From 6ee16ea2a030629eec3032c9c551f5e989f37f6f Mon Sep 17 00:00:00 2001 From: Andrea Amorese Date: Thu, 23 Sep 2021 10:05:10 +0200 Subject: [PATCH] Built motion from commit d770e63b.|2.5.35 --- apidoc/api_project.js | 2 +- apidoc/api_project.json | 2 +- server/api/action/action.attributes.js | 2 +- server/api/action/action.controller.js | 2 +- server/api/action/action.model.js | 2 +- server/api/action/action.rpc.js | 2 +- server/api/action/index.js | 2 +- .../analyticCustomReport.attributes.js | 2 +- .../analyticCustomReport.controller.js | 2 +- .../analyticCustomReport.model.js | 2 +- .../analyticCustomReport.rpc.js | 2 +- server/api/analyticCustomReport/index.js | 2 +- .../analyticDefaultReport.attributes.js | 2 +- .../analyticDefaultReport.controller.js | 2 +- .../analyticDefaultReport.model.js | 2 +- .../analyticDefaultReport.rpc.js | 2 +- server/api/analyticDefaultReport/index.js | 2 +- .../analyticExtractedReport.attributes.js | 2 +- .../analyticExtractedReport.controller.js | 2 +- .../analyticExtractedReport.model.js | 2 +- .../analyticExtractedReport.rpc.js | 2 +- server/api/analyticExtractedReport/index.js | 2 +- .../analyticFieldReport.attributes.js | 2 +- .../analyticFieldReport.controller.js | 2 +- .../analyticFieldReport.model.js | 2 +- .../analyticFieldReport/analyticFieldReport.rpc.js | 2 +- server/api/analyticFieldReport/index.js | 2 +- .../analyticMetric/analyticMetric.attributes.js | 2 +- .../analyticMetric/analyticMetric.controller.js | 2 +- server/api/analyticMetric/analyticMetric.model.js | 2 +- server/api/analyticMetric/analyticMetric.rpc.js | 2 +- server/api/analyticMetric/index.js | 2 +- .../analyticTreeReport.attributes.js | 2 +- .../analyticTreeReport.controller.js | 2 +- .../analyticTreeReport/analyticTreeReport.model.js | 2 +- .../analyticTreeReport/analyticTreeReport.rpc.js | 2 +- server/api/analyticTreeReport/index.js | 2 +- server/api/attachment/attachment.attributes.js | 2 +- server/api/attachment/attachment.controller.js | 2 +- server/api/attachment/attachment.model.js | 2 +- server/api/attachment/attachment.rpc.js | 2 +- server/api/attachment/index.js | 2 +- server/api/authGoogle/authGoogle.controller.js | 2 +- server/api/authGoogle/index.js | 2 +- server/api/authLocal/authLocal.controller.js | 2 +- server/api/authLocal/index.js | 2 +- server/api/automation/automation.attributes.js | 2 +- server/api/automation/automation.controller.js | 2 +- server/api/automation/automation.model.js | 2 +- server/api/automation/automation.rpc.js | 2 +- server/api/automation/index.js | 2 +- server/api/campaign/campaign.attributes.js | 2 +- server/api/campaign/campaign.controller.js | 2 +- server/api/campaign/campaign.model.js | 2 +- server/api/campaign/campaign.rpc.js | 2 +- server/api/campaign/index.js | 2 +- server/api/cannedAnswer/cannedAnswer.attributes.js | 2 +- server/api/cannedAnswer/cannedAnswer.controller.js | 2 +- server/api/cannedAnswer/cannedAnswer.model.js | 2 +- server/api/cannedAnswer/cannedAnswer.rpc.js | 2 +- server/api/cannedAnswer/index.js | 2 +- server/api/cdr/cdr.attributes.js | 2 +- server/api/cdr/cdr.controller.js | 2 +- server/api/cdr/cdr.model.js | 2 +- server/api/cdr/cdr.rpc.js | 2 +- server/api/cdr/index.js | 2 +- .../chatApplication/chatApplication.attributes.js | 2 +- .../chatApplication/chatApplication.controller.js | 2 +- .../api/chatApplication/chatApplication.model.js | 2 +- server/api/chatApplication/chatApplication.rpc.js | 2 +- server/api/chatApplication/index.js | 2 +- server/api/chatGroup/chatGroup.attributes.js | 2 +- server/api/chatGroup/chatGroup.controller.js | 2 +- server/api/chatGroup/chatGroup.events.js | 2 +- server/api/chatGroup/chatGroup.model.js | 2 +- server/api/chatGroup/chatGroup.rpc.js | 2 +- server/api/chatGroup/chatGroup.socket.js | 2 +- server/api/chatGroup/index.js | 2 +- .../chatInteraction/chatInteraction.attributes.js | 2 +- .../chatInteraction/chatInteraction.controller.js | 2 +- .../api/chatInteraction/chatInteraction.events.js | 2 +- .../api/chatInteraction/chatInteraction.model.js | 2 +- server/api/chatInteraction/chatInteraction.rpc.js | 2 +- .../api/chatInteraction/chatInteraction.socket.js | 2 +- server/api/chatInteraction/index.js | 2 +- .../chatInternalMessage.attributes.js | 2 +- .../chatInternalMessage.controller.js | 2 +- .../chatInternalMessage.events.js | 2 +- .../chatInternalMessage.model.js | 2 +- .../chatInternalMessage/chatInternalMessage.rpc.js | 2 +- .../chatInternalMessage.socket.js | 2 +- server/api/chatInternalMessage/index.js | 2 +- server/api/chatMessage/chatMessage.attributes.js | 2 +- server/api/chatMessage/chatMessage.controller.js | 2 +- server/api/chatMessage/chatMessage.events.js | 2 +- server/api/chatMessage/chatMessage.model.js | 2 +- server/api/chatMessage/chatMessage.rpc.js | 2 +- server/api/chatMessage/chatMessage.socket.js | 2 +- server/api/chatMessage/index.js | 2 +- .../chatOfflineMessage.attributes.js | 2 +- .../chatOfflineMessage.controller.js | 2 +- .../chatOfflineMessage/chatOfflineMessage.model.js | 2 +- .../chatOfflineMessage/chatOfflineMessage.rpc.js | 2 +- server/api/chatOfflineMessage/index.js | 2 +- .../chatProactiveAction.attributes.js | 2 +- .../chatProactiveAction.controller.js | 2 +- .../chatProactiveAction.model.js | 2 +- .../chatProactiveAction/chatProactiveAction.rpc.js | 2 +- server/api/chatProactiveAction/index.js | 2 +- server/api/chatQueue/chatQueue.attributes.js | 2 +- server/api/chatQueue/chatQueue.controller.js | 2 +- server/api/chatQueue/chatQueue.events.js | 2 +- server/api/chatQueue/chatQueue.model.js | 2 +- server/api/chatQueue/chatQueue.rpc.js | 2 +- server/api/chatQueue/chatQueue.socket.js | 2 +- server/api/chatQueue/index.js | 2 +- .../chatQueueReport/chatQueueReport.attributes.js | 2 +- .../chatQueueReport/chatQueueReport.controller.js | 2 +- .../api/chatQueueReport/chatQueueReport.model.js | 2 +- server/api/chatQueueReport/chatQueueReport.rpc.js | 2 +- server/api/chatQueueReport/index.js | 2 +- .../chatTransferReport.attributes.js | 2 +- .../chatTransferReport.controller.js | 2 +- .../chatTransferReport/chatTransferReport.model.js | 2 +- .../chatTransferReport/chatTransferReport.rpc.js | 2 +- server/api/chatTransferReport/index.js | 2 +- server/api/chatWebsite/chatWebsite.attributes.js | 2 +- server/api/chatWebsite/chatWebsite.controller.js | 2 +- server/api/chatWebsite/chatWebsite.events.js | 2 +- server/api/chatWebsite/chatWebsite.model.js | 2 +- server/api/chatWebsite/chatWebsite.rpc.js | 2 +- server/api/chatWebsite/chatWebsite.socket.js | 2 +- server/api/chatWebsite/index.js | 2 +- .../api/cloudProvider/cloudProvider.attributes.js | 2 +- .../api/cloudProvider/cloudProvider.controller.js | 2 +- server/api/cloudProvider/cloudProvider.model.js | 2 +- server/api/cloudProvider/cloudProvider.rpc.js | 2 +- server/api/cloudProvider/index.js | 2 +- server/api/cmCompany/cmCompany.attributes.js | 2 +- server/api/cmCompany/cmCompany.controller.js | 2 +- server/api/cmCompany/cmCompany.model.js | 2 +- server/api/cmCompany/cmCompany.rpc.js | 2 +- server/api/cmCompany/index.js | 2 +- server/api/cmContact/cmContact.attributes.js | 2 +- server/api/cmContact/cmContact.controller.js | 2 +- server/api/cmContact/cmContact.events.js | 2 +- server/api/cmContact/cmContact.model.js | 2 +- server/api/cmContact/cmContact.rpc.js | 2 +- server/api/cmContact/cmContact.socket.js | 2 +- server/api/cmContact/index.js | 2 +- .../api/cmCustomField/cmCustomField.attributes.js | 2 +- .../api/cmCustomField/cmCustomField.controller.js | 2 +- server/api/cmCustomField/cmCustomField.model.js | 2 +- server/api/cmCustomField/cmCustomField.rpc.js | 2 +- server/api/cmCustomField/index.js | 2 +- server/api/cmHopper/cmHopper.attributes.js | 2 +- server/api/cmHopper/cmHopper.controller.js | 2 +- server/api/cmHopper/cmHopper.model.js | 2 +- server/api/cmHopper/cmHopper.rpc.js | 2 +- server/api/cmHopper/index.js | 2 +- .../api/cmHopperBlack/cmHopperBlack.attributes.js | 2 +- .../api/cmHopperBlack/cmHopperBlack.controller.js | 2 +- server/api/cmHopperBlack/cmHopperBlack.model.js | 2 +- server/api/cmHopperBlack/cmHopperBlack.rpc.js | 2 +- server/api/cmHopperBlack/index.js | 2 +- .../api/cmHopperFinal/cmHopperFinal.attributes.js | 2 +- .../api/cmHopperFinal/cmHopperFinal.controller.js | 2 +- server/api/cmHopperFinal/cmHopperFinal.model.js | 2 +- server/api/cmHopperFinal/cmHopperFinal.rpc.js | 2 +- server/api/cmHopperFinal/index.js | 2 +- .../cmHopperHistory/cmHopperHistory.attributes.js | 2 +- .../cmHopperHistory/cmHopperHistory.controller.js | 2 +- .../api/cmHopperHistory/cmHopperHistory.model.js | 2 +- server/api/cmHopperHistory/cmHopperHistory.rpc.js | 2 +- server/api/cmHopperHistory/index.js | 2 +- server/api/cmList/cmList.attributes.js | 2 +- server/api/cmList/cmList.controller.js | 2 +- server/api/cmList/cmList.events.js | 2 +- server/api/cmList/cmList.model.js | 2 +- server/api/cmList/cmList.rpc.js | 2 +- server/api/cmList/cmList.socket.js | 2 +- server/api/cmList/index.js | 2 +- server/api/condition/condition.attributes.js | 2 +- server/api/condition/condition.controller.js | 2 +- server/api/condition/condition.model.js | 2 +- server/api/condition/condition.rpc.js | 2 +- server/api/condition/index.js | 2 +- server/api/dashboard/dashboard.attributes.js | 2 +- server/api/dashboard/dashboard.controller.js | 2 +- server/api/dashboard/dashboard.events.js | 2 +- server/api/dashboard/dashboard.model.js | 2 +- server/api/dashboard/dashboard.rpc.js | 2 +- server/api/dashboard/dashboard.socket.js | 2 +- server/api/dashboard/index.js | 2 +- .../api/dashboardItem/dashboardItem.attributes.js | 2 +- .../api/dashboardItem/dashboardItem.controller.js | 2 +- server/api/dashboardItem/dashboardItem.events.js | 2 +- server/api/dashboardItem/dashboardItem.model.js | 2 +- server/api/dashboardItem/dashboardItem.rpc.js | 2 +- server/api/dashboardItem/dashboardItem.socket.js | 2 +- server/api/dashboardItem/index.js | 2 +- server/api/disposition/disposition.attributes.js | 2 +- server/api/disposition/disposition.controller.js | 2 +- server/api/disposition/disposition.model.js | 2 +- server/api/disposition/disposition.rpc.js | 2 +- server/api/disposition/index.js | 2 +- server/api/faxAccount/faxAccount.attributes.js | 2 +- server/api/faxAccount/faxAccount.controller.js | 2 +- server/api/faxAccount/faxAccount.events.js | 2 +- server/api/faxAccount/faxAccount.model.js | 2 +- server/api/faxAccount/faxAccount.rpc.js | 2 +- server/api/faxAccount/faxAccount.socket.js | 2 +- server/api/faxAccount/index.js | 2 +- .../faxApplication/faxApplication.attributes.js | 2 +- .../faxApplication/faxApplication.controller.js | 2 +- server/api/faxApplication/faxApplication.model.js | 2 +- server/api/faxApplication/faxApplication.rpc.js | 2 +- server/api/faxApplication/index.js | 2 +- .../faxInteraction/faxInteraction.attributes.js | 2 +- .../faxInteraction/faxInteraction.controller.js | 2 +- server/api/faxInteraction/faxInteraction.events.js | 2 +- server/api/faxInteraction/faxInteraction.model.js | 2 +- server/api/faxInteraction/faxInteraction.rpc.js | 2 +- server/api/faxInteraction/faxInteraction.socket.js | 2 +- server/api/faxInteraction/index.js | 2 +- server/api/faxMessage/faxMessage.attributes.js | 2 +- server/api/faxMessage/faxMessage.controller.js | 2 +- server/api/faxMessage/faxMessage.events.js | 2 +- server/api/faxMessage/faxMessage.model.js | 2 +- server/api/faxMessage/faxMessage.rpc.js | 2 +- server/api/faxMessage/faxMessage.socket.js | 2 +- server/api/faxMessage/index.js | 2 +- server/api/faxQueue/faxQueue.attributes.js | 2 +- server/api/faxQueue/faxQueue.controller.js | 2 +- server/api/faxQueue/faxQueue.events.js | 2 +- server/api/faxQueue/faxQueue.model.js | 2 +- server/api/faxQueue/faxQueue.rpc.js | 2 +- server/api/faxQueue/faxQueue.socket.js | 2 +- server/api/faxQueue/index.js | 2 +- .../faxQueueReport/faxQueueReport.attributes.js | 2 +- .../faxQueueReport/faxQueueReport.controller.js | 2 +- server/api/faxQueueReport/faxQueueReport.model.js | 2 +- server/api/faxQueueReport/faxQueueReport.rpc.js | 2 +- server/api/faxQueueReport/index.js | 2 +- .../faxTransferReport.attributes.js | 2 +- .../faxTransferReport.controller.js | 2 +- .../faxTransferReport/faxTransferReport.model.js | 2 +- .../api/faxTransferReport/faxTransferReport.rpc.js | 2 +- server/api/faxTransferReport/index.js | 2 +- server/api/intDeskAccount/index.js | 2 +- .../intDeskAccount/intDeskAccount.attributes.js | 2 +- .../intDeskAccount/intDeskAccount.controller.js | 2 +- server/api/intDeskAccount/intDeskAccount.model.js | 2 +- server/api/intDeskAccount/intDeskAccount.rpc.js | 2 +- server/api/intDeskConfiguration/index.js | 2 +- .../intDeskConfiguration.attributes.js | 2 +- .../intDeskConfiguration.controller.js | 2 +- .../intDeskConfiguration.model.js | 2 +- .../intDeskConfiguration.rpc.js | 2 +- server/api/intDeskField/index.js | 2 +- server/api/intDeskField/intDeskField.attributes.js | 2 +- server/api/intDeskField/intDeskField.controller.js | 2 +- server/api/intDeskField/intDeskField.model.js | 2 +- server/api/intDeskField/intDeskField.rpc.js | 2 +- server/api/intDynamics365Account/index.js | 2 +- .../intDynamics365Account.attributes.js | 2 +- .../intDynamics365Account.controller.js | 2 +- .../intDynamics365Account.model.js | 2 +- .../intDynamics365Account.rpc.js | 2 +- server/api/intDynamics365Configuration/index.js | 2 +- .../intDynamics365Configuration.attributes.js | 2 +- .../intDynamics365Configuration.controller.js | 2 +- .../intDynamics365Configuration.model.js | 2 +- .../intDynamics365Configuration.rpc.js | 2 +- server/api/intDynamics365Field/index.js | 2 +- .../intDynamics365Field.attributes.js | 2 +- .../intDynamics365Field.controller.js | 2 +- .../intDynamics365Field.model.js | 2 +- .../intDynamics365Field/intDynamics365Field.rpc.js | 2 +- server/api/intFreshdeskAccount/index.js | 2 +- .../intFreshdeskAccount.attributes.js | 2 +- .../intFreshdeskAccount.controller.js | 2 +- .../intFreshdeskAccount.model.js | 2 +- .../intFreshdeskAccount/intFreshdeskAccount.rpc.js | 2 +- server/api/intFreshdeskConfiguration/index.js | 2 +- .../intFreshdeskConfiguration.attributes.js | 2 +- .../intFreshdeskConfiguration.controller.js | 2 +- .../intFreshdeskConfiguration.model.js | 2 +- .../intFreshdeskConfiguration.rpc.js | 2 +- server/api/intFreshdeskField/index.js | 2 +- .../intFreshdeskField.attributes.js | 2 +- .../intFreshdeskField.controller.js | 2 +- .../intFreshdeskField/intFreshdeskField.model.js | 2 +- .../api/intFreshdeskField/intFreshdeskField.rpc.js | 2 +- server/api/intFreshsalesAccount/index.js | 2 +- .../intFreshsalesAccount.attributes.js | 2 +- .../intFreshsalesAccount.controller.js | 2 +- .../intFreshsalesAccount.model.js | 2 +- .../intFreshsalesAccount.rpc.js | 2 +- server/api/intFreshsalesConfiguration/index.js | 2 +- .../intFreshsalesConfiguration.attributes.js | 2 +- .../intFreshsalesConfiguration.controller.js | 2 +- .../intFreshsalesConfiguration.model.js | 2 +- .../intFreshsalesConfiguration.rpc.js | 2 +- server/api/intFreshsalesField/index.js | 2 +- .../intFreshsalesField.attributes.js | 2 +- .../intFreshsalesField.controller.js | 2 +- .../intFreshsalesField/intFreshsalesField.model.js | 2 +- .../intFreshsalesField/intFreshsalesField.rpc.js | 2 +- server/api/intSalesforceAccount/index.js | 2 +- .../intSalesforceAccount.attributes.js | 2 +- .../intSalesforceAccount.controller.js | 2 +- .../intSalesforceAccount.model.js | 2 +- .../intSalesforceAccount.rpc.js | 2 +- server/api/intSalesforceConfiguration/index.js | 2 +- .../intSalesforceConfiguration.attributes.js | 2 +- .../intSalesforceConfiguration.controller.js | 2 +- .../intSalesforceConfiguration.model.js | 2 +- .../intSalesforceConfiguration.rpc.js | 2 +- server/api/intSalesforceField/index.js | 2 +- .../intSalesforceField.attributes.js | 2 +- .../intSalesforceField.controller.js | 2 +- .../intSalesforceField/intSalesforceField.model.js | 2 +- .../intSalesforceField/intSalesforceField.rpc.js | 2 +- server/api/intServicenowAccount/index.js | 2 +- .../intServicenowAccount.attributes.js | 2 +- .../intServicenowAccount.controller.js | 2 +- .../intServicenowAccount.model.js | 2 +- .../intServicenowAccount.rpc.js | 2 +- server/api/intServicenowConfiguration/index.js | 2 +- .../intServicenowConfiguration.attributes.js | 2 +- .../intServicenowConfiguration.controller.js | 2 +- .../intServicenowConfiguration.model.js | 2 +- .../intServicenowConfiguration.rpc.js | 2 +- server/api/intServicenowField/index.js | 2 +- .../intServicenowField.attributes.js | 2 +- .../intServicenowField.controller.js | 2 +- .../intServicenowField/intServicenowField.model.js | 2 +- .../intServicenowField/intServicenowField.rpc.js | 2 +- server/api/intSugarcrmAccount/index.js | 2 +- .../intSugarcrmAccount.attributes.js | 2 +- .../intSugarcrmAccount.controller.js | 2 +- .../intSugarcrmAccount/intSugarcrmAccount.model.js | 2 +- .../intSugarcrmAccount/intSugarcrmAccount.rpc.js | 2 +- server/api/intSugarcrmConfiguration/index.js | 2 +- .../intSugarcrmConfiguration.attributes.js | 2 +- .../intSugarcrmConfiguration.controller.js | 2 +- .../intSugarcrmConfiguration.model.js | 2 +- .../intSugarcrmConfiguration.rpc.js | 2 +- server/api/intSugarcrmField/index.js | 2 +- .../intSugarcrmField.attributes.js | 2 +- .../intSugarcrmField.controller.js | 2 +- .../api/intSugarcrmField/intSugarcrmField.model.js | 2 +- .../api/intSugarcrmField/intSugarcrmField.rpc.js | 2 +- server/api/intVtigerAccount/index.js | 2 +- .../intVtigerAccount.attributes.js | 2 +- .../intVtigerAccount.controller.js | 2 +- .../api/intVtigerAccount/intVtigerAccount.model.js | 2 +- .../api/intVtigerAccount/intVtigerAccount.rpc.js | 2 +- server/api/intVtigerConfiguration/index.js | 2 +- .../intVtigerConfiguration.attributes.js | 2 +- .../intVtigerConfiguration.controller.js | 2 +- .../intVtigerConfiguration.model.js | 2 +- .../intVtigerConfiguration.rpc.js | 2 +- server/api/intVtigerField/index.js | 2 +- .../intVtigerField/intVtigerField.attributes.js | 2 +- .../intVtigerField/intVtigerField.controller.js | 2 +- server/api/intVtigerField/intVtigerField.model.js | 2 +- server/api/intVtigerField/intVtigerField.rpc.js | 2 +- server/api/intZendeskAccount/index.js | 2 +- .../intZendeskAccount.attributes.js | 2 +- .../intZendeskAccount.controller.js | 2 +- .../intZendeskAccount/intZendeskAccount.model.js | 2 +- .../api/intZendeskAccount/intZendeskAccount.rpc.js | 2 +- server/api/intZendeskConfiguration/index.js | 2 +- .../intZendeskConfiguration.attributes.js | 2 +- .../intZendeskConfiguration.controller.js | 2 +- .../intZendeskConfiguration.model.js | 2 +- .../intZendeskConfiguration.rpc.js | 2 +- server/api/intZendeskField/index.js | 2 +- .../intZendeskField/intZendeskField.attributes.js | 2 +- .../intZendeskField/intZendeskField.controller.js | 2 +- .../api/intZendeskField/intZendeskField.model.js | 2 +- server/api/intZendeskField/intZendeskField.rpc.js | 2 +- server/api/intZohoAccount/index.js | 2 +- .../intZohoAccount/intZohoAccount.attributes.js | 2 +- .../intZohoAccount/intZohoAccount.controller.js | 2 +- server/api/intZohoAccount/intZohoAccount.model.js | 2 +- server/api/intZohoAccount/intZohoAccount.rpc.js | 2 +- server/api/intZohoConfiguration/index.js | 2 +- .../intZohoConfiguration.attributes.js | 2 +- .../intZohoConfiguration.controller.js | 2 +- .../intZohoConfiguration.model.js | 2 +- .../intZohoConfiguration.rpc.js | 2 +- server/api/intZohoField/index.js | 2 +- server/api/intZohoField/intZohoField.attributes.js | 2 +- server/api/intZohoField/intZohoField.controller.js | 2 +- server/api/intZohoField/intZohoField.model.js | 2 +- server/api/intZohoField/intZohoField.rpc.js | 2 +- server/api/integration/index.js | 2 +- server/api/integration/integration.attributes.js | 2 +- server/api/integration/integration.controller.js | 2 +- server/api/integration/integration.model.js | 2 +- server/api/integration/integration.rpc.js | 2 +- server/api/integrationReport/index.js | 2 +- .../integrationReport.attributes.js | 2 +- .../integrationReport.controller.js | 2 +- .../integrationReport/integrationReport.model.js | 2 +- .../api/integrationReport/integrationReport.rpc.js | 2 +- server/api/interval/index.js | 2 +- server/api/interval/interval.attributes.js | 2 +- server/api/interval/interval.controller.js | 2 +- server/api/interval/interval.model.js | 2 +- server/api/interval/interval.rpc.js | 2 +- server/api/jira/index.js | 2 +- server/api/jira/jira.controller.js | 2 +- server/api/jscriptyAnswerReport/index.js | 2 +- .../jscriptyAnswerReport.attributes.js | 2 +- .../jscriptyAnswerReport.controller.js | 2 +- .../jscriptyAnswerReport.model.js | 2 +- .../jscriptyAnswerReport.rpc.js | 2 +- server/api/jscriptyProject/index.js | 2 +- .../jscriptyProject/jscriptyProject.attributes.js | 2 +- .../jscriptyProject/jscriptyProject.controller.js | 2 +- .../api/jscriptyProject/jscriptyProject.model.js | 2 +- server/api/jscriptyProject/jscriptyProject.rpc.js | 2 +- server/api/jscriptyQuestionReport/index.js | 2 +- .../jscriptyQuestionReport.attributes.js | 2 +- .../jscriptyQuestionReport.controller.js | 2 +- .../jscriptyQuestionReport.model.js | 2 +- .../jscriptyQuestionReport.rpc.js | 2 +- server/api/jscriptySessionReport/index.js | 2 +- .../jscriptySessionReport.attributes.js | 2 +- .../jscriptySessionReport.controller.js | 2 +- .../jscriptySessionReport.model.js | 2 +- .../jscriptySessionReport.rpc.js | 2 +- server/api/license/index.js | 2 +- server/api/license/license.attributes.js | 2 +- server/api/license/license.controller.js | 2 +- server/api/license/license.model.js | 2 +- server/api/license/license.rpc.js | 2 +- server/api/mailAccount/index.js | 2 +- server/api/mailAccount/mailAccount.attributes.js | 2 +- server/api/mailAccount/mailAccount.controller.js | 2 +- server/api/mailAccount/mailAccount.events.js | 2 +- server/api/mailAccount/mailAccount.model.js | 2 +- server/api/mailAccount/mailAccount.rpc.js | 2 +- server/api/mailAccount/mailAccount.socket.js | 2 +- server/api/mailApplication/index.js | 2 +- .../mailApplication/mailApplication.attributes.js | 2 +- .../mailApplication/mailApplication.controller.js | 2 +- .../api/mailApplication/mailApplication.model.js | 2 +- server/api/mailApplication/mailApplication.rpc.js | 2 +- server/api/mailInteraction/index.js | 2 +- .../mailInteraction/mailInteraction.attributes.js | 2 +- .../mailInteraction/mailInteraction.controller.js | 2 +- .../api/mailInteraction/mailInteraction.events.js | 2 +- .../api/mailInteraction/mailInteraction.model.js | 2 +- server/api/mailInteraction/mailInteraction.rpc.js | 2 +- .../api/mailInteraction/mailInteraction.socket.js | 2 +- server/api/mailMessage/index.js | 2 +- server/api/mailMessage/mailMessage.attributes.js | 2 +- server/api/mailMessage/mailMessage.controller.js | 2 +- server/api/mailMessage/mailMessage.events.js | 2 +- server/api/mailMessage/mailMessage.model.js | 2 +- server/api/mailMessage/mailMessage.rpc.js | 2 +- server/api/mailMessage/mailMessage.socket.js | 2 +- server/api/mailQueue/index.js | 2 +- server/api/mailQueue/mailQueue.attributes.js | 2 +- server/api/mailQueue/mailQueue.controller.js | 2 +- server/api/mailQueue/mailQueue.events.js | 2 +- server/api/mailQueue/mailQueue.model.js | 2 +- server/api/mailQueue/mailQueue.rpc.js | 2 +- server/api/mailQueue/mailQueue.socket.js | 2 +- server/api/mailQueueReport/index.js | 2 +- .../mailQueueReport/mailQueueReport.attributes.js | 2 +- .../mailQueueReport/mailQueueReport.controller.js | 2 +- .../api/mailQueueReport/mailQueueReport.model.js | 2 +- server/api/mailQueueReport/mailQueueReport.rpc.js | 2 +- server/api/mailServerIn/index.js | 2 +- server/api/mailServerIn/mailServerIn.attributes.js | 2 +- server/api/mailServerIn/mailServerIn.model.js | 2 +- server/api/mailServerIn/mailServerIn.rpc.js | 2 +- server/api/mailServerOut/index.js | 2 +- .../api/mailServerOut/mailServerOut.attributes.js | 2 +- .../api/mailServerOut/mailServerOut.controller.js | 2 +- server/api/mailServerOut/mailServerOut.model.js | 2 +- server/api/mailServerOut/mailServerOut.rpc.js | 2 +- server/api/mailSubstatus/index.js | 2 +- .../api/mailSubstatus/mailSubstatus.attributes.js | 2 +- .../api/mailSubstatus/mailSubstatus.controller.js | 2 +- server/api/mailSubstatus/mailSubstatus.events.js | 2 +- server/api/mailSubstatus/mailSubstatus.model.js | 2 +- server/api/mailSubstatus/mailSubstatus.rpc.js | 2 +- server/api/mailTransferReport/index.js | 2 +- .../mailTransferReport.attributes.js | 2 +- .../mailTransferReport.controller.js | 2 +- .../mailTransferReport/mailTransferReport.model.js | 2 +- .../mailTransferReport/mailTransferReport.rpc.js | 2 +- server/api/memberReport/index.js | 2 +- server/api/memberReport/memberReport.attributes.js | 2 +- server/api/memberReport/memberReport.controller.js | 2 +- server/api/memberReport/memberReport.model.js | 2 +- server/api/memberReport/memberReport.rpc.js | 2 +- server/api/migration/index.js | 2 +- server/api/migration/migration.attributes.js | 2 +- server/api/migration/migration.controller.js | 2 +- server/api/migration/migration.model.js | 2 +- server/api/migration/migration.rpc.js | 2 +- server/api/network/index.js | 2 +- server/api/network/network.attributes.js | 2 +- server/api/network/network.controller.js | 2 +- server/api/network/network.model.js | 2 +- server/api/network/network.rpc.js | 2 +- server/api/openchannelAccount/index.js | 2 +- .../openchannelAccount.attributes.js | 2 +- .../openchannelAccount.controller.js | 2 +- .../openchannelAccount.events.js | 2 +- .../openchannelAccount/openchannelAccount.model.js | 2 +- .../openchannelAccount/openchannelAccount.rpc.js | 2 +- .../openchannelAccount.socket.js | 2 +- server/api/openchannelApplication/index.js | 2 +- .../openchannelApplication.attributes.js | 2 +- .../openchannelApplication.controller.js | 2 +- .../openchannelApplication.model.js | 2 +- .../openchannelApplication.rpc.js | 2 +- server/api/openchannelInteraction/index.js | 2 +- .../openchannelInteraction.attributes.js | 2 +- .../openchannelInteraction.controller.js | 2 +- .../openchannelInteraction.events.js | 2 +- .../openchannelInteraction.model.js | 2 +- .../openchannelInteraction.rpc.js | 2 +- .../openchannelInteraction.socket.js | 2 +- server/api/openchannelMessage/index.js | 2 +- .../openchannelMessage.attributes.js | 2 +- .../openchannelMessage.controller.js | 2 +- .../openchannelMessage.events.js | 2 +- .../openchannelMessage/openchannelMessage.model.js | 2 +- .../openchannelMessage/openchannelMessage.rpc.js | 2 +- .../openchannelMessage.socket.js | 2 +- server/api/openchannelQueue/index.js | 2 +- .../openchannelQueue.attributes.js | 2 +- .../openchannelQueue.controller.js | 2 +- .../openchannelQueue/openchannelQueue.events.js | 2 +- .../api/openchannelQueue/openchannelQueue.model.js | 2 +- .../api/openchannelQueue/openchannelQueue.rpc.js | 2 +- .../openchannelQueue/openchannelQueue.socket.js | 2 +- server/api/openchannelQueueReport/index.js | 2 +- .../openchannelQueueReport.attributes.js | 2 +- .../openchannelQueueReport.controller.js | 2 +- .../openchannelQueueReport.model.js | 2 +- .../openchannelQueueReport.rpc.js | 2 +- server/api/openchannelTransferReport/index.js | 2 +- .../openchannelTransferReport.attributes.js | 2 +- .../openchannelTransferReport.controller.js | 2 +- .../openchannelTransferReport.model.js | 2 +- .../openchannelTransferReport.rpc.js | 2 +- server/api/pause/index.js | 2 +- server/api/pause/pause.attributes.js | 2 +- server/api/pause/pause.controller.js | 2 +- server/api/pause/pause.model.js | 2 +- server/api/pause/pause.rpc.js | 2 +- server/api/plugin/index.js | 2 +- server/api/plugin/plugin.attributes.js | 2 +- server/api/plugin/plugin.controller.js | 2 +- server/api/plugin/plugin.events.js | 2 +- server/api/plugin/plugin.model.js | 2 +- server/api/plugin/plugin.rpc.js | 2 +- server/api/plugin/plugin.socket.js | 2 +- server/api/pm2/index.js | 2 +- server/api/pm2/pm2.controller.js | 2 +- server/api/realtime/index.js | 2 +- server/api/realtime/realtime.controller.js | 2 +- server/api/reportAgentPreview/index.js | 2 +- .../reportAgentPreview.attributes.js | 2 +- .../reportAgentPreview/reportAgentPreview.model.js | 2 +- .../reportAgentPreview/reportAgentPreview.rpc.js | 2 +- server/api/rpc/index.js | 2 +- server/api/rpc/rpc.controller.js | 2 +- server/api/schedule/index.js | 2 +- server/api/schedule/schedule.attributes.js | 2 +- server/api/schedule/schedule.controller.js | 2 +- server/api/schedule/schedule.model.js | 2 +- server/api/schedule/schedule.rpc.js | 2 +- server/api/screenRecording/index.js | 2 +- .../screenRecording/screenRecording.attributes.js | 2 +- .../screenRecording/screenRecording.controller.js | 2 +- .../api/screenRecording/screenRecording.model.js | 2 +- server/api/screenRecording/screenRecording.rpc.js | 2 +- server/api/setting/index.js | 2 +- server/api/setting/setting.attributes.js | 2 +- server/api/setting/setting.controller.js | 2 +- server/api/setting/setting.model.js | 2 +- server/api/setting/setting.rpc.js | 2 +- server/api/smsAccount/index.js | 2 +- server/api/smsAccount/smsAccount.attributes.js | 2 +- server/api/smsAccount/smsAccount.controller.js | 2 +- server/api/smsAccount/smsAccount.events.js | 2 +- server/api/smsAccount/smsAccount.model.js | 2 +- server/api/smsAccount/smsAccount.rpc.js | 2 +- server/api/smsAccount/smsAccount.socket.js | 2 +- server/api/smsApplication/index.js | 2 +- .../smsApplication/smsApplication.attributes.js | 2 +- .../smsApplication/smsApplication.controller.js | 2 +- server/api/smsApplication/smsApplication.model.js | 2 +- server/api/smsApplication/smsApplication.rpc.js | 2 +- server/api/smsInteraction/index.js | 2 +- .../smsInteraction/smsInteraction.attributes.js | 2 +- .../smsInteraction/smsInteraction.controller.js | 2 +- server/api/smsInteraction/smsInteraction.events.js | 2 +- server/api/smsInteraction/smsInteraction.model.js | 2 +- server/api/smsInteraction/smsInteraction.rpc.js | 2 +- server/api/smsInteraction/smsInteraction.socket.js | 2 +- server/api/smsMessage/index.js | 2 +- server/api/smsMessage/smsMessage.attributes.js | 2 +- server/api/smsMessage/smsMessage.controller.js | 2 +- server/api/smsMessage/smsMessage.events.js | 2 +- server/api/smsMessage/smsMessage.model.js | 2 +- server/api/smsMessage/smsMessage.rpc.js | 2 +- server/api/smsMessage/smsMessage.socket.js | 2 +- server/api/smsQueue/index.js | 2 +- server/api/smsQueue/smsQueue.attributes.js | 2 +- server/api/smsQueue/smsQueue.controller.js | 2 +- server/api/smsQueue/smsQueue.events.js | 2 +- server/api/smsQueue/smsQueue.model.js | 2 +- server/api/smsQueue/smsQueue.rpc.js | 2 +- server/api/smsQueue/smsQueue.socket.js | 2 +- server/api/smsQueueReport/index.js | 2 +- .../smsQueueReport/smsQueueReport.attributes.js | 2 +- .../smsQueueReport/smsQueueReport.controller.js | 2 +- server/api/smsQueueReport/smsQueueReport.model.js | 2 +- server/api/smsQueueReport/smsQueueReport.rpc.js | 2 +- server/api/smsTransferReport/index.js | 2 +- .../smsTransferReport.attributes.js | 2 +- .../smsTransferReport.controller.js | 2 +- .../smsTransferReport/smsTransferReport.model.js | 2 +- .../api/smsTransferReport/smsTransferReport.rpc.js | 2 +- server/api/sound/index.js | 2 +- server/api/sound/sound.attributes.js | 2 +- server/api/sound/sound.controller.js | 2 +- server/api/sound/sound.model.js | 2 +- server/api/sound/sound.rpc.js | 2 +- server/api/squareMessage/index.js | 2 +- .../api/squareMessage/squareMessage.attributes.js | 2 +- .../api/squareMessage/squareMessage.controller.js | 2 +- server/api/squareMessage/squareMessage.model.js | 2 +- server/api/squareMessage/squareMessage.rpc.js | 2 +- server/api/squareOdbc/index.js | 2 +- server/api/squareOdbc/squareOdbc.attributes.js | 2 +- server/api/squareOdbc/squareOdbc.controller.js | 2 +- server/api/squareOdbc/squareOdbc.model.js | 2 +- server/api/squareOdbc/squareOdbc.rpc.js | 2 +- server/api/squareProject/index.js | 2 +- .../api/squareProject/squareProject.attributes.js | 2 +- .../api/squareProject/squareProject.controller.js | 2 +- server/api/squareProject/squareProject.events.js | 2 +- server/api/squareProject/squareProject.model.js | 2 +- server/api/squareProject/squareProject.rpc.js | 2 +- server/api/squareProject/squareProject.socket.js | 2 +- server/api/squareRecording/index.js | 2 +- .../squareRecording/squareRecording.attributes.js | 2 +- .../squareRecording/squareRecording.controller.js | 2 +- .../api/squareRecording/squareRecording.model.js | 2 +- server/api/squareRecording/squareRecording.rpc.js | 2 +- server/api/squareReport/index.js | 2 +- server/api/squareReport/squareReport.attributes.js | 2 +- server/api/squareReport/squareReport.controller.js | 2 +- server/api/squareReport/squareReport.model.js | 2 +- server/api/squareReport/squareReport.rpc.js | 2 +- server/api/squareReportDetail/index.js | 2 +- .../squareReportDetail.attributes.js | 2 +- .../squareReportDetail.controller.js | 2 +- .../squareReportDetail/squareReportDetail.model.js | 2 +- .../squareReportDetail/squareReportDetail.rpc.js | 2 +- server/api/system/index.js | 2 +- server/api/system/system.controller.js | 2 +- server/api/tag/index.js | 2 +- server/api/tag/tag.attributes.js | 2 +- server/api/tag/tag.controller.js | 2 +- server/api/tag/tag.model.js | 2 +- server/api/tag/tag.rpc.js | 2 +- server/api/team/index.js | 2 +- server/api/team/team.attributes.js | 2 +- server/api/team/team.controller.js | 2 +- server/api/team/team.events.js | 2 +- server/api/team/team.model.js | 2 +- server/api/team/team.rpc.js | 2 +- server/api/team/team.socket.js | 2 +- .../teamVoicePrefix/teamVoicePrefix.attributes.js | 2 +- .../api/teamVoicePrefix/teamVoicePrefix.model.js | 2 +- server/api/teamVoiceQueue/index.js | 2 +- .../teamVoiceQueue/teamVoiceQueue.attributes.js | 2 +- server/api/teamVoiceQueue/teamVoiceQueue.model.js | 2 +- server/api/teamVoiceQueue/teamVoiceQueue.rpc.js | 2 +- server/api/template/index.js | 2 +- server/api/template/template.attributes.js | 2 +- server/api/template/template.controller.js | 2 +- server/api/template/template.model.js | 2 +- server/api/template/template.rpc.js | 2 +- server/api/trigger/index.js | 2 +- server/api/trigger/trigger.attributes.js | 2 +- server/api/trigger/trigger.controller.js | 2 +- server/api/trigger/trigger.model.js | 2 +- server/api/trigger/trigger.rpc.js | 2 +- server/api/trunk/index.js | 2 +- server/api/trunk/trunk.attributes.js | 2 +- server/api/trunk/trunk.controller.js | 2 +- server/api/trunk/trunk.model.js | 2 +- server/api/trunk/trunk.rpc.js | 2 +- server/api/user/index.js | 2 +- server/api/user/user.attributes.js | 2 +- server/api/user/user.controller.js | 2 +- server/api/user/user.events.js | 2 +- server/api/user/user.model.js | 2 +- server/api/user/user.rpc.js | 2 +- server/api/user/user.socket.js | 2 +- server/api/userChatQueue/index.js | 2 +- .../api/userChatQueue/userChatQueue.attributes.js | 2 +- server/api/userChatQueue/userChatQueue.model.js | 2 +- server/api/userChatQueue/userChatQueue.rpc.js | 2 +- server/api/userFaxQueue/index.js | 2 +- server/api/userFaxQueue/userFaxQueue.attributes.js | 2 +- server/api/userFaxQueue/userFaxQueue.model.js | 2 +- server/api/userFaxQueue/userFaxQueue.rpc.js | 2 +- server/api/userMailQueue/index.js | 2 +- .../api/userMailQueue/userMailQueue.attributes.js | 2 +- server/api/userMailQueue/userMailQueue.model.js | 2 +- server/api/userMailQueue/userMailQueue.rpc.js | 2 +- server/api/userNotification/index.js | 2 +- .../userNotification.attributes.js | 2 +- .../userNotification.controller.js | 2 +- .../userNotification/userNotification.events.js | 2 +- .../api/userNotification/userNotification.model.js | 2 +- .../api/userNotification/userNotification.rpc.js | 2 +- .../userNotification/userNotification.socket.js | 2 +- server/api/userOpenchannelQueue/index.js | 2 +- .../userOpenchannelQueue.attributes.js | 2 +- .../userOpenchannelQueue.model.js | 2 +- .../userOpenchannelQueue.rpc.js | 2 +- server/api/userProfile/index.js | 2 +- server/api/userProfile/userProfile.attributes.js | 2 +- server/api/userProfile/userProfile.controller.js | 2 +- server/api/userProfile/userProfile.events.js | 2 +- server/api/userProfile/userProfile.model.js | 2 +- server/api/userProfile/userProfile.rpc.js | 2 +- server/api/userProfile/userProfile.socket.js | 2 +- server/api/userProfileResource/index.js | 2 +- .../userProfileResource.attributes.js | 2 +- .../userProfileResource.controller.js | 2 +- .../userProfileResource.model.js | 2 +- .../userProfileResource/userProfileResource.rpc.js | 2 +- server/api/userProfileSection/index.js | 2 +- .../userProfileSection.attributes.js | 2 +- .../userProfileSection.controller.js | 2 +- .../userProfileSection/userProfileSection.model.js | 2 +- .../userProfileSection/userProfileSection.rpc.js | 2 +- server/api/userSmsQueue/index.js | 2 +- server/api/userSmsQueue/userSmsQueue.attributes.js | 2 +- server/api/userSmsQueue/userSmsQueue.model.js | 2 +- server/api/userSmsQueue/userSmsQueue.rpc.js | 2 +- .../userVoicePrefix/userVoicePrefix.attributes.js | 2 +- .../api/userVoicePrefix/userVoicePrefix.model.js | 2 +- server/api/userVoiceQueue/index.js | 2 +- .../userVoiceQueue/userVoiceQueue.attributes.js | 2 +- server/api/userVoiceQueue/userVoiceQueue.model.js | 2 +- server/api/userVoiceQueue/userVoiceQueue.rpc.js | 2 +- server/api/userVoiceQueueRt/index.js | 2 +- .../userVoiceQueueRt.attributes.js | 2 +- .../userVoiceQueueRt/userVoiceQueueRt.events.js | 2 +- .../api/userVoiceQueueRt/userVoiceQueueRt.model.js | 2 +- .../api/userVoiceQueueRt/userVoiceQueueRt.rpc.js | 2 +- .../userVoiceQueueRt/userVoiceQueueRt.socket.js | 2 +- server/api/userWhatsappQueue/index.js | 2 +- .../userWhatsappQueue.attributes.js | 2 +- .../userWhatsappQueue/userWhatsappQueue.model.js | 2 +- .../api/userWhatsappQueue/userWhatsappQueue.rpc.js | 2 +- server/api/variable/index.js | 2 +- server/api/variable/variable.attributes.js | 2 +- server/api/variable/variable.controller.js | 2 +- server/api/variable/variable.model.js | 2 +- server/api/variable/variable.rpc.js | 2 +- server/api/version/index.js | 2 +- server/api/version/version.controller.js | 2 +- server/api/voiceAgentReport/index.js | 2 +- .../voiceAgentReport.attributes.js | 2 +- .../voiceAgentReport.controller.js | 2 +- .../api/voiceAgentReport/voiceAgentReport.model.js | 2 +- .../api/voiceAgentReport/voiceAgentReport.rpc.js | 2 +- server/api/voiceCallReport/index.js | 2 +- .../voiceCallReport/voiceCallReport.attributes.js | 2 +- .../voiceCallReport/voiceCallReport.controller.js | 2 +- .../api/voiceCallReport/voiceCallReport.model.js | 2 +- server/api/voiceCallReport/voiceCallReport.rpc.js | 2 +- server/api/voiceChanSpy/index.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.attributes.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.controller.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.model.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.rpc.js | 2 +- server/api/voiceContext/index.js | 2 +- server/api/voiceContext/voiceContext.attributes.js | 2 +- server/api/voiceContext/voiceContext.controller.js | 2 +- server/api/voiceContext/voiceContext.model.js | 2 +- server/api/voiceContext/voiceContext.rpc.js | 2 +- server/api/voiceDialReport/index.js | 2 +- .../voiceDialReport/voiceDialReport.attributes.js | 2 +- .../voiceDialReport/voiceDialReport.controller.js | 2 +- .../api/voiceDialReport/voiceDialReport.model.js | 2 +- server/api/voiceDialReport/voiceDialReport.rpc.js | 2 +- server/api/voiceExtension/index.js | 2 +- .../voiceExtension/voiceExtension.attributes.js | 2 +- .../voiceExtension/voiceExtension.controller.js | 2 +- server/api/voiceExtension/voiceExtension.events.js | 2 +- server/api/voiceExtension/voiceExtension.model.js | 2 +- server/api/voiceExtension/voiceExtension.rpc.js | 2 +- server/api/voiceExtension/voiceExtension.socket.js | 2 +- server/api/voiceMail/index.js | 2 +- server/api/voiceMail/voiceMail.attributes.js | 2 +- server/api/voiceMail/voiceMail.controller.js | 2 +- server/api/voiceMail/voiceMail.model.js | 2 +- server/api/voiceMail/voiceMail.rpc.js | 2 +- server/api/voiceMailMessage/index.js | 2 +- .../voiceMailMessage.attributes.js | 2 +- .../voiceMailMessage.controller.js | 2 +- .../api/voiceMailMessage/voiceMailMessage.model.js | 2 +- .../api/voiceMailMessage/voiceMailMessage.rpc.js | 2 +- server/api/voiceMusicOnHold/index.js | 2 +- .../voiceMusicOnHold.attributes.js | 2 +- .../voiceMusicOnHold.controller.js | 2 +- .../api/voiceMusicOnHold/voiceMusicOnHold.model.js | 2 +- .../api/voiceMusicOnHold/voiceMusicOnHold.rpc.js | 2 +- server/api/voicePrefix/index.js | 2 +- server/api/voicePrefix/voicePrefix.attributes.js | 2 +- server/api/voicePrefix/voicePrefix.controller.js | 2 +- server/api/voicePrefix/voicePrefix.events.js | 2 +- server/api/voicePrefix/voicePrefix.model.js | 2 +- server/api/voicePrefix/voicePrefix.rpc.js | 2 +- server/api/voicePrefix/voicePrefix.socket.js | 2 +- server/api/voiceQueue/index.js | 2 +- server/api/voiceQueue/voiceQueue.attributes.js | 2 +- server/api/voiceQueue/voiceQueue.controller.js | 2 +- server/api/voiceQueue/voiceQueue.events.js | 2 +- server/api/voiceQueue/voiceQueue.model.js | 2 +- server/api/voiceQueue/voiceQueue.rpc.js | 2 +- server/api/voiceQueue/voiceQueue.socket.js | 2 +- server/api/voiceQueueReport/index.js | 2 +- .../voiceQueueReport.attributes.js | 2 +- .../voiceQueueReport.controller.js | 2 +- .../voiceQueueReport/voiceQueueReport.events.js | 2 +- .../api/voiceQueueReport/voiceQueueReport.model.js | 2 +- .../api/voiceQueueReport/voiceQueueReport.rpc.js | 2 +- .../voiceQueueReport/voiceQueueReport.socket.js | 2 +- server/api/voiceQueuesLog/index.js | 2 +- .../voiceQueuesLog/voiceQueuesLog.attributes.js | 2 +- .../voiceQueuesLog/voiceQueuesLog.controller.js | 2 +- server/api/voiceQueuesLog/voiceQueuesLog.model.js | 2 +- server/api/voiceQueuesLog/voiceQueuesLog.rpc.js | 2 +- server/api/voiceRecording/index.js | 2 +- .../voiceRecording/voiceRecording.attributes.js | 2 +- .../voiceRecording/voiceRecording.controller.js | 2 +- server/api/voiceRecording/voiceRecording.model.js | 2 +- server/api/voiceRecording/voiceRecording.rpc.js | 2 +- server/api/voiceTransferReport/index.js | 2 +- .../voiceTransferReport.attributes.js | 2 +- .../voiceTransferReport.controller.js | 2 +- .../voiceTransferReport.model.js | 2 +- .../voiceTransferReport/voiceTransferReport.rpc.js | 2 +- server/api/webbar/index.js | 2 +- server/api/webbar/webbar.controller.js | 2 +- server/api/whatsappAccount/index.js | 2 +- .../whatsappAccount/whatsappAccount.attributes.js | 2 +- .../whatsappAccount/whatsappAccount.controller.js | 2 +- .../api/whatsappAccount/whatsappAccount.events.js | 2 +- .../api/whatsappAccount/whatsappAccount.model.js | 2 +- server/api/whatsappAccount/whatsappAccount.rpc.js | 2 +- .../api/whatsappAccount/whatsappAccount.socket.js | 2 +- server/api/whatsappApplication/index.js | 2 +- .../whatsappApplication.attributes.js | 2 +- .../whatsappApplication.controller.js | 2 +- .../whatsappApplication.model.js | 2 +- .../whatsappApplication/whatsappApplication.rpc.js | 2 +- server/api/whatsappInteraction/index.js | 2 +- .../whatsappInteraction.attributes.js | 2 +- .../whatsappInteraction.controller.js | 2 +- .../whatsappInteraction.events.js | 2 +- .../whatsappInteraction.model.js | 2 +- .../whatsappInteraction/whatsappInteraction.rpc.js | 2 +- .../whatsappInteraction.socket.js | 2 +- server/api/whatsappMessage/index.js | 2 +- .../whatsappMessage/whatsappMessage.attributes.js | 2 +- .../whatsappMessage/whatsappMessage.controller.js | 2 +- .../api/whatsappMessage/whatsappMessage.events.js | 2 +- .../api/whatsappMessage/whatsappMessage.model.js | 2 +- server/api/whatsappMessage/whatsappMessage.rpc.js | 2 +- .../api/whatsappMessage/whatsappMessage.socket.js | 2 +- server/api/whatsappQueue/index.js | 2 +- .../api/whatsappQueue/whatsappQueue.attributes.js | 2 +- .../api/whatsappQueue/whatsappQueue.controller.js | 2 +- server/api/whatsappQueue/whatsappQueue.events.js | 2 +- server/api/whatsappQueue/whatsappQueue.model.js | 2 +- server/api/whatsappQueue/whatsappQueue.rpc.js | 2 +- server/api/whatsappQueue/whatsappQueue.socket.js | 2 +- server/api/whatsappQueueReport/index.js | 2 +- .../whatsappQueueReport.attributes.js | 2 +- .../whatsappQueueReport.controller.js | 2 +- .../whatsappQueueReport.model.js | 2 +- .../whatsappQueueReport/whatsappQueueReport.rpc.js | 2 +- server/api/whatsappTransferReport/index.js | 2 +- .../whatsappTransferReport.attributes.js | 2 +- .../whatsappTransferReport.controller.js | 2 +- .../whatsappTransferReport.model.js | 2 +- .../whatsappTransferReport.rpc.js | 2 +- server/app.js | 2 +- server/components/auth/service.js | 2 +- server/components/encryptor/index.js | 2 +- server/components/export/csv.js | 2 +- server/components/export/pdf.js | 2 +- server/components/export/xlsx.js | 2 +- server/components/extensions/rewrite.js | 2 +- server/components/import/cm/csv.js | 2 +- server/components/import/cm/csv2.js | 2 +- server/components/integrations/configuration.js | 2 +- server/components/interaction/service.js | 2 +- server/components/license/service.js | 2 +- server/components/parsers/advancedSearch.js | 2 +- server/components/parsers/qs.js | 2 +- server/config/express.js | 2 +- server/config/license/hardware.js | 2 +- server/config/license/index.js | 2 +- server/config/license/util.js | 2 +- server/config/local.env.js | 2 +- server/config/logger.js | 2 +- server/config/pm2/config.js | 2 +- server/config/pm2/index.js | 2 +- server/config/schedule/chat.js | 2 +- server/config/schedule/index.js | 2 +- server/config/schedule/transcribe.js | 2 +- server/config/schedule/whatsapp.js | 2 +- server/config/seedContact.js | 2 +- server/config/seedUsers.js | 2 +- server/config/socketio.js | 2 +- server/config/triggers/index.js | 2 +- server/config/utils.js | 2 +- server/errors/index.js | 2 +- server/mysqldb/index.js | 2 +- server/routes.js | 2 +- server/rpc/index.js | 2 +- server/services/agi/channel.js | 2 +- server/services/agi/error.js | 2 +- server/services/agi/graph/index.js | 2 +- server/services/agi/index.js | 2 +- server/services/agi/mailRpc/index.js | 2 +- server/services/agi/reply.js | 2 +- server/services/agi/rpc/index.js | 2 +- server/services/agi/scripts/aws/index.js | 2 +- server/services/agi/scripts/aws/lex/index.js | 2 +- server/services/agi/scripts/aws/lex/lib/api.js | 2 +- server/services/agi/scripts/aws/polly/index.js | 2 +- server/services/agi/scripts/aws/polly/lib/api.js | 2 +- server/services/agi/scripts/google/asr/index.js | 2 +- server/services/agi/scripts/google/asr/lib/api.js | 2 +- server/services/agi/scripts/google/index.js | 2 +- server/services/agi/scripts/index.js | 2 +- server/services/agi/scripts/sestek/index.js | 2 +- server/services/agi/scripts/sestek/nda/index.js | 2 +- server/services/agi/scripts/tilde/asr/index.js | 2 +- server/services/agi/scripts/tilde/asr/lib/api.js | 2 +- server/services/agi/scripts/tilde/index.js | 2 +- server/services/agi/server.js | 2 +- server/services/agi/vertices.js | 2 +- server/services/ami/acw/index.js | 2 +- server/services/ami/ami.js | 2 +- server/services/ami/client.js | 2 +- server/services/ami/dialer/action.js | 2 +- server/services/ami/dialer/agentComplete.js | 2 +- server/services/ami/dialer/final.js | 2 +- server/services/ami/dialer/hangup.js | 2 +- server/services/ami/dialer/history.js | 2 +- server/services/ami/dialer/index.js | 2 +- server/services/ami/dialer/queueCallerAbandon.js | 2 +- server/services/ami/fax/action.js | 2 +- server/services/ami/fax/index.js | 2 +- server/services/ami/fax/rpcDb.js | 2 +- server/services/ami/fax/util/gs.js | 2 +- server/services/ami/fax/util/util.js | 2 +- server/services/ami/index.js | 2 +- server/services/ami/model/agent.js | 2 +- server/services/ami/model/campaign.js | 2 +- server/services/ami/model/channel.js | 2 +- server/services/ami/model/deskAccount.js | 2 +- server/services/ami/model/dynamics365Account.js | 2 +- server/services/ami/model/faxAccount.js | 2 +- server/services/ami/model/freshdeskAccount.js | 2 +- server/services/ami/model/freshsalesAccount.js | 2 +- server/services/ami/model/queueReport.js | 2 +- server/services/ami/model/salesforceAccount.js | 2 +- server/services/ami/model/servicenowAccount.js | 2 +- server/services/ami/model/sugarcrmAccount.js | 2 +- server/services/ami/model/telephone.js | 2 +- server/services/ami/model/template.js | 2 +- server/services/ami/model/trigger.js | 2 +- server/services/ami/model/trunk.js | 2 +- server/services/ami/model/voiceExtension.js | 2 +- server/services/ami/model/voiceQueue.js | 2 +- server/services/ami/model/vtigerAccount.js | 2 +- server/services/ami/model/zendeskAccount.js | 2 +- server/services/ami/model/zohoAccount.js | 2 +- server/services/ami/preview/action.js | 2 +- server/services/ami/preview/index.js | 2 +- server/services/ami/preview/rpcDb.js | 2 +- server/services/ami/preview/util/util.js | 2 +- server/services/ami/properties.js | 2 +- server/services/ami/realtime/index.js | 2 +- server/services/ami/report/index.js | 2 +- server/services/ami/report/userReport.js | 2 +- server/services/ami/report/voiceAgentReport.js | 2 +- server/services/ami/report/voiceCallReport.js | 2 +- server/services/ami/report/voiceDialReport.js | 2 +- server/services/ami/report/voiceQueueReport.js | 2 +- server/services/ami/rpc/agentReportPreview.js | 2 +- server/services/ami/rpc/attachment.js | 2 +- server/services/ami/rpc/campaign.js | 2 +- server/services/ami/rpc/cmContact.js | 2 +- server/services/ami/rpc/cmHopper.js | 2 +- server/services/ami/rpc/cmHopperBlack.js | 2 +- server/services/ami/rpc/cmHopperFinal.js | 2 +- server/services/ami/rpc/cmHopperHistory.js | 2 +- server/services/ami/rpc/faxAccount.js | 2 +- server/services/ami/rpc/faxMessage.js | 2 +- server/services/ami/rpc/integrations/desk.js | 2 +- .../services/ami/rpc/integrations/dynamics365.js | 2 +- server/services/ami/rpc/integrations/freshdesk.js | 2 +- server/services/ami/rpc/integrations/freshsales.js | 2 +- server/services/ami/rpc/integrations/salesforce.js | 2 +- server/services/ami/rpc/integrations/servicenow.js | 2 +- server/services/ami/rpc/integrations/sugarcrm.js | 2 +- server/services/ami/rpc/integrations/vtiger.js | 2 +- server/services/ami/rpc/integrations/zendesk.js | 2 +- server/services/ami/rpc/integrations/zoho.js | 2 +- server/services/ami/rpc/memberReport.js | 2 +- server/services/ami/rpc/setting.js | 2 +- server/services/ami/rpc/template.js | 2 +- server/services/ami/rpc/trigger.js | 2 +- server/services/ami/rpc/trunk.js | 2 +- server/services/ami/rpc/user.js | 2 +- server/services/ami/rpc/voiceAgentReport.js | 2 +- server/services/ami/rpc/voiceCallReport.js | 2 +- server/services/ami/rpc/voiceDialReport.js | 2 +- server/services/ami/rpc/voiceExtension.js | 2 +- server/services/ami/rpc/voiceQueue.js | 2 +- server/services/ami/rpc/voiceQueueReport.js | 2 +- server/services/ami/rpc/voiceQueueRt.js | 2 +- server/services/ami/rpc/voiceRecording.js | 2 +- server/services/ami/rpc/voiceTransferReport.js | 2 +- server/services/ami/server/index.js | 2 +- server/services/ami/trigger/cmContact/index.js | 2 +- server/services/ami/trigger/index.js | 2 +- server/services/ami/trigger/integration/desk.js | 2 +- .../ami/trigger/integration/dynamics365.js | 2 +- .../services/ami/trigger/integration/freshdesk.js | 2 +- .../services/ami/trigger/integration/freshsales.js | 2 +- server/services/ami/trigger/integration/index.js | 2 +- .../services/ami/trigger/integration/salesforce.js | 2 +- .../services/ami/trigger/integration/servicenow.js | 2 +- .../services/ami/trigger/integration/sugarcrm.js | 2 +- server/services/ami/trigger/integration/util.js | 2 +- server/services/ami/trigger/integration/vtiger.js | 2 +- server/services/ami/trigger/integration/zendesk.js | 2 +- server/services/ami/trigger/integration/zoho.js | 2 +- server/services/ami/trigger/script/index.js | 2 +- server/services/ami/trigger/urlforward/index.js | 2 +- server/services/email/client.js | 2 +- server/services/email/index.js | 2 +- server/services/email/lib/email.js | 2 +- server/services/email/lib/imap.js | 2 +- server/services/email/lib/smtp.js | 2 +- server/services/email/lib/utils.js | 2 +- server/services/email/model/mailAccount.js | 2 +- server/services/email/realtime/index.js | 2 +- server/services/email/rpc/mailAccount.js | 2 +- server/services/email/rpc/setting.js | 2 +- server/services/email/server/index.js | 2 +- server/services/express/index.js | 2 +- server/services/routing/client.js | 2 +- server/services/routing/index.js | 2 +- server/services/routing/lib/rule-engine.js | 2 +- server/services/routing/mailRpc/index.js | 2 +- server/services/routing/model/agent.js | 2 +- server/services/routing/model/chatQueue.js | 2 +- server/services/routing/model/faxQueue.js | 2 +- server/services/routing/model/interval.js | 2 +- server/services/routing/model/mailQueue.js | 2 +- server/services/routing/model/openchannelQueue.js | 2 +- server/services/routing/model/smsQueue.js | 2 +- server/services/routing/model/whatsappQueue.js | 2 +- server/services/routing/realtime/index.js | 2 +- server/services/routing/rpc/chatInteraction.js | 2 +- server/services/routing/rpc/chatMessage.js | 2 +- server/services/routing/rpc/chatQueue.js | 2 +- server/services/routing/rpc/chatQueueReport.js | 2 +- server/services/routing/rpc/faxInteraction.js | 2 +- server/services/routing/rpc/faxMessage.js | 2 +- server/services/routing/rpc/faxQueue.js | 2 +- server/services/routing/rpc/faxQueueReport.js | 2 +- server/services/routing/rpc/interval.js | 2 +- server/services/routing/rpc/mailInteraction.js | 2 +- server/services/routing/rpc/mailMessage.js | 2 +- server/services/routing/rpc/mailQueue.js | 2 +- server/services/routing/rpc/mailQueueReport.js | 2 +- .../services/routing/rpc/openchannelInteraction.js | 2 +- server/services/routing/rpc/openchannelMessage.js | 2 +- server/services/routing/rpc/openchannelQueue.js | 2 +- .../services/routing/rpc/openchannelQueueReport.js | 2 +- server/services/routing/rpc/smsInteraction.js | 2 +- server/services/routing/rpc/smsMessage.js | 2 +- server/services/routing/rpc/smsQueue.js | 2 +- server/services/routing/rpc/smsQueueReport.js | 2 +- server/services/routing/rpc/user.js | 2 +- server/services/routing/rpc/whatsappInteraction.js | 2 +- server/services/routing/rpc/whatsappMessage.js | 2 +- server/services/routing/rpc/whatsappQueue.js | 2 +- server/services/routing/rpc/whatsappQueueReport.js | 2 +- .../services/routing/server/applications/agent.js | 2 +- .../routing/server/applications/amazonlex.js | 2 +- .../routing/server/applications/autoreply.js | 2 +- .../services/routing/server/applications/close.js | 2 +- .../routing/server/applications/dialogflow.js | 2 +- .../routing/server/applications/dialogflowV2.js | 2 +- .../services/routing/server/applications/gotoif.js | 2 +- .../services/routing/server/applications/gotop.js | 2 +- .../routing/server/applications/message.js | 2 +- .../services/routing/server/applications/noop.js | 2 +- .../services/routing/server/applications/queue.js | 2 +- .../routing/server/applications/strategy/agent.js | 2 +- .../server/applications/strategy/beepall.js | 2 +- .../routing/server/applications/strategy/index.js | 2 +- .../server/applications/strategy/rrmemory.js | 2 +- .../routing/server/applications/strategy/util.js | 2 +- .../services/routing/server/applications/system.js | 2 +- server/services/routing/server/applications/tag.js | 2 +- .../services/routing/server/applications/utils.js | 2 +- server/services/routing/server/index.js | 2 +- server/services/routing/server/interval.js | 2 +- server/services/xdr/agents.controller.js | 2 +- server/services/xdr/calls.controller.js | 2 +- server/services/xdr/core.controller.js | 2 +- server/services/xdr/dials.controller.js | 2 +- server/services/xdr/index.js | 2 +- server/services/xdr/members.controller.js | 2 +- server/services/xdr/queues.controller.js | 2 +- server/services/xdr/recordings.controller.js | 2 +- server/services/xdr/transfers.controller.js | 2 +- server/services/xdr/utils.js | 2 +- 1152 files changed, 1152 insertions(+), 1152 deletions(-) diff --git a/apidoc/api_project.js b/apidoc/api_project.js index 054a201..8b7881a 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-09-23T07:50:02.114Z", + "time": "2021-09-23T07:58:14.930Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index 15a69e4..ca18e1a 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2021-09-23T07:50:02.114Z", + "time": "2021-09-23T07:58:14.930Z", "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 24ee8c7..0198b99 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 _0x6b1b=['motionbar','jscripty','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','urlForward[headers],\x20browser[wsindowHeight]','urlForward[body]','exports','VIRTUAL','action','STRING','contactManager','integration'];(function(_0x3c4a6a,_0x231751){var _0x52f15c=function(_0x34fc69){while(--_0x34fc69){_0x3c4a6a['push'](_0x3c4a6a['shift']());}};_0x52f15c(++_0x231751);}(_0x6b1b,0x1e7));var _0xb6b1=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x6b1b[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require('sequelize');module[_0xb6b1('0x0')]={'name':{'type':Sequelize[_0xb6b1('0x1')],'get':function(_0x446608){return this['getDataValue'](_0xb6b1('0x2'));}},'action':{'type':Sequelize[_0xb6b1('0x3')],'allowNull':![],'validate':{'isIn':{'args':[[_0xb6b1('0x4'),_0xb6b1('0x5'),_0xb6b1('0x6'),_0xb6b1('0x7'),_0xb6b1('0x8'),_0xb6b1('0x9'),_0xb6b1('0xa'),_0xb6b1('0xb')]],'msg':_0xb6b1('0xc')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0xb6b1('0x3')](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['STRING'](0x1000),'comment':_0xb6b1('0xd')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0xb6b1('0xe')},'data4':{'type':Sequelize['STRING'](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize['STRING'](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth]'},'data6':{'type':Sequelize[_0xb6b1('0x3')],'comments':_0xb6b1('0xf')},'data7':{'type':Sequelize['TEXT'],'comments':_0xb6b1('0x10')}}; \ No newline at end of file +var _0x4317=['script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','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]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','exports','VIRTUAL','action','STRING','contactManager','integration','motionbar','jscripty','bot'];(function(_0x265a85,_0x28374d){var _0xd35f61=function(_0x1fff20){while(--_0x1fff20){_0x265a85['push'](_0x265a85['shift']());}};_0xd35f61(++_0x28374d);}(_0x4317,0x7c));var _0x7431=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x4317[_0x5ddb1c];return _0x354adc;};'use strict';var Sequelize=require('sequelize');module[_0x7431('0x0')]={'name':{'type':Sequelize[_0x7431('0x1')],'get':function(_0x1ad054){return this['getDataValue'](_0x7431('0x2'));}},'action':{'type':Sequelize[_0x7431('0x3')],'allowNull':![],'validate':{'isIn':{'args':[[_0x7431('0x4'),_0x7431('0x5'),_0x7431('0x6'),_0x7431('0x7'),'urlForward','browser',_0x7431('0x8'),_0x7431('0x9')]],'msg':_0x7431('0xa')}},'comment':_0x7431('0xa')},'data1':{'type':Sequelize[_0x7431('0x3')](0x1000),'comment':_0x7431('0xb')},'data2':{'type':Sequelize[_0x7431('0x3')](0x1000),'comment':_0x7431('0xc')},'data3':{'type':Sequelize[_0x7431('0x3')](0x1000),'comment':_0x7431('0xd')},'data4':{'type':Sequelize[_0x7431('0x3')](0x1000),'comments':_0x7431('0xe')},'data5':{'type':Sequelize[_0x7431('0x3')](0x1000),'comments':_0x7431('0xf')},'data6':{'type':Sequelize[_0x7431('0x3')],'comments':_0x7431('0x10')},'data7':{'type':Sequelize[_0x7431('0x11')],'comments':_0x7431('0x12')}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index 16da602..e6c08ff 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 _0xe2df=['send','body','find','params','then','catch','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/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','error','stack','name'];(function(_0x2adc31,_0x15c7df){var _0x398402=function(_0x42b0d9){while(--_0x42b0d9){_0x2adc31['push'](_0x2adc31['shift']());}};_0x398402(++_0x15c7df);}(_0xe2df,0x17e));var _0xfe2d=function(_0x1cd866,_0x3c4535){_0x1cd866=_0x1cd866-0x0;var _0x14cb3b=_0xe2df[_0x1cd866];return _0x14cb3b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfe2d('0x0'));var zipdir=require(_0xfe2d('0x1'));var jsonpatch=require(_0xfe2d('0x2'));var rp=require(_0xfe2d('0x3'));var moment=require(_0xfe2d('0x4'));var BPromise=require(_0xfe2d('0x5'));var Mustache=require(_0xfe2d('0x6'));var util=require(_0xfe2d('0x7'));var path=require(_0xfe2d('0x8'));var sox=require(_0xfe2d('0x9'));var csv=require(_0xfe2d('0xa'));var ejs=require(_0xfe2d('0xb'));var fs=require('fs');var fs_extra=require(_0xfe2d('0xc'));var _=require('lodash');var squel=require(_0xfe2d('0xd'));var crypto=require('crypto');var jsforce=require(_0xfe2d('0xe'));var deskjs=require(_0xfe2d('0xf'));var toCsv=require(_0xfe2d('0xa'));var querystring=require(_0xfe2d('0x10'));var Papa=require(_0xfe2d('0x11'));var Redis=require(_0xfe2d('0x12'));var authService=require(_0xfe2d('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xfe2d('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfe2d('0x15'))(_0xfe2d('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xfe2d('0x17'));var db=require(_0xfe2d('0x18'))['db'];function respondWithStatusCode(_0x534d7e,_0x3fe121){_0x3fe121=_0x3fe121||0xcc;return function(_0x475f49){if(_0x475f49){return _0x534d7e['sendStatus'](_0x3fe121);}return _0x534d7e[_0xfe2d('0x19')](_0x3fe121)['end']();};}function respondWithResult(_0x33f4b0,_0x400ae4){_0x400ae4=_0x400ae4||0xc8;return function(_0x3813d8){if(_0x3813d8){return _0x33f4b0['status'](_0x400ae4)[_0xfe2d('0x1a')](_0x3813d8);}};}function respondWithFilteredResult(_0x8e979d,_0x1d2cdc){return function(_0x4b016e){if(_0x4b016e){var _0x487b1f=typeof _0x1d2cdc[_0xfe2d('0x1b')]===_0xfe2d('0x1c')&&typeof _0x1d2cdc[_0xfe2d('0x1d')]==='undefined';var _0x57efbd=_0x4b016e[_0xfe2d('0x1e')];var _0x2e09d5=_0x487b1f?0x0:_0x1d2cdc[_0xfe2d('0x1b')];var _0x76f014=_0x487b1f?_0x4b016e[_0xfe2d('0x1e')]:_0x1d2cdc['offset']+_0x1d2cdc[_0xfe2d('0x1d')];var _0x3346bd;if(_0x76f014>=_0x57efbd){_0x76f014=_0x57efbd;_0x3346bd=0xc8;}else{_0x3346bd=0xce;}_0x8e979d['status'](_0x3346bd);return _0x8e979d[_0xfe2d('0x1f')](_0xfe2d('0x20'),_0x2e09d5+'-'+_0x76f014+'/'+_0x57efbd)['json'](_0x4b016e);}return null;};}function patchUpdates(_0x5d139c){return function(_0x514105){try{jsonpatch[_0xfe2d('0x21')](_0x514105,_0x5d139c,!![]);}catch(_0x866835){return BPromise[_0xfe2d('0x22')](_0x866835);}return _0x514105[_0xfe2d('0x23')]();};}function saveUpdates(_0x345409,_0x544258){return function(_0x4090f6){if(_0x4090f6){return _0x4090f6[_0xfe2d('0x24')](_0x345409)['then'](function(_0x3fa059){return _0x3fa059;});}return null;};}function removeEntity(_0x1a0962,_0x3a20d7){return function(_0x3abcc5){if(_0x3abcc5){return _0x3abcc5[_0xfe2d('0x25')]()['then'](function(){_0x1a0962[_0xfe2d('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x10ea8d,_0x2d6d2f){return function(_0x106419){if(!_0x106419){_0x10ea8d['sendStatus'](0x194);}return _0x106419;};}function handleError(_0x5f52b9,_0x3b63f3){_0x3b63f3=_0x3b63f3||0x1f4;return function(_0x1f9047){logger[_0xfe2d('0x26')](_0x1f9047[_0xfe2d('0x27')]);if(_0x1f9047['name']){delete _0x1f9047[_0xfe2d('0x28')];}_0x5f52b9[_0xfe2d('0x19')](_0x3b63f3)[_0xfe2d('0x29')](_0x1f9047);};}exports[_0xfe2d('0x24')]=function(_0x32d0df,_0x569f8d){if(_0x32d0df[_0xfe2d('0x2a')]['id']){delete _0x32d0df[_0xfe2d('0x2a')]['id'];}return db['Action'][_0xfe2d('0x2b')]({'where':{'id':_0x32d0df[_0xfe2d('0x2c')]['id']}})[_0xfe2d('0x2d')](handleEntityNotFound(_0x569f8d,null))[_0xfe2d('0x2d')](saveUpdates(_0x32d0df[_0xfe2d('0x2a')],null))['then'](respondWithResult(_0x569f8d,null))[_0xfe2d('0x2e')](handleError(_0x569f8d,null));};exports[_0xfe2d('0x25')]=function(_0x5b4de1,_0x35a97a){return db['Action'][_0xfe2d('0x2b')]({'where':{'id':_0x5b4de1['params']['id']}})[_0xfe2d('0x2d')](handleEntityNotFound(_0x35a97a,null))[_0xfe2d('0x2d')](removeEntity(_0x35a97a,null))['catch'](handleError(_0x35a97a,null));}; \ No newline at end of file +var _0x2f40=['lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','reject','save','update','destroy','then','error','stack','name','body','find','catch','Action','params','rimraf','zip-dir','fast-json-patch','moment','util','sox','to-csv','ejs'];(function(_0x8854f2,_0x79542c){var _0x38505d=function(_0x5af02b){while(--_0x5af02b){_0x8854f2['push'](_0x8854f2['shift']());}};_0x38505d(++_0x79542c);}(_0x2f40,0x172));var _0x02f4=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0x2f40[_0x5447fd];return _0x15b28a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x02f4('0x0'));var zipdir=require(_0x02f4('0x1'));var jsonpatch=require(_0x02f4('0x2'));var rp=require('request-promise');var moment=require(_0x02f4('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x02f4('0x4'));var path=require('path');var sox=require(_0x02f4('0x5'));var csv=require(_0x02f4('0x6'));var ejs=require(_0x02f4('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x02f4('0x8'));var squel=require(_0x02f4('0x9'));var crypto=require('crypto');var jsforce=require(_0x02f4('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x02f4('0x6'));var querystring=require(_0x02f4('0xb'));var Papa=require(_0x02f4('0xc'));var Redis=require(_0x02f4('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x02f4('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x02f4('0xf'));var logger=require('../../config/logger')(_0x02f4('0x10'));var utils=require(_0x02f4('0x11'));var config=require(_0x02f4('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x02f4('0x13'))['db'];function respondWithStatusCode(_0x5cd62b,_0x1c069d){_0x1c069d=_0x1c069d||0xcc;return function(_0xafe7d3){if(_0xafe7d3){return _0x5cd62b[_0x02f4('0x14')](_0x1c069d);}return _0x5cd62b[_0x02f4('0x15')](_0x1c069d)[_0x02f4('0x16')]();};}function respondWithResult(_0xa4b49b,_0x65239){_0x65239=_0x65239||0xc8;return function(_0x2ca339){if(_0x2ca339){return _0xa4b49b[_0x02f4('0x15')](_0x65239)[_0x02f4('0x17')](_0x2ca339);}};}function respondWithFilteredResult(_0x2017de,_0x37733d){return function(_0x3a7f49){if(_0x3a7f49){var _0x4db4f3=typeof _0x37733d['offset']===_0x02f4('0x18')&&typeof _0x37733d['limit']==='undefined';var _0x542934=_0x3a7f49[_0x02f4('0x19')];var _0x4da85c=_0x4db4f3?0x0:_0x37733d[_0x02f4('0x1a')];var _0x5ddd77=_0x4db4f3?_0x3a7f49['count']:_0x37733d[_0x02f4('0x1a')]+_0x37733d[_0x02f4('0x1b')];var _0x59a0f9;if(_0x5ddd77>=_0x542934){_0x5ddd77=_0x542934;_0x59a0f9=0xc8;}else{_0x59a0f9=0xce;}_0x2017de[_0x02f4('0x15')](_0x59a0f9);return _0x2017de[_0x02f4('0x1c')]('Content-Range',_0x4da85c+'-'+_0x5ddd77+'/'+_0x542934)[_0x02f4('0x17')](_0x3a7f49);}return null;};}function patchUpdates(_0x2ee0fb){return function(_0x127bd6){try{jsonpatch['apply'](_0x127bd6,_0x2ee0fb,!![]);}catch(_0x4612f2){return BPromise[_0x02f4('0x1d')](_0x4612f2);}return _0x127bd6[_0x02f4('0x1e')]();};}function saveUpdates(_0xdd84c,_0x4b7ccf){return function(_0x194e21){if(_0x194e21){return _0x194e21[_0x02f4('0x1f')](_0xdd84c)['then'](function(_0x1cedbc){return _0x1cedbc;});}return null;};}function removeEntity(_0x46d77d,_0xf71cd0){return function(_0x237fe2){if(_0x237fe2){return _0x237fe2[_0x02f4('0x20')]()[_0x02f4('0x21')](function(){_0x46d77d[_0x02f4('0x15')](0xcc)[_0x02f4('0x16')]();});}};}function handleEntityNotFound(_0x16812c,_0x5a501f){return function(_0xa1c370){if(!_0xa1c370){_0x16812c[_0x02f4('0x14')](0x194);}return _0xa1c370;};}function handleError(_0x53a184,_0x369a95){_0x369a95=_0x369a95||0x1f4;return function(_0x570a5d){logger[_0x02f4('0x22')](_0x570a5d[_0x02f4('0x23')]);if(_0x570a5d[_0x02f4('0x24')]){delete _0x570a5d[_0x02f4('0x24')];}_0x53a184[_0x02f4('0x15')](_0x369a95)['send'](_0x570a5d);};}exports['update']=function(_0x38b3e5,_0x156d8d){if(_0x38b3e5[_0x02f4('0x25')]['id']){delete _0x38b3e5['body']['id'];}return db['Action'][_0x02f4('0x26')]({'where':{'id':_0x38b3e5['params']['id']}})[_0x02f4('0x21')](handleEntityNotFound(_0x156d8d,null))[_0x02f4('0x21')](saveUpdates(_0x38b3e5[_0x02f4('0x25')],null))[_0x02f4('0x21')](respondWithResult(_0x156d8d,null))[_0x02f4('0x27')](handleError(_0x156d8d,null));};exports[_0x02f4('0x20')]=function(_0x2724a4,_0x5eba52){return db[_0x02f4('0x28')]['find']({'where':{'id':_0x2724a4[_0x02f4('0x29')]['id']}})['then'](handleEntityNotFound(_0x5eba52,null))[_0x02f4('0x21')](removeEntity(_0x5eba52,null))[_0x02f4('0x27')](handleError(_0x5eba52,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 5869a09..b79df7a 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 _0xd67b=['util','../../config/logger','api','moment','path','rimraf','../../config/environment','./action.attributes','exports','define','Action','lodash'];(function(_0x3f13f0,_0x3352a5){var _0x2970dd=function(_0x333f43){while(--_0x333f43){_0x3f13f0['push'](_0x3f13f0['shift']());}};_0x2970dd(++_0x3352a5);}(_0xd67b,0x1df));var _0xbd67=function(_0x21f231,_0x4e7334){_0x21f231=_0x21f231-0x0;var _0x478a31=_0xd67b[_0x21f231];return _0x478a31;};'use strict';var _=require(_0xbd67('0x0'));var util=require(_0xbd67('0x1'));var logger=require(_0xbd67('0x2'))(_0xbd67('0x3'));var moment=require(_0xbd67('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xbd67('0x5'));var rimraf=require(_0xbd67('0x6'));var config=require(_0xbd67('0x7'));var attributes=require(_0xbd67('0x8'));module[_0xbd67('0x9')]=function(_0x20b285,_0x103a04){return _0x20b285[_0xbd67('0xa')](_0xbd67('0xb'),attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2dac=['define','Action','tools_actions','util','../../config/logger','moment','bluebird','request-promise','./action.attributes','exports'];(function(_0x5ff5c9,_0x3213de){var _0x23e4a8=function(_0x1ebd48){while(--_0x1ebd48){_0x5ff5c9['push'](_0x5ff5c9['shift']());}};_0x23e4a8(++_0x3213de);}(_0x2dac,0x107));var _0xc2da=function(_0x1f99c9,_0xb440a4){_0x1f99c9=_0x1f99c9-0x0;var _0x5d0fff=_0x2dac[_0x1f99c9];return _0x5d0fff;};'use strict';var _=require('lodash');var util=require(_0xc2da('0x0'));var logger=require(_0xc2da('0x1'))('api');var moment=require(_0xc2da('0x2'));var BPromise=require(_0xc2da('0x3'));var rp=require(_0xc2da('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc2da('0x5'));module[_0xc2da('0x6')]=function(_0x2affd3,_0x3c879c){return _0x2affd3[_0xc2da('0x7')](_0xc2da('0x8'),attributes,{'tableName':_0xc2da('0x9'),'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 1df5487..36387eb 100644 --- a/server/api/action/action.rpc.js +++ b/server/api/action/action.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','Action,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x53cead,_0x2008a9){var _0x2f5841=function(_0x58afe8){while(--_0x58afe8){_0x53cead['push'](_0x53cead['shift']());}};_0x2f5841(++_0x2008a9);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0xc4aa[_0x3b0731];return _0x4204d7;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('Action,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});} \ No newline at end of file +var _0x5fab=['../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Action,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x4c8fa9,_0x2a1337){var _0x192648=function(_0x6c8436){while(--_0x6c8436){_0x4c8fa9['push'](_0x4c8fa9['shift']());}};_0x192648(++_0x2a1337);}(_0x5fab,0x177));var _0xb5fa=function(_0x5d9a85,_0x55221e){_0x5d9a85=_0x5d9a85-0x0;var _0x1ef8aa=_0x5fab[_0x5d9a85];return _0x1ef8aa;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var moment=require('moment');var BPromise=require(_0xb5fa('0x2'));var rs=require(_0xb5fa('0x3'));var fs=require('fs');var Redis=require(_0xb5fa('0x4'));var db=require(_0xb5fa('0x5'))['db'];var utils=require(_0xb5fa('0x6'));var logger=require(_0xb5fa('0x7'))(_0xb5fa('0x8'));var config=require(_0xb5fa('0x9'));var jayson=require(_0xb5fa('0xa'));var client=jayson[_0xb5fa('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d70f6,_0x2e3804,_0x1aec3e){return new BPromise(function(_0x9c7bce,_0x56d018){return client[_0xb5fa('0xc')](_0x5d70f6,_0x1aec3e)[_0xb5fa('0xd')](function(_0x2cf4a5){logger['info']('Action,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));logger[_0xb5fa('0xf')](_0xb5fa('0x10'),_0x2e3804,_0xb5fa('0xe'),JSON[_0xb5fa('0x11')](_0x2cf4a5));if(_0x2cf4a5[_0xb5fa('0x12')]){if(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x13')]===0x1f4){logger[_0xb5fa('0x12')]('Action,\x20%s,\x20%s',_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x56d018(_0x2cf4a5['error'][_0xb5fa('0x14')]);}logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x9c7bce(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);}else{logger['info']('Action,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));_0x9c7bce(_0x2cf4a5[_0xb5fa('0x16')][_0xb5fa('0x14')]);}})[_0xb5fa('0x17')](function(_0x56fe10){logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x56fe10);_0x56d018(_0x56fe10);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index abae83b..fcefa22 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 _0x7def=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./action.controller','put','isAuthenticated','update','delete','/:id'];(function(_0xb6e2ea,_0x3b26e9){var _0x2a57bb=function(_0x2a1ac9){while(--_0x2a1ac9){_0xb6e2ea['push'](_0xb6e2ea['shift']());}};_0x2a57bb(++_0x3b26e9);}(_0x7def,0x167));var _0xf7de=function(_0x51c819,_0xd812db){_0x51c819=_0x51c819-0x0;var _0x15c5d2=_0x7def[_0x51c819];return _0x15c5d2;};'use strict';var multer=require(_0xf7de('0x0'));var util=require(_0xf7de('0x1'));var path=require(_0xf7de('0x2'));var timeout=require(_0xf7de('0x3'));var express=require(_0xf7de('0x4'));var router=express[_0xf7de('0x5')]();var fs_extra=require(_0xf7de('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xf7de('0x7'));var config=require(_0xf7de('0x8'));var controller=require(_0xf7de('0x9'));router[_0xf7de('0xa')]('/:id',auth[_0xf7de('0xb')](),controller[_0xf7de('0xc')]);router[_0xf7de('0xd')](_0xf7de('0xe'),auth[_0xf7de('0xb')](),controller[_0xf7de('0xf')]);module[_0xf7de('0x10')]=router; \ No newline at end of file +var _0x922d=['../../components/auth/service','../../config/environment','./action.controller','put','/:id','isAuthenticated','update','exports','util','path','connect-timeout','Router'];(function(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0x922d,0xf8));var _0xd922=function(_0x27d16e,_0x461295){_0x27d16e=_0x27d16e-0x0;var _0x4005ac=_0x922d[_0x27d16e];return _0x4005ac;};'use strict';var multer=require('multer');var util=require(_0xd922('0x0'));var path=require(_0xd922('0x1'));var timeout=require(_0xd922('0x2'));var express=require('express');var router=express[_0xd922('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xd922('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xd922('0x5'));var controller=require(_0xd922('0x6'));router[_0xd922('0x7')](_0xd922('0x8'),auth[_0xd922('0x9')](),controller[_0xd922('0xa')]);router['delete'](_0xd922('0x8'),auth[_0xd922('0x9')](),controller['destroy']);module[_0xd922('0xb')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index b7b7480..0beac28 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 _0x3eea=['STRING','TEXT','sequelize'];(function(_0x36fbf3,_0x32aace){var _0x1536e2=function(_0x547d3a){while(--_0x547d3a){_0x36fbf3['push'](_0x36fbf3['shift']());}};_0x1536e2(++_0x32aace);}(_0x3eea,0x1ca));var _0xa3ee=function(_0x3e6091,_0x49c232){_0x3e6091=_0x3e6091-0x0;var _0x35f9bb=_0x3eea[_0x3e6091];return _0x35f9bb;};'use strict';var Sequelize=require(_0xa3ee('0x0'));module['exports']={'name':{'type':Sequelize[_0xa3ee('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xa3ee('0x1')]},'parent':{'type':Sequelize[_0xa3ee('0x1')]},'table':{'type':Sequelize[_0xa3ee('0x1')]},'conditions':{'type':Sequelize[_0xa3ee('0x2')]},'joins':{'type':Sequelize[_0xa3ee('0x2')]}}; \ No newline at end of file +var _0x7dfd=['STRING','TEXT','sequelize','exports'];(function(_0x1a9d8c,_0x8eb138){var _0x42f058=function(_0x35b9df){while(--_0x35b9df){_0x1a9d8c['push'](_0x1a9d8c['shift']());}};_0x42f058(++_0x8eb138);}(_0x7dfd,0x1c2));var _0xd7df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7dfd[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xd7df('0x0'));module[_0xd7df('0x1')]={'name':{'type':Sequelize[_0xd7df('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xd7df('0x2')]},'parent':{'type':Sequelize[_0xd7df('0x2')]},'table':{'type':Sequelize[_0xd7df('0x2')]},'conditions':{'type':Sequelize[_0xd7df('0x3')]},'joins':{'type':Sequelize[_0xd7df('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index 1ea1ff4..38fe857 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 _0xbb6a=['fieldName','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','keys','rawAttributes','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','body','params','preview','join','left_join','right_join','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','SEC_TO_TIME(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','joins','parse','includes','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SUM(%s)','MAX(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','ROUND(%s)','value','Sequelize','ValidationErrorItem','DESC','alias','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','fork','../../components/export/','savename','countTable','COUNT(*)','SELECT','run','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','count','apply','save','update','then','destroy','get','CustomReports','UserProfileResource','error','stack','name','map','AnalyticCustomReport'];(function(_0x2d8db5,_0x3c9c8d){var _0xdc5579=function(_0x36f14f){while(--_0x36f14f){_0x2d8db5['push'](_0x2d8db5['shift']());}};_0xdc5579(++_0x3c9c8d);}(_0xbb6a,0x76));var _0xabb6=function(_0x59a549,_0x2fe2bb){_0x59a549=_0x59a549-0x0;var _0x12adbe=_0xbb6a[_0x59a549];return _0x12adbe;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xabb6('0x0'));var jsonpatch=require(_0xabb6('0x1'));var rp=require(_0xabb6('0x2'));var moment=require(_0xabb6('0x3'));var BPromise=require(_0xabb6('0x4'));var Mustache=require(_0xabb6('0x5'));var util=require(_0xabb6('0x6'));var path=require(_0xabb6('0x7'));var sox=require(_0xabb6('0x8'));var csv=require(_0xabb6('0x9'));var ejs=require(_0xabb6('0xa'));var fs=require('fs');var fs_extra=require(_0xabb6('0xb'));var _=require(_0xabb6('0xc'));var squel=require('squel');var crypto=require(_0xabb6('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xabb6('0xe'));var toCsv=require(_0xabb6('0x9'));var querystring=require('querystring');var Papa=require(_0xabb6('0xf'));var Redis=require(_0xabb6('0x10'));var authService=require(_0xabb6('0x11'));var qs=require(_0xabb6('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xabb6('0x13'));var logger=require(_0xabb6('0x14'))(_0xabb6('0x15'));var utils=require(_0xabb6('0x16'));var config=require(_0xabb6('0x17'));var licenseUtil=require(_0xabb6('0x18'));var db=require(_0xabb6('0x19'))['db'];var dbH=require(_0xabb6('0x19'))[_0xabb6('0x1a')];function respondWithStatusCode(_0x3865d4,_0x13ffa8){_0x13ffa8=_0x13ffa8||0xcc;return function(_0x1f8a32){if(_0x1f8a32){return _0x3865d4[_0xabb6('0x1b')](_0x13ffa8);}return _0x3865d4[_0xabb6('0x1c')](_0x13ffa8)[_0xabb6('0x1d')]();};}function respondWithResult(_0x176080,_0x5ca099){_0x5ca099=_0x5ca099||0xc8;return function(_0x28742d){if(_0x28742d){return _0x176080[_0xabb6('0x1c')](_0x5ca099)[_0xabb6('0x1e')](_0x28742d);}};}function respondWithFilteredResult(_0x4bc452,_0x1d2a15){return function(_0xcf99e){if(_0xcf99e){var _0x3b28a6=typeof _0x1d2a15[_0xabb6('0x1f')]===_0xabb6('0x20')&&typeof _0x1d2a15[_0xabb6('0x21')]==='undefined';var _0x4b9435=_0xcf99e['count'];var _0x52bfa1=_0x3b28a6?0x0:_0x1d2a15['offset'];var _0x2c3e44=_0x3b28a6?_0xcf99e[_0xabb6('0x22')]:_0x1d2a15[_0xabb6('0x1f')]+_0x1d2a15[_0xabb6('0x21')];var _0x170280;if(_0x2c3e44>=_0x4b9435){_0x2c3e44=_0x4b9435;_0x170280=0xc8;}else{_0x170280=0xce;}_0x4bc452[_0xabb6('0x1c')](_0x170280);return _0x4bc452['set']('Content-Range',_0x52bfa1+'-'+_0x2c3e44+'/'+_0x4b9435)[_0xabb6('0x1e')](_0xcf99e);}return null;};}function patchUpdates(_0xb1c764){return function(_0x1dee8c){try{jsonpatch[_0xabb6('0x23')](_0x1dee8c,_0xb1c764,!![]);}catch(_0x338c77){return BPromise['reject'](_0x338c77);}return _0x1dee8c[_0xabb6('0x24')]();};}function saveUpdates(_0x28687e,_0x43ebf4){return function(_0x4589de){if(_0x4589de){return _0x4589de[_0xabb6('0x25')](_0x28687e)[_0xabb6('0x26')](function(_0x2cf653){return _0x2cf653;});}return null;};}function removeEntity(_0x1a2070,_0x57dd15){return function(_0x18e777){if(_0x18e777){return _0x18e777[_0xabb6('0x27')]()[_0xabb6('0x26')](function(){var _0x1bb094=_0x18e777[_0xabb6('0x28')]({'plain':!![]});var _0x412549=_0xabb6('0x29');return db[_0xabb6('0x2a')]['destroy']({'where':{'type':_0x412549,'resourceId':_0x1bb094['id']}})[_0xabb6('0x26')](function(){return _0x18e777;});})['then'](function(){_0x1a2070['status'](0xcc)[_0xabb6('0x1d')]();});}};}function handleEntityNotFound(_0x17ec1f,_0x500e3e){return function(_0x1eb2c9){if(!_0x1eb2c9){_0x17ec1f[_0xabb6('0x1b')](0x194);}return _0x1eb2c9;};}function handleError(_0x7ee2b,_0x2453ca){_0x2453ca=_0x2453ca||0x1f4;return function(_0x584a8f){logger[_0xabb6('0x2b')](_0x584a8f[_0xabb6('0x2c')]);if(_0x584a8f[_0xabb6('0x2d')]){delete _0x584a8f[_0xabb6('0x2d')];}_0x7ee2b['status'](_0x2453ca)['send'](_0x584a8f);};}exports['index']=function(_0x3a2af5,_0x4cc486){var _0x5ab922={},_0x3895a2={},_0x4ccbdd={'count':0x0,'rows':[]};var _0x51562d=_[_0xabb6('0x2e')](db[_0xabb6('0x2f')]['rawAttributes'],function(_0xf8008f){return{'name':_0xf8008f[_0xabb6('0x30')],'type':_0xf8008f['type'][_0xabb6('0x31')]};});_0x3895a2[_0xabb6('0x32')]=_[_0xabb6('0x2e')](_0x51562d,'name');_0x3895a2[_0xabb6('0x33')]=_['keys'](_0x3a2af5[_0xabb6('0x33')]);_0x3895a2['filters']=_[_0xabb6('0x34')](_0x3895a2[_0xabb6('0x32')],_0x3895a2[_0xabb6('0x33')]);_0x5ab922[_0xabb6('0x35')]=_[_0xabb6('0x34')](_0x3895a2[_0xabb6('0x32')],qs['fields'](_0x3a2af5[_0xabb6('0x33')][_0xabb6('0x36')]));_0x5ab922[_0xabb6('0x35')]=_0x5ab922[_0xabb6('0x35')][_0xabb6('0x37')]?_0x5ab922['attributes']:_0x3895a2[_0xabb6('0x32')];if(!_0x3a2af5[_0xabb6('0x33')][_0xabb6('0x38')](_0xabb6('0x39'))){_0x5ab922[_0xabb6('0x21')]=qs[_0xabb6('0x21')](_0x3a2af5[_0xabb6('0x33')][_0xabb6('0x21')]);_0x5ab922[_0xabb6('0x1f')]=qs['offset'](_0x3a2af5['query'][_0xabb6('0x1f')]);}_0x5ab922[_0xabb6('0x3a')]=qs[_0xabb6('0x3b')](_0x3a2af5['query']['sort']);_0x5ab922[_0xabb6('0x3c')]=qs[_0xabb6('0x3d')](_['pick'](_0x3a2af5['query'],_0x3895a2[_0xabb6('0x3d')]),_0x51562d);if(_0x3a2af5[_0xabb6('0x33')]['filter']){_0x5ab922[_0xabb6('0x3c')]=_[_0xabb6('0x3e')](_0x5ab922['where'],{'$or':_[_0xabb6('0x2e')](_0x51562d,function(_0x5f04ad){if(_0x5f04ad[_0xabb6('0x3f')]!==_0xabb6('0x40')){var _0x16f46a={};_0x16f46a[_0x5f04ad[_0xabb6('0x2d')]]={'$like':'%'+_0x3a2af5[_0xabb6('0x33')][_0xabb6('0x41')]+'%'};return _0x16f46a;}})});}_0x5ab922=_[_0xabb6('0x3e')]({},_0x5ab922,_0x3a2af5[_0xabb6('0x42')]);var _0xe36be6={'where':_0x5ab922[_0xabb6('0x3c')]};return db[_0xabb6('0x2f')][_0xabb6('0x22')](_0xe36be6)[_0xabb6('0x26')](function(_0x340323){_0x4ccbdd[_0xabb6('0x22')]=_0x340323;if(_0x3a2af5[_0xabb6('0x33')][_0xabb6('0x43')]){_0x5ab922[_0xabb6('0x44')]=[{'all':!![]}];}return db[_0xabb6('0x2f')][_0xabb6('0x45')](_0x5ab922);})[_0xabb6('0x26')](function(_0x24f7e8){_0x4ccbdd[_0xabb6('0x46')]=_0x24f7e8;return _0x4ccbdd;})[_0xabb6('0x26')](respondWithFilteredResult(_0x4cc486,_0x5ab922))[_0xabb6('0x47')](handleError(_0x4cc486,null));};exports[_0xabb6('0x48')]=function(_0x4d25c9,_0x3bbdb1){var _0x1e8fc5={'raw':![],'where':{'id':_0x4d25c9['params']['id']}},_0x4cdf25={};_0x4cdf25['model']=_[_0xabb6('0x49')](db[_0xabb6('0x2f')][_0xabb6('0x4a')]);_0x4cdf25[_0xabb6('0x33')]=_[_0xabb6('0x49')](_0x4d25c9[_0xabb6('0x33')]);_0x4cdf25['filters']=_[_0xabb6('0x34')](_0x4cdf25[_0xabb6('0x32')],_0x4cdf25[_0xabb6('0x33')]);_0x1e8fc5['attributes']=_['intersection'](_0x4cdf25[_0xabb6('0x32')],qs['fields'](_0x4d25c9[_0xabb6('0x33')][_0xabb6('0x36')]));_0x1e8fc5[_0xabb6('0x35')]=_0x1e8fc5[_0xabb6('0x35')][_0xabb6('0x37')]?_0x1e8fc5['attributes']:_0x4cdf25['model'];if(_0x4d25c9['query'][_0xabb6('0x43')]){_0x1e8fc5[_0xabb6('0x44')]=[{'all':!![]}];}_0x1e8fc5=_['merge']({},_0x1e8fc5,_0x4d25c9[_0xabb6('0x42')]);return db['AnalyticCustomReport'][_0xabb6('0x4b')](_0x1e8fc5)[_0xabb6('0x26')](handleEntityNotFound(_0x3bbdb1,null))['then'](respondWithResult(_0x3bbdb1,null))[_0xabb6('0x47')](handleError(_0x3bbdb1,null));};exports[_0xabb6('0x4c')]=function(_0x5caa0c,_0x5f3a43){return db[_0xabb6('0x2f')][_0xabb6('0x4c')](_0x5caa0c['body'],{})[_0xabb6('0x26')](function(_0x551cf9){var _0x5ab6e3=_0x5caa0c[_0xabb6('0x4d')][_0xabb6('0x28')]({'plain':!![]});if(!_0x5ab6e3)throw new Error(_0xabb6('0x4e'));if(_0x5ab6e3[_0xabb6('0x4f')]===_0xabb6('0x4d')){var _0x33a313=_0x551cf9[_0xabb6('0x28')]({'plain':!![]});var _0x3a4b64=_0xabb6('0x50');return db[_0xabb6('0x51')][_0xabb6('0x4b')]({'where':{'name':_0x3a4b64,'userProfileId':_0x5ab6e3[_0xabb6('0x52')]},'raw':!![]})[_0xabb6('0x26')](function(_0x3d6905){if(_0x3d6905&&_0x3d6905['autoAssociation']===0x0){return db[_0xabb6('0x2a')][_0xabb6('0x4c')]({'name':_0x33a313[_0xabb6('0x2d')],'resourceId':_0x33a313['id'],'type':_0xabb6('0x29'),'sectionId':_0x3d6905['id']},{})[_0xabb6('0x26')](function(){return _0x551cf9;});}else{return _0x551cf9;}})[_0xabb6('0x47')](function(_0x12f84a){logger[_0xabb6('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x12f84a);throw _0x12f84a;});}return _0x551cf9;})[_0xabb6('0x26')](respondWithResult(_0x5f3a43,0xc9))[_0xabb6('0x47')](handleError(_0x5f3a43,null));};exports[_0xabb6('0x25')]=function(_0x5155ea,_0x116c15){if(_0x5155ea[_0xabb6('0x53')]['id']){delete _0x5155ea['body']['id'];}return db[_0xabb6('0x2f')]['find']({'where':{'id':_0x5155ea[_0xabb6('0x54')]['id']}})[_0xabb6('0x26')](handleEntityNotFound(_0x116c15,null))[_0xabb6('0x26')](saveUpdates(_0x5155ea['body'],null))[_0xabb6('0x26')](respondWithResult(_0x116c15,null))[_0xabb6('0x47')](handleError(_0x116c15,null));};exports[_0xabb6('0x27')]=function(_0x51531d,_0x55fe73){return db[_0xabb6('0x2f')]['find']({'where':{'id':_0x51531d[_0xabb6('0x54')]['id']}})['then'](handleEntityNotFound(_0x55fe73,null))[_0xabb6('0x26')](removeEntity(_0x55fe73,null))['catch'](handleError(_0x55fe73,null));};exports[_0xabb6('0x55')]=function(_0x5a5c01,_0x1657bf){var _0x563cb3=0xa;var _0x10e5d7=[_0xabb6('0x56'),_0xabb6('0x57'),_0xabb6('0x58'),_0xabb6('0x59')];var _0x69d028={'SUM':'SUM(%s)','COUNT':_0xabb6('0x5a'),'COUNT DISTINCT':_0xabb6('0x5b'),'MAX':'MAX(%s)','MIN':_0xabb6('0x5c'),'AVG':_0xabb6('0x5d'),'GROUP_CONCAT':_0xabb6('0x5e'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x521107={'SEC_TO_TIME':_0xabb6('0x5f'),'DATE':'DATE(%s)','HOUR':_0xabb6('0x60'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xabb6('0x61')};var _0x48d827=function(_0x229ebb){return!_['includes']([_0xabb6('0x62'),_0xabb6('0x63'),_0xabb6('0x64'),_0xabb6('0x65')],_0x229ebb);};var _0x2d812f=function(_0x287ab4){if(!_0x287ab4||!_0x287ab4[_0xabb6('0x66')][_0xabb6('0x37')]){return'';}for(var _0x28decd='(',_0x21afe9=0x0;_0x21afe9<_0x287ab4[_0xabb6('0x66')][_0xabb6('0x37')];_0x21afe9+=0x1){_0x21afe9>0x0&&(_0x28decd+='\x20'+_0x287ab4[_0xabb6('0x67')]+'\x20');_0x28decd+=_0x287ab4[_0xabb6('0x66')][_0x21afe9][_0xabb6('0x68')]?_0x2d812f(_0x287ab4[_0xabb6('0x66')][_0x21afe9][_0xabb6('0x68')]):_0x287ab4['rules'][_0x21afe9][_0xabb6('0x69')]+'\x20'+_0x287ab4['rules'][_0x21afe9][_0xabb6('0x6a')]+(_0x48d827(_0x287ab4[_0xabb6('0x66')][_0x21afe9][_0xabb6('0x6a')])?'\x20'+_0x287ab4[_0xabb6('0x66')][_0x21afe9]['value']:'');}return _0x28decd+')';};var _0xff4341={'where':{'id':_0x5a5c01[_0xabb6('0x54')]['id']}},_0x35278c,_0x5a147a,_0x58082,_0x1fafe0,_0x5e8954;_0xff4341=_[_0xabb6('0x3e')]({},_0xff4341,_0x5a5c01[_0xabb6('0x42')]);return db[_0xabb6('0x2f')]['find'](_0xff4341)[_0xabb6('0x26')](function(_0x3dc26b){if(_0x3dc26b){_0x35278c=_0x3dc26b;return _0x3dc26b[_0xabb6('0x6b')]();}return null;})[_0xabb6('0x26')](function(_0x65d12c){if(_0x65d12c){if(!_0x65d12c[_0xabb6('0x37')]){throw new db['Sequelize']['ValidationErrorItem'](_0xabb6('0x6c'),0x193);}_0x5a147a=_0x65d12c;return db[_0xabb6('0x6d')][_0xabb6('0x45')]({'raw':!![]});}return null;})[_0xabb6('0x26')](function(_0x2cbbb8){if(_0x2cbbb8){_0x58082=_[_0xabb6('0x6e')](_0x2cbbb8,'id');var _0x4228e7;var _0x50aae4=squel[_0xabb6('0x6f')]();_0x50aae4[_0xabb6('0x70')](_0x35278c[_0xabb6('0x71')]);for(var _0x59e268=0x0;_0x59e268<_0x5a147a[_0xabb6('0x37')];_0x59e268+=0x1){_0x4228e7=_0x5a147a[_0x59e268][_0xabb6('0x72')]?_0x58082[_0x5a147a[_0x59e268][_0xabb6('0x72')]][_0xabb6('0x73')]:_0x5a147a[_0x59e268][_0xabb6('0x69')];_0x4228e7=_0x5a147a[_0x59e268][_0xabb6('0x74')]?_[_0xabb6('0x75')](_0x69d028[_0x5a147a[_0x59e268]['function']],'%s',_0x4228e7):_0x4228e7;_0x4228e7=_0x5a147a[_0x59e268][_0xabb6('0x76')]?_[_0xabb6('0x75')](_0x521107[_0x5a147a[_0x59e268][_0xabb6('0x76')]],'%s',_0x4228e7):_0x4228e7;if(_0x5a147a[_0x59e268][_0xabb6('0x77')]){_0x50aae4['group'](_0x4228e7);}_0x5a147a[_0x59e268][_0xabb6('0x78')]&&_0x50aae4[_0xabb6('0x3a')](_0x4228e7,_0x5a147a[_0x59e268][_0xabb6('0x78')]==='DESC'?![]:!![]);_0x50aae4[_0xabb6('0x69')](_0x4228e7,_0x5a147a[_0x59e268]['alias']||_0x4228e7);}if(_0x35278c[_0xabb6('0x79')]){_0x35278c[_0xabb6('0x79')]=JSON[_0xabb6('0x7a')](_0x35278c[_0xabb6('0x79')]);for(var _0x3d7a5e=0x0;_0x3d7a5e<_0x35278c[_0xabb6('0x79')]['length'];_0x3d7a5e+=0x1){if(_0x35278c[_0xabb6('0x79')][_0x3d7a5e]['type']&&_[_0xabb6('0x7b')](_0x10e5d7,_0x35278c[_0xabb6('0x79')][_0x3d7a5e][_0xabb6('0x3f')])&&_0x35278c[_0xabb6('0x79')][_0x3d7a5e][_0xabb6('0x7c')]&&_0x35278c['joins'][_0x3d7a5e][_0xabb6('0x7d')]&&_0x35278c[_0xabb6('0x79')][_0x3d7a5e][_0xabb6('0x7e')]){_0x50aae4[_0x35278c['joins'][_0x3d7a5e][_0xabb6('0x3f')]](_0x35278c['joins'][_0x3d7a5e][_0xabb6('0x7d')],null,util[_0xabb6('0x76')](_0xabb6('0x7f'),_0x35278c[_0xabb6('0x71')],_0x35278c['joins'][_0x3d7a5e][_0xabb6('0x7c')],_0x35278c[_0xabb6('0x79')][_0x3d7a5e][_0xabb6('0x7d')],_0x35278c[_0xabb6('0x79')][_0x3d7a5e][_0xabb6('0x7e')]));}}}if(_0x35278c[_0xabb6('0x80')]){_0x35278c[_0xabb6('0x80')]=JSON[_0xabb6('0x7a')](_0x35278c[_0xabb6('0x80')]);_0x50aae4[_0xabb6('0x3c')](_0x2d812f(_0x35278c['conditions']['group']));}_0x5e8954=_0x50aae4[_0xabb6('0x81')]();_0x50aae4[_0xabb6('0x21')](_0x563cb3);_0x50aae4['offset'](0x0);logger[_0xabb6('0x82')](_0xabb6('0x83'),_0x50aae4[_0xabb6('0x84')]());return dbH[_0xabb6('0x85')]['query'](_0x50aae4['toString'](),{'type':dbH[_0xabb6('0x85')][_0xabb6('0x86')]['SELECT']});}})[_0xabb6('0x26')](respondWithResult(_0x1657bf,null))['catch'](handleError(_0x1657bf,null));};function runReport(_0x13dd0d,_0x51e7aa,_0x14ee7f){var _0x1e0e37=_0x51e7aa[_0xabb6('0x2d')];var _0x4682ad=0xa;var _0x2208f3=[_0xabb6('0x56'),'left_join',_0xabb6('0x58'),_0xabb6('0x59')];var _0x17b2d6={'SUM':_0xabb6('0x87'),'COUNT':_0xabb6('0x5a'),'COUNT DISTINCT':_0xabb6('0x5b'),'MAX':_0xabb6('0x88'),'MIN':_0xabb6('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xabb6('0x5e'),'GROUP_CONCAT ASC':_0xabb6('0x89'),'GROUP_CONCAT DESC':_0xabb6('0x8a')};var _0x301792={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0xabb6('0x60'),'ROUND':_0xabb6('0x8b'),'UNIX_TIMESTAMP':_0xabb6('0x61')};var _0x1a8fd9=function(_0x46227a){return!_[_0xabb6('0x7b')]([_0xabb6('0x62'),_0xabb6('0x63'),_0xabb6('0x64'),_0xabb6('0x65')],_0x46227a);};var _0x22bb93=function(_0x2e77f8){if(!_0x2e77f8||!_0x2e77f8['rules'][_0xabb6('0x37')]){return'';}for(var _0x263242='(',_0x20dab3=0x0;_0x20dab3<_0x2e77f8['rules']['length'];_0x20dab3+=0x1){_0x20dab3>0x0&&(_0x263242+='\x20'+_0x2e77f8[_0xabb6('0x67')]+'\x20');_0x263242+=_0x2e77f8[_0xabb6('0x66')][_0x20dab3][_0xabb6('0x68')]?_0x22bb93(_0x2e77f8[_0xabb6('0x66')][_0x20dab3][_0xabb6('0x68')]):_0x2e77f8[_0xabb6('0x66')][_0x20dab3][_0xabb6('0x69')]+'\x20'+_0x2e77f8[_0xabb6('0x66')][_0x20dab3][_0xabb6('0x6a')]+(_0x1a8fd9(_0x2e77f8[_0xabb6('0x66')][_0x20dab3][_0xabb6('0x6a')])?'\x20'+_0x2e77f8[_0xabb6('0x66')][_0x20dab3][_0xabb6('0x8c')]:'');}return _0x263242+')';};var _0x38525e={'where':{'id':_0x13dd0d['id']}},_0x55c104,_0x4cfdf7,_0x290630,_0x5a8126,_0x24cdcf;_0x38525e=_[_0xabb6('0x3e')]({},_0x38525e,_0x14ee7f);return db[_0xabb6('0x2f')][_0xabb6('0x4b')](_0x38525e)[_0xabb6('0x26')](function(_0x4a3e79){if(_0x4a3e79){_0x55c104=_0x4a3e79;return _0x4a3e79['getFields']();}return null;})[_0xabb6('0x26')](function(_0x2d60dd){if(_0x2d60dd){if(!_0x2d60dd[_0xabb6('0x37')]){throw new db[(_0xabb6('0x8d'))][(_0xabb6('0x8e'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x4cfdf7=_0x2d60dd;return db[_0xabb6('0x6d')][_0xabb6('0x45')]({'raw':!![]});}return null;})[_0xabb6('0x26')](function(_0x4d5100){if(_0x4d5100){_0x290630=_['keyBy'](_0x4d5100,'id');var _0x1abfed;var _0x533e48=squel['select']();_0x533e48[_0xabb6('0x70')](_0x55c104[_0xabb6('0x71')]);for(var _0x49f087=0x0;_0x49f087<_0x4cfdf7[_0xabb6('0x37')];_0x49f087+=0x1){_0x1abfed=_0x4cfdf7[_0x49f087][_0xabb6('0x72')]?_0x290630[_0x4cfdf7[_0x49f087]['MetricId']][_0xabb6('0x73')]:_0x4cfdf7[_0x49f087][_0xabb6('0x69')];_0x1abfed=_0x4cfdf7[_0x49f087]['function']?_[_0xabb6('0x75')](_0x17b2d6[_0x4cfdf7[_0x49f087][_0xabb6('0x74')]],'%s',_0x1abfed):_0x1abfed;_0x1abfed=_0x4cfdf7[_0x49f087][_0xabb6('0x76')]?_[_0xabb6('0x75')](_0x301792[_0x4cfdf7[_0x49f087]['format']],'%s',_0x1abfed):_0x1abfed;if(_0x4cfdf7[_0x49f087][_0xabb6('0x77')]){_0x533e48[_0xabb6('0x68')](_0x1abfed);}_0x4cfdf7[_0x49f087][_0xabb6('0x78')]&&_0x533e48[_0xabb6('0x3a')](_0x1abfed,_0x4cfdf7[_0x49f087][_0xabb6('0x78')]===_0xabb6('0x8f')?![]:!![]);_0x533e48['field'](_0x1abfed,_0x4cfdf7[_0x49f087][_0xabb6('0x90')]||_0x1abfed);}if(_0x55c104[_0xabb6('0x79')]){_0x55c104['joins']=JSON[_0xabb6('0x7a')](_0x55c104['joins']);for(var _0x13c778=0x0;_0x13c778<_0x55c104[_0xabb6('0x79')][_0xabb6('0x37')];_0x13c778+=0x1){if(_0x55c104['joins'][_0x13c778][_0xabb6('0x3f')]&&_[_0xabb6('0x7b')](_0x2208f3,_0x55c104[_0xabb6('0x79')][_0x13c778][_0xabb6('0x3f')])&&_0x55c104[_0xabb6('0x79')][_0x13c778]['parentKey']&&_0x55c104[_0xabb6('0x79')][_0x13c778][_0xabb6('0x7d')]&&_0x55c104[_0xabb6('0x79')][_0x13c778]['foreignKey']){_0x533e48[_0x55c104[_0xabb6('0x79')][_0x13c778]['type']](_0x55c104[_0xabb6('0x79')][_0x13c778][_0xabb6('0x7d')],null,util['format'](_0xabb6('0x7f'),_0x55c104['table'],_0x55c104[_0xabb6('0x79')][_0x13c778][_0xabb6('0x7c')],_0x55c104[_0xabb6('0x79')][_0x13c778][_0xabb6('0x7d')],_0x55c104['joins'][_0x13c778]['foreignKey']));}}}if(_0x55c104['conditions']){_0x55c104['conditions']=JSON[_0xabb6('0x7a')](_0x55c104[_0xabb6('0x80')]);_0x533e48[_0xabb6('0x3c')](_0x22bb93(_0x55c104[_0xabb6('0x80')][_0xabb6('0x68')]));}_0x24cdcf=_0x533e48[_0xabb6('0x81')]();_0x533e48['limit'](_0x4682ad);_0x533e48[_0xabb6('0x1f')](0x0);return;}})[_0xabb6('0x26')](function(){if(_0x51e7aa[_0xabb6('0x91')]===_0xabb6('0x92')){return null;}var _0x7ed58=_[_0xabb6('0x3e')](_0x51e7aa,{'name':_0x51e7aa[_0xabb6('0x93')]||_0x51e7aa[_0xabb6('0x2d')]||_0x55c104[_0xabb6('0x2d')],'basename':_0x1e0e37,'savename':util[_0xabb6('0x76')](_0xabb6('0x94'),_0x51e7aa[_0xabb6('0x2d')]||_0x55c104['name'],require(_0xabb6('0x95'))[_0xabb6('0x96')](0x4),_0x51e7aa[_0xabb6('0x91')]||_0xabb6('0x97')),'reportId':_0x55c104['id'],'reportType':_0xabb6('0x98')});return db[_0xabb6('0x99')][_0xabb6('0x4c')](_0x7ed58,{'raw':!![]});})[_0xabb6('0x26')](function(_0x12a477){if(_0x55c104[_0xabb6('0x71')]===_0xabb6('0x9a')){_0x24cdcf[_0xabb6('0x3c')](_0x55c104[_0xabb6('0x71')]+_0xabb6('0x9b'),_0x51e7aa[_0xabb6('0x9c')],_0x51e7aa[_0xabb6('0x9d')]);}else{_0x24cdcf[_0xabb6('0x3c')](_0x55c104[_0xabb6('0x71')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x51e7aa[_0xabb6('0x9c')],_0x51e7aa[_0xabb6('0x9d')]);}if(_0x12a477){logger[_0xabb6('0x9e')]('Run\x20Query:',_0x24cdcf[_0xabb6('0x84')]());require('child_process')[_0xabb6('0x9f')](path['join'](__dirname,_0xabb6('0xa0'),_0x12a477[_0xabb6('0x91')]),[_0x12a477['id'],_0x24cdcf[_0xabb6('0x84')](),path['join'](__dirname,'../../files/reports',_0x12a477[_0xabb6('0xa1')]),_0x1e0e37]);return _0x12a477;}else{var _0x20d476=squel[_0xabb6('0x6f')]();_0x20d476[_0xabb6('0x70')]('('+_0x24cdcf['toString']()+')',_0xabb6('0xa2'));_0x20d476['field'](_0xabb6('0xa3'),'count');_0x24cdcf[_0xabb6('0x21')](_0x51e7aa[_0xabb6('0x21')]||_0x4682ad);_0x24cdcf[_0xabb6('0x1f')](_0x51e7aa[_0xabb6('0x1f')]||0x0);return dbH['sequelize'][_0xabb6('0x33')](_0x20d476[_0xabb6('0x84')](),{'type':dbH[_0xabb6('0x85')]['QueryTypes'][_0xabb6('0xa4')]})[_0xabb6('0x26')](function(_0xbae63c){if(!_0xbae63c['length']){_0x5a8126=0x0;}else{_0x5a8126=_0xbae63c[0x0][_0xabb6('0x22')]||0x0;}return dbH[_0xabb6('0x85')]['query'](_0x24cdcf[_0xabb6('0x84')](),{'type':dbH[_0xabb6('0x85')][_0xabb6('0x86')]['SELECT']});})['then'](function(_0x415c79){return{'rows':_0x415c79||[],'count':_0x5a8126};});}});}exports[_0xabb6('0xa5')]=function(_0x58c749,_0x2770ba){return runReport(_0x58c749[_0xabb6('0x54')],_0x58c749[_0xabb6('0x33')],_0x58c749[_0xabb6('0x42')])['then'](respondWithResult(_0x2770ba,null))['catch'](handleError(_0x2770ba,null));};exports['runReport']=runReport;exports[_0xabb6('0x33')]=function(_0x335a51,_0x2909a5){var _0x12ce4a=0xa;var _0x23a2e3=[_0xabb6('0x56'),_0xabb6('0x57'),_0xabb6('0x58'),'cross_join'];var _0x14aa93={'SUM':'SUM(%s)','COUNT':_0xabb6('0x5a'),'COUNT DISTINCT':_0xabb6('0x5b'),'MAX':_0xabb6('0x88'),'MIN':_0xabb6('0x5c'),'AVG':_0xabb6('0x5d'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xabb6('0x89'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x5167f0={'SEC_TO_TIME':_0xabb6('0x5f'),'DATE':'DATE(%s)','HOUR':_0xabb6('0x60'),'ROUND':_0xabb6('0x8b'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0xeb75dc=function(_0x17a559){return!_[_0xabb6('0x7b')]([_0xabb6('0x62'),_0xabb6('0x63'),_0xabb6('0x64'),_0xabb6('0x65')],_0x17a559);};var _0x31e38c=function(_0xee97b2){if(!_0xee97b2||!_0xee97b2[_0xabb6('0x66')][_0xabb6('0x37')]){return'';}for(var _0x20c29f='(',_0x40ad57=0x0;_0x40ad57<_0xee97b2[_0xabb6('0x66')][_0xabb6('0x37')];_0x40ad57+=0x1){_0x40ad57>0x0&&(_0x20c29f+='\x20'+_0xee97b2[_0xabb6('0x67')]+'\x20');_0x20c29f+=_0xee97b2['rules'][_0x40ad57][_0xabb6('0x68')]?_0x31e38c(_0xee97b2[_0xabb6('0x66')][_0x40ad57][_0xabb6('0x68')]):_0xee97b2[_0xabb6('0x66')][_0x40ad57][_0xabb6('0x69')]+'\x20'+_0xee97b2['rules'][_0x40ad57][_0xabb6('0x6a')]+(_0xeb75dc(_0xee97b2['rules'][_0x40ad57][_0xabb6('0x6a')])?'\x20'+_0xee97b2[_0xabb6('0x66')][_0x40ad57][_0xabb6('0x8c')]:'');}return _0x20c29f+')';};var _0x3fc505={'where':{'id':_0x335a51[_0xabb6('0x54')]['id']}},_0x8f95a3,_0x52b61e,_0x565781,_0xe73ec,_0x14a4fe;_0x3fc505=_[_0xabb6('0x3e')]({},_0x3fc505,_0x335a51[_0xabb6('0x42')]);return db[_0xabb6('0x2f')]['find'](_0x3fc505)[_0xabb6('0x26')](function(_0x23d11e){if(_0x23d11e){_0x8f95a3=_0x23d11e;return _0x23d11e['getFields']();}return null;})[_0xabb6('0x26')](function(_0x116564){if(_0x116564){if(!_0x116564[_0xabb6('0x37')]){throw new db[(_0xabb6('0x8d'))]['ValidationErrorItem'](_0xabb6('0x6c'),0x193);}_0x52b61e=_0x116564;return db[_0xabb6('0x6d')][_0xabb6('0x45')]({'raw':!![]});}return null;})[_0xabb6('0x26')](function(_0x102d7e){if(_0x102d7e){_0x565781=_['keyBy'](_0x102d7e,'id');var _0x4d5393;var _0x5c6244=squel[_0xabb6('0x6f')]();_0x5c6244[_0xabb6('0x70')](_0x8f95a3[_0xabb6('0x71')]);for(var _0x3db458=0x0;_0x3db458<_0x52b61e[_0xabb6('0x37')];_0x3db458+=0x1){_0x4d5393=_0x52b61e[_0x3db458][_0xabb6('0x72')]?_0x565781[_0x52b61e[_0x3db458][_0xabb6('0x72')]][_0xabb6('0x73')]:_0x52b61e[_0x3db458]['field'];_0x4d5393=_0x52b61e[_0x3db458][_0xabb6('0x74')]?_[_0xabb6('0x75')](_0x14aa93[_0x52b61e[_0x3db458][_0xabb6('0x74')]],'%s',_0x4d5393):_0x4d5393;_0x4d5393=_0x52b61e[_0x3db458][_0xabb6('0x76')]?_[_0xabb6('0x75')](_0x5167f0[_0x52b61e[_0x3db458][_0xabb6('0x76')]],'%s',_0x4d5393):_0x4d5393;if(_0x52b61e[_0x3db458][_0xabb6('0x77')]){_0x5c6244[_0xabb6('0x68')](_0x4d5393);}_0x52b61e[_0x3db458][_0xabb6('0x78')]&&_0x5c6244[_0xabb6('0x3a')](_0x4d5393,_0x52b61e[_0x3db458][_0xabb6('0x78')]===_0xabb6('0x8f')?![]:!![]);_0x5c6244[_0xabb6('0x69')](_0x4d5393,_0x52b61e[_0x3db458]['alias']||_0x4d5393);}if(_0x8f95a3[_0xabb6('0x79')]){_0x8f95a3['joins']=JSON['parse'](_0x8f95a3[_0xabb6('0x79')]);for(var _0x39b5ab=0x0;_0x39b5ab<_0x8f95a3[_0xabb6('0x79')][_0xabb6('0x37')];_0x39b5ab+=0x1){if(_0x8f95a3[_0xabb6('0x79')][_0x39b5ab][_0xabb6('0x3f')]&&_[_0xabb6('0x7b')](_0x23a2e3,_0x8f95a3[_0xabb6('0x79')][_0x39b5ab][_0xabb6('0x3f')])&&_0x8f95a3[_0xabb6('0x79')][_0x39b5ab][_0xabb6('0x7c')]&&_0x8f95a3[_0xabb6('0x79')][_0x39b5ab][_0xabb6('0x7d')]&&_0x8f95a3[_0xabb6('0x79')][_0x39b5ab][_0xabb6('0x7e')]){_0x5c6244[_0x8f95a3[_0xabb6('0x79')][_0x39b5ab][_0xabb6('0x3f')]](_0x8f95a3[_0xabb6('0x79')][_0x39b5ab][_0xabb6('0x7d')],null,util[_0xabb6('0x76')]('%s.%s\x20=\x20%s.%s',_0x8f95a3[_0xabb6('0x71')],_0x8f95a3[_0xabb6('0x79')][_0x39b5ab][_0xabb6('0x7c')],_0x8f95a3[_0xabb6('0x79')][_0x39b5ab]['foreignTable'],_0x8f95a3[_0xabb6('0x79')][_0x39b5ab][_0xabb6('0x7e')]));}}}if(_0x8f95a3[_0xabb6('0x80')]){_0x8f95a3[_0xabb6('0x80')]=JSON['parse'](_0x8f95a3[_0xabb6('0x80')]);_0x5c6244[_0xabb6('0x3c')](_0x31e38c(_0x8f95a3[_0xabb6('0x80')][_0xabb6('0x68')]));}_0x14a4fe=_0x5c6244[_0xabb6('0x81')]();_0x5c6244['limit'](_0x12ce4a);_0x5c6244[_0xabb6('0x1f')](0x0);logger['debug']('Limited\x20Query:',_0x5c6244[_0xabb6('0x84')]());return dbH[_0xabb6('0x85')]['query'](_0x5c6244['toString'](),{'type':dbH[_0xabb6('0x85')]['QueryTypes'][_0xabb6('0xa4')]});}})[_0xabb6('0x26')](function(){return{'sql':_0x14a4fe[_0xabb6('0x84')]()};})[_0xabb6('0x26')](respondWithResult(_0x2909a5,null))[_0xabb6('0x47')](handleError(_0x2909a5,null));}; \ No newline at end of file +var _0x6f70=['VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','rawAttributes','include','create','body','user','role','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','MetricId','metric','function','replace','format','groupBy','orderBy','order','DESC','field','alias','joins','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','table','foreignKey','conditions','parse','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','join','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','value','getFields','output','web','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','params','runReport','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','dbH','sendStatus','status','offset','undefined','count','limit','set','json','apply','reject','save','update','then','destroy','get','CustomReports','UserProfileResource','end','error','name','send','index','map','AnalyticCustomReport','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','type'];(function(_0x2396a9,_0x448c2e){var _0x4deb7a=function(_0x1a1e3a){while(--_0x1a1e3a){_0x2396a9['push'](_0x2396a9['shift']());}};_0x4deb7a(++_0x448c2e);}(_0x6f70,0x110));var _0x06f7=function(_0x17b08b,_0x11e6cc){_0x17b08b=_0x17b08b-0x0;var _0x39853e=_0x6f70[_0x17b08b];return _0x39853e;};'use strict';var emlformat=require(_0x06f7('0x0'));var rimraf=require(_0x06f7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x06f7('0x2'));var rp=require('request-promise');var moment=require(_0x06f7('0x3'));var BPromise=require(_0x06f7('0x4'));var Mustache=require(_0x06f7('0x5'));var util=require(_0x06f7('0x6'));var path=require('path');var sox=require(_0x06f7('0x7'));var csv=require(_0x06f7('0x8'));var ejs=require(_0x06f7('0x9'));var fs=require('fs');var fs_extra=require(_0x06f7('0xa'));var _=require(_0x06f7('0xb'));var squel=require(_0x06f7('0xc'));var crypto=require(_0x06f7('0xd'));var jsforce=require(_0x06f7('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x06f7('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x06f7('0x10'));var hardwareService=require(_0x06f7('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x06f7('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x06f7('0x13'));var db=require('../../mysqldb')['db'];var dbH=require(_0x06f7('0x14'))[_0x06f7('0x15')];function respondWithStatusCode(_0x2da6a7,_0xac42da){_0xac42da=_0xac42da||0xcc;return function(_0x11ddba){if(_0x11ddba){return _0x2da6a7[_0x06f7('0x16')](_0xac42da);}return _0x2da6a7[_0x06f7('0x17')](_0xac42da)['end']();};}function respondWithResult(_0x15cf8d,_0x28a6ab){_0x28a6ab=_0x28a6ab||0xc8;return function(_0x475f65){if(_0x475f65){return _0x15cf8d[_0x06f7('0x17')](_0x28a6ab)['json'](_0x475f65);}};}function respondWithFilteredResult(_0x5e2c8a,_0x50a8b3){return function(_0x1732d7){if(_0x1732d7){var _0x369e12=typeof _0x50a8b3[_0x06f7('0x18')]===_0x06f7('0x19')&&typeof _0x50a8b3['limit']===_0x06f7('0x19');var _0x58f2e9=_0x1732d7[_0x06f7('0x1a')];var _0x731f19=_0x369e12?0x0:_0x50a8b3[_0x06f7('0x18')];var _0x193200=_0x369e12?_0x1732d7[_0x06f7('0x1a')]:_0x50a8b3[_0x06f7('0x18')]+_0x50a8b3[_0x06f7('0x1b')];var _0x2872f5;if(_0x193200>=_0x58f2e9){_0x193200=_0x58f2e9;_0x2872f5=0xc8;}else{_0x2872f5=0xce;}_0x5e2c8a[_0x06f7('0x17')](_0x2872f5);return _0x5e2c8a[_0x06f7('0x1c')]('Content-Range',_0x731f19+'-'+_0x193200+'/'+_0x58f2e9)[_0x06f7('0x1d')](_0x1732d7);}return null;};}function patchUpdates(_0x24c34b){return function(_0xfb1e60){try{jsonpatch[_0x06f7('0x1e')](_0xfb1e60,_0x24c34b,!![]);}catch(_0x3776b8){return BPromise[_0x06f7('0x1f')](_0x3776b8);}return _0xfb1e60[_0x06f7('0x20')]();};}function saveUpdates(_0x40afa7,_0x18a6f0){return function(_0x5712cc){if(_0x5712cc){return _0x5712cc[_0x06f7('0x21')](_0x40afa7)[_0x06f7('0x22')](function(_0x3b7e36){return _0x3b7e36;});}return null;};}function removeEntity(_0x5b6d24,_0x22c207){return function(_0x2a2359){if(_0x2a2359){return _0x2a2359[_0x06f7('0x23')]()['then'](function(){var _0x4fbb4c=_0x2a2359[_0x06f7('0x24')]({'plain':!![]});var _0x35ea80=_0x06f7('0x25');return db[_0x06f7('0x26')][_0x06f7('0x23')]({'where':{'type':_0x35ea80,'resourceId':_0x4fbb4c['id']}})[_0x06f7('0x22')](function(){return _0x2a2359;});})[_0x06f7('0x22')](function(){_0x5b6d24[_0x06f7('0x17')](0xcc)[_0x06f7('0x27')]();});}};}function handleEntityNotFound(_0x23de7d,_0x417269){return function(_0x3a5b2d){if(!_0x3a5b2d){_0x23de7d['sendStatus'](0x194);}return _0x3a5b2d;};}function handleError(_0x5a6c70,_0x2b7f4e){_0x2b7f4e=_0x2b7f4e||0x1f4;return function(_0xb05cb7){logger[_0x06f7('0x28')](_0xb05cb7['stack']);if(_0xb05cb7[_0x06f7('0x29')]){delete _0xb05cb7[_0x06f7('0x29')];}_0x5a6c70['status'](_0x2b7f4e)[_0x06f7('0x2a')](_0xb05cb7);};}exports[_0x06f7('0x2b')]=function(_0x1644fc,_0x38bf98){var _0x599523={},_0x3dddb6={},_0x101953={'count':0x0,'rows':[]};var _0x3842da=_[_0x06f7('0x2c')](db[_0x06f7('0x2d')]['rawAttributes'],function(_0x2a7aae){return{'name':_0x2a7aae['fieldName'],'type':_0x2a7aae['type'][_0x06f7('0x2e')]};});_0x3dddb6['model']=_[_0x06f7('0x2c')](_0x3842da,'name');_0x3dddb6[_0x06f7('0x2f')]=_[_0x06f7('0x30')](_0x1644fc['query']);_0x3dddb6['filters']=_[_0x06f7('0x31')](_0x3dddb6[_0x06f7('0x32')],_0x3dddb6[_0x06f7('0x2f')]);_0x599523[_0x06f7('0x33')]=_[_0x06f7('0x31')](_0x3dddb6[_0x06f7('0x32')],qs[_0x06f7('0x34')](_0x1644fc[_0x06f7('0x2f')][_0x06f7('0x34')]));_0x599523['attributes']=_0x599523[_0x06f7('0x33')][_0x06f7('0x35')]?_0x599523['attributes']:_0x3dddb6[_0x06f7('0x32')];if(!_0x1644fc[_0x06f7('0x2f')][_0x06f7('0x36')](_0x06f7('0x37'))){_0x599523[_0x06f7('0x1b')]=qs[_0x06f7('0x1b')](_0x1644fc[_0x06f7('0x2f')][_0x06f7('0x1b')]);_0x599523[_0x06f7('0x18')]=qs['offset'](_0x1644fc[_0x06f7('0x2f')][_0x06f7('0x18')]);}_0x599523['order']=qs[_0x06f7('0x38')](_0x1644fc[_0x06f7('0x2f')][_0x06f7('0x38')]);_0x599523[_0x06f7('0x39')]=qs[_0x06f7('0x3a')](_[_0x06f7('0x3b')](_0x1644fc['query'],_0x3dddb6[_0x06f7('0x3a')]),_0x3842da);if(_0x1644fc[_0x06f7('0x2f')][_0x06f7('0x3c')]){_0x599523[_0x06f7('0x39')]=_['merge'](_0x599523['where'],{'$or':_[_0x06f7('0x2c')](_0x3842da,function(_0x556582){if(_0x556582[_0x06f7('0x3d')]!==_0x06f7('0x3e')){var _0x46f107={};_0x46f107[_0x556582['name']]={'$like':'%'+_0x1644fc[_0x06f7('0x2f')][_0x06f7('0x3c')]+'%'};return _0x46f107;}})});}_0x599523=_[_0x06f7('0x3f')]({},_0x599523,_0x1644fc[_0x06f7('0x40')]);var _0x3f2c8d={'where':_0x599523[_0x06f7('0x39')]};return db['AnalyticCustomReport'][_0x06f7('0x1a')](_0x3f2c8d)[_0x06f7('0x22')](function(_0x18e23c){_0x101953[_0x06f7('0x1a')]=_0x18e23c;if(_0x1644fc[_0x06f7('0x2f')][_0x06f7('0x41')]){_0x599523['include']=[{'all':!![]}];}return db[_0x06f7('0x2d')][_0x06f7('0x42')](_0x599523);})['then'](function(_0x4d3b25){_0x101953[_0x06f7('0x43')]=_0x4d3b25;return _0x101953;})[_0x06f7('0x22')](respondWithFilteredResult(_0x38bf98,_0x599523))[_0x06f7('0x44')](handleError(_0x38bf98,null));};exports[_0x06f7('0x45')]=function(_0x325f82,_0x441887){var _0x1824a4={'raw':![],'where':{'id':_0x325f82['params']['id']}},_0x48c4ff={};_0x48c4ff[_0x06f7('0x32')]=_[_0x06f7('0x30')](db['AnalyticCustomReport'][_0x06f7('0x46')]);_0x48c4ff[_0x06f7('0x2f')]=_[_0x06f7('0x30')](_0x325f82[_0x06f7('0x2f')]);_0x48c4ff[_0x06f7('0x3a')]=_['intersection'](_0x48c4ff['model'],_0x48c4ff[_0x06f7('0x2f')]);_0x1824a4[_0x06f7('0x33')]=_[_0x06f7('0x31')](_0x48c4ff[_0x06f7('0x32')],qs[_0x06f7('0x34')](_0x325f82[_0x06f7('0x2f')][_0x06f7('0x34')]));_0x1824a4[_0x06f7('0x33')]=_0x1824a4[_0x06f7('0x33')][_0x06f7('0x35')]?_0x1824a4['attributes']:_0x48c4ff[_0x06f7('0x32')];if(_0x325f82[_0x06f7('0x2f')][_0x06f7('0x41')]){_0x1824a4[_0x06f7('0x47')]=[{'all':!![]}];}_0x1824a4=_[_0x06f7('0x3f')]({},_0x1824a4,_0x325f82[_0x06f7('0x40')]);return db[_0x06f7('0x2d')]['find'](_0x1824a4)[_0x06f7('0x22')](handleEntityNotFound(_0x441887,null))[_0x06f7('0x22')](respondWithResult(_0x441887,null))[_0x06f7('0x44')](handleError(_0x441887,null));};exports[_0x06f7('0x48')]=function(_0x4c85fd,_0x449ddb){return db[_0x06f7('0x2d')][_0x06f7('0x48')](_0x4c85fd[_0x06f7('0x49')],{})[_0x06f7('0x22')](function(_0x4f60ef){var _0x10e3f3=_0x4c85fd[_0x06f7('0x4a')][_0x06f7('0x24')]({'plain':!![]});if(!_0x10e3f3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x10e3f3[_0x06f7('0x4b')]===_0x06f7('0x4a')){var _0x4a0095=_0x4f60ef['get']({'plain':!![]});var _0x14ea54='Reports';return db[_0x06f7('0x4c')][_0x06f7('0x4d')]({'where':{'name':_0x14ea54,'userProfileId':_0x10e3f3['userProfileId']},'raw':!![]})['then'](function(_0x2546ad){if(_0x2546ad&&_0x2546ad[_0x06f7('0x4e')]===0x0){return db[_0x06f7('0x26')][_0x06f7('0x48')]({'name':_0x4a0095[_0x06f7('0x29')],'resourceId':_0x4a0095['id'],'type':_0x06f7('0x25'),'sectionId':_0x2546ad['id']},{})[_0x06f7('0x22')](function(){return _0x4f60ef;});}else{return _0x4f60ef;}})[_0x06f7('0x44')](function(_0x4f71a7){logger[_0x06f7('0x28')](_0x06f7('0x4f'),_0x4f71a7);throw _0x4f71a7;});}return _0x4f60ef;})[_0x06f7('0x22')](respondWithResult(_0x449ddb,0xc9))[_0x06f7('0x44')](handleError(_0x449ddb,null));};exports['update']=function(_0x44e755,_0x36ccfd){if(_0x44e755[_0x06f7('0x49')]['id']){delete _0x44e755['body']['id'];}return db[_0x06f7('0x2d')][_0x06f7('0x4d')]({'where':{'id':_0x44e755['params']['id']}})[_0x06f7('0x22')](handleEntityNotFound(_0x36ccfd,null))[_0x06f7('0x22')](saveUpdates(_0x44e755[_0x06f7('0x49')],null))[_0x06f7('0x22')](respondWithResult(_0x36ccfd,null))[_0x06f7('0x44')](handleError(_0x36ccfd,null));};exports[_0x06f7('0x23')]=function(_0x5572a3,_0x2e5f48){return db[_0x06f7('0x2d')][_0x06f7('0x4d')]({'where':{'id':_0x5572a3['params']['id']}})[_0x06f7('0x22')](handleEntityNotFound(_0x2e5f48,null))[_0x06f7('0x22')](removeEntity(_0x2e5f48,null))[_0x06f7('0x44')](handleError(_0x2e5f48,null));};exports['preview']=function(_0x5b9049,_0x154ad4){var _0x5cd840=0xa;var _0x217283=['join',_0x06f7('0x50'),_0x06f7('0x51'),_0x06f7('0x52')];var _0x41518d={'SUM':_0x06f7('0x53'),'COUNT':_0x06f7('0x54'),'COUNT DISTINCT':_0x06f7('0x55'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0x06f7('0x56'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x06f7('0x57'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x4f9733={'SEC_TO_TIME':_0x06f7('0x58'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0x06f7('0x59'),'UNIX_TIMESTAMP':_0x06f7('0x5a')};var _0x5112b7=function(_0x4b9aae){return!_[_0x06f7('0x5b')]([_0x06f7('0x5c'),_0x06f7('0x5d'),_0x06f7('0x5e'),_0x06f7('0x5f')],_0x4b9aae);};var _0x5666ab=function(_0x17bb46){if(!_0x17bb46||!_0x17bb46[_0x06f7('0x60')][_0x06f7('0x35')]){return'';}for(var _0x38df88='(',_0xfcd92a=0x0;_0xfcd92a<_0x17bb46['rules'][_0x06f7('0x35')];_0xfcd92a+=0x1){_0xfcd92a>0x0&&(_0x38df88+='\x20'+_0x17bb46[_0x06f7('0x61')]+'\x20');_0x38df88+=_0x17bb46[_0x06f7('0x60')][_0xfcd92a]['group']?_0x5666ab(_0x17bb46[_0x06f7('0x60')][_0xfcd92a][_0x06f7('0x62')]):_0x17bb46['rules'][_0xfcd92a]['field']+'\x20'+_0x17bb46[_0x06f7('0x60')][_0xfcd92a][_0x06f7('0x63')]+(_0x5112b7(_0x17bb46[_0x06f7('0x60')][_0xfcd92a][_0x06f7('0x63')])?'\x20'+_0x17bb46[_0x06f7('0x60')][_0xfcd92a]['value']:'');}return _0x38df88+')';};var _0xa43de5={'where':{'id':_0x5b9049['params']['id']}},_0x6113b4,_0x3b6eb1,_0xb6aead,_0x3f86f5,_0x5b364c;_0xa43de5=_[_0x06f7('0x3f')]({},_0xa43de5,_0x5b9049[_0x06f7('0x40')]);return db[_0x06f7('0x2d')][_0x06f7('0x4d')](_0xa43de5)[_0x06f7('0x22')](function(_0x5d0c4a){if(_0x5d0c4a){_0x6113b4=_0x5d0c4a;return _0x5d0c4a['getFields']();}return null;})[_0x06f7('0x22')](function(_0x4cff49){if(_0x4cff49){if(!_0x4cff49[_0x06f7('0x35')]){throw new db[(_0x06f7('0x64'))][(_0x06f7('0x65'))](_0x06f7('0x66'),0x193);}_0x3b6eb1=_0x4cff49;return db[_0x06f7('0x67')]['findAll']({'raw':!![]});}return null;})[_0x06f7('0x22')](function(_0x262237){if(_0x262237){_0xb6aead=_[_0x06f7('0x68')](_0x262237,'id');var _0x3e2be6;var _0x655f62=squel[_0x06f7('0x69')]();_0x655f62[_0x06f7('0x6a')](_0x6113b4['table']);for(var _0x9465c6=0x0;_0x9465c6<_0x3b6eb1[_0x06f7('0x35')];_0x9465c6+=0x1){_0x3e2be6=_0x3b6eb1[_0x9465c6]['MetricId']?_0xb6aead[_0x3b6eb1[_0x9465c6][_0x06f7('0x6b')]][_0x06f7('0x6c')]:_0x3b6eb1[_0x9465c6]['field'];_0x3e2be6=_0x3b6eb1[_0x9465c6][_0x06f7('0x6d')]?_[_0x06f7('0x6e')](_0x41518d[_0x3b6eb1[_0x9465c6]['function']],'%s',_0x3e2be6):_0x3e2be6;_0x3e2be6=_0x3b6eb1[_0x9465c6][_0x06f7('0x6f')]?_['replace'](_0x4f9733[_0x3b6eb1[_0x9465c6][_0x06f7('0x6f')]],'%s',_0x3e2be6):_0x3e2be6;if(_0x3b6eb1[_0x9465c6][_0x06f7('0x70')]){_0x655f62['group'](_0x3e2be6);}_0x3b6eb1[_0x9465c6][_0x06f7('0x71')]&&_0x655f62[_0x06f7('0x72')](_0x3e2be6,_0x3b6eb1[_0x9465c6]['orderBy']===_0x06f7('0x73')?![]:!![]);_0x655f62[_0x06f7('0x74')](_0x3e2be6,_0x3b6eb1[_0x9465c6][_0x06f7('0x75')]||_0x3e2be6);}if(_0x6113b4[_0x06f7('0x76')]){_0x6113b4[_0x06f7('0x76')]=JSON['parse'](_0x6113b4[_0x06f7('0x76')]);for(var _0x187d3e=0x0;_0x187d3e<_0x6113b4[_0x06f7('0x76')][_0x06f7('0x35')];_0x187d3e+=0x1){if(_0x6113b4[_0x06f7('0x76')][_0x187d3e][_0x06f7('0x3d')]&&_[_0x06f7('0x5b')](_0x217283,_0x6113b4[_0x06f7('0x76')][_0x187d3e][_0x06f7('0x3d')])&&_0x6113b4[_0x06f7('0x76')][_0x187d3e][_0x06f7('0x77')]&&_0x6113b4[_0x06f7('0x76')][_0x187d3e]['foreignTable']&&_0x6113b4[_0x06f7('0x76')][_0x187d3e]['foreignKey']){_0x655f62[_0x6113b4[_0x06f7('0x76')][_0x187d3e][_0x06f7('0x3d')]](_0x6113b4[_0x06f7('0x76')][_0x187d3e][_0x06f7('0x78')],null,util[_0x06f7('0x6f')](_0x06f7('0x79'),_0x6113b4[_0x06f7('0x7a')],_0x6113b4[_0x06f7('0x76')][_0x187d3e][_0x06f7('0x77')],_0x6113b4['joins'][_0x187d3e][_0x06f7('0x78')],_0x6113b4[_0x06f7('0x76')][_0x187d3e][_0x06f7('0x7b')]));}}}if(_0x6113b4['conditions']){_0x6113b4[_0x06f7('0x7c')]=JSON[_0x06f7('0x7d')](_0x6113b4[_0x06f7('0x7c')]);_0x655f62['where'](_0x5666ab(_0x6113b4[_0x06f7('0x7c')][_0x06f7('0x62')]));}_0x5b364c=_0x655f62[_0x06f7('0x7e')]();_0x655f62[_0x06f7('0x1b')](_0x5cd840);_0x655f62['offset'](0x0);logger[_0x06f7('0x7f')](_0x06f7('0x80'),_0x655f62[_0x06f7('0x81')]());return dbH['sequelize'][_0x06f7('0x2f')](_0x655f62[_0x06f7('0x81')](),{'type':dbH[_0x06f7('0x82')][_0x06f7('0x83')][_0x06f7('0x84')]});}})[_0x06f7('0x22')](respondWithResult(_0x154ad4,null))[_0x06f7('0x44')](handleError(_0x154ad4,null));};function runReport(_0x1c0dbf,_0x5cd68e,_0x169ead){var _0x1bb74d=_0x5cd68e[_0x06f7('0x29')];var _0x38e044=0xa;var _0x46b999=[_0x06f7('0x85'),_0x06f7('0x50'),_0x06f7('0x51'),_0x06f7('0x52')];var _0x3ae88f={'SUM':_0x06f7('0x53'),'COUNT':_0x06f7('0x54'),'COUNT DISTINCT':_0x06f7('0x55'),'MAX':_0x06f7('0x86'),'MIN':_0x06f7('0x87'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x06f7('0x88'),'GROUP_CONCAT ASC':_0x06f7('0x57'),'GROUP_CONCAT DESC':_0x06f7('0x89')};var _0x51f50a={'SEC_TO_TIME':_0x06f7('0x58'),'DATE':_0x06f7('0x8a'),'HOUR':_0x06f7('0x8b'),'ROUND':_0x06f7('0x59'),'UNIX_TIMESTAMP':_0x06f7('0x5a')};var _0x282a3b=function(_0x58150b){return!_[_0x06f7('0x5b')](['IS\x20NULL',_0x06f7('0x5d'),_0x06f7('0x5e'),_0x06f7('0x5f')],_0x58150b);};var _0x1b07e0=function(_0x361c1f){if(!_0x361c1f||!_0x361c1f[_0x06f7('0x60')][_0x06f7('0x35')]){return'';}for(var _0x386aa9='(',_0x44d669=0x0;_0x44d669<_0x361c1f[_0x06f7('0x60')][_0x06f7('0x35')];_0x44d669+=0x1){_0x44d669>0x0&&(_0x386aa9+='\x20'+_0x361c1f[_0x06f7('0x61')]+'\x20');_0x386aa9+=_0x361c1f[_0x06f7('0x60')][_0x44d669][_0x06f7('0x62')]?_0x1b07e0(_0x361c1f[_0x06f7('0x60')][_0x44d669][_0x06f7('0x62')]):_0x361c1f[_0x06f7('0x60')][_0x44d669][_0x06f7('0x74')]+'\x20'+_0x361c1f['rules'][_0x44d669][_0x06f7('0x63')]+(_0x282a3b(_0x361c1f['rules'][_0x44d669]['condition'])?'\x20'+_0x361c1f[_0x06f7('0x60')][_0x44d669][_0x06f7('0x8c')]:'');}return _0x386aa9+')';};var _0x30f1f0={'where':{'id':_0x1c0dbf['id']}},_0x246a1f,_0x502709,_0x469963,_0x361080,_0x1eaa8b;_0x30f1f0=_[_0x06f7('0x3f')]({},_0x30f1f0,_0x169ead);return db['AnalyticCustomReport'][_0x06f7('0x4d')](_0x30f1f0)['then'](function(_0x5b66a4){if(_0x5b66a4){_0x246a1f=_0x5b66a4;return _0x5b66a4[_0x06f7('0x8d')]();}return null;})[_0x06f7('0x22')](function(_0x4e8332){if(_0x4e8332){if(!_0x4e8332[_0x06f7('0x35')]){throw new db[(_0x06f7('0x64'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x502709=_0x4e8332;return db[_0x06f7('0x67')][_0x06f7('0x42')]({'raw':!![]});}return null;})[_0x06f7('0x22')](function(_0x185ad8){if(_0x185ad8){_0x469963=_[_0x06f7('0x68')](_0x185ad8,'id');var _0x528a76;var _0x33bfe8=squel[_0x06f7('0x69')]();_0x33bfe8['from'](_0x246a1f[_0x06f7('0x7a')]);for(var _0x131931=0x0;_0x131931<_0x502709[_0x06f7('0x35')];_0x131931+=0x1){_0x528a76=_0x502709[_0x131931][_0x06f7('0x6b')]?_0x469963[_0x502709[_0x131931]['MetricId']][_0x06f7('0x6c')]:_0x502709[_0x131931][_0x06f7('0x74')];_0x528a76=_0x502709[_0x131931][_0x06f7('0x6d')]?_['replace'](_0x3ae88f[_0x502709[_0x131931][_0x06f7('0x6d')]],'%s',_0x528a76):_0x528a76;_0x528a76=_0x502709[_0x131931]['format']?_['replace'](_0x51f50a[_0x502709[_0x131931][_0x06f7('0x6f')]],'%s',_0x528a76):_0x528a76;if(_0x502709[_0x131931][_0x06f7('0x70')]){_0x33bfe8['group'](_0x528a76);}_0x502709[_0x131931]['orderBy']&&_0x33bfe8[_0x06f7('0x72')](_0x528a76,_0x502709[_0x131931][_0x06f7('0x71')]===_0x06f7('0x73')?![]:!![]);_0x33bfe8[_0x06f7('0x74')](_0x528a76,_0x502709[_0x131931][_0x06f7('0x75')]||_0x528a76);}if(_0x246a1f['joins']){_0x246a1f[_0x06f7('0x76')]=JSON['parse'](_0x246a1f[_0x06f7('0x76')]);for(var _0x486c30=0x0;_0x486c30<_0x246a1f[_0x06f7('0x76')]['length'];_0x486c30+=0x1){if(_0x246a1f[_0x06f7('0x76')][_0x486c30][_0x06f7('0x3d')]&&_[_0x06f7('0x5b')](_0x46b999,_0x246a1f[_0x06f7('0x76')][_0x486c30][_0x06f7('0x3d')])&&_0x246a1f[_0x06f7('0x76')][_0x486c30][_0x06f7('0x77')]&&_0x246a1f[_0x06f7('0x76')][_0x486c30][_0x06f7('0x78')]&&_0x246a1f[_0x06f7('0x76')][_0x486c30][_0x06f7('0x7b')]){_0x33bfe8[_0x246a1f[_0x06f7('0x76')][_0x486c30]['type']](_0x246a1f[_0x06f7('0x76')][_0x486c30][_0x06f7('0x78')],null,util[_0x06f7('0x6f')](_0x06f7('0x79'),_0x246a1f[_0x06f7('0x7a')],_0x246a1f[_0x06f7('0x76')][_0x486c30][_0x06f7('0x77')],_0x246a1f[_0x06f7('0x76')][_0x486c30][_0x06f7('0x78')],_0x246a1f[_0x06f7('0x76')][_0x486c30]['foreignKey']));}}}if(_0x246a1f[_0x06f7('0x7c')]){_0x246a1f['conditions']=JSON['parse'](_0x246a1f['conditions']);_0x33bfe8['where'](_0x1b07e0(_0x246a1f[_0x06f7('0x7c')]['group']));}_0x1eaa8b=_0x33bfe8[_0x06f7('0x7e')]();_0x33bfe8[_0x06f7('0x1b')](_0x38e044);_0x33bfe8[_0x06f7('0x18')](0x0);return;}})[_0x06f7('0x22')](function(){if(_0x5cd68e[_0x06f7('0x8e')]===_0x06f7('0x8f')){return null;}var _0x5acaeb=_['merge'](_0x5cd68e,{'name':_0x5cd68e['fullPath']||_0x5cd68e[_0x06f7('0x29')]||_0x246a1f[_0x06f7('0x29')],'basename':_0x1bb74d,'savename':util[_0x06f7('0x6f')](_0x06f7('0x90'),_0x5cd68e['name']||_0x246a1f[_0x06f7('0x29')],require(_0x06f7('0x91'))[_0x06f7('0x92')](0x4),_0x5cd68e[_0x06f7('0x8e')]||_0x06f7('0x93')),'reportId':_0x246a1f['id'],'reportType':_0x06f7('0x94')});return db[_0x06f7('0x95')][_0x06f7('0x48')](_0x5acaeb,{'raw':!![]});})[_0x06f7('0x22')](function(_0x49e97e){if(_0x246a1f[_0x06f7('0x7a')]===_0x06f7('0x96')){_0x1eaa8b[_0x06f7('0x39')](_0x246a1f[_0x06f7('0x7a')]+_0x06f7('0x97'),_0x5cd68e[_0x06f7('0x98')],_0x5cd68e['endDate']);}else{_0x1eaa8b[_0x06f7('0x39')](_0x246a1f[_0x06f7('0x7a')]+_0x06f7('0x99'),_0x5cd68e[_0x06f7('0x98')],_0x5cd68e[_0x06f7('0x9a')]);}if(_0x49e97e){logger[_0x06f7('0x9b')](_0x06f7('0x9c'),_0x1eaa8b[_0x06f7('0x81')]());require(_0x06f7('0x9d'))[_0x06f7('0x9e')](path['join'](__dirname,_0x06f7('0x9f'),_0x49e97e[_0x06f7('0x8e')]),[_0x49e97e['id'],_0x1eaa8b[_0x06f7('0x81')](),path['join'](__dirname,_0x06f7('0xa0'),_0x49e97e[_0x06f7('0xa1')]),_0x1bb74d]);return _0x49e97e;}else{var _0x2b315f=squel[_0x06f7('0x69')]();_0x2b315f[_0x06f7('0x6a')]('('+_0x1eaa8b['toString']()+')',_0x06f7('0xa2'));_0x2b315f['field'](_0x06f7('0xa3'),_0x06f7('0x1a'));_0x1eaa8b[_0x06f7('0x1b')](_0x5cd68e[_0x06f7('0x1b')]||_0x38e044);_0x1eaa8b[_0x06f7('0x18')](_0x5cd68e[_0x06f7('0x18')]||0x0);return dbH['sequelize'][_0x06f7('0x2f')](_0x2b315f[_0x06f7('0x81')](),{'type':dbH[_0x06f7('0x82')][_0x06f7('0x83')][_0x06f7('0x84')]})['then'](function(_0x1873d3){if(!_0x1873d3[_0x06f7('0x35')]){_0x361080=0x0;}else{_0x361080=_0x1873d3[0x0][_0x06f7('0x1a')]||0x0;}return dbH[_0x06f7('0x82')]['query'](_0x1eaa8b[_0x06f7('0x81')](),{'type':dbH[_0x06f7('0x82')]['QueryTypes'][_0x06f7('0x84')]});})['then'](function(_0x4d82c4){return{'rows':_0x4d82c4||[],'count':_0x361080};});}});}exports[_0x06f7('0xa4')]=function(_0x8ae404,_0x12daf7){return runReport(_0x8ae404[_0x06f7('0xa5')],_0x8ae404[_0x06f7('0x2f')],_0x8ae404[_0x06f7('0x40')])[_0x06f7('0x22')](respondWithResult(_0x12daf7,null))[_0x06f7('0x44')](handleError(_0x12daf7,null));};exports[_0x06f7('0xa6')]=runReport;exports['query']=function(_0x3e2c25,_0x5efe03){var _0x2de4ec=0xa;var _0x21bddb=[_0x06f7('0x85'),_0x06f7('0x50'),_0x06f7('0x51'),_0x06f7('0x52')];var _0x457c31={'SUM':_0x06f7('0x53'),'COUNT':_0x06f7('0x54'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x06f7('0x86'),'MIN':'MIN(%s)','AVG':_0x06f7('0x56'),'GROUP_CONCAT':_0x06f7('0x88'),'GROUP_CONCAT ASC':_0x06f7('0x57'),'GROUP_CONCAT DESC':_0x06f7('0x89')};var _0x568888={'SEC_TO_TIME':_0x06f7('0x58'),'DATE':'DATE(%s)','HOUR':_0x06f7('0x8b'),'ROUND':_0x06f7('0x59'),'UNIX_TIMESTAMP':_0x06f7('0x5a')};var _0x4592c7=function(_0x21d1d){return!_[_0x06f7('0x5b')]([_0x06f7('0x5c'),_0x06f7('0x5d'),_0x06f7('0x5e'),_0x06f7('0x5f')],_0x21d1d);};var _0x5cc7a1=function(_0x1ecc4c){if(!_0x1ecc4c||!_0x1ecc4c[_0x06f7('0x60')][_0x06f7('0x35')]){return'';}for(var _0x447abd='(',_0x466a05=0x0;_0x466a05<_0x1ecc4c[_0x06f7('0x60')][_0x06f7('0x35')];_0x466a05+=0x1){_0x466a05>0x0&&(_0x447abd+='\x20'+_0x1ecc4c[_0x06f7('0x61')]+'\x20');_0x447abd+=_0x1ecc4c['rules'][_0x466a05]['group']?_0x5cc7a1(_0x1ecc4c['rules'][_0x466a05][_0x06f7('0x62')]):_0x1ecc4c['rules'][_0x466a05][_0x06f7('0x74')]+'\x20'+_0x1ecc4c['rules'][_0x466a05]['condition']+(_0x4592c7(_0x1ecc4c['rules'][_0x466a05][_0x06f7('0x63')])?'\x20'+_0x1ecc4c['rules'][_0x466a05][_0x06f7('0x8c')]:'');}return _0x447abd+')';};var _0x239735={'where':{'id':_0x3e2c25[_0x06f7('0xa5')]['id']}},_0x2d206f,_0x5bf1be,_0x18c530,_0xa7d33d,_0x501379;_0x239735=_[_0x06f7('0x3f')]({},_0x239735,_0x3e2c25[_0x06f7('0x40')]);return db[_0x06f7('0x2d')]['find'](_0x239735)[_0x06f7('0x22')](function(_0x221bf9){if(_0x221bf9){_0x2d206f=_0x221bf9;return _0x221bf9['getFields']();}return null;})[_0x06f7('0x22')](function(_0x37ef56){if(_0x37ef56){if(!_0x37ef56[_0x06f7('0x35')]){throw new db[(_0x06f7('0x64'))][(_0x06f7('0x65'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x5bf1be=_0x37ef56;return db[_0x06f7('0x67')][_0x06f7('0x42')]({'raw':!![]});}return null;})[_0x06f7('0x22')](function(_0x4b1ab4){if(_0x4b1ab4){_0x18c530=_['keyBy'](_0x4b1ab4,'id');var _0x4bae37;var _0x4afb22=squel['select']();_0x4afb22[_0x06f7('0x6a')](_0x2d206f['table']);for(var _0x392f04=0x0;_0x392f04<_0x5bf1be[_0x06f7('0x35')];_0x392f04+=0x1){_0x4bae37=_0x5bf1be[_0x392f04][_0x06f7('0x6b')]?_0x18c530[_0x5bf1be[_0x392f04][_0x06f7('0x6b')]][_0x06f7('0x6c')]:_0x5bf1be[_0x392f04][_0x06f7('0x74')];_0x4bae37=_0x5bf1be[_0x392f04][_0x06f7('0x6d')]?_[_0x06f7('0x6e')](_0x457c31[_0x5bf1be[_0x392f04][_0x06f7('0x6d')]],'%s',_0x4bae37):_0x4bae37;_0x4bae37=_0x5bf1be[_0x392f04][_0x06f7('0x6f')]?_['replace'](_0x568888[_0x5bf1be[_0x392f04][_0x06f7('0x6f')]],'%s',_0x4bae37):_0x4bae37;if(_0x5bf1be[_0x392f04][_0x06f7('0x70')]){_0x4afb22['group'](_0x4bae37);}_0x5bf1be[_0x392f04][_0x06f7('0x71')]&&_0x4afb22['order'](_0x4bae37,_0x5bf1be[_0x392f04][_0x06f7('0x71')]===_0x06f7('0x73')?![]:!![]);_0x4afb22[_0x06f7('0x74')](_0x4bae37,_0x5bf1be[_0x392f04][_0x06f7('0x75')]||_0x4bae37);}if(_0x2d206f[_0x06f7('0x76')]){_0x2d206f[_0x06f7('0x76')]=JSON['parse'](_0x2d206f[_0x06f7('0x76')]);for(var _0x47ac66=0x0;_0x47ac66<_0x2d206f[_0x06f7('0x76')][_0x06f7('0x35')];_0x47ac66+=0x1){if(_0x2d206f['joins'][_0x47ac66][_0x06f7('0x3d')]&&_[_0x06f7('0x5b')](_0x21bddb,_0x2d206f[_0x06f7('0x76')][_0x47ac66][_0x06f7('0x3d')])&&_0x2d206f[_0x06f7('0x76')][_0x47ac66][_0x06f7('0x77')]&&_0x2d206f['joins'][_0x47ac66][_0x06f7('0x78')]&&_0x2d206f[_0x06f7('0x76')][_0x47ac66][_0x06f7('0x7b')]){_0x4afb22[_0x2d206f[_0x06f7('0x76')][_0x47ac66][_0x06f7('0x3d')]](_0x2d206f[_0x06f7('0x76')][_0x47ac66][_0x06f7('0x78')],null,util[_0x06f7('0x6f')](_0x06f7('0x79'),_0x2d206f[_0x06f7('0x7a')],_0x2d206f['joins'][_0x47ac66][_0x06f7('0x77')],_0x2d206f[_0x06f7('0x76')][_0x47ac66][_0x06f7('0x78')],_0x2d206f[_0x06f7('0x76')][_0x47ac66][_0x06f7('0x7b')]));}}}if(_0x2d206f[_0x06f7('0x7c')]){_0x2d206f['conditions']=JSON[_0x06f7('0x7d')](_0x2d206f[_0x06f7('0x7c')]);_0x4afb22['where'](_0x5cc7a1(_0x2d206f[_0x06f7('0x7c')]['group']));}_0x501379=_0x4afb22['clone']();_0x4afb22[_0x06f7('0x1b')](_0x2de4ec);_0x4afb22[_0x06f7('0x18')](0x0);logger[_0x06f7('0x7f')](_0x06f7('0x80'),_0x4afb22[_0x06f7('0x81')]());return dbH[_0x06f7('0x82')]['query'](_0x4afb22[_0x06f7('0x81')](),{'type':dbH[_0x06f7('0x82')][_0x06f7('0x83')]['SELECT']});}})[_0x06f7('0x22')](function(){return{'sql':_0x501379[_0x06f7('0x81')]()};})[_0x06f7('0x22')](respondWithResult(_0x5efe03,null))[_0x06f7('0x44')](handleError(_0x5efe03,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 785d5ec..7cbed83 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 _0xb0d7=['path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','../../config/logger','moment','request-promise'];(function(_0x26ccb4,_0x1d89dd){var _0x59c549=function(_0x412a4b){while(--_0x412a4b){_0x26ccb4['push'](_0x26ccb4['shift']());}};_0x59c549(++_0x1d89dd);}(_0xb0d7,0xb0));var _0x7b0d=function(_0x512535,_0x4fe5ff){_0x512535=_0x512535-0x0;var _0x1f1ed6=_0xb0d7[_0x512535];return _0x1f1ed6;};'use strict';var _=require(_0x7b0d('0x0'));var util=require('util');var logger=require(_0x7b0d('0x1'))('api');var moment=require(_0x7b0d('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b0d('0x3'));var fs=require('fs');var path=require(_0x7b0d('0x4'));var rimraf=require(_0x7b0d('0x5'));var config=require(_0x7b0d('0x6'));var attributes=require(_0x7b0d('0x7'));module[_0x7b0d('0x8')]=function(_0x42803d,_0x5e8329){return _0x42803d[_0x7b0d('0x9')](_0x7b0d('0xa'),attributes,{'tableName':_0x7b0d('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x28f9=['analytics_custom_reports','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','AnalyticCustomReport'];(function(_0x183964,_0x2dd9ac){var _0x311d8f=function(_0x1b8f9b){while(--_0x1b8f9b){_0x183964['push'](_0x183964['shift']());}};_0x311d8f(++_0x2dd9ac);}(_0x28f9,0x7a));var _0x928f=function(_0x158db6,_0x1ea45d){_0x158db6=_0x158db6-0x0;var _0x200753=_0x28f9[_0x158db6];return _0x200753;};'use strict';var _=require('lodash');var util=require(_0x928f('0x0'));var logger=require(_0x928f('0x1'))(_0x928f('0x2'));var moment=require(_0x928f('0x3'));var BPromise=require(_0x928f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x928f('0x5'));var rimraf=require(_0x928f('0x6'));var config=require(_0x928f('0x7'));var attributes=require('./analyticCustomReport.attributes');module[_0x928f('0x8')]=function(_0x59794b,_0x1772f3){return _0x59794b['define'](_0x928f('0x9'),attributes,{'tableName':_0x928f('0xa'),'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 bf3dd10..b2d78f1 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 _0x6259=['request','AnalyticCustomReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','catch','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0x6259,0x199));var _0x9625=function(_0x567f56,_0x49dd75){_0x567f56=_0x567f56-0x0;var _0x55df17=_0x6259[_0x567f56];return _0x55df17;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9625('0x0'));var BPromise=require(_0x9625('0x1'));var rs=require(_0x9625('0x2'));var fs=require('fs');var Redis=require(_0x9625('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x9625('0x4'))(_0x9625('0x5'));var config=require(_0x9625('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x9625('0x7')][_0x9625('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x243c4e,_0x21cefa,_0x4e9c6d){return new BPromise(function(_0x19272a,_0x391a19){return client[_0x9625('0x9')](_0x243c4e,_0x4e9c6d)['then'](function(_0x16fc99){logger['info'](_0x9625('0xa'),_0x21cefa,'request\x20sent');logger[_0x9625('0xb')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x21cefa,_0x9625('0xc'),JSON[_0x9625('0xd')](_0x16fc99));if(_0x16fc99['error']){if(_0x16fc99[_0x9625('0xe')][_0x9625('0xf')]===0x1f4){logger[_0x9625('0xe')]('AnalyticCustomReport,\x20%s,\x20%s',_0x21cefa,_0x16fc99[_0x9625('0xe')][_0x9625('0x10')]);return _0x391a19(_0x16fc99[_0x9625('0xe')][_0x9625('0x10')]);}logger[_0x9625('0xe')](_0x9625('0xa'),_0x21cefa,_0x16fc99[_0x9625('0xe')]['message']);return _0x19272a(_0x16fc99['error'][_0x9625('0x10')]);}else{logger[_0x9625('0x11')](_0x9625('0xa'),_0x21cefa,'request\x20sent');_0x19272a(_0x16fc99['result'][_0x9625('0x10')]);}})[_0x9625('0x12')](function(_0x333ef9){logger[_0x9625('0xe')](_0x9625('0xa'),_0x21cefa,_0x333ef9);_0x391a19(_0x333ef9);});});} \ No newline at end of file +var _0xf6bd=['http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client'];(function(_0x206794,_0x26fd02){var _0x38a75b=function(_0x208082){while(--_0x208082){_0x206794['push'](_0x206794['shift']());}};_0x38a75b(++_0x26fd02);}(_0xf6bd,0x7b));var _0xdf6b=function(_0x4a8418,_0x39078a){_0x4a8418=_0x4a8418-0x0;var _0x390174=_0xf6bd[_0x4a8418];return _0x390174;};'use strict';var _=require('lodash');var util=require(_0xdf6b('0x0'));var moment=require(_0xdf6b('0x1'));var BPromise=require(_0xdf6b('0x2'));var rs=require(_0xdf6b('0x3'));var fs=require('fs');var Redis=require(_0xdf6b('0x4'));var db=require(_0xdf6b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xdf6b('0x6'))(_0xdf6b('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xdf6b('0x8')][_0xdf6b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x36cbd0,_0x2b31b8,_0x388f1a){return new BPromise(function(_0x1bbbb6,_0x63dc28){return client[_0xdf6b('0xa')](_0x36cbd0,_0x388f1a)[_0xdf6b('0xb')](function(_0x97aee1){logger[_0xdf6b('0xc')](_0xdf6b('0xd'),_0x2b31b8,_0xdf6b('0xe'));logger[_0xdf6b('0xf')](_0xdf6b('0x10'),_0x2b31b8,'request\x20sent',JSON[_0xdf6b('0x11')](_0x97aee1));if(_0x97aee1['error']){if(_0x97aee1[_0xdf6b('0x12')][_0xdf6b('0x13')]===0x1f4){logger[_0xdf6b('0x12')]('AnalyticCustomReport,\x20%s,\x20%s',_0x2b31b8,_0x97aee1[_0xdf6b('0x12')][_0xdf6b('0x14')]);return _0x63dc28(_0x97aee1['error'][_0xdf6b('0x14')]);}logger[_0xdf6b('0x12')](_0xdf6b('0xd'),_0x2b31b8,_0x97aee1[_0xdf6b('0x12')]['message']);return _0x1bbbb6(_0x97aee1['error'][_0xdf6b('0x14')]);}else{logger['info']('AnalyticCustomReport,\x20%s,\x20%s',_0x2b31b8,_0xdf6b('0xe'));_0x1bbbb6(_0x97aee1['result']['message']);}})[_0xdf6b('0x15')](function(_0x45bc66){logger[_0xdf6b('0x12')]('AnalyticCustomReport,\x20%s,\x20%s',_0x2b31b8,_0x45bc66);_0x63dc28(_0x45bc66);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index 0ad56c1..82cd0f6 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 _0x276b=['util','connect-timeout','fs-extra','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','/:id','show','/:id/run','run','post','create','update','delete','destroy','exports','multer'];(function(_0x420f46,_0x389a33){var _0x5992f9=function(_0x298ab9){while(--_0x298ab9){_0x420f46['push'](_0x420f46['shift']());}};_0x5992f9(++_0x389a33);}(_0x276b,0x10d));var _0xb276=function(_0x9290a4,_0x59eba5){_0x9290a4=_0x9290a4-0x0;var _0x2fff5d=_0x276b[_0x9290a4];return _0x2fff5d;};'use strict';var multer=require(_0xb276('0x0'));var util=require(_0xb276('0x1'));var path=require('path');var timeout=require(_0xb276('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xb276('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xb276('0x4'));var controller=require(_0xb276('0x5'));router[_0xb276('0x6')]('/',auth[_0xb276('0x7')](),controller['index']);router[_0xb276('0x6')](_0xb276('0x8'),auth[_0xb276('0x7')](),controller[_0xb276('0x9')]);router[_0xb276('0x6')]('/:id/preview',auth['isAuthenticated'](),controller['preview']);router[_0xb276('0x6')](_0xb276('0xa'),auth['isAuthenticated'](),controller[_0xb276('0xb')]);router['get']('/:id/query',auth[_0xb276('0x7')](),controller['query']);router[_0xb276('0xc')]('/',auth[_0xb276('0x7')](),controller[_0xb276('0xd')]);router['put'](_0xb276('0x8'),auth[_0xb276('0x7')](),controller[_0xb276('0xe')]);router[_0xb276('0xf')](_0xb276('0x8'),auth['isAuthenticated'](),controller[_0xb276('0x10')]);module[_0xb276('0x11')]=router; \ No newline at end of file +var _0x4cc8=['/:id','get','/:id/preview','/:id/run','run','/:id/query','query','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','../../components/auth/service','../../config/environment','./analyticCustomReport.controller','isAuthenticated','index'];(function(_0x4030ee,_0x41fadd){var _0x27f309=function(_0x506771){while(--_0x506771){_0x4030ee['push'](_0x4030ee['shift']());}};_0x27f309(++_0x41fadd);}(_0x4cc8,0x157));var _0x84cc=function(_0x178ddb,_0x44c400){_0x178ddb=_0x178ddb-0x0;var _0x12ce4c=_0x4cc8[_0x178ddb];return _0x12ce4c;};'use strict';var multer=require(_0x84cc('0x0'));var util=require(_0x84cc('0x1'));var path=require(_0x84cc('0x2'));var timeout=require(_0x84cc('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x84cc('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x84cc('0x5'));var controller=require(_0x84cc('0x6'));router['get']('/',auth[_0x84cc('0x7')](),controller[_0x84cc('0x8')]);router['get'](_0x84cc('0x9'),auth[_0x84cc('0x7')](),controller['show']);router[_0x84cc('0xa')](_0x84cc('0xb'),auth[_0x84cc('0x7')](),controller['preview']);router[_0x84cc('0xa')](_0x84cc('0xc'),auth[_0x84cc('0x7')](),controller[_0x84cc('0xd')]);router[_0x84cc('0xa')](_0x84cc('0xe'),auth[_0x84cc('0x7')](),controller[_0x84cc('0xf')]);router['post']('/',auth[_0x84cc('0x7')](),controller[_0x84cc('0x10')]);router[_0x84cc('0x11')](_0x84cc('0x9'),auth[_0x84cc('0x7')](),controller[_0x84cc('0x12')]);router[_0x84cc('0x13')](_0x84cc('0x9'),auth[_0x84cc('0x7')](),controller[_0x84cc('0x14')]);module[_0x84cc('0x15')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index 0631435..4b89ece 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 _0x814b=['STRING','TEXT','sequelize','exports'];(function(_0x281633,_0xa6166a){var _0x4de759=function(_0x400a42){while(--_0x400a42){_0x281633['push'](_0x281633['shift']());}};_0x4de759(++_0xa6166a);}(_0x814b,0x1a2));var _0xb814=function(_0x12e73c,_0x2cbe1d){_0x12e73c=_0x12e73c-0x0;var _0x4c41cb=_0x814b[_0x12e73c];return _0x4c41cb;};'use strict';var Sequelize=require(_0xb814('0x0'));module[_0xb814('0x1')]={'name':{'type':Sequelize[_0xb814('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xb814('0x2')]},'parent':{'type':Sequelize[_0xb814('0x2')]},'table':{'type':Sequelize[_0xb814('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xb814('0x3')]}}; \ No newline at end of file +var _0x7da7=['TEXT','sequelize','exports','STRING'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x7da7,0x10d));var _0x77da=function(_0x3c4062,_0x3767fc){_0x3c4062=_0x3c4062-0x0;var _0x3f5bf3=_0x7da7[_0x3c4062];return _0x3f5bf3;};'use strict';var Sequelize=require(_0x77da('0x0'));module[_0x77da('0x1')]={'name':{'type':Sequelize[_0x77da('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0x77da('0x2')]},'conditions':{'type':Sequelize[_0x77da('0x3')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index d9e5851..4c4c1fa 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 _0x31f0=['fullPath','%s-%s.%s','randomstring','generate','default','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','child_process','../../components/export/','../../files/reports','countTable','COUNT(*)','run','runReport','DATE(%s)','keyBy','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','sox','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','then','get','DefaultReports','destroy','error','name','send','index','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','options','include','findAll','rows','catch','params','length','find','create','user','role','Reports','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','preview','join','left_join','right_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','from','table','function','replace','format','orderBy','DESC','field','alias','parse','joins','parentKey','foreignKey','%s.%s\x20=\x20%s.%s','foreignTable','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','cross_join','COUNT(DISTINCT\x20%s)','AVG(%s)','HOUR(%s)','ROUND(%s)','IS\x20NOT\x20NULL','getFields','MetricId','metric','groupBy','output','web'];(function(_0x540954,_0x52ee3a){var _0x3f94d6=function(_0x15ff99){while(--_0x15ff99){_0x540954['push'](_0x540954['shift']());}};_0x3f94d6(++_0x52ee3a);}(_0x31f0,0xb7));var _0x031f=function(_0x12794e,_0x340e2e){_0x12794e=_0x12794e-0x0;var _0x1e9570=_0x31f0[_0x12794e];return _0x1e9570;};'use strict';var emlformat=require(_0x031f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x031f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x031f('0x2'));var moment=require(_0x031f('0x3'));var BPromise=require(_0x031f('0x4'));var Mustache=require(_0x031f('0x5'));var util=require('util');var path=require(_0x031f('0x6'));var sox=require(_0x031f('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x031f('0x8'));var squel=require('squel');var crypto=require(_0x031f('0x9'));var jsforce=require(_0x031f('0xa'));var deskjs=require(_0x031f('0xb'));var toCsv=require(_0x031f('0xc'));var querystring=require('querystring');var Papa=require(_0x031f('0xd'));var Redis=require(_0x031f('0xe'));var authService=require(_0x031f('0xf'));var qs=require(_0x031f('0x10'));var as=require(_0x031f('0x11'));var hardwareService=require(_0x031f('0x12'));var logger=require(_0x031f('0x13'))(_0x031f('0x14'));var utils=require('../../config/utils');var config=require(_0x031f('0x15'));var licenseUtil=require(_0x031f('0x16'));var db=require(_0x031f('0x17'))['db'];var dbH=require(_0x031f('0x17'))[_0x031f('0x18')];function respondWithStatusCode(_0x405896,_0x1c230d){_0x1c230d=_0x1c230d||0xcc;return function(_0x5d0457){if(_0x5d0457){return _0x405896[_0x031f('0x19')](_0x1c230d);}return _0x405896[_0x031f('0x1a')](_0x1c230d)[_0x031f('0x1b')]();};}function respondWithResult(_0x2e3dfe,_0x2ea549){_0x2ea549=_0x2ea549||0xc8;return function(_0x57f9c0){if(_0x57f9c0){return _0x2e3dfe['status'](_0x2ea549)[_0x031f('0x1c')](_0x57f9c0);}};}function respondWithFilteredResult(_0x3a10aa,_0xe4fc1d){return function(_0x286177){if(_0x286177){var _0x5196b1=typeof _0xe4fc1d[_0x031f('0x1d')]===_0x031f('0x1e')&&typeof _0xe4fc1d['limit']===_0x031f('0x1e');var _0x535e70=_0x286177[_0x031f('0x1f')];var _0x5f2199=_0x5196b1?0x0:_0xe4fc1d[_0x031f('0x1d')];var _0xaa155=_0x5196b1?_0x286177[_0x031f('0x1f')]:_0xe4fc1d[_0x031f('0x1d')]+_0xe4fc1d[_0x031f('0x20')];var _0x2825ef;if(_0xaa155>=_0x535e70){_0xaa155=_0x535e70;_0x2825ef=0xc8;}else{_0x2825ef=0xce;}_0x3a10aa[_0x031f('0x1a')](_0x2825ef);return _0x3a10aa[_0x031f('0x21')](_0x031f('0x22'),_0x5f2199+'-'+_0xaa155+'/'+_0x535e70)['json'](_0x286177);}return null;};}function patchUpdates(_0xf72793){return function(_0x33926c){try{jsonpatch[_0x031f('0x23')](_0x33926c,_0xf72793,!![]);}catch(_0x4d6706){return BPromise['reject'](_0x4d6706);}return _0x33926c[_0x031f('0x24')]();};}function saveUpdates(_0x4d0f92,_0x3472a2){return function(_0x57f6c4){if(_0x57f6c4){return _0x57f6c4['update'](_0x4d0f92)['then'](function(_0x971691){return _0x971691;});}return null;};}function removeEntity(_0x12c406,_0x2920cd){return function(_0x4c8126){if(_0x4c8126){return _0x4c8126['destroy']()[_0x031f('0x25')](function(){var _0x5a64c0=_0x4c8126[_0x031f('0x26')]({'plain':!![]});var _0x1f5a14=_0x031f('0x27');return db['UserProfileResource'][_0x031f('0x28')]({'where':{'type':_0x1f5a14,'resourceId':_0x5a64c0['id']}})[_0x031f('0x25')](function(){return _0x4c8126;});})['then'](function(){_0x12c406[_0x031f('0x1a')](0xcc)[_0x031f('0x1b')]();});}};}function handleEntityNotFound(_0x2403e9,_0x5395ea){return function(_0xa308b){if(!_0xa308b){_0x2403e9[_0x031f('0x19')](0x194);}return _0xa308b;};}function handleError(_0xb6ed6c,_0xaf5bea){_0xaf5bea=_0xaf5bea||0x1f4;return function(_0xfaa36){logger[_0x031f('0x29')](_0xfaa36['stack']);if(_0xfaa36[_0x031f('0x2a')]){delete _0xfaa36[_0x031f('0x2a')];}_0xb6ed6c[_0x031f('0x1a')](_0xaf5bea)[_0x031f('0x2b')](_0xfaa36);};}exports[_0x031f('0x2c')]=function(_0x2d24f0,_0x378692){var _0x87dc07={},_0x2034ac={},_0xfc4a89={'count':0x0,'rows':[]};var _0x2cf3a8=_['map'](db[_0x031f('0x2d')][_0x031f('0x2e')],function(_0xb3a6bd){return{'name':_0xb3a6bd[_0x031f('0x2f')],'type':_0xb3a6bd[_0x031f('0x30')][_0x031f('0x31')]};});_0x2034ac[_0x031f('0x32')]=_[_0x031f('0x33')](_0x2cf3a8,_0x031f('0x2a'));_0x2034ac[_0x031f('0x34')]=_[_0x031f('0x35')](_0x2d24f0[_0x031f('0x34')]);_0x2034ac[_0x031f('0x36')]=_['intersection'](_0x2034ac[_0x031f('0x32')],_0x2034ac[_0x031f('0x34')]);_0x87dc07['attributes']=_[_0x031f('0x37')](_0x2034ac[_0x031f('0x32')],qs['fields'](_0x2d24f0[_0x031f('0x34')][_0x031f('0x38')]));_0x87dc07[_0x031f('0x39')]=_0x87dc07[_0x031f('0x39')]['length']?_0x87dc07['attributes']:_0x2034ac[_0x031f('0x32')];if(!_0x2d24f0['query'][_0x031f('0x3a')](_0x031f('0x3b'))){_0x87dc07[_0x031f('0x20')]=qs['limit'](_0x2d24f0['query'][_0x031f('0x20')]);_0x87dc07['offset']=qs['offset'](_0x2d24f0[_0x031f('0x34')][_0x031f('0x1d')]);}_0x87dc07[_0x031f('0x3c')]=qs[_0x031f('0x3d')](_0x2d24f0[_0x031f('0x34')][_0x031f('0x3d')]);_0x87dc07[_0x031f('0x3e')]=qs['filters'](_[_0x031f('0x3f')](_0x2d24f0[_0x031f('0x34')],_0x2034ac[_0x031f('0x36')]),_0x2cf3a8);if(_0x2d24f0[_0x031f('0x34')]['filter']){_0x87dc07[_0x031f('0x3e')]=_[_0x031f('0x40')](_0x87dc07[_0x031f('0x3e')],{'$or':_['map'](_0x2cf3a8,function(_0x24ec95){if(_0x24ec95[_0x031f('0x30')]!=='VIRTUAL'){var _0x36bafa={};_0x36bafa[_0x24ec95[_0x031f('0x2a')]]={'$like':'%'+_0x2d24f0['query']['filter']+'%'};return _0x36bafa;}})});}_0x87dc07=_[_0x031f('0x40')]({},_0x87dc07,_0x2d24f0[_0x031f('0x41')]);var _0x9efbc4={'where':_0x87dc07[_0x031f('0x3e')]};return db[_0x031f('0x2d')][_0x031f('0x1f')](_0x9efbc4)[_0x031f('0x25')](function(_0x5a212c){_0xfc4a89[_0x031f('0x1f')]=_0x5a212c;if(_0x2d24f0[_0x031f('0x34')]['includeAll']){_0x87dc07[_0x031f('0x42')]=[{'all':!![]}];}return db['AnalyticDefaultReport'][_0x031f('0x43')](_0x87dc07);})[_0x031f('0x25')](function(_0x56dd24){_0xfc4a89[_0x031f('0x44')]=_0x56dd24;return _0xfc4a89;})[_0x031f('0x25')](respondWithFilteredResult(_0x378692,_0x87dc07))[_0x031f('0x45')](handleError(_0x378692,null));};exports['show']=function(_0x98747f,_0x213e1c){var _0x1d3324={'raw':!![],'where':{'id':_0x98747f[_0x031f('0x46')]['id']}},_0x2a6cba={};_0x2a6cba[_0x031f('0x32')]=_[_0x031f('0x35')](db[_0x031f('0x2d')][_0x031f('0x2e')]);_0x2a6cba['query']=_[_0x031f('0x35')](_0x98747f[_0x031f('0x34')]);_0x2a6cba[_0x031f('0x36')]=_[_0x031f('0x37')](_0x2a6cba[_0x031f('0x32')],_0x2a6cba[_0x031f('0x34')]);_0x1d3324[_0x031f('0x39')]=_[_0x031f('0x37')](_0x2a6cba[_0x031f('0x32')],qs['fields'](_0x98747f[_0x031f('0x34')]['fields']));_0x1d3324['attributes']=_0x1d3324[_0x031f('0x39')][_0x031f('0x47')]?_0x1d3324[_0x031f('0x39')]:_0x2a6cba[_0x031f('0x32')];if(_0x98747f[_0x031f('0x34')]['includeAll']){_0x1d3324[_0x031f('0x42')]=[{'all':!![]}];}_0x1d3324=_[_0x031f('0x40')]({},_0x1d3324,_0x98747f[_0x031f('0x41')]);return db['AnalyticDefaultReport'][_0x031f('0x48')](_0x1d3324)[_0x031f('0x25')](handleEntityNotFound(_0x213e1c,null))[_0x031f('0x25')](respondWithResult(_0x213e1c,null))[_0x031f('0x45')](handleError(_0x213e1c,null));};exports[_0x031f('0x49')]=function(_0x12d28e,_0x5caeb5){return db['AnalyticDefaultReport'][_0x031f('0x49')](_0x12d28e['body'],{})[_0x031f('0x25')](function(_0x3bba44){var _0x5a29e0=_0x12d28e[_0x031f('0x4a')]['get']({'plain':!![]});if(!_0x5a29e0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5a29e0[_0x031f('0x4b')]==='user'){var _0x16bade=_0x3bba44['get']({'plain':!![]});var _0x11bf43=_0x031f('0x4c');return db['UserProfileSection'][_0x031f('0x48')]({'where':{'name':_0x11bf43,'userProfileId':_0x5a29e0[_0x031f('0x4d')]},'raw':!![]})['then'](function(_0x46471a){if(_0x46471a&&_0x46471a['autoAssociation']===0x0){return db[_0x031f('0x4e')]['create']({'name':_0x16bade[_0x031f('0x2a')],'resourceId':_0x16bade['id'],'type':_0x031f('0x27'),'sectionId':_0x46471a['id']},{})[_0x031f('0x25')](function(){return _0x3bba44;});}else{return _0x3bba44;}})[_0x031f('0x45')](function(_0x691a68){logger['error'](_0x031f('0x4f'),_0x691a68);throw _0x691a68;});}return _0x3bba44;})['then'](respondWithResult(_0x5caeb5,0xc9))[_0x031f('0x45')](handleError(_0x5caeb5,null));};exports[_0x031f('0x50')]=function(_0x4d49f8,_0x1f9c55){if(_0x4d49f8[_0x031f('0x51')]['id']){delete _0x4d49f8['body']['id'];}return db[_0x031f('0x2d')][_0x031f('0x48')]({'where':{'id':_0x4d49f8[_0x031f('0x46')]['id']}})['then'](handleEntityNotFound(_0x1f9c55,null))[_0x031f('0x25')](saveUpdates(_0x4d49f8['body'],null))[_0x031f('0x25')](respondWithResult(_0x1f9c55,null))['catch'](handleError(_0x1f9c55,null));};exports[_0x031f('0x28')]=function(_0x561a2b,_0xa52a54){return db[_0x031f('0x2d')]['find']({'where':{'id':_0x561a2b['params']['id']}})[_0x031f('0x25')](handleEntityNotFound(_0xa52a54,null))[_0x031f('0x25')](removeEntity(_0xa52a54,null))['catch'](handleError(_0xa52a54,null));};exports[_0x031f('0x52')]=function(_0xb44c73,_0x255003){var _0x286d4e=0xa;var _0x21a89d=[_0x031f('0x53'),_0x031f('0x54'),_0x031f('0x55'),'cross_join'];var _0xe452c2={'SUM':_0x031f('0x56'),'COUNT':_0x031f('0x57'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x031f('0x58'),'MIN':_0x031f('0x59'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x031f('0x5a'),'GROUP_CONCAT ASC':_0x031f('0x5b'),'GROUP_CONCAT DESC':_0x031f('0x5c')};var _0x198e2e={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x031f('0x5d')};var _0xcf8b7=function(_0x4a7fbb){return!_[_0x031f('0x5e')]([_0x031f('0x5f'),'IS\x20NOT\x20NULL',_0x031f('0x60'),_0x031f('0x61')],_0x4a7fbb);};var _0x451c71=function(_0x22d211){if(!_0x22d211||!_0x22d211[_0x031f('0x62')][_0x031f('0x47')]){return'';}for(var _0x2ddf15='(',_0x4527e5=0x0;_0x4527e5<_0x22d211[_0x031f('0x62')]['length'];_0x4527e5+=0x1){_0x4527e5>0x0&&(_0x2ddf15+='\x20'+_0x22d211[_0x031f('0x63')]+'\x20');_0x2ddf15+=_0x22d211['rules'][_0x4527e5][_0x031f('0x64')]?_0x451c71(_0x22d211[_0x031f('0x62')][_0x4527e5][_0x031f('0x64')]):_0x22d211['rules'][_0x4527e5]['field']+'\x20'+_0x22d211[_0x031f('0x62')][_0x4527e5][_0x031f('0x65')]+(_0xcf8b7(_0x22d211[_0x031f('0x62')][_0x4527e5][_0x031f('0x65')])?'\x20'+_0x22d211['rules'][_0x4527e5][_0x031f('0x66')]:'');}return _0x2ddf15+')';};var _0x5a181c={'where':{'id':_0xb44c73[_0x031f('0x46')]['id']}},_0x478982,_0x2179ee,_0x534bae,_0x50d618,_0x71e67;_0x5a181c=_[_0x031f('0x40')]({},_0x5a181c,_0xb44c73[_0x031f('0x41')]);return db[_0x031f('0x2d')]['find'](_0x5a181c)['then'](function(_0x214eec){if(_0x214eec){_0x478982=_0x214eec;return _0x214eec['getFields']();}return null;})[_0x031f('0x25')](function(_0xa921b2){if(_0xa921b2){if(!_0xa921b2['length']){throw new db[(_0x031f('0x67'))][(_0x031f('0x68'))](_0x031f('0x69'),0x193);}_0x2179ee=_0xa921b2;return db[_0x031f('0x6a')][_0x031f('0x43')]({'raw':!![]});}return null;})[_0x031f('0x25')](function(_0x5bea08){if(_0x5bea08){_0x534bae=_['keyBy'](_0x5bea08,'id');var _0x3bcc7e;var _0x232b62=squel[_0x031f('0x6b')]();_0x232b62[_0x031f('0x6c')](_0x478982[_0x031f('0x6d')]);for(var _0x26fa57=0x0;_0x26fa57<_0x2179ee[_0x031f('0x47')];_0x26fa57+=0x1){_0x3bcc7e=_0x2179ee[_0x26fa57]['MetricId']?_0x534bae[_0x2179ee[_0x26fa57]['MetricId']]['metric']:_0x2179ee[_0x26fa57]['field'];_0x3bcc7e=_0x2179ee[_0x26fa57][_0x031f('0x6e')]?_[_0x031f('0x6f')](_0xe452c2[_0x2179ee[_0x26fa57][_0x031f('0x6e')]],'%s',_0x3bcc7e):_0x3bcc7e;_0x3bcc7e=_0x2179ee[_0x26fa57]['format']?_[_0x031f('0x6f')](_0x198e2e[_0x2179ee[_0x26fa57][_0x031f('0x70')]],'%s',_0x3bcc7e):_0x3bcc7e;if(_0x2179ee[_0x26fa57]['groupBy']){_0x232b62[_0x031f('0x64')](_0x3bcc7e);}_0x2179ee[_0x26fa57][_0x031f('0x71')]&&_0x232b62[_0x031f('0x3c')](_0x3bcc7e,_0x2179ee[_0x26fa57][_0x031f('0x71')]===_0x031f('0x72')?![]:!![]);_0x232b62[_0x031f('0x73')](_0x3bcc7e,_0x2179ee[_0x26fa57][_0x031f('0x74')]||_0x3bcc7e);}if(_0x478982['joins']){_0x478982['joins']=JSON[_0x031f('0x75')](_0x478982['joins']);for(var _0x2ed9c1=0x0;_0x2ed9c1<_0x478982['joins'][_0x031f('0x47')];_0x2ed9c1+=0x1){if(_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x30')]&&_['includes'](_0x21a89d,_0x478982[_0x031f('0x76')][_0x2ed9c1]['type'])&&_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x77')]&&_0x478982[_0x031f('0x76')][_0x2ed9c1]['foreignTable']&&_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x78')]){_0x232b62[_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x30')]](_0x478982[_0x031f('0x76')][_0x2ed9c1]['foreignTable'],null,util['format'](_0x031f('0x79'),_0x478982[_0x031f('0x6d')],_0x478982['joins'][_0x2ed9c1][_0x031f('0x77')],_0x478982['joins'][_0x2ed9c1][_0x031f('0x7a')],_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x78')]));}}}if(_0x478982[_0x031f('0x7b')]){_0x478982['conditions']=JSON[_0x031f('0x75')](_0x478982[_0x031f('0x7b')]);_0x232b62[_0x031f('0x3e')](_0x451c71(_0x478982['conditions'][_0x031f('0x64')]));}_0x71e67=_0x232b62[_0x031f('0x7c')]();_0x232b62['limit'](_0x286d4e);_0x232b62[_0x031f('0x1d')](0x0);logger[_0x031f('0x7d')](_0x031f('0x7e'),_0x232b62[_0x031f('0x7f')]());return dbH[_0x031f('0x80')][_0x031f('0x34')](_0x232b62[_0x031f('0x7f')](),{'type':dbH['sequelize'][_0x031f('0x81')][_0x031f('0x82')]});}})[_0x031f('0x25')](respondWithResult(_0x255003,null))['catch'](handleError(_0x255003,null));};function runReport(_0x4f4aff,_0x26de7c,_0x5bd344){var _0x54f02d=_0x26de7c[_0x031f('0x2a')];var _0x184bbd=0xa;var _0x1c8055=[_0x031f('0x53'),_0x031f('0x54'),_0x031f('0x55'),_0x031f('0x83')];var _0x32c626={'SUM':_0x031f('0x56'),'COUNT':_0x031f('0x57'),'COUNT DISTINCT':_0x031f('0x84'),'MAX':'MAX(%s)','MIN':_0x031f('0x59'),'AVG':_0x031f('0x85'),'GROUP_CONCAT':_0x031f('0x5a'),'GROUP_CONCAT ASC':_0x031f('0x5b'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x6970f5={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x031f('0x86'),'ROUND':_0x031f('0x87'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x510bb6=function(_0x3cfaa4){return!_[_0x031f('0x5e')]([_0x031f('0x5f'),_0x031f('0x88'),_0x031f('0x60'),_0x031f('0x61')],_0x3cfaa4);};var _0x5e0853=function(_0x263658){if(!_0x263658||!_0x263658[_0x031f('0x62')]['length']){return'';}for(var _0x25ea89='(',_0x2f2e96=0x0;_0x2f2e96<_0x263658[_0x031f('0x62')][_0x031f('0x47')];_0x2f2e96+=0x1){_0x2f2e96>0x0&&(_0x25ea89+='\x20'+_0x263658[_0x031f('0x63')]+'\x20');_0x25ea89+=_0x263658[_0x031f('0x62')][_0x2f2e96][_0x031f('0x64')]?_0x5e0853(_0x263658['rules'][_0x2f2e96][_0x031f('0x64')]):_0x263658['rules'][_0x2f2e96][_0x031f('0x73')]+'\x20'+_0x263658[_0x031f('0x62')][_0x2f2e96][_0x031f('0x65')]+(_0x510bb6(_0x263658['rules'][_0x2f2e96]['condition'])?'\x20'+_0x263658['rules'][_0x2f2e96][_0x031f('0x66')]:'');}return _0x25ea89+')';};var _0xee744={'where':{'id':_0x4f4aff['id']}},_0x8f0afd,_0x2985fe,_0x290f82,_0x307246,_0x232aa0;_0xee744=_['merge']({},_0xee744,_0x5bd344);return db['AnalyticDefaultReport'][_0x031f('0x48')](_0xee744)[_0x031f('0x25')](function(_0x54d86e){if(_0x54d86e){_0x8f0afd=_0x54d86e;return _0x54d86e[_0x031f('0x89')]();}return null;})['then'](function(_0x1c31d5){if(_0x1c31d5){if(!_0x1c31d5[_0x031f('0x47')]){throw new db['Sequelize'][(_0x031f('0x68'))](_0x031f('0x69'),0x193);}_0x2985fe=_0x1c31d5;return db['AnalyticMetric'][_0x031f('0x43')]({'raw':!![]});}return null;})[_0x031f('0x25')](function(_0x1b588e){if(_0x1b588e){_0x290f82=_['keyBy'](_0x1b588e,'id');var _0xa9b5e2;var _0x31504b=squel[_0x031f('0x6b')]();_0x31504b[_0x031f('0x6c')](_0x8f0afd[_0x031f('0x6d')]);for(var _0x2b3326=0x0;_0x2b3326<_0x2985fe['length'];_0x2b3326+=0x1){_0xa9b5e2=_0x2985fe[_0x2b3326][_0x031f('0x8a')]?_0x290f82[_0x2985fe[_0x2b3326][_0x031f('0x8a')]][_0x031f('0x8b')]:_0x2985fe[_0x2b3326][_0x031f('0x73')];_0xa9b5e2=_0x2985fe[_0x2b3326]['function']?_[_0x031f('0x6f')](_0x32c626[_0x2985fe[_0x2b3326][_0x031f('0x6e')]],'%s',_0xa9b5e2):_0xa9b5e2;_0xa9b5e2=_0x2985fe[_0x2b3326]['format']?_[_0x031f('0x6f')](_0x6970f5[_0x2985fe[_0x2b3326][_0x031f('0x70')]],'%s',_0xa9b5e2):_0xa9b5e2;if(_0x2985fe[_0x2b3326][_0x031f('0x8c')]){_0x31504b[_0x031f('0x64')](_0xa9b5e2);}_0x2985fe[_0x2b3326][_0x031f('0x71')]&&_0x31504b[_0x031f('0x3c')](_0xa9b5e2,_0x2985fe[_0x2b3326][_0x031f('0x71')]===_0x031f('0x72')?![]:!![]);_0x31504b[_0x031f('0x73')](_0xa9b5e2,_0x2985fe[_0x2b3326][_0x031f('0x74')]||_0xa9b5e2);}if(_0x8f0afd[_0x031f('0x76')]){_0x8f0afd[_0x031f('0x76')]=JSON[_0x031f('0x75')](_0x8f0afd[_0x031f('0x76')]);for(var _0x2433ce=0x0;_0x2433ce<_0x8f0afd['joins'][_0x031f('0x47')];_0x2433ce+=0x1){if(_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x30')]&&_[_0x031f('0x5e')](_0x1c8055,_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x30')])&&_0x8f0afd['joins'][_0x2433ce]['parentKey']&&_0x8f0afd['joins'][_0x2433ce][_0x031f('0x7a')]&&_0x8f0afd[_0x031f('0x76')][_0x2433ce]['foreignKey']){_0x31504b[_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x30')]](_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x7a')],null,util['format'](_0x031f('0x79'),_0x8f0afd[_0x031f('0x6d')],_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x77')],_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x7a')],_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x78')]));}}}if(_0x8f0afd[_0x031f('0x7b')]){_0x8f0afd[_0x031f('0x7b')]=JSON[_0x031f('0x75')](_0x8f0afd[_0x031f('0x7b')]);_0x31504b['where'](_0x5e0853(_0x8f0afd[_0x031f('0x7b')][_0x031f('0x64')]));}_0x232aa0=_0x31504b['clone']();_0x31504b[_0x031f('0x20')](_0x184bbd);_0x31504b[_0x031f('0x1d')](0x0);return;}})['then'](function(){if(_0x26de7c[_0x031f('0x8d')]===_0x031f('0x8e')){return null;}var _0x1ade73=_[_0x031f('0x40')](_0x26de7c,{'name':_0x26de7c[_0x031f('0x8f')]||_0x26de7c[_0x031f('0x2a')]||_0x8f0afd[_0x031f('0x2a')],'basename':_0x54f02d,'savename':util[_0x031f('0x70')](_0x031f('0x90'),_0x26de7c['name']||_0x8f0afd[_0x031f('0x2a')],require(_0x031f('0x91'))[_0x031f('0x92')](0x4),_0x26de7c['output']||'csv'),'reportId':_0x8f0afd['id'],'reportType':_0x031f('0x93')});return db['AnalyticExtractedReport'][_0x031f('0x49')](_0x1ade73,{'raw':!![]});})[_0x031f('0x25')](function(_0x4a96f2){if(_0x8f0afd[_0x031f('0x6d')]===_0x031f('0x94')){_0x232aa0[_0x031f('0x3e')](_0x8f0afd[_0x031f('0x6d')]+_0x031f('0x95'),_0x26de7c[_0x031f('0x96')],_0x26de7c[_0x031f('0x97')]);}else{_0x232aa0[_0x031f('0x3e')](_0x8f0afd[_0x031f('0x6d')]+_0x031f('0x98'),_0x26de7c[_0x031f('0x96')],_0x26de7c[_0x031f('0x97')]);}if(_0x4a96f2){logger[_0x031f('0x99')]('Run\x20Query:',_0x232aa0['toString']());require(_0x031f('0x9a'))['fork'](path[_0x031f('0x53')](__dirname,_0x031f('0x9b'),_0x4a96f2[_0x031f('0x8d')]),[_0x4a96f2['id'],_0x232aa0['toString'](),path[_0x031f('0x53')](__dirname,_0x031f('0x9c'),_0x4a96f2['savename']),_0x54f02d]);return _0x4a96f2;}else{var _0x185085=squel[_0x031f('0x6b')]();_0x185085[_0x031f('0x6c')]('('+_0x232aa0[_0x031f('0x7f')]()+')',_0x031f('0x9d'));_0x185085[_0x031f('0x73')](_0x031f('0x9e'),'count');_0x232aa0[_0x031f('0x20')](_0x26de7c[_0x031f('0x20')]||_0x184bbd);_0x232aa0[_0x031f('0x1d')](_0x26de7c[_0x031f('0x1d')]||0x0);return dbH['sequelize']['query'](_0x185085[_0x031f('0x7f')](),{'type':dbH['sequelize']['QueryTypes'][_0x031f('0x82')]})['then'](function(_0x579ade){if(!_0x579ade[_0x031f('0x47')]){_0x307246=0x0;}else{_0x307246=_0x579ade[0x0][_0x031f('0x1f')]||0x0;}return dbH[_0x031f('0x80')][_0x031f('0x34')](_0x232aa0[_0x031f('0x7f')](),{'type':dbH[_0x031f('0x80')]['QueryTypes'][_0x031f('0x82')]});})[_0x031f('0x25')](function(_0x52a3f0){return{'rows':_0x52a3f0||[],'count':_0x307246};});}});}exports[_0x031f('0x9f')]=function(_0x355e1a,_0x30c32f){return runReport(_0x355e1a[_0x031f('0x46')],_0x355e1a['query'],_0x355e1a['options'])['then'](respondWithResult(_0x30c32f,null))[_0x031f('0x45')](handleError(_0x30c32f,null));};exports[_0x031f('0xa0')]=runReport;exports[_0x031f('0x34')]=function(_0x3ec98a,_0x3ed663){var _0xac324f=0xa;var _0xcf0af9=[_0x031f('0x53'),_0x031f('0x54'),'right_join',_0x031f('0x83')];var _0xde544e={'SUM':_0x031f('0x56'),'COUNT':_0x031f('0x57'),'COUNT DISTINCT':_0x031f('0x84'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x031f('0x5a'),'GROUP_CONCAT ASC':_0x031f('0x5b'),'GROUP_CONCAT DESC':_0x031f('0x5c')};var _0x84cd0c={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x031f('0xa1'),'HOUR':'HOUR(%s)','ROUND':_0x031f('0x87'),'UNIX_TIMESTAMP':_0x031f('0x5d')};var _0x24aff3=function(_0x35a1f1){return!_[_0x031f('0x5e')](['IS\x20NULL',_0x031f('0x88'),_0x031f('0x60'),_0x031f('0x61')],_0x35a1f1);};var _0x3cb099=function(_0x4a4d8f){if(!_0x4a4d8f||!_0x4a4d8f[_0x031f('0x62')][_0x031f('0x47')]){return'';}for(var _0x578201='(',_0xdbf09f=0x0;_0xdbf09f<_0x4a4d8f['rules'][_0x031f('0x47')];_0xdbf09f+=0x1){_0xdbf09f>0x0&&(_0x578201+='\x20'+_0x4a4d8f[_0x031f('0x63')]+'\x20');_0x578201+=_0x4a4d8f[_0x031f('0x62')][_0xdbf09f][_0x031f('0x64')]?_0x3cb099(_0x4a4d8f[_0x031f('0x62')][_0xdbf09f]['group']):_0x4a4d8f[_0x031f('0x62')][_0xdbf09f]['field']+'\x20'+_0x4a4d8f[_0x031f('0x62')][_0xdbf09f][_0x031f('0x65')]+(_0x24aff3(_0x4a4d8f['rules'][_0xdbf09f][_0x031f('0x65')])?'\x20'+_0x4a4d8f[_0x031f('0x62')][_0xdbf09f][_0x031f('0x66')]:'');}return _0x578201+')';};var _0x123b4d={'where':{'id':_0x3ec98a['params']['id']}},_0x3f80b5,_0x53cd67,_0x516f11,_0x50cdb2,_0x2e9a3b;_0x123b4d=_[_0x031f('0x40')]({},_0x123b4d,_0x3ec98a[_0x031f('0x41')]);return db[_0x031f('0x2d')][_0x031f('0x48')](_0x123b4d)[_0x031f('0x25')](function(_0x53911d){if(_0x53911d){_0x3f80b5=_0x53911d;return _0x53911d[_0x031f('0x89')]();}return null;})['then'](function(_0x30fa18){if(_0x30fa18){if(!_0x30fa18[_0x031f('0x47')]){throw new db[(_0x031f('0x67'))]['ValidationErrorItem'](_0x031f('0x69'),0x193);}_0x53cd67=_0x30fa18;return db[_0x031f('0x6a')][_0x031f('0x43')]({'raw':!![]});}return null;})[_0x031f('0x25')](function(_0x5b092c){if(_0x5b092c){_0x516f11=_[_0x031f('0xa2')](_0x5b092c,'id');var _0x7b8699;var _0x14a497=squel[_0x031f('0x6b')]();_0x14a497[_0x031f('0x6c')](_0x3f80b5[_0x031f('0x6d')]);for(var _0x59fd9a=0x0;_0x59fd9a<_0x53cd67[_0x031f('0x47')];_0x59fd9a+=0x1){_0x7b8699=_0x53cd67[_0x59fd9a][_0x031f('0x8a')]?_0x516f11[_0x53cd67[_0x59fd9a][_0x031f('0x8a')]][_0x031f('0x8b')]:_0x53cd67[_0x59fd9a][_0x031f('0x73')];_0x7b8699=_0x53cd67[_0x59fd9a][_0x031f('0x6e')]?_[_0x031f('0x6f')](_0xde544e[_0x53cd67[_0x59fd9a]['function']],'%s',_0x7b8699):_0x7b8699;_0x7b8699=_0x53cd67[_0x59fd9a][_0x031f('0x70')]?_[_0x031f('0x6f')](_0x84cd0c[_0x53cd67[_0x59fd9a][_0x031f('0x70')]],'%s',_0x7b8699):_0x7b8699;if(_0x53cd67[_0x59fd9a][_0x031f('0x8c')]){_0x14a497[_0x031f('0x64')](_0x7b8699);}_0x53cd67[_0x59fd9a]['orderBy']&&_0x14a497[_0x031f('0x3c')](_0x7b8699,_0x53cd67[_0x59fd9a][_0x031f('0x71')]===_0x031f('0x72')?![]:!![]);_0x14a497[_0x031f('0x73')](_0x7b8699,_0x53cd67[_0x59fd9a][_0x031f('0x74')]||_0x7b8699);}if(_0x3f80b5['joins']){_0x3f80b5[_0x031f('0x76')]=JSON[_0x031f('0x75')](_0x3f80b5[_0x031f('0x76')]);for(var _0x110747=0x0;_0x110747<_0x3f80b5[_0x031f('0x76')]['length'];_0x110747+=0x1){if(_0x3f80b5['joins'][_0x110747][_0x031f('0x30')]&&_[_0x031f('0x5e')](_0xcf0af9,_0x3f80b5['joins'][_0x110747][_0x031f('0x30')])&&_0x3f80b5['joins'][_0x110747][_0x031f('0x77')]&&_0x3f80b5[_0x031f('0x76')][_0x110747][_0x031f('0x7a')]&&_0x3f80b5[_0x031f('0x76')][_0x110747]['foreignKey']){_0x14a497[_0x3f80b5['joins'][_0x110747][_0x031f('0x30')]](_0x3f80b5[_0x031f('0x76')][_0x110747][_0x031f('0x7a')],null,util[_0x031f('0x70')]('%s.%s\x20=\x20%s.%s',_0x3f80b5[_0x031f('0x6d')],_0x3f80b5[_0x031f('0x76')][_0x110747][_0x031f('0x77')],_0x3f80b5['joins'][_0x110747][_0x031f('0x7a')],_0x3f80b5[_0x031f('0x76')][_0x110747][_0x031f('0x78')]));}}}if(_0x3f80b5['conditions']){_0x3f80b5[_0x031f('0x7b')]=JSON[_0x031f('0x75')](_0x3f80b5[_0x031f('0x7b')]);_0x14a497[_0x031f('0x3e')](_0x3cb099(_0x3f80b5[_0x031f('0x7b')]['group']));}_0x2e9a3b=_0x14a497[_0x031f('0x7c')]();_0x14a497[_0x031f('0x20')](_0xac324f);_0x14a497[_0x031f('0x1d')](0x0);logger[_0x031f('0x7d')](_0x031f('0x7e'),_0x14a497[_0x031f('0x7f')]());return dbH['sequelize']['query'](_0x14a497[_0x031f('0x7f')](),{'type':dbH[_0x031f('0x80')][_0x031f('0x81')][_0x031f('0x82')]});}})[_0x031f('0x25')](function(){return{'sql':_0x2e9a3b[_0x031f('0x7f')]()};})[_0x031f('0x25')](respondWithResult(_0x3ed663,null))['catch'](handleError(_0x3ed663,null));}; \ No newline at end of file +var _0xc4aa=['Content-Range','apply','reject','save','update','then','destroy','get','DefaultReports','UserProfileResource','name','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','AnalyticDefaultReport','findAll','rows','catch','show','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','orderBy','joins','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','clone','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','COUNT(%s)','MAX(%s)','AVG(%s)','SEC_TO_TIME(%s)','IS\x20NOT\x20EMPTY','value','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','groupBy','alias','includes','foreignKey','output','web','fullPath','%s-%s.%s','randomstring','default','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','startDate','info','Run\x20Query:','child_process','fork','countTable','runReport','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20NOT\x20NULL','eml-format','rimraf','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'];(function(_0x4e6ae6,_0x49dba6){var _0x23c108=function(_0x1bc103){while(--_0x1bc103){_0x4e6ae6['push'](_0x4e6ae6['shift']());}};_0x23c108(++_0x49dba6);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0xc4aa[_0x3d42d8];return _0x27fc41;};'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'];var dbH=require(_0xac4a('0x16'))['dbH'];function respondWithStatusCode(_0x21a79,_0x68424a){_0x68424a=_0x68424a||0xcc;return function(_0x247b78){if(_0x247b78){return _0x21a79[_0xac4a('0x17')](_0x68424a);}return _0x21a79[_0xac4a('0x18')](_0x68424a)[_0xac4a('0x19')]();};}function respondWithResult(_0x34bc01,_0x33c287){_0x33c287=_0x33c287||0xc8;return function(_0x190418){if(_0x190418){return _0x34bc01[_0xac4a('0x18')](_0x33c287)[_0xac4a('0x1a')](_0x190418);}};}function respondWithFilteredResult(_0x26dbb8,_0x4a2119){return function(_0x402fff){if(_0x402fff){var _0x34d797=typeof _0x4a2119[_0xac4a('0x1b')]===_0xac4a('0x1c')&&typeof _0x4a2119[_0xac4a('0x1d')]===_0xac4a('0x1c');var _0x28e304=_0x402fff[_0xac4a('0x1e')];var _0x546c5d=_0x34d797?0x0:_0x4a2119['offset'];var _0x21a729=_0x34d797?_0x402fff[_0xac4a('0x1e')]:_0x4a2119[_0xac4a('0x1b')]+_0x4a2119['limit'];var _0x39e83e;if(_0x21a729>=_0x28e304){_0x21a729=_0x28e304;_0x39e83e=0xc8;}else{_0x39e83e=0xce;}_0x26dbb8[_0xac4a('0x18')](_0x39e83e);return _0x26dbb8[_0xac4a('0x1f')](_0xac4a('0x20'),_0x546c5d+'-'+_0x21a729+'/'+_0x28e304)[_0xac4a('0x1a')](_0x402fff);}return null;};}function patchUpdates(_0x3e829c){return function(_0xe38996){try{jsonpatch[_0xac4a('0x21')](_0xe38996,_0x3e829c,!![]);}catch(_0x534092){return BPromise[_0xac4a('0x22')](_0x534092);}return _0xe38996[_0xac4a('0x23')]();};}function saveUpdates(_0x599787,_0x3d7ce0){return function(_0x4169c0){if(_0x4169c0){return _0x4169c0[_0xac4a('0x24')](_0x599787)[_0xac4a('0x25')](function(_0x4d2d6c){return _0x4d2d6c;});}return null;};}function removeEntity(_0x1b7998,_0x2503d8){return function(_0x15435c){if(_0x15435c){return _0x15435c[_0xac4a('0x26')]()[_0xac4a('0x25')](function(){var _0x2b0dc2=_0x15435c[_0xac4a('0x27')]({'plain':!![]});var _0x36054a=_0xac4a('0x28');return db[_0xac4a('0x29')][_0xac4a('0x26')]({'where':{'type':_0x36054a,'resourceId':_0x2b0dc2['id']}})[_0xac4a('0x25')](function(){return _0x15435c;});})[_0xac4a('0x25')](function(){_0x1b7998[_0xac4a('0x18')](0xcc)[_0xac4a('0x19')]();});}};}function handleEntityNotFound(_0x20202c,_0x4e17ce){return function(_0x23b061){if(!_0x23b061){_0x20202c[_0xac4a('0x17')](0x194);}return _0x23b061;};}function handleError(_0x42a33c,_0x2772fe){_0x2772fe=_0x2772fe||0x1f4;return function(_0x116700){logger['error'](_0x116700['stack']);if(_0x116700[_0xac4a('0x2a')]){delete _0x116700[_0xac4a('0x2a')];}_0x42a33c[_0xac4a('0x18')](_0x2772fe)['send'](_0x116700);};}exports['index']=function(_0x355755,_0x2896bc){var _0x228629={},_0x432066={},_0x17118e={'count':0x0,'rows':[]};var _0x53d3a5=_[_0xac4a('0x2b')](db['AnalyticDefaultReport'][_0xac4a('0x2c')],function(_0x57adcf){return{'name':_0x57adcf[_0xac4a('0x2d')],'type':_0x57adcf[_0xac4a('0x2e')][_0xac4a('0x2f')]};});_0x432066[_0xac4a('0x30')]=_[_0xac4a('0x2b')](_0x53d3a5,_0xac4a('0x2a'));_0x432066[_0xac4a('0x31')]=_[_0xac4a('0x32')](_0x355755[_0xac4a('0x31')]);_0x432066[_0xac4a('0x33')]=_[_0xac4a('0x34')](_0x432066[_0xac4a('0x30')],_0x432066[_0xac4a('0x31')]);_0x228629[_0xac4a('0x35')]=_['intersection'](_0x432066[_0xac4a('0x30')],qs[_0xac4a('0x36')](_0x355755['query'][_0xac4a('0x36')]));_0x228629[_0xac4a('0x35')]=_0x228629['attributes']['length']?_0x228629[_0xac4a('0x35')]:_0x432066[_0xac4a('0x30')];if(!_0x355755[_0xac4a('0x31')][_0xac4a('0x37')]('nolimit')){_0x228629[_0xac4a('0x1d')]=qs[_0xac4a('0x1d')](_0x355755['query'][_0xac4a('0x1d')]);_0x228629[_0xac4a('0x1b')]=qs[_0xac4a('0x1b')](_0x355755['query'][_0xac4a('0x1b')]);}_0x228629[_0xac4a('0x38')]=qs[_0xac4a('0x39')](_0x355755['query'][_0xac4a('0x39')]);_0x228629[_0xac4a('0x3a')]=qs['filters'](_['pick'](_0x355755[_0xac4a('0x31')],_0x432066['filters']),_0x53d3a5);if(_0x355755['query']['filter']){_0x228629['where']=_[_0xac4a('0x3b')](_0x228629[_0xac4a('0x3a')],{'$or':_[_0xac4a('0x2b')](_0x53d3a5,function(_0x472484){if(_0x472484[_0xac4a('0x2e')]!==_0xac4a('0x3c')){var _0x4220e2={};_0x4220e2[_0x472484[_0xac4a('0x2a')]]={'$like':'%'+_0x355755[_0xac4a('0x31')][_0xac4a('0x3d')]+'%'};return _0x4220e2;}})});}_0x228629=_[_0xac4a('0x3b')]({},_0x228629,_0x355755[_0xac4a('0x3e')]);var _0x4e4994={'where':_0x228629['where']};return db['AnalyticDefaultReport'][_0xac4a('0x1e')](_0x4e4994)[_0xac4a('0x25')](function(_0x14e80b){_0x17118e[_0xac4a('0x1e')]=_0x14e80b;if(_0x355755[_0xac4a('0x31')][_0xac4a('0x3f')]){_0x228629[_0xac4a('0x40')]=[{'all':!![]}];}return db[_0xac4a('0x41')][_0xac4a('0x42')](_0x228629);})[_0xac4a('0x25')](function(_0x561cb7){_0x17118e[_0xac4a('0x43')]=_0x561cb7;return _0x17118e;})[_0xac4a('0x25')](respondWithFilteredResult(_0x2896bc,_0x228629))[_0xac4a('0x44')](handleError(_0x2896bc,null));};exports[_0xac4a('0x45')]=function(_0x1a96cf,_0x57b879){var _0x8700b4={'raw':!![],'where':{'id':_0x1a96cf['params']['id']}},_0x1b77bb={};_0x1b77bb[_0xac4a('0x30')]=_['keys'](db[_0xac4a('0x41')][_0xac4a('0x2c')]);_0x1b77bb[_0xac4a('0x31')]=_[_0xac4a('0x32')](_0x1a96cf[_0xac4a('0x31')]);_0x1b77bb[_0xac4a('0x33')]=_[_0xac4a('0x34')](_0x1b77bb[_0xac4a('0x30')],_0x1b77bb[_0xac4a('0x31')]);_0x8700b4[_0xac4a('0x35')]=_[_0xac4a('0x34')](_0x1b77bb[_0xac4a('0x30')],qs['fields'](_0x1a96cf[_0xac4a('0x31')][_0xac4a('0x36')]));_0x8700b4[_0xac4a('0x35')]=_0x8700b4['attributes'][_0xac4a('0x46')]?_0x8700b4[_0xac4a('0x35')]:_0x1b77bb['model'];if(_0x1a96cf[_0xac4a('0x31')]['includeAll']){_0x8700b4[_0xac4a('0x40')]=[{'all':!![]}];}_0x8700b4=_[_0xac4a('0x3b')]({},_0x8700b4,_0x1a96cf[_0xac4a('0x3e')]);return db['AnalyticDefaultReport']['find'](_0x8700b4)[_0xac4a('0x25')](handleEntityNotFound(_0x57b879,null))['then'](respondWithResult(_0x57b879,null))[_0xac4a('0x44')](handleError(_0x57b879,null));};exports['create']=function(_0x3d2aaf,_0x530bbb){return db[_0xac4a('0x41')][_0xac4a('0x47')](_0x3d2aaf[_0xac4a('0x48')],{})[_0xac4a('0x25')](function(_0x54782f){var _0x31c794=_0x3d2aaf[_0xac4a('0x49')][_0xac4a('0x27')]({'plain':!![]});if(!_0x31c794)throw new Error(_0xac4a('0x4a'));if(_0x31c794[_0xac4a('0x4b')]===_0xac4a('0x49')){var _0x187306=_0x54782f['get']({'plain':!![]});var _0x35dee5=_0xac4a('0x4c');return db['UserProfileSection'][_0xac4a('0x4d')]({'where':{'name':_0x35dee5,'userProfileId':_0x31c794[_0xac4a('0x4e')]},'raw':!![]})[_0xac4a('0x25')](function(_0x3ac36e){if(_0x3ac36e&&_0x3ac36e['autoAssociation']===0x0){return db[_0xac4a('0x29')][_0xac4a('0x47')]({'name':_0x187306[_0xac4a('0x2a')],'resourceId':_0x187306['id'],'type':_0xac4a('0x28'),'sectionId':_0x3ac36e['id']},{})[_0xac4a('0x25')](function(){return _0x54782f;});}else{return _0x54782f;}})['catch'](function(_0x179373){logger['error'](_0xac4a('0x4f'),_0x179373);throw _0x179373;});}return _0x54782f;})[_0xac4a('0x25')](respondWithResult(_0x530bbb,0xc9))['catch'](handleError(_0x530bbb,null));};exports['update']=function(_0x437466,_0x70fdc3){if(_0x437466['body']['id']){delete _0x437466[_0xac4a('0x48')]['id'];}return db[_0xac4a('0x41')][_0xac4a('0x4d')]({'where':{'id':_0x437466[_0xac4a('0x50')]['id']}})['then'](handleEntityNotFound(_0x70fdc3,null))[_0xac4a('0x25')](saveUpdates(_0x437466[_0xac4a('0x48')],null))[_0xac4a('0x25')](respondWithResult(_0x70fdc3,null))[_0xac4a('0x44')](handleError(_0x70fdc3,null));};exports[_0xac4a('0x26')]=function(_0x411547,_0x36179a){return db['AnalyticDefaultReport'][_0xac4a('0x4d')]({'where':{'id':_0x411547[_0xac4a('0x50')]['id']}})[_0xac4a('0x25')](handleEntityNotFound(_0x36179a,null))[_0xac4a('0x25')](removeEntity(_0x36179a,null))[_0xac4a('0x44')](handleError(_0x36179a,null));};exports[_0xac4a('0x51')]=function(_0x213df2,_0x236f57){var _0x159e43=0xa;var _0x786d9=[_0xac4a('0x52'),_0xac4a('0x53'),_0xac4a('0x54'),_0xac4a('0x55')];var _0x5222f3={'SUM':_0xac4a('0x56'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xac4a('0x57'),'MAX':'MAX(%s)','MIN':_0xac4a('0x58'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xac4a('0x59'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xac4a('0x5a')};var _0x5cac9b={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xac4a('0x5b'),'HOUR':_0xac4a('0x5c'),'ROUND':_0xac4a('0x5d'),'UNIX_TIMESTAMP':_0xac4a('0x5e')};var _0x2f9940=function(_0xb7b884){return!_['includes']([_0xac4a('0x5f'),'IS\x20NOT\x20NULL',_0xac4a('0x60'),'IS\x20NOT\x20EMPTY'],_0xb7b884);};var _0x347880=function(_0x19ce2c){if(!_0x19ce2c||!_0x19ce2c[_0xac4a('0x61')][_0xac4a('0x46')]){return'';}for(var _0x429273='(',_0x2bc39a=0x0;_0x2bc39a<_0x19ce2c[_0xac4a('0x61')][_0xac4a('0x46')];_0x2bc39a+=0x1){_0x2bc39a>0x0&&(_0x429273+='\x20'+_0x19ce2c[_0xac4a('0x62')]+'\x20');_0x429273+=_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x63')]?_0x347880(_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x63')]):_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x64')]+'\x20'+_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x65')]+(_0x2f9940(_0x19ce2c['rules'][_0x2bc39a][_0xac4a('0x65')])?'\x20'+_0x19ce2c[_0xac4a('0x61')][_0x2bc39a]['value']:'');}return _0x429273+')';};var _0x3c3576={'where':{'id':_0x213df2['params']['id']}},_0x34bd1c,_0x2d24c7,_0x2b8562,_0x357cac,_0x4d1440;_0x3c3576=_[_0xac4a('0x3b')]({},_0x3c3576,_0x213df2[_0xac4a('0x3e')]);return db[_0xac4a('0x41')][_0xac4a('0x4d')](_0x3c3576)[_0xac4a('0x25')](function(_0x21ef8b){if(_0x21ef8b){_0x34bd1c=_0x21ef8b;return _0x21ef8b[_0xac4a('0x66')]();}return null;})[_0xac4a('0x25')](function(_0x44c60b){if(_0x44c60b){if(!_0x44c60b[_0xac4a('0x46')]){throw new db[(_0xac4a('0x67'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2d24c7=_0x44c60b;return db[_0xac4a('0x68')][_0xac4a('0x42')]({'raw':!![]});}return null;})[_0xac4a('0x25')](function(_0x423f70){if(_0x423f70){_0x2b8562=_[_0xac4a('0x69')](_0x423f70,'id');var _0x283107;var _0x1d24bb=squel[_0xac4a('0x6a')]();_0x1d24bb[_0xac4a('0x6b')](_0x34bd1c[_0xac4a('0x6c')]);for(var _0xb09b89=0x0;_0xb09b89<_0x2d24c7[_0xac4a('0x46')];_0xb09b89+=0x1){_0x283107=_0x2d24c7[_0xb09b89]['MetricId']?_0x2b8562[_0x2d24c7[_0xb09b89][_0xac4a('0x6d')]][_0xac4a('0x6e')]:_0x2d24c7[_0xb09b89][_0xac4a('0x64')];_0x283107=_0x2d24c7[_0xb09b89][_0xac4a('0x6f')]?_['replace'](_0x5222f3[_0x2d24c7[_0xb09b89][_0xac4a('0x6f')]],'%s',_0x283107):_0x283107;_0x283107=_0x2d24c7[_0xb09b89]['format']?_[_0xac4a('0x70')](_0x5cac9b[_0x2d24c7[_0xb09b89][_0xac4a('0x71')]],'%s',_0x283107):_0x283107;if(_0x2d24c7[_0xb09b89]['groupBy']){_0x1d24bb['group'](_0x283107);}_0x2d24c7[_0xb09b89][_0xac4a('0x72')]&&_0x1d24bb[_0xac4a('0x38')](_0x283107,_0x2d24c7[_0xb09b89][_0xac4a('0x72')]==='DESC'?![]:!![]);_0x1d24bb[_0xac4a('0x64')](_0x283107,_0x2d24c7[_0xb09b89]['alias']||_0x283107);}if(_0x34bd1c[_0xac4a('0x73')]){_0x34bd1c['joins']=JSON['parse'](_0x34bd1c[_0xac4a('0x73')]);for(var _0x56ef2a=0x0;_0x56ef2a<_0x34bd1c[_0xac4a('0x73')]['length'];_0x56ef2a+=0x1){if(_0x34bd1c[_0xac4a('0x73')][_0x56ef2a][_0xac4a('0x2e')]&&_['includes'](_0x786d9,_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['type'])&&_0x34bd1c[_0xac4a('0x73')][_0x56ef2a][_0xac4a('0x74')]&&_0x34bd1c['joins'][_0x56ef2a][_0xac4a('0x75')]&&_0x34bd1c['joins'][_0x56ef2a]['foreignKey']){_0x1d24bb[_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['type']](_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['foreignTable'],null,util['format'](_0xac4a('0x76'),_0x34bd1c[_0xac4a('0x6c')],_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['parentKey'],_0x34bd1c['joins'][_0x56ef2a][_0xac4a('0x75')],_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['foreignKey']));}}}if(_0x34bd1c['conditions']){_0x34bd1c[_0xac4a('0x77')]=JSON[_0xac4a('0x78')](_0x34bd1c[_0xac4a('0x77')]);_0x1d24bb[_0xac4a('0x3a')](_0x347880(_0x34bd1c[_0xac4a('0x77')][_0xac4a('0x63')]));}_0x4d1440=_0x1d24bb[_0xac4a('0x79')]();_0x1d24bb[_0xac4a('0x1d')](_0x159e43);_0x1d24bb[_0xac4a('0x1b')](0x0);logger['debug'](_0xac4a('0x7a'),_0x1d24bb[_0xac4a('0x7b')]());return dbH[_0xac4a('0x7c')]['query'](_0x1d24bb[_0xac4a('0x7b')](),{'type':dbH[_0xac4a('0x7c')][_0xac4a('0x7d')][_0xac4a('0x7e')]});}})[_0xac4a('0x25')](respondWithResult(_0x236f57,null))['catch'](handleError(_0x236f57,null));};function runReport(_0x290a73,_0x19ce24,_0xc9d040){var _0x37e519=_0x19ce24[_0xac4a('0x2a')];var _0x451248=0xa;var _0xd7bdd6=['join',_0xac4a('0x53'),_0xac4a('0x54'),_0xac4a('0x55')];var _0x35a97c={'SUM':_0xac4a('0x56'),'COUNT':_0xac4a('0x7f'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xac4a('0x80'),'MIN':_0xac4a('0x58'),'AVG':_0xac4a('0x81'),'GROUP_CONCAT':_0xac4a('0x59'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xac4a('0x5a')};var _0x56a934={'SEC_TO_TIME':_0xac4a('0x82'),'DATE':_0xac4a('0x5b'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xac4a('0x5e')};var _0x212a22=function(_0x1fe86a){return!_['includes']([_0xac4a('0x5f'),'IS\x20NOT\x20NULL',_0xac4a('0x60'),_0xac4a('0x83')],_0x1fe86a);};var _0x406b64=function(_0x35328e){if(!_0x35328e||!_0x35328e[_0xac4a('0x61')]['length']){return'';}for(var _0x50f471='(',_0x31cda0=0x0;_0x31cda0<_0x35328e[_0xac4a('0x61')][_0xac4a('0x46')];_0x31cda0+=0x1){_0x31cda0>0x0&&(_0x50f471+='\x20'+_0x35328e[_0xac4a('0x62')]+'\x20');_0x50f471+=_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x63')]?_0x406b64(_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x63')]):_0x35328e['rules'][_0x31cda0]['field']+'\x20'+_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x65')]+(_0x212a22(_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x65')])?'\x20'+_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x84')]:'');}return _0x50f471+')';};var _0xdaa2ef={'where':{'id':_0x290a73['id']}},_0x2e704b,_0x540d8e,_0x5e0be4,_0x32fd0c,_0x168f30;_0xdaa2ef=_[_0xac4a('0x3b')]({},_0xdaa2ef,_0xc9d040);return db[_0xac4a('0x41')][_0xac4a('0x4d')](_0xdaa2ef)[_0xac4a('0x25')](function(_0x338af3){if(_0x338af3){_0x2e704b=_0x338af3;return _0x338af3['getFields']();}return null;})[_0xac4a('0x25')](function(_0x1bacf2){if(_0x1bacf2){if(!_0x1bacf2[_0xac4a('0x46')]){throw new db['Sequelize'][(_0xac4a('0x85'))](_0xac4a('0x86'),0x193);}_0x540d8e=_0x1bacf2;return db[_0xac4a('0x68')][_0xac4a('0x42')]({'raw':!![]});}return null;})[_0xac4a('0x25')](function(_0x27d023){if(_0x27d023){_0x5e0be4=_[_0xac4a('0x69')](_0x27d023,'id');var _0x2ef42a;var _0x322465=squel['select']();_0x322465[_0xac4a('0x6b')](_0x2e704b['table']);for(var _0x203321=0x0;_0x203321<_0x540d8e[_0xac4a('0x46')];_0x203321+=0x1){_0x2ef42a=_0x540d8e[_0x203321][_0xac4a('0x6d')]?_0x5e0be4[_0x540d8e[_0x203321][_0xac4a('0x6d')]][_0xac4a('0x6e')]:_0x540d8e[_0x203321][_0xac4a('0x64')];_0x2ef42a=_0x540d8e[_0x203321][_0xac4a('0x6f')]?_['replace'](_0x35a97c[_0x540d8e[_0x203321][_0xac4a('0x6f')]],'%s',_0x2ef42a):_0x2ef42a;_0x2ef42a=_0x540d8e[_0x203321][_0xac4a('0x71')]?_[_0xac4a('0x70')](_0x56a934[_0x540d8e[_0x203321][_0xac4a('0x71')]],'%s',_0x2ef42a):_0x2ef42a;if(_0x540d8e[_0x203321][_0xac4a('0x87')]){_0x322465['group'](_0x2ef42a);}_0x540d8e[_0x203321][_0xac4a('0x72')]&&_0x322465[_0xac4a('0x38')](_0x2ef42a,_0x540d8e[_0x203321]['orderBy']==='DESC'?![]:!![]);_0x322465[_0xac4a('0x64')](_0x2ef42a,_0x540d8e[_0x203321][_0xac4a('0x88')]||_0x2ef42a);}if(_0x2e704b['joins']){_0x2e704b[_0xac4a('0x73')]=JSON[_0xac4a('0x78')](_0x2e704b[_0xac4a('0x73')]);for(var _0x37657e=0x0;_0x37657e<_0x2e704b[_0xac4a('0x73')][_0xac4a('0x46')];_0x37657e+=0x1){if(_0x2e704b['joins'][_0x37657e][_0xac4a('0x2e')]&&_[_0xac4a('0x89')](_0xd7bdd6,_0x2e704b[_0xac4a('0x73')][_0x37657e]['type'])&&_0x2e704b[_0xac4a('0x73')][_0x37657e][_0xac4a('0x74')]&&_0x2e704b[_0xac4a('0x73')][_0x37657e][_0xac4a('0x75')]&&_0x2e704b[_0xac4a('0x73')][_0x37657e][_0xac4a('0x8a')]){_0x322465[_0x2e704b['joins'][_0x37657e][_0xac4a('0x2e')]](_0x2e704b[_0xac4a('0x73')][_0x37657e]['foreignTable'],null,util[_0xac4a('0x71')]('%s.%s\x20=\x20%s.%s',_0x2e704b[_0xac4a('0x6c')],_0x2e704b[_0xac4a('0x73')][_0x37657e]['parentKey'],_0x2e704b[_0xac4a('0x73')][_0x37657e]['foreignTable'],_0x2e704b[_0xac4a('0x73')][_0x37657e]['foreignKey']));}}}if(_0x2e704b[_0xac4a('0x77')]){_0x2e704b[_0xac4a('0x77')]=JSON[_0xac4a('0x78')](_0x2e704b[_0xac4a('0x77')]);_0x322465[_0xac4a('0x3a')](_0x406b64(_0x2e704b[_0xac4a('0x77')][_0xac4a('0x63')]));}_0x168f30=_0x322465[_0xac4a('0x79')]();_0x322465[_0xac4a('0x1d')](_0x451248);_0x322465[_0xac4a('0x1b')](0x0);return;}})[_0xac4a('0x25')](function(){if(_0x19ce24[_0xac4a('0x8b')]===_0xac4a('0x8c')){return null;}var _0x4217df=_['merge'](_0x19ce24,{'name':_0x19ce24[_0xac4a('0x8d')]||_0x19ce24[_0xac4a('0x2a')]||_0x2e704b['name'],'basename':_0x37e519,'savename':util[_0xac4a('0x71')](_0xac4a('0x8e'),_0x19ce24[_0xac4a('0x2a')]||_0x2e704b[_0xac4a('0x2a')],require(_0xac4a('0x8f'))['generate'](0x4),_0x19ce24[_0xac4a('0x8b')]||'csv'),'reportId':_0x2e704b['id'],'reportType':_0xac4a('0x90')});return db[_0xac4a('0x91')][_0xac4a('0x47')](_0x4217df,{'raw':!![]});})[_0xac4a('0x25')](function(_0x53f23d){if(_0x2e704b[_0xac4a('0x6c')]==='cdr'){_0x168f30[_0xac4a('0x3a')](_0x2e704b[_0xac4a('0x6c')]+_0xac4a('0x92'),_0x19ce24['startDate'],_0x19ce24[_0xac4a('0x93')]);}else{_0x168f30[_0xac4a('0x3a')](_0x2e704b[_0xac4a('0x6c')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x19ce24[_0xac4a('0x94')],_0x19ce24[_0xac4a('0x93')]);}if(_0x53f23d){logger[_0xac4a('0x95')](_0xac4a('0x96'),_0x168f30[_0xac4a('0x7b')]());require(_0xac4a('0x97'))[_0xac4a('0x98')](path[_0xac4a('0x52')](__dirname,'../../components/export/',_0x53f23d[_0xac4a('0x8b')]),[_0x53f23d['id'],_0x168f30['toString'](),path['join'](__dirname,'../../files/reports',_0x53f23d['savename']),_0x37e519]);return _0x53f23d;}else{var _0x502275=squel[_0xac4a('0x6a')]();_0x502275[_0xac4a('0x6b')]('('+_0x168f30[_0xac4a('0x7b')]()+')',_0xac4a('0x99'));_0x502275[_0xac4a('0x64')]('COUNT(*)',_0xac4a('0x1e'));_0x168f30[_0xac4a('0x1d')](_0x19ce24[_0xac4a('0x1d')]||_0x451248);_0x168f30[_0xac4a('0x1b')](_0x19ce24[_0xac4a('0x1b')]||0x0);return dbH[_0xac4a('0x7c')][_0xac4a('0x31')](_0x502275[_0xac4a('0x7b')](),{'type':dbH['sequelize'][_0xac4a('0x7d')][_0xac4a('0x7e')]})[_0xac4a('0x25')](function(_0x25331f){if(!_0x25331f[_0xac4a('0x46')]){_0x32fd0c=0x0;}else{_0x32fd0c=_0x25331f[0x0][_0xac4a('0x1e')]||0x0;}return dbH[_0xac4a('0x7c')]['query'](_0x168f30['toString'](),{'type':dbH[_0xac4a('0x7c')][_0xac4a('0x7d')]['SELECT']});})[_0xac4a('0x25')](function(_0x366f5a){return{'rows':_0x366f5a||[],'count':_0x32fd0c};});}});}exports['run']=function(_0x5bd013,_0x2fe103){return runReport(_0x5bd013[_0xac4a('0x50')],_0x5bd013[_0xac4a('0x31')],_0x5bd013[_0xac4a('0x3e')])[_0xac4a('0x25')](respondWithResult(_0x2fe103,null))['catch'](handleError(_0x2fe103,null));};exports[_0xac4a('0x9a')]=runReport;exports['query']=function(_0x4f2d85,_0x538cfd){var _0x63c30=0xa;var _0x4301c3=[_0xac4a('0x52'),_0xac4a('0x53'),_0xac4a('0x54'),_0xac4a('0x55')];var _0xcad25d={'SUM':_0xac4a('0x56'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xac4a('0x58'),'AVG':_0xac4a('0x81'),'GROUP_CONCAT':_0xac4a('0x59'),'GROUP_CONCAT ASC':_0xac4a('0x9b'),'GROUP_CONCAT DESC':_0xac4a('0x5a')};var _0xcd140e={'SEC_TO_TIME':_0xac4a('0x82'),'DATE':_0xac4a('0x5b'),'HOUR':_0xac4a('0x5c'),'ROUND':_0xac4a('0x5d'),'UNIX_TIMESTAMP':_0xac4a('0x5e')};var _0x37cb49=function(_0xe0fd57){return!_[_0xac4a('0x89')]([_0xac4a('0x5f'),_0xac4a('0x9c'),_0xac4a('0x60'),_0xac4a('0x83')],_0xe0fd57);};var _0x41cdb5=function(_0x172d03){if(!_0x172d03||!_0x172d03[_0xac4a('0x61')][_0xac4a('0x46')]){return'';}for(var _0x3e2575='(',_0x4cc581=0x0;_0x4cc581<_0x172d03[_0xac4a('0x61')][_0xac4a('0x46')];_0x4cc581+=0x1){_0x4cc581>0x0&&(_0x3e2575+='\x20'+_0x172d03[_0xac4a('0x62')]+'\x20');_0x3e2575+=_0x172d03[_0xac4a('0x61')][_0x4cc581][_0xac4a('0x63')]?_0x41cdb5(_0x172d03[_0xac4a('0x61')][_0x4cc581][_0xac4a('0x63')]):_0x172d03[_0xac4a('0x61')][_0x4cc581]['field']+'\x20'+_0x172d03['rules'][_0x4cc581][_0xac4a('0x65')]+(_0x37cb49(_0x172d03[_0xac4a('0x61')][_0x4cc581][_0xac4a('0x65')])?'\x20'+_0x172d03['rules'][_0x4cc581]['value']:'');}return _0x3e2575+')';};var _0x5de198={'where':{'id':_0x4f2d85[_0xac4a('0x50')]['id']}},_0x2b6773,_0x52df82,_0x59e82c,_0x216055,_0x52963c;_0x5de198=_['merge']({},_0x5de198,_0x4f2d85[_0xac4a('0x3e')]);return db[_0xac4a('0x41')][_0xac4a('0x4d')](_0x5de198)[_0xac4a('0x25')](function(_0x403a16){if(_0x403a16){_0x2b6773=_0x403a16;return _0x403a16[_0xac4a('0x66')]();}return null;})['then'](function(_0x25bf23){if(_0x25bf23){if(!_0x25bf23[_0xac4a('0x46')]){throw new db[(_0xac4a('0x67'))]['ValidationErrorItem'](_0xac4a('0x86'),0x193);}_0x52df82=_0x25bf23;return db[_0xac4a('0x68')][_0xac4a('0x42')]({'raw':!![]});}return null;})[_0xac4a('0x25')](function(_0x5bb911){if(_0x5bb911){_0x59e82c=_[_0xac4a('0x69')](_0x5bb911,'id');var _0x403f5a;var _0x3eae2f=squel[_0xac4a('0x6a')]();_0x3eae2f[_0xac4a('0x6b')](_0x2b6773[_0xac4a('0x6c')]);for(var _0x4a0cd9=0x0;_0x4a0cd9<_0x52df82['length'];_0x4a0cd9+=0x1){_0x403f5a=_0x52df82[_0x4a0cd9][_0xac4a('0x6d')]?_0x59e82c[_0x52df82[_0x4a0cd9][_0xac4a('0x6d')]][_0xac4a('0x6e')]:_0x52df82[_0x4a0cd9][_0xac4a('0x64')];_0x403f5a=_0x52df82[_0x4a0cd9][_0xac4a('0x6f')]?_[_0xac4a('0x70')](_0xcad25d[_0x52df82[_0x4a0cd9]['function']],'%s',_0x403f5a):_0x403f5a;_0x403f5a=_0x52df82[_0x4a0cd9][_0xac4a('0x71')]?_['replace'](_0xcd140e[_0x52df82[_0x4a0cd9][_0xac4a('0x71')]],'%s',_0x403f5a):_0x403f5a;if(_0x52df82[_0x4a0cd9]['groupBy']){_0x3eae2f[_0xac4a('0x63')](_0x403f5a);}_0x52df82[_0x4a0cd9][_0xac4a('0x72')]&&_0x3eae2f[_0xac4a('0x38')](_0x403f5a,_0x52df82[_0x4a0cd9][_0xac4a('0x72')]==='DESC'?![]:!![]);_0x3eae2f[_0xac4a('0x64')](_0x403f5a,_0x52df82[_0x4a0cd9][_0xac4a('0x88')]||_0x403f5a);}if(_0x2b6773[_0xac4a('0x73')]){_0x2b6773[_0xac4a('0x73')]=JSON[_0xac4a('0x78')](_0x2b6773['joins']);for(var _0x3dd60a=0x0;_0x3dd60a<_0x2b6773[_0xac4a('0x73')][_0xac4a('0x46')];_0x3dd60a+=0x1){if(_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x2e')]&&_['includes'](_0x4301c3,_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x2e')])&&_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x74')]&&_0x2b6773[_0xac4a('0x73')][_0x3dd60a]['foreignTable']&&_0x2b6773['joins'][_0x3dd60a]['foreignKey']){_0x3eae2f[_0x2b6773['joins'][_0x3dd60a][_0xac4a('0x2e')]](_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x75')],null,util[_0xac4a('0x71')](_0xac4a('0x76'),_0x2b6773['table'],_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x74')],_0x2b6773['joins'][_0x3dd60a][_0xac4a('0x75')],_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x8a')]));}}}if(_0x2b6773['conditions']){_0x2b6773[_0xac4a('0x77')]=JSON[_0xac4a('0x78')](_0x2b6773[_0xac4a('0x77')]);_0x3eae2f[_0xac4a('0x3a')](_0x41cdb5(_0x2b6773[_0xac4a('0x77')][_0xac4a('0x63')]));}_0x52963c=_0x3eae2f[_0xac4a('0x79')]();_0x3eae2f[_0xac4a('0x1d')](_0x63c30);_0x3eae2f[_0xac4a('0x1b')](0x0);logger['debug'](_0xac4a('0x7a'),_0x3eae2f[_0xac4a('0x7b')]());return dbH['sequelize'][_0xac4a('0x31')](_0x3eae2f['toString'](),{'type':dbH[_0xac4a('0x7c')][_0xac4a('0x7d')]['SELECT']});}})[_0xac4a('0x25')](function(){return{'sql':_0x52963c[_0xac4a('0x7b')]()};})[_0xac4a('0x25')](respondWithResult(_0x538cfd,null))[_0xac4a('0x44')](handleError(_0x538cfd,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index 4dc7a6c..bbc4632 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 _0x5e6d=['exports','AnalyticDefaultReport','analytics_default_reports','lodash','moment','bluebird','path','rimraf','../../config/environment','./analyticDefaultReport.attributes'];(function(_0x32f1e6,_0x4789d0){var _0x1600bc=function(_0x53180a){while(--_0x53180a){_0x32f1e6['push'](_0x32f1e6['shift']());}};_0x1600bc(++_0x4789d0);}(_0x5e6d,0xb7));var _0xd5e6=function(_0x7e2eb0,_0x17cd58){_0x7e2eb0=_0x7e2eb0-0x0;var _0xd92de4=_0x5e6d[_0x7e2eb0];return _0xd92de4;};'use strict';var _=require(_0xd5e6('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xd5e6('0x1'));var BPromise=require(_0xd5e6('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd5e6('0x3'));var rimraf=require(_0xd5e6('0x4'));var config=require(_0xd5e6('0x5'));var attributes=require(_0xd5e6('0x6'));module[_0xd5e6('0x7')]=function(_0x4e62b8,_0x38a386){return _0x4e62b8['define'](_0xd5e6('0x8'),attributes,{'tableName':_0xd5e6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbdf0=['bluebird','path','../../config/environment','./analyticDefaultReport.attributes','exports','define','analytics_default_reports','lodash','api','moment'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xbdf0,0x15b));var _0x0bdf=function(_0x18cfc7,_0x27371b){_0x18cfc7=_0x18cfc7-0x0;var _0x3d0e73=_0xbdf0[_0x18cfc7];return _0x3d0e73;};'use strict';var _=require(_0x0bdf('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x0bdf('0x1'));var moment=require(_0x0bdf('0x2'));var BPromise=require(_0x0bdf('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0bdf('0x4'));var rimraf=require('rimraf');var config=require(_0x0bdf('0x5'));var attributes=require(_0x0bdf('0x6'));module[_0x0bdf('0x7')]=function(_0x49fa94,_0x4a4c72){return _0x49fa94[_0x0bdf('0x8')]('AnalyticDefaultReport',attributes,{'tableName':_0x0bdf('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 b6424c3..57f9b09 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 _0x9faa=['../../config/utils','../../config/logger','rpc','../../config/environment','client','then','AnalyticDefaultReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x314d37,_0xa23154){var _0x584bff=function(_0x1e9df2){while(--_0x1e9df2){_0x314d37['push'](_0x314d37['shift']());}};_0x584bff(++_0xa23154);}(_0x9faa,0x162));var _0xa9fa=function(_0x4e23b3,_0x37a56a){_0x4e23b3=_0x4e23b3-0x0;var _0xd888fc=_0x9faa[_0x4e23b3];return _0xd888fc;};'use strict';var _=require(_0xa9fa('0x0'));var util=require(_0xa9fa('0x1'));var moment=require(_0xa9fa('0x2'));var BPromise=require(_0xa9fa('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa9fa('0x4'));var db=require(_0xa9fa('0x5'))['db'];var utils=require(_0xa9fa('0x6'));var logger=require(_0xa9fa('0x7'))(_0xa9fa('0x8'));var config=require(_0xa9fa('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xa9fa('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3d53ce,_0x2ff72e,_0x3e33fe){return new BPromise(function(_0x4211d2,_0x133cf3){return client['request'](_0x3d53ce,_0x3e33fe)[_0xa9fa('0xb')](function(_0x995e83){logger['info'](_0xa9fa('0xc'),_0x2ff72e,'request\x20sent');logger[_0xa9fa('0xd')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x2ff72e,'request\x20sent',JSON[_0xa9fa('0xe')](_0x995e83));if(_0x995e83['error']){if(_0x995e83[_0xa9fa('0xf')][_0xa9fa('0x10')]===0x1f4){logger[_0xa9fa('0xf')](_0xa9fa('0xc'),_0x2ff72e,_0x995e83[_0xa9fa('0xf')][_0xa9fa('0x11')]);return _0x133cf3(_0x995e83['error'][_0xa9fa('0x11')]);}logger['error'](_0xa9fa('0xc'),_0x2ff72e,_0x995e83['error'][_0xa9fa('0x11')]);return _0x4211d2(_0x995e83[_0xa9fa('0xf')][_0xa9fa('0x11')]);}else{logger['info'](_0xa9fa('0xc'),_0x2ff72e,_0xa9fa('0x12'));_0x4211d2(_0x995e83[_0xa9fa('0x13')][_0xa9fa('0x11')]);}})['catch'](function(_0x385403){logger[_0xa9fa('0xf')](_0xa9fa('0xc'),_0x2ff72e,_0x385403);_0x133cf3(_0x385403);});});} \ No newline at end of file +var _0x31d9=['stringify','error','code','AnalyticDefaultReport,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','request\x20sent','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s'];(function(_0x43fdf8,_0x8426b3){var _0x1160c6=function(_0x281fb6){while(--_0x281fb6){_0x43fdf8['push'](_0x43fdf8['shift']());}};_0x1160c6(++_0x8426b3);}(_0x31d9,0x1d4));var _0x931d=function(_0x48795e,_0x46c47d){_0x48795e=_0x48795e-0x0;var _0xeed653=_0x31d9[_0x48795e];return _0xeed653;};'use strict';var _=require(_0x931d('0x0'));var util=require(_0x931d('0x1'));var moment=require(_0x931d('0x2'));var BPromise=require(_0x931d('0x3'));var rs=require(_0x931d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x931d('0x5'));var logger=require(_0x931d('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x931d('0x7'));var client=jayson[_0x931d('0x8')][_0x931d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x95c99c,_0x101c36,_0x5878df){return new BPromise(function(_0x530efe,_0x34e66d){return client[_0x931d('0xa')](_0x95c99c,_0x5878df)[_0x931d('0xb')](function(_0x3a24eb){logger[_0x931d('0xc')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x101c36,_0x931d('0xd'));logger['debug'](_0x931d('0xe'),_0x101c36,_0x931d('0xd'),JSON[_0x931d('0xf')](_0x3a24eb));if(_0x3a24eb[_0x931d('0x10')]){if(_0x3a24eb[_0x931d('0x10')][_0x931d('0x11')]===0x1f4){logger['error'](_0x931d('0x12'),_0x101c36,_0x3a24eb[_0x931d('0x10')]['message']);return _0x34e66d(_0x3a24eb[_0x931d('0x10')][_0x931d('0x13')]);}logger[_0x931d('0x10')](_0x931d('0x12'),_0x101c36,_0x3a24eb['error'][_0x931d('0x13')]);return _0x530efe(_0x3a24eb[_0x931d('0x10')][_0x931d('0x13')]);}else{logger['info'](_0x931d('0x12'),_0x101c36,_0x931d('0xd'));_0x530efe(_0x3a24eb[_0x931d('0x14')][_0x931d('0x13')]);}})['catch'](function(_0x1a50d5){logger[_0x931d('0x10')](_0x931d('0x12'),_0x101c36,_0x1a50d5);_0x34e66d(_0x1a50d5);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index ba1493d..9c6bcf2 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 _0x20f2=['../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','/: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'];(function(_0x15cf4d,_0xec4698){var _0x544525=function(_0x584650){while(--_0x584650){_0x15cf4d['push'](_0x15cf4d['shift']());}};_0x544525(++_0xec4698);}(_0x20f2,0x1e6));var _0x220f=function(_0x39d090,_0x3295ca){_0x39d090=_0x39d090-0x0;var _0x255242=_0x20f2[_0x39d090];return _0x255242;};'use strict';var multer=require(_0x220f('0x0'));var util=require(_0x220f('0x1'));var path=require(_0x220f('0x2'));var timeout=require(_0x220f('0x3'));var express=require(_0x220f('0x4'));var router=express[_0x220f('0x5')]();var fs_extra=require(_0x220f('0x6'));var auth=require(_0x220f('0x7'));var interaction=require(_0x220f('0x8'));var config=require(_0x220f('0x9'));var controller=require(_0x220f('0xa'));router[_0x220f('0xb')]('/',auth[_0x220f('0xc')](),controller[_0x220f('0xd')]);router[_0x220f('0xb')](_0x220f('0xe'),auth['isAuthenticated'](),controller[_0x220f('0xf')]);router[_0x220f('0xb')](_0x220f('0x10'),auth[_0x220f('0xc')](),controller[_0x220f('0x11')]);router[_0x220f('0xb')](_0x220f('0x12'),auth[_0x220f('0xc')](),controller[_0x220f('0x13')]);router[_0x220f('0xb')](_0x220f('0x14'),auth[_0x220f('0xc')](),controller[_0x220f('0x15')]);router[_0x220f('0x16')]('/',auth[_0x220f('0xc')](),controller[_0x220f('0x17')]);router[_0x220f('0x18')]('/:id',auth[_0x220f('0xc')](),controller[_0x220f('0x19')]);router[_0x220f('0x1a')](_0x220f('0xe'),auth[_0x220f('0xc')](),controller[_0x220f('0x1b')]);module[_0x220f('0x1c')]=router; \ No newline at end of file +var _0x3311=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','/:id/preview','preview','run','/:id/query','post','create','put','update','delete','destroy','exports'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0x3311,0x1d4));var _0x1331=function(_0x2c9841,_0x1a7e07){_0x2c9841=_0x2c9841-0x0;var _0x4f5641=_0x3311[_0x2c9841];return _0x4f5641;};'use strict';var multer=require(_0x1331('0x0'));var util=require(_0x1331('0x1'));var path=require(_0x1331('0x2'));var timeout=require(_0x1331('0x3'));var express=require(_0x1331('0x4'));var router=express[_0x1331('0x5')]();var fs_extra=require(_0x1331('0x6'));var auth=require(_0x1331('0x7'));var interaction=require(_0x1331('0x8'));var config=require(_0x1331('0x9'));var controller=require(_0x1331('0xa'));router[_0x1331('0xb')]('/',auth[_0x1331('0xc')](),controller[_0x1331('0xd')]);router[_0x1331('0xb')](_0x1331('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x1331('0xb')](_0x1331('0xf'),auth[_0x1331('0xc')](),controller[_0x1331('0x10')]);router[_0x1331('0xb')]('/:id/run',auth[_0x1331('0xc')](),controller[_0x1331('0x11')]);router[_0x1331('0xb')](_0x1331('0x12'),auth[_0x1331('0xc')](),controller['query']);router[_0x1331('0x13')]('/',auth['isAuthenticated'](),controller[_0x1331('0x14')]);router[_0x1331('0x15')](_0x1331('0xe'),auth[_0x1331('0xc')](),controller[_0x1331('0x16')]);router[_0x1331('0x17')](_0x1331('0xe'),auth['isAuthenticated'](),controller[_0x1331('0x18')]);module[_0x1331('0x19')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index fadab89..19791f1 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 _0x98ac=['UNSIGNED','sequelize','moment','exports','STRING','ENUM','csv','pdf','xlsx','DATE','Loading','manual','scheduled','INTEGER'];(function(_0x2787c5,_0x422f0b){var _0x1b53c5=function(_0x398028){while(--_0x398028){_0x2787c5['push'](_0x2787c5['shift']());}};_0x1b53c5(++_0x422f0b);}(_0x98ac,0x151));var _0xc98a=function(_0x2f6bb7,_0x539abe){_0x2f6bb7=_0x2f6bb7-0x0;var _0x84133c=_0x98ac[_0x2f6bb7];return _0x84133c;};'use strict';var Sequelize=require(_0xc98a('0x0'));var moment=require(_0xc98a('0x1'));module[_0xc98a('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0xc98a('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0xc98a('0x4')](_0xc98a('0x5'),_0xc98a('0x6'),_0xc98a('0x7')),'allowNull':![],'defaultValue':_0xc98a('0x5')},'savename':{'type':Sequelize[_0xc98a('0x3')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0xc98a('0x8')]},'status':{'type':Sequelize['STRING'],'defaultValue':_0xc98a('0x9')},'type':{'type':Sequelize['ENUM'](_0xc98a('0xa'),_0xc98a('0xb')),'allowNull':![],'defaultValue':_0xc98a('0xa')},'reportId':{'type':Sequelize[_0xc98a('0xc')](0xb)[_0xc98a('0xd')]},'reportType':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x2e14=['xlsx','DATE','Loading','manual','scheduled','INTEGER','UNSIGNED','sequelize','moment','exports','STRING','ENUM','csv','pdf'];(function(_0x5e6352,_0x3232f5){var _0x1e6f46=function(_0x4f2729){while(--_0x4f2729){_0x5e6352['push'](_0x5e6352['shift']());}};_0x1e6f46(++_0x3232f5);}(_0x2e14,0x77));var _0x42e1=function(_0x3356c5,_0x20a150){_0x3356c5=_0x3356c5-0x0;var _0x556859=_0x2e14[_0x3356c5];return _0x556859;};'use strict';var Sequelize=require(_0x42e1('0x0'));var moment=require(_0x42e1('0x1'));module[_0x42e1('0x2')]={'name':{'type':Sequelize[_0x42e1('0x3')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0x42e1('0x4')](_0x42e1('0x5'),_0x42e1('0x6'),_0x42e1('0x7')),'allowNull':![],'defaultValue':_0x42e1('0x5')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0x42e1('0x8')]},'endDate':{'type':Sequelize[_0x42e1('0x8')]},'status':{'type':Sequelize['STRING'],'defaultValue':_0x42e1('0x9')},'type':{'type':Sequelize[_0x42e1('0x4')](_0x42e1('0xa'),_0x42e1('0xb')),'allowNull':![],'defaultValue':_0x42e1('0xa')},'reportId':{'type':Sequelize[_0x42e1('0xc')](0xb)[_0x42e1('0xd')]},'reportType':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index 8c9d3ec..bb9c873 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 _0x9b7c=['output','existsSync','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','download','root','server/files/reports','format','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','destroy','get','ExtractedReports','UserProfileResource','error','name','send','index','map','rawAttributes','fieldName','type','key','keys','query','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','filters','filter','merge','options','includeAll','AnalyticExtractedReport','findAll','catch','show','params','body','user','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','basename','savename'];(function(_0x52965d,_0x487353){var _0x43f259=function(_0x4c326c){while(--_0x4c326c){_0x52965d['push'](_0x52965d['shift']());}};_0x43f259(++_0x487353);}(_0x9b7c,0x177));var _0xc9b7=function(_0x29db36,_0x410ae9){_0x29db36=_0x29db36-0x0;var _0x234e87=_0x9b7c[_0x29db36];return _0x234e87;};'use strict';var emlformat=require(_0xc9b7('0x0'));var rimraf=require(_0xc9b7('0x1'));var zipdir=require(_0xc9b7('0x2'));var jsonpatch=require(_0xc9b7('0x3'));var rp=require(_0xc9b7('0x4'));var moment=require('moment');var BPromise=require(_0xc9b7('0x5'));var Mustache=require(_0xc9b7('0x6'));var util=require('util');var path=require(_0xc9b7('0x7'));var sox=require('sox');var csv=require(_0xc9b7('0x8'));var ejs=require(_0xc9b7('0x9'));var fs=require('fs');var fs_extra=require(_0xc9b7('0xa'));var _=require('lodash');var squel=require(_0xc9b7('0xb'));var crypto=require(_0xc9b7('0xc'));var jsforce=require(_0xc9b7('0xd'));var deskjs=require(_0xc9b7('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc9b7('0xf'));var Redis=require('ioredis');var authService=require(_0xc9b7('0x10'));var qs=require(_0xc9b7('0x11'));var as=require(_0xc9b7('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc9b7('0x13'))(_0xc9b7('0x14'));var utils=require(_0xc9b7('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xc9b7('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2e2eb7,_0x5c255f){_0x5c255f=_0x5c255f||0xcc;return function(_0x4ff09b){if(_0x4ff09b){return _0x2e2eb7[_0xc9b7('0x17')](_0x5c255f);}return _0x2e2eb7[_0xc9b7('0x18')](_0x5c255f)[_0xc9b7('0x19')]();};}function respondWithResult(_0x27d818,_0x4f6b24){_0x4f6b24=_0x4f6b24||0xc8;return function(_0xe88b40){if(_0xe88b40){return _0x27d818[_0xc9b7('0x18')](_0x4f6b24)[_0xc9b7('0x1a')](_0xe88b40);}};}function respondWithFilteredResult(_0x29b8ee,_0x2c987c){return function(_0x4888e0){if(_0x4888e0){var _0x459f0e=typeof _0x2c987c[_0xc9b7('0x1b')]==='undefined'&&typeof _0x2c987c[_0xc9b7('0x1c')]===_0xc9b7('0x1d');var _0x197e23=_0x4888e0['count'];var _0x4ad468=_0x459f0e?0x0:_0x2c987c[_0xc9b7('0x1b')];var _0x13c3d4=_0x459f0e?_0x4888e0[_0xc9b7('0x1e')]:_0x2c987c[_0xc9b7('0x1b')]+_0x2c987c[_0xc9b7('0x1c')];var _0x476fb8;if(_0x13c3d4>=_0x197e23){_0x13c3d4=_0x197e23;_0x476fb8=0xc8;}else{_0x476fb8=0xce;}_0x29b8ee[_0xc9b7('0x18')](_0x476fb8);return _0x29b8ee['set'](_0xc9b7('0x1f'),_0x4ad468+'-'+_0x13c3d4+'/'+_0x197e23)['json'](_0x4888e0);}return null;};}function patchUpdates(_0x132e55){return function(_0x379d2b){try{jsonpatch[_0xc9b7('0x20')](_0x379d2b,_0x132e55,!![]);}catch(_0x3da26f){return BPromise[_0xc9b7('0x21')](_0x3da26f);}return _0x379d2b[_0xc9b7('0x22')]();};}function saveUpdates(_0x11df9e,_0x2f00bc){return function(_0x197e20){if(_0x197e20){return _0x197e20[_0xc9b7('0x23')](_0x11df9e)[_0xc9b7('0x24')](function(_0xe4eb8d){return _0xe4eb8d;});}return null;};}function removeEntity(_0x5db1c2,_0xf06d77){return function(_0x5326df){if(_0x5326df){return _0x5326df[_0xc9b7('0x25')]()[_0xc9b7('0x24')](function(){var _0x321a6e=_0x5326df[_0xc9b7('0x26')]({'plain':!![]});var _0x3de78d=_0xc9b7('0x27');return db[_0xc9b7('0x28')]['destroy']({'where':{'type':_0x3de78d,'resourceId':_0x321a6e['id']}})[_0xc9b7('0x24')](function(){return _0x5326df;});})[_0xc9b7('0x24')](function(){_0x5db1c2['status'](0xcc)[_0xc9b7('0x19')]();});}};}function handleEntityNotFound(_0x1d0e9f,_0x2bf2f1){return function(_0x2712e0){if(!_0x2712e0){_0x1d0e9f['sendStatus'](0x194);}return _0x2712e0;};}function handleError(_0x1e95dd,_0x508700){_0x508700=_0x508700||0x1f4;return function(_0x31546f){logger[_0xc9b7('0x29')](_0x31546f['stack']);if(_0x31546f[_0xc9b7('0x2a')]){delete _0x31546f[_0xc9b7('0x2a')];}_0x1e95dd[_0xc9b7('0x18')](_0x508700)[_0xc9b7('0x2b')](_0x31546f);};}exports[_0xc9b7('0x2c')]=function(_0x1cb9de,_0x468d94){var _0x13be7f={},_0x3d0f7f={},_0x44e27d={'count':0x0,'rows':[]};var _0x49bcf0=_[_0xc9b7('0x2d')](db['AnalyticExtractedReport'][_0xc9b7('0x2e')],function(_0x1cea0c){return{'name':_0x1cea0c[_0xc9b7('0x2f')],'type':_0x1cea0c[_0xc9b7('0x30')][_0xc9b7('0x31')]};});_0x3d0f7f['model']=_[_0xc9b7('0x2d')](_0x49bcf0,_0xc9b7('0x2a'));_0x3d0f7f['query']=_[_0xc9b7('0x32')](_0x1cb9de[_0xc9b7('0x33')]);_0x3d0f7f['filters']=_[_0xc9b7('0x34')](_0x3d0f7f['model'],_0x3d0f7f[_0xc9b7('0x33')]);_0x13be7f[_0xc9b7('0x35')]=_[_0xc9b7('0x34')](_0x3d0f7f[_0xc9b7('0x36')],qs[_0xc9b7('0x37')](_0x1cb9de[_0xc9b7('0x33')]['fields']));_0x13be7f[_0xc9b7('0x35')]=_0x13be7f['attributes'][_0xc9b7('0x38')]?_0x13be7f[_0xc9b7('0x35')]:_0x3d0f7f[_0xc9b7('0x36')];if(!_0x1cb9de[_0xc9b7('0x33')][_0xc9b7('0x39')](_0xc9b7('0x3a'))){_0x13be7f[_0xc9b7('0x1c')]=qs[_0xc9b7('0x1c')](_0x1cb9de[_0xc9b7('0x33')]['limit']);_0x13be7f[_0xc9b7('0x1b')]=qs[_0xc9b7('0x1b')](_0x1cb9de[_0xc9b7('0x33')][_0xc9b7('0x1b')]);}_0x13be7f['order']=qs[_0xc9b7('0x3b')](_0x1cb9de['query'][_0xc9b7('0x3b')]);_0x13be7f[_0xc9b7('0x3c')]=qs[_0xc9b7('0x3d')](_['pick'](_0x1cb9de[_0xc9b7('0x33')],_0x3d0f7f[_0xc9b7('0x3d')]),_0x49bcf0);if(_0x1cb9de[_0xc9b7('0x33')][_0xc9b7('0x3e')]){_0x13be7f[_0xc9b7('0x3c')]=_[_0xc9b7('0x3f')](_0x13be7f[_0xc9b7('0x3c')],{'$or':_[_0xc9b7('0x2d')](_0x49bcf0,function(_0x5604ee){if(_0x5604ee[_0xc9b7('0x30')]!=='VIRTUAL'){var _0x3e3263={};_0x3e3263[_0x5604ee[_0xc9b7('0x2a')]]={'$like':'%'+_0x1cb9de[_0xc9b7('0x33')][_0xc9b7('0x3e')]+'%'};return _0x3e3263;}})});}_0x13be7f=_['merge']({},_0x13be7f,_0x1cb9de[_0xc9b7('0x40')]);var _0x36c649={'where':_0x13be7f[_0xc9b7('0x3c')]};return db['AnalyticExtractedReport'][_0xc9b7('0x1e')](_0x36c649)[_0xc9b7('0x24')](function(_0x11f64e){_0x44e27d['count']=_0x11f64e;if(_0x1cb9de[_0xc9b7('0x33')][_0xc9b7('0x41')]){_0x13be7f['include']=[{'all':!![]}];}return db[_0xc9b7('0x42')][_0xc9b7('0x43')](_0x13be7f);})[_0xc9b7('0x24')](function(_0x2914c2){_0x44e27d['rows']=_0x2914c2;return _0x44e27d;})['then'](respondWithFilteredResult(_0x468d94,_0x13be7f))[_0xc9b7('0x44')](handleError(_0x468d94,null));};exports[_0xc9b7('0x45')]=function(_0x52e090,_0x22df15){var _0x32afae={'raw':!![],'where':{'id':_0x52e090[_0xc9b7('0x46')]['id']}},_0x15b98a={};_0x15b98a[_0xc9b7('0x36')]=_[_0xc9b7('0x32')](db[_0xc9b7('0x42')][_0xc9b7('0x2e')]);_0x15b98a[_0xc9b7('0x33')]=_[_0xc9b7('0x32')](_0x52e090[_0xc9b7('0x33')]);_0x15b98a['filters']=_[_0xc9b7('0x34')](_0x15b98a[_0xc9b7('0x36')],_0x15b98a['query']);_0x32afae[_0xc9b7('0x35')]=_[_0xc9b7('0x34')](_0x15b98a[_0xc9b7('0x36')],qs[_0xc9b7('0x37')](_0x52e090['query'][_0xc9b7('0x37')]));_0x32afae[_0xc9b7('0x35')]=_0x32afae['attributes']['length']?_0x32afae[_0xc9b7('0x35')]:_0x15b98a[_0xc9b7('0x36')];if(_0x52e090['query'][_0xc9b7('0x41')]){_0x32afae['include']=[{'all':!![]}];}_0x32afae=_['merge']({},_0x32afae,_0x52e090[_0xc9b7('0x40')]);return db['AnalyticExtractedReport']['find'](_0x32afae)[_0xc9b7('0x24')](handleEntityNotFound(_0x22df15,null))['then'](respondWithResult(_0x22df15,null))[_0xc9b7('0x44')](handleError(_0x22df15,null));};exports['create']=function(_0x5be96a,_0x277c09){return db['AnalyticExtractedReport']['create'](_0x5be96a[_0xc9b7('0x47')],{})['then'](function(_0x173cf3){var _0x57d125=_0x5be96a['user'][_0xc9b7('0x26')]({'plain':!![]});if(!_0x57d125)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x57d125['role']===_0xc9b7('0x48')){var _0x440792=_0x173cf3[_0xc9b7('0x26')]({'plain':!![]});var _0x371cf3='ExtractedReports';return db['UserProfileSection']['find']({'where':{'name':_0x371cf3,'userProfileId':_0x57d125[_0xc9b7('0x49')]},'raw':!![]})['then'](function(_0x256bd5){if(_0x256bd5&&_0x256bd5[_0xc9b7('0x4a')]===0x0){return db[_0xc9b7('0x28')][_0xc9b7('0x4b')]({'name':_0x440792[_0xc9b7('0x2a')],'resourceId':_0x440792['id'],'type':_0x256bd5[_0xc9b7('0x2a')],'sectionId':_0x256bd5['id']},{})['then'](function(){return _0x173cf3;});}else{return _0x173cf3;}})[_0xc9b7('0x44')](function(_0x12d941){logger[_0xc9b7('0x29')](_0xc9b7('0x4c'),_0x12d941);throw _0x12d941;});}return _0x173cf3;})['then'](respondWithResult(_0x277c09,0xc9))[_0xc9b7('0x44')](handleError(_0x277c09,null));};exports['update']=function(_0x2080b6,_0x521bcf){if(_0x2080b6[_0xc9b7('0x47')]['id']){delete _0x2080b6[_0xc9b7('0x47')]['id'];}return db[_0xc9b7('0x42')][_0xc9b7('0x4d')]({'where':{'id':_0x2080b6[_0xc9b7('0x46')]['id']}})[_0xc9b7('0x24')](handleEntityNotFound(_0x521bcf,null))[_0xc9b7('0x24')](saveUpdates(_0x2080b6['body'],null))['then'](respondWithResult(_0x521bcf,null))['catch'](handleError(_0x521bcf,null));};exports[_0xc9b7('0x25')]=function(_0x38d3bb,_0x3c927d){return db[_0xc9b7('0x42')]['find']({'where':{'id':_0x38d3bb[_0xc9b7('0x46')]['id']}})[_0xc9b7('0x24')](handleEntityNotFound(_0x3c927d,null))[_0xc9b7('0x24')](removeEntity(_0x3c927d,null))[_0xc9b7('0x44')](handleError(_0x3c927d,null));};exports['download']=function(_0x224bc3,_0x3a5663,_0x123899){return db[_0xc9b7('0x42')][_0xc9b7('0x4d')]({'where':{'id':_0x224bc3[_0xc9b7('0x46')]['id']},'attributes':[_0xc9b7('0x2a'),_0xc9b7('0x4e'),_0xc9b7('0x4f'),_0xc9b7('0x50')],'raw':!![]})[_0xc9b7('0x24')](handleEntityNotFound(_0x3a5663,null))[_0xc9b7('0x24')](function(_0x388782){if(_0x388782){if(!fs[_0xc9b7('0x51')](path['join'](config['root'],'server/files/reports',_0x388782[_0xc9b7('0x4f')]))){throw new db[(_0xc9b7('0x52'))][(_0xc9b7('0x53'))](_0xc9b7('0x54'));}if(_0x224bc3[_0xc9b7('0x33')][_0xc9b7('0x55')]){return _0x3a5663[_0xc9b7('0x17')](0xc8);}return _0x3a5663[_0xc9b7('0x56')](path['join'](config[_0xc9b7('0x57')],_0xc9b7('0x58'),_0x388782[_0xc9b7('0x4f')]),util[_0xc9b7('0x59')]('%s.%s',_0x388782['basename']||_0x388782[_0xc9b7('0x2a')],_0x388782['output'][_0xc9b7('0x5a')]()));}})['catch'](handleError(_0x3a5663,null));}; \ No newline at end of file +var _0xdfe8=['exists','format','basename','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','destroy','then','get','UserProfileResource','error','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','pick','filter','where','merge','VIRTUAL','options','includeAll','include','rows','keys','find','catch','create','body','user','role','ExtractedReports','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','download','savename','output','existsSync','join','root','server/files/reports','ValidationError'];(function(_0x5598ed,_0x366268){var _0x5368a4=function(_0x308473){while(--_0x308473){_0x5598ed['push'](_0x5598ed['shift']());}};_0x5368a4(++_0x366268);}(_0xdfe8,0x66));var _0x8dfe=function(_0x77d286,_0x1ddc6d){_0x77d286=_0x77d286-0x0;var _0x5446a5=_0xdfe8[_0x77d286];return _0x5446a5;};'use strict';var emlformat=require(_0x8dfe('0x0'));var rimraf=require(_0x8dfe('0x1'));var zipdir=require(_0x8dfe('0x2'));var jsonpatch=require(_0x8dfe('0x3'));var rp=require(_0x8dfe('0x4'));var moment=require(_0x8dfe('0x5'));var BPromise=require(_0x8dfe('0x6'));var Mustache=require(_0x8dfe('0x7'));var util=require(_0x8dfe('0x8'));var path=require(_0x8dfe('0x9'));var sox=require('sox');var csv=require(_0x8dfe('0xa'));var ejs=require(_0x8dfe('0xb'));var fs=require('fs');var fs_extra=require(_0x8dfe('0xc'));var _=require('lodash');var squel=require(_0x8dfe('0xd'));var crypto=require(_0x8dfe('0xe'));var jsforce=require(_0x8dfe('0xf'));var deskjs=require(_0x8dfe('0x10'));var toCsv=require(_0x8dfe('0xa'));var querystring=require(_0x8dfe('0x11'));var Papa=require(_0x8dfe('0x12'));var Redis=require('ioredis');var authService=require(_0x8dfe('0x13'));var qs=require(_0x8dfe('0x14'));var as=require(_0x8dfe('0x15'));var hardwareService=require(_0x8dfe('0x16'));var logger=require(_0x8dfe('0x17'))(_0x8dfe('0x18'));var utils=require(_0x8dfe('0x19'));var config=require(_0x8dfe('0x1a'));var licenseUtil=require(_0x8dfe('0x1b'));var db=require(_0x8dfe('0x1c'))['db'];function respondWithStatusCode(_0x3304e5,_0x5aa0b8){_0x5aa0b8=_0x5aa0b8||0xcc;return function(_0x45d203){if(_0x45d203){return _0x3304e5[_0x8dfe('0x1d')](_0x5aa0b8);}return _0x3304e5['status'](_0x5aa0b8)[_0x8dfe('0x1e')]();};}function respondWithResult(_0x2da34a,_0x1e9898){_0x1e9898=_0x1e9898||0xc8;return function(_0x4f1142){if(_0x4f1142){return _0x2da34a[_0x8dfe('0x1f')](_0x1e9898)[_0x8dfe('0x20')](_0x4f1142);}};}function respondWithFilteredResult(_0x194071,_0x164337){return function(_0x146846){if(_0x146846){var _0x3b8f5a=typeof _0x164337['offset']===_0x8dfe('0x21')&&typeof _0x164337[_0x8dfe('0x22')]===_0x8dfe('0x21');var _0x2ee5a1=_0x146846['count'];var _0x2b61ba=_0x3b8f5a?0x0:_0x164337[_0x8dfe('0x23')];var _0xc6d867=_0x3b8f5a?_0x146846[_0x8dfe('0x24')]:_0x164337[_0x8dfe('0x23')]+_0x164337[_0x8dfe('0x22')];var _0x2aad52;if(_0xc6d867>=_0x2ee5a1){_0xc6d867=_0x2ee5a1;_0x2aad52=0xc8;}else{_0x2aad52=0xce;}_0x194071['status'](_0x2aad52);return _0x194071[_0x8dfe('0x25')](_0x8dfe('0x26'),_0x2b61ba+'-'+_0xc6d867+'/'+_0x2ee5a1)['json'](_0x146846);}return null;};}function patchUpdates(_0xaa9b2f){return function(_0x5b33a0){try{jsonpatch[_0x8dfe('0x27')](_0x5b33a0,_0xaa9b2f,!![]);}catch(_0x2aeb06){return BPromise['reject'](_0x2aeb06);}return _0x5b33a0[_0x8dfe('0x28')]();};}function saveUpdates(_0x19c20a,_0x13f561){return function(_0x57b5d9){if(_0x57b5d9){return _0x57b5d9[_0x8dfe('0x29')](_0x19c20a)['then'](function(_0x54a31e){return _0x54a31e;});}return null;};}function removeEntity(_0x50b245,_0x2cb868){return function(_0x3c1694){if(_0x3c1694){return _0x3c1694[_0x8dfe('0x2a')]()[_0x8dfe('0x2b')](function(){var _0x576cef=_0x3c1694[_0x8dfe('0x2c')]({'plain':!![]});var _0x5098b8='ExtractedReports';return db[_0x8dfe('0x2d')]['destroy']({'where':{'type':_0x5098b8,'resourceId':_0x576cef['id']}})['then'](function(){return _0x3c1694;});})['then'](function(){_0x50b245['status'](0xcc)[_0x8dfe('0x1e')]();});}};}function handleEntityNotFound(_0x9a507d,_0x1e4d05){return function(_0x4f1859){if(!_0x4f1859){_0x9a507d[_0x8dfe('0x1d')](0x194);}return _0x4f1859;};}function handleError(_0x21ea6c,_0x50da9f){_0x50da9f=_0x50da9f||0x1f4;return function(_0x51d892){logger[_0x8dfe('0x2e')](_0x51d892['stack']);if(_0x51d892['name']){delete _0x51d892[_0x8dfe('0x2f')];}_0x21ea6c[_0x8dfe('0x1f')](_0x50da9f)[_0x8dfe('0x30')](_0x51d892);};}exports[_0x8dfe('0x31')]=function(_0x57e48a,_0x567ffa){var _0x37e59b={},_0x390068={},_0xdb23ab={'count':0x0,'rows':[]};var _0x448717=_[_0x8dfe('0x32')](db[_0x8dfe('0x33')][_0x8dfe('0x34')],function(_0x46d250){return{'name':_0x46d250[_0x8dfe('0x35')],'type':_0x46d250[_0x8dfe('0x36')][_0x8dfe('0x37')]};});_0x390068[_0x8dfe('0x38')]=_[_0x8dfe('0x32')](_0x448717,'name');_0x390068[_0x8dfe('0x39')]=_['keys'](_0x57e48a[_0x8dfe('0x39')]);_0x390068[_0x8dfe('0x3a')]=_['intersection'](_0x390068[_0x8dfe('0x38')],_0x390068[_0x8dfe('0x39')]);_0x37e59b[_0x8dfe('0x3b')]=_[_0x8dfe('0x3c')](_0x390068[_0x8dfe('0x38')],qs[_0x8dfe('0x3d')](_0x57e48a[_0x8dfe('0x39')]['fields']));_0x37e59b['attributes']=_0x37e59b[_0x8dfe('0x3b')][_0x8dfe('0x3e')]?_0x37e59b[_0x8dfe('0x3b')]:_0x390068[_0x8dfe('0x38')];if(!_0x57e48a['query'][_0x8dfe('0x3f')](_0x8dfe('0x40'))){_0x37e59b['limit']=qs[_0x8dfe('0x22')](_0x57e48a[_0x8dfe('0x39')][_0x8dfe('0x22')]);_0x37e59b[_0x8dfe('0x23')]=qs[_0x8dfe('0x23')](_0x57e48a[_0x8dfe('0x39')][_0x8dfe('0x23')]);}_0x37e59b['order']=qs['sort'](_0x57e48a[_0x8dfe('0x39')]['sort']);_0x37e59b['where']=qs[_0x8dfe('0x3a')](_[_0x8dfe('0x41')](_0x57e48a[_0x8dfe('0x39')],_0x390068[_0x8dfe('0x3a')]),_0x448717);if(_0x57e48a[_0x8dfe('0x39')][_0x8dfe('0x42')]){_0x37e59b[_0x8dfe('0x43')]=_[_0x8dfe('0x44')](_0x37e59b[_0x8dfe('0x43')],{'$or':_['map'](_0x448717,function(_0x134959){if(_0x134959['type']!==_0x8dfe('0x45')){var _0x3e956b={};_0x3e956b[_0x134959[_0x8dfe('0x2f')]]={'$like':'%'+_0x57e48a['query']['filter']+'%'};return _0x3e956b;}})});}_0x37e59b=_[_0x8dfe('0x44')]({},_0x37e59b,_0x57e48a[_0x8dfe('0x46')]);var _0x153510={'where':_0x37e59b['where']};return db['AnalyticExtractedReport'][_0x8dfe('0x24')](_0x153510)[_0x8dfe('0x2b')](function(_0x1aacaf){_0xdb23ab[_0x8dfe('0x24')]=_0x1aacaf;if(_0x57e48a['query'][_0x8dfe('0x47')]){_0x37e59b[_0x8dfe('0x48')]=[{'all':!![]}];}return db['AnalyticExtractedReport']['findAll'](_0x37e59b);})[_0x8dfe('0x2b')](function(_0xac7a89){_0xdb23ab[_0x8dfe('0x49')]=_0xac7a89;return _0xdb23ab;})[_0x8dfe('0x2b')](respondWithFilteredResult(_0x567ffa,_0x37e59b))['catch'](handleError(_0x567ffa,null));};exports['show']=function(_0x1233e9,_0x148a3b){var _0xde276={'raw':!![],'where':{'id':_0x1233e9['params']['id']}},_0x48323c={};_0x48323c['model']=_[_0x8dfe('0x4a')](db[_0x8dfe('0x33')]['rawAttributes']);_0x48323c[_0x8dfe('0x39')]=_[_0x8dfe('0x4a')](_0x1233e9[_0x8dfe('0x39')]);_0x48323c[_0x8dfe('0x3a')]=_[_0x8dfe('0x3c')](_0x48323c[_0x8dfe('0x38')],_0x48323c['query']);_0xde276['attributes']=_[_0x8dfe('0x3c')](_0x48323c['model'],qs[_0x8dfe('0x3d')](_0x1233e9[_0x8dfe('0x39')][_0x8dfe('0x3d')]));_0xde276[_0x8dfe('0x3b')]=_0xde276[_0x8dfe('0x3b')][_0x8dfe('0x3e')]?_0xde276[_0x8dfe('0x3b')]:_0x48323c['model'];if(_0x1233e9[_0x8dfe('0x39')][_0x8dfe('0x47')]){_0xde276[_0x8dfe('0x48')]=[{'all':!![]}];}_0xde276=_['merge']({},_0xde276,_0x1233e9[_0x8dfe('0x46')]);return db[_0x8dfe('0x33')][_0x8dfe('0x4b')](_0xde276)[_0x8dfe('0x2b')](handleEntityNotFound(_0x148a3b,null))[_0x8dfe('0x2b')](respondWithResult(_0x148a3b,null))[_0x8dfe('0x4c')](handleError(_0x148a3b,null));};exports[_0x8dfe('0x4d')]=function(_0x22ab6f,_0x2b5390){return db[_0x8dfe('0x33')][_0x8dfe('0x4d')](_0x22ab6f[_0x8dfe('0x4e')],{})[_0x8dfe('0x2b')](function(_0x2d5990){var _0x3210cd=_0x22ab6f[_0x8dfe('0x4f')]['get']({'plain':!![]});if(!_0x3210cd)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3210cd[_0x8dfe('0x50')]==='user'){var _0x3c41fb=_0x2d5990['get']({'plain':!![]});var _0x17070d=_0x8dfe('0x51');return db[_0x8dfe('0x52')][_0x8dfe('0x4b')]({'where':{'name':_0x17070d,'userProfileId':_0x3210cd['userProfileId']},'raw':!![]})[_0x8dfe('0x2b')](function(_0x373d98){if(_0x373d98&&_0x373d98[_0x8dfe('0x53')]===0x0){return db[_0x8dfe('0x2d')][_0x8dfe('0x4d')]({'name':_0x3c41fb[_0x8dfe('0x2f')],'resourceId':_0x3c41fb['id'],'type':_0x373d98[_0x8dfe('0x2f')],'sectionId':_0x373d98['id']},{})[_0x8dfe('0x2b')](function(){return _0x2d5990;});}else{return _0x2d5990;}})['catch'](function(_0x4e2b05){logger['error'](_0x8dfe('0x54'),_0x4e2b05);throw _0x4e2b05;});}return _0x2d5990;})[_0x8dfe('0x2b')](respondWithResult(_0x2b5390,0xc9))[_0x8dfe('0x4c')](handleError(_0x2b5390,null));};exports[_0x8dfe('0x29')]=function(_0x5023f3,_0x85233d){if(_0x5023f3[_0x8dfe('0x4e')]['id']){delete _0x5023f3['body']['id'];}return db[_0x8dfe('0x33')][_0x8dfe('0x4b')]({'where':{'id':_0x5023f3[_0x8dfe('0x55')]['id']}})[_0x8dfe('0x2b')](handleEntityNotFound(_0x85233d,null))[_0x8dfe('0x2b')](saveUpdates(_0x5023f3[_0x8dfe('0x4e')],null))[_0x8dfe('0x2b')](respondWithResult(_0x85233d,null))['catch'](handleError(_0x85233d,null));};exports[_0x8dfe('0x2a')]=function(_0x1b9907,_0x59fba9){return db['AnalyticExtractedReport'][_0x8dfe('0x4b')]({'where':{'id':_0x1b9907[_0x8dfe('0x55')]['id']}})[_0x8dfe('0x2b')](handleEntityNotFound(_0x59fba9,null))['then'](removeEntity(_0x59fba9,null))[_0x8dfe('0x4c')](handleError(_0x59fba9,null));};exports[_0x8dfe('0x56')]=function(_0x970dda,_0x213cd0,_0x34362f){return db['AnalyticExtractedReport'][_0x8dfe('0x4b')]({'where':{'id':_0x970dda['params']['id']},'attributes':[_0x8dfe('0x2f'),'basename',_0x8dfe('0x57'),_0x8dfe('0x58')],'raw':!![]})[_0x8dfe('0x2b')](handleEntityNotFound(_0x213cd0,null))[_0x8dfe('0x2b')](function(_0x26a8d9){if(_0x26a8d9){if(!fs[_0x8dfe('0x59')](path[_0x8dfe('0x5a')](config[_0x8dfe('0x5b')],_0x8dfe('0x5c'),_0x26a8d9[_0x8dfe('0x57')]))){throw new db['Sequelize'][(_0x8dfe('0x5d'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x970dda[_0x8dfe('0x39')][_0x8dfe('0x5e')]){return _0x213cd0[_0x8dfe('0x1d')](0xc8);}return _0x213cd0[_0x8dfe('0x56')](path[_0x8dfe('0x5a')](config[_0x8dfe('0x5b')],_0x8dfe('0x5c'),_0x26a8d9['savename']),util[_0x8dfe('0x5f')]('%s.%s',_0x26a8d9[_0x8dfe('0x60')]||_0x26a8d9['name'],_0x26a8d9[_0x8dfe('0x58')][_0x8dfe('0x61')]()));}})[_0x8dfe('0x4c')](handleError(_0x213cd0,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index df26b16..5d1511a 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 _0xf4f3=['analytics_extracted_reports','../../config/logger','api','moment','bluebird','rimraf','./analyticExtractedReport.attributes','exports'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xf4f3,0x159));var _0x3f4f=function(_0x2e0621,_0x396248){_0x2e0621=_0x2e0621-0x0;var _0x21aee4=_0xf4f3[_0x2e0621];return _0x21aee4;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3f4f('0x0'))(_0x3f4f('0x1'));var moment=require(_0x3f4f('0x2'));var BPromise=require(_0x3f4f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3f4f('0x4'));var config=require('../../config/environment');var attributes=require(_0x3f4f('0x5'));module[_0x3f4f('0x6')]=function(_0x690e13,_0x585862){return _0x690e13['define']('AnalyticExtractedReport',attributes,{'tableName':_0x3f4f('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xacec=['request-promise','rimraf','./analyticExtractedReport.attributes','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','../../config/logger','api','moment'];(function(_0x3a3a46,_0x111874){var _0xe4acdb=function(_0x44b041){while(--_0x44b041){_0x3a3a46['push'](_0x3a3a46['shift']());}};_0xe4acdb(++_0x111874);}(_0xacec,0x88));var _0xcace=function(_0x3bd4e5,_0x33854f){_0x3bd4e5=_0x3bd4e5-0x0;var _0x2d1522=_0xacec[_0x3bd4e5];return _0x2d1522;};'use strict';var _=require(_0xcace('0x0'));var util=require('util');var logger=require(_0xcace('0x1'))(_0xcace('0x2'));var moment=require(_0xcace('0x3'));var BPromise=require('bluebird');var rp=require(_0xcace('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcace('0x5'));var config=require('../../config/environment');var attributes=require(_0xcace('0x6'));module['exports']=function(_0x491f14,_0x24dd13){return _0x491f14[_0xcace('0x7')](_0xcace('0x8'),attributes,{'tableName':_0xcace('0x9'),'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 c9426ea..09f29b3 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 _0x0046=['jayson/promise','client','http','then','info','AnalyticExtractedReport,\x20%s,\x20%s','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x1cb936,_0xd24a3e){var _0x1fee35=function(_0x841d6e){while(--_0x841d6e){_0x1cb936['push'](_0x1cb936['shift']());}};_0x1fee35(++_0xd24a3e);}(_0x0046,0x14f));var _0x6004=function(_0x4b2d37,_0x2589c1){_0x4b2d37=_0x4b2d37-0x0;var _0x2350d3=_0x0046[_0x4b2d37];return _0x2350d3;};'use strict';var _=require(_0x6004('0x0'));var util=require(_0x6004('0x1'));var moment=require(_0x6004('0x2'));var BPromise=require(_0x6004('0x3'));var rs=require(_0x6004('0x4'));var fs=require('fs');var Redis=require(_0x6004('0x5'));var db=require(_0x6004('0x6'))['db'];var utils=require(_0x6004('0x7'));var logger=require('../../config/logger')(_0x6004('0x8'));var config=require(_0x6004('0x9'));var jayson=require(_0x6004('0xa'));var client=jayson[_0x6004('0xb')][_0x6004('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x352969,_0xcae766,_0x50a55d){return new BPromise(function(_0x1d95c7,_0xfa757d){return client['request'](_0x352969,_0x50a55d)[_0x6004('0xd')](function(_0x4429dd){logger[_0x6004('0xe')](_0x6004('0xf'),_0xcae766,'request\x20sent');logger[_0x6004('0x10')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0xcae766,'request\x20sent',JSON[_0x6004('0x11')](_0x4429dd));if(_0x4429dd[_0x6004('0x12')]){if(_0x4429dd[_0x6004('0x12')][_0x6004('0x13')]===0x1f4){logger[_0x6004('0x12')](_0x6004('0xf'),_0xcae766,_0x4429dd[_0x6004('0x12')]['message']);return _0xfa757d(_0x4429dd[_0x6004('0x12')][_0x6004('0x14')]);}logger[_0x6004('0x12')](_0x6004('0xf'),_0xcae766,_0x4429dd[_0x6004('0x12')][_0x6004('0x14')]);return _0x1d95c7(_0x4429dd[_0x6004('0x12')]['message']);}else{logger[_0x6004('0xe')]('AnalyticExtractedReport,\x20%s,\x20%s',_0xcae766,'request\x20sent');_0x1d95c7(_0x4429dd[_0x6004('0x15')][_0x6004('0x14')]);}})[_0x6004('0x16')](function(_0x311263){logger[_0x6004('0x12')]('AnalyticExtractedReport,\x20%s,\x20%s',_0xcae766,_0x311263);_0xfa757d(_0x311263);});});} \ No newline at end of file +var _0x6633=['stringify','error','code','message','info','result','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','http','then','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s'];(function(_0x498334,_0x27b6fe){var _0x13bb70=function(_0x4087b1){while(--_0x4087b1){_0x498334['push'](_0x498334['shift']());}};_0x13bb70(++_0x27b6fe);}(_0x6633,0xfd));var _0x3663=function(_0x1990f0,_0x427550){_0x1990f0=_0x1990f0-0x0;var _0x4b3cf7=_0x6633[_0x1990f0];return _0x4b3cf7;};'use strict';var _=require(_0x3663('0x0'));var util=require(_0x3663('0x1'));var moment=require(_0x3663('0x2'));var BPromise=require(_0x3663('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3663('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3663('0x5'))(_0x3663('0x6'));var config=require(_0x3663('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x3663('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x51604b,_0x47f3ad,_0x47f2a6){return new BPromise(function(_0x5c97fb,_0x418ba7){return client['request'](_0x51604b,_0x47f2a6)[_0x3663('0x9')](function(_0x1352e7){logger['info'](_0x3663('0xa'),_0x47f3ad,_0x3663('0xb'));logger['debug'](_0x3663('0xc'),_0x47f3ad,_0x3663('0xb'),JSON[_0x3663('0xd')](_0x1352e7));if(_0x1352e7['error']){if(_0x1352e7[_0x3663('0xe')][_0x3663('0xf')]===0x1f4){logger['error'](_0x3663('0xa'),_0x47f3ad,_0x1352e7[_0x3663('0xe')]['message']);return _0x418ba7(_0x1352e7['error'][_0x3663('0x10')]);}logger[_0x3663('0xe')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x47f3ad,_0x1352e7[_0x3663('0xe')][_0x3663('0x10')]);return _0x5c97fb(_0x1352e7[_0x3663('0xe')][_0x3663('0x10')]);}else{logger[_0x3663('0x11')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x47f3ad,_0x3663('0xb'));_0x5c97fb(_0x1352e7[_0x3663('0x12')][_0x3663('0x10')]);}})['catch'](function(_0x4e8086){logger[_0x3663('0xe')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x47f3ad,_0x4e8086);_0x418ba7(_0x4e8086);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index 57c7d08..930ec1d 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 _0x6c0b=['fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','get','/:id','show','/:id/download','download','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router'];(function(_0x4c2f17,_0x5c6821){var _0x20919e=function(_0x31eef7){while(--_0x31eef7){_0x4c2f17['push'](_0x4c2f17['shift']());}};_0x20919e(++_0x5c6821);}(_0x6c0b,0x12e));var _0xb6c0=function(_0x489b87,_0xd51c93){_0x489b87=_0x489b87-0x0;var _0x1823b6=_0x6c0b[_0x489b87];return _0x1823b6;};'use strict';var multer=require(_0xb6c0('0x0'));var util=require(_0xb6c0('0x1'));var path=require(_0xb6c0('0x2'));var timeout=require(_0xb6c0('0x3'));var express=require(_0xb6c0('0x4'));var router=express[_0xb6c0('0x5')]();var fs_extra=require(_0xb6c0('0x6'));var auth=require(_0xb6c0('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xb6c0('0x8'));var controller=require('./analyticExtractedReport.controller');router['get']('/',auth[_0xb6c0('0x9')](),controller[_0xb6c0('0xa')]);router[_0xb6c0('0xb')](_0xb6c0('0xc'),auth[_0xb6c0('0x9')](),controller[_0xb6c0('0xd')]);router[_0xb6c0('0xb')](_0xb6c0('0xe'),auth[_0xb6c0('0x9')](),controller[_0xb6c0('0xf')]);router[_0xb6c0('0x10')]('/',auth[_0xb6c0('0x9')](),controller[_0xb6c0('0x11')]);router[_0xb6c0('0x12')](_0xb6c0('0xc'),auth[_0xb6c0('0x9')](),controller[_0xb6c0('0x13')]);router[_0xb6c0('0x14')](_0xb6c0('0xc'),auth['isAuthenticated'](),controller[_0xb6c0('0x15')]);module['exports']=router; \ No newline at end of file +var _0xf43c=['/:id','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','show','post','create'];(function(_0x2e5fe4,_0x2889b8){var _0x1be065=function(_0x1e9cf5){while(--_0x1e9cf5){_0x2e5fe4['push'](_0x2e5fe4['shift']());}};_0x1be065(++_0x2889b8);}(_0xf43c,0xa4));var _0xcf43=function(_0x440178,_0x519854){_0x440178=_0x440178-0x0;var _0x22aa42=_0xf43c[_0x440178];return _0x22aa42;};'use strict';var multer=require(_0xcf43('0x0'));var util=require(_0xcf43('0x1'));var path=require(_0xcf43('0x2'));var timeout=require(_0xcf43('0x3'));var express=require('express');var router=express[_0xcf43('0x4')]();var fs_extra=require(_0xcf43('0x5'));var auth=require(_0xcf43('0x6'));var interaction=require(_0xcf43('0x7'));var config=require(_0xcf43('0x8'));var controller=require(_0xcf43('0x9'));router[_0xcf43('0xa')]('/',auth[_0xcf43('0xb')](),controller[_0xcf43('0xc')]);router[_0xcf43('0xa')]('/:id',auth[_0xcf43('0xb')](),controller[_0xcf43('0xd')]);router['get']('/:id/download',auth[_0xcf43('0xb')](),controller['download']);router[_0xcf43('0xe')]('/',auth[_0xcf43('0xb')](),controller[_0xcf43('0xf')]);router['put'](_0xcf43('0x10'),auth[_0xcf43('0xb')](),controller['update']);router[_0xcf43('0x11')](_0xcf43('0x10'),auth[_0xcf43('0xb')](),controller[_0xcf43('0x12')]);module[_0xcf43('0x13')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index 8f30612..19a520d 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 _0xa3af=['exports','TEXT','STRING','BOOLEAN','sequelize'];(function(_0x525bcf,_0x86ae27){var _0xd63d2f=function(_0x426a23){while(--_0x426a23){_0x525bcf['push'](_0x525bcf['shift']());}};_0xd63d2f(++_0x86ae27);}(_0xa3af,0x185));var _0xfa3a=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xa3af[_0x6131cd];return _0x47e916;};'use strict';var Sequelize=require(_0xfa3a('0x0'));module[_0xfa3a('0x1')]={'field':{'type':Sequelize[_0xfa3a('0x2')]},'alias':{'type':Sequelize[_0xfa3a('0x3')]},'function':{'type':Sequelize[_0xfa3a('0x3')]},'format':{'type':Sequelize[_0xfa3a('0x3')]},'groupBy':{'type':Sequelize[_0xfa3a('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xfa3a('0x3')]},'custom':{'type':Sequelize[_0xfa3a('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x0467=['exports','TEXT','STRING','BOOLEAN','sequelize'];(function(_0x1c83c0,_0x196063){var _0x24a775=function(_0x5e0b6b){while(--_0x5e0b6b){_0x1c83c0['push'](_0x1c83c0['shift']());}};_0x24a775(++_0x196063);}(_0x0467,0x153));var _0x7046=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x0467[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require(_0x7046('0x0'));module[_0x7046('0x1')]={'field':{'type':Sequelize[_0x7046('0x2')]},'alias':{'type':Sequelize[_0x7046('0x3')]},'function':{'type':Sequelize[_0x7046('0x3')]},'format':{'type':Sequelize[_0x7046('0x3')]},'groupBy':{'type':Sequelize[_0x7046('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x7046('0x3')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index 3b6ed10..93264f7 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 _0x5139=['sort','filters','pick','filter','merge','where','map','options','includeAll','include','findAll','catch','params','length','create','bulkCreate','body','destroy','find','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','reject','save','update','then','error','stack','name','index','AnalyticFieldReport','fieldName','type','key','query','keys','intersection','model','fields','attributes','hasOwnProperty','nolimit'];(function(_0x44e114,_0x23db9d){var _0xd10546=function(_0xc9853a){while(--_0xc9853a){_0x44e114['push'](_0x44e114['shift']());}};_0xd10546(++_0x23db9d);}(_0x5139,0xaf));var _0x9513=function(_0x5d329b,_0x15387a){_0x5d329b=_0x5d329b-0x0;var _0x21eefb=_0x5139[_0x5d329b];return _0x21eefb;};'use strict';var emlformat=require(_0x9513('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9513('0x1'));var jsonpatch=require(_0x9513('0x2'));var rp=require(_0x9513('0x3'));var moment=require('moment');var BPromise=require(_0x9513('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x9513('0x5'));var csv=require(_0x9513('0x6'));var ejs=require(_0x9513('0x7'));var fs=require('fs');var fs_extra=require(_0x9513('0x8'));var _=require(_0x9513('0x9'));var squel=require(_0x9513('0xa'));var crypto=require(_0x9513('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x9513('0xc'));var toCsv=require(_0x9513('0x6'));var querystring=require(_0x9513('0xd'));var Papa=require(_0x9513('0xe'));var Redis=require('ioredis');var authService=require(_0x9513('0xf'));var qs=require(_0x9513('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x9513('0x11'));var utils=require(_0x9513('0x12'));var config=require(_0x9513('0x13'));var licenseUtil=require(_0x9513('0x14'));var db=require(_0x9513('0x15'))['db'];function respondWithStatusCode(_0x57978d,_0x1de524){_0x1de524=_0x1de524||0xcc;return function(_0x2448d7){if(_0x2448d7){return _0x57978d[_0x9513('0x16')](_0x1de524);}return _0x57978d[_0x9513('0x17')](_0x1de524)[_0x9513('0x18')]();};}function respondWithResult(_0xb9ef77,_0x545c89){_0x545c89=_0x545c89||0xc8;return function(_0x23401e){if(_0x23401e){return _0xb9ef77['status'](_0x545c89)[_0x9513('0x19')](_0x23401e);}};}function respondWithFilteredResult(_0x38b964,_0x2c938f){return function(_0x633e99){if(_0x633e99){var _0x5d498c=typeof _0x2c938f[_0x9513('0x1a')]==='undefined'&&typeof _0x2c938f[_0x9513('0x1b')]===_0x9513('0x1c');var _0x358fc6=_0x633e99[_0x9513('0x1d')];var _0x50070b=_0x5d498c?0x0:_0x2c938f[_0x9513('0x1a')];var _0x390fdd=_0x5d498c?_0x633e99[_0x9513('0x1d')]:_0x2c938f[_0x9513('0x1a')]+_0x2c938f[_0x9513('0x1b')];var _0x4f36ac;if(_0x390fdd>=_0x358fc6){_0x390fdd=_0x358fc6;_0x4f36ac=0xc8;}else{_0x4f36ac=0xce;}_0x38b964[_0x9513('0x17')](_0x4f36ac);return _0x38b964['set']('Content-Range',_0x50070b+'-'+_0x390fdd+'/'+_0x358fc6)[_0x9513('0x19')](_0x633e99);}return null;};}function patchUpdates(_0x5dee6a){return function(_0x8fd092){try{jsonpatch['apply'](_0x8fd092,_0x5dee6a,!![]);}catch(_0xef9c91){return BPromise[_0x9513('0x1e')](_0xef9c91);}return _0x8fd092[_0x9513('0x1f')]();};}function saveUpdates(_0x3ecd88,_0x90203c){return function(_0x1202f2){if(_0x1202f2){return _0x1202f2[_0x9513('0x20')](_0x3ecd88)[_0x9513('0x21')](function(_0x158fa5){return _0x158fa5;});}return null;};}function removeEntity(_0x1fb750,_0x2a8aad){return function(_0x5cd34b){if(_0x5cd34b){return _0x5cd34b['destroy']()[_0x9513('0x21')](function(){_0x1fb750[_0x9513('0x17')](0xcc)[_0x9513('0x18')]();});}};}function handleEntityNotFound(_0x4d391a,_0x9afd2f){return function(_0x481d0f){if(!_0x481d0f){_0x4d391a[_0x9513('0x16')](0x194);}return _0x481d0f;};}function handleError(_0x19969c,_0x6b1a45){_0x6b1a45=_0x6b1a45||0x1f4;return function(_0x1fe9e9){logger[_0x9513('0x22')](_0x1fe9e9[_0x9513('0x23')]);if(_0x1fe9e9[_0x9513('0x24')]){delete _0x1fe9e9[_0x9513('0x24')];}_0x19969c[_0x9513('0x17')](_0x6b1a45)['send'](_0x1fe9e9);};}exports[_0x9513('0x25')]=function(_0x326d4b,_0x15d4fd){var _0x247190={},_0x46cafb={},_0x151f2c={'count':0x0,'rows':[]};var _0x3a6bec=_['map'](db[_0x9513('0x26')]['rawAttributes'],function(_0x28f1c3){return{'name':_0x28f1c3[_0x9513('0x27')],'type':_0x28f1c3[_0x9513('0x28')][_0x9513('0x29')]};});_0x46cafb['model']=_['map'](_0x3a6bec,_0x9513('0x24'));_0x46cafb[_0x9513('0x2a')]=_[_0x9513('0x2b')](_0x326d4b['query']);_0x46cafb['filters']=_[_0x9513('0x2c')](_0x46cafb[_0x9513('0x2d')],_0x46cafb[_0x9513('0x2a')]);_0x247190['attributes']=_['intersection'](_0x46cafb['model'],qs[_0x9513('0x2e')](_0x326d4b[_0x9513('0x2a')][_0x9513('0x2e')]));_0x247190[_0x9513('0x2f')]=_0x247190['attributes']['length']?_0x247190[_0x9513('0x2f')]:_0x46cafb['model'];if(!_0x326d4b[_0x9513('0x2a')][_0x9513('0x30')](_0x9513('0x31'))){_0x247190['limit']=qs[_0x9513('0x1b')](_0x326d4b[_0x9513('0x2a')][_0x9513('0x1b')]);_0x247190['offset']=qs[_0x9513('0x1a')](_0x326d4b[_0x9513('0x2a')]['offset']);}_0x247190['order']=qs[_0x9513('0x32')](_0x326d4b['query'][_0x9513('0x32')]);_0x247190['where']=qs[_0x9513('0x33')](_[_0x9513('0x34')](_0x326d4b[_0x9513('0x2a')],_0x46cafb[_0x9513('0x33')]),_0x3a6bec);if(_0x326d4b['query'][_0x9513('0x35')]){_0x247190['where']=_[_0x9513('0x36')](_0x247190[_0x9513('0x37')],{'$or':_[_0x9513('0x38')](_0x3a6bec,function(_0x1c0068){if(_0x1c0068[_0x9513('0x28')]!=='VIRTUAL'){var _0x23761b={};_0x23761b[_0x1c0068[_0x9513('0x24')]]={'$like':'%'+_0x326d4b[_0x9513('0x2a')]['filter']+'%'};return _0x23761b;}})});}_0x247190=_[_0x9513('0x36')]({},_0x247190,_0x326d4b[_0x9513('0x39')]);var _0x31de2d={'where':_0x247190[_0x9513('0x37')]};return db['AnalyticFieldReport'][_0x9513('0x1d')](_0x31de2d)[_0x9513('0x21')](function(_0xc92ca4){_0x151f2c[_0x9513('0x1d')]=_0xc92ca4;if(_0x326d4b[_0x9513('0x2a')][_0x9513('0x3a')]){_0x247190[_0x9513('0x3b')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x9513('0x3c')](_0x247190);})[_0x9513('0x21')](function(_0x334c1f){_0x151f2c['rows']=_0x334c1f;return _0x151f2c;})[_0x9513('0x21')](respondWithFilteredResult(_0x15d4fd,_0x247190))[_0x9513('0x3d')](handleError(_0x15d4fd,null));};exports['show']=function(_0xc38fe3,_0x16f78c){var _0x52ec04={'raw':![],'where':{'id':_0xc38fe3[_0x9513('0x3e')]['id']}},_0x16c1e6={};_0x16c1e6[_0x9513('0x2d')]=_[_0x9513('0x2b')](db[_0x9513('0x26')]['rawAttributes']);_0x16c1e6[_0x9513('0x2a')]=_[_0x9513('0x2b')](_0xc38fe3[_0x9513('0x2a')]);_0x16c1e6[_0x9513('0x33')]=_[_0x9513('0x2c')](_0x16c1e6[_0x9513('0x2d')],_0x16c1e6[_0x9513('0x2a')]);_0x52ec04[_0x9513('0x2f')]=_[_0x9513('0x2c')](_0x16c1e6[_0x9513('0x2d')],qs[_0x9513('0x2e')](_0xc38fe3[_0x9513('0x2a')]['fields']));_0x52ec04[_0x9513('0x2f')]=_0x52ec04[_0x9513('0x2f')][_0x9513('0x3f')]?_0x52ec04[_0x9513('0x2f')]:_0x16c1e6[_0x9513('0x2d')];if(_0xc38fe3[_0x9513('0x2a')][_0x9513('0x3a')]){_0x52ec04[_0x9513('0x3b')]=[{'all':!![]}];}_0x52ec04=_[_0x9513('0x36')]({},_0x52ec04,_0xc38fe3[_0x9513('0x39')]);return db[_0x9513('0x26')]['find'](_0x52ec04)[_0x9513('0x21')](handleEntityNotFound(_0x16f78c,null))['then'](respondWithResult(_0x16f78c,null))['catch'](handleError(_0x16f78c,null));};exports[_0x9513('0x40')]=function(_0xbc6bc,_0x5887bc){return db[_0x9513('0x26')][_0x9513('0x40')](_0xbc6bc['body'],{})[_0x9513('0x21')](respondWithResult(_0x5887bc,0xc9))[_0x9513('0x3d')](handleError(_0x5887bc,null));};exports['bulkCreate']=function(_0x142835,_0x5a85d9){return db['AnalyticFieldReport'][_0x9513('0x41')](_0x142835[_0x9513('0x42')],{'raw':![],'individualHooks':!![]})[_0x9513('0x21')](respondWithResult(_0x5a85d9,0xc9))[_0x9513('0x3d')](handleError(_0x5a85d9,null));};exports[_0x9513('0x20')]=function(_0x37535b,_0x2f29f4){if(_0x37535b[_0x9513('0x42')]['id']){delete _0x37535b[_0x9513('0x42')]['id'];}return db[_0x9513('0x26')]['find']({'where':{'id':_0x37535b[_0x9513('0x3e')]['id']}})[_0x9513('0x21')](handleEntityNotFound(_0x2f29f4,null))['then'](saveUpdates(_0x37535b[_0x9513('0x42')],null))[_0x9513('0x21')](respondWithResult(_0x2f29f4,null))[_0x9513('0x3d')](handleError(_0x2f29f4,null));};exports[_0x9513('0x43')]=function(_0x56aef5,_0x12649c){return db[_0x9513('0x26')][_0x9513('0x44')]({'where':{'id':_0x56aef5[_0x9513('0x3e')]['id']}})[_0x9513('0x21')](handleEntityNotFound(_0x12649c,null))[_0x9513('0x21')](removeEntity(_0x12649c,null))[_0x9513('0x3d')](handleError(_0x12649c,null));};exports[_0x9513('0x45')]=function(_0xb1a10c,_0x4907ad){return db[_0x9513('0x26')]['destroy']({'where':{'id':_0xb1a10c[_0x9513('0x2a')][_0x9513('0x46')]||[]},'raw':![],'individualHooks':!![]})[_0x9513('0x21')](respondWithResult(_0x4907ad,0xcc))[_0x9513('0x3d')](handleError(_0x4907ad,null));};exports[_0x9513('0x47')]=function(_0x2497cc,_0xc37475,_0x4e36d2){return db[_0x9513('0x48')][_0x9513('0x49')]({'where':{'id':_0x2497cc[_0x9513('0x3e')]['id']}})[_0x9513('0x21')](handleEntityNotFound(_0xc37475,null))['then'](function(_0x435a1d){if(_0x435a1d){return db[_0x9513('0x4a')]['transaction'](function(_0xa61c4e){return db[_0x9513('0x26')][_0x9513('0x43')]({'where':{'CustomReportId':_0x2497cc[_0x9513('0x3e')]['id']},'transaction':_0xa61c4e})[_0x9513('0x21')](function(_0x4bf9c8){var _0x28097a=_[_0x9513('0x38')](_0x2497cc['body'],function(_0x1c1961){delete _0x1c1961['id'];_0x1c1961['CustomReportId']=_0x2497cc[_0x9513('0x3e')]['id'];return _0x1c1961;});return db[_0x9513('0x26')][_0x9513('0x41')](_0x28097a,{'transaction':_0xa61c4e});});})[_0x9513('0x21')](function(){return db['AnalyticFieldReport']['findAll']({'where':{'CustomReportId':_0x2497cc[_0x9513('0x3e')]['id']}});});}})['then'](respondWithResult(_0xc37475,null))[_0x9513('0x3d')](handleError(_0xc37475,null));}; \ No newline at end of file +var _0xe30f=['length','order','sort','filter','where','merge','VIRTUAL','options','AnalyticFieldReport','includeAll','include','findAll','rows','show','params','catch','create','body','bulkCreate','find','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','eml-format','zip-dir','moment','bluebird','util','path','sox','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','offset','undefined','limit','count','status','Content-Range','json','apply','reject','update','destroy','then','stack','name','index','map','rawAttributes','fieldName','type','key','keys','filters','intersection','model','query','attributes','fields'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe30f,0x15c));var _0xfe30=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xe30f[_0x432682];return _0x463d05;};'use strict';var emlformat=require(_0xfe30('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfe30('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xfe30('0x2'));var BPromise=require(_0xfe30('0x3'));var Mustache=require('mustache');var util=require(_0xfe30('0x4'));var path=require(_0xfe30('0x5'));var sox=require(_0xfe30('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfe30('0x7'));var _=require(_0xfe30('0x8'));var squel=require(_0xfe30('0x9'));var crypto=require(_0xfe30('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xfe30('0xb'));var toCsv=require(_0xfe30('0xc'));var querystring=require(_0xfe30('0xd'));var Papa=require('papaparse');var Redis=require(_0xfe30('0xe'));var authService=require(_0xfe30('0xf'));var qs=require(_0xfe30('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfe30('0x11'));var logger=require(_0xfe30('0x12'))('api');var utils=require(_0xfe30('0x13'));var config=require(_0xfe30('0x14'));var licenseUtil=require(_0xfe30('0x15'));var db=require(_0xfe30('0x16'))['db'];function respondWithStatusCode(_0xd0f76f,_0x10710f){_0x10710f=_0x10710f||0xcc;return function(_0x2f17a1){if(_0x2f17a1){return _0xd0f76f[_0xfe30('0x17')](_0x10710f);}return _0xd0f76f['status'](_0x10710f)[_0xfe30('0x18')]();};}function respondWithResult(_0x3c52ed,_0x23638b){_0x23638b=_0x23638b||0xc8;return function(_0xfb5124){if(_0xfb5124){return _0x3c52ed['status'](_0x23638b)['json'](_0xfb5124);}};}function respondWithFilteredResult(_0x1e43ca,_0x47fbd6){return function(_0xdbc826){if(_0xdbc826){var _0x410fe3=typeof _0x47fbd6[_0xfe30('0x19')]===_0xfe30('0x1a')&&typeof _0x47fbd6[_0xfe30('0x1b')]===_0xfe30('0x1a');var _0x143144=_0xdbc826[_0xfe30('0x1c')];var _0x21b5ed=_0x410fe3?0x0:_0x47fbd6[_0xfe30('0x19')];var _0x47e21c=_0x410fe3?_0xdbc826['count']:_0x47fbd6['offset']+_0x47fbd6['limit'];var _0xe4dae4;if(_0x47e21c>=_0x143144){_0x47e21c=_0x143144;_0xe4dae4=0xc8;}else{_0xe4dae4=0xce;}_0x1e43ca[_0xfe30('0x1d')](_0xe4dae4);return _0x1e43ca['set'](_0xfe30('0x1e'),_0x21b5ed+'-'+_0x47e21c+'/'+_0x143144)[_0xfe30('0x1f')](_0xdbc826);}return null;};}function patchUpdates(_0x133a4d){return function(_0x2b85d9){try{jsonpatch[_0xfe30('0x20')](_0x2b85d9,_0x133a4d,!![]);}catch(_0x34ea1d){return BPromise[_0xfe30('0x21')](_0x34ea1d);}return _0x2b85d9['save']();};}function saveUpdates(_0x946589,_0x5d6be6){return function(_0x34800a){if(_0x34800a){return _0x34800a[_0xfe30('0x22')](_0x946589)['then'](function(_0x5fe62){return _0x5fe62;});}return null;};}function removeEntity(_0x5f1acd,_0x354006){return function(_0x152a39){if(_0x152a39){return _0x152a39[_0xfe30('0x23')]()[_0xfe30('0x24')](function(){_0x5f1acd[_0xfe30('0x1d')](0xcc)[_0xfe30('0x18')]();});}};}function handleEntityNotFound(_0x4763bd,_0x54e3ce){return function(_0x5a6d02){if(!_0x5a6d02){_0x4763bd[_0xfe30('0x17')](0x194);}return _0x5a6d02;};}function handleError(_0x26682a,_0x295040){_0x295040=_0x295040||0x1f4;return function(_0x57b8a6){logger['error'](_0x57b8a6[_0xfe30('0x25')]);if(_0x57b8a6[_0xfe30('0x26')]){delete _0x57b8a6[_0xfe30('0x26')];}_0x26682a[_0xfe30('0x1d')](_0x295040)['send'](_0x57b8a6);};}exports[_0xfe30('0x27')]=function(_0x5bf253,_0x5646c2){var _0x16747e={},_0x22878d={},_0x35326c={'count':0x0,'rows':[]};var _0x426c6e=_[_0xfe30('0x28')](db['AnalyticFieldReport'][_0xfe30('0x29')],function(_0x4a80c1){return{'name':_0x4a80c1[_0xfe30('0x2a')],'type':_0x4a80c1[_0xfe30('0x2b')][_0xfe30('0x2c')]};});_0x22878d['model']=_[_0xfe30('0x28')](_0x426c6e,_0xfe30('0x26'));_0x22878d['query']=_[_0xfe30('0x2d')](_0x5bf253['query']);_0x22878d[_0xfe30('0x2e')]=_[_0xfe30('0x2f')](_0x22878d[_0xfe30('0x30')],_0x22878d[_0xfe30('0x31')]);_0x16747e[_0xfe30('0x32')]=_['intersection'](_0x22878d['model'],qs['fields'](_0x5bf253[_0xfe30('0x31')][_0xfe30('0x33')]));_0x16747e[_0xfe30('0x32')]=_0x16747e[_0xfe30('0x32')][_0xfe30('0x34')]?_0x16747e[_0xfe30('0x32')]:_0x22878d[_0xfe30('0x30')];if(!_0x5bf253[_0xfe30('0x31')]['hasOwnProperty']('nolimit')){_0x16747e[_0xfe30('0x1b')]=qs[_0xfe30('0x1b')](_0x5bf253[_0xfe30('0x31')][_0xfe30('0x1b')]);_0x16747e[_0xfe30('0x19')]=qs[_0xfe30('0x19')](_0x5bf253[_0xfe30('0x31')][_0xfe30('0x19')]);}_0x16747e[_0xfe30('0x35')]=qs[_0xfe30('0x36')](_0x5bf253[_0xfe30('0x31')]['sort']);_0x16747e['where']=qs[_0xfe30('0x2e')](_['pick'](_0x5bf253[_0xfe30('0x31')],_0x22878d['filters']),_0x426c6e);if(_0x5bf253[_0xfe30('0x31')][_0xfe30('0x37')]){_0x16747e[_0xfe30('0x38')]=_[_0xfe30('0x39')](_0x16747e['where'],{'$or':_[_0xfe30('0x28')](_0x426c6e,function(_0x99a5d9){if(_0x99a5d9[_0xfe30('0x2b')]!==_0xfe30('0x3a')){var _0x5e657b={};_0x5e657b[_0x99a5d9['name']]={'$like':'%'+_0x5bf253['query'][_0xfe30('0x37')]+'%'};return _0x5e657b;}})});}_0x16747e=_[_0xfe30('0x39')]({},_0x16747e,_0x5bf253[_0xfe30('0x3b')]);var _0x4b81ac={'where':_0x16747e[_0xfe30('0x38')]};return db[_0xfe30('0x3c')]['count'](_0x4b81ac)[_0xfe30('0x24')](function(_0x92c9b4){_0x35326c[_0xfe30('0x1c')]=_0x92c9b4;if(_0x5bf253[_0xfe30('0x31')][_0xfe30('0x3d')]){_0x16747e[_0xfe30('0x3e')]=[{'all':!![]}];}return db[_0xfe30('0x3c')][_0xfe30('0x3f')](_0x16747e);})[_0xfe30('0x24')](function(_0x500310){_0x35326c[_0xfe30('0x40')]=_0x500310;return _0x35326c;})[_0xfe30('0x24')](respondWithFilteredResult(_0x5646c2,_0x16747e))['catch'](handleError(_0x5646c2,null));};exports[_0xfe30('0x41')]=function(_0x19663a,_0x3cd371){var _0x19f813={'raw':![],'where':{'id':_0x19663a[_0xfe30('0x42')]['id']}},_0x33a11b={};_0x33a11b[_0xfe30('0x30')]=_[_0xfe30('0x2d')](db[_0xfe30('0x3c')][_0xfe30('0x29')]);_0x33a11b['query']=_[_0xfe30('0x2d')](_0x19663a['query']);_0x33a11b[_0xfe30('0x2e')]=_[_0xfe30('0x2f')](_0x33a11b['model'],_0x33a11b[_0xfe30('0x31')]);_0x19f813[_0xfe30('0x32')]=_[_0xfe30('0x2f')](_0x33a11b[_0xfe30('0x30')],qs['fields'](_0x19663a[_0xfe30('0x31')]['fields']));_0x19f813[_0xfe30('0x32')]=_0x19f813['attributes']['length']?_0x19f813[_0xfe30('0x32')]:_0x33a11b[_0xfe30('0x30')];if(_0x19663a['query'][_0xfe30('0x3d')]){_0x19f813['include']=[{'all':!![]}];}_0x19f813=_['merge']({},_0x19f813,_0x19663a[_0xfe30('0x3b')]);return db[_0xfe30('0x3c')]['find'](_0x19f813)['then'](handleEntityNotFound(_0x3cd371,null))[_0xfe30('0x24')](respondWithResult(_0x3cd371,null))[_0xfe30('0x43')](handleError(_0x3cd371,null));};exports[_0xfe30('0x44')]=function(_0x4e6dff,_0x2ce642){return db[_0xfe30('0x3c')][_0xfe30('0x44')](_0x4e6dff[_0xfe30('0x45')],{})[_0xfe30('0x24')](respondWithResult(_0x2ce642,0xc9))[_0xfe30('0x43')](handleError(_0x2ce642,null));};exports[_0xfe30('0x46')]=function(_0x187486,_0x2c9500){return db[_0xfe30('0x3c')][_0xfe30('0x46')](_0x187486[_0xfe30('0x45')],{'raw':![],'individualHooks':!![]})[_0xfe30('0x24')](respondWithResult(_0x2c9500,0xc9))[_0xfe30('0x43')](handleError(_0x2c9500,null));};exports[_0xfe30('0x22')]=function(_0x2f5f25,_0x43d682){if(_0x2f5f25[_0xfe30('0x45')]['id']){delete _0x2f5f25[_0xfe30('0x45')]['id'];}return db[_0xfe30('0x3c')][_0xfe30('0x47')]({'where':{'id':_0x2f5f25[_0xfe30('0x42')]['id']}})[_0xfe30('0x24')](handleEntityNotFound(_0x43d682,null))[_0xfe30('0x24')](saveUpdates(_0x2f5f25['body'],null))['then'](respondWithResult(_0x43d682,null))[_0xfe30('0x43')](handleError(_0x43d682,null));};exports[_0xfe30('0x23')]=function(_0x3d535d,_0x1871c1){return db['AnalyticFieldReport'][_0xfe30('0x47')]({'where':{'id':_0x3d535d[_0xfe30('0x42')]['id']}})[_0xfe30('0x24')](handleEntityNotFound(_0x1871c1,null))[_0xfe30('0x24')](removeEntity(_0x1871c1,null))[_0xfe30('0x43')](handleError(_0x1871c1,null));};exports[_0xfe30('0x48')]=function(_0x211514,_0x1f29ad){return db['AnalyticFieldReport'][_0xfe30('0x23')]({'where':{'id':_0x211514[_0xfe30('0x31')][_0xfe30('0x49')]||[]},'raw':![],'individualHooks':!![]})[_0xfe30('0x24')](respondWithResult(_0x1f29ad,0xcc))['catch'](handleError(_0x1f29ad,null));};exports[_0xfe30('0x4a')]=function(_0xc61b6f,_0x1b9631,_0x2f6299){return db[_0xfe30('0x4b')][_0xfe30('0x4c')]({'where':{'id':_0xc61b6f[_0xfe30('0x42')]['id']}})[_0xfe30('0x24')](handleEntityNotFound(_0x1b9631,null))['then'](function(_0x2ef5ab){if(_0x2ef5ab){return db[_0xfe30('0x4d')][_0xfe30('0x4e')](function(_0x5527ba){return db[_0xfe30('0x3c')]['destroy']({'where':{'CustomReportId':_0xc61b6f['params']['id']},'transaction':_0x5527ba})['then'](function(_0x40180e){var _0x54cd13=_['map'](_0xc61b6f['body'],function(_0x15f216){delete _0x15f216['id'];_0x15f216[_0xfe30('0x4f')]=_0xc61b6f[_0xfe30('0x42')]['id'];return _0x15f216;});return db['AnalyticFieldReport'][_0xfe30('0x46')](_0x54cd13,{'transaction':_0x5527ba});});})['then'](function(){return db['AnalyticFieldReport'][_0xfe30('0x3f')]({'where':{'CustomReportId':_0xc61b6f[_0xfe30('0x42')]['id']}});});}})[_0xfe30('0x24')](respondWithResult(_0x1b9631,null))[_0xfe30('0x43')](handleError(_0x1b9631,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 127b43f..aef0bf5 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 _0x9060=['../../config/environment','./analyticFieldReport.attributes','AnalyticFieldReport','analytics_report_fields','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x5270ee,_0x4fe7a3){var _0x21fecb=function(_0x3602be){while(--_0x3602be){_0x5270ee['push'](_0x5270ee['shift']());}};_0x21fecb(++_0x4fe7a3);}(_0x9060,0x130));var _0x0906=function(_0x68ee8b,_0x3cc6c5){_0x68ee8b=_0x68ee8b-0x0;var _0x5148f7=_0x9060[_0x68ee8b];return _0x5148f7;};'use strict';var _=require(_0x0906('0x0'));var util=require('util');var logger=require(_0x0906('0x1'))(_0x0906('0x2'));var moment=require(_0x0906('0x3'));var BPromise=require(_0x0906('0x4'));var rp=require(_0x0906('0x5'));var fs=require('fs');var path=require(_0x0906('0x6'));var rimraf=require(_0x0906('0x7'));var config=require(_0x0906('0x8'));var attributes=require(_0x0906('0x9'));module['exports']=function(_0x1a4f22,_0x53007c){return _0x1a4f22['define'](_0x0906('0xa'),attributes,{'tableName':_0x0906('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x77bb=['api','request-promise','../../config/environment','./analyticFieldReport.attributes','exports','AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger'];(function(_0x27fe0f,_0x39cb63){var _0x28b7d3=function(_0x52be6f){while(--_0x52be6f){_0x27fe0f['push'](_0x27fe0f['shift']());}};_0x28b7d3(++_0x39cb63);}(_0x77bb,0xbb));var _0xb77b=function(_0x145cf3,_0x3bf0da){_0x145cf3=_0x145cf3-0x0;var _0x5db0bf=_0x77bb[_0x145cf3];return _0x5db0bf;};'use strict';var _=require(_0xb77b('0x0'));var util=require(_0xb77b('0x1'));var logger=require(_0xb77b('0x2'))(_0xb77b('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb77b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xb77b('0x5'));var attributes=require(_0xb77b('0x6'));module[_0xb77b('0x7')]=function(_0x41d3f6,_0x276c50){return _0x41d3f6['define'](_0xb77b('0x8'),attributes,{'tableName':_0xb77b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js index deb2187..edb6004 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 _0xba47=['then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x26a3f9,_0x275fe9){var _0x37a62f=function(_0x2f078f){while(--_0x2f078f){_0x26a3f9['push'](_0x26a3f9['shift']());}};_0x37a62f(++_0x275fe9);}(_0xba47,0xa8));var _0x7ba4=function(_0x533d3c,_0x326c9f){_0x533d3c=_0x533d3c-0x0;var _0x4cd573=_0xba47[_0x533d3c];return _0x4cd573;};'use strict';var _=require(_0x7ba4('0x0'));var util=require(_0x7ba4('0x1'));var moment=require(_0x7ba4('0x2'));var BPromise=require(_0x7ba4('0x3'));var rs=require(_0x7ba4('0x4'));var fs=require('fs');var Redis=require(_0x7ba4('0x5'));var db=require(_0x7ba4('0x6'))['db'];var utils=require(_0x7ba4('0x7'));var logger=require('../../config/logger')(_0x7ba4('0x8'));var config=require(_0x7ba4('0x9'));var jayson=require(_0x7ba4('0xa'));var client=jayson[_0x7ba4('0xb')][_0x7ba4('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3ed4f1,_0x4db0cc,_0x48a42b){return new BPromise(function(_0x52db60,_0x4571a4){return client[_0x7ba4('0xd')](_0x3ed4f1,_0x48a42b)[_0x7ba4('0xe')](function(_0x22f14f){logger[_0x7ba4('0xf')](_0x7ba4('0x10'),_0x4db0cc,_0x7ba4('0x11'));logger[_0x7ba4('0x12')](_0x7ba4('0x13'),_0x4db0cc,_0x7ba4('0x11'),JSON[_0x7ba4('0x14')](_0x22f14f));if(_0x22f14f[_0x7ba4('0x15')]){if(_0x22f14f[_0x7ba4('0x15')][_0x7ba4('0x16')]===0x1f4){logger[_0x7ba4('0x15')](_0x7ba4('0x10'),_0x4db0cc,_0x22f14f[_0x7ba4('0x15')][_0x7ba4('0x17')]);return _0x4571a4(_0x22f14f[_0x7ba4('0x15')][_0x7ba4('0x17')]);}logger[_0x7ba4('0x15')](_0x7ba4('0x10'),_0x4db0cc,_0x22f14f[_0x7ba4('0x15')][_0x7ba4('0x17')]);return _0x52db60(_0x22f14f['error'][_0x7ba4('0x17')]);}else{logger['info'](_0x7ba4('0x10'),_0x4db0cc,'request\x20sent');_0x52db60(_0x22f14f[_0x7ba4('0x18')][_0x7ba4('0x17')]);}})[_0x7ba4('0x19')](function(_0x21c035){logger[_0x7ba4('0x15')](_0x7ba4('0x10'),_0x4db0cc,_0x21c035);_0x4571a4(_0x21c035);});});} \ No newline at end of file +var _0xfeca=['message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticFieldReport,\x20%s,\x20%s'];(function(_0x3007b2,_0x4d0027){var _0x4597a9=function(_0x493679){while(--_0x493679){_0x3007b2['push'](_0x3007b2['shift']());}};_0x4597a9(++_0x4d0027);}(_0xfeca,0xf4));var _0xafec=function(_0x1866b7,_0x243cf7){_0x1866b7=_0x1866b7-0x0;var _0x5a0a82=_0xfeca[_0x1866b7];return _0x5a0a82;};'use strict';var _=require(_0xafec('0x0'));var util=require(_0xafec('0x1'));var moment=require(_0xafec('0x2'));var BPromise=require(_0xafec('0x3'));var rs=require(_0xafec('0x4'));var fs=require('fs');var Redis=require(_0xafec('0x5'));var db=require(_0xafec('0x6'))['db'];var utils=require(_0xafec('0x7'));var logger=require('../../config/logger')(_0xafec('0x8'));var config=require(_0xafec('0x9'));var jayson=require(_0xafec('0xa'));var client=jayson[_0xafec('0xb')][_0xafec('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1d9b88,_0x4080ea,_0x1248e9){return new BPromise(function(_0x1561be,_0xf6561b){return client[_0xafec('0xd')](_0x1d9b88,_0x1248e9)['then'](function(_0xe7c737){logger['info']('AnalyticFieldReport,\x20%s,\x20%s',_0x4080ea,_0xafec('0xe'));logger['debug'](_0xafec('0xf'),_0x4080ea,_0xafec('0xe'),JSON[_0xafec('0x10')](_0xe7c737));if(_0xe7c737[_0xafec('0x11')]){if(_0xe7c737[_0xafec('0x11')][_0xafec('0x12')]===0x1f4){logger['error'](_0xafec('0x13'),_0x4080ea,_0xe7c737['error']['message']);return _0xf6561b(_0xe7c737[_0xafec('0x11')][_0xafec('0x14')]);}logger['error'](_0xafec('0x13'),_0x4080ea,_0xe7c737[_0xafec('0x11')][_0xafec('0x14')]);return _0x1561be(_0xe7c737[_0xafec('0x11')][_0xafec('0x14')]);}else{logger[_0xafec('0x15')](_0xafec('0x13'),_0x4080ea,_0xafec('0xe'));_0x1561be(_0xe7c737[_0xafec('0x16')]['message']);}})[_0xafec('0x17')](function(_0x5331dc){logger[_0xafec('0x11')]('AnalyticFieldReport,\x20%s,\x20%s',_0x4080ea,_0x5331dc);_0xf6561b(_0x5331dc);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index f31ff61..38d837c 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(_0x185ca0,_0x548954){var _0x40f97c=function(_0x356a64){while(--_0x356a64){_0x185ca0['push'](_0x185ca0['shift']());}};_0x40f97c(++_0x548954);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xa9e0[_0x3ce3c];return _0x55a2c9;};'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(_0x974a42,_0x509392){var _0x1b801c=function(_0x37bb44){while(--_0x37bb44){_0x974a42['push'](_0x974a42['shift']());}};_0x1b801c(++_0x509392);}(_0xa9e0,0x123));var _0x0a9e=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xa9e0[_0x481bf7];return _0x461787;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0a9e('0xb')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xb')](_0x0a9e('0xf'),auth['isAuthenticated'](),controller['addFields']);router['put']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);module[_0x0a9e('0x15')]=router; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.attributes.js b/server/api/analyticMetric/analyticMetric.attributes.js index d96cfed..7b97241 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 _0x37e9=['name','TEXT','sequelize','exports','STRING'];(function(_0x33396e,_0x4412a2){var _0x3be463=function(_0x306fb3){while(--_0x306fb3){_0x33396e['push'](_0x33396e['shift']());}};_0x3be463(++_0x4412a2);}(_0x37e9,0x1e7));var _0x937e=function(_0x11d477,_0x20cb6f){_0x11d477=_0x11d477-0x0;var _0x38d88e=_0x37e9[_0x11d477];return _0x38d88e;};'use strict';var Sequelize=require(_0x937e('0x0'));module[_0x937e('0x1')]={'name':{'type':Sequelize[_0x937e('0x2')],'allowNull':![],'unique':_0x937e('0x3')},'table':{'type':Sequelize[_0x937e('0x2')]},'metric':{'type':Sequelize[_0x937e('0x4')]},'description':{'type':Sequelize[_0x937e('0x2')]}}; \ No newline at end of file +var _0xd757=['name','sequelize','exports','STRING'];(function(_0x187e2c,_0x1f0899){var _0x214c94=function(_0x51325c){while(--_0x51325c){_0x187e2c['push'](_0x187e2c['shift']());}};_0x214c94(++_0x1f0899);}(_0xd757,0x1e5));var _0x7d75=function(_0x46c6b5,_0x23f130){_0x46c6b5=_0x46c6b5-0x0;var _0x429113=_0xd757[_0x46c6b5];return _0x429113;};'use strict';var Sequelize=require(_0x7d75('0x0'));module[_0x7d75('0x1')]={'name':{'type':Sequelize[_0x7d75('0x2')],'allowNull':![],'unique':_0x7d75('0x3')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0x7d75('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index 3535f3b..1564b10 100644 --- a/server/api/analyticMetric/analyticMetric.controller.js +++ b/server/api/analyticMetric/analyticMetric.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9a19=['AnalyticMetric','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','options','find','body','user','UserProfileSection','autoAssociation','create','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','save','then','destroy','get','Metrics','stack','name','send','index','map'];(function(_0x5b03a6,_0x192292){var _0x5900fa=function(_0x6d8a00){while(--_0x6d8a00){_0x5b03a6['push'](_0x5b03a6['shift']());}};_0x5900fa(++_0x192292);}(_0x9a19,0x114));var _0x99a1=function(_0xbb14db,_0x3ee8c6){_0xbb14db=_0xbb14db-0x0;var _0x36bed7=_0x9a19[_0xbb14db];return _0x36bed7;};'use strict';var emlformat=require(_0x99a1('0x0'));var rimraf=require(_0x99a1('0x1'));var zipdir=require(_0x99a1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x99a1('0x3'));var moment=require(_0x99a1('0x4'));var BPromise=require(_0x99a1('0x5'));var Mustache=require(_0x99a1('0x6'));var util=require(_0x99a1('0x7'));var path=require(_0x99a1('0x8'));var sox=require(_0x99a1('0x9'));var csv=require(_0x99a1('0xa'));var ejs=require(_0x99a1('0xb'));var fs=require('fs');var fs_extra=require(_0x99a1('0xc'));var _=require(_0x99a1('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x99a1('0xe'));var toCsv=require(_0x99a1('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x99a1('0xf'));var authService=require(_0x99a1('0x10'));var qs=require(_0x99a1('0x11'));var as=require(_0x99a1('0x12'));var hardwareService=require(_0x99a1('0x13'));var logger=require('../../config/logger')(_0x99a1('0x14'));var utils=require(_0x99a1('0x15'));var config=require(_0x99a1('0x16'));var licenseUtil=require(_0x99a1('0x17'));var db=require(_0x99a1('0x18'))['db'];function respondWithStatusCode(_0x1bc7aa,_0x2ff655){_0x2ff655=_0x2ff655||0xcc;return function(_0x532f56){if(_0x532f56){return _0x1bc7aa[_0x99a1('0x19')](_0x2ff655);}return _0x1bc7aa[_0x99a1('0x1a')](_0x2ff655)[_0x99a1('0x1b')]();};}function respondWithResult(_0x47815e,_0xe1a1f){_0xe1a1f=_0xe1a1f||0xc8;return function(_0x3c9ef4){if(_0x3c9ef4){return _0x47815e[_0x99a1('0x1a')](_0xe1a1f)['json'](_0x3c9ef4);}};}function respondWithFilteredResult(_0x2d81ed,_0x3e45d4){return function(_0x1bb464){if(_0x1bb464){var _0x3d40cc=typeof _0x3e45d4[_0x99a1('0x1c')]===_0x99a1('0x1d')&&typeof _0x3e45d4[_0x99a1('0x1e')]==='undefined';var _0x4f049c=_0x1bb464[_0x99a1('0x1f')];var _0xbf62f1=_0x3d40cc?0x0:_0x3e45d4[_0x99a1('0x1c')];var _0x1fcd00=_0x3d40cc?_0x1bb464[_0x99a1('0x1f')]:_0x3e45d4[_0x99a1('0x1c')]+_0x3e45d4[_0x99a1('0x1e')];var _0x3cd62c;if(_0x1fcd00>=_0x4f049c){_0x1fcd00=_0x4f049c;_0x3cd62c=0xc8;}else{_0x3cd62c=0xce;}_0x2d81ed[_0x99a1('0x1a')](_0x3cd62c);return _0x2d81ed[_0x99a1('0x20')](_0x99a1('0x21'),_0xbf62f1+'-'+_0x1fcd00+'/'+_0x4f049c)['json'](_0x1bb464);}return null;};}function patchUpdates(_0x3023a1){return function(_0x20007e){try{jsonpatch['apply'](_0x20007e,_0x3023a1,!![]);}catch(_0x38435b){return BPromise['reject'](_0x38435b);}return _0x20007e[_0x99a1('0x22')]();};}function saveUpdates(_0x2927b0,_0x2d6f20){return function(_0x2d3b82){if(_0x2d3b82){return _0x2d3b82['update'](_0x2927b0)[_0x99a1('0x23')](function(_0x1268a7){return _0x1268a7;});}return null;};}function removeEntity(_0x483c17,_0x44df2d){return function(_0x5b5dfa){if(_0x5b5dfa){return _0x5b5dfa[_0x99a1('0x24')]()[_0x99a1('0x23')](function(){var _0x179597=_0x5b5dfa[_0x99a1('0x25')]({'plain':!![]});var _0x3c813=_0x99a1('0x26');return db['UserProfileResource'][_0x99a1('0x24')]({'where':{'type':_0x3c813,'resourceId':_0x179597['id']}})['then'](function(){return _0x5b5dfa;});})['then'](function(){_0x483c17[_0x99a1('0x1a')](0xcc)[_0x99a1('0x1b')]();});}};}function handleEntityNotFound(_0xa6799b,_0x15a0b6){return function(_0x25d560){if(!_0x25d560){_0xa6799b[_0x99a1('0x19')](0x194);}return _0x25d560;};}function handleError(_0x183037,_0x549645){_0x549645=_0x549645||0x1f4;return function(_0xf41b0d){logger['error'](_0xf41b0d[_0x99a1('0x27')]);if(_0xf41b0d[_0x99a1('0x28')]){delete _0xf41b0d[_0x99a1('0x28')];}_0x183037['status'](_0x549645)[_0x99a1('0x29')](_0xf41b0d);};}exports[_0x99a1('0x2a')]=function(_0x5718b9,_0x37514e){var _0x1434a0={},_0x36aa34={},_0x303d1e={'count':0x0,'rows':[]};var _0x2a5b8c=_[_0x99a1('0x2b')](db[_0x99a1('0x2c')][_0x99a1('0x2d')],function(_0x52da8d){return{'name':_0x52da8d['fieldName'],'type':_0x52da8d[_0x99a1('0x2e')]['key']};});_0x36aa34[_0x99a1('0x2f')]=_[_0x99a1('0x2b')](_0x2a5b8c,'name');_0x36aa34[_0x99a1('0x30')]=_[_0x99a1('0x31')](_0x5718b9[_0x99a1('0x30')]);_0x36aa34[_0x99a1('0x32')]=_[_0x99a1('0x33')](_0x36aa34[_0x99a1('0x2f')],_0x36aa34[_0x99a1('0x30')]);_0x1434a0[_0x99a1('0x34')]=_[_0x99a1('0x33')](_0x36aa34[_0x99a1('0x2f')],qs[_0x99a1('0x35')](_0x5718b9[_0x99a1('0x30')][_0x99a1('0x35')]));_0x1434a0[_0x99a1('0x34')]=_0x1434a0['attributes']['length']?_0x1434a0[_0x99a1('0x34')]:_0x36aa34[_0x99a1('0x2f')];if(!_0x5718b9[_0x99a1('0x30')][_0x99a1('0x36')](_0x99a1('0x37'))){_0x1434a0[_0x99a1('0x1e')]=qs[_0x99a1('0x1e')](_0x5718b9['query'][_0x99a1('0x1e')]);_0x1434a0[_0x99a1('0x1c')]=qs['offset'](_0x5718b9[_0x99a1('0x30')][_0x99a1('0x1c')]);}_0x1434a0[_0x99a1('0x38')]=qs[_0x99a1('0x39')](_0x5718b9[_0x99a1('0x30')][_0x99a1('0x39')]);_0x1434a0[_0x99a1('0x3a')]=qs[_0x99a1('0x32')](_[_0x99a1('0x3b')](_0x5718b9[_0x99a1('0x30')],_0x36aa34[_0x99a1('0x32')]),_0x2a5b8c);if(_0x5718b9[_0x99a1('0x30')][_0x99a1('0x3c')]){_0x1434a0['where']=_['merge'](_0x1434a0['where'],{'$or':_[_0x99a1('0x2b')](_0x2a5b8c,function(_0x169df7){if(_0x169df7[_0x99a1('0x2e')]!==_0x99a1('0x3d')){var _0x40613a={};_0x40613a[_0x169df7['name']]={'$like':'%'+_0x5718b9[_0x99a1('0x30')][_0x99a1('0x3c')]+'%'};return _0x40613a;}})});}_0x1434a0=_[_0x99a1('0x3e')]({},_0x1434a0,_0x5718b9['options']);var _0x49be37={'where':_0x1434a0[_0x99a1('0x3a')]};return db[_0x99a1('0x2c')][_0x99a1('0x1f')](_0x49be37)['then'](function(_0x6c4cb){_0x303d1e[_0x99a1('0x1f')]=_0x6c4cb;if(_0x5718b9[_0x99a1('0x30')][_0x99a1('0x3f')]){_0x1434a0[_0x99a1('0x40')]=[{'all':!![]}];}return db[_0x99a1('0x2c')][_0x99a1('0x41')](_0x1434a0);})[_0x99a1('0x23')](function(_0x1c4ce4){_0x303d1e[_0x99a1('0x42')]=_0x1c4ce4;return _0x303d1e;})['then'](respondWithFilteredResult(_0x37514e,_0x1434a0))[_0x99a1('0x43')](handleError(_0x37514e,null));};exports[_0x99a1('0x44')]=function(_0x3d5373,_0x50d38b){var _0x1beed2={'raw':!![],'where':{'id':_0x3d5373[_0x99a1('0x45')]['id']}},_0x51536d={};_0x51536d[_0x99a1('0x2f')]=_[_0x99a1('0x31')](db[_0x99a1('0x2c')][_0x99a1('0x2d')]);_0x51536d[_0x99a1('0x30')]=_['keys'](_0x3d5373[_0x99a1('0x30')]);_0x51536d['filters']=_[_0x99a1('0x33')](_0x51536d[_0x99a1('0x2f')],_0x51536d[_0x99a1('0x30')]);_0x1beed2[_0x99a1('0x34')]=_[_0x99a1('0x33')](_0x51536d[_0x99a1('0x2f')],qs[_0x99a1('0x35')](_0x3d5373[_0x99a1('0x30')][_0x99a1('0x35')]));_0x1beed2[_0x99a1('0x34')]=_0x1beed2[_0x99a1('0x34')]['length']?_0x1beed2[_0x99a1('0x34')]:_0x51536d[_0x99a1('0x2f')];if(_0x3d5373['query'][_0x99a1('0x3f')]){_0x1beed2[_0x99a1('0x40')]=[{'all':!![]}];}_0x1beed2=_[_0x99a1('0x3e')]({},_0x1beed2,_0x3d5373[_0x99a1('0x46')]);return db[_0x99a1('0x2c')][_0x99a1('0x47')](_0x1beed2)[_0x99a1('0x23')](handleEntityNotFound(_0x50d38b,null))['then'](respondWithResult(_0x50d38b,null))[_0x99a1('0x43')](handleError(_0x50d38b,null));};exports['create']=function(_0x1d4d3f,_0x269798){return db['AnalyticMetric']['create'](_0x1d4d3f[_0x99a1('0x48')],{})[_0x99a1('0x23')](function(_0x462c15){var _0x4519fb=_0x1d4d3f[_0x99a1('0x49')]['get']({'plain':!![]});if(!_0x4519fb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4519fb['role']===_0x99a1('0x49')){var _0x4ae90e=_0x462c15[_0x99a1('0x25')]({'plain':!![]});var _0x30fdfb=_0x99a1('0x26');return db[_0x99a1('0x4a')][_0x99a1('0x47')]({'where':{'name':_0x30fdfb,'userProfileId':_0x4519fb['userProfileId']},'raw':!![]})[_0x99a1('0x23')](function(_0x22bfd8){if(_0x22bfd8&&_0x22bfd8[_0x99a1('0x4b')]===0x0){return db['UserProfileResource'][_0x99a1('0x4c')]({'name':_0x4ae90e['name'],'resourceId':_0x4ae90e['id'],'type':_0x22bfd8['name'],'sectionId':_0x22bfd8['id']},{})[_0x99a1('0x23')](function(){return _0x462c15;});}else{return _0x462c15;}})[_0x99a1('0x43')](function(_0x1dd17b){logger[_0x99a1('0x4d')](_0x99a1('0x4e'),_0x1dd17b);throw _0x1dd17b;});}return _0x462c15;})[_0x99a1('0x23')](respondWithResult(_0x269798,0xc9))[_0x99a1('0x43')](handleError(_0x269798,null));};exports[_0x99a1('0x4f')]=function(_0x16641e,_0x53e9eb){if(_0x16641e[_0x99a1('0x48')]['id']){delete _0x16641e['body']['id'];}return db[_0x99a1('0x2c')][_0x99a1('0x47')]({'where':{'id':_0x16641e['params']['id']}})[_0x99a1('0x23')](handleEntityNotFound(_0x53e9eb,null))[_0x99a1('0x23')](saveUpdates(_0x16641e[_0x99a1('0x48')],null))[_0x99a1('0x23')](respondWithResult(_0x53e9eb,null))[_0x99a1('0x43')](handleError(_0x53e9eb,null));};exports[_0x99a1('0x24')]=function(_0x157c49,_0x1a5658){return db[_0x99a1('0x2c')][_0x99a1('0x47')]({'where':{'id':_0x157c49[_0x99a1('0x45')]['id']}})[_0x99a1('0x23')](handleEntityNotFound(_0x1a5658,null))['then'](removeEntity(_0x1a5658,null))['catch'](handleError(_0x1a5658,null));}; \ No newline at end of file +var _0xdc97=['mustache','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','update','then','get','destroy','sendStatus','error','stack','name','send','AnalyticMetric','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','length','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','includeAll','findAll','rows','catch','params','keys','fields','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Metrics','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','eml-format','rimraf','zip-dir','request-promise','bluebird'];(function(_0x55279e,_0x52184e){var _0x2690c6=function(_0x2269c0){while(--_0x2269c0){_0x55279e['push'](_0x55279e['shift']());}};_0x2690c6(++_0x52184e);}(_0xdc97,0x13b));var _0x7dc9=function(_0x2f00d7,_0x80b5e9){_0x2f00d7=_0x2f00d7-0x0;var _0x49a48f=_0xdc97[_0x2f00d7];return _0x49a48f;};'use strict';var emlformat=require(_0x7dc9('0x0'));var rimraf=require(_0x7dc9('0x1'));var zipdir=require(_0x7dc9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7dc9('0x3'));var moment=require('moment');var BPromise=require(_0x7dc9('0x4'));var Mustache=require(_0x7dc9('0x5'));var util=require('util');var path=require(_0x7dc9('0x6'));var sox=require(_0x7dc9('0x7'));var csv=require(_0x7dc9('0x8'));var ejs=require(_0x7dc9('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7dc9('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7dc9('0xb'));var deskjs=require(_0x7dc9('0xc'));var toCsv=require(_0x7dc9('0x8'));var querystring=require(_0x7dc9('0xd'));var Papa=require(_0x7dc9('0xe'));var Redis=require('ioredis');var authService=require(_0x7dc9('0xf'));var qs=require(_0x7dc9('0x10'));var as=require(_0x7dc9('0x11'));var hardwareService=require(_0x7dc9('0x12'));var logger=require(_0x7dc9('0x13'))(_0x7dc9('0x14'));var utils=require(_0x7dc9('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x599ef1,_0x94c75a){_0x94c75a=_0x94c75a||0xcc;return function(_0x14e5db){if(_0x14e5db){return _0x599ef1['sendStatus'](_0x94c75a);}return _0x599ef1[_0x7dc9('0x16')](_0x94c75a)[_0x7dc9('0x17')]();};}function respondWithResult(_0xaadf2,_0xf37bc7){_0xf37bc7=_0xf37bc7||0xc8;return function(_0x31d43d){if(_0x31d43d){return _0xaadf2[_0x7dc9('0x16')](_0xf37bc7)['json'](_0x31d43d);}};}function respondWithFilteredResult(_0x3a54f2,_0x278191){return function(_0x1b0aa1){if(_0x1b0aa1){var _0x442819=typeof _0x278191[_0x7dc9('0x18')]===_0x7dc9('0x19')&&typeof _0x278191[_0x7dc9('0x1a')]===_0x7dc9('0x19');var _0x4778d5=_0x1b0aa1['count'];var _0x22577e=_0x442819?0x0:_0x278191['offset'];var _0x1f5906=_0x442819?_0x1b0aa1[_0x7dc9('0x1b')]:_0x278191['offset']+_0x278191[_0x7dc9('0x1a')];var _0x3b738a;if(_0x1f5906>=_0x4778d5){_0x1f5906=_0x4778d5;_0x3b738a=0xc8;}else{_0x3b738a=0xce;}_0x3a54f2[_0x7dc9('0x16')](_0x3b738a);return _0x3a54f2[_0x7dc9('0x1c')](_0x7dc9('0x1d'),_0x22577e+'-'+_0x1f5906+'/'+_0x4778d5)[_0x7dc9('0x1e')](_0x1b0aa1);}return null;};}function patchUpdates(_0x2dad65){return function(_0x2895f5){try{jsonpatch[_0x7dc9('0x1f')](_0x2895f5,_0x2dad65,!![]);}catch(_0x2b38d6){return BPromise['reject'](_0x2b38d6);}return _0x2895f5['save']();};}function saveUpdates(_0x12954f,_0x5981e2){return function(_0x596e0f){if(_0x596e0f){return _0x596e0f[_0x7dc9('0x20')](_0x12954f)[_0x7dc9('0x21')](function(_0x5e9525){return _0x5e9525;});}return null;};}function removeEntity(_0xffc080,_0x43d31f){return function(_0x41110a){if(_0x41110a){return _0x41110a['destroy']()[_0x7dc9('0x21')](function(){var _0x1e3a8d=_0x41110a[_0x7dc9('0x22')]({'plain':!![]});var _0x55a482='Metrics';return db['UserProfileResource'][_0x7dc9('0x23')]({'where':{'type':_0x55a482,'resourceId':_0x1e3a8d['id']}})[_0x7dc9('0x21')](function(){return _0x41110a;});})['then'](function(){_0xffc080['status'](0xcc)[_0x7dc9('0x17')]();});}};}function handleEntityNotFound(_0x5afb7d,_0x2d22eb){return function(_0x1c690b){if(!_0x1c690b){_0x5afb7d[_0x7dc9('0x24')](0x194);}return _0x1c690b;};}function handleError(_0x3e4102,_0xa2aaa9){_0xa2aaa9=_0xa2aaa9||0x1f4;return function(_0x450124){logger[_0x7dc9('0x25')](_0x450124[_0x7dc9('0x26')]);if(_0x450124[_0x7dc9('0x27')]){delete _0x450124[_0x7dc9('0x27')];}_0x3e4102[_0x7dc9('0x16')](_0xa2aaa9)[_0x7dc9('0x28')](_0x450124);};}exports['index']=function(_0x4e929c,_0x513dd6){var _0x49a4a5={},_0x4a68f0={},_0x553a03={'count':0x0,'rows':[]};var _0x58c4e8=_['map'](db[_0x7dc9('0x29')][_0x7dc9('0x2a')],function(_0x29dcef){return{'name':_0x29dcef[_0x7dc9('0x2b')],'type':_0x29dcef[_0x7dc9('0x2c')][_0x7dc9('0x2d')]};});_0x4a68f0['model']=_['map'](_0x58c4e8,'name');_0x4a68f0[_0x7dc9('0x2e')]=_['keys'](_0x4e929c[_0x7dc9('0x2e')]);_0x4a68f0[_0x7dc9('0x2f')]=_[_0x7dc9('0x30')](_0x4a68f0[_0x7dc9('0x31')],_0x4a68f0[_0x7dc9('0x2e')]);_0x49a4a5[_0x7dc9('0x32')]=_[_0x7dc9('0x30')](_0x4a68f0[_0x7dc9('0x31')],qs['fields'](_0x4e929c[_0x7dc9('0x2e')]['fields']));_0x49a4a5[_0x7dc9('0x32')]=_0x49a4a5[_0x7dc9('0x32')][_0x7dc9('0x33')]?_0x49a4a5[_0x7dc9('0x32')]:_0x4a68f0['model'];if(!_0x4e929c[_0x7dc9('0x2e')]['hasOwnProperty'](_0x7dc9('0x34'))){_0x49a4a5['limit']=qs['limit'](_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x1a')]);_0x49a4a5[_0x7dc9('0x18')]=qs[_0x7dc9('0x18')](_0x4e929c['query'][_0x7dc9('0x18')]);}_0x49a4a5[_0x7dc9('0x35')]=qs[_0x7dc9('0x36')](_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x36')]);_0x49a4a5[_0x7dc9('0x37')]=qs[_0x7dc9('0x2f')](_[_0x7dc9('0x38')](_0x4e929c[_0x7dc9('0x2e')],_0x4a68f0[_0x7dc9('0x2f')]),_0x58c4e8);if(_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x39')]){_0x49a4a5['where']=_[_0x7dc9('0x3a')](_0x49a4a5[_0x7dc9('0x37')],{'$or':_[_0x7dc9('0x3b')](_0x58c4e8,function(_0xfd2612){if(_0xfd2612['type']!==_0x7dc9('0x3c')){var _0x89db0e={};_0x89db0e[_0xfd2612[_0x7dc9('0x27')]]={'$like':'%'+_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x39')]+'%'};return _0x89db0e;}})});}_0x49a4a5=_[_0x7dc9('0x3a')]({},_0x49a4a5,_0x4e929c['options']);var _0x553230={'where':_0x49a4a5[_0x7dc9('0x37')]};return db[_0x7dc9('0x29')]['count'](_0x553230)[_0x7dc9('0x21')](function(_0x4a37ec){_0x553a03[_0x7dc9('0x1b')]=_0x4a37ec;if(_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x3d')]){_0x49a4a5['include']=[{'all':!![]}];}return db[_0x7dc9('0x29')][_0x7dc9('0x3e')](_0x49a4a5);})[_0x7dc9('0x21')](function(_0x95513c){_0x553a03[_0x7dc9('0x3f')]=_0x95513c;return _0x553a03;})[_0x7dc9('0x21')](respondWithFilteredResult(_0x513dd6,_0x49a4a5))[_0x7dc9('0x40')](handleError(_0x513dd6,null));};exports['show']=function(_0x187aa6,_0x4f29b2){var _0x52d883={'raw':!![],'where':{'id':_0x187aa6[_0x7dc9('0x41')]['id']}},_0xcced6c={};_0xcced6c[_0x7dc9('0x31')]=_[_0x7dc9('0x42')](db[_0x7dc9('0x29')][_0x7dc9('0x2a')]);_0xcced6c[_0x7dc9('0x2e')]=_[_0x7dc9('0x42')](_0x187aa6[_0x7dc9('0x2e')]);_0xcced6c['filters']=_[_0x7dc9('0x30')](_0xcced6c[_0x7dc9('0x31')],_0xcced6c[_0x7dc9('0x2e')]);_0x52d883[_0x7dc9('0x32')]=_[_0x7dc9('0x30')](_0xcced6c[_0x7dc9('0x31')],qs['fields'](_0x187aa6[_0x7dc9('0x2e')][_0x7dc9('0x43')]));_0x52d883['attributes']=_0x52d883[_0x7dc9('0x32')][_0x7dc9('0x33')]?_0x52d883[_0x7dc9('0x32')]:_0xcced6c['model'];if(_0x187aa6[_0x7dc9('0x2e')]['includeAll']){_0x52d883['include']=[{'all':!![]}];}_0x52d883=_[_0x7dc9('0x3a')]({},_0x52d883,_0x187aa6[_0x7dc9('0x44')]);return db[_0x7dc9('0x29')]['find'](_0x52d883)['then'](handleEntityNotFound(_0x4f29b2,null))[_0x7dc9('0x21')](respondWithResult(_0x4f29b2,null))['catch'](handleError(_0x4f29b2,null));};exports[_0x7dc9('0x45')]=function(_0x4ab558,_0x5e2d59){return db[_0x7dc9('0x29')][_0x7dc9('0x45')](_0x4ab558[_0x7dc9('0x46')],{})[_0x7dc9('0x21')](function(_0x414bf4){var _0x113087=_0x4ab558[_0x7dc9('0x47')][_0x7dc9('0x22')]({'plain':!![]});if(!_0x113087)throw new Error(_0x7dc9('0x48'));if(_0x113087[_0x7dc9('0x49')]===_0x7dc9('0x47')){var _0x13580b=_0x414bf4[_0x7dc9('0x22')]({'plain':!![]});var _0x59be9b=_0x7dc9('0x4a');return db['UserProfileSection']['find']({'where':{'name':_0x59be9b,'userProfileId':_0x113087[_0x7dc9('0x4b')]},'raw':!![]})[_0x7dc9('0x21')](function(_0x40e382){if(_0x40e382&&_0x40e382[_0x7dc9('0x4c')]===0x0){return db[_0x7dc9('0x4d')]['create']({'name':_0x13580b[_0x7dc9('0x27')],'resourceId':_0x13580b['id'],'type':_0x40e382[_0x7dc9('0x27')],'sectionId':_0x40e382['id']},{})[_0x7dc9('0x21')](function(){return _0x414bf4;});}else{return _0x414bf4;}})['catch'](function(_0x341909){logger[_0x7dc9('0x25')](_0x7dc9('0x4e'),_0x341909);throw _0x341909;});}return _0x414bf4;})[_0x7dc9('0x21')](respondWithResult(_0x5e2d59,0xc9))[_0x7dc9('0x40')](handleError(_0x5e2d59,null));};exports[_0x7dc9('0x20')]=function(_0x593132,_0x366b8b){if(_0x593132[_0x7dc9('0x46')]['id']){delete _0x593132[_0x7dc9('0x46')]['id'];}return db[_0x7dc9('0x29')][_0x7dc9('0x4f')]({'where':{'id':_0x593132[_0x7dc9('0x41')]['id']}})[_0x7dc9('0x21')](handleEntityNotFound(_0x366b8b,null))[_0x7dc9('0x21')](saveUpdates(_0x593132[_0x7dc9('0x46')],null))[_0x7dc9('0x21')](respondWithResult(_0x366b8b,null))[_0x7dc9('0x40')](handleError(_0x366b8b,null));};exports[_0x7dc9('0x23')]=function(_0x4fec6e,_0x1767b6){return db[_0x7dc9('0x29')][_0x7dc9('0x4f')]({'where':{'id':_0x4fec6e[_0x7dc9('0x41')]['id']}})[_0x7dc9('0x21')](handleEntityNotFound(_0x1767b6,null))['then'](removeEntity(_0x1767b6,null))[_0x7dc9('0x40')](handleError(_0x1767b6,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index c4fe35f..5a7e938 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 _0xfdbd=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./analyticMetric.attributes'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0xfdbd,0xf0));var _0xdfdb=function(_0x65ff6c,_0x4c2da3){_0x65ff6c=_0x65ff6c-0x0;var _0x238215=_0xfdbd[_0x65ff6c];return _0x238215;};'use strict';var _=require(_0xdfdb('0x0'));var util=require(_0xdfdb('0x1'));var logger=require(_0xdfdb('0x2'))(_0xdfdb('0x3'));var moment=require(_0xdfdb('0x4'));var BPromise=require(_0xdfdb('0x5'));var rp=require(_0xdfdb('0x6'));var fs=require('fs');var path=require(_0xdfdb('0x7'));var rimraf=require(_0xdfdb('0x8'));var config=require('../../config/environment');var attributes=require(_0xdfdb('0x9'));module['exports']=function(_0x453ef6,_0x41bd5e){return _0x453ef6['define']('AnalyticMetric',attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9865=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','lodash','util'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x9865,0x1ba));var _0x5986=function(_0x2c2ab3,_0x593de1){_0x2c2ab3=_0x2c2ab3-0x0;var _0x1803f7=_0x9865[_0x2c2ab3];return _0x1803f7;};'use strict';var _=require(_0x5986('0x0'));var util=require(_0x5986('0x1'));var logger=require(_0x5986('0x2'))(_0x5986('0x3'));var moment=require(_0x5986('0x4'));var BPromise=require(_0x5986('0x5'));var rp=require(_0x5986('0x6'));var fs=require('fs');var path=require(_0x5986('0x7'));var rimraf=require(_0x5986('0x8'));var config=require(_0x5986('0x9'));var attributes=require('./analyticMetric.attributes');module[_0x5986('0xa')]=function(_0x35e6f8,_0x3ac862){return _0x35e6f8[_0x5986('0xb')]('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 1fdc7b8..78216a5 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 _0xa06e=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x3578e0,_0x527708){var _0x9ba392=function(_0xc6b899){while(--_0xc6b899){_0x3578e0['push'](_0x3578e0['shift']());}};_0x9ba392(++_0x527708);}(_0xa06e,0xc2));var _0xea06=function(_0x13ef4f,_0x268dae){_0x13ef4f=_0x13ef4f-0x0;var _0x568fa4=_0xa06e[_0x13ef4f];return _0x568fa4;};'use strict';var _=require(_0xea06('0x0'));var util=require(_0xea06('0x1'));var moment=require(_0xea06('0x2'));var BPromise=require(_0xea06('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xea06('0x4'));var db=require(_0xea06('0x5'))['db'];var utils=require(_0xea06('0x6'));var logger=require(_0xea06('0x7'))(_0xea06('0x8'));var config=require('../../config/environment');var jayson=require(_0xea06('0x9'));var client=jayson[_0xea06('0xa')][_0xea06('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x272f72,_0x359741,_0x265c62){return new BPromise(function(_0x5ac911,_0x5ac6ca){return client['request'](_0x272f72,_0x265c62)['then'](function(_0x24f1ce){logger[_0xea06('0xc')](_0xea06('0xd'),_0x359741,_0xea06('0xe'));logger[_0xea06('0xf')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x359741,_0xea06('0xe'),JSON[_0xea06('0x10')](_0x24f1ce));if(_0x24f1ce[_0xea06('0x11')]){if(_0x24f1ce[_0xea06('0x11')][_0xea06('0x12')]===0x1f4){logger[_0xea06('0x11')](_0xea06('0xd'),_0x359741,_0x24f1ce['error']['message']);return _0x5ac6ca(_0x24f1ce[_0xea06('0x11')][_0xea06('0x13')]);}logger[_0xea06('0x11')](_0xea06('0xd'),_0x359741,_0x24f1ce['error']['message']);return _0x5ac911(_0x24f1ce[_0xea06('0x11')][_0xea06('0x13')]);}else{logger['info'](_0xea06('0xd'),_0x359741,_0xea06('0xe'));_0x5ac911(_0x24f1ce[_0xea06('0x14')][_0xea06('0x13')]);}})[_0xea06('0x15')](function(_0x465920){logger[_0xea06('0x11')](_0xea06('0xd'),_0x359741,_0x465920);_0x5ac6ca(_0x465920);});});} \ No newline at end of file +var _0x5552=['stringify','error','code','message','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','request','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x58c961,_0x15690a){var _0x1993bf=function(_0x5494e6){while(--_0x5494e6){_0x58c961['push'](_0x58c961['shift']());}};_0x1993bf(++_0x15690a);}(_0x5552,0x8a));var _0x2555=function(_0x352026,_0x14f939){_0x352026=_0x352026-0x0;var _0x1a3573=_0x5552[_0x352026];return _0x1a3573;};'use strict';var _=require(_0x2555('0x0'));var util=require(_0x2555('0x1'));var moment=require(_0x2555('0x2'));var BPromise=require(_0x2555('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2555('0x4'))['db'];var utils=require(_0x2555('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x2555('0x6'));var jayson=require(_0x2555('0x7'));var client=jayson['client'][_0x2555('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x32ad2c,_0x404070,_0x5c17e1){return new BPromise(function(_0x35c2f2,_0x23e68a){return client[_0x2555('0x9')](_0x32ad2c,_0x5c17e1)['then'](function(_0x440932){logger[_0x2555('0xa')](_0x2555('0xb'),_0x404070,_0x2555('0xc'));logger[_0x2555('0xd')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x404070,_0x2555('0xc'),JSON[_0x2555('0xe')](_0x440932));if(_0x440932[_0x2555('0xf')]){if(_0x440932['error'][_0x2555('0x10')]===0x1f4){logger['error'](_0x2555('0xb'),_0x404070,_0x440932[_0x2555('0xf')]['message']);return _0x23e68a(_0x440932[_0x2555('0xf')][_0x2555('0x11')]);}logger['error'](_0x2555('0xb'),_0x404070,_0x440932[_0x2555('0xf')][_0x2555('0x11')]);return _0x35c2f2(_0x440932['error'][_0x2555('0x11')]);}else{logger[_0x2555('0xa')](_0x2555('0xb'),_0x404070,_0x2555('0xc'));_0x35c2f2(_0x440932['result']['message']);}})[_0x2555('0x12')](function(_0x4c09e3){logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x404070,_0x4c09e3);_0x23e68a(_0x4c09e3);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index adbe4f2..232af2e 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 _0x4fd7=['fs-extra','../../components/auth/service','../../config/environment','get','index','isAuthenticated','show','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x17072e,_0x51728c){var _0x75baee=function(_0x14cb19){while(--_0x14cb19){_0x17072e['push'](_0x17072e['shift']());}};_0x75baee(++_0x51728c);}(_0x4fd7,0xe6));var _0x74fd=function(_0x528bf7,_0x2c17c5){_0x528bf7=_0x528bf7-0x0;var _0x45e043=_0x4fd7[_0x528bf7];return _0x45e043;};'use strict';var multer=require(_0x74fd('0x0'));var util=require(_0x74fd('0x1'));var path=require(_0x74fd('0x2'));var timeout=require(_0x74fd('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x74fd('0x4'));var auth=require(_0x74fd('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x74fd('0x6'));var controller=require('./analyticMetric.controller');router[_0x74fd('0x7')]('/',auth['isAuthenticated'](),controller[_0x74fd('0x8')]);router[_0x74fd('0x7')]('/:id',auth[_0x74fd('0x9')](),controller[_0x74fd('0xa')]);router['post']('/',auth[_0x74fd('0x9')](),controller[_0x74fd('0xb')]);router[_0x74fd('0xc')](_0x74fd('0xd'),auth[_0x74fd('0x9')](),controller[_0x74fd('0xe')]);router[_0x74fd('0xf')](_0x74fd('0xd'),auth[_0x74fd('0x9')](),controller[_0x74fd('0x10')]);module[_0x74fd('0x11')]=router; \ No newline at end of file +var _0xa4dc=['put','/:id','update','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticMetric.controller','get','isAuthenticated','show','post'];(function(_0x48ec16,_0x3536e0){var _0x272d42=function(_0x34051d){while(--_0x34051d){_0x48ec16['push'](_0x48ec16['shift']());}};_0x272d42(++_0x3536e0);}(_0xa4dc,0x16a));var _0xca4d=function(_0x8a969d,_0x339d9f){_0x8a969d=_0x8a969d-0x0;var _0x1d8dc7=_0xa4dc[_0x8a969d];return _0x1d8dc7;};'use strict';var multer=require(_0xca4d('0x0'));var util=require(_0xca4d('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xca4d('0x2'));var router=express[_0xca4d('0x3')]();var fs_extra=require(_0xca4d('0x4'));var auth=require(_0xca4d('0x5'));var interaction=require(_0xca4d('0x6'));var config=require('../../config/environment');var controller=require(_0xca4d('0x7'));router[_0xca4d('0x8')]('/',auth[_0xca4d('0x9')](),controller['index']);router[_0xca4d('0x8')]('/:id',auth[_0xca4d('0x9')](),controller[_0xca4d('0xa')]);router[_0xca4d('0xb')]('/',auth[_0xca4d('0x9')](),controller['create']);router[_0xca4d('0xc')](_0xca4d('0xd'),auth['isAuthenticated'](),controller[_0xca4d('0xe')]);router['delete'](_0xca4d('0xd'),auth[_0xca4d('0x9')](),controller[_0xca4d('0xf')]);module[_0xca4d('0x10')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index bca9a9b..793ea75 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 _0x76b4=['sequelize','TEXT'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x76b4,0x110));var _0x476b=function(_0x42be7f,_0x36f338){_0x42be7f=_0x42be7f-0x0;var _0x42c239=_0x76b4[_0x42be7f];return _0x42c239;};'use strict';var Sequelize=require(_0x476b('0x0'));module['exports']={'tree':{'type':Sequelize[_0x476b('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x7be8=['sequelize','TEXT'];(function(_0x1c89c3,_0x3c2348){var _0x62d305=function(_0x5441a2){while(--_0x5441a2){_0x1c89c3['push'](_0x1c89c3['shift']());}};_0x62d305(++_0x3c2348);}(_0x7be8,0x80));var _0x87be=function(_0x555014,_0xf5b10b){_0x555014=_0x555014-0x0;var _0x2dbe09=_0x7be8[_0x555014];return _0x2dbe09;};'use strict';var Sequelize=require(_0x87be('0x0'));module['exports']={'tree':{'type':Sequelize[_0x87be('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index 8f76c1a..97159ce 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 _0x024c=['crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','destroy','then','error','name','map','AnalyticTreeReport','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','show','params','keys','catch','create','body','find','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel'];(function(_0x3198fd,_0x3729d8){var _0x2dd0b=function(_0x94b525){while(--_0x94b525){_0x3198fd['push'](_0x3198fd['shift']());}};_0x2dd0b(++_0x3729d8);}(_0x024c,0x113));var _0xc024=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x024c[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xc024('0x0'));var rimraf=require(_0xc024('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc024('0x2'));var rp=require(_0xc024('0x3'));var moment=require(_0xc024('0x4'));var BPromise=require(_0xc024('0x5'));var Mustache=require(_0xc024('0x6'));var util=require(_0xc024('0x7'));var path=require(_0xc024('0x8'));var sox=require(_0xc024('0x9'));var csv=require(_0xc024('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc024('0xb'));var squel=require(_0xc024('0xc'));var crypto=require(_0xc024('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xc024('0xe'));var toCsv=require(_0xc024('0xa'));var querystring=require(_0xc024('0xf'));var Papa=require(_0xc024('0x10'));var Redis=require(_0xc024('0x11'));var authService=require(_0xc024('0x12'));var qs=require(_0xc024('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xc024('0x14'))(_0xc024('0x15'));var utils=require(_0xc024('0x16'));var config=require(_0xc024('0x17'));var licenseUtil=require(_0xc024('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x217646,_0x32e2af){_0x32e2af=_0x32e2af||0xcc;return function(_0x544a89){if(_0x544a89){return _0x217646[_0xc024('0x19')](_0x32e2af);}return _0x217646[_0xc024('0x1a')](_0x32e2af)[_0xc024('0x1b')]();};}function respondWithResult(_0x4a20a5,_0x2dcce1){_0x2dcce1=_0x2dcce1||0xc8;return function(_0x48086b){if(_0x48086b){return _0x4a20a5[_0xc024('0x1a')](_0x2dcce1)[_0xc024('0x1c')](_0x48086b);}};}function respondWithFilteredResult(_0x10fb89,_0x379dc3){return function(_0xf95cf){if(_0xf95cf){var _0x40ca26=typeof _0x379dc3[_0xc024('0x1d')]===_0xc024('0x1e')&&typeof _0x379dc3[_0xc024('0x1f')]===_0xc024('0x1e');var _0x50506a=_0xf95cf['count'];var _0x79a9c8=_0x40ca26?0x0:_0x379dc3[_0xc024('0x1d')];var _0x47b396=_0x40ca26?_0xf95cf[_0xc024('0x20')]:_0x379dc3[_0xc024('0x1d')]+_0x379dc3[_0xc024('0x1f')];var _0xf3d1ed;if(_0x47b396>=_0x50506a){_0x47b396=_0x50506a;_0xf3d1ed=0xc8;}else{_0xf3d1ed=0xce;}_0x10fb89['status'](_0xf3d1ed);return _0x10fb89[_0xc024('0x21')](_0xc024('0x22'),_0x79a9c8+'-'+_0x47b396+'/'+_0x50506a)[_0xc024('0x1c')](_0xf95cf);}return null;};}function patchUpdates(_0x1e9a78){return function(_0xa49142){try{jsonpatch['apply'](_0xa49142,_0x1e9a78,!![]);}catch(_0x546396){return BPromise['reject'](_0x546396);}return _0xa49142[_0xc024('0x23')]();};}function saveUpdates(_0x469237,_0x33b953){return function(_0x4d1a1c){if(_0x4d1a1c){return _0x4d1a1c[_0xc024('0x24')](_0x469237)['then'](function(_0x4c1931){return _0x4c1931;});}return null;};}function removeEntity(_0x3f6f81,_0x2c11e5){return function(_0x557b7f){if(_0x557b7f){return _0x557b7f[_0xc024('0x25')]()[_0xc024('0x26')](function(){_0x3f6f81[_0xc024('0x1a')](0xcc)[_0xc024('0x1b')]();});}};}function handleEntityNotFound(_0x513bc1,_0x18db9b){return function(_0x52f500){if(!_0x52f500){_0x513bc1[_0xc024('0x19')](0x194);}return _0x52f500;};}function handleError(_0x2c2888,_0x3df63d){_0x3df63d=_0x3df63d||0x1f4;return function(_0x118624){logger[_0xc024('0x27')](_0x118624['stack']);if(_0x118624[_0xc024('0x28')]){delete _0x118624[_0xc024('0x28')];}_0x2c2888[_0xc024('0x1a')](_0x3df63d)['send'](_0x118624);};}exports['index']=function(_0xfb4c64,_0x106748){var _0x4c5e38={},_0x31821c={},_0x519d4d={'count':0x0,'rows':[]};var _0x36c2a4=_[_0xc024('0x29')](db[_0xc024('0x2a')]['rawAttributes'],function(_0x19c866){return{'name':_0x19c866[_0xc024('0x2b')],'type':_0x19c866['type'][_0xc024('0x2c')]};});_0x31821c[_0xc024('0x2d')]=_[_0xc024('0x29')](_0x36c2a4,_0xc024('0x28'));_0x31821c['query']=_['keys'](_0xfb4c64[_0xc024('0x2e')]);_0x31821c[_0xc024('0x2f')]=_[_0xc024('0x30')](_0x31821c[_0xc024('0x2d')],_0x31821c[_0xc024('0x2e')]);_0x4c5e38[_0xc024('0x31')]=_['intersection'](_0x31821c[_0xc024('0x2d')],qs[_0xc024('0x32')](_0xfb4c64[_0xc024('0x2e')]['fields']));_0x4c5e38[_0xc024('0x31')]=_0x4c5e38[_0xc024('0x31')][_0xc024('0x33')]?_0x4c5e38['attributes']:_0x31821c[_0xc024('0x2d')];if(!_0xfb4c64[_0xc024('0x2e')][_0xc024('0x34')](_0xc024('0x35'))){_0x4c5e38['limit']=qs['limit'](_0xfb4c64['query'][_0xc024('0x1f')]);_0x4c5e38[_0xc024('0x1d')]=qs[_0xc024('0x1d')](_0xfb4c64[_0xc024('0x2e')]['offset']);}_0x4c5e38['order']=qs[_0xc024('0x36')](_0xfb4c64[_0xc024('0x2e')]['sort']);_0x4c5e38[_0xc024('0x37')]=qs[_0xc024('0x2f')](_[_0xc024('0x38')](_0xfb4c64['query'],_0x31821c[_0xc024('0x2f')]),_0x36c2a4);if(_0xfb4c64[_0xc024('0x2e')][_0xc024('0x39')]){_0x4c5e38[_0xc024('0x37')]=_['merge'](_0x4c5e38[_0xc024('0x37')],{'$or':_[_0xc024('0x29')](_0x36c2a4,function(_0x5d372e){if(_0x5d372e[_0xc024('0x3a')]!==_0xc024('0x3b')){var _0x55fb4c={};_0x55fb4c[_0x5d372e[_0xc024('0x28')]]={'$like':'%'+_0xfb4c64['query'][_0xc024('0x39')]+'%'};return _0x55fb4c;}})});}_0x4c5e38=_[_0xc024('0x3c')]({},_0x4c5e38,_0xfb4c64[_0xc024('0x3d')]);var _0x1ac9b5={'where':_0x4c5e38['where']};return db[_0xc024('0x2a')][_0xc024('0x20')](_0x1ac9b5)['then'](function(_0x192055){_0x519d4d['count']=_0x192055;if(_0xfb4c64[_0xc024('0x2e')][_0xc024('0x3e')]){_0x4c5e38[_0xc024('0x3f')]=[{'all':!![]}];}return db[_0xc024('0x2a')][_0xc024('0x40')](_0x4c5e38);})[_0xc024('0x26')](function(_0x1601e8){_0x519d4d['rows']=_0x1601e8;return _0x519d4d;})['then'](respondWithFilteredResult(_0x106748,_0x4c5e38))['catch'](handleError(_0x106748,null));};exports[_0xc024('0x41')]=function(_0x4335ac,_0x3cc1dd){var _0x57fbc8={'raw':!![],'where':{'id':_0x4335ac[_0xc024('0x42')]['id']}},_0x45842e={};_0x45842e[_0xc024('0x2d')]=_['keys'](db[_0xc024('0x2a')]['rawAttributes']);_0x45842e[_0xc024('0x2e')]=_[_0xc024('0x43')](_0x4335ac[_0xc024('0x2e')]);_0x45842e[_0xc024('0x2f')]=_[_0xc024('0x30')](_0x45842e[_0xc024('0x2d')],_0x45842e[_0xc024('0x2e')]);_0x57fbc8[_0xc024('0x31')]=_[_0xc024('0x30')](_0x45842e[_0xc024('0x2d')],qs['fields'](_0x4335ac['query'][_0xc024('0x32')]));_0x57fbc8[_0xc024('0x31')]=_0x57fbc8[_0xc024('0x31')][_0xc024('0x33')]?_0x57fbc8['attributes']:_0x45842e[_0xc024('0x2d')];if(_0x4335ac[_0xc024('0x2e')]['includeAll']){_0x57fbc8['include']=[{'all':!![]}];}_0x57fbc8=_[_0xc024('0x3c')]({},_0x57fbc8,_0x4335ac[_0xc024('0x3d')]);return db[_0xc024('0x2a')]['find'](_0x57fbc8)[_0xc024('0x26')](handleEntityNotFound(_0x3cc1dd,null))['then'](respondWithResult(_0x3cc1dd,null))[_0xc024('0x44')](handleError(_0x3cc1dd,null));};exports[_0xc024('0x45')]=function(_0x36d94e,_0x526343){return db[_0xc024('0x2a')][_0xc024('0x45')](_0x36d94e[_0xc024('0x46')],{})[_0xc024('0x26')](respondWithResult(_0x526343,0xc9))[_0xc024('0x44')](handleError(_0x526343,null));};exports[_0xc024('0x24')]=function(_0x112736,_0x32bf93){if(_0x112736[_0xc024('0x46')]['id']){delete _0x112736['body']['id'];}return db[_0xc024('0x2a')][_0xc024('0x47')]({'where':{'id':_0x112736[_0xc024('0x42')]['id']}})['then'](handleEntityNotFound(_0x32bf93,null))[_0xc024('0x26')](saveUpdates(_0x112736['body'],null))[_0xc024('0x26')](respondWithResult(_0x32bf93,null))[_0xc024('0x44')](handleError(_0x32bf93,null));};exports['destroy']=function(_0x3f2f7b,_0x463cb1){return db[_0xc024('0x2a')][_0xc024('0x47')]({'where':{'id':_0x3f2f7b[_0xc024('0x42')]['id']}})['then'](handleEntityNotFound(_0x463cb1,null))[_0xc024('0x26')](removeEntity(_0x463cb1,null))['catch'](handleError(_0x463cb1,null));}; \ No newline at end of file +var _0xc206=['fieldName','type','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','show','params','keys','find','catch','create','body','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','update','destroy','then','sendStatus','error','stack','name','send','index','map','AnalyticTreeReport','rawAttributes'];(function(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0xc206,0xae));var _0x6c20=function(_0x1b6c6d,_0x2983b0){_0x1b6c6d=_0x1b6c6d-0x0;var _0x290d9d=_0xc206[_0x1b6c6d];return _0x290d9d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6c20('0x0'));var zipdir=require(_0x6c20('0x1'));var jsonpatch=require(_0x6c20('0x2'));var rp=require(_0x6c20('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x6c20('0x4'));var util=require('util');var path=require(_0x6c20('0x5'));var sox=require(_0x6c20('0x6'));var csv=require('to-csv');var ejs=require(_0x6c20('0x7'));var fs=require('fs');var fs_extra=require(_0x6c20('0x8'));var _=require(_0x6c20('0x9'));var squel=require(_0x6c20('0xa'));var crypto=require(_0x6c20('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x6c20('0xc'));var toCsv=require(_0x6c20('0xd'));var querystring=require(_0x6c20('0xe'));var Papa=require(_0x6c20('0xf'));var Redis=require(_0x6c20('0x10'));var authService=require(_0x6c20('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x6c20('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6c20('0x13'));var utils=require(_0x6c20('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x6c20('0x15'));var db=require(_0x6c20('0x16'))['db'];function respondWithStatusCode(_0x92280e,_0x484350){_0x484350=_0x484350||0xcc;return function(_0x5411f5){if(_0x5411f5){return _0x92280e['sendStatus'](_0x484350);}return _0x92280e[_0x6c20('0x17')](_0x484350)[_0x6c20('0x18')]();};}function respondWithResult(_0x456861,_0x2719df){_0x2719df=_0x2719df||0xc8;return function(_0x22805d){if(_0x22805d){return _0x456861['status'](_0x2719df)[_0x6c20('0x19')](_0x22805d);}};}function respondWithFilteredResult(_0x3634cc,_0x2eb939){return function(_0x37d4f8){if(_0x37d4f8){var _0x2bc2d3=typeof _0x2eb939[_0x6c20('0x1a')]==='undefined'&&typeof _0x2eb939[_0x6c20('0x1b')]===_0x6c20('0x1c');var _0x80ddea=_0x37d4f8[_0x6c20('0x1d')];var _0x22b0b2=_0x2bc2d3?0x0:_0x2eb939[_0x6c20('0x1a')];var _0x46ec47=_0x2bc2d3?_0x37d4f8[_0x6c20('0x1d')]:_0x2eb939['offset']+_0x2eb939[_0x6c20('0x1b')];var _0x7c88dd;if(_0x46ec47>=_0x80ddea){_0x46ec47=_0x80ddea;_0x7c88dd=0xc8;}else{_0x7c88dd=0xce;}_0x3634cc[_0x6c20('0x17')](_0x7c88dd);return _0x3634cc[_0x6c20('0x1e')](_0x6c20('0x1f'),_0x22b0b2+'-'+_0x46ec47+'/'+_0x80ddea)[_0x6c20('0x19')](_0x37d4f8);}return null;};}function patchUpdates(_0x2e77c6){return function(_0x510b6c){try{jsonpatch[_0x6c20('0x20')](_0x510b6c,_0x2e77c6,!![]);}catch(_0x2270bc){return BPromise['reject'](_0x2270bc);}return _0x510b6c['save']();};}function saveUpdates(_0x223c8f,_0x36da6e){return function(_0x767b77){if(_0x767b77){return _0x767b77[_0x6c20('0x21')](_0x223c8f)['then'](function(_0x1d865c){return _0x1d865c;});}return null;};}function removeEntity(_0x1f215a,_0x1b526f){return function(_0x4e8108){if(_0x4e8108){return _0x4e8108[_0x6c20('0x22')]()[_0x6c20('0x23')](function(){_0x1f215a[_0x6c20('0x17')](0xcc)[_0x6c20('0x18')]();});}};}function handleEntityNotFound(_0x4591d5,_0x457071){return function(_0x1665c8){if(!_0x1665c8){_0x4591d5[_0x6c20('0x24')](0x194);}return _0x1665c8;};}function handleError(_0x5d4695,_0x505ac1){_0x505ac1=_0x505ac1||0x1f4;return function(_0x533be1){logger[_0x6c20('0x25')](_0x533be1[_0x6c20('0x26')]);if(_0x533be1[_0x6c20('0x27')]){delete _0x533be1[_0x6c20('0x27')];}_0x5d4695['status'](_0x505ac1)[_0x6c20('0x28')](_0x533be1);};}exports[_0x6c20('0x29')]=function(_0x367491,_0x5791f7){var _0x461d2d={},_0x4892b6={},_0x246d82={'count':0x0,'rows':[]};var _0x84de8a=_[_0x6c20('0x2a')](db[_0x6c20('0x2b')][_0x6c20('0x2c')],function(_0x3b9739){return{'name':_0x3b9739[_0x6c20('0x2d')],'type':_0x3b9739[_0x6c20('0x2e')]['key']};});_0x4892b6[_0x6c20('0x2f')]=_['map'](_0x84de8a,_0x6c20('0x27'));_0x4892b6[_0x6c20('0x30')]=_['keys'](_0x367491[_0x6c20('0x30')]);_0x4892b6[_0x6c20('0x31')]=_['intersection'](_0x4892b6[_0x6c20('0x2f')],_0x4892b6['query']);_0x461d2d[_0x6c20('0x32')]=_[_0x6c20('0x33')](_0x4892b6[_0x6c20('0x2f')],qs[_0x6c20('0x34')](_0x367491[_0x6c20('0x30')][_0x6c20('0x34')]));_0x461d2d[_0x6c20('0x32')]=_0x461d2d[_0x6c20('0x32')][_0x6c20('0x35')]?_0x461d2d[_0x6c20('0x32')]:_0x4892b6['model'];if(!_0x367491['query'][_0x6c20('0x36')]('nolimit')){_0x461d2d[_0x6c20('0x1b')]=qs[_0x6c20('0x1b')](_0x367491[_0x6c20('0x30')]['limit']);_0x461d2d[_0x6c20('0x1a')]=qs['offset'](_0x367491['query'][_0x6c20('0x1a')]);}_0x461d2d[_0x6c20('0x37')]=qs[_0x6c20('0x38')](_0x367491[_0x6c20('0x30')][_0x6c20('0x38')]);_0x461d2d[_0x6c20('0x39')]=qs['filters'](_[_0x6c20('0x3a')](_0x367491[_0x6c20('0x30')],_0x4892b6[_0x6c20('0x31')]),_0x84de8a);if(_0x367491['query']['filter']){_0x461d2d[_0x6c20('0x39')]=_[_0x6c20('0x3b')](_0x461d2d[_0x6c20('0x39')],{'$or':_['map'](_0x84de8a,function(_0x2e4f93){if(_0x2e4f93[_0x6c20('0x2e')]!==_0x6c20('0x3c')){var _0x5cc0ff={};_0x5cc0ff[_0x2e4f93[_0x6c20('0x27')]]={'$like':'%'+_0x367491['query'][_0x6c20('0x3d')]+'%'};return _0x5cc0ff;}})});}_0x461d2d=_[_0x6c20('0x3b')]({},_0x461d2d,_0x367491[_0x6c20('0x3e')]);var _0x1d0669={'where':_0x461d2d[_0x6c20('0x39')]};return db['AnalyticTreeReport'][_0x6c20('0x1d')](_0x1d0669)[_0x6c20('0x23')](function(_0x40e716){_0x246d82[_0x6c20('0x1d')]=_0x40e716;if(_0x367491[_0x6c20('0x30')][_0x6c20('0x3f')]){_0x461d2d[_0x6c20('0x40')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0x6c20('0x41')](_0x461d2d);})[_0x6c20('0x23')](function(_0x582922){_0x246d82['rows']=_0x582922;return _0x246d82;})[_0x6c20('0x23')](respondWithFilteredResult(_0x5791f7,_0x461d2d))['catch'](handleError(_0x5791f7,null));};exports[_0x6c20('0x42')]=function(_0x1d4e61,_0x51210f){var _0x5c2e51={'raw':!![],'where':{'id':_0x1d4e61[_0x6c20('0x43')]['id']}},_0x2c4d97={};_0x2c4d97[_0x6c20('0x2f')]=_[_0x6c20('0x44')](db[_0x6c20('0x2b')][_0x6c20('0x2c')]);_0x2c4d97[_0x6c20('0x30')]=_[_0x6c20('0x44')](_0x1d4e61[_0x6c20('0x30')]);_0x2c4d97['filters']=_[_0x6c20('0x33')](_0x2c4d97['model'],_0x2c4d97[_0x6c20('0x30')]);_0x5c2e51[_0x6c20('0x32')]=_['intersection'](_0x2c4d97[_0x6c20('0x2f')],qs[_0x6c20('0x34')](_0x1d4e61[_0x6c20('0x30')][_0x6c20('0x34')]));_0x5c2e51[_0x6c20('0x32')]=_0x5c2e51['attributes'][_0x6c20('0x35')]?_0x5c2e51[_0x6c20('0x32')]:_0x2c4d97[_0x6c20('0x2f')];if(_0x1d4e61[_0x6c20('0x30')][_0x6c20('0x3f')]){_0x5c2e51[_0x6c20('0x40')]=[{'all':!![]}];}_0x5c2e51=_['merge']({},_0x5c2e51,_0x1d4e61[_0x6c20('0x3e')]);return db[_0x6c20('0x2b')][_0x6c20('0x45')](_0x5c2e51)['then'](handleEntityNotFound(_0x51210f,null))['then'](respondWithResult(_0x51210f,null))[_0x6c20('0x46')](handleError(_0x51210f,null));};exports[_0x6c20('0x47')]=function(_0x20b386,_0xf11e7c){return db[_0x6c20('0x2b')][_0x6c20('0x47')](_0x20b386[_0x6c20('0x48')],{})[_0x6c20('0x23')](respondWithResult(_0xf11e7c,0xc9))[_0x6c20('0x46')](handleError(_0xf11e7c,null));};exports['update']=function(_0x181984,_0x44b973){if(_0x181984[_0x6c20('0x48')]['id']){delete _0x181984[_0x6c20('0x48')]['id'];}return db[_0x6c20('0x2b')][_0x6c20('0x45')]({'where':{'id':_0x181984[_0x6c20('0x43')]['id']}})[_0x6c20('0x23')](handleEntityNotFound(_0x44b973,null))['then'](saveUpdates(_0x181984[_0x6c20('0x48')],null))[_0x6c20('0x23')](respondWithResult(_0x44b973,null))['catch'](handleError(_0x44b973,null));};exports['destroy']=function(_0x8591c7,_0x22018b){return db[_0x6c20('0x2b')][_0x6c20('0x45')]({'where':{'id':_0x8591c7[_0x6c20('0x43')]['id']}})['then'](handleEntityNotFound(_0x22018b,null))[_0x6c20('0x23')](removeEntity(_0x22018b,null))['catch'](handleError(_0x22018b,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index 81dc0aa..124b728 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 _0x3af5=['define','AnalyticTreeReport','analytics_report_trees','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports'];(function(_0x5ec370,_0x5a2a10){var _0x1bb5bc=function(_0xcc785c){while(--_0xcc785c){_0x5ec370['push'](_0x5ec370['shift']());}};_0x1bb5bc(++_0x5a2a10);}(_0x3af5,0x129));var _0x53af=function(_0x5e9817,_0xa29439){_0x5e9817=_0x5e9817-0x0;var _0x25b437=_0x3af5[_0x5e9817];return _0x25b437;};'use strict';var _=require(_0x53af('0x0'));var util=require(_0x53af('0x1'));var logger=require('../../config/logger')(_0x53af('0x2'));var moment=require(_0x53af('0x3'));var BPromise=require(_0x53af('0x4'));var rp=require(_0x53af('0x5'));var fs=require('fs');var path=require(_0x53af('0x6'));var rimraf=require(_0x53af('0x7'));var config=require(_0x53af('0x8'));var attributes=require(_0x53af('0x9'));module[_0x53af('0xa')]=function(_0x1aed3e,_0x249328){return _0x1aed3e[_0x53af('0xb')](_0x53af('0xc'),attributes,{'tableName':_0x53af('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x191d=['AnalyticTreeReport','analytics_report_trees','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define'];(function(_0x4133fd,_0x1cd6ec){var _0x2365d6=function(_0x471734){while(--_0x471734){_0x4133fd['push'](_0x4133fd['shift']());}};_0x2365d6(++_0x1cd6ec);}(_0x191d,0x161));var _0xd191=function(_0x15a782,_0x25165f){_0x15a782=_0x15a782-0x0;var _0x376302=_0x191d[_0x15a782];return _0x376302;};'use strict';var _=require(_0xd191('0x0'));var util=require(_0xd191('0x1'));var logger=require(_0xd191('0x2'))(_0xd191('0x3'));var moment=require('moment');var BPromise=require(_0xd191('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd191('0x5'));var rimraf=require(_0xd191('0x6'));var config=require(_0xd191('0x7'));var attributes=require(_0xd191('0x8'));module[_0xd191('0x9')]=function(_0x4ffbd0,_0x56fe2c){return _0x4ffbd0[_0xd191('0xa')](_0xd191('0xb'),attributes,{'tableName':_0xd191('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js index 24f0f36..57d5373 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 _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x3ca879,_0x2e88ee){var _0x1f0bae=function(_0x114b52){while(--_0x114b52){_0x3ca879['push'](_0x3ca879['shift']());}};_0x1f0bae(++_0x2e88ee);}(_0x2ef3,0xba));var _0x32ef=function(_0x2eaa59,_0x298b57){_0x2eaa59=_0x2eaa59-0x0;var _0x393824=_0x2ef3[_0x2eaa59];return _0x393824;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});} \ No newline at end of file +var _0x7a54=['info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x7a54,0x106));var _0x47a5=function(_0x41c87b,_0x52f73e){_0x41c87b=_0x41c87b-0x0;var _0x22506f=_0x7a54[_0x41c87b];return _0x22506f;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index d072265..bb0b5e6 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 _0x844d=['index','/:id','create','put','update','destroy','exports','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticTreeReport.controller','get','isAuthenticated'];(function(_0x9cf391,_0x3b631f){var _0xb7069f=function(_0x36a123){while(--_0x36a123){_0x9cf391['push'](_0x9cf391['shift']());}};_0xb7069f(++_0x3b631f);}(_0x844d,0x117));var _0xd844=function(_0x26bcec,_0xe13f50){_0x26bcec=_0x26bcec-0x0;var _0x1049dc=_0x844d[_0x26bcec];return _0x1049dc;};'use strict';var multer=require('multer');var util=require(_0xd844('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xd844('0x1'));var router=express[_0xd844('0x2')]();var fs_extra=require(_0xd844('0x3'));var auth=require(_0xd844('0x4'));var interaction=require(_0xd844('0x5'));var config=require('../../config/environment');var controller=require(_0xd844('0x6'));router[_0xd844('0x7')]('/',auth[_0xd844('0x8')](),controller[_0xd844('0x9')]);router[_0xd844('0x7')](_0xd844('0xa'),auth[_0xd844('0x8')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xd844('0xb')]);router[_0xd844('0xc')](_0xd844('0xa'),auth[_0xd844('0x8')](),controller[_0xd844('0xd')]);router['delete']('/:id',auth[_0xd844('0x8')](),controller[_0xd844('0xe')]);module[_0xd844('0xf')]=router; \ No newline at end of file +var _0x60e4=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','isAuthenticated','index','get','/:id','post','create'];(function(_0xb2432a,_0x46ce8b){var _0x38ec39=function(_0x378ed7){while(--_0x378ed7){_0xb2432a['push'](_0xb2432a['shift']());}};_0x38ec39(++_0x46ce8b);}(_0x60e4,0xff));var _0x460e=function(_0x3e8096,_0xf1d389){_0x3e8096=_0x3e8096-0x0;var _0x3c2377=_0x60e4[_0x3e8096];return _0x3c2377;};'use strict';var multer=require(_0x460e('0x0'));var util=require(_0x460e('0x1'));var path=require(_0x460e('0x2'));var timeout=require(_0x460e('0x3'));var express=require(_0x460e('0x4'));var router=express[_0x460e('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x460e('0x6'));var config=require(_0x460e('0x7'));var controller=require(_0x460e('0x8'));router['get']('/',auth[_0x460e('0x9')](),controller[_0x460e('0xa')]);router[_0x460e('0xb')](_0x460e('0xc'),auth[_0x460e('0x9')](),controller['show']);router[_0x460e('0xd')]('/',auth[_0x460e('0x9')](),controller[_0x460e('0xe')]);router['put'](_0x460e('0xc'),auth[_0x460e('0x9')](),controller['update']);router[_0x460e('0xf')]('/:id',auth[_0x460e('0x9')](),controller[_0x460e('0x10')]);module[_0x460e('0x11')]=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index b65700b..4e1985b 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 _0x98a7=['exports','STRING','sequelize'];(function(_0x4e4933,_0x32cd71){var _0x2890a2=function(_0x384bff){while(--_0x384bff){_0x4e4933['push'](_0x4e4933['shift']());}};_0x2890a2(++_0x32cd71);}(_0x98a7,0x9e));var _0x798a=function(_0x50dce5,_0x5e3d03){_0x50dce5=_0x50dce5-0x0;var _0x3783ab=_0x98a7[_0x50dce5];return _0x3783ab;};'use strict';var Sequelize=require(_0x798a('0x0'));module[_0x798a('0x1')]={'name':{'type':Sequelize[_0x798a('0x2')]},'basename':{'type':Sequelize[_0x798a('0x2')]},'type':{'type':Sequelize[_0x798a('0x2')]}}; \ No newline at end of file +var _0x89c3=['sequelize','exports','STRING'];(function(_0x2dcc80,_0x96b865){var _0x1289d9=function(_0x155eab){while(--_0x155eab){_0x2dcc80['push'](_0x2dcc80['shift']());}};_0x1289d9(++_0x96b865);}(_0x89c3,0xff));var _0x389c=function(_0x4a8829,_0x36f847){_0x4a8829=_0x4a8829-0x0;var _0x22dc42=_0x89c3[_0x4a8829];return _0x22dc42;};'use strict';var Sequelize=require(_0x389c('0x0'));module[_0x389c('0x1')]={'name':{'type':Sequelize[_0x389c('0x2')]},'basename':{'type':Sequelize[_0x389c('0x2')]},'type':{'type':Sequelize[_0x389c('0x2')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index ab1084d..b8948a4 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 _0x3c23=['moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','Attachment','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','merge','find','clone','get','omit','updatedAt','body','createdAt','create','originalname','file','filename','mimetype','download','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','basename','eml-format','rimraf','fast-json-patch'];(function(_0x50b07f,_0x1dee5b){var _0x19b62c=function(_0x257bb3){while(--_0x257bb3){_0x50b07f['push'](_0x50b07f['shift']());}};_0x19b62c(++_0x1dee5b);}(_0x3c23,0xbf));var _0x33c2=function(_0x481471,_0x26356b){_0x481471=_0x481471-0x0;var _0x1e92e0=_0x3c23[_0x481471];return _0x1e92e0;};'use strict';var emlformat=require(_0x33c2('0x0'));var rimraf=require(_0x33c2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x33c2('0x2'));var rp=require('request-promise');var moment=require(_0x33c2('0x3'));var BPromise=require(_0x33c2('0x4'));var Mustache=require(_0x33c2('0x5'));var util=require(_0x33c2('0x6'));var path=require(_0x33c2('0x7'));var sox=require(_0x33c2('0x8'));var csv=require(_0x33c2('0x9'));var ejs=require(_0x33c2('0xa'));var fs=require('fs');var fs_extra=require(_0x33c2('0xb'));var _=require(_0x33c2('0xc'));var squel=require(_0x33c2('0xd'));var crypto=require(_0x33c2('0xe'));var jsforce=require(_0x33c2('0xf'));var deskjs=require(_0x33c2('0x10'));var toCsv=require('to-csv');var querystring=require(_0x33c2('0x11'));var Papa=require(_0x33c2('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x33c2('0x13'));var as=require(_0x33c2('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x33c2('0x15'))(_0x33c2('0x16'));var utils=require(_0x33c2('0x17'));var config=require(_0x33c2('0x18'));var licenseUtil=require(_0x33c2('0x19'));var db=require(_0x33c2('0x1a'))['db'];function respondWithStatusCode(_0x21fab8,_0x80dd71){_0x80dd71=_0x80dd71||0xcc;return function(_0x2e5bb3){if(_0x2e5bb3){return _0x21fab8[_0x33c2('0x1b')](_0x80dd71);}return _0x21fab8[_0x33c2('0x1c')](_0x80dd71)[_0x33c2('0x1d')]();};}function respondWithResult(_0x26f194,_0xd160ca){_0xd160ca=_0xd160ca||0xc8;return function(_0xefb92f){if(_0xefb92f){return _0x26f194['status'](_0xd160ca)[_0x33c2('0x1e')](_0xefb92f);}};}function respondWithFilteredResult(_0x275dbb,_0x42def0){return function(_0x142147){if(_0x142147){var _0x5412a1=typeof _0x42def0[_0x33c2('0x1f')]==='undefined'&&typeof _0x42def0[_0x33c2('0x20')]==='undefined';var _0x490692=_0x142147[_0x33c2('0x21')];var _0x38ca01=_0x5412a1?0x0:_0x42def0[_0x33c2('0x1f')];var _0x83c846=_0x5412a1?_0x142147[_0x33c2('0x21')]:_0x42def0['offset']+_0x42def0['limit'];var _0x17310d;if(_0x83c846>=_0x490692){_0x83c846=_0x490692;_0x17310d=0xc8;}else{_0x17310d=0xce;}_0x275dbb[_0x33c2('0x1c')](_0x17310d);return _0x275dbb[_0x33c2('0x22')](_0x33c2('0x23'),_0x38ca01+'-'+_0x83c846+'/'+_0x490692)[_0x33c2('0x1e')](_0x142147);}return null;};}function patchUpdates(_0x2c3039){return function(_0x1606c8){try{jsonpatch[_0x33c2('0x24')](_0x1606c8,_0x2c3039,!![]);}catch(_0x55ffd5){return BPromise[_0x33c2('0x25')](_0x55ffd5);}return _0x1606c8[_0x33c2('0x26')]();};}function saveUpdates(_0x5ce085,_0x1f40a0){return function(_0x5e2aaa){if(_0x5e2aaa){return _0x5e2aaa[_0x33c2('0x27')](_0x5ce085)['then'](function(_0x13854c){return _0x13854c;});}return null;};}function removeEntity(_0x375740,_0x4401ba){return function(_0x361515){if(_0x361515){return _0x361515[_0x33c2('0x28')]()[_0x33c2('0x29')](function(){_0x375740[_0x33c2('0x1c')](0xcc)[_0x33c2('0x1d')]();});}};}function handleEntityNotFound(_0x268da0,_0x98f241){return function(_0x498af1){if(!_0x498af1){_0x268da0[_0x33c2('0x1b')](0x194);}return _0x498af1;};}function handleError(_0x1a8116,_0xca1eef){_0xca1eef=_0xca1eef||0x1f4;return function(_0x290579){logger[_0x33c2('0x2a')](_0x290579[_0x33c2('0x2b')]);if(_0x290579['name']){delete _0x290579[_0x33c2('0x2c')];}_0x1a8116['status'](_0xca1eef)[_0x33c2('0x2d')](_0x290579);};}exports[_0x33c2('0x2e')]=function(_0x416fb4,_0x47c483){var _0x487a65={},_0x3f3d2d={},_0x2945b2={'count':0x0,'rows':[]};var _0x2ad2da=_['map'](db[_0x33c2('0x2f')]['rawAttributes'],function(_0x4315c2){return{'name':_0x4315c2[_0x33c2('0x30')],'type':_0x4315c2['type'][_0x33c2('0x31')]};});_0x3f3d2d[_0x33c2('0x32')]=_[_0x33c2('0x33')](_0x2ad2da,_0x33c2('0x2c'));_0x3f3d2d[_0x33c2('0x34')]=_[_0x33c2('0x35')](_0x416fb4['query']);_0x3f3d2d[_0x33c2('0x36')]=_[_0x33c2('0x37')](_0x3f3d2d[_0x33c2('0x32')],_0x3f3d2d[_0x33c2('0x34')]);_0x487a65[_0x33c2('0x38')]=_[_0x33c2('0x37')](_0x3f3d2d[_0x33c2('0x32')],qs[_0x33c2('0x39')](_0x416fb4[_0x33c2('0x34')][_0x33c2('0x39')]));_0x487a65[_0x33c2('0x38')]=_0x487a65[_0x33c2('0x38')][_0x33c2('0x3a')]?_0x487a65['attributes']:_0x3f3d2d[_0x33c2('0x32')];if(!_0x416fb4[_0x33c2('0x34')][_0x33c2('0x3b')](_0x33c2('0x3c'))){_0x487a65[_0x33c2('0x20')]=qs[_0x33c2('0x20')](_0x416fb4[_0x33c2('0x34')][_0x33c2('0x20')]);_0x487a65[_0x33c2('0x1f')]=qs[_0x33c2('0x1f')](_0x416fb4['query'][_0x33c2('0x1f')]);}_0x487a65[_0x33c2('0x3d')]=qs[_0x33c2('0x3e')](_0x416fb4[_0x33c2('0x34')][_0x33c2('0x3e')]);_0x487a65[_0x33c2('0x3f')]=qs[_0x33c2('0x36')](_[_0x33c2('0x40')](_0x416fb4[_0x33c2('0x34')],_0x3f3d2d[_0x33c2('0x36')]),_0x2ad2da);if(_0x416fb4[_0x33c2('0x34')][_0x33c2('0x41')]){_0x487a65[_0x33c2('0x3f')]=_['merge'](_0x487a65['where'],{'$or':_[_0x33c2('0x33')](_0x2ad2da,function(_0x4c27a0){if(_0x4c27a0[_0x33c2('0x42')]!=='VIRTUAL'){var _0x18ee6b={};_0x18ee6b[_0x4c27a0[_0x33c2('0x2c')]]={'$like':'%'+_0x416fb4[_0x33c2('0x34')]['filter']+'%'};return _0x18ee6b;}})});}_0x487a65=_['merge']({},_0x487a65,_0x416fb4[_0x33c2('0x43')]);var _0x3a07d3={'where':_0x487a65['where']};return db['Attachment'][_0x33c2('0x21')](_0x3a07d3)[_0x33c2('0x29')](function(_0x155684){_0x2945b2['count']=_0x155684;if(_0x416fb4[_0x33c2('0x34')][_0x33c2('0x44')]){_0x487a65[_0x33c2('0x45')]=[{'all':!![]}];}return db[_0x33c2('0x2f')][_0x33c2('0x46')](_0x487a65);})['then'](function(_0x369b95){_0x2945b2[_0x33c2('0x47')]=_0x369b95;return _0x2945b2;})[_0x33c2('0x29')](respondWithFilteredResult(_0x47c483,_0x487a65))[_0x33c2('0x48')](handleError(_0x47c483,null));};exports[_0x33c2('0x49')]=function(_0x44c7df,_0x127b8f){var _0x224d57={'raw':!![],'where':{'id':_0x44c7df[_0x33c2('0x4a')]['id']}},_0x4e1afe={};_0x4e1afe[_0x33c2('0x32')]=_[_0x33c2('0x35')](db[_0x33c2('0x2f')][_0x33c2('0x4b')]);_0x4e1afe[_0x33c2('0x34')]=_[_0x33c2('0x35')](_0x44c7df[_0x33c2('0x34')]);_0x4e1afe['filters']=_[_0x33c2('0x37')](_0x4e1afe[_0x33c2('0x32')],_0x4e1afe['query']);_0x224d57[_0x33c2('0x38')]=_[_0x33c2('0x37')](_0x4e1afe['model'],qs[_0x33c2('0x39')](_0x44c7df[_0x33c2('0x34')][_0x33c2('0x39')]));_0x224d57[_0x33c2('0x38')]=_0x224d57[_0x33c2('0x38')][_0x33c2('0x3a')]?_0x224d57['attributes']:_0x4e1afe[_0x33c2('0x32')];if(_0x44c7df[_0x33c2('0x34')][_0x33c2('0x44')]){_0x224d57[_0x33c2('0x45')]=[{'all':!![]}];}_0x224d57=_[_0x33c2('0x4c')]({},_0x224d57,_0x44c7df[_0x33c2('0x43')]);return db['Attachment'][_0x33c2('0x4d')](_0x224d57)[_0x33c2('0x29')](handleEntityNotFound(_0x127b8f,null))['then'](respondWithResult(_0x127b8f,null))['catch'](handleError(_0x127b8f,null));};exports[_0x33c2('0x4e')]=function(_0xcccc89,_0x19a142){var _0x52efb8={'where':{'id':_0xcccc89[_0x33c2('0x4a')]['id']}},_0x5c818f={};_0x5c818f[_0x33c2('0x32')]=_[_0x33c2('0x35')](db[_0x33c2('0x2f')][_0x33c2('0x4b')]);_0x52efb8[_0x33c2('0x38')]=_[_0x33c2('0x37')](_0x5c818f[_0x33c2('0x32')],qs['fields'](_0xcccc89['query'][_0x33c2('0x39')]));_0x52efb8['attributes']=_0x52efb8['attributes']['length']?_0x52efb8['attributes']:_0x5c818f[_0x33c2('0x32')];if(_0xcccc89[_0x33c2('0x34')]['includeAll']){_0x52efb8[_0x33c2('0x45')]=[{'all':!![]}];}_0x52efb8=_[_0x33c2('0x4c')]({},_0x52efb8,_0xcccc89['options']);return db['Attachment'][_0x33c2('0x4d')](_0x52efb8)[_0x33c2('0x29')](handleEntityNotFound(_0x19a142,null))[_0x33c2('0x29')](function(_0x2ffd0f){if(_0x2ffd0f){var _0x2eb403=_0x2ffd0f[_0x33c2('0x4f')]({'plain':!![]});_0x2eb403=qs[_0x33c2('0x50')](_0x2eb403,['id','createdAt',_0x33c2('0x51')]);_0xcccc89['body']=_[_0x33c2('0x50')](_0xcccc89[_0x33c2('0x52')],['id',_0x33c2('0x53'),_0x33c2('0x51')]);return db[_0x33c2('0x2f')]['create'](_[_0x33c2('0x4c')](_0x2eb403,_0xcccc89['body']),{'include':_0xcccc89['query'][_0x33c2('0x44')]?[{'all':!![]}]:undefined});}})[_0x33c2('0x29')](respondWithResult(_0x19a142,0xc9))[_0x33c2('0x48')](handleError(_0x19a142,null));};exports[_0x33c2('0x27')]=function(_0x39c574,_0x2e6d9b){if(_0x39c574[_0x33c2('0x52')]['id']){delete _0x39c574[_0x33c2('0x52')]['id'];}return db[_0x33c2('0x2f')][_0x33c2('0x4d')]({'where':{'id':_0x39c574[_0x33c2('0x4a')]['id']}})[_0x33c2('0x29')](handleEntityNotFound(_0x2e6d9b,null))[_0x33c2('0x29')](saveUpdates(_0x39c574[_0x33c2('0x52')],null))[_0x33c2('0x29')](respondWithResult(_0x2e6d9b,null))[_0x33c2('0x48')](handleError(_0x2e6d9b,null));};exports[_0x33c2('0x28')]=function(_0x135f29,_0xcf8d0b){return db['Attachment'][_0x33c2('0x4d')]({'where':{'id':_0x135f29[_0x33c2('0x4a')]['id']}})['then'](handleEntityNotFound(_0xcf8d0b,null))['then'](removeEntity(_0xcf8d0b,null))[_0x33c2('0x48')](handleError(_0xcf8d0b,null));};exports[_0x33c2('0x54')]=function(_0x78d33e,_0xf75f78,_0x3c9671){_0x78d33e[_0x33c2('0x52')][_0x33c2('0x2c')]=_0x78d33e['file'][_0x33c2('0x55')];_0x78d33e[_0x33c2('0x52')]['basename']=_0x78d33e[_0x33c2('0x56')][_0x33c2('0x57')];_0x78d33e[_0x33c2('0x52')][_0x33c2('0x42')]=_0x78d33e[_0x33c2('0x56')][_0x33c2('0x58')];return db[_0x33c2('0x2f')]['create'](_0x78d33e[_0x33c2('0x52')])[_0x33c2('0x29')](respondWithResult(_0xf75f78,0xc9))[_0x33c2('0x48')](handleError(_0xf75f78,null));};exports[_0x33c2('0x59')]=function(_0xc12c42,_0x38d2d7,_0x4109f4){return db[_0x33c2('0x2f')][_0x33c2('0x5a')]({'where':{'id':_0xc12c42[_0x33c2('0x4a')]['id']},'raw':!![]})[_0x33c2('0x29')](handleEntityNotFound(_0x38d2d7,null))[_0x33c2('0x29')](function(_0x1fd0ce){if(_0x1fd0ce){var _0x3c50cd=_0x1fd0ce[_0x33c2('0x5b')]!==null;var _0x373396=path[_0x33c2('0x5c')](config[_0x33c2('0x5d')],_0x33c2('0x5e'));if(_0x3c50cd){_0x373396=path[_0x33c2('0x5c')](_0x373396,_0x33c2('0x5f'));}var _0x435d69=path[_0x33c2('0x5c')](_0x373396,_0x1fd0ce[_0x33c2('0x60')]);return _0x38d2d7[_0x33c2('0x59')](_0x435d69);}})['catch'](handleError(_0x38d2d7,null));}; \ No newline at end of file +var _0xecd4=['keys','find','clone','include','get','omit','createdAt','body','create','originalname','basename','file','filename','mimetype','download','server/files/attachments/','join','offline-chat/','eml-format','rimraf','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','then','sendStatus','error','name','index','Attachment','rawAttributes','fieldName','type','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params'];(function(_0x5c3526,_0x2a1e90){var _0xec27a2=function(_0x5ac4e1){while(--_0x5ac4e1){_0x5c3526['push'](_0x5c3526['shift']());}};_0xec27a2(++_0x2a1e90);}(_0xecd4,0xc6));var _0x4ecd=function(_0x4cb0e3,_0x5e0445){_0x4cb0e3=_0x4cb0e3-0x0;var _0x46ea93=_0xecd4[_0x4cb0e3];return _0x46ea93;};'use strict';var emlformat=require(_0x4ecd('0x0'));var rimraf=require(_0x4ecd('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x4ecd('0x2'));var Mustache=require(_0x4ecd('0x3'));var util=require('util');var path=require(_0x4ecd('0x4'));var sox=require(_0x4ecd('0x5'));var csv=require(_0x4ecd('0x6'));var ejs=require(_0x4ecd('0x7'));var fs=require('fs');var fs_extra=require(_0x4ecd('0x8'));var _=require(_0x4ecd('0x9'));var squel=require('squel');var crypto=require(_0x4ecd('0xa'));var jsforce=require(_0x4ecd('0xb'));var deskjs=require(_0x4ecd('0xc'));var toCsv=require(_0x4ecd('0x6'));var querystring=require(_0x4ecd('0xd'));var Papa=require(_0x4ecd('0xe'));var Redis=require('ioredis');var authService=require(_0x4ecd('0xf'));var qs=require(_0x4ecd('0x10'));var as=require(_0x4ecd('0x11'));var hardwareService=require(_0x4ecd('0x12'));var logger=require(_0x4ecd('0x13'))(_0x4ecd('0x14'));var utils=require(_0x4ecd('0x15'));var config=require(_0x4ecd('0x16'));var licenseUtil=require(_0x4ecd('0x17'));var db=require(_0x4ecd('0x18'))['db'];function respondWithStatusCode(_0x1bdeca,_0x31f01e){_0x31f01e=_0x31f01e||0xcc;return function(_0x1b6600){if(_0x1b6600){return _0x1bdeca['sendStatus'](_0x31f01e);}return _0x1bdeca[_0x4ecd('0x19')](_0x31f01e)[_0x4ecd('0x1a')]();};}function respondWithResult(_0x1a7041,_0x3227b3){_0x3227b3=_0x3227b3||0xc8;return function(_0x211fbc){if(_0x211fbc){return _0x1a7041[_0x4ecd('0x19')](_0x3227b3)[_0x4ecd('0x1b')](_0x211fbc);}};}function respondWithFilteredResult(_0x32254e,_0x30c062){return function(_0x3dc5dc){if(_0x3dc5dc){var _0x4483a5=typeof _0x30c062[_0x4ecd('0x1c')]===_0x4ecd('0x1d')&&typeof _0x30c062[_0x4ecd('0x1e')]===_0x4ecd('0x1d');var _0x45ece2=_0x3dc5dc[_0x4ecd('0x1f')];var _0x1dbdf5=_0x4483a5?0x0:_0x30c062[_0x4ecd('0x1c')];var _0x43f2aa=_0x4483a5?_0x3dc5dc[_0x4ecd('0x1f')]:_0x30c062[_0x4ecd('0x1c')]+_0x30c062[_0x4ecd('0x1e')];var _0x390ded;if(_0x43f2aa>=_0x45ece2){_0x43f2aa=_0x45ece2;_0x390ded=0xc8;}else{_0x390ded=0xce;}_0x32254e[_0x4ecd('0x19')](_0x390ded);return _0x32254e[_0x4ecd('0x20')]('Content-Range',_0x1dbdf5+'-'+_0x43f2aa+'/'+_0x45ece2)['json'](_0x3dc5dc);}return null;};}function patchUpdates(_0x38fea7){return function(_0x263273){try{jsonpatch[_0x4ecd('0x21')](_0x263273,_0x38fea7,!![]);}catch(_0xb2c982){return BPromise[_0x4ecd('0x22')](_0xb2c982);}return _0x263273[_0x4ecd('0x23')]();};}function saveUpdates(_0x17a63f,_0x5494dc){return function(_0x1af18e){if(_0x1af18e){return _0x1af18e[_0x4ecd('0x24')](_0x17a63f)['then'](function(_0x3ffa29){return _0x3ffa29;});}return null;};}function removeEntity(_0x83bce5,_0x325f8a){return function(_0x38ab8b){if(_0x38ab8b){return _0x38ab8b[_0x4ecd('0x25')]()[_0x4ecd('0x26')](function(){_0x83bce5['status'](0xcc)[_0x4ecd('0x1a')]();});}};}function handleEntityNotFound(_0x239e22,_0x1719f0){return function(_0x113c7a){if(!_0x113c7a){_0x239e22[_0x4ecd('0x27')](0x194);}return _0x113c7a;};}function handleError(_0x3b11f1,_0x14d42f){_0x14d42f=_0x14d42f||0x1f4;return function(_0x1d0598){logger[_0x4ecd('0x28')](_0x1d0598['stack']);if(_0x1d0598[_0x4ecd('0x29')]){delete _0x1d0598[_0x4ecd('0x29')];}_0x3b11f1[_0x4ecd('0x19')](_0x14d42f)['send'](_0x1d0598);};}exports[_0x4ecd('0x2a')]=function(_0xe4402e,_0x13432b){var _0x4d18c4={},_0x2fd398={},_0x276794={'count':0x0,'rows':[]};var _0x2a025a=_['map'](db[_0x4ecd('0x2b')][_0x4ecd('0x2c')],function(_0x2ccebd){return{'name':_0x2ccebd[_0x4ecd('0x2d')],'type':_0x2ccebd[_0x4ecd('0x2e')][_0x4ecd('0x2f')]};});_0x2fd398[_0x4ecd('0x30')]=_[_0x4ecd('0x31')](_0x2a025a,_0x4ecd('0x29'));_0x2fd398[_0x4ecd('0x32')]=_['keys'](_0xe4402e[_0x4ecd('0x32')]);_0x2fd398['filters']=_[_0x4ecd('0x33')](_0x2fd398['model'],_0x2fd398[_0x4ecd('0x32')]);_0x4d18c4[_0x4ecd('0x34')]=_[_0x4ecd('0x33')](_0x2fd398['model'],qs[_0x4ecd('0x35')](_0xe4402e[_0x4ecd('0x32')][_0x4ecd('0x35')]));_0x4d18c4[_0x4ecd('0x34')]=_0x4d18c4[_0x4ecd('0x34')][_0x4ecd('0x36')]?_0x4d18c4[_0x4ecd('0x34')]:_0x2fd398[_0x4ecd('0x30')];if(!_0xe4402e[_0x4ecd('0x32')][_0x4ecd('0x37')](_0x4ecd('0x38'))){_0x4d18c4[_0x4ecd('0x1e')]=qs[_0x4ecd('0x1e')](_0xe4402e[_0x4ecd('0x32')][_0x4ecd('0x1e')]);_0x4d18c4[_0x4ecd('0x1c')]=qs['offset'](_0xe4402e[_0x4ecd('0x32')][_0x4ecd('0x1c')]);}_0x4d18c4[_0x4ecd('0x39')]=qs[_0x4ecd('0x3a')](_0xe4402e['query'][_0x4ecd('0x3a')]);_0x4d18c4['where']=qs[_0x4ecd('0x3b')](_[_0x4ecd('0x3c')](_0xe4402e[_0x4ecd('0x32')],_0x2fd398[_0x4ecd('0x3b')]),_0x2a025a);if(_0xe4402e[_0x4ecd('0x32')][_0x4ecd('0x3d')]){_0x4d18c4[_0x4ecd('0x3e')]=_[_0x4ecd('0x3f')](_0x4d18c4[_0x4ecd('0x3e')],{'$or':_[_0x4ecd('0x31')](_0x2a025a,function(_0x335602){if(_0x335602[_0x4ecd('0x2e')]!==_0x4ecd('0x40')){var _0x4fb543={};_0x4fb543[_0x335602[_0x4ecd('0x29')]]={'$like':'%'+_0xe4402e[_0x4ecd('0x32')][_0x4ecd('0x3d')]+'%'};return _0x4fb543;}})});}_0x4d18c4=_[_0x4ecd('0x3f')]({},_0x4d18c4,_0xe4402e[_0x4ecd('0x41')]);var _0x38f25d={'where':_0x4d18c4[_0x4ecd('0x3e')]};return db[_0x4ecd('0x2b')][_0x4ecd('0x1f')](_0x38f25d)[_0x4ecd('0x26')](function(_0x47103e){_0x276794[_0x4ecd('0x1f')]=_0x47103e;if(_0xe4402e[_0x4ecd('0x32')][_0x4ecd('0x42')]){_0x4d18c4['include']=[{'all':!![]}];}return db['Attachment'][_0x4ecd('0x43')](_0x4d18c4);})[_0x4ecd('0x26')](function(_0x3898c6){_0x276794[_0x4ecd('0x44')]=_0x3898c6;return _0x276794;})[_0x4ecd('0x26')](respondWithFilteredResult(_0x13432b,_0x4d18c4))[_0x4ecd('0x45')](handleError(_0x13432b,null));};exports[_0x4ecd('0x46')]=function(_0x166c94,_0x194118){var _0x805890={'raw':!![],'where':{'id':_0x166c94[_0x4ecd('0x47')]['id']}},_0x279c54={};_0x279c54['model']=_[_0x4ecd('0x48')](db[_0x4ecd('0x2b')][_0x4ecd('0x2c')]);_0x279c54[_0x4ecd('0x32')]=_['keys'](_0x166c94['query']);_0x279c54['filters']=_['intersection'](_0x279c54[_0x4ecd('0x30')],_0x279c54[_0x4ecd('0x32')]);_0x805890[_0x4ecd('0x34')]=_['intersection'](_0x279c54['model'],qs[_0x4ecd('0x35')](_0x166c94[_0x4ecd('0x32')]['fields']));_0x805890[_0x4ecd('0x34')]=_0x805890[_0x4ecd('0x34')][_0x4ecd('0x36')]?_0x805890[_0x4ecd('0x34')]:_0x279c54['model'];if(_0x166c94[_0x4ecd('0x32')][_0x4ecd('0x42')]){_0x805890['include']=[{'all':!![]}];}_0x805890=_['merge']({},_0x805890,_0x166c94[_0x4ecd('0x41')]);return db[_0x4ecd('0x2b')][_0x4ecd('0x49')](_0x805890)[_0x4ecd('0x26')](handleEntityNotFound(_0x194118,null))[_0x4ecd('0x26')](respondWithResult(_0x194118,null))['catch'](handleError(_0x194118,null));};exports[_0x4ecd('0x4a')]=function(_0x3210a8,_0x3aa2c9){var _0x4cc1a1={'where':{'id':_0x3210a8[_0x4ecd('0x47')]['id']}},_0x2ebbf2={};_0x2ebbf2['model']=_[_0x4ecd('0x48')](db[_0x4ecd('0x2b')][_0x4ecd('0x2c')]);_0x4cc1a1[_0x4ecd('0x34')]=_[_0x4ecd('0x33')](_0x2ebbf2[_0x4ecd('0x30')],qs[_0x4ecd('0x35')](_0x3210a8['query'][_0x4ecd('0x35')]));_0x4cc1a1[_0x4ecd('0x34')]=_0x4cc1a1[_0x4ecd('0x34')][_0x4ecd('0x36')]?_0x4cc1a1['attributes']:_0x2ebbf2[_0x4ecd('0x30')];if(_0x3210a8[_0x4ecd('0x32')][_0x4ecd('0x42')]){_0x4cc1a1[_0x4ecd('0x4b')]=[{'all':!![]}];}_0x4cc1a1=_[_0x4ecd('0x3f')]({},_0x4cc1a1,_0x3210a8[_0x4ecd('0x41')]);return db['Attachment'][_0x4ecd('0x49')](_0x4cc1a1)['then'](handleEntityNotFound(_0x3aa2c9,null))['then'](function(_0x2caded){if(_0x2caded){var _0x1280a5=_0x2caded[_0x4ecd('0x4c')]({'plain':!![]});_0x1280a5=qs[_0x4ecd('0x4d')](_0x1280a5,['id',_0x4ecd('0x4e'),'updatedAt']);_0x3210a8[_0x4ecd('0x4f')]=_['omit'](_0x3210a8['body'],['id',_0x4ecd('0x4e'),'updatedAt']);return db['Attachment'][_0x4ecd('0x50')](_[_0x4ecd('0x3f')](_0x1280a5,_0x3210a8['body']),{'include':_0x3210a8['query'][_0x4ecd('0x42')]?[{'all':!![]}]:undefined});}})[_0x4ecd('0x26')](respondWithResult(_0x3aa2c9,0xc9))[_0x4ecd('0x45')](handleError(_0x3aa2c9,null));};exports['update']=function(_0x289308,_0x1af643){if(_0x289308['body']['id']){delete _0x289308[_0x4ecd('0x4f')]['id'];}return db[_0x4ecd('0x2b')][_0x4ecd('0x49')]({'where':{'id':_0x289308[_0x4ecd('0x47')]['id']}})[_0x4ecd('0x26')](handleEntityNotFound(_0x1af643,null))[_0x4ecd('0x26')](saveUpdates(_0x289308[_0x4ecd('0x4f')],null))['then'](respondWithResult(_0x1af643,null))[_0x4ecd('0x45')](handleError(_0x1af643,null));};exports[_0x4ecd('0x25')]=function(_0x4fd831,_0x4ff466){return db[_0x4ecd('0x2b')][_0x4ecd('0x49')]({'where':{'id':_0x4fd831[_0x4ecd('0x47')]['id']}})[_0x4ecd('0x26')](handleEntityNotFound(_0x4ff466,null))['then'](removeEntity(_0x4ff466,null))[_0x4ecd('0x45')](handleError(_0x4ff466,null));};exports[_0x4ecd('0x50')]=function(_0x4a69f8,_0x2869cc,_0x12a0b3){_0x4a69f8[_0x4ecd('0x4f')]['name']=_0x4a69f8['file'][_0x4ecd('0x51')];_0x4a69f8[_0x4ecd('0x4f')][_0x4ecd('0x52')]=_0x4a69f8[_0x4ecd('0x53')][_0x4ecd('0x54')];_0x4a69f8[_0x4ecd('0x4f')][_0x4ecd('0x2e')]=_0x4a69f8['file'][_0x4ecd('0x55')];return db['Attachment'][_0x4ecd('0x50')](_0x4a69f8[_0x4ecd('0x4f')])[_0x4ecd('0x26')](respondWithResult(_0x2869cc,0xc9))[_0x4ecd('0x45')](handleError(_0x2869cc,null));};exports[_0x4ecd('0x56')]=function(_0x3ad04a,_0x3cb7da,_0x46d78d){return db['Attachment']['findOne']({'where':{'id':_0x3ad04a[_0x4ecd('0x47')]['id']},'raw':!![]})[_0x4ecd('0x26')](handleEntityNotFound(_0x3cb7da,null))[_0x4ecd('0x26')](function(_0x39b149){if(_0x39b149){var _0x39c1b2=_0x39b149['ChatOfflineMessageId']!==null;var _0x2be4be=path['join'](config['root'],_0x4ecd('0x57'));if(_0x39c1b2){_0x2be4be=path[_0x4ecd('0x58')](_0x2be4be,_0x4ecd('0x59'));}var _0x194b64=path[_0x4ecd('0x58')](_0x2be4be,_0x39b149[_0x4ecd('0x52')]);return _0x3cb7da['download'](_0x194b64);}})[_0x4ecd('0x45')](handleError(_0x3cb7da,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 5fa591a..72c908b 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 _0x2c7f=['Attachment','attachments','lodash','util','api','moment','path','rimraf','../../config/environment','./attachment.attributes','exports','define'];(function(_0x2e9a71,_0x206d47){var _0x59955f=function(_0x1d6554){while(--_0x1d6554){_0x2e9a71['push'](_0x2e9a71['shift']());}};_0x59955f(++_0x206d47);}(_0x2c7f,0x1be));var _0xf2c7=function(_0x1333e7,_0x560caa){_0x1333e7=_0x1333e7-0x0;var _0x175b01=_0x2c7f[_0x1333e7];return _0x175b01;};'use strict';var _=require(_0xf2c7('0x0'));var util=require(_0xf2c7('0x1'));var logger=require('../../config/logger')(_0xf2c7('0x2'));var moment=require(_0xf2c7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf2c7('0x4'));var rimraf=require(_0xf2c7('0x5'));var config=require(_0xf2c7('0x6'));var attributes=require(_0xf2c7('0x7'));module[_0xf2c7('0x8')]=function(_0x6adcc6,_0x3c4ac9){return _0x6adcc6[_0xf2c7('0x9')](_0xf2c7('0xa'),attributes,{'tableName':_0xf2c7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3e73=['Attachment','attachments','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./attachment.attributes','define'];(function(_0x43f9cb,_0x395f16){var _0x56e717=function(_0x49fb96){while(--_0x49fb96){_0x43f9cb['push'](_0x43f9cb['shift']());}};_0x56e717(++_0x395f16);}(_0x3e73,0x122));var _0x33e7=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x3e73[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0x33e7('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x33e7('0x1'));var moment=require(_0x33e7('0x2'));var BPromise=require(_0x33e7('0x3'));var rp=require(_0x33e7('0x4'));var fs=require('fs');var path=require(_0x33e7('0x5'));var rimraf=require(_0x33e7('0x6'));var config=require(_0x33e7('0x7'));var attributes=require(_0x33e7('0x8'));module['exports']=function(_0x52b033,_0x4d31d4){return _0x52b033[_0x33e7('0x9')](_0x33e7('0xa'),attributes,{'tableName':_0x33e7('0xb'),'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 5d5eb0c..c4744ac 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 _0x2504=['catch','CreateAttachment','create','options','raw','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','error','code','Attachment,\x20%s,\x20%s','message','result'];(function(_0x3ceab8,_0x30486f){var _0x3e9fe3=function(_0x33bd73){while(--_0x33bd73){_0x3ceab8['push'](_0x3ceab8['shift']());}};_0x3e9fe3(++_0x30486f);}(_0x2504,0xee));var _0x4250=function(_0x3e5f50,_0x4c4c90){_0x3e5f50=_0x3e5f50-0x0;var _0xe51297=_0x2504[_0x3e5f50];return _0xe51297;};'use strict';var _=require(_0x4250('0x0'));var util=require(_0x4250('0x1'));var moment=require(_0x4250('0x2'));var BPromise=require(_0x4250('0x3'));var rs=require(_0x4250('0x4'));var fs=require('fs');var Redis=require(_0x4250('0x5'));var db=require(_0x4250('0x6'))['db'];var utils=require(_0x4250('0x7'));var logger=require(_0x4250('0x8'))(_0x4250('0x9'));var config=require(_0x4250('0xa'));var jayson=require(_0x4250('0xb'));var client=jayson['client'][_0x4250('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4e177e,_0x5a5286,_0x370998){return new BPromise(function(_0x477312,_0x1a3b57){return client[_0x4250('0xd')](_0x4e177e,_0x370998)[_0x4250('0xe')](function(_0x51ea6f){logger[_0x4250('0xf')]('Attachment,\x20%s,\x20%s',_0x5a5286,_0x4250('0x10'));logger[_0x4250('0x11')]('Attachment,\x20%s,\x20%s,\x20%s',_0x5a5286,_0x4250('0x10'),JSON['stringify'](_0x51ea6f));if(_0x51ea6f['error']){if(_0x51ea6f[_0x4250('0x12')][_0x4250('0x13')]===0x1f4){logger[_0x4250('0x12')](_0x4250('0x14'),_0x5a5286,_0x51ea6f[_0x4250('0x12')]['message']);return _0x1a3b57(_0x51ea6f[_0x4250('0x12')][_0x4250('0x15')]);}logger[_0x4250('0x12')](_0x4250('0x14'),_0x5a5286,_0x51ea6f[_0x4250('0x12')][_0x4250('0x15')]);return _0x477312(_0x51ea6f['error'][_0x4250('0x15')]);}else{logger[_0x4250('0xf')](_0x4250('0x14'),_0x5a5286,_0x4250('0x10'));_0x477312(_0x51ea6f[_0x4250('0x16')][_0x4250('0x15')]);}})[_0x4250('0x17')](function(_0x4e70fc){logger[_0x4250('0x12')](_0x4250('0x14'),_0x5a5286,_0x4e70fc);_0x1a3b57(_0x4e70fc);});});}exports[_0x4250('0x18')]=function(_0x17a8a9){var _0x369010=this;return new Promise(function(_0x30e48c,_0x14d590){return db['Attachment'][_0x4250('0x19')](_0x17a8a9['body'],{'raw':_0x17a8a9['options']?_0x17a8a9[_0x4250('0x1a')][_0x4250('0x1b')]===undefined?!![]:![]:!![]})[_0x4250('0xe')](function(_0x42c331){logger[_0x4250('0xf')](_0x4250('0x18'),_0x17a8a9);logger[_0x4250('0x11')](_0x4250('0x18'),_0x17a8a9,JSON[_0x4250('0x1c')](_0x42c331));_0x30e48c(_0x42c331);})[_0x4250('0x17')](function(_0x728862){logger[_0x4250('0x12')]('CreateAttachment',_0x728862[_0x4250('0x15')],_0x17a8a9);_0x14d590(_0x369010[_0x4250('0x12')](0x1f4,_0x728862[_0x4250('0x15')]));});});}; \ No newline at end of file +var _0x07c3=['debug','Attachment,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','catch','CreateAttachment','body','options','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s'];(function(_0x275e07,_0x3a2a1a){var _0x5b8eae=function(_0x3c1a99){while(--_0x3c1a99){_0x275e07['push'](_0x275e07['shift']());}};_0x5b8eae(++_0x3a2a1a);}(_0x07c3,0x1bf));var _0x307c=function(_0x46aaaa,_0x3af897){_0x46aaaa=_0x46aaaa-0x0;var _0x26d04e=_0x07c3[_0x46aaaa];return _0x26d04e;};'use strict';var _=require(_0x307c('0x0'));var util=require(_0x307c('0x1'));var moment=require(_0x307c('0x2'));var BPromise=require(_0x307c('0x3'));var rs=require(_0x307c('0x4'));var fs=require('fs');var Redis=require(_0x307c('0x5'));var db=require(_0x307c('0x6'))['db'];var utils=require(_0x307c('0x7'));var logger=require('../../config/logger')(_0x307c('0x8'));var config=require(_0x307c('0x9'));var jayson=require(_0x307c('0xa'));var client=jayson[_0x307c('0xb')][_0x307c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x410ae8,_0x39af52,_0x3f5d08){return new BPromise(function(_0xfb14bf,_0x166467){return client[_0x307c('0xd')](_0x410ae8,_0x3f5d08)[_0x307c('0xe')](function(_0x1af97f){logger[_0x307c('0xf')](_0x307c('0x10'),_0x39af52,'request\x20sent');logger[_0x307c('0x11')](_0x307c('0x12'),_0x39af52,_0x307c('0x13'),JSON[_0x307c('0x14')](_0x1af97f));if(_0x1af97f['error']){if(_0x1af97f['error'][_0x307c('0x15')]===0x1f4){logger['error'](_0x307c('0x10'),_0x39af52,_0x1af97f[_0x307c('0x16')]['message']);return _0x166467(_0x1af97f[_0x307c('0x16')][_0x307c('0x17')]);}logger[_0x307c('0x16')](_0x307c('0x10'),_0x39af52,_0x1af97f[_0x307c('0x16')][_0x307c('0x17')]);return _0xfb14bf(_0x1af97f[_0x307c('0x16')][_0x307c('0x17')]);}else{logger[_0x307c('0xf')](_0x307c('0x10'),_0x39af52,_0x307c('0x13'));_0xfb14bf(_0x1af97f[_0x307c('0x18')]['message']);}})[_0x307c('0x19')](function(_0x364441){logger[_0x307c('0x16')](_0x307c('0x10'),_0x39af52,_0x364441);_0x166467(_0x364441);});});}exports[_0x307c('0x1a')]=function(_0x2e21a6){var _0x3e05e2=this;return new Promise(function(_0x13f03b,_0xbfe2b4){return db['Attachment']['create'](_0x2e21a6[_0x307c('0x1b')],{'raw':_0x2e21a6['options']?_0x2e21a6[_0x307c('0x1c')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x4bcc1a){logger[_0x307c('0xf')]('CreateAttachment',_0x2e21a6);logger[_0x307c('0x11')](_0x307c('0x1a'),_0x2e21a6,JSON['stringify'](_0x4bcc1a));_0x13f03b(_0x4bcc1a);})[_0x307c('0x19')](function(_0x45fe2){logger['error'](_0x307c('0x1a'),_0x45fe2[_0x307c('0x17')],_0x2e21a6);_0xbfe2b4(_0x3e05e2[_0x307c('0x16')](0x1f4,_0x45fe2[_0x307c('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index a2ba6fc..b4aac6d 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 _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(_0x5ede62,_0x312856){var _0x4a43ec=function(_0x2c5607){while(--_0x2c5607){_0x5ede62['push'](_0x5ede62['shift']());}};_0x4a43ec(++_0x312856);}(_0x2032,0xd9));var _0x2203=function(_0x51bc22,_0xa61444){_0x51bc22=_0x51bc22-0x0;var _0xee8e68=_0x2032[_0x51bc22];return _0xee8e68;};'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 +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(_0x5c9307,_0x5b97e4){var _0x373e29=function(_0xefebbd){while(--_0xefebbd){_0x5c9307['push'](_0x5c9307['shift']());}};_0x373e29(++_0x5b97e4);}(_0x0b0e,0x187));var _0xe0b0=function(_0xf31767,_0x381746){_0xf31767=_0xf31767-0x0;var _0x24bd0c=_0x0b0e[_0xf31767];return _0x24bd0c;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['download']);router[_0xe0b0('0xe')](_0xe0b0('0xf'),auth['isAuthenticated'](),controller[_0xe0b0('0x10')]);var upload=multer({'storage':multer[_0xe0b0('0x11')]({'destination':function(_0x574d96,_0x399320,_0x2cdad2){_0x2cdad2(null,path[_0xe0b0('0x12')](config['root'],_0xe0b0('0x13')));},'filename':function(_0x1c358a,_0x3cc19a,_0x45f914){_0x45f914(null,util[_0xe0b0('0x14')]('%s-%s',Date[_0xe0b0('0x15')](),_0x3cc19a[_0xe0b0('0x16')][_0xe0b0('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xe0b0('0xe')]('/',upload[_0xe0b0('0x18')]('file'),controller[_0xe0b0('0x19')]);router['put'](_0xe0b0('0x1a'),auth[_0xe0b0('0xa')](),controller['update']);router[_0xe0b0('0x1b')]('/:id',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x1c')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index 9e4713d..3b7485b 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 _0x41dc=['User','map','value','admin','user','agent','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','blockedAt','add','clearBlockUser','getLicense','lodash','passport','passport-google-oauth20','Strategy','moment','../../mysqldb','signToken','../../config/utils','login','authenticate','/login','profile','email','callback','google','use','callbackURL','Setting','findOne','allowedLoginAttempts','blockDuration','then'];(function(_0x9a36ec,_0x7afd44){var _0x397955=function(_0x16e50e){while(--_0x16e50e){_0x9a36ec['push'](_0x9a36ec['shift']());}};_0x397955(++_0x7afd44);}(_0x41dc,0x148));var _0xc41d=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0x41dc[_0x18ab2a];return _0x16dcee;};'use strict';var _=require(_0xc41d('0x0'));var passport=require(_0xc41d('0x1'));var GoogleStrategy=require(_0xc41d('0x2'))[_0xc41d('0x3')];var moment=require(_0xc41d('0x4'));var db=require(_0xc41d('0x5'))['db'];var config=require('../../config/environment');var signToken=require('../../components/auth/service')[_0xc41d('0x6')];var utils=require(_0xc41d('0x7'));exports[_0xc41d('0x8')]=passport[_0xc41d('0x9')]('google',{'failureRedirect':_0xc41d('0xa'),'scope':[_0xc41d('0xb'),_0xc41d('0xc')],'session':![]});exports[_0xc41d('0xd')]=passport['authenticate'](_0xc41d('0xe'),{'failureRedirect':_0xc41d('0xa'),'session':![]});passport[_0xc41d('0xf')](new GoogleStrategy({'clientID':config[_0xc41d('0xe')]?config[_0xc41d('0xe')]['clientID']:'id','clientSecret':config['google']?config['google']['clientSecret']:'secret','callbackURL':config[_0xc41d('0xe')]?config['google'][_0xc41d('0x10')]:''},function(_0x4f3b8d,_0x441066,_0x4ec897,_0x1309bc){var _0x6471c2,_0x45e1b1;return db[_0xc41d('0x11')][_0xc41d('0x12')]({'where':{'id':0x1},'attributes':[_0xc41d('0x13'),_0xc41d('0x14')],'raw':!![]})[_0xc41d('0x15')](function(_0x55e5f8){_0x6471c2=_0x55e5f8;return db[_0xc41d('0x16')]['find']({'where':{'email':_[_0xc41d('0x17')](_0x4ec897['emails'],_0xc41d('0x18')),'role':{'$or':[_0xc41d('0x19'),_0xc41d('0x1a'),_0xc41d('0x1b')]}}});})[_0xc41d('0x15')](function(_0x54e997){_0x45e1b1=_0x54e997;if(_0x45e1b1){if(_0x45e1b1[_0xc41d('0x1c')]){return _0x1309bc(_0xc41d('0x1d'));}else if(_0x6471c2[_0xc41d('0x14')]>0x0){if(_0x45e1b1[_0xc41d('0x1e')]){if(moment(_0x45e1b1[_0xc41d('0x1f')])[_0xc41d('0x20')](_0x6471c2[_0xc41d('0x14')],'minutes')>moment()){return _0x1309bc(_0xc41d('0x1d'));}else{return utils[_0xc41d('0x21')](_0x45e1b1,0x0,![],null)[_0xc41d('0x15')](function(){return utils[_0xc41d('0x22')](_0x45e1b1);})['then'](function(){return _0x1309bc(null,_0x45e1b1);});}}else{return utils['getLicense'](_0x45e1b1)[_0xc41d('0x15')](function(){return _0x1309bc(null,_0x45e1b1);});}}else{return utils[_0xc41d('0x22')](_0x45e1b1)['then'](function(){return _0x1309bc(null,_0x45e1b1);});}}return _0x1309bc('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');})['catch'](function(_0x3e6160){_0x1309bc(_0x3e6160);});})); \ No newline at end of file +var _0xbe53=['disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','blockedAt','minutes','clearBlockUser','then','getLicense','passport','passport-google-oauth20','moment','../../mysqldb','../../config/environment','signToken','../../config/utils','authenticate','google','/login','email','use','clientSecret','secret','callbackURL','Setting','allowedLoginAttempts','blockDuration','User','map','emails','user','agent'];(function(_0x550eaa,_0x4302ab){var _0x4db477=function(_0x59820c){while(--_0x59820c){_0x550eaa['push'](_0x550eaa['shift']());}};_0x4db477(++_0x4302ab);}(_0xbe53,0x1ba));var _0x3be5=function(_0x4b7a91,_0x3d7cd2){_0x4b7a91=_0x4b7a91-0x0;var _0x2fd4b9=_0xbe53[_0x4b7a91];return _0x2fd4b9;};'use strict';var _=require('lodash');var passport=require(_0x3be5('0x0'));var GoogleStrategy=require(_0x3be5('0x1'))['Strategy'];var moment=require(_0x3be5('0x2'));var db=require(_0x3be5('0x3'))['db'];var config=require(_0x3be5('0x4'));var signToken=require('../../components/auth/service')[_0x3be5('0x5')];var utils=require(_0x3be5('0x6'));exports['login']=passport[_0x3be5('0x7')](_0x3be5('0x8'),{'failureRedirect':_0x3be5('0x9'),'scope':['profile',_0x3be5('0xa')],'session':![]});exports['callback']=passport[_0x3be5('0x7')](_0x3be5('0x8'),{'failureRedirect':_0x3be5('0x9'),'session':![]});passport[_0x3be5('0xb')](new GoogleStrategy({'clientID':config[_0x3be5('0x8')]?config['google']['clientID']:'id','clientSecret':config[_0x3be5('0x8')]?config[_0x3be5('0x8')][_0x3be5('0xc')]:_0x3be5('0xd'),'callbackURL':config['google']?config[_0x3be5('0x8')][_0x3be5('0xe')]:''},function(_0x52e48f,_0xa358f9,_0x55b7e7,_0x328516){var _0xa25786,_0x35c0de;return db[_0x3be5('0xf')]['findOne']({'where':{'id':0x1},'attributes':[_0x3be5('0x10'),_0x3be5('0x11')],'raw':!![]})['then'](function(_0x1439ff){_0xa25786=_0x1439ff;return db[_0x3be5('0x12')]['find']({'where':{'email':_[_0x3be5('0x13')](_0x55b7e7[_0x3be5('0x14')],'value'),'role':{'$or':['admin',_0x3be5('0x15'),_0x3be5('0x16')]}}});})['then'](function(_0x49acca){_0x35c0de=_0x49acca;if(_0x35c0de){if(_0x35c0de[_0x3be5('0x17')]){return _0x328516(_0x3be5('0x18'));}else if(_0xa25786[_0x3be5('0x11')]>0x0){if(_0x35c0de[_0x3be5('0x19')]){if(moment(_0x35c0de[_0x3be5('0x1a')])['add'](_0xa25786[_0x3be5('0x11')],_0x3be5('0x1b'))>moment()){return _0x328516(_0x3be5('0x18'));}else{return utils[_0x3be5('0x1c')](_0x35c0de,0x0,![],null)[_0x3be5('0x1d')](function(){return utils[_0x3be5('0x1e')](_0x35c0de);})[_0x3be5('0x1d')](function(){return _0x328516(null,_0x35c0de);});}}else{return utils[_0x3be5('0x1e')](_0x35c0de)[_0x3be5('0x1d')](function(){return _0x328516(null,_0x35c0de);});}}else{return utils['getLicense'](_0x35c0de)[_0x3be5('0x1d')](function(){return _0x328516(null,_0x35c0de);});}}return _0x328516(_0x3be5('0x18'));})['catch'](function(_0x2a1dd8){_0x328516(_0x2a1dd8);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index 3e44dc5..6a16d7d 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 _0x41c1=['get','/callback','callback','isMiddleware','setTokenCookie','exports','passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service'];(function(_0x9dfc10,_0x19c2d5){var _0x4f938a=function(_0x12b1e5){while(--_0x12b1e5){_0x9dfc10['push'](_0x9dfc10['shift']());}};_0x4f938a(++_0x19c2d5);}(_0x41c1,0x103));var _0x141c=function(_0x2fa771,_0x511aec){_0x2fa771=_0x2fa771-0x0;var _0x8f89c2=_0x41c1[_0x2fa771];return _0x8f89c2;};'use strict';var express=require('express');var passport=require(_0x141c('0x0'));var router=express[_0x141c('0x1')]();var controller=require(_0x141c('0x2'));var userController=require(_0x141c('0x3'));var authService=require(_0x141c('0x4'));router[_0x141c('0x5')]('/',controller['login']);router['get'](_0x141c('0x6'),controller[_0x141c('0x7')],authService[_0x141c('0x8')],userController['login'],authService[_0x141c('0x9')]);module[_0x141c('0xa')]=router; \ No newline at end of file +var _0x24d3=['isMiddleware','setTokenCookie','exports','express','passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login','/callback'];(function(_0x4efe2c,_0x4e01b0){var _0x146de7=function(_0x43216f){while(--_0x43216f){_0x4efe2c['push'](_0x4efe2c['shift']());}};_0x146de7(++_0x4e01b0);}(_0x24d3,0xcf));var _0x324d=function(_0x428751,_0x1eb9c3){_0x428751=_0x428751-0x0;var _0x147aff=_0x24d3[_0x428751];return _0x147aff;};'use strict';var express=require(_0x324d('0x0'));var passport=require(_0x324d('0x1'));var router=express[_0x324d('0x2')]();var controller=require(_0x324d('0x3'));var userController=require(_0x324d('0x4'));var authService=require(_0x324d('0x5'));router[_0x324d('0x6')]('/',controller[_0x324d('0x7')]);router['get'](_0x324d('0x8'),controller['callback'],authService[_0x324d('0x9')],userController[_0x324d('0x7')],authService[_0x324d('0xa')]);module[_0x324d('0xb')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index 6c305b8..a7c26a5 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 _0xa15b=['catch','MailAccount','find','email','MailServerOut','service','Smtp','host','port','secure','auth','pass','\x22%s\x22\x20<%s>','request','error','format','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','send','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','json','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','/reset/','status','Reset\x20Email\x20sent!','User','params','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','validatePasswordHistory','Password\x20reset!','use','util','passport','passport-local','Strategy','jayson/promise','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','name','password','salt','disabled','blocked','blockedAt','loginAttempts','admin','then','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','add','minutes','clearBlockUser','getLicense'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0xa15b,0x1e6));var _0xba15=function(_0x1a97c7,_0x556227){_0x1a97c7=_0x1a97c7-0x0;var _0x3bfa53=_0xa15b[_0x1a97c7];return _0x3bfa53;};'use strict';var util=require(_0xba15('0x0'));var passport=require(_0xba15('0x1'));var LocalStrategy=require(_0xba15('0x2'))[_0xba15('0x3')];var jayson=require(_0xba15('0x4'));var _=require('lodash');var rs=require('randomstring');var moment=require(_0xba15('0x5'));var db=require(_0xba15('0x6'))['db'];var authService=require(_0xba15('0x7'));var utils=require(_0xba15('0x8'));var client=jayson[_0xba15('0x9')][_0xba15('0xa')]({'port':0x232b});function localAuthenticate(_0x1df67e,_0x9b1ed1,_0x313a88,_0x553c91){var _0x51d2b4,_0x46abb3;return db[_0xba15('0xb')][_0xba15('0xc')]({'where':{'id':0x1},'attributes':[_0xba15('0xd'),_0xba15('0xe')],'raw':!![]})['then'](function(_0x4a843e){_0x51d2b4=_0x4a843e;return _0x1df67e['findOne']({'attributes':['id',_0xba15('0xf'),_0xba15('0x10'),_0xba15('0x11'),'role',_0xba15('0x12'),_0xba15('0x13'),_0xba15('0x14'),_0xba15('0x15')],'where':{'name':_0x9b1ed1,'role':{'$or':[_0xba15('0x16'),'user','agent']}}});})[_0xba15('0x17')](function(_0x573c36){if(!_0x573c36||_0x573c36&&_0x573c36[_0xba15('0xf')]!==_0x9b1ed1){throw new Error(_0xba15('0x18'));}else{_0x46abb3=_0x573c36;return _0x46abb3;}})['then'](function(){_0x46abb3[_0xba15('0x19')](_0x313a88,function(_0x33aba3,_0x224c5b){var _0x231051=_0x46abb3[_0xba15('0x15')]+0x1;if(_0x33aba3){return _0x553c91(_0x33aba3);}else if(!_0x224c5b){if(_0x46abb3['disabled']){return _0x553c91(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x51d2b4[_0xba15('0xd')]>0x0){if(_0x46abb3[_0xba15('0x13')]){if(_0x51d2b4[_0xba15('0xe')]>0x0){if(moment(_0x46abb3[_0xba15('0x14')])[_0xba15('0x1a')](_0x51d2b4[_0xba15('0xe')],_0xba15('0x1b'))>moment()){return _0x553c91(null,![],{'message':_0xba15('0x18')});}else{return utils[_0xba15('0x1c')](_0x46abb3,_0x231051,![],null)[_0xba15('0x17')](function(){return _0x553c91(null,![],{'message':_0xba15('0x18')});});}}else{return _0x553c91(null,![],{'message':_0xba15('0x18')});}}else{if(_0x231051>=_0x51d2b4['allowedLoginAttempts']){return utils['clearBlockUser'](_0x46abb3,0x0,!![],moment())[_0xba15('0x17')](function(){return _0x553c91(null,![],{'message':_0xba15('0x18')});});}else{return utils[_0xba15('0x1c')](_0x46abb3,_0x231051,![],null)[_0xba15('0x17')](function(){return _0x553c91(null,![],{'message':_0xba15('0x18')});});}}}else{return _0x553c91(null,![],{'message':_0xba15('0x18')});}}else{if(_0x46abb3[_0xba15('0x12')]){return _0x553c91(null,![],{'message':_0xba15('0x18')});}else if(_0x51d2b4[_0xba15('0xd')]>0x0){if(_0x46abb3['blocked']){if(_0x51d2b4[_0xba15('0xe')]>0x0){if(moment(_0x46abb3[_0xba15('0x14')])['add'](_0x51d2b4[_0xba15('0xe')],_0xba15('0x1b'))>moment()){return _0x553c91(null,![],{'message':_0xba15('0x18')});}else{return utils['clearBlockUser'](_0x46abb3,0x0,![],null)[_0xba15('0x17')](function(){return utils[_0xba15('0x1d')](_0x46abb3);})[_0xba15('0x17')](function(){return _0x553c91(null,_0x46abb3);});}}else{return _0x553c91(null,![],{'message':_0xba15('0x18')});}}else{return utils[_0xba15('0x1c')](_0x46abb3,0x0,![],null)[_0xba15('0x17')](function(){return utils['getLicense'](_0x46abb3);})[_0xba15('0x17')](function(){return _0x553c91(null,_0x46abb3);})[_0xba15('0x1e')](function(_0x3aa75c){return _0x553c91(null,![],_0x3aa75c);});}}else{if(_0x46abb3[_0xba15('0x13')]){return _0x553c91(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['getLicense'](_0x46abb3)[_0xba15('0x17')](function(){return _0x553c91(null,_0x46abb3);});}}}});})['catch'](function(_0x38fe79){return _0x553c91(null,![],_0x38fe79);});}function sendServiceMail(_0x2b37d9){return db[_0xba15('0x1f')][_0xba15('0x20')]({'where':{'service':!![]},'attributes':['id',_0xba15('0xf'),_0xba15('0x21')],'include':[{'model':db[_0xba15('0x22')],'as':'Smtp'}]})[_0xba15('0x17')](function(_0x5137fe){if(!_0x5137fe){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x430c71={'tls':{'rejectUnauthorized':![]}};if(_0x5137fe['Smtp']['service']){_0x430c71[_0xba15('0x23')]=_0x5137fe[_0xba15('0x24')][_0xba15('0x23')];}else{_0x430c71[_0xba15('0x25')]=_0x5137fe['Smtp']['host'];_0x430c71['port']=_0x5137fe[_0xba15('0x24')][_0xba15('0x26')];_0x430c71[_0xba15('0x27')]=_0x5137fe['Smtp'][_0xba15('0x27')];}if(_0x5137fe['Smtp']['authentication']){_0x430c71[_0xba15('0x28')]={'user':_0x5137fe[_0xba15('0x24')]['user'],'pass':_0x5137fe[_0xba15('0x24')][_0xba15('0x29')]};}var _0x2bc433={'account':_0x430c71,'message':_['merge']({'from':util['format'](_0xba15('0x2a'),_0x5137fe['name'],_0x5137fe[_0xba15('0x21')]||_0x5137fe['Smtp']['user'])},_0x2b37d9)};return client[_0xba15('0x2b')]('SendMail',_0x2bc433);})[_0xba15('0x17')](function(_0x33911e){if(_0x33911e[_0xba15('0x2c')]){throw new Error(util[_0xba15('0x2d')](_0xba15('0x2e'),_0x33911e[_0xba15('0x2c')][_0xba15('0x2f')]||JSON[_0xba15('0x30')](_0x33911e[_0xba15('0x2c')])));}return!![];});}function handleError(_0x575a06,_0xa80376,_0x1e61c7){return _0x575a06['status'](_0xa80376||0x1f4)[_0xba15('0x31')]({'message':_0x1e61c7?_0x1e61c7[_0xba15('0x2f')]||_0x1e61c7:''});}exports['login']=function(_0x470614,_0x189d80,_0x2eba37){passport[_0xba15('0x19')](_0xba15('0x32'),function(_0x3259db,_0x589435,_0x3ae369){var _0x1ec556=_0x3259db||_0x3ae369;if(_0x1ec556){return handleError(_0x189d80,0x191,_0x1ec556);}if(!_0x589435){return handleError(_0x189d80,0x194,{'message':_0xba15('0x33')});}else{var _0x1023b7={'payload':{'id':_0x589435['id'],'role':_0x589435[_0xba15('0x34')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x1023b7)[_0xba15('0x17')](function(_0x123d9e){_0x189d80[_0xba15('0x35')]({'id':_0x589435['id'],'token':_0x123d9e,'statusCall':'','isAlreadyLogged':_0x589435[_0xba15('0x36')]});});}})(_0x470614,_0x189d80,_0x2eba37);};exports[_0xba15('0x37')]=function(_0x3ac4e2,_0x363504,_0x1fd6b8){if(!_0x3ac4e2[_0xba15('0x38')][_0xba15('0x21')]){return handleError(_0x363504,0x1f4,{'message':_0xba15('0x39')});}var _0x4f9fad=rs[_0xba15('0x3a')]();_0x3ac4e2[_0xba15('0x38')]['email']=_0x3ac4e2['body'][_0xba15('0x21')][_0xba15('0x3b')]()[_0xba15('0x3c')]();var _0x90261e;return db[_0xba15('0xb')][_0xba15('0xc')]({'where':{'id':0x1},'attributes':[_0xba15('0xd'),_0xba15('0xe')],'raw':!![]})[_0xba15('0x17')](function(_0x57ac86){_0x90261e=_0x57ac86;return db['User'][_0xba15('0x20')]({'where':{'email':_0x3ac4e2[_0xba15('0x38')][_0xba15('0x21')]}});})[_0xba15('0x17')](function(_0x35802c){if(!_0x35802c){throw new Error(_0xba15('0x3d'));}if(_0x35802c[_0xba15('0x12')]){throw new Error(_0xba15('0x3e'));}if(_0x35802c[_0xba15('0x13')]){if(moment(_0x35802c['blockedAt'])[_0xba15('0x1a')](_0x90261e[_0xba15('0xe')],_0xba15('0x1b'))>moment()){throw new Error(_0xba15('0x3f'));}else{_0x35802c['blocked']=![];_0x35802c['blockedAt']=null;}}_0x35802c[_0xba15('0x40')]=_0x4f9fad;_0x35802c[_0xba15('0x41')]=Date[_0xba15('0x42')]()+0x36ee80;return _0x35802c[_0xba15('0x43')]();})[_0xba15('0x17')](function(){return sendServiceMail({'to':_0x3ac4e2[_0xba15('0x38')]['email'],'subject':_0xba15('0x44'),'text':_0xba15('0x45')+_0xba15('0x46')+_0xba15('0x47')+_0x3ac4e2[_0xba15('0x48')][_0xba15('0x25')]+_0xba15('0x49')+_0x4f9fad+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0xba15('0x17')](function(){_0x363504[_0xba15('0x4a')](0xc8)[_0xba15('0x31')]({'message':_0xba15('0x4b')});})[_0xba15('0x1e')](function(_0x3065bb){return handleError(_0x363504,0x1f4,_0x3065bb);});};exports['reset']=function(_0x335c26,_0x5e31f2,_0x1d5b33){return db[_0xba15('0x4c')][_0xba15('0x20')]({'where':{'resetPasswordToken':_0x335c26[_0xba15('0x4d')]['token'],'resetPasswordExpires':{'$gt':Date[_0xba15('0x42')]()}}})['then'](function(_0x3f32cd){if(!_0x3f32cd){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db['Setting'][_0xba15('0xc')]({'attributes':['id',_0xba15('0x4e'),_0xba15('0x4f'),_0xba15('0x50')]})[_0xba15('0x17')](function(_0x314f80){if(_0x314f80[_0xba15('0x4e')])authService[_0xba15('0x51')](_0x335c26[_0xba15('0x38')][_0xba15('0x10')]);if(!_0x314f80[_0xba15('0x4f')]||!_0x3f32cd[_0xba15('0x52')])return _0x3f32cd;authService[_0xba15('0x53')](_0x335c26[_0xba15('0x38')][_0xba15('0x10')],_0x3f32cd[_0xba15('0x52')],_0x314f80['passwordHistoryLimit']);return _0x3f32cd;})[_0xba15('0x17')](function(){_0x3f32cd[_0xba15('0x10')]=_0x335c26[_0xba15('0x38')][_0xba15('0x10')];_0x3f32cd[_0xba15('0x40')]=null;_0x3f32cd[_0xba15('0x41')]=null;return _0x3f32cd['save']();});})[_0xba15('0x17')](function(){_0x5e31f2[_0xba15('0x4a')](0xc8)[_0xba15('0x31')]({'message':_0xba15('0x54')});})['catch'](function(_0x3502ef){return handleError(_0x5e31f2,0x1f4,_0x3502ef);});};passport[_0xba15('0x55')](new LocalStrategy({'usernameField':_0xba15('0xf'),'passwordField':_0xba15('0x10')},function(_0x589f07,_0x20d2e3,_0x4d94d2){return localAuthenticate(db[_0xba15('0x4c')],_0x589f07,_0x20d2e3,_0x4d94d2);})); \ No newline at end of file +var _0xb2e3=['then','name','password','salt','role','disabled','blockedAt','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','clearBlockUser','blocked','minutes','getLicense','catch','MailAccount','find','email','MailServerOut','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','Smtp','service','host','port','secure','authentication','auth','pass','\x22%s\x22\x20<%s>','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','send','authenticate','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','add','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','status','params','token','now','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','validatePasswordHistory','save','Password\x20reset!','use','util','passport','passport-local','Strategy','jayson/promise','lodash','randomstring','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts'];(function(_0x38fe24,_0x239dd9){var _0x245a09=function(_0x58862a){while(--_0x58862a){_0x38fe24['push'](_0x38fe24['shift']());}};_0x245a09(++_0x239dd9);}(_0xb2e3,0xf9));var _0x3b2e=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xb2e3[_0x3bf83f];return _0x22c4a9;};'use strict';var util=require(_0x3b2e('0x0'));var passport=require(_0x3b2e('0x1'));var LocalStrategy=require(_0x3b2e('0x2'))[_0x3b2e('0x3')];var jayson=require(_0x3b2e('0x4'));var _=require(_0x3b2e('0x5'));var rs=require(_0x3b2e('0x6'));var moment=require('moment');var db=require(_0x3b2e('0x7'))['db'];var authService=require(_0x3b2e('0x8'));var utils=require(_0x3b2e('0x9'));var client=jayson[_0x3b2e('0xa')][_0x3b2e('0xb')]({'port':0x232b});function localAuthenticate(_0x44a2f2,_0x52a011,_0x1b6c7b,_0x3f0b9b){var _0x1191c4,_0x3f8b69;return db[_0x3b2e('0xc')][_0x3b2e('0xd')]({'where':{'id':0x1},'attributes':[_0x3b2e('0xe'),'blockDuration'],'raw':!![]})[_0x3b2e('0xf')](function(_0x17d3f4){_0x1191c4=_0x17d3f4;return _0x44a2f2[_0x3b2e('0xd')]({'attributes':['id',_0x3b2e('0x10'),_0x3b2e('0x11'),_0x3b2e('0x12'),_0x3b2e('0x13'),_0x3b2e('0x14'),'blocked',_0x3b2e('0x15'),_0x3b2e('0x16')],'where':{'name':_0x52a011,'role':{'$or':[_0x3b2e('0x17'),_0x3b2e('0x18'),_0x3b2e('0x19')]}}});})[_0x3b2e('0xf')](function(_0x4e2ff0){if(!_0x4e2ff0||_0x4e2ff0&&_0x4e2ff0[_0x3b2e('0x10')]!==_0x52a011){throw new Error(_0x3b2e('0x1a'));}else{_0x3f8b69=_0x4e2ff0;return _0x3f8b69;}})[_0x3b2e('0xf')](function(){_0x3f8b69['authenticate'](_0x1b6c7b,function(_0x37591c,_0x467925){var _0x256658=_0x3f8b69['loginAttempts']+0x1;if(_0x37591c){return _0x3f0b9b(_0x37591c);}else if(!_0x467925){if(_0x3f8b69[_0x3b2e('0x14')]){return _0x3f0b9b(null,![],{'message':_0x3b2e('0x1a')});}else if(_0x1191c4[_0x3b2e('0xe')]>0x0){if(_0x3f8b69['blocked']){if(_0x1191c4[_0x3b2e('0x1b')]>0x0){if(moment(_0x3f8b69[_0x3b2e('0x15')])['add'](_0x1191c4['blockDuration'],'minutes')>moment()){return _0x3f0b9b(null,![],{'message':_0x3b2e('0x1a')});}else{return utils[_0x3b2e('0x1c')](_0x3f8b69,_0x256658,![],null)['then'](function(){return _0x3f0b9b(null,![],{'message':_0x3b2e('0x1a')});});}}else{return _0x3f0b9b(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x256658>=_0x1191c4[_0x3b2e('0xe')]){return utils[_0x3b2e('0x1c')](_0x3f8b69,0x0,!![],moment())[_0x3b2e('0xf')](function(){return _0x3f0b9b(null,![],{'message':_0x3b2e('0x1a')});});}else{return utils[_0x3b2e('0x1c')](_0x3f8b69,_0x256658,![],null)[_0x3b2e('0xf')](function(){return _0x3f0b9b(null,![],{'message':_0x3b2e('0x1a')});});}}}else{return _0x3f0b9b(null,![],{'message':_0x3b2e('0x1a')});}}else{if(_0x3f8b69['disabled']){return _0x3f0b9b(null,![],{'message':_0x3b2e('0x1a')});}else if(_0x1191c4['allowedLoginAttempts']>0x0){if(_0x3f8b69[_0x3b2e('0x1d')]){if(_0x1191c4[_0x3b2e('0x1b')]>0x0){if(moment(_0x3f8b69[_0x3b2e('0x15')])['add'](_0x1191c4[_0x3b2e('0x1b')],_0x3b2e('0x1e'))>moment()){return _0x3f0b9b(null,![],{'message':_0x3b2e('0x1a')});}else{return utils[_0x3b2e('0x1c')](_0x3f8b69,0x0,![],null)[_0x3b2e('0xf')](function(){return utils[_0x3b2e('0x1f')](_0x3f8b69);})[_0x3b2e('0xf')](function(){return _0x3f0b9b(null,_0x3f8b69);});}}else{return _0x3f0b9b(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0x3b2e('0x1c')](_0x3f8b69,0x0,![],null)['then'](function(){return utils[_0x3b2e('0x1f')](_0x3f8b69);})['then'](function(){return _0x3f0b9b(null,_0x3f8b69);})[_0x3b2e('0x20')](function(_0xbbe540){return _0x3f0b9b(null,![],_0xbbe540);});}}else{if(_0x3f8b69[_0x3b2e('0x1d')]){return _0x3f0b9b(null,![],{'message':_0x3b2e('0x1a')});}else{return utils[_0x3b2e('0x1f')](_0x3f8b69)[_0x3b2e('0xf')](function(){return _0x3f0b9b(null,_0x3f8b69);});}}}});})[_0x3b2e('0x20')](function(_0xf119a4){return _0x3f0b9b(null,![],_0xf119a4);});}function sendServiceMail(_0x19d381){return db[_0x3b2e('0x21')][_0x3b2e('0x22')]({'where':{'service':!![]},'attributes':['id',_0x3b2e('0x10'),_0x3b2e('0x23')],'include':[{'model':db[_0x3b2e('0x24')],'as':'Smtp'}]})[_0x3b2e('0xf')](function(_0xf2a6f7){if(!_0xf2a6f7){throw new Error(_0x3b2e('0x25'));}var _0x434f52={'tls':{'rejectUnauthorized':![]}};if(_0xf2a6f7[_0x3b2e('0x26')][_0x3b2e('0x27')]){_0x434f52[_0x3b2e('0x27')]=_0xf2a6f7[_0x3b2e('0x26')][_0x3b2e('0x27')];}else{_0x434f52[_0x3b2e('0x28')]=_0xf2a6f7[_0x3b2e('0x26')][_0x3b2e('0x28')];_0x434f52[_0x3b2e('0x29')]=_0xf2a6f7['Smtp'][_0x3b2e('0x29')];_0x434f52[_0x3b2e('0x2a')]=_0xf2a6f7[_0x3b2e('0x26')][_0x3b2e('0x2a')];}if(_0xf2a6f7[_0x3b2e('0x26')][_0x3b2e('0x2b')]){_0x434f52[_0x3b2e('0x2c')]={'user':_0xf2a6f7[_0x3b2e('0x26')][_0x3b2e('0x18')],'pass':_0xf2a6f7[_0x3b2e('0x26')][_0x3b2e('0x2d')]};}var _0x2f107e={'account':_0x434f52,'message':_['merge']({'from':util['format'](_0x3b2e('0x2e'),_0xf2a6f7[_0x3b2e('0x10')],_0xf2a6f7[_0x3b2e('0x23')]||_0xf2a6f7[_0x3b2e('0x26')]['user'])},_0x19d381)};return client['request']('SendMail',_0x2f107e);})[_0x3b2e('0xf')](function(_0x1f0610){if(_0x1f0610[_0x3b2e('0x2f')]){throw new Error(util['format'](_0x3b2e('0x30'),_0x1f0610[_0x3b2e('0x2f')][_0x3b2e('0x31')]||JSON['stringify'](_0x1f0610[_0x3b2e('0x2f')])));}return!![];});}function handleError(_0xad25b2,_0x1d0a49,_0x811993){return _0xad25b2['status'](_0x1d0a49||0x1f4)[_0x3b2e('0x32')]({'message':_0x811993?_0x811993[_0x3b2e('0x31')]||_0x811993:''});}exports['login']=function(_0x57bf73,_0x487db1,_0x383bd1){passport[_0x3b2e('0x33')]('local',function(_0x3a281f,_0x58f05d,_0x421290){var _0x48ca40=_0x3a281f||_0x421290;if(_0x48ca40){return handleError(_0x487db1,0x191,_0x48ca40);}if(!_0x58f05d){return handleError(_0x487db1,0x194,{'message':_0x3b2e('0x34')});}else{var _0x899523={'payload':{'id':_0x58f05d['id'],'role':_0x58f05d[_0x3b2e('0x13')]},'options':{'expiresIn':0x15180}};return authService[_0x3b2e('0x35')](_0x899523)[_0x3b2e('0xf')](function(_0x18808a){_0x487db1['json']({'id':_0x58f05d['id'],'token':_0x18808a,'statusCall':'','isAlreadyLogged':_0x58f05d[_0x3b2e('0x36')]});});}})(_0x57bf73,_0x487db1,_0x383bd1);};exports[_0x3b2e('0x37')]=function(_0x194609,_0x451f68,_0x2633ae){if(!_0x194609[_0x3b2e('0x38')][_0x3b2e('0x23')]){return handleError(_0x451f68,0x1f4,{'message':_0x3b2e('0x39')});}var _0x29498c=rs[_0x3b2e('0x3a')]();_0x194609['body'][_0x3b2e('0x23')]=_0x194609['body'][_0x3b2e('0x23')][_0x3b2e('0x3b')]()[_0x3b2e('0x3c')]();var _0x35549c;return db[_0x3b2e('0xc')][_0x3b2e('0xd')]({'where':{'id':0x1},'attributes':[_0x3b2e('0xe'),'blockDuration'],'raw':!![]})[_0x3b2e('0xf')](function(_0x249b3f){_0x35549c=_0x249b3f;return db[_0x3b2e('0x3d')][_0x3b2e('0x22')]({'where':{'email':_0x194609[_0x3b2e('0x38')][_0x3b2e('0x23')]}});})['then'](function(_0x3b3ee6){if(!_0x3b3ee6){throw new Error(_0x3b2e('0x3e'));}if(_0x3b3ee6[_0x3b2e('0x14')]){throw new Error(_0x3b2e('0x3f'));}if(_0x3b3ee6[_0x3b2e('0x1d')]){if(moment(_0x3b3ee6['blockedAt'])[_0x3b2e('0x40')](_0x35549c[_0x3b2e('0x1b')],'minutes')>moment()){throw new Error(_0x3b2e('0x41'));}else{_0x3b3ee6[_0x3b2e('0x1d')]=![];_0x3b3ee6[_0x3b2e('0x15')]=null;}}_0x3b3ee6[_0x3b2e('0x42')]=_0x29498c;_0x3b3ee6[_0x3b2e('0x43')]=Date['now']()+0x36ee80;return _0x3b3ee6['save']();})[_0x3b2e('0xf')](function(){return sendServiceMail({'to':_0x194609[_0x3b2e('0x38')]['email'],'subject':_0x3b2e('0x44'),'text':_0x3b2e('0x45')+_0x3b2e('0x46')+_0x3b2e('0x47')+_0x194609[_0x3b2e('0x48')][_0x3b2e('0x28')]+_0x3b2e('0x49')+_0x29498c+'\x0a\x0a'+_0x3b2e('0x4a')});})['then'](function(){_0x451f68[_0x3b2e('0x4b')](0xc8)[_0x3b2e('0x32')]({'message':'Reset\x20Email\x20sent!'});})['catch'](function(_0x12cc5f){return handleError(_0x451f68,0x1f4,_0x12cc5f);});};exports['reset']=function(_0x42a43b,_0x1f05c1,_0x235c5a){return db[_0x3b2e('0x3d')][_0x3b2e('0x22')]({'where':{'resetPasswordToken':_0x42a43b[_0x3b2e('0x4c')][_0x3b2e('0x4d')],'resetPasswordExpires':{'$gt':Date[_0x3b2e('0x4e')]()}}})[_0x3b2e('0xf')](function(_0x542b33){if(!_0x542b33){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db[_0x3b2e('0xc')][_0x3b2e('0xd')]({'attributes':['id',_0x3b2e('0x4f'),_0x3b2e('0x50'),_0x3b2e('0x51')]})[_0x3b2e('0xf')](function(_0x1f05b2){if(_0x1f05b2[_0x3b2e('0x4f')])authService[_0x3b2e('0x52')](_0x42a43b[_0x3b2e('0x38')]['password']);if(!_0x1f05b2['enforcePasswordHistory']||!_0x542b33[_0x3b2e('0x53')])return _0x542b33;authService[_0x3b2e('0x54')](_0x42a43b[_0x3b2e('0x38')][_0x3b2e('0x11')],_0x542b33[_0x3b2e('0x53')],_0x1f05b2['passwordHistoryLimit']);return _0x542b33;})[_0x3b2e('0xf')](function(){_0x542b33[_0x3b2e('0x11')]=_0x42a43b[_0x3b2e('0x38')][_0x3b2e('0x11')];_0x542b33[_0x3b2e('0x42')]=null;_0x542b33[_0x3b2e('0x43')]=null;return _0x542b33[_0x3b2e('0x55')]();});})[_0x3b2e('0xf')](function(){_0x1f05c1[_0x3b2e('0x4b')](0xc8)[_0x3b2e('0x32')]({'message':_0x3b2e('0x56')});})[_0x3b2e('0x20')](function(_0x3ece9f){return handleError(_0x1f05c1,0x1f4,_0x3ece9f);});};passport[_0x3b2e('0x57')](new LocalStrategy({'usernameField':_0x3b2e('0x10'),'passwordField':_0x3b2e('0x11')},function(_0x5033f2,_0x34869d,_0x5cfb10){return localAuthenticate(db['User'],_0x5033f2,_0x34869d,_0x5cfb10);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 03c0d04..a855aa6 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 _0x7abc=['express','Router','post','login','/forgot','forgot','reset'];(function(_0x25b1f1,_0x314226){var _0x2be1ed=function(_0x4f4480){while(--_0x4f4480){_0x25b1f1['push'](_0x25b1f1['shift']());}};_0x2be1ed(++_0x314226);}(_0x7abc,0xa1));var _0xc7ab=function(_0x1b1211,_0x25a3ec){_0x1b1211=_0x1b1211-0x0;var _0x458eea=_0x7abc[_0x1b1211];return _0x458eea;};'use strict';var express=require(_0xc7ab('0x0'));var router=express[_0xc7ab('0x1')]();var controller=require('./authLocal.controller');router[_0xc7ab('0x2')]('/',controller[_0xc7ab('0x3')]);router[_0xc7ab('0x2')](_0xc7ab('0x4'),controller[_0xc7ab('0x5')]);router['post']('/reset/:token',controller[_0xc7ab('0x6')]);module['exports']=router; \ No newline at end of file +var _0x6f46=['exports','express','Router','./authLocal.controller','post','login','forgot','/reset/:token','reset'];(function(_0x2b5513,_0x3fe5cd){var _0x578fd2=function(_0x7a9106){while(--_0x7a9106){_0x2b5513['push'](_0x2b5513['shift']());}};_0x578fd2(++_0x3fe5cd);}(_0x6f46,0x10f));var _0x66f4=function(_0xda5c7c,_0x40f3b4){_0xda5c7c=_0xda5c7c-0x0;var _0x2bb2c2=_0x6f46[_0xda5c7c];return _0x2bb2c2;};'use strict';var express=require(_0x66f4('0x0'));var router=express[_0x66f4('0x1')]();var controller=require(_0x66f4('0x2'));router[_0x66f4('0x3')]('/',controller[_0x66f4('0x4')]);router[_0x66f4('0x3')]('/forgot',controller[_0x66f4('0x5')]);router[_0x66f4('0x3')](_0x66f4('0x6'),controller[_0x66f4('0x7')]);module[_0x66f4('0x8')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index 6a73f56..e160958 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 _0xdf3e=['INTEGER','exports','STRING','BOOLEAN'];(function(_0x35debf,_0xc16156){var _0x103ae6=function(_0x52037f){while(--_0x52037f){_0x35debf['push'](_0x35debf['shift']());}};_0x103ae6(++_0xc16156);}(_0xdf3e,0x89));var _0xedf3=function(_0x25289c,_0x16ae20){_0x25289c=_0x25289c-0x0;var _0x48a71e=_0xdf3e[_0x25289c];return _0x48a71e;};'use strict';var Sequelize=require('sequelize');module[_0xedf3('0x0')]={'name':{'type':Sequelize[_0xedf3('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0xedf3('0x1')]},'description':{'type':Sequelize[_0xedf3('0x1')]},'status':{'type':Sequelize[_0xedf3('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xedf3('0x3')],'defaultValue':0xa}}; \ No newline at end of file +var _0x3a3e=['STRING','BOOLEAN','INTEGER','sequelize'];(function(_0x225c0b,_0x1cbbc5){var _0x37c039=function(_0x519219){while(--_0x519219){_0x225c0b['push'](_0x225c0b['shift']());}};_0x37c039(++_0x1cbbc5);}(_0x3a3e,0x13b));var _0xe3a3=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0x3a3e[_0x4f9b18];return _0x29f20c;};'use strict';var Sequelize=require(_0xe3a3('0x0'));module['exports']={'name':{'type':Sequelize[_0xe3a3('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0xe3a3('0x1')]},'description':{'type':Sequelize[_0xe3a3('0x1')]},'status':{'type':Sequelize[_0xe3a3('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xe3a3('0x3')],'defaultValue':0xa}}; \ No newline at end of file diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js index cdc05d3..f19cfc5 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 _0x45fd=['fast-json-patch','request-promise','moment','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','Automation','fieldName','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','sort','filters','pick','where','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','show','params','create','body','find','addConditions','Condition','ids','omit','getConditions','findOne','rawAttributes','order','nolimit','addActions','getActions','eml-format','rimraf','zip-dir'];(function(_0x3daf35,_0x18a6f5){var _0x1cda00=function(_0x5cbecc){while(--_0x5cbecc){_0x3daf35['push'](_0x3daf35['shift']());}};_0x1cda00(++_0x18a6f5);}(_0x45fd,0xf9));var _0xd45f=function(_0x18e915,_0x4fe7bb){_0x18e915=_0x18e915-0x0;var _0x566734=_0x45fd[_0x18e915];return _0x566734;};'use strict';var emlformat=require(_0xd45f('0x0'));var rimraf=require(_0xd45f('0x1'));var zipdir=require(_0xd45f('0x2'));var jsonpatch=require(_0xd45f('0x3'));var rp=require(_0xd45f('0x4'));var moment=require(_0xd45f('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xd45f('0x6'));var path=require(_0xd45f('0x7'));var sox=require('sox');var csv=require(_0xd45f('0x8'));var ejs=require(_0xd45f('0x9'));var fs=require('fs');var fs_extra=require(_0xd45f('0xa'));var _=require('lodash');var squel=require(_0xd45f('0xb'));var crypto=require(_0xd45f('0xc'));var jsforce=require(_0xd45f('0xd'));var deskjs=require(_0xd45f('0xe'));var toCsv=require(_0xd45f('0x8'));var querystring=require(_0xd45f('0xf'));var Papa=require(_0xd45f('0x10'));var Redis=require(_0xd45f('0x11'));var authService=require(_0xd45f('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd45f('0x13'));var hardwareService=require(_0xd45f('0x14'));var logger=require('../../config/logger')(_0xd45f('0x15'));var utils=require('../../config/utils');var config=require(_0xd45f('0x16'));var licenseUtil=require(_0xd45f('0x17'));var db=require(_0xd45f('0x18'))['db'];function respondWithStatusCode(_0x3ae01d,_0x438af0){_0x438af0=_0x438af0||0xcc;return function(_0x2ee37a){if(_0x2ee37a){return _0x3ae01d[_0xd45f('0x19')](_0x438af0);}return _0x3ae01d[_0xd45f('0x1a')](_0x438af0)['end']();};}function respondWithResult(_0x585d0e,_0x4aba48){_0x4aba48=_0x4aba48||0xc8;return function(_0x54bad8){if(_0x54bad8){return _0x585d0e[_0xd45f('0x1a')](_0x4aba48)['json'](_0x54bad8);}};}function respondWithFilteredResult(_0x90ce3b,_0x5831e6){return function(_0x20d4dc){if(_0x20d4dc){var _0x26b257=typeof _0x5831e6[_0xd45f('0x1b')]===_0xd45f('0x1c')&&typeof _0x5831e6[_0xd45f('0x1d')]===_0xd45f('0x1c');var _0x3681b8=_0x20d4dc['count'];var _0x2c1afe=_0x26b257?0x0:_0x5831e6[_0xd45f('0x1b')];var _0x52ca61=_0x26b257?_0x20d4dc[_0xd45f('0x1e')]:_0x5831e6[_0xd45f('0x1b')]+_0x5831e6[_0xd45f('0x1d')];var _0x50f9ea;if(_0x52ca61>=_0x3681b8){_0x52ca61=_0x3681b8;_0x50f9ea=0xc8;}else{_0x50f9ea=0xce;}_0x90ce3b[_0xd45f('0x1a')](_0x50f9ea);return _0x90ce3b['set'](_0xd45f('0x1f'),_0x2c1afe+'-'+_0x52ca61+'/'+_0x3681b8)[_0xd45f('0x20')](_0x20d4dc);}return null;};}function patchUpdates(_0xfc21d5){return function(_0x1c96c2){try{jsonpatch[_0xd45f('0x21')](_0x1c96c2,_0xfc21d5,!![]);}catch(_0x23f3f6){return BPromise[_0xd45f('0x22')](_0x23f3f6);}return _0x1c96c2[_0xd45f('0x23')]();};}function saveUpdates(_0x236751,_0x28c6d3){return function(_0x1274ba){if(_0x1274ba){return _0x1274ba[_0xd45f('0x24')](_0x236751)[_0xd45f('0x25')](function(_0x5e1bb7){return _0x5e1bb7;});}return null;};}function removeEntity(_0xd4ad2e,_0x26cffa){return function(_0xe75b13){if(_0xe75b13){return _0xe75b13[_0xd45f('0x26')]()[_0xd45f('0x25')](function(){_0xd4ad2e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x305077,_0x3071eb){return function(_0x36ea92){if(!_0x36ea92){_0x305077['sendStatus'](0x194);}return _0x36ea92;};}function handleError(_0x5d8f0c,_0x188bdc){_0x188bdc=_0x188bdc||0x1f4;return function(_0x423e1e){logger[_0xd45f('0x27')](_0x423e1e[_0xd45f('0x28')]);if(_0x423e1e[_0xd45f('0x29')]){delete _0x423e1e['name'];}_0x5d8f0c[_0xd45f('0x1a')](_0x188bdc)[_0xd45f('0x2a')](_0x423e1e);};}exports[_0xd45f('0x2b')]=function(_0x36e533,_0x20b9f6){var _0x42cf02={},_0x3da9e9={},_0x2eaad8={'count':0x0,'rows':[]};var _0xa6a924=_[_0xd45f('0x2c')](db[_0xd45f('0x2d')]['rawAttributes'],function(_0x10be95){return{'name':_0x10be95[_0xd45f('0x2e')],'type':_0x10be95['type'][_0xd45f('0x2f')]};});_0x3da9e9[_0xd45f('0x30')]=_[_0xd45f('0x2c')](_0xa6a924,_0xd45f('0x29'));_0x3da9e9[_0xd45f('0x31')]=_[_0xd45f('0x32')](_0x36e533[_0xd45f('0x31')]);_0x3da9e9['filters']=_[_0xd45f('0x33')](_0x3da9e9[_0xd45f('0x30')],_0x3da9e9['query']);_0x42cf02['attributes']=_['intersection'](_0x3da9e9[_0xd45f('0x30')],qs[_0xd45f('0x34')](_0x36e533[_0xd45f('0x31')][_0xd45f('0x34')]));_0x42cf02[_0xd45f('0x35')]=_0x42cf02['attributes'][_0xd45f('0x36')]?_0x42cf02[_0xd45f('0x35')]:_0x3da9e9[_0xd45f('0x30')];if(!_0x36e533['query'][_0xd45f('0x37')]('nolimit')){_0x42cf02['limit']=qs[_0xd45f('0x1d')](_0x36e533[_0xd45f('0x31')][_0xd45f('0x1d')]);_0x42cf02[_0xd45f('0x1b')]=qs[_0xd45f('0x1b')](_0x36e533[_0xd45f('0x31')]['offset']);}_0x42cf02['order']=qs['sort'](_0x36e533['query'][_0xd45f('0x38')]);_0x42cf02['where']=qs[_0xd45f('0x39')](_[_0xd45f('0x3a')](_0x36e533[_0xd45f('0x31')],_0x3da9e9['filters']),_0xa6a924);if(_0x36e533[_0xd45f('0x31')]['filter']){_0x42cf02[_0xd45f('0x3b')]=_[_0xd45f('0x3c')](_0x42cf02[_0xd45f('0x3b')],{'$or':_[_0xd45f('0x2c')](_0xa6a924,function(_0x324044){if(_0x324044['type']!==_0xd45f('0x3d')){var _0x363454={};_0x363454[_0x324044[_0xd45f('0x29')]]={'$like':'%'+_0x36e533[_0xd45f('0x31')][_0xd45f('0x3e')]+'%'};return _0x363454;}})});}_0x42cf02=_[_0xd45f('0x3c')]({},_0x42cf02,_0x36e533[_0xd45f('0x3f')]);var _0x1dc4ca={'where':_0x42cf02[_0xd45f('0x3b')]};return db[_0xd45f('0x2d')][_0xd45f('0x1e')](_0x1dc4ca)[_0xd45f('0x25')](function(_0x40d6ba){_0x2eaad8[_0xd45f('0x1e')]=_0x40d6ba;if(_0x36e533['query'][_0xd45f('0x40')]){_0x42cf02[_0xd45f('0x41')]=[{'all':!![]}];}return db[_0xd45f('0x2d')]['findAll'](_0x42cf02);})[_0xd45f('0x25')](function(_0x51b95a){_0x2eaad8[_0xd45f('0x42')]=_0x51b95a;return _0x2eaad8;})['then'](respondWithFilteredResult(_0x20b9f6,_0x42cf02))[_0xd45f('0x43')](handleError(_0x20b9f6,null));};exports[_0xd45f('0x44')]=function(_0x37c878,_0x3ac5d8){var _0x8d741b={'raw':![],'where':{'id':_0x37c878[_0xd45f('0x45')]['id']}},_0x4b4121={};_0x4b4121[_0xd45f('0x30')]=_['keys'](db[_0xd45f('0x2d')]['rawAttributes']);_0x4b4121[_0xd45f('0x31')]=_[_0xd45f('0x32')](_0x37c878[_0xd45f('0x31')]);_0x4b4121[_0xd45f('0x39')]=_[_0xd45f('0x33')](_0x4b4121['model'],_0x4b4121[_0xd45f('0x31')]);_0x8d741b[_0xd45f('0x35')]=_[_0xd45f('0x33')](_0x4b4121[_0xd45f('0x30')],qs[_0xd45f('0x34')](_0x37c878[_0xd45f('0x31')]['fields']));_0x8d741b['attributes']=_0x8d741b[_0xd45f('0x35')][_0xd45f('0x36')]?_0x8d741b[_0xd45f('0x35')]:_0x4b4121['model'];if(_0x37c878[_0xd45f('0x31')]['includeAll']){_0x8d741b[_0xd45f('0x41')]=[{'all':!![]}];}_0x8d741b=_['merge']({},_0x8d741b,_0x37c878['options']);return db['Automation']['find'](_0x8d741b)[_0xd45f('0x25')](handleEntityNotFound(_0x3ac5d8,null))['then'](respondWithResult(_0x3ac5d8,null))[_0xd45f('0x43')](handleError(_0x3ac5d8,null));};exports[_0xd45f('0x46')]=function(_0x12b6b4,_0x1e8348){return db[_0xd45f('0x2d')]['create'](_0x12b6b4[_0xd45f('0x47')],{})[_0xd45f('0x25')](respondWithResult(_0x1e8348,0xc9))[_0xd45f('0x43')](handleError(_0x1e8348,null));};exports[_0xd45f('0x24')]=function(_0x2ea6d7,_0xfe69d3){if(_0x2ea6d7[_0xd45f('0x47')]['id']){delete _0x2ea6d7[_0xd45f('0x47')]['id'];}return db[_0xd45f('0x2d')][_0xd45f('0x48')]({'where':{'id':_0x2ea6d7[_0xd45f('0x45')]['id']}})[_0xd45f('0x25')](handleEntityNotFound(_0xfe69d3,null))[_0xd45f('0x25')](saveUpdates(_0x2ea6d7[_0xd45f('0x47')],null))['then'](respondWithResult(_0xfe69d3,null))[_0xd45f('0x43')](handleError(_0xfe69d3,null));};exports[_0xd45f('0x26')]=function(_0x4e4a98,_0x1a4683){return db[_0xd45f('0x2d')][_0xd45f('0x48')]({'where':{'id':_0x4e4a98[_0xd45f('0x45')]['id']}})[_0xd45f('0x25')](handleEntityNotFound(_0x1a4683,null))['then'](removeEntity(_0x1a4683,null))[_0xd45f('0x43')](handleError(_0x1a4683,null));};exports[_0xd45f('0x49')]=function(_0x5d8230,_0x28d3fc,_0x27affe){return db[_0xd45f('0x4a')]['find']({'where':{'id':_0x5d8230[_0xd45f('0x45')]['id']}})[_0xd45f('0x25')](handleEntityNotFound(_0x28d3fc,null))['then'](function(_0x3837af){if(_0x3837af){return _0x3837af[_0xd45f('0x49')](_0x5d8230[_0xd45f('0x47')][_0xd45f('0x4b')],_[_0xd45f('0x4c')](_0x5d8230[_0xd45f('0x47')],['ids','id'])||{});}})[_0xd45f('0x25')](respondWithResult(_0x28d3fc,null))[_0xd45f('0x43')](handleError(_0x28d3fc,null));};exports[_0xd45f('0x4d')]=function(_0x28bd60,_0x3e7a07,_0x3cd02f){var _0x48d4b2={};var _0x49d74b={};var _0x538a2b;var _0x16c026;return db[_0xd45f('0x2d')][_0xd45f('0x4e')]({'where':{'id':_0x28bd60[_0xd45f('0x45')]['id']}})[_0xd45f('0x25')](handleEntityNotFound(_0x3e7a07,null))[_0xd45f('0x25')](function(_0x2dce8a){if(_0x2dce8a){_0x538a2b=_0x2dce8a;_0x49d74b[_0xd45f('0x30')]=_['keys'](db[_0xd45f('0x4a')][_0xd45f('0x4f')]);_0x49d74b[_0xd45f('0x31')]=_[_0xd45f('0x32')](_0x28bd60[_0xd45f('0x31')]);_0x49d74b[_0xd45f('0x39')]=_[_0xd45f('0x33')](_0x49d74b['model'],_0x49d74b[_0xd45f('0x31')]);_0x48d4b2[_0xd45f('0x35')]=_[_0xd45f('0x33')](_0x49d74b[_0xd45f('0x30')],qs[_0xd45f('0x34')](_0x28bd60[_0xd45f('0x31')][_0xd45f('0x34')]));_0x48d4b2[_0xd45f('0x35')]=_0x48d4b2['attributes'][_0xd45f('0x36')]?_0x48d4b2[_0xd45f('0x35')]:_0x49d74b[_0xd45f('0x30')];_0x48d4b2[_0xd45f('0x50')]=qs[_0xd45f('0x38')](_0x28bd60[_0xd45f('0x31')][_0xd45f('0x38')]);_0x48d4b2[_0xd45f('0x3b')]=qs[_0xd45f('0x39')](_[_0xd45f('0x3a')](_0x28bd60[_0xd45f('0x31')],_0x49d74b[_0xd45f('0x39')]));if(_0x28bd60[_0xd45f('0x31')][_0xd45f('0x3e')]){_0x48d4b2[_0xd45f('0x3b')]=_[_0xd45f('0x3c')](_0x48d4b2[_0xd45f('0x3b')],{'$or':_[_0xd45f('0x2c')](_0x48d4b2['attributes'],function(_0x1781b0){var _0x524a29={};_0x524a29[_0x1781b0]={'$like':'%'+_0x28bd60[_0xd45f('0x31')][_0xd45f('0x3e')]+'%'};return _0x524a29;})});}_0x48d4b2=_['merge']({},_0x48d4b2,_0x28bd60[_0xd45f('0x3f')]);return _0x538a2b[_0xd45f('0x4d')](_0x48d4b2);}})[_0xd45f('0x25')](function(_0x1c600d){if(_0x1c600d){_0x16c026=_0x1c600d[_0xd45f('0x36')];if(!_0x28bd60[_0xd45f('0x31')][_0xd45f('0x37')](_0xd45f('0x51'))){_0x48d4b2[_0xd45f('0x1d')]=qs[_0xd45f('0x1d')](_0x28bd60['query'][_0xd45f('0x1d')]);_0x48d4b2[_0xd45f('0x1b')]=qs[_0xd45f('0x1b')](_0x28bd60['query'][_0xd45f('0x1b')]);}return _0x538a2b[_0xd45f('0x4d')](_0x48d4b2);}})[_0xd45f('0x25')](function(_0x5aa1da){if(_0x5aa1da){return _0x5aa1da?{'count':_0x16c026,'rows':_0x5aa1da}:null;}})[_0xd45f('0x25')](respondWithResult(_0x3e7a07,null))['catch'](handleError(_0x3e7a07,null));};exports[_0xd45f('0x52')]=function(_0x3a85e5,_0x80d420,_0x3ee993){return db['Action'][_0xd45f('0x48')]({'where':{'id':_0x3a85e5['params']['id']}})[_0xd45f('0x25')](handleEntityNotFound(_0x80d420,null))[_0xd45f('0x25')](function(_0x182e09){if(_0x182e09){return _0x182e09[_0xd45f('0x52')](_0x3a85e5['body'][_0xd45f('0x4b')],_[_0xd45f('0x4c')](_0x3a85e5[_0xd45f('0x47')],[_0xd45f('0x4b'),'id'])||{});}})['then'](respondWithResult(_0x80d420,null))['catch'](handleError(_0x80d420,null));};exports[_0xd45f('0x53')]=function(_0x3fb804,_0x1e33b3,_0x56ecfd){var _0xb2230f={};var _0x1b2a23={};var _0x49401a;var _0x1c868a;return db[_0xd45f('0x2d')]['findOne']({'where':{'id':_0x3fb804[_0xd45f('0x45')]['id']}})[_0xd45f('0x25')](handleEntityNotFound(_0x1e33b3,null))[_0xd45f('0x25')](function(_0x5751b5){if(_0x5751b5){_0x49401a=_0x5751b5;_0x1b2a23[_0xd45f('0x30')]=_[_0xd45f('0x32')](db['Action'][_0xd45f('0x4f')]);_0x1b2a23[_0xd45f('0x31')]=_[_0xd45f('0x32')](_0x3fb804[_0xd45f('0x31')]);_0x1b2a23[_0xd45f('0x39')]=_[_0xd45f('0x33')](_0x1b2a23[_0xd45f('0x30')],_0x1b2a23[_0xd45f('0x31')]);_0xb2230f[_0xd45f('0x35')]=_['intersection'](_0x1b2a23[_0xd45f('0x30')],qs[_0xd45f('0x34')](_0x3fb804[_0xd45f('0x31')]['fields']));_0xb2230f[_0xd45f('0x35')]=_0xb2230f['attributes']['length']?_0xb2230f[_0xd45f('0x35')]:_0x1b2a23[_0xd45f('0x30')];_0xb2230f['order']=qs[_0xd45f('0x38')](_0x3fb804[_0xd45f('0x31')][_0xd45f('0x38')]);_0xb2230f[_0xd45f('0x3b')]=qs[_0xd45f('0x39')](_[_0xd45f('0x3a')](_0x3fb804[_0xd45f('0x31')],_0x1b2a23['filters']));if(_0x3fb804[_0xd45f('0x31')][_0xd45f('0x3e')]){_0xb2230f[_0xd45f('0x3b')]=_[_0xd45f('0x3c')](_0xb2230f[_0xd45f('0x3b')],{'$or':_[_0xd45f('0x2c')](_0xb2230f[_0xd45f('0x35')],function(_0x862230){var _0x9bdf16={};_0x9bdf16[_0x862230]={'$like':'%'+_0x3fb804['query'][_0xd45f('0x3e')]+'%'};return _0x9bdf16;})});}_0xb2230f=_[_0xd45f('0x3c')]({},_0xb2230f,_0x3fb804[_0xd45f('0x3f')]);return _0x49401a[_0xd45f('0x53')](_0xb2230f);}})[_0xd45f('0x25')](function(_0x103697){if(_0x103697){_0x1c868a=_0x103697[_0xd45f('0x36')];if(!_0x3fb804[_0xd45f('0x31')][_0xd45f('0x37')]('nolimit')){_0xb2230f[_0xd45f('0x1d')]=qs[_0xd45f('0x1d')](_0x3fb804[_0xd45f('0x31')][_0xd45f('0x1d')]);_0xb2230f[_0xd45f('0x1b')]=qs['offset'](_0x3fb804[_0xd45f('0x31')][_0xd45f('0x1b')]);}return _0x49401a[_0xd45f('0x53')](_0xb2230f);}})[_0xd45f('0x25')](function(_0x386699){if(_0x386699){return _0x386699?{'count':_0x1c868a,'rows':_0x386699}:null;}})[_0xd45f('0x25')](respondWithResult(_0x1e33b3,null))['catch'](handleError(_0x1e33b3,null));}; \ No newline at end of file +var _0x8329=['filters','pick','filter','merge','type','VIRTUAL','options','then','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','Condition','addConditions','ids','getConditions','findOne','addActions','Action','getActions','hasOwnProperty','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','reject','save','update','stack','name','send','index','map','Automation','rawAttributes','key','model','query','keys','intersection','fields','length','attributes','nolimit','limit','order','sort','where'];(function(_0x46032a,_0xaca6f8){var _0x12766f=function(_0x52cb8d){while(--_0x52cb8d){_0x46032a['push'](_0x46032a['shift']());}};_0x12766f(++_0xaca6f8);}(_0x8329,0x1c0));var _0x9832=function(_0x41cc65,_0x5760d4){_0x41cc65=_0x41cc65-0x0;var _0xae75e9=_0x8329[_0x41cc65];return _0xae75e9;};'use strict';var emlformat=require(_0x9832('0x0'));var rimraf=require(_0x9832('0x1'));var zipdir=require(_0x9832('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9832('0x3'));var moment=require('moment');var BPromise=require(_0x9832('0x4'));var Mustache=require(_0x9832('0x5'));var util=require(_0x9832('0x6'));var path=require(_0x9832('0x7'));var sox=require(_0x9832('0x8'));var csv=require('to-csv');var ejs=require(_0x9832('0x9'));var fs=require('fs');var fs_extra=require(_0x9832('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x9832('0xb'));var jsforce=require(_0x9832('0xc'));var deskjs=require(_0x9832('0xd'));var toCsv=require(_0x9832('0xe'));var querystring=require(_0x9832('0xf'));var Papa=require(_0x9832('0x10'));var Redis=require(_0x9832('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x9832('0x12'));var hardwareService=require(_0x9832('0x13'));var logger=require(_0x9832('0x14'))(_0x9832('0x15'));var utils=require(_0x9832('0x16'));var config=require(_0x9832('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x9832('0x18'))['db'];function respondWithStatusCode(_0x2f7bd8,_0x10498c){_0x10498c=_0x10498c||0xcc;return function(_0x297a58){if(_0x297a58){return _0x2f7bd8[_0x9832('0x19')](_0x10498c);}return _0x2f7bd8[_0x9832('0x1a')](_0x10498c)[_0x9832('0x1b')]();};}function respondWithResult(_0x5473af,_0x58b21c){_0x58b21c=_0x58b21c||0xc8;return function(_0x6a915){if(_0x6a915){return _0x5473af[_0x9832('0x1a')](_0x58b21c)[_0x9832('0x1c')](_0x6a915);}};}function respondWithFilteredResult(_0x15fd29,_0x58f974){return function(_0x1285ef){if(_0x1285ef){var _0x3faacd=typeof _0x58f974[_0x9832('0x1d')]===_0x9832('0x1e')&&typeof _0x58f974['limit']===_0x9832('0x1e');var _0x4a1360=_0x1285ef[_0x9832('0x1f')];var _0x41a135=_0x3faacd?0x0:_0x58f974[_0x9832('0x1d')];var _0x182814=_0x3faacd?_0x1285ef['count']:_0x58f974[_0x9832('0x1d')]+_0x58f974['limit'];var _0x78df03;if(_0x182814>=_0x4a1360){_0x182814=_0x4a1360;_0x78df03=0xc8;}else{_0x78df03=0xce;}_0x15fd29['status'](_0x78df03);return _0x15fd29[_0x9832('0x20')]('Content-Range',_0x41a135+'-'+_0x182814+'/'+_0x4a1360)[_0x9832('0x1c')](_0x1285ef);}return null;};}function patchUpdates(_0xdc12ef){return function(_0x13ccd3){try{jsonpatch['apply'](_0x13ccd3,_0xdc12ef,!![]);}catch(_0x175fd2){return BPromise[_0x9832('0x21')](_0x175fd2);}return _0x13ccd3[_0x9832('0x22')]();};}function saveUpdates(_0x53f6fe,_0x2f8fd8){return function(_0x46e1f4){if(_0x46e1f4){return _0x46e1f4[_0x9832('0x23')](_0x53f6fe)['then'](function(_0x3213a4){return _0x3213a4;});}return null;};}function removeEntity(_0x42b416,_0x5ecc9c){return function(_0x17fbc2){if(_0x17fbc2){return _0x17fbc2['destroy']()['then'](function(){_0x42b416['status'](0xcc)[_0x9832('0x1b')]();});}};}function handleEntityNotFound(_0x4f75fc,_0x316d50){return function(_0x259d90){if(!_0x259d90){_0x4f75fc[_0x9832('0x19')](0x194);}return _0x259d90;};}function handleError(_0x17bb0c,_0x5e6940){_0x5e6940=_0x5e6940||0x1f4;return function(_0x1eceb6){logger['error'](_0x1eceb6[_0x9832('0x24')]);if(_0x1eceb6[_0x9832('0x25')]){delete _0x1eceb6[_0x9832('0x25')];}_0x17bb0c[_0x9832('0x1a')](_0x5e6940)[_0x9832('0x26')](_0x1eceb6);};}exports[_0x9832('0x27')]=function(_0x54dda7,_0x52cc3d){var _0xc1aeb4={},_0xa845f0={},_0x421340={'count':0x0,'rows':[]};var _0x5cb12b=_[_0x9832('0x28')](db[_0x9832('0x29')][_0x9832('0x2a')],function(_0x4303b2){return{'name':_0x4303b2['fieldName'],'type':_0x4303b2['type'][_0x9832('0x2b')]};});_0xa845f0[_0x9832('0x2c')]=_[_0x9832('0x28')](_0x5cb12b,_0x9832('0x25'));_0xa845f0[_0x9832('0x2d')]=_[_0x9832('0x2e')](_0x54dda7[_0x9832('0x2d')]);_0xa845f0['filters']=_[_0x9832('0x2f')](_0xa845f0[_0x9832('0x2c')],_0xa845f0['query']);_0xc1aeb4['attributes']=_[_0x9832('0x2f')](_0xa845f0[_0x9832('0x2c')],qs['fields'](_0x54dda7[_0x9832('0x2d')][_0x9832('0x30')]));_0xc1aeb4['attributes']=_0xc1aeb4['attributes'][_0x9832('0x31')]?_0xc1aeb4[_0x9832('0x32')]:_0xa845f0[_0x9832('0x2c')];if(!_0x54dda7['query']['hasOwnProperty'](_0x9832('0x33'))){_0xc1aeb4[_0x9832('0x34')]=qs[_0x9832('0x34')](_0x54dda7[_0x9832('0x2d')][_0x9832('0x34')]);_0xc1aeb4[_0x9832('0x1d')]=qs[_0x9832('0x1d')](_0x54dda7['query']['offset']);}_0xc1aeb4[_0x9832('0x35')]=qs[_0x9832('0x36')](_0x54dda7[_0x9832('0x2d')][_0x9832('0x36')]);_0xc1aeb4[_0x9832('0x37')]=qs[_0x9832('0x38')](_[_0x9832('0x39')](_0x54dda7['query'],_0xa845f0[_0x9832('0x38')]),_0x5cb12b);if(_0x54dda7['query'][_0x9832('0x3a')]){_0xc1aeb4[_0x9832('0x37')]=_[_0x9832('0x3b')](_0xc1aeb4[_0x9832('0x37')],{'$or':_[_0x9832('0x28')](_0x5cb12b,function(_0x39a231){if(_0x39a231[_0x9832('0x3c')]!==_0x9832('0x3d')){var _0x2e50ce={};_0x2e50ce[_0x39a231[_0x9832('0x25')]]={'$like':'%'+_0x54dda7['query']['filter']+'%'};return _0x2e50ce;}})});}_0xc1aeb4=_['merge']({},_0xc1aeb4,_0x54dda7[_0x9832('0x3e')]);var _0x3c3cdc={'where':_0xc1aeb4[_0x9832('0x37')]};return db[_0x9832('0x29')][_0x9832('0x1f')](_0x3c3cdc)[_0x9832('0x3f')](function(_0x22b2b5){_0x421340['count']=_0x22b2b5;if(_0x54dda7[_0x9832('0x2d')][_0x9832('0x40')]){_0xc1aeb4[_0x9832('0x41')]=[{'all':!![]}];}return db[_0x9832('0x29')][_0x9832('0x42')](_0xc1aeb4);})['then'](function(_0x308391){_0x421340[_0x9832('0x43')]=_0x308391;return _0x421340;})['then'](respondWithFilteredResult(_0x52cc3d,_0xc1aeb4))[_0x9832('0x44')](handleError(_0x52cc3d,null));};exports[_0x9832('0x45')]=function(_0x22fc4a,_0x2b2ce8){var _0x54ab25={'raw':![],'where':{'id':_0x22fc4a[_0x9832('0x46')]['id']}},_0x3018b8={};_0x3018b8[_0x9832('0x2c')]=_[_0x9832('0x2e')](db[_0x9832('0x29')][_0x9832('0x2a')]);_0x3018b8['query']=_['keys'](_0x22fc4a[_0x9832('0x2d')]);_0x3018b8[_0x9832('0x38')]=_[_0x9832('0x2f')](_0x3018b8['model'],_0x3018b8[_0x9832('0x2d')]);_0x54ab25['attributes']=_[_0x9832('0x2f')](_0x3018b8['model'],qs[_0x9832('0x30')](_0x22fc4a[_0x9832('0x2d')]['fields']));_0x54ab25['attributes']=_0x54ab25[_0x9832('0x32')][_0x9832('0x31')]?_0x54ab25[_0x9832('0x32')]:_0x3018b8[_0x9832('0x2c')];if(_0x22fc4a[_0x9832('0x2d')]['includeAll']){_0x54ab25[_0x9832('0x41')]=[{'all':!![]}];}_0x54ab25=_[_0x9832('0x3b')]({},_0x54ab25,_0x22fc4a[_0x9832('0x3e')]);return db[_0x9832('0x29')][_0x9832('0x47')](_0x54ab25)[_0x9832('0x3f')](handleEntityNotFound(_0x2b2ce8,null))['then'](respondWithResult(_0x2b2ce8,null))[_0x9832('0x44')](handleError(_0x2b2ce8,null));};exports[_0x9832('0x48')]=function(_0x382007,_0x473080){return db[_0x9832('0x29')][_0x9832('0x48')](_0x382007[_0x9832('0x49')],{})[_0x9832('0x3f')](respondWithResult(_0x473080,0xc9))[_0x9832('0x44')](handleError(_0x473080,null));};exports[_0x9832('0x23')]=function(_0x1e0e0d,_0x3c658b){if(_0x1e0e0d['body']['id']){delete _0x1e0e0d[_0x9832('0x49')]['id'];}return db[_0x9832('0x29')][_0x9832('0x47')]({'where':{'id':_0x1e0e0d[_0x9832('0x46')]['id']}})['then'](handleEntityNotFound(_0x3c658b,null))[_0x9832('0x3f')](saveUpdates(_0x1e0e0d['body'],null))['then'](respondWithResult(_0x3c658b,null))['catch'](handleError(_0x3c658b,null));};exports[_0x9832('0x4a')]=function(_0x49ab3d,_0x184ce4){return db[_0x9832('0x29')]['find']({'where':{'id':_0x49ab3d[_0x9832('0x46')]['id']}})[_0x9832('0x3f')](handleEntityNotFound(_0x184ce4,null))['then'](removeEntity(_0x184ce4,null))[_0x9832('0x44')](handleError(_0x184ce4,null));};exports['addConditions']=function(_0x5c4a3a,_0x1184b3,_0x15765a){return db[_0x9832('0x4b')][_0x9832('0x47')]({'where':{'id':_0x5c4a3a[_0x9832('0x46')]['id']}})[_0x9832('0x3f')](handleEntityNotFound(_0x1184b3,null))['then'](function(_0x3e8000){if(_0x3e8000){return _0x3e8000[_0x9832('0x4c')](_0x5c4a3a[_0x9832('0x49')]['ids'],_['omit'](_0x5c4a3a['body'],[_0x9832('0x4d'),'id'])||{});}})[_0x9832('0x3f')](respondWithResult(_0x1184b3,null))['catch'](handleError(_0x1184b3,null));};exports[_0x9832('0x4e')]=function(_0x133b44,_0x289e79,_0x162734){var _0x1ff4fc={};var _0x4132bf={};var _0x43ef01;var _0x37ca43;return db['Automation'][_0x9832('0x4f')]({'where':{'id':_0x133b44[_0x9832('0x46')]['id']}})['then'](handleEntityNotFound(_0x289e79,null))[_0x9832('0x3f')](function(_0x36c6bd){if(_0x36c6bd){_0x43ef01=_0x36c6bd;_0x4132bf[_0x9832('0x2c')]=_[_0x9832('0x2e')](db[_0x9832('0x4b')][_0x9832('0x2a')]);_0x4132bf[_0x9832('0x2d')]=_[_0x9832('0x2e')](_0x133b44['query']);_0x4132bf[_0x9832('0x38')]=_[_0x9832('0x2f')](_0x4132bf['model'],_0x4132bf[_0x9832('0x2d')]);_0x1ff4fc['attributes']=_[_0x9832('0x2f')](_0x4132bf[_0x9832('0x2c')],qs[_0x9832('0x30')](_0x133b44[_0x9832('0x2d')]['fields']));_0x1ff4fc['attributes']=_0x1ff4fc[_0x9832('0x32')][_0x9832('0x31')]?_0x1ff4fc[_0x9832('0x32')]:_0x4132bf[_0x9832('0x2c')];_0x1ff4fc['order']=qs[_0x9832('0x36')](_0x133b44[_0x9832('0x2d')][_0x9832('0x36')]);_0x1ff4fc[_0x9832('0x37')]=qs[_0x9832('0x38')](_[_0x9832('0x39')](_0x133b44[_0x9832('0x2d')],_0x4132bf[_0x9832('0x38')]));if(_0x133b44['query'][_0x9832('0x3a')]){_0x1ff4fc[_0x9832('0x37')]=_[_0x9832('0x3b')](_0x1ff4fc['where'],{'$or':_['map'](_0x1ff4fc['attributes'],function(_0x21d4f1){var _0x47f239={};_0x47f239[_0x21d4f1]={'$like':'%'+_0x133b44[_0x9832('0x2d')][_0x9832('0x3a')]+'%'};return _0x47f239;})});}_0x1ff4fc=_[_0x9832('0x3b')]({},_0x1ff4fc,_0x133b44[_0x9832('0x3e')]);return _0x43ef01['getConditions'](_0x1ff4fc);}})[_0x9832('0x3f')](function(_0xd6e4c8){if(_0xd6e4c8){_0x37ca43=_0xd6e4c8[_0x9832('0x31')];if(!_0x133b44[_0x9832('0x2d')]['hasOwnProperty'](_0x9832('0x33'))){_0x1ff4fc[_0x9832('0x34')]=qs[_0x9832('0x34')](_0x133b44['query'][_0x9832('0x34')]);_0x1ff4fc[_0x9832('0x1d')]=qs[_0x9832('0x1d')](_0x133b44['query'][_0x9832('0x1d')]);}return _0x43ef01['getConditions'](_0x1ff4fc);}})['then'](function(_0x55712b){if(_0x55712b){return _0x55712b?{'count':_0x37ca43,'rows':_0x55712b}:null;}})[_0x9832('0x3f')](respondWithResult(_0x289e79,null))[_0x9832('0x44')](handleError(_0x289e79,null));};exports[_0x9832('0x50')]=function(_0x3f2f77,_0x42e097,_0x1baddb){return db[_0x9832('0x51')]['find']({'where':{'id':_0x3f2f77['params']['id']}})[_0x9832('0x3f')](handleEntityNotFound(_0x42e097,null))[_0x9832('0x3f')](function(_0x387e27){if(_0x387e27){return _0x387e27[_0x9832('0x50')](_0x3f2f77['body'][_0x9832('0x4d')],_['omit'](_0x3f2f77['body'],[_0x9832('0x4d'),'id'])||{});}})[_0x9832('0x3f')](respondWithResult(_0x42e097,null))[_0x9832('0x44')](handleError(_0x42e097,null));};exports[_0x9832('0x52')]=function(_0x2d72ee,_0x216727,_0x4be8dd){var _0x2429ff={};var _0x210724={};var _0x504a06;var _0x177220;return db['Automation'][_0x9832('0x4f')]({'where':{'id':_0x2d72ee[_0x9832('0x46')]['id']}})[_0x9832('0x3f')](handleEntityNotFound(_0x216727,null))[_0x9832('0x3f')](function(_0xe962cb){if(_0xe962cb){_0x504a06=_0xe962cb;_0x210724['model']=_[_0x9832('0x2e')](db['Action'][_0x9832('0x2a')]);_0x210724[_0x9832('0x2d')]=_['keys'](_0x2d72ee[_0x9832('0x2d')]);_0x210724[_0x9832('0x38')]=_['intersection'](_0x210724['model'],_0x210724[_0x9832('0x2d')]);_0x2429ff[_0x9832('0x32')]=_['intersection'](_0x210724['model'],qs[_0x9832('0x30')](_0x2d72ee[_0x9832('0x2d')]['fields']));_0x2429ff['attributes']=_0x2429ff[_0x9832('0x32')][_0x9832('0x31')]?_0x2429ff[_0x9832('0x32')]:_0x210724[_0x9832('0x2c')];_0x2429ff['order']=qs[_0x9832('0x36')](_0x2d72ee['query']['sort']);_0x2429ff[_0x9832('0x37')]=qs[_0x9832('0x38')](_[_0x9832('0x39')](_0x2d72ee['query'],_0x210724[_0x9832('0x38')]));if(_0x2d72ee[_0x9832('0x2d')][_0x9832('0x3a')]){_0x2429ff['where']=_[_0x9832('0x3b')](_0x2429ff[_0x9832('0x37')],{'$or':_[_0x9832('0x28')](_0x2429ff[_0x9832('0x32')],function(_0x14ef3d){var _0x5f4358={};_0x5f4358[_0x14ef3d]={'$like':'%'+_0x2d72ee[_0x9832('0x2d')]['filter']+'%'};return _0x5f4358;})});}_0x2429ff=_[_0x9832('0x3b')]({},_0x2429ff,_0x2d72ee[_0x9832('0x3e')]);return _0x504a06['getActions'](_0x2429ff);}})[_0x9832('0x3f')](function(_0x45bf3b){if(_0x45bf3b){_0x177220=_0x45bf3b[_0x9832('0x31')];if(!_0x2d72ee[_0x9832('0x2d')][_0x9832('0x53')]('nolimit')){_0x2429ff[_0x9832('0x34')]=qs[_0x9832('0x34')](_0x2d72ee[_0x9832('0x2d')][_0x9832('0x34')]);_0x2429ff[_0x9832('0x1d')]=qs['offset'](_0x2d72ee['query'][_0x9832('0x1d')]);}return _0x504a06['getActions'](_0x2429ff);}})[_0x9832('0x3f')](function(_0x42d17c){if(_0x42d17c){return _0x42d17c?{'count':_0x177220,'rows':_0x42d17c}:null;}})[_0x9832('0x3f')](respondWithResult(_0x216727,null))[_0x9832('0x44')](handleError(_0x216727,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index 749c6ab..3e522aa 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 _0x5a65=['define','tools_automations','lodash','api','bluebird','request-promise','path','../../config/environment','./automation.attributes','exports'];(function(_0x14fad0,_0x278d75){var _0x5c665f=function(_0xe43a83){while(--_0xe43a83){_0x14fad0['push'](_0x14fad0['shift']());}};_0x5c665f(++_0x278d75);}(_0x5a65,0x156));var _0x55a6=function(_0x1cf20b,_0x118a35){_0x1cf20b=_0x1cf20b-0x0;var _0x31434a=_0x5a65[_0x1cf20b];return _0x31434a;};'use strict';var _=require(_0x55a6('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x55a6('0x1'));var moment=require('moment');var BPromise=require(_0x55a6('0x2'));var rp=require(_0x55a6('0x3'));var fs=require('fs');var path=require(_0x55a6('0x4'));var rimraf=require('rimraf');var config=require(_0x55a6('0x5'));var attributes=require(_0x55a6('0x6'));module[_0x55a6('0x7')]=function(_0x28b2ea,_0x30793b){return _0x28b2ea[_0x55a6('0x8')]('Automation',attributes,{'tableName':_0x55a6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa092=['./automation.attributes','define','tools_automations','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0xa092,0x189));var _0x2a09=function(_0x5566b7,_0x4e9e2c){_0x5566b7=_0x5566b7-0x0;var _0x1c7ea7=_0xa092[_0x5566b7];return _0x1c7ea7;};'use strict';var _=require('lodash');var util=require(_0x2a09('0x0'));var logger=require(_0x2a09('0x1'))(_0x2a09('0x2'));var moment=require('moment');var BPromise=require(_0x2a09('0x3'));var rp=require(_0x2a09('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2a09('0x5'));var config=require(_0x2a09('0x6'));var attributes=require(_0x2a09('0x7'));module['exports']=function(_0x7b06ea,_0x167c88){return _0x7b06ea[_0x2a09('0x8')]('Automation',attributes,{'tableName':_0x2a09('0x9'),'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 13bea0d..303f904 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 _0x6e1c=['rpc','../../config/environment','jayson/promise','client','http','request','info','Automation,\x20%s,\x20%s','Automation,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x250ddd,_0x57e608){var _0xb42e9c=function(_0x10facc){while(--_0x10facc){_0x250ddd['push'](_0x250ddd['shift']());}};_0xb42e9c(++_0x57e608);}(_0x6e1c,0xb6));var _0xc6e1=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6e1c[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xc6e1('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xc6e1('0x1'));var rs=require(_0xc6e1('0x2'));var fs=require('fs');var Redis=require(_0xc6e1('0x3'));var db=require(_0xc6e1('0x4'))['db'];var utils=require(_0xc6e1('0x5'));var logger=require(_0xc6e1('0x6'))(_0xc6e1('0x7'));var config=require(_0xc6e1('0x8'));var jayson=require(_0xc6e1('0x9'));var client=jayson[_0xc6e1('0xa')][_0xc6e1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5247f1,_0x3ff10c,_0x1242d5){return new BPromise(function(_0x39000a,_0x2ffee0){return client[_0xc6e1('0xc')](_0x5247f1,_0x1242d5)['then'](function(_0xa29af9){logger[_0xc6e1('0xd')](_0xc6e1('0xe'),_0x3ff10c,'request\x20sent');logger['debug'](_0xc6e1('0xf'),_0x3ff10c,_0xc6e1('0x10'),JSON['stringify'](_0xa29af9));if(_0xa29af9[_0xc6e1('0x11')]){if(_0xa29af9[_0xc6e1('0x11')][_0xc6e1('0x12')]===0x1f4){logger[_0xc6e1('0x11')](_0xc6e1('0xe'),_0x3ff10c,_0xa29af9[_0xc6e1('0x11')]['message']);return _0x2ffee0(_0xa29af9[_0xc6e1('0x11')][_0xc6e1('0x13')]);}logger[_0xc6e1('0x11')](_0xc6e1('0xe'),_0x3ff10c,_0xa29af9[_0xc6e1('0x11')]['message']);return _0x39000a(_0xa29af9['error'][_0xc6e1('0x13')]);}else{logger[_0xc6e1('0xd')]('Automation,\x20%s,\x20%s',_0x3ff10c,_0xc6e1('0x10'));_0x39000a(_0xa29af9[_0xc6e1('0x14')][_0xc6e1('0x13')]);}})['catch'](function(_0x44ef6c){logger[_0xc6e1('0x11')](_0xc6e1('0xe'),_0x3ff10c,_0x44ef6c);_0x2ffee0(_0x44ef6c);});});} \ No newline at end of file +var _0x505d=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','request\x20sent','Automation,\x20%s,\x20%s,\x20%s','stringify','error','message','Automation,\x20%s,\x20%s','catch','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x517082,_0xc70ef9){var _0x560118=function(_0xff3513){while(--_0xff3513){_0x517082['push'](_0x517082['shift']());}};_0x560118(++_0xc70ef9);}(_0x505d,0x93));var _0xd505=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0x505d[_0x491a7f];return _0x3d8f44;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd505('0x0'));var BPromise=require(_0xd505('0x1'));var rs=require(_0xd505('0x2'));var fs=require('fs');var Redis=require(_0xd505('0x3'));var db=require(_0xd505('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd505('0x5'))(_0xd505('0x6'));var config=require(_0xd505('0x7'));var jayson=require(_0xd505('0x8'));var client=jayson['client'][_0xd505('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5d4f8d,_0x2bc4e7,_0x162ee2){return new BPromise(function(_0x543c42,_0x2abf26){return client[_0xd505('0xa')](_0x5d4f8d,_0x162ee2)['then'](function(_0x47b37a){logger[_0xd505('0xb')]('Automation,\x20%s,\x20%s',_0x2bc4e7,_0xd505('0xc'));logger['debug'](_0xd505('0xd'),_0x2bc4e7,'request\x20sent',JSON[_0xd505('0xe')](_0x47b37a));if(_0x47b37a['error']){if(_0x47b37a['error']['code']===0x1f4){logger[_0xd505('0xf')]('Automation,\x20%s,\x20%s',_0x2bc4e7,_0x47b37a[_0xd505('0xf')][_0xd505('0x10')]);return _0x2abf26(_0x47b37a['error']['message']);}logger[_0xd505('0xf')](_0xd505('0x11'),_0x2bc4e7,_0x47b37a[_0xd505('0xf')][_0xd505('0x10')]);return _0x543c42(_0x47b37a[_0xd505('0xf')][_0xd505('0x10')]);}else{logger[_0xd505('0xb')](_0xd505('0x11'),_0x2bc4e7,_0xd505('0xc'));_0x543c42(_0x47b37a['result'][_0xd505('0x10')]);}})[_0xd505('0x12')](function(_0x8013f2){logger['error'](_0xd505('0x11'),_0x2bc4e7,_0x8013f2);_0x2abf26(_0x8013f2);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index 7b4cd86..2baccf8 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 _0x26c2=['addConditions','addActions','put','destroy','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/conditions','getConditions','/:id/actions','create','post'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0x26c2,0x130));var _0x226c=function(_0x41caaf,_0x2c91c4){_0x41caaf=_0x41caaf-0x0;var _0x41a83d=_0x26c2[_0x41caaf];return _0x41a83d;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x226c('0x0'));var express=require(_0x226c('0x1'));var router=express[_0x226c('0x2')]();var fs_extra=require(_0x226c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x226c('0x4'));var config=require(_0x226c('0x5'));var controller=require('./automation.controller');router[_0x226c('0x6')]('/',auth[_0x226c('0x7')](),controller[_0x226c('0x8')]);router[_0x226c('0x6')](_0x226c('0x9'),auth['isAuthenticated'](),controller[_0x226c('0xa')]);router[_0x226c('0x6')](_0x226c('0xb'),auth[_0x226c('0x7')](),controller[_0x226c('0xc')]);router['get'](_0x226c('0xd'),auth[_0x226c('0x7')](),controller['getActions']);router['post']('/',auth[_0x226c('0x7')](),controller[_0x226c('0xe')]);router[_0x226c('0xf')](_0x226c('0xb'),auth[_0x226c('0x7')](),controller[_0x226c('0x10')]);router[_0x226c('0xf')]('/:id/actions',auth['isAuthenticated'](),controller[_0x226c('0x11')]);router[_0x226c('0x12')](_0x226c('0x9'),auth[_0x226c('0x7')](),controller['update']);router['delete'](_0x226c('0x9'),auth[_0x226c('0x7')](),controller[_0x226c('0x13')]);module['exports']=router; \ No newline at end of file +var _0x7429=['../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','/:id','show','isAuthenticated','getConditions','post','/:id/conditions','/:id/actions','put','update','delete','destroy','path','express','Router'];(function(_0x1e17eb,_0x2e15c5){var _0x4de4c7=function(_0x52d003){while(--_0x52d003){_0x1e17eb['push'](_0x1e17eb['shift']());}};_0x4de4c7(++_0x2e15c5);}(_0x7429,0x6f));var _0x9742=function(_0x41cf29,_0x5c7212){_0x41cf29=_0x41cf29-0x0;var _0x20753e=_0x7429[_0x41cf29];return _0x20753e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9742('0x0'));var timeout=require('connect-timeout');var express=require(_0x9742('0x1'));var router=express[_0x9742('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x9742('0x3'));var interaction=require(_0x9742('0x4'));var config=require(_0x9742('0x5'));var controller=require(_0x9742('0x6'));router[_0x9742('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x9742('0x7')](_0x9742('0x8'),auth['isAuthenticated'](),controller[_0x9742('0x9')]);router[_0x9742('0x7')]('/:id/conditions',auth[_0x9742('0xa')](),controller[_0x9742('0xb')]);router[_0x9742('0x7')]('/:id/actions',auth[_0x9742('0xa')](),controller['getActions']);router[_0x9742('0xc')]('/',auth[_0x9742('0xa')](),controller['create']);router[_0x9742('0xc')](_0x9742('0xd'),auth[_0x9742('0xa')](),controller['addConditions']);router[_0x9742('0xc')](_0x9742('0xe'),auth[_0x9742('0xa')](),controller['addActions']);router[_0x9742('0xf')](_0x9742('0x8'),auth['isAuthenticated'](),controller[_0x9742('0x10')]);router[_0x9742('0x11')](_0x9742('0x8'),auth[_0x9742('0xa')](),controller[_0x9742('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index 5783802..965747c 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 _0xb700=['Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','STRING','ENUM','BOOLEAN','Active/Disactive\x20Campaign','UNSIGNED','INTEGER'];(function(_0x29df9a,_0x42aff3){var _0x3a8e96=function(_0x70fbe7){while(--_0x70fbe7){_0x29df9a['push'](_0x29df9a['shift']());}};_0x3a8e96(++_0x42aff3);}(_0xb700,0x13d));var _0x0b70=function(_0x330414,_0x4f3207){_0x330414=_0x330414-0x0;var _0x99dbff=_0xb700[_0x330414];return _0x99dbff;};'use strict';var Sequelize=require(_0x0b70('0x0'));module['exports']={'name':{'type':Sequelize[_0x0b70('0x1')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x0b70('0x2')]('ivr'),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x0b70('0x3')],'defaultValue':0x0,'comment':_0x0b70('0x4')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0x0b70('0x5')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0x0b70('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x0b70('0x6')](0x3)[_0x0b70('0x5')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0b70('0x7')},'dialCongestionMaxRetry':{'type':Sequelize[_0x0b70('0x6')](0x3)[_0x0b70('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0b70('0x8')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0b70('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0b70('0x9')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0b70('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0b70('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0b70('0xa')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x0b70('0x6')](0x3)[_0x0b70('0x5')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0b70('0xb')},'dialGlobalMaxRetry':{'type':Sequelize[_0x0b70('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x0b70('0xc')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x0b70('0x1')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x0b70('0xd'),_0x0b70('0xe'),_0x0b70('0xf')),'defaultValue':_0x0b70('0xd')},'dialAMDActive':{'type':Sequelize[_0x0b70('0x3')],'defaultValue':0x0,'comment':_0x0b70('0x10')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x0b70('0x5')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x0b70('0x5')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x0b70('0x11')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x0b70('0x12')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x0b70('0x6')](0x9)[_0x0b70('0x5')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0b70('0x13')},'dialAMDMinWordLength':{'type':Sequelize[_0x0b70('0x6')](0x9)[_0x0b70('0x5')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x0b70('0x6')](0x9)[_0x0b70('0x5')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x0b70('0x14')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x0b70('0x6')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x0b70('0x15')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x0b70('0x6')](0x5)[_0x0b70('0x5')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x0b70('0x16')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x0b70('0x6')](0x9)[_0x0b70('0x5')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0b70('0x17')},'dialOrderByScheduledAt':{'type':Sequelize[_0x0b70('0x2')](_0x0b70('0x18'),_0x0b70('0x19')),'defaultValue':_0x0b70('0x18')},'dialPrefix':{'type':Sequelize[_0x0b70('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x0b70('0x6')](0x3)[_0x0b70('0x5')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0b70('0x1a')},'dialCutDigit':{'type':Sequelize[_0x0b70('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0b70('0x1b')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x0b70('0x6')](0x3)[_0x0b70('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0b70('0x1c')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x0b70('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0b70('0x1d')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0b70('0x1e')},'dialDropRetryFrequency':{'type':Sequelize[_0x0b70('0x6')](0x5)[_0x0b70('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0b70('0x1f')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x0b70('0x6')](0x3)[_0x0b70('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0b70('0x20')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x0b70('0x6')](0x5)[_0x0b70('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0b70('0x21')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0b70('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0b70('0x22')},'dialMachineRetryFrequency':{'type':Sequelize[_0x0b70('0x6')](0x5)[_0x0b70('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x0b70('0x6')](0x3)[_0x0b70('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x0b70('0x6')](0x5)[_0x0b70('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0b70('0x23')}}; \ No newline at end of file +var _0x8e8d=['#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Word\x20Length','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','exports','STRING','name','ENUM','ivr','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence'];(function(_0x310bd9,_0x27690d){var _0x438c67=function(_0x7ce348){while(--_0x7ce348){_0x310bd9['push'](_0x310bd9['shift']());}};_0x438c67(++_0x27690d);}(_0x8e8d,0x1d7));var _0xd8e8=function(_0x29f9ea,_0x68785d){_0x29f9ea=_0x29f9ea-0x0;var _0xe1819d=_0x8e8d[_0x29f9ea];return _0xe1819d;};'use strict';var Sequelize=require('sequelize');module[_0xd8e8('0x0')]={'name':{'type':Sequelize[_0xd8e8('0x1')],'unique':_0xd8e8('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xd8e8('0x3')](_0xd8e8('0x4')),'allowNull':![],'defaultValue':_0xd8e8('0x4')},'description':{'type':Sequelize[_0xd8e8('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xd8e8('0x5')},'limitCalls':{'type':Sequelize[_0xd8e8('0x6')](0x4)[_0xd8e8('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xd8e8('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0xd8e8('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xd8e8('0x1')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd8e8('0x9')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd8e8('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xd8e8('0x6')](0x5)[_0xd8e8('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd8e8('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0xd8e8('0x6')](0x3)[_0xd8e8('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd8e8('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0xd8e8('0x6')](0x5)[_0xd8e8('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd8e8('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xd8e8('0x6')](0x3)[_0xd8e8('0x7')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xd8e8('0x6')](0x5)[_0xd8e8('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0xd8e8('0x6')](0x3)[_0xd8e8('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xd8e8('0xe')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xd8e8('0x1')],'defaultValue':_0xd8e8('0xf')},'dialCheckDuplicateType':{'type':Sequelize[_0xd8e8('0x3')](_0xd8e8('0x10'),_0xd8e8('0x11'),_0xd8e8('0x12')),'defaultValue':_0xd8e8('0x10')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xd8e8('0x13')},'dialAMDInitialSilence':{'type':Sequelize[_0xd8e8('0x6')](0x9)[_0xd8e8('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xd8e8('0x14')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0xd8e8('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xd8e8('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xd8e8('0x6')](0x9)[_0xd8e8('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xd8e8('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xd8e8('0x6')](0x9)[_0xd8e8('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xd8e8('0x17')},'dialAMDMinWordLength':{'type':Sequelize[_0xd8e8('0x6')](0x9)[_0xd8e8('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xd8e8('0x18')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0xd8e8('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xd8e8('0x19')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xd8e8('0x6')](0x9)[_0xd8e8('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0xd8e8('0x6')](0x5)[_0xd8e8('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0xd8e8('0x6')](0x9)[_0xd8e8('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xd8e8('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize[_0xd8e8('0x3')](_0xd8e8('0x1b'),'ASC'),'defaultValue':_0xd8e8('0x1b')},'dialPrefix':{'type':Sequelize[_0xd8e8('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0xd8e8('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xd8e8('0x1c')},'dialCutDigit':{'type':Sequelize[_0xd8e8('0x6')](0x3)[_0xd8e8('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xd8e8('0x1d')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xd8e8('0x6')](0x3)[_0xd8e8('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd8e8('0x1e')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xd8e8('0x6')](0x5)[_0xd8e8('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd8e8('0x1f')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd8e8('0x20')},'dialDropRetryFrequency':{'type':Sequelize[_0xd8e8('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd8e8('0x21')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xd8e8('0x6')](0x5)[_0xd8e8('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd8e8('0x22')},'dialMachineMaxRetry':{'type':Sequelize[_0xd8e8('0x6')](0x3)[_0xd8e8('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0xd8e8('0x6')](0x5)[_0xd8e8('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd8e8('0x23')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd8e8('0x24')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xd8e8('0x6')](0x5)[_0xd8e8('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd8e8('0x25')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index 9c91bd3..ed7ad37 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 _0x23a0=['ListId\x20=\x20?','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','scheduledAt','phone\x20IS\x20NOT\x20NULL','push','all','removeLists','destroy','getBlackLists','CmList','addBlackLists','sequelize','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','sox','to-csv','lodash','crypto','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','then','get','name','index','map','Campaign','fieldName','type','key','query','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','includeAll','include','rows','catch','show','params','keys','rawAttributes','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','IvrCampaigns','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','role','UserProfileSection','userProfileId','update','getHoppers','findOne','CmHopper','CampaignId','findAll','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','ids','spread','dialCheckDuplicateType','always','into','cm_hopper','fromQuery','phone','ListId','select','NOW()','field','ContactId','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL'];(function(_0x2c92a3,_0x59ec68){var _0x16c8e7=function(_0x5b7523){while(--_0x5b7523){_0x2c92a3['push'](_0x2c92a3['shift']());}};_0x16c8e7(++_0x59ec68);}(_0x23a0,0x94));var _0x023a=function(_0x45bf86,_0x75586e){_0x45bf86=_0x45bf86-0x0;var _0x1f02b7=_0x23a0[_0x45bf86];return _0x1f02b7;};'use strict';var emlformat=require(_0x023a('0x0'));var rimraf=require(_0x023a('0x1'));var zipdir=require(_0x023a('0x2'));var jsonpatch=require(_0x023a('0x3'));var rp=require('request-promise');var moment=require(_0x023a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x023a('0x5'));var util=require('util');var path=require(_0x023a('0x6'));var sox=require(_0x023a('0x7'));var csv=require(_0x023a('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x023a('0x9'));var squel=require('squel');var crypto=require(_0x023a('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x023a('0x8'));var querystring=require(_0x023a('0xb'));var Papa=require('papaparse');var Redis=require(_0x023a('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x023a('0xd'));var as=require(_0x023a('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x023a('0xf'))('api');var utils=require(_0x023a('0x10'));var config=require(_0x023a('0x11'));var licenseUtil=require(_0x023a('0x12'));var db=require(_0x023a('0x13'))['db'];function respondWithStatusCode(_0x1eaba4,_0xb2bc97){_0xb2bc97=_0xb2bc97||0xcc;return function(_0x491008){if(_0x491008){return _0x1eaba4[_0x023a('0x14')](_0xb2bc97);}return _0x1eaba4[_0x023a('0x15')](_0xb2bc97)[_0x023a('0x16')]();};}function respondWithResult(_0x436b0a,_0x381014){_0x381014=_0x381014||0xc8;return function(_0x3654dd){if(_0x3654dd){return _0x436b0a[_0x023a('0x15')](_0x381014)[_0x023a('0x17')](_0x3654dd);}};}function respondWithFilteredResult(_0xbe6064,_0x12e358){return function(_0x2be30b){if(_0x2be30b){var _0xed01ef=typeof _0x12e358[_0x023a('0x18')]===_0x023a('0x19')&&typeof _0x12e358['limit']==='undefined';var _0x3b7757=_0x2be30b['count'];var _0x10888e=_0xed01ef?0x0:_0x12e358['offset'];var _0x322be0=_0xed01ef?_0x2be30b[_0x023a('0x1a')]:_0x12e358[_0x023a('0x18')]+_0x12e358[_0x023a('0x1b')];var _0x4d0c11;if(_0x322be0>=_0x3b7757){_0x322be0=_0x3b7757;_0x4d0c11=0xc8;}else{_0x4d0c11=0xce;}_0xbe6064['status'](_0x4d0c11);return _0xbe6064['set'](_0x023a('0x1c'),_0x10888e+'-'+_0x322be0+'/'+_0x3b7757)['json'](_0x2be30b);}return null;};}function patchUpdates(_0x13c800){return function(_0x18b222){try{jsonpatch[_0x023a('0x1d')](_0x18b222,_0x13c800,!![]);}catch(_0x2dd1ca){return BPromise[_0x023a('0x1e')](_0x2dd1ca);}return _0x18b222[_0x023a('0x1f')]();};}function saveUpdates(_0x4ec1c7,_0x3fc025){return function(_0x554aaf){if(_0x554aaf){return _0x554aaf['update'](_0x4ec1c7)[_0x023a('0x20')](function(_0x37ee49){return _0x37ee49;});}return null;};}function removeEntity(_0x1fb09f,_0x40914d){return function(_0x1d2ab8){if(_0x1d2ab8){return _0x1d2ab8['destroy']()[_0x023a('0x20')](function(){var _0x49c635=_0x1d2ab8[_0x023a('0x21')]({'plain':!![]});var _0x52914f='IvrCampaigns';return db['UserProfileResource']['destroy']({'where':{'type':_0x52914f,'resourceId':_0x49c635['id']}})[_0x023a('0x20')](function(){return _0x1d2ab8;});})['then'](function(){_0x1fb09f[_0x023a('0x15')](0xcc)[_0x023a('0x16')]();});}};}function handleEntityNotFound(_0x11e7a4,_0x3715ec){return function(_0x4b7cea){if(!_0x4b7cea){_0x11e7a4[_0x023a('0x14')](0x194);}return _0x4b7cea;};}function handleError(_0x59630c,_0x5a1c9e){_0x5a1c9e=_0x5a1c9e||0x1f4;return function(_0x3036d4){logger['error'](_0x3036d4['stack']);if(_0x3036d4[_0x023a('0x22')]){delete _0x3036d4[_0x023a('0x22')];}_0x59630c[_0x023a('0x15')](_0x5a1c9e)['send'](_0x3036d4);};}exports[_0x023a('0x23')]=function(_0x2089f6,_0xd83581){var _0x1aa324={},_0x521363={},_0x24738c={'count':0x0,'rows':[]};var _0x37e2cc=_[_0x023a('0x24')](db[_0x023a('0x25')]['rawAttributes'],function(_0x487750){return{'name':_0x487750[_0x023a('0x26')],'type':_0x487750[_0x023a('0x27')][_0x023a('0x28')]};});_0x521363['model']=_[_0x023a('0x24')](_0x37e2cc,_0x023a('0x22'));_0x521363[_0x023a('0x29')]=_['keys'](_0x2089f6[_0x023a('0x29')]);_0x521363[_0x023a('0x2a')]=_[_0x023a('0x2b')](_0x521363[_0x023a('0x2c')],_0x521363[_0x023a('0x29')]);_0x1aa324['attributes']=_[_0x023a('0x2b')](_0x521363[_0x023a('0x2c')],qs[_0x023a('0x2d')](_0x2089f6['query']['fields']));_0x1aa324[_0x023a('0x2e')]=_0x1aa324['attributes']['length']?_0x1aa324['attributes']:_0x521363['model'];if(!_0x2089f6[_0x023a('0x29')][_0x023a('0x2f')](_0x023a('0x30'))){_0x1aa324[_0x023a('0x1b')]=qs[_0x023a('0x1b')](_0x2089f6[_0x023a('0x29')][_0x023a('0x1b')]);_0x1aa324[_0x023a('0x18')]=qs[_0x023a('0x18')](_0x2089f6[_0x023a('0x29')][_0x023a('0x18')]);}_0x1aa324[_0x023a('0x31')]=qs[_0x023a('0x32')](_0x2089f6[_0x023a('0x29')]['sort']);_0x1aa324['where']=qs[_0x023a('0x2a')](_[_0x023a('0x33')](_0x2089f6['query'],_0x521363[_0x023a('0x2a')]),_0x37e2cc);if(_0x2089f6['query'][_0x023a('0x34')]){_0x1aa324[_0x023a('0x35')]=_[_0x023a('0x36')](_0x1aa324[_0x023a('0x35')],{'$or':_[_0x023a('0x24')](_0x37e2cc,function(_0x212a0c){if(_0x212a0c[_0x023a('0x27')]!=='VIRTUAL'){var _0x50fbcf={};_0x50fbcf[_0x212a0c[_0x023a('0x22')]]={'$like':'%'+_0x2089f6[_0x023a('0x29')][_0x023a('0x34')]+'%'};return _0x50fbcf;}})});}_0x1aa324=_[_0x023a('0x36')]({},_0x1aa324,_0x2089f6[_0x023a('0x37')]);var _0x2baa16={'where':_0x1aa324[_0x023a('0x35')]};return db[_0x023a('0x25')][_0x023a('0x1a')](_0x2baa16)[_0x023a('0x20')](function(_0x2f88f7){_0x24738c[_0x023a('0x1a')]=_0x2f88f7;if(_0x2089f6['query'][_0x023a('0x38')]){_0x1aa324[_0x023a('0x39')]=[{'all':!![]}];}return db['Campaign']['findAll'](_0x1aa324);})[_0x023a('0x20')](function(_0x13a90d){_0x24738c[_0x023a('0x3a')]=_0x13a90d;return _0x24738c;})[_0x023a('0x20')](respondWithFilteredResult(_0xd83581,_0x1aa324))[_0x023a('0x3b')](handleError(_0xd83581,null));};exports[_0x023a('0x3c')]=function(_0x28f703,_0x3c1605){var _0x445a16={'raw':![],'where':{'id':_0x28f703[_0x023a('0x3d')]['id']}},_0x1879b1={};_0x1879b1[_0x023a('0x2c')]=_[_0x023a('0x3e')](db[_0x023a('0x25')][_0x023a('0x3f')]);_0x1879b1[_0x023a('0x29')]=_[_0x023a('0x3e')](_0x28f703[_0x023a('0x29')]);_0x1879b1[_0x023a('0x2a')]=_[_0x023a('0x2b')](_0x1879b1[_0x023a('0x2c')],_0x1879b1[_0x023a('0x29')]);_0x445a16[_0x023a('0x2e')]=_['intersection'](_0x1879b1[_0x023a('0x2c')],qs[_0x023a('0x2d')](_0x28f703[_0x023a('0x29')][_0x023a('0x2d')]));_0x445a16['attributes']=_0x445a16['attributes'][_0x023a('0x40')]?_0x445a16[_0x023a('0x2e')]:_0x1879b1[_0x023a('0x2c')];if(_0x28f703[_0x023a('0x29')][_0x023a('0x38')]){_0x445a16[_0x023a('0x39')]=[{'all':!![]}];}_0x445a16=_['merge']({},_0x445a16,_0x28f703[_0x023a('0x37')]);return db[_0x023a('0x25')][_0x023a('0x41')](_0x445a16)[_0x023a('0x20')](handleEntityNotFound(_0x3c1605,null))[_0x023a('0x20')](respondWithResult(_0x3c1605,null))[_0x023a('0x3b')](handleError(_0x3c1605,null));};exports[_0x023a('0x42')]=function(_0x158f57,_0x260be5){return db[_0x023a('0x25')][_0x023a('0x42')](_0x158f57[_0x023a('0x43')],{})[_0x023a('0x20')](function(_0xc15ab6){var _0x388217=_0x158f57[_0x023a('0x44')]['get']({'plain':!![]});if(!_0x388217)throw new Error(_0x023a('0x45'));if(_0x388217['role']===_0x023a('0x44')){var _0x91d007=_0xc15ab6[_0x023a('0x21')]({'plain':!![]});var _0x3d47ee=_0x023a('0x46');return db['UserProfileSection'][_0x023a('0x41')]({'where':{'name':_0x3d47ee,'userProfileId':_0x388217['userProfileId']},'raw':!![]})[_0x023a('0x20')](function(_0x107954){if(_0x107954&&_0x107954[_0x023a('0x47')]===0x0){return db[_0x023a('0x48')][_0x023a('0x42')]({'name':_0x91d007[_0x023a('0x22')],'resourceId':_0x91d007['id'],'type':_0x107954[_0x023a('0x22')],'sectionId':_0x107954['id']},{})[_0x023a('0x20')](function(){return _0xc15ab6;});}else{return _0xc15ab6;}})['catch'](function(_0x4df6e8){logger[_0x023a('0x49')](_0x023a('0x4a'),_0x4df6e8);throw _0x4df6e8;});}return _0xc15ab6;})[_0x023a('0x20')](respondWithResult(_0x260be5,0xc9))[_0x023a('0x3b')](handleError(_0x260be5,null));};exports[_0x023a('0x4b')]=function(_0x472746,_0x26cdce){var _0x28e86b={'where':{'id':_0x472746[_0x023a('0x3d')]['id']}},_0x3b4e4c={};_0x3b4e4c[_0x023a('0x2c')]=_['keys'](db[_0x023a('0x25')][_0x023a('0x3f')]);_0x28e86b[_0x023a('0x2e')]=_[_0x023a('0x2b')](_0x3b4e4c[_0x023a('0x2c')],qs[_0x023a('0x2d')](_0x472746['query'][_0x023a('0x2d')]));_0x28e86b[_0x023a('0x2e')]=_0x28e86b[_0x023a('0x2e')]['length']?_0x28e86b['attributes']:_0x3b4e4c[_0x023a('0x2c')];if(_0x472746[_0x023a('0x29')][_0x023a('0x38')]){_0x28e86b['include']=[{'all':!![]}];}_0x28e86b=_['merge']({},_0x28e86b,_0x472746[_0x023a('0x37')]);return db[_0x023a('0x25')][_0x023a('0x41')](_0x28e86b)['then'](handleEntityNotFound(_0x26cdce,null))['then'](function(_0x4dd2bc){if(_0x4dd2bc){var _0x465d91=_0x4dd2bc[_0x023a('0x21')]({'plain':!![]});_0x465d91=qs[_0x023a('0x4c')](_0x465d91,['id',_0x023a('0x4d'),'updatedAt']);_0x472746[_0x023a('0x43')]=_[_0x023a('0x4c')](_0x472746[_0x023a('0x43')],['id',_0x023a('0x4d'),_0x023a('0x4e')]);return db[_0x023a('0x25')][_0x023a('0x42')](_[_0x023a('0x36')](_0x465d91,_0x472746[_0x023a('0x43')]),{'include':_0x472746[_0x023a('0x29')][_0x023a('0x38')]?[{'all':!![]}]:undefined})[_0x023a('0x20')](function(_0x180c64){var _0x1bc7aa=_0x472746[_0x023a('0x44')][_0x023a('0x21')]({'plain':!![]});if(!_0x1bc7aa)throw new Error(_0x023a('0x45'));if(_0x1bc7aa[_0x023a('0x4f')]===_0x023a('0x44')){var _0x32b3e1=_0x180c64[_0x023a('0x21')]({'plain':!![]});var _0x203cd7='IvrCampaigns';return db[_0x023a('0x50')]['find']({'where':{'name':_0x203cd7,'userProfileId':_0x1bc7aa[_0x023a('0x51')]},'raw':!![]})[_0x023a('0x20')](function(_0x108d7d){if(_0x108d7d&&_0x108d7d['autoAssociation']===0x0){return db[_0x023a('0x48')][_0x023a('0x42')]({'name':_0x32b3e1[_0x023a('0x22')],'resourceId':_0x32b3e1['id'],'type':_0x108d7d['name'],'sectionId':_0x108d7d['id']},{})[_0x023a('0x20')](function(){return _0x180c64;});}else{return _0x180c64;}})[_0x023a('0x3b')](function(_0x28c448){logger[_0x023a('0x49')](_0x023a('0x4a'),_0x28c448);throw _0x28c448;});}return _0x180c64;});}})['then'](respondWithResult(_0x26cdce,0xc9))[_0x023a('0x3b')](handleError(_0x26cdce,null));};exports[_0x023a('0x52')]=function(_0x14e893,_0xd1263d){if(_0x14e893[_0x023a('0x43')]['id']){delete _0x14e893[_0x023a('0x43')]['id'];}return db[_0x023a('0x25')][_0x023a('0x41')]({'where':{'id':_0x14e893[_0x023a('0x3d')]['id']}})['then'](handleEntityNotFound(_0xd1263d,null))[_0x023a('0x20')](saveUpdates(_0x14e893[_0x023a('0x43')],null))[_0x023a('0x20')](respondWithResult(_0xd1263d,null))[_0x023a('0x3b')](handleError(_0xd1263d,null));};exports['destroy']=function(_0x33764c,_0x3fe7cd){return db['Campaign']['find']({'where':{'id':_0x33764c['params']['id']}})[_0x023a('0x20')](handleEntityNotFound(_0x3fe7cd,null))[_0x023a('0x20')](removeEntity(_0x3fe7cd,null))[_0x023a('0x3b')](handleError(_0x3fe7cd,null));};exports[_0x023a('0x53')]=function(_0x2ef95b,_0x138025,_0x1b3875){var _0x5cc386={'raw':!![],'where':{}};var _0x1a9cab={};var _0x582401={'count':0x0,'rows':[]};return db[_0x023a('0x25')][_0x023a('0x54')]({'where':{'id':_0x2ef95b[_0x023a('0x3d')]['id']}})[_0x023a('0x20')](handleEntityNotFound(_0x138025,null))['then'](function(_0x222321){if(_0x222321){_0x1a9cab[_0x023a('0x2c')]=_[_0x023a('0x3e')](db[_0x023a('0x55')][_0x023a('0x3f')]);_0x1a9cab[_0x023a('0x29')]=_[_0x023a('0x3e')](_0x2ef95b[_0x023a('0x29')]);_0x1a9cab['filters']=_['intersection'](_0x1a9cab[_0x023a('0x2c')],_0x1a9cab[_0x023a('0x29')]);_0x5cc386[_0x023a('0x2e')]=_[_0x023a('0x2b')](_0x1a9cab[_0x023a('0x2c')],qs['fields'](_0x2ef95b[_0x023a('0x29')]['fields']));_0x5cc386[_0x023a('0x2e')]=_0x5cc386['attributes'][_0x023a('0x40')]?_0x5cc386[_0x023a('0x2e')]:_0x1a9cab['model'];if(!_0x2ef95b[_0x023a('0x29')]['hasOwnProperty'](_0x023a('0x30'))){_0x5cc386[_0x023a('0x1b')]=qs['limit'](_0x2ef95b[_0x023a('0x29')][_0x023a('0x1b')]);_0x5cc386[_0x023a('0x18')]=qs[_0x023a('0x18')](_0x2ef95b[_0x023a('0x29')][_0x023a('0x18')]);}_0x5cc386[_0x023a('0x31')]=qs[_0x023a('0x32')](_0x2ef95b['query'][_0x023a('0x32')]);_0x5cc386[_0x023a('0x35')]=qs[_0x023a('0x2a')](_[_0x023a('0x33')](_0x2ef95b[_0x023a('0x29')],_0x1a9cab[_0x023a('0x2a')]));_0x5cc386['where'][_0x023a('0x56')]=_0x222321['id'];if(_0x2ef95b['query'][_0x023a('0x34')]){_0x5cc386[_0x023a('0x35')]=_[_0x023a('0x36')](_0x5cc386['where'],{'$or':_[_0x023a('0x24')](_0x5cc386[_0x023a('0x2e')],function(_0x4af321){var _0x278e4c={};_0x278e4c[_0x4af321]={'$like':'%'+_0x2ef95b[_0x023a('0x29')][_0x023a('0x34')]+'%'};return _0x278e4c;})});}_0x5cc386=_[_0x023a('0x36')]({},_0x5cc386,_0x2ef95b['options']);return db[_0x023a('0x55')][_0x023a('0x1a')]({'where':_0x5cc386[_0x023a('0x35')]})[_0x023a('0x20')](function(_0x4b9f40){_0x582401['count']=_0x4b9f40;if(_0x2ef95b[_0x023a('0x29')][_0x023a('0x38')]){_0x5cc386[_0x023a('0x39')]=[{'all':!![]}];}return db[_0x023a('0x55')][_0x023a('0x57')](_0x5cc386);})[_0x023a('0x20')](function(_0x2410aa){_0x582401[_0x023a('0x3a')]=_0x2410aa;return _0x582401;});}})['then'](respondWithFilteredResult(_0x138025,_0x5cc386))[_0x023a('0x3b')](handleError(_0x138025,null));};exports[_0x023a('0x58')]=function(_0x58b392,_0x45d97c,_0x2fd100){var _0x256f0b={'raw':!![],'where':{}};var _0x494976={};var _0x1a730d={'count':0x0,'rows':[]};return db[_0x023a('0x25')][_0x023a('0x54')]({'where':{'id':_0x58b392[_0x023a('0x3d')]['id']}})[_0x023a('0x20')](handleEntityNotFound(_0x45d97c,null))[_0x023a('0x20')](function(_0x5679b2){if(_0x5679b2){_0x494976[_0x023a('0x2c')]=_[_0x023a('0x3e')](db[_0x023a('0x59')]['rawAttributes']);_0x494976['query']=_[_0x023a('0x3e')](_0x58b392['query']);_0x494976[_0x023a('0x2a')]=_['intersection'](_0x494976[_0x023a('0x2c')],_0x494976[_0x023a('0x29')]);_0x256f0b[_0x023a('0x2e')]=_[_0x023a('0x2b')](_0x494976[_0x023a('0x2c')],qs[_0x023a('0x2d')](_0x58b392[_0x023a('0x29')]['fields']));_0x256f0b[_0x023a('0x2e')]=_0x256f0b[_0x023a('0x2e')][_0x023a('0x40')]?_0x256f0b[_0x023a('0x2e')]:_0x494976[_0x023a('0x2c')];if(!_0x58b392['query'][_0x023a('0x2f')](_0x023a('0x30'))){_0x256f0b[_0x023a('0x1b')]=qs['limit'](_0x58b392[_0x023a('0x29')][_0x023a('0x1b')]);_0x256f0b[_0x023a('0x18')]=qs[_0x023a('0x18')](_0x58b392['query'][_0x023a('0x18')]);}_0x256f0b[_0x023a('0x31')]=qs['sort'](_0x58b392[_0x023a('0x29')][_0x023a('0x32')]);_0x256f0b[_0x023a('0x35')]=qs[_0x023a('0x2a')](_[_0x023a('0x33')](_0x58b392[_0x023a('0x29')],_0x494976[_0x023a('0x2a')]));_0x256f0b[_0x023a('0x35')][_0x023a('0x56')]=_0x5679b2['id'];if(_0x58b392[_0x023a('0x29')][_0x023a('0x34')]){_0x256f0b[_0x023a('0x35')]=_[_0x023a('0x36')](_0x256f0b[_0x023a('0x35')],{'$or':_['map'](_0x256f0b[_0x023a('0x2e')],function(_0x10e28a){var _0x4f1de7={};_0x4f1de7[_0x10e28a]={'$like':'%'+_0x58b392[_0x023a('0x29')]['filter']+'%'};return _0x4f1de7;})});}_0x256f0b=_[_0x023a('0x36')]({},_0x256f0b,_0x58b392['options']);return db[_0x023a('0x59')][_0x023a('0x1a')]({'where':_0x256f0b[_0x023a('0x35')]})['then'](function(_0x530394){_0x1a730d[_0x023a('0x1a')]=_0x530394;if(_0x58b392[_0x023a('0x29')][_0x023a('0x38')]){_0x256f0b[_0x023a('0x39')]=[{'all':!![]}];}return db[_0x023a('0x59')][_0x023a('0x57')](_0x256f0b);})['then'](function(_0x54a861){_0x1a730d['rows']=_0x54a861;return _0x1a730d;});}})[_0x023a('0x20')](respondWithFilteredResult(_0x45d97c,_0x256f0b))[_0x023a('0x3b')](handleError(_0x45d97c,null));};exports[_0x023a('0x5a')]=function(_0x30a9d,_0x26515d,_0x144a77){var _0x1d9363={'raw':!![],'where':{}};var _0x2f2cc7={};var _0x312343={'count':0x0,'rows':[]};return db['Campaign'][_0x023a('0x54')]({'where':{'id':_0x30a9d['params']['id']}})[_0x023a('0x20')](handleEntityNotFound(_0x26515d,null))[_0x023a('0x20')](function(_0x4ebc29){if(_0x4ebc29){_0x2f2cc7[_0x023a('0x2c')]=_[_0x023a('0x3e')](db[_0x023a('0x5b')][_0x023a('0x3f')]);_0x2f2cc7['query']=_[_0x023a('0x3e')](_0x30a9d[_0x023a('0x29')]);_0x2f2cc7[_0x023a('0x2a')]=_[_0x023a('0x2b')](_0x2f2cc7[_0x023a('0x2c')],_0x2f2cc7['query']);_0x1d9363[_0x023a('0x2e')]=_['intersection'](_0x2f2cc7[_0x023a('0x2c')],qs[_0x023a('0x2d')](_0x30a9d[_0x023a('0x29')][_0x023a('0x2d')]));_0x1d9363[_0x023a('0x2e')]=_0x1d9363[_0x023a('0x2e')][_0x023a('0x40')]?_0x1d9363[_0x023a('0x2e')]:_0x2f2cc7['model'];if(!_0x30a9d['query'][_0x023a('0x2f')](_0x023a('0x30'))){_0x1d9363[_0x023a('0x1b')]=qs[_0x023a('0x1b')](_0x30a9d[_0x023a('0x29')]['limit']);_0x1d9363[_0x023a('0x18')]=qs['offset'](_0x30a9d['query']['offset']);}_0x1d9363['order']=qs['sort'](_0x30a9d[_0x023a('0x29')]['sort']);_0x1d9363['where']=qs[_0x023a('0x2a')](_[_0x023a('0x33')](_0x30a9d['query'],_0x2f2cc7[_0x023a('0x2a')]));_0x1d9363[_0x023a('0x35')][_0x023a('0x56')]=_0x4ebc29['id'];if(_0x30a9d[_0x023a('0x29')]['filter']){_0x1d9363[_0x023a('0x35')]=_[_0x023a('0x36')](_0x1d9363['where'],{'$or':_[_0x023a('0x24')](_0x1d9363[_0x023a('0x2e')],function(_0x424a90){var _0xc00e0f={};_0xc00e0f[_0x424a90]={'$like':'%'+_0x30a9d[_0x023a('0x29')]['filter']+'%'};return _0xc00e0f;})});}_0x1d9363=_[_0x023a('0x36')]({},_0x1d9363,_0x30a9d[_0x023a('0x37')]);return db['CmHopperFinal'][_0x023a('0x1a')]({'where':_0x1d9363[_0x023a('0x35')]})[_0x023a('0x20')](function(_0x12901b){_0x312343[_0x023a('0x1a')]=_0x12901b;if(_0x30a9d[_0x023a('0x29')][_0x023a('0x38')]){_0x1d9363[_0x023a('0x39')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x023a('0x57')](_0x1d9363);})[_0x023a('0x20')](function(_0x3dd276){_0x312343[_0x023a('0x3a')]=_0x3dd276;return _0x312343;});}})[_0x023a('0x20')](respondWithFilteredResult(_0x26515d,_0x1d9363))[_0x023a('0x3b')](handleError(_0x26515d,null));};exports[_0x023a('0x5c')]=function(_0x4239c2,_0x4248e9,_0x32fe1c){var _0xdf9c6a={'raw':!![],'where':{}};var _0x3df86b={};var _0x46433d={'count':0x0,'rows':[]};return db[_0x023a('0x25')][_0x023a('0x54')]({'where':{'id':_0x4239c2['params']['id']}})['then'](handleEntityNotFound(_0x4248e9,null))[_0x023a('0x20')](function(_0xce97a5){if(_0xce97a5){_0x3df86b[_0x023a('0x2c')]=_['keys'](db[_0x023a('0x5d')][_0x023a('0x3f')]);_0x3df86b[_0x023a('0x29')]=_[_0x023a('0x3e')](_0x4239c2['query']);_0x3df86b[_0x023a('0x2a')]=_[_0x023a('0x2b')](_0x3df86b[_0x023a('0x2c')],_0x3df86b[_0x023a('0x29')]);_0xdf9c6a['attributes']=_['intersection'](_0x3df86b[_0x023a('0x2c')],qs[_0x023a('0x2d')](_0x4239c2[_0x023a('0x29')][_0x023a('0x2d')]));_0xdf9c6a[_0x023a('0x2e')]=_0xdf9c6a['attributes'][_0x023a('0x40')]?_0xdf9c6a['attributes']:_0x3df86b[_0x023a('0x2c')];if(!_0x4239c2['query'][_0x023a('0x2f')]('nolimit')){_0xdf9c6a[_0x023a('0x1b')]=qs[_0x023a('0x1b')](_0x4239c2[_0x023a('0x29')][_0x023a('0x1b')]);_0xdf9c6a[_0x023a('0x18')]=qs[_0x023a('0x18')](_0x4239c2[_0x023a('0x29')][_0x023a('0x18')]);}_0xdf9c6a['order']=qs[_0x023a('0x32')](_0x4239c2[_0x023a('0x29')][_0x023a('0x32')]);_0xdf9c6a[_0x023a('0x35')]=qs[_0x023a('0x2a')](_[_0x023a('0x33')](_0x4239c2[_0x023a('0x29')],_0x3df86b['filters']));_0xdf9c6a['where'][_0x023a('0x56')]=_0xce97a5['id'];if(_0x4239c2[_0x023a('0x29')][_0x023a('0x34')]){_0xdf9c6a[_0x023a('0x35')]=_[_0x023a('0x36')](_0xdf9c6a[_0x023a('0x35')],{'$or':_['map'](_0xdf9c6a['attributes'],function(_0x55e2f8){var _0x29485a={};_0x29485a[_0x55e2f8]={'$like':'%'+_0x4239c2[_0x023a('0x29')]['filter']+'%'};return _0x29485a;})});}_0xdf9c6a=_[_0x023a('0x36')]({},_0xdf9c6a,_0x4239c2[_0x023a('0x37')]);return db[_0x023a('0x5d')][_0x023a('0x1a')]({'where':_0xdf9c6a[_0x023a('0x35')]})[_0x023a('0x20')](function(_0x2a4cf4){_0x46433d['count']=_0x2a4cf4;if(_0x4239c2[_0x023a('0x29')]['includeAll']){_0xdf9c6a[_0x023a('0x39')]=[{'all':!![]}];}return db[_0x023a('0x5d')][_0x023a('0x57')](_0xdf9c6a);})['then'](function(_0x4fb451){_0x46433d[_0x023a('0x3a')]=_0x4fb451;return _0x46433d;});}})[_0x023a('0x20')](respondWithFilteredResult(_0x4248e9,_0xdf9c6a))[_0x023a('0x3b')](handleError(_0x4248e9,null));};exports[_0x023a('0x5e')]=function(_0x30f940,_0x2b636b,_0x30b51f){var _0x2fce34={};var _0x14879c={};var _0x7f4ae4;var _0x47a25d;return db[_0x023a('0x25')][_0x023a('0x54')]({'where':{'id':_0x30f940[_0x023a('0x3d')]['id']}})['then'](handleEntityNotFound(_0x2b636b,null))['then'](function(_0x503f20){if(_0x503f20){_0x7f4ae4=_0x503f20;_0x14879c[_0x023a('0x2c')]=_[_0x023a('0x3e')](db['CmList'][_0x023a('0x3f')]);_0x14879c[_0x023a('0x29')]=_[_0x023a('0x3e')](_0x30f940[_0x023a('0x29')]);_0x14879c[_0x023a('0x2a')]=_[_0x023a('0x2b')](_0x14879c[_0x023a('0x2c')],_0x14879c[_0x023a('0x29')]);_0x2fce34['attributes']=_['intersection'](_0x14879c[_0x023a('0x2c')],qs[_0x023a('0x2d')](_0x30f940[_0x023a('0x29')][_0x023a('0x2d')]));_0x2fce34[_0x023a('0x2e')]=_0x2fce34[_0x023a('0x2e')][_0x023a('0x40')]?_0x2fce34[_0x023a('0x2e')]:_0x14879c[_0x023a('0x2c')];_0x2fce34['order']=qs[_0x023a('0x32')](_0x30f940[_0x023a('0x29')]['sort']);_0x2fce34[_0x023a('0x35')]=qs[_0x023a('0x2a')](_[_0x023a('0x33')](_0x30f940[_0x023a('0x29')],_0x14879c[_0x023a('0x2a')]));if(_0x30f940[_0x023a('0x29')]['filter']){_0x2fce34[_0x023a('0x35')]=_[_0x023a('0x36')](_0x2fce34[_0x023a('0x35')],{'$or':_['map'](_0x2fce34[_0x023a('0x2e')],function(_0x2594a7){var _0x35cc31={};_0x35cc31[_0x2594a7]={'$like':'%'+_0x30f940[_0x023a('0x29')][_0x023a('0x34')]+'%'};return _0x35cc31;})});}_0x2fce34=_[_0x023a('0x36')]({},_0x2fce34,_0x30f940['options']);return _0x7f4ae4['getLists'](_0x2fce34);}})['then'](function(_0xa3840){if(_0xa3840){_0x47a25d=_0xa3840['length'];if(!_0x30f940[_0x023a('0x29')][_0x023a('0x2f')](_0x023a('0x30'))){_0x2fce34[_0x023a('0x1b')]=qs[_0x023a('0x1b')](_0x30f940[_0x023a('0x29')]['limit']);_0x2fce34[_0x023a('0x18')]=qs[_0x023a('0x18')](_0x30f940[_0x023a('0x29')][_0x023a('0x18')]);}return _0x7f4ae4['getLists'](_0x2fce34);}})[_0x023a('0x20')](function(_0x15250c){if(_0x15250c){return _0x15250c?{'count':_0x47a25d,'rows':_0x15250c}:null;}})[_0x023a('0x20')](respondWithResult(_0x2b636b,null))[_0x023a('0x3b')](handleError(_0x2b636b,null));};exports['addLists']=function(_0x305df9,_0x276a25,_0x16eb19){var _0x2110cd,_0x157424;return db['Campaign'][_0x023a('0x41')]({'where':{'id':_0x305df9[_0x023a('0x3d')]['id']}})[_0x023a('0x20')](handleEntityNotFound(_0x276a25,null))[_0x023a('0x20')](function(_0x2e90cc){if(_0x2e90cc){_0x157424=_0x2e90cc;return _0x2e90cc[_0x023a('0x5f')](_0x305df9['body']['ids'],_['omit'](_0x305df9[_0x023a('0x43')],[_0x023a('0x60'),'id'])||{});}return null;})[_0x023a('0x61')](function(_0x4f4381){var _0x2e5286;_0x2110cd=_0x4f4381||[];var _0x4d1dfa=[];if(_0x4f4381){for(var _0xb42d07=0x0;_0xb42d07<_0x4f4381['length'];_0xb42d07+=0x1){var _0x29b1a7=_0x4f4381[_0xb42d07][_0x023a('0x21')]({'plain':!![]});_0x157424['dialCheckDuplicateType']=_0x305df9[_0x023a('0x43')][_0x023a('0x62')]?_0x305df9['body'][_0x023a('0x62')]:_0x157424['dialCheckDuplicateType'];switch(_0x157424[_0x023a('0x62')]){case _0x023a('0x63'):_0x2e5286=squel['insert']()[_0x023a('0x64')](_0x023a('0x65'))[_0x023a('0x66')]([_0x023a('0x67'),'scheduledAt','ContactId',_0x023a('0x68'),_0x023a('0x56'),'createdAt',_0x023a('0x4e')],squel[_0x023a('0x69')]()['field']('phone','phone')['field'](_0x023a('0x6a'),'scheduledAt')[_0x023a('0x6b')]('id',_0x023a('0x6c'))['field'](_0x29b1a7[_0x023a('0x6d')][_0x023a('0x6e')](),_0x023a('0x68'))[_0x023a('0x6b')](_0x305df9['params']['id'][_0x023a('0x6e')](),_0x023a('0x56'))[_0x023a('0x6b')]('NOW()','createdAt')['field'](_0x023a('0x6a'),_0x023a('0x4e'))[_0x023a('0x6f')](_0x023a('0x70'))[_0x023a('0x35')](_0x023a('0x71'))[_0x023a('0x35')](_0x023a('0x72'),_0x29b1a7[_0x023a('0x6d')]['toString']())['where']('phone\x20IS\x20NOT\x20NULL')[_0x023a('0x35')]('phone\x20NOT\x20IN\x20(?)',squel[_0x023a('0x69')]()['field'](_0x023a('0x73'))[_0x023a('0x6f')](_0x023a('0x74'))['where'](_0x023a('0x75'),_0x305df9[_0x023a('0x3d')]['id'][_0x023a('0x6e')]()))[_0x023a('0x35')]('phone\x20NOT\x20IN\x20(?)',squel[_0x023a('0x69')]()[_0x023a('0x6b')](_0x023a('0x76'))[_0x023a('0x6f')](_0x023a('0x65'))[_0x023a('0x35')](_0x023a('0x75'),_0x305df9[_0x023a('0x3d')]['id']['toString']())))[_0x023a('0x6e')]();break;case _0x023a('0x77'):_0x2e5286=squel['insert']()[_0x023a('0x64')]('cm_hopper')[_0x023a('0x66')](['phone','scheduledAt',_0x023a('0x6c'),_0x023a('0x68'),_0x023a('0x56'),_0x023a('0x4d'),_0x023a('0x4e')],squel[_0x023a('0x69')]()[_0x023a('0x6b')]('phone',_0x023a('0x67'))[_0x023a('0x6b')](_0x023a('0x6a'),_0x023a('0x78'))[_0x023a('0x6b')]('id',_0x023a('0x6c'))[_0x023a('0x6b')](_0x29b1a7['CmListId'][_0x023a('0x6e')](),_0x023a('0x68'))[_0x023a('0x6b')](_0x305df9['params']['id'][_0x023a('0x6e')](),_0x023a('0x56'))[_0x023a('0x6b')](_0x023a('0x6a'),'createdAt')[_0x023a('0x6b')]('NOW()','updatedAt')['from']('cm_contacts')['where'](_0x023a('0x71'))['where'](_0x023a('0x72'),_0x29b1a7[_0x023a('0x6d')][_0x023a('0x6e')]())[_0x023a('0x35')](_0x023a('0x79'))[_0x023a('0x35')]('phone\x20NOT\x20IN\x20(?)',squel[_0x023a('0x69')]()['field'](_0x023a('0x76'))[_0x023a('0x6f')]('cm_hopper')[_0x023a('0x35')](_0x023a('0x75'),_0x305df9[_0x023a('0x3d')]['id']['toString']())))[_0x023a('0x6e')]();break;default:_0x2e5286=squel['insert']()[_0x023a('0x64')](_0x023a('0x65'))['fromQuery'](['phone','scheduledAt','ContactId',_0x023a('0x68'),_0x023a('0x56'),_0x023a('0x4d'),_0x023a('0x4e')],squel[_0x023a('0x69')]()[_0x023a('0x6b')](_0x023a('0x67'),_0x023a('0x67'))[_0x023a('0x6b')]('NOW()',_0x023a('0x78'))[_0x023a('0x6b')]('id',_0x023a('0x6c'))['field'](_0x29b1a7[_0x023a('0x6d')][_0x023a('0x6e')](),_0x023a('0x68'))[_0x023a('0x6b')](_0x305df9[_0x023a('0x3d')]['id'][_0x023a('0x6e')](),_0x023a('0x56'))[_0x023a('0x6b')](_0x023a('0x6a'),_0x023a('0x4d'))['field'](_0x023a('0x6a'),_0x023a('0x4e'))[_0x023a('0x6f')]('cm_contacts')[_0x023a('0x35')](_0x023a('0x71'))['where'](_0x023a('0x72'),_0x29b1a7[_0x023a('0x6d')]['toString']())[_0x023a('0x35')]('phone\x20IS\x20NOT\x20NULL'))[_0x023a('0x6e')]();}_0x4d1dfa[_0x023a('0x7a')](db['sequelize'][_0x023a('0x29')](_0x2e5286));}return BPromise[_0x023a('0x7b')](_0x4d1dfa);}})[_0x023a('0x20')](function(){return _0x2110cd;})[_0x023a('0x20')](respondWithResult(_0x276a25,null))['catch'](handleError(_0x276a25,null));};exports['removeLists']=function(_0x1f3503,_0x5baa2e,_0x3698fc){return db['Campaign'][_0x023a('0x41')]({'where':{'id':_0x1f3503[_0x023a('0x3d')]['id']}})[_0x023a('0x20')](handleEntityNotFound(_0x5baa2e,null))[_0x023a('0x20')](function(_0xbc9a6f){if(_0xbc9a6f){return _0xbc9a6f[_0x023a('0x7c')](_0x1f3503['query'][_0x023a('0x60')]);}})[_0x023a('0x20')](function(_0x48633f){if(_0x48633f){return db['CmHopper'][_0x023a('0x7d')]({'where':{'ListId':_0x1f3503[_0x023a('0x29')][_0x023a('0x60')],'CampaignId':_0x1f3503[_0x023a('0x3d')]['id']}})[_0x023a('0x20')](function(){return _0x48633f;});}})['then'](respondWithStatusCode(_0x5baa2e,null))['catch'](handleError(_0x5baa2e,null));};exports[_0x023a('0x7e')]=function(_0x526773,_0x2daf15,_0x47309a){var _0x2bc2cb={};var _0x4bce13={};var _0x311320;var _0x294fa0;return db[_0x023a('0x25')][_0x023a('0x54')]({'where':{'id':_0x526773[_0x023a('0x3d')]['id']}})[_0x023a('0x20')](handleEntityNotFound(_0x2daf15,null))[_0x023a('0x20')](function(_0x5a1819){if(_0x5a1819){_0x311320=_0x5a1819;_0x4bce13[_0x023a('0x2c')]=_['keys'](db[_0x023a('0x7f')]['rawAttributes']);_0x4bce13[_0x023a('0x29')]=_[_0x023a('0x3e')](_0x526773[_0x023a('0x29')]);_0x4bce13[_0x023a('0x2a')]=_[_0x023a('0x2b')](_0x4bce13[_0x023a('0x2c')],_0x4bce13[_0x023a('0x29')]);_0x2bc2cb[_0x023a('0x2e')]=_[_0x023a('0x2b')](_0x4bce13[_0x023a('0x2c')],qs[_0x023a('0x2d')](_0x526773[_0x023a('0x29')][_0x023a('0x2d')]));_0x2bc2cb[_0x023a('0x2e')]=_0x2bc2cb['attributes'][_0x023a('0x40')]?_0x2bc2cb[_0x023a('0x2e')]:_0x4bce13[_0x023a('0x2c')];_0x2bc2cb[_0x023a('0x31')]=qs[_0x023a('0x32')](_0x526773[_0x023a('0x29')][_0x023a('0x32')]);_0x2bc2cb[_0x023a('0x35')]=qs['filters'](_[_0x023a('0x33')](_0x526773[_0x023a('0x29')],_0x4bce13[_0x023a('0x2a')]));if(_0x526773[_0x023a('0x29')][_0x023a('0x34')]){_0x2bc2cb[_0x023a('0x35')]=_[_0x023a('0x36')](_0x2bc2cb['where'],{'$or':_['map'](_0x2bc2cb['attributes'],function(_0xa1c1e5){var _0x2d52fb={};_0x2d52fb[_0xa1c1e5]={'$like':'%'+_0x526773[_0x023a('0x29')][_0x023a('0x34')]+'%'};return _0x2d52fb;})});}_0x2bc2cb=_[_0x023a('0x36')]({},_0x2bc2cb,_0x526773[_0x023a('0x37')]);return _0x311320[_0x023a('0x7e')](_0x2bc2cb);}})['then'](function(_0x11ed38){if(_0x11ed38){_0x294fa0=_0x11ed38[_0x023a('0x40')];if(!_0x526773['query']['hasOwnProperty'](_0x023a('0x30'))){_0x2bc2cb['limit']=qs[_0x023a('0x1b')](_0x526773[_0x023a('0x29')][_0x023a('0x1b')]);_0x2bc2cb[_0x023a('0x18')]=qs[_0x023a('0x18')](_0x526773[_0x023a('0x29')]['offset']);}return _0x311320[_0x023a('0x7e')](_0x2bc2cb);}})[_0x023a('0x20')](function(_0x5760cc){if(_0x5760cc){return _0x5760cc?{'count':_0x294fa0,'rows':_0x5760cc}:null;}})[_0x023a('0x20')](respondWithResult(_0x2daf15,null))[_0x023a('0x3b')](handleError(_0x2daf15,null));};exports[_0x023a('0x80')]=function(_0x1b7a57,_0x323539,_0x2c3c8f){var _0x18478f,_0x3f567d;return db[_0x023a('0x25')]['find']({'where':{'id':_0x1b7a57[_0x023a('0x3d')]['id']}})['then'](handleEntityNotFound(_0x323539,null))[_0x023a('0x20')](function(_0x583530){if(_0x583530){_0x3f567d=_0x583530;return _0x583530[_0x023a('0x80')](_0x1b7a57[_0x023a('0x43')][_0x023a('0x60')],_[_0x023a('0x4c')](_0x1b7a57['body'],['ids','id'])||{});}return null;})[_0x023a('0x61')](function(_0xc95d55){var _0x38b1d9;_0x18478f=_0xc95d55||[];var _0x4c4b2c=[];if(_0xc95d55){for(var _0x35174a=0x0;_0x35174a<_0xc95d55[_0x023a('0x40')];_0x35174a+=0x1){var _0x1ad936=_0xc95d55[_0x35174a][_0x023a('0x21')]({'plain':!![]});_0x38b1d9=squel['insert']()[_0x023a('0x64')]('cm_hopper_black')['fromQuery']([_0x023a('0x67'),_0x023a('0x6c'),_0x023a('0x68'),_0x023a('0x56'),'createdAt',_0x023a('0x4e')],squel[_0x023a('0x69')]()[_0x023a('0x6b')](_0x023a('0x67'),_0x023a('0x67'))[_0x023a('0x6b')]('id',_0x023a('0x6c'))[_0x023a('0x6b')](_0x1ad936[_0x023a('0x6d')][_0x023a('0x6e')](),'ListId')['field'](_0x1b7a57[_0x023a('0x3d')]['id']['toString'](),_0x023a('0x56'))['field'](_0x023a('0x6a'),'createdAt')[_0x023a('0x6b')](_0x023a('0x6a'),_0x023a('0x4e'))[_0x023a('0x6f')](_0x023a('0x70'))[_0x023a('0x35')](_0x023a('0x71'))[_0x023a('0x35')](_0x023a('0x72'),_0x1ad936[_0x023a('0x6d')]['toString']())[_0x023a('0x35')](_0x023a('0x79')))[_0x023a('0x6e')]();_0x4c4b2c[_0x023a('0x7a')](db[_0x023a('0x81')]['query'](_0x38b1d9));}return BPromise[_0x023a('0x7b')](_0x4c4b2c);}})[_0x023a('0x20')](function(){return _0x18478f;})[_0x023a('0x20')](respondWithResult(_0x323539,null))[_0x023a('0x3b')](handleError(_0x323539,null));};exports[_0x023a('0x82')]=function(_0x443a4c,_0x3bd443,_0x3b1763){return db[_0x023a('0x25')]['find']({'where':{'id':_0x443a4c[_0x023a('0x3d')]['id']}})[_0x023a('0x20')](handleEntityNotFound(_0x3bd443,null))[_0x023a('0x20')](function(_0x9d16f7){if(_0x9d16f7){return _0x9d16f7[_0x023a('0x82')](_0x443a4c[_0x023a('0x29')][_0x023a('0x60')]);}})[_0x023a('0x20')](function(_0x178b7c){if(_0x178b7c){return db[_0x023a('0x5d')][_0x023a('0x7d')]({'where':{'ListId':_0x443a4c[_0x023a('0x29')][_0x023a('0x60')],'CampaignId':_0x443a4c[_0x023a('0x3d')]['id']}})['then'](function(){return _0x178b7c;});}})[_0x023a('0x20')](respondWithStatusCode(_0x3bd443,null))[_0x023a('0x3b')](handleError(_0x3bd443,null));}; \ No newline at end of file +var _0xd1e7=['key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','pick','where','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','clone','find','omit','createdAt','updatedAt','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','getHoppers','findOne','CmHopper','nolimit','CampaignId','filter','getHopperHistories','CmHopperHistory','CmHopperFinal','CmHopperBlack','CmList','addLists','ids','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','scheduledAt','ListId','select','field','phone','NOW()','ContactId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','push','sequelize','all','removeLists','getBlackLists','addBlackLists','spread','removeBlackLists','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','apply','reject','save','then','destroy','IvrCampaigns','UserProfileResource','end','error','stack','name','send','index','map','Campaign','fieldName','type'];(function(_0x273c39,_0x1052e6){var _0x46d6b5=function(_0x44f1fb){while(--_0x44f1fb){_0x273c39['push'](_0x273c39['shift']());}};_0x46d6b5(++_0x1052e6);}(_0xd1e7,0x1ee));var _0x7d1e=function(_0x2fc9d4,_0x14719f){_0x2fc9d4=_0x2fc9d4-0x0;var _0x1eff4b=_0xd1e7[_0x2fc9d4];return _0x1eff4b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7d1e('0x0'));var zipdir=require(_0x7d1e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7d1e('0x2'));var moment=require(_0x7d1e('0x3'));var BPromise=require(_0x7d1e('0x4'));var Mustache=require(_0x7d1e('0x5'));var util=require(_0x7d1e('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x7d1e('0x7'));var ejs=require(_0x7d1e('0x8'));var fs=require('fs');var fs_extra=require(_0x7d1e('0x9'));var _=require(_0x7d1e('0xa'));var squel=require(_0x7d1e('0xb'));var crypto=require(_0x7d1e('0xc'));var jsforce=require(_0x7d1e('0xd'));var deskjs=require(_0x7d1e('0xe'));var toCsv=require(_0x7d1e('0x7'));var querystring=require(_0x7d1e('0xf'));var Papa=require(_0x7d1e('0x10'));var Redis=require(_0x7d1e('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x7d1e('0x12'));var as=require(_0x7d1e('0x13'));var hardwareService=require(_0x7d1e('0x14'));var logger=require(_0x7d1e('0x15'))(_0x7d1e('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7d1e('0x17'));var db=require(_0x7d1e('0x18'))['db'];function respondWithStatusCode(_0x26a589,_0x31b8e6){_0x31b8e6=_0x31b8e6||0xcc;return function(_0x57776a){if(_0x57776a){return _0x26a589[_0x7d1e('0x19')](_0x31b8e6);}return _0x26a589[_0x7d1e('0x1a')](_0x31b8e6)['end']();};}function respondWithResult(_0xc7b55e,_0xf740c4){_0xf740c4=_0xf740c4||0xc8;return function(_0x4a9ea){if(_0x4a9ea){return _0xc7b55e['status'](_0xf740c4)[_0x7d1e('0x1b')](_0x4a9ea);}};}function respondWithFilteredResult(_0x4fb9c3,_0x1404ac){return function(_0x384a51){if(_0x384a51){var _0x1e9e77=typeof _0x1404ac['offset']===_0x7d1e('0x1c')&&typeof _0x1404ac['limit']==='undefined';var _0xcc0868=_0x384a51[_0x7d1e('0x1d')];var _0x1861a3=_0x1e9e77?0x0:_0x1404ac[_0x7d1e('0x1e')];var _0x14b044=_0x1e9e77?_0x384a51[_0x7d1e('0x1d')]:_0x1404ac[_0x7d1e('0x1e')]+_0x1404ac[_0x7d1e('0x1f')];var _0x518db8;if(_0x14b044>=_0xcc0868){_0x14b044=_0xcc0868;_0x518db8=0xc8;}else{_0x518db8=0xce;}_0x4fb9c3['status'](_0x518db8);return _0x4fb9c3[_0x7d1e('0x20')]('Content-Range',_0x1861a3+'-'+_0x14b044+'/'+_0xcc0868)['json'](_0x384a51);}return null;};}function patchUpdates(_0x25a691){return function(_0x2cb5ec){try{jsonpatch[_0x7d1e('0x21')](_0x2cb5ec,_0x25a691,!![]);}catch(_0xf065e){return BPromise[_0x7d1e('0x22')](_0xf065e);}return _0x2cb5ec[_0x7d1e('0x23')]();};}function saveUpdates(_0x189427,_0x1392ab){return function(_0x5aba8b){if(_0x5aba8b){return _0x5aba8b['update'](_0x189427)[_0x7d1e('0x24')](function(_0x33c9b1){return _0x33c9b1;});}return null;};}function removeEntity(_0x2c8836,_0x573f1a){return function(_0x4fbc16){if(_0x4fbc16){return _0x4fbc16[_0x7d1e('0x25')]()[_0x7d1e('0x24')](function(){var _0x3abf36=_0x4fbc16['get']({'plain':!![]});var _0x524c00=_0x7d1e('0x26');return db[_0x7d1e('0x27')][_0x7d1e('0x25')]({'where':{'type':_0x524c00,'resourceId':_0x3abf36['id']}})[_0x7d1e('0x24')](function(){return _0x4fbc16;});})[_0x7d1e('0x24')](function(){_0x2c8836[_0x7d1e('0x1a')](0xcc)[_0x7d1e('0x28')]();});}};}function handleEntityNotFound(_0xdfc49e,_0x3d0ecd){return function(_0x124037){if(!_0x124037){_0xdfc49e[_0x7d1e('0x19')](0x194);}return _0x124037;};}function handleError(_0x4cefde,_0x36b982){_0x36b982=_0x36b982||0x1f4;return function(_0x206779){logger[_0x7d1e('0x29')](_0x206779[_0x7d1e('0x2a')]);if(_0x206779['name']){delete _0x206779[_0x7d1e('0x2b')];}_0x4cefde[_0x7d1e('0x1a')](_0x36b982)[_0x7d1e('0x2c')](_0x206779);};}exports[_0x7d1e('0x2d')]=function(_0x2cf4dc,_0x2a5bb7){var _0x3f99b={},_0x51265e={},_0x2d7e03={'count':0x0,'rows':[]};var _0xb853ff=_[_0x7d1e('0x2e')](db[_0x7d1e('0x2f')]['rawAttributes'],function(_0xc9e0dc){return{'name':_0xc9e0dc[_0x7d1e('0x30')],'type':_0xc9e0dc[_0x7d1e('0x31')][_0x7d1e('0x32')]};});_0x51265e['model']=_[_0x7d1e('0x2e')](_0xb853ff,'name');_0x51265e[_0x7d1e('0x33')]=_[_0x7d1e('0x34')](_0x2cf4dc[_0x7d1e('0x33')]);_0x51265e[_0x7d1e('0x35')]=_[_0x7d1e('0x36')](_0x51265e[_0x7d1e('0x37')],_0x51265e[_0x7d1e('0x33')]);_0x3f99b['attributes']=_[_0x7d1e('0x36')](_0x51265e[_0x7d1e('0x37')],qs[_0x7d1e('0x38')](_0x2cf4dc[_0x7d1e('0x33')]['fields']));_0x3f99b[_0x7d1e('0x39')]=_0x3f99b[_0x7d1e('0x39')][_0x7d1e('0x3a')]?_0x3f99b[_0x7d1e('0x39')]:_0x51265e[_0x7d1e('0x37')];if(!_0x2cf4dc[_0x7d1e('0x33')][_0x7d1e('0x3b')]('nolimit')){_0x3f99b[_0x7d1e('0x1f')]=qs[_0x7d1e('0x1f')](_0x2cf4dc['query'][_0x7d1e('0x1f')]);_0x3f99b['offset']=qs['offset'](_0x2cf4dc[_0x7d1e('0x33')][_0x7d1e('0x1e')]);}_0x3f99b[_0x7d1e('0x3c')]=qs['sort'](_0x2cf4dc[_0x7d1e('0x33')][_0x7d1e('0x3d')]);_0x3f99b['where']=qs[_0x7d1e('0x35')](_[_0x7d1e('0x3e')](_0x2cf4dc[_0x7d1e('0x33')],_0x51265e['filters']),_0xb853ff);if(_0x2cf4dc[_0x7d1e('0x33')]['filter']){_0x3f99b[_0x7d1e('0x3f')]=_[_0x7d1e('0x40')](_0x3f99b['where'],{'$or':_[_0x7d1e('0x2e')](_0xb853ff,function(_0x361aa0){if(_0x361aa0[_0x7d1e('0x31')]!=='VIRTUAL'){var _0x3e2f71={};_0x3e2f71[_0x361aa0[_0x7d1e('0x2b')]]={'$like':'%'+_0x2cf4dc[_0x7d1e('0x33')]['filter']+'%'};return _0x3e2f71;}})});}_0x3f99b=_[_0x7d1e('0x40')]({},_0x3f99b,_0x2cf4dc[_0x7d1e('0x41')]);var _0x135953={'where':_0x3f99b[_0x7d1e('0x3f')]};return db[_0x7d1e('0x2f')][_0x7d1e('0x1d')](_0x135953)['then'](function(_0x12c67d){_0x2d7e03[_0x7d1e('0x1d')]=_0x12c67d;if(_0x2cf4dc[_0x7d1e('0x33')][_0x7d1e('0x42')]){_0x3f99b[_0x7d1e('0x43')]=[{'all':!![]}];}return db[_0x7d1e('0x2f')][_0x7d1e('0x44')](_0x3f99b);})[_0x7d1e('0x24')](function(_0x823b3){_0x2d7e03[_0x7d1e('0x45')]=_0x823b3;return _0x2d7e03;})[_0x7d1e('0x24')](respondWithFilteredResult(_0x2a5bb7,_0x3f99b))[_0x7d1e('0x46')](handleError(_0x2a5bb7,null));};exports[_0x7d1e('0x47')]=function(_0xdde30f,_0x24eadc){var _0xcfe0d4={'raw':![],'where':{'id':_0xdde30f[_0x7d1e('0x48')]['id']}},_0x2bcf2e={};_0x2bcf2e[_0x7d1e('0x37')]=_['keys'](db['Campaign'][_0x7d1e('0x49')]);_0x2bcf2e[_0x7d1e('0x33')]=_['keys'](_0xdde30f['query']);_0x2bcf2e[_0x7d1e('0x35')]=_[_0x7d1e('0x36')](_0x2bcf2e[_0x7d1e('0x37')],_0x2bcf2e['query']);_0xcfe0d4['attributes']=_['intersection'](_0x2bcf2e[_0x7d1e('0x37')],qs[_0x7d1e('0x38')](_0xdde30f['query'][_0x7d1e('0x38')]));_0xcfe0d4[_0x7d1e('0x39')]=_0xcfe0d4[_0x7d1e('0x39')]['length']?_0xcfe0d4[_0x7d1e('0x39')]:_0x2bcf2e['model'];if(_0xdde30f['query']['includeAll']){_0xcfe0d4[_0x7d1e('0x43')]=[{'all':!![]}];}_0xcfe0d4=_[_0x7d1e('0x40')]({},_0xcfe0d4,_0xdde30f[_0x7d1e('0x41')]);return db[_0x7d1e('0x2f')]['find'](_0xcfe0d4)[_0x7d1e('0x24')](handleEntityNotFound(_0x24eadc,null))[_0x7d1e('0x24')](respondWithResult(_0x24eadc,null))[_0x7d1e('0x46')](handleError(_0x24eadc,null));};exports['create']=function(_0xd256e5,_0x14f008){return db[_0x7d1e('0x2f')][_0x7d1e('0x4a')](_0xd256e5[_0x7d1e('0x4b')],{})['then'](function(_0x530214){var _0xf860ef=_0xd256e5[_0x7d1e('0x4c')][_0x7d1e('0x4d')]({'plain':!![]});if(!_0xf860ef)throw new Error(_0x7d1e('0x4e'));if(_0xf860ef[_0x7d1e('0x4f')]===_0x7d1e('0x4c')){var _0x34b641=_0x530214[_0x7d1e('0x4d')]({'plain':!![]});var _0x446b82=_0x7d1e('0x26');return db[_0x7d1e('0x50')]['find']({'where':{'name':_0x446b82,'userProfileId':_0xf860ef[_0x7d1e('0x51')]},'raw':!![]})[_0x7d1e('0x24')](function(_0x1bc8f6){if(_0x1bc8f6&&_0x1bc8f6[_0x7d1e('0x52')]===0x0){return db[_0x7d1e('0x27')]['create']({'name':_0x34b641[_0x7d1e('0x2b')],'resourceId':_0x34b641['id'],'type':_0x1bc8f6[_0x7d1e('0x2b')],'sectionId':_0x1bc8f6['id']},{})[_0x7d1e('0x24')](function(){return _0x530214;});}else{return _0x530214;}})[_0x7d1e('0x46')](function(_0x38690a){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x38690a);throw _0x38690a;});}return _0x530214;})[_0x7d1e('0x24')](respondWithResult(_0x14f008,0xc9))['catch'](handleError(_0x14f008,null));};exports[_0x7d1e('0x53')]=function(_0x3f9a68,_0x211867){var _0x233512={'where':{'id':_0x3f9a68[_0x7d1e('0x48')]['id']}},_0x4361ee={};_0x4361ee[_0x7d1e('0x37')]=_['keys'](db[_0x7d1e('0x2f')][_0x7d1e('0x49')]);_0x233512['attributes']=_[_0x7d1e('0x36')](_0x4361ee[_0x7d1e('0x37')],qs[_0x7d1e('0x38')](_0x3f9a68['query'][_0x7d1e('0x38')]));_0x233512[_0x7d1e('0x39')]=_0x233512[_0x7d1e('0x39')]['length']?_0x233512['attributes']:_0x4361ee[_0x7d1e('0x37')];if(_0x3f9a68[_0x7d1e('0x33')]['includeAll']){_0x233512[_0x7d1e('0x43')]=[{'all':!![]}];}_0x233512=_[_0x7d1e('0x40')]({},_0x233512,_0x3f9a68[_0x7d1e('0x41')]);return db[_0x7d1e('0x2f')][_0x7d1e('0x54')](_0x233512)[_0x7d1e('0x24')](handleEntityNotFound(_0x211867,null))['then'](function(_0x2fc02f){if(_0x2fc02f){var _0x42007c=_0x2fc02f[_0x7d1e('0x4d')]({'plain':!![]});_0x42007c=qs[_0x7d1e('0x55')](_0x42007c,['id',_0x7d1e('0x56'),_0x7d1e('0x57')]);_0x3f9a68[_0x7d1e('0x4b')]=_[_0x7d1e('0x55')](_0x3f9a68[_0x7d1e('0x4b')],['id','createdAt','updatedAt']);return db[_0x7d1e('0x2f')]['create'](_[_0x7d1e('0x40')](_0x42007c,_0x3f9a68[_0x7d1e('0x4b')]),{'include':_0x3f9a68[_0x7d1e('0x33')][_0x7d1e('0x42')]?[{'all':!![]}]:undefined})['then'](function(_0x4e45d3){var _0x1a9f18=_0x3f9a68[_0x7d1e('0x4c')][_0x7d1e('0x4d')]({'plain':!![]});if(!_0x1a9f18)throw new Error(_0x7d1e('0x4e'));if(_0x1a9f18[_0x7d1e('0x4f')]===_0x7d1e('0x4c')){var _0x3538e1=_0x4e45d3[_0x7d1e('0x4d')]({'plain':!![]});var _0x29b8e2=_0x7d1e('0x26');return db[_0x7d1e('0x50')][_0x7d1e('0x54')]({'where':{'name':_0x29b8e2,'userProfileId':_0x1a9f18[_0x7d1e('0x51')]},'raw':!![]})[_0x7d1e('0x24')](function(_0x2e993c){if(_0x2e993c&&_0x2e993c[_0x7d1e('0x52')]===0x0){return db[_0x7d1e('0x27')][_0x7d1e('0x4a')]({'name':_0x3538e1[_0x7d1e('0x2b')],'resourceId':_0x3538e1['id'],'type':_0x2e993c[_0x7d1e('0x2b')],'sectionId':_0x2e993c['id']},{})['then'](function(){return _0x4e45d3;});}else{return _0x4e45d3;}})['catch'](function(_0x5a1750){logger[_0x7d1e('0x29')](_0x7d1e('0x58'),_0x5a1750);throw _0x5a1750;});}return _0x4e45d3;});}})['then'](respondWithResult(_0x211867,0xc9))[_0x7d1e('0x46')](handleError(_0x211867,null));};exports[_0x7d1e('0x59')]=function(_0x1bddd8,_0x16b79c){if(_0x1bddd8[_0x7d1e('0x4b')]['id']){delete _0x1bddd8[_0x7d1e('0x4b')]['id'];}return db['Campaign'][_0x7d1e('0x54')]({'where':{'id':_0x1bddd8[_0x7d1e('0x48')]['id']}})[_0x7d1e('0x24')](handleEntityNotFound(_0x16b79c,null))[_0x7d1e('0x24')](saveUpdates(_0x1bddd8[_0x7d1e('0x4b')],null))[_0x7d1e('0x24')](respondWithResult(_0x16b79c,null))[_0x7d1e('0x46')](handleError(_0x16b79c,null));};exports[_0x7d1e('0x25')]=function(_0x2e60cf,_0x9dbd6c){return db[_0x7d1e('0x2f')]['find']({'where':{'id':_0x2e60cf[_0x7d1e('0x48')]['id']}})['then'](handleEntityNotFound(_0x9dbd6c,null))[_0x7d1e('0x24')](removeEntity(_0x9dbd6c,null))['catch'](handleError(_0x9dbd6c,null));};exports[_0x7d1e('0x5a')]=function(_0x313e0a,_0x35c59b,_0x18ee9b){var _0x41a378={'raw':!![],'where':{}};var _0x117cb7={};var _0x1ade85={'count':0x0,'rows':[]};return db['Campaign'][_0x7d1e('0x5b')]({'where':{'id':_0x313e0a['params']['id']}})[_0x7d1e('0x24')](handleEntityNotFound(_0x35c59b,null))[_0x7d1e('0x24')](function(_0x5ec93c){if(_0x5ec93c){_0x117cb7['model']=_[_0x7d1e('0x34')](db[_0x7d1e('0x5c')]['rawAttributes']);_0x117cb7['query']=_[_0x7d1e('0x34')](_0x313e0a[_0x7d1e('0x33')]);_0x117cb7[_0x7d1e('0x35')]=_[_0x7d1e('0x36')](_0x117cb7[_0x7d1e('0x37')],_0x117cb7['query']);_0x41a378[_0x7d1e('0x39')]=_[_0x7d1e('0x36')](_0x117cb7[_0x7d1e('0x37')],qs[_0x7d1e('0x38')](_0x313e0a[_0x7d1e('0x33')][_0x7d1e('0x38')]));_0x41a378[_0x7d1e('0x39')]=_0x41a378[_0x7d1e('0x39')][_0x7d1e('0x3a')]?_0x41a378['attributes']:_0x117cb7['model'];if(!_0x313e0a[_0x7d1e('0x33')][_0x7d1e('0x3b')](_0x7d1e('0x5d'))){_0x41a378[_0x7d1e('0x1f')]=qs['limit'](_0x313e0a[_0x7d1e('0x33')][_0x7d1e('0x1f')]);_0x41a378['offset']=qs[_0x7d1e('0x1e')](_0x313e0a[_0x7d1e('0x33')][_0x7d1e('0x1e')]);}_0x41a378['order']=qs[_0x7d1e('0x3d')](_0x313e0a[_0x7d1e('0x33')]['sort']);_0x41a378[_0x7d1e('0x3f')]=qs[_0x7d1e('0x35')](_['pick'](_0x313e0a['query'],_0x117cb7['filters']));_0x41a378[_0x7d1e('0x3f')][_0x7d1e('0x5e')]=_0x5ec93c['id'];if(_0x313e0a[_0x7d1e('0x33')][_0x7d1e('0x5f')]){_0x41a378['where']=_[_0x7d1e('0x40')](_0x41a378[_0x7d1e('0x3f')],{'$or':_[_0x7d1e('0x2e')](_0x41a378['attributes'],function(_0xb04b39){var _0x4b7efd={};_0x4b7efd[_0xb04b39]={'$like':'%'+_0x313e0a[_0x7d1e('0x33')][_0x7d1e('0x5f')]+'%'};return _0x4b7efd;})});}_0x41a378=_[_0x7d1e('0x40')]({},_0x41a378,_0x313e0a[_0x7d1e('0x41')]);return db['CmHopper'][_0x7d1e('0x1d')]({'where':_0x41a378[_0x7d1e('0x3f')]})['then'](function(_0xaa428a){_0x1ade85['count']=_0xaa428a;if(_0x313e0a[_0x7d1e('0x33')]['includeAll']){_0x41a378[_0x7d1e('0x43')]=[{'all':!![]}];}return db[_0x7d1e('0x5c')][_0x7d1e('0x44')](_0x41a378);})[_0x7d1e('0x24')](function(_0xbd0e6b){_0x1ade85[_0x7d1e('0x45')]=_0xbd0e6b;return _0x1ade85;});}})['then'](respondWithFilteredResult(_0x35c59b,_0x41a378))[_0x7d1e('0x46')](handleError(_0x35c59b,null));};exports[_0x7d1e('0x60')]=function(_0x569a9c,_0x184673,_0x2f3f61){var _0x5cf758={'raw':!![],'where':{}};var _0x433fcf={};var _0x3ac15a={'count':0x0,'rows':[]};return db[_0x7d1e('0x2f')][_0x7d1e('0x5b')]({'where':{'id':_0x569a9c['params']['id']}})[_0x7d1e('0x24')](handleEntityNotFound(_0x184673,null))[_0x7d1e('0x24')](function(_0x4b4f9f){if(_0x4b4f9f){_0x433fcf[_0x7d1e('0x37')]=_[_0x7d1e('0x34')](db[_0x7d1e('0x61')][_0x7d1e('0x49')]);_0x433fcf['query']=_[_0x7d1e('0x34')](_0x569a9c[_0x7d1e('0x33')]);_0x433fcf[_0x7d1e('0x35')]=_[_0x7d1e('0x36')](_0x433fcf[_0x7d1e('0x37')],_0x433fcf[_0x7d1e('0x33')]);_0x5cf758[_0x7d1e('0x39')]=_[_0x7d1e('0x36')](_0x433fcf[_0x7d1e('0x37')],qs['fields'](_0x569a9c[_0x7d1e('0x33')]['fields']));_0x5cf758[_0x7d1e('0x39')]=_0x5cf758[_0x7d1e('0x39')][_0x7d1e('0x3a')]?_0x5cf758[_0x7d1e('0x39')]:_0x433fcf[_0x7d1e('0x37')];if(!_0x569a9c[_0x7d1e('0x33')][_0x7d1e('0x3b')]('nolimit')){_0x5cf758['limit']=qs[_0x7d1e('0x1f')](_0x569a9c['query']['limit']);_0x5cf758[_0x7d1e('0x1e')]=qs[_0x7d1e('0x1e')](_0x569a9c['query']['offset']);}_0x5cf758[_0x7d1e('0x3c')]=qs[_0x7d1e('0x3d')](_0x569a9c['query']['sort']);_0x5cf758['where']=qs[_0x7d1e('0x35')](_['pick'](_0x569a9c[_0x7d1e('0x33')],_0x433fcf[_0x7d1e('0x35')]));_0x5cf758['where'][_0x7d1e('0x5e')]=_0x4b4f9f['id'];if(_0x569a9c[_0x7d1e('0x33')][_0x7d1e('0x5f')]){_0x5cf758['where']=_[_0x7d1e('0x40')](_0x5cf758[_0x7d1e('0x3f')],{'$or':_['map'](_0x5cf758['attributes'],function(_0x34a290){var _0x52be4c={};_0x52be4c[_0x34a290]={'$like':'%'+_0x569a9c[_0x7d1e('0x33')][_0x7d1e('0x5f')]+'%'};return _0x52be4c;})});}_0x5cf758=_[_0x7d1e('0x40')]({},_0x5cf758,_0x569a9c[_0x7d1e('0x41')]);return db[_0x7d1e('0x61')][_0x7d1e('0x1d')]({'where':_0x5cf758['where']})['then'](function(_0x3afad2){_0x3ac15a[_0x7d1e('0x1d')]=_0x3afad2;if(_0x569a9c[_0x7d1e('0x33')]['includeAll']){_0x5cf758[_0x7d1e('0x43')]=[{'all':!![]}];}return db[_0x7d1e('0x61')][_0x7d1e('0x44')](_0x5cf758);})[_0x7d1e('0x24')](function(_0x14fab5){_0x3ac15a['rows']=_0x14fab5;return _0x3ac15a;});}})[_0x7d1e('0x24')](respondWithFilteredResult(_0x184673,_0x5cf758))[_0x7d1e('0x46')](handleError(_0x184673,null));};exports['getHopperFinals']=function(_0x2debfb,_0x37048c,_0x3d00c6){var _0x3e33d1={'raw':!![],'where':{}};var _0x8a138a={};var _0x50526a={'count':0x0,'rows':[]};return db['Campaign'][_0x7d1e('0x5b')]({'where':{'id':_0x2debfb[_0x7d1e('0x48')]['id']}})[_0x7d1e('0x24')](handleEntityNotFound(_0x37048c,null))[_0x7d1e('0x24')](function(_0x1e9e26){if(_0x1e9e26){_0x8a138a[_0x7d1e('0x37')]=_['keys'](db[_0x7d1e('0x62')][_0x7d1e('0x49')]);_0x8a138a[_0x7d1e('0x33')]=_[_0x7d1e('0x34')](_0x2debfb[_0x7d1e('0x33')]);_0x8a138a[_0x7d1e('0x35')]=_['intersection'](_0x8a138a[_0x7d1e('0x37')],_0x8a138a[_0x7d1e('0x33')]);_0x3e33d1['attributes']=_[_0x7d1e('0x36')](_0x8a138a[_0x7d1e('0x37')],qs[_0x7d1e('0x38')](_0x2debfb['query'][_0x7d1e('0x38')]));_0x3e33d1[_0x7d1e('0x39')]=_0x3e33d1[_0x7d1e('0x39')][_0x7d1e('0x3a')]?_0x3e33d1[_0x7d1e('0x39')]:_0x8a138a[_0x7d1e('0x37')];if(!_0x2debfb[_0x7d1e('0x33')]['hasOwnProperty'](_0x7d1e('0x5d'))){_0x3e33d1[_0x7d1e('0x1f')]=qs[_0x7d1e('0x1f')](_0x2debfb[_0x7d1e('0x33')][_0x7d1e('0x1f')]);_0x3e33d1[_0x7d1e('0x1e')]=qs[_0x7d1e('0x1e')](_0x2debfb[_0x7d1e('0x33')][_0x7d1e('0x1e')]);}_0x3e33d1[_0x7d1e('0x3c')]=qs['sort'](_0x2debfb[_0x7d1e('0x33')][_0x7d1e('0x3d')]);_0x3e33d1['where']=qs[_0x7d1e('0x35')](_[_0x7d1e('0x3e')](_0x2debfb['query'],_0x8a138a['filters']));_0x3e33d1['where']['CampaignId']=_0x1e9e26['id'];if(_0x2debfb[_0x7d1e('0x33')]['filter']){_0x3e33d1['where']=_[_0x7d1e('0x40')](_0x3e33d1[_0x7d1e('0x3f')],{'$or':_[_0x7d1e('0x2e')](_0x3e33d1['attributes'],function(_0x3f906d){var _0x5f3d3c={};_0x5f3d3c[_0x3f906d]={'$like':'%'+_0x2debfb[_0x7d1e('0x33')][_0x7d1e('0x5f')]+'%'};return _0x5f3d3c;})});}_0x3e33d1=_[_0x7d1e('0x40')]({},_0x3e33d1,_0x2debfb['options']);return db['CmHopperFinal']['count']({'where':_0x3e33d1[_0x7d1e('0x3f')]})[_0x7d1e('0x24')](function(_0x48cbd3){_0x50526a[_0x7d1e('0x1d')]=_0x48cbd3;if(_0x2debfb[_0x7d1e('0x33')][_0x7d1e('0x42')]){_0x3e33d1['include']=[{'all':!![]}];}return db[_0x7d1e('0x62')][_0x7d1e('0x44')](_0x3e33d1);})[_0x7d1e('0x24')](function(_0x288e3b){_0x50526a[_0x7d1e('0x45')]=_0x288e3b;return _0x50526a;});}})['then'](respondWithFilteredResult(_0x37048c,_0x3e33d1))['catch'](handleError(_0x37048c,null));};exports['getHopperBlacks']=function(_0x3a771f,_0x2d15f4,_0x38ec66){var _0x4589b9={'raw':!![],'where':{}};var _0x16cb78={};var _0x9a1c77={'count':0x0,'rows':[]};return db[_0x7d1e('0x2f')][_0x7d1e('0x5b')]({'where':{'id':_0x3a771f[_0x7d1e('0x48')]['id']}})[_0x7d1e('0x24')](handleEntityNotFound(_0x2d15f4,null))['then'](function(_0x58dadc){if(_0x58dadc){_0x16cb78[_0x7d1e('0x37')]=_[_0x7d1e('0x34')](db[_0x7d1e('0x63')][_0x7d1e('0x49')]);_0x16cb78[_0x7d1e('0x33')]=_[_0x7d1e('0x34')](_0x3a771f['query']);_0x16cb78['filters']=_[_0x7d1e('0x36')](_0x16cb78[_0x7d1e('0x37')],_0x16cb78[_0x7d1e('0x33')]);_0x4589b9['attributes']=_['intersection'](_0x16cb78['model'],qs['fields'](_0x3a771f[_0x7d1e('0x33')][_0x7d1e('0x38')]));_0x4589b9[_0x7d1e('0x39')]=_0x4589b9['attributes'][_0x7d1e('0x3a')]?_0x4589b9[_0x7d1e('0x39')]:_0x16cb78[_0x7d1e('0x37')];if(!_0x3a771f[_0x7d1e('0x33')]['hasOwnProperty']('nolimit')){_0x4589b9[_0x7d1e('0x1f')]=qs[_0x7d1e('0x1f')](_0x3a771f[_0x7d1e('0x33')][_0x7d1e('0x1f')]);_0x4589b9[_0x7d1e('0x1e')]=qs[_0x7d1e('0x1e')](_0x3a771f[_0x7d1e('0x33')][_0x7d1e('0x1e')]);}_0x4589b9['order']=qs[_0x7d1e('0x3d')](_0x3a771f[_0x7d1e('0x33')][_0x7d1e('0x3d')]);_0x4589b9[_0x7d1e('0x3f')]=qs['filters'](_[_0x7d1e('0x3e')](_0x3a771f[_0x7d1e('0x33')],_0x16cb78[_0x7d1e('0x35')]));_0x4589b9[_0x7d1e('0x3f')][_0x7d1e('0x5e')]=_0x58dadc['id'];if(_0x3a771f[_0x7d1e('0x33')][_0x7d1e('0x5f')]){_0x4589b9[_0x7d1e('0x3f')]=_[_0x7d1e('0x40')](_0x4589b9[_0x7d1e('0x3f')],{'$or':_[_0x7d1e('0x2e')](_0x4589b9[_0x7d1e('0x39')],function(_0x59e232){var _0x29f5fb={};_0x29f5fb[_0x59e232]={'$like':'%'+_0x3a771f[_0x7d1e('0x33')][_0x7d1e('0x5f')]+'%'};return _0x29f5fb;})});}_0x4589b9=_[_0x7d1e('0x40')]({},_0x4589b9,_0x3a771f['options']);return db[_0x7d1e('0x63')]['count']({'where':_0x4589b9['where']})[_0x7d1e('0x24')](function(_0x540bb3){_0x9a1c77['count']=_0x540bb3;if(_0x3a771f['query'][_0x7d1e('0x42')]){_0x4589b9[_0x7d1e('0x43')]=[{'all':!![]}];}return db[_0x7d1e('0x63')]['findAll'](_0x4589b9);})['then'](function(_0x2a7146){_0x9a1c77[_0x7d1e('0x45')]=_0x2a7146;return _0x9a1c77;});}})[_0x7d1e('0x24')](respondWithFilteredResult(_0x2d15f4,_0x4589b9))[_0x7d1e('0x46')](handleError(_0x2d15f4,null));};exports['getLists']=function(_0x2ce351,_0x144c94,_0x17e73e){var _0x3a0ff1={};var _0x4318d6={};var _0x4a5ab7;var _0x47315b;return db['Campaign'][_0x7d1e('0x5b')]({'where':{'id':_0x2ce351[_0x7d1e('0x48')]['id']}})[_0x7d1e('0x24')](handleEntityNotFound(_0x144c94,null))[_0x7d1e('0x24')](function(_0x2a6f86){if(_0x2a6f86){_0x4a5ab7=_0x2a6f86;_0x4318d6[_0x7d1e('0x37')]=_[_0x7d1e('0x34')](db[_0x7d1e('0x64')][_0x7d1e('0x49')]);_0x4318d6[_0x7d1e('0x33')]=_[_0x7d1e('0x34')](_0x2ce351[_0x7d1e('0x33')]);_0x4318d6[_0x7d1e('0x35')]=_['intersection'](_0x4318d6[_0x7d1e('0x37')],_0x4318d6[_0x7d1e('0x33')]);_0x3a0ff1[_0x7d1e('0x39')]=_[_0x7d1e('0x36')](_0x4318d6[_0x7d1e('0x37')],qs['fields'](_0x2ce351['query'][_0x7d1e('0x38')]));_0x3a0ff1['attributes']=_0x3a0ff1[_0x7d1e('0x39')][_0x7d1e('0x3a')]?_0x3a0ff1[_0x7d1e('0x39')]:_0x4318d6[_0x7d1e('0x37')];_0x3a0ff1[_0x7d1e('0x3c')]=qs[_0x7d1e('0x3d')](_0x2ce351[_0x7d1e('0x33')][_0x7d1e('0x3d')]);_0x3a0ff1[_0x7d1e('0x3f')]=qs[_0x7d1e('0x35')](_[_0x7d1e('0x3e')](_0x2ce351[_0x7d1e('0x33')],_0x4318d6[_0x7d1e('0x35')]));if(_0x2ce351[_0x7d1e('0x33')][_0x7d1e('0x5f')]){_0x3a0ff1[_0x7d1e('0x3f')]=_[_0x7d1e('0x40')](_0x3a0ff1['where'],{'$or':_[_0x7d1e('0x2e')](_0x3a0ff1[_0x7d1e('0x39')],function(_0x53f99e){var _0x9a1d6c={};_0x9a1d6c[_0x53f99e]={'$like':'%'+_0x2ce351[_0x7d1e('0x33')][_0x7d1e('0x5f')]+'%'};return _0x9a1d6c;})});}_0x3a0ff1=_[_0x7d1e('0x40')]({},_0x3a0ff1,_0x2ce351[_0x7d1e('0x41')]);return _0x4a5ab7['getLists'](_0x3a0ff1);}})['then'](function(_0x48972b){if(_0x48972b){_0x47315b=_0x48972b['length'];if(!_0x2ce351[_0x7d1e('0x33')][_0x7d1e('0x3b')](_0x7d1e('0x5d'))){_0x3a0ff1[_0x7d1e('0x1f')]=qs[_0x7d1e('0x1f')](_0x2ce351['query'][_0x7d1e('0x1f')]);_0x3a0ff1[_0x7d1e('0x1e')]=qs[_0x7d1e('0x1e')](_0x2ce351[_0x7d1e('0x33')][_0x7d1e('0x1e')]);}return _0x4a5ab7['getLists'](_0x3a0ff1);}})[_0x7d1e('0x24')](function(_0x21bb17){if(_0x21bb17){return _0x21bb17?{'count':_0x47315b,'rows':_0x21bb17}:null;}})['then'](respondWithResult(_0x144c94,null))['catch'](handleError(_0x144c94,null));};exports[_0x7d1e('0x65')]=function(_0x5dd05f,_0x13698a,_0x4f9e21){var _0x4e5f78,_0xca93fd;return db[_0x7d1e('0x2f')][_0x7d1e('0x54')]({'where':{'id':_0x5dd05f[_0x7d1e('0x48')]['id']}})[_0x7d1e('0x24')](handleEntityNotFound(_0x13698a,null))[_0x7d1e('0x24')](function(_0x4da334){if(_0x4da334){_0xca93fd=_0x4da334;return _0x4da334['addLists'](_0x5dd05f[_0x7d1e('0x4b')][_0x7d1e('0x66')],_[_0x7d1e('0x55')](_0x5dd05f[_0x7d1e('0x4b')],['ids','id'])||{});}return null;})['spread'](function(_0x22eb67){var _0x23790f;_0x4e5f78=_0x22eb67||[];var _0x53153f=[];if(_0x22eb67){for(var _0x5793a7=0x0;_0x5793a7<_0x22eb67[_0x7d1e('0x3a')];_0x5793a7+=0x1){var _0x51ed2c=_0x22eb67[_0x5793a7][_0x7d1e('0x4d')]({'plain':!![]});_0xca93fd[_0x7d1e('0x67')]=_0x5dd05f[_0x7d1e('0x4b')][_0x7d1e('0x67')]?_0x5dd05f[_0x7d1e('0x4b')][_0x7d1e('0x67')]:_0xca93fd[_0x7d1e('0x67')];switch(_0xca93fd[_0x7d1e('0x67')]){case _0x7d1e('0x68'):_0x23790f=squel[_0x7d1e('0x69')]()[_0x7d1e('0x6a')](_0x7d1e('0x6b'))[_0x7d1e('0x6c')](['phone',_0x7d1e('0x6d'),'ContactId',_0x7d1e('0x6e'),_0x7d1e('0x5e'),'createdAt',_0x7d1e('0x57')],squel[_0x7d1e('0x6f')]()[_0x7d1e('0x70')](_0x7d1e('0x71'),'phone')[_0x7d1e('0x70')](_0x7d1e('0x72'),_0x7d1e('0x6d'))[_0x7d1e('0x70')]('id',_0x7d1e('0x73'))['field'](_0x51ed2c['CmListId'][_0x7d1e('0x74')](),_0x7d1e('0x6e'))['field'](_0x5dd05f[_0x7d1e('0x48')]['id'][_0x7d1e('0x74')](),'CampaignId')[_0x7d1e('0x70')](_0x7d1e('0x72'),_0x7d1e('0x56'))[_0x7d1e('0x70')](_0x7d1e('0x72'),_0x7d1e('0x57'))[_0x7d1e('0x75')](_0x7d1e('0x76'))['where'](_0x7d1e('0x77'))[_0x7d1e('0x3f')](_0x7d1e('0x78'),_0x51ed2c[_0x7d1e('0x79')][_0x7d1e('0x74')]())['where'](_0x7d1e('0x7a'))['where'](_0x7d1e('0x7b'),squel['select']()[_0x7d1e('0x70')](_0x7d1e('0x7c'))[_0x7d1e('0x75')]('cm_hopper_final')['where'](_0x7d1e('0x7d'),_0x5dd05f[_0x7d1e('0x48')]['id'][_0x7d1e('0x74')]()))[_0x7d1e('0x3f')](_0x7d1e('0x7b'),squel[_0x7d1e('0x6f')]()[_0x7d1e('0x70')](_0x7d1e('0x7e'))['from'](_0x7d1e('0x6b'))[_0x7d1e('0x3f')](_0x7d1e('0x7d'),_0x5dd05f['params']['id'][_0x7d1e('0x74')]())))[_0x7d1e('0x74')]();break;case _0x7d1e('0x7f'):_0x23790f=squel[_0x7d1e('0x69')]()['into'](_0x7d1e('0x6b'))['fromQuery'](['phone',_0x7d1e('0x6d'),'ContactId','ListId','CampaignId','createdAt',_0x7d1e('0x57')],squel[_0x7d1e('0x6f')]()[_0x7d1e('0x70')]('phone',_0x7d1e('0x71'))[_0x7d1e('0x70')](_0x7d1e('0x72'),_0x7d1e('0x6d'))[_0x7d1e('0x70')]('id',_0x7d1e('0x73'))[_0x7d1e('0x70')](_0x51ed2c[_0x7d1e('0x79')][_0x7d1e('0x74')](),_0x7d1e('0x6e'))[_0x7d1e('0x70')](_0x5dd05f[_0x7d1e('0x48')]['id']['toString'](),'CampaignId')[_0x7d1e('0x70')](_0x7d1e('0x72'),_0x7d1e('0x56'))[_0x7d1e('0x70')](_0x7d1e('0x72'),_0x7d1e('0x57'))[_0x7d1e('0x75')](_0x7d1e('0x76'))['where'](_0x7d1e('0x77'))['where'](_0x7d1e('0x78'),_0x51ed2c['CmListId']['toString']())['where'](_0x7d1e('0x7a'))['where'](_0x7d1e('0x7b'),squel[_0x7d1e('0x6f')]()[_0x7d1e('0x70')](_0x7d1e('0x7e'))[_0x7d1e('0x75')]('cm_hopper')[_0x7d1e('0x3f')]('CampaignId\x20=\x20?',_0x5dd05f[_0x7d1e('0x48')]['id'][_0x7d1e('0x74')]())))[_0x7d1e('0x74')]();break;default:_0x23790f=squel['insert']()[_0x7d1e('0x6a')](_0x7d1e('0x6b'))[_0x7d1e('0x6c')](['phone',_0x7d1e('0x6d'),'ContactId',_0x7d1e('0x6e'),_0x7d1e('0x5e'),_0x7d1e('0x56'),_0x7d1e('0x57')],squel[_0x7d1e('0x6f')]()[_0x7d1e('0x70')](_0x7d1e('0x71'),_0x7d1e('0x71'))[_0x7d1e('0x70')](_0x7d1e('0x72'),'scheduledAt')['field']('id','ContactId')[_0x7d1e('0x70')](_0x51ed2c[_0x7d1e('0x79')]['toString'](),_0x7d1e('0x6e'))['field'](_0x5dd05f[_0x7d1e('0x48')]['id'][_0x7d1e('0x74')](),_0x7d1e('0x5e'))['field'](_0x7d1e('0x72'),_0x7d1e('0x56'))[_0x7d1e('0x70')](_0x7d1e('0x72'),_0x7d1e('0x57'))[_0x7d1e('0x75')](_0x7d1e('0x76'))[_0x7d1e('0x3f')](_0x7d1e('0x77'))['where']('ListId\x20=\x20?',_0x51ed2c[_0x7d1e('0x79')][_0x7d1e('0x74')]())[_0x7d1e('0x3f')](_0x7d1e('0x7a')))[_0x7d1e('0x74')]();}_0x53153f[_0x7d1e('0x80')](db[_0x7d1e('0x81')][_0x7d1e('0x33')](_0x23790f));}return BPromise[_0x7d1e('0x82')](_0x53153f);}})[_0x7d1e('0x24')](function(){return _0x4e5f78;})['then'](respondWithResult(_0x13698a,null))['catch'](handleError(_0x13698a,null));};exports[_0x7d1e('0x83')]=function(_0x59e013,_0x2d5b74,_0x90b4aa){return db[_0x7d1e('0x2f')]['find']({'where':{'id':_0x59e013[_0x7d1e('0x48')]['id']}})[_0x7d1e('0x24')](handleEntityNotFound(_0x2d5b74,null))[_0x7d1e('0x24')](function(_0x3c6843){if(_0x3c6843){return _0x3c6843[_0x7d1e('0x83')](_0x59e013[_0x7d1e('0x33')][_0x7d1e('0x66')]);}})['then'](function(_0x5a13d3){if(_0x5a13d3){return db[_0x7d1e('0x5c')][_0x7d1e('0x25')]({'where':{'ListId':_0x59e013[_0x7d1e('0x33')][_0x7d1e('0x66')],'CampaignId':_0x59e013['params']['id']}})[_0x7d1e('0x24')](function(){return _0x5a13d3;});}})[_0x7d1e('0x24')](respondWithStatusCode(_0x2d5b74,null))[_0x7d1e('0x46')](handleError(_0x2d5b74,null));};exports[_0x7d1e('0x84')]=function(_0x4af5ae,_0x34ad7c,_0x376cf8){var _0x50a9a2={};var _0x16e020={};var _0x5cb468;var _0x2c5390;return db['Campaign'][_0x7d1e('0x5b')]({'where':{'id':_0x4af5ae[_0x7d1e('0x48')]['id']}})['then'](handleEntityNotFound(_0x34ad7c,null))[_0x7d1e('0x24')](function(_0x2eda37){if(_0x2eda37){_0x5cb468=_0x2eda37;_0x16e020[_0x7d1e('0x37')]=_[_0x7d1e('0x34')](db[_0x7d1e('0x64')][_0x7d1e('0x49')]);_0x16e020[_0x7d1e('0x33')]=_[_0x7d1e('0x34')](_0x4af5ae[_0x7d1e('0x33')]);_0x16e020['filters']=_[_0x7d1e('0x36')](_0x16e020[_0x7d1e('0x37')],_0x16e020[_0x7d1e('0x33')]);_0x50a9a2[_0x7d1e('0x39')]=_['intersection'](_0x16e020[_0x7d1e('0x37')],qs[_0x7d1e('0x38')](_0x4af5ae[_0x7d1e('0x33')][_0x7d1e('0x38')]));_0x50a9a2[_0x7d1e('0x39')]=_0x50a9a2[_0x7d1e('0x39')][_0x7d1e('0x3a')]?_0x50a9a2['attributes']:_0x16e020['model'];_0x50a9a2['order']=qs[_0x7d1e('0x3d')](_0x4af5ae[_0x7d1e('0x33')][_0x7d1e('0x3d')]);_0x50a9a2[_0x7d1e('0x3f')]=qs['filters'](_[_0x7d1e('0x3e')](_0x4af5ae['query'],_0x16e020[_0x7d1e('0x35')]));if(_0x4af5ae[_0x7d1e('0x33')][_0x7d1e('0x5f')]){_0x50a9a2[_0x7d1e('0x3f')]=_['merge'](_0x50a9a2['where'],{'$or':_[_0x7d1e('0x2e')](_0x50a9a2[_0x7d1e('0x39')],function(_0x3a0bef){var _0x2befa2={};_0x2befa2[_0x3a0bef]={'$like':'%'+_0x4af5ae[_0x7d1e('0x33')][_0x7d1e('0x5f')]+'%'};return _0x2befa2;})});}_0x50a9a2=_[_0x7d1e('0x40')]({},_0x50a9a2,_0x4af5ae[_0x7d1e('0x41')]);return _0x5cb468['getBlackLists'](_0x50a9a2);}})[_0x7d1e('0x24')](function(_0x800fc1){if(_0x800fc1){_0x2c5390=_0x800fc1['length'];if(!_0x4af5ae[_0x7d1e('0x33')][_0x7d1e('0x3b')]('nolimit')){_0x50a9a2['limit']=qs[_0x7d1e('0x1f')](_0x4af5ae[_0x7d1e('0x33')]['limit']);_0x50a9a2[_0x7d1e('0x1e')]=qs[_0x7d1e('0x1e')](_0x4af5ae['query'][_0x7d1e('0x1e')]);}return _0x5cb468[_0x7d1e('0x84')](_0x50a9a2);}})[_0x7d1e('0x24')](function(_0x69beec){if(_0x69beec){return _0x69beec?{'count':_0x2c5390,'rows':_0x69beec}:null;}})[_0x7d1e('0x24')](respondWithResult(_0x34ad7c,null))['catch'](handleError(_0x34ad7c,null));};exports[_0x7d1e('0x85')]=function(_0x572649,_0x444dc4,_0x1dfe2a){var _0x31387a,_0x47c79f;return db[_0x7d1e('0x2f')][_0x7d1e('0x54')]({'where':{'id':_0x572649[_0x7d1e('0x48')]['id']}})[_0x7d1e('0x24')](handleEntityNotFound(_0x444dc4,null))[_0x7d1e('0x24')](function(_0x1d0937){if(_0x1d0937){_0x47c79f=_0x1d0937;return _0x1d0937[_0x7d1e('0x85')](_0x572649['body'][_0x7d1e('0x66')],_[_0x7d1e('0x55')](_0x572649[_0x7d1e('0x4b')],[_0x7d1e('0x66'),'id'])||{});}return null;})[_0x7d1e('0x86')](function(_0x22617e){var _0x4b966c;_0x31387a=_0x22617e||[];var _0x381c29=[];if(_0x22617e){for(var _0x2439d5=0x0;_0x2439d5<_0x22617e[_0x7d1e('0x3a')];_0x2439d5+=0x1){var _0x419536=_0x22617e[_0x2439d5]['get']({'plain':!![]});_0x4b966c=squel[_0x7d1e('0x69')]()[_0x7d1e('0x6a')]('cm_hopper_black')[_0x7d1e('0x6c')](['phone',_0x7d1e('0x73'),_0x7d1e('0x6e'),_0x7d1e('0x5e'),_0x7d1e('0x56'),_0x7d1e('0x57')],squel[_0x7d1e('0x6f')]()[_0x7d1e('0x70')]('phone','phone')[_0x7d1e('0x70')]('id',_0x7d1e('0x73'))['field'](_0x419536['CmListId'][_0x7d1e('0x74')](),_0x7d1e('0x6e'))['field'](_0x572649[_0x7d1e('0x48')]['id'][_0x7d1e('0x74')](),_0x7d1e('0x5e'))[_0x7d1e('0x70')](_0x7d1e('0x72'),_0x7d1e('0x56'))['field'](_0x7d1e('0x72'),_0x7d1e('0x57'))['from'](_0x7d1e('0x76'))[_0x7d1e('0x3f')]('deletedAt\x20IS\x20NULL')['where'](_0x7d1e('0x78'),_0x419536[_0x7d1e('0x79')][_0x7d1e('0x74')]())[_0x7d1e('0x3f')](_0x7d1e('0x7a')))['toString']();_0x381c29['push'](db['sequelize'][_0x7d1e('0x33')](_0x4b966c));}return BPromise['all'](_0x381c29);}})['then'](function(){return _0x31387a;})[_0x7d1e('0x24')](respondWithResult(_0x444dc4,null))['catch'](handleError(_0x444dc4,null));};exports[_0x7d1e('0x87')]=function(_0x12adc0,_0x5da1e5,_0x378ee2){return db['Campaign'][_0x7d1e('0x54')]({'where':{'id':_0x12adc0[_0x7d1e('0x48')]['id']}})[_0x7d1e('0x24')](handleEntityNotFound(_0x5da1e5,null))[_0x7d1e('0x24')](function(_0x9ea85b){if(_0x9ea85b){return _0x9ea85b[_0x7d1e('0x87')](_0x12adc0[_0x7d1e('0x33')][_0x7d1e('0x66')]);}})['then'](function(_0x39f005){if(_0x39f005){return db[_0x7d1e('0x63')][_0x7d1e('0x25')]({'where':{'ListId':_0x12adc0[_0x7d1e('0x33')][_0x7d1e('0x66')],'CampaignId':_0x12adc0[_0x7d1e('0x48')]['id']}})[_0x7d1e('0x24')](function(){return _0x39f005;});}})['then'](respondWithStatusCode(_0x5da1e5,null))[_0x7d1e('0x46')](handleError(_0x5da1e5,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 656f5cb..e1452f2 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 _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x5509a8,_0x1a8b93){var _0x5383b1=function(_0x14cde3){while(--_0x14cde3){_0x5509a8['push'](_0x5509a8['shift']());}};_0x5383b1(++_0x1a8b93);}(_0x7a54,0x106));var _0x47a5=function(_0x55215a,_0x19cbd2){_0x55215a=_0x55215a-0x0;var _0x265e45=_0x7a54[_0x55215a];return _0x265e45;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x2080a3,_0x48acfa){var _0x8d7d17=function(_0x2dbc06){while(--_0x2dbc06){_0x2080a3['push'](_0x2080a3['shift']());}};_0x8d7d17(++_0x48acfa);}(_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 2986a3e..7a6baf3 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 _0x45c8=['debug','stringify','error','code','message','result','options','raw','where','attributes','include','model','map','GetCampaign','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/environment','jayson/promise','client','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent'];(function(_0x200556,_0x486dda){var _0x569faa=function(_0x2299b4){while(--_0x2299b4){_0x200556['push'](_0x200556['shift']());}};_0x569faa(++_0x486dda);}(_0x45c8,0xef));var _0x845c=function(_0x376573,_0x5eea01){_0x376573=_0x376573-0x0;var _0x23e41b=_0x45c8[_0x376573];return _0x23e41b;};'use strict';var _=require(_0x845c('0x0'));var util=require('util');var moment=require(_0x845c('0x1'));var BPromise=require(_0x845c('0x2'));var rs=require(_0x845c('0x3'));var fs=require('fs');var Redis=require(_0x845c('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x845c('0x5'));var jayson=require(_0x845c('0x6'));var client=jayson[_0x845c('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x335f38,_0x4a1a42,_0x42b569){return new BPromise(function(_0x4648e1,_0x3075cd){return client[_0x845c('0x8')](_0x335f38,_0x42b569)[_0x845c('0x9')](function(_0x34a8ae){logger[_0x845c('0xa')](_0x845c('0xb'),_0x4a1a42,_0x845c('0xc'));logger[_0x845c('0xd')]('Campaign,\x20%s,\x20%s,\x20%s',_0x4a1a42,'request\x20sent',JSON[_0x845c('0xe')](_0x34a8ae));if(_0x34a8ae[_0x845c('0xf')]){if(_0x34a8ae['error'][_0x845c('0x10')]===0x1f4){logger[_0x845c('0xf')](_0x845c('0xb'),_0x4a1a42,_0x34a8ae[_0x845c('0xf')][_0x845c('0x11')]);return _0x3075cd(_0x34a8ae[_0x845c('0xf')]['message']);}logger[_0x845c('0xf')](_0x845c('0xb'),_0x4a1a42,_0x34a8ae['error'][_0x845c('0x11')]);return _0x4648e1(_0x34a8ae[_0x845c('0xf')][_0x845c('0x11')]);}else{logger[_0x845c('0xa')](_0x845c('0xb'),_0x4a1a42,_0x845c('0xc'));_0x4648e1(_0x34a8ae[_0x845c('0x12')]['message']);}})['catch'](function(_0x3b1ff9){logger[_0x845c('0xf')](_0x845c('0xb'),_0x4a1a42,_0x3b1ff9);_0x3075cd(_0x3b1ff9);});});}exports['GetCampaign']=function(_0x1f9bed){var _0x104314=this;return new Promise(function(_0x452b54,_0x48e7d4){return db['Campaign']['findAll']({'raw':_0x1f9bed[_0x845c('0x13')]?_0x1f9bed['options'][_0x845c('0x14')]===undefined?!![]:![]:!![],'where':_0x1f9bed[_0x845c('0x13')]?_0x1f9bed[_0x845c('0x13')][_0x845c('0x15')]||null:null,'attributes':_0x1f9bed[_0x845c('0x13')]?_0x1f9bed['options'][_0x845c('0x16')]||null:null,'limit':_0x1f9bed['options']?_0x1f9bed[_0x845c('0x13')]['limit']||null:null,'include':_0x1f9bed[_0x845c('0x13')]?_0x1f9bed['options'][_0x845c('0x17')]?_['map'](_0x1f9bed[_0x845c('0x13')][_0x845c('0x17')],function(_0x362975){return{'model':db[_0x362975[_0x845c('0x18')]],'as':_0x362975['as'],'attributes':_0x362975[_0x845c('0x16')],'include':_0x362975[_0x845c('0x17')]?_['map'](_0x362975[_0x845c('0x17')],function(_0x5e3ec8){return{'model':db[_0x5e3ec8[_0x845c('0x18')]],'as':_0x5e3ec8['as'],'attributes':_0x5e3ec8[_0x845c('0x16')],'include':_0x5e3ec8['include']?_[_0x845c('0x19')](_0x5e3ec8[_0x845c('0x17')],function(_0x189c19){return{'model':db[_0x189c19['model']],'as':_0x189c19['as'],'attributes':_0x189c19['attributes']};}):[]};}):[]};}):[]:[]})[_0x845c('0x9')](function(_0x2a3c1d){logger[_0x845c('0xa')]('GetCampaign',_0x1f9bed);logger[_0x845c('0xd')](_0x845c('0x1a'),_0x1f9bed,JSON[_0x845c('0xe')](_0x2a3c1d));_0x452b54(_0x2a3c1d);})[_0x845c('0x1b')](function(_0x5d7b58){logger[_0x845c('0xf')](_0x845c('0x1a'),_0x5d7b58[_0x845c('0x11')],_0x1f9bed);_0x48e7d4(_0x104314['error'](0x1f4,_0x5d7b58[_0x845c('0x11')]));});});}; \ No newline at end of file +var _0x0dba=['Campaign,\x20%s,\x20%s','message','result','catch','GetCampaign','Campaign','findAll','options','raw','attributes','include','map','model','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','stringify','error','code'];(function(_0x17866f,_0x2bc389){var _0x5109ac=function(_0x191415){while(--_0x191415){_0x17866f['push'](_0x17866f['shift']());}};_0x5109ac(++_0x2bc389);}(_0x0dba,0x136));var _0xa0db=function(_0x40be2b,_0x2c77b4){_0x40be2b=_0x40be2b-0x0;var _0x5a4403=_0x0dba[_0x40be2b];return _0x5a4403;};'use strict';var _=require(_0xa0db('0x0'));var util=require(_0xa0db('0x1'));var moment=require(_0xa0db('0x2'));var BPromise=require(_0xa0db('0x3'));var rs=require(_0xa0db('0x4'));var fs=require('fs');var Redis=require(_0xa0db('0x5'));var db=require(_0xa0db('0x6'))['db'];var utils=require(_0xa0db('0x7'));var logger=require(_0xa0db('0x8'))(_0xa0db('0x9'));var config=require(_0xa0db('0xa'));var jayson=require(_0xa0db('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5b77ce,_0x5a8cb2,_0x45fb6d){return new BPromise(function(_0x1fd7ed,_0x483ddf){return client[_0xa0db('0xc')](_0x5b77ce,_0x45fb6d)[_0xa0db('0xd')](function(_0x35445a){logger[_0xa0db('0xe')]('Campaign,\x20%s,\x20%s',_0x5a8cb2,_0xa0db('0xf'));logger[_0xa0db('0x10')]('Campaign,\x20%s,\x20%s,\x20%s',_0x5a8cb2,'request\x20sent',JSON[_0xa0db('0x11')](_0x35445a));if(_0x35445a[_0xa0db('0x12')]){if(_0x35445a[_0xa0db('0x12')][_0xa0db('0x13')]===0x1f4){logger['error'](_0xa0db('0x14'),_0x5a8cb2,_0x35445a[_0xa0db('0x12')][_0xa0db('0x15')]);return _0x483ddf(_0x35445a[_0xa0db('0x12')][_0xa0db('0x15')]);}logger[_0xa0db('0x12')](_0xa0db('0x14'),_0x5a8cb2,_0x35445a[_0xa0db('0x12')][_0xa0db('0x15')]);return _0x1fd7ed(_0x35445a['error'][_0xa0db('0x15')]);}else{logger[_0xa0db('0xe')](_0xa0db('0x14'),_0x5a8cb2,_0xa0db('0xf'));_0x1fd7ed(_0x35445a[_0xa0db('0x16')][_0xa0db('0x15')]);}})[_0xa0db('0x17')](function(_0x12a3e8){logger[_0xa0db('0x12')]('Campaign,\x20%s,\x20%s',_0x5a8cb2,_0x12a3e8);_0x483ddf(_0x12a3e8);});});}exports[_0xa0db('0x18')]=function(_0x215658){var _0x4be2e2=this;return new Promise(function(_0x12766f,_0x2786ae){return db[_0xa0db('0x19')][_0xa0db('0x1a')]({'raw':_0x215658[_0xa0db('0x1b')]?_0x215658[_0xa0db('0x1b')][_0xa0db('0x1c')]===undefined?!![]:![]:!![],'where':_0x215658['options']?_0x215658['options']['where']||null:null,'attributes':_0x215658['options']?_0x215658[_0xa0db('0x1b')][_0xa0db('0x1d')]||null:null,'limit':_0x215658[_0xa0db('0x1b')]?_0x215658['options']['limit']||null:null,'include':_0x215658[_0xa0db('0x1b')]?_0x215658['options'][_0xa0db('0x1e')]?_[_0xa0db('0x1f')](_0x215658[_0xa0db('0x1b')][_0xa0db('0x1e')],function(_0x4e9a22){return{'model':db[_0x4e9a22[_0xa0db('0x20')]],'as':_0x4e9a22['as'],'attributes':_0x4e9a22[_0xa0db('0x1d')],'include':_0x4e9a22[_0xa0db('0x1e')]?_[_0xa0db('0x1f')](_0x4e9a22[_0xa0db('0x1e')],function(_0x362c30){return{'model':db[_0x362c30[_0xa0db('0x20')]],'as':_0x362c30['as'],'attributes':_0x362c30[_0xa0db('0x1d')],'include':_0x362c30[_0xa0db('0x1e')]?_[_0xa0db('0x1f')](_0x362c30['include'],function(_0x3652a1){return{'model':db[_0x3652a1[_0xa0db('0x20')]],'as':_0x3652a1['as'],'attributes':_0x3652a1[_0xa0db('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xa0db('0xd')](function(_0xe3372c){logger[_0xa0db('0xe')](_0xa0db('0x18'),_0x215658);logger[_0xa0db('0x10')](_0xa0db('0x18'),_0x215658,JSON[_0xa0db('0x11')](_0xe3372c));_0x12766f(_0xe3372c);})[_0xa0db('0x17')](function(_0x3a3dba){logger[_0xa0db('0x12')](_0xa0db('0x18'),_0x3a3dba[_0xa0db('0x15')],_0x215658);_0x2786ae(_0x4be2e2[_0xa0db('0x12')](0x1f4,_0x3a3dba[_0xa0db('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index 4c223ac..b9216e4 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 _0xf774=['index','get','/:id','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','addLists','addBlackLists','put','delete','destroy','removeLists','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','isAuthenticated'];(function(_0x25b4a4,_0x2e081b){var _0x707267=function(_0x440123){while(--_0x440123){_0x25b4a4['push'](_0x25b4a4['shift']());}};_0x707267(++_0x2e081b);}(_0xf774,0x1e4));var _0x4f77=function(_0x5f1a58,_0x45c87d){_0x5f1a58=_0x5f1a58-0x0;var _0x2bf6c5=_0xf774[_0x5f1a58];return _0x2bf6c5;};'use strict';var multer=require(_0x4f77('0x0'));var util=require(_0x4f77('0x1'));var path=require(_0x4f77('0x2'));var timeout=require(_0x4f77('0x3'));var express=require(_0x4f77('0x4'));var router=express['Router']();var fs_extra=require(_0x4f77('0x5'));var auth=require(_0x4f77('0x6'));var interaction=require(_0x4f77('0x7'));var config=require(_0x4f77('0x8'));var controller=require(_0x4f77('0x9'));router['get']('/',auth[_0x4f77('0xa')](),controller[_0x4f77('0xb')]);router[_0x4f77('0xc')](_0x4f77('0xd'),auth[_0x4f77('0xa')](),controller['show']);router[_0x4f77('0xc')]('/:id/hoppers',auth['isAuthenticated'](),controller[_0x4f77('0xe')]);router[_0x4f77('0xc')](_0x4f77('0xf'),auth[_0x4f77('0xa')](),controller['getHopperHistories']);router[_0x4f77('0xc')](_0x4f77('0x10'),auth[_0x4f77('0xa')](),controller[_0x4f77('0x11')]);router[_0x4f77('0xc')](_0x4f77('0x12'),auth['isAuthenticated'](),controller[_0x4f77('0x13')]);router[_0x4f77('0xc')](_0x4f77('0x14'),auth['isAuthenticated'](),controller[_0x4f77('0x15')]);router['get'](_0x4f77('0x16'),auth[_0x4f77('0xa')](),controller[_0x4f77('0x17')]);router[_0x4f77('0x18')]('/',auth['isAuthenticated'](),controller[_0x4f77('0x19')]);router[_0x4f77('0x18')](_0x4f77('0x1a'),auth[_0x4f77('0xa')](),controller['clone']);router[_0x4f77('0x18')]('/:id/lists',auth[_0x4f77('0xa')](),controller[_0x4f77('0x1b')]);router[_0x4f77('0x18')](_0x4f77('0x16'),auth[_0x4f77('0xa')](),controller[_0x4f77('0x1c')]);router[_0x4f77('0x1d')]('/:id',auth[_0x4f77('0xa')](),controller['update']);router[_0x4f77('0x1e')](_0x4f77('0xd'),auth[_0x4f77('0xa')](),controller[_0x4f77('0x1f')]);router[_0x4f77('0x1e')](_0x4f77('0x14'),auth[_0x4f77('0xa')](),controller[_0x4f77('0x20')]);router['delete'](_0x4f77('0x16'),auth[_0x4f77('0xa')](),controller['removeBlackLists']);module['exports']=router; \ No newline at end of file +var _0x2bc6=['addLists','addBlackLists','update','removeLists','removeBlackLists','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','index','get','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_finals','isAuthenticated','/:id/hopper_black','getHopperBlacks','/:id/lists','/:id/blacklists','post','create','/:id/clone'];(function(_0x3fda1e,_0x3f8d30){var _0x1126bc=function(_0x42774d){while(--_0x42774d){_0x3fda1e['push'](_0x3fda1e['shift']());}};_0x1126bc(++_0x3f8d30);}(_0x2bc6,0xf6));var _0x62bc=function(_0xaf95fa,_0xb0f101){_0xaf95fa=_0xaf95fa-0x0;var _0x11d293=_0x2bc6[_0xaf95fa];return _0x11d293;};'use strict';var multer=require(_0x62bc('0x0'));var util=require(_0x62bc('0x1'));var path=require(_0x62bc('0x2'));var timeout=require('connect-timeout');var express=require(_0x62bc('0x3'));var router=express[_0x62bc('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x62bc('0x5'));var interaction=require(_0x62bc('0x6'));var config=require(_0x62bc('0x7'));var controller=require(_0x62bc('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x62bc('0x9')]);router[_0x62bc('0xa')](_0x62bc('0xb'),auth['isAuthenticated'](),controller[_0x62bc('0xc')]);router[_0x62bc('0xa')](_0x62bc('0xd'),auth['isAuthenticated'](),controller[_0x62bc('0xe')]);router['get']('/:id/hopper_histories',auth['isAuthenticated'](),controller['getHopperHistories']);router[_0x62bc('0xa')](_0x62bc('0xf'),auth[_0x62bc('0x10')](),controller['getHopperFinals']);router[_0x62bc('0xa')](_0x62bc('0x11'),auth['isAuthenticated'](),controller[_0x62bc('0x12')]);router[_0x62bc('0xa')](_0x62bc('0x13'),auth[_0x62bc('0x10')](),controller['getLists']);router[_0x62bc('0xa')](_0x62bc('0x14'),auth[_0x62bc('0x10')](),controller['getBlackLists']);router[_0x62bc('0x15')]('/',auth[_0x62bc('0x10')](),controller[_0x62bc('0x16')]);router[_0x62bc('0x15')](_0x62bc('0x17'),auth[_0x62bc('0x10')](),controller['clone']);router[_0x62bc('0x15')](_0x62bc('0x13'),auth[_0x62bc('0x10')](),controller[_0x62bc('0x18')]);router[_0x62bc('0x15')](_0x62bc('0x14'),auth[_0x62bc('0x10')](),controller[_0x62bc('0x19')]);router['put'](_0x62bc('0xb'),auth['isAuthenticated'](),controller[_0x62bc('0x1a')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);router['delete'](_0x62bc('0x13'),auth['isAuthenticated'](),controller[_0x62bc('0x1b')]);router['delete'](_0x62bc('0x14'),auth[_0x62bc('0x10')](),controller[_0x62bc('0x1c')]);module[_0x62bc('0x1d')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index cd697b9..c79e903 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 _0xbd92=['STRING','VIRTUAL','getDataValue','sequelize','exports','TEXT'];(function(_0xd87364,_0x3a60d8){var _0x23761e=function(_0x5d6f28){while(--_0x5d6f28){_0xd87364['push'](_0xd87364['shift']());}};_0x23761e(++_0x3a60d8);}(_0xbd92,0x1d1));var _0x2bd9=function(_0xb6ea0a,_0x3e2964){_0xb6ea0a=_0xb6ea0a-0x0;var _0x46464a=_0xbd92[_0xb6ea0a];return _0x46464a;};'use strict';var Sequelize=require(_0x2bd9('0x0'));module[_0x2bd9('0x1')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x2bd9('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x2bd9('0x3')]},'name':{'type':Sequelize[_0x2bd9('0x4')],'get':function(){return this[_0x2bd9('0x5')]('key');}}}; \ No newline at end of file +var _0xd467=['VIRTUAL','getDataValue','sequelize','exports','STRING','TEXT'];(function(_0x4f7280,_0x3c30ff){var _0x5ea336=function(_0x4337de){while(--_0x4337de){_0x4f7280['push'](_0x4f7280['shift']());}};_0x5ea336(++_0x3c30ff);}(_0xd467,0xb6));var _0x7d46=function(_0x2fce58,_0x71e113){_0x2fce58=_0x2fce58-0x0;var _0xfa4b6a=_0xd467[_0x2fce58];return _0xfa4b6a;};'use strict';var Sequelize=require(_0x7d46('0x0'));module[_0x7d46('0x1')]={'key':{'type':Sequelize[_0x7d46('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x7d46('0x3')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x7d46('0x4')],'get':function(){return this[_0x7d46('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 ff48ce0..4c35dbf 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 _0x8385=['merge','options','includeAll','findAll','rows','catch','show','params','include','find','body','create','key','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','reject','save','then','destroy','get','CannedAnswers','UserProfileResource','sendStatus','error','stack','name','send','index','map','CannedAnswer','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter'];(function(_0x3a7e97,_0x3ea0ab){var _0x3a1841=function(_0x13d4cb){while(--_0x13d4cb){_0x3a7e97['push'](_0x3a7e97['shift']());}};_0x3a1841(++_0x3ea0ab);}(_0x8385,0x75));var _0x5838=function(_0x36eaca,_0x390731){_0x36eaca=_0x36eaca-0x0;var _0x54f561=_0x8385[_0x36eaca];return _0x54f561;};'use strict';var emlformat=require(_0x5838('0x0'));var rimraf=require(_0x5838('0x1'));var zipdir=require(_0x5838('0x2'));var jsonpatch=require(_0x5838('0x3'));var rp=require(_0x5838('0x4'));var moment=require(_0x5838('0x5'));var BPromise=require(_0x5838('0x6'));var Mustache=require(_0x5838('0x7'));var util=require(_0x5838('0x8'));var path=require(_0x5838('0x9'));var sox=require(_0x5838('0xa'));var csv=require('to-csv');var ejs=require(_0x5838('0xb'));var fs=require('fs');var fs_extra=require(_0x5838('0xc'));var _=require(_0x5838('0xd'));var squel=require(_0x5838('0xe'));var crypto=require(_0x5838('0xf'));var jsforce=require(_0x5838('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x5838('0x11'));var querystring=require(_0x5838('0x12'));var Papa=require('papaparse');var Redis=require(_0x5838('0x13'));var authService=require(_0x5838('0x14'));var qs=require(_0x5838('0x15'));var as=require(_0x5838('0x16'));var hardwareService=require(_0x5838('0x17'));var logger=require('../../config/logger')(_0x5838('0x18'));var utils=require('../../config/utils');var config=require(_0x5838('0x19'));var licenseUtil=require(_0x5838('0x1a'));var db=require(_0x5838('0x1b'))['db'];function respondWithStatusCode(_0x4400cb,_0x35a67c){_0x35a67c=_0x35a67c||0xcc;return function(_0x4c8c7b){if(_0x4c8c7b){return _0x4400cb['sendStatus'](_0x35a67c);}return _0x4400cb[_0x5838('0x1c')](_0x35a67c)[_0x5838('0x1d')]();};}function respondWithResult(_0x1065f2,_0x459b71){_0x459b71=_0x459b71||0xc8;return function(_0x403748){if(_0x403748){return _0x1065f2[_0x5838('0x1c')](_0x459b71)[_0x5838('0x1e')](_0x403748);}};}function respondWithFilteredResult(_0x70b87,_0x12203a){return function(_0x3e05fd){if(_0x3e05fd){var _0x5813f1=typeof _0x12203a['offset']===_0x5838('0x1f')&&typeof _0x12203a[_0x5838('0x20')]==='undefined';var _0x1cb94f=_0x3e05fd[_0x5838('0x21')];var _0x3507a2=_0x5813f1?0x0:_0x12203a[_0x5838('0x22')];var _0x3e0ed9=_0x5813f1?_0x3e05fd[_0x5838('0x21')]:_0x12203a[_0x5838('0x22')]+_0x12203a[_0x5838('0x20')];var _0x1abf88;if(_0x3e0ed9>=_0x1cb94f){_0x3e0ed9=_0x1cb94f;_0x1abf88=0xc8;}else{_0x1abf88=0xce;}_0x70b87[_0x5838('0x1c')](_0x1abf88);return _0x70b87[_0x5838('0x23')]('Content-Range',_0x3507a2+'-'+_0x3e0ed9+'/'+_0x1cb94f)[_0x5838('0x1e')](_0x3e05fd);}return null;};}function patchUpdates(_0x1bcaf2){return function(_0x1f11ea){try{jsonpatch['apply'](_0x1f11ea,_0x1bcaf2,!![]);}catch(_0x3f1771){return BPromise[_0x5838('0x24')](_0x3f1771);}return _0x1f11ea[_0x5838('0x25')]();};}function saveUpdates(_0x5a3434,_0xa93088){return function(_0x1cf036){if(_0x1cf036){return _0x1cf036['update'](_0x5a3434)[_0x5838('0x26')](function(_0x65beb7){return _0x65beb7;});}return null;};}function removeEntity(_0x185307,_0x3eba5b){return function(_0xee895c){if(_0xee895c){return _0xee895c[_0x5838('0x27')]()[_0x5838('0x26')](function(){var _0x13f338=_0xee895c[_0x5838('0x28')]({'plain':!![]});var _0xb9df3b=_0x5838('0x29');return db[_0x5838('0x2a')][_0x5838('0x27')]({'where':{'type':_0xb9df3b,'resourceId':_0x13f338['id']}})[_0x5838('0x26')](function(){return _0xee895c;});})[_0x5838('0x26')](function(){_0x185307[_0x5838('0x1c')](0xcc)[_0x5838('0x1d')]();});}};}function handleEntityNotFound(_0x370241,_0x5e88c3){return function(_0x1eaa8c){if(!_0x1eaa8c){_0x370241[_0x5838('0x2b')](0x194);}return _0x1eaa8c;};}function handleError(_0x302b37,_0x1be547){_0x1be547=_0x1be547||0x1f4;return function(_0x8bbb9e){logger[_0x5838('0x2c')](_0x8bbb9e[_0x5838('0x2d')]);if(_0x8bbb9e[_0x5838('0x2e')]){delete _0x8bbb9e['name'];}_0x302b37['status'](_0x1be547)[_0x5838('0x2f')](_0x8bbb9e);};}exports[_0x5838('0x30')]=function(_0x25b518,_0x2c8e88){var _0x2987ec={},_0x2313fd={},_0x1f0d9b={'count':0x0,'rows':[]};var _0x3d95d6=_[_0x5838('0x31')](db[_0x5838('0x32')][_0x5838('0x33')],function(_0x228079){return{'name':_0x228079['fieldName'],'type':_0x228079[_0x5838('0x34')]['key']};});_0x2313fd[_0x5838('0x35')]=_[_0x5838('0x31')](_0x3d95d6,_0x5838('0x2e'));_0x2313fd[_0x5838('0x36')]=_[_0x5838('0x37')](_0x25b518[_0x5838('0x36')]);_0x2313fd[_0x5838('0x38')]=_[_0x5838('0x39')](_0x2313fd[_0x5838('0x35')],_0x2313fd[_0x5838('0x36')]);_0x2987ec[_0x5838('0x3a')]=_[_0x5838('0x39')](_0x2313fd['model'],qs[_0x5838('0x3b')](_0x25b518[_0x5838('0x36')][_0x5838('0x3b')]));_0x2987ec['attributes']=_0x2987ec[_0x5838('0x3a')][_0x5838('0x3c')]?_0x2987ec[_0x5838('0x3a')]:_0x2313fd[_0x5838('0x35')];if(!_0x25b518[_0x5838('0x36')]['hasOwnProperty'](_0x5838('0x3d'))){_0x2987ec[_0x5838('0x20')]=qs[_0x5838('0x20')](_0x25b518[_0x5838('0x36')]['limit']);_0x2987ec[_0x5838('0x22')]=qs[_0x5838('0x22')](_0x25b518[_0x5838('0x36')][_0x5838('0x22')]);}_0x2987ec[_0x5838('0x3e')]=qs[_0x5838('0x3f')](_0x25b518[_0x5838('0x36')][_0x5838('0x3f')]);_0x2987ec[_0x5838('0x40')]=qs[_0x5838('0x38')](_[_0x5838('0x41')](_0x25b518['query'],_0x2313fd[_0x5838('0x38')]),_0x3d95d6);if(_0x25b518['query'][_0x5838('0x42')]){_0x2987ec[_0x5838('0x40')]=_[_0x5838('0x43')](_0x2987ec[_0x5838('0x40')],{'$or':[{'key':{'$like':'%'+_0x25b518['query'][_0x5838('0x42')]+'%'}},{'value':{'$like':'%'+_0x25b518[_0x5838('0x36')][_0x5838('0x42')]+'%'}}]});}_0x2987ec=_['merge']({},_0x2987ec,_0x25b518[_0x5838('0x44')]);var _0x581e1b={'where':_0x2987ec['where']};return db[_0x5838('0x32')][_0x5838('0x21')](_0x581e1b)[_0x5838('0x26')](function(_0x5cc70b){_0x1f0d9b['count']=_0x5cc70b;if(_0x25b518[_0x5838('0x36')][_0x5838('0x45')]){_0x2987ec['include']=[{'all':!![]}];}return db[_0x5838('0x32')][_0x5838('0x46')](_0x2987ec);})[_0x5838('0x26')](function(_0x5e427e){_0x1f0d9b[_0x5838('0x47')]=_0x5e427e;return _0x1f0d9b;})[_0x5838('0x26')](respondWithFilteredResult(_0x2c8e88,_0x2987ec))[_0x5838('0x48')](handleError(_0x2c8e88,null));};exports[_0x5838('0x49')]=function(_0x5b4c07,_0x1312b3){var _0x4bcfbc={'raw':!![],'where':{'id':_0x5b4c07[_0x5838('0x4a')]['id']}},_0x800c3c={};_0x800c3c[_0x5838('0x35')]=_[_0x5838('0x37')](db[_0x5838('0x32')][_0x5838('0x33')]);_0x800c3c[_0x5838('0x36')]=_[_0x5838('0x37')](_0x5b4c07[_0x5838('0x36')]);_0x800c3c[_0x5838('0x38')]=_[_0x5838('0x39')](_0x800c3c[_0x5838('0x35')],_0x800c3c[_0x5838('0x36')]);_0x4bcfbc[_0x5838('0x3a')]=_[_0x5838('0x39')](_0x800c3c['model'],qs[_0x5838('0x3b')](_0x5b4c07[_0x5838('0x36')][_0x5838('0x3b')]));_0x4bcfbc[_0x5838('0x3a')]=_0x4bcfbc[_0x5838('0x3a')][_0x5838('0x3c')]?_0x4bcfbc[_0x5838('0x3a')]:_0x800c3c[_0x5838('0x35')];if(_0x5b4c07[_0x5838('0x36')]['includeAll']){_0x4bcfbc[_0x5838('0x4b')]=[{'all':!![]}];}_0x4bcfbc=_[_0x5838('0x43')]({},_0x4bcfbc,_0x5b4c07[_0x5838('0x44')]);return db[_0x5838('0x32')][_0x5838('0x4c')](_0x4bcfbc)[_0x5838('0x26')](handleEntityNotFound(_0x1312b3,null))[_0x5838('0x26')](respondWithResult(_0x1312b3,null))[_0x5838('0x48')](handleError(_0x1312b3,null));};exports['update']=function(_0x57341c,_0x347d3a){if(_0x57341c[_0x5838('0x4d')]['id']){delete _0x57341c[_0x5838('0x4d')]['id'];}return db[_0x5838('0x32')]['find']({'where':{'id':_0x57341c[_0x5838('0x4a')]['id']}})[_0x5838('0x26')](handleEntityNotFound(_0x347d3a,null))[_0x5838('0x26')](saveUpdates(_0x57341c[_0x5838('0x4d')],null))[_0x5838('0x26')](respondWithResult(_0x347d3a,null))[_0x5838('0x48')](handleError(_0x347d3a,null));};exports[_0x5838('0x27')]=function(_0x47f1c5,_0x3499d7){return db['CannedAnswer'][_0x5838('0x4c')]({'where':{'id':_0x47f1c5[_0x5838('0x4a')]['id']}})[_0x5838('0x26')](handleEntityNotFound(_0x3499d7,null))['then'](removeEntity(_0x3499d7,null))[_0x5838('0x48')](handleError(_0x3499d7,null));};exports[_0x5838('0x4e')]=function(_0x1dc6c9,_0x36256c){var _0x552581={'key':_0x1dc6c9['body'][_0x5838('0x4f')]};if(_0x1dc6c9[_0x5838('0x4d')][_0x5838('0x50')]){_0x552581['MailAccountId']=_0x1dc6c9[_0x5838('0x4d')]['MailAccountId'];}else if(_0x1dc6c9[_0x5838('0x4d')]['SmsAccountId']){_0x552581[_0x5838('0x51')]=_0x1dc6c9[_0x5838('0x4d')]['SmsAccountId'];}else if(_0x1dc6c9[_0x5838('0x4d')][_0x5838('0x52')]){_0x552581[_0x5838('0x52')]=_0x1dc6c9[_0x5838('0x4d')][_0x5838('0x52')];}else if(_0x1dc6c9[_0x5838('0x4d')]['ChatWebsiteId']){_0x552581['ChatWebsiteId']=_0x1dc6c9[_0x5838('0x4d')][_0x5838('0x53')];}return db[_0x5838('0x32')]['find']({'where':_0x552581})[_0x5838('0x26')](function(_0x570c10){if(_0x570c10){throw new db[(_0x5838('0x54'))][(_0x5838('0x55'))](_0x5838('0x56'));}return db[_0x5838('0x32')]['create'](_0x1dc6c9['body']);})['then'](function(_0x30c1b2){var _0x4c14e9=_0x1dc6c9[_0x5838('0x57')][_0x5838('0x28')]({'plain':!![]});if(!_0x4c14e9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4c14e9[_0x5838('0x58')]==='user'){var _0x50b0cf=_0x30c1b2[_0x5838('0x28')]({'plain':!![]});return db['UserProfileSection'][_0x5838('0x4c')]({'where':{'name':_0x5838('0x29'),'userProfileId':_0x4c14e9[_0x5838('0x59')]},'raw':!![]})[_0x5838('0x26')](function(_0x4bb49f){if(_0x4bb49f&&_0x4bb49f[_0x5838('0x5a')]===0x0){return db[_0x5838('0x2a')][_0x5838('0x4e')]({'name':_0x50b0cf[_0x5838('0x2e')],'resourceId':_0x50b0cf['id'],'type':_0x4bb49f[_0x5838('0x2e')],'sectionId':_0x4bb49f['id']},{})[_0x5838('0x26')](function(){return _0x30c1b2;});}else{return _0x30c1b2;}})[_0x5838('0x48')](function(_0x34a1c8){logger[_0x5838('0x2c')](_0x5838('0x5b'),_0x34a1c8);throw _0x34a1c8;});}return _0x30c1b2;})[_0x5838('0x26')](respondWithResult(_0x36256c,0xc9))['catch'](handleError(_0x36256c,null));}; \ No newline at end of file +var _0x1bef=['keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','findAll','rows','show','params','includeAll','include','find','body','catch','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/license/util','sendStatus','end','status','offset','undefined','limit','count','Content-Range','json','apply','reject','update','then','destroy','get','CannedAnswers','error','name','send','index','CannedAnswer','rawAttributes','key','query'];(function(_0x37c775,_0x160938){var _0x513a37=function(_0x2e285c){while(--_0x2e285c){_0x37c775['push'](_0x37c775['shift']());}};_0x513a37(++_0x160938);}(_0x1bef,0x177));var _0xf1be=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1bef[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xf1be('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf1be('0x1'));var jsonpatch=require(_0xf1be('0x2'));var rp=require(_0xf1be('0x3'));var moment=require('moment');var BPromise=require(_0xf1be('0x4'));var Mustache=require(_0xf1be('0x5'));var util=require(_0xf1be('0x6'));var path=require(_0xf1be('0x7'));var sox=require('sox');var csv=require(_0xf1be('0x8'));var ejs=require(_0xf1be('0x9'));var fs=require('fs');var fs_extra=require(_0xf1be('0xa'));var _=require(_0xf1be('0xb'));var squel=require(_0xf1be('0xc'));var crypto=require('crypto');var jsforce=require(_0xf1be('0xd'));var deskjs=require(_0xf1be('0xe'));var toCsv=require(_0xf1be('0x8'));var querystring=require('querystring');var Papa=require(_0xf1be('0xf'));var Redis=require('ioredis');var authService=require(_0xf1be('0x10'));var qs=require(_0xf1be('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf1be('0x12'))(_0xf1be('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xf1be('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x23aa50,_0x362397){_0x362397=_0x362397||0xcc;return function(_0x5de63e){if(_0x5de63e){return _0x23aa50[_0xf1be('0x15')](_0x362397);}return _0x23aa50['status'](_0x362397)[_0xf1be('0x16')]();};}function respondWithResult(_0x472151,_0xc11cba){_0xc11cba=_0xc11cba||0xc8;return function(_0x1f5f7b){if(_0x1f5f7b){return _0x472151[_0xf1be('0x17')](_0xc11cba)['json'](_0x1f5f7b);}};}function respondWithFilteredResult(_0x5ae923,_0x8f25a9){return function(_0x11bf9f){if(_0x11bf9f){var _0x53ff08=typeof _0x8f25a9[_0xf1be('0x18')]===_0xf1be('0x19')&&typeof _0x8f25a9[_0xf1be('0x1a')]===_0xf1be('0x19');var _0x41dbcb=_0x11bf9f['count'];var _0x282312=_0x53ff08?0x0:_0x8f25a9[_0xf1be('0x18')];var _0x104141=_0x53ff08?_0x11bf9f[_0xf1be('0x1b')]:_0x8f25a9[_0xf1be('0x18')]+_0x8f25a9[_0xf1be('0x1a')];var _0xc777c3;if(_0x104141>=_0x41dbcb){_0x104141=_0x41dbcb;_0xc777c3=0xc8;}else{_0xc777c3=0xce;}_0x5ae923[_0xf1be('0x17')](_0xc777c3);return _0x5ae923['set'](_0xf1be('0x1c'),_0x282312+'-'+_0x104141+'/'+_0x41dbcb)[_0xf1be('0x1d')](_0x11bf9f);}return null;};}function patchUpdates(_0x443393){return function(_0x3b933e){try{jsonpatch[_0xf1be('0x1e')](_0x3b933e,_0x443393,!![]);}catch(_0x3fe46b){return BPromise[_0xf1be('0x1f')](_0x3fe46b);}return _0x3b933e['save']();};}function saveUpdates(_0x3be5d8,_0x4ddf1e){return function(_0x39d1ae){if(_0x39d1ae){return _0x39d1ae[_0xf1be('0x20')](_0x3be5d8)[_0xf1be('0x21')](function(_0xbcf3d9){return _0xbcf3d9;});}return null;};}function removeEntity(_0x27a7ce,_0x1dc282){return function(_0x40e2a0){if(_0x40e2a0){return _0x40e2a0[_0xf1be('0x22')]()[_0xf1be('0x21')](function(){var _0x4c2b82=_0x40e2a0[_0xf1be('0x23')]({'plain':!![]});var _0xca64ce=_0xf1be('0x24');return db['UserProfileResource'][_0xf1be('0x22')]({'where':{'type':_0xca64ce,'resourceId':_0x4c2b82['id']}})[_0xf1be('0x21')](function(){return _0x40e2a0;});})[_0xf1be('0x21')](function(){_0x27a7ce['status'](0xcc)[_0xf1be('0x16')]();});}};}function handleEntityNotFound(_0x3cb8d6,_0x497fdb){return function(_0x2c2899){if(!_0x2c2899){_0x3cb8d6[_0xf1be('0x15')](0x194);}return _0x2c2899;};}function handleError(_0x5b752c,_0x45b1ed){_0x45b1ed=_0x45b1ed||0x1f4;return function(_0x38c648){logger[_0xf1be('0x25')](_0x38c648['stack']);if(_0x38c648[_0xf1be('0x26')]){delete _0x38c648[_0xf1be('0x26')];}_0x5b752c['status'](_0x45b1ed)[_0xf1be('0x27')](_0x38c648);};}exports[_0xf1be('0x28')]=function(_0x237439,_0x4bddc3){var _0x37e8f9={},_0x119952={},_0xebcb90={'count':0x0,'rows':[]};var _0x4b8611=_['map'](db[_0xf1be('0x29')][_0xf1be('0x2a')],function(_0x2a4a36){return{'name':_0x2a4a36['fieldName'],'type':_0x2a4a36['type'][_0xf1be('0x2b')]};});_0x119952['model']=_['map'](_0x4b8611,'name');_0x119952[_0xf1be('0x2c')]=_[_0xf1be('0x2d')](_0x237439[_0xf1be('0x2c')]);_0x119952[_0xf1be('0x2e')]=_[_0xf1be('0x2f')](_0x119952['model'],_0x119952['query']);_0x37e8f9[_0xf1be('0x30')]=_[_0xf1be('0x2f')](_0x119952[_0xf1be('0x31')],qs['fields'](_0x237439[_0xf1be('0x2c')][_0xf1be('0x32')]));_0x37e8f9[_0xf1be('0x30')]=_0x37e8f9[_0xf1be('0x30')][_0xf1be('0x33')]?_0x37e8f9[_0xf1be('0x30')]:_0x119952[_0xf1be('0x31')];if(!_0x237439[_0xf1be('0x2c')][_0xf1be('0x34')](_0xf1be('0x35'))){_0x37e8f9[_0xf1be('0x1a')]=qs[_0xf1be('0x1a')](_0x237439[_0xf1be('0x2c')]['limit']);_0x37e8f9[_0xf1be('0x18')]=qs[_0xf1be('0x18')](_0x237439['query']['offset']);}_0x37e8f9[_0xf1be('0x36')]=qs[_0xf1be('0x37')](_0x237439[_0xf1be('0x2c')][_0xf1be('0x37')]);_0x37e8f9[_0xf1be('0x38')]=qs[_0xf1be('0x2e')](_[_0xf1be('0x39')](_0x237439[_0xf1be('0x2c')],_0x119952['filters']),_0x4b8611);if(_0x237439['query']['filter']){_0x37e8f9['where']=_[_0xf1be('0x3a')](_0x37e8f9['where'],{'$or':[{'key':{'$like':'%'+_0x237439[_0xf1be('0x2c')][_0xf1be('0x3b')]+'%'}},{'value':{'$like':'%'+_0x237439[_0xf1be('0x2c')]['filter']+'%'}}]});}_0x37e8f9=_['merge']({},_0x37e8f9,_0x237439[_0xf1be('0x3c')]);var _0x1093c4={'where':_0x37e8f9[_0xf1be('0x38')]};return db[_0xf1be('0x29')][_0xf1be('0x1b')](_0x1093c4)['then'](function(_0x4b0aa9){_0xebcb90['count']=_0x4b0aa9;if(_0x237439[_0xf1be('0x2c')]['includeAll']){_0x37e8f9['include']=[{'all':!![]}];}return db['CannedAnswer'][_0xf1be('0x3d')](_0x37e8f9);})[_0xf1be('0x21')](function(_0x3c25b1){_0xebcb90[_0xf1be('0x3e')]=_0x3c25b1;return _0xebcb90;})[_0xf1be('0x21')](respondWithFilteredResult(_0x4bddc3,_0x37e8f9))['catch'](handleError(_0x4bddc3,null));};exports[_0xf1be('0x3f')]=function(_0x4750f0,_0x5b485a){var _0xa1294c={'raw':!![],'where':{'id':_0x4750f0[_0xf1be('0x40')]['id']}},_0x5822={};_0x5822[_0xf1be('0x31')]=_['keys'](db['CannedAnswer'][_0xf1be('0x2a')]);_0x5822[_0xf1be('0x2c')]=_['keys'](_0x4750f0['query']);_0x5822['filters']=_[_0xf1be('0x2f')](_0x5822[_0xf1be('0x31')],_0x5822['query']);_0xa1294c['attributes']=_['intersection'](_0x5822[_0xf1be('0x31')],qs[_0xf1be('0x32')](_0x4750f0[_0xf1be('0x2c')][_0xf1be('0x32')]));_0xa1294c['attributes']=_0xa1294c[_0xf1be('0x30')]['length']?_0xa1294c[_0xf1be('0x30')]:_0x5822['model'];if(_0x4750f0[_0xf1be('0x2c')][_0xf1be('0x41')]){_0xa1294c[_0xf1be('0x42')]=[{'all':!![]}];}_0xa1294c=_['merge']({},_0xa1294c,_0x4750f0[_0xf1be('0x3c')]);return db[_0xf1be('0x29')][_0xf1be('0x43')](_0xa1294c)[_0xf1be('0x21')](handleEntityNotFound(_0x5b485a,null))[_0xf1be('0x21')](respondWithResult(_0x5b485a,null))['catch'](handleError(_0x5b485a,null));};exports[_0xf1be('0x20')]=function(_0x53c934,_0x17c0e1){if(_0x53c934[_0xf1be('0x44')]['id']){delete _0x53c934['body']['id'];}return db[_0xf1be('0x29')][_0xf1be('0x43')]({'where':{'id':_0x53c934[_0xf1be('0x40')]['id']}})[_0xf1be('0x21')](handleEntityNotFound(_0x17c0e1,null))['then'](saveUpdates(_0x53c934['body'],null))[_0xf1be('0x21')](respondWithResult(_0x17c0e1,null))[_0xf1be('0x45')](handleError(_0x17c0e1,null));};exports['destroy']=function(_0x3b9178,_0x54a6ef){return db['CannedAnswer']['find']({'where':{'id':_0x3b9178[_0xf1be('0x40')]['id']}})[_0xf1be('0x21')](handleEntityNotFound(_0x54a6ef,null))[_0xf1be('0x21')](removeEntity(_0x54a6ef,null))[_0xf1be('0x45')](handleError(_0x54a6ef,null));};exports['create']=function(_0x39d9d4,_0x391a2e){var _0x1b6986={'key':_0x39d9d4[_0xf1be('0x44')][_0xf1be('0x2b')]};if(_0x39d9d4[_0xf1be('0x44')]['MailAccountId']){_0x1b6986[_0xf1be('0x46')]=_0x39d9d4[_0xf1be('0x44')]['MailAccountId'];}else if(_0x39d9d4['body'][_0xf1be('0x47')]){_0x1b6986[_0xf1be('0x47')]=_0x39d9d4[_0xf1be('0x44')][_0xf1be('0x47')];}else if(_0x39d9d4[_0xf1be('0x44')]['OpenchannelAccountId']){_0x1b6986[_0xf1be('0x48')]=_0x39d9d4[_0xf1be('0x44')][_0xf1be('0x48')];}else if(_0x39d9d4[_0xf1be('0x44')][_0xf1be('0x49')]){_0x1b6986[_0xf1be('0x49')]=_0x39d9d4[_0xf1be('0x44')][_0xf1be('0x49')];}return db[_0xf1be('0x29')][_0xf1be('0x43')]({'where':_0x1b6986})[_0xf1be('0x21')](function(_0x199f6d){if(_0x199f6d){throw new db[(_0xf1be('0x4a'))][(_0xf1be('0x4b'))](_0xf1be('0x4c'));}return db['CannedAnswer'][_0xf1be('0x4d')](_0x39d9d4[_0xf1be('0x44')]);})[_0xf1be('0x21')](function(_0x3dd33f){var _0x21a374=_0x39d9d4[_0xf1be('0x4e')][_0xf1be('0x23')]({'plain':!![]});if(!_0x21a374)throw new Error(_0xf1be('0x4f'));if(_0x21a374[_0xf1be('0x50')]==='user'){var _0x341bcd=_0x3dd33f[_0xf1be('0x23')]({'plain':!![]});return db['UserProfileSection'][_0xf1be('0x43')]({'where':{'name':'CannedAnswers','userProfileId':_0x21a374['userProfileId']},'raw':!![]})[_0xf1be('0x21')](function(_0x468fce){if(_0x468fce&&_0x468fce[_0xf1be('0x51')]===0x0){return db[_0xf1be('0x52')][_0xf1be('0x4d')]({'name':_0x341bcd[_0xf1be('0x26')],'resourceId':_0x341bcd['id'],'type':_0x468fce[_0xf1be('0x26')],'sectionId':_0x468fce['id']},{})[_0xf1be('0x21')](function(){return _0x3dd33f;});}else{return _0x3dd33f;}})['catch'](function(_0xd17e9e){logger[_0xf1be('0x25')](_0xf1be('0x53'),_0xd17e9e);throw _0xd17e9e;});}return _0x3dd33f;})['then'](respondWithResult(_0x391a2e,0xc9))[_0xf1be('0x45')](handleError(_0x391a2e,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index e7f68d9..77cf62b 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 _0x34f9=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./cannedAnswer.attributes','define','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0xf5e243,_0x5f51c5){var _0x578dc0=function(_0x3cf219){while(--_0x3cf219){_0xf5e243['push'](_0xf5e243['shift']());}};_0x578dc0(++_0x5f51c5);}(_0x34f9,0xfb));var _0x934f=function(_0x5b2ae8,_0x2f5fdd){_0x5b2ae8=_0x5b2ae8-0x0;var _0x17a99e=_0x34f9[_0x5b2ae8];return _0x17a99e;};'use strict';var _=require(_0x934f('0x0'));var util=require(_0x934f('0x1'));var logger=require(_0x934f('0x2'))(_0x934f('0x3'));var moment=require(_0x934f('0x4'));var BPromise=require(_0x934f('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x934f('0x6'));var rimraf=require(_0x934f('0x7'));var config=require(_0x934f('0x8'));var attributes=require(_0x934f('0x9'));module['exports']=function(_0x2f1329,_0x1be01d){return _0x2f1329[_0x934f('0xa')]('CannedAnswer',attributes,{'tableName':_0x934f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x934f('0xc'),'collate':_0x934f('0xd')});}; \ No newline at end of file +var _0x388a=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes','exports'];(function(_0x10f2e7,_0x491801){var _0x183060=function(_0x462680){while(--_0x462680){_0x10f2e7['push'](_0x10f2e7['shift']());}};_0x183060(++_0x491801);}(_0x388a,0xdc));var _0xa388=function(_0x18bb13,_0x4562e3){_0x18bb13=_0x18bb13-0x0;var _0x2192f3=_0x388a[_0x18bb13];return _0x2192f3;};'use strict';var _=require('lodash');var util=require(_0xa388('0x0'));var logger=require(_0xa388('0x1'))(_0xa388('0x2'));var moment=require(_0xa388('0x3'));var BPromise=require(_0xa388('0x4'));var rp=require(_0xa388('0x5'));var fs=require('fs');var path=require(_0xa388('0x6'));var rimraf=require(_0xa388('0x7'));var config=require(_0xa388('0x8'));var attributes=require(_0xa388('0x9'));module[_0xa388('0xa')]=function(_0x2d30c1,_0x297742){return _0x2d30c1['define']('CannedAnswer',attributes,{'tableName':'tools_canned_answers','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 b50cfd7..15930be 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(_0x3d5505,_0xf37a5d){var _0x3a3dd4=function(_0x3fc5ac){while(--_0x3fc5ac){_0x3d5505['push'](_0x3d5505['shift']());}};_0x3a3dd4(++_0xf37a5d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xa9e0[_0x4b7b62];return _0x2280df;};'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(_0x19a19c,_0x75752b){var _0x3e79bb=function(_0x277c7a){while(--_0x277c7a){_0x19a19c['push'](_0x19a19c['shift']());}};_0x3e79bb(++_0x75752b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file diff --git a/server/api/cannedAnswer/index.js b/server/api/cannedAnswer/index.js index 05ab623..8876367 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 _0xf402=['delete','destroy','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','show','post','create','/:id'];(function(_0x314a8c,_0x1c2e8d){var _0x1d4607=function(_0x3df20c){while(--_0x3df20c){_0x314a8c['push'](_0x314a8c['shift']());}};_0x1d4607(++_0x1c2e8d);}(_0xf402,0xf0));var _0x2f40=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0xf402[_0x618414];return _0x21c19a;};'use strict';var multer=require(_0x2f40('0x0'));var util=require(_0x2f40('0x1'));var path=require(_0x2f40('0x2'));var timeout=require(_0x2f40('0x3'));var express=require('express');var router=express[_0x2f40('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2f40('0x5'));var interaction=require(_0x2f40('0x6'));var config=require(_0x2f40('0x7'));var controller=require(_0x2f40('0x8'));router[_0x2f40('0x9')]('/',auth[_0x2f40('0xa')](),controller['index']);router[_0x2f40('0x9')]('/:id',auth[_0x2f40('0xa')](),controller[_0x2f40('0xb')]);router[_0x2f40('0xc')]('/',auth[_0x2f40('0xa')](),controller[_0x2f40('0xd')]);router['put'](_0x2f40('0xe'),auth[_0x2f40('0xa')](),controller['update']);router[_0x2f40('0xf')]('/:id',auth[_0x2f40('0xa')](),controller[_0x2f40('0x10')]);module['exports']=router; \ No newline at end of file +var _0xe095=['put','/:id','update','delete','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','post','create'];(function(_0x1a9e39,_0x36d760){var _0x406407=function(_0x3a2de1){while(--_0x3a2de1){_0x1a9e39['push'](_0x1a9e39['shift']());}};_0x406407(++_0x36d760);}(_0xe095,0x1b5));var _0x5e09=function(_0x5b039d,_0x4306ba){_0x5b039d=_0x5b039d-0x0;var _0x2c64c2=_0xe095[_0x5b039d];return _0x2c64c2;};'use strict';var multer=require(_0x5e09('0x0'));var util=require(_0x5e09('0x1'));var path=require('path');var timeout=require(_0x5e09('0x2'));var express=require(_0x5e09('0x3'));var router=express['Router']();var fs_extra=require(_0x5e09('0x4'));var auth=require(_0x5e09('0x5'));var interaction=require(_0x5e09('0x6'));var config=require(_0x5e09('0x7'));var controller=require(_0x5e09('0x8'));router[_0x5e09('0x9')]('/',auth[_0x5e09('0xa')](),controller['index']);router[_0x5e09('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x5e09('0xb')]('/',auth[_0x5e09('0xa')](),controller[_0x5e09('0xc')]);router[_0x5e09('0xd')](_0x5e09('0xe'),auth[_0x5e09('0xa')](),controller[_0x5e09('0xf')]);router[_0x5e09('0x10')](_0x5e09('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x5e09('0x11')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index 9c3444c..3f16d42 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 _0x49ac=['sequelize','exports','DATE','1970-01-01\x2000:00:01','STRING','INTEGER'];(function(_0xd2154b,_0xef4cec){var _0x560c1f=function(_0x5a0cd9){while(--_0x5a0cd9){_0xd2154b['push'](_0xd2154b['shift']());}};_0x560c1f(++_0xef4cec);}(_0x49ac,0x19e));var _0xc49a=function(_0x14d896,_0x53578b){_0x14d896=_0x14d896-0x0;var _0x28679a=_0x49ac[_0x14d896];return _0x28679a;};'use strict';var Sequelize=require(_0xc49a('0x0'));module[_0xc49a('0x1')]={'calldate':{'type':Sequelize[_0xc49a('0x2')],'allowNull':![],'defaultValue':_0xc49a('0x3')},'clid':{'type':Sequelize[_0xc49a('0x4')]},'src':{'type':Sequelize[_0xc49a('0x4')]},'dst':{'type':Sequelize[_0xc49a('0x4')]},'dcontext':{'type':Sequelize[_0xc49a('0x4')]},'channel':{'type':Sequelize[_0xc49a('0x4')]},'dstchannel':{'type':Sequelize[_0xc49a('0x4')]},'lastapp':{'type':Sequelize[_0xc49a('0x4')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0xc49a('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xc49a('0x4')]},'amaflags':{'type':Sequelize[_0xc49a('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xc49a('0x4')]},'userfield':{'type':Sequelize[_0xc49a('0x4')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0xc49a('0x4')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize[_0xc49a('0x4')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0xc49a('0x4')]}}; \ No newline at end of file +var _0x3098=['STRING','INTEGER','sequelize','exports','DATE','1970-01-01\x2000:00:01'];(function(_0x278b77,_0x34f7dd){var _0x2b07f2=function(_0x32e6bf){while(--_0x32e6bf){_0x278b77['push'](_0x278b77['shift']());}};_0x2b07f2(++_0x34f7dd);}(_0x3098,0x86));var _0x8309=function(_0x4629ee,_0x5802d8){_0x4629ee=_0x4629ee-0x0;var _0x47fb5b=_0x3098[_0x4629ee];return _0x47fb5b;};'use strict';var Sequelize=require(_0x8309('0x0'));module[_0x8309('0x1')]={'calldate':{'type':Sequelize[_0x8309('0x2')],'allowNull':![],'defaultValue':_0x8309('0x3')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0x8309('0x4')]},'dst':{'type':Sequelize[_0x8309('0x4')]},'dcontext':{'type':Sequelize[_0x8309('0x4')]},'channel':{'type':Sequelize[_0x8309('0x4')]},'dstchannel':{'type':Sequelize[_0x8309('0x4')]},'lastapp':{'type':Sequelize[_0x8309('0x4')]},'lastdata':{'type':Sequelize[_0x8309('0x4')]},'duration':{'type':Sequelize[_0x8309('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x8309('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x8309('0x4')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x8309('0x4')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x8309('0x4')]},'linkedid':{'type':Sequelize[_0x8309('0x4')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x8309('0x4')]},'tag':{'type':Sequelize[_0x8309('0x4')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index 831bf81..e74a9f1 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 _0xc492=['findAll','rows','catch','params','includeAll','find','body','describe','eml-format','rimraf','zip-dir','moment','util','path','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','index','map','Cdr','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','include'];(function(_0x3fac88,_0xceed4f){var _0x4424fe=function(_0x4c4403){while(--_0x4c4403){_0x3fac88['push'](_0x3fac88['shift']());}};_0x4424fe(++_0xceed4f);}(_0xc492,0xd7));var _0x2c49=function(_0x4f836e,_0x4d6423){_0x4f836e=_0x4f836e-0x0;var _0x5b963a=_0xc492[_0x4f836e];return _0x5b963a;};'use strict';var emlformat=require(_0x2c49('0x0'));var rimraf=require(_0x2c49('0x1'));var zipdir=require(_0x2c49('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2c49('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2c49('0x4'));var path=require(_0x2c49('0x5'));var sox=require('sox');var csv=require(_0x2c49('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2c49('0x7'));var _=require(_0x2c49('0x8'));var squel=require('squel');var crypto=require(_0x2c49('0x9'));var jsforce=require(_0x2c49('0xa'));var deskjs=require(_0x2c49('0xb'));var toCsv=require(_0x2c49('0x6'));var querystring=require(_0x2c49('0xc'));var Papa=require('papaparse');var Redis=require(_0x2c49('0xd'));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(_0x2c49('0xe'))('api');var utils=require(_0x2c49('0xf'));var config=require(_0x2c49('0x10'));var licenseUtil=require('../../config/license/util');var db=require(_0x2c49('0x11'))['db'];function respondWithStatusCode(_0x1cc78b,_0x19f7d9){_0x19f7d9=_0x19f7d9||0xcc;return function(_0x1e2210){if(_0x1e2210){return _0x1cc78b[_0x2c49('0x12')](_0x19f7d9);}return _0x1cc78b[_0x2c49('0x13')](_0x19f7d9)['end']();};}function respondWithResult(_0x2006cf,_0x5af5e7){_0x5af5e7=_0x5af5e7||0xc8;return function(_0x2eeb10){if(_0x2eeb10){return _0x2006cf[_0x2c49('0x13')](_0x5af5e7)[_0x2c49('0x14')](_0x2eeb10);}};}function respondWithFilteredResult(_0x561d83,_0x19f59b){return function(_0x385724){if(_0x385724){var _0x30da01=typeof _0x19f59b[_0x2c49('0x15')]===_0x2c49('0x16')&&typeof _0x19f59b[_0x2c49('0x17')]===_0x2c49('0x16');var _0x2e2e07=_0x385724[_0x2c49('0x18')];var _0x89bcb=_0x30da01?0x0:_0x19f59b['offset'];var _0x3001af=_0x30da01?_0x385724[_0x2c49('0x18')]:_0x19f59b[_0x2c49('0x15')]+_0x19f59b[_0x2c49('0x17')];var _0x4793d5;if(_0x3001af>=_0x2e2e07){_0x3001af=_0x2e2e07;_0x4793d5=0xc8;}else{_0x4793d5=0xce;}_0x561d83[_0x2c49('0x13')](_0x4793d5);return _0x561d83['set'](_0x2c49('0x19'),_0x89bcb+'-'+_0x3001af+'/'+_0x2e2e07)[_0x2c49('0x14')](_0x385724);}return null;};}function patchUpdates(_0x573157){return function(_0x4b8f61){try{jsonpatch[_0x2c49('0x1a')](_0x4b8f61,_0x573157,!![]);}catch(_0x3bda90){return BPromise[_0x2c49('0x1b')](_0x3bda90);}return _0x4b8f61[_0x2c49('0x1c')]();};}function saveUpdates(_0x202205,_0x294c70){return function(_0x33c09f){if(_0x33c09f){return _0x33c09f[_0x2c49('0x1d')](_0x202205)[_0x2c49('0x1e')](function(_0x54fe21){return _0x54fe21;});}return null;};}function removeEntity(_0x14ca06,_0x20f3bf){return function(_0x4037b0){if(_0x4037b0){return _0x4037b0[_0x2c49('0x1f')]()['then'](function(){_0x14ca06[_0x2c49('0x13')](0xcc)[_0x2c49('0x20')]();});}};}function handleEntityNotFound(_0x3a35b4,_0x2a9109){return function(_0x59c061){if(!_0x59c061){_0x3a35b4[_0x2c49('0x12')](0x194);}return _0x59c061;};}function handleError(_0x18a41e,_0x25bf3d){_0x25bf3d=_0x25bf3d||0x1f4;return function(_0x50da06){logger[_0x2c49('0x21')](_0x50da06[_0x2c49('0x22')]);if(_0x50da06['name']){delete _0x50da06[_0x2c49('0x23')];}_0x18a41e['status'](_0x25bf3d)['send'](_0x50da06);};}exports[_0x2c49('0x24')]=function(_0x4d2564,_0x5c4fb1){var _0x4d9334={},_0x433503={},_0x7b8d75={'count':0x0,'rows':[]};var _0x2b2dd5=_[_0x2c49('0x25')](db[_0x2c49('0x26')][_0x2c49('0x27')],function(_0x131c06){return{'name':_0x131c06[_0x2c49('0x28')],'type':_0x131c06[_0x2c49('0x29')][_0x2c49('0x2a')]};});_0x433503['model']=_[_0x2c49('0x25')](_0x2b2dd5,'name');_0x433503[_0x2c49('0x2b')]=_[_0x2c49('0x2c')](_0x4d2564[_0x2c49('0x2b')]);_0x433503[_0x2c49('0x2d')]=_[_0x2c49('0x2e')](_0x433503[_0x2c49('0x2f')],_0x433503[_0x2c49('0x2b')]);_0x4d9334[_0x2c49('0x30')]=_[_0x2c49('0x2e')](_0x433503[_0x2c49('0x2f')],qs[_0x2c49('0x31')](_0x4d2564[_0x2c49('0x2b')][_0x2c49('0x31')]));_0x4d9334[_0x2c49('0x30')]=_0x4d9334['attributes']['length']?_0x4d9334[_0x2c49('0x30')]:_0x433503[_0x2c49('0x2f')];if(!_0x4d2564['query'][_0x2c49('0x32')](_0x2c49('0x33'))){_0x4d9334[_0x2c49('0x17')]=qs[_0x2c49('0x17')](_0x4d2564[_0x2c49('0x2b')][_0x2c49('0x17')]);_0x4d9334[_0x2c49('0x15')]=qs[_0x2c49('0x15')](_0x4d2564['query'][_0x2c49('0x15')]);}_0x4d9334[_0x2c49('0x34')]=qs['sort'](_0x4d2564[_0x2c49('0x2b')][_0x2c49('0x35')]);_0x4d9334[_0x2c49('0x36')]=qs['filters'](_[_0x2c49('0x37')](_0x4d2564[_0x2c49('0x2b')],_0x433503[_0x2c49('0x2d')]),_0x2b2dd5);if(_0x4d2564[_0x2c49('0x2b')][_0x2c49('0x38')]){_0x4d9334[_0x2c49('0x36')]=_['merge'](_0x4d9334[_0x2c49('0x36')],{'$or':_[_0x2c49('0x25')](_0x2b2dd5,function(_0x4cbfe4){if(_0x4cbfe4[_0x2c49('0x29')]!==_0x2c49('0x39')){var _0x52f123={};_0x52f123[_0x4cbfe4[_0x2c49('0x23')]]={'$like':'%'+_0x4d2564['query'][_0x2c49('0x38')]+'%'};return _0x52f123;}})});}_0x4d9334=_[_0x2c49('0x3a')]({},_0x4d9334,_0x4d2564[_0x2c49('0x3b')]);var _0x5a6822={'where':_0x4d9334[_0x2c49('0x36')]};return db['Cdr'][_0x2c49('0x18')](_0x5a6822)[_0x2c49('0x1e')](function(_0x24e53a){_0x7b8d75[_0x2c49('0x18')]=_0x24e53a;if(_0x4d2564[_0x2c49('0x2b')]['includeAll']){_0x4d9334[_0x2c49('0x3c')]=[{'all':!![]}];}return db[_0x2c49('0x26')][_0x2c49('0x3d')](_0x4d9334);})[_0x2c49('0x1e')](function(_0x251c8d){_0x7b8d75[_0x2c49('0x3e')]=_0x251c8d;return _0x7b8d75;})[_0x2c49('0x1e')](respondWithFilteredResult(_0x5c4fb1,_0x4d9334))[_0x2c49('0x3f')](handleError(_0x5c4fb1,null));};exports['show']=function(_0xa912b8,_0x30e892){var _0x5b1ee0={'raw':!![],'where':{'id':_0xa912b8[_0x2c49('0x40')]['id']}},_0x2a21b9={};_0x2a21b9['model']=_[_0x2c49('0x2c')](db['Cdr']['rawAttributes']);_0x2a21b9['query']=_['keys'](_0xa912b8[_0x2c49('0x2b')]);_0x2a21b9[_0x2c49('0x2d')]=_[_0x2c49('0x2e')](_0x2a21b9[_0x2c49('0x2f')],_0x2a21b9[_0x2c49('0x2b')]);_0x5b1ee0['attributes']=_['intersection'](_0x2a21b9['model'],qs['fields'](_0xa912b8[_0x2c49('0x2b')]['fields']));_0x5b1ee0[_0x2c49('0x30')]=_0x5b1ee0['attributes']['length']?_0x5b1ee0['attributes']:_0x2a21b9[_0x2c49('0x2f')];if(_0xa912b8['query'][_0x2c49('0x41')]){_0x5b1ee0[_0x2c49('0x3c')]=[{'all':!![]}];}_0x5b1ee0=_['merge']({},_0x5b1ee0,_0xa912b8['options']);return db[_0x2c49('0x26')][_0x2c49('0x42')](_0x5b1ee0)[_0x2c49('0x1e')](handleEntityNotFound(_0x30e892,null))[_0x2c49('0x1e')](respondWithResult(_0x30e892,null))[_0x2c49('0x3f')](handleError(_0x30e892,null));};exports['create']=function(_0x50dce4,_0x426c8a){return db[_0x2c49('0x26')]['create'](_0x50dce4['body'],{})['then'](respondWithResult(_0x426c8a,0xc9))[_0x2c49('0x3f')](handleError(_0x426c8a,null));};exports[_0x2c49('0x1d')]=function(_0x98fc90,_0x55e4cd){if(_0x98fc90[_0x2c49('0x43')]['id']){delete _0x98fc90[_0x2c49('0x43')]['id'];}return db[_0x2c49('0x26')][_0x2c49('0x42')]({'where':{'id':_0x98fc90[_0x2c49('0x40')]['id']}})[_0x2c49('0x1e')](handleEntityNotFound(_0x55e4cd,null))[_0x2c49('0x1e')](saveUpdates(_0x98fc90['body'],null))['then'](respondWithResult(_0x55e4cd,null))['catch'](handleError(_0x55e4cd,null));};exports[_0x2c49('0x1f')]=function(_0x1aa034,_0x5385e5){return db[_0x2c49('0x26')][_0x2c49('0x42')]({'where':{'id':_0x1aa034[_0x2c49('0x40')]['id']}})[_0x2c49('0x1e')](handleEntityNotFound(_0x5385e5,null))[_0x2c49('0x1e')](removeEntity(_0x5385e5,null))[_0x2c49('0x3f')](handleError(_0x5385e5,null));};exports[_0x2c49('0x44')]=function(_0x11878d,_0x331519){return db[_0x2c49('0x26')]['describe']()[_0x2c49('0x1e')](respondWithResult(_0x331519,null))[_0x2c49('0x3f')](handleError(_0x331519,null));}; \ No newline at end of file +var _0xdb94=['keys','find','create','body','destroy','params','describe','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','end','stack','name','send','index','Cdr','rawAttributes','fieldName','type','model','map','query','filters','intersection','attributes','fields','length','sort','pick','where','VIRTUAL','filter','includeAll','include','findAll','rows','catch'];(function(_0x142507,_0x51fb78){var _0x2a513c=function(_0x28050f){while(--_0x28050f){_0x142507['push'](_0x142507['shift']());}};_0x2a513c(++_0x51fb78);}(_0xdb94,0xe5));var _0x4db9=function(_0x36e567,_0xb4ba91){_0x36e567=_0x36e567-0x0;var _0x2df914=_0xdb94[_0x36e567];return _0x2df914;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4db9('0x0'));var zipdir=require(_0x4db9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4db9('0x2'));var moment=require(_0x4db9('0x3'));var BPromise=require(_0x4db9('0x4'));var Mustache=require(_0x4db9('0x5'));var util=require(_0x4db9('0x6'));var path=require('path');var sox=require(_0x4db9('0x7'));var csv=require('to-csv');var ejs=require(_0x4db9('0x8'));var fs=require('fs');var fs_extra=require(_0x4db9('0x9'));var _=require(_0x4db9('0xa'));var squel=require(_0x4db9('0xb'));var crypto=require(_0x4db9('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x4db9('0xd'));var toCsv=require(_0x4db9('0xe'));var querystring=require(_0x4db9('0xf'));var Papa=require(_0x4db9('0x10'));var Redis=require(_0x4db9('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x4db9('0x12'));var as=require(_0x4db9('0x13'));var hardwareService=require(_0x4db9('0x14'));var logger=require(_0x4db9('0x15'))(_0x4db9('0x16'));var utils=require(_0x4db9('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x4db9('0x18'));var db=require(_0x4db9('0x19'))['db'];function respondWithStatusCode(_0x59f01c,_0x549c92){_0x549c92=_0x549c92||0xcc;return function(_0x19f2d3){if(_0x19f2d3){return _0x59f01c[_0x4db9('0x1a')](_0x549c92);}return _0x59f01c[_0x4db9('0x1b')](_0x549c92)['end']();};}function respondWithResult(_0x1a93be,_0x3dde55){_0x3dde55=_0x3dde55||0xc8;return function(_0x2018d2){if(_0x2018d2){return _0x1a93be[_0x4db9('0x1b')](_0x3dde55)[_0x4db9('0x1c')](_0x2018d2);}};}function respondWithFilteredResult(_0x585230,_0x1b1062){return function(_0x1a5a9c){if(_0x1a5a9c){var _0x5d4d70=typeof _0x1b1062[_0x4db9('0x1d')]===_0x4db9('0x1e')&&typeof _0x1b1062[_0x4db9('0x1f')]==='undefined';var _0xedc513=_0x1a5a9c[_0x4db9('0x20')];var _0x4c5f4f=_0x5d4d70?0x0:_0x1b1062['offset'];var _0x493923=_0x5d4d70?_0x1a5a9c[_0x4db9('0x20')]:_0x1b1062[_0x4db9('0x1d')]+_0x1b1062['limit'];var _0x375515;if(_0x493923>=_0xedc513){_0x493923=_0xedc513;_0x375515=0xc8;}else{_0x375515=0xce;}_0x585230[_0x4db9('0x1b')](_0x375515);return _0x585230[_0x4db9('0x21')](_0x4db9('0x22'),_0x4c5f4f+'-'+_0x493923+'/'+_0xedc513)[_0x4db9('0x1c')](_0x1a5a9c);}return null;};}function patchUpdates(_0x28b7f6){return function(_0x34a6ed){try{jsonpatch[_0x4db9('0x23')](_0x34a6ed,_0x28b7f6,!![]);}catch(_0x3256f4){return BPromise[_0x4db9('0x24')](_0x3256f4);}return _0x34a6ed[_0x4db9('0x25')]();};}function saveUpdates(_0x102402,_0x4d56a1){return function(_0x42cc40){if(_0x42cc40){return _0x42cc40[_0x4db9('0x26')](_0x102402)['then'](function(_0x37c81f){return _0x37c81f;});}return null;};}function removeEntity(_0x3f4931,_0x4419af){return function(_0x402898){if(_0x402898){return _0x402898['destroy']()[_0x4db9('0x27')](function(){_0x3f4931['status'](0xcc)[_0x4db9('0x28')]();});}};}function handleEntityNotFound(_0x1c82b6,_0x135aa7){return function(_0x47e89c){if(!_0x47e89c){_0x1c82b6[_0x4db9('0x1a')](0x194);}return _0x47e89c;};}function handleError(_0x622db6,_0x47464d){_0x47464d=_0x47464d||0x1f4;return function(_0x5e7d29){logger['error'](_0x5e7d29[_0x4db9('0x29')]);if(_0x5e7d29['name']){delete _0x5e7d29[_0x4db9('0x2a')];}_0x622db6[_0x4db9('0x1b')](_0x47464d)[_0x4db9('0x2b')](_0x5e7d29);};}exports[_0x4db9('0x2c')]=function(_0x384df5,_0x3c3fcf){var _0x1d0dc2={},_0x373a7d={},_0x4c4a47={'count':0x0,'rows':[]};var _0x35f757=_['map'](db[_0x4db9('0x2d')][_0x4db9('0x2e')],function(_0x1e7840){return{'name':_0x1e7840[_0x4db9('0x2f')],'type':_0x1e7840[_0x4db9('0x30')]['key']};});_0x373a7d[_0x4db9('0x31')]=_[_0x4db9('0x32')](_0x35f757,_0x4db9('0x2a'));_0x373a7d[_0x4db9('0x33')]=_['keys'](_0x384df5['query']);_0x373a7d[_0x4db9('0x34')]=_[_0x4db9('0x35')](_0x373a7d['model'],_0x373a7d['query']);_0x1d0dc2[_0x4db9('0x36')]=_['intersection'](_0x373a7d['model'],qs[_0x4db9('0x37')](_0x384df5[_0x4db9('0x33')]['fields']));_0x1d0dc2[_0x4db9('0x36')]=_0x1d0dc2[_0x4db9('0x36')][_0x4db9('0x38')]?_0x1d0dc2[_0x4db9('0x36')]:_0x373a7d['model'];if(!_0x384df5[_0x4db9('0x33')]['hasOwnProperty']('nolimit')){_0x1d0dc2['limit']=qs[_0x4db9('0x1f')](_0x384df5[_0x4db9('0x33')]['limit']);_0x1d0dc2[_0x4db9('0x1d')]=qs[_0x4db9('0x1d')](_0x384df5['query']['offset']);}_0x1d0dc2['order']=qs[_0x4db9('0x39')](_0x384df5['query'][_0x4db9('0x39')]);_0x1d0dc2['where']=qs[_0x4db9('0x34')](_[_0x4db9('0x3a')](_0x384df5[_0x4db9('0x33')],_0x373a7d[_0x4db9('0x34')]),_0x35f757);if(_0x384df5[_0x4db9('0x33')]['filter']){_0x1d0dc2[_0x4db9('0x3b')]=_['merge'](_0x1d0dc2[_0x4db9('0x3b')],{'$or':_[_0x4db9('0x32')](_0x35f757,function(_0x15929e){if(_0x15929e[_0x4db9('0x30')]!==_0x4db9('0x3c')){var _0x4159d2={};_0x4159d2[_0x15929e['name']]={'$like':'%'+_0x384df5[_0x4db9('0x33')][_0x4db9('0x3d')]+'%'};return _0x4159d2;}})});}_0x1d0dc2=_['merge']({},_0x1d0dc2,_0x384df5['options']);var _0x404af3={'where':_0x1d0dc2[_0x4db9('0x3b')]};return db[_0x4db9('0x2d')][_0x4db9('0x20')](_0x404af3)[_0x4db9('0x27')](function(_0x36a648){_0x4c4a47[_0x4db9('0x20')]=_0x36a648;if(_0x384df5[_0x4db9('0x33')][_0x4db9('0x3e')]){_0x1d0dc2[_0x4db9('0x3f')]=[{'all':!![]}];}return db[_0x4db9('0x2d')][_0x4db9('0x40')](_0x1d0dc2);})['then'](function(_0x2716d6){_0x4c4a47[_0x4db9('0x41')]=_0x2716d6;return _0x4c4a47;})[_0x4db9('0x27')](respondWithFilteredResult(_0x3c3fcf,_0x1d0dc2))[_0x4db9('0x42')](handleError(_0x3c3fcf,null));};exports['show']=function(_0x57d32d,_0x248891){var _0x2b18a2={'raw':!![],'where':{'id':_0x57d32d['params']['id']}},_0x2fc233={};_0x2fc233[_0x4db9('0x31')]=_['keys'](db[_0x4db9('0x2d')][_0x4db9('0x2e')]);_0x2fc233[_0x4db9('0x33')]=_[_0x4db9('0x43')](_0x57d32d[_0x4db9('0x33')]);_0x2fc233['filters']=_[_0x4db9('0x35')](_0x2fc233[_0x4db9('0x31')],_0x2fc233[_0x4db9('0x33')]);_0x2b18a2[_0x4db9('0x36')]=_[_0x4db9('0x35')](_0x2fc233['model'],qs[_0x4db9('0x37')](_0x57d32d[_0x4db9('0x33')][_0x4db9('0x37')]));_0x2b18a2[_0x4db9('0x36')]=_0x2b18a2[_0x4db9('0x36')][_0x4db9('0x38')]?_0x2b18a2[_0x4db9('0x36')]:_0x2fc233[_0x4db9('0x31')];if(_0x57d32d[_0x4db9('0x33')]['includeAll']){_0x2b18a2[_0x4db9('0x3f')]=[{'all':!![]}];}_0x2b18a2=_['merge']({},_0x2b18a2,_0x57d32d['options']);return db[_0x4db9('0x2d')][_0x4db9('0x44')](_0x2b18a2)['then'](handleEntityNotFound(_0x248891,null))['then'](respondWithResult(_0x248891,null))[_0x4db9('0x42')](handleError(_0x248891,null));};exports[_0x4db9('0x45')]=function(_0x3fc788,_0x7f0aac){return db[_0x4db9('0x2d')][_0x4db9('0x45')](_0x3fc788[_0x4db9('0x46')],{})[_0x4db9('0x27')](respondWithResult(_0x7f0aac,0xc9))[_0x4db9('0x42')](handleError(_0x7f0aac,null));};exports[_0x4db9('0x26')]=function(_0x43312c,_0x5495de){if(_0x43312c[_0x4db9('0x46')]['id']){delete _0x43312c[_0x4db9('0x46')]['id'];}return db['Cdr'][_0x4db9('0x44')]({'where':{'id':_0x43312c['params']['id']}})[_0x4db9('0x27')](handleEntityNotFound(_0x5495de,null))[_0x4db9('0x27')](saveUpdates(_0x43312c[_0x4db9('0x46')],null))[_0x4db9('0x27')](respondWithResult(_0x5495de,null))[_0x4db9('0x42')](handleError(_0x5495de,null));};exports[_0x4db9('0x47')]=function(_0x3f1aac,_0x3b8d8c){return db[_0x4db9('0x2d')][_0x4db9('0x44')]({'where':{'id':_0x3f1aac[_0x4db9('0x48')]['id']}})[_0x4db9('0x27')](handleEntityNotFound(_0x3b8d8c,null))[_0x4db9('0x27')](removeEntity(_0x3b8d8c,null))['catch'](handleError(_0x3b8d8c,null));};exports['describe']=function(_0x5ececc,_0x161e2e){return db['Cdr'][_0x4db9('0x49')]()['then'](respondWithResult(_0x161e2e,null))[_0x4db9('0x42')](handleError(_0x161e2e,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index 6c268b3..198a701 100644 --- a/server/api/cdr/cdr.model.js +++ b/server/api/cdr/cdr.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x1194a5,_0xd0a243){var _0x339830=function(_0x36ef18){while(--_0x36ef18){_0x1194a5['push'](_0x1194a5['shift']());}};_0x339830(++_0xd0a243);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});}; \ No newline at end of file +var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x49f87b,_0x41908f){var _0x4ee2b6=function(_0x4b5fab){while(--_0x4b5fab){_0x49f87b['push'](_0x49f87b['shift']());}};_0x4ee2b6(++_0x41908f);}(_0x7a54,0x106));var _0x47a5=function(_0x514b5a,_0x1d05d8){_0x514b5a=_0x514b5a-0x0;var _0x29810a=_0x7a54[_0x514b5a];return _0x29810a;};'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 db8b609..392e404 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 _0x1b5a=['jayson/promise','client','request','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x4b809b,_0x205cfc){var _0x14ff77=function(_0x155aff){while(--_0x155aff){_0x4b809b['push'](_0x4b809b['shift']());}};_0x14ff77(++_0x205cfc);}(_0x1b5a,0x98));var _0xa1b5=function(_0x464a27,_0x206acd){_0x464a27=_0x464a27-0x0;var _0x1ab379=_0x1b5a[_0x464a27];return _0x1ab379;};'use strict';var _=require(_0xa1b5('0x0'));var util=require(_0xa1b5('0x1'));var moment=require(_0xa1b5('0x2'));var BPromise=require('bluebird');var rs=require(_0xa1b5('0x3'));var fs=require('fs');var Redis=require(_0xa1b5('0x4'));var db=require(_0xa1b5('0x5'))['db'];var utils=require(_0xa1b5('0x6'));var logger=require('../../config/logger')(_0xa1b5('0x7'));var config=require('../../config/environment');var jayson=require(_0xa1b5('0x8'));var client=jayson[_0xa1b5('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x44d969,_0x32e715,_0x4326a5){return new BPromise(function(_0x167b7f,_0x12c7bb){return client[_0xa1b5('0xa')](_0x44d969,_0x4326a5)['then'](function(_0x39e94e){logger['info'](_0xa1b5('0xb'),_0x32e715,_0xa1b5('0xc'));logger[_0xa1b5('0xd')](_0xa1b5('0xe'),_0x32e715,_0xa1b5('0xc'),JSON[_0xa1b5('0xf')](_0x39e94e));if(_0x39e94e[_0xa1b5('0x10')]){if(_0x39e94e[_0xa1b5('0x10')]['code']===0x1f4){logger['error'](_0xa1b5('0xb'),_0x32e715,_0x39e94e['error']['message']);return _0x12c7bb(_0x39e94e['error'][_0xa1b5('0x11')]);}logger[_0xa1b5('0x10')](_0xa1b5('0xb'),_0x32e715,_0x39e94e[_0xa1b5('0x10')][_0xa1b5('0x11')]);return _0x167b7f(_0x39e94e['error'][_0xa1b5('0x11')]);}else{logger['info'](_0xa1b5('0xb'),_0x32e715,_0xa1b5('0xc'));_0x167b7f(_0x39e94e[_0xa1b5('0x12')][_0xa1b5('0x11')]);}})[_0xa1b5('0x13')](function(_0x5eb1cb){logger['error']('Cdr,\x20%s,\x20%s',_0x32e715,_0x5eb1cb);_0x12c7bb(_0x5eb1cb);});});} \ No newline at end of file +var _0xeef8=['randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Cdr,\x20%s,\x20%s','result','catch','lodash','util','bluebird'];(function(_0x404fb4,_0x508e6d){var _0x28992d=function(_0x56d9b7){while(--_0x56d9b7){_0x404fb4['push'](_0x404fb4['shift']());}};_0x28992d(++_0x508e6d);}(_0xeef8,0x1ad));var _0x8eef=function(_0x249bae,_0x39509a){_0x249bae=_0x249bae-0x0;var _0x5407f1=_0xeef8[_0x249bae];return _0x5407f1;};'use strict';var _=require(_0x8eef('0x0'));var util=require(_0x8eef('0x1'));var moment=require('moment');var BPromise=require(_0x8eef('0x2'));var rs=require(_0x8eef('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8eef('0x4'))['db'];var utils=require(_0x8eef('0x5'));var logger=require(_0x8eef('0x6'))('rpc');var config=require(_0x8eef('0x7'));var jayson=require(_0x8eef('0x8'));var client=jayson[_0x8eef('0x9')][_0x8eef('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x381290,_0x478694,_0x489a90){return new BPromise(function(_0x5f4a83,_0x40b5f9){return client[_0x8eef('0xb')](_0x381290,_0x489a90)[_0x8eef('0xc')](function(_0x431b8c){logger[_0x8eef('0xd')]('Cdr,\x20%s,\x20%s',_0x478694,_0x8eef('0xe'));logger[_0x8eef('0xf')](_0x8eef('0x10'),_0x478694,_0x8eef('0xe'),JSON[_0x8eef('0x11')](_0x431b8c));if(_0x431b8c[_0x8eef('0x12')]){if(_0x431b8c[_0x8eef('0x12')][_0x8eef('0x13')]===0x1f4){logger[_0x8eef('0x12')]('Cdr,\x20%s,\x20%s',_0x478694,_0x431b8c[_0x8eef('0x12')]['message']);return _0x40b5f9(_0x431b8c[_0x8eef('0x12')]['message']);}logger[_0x8eef('0x12')]('Cdr,\x20%s,\x20%s',_0x478694,_0x431b8c[_0x8eef('0x12')]['message']);return _0x5f4a83(_0x431b8c['error'][_0x8eef('0x14')]);}else{logger['info'](_0x8eef('0x15'),_0x478694,_0x8eef('0xe'));_0x5f4a83(_0x431b8c[_0x8eef('0x16')][_0x8eef('0x14')]);}})[_0x8eef('0x17')](function(_0xf27091){logger[_0x8eef('0x12')]('Cdr,\x20%s,\x20%s',_0x478694,_0xf27091);_0x40b5f9(_0xf27091);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 98eb66a..a80baf7 100644 --- a/server/api/cdr/index.js +++ b/server/api/cdr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x38aa1d,_0x4faf18){var _0x2fb75d=function(_0x14ee14){while(--_0x14ee14){_0x38aa1d['push'](_0x38aa1d['shift']());}};_0x2fb75d(++_0x4faf18);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file +var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x5cfaf5,_0x1c4530){var _0x30468e=function(_0x4b97ed){while(--_0x4b97ed){_0x5cfaf5['push'](_0x5cfaf5['shift']());}};_0x30468e(++_0x1c4530);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index 2b2b0a8..ed058bc 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 _0x985c=['TEXT','sequelize','INTEGER','STRING','noop'];(function(_0x11b8ae,_0x485fa8){var _0x35a448=function(_0x188a5b){while(--_0x188a5b){_0x11b8ae['push'](_0x11b8ae['shift']());}};_0x35a448(++_0x485fa8);}(_0x985c,0x8d));var _0xc985=function(_0x54c9f0,_0x402dae){_0x54c9f0=_0x54c9f0-0x0;var _0x57f97a=_0x985c[_0x54c9f0];return _0x57f97a;};'use strict';var Sequelize=require(_0xc985('0x0'));module['exports']={'priority':{'type':Sequelize[_0xc985('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xc985('0x2')],'allowNull':![],'defaultValue':_0xc985('0x3')},'appdata':{'type':Sequelize[_0xc985('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xc985('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x4b7b=['INTEGER','STRING','noop','TEXT','*,*,*,*','exports'];(function(_0x4add74,_0x41e997){var _0x64e1f2=function(_0x1c6985){while(--_0x1c6985){_0x4add74['push'](_0x4add74['shift']());}};_0x64e1f2(++_0x41e997);}(_0x4b7b,0x143));var _0xb4b7=function(_0x14fa9f,_0x4b9856){_0x14fa9f=_0x14fa9f-0x0;var _0x362f8d=_0x4b7b[_0x14fa9f];return _0x362f8d;};'use strict';var Sequelize=require('sequelize');module[_0xb4b7('0x0')]={'priority':{'type':Sequelize[_0xb4b7('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xb4b7('0x2')],'allowNull':![],'defaultValue':_0xb4b7('0x3')},'appdata':{'type':Sequelize[_0xb4b7('0x4')]()},'description':{'type':Sequelize[_0xb4b7('0x2')]},'interval':{'type':Sequelize[_0xb4b7('0x2')],'defaultValue':_0xb4b7('0x5')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index 041d660..66dba03 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 _0xad13=['length','includeAll','ChatApplication','find','catch','body','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','stack','name','show','keys','rawAttributes','query','filters','intersection','model','attributes','fields'];(function(_0x20aab1,_0xc6d854){var _0x277dff=function(_0x494c4d){while(--_0x494c4d){_0x20aab1['push'](_0x20aab1['shift']());}};_0x277dff(++_0xc6d854);}(_0xad13,0x79));var _0x3ad1=function(_0x18e3c5,_0x54fe8d){_0x18e3c5=_0x18e3c5-0x0;var _0x1a6b15=_0xad13[_0x18e3c5];return _0x1a6b15;};'use strict';var emlformat=require(_0x3ad1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3ad1('0x1'));var jsonpatch=require(_0x3ad1('0x2'));var rp=require(_0x3ad1('0x3'));var moment=require(_0x3ad1('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3ad1('0x5'));var util=require(_0x3ad1('0x6'));var path=require(_0x3ad1('0x7'));var sox=require(_0x3ad1('0x8'));var csv=require(_0x3ad1('0x9'));var ejs=require(_0x3ad1('0xa'));var fs=require('fs');var fs_extra=require(_0x3ad1('0xb'));var _=require(_0x3ad1('0xc'));var squel=require(_0x3ad1('0xd'));var crypto=require(_0x3ad1('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x3ad1('0xf'));var toCsv=require(_0x3ad1('0x9'));var querystring=require(_0x3ad1('0x10'));var Papa=require('papaparse');var Redis=require(_0x3ad1('0x11'));var authService=require(_0x3ad1('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x3ad1('0x13'));var hardwareService=require(_0x3ad1('0x14'));var logger=require(_0x3ad1('0x15'))(_0x3ad1('0x16'));var utils=require(_0x3ad1('0x17'));var config=require(_0x3ad1('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x142957,_0x42f6a0){_0x42f6a0=_0x42f6a0||0xcc;return function(_0x4544c0){if(_0x4544c0){return _0x142957[_0x3ad1('0x19')](_0x42f6a0);}return _0x142957['status'](_0x42f6a0)[_0x3ad1('0x1a')]();};}function respondWithResult(_0x4bf44f,_0x19b1db){_0x19b1db=_0x19b1db||0xc8;return function(_0x3b68de){if(_0x3b68de){return _0x4bf44f[_0x3ad1('0x1b')](_0x19b1db)[_0x3ad1('0x1c')](_0x3b68de);}};}function respondWithFilteredResult(_0x5448a1,_0x4104aa){return function(_0xce229){if(_0xce229){var _0x384ed5=typeof _0x4104aa[_0x3ad1('0x1d')]===_0x3ad1('0x1e')&&typeof _0x4104aa[_0x3ad1('0x1f')]===_0x3ad1('0x1e');var _0x5cf66b=_0xce229[_0x3ad1('0x20')];var _0x30e53f=_0x384ed5?0x0:_0x4104aa[_0x3ad1('0x1d')];var _0xd43203=_0x384ed5?_0xce229[_0x3ad1('0x20')]:_0x4104aa['offset']+_0x4104aa[_0x3ad1('0x1f')];var _0x3de9a2;if(_0xd43203>=_0x5cf66b){_0xd43203=_0x5cf66b;_0x3de9a2=0xc8;}else{_0x3de9a2=0xce;}_0x5448a1['status'](_0x3de9a2);return _0x5448a1[_0x3ad1('0x21')](_0x3ad1('0x22'),_0x30e53f+'-'+_0xd43203+'/'+_0x5cf66b)[_0x3ad1('0x1c')](_0xce229);}return null;};}function patchUpdates(_0x46649d){return function(_0x1f65ff){try{jsonpatch[_0x3ad1('0x23')](_0x1f65ff,_0x46649d,!![]);}catch(_0x5aa568){return BPromise[_0x3ad1('0x24')](_0x5aa568);}return _0x1f65ff['save']();};}function saveUpdates(_0xc78309,_0x5f1031){return function(_0x21ed3b){if(_0x21ed3b){return _0x21ed3b[_0x3ad1('0x25')](_0xc78309)[_0x3ad1('0x26')](function(_0x3e9c1f){return _0x3e9c1f;});}return null;};}function removeEntity(_0x2365f3,_0x3a0166){return function(_0x2fd5e6){if(_0x2fd5e6){return _0x2fd5e6['destroy']()[_0x3ad1('0x26')](function(){_0x2365f3[_0x3ad1('0x1b')](0xcc)[_0x3ad1('0x1a')]();});}};}function handleEntityNotFound(_0x2ee2e8,_0x1d82a8){return function(_0x2cd135){if(!_0x2cd135){_0x2ee2e8['sendStatus'](0x194);}return _0x2cd135;};}function handleError(_0x5b5abc,_0x7b69e5){_0x7b69e5=_0x7b69e5||0x1f4;return function(_0x5e1c03){logger['error'](_0x5e1c03[_0x3ad1('0x27')]);if(_0x5e1c03[_0x3ad1('0x28')]){delete _0x5e1c03[_0x3ad1('0x28')];}_0x5b5abc[_0x3ad1('0x1b')](_0x7b69e5)['send'](_0x5e1c03);};}exports[_0x3ad1('0x29')]=function(_0xc56f8a,_0x402df6){var _0x3753f1={'raw':!![],'where':{'id':_0xc56f8a['params']['id']}},_0x345cb9={};_0x345cb9['model']=_[_0x3ad1('0x2a')](db['ChatApplication'][_0x3ad1('0x2b')]);_0x345cb9[_0x3ad1('0x2c')]=_[_0x3ad1('0x2a')](_0xc56f8a[_0x3ad1('0x2c')]);_0x345cb9[_0x3ad1('0x2d')]=_[_0x3ad1('0x2e')](_0x345cb9[_0x3ad1('0x2f')],_0x345cb9[_0x3ad1('0x2c')]);_0x3753f1[_0x3ad1('0x30')]=_['intersection'](_0x345cb9[_0x3ad1('0x2f')],qs['fields'](_0xc56f8a[_0x3ad1('0x2c')][_0x3ad1('0x31')]));_0x3753f1[_0x3ad1('0x30')]=_0x3753f1[_0x3ad1('0x30')][_0x3ad1('0x32')]?_0x3753f1[_0x3ad1('0x30')]:_0x345cb9[_0x3ad1('0x2f')];if(_0xc56f8a['query'][_0x3ad1('0x33')]){_0x3753f1['include']=[{'all':!![]}];}_0x3753f1=_['merge']({},_0x3753f1,_0xc56f8a['options']);return db[_0x3ad1('0x34')][_0x3ad1('0x35')](_0x3753f1)[_0x3ad1('0x26')](handleEntityNotFound(_0x402df6,null))[_0x3ad1('0x26')](respondWithResult(_0x402df6,null))[_0x3ad1('0x36')](handleError(_0x402df6,null));};exports[_0x3ad1('0x25')]=function(_0x54f100,_0x51d21b){if(_0x54f100[_0x3ad1('0x37')]['id']){delete _0x54f100[_0x3ad1('0x37')]['id'];}return db[_0x3ad1('0x34')][_0x3ad1('0x35')]({'where':{'id':_0x54f100[_0x3ad1('0x38')]['id']}})['then'](handleEntityNotFound(_0x51d21b,null))['then'](saveUpdates(_0x54f100['body'],null))['then'](respondWithResult(_0x51d21b,null))[_0x3ad1('0x36')](handleError(_0x51d21b,null));};exports['destroy']=function(_0x5c2acd,_0x78b554){return db[_0x3ad1('0x34')]['find']({'where':{'id':_0x5c2acd[_0x3ad1('0x38')]['id']}})[_0x3ad1('0x26')](handleEntityNotFound(_0x78b554,null))['then'](removeEntity(_0x78b554,null))[_0x3ad1('0x36')](handleError(_0x78b554,null));}; \ No newline at end of file +var _0x19c3=['keys','ChatApplication','rawAttributes','query','filters','intersection','fields','attributes','include','merge','find','catch','body','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','limit','undefined','count','offset','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','show','params','model'];(function(_0x17b4cd,_0x428e1a){var _0x35449c=function(_0x3b0a1a){while(--_0x3b0a1a){_0x17b4cd['push'](_0x17b4cd['shift']());}};_0x35449c(++_0x428e1a);}(_0x19c3,0xf9));var _0x319c=function(_0x29b931,_0x109906){_0x29b931=_0x29b931-0x0;var _0xafbd90=_0x19c3[_0x29b931];return _0xafbd90;};'use strict';var emlformat=require(_0x319c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x319c('0x1'));var jsonpatch=require(_0x319c('0x2'));var rp=require('request-promise');var moment=require(_0x319c('0x3'));var BPromise=require(_0x319c('0x4'));var Mustache=require(_0x319c('0x5'));var util=require(_0x319c('0x6'));var path=require(_0x319c('0x7'));var sox=require(_0x319c('0x8'));var csv=require('to-csv');var ejs=require(_0x319c('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x319c('0xa'));var squel=require(_0x319c('0xb'));var crypto=require(_0x319c('0xc'));var jsforce=require(_0x319c('0xd'));var deskjs=require(_0x319c('0xe'));var toCsv=require('to-csv');var querystring=require(_0x319c('0xf'));var Papa=require(_0x319c('0x10'));var Redis=require(_0x319c('0x11'));var authService=require(_0x319c('0x12'));var qs=require(_0x319c('0x13'));var as=require(_0x319c('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x319c('0x15'))('api');var utils=require(_0x319c('0x16'));var config=require(_0x319c('0x17'));var licenseUtil=require(_0x319c('0x18'));var db=require(_0x319c('0x19'))['db'];function respondWithStatusCode(_0x362f44,_0x3be537){_0x3be537=_0x3be537||0xcc;return function(_0x401fdb){if(_0x401fdb){return _0x362f44['sendStatus'](_0x3be537);}return _0x362f44['status'](_0x3be537)[_0x319c('0x1a')]();};}function respondWithResult(_0x2fb398,_0x4c246e){_0x4c246e=_0x4c246e||0xc8;return function(_0x372a50){if(_0x372a50){return _0x2fb398[_0x319c('0x1b')](_0x4c246e)[_0x319c('0x1c')](_0x372a50);}};}function respondWithFilteredResult(_0x2cd063,_0x23afe7){return function(_0xa9b5a7){if(_0xa9b5a7){var _0x29b26c=typeof _0x23afe7['offset']==='undefined'&&typeof _0x23afe7[_0x319c('0x1d')]===_0x319c('0x1e');var _0x53c939=_0xa9b5a7[_0x319c('0x1f')];var _0x49624c=_0x29b26c?0x0:_0x23afe7[_0x319c('0x20')];var _0x45a822=_0x29b26c?_0xa9b5a7[_0x319c('0x1f')]:_0x23afe7[_0x319c('0x20')]+_0x23afe7[_0x319c('0x1d')];var _0x1c11d3;if(_0x45a822>=_0x53c939){_0x45a822=_0x53c939;_0x1c11d3=0xc8;}else{_0x1c11d3=0xce;}_0x2cd063[_0x319c('0x1b')](_0x1c11d3);return _0x2cd063['set'](_0x319c('0x21'),_0x49624c+'-'+_0x45a822+'/'+_0x53c939)[_0x319c('0x1c')](_0xa9b5a7);}return null;};}function patchUpdates(_0x5bd273){return function(_0x500597){try{jsonpatch[_0x319c('0x22')](_0x500597,_0x5bd273,!![]);}catch(_0xc2e927){return BPromise[_0x319c('0x23')](_0xc2e927);}return _0x500597['save']();};}function saveUpdates(_0x3bc070,_0xe50337){return function(_0x386340){if(_0x386340){return _0x386340[_0x319c('0x24')](_0x3bc070)[_0x319c('0x25')](function(_0x4d2ace){return _0x4d2ace;});}return null;};}function removeEntity(_0x1d9dfd,_0x2444c8){return function(_0x4508a5){if(_0x4508a5){return _0x4508a5[_0x319c('0x26')]()[_0x319c('0x25')](function(){_0x1d9dfd['status'](0xcc)[_0x319c('0x1a')]();});}};}function handleEntityNotFound(_0x4f87f8,_0x2cf97b){return function(_0x5fcf3c){if(!_0x5fcf3c){_0x4f87f8['sendStatus'](0x194);}return _0x5fcf3c;};}function handleError(_0x46e747,_0x5d93b9){_0x5d93b9=_0x5d93b9||0x1f4;return function(_0x4273de){logger[_0x319c('0x27')](_0x4273de[_0x319c('0x28')]);if(_0x4273de[_0x319c('0x29')]){delete _0x4273de[_0x319c('0x29')];}_0x46e747[_0x319c('0x1b')](_0x5d93b9)[_0x319c('0x2a')](_0x4273de);};}exports[_0x319c('0x2b')]=function(_0x363362,_0x5cf5de){var _0x2a7421={'raw':!![],'where':{'id':_0x363362[_0x319c('0x2c')]['id']}},_0x2591c6={};_0x2591c6[_0x319c('0x2d')]=_[_0x319c('0x2e')](db[_0x319c('0x2f')][_0x319c('0x30')]);_0x2591c6[_0x319c('0x31')]=_[_0x319c('0x2e')](_0x363362['query']);_0x2591c6[_0x319c('0x32')]=_[_0x319c('0x33')](_0x2591c6[_0x319c('0x2d')],_0x2591c6[_0x319c('0x31')]);_0x2a7421['attributes']=_[_0x319c('0x33')](_0x2591c6[_0x319c('0x2d')],qs[_0x319c('0x34')](_0x363362['query'][_0x319c('0x34')]));_0x2a7421['attributes']=_0x2a7421[_0x319c('0x35')]['length']?_0x2a7421[_0x319c('0x35')]:_0x2591c6[_0x319c('0x2d')];if(_0x363362[_0x319c('0x31')]['includeAll']){_0x2a7421[_0x319c('0x36')]=[{'all':!![]}];}_0x2a7421=_[_0x319c('0x37')]({},_0x2a7421,_0x363362['options']);return db[_0x319c('0x2f')][_0x319c('0x38')](_0x2a7421)[_0x319c('0x25')](handleEntityNotFound(_0x5cf5de,null))[_0x319c('0x25')](respondWithResult(_0x5cf5de,null))[_0x319c('0x39')](handleError(_0x5cf5de,null));};exports['update']=function(_0x9c47df,_0x220a8c){if(_0x9c47df[_0x319c('0x3a')]['id']){delete _0x9c47df[_0x319c('0x3a')]['id'];}return db[_0x319c('0x2f')][_0x319c('0x38')]({'where':{'id':_0x9c47df[_0x319c('0x2c')]['id']}})[_0x319c('0x25')](handleEntityNotFound(_0x220a8c,null))[_0x319c('0x25')](saveUpdates(_0x9c47df['body'],null))[_0x319c('0x25')](respondWithResult(_0x220a8c,null))[_0x319c('0x39')](handleError(_0x220a8c,null));};exports[_0x319c('0x26')]=function(_0x176d3f,_0x5b280e){return db[_0x319c('0x2f')][_0x319c('0x38')]({'where':{'id':_0x176d3f[_0x319c('0x2c')]['id']}})[_0x319c('0x25')](handleEntityNotFound(_0x5b280e,null))[_0x319c('0x25')](removeEntity(_0x5b280e,null))[_0x319c('0x39')](handleError(_0x5b280e,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 98d303f..27b412b 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 _0x3021=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger'];(function(_0x105ffd,_0x238299){var _0x1f8870=function(_0x1aecc7){while(--_0x1aecc7){_0x105ffd['push'](_0x105ffd['shift']());}};_0x1f8870(++_0x238299);}(_0x3021,0x1b0));var _0x1302=function(_0xfa5998,_0x4dcec4){_0xfa5998=_0xfa5998-0x0;var _0x55bddd=_0x3021[_0xfa5998];return _0x55bddd;};'use strict';var _=require(_0x1302('0x0'));var util=require('util');var logger=require(_0x1302('0x1'))('api');var moment=require(_0x1302('0x2'));var BPromise=require(_0x1302('0x3'));var rp=require(_0x1302('0x4'));var fs=require('fs');var path=require(_0x1302('0x5'));var rimraf=require(_0x1302('0x6'));var config=require(_0x1302('0x7'));var attributes=require(_0x1302('0x8'));module[_0x1302('0x9')]=function(_0x2bd488,_0x43890d){return _0x2bd488[_0x1302('0xa')](_0x1302('0xb'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1302('0xc'),'collate':_0x1302('0xd')});}; \ No newline at end of file +var _0xef28=['./chatApplication.attributes','define','ChatApplication','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xef28,0x71));var _0x8ef2=function(_0xf7077d,_0x309ea1){_0xf7077d=_0xf7077d-0x0;var _0x19ff53=_0xef28[_0xf7077d];return _0x19ff53;};'use strict';var _=require(_0x8ef2('0x0'));var util=require(_0x8ef2('0x1'));var logger=require(_0x8ef2('0x2'))(_0x8ef2('0x3'));var moment=require(_0x8ef2('0x4'));var BPromise=require(_0x8ef2('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8ef2('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x8ef2('0x7'));module['exports']=function(_0x354662,_0x61b5ee){return _0x354662[_0x8ef2('0x8')](_0x8ef2('0x9'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index 500641f..813f9bf 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 _0x3873=['request','then','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','error','code','message','info','result','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http'];(function(_0x5a0f8a,_0x374487){var _0x1a9380=function(_0x783ef1){while(--_0x783ef1){_0x5a0f8a['push'](_0x5a0f8a['shift']());}};_0x1a9380(++_0x374487);}(_0x3873,0x161));var _0x3387=function(_0xda0921,_0x11bd63){_0xda0921=_0xda0921-0x0;var _0xf871d9=_0x3873[_0xda0921];return _0xf871d9;};'use strict';var _=require(_0x3387('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3387('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3387('0x2'));var db=require(_0x3387('0x3'))['db'];var utils=require(_0x3387('0x4'));var logger=require('../../config/logger')(_0x3387('0x5'));var config=require(_0x3387('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x3387('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x15a2db,_0x47a783,_0x3deb52){return new BPromise(function(_0x5b4d31,_0x2e4f07){return client[_0x3387('0x8')](_0x15a2db,_0x3deb52)[_0x3387('0x9')](function(_0x4796d0){logger['info'](_0x3387('0xa'),_0x47a783,_0x3387('0xb'));logger[_0x3387('0xc')](_0x3387('0xd'),_0x47a783,_0x3387('0xb'),JSON['stringify'](_0x4796d0));if(_0x4796d0['error']){if(_0x4796d0[_0x3387('0xe')][_0x3387('0xf')]===0x1f4){logger['error'](_0x3387('0xa'),_0x47a783,_0x4796d0[_0x3387('0xe')][_0x3387('0x10')]);return _0x2e4f07(_0x4796d0[_0x3387('0xe')][_0x3387('0x10')]);}logger[_0x3387('0xe')](_0x3387('0xa'),_0x47a783,_0x4796d0[_0x3387('0xe')]['message']);return _0x5b4d31(_0x4796d0[_0x3387('0xe')]['message']);}else{logger[_0x3387('0x11')](_0x3387('0xa'),_0x47a783,_0x3387('0xb'));_0x5b4d31(_0x4796d0[_0x3387('0x12')][_0x3387('0x10')]);}})['catch'](function(_0x50e589){logger[_0x3387('0xe')]('ChatApplication,\x20%s,\x20%s',_0x47a783,_0x50e589);_0x2e4f07(_0x50e589);});});} \ No newline at end of file +var _0xbfbb=['ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0xbfbb,0x1d7));var _0xbbfb=function(_0x43fbdb,_0x2bfc6e){_0x43fbdb=_0x43fbdb-0x0;var _0x3b6ab8=_0xbfbb[_0x43fbdb];return _0x3b6ab8;};'use strict';var _=require(_0xbbfb('0x0'));var util=require(_0xbbfb('0x1'));var moment=require('moment');var BPromise=require(_0xbbfb('0x2'));var rs=require(_0xbbfb('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbbfb('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xbbfb('0x5'))(_0xbbfb('0x6'));var config=require(_0xbbfb('0x7'));var jayson=require(_0xbbfb('0x8'));var client=jayson[_0xbbfb('0x9')][_0xbbfb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x38f91a,_0x329b85,_0x30bd77){return new BPromise(function(_0x4e8da5,_0x233431){return client['request'](_0x38f91a,_0x30bd77)[_0xbbfb('0xb')](function(_0x26c49e){logger['info'](_0xbbfb('0xc'),_0x329b85,_0xbbfb('0xd'));logger[_0xbbfb('0xe')](_0xbbfb('0xf'),_0x329b85,_0xbbfb('0xd'),JSON[_0xbbfb('0x10')](_0x26c49e));if(_0x26c49e[_0xbbfb('0x11')]){if(_0x26c49e['error']['code']===0x1f4){logger['error'](_0xbbfb('0xc'),_0x329b85,_0x26c49e[_0xbbfb('0x11')][_0xbbfb('0x12')]);return _0x233431(_0x26c49e[_0xbbfb('0x11')][_0xbbfb('0x12')]);}logger[_0xbbfb('0x11')](_0xbbfb('0xc'),_0x329b85,_0x26c49e[_0xbbfb('0x11')][_0xbbfb('0x12')]);return _0x4e8da5(_0x26c49e[_0xbbfb('0x11')][_0xbbfb('0x12')]);}else{logger['info'](_0xbbfb('0xc'),_0x329b85,_0xbbfb('0xd'));_0x4e8da5(_0x26c49e[_0xbbfb('0x13')][_0xbbfb('0x12')]);}})[_0xbbfb('0x14')](function(_0x54a1f8){logger[_0xbbfb('0x11')](_0xbbfb('0xc'),_0x329b85,_0x54a1f8);_0x233431(_0x54a1f8);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 0d3e2b3..a04092f 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 _0x5aca=['show','put','isAuthenticated','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x5aca,0xc5));var _0xa5ac=function(_0x507dcd,_0x2ecaeb){_0x507dcd=_0x507dcd-0x0;var _0x35bc5f=_0x5aca[_0x507dcd];return _0x35bc5f;};'use strict';var multer=require(_0xa5ac('0x0'));var util=require(_0xa5ac('0x1'));var path=require(_0xa5ac('0x2'));var timeout=require(_0xa5ac('0x3'));var express=require(_0xa5ac('0x4'));var router=express[_0xa5ac('0x5')]();var fs_extra=require(_0xa5ac('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xa5ac('0x7'));var config=require(_0xa5ac('0x8'));var controller=require(_0xa5ac('0x9'));router[_0xa5ac('0xa')](_0xa5ac('0xb'),auth['isAuthenticated'](),controller[_0xa5ac('0xc')]);router[_0xa5ac('0xd')](_0xa5ac('0xb'),auth[_0xa5ac('0xe')](),controller[_0xa5ac('0xf')]);router[_0xa5ac('0x10')](_0xa5ac('0xb'),auth['isAuthenticated'](),controller[_0xa5ac('0x11')]);module[_0xa5ac('0x12')]=router; \ No newline at end of file +var _0x871d=['exports','multer','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','put','/:id','update','delete','destroy'];(function(_0x541cf4,_0x38ea3c){var _0x2093ec=function(_0x5bd8d7){while(--_0x5bd8d7){_0x541cf4['push'](_0x541cf4['shift']());}};_0x2093ec(++_0x38ea3c);}(_0x871d,0x187));var _0xd871=function(_0x38f771,_0x4587dd){_0x38f771=_0x38f771-0x0;var _0x2c562c=_0x871d[_0x38f771];return _0x2c562c;};'use strict';var multer=require(_0xd871('0x0'));var util=require('util');var path=require(_0xd871('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xd871('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xd871('0x3'));var interaction=require(_0xd871('0x4'));var config=require(_0xd871('0x5'));var controller=require('./chatApplication.controller');router[_0xd871('0x6')]('/:id',auth[_0xd871('0x7')](),controller[_0xd871('0x8')]);router[_0xd871('0x9')](_0xd871('0xa'),auth[_0xd871('0x7')](),controller[_0xd871('0xb')]);router[_0xd871('0xc')](_0xd871('0xa'),auth[_0xd871('0x7')](),controller[_0xd871('0xd')]);module[_0xd871('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 281a610..96c2647 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 _0xac73=['STRING','BOOLEAN','sequelize','exports'];(function(_0x3161b5,_0x42dc8a){var _0x2adf35=function(_0x14ce40){while(--_0x14ce40){_0x3161b5['push'](_0x3161b5['shift']());}};_0x2adf35(++_0x42dc8a);}(_0xac73,0x186));var _0x3ac7=function(_0x41dcd7,_0x467c87){_0x41dcd7=_0x41dcd7-0x0;var _0x1b315d=_0xac73[_0x41dcd7];return _0x1b315d;};'use strict';var Sequelize=require(_0x3ac7('0x0'));module[_0x3ac7('0x1')]={'name':{'type':Sequelize[_0x3ac7('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x3ac7('0x2')]},'write':{'type':Sequelize[_0x3ac7('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0x2542=['STRING','sequelize','exports'];(function(_0x199bdf,_0x3daaf6){var _0x287fdc=function(_0x36b976){while(--_0x36b976){_0x199bdf['push'](_0x199bdf['shift']());}};_0x287fdc(++_0x3daaf6);}(_0x2542,0x169));var _0x2254=function(_0x10353c,_0x162dac){_0x10353c=_0x10353c-0x0;var _0x20300e=_0x2542[_0x10353c];return _0x20300e;};'use strict';var Sequelize=require(_0x2254('0x0'));module[_0x2254('0x1')]={'name':{'type':Sequelize[_0x2254('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x2254('0x2')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index c8e17c9..c06e754 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 _0x5b6c=['reject','save','destroy','then','status','end','stack','name','map','ChatGroup','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','update','describe','ChatInternalMessage','toInteger','addMembers','omit','ids','findOne','order','getMembers','removeMembers','addMessage','ChatGroupId','getMessages','$gte','format','YYYY-MM-DD\x20HH:mm:ss','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','register','sendStatus','json','undefined','count','offset','limit','set','Content-Range','apply'];(function(_0x3b25e3,_0x368a15){var _0x2eaf8c=function(_0x33d731){while(--_0x33d731){_0x3b25e3['push'](_0x3b25e3['shift']());}};_0x2eaf8c(++_0x368a15);}(_0x5b6c,0x153));var _0xc5b6=function(_0x101e7b,_0x4ef05b){_0x101e7b=_0x101e7b-0x0;var _0x4995c0=_0x5b6c[_0x101e7b];return _0x4995c0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc5b6('0x0'));var zipdir=require(_0xc5b6('0x1'));var jsonpatch=require(_0xc5b6('0x2'));var rp=require(_0xc5b6('0x3'));var moment=require(_0xc5b6('0x4'));var BPromise=require(_0xc5b6('0x5'));var Mustache=require(_0xc5b6('0x6'));var util=require(_0xc5b6('0x7'));var path=require('path');var sox=require(_0xc5b6('0x8'));var csv=require(_0xc5b6('0x9'));var ejs=require(_0xc5b6('0xa'));var fs=require('fs');var fs_extra=require(_0xc5b6('0xb'));var _=require(_0xc5b6('0xc'));var squel=require('squel');var crypto=require(_0xc5b6('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc5b6('0x9'));var querystring=require(_0xc5b6('0xe'));var Papa=require(_0xc5b6('0xf'));var Redis=require(_0xc5b6('0x10'));var authService=require(_0xc5b6('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc5b6('0x12'));var logger=require(_0xc5b6('0x13'))(_0xc5b6('0x14'));var utils=require('../../config/utils');var config=require(_0xc5b6('0x15'));var licenseUtil=require(_0xc5b6('0x16'));var db=require(_0xc5b6('0x17'))['db'];config[_0xc5b6('0x18')]=_[_0xc5b6('0x19')](config[_0xc5b6('0x18')],{'host':_0xc5b6('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatGroup.socket')[_0xc5b6('0x1b')](socket);function respondWithStatusCode(_0x2a4679,_0x2070e1){_0x2070e1=_0x2070e1||0xcc;return function(_0x5c4bdd){if(_0x5c4bdd){return _0x2a4679[_0xc5b6('0x1c')](_0x2070e1);}return _0x2a4679['status'](_0x2070e1)['end']();};}function respondWithResult(_0xb4af,_0x421c07){_0x421c07=_0x421c07||0xc8;return function(_0x2a85f2){if(_0x2a85f2){return _0xb4af['status'](_0x421c07)[_0xc5b6('0x1d')](_0x2a85f2);}};}function respondWithFilteredResult(_0x358b2f,_0x25c732){return function(_0x6c147c){if(_0x6c147c){var _0x269889=typeof _0x25c732['offset']===_0xc5b6('0x1e')&&typeof _0x25c732['limit']===_0xc5b6('0x1e');var _0x763f89=_0x6c147c[_0xc5b6('0x1f')];var _0x283974=_0x269889?0x0:_0x25c732[_0xc5b6('0x20')];var _0x143fc7=_0x269889?_0x6c147c[_0xc5b6('0x1f')]:_0x25c732[_0xc5b6('0x20')]+_0x25c732[_0xc5b6('0x21')];var _0x3b587e;if(_0x143fc7>=_0x763f89){_0x143fc7=_0x763f89;_0x3b587e=0xc8;}else{_0x3b587e=0xce;}_0x358b2f['status'](_0x3b587e);return _0x358b2f[_0xc5b6('0x22')](_0xc5b6('0x23'),_0x283974+'-'+_0x143fc7+'/'+_0x763f89)[_0xc5b6('0x1d')](_0x6c147c);}return null;};}function patchUpdates(_0x37ae51){return function(_0x14d45b){try{jsonpatch[_0xc5b6('0x24')](_0x14d45b,_0x37ae51,!![]);}catch(_0x18192e){return BPromise[_0xc5b6('0x25')](_0x18192e);}return _0x14d45b[_0xc5b6('0x26')]();};}function saveUpdates(_0x411d1f,_0x5e087a){return function(_0x3af8fd){if(_0x3af8fd){return _0x3af8fd['update'](_0x411d1f)['then'](function(_0x2d0d00){return _0x2d0d00;});}return null;};}function removeEntity(_0x3b0cca,_0x5bfa7b){return function(_0xc93bf4){if(_0xc93bf4){return _0xc93bf4[_0xc5b6('0x27')]()[_0xc5b6('0x28')](function(){_0x3b0cca[_0xc5b6('0x29')](0xcc)[_0xc5b6('0x2a')]();});}};}function handleEntityNotFound(_0x554ee6,_0x3e6385){return function(_0x530ae4){if(!_0x530ae4){_0x554ee6[_0xc5b6('0x1c')](0x194);}return _0x530ae4;};}function handleError(_0x358531,_0x1071fd){_0x1071fd=_0x1071fd||0x1f4;return function(_0x394130){logger['error'](_0x394130[_0xc5b6('0x2b')]);if(_0x394130[_0xc5b6('0x2c')]){delete _0x394130[_0xc5b6('0x2c')];}_0x358531[_0xc5b6('0x29')](_0x1071fd)['send'](_0x394130);};}exports['index']=function(_0x4408cc,_0x3a0e40){var _0x43a2c2={},_0x4d3698={},_0x59e953={'count':0x0,'rows':[]};var _0x56c50b=_[_0xc5b6('0x2d')](db[_0xc5b6('0x2e')]['rawAttributes'],function(_0x1e0374){return{'name':_0x1e0374[_0xc5b6('0x2f')],'type':_0x1e0374[_0xc5b6('0x30')]['key']};});_0x4d3698[_0xc5b6('0x31')]=_['map'](_0x56c50b,'name');_0x4d3698['query']=_[_0xc5b6('0x32')](_0x4408cc[_0xc5b6('0x33')]);_0x4d3698[_0xc5b6('0x34')]=_[_0xc5b6('0x35')](_0x4d3698[_0xc5b6('0x31')],_0x4d3698[_0xc5b6('0x33')]);_0x43a2c2[_0xc5b6('0x36')]=_[_0xc5b6('0x35')](_0x4d3698[_0xc5b6('0x31')],qs[_0xc5b6('0x37')](_0x4408cc['query'][_0xc5b6('0x37')]));_0x43a2c2[_0xc5b6('0x36')]=_0x43a2c2['attributes'][_0xc5b6('0x38')]?_0x43a2c2['attributes']:_0x4d3698['model'];if(!_0x4408cc['query'][_0xc5b6('0x39')](_0xc5b6('0x3a'))){_0x43a2c2[_0xc5b6('0x21')]=qs[_0xc5b6('0x21')](_0x4408cc[_0xc5b6('0x33')][_0xc5b6('0x21')]);_0x43a2c2[_0xc5b6('0x20')]=qs[_0xc5b6('0x20')](_0x4408cc[_0xc5b6('0x33')][_0xc5b6('0x20')]);}_0x43a2c2['order']=qs[_0xc5b6('0x3b')](_0x4408cc['query'][_0xc5b6('0x3b')]);_0x43a2c2[_0xc5b6('0x3c')]=qs[_0xc5b6('0x34')](_[_0xc5b6('0x3d')](_0x4408cc[_0xc5b6('0x33')],_0x4d3698['filters']),_0x56c50b);if(_0x4408cc[_0xc5b6('0x33')][_0xc5b6('0x3e')]){_0x43a2c2[_0xc5b6('0x3c')]=_[_0xc5b6('0x3f')](_0x43a2c2[_0xc5b6('0x3c')],{'$or':_['map'](_0x56c50b,function(_0x59a30a){if(_0x59a30a[_0xc5b6('0x30')]!==_0xc5b6('0x40')){var _0x477b4e={};_0x477b4e[_0x59a30a[_0xc5b6('0x2c')]]={'$like':'%'+_0x4408cc[_0xc5b6('0x33')][_0xc5b6('0x3e')]+'%'};return _0x477b4e;}})});}_0x43a2c2=_['merge']({},_0x43a2c2,_0x4408cc[_0xc5b6('0x41')]);var _0x561346={'where':_0x43a2c2[_0xc5b6('0x3c')]};return db['ChatGroup'][_0xc5b6('0x1f')](_0x561346)[_0xc5b6('0x28')](function(_0x19a726){_0x59e953[_0xc5b6('0x1f')]=_0x19a726;if(_0x4408cc[_0xc5b6('0x33')][_0xc5b6('0x42')]){_0x43a2c2[_0xc5b6('0x43')]=[{'all':!![]}];}return db[_0xc5b6('0x2e')][_0xc5b6('0x44')](_0x43a2c2);})[_0xc5b6('0x28')](function(_0x18d3f5){_0x59e953[_0xc5b6('0x45')]=_0x18d3f5;return _0x59e953;})['then'](respondWithFilteredResult(_0x3a0e40,_0x43a2c2))[_0xc5b6('0x46')](handleError(_0x3a0e40,null));};exports[_0xc5b6('0x47')]=function(_0x1283ff,_0x46448a){var _0x538ac8={'raw':!![],'where':{'id':_0x1283ff[_0xc5b6('0x48')]['id']}},_0x597670={};_0x597670[_0xc5b6('0x31')]=_[_0xc5b6('0x32')](db['ChatGroup'][_0xc5b6('0x49')]);_0x597670[_0xc5b6('0x33')]=_[_0xc5b6('0x32')](_0x1283ff['query']);_0x597670[_0xc5b6('0x34')]=_[_0xc5b6('0x35')](_0x597670[_0xc5b6('0x31')],_0x597670[_0xc5b6('0x33')]);_0x538ac8[_0xc5b6('0x36')]=_[_0xc5b6('0x35')](_0x597670[_0xc5b6('0x31')],qs[_0xc5b6('0x37')](_0x1283ff['query'][_0xc5b6('0x37')]));_0x538ac8['attributes']=_0x538ac8['attributes'][_0xc5b6('0x38')]?_0x538ac8[_0xc5b6('0x36')]:_0x597670[_0xc5b6('0x31')];if(_0x1283ff['query']['includeAll']){_0x538ac8[_0xc5b6('0x43')]=[{'all':!![]}];}_0x538ac8=_[_0xc5b6('0x3f')]({},_0x538ac8,_0x1283ff['options']);return db[_0xc5b6('0x2e')][_0xc5b6('0x4a')](_0x538ac8)['then'](handleEntityNotFound(_0x46448a,null))[_0xc5b6('0x28')](respondWithResult(_0x46448a,null))[_0xc5b6('0x46')](handleError(_0x46448a,null));};exports[_0xc5b6('0x4b')]=function(_0x596b24,_0x206076){return db[_0xc5b6('0x2e')][_0xc5b6('0x4b')](_0x596b24[_0xc5b6('0x4c')],{})[_0xc5b6('0x28')](respondWithResult(_0x206076,0xc9))[_0xc5b6('0x46')](handleError(_0x206076,null));};exports[_0xc5b6('0x4d')]=function(_0x22708d,_0x184e0d){if(_0x22708d[_0xc5b6('0x4c')]['id']){delete _0x22708d['body']['id'];}return db[_0xc5b6('0x2e')]['find']({'where':{'id':_0x22708d[_0xc5b6('0x48')]['id']}})[_0xc5b6('0x28')](handleEntityNotFound(_0x184e0d,null))['then'](saveUpdates(_0x22708d[_0xc5b6('0x4c')],null))[_0xc5b6('0x28')](respondWithResult(_0x184e0d,null))['catch'](handleError(_0x184e0d,null));};exports[_0xc5b6('0x27')]=function(_0x380d90,_0x320e7e){return db[_0xc5b6('0x2e')][_0xc5b6('0x4a')]({'where':{'id':_0x380d90[_0xc5b6('0x48')]['id']}})[_0xc5b6('0x28')](handleEntityNotFound(_0x320e7e,null))['then'](removeEntity(_0x320e7e,null))[_0xc5b6('0x46')](handleError(_0x320e7e,null));};exports[_0xc5b6('0x4e')]=function(_0xd51042,_0x33da35){return db[_0xc5b6('0x2e')][_0xc5b6('0x4e')]()[_0xc5b6('0x28')](respondWithResult(_0x33da35,null))['catch'](handleError(_0x33da35,null));};exports['getUnread']=function(_0x3af80e,_0x3748ff,_0x4acab9){return db[_0xc5b6('0x4f')]['count']({'where':{'ChatGroupId':_0x3af80e[_0xc5b6('0x48')]['id'],'ToId':_0x3af80e['user']['id'],'read':![]}})[_0xc5b6('0x28')](function(_0x1e80bf){return{'id':_[_0xc5b6('0x50')](_0x3af80e[_0xc5b6('0x48')]['id']),'count':_0x1e80bf};})['then'](respondWithResult(_0x3748ff,null))[_0xc5b6('0x46')](handleError(_0x3748ff,null));};exports['addMembers']=function(_0x572741,_0x402d38,_0x59ba82){return db[_0xc5b6('0x2e')]['find']({'where':{'id':_0x572741[_0xc5b6('0x48')]['id']}})[_0xc5b6('0x28')](handleEntityNotFound(_0x402d38,null))[_0xc5b6('0x28')](function(_0x32df4d){if(_0x32df4d){return _0x32df4d[_0xc5b6('0x51')](_0x572741[_0xc5b6('0x4c')]['ids'],_[_0xc5b6('0x52')](_0x572741[_0xc5b6('0x4c')],[_0xc5b6('0x53'),'id'])||{});}})[_0xc5b6('0x28')](respondWithResult(_0x402d38,null))['catch'](handleError(_0x402d38,null));};exports['getMembers']=function(_0xc2f9eb,_0x13b829,_0x1dd324){var _0x284521={};var _0x32e062={};var _0xc56d86;var _0x4d9261;return db[_0xc5b6('0x2e')][_0xc5b6('0x54')]({'where':{'id':_0xc2f9eb['params']['id']}})[_0xc5b6('0x28')](handleEntityNotFound(_0x13b829,null))['then'](function(_0x5b0b49){if(_0x5b0b49){_0xc56d86=_0x5b0b49;_0x32e062[_0xc5b6('0x31')]=_[_0xc5b6('0x32')](db['User'][_0xc5b6('0x49')]);_0x32e062['query']=_[_0xc5b6('0x32')](_0xc2f9eb['query']);_0x32e062[_0xc5b6('0x34')]=_[_0xc5b6('0x35')](_0x32e062[_0xc5b6('0x31')],_0x32e062[_0xc5b6('0x33')]);_0x284521['attributes']=_[_0xc5b6('0x35')](_0x32e062[_0xc5b6('0x31')],qs[_0xc5b6('0x37')](_0xc2f9eb[_0xc5b6('0x33')][_0xc5b6('0x37')]));_0x284521[_0xc5b6('0x36')]=_0x284521['attributes'][_0xc5b6('0x38')]?_0x284521[_0xc5b6('0x36')]:_0x32e062[_0xc5b6('0x31')];_0x284521[_0xc5b6('0x55')]=qs[_0xc5b6('0x3b')](_0xc2f9eb[_0xc5b6('0x33')][_0xc5b6('0x3b')]);_0x284521[_0xc5b6('0x3c')]=qs['filters'](_[_0xc5b6('0x3d')](_0xc2f9eb[_0xc5b6('0x33')],_0x32e062[_0xc5b6('0x34')]));if(_0xc2f9eb[_0xc5b6('0x33')][_0xc5b6('0x3e')]){_0x284521[_0xc5b6('0x3c')]=_['merge'](_0x284521[_0xc5b6('0x3c')],{'$or':_[_0xc5b6('0x2d')](_0x284521[_0xc5b6('0x36')],function(_0x44696d){var _0x47b404={};_0x47b404[_0x44696d]={'$like':'%'+_0xc2f9eb[_0xc5b6('0x33')]['filter']+'%'};return _0x47b404;})});}_0x284521=_[_0xc5b6('0x3f')]({},_0x284521,_0xc2f9eb[_0xc5b6('0x41')]);return _0xc56d86[_0xc5b6('0x56')](_0x284521);}})[_0xc5b6('0x28')](function(_0x17e899){if(_0x17e899){_0x4d9261=_0x17e899[_0xc5b6('0x38')];if(!_0xc2f9eb[_0xc5b6('0x33')][_0xc5b6('0x39')](_0xc5b6('0x3a'))){_0x284521[_0xc5b6('0x21')]=qs[_0xc5b6('0x21')](_0xc2f9eb['query']['limit']);_0x284521['offset']=qs[_0xc5b6('0x20')](_0xc2f9eb[_0xc5b6('0x33')][_0xc5b6('0x20')]);}return _0xc56d86['getMembers'](_0x284521);}})[_0xc5b6('0x28')](function(_0x5b44d6){if(_0x5b44d6){return _0x5b44d6?{'count':_0x4d9261,'rows':_0x5b44d6}:null;}})[_0xc5b6('0x28')](respondWithResult(_0x13b829,null))[_0xc5b6('0x46')](handleError(_0x13b829,null));};exports[_0xc5b6('0x57')]=function(_0x2d613f,_0x1e97e7,_0x458927){return db['ChatGroup'][_0xc5b6('0x4a')]({'where':{'id':_0x2d613f[_0xc5b6('0x48')]['id']}})[_0xc5b6('0x28')](handleEntityNotFound(_0x1e97e7,null))['then'](function(_0x2b252b){if(_0x2b252b){return _0x2b252b[_0xc5b6('0x57')](_0x2d613f['query'][_0xc5b6('0x53')]);}})[_0xc5b6('0x28')](respondWithStatusCode(_0x1e97e7,null))[_0xc5b6('0x46')](handleError(_0x1e97e7,null));};exports[_0xc5b6('0x58')]=function(_0x5fe27b,_0xa156ad,_0x1bce1b){if(_0x5fe27b['body']['id']){delete _0x5fe27b[_0xc5b6('0x4c')]['id'];}return db[_0xc5b6('0x2e')][_0xc5b6('0x4a')]({'where':{'id':_0x5fe27b[_0xc5b6('0x48')]['id']}})[_0xc5b6('0x28')](handleEntityNotFound(_0xa156ad,null))[_0xc5b6('0x28')](function(_0x4324a6){if(_0x4324a6){_0x5fe27b['body'][_0xc5b6('0x59')]=_0x4324a6['id'];return db[_0xc5b6('0x4f')][_0xc5b6('0x4b')](_0x5fe27b[_0xc5b6('0x4c')]);}})['then'](respondWithResult(_0xa156ad,null))[_0xc5b6('0x46')](handleError(_0xa156ad,null));};exports[_0xc5b6('0x5a')]=function(_0x57db29,_0x559ffd,_0x259398){var _0x5e7166={};var _0x2fe4bb={};var _0x28f370;var _0x24bde5;return db[_0xc5b6('0x2e')][_0xc5b6('0x54')]({'where':{'id':_0x57db29['params']['id']}})[_0xc5b6('0x28')](handleEntityNotFound(_0x559ffd,null))[_0xc5b6('0x28')](function(_0x2e2821){if(_0x2e2821){_0x28f370=_0x2e2821;_0x2fe4bb['model']=_[_0xc5b6('0x32')](db[_0xc5b6('0x4f')][_0xc5b6('0x49')]);_0x2fe4bb[_0xc5b6('0x33')]=_[_0xc5b6('0x32')](_0x57db29['query']);_0x2fe4bb[_0xc5b6('0x34')]=_[_0xc5b6('0x35')](_0x2fe4bb[_0xc5b6('0x31')],_0x2fe4bb[_0xc5b6('0x33')]);_0x5e7166['attributes']=_[_0xc5b6('0x35')](_0x2fe4bb['model'],qs[_0xc5b6('0x37')](_0x57db29[_0xc5b6('0x33')][_0xc5b6('0x37')]));_0x5e7166[_0xc5b6('0x36')]=_0x5e7166['attributes'][_0xc5b6('0x38')]?_0x5e7166[_0xc5b6('0x36')]:_0x2fe4bb[_0xc5b6('0x31')];_0x5e7166[_0xc5b6('0x55')]=qs[_0xc5b6('0x3b')](_0x57db29[_0xc5b6('0x33')]['sort']);_0x5e7166['where']=qs['filters'](_[_0xc5b6('0x3d')](_0x57db29['query'],_0x2fe4bb['filters']));if(_0x57db29[_0xc5b6('0x33')][_0xc5b6('0x3e')]){_0x5e7166[_0xc5b6('0x3c')]=_[_0xc5b6('0x3f')](_0x5e7166[_0xc5b6('0x3c')],{'$or':_['map'](_0x5e7166[_0xc5b6('0x36')],function(_0x71cf6e){var _0x39c4fd={};_0x39c4fd[_0x71cf6e]={'$like':'%'+_0x57db29['query'][_0xc5b6('0x3e')]+'%'};return _0x39c4fd;})});}if(_0x57db29[_0xc5b6('0x33')]['$gte']){var _0x1c9374=_0x57db29[_0xc5b6('0x33')][_0xc5b6('0x5b')]['split'](',');var _0xac4a2b={};_0xac4a2b[_0x1c9374[0x0]]={'$gte':moment(_0x1c9374[0x1])[_0xc5b6('0x5c')](_0xc5b6('0x5d'))};_0x5e7166[_0xc5b6('0x3c')]=_['merge'](_0x5e7166[_0xc5b6('0x3c')],_0xac4a2b);}_0x5e7166=_[_0xc5b6('0x3f')]({},_0x5e7166,_0x57db29['options']);return _0x28f370[_0xc5b6('0x5a')](_0x5e7166);}})[_0xc5b6('0x28')](function(_0x578a50){if(_0x578a50){_0x24bde5=_0x578a50[_0xc5b6('0x38')];if(!_0x57db29[_0xc5b6('0x33')][_0xc5b6('0x39')](_0xc5b6('0x3a'))){_0x5e7166[_0xc5b6('0x21')]=qs[_0xc5b6('0x21')](_0x57db29[_0xc5b6('0x33')][_0xc5b6('0x21')]);_0x5e7166[_0xc5b6('0x20')]=qs[_0xc5b6('0x20')](_0x57db29[_0xc5b6('0x33')][_0xc5b6('0x20')]);}return _0x28f370[_0xc5b6('0x5a')](_0x5e7166);}})['then'](function(_0x22376a){if(_0x22376a){return _0x22376a?{'count':_0x24bde5,'rows':_0x22376a}:null;}})[_0xc5b6('0x28')](respondWithResult(_0x559ffd,null))['catch'](handleError(_0x559ffd,null));}; \ No newline at end of file +var _0x25b4=['VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','getMembers','findOne','User','nolimit','removeMembers','addMessage','ChatGroupId','getMessages','pick','$gte','format','YYYY-MM-DD\x20HH:mm:ss','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','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','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','status','end','json','undefined','limit','count','offset','set','save','then','destroy','sendStatus','error','stack','name','send','index','map','ChatGroup','rawAttributes','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','filter','where'];(function(_0x350bd9,_0x7ee684){var _0x460756=function(_0x564516){while(--_0x564516){_0x350bd9['push'](_0x350bd9['shift']());}};_0x460756(++_0x7ee684);}(_0x25b4,0xe0));var _0x425b=function(_0x3c59fc,_0x10dbd2){_0x3c59fc=_0x3c59fc-0x0;var _0x2b78d4=_0x25b4[_0x3c59fc];return _0x2b78d4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x425b('0x0'));var zipdir=require(_0x425b('0x1'));var jsonpatch=require(_0x425b('0x2'));var rp=require(_0x425b('0x3'));var moment=require('moment');var BPromise=require(_0x425b('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x425b('0x5'));var sox=require(_0x425b('0x6'));var csv=require(_0x425b('0x7'));var ejs=require(_0x425b('0x8'));var fs=require('fs');var fs_extra=require(_0x425b('0x9'));var _=require(_0x425b('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x425b('0xb'));var deskjs=require(_0x425b('0xc'));var toCsv=require('to-csv');var querystring=require(_0x425b('0xd'));var Papa=require(_0x425b('0xe'));var Redis=require(_0x425b('0xf'));var authService=require(_0x425b('0x10'));var qs=require(_0x425b('0x11'));var as=require(_0x425b('0x12'));var hardwareService=require(_0x425b('0x13'));var logger=require(_0x425b('0x14'))('api');var utils=require(_0x425b('0x15'));var config=require(_0x425b('0x16'));var licenseUtil=require(_0x425b('0x17'));var db=require(_0x425b('0x18'))['db'];config[_0x425b('0x19')]=_[_0x425b('0x1a')](config[_0x425b('0x19')],{'host':_0x425b('0x1b'),'port':0x18eb});var socket=require(_0x425b('0x1c'))(new Redis(config[_0x425b('0x19')]));require('./chatGroup.socket')['register'](socket);function respondWithStatusCode(_0x3fec83,_0x3b811a){_0x3b811a=_0x3b811a||0xcc;return function(_0x1d020d){if(_0x1d020d){return _0x3fec83['sendStatus'](_0x3b811a);}return _0x3fec83[_0x425b('0x1d')](_0x3b811a)[_0x425b('0x1e')]();};}function respondWithResult(_0xc83b96,_0x56a434){_0x56a434=_0x56a434||0xc8;return function(_0xf237a9){if(_0xf237a9){return _0xc83b96['status'](_0x56a434)[_0x425b('0x1f')](_0xf237a9);}};}function respondWithFilteredResult(_0x15c07f,_0x37c80d){return function(_0x46d1dc){if(_0x46d1dc){var _0x3f81b4=typeof _0x37c80d['offset']===_0x425b('0x20')&&typeof _0x37c80d[_0x425b('0x21')]===_0x425b('0x20');var _0x403b58=_0x46d1dc[_0x425b('0x22')];var _0x1f993c=_0x3f81b4?0x0:_0x37c80d[_0x425b('0x23')];var _0xa6008b=_0x3f81b4?_0x46d1dc['count']:_0x37c80d['offset']+_0x37c80d[_0x425b('0x21')];var _0x124784;if(_0xa6008b>=_0x403b58){_0xa6008b=_0x403b58;_0x124784=0xc8;}else{_0x124784=0xce;}_0x15c07f[_0x425b('0x1d')](_0x124784);return _0x15c07f[_0x425b('0x24')]('Content-Range',_0x1f993c+'-'+_0xa6008b+'/'+_0x403b58)[_0x425b('0x1f')](_0x46d1dc);}return null;};}function patchUpdates(_0x2efef0){return function(_0x3745dd){try{jsonpatch['apply'](_0x3745dd,_0x2efef0,!![]);}catch(_0x43d2a9){return BPromise['reject'](_0x43d2a9);}return _0x3745dd[_0x425b('0x25')]();};}function saveUpdates(_0x5842e9,_0x13ff96){return function(_0xceaeed){if(_0xceaeed){return _0xceaeed['update'](_0x5842e9)[_0x425b('0x26')](function(_0x559a24){return _0x559a24;});}return null;};}function removeEntity(_0x4656f2,_0x33d8b8){return function(_0x35cdcd){if(_0x35cdcd){return _0x35cdcd[_0x425b('0x27')]()[_0x425b('0x26')](function(){_0x4656f2[_0x425b('0x1d')](0xcc)[_0x425b('0x1e')]();});}};}function handleEntityNotFound(_0xab8ad0,_0xeb0120){return function(_0x420e4d){if(!_0x420e4d){_0xab8ad0[_0x425b('0x28')](0x194);}return _0x420e4d;};}function handleError(_0x393296,_0x20ae70){_0x20ae70=_0x20ae70||0x1f4;return function(_0x5cd58b){logger[_0x425b('0x29')](_0x5cd58b[_0x425b('0x2a')]);if(_0x5cd58b[_0x425b('0x2b')]){delete _0x5cd58b[_0x425b('0x2b')];}_0x393296[_0x425b('0x1d')](_0x20ae70)[_0x425b('0x2c')](_0x5cd58b);};}exports[_0x425b('0x2d')]=function(_0xdd2906,_0x3b1c03){var _0x1f53f1={},_0x5bb1d1={},_0x511697={'count':0x0,'rows':[]};var _0x3bc1df=_[_0x425b('0x2e')](db[_0x425b('0x2f')][_0x425b('0x30')],function(_0x511020){return{'name':_0x511020['fieldName'],'type':_0x511020[_0x425b('0x31')][_0x425b('0x32')]};});_0x5bb1d1['model']=_[_0x425b('0x2e')](_0x3bc1df,_0x425b('0x2b'));_0x5bb1d1['query']=_[_0x425b('0x33')](_0xdd2906[_0x425b('0x34')]);_0x5bb1d1[_0x425b('0x35')]=_[_0x425b('0x36')](_0x5bb1d1[_0x425b('0x37')],_0x5bb1d1[_0x425b('0x34')]);_0x1f53f1[_0x425b('0x38')]=_[_0x425b('0x36')](_0x5bb1d1[_0x425b('0x37')],qs[_0x425b('0x39')](_0xdd2906[_0x425b('0x34')][_0x425b('0x39')]));_0x1f53f1[_0x425b('0x38')]=_0x1f53f1[_0x425b('0x38')][_0x425b('0x3a')]?_0x1f53f1[_0x425b('0x38')]:_0x5bb1d1[_0x425b('0x37')];if(!_0xdd2906[_0x425b('0x34')][_0x425b('0x3b')]('nolimit')){_0x1f53f1['limit']=qs[_0x425b('0x21')](_0xdd2906[_0x425b('0x34')]['limit']);_0x1f53f1[_0x425b('0x23')]=qs['offset'](_0xdd2906[_0x425b('0x34')][_0x425b('0x23')]);}_0x1f53f1[_0x425b('0x3c')]=qs['sort'](_0xdd2906[_0x425b('0x34')][_0x425b('0x3d')]);_0x1f53f1['where']=qs[_0x425b('0x35')](_['pick'](_0xdd2906['query'],_0x5bb1d1[_0x425b('0x35')]),_0x3bc1df);if(_0xdd2906['query'][_0x425b('0x3e')]){_0x1f53f1[_0x425b('0x3f')]=_['merge'](_0x1f53f1[_0x425b('0x3f')],{'$or':_['map'](_0x3bc1df,function(_0x358e45){if(_0x358e45[_0x425b('0x31')]!==_0x425b('0x40')){var _0x24fbfa={};_0x24fbfa[_0x358e45[_0x425b('0x2b')]]={'$like':'%'+_0xdd2906['query'][_0x425b('0x3e')]+'%'};return _0x24fbfa;}})});}_0x1f53f1=_[_0x425b('0x41')]({},_0x1f53f1,_0xdd2906[_0x425b('0x42')]);var _0x52d478={'where':_0x1f53f1['where']};return db[_0x425b('0x2f')]['count'](_0x52d478)['then'](function(_0x4419c6){_0x511697['count']=_0x4419c6;if(_0xdd2906[_0x425b('0x34')][_0x425b('0x43')]){_0x1f53f1[_0x425b('0x44')]=[{'all':!![]}];}return db['ChatGroup'][_0x425b('0x45')](_0x1f53f1);})['then'](function(_0x8798fe){_0x511697[_0x425b('0x46')]=_0x8798fe;return _0x511697;})[_0x425b('0x26')](respondWithFilteredResult(_0x3b1c03,_0x1f53f1))[_0x425b('0x47')](handleError(_0x3b1c03,null));};exports[_0x425b('0x48')]=function(_0x4e9e91,_0x21bdfd){var _0x2cb9e3={'raw':!![],'where':{'id':_0x4e9e91['params']['id']}},_0x3ca7e8={};_0x3ca7e8[_0x425b('0x37')]=_[_0x425b('0x33')](db[_0x425b('0x2f')][_0x425b('0x30')]);_0x3ca7e8[_0x425b('0x34')]=_[_0x425b('0x33')](_0x4e9e91[_0x425b('0x34')]);_0x3ca7e8[_0x425b('0x35')]=_[_0x425b('0x36')](_0x3ca7e8['model'],_0x3ca7e8[_0x425b('0x34')]);_0x2cb9e3['attributes']=_[_0x425b('0x36')](_0x3ca7e8[_0x425b('0x37')],qs['fields'](_0x4e9e91[_0x425b('0x34')][_0x425b('0x39')]));_0x2cb9e3[_0x425b('0x38')]=_0x2cb9e3[_0x425b('0x38')][_0x425b('0x3a')]?_0x2cb9e3[_0x425b('0x38')]:_0x3ca7e8[_0x425b('0x37')];if(_0x4e9e91[_0x425b('0x34')][_0x425b('0x43')]){_0x2cb9e3[_0x425b('0x44')]=[{'all':!![]}];}_0x2cb9e3=_[_0x425b('0x41')]({},_0x2cb9e3,_0x4e9e91['options']);return db['ChatGroup'][_0x425b('0x49')](_0x2cb9e3)[_0x425b('0x26')](handleEntityNotFound(_0x21bdfd,null))['then'](respondWithResult(_0x21bdfd,null))['catch'](handleError(_0x21bdfd,null));};exports[_0x425b('0x4a')]=function(_0x3a9b70,_0x34ad34){return db[_0x425b('0x2f')][_0x425b('0x4a')](_0x3a9b70[_0x425b('0x4b')],{})['then'](respondWithResult(_0x34ad34,0xc9))[_0x425b('0x47')](handleError(_0x34ad34,null));};exports['update']=function(_0x1e9cc1,_0x347674){if(_0x1e9cc1['body']['id']){delete _0x1e9cc1[_0x425b('0x4b')]['id'];}return db[_0x425b('0x2f')][_0x425b('0x49')]({'where':{'id':_0x1e9cc1[_0x425b('0x4c')]['id']}})['then'](handleEntityNotFound(_0x347674,null))['then'](saveUpdates(_0x1e9cc1['body'],null))[_0x425b('0x26')](respondWithResult(_0x347674,null))[_0x425b('0x47')](handleError(_0x347674,null));};exports[_0x425b('0x27')]=function(_0x58391b,_0x48859d){return db[_0x425b('0x2f')][_0x425b('0x49')]({'where':{'id':_0x58391b[_0x425b('0x4c')]['id']}})[_0x425b('0x26')](handleEntityNotFound(_0x48859d,null))[_0x425b('0x26')](removeEntity(_0x48859d,null))[_0x425b('0x47')](handleError(_0x48859d,null));};exports[_0x425b('0x4d')]=function(_0x45693d,_0x586842){return db[_0x425b('0x2f')][_0x425b('0x4d')]()[_0x425b('0x26')](respondWithResult(_0x586842,null))['catch'](handleError(_0x586842,null));};exports[_0x425b('0x4e')]=function(_0x183e3a,_0x4348fe,_0x30fc77){return db[_0x425b('0x4f')][_0x425b('0x22')]({'where':{'ChatGroupId':_0x183e3a[_0x425b('0x4c')]['id'],'ToId':_0x183e3a[_0x425b('0x50')]['id'],'read':![]}})[_0x425b('0x26')](function(_0x1a9ad9){return{'id':_[_0x425b('0x51')](_0x183e3a[_0x425b('0x4c')]['id']),'count':_0x1a9ad9};})[_0x425b('0x26')](respondWithResult(_0x4348fe,null))[_0x425b('0x47')](handleError(_0x4348fe,null));};exports[_0x425b('0x52')]=function(_0x79075c,_0x296982,_0x5ac032){return db[_0x425b('0x2f')]['find']({'where':{'id':_0x79075c[_0x425b('0x4c')]['id']}})[_0x425b('0x26')](handleEntityNotFound(_0x296982,null))[_0x425b('0x26')](function(_0x1d2b8a){if(_0x1d2b8a){return _0x1d2b8a[_0x425b('0x52')](_0x79075c[_0x425b('0x4b')][_0x425b('0x53')],_['omit'](_0x79075c['body'],[_0x425b('0x53'),'id'])||{});}})[_0x425b('0x26')](respondWithResult(_0x296982,null))[_0x425b('0x47')](handleError(_0x296982,null));};exports[_0x425b('0x54')]=function(_0x42d8d6,_0x49dfbb,_0x201a41){var _0x141759={};var _0x537148={};var _0xacc558;var _0x5e0837;return db[_0x425b('0x2f')][_0x425b('0x55')]({'where':{'id':_0x42d8d6[_0x425b('0x4c')]['id']}})[_0x425b('0x26')](handleEntityNotFound(_0x49dfbb,null))[_0x425b('0x26')](function(_0x365e79){if(_0x365e79){_0xacc558=_0x365e79;_0x537148['model']=_[_0x425b('0x33')](db[_0x425b('0x56')][_0x425b('0x30')]);_0x537148[_0x425b('0x34')]=_[_0x425b('0x33')](_0x42d8d6[_0x425b('0x34')]);_0x537148[_0x425b('0x35')]=_[_0x425b('0x36')](_0x537148[_0x425b('0x37')],_0x537148[_0x425b('0x34')]);_0x141759[_0x425b('0x38')]=_[_0x425b('0x36')](_0x537148[_0x425b('0x37')],qs[_0x425b('0x39')](_0x42d8d6['query'][_0x425b('0x39')]));_0x141759[_0x425b('0x38')]=_0x141759[_0x425b('0x38')][_0x425b('0x3a')]?_0x141759[_0x425b('0x38')]:_0x537148['model'];_0x141759['order']=qs[_0x425b('0x3d')](_0x42d8d6[_0x425b('0x34')][_0x425b('0x3d')]);_0x141759[_0x425b('0x3f')]=qs[_0x425b('0x35')](_['pick'](_0x42d8d6[_0x425b('0x34')],_0x537148[_0x425b('0x35')]));if(_0x42d8d6[_0x425b('0x34')][_0x425b('0x3e')]){_0x141759['where']=_['merge'](_0x141759['where'],{'$or':_['map'](_0x141759[_0x425b('0x38')],function(_0x37addc){var _0x1e6193={};_0x1e6193[_0x37addc]={'$like':'%'+_0x42d8d6[_0x425b('0x34')][_0x425b('0x3e')]+'%'};return _0x1e6193;})});}_0x141759=_['merge']({},_0x141759,_0x42d8d6['options']);return _0xacc558[_0x425b('0x54')](_0x141759);}})['then'](function(_0x16a93b){if(_0x16a93b){_0x5e0837=_0x16a93b[_0x425b('0x3a')];if(!_0x42d8d6[_0x425b('0x34')][_0x425b('0x3b')](_0x425b('0x57'))){_0x141759[_0x425b('0x21')]=qs[_0x425b('0x21')](_0x42d8d6[_0x425b('0x34')][_0x425b('0x21')]);_0x141759[_0x425b('0x23')]=qs[_0x425b('0x23')](_0x42d8d6[_0x425b('0x34')][_0x425b('0x23')]);}return _0xacc558[_0x425b('0x54')](_0x141759);}})[_0x425b('0x26')](function(_0x4113d5){if(_0x4113d5){return _0x4113d5?{'count':_0x5e0837,'rows':_0x4113d5}:null;}})[_0x425b('0x26')](respondWithResult(_0x49dfbb,null))[_0x425b('0x47')](handleError(_0x49dfbb,null));};exports[_0x425b('0x58')]=function(_0x37d50e,_0x515060,_0x1ff2db){return db[_0x425b('0x2f')][_0x425b('0x49')]({'where':{'id':_0x37d50e[_0x425b('0x4c')]['id']}})[_0x425b('0x26')](handleEntityNotFound(_0x515060,null))['then'](function(_0x25fd63){if(_0x25fd63){return _0x25fd63[_0x425b('0x58')](_0x37d50e['query']['ids']);}})['then'](respondWithStatusCode(_0x515060,null))[_0x425b('0x47')](handleError(_0x515060,null));};exports[_0x425b('0x59')]=function(_0x4e5751,_0x12b617,_0x55dfcc){if(_0x4e5751[_0x425b('0x4b')]['id']){delete _0x4e5751[_0x425b('0x4b')]['id'];}return db['ChatGroup'][_0x425b('0x49')]({'where':{'id':_0x4e5751[_0x425b('0x4c')]['id']}})[_0x425b('0x26')](handleEntityNotFound(_0x12b617,null))[_0x425b('0x26')](function(_0x8c7b13){if(_0x8c7b13){_0x4e5751['body'][_0x425b('0x5a')]=_0x8c7b13['id'];return db['ChatInternalMessage'][_0x425b('0x4a')](_0x4e5751[_0x425b('0x4b')]);}})[_0x425b('0x26')](respondWithResult(_0x12b617,null))['catch'](handleError(_0x12b617,null));};exports[_0x425b('0x5b')]=function(_0x9458e0,_0x31ce02,_0x18772c){var _0x122b1f={};var _0xb35965={};var _0x1046e1;var _0x1a019f;return db[_0x425b('0x2f')][_0x425b('0x55')]({'where':{'id':_0x9458e0[_0x425b('0x4c')]['id']}})[_0x425b('0x26')](handleEntityNotFound(_0x31ce02,null))[_0x425b('0x26')](function(_0x50efb1){if(_0x50efb1){_0x1046e1=_0x50efb1;_0xb35965['model']=_['keys'](db[_0x425b('0x4f')][_0x425b('0x30')]);_0xb35965[_0x425b('0x34')]=_[_0x425b('0x33')](_0x9458e0[_0x425b('0x34')]);_0xb35965[_0x425b('0x35')]=_[_0x425b('0x36')](_0xb35965['model'],_0xb35965['query']);_0x122b1f['attributes']=_[_0x425b('0x36')](_0xb35965[_0x425b('0x37')],qs[_0x425b('0x39')](_0x9458e0['query']['fields']));_0x122b1f[_0x425b('0x38')]=_0x122b1f[_0x425b('0x38')][_0x425b('0x3a')]?_0x122b1f[_0x425b('0x38')]:_0xb35965[_0x425b('0x37')];_0x122b1f['order']=qs[_0x425b('0x3d')](_0x9458e0['query']['sort']);_0x122b1f[_0x425b('0x3f')]=qs[_0x425b('0x35')](_[_0x425b('0x5c')](_0x9458e0[_0x425b('0x34')],_0xb35965[_0x425b('0x35')]));if(_0x9458e0['query'][_0x425b('0x3e')]){_0x122b1f[_0x425b('0x3f')]=_[_0x425b('0x41')](_0x122b1f[_0x425b('0x3f')],{'$or':_[_0x425b('0x2e')](_0x122b1f['attributes'],function(_0x38f2c4){var _0x4366cb={};_0x4366cb[_0x38f2c4]={'$like':'%'+_0x9458e0[_0x425b('0x34')][_0x425b('0x3e')]+'%'};return _0x4366cb;})});}if(_0x9458e0[_0x425b('0x34')][_0x425b('0x5d')]){var _0x149aa1=_0x9458e0[_0x425b('0x34')][_0x425b('0x5d')]['split'](',');var _0xbcdc45={};_0xbcdc45[_0x149aa1[0x0]]={'$gte':moment(_0x149aa1[0x1])[_0x425b('0x5e')](_0x425b('0x5f'))};_0x122b1f[_0x425b('0x3f')]=_[_0x425b('0x41')](_0x122b1f[_0x425b('0x3f')],_0xbcdc45);}_0x122b1f=_['merge']({},_0x122b1f,_0x9458e0['options']);return _0x1046e1['getMessages'](_0x122b1f);}})['then'](function(_0x1693f4){if(_0x1693f4){_0x1a019f=_0x1693f4[_0x425b('0x3a')];if(!_0x9458e0[_0x425b('0x34')][_0x425b('0x3b')](_0x425b('0x57'))){_0x122b1f[_0x425b('0x21')]=qs[_0x425b('0x21')](_0x9458e0[_0x425b('0x34')][_0x425b('0x21')]);_0x122b1f[_0x425b('0x23')]=qs[_0x425b('0x23')](_0x9458e0[_0x425b('0x34')][_0x425b('0x23')]);}return _0x1046e1[_0x425b('0x5b')](_0x122b1f);}})['then'](function(_0xa01449){if(_0xa01449){return _0xa01449?{'count':_0x1a019f,'rows':_0xa01449}:null;}})[_0x425b('0x26')](respondWithResult(_0x31ce02,null))[_0x425b('0x47')](handleError(_0x31ce02,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index 706b89b..debfc6a 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 _0xee2c=['update','emit','hasOwnProperty','hook','exports','events','ChatGroup','setMaxListeners','save'];(function(_0x43232a,_0xfda881){var _0x48db5f=function(_0x203b22){while(--_0x203b22){_0x43232a['push'](_0x43232a['shift']());}};_0x48db5f(++_0xfda881);}(_0xee2c,0x1c7));var _0xcee2=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0xee2c[_0x3e5086];return _0xfeb102;};'use strict';var EventEmitter=require(_0xcee2('0x0'));var ChatGroup=require('../../mysqldb')['db'][_0xcee2('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xcee2('0x2')](0x0);var events={'afterCreate':_0xcee2('0x3'),'afterUpdate':_0xcee2('0x4'),'afterDestroy':'remove'};function emitEvent(_0x589e9d){return function(_0xc9b213,_0xb70cd1,_0x49d04d){ChatGroupEvents[_0xcee2('0x5')](_0x589e9d+':'+_0xc9b213['id'],_0xc9b213);ChatGroupEvents[_0xcee2('0x5')](_0x589e9d,_0xc9b213);_0x49d04d(null);};}for(var e in events){if(events[_0xcee2('0x6')](e)){var event=events[e];ChatGroup[_0xcee2('0x7')](e,emitEvent(event));}}module[_0xcee2('0x8')]=ChatGroupEvents; \ No newline at end of file +var _0xfdb5=['ChatGroup','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x5608a3,_0x5b33c5){var _0x1ed50a=function(_0x959171){while(--_0x959171){_0x5608a3['push'](_0x5608a3['shift']());}};_0x1ed50a(++_0x5b33c5);}(_0xfdb5,0x18f));var _0x5fdb=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0xfdb5[_0x12fc8d];return _0x3f9d04;};'use strict';var EventEmitter=require(_0x5fdb('0x0'));var ChatGroup=require('../../mysqldb')['db'][_0x5fdb('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x5fdb('0x2')](0x0);var events={'afterCreate':_0x5fdb('0x3'),'afterUpdate':_0x5fdb('0x4'),'afterDestroy':_0x5fdb('0x5')};function emitEvent(_0x379f9b){return function(_0x24cbe7,_0x334e53,_0x5f3fc6){ChatGroupEvents[_0x5fdb('0x6')](_0x379f9b+':'+_0x24cbe7['id'],_0x24cbe7);ChatGroupEvents['emit'](_0x379f9b,_0x24cbe7);_0x5f3fc6(null);};}for(var e in events){if(events[_0x5fdb('0x7')](e)){var event=events[e];ChatGroup[_0x5fdb('0x8')](e,emitEvent(event));}}module[_0x5fdb('0x9')]=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index 08b9e17..f391bab 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 _0x0384=['moment','bluebird','request-promise','path','rimraf','./chatGroup.attributes','exports','define','ChatGroup','lodash','util','../../config/logger','api'];(function(_0x30ab4d,_0x1324db){var _0x41eac2=function(_0x2f7d58){while(--_0x2f7d58){_0x30ab4d['push'](_0x30ab4d['shift']());}};_0x41eac2(++_0x1324db);}(_0x0384,0x11a));var _0x4038=function(_0x2dea0d,_0x553e6f){_0x2dea0d=_0x2dea0d-0x0;var _0x779e6e=_0x0384[_0x2dea0d];return _0x779e6e;};'use strict';var _=require(_0x4038('0x0'));var util=require(_0x4038('0x1'));var logger=require(_0x4038('0x2'))(_0x4038('0x3'));var moment=require(_0x4038('0x4'));var BPromise=require(_0x4038('0x5'));var rp=require(_0x4038('0x6'));var fs=require('fs');var path=require(_0x4038('0x7'));var rimraf=require(_0x4038('0x8'));var config=require('../../config/environment');var attributes=require(_0x4038('0x9'));module[_0x4038('0xa')]=function(_0x4077e4,_0x40c601){return _0x4077e4[_0x4038('0xb')](_0x4038('0xc'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7d89=['request-promise','path','../../config/environment','define','ChatGroup','chat_groups','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x331052,_0x1bec7a){var _0x409de2=function(_0x305528){while(--_0x305528){_0x331052['push'](_0x331052['shift']());}};_0x409de2(++_0x1bec7a);}(_0x7d89,0x126));var _0x97d8=function(_0x2f1a48,_0x1fd155){_0x2f1a48=_0x2f1a48-0x0;var _0x4ff0b5=_0x7d89[_0x2f1a48];return _0x4ff0b5;};'use strict';var _=require(_0x97d8('0x0'));var util=require(_0x97d8('0x1'));var logger=require(_0x97d8('0x2'))(_0x97d8('0x3'));var moment=require(_0x97d8('0x4'));var BPromise=require(_0x97d8('0x5'));var rp=require(_0x97d8('0x6'));var fs=require('fs');var path=require(_0x97d8('0x7'));var rimraf=require('rimraf');var config=require(_0x97d8('0x8'));var attributes=require('./chatGroup.attributes');module['exports']=function(_0x2dd528,_0x2e2891){return _0x2dd528[_0x97d8('0x9')](_0x97d8('0xa'),attributes,{'tableName':_0x97d8('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 b97e6fb..e6d7250 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 _0x1de4=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','./chatGroup.socket','register','request','then','info','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatGroup,\x20%s,\x20%s'];(function(_0xc8db6b,_0x320abd){var _0x12cb81=function(_0x417540){while(--_0x417540){_0xc8db6b['push'](_0xc8db6b['shift']());}};_0x12cb81(++_0x320abd);}(_0x1de4,0x94));var _0x41de=function(_0x51cb36,_0x4db5dc){_0x51cb36=_0x51cb36-0x0;var _0x50c6af=_0x1de4[_0x51cb36];return _0x50c6af;};'use strict';var _=require(_0x41de('0x0'));var util=require(_0x41de('0x1'));var moment=require(_0x41de('0x2'));var BPromise=require(_0x41de('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x41de('0x4'));var db=require(_0x41de('0x5'))['db'];var utils=require(_0x41de('0x6'));var logger=require('../../config/logger')(_0x41de('0x7'));var config=require(_0x41de('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x41de('0x9')][_0x41de('0xa')]({'port':0x232a});config[_0x41de('0xb')]=_[_0x41de('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x41de('0xd'))(new Redis(config[_0x41de('0xb')]));require(_0x41de('0xe'))[_0x41de('0xf')](socket);function respondWithRpcPromise(_0x1259ce,_0xac4f6c,_0x5c2eb6){return new BPromise(function(_0x3a923d,_0x415af3){return client[_0x41de('0x10')](_0x1259ce,_0x5c2eb6)[_0x41de('0x11')](function(_0x41e515){logger[_0x41de('0x12')]('ChatGroup,\x20%s,\x20%s',_0xac4f6c,_0x41de('0x13'));logger[_0x41de('0x14')](_0x41de('0x15'),_0xac4f6c,'request\x20sent',JSON[_0x41de('0x16')](_0x41e515));if(_0x41e515[_0x41de('0x17')]){if(_0x41e515['error'][_0x41de('0x18')]===0x1f4){logger[_0x41de('0x17')](_0x41de('0x19'),_0xac4f6c,_0x41e515[_0x41de('0x17')][_0x41de('0x1a')]);return _0x415af3(_0x41e515[_0x41de('0x17')][_0x41de('0x1a')]);}logger[_0x41de('0x17')](_0x41de('0x19'),_0xac4f6c,_0x41e515[_0x41de('0x17')][_0x41de('0x1a')]);return _0x3a923d(_0x41e515['error'][_0x41de('0x1a')]);}else{logger[_0x41de('0x12')]('ChatGroup,\x20%s,\x20%s',_0xac4f6c,_0x41de('0x13'));_0x3a923d(_0x41e515[_0x41de('0x1b')][_0x41de('0x1a')]);}})[_0x41de('0x1c')](function(_0x1a7b6f){logger['error']('ChatGroup,\x20%s,\x20%s',_0xac4f6c,_0x1a7b6f);_0x415af3(_0x1a7b6f);});});} \ No newline at end of file +var _0x8ccc=['message','result','catch','lodash','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./chatGroup.socket','register','then','info','ChatGroup,\x20%s,\x20%s','debug','ChatGroup,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0xd7de81,_0x35ca61){var _0x41c627=function(_0x10aeff){while(--_0x10aeff){_0xd7de81['push'](_0xd7de81['shift']());}};_0x41c627(++_0x35ca61);}(_0x8ccc,0x16f));var _0xc8cc=function(_0x332d62,_0x236139){_0x332d62=_0x332d62-0x0;var _0x3bd864=_0x8ccc[_0x332d62];return _0x3bd864;};'use strict';var _=require(_0xc8cc('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xc8cc('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc8cc('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xc8cc('0x3'))(_0xc8cc('0x4'));var config=require(_0xc8cc('0x5'));var jayson=require(_0xc8cc('0x6'));var client=jayson[_0xc8cc('0x7')]['http']({'port':0x232a});config['redis']=_[_0xc8cc('0x8')](config[_0xc8cc('0x9')],{'host':_0xc8cc('0xa'),'port':0x18eb});var socket=require(_0xc8cc('0xb'))(new Redis(config[_0xc8cc('0x9')]));require(_0xc8cc('0xc'))[_0xc8cc('0xd')](socket);function respondWithRpcPromise(_0x181d7d,_0x1913e0,_0x3fe1d8){return new BPromise(function(_0x479f74,_0x2cac96){return client['request'](_0x181d7d,_0x3fe1d8)[_0xc8cc('0xe')](function(_0x1d02fe){logger[_0xc8cc('0xf')](_0xc8cc('0x10'),_0x1913e0,'request\x20sent');logger[_0xc8cc('0x11')](_0xc8cc('0x12'),_0x1913e0,_0xc8cc('0x13'),JSON[_0xc8cc('0x14')](_0x1d02fe));if(_0x1d02fe[_0xc8cc('0x15')]){if(_0x1d02fe['error'][_0xc8cc('0x16')]===0x1f4){logger[_0xc8cc('0x15')](_0xc8cc('0x10'),_0x1913e0,_0x1d02fe[_0xc8cc('0x15')][_0xc8cc('0x17')]);return _0x2cac96(_0x1d02fe[_0xc8cc('0x15')][_0xc8cc('0x17')]);}logger[_0xc8cc('0x15')](_0xc8cc('0x10'),_0x1913e0,_0x1d02fe[_0xc8cc('0x15')][_0xc8cc('0x17')]);return _0x479f74(_0x1d02fe[_0xc8cc('0x15')][_0xc8cc('0x17')]);}else{logger[_0xc8cc('0xf')](_0xc8cc('0x10'),_0x1913e0,_0xc8cc('0x13'));_0x479f74(_0x1d02fe[_0xc8cc('0x18')][_0xc8cc('0x17')]);}})[_0xc8cc('0x19')](function(_0xb435db){logger[_0xc8cc('0x15')]('ChatGroup,\x20%s,\x20%s',_0x1913e0,_0xb435db);_0x2cac96(_0xb435db);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index 3e19e1f..acac911 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 _0xffaa=['./chatGroup.events','save','remove','update','emit','removeListener','length','chatGroup:'];(function(_0xa6e9fa,_0x33372a){var _0x44592c=function(_0x53febe){while(--_0x53febe){_0xa6e9fa['push'](_0xa6e9fa['shift']());}};_0x44592c(++_0x33372a);}(_0xffaa,0x1e0));var _0xaffa=function(_0x67f102,_0x2d3bd1){_0x67f102=_0x67f102-0x0;var _0x568b50=_0xffaa[_0x67f102];return _0x568b50;};'use strict';var ChatGroupEvents=require(_0xaffa('0x0'));var events=[_0xaffa('0x1'),_0xaffa('0x2'),_0xaffa('0x3')];function createListener(_0x1ceac5,_0x145359){return function(_0x4935bc){_0x145359[_0xaffa('0x4')](_0x1ceac5,_0x4935bc);};}function removeListener(_0x4c63e5,_0x3819f0){return function(){ChatGroupEvents[_0xaffa('0x5')](_0x4c63e5,_0x3819f0);};}exports['register']=function(_0x4ecc09){for(var _0x4f031d=0x0,_0x21298c=events[_0xaffa('0x6')];_0x4f031d<_0x21298c;_0x4f031d++){var _0x5a6ea6=events[_0x4f031d];var _0x2e37b6=createListener(_0xaffa('0x7')+_0x5a6ea6,_0x4ecc09);ChatGroupEvents['on'](_0x5a6ea6,_0x2e37b6);}}; \ No newline at end of file +var _0x75b5=['emit','removeListener','register','chatGroup:','save','remove','update'];(function(_0x3ff33a,_0x32e7a5){var _0x43517f=function(_0x5f0f4a){while(--_0x5f0f4a){_0x3ff33a['push'](_0x3ff33a['shift']());}};_0x43517f(++_0x32e7a5);}(_0x75b5,0xd6));var _0x575b=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0x75b5[_0x43d11d];return _0x38cd08;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=[_0x575b('0x0'),_0x575b('0x1'),_0x575b('0x2')];function createListener(_0x2c37ca,_0xf70335){return function(_0x22ccc9){_0xf70335[_0x575b('0x3')](_0x2c37ca,_0x22ccc9);};}function removeListener(_0x5b04db,_0x51759c){return function(){ChatGroupEvents[_0x575b('0x4')](_0x5b04db,_0x51759c);};}exports[_0x575b('0x5')]=function(_0x25db80){for(var _0x28fc02=0x0,_0x7ad9da=events['length'];_0x28fc02<_0x7ad9da;_0x28fc02++){var _0x49a6e4=events[_0x28fc02];var _0x420e73=createListener(_0x575b('0x6')+_0x49a6e4,_0x25db80);ChatGroupEvents['on'](_0x49a6e4,_0x420e73);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 92d9f86..5089ab5 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 _0x9fda=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/unread','getUnread','/:id/members','getMembers','getMessages','post','addMembers','/:id/messages','addMessage','put','update','destroy','delete','removeMembers','exports','multer'];(function(_0x2b78de,_0x547dd0){var _0x29f987=function(_0x423471){while(--_0x423471){_0x2b78de['push'](_0x2b78de['shift']());}};_0x29f987(++_0x547dd0);}(_0x9fda,0x15f));var _0xa9fd=function(_0x29c4e5,_0x4b0c43){_0x29c4e5=_0x29c4e5-0x0;var _0x108d1f=_0x9fda[_0x29c4e5];return _0x108d1f;};'use strict';var multer=require(_0xa9fd('0x0'));var util=require(_0xa9fd('0x1'));var path=require(_0xa9fd('0x2'));var timeout=require(_0xa9fd('0x3'));var express=require(_0xa9fd('0x4'));var router=express[_0xa9fd('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xa9fd('0x6'));var interaction=require(_0xa9fd('0x7'));var config=require(_0xa9fd('0x8'));var controller=require(_0xa9fd('0x9'));router[_0xa9fd('0xa')]('/',auth[_0xa9fd('0xb')](),controller[_0xa9fd('0xc')]);router[_0xa9fd('0xa')](_0xa9fd('0xd'),auth[_0xa9fd('0xb')](),controller[_0xa9fd('0xe')]);router[_0xa9fd('0xa')](_0xa9fd('0xf'),auth['isAuthenticated'](),controller[_0xa9fd('0x10')]);router['get'](_0xa9fd('0x11'),auth[_0xa9fd('0xb')](),controller[_0xa9fd('0x12')]);router[_0xa9fd('0xa')](_0xa9fd('0x13'),auth['isAuthenticated'](),controller[_0xa9fd('0x14')]);router[_0xa9fd('0xa')]('/:id/messages',auth[_0xa9fd('0xb')](),controller[_0xa9fd('0x15')]);router[_0xa9fd('0x16')]('/',auth[_0xa9fd('0xb')](),controller['create']);router[_0xa9fd('0x16')]('/:id/members',auth['isAuthenticated'](),controller[_0xa9fd('0x17')]);router[_0xa9fd('0x16')](_0xa9fd('0x18'),auth['isAuthenticated'](),controller[_0xa9fd('0x19')]);router[_0xa9fd('0x1a')](_0xa9fd('0xf'),auth[_0xa9fd('0xb')](),controller[_0xa9fd('0x1b')]);router['delete'](_0xa9fd('0xf'),auth[_0xa9fd('0xb')](),controller[_0xa9fd('0x1c')]);router[_0xa9fd('0x1d')](_0xa9fd('0x13'),auth['isAuthenticated'](),controller[_0xa9fd('0x1e')]);module[_0xa9fd('0x1f')]=router; \ No newline at end of file +var _0xc791=['multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','create','addMembers','addMessage','put','/:id','update','delete','destroy','exports'];(function(_0x99868f,_0xbdb8e7){var _0x27a71b=function(_0x41feca){while(--_0x41feca){_0x99868f['push'](_0x99868f['shift']());}};_0x27a71b(++_0xbdb8e7);}(_0xc791,0x8c));var _0x1c79=function(_0xa51ba0,_0x3bf58d){_0xa51ba0=_0xa51ba0-0x0;var _0x17f343=_0xc791[_0xa51ba0];return _0x17f343;};'use strict';var multer=require(_0x1c79('0x0'));var util=require(_0x1c79('0x1'));var path=require(_0x1c79('0x2'));var timeout=require(_0x1c79('0x3'));var express=require(_0x1c79('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x1c79('0x5'));var interaction=require(_0x1c79('0x6'));var config=require('../../config/environment');var controller=require('./chatGroup.controller');router[_0x1c79('0x7')]('/',auth[_0x1c79('0x8')](),controller[_0x1c79('0x9')]);router[_0x1c79('0x7')](_0x1c79('0xa'),auth[_0x1c79('0x8')](),controller['describe']);router['get']('/:id',auth[_0x1c79('0x8')](),controller[_0x1c79('0xb')]);router[_0x1c79('0x7')](_0x1c79('0xc'),auth[_0x1c79('0x8')](),controller[_0x1c79('0xd')]);router['get'](_0x1c79('0xe'),auth[_0x1c79('0x8')](),controller[_0x1c79('0xf')]);router[_0x1c79('0x7')](_0x1c79('0x10'),auth[_0x1c79('0x8')](),controller[_0x1c79('0x11')]);router[_0x1c79('0x12')]('/',auth['isAuthenticated'](),controller[_0x1c79('0x13')]);router[_0x1c79('0x12')]('/:id/members',auth[_0x1c79('0x8')](),controller[_0x1c79('0x14')]);router['post'](_0x1c79('0x10'),auth['isAuthenticated'](),controller[_0x1c79('0x15')]);router[_0x1c79('0x16')](_0x1c79('0x17'),auth[_0x1c79('0x8')](),controller[_0x1c79('0x18')]);router[_0x1c79('0x19')]('/:id',auth[_0x1c79('0x8')](),controller[_0x1c79('0x1a')]);router['delete']('/:id/members',auth[_0x1c79('0x8')](),controller['removeMembers']);module[_0x1c79('0x1b')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index 7ff7209..cbb75be 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 _0x3c81=['INTEGER','ENUM','TEXT','STRING','DATE','long','out','BOOLEAN','sequelize','exports'];(function(_0x1b6bc3,_0xc728b7){var _0x1e0121=function(_0x4925ae){while(--_0x4925ae){_0x1b6bc3['push'](_0x1b6bc3['shift']());}};_0x1e0121(++_0xc728b7);}(_0x3c81,0x102));var _0x13c8=function(_0x585c26,_0xb238c){_0x585c26=_0x585c26-0x0;var _0x3226cd=_0x3c81[_0x585c26];return _0x3226cd;};'use strict';var Sequelize=require(_0x13c8('0x0'));module[_0x13c8('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x13c8('0x2')]},'ratingType':{'type':Sequelize[_0x13c8('0x3')]('star','thumb'),'defaultValue':'star'},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0x13c8('0x4')]},'mailTranscript':{'type':Sequelize[_0x13c8('0x5')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x13c8('0x6')]},'disposition':{'type':Sequelize[_0x13c8('0x5')]},'secondDisposition':{'type':Sequelize[_0x13c8('0x5')]},'thirdDisposition':{'type':Sequelize[_0x13c8('0x5')]},'note':{'type':Sequelize[_0x13c8('0x5')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0x13c8('0x5')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0x13c8('0x5')]},'deviceModel':{'type':Sequelize[_0x13c8('0x5')]},'deviceVendor':{'type':Sequelize[_0x13c8('0x5')]},'deviceType':{'type':Sequelize[_0x13c8('0x5')]},'referer':{'type':Sequelize[_0x13c8('0x4')]},'customerIp':{'type':Sequelize[_0x13c8('0x5')]},'formData':{'type':Sequelize[_0x13c8('0x4')](_0x13c8('0x7'))},'read1stAt':{'type':Sequelize[_0x13c8('0x6')]},'lastMsgAt':{'type':Sequelize[_0x13c8('0x6')]},'lastMsgDirection':{'type':Sequelize[_0x13c8('0x3')]('in',_0x13c8('0x8')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x13c8('0x5')]},'customerPort':{'type':Sequelize[_0x13c8('0x5')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0x13c8('0x9')],'defaultValue':![]}}; \ No newline at end of file +var _0xee4e=['STRING','DATE','sequelize','exports','BOOLEAN','ENUM','star','thumb','TEXT'];(function(_0x37846a,_0x42db81){var _0x401321=function(_0x376993){while(--_0x376993){_0x37846a['push'](_0x37846a['shift']());}};_0x401321(++_0x42db81);}(_0xee4e,0x122));var _0xeee4=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xee4e[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xeee4('0x0'));module[_0xeee4('0x1')]={'closed':{'type':Sequelize[_0xeee4('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0xeee4('0x3')](_0xeee4('0x4'),_0xeee4('0x5')),'defaultValue':_0xeee4('0x4')},'ratingMessage':{'type':Sequelize[_0xeee4('0x6')]},'pathTranscript':{'type':Sequelize[_0xeee4('0x6')]},'mailTranscript':{'type':Sequelize[_0xeee4('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xeee4('0x8')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xeee4('0x7')]},'thirdDisposition':{'type':Sequelize[_0xeee4('0x7')]},'note':{'type':Sequelize[_0xeee4('0x7')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0xeee4('0x7')]},'osName':{'type':Sequelize[_0xeee4('0x7')]},'osVersion':{'type':Sequelize[_0xeee4('0x7')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0xeee4('0x7')]},'deviceType':{'type':Sequelize[_0xeee4('0x7')]},'referer':{'type':Sequelize[_0xeee4('0x6')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0xeee4('0x6')]('long')},'read1stAt':{'type':Sequelize[_0xeee4('0x8')]},'lastMsgAt':{'type':Sequelize[_0xeee4('0x8')]},'lastMsgDirection':{'type':Sequelize[_0xeee4('0x3')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xeee4('0x7')]},'customerPort':{'type':Sequelize[_0xeee4('0x7')]},'vidaooSessionId':{'type':Sequelize[_0xeee4('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0xeee4('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index d559edb..36b81c1 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 _0x9ffd=['MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','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','contactName','DESC','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','agent','getChatWebsites','isEmpty','i.ChatWebsiteId\x20IS\x20NULL','role','sequelize','keyBy','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','GROUP_CONCAT(DISTINCT\x20t.id)','toString','ui.ChatInteractionId\x20IN\x20?','groupBy','params','includeAll','find','destroy','describe','createVidaooSession','findOne','ChatWebsite','vidaooNote','vidaooApiKey','vidaooEscalation','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','vidaooMetadata','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','join_url','out','ChatMessage','create','updateAttributes','customUpdate','abandonInteraction,\x20%s,\x20%s,\x20%s','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','abandon','attachmentUpload','file','originalname','basename','filename','Attachment','attachmentDownload','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','Messages','%s%d','agentAlias','System','Visitor','agentIdentifier','website_alias','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','appendFileSync','MailAccount','Smtp','service','host','port','secure','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','addMessage','ids','omit','getMessages','ChatInteractionId','YYYY-MM-DD\x20HH:mm:ss','options','findAll','rows','secret','include','includeAgent','push','setTags','spread','Tag','emit','chatInteractionTags:save','removeTags','unix','tmp','server','files','CmContact','firstName','attachments','Account','Owner','get','mkdirSync','Chat','closedAt','browserName','osName','referer','customerIp','customerPort','tail','existsSync','createReadStream','pipe','lastName','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','register','jayson/promise','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','sendStatus','end','json','offset','undefined','limit','count','status','set','apply','reject','save','update','stack','name','render','merge','body','contact','account','Users','fullname','Tags','TagIds','split','forEach','index','ChatInteraction','rawAttributes','fieldName','type','keys','query','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','select','field','color','from','left_join','u.id\x20=\x20ui.UserId','chat_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','parseSearch','search','conditions','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','map','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','compact','ChatWebsiteId','where','i.ChatWebsiteId\x20IN\x20?','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?'];(function(_0x550d12,_0x5384bd){var _0x12103d=function(_0x2a9834){while(--_0x2a9834){_0x550d12['push'](_0x550d12['shift']());}};_0x12103d(++_0x5384bd);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x274be7,_0x84897d){_0x274be7=_0x274be7-0x0;var _0x123967=_0x9ffd[_0x274be7];return _0x123967;};'use strict';var emlformat=require(_0xd9ff('0x0'));var rimraf=require(_0xd9ff('0x1'));var zipdir=require(_0xd9ff('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd9ff('0x3'));var moment=require(_0xd9ff('0x4'));var BPromise=require(_0xd9ff('0x5'));var Mustache=require(_0xd9ff('0x6'));var util=require('util');var path=require(_0xd9ff('0x7'));var sox=require(_0xd9ff('0x8'));var csv=require('to-csv');var ejs=require(_0xd9ff('0x9'));var fs=require('fs');var fs_extra=require(_0xd9ff('0xa'));var _=require(_0xd9ff('0xb'));var squel=require(_0xd9ff('0xc'));var crypto=require(_0xd9ff('0xd'));var jsforce=require(_0xd9ff('0xe'));var deskjs=require(_0xd9ff('0xf'));var toCsv=require(_0xd9ff('0x10'));var querystring=require(_0xd9ff('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xd9ff('0x12'));var pdf=require(_0xd9ff('0x13'));var hardwareService=require(_0xd9ff('0x14'));var logger=require(_0xd9ff('0x15'))(_0xd9ff('0x16'));var utils=require(_0xd9ff('0x17'));var config=require(_0xd9ff('0x18'));var licenseUtil=require(_0xd9ff('0x19'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xd9ff('0x1a')](config[_0xd9ff('0x1b')],{'host':_0xd9ff('0x1c'),'port':0x18eb});var socket=require(_0xd9ff('0x1d'))(new Redis(config[_0xd9ff('0x1b')]));require('./chatInteraction.socket')[_0xd9ff('0x1e')](socket);var jayson=require(_0xd9ff('0x1f'));var client=jayson['client'][_0xd9ff('0x20')]({'port':0x232b});var client9004=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0x547e28,_0x4c5718,_0x271287,_0x4f9d6d){return new BPromise(function(_0x35679e,_0xa30fd2){var _0x39c6ce=_0x4f9d6d||client;return _0x39c6ce[_0xd9ff('0x21')](_0x547e28,_0x271287)[_0xd9ff('0x22')](function(_0x2d4df1){logger[_0xd9ff('0x23')](_0xd9ff('0x24'),_0x4c5718,_0xd9ff('0x25'));logger[_0xd9ff('0x26')](_0xd9ff('0x27'),_0x4c5718,_0xd9ff('0x25'),JSON[_0xd9ff('0x28')](_0x2d4df1));if(_0x2d4df1['error']){if(_0x2d4df1['error'][_0xd9ff('0x29')]===0x1f4){logger[_0xd9ff('0x2a')]('ChatInteraction,\x20%s,\x20%s',_0x4c5718,_0x2d4df1['error']['message']);return _0xa30fd2(_0x2d4df1['error'][_0xd9ff('0x2b')]);}logger['error'](_0xd9ff('0x24'),_0x4c5718,_0x2d4df1[_0xd9ff('0x2a')][_0xd9ff('0x2b')]);return _0x35679e(_0x2d4df1[_0xd9ff('0x2a')][_0xd9ff('0x2b')]);}else{logger[_0xd9ff('0x23')]('ChatInteraction,\x20%s,\x20%s',_0x4c5718,'request\x20sent');_0x35679e(_0x2d4df1[_0xd9ff('0x2c')]['message']);}})[_0xd9ff('0x2d')](function(_0x4d86fe){logger[_0xd9ff('0x2a')]('ChatInteraction,\x20%s,\x20%s',_0x4c5718,_0x4d86fe);_0xa30fd2(_0x4d86fe);});});}function respondWithStatusCode(_0x10cbdd,_0x159e56){_0x159e56=_0x159e56||0xcc;return function(_0x2138b4){if(_0x2138b4){return _0x10cbdd[_0xd9ff('0x2e')](_0x159e56);}return _0x10cbdd['status'](_0x159e56)[_0xd9ff('0x2f')]();};}function respondWithResult(_0xe11f88,_0x1c78c4){_0x1c78c4=_0x1c78c4||0xc8;return function(_0x4390f7){if(_0x4390f7){return _0xe11f88['status'](_0x1c78c4)[_0xd9ff('0x30')](_0x4390f7);}};}function respondWithFilteredResult(_0x3792d9,_0x44b5a7){return function(_0x45fb63){if(_0x45fb63){var _0x263d3a=typeof _0x44b5a7[_0xd9ff('0x31')]===_0xd9ff('0x32')&&typeof _0x44b5a7[_0xd9ff('0x33')]===_0xd9ff('0x32');var _0x5706cf=_0x45fb63[_0xd9ff('0x34')];var _0x4ba2be=_0x263d3a?0x0:_0x44b5a7[_0xd9ff('0x31')];var _0x29c532=_0x263d3a?_0x45fb63[_0xd9ff('0x34')]:_0x44b5a7['offset']+_0x44b5a7[_0xd9ff('0x33')];var _0x3b26da;if(_0x29c532>=_0x5706cf){_0x29c532=_0x5706cf;_0x3b26da=0xc8;}else{_0x3b26da=0xce;}_0x3792d9[_0xd9ff('0x35')](_0x3b26da);return _0x3792d9[_0xd9ff('0x36')]('Content-Range',_0x4ba2be+'-'+_0x29c532+'/'+_0x5706cf)[_0xd9ff('0x30')](_0x45fb63);}return null;};}function patchUpdates(_0x5743de){return function(_0x18c28b){try{jsonpatch[_0xd9ff('0x37')](_0x18c28b,_0x5743de,!![]);}catch(_0x323cb5){return BPromise[_0xd9ff('0x38')](_0x323cb5);}return _0x18c28b[_0xd9ff('0x39')]();};}function saveUpdates(_0xdf3947,_0x2cc2ae){return function(_0x281c7b){if(_0x281c7b){return _0x281c7b[_0xd9ff('0x3a')](_0xdf3947)[_0xd9ff('0x22')](function(_0x4813a5){return _0x4813a5;});}return null;};}function removeEntity(_0x34e9a9,_0x4670e4){return function(_0x66f4d){if(_0x66f4d){return _0x66f4d['destroy']()[_0xd9ff('0x22')](function(){_0x34e9a9[_0xd9ff('0x35')](0xcc)[_0xd9ff('0x2f')]();});}};}function handleEntityNotFound(_0x4ab10f,_0x3d449d){return function(_0x5e3ff9){if(!_0x5e3ff9){_0x4ab10f[_0xd9ff('0x2e')](0x194);}return _0x5e3ff9;};}function handleError(_0x4ae56b,_0x20a021){_0x20a021=_0x20a021||0x1f4;return function(_0x5db498){logger[_0xd9ff('0x2a')](_0x5db498[_0xd9ff('0x3b')]);if(_0x5db498[_0xd9ff('0x3c')]){delete _0x5db498['name'];}_0x4ae56b['status'](_0x20a021)['send'](_0x5db498);};}function getMustacheRender(_0x7ac3d1,_0x30fc5b){return Mustache[_0xd9ff('0x3d')](_0x7ac3d1,_[_0xd9ff('0x3e')](_0x30fc5b[_0xd9ff('0x3f')],{'contact':_0x30fc5b[_0xd9ff('0x40')],'message':_0x30fc5b['message'],'agent':_0x30fc5b['agent'],'interaction':_0x30fc5b['interaction'],'account':_0x30fc5b[_0xd9ff('0x41')]}))||'';}function getInteractionUsers(_0x252edc,_0x918c9a){return new BPromise(function(_0x32adae,_0x56b94d){try{if(_0x918c9a[_0x252edc['id']]){_0x252edc[_0xd9ff('0x42')]=_['map'](_0x918c9a[_0x252edc['id']],function(_0x3cff52){return{'id':_0x3cff52['id'],'fullname':_0x3cff52[_0xd9ff('0x43')]};});}}catch(_0x1bedaf){_0x56b94d(_0x1bedaf);}_0x32adae(_0x252edc);});}function getInteractionTags(_0x169dc7,_0x59fc07){return new BPromise(function(_0x1e34da,_0x2d4d97){try{if(_0x169dc7['TagIds']){_0x169dc7[_0xd9ff('0x44')]=[];_0x169dc7[_0xd9ff('0x45')][_0xd9ff('0x46')](',')[_0xd9ff('0x47')](function(_0x1fe44d){_0x169dc7[_0xd9ff('0x44')]['push'](_0x59fc07[_0x1fe44d]);});}delete _0x169dc7[_0xd9ff('0x45')];}catch(_0x116f28){_0x2d4d97(_0x116f28);}_0x1e34da(_0x169dc7);});}function updateChatInteraction(_0x10533a,_0x39fbbb,_0x472724){return new BPromise(function(_0x52aab8,_0x3178cd){return getInteractionUsers(_0x10533a,_0x472724)[_0xd9ff('0x22')](function(_0xe0bc49){return getInteractionTags(_0xe0bc49,_0x39fbbb);})['then'](function(_0x5d06dd){_0x52aab8(_0x5d06dd);})[_0xd9ff('0x2d')](function(_0x7eb1a){_0x3178cd(_0x7eb1a);});});}exports[_0xd9ff('0x48')]=function(_0x2dfb8f,_0x437561){var _0x30c69d={},_0x564ef4={},_0xd64585={'count':0x0,'rows':[]};var _0x2d3013=_['map'](db[_0xd9ff('0x49')][_0xd9ff('0x4a')],function(_0x13a1ec){return{'name':_0x13a1ec[_0xd9ff('0x4b')],'type':_0x13a1ec[_0xd9ff('0x4c')]['key']};});_0x564ef4['model']=_['map'](_0x2d3013,_0xd9ff('0x3c'));_0x564ef4['query']=_[_0xd9ff('0x4d')](_0x2dfb8f[_0xd9ff('0x4e')]);_0x564ef4[_0xd9ff('0x4f')]=_['intersection'](_0x564ef4[_0xd9ff('0x50')],_0x564ef4[_0xd9ff('0x4e')]);_0x30c69d['attributes']=_[_0xd9ff('0x51')](_0x564ef4[_0xd9ff('0x50')],qs[_0xd9ff('0x52')](_0x2dfb8f[_0xd9ff('0x4e')]['fields']));_0x30c69d[_0xd9ff('0x53')]=_0x30c69d['attributes'][_0xd9ff('0x54')]?_0x30c69d['attributes']:_0x564ef4[_0xd9ff('0x50')];if(!_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x55')](_0xd9ff('0x56'))){_0x30c69d[_0xd9ff('0x33')]=qs['limit'](_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x33')]);_0x30c69d[_0xd9ff('0x31')]=qs[_0xd9ff('0x31')](_0x2dfb8f['query']['offset']);}_0x30c69d['order']=qs[_0xd9ff('0x57')](_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x57')]);_0x30c69d['where']=qs[_0xd9ff('0x4f')](_[_0xd9ff('0x58')](_0x2dfb8f[_0xd9ff('0x4e')],_0x564ef4[_0xd9ff('0x4f')]),_0x2d3013);var _0xfede73=[];var _0x40d391=squel[_0xd9ff('0x59')]()[_0xd9ff('0x5a')]('id')[_0xd9ff('0x5a')](_0xd9ff('0x3c'))[_0xd9ff('0x5a')](_0xd9ff('0x5b'))[_0xd9ff('0x5c')]('tools_tags');var _0x3ed112=squel['select']()[_0xd9ff('0x5a')]('u.id')[_0xd9ff('0x5a')]('u.fullname')[_0xd9ff('0x5a')]('ui.ChatInteractionId')[_0xd9ff('0x5c')]('user_has_chat_interactions','ui')[_0xd9ff('0x5d')]('users','u',_0xd9ff('0x5e'));var _0x5da1a8=squel[_0xd9ff('0x59')]()[_0xd9ff('0x5c')](_0xd9ff('0x5f'),'i')[_0xd9ff('0x5d')]('cm_contacts','c',_0xd9ff('0x60'))[_0xd9ff('0x5d')](_0xd9ff('0x61'),'o','o.id\x20=\x20i.UserId')[_0xd9ff('0x5d')](_0xd9ff('0x62'),'a',_0xd9ff('0x63'))[_0xd9ff('0x5d')](_0xd9ff('0x64'),'me','me.ChatInteractionId\x20=\x20i.id')[_0xd9ff('0x5d')](_0xd9ff('0x65'),'it',_0xd9ff('0x66'))[_0xd9ff('0x5d')](_0xd9ff('0x67'),'t',_0xd9ff('0x68'));var _0x458fd4=squel['expr']();var _0x3be850=[];var _0x11251f=squel['expr']();var _0x1c885f;if(_0x2dfb8f[_0xd9ff('0x4e')]['search']){_0x1c885f=as[_0xd9ff('0x69')](_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x6a')]);var _0x54ea27=_0x1c885f['sqlOperator'];for(var _0x39473e=0x0;_0x39473e<_0x1c885f['conditions'][_0xd9ff('0x54')];_0x39473e++){var _0x1e4d0c=_0x1c885f[_0xd9ff('0x6b')][_0x39473e];var _0x102aea='i';var _0x53a230=_['find'](_0x2d3013,['name',_0x1e4d0c[_0xd9ff('0x5a')]]);if(!_0x53a230){switch(_0x1e4d0c[_0xd9ff('0x5a')]){case _0xd9ff('0x6c'):if(_0x1e4d0c[_0xd9ff('0x6d')]==0x1){_0x5da1a8[_0xd9ff('0x6e')]('`'+_0x1e4d0c['field']+_0xd9ff('0x6f'));}else{_0x5da1a8['having']('`'+_0x1e4d0c[_0xd9ff('0x5a')]+_0xd9ff('0x70'));}break;case _0xd9ff('0x71'):if(_0x1e4d0c[_0xd9ff('0x72')]===_0xd9ff('0x73')){if(_0x1e4d0c[_0xd9ff('0x6d')][_0xd9ff('0x46')]('\x20')[_0xd9ff('0x54')]>0x1){_0x458fd4[_0x54ea27]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xd9ff('0x74')](_0x1e4d0c[_0xd9ff('0x6d')]),null);}else{var _0x4f5338='%'+_0x1e4d0c['value']+'%';_0x458fd4[_0x54ea27](_0xd9ff('0x75'),_0x4f5338,_0x4f5338,_0x4f5338);}}else{_0x53a230=_['find'](_0x2d3013,[_0xd9ff('0x3c'),_0xd9ff('0x76')]);_0x1e4d0c['field']=_0xd9ff('0x76');_0x58c9c2=as[_0xd9ff('0x77')](_0x102aea,_0x53a230[_0xd9ff('0x4c')],_0x1e4d0c);_0x458fd4[_0x54ea27](_0x58c9c2[_0xd9ff('0x78')],_0x58c9c2[_0xd9ff('0x6d')]['start'],_0x58c9c2[_0xd9ff('0x6d')]['end']);}break;case'Tag':var _0x3dabb1=_0x1e4d0c[_0xd9ff('0x6d')][_0xd9ff('0x46')](',')[_0xd9ff('0x79')](function(_0x56d822){return Number(_0x56d822);});_0x3dabb1[_0xd9ff('0x47')](function(_0x23b816){_0x11251f['or'](_0xd9ff('0x7a'),'%,'+_0x23b816+',%');});_0x3be850=_[_0xd9ff('0x7b')](_0x3be850,_0x3dabb1);break;case _0xd9ff('0x7c'):if(_0x1e4d0c[_0xd9ff('0x72')]===_0xd9ff('0x73')){_0x458fd4[_0x54ea27](_0xd9ff('0x7d'),'%'+_0x1e4d0c['value']+'%',null);}else{_0x53a230=_['find'](_0x2d3013,['name',_0xd9ff('0x7e')]);_0x1e4d0c[_0xd9ff('0x5a')]='UserId';_0x58c9c2=as[_0xd9ff('0x77')](_0x102aea,_0x53a230[_0xd9ff('0x4c')],_0x1e4d0c);_0x458fd4[_0x54ea27](_0x58c9c2[_0xd9ff('0x78')],_0x58c9c2[_0xd9ff('0x6d')][_0xd9ff('0x7f')],_0x58c9c2[_0xd9ff('0x6d')][_0xd9ff('0x2f')]);}break;case _0xd9ff('0x3f'):_0x58c9c2=as['buildExpression']('me',null,_0x1e4d0c);_0x458fd4[_0x54ea27](_0x58c9c2[_0xd9ff('0x78')],_0x58c9c2[_0xd9ff('0x6d')][_0xd9ff('0x7f')],_0x58c9c2['value'][_0xd9ff('0x2f')]);break;}}else{var _0x58c9c2=as[_0xd9ff('0x77')](_0x102aea,_0x53a230[_0xd9ff('0x4c')],_0x1e4d0c);_0x458fd4[_0x54ea27](_0x58c9c2[_0xd9ff('0x78')],_0x58c9c2['value'][_0xd9ff('0x7f')],_0x58c9c2[_0xd9ff('0x6d')][_0xd9ff('0x2f')]);}}}else{var _0x1cd620=_(_0x2dfb8f['query'])[_0xd9ff('0x4d')]()[_0xd9ff('0x79')](function(_0x1de5c9){return _['some'](_0x2d3013,[_0xd9ff('0x3c'),_0x1de5c9])?_0x1de5c9:undefined;})[_0xd9ff('0x80')]()[_0xd9ff('0x6d')]();if(!_['isEmpty'](_0x1cd620)){_0x1cd620[_0xd9ff('0x47')](function(_0x35926f){if(_0x35926f===_0xd9ff('0x81')){_0x5da1a8[_0xd9ff('0x82')](_0xd9ff('0x83'),[]['concat'](_0x2dfb8f[_0xd9ff('0x4e')][_0x35926f]));}else if(_0x35926f===_0xd9ff('0x84')){var _0x59af0a=JSON[_0xd9ff('0x85')](_0x2dfb8f[_0xd9ff('0x4e')][_0x35926f])[_0xd9ff('0x86')];var _0x5d1973=JSON[_0xd9ff('0x85')](_0x2dfb8f['query'][_0x35926f])[_0xd9ff('0x87')];_0x5da1a8['where'](_0xd9ff('0x88'),_0x59af0a,_0x5d1973);}else{if(_0x2dfb8f[_0xd9ff('0x4e')][_0x35926f]===_0xd9ff('0x89')){_0x5da1a8[_0xd9ff('0x82')]('i.'+_0x35926f+_0xd9ff('0x8a'));}else{_0x5da1a8[_0xd9ff('0x82')]('i.'+_0x35926f+_0xd9ff('0x8b'),_0x2dfb8f[_0xd9ff('0x4e')][_0x35926f]);}}});}if(_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x8c')]){if(_0x2dfb8f['query'][_0xd9ff('0x8c')]==0x1){_0x5da1a8[_0xd9ff('0x6e')](_0xd9ff('0x8d'));}else{_0x5da1a8[_0xd9ff('0x6e')](_0xd9ff('0x8e'));}}if(_0x2dfb8f[_0xd9ff('0x4e')]['tag']){_0x3be850=_['isArray'](_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x8f')])?_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x8f')]:new Array(_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x8f')]);_0x3be850['forEach'](function(_0x1d34a1){_0x11251f['or'](_0xd9ff('0x7a'),'%,'+_0x1d34a1+',%');});}if(_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x90')]){var _0x14c89f=_0x2dfb8f[_0xd9ff('0x4e')]['filter'][_0xd9ff('0x91')]('\x5c','\x5c\x5c')[_0xd9ff('0x91')](/'/g,'\x27\x27');if(qs[_0xd9ff('0x92')](_0x14c89f)){_0x458fd4['or'](_0xd9ff('0x93'),_0x14c89f+'%');}else{_0x458fd4['or'](_0xd9ff('0x94'),qs[_0xd9ff('0x74')](_0x14c89f))['or'](_0xd9ff('0x95'),_0x14c89f+'%');}}}_0x5da1a8[_0xd9ff('0x82')](_0x458fd4);_0x5da1a8['group'](_0xd9ff('0x96'));var _0x4c2ad5={'type':db[_0xd9ff('0x97')][_0xd9ff('0x98')][_0xd9ff('0x99')],'raw':!![]};var _0x2d2d1c=_0x5da1a8[_0xd9ff('0x9a')]();_0x2d2d1c[_0xd9ff('0x5a')](_0xd9ff('0x96'));_0x2d2d1c[_0xd9ff('0x5a')](_0xd9ff('0x9b'),_0xd9ff('0x6c'));if(_0x30c69d[_0xd9ff('0x9c')]){_0x30c69d[_0xd9ff('0x9c')][_0xd9ff('0x47')](function(_0x5d29b9){var _0x4413c4=_0x5d29b9[0x0]===_0xd9ff('0x9d')?_0x5d29b9[0x0]:'i.'+_0x5d29b9[0x0];_0x5da1a8[_0xd9ff('0x9c')](_0x4413c4,_0x5d29b9[0x1]===_0xd9ff('0x9e')?![]:!![]);});}if(!_['isEmpty'](_0x3be850)){_0x5da1a8[_0xd9ff('0x6e')](_0x11251f);_0x2d2d1c[_0xd9ff('0x82')]('t.id\x20IN\x20?',_0x3be850);}BPromise[_0xd9ff('0x9f')]()[_0xd9ff('0x22')](function(){if(!_0x1c885f){if(_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x81')])return;_0x2d2d1c[_0xd9ff('0x82')](_0xd9ff('0xa0'));_0x5da1a8[_0xd9ff('0x82')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');return;}if(_0x2dfb8f[_0xd9ff('0xa1')]['role']!==_0xd9ff('0xa2'))return;return _0x2dfb8f[_0xd9ff('0xa1')][_0xd9ff('0xa3')]({'attributes':['id'],'raw':!![]})[_0xd9ff('0x22')](function(_0x320adb){if(_[_0xd9ff('0xa4')](_0x320adb)){_0x2d2d1c[_0xd9ff('0x82')](_0xd9ff('0xa5'));_0x5da1a8[_0xd9ff('0x82')](_0xd9ff('0xa5'));}else{_0x2d2d1c[_0xd9ff('0x82')]('i.ChatWebsiteId\x20IN\x20?',_[_0xd9ff('0x79')](_0x320adb,'id'));_0x5da1a8[_0xd9ff('0x82')]('i.ChatWebsiteId\x20IN\x20?',_[_0xd9ff('0x79')](_0x320adb,'id'));}});})[_0xd9ff('0x22')](function(){if(_0x2dfb8f[_0xd9ff('0xa1')][_0xd9ff('0xa6')]===_0xd9ff('0xa2')&&!_0x1c885f&&!_0x2dfb8f[_0xd9ff('0x4e')]['ChatWebsiteId'])return[];return db['sequelize'][_0xd9ff('0x4e')](_0x2d2d1c['toString'](),_0x4c2ad5);})['then'](function(_0x4a55c1){_0xd64585['count']=_0x4a55c1[_0xd9ff('0x54')];if(_0xd64585[_0xd9ff('0x34')]===0x0)return[];return db[_0xd9ff('0xa7')]['query'](_0x40d391['toString'](),_0x4c2ad5)[_0xd9ff('0x22')](function(_0x5e7f52){_0xfede73=_[_0xd9ff('0xa8')](_0x5e7f52,'id');_0x4c2ad5=_['merge'](_0x4c2ad5,{'model':db[_0xd9ff('0x49')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x52')]){_0x30c69d[_0xd9ff('0x53')][_0xd9ff('0x47')](function(_0x4e6dd2){_0x5da1a8['field']('i.'+_0x4e6dd2);});}else{_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0x9b'),_0xd9ff('0x6c'));_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xa9'),'Account.key');_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xaa'),_0xd9ff('0xab'));_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xac'),_0xd9ff('0x9d'));_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xad'));_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xae'),_0xd9ff('0xaf'));_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xb0'),'Contact.lastName');_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xb1'),'Contact.email');_0x5da1a8['field'](_0xd9ff('0xb2'),_0xd9ff('0xb3'));_0x5da1a8['field'](_0xd9ff('0xb4'),_0xd9ff('0xb5'));_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xb6'),_0xd9ff('0xb7'));_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xb8'),_0xd9ff('0xb9'));_0x5da1a8['field']('o.internal','Owner.internal');_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xba'),_0xd9ff('0x45'));}if(_0x30c69d['limit'])_0x5da1a8[_0xd9ff('0x33')](_0x30c69d[_0xd9ff('0x33')]);if(_0x30c69d[_0xd9ff('0x31')])_0x5da1a8[_0xd9ff('0x31')](_0x30c69d[_0xd9ff('0x31')]);return db[_0xd9ff('0xa7')]['query'](_0x5da1a8[_0xd9ff('0xbb')](),_0x4c2ad5);})['then'](function(_0x5cb3af){if(_0x5cb3af[_0xd9ff('0x54')]>0x0)_0x3ed112[_0xd9ff('0x82')](_0xd9ff('0xbc'),_['map'](_0x5cb3af,'id'));return db[_0xd9ff('0xa7')][_0xd9ff('0x4e')](_0x3ed112['toString'](),_0x4c2ad5)['then'](function(_0x4aa6d5){var _0x11840a=_[_0xd9ff('0xbd')](_0x4aa6d5,'ChatInteractionId');var _0x2871ec=[];_0x5cb3af[_0xd9ff('0x47')](function(_0x16e130){_0x2871ec['push'](updateChatInteraction(_0x16e130,_0xfede73,_0x11840a));});return BPromise['all'](_0x2871ec);});});})['then'](function(_0xdf2e33){_0xd64585['rows']=_0xdf2e33;return _0xd64585;})[_0xd9ff('0x22')](respondWithFilteredResult(_0x437561,_0x30c69d))[_0xd9ff('0x2d')](handleError(_0x437561,null));};exports['show']=function(_0x1b048b,_0x5eeeaf){var _0x3339e5={'raw':![],'where':{'id':_0x1b048b[_0xd9ff('0xbe')]['id']}},_0x1f7d87={};_0x1f7d87['model']=_[_0xd9ff('0x4d')](db['ChatInteraction']['rawAttributes']);_0x1f7d87['query']=_[_0xd9ff('0x4d')](_0x1b048b[_0xd9ff('0x4e')]);_0x1f7d87[_0xd9ff('0x4f')]=_[_0xd9ff('0x51')](_0x1f7d87['model'],_0x1f7d87['query']);_0x3339e5[_0xd9ff('0x53')]=_[_0xd9ff('0x51')](_0x1f7d87[_0xd9ff('0x50')],qs[_0xd9ff('0x52')](_0x1b048b[_0xd9ff('0x4e')]['fields']));_0x3339e5['attributes']=_0x3339e5[_0xd9ff('0x53')][_0xd9ff('0x54')]?_0x3339e5[_0xd9ff('0x53')]:_0x1f7d87[_0xd9ff('0x50')];if(_0x1b048b[_0xd9ff('0x4e')][_0xd9ff('0xbf')]){_0x3339e5['include']=[{'all':!![]}];}_0x3339e5=_[_0xd9ff('0x3e')]({},_0x3339e5,_0x1b048b['options']);return db['ChatInteraction'][_0xd9ff('0xc0')](_0x3339e5)[_0xd9ff('0x22')](handleEntityNotFound(_0x5eeeaf,null))[_0xd9ff('0x22')](respondWithResult(_0x5eeeaf,null))[_0xd9ff('0x2d')](handleError(_0x5eeeaf,null));};exports['create']=function(_0x4e3fdd,_0x2cf8da){return db['ChatInteraction']['create'](_0x4e3fdd[_0xd9ff('0x3f')],{})['then'](respondWithResult(_0x2cf8da,0xc9))[_0xd9ff('0x2d')](handleError(_0x2cf8da,null));};exports['update']=function(_0x327cd8,_0xd95329){if(_0x327cd8[_0xd9ff('0x3f')]['id']){delete _0x327cd8[_0xd9ff('0x3f')]['id'];}return db[_0xd9ff('0x49')][_0xd9ff('0xc0')]({'where':{'id':_0x327cd8[_0xd9ff('0xbe')]['id']}})['then'](handleEntityNotFound(_0xd95329,null))[_0xd9ff('0x22')](saveUpdates(_0x327cd8['body'],null))['then'](respondWithResult(_0xd95329,null))[_0xd9ff('0x2d')](handleError(_0xd95329,null));};exports[_0xd9ff('0xc1')]=function(_0x499869,_0x3c86ac){return db['ChatInteraction']['find']({'where':{'id':_0x499869[_0xd9ff('0xbe')]['id']}})[_0xd9ff('0x22')](handleEntityNotFound(_0x3c86ac,null))[_0xd9ff('0x22')](removeEntity(_0x3c86ac,null))[_0xd9ff('0x2d')](handleError(_0x3c86ac,null));};exports[_0xd9ff('0xc2')]=function(_0x11c84f,_0x2d0261){return db[_0xd9ff('0x49')][_0xd9ff('0xc2')]()[_0xd9ff('0x22')](respondWithResult(_0x2d0261,null))[_0xd9ff('0x2d')](handleError(_0x2d0261,null));};exports[_0xd9ff('0xc3')]=function(_0x73cfcf,_0x538f20){var _0x51feff=_0x73cfcf['params']['id'];var _0x30c62c;var _0x50b6b2;var _0x413aef;return db[_0xd9ff('0x49')][_0xd9ff('0xc4')]({'where':{'id':_0x51feff}})[_0xd9ff('0x22')](function(_0x54c390){_0x30c62c=_0x54c390;return db[_0xd9ff('0xc5')]['findOne']({'where':{'id':_0x54c390[_0xd9ff('0x81')]},'attributes':['id','vidaooApiKey','vidaooEscalation','vidaooTopic',_0xd9ff('0xc6'),'vidaooMetadata'],'raw':!![]});})[_0xd9ff('0x22')](function(_0x54524c){if(_0x54524c&&_0x54524c[_0xd9ff('0xc7')]&&_0x54524c[_0xd9ff('0xc8')]){_0x50b6b2=_0x54524c;var _0x696e18={'interaction':{'id':_0x51feff},'agent':{'id':_0x73cfcf[_0xd9ff('0xa1')]['id'],'name':_0x73cfcf[_0xd9ff('0xa1')][_0xd9ff('0x3c')],'fullname':_0x73cfcf['user']['fullname'],'email':_0x73cfcf[_0xd9ff('0xa1')][_0xd9ff('0xc9')]},'contact':_0x73cfcf[_0xd9ff('0x3f')][_0xd9ff('0x40')],'account':_0x73cfcf[_0xd9ff('0x3f')]['account']};var _0x432854={'rejectUnauthorized':![],'method':_0xd9ff('0xca'),'url':_0xd9ff('0xcb'),'headers':{'X-APIKEY':_0x54524c[_0xd9ff('0xc7')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x73cfcf[_0xd9ff('0xa1')][_0xd9ff('0xc9')]],'buttons':null,'topic':_0x50b6b2['vidaooTopic'],'note':_[_0xd9ff('0xcc')](_0x50b6b2[_0xd9ff('0xc6')])?null:getMustacheRender(_0x50b6b2[_0xd9ff('0xc6')],_0x696e18),'metadata':null},'redirect':_0xd9ff('0xcd'),'json':!![]};try{if(!_[_0xd9ff('0xcc')](_0x50b6b2[_0xd9ff('0xce')])){var _0x1c8e55=getMustacheRender(_0x50b6b2[_0xd9ff('0xce')],_0x696e18);var _0x29fdb8=JSON[_0xd9ff('0x85')](_0x1c8e55);_0x432854[_0xd9ff('0x3f')][_0xd9ff('0xcf')]=_0x29fdb8;}}catch(_0xfc755a){throw new db[(_0xd9ff('0x97'))][(_0xd9ff('0xd0'))](_0xd9ff('0xd1'));}return rp(_0x432854);}else{throw new db[(_0xd9ff('0x97'))][(_0xd9ff('0xd0'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0xd9ff('0x22')](function(_0x282183){_0x413aef=_0x282183;if(_0x413aef['id']){var _0x3aba00={'body':_0x413aef[_0xd9ff('0xd2')],'ChatWebsiteId':_0x50b6b2['id'],'ChatInteractionId':_0x30c62c['id'],'direction':_0xd9ff('0xd3'),'UserId':_0x73cfcf[_0xd9ff('0xa1')]['id']};return db[_0xd9ff('0xd4')][_0xd9ff('0xd5')](_0x3aba00,{});}else{throw new db['Sequelize'][(_0xd9ff('0xd0'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0xd9ff('0x22')](function(){return _0x30c62c[_0xd9ff('0xd6')]({'vidaooSessionId':_0x413aef['id']});})[_0xd9ff('0x22')](respondWithResult(_0x538f20,null))[_0xd9ff('0x2d')](handleError(_0x538f20,null));};exports[_0xd9ff('0xd7')]=function(_0x204127,_0xf98666){if(_0x204127['body']['id']){delete _0x204127[_0xd9ff('0x3f')]['id'];}return db[_0xd9ff('0x49')][_0xd9ff('0xc0')]({'where':{'id':_0x204127[_0xd9ff('0xbe')]['id']},'include':[{'model':db['CmContact'],'as':_0xd9ff('0x71')}]})[_0xd9ff('0x22')](handleEntityNotFound(_0xf98666,null))['then'](saveUpdates(_0x204127[_0xd9ff('0x3f')],null))[_0xd9ff('0x22')](respondWithResult(_0xf98666,null))['catch'](handleError(_0xf98666,null));};exports['abandon']=function(_0x5c4138,_0x560ea2,_0x1e6d5a){if(_0x5c4138[_0xd9ff('0x3f')]['id']){delete _0x5c4138[_0xd9ff('0x3f')]['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x5c4138[_0xd9ff('0xbe')]['id']}})['then'](function(_0x43a941){if(!_0x43a941){logger[_0xd9ff('0x2a')](_0xd9ff('0xd8'),'abandon',0x194,'entity\x20not\x20found');_0x560ea2['sendStatus'](0x194);}else{if(_0x43a941[_0xd9ff('0x7e')]){throw new db[(_0xd9ff('0x97'))]['ValidationError'](_0xd9ff('0xd9'));}}return _0x43a941;})[_0xd9ff('0x22')](function(_0x7efe12){if(_0x7efe12){return _0x7efe12[_0xd9ff('0x3a')]({'closed':_0x5c4138[_0xd9ff('0x3f')][_0xd9ff('0xda')],'disposition':_0x5c4138[_0xd9ff('0x3f')][_0xd9ff('0xdb')]})[_0xd9ff('0x22')](function(_0x3b7aeb){return _0x3b7aeb;});}})[_0xd9ff('0x22')](function(_0x37eb49){return respondWithRpcPromise(_0xd9ff('0xdc'),_0xd9ff('0xdd'),_0x5c4138[_0xd9ff('0x3f')],client9004);})[_0xd9ff('0x22')](respondWithResult(_0x560ea2,null))[_0xd9ff('0x2d')](handleError(_0x560ea2,null));};exports[_0xd9ff('0xde')]=function(_0x3b05c4,_0x32c04e,_0x1bcf8f){_0x3b05c4[_0xd9ff('0x3f')][_0xd9ff('0x3c')]=_0x3b05c4[_0xd9ff('0xdf')][_0xd9ff('0xe0')];_0x3b05c4[_0xd9ff('0x3f')][_0xd9ff('0xe1')]=_0x3b05c4[_0xd9ff('0xdf')][_0xd9ff('0xe2')];_0x3b05c4['body'][_0xd9ff('0x4c')]=_0x3b05c4[_0xd9ff('0xdf')]['mimetype'];return db[_0xd9ff('0xe3')][_0xd9ff('0xd5')](_0x3b05c4[_0xd9ff('0x3f')])[_0xd9ff('0x22')](respondWithResult(_0x32c04e,0xc9))[_0xd9ff('0x2d')](handleError(_0x32c04e,null));};exports[_0xd9ff('0xe4')]=function(_0x5978ad,_0x4ddfe7,_0x30c520){return db['ChatInteraction']['findOne']({'where':{'id':_0x5978ad[_0xd9ff('0xbe')]['id']},'raw':!![]})[_0xd9ff('0x22')](handleEntityNotFound(_0x4ddfe7,null))['then'](function(_0x327362){if(_0x327362){if(_0x327362[_0xd9ff('0xda')]){return _0x4ddfe7[_0xd9ff('0x35')](0x193)[_0xd9ff('0x30')]({'status':0x193,'message':'Unauthorized'});}return db[_0xd9ff('0xe3')][_0xd9ff('0xc4')]({'where':{'id':_0x5978ad['query'][_0xd9ff('0xe5')]},'raw':!![]})[_0xd9ff('0x22')](handleEntityNotFound(_0x4ddfe7,null));}})['then'](function(_0x62f1f3){if(_0x62f1f3){var _0xd188cf=_0x62f1f3[_0xd9ff('0xe6')]!==null;var _0x5b2e9c=path[_0xd9ff('0xe7')](config[_0xd9ff('0xe8')],_0xd9ff('0xe9'));if(_0xd188cf){_0x5b2e9c=path['join'](_0x5b2e9c,_0xd9ff('0xea'));}var _0x53a25a=path[_0xd9ff('0xe7')](_0x5b2e9c,_0x62f1f3[_0xd9ff('0xe1')]);return _0x4ddfe7[_0xd9ff('0xeb')](_0x53a25a);}})[_0xd9ff('0x2d')](handleError(_0x4ddfe7,null));};exports[_0xd9ff('0xec')]=function(_0x10397d,_0x51039f){var _0x37ea50=null;var _0x3cf2ef=null;var _0x171195=null;var _0x24c066=null;if(_0x10397d[_0xd9ff('0x3f')]['id']){delete _0x10397d['body']['id'];}if(_0x10397d[_0xd9ff('0x3f')][_0xd9ff('0xed')]){_0x24c066=path['join'](config[_0xd9ff('0xe8')],_0xd9ff('0xee'),util[_0xd9ff('0xef')](_0xd9ff('0xf0'),Date[_0xd9ff('0xf1')]()));_0x10397d[_0xd9ff('0x3f')][_0xd9ff('0xf2')]=_0x24c066;}return db[_0xd9ff('0x49')][_0xd9ff('0xc0')]({'where':{'id':_0x10397d[_0xd9ff('0xbe')]['id']},'include':[{'model':db[_0xd9ff('0xd4')],'as':_0xd9ff('0xf3'),'include':[{'model':db[_0xd9ff('0x7c')],'as':_0xd9ff('0x7c')}]}]})[_0xd9ff('0x22')](handleEntityNotFound(_0x51039f,null))[_0xd9ff('0x22')](saveUpdates(_0x10397d['body'],null))['then'](function(_0x497e36){if(_0x497e36){_0x37ea50=_0x497e36;return db[_0xd9ff('0xc5')]['find']({'where':{'id':_0x37ea50[_0xd9ff('0x81')]}});}})['then'](function(_0x4d4cc0){if(_0x4d4cc0){_0x171195=_0x4d4cc0;return db['CmContact'][_0xd9ff('0xc0')]({'where':{'id':_0x37ea50['ContactId']}});}})['then'](function(_0x474b4c){if(_0x474b4c){_0x3cf2ef=_0x474b4c;if(_0x24c066){var _0x144cf7=null;for(var _0x9eac7f=0x1;_0x9eac7f<_0x37ea50[_0xd9ff('0xf3')][_0xd9ff('0x54')];++_0x9eac7f){_0x144cf7=_0x37ea50[_0xd9ff('0xf3')][_0x9eac7f];var _0x2450da=_0x144cf7[_0xd9ff('0x7e')]?util[_0xd9ff('0xef')](_0xd9ff('0xf4'),_0x171195[_0xd9ff('0xf5')],_0x144cf7[_0xd9ff('0x7e')]):_0xd9ff('0xf6');var _0x4531bc=_0x10397d['body']['customer']||util[_0xd9ff('0xef')](_0xd9ff('0xf4'),_0xd9ff('0xf7'),_0x144cf7[_0xd9ff('0x76')]);switch(_0x171195[_0xd9ff('0xf8')]){case _0xd9ff('0xf9'):_0x2450da=_0x144cf7[_0xd9ff('0x7e')]?util[_0xd9ff('0xef')]('%s%d',_0x171195[_0xd9ff('0xf5')],_0x144cf7[_0xd9ff('0x7e')]):_0xd9ff('0xf6');break;case _0xd9ff('0xfa'):_0x2450da=_0x144cf7['UserId']?_0x144cf7['User'][_0xd9ff('0xfb')]||_0x144cf7[_0xd9ff('0x7c')]['fullname']:_0xd9ff('0xf6');break;case _0xd9ff('0xfc'):_0x2450da=_0x144cf7['UserId']?_0x144cf7[_0xd9ff('0x7c')][_0xd9ff('0x43')]:_0xd9ff('0xf6');break;default:_0x2450da=_0x144cf7[_0xd9ff('0x7e')]?util[_0xd9ff('0xef')](_0xd9ff('0xf4'),_0x171195[_0xd9ff('0xf5')],_0x144cf7['UserId']):_0xd9ff('0xf6');}var _0x62b518=util[_0xd9ff('0xef')](_0xd9ff('0xfd'),moment(_0x144cf7[_0xd9ff('0x84')])['format'](_0xd9ff('0xfe')),_0x144cf7[_0xd9ff('0xff')]==='in'?_0x4531bc:_0x2450da,_0x144cf7[_0xd9ff('0x3f')]);if(!_0x144cf7['secret']){fs[_0xd9ff('0x100')](_0x24c066,_0x62b518);}}return db[_0xd9ff('0x101')][_0xd9ff('0xc4')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0xd9ff('0x102'),'raw':!![]}]});}}})['then'](function(_0x5e07ae){if(_0x5e07ae&&_0x5e07ae['Smtp']&&_0x10397d['body']){var _0x578f41={'tls':{'rejectUnauthorized':![]}};if(_0x5e07ae[_0xd9ff('0x102')][_0xd9ff('0x103')]){_0x578f41['service']=_0x5e07ae[_0xd9ff('0x102')][_0xd9ff('0x103')];}else{_0x578f41[_0xd9ff('0x104')]=_0x5e07ae['Smtp'][_0xd9ff('0x104')];_0x578f41['port']=_0x5e07ae['Smtp'][_0xd9ff('0x105')];_0x578f41[_0xd9ff('0x106')]=_0x5e07ae[_0xd9ff('0x102')]['secure'];}if(_0x5e07ae['Smtp'][_0xd9ff('0x107')]){_0x578f41[_0xd9ff('0x108')]={'user':_0x5e07ae['Smtp'][_0xd9ff('0xa1')],'pass':_0x5e07ae[_0xd9ff('0x102')][_0xd9ff('0x109')]};}return respondWithRpcPromise(_0xd9ff('0x10a'),_0xd9ff('0x10b'),{'account':_0x578f41,'message':{'from':util[_0xd9ff('0xef')](_0xd9ff('0x10c'),_0x5e07ae['name'],_0x5e07ae[_0xd9ff('0xc9')]||_0x5e07ae[_0xd9ff('0x102')]['user']),'to':_0x10397d[_0xd9ff('0x3f')][_0xd9ff('0xed')],'subject':'Mail\x20Transcript','text':util[_0xd9ff('0xef')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x10397d[_0xd9ff('0x3f')][_0xd9ff('0xed')]),'attachments':[{'path':_0x24c066}]}})['then'](function(){return _0x37ea50;})[_0xd9ff('0x2d')](function(_0x4d6172){console[_0xd9ff('0x2a')](_0x4d6172);});}else{return _0x37ea50;}})[_0xd9ff('0x22')](respondWithStatusCode(_0x51039f,0xc8))[_0xd9ff('0x2d')](handleError(_0x51039f,null));};exports[_0xd9ff('0x10d')]=function(_0x6a2524,_0x356583,_0x5c1165){return db['ChatMessage'][_0xd9ff('0xc0')]({'where':{'id':_0x6a2524['params']['id']}})[_0xd9ff('0x22')](handleEntityNotFound(_0x356583,null))[_0xd9ff('0x22')](function(_0x599273){if(_0x599273){return _0x599273['addMessage'](_0x6a2524['body'][_0xd9ff('0x10e')],_[_0xd9ff('0x10f')](_0x6a2524[_0xd9ff('0x3f')],['ids','id'])||{});}})[_0xd9ff('0x22')](respondWithResult(_0x356583,null))[_0xd9ff('0x2d')](handleError(_0x356583,null));};exports[_0xd9ff('0x110')]=function(_0x2832b7,_0x618c47,_0x109140){var _0x278670={'raw':![],'where':{}};var _0x5e064d={};var _0x231b46={'count':0x0,'rows':[]};return db[_0xd9ff('0x49')][_0xd9ff('0xc4')]({'where':{'id':_0x2832b7[_0xd9ff('0xbe')]['id']}})[_0xd9ff('0x22')](handleEntityNotFound(_0x618c47,null))[_0xd9ff('0x22')](function(_0x1802b1){if(_0x1802b1){_0x5e064d[_0xd9ff('0x50')]=_[_0xd9ff('0x4d')](db[_0xd9ff('0xd4')][_0xd9ff('0x4a')]);_0x5e064d['query']=_['keys'](_0x2832b7[_0xd9ff('0x4e')]);_0x5e064d['filters']=_['intersection'](_0x5e064d[_0xd9ff('0x50')],_0x5e064d[_0xd9ff('0x4e')]);_0x278670[_0xd9ff('0x53')]=_[_0xd9ff('0x51')](_0x5e064d[_0xd9ff('0x50')],qs['fields'](_0x2832b7[_0xd9ff('0x4e')]['fields']));_0x278670[_0xd9ff('0x53')]=_0x278670[_0xd9ff('0x53')]['length']?_0x278670[_0xd9ff('0x53')]:_0x5e064d[_0xd9ff('0x50')];if(!_0x2832b7[_0xd9ff('0x4e')][_0xd9ff('0x55')](_0xd9ff('0x56'))){_0x278670[_0xd9ff('0x33')]=qs[_0xd9ff('0x33')](_0x2832b7['query'][_0xd9ff('0x33')]);_0x278670[_0xd9ff('0x31')]=qs[_0xd9ff('0x31')](_0x2832b7[_0xd9ff('0x4e')][_0xd9ff('0x31')]);}_0x278670[_0xd9ff('0x9c')]=qs['sort'](_0x2832b7[_0xd9ff('0x4e')][_0xd9ff('0x57')]);_0x278670[_0xd9ff('0x82')]=qs['filters'](_[_0xd9ff('0x58')](_0x2832b7['query'],_0x5e064d[_0xd9ff('0x4f')]));_0x278670['where'][_0xd9ff('0x111')]=_0x1802b1['id'];if(_0x2832b7[_0xd9ff('0x4e')][_0xd9ff('0x90')]){_0x278670['where']=_[_0xd9ff('0x3e')](_0x278670['where'],{'$or':_[_0xd9ff('0x79')](_0x278670[_0xd9ff('0x53')],function(_0x2b2a50){var _0x34f3f0={};_0x34f3f0[_0x2b2a50]={'$like':'%'+_0x2832b7[_0xd9ff('0x4e')]['filter']+'%'};return _0x34f3f0;})});}if(_0x2832b7[_0xd9ff('0x4e')][_0xd9ff('0x86')]){var _0x955328=_0x2832b7[_0xd9ff('0x4e')][_0xd9ff('0x86')][_0xd9ff('0x46')](',');var _0x5d95b1={};_0x5d95b1[_0x955328[0x0]]={'$gte':moment(_0x955328[0x1])['format'](_0xd9ff('0x112'))};_0x278670[_0xd9ff('0x82')]=_[_0xd9ff('0x3e')](_0x278670[_0xd9ff('0x82')],_0x5d95b1);}_0x278670=_[_0xd9ff('0x3e')]({},_0x278670,_0x2832b7[_0xd9ff('0x113')]);return db[_0xd9ff('0xd4')]['count']({'where':_0x278670[_0xd9ff('0x82')]})[_0xd9ff('0x22')](function(_0x3e90fe){_0x231b46[_0xd9ff('0x34')]=_0x3e90fe;if(_0x2832b7[_0xd9ff('0x4e')][_0xd9ff('0xbf')]){_0x278670['include']=[{'all':!![]}];}return db[_0xd9ff('0xd4')][_0xd9ff('0x114')](_0x278670);})[_0xd9ff('0x22')](function(_0x33f933){_0x231b46[_0xd9ff('0x115')]=_0x33f933;return _0x231b46;});}})[_0xd9ff('0x22')](respondWithFilteredResult(_0x618c47,_0x278670))['catch'](handleError(_0x618c47,null));};exports['getMyMessages']=function(_0xf3a93b,_0x473ecf,_0x1213a4){var _0x6f731a={'where':{}},_0x193c57={},_0x4572b2={'count':0x0,'rows':[]};return db[_0xd9ff('0x49')][_0xd9ff('0xc4')]({'where':{'id':_0xf3a93b['params']['id']}})[_0xd9ff('0x22')](handleEntityNotFound(_0x473ecf,null))[_0xd9ff('0x22')](function(_0x4115a3){if(_0x4115a3){_0x193c57[_0xd9ff('0x50')]=_[_0xd9ff('0x4d')](db[_0xd9ff('0xd4')]['rawAttributes']);_0x193c57[_0xd9ff('0x4e')]=_['keys'](_0xf3a93b['query']);_0x193c57[_0xd9ff('0x4f')]=_[_0xd9ff('0x51')](_0x193c57[_0xd9ff('0x50')],_0x193c57[_0xd9ff('0x4e')]);_0x6f731a[_0xd9ff('0x53')]=_[_0xd9ff('0x51')](_0x193c57[_0xd9ff('0x50')],qs[_0xd9ff('0x52')](_0xf3a93b['query'][_0xd9ff('0x52')]));_0x6f731a['attributes']=_0x6f731a[_0xd9ff('0x53')][_0xd9ff('0x54')]?_0x6f731a[_0xd9ff('0x53')]:_0x193c57[_0xd9ff('0x50')];if(!_0xf3a93b['query'][_0xd9ff('0x55')](_0xd9ff('0x56'))){_0x6f731a[_0xd9ff('0x33')]=qs[_0xd9ff('0x33')](_0xf3a93b[_0xd9ff('0x4e')][_0xd9ff('0x33')]);_0x6f731a[_0xd9ff('0x31')]=qs[_0xd9ff('0x31')](_0xf3a93b[_0xd9ff('0x4e')]['offset']);}_0x6f731a[_0xd9ff('0x9c')]=qs['sort'](_0xf3a93b['query'][_0xd9ff('0x57')]);_0x6f731a[_0xd9ff('0x82')]=qs[_0xd9ff('0x4f')](_[_0xd9ff('0x58')](_0xf3a93b[_0xd9ff('0x4e')],_0x193c57[_0xd9ff('0x4f')]));_0x6f731a[_0xd9ff('0x82')][_0xd9ff('0x111')]=_0x4115a3['id'];if(_0xf3a93b[_0xd9ff('0x4e')][_0xd9ff('0x90')]){_0x6f731a[_0xd9ff('0x82')]=_[_0xd9ff('0x3e')](_0x6f731a['where'],{'$or':_[_0xd9ff('0x79')](_0x6f731a['attributes'],function(_0x1bb980){var _0x3ccf5d={};_0x3ccf5d[_0x1bb980]={'$like':'%'+_0xf3a93b['query']['filter']+'%'};return _0x3ccf5d;})});}_0x6f731a[_0xd9ff('0x82')][_0xd9ff('0x116')]=![];if(_0xf3a93b['query']['id']){_0x6f731a[_0xd9ff('0x82')]['id']={'$gt':_0xf3a93b[_0xd9ff('0x4e')]['id']};}_0x6f731a=_['merge']({},_0x6f731a,_0xf3a93b[_0xd9ff('0x113')]);return db['ChatMessage'][_0xd9ff('0x34')]({'where':_0x6f731a[_0xd9ff('0x82')]})[_0xd9ff('0x22')](function(_0x42d9ff){_0x4572b2[_0xd9ff('0x34')]=_0x42d9ff;_0x6f731a[_0xd9ff('0x117')]=[];if(_0xf3a93b[_0xd9ff('0x4e')][_0xd9ff('0x118')]){_0x6f731a[_0xd9ff('0x117')][_0xd9ff('0x119')]({'model':db[_0xd9ff('0x7c')],'as':_0xd9ff('0x7c'),'attributes':['id',_0xd9ff('0x43'),_0xd9ff('0xfb')]});}if(_0xf3a93b['query'][_0xd9ff('0xbf')]){_0x6f731a[_0xd9ff('0x117')]=[{'all':!![]}];}return db[_0xd9ff('0xd4')][_0xd9ff('0x114')](_0x6f731a);})[_0xd9ff('0x22')](function(_0x314f18){_0x4572b2['rows']=_0x314f18;return _0x4572b2;});}})['then'](respondWithFilteredResult(_0x473ecf,_0x6f731a))['catch'](handleError(_0x473ecf,null));};exports['addTags']=function(_0x4699d3,_0x2e91a8,_0x4956b2){return db[_0xd9ff('0x49')][_0xd9ff('0xc0')]({'where':{'id':_0x4699d3[_0xd9ff('0xbe')]['id']}})['then'](handleEntityNotFound(_0x2e91a8,null))['then'](function(_0x217023){if(_0x217023){return _0x217023[_0xd9ff('0x11a')](_0x4699d3['body']['ids'],_['omit'](_0x4699d3['body'],['ids','id'])||{})[_0xd9ff('0x11b')](function(){return db[_0xd9ff('0x11c')][_0xd9ff('0x114')]({'attributes':['id',_0xd9ff('0x3c'),_0xd9ff('0x5b')],'where':{'id':_0x4699d3[_0xd9ff('0x3f')][_0xd9ff('0x10e')]}});})[_0xd9ff('0x22')](function(_0x317f93){socket[_0xd9ff('0x11d')](_0xd9ff('0x11e'),{'id':Number(_0x4699d3[_0xd9ff('0xbe')]['id']),'tags':_0x317f93||[]});return{'id':Number(_0x4699d3[_0xd9ff('0xbe')]['id']),'tags':_0x317f93||[]};});}})[_0xd9ff('0x22')](respondWithResult(_0x2e91a8,null))[_0xd9ff('0x2d')](handleError(_0x2e91a8,null));};exports[_0xd9ff('0x11f')]=function(_0x404baf,_0x5d73cd,_0xdb719b){return db['ChatInteraction'][_0xd9ff('0xc0')]({'where':{'id':_0x404baf['params']['id']}})[_0xd9ff('0x22')](handleEntityNotFound(_0x5d73cd,null))[_0xd9ff('0x22')](function(_0x10935d){if(_0x10935d){return _0x10935d['removeTags'](_0x404baf['query']['ids']);}})['then'](respondWithStatusCode(_0x5d73cd,null))['catch'](handleError(_0x5d73cd,null));};exports[_0xd9ff('0xeb')]=function(_0x2031e9,_0x3b50d9){var _0x410fae=moment()[_0xd9ff('0x120')]()[_0xd9ff('0xbb')]();var _0x494da6=path[_0xd9ff('0xe7')](config[_0xd9ff('0xe8')],'server','files',_0xd9ff('0x121'));var _0x49c9cc=path[_0xd9ff('0xe7')](config['root'],_0xd9ff('0x122'),_0xd9ff('0x123'),'attachments');var _0x378746=path[_0xd9ff('0xe7')](_0x494da6,_0x410fae);var _0x2acbe3=util[_0xd9ff('0xef')]('transcript-%d-%s.zip',_0x2031e9['params']['id'],_0x410fae);var _0x46d12c=path[_0xd9ff('0xe7')](_0x494da6,_0x2acbe3);var _0x54f4aa=[];_0x54f4aa[_0xd9ff('0x119')]({'model':db['User'],'as':_0xd9ff('0x7c'),'attributes':['id',_0xd9ff('0x43')],'raw':!![]});_0x54f4aa[_0xd9ff('0x119')]({'model':db[_0xd9ff('0x124')],'as':_0xd9ff('0x71'),'attributes':['id',_0xd9ff('0x125'),'lastName'],'raw':!![]});if(_0x2031e9['query'][_0xd9ff('0x126')]){_0x54f4aa['push']({'model':db[_0xd9ff('0xe3')],'as':'Attachment','raw':!![]});}var _0xd015e9=[{'model':db[_0xd9ff('0xd4')],'as':_0xd9ff('0xf3'),'attributes':['id','body',_0xd9ff('0x84'),_0xd9ff('0xff'),'secret','read'],'include':_0x54f4aa}];_0xd015e9['push']({'model':db[_0xd9ff('0xc5')],'as':_0xd9ff('0x127'),'attributes':['id',_0xd9ff('0x3c')]});_0xd015e9[_0xd9ff('0x119')]({'model':db[_0xd9ff('0x7c')],'as':_0xd9ff('0x128'),'attributes':['id',_0xd9ff('0x43')]});return db[_0xd9ff('0x49')]['find']({'where':{'id':_0x2031e9[_0xd9ff('0xbe')]['id']},'include':_0xd015e9})[_0xd9ff('0x22')](handleEntityNotFound(_0x3b50d9,null))[_0xd9ff('0x22')](function(_0x1b452e){if(_0x1b452e){var _0x3ab927=_0x1b452e[_0xd9ff('0x129')]({'plain':!![]});fs[_0xd9ff('0x12a')](_0x378746);var _0x2b6e15={'channel':_0xd9ff('0x12b'),'account':_0x3ab927['Account']['name'],'agent':_0x3ab927['Owner']?_0x3ab927[_0xd9ff('0x128')][_0xd9ff('0x43')]:'N.A.','createdAt':moment(_0x3ab927[_0xd9ff('0x84')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xd9ff('0xbb')](),'closedAt':_0x3ab927[_0xd9ff('0xda')]?moment(_0x3ab927[_0xd9ff('0x12c')])[_0xd9ff('0xef')](_0xd9ff('0x112'))[_0xd9ff('0xbb')]():'','disposition':_0x3ab927['disposition'],'chatInfo':{'browser':_0x3ab927[_0xd9ff('0x12d')],'os':_0x3ab927[_0xd9ff('0x12e')],'referer':_0x3ab927[_0xd9ff('0x12f')],'customerIp':_0x3ab927[_0xd9ff('0x130')],'customerPort':_0x3ab927[_0xd9ff('0x131')]?_0x3ab927['customerPort']:'N.A.'},'messages':_(_0x3ab927[_0xd9ff('0xf3')])[_0xd9ff('0x132')]()[_0xd9ff('0x90')]({'secret':![]})[_0xd9ff('0x79')](function(_0x319248){if(_0x319248[_0xd9ff('0xe3')]){var _0x1ea603=path[_0xd9ff('0xe7')](_0x49c9cc,_0x319248[_0xd9ff('0xe3')][_0xd9ff('0xe1')]);if(fs[_0xd9ff('0x133')](_0x1ea603)){fs[_0xd9ff('0x134')](_0x1ea603)[_0xd9ff('0x135')](fs['createWriteStream'](path[_0xd9ff('0xe7')](_0x378746,_0x319248[_0xd9ff('0xe3')][_0xd9ff('0xe1')])));}}return{'date':moment(_0x319248[_0xd9ff('0x84')])[_0xd9ff('0xef')](_0xd9ff('0x112'))[_0xd9ff('0xbb')](),'sender':_0x319248[_0xd9ff('0xff')]===_0xd9ff('0xd3')?_0x319248[_0xd9ff('0x7c')]?_0x319248[_0xd9ff('0x7c')][_0xd9ff('0x43')]:_0xd9ff('0xf6'):_0x319248['Contact'][_0xd9ff('0x125')]+(_0x319248[_0xd9ff('0x71')][_0xd9ff('0x136')]?'\x20'+_0x319248[_0xd9ff('0x71')]['lastName']:''),'body':_0x319248[_0xd9ff('0xe3')]?_0x319248['Attachment']['basename']:_0x319248[_0xd9ff('0x3f')],'direction':_0x319248[_0xd9ff('0xff')]===_0xd9ff('0xd3')?'A':'C','secret':_0x319248[_0xd9ff('0x116')],'read':_0x319248[_0xd9ff('0x8c')],'attachment':_0x319248[_0xd9ff('0xe3')]};})[_0xd9ff('0x6d')]()};return ejs['renderFile'](path[_0xd9ff('0xe7')](config[_0xd9ff('0xe8')],'server',_0xd9ff('0x137'),_0xd9ff('0x138')),{'interaction':_0x2b6e15})[_0xd9ff('0x22')](function(_0xb07a14){var _0x1c419f=path[_0xd9ff('0xe7')](_0x378746,_0xd9ff('0x139')+_0x3ab927['id']+'-'+_0x410fae+_0xd9ff('0x13a'));var _0x3156c8={'path':_0x1c419f,'channel':_0xd9ff('0x12b'),'interactionId':_0x3ab927['id']};return pdf[_0xd9ff('0x13b')](_0xb07a14,_0x3156c8);})['then'](function(){return new BPromise(function(_0x567007,_0x1019f9){zipdir(_0x378746,{'saveTo':_0x46d12c},function(_0x2ab78a,_0x4649d9){if(_0x2ab78a)return _0x1019f9(_0x2ab78a);return _0x567007(_0x4649d9);});})[_0xd9ff('0x22')](function(){return new BPromise(function(_0x166033,_0x3c40e4){rimraf(_0x378746,function(_0x346d93){if(_0x346d93)_0x3c40e4(_0x346d93);return _0x166033();});});})[_0xd9ff('0x22')](function(){return _0x3b50d9['download'](_0x46d12c,_0x2acbe3,function(_0x22680e){if(_0x22680e){console['log'](_0xd9ff('0x13c'),_0x22680e);}else{fs[_0xd9ff('0x13d')](_0x46d12c);}});});});}else{return _0x3b50d9['sendStatus'](0xc8);}})[_0xd9ff('0x2d')](handleError(_0x3b50d9,null));}; \ No newline at end of file +var _0x0b0e=['closed','disposition','AbandonInteraction','attachmentUpload','file','originalname','basename','filename','Attachment','attachmentDownload','attachId','ChatOfflineMessageId','join','root','offline-chat/','download','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','ChatMessage','Messages','%s%d','agentAlias','customer','Visitor','agentIdentifier','website_alias','System','agent_alias','alias','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','auth','SendMail','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','nolimit','YYYY-MM-DD\x20HH:mm:ss','findAll','getMyMessages','includeAgent','spread','chatInteractionTags:save','removeTags','files','tmp','attachments','lastName','Account','Owner','get','mkdirSync','N.A.','browserName','customerIp','customerPort','createReadStream','pipe','createWriteStream','firstName','renderFile','server','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','log','err','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','http','then','request\x20sent','error','code','ChatInteraction,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','send','merge','body','contact','interaction','account','Users','map','TagIds','split','forEach','Tags','push','index','ChatInteraction','rawAttributes','fieldName','type','name','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','pick','field','color','from','tools_tags','ui.ChatInteractionId','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','select','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_websites','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20>\x200','operator','$substring','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','isEmpty','where','i.ChatWebsiteId\x20IN\x20?','createdAt','parse','$gte','$lte','null','read','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.id\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','role','agent','user','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','ChatWebsiteId','sequelize','toString','Account.key','a.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','c.phone','Contact.phone','c.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','ChatInteractionId','all','rows','show','params','filters','includeAll','include','options','create','describe','createVidaooSession','ChatWebsite','findOne','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','fullname','email','POST','isNull','follow','vidaooMetadata','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','Unable\x20to\x20create\x20Vidaoo\x20session','customUpdate','CmContact','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned'];(function(_0x529b89,_0x4c0cd6){var _0x5e7124=function(_0x477328){while(--_0x477328){_0x529b89['push'](_0x529b89['shift']());}};_0x5e7124(++_0x4c0cd6);}(_0x0b0e,0x187));var _0xe0b0=function(_0x542da8,_0x509c26){_0x542da8=_0x542da8-0x0;var _0x533d7e=_0x0b0e[_0x542da8];return _0x533d7e;};'use strict';var emlformat=require(_0xe0b0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe0b0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe0b0('0x2'));var moment=require(_0xe0b0('0x3'));var BPromise=require(_0xe0b0('0x4'));var Mustache=require(_0xe0b0('0x5'));var util=require(_0xe0b0('0x6'));var path=require(_0xe0b0('0x7'));var sox=require(_0xe0b0('0x8'));var csv=require(_0xe0b0('0x9'));var ejs=require(_0xe0b0('0xa'));var fs=require('fs');var fs_extra=require(_0xe0b0('0xb'));var _=require(_0xe0b0('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe0b0('0xd'));var deskjs=require(_0xe0b0('0xe'));var toCsv=require(_0xe0b0('0x9'));var querystring=require(_0xe0b0('0xf'));var Papa=require('papaparse');var Redis=require(_0xe0b0('0x10'));var authService=require(_0xe0b0('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe0b0('0x12'));var pdf=require(_0xe0b0('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe0b0('0x14'))(_0xe0b0('0x15'));var utils=require(_0xe0b0('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xe0b0('0x17'));var db=require(_0xe0b0('0x18'))['db'];config[_0xe0b0('0x19')]=_[_0xe0b0('0x1a')](config[_0xe0b0('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xe0b0('0x1b'))(new Redis(config[_0xe0b0('0x19')]));require(_0xe0b0('0x1c'))[_0xe0b0('0x1d')](socket);var jayson=require(_0xe0b0('0x1e'));var client=jayson['client'][_0xe0b0('0x1f')]({'port':0x232b});var client9004=jayson['client'][_0xe0b0('0x1f')]({'port':0x232c});function respondWithRpcPromise(_0xadee6e,_0x519ae8,_0x11fdca,_0x4a4cc0){return new BPromise(function(_0x2d6fb6,_0x100204){var _0x56bcc7=_0x4a4cc0||client;return _0x56bcc7['request'](_0xadee6e,_0x11fdca)[_0xe0b0('0x20')](function(_0x50a441){logger['info']('ChatInteraction,\x20%s,\x20%s',_0x519ae8,_0xe0b0('0x21'));logger['debug']('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x519ae8,_0xe0b0('0x21'),JSON['stringify'](_0x50a441));if(_0x50a441[_0xe0b0('0x22')]){if(_0x50a441['error'][_0xe0b0('0x23')]===0x1f4){logger[_0xe0b0('0x22')](_0xe0b0('0x24'),_0x519ae8,_0x50a441[_0xe0b0('0x22')][_0xe0b0('0x25')]);return _0x100204(_0x50a441['error']['message']);}logger[_0xe0b0('0x22')]('ChatInteraction,\x20%s,\x20%s',_0x519ae8,_0x50a441[_0xe0b0('0x22')][_0xe0b0('0x25')]);return _0x2d6fb6(_0x50a441['error'][_0xe0b0('0x25')]);}else{logger['info'](_0xe0b0('0x24'),_0x519ae8,'request\x20sent');_0x2d6fb6(_0x50a441[_0xe0b0('0x26')]['message']);}})[_0xe0b0('0x27')](function(_0x4de537){logger[_0xe0b0('0x22')]('ChatInteraction,\x20%s,\x20%s',_0x519ae8,_0x4de537);_0x100204(_0x4de537);});});}function respondWithStatusCode(_0x3c221d,_0x5c5317){_0x5c5317=_0x5c5317||0xcc;return function(_0x362aba){if(_0x362aba){return _0x3c221d[_0xe0b0('0x28')](_0x5c5317);}return _0x3c221d[_0xe0b0('0x29')](_0x5c5317)[_0xe0b0('0x2a')]();};}function respondWithResult(_0x3ec2,_0x10745d){_0x10745d=_0x10745d||0xc8;return function(_0x5200a6){if(_0x5200a6){return _0x3ec2[_0xe0b0('0x29')](_0x10745d)[_0xe0b0('0x2b')](_0x5200a6);}};}function respondWithFilteredResult(_0x5b7a64,_0x15e13b){return function(_0x419b1f){if(_0x419b1f){var _0x36d137=typeof _0x15e13b[_0xe0b0('0x2c')]===_0xe0b0('0x2d')&&typeof _0x15e13b[_0xe0b0('0x2e')]===_0xe0b0('0x2d');var _0x4fb3b7=_0x419b1f[_0xe0b0('0x2f')];var _0x3c0109=_0x36d137?0x0:_0x15e13b['offset'];var _0x4fe400=_0x36d137?_0x419b1f[_0xe0b0('0x2f')]:_0x15e13b[_0xe0b0('0x2c')]+_0x15e13b[_0xe0b0('0x2e')];var _0x3f81d5;if(_0x4fe400>=_0x4fb3b7){_0x4fe400=_0x4fb3b7;_0x3f81d5=0xc8;}else{_0x3f81d5=0xce;}_0x5b7a64[_0xe0b0('0x29')](_0x3f81d5);return _0x5b7a64['set'](_0xe0b0('0x30'),_0x3c0109+'-'+_0x4fe400+'/'+_0x4fb3b7)[_0xe0b0('0x2b')](_0x419b1f);}return null;};}function patchUpdates(_0x7867c4){return function(_0x29d725){try{jsonpatch[_0xe0b0('0x31')](_0x29d725,_0x7867c4,!![]);}catch(_0x4fe835){return BPromise[_0xe0b0('0x32')](_0x4fe835);}return _0x29d725[_0xe0b0('0x33')]();};}function saveUpdates(_0xfc51d3,_0x31c6f5){return function(_0x3575bc){if(_0x3575bc){return _0x3575bc[_0xe0b0('0x34')](_0xfc51d3)[_0xe0b0('0x20')](function(_0x20908f){return _0x20908f;});}return null;};}function removeEntity(_0x2125d5,_0x1dd010){return function(_0xd56467){if(_0xd56467){return _0xd56467[_0xe0b0('0x35')]()[_0xe0b0('0x20')](function(){_0x2125d5[_0xe0b0('0x29')](0xcc)[_0xe0b0('0x2a')]();});}};}function handleEntityNotFound(_0x4cf80c,_0x121608){return function(_0x135be5){if(!_0x135be5){_0x4cf80c[_0xe0b0('0x28')](0x194);}return _0x135be5;};}function handleError(_0x1eb3f9,_0x1a2d24){_0x1a2d24=_0x1a2d24||0x1f4;return function(_0x2c6e60){logger[_0xe0b0('0x22')](_0x2c6e60['stack']);if(_0x2c6e60['name']){delete _0x2c6e60['name'];}_0x1eb3f9['status'](_0x1a2d24)[_0xe0b0('0x36')](_0x2c6e60);};}function getMustacheRender(_0xc3d967,_0xe6f635){return Mustache['render'](_0xc3d967,_[_0xe0b0('0x37')](_0xe6f635[_0xe0b0('0x38')],{'contact':_0xe6f635[_0xe0b0('0x39')],'message':_0xe6f635[_0xe0b0('0x25')],'agent':_0xe6f635['agent'],'interaction':_0xe6f635[_0xe0b0('0x3a')],'account':_0xe6f635[_0xe0b0('0x3b')]}))||'';}function getInteractionUsers(_0x43d352,_0x30dcbb){return new BPromise(function(_0x4265e3,_0x1205db){try{if(_0x30dcbb[_0x43d352['id']]){_0x43d352[_0xe0b0('0x3c')]=_[_0xe0b0('0x3d')](_0x30dcbb[_0x43d352['id']],function(_0xeaffbb){return{'id':_0xeaffbb['id'],'fullname':_0xeaffbb['fullname']};});}}catch(_0x3e349b){_0x1205db(_0x3e349b);}_0x4265e3(_0x43d352);});}function getInteractionTags(_0x54f646,_0x34178d){return new BPromise(function(_0x2d5f47,_0x46c4ea){try{if(_0x54f646[_0xe0b0('0x3e')]){_0x54f646['Tags']=[];_0x54f646[_0xe0b0('0x3e')][_0xe0b0('0x3f')](',')[_0xe0b0('0x40')](function(_0x402a0e){_0x54f646[_0xe0b0('0x41')][_0xe0b0('0x42')](_0x34178d[_0x402a0e]);});}delete _0x54f646[_0xe0b0('0x3e')];}catch(_0x3bde8b){_0x46c4ea(_0x3bde8b);}_0x2d5f47(_0x54f646);});}function updateChatInteraction(_0x52ffe4,_0x2aad80,_0x309bbf){return new BPromise(function(_0x528818,_0x515bd2){return getInteractionUsers(_0x52ffe4,_0x309bbf)[_0xe0b0('0x20')](function(_0x247f8d){return getInteractionTags(_0x247f8d,_0x2aad80);})['then'](function(_0x18a59d){_0x528818(_0x18a59d);})[_0xe0b0('0x27')](function(_0x6bca5c){_0x515bd2(_0x6bca5c);});});}exports[_0xe0b0('0x43')]=function(_0x1a8cc7,_0x5c31b5){var _0x5d2fa2={},_0x51c580={},_0xc3235b={'count':0x0,'rows':[]};var _0x38e715=_['map'](db[_0xe0b0('0x44')][_0xe0b0('0x45')],function(_0x14197b){return{'name':_0x14197b[_0xe0b0('0x46')],'type':_0x14197b[_0xe0b0('0x47')]['key']};});_0x51c580['model']=_[_0xe0b0('0x3d')](_0x38e715,_0xe0b0('0x48'));_0x51c580[_0xe0b0('0x49')]=_[_0xe0b0('0x4a')](_0x1a8cc7[_0xe0b0('0x49')]);_0x51c580['filters']=_[_0xe0b0('0x4b')](_0x51c580[_0xe0b0('0x4c')],_0x51c580['query']);_0x5d2fa2['attributes']=_['intersection'](_0x51c580[_0xe0b0('0x4c')],qs[_0xe0b0('0x4d')](_0x1a8cc7[_0xe0b0('0x49')][_0xe0b0('0x4d')]));_0x5d2fa2['attributes']=_0x5d2fa2[_0xe0b0('0x4e')][_0xe0b0('0x4f')]?_0x5d2fa2['attributes']:_0x51c580['model'];if(!_0x1a8cc7[_0xe0b0('0x49')][_0xe0b0('0x50')]('nolimit')){_0x5d2fa2[_0xe0b0('0x2e')]=qs[_0xe0b0('0x2e')](_0x1a8cc7['query']['limit']);_0x5d2fa2[_0xe0b0('0x2c')]=qs['offset'](_0x1a8cc7[_0xe0b0('0x49')][_0xe0b0('0x2c')]);}_0x5d2fa2[_0xe0b0('0x51')]=qs[_0xe0b0('0x52')](_0x1a8cc7[_0xe0b0('0x49')][_0xe0b0('0x52')]);_0x5d2fa2['where']=qs['filters'](_[_0xe0b0('0x53')](_0x1a8cc7['query'],_0x51c580['filters']),_0x38e715);var _0x249d9a=[];var _0x222174=squel['select']()['field']('id')[_0xe0b0('0x54')](_0xe0b0('0x48'))[_0xe0b0('0x54')](_0xe0b0('0x55'))[_0xe0b0('0x56')](_0xe0b0('0x57'));var _0x84fabb=squel['select']()[_0xe0b0('0x54')]('u.id')[_0xe0b0('0x54')]('u.fullname')['field'](_0xe0b0('0x58'))[_0xe0b0('0x56')](_0xe0b0('0x59'),'ui')[_0xe0b0('0x5a')](_0xe0b0('0x5b'),'u',_0xe0b0('0x5c'));var _0x4548da=squel[_0xe0b0('0x5d')]()[_0xe0b0('0x56')]('chat_interactions','i')[_0xe0b0('0x5a')]('cm_contacts','c',_0xe0b0('0x5e'))[_0xe0b0('0x5a')](_0xe0b0('0x5b'),'o',_0xe0b0('0x5f'))[_0xe0b0('0x5a')](_0xe0b0('0x60'),'a','a.id\x20=\x20i.ChatWebsiteId')[_0xe0b0('0x5a')](_0xe0b0('0x61'),'me',_0xe0b0('0x62'))[_0xe0b0('0x5a')](_0xe0b0('0x63'),'it',_0xe0b0('0x64'))[_0xe0b0('0x5a')](_0xe0b0('0x57'),'t',_0xe0b0('0x65'));var _0xf331df=squel[_0xe0b0('0x66')]();var _0x18ab99=[];var _0xc719d2=squel[_0xe0b0('0x66')]();var _0xcdf97;if(_0x1a8cc7[_0xe0b0('0x49')][_0xe0b0('0x67')]){_0xcdf97=as[_0xe0b0('0x68')](_0x1a8cc7['query'][_0xe0b0('0x67')]);var _0xe7fbac=_0xcdf97[_0xe0b0('0x69')];for(var _0x2f24e6=0x0;_0x2f24e6<_0xcdf97[_0xe0b0('0x6a')][_0xe0b0('0x4f')];_0x2f24e6++){var _0x2bdb59=_0xcdf97['conditions'][_0x2f24e6];var _0x47dcc4='i';var _0x139014=_[_0xe0b0('0x6b')](_0x38e715,[_0xe0b0('0x48'),_0x2bdb59['field']]);if(!_0x139014){switch(_0x2bdb59[_0xe0b0('0x54')]){case _0xe0b0('0x6c'):if(_0x2bdb59[_0xe0b0('0x6d')]==0x1){_0x4548da[_0xe0b0('0x6e')]('`'+_0x2bdb59[_0xe0b0('0x54')]+'`\x20=\x200');}else{_0x4548da[_0xe0b0('0x6e')]('`'+_0x2bdb59[_0xe0b0('0x54')]+_0xe0b0('0x6f'));}break;case'Contact':if(_0x2bdb59[_0xe0b0('0x70')]===_0xe0b0('0x71')){if(_0x2bdb59['value'][_0xe0b0('0x3f')]('\x20')['length']>0x1){_0xf331df[_0xe7fbac]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xe0b0('0x72')](_0x2bdb59['value']),null);}else{var _0x4d75e4='%'+_0x2bdb59[_0xe0b0('0x6d')]+'%';_0xf331df[_0xe7fbac](_0xe0b0('0x73'),_0x4d75e4,_0x4d75e4,_0x4d75e4);}}else{_0x139014=_[_0xe0b0('0x6b')](_0x38e715,[_0xe0b0('0x48'),'ContactId']);_0x2bdb59[_0xe0b0('0x54')]=_0xe0b0('0x74');_0x14da9c=as[_0xe0b0('0x75')](_0x47dcc4,_0x139014[_0xe0b0('0x47')],_0x2bdb59);_0xf331df[_0xe7fbac](_0x14da9c[_0xe0b0('0x76')],_0x14da9c[_0xe0b0('0x6d')][_0xe0b0('0x77')],_0x14da9c[_0xe0b0('0x6d')]['end']);}break;case'Tag':var _0x4b41a=_0x2bdb59[_0xe0b0('0x6d')][_0xe0b0('0x3f')](',')['map'](function(_0x49b754){return Number(_0x49b754);});_0x4b41a[_0xe0b0('0x40')](function(_0x26f36f){_0xc719d2['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x26f36f+',%');});_0x18ab99=_['union'](_0x18ab99,_0x4b41a);break;case _0xe0b0('0x78'):if(_0x2bdb59[_0xe0b0('0x70')]===_0xe0b0('0x71')){_0xf331df[_0xe7fbac](_0xe0b0('0x79'),'%'+_0x2bdb59[_0xe0b0('0x6d')]+'%',null);}else{_0x139014=_[_0xe0b0('0x6b')](_0x38e715,[_0xe0b0('0x48'),_0xe0b0('0x7a')]);_0x2bdb59['field']=_0xe0b0('0x7a');_0x14da9c=as[_0xe0b0('0x75')](_0x47dcc4,_0x139014[_0xe0b0('0x47')],_0x2bdb59);_0xf331df[_0xe7fbac](_0x14da9c['text'],_0x14da9c['value']['start'],_0x14da9c['value']['end']);}break;case'body':_0x14da9c=as[_0xe0b0('0x75')]('me',null,_0x2bdb59);_0xf331df[_0xe7fbac](_0x14da9c['text'],_0x14da9c['value'][_0xe0b0('0x77')],_0x14da9c[_0xe0b0('0x6d')][_0xe0b0('0x2a')]);break;}}else{var _0x14da9c=as[_0xe0b0('0x75')](_0x47dcc4,_0x139014[_0xe0b0('0x47')],_0x2bdb59);_0xf331df[_0xe7fbac](_0x14da9c[_0xe0b0('0x76')],_0x14da9c[_0xe0b0('0x6d')]['start'],_0x14da9c[_0xe0b0('0x6d')][_0xe0b0('0x2a')]);}}}else{var _0x86e90=_(_0x1a8cc7[_0xe0b0('0x49')])[_0xe0b0('0x4a')]()[_0xe0b0('0x3d')](function(_0x16a2ae){return _['some'](_0x38e715,[_0xe0b0('0x48'),_0x16a2ae])?_0x16a2ae:undefined;})['compact']()[_0xe0b0('0x6d')]();if(!_[_0xe0b0('0x7b')](_0x86e90)){_0x86e90[_0xe0b0('0x40')](function(_0x9c7221){if(_0x9c7221==='ChatWebsiteId'){_0x4548da[_0xe0b0('0x7c')](_0xe0b0('0x7d'),[]['concat'](_0x1a8cc7['query'][_0x9c7221]));}else if(_0x9c7221===_0xe0b0('0x7e')){var _0x30adc5=JSON[_0xe0b0('0x7f')](_0x1a8cc7[_0xe0b0('0x49')][_0x9c7221])[_0xe0b0('0x80')];var _0x31dd21=JSON[_0xe0b0('0x7f')](_0x1a8cc7[_0xe0b0('0x49')][_0x9c7221])[_0xe0b0('0x81')];_0x4548da[_0xe0b0('0x7c')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x30adc5,_0x31dd21);}else{if(_0x1a8cc7['query'][_0x9c7221]===_0xe0b0('0x82')){_0x4548da['where']('i.'+_0x9c7221+'\x20IS\x20NULL');}else{_0x4548da['where']('i.'+_0x9c7221+'\x20=\x20?',_0x1a8cc7[_0xe0b0('0x49')][_0x9c7221]);}}});}if(_0x1a8cc7['query'][_0xe0b0('0x83')]){if(_0x1a8cc7[_0xe0b0('0x49')][_0xe0b0('0x83')]==0x1){_0x4548da[_0xe0b0('0x6e')]('`unreadMessages`\x20=\x200');}else{_0x4548da[_0xe0b0('0x6e')](_0xe0b0('0x84'));}}if(_0x1a8cc7['query'][_0xe0b0('0x85')]){_0x18ab99=_[_0xe0b0('0x86')](_0x1a8cc7[_0xe0b0('0x49')][_0xe0b0('0x85')])?_0x1a8cc7[_0xe0b0('0x49')]['tag']:new Array(_0x1a8cc7['query']['tag']);_0x18ab99['forEach'](function(_0x5c258b){_0xc719d2['or'](_0xe0b0('0x87'),'%,'+_0x5c258b+',%');});}if(_0x1a8cc7['query'][_0xe0b0('0x88')]){var _0x5f4aaf=_0x1a8cc7[_0xe0b0('0x49')][_0xe0b0('0x88')][_0xe0b0('0x89')]('\x5c','\x5c\x5c')[_0xe0b0('0x89')](/'/g,'\x27\x27');if(qs[_0xe0b0('0x8a')](_0x5f4aaf)){_0xf331df['or'](_0xe0b0('0x8b'),_0x5f4aaf+'%');}else{_0xf331df['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x5f4aaf))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x5f4aaf+'%');}}}_0x4548da['where'](_0xf331df);_0x4548da[_0xe0b0('0x8c')](_0xe0b0('0x8d'));var _0x264363={'type':db[_0xe0b0('0x8e')][_0xe0b0('0x8f')]['SELECT'],'raw':!![]};var _0x234716=_0x4548da[_0xe0b0('0x90')]();_0x234716[_0xe0b0('0x54')](_0xe0b0('0x8d'));_0x234716[_0xe0b0('0x54')](_0xe0b0('0x91'),_0xe0b0('0x6c'));if(_0x5d2fa2[_0xe0b0('0x51')]){_0x5d2fa2[_0xe0b0('0x51')]['forEach'](function(_0x589c47){var _0x6e0e9=_0x589c47[0x0]===_0xe0b0('0x92')?_0x589c47[0x0]:'i.'+_0x589c47[0x0];_0x4548da['order'](_0x6e0e9,_0x589c47[0x1]===_0xe0b0('0x93')?![]:!![]);});}if(!_[_0xe0b0('0x7b')](_0x18ab99)){_0x4548da[_0xe0b0('0x6e')](_0xc719d2);_0x234716[_0xe0b0('0x7c')](_0xe0b0('0x94'),_0x18ab99);}BPromise[_0xe0b0('0x95')]()[_0xe0b0('0x20')](function(){if(!_0xcdf97){if(_0x1a8cc7[_0xe0b0('0x49')]['ChatWebsiteId'])return;_0x234716['where']('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');_0x4548da[_0xe0b0('0x7c')](_0xe0b0('0x96'));return;}if(_0x1a8cc7['user'][_0xe0b0('0x97')]!==_0xe0b0('0x98'))return;return _0x1a8cc7[_0xe0b0('0x99')][_0xe0b0('0x9a')]({'attributes':['id'],'raw':!![]})['then'](function(_0x56c4b9){if(_['isEmpty'](_0x56c4b9)){_0x234716[_0xe0b0('0x7c')](_0xe0b0('0x9b'));_0x4548da['where'](_0xe0b0('0x9b'));}else{_0x234716[_0xe0b0('0x7c')]('i.ChatWebsiteId\x20IN\x20?',_['map'](_0x56c4b9,'id'));_0x4548da[_0xe0b0('0x7c')]('i.ChatWebsiteId\x20IN\x20?',_[_0xe0b0('0x3d')](_0x56c4b9,'id'));}});})['then'](function(){if(_0x1a8cc7[_0xe0b0('0x99')][_0xe0b0('0x97')]===_0xe0b0('0x98')&&!_0xcdf97&&!_0x1a8cc7[_0xe0b0('0x49')][_0xe0b0('0x9c')])return[];return db[_0xe0b0('0x9d')][_0xe0b0('0x49')](_0x234716[_0xe0b0('0x9e')](),_0x264363);})[_0xe0b0('0x20')](function(_0x48497e){_0xc3235b[_0xe0b0('0x2f')]=_0x48497e[_0xe0b0('0x4f')];if(_0xc3235b[_0xe0b0('0x2f')]===0x0)return[];return db['sequelize'][_0xe0b0('0x49')](_0x222174['toString'](),_0x264363)[_0xe0b0('0x20')](function(_0x350c40){_0x249d9a=_['keyBy'](_0x350c40,'id');_0x264363=_[_0xe0b0('0x37')](_0x264363,{'model':db['ChatInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1a8cc7['query'][_0xe0b0('0x4d')]){_0x5d2fa2['attributes']['forEach'](function(_0x4f027c){_0x4548da[_0xe0b0('0x54')]('i.'+_0x4f027c);});}else{_0x4548da[_0xe0b0('0x54')](_0xe0b0('0x91'),_0xe0b0('0x6c'));_0x4548da[_0xe0b0('0x54')]('a.key',_0xe0b0('0x9f'));_0x4548da[_0xe0b0('0x54')](_0xe0b0('0xa0'),'Account.mandatoryDisposition');_0x4548da[_0xe0b0('0x54')](_0xe0b0('0xa1'),'contactName');_0x4548da['field'](_0xe0b0('0xa2'));_0x4548da['field'](_0xe0b0('0xa3'),_0xe0b0('0xa4'));_0x4548da[_0xe0b0('0x54')](_0xe0b0('0xa5'),_0xe0b0('0xa6'));_0x4548da[_0xe0b0('0x54')](_0xe0b0('0xa7'),'Contact.email');_0x4548da[_0xe0b0('0x54')](_0xe0b0('0xa8'),_0xe0b0('0xa9'));_0x4548da[_0xe0b0('0x54')](_0xe0b0('0xaa'),'Contact.mobile');_0x4548da['field'](_0xe0b0('0xab'),_0xe0b0('0xac'));_0x4548da[_0xe0b0('0x54')](_0xe0b0('0xad'),_0xe0b0('0xae'));_0x4548da[_0xe0b0('0x54')](_0xe0b0('0xaf'),_0xe0b0('0xb0'));_0x4548da[_0xe0b0('0x54')](_0xe0b0('0xb1'),'TagIds');}if(_0x5d2fa2[_0xe0b0('0x2e')])_0x4548da[_0xe0b0('0x2e')](_0x5d2fa2[_0xe0b0('0x2e')]);if(_0x5d2fa2[_0xe0b0('0x2c')])_0x4548da['offset'](_0x5d2fa2[_0xe0b0('0x2c')]);return db[_0xe0b0('0x9d')][_0xe0b0('0x49')](_0x4548da[_0xe0b0('0x9e')](),_0x264363);})[_0xe0b0('0x20')](function(_0x484cb2){if(_0x484cb2[_0xe0b0('0x4f')]>0x0)_0x84fabb['where'](_0xe0b0('0xb2'),_[_0xe0b0('0x3d')](_0x484cb2,'id'));return db[_0xe0b0('0x9d')][_0xe0b0('0x49')](_0x84fabb[_0xe0b0('0x9e')](),_0x264363)['then'](function(_0x567e42){var _0x3822e4=_['groupBy'](_0x567e42,_0xe0b0('0xb3'));var _0x4c82d6=[];_0x484cb2[_0xe0b0('0x40')](function(_0x474fbb){_0x4c82d6[_0xe0b0('0x42')](updateChatInteraction(_0x474fbb,_0x249d9a,_0x3822e4));});return BPromise[_0xe0b0('0xb4')](_0x4c82d6);});});})[_0xe0b0('0x20')](function(_0x1bb4da){_0xc3235b[_0xe0b0('0xb5')]=_0x1bb4da;return _0xc3235b;})['then'](respondWithFilteredResult(_0x5c31b5,_0x5d2fa2))['catch'](handleError(_0x5c31b5,null));};exports[_0xe0b0('0xb6')]=function(_0x717e74,_0x184938){var _0x20d6bd={'raw':![],'where':{'id':_0x717e74[_0xe0b0('0xb7')]['id']}},_0xd83992={};_0xd83992[_0xe0b0('0x4c')]=_[_0xe0b0('0x4a')](db[_0xe0b0('0x44')][_0xe0b0('0x45')]);_0xd83992['query']=_['keys'](_0x717e74[_0xe0b0('0x49')]);_0xd83992[_0xe0b0('0xb8')]=_[_0xe0b0('0x4b')](_0xd83992[_0xe0b0('0x4c')],_0xd83992[_0xe0b0('0x49')]);_0x20d6bd[_0xe0b0('0x4e')]=_[_0xe0b0('0x4b')](_0xd83992['model'],qs['fields'](_0x717e74[_0xe0b0('0x49')][_0xe0b0('0x4d')]));_0x20d6bd[_0xe0b0('0x4e')]=_0x20d6bd[_0xe0b0('0x4e')][_0xe0b0('0x4f')]?_0x20d6bd[_0xe0b0('0x4e')]:_0xd83992[_0xe0b0('0x4c')];if(_0x717e74[_0xe0b0('0x49')][_0xe0b0('0xb9')]){_0x20d6bd[_0xe0b0('0xba')]=[{'all':!![]}];}_0x20d6bd=_['merge']({},_0x20d6bd,_0x717e74[_0xe0b0('0xbb')]);return db[_0xe0b0('0x44')]['find'](_0x20d6bd)[_0xe0b0('0x20')](handleEntityNotFound(_0x184938,null))[_0xe0b0('0x20')](respondWithResult(_0x184938,null))[_0xe0b0('0x27')](handleError(_0x184938,null));};exports[_0xe0b0('0xbc')]=function(_0x41fdef,_0x594f91){return db[_0xe0b0('0x44')][_0xe0b0('0xbc')](_0x41fdef[_0xe0b0('0x38')],{})[_0xe0b0('0x20')](respondWithResult(_0x594f91,0xc9))[_0xe0b0('0x27')](handleError(_0x594f91,null));};exports['update']=function(_0x475404,_0x58d61b){if(_0x475404[_0xe0b0('0x38')]['id']){delete _0x475404[_0xe0b0('0x38')]['id'];}return db[_0xe0b0('0x44')]['find']({'where':{'id':_0x475404['params']['id']}})[_0xe0b0('0x20')](handleEntityNotFound(_0x58d61b,null))[_0xe0b0('0x20')](saveUpdates(_0x475404[_0xe0b0('0x38')],null))['then'](respondWithResult(_0x58d61b,null))['catch'](handleError(_0x58d61b,null));};exports['destroy']=function(_0x5175e1,_0x57694c){return db['ChatInteraction'][_0xe0b0('0x6b')]({'where':{'id':_0x5175e1[_0xe0b0('0xb7')]['id']}})['then'](handleEntityNotFound(_0x57694c,null))[_0xe0b0('0x20')](removeEntity(_0x57694c,null))[_0xe0b0('0x27')](handleError(_0x57694c,null));};exports[_0xe0b0('0xbd')]=function(_0xd73b8a,_0x437588){return db['ChatInteraction']['describe']()[_0xe0b0('0x20')](respondWithResult(_0x437588,null))[_0xe0b0('0x27')](handleError(_0x437588,null));};exports[_0xe0b0('0xbe')]=function(_0x52dfd8,_0x6ab413){var _0x395083=_0x52dfd8[_0xe0b0('0xb7')]['id'];var _0xd231c4;var _0x35ca4e;var _0x1b8d4a;return db['ChatInteraction']['findOne']({'where':{'id':_0x395083}})['then'](function(_0x1ce027){_0xd231c4=_0x1ce027;return db[_0xe0b0('0xbf')][_0xe0b0('0xc0')]({'where':{'id':_0x1ce027[_0xe0b0('0x9c')]},'attributes':['id',_0xe0b0('0xc1'),_0xe0b0('0xc2'),_0xe0b0('0xc3'),_0xe0b0('0xc4'),'vidaooMetadata'],'raw':!![]});})['then'](function(_0x28ba25){if(_0x28ba25&&_0x28ba25[_0xe0b0('0xc1')]&&_0x28ba25[_0xe0b0('0xc2')]){_0x35ca4e=_0x28ba25;var _0x5451e7={'interaction':{'id':_0x395083},'agent':{'id':_0x52dfd8[_0xe0b0('0x99')]['id'],'name':_0x52dfd8[_0xe0b0('0x99')][_0xe0b0('0x48')],'fullname':_0x52dfd8['user'][_0xe0b0('0xc5')],'email':_0x52dfd8['user'][_0xe0b0('0xc6')]},'contact':_0x52dfd8[_0xe0b0('0x38')][_0xe0b0('0x39')],'account':_0x52dfd8[_0xe0b0('0x38')][_0xe0b0('0x3b')]};var _0x26df60={'rejectUnauthorized':![],'method':_0xe0b0('0xc7'),'url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x28ba25[_0xe0b0('0xc1')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x52dfd8[_0xe0b0('0x99')]['email']],'buttons':null,'topic':_0x35ca4e[_0xe0b0('0xc3')],'note':_[_0xe0b0('0xc8')](_0x35ca4e[_0xe0b0('0xc4')])?null:getMustacheRender(_0x35ca4e['vidaooNote'],_0x5451e7),'metadata':null},'redirect':_0xe0b0('0xc9'),'json':!![]};try{if(!_[_0xe0b0('0xc8')](_0x35ca4e[_0xe0b0('0xca')])){var _0x566a6e=getMustacheRender(_0x35ca4e[_0xe0b0('0xca')],_0x5451e7);var _0x32f67b=JSON[_0xe0b0('0x7f')](_0x566a6e);_0x26df60[_0xe0b0('0x38')][_0xe0b0('0xcb')]=_0x32f67b;}}catch(_0x15be52){throw new db['Sequelize'][(_0xe0b0('0xcc'))](_0xe0b0('0xcd'));}return rp(_0x26df60);}else{throw new db[(_0xe0b0('0x8e'))][(_0xe0b0('0xcc'))](_0xe0b0('0xce'));}})[_0xe0b0('0x20')](function(_0x38b2cf){_0x1b8d4a=_0x38b2cf;if(_0x1b8d4a['id']){var _0x31b01a={'body':_0x1b8d4a[_0xe0b0('0xcf')],'ChatWebsiteId':_0x35ca4e['id'],'ChatInteractionId':_0xd231c4['id'],'direction':_0xe0b0('0xd0'),'UserId':_0x52dfd8[_0xe0b0('0x99')]['id']};return db['ChatMessage'][_0xe0b0('0xbc')](_0x31b01a,{});}else{throw new db['Sequelize']['ValidationError'](_0xe0b0('0xd1'));}})[_0xe0b0('0x20')](function(){return _0xd231c4['updateAttributes']({'vidaooSessionId':_0x1b8d4a['id']});})[_0xe0b0('0x20')](respondWithResult(_0x6ab413,null))[_0xe0b0('0x27')](handleError(_0x6ab413,null));};exports[_0xe0b0('0xd2')]=function(_0x11e969,_0xa18619){if(_0x11e969[_0xe0b0('0x38')]['id']){delete _0x11e969[_0xe0b0('0x38')]['id'];}return db[_0xe0b0('0x44')][_0xe0b0('0x6b')]({'where':{'id':_0x11e969['params']['id']},'include':[{'model':db[_0xe0b0('0xd3')],'as':_0xe0b0('0xd4')}]})[_0xe0b0('0x20')](handleEntityNotFound(_0xa18619,null))[_0xe0b0('0x20')](saveUpdates(_0x11e969['body'],null))['then'](respondWithResult(_0xa18619,null))[_0xe0b0('0x27')](handleError(_0xa18619,null));};exports[_0xe0b0('0xd5')]=function(_0x333c2a,_0x2cd7db,_0x308d03){if(_0x333c2a[_0xe0b0('0x38')]['id']){delete _0x333c2a[_0xe0b0('0x38')]['id'];}return db[_0xe0b0('0x44')][_0xe0b0('0x6b')]({'where':{'id':_0x333c2a[_0xe0b0('0xb7')]['id']}})[_0xe0b0('0x20')](function(_0xaa7a71){if(!_0xaa7a71){logger[_0xe0b0('0x22')](_0xe0b0('0xd6'),_0xe0b0('0xd5'),0x194,_0xe0b0('0xd7'));_0x2cd7db[_0xe0b0('0x28')](0x194);}else{if(_0xaa7a71[_0xe0b0('0x7a')]){throw new db[(_0xe0b0('0x8e'))]['ValidationError'](_0xe0b0('0xd8'));}}return _0xaa7a71;})[_0xe0b0('0x20')](function(_0x36a006){if(_0x36a006){return _0x36a006['update']({'closed':_0x333c2a[_0xe0b0('0x38')][_0xe0b0('0xd9')],'disposition':_0x333c2a[_0xe0b0('0x38')][_0xe0b0('0xda')]})[_0xe0b0('0x20')](function(_0x3532f1){return _0x3532f1;});}})[_0xe0b0('0x20')](function(_0x581ae9){return respondWithRpcPromise(_0xe0b0('0xdb'),'abandon',_0x333c2a[_0xe0b0('0x38')],client9004);})['then'](respondWithResult(_0x2cd7db,null))[_0xe0b0('0x27')](handleError(_0x2cd7db,null));};exports[_0xe0b0('0xdc')]=function(_0x4bd799,_0x2102bc,_0x4f0cbe){_0x4bd799[_0xe0b0('0x38')][_0xe0b0('0x48')]=_0x4bd799[_0xe0b0('0xdd')][_0xe0b0('0xde')];_0x4bd799[_0xe0b0('0x38')][_0xe0b0('0xdf')]=_0x4bd799[_0xe0b0('0xdd')][_0xe0b0('0xe0')];_0x4bd799['body'][_0xe0b0('0x47')]=_0x4bd799['file']['mimetype'];return db[_0xe0b0('0xe1')][_0xe0b0('0xbc')](_0x4bd799[_0xe0b0('0x38')])['then'](respondWithResult(_0x2102bc,0xc9))['catch'](handleError(_0x2102bc,null));};exports[_0xe0b0('0xe2')]=function(_0x3c207e,_0x4fc379,_0x98e7c9){return db[_0xe0b0('0x44')][_0xe0b0('0xc0')]({'where':{'id':_0x3c207e[_0xe0b0('0xb7')]['id']},'raw':!![]})[_0xe0b0('0x20')](handleEntityNotFound(_0x4fc379,null))[_0xe0b0('0x20')](function(_0x4074bb){if(_0x4074bb){if(_0x4074bb[_0xe0b0('0xd9')]){return _0x4fc379[_0xe0b0('0x29')](0x193)['json']({'status':0x193,'message':'Unauthorized'});}return db[_0xe0b0('0xe1')][_0xe0b0('0xc0')]({'where':{'id':_0x3c207e[_0xe0b0('0x49')][_0xe0b0('0xe3')]},'raw':!![]})[_0xe0b0('0x20')](handleEntityNotFound(_0x4fc379,null));}})[_0xe0b0('0x20')](function(_0x54f90a){if(_0x54f90a){var _0x1aa40b=_0x54f90a[_0xe0b0('0xe4')]!==null;var _0x22c8a2=path[_0xe0b0('0xe5')](config[_0xe0b0('0xe6')],'server/files/attachments/');if(_0x1aa40b){_0x22c8a2=path[_0xe0b0('0xe5')](_0x22c8a2,_0xe0b0('0xe7'));}var _0x321b0b=path[_0xe0b0('0xe5')](_0x22c8a2,_0x54f90a[_0xe0b0('0xdf')]);return _0x4fc379[_0xe0b0('0xe8')](_0x321b0b);}})[_0xe0b0('0x27')](handleError(_0x4fc379,null));};exports[_0xe0b0('0xe9')]=function(_0x1ccfc1,_0x2b1474){var _0x574f0a=null;var _0x108371=null;var _0x3f2ec=null;var _0x4f0db7=null;if(_0x1ccfc1[_0xe0b0('0x38')]['id']){delete _0x1ccfc1['body']['id'];}if(_0x1ccfc1[_0xe0b0('0x38')][_0xe0b0('0xea')]){_0x4f0db7=path['join'](config[_0xe0b0('0xe6')],_0xe0b0('0xeb'),util[_0xe0b0('0xec')](_0xe0b0('0xed'),Date[_0xe0b0('0xee')]()));_0x1ccfc1[_0xe0b0('0x38')][_0xe0b0('0xef')]=_0x4f0db7;}return db['ChatInteraction']['find']({'where':{'id':_0x1ccfc1[_0xe0b0('0xb7')]['id']},'include':[{'model':db[_0xe0b0('0xf0')],'as':_0xe0b0('0xf1'),'include':[{'model':db['User'],'as':_0xe0b0('0x78')}]}]})[_0xe0b0('0x20')](handleEntityNotFound(_0x2b1474,null))[_0xe0b0('0x20')](saveUpdates(_0x1ccfc1[_0xe0b0('0x38')],null))[_0xe0b0('0x20')](function(_0x117d00){if(_0x117d00){_0x574f0a=_0x117d00;return db[_0xe0b0('0xbf')][_0xe0b0('0x6b')]({'where':{'id':_0x574f0a[_0xe0b0('0x9c')]}});}})[_0xe0b0('0x20')](function(_0x5aa313){if(_0x5aa313){_0x3f2ec=_0x5aa313;return db['CmContact'][_0xe0b0('0x6b')]({'where':{'id':_0x574f0a[_0xe0b0('0x74')]}});}})[_0xe0b0('0x20')](function(_0x3c93c6){if(_0x3c93c6){_0x108371=_0x3c93c6;if(_0x4f0db7){var _0x203351=null;for(var _0x343409=0x1;_0x343409<_0x574f0a[_0xe0b0('0xf1')]['length'];++_0x343409){_0x203351=_0x574f0a[_0xe0b0('0xf1')][_0x343409];var _0x2e7fe2=_0x203351[_0xe0b0('0x7a')]?util['format'](_0xe0b0('0xf2'),_0x3f2ec[_0xe0b0('0xf3')],_0x203351['UserId']):'System';var _0x3b3473=_0x1ccfc1['body'][_0xe0b0('0xf4')]||util['format'](_0xe0b0('0xf2'),_0xe0b0('0xf5'),_0x203351['ContactId']);switch(_0x3f2ec[_0xe0b0('0xf6')]){case _0xe0b0('0xf7'):_0x2e7fe2=_0x203351['UserId']?util[_0xe0b0('0xec')]('%s%d',_0x3f2ec[_0xe0b0('0xf3')],_0x203351[_0xe0b0('0x7a')]):_0xe0b0('0xf8');break;case _0xe0b0('0xf9'):_0x2e7fe2=_0x203351[_0xe0b0('0x7a')]?_0x203351[_0xe0b0('0x78')][_0xe0b0('0xfa')]||_0x203351['User'][_0xe0b0('0xc5')]:_0xe0b0('0xf8');break;case'agent_fullname':_0x2e7fe2=_0x203351['UserId']?_0x203351[_0xe0b0('0x78')]['fullname']:_0xe0b0('0xf8');break;default:_0x2e7fe2=_0x203351[_0xe0b0('0x7a')]?util[_0xe0b0('0xec')](_0xe0b0('0xf2'),_0x3f2ec[_0xe0b0('0xf3')],_0x203351[_0xe0b0('0x7a')]):_0xe0b0('0xf8');}var _0x8364b0=util[_0xe0b0('0xec')](_0xe0b0('0xfb'),moment(_0x203351[_0xe0b0('0x7e')])[_0xe0b0('0xec')](_0xe0b0('0xfc')),_0x203351[_0xe0b0('0xfd')]==='in'?_0x3b3473:_0x2e7fe2,_0x203351['body']);if(!_0x203351[_0xe0b0('0xfe')]){fs[_0xe0b0('0xff')](_0x4f0db7,_0x8364b0);}}return db[_0xe0b0('0x100')][_0xe0b0('0xc0')]({'where':{'service':!![]},'include':[{'model':db[_0xe0b0('0x101')],'as':'Smtp','raw':!![]}]});}}})[_0xe0b0('0x20')](function(_0x3a75d8){if(_0x3a75d8&&_0x3a75d8[_0xe0b0('0x102')]&&_0x1ccfc1[_0xe0b0('0x38')]){var _0x1e2ef8={'tls':{'rejectUnauthorized':![]}};if(_0x3a75d8[_0xe0b0('0x102')]['service']){_0x1e2ef8[_0xe0b0('0x103')]=_0x3a75d8['Smtp'][_0xe0b0('0x103')];}else{_0x1e2ef8[_0xe0b0('0x104')]=_0x3a75d8[_0xe0b0('0x102')][_0xe0b0('0x104')];_0x1e2ef8[_0xe0b0('0x105')]=_0x3a75d8[_0xe0b0('0x102')]['port'];_0x1e2ef8[_0xe0b0('0x106')]=_0x3a75d8[_0xe0b0('0x102')][_0xe0b0('0x106')];}if(_0x3a75d8[_0xe0b0('0x102')][_0xe0b0('0x107')]){_0x1e2ef8[_0xe0b0('0x108')]={'user':_0x3a75d8[_0xe0b0('0x102')][_0xe0b0('0x99')],'pass':_0x3a75d8['Smtp']['pass']};}return respondWithRpcPromise(_0xe0b0('0x109'),'sendMail',{'account':_0x1e2ef8,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x3a75d8['name'],_0x3a75d8[_0xe0b0('0xc6')]||_0x3a75d8['Smtp']['user']),'to':_0x1ccfc1[_0xe0b0('0x38')][_0xe0b0('0xea')],'subject':_0xe0b0('0x10a'),'text':util[_0xe0b0('0xec')](_0xe0b0('0x10b'),_0x1ccfc1[_0xe0b0('0x38')][_0xe0b0('0xea')]),'attachments':[{'path':_0x4f0db7}]}})[_0xe0b0('0x20')](function(){return _0x574f0a;})[_0xe0b0('0x27')](function(_0x43f1b1){console['error'](_0x43f1b1);});}else{return _0x574f0a;}})['then'](respondWithStatusCode(_0x2b1474,0xc8))[_0xe0b0('0x27')](handleError(_0x2b1474,null));};exports[_0xe0b0('0x10c')]=function(_0x2b8a03,_0x4f784a,_0x4b5a48){return db[_0xe0b0('0xf0')]['find']({'where':{'id':_0x2b8a03[_0xe0b0('0xb7')]['id']}})[_0xe0b0('0x20')](handleEntityNotFound(_0x4f784a,null))['then'](function(_0x2e393e){if(_0x2e393e){return _0x2e393e[_0xe0b0('0x10c')](_0x2b8a03[_0xe0b0('0x38')][_0xe0b0('0x10d')],_[_0xe0b0('0x10e')](_0x2b8a03[_0xe0b0('0x38')],[_0xe0b0('0x10d'),'id'])||{});}})['then'](respondWithResult(_0x4f784a,null))[_0xe0b0('0x27')](handleError(_0x4f784a,null));};exports[_0xe0b0('0x10f')]=function(_0x1f3162,_0x22da3a,_0x2b2c68){var _0x5c5c2d={'raw':![],'where':{}};var _0x4d6429={};var _0x322d1b={'count':0x0,'rows':[]};return db['ChatInteraction']['findOne']({'where':{'id':_0x1f3162[_0xe0b0('0xb7')]['id']}})['then'](handleEntityNotFound(_0x22da3a,null))[_0xe0b0('0x20')](function(_0x151da2){if(_0x151da2){_0x4d6429[_0xe0b0('0x4c')]=_[_0xe0b0('0x4a')](db['ChatMessage']['rawAttributes']);_0x4d6429[_0xe0b0('0x49')]=_[_0xe0b0('0x4a')](_0x1f3162[_0xe0b0('0x49')]);_0x4d6429[_0xe0b0('0xb8')]=_[_0xe0b0('0x4b')](_0x4d6429[_0xe0b0('0x4c')],_0x4d6429[_0xe0b0('0x49')]);_0x5c5c2d[_0xe0b0('0x4e')]=_['intersection'](_0x4d6429[_0xe0b0('0x4c')],qs[_0xe0b0('0x4d')](_0x1f3162[_0xe0b0('0x49')]['fields']));_0x5c5c2d[_0xe0b0('0x4e')]=_0x5c5c2d[_0xe0b0('0x4e')][_0xe0b0('0x4f')]?_0x5c5c2d[_0xe0b0('0x4e')]:_0x4d6429[_0xe0b0('0x4c')];if(!_0x1f3162[_0xe0b0('0x49')]['hasOwnProperty'](_0xe0b0('0x110'))){_0x5c5c2d[_0xe0b0('0x2e')]=qs[_0xe0b0('0x2e')](_0x1f3162['query'][_0xe0b0('0x2e')]);_0x5c5c2d[_0xe0b0('0x2c')]=qs[_0xe0b0('0x2c')](_0x1f3162[_0xe0b0('0x49')]['offset']);}_0x5c5c2d[_0xe0b0('0x51')]=qs[_0xe0b0('0x52')](_0x1f3162[_0xe0b0('0x49')][_0xe0b0('0x52')]);_0x5c5c2d[_0xe0b0('0x7c')]=qs[_0xe0b0('0xb8')](_[_0xe0b0('0x53')](_0x1f3162[_0xe0b0('0x49')],_0x4d6429['filters']));_0x5c5c2d[_0xe0b0('0x7c')]['ChatInteractionId']=_0x151da2['id'];if(_0x1f3162['query'][_0xe0b0('0x88')]){_0x5c5c2d[_0xe0b0('0x7c')]=_[_0xe0b0('0x37')](_0x5c5c2d['where'],{'$or':_[_0xe0b0('0x3d')](_0x5c5c2d['attributes'],function(_0xf0c217){var _0x4c5406={};_0x4c5406[_0xf0c217]={'$like':'%'+_0x1f3162['query']['filter']+'%'};return _0x4c5406;})});}if(_0x1f3162[_0xe0b0('0x49')][_0xe0b0('0x80')]){var _0x55e013=_0x1f3162[_0xe0b0('0x49')]['$gte']['split'](',');var _0x31fa9d={};_0x31fa9d[_0x55e013[0x0]]={'$gte':moment(_0x55e013[0x1])['format'](_0xe0b0('0x111'))};_0x5c5c2d[_0xe0b0('0x7c')]=_[_0xe0b0('0x37')](_0x5c5c2d[_0xe0b0('0x7c')],_0x31fa9d);}_0x5c5c2d=_['merge']({},_0x5c5c2d,_0x1f3162[_0xe0b0('0xbb')]);return db[_0xe0b0('0xf0')][_0xe0b0('0x2f')]({'where':_0x5c5c2d[_0xe0b0('0x7c')]})[_0xe0b0('0x20')](function(_0x51600e){_0x322d1b[_0xe0b0('0x2f')]=_0x51600e;if(_0x1f3162[_0xe0b0('0x49')]['includeAll']){_0x5c5c2d[_0xe0b0('0xba')]=[{'all':!![]}];}return db['ChatMessage'][_0xe0b0('0x112')](_0x5c5c2d);})[_0xe0b0('0x20')](function(_0x1e0374){_0x322d1b[_0xe0b0('0xb5')]=_0x1e0374;return _0x322d1b;});}})[_0xe0b0('0x20')](respondWithFilteredResult(_0x22da3a,_0x5c5c2d))[_0xe0b0('0x27')](handleError(_0x22da3a,null));};exports[_0xe0b0('0x113')]=function(_0x5b7b02,_0x565f67,_0x2853bf){var _0x4c0d9d={'where':{}},_0x38dd79={},_0x2dc446={'count':0x0,'rows':[]};return db[_0xe0b0('0x44')][_0xe0b0('0xc0')]({'where':{'id':_0x5b7b02[_0xe0b0('0xb7')]['id']}})[_0xe0b0('0x20')](handleEntityNotFound(_0x565f67,null))['then'](function(_0x5996a6){if(_0x5996a6){_0x38dd79[_0xe0b0('0x4c')]=_[_0xe0b0('0x4a')](db['ChatMessage'][_0xe0b0('0x45')]);_0x38dd79[_0xe0b0('0x49')]=_['keys'](_0x5b7b02[_0xe0b0('0x49')]);_0x38dd79[_0xe0b0('0xb8')]=_[_0xe0b0('0x4b')](_0x38dd79['model'],_0x38dd79[_0xe0b0('0x49')]);_0x4c0d9d[_0xe0b0('0x4e')]=_[_0xe0b0('0x4b')](_0x38dd79[_0xe0b0('0x4c')],qs['fields'](_0x5b7b02[_0xe0b0('0x49')]['fields']));_0x4c0d9d[_0xe0b0('0x4e')]=_0x4c0d9d[_0xe0b0('0x4e')][_0xe0b0('0x4f')]?_0x4c0d9d['attributes']:_0x38dd79[_0xe0b0('0x4c')];if(!_0x5b7b02[_0xe0b0('0x49')][_0xe0b0('0x50')](_0xe0b0('0x110'))){_0x4c0d9d['limit']=qs[_0xe0b0('0x2e')](_0x5b7b02[_0xe0b0('0x49')][_0xe0b0('0x2e')]);_0x4c0d9d[_0xe0b0('0x2c')]=qs[_0xe0b0('0x2c')](_0x5b7b02[_0xe0b0('0x49')]['offset']);}_0x4c0d9d['order']=qs['sort'](_0x5b7b02[_0xe0b0('0x49')]['sort']);_0x4c0d9d[_0xe0b0('0x7c')]=qs['filters'](_['pick'](_0x5b7b02[_0xe0b0('0x49')],_0x38dd79[_0xe0b0('0xb8')]));_0x4c0d9d[_0xe0b0('0x7c')][_0xe0b0('0xb3')]=_0x5996a6['id'];if(_0x5b7b02[_0xe0b0('0x49')][_0xe0b0('0x88')]){_0x4c0d9d[_0xe0b0('0x7c')]=_['merge'](_0x4c0d9d[_0xe0b0('0x7c')],{'$or':_[_0xe0b0('0x3d')](_0x4c0d9d[_0xe0b0('0x4e')],function(_0x15033e){var _0x14ba21={};_0x14ba21[_0x15033e]={'$like':'%'+_0x5b7b02[_0xe0b0('0x49')]['filter']+'%'};return _0x14ba21;})});}_0x4c0d9d['where'][_0xe0b0('0xfe')]=![];if(_0x5b7b02[_0xe0b0('0x49')]['id']){_0x4c0d9d[_0xe0b0('0x7c')]['id']={'$gt':_0x5b7b02[_0xe0b0('0x49')]['id']};}_0x4c0d9d=_[_0xe0b0('0x37')]({},_0x4c0d9d,_0x5b7b02[_0xe0b0('0xbb')]);return db[_0xe0b0('0xf0')]['count']({'where':_0x4c0d9d['where']})[_0xe0b0('0x20')](function(_0x16386b){_0x2dc446[_0xe0b0('0x2f')]=_0x16386b;_0x4c0d9d['include']=[];if(_0x5b7b02['query'][_0xe0b0('0x114')]){_0x4c0d9d[_0xe0b0('0xba')][_0xe0b0('0x42')]({'model':db[_0xe0b0('0x78')],'as':_0xe0b0('0x78'),'attributes':['id',_0xe0b0('0xc5'),_0xe0b0('0xfa')]});}if(_0x5b7b02[_0xe0b0('0x49')][_0xe0b0('0xb9')]){_0x4c0d9d[_0xe0b0('0xba')]=[{'all':!![]}];}return db['ChatMessage'][_0xe0b0('0x112')](_0x4c0d9d);})['then'](function(_0x2df3df){_0x2dc446['rows']=_0x2df3df;return _0x2dc446;});}})[_0xe0b0('0x20')](respondWithFilteredResult(_0x565f67,_0x4c0d9d))[_0xe0b0('0x27')](handleError(_0x565f67,null));};exports['addTags']=function(_0x236966,_0x41fd0e,_0x17e7d4){return db['ChatInteraction'][_0xe0b0('0x6b')]({'where':{'id':_0x236966[_0xe0b0('0xb7')]['id']}})['then'](handleEntityNotFound(_0x41fd0e,null))[_0xe0b0('0x20')](function(_0x19dafb){if(_0x19dafb){return _0x19dafb['setTags'](_0x236966['body'][_0xe0b0('0x10d')],_[_0xe0b0('0x10e')](_0x236966['body'],['ids','id'])||{})[_0xe0b0('0x115')](function(){return db['Tag'][_0xe0b0('0x112')]({'attributes':['id',_0xe0b0('0x48'),_0xe0b0('0x55')],'where':{'id':_0x236966[_0xe0b0('0x38')][_0xe0b0('0x10d')]}});})[_0xe0b0('0x20')](function(_0x36106e){socket['emit'](_0xe0b0('0x116'),{'id':Number(_0x236966['params']['id']),'tags':_0x36106e||[]});return{'id':Number(_0x236966['params']['id']),'tags':_0x36106e||[]};});}})['then'](respondWithResult(_0x41fd0e,null))[_0xe0b0('0x27')](handleError(_0x41fd0e,null));};exports[_0xe0b0('0x117')]=function(_0x263288,_0x7117ca,_0x21ccfe){return db['ChatInteraction']['find']({'where':{'id':_0x263288['params']['id']}})['then'](handleEntityNotFound(_0x7117ca,null))[_0xe0b0('0x20')](function(_0x1bd420){if(_0x1bd420){return _0x1bd420[_0xe0b0('0x117')](_0x263288['query'][_0xe0b0('0x10d')]);}})[_0xe0b0('0x20')](respondWithStatusCode(_0x7117ca,null))[_0xe0b0('0x27')](handleError(_0x7117ca,null));};exports[_0xe0b0('0xe8')]=function(_0x2d2852,_0x16a02b){var _0x125ead=moment()['unix']()[_0xe0b0('0x9e')]();var _0x380fe1=path[_0xe0b0('0xe5')](config[_0xe0b0('0xe6')],'server',_0xe0b0('0x118'),_0xe0b0('0x119'));var _0x3eb643=path[_0xe0b0('0xe5')](config['root'],'server',_0xe0b0('0x118'),_0xe0b0('0x11a'));var _0x26bd6c=path[_0xe0b0('0xe5')](_0x380fe1,_0x125ead);var _0x104409=util[_0xe0b0('0xec')]('transcript-%d-%s.zip',_0x2d2852[_0xe0b0('0xb7')]['id'],_0x125ead);var _0x6f9dbd=path[_0xe0b0('0xe5')](_0x380fe1,_0x104409);var _0x4c6646=[];_0x4c6646[_0xe0b0('0x42')]({'model':db['User'],'as':_0xe0b0('0x78'),'attributes':['id',_0xe0b0('0xc5')],'raw':!![]});_0x4c6646['push']({'model':db[_0xe0b0('0xd3')],'as':'Contact','attributes':['id','firstName',_0xe0b0('0x11b')],'raw':!![]});if(_0x2d2852['query']['attachments']){_0x4c6646['push']({'model':db[_0xe0b0('0xe1')],'as':_0xe0b0('0xe1'),'raw':!![]});}var _0x573ca9=[{'model':db[_0xe0b0('0xf0')],'as':'Messages','attributes':['id',_0xe0b0('0x38'),_0xe0b0('0x7e'),_0xe0b0('0xfd'),_0xe0b0('0xfe'),'read'],'include':_0x4c6646}];_0x573ca9['push']({'model':db['ChatWebsite'],'as':_0xe0b0('0x11c'),'attributes':['id',_0xe0b0('0x48')]});_0x573ca9['push']({'model':db['User'],'as':_0xe0b0('0x11d'),'attributes':['id',_0xe0b0('0xc5')]});return db[_0xe0b0('0x44')][_0xe0b0('0x6b')]({'where':{'id':_0x2d2852['params']['id']},'include':_0x573ca9})['then'](handleEntityNotFound(_0x16a02b,null))[_0xe0b0('0x20')](function(_0x329684){if(_0x329684){var _0x5b1bb7=_0x329684[_0xe0b0('0x11e')]({'plain':!![]});fs[_0xe0b0('0x11f')](_0x26bd6c);var _0x5b7df1={'channel':'Chat','account':_0x5b1bb7['Account'][_0xe0b0('0x48')],'agent':_0x5b1bb7[_0xe0b0('0x11d')]?_0x5b1bb7['Owner'][_0xe0b0('0xc5')]:_0xe0b0('0x120'),'createdAt':moment(_0x5b1bb7[_0xe0b0('0x7e')])[_0xe0b0('0xec')]('YYYY-MM-DD\x20HH:mm:ss')[_0xe0b0('0x9e')](),'closedAt':_0x5b1bb7[_0xe0b0('0xd9')]?moment(_0x5b1bb7['closedAt'])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xe0b0('0x9e')]():'','disposition':_0x5b1bb7['disposition'],'chatInfo':{'browser':_0x5b1bb7[_0xe0b0('0x121')],'os':_0x5b1bb7['osName'],'referer':_0x5b1bb7['referer'],'customerIp':_0x5b1bb7[_0xe0b0('0x122')],'customerPort':_0x5b1bb7[_0xe0b0('0x123')]?_0x5b1bb7[_0xe0b0('0x123')]:_0xe0b0('0x120')},'messages':_(_0x5b1bb7['Messages'])['tail']()['filter']({'secret':![]})['map'](function(_0x26a916){if(_0x26a916[_0xe0b0('0xe1')]){var _0x5b5bb2=path['join'](_0x3eb643,_0x26a916[_0xe0b0('0xe1')][_0xe0b0('0xdf')]);if(fs['existsSync'](_0x5b5bb2)){fs[_0xe0b0('0x124')](_0x5b5bb2)[_0xe0b0('0x125')](fs[_0xe0b0('0x126')](path[_0xe0b0('0xe5')](_0x26bd6c,_0x26a916['Attachment'][_0xe0b0('0xdf')])));}}return{'date':moment(_0x26a916[_0xe0b0('0x7e')])[_0xe0b0('0xec')]('YYYY-MM-DD\x20HH:mm:ss')[_0xe0b0('0x9e')](),'sender':_0x26a916[_0xe0b0('0xfd')]===_0xe0b0('0xd0')?_0x26a916[_0xe0b0('0x78')]?_0x26a916['User'][_0xe0b0('0xc5')]:_0xe0b0('0xf8'):_0x26a916[_0xe0b0('0xd4')][_0xe0b0('0x127')]+(_0x26a916[_0xe0b0('0xd4')]['lastName']?'\x20'+_0x26a916[_0xe0b0('0xd4')][_0xe0b0('0x11b')]:''),'body':_0x26a916['Attachment']?_0x26a916[_0xe0b0('0xe1')][_0xe0b0('0xdf')]:_0x26a916[_0xe0b0('0x38')],'direction':_0x26a916[_0xe0b0('0xfd')]===_0xe0b0('0xd0')?'A':'C','secret':_0x26a916[_0xe0b0('0xfe')],'read':_0x26a916['read'],'attachment':_0x26a916[_0xe0b0('0xe1')]};})[_0xe0b0('0x6d')]()};return ejs[_0xe0b0('0x128')](path[_0xe0b0('0xe5')](config[_0xe0b0('0xe6')],_0xe0b0('0x129'),_0xe0b0('0x12a'),_0xe0b0('0x12b')),{'interaction':_0x5b7df1})[_0xe0b0('0x20')](function(_0x1f5871){var _0x4d12b2=path[_0xe0b0('0xe5')](_0x26bd6c,'transcript-'+_0x5b1bb7['id']+'-'+_0x125ead+_0xe0b0('0x12c'));var _0x4b655d={'path':_0x4d12b2,'channel':'Chat','interactionId':_0x5b1bb7['id']};return pdf[_0xe0b0('0x12d')](_0x1f5871,_0x4b655d);})[_0xe0b0('0x20')](function(){return new BPromise(function(_0x5b8cef,_0x4d4eae){zipdir(_0x26bd6c,{'saveTo':_0x6f9dbd},function(_0x388f0d,_0x317dee){if(_0x388f0d)return _0x4d4eae(_0x388f0d);return _0x5b8cef(_0x317dee);});})['then'](function(){return new BPromise(function(_0x5501c2,_0xa7f2cf){rimraf(_0x26bd6c,function(_0x2c61b3){if(_0x2c61b3)_0xa7f2cf(_0x2c61b3);return _0x5501c2();});});})['then'](function(){return _0x16a02b[_0xe0b0('0xe8')](_0x6f9dbd,_0x104409,function(_0x465315){if(_0x465315){console[_0xe0b0('0x12e')](_0xe0b0('0x12f'),_0x465315);}else{fs['unlinkSync'](_0x6f9dbd);}});});});}else{return _0x16a02b[_0xe0b0('0x28')](0xc8);}})[_0xe0b0('0x27')](handleError(_0x16a02b,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 24279b3..d2c0006 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 _0x09c1=['Users','map','findAll','setDataValue','unreadMessages','length','emit','hasOwnProperty','hook','exports','events','ChatInteraction','../../mysqldb','ChatMessage','update','then'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0x09c1,0xaa));var _0x109c=function(_0x16697e,_0x112bf8){_0x16697e=_0x16697e-0x0;var _0x218ede=_0x09c1[_0x16697e];return _0x218ede;};'use strict';var EventEmitter=require(_0x109c('0x0'));var ChatInteraction=require('../../mysqldb')['db'][_0x109c('0x1')];var ChatMessage=require(_0x109c('0x2'))['db'][_0x109c('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x109c('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5c3d73){return function(_0x316ea5,_0xfbc621,_0x264197){_0x316ea5['getUsers']({'attributes':['id'],'raw':!![]})[_0x109c('0x5')](function(_0x354452){_0x316ea5['setDataValue'](_0x109c('0x6'),_0x354452[_0x109c('0x7')](function(_0x34208b){return{'id':_0x34208b['id']};}));return ChatMessage[_0x109c('0x8')]({'where':{'ChatInteractionId':_0x316ea5['id'],'direction':'in','read':![]},'raw':!![]});})[_0x109c('0x5')](function(_0x4191fd){_0x316ea5[_0x109c('0x9')](_0x109c('0xa'),_0x4191fd[_0x109c('0xb')]);ChatInteractionEvents[_0x109c('0xc')](_0x5c3d73+':'+_0x316ea5['id'],_0x316ea5);ChatInteractionEvents['emit'](_0x5c3d73,_0x316ea5);_0x264197(null);})['catch'](_0x264197(null));};}for(var e in events){if(events[_0x109c('0xd')](e)){var event=events[e];ChatInteraction[_0x109c('0xe')](e,emitEvent(event));}}module[_0x109c('0xf')]=ChatInteractionEvents; \ No newline at end of file +var _0x4804=['save','update','remove','then','setDataValue','Users','unreadMessages','length','emit','catch','hasOwnProperty','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners'];(function(_0x8e74c4,_0x4c3b72){var _0x50e53f=function(_0x2a4eef){while(--_0x2a4eef){_0x8e74c4['push'](_0x8e74c4['shift']());}};_0x50e53f(++_0x4c3b72);}(_0x4804,0x15b));var _0x4480=function(_0x531598,_0x3db452){_0x531598=_0x531598-0x0;var _0x47be54=_0x4804[_0x531598];return _0x47be54;};'use strict';var EventEmitter=require(_0x4480('0x0'));var ChatInteraction=require(_0x4480('0x1'))['db'][_0x4480('0x2')];var ChatMessage=require('../../mysqldb')['db'][_0x4480('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x4480('0x4')](0x0);var events={'afterCreate':_0x4480('0x5'),'afterUpdate':_0x4480('0x6'),'afterDestroy':_0x4480('0x7')};function emitEvent(_0x386300){return function(_0x5ad808,_0x8a023e,_0x16e840){_0x5ad808['getUsers']({'attributes':['id'],'raw':!![]})[_0x4480('0x8')](function(_0x1d8d1c){_0x5ad808[_0x4480('0x9')](_0x4480('0xa'),_0x1d8d1c['map'](function(_0x5508c7){return{'id':_0x5508c7['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x5ad808['id'],'direction':'in','read':![]},'raw':!![]});})[_0x4480('0x8')](function(_0x2587c3){_0x5ad808[_0x4480('0x9')](_0x4480('0xb'),_0x2587c3[_0x4480('0xc')]);ChatInteractionEvents[_0x4480('0xd')](_0x386300+':'+_0x5ad808['id'],_0x5ad808);ChatInteractionEvents[_0x4480('0xd')](_0x386300,_0x5ad808);_0x16e840(null);})[_0x4480('0xe')](_0x16e840(null));};}for(var e in events){if(events[_0x4480('0xf')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module['exports']=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index 4aa2d16..2b15116 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 _0xc744=['closed','closedAt','format','utf8mb4','util','../../config/logger','api','moment','request-promise','path','rimraf','./chatInteraction.attributes','exports','changed'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc744,0x66));var _0x4c74=function(_0x35b976,_0x289a1a){_0x35b976=_0x35b976-0x0;var _0x56565f=_0xc744[_0x35b976];return _0x56565f;};'use strict';var _=require('lodash');var util=require(_0x4c74('0x0'));var logger=require(_0x4c74('0x1'))(_0x4c74('0x2'));var moment=require(_0x4c74('0x3'));var BPromise=require('bluebird');var rp=require(_0x4c74('0x4'));var fs=require('fs');var path=require(_0x4c74('0x5'));var rimraf=require(_0x4c74('0x6'));var config=require('../../config/environment');var attributes=require(_0x4c74('0x7'));module[_0x4c74('0x8')]=function(_0xb6b5b7,_0x2fe406){return _0xb6b5b7['define']('ChatInteraction',attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1b9113,_0x2fd749,_0x2d23a0){if(_0x1b9113[_0x4c74('0x9')](_0x4c74('0xa'))){_0x1b9113[_0x4c74('0xb')]=moment()[_0x4c74('0xc')]('YYYY-MM-DD\x20HH:mm:ss');}_0x2d23a0(null,_0x1b9113);}},'charset':_0x4c74('0xd'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xd0d2=['utf8mb4_unicode_ci','lodash','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','ChatInteraction','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x5ad781,_0x27573a){var _0x82d137=function(_0x4369e2){while(--_0x4369e2){_0x5ad781['push'](_0x5ad781['shift']());}};_0x82d137(++_0x27573a);}(_0xd0d2,0x191));var _0x2d0d=function(_0x585e84,_0x1d8489){_0x585e84=_0x585e84-0x0;var _0x39f3c4=_0xd0d2[_0x585e84];return _0x39f3c4;};'use strict';var _=require(_0x2d0d('0x0'));var util=require(_0x2d0d('0x1'));var logger=require(_0x2d0d('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2d0d('0x3'));var fs=require('fs');var path=require(_0x2d0d('0x4'));var rimraf=require(_0x2d0d('0x5'));var config=require(_0x2d0d('0x6'));var attributes=require(_0x2d0d('0x7'));module[_0x2d0d('0x8')]=function(_0x50e279,_0xa3fc37){return _0x50e279['define'](_0x2d0d('0x9'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3eb451,_0x5875a8,_0x3163e6){if(_0x3eb451[_0x2d0d('0xa')](_0x2d0d('0xb'))){_0x3eb451[_0x2d0d('0xc')]=moment()[_0x2d0d('0xd')](_0x2d0d('0xe'));}_0x3163e6(null,_0x3eb451);}},'charset':'utf8mb4','collate':_0x2d0d('0xf')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index a77797a..180c7bc 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 _0xb89f=['AddTags','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','./chatInteraction.socket','register','then','info','ChatInteraction,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','UpdateChatInteraction','ChatInteraction','update','body','options','where','limit','debug','find','addTags','ids','omit','spread'];(function(_0x10197a,_0x5b7bb6){var _0x11ad2b=function(_0x5b8bc9){while(--_0x5b8bc9){_0x10197a['push'](_0x10197a['shift']());}};_0x11ad2b(++_0x5b7bb6);}(_0xb89f,0x99));var _0xfb89=function(_0x57e8e1,_0x22396f){_0x57e8e1=_0x57e8e1-0x0;var _0x3b4664=_0xb89f[_0x57e8e1];return _0x3b4664;};'use strict';var _=require('lodash');var util=require(_0xfb89('0x0'));var moment=require('moment');var BPromise=require(_0xfb89('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfb89('0x2'));var db=require(_0xfb89('0x3'))['db'];var utils=require(_0xfb89('0x4'));var logger=require(_0xfb89('0x5'))(_0xfb89('0x6'));var config=require(_0xfb89('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xfb89('0x8')][_0xfb89('0x9')]({'port':0x232a});config[_0xfb89('0xa')]=_[_0xfb89('0xb')](config[_0xfb89('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xfb89('0xc'))(new Redis(config['redis']));require(_0xfb89('0xd'))[_0xfb89('0xe')](socket);function respondWithRpcPromise(_0x13deca,_0x693471,_0x2eab02){return new BPromise(function(_0x1a780c,_0x3046a7){return client['request'](_0x13deca,_0x2eab02)[_0xfb89('0xf')](function(_0x2f4007){logger[_0xfb89('0x10')](_0xfb89('0x11'),_0x693471,'request\x20sent');logger['debug']('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x693471,'request\x20sent',JSON[_0xfb89('0x12')](_0x2f4007));if(_0x2f4007['error']){if(_0x2f4007[_0xfb89('0x13')]['code']===0x1f4){logger['error'](_0xfb89('0x11'),_0x693471,_0x2f4007[_0xfb89('0x13')][_0xfb89('0x14')]);return _0x3046a7(_0x2f4007[_0xfb89('0x13')]['message']);}logger[_0xfb89('0x13')](_0xfb89('0x11'),_0x693471,_0x2f4007[_0xfb89('0x13')][_0xfb89('0x14')]);return _0x1a780c(_0x2f4007[_0xfb89('0x13')][_0xfb89('0x14')]);}else{logger[_0xfb89('0x10')]('ChatInteraction,\x20%s,\x20%s',_0x693471,_0xfb89('0x15'));_0x1a780c(_0x2f4007[_0xfb89('0x16')][_0xfb89('0x14')]);}})[_0xfb89('0x17')](function(_0xf57a67){logger[_0xfb89('0x13')](_0xfb89('0x11'),_0x693471,_0xf57a67);_0x3046a7(_0xf57a67);});});}exports[_0xfb89('0x18')]=function(_0x59e956){var _0x3dd0d6=this;return new Promise(function(_0x3bf4c0,_0x271c98){return db[_0xfb89('0x19')][_0xfb89('0x1a')](_0x59e956[_0xfb89('0x1b')],{'raw':_0x59e956['options']?_0x59e956[_0xfb89('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x59e956[_0xfb89('0x1c')]?_0x59e956[_0xfb89('0x1c')][_0xfb89('0x1d')]||null:null,'attributes':_0x59e956[_0xfb89('0x1c')]?_0x59e956[_0xfb89('0x1c')]['attributes']||null:null,'limit':_0x59e956[_0xfb89('0x1c')]?_0x59e956[_0xfb89('0x1c')][_0xfb89('0x1e')]||null:null})[_0xfb89('0xf')](function(_0x196e18){logger[_0xfb89('0x10')](_0xfb89('0x18'),_0x59e956);logger[_0xfb89('0x1f')](_0xfb89('0x18'),_0x59e956,JSON[_0xfb89('0x12')](_0x196e18));_0x3bf4c0(_0x196e18);})[_0xfb89('0x17')](function(_0x2149cc){logger['error'](_0xfb89('0x18'),_0x2149cc[_0xfb89('0x14')],_0x59e956);_0x271c98(_0x3dd0d6[_0xfb89('0x13')](0x1f4,_0x2149cc[_0xfb89('0x14')]));});});};exports['AddTagsToChatInteraction']=function(_0x5dd2ba){return new Promise(function(_0x5544bb,_0x449acf){return db[_0xfb89('0x19')][_0xfb89('0x20')]({'where':_0x5dd2ba['options']?_0x5dd2ba[_0xfb89('0x1c')][_0xfb89('0x1d')]||null:null})['then'](function(_0x490e91){if(_0x490e91){return _0x490e91[_0xfb89('0x21')](_0x5dd2ba['body'][_0xfb89('0x22')],_[_0xfb89('0x23')](_0x5dd2ba[_0xfb89('0x1b')],[_0xfb89('0x22'),'id'])||{});}})[_0xfb89('0x24')](function(_0x532375){logger[_0xfb89('0x10')](_0xfb89('0x25'),_0x5dd2ba);logger['debug'](_0xfb89('0x25'),_0x5dd2ba,JSON[_0xfb89('0x12')](_0x532375));_0x5544bb(_0x532375);})['catch'](function(_0x53d614){logger['error'](_0xfb89('0x25'),_0x53d614['message'],_0x5dd2ba);_0x449acf(_this['error'](0x1f4,_0x53d614[_0xfb89('0x14')]));});});}; \ No newline at end of file +var _0x062b=['catch','ChatInteraction','addTags','body','ids','omit','spread','AddTags','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','./chatInteraction.socket','register','request','then','ChatInteraction,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','result','UpdateChatInteraction','update','options','raw','where','attributes','limit'];(function(_0x1b6311,_0x42ec20){var _0x25aab6=function(_0x139a77){while(--_0x139a77){_0x1b6311['push'](_0x1b6311['shift']());}};_0x25aab6(++_0x42ec20);}(_0x062b,0xdf));var _0xb062=function(_0x62628,_0x35b586){_0x62628=_0x62628-0x0;var _0x50c4f4=_0x062b[_0x62628];return _0x50c4f4;};'use strict';var _=require(_0xb062('0x0'));var util=require(_0xb062('0x1'));var moment=require(_0xb062('0x2'));var BPromise=require('bluebird');var rs=require(_0xb062('0x3'));var fs=require('fs');var Redis=require(_0xb062('0x4'));var db=require(_0xb062('0x5'))['db'];var utils=require(_0xb062('0x6'));var logger=require(_0xb062('0x7'))(_0xb062('0x8'));var config=require(_0xb062('0x9'));var jayson=require(_0xb062('0xa'));var client=jayson[_0xb062('0xb')][_0xb062('0xc')]({'port':0x232a});config[_0xb062('0xd')]=_[_0xb062('0xe')](config[_0xb062('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb062('0xd')]));require(_0xb062('0xf'))[_0xb062('0x10')](socket);function respondWithRpcPromise(_0x52f824,_0x26b15f,_0x298a4b){return new BPromise(function(_0x30719a,_0x516d96){return client[_0xb062('0x11')](_0x52f824,_0x298a4b)[_0xb062('0x12')](function(_0x5ae9c8){logger['info'](_0xb062('0x13'),_0x26b15f,'request\x20sent');logger[_0xb062('0x14')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x26b15f,_0xb062('0x15'),JSON[_0xb062('0x16')](_0x5ae9c8));if(_0x5ae9c8[_0xb062('0x17')]){if(_0x5ae9c8[_0xb062('0x17')][_0xb062('0x18')]===0x1f4){logger[_0xb062('0x17')](_0xb062('0x13'),_0x26b15f,_0x5ae9c8[_0xb062('0x17')][_0xb062('0x19')]);return _0x516d96(_0x5ae9c8['error'][_0xb062('0x19')]);}logger[_0xb062('0x17')]('ChatInteraction,\x20%s,\x20%s',_0x26b15f,_0x5ae9c8[_0xb062('0x17')]['message']);return _0x30719a(_0x5ae9c8[_0xb062('0x17')][_0xb062('0x19')]);}else{logger[_0xb062('0x1a')](_0xb062('0x13'),_0x26b15f,'request\x20sent');_0x30719a(_0x5ae9c8[_0xb062('0x1b')][_0xb062('0x19')]);}})['catch'](function(_0x2501ca){logger[_0xb062('0x17')](_0xb062('0x13'),_0x26b15f,_0x2501ca);_0x516d96(_0x2501ca);});});}exports[_0xb062('0x1c')]=function(_0x9a68f0){var _0x3eb4ad=this;return new Promise(function(_0x3c3356,_0x496f7f){return db['ChatInteraction'][_0xb062('0x1d')](_0x9a68f0['body'],{'raw':_0x9a68f0[_0xb062('0x1e')]?_0x9a68f0[_0xb062('0x1e')][_0xb062('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x9a68f0[_0xb062('0x1e')]?_0x9a68f0[_0xb062('0x1e')][_0xb062('0x20')]||null:null,'attributes':_0x9a68f0[_0xb062('0x1e')]?_0x9a68f0[_0xb062('0x1e')][_0xb062('0x21')]||null:null,'limit':_0x9a68f0[_0xb062('0x1e')]?_0x9a68f0['options'][_0xb062('0x22')]||null:null})[_0xb062('0x12')](function(_0x7bc93a){logger['info'](_0xb062('0x1c'),_0x9a68f0);logger['debug'](_0xb062('0x1c'),_0x9a68f0,JSON['stringify'](_0x7bc93a));_0x3c3356(_0x7bc93a);})[_0xb062('0x23')](function(_0x480b83){logger[_0xb062('0x17')](_0xb062('0x1c'),_0x480b83[_0xb062('0x19')],_0x9a68f0);_0x496f7f(_0x3eb4ad[_0xb062('0x17')](0x1f4,_0x480b83[_0xb062('0x19')]));});});};exports['AddTagsToChatInteraction']=function(_0x460a96){return new Promise(function(_0x2acca0,_0x23c8e9){return db[_0xb062('0x24')]['find']({'where':_0x460a96[_0xb062('0x1e')]?_0x460a96[_0xb062('0x1e')][_0xb062('0x20')]||null:null})[_0xb062('0x12')](function(_0x2ba9f0){if(_0x2ba9f0){return _0x2ba9f0[_0xb062('0x25')](_0x460a96[_0xb062('0x26')][_0xb062('0x27')],_[_0xb062('0x28')](_0x460a96[_0xb062('0x26')],[_0xb062('0x27'),'id'])||{});}})[_0xb062('0x29')](function(_0x4a0783){logger[_0xb062('0x1a')](_0xb062('0x2a'),_0x460a96);logger[_0xb062('0x14')](_0xb062('0x2a'),_0x460a96,JSON[_0xb062('0x16')](_0x4a0783));_0x2acca0(_0x4a0783);})[_0xb062('0x23')](function(_0xca353d){logger[_0xb062('0x17')](_0xb062('0x2a'),_0xca353d[_0xb062('0x19')],_0x460a96);_0x23c8e9(_this['error'](0x1f4,_0xca353d[_0xb062('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index 76da22c..b437a39 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 _0xe889=['save','update','emit','removeListener','./chatInteraction.events'];(function(_0x1b7a3f,_0x212a5c){var _0x56dee8=function(_0x451ed4){while(--_0x451ed4){_0x1b7a3f['push'](_0x1b7a3f['shift']());}};_0x56dee8(++_0x212a5c);}(_0xe889,0xd6));var _0x9e88=function(_0x53bfae,_0x5c9342){_0x53bfae=_0x53bfae-0x0;var _0x294798=_0xe889[_0x53bfae];return _0x294798;};'use strict';var ChatInteractionEvents=require(_0x9e88('0x0'));var events=[_0x9e88('0x1'),'remove',_0x9e88('0x2')];function createListener(_0x73fd17,_0x12a2c9){return function(_0x24cdc5){_0x12a2c9[_0x9e88('0x3')](_0x73fd17,_0x24cdc5);};}function removeListener(_0x5012c5,_0x59d809){return function(){ChatInteractionEvents[_0x9e88('0x4')](_0x5012c5,_0x59d809);};}exports['register']=function(_0x576de6){for(var _0x2d3347=0x0,_0x3a0b5d=events['length'];_0x2d3347<_0x3a0b5d;_0x2d3347++){var _0x2a9cf8=events[_0x2d3347];var _0x3929aa=createListener('chatInteraction:'+_0x2a9cf8,_0x576de6);ChatInteractionEvents['on'](_0x2a9cf8,_0x3929aa);}}; \ No newline at end of file +var _0xc86c=['removeListener','chatInteraction:','./chatInteraction.events','save','emit'];(function(_0x20634c,_0x5534fc){var _0x5d8936=function(_0x6b45f2){while(--_0x6b45f2){_0x20634c['push'](_0x20634c['shift']());}};_0x5d8936(++_0x5534fc);}(_0xc86c,0x138));var _0xcc86=function(_0x42e03b,_0x110aea){_0x42e03b=_0x42e03b-0x0;var _0x3ba84b=_0xc86c[_0x42e03b];return _0x3ba84b;};'use strict';var ChatInteractionEvents=require(_0xcc86('0x0'));var events=[_0xcc86('0x1'),'remove','update'];function createListener(_0x3012b1,_0x3c4260){return function(_0x14639c){_0x3c4260[_0xcc86('0x2')](_0x3012b1,_0x14639c);};}function removeListener(_0x4ee129,_0x5d41db){return function(){ChatInteractionEvents[_0xcc86('0x3')](_0x4ee129,_0x5d41db);};}exports['register']=function(_0x55c925){for(var _0x1f39c4=0x0,_0x501fca=events['length'];_0x1f39c4<_0x501fca;_0x1f39c4++){var _0x2d301a=events[_0x1f39c4];var _0x2b08dd=createListener(_0xcc86('0x4')+_0x2d301a,_0x55c925);ChatInteractionEvents['on'](_0x2d301a,_0x2b08dd);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index 3d47b6d..8ff7c7c 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 _0x530e=['put','chatinteraction:update','update','customUpdate','/:id/abandon','abandon','/:id/close','close','/:id','delete','removeTags','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/describe','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','getMyMessages','/:id/download','download','post','create','join','root','server/files/attachments/','now','originalname','replace','/:id/attachment_upload','single','file','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags'];(function(_0x16b4eb,_0x583bdd){var _0xeb3035=function(_0x1d50b5){while(--_0x1d50b5){_0x16b4eb['push'](_0x16b4eb['shift']());}};_0xeb3035(++_0x583bdd);}(_0x530e,0x106));var _0xe530=function(_0x1c97a8,_0x55c4ca){_0x1c97a8=_0x1c97a8-0x0;var _0x21b006=_0x530e[_0x1c97a8];return _0x21b006;};'use strict';var multer=require(_0xe530('0x0'));var util=require(_0xe530('0x1'));var path=require('path');var timeout=require(_0xe530('0x2'));var express=require(_0xe530('0x3'));var router=express[_0xe530('0x4')]();var fs_extra=require(_0xe530('0x5'));var auth=require(_0xe530('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xe530('0x7'));var controller=require(_0xe530('0x8'));router[_0xe530('0x9')]('/',auth[_0xe530('0xa')](),controller[_0xe530('0xb')]);router[_0xe530('0x9')](_0xe530('0xc'),auth[_0xe530('0xa')](),controller['describe']);router[_0xe530('0x9')]('/:id',auth[_0xe530('0xd')](),controller[_0xe530('0xe')]);router['get'](_0xe530('0xf'),auth['isChatInteractionAuthorized'](),controller[_0xe530('0x10')]);router[_0xe530('0x9')](_0xe530('0x11'),auth[_0xe530('0xa')](),controller[_0xe530('0x12')]);router['get']('/:id/my_messages',auth['isChatInteractionAuthorized'](),controller[_0xe530('0x13')]);router['get'](_0xe530('0x14'),auth[_0xe530('0xa')](),controller[_0xe530('0x15')]);router[_0xe530('0x16')]('/',auth[_0xe530('0xa')](),controller[_0xe530('0x17')]);router[_0xe530('0x16')]('/:id/vidaoo',auth[_0xe530('0xa')](),controller['createVidaooSession']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xc9d75c,_0x9029d1,_0x540aff){_0x540aff(null,path[_0xe530('0x18')](config[_0xe530('0x19')],_0xe530('0x1a')));},'filename':function(_0x5d2236,_0x2f69a1,_0x42a7ac){_0x42a7ac(null,util['format']('%s-%s',Date[_0xe530('0x1b')](),_0x2f69a1[_0xe530('0x1c')][_0xe530('0x1d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xe530('0x16')](_0xe530('0x1e'),upload[_0xe530('0x1f')](_0xe530('0x20')),controller['attachmentUpload']);router[_0xe530('0x16')](_0xe530('0x11'),auth['isChatInteractionAuthorized'](),controller[_0xe530('0x21')]);router['post'](_0xe530('0x22'),auth[_0xe530('0xa')](),interaction[_0xe530('0x23')](_0xe530('0x24'),_0xe530('0x25')),controller['addTags']);router[_0xe530('0x26')]('/:id',auth[_0xe530('0xa')](),interaction[_0xe530('0x23')](_0xe530('0x24'),_0xe530('0x27')),controller[_0xe530('0x28')]);router[_0xe530('0x26')]('/:id/custom_update',controller[_0xe530('0x29')]);router[_0xe530('0x26')](_0xe530('0x2a'),auth[_0xe530('0xd')](),controller[_0xe530('0x2b')]);router['put'](_0xe530('0x2c'),controller[_0xe530('0x2d')]);router['delete'](_0xe530('0x2e'),auth[_0xe530('0xa')](),interaction[_0xe530('0x23')](_0xe530('0x24'),'chatinteraction:destroy'),controller['destroy']);router[_0xe530('0x2f')](_0xe530('0x22'),auth[_0xe530('0xa')](),controller[_0xe530('0x30')]);module[_0xe530('0x31')]=router; \ No newline at end of file +var _0xcaab=['diskStorage','join','root','server/files/attachments/','%s-%s','now','originalname','replace','/:id/attachment_upload','single','file','attachmentUpload','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','chatinteraction:update','update','put','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/attachment_download','isChatInteractionAuthorized','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','create','post','/:id/vidaoo','createVidaooSession'];(function(_0x344d0a,_0x32bb71){var _0x58a652=function(_0xcda1a7){while(--_0xcda1a7){_0x344d0a['push'](_0x344d0a['shift']());}};_0x58a652(++_0x32bb71);}(_0xcaab,0x10b));var _0xbcaa=function(_0x3f30a5,_0x180083){_0x3f30a5=_0x3f30a5-0x0;var _0x18d972=_0xcaab[_0x3f30a5];return _0x18d972;};'use strict';var multer=require(_0xbcaa('0x0'));var util=require('util');var path=require(_0xbcaa('0x1'));var timeout=require('connect-timeout');var express=require(_0xbcaa('0x2'));var router=express[_0xbcaa('0x3')]();var fs_extra=require(_0xbcaa('0x4'));var auth=require(_0xbcaa('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xbcaa('0x6'));var controller=require(_0xbcaa('0x7'));router[_0xbcaa('0x8')]('/',auth[_0xbcaa('0x9')](),controller[_0xbcaa('0xa')]);router['get'](_0xbcaa('0xb'),auth[_0xbcaa('0x9')](),controller[_0xbcaa('0xc')]);router[_0xbcaa('0x8')](_0xbcaa('0xd'),auth['isChatInteractionAuthorized'](),controller[_0xbcaa('0xe')]);router[_0xbcaa('0x8')](_0xbcaa('0xf'),auth[_0xbcaa('0x10')](),controller[_0xbcaa('0x11')]);router[_0xbcaa('0x8')](_0xbcaa('0x12'),auth['isAuthenticated'](),controller[_0xbcaa('0x13')]);router[_0xbcaa('0x8')](_0xbcaa('0x14'),auth[_0xbcaa('0x10')](),controller[_0xbcaa('0x15')]);router[_0xbcaa('0x8')](_0xbcaa('0x16'),auth[_0xbcaa('0x9')](),controller[_0xbcaa('0x17')]);router['post']('/',auth[_0xbcaa('0x9')](),controller[_0xbcaa('0x18')]);router[_0xbcaa('0x19')](_0xbcaa('0x1a'),auth[_0xbcaa('0x9')](),controller[_0xbcaa('0x1b')]);var upload=multer({'storage':multer[_0xbcaa('0x1c')]({'destination':function(_0x1d7ddd,_0x486a75,_0x1377be){_0x1377be(null,path[_0xbcaa('0x1d')](config[_0xbcaa('0x1e')],_0xbcaa('0x1f')));},'filename':function(_0x437c8c,_0x43379e,_0x5b1613){_0x5b1613(null,util['format'](_0xbcaa('0x20'),Date[_0xbcaa('0x21')](),_0x43379e[_0xbcaa('0x22')][_0xbcaa('0x23')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0xbcaa('0x24'),upload[_0xbcaa('0x25')](_0xbcaa('0x26')),controller[_0xbcaa('0x27')]);router[_0xbcaa('0x19')](_0xbcaa('0x12'),auth[_0xbcaa('0x10')](),controller[_0xbcaa('0x28')]);router['post'](_0xbcaa('0x29'),auth[_0xbcaa('0x9')](),interaction[_0xbcaa('0x2a')](_0xbcaa('0x2b'),_0xbcaa('0x2c')),controller[_0xbcaa('0x2d')]);router['put'](_0xbcaa('0xd'),auth[_0xbcaa('0x9')](),interaction[_0xbcaa('0x2a')](_0xbcaa('0x2b'),_0xbcaa('0x2e')),controller[_0xbcaa('0x2f')]);router[_0xbcaa('0x30')](_0xbcaa('0x31'),controller[_0xbcaa('0x32')]);router[_0xbcaa('0x30')](_0xbcaa('0x33'),auth[_0xbcaa('0x10')](),controller[_0xbcaa('0x34')]);router[_0xbcaa('0x30')](_0xbcaa('0x35'),controller[_0xbcaa('0x36')]);router[_0xbcaa('0x37')]('/:id',auth[_0xbcaa('0x9')](),interaction['tracked']('chat',_0xbcaa('0x38')),controller[_0xbcaa('0x39')]);router[_0xbcaa('0x37')](_0xbcaa('0x29'),auth[_0xbcaa('0x9')](),controller['removeTags']);module[_0xbcaa('0x3a')]=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index f7e100c..6a744ea 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 _0xbad0=['BOOLEAN','exports','TEXT'];(function(_0x57d93d,_0x3e393b){var _0x25cb7d=function(_0x4be5e1){while(--_0x4be5e1){_0x57d93d['push'](_0x57d93d['shift']());}};_0x25cb7d(++_0x3e393b);}(_0xbad0,0x18a));var _0x0bad=function(_0x27671e,_0x351e75){_0x27671e=_0x27671e-0x0;var _0x20f949=_0xbad0[_0x27671e];return _0x20f949;};'use strict';var Sequelize=require('sequelize');module[_0x0bad('0x0')]={'body':{'type':Sequelize[_0x0bad('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x0bad('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x1a3b=['sequelize','TEXT','BOOLEAN','INTEGER'];(function(_0x3fb392,_0x4259ad){var _0x49b16e=function(_0x5aec73){while(--_0x5aec73){_0x3fb392['push'](_0x3fb392['shift']());}};_0x49b16e(++_0x4259ad);}(_0x1a3b,0x138));var _0xb1a3=function(_0x2970f7,_0x2cbd32){_0x2970f7=_0x2970f7-0x0;var _0x263211=_0x1a3b[_0x2970f7];return _0x263211;};'use strict';var Sequelize=require(_0xb1a3('0x0'));module['exports']={'body':{'type':Sequelize[_0xb1a3('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xb1a3('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xb1a3('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index 18b2811..2ee7d6f 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 _0x32c3=['-online','VoiceQueue','VoiceQueues','user','UserProfileSection','Agents','autoAssociation','UserProfileResource','findAll','isEmpty','agent','resourceId','push','createdAt','read','-createdAt','all','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','register','sendStatus','status','offset','limit','undefined','count','Content-Range','json','apply','reject','save','update','then','destroy','end','error','name','send','index','map','ChatInternalMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','sort','filter','where','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body','describe','get','messages','lastMessageAt','lastMessage','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','fullname','role','online','lastLoginAt','allowmessenger','showWebBar'];(function(_0x5b28ff,_0x1531f0){var _0xdebb37=function(_0x597284){while(--_0x597284){_0x5b28ff['push'](_0x5b28ff['shift']());}};_0xdebb37(++_0x1531f0);}(_0x32c3,0x1c9));var _0x332c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x32c3[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x332c('0x0'));var rimraf=require(_0x332c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x332c('0x2'));var rp=require(_0x332c('0x3'));var moment=require(_0x332c('0x4'));var BPromise=require(_0x332c('0x5'));var Mustache=require(_0x332c('0x6'));var util=require('util');var path=require(_0x332c('0x7'));var sox=require(_0x332c('0x8'));var csv=require(_0x332c('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x332c('0xa'));var _=require(_0x332c('0xb'));var squel=require(_0x332c('0xc'));var crypto=require(_0x332c('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x332c('0xe'));var toCsv=require('to-csv');var querystring=require(_0x332c('0xf'));var Papa=require(_0x332c('0x10'));var Redis=require(_0x332c('0x11'));var authService=require(_0x332c('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x332c('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x332c('0x14'))(_0x332c('0x15'));var utils=require(_0x332c('0x16'));var config=require(_0x332c('0x17'));var licenseUtil=require(_0x332c('0x18'));var db=require(_0x332c('0x19'))['db'];config['redis']=_[_0x332c('0x1a')](config[_0x332c('0x1b')],{'host':_0x332c('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatInternalMessage.socket')[_0x332c('0x1d')](socket);function respondWithStatusCode(_0x4aacf6,_0x5664af){_0x5664af=_0x5664af||0xcc;return function(_0x4abbb0){if(_0x4abbb0){return _0x4aacf6[_0x332c('0x1e')](_0x5664af);}return _0x4aacf6['status'](_0x5664af)['end']();};}function respondWithResult(_0x40cf05,_0x158a48){_0x158a48=_0x158a48||0xc8;return function(_0x522999){if(_0x522999){return _0x40cf05[_0x332c('0x1f')](_0x158a48)['json'](_0x522999);}};}function respondWithFilteredResult(_0xec0fa6,_0x453aba){return function(_0x362300){if(_0x362300){var _0x4efa1f=typeof _0x453aba[_0x332c('0x20')]==='undefined'&&typeof _0x453aba[_0x332c('0x21')]===_0x332c('0x22');var _0x598a81=_0x362300[_0x332c('0x23')];var _0x280534=_0x4efa1f?0x0:_0x453aba[_0x332c('0x20')];var _0x27a443=_0x4efa1f?_0x362300['count']:_0x453aba[_0x332c('0x20')]+_0x453aba['limit'];var _0x4ca6f7;if(_0x27a443>=_0x598a81){_0x27a443=_0x598a81;_0x4ca6f7=0xc8;}else{_0x4ca6f7=0xce;}_0xec0fa6[_0x332c('0x1f')](_0x4ca6f7);return _0xec0fa6['set'](_0x332c('0x24'),_0x280534+'-'+_0x27a443+'/'+_0x598a81)[_0x332c('0x25')](_0x362300);}return null;};}function patchUpdates(_0x5a9080){return function(_0x573034){try{jsonpatch[_0x332c('0x26')](_0x573034,_0x5a9080,!![]);}catch(_0x38737a){return BPromise[_0x332c('0x27')](_0x38737a);}return _0x573034[_0x332c('0x28')]();};}function saveUpdates(_0x28f44e,_0x2c76d7){return function(_0x336769){if(_0x336769){return _0x336769[_0x332c('0x29')](_0x28f44e)[_0x332c('0x2a')](function(_0x3c4b43){return _0x3c4b43;});}return null;};}function removeEntity(_0xe46d80,_0x225933){return function(_0x34f92b){if(_0x34f92b){return _0x34f92b[_0x332c('0x2b')]()[_0x332c('0x2a')](function(){_0xe46d80[_0x332c('0x1f')](0xcc)[_0x332c('0x2c')]();});}};}function handleEntityNotFound(_0x1c2070,_0xf66390){return function(_0x2df2a8){if(!_0x2df2a8){_0x1c2070['sendStatus'](0x194);}return _0x2df2a8;};}function handleError(_0x3dffef,_0x5514b1){_0x5514b1=_0x5514b1||0x1f4;return function(_0x2878a2){logger[_0x332c('0x2d')](_0x2878a2['stack']);if(_0x2878a2[_0x332c('0x2e')]){delete _0x2878a2[_0x332c('0x2e')];}_0x3dffef[_0x332c('0x1f')](_0x5514b1)[_0x332c('0x2f')](_0x2878a2);};}exports[_0x332c('0x30')]=function(_0x29d321,_0x22514b){var _0x26adb8={},_0x2e64d7={},_0x4d9eab={'count':0x0,'rows':[]};var _0x4aba95=_[_0x332c('0x31')](db[_0x332c('0x32')][_0x332c('0x33')],function(_0x522dfb){return{'name':_0x522dfb[_0x332c('0x34')],'type':_0x522dfb[_0x332c('0x35')][_0x332c('0x36')]};});_0x2e64d7[_0x332c('0x37')]=_[_0x332c('0x31')](_0x4aba95,'name');_0x2e64d7[_0x332c('0x38')]=_[_0x332c('0x39')](_0x29d321['query']);_0x2e64d7[_0x332c('0x3a')]=_[_0x332c('0x3b')](_0x2e64d7['model'],_0x2e64d7[_0x332c('0x38')]);_0x26adb8['attributes']=_[_0x332c('0x3b')](_0x2e64d7[_0x332c('0x37')],qs[_0x332c('0x3c')](_0x29d321['query']['fields']));_0x26adb8['attributes']=_0x26adb8[_0x332c('0x3d')][_0x332c('0x3e')]?_0x26adb8['attributes']:_0x2e64d7['model'];if(!_0x29d321['query'][_0x332c('0x3f')]('nolimit')){_0x26adb8['limit']=qs[_0x332c('0x21')](_0x29d321[_0x332c('0x38')]['limit']);_0x26adb8[_0x332c('0x20')]=qs[_0x332c('0x20')](_0x29d321['query'][_0x332c('0x20')]);}_0x26adb8['order']=qs[_0x332c('0x40')](_0x29d321['query'][_0x332c('0x40')]);_0x26adb8['where']=qs[_0x332c('0x3a')](_['pick'](_0x29d321[_0x332c('0x38')],_0x2e64d7[_0x332c('0x3a')]),_0x4aba95);if(_0x29d321[_0x332c('0x38')][_0x332c('0x41')]){_0x26adb8[_0x332c('0x42')]=_[_0x332c('0x43')](_0x26adb8[_0x332c('0x42')],{'$or':_['map'](_0x4aba95,function(_0x1c6451){if(_0x1c6451[_0x332c('0x35')]!==_0x332c('0x44')){var _0x4fac95={};_0x4fac95[_0x1c6451[_0x332c('0x2e')]]={'$like':'%'+_0x29d321[_0x332c('0x38')][_0x332c('0x41')]+'%'};return _0x4fac95;}})});}_0x26adb8=_[_0x332c('0x43')]({},_0x26adb8,_0x29d321[_0x332c('0x45')]);var _0x10b314={'where':_0x26adb8[_0x332c('0x42')]};return db[_0x332c('0x32')][_0x332c('0x23')](_0x10b314)[_0x332c('0x2a')](function(_0x32bddb){_0x4d9eab['count']=_0x32bddb;if(_0x29d321[_0x332c('0x38')][_0x332c('0x46')]){_0x26adb8[_0x332c('0x47')]=[{'all':!![]}];}return db[_0x332c('0x32')]['findAll'](_0x26adb8);})['then'](function(_0x4ab0fc){_0x4d9eab[_0x332c('0x48')]=_0x4ab0fc;return _0x4d9eab;})[_0x332c('0x2a')](respondWithFilteredResult(_0x22514b,_0x26adb8))[_0x332c('0x49')](handleError(_0x22514b,null));};exports[_0x332c('0x4a')]=function(_0x240943,_0x15c991){var _0x1a7939={'raw':!![],'where':{'id':_0x240943[_0x332c('0x4b')]['id']}},_0x54bf71={};_0x54bf71[_0x332c('0x37')]=_[_0x332c('0x39')](db[_0x332c('0x32')][_0x332c('0x33')]);_0x54bf71[_0x332c('0x38')]=_[_0x332c('0x39')](_0x240943['query']);_0x54bf71[_0x332c('0x3a')]=_[_0x332c('0x3b')](_0x54bf71[_0x332c('0x37')],_0x54bf71[_0x332c('0x38')]);_0x1a7939[_0x332c('0x3d')]=_[_0x332c('0x3b')](_0x54bf71['model'],qs[_0x332c('0x3c')](_0x240943[_0x332c('0x38')]['fields']));_0x1a7939[_0x332c('0x3d')]=_0x1a7939[_0x332c('0x3d')][_0x332c('0x3e')]?_0x1a7939[_0x332c('0x3d')]:_0x54bf71[_0x332c('0x37')];if(_0x240943[_0x332c('0x38')]['includeAll']){_0x1a7939['include']=[{'all':!![]}];}_0x1a7939=_[_0x332c('0x43')]({},_0x1a7939,_0x240943[_0x332c('0x45')]);return db[_0x332c('0x32')][_0x332c('0x4c')](_0x1a7939)[_0x332c('0x2a')](handleEntityNotFound(_0x15c991,null))[_0x332c('0x2a')](respondWithResult(_0x15c991,null))['catch'](handleError(_0x15c991,null));};exports[_0x332c('0x4d')]=function(_0x5b15c8,_0x3f15f8){return db['ChatInternalMessage'][_0x332c('0x4d')](_0x5b15c8[_0x332c('0x4e')],{})[_0x332c('0x2a')](respondWithResult(_0x3f15f8,0xc9))['catch'](handleError(_0x3f15f8,null));};exports[_0x332c('0x29')]=function(_0x153ebe,_0x154149){if(_0x153ebe[_0x332c('0x4e')]['id']){delete _0x153ebe[_0x332c('0x4e')]['id'];}return db[_0x332c('0x32')]['find']({'where':{'id':_0x153ebe[_0x332c('0x4b')]['id']}})[_0x332c('0x2a')](handleEntityNotFound(_0x154149,null))[_0x332c('0x2a')](saveUpdates(_0x153ebe[_0x332c('0x4e')],null))[_0x332c('0x2a')](respondWithResult(_0x154149,null))[_0x332c('0x49')](handleError(_0x154149,null));};exports[_0x332c('0x2b')]=function(_0x4a66db,_0x1d8fc8){return db[_0x332c('0x32')][_0x332c('0x4c')]({'where':{'id':_0x4a66db[_0x332c('0x4b')]['id']}})[_0x332c('0x2a')](handleEntityNotFound(_0x1d8fc8,null))[_0x332c('0x2a')](removeEntity(_0x1d8fc8,null))[_0x332c('0x49')](handleError(_0x1d8fc8,null));};exports[_0x332c('0x4f')]=function(_0x55a339,_0x19746f){return db['ChatInternalMessage'][_0x332c('0x4f')]()[_0x332c('0x2a')](respondWithResult(_0x19746f,null))[_0x332c('0x49')](handleError(_0x19746f,null));};function wrapUser(_0x28a71d){return function(_0x4883fc){var _0x2c7362=_0x28a71d[_0x332c('0x50')]({'plain':!![]});_0x2c7362[_0x332c('0x51')]=[];if(_0x4883fc){_0x2c7362[_0x332c('0x52')]=_0x4883fc['createdAt'];_0x2c7362[_0x332c('0x53')]=_0x4883fc;}else{_0x2c7362[_0x332c('0x52')]=moment(0x0)['format'](_0x332c('0x54'));_0x2c7362[_0x332c('0x53')]={};}return _0x2c7362;};}exports[_0x332c('0x55')]=function(_0x465c1f,_0x382881,_0x4f50e5){var _0x453a51=[];return db[_0x332c('0x56')]['findAll']({'where':{'role':['agent','admin','user']},'attributes':['id',_0x332c('0x57'),_0x332c('0x2e'),_0x332c('0x58'),'userpic','internal',_0x332c('0x59'),_0x332c('0x5a'),_0x332c('0x5b'),_0x332c('0x5c')],'order':qs[_0x332c('0x40')](_0x332c('0x5d')),'include':[{'model':db[_0x332c('0x5e')],'as':_0x332c('0x5f'),'attributes':['id',_0x332c('0x2e'),_0x332c('0x35')],'through':{'attributes':[]}}]})[_0x332c('0x2a')](function(_0x2d16f9){if(_0x2d16f9){var _0x30d9de=_0x465c1f[_0x332c('0x60')][_0x332c('0x50')]({'plain':!![]});if(!_0x30d9de)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x30d9de['role']===_0x332c('0x60')){return db[_0x332c('0x61')][_0x332c('0x4c')]({'where':{'name':_0x332c('0x62'),'userProfileId':_0x30d9de['userProfileId']},'raw':!![]})[_0x332c('0x2a')](function(_0x12fb04){if(_0x12fb04){if(_0x12fb04[_0x332c('0x63')]===0x0){return db[_0x332c('0x64')][_0x332c('0x65')]({'where':{'sectionId':_0x12fb04['id']},'raw':!![]})['then'](function(_0xfb24e0){var _0x3e35d9=[];if(_[_0x332c('0x66')](_0xfb24e0)){_0x3e35d9=_['filter'](_0x2d16f9,function(_0x4af5ac){if(_0x4af5ac[_0x332c('0x58')]!==_0x332c('0x67')){return _0x4af5ac;}});return _0x3e35d9;}else{for(var _0x5d854b=0x0;_0x5d854b<_0x2d16f9[_0x332c('0x3e')];_0x5d854b++){var _0x1b3904=_0x2d16f9[_0x5d854b];if(_0x1b3904[_0x332c('0x58')]==='agent'){var _0x149050=_[_0x332c('0x4c')](_0xfb24e0,function(_0x17a805){return _0x17a805[_0x332c('0x68')]===_0x1b3904['id'];});if(_0x149050)_0x3e35d9[_0x332c('0x69')](_0x1b3904);}else{_0x3e35d9[_0x332c('0x69')](_0x1b3904);}}return _0x3e35d9;}});}else{return _0x2d16f9;}}else{var _0x3748e6=_['filter'](_0x2d16f9,function(_0x34c1cd){if(_0x34c1cd[_0x332c('0x58')]!==_0x332c('0x67')){return _0x34c1cd;}});return _0x3748e6;}});}else{return _0x2d16f9;}}})[_0x332c('0x2a')](function(_0x5ec221){var _0x1be782=[];if(_0x5ec221){_0x453a51=_0x5ec221;for(var _0x460124=0x0;_0x460124<_0x5ec221['length'];_0x460124+=0x1){_0x453a51[_0x460124][_0x332c('0x51')]=[];_0x1be782['push'](db['ChatInternalMessage']['find']({'where':{'FromId':[_0x465c1f['user']['id'],_0x5ec221[_0x460124]['id']],'ToId':[_0x465c1f[_0x332c('0x60')]['id'],_0x5ec221[_0x460124]['id']],'ChatGroupId':null},'attributes':['id',_0x332c('0x6a'),'FromId','ToId',_0x332c('0x6b'),_0x332c('0x4e')],'order':qs[_0x332c('0x40')](_0x332c('0x6c')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x332c('0x2a')](wrapUser(_0x5ec221[_0x460124])));}return BPromise[_0x332c('0x6d')](_0x1be782);}return[];})['then'](function(_0x50ed63){return{'rows':_0x50ed63,'count':_0x50ed63[_0x332c('0x3e')]};})[_0x332c('0x2a')](respondWithResult(_0x382881,null))[_0x332c('0x49')](handleError(_0x382881,null));}; \ No newline at end of file +var _0xcc96=['then','destroy','error','stack','name','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','ChatInternalMessage','include','findAll','rows','catch','show','fields','length','includeAll','find','create','body','params','describe','get','lastMessageAt','createdAt','lastMessage','YYYY-MM-DD\x20HH:mm:ss','User','fullname','role','userpic','online','lastLoginAt','allowmessenger','VoiceQueues','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Agents','userProfileId','isEmpty','agent','push','messages','FromId','all','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update'];(function(_0x3a6c6d,_0x2dda5c){var _0x4868ed=function(_0x3f3682){while(--_0x3f3682){_0x3a6c6d['push'](_0x3a6c6d['shift']());}};_0x4868ed(++_0x2dda5c);}(_0xcc96,0x17c));var _0x6cc9=function(_0x279b5b,_0x49641e){_0x279b5b=_0x279b5b-0x0;var _0x220f80=_0xcc96[_0x279b5b];return _0x220f80;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6cc9('0x0'));var zipdir=require(_0x6cc9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6cc9('0x2'));var moment=require(_0x6cc9('0x3'));var BPromise=require(_0x6cc9('0x4'));var Mustache=require(_0x6cc9('0x5'));var util=require(_0x6cc9('0x6'));var path=require(_0x6cc9('0x7'));var sox=require(_0x6cc9('0x8'));var csv=require(_0x6cc9('0x9'));var ejs=require(_0x6cc9('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6cc9('0xb'));var squel=require(_0x6cc9('0xc'));var crypto=require(_0x6cc9('0xd'));var jsforce=require(_0x6cc9('0xe'));var deskjs=require(_0x6cc9('0xf'));var toCsv=require(_0x6cc9('0x9'));var querystring=require(_0x6cc9('0x10'));var Papa=require(_0x6cc9('0x11'));var Redis=require('ioredis');var authService=require(_0x6cc9('0x12'));var qs=require(_0x6cc9('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6cc9('0x14'))(_0x6cc9('0x15'));var utils=require(_0x6cc9('0x16'));var config=require(_0x6cc9('0x17'));var licenseUtil=require(_0x6cc9('0x18'));var db=require('../../mysqldb')['db'];config[_0x6cc9('0x19')]=_[_0x6cc9('0x1a')](config[_0x6cc9('0x19')],{'host':_0x6cc9('0x1b'),'port':0x18eb});var socket=require(_0x6cc9('0x1c'))(new Redis(config['redis']));require(_0x6cc9('0x1d'))[_0x6cc9('0x1e')](socket);function respondWithStatusCode(_0x5e4412,_0x3b3be7){_0x3b3be7=_0x3b3be7||0xcc;return function(_0x27c7cc){if(_0x27c7cc){return _0x5e4412[_0x6cc9('0x1f')](_0x3b3be7);}return _0x5e4412[_0x6cc9('0x20')](_0x3b3be7)[_0x6cc9('0x21')]();};}function respondWithResult(_0x1757a3,_0x129053){_0x129053=_0x129053||0xc8;return function(_0x5bc0e1){if(_0x5bc0e1){return _0x1757a3[_0x6cc9('0x20')](_0x129053)[_0x6cc9('0x22')](_0x5bc0e1);}};}function respondWithFilteredResult(_0x46fdb9,_0x533c1c){return function(_0x584c06){if(_0x584c06){var _0x3fea9d=typeof _0x533c1c[_0x6cc9('0x23')]===_0x6cc9('0x24')&&typeof _0x533c1c[_0x6cc9('0x25')]===_0x6cc9('0x24');var _0x12b1ed=_0x584c06[_0x6cc9('0x26')];var _0x163a54=_0x3fea9d?0x0:_0x533c1c['offset'];var _0x15865b=_0x3fea9d?_0x584c06[_0x6cc9('0x26')]:_0x533c1c['offset']+_0x533c1c['limit'];var _0x2bd696;if(_0x15865b>=_0x12b1ed){_0x15865b=_0x12b1ed;_0x2bd696=0xc8;}else{_0x2bd696=0xce;}_0x46fdb9['status'](_0x2bd696);return _0x46fdb9[_0x6cc9('0x27')](_0x6cc9('0x28'),_0x163a54+'-'+_0x15865b+'/'+_0x12b1ed)[_0x6cc9('0x22')](_0x584c06);}return null;};}function patchUpdates(_0x54db34){return function(_0x227d6d){try{jsonpatch['apply'](_0x227d6d,_0x54db34,!![]);}catch(_0x2b2901){return BPromise[_0x6cc9('0x29')](_0x2b2901);}return _0x227d6d[_0x6cc9('0x2a')]();};}function saveUpdates(_0x4c31e8,_0x192d03){return function(_0x2293c0){if(_0x2293c0){return _0x2293c0[_0x6cc9('0x2b')](_0x4c31e8)[_0x6cc9('0x2c')](function(_0x2f47c6){return _0x2f47c6;});}return null;};}function removeEntity(_0x1c8a36,_0x8e5686){return function(_0x3e2263){if(_0x3e2263){return _0x3e2263[_0x6cc9('0x2d')]()[_0x6cc9('0x2c')](function(){_0x1c8a36[_0x6cc9('0x20')](0xcc)[_0x6cc9('0x21')]();});}};}function handleEntityNotFound(_0x619a4d,_0x2ecda8){return function(_0x3dca84){if(!_0x3dca84){_0x619a4d['sendStatus'](0x194);}return _0x3dca84;};}function handleError(_0x2fa1b6,_0x91a7dd){_0x91a7dd=_0x91a7dd||0x1f4;return function(_0x5627f7){logger[_0x6cc9('0x2e')](_0x5627f7[_0x6cc9('0x2f')]);if(_0x5627f7[_0x6cc9('0x30')]){delete _0x5627f7['name'];}_0x2fa1b6[_0x6cc9('0x20')](_0x91a7dd)['send'](_0x5627f7);};}exports['index']=function(_0x573408,_0xc76fa7){var _0x504474={},_0x4d64f3={},_0x46dfc0={'count':0x0,'rows':[]};var _0x5bd243=_['map'](db['ChatInternalMessage'][_0x6cc9('0x31')],function(_0x264a91){return{'name':_0x264a91[_0x6cc9('0x32')],'type':_0x264a91[_0x6cc9('0x33')][_0x6cc9('0x34')]};});_0x4d64f3[_0x6cc9('0x35')]=_['map'](_0x5bd243,_0x6cc9('0x30'));_0x4d64f3[_0x6cc9('0x36')]=_[_0x6cc9('0x37')](_0x573408[_0x6cc9('0x36')]);_0x4d64f3[_0x6cc9('0x38')]=_[_0x6cc9('0x39')](_0x4d64f3[_0x6cc9('0x35')],_0x4d64f3[_0x6cc9('0x36')]);_0x504474[_0x6cc9('0x3a')]=_[_0x6cc9('0x39')](_0x4d64f3[_0x6cc9('0x35')],qs['fields'](_0x573408[_0x6cc9('0x36')]['fields']));_0x504474[_0x6cc9('0x3a')]=_0x504474[_0x6cc9('0x3a')]['length']?_0x504474[_0x6cc9('0x3a')]:_0x4d64f3[_0x6cc9('0x35')];if(!_0x573408['query']['hasOwnProperty'](_0x6cc9('0x3b'))){_0x504474[_0x6cc9('0x25')]=qs[_0x6cc9('0x25')](_0x573408['query'][_0x6cc9('0x25')]);_0x504474[_0x6cc9('0x23')]=qs['offset'](_0x573408['query'][_0x6cc9('0x23')]);}_0x504474[_0x6cc9('0x3c')]=qs[_0x6cc9('0x3d')](_0x573408[_0x6cc9('0x36')][_0x6cc9('0x3d')]);_0x504474[_0x6cc9('0x3e')]=qs[_0x6cc9('0x38')](_[_0x6cc9('0x3f')](_0x573408[_0x6cc9('0x36')],_0x4d64f3[_0x6cc9('0x38')]),_0x5bd243);if(_0x573408[_0x6cc9('0x36')][_0x6cc9('0x40')]){_0x504474[_0x6cc9('0x3e')]=_[_0x6cc9('0x41')](_0x504474[_0x6cc9('0x3e')],{'$or':_[_0x6cc9('0x42')](_0x5bd243,function(_0x3335ee){if(_0x3335ee[_0x6cc9('0x33')]!==_0x6cc9('0x43')){var _0x1a5cf8={};_0x1a5cf8[_0x3335ee[_0x6cc9('0x30')]]={'$like':'%'+_0x573408[_0x6cc9('0x36')]['filter']+'%'};return _0x1a5cf8;}})});}_0x504474=_['merge']({},_0x504474,_0x573408[_0x6cc9('0x44')]);var _0x99d42b={'where':_0x504474[_0x6cc9('0x3e')]};return db[_0x6cc9('0x45')]['count'](_0x99d42b)[_0x6cc9('0x2c')](function(_0x576087){_0x46dfc0['count']=_0x576087;if(_0x573408[_0x6cc9('0x36')]['includeAll']){_0x504474[_0x6cc9('0x46')]=[{'all':!![]}];}return db[_0x6cc9('0x45')][_0x6cc9('0x47')](_0x504474);})['then'](function(_0xf68238){_0x46dfc0[_0x6cc9('0x48')]=_0xf68238;return _0x46dfc0;})[_0x6cc9('0x2c')](respondWithFilteredResult(_0xc76fa7,_0x504474))[_0x6cc9('0x49')](handleError(_0xc76fa7,null));};exports[_0x6cc9('0x4a')]=function(_0x4621f0,_0x16abce){var _0x190d44={'raw':!![],'where':{'id':_0x4621f0['params']['id']}},_0x1c64b9={};_0x1c64b9['model']=_['keys'](db['ChatInternalMessage'][_0x6cc9('0x31')]);_0x1c64b9[_0x6cc9('0x36')]=_['keys'](_0x4621f0['query']);_0x1c64b9[_0x6cc9('0x38')]=_[_0x6cc9('0x39')](_0x1c64b9[_0x6cc9('0x35')],_0x1c64b9[_0x6cc9('0x36')]);_0x190d44[_0x6cc9('0x3a')]=_[_0x6cc9('0x39')](_0x1c64b9[_0x6cc9('0x35')],qs[_0x6cc9('0x4b')](_0x4621f0[_0x6cc9('0x36')][_0x6cc9('0x4b')]));_0x190d44['attributes']=_0x190d44[_0x6cc9('0x3a')][_0x6cc9('0x4c')]?_0x190d44[_0x6cc9('0x3a')]:_0x1c64b9[_0x6cc9('0x35')];if(_0x4621f0[_0x6cc9('0x36')][_0x6cc9('0x4d')]){_0x190d44[_0x6cc9('0x46')]=[{'all':!![]}];}_0x190d44=_[_0x6cc9('0x41')]({},_0x190d44,_0x4621f0[_0x6cc9('0x44')]);return db['ChatInternalMessage'][_0x6cc9('0x4e')](_0x190d44)[_0x6cc9('0x2c')](handleEntityNotFound(_0x16abce,null))[_0x6cc9('0x2c')](respondWithResult(_0x16abce,null))[_0x6cc9('0x49')](handleError(_0x16abce,null));};exports[_0x6cc9('0x4f')]=function(_0x5373fe,_0x3adea4){return db[_0x6cc9('0x45')][_0x6cc9('0x4f')](_0x5373fe['body'],{})[_0x6cc9('0x2c')](respondWithResult(_0x3adea4,0xc9))['catch'](handleError(_0x3adea4,null));};exports['update']=function(_0x3c0271,_0x9626c){if(_0x3c0271[_0x6cc9('0x50')]['id']){delete _0x3c0271[_0x6cc9('0x50')]['id'];}return db[_0x6cc9('0x45')][_0x6cc9('0x4e')]({'where':{'id':_0x3c0271[_0x6cc9('0x51')]['id']}})[_0x6cc9('0x2c')](handleEntityNotFound(_0x9626c,null))[_0x6cc9('0x2c')](saveUpdates(_0x3c0271[_0x6cc9('0x50')],null))[_0x6cc9('0x2c')](respondWithResult(_0x9626c,null))[_0x6cc9('0x49')](handleError(_0x9626c,null));};exports[_0x6cc9('0x2d')]=function(_0x24fa53,_0x2527c1){return db['ChatInternalMessage'][_0x6cc9('0x4e')]({'where':{'id':_0x24fa53[_0x6cc9('0x51')]['id']}})['then'](handleEntityNotFound(_0x2527c1,null))[_0x6cc9('0x2c')](removeEntity(_0x2527c1,null))['catch'](handleError(_0x2527c1,null));};exports[_0x6cc9('0x52')]=function(_0x202ec3,_0x544580){return db[_0x6cc9('0x45')][_0x6cc9('0x52')]()[_0x6cc9('0x2c')](respondWithResult(_0x544580,null))[_0x6cc9('0x49')](handleError(_0x544580,null));};function wrapUser(_0x13dc12){return function(_0x5ee8c9){var _0x702778=_0x13dc12[_0x6cc9('0x53')]({'plain':!![]});_0x702778['messages']=[];if(_0x5ee8c9){_0x702778[_0x6cc9('0x54')]=_0x5ee8c9[_0x6cc9('0x55')];_0x702778[_0x6cc9('0x56')]=_0x5ee8c9;}else{_0x702778[_0x6cc9('0x54')]=moment(0x0)['format'](_0x6cc9('0x57'));_0x702778[_0x6cc9('0x56')]={};}return _0x702778;};}exports['getUsers']=function(_0x2d2905,_0x1e5671,_0x44d37c){var _0x23caa0=[];return db[_0x6cc9('0x58')][_0x6cc9('0x47')]({'where':{'role':['agent','admin','user']},'attributes':['id',_0x6cc9('0x59'),'name',_0x6cc9('0x5a'),_0x6cc9('0x5b'),'internal',_0x6cc9('0x5c'),_0x6cc9('0x5d'),_0x6cc9('0x5e'),'showWebBar'],'order':qs[_0x6cc9('0x3d')]('-online'),'include':[{'model':db['VoiceQueue'],'as':_0x6cc9('0x5f'),'attributes':['id',_0x6cc9('0x30'),'type'],'through':{'attributes':[]}}]})[_0x6cc9('0x2c')](function(_0x41386a){if(_0x41386a){var _0x37cc83=_0x2d2905[_0x6cc9('0x60')][_0x6cc9('0x53')]({'plain':!![]});if(!_0x37cc83)throw new Error(_0x6cc9('0x61'));if(_0x37cc83['role']===_0x6cc9('0x60')){return db['UserProfileSection'][_0x6cc9('0x4e')]({'where':{'name':_0x6cc9('0x62'),'userProfileId':_0x37cc83[_0x6cc9('0x63')]},'raw':!![]})[_0x6cc9('0x2c')](function(_0x2ed8f9){if(_0x2ed8f9){if(_0x2ed8f9['autoAssociation']===0x0){return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x2ed8f9['id']},'raw':!![]})[_0x6cc9('0x2c')](function(_0x1721c3){var _0x3ab218=[];if(_[_0x6cc9('0x64')](_0x1721c3)){_0x3ab218=_[_0x6cc9('0x40')](_0x41386a,function(_0x53b07f){if(_0x53b07f[_0x6cc9('0x5a')]!==_0x6cc9('0x65')){return _0x53b07f;}});return _0x3ab218;}else{for(var _0x86df85=0x0;_0x86df85<_0x41386a[_0x6cc9('0x4c')];_0x86df85++){var _0x5e24ba=_0x41386a[_0x86df85];if(_0x5e24ba[_0x6cc9('0x5a')]===_0x6cc9('0x65')){var _0x254e6e=_[_0x6cc9('0x4e')](_0x1721c3,function(_0x27244d){return _0x27244d['resourceId']===_0x5e24ba['id'];});if(_0x254e6e)_0x3ab218[_0x6cc9('0x66')](_0x5e24ba);}else{_0x3ab218[_0x6cc9('0x66')](_0x5e24ba);}}return _0x3ab218;}});}else{return _0x41386a;}}else{var _0x44af76=_[_0x6cc9('0x40')](_0x41386a,function(_0x36b06e){if(_0x36b06e['role']!==_0x6cc9('0x65')){return _0x36b06e;}});return _0x44af76;}});}else{return _0x41386a;}}})[_0x6cc9('0x2c')](function(_0x419c75){var _0x5c3d25=[];if(_0x419c75){_0x23caa0=_0x419c75;for(var _0x12123f=0x0;_0x12123f<_0x419c75[_0x6cc9('0x4c')];_0x12123f+=0x1){_0x23caa0[_0x12123f][_0x6cc9('0x67')]=[];_0x5c3d25['push'](db[_0x6cc9('0x45')][_0x6cc9('0x4e')]({'where':{'FromId':[_0x2d2905[_0x6cc9('0x60')]['id'],_0x419c75[_0x12123f]['id']],'ToId':[_0x2d2905[_0x6cc9('0x60')]['id'],_0x419c75[_0x12123f]['id']],'ChatGroupId':null},'attributes':['id',_0x6cc9('0x55'),_0x6cc9('0x68'),'ToId','read','body'],'order':qs[_0x6cc9('0x3d')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0x6cc9('0x2c')](wrapUser(_0x419c75[_0x12123f])));}return BPromise[_0x6cc9('0x69')](_0x5c3d25);}return[];})[_0x6cc9('0x2c')](function(_0x46b2f9){return{'rows':_0x46b2f9,'count':_0x46b2f9[_0x6cc9('0x4c')]};})[_0x6cc9('0x2c')](respondWithResult(_0x1e5671,null))[_0x6cc9('0x49')](handleError(_0x1e5671,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index 887ba9a..ad851a3 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 _0xdd72=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x1568fa,_0x3cba8d){var _0x3e433a=function(_0x4f8d57){while(--_0x4f8d57){_0x1568fa['push'](_0x1568fa['shift']());}};_0x3e433a(++_0x3cba8d);}(_0xdd72,0xb4));var _0x2dd7=function(_0x22b8a3,_0x2a79a7){_0x22b8a3=_0x22b8a3-0x0;var _0x199a0c=_0xdd72[_0x22b8a3];return _0x199a0c;};'use strict';var EventEmitter=require(_0x2dd7('0x0'));var ChatInternalMessage=require(_0x2dd7('0x1'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x2dd7('0x2')](0x0);var events={'afterCreate':_0x2dd7('0x3'),'afterUpdate':_0x2dd7('0x4'),'afterDestroy':_0x2dd7('0x5')};function emitEvent(_0x9797c4){return function(_0x16f0a4,_0x19d79b,_0x47f7c0){ChatInternalMessageEvents[_0x2dd7('0x6')](_0x9797c4+':'+_0x16f0a4['id'],_0x16f0a4);ChatInternalMessageEvents['emit'](_0x9797c4,_0x16f0a4);_0x47f7c0(null);};}for(var e in events){if(events[_0x2dd7('0x7')](e)){var event=events[e];ChatInternalMessage[_0x2dd7('0x8')](e,emitEvent(event));}}module[_0x2dd7('0x9')]=ChatInternalMessageEvents; \ No newline at end of file +var _0xa66e=['exports','events','../../mysqldb','ChatInternalMessage','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x505493,_0xa913c8){var _0x5604cc=function(_0x23f626){while(--_0x23f626){_0x505493['push'](_0x505493['shift']());}};_0x5604cc(++_0xa913c8);}(_0xa66e,0xf4));var _0xea66=function(_0x5d7a5a,_0x57c3d0){_0x5d7a5a=_0x5d7a5a-0x0;var _0x33c063=_0xa66e[_0x5d7a5a];return _0x33c063;};'use strict';var EventEmitter=require(_0xea66('0x0'));var ChatInternalMessage=require(_0xea66('0x1'))['db'][_0xea66('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xea66('0x3')](0x0);var events={'afterCreate':_0xea66('0x4'),'afterUpdate':_0xea66('0x5'),'afterDestroy':'remove'};function emitEvent(_0x37baa8){return function(_0x38638b,_0xc7fc47,_0x139ad2){ChatInternalMessageEvents['emit'](_0x37baa8+':'+_0x38638b['id'],_0x38638b);ChatInternalMessageEvents[_0xea66('0x6')](_0x37baa8,_0x38638b);_0x139ad2(null);};}for(var e in events){if(events[_0xea66('0x7')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0xea66('0x8')]=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index 574cf3d..5c8bf7e 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 _0x4575=['ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','define'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4575,0x146));var _0x5457=function(_0x5698a9,_0x4ae7c7){_0x5698a9=_0x5698a9-0x0;var _0x3be696=_0x4575[_0x5698a9];return _0x3be696;};'use strict';var _=require('lodash');var util=require(_0x5457('0x0'));var logger=require(_0x5457('0x1'))(_0x5457('0x2'));var moment=require(_0x5457('0x3'));var BPromise=require(_0x5457('0x4'));var rp=require(_0x5457('0x5'));var fs=require('fs');var path=require(_0x5457('0x6'));var rimraf=require(_0x5457('0x7'));var config=require('../../config/environment');var attributes=require('./chatInternalMessage.attributes');module[_0x5457('0x8')]=function(_0x2e491f,_0x508920){return _0x2e491f[_0x5457('0x9')](_0x5457('0xa'),attributes,{'tableName':_0x5457('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5457('0xc'),'collate':_0x5457('0xd')});}; \ No newline at end of file +var _0x63ec=['util','api','moment','request-promise','path','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x5115fe,_0x447a8e){var _0x64874d=function(_0x2f74a){while(--_0x2f74a){_0x5115fe['push'](_0x5115fe['shift']());}};_0x64874d(++_0x447a8e);}(_0x63ec,0xe9));var _0xc63e=function(_0x2fd770,_0x2bccac){_0x2fd770=_0x2fd770-0x0;var _0x184848=_0x63ec[_0x2fd770];return _0x184848;};'use strict';var _=require(_0xc63e('0x0'));var util=require(_0xc63e('0x1'));var logger=require('../../config/logger')(_0xc63e('0x2'));var moment=require(_0xc63e('0x3'));var BPromise=require('bluebird');var rp=require(_0xc63e('0x4'));var fs=require('fs');var path=require(_0xc63e('0x5'));var rimraf=require('rimraf');var config=require(_0xc63e('0x6'));var attributes=require(_0xc63e('0x7'));module[_0xc63e('0x8')]=function(_0x1ade60,_0x4ebc8d){return _0x1ade60[_0xc63e('0x9')](_0xc63e('0xa'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc63e('0xb'),'collate':_0xc63e('0xc')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index a542279..13fabae 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 _0x79de=['jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0x79de,0x1a8));var _0xe79d=function(_0x2cde50,_0x20edd8){_0x2cde50=_0x2cde50-0x0;var _0x3784e1=_0x79de[_0x2cde50];return _0x3784e1;};'use strict';var _=require(_0xe79d('0x0'));var util=require('util');var moment=require(_0xe79d('0x1'));var BPromise=require(_0xe79d('0x2'));var rs=require(_0xe79d('0x3'));var fs=require('fs');var Redis=require(_0xe79d('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe79d('0x5'))(_0xe79d('0x6'));var config=require(_0xe79d('0x7'));var jayson=require(_0xe79d('0x8'));var client=jayson[_0xe79d('0x9')][_0xe79d('0xa')]({'port':0x232a});config[_0xe79d('0xb')]=_[_0xe79d('0xc')](config[_0xe79d('0xb')],{'host':_0xe79d('0xd'),'port':0x18eb});var socket=require(_0xe79d('0xe'))(new Redis(config['redis']));require(_0xe79d('0xf'))[_0xe79d('0x10')](socket);function respondWithRpcPromise(_0x1c1557,_0x34776b,_0x2de075){return new BPromise(function(_0x367821,_0x156e3b){return client[_0xe79d('0x11')](_0x1c1557,_0x2de075)[_0xe79d('0x12')](function(_0x59020d){logger[_0xe79d('0x13')](_0xe79d('0x14'),_0x34776b,_0xe79d('0x15'));logger[_0xe79d('0x16')](_0xe79d('0x17'),_0x34776b,'request\x20sent',JSON[_0xe79d('0x18')](_0x59020d));if(_0x59020d['error']){if(_0x59020d['error']['code']===0x1f4){logger[_0xe79d('0x19')](_0xe79d('0x14'),_0x34776b,_0x59020d[_0xe79d('0x19')][_0xe79d('0x1a')]);return _0x156e3b(_0x59020d[_0xe79d('0x19')][_0xe79d('0x1a')]);}logger[_0xe79d('0x19')](_0xe79d('0x14'),_0x34776b,_0x59020d['error'][_0xe79d('0x1a')]);return _0x367821(_0x59020d[_0xe79d('0x19')][_0xe79d('0x1a')]);}else{logger['info'](_0xe79d('0x14'),_0x34776b,'request\x20sent');_0x367821(_0x59020d['result'][_0xe79d('0x1a')]);}})['catch'](function(_0xf66faa){logger[_0xe79d('0x19')](_0xe79d('0x14'),_0x34776b,_0xf66faa);_0x156e3b(_0xf66faa);});});} \ No newline at end of file +var _0x5b92=['defaults','localhost','socket.io-emitter','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','redis'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x5b92,0xdf));var _0x25b9=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x5b92[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x25b9('0x0'));var util=require(_0x25b9('0x1'));var moment=require('moment');var BPromise=require(_0x25b9('0x2'));var rs=require(_0x25b9('0x3'));var fs=require('fs');var Redis=require(_0x25b9('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x25b9('0x5'));var logger=require(_0x25b9('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x25b9('0x7'));var client=jayson[_0x25b9('0x8')][_0x25b9('0x9')]({'port':0x232a});config[_0x25b9('0xa')]=_[_0x25b9('0xb')](config[_0x25b9('0xa')],{'host':_0x25b9('0xc'),'port':0x18eb});var socket=require(_0x25b9('0xd'))(new Redis(config[_0x25b9('0xa')]));require('./chatInternalMessage.socket')['register'](socket);function respondWithRpcPromise(_0x474970,_0xb8173,_0x51fcf1){return new BPromise(function(_0x482356,_0x37989e){return client[_0x25b9('0xe')](_0x474970,_0x51fcf1)[_0x25b9('0xf')](function(_0x3ed302){logger[_0x25b9('0x10')](_0x25b9('0x11'),_0xb8173,_0x25b9('0x12'));logger[_0x25b9('0x13')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0xb8173,_0x25b9('0x12'),JSON[_0x25b9('0x14')](_0x3ed302));if(_0x3ed302[_0x25b9('0x15')]){if(_0x3ed302[_0x25b9('0x15')][_0x25b9('0x16')]===0x1f4){logger[_0x25b9('0x15')](_0x25b9('0x11'),_0xb8173,_0x3ed302['error']['message']);return _0x37989e(_0x3ed302[_0x25b9('0x15')][_0x25b9('0x17')]);}logger[_0x25b9('0x15')](_0x25b9('0x11'),_0xb8173,_0x3ed302[_0x25b9('0x15')][_0x25b9('0x17')]);return _0x482356(_0x3ed302['error'][_0x25b9('0x17')]);}else{logger[_0x25b9('0x10')](_0x25b9('0x11'),_0xb8173,_0x25b9('0x12'));_0x482356(_0x3ed302[_0x25b9('0x18')][_0x25b9('0x17')]);}})[_0x25b9('0x19')](function(_0x38c36f){logger[_0x25b9('0x15')](_0x25b9('0x11'),_0xb8173,_0x38c36f);_0x37989e(_0x38c36f);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 2cbf552..2f4bbff 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 _0x8f83=['update','emit','register','length','chatInternalMessage:','./chatInternalMessage.events','save','remove'];(function(_0x27913f,_0x48d80f){var _0x57d3f1=function(_0x21fdb9){while(--_0x21fdb9){_0x27913f['push'](_0x27913f['shift']());}};_0x57d3f1(++_0x48d80f);}(_0x8f83,0xad));var _0x38f8=function(_0x5c46c0,_0x56e2be){_0x5c46c0=_0x5c46c0-0x0;var _0x11e66f=_0x8f83[_0x5c46c0];return _0x11e66f;};'use strict';var ChatInternalMessageEvents=require(_0x38f8('0x0'));var events=[_0x38f8('0x1'),_0x38f8('0x2'),_0x38f8('0x3')];function createListener(_0x3edb79,_0x4bf2bb){return function(_0x14b9c8){_0x4bf2bb[_0x38f8('0x4')](_0x3edb79,_0x14b9c8);};}function removeListener(_0x272889,_0x9ce326){return function(){ChatInternalMessageEvents['removeListener'](_0x272889,_0x9ce326);};}exports[_0x38f8('0x5')]=function(_0x2a1621){for(var _0x30cf9c=0x0,_0x2e9819=events[_0x38f8('0x6')];_0x30cf9c<_0x2e9819;_0x30cf9c++){var _0x35401e=events[_0x30cf9c];var _0x5d7ae2=createListener(_0x38f8('0x7')+_0x35401e,_0x2a1621);ChatInternalMessageEvents['on'](_0x35401e,_0x5d7ae2);}}; \ No newline at end of file +var _0xbab5=['length','./chatInternalMessage.events','save','remove','emit','removeListener'];(function(_0x2f81d2,_0x2fb23b){var _0x392650=function(_0x40d237){while(--_0x40d237){_0x2f81d2['push'](_0x2f81d2['shift']());}};_0x392650(++_0x2fb23b);}(_0xbab5,0xe5));var _0x5bab=function(_0x235f57,_0x3eeb52){_0x235f57=_0x235f57-0x0;var _0x4728f1=_0xbab5[_0x235f57];return _0x4728f1;};'use strict';var ChatInternalMessageEvents=require(_0x5bab('0x0'));var events=[_0x5bab('0x1'),_0x5bab('0x2'),'update'];function createListener(_0x12fb0f,_0x5f2141){return function(_0xbdec2f){_0x5f2141[_0x5bab('0x3')](_0x12fb0f,_0xbdec2f);};}function removeListener(_0x1282e5,_0x4de468){return function(){ChatInternalMessageEvents[_0x5bab('0x4')](_0x1282e5,_0x4de468);};}exports['register']=function(_0x83a500){for(var _0x272ee6=0x0,_0x331c69=events[_0x5bab('0x5')];_0x272ee6<_0x331c69;_0x272ee6++){var _0x454ddd=events[_0x272ee6];var _0x3e0116=createListener('chatInternalMessage:'+_0x454ddd,_0x83a500);ChatInternalMessageEvents['on'](_0x454ddd,_0x3e0116);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index 587b331..7c21f8c 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 _0x54e4=['post','create','put','update','delete','exports','multer','express','Router','fs-extra','../../components/interaction/service','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','describe','/users','getUsers','/:id','show'];(function(_0x317ab1,_0x42dcd6){var _0x7488db=function(_0x4e6d1f){while(--_0x4e6d1f){_0x317ab1['push'](_0x317ab1['shift']());}};_0x7488db(++_0x42dcd6);}(_0x54e4,0x156));var _0x454e=function(_0x185cfe,_0x50f560){_0x185cfe=_0x185cfe-0x0;var _0x106262=_0x54e4[_0x185cfe];return _0x106262;};'use strict';var multer=require(_0x454e('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x454e('0x1'));var router=express[_0x454e('0x2')]();var fs_extra=require(_0x454e('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x454e('0x4'));var config=require('../../config/environment');var controller=require(_0x454e('0x5'));router[_0x454e('0x6')]('/',auth[_0x454e('0x7')](),controller[_0x454e('0x8')]);router[_0x454e('0x6')](_0x454e('0x9'),auth[_0x454e('0x7')](),controller[_0x454e('0xa')]);router[_0x454e('0x6')](_0x454e('0xb'),auth[_0x454e('0x7')](),controller[_0x454e('0xc')]);router[_0x454e('0x6')](_0x454e('0xd'),auth['isAuthenticated'](),controller[_0x454e('0xe')]);router[_0x454e('0xf')]('/',auth[_0x454e('0x7')](),controller[_0x454e('0x10')]);router[_0x454e('0x11')](_0x454e('0xd'),controller[_0x454e('0x12')]);router[_0x454e('0x13')]('/:id',auth[_0x454e('0x7')](),controller['destroy']);module[_0x454e('0x14')]=router; \ No newline at end of file +var _0x5316=['create','put','update','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','isAuthenticated','get','describe','/users','getUsers','/:id','show','post'];(function(_0x29adb2,_0x48616f){var _0x250229=function(_0x22a883){while(--_0x22a883){_0x29adb2['push'](_0x29adb2['shift']());}};_0x250229(++_0x48616f);}(_0x5316,0x115));var _0x6531=function(_0x5743e3,_0x4a2aab){_0x5743e3=_0x5743e3-0x0;var _0x24d100=_0x5316[_0x5743e3];return _0x24d100;};'use strict';var multer=require(_0x6531('0x0'));var util=require('util');var path=require(_0x6531('0x1'));var timeout=require('connect-timeout');var express=require(_0x6531('0x2'));var router=express[_0x6531('0x3')]();var fs_extra=require(_0x6531('0x4'));var auth=require(_0x6531('0x5'));var interaction=require(_0x6531('0x6'));var config=require(_0x6531('0x7'));var controller=require(_0x6531('0x8'));router['get']('/',auth[_0x6531('0x9')](),controller['index']);router[_0x6531('0xa')]('/describe',auth[_0x6531('0x9')](),controller[_0x6531('0xb')]);router['get'](_0x6531('0xc'),auth[_0x6531('0x9')](),controller[_0x6531('0xd')]);router[_0x6531('0xa')](_0x6531('0xe'),auth[_0x6531('0x9')](),controller[_0x6531('0xf')]);router[_0x6531('0x10')]('/',auth[_0x6531('0x9')](),controller[_0x6531('0x11')]);router[_0x6531('0x12')](_0x6531('0xe'),controller[_0x6531('0x13')]);router['delete']('/:id',auth[_0x6531('0x9')](),controller[_0x6531('0x14')]);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 71cc9e0..87a2993 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 _0x0fd9=['DATE','STRING','exports','TEXT','medium','BOOLEAN','out'];(function(_0x4711fc,_0x31742c){var _0x4c1eaf=function(_0x1f4b2d){while(--_0x1f4b2d){_0x4711fc['push'](_0x4711fc['shift']());}};_0x4c1eaf(++_0x31742c);}(_0x0fd9,0xa3));var _0x90fd=function(_0x299784,_0xb0918f){_0x299784=_0x299784-0x0;var _0x5ab008=_0x0fd9[_0x299784];return _0x5ab008;};'use strict';var Sequelize=require('sequelize');module[_0x90fd('0x0')]={'body':{'type':Sequelize[_0x90fd('0x1')](_0x90fd('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x90fd('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x90fd('0x4')),'defaultValue':_0x90fd('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0x90fd('0x5')]},'providerName':{'type':Sequelize[_0x90fd('0x6')]},'providerResponse':{'type':Sequelize[_0x90fd('0x1')]}}; \ No newline at end of file +var _0x1beb=['sequelize','exports','medium','BOOLEAN','out','STRING','TEXT'];(function(_0x1eda20,_0x1149f4){var _0x31b953=function(_0x25f0d8){while(--_0x25f0d8){_0x1eda20['push'](_0x1eda20['shift']());}};_0x31b953(++_0x1149f4);}(_0x1beb,0x165));var _0xb1be=function(_0x12daf9,_0x4fbd4b){_0x12daf9=_0x12daf9-0x0;var _0x58c9f5=_0x1beb[_0x12daf9];return _0x58c9f5;};'use strict';var Sequelize=require(_0xb1be('0x0'));module[_0xb1be('0x1')]={'body':{'type':Sequelize['TEXT'](_0xb1be('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xb1be('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0xb1be('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xb1be('0x4')),'defaultValue':_0xb1be('0x4'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0xb1be('0x5')]},'providerResponse':{'type':Sequelize[_0xb1be('0x6')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index dec60dd..50ae247 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 _0xfc72=['readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','parse','formData','reject','chat','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','ContactId','Sequelize','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','result','catch','status','end','json','offset','undefined','count','limit','set','apply','save','destroy','stack','name','send','index','map','ChatMessage','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','find','create','body','update','describe','chat-interactions','accept','read'];(function(_0x4a21a9,_0x418f4c){var _0x28c8ab=function(_0x4726b2){while(--_0x4726b2){_0x4a21a9['push'](_0x4a21a9['shift']());}};_0x28c8ab(++_0x418f4c);}(_0xfc72,0x146));var _0x2fc7=function(_0x44b3f6,_0x2f0b79){_0x44b3f6=_0x44b3f6-0x0;var _0x4a6207=_0xfc72[_0x44b3f6];return _0x4a6207;};'use strict';var emlformat=require(_0x2fc7('0x0'));var rimraf=require(_0x2fc7('0x1'));var zipdir=require(_0x2fc7('0x2'));var jsonpatch=require(_0x2fc7('0x3'));var rp=require(_0x2fc7('0x4'));var moment=require(_0x2fc7('0x5'));var BPromise=require(_0x2fc7('0x6'));var Mustache=require(_0x2fc7('0x7'));var util=require('util');var path=require('path');var sox=require(_0x2fc7('0x8'));var csv=require('to-csv');var ejs=require(_0x2fc7('0x9'));var fs=require('fs');var fs_extra=require(_0x2fc7('0xa'));var _=require(_0x2fc7('0xb'));var squel=require(_0x2fc7('0xc'));var crypto=require(_0x2fc7('0xd'));var jsforce=require(_0x2fc7('0xe'));var deskjs=require(_0x2fc7('0xf'));var toCsv=require(_0x2fc7('0x10'));var querystring=require('querystring');var Papa=require(_0x2fc7('0x11'));var Redis=require(_0x2fc7('0x12'));var authService=require(_0x2fc7('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x2fc7('0x14'));var hardwareService=require(_0x2fc7('0x15'));var logger=require(_0x2fc7('0x16'))(_0x2fc7('0x17'));var utils=require(_0x2fc7('0x18'));var config=require(_0x2fc7('0x19'));var licenseUtil=require(_0x2fc7('0x1a'));var db=require(_0x2fc7('0x1b'))['db'];config[_0x2fc7('0x1c')]=_[_0x2fc7('0x1d')](config['redis'],{'host':_0x2fc7('0x1e'),'port':0x18eb});var socket=require(_0x2fc7('0x1f'))(new Redis(config[_0x2fc7('0x1c')]));require('./chatMessage.socket')['register'](socket);var jayson=require(_0x2fc7('0x20'));var client=jayson[_0x2fc7('0x21')][_0x2fc7('0x22')]({'port':0x232c});var client9002=jayson[_0x2fc7('0x21')]['http']({'port':0x232a});function respondWithRpcPromise(_0x16cbca,_0xa03d0c,_0x57b8fa,_0x2e718b){return new BPromise(function(_0x4a6dce,_0x1624d3){var _0x3d3380=_0x2e718b||client;return _0x3d3380[_0x2fc7('0x23')](_0x16cbca,_0x57b8fa)[_0x2fc7('0x24')](function(_0x46fa21){logger[_0x2fc7('0x25')]('ChatMessage,\x20%s,\x20%s',_0xa03d0c,_0x2fc7('0x26'));logger[_0x2fc7('0x27')](_0x2fc7('0x28'),_0xa03d0c,_0x2fc7('0x26'),JSON[_0x2fc7('0x29')](_0x46fa21));if(_0x46fa21[_0x2fc7('0x2a')]){if(_0x46fa21[_0x2fc7('0x2a')][_0x2fc7('0x2b')]===0x1f4){logger['error'](_0x2fc7('0x2c'),_0xa03d0c,_0x46fa21[_0x2fc7('0x2a')][_0x2fc7('0x2d')]);return _0x1624d3(_0x46fa21[_0x2fc7('0x2a')][_0x2fc7('0x2d')]);}logger[_0x2fc7('0x2a')](_0x2fc7('0x2c'),_0xa03d0c,_0x46fa21[_0x2fc7('0x2a')][_0x2fc7('0x2d')]);return _0x4a6dce(_0x46fa21[_0x2fc7('0x2a')]['message']);}else{logger[_0x2fc7('0x25')](_0x2fc7('0x2c'),_0xa03d0c,'request\x20sent');_0x4a6dce(_0x46fa21[_0x2fc7('0x2e')][_0x2fc7('0x2d')]);}})[_0x2fc7('0x2f')](function(_0x4523d2){logger[_0x2fc7('0x2a')](_0x2fc7('0x2c'),_0xa03d0c,_0x4523d2);_0x1624d3(_0x4523d2);});});}function respondWithStatusCode(_0x1844b3,_0x116d95){_0x116d95=_0x116d95||0xcc;return function(_0x79dd1b){if(_0x79dd1b){return _0x1844b3['sendStatus'](_0x116d95);}return _0x1844b3[_0x2fc7('0x30')](_0x116d95)[_0x2fc7('0x31')]();};}function respondWithResult(_0x40f2b2,_0x48a72c){_0x48a72c=_0x48a72c||0xc8;return function(_0x1afdba){if(_0x1afdba){return _0x40f2b2[_0x2fc7('0x30')](_0x48a72c)[_0x2fc7('0x32')](_0x1afdba);}};}function respondWithFilteredResult(_0x13eabb,_0x5b12ff){return function(_0x15bd17){if(_0x15bd17){var _0x227729=typeof _0x5b12ff[_0x2fc7('0x33')]===_0x2fc7('0x34')&&typeof _0x5b12ff['limit']===_0x2fc7('0x34');var _0x4b2bd5=_0x15bd17[_0x2fc7('0x35')];var _0x24a200=_0x227729?0x0:_0x5b12ff[_0x2fc7('0x33')];var _0x50bbc8=_0x227729?_0x15bd17[_0x2fc7('0x35')]:_0x5b12ff[_0x2fc7('0x33')]+_0x5b12ff[_0x2fc7('0x36')];var _0x26e92a;if(_0x50bbc8>=_0x4b2bd5){_0x50bbc8=_0x4b2bd5;_0x26e92a=0xc8;}else{_0x26e92a=0xce;}_0x13eabb[_0x2fc7('0x30')](_0x26e92a);return _0x13eabb[_0x2fc7('0x37')]('Content-Range',_0x24a200+'-'+_0x50bbc8+'/'+_0x4b2bd5)[_0x2fc7('0x32')](_0x15bd17);}return null;};}function patchUpdates(_0x4c4650){return function(_0x194fc6){try{jsonpatch[_0x2fc7('0x38')](_0x194fc6,_0x4c4650,!![]);}catch(_0x1cfc70){return BPromise['reject'](_0x1cfc70);}return _0x194fc6[_0x2fc7('0x39')]();};}function saveUpdates(_0xeebe7d,_0x8391c8){return function(_0x2c05d0){if(_0x2c05d0){return _0x2c05d0['update'](_0xeebe7d)[_0x2fc7('0x24')](function(_0x4b9a03){return _0x4b9a03;});}return null;};}function removeEntity(_0x37319c,_0x115e27){return function(_0x3867d7){if(_0x3867d7){return _0x3867d7[_0x2fc7('0x3a')]()['then'](function(){_0x37319c[_0x2fc7('0x30')](0xcc)[_0x2fc7('0x31')]();});}};}function handleEntityNotFound(_0x27ab4c,_0x532cac){return function(_0x3606c7){if(!_0x3606c7){_0x27ab4c['sendStatus'](0x194);}return _0x3606c7;};}function handleError(_0x1a57ad,_0x50034e){_0x50034e=_0x50034e||0x1f4;return function(_0x8798c6){logger[_0x2fc7('0x2a')](_0x8798c6[_0x2fc7('0x3b')]);if(_0x8798c6[_0x2fc7('0x3c')]){delete _0x8798c6[_0x2fc7('0x3c')];}_0x1a57ad[_0x2fc7('0x30')](_0x50034e)[_0x2fc7('0x3d')](_0x8798c6);};}exports[_0x2fc7('0x3e')]=function(_0x4c9381,_0x5c01ff){var _0x5abd1b={},_0x59c27c={},_0x1e82ea={'count':0x0,'rows':[]};var _0x342b4a=_[_0x2fc7('0x3f')](db[_0x2fc7('0x40')][_0x2fc7('0x41')],function(_0x3c4086){return{'name':_0x3c4086[_0x2fc7('0x42')],'type':_0x3c4086[_0x2fc7('0x43')][_0x2fc7('0x44')]};});_0x59c27c[_0x2fc7('0x45')]=_['map'](_0x342b4a,'name');_0x59c27c['query']=_['keys'](_0x4c9381[_0x2fc7('0x46')]);_0x59c27c[_0x2fc7('0x47')]=_[_0x2fc7('0x48')](_0x59c27c[_0x2fc7('0x45')],_0x59c27c[_0x2fc7('0x46')]);_0x5abd1b[_0x2fc7('0x49')]=_[_0x2fc7('0x48')](_0x59c27c[_0x2fc7('0x45')],qs[_0x2fc7('0x4a')](_0x4c9381['query'][_0x2fc7('0x4a')]));_0x5abd1b['attributes']=_0x5abd1b[_0x2fc7('0x49')][_0x2fc7('0x4b')]?_0x5abd1b['attributes']:_0x59c27c['model'];if(!_0x4c9381[_0x2fc7('0x46')][_0x2fc7('0x4c')](_0x2fc7('0x4d'))){_0x5abd1b[_0x2fc7('0x36')]=qs[_0x2fc7('0x36')](_0x4c9381[_0x2fc7('0x46')][_0x2fc7('0x36')]);_0x5abd1b[_0x2fc7('0x33')]=qs[_0x2fc7('0x33')](_0x4c9381[_0x2fc7('0x46')][_0x2fc7('0x33')]);}_0x5abd1b[_0x2fc7('0x4e')]=qs[_0x2fc7('0x4f')](_0x4c9381[_0x2fc7('0x46')][_0x2fc7('0x4f')]);_0x5abd1b['where']=qs[_0x2fc7('0x47')](_['pick'](_0x4c9381['query'],_0x59c27c[_0x2fc7('0x47')]),_0x342b4a);if(_0x4c9381[_0x2fc7('0x46')][_0x2fc7('0x50')]){_0x5abd1b[_0x2fc7('0x51')]=_[_0x2fc7('0x52')](_0x5abd1b[_0x2fc7('0x51')],{'$or':_[_0x2fc7('0x3f')](_0x342b4a,function(_0x44a0a7){if(_0x44a0a7[_0x2fc7('0x43')]!==_0x2fc7('0x53')){var _0x476421={};_0x476421[_0x44a0a7[_0x2fc7('0x3c')]]={'$like':'%'+_0x4c9381[_0x2fc7('0x46')][_0x2fc7('0x50')]+'%'};return _0x476421;}})});}_0x5abd1b=_[_0x2fc7('0x52')]({},_0x5abd1b,_0x4c9381[_0x2fc7('0x54')]);var _0x5a3e50={'where':_0x5abd1b[_0x2fc7('0x51')]};return db[_0x2fc7('0x40')]['count'](_0x5a3e50)[_0x2fc7('0x24')](function(_0x38d6a7){_0x1e82ea[_0x2fc7('0x35')]=_0x38d6a7;if(_0x4c9381['query'][_0x2fc7('0x55')]){_0x5abd1b[_0x2fc7('0x56')]=[{'all':!![]}];}return db[_0x2fc7('0x40')][_0x2fc7('0x57')](_0x5abd1b);})[_0x2fc7('0x24')](function(_0x5c64f4){_0x1e82ea[_0x2fc7('0x58')]=_0x5c64f4;return _0x1e82ea;})[_0x2fc7('0x24')](respondWithFilteredResult(_0x5c01ff,_0x5abd1b))[_0x2fc7('0x2f')](handleError(_0x5c01ff,null));};exports[_0x2fc7('0x59')]=function(_0x4119dc,_0x4bb35c){var _0x34bb13={'raw':!![],'where':{'id':_0x4119dc[_0x2fc7('0x5a')]['id']}},_0x914474={};_0x914474['model']=_[_0x2fc7('0x5b')](db[_0x2fc7('0x40')][_0x2fc7('0x41')]);_0x914474['query']=_['keys'](_0x4119dc[_0x2fc7('0x46')]);_0x914474[_0x2fc7('0x47')]=_[_0x2fc7('0x48')](_0x914474['model'],_0x914474[_0x2fc7('0x46')]);_0x34bb13[_0x2fc7('0x49')]=_[_0x2fc7('0x48')](_0x914474['model'],qs[_0x2fc7('0x4a')](_0x4119dc[_0x2fc7('0x46')][_0x2fc7('0x4a')]));_0x34bb13[_0x2fc7('0x49')]=_0x34bb13[_0x2fc7('0x49')]['length']?_0x34bb13[_0x2fc7('0x49')]:_0x914474['model'];if(_0x4119dc[_0x2fc7('0x46')][_0x2fc7('0x55')]){_0x34bb13[_0x2fc7('0x56')]=[{'all':!![]}];}_0x34bb13=_['merge']({},_0x34bb13,_0x4119dc[_0x2fc7('0x54')]);return db[_0x2fc7('0x40')][_0x2fc7('0x5c')](_0x34bb13)[_0x2fc7('0x24')](handleEntityNotFound(_0x4bb35c,null))[_0x2fc7('0x24')](respondWithResult(_0x4bb35c,null))[_0x2fc7('0x2f')](handleError(_0x4bb35c,null));};exports[_0x2fc7('0x5d')]=function(_0x322b3d,_0x350d4c){return db[_0x2fc7('0x40')][_0x2fc7('0x5d')](_0x322b3d[_0x2fc7('0x5e')],{})[_0x2fc7('0x24')](respondWithResult(_0x350d4c,0xc9))['catch'](handleError(_0x350d4c,null));};exports[_0x2fc7('0x5f')]=function(_0x5428a0,_0x5726d0){if(_0x5428a0[_0x2fc7('0x5e')]['id']){delete _0x5428a0['body']['id'];}return db[_0x2fc7('0x40')][_0x2fc7('0x5c')]({'where':{'id':_0x5428a0[_0x2fc7('0x5a')]['id']}})[_0x2fc7('0x24')](handleEntityNotFound(_0x5726d0,null))[_0x2fc7('0x24')](saveUpdates(_0x5428a0[_0x2fc7('0x5e')],null))[_0x2fc7('0x24')](respondWithResult(_0x5726d0,null))[_0x2fc7('0x2f')](handleError(_0x5726d0,null));};exports[_0x2fc7('0x3a')]=function(_0x5b107b,_0x16dd54){return db[_0x2fc7('0x40')][_0x2fc7('0x5c')]({'where':{'id':_0x5b107b['params']['id']}})[_0x2fc7('0x24')](handleEntityNotFound(_0x16dd54,null))[_0x2fc7('0x24')](removeEntity(_0x16dd54,null))[_0x2fc7('0x2f')](handleError(_0x16dd54,null));};exports['describe']=function(_0xc7e977,_0x5514c2){return db[_0x2fc7('0x40')][_0x2fc7('0x60')]()[_0x2fc7('0x24')](respondWithResult(_0x5514c2,null))[_0x2fc7('0x2f')](handleError(_0x5514c2,null));};var interaction_log=require('../../config/logger')(_0x2fc7('0x61'));exports[_0x2fc7('0x62')]=function(_0x58e0af,_0x51e370,_0x1da6ae){var _0x258475={'agent':{},'channel':'chat'};if(_0x58e0af[_0x2fc7('0x5e')]['id']){delete _0x58e0af[_0x2fc7('0x5e')]['id'];}_0x58e0af[_0x2fc7('0x5e')][_0x2fc7('0x63')]=!![];_0x58e0af[_0x2fc7('0x5e')][_0x2fc7('0x64')]=moment()[_0x2fc7('0x65')](_0x2fc7('0x66'));_0x58e0af[_0x2fc7('0x5e')][_0x2fc7('0x67')]=_0x58e0af['body'][_0x2fc7('0x67')]||_0x58e0af[_0x2fc7('0x68')]['id'];_0x258475[_0x2fc7('0x69')]['id']=_0x58e0af[_0x2fc7('0x5e')][_0x2fc7('0x67')];return db[_0x2fc7('0x40')][_0x2fc7('0x5c')]({'where':{'id':_0x58e0af['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x51e370,null))[_0x2fc7('0x24')](saveUpdates(_0x58e0af[_0x2fc7('0x5e')],null))[_0x2fc7('0x24')](function(_0x43b2e9){if(_0x43b2e9){_0x258475[_0x2fc7('0x2d')]=_0x43b2e9[_0x2fc7('0x6a')]({'plain':!![]});return db[_0x2fc7('0x6b')][_0x2fc7('0x5c')]({'where':{'id':_0x43b2e9[_0x2fc7('0x6c')]}});}return null;})[_0x2fc7('0x24')](handleEntityNotFound(_0x51e370,null))['then'](function(_0xaeca3e){if(_0xaeca3e){return _0xaeca3e[_0x2fc7('0x5f')]({'UserId':_0x58e0af[_0x2fc7('0x5e')][_0x2fc7('0x67')],'read1stAt':_[_0x2fc7('0x6d')](_0xaeca3e[_0x2fc7('0x6e')])?moment()[_0x2fc7('0x65')](_0x2fc7('0x66')):undefined});}return null;})[_0x2fc7('0x24')](function(_0x5d90a4){if(_0x5d90a4){_0x258475[_0x2fc7('0x6f')]=_0x5d90a4[_0x2fc7('0x6a')]({'plain':!![]});interaction_log['info'](_0x2fc7('0x70'),_0x58e0af[_0x2fc7('0x68')]['id'],_0x58e0af[_0x2fc7('0x68')][_0x2fc7('0x3c')],_0x58e0af[_0x2fc7('0x68')]['role'],_0x258475['interaction']['id'],_0x58e0af[_0x2fc7('0x5e')]?JSON['stringify'](_0x58e0af['body']):_0x2fc7('0x71'));return respondWithRpcPromise(_0x2fc7('0x72'),'acceptMessage',_0x258475);}return null;})[_0x2fc7('0x24')](function(_0x468fca){var _0x338bd7=_0x2fc7('0x73')+_0x468fca[_0x2fc7('0x2d')]['ContactId'];return db[_0x2fc7('0x74')]['query'](_0x338bd7,{'type':db['Sequelize'][_0x2fc7('0x75')][_0x2fc7('0x76')],'raw':!![]})[_0x2fc7('0x24')](function(_0x5444fc){return _0x5444fc;});})[_0x2fc7('0x24')](function(_0x5a72af){if(_0x5a72af){_0x258475['message'][_0x2fc7('0x77')]=_0x5a72af[0x0];if(!_0x58e0af[_0x2fc7('0x5e')][_0x2fc7('0x67')])return;return db[_0x2fc7('0x78')][_0x2fc7('0x5c')]({'where':{'id':_0x58e0af[_0x2fc7('0x5e')][_0x2fc7('0x67')],'role':_0x2fc7('0x69')},'attributes':['id','name',_0x2fc7('0x79'),_0x2fc7('0x7a'),_0x2fc7('0x7b')],'raw':!![]});}return null;})[_0x2fc7('0x24')](function(_0xa4935a){if(!_0xa4935a)return null;_0x258475[_0x2fc7('0x2d')][_0x2fc7('0x69')]=_0xa4935a;return _0x258475;})[_0x2fc7('0x24')](function(_0x28873c){if(_0x28873c){if(_0x58e0af['body'][_0x2fc7('0x7c')]){_0x258475[_0x2fc7('0x2d')][_0x2fc7('0x7d')]=util[_0x2fc7('0x65')](_0x2fc7('0x7e'),_0x58e0af[_0x2fc7('0x68')][_0x2fc7('0x3c')]);_0x258475[_0x2fc7('0x2d')][_0x2fc7('0x7f')]=_0x258475[_0x2fc7('0x7f')];_0x258475['message'][_0x2fc7('0x80')]=_0x258475[_0x2fc7('0x7f')];_0x258475[_0x2fc7('0x2d')][_0x2fc7('0x81')]=_0x2fc7('0x62');return respondWithRpcPromise(_0x2fc7('0x82'),'EventManager',{'event':_0x2fc7('0x83'),'message':_['merge'](_0x258475[_0x2fc7('0x2d')],JSON[_0x2fc7('0x84')](_0x258475[_0x2fc7('0x6f')][_0x2fc7('0x85')]))},client9002)[_0x2fc7('0x24')](function(){return _0x258475;});}return _0x258475;}return null;})[_0x2fc7('0x24')](respondWithResult(_0x51e370,null))[_0x2fc7('0x2f')](handleError(_0x51e370,null));};var interaction_log=require(_0x2fc7('0x16'))(_0x2fc7('0x61'));exports[_0x2fc7('0x86')]=function(_0x28d156,_0x48ed90,_0x457482){var _0x5814c1={'agent':{},'channel':_0x2fc7('0x87')};if(_0x28d156[_0x2fc7('0x5e')]['id']){delete _0x28d156[_0x2fc7('0x5e')]['id'];}_0x28d156[_0x2fc7('0x5e')]['UserId']=_0x28d156['body'][_0x2fc7('0x67')]||_0x28d156[_0x2fc7('0x68')]['id'];_0x5814c1['agent']['id']=_0x28d156[_0x2fc7('0x5e')]['UserId'];return db['ChatMessage'][_0x2fc7('0x5c')]({'where':{'id':_0x28d156[_0x2fc7('0x5a')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x48ed90,null))[_0x2fc7('0x24')](function(_0x59ee81){if(_0x59ee81){_0x5814c1[_0x2fc7('0x2d')]=_0x59ee81[_0x2fc7('0x6a')]({'plain':!![]});return db[_0x2fc7('0x6b')][_0x2fc7('0x5c')]({'where':{'id':_0x59ee81[_0x2fc7('0x6c')]}});}return null;})[_0x2fc7('0x24')](handleEntityNotFound(_0x48ed90,null))[_0x2fc7('0x24')](function(_0x30c81b){if(_0x30c81b){_0x5814c1[_0x2fc7('0x6f')]=_0x30c81b['get']({'plain':!![]});interaction_log[_0x2fc7('0x25')](_0x2fc7('0x88'),_0x28d156[_0x2fc7('0x68')]['id'],_0x28d156['user'][_0x2fc7('0x3c')],_0x28d156[_0x2fc7('0x68')][_0x2fc7('0x89')],_0x5814c1['interaction']['id'],_0x28d156[_0x2fc7('0x5e')]?JSON[_0x2fc7('0x29')](_0x28d156['body']):_0x2fc7('0x71'));return respondWithRpcPromise(_0x2fc7('0x8a'),_0x2fc7('0x8b'),_0x5814c1);}return null;})['then'](function(_0x5c3d2b){var _0x55ca43=_0x2fc7('0x73')+_0x5c3d2b['message'][_0x2fc7('0x8c')];return db[_0x2fc7('0x74')][_0x2fc7('0x46')](_0x55ca43,{'type':db[_0x2fc7('0x8d')]['QueryTypes'][_0x2fc7('0x76')],'raw':!![]})[_0x2fc7('0x24')](function(_0xfae901){return _0xfae901;});})[_0x2fc7('0x24')](function(_0x509d12){if(_0x509d12){_0x5814c1['message']['contact']=_0x509d12[0x0];if(!_0x28d156[_0x2fc7('0x5e')][_0x2fc7('0x67')])return;return db[_0x2fc7('0x78')]['find']({'where':{'id':_0x28d156[_0x2fc7('0x5e')][_0x2fc7('0x67')],'role':_0x2fc7('0x69')},'attributes':['id',_0x2fc7('0x3c'),_0x2fc7('0x79'),_0x2fc7('0x7a'),'internal'],'raw':!![]});}return null;})[_0x2fc7('0x24')](function(_0x41756e){if(!_0x41756e)return null;_0x5814c1[_0x2fc7('0x2d')][_0x2fc7('0x69')]=_0x41756e;return _0x5814c1;})[_0x2fc7('0x24')](function(_0x2ee474){if(_0x2ee474){_0x2ee474[_0x2fc7('0x2d')]['interface']=util[_0x2fc7('0x65')]('SIP/%s',_0x28d156[_0x2fc7('0x68')][_0x2fc7('0x3c')]);_0x2ee474['message'][_0x2fc7('0x7f')]=_0x5814c1[_0x2fc7('0x7f')];_0x2ee474[_0x2fc7('0x2d')][_0x2fc7('0x80')]=_0x5814c1[_0x2fc7('0x7f')];_0x2ee474[_0x2fc7('0x2d')]['event']=_0x2fc7('0x86');respondWithRpcPromise(_0x2fc7('0x82'),'EventManager',{'event':'rejectmessage','message':_['merge'](_0x5814c1[_0x2fc7('0x2d')],JSON[_0x2fc7('0x84')](_0x5814c1[_0x2fc7('0x6f')][_0x2fc7('0x85')]))},client9002);return _0x5814c1;}return null;})[_0x2fc7('0x24')](respondWithResult(_0x48ed90,null))['catch'](handleError(_0x48ed90,null));}; \ No newline at end of file +var _0x0873=['attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','find','create','body','params','describe','chat-interactions','accept','chat','read','readAt','format','UserId','user','agent','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','SELECT','fullname','email','internal','manual','interface','channel','event','EventManager','parse','interaction','formData','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','QueryTypes','User','motionChannel','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','redis','localhost','./chatMessage.socket','register','jayson/promise','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','map','ChatMessage','rawAttributes','fieldName','type','key','model','keys','query','filters'];(function(_0x35e9a8,_0x22bef3){var _0x470a34=function(_0x2e7c9d){while(--_0x2e7c9d){_0x35e9a8['push'](_0x35e9a8['shift']());}};_0x470a34(++_0x22bef3);}(_0x0873,0x153));var _0x3087=function(_0x1a231a,_0x3a0830){_0x1a231a=_0x1a231a-0x0;var _0x4a25e0=_0x0873[_0x1a231a];return _0x4a25e0;};'use strict';var emlformat=require(_0x3087('0x0'));var rimraf=require(_0x3087('0x1'));var zipdir=require(_0x3087('0x2'));var jsonpatch=require(_0x3087('0x3'));var rp=require(_0x3087('0x4'));var moment=require('moment');var BPromise=require(_0x3087('0x5'));var Mustache=require(_0x3087('0x6'));var util=require(_0x3087('0x7'));var path=require(_0x3087('0x8'));var sox=require(_0x3087('0x9'));var csv=require('to-csv');var ejs=require(_0x3087('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x3087('0xb'));var crypto=require(_0x3087('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x3087('0xd'));var toCsv=require(_0x3087('0xe'));var querystring=require(_0x3087('0xf'));var Papa=require('papaparse');var Redis=require(_0x3087('0x10'));var authService=require(_0x3087('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x3087('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3087('0x13'))(_0x3087('0x14'));var utils=require(_0x3087('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x3087('0x16'))['db'];config['redis']=_['defaults'](config[_0x3087('0x17')],{'host':_0x3087('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3087('0x17')]));require(_0x3087('0x19'))[_0x3087('0x1a')](socket);var jayson=require(_0x3087('0x1b'));var client=jayson[_0x3087('0x1c')][_0x3087('0x1d')]({'port':0x232c});var client9002=jayson[_0x3087('0x1c')][_0x3087('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x250764,_0x1f1691,_0x52a6a5,_0x333b4f){return new BPromise(function(_0x3c8cae,_0x3e879e){var _0xb919fd=_0x333b4f||client;return _0xb919fd[_0x3087('0x1e')](_0x250764,_0x52a6a5)[_0x3087('0x1f')](function(_0x2f40cc){logger[_0x3087('0x20')](_0x3087('0x21'),_0x1f1691,'request\x20sent');logger[_0x3087('0x22')](_0x3087('0x23'),_0x1f1691,_0x3087('0x24'),JSON[_0x3087('0x25')](_0x2f40cc));if(_0x2f40cc['error']){if(_0x2f40cc[_0x3087('0x26')][_0x3087('0x27')]===0x1f4){logger[_0x3087('0x26')]('ChatMessage,\x20%s,\x20%s',_0x1f1691,_0x2f40cc[_0x3087('0x26')][_0x3087('0x28')]);return _0x3e879e(_0x2f40cc[_0x3087('0x26')][_0x3087('0x28')]);}logger[_0x3087('0x26')](_0x3087('0x21'),_0x1f1691,_0x2f40cc[_0x3087('0x26')][_0x3087('0x28')]);return _0x3c8cae(_0x2f40cc['error'][_0x3087('0x28')]);}else{logger[_0x3087('0x20')](_0x3087('0x21'),_0x1f1691,_0x3087('0x24'));_0x3c8cae(_0x2f40cc['result'][_0x3087('0x28')]);}})['catch'](function(_0x402c58){logger[_0x3087('0x26')](_0x3087('0x21'),_0x1f1691,_0x402c58);_0x3e879e(_0x402c58);});});}function respondWithStatusCode(_0x4d83bf,_0x828590){_0x828590=_0x828590||0xcc;return function(_0x21681e){if(_0x21681e){return _0x4d83bf['sendStatus'](_0x828590);}return _0x4d83bf[_0x3087('0x29')](_0x828590)[_0x3087('0x2a')]();};}function respondWithResult(_0x1d5d1e,_0x39ba88){_0x39ba88=_0x39ba88||0xc8;return function(_0xf26d76){if(_0xf26d76){return _0x1d5d1e['status'](_0x39ba88)[_0x3087('0x2b')](_0xf26d76);}};}function respondWithFilteredResult(_0x4d8f9a,_0x2daac5){return function(_0x1306c9){if(_0x1306c9){var _0x406f97=typeof _0x2daac5[_0x3087('0x2c')]==='undefined'&&typeof _0x2daac5[_0x3087('0x2d')]===_0x3087('0x2e');var _0x353823=_0x1306c9[_0x3087('0x2f')];var _0x4c2d95=_0x406f97?0x0:_0x2daac5['offset'];var _0x2e084c=_0x406f97?_0x1306c9['count']:_0x2daac5[_0x3087('0x2c')]+_0x2daac5[_0x3087('0x2d')];var _0x5dbc57;if(_0x2e084c>=_0x353823){_0x2e084c=_0x353823;_0x5dbc57=0xc8;}else{_0x5dbc57=0xce;}_0x4d8f9a[_0x3087('0x29')](_0x5dbc57);return _0x4d8f9a[_0x3087('0x30')](_0x3087('0x31'),_0x4c2d95+'-'+_0x2e084c+'/'+_0x353823)[_0x3087('0x2b')](_0x1306c9);}return null;};}function patchUpdates(_0x5ad6bd){return function(_0x2984be){try{jsonpatch[_0x3087('0x32')](_0x2984be,_0x5ad6bd,!![]);}catch(_0x4fab88){return BPromise[_0x3087('0x33')](_0x4fab88);}return _0x2984be[_0x3087('0x34')]();};}function saveUpdates(_0x4233c9,_0x53a188){return function(_0x428436){if(_0x428436){return _0x428436[_0x3087('0x35')](_0x4233c9)['then'](function(_0x520af9){return _0x520af9;});}return null;};}function removeEntity(_0x28866a,_0xc8ca0a){return function(_0x4f38c0){if(_0x4f38c0){return _0x4f38c0[_0x3087('0x36')]()[_0x3087('0x1f')](function(){_0x28866a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4c7b66,_0x272873){return function(_0x589ebd){if(!_0x589ebd){_0x4c7b66['sendStatus'](0x194);}return _0x589ebd;};}function handleError(_0x413311,_0x10176c){_0x10176c=_0x10176c||0x1f4;return function(_0x19bcee){logger[_0x3087('0x26')](_0x19bcee[_0x3087('0x37')]);if(_0x19bcee[_0x3087('0x38')]){delete _0x19bcee['name'];}_0x413311[_0x3087('0x29')](_0x10176c)[_0x3087('0x39')](_0x19bcee);};}exports[_0x3087('0x3a')]=function(_0x45a5b3,_0x1d6d48){var _0x42fcb0={},_0x574ef9={},_0x4343ef={'count':0x0,'rows':[]};var _0x54ff8e=_[_0x3087('0x3b')](db[_0x3087('0x3c')][_0x3087('0x3d')],function(_0x307c3c){return{'name':_0x307c3c[_0x3087('0x3e')],'type':_0x307c3c[_0x3087('0x3f')][_0x3087('0x40')]};});_0x574ef9[_0x3087('0x41')]=_['map'](_0x54ff8e,_0x3087('0x38'));_0x574ef9['query']=_[_0x3087('0x42')](_0x45a5b3[_0x3087('0x43')]);_0x574ef9[_0x3087('0x44')]=_['intersection'](_0x574ef9[_0x3087('0x41')],_0x574ef9['query']);_0x42fcb0[_0x3087('0x45')]=_[_0x3087('0x46')](_0x574ef9[_0x3087('0x41')],qs[_0x3087('0x47')](_0x45a5b3[_0x3087('0x43')][_0x3087('0x47')]));_0x42fcb0[_0x3087('0x45')]=_0x42fcb0['attributes'][_0x3087('0x48')]?_0x42fcb0[_0x3087('0x45')]:_0x574ef9[_0x3087('0x41')];if(!_0x45a5b3[_0x3087('0x43')][_0x3087('0x49')](_0x3087('0x4a'))){_0x42fcb0[_0x3087('0x2d')]=qs[_0x3087('0x2d')](_0x45a5b3[_0x3087('0x43')][_0x3087('0x2d')]);_0x42fcb0[_0x3087('0x2c')]=qs['offset'](_0x45a5b3['query'][_0x3087('0x2c')]);}_0x42fcb0[_0x3087('0x4b')]=qs[_0x3087('0x4c')](_0x45a5b3['query'][_0x3087('0x4c')]);_0x42fcb0['where']=qs[_0x3087('0x44')](_[_0x3087('0x4d')](_0x45a5b3[_0x3087('0x43')],_0x574ef9[_0x3087('0x44')]),_0x54ff8e);if(_0x45a5b3[_0x3087('0x43')][_0x3087('0x4e')]){_0x42fcb0[_0x3087('0x4f')]=_[_0x3087('0x50')](_0x42fcb0['where'],{'$or':_['map'](_0x54ff8e,function(_0xedc4f5){if(_0xedc4f5[_0x3087('0x3f')]!==_0x3087('0x51')){var _0x44a5c6={};_0x44a5c6[_0xedc4f5[_0x3087('0x38')]]={'$like':'%'+_0x45a5b3[_0x3087('0x43')][_0x3087('0x4e')]+'%'};return _0x44a5c6;}})});}_0x42fcb0=_[_0x3087('0x50')]({},_0x42fcb0,_0x45a5b3[_0x3087('0x52')]);var _0xd7825={'where':_0x42fcb0[_0x3087('0x4f')]};return db[_0x3087('0x3c')][_0x3087('0x2f')](_0xd7825)[_0x3087('0x1f')](function(_0xa2cd2e){_0x4343ef[_0x3087('0x2f')]=_0xa2cd2e;if(_0x45a5b3['query'][_0x3087('0x53')]){_0x42fcb0[_0x3087('0x54')]=[{'all':!![]}];}return db[_0x3087('0x3c')][_0x3087('0x55')](_0x42fcb0);})[_0x3087('0x1f')](function(_0x274c9c){_0x4343ef[_0x3087('0x56')]=_0x274c9c;return _0x4343ef;})[_0x3087('0x1f')](respondWithFilteredResult(_0x1d6d48,_0x42fcb0))[_0x3087('0x57')](handleError(_0x1d6d48,null));};exports['show']=function(_0x47f866,_0x50742e){var _0x1a28f8={'raw':!![],'where':{'id':_0x47f866['params']['id']}},_0x4043c0={};_0x4043c0['model']=_[_0x3087('0x42')](db[_0x3087('0x3c')]['rawAttributes']);_0x4043c0[_0x3087('0x43')]=_[_0x3087('0x42')](_0x47f866[_0x3087('0x43')]);_0x4043c0[_0x3087('0x44')]=_[_0x3087('0x46')](_0x4043c0[_0x3087('0x41')],_0x4043c0[_0x3087('0x43')]);_0x1a28f8[_0x3087('0x45')]=_[_0x3087('0x46')](_0x4043c0[_0x3087('0x41')],qs['fields'](_0x47f866[_0x3087('0x43')][_0x3087('0x47')]));_0x1a28f8[_0x3087('0x45')]=_0x1a28f8['attributes'][_0x3087('0x48')]?_0x1a28f8[_0x3087('0x45')]:_0x4043c0[_0x3087('0x41')];if(_0x47f866['query']['includeAll']){_0x1a28f8['include']=[{'all':!![]}];}_0x1a28f8=_['merge']({},_0x1a28f8,_0x47f866[_0x3087('0x52')]);return db['ChatMessage'][_0x3087('0x58')](_0x1a28f8)[_0x3087('0x1f')](handleEntityNotFound(_0x50742e,null))[_0x3087('0x1f')](respondWithResult(_0x50742e,null))[_0x3087('0x57')](handleError(_0x50742e,null));};exports[_0x3087('0x59')]=function(_0x171dbb,_0xfed153){return db['ChatMessage'][_0x3087('0x59')](_0x171dbb['body'],{})[_0x3087('0x1f')](respondWithResult(_0xfed153,0xc9))[_0x3087('0x57')](handleError(_0xfed153,null));};exports['update']=function(_0x2750e6,_0x11f25d){if(_0x2750e6[_0x3087('0x5a')]['id']){delete _0x2750e6['body']['id'];}return db[_0x3087('0x3c')][_0x3087('0x58')]({'where':{'id':_0x2750e6['params']['id']}})[_0x3087('0x1f')](handleEntityNotFound(_0x11f25d,null))[_0x3087('0x1f')](saveUpdates(_0x2750e6[_0x3087('0x5a')],null))['then'](respondWithResult(_0x11f25d,null))[_0x3087('0x57')](handleError(_0x11f25d,null));};exports[_0x3087('0x36')]=function(_0x5dce3d,_0xe4b846){return db[_0x3087('0x3c')][_0x3087('0x58')]({'where':{'id':_0x5dce3d[_0x3087('0x5b')]['id']}})[_0x3087('0x1f')](handleEntityNotFound(_0xe4b846,null))[_0x3087('0x1f')](removeEntity(_0xe4b846,null))[_0x3087('0x57')](handleError(_0xe4b846,null));};exports[_0x3087('0x5c')]=function(_0x3e1f6b,_0x8c570f){return db[_0x3087('0x3c')][_0x3087('0x5c')]()['then'](respondWithResult(_0x8c570f,null))['catch'](handleError(_0x8c570f,null));};var interaction_log=require(_0x3087('0x13'))(_0x3087('0x5d'));exports[_0x3087('0x5e')]=function(_0x2d2ce7,_0x29c5d8,_0x51f1ad){var _0x20c380={'agent':{},'channel':_0x3087('0x5f')};if(_0x2d2ce7[_0x3087('0x5a')]['id']){delete _0x2d2ce7[_0x3087('0x5a')]['id'];}_0x2d2ce7[_0x3087('0x5a')][_0x3087('0x60')]=!![];_0x2d2ce7[_0x3087('0x5a')][_0x3087('0x61')]=moment()[_0x3087('0x62')]('YYYY-MM-DD\x20HH:mm:ss');_0x2d2ce7[_0x3087('0x5a')][_0x3087('0x63')]=_0x2d2ce7[_0x3087('0x5a')][_0x3087('0x63')]||_0x2d2ce7[_0x3087('0x64')]['id'];_0x20c380[_0x3087('0x65')]['id']=_0x2d2ce7[_0x3087('0x5a')][_0x3087('0x63')];return db[_0x3087('0x3c')][_0x3087('0x58')]({'where':{'id':_0x2d2ce7[_0x3087('0x5b')]['id'],'UserId':null}})[_0x3087('0x1f')](handleEntityNotFound(_0x29c5d8,null))[_0x3087('0x1f')](saveUpdates(_0x2d2ce7[_0x3087('0x5a')],null))[_0x3087('0x1f')](function(_0x3c0bfc){if(_0x3c0bfc){_0x20c380[_0x3087('0x28')]=_0x3c0bfc[_0x3087('0x66')]({'plain':!![]});return db[_0x3087('0x67')][_0x3087('0x58')]({'where':{'id':_0x3c0bfc[_0x3087('0x68')]}});}return null;})[_0x3087('0x1f')](handleEntityNotFound(_0x29c5d8,null))['then'](function(_0x101216){if(_0x101216){return _0x101216[_0x3087('0x35')]({'UserId':_0x2d2ce7[_0x3087('0x5a')][_0x3087('0x63')],'read1stAt':_[_0x3087('0x69')](_0x101216[_0x3087('0x6a')])?moment()[_0x3087('0x62')](_0x3087('0x6b')):undefined});}return null;})[_0x3087('0x1f')](function(_0xe75dfa){if(_0xe75dfa){_0x20c380['interaction']=_0xe75dfa[_0x3087('0x66')]({'plain':!![]});interaction_log['info'](_0x3087('0x6c'),_0x2d2ce7['user']['id'],_0x2d2ce7[_0x3087('0x64')]['name'],_0x2d2ce7['user']['role'],_0x20c380['interaction']['id'],_0x2d2ce7[_0x3087('0x5a')]?JSON[_0x3087('0x25')](_0x2d2ce7[_0x3087('0x5a')]):_0x3087('0x6d'));return respondWithRpcPromise(_0x3087('0x6e'),_0x3087('0x6f'),_0x20c380);}return null;})['then'](function(_0x47307b){var _0x136233=_0x3087('0x70')+_0x47307b[_0x3087('0x28')][_0x3087('0x71')];return db[_0x3087('0x72')][_0x3087('0x43')](_0x136233,{'type':db[_0x3087('0x73')]['QueryTypes'][_0x3087('0x74')],'raw':!![]})['then'](function(_0x2707ce){return _0x2707ce;});})[_0x3087('0x1f')](function(_0x72cf40){if(_0x72cf40){_0x20c380['message']['contact']=_0x72cf40[0x0];if(!_0x2d2ce7[_0x3087('0x5a')][_0x3087('0x63')])return;return db['User'][_0x3087('0x58')]({'where':{'id':_0x2d2ce7['body']['UserId'],'role':_0x3087('0x65')},'attributes':['id',_0x3087('0x38'),_0x3087('0x75'),_0x3087('0x76'),_0x3087('0x77')],'raw':!![]});}return null;})[_0x3087('0x1f')](function(_0x5a7c12){if(!_0x5a7c12)return null;_0x20c380[_0x3087('0x28')][_0x3087('0x65')]=_0x5a7c12;return _0x20c380;})[_0x3087('0x1f')](function(_0x1c1968){if(_0x1c1968){if(_0x2d2ce7[_0x3087('0x5a')][_0x3087('0x78')]){_0x20c380[_0x3087('0x28')][_0x3087('0x79')]=util[_0x3087('0x62')]('SIP/%s',_0x2d2ce7[_0x3087('0x64')]['name']);_0x20c380[_0x3087('0x28')]['channel']=_0x20c380[_0x3087('0x7a')];_0x20c380[_0x3087('0x28')]['motionChannel']=_0x20c380['channel'];_0x20c380[_0x3087('0x28')][_0x3087('0x7b')]=_0x3087('0x5e');return respondWithRpcPromise(_0x3087('0x7c'),'EventManager',{'event':'acceptmessage','message':_[_0x3087('0x50')](_0x20c380[_0x3087('0x28')],JSON[_0x3087('0x7d')](_0x20c380[_0x3087('0x7e')][_0x3087('0x7f')]))},client9002)[_0x3087('0x1f')](function(){return _0x20c380;});}return _0x20c380;}return null;})[_0x3087('0x1f')](respondWithResult(_0x29c5d8,null))[_0x3087('0x57')](handleError(_0x29c5d8,null));};var interaction_log=require(_0x3087('0x13'))('chat-interactions');exports['reject']=function(_0x2ad943,_0x41c440,_0xe73b11){var _0x3c0cc5={'agent':{},'channel':_0x3087('0x5f')};if(_0x2ad943['body']['id']){delete _0x2ad943[_0x3087('0x5a')]['id'];}_0x2ad943[_0x3087('0x5a')][_0x3087('0x63')]=_0x2ad943[_0x3087('0x5a')][_0x3087('0x63')]||_0x2ad943[_0x3087('0x64')]['id'];_0x3c0cc5[_0x3087('0x65')]['id']=_0x2ad943['body']['UserId'];return db[_0x3087('0x3c')][_0x3087('0x58')]({'where':{'id':_0x2ad943[_0x3087('0x5b')]['id'],'UserId':null}})[_0x3087('0x1f')](handleEntityNotFound(_0x41c440,null))[_0x3087('0x1f')](function(_0x103fbf){if(_0x103fbf){_0x3c0cc5['message']=_0x103fbf[_0x3087('0x66')]({'plain':!![]});return db[_0x3087('0x67')][_0x3087('0x58')]({'where':{'id':_0x103fbf[_0x3087('0x68')]}});}return null;})[_0x3087('0x1f')](handleEntityNotFound(_0x41c440,null))['then'](function(_0x4290a4){if(_0x4290a4){_0x3c0cc5['interaction']=_0x4290a4[_0x3087('0x66')]({'plain':!![]});interaction_log[_0x3087('0x20')](_0x3087('0x80'),_0x2ad943['user']['id'],_0x2ad943[_0x3087('0x64')]['name'],_0x2ad943[_0x3087('0x64')][_0x3087('0x81')],_0x3c0cc5[_0x3087('0x7e')]['id'],_0x2ad943[_0x3087('0x5a')]?JSON[_0x3087('0x25')](_0x2ad943[_0x3087('0x5a')]):'null');return respondWithRpcPromise(_0x3087('0x82'),_0x3087('0x83'),_0x3c0cc5);}return null;})[_0x3087('0x1f')](function(_0x5df46a){var _0x26c389=_0x3087('0x70')+_0x5df46a[_0x3087('0x28')][_0x3087('0x71')];return db[_0x3087('0x72')][_0x3087('0x43')](_0x26c389,{'type':db['Sequelize'][_0x3087('0x84')]['SELECT'],'raw':!![]})[_0x3087('0x1f')](function(_0x427a1d){return _0x427a1d;});})['then'](function(_0x29738e){if(_0x29738e){_0x3c0cc5[_0x3087('0x28')]['contact']=_0x29738e[0x0];if(!_0x2ad943['body']['UserId'])return;return db[_0x3087('0x85')][_0x3087('0x58')]({'where':{'id':_0x2ad943[_0x3087('0x5a')][_0x3087('0x63')],'role':'agent'},'attributes':['id','name',_0x3087('0x75'),'email',_0x3087('0x77')],'raw':!![]});}return null;})[_0x3087('0x1f')](function(_0x4f501b){if(!_0x4f501b)return null;_0x3c0cc5[_0x3087('0x28')][_0x3087('0x65')]=_0x4f501b;return _0x3c0cc5;})[_0x3087('0x1f')](function(_0x54c472){if(_0x54c472){_0x54c472['message'][_0x3087('0x79')]=util[_0x3087('0x62')]('SIP/%s',_0x2ad943[_0x3087('0x64')][_0x3087('0x38')]);_0x54c472[_0x3087('0x28')][_0x3087('0x7a')]=_0x3c0cc5[_0x3087('0x7a')];_0x54c472[_0x3087('0x28')][_0x3087('0x86')]=_0x3c0cc5['channel'];_0x54c472[_0x3087('0x28')][_0x3087('0x7b')]='reject';respondWithRpcPromise('EventManager',_0x3087('0x7c'),{'event':_0x3087('0x87'),'message':_[_0x3087('0x50')](_0x3c0cc5[_0x3087('0x28')],JSON['parse'](_0x3c0cc5[_0x3087('0x7e')][_0x3087('0x7f')]))},client9002);return _0x3c0cc5;}return null;})['then'](respondWithResult(_0x41c440,null))[_0x3087('0x57')](handleError(_0x41c440,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index 43f8625..d5a11fe 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 _0xf060=['exports','events','ChatMessage','setMaxListeners','update','remove','emit','hook'];(function(_0x579e57,_0x1feb17){var _0x2d8e54=function(_0x517982){while(--_0x517982){_0x579e57['push'](_0x579e57['shift']());}};_0x2d8e54(++_0x1feb17);}(_0xf060,0xf9));var _0x0f06=function(_0x4cff96,_0x584782){_0x4cff96=_0x4cff96-0x0;var _0x39dd96=_0xf060[_0x4cff96];return _0x39dd96;};'use strict';var EventEmitter=require(_0x0f06('0x0'));var ChatMessage=require('../../mysqldb')['db'][_0x0f06('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x0f06('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x0f06('0x3'),'afterDestroy':_0x0f06('0x4')};function emitEvent(_0x171ab5){return function(_0x1c0978,_0x115687,_0x43ce49){ChatMessageEvents[_0x0f06('0x5')](_0x171ab5+':'+_0x1c0978['id'],_0x1c0978);ChatMessageEvents['emit'](_0x171ab5,_0x1c0978);_0x43ce49(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0x0f06('0x6')](e,emitEvent(event));}}module[_0x0f06('0x7')]=ChatMessageEvents; \ No newline at end of file +var _0xd4be=['../../mysqldb','ChatMessage','setMaxListeners','save','update','remove','emit','hook','exports','events'];(function(_0x39635f,_0x45525d){var _0x340960=function(_0x2011a7){while(--_0x2011a7){_0x39635f['push'](_0x39635f['shift']());}};_0x340960(++_0x45525d);}(_0xd4be,0x9f));var _0xed4b=function(_0x2951fa,_0x9f3367){_0x2951fa=_0x2951fa-0x0;var _0x21e25b=_0xd4be[_0x2951fa];return _0x21e25b;};'use strict';var EventEmitter=require(_0xed4b('0x0'));var ChatMessage=require(_0xed4b('0x1'))['db'][_0xed4b('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xed4b('0x3')](0x0);var events={'afterCreate':_0xed4b('0x4'),'afterUpdate':_0xed4b('0x5'),'afterDestroy':_0xed4b('0x6')};function emitEvent(_0x37d4c3){return function(_0x5694a8,_0x2ce761,_0x550bb2){ChatMessageEvents[_0xed4b('0x7')](_0x37d4c3+':'+_0x5694a8['id'],_0x5694a8);ChatMessageEvents[_0xed4b('0x7')](_0x37d4c3,_0x5694a8);_0x550bb2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0xed4b('0x8')](e,emitEvent(event));}}module[_0xed4b('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 1275bd1..1881bfe 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 _0xc319=['get','direction','toLowerCase','UserId','findOne','ChatInteractionId','then','update','createdAt','catch','error','utf8mb4','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','fti_chat_messages','body','FULLTEXT','models'];(function(_0x51ba79,_0x43bba6){var _0x2e2aab=function(_0x47abff){while(--_0x47abff){_0x51ba79['push'](_0x51ba79['shift']());}};_0x2e2aab(++_0x43bba6);}(_0xc319,0x174));var _0x9c31=function(_0x3b5445,_0x17475b){_0x3b5445=_0x3b5445-0x0;var _0x4aba5f=_0xc319[_0x3b5445];return _0x4aba5f;};'use strict';var _=require(_0x9c31('0x0'));var util=require(_0x9c31('0x1'));var logger=require('../../config/logger')(_0x9c31('0x2'));var moment=require(_0x9c31('0x3'));var BPromise=require('bluebird');var rp=require(_0x9c31('0x4'));var fs=require('fs');var path=require(_0x9c31('0x5'));var rimraf=require(_0x9c31('0x6'));var config=require(_0x9c31('0x7'));var attributes=require('./chatMessage.attributes');module['exports']=function(_0x19eda1,_0x275fd1){return _0x19eda1['define']('ChatMessage',attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0x9c31('0x8'),'fields':[_0x9c31('0x9')],'type':_0x9c31('0xa')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5ce07a,_0x124531,_0x2bfbce){var _0x518d6c=_0x19eda1[_0x9c31('0xb')];var _0x51bb5a=_0x5ce07a[_0x9c31('0xc')]({'plain':!![]});if(_0x51bb5a[_0x9c31('0xd')][_0x9c31('0xe')]()==='in'||_0x51bb5a[_0x9c31('0xd')][_0x9c31('0xe')]()==='out'&&!_0x51bb5a['secret']&&!_['isNil'](_0x51bb5a[_0x9c31('0xf')])){_0x518d6c['ChatInteraction'][_0x9c31('0x10')]({'where':{'id':_0x51bb5a[_0x9c31('0x11')]}})[_0x9c31('0x12')](function(_0x57f1d3){if(_0x57f1d3){_0x57f1d3[_0x9c31('0x13')]({'lastMsgAt':_0x51bb5a[_0x9c31('0x14')],'lastMsgDirection':_0x51bb5a[_0x9c31('0xd')]['toLowerCase']()});}})[_0x9c31('0x15')](function(_0x1bb3fc){console[_0x9c31('0x16')](_0x1bb3fc);});}_0x2bfbce();}},'charset':_0x9c31('0x17'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x623e=['error','lodash','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ChatMessage','chat_messages','fti_chat_messages','body','models','get','direction','toLowerCase','isNil','UserId','ChatInteraction','findOne','then','update','createdAt'];(function(_0x290818,_0x500c35){var _0x2cc668=function(_0x605dfb){while(--_0x605dfb){_0x290818['push'](_0x290818['shift']());}};_0x2cc668(++_0x500c35);}(_0x623e,0x65));var _0xe623=function(_0x503166,_0x32adbd){_0x503166=_0x503166-0x0;var _0x57535b=_0x623e[_0x503166];return _0x57535b;};'use strict';var _=require(_0xe623('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xe623('0x1'));var moment=require('moment');var BPromise=require(_0xe623('0x2'));var rp=require(_0xe623('0x3'));var fs=require('fs');var path=require(_0xe623('0x4'));var rimraf=require(_0xe623('0x5'));var config=require(_0xe623('0x6'));var attributes=require('./chatMessage.attributes');module[_0xe623('0x7')]=function(_0x5ed775,_0x570056){return _0x5ed775[_0xe623('0x8')](_0xe623('0x9'),attributes,{'tableName':_0xe623('0xa'),'paranoid':![],'indexes':[{'name':_0xe623('0xb'),'fields':[_0xe623('0xc')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x511a5c,_0xaf269d,_0x5930e2){var _0x5645fe=_0x5ed775[_0xe623('0xd')];var _0x4300f6=_0x511a5c[_0xe623('0xe')]({'plain':!![]});if(_0x4300f6[_0xe623('0xf')][_0xe623('0x10')]()==='in'||_0x4300f6[_0xe623('0xf')][_0xe623('0x10')]()==='out'&&!_0x4300f6['secret']&&!_[_0xe623('0x11')](_0x4300f6[_0xe623('0x12')])){_0x5645fe[_0xe623('0x13')][_0xe623('0x14')]({'where':{'id':_0x4300f6['ChatInteractionId']}})[_0xe623('0x15')](function(_0x2d05a2){if(_0x2d05a2){_0x2d05a2[_0xe623('0x16')]({'lastMsgAt':_0x4300f6[_0xe623('0x17')],'lastMsgDirection':_0x4300f6[_0xe623('0xf')][_0xe623('0x10')]()});}})['catch'](function(_0x3bee29){console[_0xe623('0x18')](_0x3bee29);});}_0x5930e2();}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index fcec52e..a751045 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 _0xcdf1=['create','body','options','raw','then','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','info','request\x20sent','debug','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','result','CreateChatMessage','ChatMessage'];(function(_0x50cb4b,_0x31a607){var _0x8b1491=function(_0x53596c){while(--_0x53596c){_0x50cb4b['push'](_0x50cb4b['shift']());}};_0x8b1491(++_0x31a607);}(_0xcdf1,0x11e));var _0x1cdf=function(_0x1be35b,_0xa49780){_0x1be35b=_0x1be35b-0x0;var _0xd22f6=_0xcdf1[_0x1be35b];return _0xd22f6;};'use strict';var _=require(_0x1cdf('0x0'));var util=require(_0x1cdf('0x1'));var moment=require(_0x1cdf('0x2'));var BPromise=require(_0x1cdf('0x3'));var rs=require(_0x1cdf('0x4'));var fs=require('fs');var Redis=require(_0x1cdf('0x5'));var db=require(_0x1cdf('0x6'))['db'];var utils=require(_0x1cdf('0x7'));var logger=require(_0x1cdf('0x8'))(_0x1cdf('0x9'));var config=require('../../config/environment');var jayson=require(_0x1cdf('0xa'));var client=jayson[_0x1cdf('0xb')]['http']({'port':0x232a});config[_0x1cdf('0xc')]=_[_0x1cdf('0xd')](config[_0x1cdf('0xc')],{'host':_0x1cdf('0xe'),'port':0x18eb});var socket=require(_0x1cdf('0xf'))(new Redis(config['redis']));require(_0x1cdf('0x10'))[_0x1cdf('0x11')](socket);function respondWithRpcPromise(_0x31a205,_0x4af438,_0x20f5b5){return new BPromise(function(_0x191dc3,_0x551eed){return client['request'](_0x31a205,_0x20f5b5)['then'](function(_0x447bce){logger[_0x1cdf('0x12')]('ChatMessage,\x20%s,\x20%s',_0x4af438,_0x1cdf('0x13'));logger[_0x1cdf('0x14')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x4af438,_0x1cdf('0x13'),JSON[_0x1cdf('0x15')](_0x447bce));if(_0x447bce[_0x1cdf('0x16')]){if(_0x447bce[_0x1cdf('0x16')][_0x1cdf('0x17')]===0x1f4){logger[_0x1cdf('0x16')](_0x1cdf('0x18'),_0x4af438,_0x447bce[_0x1cdf('0x16')][_0x1cdf('0x19')]);return _0x551eed(_0x447bce[_0x1cdf('0x16')][_0x1cdf('0x19')]);}logger[_0x1cdf('0x16')]('ChatMessage,\x20%s,\x20%s',_0x4af438,_0x447bce[_0x1cdf('0x16')][_0x1cdf('0x19')]);return _0x191dc3(_0x447bce[_0x1cdf('0x16')][_0x1cdf('0x19')]);}else{logger[_0x1cdf('0x12')]('ChatMessage,\x20%s,\x20%s',_0x4af438,_0x1cdf('0x13'));_0x191dc3(_0x447bce[_0x1cdf('0x1a')][_0x1cdf('0x19')]);}})['catch'](function(_0x23a397){logger[_0x1cdf('0x16')](_0x1cdf('0x18'),_0x4af438,_0x23a397);_0x551eed(_0x23a397);});});}exports[_0x1cdf('0x1b')]=function(_0x13c8a3){var _0x1c5ce9=this;return new Promise(function(_0x13c842,_0x11521f){return db[_0x1cdf('0x1c')][_0x1cdf('0x1d')](_0x13c8a3[_0x1cdf('0x1e')],{'raw':_0x13c8a3[_0x1cdf('0x1f')]?_0x13c8a3['options'][_0x1cdf('0x20')]===undefined?!![]:![]:!![]})[_0x1cdf('0x21')](function(_0x57a0d2){logger[_0x1cdf('0x12')]('CreateChatMessage',_0x13c8a3);logger['debug'](_0x1cdf('0x1b'),_0x13c8a3,JSON[_0x1cdf('0x15')](_0x57a0d2));_0x13c842(_0x57a0d2);})[_0x1cdf('0x22')](function(_0x1c4e44){logger[_0x1cdf('0x16')](_0x1cdf('0x1b'),_0x1c4e44[_0x1cdf('0x19')],_0x13c8a3);_0x11521f(_0x1c5ce9['error'](0x1f4,_0x1c4e44[_0x1cdf('0x19')]));});});}; \ No newline at end of file +var _0x1f24=['../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','CreateChatMessage','ChatMessage','create','body','options','raw','catch','lodash','bluebird','randomstring'];(function(_0x1ae94c,_0x489198){var _0x91a500=function(_0x51a333){while(--_0x51a333){_0x1ae94c['push'](_0x1ae94c['shift']());}};_0x91a500(++_0x489198);}(_0x1f24,0x12f));var _0x41f2=function(_0x3877aa,_0x42bf1e){_0x3877aa=_0x3877aa-0x0;var _0x4e2e61=_0x1f24[_0x3877aa];return _0x4e2e61;};'use strict';var _=require(_0x41f2('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x41f2('0x1'));var rs=require(_0x41f2('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x41f2('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x41f2('0x4'))('rpc');var config=require(_0x41f2('0x5'));var jayson=require(_0x41f2('0x6'));var client=jayson[_0x41f2('0x7')][_0x41f2('0x8')]({'port':0x232a});config[_0x41f2('0x9')]=_[_0x41f2('0xa')](config[_0x41f2('0x9')],{'host':_0x41f2('0xb'),'port':0x18eb});var socket=require(_0x41f2('0xc'))(new Redis(config['redis']));require(_0x41f2('0xd'))[_0x41f2('0xe')](socket);function respondWithRpcPromise(_0x34ea0a,_0x36e9ba,_0x38c5ef){return new BPromise(function(_0x3454f0,_0x5583da){return client[_0x41f2('0xf')](_0x34ea0a,_0x38c5ef)[_0x41f2('0x10')](function(_0x58642a){logger[_0x41f2('0x11')](_0x41f2('0x12'),_0x36e9ba,'request\x20sent');logger[_0x41f2('0x13')](_0x41f2('0x14'),_0x36e9ba,_0x41f2('0x15'),JSON[_0x41f2('0x16')](_0x58642a));if(_0x58642a['error']){if(_0x58642a[_0x41f2('0x17')][_0x41f2('0x18')]===0x1f4){logger[_0x41f2('0x17')](_0x41f2('0x12'),_0x36e9ba,_0x58642a[_0x41f2('0x17')]['message']);return _0x5583da(_0x58642a[_0x41f2('0x17')][_0x41f2('0x19')]);}logger[_0x41f2('0x17')]('ChatMessage,\x20%s,\x20%s',_0x36e9ba,_0x58642a[_0x41f2('0x17')][_0x41f2('0x19')]);return _0x3454f0(_0x58642a[_0x41f2('0x17')]['message']);}else{logger['info'](_0x41f2('0x12'),_0x36e9ba,'request\x20sent');_0x3454f0(_0x58642a[_0x41f2('0x1a')]['message']);}})['catch'](function(_0x3819cf){logger['error'](_0x41f2('0x12'),_0x36e9ba,_0x3819cf);_0x5583da(_0x3819cf);});});}exports[_0x41f2('0x1b')]=function(_0x3e7db5){var _0x42a9f2=this;return new Promise(function(_0x38d8c0,_0x26d0bc){return db[_0x41f2('0x1c')][_0x41f2('0x1d')](_0x3e7db5[_0x41f2('0x1e')],{'raw':_0x3e7db5[_0x41f2('0x1f')]?_0x3e7db5['options'][_0x41f2('0x20')]===undefined?!![]:![]:!![]})[_0x41f2('0x10')](function(_0x3dc07d){logger['info']('CreateChatMessage',_0x3e7db5);logger['debug'](_0x41f2('0x1b'),_0x3e7db5,JSON[_0x41f2('0x16')](_0x3dc07d));_0x38d8c0(_0x3dc07d);})[_0x41f2('0x21')](function(_0x3ba91e){logger['error'](_0x41f2('0x1b'),_0x3ba91e[_0x41f2('0x19')],_0x3e7db5);_0x26d0bc(_0x42a9f2[_0x41f2('0x17')](0x1f4,_0x3ba91e[_0x41f2('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index f1a3324..b1a3fef 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 _0x4ab0=['register','length','chatMessage:','save','remove','update'];(function(_0x18ac33,_0x3f860a){var _0x33dd81=function(_0xd8fe3f){while(--_0xd8fe3f){_0x18ac33['push'](_0x18ac33['shift']());}};_0x33dd81(++_0x3f860a);}(_0x4ab0,0xd5));var _0x04ab=function(_0x52bc51,_0x2662c){_0x52bc51=_0x52bc51-0x0;var _0x5a5bda=_0x4ab0[_0x52bc51];return _0x5a5bda;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0x04ab('0x0'),_0x04ab('0x1'),_0x04ab('0x2')];function createListener(_0x3d8417,_0x3a7b9f){return function(_0x51135e){_0x3a7b9f['emit'](_0x3d8417,_0x51135e);};}function removeListener(_0x45dfee,_0xb1bf2d){return function(){ChatMessageEvents['removeListener'](_0x45dfee,_0xb1bf2d);};}exports[_0x04ab('0x3')]=function(_0x2c5730){for(var _0x4edd2e=0x0,_0x3f5901=events[_0x04ab('0x4')];_0x4edd2e<_0x3f5901;_0x4edd2e++){var _0x1ff7f6=events[_0x4edd2e];var _0x4bc05e=createListener(_0x04ab('0x5')+_0x1ff7f6,_0x2c5730);ChatMessageEvents['on'](_0x1ff7f6,_0x4bc05e);}}; \ No newline at end of file +var _0x1b20=['removeListener','register','length','chatMessage:','save','remove','emit'];(function(_0x1ee294,_0xbba3f5){var _0x41d205=function(_0x529f07){while(--_0x529f07){_0x1ee294['push'](_0x1ee294['shift']());}};_0x41d205(++_0xbba3f5);}(_0x1b20,0x66));var _0x01b2=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x1b20[_0x4565bf];return _0x5610ba;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0x01b2('0x0'),_0x01b2('0x1'),'update'];function createListener(_0x54eccf,_0x27a406){return function(_0x18e3ff){_0x27a406[_0x01b2('0x2')](_0x54eccf,_0x18e3ff);};}function removeListener(_0x1150fc,_0x1cf757){return function(){ChatMessageEvents[_0x01b2('0x3')](_0x1150fc,_0x1cf757);};}exports[_0x01b2('0x4')]=function(_0x28de4a){for(var _0x46e745=0x0,_0xa64ad1=events[_0x01b2('0x5')];_0x46e745<_0xa64ad1;_0x46e745++){var _0x323470=events[_0x46e745];var _0x508add=createListener(_0x01b2('0x6')+_0x323470,_0x28de4a);ChatMessageEvents['on'](_0x323470,_0x508add);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index 992688d..ba0ad07 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 _0x2eb4=['describe','get','/:id','show','post','tracked','chat','chatmessage:create','create','put','update','/:id/accept','reject','delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatMessage.controller','isAuthenticated','index','/describe'];(function(_0x3163ee,_0x4f031c){var _0x4e31cc=function(_0x5e5fa5){while(--_0x5e5fa5){_0x3163ee['push'](_0x3163ee['shift']());}};_0x4e31cc(++_0x4f031c);}(_0x2eb4,0x1db));var _0x42eb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2eb4[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x42eb('0x0'));var util=require(_0x42eb('0x1'));var path=require('path');var timeout=require(_0x42eb('0x2'));var express=require('express');var router=express[_0x42eb('0x3')]();var fs_extra=require(_0x42eb('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x42eb('0x5'));var config=require(_0x42eb('0x6'));var controller=require(_0x42eb('0x7'));router['get']('/',auth[_0x42eb('0x8')](),controller[_0x42eb('0x9')]);router['get'](_0x42eb('0xa'),auth['isAuthenticated'](),controller[_0x42eb('0xb')]);router[_0x42eb('0xc')](_0x42eb('0xd'),auth['isAuthenticated'](),controller[_0x42eb('0xe')]);router[_0x42eb('0xf')]('/',auth[_0x42eb('0x8')](),interaction[_0x42eb('0x10')](_0x42eb('0x11'),_0x42eb('0x12')),controller[_0x42eb('0x13')]);router[_0x42eb('0x14')]('/:id',controller[_0x42eb('0x15')]);router[_0x42eb('0x14')](_0x42eb('0x16'),auth[_0x42eb('0x8')](),controller['accept']);router[_0x42eb('0x14')]('/:id/reject',auth[_0x42eb('0x8')](),controller[_0x42eb('0x17')]);router[_0x42eb('0x18')](_0x42eb('0xd'),auth['isAuthenticated'](),controller[_0x42eb('0x19')]);module[_0x42eb('0x1a')]=router; \ No newline at end of file +var _0xfe9e=['isAuthenticated','tracked','chat','chatmessage:create','create','put','accept','/:id/reject','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','describe','/:id'];(function(_0xd89f4e,_0x275d9){var _0x2bf51b=function(_0x68692a){while(--_0x68692a){_0xd89f4e['push'](_0xd89f4e['shift']());}};_0x2bf51b(++_0x275d9);}(_0xfe9e,0x177));var _0xefe9=function(_0x50c16c,_0x43b99e){_0x50c16c=_0x50c16c-0x0;var _0x24dc5f=_0xfe9e[_0x50c16c];return _0x24dc5f;};'use strict';var multer=require(_0xefe9('0x0'));var util=require(_0xefe9('0x1'));var path=require(_0xefe9('0x2'));var timeout=require(_0xefe9('0x3'));var express=require(_0xefe9('0x4'));var router=express[_0xefe9('0x5')]();var fs_extra=require(_0xefe9('0x6'));var auth=require(_0xefe9('0x7'));var interaction=require(_0xefe9('0x8'));var config=require(_0xefe9('0x9'));var controller=require('./chatMessage.controller');router[_0xefe9('0xa')]('/',auth['isAuthenticated'](),controller[_0xefe9('0xb')]);router[_0xefe9('0xa')](_0xefe9('0xc'),auth['isAuthenticated'](),controller[_0xefe9('0xd')]);router['get'](_0xefe9('0xe'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xefe9('0xf')](),interaction[_0xefe9('0x10')](_0xefe9('0x11'),_0xefe9('0x12')),controller[_0xefe9('0x13')]);router[_0xefe9('0x14')]('/:id',controller['update']);router['put']('/:id/accept',auth['isAuthenticated'](),controller[_0xefe9('0x15')]);router[_0xefe9('0x14')](_0xefe9('0x16'),auth[_0xefe9('0xf')](),controller['reject']);router[_0xefe9('0x17')](_0xefe9('0xe'),auth[_0xefe9('0xf')](),controller[_0xefe9('0x18')]);module[_0xefe9('0x19')]=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index 92a1849..9f40e17 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 _0x1739=['TEXT','exports'];(function(_0x25b7fd,_0x479a63){var _0x1c712e=function(_0x31cc60){while(--_0x31cc60){_0x25b7fd['push'](_0x25b7fd['shift']());}};_0x1c712e(++_0x479a63);}(_0x1739,0x1e9));var _0x9173=function(_0x40f340,_0x167f80){_0x40f340=_0x40f340-0x0;var _0x2538c5=_0x1739[_0x40f340];return _0x2538c5;};'use strict';var Sequelize=require('sequelize');module[_0x9173('0x0')]={'body':{'type':Sequelize[_0x9173('0x1')]('medium'),'allowNull':![]}}; \ No newline at end of file +var _0xd8d6=['exports','TEXT','medium','sequelize'];(function(_0x3c819e,_0x1d0c31){var _0x122739=function(_0x2deea9){while(--_0x2deea9){_0x3c819e['push'](_0x3c819e['shift']());}};_0x122739(++_0x1d0c31);}(_0xd8d6,0x177));var _0x6d8d=function(_0x349766,_0x1b7f7d){_0x349766=_0x349766-0x0;var _0xbfc0dd=_0xd8d6[_0x349766];return _0xbfc0dd;};'use strict';var Sequelize=require(_0x6d8d('0x0'));module[_0x6d8d('0x1')]={'body':{'type':Sequelize[_0x6d8d('0x2')](_0x6d8d('0x3')),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index 1edde58..9ff4d0d 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(_0x25386b,_0x2c852f){var _0x21952c=function(_0x330912){while(--_0x330912){_0x25386b['push'](_0x25386b['shift']());}};_0x21952c(++_0x2c852f);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'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(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0x7a54,0x106));var _0x47a5=function(_0x1e700b,_0x495c85){_0x1e700b=_0x1e700b-0x0;var _0x42ca03=_0x7a54[_0x1e700b];return _0x42ca03;};'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 f89cc55..f47c7f1 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 _0x94bb=['bluebird','path','rimraf','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','utf8mb4','utf8mb4_unicode_ci','util','api','moment'];(function(_0x1a9204,_0x1c9e00){var _0x17ca68=function(_0x1f4399){while(--_0x1f4399){_0x1a9204['push'](_0x1a9204['shift']());}};_0x17ca68(++_0x1c9e00);}(_0x94bb,0xa5));var _0xb94b=function(_0x2059df,_0x367401){_0x2059df=_0x2059df-0x0;var _0xdd848b=_0x94bb[_0x2059df];return _0xdd848b;};'use strict';var _=require('lodash');var util=require(_0xb94b('0x0'));var logger=require('../../config/logger')(_0xb94b('0x1'));var moment=require(_0xb94b('0x2'));var BPromise=require(_0xb94b('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb94b('0x4'));var rimraf=require(_0xb94b('0x5'));var config=require('../../config/environment');var attributes=require(_0xb94b('0x6'));module[_0xb94b('0x7')]=function(_0x3bda7c,_0x1d5737){return _0x3bda7c[_0xb94b('0x8')](_0xb94b('0x9'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb94b('0xa'),'collate':_0xb94b('0xb')});}; \ No newline at end of file +var _0x0ff9=['exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./chatOfflineMessage.attributes'];(function(_0x398eb8,_0x4757d8){var _0x5aa1d6=function(_0x190a13){while(--_0x190a13){_0x398eb8['push'](_0x398eb8['shift']());}};_0x5aa1d6(++_0x4757d8);}(_0x0ff9,0x156));var _0x90ff=function(_0x1ce472,_0x5f5374){_0x1ce472=_0x1ce472-0x0;var _0x5414e7=_0x0ff9[_0x1ce472];return _0x5414e7;};'use strict';var _=require('lodash');var util=require(_0x90ff('0x0'));var logger=require(_0x90ff('0x1'))(_0x90ff('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x90ff('0x3'));var fs=require('fs');var path=require(_0x90ff('0x4'));var rimraf=require(_0x90ff('0x5'));var config=require(_0x90ff('0x6'));var attributes=require(_0x90ff('0x7'));module[_0x90ff('0x8')]=function(_0x46cacb,_0x2ee7dd){return _0x46cacb[_0x90ff('0x9')](_0x90ff('0xa'),attributes,{'tableName':_0x90ff('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x90ff('0xc'),'collate':_0x90ff('0xd')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index e4e03c1..735016e 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 _0x39f0=['code','message','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','ChatOfflineMessage,\x20%s,\x20%s','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x39f0,0x1d1));var _0x039f=function(_0x190488,_0x2fb857){_0x190488=_0x190488-0x0;var _0x5ab646=_0x39f0[_0x190488];return _0x5ab646;};'use strict';var _=require(_0x039f('0x0'));var util=require(_0x039f('0x1'));var moment=require(_0x039f('0x2'));var BPromise=require(_0x039f('0x3'));var rs=require(_0x039f('0x4'));var fs=require('fs');var Redis=require(_0x039f('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x039f('0x6'));var logger=require(_0x039f('0x7'))('rpc');var config=require(_0x039f('0x8'));var jayson=require(_0x039f('0x9'));var client=jayson[_0x039f('0xa')][_0x039f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4381ac,_0x5ed44c,_0x5f47e1){return new BPromise(function(_0x1a3af6,_0x170a0e){return client['request'](_0x4381ac,_0x5f47e1)[_0x039f('0xc')](function(_0x1f87dc){logger[_0x039f('0xd')](_0x039f('0xe'),_0x5ed44c,'request\x20sent');logger['debug'](_0x039f('0xf'),_0x5ed44c,'request\x20sent',JSON[_0x039f('0x10')](_0x1f87dc));if(_0x1f87dc[_0x039f('0x11')]){if(_0x1f87dc[_0x039f('0x11')][_0x039f('0x12')]===0x1f4){logger[_0x039f('0x11')](_0x039f('0xe'),_0x5ed44c,_0x1f87dc[_0x039f('0x11')][_0x039f('0x13')]);return _0x170a0e(_0x1f87dc['error'][_0x039f('0x13')]);}logger[_0x039f('0x11')](_0x039f('0xe'),_0x5ed44c,_0x1f87dc[_0x039f('0x11')][_0x039f('0x13')]);return _0x1a3af6(_0x1f87dc[_0x039f('0x11')][_0x039f('0x13')]);}else{logger[_0x039f('0xd')](_0x039f('0xe'),_0x5ed44c,_0x039f('0x14'));_0x1a3af6(_0x1f87dc[_0x039f('0x15')][_0x039f('0x13')]);}})[_0x039f('0x16')](function(_0x92ac10){logger[_0x039f('0x11')](_0x039f('0xe'),_0x5ed44c,_0x92ac10);_0x170a0e(_0x92ac10);});});} \ No newline at end of file +var _0x5270=['error','message','result','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x5270,0xab));var _0x0527=function(_0x231c1e,_0xff1290){_0x231c1e=_0x231c1e-0x0;var _0x3a220a=_0x5270[_0x231c1e];return _0x3a220a;};'use strict';var _=require(_0x0527('0x0'));var util=require(_0x0527('0x1'));var moment=require('moment');var BPromise=require(_0x0527('0x2'));var rs=require(_0x0527('0x3'));var fs=require('fs');var Redis=require(_0x0527('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0527('0x5'));var logger=require(_0x0527('0x6'))(_0x0527('0x7'));var config=require(_0x0527('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0527('0x9')][_0x0527('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3f6299,_0x3b2f09,_0x5b2929){return new BPromise(function(_0x42a07f,_0xd6cf99){return client[_0x0527('0xb')](_0x3f6299,_0x5b2929)[_0x0527('0xc')](function(_0x2f0a05){logger[_0x0527('0xd')](_0x0527('0xe'),_0x3b2f09,_0x0527('0xf'));logger[_0x0527('0x10')](_0x0527('0x11'),_0x3b2f09,_0x0527('0xf'),JSON['stringify'](_0x2f0a05));if(_0x2f0a05['error']){if(_0x2f0a05[_0x0527('0x12')]['code']===0x1f4){logger[_0x0527('0x12')]('ChatOfflineMessage,\x20%s,\x20%s',_0x3b2f09,_0x2f0a05['error']['message']);return _0xd6cf99(_0x2f0a05['error']['message']);}logger['error'](_0x0527('0xe'),_0x3b2f09,_0x2f0a05['error'][_0x0527('0x13')]);return _0x42a07f(_0x2f0a05[_0x0527('0x12')][_0x0527('0x13')]);}else{logger[_0x0527('0xd')](_0x0527('0xe'),_0x3b2f09,_0x0527('0xf'));_0x42a07f(_0x2f0a05[_0x0527('0x14')][_0x0527('0x13')]);}})['catch'](function(_0x2bc699){logger['error'](_0x0527('0xe'),_0x3b2f09,_0x2bc699);_0xd6cf99(_0x2bc699);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index e53c18d..028966e 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 _0xe752=['fs-extra','../../components/interaction/service','./chatOfflineMessage.controller','isAuthenticated','get','describe','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x3336ad,_0x4f8359){var _0x286568=function(_0x180d3b){while(--_0x180d3b){_0x3336ad['push'](_0x3336ad['shift']());}};_0x286568(++_0x4f8359);}(_0xe752,0xe1));var _0x2e75=function(_0xb378f1,_0x523663){_0xb378f1=_0xb378f1-0x0;var _0x263069=_0xe752[_0xb378f1];return _0x263069;};'use strict';var multer=require(_0x2e75('0x0'));var util=require(_0x2e75('0x1'));var path=require(_0x2e75('0x2'));var timeout=require(_0x2e75('0x3'));var express=require(_0x2e75('0x4'));var router=express[_0x2e75('0x5')]();var fs_extra=require(_0x2e75('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x2e75('0x7'));var config=require('../../config/environment');var controller=require(_0x2e75('0x8'));router['get']('/',auth[_0x2e75('0x9')](),controller['index']);router[_0x2e75('0xa')]('/describe',auth[_0x2e75('0x9')](),controller[_0x2e75('0xb')]);router[_0x2e75('0xa')]('/:id',auth[_0x2e75('0x9')](),controller[_0x2e75('0xc')]);router[_0x2e75('0xd')]('/',auth['isAuthenticated'](),controller[_0x2e75('0xe')]);router[_0x2e75('0xf')](_0x2e75('0x10'),auth[_0x2e75('0x9')](),controller[_0x2e75('0x11')]);router[_0x2e75('0x12')](_0x2e75('0x10'),auth[_0x2e75('0x9')](),controller[_0x2e75('0x13')]);module[_0x2e75('0x14')]=router; \ No newline at end of file +var _0xf77b=['create','exports','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','post'];(function(_0x571a17,_0x63fb3d){var _0x3ef337=function(_0x12096b){while(--_0x12096b){_0x571a17['push'](_0x571a17['shift']());}};_0x3ef337(++_0x63fb3d);}(_0xf77b,0xa2));var _0xbf77=function(_0x3c8e9a,_0x384306){_0x3c8e9a=_0x3c8e9a-0x0;var _0x2d4c57=_0xf77b[_0x3c8e9a];return _0x2d4c57;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xbf77('0x0'));var express=require(_0xbf77('0x1'));var router=express[_0xbf77('0x2')]();var fs_extra=require(_0xbf77('0x3'));var auth=require(_0xbf77('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xbf77('0x5'));var controller=require(_0xbf77('0x6'));router[_0xbf77('0x7')]('/',auth[_0xbf77('0x8')](),controller[_0xbf77('0x9')]);router[_0xbf77('0x7')](_0xbf77('0xa'),auth[_0xbf77('0x8')](),controller[_0xbf77('0xb')]);router['get'](_0xbf77('0xc'),auth[_0xbf77('0x8')](),controller['show']);router[_0xbf77('0xd')]('/',auth[_0xbf77('0x8')](),controller[_0xbf77('0xe')]);router['put'](_0xbf77('0xc'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xbf77('0xc'),auth[_0xbf77('0x8')](),controller['destroy']);module[_0xbf77('0xf')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index a85bac7..1e9e612 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 _0x0610=['exports','STRING','ENUM','mouseOver','timeout','INTEGER','sequelize'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x0610,0x156));var _0x0061=function(_0x517bca,_0x447dc8){_0x517bca=_0x517bca-0x0;var _0x117c43=_0x0610[_0x517bca];return _0x117c43;};'use strict';var Sequelize=require(_0x0061('0x0'));module[_0x0061('0x1')]={'name':{'type':Sequelize[_0x0061('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x0061('0x3')](_0x0061('0x4'),_0x0061('0x5')),'defaultValue':_0x0061('0x4')},'selector':{'type':Sequelize[_0x0061('0x2')]},'timeout':{'type':Sequelize[_0x0061('0x6')]}}; \ No newline at end of file +var _0x53ce=['timeout','STRING','exports','ENUM','mouseOver'];(function(_0x16fd27,_0x3b82ef){var _0x2539e9=function(_0x3be0e1){while(--_0x3be0e1){_0x16fd27['push'](_0x16fd27['shift']());}};_0x2539e9(++_0x3b82ef);}(_0x53ce,0x110));var _0xe53c=function(_0x353dfb,_0x4fcbcc){_0x353dfb=_0x353dfb-0x0;var _0x34fc15=_0x53ce[_0x353dfb];return _0x34fc15;};'use strict';var Sequelize=require('sequelize');module[_0xe53c('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xe53c('0x1')](_0xe53c('0x2'),_0xe53c('0x3')),'defaultValue':_0xe53c('0x2')},'selector':{'type':Sequelize[_0xe53c('0x4')]},'timeout':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index 7225c0f..82e6afc 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 _0xbf07=['rimraf','zip-dir','fast-json-patch','moment','bluebird','sox','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','show','params','model','ChatProactiveAction','rawAttributes','query','filters','intersection','attributes','fields','includeAll','include','merge','options','find','catch','create','body','eml-format'];(function(_0x22a19c,_0xb78748){var _0x3d8120=function(_0x241270){while(--_0x241270){_0x22a19c['push'](_0x22a19c['shift']());}};_0x3d8120(++_0xb78748);}(_0xbf07,0x77));var _0x7bf0=function(_0x207811,_0x3420a6){_0x207811=_0x207811-0x0;var _0x170d56=_0xbf07[_0x207811];return _0x170d56;};'use strict';var emlformat=require(_0x7bf0('0x0'));var rimraf=require(_0x7bf0('0x1'));var zipdir=require(_0x7bf0('0x2'));var jsonpatch=require(_0x7bf0('0x3'));var rp=require('request-promise');var moment=require(_0x7bf0('0x4'));var BPromise=require(_0x7bf0('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x7bf0('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7bf0('0x7'));var squel=require('squel');var crypto=require(_0x7bf0('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x7bf0('0x9'));var toCsv=require(_0x7bf0('0xa'));var querystring=require(_0x7bf0('0xb'));var Papa=require(_0x7bf0('0xc'));var Redis=require(_0x7bf0('0xd'));var authService=require(_0x7bf0('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x7bf0('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7bf0('0x10'))(_0x7bf0('0x11'));var utils=require(_0x7bf0('0x12'));var config=require(_0x7bf0('0x13'));var licenseUtil=require(_0x7bf0('0x14'));var db=require(_0x7bf0('0x15'))['db'];function respondWithStatusCode(_0xf81111,_0x2382fb){_0x2382fb=_0x2382fb||0xcc;return function(_0x1897e0){if(_0x1897e0){return _0xf81111[_0x7bf0('0x16')](_0x2382fb);}return _0xf81111[_0x7bf0('0x17')](_0x2382fb)[_0x7bf0('0x18')]();};}function respondWithResult(_0xf15732,_0x88142d){_0x88142d=_0x88142d||0xc8;return function(_0x13c6e9){if(_0x13c6e9){return _0xf15732[_0x7bf0('0x17')](_0x88142d)[_0x7bf0('0x19')](_0x13c6e9);}};}function respondWithFilteredResult(_0x383be0,_0x20fc70){return function(_0x182df9){if(_0x182df9){var _0x4f551c=typeof _0x20fc70[_0x7bf0('0x1a')]===_0x7bf0('0x1b')&&typeof _0x20fc70[_0x7bf0('0x1c')]===_0x7bf0('0x1b');var _0x13c9bb=_0x182df9['count'];var _0x254dc8=_0x4f551c?0x0:_0x20fc70[_0x7bf0('0x1a')];var _0x2a99fe=_0x4f551c?_0x182df9[_0x7bf0('0x1d')]:_0x20fc70[_0x7bf0('0x1a')]+_0x20fc70[_0x7bf0('0x1c')];var _0xf97278;if(_0x2a99fe>=_0x13c9bb){_0x2a99fe=_0x13c9bb;_0xf97278=0xc8;}else{_0xf97278=0xce;}_0x383be0[_0x7bf0('0x17')](_0xf97278);return _0x383be0[_0x7bf0('0x1e')](_0x7bf0('0x1f'),_0x254dc8+'-'+_0x2a99fe+'/'+_0x13c9bb)['json'](_0x182df9);}return null;};}function patchUpdates(_0x115f78){return function(_0x131a9b){try{jsonpatch[_0x7bf0('0x20')](_0x131a9b,_0x115f78,!![]);}catch(_0x3a74b6){return BPromise[_0x7bf0('0x21')](_0x3a74b6);}return _0x131a9b[_0x7bf0('0x22')]();};}function saveUpdates(_0x4e41b6,_0x4924d8){return function(_0x4379cb){if(_0x4379cb){return _0x4379cb[_0x7bf0('0x23')](_0x4e41b6)['then'](function(_0x4345a3){return _0x4345a3;});}return null;};}function removeEntity(_0x4b5278,_0x157e0f){return function(_0x44e281){if(_0x44e281){return _0x44e281[_0x7bf0('0x24')]()[_0x7bf0('0x25')](function(){_0x4b5278[_0x7bf0('0x17')](0xcc)[_0x7bf0('0x18')]();});}};}function handleEntityNotFound(_0x2e4994,_0xb4c390){return function(_0x14a98c){if(!_0x14a98c){_0x2e4994[_0x7bf0('0x16')](0x194);}return _0x14a98c;};}function handleError(_0x1e0f7f,_0x573ab4){_0x573ab4=_0x573ab4||0x1f4;return function(_0x366c54){logger[_0x7bf0('0x26')](_0x366c54[_0x7bf0('0x27')]);if(_0x366c54[_0x7bf0('0x28')]){delete _0x366c54[_0x7bf0('0x28')];}_0x1e0f7f['status'](_0x573ab4)[_0x7bf0('0x29')](_0x366c54);};}exports[_0x7bf0('0x2a')]=function(_0x4d1b7a,_0x145f54){var _0x540e84={'raw':!![],'where':{'id':_0x4d1b7a[_0x7bf0('0x2b')]['id']}},_0x1393f7={};_0x1393f7[_0x7bf0('0x2c')]=_['keys'](db[_0x7bf0('0x2d')][_0x7bf0('0x2e')]);_0x1393f7[_0x7bf0('0x2f')]=_['keys'](_0x4d1b7a[_0x7bf0('0x2f')]);_0x1393f7[_0x7bf0('0x30')]=_[_0x7bf0('0x31')](_0x1393f7[_0x7bf0('0x2c')],_0x1393f7['query']);_0x540e84[_0x7bf0('0x32')]=_[_0x7bf0('0x31')](_0x1393f7[_0x7bf0('0x2c')],qs[_0x7bf0('0x33')](_0x4d1b7a[_0x7bf0('0x2f')]['fields']));_0x540e84[_0x7bf0('0x32')]=_0x540e84[_0x7bf0('0x32')]['length']?_0x540e84[_0x7bf0('0x32')]:_0x1393f7[_0x7bf0('0x2c')];if(_0x4d1b7a['query'][_0x7bf0('0x34')]){_0x540e84[_0x7bf0('0x35')]=[{'all':!![]}];}_0x540e84=_[_0x7bf0('0x36')]({},_0x540e84,_0x4d1b7a[_0x7bf0('0x37')]);return db[_0x7bf0('0x2d')][_0x7bf0('0x38')](_0x540e84)[_0x7bf0('0x25')](handleEntityNotFound(_0x145f54,null))[_0x7bf0('0x25')](respondWithResult(_0x145f54,null))[_0x7bf0('0x39')](handleError(_0x145f54,null));};exports[_0x7bf0('0x3a')]=function(_0x458142,_0x37217c){return db[_0x7bf0('0x2d')][_0x7bf0('0x3a')](_0x458142[_0x7bf0('0x3b')],{})['then'](respondWithResult(_0x37217c,0xc9))[_0x7bf0('0x39')](handleError(_0x37217c,null));};exports[_0x7bf0('0x23')]=function(_0x351336,_0x946380){if(_0x351336[_0x7bf0('0x3b')]['id']){delete _0x351336['body']['id'];}return db[_0x7bf0('0x2d')][_0x7bf0('0x38')]({'where':{'id':_0x351336['params']['id']}})[_0x7bf0('0x25')](handleEntityNotFound(_0x946380,null))['then'](saveUpdates(_0x351336[_0x7bf0('0x3b')],null))[_0x7bf0('0x25')](respondWithResult(_0x946380,null))[_0x7bf0('0x39')](handleError(_0x946380,null));};exports[_0x7bf0('0x24')]=function(_0x172d35,_0xed9c6b){return db[_0x7bf0('0x2d')]['find']({'where':{'id':_0x172d35['params']['id']}})[_0x7bf0('0x25')](handleEntityNotFound(_0xed9c6b,null))[_0x7bf0('0x25')](removeEntity(_0xed9c6b,null))[_0x7bf0('0x39')](handleError(_0xed9c6b,null));}; \ No newline at end of file +var _0xe314=['mustache','util','path','sox','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','sendStatus','status','end','offset','undefined','count','limit','Content-Range','json','apply','reject','then','error','stack','name','show','model','ChatProactiveAction','rawAttributes','keys','query','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','catch','create','update','body','destroy','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x5959c9,_0x2ed153){var _0x4ffcbc=function(_0x459b7a){while(--_0x459b7a){_0x5959c9['push'](_0x5959c9['shift']());}};_0x4ffcbc(++_0x2ed153);}(_0xe314,0x7c));var _0x4e31=function(_0x5e1184,_0x22508c){_0x5e1184=_0x5e1184-0x0;var _0x4f6ef7=_0xe314[_0x5e1184];return _0x4f6ef7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4e31('0x0'));var zipdir=require(_0x4e31('0x1'));var jsonpatch=require(_0x4e31('0x2'));var rp=require(_0x4e31('0x3'));var moment=require(_0x4e31('0x4'));var BPromise=require(_0x4e31('0x5'));var Mustache=require(_0x4e31('0x6'));var util=require(_0x4e31('0x7'));var path=require(_0x4e31('0x8'));var sox=require(_0x4e31('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4e31('0xa'));var _=require(_0x4e31('0xb'));var squel=require(_0x4e31('0xc'));var crypto=require(_0x4e31('0xd'));var jsforce=require(_0x4e31('0xe'));var deskjs=require(_0x4e31('0xf'));var toCsv=require('to-csv');var querystring=require(_0x4e31('0x10'));var Papa=require(_0x4e31('0x11'));var Redis=require(_0x4e31('0x12'));var authService=require(_0x4e31('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x4e31('0x14'));var hardwareService=require(_0x4e31('0x15'));var logger=require(_0x4e31('0x16'))(_0x4e31('0x17'));var utils=require(_0x4e31('0x18'));var config=require(_0x4e31('0x19'));var licenseUtil=require(_0x4e31('0x1a'));var db=require(_0x4e31('0x1b'))['db'];function respondWithStatusCode(_0x278a3b,_0x3f8dff){_0x3f8dff=_0x3f8dff||0xcc;return function(_0x41abc8){if(_0x41abc8){return _0x278a3b[_0x4e31('0x1c')](_0x3f8dff);}return _0x278a3b[_0x4e31('0x1d')](_0x3f8dff)[_0x4e31('0x1e')]();};}function respondWithResult(_0x9d0d2,_0x3f7e56){_0x3f7e56=_0x3f7e56||0xc8;return function(_0x8389a9){if(_0x8389a9){return _0x9d0d2[_0x4e31('0x1d')](_0x3f7e56)['json'](_0x8389a9);}};}function respondWithFilteredResult(_0xee6bb9,_0x2e8651){return function(_0x551b8e){if(_0x551b8e){var _0x23dd30=typeof _0x2e8651[_0x4e31('0x1f')]===_0x4e31('0x20')&&typeof _0x2e8651['limit']===_0x4e31('0x20');var _0x14a367=_0x551b8e[_0x4e31('0x21')];var _0x5cdcba=_0x23dd30?0x0:_0x2e8651[_0x4e31('0x1f')];var _0x4264f7=_0x23dd30?_0x551b8e[_0x4e31('0x21')]:_0x2e8651['offset']+_0x2e8651[_0x4e31('0x22')];var _0x2c36f6;if(_0x4264f7>=_0x14a367){_0x4264f7=_0x14a367;_0x2c36f6=0xc8;}else{_0x2c36f6=0xce;}_0xee6bb9['status'](_0x2c36f6);return _0xee6bb9['set'](_0x4e31('0x23'),_0x5cdcba+'-'+_0x4264f7+'/'+_0x14a367)[_0x4e31('0x24')](_0x551b8e);}return null;};}function patchUpdates(_0x38dd6c){return function(_0x349594){try{jsonpatch[_0x4e31('0x25')](_0x349594,_0x38dd6c,!![]);}catch(_0x1b7968){return BPromise[_0x4e31('0x26')](_0x1b7968);}return _0x349594['save']();};}function saveUpdates(_0x41aaa7,_0x31c5dc){return function(_0x240d19){if(_0x240d19){return _0x240d19['update'](_0x41aaa7)[_0x4e31('0x27')](function(_0xcd5940){return _0xcd5940;});}return null;};}function removeEntity(_0x171a42,_0x3d4255){return function(_0x12efaf){if(_0x12efaf){return _0x12efaf['destroy']()[_0x4e31('0x27')](function(){_0x171a42[_0x4e31('0x1d')](0xcc)[_0x4e31('0x1e')]();});}};}function handleEntityNotFound(_0x53c3e0,_0x1a3435){return function(_0xe7e0f8){if(!_0xe7e0f8){_0x53c3e0[_0x4e31('0x1c')](0x194);}return _0xe7e0f8;};}function handleError(_0x182a4d,_0x20941d){_0x20941d=_0x20941d||0x1f4;return function(_0x1ee99c){logger[_0x4e31('0x28')](_0x1ee99c[_0x4e31('0x29')]);if(_0x1ee99c[_0x4e31('0x2a')]){delete _0x1ee99c[_0x4e31('0x2a')];}_0x182a4d[_0x4e31('0x1d')](_0x20941d)['send'](_0x1ee99c);};}exports[_0x4e31('0x2b')]=function(_0x3b74b0,_0x55cb05){var _0x32d9bf={'raw':!![],'where':{'id':_0x3b74b0['params']['id']}},_0x41d0eb={};_0x41d0eb[_0x4e31('0x2c')]=_['keys'](db[_0x4e31('0x2d')][_0x4e31('0x2e')]);_0x41d0eb['query']=_[_0x4e31('0x2f')](_0x3b74b0[_0x4e31('0x30')]);_0x41d0eb[_0x4e31('0x31')]=_[_0x4e31('0x32')](_0x41d0eb[_0x4e31('0x2c')],_0x41d0eb[_0x4e31('0x30')]);_0x32d9bf[_0x4e31('0x33')]=_[_0x4e31('0x32')](_0x41d0eb[_0x4e31('0x2c')],qs[_0x4e31('0x34')](_0x3b74b0['query'][_0x4e31('0x34')]));_0x32d9bf[_0x4e31('0x33')]=_0x32d9bf['attributes'][_0x4e31('0x35')]?_0x32d9bf[_0x4e31('0x33')]:_0x41d0eb[_0x4e31('0x2c')];if(_0x3b74b0['query'][_0x4e31('0x36')]){_0x32d9bf[_0x4e31('0x37')]=[{'all':!![]}];}_0x32d9bf=_[_0x4e31('0x38')]({},_0x32d9bf,_0x3b74b0[_0x4e31('0x39')]);return db['ChatProactiveAction'][_0x4e31('0x3a')](_0x32d9bf)['then'](handleEntityNotFound(_0x55cb05,null))['then'](respondWithResult(_0x55cb05,null))[_0x4e31('0x3b')](handleError(_0x55cb05,null));};exports[_0x4e31('0x3c')]=function(_0x5c2dcb,_0x4d82cc){return db[_0x4e31('0x2d')][_0x4e31('0x3c')](_0x5c2dcb['body'],{})['then'](respondWithResult(_0x4d82cc,0xc9))[_0x4e31('0x3b')](handleError(_0x4d82cc,null));};exports[_0x4e31('0x3d')]=function(_0x3b2e20,_0x34f11f){if(_0x3b2e20['body']['id']){delete _0x3b2e20[_0x4e31('0x3e')]['id'];}return db[_0x4e31('0x2d')][_0x4e31('0x3a')]({'where':{'id':_0x3b2e20['params']['id']}})['then'](handleEntityNotFound(_0x34f11f,null))[_0x4e31('0x27')](saveUpdates(_0x3b2e20[_0x4e31('0x3e')],null))[_0x4e31('0x27')](respondWithResult(_0x34f11f,null))[_0x4e31('0x3b')](handleError(_0x34f11f,null));};exports[_0x4e31('0x3f')]=function(_0x26c684,_0xf9c44b){return db[_0x4e31('0x2d')][_0x4e31('0x3a')]({'where':{'id':_0x26c684[_0x4e31('0x40')]['id']}})[_0x4e31('0x27')](handleEntityNotFound(_0xf9c44b,null))[_0x4e31('0x27')](removeEntity(_0xf9c44b,null))['catch'](handleError(_0xf9c44b,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index d9a65fe..32a53e7 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 _0xa87c=['./chatProactiveAction.attributes','exports','define','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0xe78bdf,_0x102a52){var _0x197f88=function(_0x34124a){while(--_0x34124a){_0xe78bdf['push'](_0xe78bdf['shift']());}};_0x197f88(++_0x102a52);}(_0xa87c,0x142));var _0xca87=function(_0x54e4ec,_0x183144){_0x54e4ec=_0x54e4ec-0x0;var _0x44ef91=_0xa87c[_0x54e4ec];return _0x44ef91;};'use strict';var _=require(_0xca87('0x0'));var util=require('util');var logger=require(_0xca87('0x1'))(_0xca87('0x2'));var moment=require(_0xca87('0x3'));var BPromise=require(_0xca87('0x4'));var rp=require(_0xca87('0x5'));var fs=require('fs');var path=require(_0xca87('0x6'));var rimraf=require('rimraf');var config=require(_0xca87('0x7'));var attributes=require(_0xca87('0x8'));module[_0xca87('0x9')]=function(_0x133a81,_0x24bc6b){return _0x133a81[_0xca87('0xa')]('ChatProactiveAction',attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8659=['../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','lodash','util'];(function(_0x19c1ca,_0x881113){var _0x5960af=function(_0x3e568f){while(--_0x3e568f){_0x19c1ca['push'](_0x19c1ca['shift']());}};_0x5960af(++_0x881113);}(_0x8659,0x82));var _0x9865=function(_0x82d06e,_0xb52ffa){_0x82d06e=_0x82d06e-0x0;var _0x36de13=_0x8659[_0x82d06e];return _0x36de13;};'use strict';var _=require(_0x9865('0x0'));var util=require(_0x9865('0x1'));var logger=require(_0x9865('0x2'))(_0x9865('0x3'));var moment=require(_0x9865('0x4'));var BPromise=require(_0x9865('0x5'));var rp=require(_0x9865('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9865('0x7'));var attributes=require(_0x9865('0x8'));module[_0x9865('0x9')]=function(_0x492f0a,_0x31f3eb){return _0x492f0a[_0x9865('0xa')](_0x9865('0xb'),attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js index d691e0b..c6c602d 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 _0xa6f9=['ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','message','ChatProactiveAction,\x20%s,\x20%s','result','catch','moment','bluebird','randomstring'];(function(_0x31745c,_0x3b8d6e){var _0xbee8b7=function(_0x53d485){while(--_0x53d485){_0x31745c['push'](_0x31745c['shift']());}};_0xbee8b7(++_0x3b8d6e);}(_0xa6f9,0x165));var _0x9a6f=function(_0xa7dfcd,_0x3ab8bd){_0xa7dfcd=_0xa7dfcd-0x0;var _0x5d8883=_0xa6f9[_0xa7dfcd];return _0x5d8883;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9a6f('0x0'));var BPromise=require(_0x9a6f('0x1'));var rs=require(_0x9a6f('0x2'));var fs=require('fs');var Redis=require(_0x9a6f('0x3'));var db=require(_0x9a6f('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9a6f('0x5'));var config=require(_0x9a6f('0x6'));var jayson=require(_0x9a6f('0x7'));var client=jayson[_0x9a6f('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xa0532e,_0x3373f4,_0x24ea6c){return new BPromise(function(_0x4bc86e,_0x3cd9c2){return client[_0x9a6f('0x9')](_0xa0532e,_0x24ea6c)[_0x9a6f('0xa')](function(_0x13e018){logger[_0x9a6f('0xb')]('ChatProactiveAction,\x20%s,\x20%s',_0x3373f4,_0x9a6f('0xc'));logger['debug'](_0x9a6f('0xd'),_0x3373f4,_0x9a6f('0xc'),JSON[_0x9a6f('0xe')](_0x13e018));if(_0x13e018[_0x9a6f('0xf')]){if(_0x13e018[_0x9a6f('0xf')]['code']===0x1f4){logger[_0x9a6f('0xf')]('ChatProactiveAction,\x20%s,\x20%s',_0x3373f4,_0x13e018[_0x9a6f('0xf')]['message']);return _0x3cd9c2(_0x13e018[_0x9a6f('0xf')][_0x9a6f('0x10')]);}logger[_0x9a6f('0xf')](_0x9a6f('0x11'),_0x3373f4,_0x13e018[_0x9a6f('0xf')]['message']);return _0x4bc86e(_0x13e018[_0x9a6f('0xf')]['message']);}else{logger[_0x9a6f('0xb')](_0x9a6f('0x11'),_0x3373f4,_0x9a6f('0xc'));_0x4bc86e(_0x13e018[_0x9a6f('0x12')][_0x9a6f('0x10')]);}})[_0x9a6f('0x13')](function(_0x11ab8b){logger[_0x9a6f('0xf')](_0x9a6f('0x11'),_0x3373f4,_0x11ab8b);_0x3cd9c2(_0x11ab8b);});});} \ No newline at end of file +var _0xbdf4=['result','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','http','request','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x48317e,_0x5e222e){var _0xe34bde=function(_0x2e40f8){while(--_0x2e40f8){_0x48317e['push'](_0x48317e['shift']());}};_0xe34bde(++_0x5e222e);}(_0xbdf4,0xdd));var _0x4bdf=function(_0x9c2427,_0x17c865){_0x9c2427=_0x9c2427-0x0;var _0x51984f=_0xbdf4[_0x9c2427];return _0x51984f;};'use strict';var _=require(_0x4bdf('0x0'));var util=require(_0x4bdf('0x1'));var moment=require(_0x4bdf('0x2'));var BPromise=require(_0x4bdf('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4bdf('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4bdf('0x5'));var logger=require(_0x4bdf('0x6'))('rpc');var config=require(_0x4bdf('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x4bdf('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x474cb7,_0x5ebc78,_0x2d57b7){return new BPromise(function(_0xd1b14f,_0x121d5f){return client[_0x4bdf('0x9')](_0x474cb7,_0x2d57b7)['then'](function(_0x25e6df){logger[_0x4bdf('0xa')](_0x4bdf('0xb'),_0x5ebc78,_0x4bdf('0xc'));logger[_0x4bdf('0xd')](_0x4bdf('0xe'),_0x5ebc78,_0x4bdf('0xc'),JSON[_0x4bdf('0xf')](_0x25e6df));if(_0x25e6df[_0x4bdf('0x10')]){if(_0x25e6df['error'][_0x4bdf('0x11')]===0x1f4){logger[_0x4bdf('0x10')](_0x4bdf('0xb'),_0x5ebc78,_0x25e6df[_0x4bdf('0x10')]['message']);return _0x121d5f(_0x25e6df['error'][_0x4bdf('0x12')]);}logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x5ebc78,_0x25e6df['error'][_0x4bdf('0x12')]);return _0xd1b14f(_0x25e6df['error']['message']);}else{logger[_0x4bdf('0xa')](_0x4bdf('0xb'),_0x5ebc78,_0x4bdf('0xc'));_0xd1b14f(_0x25e6df[_0x4bdf('0x13')][_0x4bdf('0x12')]);}})['catch'](function(_0x2927ec){logger[_0x4bdf('0x10')](_0x4bdf('0xb'),_0x5ebc78,_0x2927ec);_0x121d5f(_0x2927ec);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index 92876bf..f03ac7d 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 _0xe14b=['/:id','isAuthenticated','show','post','update','delete','exports','multer','util','express','Router','../../components/auth/service','./chatProactiveAction.controller','get'];(function(_0x228445,_0x4bfa2b){var _0x33d4f8=function(_0x15917e){while(--_0x15917e){_0x228445['push'](_0x228445['shift']());}};_0x33d4f8(++_0x4bfa2b);}(_0xe14b,0x93));var _0xbe14=function(_0x25dc61,_0x19fae8){_0x25dc61=_0x25dc61-0x0;var _0x21e26c=_0xe14b[_0x25dc61];return _0x21e26c;};'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')](_0xbe14('0x7'),auth[_0xbe14('0x8')](),controller[_0xbe14('0x9')]);router[_0xbe14('0xa')]('/',auth[_0xbe14('0x8')](),controller['create']);router['put']('/:id',auth[_0xbe14('0x8')](),controller[_0xbe14('0xb')]);router[_0xbe14('0xc')](_0xbe14('0x7'),auth['isAuthenticated'](),controller['destroy']);module[_0xbe14('0xd')]=router; \ No newline at end of file +var _0x032e=['post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated','show'];(function(_0x1415d3,_0x453d0a){var _0x5df6b2=function(_0x4274da){while(--_0x4274da){_0x1415d3['push'](_0x1415d3['shift']());}};_0x5df6b2(++_0x453d0a);}(_0x032e,0x124));var _0xe032=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0x032e[_0x2763f2];return _0x3ef471;};'use strict';var multer=require(_0xe032('0x0'));var util=require('util');var path=require(_0xe032('0x1'));var timeout=require(_0xe032('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xe032('0x3'));var auth=require(_0xe032('0x4'));var interaction=require(_0xe032('0x5'));var config=require(_0xe032('0x6'));var controller=require(_0xe032('0x7'));router[_0xe032('0x8')](_0xe032('0x9'),auth[_0xe032('0xa')](),controller[_0xe032('0xb')]);router[_0xe032('0xc')]('/',auth[_0xe032('0xa')](),controller[_0xe032('0xd')]);router[_0xe032('0xe')](_0xe032('0x9'),auth[_0xe032('0xa')](),controller[_0xe032('0xf')]);router[_0xe032('0x10')](_0xe032('0x9'),auth['isAuthenticated'](),controller[_0xe032('0x11')]);module[_0xe032('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index e20dd0b..9a8a765 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 _0xcc21=['INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','exports','STRING','name'];(function(_0x53adf1,_0x2e4d6f){var _0x3334b1=function(_0x22b979){while(--_0x22b979){_0x53adf1['push'](_0x53adf1['shift']());}};_0x3334b1(++_0x2e4d6f);}(_0xcc21,0x9e));var _0x1cc2=function(_0x53ec7a,_0x2c1f7e){_0x53ec7a=_0x53ec7a-0x0;var _0x3a1407=_0xcc21[_0x53ec7a];return _0x3a1407;};'use strict';var Sequelize=require(_0x1cc2('0x0'));module[_0x1cc2('0x1')]={'name':{'type':Sequelize[_0x1cc2('0x2')],'unique':_0x1cc2('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x1cc2('0x2')]},'timeout':{'type':Sequelize[_0x1cc2('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x1cc2('0x5')](_0x1cc2('0x6'),_0x1cc2('0x7'),_0x1cc2('0x8'))}}; \ No newline at end of file +var _0xa08e=['rrmemory','beepall','roundrobin','exports','STRING','name','ENUM'];(function(_0x2a3462,_0x2c8460){var _0x38b619=function(_0x616cab){while(--_0x616cab){_0x2a3462['push'](_0x2a3462['shift']());}};_0x38b619(++_0x2c8460);}(_0xa08e,0x1ca));var _0xea08=function(_0x3f88bc,_0xe38cf5){_0x3f88bc=_0x3f88bc-0x0;var _0x4df1c4=_0xa08e[_0x3f88bc];return _0x4df1c4;};'use strict';var Sequelize=require('sequelize');module[_0xea08('0x0')]={'name':{'type':Sequelize[_0xea08('0x1')],'unique':_0xea08('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xea08('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xea08('0x3')](_0xea08('0x4'),_0xea08('0x5'),_0xea08('0x6'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index 0534663..25ed7f4 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 _0x1829=['isEmpty','removeAgents','addAgents','omit','spread','userChatQueue:save','isArray','userChatQueue:remove','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','then','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','status','end','json','undefined','limit','offset','count','Content-Range','apply','save','update','destroy','get','ChatQueues','stack','name','send','index','map','ChatQueue','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','filters','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','create','describe','getMembers','UserChatQueue','hasOwnProperty','User','findAndCountAll','chatPause','updatedAt','rows','format','%s/%s','getTeams','findOne','Team','ids','Agents','online','voicePause','interface','sequelize','transaction','addTeams','each','findOrCreate','forEach','emit','select','field','tq.TeamId','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','union','value','removeTeams'];(function(_0x15b71c,_0x25708f){var _0x35c8c8=function(_0x36b4d6){while(--_0x36b4d6){_0x15b71c['push'](_0x15b71c['shift']());}};_0x35c8c8(++_0x25708f);}(_0x1829,0x13f));var _0x9182=function(_0x5a9c0c,_0x4ec485){_0x5a9c0c=_0x5a9c0c-0x0;var _0x53c77d=_0x1829[_0x5a9c0c];return _0x53c77d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9182('0x0'));var zipdir=require(_0x9182('0x1'));var jsonpatch=require(_0x9182('0x2'));var rp=require(_0x9182('0x3'));var moment=require(_0x9182('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9182('0x5'));var util=require('util');var path=require(_0x9182('0x6'));var sox=require(_0x9182('0x7'));var csv=require('to-csv');var ejs=require(_0x9182('0x8'));var fs=require('fs');var fs_extra=require(_0x9182('0x9'));var _=require(_0x9182('0xa'));var squel=require(_0x9182('0xb'));var crypto=require(_0x9182('0xc'));var jsforce=require(_0x9182('0xd'));var deskjs=require(_0x9182('0xe'));var toCsv=require(_0x9182('0xf'));var querystring=require(_0x9182('0x10'));var Papa=require(_0x9182('0x11'));var Redis=require(_0x9182('0x12'));var authService=require(_0x9182('0x13'));var qs=require(_0x9182('0x14'));var as=require(_0x9182('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9182('0x16'))(_0x9182('0x17'));var utils=require(_0x9182('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x9182('0x19'));var db=require(_0x9182('0x1a'))['db'];config[_0x9182('0x1b')]=_[_0x9182('0x1c')](config['redis'],{'host':_0x9182('0x1d'),'port':0x18eb});var socket=require(_0x9182('0x1e'))(new Redis(config['redis']));require(_0x9182('0x1f'))[_0x9182('0x20')](socket);var jayson=require(_0x9182('0x21'));var client=jayson[_0x9182('0x22')]['http']({'port':0x232a});function respondWithRpcPromise(_0x35ee31,_0x31c992,_0x341e81,_0x4a94a7){return new BPromise(function(_0x1c594b,_0x4285ad){var _0x19826e=_0x4a94a7||client;return _0x19826e['request'](_0x35ee31,_0x341e81)[_0x9182('0x23')](function(_0x46f1b9){logger['info'](_0x9182('0x24'),_0x31c992,_0x9182('0x25'));logger[_0x9182('0x26')](_0x9182('0x27'),_0x31c992,_0x9182('0x25'),JSON[_0x9182('0x28')](_0x46f1b9));if(_0x46f1b9[_0x9182('0x29')]){if(_0x46f1b9['error'][_0x9182('0x2a')]===0x1f4){logger['error'](_0x9182('0x24'),_0x31c992,_0x46f1b9['error'][_0x9182('0x2b')]);return _0x4285ad(_0x46f1b9[_0x9182('0x29')]['message']);}logger[_0x9182('0x29')](_0x9182('0x24'),_0x31c992,_0x46f1b9['error']['message']);return _0x1c594b(_0x46f1b9[_0x9182('0x29')][_0x9182('0x2b')]);}else{logger[_0x9182('0x2c')](_0x9182('0x24'),_0x31c992,_0x9182('0x25'));_0x1c594b(_0x46f1b9[_0x9182('0x2d')][_0x9182('0x2b')]);}})[_0x9182('0x2e')](function(_0x5e69c7){logger[_0x9182('0x29')](_0x9182('0x24'),_0x31c992,_0x5e69c7);_0x4285ad(_0x5e69c7);});});}function respondWithStatusCode(_0x49c155,_0x50d3b3){_0x50d3b3=_0x50d3b3||0xcc;return function(_0x54239b){if(_0x54239b){return _0x49c155['sendStatus'](_0x50d3b3);}return _0x49c155[_0x9182('0x2f')](_0x50d3b3)[_0x9182('0x30')]();};}function respondWithResult(_0x246d96,_0x188b79){_0x188b79=_0x188b79||0xc8;return function(_0x2a248e){if(_0x2a248e){return _0x246d96['status'](_0x188b79)[_0x9182('0x31')](_0x2a248e);}};}function respondWithFilteredResult(_0x3bb390,_0x420f7f){return function(_0xe2526d){if(_0xe2526d){var _0x3a26d5=typeof _0x420f7f['offset']===_0x9182('0x32')&&typeof _0x420f7f[_0x9182('0x33')]===_0x9182('0x32');var _0x2fe154=_0xe2526d['count'];var _0x125ece=_0x3a26d5?0x0:_0x420f7f[_0x9182('0x34')];var _0x349818=_0x3a26d5?_0xe2526d[_0x9182('0x35')]:_0x420f7f[_0x9182('0x34')]+_0x420f7f[_0x9182('0x33')];var _0x4da502;if(_0x349818>=_0x2fe154){_0x349818=_0x2fe154;_0x4da502=0xc8;}else{_0x4da502=0xce;}_0x3bb390['status'](_0x4da502);return _0x3bb390['set'](_0x9182('0x36'),_0x125ece+'-'+_0x349818+'/'+_0x2fe154)[_0x9182('0x31')](_0xe2526d);}return null;};}function patchUpdates(_0x595d80){return function(_0x494b42){try{jsonpatch[_0x9182('0x37')](_0x494b42,_0x595d80,!![]);}catch(_0x2cca0d){return BPromise['reject'](_0x2cca0d);}return _0x494b42[_0x9182('0x38')]();};}function saveUpdates(_0x2a0e93,_0x3f0d85){return function(_0x260bbc){if(_0x260bbc){return _0x260bbc[_0x9182('0x39')](_0x2a0e93)[_0x9182('0x23')](function(_0x5eb2b6){return _0x5eb2b6;});}return null;};}function removeEntity(_0x19a34a,_0x136a7b){return function(_0x376877){if(_0x376877){return _0x376877[_0x9182('0x3a')]()['then'](function(){var _0x2dadab=_0x376877[_0x9182('0x3b')]({'plain':!![]});var _0x319e2c=_0x9182('0x3c');return db['UserProfileResource'][_0x9182('0x3a')]({'where':{'type':_0x319e2c,'resourceId':_0x2dadab['id']}})[_0x9182('0x23')](function(){return _0x376877;});})[_0x9182('0x23')](function(){_0x19a34a[_0x9182('0x2f')](0xcc)[_0x9182('0x30')]();});}};}function handleEntityNotFound(_0x544c06,_0x13819f){return function(_0x5b304b){if(!_0x5b304b){_0x544c06['sendStatus'](0x194);}return _0x5b304b;};}function handleError(_0x213479,_0x39e1b2){_0x39e1b2=_0x39e1b2||0x1f4;return function(_0x4597ce){logger[_0x9182('0x29')](_0x4597ce[_0x9182('0x3d')]);if(_0x4597ce[_0x9182('0x3e')]){delete _0x4597ce['name'];}_0x213479[_0x9182('0x2f')](_0x39e1b2)[_0x9182('0x3f')](_0x4597ce);};}exports[_0x9182('0x40')]=function(_0x1f8b51,_0x1afa43){var _0x215bde={},_0x39e62b={},_0x16d516={'count':0x0,'rows':[]};var _0x31f355=_[_0x9182('0x41')](db[_0x9182('0x42')][_0x9182('0x43')],function(_0x530a3f){return{'name':_0x530a3f[_0x9182('0x44')],'type':_0x530a3f[_0x9182('0x45')]['key']};});_0x39e62b[_0x9182('0x46')]=_[_0x9182('0x41')](_0x31f355,'name');_0x39e62b[_0x9182('0x47')]=_[_0x9182('0x48')](_0x1f8b51[_0x9182('0x47')]);_0x39e62b['filters']=_[_0x9182('0x49')](_0x39e62b[_0x9182('0x46')],_0x39e62b['query']);_0x215bde[_0x9182('0x4a')]=_[_0x9182('0x49')](_0x39e62b[_0x9182('0x46')],qs['fields'](_0x1f8b51[_0x9182('0x47')][_0x9182('0x4b')]));_0x215bde[_0x9182('0x4a')]=_0x215bde[_0x9182('0x4a')][_0x9182('0x4c')]?_0x215bde[_0x9182('0x4a')]:_0x39e62b[_0x9182('0x46')];if(!_0x1f8b51['query']['hasOwnProperty'](_0x9182('0x4d'))){_0x215bde[_0x9182('0x33')]=qs['limit'](_0x1f8b51['query']['limit']);_0x215bde[_0x9182('0x34')]=qs[_0x9182('0x34')](_0x1f8b51[_0x9182('0x47')][_0x9182('0x34')]);}_0x215bde[_0x9182('0x4e')]=qs['sort'](_0x1f8b51[_0x9182('0x47')][_0x9182('0x4f')]);_0x215bde[_0x9182('0x50')]=qs['filters'](_[_0x9182('0x51')](_0x1f8b51[_0x9182('0x47')],_0x39e62b['filters']),_0x31f355);if(_0x1f8b51[_0x9182('0x47')][_0x9182('0x52')]){_0x215bde[_0x9182('0x50')]=_[_0x9182('0x53')](_0x215bde['where'],{'$or':_[_0x9182('0x41')](_0x31f355,function(_0x274d20){if(_0x274d20[_0x9182('0x45')]!==_0x9182('0x54')){var _0x19a129={};_0x19a129[_0x274d20[_0x9182('0x3e')]]={'$like':'%'+_0x1f8b51[_0x9182('0x47')]['filter']+'%'};return _0x19a129;}})});}_0x215bde=_['merge']({},_0x215bde,_0x1f8b51[_0x9182('0x55')]);var _0x210669={'where':_0x215bde[_0x9182('0x50')]};return db[_0x9182('0x42')][_0x9182('0x35')](_0x210669)[_0x9182('0x23')](function(_0x52544c){_0x16d516[_0x9182('0x35')]=_0x52544c;if(_0x1f8b51['query'][_0x9182('0x56')]){_0x215bde[_0x9182('0x57')]=[{'all':!![]}];}return db[_0x9182('0x42')][_0x9182('0x58')](_0x215bde);})[_0x9182('0x23')](function(_0x22d8c2){_0x16d516['rows']=_0x22d8c2;return _0x16d516;})[_0x9182('0x23')](respondWithFilteredResult(_0x1afa43,_0x215bde))['catch'](handleError(_0x1afa43,null));};exports[_0x9182('0x59')]=function(_0xfb6767,_0x24ef1c){var _0x1d19ff={'raw':!![],'where':{'id':_0xfb6767[_0x9182('0x5a')]['id']}},_0x3f58e3={};_0x3f58e3['model']=_[_0x9182('0x48')](db[_0x9182('0x42')]['rawAttributes']);_0x3f58e3[_0x9182('0x47')]=_[_0x9182('0x48')](_0xfb6767['query']);_0x3f58e3[_0x9182('0x5b')]=_[_0x9182('0x49')](_0x3f58e3[_0x9182('0x46')],_0x3f58e3['query']);_0x1d19ff[_0x9182('0x4a')]=_[_0x9182('0x49')](_0x3f58e3[_0x9182('0x46')],qs[_0x9182('0x4b')](_0xfb6767[_0x9182('0x47')][_0x9182('0x4b')]));_0x1d19ff[_0x9182('0x4a')]=_0x1d19ff[_0x9182('0x4a')][_0x9182('0x4c')]?_0x1d19ff[_0x9182('0x4a')]:_0x3f58e3[_0x9182('0x46')];if(_0xfb6767[_0x9182('0x47')][_0x9182('0x56')]){_0x1d19ff['include']=[{'all':!![]}];}_0x1d19ff=_[_0x9182('0x53')]({},_0x1d19ff,_0xfb6767['options']);return db[_0x9182('0x42')][_0x9182('0x5c')](_0x1d19ff)[_0x9182('0x23')](handleEntityNotFound(_0x24ef1c,null))[_0x9182('0x23')](respondWithResult(_0x24ef1c,null))[_0x9182('0x2e')](handleError(_0x24ef1c,null));};exports['create']=function(_0x1491c4,_0x5713bc){return db[_0x9182('0x42')]['create'](_0x1491c4[_0x9182('0x5d')],{})[_0x9182('0x23')](function(_0x4f22aa){var _0x5ae6f5=_0x1491c4[_0x9182('0x5e')]['get']({'plain':!![]});if(!_0x5ae6f5)throw new Error(_0x9182('0x5f'));if(_0x5ae6f5[_0x9182('0x60')]===_0x9182('0x5e')){var _0x3e986e=_0x4f22aa[_0x9182('0x3b')]({'plain':!![]});var _0x5436a1=_0x9182('0x3c');return db['UserProfileSection'][_0x9182('0x5c')]({'where':{'name':_0x5436a1,'userProfileId':_0x5ae6f5[_0x9182('0x61')]},'raw':!![]})['then'](function(_0x262d30){if(_0x262d30&&_0x262d30[_0x9182('0x62')]===0x0){return db['UserProfileResource'][_0x9182('0x63')]({'name':_0x3e986e['name'],'resourceId':_0x3e986e['id'],'type':_0x262d30[_0x9182('0x3e')],'sectionId':_0x262d30['id']},{})[_0x9182('0x23')](function(){return _0x4f22aa;});}else{return _0x4f22aa;}})['catch'](function(_0x114dc6){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x114dc6);throw _0x114dc6;});}return _0x4f22aa;})['then'](respondWithResult(_0x5713bc,0xc9))[_0x9182('0x2e')](handleError(_0x5713bc,null));};exports[_0x9182('0x39')]=function(_0x3b1edb,_0x3a541a){if(_0x3b1edb[_0x9182('0x5d')]['id']){delete _0x3b1edb['body']['id'];}return db[_0x9182('0x42')]['find']({'where':{'id':_0x3b1edb[_0x9182('0x5a')]['id']}})['then'](handleEntityNotFound(_0x3a541a,null))['then'](saveUpdates(_0x3b1edb[_0x9182('0x5d')],null))[_0x9182('0x23')](respondWithResult(_0x3a541a,null))[_0x9182('0x2e')](handleError(_0x3a541a,null));};exports[_0x9182('0x3a')]=function(_0xc6d0f7,_0xd5da66){return db[_0x9182('0x42')][_0x9182('0x5c')]({'where':{'id':_0xc6d0f7[_0x9182('0x5a')]['id']}})[_0x9182('0x23')](handleEntityNotFound(_0xd5da66,null))['then'](removeEntity(_0xd5da66,null))[_0x9182('0x2e')](handleError(_0xd5da66,null));};exports[_0x9182('0x64')]=function(_0x48542e,_0xbe7169){return db['ChatQueue'][_0x9182('0x64')]()[_0x9182('0x23')](respondWithResult(_0xbe7169,null))[_0x9182('0x2e')](handleError(_0xbe7169,null));};exports[_0x9182('0x65')]=function(_0x4a03f9,_0x23acbc,_0x11c02f){var _0x5b8113={'raw':!![],'where':{}},_0x5743fa={},_0x556650;return db['ChatQueue']['findOne']({'where':{'id':_0x4a03f9['params']['id']}})[_0x9182('0x23')](handleEntityNotFound(_0x23acbc,null))[_0x9182('0x23')](function(_0x4c9356){if(_0x4c9356){_0x556650=_0x4c9356[_0x9182('0x3b')]({'plain':!![]});_0x5743fa[_0x9182('0x46')]=_[_0x9182('0x48')](db[_0x9182('0x66')][_0x9182('0x43')]);_0x5743fa[_0x9182('0x47')]=_[_0x9182('0x48')](_0x4a03f9[_0x9182('0x47')]);_0x5743fa[_0x9182('0x5b')]=_[_0x9182('0x49')](_0x5743fa[_0x9182('0x46')],_0x5743fa[_0x9182('0x47')]);_0x5b8113[_0x9182('0x4a')]=_[_0x9182('0x49')](_0x5743fa[_0x9182('0x46')],qs[_0x9182('0x4b')](_0x4a03f9[_0x9182('0x47')][_0x9182('0x4b')]));_0x5b8113[_0x9182('0x4a')]=_0x5b8113[_0x9182('0x4a')][_0x9182('0x4c')]?_0x5b8113[_0x9182('0x4a')]:_0x5743fa[_0x9182('0x46')];if(!_0x4a03f9[_0x9182('0x47')][_0x9182('0x67')]('nolimit')){_0x5b8113['limit']=qs[_0x9182('0x33')](_0x4a03f9['query'][_0x9182('0x33')]);_0x5b8113[_0x9182('0x34')]=qs[_0x9182('0x34')](_0x4a03f9[_0x9182('0x47')][_0x9182('0x34')]);}_0x5b8113[_0x9182('0x4e')]=qs[_0x9182('0x4f')](_0x4a03f9[_0x9182('0x47')]['sort']);_0x5b8113[_0x9182('0x50')]=qs['filters'](_['pick'](_0x4a03f9[_0x9182('0x47')],_0x5743fa[_0x9182('0x5b')]));_0x5b8113['where']['ChatQueueId']=_0x4c9356['id'];if(_0x4a03f9[_0x9182('0x47')][_0x9182('0x52')]){_0x5b8113[_0x9182('0x50')]=_['merge'](_0x5b8113['where'],{'$or':_['map'](_0x5b8113['attributes'],function(_0x20d90e){var _0x980b2a={};_0x980b2a[_0x20d90e]={'$like':'%'+_0x4a03f9[_0x9182('0x47')][_0x9182('0x52')]+'%'};return _0x980b2a;})});}_0x5b8113=_[_0x9182('0x53')]({},_0x5b8113,_0x4a03f9[_0x9182('0x55')]);return db[_0x9182('0x66')]['findAll'](_0x5b8113);}})['then'](function(_0x2b2ed1){if(_0x2b2ed1){return db[_0x9182('0x68')][_0x9182('0x69')]({'where':{'id':_[_0x9182('0x41')](_0x2b2ed1,'UserId'),'role':'agent'},'attributes':['id',_0x9182('0x3e'),_0x9182('0x6a'),_0x9182('0x6b'),'createdAt']});}})[_0x9182('0x23')](function(_0x49e9b2){if(_0x49e9b2){return{'count':_0x49e9b2[_0x9182('0x35')],'rows':_[_0x9182('0x41')](_0x49e9b2[_0x9182('0x6c')],function(_0xfa8afe){return{'membername':_0xfa8afe[_0x9182('0x3e')],'UserId':_0xfa8afe['id'],'queue_name':_0x556650[_0x9182('0x3e')],'ChatQueueId':_0x556650['id'],'interface':util[_0x9182('0x6d')](_0x9182('0x6e'),'SIP',_0xfa8afe[_0x9182('0x3e')]),'penalty':0x0,'paused':_0xfa8afe[_0x9182('0x6a')],'createdAt':_0xfa8afe['createdAt'],'updatedAt':_0xfa8afe[_0x9182('0x6b')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x23acbc,_0x5b8113))['catch'](handleError(_0x23acbc,null));};exports[_0x9182('0x6f')]=function(_0x2a1109,_0x20e18b,_0x547991){var _0x36e5da={};var _0x115e11={};var _0x474310;var _0x48b069;return db[_0x9182('0x42')][_0x9182('0x70')]({'where':{'id':_0x2a1109[_0x9182('0x5a')]['id']}})[_0x9182('0x23')](handleEntityNotFound(_0x20e18b,null))[_0x9182('0x23')](function(_0x489c87){if(_0x489c87){_0x474310=_0x489c87;_0x115e11[_0x9182('0x46')]=_[_0x9182('0x48')](db[_0x9182('0x71')][_0x9182('0x43')]);_0x115e11[_0x9182('0x47')]=_['keys'](_0x2a1109[_0x9182('0x47')]);_0x115e11[_0x9182('0x5b')]=_['intersection'](_0x115e11[_0x9182('0x46')],_0x115e11[_0x9182('0x47')]);_0x36e5da[_0x9182('0x4a')]=_[_0x9182('0x49')](_0x115e11[_0x9182('0x46')],qs[_0x9182('0x4b')](_0x2a1109[_0x9182('0x47')][_0x9182('0x4b')]));_0x36e5da[_0x9182('0x4a')]=_0x36e5da[_0x9182('0x4a')][_0x9182('0x4c')]?_0x36e5da['attributes']:_0x115e11['model'];_0x36e5da[_0x9182('0x4e')]=qs[_0x9182('0x4f')](_0x2a1109[_0x9182('0x47')]['sort']);_0x36e5da[_0x9182('0x50')]=qs['filters'](_['pick'](_0x2a1109[_0x9182('0x47')],_0x115e11[_0x9182('0x5b')]));if(_0x2a1109['query'][_0x9182('0x52')]){_0x36e5da[_0x9182('0x50')]=_[_0x9182('0x53')](_0x36e5da['where'],{'$or':_[_0x9182('0x41')](_0x36e5da[_0x9182('0x4a')],function(_0x42fd91){var _0x490844={};_0x490844[_0x42fd91]={'$like':'%'+_0x2a1109['query'][_0x9182('0x52')]+'%'};return _0x490844;})});}_0x36e5da=_[_0x9182('0x53')]({},_0x36e5da,_0x2a1109[_0x9182('0x55')]);return _0x474310['getTeams'](_0x36e5da);}})['then'](function(_0x3e0df4){if(_0x3e0df4){_0x48b069=_0x3e0df4[_0x9182('0x4c')];if(!_0x2a1109[_0x9182('0x47')][_0x9182('0x67')](_0x9182('0x4d'))){_0x36e5da[_0x9182('0x33')]=qs[_0x9182('0x33')](_0x2a1109['query'][_0x9182('0x33')]);_0x36e5da['offset']=qs['offset'](_0x2a1109[_0x9182('0x47')]['offset']);}return _0x474310[_0x9182('0x6f')](_0x36e5da);}})[_0x9182('0x23')](function(_0x30904c){if(_0x30904c){return _0x30904c?{'count':_0x48b069,'rows':_0x30904c}:null;}})['then'](respondWithResult(_0x20e18b,null))[_0x9182('0x2e')](handleError(_0x20e18b,null));};exports['addTeams']=function(_0x56e9df,_0x167a43,_0xec9a46){var _0x4d71a5=_0x56e9df[_0x9182('0x5d')][_0x9182('0x72')];return db[_0x9182('0x71')][_0x9182('0x58')]({'where':{'id':_0x4d71a5},'attributes':['id'],'include':[{'model':db[_0x9182('0x68')],'as':_0x9182('0x73'),'attributes':['id',_0x9182('0x3e'),_0x9182('0x74'),_0x9182('0x75'),_0x9182('0x76')],'raw':!![]}]})[_0x9182('0x23')](function(_0x4b29b3){if(_0x4b29b3){var _0x1e3be4=_['flatMap'](_0x4b29b3,function(_0x4399d2){var _0x3c8be3=_0x4399d2['get']({'plain':!![]});return _0x3c8be3[_0x9182('0x73')];});return db['ChatQueue'][_0x9182('0x5c')]({'where':{'id':_0x56e9df[_0x9182('0x5a')]['id']}})[_0x9182('0x23')](function(_0x5a4dc1){return db[_0x9182('0x77')][_0x9182('0x78')](function(_0x1ce743){return _0x5a4dc1[_0x9182('0x79')](_0x4d71a5,{'transaction':_0x1ce743})[_0x9182('0x23')](function(){return BPromise[_0x9182('0x7a')](_0x1e3be4,function(_0x2f3790){return db[_0x9182('0x66')][_0x9182('0x7b')]({'where':{'UserId':_0x2f3790['id'],'ChatQueueId':_0x56e9df['params']['id']},'transaction':_0x1ce743});});})[_0x9182('0x23')](function(){_0x1e3be4[_0x9182('0x7c')](function(_0x21bb68){socket[_0x9182('0x7d')]('userChatQueue:save',{'UserId':_0x21bb68['id'],'ChatQueueId':_0x5a4dc1['id']});});});});});}})[_0x9182('0x23')](respondWithStatusCode(_0x167a43,null))['catch'](handleError(_0x167a43,null));};exports['removeTeams']=function(_0x4f38e1,_0x17c227,_0x4719ba){return db[_0x9182('0x71')][_0x9182('0x58')]({'where':{'id':_0x4f38e1[_0x9182('0x47')][_0x9182('0x72')]},'attributes':['id'],'include':[{'model':db[_0x9182('0x68')],'as':_0x9182('0x73'),'attributes':['id'],'raw':!![]}]})[_0x9182('0x23')](handleEntityNotFound(_0x17c227,null))[_0x9182('0x23')](function(_0x2edb4b){var _0x117d0e=_[_0x9182('0x41')](_0x2edb4b,'id');var _0x339b9f=[];var _0x18fd24=[];var _0x166cff=squel[_0x9182('0x7e')]();_0x166cff[_0x9182('0x7f')](_0x9182('0x80'))['from'](_0x9182('0x81'),'tq')[_0x9182('0x82')](_0x9182('0x83'),'ut',_0x9182('0x84'))[_0x9182('0x50')](_0x9182('0x85'),_0x4f38e1['params']['id']);for(var _0x480bed=0x0;_0x480bed<_0x2edb4b['length'];_0x480bed+=0x1){let _0x14c897=_0x2edb4b[_0x480bed];for(var _0x45c857=0x0;_0x45c857<_0x14c897[_0x9182('0x73')][_0x9182('0x4c')];_0x45c857+=0x1){let _0x348f79=_0x14c897[_0x9182('0x73')][_0x45c857];var _0x17a3b7=_0x166cff[_0x9182('0x86')]();_0x17a3b7['where'](_0x9182('0x87'),_0x348f79['id']);_0x18fd24[_0x9182('0x88')](db[_0x9182('0x77')][_0x9182('0x47')](_0x17a3b7[_0x9182('0x89')](),{'type':db['sequelize'][_0x9182('0x8a')][_0x9182('0x8b')]})['then'](function(_0x203021){if(_0x203021[_0x9182('0x4c')]===0x1){return _0x348f79['id'];}else{var _0x374f85=_[_0x9182('0x8c')](_[_0x9182('0x41')](_0x203021,_0x9182('0x8d')),function(_0x360bcf){return _[_0x9182('0x8e')](_0x117d0e,_0x360bcf);});if(_0x374f85){return _0x348f79['id'];}}}));}}return BPromise['all'](_0x18fd24)['then'](function(_0x483fb4){_0x339b9f=_(_0x339b9f)[_0x9182('0x8f')](_0x483fb4)['compact']()[_0x9182('0x90')]();return db[_0x9182('0x42')][_0x9182('0x5c')]({'where':{'id':_0x4f38e1[_0x9182('0x5a')]['id']}})[_0x9182('0x23')](function(_0x41396d){return db['sequelize'][_0x9182('0x78')](function(_0x311daa){return _0x41396d[_0x9182('0x91')](_0x4f38e1['query'][_0x9182('0x72')],{'transaction':_0x311daa})['then'](function(){if(!_[_0x9182('0x92')](_0x339b9f)){return _0x41396d[_0x9182('0x93')](_0x339b9f,{'transaction':_0x311daa});}})[_0x9182('0x23')](function(){_0x339b9f[_0x9182('0x7c')](function(_0x19c652){socket[_0x9182('0x7d')]('userChatQueue:remove',{'UserId':_0x19c652,'ChatQueueId':_0x41396d['id']});});});});});});})[_0x9182('0x23')](respondWithStatusCode(_0x17c227,null))[_0x9182('0x2e')](handleError(_0x17c227,null));};exports['addAgents']=function(_0xad24d9,_0x1bf5c6,_0x307e10){return db[_0x9182('0x42')][_0x9182('0x5c')]({'where':{'id':_0xad24d9[_0x9182('0x5a')]['id']}})[_0x9182('0x23')](handleEntityNotFound(_0x1bf5c6,null))[_0x9182('0x23')](function(_0xd2386c){if(_0xd2386c){return _0xd2386c[_0x9182('0x94')](_0xad24d9['body'][_0x9182('0x72')],_[_0x9182('0x95')](_0xad24d9['body'],[_0x9182('0x72'),'id'])||{})[_0x9182('0x96')](function(_0x361aee){for(var _0x264a73=0x0;_0x264a73<_0xad24d9['body'][_0x9182('0x72')]['length'];_0x264a73+=0x1){socket[_0x9182('0x7d')](_0x9182('0x97'),{'UserId':Number(_0xad24d9['body']['ids'][_0x264a73]),'ChatQueueId':Number(_0xad24d9[_0x9182('0x5a')]['id'])});}return _0x361aee;});}})[_0x9182('0x23')](respondWithResult(_0x1bf5c6,null))['catch'](handleError(_0x1bf5c6,null));};exports[_0x9182('0x93')]=function(_0x1b1c27,_0x33a389,_0x3c7087){return db['ChatQueue'][_0x9182('0x5c')]({'where':{'id':_0x1b1c27['params']['id']}})['then'](handleEntityNotFound(_0x33a389,null))[_0x9182('0x23')](function(_0x4f7b9e){if(_0x4f7b9e){return _0x4f7b9e[_0x9182('0x93')](_0x1b1c27[_0x9182('0x47')][_0x9182('0x72')])[_0x9182('0x23')](function(){if(_[_0x9182('0x98')](_0x1b1c27['query'][_0x9182('0x72')])){for(var _0x2308e8=0x0;_0x2308e8<_0x1b1c27[_0x9182('0x47')][_0x9182('0x72')][_0x9182('0x4c')];_0x2308e8+=0x1){socket[_0x9182('0x7d')](_0x9182('0x99'),{'UserId':Number(_0x1b1c27[_0x9182('0x47')][_0x9182('0x72')][_0x2308e8]),'ChatQueueId':Number(_0x1b1c27[_0x9182('0x5a')]['id'])});}}else{socket[_0x9182('0x7d')](_0x9182('0x99'),{'UserId':Number(_0x1b1c27[_0x9182('0x47')][_0x9182('0x72')]),'ChatQueueId':Number(_0x1b1c27[_0x9182('0x5a')]['id'])});}});}})[_0x9182('0x23')](respondWithStatusCode(_0x33a389,null))[_0x9182('0x2e')](handleError(_0x33a389,null));};exports['getAgents']=function(_0x383f82,_0x2cb8bf,_0x5abc68){var _0x15002d={};var _0x48ab18={};var _0x4c70f6;var _0x5e662c;return db[_0x9182('0x42')][_0x9182('0x70')]({'where':{'id':_0x383f82[_0x9182('0x5a')]['id']}})[_0x9182('0x23')](handleEntityNotFound(_0x2cb8bf,null))[_0x9182('0x23')](function(_0x95dbab){if(_0x95dbab){_0x4c70f6=_0x95dbab;_0x48ab18[_0x9182('0x46')]=_[_0x9182('0x48')](db[_0x9182('0x68')][_0x9182('0x43')]);_0x48ab18[_0x9182('0x47')]=_['keys'](_0x383f82[_0x9182('0x47')]);_0x48ab18[_0x9182('0x5b')]=_[_0x9182('0x49')](_0x48ab18['model'],_0x48ab18[_0x9182('0x47')]);_0x15002d[_0x9182('0x4a')]=_[_0x9182('0x49')](_0x48ab18[_0x9182('0x46')],qs[_0x9182('0x4b')](_0x383f82[_0x9182('0x47')][_0x9182('0x4b')]));_0x15002d[_0x9182('0x4a')]=_0x15002d[_0x9182('0x4a')][_0x9182('0x4c')]?_0x15002d[_0x9182('0x4a')]:_0x48ab18['model'];_0x15002d[_0x9182('0x4e')]=qs[_0x9182('0x4f')](_0x383f82[_0x9182('0x47')]['sort']);_0x15002d[_0x9182('0x50')]=qs['filters'](_[_0x9182('0x51')](_0x383f82[_0x9182('0x47')],_0x48ab18[_0x9182('0x5b')]));if(_0x383f82['query'][_0x9182('0x52')]){_0x15002d[_0x9182('0x50')]=_[_0x9182('0x53')](_0x15002d['where'],{'$or':_[_0x9182('0x41')](_0x15002d[_0x9182('0x4a')],function(_0x18de17){var _0x589562={};_0x589562[_0x18de17]={'$like':'%'+_0x383f82[_0x9182('0x47')][_0x9182('0x52')]+'%'};return _0x589562;})});}_0x15002d=_['merge']({},_0x15002d,_0x383f82['options']);return _0x4c70f6[_0x9182('0x9a')](_0x15002d);}})['then'](function(_0x41ce54){if(_0x41ce54){_0x5e662c=_0x41ce54[_0x9182('0x4c')];if(!_0x383f82[_0x9182('0x47')][_0x9182('0x67')](_0x9182('0x4d'))){_0x15002d[_0x9182('0x33')]=qs[_0x9182('0x33')](_0x383f82[_0x9182('0x47')][_0x9182('0x33')]);_0x15002d[_0x9182('0x34')]=qs[_0x9182('0x34')](_0x383f82[_0x9182('0x47')][_0x9182('0x34')]);}return _0x4c70f6[_0x9182('0x9a')](_0x15002d);}})[_0x9182('0x23')](function(_0xcb1530){if(_0xcb1530){return _0xcb1530?{'count':_0x5e662c,'rows':_0xcb1530}:null;}})[_0x9182('0x23')](respondWithResult(_0x2cb8bf,null))[_0x9182('0x2e')](handleError(_0x2cb8bf,null));}; \ No newline at end of file +var _0x35f3=['getAgents','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','request','then','info','request\x20sent','stringify','error','message','ChatQueue,\x20%s,\x20%s','catch','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','update','destroy','name','send','index','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','ChatQueue','includeAll','include','findAll','rows','params','rawAttributes','options','create','body','user','get','role','ChatQueues','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','describe','findOne','ChatQueueId','findAndCountAll','agent','chatPause','updatedAt','createdAt','format','%s/%s','getTeams','Team','addTeams','ids','User','Agents','online','voicePause','interface','flatMap','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','SELECT','every','union','compact','value','transaction','isEmpty','removeAgents','addAgents','omit','spread','isArray','userChatQueue:remove'];(function(_0x614c88,_0x184f02){var _0x1a768e=function(_0x4f204f){while(--_0x4f204f){_0x614c88['push'](_0x614c88['shift']());}};_0x1a768e(++_0x184f02);}(_0x35f3,0x98));var _0x335f=function(_0xbd4a35,_0x3eec3b){_0xbd4a35=_0xbd4a35-0x0;var _0x1da054=_0x35f3[_0xbd4a35];return _0x1da054;};'use strict';var emlformat=require(_0x335f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x335f('0x1'));var jsonpatch=require(_0x335f('0x2'));var rp=require(_0x335f('0x3'));var moment=require('moment');var BPromise=require(_0x335f('0x4'));var Mustache=require(_0x335f('0x5'));var util=require(_0x335f('0x6'));var path=require(_0x335f('0x7'));var sox=require(_0x335f('0x8'));var csv=require(_0x335f('0x9'));var ejs=require(_0x335f('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x335f('0xb'));var squel=require(_0x335f('0xc'));var crypto=require('crypto');var jsforce=require(_0x335f('0xd'));var deskjs=require(_0x335f('0xe'));var toCsv=require(_0x335f('0x9'));var querystring=require(_0x335f('0xf'));var Papa=require(_0x335f('0x10'));var Redis=require(_0x335f('0x11'));var authService=require(_0x335f('0x12'));var qs=require(_0x335f('0x13'));var as=require(_0x335f('0x14'));var hardwareService=require(_0x335f('0x15'));var logger=require(_0x335f('0x16'))('api');var utils=require(_0x335f('0x17'));var config=require(_0x335f('0x18'));var licenseUtil=require(_0x335f('0x19'));var db=require(_0x335f('0x1a'))['db'];config[_0x335f('0x1b')]=_[_0x335f('0x1c')](config[_0x335f('0x1b')],{'host':_0x335f('0x1d'),'port':0x18eb});var socket=require(_0x335f('0x1e'))(new Redis(config[_0x335f('0x1b')]));require(_0x335f('0x1f'))[_0x335f('0x20')](socket);var jayson=require(_0x335f('0x21'));var client=jayson[_0x335f('0x22')]['http']({'port':0x232a});function respondWithRpcPromise(_0x32ef1e,_0x27b886,_0x478a97,_0x288be2){return new BPromise(function(_0x5e3d8d,_0x2070c0){var _0x206630=_0x288be2||client;return _0x206630[_0x335f('0x23')](_0x32ef1e,_0x478a97)[_0x335f('0x24')](function(_0x41c6d2){logger[_0x335f('0x25')]('ChatQueue,\x20%s,\x20%s',_0x27b886,_0x335f('0x26'));logger['debug']('ChatQueue,\x20%s,\x20%s,\x20%s',_0x27b886,_0x335f('0x26'),JSON[_0x335f('0x27')](_0x41c6d2));if(_0x41c6d2['error']){if(_0x41c6d2['error']['code']===0x1f4){logger[_0x335f('0x28')]('ChatQueue,\x20%s,\x20%s',_0x27b886,_0x41c6d2[_0x335f('0x28')]['message']);return _0x2070c0(_0x41c6d2[_0x335f('0x28')][_0x335f('0x29')]);}logger[_0x335f('0x28')]('ChatQueue,\x20%s,\x20%s',_0x27b886,_0x41c6d2[_0x335f('0x28')][_0x335f('0x29')]);return _0x5e3d8d(_0x41c6d2['error']['message']);}else{logger[_0x335f('0x25')](_0x335f('0x2a'),_0x27b886,_0x335f('0x26'));_0x5e3d8d(_0x41c6d2['result'][_0x335f('0x29')]);}})[_0x335f('0x2b')](function(_0x1286a8){logger[_0x335f('0x28')](_0x335f('0x2a'),_0x27b886,_0x1286a8);_0x2070c0(_0x1286a8);});});}function respondWithStatusCode(_0x55787a,_0x583917){_0x583917=_0x583917||0xcc;return function(_0x178322){if(_0x178322){return _0x55787a[_0x335f('0x2c')](_0x583917);}return _0x55787a[_0x335f('0x2d')](_0x583917)[_0x335f('0x2e')]();};}function respondWithResult(_0x53fd7d,_0x2c92ec){_0x2c92ec=_0x2c92ec||0xc8;return function(_0x5c205b){if(_0x5c205b){return _0x53fd7d[_0x335f('0x2d')](_0x2c92ec)['json'](_0x5c205b);}};}function respondWithFilteredResult(_0x1d09a5,_0x4d7832){return function(_0x5d5bcf){if(_0x5d5bcf){var _0x497658=typeof _0x4d7832[_0x335f('0x2f')]===_0x335f('0x30')&&typeof _0x4d7832[_0x335f('0x31')]===_0x335f('0x30');var _0x1c55ee=_0x5d5bcf[_0x335f('0x32')];var _0x1b528b=_0x497658?0x0:_0x4d7832[_0x335f('0x2f')];var _0x57689c=_0x497658?_0x5d5bcf[_0x335f('0x32')]:_0x4d7832[_0x335f('0x2f')]+_0x4d7832[_0x335f('0x31')];var _0x429c6;if(_0x57689c>=_0x1c55ee){_0x57689c=_0x1c55ee;_0x429c6=0xc8;}else{_0x429c6=0xce;}_0x1d09a5[_0x335f('0x2d')](_0x429c6);return _0x1d09a5['set'](_0x335f('0x33'),_0x1b528b+'-'+_0x57689c+'/'+_0x1c55ee)[_0x335f('0x34')](_0x5d5bcf);}return null;};}function patchUpdates(_0x8b6651){return function(_0x50ffb2){try{jsonpatch[_0x335f('0x35')](_0x50ffb2,_0x8b6651,!![]);}catch(_0x1235a3){return BPromise[_0x335f('0x36')](_0x1235a3);}return _0x50ffb2['save']();};}function saveUpdates(_0x238975,_0xf01acf){return function(_0x3a094d){if(_0x3a094d){return _0x3a094d[_0x335f('0x37')](_0x238975)[_0x335f('0x24')](function(_0x30bcb8){return _0x30bcb8;});}return null;};}function removeEntity(_0x535df2,_0x5b28f0){return function(_0x287271){if(_0x287271){return _0x287271['destroy']()['then'](function(){var _0x24666d=_0x287271['get']({'plain':!![]});var _0x59ed5a='ChatQueues';return db['UserProfileResource'][_0x335f('0x38')]({'where':{'type':_0x59ed5a,'resourceId':_0x24666d['id']}})['then'](function(){return _0x287271;});})['then'](function(){_0x535df2[_0x335f('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f9b6a,_0x52e448){return function(_0x4278ec){if(!_0x4278ec){_0x2f9b6a[_0x335f('0x2c')](0x194);}return _0x4278ec;};}function handleError(_0x1aa4c5,_0x3d1f22){_0x3d1f22=_0x3d1f22||0x1f4;return function(_0x101ab2){logger[_0x335f('0x28')](_0x101ab2['stack']);if(_0x101ab2[_0x335f('0x39')]){delete _0x101ab2['name'];}_0x1aa4c5['status'](_0x3d1f22)[_0x335f('0x3a')](_0x101ab2);};}exports[_0x335f('0x3b')]=function(_0x221f9e,_0x14f0b7){var _0x221dc1={},_0xbe0bd9={},_0x517662={'count':0x0,'rows':[]};var _0x189b91=_['map'](db['ChatQueue']['rawAttributes'],function(_0x4f96af){return{'name':_0x4f96af[_0x335f('0x3c')],'type':_0x4f96af[_0x335f('0x3d')][_0x335f('0x3e')]};});_0xbe0bd9[_0x335f('0x3f')]=_[_0x335f('0x40')](_0x189b91,_0x335f('0x39'));_0xbe0bd9[_0x335f('0x41')]=_[_0x335f('0x42')](_0x221f9e[_0x335f('0x41')]);_0xbe0bd9[_0x335f('0x43')]=_[_0x335f('0x44')](_0xbe0bd9['model'],_0xbe0bd9[_0x335f('0x41')]);_0x221dc1['attributes']=_[_0x335f('0x44')](_0xbe0bd9['model'],qs['fields'](_0x221f9e[_0x335f('0x41')][_0x335f('0x45')]));_0x221dc1[_0x335f('0x46')]=_0x221dc1[_0x335f('0x46')][_0x335f('0x47')]?_0x221dc1['attributes']:_0xbe0bd9[_0x335f('0x3f')];if(!_0x221f9e['query'][_0x335f('0x48')](_0x335f('0x49'))){_0x221dc1[_0x335f('0x31')]=qs[_0x335f('0x31')](_0x221f9e[_0x335f('0x41')][_0x335f('0x31')]);_0x221dc1[_0x335f('0x2f')]=qs[_0x335f('0x2f')](_0x221f9e[_0x335f('0x41')][_0x335f('0x2f')]);}_0x221dc1[_0x335f('0x4a')]=qs[_0x335f('0x4b')](_0x221f9e[_0x335f('0x41')][_0x335f('0x4b')]);_0x221dc1['where']=qs[_0x335f('0x43')](_[_0x335f('0x4c')](_0x221f9e['query'],_0xbe0bd9[_0x335f('0x43')]),_0x189b91);if(_0x221f9e['query'][_0x335f('0x4d')]){_0x221dc1['where']=_[_0x335f('0x4e')](_0x221dc1[_0x335f('0x4f')],{'$or':_[_0x335f('0x40')](_0x189b91,function(_0x1540d2){if(_0x1540d2[_0x335f('0x3d')]!=='VIRTUAL'){var _0x2c14bf={};_0x2c14bf[_0x1540d2[_0x335f('0x39')]]={'$like':'%'+_0x221f9e[_0x335f('0x41')][_0x335f('0x4d')]+'%'};return _0x2c14bf;}})});}_0x221dc1=_[_0x335f('0x4e')]({},_0x221dc1,_0x221f9e['options']);var _0x1dbe27={'where':_0x221dc1[_0x335f('0x4f')]};return db[_0x335f('0x50')][_0x335f('0x32')](_0x1dbe27)[_0x335f('0x24')](function(_0x5d66d5){_0x517662[_0x335f('0x32')]=_0x5d66d5;if(_0x221f9e[_0x335f('0x41')][_0x335f('0x51')]){_0x221dc1[_0x335f('0x52')]=[{'all':!![]}];}return db[_0x335f('0x50')][_0x335f('0x53')](_0x221dc1);})[_0x335f('0x24')](function(_0x5c5228){_0x517662[_0x335f('0x54')]=_0x5c5228;return _0x517662;})[_0x335f('0x24')](respondWithFilteredResult(_0x14f0b7,_0x221dc1))['catch'](handleError(_0x14f0b7,null));};exports['show']=function(_0x1ab2e4,_0x4c0198){var _0xd654cf={'raw':!![],'where':{'id':_0x1ab2e4[_0x335f('0x55')]['id']}},_0x54c57a={};_0x54c57a[_0x335f('0x3f')]=_[_0x335f('0x42')](db['ChatQueue'][_0x335f('0x56')]);_0x54c57a['query']=_[_0x335f('0x42')](_0x1ab2e4[_0x335f('0x41')]);_0x54c57a[_0x335f('0x43')]=_[_0x335f('0x44')](_0x54c57a[_0x335f('0x3f')],_0x54c57a['query']);_0xd654cf[_0x335f('0x46')]=_[_0x335f('0x44')](_0x54c57a[_0x335f('0x3f')],qs[_0x335f('0x45')](_0x1ab2e4['query'][_0x335f('0x45')]));_0xd654cf[_0x335f('0x46')]=_0xd654cf[_0x335f('0x46')][_0x335f('0x47')]?_0xd654cf[_0x335f('0x46')]:_0x54c57a[_0x335f('0x3f')];if(_0x1ab2e4[_0x335f('0x41')]['includeAll']){_0xd654cf[_0x335f('0x52')]=[{'all':!![]}];}_0xd654cf=_[_0x335f('0x4e')]({},_0xd654cf,_0x1ab2e4[_0x335f('0x57')]);return db[_0x335f('0x50')]['find'](_0xd654cf)['then'](handleEntityNotFound(_0x4c0198,null))[_0x335f('0x24')](respondWithResult(_0x4c0198,null))['catch'](handleError(_0x4c0198,null));};exports[_0x335f('0x58')]=function(_0x32d049,_0x1d069c){return db[_0x335f('0x50')][_0x335f('0x58')](_0x32d049[_0x335f('0x59')],{})[_0x335f('0x24')](function(_0x2512fc){var _0x57ea09=_0x32d049[_0x335f('0x5a')][_0x335f('0x5b')]({'plain':!![]});if(!_0x57ea09)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x57ea09[_0x335f('0x5c')]===_0x335f('0x5a')){var _0x102501=_0x2512fc[_0x335f('0x5b')]({'plain':!![]});var _0x284f2e=_0x335f('0x5d');return db[_0x335f('0x5e')]['find']({'where':{'name':_0x284f2e,'userProfileId':_0x57ea09['userProfileId']},'raw':!![]})[_0x335f('0x24')](function(_0x2157e3){if(_0x2157e3&&_0x2157e3[_0x335f('0x5f')]===0x0){return db[_0x335f('0x60')]['create']({'name':_0x102501[_0x335f('0x39')],'resourceId':_0x102501['id'],'type':_0x2157e3['name'],'sectionId':_0x2157e3['id']},{})[_0x335f('0x24')](function(){return _0x2512fc;});}else{return _0x2512fc;}})['catch'](function(_0x40b751){logger[_0x335f('0x28')](_0x335f('0x61'),_0x40b751);throw _0x40b751;});}return _0x2512fc;})[_0x335f('0x24')](respondWithResult(_0x1d069c,0xc9))[_0x335f('0x2b')](handleError(_0x1d069c,null));};exports['update']=function(_0x5ba1f5,_0x47e97a){if(_0x5ba1f5[_0x335f('0x59')]['id']){delete _0x5ba1f5['body']['id'];}return db['ChatQueue']['find']({'where':{'id':_0x5ba1f5[_0x335f('0x55')]['id']}})['then'](handleEntityNotFound(_0x47e97a,null))['then'](saveUpdates(_0x5ba1f5[_0x335f('0x59')],null))['then'](respondWithResult(_0x47e97a,null))[_0x335f('0x2b')](handleError(_0x47e97a,null));};exports[_0x335f('0x38')]=function(_0x468a4a,_0x5a1aa0){return db[_0x335f('0x50')][_0x335f('0x62')]({'where':{'id':_0x468a4a['params']['id']}})[_0x335f('0x24')](handleEntityNotFound(_0x5a1aa0,null))[_0x335f('0x24')](removeEntity(_0x5a1aa0,null))[_0x335f('0x2b')](handleError(_0x5a1aa0,null));};exports[_0x335f('0x63')]=function(_0x53eea1,_0x4ad269){return db[_0x335f('0x50')][_0x335f('0x63')]()['then'](respondWithResult(_0x4ad269,null))['catch'](handleError(_0x4ad269,null));};exports['getMembers']=function(_0x3efe13,_0x1cee05,_0x474c77){var _0xb35305={'raw':!![],'where':{}},_0x316f11={},_0x22f663;return db[_0x335f('0x50')][_0x335f('0x64')]({'where':{'id':_0x3efe13[_0x335f('0x55')]['id']}})['then'](handleEntityNotFound(_0x1cee05,null))[_0x335f('0x24')](function(_0x3e026b){if(_0x3e026b){_0x22f663=_0x3e026b[_0x335f('0x5b')]({'plain':!![]});_0x316f11['model']=_[_0x335f('0x42')](db['UserChatQueue']['rawAttributes']);_0x316f11['query']=_[_0x335f('0x42')](_0x3efe13['query']);_0x316f11[_0x335f('0x43')]=_['intersection'](_0x316f11[_0x335f('0x3f')],_0x316f11[_0x335f('0x41')]);_0xb35305[_0x335f('0x46')]=_[_0x335f('0x44')](_0x316f11['model'],qs[_0x335f('0x45')](_0x3efe13[_0x335f('0x41')][_0x335f('0x45')]));_0xb35305[_0x335f('0x46')]=_0xb35305[_0x335f('0x46')]['length']?_0xb35305[_0x335f('0x46')]:_0x316f11[_0x335f('0x3f')];if(!_0x3efe13['query'][_0x335f('0x48')]('nolimit')){_0xb35305[_0x335f('0x31')]=qs['limit'](_0x3efe13[_0x335f('0x41')][_0x335f('0x31')]);_0xb35305['offset']=qs['offset'](_0x3efe13[_0x335f('0x41')][_0x335f('0x2f')]);}_0xb35305['order']=qs[_0x335f('0x4b')](_0x3efe13[_0x335f('0x41')][_0x335f('0x4b')]);_0xb35305[_0x335f('0x4f')]=qs[_0x335f('0x43')](_['pick'](_0x3efe13[_0x335f('0x41')],_0x316f11['filters']));_0xb35305[_0x335f('0x4f')][_0x335f('0x65')]=_0x3e026b['id'];if(_0x3efe13['query']['filter']){_0xb35305[_0x335f('0x4f')]=_[_0x335f('0x4e')](_0xb35305['where'],{'$or':_[_0x335f('0x40')](_0xb35305['attributes'],function(_0x3795a1){var _0x32705c={};_0x32705c[_0x3795a1]={'$like':'%'+_0x3efe13[_0x335f('0x41')][_0x335f('0x4d')]+'%'};return _0x32705c;})});}_0xb35305=_[_0x335f('0x4e')]({},_0xb35305,_0x3efe13[_0x335f('0x57')]);return db['UserChatQueue'][_0x335f('0x53')](_0xb35305);}})[_0x335f('0x24')](function(_0x3ba5ff){if(_0x3ba5ff){return db['User'][_0x335f('0x66')]({'where':{'id':_[_0x335f('0x40')](_0x3ba5ff,'UserId'),'role':_0x335f('0x67')},'attributes':['id',_0x335f('0x39'),_0x335f('0x68'),_0x335f('0x69'),_0x335f('0x6a')]});}})[_0x335f('0x24')](function(_0x192d2d){if(_0x192d2d){return{'count':_0x192d2d['count'],'rows':_['map'](_0x192d2d[_0x335f('0x54')],function(_0x1872cd){return{'membername':_0x1872cd[_0x335f('0x39')],'UserId':_0x1872cd['id'],'queue_name':_0x22f663[_0x335f('0x39')],'ChatQueueId':_0x22f663['id'],'interface':util[_0x335f('0x6b')](_0x335f('0x6c'),'SIP',_0x1872cd['name']),'penalty':0x0,'paused':_0x1872cd[_0x335f('0x68')],'createdAt':_0x1872cd[_0x335f('0x6a')],'updatedAt':_0x1872cd[_0x335f('0x69')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x335f('0x24')](respondWithFilteredResult(_0x1cee05,_0xb35305))['catch'](handleError(_0x1cee05,null));};exports[_0x335f('0x6d')]=function(_0x2c52aa,_0x9c75a,_0x420ee9){var _0x1afb99={};var _0x108e7d={};var _0x3975a1;var _0x2809b0;return db[_0x335f('0x50')][_0x335f('0x64')]({'where':{'id':_0x2c52aa[_0x335f('0x55')]['id']}})[_0x335f('0x24')](handleEntityNotFound(_0x9c75a,null))[_0x335f('0x24')](function(_0x430559){if(_0x430559){_0x3975a1=_0x430559;_0x108e7d[_0x335f('0x3f')]=_[_0x335f('0x42')](db[_0x335f('0x6e')][_0x335f('0x56')]);_0x108e7d[_0x335f('0x41')]=_[_0x335f('0x42')](_0x2c52aa[_0x335f('0x41')]);_0x108e7d[_0x335f('0x43')]=_['intersection'](_0x108e7d['model'],_0x108e7d[_0x335f('0x41')]);_0x1afb99[_0x335f('0x46')]=_[_0x335f('0x44')](_0x108e7d[_0x335f('0x3f')],qs[_0x335f('0x45')](_0x2c52aa[_0x335f('0x41')][_0x335f('0x45')]));_0x1afb99[_0x335f('0x46')]=_0x1afb99[_0x335f('0x46')]['length']?_0x1afb99['attributes']:_0x108e7d[_0x335f('0x3f')];_0x1afb99[_0x335f('0x4a')]=qs[_0x335f('0x4b')](_0x2c52aa['query'][_0x335f('0x4b')]);_0x1afb99['where']=qs[_0x335f('0x43')](_[_0x335f('0x4c')](_0x2c52aa[_0x335f('0x41')],_0x108e7d[_0x335f('0x43')]));if(_0x2c52aa[_0x335f('0x41')][_0x335f('0x4d')]){_0x1afb99[_0x335f('0x4f')]=_['merge'](_0x1afb99[_0x335f('0x4f')],{'$or':_[_0x335f('0x40')](_0x1afb99[_0x335f('0x46')],function(_0x22b328){var _0x204dcf={};_0x204dcf[_0x22b328]={'$like':'%'+_0x2c52aa[_0x335f('0x41')][_0x335f('0x4d')]+'%'};return _0x204dcf;})});}_0x1afb99=_[_0x335f('0x4e')]({},_0x1afb99,_0x2c52aa[_0x335f('0x57')]);return _0x3975a1[_0x335f('0x6d')](_0x1afb99);}})['then'](function(_0x5bf0dc){if(_0x5bf0dc){_0x2809b0=_0x5bf0dc[_0x335f('0x47')];if(!_0x2c52aa['query'][_0x335f('0x48')](_0x335f('0x49'))){_0x1afb99[_0x335f('0x31')]=qs['limit'](_0x2c52aa[_0x335f('0x41')]['limit']);_0x1afb99[_0x335f('0x2f')]=qs[_0x335f('0x2f')](_0x2c52aa['query'][_0x335f('0x2f')]);}return _0x3975a1['getTeams'](_0x1afb99);}})[_0x335f('0x24')](function(_0x3fb11d){if(_0x3fb11d){return _0x3fb11d?{'count':_0x2809b0,'rows':_0x3fb11d}:null;}})[_0x335f('0x24')](respondWithResult(_0x9c75a,null))['catch'](handleError(_0x9c75a,null));};exports[_0x335f('0x6f')]=function(_0x48393f,_0x21efc2,_0x6853fb){var _0xe5cd1d=_0x48393f[_0x335f('0x59')][_0x335f('0x70')];return db[_0x335f('0x6e')][_0x335f('0x53')]({'where':{'id':_0xe5cd1d},'attributes':['id'],'include':[{'model':db[_0x335f('0x71')],'as':_0x335f('0x72'),'attributes':['id','name',_0x335f('0x73'),_0x335f('0x74'),_0x335f('0x75')],'raw':!![]}]})[_0x335f('0x24')](function(_0x59b6cf){if(_0x59b6cf){var _0x4dd723=_[_0x335f('0x76')](_0x59b6cf,function(_0x126ab6){var _0x18521c=_0x126ab6[_0x335f('0x5b')]({'plain':!![]});return _0x18521c['Agents'];});return db[_0x335f('0x50')]['find']({'where':{'id':_0x48393f[_0x335f('0x55')]['id']}})[_0x335f('0x24')](function(_0x2a87b3){return db['sequelize']['transaction'](function(_0x1bb1db){return _0x2a87b3[_0x335f('0x6f')](_0xe5cd1d,{'transaction':_0x1bb1db})['then'](function(){return BPromise[_0x335f('0x77')](_0x4dd723,function(_0x167d0b){return db['UserChatQueue'][_0x335f('0x78')]({'where':{'UserId':_0x167d0b['id'],'ChatQueueId':_0x48393f[_0x335f('0x55')]['id']},'transaction':_0x1bb1db});});})[_0x335f('0x24')](function(){_0x4dd723[_0x335f('0x79')](function(_0x3b18af){socket[_0x335f('0x7a')](_0x335f('0x7b'),{'UserId':_0x3b18af['id'],'ChatQueueId':_0x2a87b3['id']});});});});});}})[_0x335f('0x24')](respondWithStatusCode(_0x21efc2,null))[_0x335f('0x2b')](handleError(_0x21efc2,null));};exports[_0x335f('0x7c')]=function(_0x515d77,_0x2918ec,_0x5424fb){return db[_0x335f('0x6e')][_0x335f('0x53')]({'where':{'id':_0x515d77[_0x335f('0x41')][_0x335f('0x70')]},'attributes':['id'],'include':[{'model':db[_0x335f('0x71')],'as':_0x335f('0x72'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x2918ec,null))['then'](function(_0x3f7e2b){var _0x3013ae=_[_0x335f('0x40')](_0x3f7e2b,'id');var _0x2232e9=[];var _0x428abe=[];var _0x5ded24=squel[_0x335f('0x7d')]();_0x5ded24[_0x335f('0x7e')](_0x335f('0x7f'))[_0x335f('0x80')](_0x335f('0x81'),'tq')[_0x335f('0x82')](_0x335f('0x83'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x335f('0x84'),_0x515d77[_0x335f('0x55')]['id']);for(var _0x4c4629=0x0;_0x4c4629<_0x3f7e2b[_0x335f('0x47')];_0x4c4629+=0x1){let _0x1c6e0a=_0x3f7e2b[_0x4c4629];for(var _0x378506=0x0;_0x378506<_0x1c6e0a[_0x335f('0x72')][_0x335f('0x47')];_0x378506+=0x1){let _0x1a7fcf=_0x1c6e0a['Agents'][_0x378506];var _0x267cc9=_0x5ded24[_0x335f('0x85')]();_0x267cc9[_0x335f('0x4f')](_0x335f('0x86'),_0x1a7fcf['id']);_0x428abe[_0x335f('0x87')](db['sequelize'][_0x335f('0x41')](_0x267cc9['toString'](),{'type':db[_0x335f('0x88')]['QueryTypes'][_0x335f('0x89')]})['then'](function(_0x5ed752){if(_0x5ed752[_0x335f('0x47')]===0x1){return _0x1a7fcf['id'];}else{var _0x266fea=_[_0x335f('0x8a')](_[_0x335f('0x40')](_0x5ed752,'TeamId'),function(_0x49aec9){return _['includes'](_0x3013ae,_0x49aec9);});if(_0x266fea){return _0x1a7fcf['id'];}}}));}}return BPromise['all'](_0x428abe)[_0x335f('0x24')](function(_0x3f4c53){_0x2232e9=_(_0x2232e9)[_0x335f('0x8b')](_0x3f4c53)[_0x335f('0x8c')]()[_0x335f('0x8d')]();return db[_0x335f('0x50')][_0x335f('0x62')]({'where':{'id':_0x515d77[_0x335f('0x55')]['id']}})['then'](function(_0x507de7){return db[_0x335f('0x88')][_0x335f('0x8e')](function(_0x40e02a){return _0x507de7[_0x335f('0x7c')](_0x515d77['query']['ids'],{'transaction':_0x40e02a})['then'](function(){if(!_[_0x335f('0x8f')](_0x2232e9)){return _0x507de7[_0x335f('0x90')](_0x2232e9,{'transaction':_0x40e02a});}})['then'](function(){_0x2232e9[_0x335f('0x79')](function(_0x1b0e22){socket['emit']('userChatQueue:remove',{'UserId':_0x1b0e22,'ChatQueueId':_0x507de7['id']});});});});});});})[_0x335f('0x24')](respondWithStatusCode(_0x2918ec,null))[_0x335f('0x2b')](handleError(_0x2918ec,null));};exports[_0x335f('0x91')]=function(_0x2c11dd,_0x488cc9,_0x11b57b){return db[_0x335f('0x50')][_0x335f('0x62')]({'where':{'id':_0x2c11dd['params']['id']}})[_0x335f('0x24')](handleEntityNotFound(_0x488cc9,null))[_0x335f('0x24')](function(_0x204cf8){if(_0x204cf8){return _0x204cf8[_0x335f('0x91')](_0x2c11dd['body'][_0x335f('0x70')],_[_0x335f('0x92')](_0x2c11dd[_0x335f('0x59')],[_0x335f('0x70'),'id'])||{})[_0x335f('0x93')](function(_0x4a5d8a){for(var _0x289dab=0x0;_0x289dab<_0x2c11dd['body'][_0x335f('0x70')][_0x335f('0x47')];_0x289dab+=0x1){socket['emit'](_0x335f('0x7b'),{'UserId':Number(_0x2c11dd['body'][_0x335f('0x70')][_0x289dab]),'ChatQueueId':Number(_0x2c11dd[_0x335f('0x55')]['id'])});}return _0x4a5d8a;});}})[_0x335f('0x24')](respondWithResult(_0x488cc9,null))['catch'](handleError(_0x488cc9,null));};exports[_0x335f('0x90')]=function(_0x111df1,_0x35dd30,_0x316948){return db[_0x335f('0x50')][_0x335f('0x62')]({'where':{'id':_0x111df1[_0x335f('0x55')]['id']}})[_0x335f('0x24')](handleEntityNotFound(_0x35dd30,null))[_0x335f('0x24')](function(_0x26b9ee){if(_0x26b9ee){return _0x26b9ee[_0x335f('0x90')](_0x111df1[_0x335f('0x41')][_0x335f('0x70')])[_0x335f('0x24')](function(){if(_[_0x335f('0x94')](_0x111df1['query'][_0x335f('0x70')])){for(var _0x27e4f0=0x0;_0x27e4f0<_0x111df1[_0x335f('0x41')][_0x335f('0x70')]['length'];_0x27e4f0+=0x1){socket[_0x335f('0x7a')](_0x335f('0x95'),{'UserId':Number(_0x111df1[_0x335f('0x41')][_0x335f('0x70')][_0x27e4f0]),'ChatQueueId':Number(_0x111df1[_0x335f('0x55')]['id'])});}}else{socket[_0x335f('0x7a')](_0x335f('0x95'),{'UserId':Number(_0x111df1[_0x335f('0x41')]['ids']),'ChatQueueId':Number(_0x111df1[_0x335f('0x55')]['id'])});}});}})[_0x335f('0x24')](respondWithStatusCode(_0x35dd30,null))[_0x335f('0x2b')](handleError(_0x35dd30,null));};exports[_0x335f('0x96')]=function(_0xd90543,_0x23f596,_0x3ca7e9){var _0x58af07={};var _0x2cf3ae={};var _0x211ac8;var _0x6970c0;return db[_0x335f('0x50')]['findOne']({'where':{'id':_0xd90543[_0x335f('0x55')]['id']}})[_0x335f('0x24')](handleEntityNotFound(_0x23f596,null))['then'](function(_0x19aba3){if(_0x19aba3){_0x211ac8=_0x19aba3;_0x2cf3ae[_0x335f('0x3f')]=_[_0x335f('0x42')](db[_0x335f('0x71')][_0x335f('0x56')]);_0x2cf3ae[_0x335f('0x41')]=_[_0x335f('0x42')](_0xd90543[_0x335f('0x41')]);_0x2cf3ae[_0x335f('0x43')]=_[_0x335f('0x44')](_0x2cf3ae['model'],_0x2cf3ae[_0x335f('0x41')]);_0x58af07[_0x335f('0x46')]=_[_0x335f('0x44')](_0x2cf3ae[_0x335f('0x3f')],qs[_0x335f('0x45')](_0xd90543['query']['fields']));_0x58af07[_0x335f('0x46')]=_0x58af07[_0x335f('0x46')]['length']?_0x58af07[_0x335f('0x46')]:_0x2cf3ae[_0x335f('0x3f')];_0x58af07[_0x335f('0x4a')]=qs[_0x335f('0x4b')](_0xd90543['query'][_0x335f('0x4b')]);_0x58af07['where']=qs[_0x335f('0x43')](_[_0x335f('0x4c')](_0xd90543[_0x335f('0x41')],_0x2cf3ae['filters']));if(_0xd90543[_0x335f('0x41')][_0x335f('0x4d')]){_0x58af07['where']=_[_0x335f('0x4e')](_0x58af07['where'],{'$or':_[_0x335f('0x40')](_0x58af07[_0x335f('0x46')],function(_0x38755b){var _0x4c4bb8={};_0x4c4bb8[_0x38755b]={'$like':'%'+_0xd90543['query'][_0x335f('0x4d')]+'%'};return _0x4c4bb8;})});}_0x58af07=_[_0x335f('0x4e')]({},_0x58af07,_0xd90543[_0x335f('0x57')]);return _0x211ac8[_0x335f('0x96')](_0x58af07);}})['then'](function(_0x62806b){if(_0x62806b){_0x6970c0=_0x62806b[_0x335f('0x47')];if(!_0xd90543[_0x335f('0x41')][_0x335f('0x48')]('nolimit')){_0x58af07[_0x335f('0x31')]=qs[_0x335f('0x31')](_0xd90543[_0x335f('0x41')][_0x335f('0x31')]);_0x58af07['offset']=qs[_0x335f('0x2f')](_0xd90543[_0x335f('0x41')][_0x335f('0x2f')]);}return _0x211ac8[_0x335f('0x96')](_0x58af07);}})[_0x335f('0x24')](function(_0x4031ba){if(_0x4031ba){return _0x4031ba?{'count':_0x6970c0,'rows':_0x4031ba}:null;}})[_0x335f('0x24')](respondWithResult(_0x23f596,null))['catch'](handleError(_0x23f596,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 49b9819..8577b63 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 _0xff7a=['ChatQueue','setMaxListeners','emit','hasOwnProperty','hook','exports','events'];(function(_0x3ebb69,_0x3e612e){var _0x421e59=function(_0x5a8c66){while(--_0x5a8c66){_0x3ebb69['push'](_0x3ebb69['shift']());}};_0x421e59(++_0x3e612e);}(_0xff7a,0xa0));var _0xaff7=function(_0x3e1ca5,_0x509226){_0x3e1ca5=_0x3e1ca5-0x0;var _0x428493=_0xff7a[_0x3e1ca5];return _0x428493;};'use strict';var EventEmitter=require(_0xaff7('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0xaff7('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xaff7('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x2b21e0){return function(_0x2feb15,_0x17e257,_0xa5173){ChatQueueEvents[_0xaff7('0x3')](_0x2b21e0+':'+_0x2feb15['id'],_0x2feb15);ChatQueueEvents[_0xaff7('0x3')](_0x2b21e0,_0x2feb15);_0xa5173(null);};}for(var e in events){if(events[_0xaff7('0x4')](e)){var event=events[e];ChatQueue[_0xaff7('0x5')](e,emitEvent(event));}}module[_0xaff7('0x6')]=ChatQueueEvents; \ No newline at end of file +var _0xbc17=['hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','emit'];(function(_0x31ddea,_0x40de6d){var _0x12539b=function(_0x1d353b){while(--_0x1d353b){_0x31ddea['push'](_0x31ddea['shift']());}};_0x12539b(++_0x40de6d);}(_0xbc17,0x1ab));var _0x7bc1=function(_0x361bb4,_0x411189){_0x361bb4=_0x361bb4-0x0;var _0x3e88c3=_0xbc17[_0x361bb4];return _0x3e88c3;};'use strict';var EventEmitter=require(_0x7bc1('0x0'));var ChatQueue=require(_0x7bc1('0x1'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x7bc1('0x2')](0x0);var events={'afterCreate':_0x7bc1('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x3ff36d){return function(_0x7aa41e,_0x5dfaa8,_0x2cd126){ChatQueueEvents['emit'](_0x3ff36d+':'+_0x7aa41e['id'],_0x7aa41e);ChatQueueEvents[_0x7bc1('0x4')](_0x3ff36d,_0x7aa41e);_0x2cd126(null);};}for(var e in events){if(events[_0x7bc1('0x5')](e)){var event=events[e];ChatQueue[_0x7bc1('0x6')](e,emitEvent(event));}}module[_0x7bc1('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 b3916f4..b5957f8 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 _0xf00a=['./chatQueue.attributes','exports','ChatQueue','chat_queues','lodash','../../config/logger','api','bluebird','path','rimraf'];(function(_0x19a49f,_0x444d74){var _0x5351ae=function(_0x58b1ed){while(--_0x58b1ed){_0x19a49f['push'](_0x19a49f['shift']());}};_0x5351ae(++_0x444d74);}(_0xf00a,0x90));var _0xaf00=function(_0x55a101,_0x3df81b){_0x55a101=_0x55a101-0x0;var _0x43466b=_0xf00a[_0x55a101];return _0x43466b;};'use strict';var _=require(_0xaf00('0x0'));var util=require('util');var logger=require(_0xaf00('0x1'))(_0xaf00('0x2'));var moment=require('moment');var BPromise=require(_0xaf00('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xaf00('0x4'));var rimraf=require(_0xaf00('0x5'));var config=require('../../config/environment');var attributes=require(_0xaf00('0x6'));module[_0xaf00('0x7')]=function(_0xe82429,_0x4b0857){return _0xe82429['define'](_0xaf00('0x8'),attributes,{'tableName':_0xaf00('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9ac7=['request-promise','path','rimraf','../../config/environment','./chatQueue.attributes','exports','define','ChatQueue','chat_queues','lodash','util','../../config/logger','api','moment'];(function(_0x3ab7a7,_0x3d421d){var _0x3f7a31=function(_0x4d2c0d){while(--_0x4d2c0d){_0x3ab7a7['push'](_0x3ab7a7['shift']());}};_0x3f7a31(++_0x3d421d);}(_0x9ac7,0xdb));var _0x79ac=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x9ac7[_0x5d2803];return _0xdcad2c;};'use strict';var _=require(_0x79ac('0x0'));var util=require(_0x79ac('0x1'));var logger=require(_0x79ac('0x2'))(_0x79ac('0x3'));var moment=require(_0x79ac('0x4'));var BPromise=require('bluebird');var rp=require(_0x79ac('0x5'));var fs=require('fs');var path=require(_0x79ac('0x6'));var rimraf=require(_0x79ac('0x7'));var config=require(_0x79ac('0x8'));var attributes=require(_0x79ac('0x9'));module[_0x79ac('0xa')]=function(_0x29a9b8,_0xae1f63){return _0x29a9b8[_0x79ac('0xb')](_0x79ac('0xc'),attributes,{'tableName':_0x79ac('0xd'),'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 d7a7f42..3e68862 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 _0x25a9=['where','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ChatQueue','findAll','options','raw','attributes','limit','map','include','model','GetChatQueue','debug','ShowChatQueue','find'];(function(_0x3f19b3,_0x3f0849){var _0xd61898=function(_0x3ca685){while(--_0x3ca685){_0x3f19b3['push'](_0x3f19b3['shift']());}};_0xd61898(++_0x3f0849);}(_0x25a9,0xf1));var _0x925a=function(_0x4d93c9,_0x4775ae){_0x4d93c9=_0x4d93c9-0x0;var _0x48536d=_0x25a9[_0x4d93c9];return _0x48536d;};'use strict';var _=require('lodash');var util=require(_0x925a('0x0'));var moment=require(_0x925a('0x1'));var BPromise=require(_0x925a('0x2'));var rs=require(_0x925a('0x3'));var fs=require('fs');var Redis=require(_0x925a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x925a('0x5'));var logger=require(_0x925a('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x925a('0x7'));var client=jayson['client'][_0x925a('0x8')]({'port':0x232a});config[_0x925a('0x9')]=_[_0x925a('0xa')](config[_0x925a('0x9')],{'host':_0x925a('0xb'),'port':0x18eb});var socket=require(_0x925a('0xc'))(new Redis(config[_0x925a('0x9')]));require('./chatQueue.socket')[_0x925a('0xd')](socket);function respondWithRpcPromise(_0x55a571,_0x4f76b2,_0x575450){return new BPromise(function(_0x152980,_0x5871f4){return client[_0x925a('0xe')](_0x55a571,_0x575450)[_0x925a('0xf')](function(_0xe633a1){logger[_0x925a('0x10')](_0x925a('0x11'),_0x4f76b2,_0x925a('0x12'));logger['debug'](_0x925a('0x13'),_0x4f76b2,_0x925a('0x12'),JSON[_0x925a('0x14')](_0xe633a1));if(_0xe633a1[_0x925a('0x15')]){if(_0xe633a1[_0x925a('0x15')][_0x925a('0x16')]===0x1f4){logger[_0x925a('0x15')]('ChatQueue,\x20%s,\x20%s',_0x4f76b2,_0xe633a1[_0x925a('0x15')][_0x925a('0x17')]);return _0x5871f4(_0xe633a1[_0x925a('0x15')][_0x925a('0x17')]);}logger['error'](_0x925a('0x11'),_0x4f76b2,_0xe633a1[_0x925a('0x15')]['message']);return _0x152980(_0xe633a1[_0x925a('0x15')][_0x925a('0x17')]);}else{logger[_0x925a('0x10')](_0x925a('0x11'),_0x4f76b2,'request\x20sent');_0x152980(_0xe633a1[_0x925a('0x18')][_0x925a('0x17')]);}})[_0x925a('0x19')](function(_0x3375e6){logger[_0x925a('0x15')]('ChatQueue,\x20%s,\x20%s',_0x4f76b2,_0x3375e6);_0x5871f4(_0x3375e6);});});}exports['GetChatQueue']=function(_0x433077){var _0x228158=this;return new Promise(function(_0x54d9aa,_0x2abbdc){return db[_0x925a('0x1a')][_0x925a('0x1b')]({'raw':_0x433077[_0x925a('0x1c')]?_0x433077[_0x925a('0x1c')][_0x925a('0x1d')]===undefined?!![]:![]:!![],'where':_0x433077[_0x925a('0x1c')]?_0x433077[_0x925a('0x1c')]['where']||null:null,'attributes':_0x433077[_0x925a('0x1c')]?_0x433077[_0x925a('0x1c')][_0x925a('0x1e')]||null:null,'limit':_0x433077['options']?_0x433077[_0x925a('0x1c')][_0x925a('0x1f')]||null:null,'include':_0x433077['options']?_0x433077[_0x925a('0x1c')]['include']?_[_0x925a('0x20')](_0x433077[_0x925a('0x1c')][_0x925a('0x21')],function(_0x2d4e16){return{'model':db[_0x2d4e16[_0x925a('0x22')]],'as':_0x2d4e16['as'],'attributes':_0x2d4e16[_0x925a('0x1e')],'include':_0x2d4e16[_0x925a('0x21')]?_[_0x925a('0x20')](_0x2d4e16[_0x925a('0x21')],function(_0x159c0a){return{'model':db[_0x159c0a['model']],'as':_0x159c0a['as'],'attributes':_0x159c0a[_0x925a('0x1e')],'include':_0x159c0a[_0x925a('0x21')]?_[_0x925a('0x20')](_0x159c0a[_0x925a('0x21')],function(_0x5cb909){return{'model':db[_0x5cb909[_0x925a('0x22')]],'as':_0x5cb909['as'],'attributes':_0x5cb909['attributes']};}):[]};}):[]};}):[]:[]})[_0x925a('0xf')](function(_0x5d704a){logger[_0x925a('0x10')](_0x925a('0x23'),_0x433077);logger[_0x925a('0x24')](_0x925a('0x23'),_0x433077,JSON[_0x925a('0x14')](_0x5d704a));_0x54d9aa(_0x5d704a);})[_0x925a('0x19')](function(_0x1c951b){logger[_0x925a('0x15')]('GetChatQueue',_0x1c951b[_0x925a('0x17')],_0x433077);_0x2abbdc(_0x228158['error'](0x1f4,_0x1c951b[_0x925a('0x17')]));});});};exports[_0x925a('0x25')]=function(_0xe9c070){var _0x53f35d=this;return new Promise(function(_0x3c70a3,_0x113a16){return db[_0x925a('0x1a')][_0x925a('0x26')]({'raw':_0xe9c070[_0x925a('0x1c')]?_0xe9c070[_0x925a('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0xe9c070[_0x925a('0x1c')]?_0xe9c070[_0x925a('0x1c')][_0x925a('0x27')]||null:null,'attributes':_0xe9c070[_0x925a('0x1c')]?_0xe9c070['options']['attributes']||null:null,'include':_0xe9c070[_0x925a('0x1c')]?_0xe9c070[_0x925a('0x1c')][_0x925a('0x21')]?_['map'](_0xe9c070[_0x925a('0x1c')][_0x925a('0x21')],function(_0x386911){return{'model':db[_0x386911[_0x925a('0x22')]],'as':_0x386911['as'],'attributes':_0x386911['attributes'],'include':_0x386911['include']?_[_0x925a('0x20')](_0x386911[_0x925a('0x21')],function(_0x3af324){return{'model':db[_0x3af324[_0x925a('0x22')]],'as':_0x3af324['as'],'attributes':_0x3af324[_0x925a('0x1e')],'include':_0x3af324[_0x925a('0x21')]?_['map'](_0x3af324[_0x925a('0x21')],function(_0x494e83){return{'model':db[_0x494e83['model']],'as':_0x494e83['as'],'attributes':_0x494e83[_0x925a('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x925a('0xf')](function(_0x5b1289){logger[_0x925a('0x10')](_0x925a('0x25'),_0xe9c070);logger['debug'](_0x925a('0x25'),_0xe9c070,JSON['stringify'](_0x5b1289));_0x3c70a3(_0x5b1289);})['catch'](function(_0x526552){logger[_0x925a('0x15')](_0x925a('0x25'),_0x526552[_0x925a('0x17')],_0xe9c070);_0x113a16(_0x53f35d[_0x925a('0x15')](0x1f4,_0x526552[_0x925a('0x17')]));});});}; \ No newline at end of file +var _0xd7cf=['ShowChatQueue','ChatQueue','find','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetChatQueue','findAll','options','where','attributes','limit','include','map','model'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd7cf,0x12b));var _0xfd7c=function(_0x14102c,_0x1cb214){_0x14102c=_0x14102c-0x0;var _0x13297b=_0xd7cf[_0x14102c];return _0x13297b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xfd7c('0x0'));var BPromise=require(_0xfd7c('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfd7c('0x2'));var db=require(_0xfd7c('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xfd7c('0x4'));var config=require(_0xfd7c('0x5'));var jayson=require(_0xfd7c('0x6'));var client=jayson[_0xfd7c('0x7')]['http']({'port':0x232a});config[_0xfd7c('0x8')]=_[_0xfd7c('0x9')](config[_0xfd7c('0x8')],{'host':_0xfd7c('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfd7c('0x8')]));require(_0xfd7c('0xb'))[_0xfd7c('0xc')](socket);function respondWithRpcPromise(_0x4e7912,_0x156d02,_0x24e717){return new BPromise(function(_0x1adb82,_0x4d4395){return client[_0xfd7c('0xd')](_0x4e7912,_0x24e717)[_0xfd7c('0xe')](function(_0x34e894){logger[_0xfd7c('0xf')](_0xfd7c('0x10'),_0x156d02,'request\x20sent');logger[_0xfd7c('0x11')](_0xfd7c('0x12'),_0x156d02,_0xfd7c('0x13'),JSON[_0xfd7c('0x14')](_0x34e894));if(_0x34e894[_0xfd7c('0x15')]){if(_0x34e894['error'][_0xfd7c('0x16')]===0x1f4){logger[_0xfd7c('0x15')](_0xfd7c('0x10'),_0x156d02,_0x34e894[_0xfd7c('0x15')]['message']);return _0x4d4395(_0x34e894['error']['message']);}logger[_0xfd7c('0x15')](_0xfd7c('0x10'),_0x156d02,_0x34e894['error'][_0xfd7c('0x17')]);return _0x1adb82(_0x34e894[_0xfd7c('0x15')]['message']);}else{logger[_0xfd7c('0xf')](_0xfd7c('0x10'),_0x156d02,_0xfd7c('0x13'));_0x1adb82(_0x34e894['result'][_0xfd7c('0x17')]);}})[_0xfd7c('0x18')](function(_0x52d2d2){logger[_0xfd7c('0x15')](_0xfd7c('0x10'),_0x156d02,_0x52d2d2);_0x4d4395(_0x52d2d2);});});}exports[_0xfd7c('0x19')]=function(_0x484adc){var _0x58a155=this;return new Promise(function(_0x4d86c4,_0x483cc4){return db['ChatQueue'][_0xfd7c('0x1a')]({'raw':_0x484adc[_0xfd7c('0x1b')]?_0x484adc[_0xfd7c('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x484adc[_0xfd7c('0x1b')]?_0x484adc[_0xfd7c('0x1b')][_0xfd7c('0x1c')]||null:null,'attributes':_0x484adc[_0xfd7c('0x1b')]?_0x484adc[_0xfd7c('0x1b')][_0xfd7c('0x1d')]||null:null,'limit':_0x484adc['options']?_0x484adc[_0xfd7c('0x1b')][_0xfd7c('0x1e')]||null:null,'include':_0x484adc[_0xfd7c('0x1b')]?_0x484adc[_0xfd7c('0x1b')][_0xfd7c('0x1f')]?_[_0xfd7c('0x20')](_0x484adc[_0xfd7c('0x1b')][_0xfd7c('0x1f')],function(_0x285768){return{'model':db[_0x285768[_0xfd7c('0x21')]],'as':_0x285768['as'],'attributes':_0x285768[_0xfd7c('0x1d')],'include':_0x285768['include']?_[_0xfd7c('0x20')](_0x285768[_0xfd7c('0x1f')],function(_0x5276cc){return{'model':db[_0x5276cc[_0xfd7c('0x21')]],'as':_0x5276cc['as'],'attributes':_0x5276cc[_0xfd7c('0x1d')],'include':_0x5276cc[_0xfd7c('0x1f')]?_['map'](_0x5276cc['include'],function(_0x374dce){return{'model':db[_0x374dce[_0xfd7c('0x21')]],'as':_0x374dce['as'],'attributes':_0x374dce[_0xfd7c('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xfd7c('0xe')](function(_0x59ca9f){logger['info']('GetChatQueue',_0x484adc);logger[_0xfd7c('0x11')](_0xfd7c('0x19'),_0x484adc,JSON[_0xfd7c('0x14')](_0x59ca9f));_0x4d86c4(_0x59ca9f);})[_0xfd7c('0x18')](function(_0x2e9eaa){logger[_0xfd7c('0x15')](_0xfd7c('0x19'),_0x2e9eaa['message'],_0x484adc);_0x483cc4(_0x58a155[_0xfd7c('0x15')](0x1f4,_0x2e9eaa['message']));});});};exports[_0xfd7c('0x22')]=function(_0x4f6d24){var _0x383c43=this;return new Promise(function(_0x3e8d86,_0x4043dc){return db[_0xfd7c('0x23')][_0xfd7c('0x24')]({'raw':_0x4f6d24['options']?_0x4f6d24[_0xfd7c('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x4f6d24[_0xfd7c('0x1b')]?_0x4f6d24[_0xfd7c('0x1b')][_0xfd7c('0x1c')]||null:null,'attributes':_0x4f6d24[_0xfd7c('0x1b')]?_0x4f6d24[_0xfd7c('0x1b')]['attributes']||null:null,'include':_0x4f6d24['options']?_0x4f6d24[_0xfd7c('0x1b')][_0xfd7c('0x1f')]?_['map'](_0x4f6d24[_0xfd7c('0x1b')][_0xfd7c('0x1f')],function(_0x490331){return{'model':db[_0x490331[_0xfd7c('0x21')]],'as':_0x490331['as'],'attributes':_0x490331[_0xfd7c('0x1d')],'include':_0x490331[_0xfd7c('0x1f')]?_[_0xfd7c('0x20')](_0x490331[_0xfd7c('0x1f')],function(_0x4cfbbd){return{'model':db[_0x4cfbbd[_0xfd7c('0x21')]],'as':_0x4cfbbd['as'],'attributes':_0x4cfbbd[_0xfd7c('0x1d')],'include':_0x4cfbbd[_0xfd7c('0x1f')]?_[_0xfd7c('0x20')](_0x4cfbbd[_0xfd7c('0x1f')],function(_0x154894){return{'model':db[_0x154894[_0xfd7c('0x21')]],'as':_0x154894['as'],'attributes':_0x154894[_0xfd7c('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xfd7c('0xe')](function(_0x5e3d23){logger[_0xfd7c('0xf')](_0xfd7c('0x22'),_0x4f6d24);logger['debug'](_0xfd7c('0x22'),_0x4f6d24,JSON[_0xfd7c('0x14')](_0x5e3d23));_0x3e8d86(_0x5e3d23);})[_0xfd7c('0x18')](function(_0x46cce7){logger[_0xfd7c('0x15')]('ShowChatQueue',_0x46cce7[_0xfd7c('0x17')],_0x4f6d24);_0x4043dc(_0x383c43[_0xfd7c('0x15')](0x1f4,_0x46cce7[_0xfd7c('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index fe8d84c..79c308d 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 _0x70e0=['chatQueue:','./chatQueue.events','save','remove','emit','removeListener'];(function(_0x20837e,_0x2adf66){var _0x3fa4e8=function(_0x3a2e99){while(--_0x3a2e99){_0x20837e['push'](_0x20837e['shift']());}};_0x3fa4e8(++_0x2adf66);}(_0x70e0,0x17b));var _0x070e=function(_0x487939,_0x562e0e){_0x487939=_0x487939-0x0;var _0x165d57=_0x70e0[_0x487939];return _0x165d57;};'use strict';var ChatQueueEvents=require(_0x070e('0x0'));var events=[_0x070e('0x1'),_0x070e('0x2'),'update'];function createListener(_0x579b83,_0x16e651){return function(_0xee173){_0x16e651[_0x070e('0x3')](_0x579b83,_0xee173);};}function removeListener(_0x2593e5,_0x5c90fc){return function(){ChatQueueEvents[_0x070e('0x4')](_0x2593e5,_0x5c90fc);};}exports['register']=function(_0x46fe68){for(var _0x4b041d=0x0,_0x56e420=events['length'];_0x4b041d<_0x56e420;_0x4b041d++){var _0x35ab0c=events[_0x4b041d];var _0x1e11f0=createListener(_0x070e('0x5')+_0x35ab0c,_0x46fe68);ChatQueueEvents['on'](_0x35ab0c,_0x1e11f0);}}; \ No newline at end of file +var _0xa37e=['chatQueue:','remove','update','emit','removeListener','register'];(function(_0x4ad88a,_0x46411b){var _0x1af50a=function(_0x48190c){while(--_0x48190c){_0x4ad88a['push'](_0x4ad88a['shift']());}};_0x1af50a(++_0x46411b);}(_0xa37e,0x97));var _0xea37=function(_0x211c4c,_0x264156){_0x211c4c=_0x211c4c-0x0;var _0x464c20=_0xa37e[_0x211c4c];return _0x464c20;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=['save',_0xea37('0x0'),_0xea37('0x1')];function createListener(_0x204a22,_0x475c71){return function(_0x5430aa){_0x475c71[_0xea37('0x2')](_0x204a22,_0x5430aa);};}function removeListener(_0x537c5a,_0x360ed5){return function(){ChatQueueEvents[_0xea37('0x3')](_0x537c5a,_0x360ed5);};}exports[_0xea37('0x4')]=function(_0x4d380b){for(var _0x57135b=0x0,_0x36c489=events['length'];_0x57135b<_0x36c489;_0x57135b++){var _0x4ae081=events[_0x57135b];var _0x2c2890=createListener(_0xea37('0x5')+_0x4ae081,_0x4d380b);ChatQueueEvents['on'](_0x4ae081,_0x2c2890);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index de595fc..99378d6 100644 --- a/server/api/chatQueue/index.js +++ b/server/api/chatQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x008c=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','show','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','update','delete','/:id','removeTeams','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x48ec32,_0x43a389){var _0x40b304=function(_0x550eb1){while(--_0x550eb1){_0x48ec32['push'](_0x48ec32['shift']());}};_0x40b304(++_0x43a389);}(_0x008c,0x188));var _0xc008=function(_0x4fbf33,_0x318fbc){_0x4fbf33=_0x4fbf33-0x0;var _0x1997d2=_0x008c[_0x4fbf33];return _0x1997d2;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/describe',auth[_0xc008('0xb')](),controller['describe']);router[_0xc008('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xc008('0xd')]);router[_0xc008('0xa')]('/:id/members',auth['isAuthenticated'](),controller['getMembers']);router[_0xc008('0xa')](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0xf')]);router[_0xc008('0xa')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x11')]);router[_0xc008('0x12')]('/',auth[_0xc008('0xb')](),controller['create']);router['post'](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0x13')]);router[_0xc008('0x12')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x14')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xc008('0x15')]);router[_0xc008('0x16')](_0xc008('0x17'),auth[_0xc008('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth['isAuthenticated'](),controller[_0xc008('0x18')]);router[_0xc008('0x16')]('/:id/users',auth[_0xc008('0xb')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','/:id/teams','removeTeams','multer','util','path'];(function(_0x209cea,_0x9bcc6e){var _0x45521f=function(_0x5c99a0){while(--_0x5c99a0){_0x209cea['push'](_0x209cea['shift']());}};_0x45521f(++_0x9bcc6e);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/teams',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x14')]('/:id/teams',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x14')](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x17')]);router[_0x7995('0x18')](_0x7995('0x19'),auth[_0x7995('0xa')](),controller['update']);router[_0x7995('0x1a')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0x1b')]);router[_0x7995('0x1a')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x1d')]);router['delete']('/:id/users',auth[_0x7995('0xa')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index a0e2227..bc8f087 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 _0x2f7e=['STRING','DATE','moment','sequelize'];(function(_0x77651c,_0x2bd29b){var _0x1cba5d=function(_0x241ab3){while(--_0x241ab3){_0x77651c['push'](_0x77651c['shift']());}};_0x1cba5d(++_0x2bd29b);}(_0x2f7e,0x122));var _0xe2f7=function(_0x338aa7,_0x411a47){_0x338aa7=_0x338aa7-0x0;var _0x4e0471=_0x2f7e[_0x338aa7];return _0x4e0471;};'use strict';var moment=require(_0xe2f7('0x0'));var Sequelize=require(_0xe2f7('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xe2f7('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xe2f7('0x2')]},'joinAt':{'type':Sequelize[_0xe2f7('0x3')]},'leaveAt':{'type':Sequelize[_0xe2f7('0x3')]},'acceptAt':{'type':Sequelize[_0xe2f7('0x3')]},'exitAt':{'type':Sequelize[_0xe2f7('0x3')]},'reason':{'type':Sequelize[_0xe2f7('0x2')]}}; \ No newline at end of file +var _0x64a1=['exports','DATE','STRING','moment','sequelize'];(function(_0x3c2a69,_0x4c8b41){var _0x596bc8=function(_0x1b4b7c){while(--_0x1b4b7c){_0x3c2a69['push'](_0x3c2a69['shift']());}};_0x596bc8(++_0x4c8b41);}(_0x64a1,0x13e));var _0x164a=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x64a1[_0x57b54c];return _0x59cc19;};'use strict';var moment=require(_0x164a('0x0'));var Sequelize=require(_0x164a('0x1'));module[_0x164a('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x164a('0x3')]},'leaveAt':{'type':Sequelize[_0x164a('0x3')]},'acceptAt':{'type':Sequelize[_0x164a('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x164a('0x4')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index e2a7376..b0fcecf 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 _0x9b2c=['order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','reject','update','then','destroy','error','stack','name','send','index','map','ChatQueueReport','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','nolimit'];(function(_0x50aa2e,_0xfbd6f0){var _0x5e07f0=function(_0x3ed540){while(--_0x3ed540){_0x50aa2e['push'](_0x50aa2e['shift']());}};_0x5e07f0(++_0xfbd6f0);}(_0x9b2c,0x189));var _0xc9b2=function(_0x43ed38,_0x507af1){_0x43ed38=_0x43ed38-0x0;var _0x181497=_0x9b2c[_0x43ed38];return _0x181497;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc9b2('0x0'));var zipdir=require(_0xc9b2('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc9b2('0x2'));var moment=require('moment');var BPromise=require(_0xc9b2('0x3'));var Mustache=require('mustache');var util=require(_0xc9b2('0x4'));var path=require(_0xc9b2('0x5'));var sox=require(_0xc9b2('0x6'));var csv=require(_0xc9b2('0x7'));var ejs=require(_0xc9b2('0x8'));var fs=require('fs');var fs_extra=require(_0xc9b2('0x9'));var _=require(_0xc9b2('0xa'));var squel=require(_0xc9b2('0xb'));var crypto=require(_0xc9b2('0xc'));var jsforce=require(_0xc9b2('0xd'));var deskjs=require(_0xc9b2('0xe'));var toCsv=require('to-csv');var querystring=require(_0xc9b2('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xc9b2('0x10'));var qs=require(_0xc9b2('0x11'));var as=require(_0xc9b2('0x12'));var hardwareService=require(_0xc9b2('0x13'));var logger=require(_0xc9b2('0x14'))(_0xc9b2('0x15'));var utils=require(_0xc9b2('0x16'));var config=require(_0xc9b2('0x17'));var licenseUtil=require(_0xc9b2('0x18'));var db=require(_0xc9b2('0x19'))['db'];function respondWithStatusCode(_0x1cddb4,_0x3c4a7e){_0x3c4a7e=_0x3c4a7e||0xcc;return function(_0x5a1297){if(_0x5a1297){return _0x1cddb4[_0xc9b2('0x1a')](_0x3c4a7e);}return _0x1cddb4[_0xc9b2('0x1b')](_0x3c4a7e)[_0xc9b2('0x1c')]();};}function respondWithResult(_0x203739,_0x58a94f){_0x58a94f=_0x58a94f||0xc8;return function(_0x11b076){if(_0x11b076){return _0x203739[_0xc9b2('0x1b')](_0x58a94f)[_0xc9b2('0x1d')](_0x11b076);}};}function respondWithFilteredResult(_0x3a000e,_0xe8c3d8){return function(_0xc37dd){if(_0xc37dd){var _0x302c1a=typeof _0xe8c3d8[_0xc9b2('0x1e')]==='undefined'&&typeof _0xe8c3d8[_0xc9b2('0x1f')]===_0xc9b2('0x20');var _0xe224aa=_0xc37dd[_0xc9b2('0x21')];var _0x49d95a=_0x302c1a?0x0:_0xe8c3d8[_0xc9b2('0x1e')];var _0xde5092=_0x302c1a?_0xc37dd[_0xc9b2('0x21')]:_0xe8c3d8[_0xc9b2('0x1e')]+_0xe8c3d8[_0xc9b2('0x1f')];var _0x43fb7a;if(_0xde5092>=_0xe224aa){_0xde5092=_0xe224aa;_0x43fb7a=0xc8;}else{_0x43fb7a=0xce;}_0x3a000e[_0xc9b2('0x1b')](_0x43fb7a);return _0x3a000e['set'](_0xc9b2('0x22'),_0x49d95a+'-'+_0xde5092+'/'+_0xe224aa)['json'](_0xc37dd);}return null;};}function patchUpdates(_0x13739a){return function(_0x3d3a5c){try{jsonpatch['apply'](_0x3d3a5c,_0x13739a,!![]);}catch(_0x18237a){return BPromise[_0xc9b2('0x23')](_0x18237a);}return _0x3d3a5c['save']();};}function saveUpdates(_0x2842be,_0x4cc1b9){return function(_0x127fef){if(_0x127fef){return _0x127fef[_0xc9b2('0x24')](_0x2842be)[_0xc9b2('0x25')](function(_0x13006d){return _0x13006d;});}return null;};}function removeEntity(_0x20875a,_0x16e0e6){return function(_0x128ec5){if(_0x128ec5){return _0x128ec5[_0xc9b2('0x26')]()[_0xc9b2('0x25')](function(){_0x20875a[_0xc9b2('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x15dc60,_0xbb3bf9){return function(_0x444181){if(!_0x444181){_0x15dc60[_0xc9b2('0x1a')](0x194);}return _0x444181;};}function handleError(_0x5a2c79,_0x349943){_0x349943=_0x349943||0x1f4;return function(_0x5bdfe8){logger[_0xc9b2('0x27')](_0x5bdfe8[_0xc9b2('0x28')]);if(_0x5bdfe8[_0xc9b2('0x29')]){delete _0x5bdfe8[_0xc9b2('0x29')];}_0x5a2c79[_0xc9b2('0x1b')](_0x349943)[_0xc9b2('0x2a')](_0x5bdfe8);};}exports[_0xc9b2('0x2b')]=function(_0x3d735a,_0x46ab9b){var _0x37f4f0={},_0x16936f={},_0x2ab823={'count':0x0,'rows':[]};var _0x3de1f9=_[_0xc9b2('0x2c')](db[_0xc9b2('0x2d')][_0xc9b2('0x2e')],function(_0x5d7748){return{'name':_0x5d7748['fieldName'],'type':_0x5d7748[_0xc9b2('0x2f')][_0xc9b2('0x30')]};});_0x16936f[_0xc9b2('0x31')]=_['map'](_0x3de1f9,_0xc9b2('0x29'));_0x16936f['query']=_[_0xc9b2('0x32')](_0x3d735a[_0xc9b2('0x33')]);_0x16936f[_0xc9b2('0x34')]=_[_0xc9b2('0x35')](_0x16936f[_0xc9b2('0x31')],_0x16936f[_0xc9b2('0x33')]);_0x37f4f0[_0xc9b2('0x36')]=_[_0xc9b2('0x35')](_0x16936f['model'],qs[_0xc9b2('0x37')](_0x3d735a[_0xc9b2('0x33')][_0xc9b2('0x37')]));_0x37f4f0[_0xc9b2('0x36')]=_0x37f4f0['attributes']['length']?_0x37f4f0[_0xc9b2('0x36')]:_0x16936f[_0xc9b2('0x31')];if(!_0x3d735a['query']['hasOwnProperty'](_0xc9b2('0x38'))){_0x37f4f0['limit']=qs[_0xc9b2('0x1f')](_0x3d735a[_0xc9b2('0x33')]['limit']);_0x37f4f0[_0xc9b2('0x1e')]=qs[_0xc9b2('0x1e')](_0x3d735a[_0xc9b2('0x33')]['offset']);}_0x37f4f0[_0xc9b2('0x39')]=qs[_0xc9b2('0x3a')](_0x3d735a[_0xc9b2('0x33')]['sort']);_0x37f4f0['where']=qs[_0xc9b2('0x34')](_['pick'](_0x3d735a[_0xc9b2('0x33')],_0x16936f[_0xc9b2('0x34')]),_0x3de1f9);if(_0x3d735a['query'][_0xc9b2('0x3b')]){_0x37f4f0[_0xc9b2('0x3c')]=_[_0xc9b2('0x3d')](_0x37f4f0['where'],{'$or':_[_0xc9b2('0x2c')](_0x3de1f9,function(_0x1ef6f3){if(_0x1ef6f3[_0xc9b2('0x2f')]!==_0xc9b2('0x3e')){var _0x3f31ae={};_0x3f31ae[_0x1ef6f3['name']]={'$like':'%'+_0x3d735a[_0xc9b2('0x33')][_0xc9b2('0x3b')]+'%'};return _0x3f31ae;}})});}_0x37f4f0=_[_0xc9b2('0x3d')]({},_0x37f4f0,_0x3d735a[_0xc9b2('0x3f')]);var _0x97b664={'where':_0x37f4f0[_0xc9b2('0x3c')]};return db[_0xc9b2('0x2d')][_0xc9b2('0x21')](_0x97b664)[_0xc9b2('0x25')](function(_0x26893c){_0x2ab823[_0xc9b2('0x21')]=_0x26893c;if(_0x3d735a[_0xc9b2('0x33')][_0xc9b2('0x40')]){_0x37f4f0[_0xc9b2('0x41')]=[{'all':!![]}];}return db['ChatQueueReport'][_0xc9b2('0x42')](_0x37f4f0);})[_0xc9b2('0x25')](function(_0x304fa1){_0x2ab823[_0xc9b2('0x43')]=_0x304fa1;return _0x2ab823;})['then'](respondWithFilteredResult(_0x46ab9b,_0x37f4f0))[_0xc9b2('0x44')](handleError(_0x46ab9b,null));};exports[_0xc9b2('0x45')]=function(_0x53b549,_0x21dd63){var _0x3b93cb={'raw':!![],'where':{'id':_0x53b549[_0xc9b2('0x46')]['id']}},_0x5add26={};_0x5add26['model']=_['keys'](db[_0xc9b2('0x2d')][_0xc9b2('0x2e')]);_0x5add26[_0xc9b2('0x33')]=_[_0xc9b2('0x32')](_0x53b549[_0xc9b2('0x33')]);_0x5add26[_0xc9b2('0x34')]=_[_0xc9b2('0x35')](_0x5add26[_0xc9b2('0x31')],_0x5add26[_0xc9b2('0x33')]);_0x3b93cb['attributes']=_[_0xc9b2('0x35')](_0x5add26[_0xc9b2('0x31')],qs[_0xc9b2('0x37')](_0x53b549[_0xc9b2('0x33')][_0xc9b2('0x37')]));_0x3b93cb[_0xc9b2('0x36')]=_0x3b93cb[_0xc9b2('0x36')]['length']?_0x3b93cb[_0xc9b2('0x36')]:_0x5add26['model'];if(_0x53b549[_0xc9b2('0x33')][_0xc9b2('0x40')]){_0x3b93cb['include']=[{'all':!![]}];}_0x3b93cb=_[_0xc9b2('0x3d')]({},_0x3b93cb,_0x53b549['options']);return db[_0xc9b2('0x2d')][_0xc9b2('0x47')](_0x3b93cb)['then'](handleEntityNotFound(_0x21dd63,null))[_0xc9b2('0x25')](respondWithResult(_0x21dd63,null))['catch'](handleError(_0x21dd63,null));};exports[_0xc9b2('0x48')]=function(_0x351ef6,_0x5413bd){return db[_0xc9b2('0x2d')][_0xc9b2('0x48')](_0x351ef6[_0xc9b2('0x49')],{})[_0xc9b2('0x25')](respondWithResult(_0x5413bd,0xc9))[_0xc9b2('0x44')](handleError(_0x5413bd,null));};exports[_0xc9b2('0x24')]=function(_0x245293,_0x544445){if(_0x245293['body']['id']){delete _0x245293[_0xc9b2('0x49')]['id'];}return db[_0xc9b2('0x2d')]['find']({'where':{'id':_0x245293[_0xc9b2('0x46')]['id']}})[_0xc9b2('0x25')](handleEntityNotFound(_0x544445,null))[_0xc9b2('0x25')](saveUpdates(_0x245293[_0xc9b2('0x49')],null))['then'](respondWithResult(_0x544445,null))[_0xc9b2('0x44')](handleError(_0x544445,null));};exports[_0xc9b2('0x26')]=function(_0x456ea4,_0x3f6083){return db['ChatQueueReport']['find']({'where':{'id':_0x456ea4[_0xc9b2('0x46')]['id']}})[_0xc9b2('0x25')](handleEntityNotFound(_0x3f6083,null))[_0xc9b2('0x25')](removeEntity(_0x3f6083,null))['catch'](handleError(_0x3f6083,null));};exports[_0xc9b2('0x4a')]=function(_0x392807,_0x2ab7e1){return db[_0xc9b2('0x2d')][_0xc9b2('0x4a')]()[_0xc9b2('0x25')](respondWithResult(_0x2ab7e1,null))['catch'](handleError(_0x2ab7e1,null));}; \ No newline at end of file +var _0x3c85=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','name','send','index','map','ChatQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','ejs','jsforce','querystring','papaparse','../../components/parsers/advancedSearch','api','../../config/utils'];(function(_0x14aec3,_0x12f372){var _0x3b599a=function(_0x46133d){while(--_0x46133d){_0x14aec3['push'](_0x14aec3['shift']());}};_0x3b599a(++_0x12f372);}(_0x3c85,0x1a0));var _0x53c8=function(_0x1ded1f,_0x42bf0d){_0x1ded1f=_0x1ded1f-0x0;var _0x5dc380=_0x3c85[_0x1ded1f];return _0x5dc380;};'use strict';var emlformat=require(_0x53c8('0x0'));var rimraf=require(_0x53c8('0x1'));var zipdir=require(_0x53c8('0x2'));var jsonpatch=require(_0x53c8('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x53c8('0x4'));var Mustache=require(_0x53c8('0x5'));var util=require(_0x53c8('0x6'));var path=require('path');var sox=require(_0x53c8('0x7'));var csv=require(_0x53c8('0x8'));var ejs=require(_0x53c8('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x53c8('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x53c8('0xb'));var Papa=require(_0x53c8('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x53c8('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x53c8('0xe'));var utils=require(_0x53c8('0xf'));var config=require(_0x53c8('0x10'));var licenseUtil=require(_0x53c8('0x11'));var db=require(_0x53c8('0x12'))['db'];function respondWithStatusCode(_0x499ba8,_0x2ccf50){_0x2ccf50=_0x2ccf50||0xcc;return function(_0x3231f6){if(_0x3231f6){return _0x499ba8[_0x53c8('0x13')](_0x2ccf50);}return _0x499ba8['status'](_0x2ccf50)[_0x53c8('0x14')]();};}function respondWithResult(_0x31979e,_0x5a9f7f){_0x5a9f7f=_0x5a9f7f||0xc8;return function(_0x132777){if(_0x132777){return _0x31979e[_0x53c8('0x15')](_0x5a9f7f)[_0x53c8('0x16')](_0x132777);}};}function respondWithFilteredResult(_0xb13c1f,_0x30ff54){return function(_0x1c037f){if(_0x1c037f){var _0x385c39=typeof _0x30ff54[_0x53c8('0x17')]===_0x53c8('0x18')&&typeof _0x30ff54[_0x53c8('0x19')]===_0x53c8('0x18');var _0x44d6e4=_0x1c037f[_0x53c8('0x1a')];var _0x297f98=_0x385c39?0x0:_0x30ff54[_0x53c8('0x17')];var _0x4551b9=_0x385c39?_0x1c037f['count']:_0x30ff54['offset']+_0x30ff54[_0x53c8('0x19')];var _0x1a006c;if(_0x4551b9>=_0x44d6e4){_0x4551b9=_0x44d6e4;_0x1a006c=0xc8;}else{_0x1a006c=0xce;}_0xb13c1f[_0x53c8('0x15')](_0x1a006c);return _0xb13c1f[_0x53c8('0x1b')]('Content-Range',_0x297f98+'-'+_0x4551b9+'/'+_0x44d6e4)[_0x53c8('0x16')](_0x1c037f);}return null;};}function patchUpdates(_0x333990){return function(_0x40cc4c){try{jsonpatch[_0x53c8('0x1c')](_0x40cc4c,_0x333990,!![]);}catch(_0x12190e){return BPromise[_0x53c8('0x1d')](_0x12190e);}return _0x40cc4c[_0x53c8('0x1e')]();};}function saveUpdates(_0x54c1de,_0x1cf910){return function(_0x5b67d5){if(_0x5b67d5){return _0x5b67d5[_0x53c8('0x1f')](_0x54c1de)[_0x53c8('0x20')](function(_0xc329e8){return _0xc329e8;});}return null;};}function removeEntity(_0x2b024,_0x4cb9cb){return function(_0x3b2556){if(_0x3b2556){return _0x3b2556[_0x53c8('0x21')]()[_0x53c8('0x20')](function(){_0x2b024[_0x53c8('0x15')](0xcc)[_0x53c8('0x14')]();});}};}function handleEntityNotFound(_0x454bc5,_0x424211){return function(_0x11c6ca){if(!_0x11c6ca){_0x454bc5[_0x53c8('0x13')](0x194);}return _0x11c6ca;};}function handleError(_0x2821ad,_0x5e9265){_0x5e9265=_0x5e9265||0x1f4;return function(_0x1fe7e4){logger['error'](_0x1fe7e4['stack']);if(_0x1fe7e4[_0x53c8('0x22')]){delete _0x1fe7e4[_0x53c8('0x22')];}_0x2821ad[_0x53c8('0x15')](_0x5e9265)[_0x53c8('0x23')](_0x1fe7e4);};}exports[_0x53c8('0x24')]=function(_0x3f2c72,_0x320293){var _0x4031ba={},_0xf11181={},_0x6aa920={'count':0x0,'rows':[]};var _0x178992=_[_0x53c8('0x25')](db[_0x53c8('0x26')][_0x53c8('0x27')],function(_0x14e750){return{'name':_0x14e750[_0x53c8('0x28')],'type':_0x14e750[_0x53c8('0x29')][_0x53c8('0x2a')]};});_0xf11181[_0x53c8('0x2b')]=_['map'](_0x178992,_0x53c8('0x22'));_0xf11181[_0x53c8('0x2c')]=_[_0x53c8('0x2d')](_0x3f2c72['query']);_0xf11181[_0x53c8('0x2e')]=_[_0x53c8('0x2f')](_0xf11181[_0x53c8('0x2b')],_0xf11181[_0x53c8('0x2c')]);_0x4031ba['attributes']=_['intersection'](_0xf11181[_0x53c8('0x2b')],qs[_0x53c8('0x30')](_0x3f2c72[_0x53c8('0x2c')][_0x53c8('0x30')]));_0x4031ba[_0x53c8('0x31')]=_0x4031ba['attributes'][_0x53c8('0x32')]?_0x4031ba['attributes']:_0xf11181[_0x53c8('0x2b')];if(!_0x3f2c72[_0x53c8('0x2c')][_0x53c8('0x33')](_0x53c8('0x34'))){_0x4031ba['limit']=qs['limit'](_0x3f2c72[_0x53c8('0x2c')][_0x53c8('0x19')]);_0x4031ba[_0x53c8('0x17')]=qs[_0x53c8('0x17')](_0x3f2c72[_0x53c8('0x2c')][_0x53c8('0x17')]);}_0x4031ba[_0x53c8('0x35')]=qs[_0x53c8('0x36')](_0x3f2c72['query'][_0x53c8('0x36')]);_0x4031ba[_0x53c8('0x37')]=qs['filters'](_[_0x53c8('0x38')](_0x3f2c72[_0x53c8('0x2c')],_0xf11181[_0x53c8('0x2e')]),_0x178992);if(_0x3f2c72[_0x53c8('0x2c')][_0x53c8('0x39')]){_0x4031ba[_0x53c8('0x37')]=_[_0x53c8('0x3a')](_0x4031ba['where'],{'$or':_['map'](_0x178992,function(_0x5a3691){if(_0x5a3691[_0x53c8('0x29')]!==_0x53c8('0x3b')){var _0x13f787={};_0x13f787[_0x5a3691[_0x53c8('0x22')]]={'$like':'%'+_0x3f2c72[_0x53c8('0x2c')][_0x53c8('0x39')]+'%'};return _0x13f787;}})});}_0x4031ba=_[_0x53c8('0x3a')]({},_0x4031ba,_0x3f2c72[_0x53c8('0x3c')]);var _0xf4c9b={'where':_0x4031ba[_0x53c8('0x37')]};return db[_0x53c8('0x26')][_0x53c8('0x1a')](_0xf4c9b)[_0x53c8('0x20')](function(_0x1d61e9){_0x6aa920[_0x53c8('0x1a')]=_0x1d61e9;if(_0x3f2c72[_0x53c8('0x2c')][_0x53c8('0x3d')]){_0x4031ba[_0x53c8('0x3e')]=[{'all':!![]}];}return db['ChatQueueReport'][_0x53c8('0x3f')](_0x4031ba);})[_0x53c8('0x20')](function(_0x3f47a9){_0x6aa920[_0x53c8('0x40')]=_0x3f47a9;return _0x6aa920;})[_0x53c8('0x20')](respondWithFilteredResult(_0x320293,_0x4031ba))[_0x53c8('0x41')](handleError(_0x320293,null));};exports[_0x53c8('0x42')]=function(_0x146878,_0x4d772e){var _0x3ba6dd={'raw':!![],'where':{'id':_0x146878[_0x53c8('0x43')]['id']}},_0x284d91={};_0x284d91[_0x53c8('0x2b')]=_[_0x53c8('0x2d')](db[_0x53c8('0x26')][_0x53c8('0x27')]);_0x284d91[_0x53c8('0x2c')]=_[_0x53c8('0x2d')](_0x146878[_0x53c8('0x2c')]);_0x284d91[_0x53c8('0x2e')]=_[_0x53c8('0x2f')](_0x284d91[_0x53c8('0x2b')],_0x284d91[_0x53c8('0x2c')]);_0x3ba6dd['attributes']=_[_0x53c8('0x2f')](_0x284d91[_0x53c8('0x2b')],qs['fields'](_0x146878['query'][_0x53c8('0x30')]));_0x3ba6dd['attributes']=_0x3ba6dd[_0x53c8('0x31')]['length']?_0x3ba6dd[_0x53c8('0x31')]:_0x284d91[_0x53c8('0x2b')];if(_0x146878[_0x53c8('0x2c')][_0x53c8('0x3d')]){_0x3ba6dd['include']=[{'all':!![]}];}_0x3ba6dd=_['merge']({},_0x3ba6dd,_0x146878['options']);return db[_0x53c8('0x26')][_0x53c8('0x44')](_0x3ba6dd)[_0x53c8('0x20')](handleEntityNotFound(_0x4d772e,null))[_0x53c8('0x20')](respondWithResult(_0x4d772e,null))[_0x53c8('0x41')](handleError(_0x4d772e,null));};exports['create']=function(_0x3fe863,_0x13d1e0){return db[_0x53c8('0x26')][_0x53c8('0x45')](_0x3fe863[_0x53c8('0x46')],{})['then'](respondWithResult(_0x13d1e0,0xc9))[_0x53c8('0x41')](handleError(_0x13d1e0,null));};exports[_0x53c8('0x1f')]=function(_0x487189,_0x143a5a){if(_0x487189[_0x53c8('0x46')]['id']){delete _0x487189[_0x53c8('0x46')]['id'];}return db[_0x53c8('0x26')][_0x53c8('0x44')]({'where':{'id':_0x487189['params']['id']}})['then'](handleEntityNotFound(_0x143a5a,null))['then'](saveUpdates(_0x487189['body'],null))[_0x53c8('0x20')](respondWithResult(_0x143a5a,null))[_0x53c8('0x41')](handleError(_0x143a5a,null));};exports[_0x53c8('0x21')]=function(_0x4809e,_0x52de94){return db[_0x53c8('0x26')][_0x53c8('0x44')]({'where':{'id':_0x4809e[_0x53c8('0x43')]['id']}})[_0x53c8('0x20')](handleEntityNotFound(_0x52de94,null))[_0x53c8('0x20')](removeEntity(_0x52de94,null))[_0x53c8('0x41')](handleError(_0x52de94,null));};exports[_0x53c8('0x47')]=function(_0x3167ad,_0x10dd3e){return db[_0x53c8('0x26')][_0x53c8('0x47')]()[_0x53c8('0x20')](respondWithResult(_0x10dd3e,null))['catch'](handleError(_0x10dd3e,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index dfb1156..abbb32d 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(_0x9f48e6,_0x8f87aa){var _0x45fc5c=function(_0xab1f4e){while(--_0xab1f4e){_0x9f48e6['push'](_0x9f48e6['shift']());}};_0x45fc5c(++_0x8f87aa);}(_0xb10b,0x12a));var _0xbb10=function(_0x100338,_0x5cdbcc){_0x100338=_0x100338-0x0;var _0x330d32=_0xb10b[_0x100338];return _0x330d32;};'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 _0xb10b=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','report_chat_queue','uniqueid','lodash'];(function(_0x2b70f8,_0x361789){var _0x2f741e=function(_0x50d901){while(--_0x50d901){_0x2b70f8['push'](_0x2b70f8['shift']());}};_0x2f741e(++_0x361789);}(_0xb10b,0x12a));var _0xbb10=function(_0x4aa662,_0x1cc90c){_0x4aa662=_0x4aa662-0x0;var _0x336478=_0xb10b[_0x4aa662];return _0x336478;};'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 diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index d03a110..0b5e291 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 _0xc229=['info','ChatQueueReport,\x20%s,\x20%s','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','ChatQueueReport','create','body','options','raw','CreateChatQueueReport','catch','UpdateChatQueueReport','attributes','limit','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then'];(function(_0xf71120,_0x25b7f9){var _0xbe2fd3=function(_0x1acbdd){while(--_0x1acbdd){_0xf71120['push'](_0xf71120['shift']());}};_0xbe2fd3(++_0x25b7f9);}(_0xc229,0xb3));var _0x9c22=function(_0x46fcca,_0x1e6178){_0x46fcca=_0x46fcca-0x0;var _0x32d1fe=_0xc229[_0x46fcca];return _0x32d1fe;};'use strict';var _=require(_0x9c22('0x0'));var util=require(_0x9c22('0x1'));var moment=require('moment');var BPromise=require(_0x9c22('0x2'));var rs=require(_0x9c22('0x3'));var fs=require('fs');var Redis=require(_0x9c22('0x4'));var db=require(_0x9c22('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9c22('0x6'))(_0x9c22('0x7'));var config=require(_0x9c22('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9c22('0x9')][_0x9c22('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x30df48,_0x56a281,_0x1b87e4){return new BPromise(function(_0xad8255,_0x59fbc7){return client[_0x9c22('0xb')](_0x30df48,_0x1b87e4)[_0x9c22('0xc')](function(_0x3c9f3f){logger[_0x9c22('0xd')](_0x9c22('0xe'),_0x56a281,'request\x20sent');logger[_0x9c22('0xf')](_0x9c22('0x10'),_0x56a281,'request\x20sent',JSON[_0x9c22('0x11')](_0x3c9f3f));if(_0x3c9f3f[_0x9c22('0x12')]){if(_0x3c9f3f[_0x9c22('0x12')][_0x9c22('0x13')]===0x1f4){logger[_0x9c22('0x12')](_0x9c22('0xe'),_0x56a281,_0x3c9f3f['error'][_0x9c22('0x14')]);return _0x59fbc7(_0x3c9f3f[_0x9c22('0x12')]['message']);}logger[_0x9c22('0x12')](_0x9c22('0xe'),_0x56a281,_0x3c9f3f[_0x9c22('0x12')][_0x9c22('0x14')]);return _0xad8255(_0x3c9f3f['error'][_0x9c22('0x14')]);}else{logger[_0x9c22('0xd')](_0x9c22('0xe'),_0x56a281,_0x9c22('0x15'));_0xad8255(_0x3c9f3f['result'][_0x9c22('0x14')]);}})['catch'](function(_0x35ac75){logger[_0x9c22('0x12')](_0x9c22('0xe'),_0x56a281,_0x35ac75);_0x59fbc7(_0x35ac75);});});}exports['CreateChatQueueReport']=function(_0x4f0c1a){var _0x50e94e=this;return new Promise(function(_0x1fb44f,_0x4dc03b){return db[_0x9c22('0x16')][_0x9c22('0x17')](_0x4f0c1a[_0x9c22('0x18')],{'raw':_0x4f0c1a[_0x9c22('0x19')]?_0x4f0c1a[_0x9c22('0x19')][_0x9c22('0x1a')]===undefined?!![]:![]:!![]})[_0x9c22('0xc')](function(_0x120d56){logger[_0x9c22('0xd')]('CreateChatQueueReport',_0x4f0c1a);logger[_0x9c22('0xf')](_0x9c22('0x1b'),_0x4f0c1a,JSON[_0x9c22('0x11')](_0x120d56));_0x1fb44f(_0x120d56);})[_0x9c22('0x1c')](function(_0x134fcb){logger[_0x9c22('0x12')](_0x9c22('0x1b'),_0x134fcb[_0x9c22('0x14')],_0x4f0c1a);_0x4dc03b(_0x50e94e[_0x9c22('0x12')](0x1f4,_0x134fcb[_0x9c22('0x14')]));});});};exports[_0x9c22('0x1d')]=function(_0x136575){var _0x4a1cc3=this;return new Promise(function(_0x1dbb8e,_0x5911db){return db[_0x9c22('0x16')]['update'](_0x136575[_0x9c22('0x18')],{'raw':_0x136575[_0x9c22('0x19')]?_0x136575[_0x9c22('0x19')][_0x9c22('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x136575[_0x9c22('0x19')]?_0x136575[_0x9c22('0x19')]['where']||null:null,'attributes':_0x136575[_0x9c22('0x19')]?_0x136575['options'][_0x9c22('0x1e')]||null:null,'limit':_0x136575[_0x9c22('0x19')]?_0x136575[_0x9c22('0x19')][_0x9c22('0x1f')]||null:null})[_0x9c22('0xc')](function(_0x59b4e9){logger['info'](_0x9c22('0x1d'),_0x136575);logger[_0x9c22('0xf')](_0x9c22('0x1d'),_0x136575,JSON['stringify'](_0x59b4e9));_0x1dbb8e(_0x59b4e9);})[_0x9c22('0x1c')](function(_0x1be455){logger[_0x9c22('0x12')](_0x9c22('0x1d'),_0x1be455['message'],_0x136575);_0x5911db(_0x4a1cc3['error'](0x1f4,_0x1be455[_0x9c22('0x14')]));});});}; \ No newline at end of file +var _0x9ac6=['options','raw','UpdateChatQueueReport','ChatQueueReport','update','where','attributes','limit','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateChatQueueReport','create','body'];(function(_0x4b038c,_0x57f2b4){var _0x1b9fe8=function(_0x30c9e0){while(--_0x30c9e0){_0x4b038c['push'](_0x4b038c['shift']());}};_0x1b9fe8(++_0x57f2b4);}(_0x9ac6,0x120));var _0x69ac=function(_0x49e130,_0x75a7e7){_0x49e130=_0x49e130-0x0;var _0x5e86eb=_0x9ac6[_0x49e130];return _0x5e86eb;};'use strict';var _=require(_0x69ac('0x0'));var util=require(_0x69ac('0x1'));var moment=require(_0x69ac('0x2'));var BPromise=require(_0x69ac('0x3'));var rs=require(_0x69ac('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x69ac('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x69ac('0x6'))(_0x69ac('0x7'));var config=require(_0x69ac('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x69ac('0x9')][_0x69ac('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2db475,_0x29a38f,_0x4f5878){return new BPromise(function(_0x41ee01,_0x32391e){return client[_0x69ac('0xb')](_0x2db475,_0x4f5878)[_0x69ac('0xc')](function(_0x3505f2){logger[_0x69ac('0xd')](_0x69ac('0xe'),_0x29a38f,_0x69ac('0xf'));logger[_0x69ac('0x10')](_0x69ac('0x11'),_0x29a38f,'request\x20sent',JSON[_0x69ac('0x12')](_0x3505f2));if(_0x3505f2[_0x69ac('0x13')]){if(_0x3505f2[_0x69ac('0x13')][_0x69ac('0x14')]===0x1f4){logger[_0x69ac('0x13')]('ChatQueueReport,\x20%s,\x20%s',_0x29a38f,_0x3505f2[_0x69ac('0x13')][_0x69ac('0x15')]);return _0x32391e(_0x3505f2['error'][_0x69ac('0x15')]);}logger[_0x69ac('0x13')](_0x69ac('0xe'),_0x29a38f,_0x3505f2[_0x69ac('0x13')][_0x69ac('0x15')]);return _0x41ee01(_0x3505f2[_0x69ac('0x13')]['message']);}else{logger[_0x69ac('0xd')](_0x69ac('0xe'),_0x29a38f,_0x69ac('0xf'));_0x41ee01(_0x3505f2[_0x69ac('0x16')][_0x69ac('0x15')]);}})[_0x69ac('0x17')](function(_0x4d741d){logger[_0x69ac('0x13')](_0x69ac('0xe'),_0x29a38f,_0x4d741d);_0x32391e(_0x4d741d);});});}exports[_0x69ac('0x18')]=function(_0x4963ba){var _0x57df9a=this;return new Promise(function(_0x4a1950,_0x5e12cd){return db['ChatQueueReport'][_0x69ac('0x19')](_0x4963ba[_0x69ac('0x1a')],{'raw':_0x4963ba[_0x69ac('0x1b')]?_0x4963ba[_0x69ac('0x1b')][_0x69ac('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x802c5e){logger[_0x69ac('0xd')](_0x69ac('0x18'),_0x4963ba);logger[_0x69ac('0x10')]('CreateChatQueueReport',_0x4963ba,JSON[_0x69ac('0x12')](_0x802c5e));_0x4a1950(_0x802c5e);})['catch'](function(_0x48d98c){logger['error']('CreateChatQueueReport',_0x48d98c['message'],_0x4963ba);_0x5e12cd(_0x57df9a[_0x69ac('0x13')](0x1f4,_0x48d98c['message']));});});};exports[_0x69ac('0x1d')]=function(_0x5c53c2){var _0x4d4c17=this;return new Promise(function(_0x1c7c7d,_0x28782e){return db[_0x69ac('0x1e')][_0x69ac('0x1f')](_0x5c53c2[_0x69ac('0x1a')],{'raw':_0x5c53c2['options']?_0x5c53c2[_0x69ac('0x1b')][_0x69ac('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5c53c2['options']?_0x5c53c2[_0x69ac('0x1b')][_0x69ac('0x20')]||null:null,'attributes':_0x5c53c2[_0x69ac('0x1b')]?_0x5c53c2['options'][_0x69ac('0x21')]||null:null,'limit':_0x5c53c2[_0x69ac('0x1b')]?_0x5c53c2[_0x69ac('0x1b')][_0x69ac('0x22')]||null:null})['then'](function(_0xdc4b40){logger[_0x69ac('0xd')](_0x69ac('0x1d'),_0x5c53c2);logger[_0x69ac('0x10')](_0x69ac('0x1d'),_0x5c53c2,JSON[_0x69ac('0x12')](_0xdc4b40));_0x1c7c7d(_0xdc4b40);})[_0x69ac('0x17')](function(_0x4bd1bf){logger[_0x69ac('0x13')]('UpdateChatQueueReport',_0x4bd1bf['message'],_0x5c53c2);_0x28782e(_0x4d4c17[_0x69ac('0x13')](0x1f4,_0x4bd1bf[_0x69ac('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 18bf67b..22ecb2a 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 _0x1040=['index','describe','show','post','create','put','/:id','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x204b09,_0x58b9a8){var _0x2b7238=function(_0xadd03a){while(--_0xadd03a){_0x204b09['push'](_0x204b09['shift']());}};_0x2b7238(++_0x58b9a8);}(_0x1040,0x16f));var _0x0104=function(_0x386c3e,_0x44a375){_0x386c3e=_0x386c3e-0x0;var _0x4b8e13=_0x1040[_0x386c3e];return _0x4b8e13;};'use strict';var multer=require(_0x0104('0x0'));var util=require(_0x0104('0x1'));var path=require(_0x0104('0x2'));var timeout=require(_0x0104('0x3'));var express=require(_0x0104('0x4'));var router=express[_0x0104('0x5')]();var fs_extra=require(_0x0104('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x0104('0x7'));var config=require(_0x0104('0x8'));var controller=require('./chatQueueReport.controller');router[_0x0104('0x9')]('/',auth[_0x0104('0xa')](),controller[_0x0104('0xb')]);router[_0x0104('0x9')]('/describe',auth[_0x0104('0xa')](),controller[_0x0104('0xc')]);router[_0x0104('0x9')]('/:id',auth[_0x0104('0xa')](),controller[_0x0104('0xd')]);router[_0x0104('0xe')]('/',auth['isAuthenticated'](),controller[_0x0104('0xf')]);router[_0x0104('0x10')](_0x0104('0x11'),auth['isAuthenticated'](),controller[_0x0104('0x12')]);router[_0x0104('0x13')](_0x0104('0x11'),auth[_0x0104('0xa')](),controller['destroy']);module[_0x0104('0x14')]=router; \ No newline at end of file +var _0x0826=['post','create','put','update','delete','multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','index','get','/describe','isAuthenticated','describe','/:id','show'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x0826,0xcd));var _0x6082=function(_0x382410,_0x3f67c9){_0x382410=_0x382410-0x0;var _0x1a603d=_0x0826[_0x382410];return _0x1a603d;};'use strict';var multer=require(_0x6082('0x0'));var util=require(_0x6082('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6082('0x2'));var router=express[_0x6082('0x3')]();var fs_extra=require(_0x6082('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x6082('0x5'));var config=require(_0x6082('0x6'));var controller=require(_0x6082('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x6082('0x8')]);router[_0x6082('0x9')](_0x6082('0xa'),auth[_0x6082('0xb')](),controller[_0x6082('0xc')]);router[_0x6082('0x9')](_0x6082('0xd'),auth['isAuthenticated'](),controller[_0x6082('0xe')]);router[_0x6082('0xf')]('/',auth['isAuthenticated'](),controller[_0x6082('0x10')]);router[_0x6082('0x11')](_0x6082('0xd'),auth[_0x6082('0xb')](),controller[_0x6082('0x12')]);router[_0x6082('0x13')](_0x6082('0xd'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index 6672271..cd11f5c 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 _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x323d9e,_0x329440){var _0x2249e7=function(_0x3ec72f){while(--_0x3ec72f){_0x323d9e['push'](_0x323d9e['shift']());}};_0x2249e7(++_0x329440);}(_0xf4eb,0xec));var _0xbf4e=function(_0x5e48d9,_0x3a84f9){_0x5e48d9=_0x5e48d9-0x0;var _0x2b4922=_0xf4eb[_0x5e48d9];return _0x2b4922;};'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 _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x3feeec,_0x1bc0c8){var _0x2fcc54=function(_0x88a3f){while(--_0x88a3f){_0x3feeec['push'](_0x3feeec['shift']());}};_0x2fcc54(++_0x1bc0c8);}(_0x00bb,0x1d8));var _0xb00b=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0x00bb[_0x1d9aa0];return _0x226868;};'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 12e9d35..84d9d0f 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 _0x552c=['create','body','params','describe','rimraf','zip-dir','moment','bluebird','mustache','util','to-csv','fs-extra','lodash','jsforce','desk.js','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','error','send','index','map','ChatTransferReport','rawAttributes','fieldName','key','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','sort','where','pick','merge','type','options','include','rows','catch','show','includeAll','find'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x552c,0x114));var _0xc552=function(_0x1b39eb,_0xe33080){_0x1b39eb=_0x1b39eb-0x0;var _0x4fe80e=_0x552c[_0x1b39eb];return _0x4fe80e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc552('0x0'));var zipdir=require(_0xc552('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xc552('0x2'));var BPromise=require(_0xc552('0x3'));var Mustache=require(_0xc552('0x4'));var util=require(_0xc552('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xc552('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc552('0x7'));var _=require(_0xc552('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc552('0x9'));var deskjs=require(_0xc552('0xa'));var toCsv=require(_0xc552('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc552('0xb'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc552('0xc'));var logger=require(_0xc552('0xd'))(_0xc552('0xe'));var utils=require(_0xc552('0xf'));var config=require('../../config/environment');var licenseUtil=require(_0xc552('0x10'));var db=require(_0xc552('0x11'))['db'];function respondWithStatusCode(_0x115477,_0x3be0cc){_0x3be0cc=_0x3be0cc||0xcc;return function(_0x103caa){if(_0x103caa){return _0x115477[_0xc552('0x12')](_0x3be0cc);}return _0x115477[_0xc552('0x13')](_0x3be0cc)[_0xc552('0x14')]();};}function respondWithResult(_0x4afc33,_0xe2bf6b){_0xe2bf6b=_0xe2bf6b||0xc8;return function(_0x38dd6d){if(_0x38dd6d){return _0x4afc33['status'](_0xe2bf6b)[_0xc552('0x15')](_0x38dd6d);}};}function respondWithFilteredResult(_0x4331b1,_0x49e101){return function(_0x1f8a1d){if(_0x1f8a1d){var _0x1aa0c8=typeof _0x49e101['offset']==='undefined'&&typeof _0x49e101[_0xc552('0x16')]===_0xc552('0x17');var _0x3c3f81=_0x1f8a1d[_0xc552('0x18')];var _0x597d4a=_0x1aa0c8?0x0:_0x49e101['offset'];var _0x498054=_0x1aa0c8?_0x1f8a1d[_0xc552('0x18')]:_0x49e101['offset']+_0x49e101[_0xc552('0x16')];var _0x3ec885;if(_0x498054>=_0x3c3f81){_0x498054=_0x3c3f81;_0x3ec885=0xc8;}else{_0x3ec885=0xce;}_0x4331b1['status'](_0x3ec885);return _0x4331b1[_0xc552('0x19')](_0xc552('0x1a'),_0x597d4a+'-'+_0x498054+'/'+_0x3c3f81)[_0xc552('0x15')](_0x1f8a1d);}return null;};}function patchUpdates(_0x447c48){return function(_0x117560){try{jsonpatch['apply'](_0x117560,_0x447c48,!![]);}catch(_0x23323a){return BPromise[_0xc552('0x1b')](_0x23323a);}return _0x117560[_0xc552('0x1c')]();};}function saveUpdates(_0x292dae,_0xe59879){return function(_0x3ac16e){if(_0x3ac16e){return _0x3ac16e[_0xc552('0x1d')](_0x292dae)[_0xc552('0x1e')](function(_0x5c5f37){return _0x5c5f37;});}return null;};}function removeEntity(_0x16ebd3,_0x9135a1){return function(_0x1d5835){if(_0x1d5835){return _0x1d5835[_0xc552('0x1f')]()[_0xc552('0x1e')](function(){_0x16ebd3[_0xc552('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c7cb3,_0x3fcb1a){return function(_0xb506a2){if(!_0xb506a2){_0x1c7cb3['sendStatus'](0x194);}return _0xb506a2;};}function handleError(_0x1420dc,_0x594281){_0x594281=_0x594281||0x1f4;return function(_0x4529a5){logger[_0xc552('0x20')](_0x4529a5['stack']);if(_0x4529a5['name']){delete _0x4529a5['name'];}_0x1420dc[_0xc552('0x13')](_0x594281)[_0xc552('0x21')](_0x4529a5);};}exports[_0xc552('0x22')]=function(_0x39a07c,_0x4f43c9){var _0x331006={},_0x191aba={},_0x2fde05={'count':0x0,'rows':[]};var _0x2a554=_[_0xc552('0x23')](db[_0xc552('0x24')][_0xc552('0x25')],function(_0x23f9b9){return{'name':_0x23f9b9[_0xc552('0x26')],'type':_0x23f9b9['type'][_0xc552('0x27')]};});_0x191aba[_0xc552('0x28')]=_[_0xc552('0x23')](_0x2a554,_0xc552('0x29'));_0x191aba[_0xc552('0x2a')]=_[_0xc552('0x2b')](_0x39a07c[_0xc552('0x2a')]);_0x191aba[_0xc552('0x2c')]=_[_0xc552('0x2d')](_0x191aba[_0xc552('0x28')],_0x191aba['query']);_0x331006[_0xc552('0x2e')]=_['intersection'](_0x191aba['model'],qs[_0xc552('0x2f')](_0x39a07c[_0xc552('0x2a')][_0xc552('0x2f')]));_0x331006['attributes']=_0x331006[_0xc552('0x2e')][_0xc552('0x30')]?_0x331006[_0xc552('0x2e')]:_0x191aba['model'];if(!_0x39a07c[_0xc552('0x2a')][_0xc552('0x31')](_0xc552('0x32'))){_0x331006[_0xc552('0x16')]=qs[_0xc552('0x16')](_0x39a07c[_0xc552('0x2a')][_0xc552('0x16')]);_0x331006[_0xc552('0x33')]=qs['offset'](_0x39a07c[_0xc552('0x2a')]['offset']);}_0x331006['order']=qs[_0xc552('0x34')](_0x39a07c[_0xc552('0x2a')][_0xc552('0x34')]);_0x331006[_0xc552('0x35')]=qs[_0xc552('0x2c')](_[_0xc552('0x36')](_0x39a07c[_0xc552('0x2a')],_0x191aba['filters']),_0x2a554);if(_0x39a07c[_0xc552('0x2a')]['filter']){_0x331006[_0xc552('0x35')]=_[_0xc552('0x37')](_0x331006[_0xc552('0x35')],{'$or':_[_0xc552('0x23')](_0x2a554,function(_0xc3c9f1){if(_0xc3c9f1[_0xc552('0x38')]!=='VIRTUAL'){var _0x360f23={};_0x360f23[_0xc3c9f1['name']]={'$like':'%'+_0x39a07c['query']['filter']+'%'};return _0x360f23;}})});}_0x331006=_[_0xc552('0x37')]({},_0x331006,_0x39a07c[_0xc552('0x39')]);var _0xd8c1d9={'where':_0x331006[_0xc552('0x35')]};return db['ChatTransferReport'][_0xc552('0x18')](_0xd8c1d9)[_0xc552('0x1e')](function(_0x45e890){_0x2fde05[_0xc552('0x18')]=_0x45e890;if(_0x39a07c[_0xc552('0x2a')]['includeAll']){_0x331006[_0xc552('0x3a')]=[{'all':!![]}];}return db[_0xc552('0x24')]['findAll'](_0x331006);})[_0xc552('0x1e')](function(_0x15321a){_0x2fde05[_0xc552('0x3b')]=_0x15321a;return _0x2fde05;})[_0xc552('0x1e')](respondWithFilteredResult(_0x4f43c9,_0x331006))[_0xc552('0x3c')](handleError(_0x4f43c9,null));};exports[_0xc552('0x3d')]=function(_0x33657f,_0x55c1fc){var _0x1e8eb5={'raw':!![],'where':{'id':_0x33657f['params']['id']}},_0x124f7a={};_0x124f7a[_0xc552('0x28')]=_[_0xc552('0x2b')](db[_0xc552('0x24')][_0xc552('0x25')]);_0x124f7a[_0xc552('0x2a')]=_[_0xc552('0x2b')](_0x33657f[_0xc552('0x2a')]);_0x124f7a[_0xc552('0x2c')]=_['intersection'](_0x124f7a[_0xc552('0x28')],_0x124f7a[_0xc552('0x2a')]);_0x1e8eb5['attributes']=_[_0xc552('0x2d')](_0x124f7a[_0xc552('0x28')],qs[_0xc552('0x2f')](_0x33657f[_0xc552('0x2a')][_0xc552('0x2f')]));_0x1e8eb5[_0xc552('0x2e')]=_0x1e8eb5['attributes']['length']?_0x1e8eb5[_0xc552('0x2e')]:_0x124f7a[_0xc552('0x28')];if(_0x33657f['query'][_0xc552('0x3e')]){_0x1e8eb5[_0xc552('0x3a')]=[{'all':!![]}];}_0x1e8eb5=_[_0xc552('0x37')]({},_0x1e8eb5,_0x33657f['options']);return db[_0xc552('0x24')][_0xc552('0x3f')](_0x1e8eb5)['then'](handleEntityNotFound(_0x55c1fc,null))[_0xc552('0x1e')](respondWithResult(_0x55c1fc,null))[_0xc552('0x3c')](handleError(_0x55c1fc,null));};exports[_0xc552('0x40')]=function(_0x351424,_0xee72c3){return db['ChatTransferReport'][_0xc552('0x40')](_0x351424['body'],{})['then'](respondWithResult(_0xee72c3,0xc9))[_0xc552('0x3c')](handleError(_0xee72c3,null));};exports[_0xc552('0x1d')]=function(_0x4356bf,_0x5048f8){if(_0x4356bf[_0xc552('0x41')]['id']){delete _0x4356bf[_0xc552('0x41')]['id'];}return db['ChatTransferReport'][_0xc552('0x3f')]({'where':{'id':_0x4356bf[_0xc552('0x42')]['id']}})['then'](handleEntityNotFound(_0x5048f8,null))[_0xc552('0x1e')](saveUpdates(_0x4356bf[_0xc552('0x41')],null))[_0xc552('0x1e')](respondWithResult(_0x5048f8,null))[_0xc552('0x3c')](handleError(_0x5048f8,null));};exports[_0xc552('0x1f')]=function(_0x4300e8,_0x2504c1){return db[_0xc552('0x24')][_0xc552('0x3f')]({'where':{'id':_0x4300e8[_0xc552('0x42')]['id']}})[_0xc552('0x1e')](handleEntityNotFound(_0x2504c1,null))['then'](removeEntity(_0x2504c1,null))[_0xc552('0x3c')](handleError(_0x2504c1,null));};exports[_0xc552('0x43')]=function(_0x17ea53,_0x1ea96e){return db[_0xc552('0x24')]['describe']()[_0xc552('0x1e')](respondWithResult(_0x1ea96e,null))['catch'](handleError(_0x1ea96e,null));}; \ No newline at end of file +var _0xae2e=['to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','type','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','catch','show','params','include','options','find','create','body','describe','eml-format','rimraf','zip-dir','moment','bluebird','util','path','sox'];(function(_0x30b85d,_0x3dbb26){var _0x38b87f=function(_0x5e4fef){while(--_0x5e4fef){_0x30b85d['push'](_0x30b85d['shift']());}};_0x38b87f(++_0x3dbb26);}(_0xae2e,0x17e));var _0xeae2=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xae2e[_0x3947c9];return _0x2e7871;};'use strict';var emlformat=require(_0xeae2('0x0'));var rimraf=require(_0xeae2('0x1'));var zipdir=require(_0xeae2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xeae2('0x3'));var BPromise=require(_0xeae2('0x4'));var Mustache=require('mustache');var util=require(_0xeae2('0x5'));var path=require(_0xeae2('0x6'));var sox=require(_0xeae2('0x7'));var csv=require(_0xeae2('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xeae2('0x9'));var _=require(_0xeae2('0xa'));var squel=require(_0xeae2('0xb'));var crypto=require('crypto');var jsforce=require(_0xeae2('0xc'));var deskjs=require(_0xeae2('0xd'));var toCsv=require('to-csv');var querystring=require(_0xeae2('0xe'));var Papa=require('papaparse');var Redis=require(_0xeae2('0xf'));var authService=require(_0xeae2('0x10'));var qs=require(_0xeae2('0x11'));var as=require(_0xeae2('0x12'));var hardwareService=require(_0xeae2('0x13'));var logger=require(_0xeae2('0x14'))(_0xeae2('0x15'));var utils=require(_0xeae2('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xeae2('0x17'));var db=require(_0xeae2('0x18'))['db'];function respondWithStatusCode(_0xd4e7e8,_0x1491fc){_0x1491fc=_0x1491fc||0xcc;return function(_0x2e7a6b){if(_0x2e7a6b){return _0xd4e7e8[_0xeae2('0x19')](_0x1491fc);}return _0xd4e7e8[_0xeae2('0x1a')](_0x1491fc)[_0xeae2('0x1b')]();};}function respondWithResult(_0x4e1236,_0x58553c){_0x58553c=_0x58553c||0xc8;return function(_0x1caa39){if(_0x1caa39){return _0x4e1236[_0xeae2('0x1a')](_0x58553c)[_0xeae2('0x1c')](_0x1caa39);}};}function respondWithFilteredResult(_0x4f5b14,_0x590f8b){return function(_0x4871f4){if(_0x4871f4){var _0x16a6cb=typeof _0x590f8b[_0xeae2('0x1d')]===_0xeae2('0x1e')&&typeof _0x590f8b['limit']==='undefined';var _0x5a8a57=_0x4871f4[_0xeae2('0x1f')];var _0x5ebb74=_0x16a6cb?0x0:_0x590f8b[_0xeae2('0x1d')];var _0x1774d9=_0x16a6cb?_0x4871f4[_0xeae2('0x1f')]:_0x590f8b['offset']+_0x590f8b['limit'];var _0x2084f2;if(_0x1774d9>=_0x5a8a57){_0x1774d9=_0x5a8a57;_0x2084f2=0xc8;}else{_0x2084f2=0xce;}_0x4f5b14['status'](_0x2084f2);return _0x4f5b14[_0xeae2('0x20')](_0xeae2('0x21'),_0x5ebb74+'-'+_0x1774d9+'/'+_0x5a8a57)['json'](_0x4871f4);}return null;};}function patchUpdates(_0x2b838f){return function(_0x2e8019){try{jsonpatch[_0xeae2('0x22')](_0x2e8019,_0x2b838f,!![]);}catch(_0x1115e6){return BPromise[_0xeae2('0x23')](_0x1115e6);}return _0x2e8019[_0xeae2('0x24')]();};}function saveUpdates(_0x52f73e,_0x4263e8){return function(_0x12b828){if(_0x12b828){return _0x12b828[_0xeae2('0x25')](_0x52f73e)[_0xeae2('0x26')](function(_0x5e5eca){return _0x5e5eca;});}return null;};}function removeEntity(_0x516dc3,_0x4f083e){return function(_0x46f7fd){if(_0x46f7fd){return _0x46f7fd['destroy']()[_0xeae2('0x26')](function(){_0x516dc3[_0xeae2('0x1a')](0xcc)[_0xeae2('0x1b')]();});}};}function handleEntityNotFound(_0x1476bb,_0x290abd){return function(_0x7ff416){if(!_0x7ff416){_0x1476bb[_0xeae2('0x19')](0x194);}return _0x7ff416;};}function handleError(_0x2b6800,_0x432f8b){_0x432f8b=_0x432f8b||0x1f4;return function(_0x5060c3){logger[_0xeae2('0x27')](_0x5060c3[_0xeae2('0x28')]);if(_0x5060c3['name']){delete _0x5060c3[_0xeae2('0x29')];}_0x2b6800[_0xeae2('0x1a')](_0x432f8b)[_0xeae2('0x2a')](_0x5060c3);};}exports[_0xeae2('0x2b')]=function(_0x272966,_0x1f98e4){var _0x556271={},_0x14ea44={},_0x3f2036={'count':0x0,'rows':[]};var _0x4e99de=_[_0xeae2('0x2c')](db[_0xeae2('0x2d')][_0xeae2('0x2e')],function(_0x2d8941){return{'name':_0x2d8941[_0xeae2('0x2f')],'type':_0x2d8941[_0xeae2('0x30')]['key']};});_0x14ea44['model']=_[_0xeae2('0x2c')](_0x4e99de,_0xeae2('0x29'));_0x14ea44['query']=_[_0xeae2('0x31')](_0x272966[_0xeae2('0x32')]);_0x14ea44[_0xeae2('0x33')]=_[_0xeae2('0x34')](_0x14ea44[_0xeae2('0x35')],_0x14ea44[_0xeae2('0x32')]);_0x556271[_0xeae2('0x36')]=_[_0xeae2('0x34')](_0x14ea44[_0xeae2('0x35')],qs[_0xeae2('0x37')](_0x272966[_0xeae2('0x32')][_0xeae2('0x37')]));_0x556271['attributes']=_0x556271[_0xeae2('0x36')][_0xeae2('0x38')]?_0x556271[_0xeae2('0x36')]:_0x14ea44[_0xeae2('0x35')];if(!_0x272966['query'][_0xeae2('0x39')](_0xeae2('0x3a'))){_0x556271[_0xeae2('0x3b')]=qs[_0xeae2('0x3b')](_0x272966[_0xeae2('0x32')][_0xeae2('0x3b')]);_0x556271[_0xeae2('0x1d')]=qs[_0xeae2('0x1d')](_0x272966[_0xeae2('0x32')]['offset']);}_0x556271[_0xeae2('0x3c')]=qs['sort'](_0x272966[_0xeae2('0x32')][_0xeae2('0x3d')]);_0x556271[_0xeae2('0x3e')]=qs[_0xeae2('0x33')](_[_0xeae2('0x3f')](_0x272966['query'],_0x14ea44['filters']),_0x4e99de);if(_0x272966[_0xeae2('0x32')][_0xeae2('0x40')]){_0x556271[_0xeae2('0x3e')]=_[_0xeae2('0x41')](_0x556271[_0xeae2('0x3e')],{'$or':_['map'](_0x4e99de,function(_0x5a5218){if(_0x5a5218[_0xeae2('0x30')]!==_0xeae2('0x42')){var _0xa330bf={};_0xa330bf[_0x5a5218[_0xeae2('0x29')]]={'$like':'%'+_0x272966[_0xeae2('0x32')][_0xeae2('0x40')]+'%'};return _0xa330bf;}})});}_0x556271=_[_0xeae2('0x41')]({},_0x556271,_0x272966['options']);var _0x14bb5d={'where':_0x556271[_0xeae2('0x3e')]};return db[_0xeae2('0x2d')]['count'](_0x14bb5d)[_0xeae2('0x26')](function(_0x4e0da6){_0x3f2036['count']=_0x4e0da6;if(_0x272966[_0xeae2('0x32')][_0xeae2('0x43')]){_0x556271['include']=[{'all':!![]}];}return db[_0xeae2('0x2d')][_0xeae2('0x44')](_0x556271);})[_0xeae2('0x26')](function(_0x2b8bff){_0x3f2036['rows']=_0x2b8bff;return _0x3f2036;})['then'](respondWithFilteredResult(_0x1f98e4,_0x556271))[_0xeae2('0x45')](handleError(_0x1f98e4,null));};exports[_0xeae2('0x46')]=function(_0x4d795b,_0x4fa9ad){var _0x389f6c={'raw':!![],'where':{'id':_0x4d795b[_0xeae2('0x47')]['id']}},_0xc52ef={};_0xc52ef[_0xeae2('0x35')]=_[_0xeae2('0x31')](db['ChatTransferReport']['rawAttributes']);_0xc52ef[_0xeae2('0x32')]=_['keys'](_0x4d795b[_0xeae2('0x32')]);_0xc52ef['filters']=_['intersection'](_0xc52ef[_0xeae2('0x35')],_0xc52ef[_0xeae2('0x32')]);_0x389f6c[_0xeae2('0x36')]=_['intersection'](_0xc52ef['model'],qs[_0xeae2('0x37')](_0x4d795b[_0xeae2('0x32')][_0xeae2('0x37')]));_0x389f6c[_0xeae2('0x36')]=_0x389f6c[_0xeae2('0x36')][_0xeae2('0x38')]?_0x389f6c[_0xeae2('0x36')]:_0xc52ef['model'];if(_0x4d795b[_0xeae2('0x32')][_0xeae2('0x43')]){_0x389f6c[_0xeae2('0x48')]=[{'all':!![]}];}_0x389f6c=_[_0xeae2('0x41')]({},_0x389f6c,_0x4d795b[_0xeae2('0x49')]);return db[_0xeae2('0x2d')][_0xeae2('0x4a')](_0x389f6c)['then'](handleEntityNotFound(_0x4fa9ad,null))[_0xeae2('0x26')](respondWithResult(_0x4fa9ad,null))[_0xeae2('0x45')](handleError(_0x4fa9ad,null));};exports['create']=function(_0xbad9f8,_0x81bee0){return db[_0xeae2('0x2d')][_0xeae2('0x4b')](_0xbad9f8[_0xeae2('0x4c')],{})[_0xeae2('0x26')](respondWithResult(_0x81bee0,0xc9))[_0xeae2('0x45')](handleError(_0x81bee0,null));};exports[_0xeae2('0x25')]=function(_0x1fb98c,_0x1b321b){if(_0x1fb98c[_0xeae2('0x4c')]['id']){delete _0x1fb98c[_0xeae2('0x4c')]['id'];}return db[_0xeae2('0x2d')]['find']({'where':{'id':_0x1fb98c[_0xeae2('0x47')]['id']}})[_0xeae2('0x26')](handleEntityNotFound(_0x1b321b,null))[_0xeae2('0x26')](saveUpdates(_0x1fb98c[_0xeae2('0x4c')],null))['then'](respondWithResult(_0x1b321b,null))[_0xeae2('0x45')](handleError(_0x1b321b,null));};exports['destroy']=function(_0x4b1bdf,_0x203eae){return db[_0xeae2('0x2d')][_0xeae2('0x4a')]({'where':{'id':_0x4b1bdf[_0xeae2('0x47')]['id']}})['then'](handleEntityNotFound(_0x203eae,null))[_0xeae2('0x26')](removeEntity(_0x203eae,null))[_0xeae2('0x45')](handleError(_0x203eae,null));};exports[_0xeae2('0x4d')]=function(_0x2c9f3d,_0x5387e1){return db[_0xeae2('0x2d')][_0xeae2('0x4d')]()[_0xeae2('0x26')](respondWithResult(_0x5387e1,null))[_0xeae2('0x45')](handleError(_0x5387e1,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 26d0e78..b079391 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 _0xe8a2=['define','ChatTransferReport','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xe8a2,0x121));var _0x2e8a=function(_0x4f8d8a,_0x37bd37){_0x4f8d8a=_0x4f8d8a-0x0;var _0x5cf5cd=_0xe8a2[_0x4f8d8a];return _0x5cf5cd;};'use strict';var _=require(_0x2e8a('0x0'));var util=require(_0x2e8a('0x1'));var logger=require(_0x2e8a('0x2'))(_0x2e8a('0x3'));var moment=require('moment');var BPromise=require(_0x2e8a('0x4'));var rp=require(_0x2e8a('0x5'));var fs=require('fs');var path=require(_0x2e8a('0x6'));var rimraf=require(_0x2e8a('0x7'));var config=require(_0x2e8a('0x8'));var attributes=require(_0x2e8a('0x9'));module['exports']=function(_0x4a4276,_0x292e89){return _0x4a4276[_0x2e8a('0xa')](_0x2e8a('0xb'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0x2e8a('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x5ac3=['../../config/environment','./chatTransferReport.attributes','exports','define','report_chat_transfer','uniqueid','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x19691f,_0x159737){var _0x5677b6=function(_0x41a9b2){while(--_0x41a9b2){_0x19691f['push'](_0x19691f['shift']());}};_0x5677b6(++_0x159737);}(_0x5ac3,0x68));var _0x35ac=function(_0xdf0f2a,_0x382763){_0xdf0f2a=_0xdf0f2a-0x0;var _0x4000f8=_0x5ac3[_0xdf0f2a];return _0x4000f8;};'use strict';var _=require(_0x35ac('0x0'));var util=require(_0x35ac('0x1'));var logger=require('../../config/logger')(_0x35ac('0x2'));var moment=require(_0x35ac('0x3'));var BPromise=require(_0x35ac('0x4'));var rp=require(_0x35ac('0x5'));var fs=require('fs');var path=require(_0x35ac('0x6'));var rimraf=require(_0x35ac('0x7'));var config=require(_0x35ac('0x8'));var attributes=require(_0x35ac('0x9'));module[_0x35ac('0xa')]=function(_0x1ef8f9,_0x19b3cf){return _0x1ef8f9[_0x35ac('0xb')]('ChatTransferReport',attributes,{'tableName':_0x35ac('0xc'),'paranoid':![],'indexes':[{'name':_0x35ac('0xd'),'fields':[_0x35ac('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index cf5f15f..32e9ba2 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 _0x88b5=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','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','catch','util','moment','bluebird'];(function(_0x2deee9,_0x58b00f){var _0x51a55e=function(_0x4de56a){while(--_0x4de56a){_0x2deee9['push'](_0x2deee9['shift']());}};_0x51a55e(++_0x58b00f);}(_0x88b5,0xa5));var _0x588b=function(_0x45906b,_0xc2c7ae){_0x45906b=_0x45906b-0x0;var _0x8fc176=_0x88b5[_0x45906b];return _0x8fc176;};'use strict';var _=require('lodash');var util=require(_0x588b('0x0'));var moment=require(_0x588b('0x1'));var BPromise=require(_0x588b('0x2'));var rs=require(_0x588b('0x3'));var fs=require('fs');var Redis=require(_0x588b('0x4'));var db=require(_0x588b('0x5'))['db'];var utils=require(_0x588b('0x6'));var logger=require(_0x588b('0x7'))(_0x588b('0x8'));var config=require('../../config/environment');var jayson=require(_0x588b('0x9'));var client=jayson[_0x588b('0xa')][_0x588b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x186f25,_0x182668,_0x567766){return new BPromise(function(_0x45e1a0,_0x312fd4){return client[_0x588b('0xc')](_0x186f25,_0x567766)[_0x588b('0xd')](function(_0x451698){logger[_0x588b('0xe')](_0x588b('0xf'),_0x182668,'request\x20sent');logger[_0x588b('0x10')](_0x588b('0x11'),_0x182668,_0x588b('0x12'),JSON[_0x588b('0x13')](_0x451698));if(_0x451698[_0x588b('0x14')]){if(_0x451698['error'][_0x588b('0x15')]===0x1f4){logger[_0x588b('0x14')](_0x588b('0xf'),_0x182668,_0x451698['error'][_0x588b('0x16')]);return _0x312fd4(_0x451698[_0x588b('0x14')]['message']);}logger[_0x588b('0x14')]('ChatTransferReport,\x20%s,\x20%s',_0x182668,_0x451698[_0x588b('0x14')][_0x588b('0x16')]);return _0x45e1a0(_0x451698[_0x588b('0x14')][_0x588b('0x16')]);}else{logger[_0x588b('0xe')](_0x588b('0xf'),_0x182668,_0x588b('0x12'));_0x45e1a0(_0x451698['result']['message']);}})[_0x588b('0x17')](function(_0x34238d){logger[_0x588b('0x14')]('ChatTransferReport,\x20%s,\x20%s',_0x182668,_0x34238d);_0x312fd4(_0x34238d);});});} \ No newline at end of file +var _0x0841=['ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','client','request','then'];(function(_0x3b5775,_0x53eefd){var _0x4a241f=function(_0x5f424e){while(--_0x5f424e){_0x3b5775['push'](_0x3b5775['shift']());}};_0x4a241f(++_0x53eefd);}(_0x0841,0x9e));var _0x1084=function(_0x284328,_0x4d674e){_0x284328=_0x284328-0x0;var _0x6efdac=_0x0841[_0x284328];return _0x6efdac;};'use strict';var _=require(_0x1084('0x0'));var util=require(_0x1084('0x1'));var moment=require(_0x1084('0x2'));var BPromise=require(_0x1084('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1084('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x1084('0x5'))(_0x1084('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1084('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x298c3f,_0x59869d,_0x341fc0){return new BPromise(function(_0x5b00d8,_0x19cac7){return client[_0x1084('0x8')](_0x298c3f,_0x341fc0)[_0x1084('0x9')](function(_0xdcaa33){logger['info'](_0x1084('0xa'),_0x59869d,_0x1084('0xb'));logger[_0x1084('0xc')](_0x1084('0xd'),_0x59869d,_0x1084('0xb'),JSON[_0x1084('0xe')](_0xdcaa33));if(_0xdcaa33['error']){if(_0xdcaa33[_0x1084('0xf')][_0x1084('0x10')]===0x1f4){logger['error'](_0x1084('0xa'),_0x59869d,_0xdcaa33['error'][_0x1084('0x11')]);return _0x19cac7(_0xdcaa33[_0x1084('0xf')][_0x1084('0x11')]);}logger['error'](_0x1084('0xa'),_0x59869d,_0xdcaa33['error'][_0x1084('0x11')]);return _0x5b00d8(_0xdcaa33[_0x1084('0xf')][_0x1084('0x11')]);}else{logger[_0x1084('0x12')](_0x1084('0xa'),_0x59869d,'request\x20sent');_0x5b00d8(_0xdcaa33[_0x1084('0x13')][_0x1084('0x11')]);}})[_0x1084('0x14')](function(_0x5912ce){logger[_0x1084('0xf')](_0x1084('0xa'),_0x59869d,_0x5912ce);_0x19cac7(_0x5912ce);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 57e8d76..2695c09 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 _0xe7e2=['isAuthenticated','index','/describe','/:id','show','post','create','put','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get'];(function(_0x493ef6,_0x31f63d){var _0x2c56d4=function(_0x1c0d47){while(--_0x1c0d47){_0x493ef6['push'](_0x493ef6['shift']());}};_0x2c56d4(++_0x31f63d);}(_0xe7e2,0x1c3));var _0x2e7e=function(_0x7b5f9a,_0x138869){_0x7b5f9a=_0x7b5f9a-0x0;var _0x45670f=_0xe7e2[_0x7b5f9a];return _0x45670f;};'use strict';var multer=require('multer');var util=require(_0x2e7e('0x0'));var path=require(_0x2e7e('0x1'));var timeout=require(_0x2e7e('0x2'));var express=require(_0x2e7e('0x3'));var router=express[_0x2e7e('0x4')]();var fs_extra=require(_0x2e7e('0x5'));var auth=require(_0x2e7e('0x6'));var interaction=require(_0x2e7e('0x7'));var config=require(_0x2e7e('0x8'));var controller=require(_0x2e7e('0x9'));router[_0x2e7e('0xa')]('/',auth[_0x2e7e('0xb')](),controller[_0x2e7e('0xc')]);router[_0x2e7e('0xa')](_0x2e7e('0xd'),auth[_0x2e7e('0xb')](),controller['describe']);router[_0x2e7e('0xa')](_0x2e7e('0xe'),auth[_0x2e7e('0xb')](),controller[_0x2e7e('0xf')]);router[_0x2e7e('0x10')]('/',auth[_0x2e7e('0xb')](),controller[_0x2e7e('0x11')]);router[_0x2e7e('0x12')](_0x2e7e('0xe'),auth[_0x2e7e('0xb')](),controller['update']);router[_0x2e7e('0x13')](_0x2e7e('0xe'),auth[_0x2e7e('0xb')](),controller[_0x2e7e('0x14')]);module[_0x2e7e('0x15')]=router; \ No newline at end of file +var _0x2000=['../../components/auth/service','../../components/interaction/service','./chatTransferReport.controller','index','get','/describe','isAuthenticated','describe','show','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra'];(function(_0x4f4b34,_0x47dda1){var _0xac9265=function(_0x5340fa){while(--_0x5340fa){_0x4f4b34['push'](_0x4f4b34['shift']());}};_0xac9265(++_0x47dda1);}(_0x2000,0x68));var _0x0200=function(_0x48ccaa,_0x118a60){_0x48ccaa=_0x48ccaa-0x0;var _0x3c11ab=_0x2000[_0x48ccaa];return _0x3c11ab;};'use strict';var multer=require(_0x0200('0x0'));var util=require(_0x0200('0x1'));var path=require(_0x0200('0x2'));var timeout=require(_0x0200('0x3'));var express=require(_0x0200('0x4'));var router=express['Router']();var fs_extra=require(_0x0200('0x5'));var auth=require(_0x0200('0x6'));var interaction=require(_0x0200('0x7'));var config=require('../../config/environment');var controller=require(_0x0200('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x0200('0x9')]);router[_0x0200('0xa')](_0x0200('0xb'),auth[_0x0200('0xc')](),controller[_0x0200('0xd')]);router[_0x0200('0xa')]('/:id',auth[_0x0200('0xc')](),controller[_0x0200('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x0200('0xf')]);router[_0x0200('0x10')](_0x0200('0x11'),auth[_0x0200('0xc')](),controller[_0x0200('0x12')]);router[_0x0200('0x13')](_0x0200('0x11'),auth[_0x0200('0xc')](),controller[_0x0200('0x14')]);module[_0x0200('0x15')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index c47feaf..d8e923c 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 _0x235a=['Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20submission\x20error','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','stringify','input','name','getDataValue','onlineForm','parse','setDataValue','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}}','bottom_right','alternate','#fafafa','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','Generated\x20by\x20XCALLY\x20Motion','sequelize','randomstring','exports','STRING','email','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM'];(function(_0x1cdf3d,_0xf691e2){var _0x33a5c1=function(_0xcd3c7a){while(--_0xcd3c7a){_0x1cdf3d['push'](_0x1cdf3d['shift']());}};_0x33a5c1(++_0xf691e2);}(_0x235a,0xfe));var _0xa235=function(_0x2bbd7d,_0x2998d4){_0x2bbd7d=_0x2bbd7d-0x0;var _0x4c8250=_0x235a[_0x2bbd7d];return _0x4c8250;};'use strict';var Sequelize=require(_0xa235('0x0'));var rs=require(_0xa235('0x1'));module[_0xa235('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0xa235('0x3')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0xa235('0x3')]},'mapKey':{'type':Sequelize[_0xa235('0x3')],'defaultValue':_0xa235('0x4')},'mapKeyOffline':{'type':Sequelize[_0xa235('0x3')],'defaultValue':'email'},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xa235('0x3')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0xa235('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xa235('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xa235('0x3')],'allowNull':![],'defaultValue':_0xa235('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xa235('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xa235('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xa235('0x3')]},'animation':{'type':Sequelize[_0xa235('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xa235('0x9')]('rounded','squared'),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0xa235('0x3')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0xa235('0x3')],'defaultValue':_0xa235('0xa')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xa235('0xb')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0xa235('0xc')},'download_transcript':{'type':Sequelize[_0xa235('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xa235('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xa235('0x3')],'defaultValue':_0xa235('0xd')},'defaultWhiteLabel':{'type':Sequelize[_0xa235('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xa235('0xe')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0xa235('0xf')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0xa235('0x10')},'noteTitle':{'type':Sequelize[_0xa235('0x3')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0xa235('0x3')],'defaultValue':_0xa235('0x11')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0xa235('0x12')},'closingMessageButton':{'type':Sequelize[_0xa235('0x3')],'defaultValue':_0xa235('0xb')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0xa235('0x13')},'conditionAgreement':{'type':Sequelize[_0xa235('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xa235('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xa235('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xa235('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xa235('0x3')],'defaultValue':_0xa235('0x14')},'ratingType':{'type':Sequelize[_0xa235('0x9')](_0xa235('0x15'),'thumb'),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0xa235('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xa235('0xe')],'defaultValue':function(){return JSON[_0xa235('0x16')]({'items':[{'type':_0xa235('0x17'),'variable':null,'config':{'placeholder':_0xa235('0x18'),'type':'text','required':!![]},'props':{'title':_0xa235('0x18'),'helpText':''}},{'type':_0xa235('0x17'),'props':{'title':_0xa235('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xa235('0x4'),'type':_0xa235('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xa235('0x19')](_0xa235('0x1a'))?JSON[_0xa235('0x1b')](this[_0xa235('0x19')](_0xa235('0x1a'))):{};},'set':function(_0x215890){return this[_0xa235('0x1c')](_0xa235('0x1a'),JSON['stringify'](_0x215890));}},'offlineForm':{'type':Sequelize[_0xa235('0xe')],'defaultValue':function(){return JSON[_0xa235('0x16')]({'items':[{'type':'input','props':{'title':_0xa235('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xa235('0x4'),'type':_0xa235('0x4')},'variable':null},{'type':'textarea','config':{'placeholder':_0xa235('0x1d')},'props':{'title':'Comments','helpText':_0xa235('0x1e')}}],'fromKey':0x0});},'get':function(){return this[_0xa235('0x19')](_0xa235('0x1f'))?JSON[_0xa235('0x1b')](this[_0xa235('0x19')](_0xa235('0x1f'))):{};},'set':function(_0x54b151){return this[_0xa235('0x1c')]('offlineForm',JSON[_0xa235('0x16')](_0x54b151));}},'token':{'type':Sequelize[_0xa235('0x3')],'defaultValue':function(){return rs[_0xa235('0x20')]();}},'autoclose':{'type':Sequelize[_0xa235('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xa235('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xa235('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xa235('0x3')]},'forwardOffline':{'type':Sequelize[_0xa235('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0xa235('0x3')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0xa235('0x21')},'offlineMessageBody':{'type':Sequelize[_0xa235('0x3')],'defaultValue':_0xa235('0x22')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xa235('0x3')],'defaultValue':_0xa235('0x23')},'skipUnmanaged':{'type':Sequelize[_0xa235('0x3')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0xa235('0x3')],'defaultValue':_0xa235('0xb')},'enableCustomerAttachment':{'type':Sequelize[_0xa235('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xa235('0xe')]},'showAgentAvatar':{'type':Sequelize[_0xa235('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xa235('0x24');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xa235('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xa235('0x8')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xa235('0x3')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0xa235('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xa235('0x3')],'defaultValue':_0xa235('0x25')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0xa235('0x3')],'defaultValue':_0xa235('0x26')},'defaultTitle':{'type':Sequelize[_0xa235('0x3')]},'customerAvatar':{'type':Sequelize[_0xa235('0xe')]},'showCustomerAvatar':{'type':Sequelize[_0xa235('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xa235('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xa235('0x3')],'allowNull':![],'defaultValue':_0xa235('0x27'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xa235('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xa235('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xa235('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xa235('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xa235('0x3')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0xa235('0x28')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xa235('0x29'),'set':function(_0x55860e){if(!_0x55860e)this[_0xa235('0x1c')](_0xa235('0x2a'),null);this['setDataValue']('mandatoryDisposition',_0x55860e);}},'vidaooEscalation':{'type':Sequelize[_0xa235('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0xa235('0x3')],'allowNull':![],'defaultValue':_0xa235('0x2b')},'vidaooNote':{'type':Sequelize[_0xa235('0x3')],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize[_0xa235('0xe')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xa235('0x8')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xa235('0xe')]}}; \ No newline at end of file +var _0x8c5f=['Form\x20submission\x20error','Note','Thanks\x20you\x20for\x20your\x20time!','Skip','ENUM','thumb','star','input','name','text','getDataValue','onlineForm','setDataValue','stringify','TEXT','textarea','Comments','offlineForm','parse','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','alternate','#fafafa','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','squared','Send','Contact\x20us','Powered\x20by\x20xCALLY','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted'];(function(_0x255b73,_0x5b2756){var _0x8f95dc=function(_0x396ed5){while(--_0x396ed5){_0x255b73['push'](_0x255b73['shift']());}};_0x8f95dc(++_0x5b2756);}(_0x8c5f,0xd3));var _0xf8c5=function(_0x1d5fd9,_0x39e853){_0x1d5fd9=_0x1d5fd9-0x0;var _0x3e11bc=_0x8c5f[_0x1d5fd9];return _0x3e11bc;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module['exports']={'name':{'type':Sequelize[_0xf8c5('0x0')],'allowNull':![]},'address':{'type':Sequelize[_0xf8c5('0x0')],'allowNull':![],'unique':_0xf8c5('0x1')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0xf8c5('0x2')},'mapKeyOffline':{'type':Sequelize[_0xf8c5('0x0')],'defaultValue':_0xf8c5('0x2')},'key':{'type':Sequelize[_0xf8c5('0x0')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xf8c5('0x0')],'defaultValue':_0xf8c5('0x3')},'customerAlias':{'type':Sequelize[_0xf8c5('0x0')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xf8c5('0x0')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xf8c5('0x0')],'allowNull':![],'defaultValue':_0xf8c5('0x4'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xf8c5('0x0')],'allowNull':![],'defaultValue':_0xf8c5('0x5'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xf8c5('0x6')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xf8c5('0x0')]},'animation':{'type':Sequelize[_0xf8c5('0x7')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM']('rounded',_0xf8c5('0x8')),'defaultValue':'rounded'},'header_online':{'type':Sequelize['STRING'],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0xf8c5('0x0')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize[_0xf8c5('0x0')],'defaultValue':_0xf8c5('0x9')},'header_offline':{'type':Sequelize[_0xf8c5('0x0')],'defaultValue':_0xf8c5('0xa')},'download_transcript':{'type':Sequelize[_0xf8c5('0x7')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xf8c5('0x6')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xf8c5('0x0')],'defaultValue':_0xf8c5('0xb')},'defaultWhiteLabel':{'type':Sequelize[_0xf8c5('0x7')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0xf8c5('0xc')},'formSubmitSuccessMessage':{'type':Sequelize[_0xf8c5('0x0')],'defaultValue':_0xf8c5('0xd')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0xf8c5('0xe')},'noteTitle':{'type':Sequelize[_0xf8c5('0x0')],'defaultValue':_0xf8c5('0xf')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0xf8c5('0x0')],'defaultValue':_0xf8c5('0x10')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0xf8c5('0x9')},'skipMessageButton':{'type':Sequelize[_0xf8c5('0x0')],'defaultValue':_0xf8c5('0x11')},'conditionAgreement':{'type':Sequelize[_0xf8c5('0x7')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xf8c5('0x7')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xf8c5('0x7')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xf8c5('0x7')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xf8c5('0x0')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0xf8c5('0x12')]('star',_0xf8c5('0x13')),'defaultValue':_0xf8c5('0x14')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0xf8c5('0x15'),'variable':null,'config':{'placeholder':_0xf8c5('0x16'),'type':_0xf8c5('0x17'),'required':!![]},'props':{'title':_0xf8c5('0x16'),'helpText':''}},{'type':_0xf8c5('0x15'),'props':{'title':_0xf8c5('0x2'),'helpText':''},'config':{'required':!![],'placeholder':_0xf8c5('0x2'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xf8c5('0x18')](_0xf8c5('0x19'))?JSON['parse'](this[_0xf8c5('0x18')]('onlineForm')):{};},'set':function(_0x3d1a1e){return this[_0xf8c5('0x1a')](_0xf8c5('0x19'),JSON[_0xf8c5('0x1b')](_0x3d1a1e));}},'offlineForm':{'type':Sequelize[_0xf8c5('0x1c')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0xf8c5('0x15'),'props':{'title':_0xf8c5('0x2'),'helpText':''},'config':{'required':!![],'placeholder':_0xf8c5('0x2'),'type':'email'},'variable':null},{'type':_0xf8c5('0x1d'),'config':{'placeholder':_0xf8c5('0x1e')},'props':{'title':_0xf8c5('0x1e'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0xf8c5('0x18')](_0xf8c5('0x1f'))?JSON[_0xf8c5('0x20')](this[_0xf8c5('0x18')](_0xf8c5('0x1f'))):{};},'set':function(_0x2696e6){return this[_0xf8c5('0x1a')]('offlineForm',JSON['stringify'](_0x2696e6));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0xf8c5('0x7')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xf8c5('0x7')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0xf8c5('0x7')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0xf8c5('0x0')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0xf8c5('0x0')],'defaultValue':_0xf8c5('0x21')},'offlineMessageSubject':{'type':Sequelize[_0xf8c5('0x0')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0xf8c5('0x0')],'defaultValue':_0xf8c5('0x22')},'enableUnmanagedNote':{'type':Sequelize[_0xf8c5('0x7')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xf8c5('0x0')],'defaultValue':_0xf8c5('0x23')},'skipUnmanaged':{'type':Sequelize[_0xf8c5('0x0')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0xf8c5('0x0')],'defaultValue':_0xf8c5('0x9')},'enableCustomerAttachment':{'type':Sequelize[_0xf8c5('0x7')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xf8c5('0x7')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xf8c5('0x1c')]},'showAgentAvatar':{'type':Sequelize[_0xf8c5('0x7')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xf8c5('0x0')]},'notificationTemplate':{'type':Sequelize[_0xf8c5('0x1c')],'defaultValue':function(){return _0xf8c5('0x24');}},'notificationSound':{'type':Sequelize[_0xf8c5('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xf8c5('0x7')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xf8c5('0x0')],'defaultValue':_0xf8c5('0x25')},'waitForTheAssignedAgent':{'type':Sequelize[_0xf8c5('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xf8c5('0x0')],'defaultValue':_0xf8c5('0x26')},'verticalAlignment':{'type':Sequelize[_0xf8c5('0x6')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0xf8c5('0x0')],'defaultValue':_0xf8c5('0x27')},'defaultTitle':{'type':Sequelize[_0xf8c5('0x0')]},'customerAvatar':{'type':Sequelize[_0xf8c5('0x1c')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xf8c5('0x0')],'allowNull':![],'defaultValue':_0xf8c5('0x28'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xf8c5('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xf8c5('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xf8c5('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xf8c5('0x0')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize[_0xf8c5('0x1c')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xf8c5('0x6')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xf8c5('0x7')],'defaultValue':![],'comment':_0xf8c5('0x29'),'set':function(_0x20393f){if(!_0x20393f)this['setDataValue'](_0xf8c5('0x2a'),null);this['setDataValue'](_0xf8c5('0x2b'),_0x20393f);}},'vidaooEscalation':{'type':Sequelize[_0xf8c5('0x7')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xf8c5('0x0')]},'vidaooTopic':{'type':Sequelize[_0xf8c5('0x0')],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize[_0xf8c5('0x0')],'defaultValue':function(){return _0xf8c5('0x2c');}},'vidaooMetadata':{'type':Sequelize[_0xf8c5('0x1c')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xf8c5('0x7')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xf8c5('0x1c')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index dfd540c..16ac94c 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 _0x9e66=['ChatInteraction','externalUrl','interaction','spread','contact','lastName','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','notify','offline','files','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','ChatOfflineMessage','originalname','server','attachments','offline-chat','openNewInteraction','transaction','bulkCreate','MailServerOut','Smtp','forwardOffline','service','host','port','secure','authentication','auth','pass','SendMail','\x22%s\x22\x20<%s>','email','forwardOfflineAddress','offlineMessageSubject','MailAccountId','mapValues','subjectOffline','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','Contact','Owner','fullname','internal','Tag','Tags','color','tag','Command','getSnippet','iftime\x20%s,%s','interval','timezone','iftime\x20%s','indexOf','true','OFFLINE','No\x20timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','Interval','Intervals','getProactiveActions','virtual','License','increment','chatLicenseExceeded','all','some','server/files/chat/iframe.ejs','remote','x-real-ip','connection','render','alignment','verticalAlignment','textColor','color_button','backgroundColor','sequelize','findAndCountAll','getApplications','addProactiveActions','getFields','online','false','offlineForm','items','fromKey','Attachment','Attachments','addAgents','userChatWebsite:save','removeAgents','isArray','emit','userChatWebsite:remove','getAgents','User','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','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','http','client','request','then','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','ChatWebsite,\x20%s,\x20%s','message','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','get','ChatWebsites','destroy','stack','name','send','Pause','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','ChatWebsite','include','findAll','rows','show','params','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','hasOwnProperty','order','ChatWebsiteId','Disposition','removeDispositions','ids','CannedAnswer','getAnswers','findOne','removeAnswers','addLogo','sitepic','addAvatar','agentAvatar','file','customerAvatar','filename','addSystemAvatar','systemAvatar','join','root','server/files/images/logos/default_logo.svg','getLicense','custom','isNil','existsSync','server/files/images/logos/','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','download','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','user-agent-parser','setUA','headers','user-agent','getResult','Sequelize','ValidationError','createdAt','updatedAt','difference','CompanyId','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','CmContact','Contacts','DESC','ChatApplication','Applications','applications','list','priority','asc','account','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','x-real-port','referer','browser','version','format','device','vendor','stringify','threadId'];(function(_0x5c3315,_0x3fd991){var _0x5f0f2a=function(_0x322161){while(--_0x322161){_0x5c3315['push'](_0x5c3315['shift']());}};_0x5f0f2a(++_0x3fd991);}(_0x9e66,0x1ae));var _0x69e6=function(_0x481382,_0x166482){_0x481382=_0x481382-0x0;var _0x5d67ad=_0x9e66[_0x481382];return _0x5d67ad;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x69e6('0x0'));var jsonpatch=require(_0x69e6('0x1'));var rp=require(_0x69e6('0x2'));var moment=require(_0x69e6('0x3'));var BPromise=require(_0x69e6('0x4'));var Mustache=require(_0x69e6('0x5'));var util=require(_0x69e6('0x6'));var path=require(_0x69e6('0x7'));var sox=require(_0x69e6('0x8'));var csv=require(_0x69e6('0x9'));var ejs=require(_0x69e6('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x69e6('0xb'));var squel=require(_0x69e6('0xc'));var crypto=require(_0x69e6('0xd'));var jsforce=require(_0x69e6('0xe'));var deskjs=require(_0x69e6('0xf'));var toCsv=require(_0x69e6('0x9'));var querystring=require(_0x69e6('0x10'));var Papa=require(_0x69e6('0x11'));var Redis=require(_0x69e6('0x12'));var authService=require(_0x69e6('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x69e6('0x14'));var logger=require(_0x69e6('0x15'))(_0x69e6('0x16'));var utils=require(_0x69e6('0x17'));var config=require(_0x69e6('0x18'));var licenseUtil=require(_0x69e6('0x19'));var db=require('../../mysqldb')['db'];config[_0x69e6('0x1a')]=_[_0x69e6('0x1b')](config[_0x69e6('0x1a')],{'host':_0x69e6('0x1c'),'port':0x18eb});var socket=require(_0x69e6('0x1d'))(new Redis(config[_0x69e6('0x1a')]));require('./chatWebsite.socket')[_0x69e6('0x1e')](socket);var jayson=require(_0x69e6('0x1f'));var client=jayson['client'][_0x69e6('0x20')]({'port':0x232c});var client9002=jayson[_0x69e6('0x21')][_0x69e6('0x20')]({'port':0x232a});var client9003=jayson[_0x69e6('0x21')]['http']({'port':0x232b});var client9001=jayson[_0x69e6('0x21')][_0x69e6('0x20')]({'port':0x2329});function respondWithRpcPromise(_0x47479e,_0x3d9095,_0x303c53,_0x331928){return new BPromise(function(_0xa2726c,_0x12c3b2){var _0x442c27=_0x331928||client;return _0x442c27[_0x69e6('0x22')](_0x47479e,_0x303c53)[_0x69e6('0x23')](function(_0x2924f0){logger[_0x69e6('0x24')]('ChatWebsite,\x20%s,\x20%s',_0x3d9095,_0x69e6('0x25'));logger[_0x69e6('0x26')](_0x69e6('0x27'),_0x3d9095,'request\x20sent',JSON['stringify'](_0x2924f0));if(_0x2924f0[_0x69e6('0x28')]){if(_0x2924f0[_0x69e6('0x28')][_0x69e6('0x29')]===0x1f4){logger['error'](_0x69e6('0x2a'),_0x3d9095,_0x2924f0['error'][_0x69e6('0x2b')]);return _0x12c3b2(_0x2924f0[_0x69e6('0x28')][_0x69e6('0x2b')]);}logger[_0x69e6('0x28')](_0x69e6('0x2a'),_0x3d9095,_0x2924f0[_0x69e6('0x28')][_0x69e6('0x2b')]);return _0xa2726c(_0x2924f0[_0x69e6('0x28')][_0x69e6('0x2b')]);}else{logger[_0x69e6('0x24')](_0x69e6('0x2a'),_0x3d9095,_0x69e6('0x25'));_0xa2726c(_0x2924f0['result'][_0x69e6('0x2b')]);}})[_0x69e6('0x2c')](function(_0x28089e){logger['error'](_0x69e6('0x2a'),_0x3d9095,_0x28089e);_0x12c3b2(_0x28089e);});});}function respondWithStatusCode(_0xfba6d3,_0xbede29){_0xbede29=_0xbede29||0xcc;return function(_0x56af4d){if(_0x56af4d){return _0xfba6d3[_0x69e6('0x2d')](_0xbede29);}return _0xfba6d3[_0x69e6('0x2e')](_0xbede29)[_0x69e6('0x2f')]();};}function respondWithResult(_0x1f6987,_0x2baf4b){_0x2baf4b=_0x2baf4b||0xc8;return function(_0x125f4f){if(_0x125f4f){return _0x1f6987['status'](_0x2baf4b)[_0x69e6('0x30')](_0x125f4f);}};}function respondWithFilteredResult(_0x325e02,_0x2f82a5){return function(_0x2a0d28){if(_0x2a0d28){var _0xa110ed=typeof _0x2f82a5['offset']===_0x69e6('0x31')&&typeof _0x2f82a5[_0x69e6('0x32')]===_0x69e6('0x31');var _0x224556=_0x2a0d28[_0x69e6('0x33')];var _0x33e373=_0xa110ed?0x0:_0x2f82a5['offset'];var _0x56e075=_0xa110ed?_0x2a0d28[_0x69e6('0x33')]:_0x2f82a5[_0x69e6('0x34')]+_0x2f82a5['limit'];var _0x4b56d1;if(_0x56e075>=_0x224556){_0x56e075=_0x224556;_0x4b56d1=0xc8;}else{_0x4b56d1=0xce;}_0x325e02[_0x69e6('0x2e')](_0x4b56d1);return _0x325e02[_0x69e6('0x35')](_0x69e6('0x36'),_0x33e373+'-'+_0x56e075+'/'+_0x224556)[_0x69e6('0x30')](_0x2a0d28);}return null;};}function patchUpdates(_0x23cbd8){return function(_0x300208){try{jsonpatch[_0x69e6('0x37')](_0x300208,_0x23cbd8,!![]);}catch(_0x18d399){return BPromise[_0x69e6('0x38')](_0x18d399);}return _0x300208[_0x69e6('0x39')]();};}function saveUpdates(_0x35d139,_0x3fb1cc){return function(_0xd9bcfe){if(_0xd9bcfe){return _0xd9bcfe[_0x69e6('0x3a')](_0x35d139)[_0x69e6('0x23')](function(_0xffbdc2){return _0xffbdc2;});}return null;};}function removeEntity(_0x430f64,_0x412260){return function(_0x3f24f0){if(_0x3f24f0){return _0x3f24f0['destroy']()[_0x69e6('0x23')](function(){var _0x107fc1=_0x3f24f0[_0x69e6('0x3b')]({'plain':!![]});var _0x3a3f86=_0x69e6('0x3c');return db['UserProfileResource'][_0x69e6('0x3d')]({'where':{'type':_0x3a3f86,'resourceId':_0x107fc1['id']}})[_0x69e6('0x23')](function(){return _0x3f24f0;});})[_0x69e6('0x23')](function(){_0x430f64[_0x69e6('0x2e')](0xcc)[_0x69e6('0x2f')]();});}};}function handleEntityNotFound(_0x1816b5,_0x1b374a){return function(_0x14b320){if(!_0x14b320){_0x1816b5[_0x69e6('0x2d')](0x194);}return _0x14b320;};}function handleError(_0x455f6b,_0x12fbdc){_0x12fbdc=_0x12fbdc||0x1f4;return function(_0x55100b){logger[_0x69e6('0x28')](_0x55100b[_0x69e6('0x3e')]);if(_0x55100b[_0x69e6('0x3f')]){delete _0x55100b[_0x69e6('0x3f')];}_0x455f6b[_0x69e6('0x2e')](_0x12fbdc)[_0x69e6('0x40')](_0x55100b);};}exports['index']=function(_0x34eb65,_0x257cc7){var _0x4ff9f6={'include':[{'model':db[_0x69e6('0x41')],'as':'mandatoryDispositionPause'}]},_0x34ddd6={},_0x3ba0c8={'count':0x0,'rows':[]};var _0x4d1997=_[_0x69e6('0x42')](db['ChatWebsite'][_0x69e6('0x43')],function(_0x3e4f20){return{'name':_0x3e4f20[_0x69e6('0x44')],'type':_0x3e4f20[_0x69e6('0x45')][_0x69e6('0x46')]};});_0x34ddd6[_0x69e6('0x47')]=_['map'](_0x4d1997,_0x69e6('0x3f'));_0x34ddd6[_0x69e6('0x48')]=_[_0x69e6('0x49')](_0x34eb65[_0x69e6('0x48')]);_0x34ddd6[_0x69e6('0x4a')]=_[_0x69e6('0x4b')](_0x34ddd6['model'],_0x34ddd6[_0x69e6('0x48')]);_0x4ff9f6[_0x69e6('0x4c')]=_[_0x69e6('0x4b')](_0x34ddd6[_0x69e6('0x47')],qs[_0x69e6('0x4d')](_0x34eb65['query'][_0x69e6('0x4d')]));_0x4ff9f6['attributes']=_0x4ff9f6[_0x69e6('0x4c')][_0x69e6('0x4e')]?_0x4ff9f6['attributes']:_0x34ddd6[_0x69e6('0x47')];if(!_0x34eb65[_0x69e6('0x48')]['hasOwnProperty'](_0x69e6('0x4f'))){_0x4ff9f6[_0x69e6('0x32')]=qs[_0x69e6('0x32')](_0x34eb65[_0x69e6('0x48')][_0x69e6('0x32')]);_0x4ff9f6[_0x69e6('0x34')]=qs['offset'](_0x34eb65[_0x69e6('0x48')][_0x69e6('0x34')]);}_0x4ff9f6['order']=qs[_0x69e6('0x50')](_0x34eb65[_0x69e6('0x48')][_0x69e6('0x50')]);_0x4ff9f6[_0x69e6('0x51')]=qs[_0x69e6('0x4a')](_[_0x69e6('0x52')](_0x34eb65[_0x69e6('0x48')],_0x34ddd6[_0x69e6('0x4a')]),_0x4d1997);if(_0x34eb65[_0x69e6('0x48')][_0x69e6('0x53')]){_0x4ff9f6['where']=_['merge'](_0x4ff9f6['where'],{'$or':_[_0x69e6('0x42')](_0x4d1997,function(_0x23a52a){if(_0x23a52a['type']!==_0x69e6('0x54')){var _0x5cffe5={};_0x5cffe5[_0x23a52a[_0x69e6('0x3f')]]={'$like':'%'+_0x34eb65[_0x69e6('0x48')][_0x69e6('0x53')]+'%'};return _0x5cffe5;}})});}_0x4ff9f6=_[_0x69e6('0x55')]({},_0x4ff9f6,_0x34eb65[_0x69e6('0x56')]);var _0x131724={'where':_0x4ff9f6['where']};return db[_0x69e6('0x57')]['count'](_0x131724)[_0x69e6('0x23')](function(_0x410045){_0x3ba0c8[_0x69e6('0x33')]=_0x410045;if(_0x34eb65[_0x69e6('0x48')]['includeAll']){_0x4ff9f6[_0x69e6('0x58')]=[{'all':!![]}];}return db[_0x69e6('0x57')][_0x69e6('0x59')](_0x4ff9f6);})[_0x69e6('0x23')](function(_0x2a8175){_0x3ba0c8[_0x69e6('0x5a')]=_0x2a8175;return _0x3ba0c8;})[_0x69e6('0x23')](respondWithFilteredResult(_0x257cc7,_0x4ff9f6))['catch'](handleError(_0x257cc7,null));};exports[_0x69e6('0x5b')]=function(_0xde850d,_0x36a0f7){var _0x31a172={'raw':![],'where':{'id':_0xde850d[_0x69e6('0x5c')]['id']},'include':[{'model':db[_0x69e6('0x41')],'as':'mandatoryDispositionPause'}]},_0x35ac24={};_0x35ac24[_0x69e6('0x47')]=_[_0x69e6('0x49')](db[_0x69e6('0x57')][_0x69e6('0x43')]);_0x35ac24[_0x69e6('0x48')]=_[_0x69e6('0x49')](_0xde850d['query']);_0x35ac24[_0x69e6('0x4a')]=_[_0x69e6('0x4b')](_0x35ac24['model'],_0x35ac24['query']);_0x31a172['attributes']=_[_0x69e6('0x4b')](_0x35ac24[_0x69e6('0x47')],qs[_0x69e6('0x4d')](_0xde850d[_0x69e6('0x48')][_0x69e6('0x4d')]));_0x31a172[_0x69e6('0x4c')]=_0x31a172[_0x69e6('0x4c')][_0x69e6('0x4e')]?_0x31a172[_0x69e6('0x4c')]:_0x35ac24[_0x69e6('0x47')];if(_0xde850d['query'][_0x69e6('0x5d')]){_0x31a172[_0x69e6('0x58')]=[{'all':!![]}];}_0x31a172=_[_0x69e6('0x55')]({},_0x31a172,_0xde850d[_0x69e6('0x56')]);return db['ChatWebsite'][_0x69e6('0x5e')](_0x31a172)[_0x69e6('0x23')](handleEntityNotFound(_0x36a0f7,null))[_0x69e6('0x23')](respondWithResult(_0x36a0f7,null))['catch'](handleError(_0x36a0f7,null));};exports[_0x69e6('0x5f')]=function(_0x23ac0e,_0x4ab3c8){return db[_0x69e6('0x57')][_0x69e6('0x5f')](_0x23ac0e[_0x69e6('0x60')],{})[_0x69e6('0x23')](function(_0x19174e){var _0x2bc126=_0x23ac0e['user']['get']({'plain':!![]});if(!_0x2bc126)throw new Error(_0x69e6('0x61'));if(_0x2bc126['role']===_0x69e6('0x62')){var _0x491371=_0x19174e[_0x69e6('0x3b')]({'plain':!![]});var _0x2aa8e5=_0x69e6('0x3c');return db[_0x69e6('0x63')][_0x69e6('0x5e')]({'where':{'name':_0x2aa8e5,'userProfileId':_0x2bc126['userProfileId']},'raw':!![]})[_0x69e6('0x23')](function(_0x45614e){if(_0x45614e&&_0x45614e[_0x69e6('0x64')]===0x0){return db[_0x69e6('0x65')][_0x69e6('0x5f')]({'name':_0x491371[_0x69e6('0x3f')],'resourceId':_0x491371['id'],'type':_0x45614e[_0x69e6('0x3f')],'sectionId':_0x45614e['id']},{})[_0x69e6('0x23')](function(){return _0x19174e;});}else{return _0x19174e;}})['catch'](function(_0xa292a){logger[_0x69e6('0x28')](_0x69e6('0x66'),_0xa292a);throw _0xa292a;});}return _0x19174e;})[_0x69e6('0x23')](respondWithResult(_0x4ab3c8,0xc9))['catch'](handleError(_0x4ab3c8,null));};exports[_0x69e6('0x3a')]=function(_0x5c4a83,_0x5e7afb){if(_0x5c4a83[_0x69e6('0x60')]['id']){delete _0x5c4a83[_0x69e6('0x60')]['id'];}return db[_0x69e6('0x57')][_0x69e6('0x5e')]({'where':{'id':_0x5c4a83[_0x69e6('0x5c')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0x69e6('0x23')](handleEntityNotFound(_0x5e7afb,null))['then'](saveUpdates(_0x5c4a83[_0x69e6('0x60')],null))[_0x69e6('0x23')](respondWithResult(_0x5e7afb,null))[_0x69e6('0x2c')](handleError(_0x5e7afb,null));};exports[_0x69e6('0x3d')]=function(_0x134a2b,_0x4940a4){return db['ChatWebsite'][_0x69e6('0x5e')]({'where':{'id':_0x134a2b[_0x69e6('0x5c')]['id']}})[_0x69e6('0x23')](handleEntityNotFound(_0x4940a4,null))[_0x69e6('0x23')](removeEntity(_0x4940a4,null))['catch'](handleError(_0x4940a4,null));};exports[_0x69e6('0x67')]=function(_0x5ba207,_0x44af05){return db[_0x69e6('0x57')]['describe']()[_0x69e6('0x23')](respondWithResult(_0x44af05,null))[_0x69e6('0x2c')](handleError(_0x44af05,null));};exports[_0x69e6('0x68')]=function(_0x279c22,_0x36faa8,_0x3ff3d3){if(_0x279c22[_0x69e6('0x60')]['id']){delete _0x279c22['body']['id'];}return db[_0x69e6('0x57')][_0x69e6('0x5e')]({'where':{'id':_0x279c22[_0x69e6('0x5c')]['id']}})['then'](handleEntityNotFound(_0x36faa8,null))[_0x69e6('0x23')](function(_0x543bdf){if(_0x543bdf){_0x279c22[_0x69e6('0x60')]['ChatWebsiteId']=_0x543bdf['id'];return db['Disposition'][_0x69e6('0x5f')](_0x279c22[_0x69e6('0x60')]);}})[_0x69e6('0x23')](respondWithResult(_0x36faa8,null))[_0x69e6('0x2c')](handleError(_0x36faa8,null));};exports['getDispositions']=function(_0x3f30e7,_0x4bea2e,_0xccf9bf){var _0xdb491a={'raw':![],'where':{}};var _0x241b86={};var _0x35116f={'count':0x0,'rows':[]};return db[_0x69e6('0x57')]['findOne']({'where':{'id':_0x3f30e7[_0x69e6('0x5c')]['id']}})[_0x69e6('0x23')](handleEntityNotFound(_0x4bea2e,null))['then'](function(_0xad3a20){if(_0xad3a20){_0x241b86[_0x69e6('0x47')]=_['keys'](db['Disposition'][_0x69e6('0x43')]);_0x241b86[_0x69e6('0x48')]=_['keys'](_0x3f30e7['query']);_0x241b86[_0x69e6('0x4a')]=_[_0x69e6('0x4b')](_0x241b86[_0x69e6('0x47')],_0x241b86[_0x69e6('0x48')]);_0xdb491a[_0x69e6('0x4c')]=_[_0x69e6('0x4b')](_0x241b86['model'],qs[_0x69e6('0x4d')](_0x3f30e7['query'][_0x69e6('0x4d')]));_0xdb491a[_0x69e6('0x4c')]=_0xdb491a[_0x69e6('0x4c')][_0x69e6('0x4e')]?_0xdb491a[_0x69e6('0x4c')]:_0x241b86[_0x69e6('0x47')];if(!_0x3f30e7[_0x69e6('0x48')][_0x69e6('0x69')](_0x69e6('0x4f'))){_0xdb491a[_0x69e6('0x32')]=qs[_0x69e6('0x32')](_0x3f30e7['query'][_0x69e6('0x32')]);_0xdb491a[_0x69e6('0x34')]=qs[_0x69e6('0x34')](_0x3f30e7[_0x69e6('0x48')]['offset']);}_0xdb491a[_0x69e6('0x6a')]=qs[_0x69e6('0x50')](_0x3f30e7[_0x69e6('0x48')][_0x69e6('0x50')]);_0xdb491a[_0x69e6('0x51')]=qs[_0x69e6('0x4a')](_[_0x69e6('0x52')](_0x3f30e7[_0x69e6('0x48')],_0x241b86['filters']));_0xdb491a[_0x69e6('0x51')][_0x69e6('0x6b')]=_0xad3a20['id'];if(_0x3f30e7[_0x69e6('0x48')][_0x69e6('0x53')]){_0xdb491a[_0x69e6('0x51')]=_[_0x69e6('0x55')](_0xdb491a[_0x69e6('0x51')],{'$or':_[_0x69e6('0x42')](_0xdb491a[_0x69e6('0x4c')],function(_0x39bf68){var _0x286eba={};_0x286eba[_0x39bf68]={'$like':'%'+_0x3f30e7[_0x69e6('0x48')]['filter']+'%'};return _0x286eba;})});}_0xdb491a=_[_0x69e6('0x55')]({},_0xdb491a,_0x3f30e7[_0x69e6('0x56')]);return db[_0x69e6('0x6c')]['count']({'where':_0xdb491a[_0x69e6('0x51')]})[_0x69e6('0x23')](function(_0x129e6b){_0x35116f[_0x69e6('0x33')]=_0x129e6b;if(_0x3f30e7['query']['includeAll']){_0xdb491a[_0x69e6('0x58')]=[{'all':!![]}];}return db[_0x69e6('0x6c')]['findAll'](_0xdb491a);})['then'](function(_0xb6476b){_0x35116f['rows']=_0xb6476b;return _0x35116f;});}})['then'](respondWithFilteredResult(_0x4bea2e,_0xdb491a))[_0x69e6('0x2c')](handleError(_0x4bea2e,null));};exports[_0x69e6('0x6d')]=function(_0x47eea2,_0xac1e6d,_0x195042){return db['ChatWebsite'][_0x69e6('0x5e')]({'where':{'id':_0x47eea2['params']['id']}})[_0x69e6('0x23')](handleEntityNotFound(_0xac1e6d,null))[_0x69e6('0x23')](function(_0x5a8d98){if(_0x5a8d98){return _0x5a8d98[_0x69e6('0x6d')](_0x47eea2[_0x69e6('0x48')][_0x69e6('0x6e')]);}})['then'](respondWithStatusCode(_0xac1e6d,null))[_0x69e6('0x2c')](handleError(_0xac1e6d,null));};exports['addAnswer']=function(_0x5249a1,_0x2e8923,_0x49d516){if(_0x5249a1['body']['id']){delete _0x5249a1['body']['id'];}return db[_0x69e6('0x57')][_0x69e6('0x5e')]({'where':{'id':_0x5249a1[_0x69e6('0x5c')]['id']}})[_0x69e6('0x23')](handleEntityNotFound(_0x2e8923,null))[_0x69e6('0x23')](function(_0x22926){if(_0x22926){_0x5249a1[_0x69e6('0x60')][_0x69e6('0x6b')]=_0x22926['id'];return db[_0x69e6('0x6f')][_0x69e6('0x5f')](_0x5249a1[_0x69e6('0x60')]);}})[_0x69e6('0x23')](respondWithResult(_0x2e8923,null))[_0x69e6('0x2c')](handleError(_0x2e8923,null));};exports[_0x69e6('0x70')]=function(_0x30cd2f,_0x3815a2,_0x2f8102){var _0xaf48db={'raw':![],'where':{}};var _0x428aac={};var _0x510bd6={'count':0x0,'rows':[]};return db[_0x69e6('0x57')][_0x69e6('0x71')]({'where':{'id':_0x30cd2f[_0x69e6('0x5c')]['id']}})[_0x69e6('0x23')](handleEntityNotFound(_0x3815a2,null))['then'](function(_0x454ed6){if(_0x454ed6){_0x428aac['model']=_[_0x69e6('0x49')](db['CannedAnswer'][_0x69e6('0x43')]);_0x428aac[_0x69e6('0x48')]=_['keys'](_0x30cd2f[_0x69e6('0x48')]);_0x428aac[_0x69e6('0x4a')]=_['intersection'](_0x428aac[_0x69e6('0x47')],_0x428aac['query']);_0xaf48db[_0x69e6('0x4c')]=_[_0x69e6('0x4b')](_0x428aac[_0x69e6('0x47')],qs[_0x69e6('0x4d')](_0x30cd2f['query'][_0x69e6('0x4d')]));_0xaf48db[_0x69e6('0x4c')]=_0xaf48db[_0x69e6('0x4c')][_0x69e6('0x4e')]?_0xaf48db[_0x69e6('0x4c')]:_0x428aac['model'];if(!_0x30cd2f[_0x69e6('0x48')][_0x69e6('0x69')](_0x69e6('0x4f'))){_0xaf48db[_0x69e6('0x32')]=qs[_0x69e6('0x32')](_0x30cd2f['query'][_0x69e6('0x32')]);_0xaf48db['offset']=qs[_0x69e6('0x34')](_0x30cd2f['query'][_0x69e6('0x34')]);}_0xaf48db[_0x69e6('0x6a')]=qs[_0x69e6('0x50')](_0x30cd2f[_0x69e6('0x48')][_0x69e6('0x50')]);_0xaf48db[_0x69e6('0x51')]=qs[_0x69e6('0x4a')](_['pick'](_0x30cd2f[_0x69e6('0x48')],_0x428aac[_0x69e6('0x4a')]));_0xaf48db[_0x69e6('0x51')]['ChatWebsiteId']=_0x454ed6['id'];if(_0x30cd2f[_0x69e6('0x48')][_0x69e6('0x53')]){_0xaf48db['where']=_[_0x69e6('0x55')](_0xaf48db[_0x69e6('0x51')],{'$or':_['map'](_0xaf48db[_0x69e6('0x4c')],function(_0x29f9a1){var _0x203366={};_0x203366[_0x29f9a1]={'$like':'%'+_0x30cd2f['query']['filter']+'%'};return _0x203366;})});}_0xaf48db=_[_0x69e6('0x55')]({},_0xaf48db,_0x30cd2f[_0x69e6('0x56')]);return db[_0x69e6('0x6f')][_0x69e6('0x33')]({'where':_0xaf48db[_0x69e6('0x51')]})[_0x69e6('0x23')](function(_0x29d8ca){_0x510bd6[_0x69e6('0x33')]=_0x29d8ca;if(_0x30cd2f[_0x69e6('0x48')][_0x69e6('0x5d')]){_0xaf48db[_0x69e6('0x58')]=[{'all':!![]}];}return db[_0x69e6('0x6f')][_0x69e6('0x59')](_0xaf48db);})[_0x69e6('0x23')](function(_0x3cb6e3){_0x510bd6[_0x69e6('0x5a')]=_0x3cb6e3;return _0x510bd6;});}})[_0x69e6('0x23')](respondWithFilteredResult(_0x3815a2,_0xaf48db))[_0x69e6('0x2c')](handleError(_0x3815a2,null));};exports[_0x69e6('0x72')]=function(_0x2647bf,_0x137876,_0x35614b){return db['ChatWebsite']['find']({'where':{'id':_0x2647bf[_0x69e6('0x5c')]['id']}})[_0x69e6('0x23')](handleEntityNotFound(_0x137876,null))[_0x69e6('0x23')](function(_0x5d4002){if(_0x5d4002){return _0x5d4002['removeAnswers'](_0x2647bf[_0x69e6('0x48')]['ids']);}})[_0x69e6('0x23')](respondWithStatusCode(_0x137876,null))['catch'](handleError(_0x137876,null));};exports[_0x69e6('0x73')]=function(_0x76a517,_0xbbb7f0,_0x4b43cc){_0x76a517[_0x69e6('0x60')][_0x69e6('0x74')]=_0x76a517['file']['filename'];return db[_0x69e6('0x57')][_0x69e6('0x5e')]({'where':{'id':_0x76a517['params']['id']}})['then'](handleEntityNotFound(_0xbbb7f0,null))['then'](saveUpdates(_0x76a517[_0x69e6('0x60')],null))[_0x69e6('0x23')](respondWithResult(_0xbbb7f0,null))['catch'](handleError(_0xbbb7f0,null));};exports[_0x69e6('0x75')]=function(_0x168caf,_0x2dac45,_0x3387da){_0x168caf['body'][_0x69e6('0x76')]=_0x168caf[_0x69e6('0x77')]['filename'];return db[_0x69e6('0x57')][_0x69e6('0x5e')]({'where':{'id':_0x168caf[_0x69e6('0x5c')]['id']}})[_0x69e6('0x23')](handleEntityNotFound(_0x2dac45,null))[_0x69e6('0x23')](saveUpdates(_0x168caf['body'],null))['then'](respondWithResult(_0x2dac45,null))['catch'](handleError(_0x2dac45,null));};exports['addCustomerAvatar']=function(_0x4639fb,_0x3acfef,_0x5a164c){_0x4639fb[_0x69e6('0x60')][_0x69e6('0x78')]=_0x4639fb[_0x69e6('0x77')][_0x69e6('0x79')];return db[_0x69e6('0x57')][_0x69e6('0x5e')]({'where':{'id':_0x4639fb['params']['id']}})[_0x69e6('0x23')](handleEntityNotFound(_0x3acfef,null))[_0x69e6('0x23')](saveUpdates(_0x4639fb['body'],null))['then'](respondWithResult(_0x3acfef,null))['catch'](handleError(_0x3acfef,null));};exports[_0x69e6('0x7a')]=function(_0x52325d,_0x509577,_0x19980e){_0x52325d[_0x69e6('0x60')][_0x69e6('0x7b')]=_0x52325d[_0x69e6('0x77')][_0x69e6('0x79')];return db[_0x69e6('0x57')][_0x69e6('0x5e')]({'where':{'id':_0x52325d[_0x69e6('0x5c')]['id']}})['then'](handleEntityNotFound(_0x509577,null))[_0x69e6('0x23')](saveUpdates(_0x52325d[_0x69e6('0x60')],null))[_0x69e6('0x23')](respondWithResult(_0x509577,null))[_0x69e6('0x2c')](handleError(_0x509577,null));};exports['getLogo']=function(_0x4c7346,_0xf684e8,_0x56d07c){var _0x1340ea=path[_0x69e6('0x7c')](config[_0x69e6('0x7d')],_0x69e6('0x7e'));var _0x61c17e={'where':{'id':_0x4c7346[_0x69e6('0x5c')]['id']},'attributes':['id',_0x69e6('0x74')],'raw':!![]};var _0x30e3a1=![];return require(_0x69e6('0x19'))[_0x69e6('0x7f')]()[_0x69e6('0x23')](function(_0x3b764b){if(_0x3b764b){_0x30e3a1=_0x3b764b[_0x69e6('0x80')];}})['then'](function(){return db['ChatWebsite'][_0x69e6('0x5e')](_0x61c17e);})[_0x69e6('0x23')](handleEntityNotFound(_0xf684e8,null))[_0x69e6('0x23')](function(_0x18bf0e){if(_0x18bf0e){if(!_[_0x69e6('0x81')](_0x18bf0e[_0x69e6('0x74')])){if(fs[_0x69e6('0x82')](path[_0x69e6('0x7c')](config[_0x69e6('0x7d')],'server/files/images/logos/',_0x18bf0e[_0x69e6('0x74')]))&&_0x30e3a1){_0x1340ea=path[_0x69e6('0x7c')](config[_0x69e6('0x7d')],_0x69e6('0x83'),_0x18bf0e['sitepic']);}}return _0xf684e8['download'](_0x1340ea);}})[_0x69e6('0x2c')](handleError(_0xf684e8,null));};exports[_0x69e6('0x84')]=function(_0x4184b9,_0x37b1e9,_0x2d4521){var _0x7d5217=path['join'](config[_0x69e6('0x7d')],_0x69e6('0x85'));var _0xedc90c={'where':{'id':_0x4184b9[_0x69e6('0x5c')]['id']},'attributes':['id',_0x69e6('0x76')],'raw':!![]};return db['ChatWebsite']['find'](_0xedc90c)[_0x69e6('0x23')](handleEntityNotFound(_0x37b1e9,null))[_0x69e6('0x23')](function(_0x23a9b6){if(_0x23a9b6){if(!_[_0x69e6('0x81')](_0x23a9b6[_0x69e6('0x76')])){if(fs['existsSync'](path[_0x69e6('0x7c')](config[_0x69e6('0x7d')],'server/files/images/avatars/',_0x23a9b6[_0x69e6('0x76')]))){_0x7d5217=path[_0x69e6('0x7c')](config[_0x69e6('0x7d')],_0x69e6('0x86'),_0x23a9b6['agentAvatar']);}}return _0x37b1e9[_0x69e6('0x87')](_0x7d5217);}})['catch'](handleError(_0x37b1e9,null));};exports['getCustomerAvatar']=function(_0x16b205,_0x1cb150,_0x260a8f){var _0xcc28eb=path[_0x69e6('0x7c')](config[_0x69e6('0x7d')],_0x69e6('0x88'));var _0x4af6fd={'where':{'id':_0x16b205[_0x69e6('0x5c')]['id']},'attributes':['id',_0x69e6('0x78'),_0x69e6('0x89')],'raw':!![]};return db['ChatWebsite'][_0x69e6('0x5e')](_0x4af6fd)[_0x69e6('0x23')](handleEntityNotFound(_0x1cb150,null))[_0x69e6('0x23')](function(_0x470482){if(_0x470482){if(!_['isNil'](_0x470482[_0x69e6('0x78')])){if(fs['existsSync'](path[_0x69e6('0x7c')](config[_0x69e6('0x7d')],_0x69e6('0x86'),_0x470482['customerAvatar']))&&_0x470482[_0x69e6('0x89')]){_0xcc28eb=path[_0x69e6('0x7c')](config[_0x69e6('0x7d')],_0x69e6('0x86'),_0x470482[_0x69e6('0x78')]);}}return _0x1cb150[_0x69e6('0x87')](_0xcc28eb);}})['catch'](handleError(_0x1cb150,null));};exports[_0x69e6('0x8a')]=function(_0x3a3ac8,_0x29bad2,_0x41edbf){var _0x15e1b3=path[_0x69e6('0x7c')](config[_0x69e6('0x7d')],_0x69e6('0x8b'));var _0x4b24a6={'where':{'id':_0x3a3ac8[_0x69e6('0x5c')]['id']},'attributes':['id',_0x69e6('0x7b')],'raw':!![]};return db[_0x69e6('0x57')][_0x69e6('0x5e')](_0x4b24a6)[_0x69e6('0x23')](handleEntityNotFound(_0x29bad2,null))[_0x69e6('0x23')](function(_0x2005ec){if(_0x2005ec){if(!_[_0x69e6('0x81')](_0x2005ec[_0x69e6('0x7b')])){if(fs[_0x69e6('0x82')](path['join'](config[_0x69e6('0x7d')],_0x69e6('0x86'),_0x2005ec[_0x69e6('0x7b')]))){_0x15e1b3=path['join'](config[_0x69e6('0x7d')],_0x69e6('0x86'),_0x2005ec[_0x69e6('0x7b')]);}}return _0x29bad2['download'](_0x15e1b3);}})[_0x69e6('0x2c')](handleError(_0x29bad2,null));};exports['notify']=function(_0x3db9e8,_0x977483,_0x556850){var _0x107162=require(_0x69e6('0x8c'));var _0x483b39=new _0x107162();var _0x24f0fb=_0x483b39[_0x69e6('0x8d')](_0x3db9e8[_0x69e6('0x8e')][_0x69e6('0x8f')])[_0x69e6('0x90')]();var _0x58e1e3={'body':_0x3db9e8[_0x69e6('0x60')],'channel':'chat'};var _0x167f27=[];var _0x3046a8=[];var _0x34fd40={};var _0x306995=![];return db['CmContact'][_0x69e6('0x67')]()['then'](function(_0x35eff4){if(!_0x35eff4){throw new db[(_0x69e6('0x91'))][(_0x69e6('0x92'))]('no\x20available\x20attributes');}_0x167f27=_['difference'](_[_0x69e6('0x49')](_0x35eff4),[_0x69e6('0x93'),_0x69e6('0x94')]);_0x3046a8=_[_0x69e6('0x95')](_[_0x69e6('0x49')](_0x35eff4),[_0x69e6('0x93'),_0x69e6('0x94'),_0x69e6('0x96'),_0x69e6('0x97')]);if(_0x3db9e8['body']['id']){delete _0x3db9e8[_0x69e6('0x60')]['id'];}if(_[_0x69e6('0x81')](_0x3db9e8[_0x69e6('0x60')][_0x69e6('0x98')])){throw new db['Sequelize'][(_0x69e6('0x92'))](_0x69e6('0x99'));}if(_[_0x69e6('0x81')](_0x3db9e8[_0x69e6('0x60')][_0x69e6('0x60')])||_0x3db9e8['body'][_0x69e6('0x60')]===''){throw new db[(_0x69e6('0x91'))][(_0x69e6('0x92'))](_0x69e6('0x9a'));}if(_['isNil'](_0x3db9e8['body'][_0x69e6('0x9b')])){throw new db[(_0x69e6('0x91'))][(_0x69e6('0x92'))](_0x69e6('0x9c')+_0x3046a8);}if(!_[_0x69e6('0x9d')](_0x3046a8,_0x3db9e8[_0x69e6('0x60')][_0x69e6('0x9b')])){throw new db['Sequelize'][(_0x69e6('0x92'))](_0x69e6('0x9e')+_0x3046a8);}_0x34fd40[_0x3db9e8[_0x69e6('0x60')][_0x69e6('0x9b')]]=_0x3db9e8['body'][_0x69e6('0x98')];})[_0x69e6('0x23')](function(){return db[_0x69e6('0x57')][_0x69e6('0x5e')]({'where':{'id':_0x3db9e8[_0x69e6('0x5c')]['id']},'include':[{'model':db[_0x69e6('0x9f')],'as':_0x69e6('0xa0'),'include':[{'model':db[_0x69e6('0xa1')],'as':_0x69e6('0xa2'),'where':_0x34fd40,'limit':0x1,'order':[[_0x69e6('0x94'),_0x69e6('0xa3')]]}]},{'model':db[_0x69e6('0xa4')],'as':_0x69e6('0xa5')}]});})[_0x69e6('0x23')](handleEntityNotFound(_0x977483,null))[_0x69e6('0x23')](function(_0xf6fe21){if(_0xf6fe21&&_0xf6fe21[_0x69e6('0xa0')]){_0x58e1e3['account']=_0xf6fe21;_0x58e1e3[_0x69e6('0xa6')]=_0xf6fe21[_0x69e6('0xa5')];_0x58e1e3[_0x69e6('0xa7')]=_0xf6fe21[_0x69e6('0xa0')];_0x58e1e3[_0x69e6('0xa6')]=_['orderBy'](_0x58e1e3[_0x69e6('0xa6')],[_0x69e6('0xa8')],[_0x69e6('0xa9')]);if(_0x58e1e3[_0x69e6('0xaa')][_0x69e6('0xa5')]){delete _0x58e1e3['account'][_0x69e6('0xa5')];}if(_0x58e1e3[_0x69e6('0xaa')][_0x69e6('0xa0')]&&_0x58e1e3[_0x69e6('0xaa')]['List'][_0x69e6('0xa2')][_0x69e6('0x4e')]){return _0x58e1e3['account'][_0x69e6('0xa0')]['Contacts'][0x0];}var _0x3bcb36=_[_0x69e6('0x1b')](_0x3db9e8[_0x69e6('0x60')],{'firstName':_0x3db9e8['body'][_0x69e6('0x98')],'ListId':_0xf6fe21['ListId']});_0x3bcb36[_0x3db9e8['body'][_0x69e6('0x9b')]]=_0x3db9e8[_0x69e6('0x60')][_0x69e6('0x98')];return db['CmContact'][_0x69e6('0x5f')](_0x3bcb36,{'fields':_0x167f27,'raw':!![]});}})['then'](handleEntityNotFound(_0x977483,null))['then'](function(_0x4fabe5){_0x58e1e3['contact']=_0x4fabe5;var _0x5cb752=_0x3db9e8['body'][_0x69e6('0xab')];if(_0x3db9e8[_0x69e6('0x8e')][_0x69e6('0xac')]){_0x5cb752=_0x3db9e8[_0x69e6('0x8e')][_0x69e6('0xac')];}else if(_0x3db9e8[_0x69e6('0x8e')][_0x69e6('0xad')]){_0x5cb752=_[_0x69e6('0xae')](_0x3db9e8['headers'][_0x69e6('0xad')][_0x69e6('0xaf')](','));}if(_0x4fabe5){var _0xc480d1={'ContactId':_0x4fabe5['id'],'ChatWebsiteId':_0x3db9e8[_0x69e6('0x5c')]['id'],'from':(_0x4fabe5[_0x69e6('0xb0')]||'')+'\x20'+(_0x4fabe5['lastName']||''),'customerIp':_0x5cb752,'customerPort':_0x3db9e8[_0x69e6('0x8e')][_0x69e6('0xb1')]?_0x3db9e8[_0x69e6('0x8e')][_0x69e6('0xb1')]:null,'referer':_0x3db9e8[_0x69e6('0x60')][_0x69e6('0xb2')],'browserName':_0x24f0fb[_0x69e6('0xb3')][_0x69e6('0x3f')]&&_0x24f0fb[_0x69e6('0xb3')][_0x69e6('0xb4')]?util['format']('%s\x20%s',_0x24f0fb['browser'][_0x69e6('0x3f')],_0x24f0fb[_0x69e6('0xb3')][_0x69e6('0xb4')]):'unknown','browserVersion':_0x24f0fb[_0x69e6('0xb3')][_0x69e6('0xb4')]||'unknown','osName':util[_0x69e6('0xb5')]('%s\x20%s',_0x24f0fb['os']['name'],_0x24f0fb['os']['version']),'osVersion':_0x24f0fb['os'][_0x69e6('0xb4')],'deviceModel':_0x24f0fb[_0x69e6('0xb6')][_0x69e6('0x47')]&&_0x24f0fb['device'][_0x69e6('0xb7')]?util['format']('%s\x20%s\x20%s',_0x24f0fb[_0x69e6('0xb6')][_0x69e6('0x47')],_0x24f0fb['device'][_0x69e6('0xb7')],_0x24f0fb['device'][_0x69e6('0x45')]):null,'deviceVendor':_0x24f0fb[_0x69e6('0xb6')][_0x69e6('0xb7')],'deviceType':_0x24f0fb[_0x69e6('0xb6')]['type'],'formData':JSON[_0x69e6('0xb8')](_0x3db9e8['body'])};var _0x4682b0={'ChatWebsiteId':_0x3db9e8[_0x69e6('0x5c')]['id'],'closed':![]};if(_0x3db9e8[_0x69e6('0x60')][_0x69e6('0xb9')]){_0x4682b0[_0x69e6('0xb9')]=_0x3db9e8['body'][_0x69e6('0xb9')];return db[_0x69e6('0xba')]['find']({'where':_0x4682b0})['then'](function(_0x2a65d5){if(_0x2a65d5){return[_0x2a65d5,![]];}_0xc480d1['threadId']=_0x3db9e8[_0x69e6('0x60')][_0x69e6('0xb9')];_0xc480d1[_0x69e6('0xbb')]=_0x3db9e8[_0x69e6('0x60')]['externalUrl'];return db['ChatInteraction']['create'](_0xc480d1)['then'](function(_0x4f7e4b){return[_0x4f7e4b,!![]];});});}_0x4682b0['ContactId']=_0x4fabe5['id'];if(_0x3db9e8[_0x69e6('0x60')][_0x69e6('0xbc')]&&_0x3db9e8[_0x69e6('0x60')][_0x69e6('0xbc')]['id']){_0x4682b0['id']=_0x3db9e8[_0x69e6('0x60')]['interaction']['id'];return db[_0x69e6('0xba')][_0x69e6('0x5e')]({'where':_0x4682b0})[_0x69e6('0x23')](function(_0x5a515b){if(_0x5a515b){return[_0x5a515b,![]];}return db['ChatInteraction'][_0x69e6('0x5f')](_0xc480d1)[_0x69e6('0x23')](function(_0x2b8035){return[_0x2b8035,!![]];});});}return db[_0x69e6('0xba')]['create'](_0xc480d1)[_0x69e6('0x23')](function(_0x5673c3){return[_0x5673c3,!![]];});}})[_0x69e6('0xbd')](function(_0x47befc,_0x35f5b){if(_0x47befc){_0x306995=_0x35f5b;if(!_0x35f5b){var _0x1e6f8e={'from':(_0x58e1e3[_0x69e6('0xbe')]['firstName']||'')+'\x20'+(_0x58e1e3[_0x69e6('0xbe')][_0x69e6('0xbf')]||'')};if(_0x3db9e8[_0x69e6('0x60')][_0x69e6('0xb9')]&&_0x3db9e8[_0x69e6('0x60')][_0x69e6('0xc0')]&&_0x3db9e8[_0x69e6('0x60')][_0x69e6('0xb9')]!=_0x3db9e8[_0x69e6('0x60')][_0x69e6('0xc0')]){_0x1e6f8e[_0x69e6('0xb9')]=_0x3db9e8[_0x69e6('0x60')][_0x69e6('0xc0')];}return _0x47befc['update'](_0x1e6f8e);}else{return _0x47befc;}}})[_0x69e6('0x23')](function(_0x177665){_0x58e1e3[_0x69e6('0xbc')]=_0x177665[_0x69e6('0x3b')]({'plain':!![]});_0x58e1e3[_0x69e6('0xbc')][_0x69e6('0xc1')]=_0x306995;if(_0x58e1e3[_0x69e6('0xbc')][_0x69e6('0xc1')]){if(_0x58e1e3[_0x69e6('0xaa')][_0x69e6('0xc2')]){_0x58e1e3['applications'][_0x69e6('0xc3')]({'id':0x0,'priority':_0x58e1e3[_0x69e6('0xa6')]['length']+0x1,'app':_0x69e6('0xc4'),'appdata':_0x69e6('0xc5'),'interval':_0x69e6('0xc6')});}}return db[_0x69e6('0xc7')][_0x69e6('0x5f')]({'body':_0x3db9e8[_0x69e6('0x60')][_0x69e6('0x60')],'ChatWebsiteId':_0x3db9e8[_0x69e6('0x5c')]['id'],'ChatInteractionId':_0x177665['id'],'direction':'in','ContactId':_0x58e1e3[_0x69e6('0xbe')]['id'],'AttachmentId':_0x3db9e8[_0x69e6('0x60')][_0x69e6('0xc8')]});})[_0x69e6('0x23')](function(_0x2c2284){_0x58e1e3[_0x69e6('0x2b')]=_0x2c2284;if(_0x58e1e3[_0x69e6('0xbc')][_0x69e6('0xc9')]){return db['User'][_0x69e6('0x5e')]({'attributes':['id','name'],'where':{'id':_0x58e1e3[_0x69e6('0xbc')][_0x69e6('0xc9')]}})['then'](function(_0x440211){if(_0x440211){_0x58e1e3[_0x69e6('0xa6')]['unshift']({'id':0x0,'priority':0x0,'app':_0x69e6('0xca'),'appdata':_0x440211[_0x69e6('0x3f')]+','+(_0x58e1e3['account'][_0x69e6('0xcb')]||0xa),'interval':_0x69e6('0xc6')});_0x58e1e3[_0x69e6('0xcc')]=!![];}return respondWithRpcPromise(_0x69e6('0xcd'),_0x69e6('0xce'),_0x58e1e3);});}return respondWithRpcPromise('Start',_0x69e6('0xce'),_0x58e1e3);})[_0x69e6('0x23')](function(_0x4e1140){respondWithRpcPromise('EventManager',_0x69e6('0xcf'),{'event':_0x69e6('0xd0'),'message':_0x4e1140},client9002);return _0x4e1140;})[_0x69e6('0x23')](respondWithResult(_0x977483,null))[_0x69e6('0x2c')](handleError(_0x977483,null));};exports[_0x69e6('0xd1')]=function(_0x14711d,_0x3ae1a8,_0x588c7a){var _0x4dbe0d,_0x2bca83,_0xe1c2f;var _0xbfd52d=[];var _0xfde647=[];var _0x3eea26={};var _0x5bc06a=_0x14711d[_0x69e6('0xd2')]||[];var _0x374e14=[];var _0x4cc70a;return db[_0x69e6('0xa1')][_0x69e6('0x67')]()[_0x69e6('0x23')](function(_0x89c40b){if(!_0x89c40b){throw new db[(_0x69e6('0x91'))][(_0x69e6('0x92'))]('no\x20available\x20attributes');}_0xfde647=_[_0x69e6('0x95')](_[_0x69e6('0x49')](_0x89c40b),[_0x69e6('0x93'),'updatedAt']);_0xbfd52d=_['difference'](_[_0x69e6('0x49')](_0x89c40b),['createdAt',_0x69e6('0x94'),_0x69e6('0x96'),_0x69e6('0x97')]);if(_0x14711d[_0x69e6('0x60')]['id']){delete _0x14711d[_0x69e6('0x60')]['id'];}if(_[_0x69e6('0x81')](_0x14711d[_0x69e6('0x60')][_0x69e6('0x98')])){throw _0x3ae1a8['status'](0x1f4)[_0x69e6('0x40')](new db[(_0x69e6('0x91'))][(_0x69e6('0x92'))](_0x69e6('0x99')));}if(_[_0x69e6('0x81')](_0x14711d[_0x69e6('0x60')][_0x69e6('0x60')])||_0x14711d[_0x69e6('0x60')][_0x69e6('0x60')]===''){throw _0x3ae1a8[_0x69e6('0x2e')](0x1f4)[_0x69e6('0x40')](new db[(_0x69e6('0x91'))]['ValidationError'](_0x69e6('0x9a')));}if(_[_0x69e6('0x81')](_0x14711d[_0x69e6('0x60')][_0x69e6('0xd3')])){throw _0x3ae1a8[_0x69e6('0x2e')](0x1f4)[_0x69e6('0x40')](new db[(_0x69e6('0x91'))][(_0x69e6('0x92'))](_0x69e6('0xd4')+_0xbfd52d));}if(!_[_0x69e6('0x9d')](_0xbfd52d,_0x14711d[_0x69e6('0x60')][_0x69e6('0xd3')])){throw _0x3ae1a8['status'](0x1f4)[_0x69e6('0x40')](new db['Sequelize'][(_0x69e6('0x92'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0xbfd52d));}_0x3eea26[_0x14711d[_0x69e6('0x60')][_0x69e6('0xd3')]]=_0x14711d[_0x69e6('0x60')][_0x69e6('0x98')];})[_0x69e6('0x23')](function(){return db[_0x69e6('0x57')][_0x69e6('0x5e')]({'where':{'id':_0x14711d['params']['id']},'include':[{'model':db[_0x69e6('0x9f')],'as':_0x69e6('0xa0')},{'model':db[_0x69e6('0xd5')],'as':_0x69e6('0xd5')}]});})[_0x69e6('0x23')](handleEntityNotFound(_0x3ae1a8,null))['then'](function(_0x236ccf){if(_0x236ccf&&_0x236ccf[_0x69e6('0xa0')]){_0x2bca83=_0x236ccf;var _0x8b052a=_[_0x69e6('0x1b')](_0x14711d[_0x69e6('0x60')],{'firstName':_0x14711d[_0x69e6('0x60')]['from'],'phone':_0x14711d[_0x69e6('0x60')][_0x69e6('0x98')],'ListId':_0x236ccf['ListId']});_0x8b052a[_0x14711d[_0x69e6('0x60')][_0x69e6('0xd3')]]=_0x14711d['body'][_0x69e6('0x98')];return db[_0x69e6('0xa1')][_0x69e6('0xd6')]({'where':_0x3eea26,'defaults':_0x8b052a});}})[_0x69e6('0xbd')](function(_0x14565d){if(_0x14565d){_0xe1c2f=_0x14565d;var _0x24566e=fs[_0x69e6('0xd7')](path[_0x69e6('0x7c')](config[_0x69e6('0x7d')],_0x69e6('0xd8')),_0x69e6('0xd9'));var _0x2002e3=ejs['render'](_0x24566e,{'body':_['toPairs'](_0x14711d[_0x69e6('0x60')]['body']),'bodyTitle':_0x2bca83['offlineMessageBody']});return db[_0x69e6('0xda')][_0x69e6('0x5f')]({'body':_0x2002e3,'ContactId':_0x14565d['id'],'ChatWebsiteId':_0x2bca83['id']});}})[_0x69e6('0x23')](function(_0x59b7d8){_0x4cc70a=_0x59b7d8;if(_0x5bc06a[_0x69e6('0x4e')]){var _0xdd4223=_0x5bc06a[_0x69e6('0x42')](function(_0x98eff2){return{'name':_0x98eff2[_0x69e6('0xdb')],'basename':_0x98eff2[_0x69e6('0x79')],'type':_0x98eff2['mimetype'],'ChatOfflineMessageId':_0x59b7d8['id']};});_0x374e14=_0xdd4223[_0x69e6('0x42')](_0x31f0b7=>{var _0x3b2a7d={'filename':_0x31f0b7[_0x69e6('0x3f')],'path':path['join'](config[_0x69e6('0x7d')],_0x69e6('0xdc'),_0x69e6('0xd2'),_0x69e6('0xdd'),_0x69e6('0xde'),_0x31f0b7['basename'])};return _0x3b2a7d;});if(!_0x2bca83[_0x69e6('0xdf')]){return db['sequelize'][_0x69e6('0xe0')](function(_0x9a649c){return db['Attachment'][_0x69e6('0xe1')](_0xdd4223,{'transaction':_0x9a649c});});}}})[_0x69e6('0x23')](function(){if(_0x4cc70a){_0x4dbe0d=_0x4cc70a;return db[_0x69e6('0xd5')][_0x69e6('0x71')]({'where':{'active':!![]},'include':[{'model':db[_0x69e6('0xe2')],'as':_0x69e6('0xe3'),'raw':!![]}]});}})[_0x69e6('0x23')](function(_0x58a4b5){if(_0x58a4b5&&_0x58a4b5['Smtp']&&_0x2bca83[_0x69e6('0xe4')]&&_0x2bca83['forwardOfflineAddress']){var _0x3703cc={'tls':{'rejectUnauthorized':![]}};if(_0x58a4b5[_0x69e6('0xe3')][_0x69e6('0xe5')]){_0x3703cc[_0x69e6('0xe5')]=_0x58a4b5[_0x69e6('0xe3')][_0x69e6('0xe5')];}else{_0x3703cc[_0x69e6('0xe6')]=_0x58a4b5[_0x69e6('0xe3')][_0x69e6('0xe6')];_0x3703cc[_0x69e6('0xe7')]=_0x58a4b5[_0x69e6('0xe3')][_0x69e6('0xe7')];_0x3703cc[_0x69e6('0xe8')]=_0x58a4b5[_0x69e6('0xe3')][_0x69e6('0xe8')];}if(_0x58a4b5[_0x69e6('0xe3')][_0x69e6('0xe9')]){_0x3703cc[_0x69e6('0xea')]={'user':_0x58a4b5[_0x69e6('0xe3')][_0x69e6('0x62')],'pass':_0x58a4b5[_0x69e6('0xe3')][_0x69e6('0xeb')]};}return respondWithRpcPromise(_0x69e6('0xec'),'sendMail',{'account':_0x3703cc,'message':{'from':util['format'](_0x69e6('0xed'),_0x58a4b5[_0x69e6('0x3f')],_0x58a4b5[_0x69e6('0xee')]||_0x58a4b5[_0x69e6('0xe3')][_0x69e6('0x62')]),'to':_0x2bca83[_0x69e6('0xef')],'subject':_0x2bca83[_0x69e6('0xf0')],'html':_0x4dbe0d['body'],'attachments':_0x374e14}},client9003)[_0x69e6('0x23')](function(){return _0x4dbe0d;})[_0x69e6('0x2c')](function(_0x4e99f2){console[_0x69e6('0x28')](_0x4e99f2);});}})[_0x69e6('0x23')](function(){if(_0x2bca83&&_0x2bca83[_0x69e6('0xdf')]&&_0x2bca83[_0x69e6('0xf1')]){var _0x24e058=[];if(_0x5bc06a[_0x69e6('0x4e')]){_0x24e058=_0x5bc06a[_0x69e6('0x42')](function(_0x9a14b0){return{'name':_0x9a14b0[_0x69e6('0xdb')],'basename':_0x9a14b0[_0x69e6('0x79')],'type':_0x9a14b0['mimetype'],'ChatOfflineMessageId':_0x4cc70a['id']};});}var _0x575add;if(!_['isNil'](_0x2bca83['subjectOffline'])){var _0x3fc22f=_['map'](_0x14711d[_0x69e6('0x60')],function(_0x384ddb){return _0x384ddb;});var _0x8df699=_['toPairsIn'](_0x3fc22f)[0x0];var _0x44ff60=_[_0x69e6('0xf2')](_0x8df699,function(_0x777a8){return _0x777a8;});_0x575add=_0x44ff60[0x1][_0x2bca83[_0x69e6('0xf3')]];}var _0x299056={'from':_0xe1c2f[_0x69e6('0xee')],'firstName':_0xe1c2f[_0x69e6('0xb0')],'lastName':_0xe1c2f['lastName'],'mapKey':_0x69e6('0xee'),'message':{'from':_0xe1c2f[_0x69e6('0xee')],'to':_0x2bca83[_0x69e6('0xd5')][_0x69e6('0xee')],'cc':'','subject':_[_0x69e6('0x81')](_0x575add)?_0x2bca83[_0x69e6('0xf0')]:_0x575add,'messageId':'','sentAt':new Date(),'attach':_0x24e058[_0x69e6('0x4e')],'attachments':_0x24e058,'originChannel':'Chat','ChatWebsiteId':_0x2bca83['id'],'ChatOfflineMessageId':_0x4dbe0d['id'],'originTo':_0x2bca83[_0x69e6('0xd5')][_0x69e6('0xee')]},'body':_0x4dbe0d['body']};var _0xf955d6={'account':{'id':_0x2bca83['MailAccountId']},'body':_0x299056,'log':_0x69e6('0xf4')};return respondWithRpcPromise(_0x69e6('0xf4'),_0x69e6('0xf5'),_0xf955d6,client9001)['then'](function(){return _0x4dbe0d;})[_0x69e6('0x2c')](function(_0x2fe7f5){console[_0x69e6('0x28')](_0x2fe7f5);});}return;})[_0x69e6('0x23')](function(){if(_0x4dbe0d){return _0x4dbe0d;}})[_0x69e6('0x23')](respondWithResult(_0x3ae1a8,null))[_0x69e6('0x2c')](function(_0xaa9ebd){console['error'](_0x69e6('0x2c'),_0xaa9ebd);for(var _0x455b82 of _0x5bc06a){var _0x270d49=path[_0x69e6('0x7c')](config['root'],_0x69e6('0xdc'),_0x69e6('0xd2'),_0x69e6('0xdd'),_0x69e6('0xde'),_0x455b82['filename']);fs_extra[_0x69e6('0xf6')](_0x270d49)[_0x69e6('0x2c')](function(_0x453f85){console[_0x69e6('0x28')](_0x69e6('0xf7'),_0x270d49,_0x453f85);});}});};exports[_0x69e6('0xf8')]=function(_0x3d2d29,_0xd6261,_0x2eeea6){return db['ChatInteraction'][_0x69e6('0x5e')]({'where':{'id':_0x3d2d29[_0x69e6('0x5c')]['id']}})[_0x69e6('0x23')](handleEntityNotFound(_0xd6261,null))[_0x69e6('0x23')](function(_0x4fc29d){if(_0x4fc29d){return _0x4fc29d[_0x69e6('0xf8')](_0x3d2d29[_0x69e6('0x60')][_0x69e6('0x6e')],_[_0x69e6('0xf9')](_0x3d2d29[_0x69e6('0x60')],[_0x69e6('0x6e'),'id'])||{});}})['then'](respondWithResult(_0xd6261,null))[_0x69e6('0x2c')](handleError(_0xd6261,null));};exports['getInteractions']=function(_0x580efb,_0xce22d2,_0x17e4e8){var _0x1cba53={'raw':![],'where':{}};var _0x323a05={};var _0xf84ba6={'count':0x0,'rows':[]};return db[_0x69e6('0x57')][_0x69e6('0x71')]({'where':{'id':_0x580efb[_0x69e6('0x5c')]['id']}})[_0x69e6('0x23')](handleEntityNotFound(_0xce22d2,null))[_0x69e6('0x23')](function(_0x2fd3a5){if(_0x2fd3a5){_0x323a05['model']=_[_0x69e6('0x49')](db[_0x69e6('0xba')]['rawAttributes']);_0x323a05['query']=_[_0x69e6('0x49')](_0x580efb[_0x69e6('0x48')]);_0x323a05['filters']=_[_0x69e6('0x4b')](_0x323a05[_0x69e6('0x47')],_0x323a05[_0x69e6('0x48')]);_0x1cba53['attributes']=_[_0x69e6('0x4b')](_0x323a05[_0x69e6('0x47')],qs[_0x69e6('0x4d')](_0x580efb[_0x69e6('0x48')][_0x69e6('0x4d')]));_0x1cba53['attributes']=_0x1cba53[_0x69e6('0x4c')][_0x69e6('0x4e')]?_0x1cba53['attributes']:_0x323a05[_0x69e6('0x47')];if(!_0x580efb[_0x69e6('0x48')][_0x69e6('0x69')](_0x69e6('0x4f'))){_0x1cba53[_0x69e6('0x32')]=qs[_0x69e6('0x32')](_0x580efb[_0x69e6('0x48')]['limit']);_0x1cba53[_0x69e6('0x34')]=qs['offset'](_0x580efb['query'][_0x69e6('0x34')]);}_0x1cba53[_0x69e6('0x6a')]=qs[_0x69e6('0x50')](_0x580efb[_0x69e6('0x48')][_0x69e6('0x50')]);_0x1cba53[_0x69e6('0x51')]=qs[_0x69e6('0x4a')](_[_0x69e6('0x52')](_0x580efb[_0x69e6('0x48')],_0x323a05['filters']));_0x1cba53['where'][_0x69e6('0x6b')]=_0x2fd3a5['id'];if(_0x580efb[_0x69e6('0x48')][_0x69e6('0x53')]){_0x1cba53[_0x69e6('0x51')]=_[_0x69e6('0x55')](_0x1cba53[_0x69e6('0x51')],{'$or':_[_0x69e6('0x42')](_0x1cba53[_0x69e6('0x4c')],function(_0x1177ca){var _0x304ae7={};_0x304ae7[_0x1177ca]={'$like':'%'+_0x580efb['query'][_0x69e6('0x53')]+'%'};return _0x304ae7;})});}_0x1cba53=_[_0x69e6('0x55')]({},_0x1cba53,_0x580efb[_0x69e6('0x56')]);return db[_0x69e6('0xba')][_0x69e6('0x33')]({'where':_0x1cba53[_0x69e6('0x51')]})[_0x69e6('0x23')](function(_0x3bc27a){_0xf84ba6[_0x69e6('0x33')]=_0x3bc27a;if(_0x580efb[_0x69e6('0x48')][_0x69e6('0x5d')]){_0x1cba53['include']=[{'model':db[_0x69e6('0xa1')],'as':_0x69e6('0xfa'),'required':![]},{'model':db['User'],'as':_0x69e6('0xfb'),'attributes':[_0x69e6('0x3f'),_0x69e6('0xfc'),_0x69e6('0xfd')],'required':![]},{'model':db[_0x69e6('0xfe')],'as':_0x69e6('0xff'),'attributes':['id',_0x69e6('0x3f'),_0x69e6('0x100')],'where':_0x580efb['query'][_0x69e6('0x101')]?{'id':_0x580efb[_0x69e6('0x48')][_0x69e6('0x101')]}:undefined,'required':_0x580efb['query']['tag']?!![]:![]}];}return db[_0x69e6('0xba')][_0x69e6('0x59')](_0x1cba53);})[_0x69e6('0x23')](function(_0x9bbea2){_0xf84ba6[_0x69e6('0x5a')]=_0x9bbea2;return _0xf84ba6;});}})['then'](respondWithFilteredResult(_0xce22d2,_0x1cba53))['catch'](handleError(_0xce22d2,null));};function iftimePromise(_0x409de0,_0x28d8b7){return respondWithRpcPromise(_0x69e6('0x102'),_0x69e6('0x103'),{'command':_0x28d8b7['timezone']?util[_0x69e6('0xb5')](_0x69e6('0x104'),_0x409de0[_0x69e6('0x105')],_0x28d8b7[_0x69e6('0x106')]):util[_0x69e6('0xb5')](_0x69e6('0x107'),_0x409de0[_0x69e6('0x105')])},client9002)['then'](function(_0x68ef87){var _0x51e833=_0x68ef87&&_0x68ef87[_0x69e6('0x108')](_0x69e6('0x109'))>=0x0?!![]:![];logger[_0x69e6('0x24')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x28d8b7['id'],_0x409de0['id'],_0x409de0[_0x69e6('0x105')],_0x51e833?'ONLINE':_0x69e6('0x10a'),_0x28d8b7[_0x69e6('0x106')]?_0x28d8b7[_0x69e6('0x106')]:_0x69e6('0x10b'));return _0x51e833;})[_0x69e6('0x2c')](function(_0x27a3e1){logger[_0x69e6('0x28')](_0x69e6('0x10c'),_0x28d8b7['id'],_0x409de0['id'],_0x409de0['interval'],util['inspect'](_0x27a3e1,{'showHidden':![],'depth':null}),_0x28d8b7[_0x69e6('0x106')]?_0x28d8b7['timezone']:_0x69e6('0x10b'));return![];});}exports[_0x69e6('0x103')]=function(_0x1b2da7,_0x40c676,_0x32546d){var _0x304f58=0x0;var _0x3f3518=0x0;var _0x6784d9=![];var _0x1802bf;var _0x190130;return db[_0x69e6('0x57')][_0x69e6('0x5e')]({'where':{'id':_0x1b2da7['params']['id']},'include':[{'model':db['Interval'],'as':'Interval','include':[{'model':db[_0x69e6('0x10d')],'as':_0x69e6('0x10e'),'attributes':['id','interval'],'raw':!![]}]}]})[_0x69e6('0x23')](handleEntityNotFound(_0x40c676,null))[_0x69e6('0x23')](function(_0x59ba3e){if(_0x59ba3e){_0x1802bf=_0x59ba3e;return _0x59ba3e[_0x69e6('0x10f')]({'raw':!![]});}})[_0x69e6('0x23')](function(_0x1ed46e){if(_0x1802bf){if(_0x1ed46e){_0x190130=_0x1ed46e;}}return require('../../config/license/util')[_0x69e6('0x7f')]();})[_0x69e6('0x23')](function(_0x96e83){if(_0x96e83){_0x3f3518=_0x96e83[_0x69e6('0x110')];_0x6784d9=_0x96e83['custom'];}})[_0x69e6('0x23')](function(){return db[_0x69e6('0xba')]['count']({'where':{'closed':![]}});})[_0x69e6('0x23')](function(_0xbd7889){_0x304f58=_0xbd7889;if(_0x3f3518&&_0xbd7889>_0x3f3518){return db[_0x69e6('0x111')][_0x69e6('0x71')]({'where':{'id':0x1}})[_0x69e6('0x23')](function(_0x220ac3){if(_0x220ac3){_0x220ac3[_0x69e6('0x112')](_0x69e6('0x113'));}});}})[_0x69e6('0x23')](function(){if(_0x1802bf[_0x69e6('0x10d')]&&_0x1802bf[_0x69e6('0x10d')][_0x69e6('0x10e')]){var _0x2ffa35=[];for(var _0x27b5d1=0x0;_0x27b5d1<_0x1802bf['Interval'][_0x69e6('0x10e')]['length'];_0x27b5d1++){var _0x1f791f=_0x1802bf[_0x69e6('0x10d')]['Intervals'][_0x27b5d1][_0x69e6('0x3b')]({'plain':!![]});_0x2ffa35[_0x69e6('0xc3')](iftimePromise(_0x1f791f,_0x1802bf));}return BPromise[_0x69e6('0x114')](_0x2ffa35)[_0x69e6('0x23')](function(_0x4971cc){return _[_0x69e6('0x115')](_0x4971cc);});}else{return!![];}})[_0x69e6('0x23')](function(_0x138834){var _0x4a828b=fs[_0x69e6('0xd7')](path[_0x69e6('0x7c')](config['root'],_0x69e6('0x116')),_0x69e6('0xd9'));var _0x24b5ee={'remote':_0x1802bf[_0x69e6('0x117')],'query':querystring[_0x69e6('0xb8')](_[_0x69e6('0x55')](_0x1802bf['get']({'plain':!![]}),{'customerIp':_0x1b2da7['headers'][_0x69e6('0xad')]||_0x1b2da7[_0x69e6('0x8e')][_0x69e6('0x118')]||_0x1b2da7[_0x69e6('0x119')]['remoteAddress']||_0x1b2da7['ip'],'referer':_0x1b2da7[_0x69e6('0x8e')]['referer'],'openedInteractions':_0x304f58,'maxInteractions':_0x3f3518,'virtual':_0x6784d9['virtual'],'online':_0x138834,'custom':_0x6784d9}))['replace'](/'/g,'\x5c\x27')};_0x40c676[_0x69e6('0x40')](ejs[_0x69e6('0x11a')](Mustache[_0x69e6('0x11a')](_0x4a828b,_0x24b5ee),{'proactiveActions':_0x190130,'alignment':_0x1802bf[_0x69e6('0x11b')],'verticalAlignment':_0x1802bf[_0x69e6('0x11c')],'div_color':_0x1802bf[_0x69e6('0x100')],'text_color':_0x1802bf[_0x69e6('0x11d')],'button_color':_0x1802bf[_0x69e6('0x11e')],'background_color':_0x1802bf[_0x69e6('0x11f')]}));})[_0x69e6('0x2c')](handleError(_0x40c676,null));};exports['addApplications']=function(_0x3990b1,_0x49d4f1,_0x4e25b1){return db[_0x69e6('0x57')][_0x69e6('0x71')]({'where':{'id':_0x3990b1[_0x69e6('0x5c')]['id']}})[_0x69e6('0x23')](handleEntityNotFound(_0x49d4f1,null))[_0x69e6('0x23')](function(_0x127c16){if(_0x127c16){return db[_0x69e6('0x120')][_0x69e6('0xe0')](function(_0x2fca5a){return db[_0x69e6('0xa4')][_0x69e6('0x3d')]({'where':{'ChatWebsiteId':_0x3990b1['params']['id']},'transaction':_0x2fca5a})[_0x69e6('0x23')](function(_0x480eb9){var _0x5b8fda=_[_0x69e6('0x42')](_0x3990b1[_0x69e6('0x60')],function(_0x54cef1){_0x54cef1[_0x69e6('0x6b')]=_0x3990b1[_0x69e6('0x5c')]['id'];return _0x54cef1;});return db[_0x69e6('0xa4')][_0x69e6('0xe1')](_0x5b8fda,{'transaction':_0x2fca5a});});})[_0x69e6('0x23')](function(){return db[_0x69e6('0xa4')][_0x69e6('0x121')]({'where':{'ChatWebsiteId':_0x3990b1[_0x69e6('0x5c')]['id']},'order':_0x69e6('0xa8')});});}})['then'](respondWithResult(_0x49d4f1,null))['catch'](handleError(_0x49d4f1,null));};exports[_0x69e6('0x122')]=function(_0x51461f,_0x4c731e,_0x5c1519){var _0x551f80={};var _0x5b6301={};var _0x2766ef;var _0x441afa;return db['ChatWebsite'][_0x69e6('0x71')]({'where':{'id':_0x51461f[_0x69e6('0x5c')]['id']}})[_0x69e6('0x23')](handleEntityNotFound(_0x4c731e,null))[_0x69e6('0x23')](function(_0x146cb7){if(_0x146cb7){_0x2766ef=_0x146cb7;_0x5b6301[_0x69e6('0x47')]=_[_0x69e6('0x49')](db[_0x69e6('0xa4')][_0x69e6('0x43')]);_0x5b6301[_0x69e6('0x48')]=_[_0x69e6('0x49')](_0x51461f[_0x69e6('0x48')]);_0x5b6301[_0x69e6('0x4a')]=_[_0x69e6('0x4b')](_0x5b6301['model'],_0x5b6301[_0x69e6('0x48')]);_0x551f80[_0x69e6('0x4c')]=_[_0x69e6('0x4b')](_0x5b6301[_0x69e6('0x47')],qs[_0x69e6('0x4d')](_0x51461f[_0x69e6('0x48')][_0x69e6('0x4d')]));_0x551f80[_0x69e6('0x4c')]=_0x551f80[_0x69e6('0x4c')][_0x69e6('0x4e')]?_0x551f80[_0x69e6('0x4c')]:_0x5b6301[_0x69e6('0x47')];_0x551f80[_0x69e6('0x6a')]=qs[_0x69e6('0x50')](_0x51461f[_0x69e6('0x48')][_0x69e6('0x50')]);_0x551f80[_0x69e6('0x51')]=qs[_0x69e6('0x4a')](_[_0x69e6('0x52')](_0x51461f[_0x69e6('0x48')],_0x5b6301[_0x69e6('0x4a')]));if(_0x51461f['query']['filter']){_0x551f80[_0x69e6('0x51')]=_[_0x69e6('0x55')](_0x551f80[_0x69e6('0x51')],{'$or':_['map'](_0x551f80[_0x69e6('0x4c')],function(_0x4ff373){var _0x4a6426={};_0x4a6426[_0x4ff373]={'$like':'%'+_0x51461f[_0x69e6('0x48')]['filter']+'%'};return _0x4a6426;})});}_0x551f80=_[_0x69e6('0x55')]({},_0x551f80,_0x51461f[_0x69e6('0x56')]);return _0x2766ef[_0x69e6('0x122')](_0x551f80);}})[_0x69e6('0x23')](function(_0x234947){if(_0x234947){_0x441afa=_0x234947[_0x69e6('0x4e')];if(!_0x51461f[_0x69e6('0x48')][_0x69e6('0x69')]('nolimit')){_0x551f80['limit']=qs[_0x69e6('0x32')](_0x51461f[_0x69e6('0x48')][_0x69e6('0x32')]);_0x551f80[_0x69e6('0x34')]=qs['offset'](_0x51461f['query'][_0x69e6('0x34')]);}return _0x2766ef[_0x69e6('0x122')](_0x551f80);}})[_0x69e6('0x23')](function(_0x36b899){if(_0x36b899){return _0x36b899?{'count':_0x441afa,'rows':_0x36b899}:null;}})[_0x69e6('0x23')](respondWithResult(_0x4c731e,null))[_0x69e6('0x2c')](handleError(_0x4c731e,null));};exports[_0x69e6('0x123')]=function(_0x5ee987,_0x43a7ad,_0x3cf5c0){return db['chatProactiveAction']['find']({'where':{'id':_0x5ee987['params']['id']}})['then'](handleEntityNotFound(_0x43a7ad,null))[_0x69e6('0x23')](function(_0x2f86ce){if(_0x2f86ce){return _0x2f86ce['addProactiveActions'](_0x5ee987[_0x69e6('0x60')]['ids'],_[_0x69e6('0xf9')](_0x5ee987[_0x69e6('0x60')],[_0x69e6('0x6e'),'id'])||{});}})[_0x69e6('0x23')](respondWithResult(_0x43a7ad,null))[_0x69e6('0x2c')](handleError(_0x43a7ad,null));};exports[_0x69e6('0x10f')]=function(_0x3b62dc,_0xe01ad1,_0x1f8b89){var _0x3ba0ab={};var _0x2ed910={};var _0x89385e;var _0x3188e7;return db[_0x69e6('0x57')][_0x69e6('0x71')]({'where':{'id':_0x3b62dc['params']['id']}})['then'](handleEntityNotFound(_0xe01ad1,null))[_0x69e6('0x23')](function(_0x3dc04b){if(_0x3dc04b){_0x89385e=_0x3dc04b;_0x2ed910[_0x69e6('0x47')]=_['keys'](db['ChatProactiveAction'][_0x69e6('0x43')]);_0x2ed910[_0x69e6('0x48')]=_[_0x69e6('0x49')](_0x3b62dc['query']);_0x2ed910[_0x69e6('0x4a')]=_[_0x69e6('0x4b')](_0x2ed910['model'],_0x2ed910[_0x69e6('0x48')]);_0x3ba0ab[_0x69e6('0x4c')]=_[_0x69e6('0x4b')](_0x2ed910[_0x69e6('0x47')],qs[_0x69e6('0x4d')](_0x3b62dc[_0x69e6('0x48')]['fields']));_0x3ba0ab[_0x69e6('0x4c')]=_0x3ba0ab[_0x69e6('0x4c')]['length']?_0x3ba0ab['attributes']:_0x2ed910[_0x69e6('0x47')];_0x3ba0ab[_0x69e6('0x6a')]=qs['sort'](_0x3b62dc[_0x69e6('0x48')]['sort']);_0x3ba0ab['where']=qs[_0x69e6('0x4a')](_[_0x69e6('0x52')](_0x3b62dc[_0x69e6('0x48')],_0x2ed910[_0x69e6('0x4a')]));if(_0x3b62dc[_0x69e6('0x48')][_0x69e6('0x53')]){_0x3ba0ab[_0x69e6('0x51')]=_['merge'](_0x3ba0ab[_0x69e6('0x51')],{'$or':_['map'](_0x3ba0ab[_0x69e6('0x4c')],function(_0x5805f1){var _0x1ba4e5={};_0x1ba4e5[_0x5805f1]={'$like':'%'+_0x3b62dc[_0x69e6('0x48')][_0x69e6('0x53')]+'%'};return _0x1ba4e5;})});}_0x3ba0ab=_['merge']({},_0x3ba0ab,_0x3b62dc['options']);return _0x89385e[_0x69e6('0x10f')](_0x3ba0ab);}})[_0x69e6('0x23')](function(_0x33755d){if(_0x33755d){_0x3188e7=_0x33755d[_0x69e6('0x4e')];if(!_0x3b62dc['query'][_0x69e6('0x69')]('nolimit')){_0x3ba0ab[_0x69e6('0x32')]=qs[_0x69e6('0x32')](_0x3b62dc[_0x69e6('0x48')]['limit']);_0x3ba0ab[_0x69e6('0x34')]=qs[_0x69e6('0x34')](_0x3b62dc['query'][_0x69e6('0x34')]);}return _0x89385e[_0x69e6('0x10f')](_0x3ba0ab);}})['then'](function(_0x3e55fe){if(_0x3e55fe){return _0x3e55fe?{'count':_0x3188e7,'rows':_0x3e55fe}:null;}})['then'](respondWithResult(_0xe01ad1,null))[_0x69e6('0x2c')](handleError(_0xe01ad1,null));};exports[_0x69e6('0x124')]=function(_0x3eea3f,_0x109c46,_0x32ca76){var _0x8cab25=_0x3eea3f['query'][_0x69e6('0x125')]===_0x69e6('0x126')?_0x69e6('0x127'):'onlineForm';return db['ChatWebsite']['find']({'attributes':['id',_0x8cab25],'where':{'id':_0x3eea3f[_0x69e6('0x5c')]['id']}})['then'](handleEntityNotFound(_0x109c46,null))['then'](function(_0x483fbc){if(_0x483fbc){var _0x1ae2b9=_0x483fbc[_0x8cab25];var _0x1265f8=_0x1ae2b9&&_0x1ae2b9[_0x69e6('0x128')]?_0x1ae2b9[_0x69e6('0x128')]:[];_0x109c46[_0x69e6('0x40')]({'fromKey':_[_0x69e6('0x81')](_0x1ae2b9[_0x69e6('0x129')])?undefined:_0x1ae2b9[_0x69e6('0x129')],'count':_0x1265f8[_0x69e6('0x4e')],'rows':_0x1265f8});}})[_0x69e6('0x2c')](handleError(_0x109c46,null));};exports['getOfflineMessages']=function(_0x4e4c82,_0x336576,_0x26a293){var _0x3c465b={'raw':![],'where':{}};var _0x22ad7b={};var _0x6e26c2={'count':0x0,'rows':[]};return db[_0x69e6('0x57')][_0x69e6('0x71')]({'where':{'id':_0x4e4c82[_0x69e6('0x5c')]['id']}})[_0x69e6('0x23')](handleEntityNotFound(_0x336576,null))[_0x69e6('0x23')](function(_0x21f7ad){if(_0x21f7ad){_0x22ad7b['model']=_['keys'](db[_0x69e6('0xda')][_0x69e6('0x43')]);_0x22ad7b[_0x69e6('0x48')]=_[_0x69e6('0x49')](_0x4e4c82[_0x69e6('0x48')]);_0x22ad7b['filters']=_[_0x69e6('0x4b')](_0x22ad7b['model'],_0x22ad7b['query']);_0x3c465b['attributes']=_['intersection'](_0x22ad7b[_0x69e6('0x47')],qs[_0x69e6('0x4d')](_0x4e4c82[_0x69e6('0x48')][_0x69e6('0x4d')]));_0x3c465b[_0x69e6('0x4c')]=_0x3c465b[_0x69e6('0x4c')]['length']?_0x3c465b[_0x69e6('0x4c')]:_0x22ad7b[_0x69e6('0x47')];if(!_0x4e4c82['query'][_0x69e6('0x69')]('nolimit')){_0x3c465b['limit']=qs[_0x69e6('0x32')](_0x4e4c82[_0x69e6('0x48')][_0x69e6('0x32')]);_0x3c465b[_0x69e6('0x34')]=qs[_0x69e6('0x34')](_0x4e4c82[_0x69e6('0x48')][_0x69e6('0x34')]);}_0x3c465b[_0x69e6('0x6a')]=qs['sort'](_0x4e4c82['query'][_0x69e6('0x50')]);_0x3c465b[_0x69e6('0x51')]=qs[_0x69e6('0x4a')](_[_0x69e6('0x52')](_0x4e4c82[_0x69e6('0x48')],_0x22ad7b[_0x69e6('0x4a')]));_0x3c465b[_0x69e6('0x51')][_0x69e6('0x6b')]=_0x21f7ad['id'];if(_0x4e4c82[_0x69e6('0x48')]['filter']){_0x3c465b[_0x69e6('0x51')]=_['merge'](_0x3c465b['where'],{'$or':_['map'](_0x3c465b[_0x69e6('0x4c')],function(_0x909d2f){var _0x6b4a8f={};_0x6b4a8f[_0x909d2f]={'$like':'%'+_0x4e4c82[_0x69e6('0x48')][_0x69e6('0x53')]+'%'};return _0x6b4a8f;})});}_0x3c465b=_['merge']({},_0x3c465b,_0x4e4c82[_0x69e6('0x56')]);return db[_0x69e6('0xda')][_0x69e6('0x33')]({'where':_0x3c465b[_0x69e6('0x51')]})[_0x69e6('0x23')](function(_0x3a4a61){_0x6e26c2[_0x69e6('0x33')]=_0x3a4a61;if(_0x4e4c82[_0x69e6('0x48')][_0x69e6('0x5d')]){_0x3c465b[_0x69e6('0x58')]=[{'all':!![]}];}else{_0x3c465b[_0x69e6('0x58')]=[{'model':db[_0x69e6('0xa1')],'as':_0x69e6('0xfa'),'required':![]},{'model':db[_0x69e6('0x12a')],'as':_0x69e6('0x12b'),'required':![]}];}return db[_0x69e6('0xda')][_0x69e6('0x59')](_0x3c465b);})['then'](function(_0x13bc99){_0x6e26c2['rows']=_0x13bc99;return _0x6e26c2;});}})['then'](respondWithFilteredResult(_0x336576,_0x3c465b))[_0x69e6('0x2c')](handleError(_0x336576,null));};exports['addAgents']=function(_0x396091,_0x32241f,_0x21c83c){return db[_0x69e6('0x57')]['find']({'where':{'id':_0x396091[_0x69e6('0x5c')]['id']}})[_0x69e6('0x23')](handleEntityNotFound(_0x32241f,null))[_0x69e6('0x23')](function(_0x1ef2f9){if(_0x1ef2f9){return _0x1ef2f9[_0x69e6('0x12c')](_0x396091['body'][_0x69e6('0x6e')],_[_0x69e6('0xf9')](_0x396091['body'],[_0x69e6('0x6e'),'id'])||{})[_0x69e6('0xbd')](function(_0x1b82e3){for(var _0x1f8a34=0x0;_0x1f8a34<_0x396091[_0x69e6('0x60')][_0x69e6('0x6e')]['length'];_0x1f8a34+=0x1){socket['emit'](_0x69e6('0x12d'),{'UserId':Number(_0x396091[_0x69e6('0x60')][_0x69e6('0x6e')][_0x1f8a34]),'ChatWebsiteId':Number(_0x396091['params']['id'])});}return _0x1b82e3;});}})[_0x69e6('0x23')](respondWithResult(_0x32241f,null))[_0x69e6('0x2c')](handleError(_0x32241f,null));};exports['removeAgents']=function(_0x5cae8e,_0x531c77,_0x1e39e5){return db[_0x69e6('0x57')]['find']({'where':{'id':_0x5cae8e[_0x69e6('0x5c')]['id']}})['then'](handleEntityNotFound(_0x531c77,null))['then'](function(_0x3a753f){if(_0x3a753f){return _0x3a753f[_0x69e6('0x12e')](_0x5cae8e['query']['ids'])['then'](function(){if(_[_0x69e6('0x12f')](_0x5cae8e[_0x69e6('0x48')][_0x69e6('0x6e')])){for(var _0x28efe7=0x0;_0x28efe7<_0x5cae8e[_0x69e6('0x48')][_0x69e6('0x6e')][_0x69e6('0x4e')];_0x28efe7+=0x1){socket[_0x69e6('0x130')](_0x69e6('0x131'),{'UserId':Number(_0x5cae8e['query']['ids'][_0x28efe7]),'ChatWebsiteId':Number(_0x5cae8e[_0x69e6('0x5c')]['id'])});}}else{socket[_0x69e6('0x130')]('userChatWebsite:remove',{'UserId':Number(_0x5cae8e['query'][_0x69e6('0x6e')]),'ChatWebsiteId':Number(_0x5cae8e[_0x69e6('0x5c')]['id'])});}});}})['then'](respondWithStatusCode(_0x531c77,null))['catch'](handleError(_0x531c77,null));};exports[_0x69e6('0x132')]=function(_0x337ba4,_0x3fb559,_0x5688a6){var _0x2aa0fd={};var _0x2a10b2={};var _0x3f4fbf;var _0x2c05dd;return db[_0x69e6('0x57')][_0x69e6('0x71')]({'where':{'id':_0x337ba4[_0x69e6('0x5c')]['id']}})[_0x69e6('0x23')](handleEntityNotFound(_0x3fb559,null))[_0x69e6('0x23')](function(_0x54b23f){if(_0x54b23f){_0x3f4fbf=_0x54b23f;_0x2a10b2[_0x69e6('0x47')]=_[_0x69e6('0x49')](db[_0x69e6('0x133')][_0x69e6('0x43')]);_0x2a10b2['query']=_[_0x69e6('0x49')](_0x337ba4[_0x69e6('0x48')]);_0x2a10b2[_0x69e6('0x4a')]=_['intersection'](_0x2a10b2[_0x69e6('0x47')],_0x2a10b2[_0x69e6('0x48')]);_0x2aa0fd[_0x69e6('0x4c')]=_[_0x69e6('0x4b')](_0x2a10b2['model'],qs[_0x69e6('0x4d')](_0x337ba4[_0x69e6('0x48')][_0x69e6('0x4d')]));_0x2aa0fd[_0x69e6('0x4c')]=_0x2aa0fd[_0x69e6('0x4c')][_0x69e6('0x4e')]?_0x2aa0fd[_0x69e6('0x4c')]:_0x2a10b2['model'];_0x2aa0fd['order']=qs[_0x69e6('0x50')](_0x337ba4['query']['sort']);_0x2aa0fd['where']=qs[_0x69e6('0x4a')](_[_0x69e6('0x52')](_0x337ba4[_0x69e6('0x48')],_0x2a10b2[_0x69e6('0x4a')]));if(_0x337ba4[_0x69e6('0x48')]['filter']){_0x2aa0fd[_0x69e6('0x51')]=_[_0x69e6('0x55')](_0x2aa0fd[_0x69e6('0x51')],{'$or':_[_0x69e6('0x42')](_0x2aa0fd[_0x69e6('0x4c')],function(_0x214163){var _0x44374a={};_0x44374a[_0x214163]={'$like':'%'+_0x337ba4['query'][_0x69e6('0x53')]+'%'};return _0x44374a;})});}_0x2aa0fd=_[_0x69e6('0x55')]({},_0x2aa0fd,_0x337ba4[_0x69e6('0x56')]);return _0x3f4fbf['getAgents'](_0x2aa0fd);}})[_0x69e6('0x23')](function(_0xce4636){if(_0xce4636){_0x2c05dd=_0xce4636[_0x69e6('0x4e')];if(!_0x337ba4['query']['hasOwnProperty']('nolimit')){_0x2aa0fd['limit']=qs[_0x69e6('0x32')](_0x337ba4[_0x69e6('0x48')]['limit']);_0x2aa0fd[_0x69e6('0x34')]=qs[_0x69e6('0x34')](_0x337ba4[_0x69e6('0x48')]['offset']);}return _0x3f4fbf[_0x69e6('0x132')](_0x2aa0fd);}})[_0x69e6('0x23')](function(_0x4bcec0){if(_0x4bcec0){return _0x4bcec0?{'count':_0x2c05dd,'rows':_0x4bcec0}:null;}})[_0x69e6('0x23')](respondWithResult(_0x3fb559,null))[_0x69e6('0x2c')](handleError(_0x3fb559,null));}; \ No newline at end of file +var _0xb7ea=['mapValues','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','getInteractions','fullname','Tag','Tags','color','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','ONLINE','OFFLINE','No\x20timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','inspect','Interval','virtual','License','increment','chatLicenseExceeded','Intervals','all','some','server/files/chat/iframe.ejs','remote','x-real-ip','connection','remoteAddress','replace','alignment','textColor','backgroundColor','addApplications','findAndCountAll','priority','getApplications','addProactiveActions','omit','getProactiveActions','online','false','offlineForm','items','fromKey','getOfflineMessages','Contact','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','rimraf','zip-dir','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatWebsite.socket','register','jayson/promise','client','http','request','then','ChatWebsite,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','result','catch','sendStatus','status','end','json','offset','undefined','count','apply','save','get','ChatWebsites','UserProfileResource','destroy','stack','name','send','index','Pause','mandatoryDispositionPause','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','VIRTUAL','filter','options','ChatWebsite','includeAll','include','findAll','rows','show','params','find','create','body','user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','ChatWebsiteId','Disposition','findOne','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','ids','addLogo','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','root','server/files/images/logos/default_logo.svg','getLicense','custom','isNil','existsSync','join','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','download','getCustomerAvatar','showCustomerAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','headers','user-agent','getResult','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','ChatApplication','Applications','List','account','applications','orderBy','Contacts','contact','customerIp','x-forwarded-for','first','split','x-real-port','referer','browser','version','format','unknown','%s\x20%s','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','firstName','lastName','messageId','created','autoclose','push','close','*,*,*,*','UserId','User','unshift','agent','Start','EventManager','offline','files','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','originalname','mimetype','server','attachments','offline-chat','openNewInteraction','transaction','Attachment','bulkCreate','MailServerOut','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','secure','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','subjectOffline','toPairsIn'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xb7ea,0x16c));var _0xab7e=function(_0x65c50e,_0x1aa926){_0x65c50e=_0x65c50e-0x0;var _0x4573e7=_0xb7ea[_0x65c50e];return _0x4573e7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xab7e('0x0'));var zipdir=require(_0xab7e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xab7e('0x2'));var BPromise=require(_0xab7e('0x3'));var Mustache=require(_0xab7e('0x4'));var util=require(_0xab7e('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xab7e('0x6'));var ejs=require(_0xab7e('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xab7e('0x8'));var squel=require(_0xab7e('0x9'));var crypto=require(_0xab7e('0xa'));var jsforce=require(_0xab7e('0xb'));var deskjs=require(_0xab7e('0xc'));var toCsv=require(_0xab7e('0x6'));var querystring=require(_0xab7e('0xd'));var Papa=require(_0xab7e('0xe'));var Redis=require('ioredis');var authService=require(_0xab7e('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xab7e('0x10'));var hardwareService=require(_0xab7e('0x11'));var logger=require(_0xab7e('0x12'))(_0xab7e('0x13'));var utils=require(_0xab7e('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xab7e('0x15'));var db=require(_0xab7e('0x16'))['db'];config[_0xab7e('0x17')]=_[_0xab7e('0x18')](config[_0xab7e('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0xab7e('0x19'))(new Redis(config[_0xab7e('0x17')]));require(_0xab7e('0x1a'))[_0xab7e('0x1b')](socket);var jayson=require(_0xab7e('0x1c'));var client=jayson[_0xab7e('0x1d')][_0xab7e('0x1e')]({'port':0x232c});var client9002=jayson['client'][_0xab7e('0x1e')]({'port':0x232a});var client9003=jayson[_0xab7e('0x1d')][_0xab7e('0x1e')]({'port':0x232b});var client9001=jayson[_0xab7e('0x1d')][_0xab7e('0x1e')]({'port':0x2329});function respondWithRpcPromise(_0x5aadb8,_0xe7f6e9,_0x3c1799,_0x433072){return new BPromise(function(_0x58ffa0,_0x5ba2dd){var _0x64928=_0x433072||client;return _0x64928[_0xab7e('0x1f')](_0x5aadb8,_0x3c1799)[_0xab7e('0x20')](function(_0x58846b){logger['info'](_0xab7e('0x21'),_0xe7f6e9,'request\x20sent');logger[_0xab7e('0x22')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0xe7f6e9,_0xab7e('0x23'),JSON[_0xab7e('0x24')](_0x58846b));if(_0x58846b[_0xab7e('0x25')]){if(_0x58846b[_0xab7e('0x25')][_0xab7e('0x26')]===0x1f4){logger[_0xab7e('0x25')](_0xab7e('0x21'),_0xe7f6e9,_0x58846b[_0xab7e('0x25')][_0xab7e('0x27')]);return _0x5ba2dd(_0x58846b['error'][_0xab7e('0x27')]);}logger[_0xab7e('0x25')](_0xab7e('0x21'),_0xe7f6e9,_0x58846b[_0xab7e('0x25')][_0xab7e('0x27')]);return _0x58ffa0(_0x58846b[_0xab7e('0x25')][_0xab7e('0x27')]);}else{logger[_0xab7e('0x28')]('ChatWebsite,\x20%s,\x20%s',_0xe7f6e9,_0xab7e('0x23'));_0x58ffa0(_0x58846b[_0xab7e('0x29')][_0xab7e('0x27')]);}})[_0xab7e('0x2a')](function(_0x5e6c68){logger[_0xab7e('0x25')](_0xab7e('0x21'),_0xe7f6e9,_0x5e6c68);_0x5ba2dd(_0x5e6c68);});});}function respondWithStatusCode(_0x1e1931,_0x26bef5){_0x26bef5=_0x26bef5||0xcc;return function(_0x1316ff){if(_0x1316ff){return _0x1e1931[_0xab7e('0x2b')](_0x26bef5);}return _0x1e1931[_0xab7e('0x2c')](_0x26bef5)[_0xab7e('0x2d')]();};}function respondWithResult(_0x5d2d1c,_0x537215){_0x537215=_0x537215||0xc8;return function(_0x48846d){if(_0x48846d){return _0x5d2d1c['status'](_0x537215)[_0xab7e('0x2e')](_0x48846d);}};}function respondWithFilteredResult(_0x4c268a,_0x35c507){return function(_0x5e8efa){if(_0x5e8efa){var _0x33d8a0=typeof _0x35c507[_0xab7e('0x2f')]===_0xab7e('0x30')&&typeof _0x35c507['limit']===_0xab7e('0x30');var _0x4bfcf0=_0x5e8efa['count'];var _0x409a8b=_0x33d8a0?0x0:_0x35c507[_0xab7e('0x2f')];var _0x1f621e=_0x33d8a0?_0x5e8efa[_0xab7e('0x31')]:_0x35c507[_0xab7e('0x2f')]+_0x35c507['limit'];var _0x47a322;if(_0x1f621e>=_0x4bfcf0){_0x1f621e=_0x4bfcf0;_0x47a322=0xc8;}else{_0x47a322=0xce;}_0x4c268a[_0xab7e('0x2c')](_0x47a322);return _0x4c268a['set']('Content-Range',_0x409a8b+'-'+_0x1f621e+'/'+_0x4bfcf0)['json'](_0x5e8efa);}return null;};}function patchUpdates(_0x30b442){return function(_0x175c9c){try{jsonpatch[_0xab7e('0x32')](_0x175c9c,_0x30b442,!![]);}catch(_0x299f06){return BPromise['reject'](_0x299f06);}return _0x175c9c[_0xab7e('0x33')]();};}function saveUpdates(_0x1ac8b3,_0x4fd262){return function(_0x4df546){if(_0x4df546){return _0x4df546['update'](_0x1ac8b3)[_0xab7e('0x20')](function(_0x472cbb){return _0x472cbb;});}return null;};}function removeEntity(_0x5f0abd,_0x25a4d7){return function(_0x421ed7){if(_0x421ed7){return _0x421ed7['destroy']()[_0xab7e('0x20')](function(){var _0x25960a=_0x421ed7[_0xab7e('0x34')]({'plain':!![]});var _0x28e6bb=_0xab7e('0x35');return db[_0xab7e('0x36')][_0xab7e('0x37')]({'where':{'type':_0x28e6bb,'resourceId':_0x25960a['id']}})[_0xab7e('0x20')](function(){return _0x421ed7;});})[_0xab7e('0x20')](function(){_0x5f0abd[_0xab7e('0x2c')](0xcc)[_0xab7e('0x2d')]();});}};}function handleEntityNotFound(_0x371d44,_0x275968){return function(_0x3444c6){if(!_0x3444c6){_0x371d44['sendStatus'](0x194);}return _0x3444c6;};}function handleError(_0x4772b7,_0x2ec77f){_0x2ec77f=_0x2ec77f||0x1f4;return function(_0x1cc44c){logger['error'](_0x1cc44c[_0xab7e('0x38')]);if(_0x1cc44c[_0xab7e('0x39')]){delete _0x1cc44c['name'];}_0x4772b7[_0xab7e('0x2c')](_0x2ec77f)[_0xab7e('0x3a')](_0x1cc44c);};}exports[_0xab7e('0x3b')]=function(_0x279b63,_0x399319){var _0x152245={'include':[{'model':db[_0xab7e('0x3c')],'as':_0xab7e('0x3d')}]},_0x27c493={},_0x4dfd7e={'count':0x0,'rows':[]};var _0xb4f340=_[_0xab7e('0x3e')](db['ChatWebsite'][_0xab7e('0x3f')],function(_0x41a2e0){return{'name':_0x41a2e0[_0xab7e('0x40')],'type':_0x41a2e0[_0xab7e('0x41')][_0xab7e('0x42')]};});_0x27c493[_0xab7e('0x43')]=_[_0xab7e('0x3e')](_0xb4f340,_0xab7e('0x39'));_0x27c493[_0xab7e('0x44')]=_[_0xab7e('0x45')](_0x279b63[_0xab7e('0x44')]);_0x27c493[_0xab7e('0x46')]=_[_0xab7e('0x47')](_0x27c493['model'],_0x27c493[_0xab7e('0x44')]);_0x152245['attributes']=_[_0xab7e('0x47')](_0x27c493[_0xab7e('0x43')],qs[_0xab7e('0x48')](_0x279b63[_0xab7e('0x44')][_0xab7e('0x48')]));_0x152245[_0xab7e('0x49')]=_0x152245[_0xab7e('0x49')][_0xab7e('0x4a')]?_0x152245[_0xab7e('0x49')]:_0x27c493[_0xab7e('0x43')];if(!_0x279b63[_0xab7e('0x44')][_0xab7e('0x4b')](_0xab7e('0x4c'))){_0x152245['limit']=qs[_0xab7e('0x4d')](_0x279b63[_0xab7e('0x44')]['limit']);_0x152245[_0xab7e('0x2f')]=qs[_0xab7e('0x2f')](_0x279b63[_0xab7e('0x44')][_0xab7e('0x2f')]);}_0x152245[_0xab7e('0x4e')]=qs[_0xab7e('0x4f')](_0x279b63['query']['sort']);_0x152245[_0xab7e('0x50')]=qs[_0xab7e('0x46')](_[_0xab7e('0x51')](_0x279b63['query'],_0x27c493[_0xab7e('0x46')]),_0xb4f340);if(_0x279b63['query']['filter']){_0x152245[_0xab7e('0x50')]=_[_0xab7e('0x52')](_0x152245[_0xab7e('0x50')],{'$or':_[_0xab7e('0x3e')](_0xb4f340,function(_0x197e8a){if(_0x197e8a[_0xab7e('0x41')]!==_0xab7e('0x53')){var _0x155f35={};_0x155f35[_0x197e8a[_0xab7e('0x39')]]={'$like':'%'+_0x279b63['query'][_0xab7e('0x54')]+'%'};return _0x155f35;}})});}_0x152245=_[_0xab7e('0x52')]({},_0x152245,_0x279b63[_0xab7e('0x55')]);var _0x1f62dd={'where':_0x152245['where']};return db[_0xab7e('0x56')]['count'](_0x1f62dd)[_0xab7e('0x20')](function(_0x2b7f8e){_0x4dfd7e[_0xab7e('0x31')]=_0x2b7f8e;if(_0x279b63['query'][_0xab7e('0x57')]){_0x152245[_0xab7e('0x58')]=[{'all':!![]}];}return db[_0xab7e('0x56')][_0xab7e('0x59')](_0x152245);})[_0xab7e('0x20')](function(_0x398ceb){_0x4dfd7e[_0xab7e('0x5a')]=_0x398ceb;return _0x4dfd7e;})[_0xab7e('0x20')](respondWithFilteredResult(_0x399319,_0x152245))['catch'](handleError(_0x399319,null));};exports[_0xab7e('0x5b')]=function(_0x2008f3,_0x38538b){var _0x42b5f6={'raw':![],'where':{'id':_0x2008f3[_0xab7e('0x5c')]['id']},'include':[{'model':db['Pause'],'as':_0xab7e('0x3d')}]},_0x1599a2={};_0x1599a2[_0xab7e('0x43')]=_[_0xab7e('0x45')](db['ChatWebsite']['rawAttributes']);_0x1599a2[_0xab7e('0x44')]=_[_0xab7e('0x45')](_0x2008f3['query']);_0x1599a2[_0xab7e('0x46')]=_[_0xab7e('0x47')](_0x1599a2[_0xab7e('0x43')],_0x1599a2[_0xab7e('0x44')]);_0x42b5f6[_0xab7e('0x49')]=_[_0xab7e('0x47')](_0x1599a2[_0xab7e('0x43')],qs[_0xab7e('0x48')](_0x2008f3[_0xab7e('0x44')][_0xab7e('0x48')]));_0x42b5f6['attributes']=_0x42b5f6[_0xab7e('0x49')][_0xab7e('0x4a')]?_0x42b5f6['attributes']:_0x1599a2[_0xab7e('0x43')];if(_0x2008f3[_0xab7e('0x44')][_0xab7e('0x57')]){_0x42b5f6[_0xab7e('0x58')]=[{'all':!![]}];}_0x42b5f6=_[_0xab7e('0x52')]({},_0x42b5f6,_0x2008f3[_0xab7e('0x55')]);return db[_0xab7e('0x56')][_0xab7e('0x5d')](_0x42b5f6)['then'](handleEntityNotFound(_0x38538b,null))[_0xab7e('0x20')](respondWithResult(_0x38538b,null))[_0xab7e('0x2a')](handleError(_0x38538b,null));};exports[_0xab7e('0x5e')]=function(_0x4b1163,_0x278068){return db['ChatWebsite'][_0xab7e('0x5e')](_0x4b1163[_0xab7e('0x5f')],{})[_0xab7e('0x20')](function(_0x15963b){var _0x3eec87=_0x4b1163[_0xab7e('0x60')][_0xab7e('0x34')]({'plain':!![]});if(!_0x3eec87)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3eec87[_0xab7e('0x61')]==='user'){var _0x186803=_0x15963b[_0xab7e('0x34')]({'plain':!![]});var _0xb4a6c4=_0xab7e('0x35');return db['UserProfileSection'][_0xab7e('0x5d')]({'where':{'name':_0xb4a6c4,'userProfileId':_0x3eec87[_0xab7e('0x62')]},'raw':!![]})[_0xab7e('0x20')](function(_0x46298b){if(_0x46298b&&_0x46298b[_0xab7e('0x63')]===0x0){return db[_0xab7e('0x36')][_0xab7e('0x5e')]({'name':_0x186803[_0xab7e('0x39')],'resourceId':_0x186803['id'],'type':_0x46298b['name'],'sectionId':_0x46298b['id']},{})['then'](function(){return _0x15963b;});}else{return _0x15963b;}})[_0xab7e('0x2a')](function(_0x2e69b8){logger[_0xab7e('0x25')](_0xab7e('0x64'),_0x2e69b8);throw _0x2e69b8;});}return _0x15963b;})[_0xab7e('0x20')](respondWithResult(_0x278068,0xc9))[_0xab7e('0x2a')](handleError(_0x278068,null));};exports[_0xab7e('0x65')]=function(_0x52a48c,_0x589bdc){if(_0x52a48c[_0xab7e('0x5f')]['id']){delete _0x52a48c[_0xab7e('0x5f')]['id'];}return db['ChatWebsite'][_0xab7e('0x5d')]({'where':{'id':_0x52a48c['params']['id']},'include':[{'model':db['Pause'],'as':_0xab7e('0x3d')}]})[_0xab7e('0x20')](handleEntityNotFound(_0x589bdc,null))['then'](saveUpdates(_0x52a48c['body'],null))[_0xab7e('0x20')](respondWithResult(_0x589bdc,null))[_0xab7e('0x2a')](handleError(_0x589bdc,null));};exports[_0xab7e('0x37')]=function(_0x8b9201,_0x5355d2){return db[_0xab7e('0x56')][_0xab7e('0x5d')]({'where':{'id':_0x8b9201[_0xab7e('0x5c')]['id']}})[_0xab7e('0x20')](handleEntityNotFound(_0x5355d2,null))[_0xab7e('0x20')](removeEntity(_0x5355d2,null))[_0xab7e('0x2a')](handleError(_0x5355d2,null));};exports[_0xab7e('0x66')]=function(_0x4e4087,_0x1e2bc6){return db[_0xab7e('0x56')]['describe']()[_0xab7e('0x20')](respondWithResult(_0x1e2bc6,null))[_0xab7e('0x2a')](handleError(_0x1e2bc6,null));};exports[_0xab7e('0x67')]=function(_0x5f1af4,_0xf1c8df,_0x515a5c){if(_0x5f1af4[_0xab7e('0x5f')]['id']){delete _0x5f1af4['body']['id'];}return db[_0xab7e('0x56')][_0xab7e('0x5d')]({'where':{'id':_0x5f1af4[_0xab7e('0x5c')]['id']}})['then'](handleEntityNotFound(_0xf1c8df,null))['then'](function(_0x5dd194){if(_0x5dd194){_0x5f1af4[_0xab7e('0x5f')][_0xab7e('0x68')]=_0x5dd194['id'];return db[_0xab7e('0x69')]['create'](_0x5f1af4[_0xab7e('0x5f')]);}})[_0xab7e('0x20')](respondWithResult(_0xf1c8df,null))[_0xab7e('0x2a')](handleError(_0xf1c8df,null));};exports['getDispositions']=function(_0x13a5ab,_0xbb4e6f,_0x192d02){var _0x2089ff={'raw':![],'where':{}};var _0x22728e={};var _0x480d06={'count':0x0,'rows':[]};return db[_0xab7e('0x56')][_0xab7e('0x6a')]({'where':{'id':_0x13a5ab[_0xab7e('0x5c')]['id']}})[_0xab7e('0x20')](handleEntityNotFound(_0xbb4e6f,null))[_0xab7e('0x20')](function(_0x3e57b6){if(_0x3e57b6){_0x22728e['model']=_[_0xab7e('0x45')](db['Disposition'][_0xab7e('0x3f')]);_0x22728e[_0xab7e('0x44')]=_['keys'](_0x13a5ab[_0xab7e('0x44')]);_0x22728e['filters']=_[_0xab7e('0x47')](_0x22728e['model'],_0x22728e[_0xab7e('0x44')]);_0x2089ff[_0xab7e('0x49')]=_['intersection'](_0x22728e[_0xab7e('0x43')],qs['fields'](_0x13a5ab[_0xab7e('0x44')][_0xab7e('0x48')]));_0x2089ff[_0xab7e('0x49')]=_0x2089ff['attributes'][_0xab7e('0x4a')]?_0x2089ff[_0xab7e('0x49')]:_0x22728e[_0xab7e('0x43')];if(!_0x13a5ab['query'][_0xab7e('0x4b')]('nolimit')){_0x2089ff[_0xab7e('0x4d')]=qs[_0xab7e('0x4d')](_0x13a5ab['query'][_0xab7e('0x4d')]);_0x2089ff[_0xab7e('0x2f')]=qs[_0xab7e('0x2f')](_0x13a5ab[_0xab7e('0x44')][_0xab7e('0x2f')]);}_0x2089ff[_0xab7e('0x4e')]=qs['sort'](_0x13a5ab[_0xab7e('0x44')][_0xab7e('0x4f')]);_0x2089ff[_0xab7e('0x50')]=qs[_0xab7e('0x46')](_[_0xab7e('0x51')](_0x13a5ab[_0xab7e('0x44')],_0x22728e[_0xab7e('0x46')]));_0x2089ff[_0xab7e('0x50')][_0xab7e('0x68')]=_0x3e57b6['id'];if(_0x13a5ab[_0xab7e('0x44')]['filter']){_0x2089ff['where']=_[_0xab7e('0x52')](_0x2089ff[_0xab7e('0x50')],{'$or':_[_0xab7e('0x3e')](_0x2089ff[_0xab7e('0x49')],function(_0x224fd8){var _0x3f3f23={};_0x3f3f23[_0x224fd8]={'$like':'%'+_0x13a5ab[_0xab7e('0x44')][_0xab7e('0x54')]+'%'};return _0x3f3f23;})});}_0x2089ff=_[_0xab7e('0x52')]({},_0x2089ff,_0x13a5ab[_0xab7e('0x55')]);return db['Disposition'][_0xab7e('0x31')]({'where':_0x2089ff[_0xab7e('0x50')]})[_0xab7e('0x20')](function(_0x3f2190){_0x480d06[_0xab7e('0x31')]=_0x3f2190;if(_0x13a5ab[_0xab7e('0x44')][_0xab7e('0x57')]){_0x2089ff[_0xab7e('0x58')]=[{'all':!![]}];}return db['Disposition'][_0xab7e('0x59')](_0x2089ff);})[_0xab7e('0x20')](function(_0x5c817b){_0x480d06[_0xab7e('0x5a')]=_0x5c817b;return _0x480d06;});}})['then'](respondWithFilteredResult(_0xbb4e6f,_0x2089ff))[_0xab7e('0x2a')](handleError(_0xbb4e6f,null));};exports[_0xab7e('0x6b')]=function(_0x226459,_0x4a50b2,_0x5ddb61){return db[_0xab7e('0x56')][_0xab7e('0x5d')]({'where':{'id':_0x226459[_0xab7e('0x5c')]['id']}})[_0xab7e('0x20')](handleEntityNotFound(_0x4a50b2,null))[_0xab7e('0x20')](function(_0x4494fc){if(_0x4494fc){return _0x4494fc[_0xab7e('0x6b')](_0x226459[_0xab7e('0x44')]['ids']);}})[_0xab7e('0x20')](respondWithStatusCode(_0x4a50b2,null))[_0xab7e('0x2a')](handleError(_0x4a50b2,null));};exports[_0xab7e('0x6c')]=function(_0x5799ec,_0x3856f,_0x6d2fa1){if(_0x5799ec[_0xab7e('0x5f')]['id']){delete _0x5799ec[_0xab7e('0x5f')]['id'];}return db[_0xab7e('0x56')][_0xab7e('0x5d')]({'where':{'id':_0x5799ec['params']['id']}})['then'](handleEntityNotFound(_0x3856f,null))[_0xab7e('0x20')](function(_0x1cb6a9){if(_0x1cb6a9){_0x5799ec[_0xab7e('0x5f')][_0xab7e('0x68')]=_0x1cb6a9['id'];return db[_0xab7e('0x6d')]['create'](_0x5799ec['body']);}})[_0xab7e('0x20')](respondWithResult(_0x3856f,null))[_0xab7e('0x2a')](handleError(_0x3856f,null));};exports[_0xab7e('0x6e')]=function(_0x25b757,_0x11b5b8,_0x1deec7){var _0x56e5c1={'raw':![],'where':{}};var _0x49b647={};var _0x328388={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xab7e('0x6a')]({'where':{'id':_0x25b757[_0xab7e('0x5c')]['id']}})[_0xab7e('0x20')](handleEntityNotFound(_0x11b5b8,null))['then'](function(_0x46921a){if(_0x46921a){_0x49b647[_0xab7e('0x43')]=_['keys'](db[_0xab7e('0x6d')]['rawAttributes']);_0x49b647[_0xab7e('0x44')]=_[_0xab7e('0x45')](_0x25b757[_0xab7e('0x44')]);_0x49b647[_0xab7e('0x46')]=_[_0xab7e('0x47')](_0x49b647[_0xab7e('0x43')],_0x49b647[_0xab7e('0x44')]);_0x56e5c1[_0xab7e('0x49')]=_['intersection'](_0x49b647[_0xab7e('0x43')],qs['fields'](_0x25b757[_0xab7e('0x44')]['fields']));_0x56e5c1['attributes']=_0x56e5c1[_0xab7e('0x49')][_0xab7e('0x4a')]?_0x56e5c1[_0xab7e('0x49')]:_0x49b647[_0xab7e('0x43')];if(!_0x25b757['query'][_0xab7e('0x4b')](_0xab7e('0x4c'))){_0x56e5c1[_0xab7e('0x4d')]=qs[_0xab7e('0x4d')](_0x25b757[_0xab7e('0x44')][_0xab7e('0x4d')]);_0x56e5c1['offset']=qs[_0xab7e('0x2f')](_0x25b757[_0xab7e('0x44')][_0xab7e('0x2f')]);}_0x56e5c1[_0xab7e('0x4e')]=qs[_0xab7e('0x4f')](_0x25b757['query'][_0xab7e('0x4f')]);_0x56e5c1[_0xab7e('0x50')]=qs[_0xab7e('0x46')](_[_0xab7e('0x51')](_0x25b757['query'],_0x49b647[_0xab7e('0x46')]));_0x56e5c1[_0xab7e('0x50')][_0xab7e('0x68')]=_0x46921a['id'];if(_0x25b757[_0xab7e('0x44')]['filter']){_0x56e5c1[_0xab7e('0x50')]=_[_0xab7e('0x52')](_0x56e5c1[_0xab7e('0x50')],{'$or':_[_0xab7e('0x3e')](_0x56e5c1[_0xab7e('0x49')],function(_0x4440d4){var _0x22f476={};_0x22f476[_0x4440d4]={'$like':'%'+_0x25b757[_0xab7e('0x44')]['filter']+'%'};return _0x22f476;})});}_0x56e5c1=_[_0xab7e('0x52')]({},_0x56e5c1,_0x25b757['options']);return db[_0xab7e('0x6d')]['count']({'where':_0x56e5c1[_0xab7e('0x50')]})['then'](function(_0x6c3aa4){_0x328388['count']=_0x6c3aa4;if(_0x25b757[_0xab7e('0x44')][_0xab7e('0x57')]){_0x56e5c1[_0xab7e('0x58')]=[{'all':!![]}];}return db['CannedAnswer'][_0xab7e('0x59')](_0x56e5c1);})['then'](function(_0x1c5184){_0x328388[_0xab7e('0x5a')]=_0x1c5184;return _0x328388;});}})[_0xab7e('0x20')](respondWithFilteredResult(_0x11b5b8,_0x56e5c1))[_0xab7e('0x2a')](handleError(_0x11b5b8,null));};exports['removeAnswers']=function(_0x2be82b,_0x4eaa76,_0x27ccbd){return db[_0xab7e('0x56')][_0xab7e('0x5d')]({'where':{'id':_0x2be82b[_0xab7e('0x5c')]['id']}})[_0xab7e('0x20')](handleEntityNotFound(_0x4eaa76,null))[_0xab7e('0x20')](function(_0x121145){if(_0x121145){return _0x121145[_0xab7e('0x6f')](_0x2be82b[_0xab7e('0x44')][_0xab7e('0x70')]);}})[_0xab7e('0x20')](respondWithStatusCode(_0x4eaa76,null))[_0xab7e('0x2a')](handleError(_0x4eaa76,null));};exports[_0xab7e('0x71')]=function(_0x51feee,_0x539916,_0xceec97){_0x51feee[_0xab7e('0x5f')][_0xab7e('0x72')]=_0x51feee[_0xab7e('0x73')][_0xab7e('0x74')];return db[_0xab7e('0x56')][_0xab7e('0x5d')]({'where':{'id':_0x51feee[_0xab7e('0x5c')]['id']}})[_0xab7e('0x20')](handleEntityNotFound(_0x539916,null))['then'](saveUpdates(_0x51feee['body'],null))[_0xab7e('0x20')](respondWithResult(_0x539916,null))[_0xab7e('0x2a')](handleError(_0x539916,null));};exports[_0xab7e('0x75')]=function(_0x2c9291,_0x2f71f1,_0x1f4270){_0x2c9291['body'][_0xab7e('0x76')]=_0x2c9291[_0xab7e('0x73')][_0xab7e('0x74')];return db[_0xab7e('0x56')][_0xab7e('0x5d')]({'where':{'id':_0x2c9291[_0xab7e('0x5c')]['id']}})['then'](handleEntityNotFound(_0x2f71f1,null))[_0xab7e('0x20')](saveUpdates(_0x2c9291[_0xab7e('0x5f')],null))[_0xab7e('0x20')](respondWithResult(_0x2f71f1,null))[_0xab7e('0x2a')](handleError(_0x2f71f1,null));};exports[_0xab7e('0x77')]=function(_0x387b59,_0x277306,_0x590358){_0x387b59[_0xab7e('0x5f')][_0xab7e('0x78')]=_0x387b59[_0xab7e('0x73')][_0xab7e('0x74')];return db['ChatWebsite'][_0xab7e('0x5d')]({'where':{'id':_0x387b59[_0xab7e('0x5c')]['id']}})[_0xab7e('0x20')](handleEntityNotFound(_0x277306,null))[_0xab7e('0x20')](saveUpdates(_0x387b59['body'],null))[_0xab7e('0x20')](respondWithResult(_0x277306,null))['catch'](handleError(_0x277306,null));};exports[_0xab7e('0x79')]=function(_0x122c6a,_0x11e5a0,_0x5e3a99){_0x122c6a['body'][_0xab7e('0x7a')]=_0x122c6a[_0xab7e('0x73')][_0xab7e('0x74')];return db[_0xab7e('0x56')][_0xab7e('0x5d')]({'where':{'id':_0x122c6a[_0xab7e('0x5c')]['id']}})[_0xab7e('0x20')](handleEntityNotFound(_0x11e5a0,null))[_0xab7e('0x20')](saveUpdates(_0x122c6a['body'],null))[_0xab7e('0x20')](respondWithResult(_0x11e5a0,null))['catch'](handleError(_0x11e5a0,null));};exports[_0xab7e('0x7b')]=function(_0x1b212b,_0x333704,_0x13d84f){var _0x203565=path['join'](config[_0xab7e('0x7c')],_0xab7e('0x7d'));var _0x56dc0e={'where':{'id':_0x1b212b[_0xab7e('0x5c')]['id']},'attributes':['id',_0xab7e('0x72')],'raw':!![]};var _0x4dc744=![];return require('../../config/license/util')[_0xab7e('0x7e')]()['then'](function(_0x11fd8b){if(_0x11fd8b){_0x4dc744=_0x11fd8b[_0xab7e('0x7f')];}})[_0xab7e('0x20')](function(){return db[_0xab7e('0x56')][_0xab7e('0x5d')](_0x56dc0e);})['then'](handleEntityNotFound(_0x333704,null))[_0xab7e('0x20')](function(_0x7cf2f2){if(_0x7cf2f2){if(!_[_0xab7e('0x80')](_0x7cf2f2[_0xab7e('0x72')])){if(fs[_0xab7e('0x81')](path['join'](config['root'],'server/files/images/logos/',_0x7cf2f2[_0xab7e('0x72')]))&&_0x4dc744){_0x203565=path[_0xab7e('0x82')](config[_0xab7e('0x7c')],'server/files/images/logos/',_0x7cf2f2[_0xab7e('0x72')]);}}return _0x333704['download'](_0x203565);}})[_0xab7e('0x2a')](handleError(_0x333704,null));};exports[_0xab7e('0x83')]=function(_0x4f15b0,_0x165395,_0x4ea43c){var _0x3ef0d9=path[_0xab7e('0x82')](config[_0xab7e('0x7c')],_0xab7e('0x84'));var _0x4f525b={'where':{'id':_0x4f15b0['params']['id']},'attributes':['id',_0xab7e('0x76')],'raw':!![]};return db[_0xab7e('0x56')][_0xab7e('0x5d')](_0x4f525b)[_0xab7e('0x20')](handleEntityNotFound(_0x165395,null))[_0xab7e('0x20')](function(_0x223908){if(_0x223908){if(!_[_0xab7e('0x80')](_0x223908['agentAvatar'])){if(fs[_0xab7e('0x81')](path[_0xab7e('0x82')](config[_0xab7e('0x7c')],_0xab7e('0x85'),_0x223908[_0xab7e('0x76')]))){_0x3ef0d9=path[_0xab7e('0x82')](config[_0xab7e('0x7c')],_0xab7e('0x85'),_0x223908[_0xab7e('0x76')]);}}return _0x165395[_0xab7e('0x86')](_0x3ef0d9);}})['catch'](handleError(_0x165395,null));};exports[_0xab7e('0x87')]=function(_0x21bc1d,_0x44714d,_0x26029d){var _0x40e8b0=path[_0xab7e('0x82')](config['root'],'server/files/images/avatars/customer_avatar.png');var _0x1784ba={'where':{'id':_0x21bc1d[_0xab7e('0x5c')]['id']},'attributes':['id',_0xab7e('0x78'),_0xab7e('0x88')],'raw':!![]};return db[_0xab7e('0x56')][_0xab7e('0x5d')](_0x1784ba)[_0xab7e('0x20')](handleEntityNotFound(_0x44714d,null))[_0xab7e('0x20')](function(_0x45ab5e){if(_0x45ab5e){if(!_[_0xab7e('0x80')](_0x45ab5e[_0xab7e('0x78')])){if(fs[_0xab7e('0x81')](path[_0xab7e('0x82')](config[_0xab7e('0x7c')],_0xab7e('0x85'),_0x45ab5e[_0xab7e('0x78')]))&&_0x45ab5e[_0xab7e('0x88')]){_0x40e8b0=path[_0xab7e('0x82')](config[_0xab7e('0x7c')],_0xab7e('0x85'),_0x45ab5e[_0xab7e('0x78')]);}}return _0x44714d[_0xab7e('0x86')](_0x40e8b0);}})[_0xab7e('0x2a')](handleError(_0x44714d,null));};exports['getSystemAvatar']=function(_0x37f4ec,_0x51ffec,_0x3e1ad0){var _0x36f5ab=path['join'](config[_0xab7e('0x7c')],_0xab7e('0x89'));var _0x8de24e={'where':{'id':_0x37f4ec[_0xab7e('0x5c')]['id']},'attributes':['id',_0xab7e('0x7a')],'raw':!![]};return db['ChatWebsite'][_0xab7e('0x5d')](_0x8de24e)[_0xab7e('0x20')](handleEntityNotFound(_0x51ffec,null))[_0xab7e('0x20')](function(_0xa9136a){if(_0xa9136a){if(!_[_0xab7e('0x80')](_0xa9136a['systemAvatar'])){if(fs[_0xab7e('0x81')](path[_0xab7e('0x82')](config[_0xab7e('0x7c')],'server/files/images/avatars/',_0xa9136a[_0xab7e('0x7a')]))){_0x36f5ab=path[_0xab7e('0x82')](config[_0xab7e('0x7c')],_0xab7e('0x85'),_0xa9136a[_0xab7e('0x7a')]);}}return _0x51ffec[_0xab7e('0x86')](_0x36f5ab);}})[_0xab7e('0x2a')](handleError(_0x51ffec,null));};exports[_0xab7e('0x8a')]=function(_0x393b1d,_0x4a353d,_0x4d845e){var _0x3d7de6=require(_0xab7e('0x8b'));var _0x3373f0=new _0x3d7de6();var _0xa54467=_0x3373f0[_0xab7e('0x8c')](_0x393b1d[_0xab7e('0x8d')][_0xab7e('0x8e')])[_0xab7e('0x8f')]();var _0xbec26d={'body':_0x393b1d['body'],'channel':'chat'};var _0x4fc89d=[];var _0x50ad72=[];var _0x37577e={};var _0x2d7037=![];return db[_0xab7e('0x90')][_0xab7e('0x66')]()[_0xab7e('0x20')](function(_0x16c43a){if(!_0x16c43a){throw new db[(_0xab7e('0x91'))]['ValidationError'](_0xab7e('0x92'));}_0x4fc89d=_[_0xab7e('0x93')](_['keys'](_0x16c43a),[_0xab7e('0x94'),_0xab7e('0x95')]);_0x50ad72=_[_0xab7e('0x93')](_[_0xab7e('0x45')](_0x16c43a),[_0xab7e('0x94'),_0xab7e('0x95'),_0xab7e('0x96'),_0xab7e('0x97')]);if(_0x393b1d['body']['id']){delete _0x393b1d[_0xab7e('0x5f')]['id'];}if(_[_0xab7e('0x80')](_0x393b1d['body'][_0xab7e('0x98')])){throw new db[(_0xab7e('0x91'))]['ValidationError']('from\x20is\x20mandatory');}if(_[_0xab7e('0x80')](_0x393b1d[_0xab7e('0x5f')][_0xab7e('0x5f')])||_0x393b1d[_0xab7e('0x5f')]['body']===''){throw new db[(_0xab7e('0x91'))][(_0xab7e('0x99'))](_0xab7e('0x9a'));}if(_[_0xab7e('0x80')](_0x393b1d['body']['mapKey'])){throw new db[(_0xab7e('0x91'))]['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x50ad72);}if(!_['includes'](_0x50ad72,_0x393b1d[_0xab7e('0x5f')][_0xab7e('0x9b')])){throw new db['Sequelize'][(_0xab7e('0x99'))](_0xab7e('0x9c')+_0x50ad72);}_0x37577e[_0x393b1d[_0xab7e('0x5f')][_0xab7e('0x9b')]]=_0x393b1d[_0xab7e('0x5f')][_0xab7e('0x98')];})[_0xab7e('0x20')](function(){return db['ChatWebsite'][_0xab7e('0x5d')]({'where':{'id':_0x393b1d['params']['id']},'include':[{'model':db[_0xab7e('0x9d')],'as':'List','include':[{'model':db[_0xab7e('0x90')],'as':'Contacts','where':_0x37577e,'limit':0x1,'order':[[_0xab7e('0x95'),'DESC']]}]},{'model':db[_0xab7e('0x9e')],'as':_0xab7e('0x9f')}]});})['then'](handleEntityNotFound(_0x4a353d,null))[_0xab7e('0x20')](function(_0x4555a1){if(_0x4555a1&&_0x4555a1[_0xab7e('0xa0')]){_0xbec26d[_0xab7e('0xa1')]=_0x4555a1;_0xbec26d[_0xab7e('0xa2')]=_0x4555a1[_0xab7e('0x9f')];_0xbec26d['list']=_0x4555a1[_0xab7e('0xa0')];_0xbec26d[_0xab7e('0xa2')]=_[_0xab7e('0xa3')](_0xbec26d[_0xab7e('0xa2')],['priority'],['asc']);if(_0xbec26d[_0xab7e('0xa1')][_0xab7e('0x9f')]){delete _0xbec26d[_0xab7e('0xa1')][_0xab7e('0x9f')];}if(_0xbec26d[_0xab7e('0xa1')][_0xab7e('0xa0')]&&_0xbec26d[_0xab7e('0xa1')]['List'][_0xab7e('0xa4')]['length']){return _0xbec26d[_0xab7e('0xa1')][_0xab7e('0xa0')][_0xab7e('0xa4')][0x0];}var _0x5d3907=_[_0xab7e('0x18')](_0x393b1d[_0xab7e('0x5f')],{'firstName':_0x393b1d[_0xab7e('0x5f')][_0xab7e('0x98')],'ListId':_0x4555a1['ListId']});_0x5d3907[_0x393b1d['body'][_0xab7e('0x9b')]]=_0x393b1d[_0xab7e('0x5f')][_0xab7e('0x98')];return db[_0xab7e('0x90')][_0xab7e('0x5e')](_0x5d3907,{'fields':_0x4fc89d,'raw':!![]});}})[_0xab7e('0x20')](handleEntityNotFound(_0x4a353d,null))[_0xab7e('0x20')](function(_0x4d0c7a){_0xbec26d[_0xab7e('0xa5')]=_0x4d0c7a;var _0x10d586=_0x393b1d[_0xab7e('0x5f')][_0xab7e('0xa6')];if(_0x393b1d['headers']['cf-connecting-ip']){_0x10d586=_0x393b1d[_0xab7e('0x8d')]['cf-connecting-ip'];}else if(_0x393b1d[_0xab7e('0x8d')][_0xab7e('0xa7')]){_0x10d586=_[_0xab7e('0xa8')](_0x393b1d[_0xab7e('0x8d')][_0xab7e('0xa7')][_0xab7e('0xa9')](','));}if(_0x4d0c7a){var _0x1a4ce3={'ContactId':_0x4d0c7a['id'],'ChatWebsiteId':_0x393b1d[_0xab7e('0x5c')]['id'],'from':(_0x4d0c7a['firstName']||'')+'\x20'+(_0x4d0c7a['lastName']||''),'customerIp':_0x10d586,'customerPort':_0x393b1d[_0xab7e('0x8d')][_0xab7e('0xaa')]?_0x393b1d[_0xab7e('0x8d')][_0xab7e('0xaa')]:null,'referer':_0x393b1d[_0xab7e('0x5f')][_0xab7e('0xab')],'browserName':_0xa54467[_0xab7e('0xac')][_0xab7e('0x39')]&&_0xa54467[_0xab7e('0xac')][_0xab7e('0xad')]?util[_0xab7e('0xae')]('%s\x20%s',_0xa54467[_0xab7e('0xac')][_0xab7e('0x39')],_0xa54467['browser'][_0xab7e('0xad')]):'unknown','browserVersion':_0xa54467[_0xab7e('0xac')][_0xab7e('0xad')]||_0xab7e('0xaf'),'osName':util[_0xab7e('0xae')](_0xab7e('0xb0'),_0xa54467['os'][_0xab7e('0x39')],_0xa54467['os'][_0xab7e('0xad')]),'osVersion':_0xa54467['os']['version'],'deviceModel':_0xa54467[_0xab7e('0xb1')]['model']&&_0xa54467[_0xab7e('0xb1')][_0xab7e('0xb2')]?util[_0xab7e('0xae')](_0xab7e('0xb3'),_0xa54467['device'][_0xab7e('0x43')],_0xa54467[_0xab7e('0xb1')][_0xab7e('0xb2')],_0xa54467[_0xab7e('0xb1')][_0xab7e('0x41')]):null,'deviceVendor':_0xa54467[_0xab7e('0xb1')][_0xab7e('0xb2')],'deviceType':_0xa54467[_0xab7e('0xb1')][_0xab7e('0x41')],'formData':JSON['stringify'](_0x393b1d[_0xab7e('0x5f')])};var _0x791f67={'ChatWebsiteId':_0x393b1d[_0xab7e('0x5c')]['id'],'closed':![]};if(_0x393b1d['body'][_0xab7e('0xb4')]){_0x791f67[_0xab7e('0xb4')]=_0x393b1d[_0xab7e('0x5f')][_0xab7e('0xb4')];return db[_0xab7e('0xb5')][_0xab7e('0x5d')]({'where':_0x791f67})[_0xab7e('0x20')](function(_0x5294b8){if(_0x5294b8){return[_0x5294b8,![]];}_0x1a4ce3[_0xab7e('0xb4')]=_0x393b1d[_0xab7e('0x5f')]['threadId'];_0x1a4ce3[_0xab7e('0xb6')]=_0x393b1d[_0xab7e('0x5f')][_0xab7e('0xb6')];return db['ChatInteraction']['create'](_0x1a4ce3)[_0xab7e('0x20')](function(_0x2e7f3c){return[_0x2e7f3c,!![]];});});}_0x791f67[_0xab7e('0xb7')]=_0x4d0c7a['id'];if(_0x393b1d[_0xab7e('0x5f')][_0xab7e('0xb8')]&&_0x393b1d[_0xab7e('0x5f')]['interaction']['id']){_0x791f67['id']=_0x393b1d[_0xab7e('0x5f')][_0xab7e('0xb8')]['id'];return db[_0xab7e('0xb5')][_0xab7e('0x5d')]({'where':_0x791f67})[_0xab7e('0x20')](function(_0x222f8a){if(_0x222f8a){return[_0x222f8a,![]];}return db[_0xab7e('0xb5')][_0xab7e('0x5e')](_0x1a4ce3)[_0xab7e('0x20')](function(_0x195685){return[_0x195685,!![]];});});}return db[_0xab7e('0xb5')][_0xab7e('0x5e')](_0x1a4ce3)[_0xab7e('0x20')](function(_0x11c388){return[_0x11c388,!![]];});}})[_0xab7e('0xb9')](function(_0x5d7a03,_0x5f1ef5){if(_0x5d7a03){_0x2d7037=_0x5f1ef5;if(!_0x5f1ef5){var _0x84c1c9={'from':(_0xbec26d[_0xab7e('0xa5')][_0xab7e('0xba')]||'')+'\x20'+(_0xbec26d[_0xab7e('0xa5')][_0xab7e('0xbb')]||'')};if(_0x393b1d['body']['threadId']&&_0x393b1d[_0xab7e('0x5f')][_0xab7e('0xbc')]&&_0x393b1d['body'][_0xab7e('0xb4')]!=_0x393b1d['body']['messageId']){_0x84c1c9[_0xab7e('0xb4')]=_0x393b1d[_0xab7e('0x5f')][_0xab7e('0xbc')];}return _0x5d7a03[_0xab7e('0x65')](_0x84c1c9);}else{return _0x5d7a03;}}})[_0xab7e('0x20')](function(_0x25027f){_0xbec26d[_0xab7e('0xb8')]=_0x25027f['get']({'plain':!![]});_0xbec26d['interaction'][_0xab7e('0xbd')]=_0x2d7037;if(_0xbec26d[_0xab7e('0xb8')][_0xab7e('0xbd')]){if(_0xbec26d[_0xab7e('0xa1')][_0xab7e('0xbe')]){_0xbec26d['applications'][_0xab7e('0xbf')]({'id':0x0,'priority':_0xbec26d[_0xab7e('0xa2')][_0xab7e('0x4a')]+0x1,'app':_0xab7e('0xc0'),'appdata':'unmanaged','interval':_0xab7e('0xc1')});}}return db['ChatMessage'][_0xab7e('0x5e')]({'body':_0x393b1d[_0xab7e('0x5f')][_0xab7e('0x5f')],'ChatWebsiteId':_0x393b1d[_0xab7e('0x5c')]['id'],'ChatInteractionId':_0x25027f['id'],'direction':'in','ContactId':_0xbec26d[_0xab7e('0xa5')]['id'],'AttachmentId':_0x393b1d['body']['AttachmentId']});})[_0xab7e('0x20')](function(_0x54d9aa){_0xbec26d[_0xab7e('0x27')]=_0x54d9aa;if(_0xbec26d[_0xab7e('0xb8')][_0xab7e('0xc2')]){return db[_0xab7e('0xc3')]['find']({'attributes':['id','name'],'where':{'id':_0xbec26d['interaction'][_0xab7e('0xc2')]}})[_0xab7e('0x20')](function(_0xa30c24){if(_0xa30c24){_0xbec26d[_0xab7e('0xa2')][_0xab7e('0xc4')]({'id':0x0,'priority':0x0,'app':_0xab7e('0xc5'),'appdata':_0xa30c24[_0xab7e('0x39')]+','+(_0xbec26d[_0xab7e('0xa1')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});_0xbec26d['forcedOwnership']=!![];}return respondWithRpcPromise(_0xab7e('0xc6'),'startRouting',_0xbec26d);});}return respondWithRpcPromise(_0xab7e('0xc6'),'startRouting',_0xbec26d);})[_0xab7e('0x20')](function(_0x2645a8){respondWithRpcPromise(_0xab7e('0xc7'),_0xab7e('0xc7'),{'event':'notify','message':_0x2645a8},client9002);return _0x2645a8;})['then'](respondWithResult(_0x4a353d,null))[_0xab7e('0x2a')](handleError(_0x4a353d,null));};exports[_0xab7e('0xc8')]=function(_0x598c63,_0x3e408d,_0xc1209e){var _0x1ad7b0,_0x39087d,_0x4bbe1e;var _0xe70b01=[];var _0x22ae01=[];var _0x3df878={};var _0x42ac81=_0x598c63[_0xab7e('0xc9')]||[];var _0x5911df=[];var _0x279351;return db['CmContact'][_0xab7e('0x66')]()[_0xab7e('0x20')](function(_0x4c1526){if(!_0x4c1526){throw new db[(_0xab7e('0x91'))][(_0xab7e('0x99'))](_0xab7e('0x92'));}_0x22ae01=_[_0xab7e('0x93')](_[_0xab7e('0x45')](_0x4c1526),[_0xab7e('0x94'),_0xab7e('0x95')]);_0xe70b01=_[_0xab7e('0x93')](_[_0xab7e('0x45')](_0x4c1526),['createdAt',_0xab7e('0x95'),_0xab7e('0x96'),_0xab7e('0x97')]);if(_0x598c63[_0xab7e('0x5f')]['id']){delete _0x598c63[_0xab7e('0x5f')]['id'];}if(_[_0xab7e('0x80')](_0x598c63[_0xab7e('0x5f')][_0xab7e('0x98')])){throw _0x3e408d[_0xab7e('0x2c')](0x1f4)[_0xab7e('0x3a')](new db[(_0xab7e('0x91'))][(_0xab7e('0x99'))]('from\x20is\x20mandatory'));}if(_[_0xab7e('0x80')](_0x598c63['body']['body'])||_0x598c63['body'][_0xab7e('0x5f')]===''){throw _0x3e408d[_0xab7e('0x2c')](0x1f4)['send'](new db[(_0xab7e('0x91'))]['ValidationError'](_0xab7e('0x9a')));}if(_[_0xab7e('0x80')](_0x598c63[_0xab7e('0x5f')][_0xab7e('0xca')])){throw _0x3e408d[_0xab7e('0x2c')](0x1f4)[_0xab7e('0x3a')](new db['Sequelize'][(_0xab7e('0x99'))](_0xab7e('0xcb')+_0xe70b01));}if(!_['includes'](_0xe70b01,_0x598c63['body'][_0xab7e('0xca')])){throw _0x3e408d[_0xab7e('0x2c')](0x1f4)[_0xab7e('0x3a')](new db[(_0xab7e('0x91'))][(_0xab7e('0x99'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0xe70b01));}_0x3df878[_0x598c63[_0xab7e('0x5f')][_0xab7e('0xca')]]=_0x598c63[_0xab7e('0x5f')]['from'];})['then'](function(){return db[_0xab7e('0x56')][_0xab7e('0x5d')]({'where':{'id':_0x598c63[_0xab7e('0x5c')]['id']},'include':[{'model':db[_0xab7e('0x9d')],'as':_0xab7e('0xa0')},{'model':db[_0xab7e('0xcc')],'as':_0xab7e('0xcc')}]});})[_0xab7e('0x20')](handleEntityNotFound(_0x3e408d,null))[_0xab7e('0x20')](function(_0x5c9b98){if(_0x5c9b98&&_0x5c9b98[_0xab7e('0xa0')]){_0x39087d=_0x5c9b98;var _0x59f1d5=_['defaults'](_0x598c63[_0xab7e('0x5f')],{'firstName':_0x598c63[_0xab7e('0x5f')][_0xab7e('0x98')],'phone':_0x598c63[_0xab7e('0x5f')][_0xab7e('0x98')],'ListId':_0x5c9b98[_0xab7e('0x97')]});_0x59f1d5[_0x598c63['body'][_0xab7e('0xca')]]=_0x598c63[_0xab7e('0x5f')][_0xab7e('0x98')];return db['CmContact'][_0xab7e('0xcd')]({'where':_0x3df878,'defaults':_0x59f1d5});}})[_0xab7e('0xb9')](function(_0x5014c3){if(_0x5014c3){_0x4bbe1e=_0x5014c3;var _0x3a458b=fs[_0xab7e('0xce')](path[_0xab7e('0x82')](config[_0xab7e('0x7c')],'server/files/templates/chatOfflineMessage.ejs'),_0xab7e('0xcf'));var _0x1a34e4=ejs[_0xab7e('0xd0')](_0x3a458b,{'body':_[_0xab7e('0xd1')](_0x598c63['body'][_0xab7e('0x5f')]),'bodyTitle':_0x39087d[_0xab7e('0xd2')]});return db[_0xab7e('0xd3')][_0xab7e('0x5e')]({'body':_0x1a34e4,'ContactId':_0x5014c3['id'],'ChatWebsiteId':_0x39087d['id']});}})[_0xab7e('0x20')](function(_0x26ac22){_0x279351=_0x26ac22;if(_0x42ac81[_0xab7e('0x4a')]){var _0x1a2346=_0x42ac81[_0xab7e('0x3e')](function(_0x25b630){return{'name':_0x25b630[_0xab7e('0xd4')],'basename':_0x25b630[_0xab7e('0x74')],'type':_0x25b630[_0xab7e('0xd5')],'ChatOfflineMessageId':_0x26ac22['id']};});_0x5911df=_0x1a2346[_0xab7e('0x3e')](_0x482503=>{var _0x16ccc1={'filename':_0x482503[_0xab7e('0x39')],'path':path[_0xab7e('0x82')](config['root'],_0xab7e('0xd6'),'files',_0xab7e('0xd7'),_0xab7e('0xd8'),_0x482503['basename'])};return _0x16ccc1;});if(!_0x39087d[_0xab7e('0xd9')]){return db['sequelize'][_0xab7e('0xda')](function(_0x1dd8da){return db[_0xab7e('0xdb')][_0xab7e('0xdc')](_0x1a2346,{'transaction':_0x1dd8da});});}}})[_0xab7e('0x20')](function(){if(_0x279351){_0x1ad7b0=_0x279351;return db[_0xab7e('0xcc')]['findOne']({'where':{'active':!![]},'include':[{'model':db[_0xab7e('0xdd')],'as':_0xab7e('0xde'),'raw':!![]}]});}})[_0xab7e('0x20')](function(_0x488142){if(_0x488142&&_0x488142['Smtp']&&_0x39087d[_0xab7e('0xdf')]&&_0x39087d[_0xab7e('0xe0')]){var _0x4523dd={'tls':{'rejectUnauthorized':![]}};if(_0x488142[_0xab7e('0xde')][_0xab7e('0xe1')]){_0x4523dd['service']=_0x488142['Smtp']['service'];}else{_0x4523dd['host']=_0x488142[_0xab7e('0xde')][_0xab7e('0xe2')];_0x4523dd[_0xab7e('0xe3')]=_0x488142[_0xab7e('0xde')][_0xab7e('0xe3')];_0x4523dd[_0xab7e('0xe4')]=_0x488142['Smtp'][_0xab7e('0xe4')];}if(_0x488142[_0xab7e('0xde')][_0xab7e('0xe5')]){_0x4523dd[_0xab7e('0xe6')]={'user':_0x488142[_0xab7e('0xde')][_0xab7e('0x60')],'pass':_0x488142[_0xab7e('0xde')][_0xab7e('0xe7')]};}return respondWithRpcPromise(_0xab7e('0xe8'),_0xab7e('0xe9'),{'account':_0x4523dd,'message':{'from':util['format'](_0xab7e('0xea'),_0x488142[_0xab7e('0x39')],_0x488142[_0xab7e('0xeb')]||_0x488142[_0xab7e('0xde')][_0xab7e('0x60')]),'to':_0x39087d[_0xab7e('0xe0')],'subject':_0x39087d[_0xab7e('0xec')],'html':_0x1ad7b0['body'],'attachments':_0x5911df}},client9003)[_0xab7e('0x20')](function(){return _0x1ad7b0;})[_0xab7e('0x2a')](function(_0x429dd3){console[_0xab7e('0x25')](_0x429dd3);});}})[_0xab7e('0x20')](function(){if(_0x39087d&&_0x39087d['openNewInteraction']&&_0x39087d[_0xab7e('0xed')]){var _0x3fe803=[];if(_0x42ac81[_0xab7e('0x4a')]){_0x3fe803=_0x42ac81[_0xab7e('0x3e')](function(_0x22c4bc){return{'name':_0x22c4bc[_0xab7e('0xd4')],'basename':_0x22c4bc[_0xab7e('0x74')],'type':_0x22c4bc[_0xab7e('0xd5')],'ChatOfflineMessageId':_0x279351['id']};});}var _0x7c85e8;if(!_[_0xab7e('0x80')](_0x39087d[_0xab7e('0xee')])){var _0x14e774=_[_0xab7e('0x3e')](_0x598c63['body'],function(_0x15f917){return _0x15f917;});var _0x19af67=_[_0xab7e('0xef')](_0x14e774)[0x0];var _0x17a2d1=_[_0xab7e('0xf0')](_0x19af67,function(_0x2fbe2e){return _0x2fbe2e;});_0x7c85e8=_0x17a2d1[0x1][_0x39087d[_0xab7e('0xee')]];}var _0xeba857={'from':_0x4bbe1e['email'],'firstName':_0x4bbe1e[_0xab7e('0xba')],'lastName':_0x4bbe1e['lastName'],'mapKey':_0xab7e('0xeb'),'message':{'from':_0x4bbe1e[_0xab7e('0xeb')],'to':_0x39087d[_0xab7e('0xcc')][_0xab7e('0xeb')],'cc':'','subject':_[_0xab7e('0x80')](_0x7c85e8)?_0x39087d[_0xab7e('0xec')]:_0x7c85e8,'messageId':'','sentAt':new Date(),'attach':_0x3fe803['length'],'attachments':_0x3fe803,'originChannel':'Chat','ChatWebsiteId':_0x39087d['id'],'ChatOfflineMessageId':_0x1ad7b0['id'],'originTo':_0x39087d[_0xab7e('0xcc')][_0xab7e('0xeb')]},'body':_0x1ad7b0[_0xab7e('0x5f')]};var _0x39b3bb={'account':{'id':_0x39087d[_0xab7e('0xed')]},'body':_0xeba857,'log':_0xab7e('0xf1')};return respondWithRpcPromise(_0xab7e('0xf1'),_0xab7e('0xf2'),_0x39b3bb,client9001)[_0xab7e('0x20')](function(){return _0x1ad7b0;})[_0xab7e('0x2a')](function(_0x2199f8){console[_0xab7e('0x25')](_0x2199f8);});}return;})[_0xab7e('0x20')](function(){if(_0x1ad7b0){return _0x1ad7b0;}})['then'](respondWithResult(_0x3e408d,null))[_0xab7e('0x2a')](function(_0x3e23c1){console[_0xab7e('0x25')]('catch',_0x3e23c1);for(var _0x269467 of _0x42ac81){var _0x2aa049=path[_0xab7e('0x82')](config['root'],'server',_0xab7e('0xc9'),_0xab7e('0xd7'),_0xab7e('0xd8'),_0x269467[_0xab7e('0x74')]);fs_extra[_0xab7e('0xf3')](_0x2aa049)[_0xab7e('0x2a')](function(_0x4b56fe){console[_0xab7e('0x25')](_0xab7e('0xf4'),_0x2aa049,_0x4b56fe);});}});};exports['addInteraction']=function(_0x468f81,_0x12ea06,_0xc02cdc){return db[_0xab7e('0xb5')]['find']({'where':{'id':_0x468f81['params']['id']}})[_0xab7e('0x20')](handleEntityNotFound(_0x12ea06,null))['then'](function(_0xa7b65b){if(_0xa7b65b){return _0xa7b65b[_0xab7e('0xf5')](_0x468f81['body'][_0xab7e('0x70')],_['omit'](_0x468f81[_0xab7e('0x5f')],['ids','id'])||{});}})[_0xab7e('0x20')](respondWithResult(_0x12ea06,null))['catch'](handleError(_0x12ea06,null));};exports[_0xab7e('0xf6')]=function(_0x2d1e5d,_0xe8f8b2,_0xd3d5cc){var _0x4402ad={'raw':![],'where':{}};var _0x3f2877={};var _0x1f4c61={'count':0x0,'rows':[]};return db[_0xab7e('0x56')]['findOne']({'where':{'id':_0x2d1e5d[_0xab7e('0x5c')]['id']}})[_0xab7e('0x20')](handleEntityNotFound(_0xe8f8b2,null))[_0xab7e('0x20')](function(_0x3e5c21){if(_0x3e5c21){_0x3f2877[_0xab7e('0x43')]=_[_0xab7e('0x45')](db['ChatInteraction'][_0xab7e('0x3f')]);_0x3f2877[_0xab7e('0x44')]=_[_0xab7e('0x45')](_0x2d1e5d['query']);_0x3f2877['filters']=_['intersection'](_0x3f2877[_0xab7e('0x43')],_0x3f2877[_0xab7e('0x44')]);_0x4402ad[_0xab7e('0x49')]=_[_0xab7e('0x47')](_0x3f2877[_0xab7e('0x43')],qs['fields'](_0x2d1e5d[_0xab7e('0x44')][_0xab7e('0x48')]));_0x4402ad[_0xab7e('0x49')]=_0x4402ad['attributes'][_0xab7e('0x4a')]?_0x4402ad[_0xab7e('0x49')]:_0x3f2877['model'];if(!_0x2d1e5d[_0xab7e('0x44')][_0xab7e('0x4b')]('nolimit')){_0x4402ad['limit']=qs[_0xab7e('0x4d')](_0x2d1e5d[_0xab7e('0x44')][_0xab7e('0x4d')]);_0x4402ad[_0xab7e('0x2f')]=qs[_0xab7e('0x2f')](_0x2d1e5d[_0xab7e('0x44')][_0xab7e('0x2f')]);}_0x4402ad['order']=qs[_0xab7e('0x4f')](_0x2d1e5d[_0xab7e('0x44')]['sort']);_0x4402ad[_0xab7e('0x50')]=qs[_0xab7e('0x46')](_[_0xab7e('0x51')](_0x2d1e5d['query'],_0x3f2877[_0xab7e('0x46')]));_0x4402ad[_0xab7e('0x50')][_0xab7e('0x68')]=_0x3e5c21['id'];if(_0x2d1e5d['query'][_0xab7e('0x54')]){_0x4402ad[_0xab7e('0x50')]=_[_0xab7e('0x52')](_0x4402ad[_0xab7e('0x50')],{'$or':_[_0xab7e('0x3e')](_0x4402ad[_0xab7e('0x49')],function(_0x25f246){var _0x5cba7b={};_0x5cba7b[_0x25f246]={'$like':'%'+_0x2d1e5d[_0xab7e('0x44')][_0xab7e('0x54')]+'%'};return _0x5cba7b;})});}_0x4402ad=_[_0xab7e('0x52')]({},_0x4402ad,_0x2d1e5d['options']);return db[_0xab7e('0xb5')]['count']({'where':_0x4402ad[_0xab7e('0x50')]})[_0xab7e('0x20')](function(_0x236b95){_0x1f4c61[_0xab7e('0x31')]=_0x236b95;if(_0x2d1e5d['query'][_0xab7e('0x57')]){_0x4402ad[_0xab7e('0x58')]=[{'model':db[_0xab7e('0x90')],'as':'Contact','required':![]},{'model':db[_0xab7e('0xc3')],'as':'Owner','attributes':[_0xab7e('0x39'),_0xab7e('0xf7'),'internal'],'required':![]},{'model':db[_0xab7e('0xf8')],'as':_0xab7e('0xf9'),'attributes':['id',_0xab7e('0x39'),_0xab7e('0xfa')],'where':_0x2d1e5d[_0xab7e('0x44')]['tag']?{'id':_0x2d1e5d[_0xab7e('0x44')]['tag']}:undefined,'required':_0x2d1e5d[_0xab7e('0x44')][_0xab7e('0xfb')]?!![]:![]}];}return db[_0xab7e('0xb5')][_0xab7e('0x59')](_0x4402ad);})[_0xab7e('0x20')](function(_0x329c00){_0x1f4c61['rows']=_0x329c00;return _0x1f4c61;});}})[_0xab7e('0x20')](respondWithFilteredResult(_0xe8f8b2,_0x4402ad))[_0xab7e('0x2a')](handleError(_0xe8f8b2,null));};function iftimePromise(_0x201a8c,_0x38b436){return respondWithRpcPromise(_0xab7e('0xfc'),_0xab7e('0xfd'),{'command':_0x38b436[_0xab7e('0xfe')]?util['format'](_0xab7e('0xff'),_0x201a8c[_0xab7e('0x100')],_0x38b436['timezone']):util[_0xab7e('0xae')](_0xab7e('0x101'),_0x201a8c[_0xab7e('0x100')])},client9002)[_0xab7e('0x20')](function(_0x201222){var _0x37a6a1=_0x201222&&_0x201222[_0xab7e('0x102')]('true')>=0x0?!![]:![];logger[_0xab7e('0x28')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x38b436['id'],_0x201a8c['id'],_0x201a8c['interval'],_0x37a6a1?_0xab7e('0x103'):_0xab7e('0x104'),_0x38b436['timezone']?_0x38b436[_0xab7e('0xfe')]:_0xab7e('0x105'));return _0x37a6a1;})[_0xab7e('0x2a')](function(_0x3ff952){logger[_0xab7e('0x25')](_0xab7e('0x106'),_0x38b436['id'],_0x201a8c['id'],_0x201a8c['interval'],util[_0xab7e('0x107')](_0x3ff952,{'showHidden':![],'depth':null}),_0x38b436[_0xab7e('0xfe')]?_0x38b436[_0xab7e('0xfe')]:'No\x20timezone');return![];});}exports[_0xab7e('0xfd')]=function(_0x38b44b,_0x20eacd,_0x47494b){var _0x417709=0x0;var _0x5a51ad=0x0;var _0x53a365=![];var _0x3cb9cb;var _0x5e4bd1;return db[_0xab7e('0x56')]['find']({'where':{'id':_0x38b44b[_0xab7e('0x5c')]['id']},'include':[{'model':db[_0xab7e('0x108')],'as':_0xab7e('0x108'),'include':[{'model':db['Interval'],'as':'Intervals','attributes':['id',_0xab7e('0x100')],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x20eacd,null))[_0xab7e('0x20')](function(_0x1fa7c2){if(_0x1fa7c2){_0x3cb9cb=_0x1fa7c2;return _0x1fa7c2['getProactiveActions']({'raw':!![]});}})[_0xab7e('0x20')](function(_0x145178){if(_0x3cb9cb){if(_0x145178){_0x5e4bd1=_0x145178;}}return require(_0xab7e('0x15'))[_0xab7e('0x7e')]();})[_0xab7e('0x20')](function(_0x1ec21e){if(_0x1ec21e){_0x5a51ad=_0x1ec21e[_0xab7e('0x109')];_0x53a365=_0x1ec21e[_0xab7e('0x7f')];}})['then'](function(){return db[_0xab7e('0xb5')][_0xab7e('0x31')]({'where':{'closed':![]}});})[_0xab7e('0x20')](function(_0x1bfec0){_0x417709=_0x1bfec0;if(_0x5a51ad&&_0x1bfec0>_0x5a51ad){return db[_0xab7e('0x10a')][_0xab7e('0x6a')]({'where':{'id':0x1}})[_0xab7e('0x20')](function(_0x2c41c7){if(_0x2c41c7){_0x2c41c7[_0xab7e('0x10b')](_0xab7e('0x10c'));}});}})[_0xab7e('0x20')](function(){if(_0x3cb9cb['Interval']&&_0x3cb9cb['Interval'][_0xab7e('0x10d')]){var _0x15cd95=[];for(var _0x50fe9a=0x0;_0x50fe9a<_0x3cb9cb[_0xab7e('0x108')][_0xab7e('0x10d')][_0xab7e('0x4a')];_0x50fe9a++){var _0x2f26da=_0x3cb9cb[_0xab7e('0x108')][_0xab7e('0x10d')][_0x50fe9a][_0xab7e('0x34')]({'plain':!![]});_0x15cd95[_0xab7e('0xbf')](iftimePromise(_0x2f26da,_0x3cb9cb));}return BPromise[_0xab7e('0x10e')](_0x15cd95)['then'](function(_0x37d156){return _[_0xab7e('0x10f')](_0x37d156);});}else{return!![];}})[_0xab7e('0x20')](function(_0x235688){var _0x30a3bf=fs['readFileSync'](path['join'](config[_0xab7e('0x7c')],_0xab7e('0x110')),_0xab7e('0xcf'));var _0x540e2c={'remote':_0x3cb9cb[_0xab7e('0x111')],'query':querystring[_0xab7e('0x24')](_['merge'](_0x3cb9cb['get']({'plain':!![]}),{'customerIp':_0x38b44b[_0xab7e('0x8d')]['x-forwarded-for']||_0x38b44b[_0xab7e('0x8d')][_0xab7e('0x112')]||_0x38b44b[_0xab7e('0x113')][_0xab7e('0x114')]||_0x38b44b['ip'],'referer':_0x38b44b[_0xab7e('0x8d')][_0xab7e('0xab')],'openedInteractions':_0x417709,'maxInteractions':_0x5a51ad,'virtual':_0x53a365[_0xab7e('0x109')],'online':_0x235688,'custom':_0x53a365}))[_0xab7e('0x115')](/'/g,'\x5c\x27')};_0x20eacd[_0xab7e('0x3a')](ejs['render'](Mustache[_0xab7e('0xd0')](_0x30a3bf,_0x540e2c),{'proactiveActions':_0x5e4bd1,'alignment':_0x3cb9cb[_0xab7e('0x116')],'verticalAlignment':_0x3cb9cb['verticalAlignment'],'div_color':_0x3cb9cb[_0xab7e('0xfa')],'text_color':_0x3cb9cb[_0xab7e('0x117')],'button_color':_0x3cb9cb['color_button'],'background_color':_0x3cb9cb[_0xab7e('0x118')]}));})[_0xab7e('0x2a')](handleError(_0x20eacd,null));};exports[_0xab7e('0x119')]=function(_0x4240c1,_0x5f16e8,_0x51a01d){return db[_0xab7e('0x56')][_0xab7e('0x6a')]({'where':{'id':_0x4240c1[_0xab7e('0x5c')]['id']}})[_0xab7e('0x20')](handleEntityNotFound(_0x5f16e8,null))['then'](function(_0x71534d){if(_0x71534d){return db['sequelize'][_0xab7e('0xda')](function(_0x532006){return db[_0xab7e('0x9e')][_0xab7e('0x37')]({'where':{'ChatWebsiteId':_0x4240c1[_0xab7e('0x5c')]['id']},'transaction':_0x532006})['then'](function(_0x45ea0a){var _0x5ae05f=_[_0xab7e('0x3e')](_0x4240c1[_0xab7e('0x5f')],function(_0x3c7eda){_0x3c7eda[_0xab7e('0x68')]=_0x4240c1[_0xab7e('0x5c')]['id'];return _0x3c7eda;});return db[_0xab7e('0x9e')]['bulkCreate'](_0x5ae05f,{'transaction':_0x532006});});})['then'](function(){return db['ChatApplication'][_0xab7e('0x11a')]({'where':{'ChatWebsiteId':_0x4240c1[_0xab7e('0x5c')]['id']},'order':_0xab7e('0x11b')});});}})[_0xab7e('0x20')](respondWithResult(_0x5f16e8,null))[_0xab7e('0x2a')](handleError(_0x5f16e8,null));};exports[_0xab7e('0x11c')]=function(_0x24d72e,_0x245169,_0x4fc3a1){var _0x187957={};var _0x2a3691={};var _0xcfb6a0;var _0x2c8e57;return db[_0xab7e('0x56')]['findOne']({'where':{'id':_0x24d72e[_0xab7e('0x5c')]['id']}})['then'](handleEntityNotFound(_0x245169,null))[_0xab7e('0x20')](function(_0x41cf53){if(_0x41cf53){_0xcfb6a0=_0x41cf53;_0x2a3691[_0xab7e('0x43')]=_[_0xab7e('0x45')](db['ChatApplication'][_0xab7e('0x3f')]);_0x2a3691['query']=_[_0xab7e('0x45')](_0x24d72e[_0xab7e('0x44')]);_0x2a3691[_0xab7e('0x46')]=_[_0xab7e('0x47')](_0x2a3691[_0xab7e('0x43')],_0x2a3691[_0xab7e('0x44')]);_0x187957[_0xab7e('0x49')]=_[_0xab7e('0x47')](_0x2a3691['model'],qs[_0xab7e('0x48')](_0x24d72e[_0xab7e('0x44')][_0xab7e('0x48')]));_0x187957[_0xab7e('0x49')]=_0x187957[_0xab7e('0x49')][_0xab7e('0x4a')]?_0x187957['attributes']:_0x2a3691[_0xab7e('0x43')];_0x187957[_0xab7e('0x4e')]=qs[_0xab7e('0x4f')](_0x24d72e[_0xab7e('0x44')][_0xab7e('0x4f')]);_0x187957[_0xab7e('0x50')]=qs['filters'](_[_0xab7e('0x51')](_0x24d72e[_0xab7e('0x44')],_0x2a3691['filters']));if(_0x24d72e[_0xab7e('0x44')][_0xab7e('0x54')]){_0x187957[_0xab7e('0x50')]=_[_0xab7e('0x52')](_0x187957[_0xab7e('0x50')],{'$or':_[_0xab7e('0x3e')](_0x187957[_0xab7e('0x49')],function(_0x45fab6){var _0x23d8c7={};_0x23d8c7[_0x45fab6]={'$like':'%'+_0x24d72e['query'][_0xab7e('0x54')]+'%'};return _0x23d8c7;})});}_0x187957=_[_0xab7e('0x52')]({},_0x187957,_0x24d72e[_0xab7e('0x55')]);return _0xcfb6a0[_0xab7e('0x11c')](_0x187957);}})[_0xab7e('0x20')](function(_0x19d388){if(_0x19d388){_0x2c8e57=_0x19d388[_0xab7e('0x4a')];if(!_0x24d72e[_0xab7e('0x44')]['hasOwnProperty'](_0xab7e('0x4c'))){_0x187957[_0xab7e('0x4d')]=qs[_0xab7e('0x4d')](_0x24d72e[_0xab7e('0x44')][_0xab7e('0x4d')]);_0x187957[_0xab7e('0x2f')]=qs[_0xab7e('0x2f')](_0x24d72e[_0xab7e('0x44')][_0xab7e('0x2f')]);}return _0xcfb6a0[_0xab7e('0x11c')](_0x187957);}})[_0xab7e('0x20')](function(_0xcda0c2){if(_0xcda0c2){return _0xcda0c2?{'count':_0x2c8e57,'rows':_0xcda0c2}:null;}})[_0xab7e('0x20')](respondWithResult(_0x245169,null))[_0xab7e('0x2a')](handleError(_0x245169,null));};exports[_0xab7e('0x11d')]=function(_0x4923f6,_0x1789fe,_0x290b52){return db['chatProactiveAction']['find']({'where':{'id':_0x4923f6[_0xab7e('0x5c')]['id']}})['then'](handleEntityNotFound(_0x1789fe,null))[_0xab7e('0x20')](function(_0x2e5937){if(_0x2e5937){return _0x2e5937[_0xab7e('0x11d')](_0x4923f6['body'][_0xab7e('0x70')],_[_0xab7e('0x11e')](_0x4923f6['body'],[_0xab7e('0x70'),'id'])||{});}})[_0xab7e('0x20')](respondWithResult(_0x1789fe,null))[_0xab7e('0x2a')](handleError(_0x1789fe,null));};exports[_0xab7e('0x11f')]=function(_0x59a5e4,_0x56b15e,_0x39242b){var _0x14e08b={};var _0x5b2b3a={};var _0x1a12bd;var _0x486986;return db[_0xab7e('0x56')][_0xab7e('0x6a')]({'where':{'id':_0x59a5e4['params']['id']}})['then'](handleEntityNotFound(_0x56b15e,null))[_0xab7e('0x20')](function(_0x431b78){if(_0x431b78){_0x1a12bd=_0x431b78;_0x5b2b3a[_0xab7e('0x43')]=_[_0xab7e('0x45')](db['ChatProactiveAction'][_0xab7e('0x3f')]);_0x5b2b3a[_0xab7e('0x44')]=_[_0xab7e('0x45')](_0x59a5e4[_0xab7e('0x44')]);_0x5b2b3a[_0xab7e('0x46')]=_[_0xab7e('0x47')](_0x5b2b3a[_0xab7e('0x43')],_0x5b2b3a[_0xab7e('0x44')]);_0x14e08b[_0xab7e('0x49')]=_[_0xab7e('0x47')](_0x5b2b3a[_0xab7e('0x43')],qs['fields'](_0x59a5e4[_0xab7e('0x44')][_0xab7e('0x48')]));_0x14e08b[_0xab7e('0x49')]=_0x14e08b[_0xab7e('0x49')][_0xab7e('0x4a')]?_0x14e08b[_0xab7e('0x49')]:_0x5b2b3a['model'];_0x14e08b[_0xab7e('0x4e')]=qs['sort'](_0x59a5e4[_0xab7e('0x44')][_0xab7e('0x4f')]);_0x14e08b[_0xab7e('0x50')]=qs[_0xab7e('0x46')](_[_0xab7e('0x51')](_0x59a5e4[_0xab7e('0x44')],_0x5b2b3a[_0xab7e('0x46')]));if(_0x59a5e4['query'][_0xab7e('0x54')]){_0x14e08b[_0xab7e('0x50')]=_[_0xab7e('0x52')](_0x14e08b[_0xab7e('0x50')],{'$or':_[_0xab7e('0x3e')](_0x14e08b[_0xab7e('0x49')],function(_0xe55f5b){var _0xaadb8e={};_0xaadb8e[_0xe55f5b]={'$like':'%'+_0x59a5e4[_0xab7e('0x44')][_0xab7e('0x54')]+'%'};return _0xaadb8e;})});}_0x14e08b=_[_0xab7e('0x52')]({},_0x14e08b,_0x59a5e4[_0xab7e('0x55')]);return _0x1a12bd[_0xab7e('0x11f')](_0x14e08b);}})['then'](function(_0x49b934){if(_0x49b934){_0x486986=_0x49b934[_0xab7e('0x4a')];if(!_0x59a5e4[_0xab7e('0x44')]['hasOwnProperty'](_0xab7e('0x4c'))){_0x14e08b[_0xab7e('0x4d')]=qs[_0xab7e('0x4d')](_0x59a5e4['query'][_0xab7e('0x4d')]);_0x14e08b[_0xab7e('0x2f')]=qs[_0xab7e('0x2f')](_0x59a5e4['query'][_0xab7e('0x2f')]);}return _0x1a12bd[_0xab7e('0x11f')](_0x14e08b);}})[_0xab7e('0x20')](function(_0x33b986){if(_0x33b986){return _0x33b986?{'count':_0x486986,'rows':_0x33b986}:null;}})[_0xab7e('0x20')](respondWithResult(_0x56b15e,null))['catch'](handleError(_0x56b15e,null));};exports['getFields']=function(_0x51dd89,_0x4b514d,_0x57b5f8){var _0x41ec3a=_0x51dd89[_0xab7e('0x44')][_0xab7e('0x120')]===_0xab7e('0x121')?_0xab7e('0x122'):'onlineForm';return db[_0xab7e('0x56')][_0xab7e('0x5d')]({'attributes':['id',_0x41ec3a],'where':{'id':_0x51dd89[_0xab7e('0x5c')]['id']}})[_0xab7e('0x20')](handleEntityNotFound(_0x4b514d,null))[_0xab7e('0x20')](function(_0x343ce5){if(_0x343ce5){var _0x3ab911=_0x343ce5[_0x41ec3a];var _0x1d4b2f=_0x3ab911&&_0x3ab911['items']?_0x3ab911[_0xab7e('0x123')]:[];_0x4b514d[_0xab7e('0x3a')]({'fromKey':_[_0xab7e('0x80')](_0x3ab911[_0xab7e('0x124')])?undefined:_0x3ab911[_0xab7e('0x124')],'count':_0x1d4b2f[_0xab7e('0x4a')],'rows':_0x1d4b2f});}})[_0xab7e('0x2a')](handleError(_0x4b514d,null));};exports[_0xab7e('0x125')]=function(_0x300372,_0x261d33,_0x1644b7){var _0x3a7b9d={'raw':![],'where':{}};var _0x4f49cc={};var _0x4fdfcc={'count':0x0,'rows':[]};return db[_0xab7e('0x56')]['findOne']({'where':{'id':_0x300372[_0xab7e('0x5c')]['id']}})['then'](handleEntityNotFound(_0x261d33,null))[_0xab7e('0x20')](function(_0x49d4e7){if(_0x49d4e7){_0x4f49cc[_0xab7e('0x43')]=_[_0xab7e('0x45')](db[_0xab7e('0xd3')]['rawAttributes']);_0x4f49cc[_0xab7e('0x44')]=_[_0xab7e('0x45')](_0x300372[_0xab7e('0x44')]);_0x4f49cc['filters']=_[_0xab7e('0x47')](_0x4f49cc[_0xab7e('0x43')],_0x4f49cc[_0xab7e('0x44')]);_0x3a7b9d[_0xab7e('0x49')]=_[_0xab7e('0x47')](_0x4f49cc['model'],qs[_0xab7e('0x48')](_0x300372[_0xab7e('0x44')][_0xab7e('0x48')]));_0x3a7b9d[_0xab7e('0x49')]=_0x3a7b9d[_0xab7e('0x49')][_0xab7e('0x4a')]?_0x3a7b9d[_0xab7e('0x49')]:_0x4f49cc[_0xab7e('0x43')];if(!_0x300372['query'][_0xab7e('0x4b')]('nolimit')){_0x3a7b9d[_0xab7e('0x4d')]=qs['limit'](_0x300372[_0xab7e('0x44')][_0xab7e('0x4d')]);_0x3a7b9d[_0xab7e('0x2f')]=qs[_0xab7e('0x2f')](_0x300372[_0xab7e('0x44')]['offset']);}_0x3a7b9d[_0xab7e('0x4e')]=qs[_0xab7e('0x4f')](_0x300372[_0xab7e('0x44')]['sort']);_0x3a7b9d[_0xab7e('0x50')]=qs['filters'](_[_0xab7e('0x51')](_0x300372[_0xab7e('0x44')],_0x4f49cc[_0xab7e('0x46')]));_0x3a7b9d['where']['ChatWebsiteId']=_0x49d4e7['id'];if(_0x300372[_0xab7e('0x44')]['filter']){_0x3a7b9d[_0xab7e('0x50')]=_[_0xab7e('0x52')](_0x3a7b9d[_0xab7e('0x50')],{'$or':_['map'](_0x3a7b9d['attributes'],function(_0x53dcc3){var _0x71e39a={};_0x71e39a[_0x53dcc3]={'$like':'%'+_0x300372[_0xab7e('0x44')][_0xab7e('0x54')]+'%'};return _0x71e39a;})});}_0x3a7b9d=_['merge']({},_0x3a7b9d,_0x300372[_0xab7e('0x55')]);return db[_0xab7e('0xd3')][_0xab7e('0x31')]({'where':_0x3a7b9d['where']})[_0xab7e('0x20')](function(_0x3fd9c7){_0x4fdfcc['count']=_0x3fd9c7;if(_0x300372['query'][_0xab7e('0x57')]){_0x3a7b9d[_0xab7e('0x58')]=[{'all':!![]}];}else{_0x3a7b9d['include']=[{'model':db[_0xab7e('0x90')],'as':_0xab7e('0x126'),'required':![]},{'model':db[_0xab7e('0xdb')],'as':'Attachments','required':![]}];}return db[_0xab7e('0xd3')]['findAll'](_0x3a7b9d);})[_0xab7e('0x20')](function(_0xa90a97){_0x4fdfcc[_0xab7e('0x5a')]=_0xa90a97;return _0x4fdfcc;});}})[_0xab7e('0x20')](respondWithFilteredResult(_0x261d33,_0x3a7b9d))[_0xab7e('0x2a')](handleError(_0x261d33,null));};exports[_0xab7e('0x127')]=function(_0x4fc0df,_0x27995c,_0x4e0e10){return db['ChatWebsite'][_0xab7e('0x5d')]({'where':{'id':_0x4fc0df[_0xab7e('0x5c')]['id']}})['then'](handleEntityNotFound(_0x27995c,null))[_0xab7e('0x20')](function(_0x5f10b0){if(_0x5f10b0){return _0x5f10b0[_0xab7e('0x127')](_0x4fc0df[_0xab7e('0x5f')][_0xab7e('0x70')],_[_0xab7e('0x11e')](_0x4fc0df['body'],['ids','id'])||{})[_0xab7e('0xb9')](function(_0xfc4710){for(var _0x661b99=0x0;_0x661b99<_0x4fc0df[_0xab7e('0x5f')][_0xab7e('0x70')][_0xab7e('0x4a')];_0x661b99+=0x1){socket[_0xab7e('0x128')](_0xab7e('0x129'),{'UserId':Number(_0x4fc0df[_0xab7e('0x5f')][_0xab7e('0x70')][_0x661b99]),'ChatWebsiteId':Number(_0x4fc0df['params']['id'])});}return _0xfc4710;});}})[_0xab7e('0x20')](respondWithResult(_0x27995c,null))[_0xab7e('0x2a')](handleError(_0x27995c,null));};exports['removeAgents']=function(_0x39f782,_0x54ef60,_0x30f4ae){return db[_0xab7e('0x56')][_0xab7e('0x5d')]({'where':{'id':_0x39f782['params']['id']}})[_0xab7e('0x20')](handleEntityNotFound(_0x54ef60,null))[_0xab7e('0x20')](function(_0x378f37){if(_0x378f37){return _0x378f37[_0xab7e('0x12a')](_0x39f782[_0xab7e('0x44')][_0xab7e('0x70')])[_0xab7e('0x20')](function(){if(_[_0xab7e('0x12b')](_0x39f782[_0xab7e('0x44')]['ids'])){for(var _0x170ac4=0x0;_0x170ac4<_0x39f782[_0xab7e('0x44')][_0xab7e('0x70')]['length'];_0x170ac4+=0x1){socket[_0xab7e('0x128')](_0xab7e('0x12c'),{'UserId':Number(_0x39f782[_0xab7e('0x44')][_0xab7e('0x70')][_0x170ac4]),'ChatWebsiteId':Number(_0x39f782[_0xab7e('0x5c')]['id'])});}}else{socket[_0xab7e('0x128')](_0xab7e('0x12c'),{'UserId':Number(_0x39f782['query']['ids']),'ChatWebsiteId':Number(_0x39f782[_0xab7e('0x5c')]['id'])});}});}})['then'](respondWithStatusCode(_0x54ef60,null))[_0xab7e('0x2a')](handleError(_0x54ef60,null));};exports[_0xab7e('0x12d')]=function(_0x5c75c9,_0x4d7d6c,_0x4176d6){var _0x4de977={};var _0x1a9534={};var _0xf113a9;var _0x3a9c06;return db[_0xab7e('0x56')][_0xab7e('0x6a')]({'where':{'id':_0x5c75c9['params']['id']}})[_0xab7e('0x20')](handleEntityNotFound(_0x4d7d6c,null))[_0xab7e('0x20')](function(_0x40575a){if(_0x40575a){_0xf113a9=_0x40575a;_0x1a9534[_0xab7e('0x43')]=_[_0xab7e('0x45')](db[_0xab7e('0xc3')]['rawAttributes']);_0x1a9534['query']=_['keys'](_0x5c75c9[_0xab7e('0x44')]);_0x1a9534['filters']=_[_0xab7e('0x47')](_0x1a9534[_0xab7e('0x43')],_0x1a9534[_0xab7e('0x44')]);_0x4de977[_0xab7e('0x49')]=_['intersection'](_0x1a9534[_0xab7e('0x43')],qs[_0xab7e('0x48')](_0x5c75c9['query'][_0xab7e('0x48')]));_0x4de977[_0xab7e('0x49')]=_0x4de977[_0xab7e('0x49')]['length']?_0x4de977[_0xab7e('0x49')]:_0x1a9534[_0xab7e('0x43')];_0x4de977[_0xab7e('0x4e')]=qs['sort'](_0x5c75c9[_0xab7e('0x44')][_0xab7e('0x4f')]);_0x4de977[_0xab7e('0x50')]=qs[_0xab7e('0x46')](_[_0xab7e('0x51')](_0x5c75c9[_0xab7e('0x44')],_0x1a9534[_0xab7e('0x46')]));if(_0x5c75c9[_0xab7e('0x44')][_0xab7e('0x54')]){_0x4de977['where']=_[_0xab7e('0x52')](_0x4de977[_0xab7e('0x50')],{'$or':_[_0xab7e('0x3e')](_0x4de977[_0xab7e('0x49')],function(_0xd2a692){var _0x10c4be={};_0x10c4be[_0xd2a692]={'$like':'%'+_0x5c75c9[_0xab7e('0x44')][_0xab7e('0x54')]+'%'};return _0x10c4be;})});}_0x4de977=_[_0xab7e('0x52')]({},_0x4de977,_0x5c75c9[_0xab7e('0x55')]);return _0xf113a9['getAgents'](_0x4de977);}})[_0xab7e('0x20')](function(_0x4e838a){if(_0x4e838a){_0x3a9c06=_0x4e838a[_0xab7e('0x4a')];if(!_0x5c75c9['query'][_0xab7e('0x4b')](_0xab7e('0x4c'))){_0x4de977['limit']=qs[_0xab7e('0x4d')](_0x5c75c9['query'][_0xab7e('0x4d')]);_0x4de977[_0xab7e('0x2f')]=qs[_0xab7e('0x2f')](_0x5c75c9[_0xab7e('0x44')]['offset']);}return _0xf113a9[_0xab7e('0x12d')](_0x4de977);}})[_0xab7e('0x20')](function(_0x19eaf7){if(_0x19eaf7){return _0x19eaf7?{'count':_0x3a9c06,'rows':_0x19eaf7}:null;}})['then'](respondWithResult(_0x4d7d6c,null))['catch'](handleError(_0x4d7d6c,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 649a4cf..08e08a3 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 _0xaa19=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatWebsite','setMaxListeners','update'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0xaa19,0x79));var _0x9aa1=function(_0x32f98e,_0x5c1821){_0x32f98e=_0x32f98e-0x0;var _0x4944f3=_0xaa19[_0x32f98e];return _0x4944f3;};'use strict';var EventEmitter=require(_0x9aa1('0x0'));var ChatWebsite=require(_0x9aa1('0x1'))['db'][_0x9aa1('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x9aa1('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x9aa1('0x4'),'afterDestroy':'remove'};function emitEvent(_0x15dd20){return function(_0x58fb46,_0x11fd1b,_0x36a679){ChatWebsiteEvents[_0x9aa1('0x5')](_0x15dd20+':'+_0x58fb46['id'],_0x58fb46);ChatWebsiteEvents['emit'](_0x15dd20,_0x58fb46);_0x36a679(null);};}for(var e in events){if(events[_0x9aa1('0x6')](e)){var event=events[e];ChatWebsite[_0x9aa1('0x7')](e,emitEvent(event));}}module[_0x9aa1('0x8')]=ChatWebsiteEvents; \ No newline at end of file +var _0x3ee5=['save','update','remove','emit','hasOwnProperty','hook','../../mysqldb','ChatWebsite'];(function(_0x1a5631,_0x1af65a){var _0x4d0e02=function(_0x592e1f){while(--_0x592e1f){_0x1a5631['push'](_0x1a5631['shift']());}};_0x4d0e02(++_0x1af65a);}(_0x3ee5,0x1b6));var _0x53ee=function(_0x4fffcf,_0x49b324){_0x4fffcf=_0x4fffcf-0x0;var _0x544752=_0x3ee5[_0x4fffcf];return _0x544752;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0x53ee('0x0'))['db'][_0x53ee('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x53ee('0x2'),'afterUpdate':_0x53ee('0x3'),'afterDestroy':_0x53ee('0x4')};function emitEvent(_0x24e272){return function(_0x25e597,_0x119975,_0x21c99a){ChatWebsiteEvents[_0x53ee('0x5')](_0x24e272+':'+_0x25e597['id'],_0x25e597);ChatWebsiteEvents[_0x53ee('0x5')](_0x24e272,_0x25e597);_0x21c99a(null);};}for(var e in events){if(events[_0x53ee('0x6')](e)){var event=events[e];ChatWebsite[_0x53ee('0x7')](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 ea020cf..7463e6b 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 _0x7216=['request-promise','path','./chatWebsite.attributes','ChatWebsite','chat_websites','lodash','../../config/logger','api','moment','bluebird'];(function(_0x4ac0f1,_0x4b4686){var _0x1dfc0d=function(_0xe86617){while(--_0xe86617){_0x4ac0f1['push'](_0x4ac0f1['shift']());}};_0x1dfc0d(++_0x4b4686);}(_0x7216,0x181));var _0x6721=function(_0x5847bc,_0x305090){_0x5847bc=_0x5847bc-0x0;var _0x2a1fb0=_0x7216[_0x5847bc];return _0x2a1fb0;};'use strict';var _=require(_0x6721('0x0'));var util=require('util');var logger=require(_0x6721('0x1'))(_0x6721('0x2'));var moment=require(_0x6721('0x3'));var BPromise=require(_0x6721('0x4'));var rp=require(_0x6721('0x5'));var fs=require('fs');var path=require(_0x6721('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6721('0x7'));module['exports']=function(_0x716f00,_0x57ca73){return _0x716f00['define'](_0x6721('0x8'),attributes,{'tableName':_0x6721('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9581=['request-promise','path','rimraf','../../config/environment','chat_websites','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x2bc293,_0x2749be){var _0x2f83ed=function(_0x1d53d1){while(--_0x1d53d1){_0x2bc293['push'](_0x2bc293['shift']());}};_0x2f83ed(++_0x2749be);}(_0x9581,0x191));var _0x1958=function(_0x1beebe,_0x5594ae){_0x1beebe=_0x1beebe-0x0;var _0x2bd4c3=_0x9581[_0x1beebe];return _0x2bd4c3;};'use strict';var _=require(_0x1958('0x0'));var util=require(_0x1958('0x1'));var logger=require(_0x1958('0x2'))(_0x1958('0x3'));var moment=require(_0x1958('0x4'));var BPromise=require(_0x1958('0x5'));var rp=require(_0x1958('0x6'));var fs=require('fs');var path=require(_0x1958('0x7'));var rimraf=require(_0x1958('0x8'));var config=require(_0x1958('0x9'));var attributes=require('./chatWebsite.attributes');module['exports']=function(_0x9d2dab,_0x483514){return _0x9d2dab['define']('ChatWebsite',attributes,{'tableName':_0x1958('0xa'),'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 aff8f10..921bda5 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 _0x455a=['code','message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','request','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error'];(function(_0x5943d3,_0x41e5fe){var _0x2e8469=function(_0x5786e1){while(--_0x5786e1){_0x5943d3['push'](_0x5943d3['shift']());}};_0x2e8469(++_0x41e5fe);}(_0x455a,0x10a));var _0xa455=function(_0x336fa0,_0x4e8281){_0x336fa0=_0x336fa0-0x0;var _0x4d1399=_0x455a[_0x336fa0];return _0x4d1399;};'use strict';var _=require(_0xa455('0x0'));var util=require(_0xa455('0x1'));var moment=require(_0xa455('0x2'));var BPromise=require(_0xa455('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa455('0x4'));var db=require(_0xa455('0x5'))['db'];var utils=require(_0xa455('0x6'));var logger=require(_0xa455('0x7'))(_0xa455('0x8'));var config=require(_0xa455('0x9'));var jayson=require(_0xa455('0xa'));var client=jayson[_0xa455('0xb')][_0xa455('0xc')]({'port':0x232a});config[_0xa455('0xd')]=_['defaults'](config[_0xa455('0xd')],{'host':_0xa455('0xe'),'port':0x18eb});var socket=require(_0xa455('0xf'))(new Redis(config['redis']));require(_0xa455('0x10'))[_0xa455('0x11')](socket);function respondWithRpcPromise(_0x4fd20a,_0x428180,_0x1b0586){return new BPromise(function(_0x2805f6,_0x52ed0a){return client[_0xa455('0x12')](_0x4fd20a,_0x1b0586)['then'](function(_0x5b61d3){logger['info'](_0xa455('0x13'),_0x428180,_0xa455('0x14'));logger[_0xa455('0x15')](_0xa455('0x16'),_0x428180,'request\x20sent',JSON['stringify'](_0x5b61d3));if(_0x5b61d3[_0xa455('0x17')]){if(_0x5b61d3['error'][_0xa455('0x18')]===0x1f4){logger[_0xa455('0x17')](_0xa455('0x13'),_0x428180,_0x5b61d3[_0xa455('0x17')][_0xa455('0x19')]);return _0x52ed0a(_0x5b61d3[_0xa455('0x17')][_0xa455('0x19')]);}logger['error'](_0xa455('0x13'),_0x428180,_0x5b61d3[_0xa455('0x17')][_0xa455('0x19')]);return _0x2805f6(_0x5b61d3[_0xa455('0x17')][_0xa455('0x19')]);}else{logger[_0xa455('0x1a')](_0xa455('0x13'),_0x428180,_0xa455('0x14'));_0x2805f6(_0x5b61d3[_0xa455('0x1b')][_0xa455('0x19')]);}})[_0xa455('0x1c')](function(_0x36b55c){logger[_0xa455('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x428180,_0x36b55c);_0x52ed0a(_0x36b55c);});});} \ No newline at end of file +var _0xb5c4=['rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','./chatWebsite.socket','register','request','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0xb5c4,0xc8));var _0x4b5c=function(_0x12b4d4,_0x2134e9){_0x12b4d4=_0x12b4d4-0x0;var _0x32604e=_0xb5c4[_0x12b4d4];return _0x32604e;};'use strict';var _=require('lodash');var util=require(_0x4b5c('0x0'));var moment=require(_0x4b5c('0x1'));var BPromise=require(_0x4b5c('0x2'));var rs=require(_0x4b5c('0x3'));var fs=require('fs');var Redis=require(_0x4b5c('0x4'));var db=require(_0x4b5c('0x5'))['db'];var utils=require(_0x4b5c('0x6'));var logger=require(_0x4b5c('0x7'))(_0x4b5c('0x8'));var config=require(_0x4b5c('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x4b5c('0xa')][_0x4b5c('0xb')]({'port':0x232a});config[_0x4b5c('0xc')]=_[_0x4b5c('0xd')](config[_0x4b5c('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x4b5c('0xe'))(new Redis(config[_0x4b5c('0xc')]));require(_0x4b5c('0xf'))[_0x4b5c('0x10')](socket);function respondWithRpcPromise(_0x558f41,_0x2b2aec,_0x441b52){return new BPromise(function(_0x3203e6,_0x2b75b8){return client[_0x4b5c('0x11')](_0x558f41,_0x441b52)['then'](function(_0x10aaa8){logger[_0x4b5c('0x12')](_0x4b5c('0x13'),_0x2b2aec,_0x4b5c('0x14'));logger['debug']('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x2b2aec,_0x4b5c('0x14'),JSON[_0x4b5c('0x15')](_0x10aaa8));if(_0x10aaa8[_0x4b5c('0x16')]){if(_0x10aaa8[_0x4b5c('0x16')][_0x4b5c('0x17')]===0x1f4){logger[_0x4b5c('0x16')]('ChatWebsite,\x20%s,\x20%s',_0x2b2aec,_0x10aaa8[_0x4b5c('0x16')]['message']);return _0x2b75b8(_0x10aaa8[_0x4b5c('0x16')][_0x4b5c('0x18')]);}logger[_0x4b5c('0x16')]('ChatWebsite,\x20%s,\x20%s',_0x2b2aec,_0x10aaa8[_0x4b5c('0x16')][_0x4b5c('0x18')]);return _0x3203e6(_0x10aaa8[_0x4b5c('0x16')][_0x4b5c('0x18')]);}else{logger[_0x4b5c('0x12')]('ChatWebsite,\x20%s,\x20%s',_0x2b2aec,_0x4b5c('0x14'));_0x3203e6(_0x10aaa8[_0x4b5c('0x19')]['message']);}})['catch'](function(_0x50b356){logger[_0x4b5c('0x16')](_0x4b5c('0x13'),_0x2b2aec,_0x50b356);_0x2b75b8(_0x50b356);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index ffbc654..8b29f5a 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 _0xc8a3=['removeListener','length','./chatWebsite.events','save','remove','emit'];(function(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0xc8a3,0x140));var _0x3c8a=function(_0x10da33,_0xcbf5db){_0x10da33=_0x10da33-0x0;var _0x17275f=_0xc8a3[_0x10da33];return _0x17275f;};'use strict';var ChatWebsiteEvents=require(_0x3c8a('0x0'));var events=[_0x3c8a('0x1'),_0x3c8a('0x2'),'update'];function createListener(_0x222feb,_0x2ea092){return function(_0x17fef8){_0x2ea092[_0x3c8a('0x3')](_0x222feb,_0x17fef8);};}function removeListener(_0x4c46bc,_0x46fe80){return function(){ChatWebsiteEvents[_0x3c8a('0x4')](_0x4c46bc,_0x46fe80);};}exports['register']=function(_0x5a4fcf){for(var _0x15f6ac=0x0,_0x38c735=events[_0x3c8a('0x5')];_0x15f6ac<_0x38c735;_0x15f6ac++){var _0x4f3590=events[_0x15f6ac];var _0x4c7b40=createListener('chatWebsite:'+_0x4f3590,_0x5a4fcf);ChatWebsiteEvents['on'](_0x4f3590,_0x4c7b40);}}; \ No newline at end of file +var _0x455a=['removeListener','length','chatWebsite:','./chatWebsite.events','save','remove','update'];(function(_0x577722,_0xcaa9af){var _0x409f2d=function(_0x47f53c){while(--_0x47f53c){_0x577722['push'](_0x577722['shift']());}};_0x409f2d(++_0xcaa9af);}(_0x455a,0x10d));var _0xa455=function(_0x502eb0,_0x6d0814){_0x502eb0=_0x502eb0-0x0;var _0x4f78e4=_0x455a[_0x502eb0];return _0x4f78e4;};'use strict';var ChatWebsiteEvents=require(_0xa455('0x0'));var events=[_0xa455('0x1'),_0xa455('0x2'),_0xa455('0x3')];function createListener(_0xc10cfe,_0x27b956){return function(_0x1d00cf){_0x27b956['emit'](_0xc10cfe,_0x1d00cf);};}function removeListener(_0x1886b7,_0x559ff1){return function(){ChatWebsiteEvents[_0xa455('0x4')](_0x1886b7,_0x559ff1);};}exports['register']=function(_0x1bdd5f){for(var _0x36fa2b=0x0,_0x43a266=events[_0xa455('0x5')];_0x36fa2b<_0x43a266;_0x36fa2b++){var _0x2f368b=events[_0x36fa2b];var _0xb69dab=createListener(_0xa455('0x6')+_0x2f368b,_0x1bdd5f);ChatWebsiteEvents['on'](_0x2f368b,_0xb69dab);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index b528352..b886a8a 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 _0x721d=['addCustomerAvatar','/:id/notify','notify','server/files','attachments','ensureDir','replace','extname','/:id/offline','any','offline','/:id/interactions','addInteraction','addApplications','addProactiveActions','addAgents','put','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./chatWebsite.controller','get','/describe','describe','/:id','show','/:id/dispositions','isAuthenticated','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','/:id/system_avatar','getSystemAvatar','/:id/snippet','getSnippet','/:id/applications','getApplications','getProactiveActions','/:id/fields','getFields','/:id/users','getAgents','post','create','addDisposition','addAnswer','diskStorage','join','root','format','%s-%s','now','originalname','single','file','addLogo','server/files/images/avatars/','addAvatar'];(function(_0x10ec04,_0x45ca9d){var _0x46eca4=function(_0x307ba1){while(--_0x307ba1){_0x10ec04['push'](_0x10ec04['shift']());}};_0x46eca4(++_0x45ca9d);}(_0x721d,0xf5));var _0xd721=function(_0x4940a0,_0x3f9be1){_0x4940a0=_0x4940a0-0x0;var _0x556f14=_0x721d[_0x4940a0];return _0x556f14;};'use strict';var multer=require(_0xd721('0x0'));var util=require(_0xd721('0x1'));var path=require(_0xd721('0x2'));var timeout=require(_0xd721('0x3'));var express=require(_0xd721('0x4'));var router=express[_0xd721('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xd721('0x6'));var interaction=require(_0xd721('0x7'));var config=require('../../config/environment');var controller=require(_0xd721('0x8'));router[_0xd721('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xd721('0x9')](_0xd721('0xa'),auth['isAuthenticated'](),controller[_0xd721('0xb')]);router[_0xd721('0x9')](_0xd721('0xc'),auth['isAuthenticated'](),controller[_0xd721('0xd')]);router[_0xd721('0x9')](_0xd721('0xe'),auth[_0xd721('0xf')](),controller[_0xd721('0x10')]);router[_0xd721('0x9')](_0xd721('0x11'),auth[_0xd721('0xf')](),controller[_0xd721('0x12')]);router[_0xd721('0x9')](_0xd721('0x13'),controller[_0xd721('0x14')]);router[_0xd721('0x9')](_0xd721('0x15'),controller[_0xd721('0x16')]);router['get'](_0xd721('0x17'),controller['getCustomerAvatar']);router[_0xd721('0x9')](_0xd721('0x18'),controller[_0xd721('0x19')]);router[_0xd721('0x9')]('/:id/interactions',auth[_0xd721('0xf')](),controller['getInteractions']);router[_0xd721('0x9')](_0xd721('0x1a'),controller[_0xd721('0x1b')]);router[_0xd721('0x9')](_0xd721('0x1c'),auth[_0xd721('0xf')](),controller[_0xd721('0x1d')]);router[_0xd721('0x9')]('/:id/proactive_actions',auth[_0xd721('0xf')](),controller[_0xd721('0x1e')]);router[_0xd721('0x9')](_0xd721('0x1f'),controller[_0xd721('0x20')]);router[_0xd721('0x9')]('/:id/offline_messages',auth[_0xd721('0xf')](),controller['getOfflineMessages']);router['get'](_0xd721('0x21'),auth[_0xd721('0xf')](),controller[_0xd721('0x22')]);router[_0xd721('0x23')]('/',auth[_0xd721('0xf')](),controller[_0xd721('0x24')]);router[_0xd721('0x23')]('/:id/dispositions',auth[_0xd721('0xf')](),controller[_0xd721('0x25')]);router[_0xd721('0x23')](_0xd721('0x11'),auth[_0xd721('0xf')](),controller[_0xd721('0x26')]);var upload=multer({'storage':multer[_0xd721('0x27')]({'destination':function(_0x4ed9d6,_0x16269d,_0x271f93){_0x271f93(null,path[_0xd721('0x28')](config[_0xd721('0x29')],'server/files/images/logos/'));},'filename':function(_0xe0f0d4,_0x80f96d,_0x4a478e){_0x4a478e(null,util[_0xd721('0x2a')](_0xd721('0x2b'),Date[_0xd721('0x2c')](),_0x80f96d[_0xd721('0x2d')]));}})});router[_0xd721('0x23')](_0xd721('0x13'),upload[_0xd721('0x2e')](_0xd721('0x2f')),controller[_0xd721('0x30')]);var upload=multer({'storage':multer[_0xd721('0x27')]({'destination':function(_0x5a2064,_0x47a72d,_0x1938cf){_0x1938cf(null,path[_0xd721('0x28')](config[_0xd721('0x29')],_0xd721('0x31')));},'filename':function(_0x46fd59,_0xb706de,_0x27a605){_0x27a605(null,util['format'](_0xd721('0x2b'),Date[_0xd721('0x2c')](),_0xb706de[_0xd721('0x2d')]));}})});router[_0xd721('0x23')](_0xd721('0x15'),upload[_0xd721('0x2e')]('file'),controller[_0xd721('0x32')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xb0f3,_0x418432,_0x5aaa11){_0x5aaa11(null,path[_0xd721('0x28')](config[_0xd721('0x29')],_0xd721('0x31')));},'filename':function(_0x9322a,_0x141c89,_0x34bbfc){_0x34bbfc(null,util[_0xd721('0x2a')](_0xd721('0x2b'),Date['now'](),_0x141c89[_0xd721('0x2d')]));}})});router[_0xd721('0x23')](_0xd721('0x17'),upload[_0xd721('0x2e')](_0xd721('0x2f')),controller[_0xd721('0x33')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x38ad8d,_0x5849fc,_0x505de1){_0x505de1(null,path[_0xd721('0x28')](config[_0xd721('0x29')],_0xd721('0x31')));},'filename':function(_0x52bf06,_0x242063,_0x617d4f){_0x617d4f(null,util['format']('%s-%s',Date[_0xd721('0x2c')](),_0x242063['originalname']));}})});router[_0xd721('0x23')](_0xd721('0x18'),upload['single'](_0xd721('0x2f')),controller['addSystemAvatar']);router[_0xd721('0x23')](_0xd721('0x34'),controller[_0xd721('0x35')]);const offlineUploadMulter=multer({'storage':multer[_0xd721('0x27')]({'destination':function(_0x41f2e0,_0x22e3c1,_0x5ee9c8){const _0x9d7704=path[_0xd721('0x28')](config['root'],_0xd721('0x36'),_0xd721('0x37'),'offline-chat');fs_extra[_0xd721('0x38')](_0x9d7704,function(){_0x5ee9c8(null,_0x9d7704);});},'filename':function(_0x27becd,_0x2f5954,_0x3527b5){const _0x470ce5=_0x2f5954[_0xd721('0x2d')][_0xd721('0x39')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x2acd74=path[_0xd721('0x3a')](_0x470ce5);const _0x17574e=Date['now']()+'-'+_0x470ce5['replace'](_0x2acd74,'')+_0x2acd74;_0x3527b5(null,_0x17574e);}})});router[_0xd721('0x23')](_0xd721('0x3b'),offlineUploadMulter[_0xd721('0x3c')](),controller[_0xd721('0x3d')]);router[_0xd721('0x23')](_0xd721('0x3e'),auth[_0xd721('0xf')](),controller[_0xd721('0x3f')]);router[_0xd721('0x23')](_0xd721('0x1c'),auth['isAuthenticated'](),controller[_0xd721('0x40')]);router[_0xd721('0x23')]('/:id/proactive_actions',auth[_0xd721('0xf')](),controller[_0xd721('0x41')]);router[_0xd721('0x23')]('/:id/users',auth['isAuthenticated'](),controller[_0xd721('0x42')]);router[_0xd721('0x43')](_0xd721('0xc'),auth[_0xd721('0xf')](),controller['update']);router[_0xd721('0x44')](_0xd721('0xc'),auth[_0xd721('0xf')](),controller[_0xd721('0x45')]);router[_0xd721('0x44')](_0xd721('0xe'),auth[_0xd721('0xf')](),controller[_0xd721('0x46')]);router['delete'](_0xd721('0x11'),auth[_0xd721('0xf')](),controller[_0xd721('0x47')]);router[_0xd721('0x44')](_0xd721('0x21'),auth[_0xd721('0xf')](),controller[_0xd721('0x48')]);module[_0xd721('0x49')]=router; \ No newline at end of file +var _0x5be5=['post','create','addAnswer','join','root','server/files/images/logos/','format','%s-%s','single','addLogo','diskStorage','server/files/images/avatars/','now','file','addAvatar','addCustomerAvatar','originalname','addSystemAvatar','notify','server/files','offline-chat','ensureDir','replace','/:id/offline','offline','addApplications','addProactiveActions','update','delete','destroy','removeAnswers','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','index','/describe','isAuthenticated','describe','get','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','/:id/system_avatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','/:id/users','getAgents'];(function(_0x5eb447,_0xd7e005){var _0x1758f2=function(_0x2215d4){while(--_0x2215d4){_0x5eb447['push'](_0x5eb447['shift']());}};_0x1758f2(++_0xd7e005);}(_0x5be5,0xb0));var _0x55be=function(_0x39106d,_0x4d5fef){_0x39106d=_0x39106d-0x0;var _0x42d497=_0x5be5[_0x39106d];return _0x42d497;};'use strict';var multer=require(_0x55be('0x0'));var util=require(_0x55be('0x1'));var path=require(_0x55be('0x2'));var timeout=require(_0x55be('0x3'));var express=require(_0x55be('0x4'));var router=express[_0x55be('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x55be('0x6'));var interaction=require(_0x55be('0x7'));var config=require(_0x55be('0x8'));var controller=require(_0x55be('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x55be('0xa')]);router['get'](_0x55be('0xb'),auth[_0x55be('0xc')](),controller[_0x55be('0xd')]);router[_0x55be('0xe')](_0x55be('0xf'),auth['isAuthenticated'](),controller[_0x55be('0x10')]);router['get'](_0x55be('0x11'),auth[_0x55be('0xc')](),controller[_0x55be('0x12')]);router[_0x55be('0xe')](_0x55be('0x13'),auth[_0x55be('0xc')](),controller[_0x55be('0x14')]);router[_0x55be('0xe')](_0x55be('0x15'),controller[_0x55be('0x16')]);router[_0x55be('0xe')](_0x55be('0x17'),controller[_0x55be('0x18')]);router[_0x55be('0xe')](_0x55be('0x19'),controller['getCustomerAvatar']);router[_0x55be('0xe')](_0x55be('0x1a'),controller['getSystemAvatar']);router['get'](_0x55be('0x1b'),auth[_0x55be('0xc')](),controller[_0x55be('0x1c')]);router[_0x55be('0xe')](_0x55be('0x1d'),controller[_0x55be('0x1e')]);router['get'](_0x55be('0x1f'),auth[_0x55be('0xc')](),controller[_0x55be('0x20')]);router[_0x55be('0xe')](_0x55be('0x21'),auth['isAuthenticated'](),controller[_0x55be('0x22')]);router[_0x55be('0xe')](_0x55be('0x23'),controller[_0x55be('0x24')]);router['get'](_0x55be('0x25'),auth[_0x55be('0xc')](),controller['getOfflineMessages']);router[_0x55be('0xe')](_0x55be('0x26'),auth[_0x55be('0xc')](),controller[_0x55be('0x27')]);router[_0x55be('0x28')]('/',auth['isAuthenticated'](),controller[_0x55be('0x29')]);router[_0x55be('0x28')](_0x55be('0x11'),auth['isAuthenticated'](),controller['addDisposition']);router['post'](_0x55be('0x13'),auth['isAuthenticated'](),controller[_0x55be('0x2a')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x82646f,_0xb0968b,_0x16d901){_0x16d901(null,path[_0x55be('0x2b')](config[_0x55be('0x2c')],_0x55be('0x2d')));},'filename':function(_0x35ebf8,_0x2d3292,_0x407e36){_0x407e36(null,util[_0x55be('0x2e')](_0x55be('0x2f'),Date['now'](),_0x2d3292['originalname']));}})});router[_0x55be('0x28')](_0x55be('0x15'),upload[_0x55be('0x30')]('file'),controller[_0x55be('0x31')]);var upload=multer({'storage':multer[_0x55be('0x32')]({'destination':function(_0x12f185,_0x4b8abd,_0x4131fa){_0x4131fa(null,path[_0x55be('0x2b')](config['root'],_0x55be('0x33')));},'filename':function(_0xe6b580,_0x1c99b3,_0x2c75bd){_0x2c75bd(null,util[_0x55be('0x2e')](_0x55be('0x2f'),Date[_0x55be('0x34')](),_0x1c99b3['originalname']));}})});router[_0x55be('0x28')](_0x55be('0x17'),upload[_0x55be('0x30')](_0x55be('0x35')),controller[_0x55be('0x36')]);var upload=multer({'storage':multer[_0x55be('0x32')]({'destination':function(_0x177c91,_0x1ce893,_0x254ade){_0x254ade(null,path[_0x55be('0x2b')](config[_0x55be('0x2c')],_0x55be('0x33')));},'filename':function(_0x360e3c,_0x2acf89,_0x37d290){_0x37d290(null,util['format'](_0x55be('0x2f'),Date['now'](),_0x2acf89['originalname']));}})});router[_0x55be('0x28')]('/:id/customer_avatar',upload['single']('file'),controller[_0x55be('0x37')]);var upload=multer({'storage':multer[_0x55be('0x32')]({'destination':function(_0x25de52,_0x428f33,_0x569d07){_0x569d07(null,path[_0x55be('0x2b')](config[_0x55be('0x2c')],'server/files/images/avatars/'));},'filename':function(_0x179cc3,_0x20a455,_0x49a9f4){_0x49a9f4(null,util[_0x55be('0x2e')](_0x55be('0x2f'),Date[_0x55be('0x34')](),_0x20a455[_0x55be('0x38')]));}})});router[_0x55be('0x28')](_0x55be('0x1a'),upload[_0x55be('0x30')](_0x55be('0x35')),controller[_0x55be('0x39')]);router[_0x55be('0x28')]('/:id/notify',controller[_0x55be('0x3a')]);const offlineUploadMulter=multer({'storage':multer[_0x55be('0x32')]({'destination':function(_0x3114bc,_0x22f36f,_0x50112a){const _0x4852d0=path[_0x55be('0x2b')](config[_0x55be('0x2c')],_0x55be('0x3b'),'attachments',_0x55be('0x3c'));fs_extra[_0x55be('0x3d')](_0x4852d0,function(){_0x50112a(null,_0x4852d0);});},'filename':function(_0x273aaa,_0x300ea9,_0x40bdf1){const _0x415343=_0x300ea9[_0x55be('0x38')][_0x55be('0x3e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x1fcbf7=path['extname'](_0x415343);const _0x4fe431=Date[_0x55be('0x34')]()+'-'+_0x415343[_0x55be('0x3e')](_0x1fcbf7,'')+_0x1fcbf7;_0x40bdf1(null,_0x4fe431);}})});router[_0x55be('0x28')](_0x55be('0x3f'),offlineUploadMulter['any'](),controller[_0x55be('0x40')]);router['post'](_0x55be('0x1b'),auth['isAuthenticated'](),controller['addInteraction']);router[_0x55be('0x28')](_0x55be('0x1f'),auth[_0x55be('0xc')](),controller[_0x55be('0x41')]);router[_0x55be('0x28')](_0x55be('0x21'),auth['isAuthenticated'](),controller[_0x55be('0x42')]);router[_0x55be('0x28')](_0x55be('0x26'),auth[_0x55be('0xc')](),controller['addAgents']);router['put'](_0x55be('0xf'),auth[_0x55be('0xc')](),controller[_0x55be('0x43')]);router[_0x55be('0x44')]('/:id',auth[_0x55be('0xc')](),controller[_0x55be('0x45')]);router['delete'](_0x55be('0x11'),auth[_0x55be('0xc')](),controller['removeDispositions']);router[_0x55be('0x44')](_0x55be('0x13'),auth['isAuthenticated'](),controller[_0x55be('0x46')]);router[_0x55be('0x44')]('/:id/users',auth[_0x55be('0xc')](),controller['removeAgents']);module[_0x55be('0x47')]=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index 7cb4347..25246dc 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 _0xd1f9=['STRING','ENUM','AmazonAWS','Google'];(function(_0x590001,_0x3505fe){var _0x291888=function(_0x10ffd){while(--_0x10ffd){_0x590001['push'](_0x590001['shift']());}};_0x291888(++_0x3505fe);}(_0xd1f9,0x88));var _0x9d1f=function(_0x20c6f1,_0x21fa65){_0x20c6f1=_0x20c6f1-0x0;var _0x43c3bf=_0xd1f9[_0x20c6f1];return _0x43c3bf;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x9d1f('0x0')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x9d1f('0x1')](_0x9d1f('0x2'),_0x9d1f('0x3')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0x9d1f('0x0')]},'data2':{'type':Sequelize[_0x9d1f('0x0')]}}; \ No newline at end of file +var _0x496e=['exports','STRING','ENUM','AmazonAWS'];(function(_0x4e783c,_0x51a362){var _0x2fbd6d=function(_0x513e00){while(--_0x513e00){_0x4e783c['push'](_0x4e783c['shift']());}};_0x2fbd6d(++_0x51a362);}(_0x496e,0x1a0));var _0xe496=function(_0x91e3a4,_0x3af814){_0x91e3a4=_0x91e3a4-0x0;var _0x383bd5=_0x496e[_0x91e3a4];return _0x383bd5;};'use strict';var Sequelize=require('sequelize');module[_0xe496('0x0')]={'name':{'type':Sequelize[_0xe496('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xe496('0x2')](_0xe496('0x3'),'Google'),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index 54f0d8e..f0b2aeb 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(_0x5a4d4c,_0x4e74b5){var _0x476ce4=function(_0x10aa22){while(--_0x10aa22){_0x5a4d4c['push'](_0x5a4d4c['shift']());}};_0x476ce4(++_0x4e74b5);}(_0xdb28,0x106));var _0x8db2=function(_0x1f0ceb,_0x41ca3f){_0x1f0ceb=_0x1f0ceb-0x0;var _0x20696d=_0xdb28[_0x1f0ceb];return _0x20696d;};'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 _0x7a54=['offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','CloudProvider','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json'];(function(_0x51c56c,_0x42c126){var _0x927019=function(_0x241547){while(--_0x241547){_0x51c56c['push'](_0x51c56c['shift']());}};_0x927019(++_0x42c126);}(_0x7a54,0x106));var _0x47a5=function(_0x183d92,_0x3699d7){_0x183d92=_0x183d92-0x0;var _0x4a59d2=_0x7a54[_0x183d92];return _0x4a59d2;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['CloudProvider'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['CloudProvider']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['CloudProvider']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index 1a48c6f..04a0483 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 _0x0e50=['path','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0x3bd139,_0x52a505){var _0xa9342a=function(_0xb2a913){while(--_0xb2a913){_0x3bd139['push'](_0x3bd139['shift']());}};_0xa9342a(++_0x52a505);}(_0x0e50,0x187));var _0x00e5=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0x0e50[_0x1928c9];return _0x51b5fb;};'use strict';var _=require(_0x00e5('0x0'));var util=require('util');var logger=require(_0x00e5('0x1'))(_0x00e5('0x2'));var moment=require('moment');var BPromise=require(_0x00e5('0x3'));var rp=require(_0x00e5('0x4'));var fs=require('fs');var path=require(_0x00e5('0x5'));var rimraf=require('rimraf');var config=require(_0x00e5('0x6'));var attributes=require(_0x00e5('0x7'));module[_0x00e5('0x8')]=function(_0x33df4f,_0x4c0967){return _0x33df4f[_0x00e5('0x9')](_0x00e5('0xa'),attributes,{'tableName':_0x00e5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3210=['exports','define','CloudProvider','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x36cb61,_0x48ede7){var _0x22bb48=function(_0xed2888){while(--_0xed2888){_0x36cb61['push'](_0x36cb61['shift']());}};_0x22bb48(++_0x48ede7);}(_0x3210,0x142));var _0x0321=function(_0x202dbd,_0x515964){_0x202dbd=_0x202dbd-0x0;var _0x3edb3f=_0x3210[_0x202dbd];return _0x3edb3f;};'use strict';var _=require(_0x0321('0x0'));var util=require(_0x0321('0x1'));var logger=require('../../config/logger')(_0x0321('0x2'));var moment=require(_0x0321('0x3'));var BPromise=require(_0x0321('0x4'));var rp=require(_0x0321('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0321('0x6'));var config=require(_0x0321('0x7'));var attributes=require('./cloudProvider.attributes');module[_0x0321('0x8')]=function(_0x147df0,_0x186f9a){return _0x147df0[_0x0321('0x9')](_0x0321('0xa'),attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js index 28a593f..97549ad 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 _0xacc6=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','CloudProvider,\x20%s,\x20%s','message','result','catch'];(function(_0xcf0479,_0x537ff7){var _0x1e350e=function(_0x1ba284){while(--_0x1ba284){_0xcf0479['push'](_0xcf0479['shift']());}};_0x1e350e(++_0x537ff7);}(_0xacc6,0x150));var _0x6acc=function(_0x358806,_0x322b66){_0x358806=_0x358806-0x0;var _0x19fdcb=_0xacc6[_0x358806];return _0x19fdcb;};'use strict';var _=require(_0x6acc('0x0'));var util=require(_0x6acc('0x1'));var moment=require(_0x6acc('0x2'));var BPromise=require(_0x6acc('0x3'));var rs=require(_0x6acc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6acc('0x5'))['db'];var utils=require(_0x6acc('0x6'));var logger=require(_0x6acc('0x7'))('rpc');var config=require(_0x6acc('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x6acc('0x9')][_0x6acc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5e7f3a,_0x41edfd,_0x48b1a8){return new BPromise(function(_0x1f95e8,_0x538730){return client[_0x6acc('0xb')](_0x5e7f3a,_0x48b1a8)[_0x6acc('0xc')](function(_0x4d6b7f){logger[_0x6acc('0xd')]('CloudProvider,\x20%s,\x20%s',_0x41edfd,_0x6acc('0xe'));logger[_0x6acc('0xf')](_0x6acc('0x10'),_0x41edfd,_0x6acc('0xe'),JSON[_0x6acc('0x11')](_0x4d6b7f));if(_0x4d6b7f[_0x6acc('0x12')]){if(_0x4d6b7f['error'][_0x6acc('0x13')]===0x1f4){logger[_0x6acc('0x12')](_0x6acc('0x14'),_0x41edfd,_0x4d6b7f[_0x6acc('0x12')][_0x6acc('0x15')]);return _0x538730(_0x4d6b7f['error']['message']);}logger[_0x6acc('0x12')](_0x6acc('0x14'),_0x41edfd,_0x4d6b7f[_0x6acc('0x12')][_0x6acc('0x15')]);return _0x1f95e8(_0x4d6b7f[_0x6acc('0x12')][_0x6acc('0x15')]);}else{logger[_0x6acc('0xd')](_0x6acc('0x14'),_0x41edfd,_0x6acc('0xe'));_0x1f95e8(_0x4d6b7f[_0x6acc('0x16')][_0x6acc('0x15')]);}})[_0x6acc('0x17')](function(_0x31c4c2){logger[_0x6acc('0x12')](_0x6acc('0x14'),_0x41edfd,_0x31c4c2);_0x538730(_0x31c4c2);});});} \ No newline at end of file +var _0x2b47=['result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x18483c,_0x33b067){var _0x4e0cf0=function(_0x418001){while(--_0x418001){_0x18483c['push'](_0x18483c['shift']());}};_0x4e0cf0(++_0x33b067);}(_0x2b47,0x177));var _0x72b4=function(_0x2f5ca2,_0x10f3e4){_0x2f5ca2=_0x2f5ca2-0x0;var _0x3c4041=_0x2b47[_0x2f5ca2];return _0x3c4041;};'use strict';var _=require(_0x72b4('0x0'));var util=require('util');var moment=require(_0x72b4('0x1'));var BPromise=require(_0x72b4('0x2'));var rs=require(_0x72b4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x72b4('0x4'))['db'];var utils=require(_0x72b4('0x5'));var logger=require(_0x72b4('0x6'))(_0x72b4('0x7'));var config=require(_0x72b4('0x8'));var jayson=require(_0x72b4('0x9'));var client=jayson['client'][_0x72b4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x480984,_0x104f08,_0x1c90aa){return new BPromise(function(_0xb1e42f,_0x1bdf7f){return client[_0x72b4('0xb')](_0x480984,_0x1c90aa)[_0x72b4('0xc')](function(_0x114a98){logger[_0x72b4('0xd')](_0x72b4('0xe'),_0x104f08,_0x72b4('0xf'));logger[_0x72b4('0x10')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0x104f08,_0x72b4('0xf'),JSON[_0x72b4('0x11')](_0x114a98));if(_0x114a98[_0x72b4('0x12')]){if(_0x114a98[_0x72b4('0x12')][_0x72b4('0x13')]===0x1f4){logger[_0x72b4('0x12')](_0x72b4('0xe'),_0x104f08,_0x114a98[_0x72b4('0x12')][_0x72b4('0x14')]);return _0x1bdf7f(_0x114a98[_0x72b4('0x12')][_0x72b4('0x14')]);}logger['error'](_0x72b4('0xe'),_0x104f08,_0x114a98[_0x72b4('0x12')][_0x72b4('0x14')]);return _0xb1e42f(_0x114a98[_0x72b4('0x12')]['message']);}else{logger['info'](_0x72b4('0xe'),_0x104f08,'request\x20sent');_0xb1e42f(_0x114a98[_0x72b4('0x15')][_0x72b4('0x14')]);}})['catch'](function(_0x2a9c37){logger[_0x72b4('0x12')](_0x72b4('0xe'),_0x104f08,_0x2a9c37);_0x1bdf7f(_0x2a9c37);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index 0ed66c5..2455913 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 _0x83a7=['/:id','update','destroy','multer','util','express','Router','fs-extra','../../config/environment','./cloudProvider.controller','get','index','isAuthenticated','post','put'];(function(_0x377609,_0x50c4ef){var _0x16978b=function(_0x5cd0b1){while(--_0x5cd0b1){_0x377609['push'](_0x377609['shift']());}};_0x16978b(++_0x50c4ef);}(_0x83a7,0x1f2));var _0x783a=function(_0x14edcd,_0x3dd904){_0x14edcd=_0x14edcd-0x0;var _0x2d3e00=_0x83a7[_0x14edcd];return _0x2d3e00;};'use strict';var multer=require(_0x783a('0x0'));var util=require(_0x783a('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x783a('0x2'));var router=express[_0x783a('0x3')]();var fs_extra=require(_0x783a('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x783a('0x5'));var controller=require(_0x783a('0x6'));router[_0x783a('0x7')]('/',auth['isAuthenticated'](),controller[_0x783a('0x8')]);router[_0x783a('0x7')]('/:id',auth[_0x783a('0x9')](),controller['show']);router[_0x783a('0xa')]('/',auth['isAuthenticated'](),controller['create']);router[_0x783a('0xb')](_0x783a('0xc'),auth['isAuthenticated'](),controller[_0x783a('0xd')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x783a('0xe')]);module['exports']=router; \ No newline at end of file +var _0x6348=['show','post','delete','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cloudProvider.controller','isAuthenticated','get','/:id'];(function(_0x9aada2,_0xd2d349){var _0x196dff=function(_0x5ad061){while(--_0x5ad061){_0x9aada2['push'](_0x9aada2['shift']());}};_0x196dff(++_0xd2d349);}(_0x6348,0x1f3));var _0x8634=function(_0x24f5ad,_0x31ef05){_0x24f5ad=_0x24f5ad-0x0;var _0x455039=_0x6348[_0x24f5ad];return _0x455039;};'use strict';var multer=require('multer');var util=require(_0x8634('0x0'));var path=require(_0x8634('0x1'));var timeout=require(_0x8634('0x2'));var express=require('express');var router=express[_0x8634('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x8634('0x4'));var interaction=require(_0x8634('0x5'));var config=require(_0x8634('0x6'));var controller=require(_0x8634('0x7'));router['get']('/',auth[_0x8634('0x8')](),controller['index']);router[_0x8634('0x9')](_0x8634('0xa'),auth['isAuthenticated'](),controller[_0x8634('0xb')]);router[_0x8634('0xc')]('/',auth[_0x8634('0x8')](),controller['create']);router['put'](_0x8634('0xa'),auth[_0x8634('0x8')](),controller['update']);router[_0x8634('0xd')](_0x8634('0xa'),auth[_0x8634('0x8')](),controller['destroy']);module[_0x8634('0xe')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index 972074f..747351a 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 _0xdd92=['sequelize','exports','STRING','name'];(function(_0x57f74a,_0x3f8b13){var _0x15b677=function(_0x332610){while(--_0x332610){_0x57f74a['push'](_0x57f74a['shift']());}};_0x15b677(++_0x3f8b13);}(_0xdd92,0x188));var _0x2dd9=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0xdd92[_0x5f1391];return _0x50ebe3;};'use strict';var Sequelize=require(_0x2dd9('0x0'));module[_0x2dd9('0x1')]={'name':{'type':Sequelize[_0x2dd9('0x2')],'unique':_0x2dd9('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0x2dd9('0x2')]},'website':{'type':Sequelize[_0x2dd9('0x2')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x2dd9('0x2')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x2dd9('0x2')]},'postalCode':{'type':Sequelize[_0x2dd9('0x2')]},'city':{'type':Sequelize[_0x2dd9('0x2')]},'country':{'type':Sequelize[_0x2dd9('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x2dd9('0x2')]},'sStreet':{'type':Sequelize[_0x2dd9('0x2')]},'sPostalCode':{'type':Sequelize[_0x2dd9('0x2')]},'sCity':{'type':Sequelize[_0x2dd9('0x2')]},'sCountry':{'type':Sequelize[_0x2dd9('0x2')]},'description':{'type':Sequelize[_0x2dd9('0x2')]}}; \ No newline at end of file +var _0x494a=['sequelize','exports','STRING','name'];(function(_0x24f862,_0x4b645a){var _0x198aa4=function(_0x131195){while(--_0x131195){_0x24f862['push'](_0x24f862['shift']());}};_0x198aa4(++_0x4b645a);}(_0x494a,0x17c));var _0xa494=function(_0x19587b,_0x324fad){_0x19587b=_0x19587b-0x0;var _0x3aebb3=_0x494a[_0x19587b];return _0x3aebb3;};'use strict';var Sequelize=require(_0xa494('0x0'));module[_0xa494('0x1')]={'name':{'type':Sequelize[_0xa494('0x2')],'unique':_0xa494('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xa494('0x2')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xa494('0x2')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xa494('0x2')]},'street':{'type':Sequelize[_0xa494('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xa494('0x2')]},'country':{'type':Sequelize[_0xa494('0x2')]},'email':{'type':Sequelize[_0xa494('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xa494('0x2')]},'sStreet':{'type':Sequelize[_0xa494('0x2')]},'sPostalCode':{'type':Sequelize[_0xa494('0x2')]},'sCity':{'type':Sequelize[_0xa494('0x2')]},'sCountry':{'type':Sequelize[_0xa494('0x2')]},'description':{'type':Sequelize[_0xa494('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index 6d798ca..da7607e 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 _0x37eb=['rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','addContacts','CmContact','ids','getContacts','findOne','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','count','Content-Range','apply','reject','update','get','UserProfileResource','then','error','stack','name','send','CmCompany','describe','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','where','merge','map','filter','options','includeAll','include','findAll'];(function(_0x1196cd,_0x33c691){var _0x4afd49=function(_0x5a76cb){while(--_0x5a76cb){_0x1196cd['push'](_0x1196cd['shift']());}};_0x4afd49(++_0x33c691);}(_0x37eb,0xc2));var _0xb37e=function(_0x55f5c0,_0x64d09e){_0x55f5c0=_0x55f5c0-0x0;var _0x1ed6fe=_0x37eb[_0x55f5c0];return _0x1ed6fe;};'use strict';var emlformat=require(_0xb37e('0x0'));var rimraf=require(_0xb37e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb37e('0x2'));var rp=require(_0xb37e('0x3'));var moment=require(_0xb37e('0x4'));var BPromise=require(_0xb37e('0x5'));var Mustache=require(_0xb37e('0x6'));var util=require(_0xb37e('0x7'));var path=require(_0xb37e('0x8'));var sox=require(_0xb37e('0x9'));var csv=require(_0xb37e('0xa'));var ejs=require(_0xb37e('0xb'));var fs=require('fs');var fs_extra=require(_0xb37e('0xc'));var _=require(_0xb37e('0xd'));var squel=require(_0xb37e('0xe'));var crypto=require(_0xb37e('0xf'));var jsforce=require(_0xb37e('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xb37e('0xa'));var querystring=require('querystring');var Papa=require(_0xb37e('0x11'));var Redis=require(_0xb37e('0x12'));var authService=require(_0xb37e('0x13'));var qs=require(_0xb37e('0x14'));var as=require(_0xb37e('0x15'));var hardwareService=require(_0xb37e('0x16'));var logger=require(_0xb37e('0x17'))('api');var utils=require('../../config/utils');var config=require(_0xb37e('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xb37e('0x19'))['db'];function respondWithStatusCode(_0x25dedd,_0x112de9){_0x112de9=_0x112de9||0xcc;return function(_0x473e23){if(_0x473e23){return _0x25dedd[_0xb37e('0x1a')](_0x112de9);}return _0x25dedd[_0xb37e('0x1b')](_0x112de9)[_0xb37e('0x1c')]();};}function respondWithResult(_0x6d6889,_0x19a064){_0x19a064=_0x19a064||0xc8;return function(_0x16e0f9){if(_0x16e0f9){return _0x6d6889[_0xb37e('0x1b')](_0x19a064)[_0xb37e('0x1d')](_0x16e0f9);}};}function respondWithFilteredResult(_0x4d48ad,_0x3811fe){return function(_0x3a2804){if(_0x3a2804){var _0x574ceb=typeof _0x3811fe[_0xb37e('0x1e')]==='undefined'&&typeof _0x3811fe[_0xb37e('0x1f')]==='undefined';var _0x39f50a=_0x3a2804[_0xb37e('0x20')];var _0x5e8bbb=_0x574ceb?0x0:_0x3811fe[_0xb37e('0x1e')];var _0x15d708=_0x574ceb?_0x3a2804['count']:_0x3811fe['offset']+_0x3811fe[_0xb37e('0x1f')];var _0x14a294;if(_0x15d708>=_0x39f50a){_0x15d708=_0x39f50a;_0x14a294=0xc8;}else{_0x14a294=0xce;}_0x4d48ad[_0xb37e('0x1b')](_0x14a294);return _0x4d48ad['set'](_0xb37e('0x21'),_0x5e8bbb+'-'+_0x15d708+'/'+_0x39f50a)[_0xb37e('0x1d')](_0x3a2804);}return null;};}function patchUpdates(_0x5af3ed){return function(_0x5137f7){try{jsonpatch[_0xb37e('0x22')](_0x5137f7,_0x5af3ed,!![]);}catch(_0x352af7){return BPromise[_0xb37e('0x23')](_0x352af7);}return _0x5137f7['save']();};}function saveUpdates(_0x4eee7d,_0x12c3ea){return function(_0x4fa59c){if(_0x4fa59c){return _0x4fa59c[_0xb37e('0x24')](_0x4eee7d)['then'](function(_0x5ef0cd){return _0x5ef0cd;});}return null;};}function removeEntity(_0x5cdc0e,_0x3567ef){return function(_0x5589dc){if(_0x5589dc){return _0x5589dc['destroy']()['then'](function(){var _0x39e5df=_0x5589dc[_0xb37e('0x25')]({'plain':!![]});var _0x9894f7='Companies';return db[_0xb37e('0x26')]['destroy']({'where':{'type':_0x9894f7,'resourceId':_0x39e5df['id']}})[_0xb37e('0x27')](function(){return _0x5589dc;});})['then'](function(){_0x5cdc0e[_0xb37e('0x1b')](0xcc)[_0xb37e('0x1c')]();});}};}function handleEntityNotFound(_0x149831,_0xf6fce2){return function(_0x46dae0){if(!_0x46dae0){_0x149831['sendStatus'](0x194);}return _0x46dae0;};}function handleError(_0x14486f,_0x3a55b1){_0x3a55b1=_0x3a55b1||0x1f4;return function(_0x20c122){logger[_0xb37e('0x28')](_0x20c122[_0xb37e('0x29')]);if(_0x20c122[_0xb37e('0x2a')]){delete _0x20c122['name'];}_0x14486f[_0xb37e('0x1b')](_0x3a55b1)[_0xb37e('0x2b')](_0x20c122);};}exports['index']=function(_0x487f14,_0x4606ae){var _0x374d26={},_0x5d8e4c={},_0x5e8467={'count':0x0,'rows':[]};return db[_0xb37e('0x2c')][_0xb37e('0x2d')]()[_0xb37e('0x27')](function(_0x164fd6){_0x5d8e4c[_0xb37e('0x2e')]=_[_0xb37e('0x2f')](_0x164fd6);_0x5d8e4c['query']=_[_0xb37e('0x2f')](_0x487f14[_0xb37e('0x30')]);_0x5d8e4c['filters']=_[_0xb37e('0x31')](_0x5d8e4c[_0xb37e('0x2e')],_0x5d8e4c['query']);_0x374d26[_0xb37e('0x32')]=_[_0xb37e('0x31')](_0x5d8e4c[_0xb37e('0x2e')],qs[_0xb37e('0x33')](_0x487f14['query'][_0xb37e('0x33')]));_0x374d26[_0xb37e('0x32')]=_0x374d26['attributes'][_0xb37e('0x34')]?_0x374d26[_0xb37e('0x32')]:_0x5d8e4c[_0xb37e('0x2e')];if(!_0x487f14[_0xb37e('0x30')][_0xb37e('0x35')](_0xb37e('0x36'))){_0x374d26[_0xb37e('0x1f')]=qs[_0xb37e('0x1f')](_0x487f14['query'][_0xb37e('0x1f')]);_0x374d26['offset']=qs[_0xb37e('0x1e')](_0x487f14[_0xb37e('0x30')]['offset']);}_0x374d26[_0xb37e('0x37')]=qs[_0xb37e('0x38')](_0x487f14[_0xb37e('0x30')]['sort']);_0x374d26['where']=qs[_0xb37e('0x39')](_[_0xb37e('0x3a')](_0x487f14[_0xb37e('0x30')],_0x5d8e4c[_0xb37e('0x39')]),_0x164fd6);if(_0x487f14['query']['filter']){_0x374d26[_0xb37e('0x3b')]=_[_0xb37e('0x3c')](_0x374d26[_0xb37e('0x3b')],{'$or':_[_0xb37e('0x3d')](_0x374d26[_0xb37e('0x32')],function(_0x30476c){var _0x7893c7={};_0x7893c7[_0x30476c]={'$like':'%'+_0x487f14['query'][_0xb37e('0x3e')]+'%'};return _0x7893c7;})});}_0x374d26=_[_0xb37e('0x3c')]({},_0x374d26,_0x487f14[_0xb37e('0x3f')]);var _0x4507c6={'where':_0x374d26[_0xb37e('0x3b')]};return db[_0xb37e('0x2c')][_0xb37e('0x20')](_0x4507c6)['then'](function(_0x5e35bf){_0x5e8467[_0xb37e('0x20')]=_0x5e35bf;if(_0x487f14[_0xb37e('0x30')][_0xb37e('0x40')]){_0x374d26[_0xb37e('0x41')]=[{'all':!![]}];}return db[_0xb37e('0x2c')][_0xb37e('0x42')](_0x374d26);})[_0xb37e('0x27')](function(_0x21fd45){_0x5e8467[_0xb37e('0x43')]=_0x21fd45;return _0x5e8467;})[_0xb37e('0x27')](respondWithFilteredResult(_0x4606ae,_0x374d26))[_0xb37e('0x44')](handleError(_0x4606ae,null));})[_0xb37e('0x44')](handleError(_0x4606ae,null));};exports[_0xb37e('0x45')]=function(_0x20a7fa,_0xbc3c34){var _0x14160f={'raw':![],'where':{'id':_0x20a7fa[_0xb37e('0x46')]['id']}},_0xcf59a0={};_0xcf59a0[_0xb37e('0x2e')]=_[_0xb37e('0x2f')](db[_0xb37e('0x2c')]['rawAttributes']);_0xcf59a0[_0xb37e('0x30')]=_[_0xb37e('0x2f')](_0x20a7fa['query']);_0xcf59a0['filters']=_[_0xb37e('0x31')](_0xcf59a0['model'],_0xcf59a0['query']);_0x14160f[_0xb37e('0x32')]=_[_0xb37e('0x31')](_0xcf59a0['model'],qs[_0xb37e('0x33')](_0x20a7fa[_0xb37e('0x30')][_0xb37e('0x33')]));_0x14160f[_0xb37e('0x32')]=_0x14160f[_0xb37e('0x32')][_0xb37e('0x34')]?_0x14160f[_0xb37e('0x32')]:_0xcf59a0[_0xb37e('0x2e')];if(_0x20a7fa[_0xb37e('0x30')]['includeAll']){_0x14160f[_0xb37e('0x41')]=[{'all':!![]}];}_0x14160f=_[_0xb37e('0x3c')]({},_0x14160f,_0x20a7fa[_0xb37e('0x3f')]);return db[_0xb37e('0x2c')][_0xb37e('0x47')](_0x14160f)[_0xb37e('0x27')](handleEntityNotFound(_0xbc3c34,null))[_0xb37e('0x27')](respondWithResult(_0xbc3c34,null))[_0xb37e('0x44')](handleError(_0xbc3c34,null));};exports[_0xb37e('0x48')]=function(_0x273d35,_0x23228d){return db['CmCompany'][_0xb37e('0x48')](_0x273d35[_0xb37e('0x49')],{})[_0xb37e('0x27')](function(_0x9b3180){var _0x5150d3=_0x273d35[_0xb37e('0x4a')][_0xb37e('0x25')]({'plain':!![]});if(!_0x5150d3)throw new Error(_0xb37e('0x4b'));if(_0x5150d3[_0xb37e('0x4c')]==='user'){var _0x207c5f=_0x9b3180[_0xb37e('0x25')]({'plain':!![]});var _0x31a7d3='Companies';return db[_0xb37e('0x4d')]['find']({'where':{'name':_0x31a7d3,'userProfileId':_0x5150d3[_0xb37e('0x4e')]},'raw':!![]})['then'](function(_0x2af684){if(_0x2af684&&_0x2af684[_0xb37e('0x4f')]===0x0){return db[_0xb37e('0x26')][_0xb37e('0x48')]({'name':_0x207c5f[_0xb37e('0x2a')],'resourceId':_0x207c5f['id'],'type':_0x2af684[_0xb37e('0x2a')],'sectionId':_0x2af684['id']},{})[_0xb37e('0x27')](function(){return _0x9b3180;});}else{return _0x9b3180;}})[_0xb37e('0x44')](function(_0xef0c95){logger[_0xb37e('0x28')](_0xb37e('0x50'),_0xef0c95);throw _0xef0c95;});}return _0x9b3180;})[_0xb37e('0x27')](respondWithResult(_0x23228d,0xc9))[_0xb37e('0x44')](handleError(_0x23228d,null));};exports[_0xb37e('0x24')]=function(_0xa1a230,_0x3987ee){if(_0xa1a230[_0xb37e('0x49')]['id']){delete _0xa1a230[_0xb37e('0x49')]['id'];}return db['CmCompany'][_0xb37e('0x47')]({'where':{'id':_0xa1a230[_0xb37e('0x46')]['id']}})[_0xb37e('0x27')](handleEntityNotFound(_0x3987ee,null))[_0xb37e('0x27')](saveUpdates(_0xa1a230[_0xb37e('0x49')],null))[_0xb37e('0x27')](respondWithResult(_0x3987ee,null))[_0xb37e('0x44')](handleError(_0x3987ee,null));};exports[_0xb37e('0x51')]=function(_0xd806a1,_0x5f5648){return db[_0xb37e('0x2c')][_0xb37e('0x47')]({'where':{'id':_0xd806a1[_0xb37e('0x46')]['id']}})[_0xb37e('0x27')](handleEntityNotFound(_0x5f5648,null))[_0xb37e('0x27')](removeEntity(_0x5f5648,null))[_0xb37e('0x44')](handleError(_0x5f5648,null));};exports[_0xb37e('0x2d')]=function(_0x512830,_0x2e1781){return db['CmCompany'][_0xb37e('0x2d')]()[_0xb37e('0x27')](respondWithResult(_0x2e1781,null))[_0xb37e('0x44')](handleError(_0x2e1781,null));};exports[_0xb37e('0x52')]=function(_0x1b0d63,_0x3f1f4f,_0x58b933){return db[_0xb37e('0x53')][_0xb37e('0x47')]({'where':{'id':_0x1b0d63[_0xb37e('0x46')]['id']}})[_0xb37e('0x27')](handleEntityNotFound(_0x3f1f4f,null))['then'](function(_0x573989){if(_0x573989){return _0x573989[_0xb37e('0x52')](_0x1b0d63['body']['ids'],_['omit'](_0x1b0d63['body'],[_0xb37e('0x54'),'id'])||{});}})[_0xb37e('0x27')](respondWithResult(_0x3f1f4f,null))[_0xb37e('0x44')](handleError(_0x3f1f4f,null));};exports[_0xb37e('0x55')]=function(_0xc4e2c8,_0x1cd9a5,_0x4def4e){var _0x507ddb={};var _0x156d34={};var _0x47abbe;var _0xd1e263;return db['CmCompany'][_0xb37e('0x56')]({'where':{'id':_0xc4e2c8[_0xb37e('0x46')]['id']}})[_0xb37e('0x27')](handleEntityNotFound(_0x1cd9a5,null))['then'](function(_0x3fb6ae){if(_0x3fb6ae){_0x47abbe=_0x3fb6ae;_0x156d34[_0xb37e('0x2e')]=_['keys'](db[_0xb37e('0x53')]['rawAttributes']);_0x156d34[_0xb37e('0x30')]=_[_0xb37e('0x2f')](_0xc4e2c8[_0xb37e('0x30')]);_0x156d34[_0xb37e('0x39')]=_[_0xb37e('0x31')](_0x156d34[_0xb37e('0x2e')],_0x156d34['query']);_0x507ddb['attributes']=_['intersection'](_0x156d34[_0xb37e('0x2e')],qs[_0xb37e('0x33')](_0xc4e2c8[_0xb37e('0x30')]['fields']));_0x507ddb[_0xb37e('0x32')]=_0x507ddb[_0xb37e('0x32')][_0xb37e('0x34')]?_0x507ddb['attributes']:_0x156d34[_0xb37e('0x2e')];_0x507ddb[_0xb37e('0x37')]=qs['sort'](_0xc4e2c8[_0xb37e('0x30')][_0xb37e('0x38')]);_0x507ddb[_0xb37e('0x3b')]=qs[_0xb37e('0x39')](_['pick'](_0xc4e2c8[_0xb37e('0x30')],_0x156d34[_0xb37e('0x39')]));if(_0xc4e2c8[_0xb37e('0x30')][_0xb37e('0x3e')]){_0x507ddb[_0xb37e('0x3b')]=_[_0xb37e('0x3c')](_0x507ddb[_0xb37e('0x3b')],{'$or':_[_0xb37e('0x3d')](_0x507ddb[_0xb37e('0x32')],function(_0x166a09){var _0x44eb62={};_0x44eb62[_0x166a09]={'$like':'%'+_0xc4e2c8[_0xb37e('0x30')][_0xb37e('0x3e')]+'%'};return _0x44eb62;})});}_0x507ddb=_[_0xb37e('0x3c')]({},_0x507ddb,_0xc4e2c8[_0xb37e('0x3f')]);return _0x47abbe[_0xb37e('0x55')](_0x507ddb);}})[_0xb37e('0x27')](function(_0x1b42f9){if(_0x1b42f9){_0xd1e263=_0x1b42f9[_0xb37e('0x34')];if(!_0xc4e2c8[_0xb37e('0x30')][_0xb37e('0x35')]('nolimit')){_0x507ddb[_0xb37e('0x1f')]=qs[_0xb37e('0x1f')](_0xc4e2c8[_0xb37e('0x30')][_0xb37e('0x1f')]);_0x507ddb['offset']=qs['offset'](_0xc4e2c8['query'][_0xb37e('0x1e')]);}return _0x47abbe['getContacts'](_0x507ddb);}})[_0xb37e('0x27')](function(_0x4ef4f8){if(_0x4ef4f8){return _0x4ef4f8?{'count':_0xd1e263,'rows':_0x4ef4f8}:null;}})[_0xb37e('0x27')](respondWithResult(_0x1cd9a5,null))['catch'](handleError(_0x1cd9a5,null));}; \ No newline at end of file +var _0x7437=['end','sendStatus','error','stack','name','index','describe','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','map','CmCompany','includeAll','include','findAll','rows','catch','show','rawAttributes','length','options','create','body','user','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addContacts','omit','ids','getContacts','findOne','CmContact','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','limit','undefined','count','offset','set','apply','reject','save','update','then','destroy','get','Companies'];(function(_0x3cc57e,_0x29cd65){var _0x264316=function(_0x12992b){while(--_0x12992b){_0x3cc57e['push'](_0x3cc57e['shift']());}};_0x264316(++_0x29cd65);}(_0x7437,0xe6));var _0x7743=function(_0x3d0ab3,_0x2e1926){_0x3d0ab3=_0x3d0ab3-0x0;var _0x17fd2c=_0x7437[_0x3d0ab3];return _0x17fd2c;};'use strict';var emlformat=require(_0x7743('0x0'));var rimraf=require(_0x7743('0x1'));var zipdir=require(_0x7743('0x2'));var jsonpatch=require(_0x7743('0x3'));var rp=require(_0x7743('0x4'));var moment=require(_0x7743('0x5'));var BPromise=require(_0x7743('0x6'));var Mustache=require(_0x7743('0x7'));var util=require(_0x7743('0x8'));var path=require('path');var sox=require(_0x7743('0x9'));var csv=require(_0x7743('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7743('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x7743('0xc'));var jsforce=require(_0x7743('0xd'));var deskjs=require(_0x7743('0xe'));var toCsv=require(_0x7743('0xa'));var querystring=require(_0x7743('0xf'));var Papa=require(_0x7743('0x10'));var Redis=require(_0x7743('0x11'));var authService=require(_0x7743('0x12'));var qs=require(_0x7743('0x13'));var as=require(_0x7743('0x14'));var hardwareService=require(_0x7743('0x15'));var logger=require(_0x7743('0x16'))(_0x7743('0x17'));var utils=require(_0x7743('0x18'));var config=require(_0x7743('0x19'));var licenseUtil=require(_0x7743('0x1a'));var db=require(_0x7743('0x1b'))['db'];function respondWithStatusCode(_0x2a1398,_0x58f989){_0x58f989=_0x58f989||0xcc;return function(_0x374c8e){if(_0x374c8e){return _0x2a1398['sendStatus'](_0x58f989);}return _0x2a1398[_0x7743('0x1c')](_0x58f989)['end']();};}function respondWithResult(_0x24ae63,_0x3a7cb7){_0x3a7cb7=_0x3a7cb7||0xc8;return function(_0x2a9bb6){if(_0x2a9bb6){return _0x24ae63[_0x7743('0x1c')](_0x3a7cb7)[_0x7743('0x1d')](_0x2a9bb6);}};}function respondWithFilteredResult(_0x5eb20e,_0x5c6744){return function(_0x471fe4){if(_0x471fe4){var _0x102f17=typeof _0x5c6744['offset']==='undefined'&&typeof _0x5c6744[_0x7743('0x1e')]===_0x7743('0x1f');var _0x1c7f26=_0x471fe4[_0x7743('0x20')];var _0x3f2702=_0x102f17?0x0:_0x5c6744[_0x7743('0x21')];var _0x4d0db2=_0x102f17?_0x471fe4[_0x7743('0x20')]:_0x5c6744['offset']+_0x5c6744['limit'];var _0x52f153;if(_0x4d0db2>=_0x1c7f26){_0x4d0db2=_0x1c7f26;_0x52f153=0xc8;}else{_0x52f153=0xce;}_0x5eb20e['status'](_0x52f153);return _0x5eb20e[_0x7743('0x22')]('Content-Range',_0x3f2702+'-'+_0x4d0db2+'/'+_0x1c7f26)['json'](_0x471fe4);}return null;};}function patchUpdates(_0x572485){return function(_0x16f155){try{jsonpatch[_0x7743('0x23')](_0x16f155,_0x572485,!![]);}catch(_0x3a20c3){return BPromise[_0x7743('0x24')](_0x3a20c3);}return _0x16f155[_0x7743('0x25')]();};}function saveUpdates(_0x1b6106,_0x455c9e){return function(_0x16f259){if(_0x16f259){return _0x16f259[_0x7743('0x26')](_0x1b6106)[_0x7743('0x27')](function(_0x22319d){return _0x22319d;});}return null;};}function removeEntity(_0x1272a2,_0x2a879a){return function(_0x46b67d){if(_0x46b67d){return _0x46b67d[_0x7743('0x28')]()[_0x7743('0x27')](function(){var _0x5ba375=_0x46b67d[_0x7743('0x29')]({'plain':!![]});var _0x28125d=_0x7743('0x2a');return db['UserProfileResource'][_0x7743('0x28')]({'where':{'type':_0x28125d,'resourceId':_0x5ba375['id']}})['then'](function(){return _0x46b67d;});})[_0x7743('0x27')](function(){_0x1272a2[_0x7743('0x1c')](0xcc)[_0x7743('0x2b')]();});}};}function handleEntityNotFound(_0x57ba34,_0xc634d8){return function(_0x48238d){if(!_0x48238d){_0x57ba34[_0x7743('0x2c')](0x194);}return _0x48238d;};}function handleError(_0x29eeb0,_0x30e386){_0x30e386=_0x30e386||0x1f4;return function(_0x1aac64){logger[_0x7743('0x2d')](_0x1aac64[_0x7743('0x2e')]);if(_0x1aac64['name']){delete _0x1aac64[_0x7743('0x2f')];}_0x29eeb0['status'](_0x30e386)['send'](_0x1aac64);};}exports[_0x7743('0x30')]=function(_0x49abc7,_0x1bbf54){var _0x1902da={},_0x5b7f14={},_0x27d7e6={'count':0x0,'rows':[]};return db['CmCompany'][_0x7743('0x31')]()[_0x7743('0x27')](function(_0x1a2ae0){_0x5b7f14[_0x7743('0x32')]=_[_0x7743('0x33')](_0x1a2ae0);_0x5b7f14['query']=_[_0x7743('0x33')](_0x49abc7[_0x7743('0x34')]);_0x5b7f14['filters']=_[_0x7743('0x35')](_0x5b7f14[_0x7743('0x32')],_0x5b7f14[_0x7743('0x34')]);_0x1902da[_0x7743('0x36')]=_['intersection'](_0x5b7f14[_0x7743('0x32')],qs[_0x7743('0x37')](_0x49abc7[_0x7743('0x34')]['fields']));_0x1902da[_0x7743('0x36')]=_0x1902da['attributes']['length']?_0x1902da[_0x7743('0x36')]:_0x5b7f14[_0x7743('0x32')];if(!_0x49abc7['query'][_0x7743('0x38')](_0x7743('0x39'))){_0x1902da[_0x7743('0x1e')]=qs[_0x7743('0x1e')](_0x49abc7[_0x7743('0x34')][_0x7743('0x1e')]);_0x1902da['offset']=qs[_0x7743('0x21')](_0x49abc7['query']['offset']);}_0x1902da[_0x7743('0x3a')]=qs[_0x7743('0x3b')](_0x49abc7[_0x7743('0x34')][_0x7743('0x3b')]);_0x1902da[_0x7743('0x3c')]=qs[_0x7743('0x3d')](_['pick'](_0x49abc7[_0x7743('0x34')],_0x5b7f14[_0x7743('0x3d')]),_0x1a2ae0);if(_0x49abc7[_0x7743('0x34')][_0x7743('0x3e')]){_0x1902da[_0x7743('0x3c')]=_[_0x7743('0x3f')](_0x1902da['where'],{'$or':_[_0x7743('0x40')](_0x1902da[_0x7743('0x36')],function(_0x106a2c){var _0xfa9c80={};_0xfa9c80[_0x106a2c]={'$like':'%'+_0x49abc7[_0x7743('0x34')][_0x7743('0x3e')]+'%'};return _0xfa9c80;})});}_0x1902da=_[_0x7743('0x3f')]({},_0x1902da,_0x49abc7['options']);var _0x37b6b8={'where':_0x1902da[_0x7743('0x3c')]};return db[_0x7743('0x41')][_0x7743('0x20')](_0x37b6b8)[_0x7743('0x27')](function(_0x5a7d7e){_0x27d7e6[_0x7743('0x20')]=_0x5a7d7e;if(_0x49abc7[_0x7743('0x34')][_0x7743('0x42')]){_0x1902da[_0x7743('0x43')]=[{'all':!![]}];}return db[_0x7743('0x41')][_0x7743('0x44')](_0x1902da);})[_0x7743('0x27')](function(_0x1a42c6){_0x27d7e6[_0x7743('0x45')]=_0x1a42c6;return _0x27d7e6;})[_0x7743('0x27')](respondWithFilteredResult(_0x1bbf54,_0x1902da))[_0x7743('0x46')](handleError(_0x1bbf54,null));})[_0x7743('0x46')](handleError(_0x1bbf54,null));};exports[_0x7743('0x47')]=function(_0x86ccaa,_0x47b171){var _0x145124={'raw':![],'where':{'id':_0x86ccaa['params']['id']}},_0x29dd36={};_0x29dd36[_0x7743('0x32')]=_[_0x7743('0x33')](db[_0x7743('0x41')][_0x7743('0x48')]);_0x29dd36[_0x7743('0x34')]=_[_0x7743('0x33')](_0x86ccaa[_0x7743('0x34')]);_0x29dd36[_0x7743('0x3d')]=_[_0x7743('0x35')](_0x29dd36[_0x7743('0x32')],_0x29dd36['query']);_0x145124[_0x7743('0x36')]=_[_0x7743('0x35')](_0x29dd36['model'],qs[_0x7743('0x37')](_0x86ccaa[_0x7743('0x34')][_0x7743('0x37')]));_0x145124['attributes']=_0x145124[_0x7743('0x36')][_0x7743('0x49')]?_0x145124[_0x7743('0x36')]:_0x29dd36[_0x7743('0x32')];if(_0x86ccaa[_0x7743('0x34')][_0x7743('0x42')]){_0x145124[_0x7743('0x43')]=[{'all':!![]}];}_0x145124=_[_0x7743('0x3f')]({},_0x145124,_0x86ccaa[_0x7743('0x4a')]);return db['CmCompany']['find'](_0x145124)[_0x7743('0x27')](handleEntityNotFound(_0x47b171,null))[_0x7743('0x27')](respondWithResult(_0x47b171,null))['catch'](handleError(_0x47b171,null));};exports[_0x7743('0x4b')]=function(_0x5cd6f4,_0x59cab8){return db[_0x7743('0x41')][_0x7743('0x4b')](_0x5cd6f4[_0x7743('0x4c')],{})[_0x7743('0x27')](function(_0x243cc4){var _0x536e50=_0x5cd6f4[_0x7743('0x4d')][_0x7743('0x29')]({'plain':!![]});if(!_0x536e50)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x536e50['role']===_0x7743('0x4d')){var _0x59fd91=_0x243cc4['get']({'plain':!![]});var _0x42ecbd=_0x7743('0x2a');return db[_0x7743('0x4e')][_0x7743('0x4f')]({'where':{'name':_0x42ecbd,'userProfileId':_0x536e50[_0x7743('0x50')]},'raw':!![]})[_0x7743('0x27')](function(_0x570a4c){if(_0x570a4c&&_0x570a4c[_0x7743('0x51')]===0x0){return db[_0x7743('0x52')]['create']({'name':_0x59fd91['name'],'resourceId':_0x59fd91['id'],'type':_0x570a4c[_0x7743('0x2f')],'sectionId':_0x570a4c['id']},{})[_0x7743('0x27')](function(){return _0x243cc4;});}else{return _0x243cc4;}})[_0x7743('0x46')](function(_0x5bdfe8){logger[_0x7743('0x2d')](_0x7743('0x53'),_0x5bdfe8);throw _0x5bdfe8;});}return _0x243cc4;})[_0x7743('0x27')](respondWithResult(_0x59cab8,0xc9))[_0x7743('0x46')](handleError(_0x59cab8,null));};exports[_0x7743('0x26')]=function(_0x215528,_0x37223d){if(_0x215528[_0x7743('0x4c')]['id']){delete _0x215528['body']['id'];}return db[_0x7743('0x41')][_0x7743('0x4f')]({'where':{'id':_0x215528[_0x7743('0x54')]['id']}})[_0x7743('0x27')](handleEntityNotFound(_0x37223d,null))[_0x7743('0x27')](saveUpdates(_0x215528[_0x7743('0x4c')],null))[_0x7743('0x27')](respondWithResult(_0x37223d,null))[_0x7743('0x46')](handleError(_0x37223d,null));};exports['destroy']=function(_0xd47076,_0x6f93c3){return db[_0x7743('0x41')]['find']({'where':{'id':_0xd47076[_0x7743('0x54')]['id']}})[_0x7743('0x27')](handleEntityNotFound(_0x6f93c3,null))[_0x7743('0x27')](removeEntity(_0x6f93c3,null))['catch'](handleError(_0x6f93c3,null));};exports[_0x7743('0x31')]=function(_0x14bbe7,_0xcc25bc){return db['CmCompany'][_0x7743('0x31')]()[_0x7743('0x27')](respondWithResult(_0xcc25bc,null))['catch'](handleError(_0xcc25bc,null));};exports[_0x7743('0x55')]=function(_0x27ea3f,_0x39c517,_0x909544){return db['CmContact'][_0x7743('0x4f')]({'where':{'id':_0x27ea3f[_0x7743('0x54')]['id']}})[_0x7743('0x27')](handleEntityNotFound(_0x39c517,null))[_0x7743('0x27')](function(_0x406891){if(_0x406891){return _0x406891[_0x7743('0x55')](_0x27ea3f[_0x7743('0x4c')]['ids'],_[_0x7743('0x56')](_0x27ea3f[_0x7743('0x4c')],[_0x7743('0x57'),'id'])||{});}})[_0x7743('0x27')](respondWithResult(_0x39c517,null))[_0x7743('0x46')](handleError(_0x39c517,null));};exports[_0x7743('0x58')]=function(_0x408345,_0x94466b,_0x351046){var _0x46a8e3={};var _0x5c11af={};var _0x30e8ac;var _0x4c31f7;return db[_0x7743('0x41')][_0x7743('0x59')]({'where':{'id':_0x408345[_0x7743('0x54')]['id']}})[_0x7743('0x27')](handleEntityNotFound(_0x94466b,null))['then'](function(_0x225121){if(_0x225121){_0x30e8ac=_0x225121;_0x5c11af['model']=_[_0x7743('0x33')](db[_0x7743('0x5a')][_0x7743('0x48')]);_0x5c11af[_0x7743('0x34')]=_[_0x7743('0x33')](_0x408345[_0x7743('0x34')]);_0x5c11af['filters']=_[_0x7743('0x35')](_0x5c11af[_0x7743('0x32')],_0x5c11af[_0x7743('0x34')]);_0x46a8e3[_0x7743('0x36')]=_[_0x7743('0x35')](_0x5c11af['model'],qs['fields'](_0x408345[_0x7743('0x34')][_0x7743('0x37')]));_0x46a8e3[_0x7743('0x36')]=_0x46a8e3['attributes'][_0x7743('0x49')]?_0x46a8e3['attributes']:_0x5c11af[_0x7743('0x32')];_0x46a8e3[_0x7743('0x3a')]=qs['sort'](_0x408345['query'][_0x7743('0x3b')]);_0x46a8e3[_0x7743('0x3c')]=qs[_0x7743('0x3d')](_['pick'](_0x408345[_0x7743('0x34')],_0x5c11af[_0x7743('0x3d')]));if(_0x408345[_0x7743('0x34')][_0x7743('0x3e')]){_0x46a8e3[_0x7743('0x3c')]=_[_0x7743('0x3f')](_0x46a8e3[_0x7743('0x3c')],{'$or':_[_0x7743('0x40')](_0x46a8e3['attributes'],function(_0x34066a){var _0x219074={};_0x219074[_0x34066a]={'$like':'%'+_0x408345[_0x7743('0x34')]['filter']+'%'};return _0x219074;})});}_0x46a8e3=_[_0x7743('0x3f')]({},_0x46a8e3,_0x408345[_0x7743('0x4a')]);return _0x30e8ac[_0x7743('0x58')](_0x46a8e3);}})[_0x7743('0x27')](function(_0x57a4d5){if(_0x57a4d5){_0x4c31f7=_0x57a4d5[_0x7743('0x49')];if(!_0x408345[_0x7743('0x34')][_0x7743('0x38')](_0x7743('0x39'))){_0x46a8e3['limit']=qs[_0x7743('0x1e')](_0x408345[_0x7743('0x34')][_0x7743('0x1e')]);_0x46a8e3[_0x7743('0x21')]=qs[_0x7743('0x21')](_0x408345[_0x7743('0x34')][_0x7743('0x21')]);}return _0x30e8ac[_0x7743('0x58')](_0x46a8e3);}})['then'](function(_0x3cf4e8){if(_0x3cf4e8){return _0x3cf4e8?{'count':_0x4c31f7,'rows':_0x3cf4e8}:null;}})['then'](respondWithResult(_0x94466b,null))[_0x7743('0x46')](handleError(_0x94466b,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index de39432..55be2b1 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 _0x2704=['moment','bluebird','request-promise','path','rimraf','./cmCompany.attributes','exports','define','CmCompany','lodash','util','../../config/logger','api'];(function(_0xbf50e9,_0x37815a){var _0x5a375b=function(_0x35a694){while(--_0x35a694){_0xbf50e9['push'](_0xbf50e9['shift']());}};_0x5a375b(++_0x37815a);}(_0x2704,0x182));var _0x4270=function(_0x3a7ab8,_0x35dbf3){_0x3a7ab8=_0x3a7ab8-0x0;var _0x2734fa=_0x2704[_0x3a7ab8];return _0x2734fa;};'use strict';var _=require(_0x4270('0x0'));var util=require(_0x4270('0x1'));var logger=require(_0x4270('0x2'))(_0x4270('0x3'));var moment=require(_0x4270('0x4'));var BPromise=require(_0x4270('0x5'));var rp=require(_0x4270('0x6'));var fs=require('fs');var path=require(_0x4270('0x7'));var rimraf=require(_0x4270('0x8'));var config=require('../../config/environment');var attributes=require(_0x4270('0x9'));module[_0x4270('0xa')]=function(_0x17cb39,_0x540298){return _0x17cb39[_0x4270('0xb')](_0x4270('0xc'),attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe420=['path','rimraf','../../config/environment','./cmCompany.attributes','define','CmCompany','cm_companies','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0xe420,0xb0));var _0x0e42=function(_0xa272c4,_0x1cf585){_0xa272c4=_0xa272c4-0x0;var _0x555142=_0xe420[_0xa272c4];return _0x555142;};'use strict';var _=require(_0x0e42('0x0'));var util=require(_0x0e42('0x1'));var logger=require(_0x0e42('0x2'))(_0x0e42('0x3'));var moment=require(_0x0e42('0x4'));var BPromise=require('bluebird');var rp=require(_0x0e42('0x5'));var fs=require('fs');var path=require(_0x0e42('0x6'));var rimraf=require(_0x0e42('0x7'));var config=require(_0x0e42('0x8'));var attributes=require(_0x0e42('0x9'));module['exports']=function(_0x27b5f1,_0x33604f){return _0x27b5f1[_0x0e42('0xa')](_0x0e42('0xb'),attributes,{'tableName':_0x0e42('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 0e77786..4af4b41 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 _0x7e4c=['../../config/environment','client','http','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x390a19,_0x5dd137){var _0x5d8230=function(_0x2e6234){while(--_0x2e6234){_0x390a19['push'](_0x390a19['shift']());}};_0x5d8230(++_0x5dd137);}(_0x7e4c,0x11e));var _0xc7e4=function(_0x2742db,_0x58e00c){_0x2742db=_0x2742db-0x0;var _0x18659e=_0x7e4c[_0x2742db];return _0x18659e;};'use strict';var _=require(_0xc7e4('0x0'));var util=require('util');var moment=require(_0xc7e4('0x1'));var BPromise=require('bluebird');var rs=require(_0xc7e4('0x2'));var fs=require('fs');var Redis=require(_0xc7e4('0x3'));var db=require(_0xc7e4('0x4'))['db'];var utils=require(_0xc7e4('0x5'));var logger=require(_0xc7e4('0x6'))(_0xc7e4('0x7'));var config=require(_0xc7e4('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc7e4('0x9')][_0xc7e4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2612a7,_0x427557,_0x162bd2){return new BPromise(function(_0x1a8c07,_0x27127e){return client['request'](_0x2612a7,_0x162bd2)[_0xc7e4('0xb')](function(_0x3ced0f){logger[_0xc7e4('0xc')](_0xc7e4('0xd'),_0x427557,_0xc7e4('0xe'));logger[_0xc7e4('0xf')](_0xc7e4('0x10'),_0x427557,_0xc7e4('0xe'),JSON[_0xc7e4('0x11')](_0x3ced0f));if(_0x3ced0f[_0xc7e4('0x12')]){if(_0x3ced0f['error']['code']===0x1f4){logger[_0xc7e4('0x12')](_0xc7e4('0xd'),_0x427557,_0x3ced0f[_0xc7e4('0x12')][_0xc7e4('0x13')]);return _0x27127e(_0x3ced0f[_0xc7e4('0x12')][_0xc7e4('0x13')]);}logger[_0xc7e4('0x12')]('CmCompany,\x20%s,\x20%s',_0x427557,_0x3ced0f['error'][_0xc7e4('0x13')]);return _0x1a8c07(_0x3ced0f[_0xc7e4('0x12')]['message']);}else{logger[_0xc7e4('0xc')](_0xc7e4('0xd'),_0x427557,_0xc7e4('0xe'));_0x1a8c07(_0x3ced0f[_0xc7e4('0x14')][_0xc7e4('0x13')]);}})['catch'](function(_0x32e405){logger[_0xc7e4('0x12')](_0xc7e4('0xd'),_0x427557,_0x32e405);_0x27127e(_0x32e405);});});} \ No newline at end of file +var _0x5b64=['request','info','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','CmCompany,\x20%s,\x20%s','message','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x1e5019,_0x516600){var _0x5bb93a=function(_0x4b4df4){while(--_0x4b4df4){_0x1e5019['push'](_0x1e5019['shift']());}};_0x5bb93a(++_0x516600);}(_0x5b64,0x66));var _0x45b6=function(_0x7cc4c4,_0x544d32){_0x7cc4c4=_0x7cc4c4-0x0;var _0x5d464b=_0x5b64[_0x7cc4c4];return _0x5d464b;};'use strict';var _=require(_0x45b6('0x0'));var util=require(_0x45b6('0x1'));var moment=require(_0x45b6('0x2'));var BPromise=require(_0x45b6('0x3'));var rs=require(_0x45b6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x45b6('0x5'))['db'];var utils=require(_0x45b6('0x6'));var logger=require(_0x45b6('0x7'))(_0x45b6('0x8'));var config=require(_0x45b6('0x9'));var jayson=require(_0x45b6('0xa'));var client=jayson[_0x45b6('0xb')][_0x45b6('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x272c8a,_0xf0ad47,_0x1d118a){return new BPromise(function(_0x239074,_0x536669){return client[_0x45b6('0xd')](_0x272c8a,_0x1d118a)['then'](function(_0x4891ff){logger[_0x45b6('0xe')]('CmCompany,\x20%s,\x20%s',_0xf0ad47,_0x45b6('0xf'));logger[_0x45b6('0x10')](_0x45b6('0x11'),_0xf0ad47,'request\x20sent',JSON[_0x45b6('0x12')](_0x4891ff));if(_0x4891ff[_0x45b6('0x13')]){if(_0x4891ff['error'][_0x45b6('0x14')]===0x1f4){logger[_0x45b6('0x13')](_0x45b6('0x15'),_0xf0ad47,_0x4891ff[_0x45b6('0x13')][_0x45b6('0x16')]);return _0x536669(_0x4891ff[_0x45b6('0x13')]['message']);}logger['error'](_0x45b6('0x15'),_0xf0ad47,_0x4891ff['error'][_0x45b6('0x16')]);return _0x239074(_0x4891ff[_0x45b6('0x13')]['message']);}else{logger[_0x45b6('0xe')](_0x45b6('0x15'),_0xf0ad47,'request\x20sent');_0x239074(_0x4891ff['result'][_0x45b6('0x16')]);}})['catch'](function(_0xebfc33){logger[_0x45b6('0x13')](_0x45b6('0x15'),_0xf0ad47,_0xebfc33);_0x536669(_0xebfc33);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index 01bdd89..e8e522f 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 _0x0f08=['exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','/:id/contacts','getContacts','post','addContacts','put','update','delete'];(function(_0x5c6ac8,_0x1b617f){var _0x16394c=function(_0x391106){while(--_0x391106){_0x5c6ac8['push'](_0x5c6ac8['shift']());}};_0x16394c(++_0x1b617f);}(_0x0f08,0x109));var _0x80f0=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0x0f08[_0x4d613c];return _0x301fe3;};'use strict';var multer=require(_0x80f0('0x0'));var util=require(_0x80f0('0x1'));var path=require(_0x80f0('0x2'));var timeout=require(_0x80f0('0x3'));var express=require('express');var router=express[_0x80f0('0x4')]();var fs_extra=require(_0x80f0('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x80f0('0x6'));var config=require(_0x80f0('0x7'));var controller=require('./cmCompany.controller');router[_0x80f0('0x8')]('/',auth[_0x80f0('0x9')](),controller[_0x80f0('0xa')]);router[_0x80f0('0x8')](_0x80f0('0xb'),auth[_0x80f0('0x9')](),controller['describe']);router[_0x80f0('0x8')](_0x80f0('0xc'),auth[_0x80f0('0x9')](),controller[_0x80f0('0xd')]);router['get'](_0x80f0('0xe'),auth[_0x80f0('0x9')](),controller[_0x80f0('0xf')]);router['post']('/',auth[_0x80f0('0x9')](),controller['create']);router[_0x80f0('0x10')]('/:id/contacts',auth[_0x80f0('0x9')](),controller[_0x80f0('0x11')]);router[_0x80f0('0x12')](_0x80f0('0xc'),auth[_0x80f0('0x9')](),controller[_0x80f0('0x13')]);router[_0x80f0('0x14')](_0x80f0('0xc'),auth[_0x80f0('0x9')](),controller['destroy']);module[_0x80f0('0x15')]=router; \ No newline at end of file +var _0x1d39=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/contacts','getContacts','post','addContacts','put','update','delete','destroy','exports'];(function(_0x2f4c1c,_0x5a3dd4){var _0x25e0f2=function(_0x46ea31){while(--_0x46ea31){_0x2f4c1c['push'](_0x2f4c1c['shift']());}};_0x25e0f2(++_0x5a3dd4);}(_0x1d39,0x108));var _0x91d3=function(_0x10c4d6,_0x1cd56c){_0x10c4d6=_0x10c4d6-0x0;var _0x3a4a5f=_0x1d39[_0x10c4d6];return _0x3a4a5f;};'use strict';var multer=require(_0x91d3('0x0'));var util=require(_0x91d3('0x1'));var path=require(_0x91d3('0x2'));var timeout=require(_0x91d3('0x3'));var express=require(_0x91d3('0x4'));var router=express[_0x91d3('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x91d3('0x6'));var interaction=require(_0x91d3('0x7'));var config=require('../../config/environment');var controller=require('./cmCompany.controller');router[_0x91d3('0x8')]('/',auth[_0x91d3('0x9')](),controller[_0x91d3('0xa')]);router[_0x91d3('0x8')](_0x91d3('0xb'),auth[_0x91d3('0x9')](),controller[_0x91d3('0xc')]);router[_0x91d3('0x8')](_0x91d3('0xd'),auth['isAuthenticated'](),controller[_0x91d3('0xe')]);router['get'](_0x91d3('0xf'),auth[_0x91d3('0x9')](),controller[_0x91d3('0x10')]);router[_0x91d3('0x11')]('/',auth[_0x91d3('0x9')](),controller['create']);router[_0x91d3('0x11')](_0x91d3('0xf'),auth[_0x91d3('0x9')](),controller[_0x91d3('0x12')]);router[_0x91d3('0x13')](_0x91d3('0xd'),auth[_0x91d3('0x9')](),controller[_0x91d3('0x14')]);router[_0x91d3('0x15')](_0x91d3('0xd'),auth['isAuthenticated'](),controller[_0x91d3('0x16')]);module[_0x91d3('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 edf4353..263f971 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 _0xe4e8=['lodash','exports','STRING','TEXT','INTEGER','UNSIGNED','NOW'];(function(_0x5bec42,_0x2e8ce9){var _0x2a1602=function(_0x3fb8a8){while(--_0x3fb8a8){_0x5bec42['push'](_0x5bec42['shift']());}};_0x2a1602(++_0x2e8ce9);}(_0xe4e8,0x13b));var _0x8e4e=function(_0x133a2e,_0x18376d){_0x133a2e=_0x133a2e-0x0;var _0x1a2782=_0xe4e8[_0x133a2e];return _0x1a2782;};'use strict';var _=require(_0x8e4e('0x0'));var Sequelize=require('sequelize');module[_0x8e4e('0x1')]={'firstName':{'type':Sequelize[_0x8e4e('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x8e4e('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x8e4e('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x8e4e('0x2')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x8e4e('0x3')]},'phone':{'type':Sequelize[_0x8e4e('0x2')]},'mobile':{'type':Sequelize[_0x8e4e('0x2')]},'fax':{'type':Sequelize[_0x8e4e('0x2')]},'email':{'type':Sequelize[_0x8e4e('0x2')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0x8e4e('0x2')]},'skype':{'type':Sequelize[_0x8e4e('0x2')]},'teams':{'type':Sequelize[_0x8e4e('0x2')]},'viber':{'type':Sequelize[_0x8e4e('0x2')]},'line':{'type':Sequelize[_0x8e4e('0x2')]},'wechat':{'type':Sequelize[_0x8e4e('0x2')]},'telegram':{'type':Sequelize[_0x8e4e('0x2')]},'UserId':{'type':Sequelize['INTEGER']},'priority':{'type':Sequelize[_0x8e4e('0x4')](0x2)[_0x8e4e('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0x8e4e('0x6')]}}; \ No newline at end of file +var _0xeca1=['DATE','NOW','lodash','exports','STRING','TEXT','INTEGER','UNSIGNED'];(function(_0x3f830b,_0x493523){var _0x33f6f2=function(_0x1e2751){while(--_0x1e2751){_0x3f830b['push'](_0x3f830b['shift']());}};_0x33f6f2(++_0x493523);}(_0xeca1,0x10a));var _0x1eca=function(_0x142d26,_0x1920db){_0x142d26=_0x142d26-0x0;var _0x4aee13=_0xeca1[_0x142d26];return _0x4aee13;};'use strict';var _=require(_0x1eca('0x0'));var Sequelize=require('sequelize');module[_0x1eca('0x1')]={'firstName':{'type':Sequelize[_0x1eca('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x1eca('0x2')]},'street':{'type':Sequelize[_0x1eca('0x2')]},'postalCode':{'type':Sequelize[_0x1eca('0x2')]},'city':{'type':Sequelize[_0x1eca('0x2')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0x1eca('0x2')]},'description':{'type':Sequelize[_0x1eca('0x3')]},'phone':{'type':Sequelize[_0x1eca('0x2')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x1eca('0x2')]},'email':{'type':Sequelize[_0x1eca('0x2')]},'url':{'type':Sequelize[_0x1eca('0x2')]},'facebook':{'type':Sequelize[_0x1eca('0x2')]},'fb_data':{'type':Sequelize[_0x1eca('0x2')]},'twitter':{'type':Sequelize[_0x1eca('0x2')]},'skype':{'type':Sequelize[_0x1eca('0x2')]},'teams':{'type':Sequelize[_0x1eca('0x2')]},'viber':{'type':Sequelize[_0x1eca('0x2')]},'line':{'type':Sequelize[_0x1eca('0x2')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0x1eca('0x2')]},'UserId':{'type':Sequelize['INTEGER']},'priority':{'type':Sequelize[_0x1eca('0x4')](0x2)[_0x1eca('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x1eca('0x6')],'defaultValue':Sequelize[_0x1eca('0x7')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index 07685dc..30213c3 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 _0xc202=['rows','catch','params','columnName','findAll','displayName','alias','values','body','get','mergeWith','tags','join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','info','[CmContact][merge][destroy][CmHopper],\x20%s','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelMessage','CmHopperFinal','CmHopperHistory','ReportAgentPreview','ChatQueueReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappQueueReport','bulkCreate','each','duplicates','$or','findOrCreate','spread','error','show','color','$and','omit','cf_%d','pickBy','format','id\x20=\x20?','phone','getTags','findOne','rawAttributes','pick','options','setTags','ContactId','includeAll','include','getHopperHistories','getHopperFinals','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','binding_keys','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','server/files/tmp','file','chmodSync','0777','child_process','../../components/import/cm/csv','CompanyId','File\x20uploaded\x20correctly!','pid','meta','import','binding','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','exit','getJourney','mail','chat','openchannel','fax','whatsapp','voice','resolve','channel','includes','toLowerCase','Invalid\x20channel','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','uniqueid','source','destination','duration','note','userDisposition','UserId','fullname','createdAt','DESC','findAndCountAll','startCase','Website','closed','closedAt','disposition','secondDisposition','thirdDisposition','Account','key','Owner','browserName','customerIp','customerPort','deviceModel','osName','ratingMessage','ratingType','referer','subject','substatus','externalUrl','threadId','Interaction','flatten','sortBy','slice','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','socket.io-emitter','redis','./cmContact.socket','register','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','name','send','index','CmContact','describe','keys','length','startsWith','CmCustomField','trimStart','all','cf_','fieldType','type','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','select','field','from','tools_tags','cm_contacts','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','left_join','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','expr','search','sqlOperator','conditions','find','Tag','split','map','union','User','uc.UserId\x20=\x20?','dateOfBirth','datetime','castTo','DATE','buildExpression','text','value','start','Contact','isEmpty','forEach','ListId','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','c.id\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','group','c.id','Sequelize','QueryTypes','SELECT','clone','having','t.id\x20IN\x20?','role','agent','user','getLists','c.ListId\x20IS\x20NULL','c.ListId\x20IN\x20?','sequelize','toString','keyBy','merge','c.firstName','c.fax','c.email','c.ListId','c.createdAt','c.deletedAt','c.CompanyId','TagIds','Tags','push'];(function(_0x49297d,_0x2b04c1){var _0x3e7dbd=function(_0x10a151){while(--_0x10a151){_0x49297d['push'](_0x49297d['shift']());}};_0x3e7dbd(++_0x2b04c1);}(_0xc202,0x95));var _0x2c20=function(_0x56c758,_0x540591){_0x56c758=_0x56c758-0x0;var _0x9bb0db=_0xc202[_0x56c758];return _0x9bb0db;};'use strict';var emlformat=require(_0x2c20('0x0'));var rimraf=require(_0x2c20('0x1'));var zipdir=require(_0x2c20('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2c20('0x3'));var moment=require(_0x2c20('0x4'));var BPromise=require(_0x2c20('0x5'));var Mustache=require(_0x2c20('0x6'));var util=require('util');var path=require(_0x2c20('0x7'));var sox=require('sox');var csv=require(_0x2c20('0x8'));var ejs=require(_0x2c20('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2c20('0xa'));var squel=require('squel');var crypto=require(_0x2c20('0xb'));var jsforce=require(_0x2c20('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2c20('0xd'));var Redis=require(_0x2c20('0xe'));var authService=require(_0x2c20('0xf'));var qs=require(_0x2c20('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2c20('0x11'));var logger=require('../../config/logger')(_0x2c20('0x12'));var utils=require(_0x2c20('0x13'));var config=require(_0x2c20('0x14'));var licenseUtil=require(_0x2c20('0x15'));var db=require(_0x2c20('0x16'))['db'];config['redis']=_[_0x2c20('0x17')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x2c20('0x18'))(new Redis(config[_0x2c20('0x19')]));require(_0x2c20('0x1a'))[_0x2c20('0x1b')](socket);function respondWithStatusCode(_0xb3ae36,_0x4c3e50){_0x4c3e50=_0x4c3e50||0xcc;return function(_0x36a231){if(_0x36a231){return _0xb3ae36[_0x2c20('0x1c')](_0x4c3e50);}return _0xb3ae36[_0x2c20('0x1d')](_0x4c3e50)[_0x2c20('0x1e')]();};}function respondWithResult(_0x2e2429,_0xc67df3){_0xc67df3=_0xc67df3||0xc8;return function(_0x1fd186){if(_0x1fd186){return _0x2e2429[_0x2c20('0x1d')](_0xc67df3)['json'](_0x1fd186);}};}function respondWithFilteredResult(_0x362a88,_0x54495d){return function(_0x384198){if(_0x384198){var _0x3aaea2=typeof _0x54495d[_0x2c20('0x1f')]==='undefined'&&typeof _0x54495d['limit']===_0x2c20('0x20');var _0x4602ac=_0x384198['count'];var _0x2b886f=_0x3aaea2?0x0:_0x54495d[_0x2c20('0x1f')];var _0x4369e3=_0x3aaea2?_0x384198[_0x2c20('0x21')]:_0x54495d[_0x2c20('0x1f')]+_0x54495d[_0x2c20('0x22')];var _0x539a49;if(_0x4369e3>=_0x4602ac){_0x4369e3=_0x4602ac;_0x539a49=0xc8;}else{_0x539a49=0xce;}_0x362a88[_0x2c20('0x1d')](_0x539a49);return _0x362a88[_0x2c20('0x23')](_0x2c20('0x24'),_0x2b886f+'-'+_0x4369e3+'/'+_0x4602ac)[_0x2c20('0x25')](_0x384198);}return null;};}function patchUpdates(_0x580c4a){return function(_0x21c1db){try{jsonpatch[_0x2c20('0x26')](_0x21c1db,_0x580c4a,!![]);}catch(_0x517b5e){return BPromise[_0x2c20('0x27')](_0x517b5e);}return _0x21c1db[_0x2c20('0x28')]();};}function saveUpdates(_0x33b197,_0x12a198){return function(_0x3522b9){if(_0x3522b9){return _0x3522b9[_0x2c20('0x29')](_0x33b197)[_0x2c20('0x2a')](function(_0x26c500){return _0x26c500;});}return null;};}function removeEntity(_0x4e3d63,_0x322ef4){return function(_0x5c5590){if(_0x5c5590){return _0x5c5590[_0x2c20('0x2b')]()['then'](function(){_0x4e3d63['status'](0xcc)[_0x2c20('0x1e')]();});}};}function handleEntityNotFound(_0x566ba3,_0xfb0f95){return function(_0x9c5ab0){if(!_0x9c5ab0){_0x566ba3[_0x2c20('0x1c')](0x194);}return _0x9c5ab0;};}function handleError(_0x2d7e28,_0x297532){_0x297532=_0x297532||0x1f4;return function(_0x2cc8ae){logger['error'](_0x2cc8ae['stack']);if(_0x2cc8ae[_0x2c20('0x2c')]){delete _0x2cc8ae[_0x2c20('0x2c')];}_0x2d7e28[_0x2c20('0x1d')](_0x297532)[_0x2c20('0x2d')](_0x2cc8ae);};}exports[_0x2c20('0x2e')]=function(_0x31a26b,_0x46b65c){var _0x3d74a8={},_0x493f49={},_0x21b281={'count':0x0,'rows':[]};return db[_0x2c20('0x2f')][_0x2c20('0x30')]()[_0x2c20('0x2a')](function(_0x432011){var _0x3c457a=[];for(var _0x496e3c=0x0;_0x496e3c0x1){_0x52732e['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x381f54),null);}else{if(qs['isNumeric'](_0x381f54)){_0x52732e['or'](_0x2c20('0x6d'),_0x381f54+'%');_0x52732e['or']('c.phone\x20LIKE\x20?',_0x381f54+'%');_0x52732e['or'](_0x2c20('0x6e'),_0x381f54+'%');_0x52732e['or'](_0x2c20('0x6f'),_0x381f54+'%');}else if(qs[_0x2c20('0x70')](_0x381f54)){_0x52732e['or'](_0x2c20('0x71'),_0x381f54+'%');}else{_0x52732e['or'](_0x2c20('0x72'),'%'+_0x381f54+'%');_0x52732e['or'](_0x2c20('0x73'),'%'+_0x381f54+'%');_0x52732e['or'](_0x2c20('0x71'),'%'+_0x381f54+'%');}}}}_0x34bc6a['where'](_0x52732e);_0x34bc6a[_0x2c20('0x74')](_0x2c20('0x75'));var _0x67ec9c={'type':db[_0x2c20('0x76')][_0x2c20('0x77')][_0x2c20('0x78')],'raw':!![]};var _0x58c793=_0x34bc6a[_0x2c20('0x79')]()['field'](_0x2c20('0x75'));if(_0x3d74a8[_0x2c20('0x42')]){_0x3d74a8['order'][_0x2c20('0x64')](function(_0x79d35c){_0x34bc6a['order']('c.'+_0x79d35c[0x0],_0x79d35c[0x1]==='DESC'?![]:!![]);});}if(!_[_0x2c20('0x63')](_0x37c920)){_0x34bc6a[_0x2c20('0x7a')](_0x128e0f);_0x58c793[_0x2c20('0x44')](_0x2c20('0x7b'),_0x37c920);}BPromise['resolve']()[_0x2c20('0x2a')](function(){if(!_0x2f7e66)return;if(_0x31a26b['user'][_0x2c20('0x7c')]!==_0x2c20('0x7d'))return;if(!_['some'](_0x2f7e66[_0x2c20('0x52')],[_0x2c20('0x46'),_0x2c20('0x58')])){return _0x31a26b[_0x2c20('0x7e')][_0x2c20('0x7f')]({'attributes':['id'],'raw':!![]})[_0x2c20('0x2a')](function(_0x396b8e){if(_[_0x2c20('0x63')](_0x396b8e)){_0x58c793[_0x2c20('0x44')](_0x2c20('0x80'));_0x34bc6a[_0x2c20('0x44')](_0x2c20('0x80'));}else{_0x58c793[_0x2c20('0x44')](_0x2c20('0x81'),_[_0x2c20('0x56')](_0x396b8e,'id'));_0x34bc6a['where'](_0x2c20('0x81'),_[_0x2c20('0x56')](_0x396b8e,'id'));}});}})['then'](function(){if(_0x31a26b[_0x2c20('0x7e')]['role']===_0x2c20('0x7d')&&!_0x2f7e66&&!_0x31a26b[_0x2c20('0x3b')]['ListId'])return[];return db[_0x2c20('0x82')][_0x2c20('0x3b')](_0x58c793[_0x2c20('0x83')](),_0x67ec9c);})[_0x2c20('0x2a')](function(_0xdde959){_0x21b281['count']=_0xdde959[_0x2c20('0x32')];if(_0x21b281[_0x2c20('0x21')]===0x0)return[];return db[_0x2c20('0x82')][_0x2c20('0x3b')](_0x3b0d31[_0x2c20('0x83')](),_0x67ec9c)[_0x2c20('0x2a')](function(_0xf3fe89){_0x104549=_[_0x2c20('0x84')](_0xf3fe89,'id');_0x67ec9c=_[_0x2c20('0x85')](_0x67ec9c,{'model':db[_0x2c20('0x2f')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x31a26b['query'][_0x2c20('0x3f')]){_0x3d74a8[_0x2c20('0x3d')][_0x2c20('0x64')](function(_0x511662){_0x34bc6a['field']('c.'+_0x511662);});}else{_0x34bc6a[_0x2c20('0x46')](_0x2c20('0x75'));_0x34bc6a[_0x2c20('0x46')](_0x2c20('0x86'));_0x34bc6a[_0x2c20('0x46')]('c.lastName');_0x34bc6a[_0x2c20('0x46')]('c.phone');_0x34bc6a['field']('c.mobile');_0x34bc6a['field'](_0x2c20('0x87'));_0x34bc6a[_0x2c20('0x46')](_0x2c20('0x88'));_0x34bc6a['field'](_0x2c20('0x89'));_0x34bc6a[_0x2c20('0x46')](_0x2c20('0x8a'));_0x34bc6a['field'](_0x2c20('0x8b'));_0x34bc6a[_0x2c20('0x46')](_0x2c20('0x8c'));_0x34bc6a[_0x2c20('0x46')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x2c20('0x8d'));}if(_0x3d74a8[_0x2c20('0x22')])_0x34bc6a[_0x2c20('0x22')](_0x3d74a8[_0x2c20('0x22')]);if(_0x3d74a8['offset'])_0x34bc6a[_0x2c20('0x1f')](_0x3d74a8[_0x2c20('0x1f')]);return db[_0x2c20('0x82')][_0x2c20('0x3b')](_0x34bc6a[_0x2c20('0x83')](),_0x67ec9c);});})['then'](function(_0x40692b){_0x40692b[_0x2c20('0x64')](function(_0x57da91){if(_0x57da91['TagIds']){_0x57da91['Tags']=[];_0x57da91[_0x2c20('0x8d')][_0x2c20('0x55')](',')[_0x2c20('0x64')](function(_0x5b67e3){_0x57da91[_0x2c20('0x8e')][_0x2c20('0x8f')](_0x104549[_0x5b67e3]);});}delete _0x57da91[_0x2c20('0x8d')];});_0x21b281[_0x2c20('0x90')]=_0x40692b;return _0x21b281;})[_0x2c20('0x2a')](respondWithFilteredResult(_0x46b65c,_0x3d74a8));})[_0x2c20('0x91')](handleError(_0x46b65c,null));};exports[_0x2c20('0x2b')]=function(_0x74a09b,_0x59d7ad){return db[_0x2c20('0x2f')][_0x2c20('0x53')]({'where':{'id':_0x74a09b[_0x2c20('0x92')]['id']}})['then'](handleEntityNotFound(_0x59d7ad,null))[_0x2c20('0x2a')](removeEntity(_0x59d7ad,null))[_0x2c20('0x91')](handleError(_0x59d7ad,null));};exports[_0x2c20('0x30')]=function(_0x378589,_0x4244c0){return db[_0x2c20('0x2f')][_0x2c20('0x30')]()[_0x2c20('0x2a')](function(_0x47da03){delete _0x47da03['tags'];for(var _0x33cf67=0x0;_0x33cf67=_0x1db1ed){_0xb785bf=_0x1db1ed;_0xf1db22=0xc8;}else{_0xf1db22=0xce;}_0x215286[_0xce6c('0x1e')](_0xf1db22);return _0x215286[_0xce6c('0x22')](_0xce6c('0x23'),_0x552717+'-'+_0xb785bf+'/'+_0x1db1ed)[_0xce6c('0x24')](_0xf55362);}return null;};}function patchUpdates(_0x53f736){return function(_0x497a91){try{jsonpatch[_0xce6c('0x25')](_0x497a91,_0x53f736,!![]);}catch(_0x336b87){return BPromise[_0xce6c('0x26')](_0x336b87);}return _0x497a91[_0xce6c('0x27')]();};}function saveUpdates(_0xb221c6,_0x2179ee){return function(_0x4e7666){if(_0x4e7666){return _0x4e7666['update'](_0xb221c6)[_0xce6c('0x28')](function(_0x438a0b){return _0x438a0b;});}return null;};}function removeEntity(_0x119fb9,_0x561cbb){return function(_0x330bad){if(_0x330bad){return _0x330bad[_0xce6c('0x29')]()[_0xce6c('0x28')](function(){_0x119fb9['status'](0xcc)[_0xce6c('0x2a')]();});}};}function handleEntityNotFound(_0x4cb444,_0x5c2433){return function(_0x23327e){if(!_0x23327e){_0x4cb444['sendStatus'](0x194);}return _0x23327e;};}function handleError(_0x1ecb80,_0x2a3f3b){_0x2a3f3b=_0x2a3f3b||0x1f4;return function(_0x569cc6){logger[_0xce6c('0x2b')](_0x569cc6['stack']);if(_0x569cc6[_0xce6c('0x2c')]){delete _0x569cc6[_0xce6c('0x2c')];}_0x1ecb80[_0xce6c('0x1e')](_0x2a3f3b)[_0xce6c('0x2d')](_0x569cc6);};}exports['index']=function(_0x27f686,_0x33e5e0){var _0x2cae07={},_0xa3257f={},_0x242ff3={'count':0x0,'rows':[]};return db[_0xce6c('0x2e')][_0xce6c('0x2f')]()[_0xce6c('0x28')](function(_0x2a0943){var _0x3f56e6=[];for(var _0x21654f=0x0;_0x21654f0x1){_0x11b769['or'](_0xce6c('0x6f'),qs[_0xce6c('0x70')](_0x58a80c),null);}else{if(qs[_0xce6c('0x71')](_0x58a80c)){_0x11b769['or']('c.id\x20LIKE\x20?',_0x58a80c+'%');_0x11b769['or'](_0xce6c('0x72'),_0x58a80c+'%');_0x11b769['or']('c.mobile\x20LIKE\x20?',_0x58a80c+'%');_0x11b769['or'](_0xce6c('0x73'),_0x58a80c+'%');}else if(qs[_0xce6c('0x74')](_0x58a80c)){_0x11b769['or'](_0xce6c('0x75'),_0x58a80c+'%');}else{_0x11b769['or'](_0xce6c('0x76'),'%'+_0x58a80c+'%');_0x11b769['or'](_0xce6c('0x77'),'%'+_0x58a80c+'%');_0x11b769['or'](_0xce6c('0x75'),'%'+_0x58a80c+'%');}}}}_0x2ba2ef[_0xce6c('0x40')](_0x11b769);_0x2ba2ef['group']('c.id');var _0x3e6612={'type':db[_0xce6c('0x78')][_0xce6c('0x79')][_0xce6c('0x7a')],'raw':!![]};var _0x424201=_0x2ba2ef[_0xce6c('0x7b')]()[_0xce6c('0x44')](_0xce6c('0x7c'));if(_0x2cae07[_0xce6c('0x3f')]){_0x2cae07[_0xce6c('0x3f')][_0xce6c('0x67')](function(_0x22e0ad){_0x2ba2ef[_0xce6c('0x3f')]('c.'+_0x22e0ad[0x0],_0x22e0ad[0x1]===_0xce6c('0x7d')?![]:!![]);});}if(!_[_0xce6c('0x66')](_0x1c379e)){_0x2ba2ef['having'](_0x4ac253);_0x424201[_0xce6c('0x40')](_0xce6c('0x7e'),_0x1c379e);}BPromise[_0xce6c('0x7f')]()[_0xce6c('0x28')](function(){if(!_0x4521e1)return;if(_0x27f686[_0xce6c('0x80')]['role']!==_0xce6c('0x81'))return;if(!_[_0xce6c('0x82')](_0x4521e1['conditions'],[_0xce6c('0x44'),_0xce6c('0x5b')])){return _0x27f686[_0xce6c('0x80')][_0xce6c('0x83')]({'attributes':['id'],'raw':!![]})[_0xce6c('0x28')](function(_0x22763d){if(_[_0xce6c('0x66')](_0x22763d)){_0x424201[_0xce6c('0x40')](_0xce6c('0x84'));_0x2ba2ef[_0xce6c('0x40')]('c.ListId\x20IS\x20NULL');}else{_0x424201[_0xce6c('0x40')](_0xce6c('0x68'),_[_0xce6c('0x59')](_0x22763d,'id'));_0x2ba2ef[_0xce6c('0x40')](_0xce6c('0x68'),_['map'](_0x22763d,'id'));}});}})[_0xce6c('0x28')](function(){if(_0x27f686[_0xce6c('0x80')][_0xce6c('0x85')]==='agent'&&!_0x4521e1&&!_0x27f686[_0xce6c('0x39')]['ListId'])return[];return db[_0xce6c('0x86')]['query'](_0x424201['toString'](),_0x3e6612);})[_0xce6c('0x28')](function(_0x744d10){_0x242ff3[_0xce6c('0x21')]=_0x744d10[_0xce6c('0x55')];if(_0x242ff3[_0xce6c('0x21')]===0x0)return[];return db['sequelize']['query'](_0x4bc4fe['toString'](),_0x3e6612)[_0xce6c('0x28')](function(_0x56d0a){_0x4eb073=_[_0xce6c('0x87')](_0x56d0a,'id');_0x3e6612=_[_0xce6c('0x88')](_0x3e6612,{'model':db[_0xce6c('0x2e')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x27f686[_0xce6c('0x39')][_0xce6c('0x3d')]){_0x2cae07['attributes'][_0xce6c('0x67')](function(_0x460661){_0x2ba2ef[_0xce6c('0x44')]('c.'+_0x460661);});}else{_0x2ba2ef['field'](_0xce6c('0x7c'));_0x2ba2ef[_0xce6c('0x44')](_0xce6c('0x89'));_0x2ba2ef['field']('c.lastName');_0x2ba2ef[_0xce6c('0x44')](_0xce6c('0x8a'));_0x2ba2ef['field']('c.mobile');_0x2ba2ef[_0xce6c('0x44')]('c.fax');_0x2ba2ef[_0xce6c('0x44')](_0xce6c('0x8b'));_0x2ba2ef[_0xce6c('0x44')]('c.ListId');_0x2ba2ef[_0xce6c('0x44')]('c.createdAt');_0x2ba2ef[_0xce6c('0x44')](_0xce6c('0x8c'));_0x2ba2ef[_0xce6c('0x44')](_0xce6c('0x8d'));_0x2ba2ef[_0xce6c('0x44')](_0xce6c('0x8e'),_0xce6c('0x8f'));}if(_0x2cae07['limit'])_0x2ba2ef[_0xce6c('0x20')](_0x2cae07[_0xce6c('0x20')]);if(_0x2cae07[_0xce6c('0x1f')])_0x2ba2ef[_0xce6c('0x1f')](_0x2cae07[_0xce6c('0x1f')]);return db[_0xce6c('0x86')][_0xce6c('0x39')](_0x2ba2ef[_0xce6c('0x90')](),_0x3e6612);});})['then'](function(_0x12c55c){_0x12c55c[_0xce6c('0x67')](function(_0x3a7bf4){if(_0x3a7bf4[_0xce6c('0x8f')]){_0x3a7bf4[_0xce6c('0x91')]=[];_0x3a7bf4[_0xce6c('0x8f')][_0xce6c('0x58')](',')[_0xce6c('0x67')](function(_0x42327b){_0x3a7bf4[_0xce6c('0x91')][_0xce6c('0x33')](_0x4eb073[_0x42327b]);});}delete _0x3a7bf4[_0xce6c('0x8f')];});_0x242ff3[_0xce6c('0x92')]=_0x12c55c;return _0x242ff3;})[_0xce6c('0x28')](respondWithFilteredResult(_0x33e5e0,_0x2cae07));})[_0xce6c('0x93')](handleError(_0x33e5e0,null));};exports[_0xce6c('0x29')]=function(_0x5c699c,_0x25a7da){return db[_0xce6c('0x2e')][_0xce6c('0x56')]({'where':{'id':_0x5c699c[_0xce6c('0x94')]['id']}})[_0xce6c('0x28')](handleEntityNotFound(_0x25a7da,null))[_0xce6c('0x28')](removeEntity(_0x25a7da,null))[_0xce6c('0x93')](handleError(_0x25a7da,null));};exports[_0xce6c('0x2f')]=function(_0x6df26d,_0x10639e){return db[_0xce6c('0x2e')]['describe']()[_0xce6c('0x28')](function(_0x400f3c){delete _0x400f3c[_0xce6c('0x95')];for(var _0x124d97=0x0;_0x124d97{}\s\\|]/g,'-');_0x337e78(null,util['format'](_0xc88b('0x1d'),path[_0xc88b('0x1e')](_0x20c02a[_0xc88b('0x1b')],path[_0xc88b('0x1f')](_0x20c02a[_0xc88b('0x1b')])),Date[_0xc88b('0x20')](),path[_0xc88b('0x1f')](_0x20c02a[_0xc88b('0x1b')])));}})});router[_0xc88b('0x14')]('/csv',upload[_0xc88b('0x21')]('file'),controller['uploadCsv']);var upload=multer({'storage':multer[_0xc88b('0x18')]({'destination':function(_0x141797,_0x29c860,_0x19efbc){_0x19efbc(null,path[_0xc88b('0x19')](config[_0xc88b('0x22')],_0xc88b('0x1a')));},'filename':function(_0x56a04a,_0x16f0ab,_0x13e159){_0x16f0ab[_0xc88b('0x1b')]=_0x16f0ab[_0xc88b('0x1b')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x13e159(null,util['format'](_0xc88b('0x1d'),path[_0xc88b('0x1e')](_0x16f0ab[_0xc88b('0x1b')],path[_0xc88b('0x1f')](_0x16f0ab['originalname'])),Date[_0xc88b('0x20')](),path[_0xc88b('0x1f')](_0x16f0ab[_0xc88b('0x1b')])));}})});router['post']('/upload',upload['single'](_0xc88b('0x23')),controller[_0xc88b('0x24')]);router[_0xc88b('0x14')](_0xc88b('0x25'),auth[_0xc88b('0x6')](),controller['import']);router[_0xc88b('0x26')](_0xc88b('0x9'),auth[_0xc88b('0x6')](),controller[_0xc88b('0x27')]);router[_0xc88b('0x28')](_0xc88b('0x9'),auth[_0xc88b('0x6')](),controller[_0xc88b('0x29')]);module['exports']=router; \ No newline at end of file +var _0x687f=['now','/csv','single','file','uploadCsv','diskStorage','format','/upload','import','put','/:id','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContact.controller','get','isAuthenticated','/describe','describe','show','/:id/tags','getHoppers','/:id/hopper_histories','getHopperFinals','/:id/jscripty_sessions','getJscriptySessions','getJourney','post','/merge','merge','create','/create_many','bulkCreate','setTags','join','root','server/files/tmp','originalname','replace','%s-%s%s','basename','extname'];(function(_0x39e84d,_0x11931d){var _0x1991bc=function(_0xc81e32){while(--_0xc81e32){_0x39e84d['push'](_0x39e84d['shift']());}};_0x1991bc(++_0x11931d);}(_0x687f,0xa3));var _0xf687=function(_0x4e170e,_0x207e58){_0x4e170e=_0x4e170e-0x0;var _0x338291=_0x687f[_0x4e170e];return _0x338291;};'use strict';var multer=require(_0xf687('0x0'));var util=require(_0xf687('0x1'));var path=require(_0xf687('0x2'));var timeout=require('connect-timeout');var express=require(_0xf687('0x3'));var router=express[_0xf687('0x4')]();var fs_extra=require(_0xf687('0x5'));var auth=require(_0xf687('0x6'));var interaction=require(_0xf687('0x7'));var config=require(_0xf687('0x8'));var controller=require(_0xf687('0x9'));router[_0xf687('0xa')]('/',auth[_0xf687('0xb')](),controller['index']);router[_0xf687('0xa')](_0xf687('0xc'),auth[_0xf687('0xb')](),controller[_0xf687('0xd')]);router[_0xf687('0xa')]('/:id',auth[_0xf687('0xb')](),controller[_0xf687('0xe')]);router['get'](_0xf687('0xf'),auth[_0xf687('0xb')](),controller['getTags']);router[_0xf687('0xa')]('/:id/hoppers',auth[_0xf687('0xb')](),controller[_0xf687('0x10')]);router[_0xf687('0xa')](_0xf687('0x11'),auth[_0xf687('0xb')](),controller['getHopperHistories']);router[_0xf687('0xa')]('/:id/hopper_finals',auth[_0xf687('0xb')](),controller[_0xf687('0x12')]);router[_0xf687('0xa')](_0xf687('0x13'),auth[_0xf687('0xb')](),controller[_0xf687('0x14')]);router[_0xf687('0xa')]('/:id/journey',auth[_0xf687('0xb')](),controller[_0xf687('0x15')]);router[_0xf687('0x16')](_0xf687('0x17'),auth[_0xf687('0xb')](),controller[_0xf687('0x18')]);router[_0xf687('0x16')]('/',auth[_0xf687('0xb')](),controller[_0xf687('0x19')]);router['post'](_0xf687('0x1a'),auth[_0xf687('0xb')](),controller[_0xf687('0x1b')]);router[_0xf687('0x16')](_0xf687('0xf'),auth['isAuthenticated'](),controller[_0xf687('0x1c')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xc53824,_0x2506a8,_0x18e1a1){_0x18e1a1(null,path[_0xf687('0x1d')](config[_0xf687('0x1e')],_0xf687('0x1f')));},'filename':function(_0x4d0408,_0xd5282c,_0xc8986b){_0xd5282c['originalname']=_0xd5282c[_0xf687('0x20')][_0xf687('0x21')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0xc8986b(null,util['format'](_0xf687('0x22'),path[_0xf687('0x23')](_0xd5282c[_0xf687('0x20')],path[_0xf687('0x24')](_0xd5282c['originalname'])),Date[_0xf687('0x25')](),path[_0xf687('0x24')](_0xd5282c[_0xf687('0x20')])));}})});router['post'](_0xf687('0x26'),upload[_0xf687('0x27')](_0xf687('0x28')),controller[_0xf687('0x29')]);var upload=multer({'storage':multer[_0xf687('0x2a')]({'destination':function(_0x58017c,_0x399bec,_0x35df2e){_0x35df2e(null,path['join'](config[_0xf687('0x1e')],_0xf687('0x1f')));},'filename':function(_0x2ad272,_0x4f11ef,_0x5266b3){_0x4f11ef[_0xf687('0x20')]=_0x4f11ef[_0xf687('0x20')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x5266b3(null,util[_0xf687('0x2b')]('%s-%s%s',path['basename'](_0x4f11ef[_0xf687('0x20')],path[_0xf687('0x24')](_0x4f11ef[_0xf687('0x20')])),Date[_0xf687('0x25')](),path['extname'](_0x4f11ef[_0xf687('0x20')])));}})});router[_0xf687('0x16')](_0xf687('0x2c'),upload[_0xf687('0x27')](_0xf687('0x28')),controller['upload']);router['post']('/upload/:id',auth[_0xf687('0xb')](),controller[_0xf687('0x2d')]);router[_0xf687('0x2e')](_0xf687('0x2f'),auth[_0xf687('0xb')](),controller['update']);router[_0xf687('0x30')](_0xf687('0x2f'),auth[_0xf687('0xb')](),controller[_0xf687('0x31')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index af99dcc..eb60d92 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 _0x31e4=['VIRTUAL','getDataValue','alias','STRING','setDataValue','TEXT','long','type','select','parse','values','BOOLEAN','ENUM','voice','sequelize','lodash','exports'];(function(_0x573c95,_0x387fda){var _0x42fed6=function(_0x385fc6){while(--_0x385fc6){_0x573c95['push'](_0x573c95['shift']());}};_0x42fed6(++_0x387fda);}(_0x31e4,0x74));var _0x431e=function(_0x2aaa60,_0x22258f){_0x2aaa60=_0x2aaa60-0x0;var _0x2e3fa5=_0x31e4[_0x2aaa60];return _0x2e3fa5;};'use strict';var Sequelize=require(_0x431e('0x0'));var _=require(_0x431e('0x1'));module[_0x431e('0x2')]={'name':{'type':Sequelize[_0x431e('0x3')],'get':function(_0x39c0ee){return this[_0x431e('0x4')](_0x431e('0x5'));}},'alias':{'type':Sequelize[_0x431e('0x6')],'allowNull':![],'set':function(_0x5cdaa5){this[_0x431e('0x7')](_0x431e('0x5'),_0x5cdaa5?_0x5cdaa5:this[_0x431e('0x4')]('name'));}},'type':{'type':Sequelize[_0x431e('0x6')],'allowNull':![]},'values':{'type':Sequelize[_0x431e('0x8')](_0x431e('0x9')),'get':function(){if(this[_0x431e('0x4')](_0x431e('0xa'))===_0x431e('0xb')){return JSON[_0x431e('0xc')](this[_0x431e('0x4')]('values'));}else{return this['getDataValue'](_0x431e('0xd'));}},'set':function(_0x5a6a57){if(Array['isArray'](_0x5a6a57)){this[_0x431e('0x7')]('values',JSON['stringify'](_0x5a6a57));}else{this['setDataValue'](_0x431e('0xd'),_0x5a6a57);}}},'required':{'type':Sequelize[_0x431e('0xe')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x431e('0xe')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x431e('0xf')](_0x431e('0x10'))}}; \ No newline at end of file +var _0x00ed=['alias','STRING','setDataValue','name','long','type','select','values','getDataValue','isArray','stringify','BOOLEAN','ENUM','sequelize','lodash','VIRTUAL'];(function(_0x5c6f53,_0x5f08f6){var _0x4b9fff=function(_0x34595f){while(--_0x34595f){_0x5c6f53['push'](_0x5c6f53['shift']());}};_0x4b9fff(++_0x5f08f6);}(_0x00ed,0x17d));var _0xd00e=function(_0x578b94,_0x4bcd37){_0x578b94=_0x578b94-0x0;var _0x2f670a=_0x00ed[_0x578b94];return _0x2f670a;};'use strict';var Sequelize=require(_0xd00e('0x0'));var _=require(_0xd00e('0x1'));module['exports']={'name':{'type':Sequelize[_0xd00e('0x2')],'get':function(_0x1d7a71){return this['getDataValue'](_0xd00e('0x3'));}},'alias':{'type':Sequelize[_0xd00e('0x4')],'allowNull':![],'set':function(_0x90de0a){this[_0xd00e('0x5')](_0xd00e('0x3'),_0x90de0a?_0x90de0a:this['getDataValue'](_0xd00e('0x6')));}},'type':{'type':Sequelize['STRING'],'allowNull':![]},'values':{'type':Sequelize['TEXT'](_0xd00e('0x7')),'get':function(){if(this['getDataValue'](_0xd00e('0x8'))===_0xd00e('0x9')){return JSON['parse'](this['getDataValue'](_0xd00e('0xa')));}else{return this[_0xd00e('0xb')](_0xd00e('0xa'));}},'set':function(_0x196287){if(Array[_0xd00e('0xc')](_0x196287)){this['setDataValue'](_0xd00e('0xa'),JSON[_0xd00e('0xd')](_0x196287));}else{this[_0xd00e('0x5')](_0xd00e('0xa'),_0x196287);}}},'required':{'type':Sequelize[_0xd00e('0xe')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0xd00e('0xe')],'defaultValue':![]},'actionType':{'type':Sequelize[_0xd00e('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 6c6fa98..255cb00 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 _0x869e=['sendStatus','error','name','send','index','map','CmCustomField','type','key','model','differenceBy','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','keys','rawAttributes','find','body','create','sequelize','transaction','Sequelize','TEXT','text','number','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','format','cf_%d','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','Content-Range','reject','then','destroy'];(function(_0x5226fa,_0x3b36c7){var _0x2db4f3=function(_0x3c66cc){while(--_0x3c66cc){_0x5226fa['push'](_0x5226fa['shift']());}};_0x2db4f3(++_0x3b36c7);}(_0x869e,0x8d));var _0xe869=function(_0x3975b5,_0x2bf6de){_0x3975b5=_0x3975b5-0x0;var _0x16b5d5=_0x869e[_0x3975b5];return _0x16b5d5;};'use strict';var emlformat=require(_0xe869('0x0'));var rimraf=require(_0xe869('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xe869('0x2'));var moment=require(_0xe869('0x3'));var BPromise=require(_0xe869('0x4'));var Mustache=require(_0xe869('0x5'));var util=require(_0xe869('0x6'));var path=require(_0xe869('0x7'));var sox=require(_0xe869('0x8'));var csv=require(_0xe869('0x9'));var ejs=require(_0xe869('0xa'));var fs=require('fs');var fs_extra=require(_0xe869('0xb'));var _=require(_0xe869('0xc'));var squel=require(_0xe869('0xd'));var crypto=require(_0xe869('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xe869('0xf'));var toCsv=require(_0xe869('0x9'));var querystring=require(_0xe869('0x10'));var Papa=require(_0xe869('0x11'));var Redis=require(_0xe869('0x12'));var authService=require(_0xe869('0x13'));var qs=require(_0xe869('0x14'));var as=require(_0xe869('0x15'));var hardwareService=require(_0xe869('0x16'));var logger=require(_0xe869('0x17'))(_0xe869('0x18'));var utils=require(_0xe869('0x19'));var config=require(_0xe869('0x1a'));var licenseUtil=require(_0xe869('0x1b'));var db=require(_0xe869('0x1c'))['db'];function respondWithStatusCode(_0x2d9c9a,_0x159dbc){_0x159dbc=_0x159dbc||0xcc;return function(_0x550a19){if(_0x550a19){return _0x2d9c9a['sendStatus'](_0x159dbc);}return _0x2d9c9a[_0xe869('0x1d')](_0x159dbc)[_0xe869('0x1e')]();};}function respondWithResult(_0x65c291,_0x16e0d1){_0x16e0d1=_0x16e0d1||0xc8;return function(_0x2f2801){if(_0x2f2801){return _0x65c291[_0xe869('0x1d')](_0x16e0d1)['json'](_0x2f2801);}};}function respondWithFilteredResult(_0x7c9b11,_0x59ff29){return function(_0x3faf7c){if(_0x3faf7c){var _0x15ceb6=typeof _0x59ff29[_0xe869('0x1f')]===_0xe869('0x20')&&typeof _0x59ff29[_0xe869('0x21')]===_0xe869('0x20');var _0x2a9286=_0x3faf7c[_0xe869('0x22')];var _0x57e772=_0x15ceb6?0x0:_0x59ff29[_0xe869('0x1f')];var _0xd363cd=_0x15ceb6?_0x3faf7c[_0xe869('0x22')]:_0x59ff29[_0xe869('0x1f')]+_0x59ff29[_0xe869('0x21')];var _0x59b31b;if(_0xd363cd>=_0x2a9286){_0xd363cd=_0x2a9286;_0x59b31b=0xc8;}else{_0x59b31b=0xce;}_0x7c9b11[_0xe869('0x1d')](_0x59b31b);return _0x7c9b11['set'](_0xe869('0x23'),_0x57e772+'-'+_0xd363cd+'/'+_0x2a9286)['json'](_0x3faf7c);}return null;};}function patchUpdates(_0x2a1061){return function(_0x227233){try{jsonpatch['apply'](_0x227233,_0x2a1061,!![]);}catch(_0x4f1d1c){return BPromise[_0xe869('0x24')](_0x4f1d1c);}return _0x227233['save']();};}function saveUpdates(_0x36ae6c,_0x56414a){return function(_0x1f73b5){if(_0x1f73b5){return _0x1f73b5['update'](_0x36ae6c)[_0xe869('0x25')](function(_0x2e0de7){return _0x2e0de7;});}return null;};}function removeEntity(_0x4374ff,_0x3ffa44){return function(_0x5ac741){if(_0x5ac741){return _0x5ac741[_0xe869('0x26')]()[_0xe869('0x25')](function(){_0x4374ff[_0xe869('0x1d')](0xcc)[_0xe869('0x1e')]();});}};}function handleEntityNotFound(_0x2b975a,_0x5795c0){return function(_0x1f5f6f){if(!_0x1f5f6f){_0x2b975a[_0xe869('0x27')](0x194);}return _0x1f5f6f;};}function handleError(_0x2b6993,_0x3bbdf8){_0x3bbdf8=_0x3bbdf8||0x1f4;return function(_0x2a01f5){logger[_0xe869('0x28')](_0x2a01f5['stack']);if(_0x2a01f5[_0xe869('0x29')]){delete _0x2a01f5[_0xe869('0x29')];}_0x2b6993['status'](_0x3bbdf8)[_0xe869('0x2a')](_0x2a01f5);};}exports[_0xe869('0x2b')]=function(_0x44ff31,_0x24b6ef){var _0x591d5b={},_0x302256={},_0x48cbaa={'count':0x0,'rows':[]};var _0x3731de=_[_0xe869('0x2c')](db[_0xe869('0x2d')]['rawAttributes'],function(_0x420901){return{'name':_0x420901['fieldName'],'type':_0x420901[_0xe869('0x2e')][_0xe869('0x2f')]};});_0x302256[_0xe869('0x30')]=_[_0xe869('0x31')](_[_0xe869('0x2c')](_0x3731de,_0xe869('0x29')),[_0xe869('0x29')]);_0x302256[_0xe869('0x32')]=_['keys'](_0x44ff31[_0xe869('0x32')]);_0x302256[_0xe869('0x33')]=_[_0xe869('0x34')](_0x302256[_0xe869('0x30')],_0x302256[_0xe869('0x32')]);_0x591d5b[_0xe869('0x35')]=_[_0xe869('0x34')](_0x302256[_0xe869('0x30')],qs[_0xe869('0x36')](_0x44ff31[_0xe869('0x32')][_0xe869('0x36')]));_0x591d5b[_0xe869('0x35')]=_0x591d5b[_0xe869('0x35')][_0xe869('0x37')]?_0x591d5b[_0xe869('0x35')]:_0x302256[_0xe869('0x30')];if(!_0x44ff31[_0xe869('0x32')][_0xe869('0x38')](_0xe869('0x39'))){_0x591d5b[_0xe869('0x21')]=qs[_0xe869('0x21')](_0x44ff31[_0xe869('0x32')][_0xe869('0x21')]);_0x591d5b[_0xe869('0x1f')]=qs['offset'](_0x44ff31[_0xe869('0x32')][_0xe869('0x1f')]);}_0x591d5b['order']=qs[_0xe869('0x3a')](_0x44ff31[_0xe869('0x32')][_0xe869('0x3a')]);_0x591d5b['where']=qs[_0xe869('0x33')](_['pick'](_0x44ff31[_0xe869('0x32')],_0x302256[_0xe869('0x33')]),_0x3731de);if(_0x44ff31[_0xe869('0x32')][_0xe869('0x3b')]){_0x591d5b[_0xe869('0x3c')]=_['merge'](_0x591d5b[_0xe869('0x3c')],{'$or':_[_0xe869('0x2c')](_0x3731de,function(_0x26663c){if(_0x26663c[_0xe869('0x2e')]!==_0xe869('0x3d')){var _0x5cc8af={};_0x5cc8af[_0x26663c[_0xe869('0x29')]]={'$like':'%'+_0x44ff31[_0xe869('0x32')][_0xe869('0x3b')]+'%'};return _0x5cc8af;}})});}_0x591d5b=_[_0xe869('0x3e')]({},_0x591d5b,_0x44ff31[_0xe869('0x3f')]);var _0x3a60a0={'where':_0x591d5b[_0xe869('0x3c')]};return db['CmCustomField']['count'](_0x3a60a0)[_0xe869('0x25')](function(_0x21814f){_0x48cbaa[_0xe869('0x22')]=_0x21814f;if(_0x44ff31[_0xe869('0x32')][_0xe869('0x40')]){_0x591d5b[_0xe869('0x41')]=[{'all':!![]}];}return db[_0xe869('0x2d')][_0xe869('0x42')](_0x591d5b);})[_0xe869('0x25')](function(_0x42566c){_0x48cbaa['rows']=_0x42566c;return _0x48cbaa;})[_0xe869('0x25')](respondWithFilteredResult(_0x24b6ef,_0x591d5b))[_0xe869('0x43')](handleError(_0x24b6ef,null));};exports[_0xe869('0x44')]=function(_0x59d87c,_0x16be4a){var _0x4734a3={'raw':!![],'where':{'id':_0x59d87c[_0xe869('0x45')]['id']}},_0x5c2421={};_0x5c2421[_0xe869('0x30')]=_[_0xe869('0x46')](db['CmCustomField'][_0xe869('0x47')]);_0x5c2421['query']=_[_0xe869('0x46')](_0x59d87c['query']);_0x5c2421[_0xe869('0x33')]=_[_0xe869('0x34')](_0x5c2421[_0xe869('0x30')],_0x5c2421['query']);_0x4734a3[_0xe869('0x35')]=_[_0xe869('0x34')](_0x5c2421[_0xe869('0x30')],qs['fields'](_0x59d87c[_0xe869('0x32')][_0xe869('0x36')]));_0x4734a3['attributes']=_0x4734a3[_0xe869('0x35')][_0xe869('0x37')]?_0x4734a3[_0xe869('0x35')]:_0x5c2421[_0xe869('0x30')];if(_0x59d87c[_0xe869('0x32')]['includeAll']){_0x4734a3[_0xe869('0x41')]=[{'all':!![]}];}_0x4734a3=_[_0xe869('0x3e')]({},_0x4734a3,_0x59d87c[_0xe869('0x3f')]);return db[_0xe869('0x2d')][_0xe869('0x48')](_0x4734a3)[_0xe869('0x25')](handleEntityNotFound(_0x16be4a,null))[_0xe869('0x25')](respondWithResult(_0x16be4a,null))['catch'](handleError(_0x16be4a,null));};exports['update']=function(_0x14fbec,_0x37c35c){if(_0x14fbec['body']['id']){delete _0x14fbec[_0xe869('0x49')]['id'];}return db[_0xe869('0x2d')][_0xe869('0x48')]({'where':{'id':_0x14fbec[_0xe869('0x45')]['id']}})['then'](handleEntityNotFound(_0x37c35c,null))['then'](saveUpdates(_0x14fbec['body'],null))[_0xe869('0x25')](respondWithResult(_0x37c35c,null))[_0xe869('0x43')](handleError(_0x37c35c,null));};exports[_0xe869('0x26')]=function(_0x16de37,_0x473f28){return db[_0xe869('0x2d')][_0xe869('0x48')]({'where':{'id':_0x16de37['params']['id']}})[_0xe869('0x25')](handleEntityNotFound(_0x473f28,null))[_0xe869('0x25')](removeEntity(_0x473f28,null))[_0xe869('0x43')](handleError(_0x473f28,null));};exports[_0xe869('0x4a')]=function(_0x580494,_0x5de35f){var _0x43e8dd;return db[_0xe869('0x4b')][_0xe869('0x4c')](function(_0xb34c5d){return db[_0xe869('0x2d')][_0xe869('0x4a')](_0x580494[_0xe869('0x49')],{'transaction':_0xb34c5d})['then'](function(_0x31ddf6){_0x43e8dd=_0x31ddf6;var _0x2b4fd9={'type':db[_0xe869('0x4d')][_0xe869('0x4e')],'transaction':_0xb34c5d};switch(_0x580494[_0xe869('0x49')][_0xe869('0x2e')]){case _0xe869('0x4f'):_0x2b4fd9[_0xe869('0x2e')]=db[_0xe869('0x4d')][_0xe869('0x4e')];break;case _0xe869('0x50'):_0x2b4fd9[_0xe869('0x2e')]=db[_0xe869('0x4d')][_0xe869('0x51')];break;case _0xe869('0x52'):_0x2b4fd9[_0xe869('0x2e')]=db[_0xe869('0x4d')][_0xe869('0x53')];_0x2b4fd9[_0xe869('0x54')]=![];break;default:}return db[_0xe869('0x4b')][_0xe869('0x55')][_0xe869('0x56')](_0xe869('0x57'),util[_0xe869('0x58')](_0xe869('0x59'),_0x43e8dd['id']),_0x2b4fd9);})['then'](function(){return _0x43e8dd;});})[_0xe869('0x25')](respondWithResult(_0x5de35f,0xc9))[_0xe869('0x43')](handleError(_0x5de35f,null));}; \ No newline at end of file +var _0xa5d1=['sox','to-csv','fs-extra','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','sendStatus','status','end','limit','offset','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','CmCustomField','includeAll','include','rows','catch','show','params','rawAttributes','find','body','create','transaction','Sequelize','TEXT','INTEGER','defaultValue','sequelize','cm_contacts','format','cf_%d','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util'];(function(_0x4105c5,_0x63f0af){var _0x5cfb55=function(_0x7ba13b){while(--_0x7ba13b){_0x4105c5['push'](_0x4105c5['shift']());}};_0x5cfb55(++_0x63f0af);}(_0xa5d1,0xfd));var _0x1a5d=function(_0x32c171,_0x5b06d7){_0x32c171=_0x32c171-0x0;var _0xe37209=_0xa5d1[_0x32c171];return _0xe37209;};'use strict';var emlformat=require(_0x1a5d('0x0'));var rimraf=require(_0x1a5d('0x1'));var zipdir=require(_0x1a5d('0x2'));var jsonpatch=require(_0x1a5d('0x3'));var rp=require(_0x1a5d('0x4'));var moment=require(_0x1a5d('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x1a5d('0x6'));var util=require(_0x1a5d('0x7'));var path=require('path');var sox=require(_0x1a5d('0x8'));var csv=require(_0x1a5d('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1a5d('0xa'));var _=require('lodash');var squel=require(_0x1a5d('0xb'));var crypto=require(_0x1a5d('0xc'));var jsforce=require(_0x1a5d('0xd'));var deskjs=require(_0x1a5d('0xe'));var toCsv=require('to-csv');var querystring=require(_0x1a5d('0xf'));var Papa=require(_0x1a5d('0x10'));var Redis=require(_0x1a5d('0x11'));var authService=require(_0x1a5d('0x12'));var qs=require(_0x1a5d('0x13'));var as=require(_0x1a5d('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1a5d('0x15'))(_0x1a5d('0x16'));var utils=require(_0x1a5d('0x17'));var config=require(_0x1a5d('0x18'));var licenseUtil=require(_0x1a5d('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x250500,_0x12f8ec){_0x12f8ec=_0x12f8ec||0xcc;return function(_0x1d431c){if(_0x1d431c){return _0x250500[_0x1a5d('0x1a')](_0x12f8ec);}return _0x250500[_0x1a5d('0x1b')](_0x12f8ec)[_0x1a5d('0x1c')]();};}function respondWithResult(_0x4e5810,_0x5d585e){_0x5d585e=_0x5d585e||0xc8;return function(_0x3f698d){if(_0x3f698d){return _0x4e5810['status'](_0x5d585e)['json'](_0x3f698d);}};}function respondWithFilteredResult(_0x1e01c5,_0x5906bf){return function(_0x5c8473){if(_0x5c8473){var _0x2e1dea=typeof _0x5906bf['offset']==='undefined'&&typeof _0x5906bf[_0x1a5d('0x1d')]==='undefined';var _0x2387dc=_0x5c8473['count'];var _0x292cc3=_0x2e1dea?0x0:_0x5906bf[_0x1a5d('0x1e')];var _0x1dc572=_0x2e1dea?_0x5c8473[_0x1a5d('0x1f')]:_0x5906bf[_0x1a5d('0x1e')]+_0x5906bf[_0x1a5d('0x1d')];var _0xededc0;if(_0x1dc572>=_0x2387dc){_0x1dc572=_0x2387dc;_0xededc0=0xc8;}else{_0xededc0=0xce;}_0x1e01c5[_0x1a5d('0x1b')](_0xededc0);return _0x1e01c5[_0x1a5d('0x20')](_0x1a5d('0x21'),_0x292cc3+'-'+_0x1dc572+'/'+_0x2387dc)[_0x1a5d('0x22')](_0x5c8473);}return null;};}function patchUpdates(_0xb63f95){return function(_0x16d67e){try{jsonpatch[_0x1a5d('0x23')](_0x16d67e,_0xb63f95,!![]);}catch(_0x5a3c8c){return BPromise[_0x1a5d('0x24')](_0x5a3c8c);}return _0x16d67e[_0x1a5d('0x25')]();};}function saveUpdates(_0x3ef090,_0x33e13f){return function(_0xdf478f){if(_0xdf478f){return _0xdf478f[_0x1a5d('0x26')](_0x3ef090)[_0x1a5d('0x27')](function(_0x45f7a2){return _0x45f7a2;});}return null;};}function removeEntity(_0x1e0192,_0x4df58c){return function(_0x14730c){if(_0x14730c){return _0x14730c[_0x1a5d('0x28')]()[_0x1a5d('0x27')](function(){_0x1e0192[_0x1a5d('0x1b')](0xcc)[_0x1a5d('0x1c')]();});}};}function handleEntityNotFound(_0x15fb1e,_0x30fa77){return function(_0x4a927b){if(!_0x4a927b){_0x15fb1e[_0x1a5d('0x1a')](0x194);}return _0x4a927b;};}function handleError(_0x50493c,_0x5b922f){_0x5b922f=_0x5b922f||0x1f4;return function(_0x1d80c6){logger[_0x1a5d('0x29')](_0x1d80c6[_0x1a5d('0x2a')]);if(_0x1d80c6[_0x1a5d('0x2b')]){delete _0x1d80c6[_0x1a5d('0x2b')];}_0x50493c[_0x1a5d('0x1b')](_0x5b922f)[_0x1a5d('0x2c')](_0x1d80c6);};}exports[_0x1a5d('0x2d')]=function(_0x5c890,_0x55716c){var _0x48886c={},_0x16cb75={},_0x4658e6={'count':0x0,'rows':[]};var _0x1d839f=_[_0x1a5d('0x2e')](db['CmCustomField']['rawAttributes'],function(_0x543846){return{'name':_0x543846[_0x1a5d('0x2f')],'type':_0x543846[_0x1a5d('0x30')][_0x1a5d('0x31')]};});_0x16cb75[_0x1a5d('0x32')]=_['differenceBy'](_[_0x1a5d('0x2e')](_0x1d839f,_0x1a5d('0x2b')),[_0x1a5d('0x2b')]);_0x16cb75[_0x1a5d('0x33')]=_[_0x1a5d('0x34')](_0x5c890[_0x1a5d('0x33')]);_0x16cb75[_0x1a5d('0x35')]=_[_0x1a5d('0x36')](_0x16cb75[_0x1a5d('0x32')],_0x16cb75[_0x1a5d('0x33')]);_0x48886c[_0x1a5d('0x37')]=_[_0x1a5d('0x36')](_0x16cb75[_0x1a5d('0x32')],qs[_0x1a5d('0x38')](_0x5c890[_0x1a5d('0x33')][_0x1a5d('0x38')]));_0x48886c[_0x1a5d('0x37')]=_0x48886c[_0x1a5d('0x37')][_0x1a5d('0x39')]?_0x48886c['attributes']:_0x16cb75['model'];if(!_0x5c890['query'][_0x1a5d('0x3a')]('nolimit')){_0x48886c[_0x1a5d('0x1d')]=qs[_0x1a5d('0x1d')](_0x5c890[_0x1a5d('0x33')]['limit']);_0x48886c[_0x1a5d('0x1e')]=qs[_0x1a5d('0x1e')](_0x5c890['query'][_0x1a5d('0x1e')]);}_0x48886c[_0x1a5d('0x3b')]=qs[_0x1a5d('0x3c')](_0x5c890[_0x1a5d('0x33')][_0x1a5d('0x3c')]);_0x48886c[_0x1a5d('0x3d')]=qs['filters'](_[_0x1a5d('0x3e')](_0x5c890[_0x1a5d('0x33')],_0x16cb75[_0x1a5d('0x35')]),_0x1d839f);if(_0x5c890[_0x1a5d('0x33')]['filter']){_0x48886c[_0x1a5d('0x3d')]=_[_0x1a5d('0x3f')](_0x48886c[_0x1a5d('0x3d')],{'$or':_[_0x1a5d('0x2e')](_0x1d839f,function(_0x340893){if(_0x340893[_0x1a5d('0x30')]!==_0x1a5d('0x40')){var _0x1c04f7={};_0x1c04f7[_0x340893[_0x1a5d('0x2b')]]={'$like':'%'+_0x5c890[_0x1a5d('0x33')][_0x1a5d('0x41')]+'%'};return _0x1c04f7;}})});}_0x48886c=_[_0x1a5d('0x3f')]({},_0x48886c,_0x5c890[_0x1a5d('0x42')]);var _0x1e13e3={'where':_0x48886c[_0x1a5d('0x3d')]};return db[_0x1a5d('0x43')][_0x1a5d('0x1f')](_0x1e13e3)[_0x1a5d('0x27')](function(_0xfc09c8){_0x4658e6[_0x1a5d('0x1f')]=_0xfc09c8;if(_0x5c890['query'][_0x1a5d('0x44')]){_0x48886c[_0x1a5d('0x45')]=[{'all':!![]}];}return db['CmCustomField']['findAll'](_0x48886c);})['then'](function(_0x36934a){_0x4658e6[_0x1a5d('0x46')]=_0x36934a;return _0x4658e6;})[_0x1a5d('0x27')](respondWithFilteredResult(_0x55716c,_0x48886c))[_0x1a5d('0x47')](handleError(_0x55716c,null));};exports[_0x1a5d('0x48')]=function(_0x32d031,_0x38e8a4){var _0x49f9ef={'raw':!![],'where':{'id':_0x32d031[_0x1a5d('0x49')]['id']}},_0x21e586={};_0x21e586['model']=_[_0x1a5d('0x34')](db['CmCustomField'][_0x1a5d('0x4a')]);_0x21e586[_0x1a5d('0x33')]=_[_0x1a5d('0x34')](_0x32d031[_0x1a5d('0x33')]);_0x21e586[_0x1a5d('0x35')]=_[_0x1a5d('0x36')](_0x21e586[_0x1a5d('0x32')],_0x21e586[_0x1a5d('0x33')]);_0x49f9ef[_0x1a5d('0x37')]=_[_0x1a5d('0x36')](_0x21e586['model'],qs['fields'](_0x32d031['query'][_0x1a5d('0x38')]));_0x49f9ef[_0x1a5d('0x37')]=_0x49f9ef[_0x1a5d('0x37')]['length']?_0x49f9ef['attributes']:_0x21e586[_0x1a5d('0x32')];if(_0x32d031[_0x1a5d('0x33')][_0x1a5d('0x44')]){_0x49f9ef[_0x1a5d('0x45')]=[{'all':!![]}];}_0x49f9ef=_[_0x1a5d('0x3f')]({},_0x49f9ef,_0x32d031[_0x1a5d('0x42')]);return db[_0x1a5d('0x43')][_0x1a5d('0x4b')](_0x49f9ef)[_0x1a5d('0x27')](handleEntityNotFound(_0x38e8a4,null))[_0x1a5d('0x27')](respondWithResult(_0x38e8a4,null))[_0x1a5d('0x47')](handleError(_0x38e8a4,null));};exports[_0x1a5d('0x26')]=function(_0x3ec613,_0x264867){if(_0x3ec613[_0x1a5d('0x4c')]['id']){delete _0x3ec613[_0x1a5d('0x4c')]['id'];}return db[_0x1a5d('0x43')]['find']({'where':{'id':_0x3ec613['params']['id']}})[_0x1a5d('0x27')](handleEntityNotFound(_0x264867,null))['then'](saveUpdates(_0x3ec613[_0x1a5d('0x4c')],null))[_0x1a5d('0x27')](respondWithResult(_0x264867,null))[_0x1a5d('0x47')](handleError(_0x264867,null));};exports[_0x1a5d('0x28')]=function(_0x39b24c,_0x196acb){return db[_0x1a5d('0x43')][_0x1a5d('0x4b')]({'where':{'id':_0x39b24c[_0x1a5d('0x49')]['id']}})[_0x1a5d('0x27')](handleEntityNotFound(_0x196acb,null))[_0x1a5d('0x27')](removeEntity(_0x196acb,null))[_0x1a5d('0x47')](handleError(_0x196acb,null));};exports[_0x1a5d('0x4d')]=function(_0x49fb00,_0x1f5891){var _0x1fea06;return db['sequelize'][_0x1a5d('0x4e')](function(_0x1040cb){return db[_0x1a5d('0x43')]['create'](_0x49fb00['body'],{'transaction':_0x1040cb})['then'](function(_0x4a25ae){_0x1fea06=_0x4a25ae;var _0x4e8ed8={'type':db[_0x1a5d('0x4f')][_0x1a5d('0x50')],'transaction':_0x1040cb};switch(_0x49fb00[_0x1a5d('0x4c')][_0x1a5d('0x30')]){case'text':_0x4e8ed8[_0x1a5d('0x30')]=db[_0x1a5d('0x4f')]['TEXT'];break;case'number':_0x4e8ed8['type']=db[_0x1a5d('0x4f')][_0x1a5d('0x51')];break;case'switch':_0x4e8ed8[_0x1a5d('0x30')]=db[_0x1a5d('0x4f')]['BOOLEAN'];_0x4e8ed8[_0x1a5d('0x52')]=![];break;default:}return db[_0x1a5d('0x53')]['queryInterface']['addColumn'](_0x1a5d('0x54'),util[_0x1a5d('0x55')](_0x1a5d('0x56'),_0x1fea06['id']),_0x4e8ed8);})['then'](function(){return _0x1fea06;});})['then'](respondWithResult(_0x1f5891,0xc9))[_0x1a5d('0x47')](handleError(_0x1f5891,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index 675b5c0..ad89e92 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 _0x0e08=['moment','bluebird','request-promise','path','rimraf','./cmCustomField.attributes','exports','define','CmCustomField','cm_custom_fields','lodash','../../config/logger','api'];(function(_0x51ea08,_0x361b2e){var _0x9bcf8e=function(_0xcf31a7){while(--_0xcf31a7){_0x51ea08['push'](_0x51ea08['shift']());}};_0x9bcf8e(++_0x361b2e);}(_0x0e08,0x1aa));var _0x80e0=function(_0x2d4ebc,_0x21099){_0x2d4ebc=_0x2d4ebc-0x0;var _0x496939=_0x0e08[_0x2d4ebc];return _0x496939;};'use strict';var _=require(_0x80e0('0x0'));var util=require('util');var logger=require(_0x80e0('0x1'))(_0x80e0('0x2'));var moment=require(_0x80e0('0x3'));var BPromise=require(_0x80e0('0x4'));var rp=require(_0x80e0('0x5'));var fs=require('fs');var path=require(_0x80e0('0x6'));var rimraf=require(_0x80e0('0x7'));var config=require('../../config/environment');var attributes=require(_0x80e0('0x8'));module[_0x80e0('0x9')]=function(_0x1acdbf,_0xf0ae08){return _0x1acdbf[_0x80e0('0xa')](_0x80e0('0xb'),attributes,{'tableName':_0x80e0('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0ca9=['../../config/logger','api','bluebird','path','rimraf','../../config/environment','./cmCustomField.attributes','exports','define','cm_custom_fields','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0ca9,0x18a));var _0x90ca=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0ca9[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x90ca('0x0'));var util=require(_0x90ca('0x1'));var logger=require(_0x90ca('0x2'))(_0x90ca('0x3'));var moment=require('moment');var BPromise=require(_0x90ca('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x90ca('0x5'));var rimraf=require(_0x90ca('0x6'));var config=require(_0x90ca('0x7'));var attributes=require(_0x90ca('0x8'));module[_0x90ca('0x9')]=function(_0xf518d2,_0xab1da5){return _0xf518d2[_0x90ca('0xa')]('CmCustomField',attributes,{'tableName':_0x90ca('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 5d3f809..f3155f9 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 _0x82e8=['util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','client','http','request','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','error','message','result'];(function(_0x59198b,_0x14663c){var _0x250e52=function(_0x49cdc7){while(--_0x49cdc7){_0x59198b['push'](_0x59198b['shift']());}};_0x250e52(++_0x14663c);}(_0x82e8,0xbe));var _0x882e=function(_0x57b432,_0x1589a0){_0x57b432=_0x57b432-0x0;var _0x2edf2a=_0x82e8[_0x57b432];return _0x2edf2a;};'use strict';var _=require('lodash');var util=require(_0x882e('0x0'));var moment=require(_0x882e('0x1'));var BPromise=require(_0x882e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x882e('0x3'));var db=require(_0x882e('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x882e('0x5'))(_0x882e('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x882e('0x7')][_0x882e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x15ac5c,_0xee5303,_0x4b90c4){return new BPromise(function(_0x2b3a6b,_0x24f668){return client[_0x882e('0x9')](_0x15ac5c,_0x4b90c4)[_0x882e('0xa')](function(_0x419add){logger[_0x882e('0xb')](_0x882e('0xc'),_0xee5303,_0x882e('0xd'));logger[_0x882e('0xe')](_0x882e('0xf'),_0xee5303,_0x882e('0xd'),JSON['stringify'](_0x419add));if(_0x419add[_0x882e('0x10')]){if(_0x419add[_0x882e('0x10')]['code']===0x1f4){logger[_0x882e('0x10')](_0x882e('0xc'),_0xee5303,_0x419add[_0x882e('0x10')][_0x882e('0x11')]);return _0x24f668(_0x419add[_0x882e('0x10')][_0x882e('0x11')]);}logger['error'](_0x882e('0xc'),_0xee5303,_0x419add['error'][_0x882e('0x11')]);return _0x2b3a6b(_0x419add[_0x882e('0x10')][_0x882e('0x11')]);}else{logger[_0x882e('0xb')]('CmCustomField,\x20%s,\x20%s',_0xee5303,'request\x20sent');_0x2b3a6b(_0x419add[_0x882e('0x12')][_0x882e('0x11')]);}})['catch'](function(_0x50d763){logger[_0x882e('0x10')](_0x882e('0xc'),_0xee5303,_0x50d763);_0x24f668(_0x50d763);});});} \ No newline at end of file +var _0xe3e6=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x5fc4f9,_0x75415d){var _0x3d82ab=function(_0x233903){while(--_0x233903){_0x5fc4f9['push'](_0x5fc4f9['shift']());}};_0x3d82ab(++_0x75415d);}(_0xe3e6,0x10f));var _0x6e3e=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xe3e6[_0x432682];return _0x463d05;};'use strict';var _=require('lodash');var util=require(_0x6e3e('0x0'));var moment=require(_0x6e3e('0x1'));var BPromise=require(_0x6e3e('0x2'));var rs=require(_0x6e3e('0x3'));var fs=require('fs');var Redis=require(_0x6e3e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6e3e('0x5'));var logger=require(_0x6e3e('0x6'))('rpc');var config=require(_0x6e3e('0x7'));var jayson=require(_0x6e3e('0x8'));var client=jayson[_0x6e3e('0x9')][_0x6e3e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x265fab,_0x3945bd,_0x54e127){return new BPromise(function(_0x296ced,_0x4141f0){return client[_0x6e3e('0xb')](_0x265fab,_0x54e127)['then'](function(_0x1f5b58){logger[_0x6e3e('0xc')](_0x6e3e('0xd'),_0x3945bd,_0x6e3e('0xe'));logger[_0x6e3e('0xf')](_0x6e3e('0x10'),_0x3945bd,'request\x20sent',JSON[_0x6e3e('0x11')](_0x1f5b58));if(_0x1f5b58['error']){if(_0x1f5b58[_0x6e3e('0x12')][_0x6e3e('0x13')]===0x1f4){logger[_0x6e3e('0x12')](_0x6e3e('0xd'),_0x3945bd,_0x1f5b58[_0x6e3e('0x12')][_0x6e3e('0x14')]);return _0x4141f0(_0x1f5b58[_0x6e3e('0x12')]['message']);}logger[_0x6e3e('0x12')](_0x6e3e('0xd'),_0x3945bd,_0x1f5b58[_0x6e3e('0x12')][_0x6e3e('0x14')]);return _0x296ced(_0x1f5b58['error'][_0x6e3e('0x14')]);}else{logger['info'](_0x6e3e('0xd'),_0x3945bd,_0x6e3e('0xe'));_0x296ced(_0x1f5b58[_0x6e3e('0x15')][_0x6e3e('0x14')]);}})[_0x6e3e('0x16')](function(_0xa2f710){logger[_0x6e3e('0x12')](_0x6e3e('0xd'),_0x3945bd,_0xa2f710);_0x4141f0(_0xa2f710);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 3e312c1..20ec4a1 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 _0x4693=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','isAuthenticated','get','/:id','post','put','update','delete','destroy','multer'];(function(_0x266779,_0x3d23e3){var _0x23db0e=function(_0xbd2ad6){while(--_0xbd2ad6){_0x266779['push'](_0x266779['shift']());}};_0x23db0e(++_0x3d23e3);}(_0x4693,0x18b));var _0x3469=function(_0x1dfa14,_0x82c01a){_0x1dfa14=_0x1dfa14-0x0;var _0x517b8d=_0x4693[_0x1dfa14];return _0x517b8d;};'use strict';var multer=require(_0x3469('0x0'));var util=require('util');var path=require(_0x3469('0x1'));var timeout=require(_0x3469('0x2'));var express=require(_0x3469('0x3'));var router=express[_0x3469('0x4')]();var fs_extra=require(_0x3469('0x5'));var auth=require(_0x3469('0x6'));var interaction=require(_0x3469('0x7'));var config=require(_0x3469('0x8'));var controller=require(_0x3469('0x9'));router['get']('/',auth[_0x3469('0xa')](),controller['index']);router[_0x3469('0xb')](_0x3469('0xc'),auth[_0x3469('0xa')](),controller['show']);router[_0x3469('0xd')]('/',auth[_0x3469('0xa')](),controller['create']);router[_0x3469('0xe')]('/:id',auth[_0x3469('0xa')](),controller[_0x3469('0xf')]);router[_0x3469('0x10')](_0x3469('0xc'),auth[_0x3469('0xa')](),controller[_0x3469('0x11')]);module['exports']=router; \ No newline at end of file +var _0x8813=['index','/:id','show','create','put','update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./cmCustomField.controller','get','isAuthenticated'];(function(_0x4e87f0,_0x5dbc5e){var _0x323eb5=function(_0x36af09){while(--_0x36af09){_0x4e87f0['push'](_0x4e87f0['shift']());}};_0x323eb5(++_0x5dbc5e);}(_0x8813,0x86));var _0x3881=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8813[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x3881('0x0'));var util=require('util');var path=require(_0x3881('0x1'));var timeout=require(_0x3881('0x2'));var express=require(_0x3881('0x3'));var router=express[_0x3881('0x4')]();var fs_extra=require(_0x3881('0x5'));var auth=require(_0x3881('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3881('0x7'));router[_0x3881('0x8')]('/',auth[_0x3881('0x9')](),controller[_0x3881('0xa')]);router[_0x3881('0x8')](_0x3881('0xb'),auth[_0x3881('0x9')](),controller[_0x3881('0xc')]);router['post']('/',auth[_0x3881('0x9')](),controller[_0x3881('0xd')]);router[_0x3881('0xe')](_0x3881('0xb'),auth[_0x3881('0x9')](),controller[_0x3881('0xf')]);router[_0x3881('0x10')](_0x3881('0xb'),auth[_0x3881('0x9')](),controller[_0x3881('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index 8ce8fab..b6a7bbd 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 _0xf134=['moment','exports','STRING','BOOLEAN','DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','contactListQueue'];(function(_0x52085a,_0x3717ca){var _0x5afc1a=function(_0x2aa175){while(--_0x2aa175){_0x52085a['push'](_0x52085a['shift']());}};_0x5afc1a(++_0x3717ca);}(_0xf134,0x13b));var _0x4f13=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0xf134[_0x5608a3];return _0x1ed50a;};'use strict';var moment=require(_0x4f13('0x0'));var Sequelize=require('sequelize');module[_0x4f13('0x1')]={'phone':{'type':Sequelize[_0x4f13('0x2')],'allowNull':![]},'active':{'type':Sequelize[_0x4f13('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x4f13('0x4')],'defaultValue':moment()[_0x4f13('0x5')](_0x4f13('0x6'))},'countbusyretry':{'type':Sequelize[_0x4f13('0x7')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x4f13('0x7')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x4f13('0x7')],'defaultValue':0x0},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x4f13('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x4f13('0x4')]},'priority':{'type':Sequelize[_0x4f13('0x7')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x4f13('0x3')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x4f13('0x7')],'unique':_0x4f13('0x8')},'ListId':{'type':Sequelize[_0x4f13('0x7')],'unique':_0x4f13('0x8')},'UserId':{'type':Sequelize[_0x4f13('0x7')]},'VoiceQueueId':{'type':Sequelize[_0x4f13('0x7')],'unique':_0x4f13('0x8')},'CampaignId':{'type':Sequelize[_0x4f13('0x7')]},'countnosuchnumberretry':{'type':Sequelize[_0x4f13('0x7')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x4f13('0x7')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x4f13('0x7')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x4f13('0x7')],'defaultValue':0x0}}; \ No newline at end of file +var _0xf801=['DATE','INTEGER','BOOLEAN','UNSIGNED','contactListQueue','moment','exports','STRING'];(function(_0x331639,_0x3ceeaa){var _0x5420ea=function(_0x175c36){while(--_0x175c36){_0x331639['push'](_0x331639['shift']());}};_0x5420ea(++_0x3ceeaa);}(_0xf801,0xc5));var _0x1f80=function(_0x466e89,_0x237ae3){_0x466e89=_0x466e89-0x0;var _0x580986=_0xf801[_0x466e89];return _0x580986;};'use strict';var moment=require(_0x1f80('0x0'));var Sequelize=require('sequelize');module[_0x1f80('0x1')]={'phone':{'type':Sequelize[_0x1f80('0x2')],'allowNull':![]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x1f80('0x3')],'defaultValue':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0x1f80('0x4')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x1f80('0x4')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x1f80('0x4')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x1f80('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x1f80('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x1f80('0x3')]},'priority':{'type':Sequelize[_0x1f80('0x4')](0x2)[_0x1f80('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0x1f80('0x4')],'unique':_0x1f80('0x7')},'UserId':{'type':Sequelize['INTEGER']},'VoiceQueueId':{'type':Sequelize[_0x1f80('0x4')],'unique':_0x1f80('0x7')},'CampaignId':{'type':Sequelize[_0x1f80('0x4')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x1f80('0x4')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x1f80('0x4')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x1f80('0x4')],'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 1292d3d..c7c2db0 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 _0xcec2=['rawAttributes','fieldName','key','model','keys','filters','query','concat','$and','$or','$lte','$ne','$not','$between','$notBetween','$in','$notIn','$like','$notLike','$iLike','$notILike','$contains','$contained','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','describe','destroy','VoiceQueueId','CampaignId','VoiceQueue','omit','dataValues','updatedAt','membername','UserId','user','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','queue','ivr','CmContact','lastName','isNil','firstName','CmHopperFinal','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','transaction','direction','prev','isEmpty','hopperIds','priority','ASC','scheduledAt','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','sequelize','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','LOCK','CmCompany','Company','List','dialActive','getOpenContacts','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','map','CmHopper'];(function(_0x37c22c,_0x28a70d){var _0x119d79=function(_0x243a13){while(--_0x243a13){_0x37c22c['push'](_0x37c22c['shift']());}};_0x119d79(++_0x28a70d);}(_0xcec2,0xed));var _0x2cec=function(_0x34fece,_0x17e9cf){_0x34fece=_0x34fece-0x0;var _0x2ca2e6=_0xcec2[_0x34fece];return _0x2ca2e6;};'use strict';var emlformat=require(_0x2cec('0x0'));var rimraf=require(_0x2cec('0x1'));var zipdir=require(_0x2cec('0x2'));var jsonpatch=require(_0x2cec('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2cec('0x4'));var Mustache=require('mustache');var util=require(_0x2cec('0x5'));var path=require(_0x2cec('0x6'));var sox=require(_0x2cec('0x7'));var csv=require('to-csv');var ejs=require(_0x2cec('0x8'));var fs=require('fs');var fs_extra=require(_0x2cec('0x9'));var _=require(_0x2cec('0xa'));var squel=require(_0x2cec('0xb'));var crypto=require(_0x2cec('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2cec('0xd'));var querystring=require('querystring');var Papa=require(_0x2cec('0xe'));var Redis=require(_0x2cec('0xf'));var authService=require(_0x2cec('0x10'));var qs=require(_0x2cec('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2cec('0x12'))(_0x2cec('0x13'));var utils=require('../../config/utils');var config=require(_0x2cec('0x14'));var licenseUtil=require(_0x2cec('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1915c2,_0x1422bf){_0x1422bf=_0x1422bf||0xcc;return function(_0x473ecb){if(_0x473ecb){return _0x1915c2[_0x2cec('0x16')](_0x1422bf);}return _0x1915c2['status'](_0x1422bf)[_0x2cec('0x17')]();};}function respondWithResult(_0x48ec7b,_0x565d8d){_0x565d8d=_0x565d8d||0xc8;return function(_0x1388b2){if(_0x1388b2){return _0x48ec7b[_0x2cec('0x18')](_0x565d8d)[_0x2cec('0x19')](_0x1388b2);}};}function respondWithFilteredResult(_0x5af1d8,_0xaf2dbf){return function(_0x108fd3){if(_0x108fd3){var _0x5216c3=typeof _0xaf2dbf['offset']===_0x2cec('0x1a')&&typeof _0xaf2dbf[_0x2cec('0x1b')]===_0x2cec('0x1a');var _0xa46596=_0x108fd3[_0x2cec('0x1c')];var _0xf5d7a8=_0x5216c3?0x0:_0xaf2dbf[_0x2cec('0x1d')];var _0x15e546=_0x5216c3?_0x108fd3[_0x2cec('0x1c')]:_0xaf2dbf[_0x2cec('0x1d')]+_0xaf2dbf['limit'];var _0x2ea8bb;if(_0x15e546>=_0xa46596){_0x15e546=_0xa46596;_0x2ea8bb=0xc8;}else{_0x2ea8bb=0xce;}_0x5af1d8['status'](_0x2ea8bb);return _0x5af1d8[_0x2cec('0x1e')](_0x2cec('0x1f'),_0xf5d7a8+'-'+_0x15e546+'/'+_0xa46596)[_0x2cec('0x19')](_0x108fd3);}return null;};}function patchUpdates(_0x828fb6){return function(_0x6dd7fd){try{jsonpatch[_0x2cec('0x20')](_0x6dd7fd,_0x828fb6,!![]);}catch(_0x2bff46){return BPromise[_0x2cec('0x21')](_0x2bff46);}return _0x6dd7fd[_0x2cec('0x22')]();};}function saveUpdates(_0x2da402,_0x269b36){return function(_0x23b1b2){if(_0x23b1b2){return _0x23b1b2[_0x2cec('0x23')](_0x2da402)[_0x2cec('0x24')](function(_0x11000f){return _0x11000f;});}return null;};}function removeEntity(_0x33e343,_0x778316){return function(_0x504740){if(_0x504740){return _0x504740['destroy']()[_0x2cec('0x24')](function(){_0x33e343['status'](0xcc)[_0x2cec('0x17')]();});}};}function handleEntityNotFound(_0xacd1d7,_0x42c28b){return function(_0x59c3b6){if(!_0x59c3b6){_0xacd1d7[_0x2cec('0x16')](0x194);}return _0x59c3b6;};}function handleError(_0x3af04a,_0x58f35d){_0x58f35d=_0x58f35d||0x1f4;return function(_0x39f83e){logger[_0x2cec('0x25')](_0x39f83e[_0x2cec('0x26')]);if(_0x39f83e[_0x2cec('0x27')]){delete _0x39f83e[_0x2cec('0x27')];}_0x3af04a[_0x2cec('0x18')](_0x58f35d)[_0x2cec('0x28')](_0x39f83e);};}exports['index']=function(_0xac059a,_0x5a00cd){var _0x77d614={},_0x5be9d8={},_0x3037aa={'count':0x0,'rows':[]};var _0x1a0ea2=_[_0x2cec('0x29')](db[_0x2cec('0x2a')][_0x2cec('0x2b')],function(_0x1fa0de){return{'name':_0x1fa0de[_0x2cec('0x2c')],'type':_0x1fa0de['type'][_0x2cec('0x2d')]};});_0x5be9d8[_0x2cec('0x2e')]=_[_0x2cec('0x29')](_0x1a0ea2,_0x2cec('0x27'));_0x5be9d8['query']=_[_0x2cec('0x2f')](_0xac059a['query']);_0x5be9d8[_0x2cec('0x30')]=_['intersection'](_0x5be9d8[_0x2cec('0x2e')],_0x5be9d8[_0x2cec('0x31')]);_0x5be9d8[_0x2cec('0x30')]=_[_0x2cec('0x32')](_0x5be9d8[_0x2cec('0x30')],[_0x2cec('0x33'),_0x2cec('0x34'),'$gt','$gte','$lt',_0x2cec('0x35'),_0x2cec('0x36'),'$eq',_0x2cec('0x37'),_0x2cec('0x38'),_0x2cec('0x39'),_0x2cec('0x3a'),_0x2cec('0x3b'),_0x2cec('0x3c'),_0x2cec('0x3d'),_0x2cec('0x3e'),_0x2cec('0x3f'),_0x2cec('0x3c'),'$overlap',_0x2cec('0x40'),_0x2cec('0x41'),'$any']);_0x77d614['attributes']=_[_0x2cec('0x42')](_0x5be9d8[_0x2cec('0x2e')],qs[_0x2cec('0x43')](_0xac059a[_0x2cec('0x31')][_0x2cec('0x43')]));_0x77d614[_0x2cec('0x44')]=_0x77d614['attributes'][_0x2cec('0x45')]?_0x77d614[_0x2cec('0x44')]:_0x5be9d8[_0x2cec('0x2e')];if(!_0xac059a['query'][_0x2cec('0x46')](_0x2cec('0x47'))){_0x77d614[_0x2cec('0x1b')]=qs[_0x2cec('0x1b')](_0xac059a[_0x2cec('0x31')][_0x2cec('0x1b')]);_0x77d614[_0x2cec('0x1d')]=qs[_0x2cec('0x1d')](_0xac059a[_0x2cec('0x31')][_0x2cec('0x1d')]);}_0x77d614['order']=qs[_0x2cec('0x48')](_0xac059a[_0x2cec('0x31')][_0x2cec('0x48')]);_0x77d614['where']=qs[_0x2cec('0x30')](_[_0x2cec('0x49')](_0xac059a[_0x2cec('0x31')],_0x5be9d8[_0x2cec('0x30')]),_0x1a0ea2);if(_0xac059a[_0x2cec('0x31')][_0x2cec('0x4a')]){_0x77d614[_0x2cec('0x4b')]=_[_0x2cec('0x4c')](_0x77d614[_0x2cec('0x4b')],{'$or':_['map'](_0x1a0ea2,function(_0x1899e5){if(_0x1899e5[_0x2cec('0x4d')]!==_0x2cec('0x4e')){var _0x7a6744={};_0x7a6744[_0x1899e5[_0x2cec('0x27')]]={'$like':'%'+_0xac059a[_0x2cec('0x31')]['filter']+'%'};return _0x7a6744;}})});}_0x77d614=_[_0x2cec('0x4c')]({},_0x77d614,_0xac059a[_0x2cec('0x4f')]);var _0x5a4d52={'where':_0x77d614[_0x2cec('0x4b')]};return db['CmHopper']['count'](_0x5a4d52)[_0x2cec('0x24')](function(_0x1dc264){_0x3037aa['count']=_0x1dc264;if(_0xac059a[_0x2cec('0x31')][_0x2cec('0x50')]){_0x77d614['include']=[{'all':!![]}];}return db['CmHopper'][_0x2cec('0x51')](_0x77d614);})[_0x2cec('0x24')](function(_0x41506e){_0x3037aa[_0x2cec('0x52')]=_0x41506e;return _0x3037aa;})[_0x2cec('0x24')](respondWithFilteredResult(_0x5a00cd,_0x77d614))[_0x2cec('0x53')](handleError(_0x5a00cd,null));};exports[_0x2cec('0x54')]=function(_0x31113f,_0x4ab929){var _0x3f2af5={'raw':!![],'where':{'id':_0x31113f[_0x2cec('0x55')]['id']}},_0x3a951b={};_0x3a951b[_0x2cec('0x2e')]=_['keys'](db['CmHopper'][_0x2cec('0x2b')]);_0x3a951b[_0x2cec('0x31')]=_[_0x2cec('0x2f')](_0x31113f[_0x2cec('0x31')]);_0x3a951b[_0x2cec('0x30')]=_[_0x2cec('0x42')](_0x3a951b[_0x2cec('0x2e')],_0x3a951b[_0x2cec('0x31')]);_0x3f2af5['attributes']=_[_0x2cec('0x42')](_0x3a951b[_0x2cec('0x2e')],qs[_0x2cec('0x43')](_0x31113f[_0x2cec('0x31')][_0x2cec('0x43')]));_0x3f2af5[_0x2cec('0x44')]=_0x3f2af5[_0x2cec('0x44')][_0x2cec('0x45')]?_0x3f2af5['attributes']:_0x3a951b[_0x2cec('0x2e')];if(_0x31113f[_0x2cec('0x31')][_0x2cec('0x50')]){_0x3f2af5[_0x2cec('0x56')]=[{'all':!![]}];}_0x3f2af5=_[_0x2cec('0x4c')]({},_0x3f2af5,_0x31113f[_0x2cec('0x4f')]);return db[_0x2cec('0x2a')][_0x2cec('0x57')](_0x3f2af5)['then'](handleEntityNotFound(_0x4ab929,null))[_0x2cec('0x24')](respondWithResult(_0x4ab929,null))[_0x2cec('0x53')](handleError(_0x4ab929,null));};exports[_0x2cec('0x58')]=function(_0x4989dc,_0x1c429a){return db[_0x2cec('0x2a')][_0x2cec('0x58')](_0x4989dc[_0x2cec('0x59')],{})[_0x2cec('0x24')](respondWithResult(_0x1c429a,0xc9))[_0x2cec('0x53')](handleError(_0x1c429a,null));};exports[_0x2cec('0x23')]=function(_0x478100,_0x1fa442){if(_0x478100['body']['id']){delete _0x478100[_0x2cec('0x59')]['id'];}return db[_0x2cec('0x2a')]['find']({'where':{'id':_0x478100[_0x2cec('0x55')]['id']}})['then'](handleEntityNotFound(_0x1fa442,null))[_0x2cec('0x24')](saveUpdates(_0x478100[_0x2cec('0x59')],null))[_0x2cec('0x24')](respondWithResult(_0x1fa442,null))['catch'](handleError(_0x1fa442,null));};exports[_0x2cec('0x5a')]=function(_0xb6bb22,_0x253c05){return db[_0x2cec('0x2a')][_0x2cec('0x5a')]()[_0x2cec('0x24')](respondWithResult(_0x253c05,null))[_0x2cec('0x53')](handleError(_0x253c05,null));};exports[_0x2cec('0x5b')]=function(_0x9c2e02,_0x4216ee){var _0x32ab93;return db[_0x2cec('0x2a')][_0x2cec('0x57')]({'where':{'id':_0x9c2e02[_0x2cec('0x55')]['id']}})['then'](handleEntityNotFound(_0x4216ee,null))[_0x2cec('0x24')](function(_0x47374a){if(_0x47374a){return _0x47374a[_0x2cec('0x5b')]()[_0x2cec('0x24')](function(_0x606bc){return _0x606bc;});}})[_0x2cec('0x24')](function(_0x877280){_0x32ab93=_0x877280;if(_0x877280){if(_0x877280[_0x2cec('0x5c')]||_0x877280[_0x2cec('0x5d')]){return db[_0x877280[_0x2cec('0x5c')]?_0x2cec('0x5e'):'Campaign'][_0x2cec('0x57')]({'where':{'id':_0x877280[_0x2cec('0x5c')]?_0x877280[_0x2cec('0x5c')]:_0x877280[_0x2cec('0x5d')]},'attributes':['id',_0x2cec('0x27')],'raw':!![]});}}})[_0x2cec('0x24')](function(_0x1c739b){var _0x391135={};if(_0x1c739b){_[_0x2cec('0x4c')](_0x391135,_[_0x2cec('0x5f')](_0x32ab93[_0x2cec('0x60')],['createdAt',_0x2cec('0x61'),'id']));_0x391135['state']=0x15;_0x391135['statedesc']='deleted';_0x391135['campaign']=_0x1c739b[_0x2cec('0x27')];_0x391135[_0x2cec('0x62')]=_0x9c2e02['user'][_0x2cec('0x27')];_0x391135[_0x2cec('0x63')]=_0x9c2e02[_0x2cec('0x64')]['id'];_0x391135['deleted']=!![];_0x391135['deletedat']=moment()[_0x2cec('0x65')](_0x2cec('0x66'));_0x391135[_0x2cec('0x67')]=_0x32ab93[_0x2cec('0x68')];_0x391135[_0x2cec('0x69')]=_0x32ab93[_0x2cec('0x5c')]?_0x2cec('0x6a'):_0x2cec('0x6b');return db[_0x2cec('0x6c')][_0x2cec('0x57')]({'where':{'id':_0x391135['ContactId']},'attributes':['firstName',_0x2cec('0x6d')]})[_0x2cec('0x24')](function(_0x483d1a){if(!_[_0x2cec('0x6e')](_0x4216ee)&&!_[_0x2cec('0x6e')](_0x483d1a[_0x2cec('0x6f')])){_0x391135['calleridname']=_0x483d1a[_0x2cec('0x6f')];if(!_['isNil'](_0x483d1a[_0x2cec('0x6d')])){_0x391135['calleridname']+='\x20'+_0x483d1a[_0x2cec('0x6d')];}}})['finally'](function(){return db[_0x2cec('0x70')][_0x2cec('0x58')](_0x391135);});}})['then'](function(){return _0x4216ee[_0x2cec('0x18')](0xcc)[_0x2cec('0x17')]();})['catch'](handleError(_0x4216ee,null));};exports['getPreview']=function(_0x3eb7d9,_0x14f078,_0x203b09){var _0x2c0ae8=[];return db[_0x2cec('0x6c')][_0x2cec('0x5a')]()[_0x2cec('0x24')](function(_0x4f8722){_0x2c0ae8=_[_0x2cec('0x2f')](_0x4f8722);return _0x3eb7d9[_0x2cec('0x64')][_0x2cec('0x71')]({'where':{'type':_0x2cec('0x72'),'dialActive':!![],'dialMethod':_0x2cec('0x73')},'attributes':['id',_0x2cec('0x74')],'raw':!![]});})['then'](function(_0x22c0f9){if(_0x22c0f9&&_0x22c0f9[_0x2cec('0x45')]){return db['sequelize'][_0x2cec('0x75')](function(_0x2db6ad){var _0x1987a6={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x2cec('0x66'))},'VoiceQueueId':{'$in':_['map'](_0x22c0f9,'id')},'$or':[{'UserId':null},{'UserId':_0x3eb7d9[_0x2cec('0x64')]['id']}]};var _0x3c6de4=[];if(_0x3eb7d9[_0x2cec('0x59')]['direction']&&_0x3eb7d9[_0x2cec('0x59')][_0x2cec('0x76')]===_0x2cec('0x77')){if(!_[_0x2cec('0x78')](_0x3eb7d9[_0x2cec('0x59')][_0x2cec('0x79')])){_0x1987a6['id']={'$in':_0x3eb7d9['body']['hopperIds']};}_0x3c6de4=[[_0x2cec('0x7a'),_0x2cec('0x7b')],[_0x2cec('0x7c'),_0x22c0f9[0x0]['dialOrderByScheduledAt']===_0x2cec('0x7b')?_0x2cec('0x7d'):_0x2cec('0x7b')],db['sequelize'][_0x2cec('0x7e')](_0x2cec('0x7f')),['id',_0x2cec('0x7d')]];}else{if(!_[_0x2cec('0x78')](_0x3eb7d9[_0x2cec('0x59')]['hopperIds'])){_0x1987a6['id']={'$notIn':_0x3eb7d9['body'][_0x2cec('0x79')]};}_0x3c6de4=[['priority',_0x2cec('0x7d')],[_0x2cec('0x7c'),_0x22c0f9[0x0][_0x2cec('0x74')]],db[_0x2cec('0x80')][_0x2cec('0x7e')](_0x2cec('0x81')),['id',_0x2cec('0x7b')]];}return db['CmHopper'][_0x2cec('0x82')]({'attributes':['id','scheduledat'],'where':_0x1987a6,'order':_0x3c6de4,'transaction':_0x2db6ad,'lock':_0x2db6ad[_0x2cec('0x83')]['UPDATE'],'include':[{'model':db[_0x2cec('0x6c')],'as':'Contact','attributes':_0x2c0ae8,'include':[{'model':db[_0x2cec('0x84')],'as':_0x2cec('0x85'),'attributes':['id',_0x2cec('0x27')]}]},{'model':db['CmList'],'as':_0x2cec('0x86'),'attributes':['id','name']},{'model':db['VoiceQueue'],'as':'Queue','attributes':['id',_0x2cec('0x27'),_0x2cec('0x87')]}]})[_0x2cec('0x24')](function(_0x125f2c){if(_0x125f2c){return _0x125f2c['update']({'UserId':_0x3eb7d9[_0x2cec('0x64')]['id']},{'transaction':_0x2db6ad});}});});}})[_0x2cec('0x24')](handleEntityNotFound(_0x14f078,null))[_0x2cec('0x24')](respondWithResult(_0x14f078,null))[_0x2cec('0x53')](handleError(_0x14f078,null));};exports[_0x2cec('0x88')]=function(_0x2e1a7b,_0x335664,_0x53c566){return _0x2e1a7b[_0x2cec('0x64')][_0x2cec('0x71')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0x2cec('0x73')},'attributes':['id'],'raw':!![]})[_0x2cec('0x24')](function(_0x34ab15){if(_0x34ab15&&_0x34ab15['length']){return db[_0x2cec('0x2a')]['count']({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0x2cec('0x29')](_0x34ab15,'id')},'$or':[{'UserId':null},{'UserId':_0x2e1a7b[_0x2cec('0x64')]['id']}]}});}return 0x0;})[_0x2cec('0x24')](function(_0x3fdfcd){if(!_['isNil'](_0x3fdfcd)&&_[_0x2cec('0x89')](_0x3fdfcd)){return _0x335664['status'](0xc8)[_0x2cec('0x19')]({'contacts':_0x3fdfcd});}else{logger[_0x2cec('0x25')](_0x2cec('0x8a'),_0x2cec('0x88'),0x194,_0x2cec('0x8b'));_0x335664[_0x2cec('0x16')](0x194);}})[_0x2cec('0x53')](handleError(_0x335664,null));}; \ No newline at end of file +var _0x3065=['crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','update','then','end','stack','name','send','index','CmHopper','rawAttributes','key','model','map','query','keys','filters','intersection','concat','$and','$or','$gt','$gte','$lte','$ne','$eq','$not','$between','$notBetween','$like','$notLike','$iLike','$overlap','$contains','$contained','$any','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','create','body','find','describe','destroy','params','VoiceQueueId','CampaignId','VoiceQueue','Campaign','omit','createdAt','state','deleted','membername','user','UserId','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','queue','ivr','CmContact','firstName','isNil','calleridname','lastName','finally','CmHopperFinal','getPreview','outbound','preview','dialOrderByScheduledAt','transaction','direction','prev','isEmpty','hopperIds','priority','ASC','scheduledAt','sequelize','COALESCE(CmHopper.UserId,\x200)\x20ASC','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','LOCK','UPDATE','Contact','CmCompany','Company','CmList','List','dialActive','getVoiceQueues','error','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','eml-format','rimraf','zip-dir','mustache','util','path','to-csv','ejs','fs-extra','squel'];(function(_0x594be4,_0x2de727){var _0x39ce1a=function(_0x1fa8e8){while(--_0x1fa8e8){_0x594be4['push'](_0x594be4['shift']());}};_0x39ce1a(++_0x2de727);}(_0x3065,0x88));var _0x5306=function(_0x22e19d,_0x121e11){_0x22e19d=_0x22e19d-0x0;var _0x412858=_0x3065[_0x22e19d];return _0x412858;};'use strict';var emlformat=require(_0x5306('0x0'));var rimraf=require(_0x5306('0x1'));var zipdir=require(_0x5306('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x5306('0x3'));var util=require(_0x5306('0x4'));var path=require(_0x5306('0x5'));var sox=require('sox');var csv=require(_0x5306('0x6'));var ejs=require(_0x5306('0x7'));var fs=require('fs');var fs_extra=require(_0x5306('0x8'));var _=require('lodash');var squel=require(_0x5306('0x9'));var crypto=require(_0x5306('0xa'));var jsforce=require(_0x5306('0xb'));var deskjs=require(_0x5306('0xc'));var toCsv=require(_0x5306('0x6'));var querystring=require(_0x5306('0xd'));var Papa=require(_0x5306('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5306('0xf'));var as=require(_0x5306('0x10'));var hardwareService=require(_0x5306('0x11'));var logger=require(_0x5306('0x12'))('api');var utils=require(_0x5306('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x5306('0x14'));var db=require(_0x5306('0x15'))['db'];function respondWithStatusCode(_0x481b1f,_0xe9efd){_0xe9efd=_0xe9efd||0xcc;return function(_0x3657ca){if(_0x3657ca){return _0x481b1f[_0x5306('0x16')](_0xe9efd);}return _0x481b1f[_0x5306('0x17')](_0xe9efd)['end']();};}function respondWithResult(_0x5062ae,_0x392467){_0x392467=_0x392467||0xc8;return function(_0x53e6f3){if(_0x53e6f3){return _0x5062ae[_0x5306('0x17')](_0x392467)['json'](_0x53e6f3);}};}function respondWithFilteredResult(_0x36018c,_0x609856){return function(_0x4db541){if(_0x4db541){var _0x44ce28=typeof _0x609856[_0x5306('0x18')]==='undefined'&&typeof _0x609856[_0x5306('0x19')]===_0x5306('0x1a');var _0x447fb4=_0x4db541[_0x5306('0x1b')];var _0x59e4db=_0x44ce28?0x0:_0x609856['offset'];var _0x6f3c0a=_0x44ce28?_0x4db541['count']:_0x609856[_0x5306('0x18')]+_0x609856[_0x5306('0x19')];var _0x151ae7;if(_0x6f3c0a>=_0x447fb4){_0x6f3c0a=_0x447fb4;_0x151ae7=0xc8;}else{_0x151ae7=0xce;}_0x36018c[_0x5306('0x17')](_0x151ae7);return _0x36018c[_0x5306('0x1c')](_0x5306('0x1d'),_0x59e4db+'-'+_0x6f3c0a+'/'+_0x447fb4)[_0x5306('0x1e')](_0x4db541);}return null;};}function patchUpdates(_0x5ec020){return function(_0x3b7b36){try{jsonpatch[_0x5306('0x1f')](_0x3b7b36,_0x5ec020,!![]);}catch(_0x5c980f){return BPromise[_0x5306('0x20')](_0x5c980f);}return _0x3b7b36['save']();};}function saveUpdates(_0x2f2100,_0x2e2465){return function(_0x533172){if(_0x533172){return _0x533172[_0x5306('0x21')](_0x2f2100)[_0x5306('0x22')](function(_0x45a4d8){return _0x45a4d8;});}return null;};}function removeEntity(_0x3913a9,_0x45574e){return function(_0x43df99){if(_0x43df99){return _0x43df99['destroy']()[_0x5306('0x22')](function(){_0x3913a9['status'](0xcc)[_0x5306('0x23')]();});}};}function handleEntityNotFound(_0x10db1a,_0x238752){return function(_0x1db57f){if(!_0x1db57f){_0x10db1a['sendStatus'](0x194);}return _0x1db57f;};}function handleError(_0x34cad5,_0x2733cc){_0x2733cc=_0x2733cc||0x1f4;return function(_0x5d80e4){logger['error'](_0x5d80e4[_0x5306('0x24')]);if(_0x5d80e4[_0x5306('0x25')]){delete _0x5d80e4[_0x5306('0x25')];}_0x34cad5[_0x5306('0x17')](_0x2733cc)[_0x5306('0x26')](_0x5d80e4);};}exports[_0x5306('0x27')]=function(_0x356e9a,_0x24aca1){var _0x4d000a={},_0x20016d={},_0x5c5220={'count':0x0,'rows':[]};var _0x34632a=_['map'](db[_0x5306('0x28')][_0x5306('0x29')],function(_0x27d751){return{'name':_0x27d751['fieldName'],'type':_0x27d751['type'][_0x5306('0x2a')]};});_0x20016d[_0x5306('0x2b')]=_[_0x5306('0x2c')](_0x34632a,_0x5306('0x25'));_0x20016d[_0x5306('0x2d')]=_[_0x5306('0x2e')](_0x356e9a['query']);_0x20016d[_0x5306('0x2f')]=_[_0x5306('0x30')](_0x20016d[_0x5306('0x2b')],_0x20016d[_0x5306('0x2d')]);_0x20016d[_0x5306('0x2f')]=_[_0x5306('0x31')](_0x20016d[_0x5306('0x2f')],[_0x5306('0x32'),_0x5306('0x33'),_0x5306('0x34'),_0x5306('0x35'),'$lt',_0x5306('0x36'),_0x5306('0x37'),_0x5306('0x38'),_0x5306('0x39'),_0x5306('0x3a'),_0x5306('0x3b'),'$in','$notIn',_0x5306('0x3c'),_0x5306('0x3d'),_0x5306('0x3e'),'$notILike','$like',_0x5306('0x3f'),_0x5306('0x40'),_0x5306('0x41'),_0x5306('0x42')]);_0x4d000a['attributes']=_[_0x5306('0x30')](_0x20016d[_0x5306('0x2b')],qs['fields'](_0x356e9a['query'][_0x5306('0x43')]));_0x4d000a[_0x5306('0x44')]=_0x4d000a['attributes'][_0x5306('0x45')]?_0x4d000a[_0x5306('0x44')]:_0x20016d[_0x5306('0x2b')];if(!_0x356e9a['query'][_0x5306('0x46')](_0x5306('0x47'))){_0x4d000a[_0x5306('0x19')]=qs[_0x5306('0x19')](_0x356e9a[_0x5306('0x2d')][_0x5306('0x19')]);_0x4d000a[_0x5306('0x18')]=qs['offset'](_0x356e9a[_0x5306('0x2d')][_0x5306('0x18')]);}_0x4d000a[_0x5306('0x48')]=qs[_0x5306('0x49')](_0x356e9a['query']['sort']);_0x4d000a[_0x5306('0x4a')]=qs[_0x5306('0x2f')](_[_0x5306('0x4b')](_0x356e9a[_0x5306('0x2d')],_0x20016d[_0x5306('0x2f')]),_0x34632a);if(_0x356e9a['query'][_0x5306('0x4c')]){_0x4d000a['where']=_[_0x5306('0x4d')](_0x4d000a['where'],{'$or':_[_0x5306('0x2c')](_0x34632a,function(_0x55914a){if(_0x55914a['type']!==_0x5306('0x4e')){var _0x837204={};_0x837204[_0x55914a[_0x5306('0x25')]]={'$like':'%'+_0x356e9a[_0x5306('0x2d')][_0x5306('0x4c')]+'%'};return _0x837204;}})});}_0x4d000a=_[_0x5306('0x4d')]({},_0x4d000a,_0x356e9a['options']);var _0x36833d={'where':_0x4d000a[_0x5306('0x4a')]};return db[_0x5306('0x28')][_0x5306('0x1b')](_0x36833d)[_0x5306('0x22')](function(_0x3e4de2){_0x5c5220[_0x5306('0x1b')]=_0x3e4de2;if(_0x356e9a[_0x5306('0x2d')][_0x5306('0x4f')]){_0x4d000a[_0x5306('0x50')]=[{'all':!![]}];}return db[_0x5306('0x28')][_0x5306('0x51')](_0x4d000a);})[_0x5306('0x22')](function(_0x158b27){_0x5c5220[_0x5306('0x52')]=_0x158b27;return _0x5c5220;})['then'](respondWithFilteredResult(_0x24aca1,_0x4d000a))[_0x5306('0x53')](handleError(_0x24aca1,null));};exports[_0x5306('0x54')]=function(_0x6666f1,_0x1be51b){var _0x474a08={'raw':!![],'where':{'id':_0x6666f1['params']['id']}},_0x239826={};_0x239826[_0x5306('0x2b')]=_[_0x5306('0x2e')](db[_0x5306('0x28')]['rawAttributes']);_0x239826['query']=_['keys'](_0x6666f1['query']);_0x239826[_0x5306('0x2f')]=_[_0x5306('0x30')](_0x239826['model'],_0x239826[_0x5306('0x2d')]);_0x474a08[_0x5306('0x44')]=_[_0x5306('0x30')](_0x239826['model'],qs['fields'](_0x6666f1[_0x5306('0x2d')]['fields']));_0x474a08[_0x5306('0x44')]=_0x474a08[_0x5306('0x44')][_0x5306('0x45')]?_0x474a08['attributes']:_0x239826[_0x5306('0x2b')];if(_0x6666f1[_0x5306('0x2d')][_0x5306('0x4f')]){_0x474a08['include']=[{'all':!![]}];}_0x474a08=_[_0x5306('0x4d')]({},_0x474a08,_0x6666f1['options']);return db[_0x5306('0x28')]['find'](_0x474a08)[_0x5306('0x22')](handleEntityNotFound(_0x1be51b,null))[_0x5306('0x22')](respondWithResult(_0x1be51b,null))['catch'](handleError(_0x1be51b,null));};exports[_0x5306('0x55')]=function(_0x4d2557,_0x3f236a){return db['CmHopper'][_0x5306('0x55')](_0x4d2557[_0x5306('0x56')],{})[_0x5306('0x22')](respondWithResult(_0x3f236a,0xc9))[_0x5306('0x53')](handleError(_0x3f236a,null));};exports['update']=function(_0x541afd,_0xd37118){if(_0x541afd['body']['id']){delete _0x541afd['body']['id'];}return db[_0x5306('0x28')][_0x5306('0x57')]({'where':{'id':_0x541afd['params']['id']}})[_0x5306('0x22')](handleEntityNotFound(_0xd37118,null))[_0x5306('0x22')](saveUpdates(_0x541afd[_0x5306('0x56')],null))['then'](respondWithResult(_0xd37118,null))['catch'](handleError(_0xd37118,null));};exports[_0x5306('0x58')]=function(_0x3dcd17,_0x29fda8){return db['CmHopper'][_0x5306('0x58')]()[_0x5306('0x22')](respondWithResult(_0x29fda8,null))[_0x5306('0x53')](handleError(_0x29fda8,null));};exports[_0x5306('0x59')]=function(_0x27f4fb,_0x2f74e7){var _0x14b0a0;return db['CmHopper'][_0x5306('0x57')]({'where':{'id':_0x27f4fb[_0x5306('0x5a')]['id']}})[_0x5306('0x22')](handleEntityNotFound(_0x2f74e7,null))['then'](function(_0x876ad4){if(_0x876ad4){return _0x876ad4[_0x5306('0x59')]()[_0x5306('0x22')](function(_0x48ee57){return _0x48ee57;});}})[_0x5306('0x22')](function(_0x13bfa1){_0x14b0a0=_0x13bfa1;if(_0x13bfa1){if(_0x13bfa1[_0x5306('0x5b')]||_0x13bfa1[_0x5306('0x5c')]){return db[_0x13bfa1[_0x5306('0x5b')]?_0x5306('0x5d'):_0x5306('0x5e')][_0x5306('0x57')]({'where':{'id':_0x13bfa1[_0x5306('0x5b')]?_0x13bfa1[_0x5306('0x5b')]:_0x13bfa1[_0x5306('0x5c')]},'attributes':['id',_0x5306('0x25')],'raw':!![]});}}})[_0x5306('0x22')](function(_0x26167f){var _0x10060c={};if(_0x26167f){_[_0x5306('0x4d')](_0x10060c,_[_0x5306('0x5f')](_0x14b0a0['dataValues'],[_0x5306('0x60'),'updatedAt','id']));_0x10060c[_0x5306('0x61')]=0x15;_0x10060c['statedesc']=_0x5306('0x62');_0x10060c['campaign']=_0x26167f[_0x5306('0x25')];_0x10060c[_0x5306('0x63')]=_0x27f4fb[_0x5306('0x64')][_0x5306('0x25')];_0x10060c[_0x5306('0x65')]=_0x27f4fb[_0x5306('0x64')]['id'];_0x10060c[_0x5306('0x62')]=!![];_0x10060c[_0x5306('0x66')]=moment()[_0x5306('0x67')](_0x5306('0x68'));_0x10060c[_0x5306('0x69')]=_0x14b0a0[_0x5306('0x6a')];_0x10060c['campaigntype']=_0x14b0a0[_0x5306('0x5b')]?_0x5306('0x6b'):_0x5306('0x6c');return db[_0x5306('0x6d')][_0x5306('0x57')]({'where':{'id':_0x10060c['ContactId']},'attributes':[_0x5306('0x6e'),'lastName']})['then'](function(_0x18bc29){if(!_[_0x5306('0x6f')](_0x2f74e7)&&!_[_0x5306('0x6f')](_0x18bc29[_0x5306('0x6e')])){_0x10060c[_0x5306('0x70')]=_0x18bc29[_0x5306('0x6e')];if(!_[_0x5306('0x6f')](_0x18bc29[_0x5306('0x71')])){_0x10060c[_0x5306('0x70')]+='\x20'+_0x18bc29[_0x5306('0x71')];}}})[_0x5306('0x72')](function(){return db[_0x5306('0x73')][_0x5306('0x55')](_0x10060c);});}})[_0x5306('0x22')](function(){return _0x2f74e7[_0x5306('0x17')](0xcc)[_0x5306('0x23')]();})[_0x5306('0x53')](handleError(_0x2f74e7,null));};exports[_0x5306('0x74')]=function(_0x171994,_0x5addf4,_0xc253a9){var _0x56ad0a=[];return db['CmContact']['describe']()['then'](function(_0x1e62dc){_0x56ad0a=_['keys'](_0x1e62dc);return _0x171994[_0x5306('0x64')]['getVoiceQueues']({'where':{'type':_0x5306('0x75'),'dialActive':!![],'dialMethod':_0x5306('0x76')},'attributes':['id',_0x5306('0x77')],'raw':!![]});})['then'](function(_0x59dbc6){if(_0x59dbc6&&_0x59dbc6[_0x5306('0x45')]){return db['sequelize'][_0x5306('0x78')](function(_0x269747){var _0x47169d={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x5306('0x67')](_0x5306('0x68'))},'VoiceQueueId':{'$in':_[_0x5306('0x2c')](_0x59dbc6,'id')},'$or':[{'UserId':null},{'UserId':_0x171994[_0x5306('0x64')]['id']}]};var _0x11cc4e=[];if(_0x171994[_0x5306('0x56')][_0x5306('0x79')]&&_0x171994['body'][_0x5306('0x79')]===_0x5306('0x7a')){if(!_[_0x5306('0x7b')](_0x171994['body'][_0x5306('0x7c')])){_0x47169d['id']={'$in':_0x171994['body']['hopperIds']};}_0x11cc4e=[[_0x5306('0x7d'),_0x5306('0x7e')],[_0x5306('0x7f'),_0x59dbc6[0x0]['dialOrderByScheduledAt']===_0x5306('0x7e')?'DESC':_0x5306('0x7e')],db[_0x5306('0x80')]['literal'](_0x5306('0x81')),['id',_0x5306('0x82')]];}else{if(!_[_0x5306('0x7b')](_0x171994[_0x5306('0x56')]['hopperIds'])){_0x47169d['id']={'$notIn':_0x171994[_0x5306('0x56')]['hopperIds']};}_0x11cc4e=[[_0x5306('0x7d'),_0x5306('0x82')],['scheduledAt',_0x59dbc6[0x0][_0x5306('0x77')]],db[_0x5306('0x80')][_0x5306('0x83')](_0x5306('0x84')),['id',_0x5306('0x7e')]];}return db['CmHopper'][_0x5306('0x85')]({'attributes':['id','scheduledat'],'where':_0x47169d,'order':_0x11cc4e,'transaction':_0x269747,'lock':_0x269747[_0x5306('0x86')][_0x5306('0x87')],'include':[{'model':db[_0x5306('0x6d')],'as':_0x5306('0x88'),'attributes':_0x56ad0a,'include':[{'model':db[_0x5306('0x89')],'as':_0x5306('0x8a'),'attributes':['id',_0x5306('0x25')]}]},{'model':db[_0x5306('0x8b')],'as':_0x5306('0x8c'),'attributes':['id',_0x5306('0x25')]},{'model':db[_0x5306('0x5d')],'as':'Queue','attributes':['id','name',_0x5306('0x8d')]}]})[_0x5306('0x22')](function(_0x5587a1){if(_0x5587a1){return _0x5587a1[_0x5306('0x21')]({'UserId':_0x171994[_0x5306('0x64')]['id']},{'transaction':_0x269747});}});});}})[_0x5306('0x22')](handleEntityNotFound(_0x5addf4,null))['then'](respondWithResult(_0x5addf4,null))[_0x5306('0x53')](handleError(_0x5addf4,null));};exports['getOpenContacts']=function(_0x1373e8,_0x5ac241,_0x45b34e){return _0x1373e8[_0x5306('0x64')][_0x5306('0x8e')]({'where':{'type':_0x5306('0x75'),'dialActive':!![],'dialMethod':_0x5306('0x76')},'attributes':['id'],'raw':!![]})[_0x5306('0x22')](function(_0x46e79e){if(_0x46e79e&&_0x46e79e[_0x5306('0x45')]){return db['CmHopper'][_0x5306('0x1b')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x5306('0x67')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0x5306('0x2c')](_0x46e79e,'id')},'$or':[{'UserId':null},{'UserId':_0x1373e8[_0x5306('0x64')]['id']}]}});}return 0x0;})[_0x5306('0x22')](function(_0x51478e){if(!_['isNil'](_0x51478e)&&_['isNumber'](_0x51478e)){return _0x5ac241[_0x5306('0x17')](0xc8)['json']({'contacts':_0x51478e});}else{logger[_0x5306('0x8f')](_0x5306('0x90'),'getOpenContacts',0x194,_0x5306('0x91'));_0x5ac241[_0x5306('0x16')](0x194);}})[_0x5306('0x53')](handleError(_0x5ac241,null));}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index 8656c3d..6f2db5b 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 _0xe3da=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopper.attributes','exports','define','CmHopper','scheduledat','priority','lodash','util','../../config/logger'];(function(_0x4080bd,_0x1680da){var _0x55aa34=function(_0x5f7294){while(--_0x5f7294){_0x4080bd['push'](_0x4080bd['shift']());}};_0x55aa34(++_0x1680da);}(_0xe3da,0x1cd));var _0xae3d=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xe3da[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0xae3d('0x0'));var util=require(_0xae3d('0x1'));var logger=require(_0xae3d('0x2'))(_0xae3d('0x3'));var moment=require(_0xae3d('0x4'));var BPromise=require(_0xae3d('0x5'));var rp=require(_0xae3d('0x6'));var fs=require('fs');var path=require(_0xae3d('0x7'));var rimraf=require(_0xae3d('0x8'));var config=require(_0xae3d('0x9'));var attributes=require(_0xae3d('0xa'));module[_0xae3d('0xb')]=function(_0xa9a1a,_0xa54808){return _0xa9a1a[_0xae3d('0xc')](_0xae3d('0xd'),attributes,{'tableName':'cm_hopper','paranoid':![],'indexes':[{'name':_0xae3d('0xe'),'fields':[_0xae3d('0xe')]},{'name':'phone','fields':['phone']},{'name':_0xae3d('0xf'),'fields':[_0xae3d('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2542=['../../config/environment','./cmHopper.attributes','exports','define','CmHopper','cm_hopper','scheduledat','phone','priority','lodash','util','../../config/logger','api','bluebird','path','rimraf'];(function(_0x4f73be,_0x4c936a){var _0x248635=function(_0x401f68){while(--_0x401f68){_0x4f73be['push'](_0x4f73be['shift']());}};_0x248635(++_0x4c936a);}(_0x2542,0x169));var _0x2254=function(_0x2a7bac,_0x440dee){_0x2a7bac=_0x2a7bac-0x0;var _0x359f77=_0x2542[_0x2a7bac];return _0x359f77;};'use strict';var _=require(_0x2254('0x0'));var util=require(_0x2254('0x1'));var logger=require(_0x2254('0x2'))(_0x2254('0x3'));var moment=require('moment');var BPromise=require(_0x2254('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2254('0x5'));var rimraf=require(_0x2254('0x6'));var config=require(_0x2254('0x7'));var attributes=require(_0x2254('0x8'));module[_0x2254('0x9')]=function(_0x508183,_0x19ad3c){return _0x508183[_0x2254('0xa')](_0x2254('0xb'),attributes,{'tableName':_0x2254('0xc'),'paranoid':![],'indexes':[{'name':_0x2254('0xd'),'fields':[_0x2254('0xd')]},{'name':_0x2254('0xe'),'fields':[_0x2254('0xe')]},{'name':_0x2254('0xf'),'fields':[_0x2254('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index fe6420c..657b518 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 _0x447c=['debug','CmHopper,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetCmHopper','CmHopper','findAll','options','raw','where','attributes','include','map','model','ShowCmHopper','find','CreateCmHopper','create','body','UpdateCmHopper','update','DestroyCmHopper','GetContactDialer','CmContact','describe','sequelize','transaction','limit','LOCK','UPDATE','Contact','keys','User','name','voicePause','length','UserId','push','includes','all','CmHopperFinal','destroy','MoveContactManagedDialer','COUNT','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','CountReScheduled','GetContactRecallMe','GetCmHopperPreview','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','then','info','CmHopper,\x20%s,\x20%s'];(function(_0xde3afb,_0x832cc7){var _0x5266f0=function(_0xc43aa2){while(--_0xc43aa2){_0xde3afb['push'](_0xde3afb['shift']());}};_0x5266f0(++_0x832cc7);}(_0x447c,0x80));var _0xc447=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x447c[_0x4e676e];return _0x336a3c;};'use strict';var _=require('lodash');var util=require(_0xc447('0x0'));var moment=require(_0xc447('0x1'));var BPromise=require(_0xc447('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc447('0x3'));var db=require(_0xc447('0x4'))['db'];var utils=require(_0xc447('0x5'));var logger=require(_0xc447('0x6'))('rpc');var config=require(_0xc447('0x7'));var jayson=require(_0xc447('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x258df0,_0x1d19a5,_0x2a0c7b){return new BPromise(function(_0x39061f,_0x3c3795){return client['request'](_0x258df0,_0x2a0c7b)[_0xc447('0x9')](function(_0x236cf0){logger[_0xc447('0xa')](_0xc447('0xb'),_0x1d19a5,'request\x20sent');logger[_0xc447('0xc')](_0xc447('0xd'),_0x1d19a5,_0xc447('0xe'),JSON[_0xc447('0xf')](_0x236cf0));if(_0x236cf0[_0xc447('0x10')]){if(_0x236cf0[_0xc447('0x10')][_0xc447('0x11')]===0x1f4){logger[_0xc447('0x10')](_0xc447('0xb'),_0x1d19a5,_0x236cf0[_0xc447('0x10')][_0xc447('0x12')]);return _0x3c3795(_0x236cf0[_0xc447('0x10')][_0xc447('0x12')]);}logger['error'](_0xc447('0xb'),_0x1d19a5,_0x236cf0[_0xc447('0x10')][_0xc447('0x12')]);return _0x39061f(_0x236cf0['error'][_0xc447('0x12')]);}else{logger[_0xc447('0xa')](_0xc447('0xb'),_0x1d19a5,'request\x20sent');_0x39061f(_0x236cf0['result'][_0xc447('0x12')]);}})[_0xc447('0x13')](function(_0x2c4d6b){logger['error'](_0xc447('0xb'),_0x1d19a5,_0x2c4d6b);_0x3c3795(_0x2c4d6b);});});}exports[_0xc447('0x14')]=function(_0x507fe4){var _0x411a79=this;return new Promise(function(_0x3dd3f2,_0x465c42){return db[_0xc447('0x15')][_0xc447('0x16')]({'raw':_0x507fe4[_0xc447('0x17')]?_0x507fe4[_0xc447('0x17')][_0xc447('0x18')]===undefined?!![]:![]:!![],'where':_0x507fe4[_0xc447('0x17')]?_0x507fe4[_0xc447('0x17')][_0xc447('0x19')]||null:null,'attributes':_0x507fe4[_0xc447('0x17')]?_0x507fe4[_0xc447('0x17')][_0xc447('0x1a')]||null:null,'limit':_0x507fe4[_0xc447('0x17')]?_0x507fe4[_0xc447('0x17')]['limit']||null:null,'include':_0x507fe4[_0xc447('0x17')]?_0x507fe4['options'][_0xc447('0x1b')]?_[_0xc447('0x1c')](_0x507fe4[_0xc447('0x17')][_0xc447('0x1b')],function(_0x435e39){return{'model':db[_0x435e39['model']],'as':_0x435e39['as'],'attributes':_0x435e39[_0xc447('0x1a')],'include':_0x435e39[_0xc447('0x1b')]?_[_0xc447('0x1c')](_0x435e39['include'],function(_0x27ff00){return{'model':db[_0x27ff00[_0xc447('0x1d')]],'as':_0x27ff00['as'],'attributes':_0x27ff00[_0xc447('0x1a')],'include':_0x27ff00[_0xc447('0x1b')]?_[_0xc447('0x1c')](_0x27ff00[_0xc447('0x1b')],function(_0x360913){return{'model':db[_0x360913[_0xc447('0x1d')]],'as':_0x360913['as'],'attributes':_0x360913[_0xc447('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xc447('0x9')](function(_0x442860){logger['info'](_0xc447('0x14'),_0x507fe4);logger[_0xc447('0xc')](_0xc447('0x14'),_0x507fe4,JSON[_0xc447('0xf')](_0x442860));_0x3dd3f2(_0x442860);})['catch'](function(_0x3c2156){logger[_0xc447('0x10')](_0xc447('0x14'),_0x3c2156[_0xc447('0x12')],_0x507fe4);_0x465c42(_0x411a79['error'](0x1f4,_0x3c2156[_0xc447('0x12')]));});});};exports[_0xc447('0x1e')]=function(_0x1681a8){var _0x36da29=this;return new Promise(function(_0x2de84e,_0x1b9cd1){return db[_0xc447('0x15')][_0xc447('0x1f')]({'raw':_0x1681a8['options']?_0x1681a8[_0xc447('0x17')][_0xc447('0x18')]===undefined?!![]:![]:!![],'where':_0x1681a8[_0xc447('0x17')]?_0x1681a8[_0xc447('0x17')][_0xc447('0x19')]||null:null,'attributes':_0x1681a8['options']?_0x1681a8['options'][_0xc447('0x1a')]||null:null,'include':_0x1681a8[_0xc447('0x17')]?_0x1681a8[_0xc447('0x17')][_0xc447('0x1b')]?_[_0xc447('0x1c')](_0x1681a8[_0xc447('0x17')][_0xc447('0x1b')],function(_0x46a172){return{'model':db[_0x46a172[_0xc447('0x1d')]],'as':_0x46a172['as'],'attributes':_0x46a172[_0xc447('0x1a')],'include':_0x46a172[_0xc447('0x1b')]?_['map'](_0x46a172[_0xc447('0x1b')],function(_0x1e78a6){return{'model':db[_0x1e78a6[_0xc447('0x1d')]],'as':_0x1e78a6['as'],'attributes':_0x1e78a6[_0xc447('0x1a')],'include':_0x1e78a6[_0xc447('0x1b')]?_[_0xc447('0x1c')](_0x1e78a6[_0xc447('0x1b')],function(_0x5125d8){return{'model':db[_0x5125d8[_0xc447('0x1d')]],'as':_0x5125d8['as'],'attributes':_0x5125d8['attributes']};}):[]};}):[]};}):[]:[]})[_0xc447('0x9')](function(_0x2a8964){logger[_0xc447('0xa')](_0xc447('0x1e'),_0x1681a8);logger[_0xc447('0xc')]('ShowCmHopper',_0x1681a8,JSON[_0xc447('0xf')](_0x2a8964));_0x2de84e(_0x2a8964);})[_0xc447('0x13')](function(_0x3520e6){logger[_0xc447('0x10')](_0xc447('0x1e'),_0x3520e6[_0xc447('0x12')],_0x1681a8);_0x1b9cd1(_0x36da29[_0xc447('0x10')](0x1f4,_0x3520e6[_0xc447('0x12')]));});});};exports[_0xc447('0x20')]=function(_0x155365){var _0x197c8a=this;return new Promise(function(_0x416af0,_0x1c1304){return db[_0xc447('0x15')][_0xc447('0x21')](_0x155365[_0xc447('0x22')],{'raw':_0x155365[_0xc447('0x17')]?_0x155365[_0xc447('0x17')]['raw']===undefined?!![]:![]:!![]})[_0xc447('0x9')](function(_0x503caf){logger[_0xc447('0xa')](_0xc447('0x20'),_0x155365);logger[_0xc447('0xc')](_0xc447('0x20'),_0x155365,JSON[_0xc447('0xf')](_0x503caf));_0x416af0(_0x503caf);})[_0xc447('0x13')](function(_0x414d29){logger['error'](_0xc447('0x20'),_0x414d29[_0xc447('0x12')],_0x155365);_0x1c1304(_0x197c8a[_0xc447('0x10')](0x1f4,_0x414d29[_0xc447('0x12')]));});});};exports[_0xc447('0x23')]=function(_0x17af9e){var _0xc34ff7=this;return new Promise(function(_0x22c7be,_0x30e136){return db[_0xc447('0x15')][_0xc447('0x24')](_0x17af9e['body'],{'raw':_0x17af9e['options']?_0x17af9e[_0xc447('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x17af9e['options']?_0x17af9e[_0xc447('0x17')][_0xc447('0x19')]||null:null,'attributes':_0x17af9e[_0xc447('0x17')]?_0x17af9e[_0xc447('0x17')]['attributes']||null:null,'limit':_0x17af9e[_0xc447('0x17')]?_0x17af9e['options']['limit']||null:null})[_0xc447('0x9')](function(_0xe226aa){logger[_0xc447('0xa')](_0xc447('0x23'),_0x17af9e);logger['debug'](_0xc447('0x23'),_0x17af9e,JSON[_0xc447('0xf')](_0xe226aa));_0x22c7be(_0xe226aa);})['catch'](function(_0x22106c){logger['error'](_0xc447('0x23'),_0x22106c['message'],_0x17af9e);_0x30e136(_0xc34ff7[_0xc447('0x10')](0x1f4,_0x22106c[_0xc447('0x12')]));});});};exports[_0xc447('0x25')]=function(_0x213614){var _0x3f67bf=this;return new Promise(function(_0x4fb9ab,_0x5862c1){return db[_0xc447('0x15')]['destroy']({'where':_0x213614['options']?_0x213614['options'][_0xc447('0x19')]||null:null})[_0xc447('0x9')](function(_0x172275){logger[_0xc447('0xa')](_0xc447('0x25'),_0x213614);logger[_0xc447('0xc')](_0xc447('0x25'),_0x213614,JSON[_0xc447('0xf')](_0x172275));_0x4fb9ab(_0x172275);})[_0xc447('0x13')](function(_0x1cf8c5){logger[_0xc447('0x10')](_0xc447('0x25'),_0x1cf8c5[_0xc447('0x12')],_0x213614);_0x5862c1(_0x3f67bf[_0xc447('0x10')](0x1f4,_0x1cf8c5[_0xc447('0x12')]));});});};exports[_0xc447('0x26')]=function(_0x483615){var _0x3b5c7c=this;return new Promise(function(_0x53fcb7,_0x3c50a7){return db[_0xc447('0x27')][_0xc447('0x28')]()[_0xc447('0x9')](function(_0x23bca7){return db[_0xc447('0x29')][_0xc447('0x2a')](function(_0x181e0e){return db[_0xc447('0x15')][_0xc447('0x16')]({'where':_0x483615[_0xc447('0x17')]?_0x483615[_0xc447('0x17')][_0xc447('0x19')]||null:null,'attributes':_0x483615[_0xc447('0x17')]?_0x483615[_0xc447('0x17')][_0xc447('0x1a')]||null:null,'limit':_0x483615['options']?_0x483615[_0xc447('0x17')][_0xc447('0x2b')]||null:null,'order':_0x483615['options']?_0x483615['options']['order']||null:null,'transaction':_0x181e0e,'lock':_0x181e0e[_0xc447('0x2c')][_0xc447('0x2d')],'include':[{'model':db[_0xc447('0x27')],'as':_0xc447('0x2e'),'attributes':_[_0xc447('0x2f')](_0x23bca7)},{'model':db[_0xc447('0x30')],'as':'Agent','attributes':['id',_0xc447('0x31'),_0xc447('0x32')]}]})[_0xc447('0x9')](function(_0x9155e6){var _0x4d04a5=[];var _0x4d74eb=[];for(var _0x115e77=0x0;_0x115e77<_0x9155e6[_0xc447('0x33')];_0x115e77+=0x1){var _0xf4fb67=_0x9155e6[_0x115e77][_0xc447('0x34')];if(_0xf4fb67===null){_0x4d04a5[_0xc447('0x35')](_0x9155e6[_0x115e77][_0xc447('0x24')](_0x483615[_0xc447('0x22')],{'transaction':_0x181e0e}));}else if(!_0x4d74eb[_0xc447('0x36')](_0xf4fb67)){_0x4d74eb[_0xc447('0x35')](_0xf4fb67);_0x4d04a5[_0xc447('0x35')](_0x9155e6[_0x115e77][_0xc447('0x24')](_0x483615['body'],{'transaction':_0x181e0e}));}}return BPromise[_0xc447('0x37')](_0x4d04a5);});})[_0xc447('0x9')](function(_0x26c94d){logger[_0xc447('0xa')](_0xc447('0x26'),_0x483615);logger['debug']('GetContactDialer',_0x483615,JSON[_0xc447('0xf')](_0x26c94d));_0x53fcb7(_0x26c94d);})[_0xc447('0x13')](function(_0x1f5e45){logger[_0xc447('0x10')]('GetContactDialer',_0x1f5e45['message'],_0x483615);_0x3c50a7(_0x3b5c7c[_0xc447('0x10')](0x1f4,_0x1f5e45[_0xc447('0x12')]));});});});};exports['MoveContactManagedDialer']=function(_0x490f86){var _0x1a0040=this;return new Promise(function(_0x513923,_0x10e068){return db[_0xc447('0x29')][_0xc447('0x2a')](function(_0x5d174f){return db[_0xc447('0x38')][_0xc447('0x21')](_0x490f86[_0xc447('0x22')],{'raw':_0x490f86[_0xc447('0x17')]?_0x490f86[_0xc447('0x17')]['raw']===undefined?!![]:![]:!![],'transaction':_0x5d174f})[_0xc447('0x9')](function(){return db[_0xc447('0x15')][_0xc447('0x39')]({'where':_0x490f86[_0xc447('0x17')]?_0x490f86[_0xc447('0x17')]['where']||null:null,'transaction':_0x5d174f});});})[_0xc447('0x9')](function(_0x1ff79d){logger[_0xc447('0xa')]('MoveContactManagedDialer',_0x490f86);logger['debug'](_0xc447('0x3a'),_0x490f86,JSON[_0xc447('0xf')](_0x1ff79d));_0x513923(_0x1ff79d);})['catch'](function(_0xe3426c){logger['error'](_0xc447('0x3a'),_0xe3426c['message'],_0x490f86);_0x10e068(_0x1a0040[_0xc447('0x10')](0x1f4,_0xe3426c[_0xc447('0x12')]));});});};exports['CountReScheduled']=function(_0x276907){var _0x12d42b=this;return new Promise(function(_0x3120dc,_0x5b2425){return db[_0xc447('0x15')]['findAll']({'raw':_0x276907[_0xc447('0x17')]?_0x276907[_0xc447('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x276907[_0xc447('0x17')]?_0x276907[_0xc447('0x17')][_0xc447('0x19')]||null:null,'attributes':[[db[_0xc447('0x29')]['fn'](_0xc447('0x3b'),db['sequelize']['fn']('IF',db[_0xc447('0x29')][_0xc447('0x3c')](_0xc447('0x3d')+util[_0xc447('0x3e')](_0xc447('0x3f'),moment()[_0xc447('0x3e')](_0xc447('0x40')))+_0xc447('0x41')))),_0xc447('0x42')]]})[_0xc447('0x9')](function(_0x3397de){logger['info'](_0xc447('0x43'),_0x276907);logger[_0xc447('0xc')](_0xc447('0x43'),_0x276907,JSON[_0xc447('0xf')](_0x3397de));_0x3120dc(_0x3397de);})['catch'](function(_0xf47dff){logger['error'](_0xc447('0x43'),_0xf47dff[_0xc447('0x12')],_0x276907);_0x5b2425(_0x12d42b[_0xc447('0x10')](0x1f4,_0xf47dff['message']));});});};exports[_0xc447('0x44')]=function(_0x56ca40){var _0x459e85=this;return new Promise(function(_0x181309,_0x578a27){return db[_0xc447('0x27')][_0xc447('0x28')]()['then'](function(_0xf047d7){return db['sequelize']['transaction'](function(_0x26cf45){return db[_0xc447('0x15')]['findAll']({'where':_0x56ca40[_0xc447('0x17')]?_0x56ca40['options'][_0xc447('0x19')]||null:null,'attributes':_0x56ca40[_0xc447('0x17')]?_0x56ca40['options']['attributes']||null:null,'limit':0x1,'order':_0x56ca40['options']?_0x56ca40[_0xc447('0x17')]['order']||null:null,'group':db[_0xc447('0x15')][_0xc447('0x34')],'transaction':_0x26cf45,'lock':_0x26cf45[_0xc447('0x2c')][_0xc447('0x2d')],'include':_0x56ca40[_0xc447('0x17')]?_0x56ca40[_0xc447('0x17')][_0xc447('0x1b')]?_[_0xc447('0x1c')](_0x56ca40[_0xc447('0x17')][_0xc447('0x1b')],function(_0x5a45be){return{'model':db[_0x5a45be[_0xc447('0x1d')]],'as':_0x5a45be['as'],'attributes':_0x5a45be[_0xc447('0x1a')],'include':_0x5a45be[_0xc447('0x1b')]?_['map'](_0x5a45be['include'],function(_0x2b3e54){return{'model':db[_0x2b3e54[_0xc447('0x1d')]],'as':_0x2b3e54['as'],'attributes':_0x2b3e54['attributes'],'include':_0x2b3e54[_0xc447('0x1b')]?_[_0xc447('0x1c')](_0x2b3e54['include'],function(_0x149a8f){return{'model':db[_0x149a8f[_0xc447('0x1d')]],'as':_0x149a8f['as'],'attributes':_0x149a8f[_0xc447('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xc447('0x9')](function(_0xf785f0){var _0x3be12c=[];for(var _0xd8fb58=0x0;_0xd8fb58<_0xf785f0[_0xc447('0x33')];_0xd8fb58+=0x1){_0x3be12c[_0xc447('0x35')](_0xf785f0[_0xd8fb58][_0xc447('0x24')](_0x56ca40[_0xc447('0x22')],{'transaction':_0x26cf45}));}return BPromise[_0xc447('0x37')](_0x3be12c);});})['then'](function(_0x6a2e7){logger[_0xc447('0xa')](_0xc447('0x44'),_0x56ca40);logger[_0xc447('0xc')](_0xc447('0x44'),_0x56ca40,JSON[_0xc447('0xf')](_0x6a2e7));_0x181309(_0x6a2e7);})[_0xc447('0x13')](function(_0x446ee3){logger[_0xc447('0x10')](_0xc447('0x44'),_0x446ee3[_0xc447('0x12')],_0x56ca40);_0x578a27(_0x459e85['error'](0x1f4,_0x446ee3[_0xc447('0x12')]));});});});};exports[_0xc447('0x45')]=function(_0x1a735d){var _0x70df3d=this;return new Promise(function(_0x38221a,_0x281cd6){db[_0xc447('0x27')][_0xc447('0x28')]()[_0xc447('0x9')](function(_0x533b76){return db[_0xc447('0x15')][_0xc447('0x16')]({'raw':_0x1a735d[_0xc447('0x17')]?_0x1a735d['options'][_0xc447('0x18')]===undefined?!![]:![]:!![],'where':_0x1a735d[_0xc447('0x17')]?_0x1a735d['options']['where']||null:null,'attributes':_0x1a735d[_0xc447('0x17')]?_0x1a735d[_0xc447('0x17')][_0xc447('0x1a')]||null:null,'limit':_0x1a735d['options']?_0x1a735d[_0xc447('0x17')][_0xc447('0x2b')]||null:null,'include':_0x1a735d[_0xc447('0x17')]?_0x1a735d[_0xc447('0x17')][_0xc447('0x1b')]?_['map'](_0x1a735d[_0xc447('0x17')][_0xc447('0x1b')],function(_0x2a33ba){return{'model':db[_0x2a33ba['model']],'as':_0x2a33ba['as'],'attributes':_0x2a33ba['as']==='Contact'?_[_0xc447('0x2f')](_0x533b76):_0x2a33ba[_0xc447('0x1a')],'include':_0x2a33ba[_0xc447('0x1b')]?_[_0xc447('0x1c')](_0x2a33ba[_0xc447('0x1b')],function(_0x4b7552){return{'model':db[_0x4b7552['model']],'as':_0x4b7552['as'],'attributes':_0x4b7552['attributes'],'include':_0x4b7552[_0xc447('0x1b')]?_[_0xc447('0x1c')](_0x4b7552[_0xc447('0x1b')],function(_0x21b84e){return{'model':db[_0x21b84e[_0xc447('0x1d')]],'as':_0x21b84e['as'],'attributes':_0x21b84e['attributes']};}):[]};}):[]};}):[]:[]})[_0xc447('0x9')](function(_0x2553ee){logger['info'](_0xc447('0x14'),_0x1a735d);logger[_0xc447('0xc')](_0xc447('0x14'),_0x1a735d,JSON['stringify'](_0x2553ee));_0x38221a(_0x2553ee);})['catch'](function(_0x248677){logger['error'](_0xc447('0x14'),_0x248677[_0xc447('0x12')],_0x1a735d);_0x281cd6(_0x70df3d[_0xc447('0x10')](0x1f4,_0x248677['message']));});});});}; \ No newline at end of file +var _0x9c0d=['update','body','DestroyCmHopper','destroy','GetContactDialer','CmContact','describe','sequelize','transaction','order','LOCK','UPDATE','Contact','keys','User','name','voicePause','length','UserId','push','includes','MoveContactManagedDialer','CmHopperFinal','create','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','all','GetCmHopperPreview','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','CmHopper,\x20%s,\x20%s','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error','message','info','request\x20sent','result','CmHopper','findAll','options','raw','limit','include','map','attributes','model','GetCmHopper','debug','catch','ShowCmHopper','find','where','CreateCmHopper','UpdateCmHopper'];(function(_0x123a39,_0xce086c){var _0x1c9388=function(_0xe83cbf){while(--_0xe83cbf){_0x123a39['push'](_0x123a39['shift']());}};_0x1c9388(++_0xce086c);}(_0x9c0d,0x143));var _0xd9c0=function(_0xef18d2,_0x81b118){_0xef18d2=_0xef18d2-0x0;var _0x62141e=_0x9c0d[_0xef18d2];return _0x62141e;};'use strict';var _=require('lodash');var util=require(_0xd9c0('0x0'));var moment=require(_0xd9c0('0x1'));var BPromise=require(_0xd9c0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd9c0('0x3'));var db=require(_0xd9c0('0x4'))['db'];var utils=require(_0xd9c0('0x5'));var logger=require(_0xd9c0('0x6'))(_0xd9c0('0x7'));var config=require(_0xd9c0('0x8'));var jayson=require(_0xd9c0('0x9'));var client=jayson[_0xd9c0('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2eba8f,_0x12f323,_0x5c8eb2){return new BPromise(function(_0x27a2f7,_0x244b80){return client['request'](_0x2eba8f,_0x5c8eb2)[_0xd9c0('0xb')](function(_0x925660){logger['info'](_0xd9c0('0xc'),_0x12f323,'request\x20sent');logger['debug'](_0xd9c0('0xd'),_0x12f323,'request\x20sent',JSON[_0xd9c0('0xe')](_0x925660));if(_0x925660[_0xd9c0('0xf')]){if(_0x925660[_0xd9c0('0xf')]['code']===0x1f4){logger['error'](_0xd9c0('0xc'),_0x12f323,_0x925660['error'][_0xd9c0('0x10')]);return _0x244b80(_0x925660[_0xd9c0('0xf')][_0xd9c0('0x10')]);}logger['error'](_0xd9c0('0xc'),_0x12f323,_0x925660[_0xd9c0('0xf')][_0xd9c0('0x10')]);return _0x27a2f7(_0x925660[_0xd9c0('0xf')][_0xd9c0('0x10')]);}else{logger[_0xd9c0('0x11')](_0xd9c0('0xc'),_0x12f323,_0xd9c0('0x12'));_0x27a2f7(_0x925660[_0xd9c0('0x13')][_0xd9c0('0x10')]);}})['catch'](function(_0x197989){logger[_0xd9c0('0xf')](_0xd9c0('0xc'),_0x12f323,_0x197989);_0x244b80(_0x197989);});});}exports['GetCmHopper']=function(_0x4dca6d){var _0x37169b=this;return new Promise(function(_0x44d4a8,_0x3ce473){return db[_0xd9c0('0x14')][_0xd9c0('0x15')]({'raw':_0x4dca6d[_0xd9c0('0x16')]?_0x4dca6d['options'][_0xd9c0('0x17')]===undefined?!![]:![]:!![],'where':_0x4dca6d[_0xd9c0('0x16')]?_0x4dca6d[_0xd9c0('0x16')]['where']||null:null,'attributes':_0x4dca6d[_0xd9c0('0x16')]?_0x4dca6d[_0xd9c0('0x16')]['attributes']||null:null,'limit':_0x4dca6d['options']?_0x4dca6d[_0xd9c0('0x16')][_0xd9c0('0x18')]||null:null,'include':_0x4dca6d['options']?_0x4dca6d[_0xd9c0('0x16')][_0xd9c0('0x19')]?_[_0xd9c0('0x1a')](_0x4dca6d[_0xd9c0('0x16')][_0xd9c0('0x19')],function(_0x2e18b9){return{'model':db[_0x2e18b9['model']],'as':_0x2e18b9['as'],'attributes':_0x2e18b9[_0xd9c0('0x1b')],'include':_0x2e18b9[_0xd9c0('0x19')]?_[_0xd9c0('0x1a')](_0x2e18b9[_0xd9c0('0x19')],function(_0x4cd90b){return{'model':db[_0x4cd90b[_0xd9c0('0x1c')]],'as':_0x4cd90b['as'],'attributes':_0x4cd90b[_0xd9c0('0x1b')],'include':_0x4cd90b[_0xd9c0('0x19')]?_[_0xd9c0('0x1a')](_0x4cd90b[_0xd9c0('0x19')],function(_0x4e5e21){return{'model':db[_0x4e5e21['model']],'as':_0x4e5e21['as'],'attributes':_0x4e5e21[_0xd9c0('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xd9c0('0xb')](function(_0x2394fd){logger[_0xd9c0('0x11')](_0xd9c0('0x1d'),_0x4dca6d);logger[_0xd9c0('0x1e')](_0xd9c0('0x1d'),_0x4dca6d,JSON[_0xd9c0('0xe')](_0x2394fd));_0x44d4a8(_0x2394fd);})[_0xd9c0('0x1f')](function(_0x374ef0){logger[_0xd9c0('0xf')](_0xd9c0('0x1d'),_0x374ef0['message'],_0x4dca6d);_0x3ce473(_0x37169b[_0xd9c0('0xf')](0x1f4,_0x374ef0['message']));});});};exports[_0xd9c0('0x20')]=function(_0x284640){var _0x37fae0=this;return new Promise(function(_0x4cbe63,_0x1709a0){return db['CmHopper'][_0xd9c0('0x21')]({'raw':_0x284640[_0xd9c0('0x16')]?_0x284640['options'][_0xd9c0('0x17')]===undefined?!![]:![]:!![],'where':_0x284640[_0xd9c0('0x16')]?_0x284640['options'][_0xd9c0('0x22')]||null:null,'attributes':_0x284640['options']?_0x284640[_0xd9c0('0x16')]['attributes']||null:null,'include':_0x284640[_0xd9c0('0x16')]?_0x284640[_0xd9c0('0x16')][_0xd9c0('0x19')]?_[_0xd9c0('0x1a')](_0x284640[_0xd9c0('0x16')][_0xd9c0('0x19')],function(_0x3a7e7d){return{'model':db[_0x3a7e7d[_0xd9c0('0x1c')]],'as':_0x3a7e7d['as'],'attributes':_0x3a7e7d['attributes'],'include':_0x3a7e7d[_0xd9c0('0x19')]?_[_0xd9c0('0x1a')](_0x3a7e7d[_0xd9c0('0x19')],function(_0x31b6c2){return{'model':db[_0x31b6c2['model']],'as':_0x31b6c2['as'],'attributes':_0x31b6c2['attributes'],'include':_0x31b6c2[_0xd9c0('0x19')]?_[_0xd9c0('0x1a')](_0x31b6c2[_0xd9c0('0x19')],function(_0x5cec6e){return{'model':db[_0x5cec6e['model']],'as':_0x5cec6e['as'],'attributes':_0x5cec6e[_0xd9c0('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xd9c0('0xb')](function(_0x52c66b){logger[_0xd9c0('0x11')](_0xd9c0('0x20'),_0x284640);logger[_0xd9c0('0x1e')](_0xd9c0('0x20'),_0x284640,JSON[_0xd9c0('0xe')](_0x52c66b));_0x4cbe63(_0x52c66b);})[_0xd9c0('0x1f')](function(_0x561a20){logger['error'](_0xd9c0('0x20'),_0x561a20['message'],_0x284640);_0x1709a0(_0x37fae0['error'](0x1f4,_0x561a20[_0xd9c0('0x10')]));});});};exports[_0xd9c0('0x23')]=function(_0x2f28dd){var _0x251407=this;return new Promise(function(_0x27d0ad,_0x33ba8b){return db['CmHopper']['create'](_0x2f28dd['body'],{'raw':_0x2f28dd[_0xd9c0('0x16')]?_0x2f28dd[_0xd9c0('0x16')][_0xd9c0('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x10b34f){logger[_0xd9c0('0x11')](_0xd9c0('0x23'),_0x2f28dd);logger[_0xd9c0('0x1e')](_0xd9c0('0x23'),_0x2f28dd,JSON[_0xd9c0('0xe')](_0x10b34f));_0x27d0ad(_0x10b34f);})[_0xd9c0('0x1f')](function(_0x5cfecb){logger[_0xd9c0('0xf')]('CreateCmHopper',_0x5cfecb[_0xd9c0('0x10')],_0x2f28dd);_0x33ba8b(_0x251407[_0xd9c0('0xf')](0x1f4,_0x5cfecb[_0xd9c0('0x10')]));});});};exports[_0xd9c0('0x24')]=function(_0x1fb8db){var _0x19f140=this;return new Promise(function(_0x1fdfda,_0x3563a8){return db['CmHopper'][_0xd9c0('0x25')](_0x1fb8db[_0xd9c0('0x26')],{'raw':_0x1fb8db[_0xd9c0('0x16')]?_0x1fb8db['options'][_0xd9c0('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1fb8db[_0xd9c0('0x16')]?_0x1fb8db[_0xd9c0('0x16')][_0xd9c0('0x22')]||null:null,'attributes':_0x1fb8db[_0xd9c0('0x16')]?_0x1fb8db[_0xd9c0('0x16')][_0xd9c0('0x1b')]||null:null,'limit':_0x1fb8db[_0xd9c0('0x16')]?_0x1fb8db['options'][_0xd9c0('0x18')]||null:null})['then'](function(_0x157fd4){logger[_0xd9c0('0x11')](_0xd9c0('0x24'),_0x1fb8db);logger[_0xd9c0('0x1e')]('UpdateCmHopper',_0x1fb8db,JSON[_0xd9c0('0xe')](_0x157fd4));_0x1fdfda(_0x157fd4);})[_0xd9c0('0x1f')](function(_0x5169b8){logger[_0xd9c0('0xf')](_0xd9c0('0x24'),_0x5169b8['message'],_0x1fb8db);_0x3563a8(_0x19f140[_0xd9c0('0xf')](0x1f4,_0x5169b8[_0xd9c0('0x10')]));});});};exports[_0xd9c0('0x27')]=function(_0x1f85bf){var _0x27037b=this;return new Promise(function(_0x8d8425,_0x3b3a72){return db[_0xd9c0('0x14')][_0xd9c0('0x28')]({'where':_0x1f85bf[_0xd9c0('0x16')]?_0x1f85bf[_0xd9c0('0x16')][_0xd9c0('0x22')]||null:null})['then'](function(_0xbebde1){logger[_0xd9c0('0x11')](_0xd9c0('0x27'),_0x1f85bf);logger[_0xd9c0('0x1e')](_0xd9c0('0x27'),_0x1f85bf,JSON[_0xd9c0('0xe')](_0xbebde1));_0x8d8425(_0xbebde1);})[_0xd9c0('0x1f')](function(_0x2e35f7){logger['error']('DestroyCmHopper',_0x2e35f7[_0xd9c0('0x10')],_0x1f85bf);_0x3b3a72(_0x27037b[_0xd9c0('0xf')](0x1f4,_0x2e35f7['message']));});});};exports[_0xd9c0('0x29')]=function(_0x5c1066){var _0x42f1a9=this;return new Promise(function(_0x24cfe5,_0x984dc4){return db[_0xd9c0('0x2a')][_0xd9c0('0x2b')]()['then'](function(_0xd29b2f){return db[_0xd9c0('0x2c')][_0xd9c0('0x2d')](function(_0xb164a2){return db[_0xd9c0('0x14')]['findAll']({'where':_0x5c1066[_0xd9c0('0x16')]?_0x5c1066[_0xd9c0('0x16')]['where']||null:null,'attributes':_0x5c1066['options']?_0x5c1066[_0xd9c0('0x16')][_0xd9c0('0x1b')]||null:null,'limit':_0x5c1066['options']?_0x5c1066[_0xd9c0('0x16')][_0xd9c0('0x18')]||null:null,'order':_0x5c1066[_0xd9c0('0x16')]?_0x5c1066[_0xd9c0('0x16')][_0xd9c0('0x2e')]||null:null,'transaction':_0xb164a2,'lock':_0xb164a2[_0xd9c0('0x2f')][_0xd9c0('0x30')],'include':[{'model':db[_0xd9c0('0x2a')],'as':_0xd9c0('0x31'),'attributes':_[_0xd9c0('0x32')](_0xd29b2f)},{'model':db[_0xd9c0('0x33')],'as':'Agent','attributes':['id',_0xd9c0('0x34'),_0xd9c0('0x35')]}]})[_0xd9c0('0xb')](function(_0x214035){var _0xc38d94=[];var _0x310681=[];for(var _0x3b9ca1=0x0;_0x3b9ca1<_0x214035[_0xd9c0('0x36')];_0x3b9ca1+=0x1){var _0x517d4a=_0x214035[_0x3b9ca1][_0xd9c0('0x37')];if(_0x517d4a===null){_0xc38d94[_0xd9c0('0x38')](_0x214035[_0x3b9ca1][_0xd9c0('0x25')](_0x5c1066[_0xd9c0('0x26')],{'transaction':_0xb164a2}));}else if(!_0x310681[_0xd9c0('0x39')](_0x517d4a)){_0x310681[_0xd9c0('0x38')](_0x517d4a);_0xc38d94[_0xd9c0('0x38')](_0x214035[_0x3b9ca1][_0xd9c0('0x25')](_0x5c1066[_0xd9c0('0x26')],{'transaction':_0xb164a2}));}}return BPromise['all'](_0xc38d94);});})[_0xd9c0('0xb')](function(_0x253c81){logger[_0xd9c0('0x11')](_0xd9c0('0x29'),_0x5c1066);logger['debug'](_0xd9c0('0x29'),_0x5c1066,JSON[_0xd9c0('0xe')](_0x253c81));_0x24cfe5(_0x253c81);})[_0xd9c0('0x1f')](function(_0x919cb2){logger[_0xd9c0('0xf')](_0xd9c0('0x29'),_0x919cb2[_0xd9c0('0x10')],_0x5c1066);_0x984dc4(_0x42f1a9[_0xd9c0('0xf')](0x1f4,_0x919cb2[_0xd9c0('0x10')]));});});});};exports[_0xd9c0('0x3a')]=function(_0x1e83ca){var _0x17a3ad=this;return new Promise(function(_0x2a8ec6,_0x1dab88){return db[_0xd9c0('0x2c')][_0xd9c0('0x2d')](function(_0x116a44){return db[_0xd9c0('0x3b')][_0xd9c0('0x3c')](_0x1e83ca[_0xd9c0('0x26')],{'raw':_0x1e83ca[_0xd9c0('0x16')]?_0x1e83ca[_0xd9c0('0x16')]['raw']===undefined?!![]:![]:!![],'transaction':_0x116a44})[_0xd9c0('0xb')](function(){return db[_0xd9c0('0x14')][_0xd9c0('0x28')]({'where':_0x1e83ca['options']?_0x1e83ca['options']['where']||null:null,'transaction':_0x116a44});});})[_0xd9c0('0xb')](function(_0x44d2ad){logger['info']('MoveContactManagedDialer',_0x1e83ca);logger[_0xd9c0('0x1e')](_0xd9c0('0x3a'),_0x1e83ca,JSON['stringify'](_0x44d2ad));_0x2a8ec6(_0x44d2ad);})[_0xd9c0('0x1f')](function(_0x5c3072){logger[_0xd9c0('0xf')](_0xd9c0('0x3a'),_0x5c3072['message'],_0x1e83ca);_0x1dab88(_0x17a3ad[_0xd9c0('0xf')](0x1f4,_0x5c3072['message']));});});};exports[_0xd9c0('0x3d')]=function(_0x2385b9){var _0x251dfd=this;return new Promise(function(_0x574b89,_0x5f343f){return db[_0xd9c0('0x14')][_0xd9c0('0x15')]({'raw':_0x2385b9[_0xd9c0('0x16')]?_0x2385b9[_0xd9c0('0x16')][_0xd9c0('0x17')]===undefined?!![]:![]:!![],'where':_0x2385b9['options']?_0x2385b9[_0xd9c0('0x16')][_0xd9c0('0x22')]||null:null,'attributes':[[db['sequelize']['fn'](_0xd9c0('0x3e'),db[_0xd9c0('0x2c')]['fn']('IF',db[_0xd9c0('0x2c')][_0xd9c0('0x3f')](_0xd9c0('0x40')+util[_0xd9c0('0x41')](_0xd9c0('0x42'),moment()[_0xd9c0('0x41')]('YYYY-MM-DD\x20HH:mm:ss'))+_0xd9c0('0x43')))),_0xd9c0('0x44')]]})[_0xd9c0('0xb')](function(_0x26f28e){logger[_0xd9c0('0x11')](_0xd9c0('0x3d'),_0x2385b9);logger[_0xd9c0('0x1e')](_0xd9c0('0x3d'),_0x2385b9,JSON['stringify'](_0x26f28e));_0x574b89(_0x26f28e);})[_0xd9c0('0x1f')](function(_0x175033){logger[_0xd9c0('0xf')]('CountReScheduled',_0x175033[_0xd9c0('0x10')],_0x2385b9);_0x5f343f(_0x251dfd[_0xd9c0('0xf')](0x1f4,_0x175033['message']));});});};exports[_0xd9c0('0x45')]=function(_0x15f621){var _0x18e0d3=this;return new Promise(function(_0x2ebd92,_0x1d5112){return db[_0xd9c0('0x2a')][_0xd9c0('0x2b')]()[_0xd9c0('0xb')](function(_0x17a334){return db[_0xd9c0('0x2c')]['transaction'](function(_0x3c95a0){return db[_0xd9c0('0x14')][_0xd9c0('0x15')]({'where':_0x15f621[_0xd9c0('0x16')]?_0x15f621[_0xd9c0('0x16')][_0xd9c0('0x22')]||null:null,'attributes':_0x15f621['options']?_0x15f621[_0xd9c0('0x16')][_0xd9c0('0x1b')]||null:null,'limit':0x1,'order':_0x15f621[_0xd9c0('0x16')]?_0x15f621[_0xd9c0('0x16')]['order']||null:null,'group':db[_0xd9c0('0x14')]['UserId'],'transaction':_0x3c95a0,'lock':_0x3c95a0[_0xd9c0('0x2f')][_0xd9c0('0x30')],'include':_0x15f621['options']?_0x15f621[_0xd9c0('0x16')][_0xd9c0('0x19')]?_['map'](_0x15f621['options'][_0xd9c0('0x19')],function(_0x209012){return{'model':db[_0x209012[_0xd9c0('0x1c')]],'as':_0x209012['as'],'attributes':_0x209012[_0xd9c0('0x1b')],'include':_0x209012[_0xd9c0('0x19')]?_[_0xd9c0('0x1a')](_0x209012['include'],function(_0x2847ce){return{'model':db[_0x2847ce[_0xd9c0('0x1c')]],'as':_0x2847ce['as'],'attributes':_0x2847ce[_0xd9c0('0x1b')],'include':_0x2847ce['include']?_[_0xd9c0('0x1a')](_0x2847ce[_0xd9c0('0x19')],function(_0x2d6ea2){return{'model':db[_0x2d6ea2[_0xd9c0('0x1c')]],'as':_0x2d6ea2['as'],'attributes':_0x2d6ea2[_0xd9c0('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5ba01b){var _0x58d670=[];for(var _0xb70103=0x0;_0xb70103<_0x5ba01b[_0xd9c0('0x36')];_0xb70103+=0x1){_0x58d670[_0xd9c0('0x38')](_0x5ba01b[_0xb70103][_0xd9c0('0x25')](_0x15f621[_0xd9c0('0x26')],{'transaction':_0x3c95a0}));}return BPromise[_0xd9c0('0x46')](_0x58d670);});})[_0xd9c0('0xb')](function(_0xb278d3){logger[_0xd9c0('0x11')](_0xd9c0('0x45'),_0x15f621);logger[_0xd9c0('0x1e')](_0xd9c0('0x45'),_0x15f621,JSON[_0xd9c0('0xe')](_0xb278d3));_0x2ebd92(_0xb278d3);})[_0xd9c0('0x1f')](function(_0x21dbbb){logger['error'](_0xd9c0('0x45'),_0x21dbbb[_0xd9c0('0x10')],_0x15f621);_0x1d5112(_0x18e0d3[_0xd9c0('0xf')](0x1f4,_0x21dbbb['message']));});});});};exports[_0xd9c0('0x47')]=function(_0x3041b4){var _0x348326=this;return new Promise(function(_0xc92874,_0x3bc5d4){db[_0xd9c0('0x2a')][_0xd9c0('0x2b')]()[_0xd9c0('0xb')](function(_0x461b90){return db[_0xd9c0('0x14')][_0xd9c0('0x15')]({'raw':_0x3041b4['options']?_0x3041b4[_0xd9c0('0x16')][_0xd9c0('0x17')]===undefined?!![]:![]:!![],'where':_0x3041b4[_0xd9c0('0x16')]?_0x3041b4[_0xd9c0('0x16')][_0xd9c0('0x22')]||null:null,'attributes':_0x3041b4['options']?_0x3041b4[_0xd9c0('0x16')]['attributes']||null:null,'limit':_0x3041b4[_0xd9c0('0x16')]?_0x3041b4[_0xd9c0('0x16')][_0xd9c0('0x18')]||null:null,'include':_0x3041b4['options']?_0x3041b4[_0xd9c0('0x16')][_0xd9c0('0x19')]?_['map'](_0x3041b4[_0xd9c0('0x16')][_0xd9c0('0x19')],function(_0x5dac15){return{'model':db[_0x5dac15['model']],'as':_0x5dac15['as'],'attributes':_0x5dac15['as']===_0xd9c0('0x31')?_[_0xd9c0('0x32')](_0x461b90):_0x5dac15[_0xd9c0('0x1b')],'include':_0x5dac15[_0xd9c0('0x19')]?_[_0xd9c0('0x1a')](_0x5dac15[_0xd9c0('0x19')],function(_0x82fc65){return{'model':db[_0x82fc65['model']],'as':_0x82fc65['as'],'attributes':_0x82fc65['attributes'],'include':_0x82fc65[_0xd9c0('0x19')]?_[_0xd9c0('0x1a')](_0x82fc65[_0xd9c0('0x19')],function(_0xdcbca7){return{'model':db[_0xdcbca7['model']],'as':_0xdcbca7['as'],'attributes':_0xdcbca7[_0xd9c0('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xd9c0('0xb')](function(_0x51d9b6){logger[_0xd9c0('0x11')](_0xd9c0('0x1d'),_0x3041b4);logger[_0xd9c0('0x1e')](_0xd9c0('0x1d'),_0x3041b4,JSON[_0xd9c0('0xe')](_0x51d9b6));_0xc92874(_0x51d9b6);})[_0xd9c0('0x1f')](function(_0x3b117f){logger[_0xd9c0('0xf')](_0xd9c0('0x1d'),_0x3b117f[_0xd9c0('0x10')],_0x3041b4);_0x3bc5d4(_0x348326[_0xd9c0('0xf')](0x1f4,_0x3b117f['message']));});});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index e41e735..ac88c6b 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 _0x7f1d=['describe','getOpenContacts','/:id','show','post','create','/preview','put','update','delete','destroy','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopper.controller','get','isAuthenticated','/describe'];(function(_0x39fc7c,_0x37cdca){var _0x2527c2=function(_0x18d265){while(--_0x18d265){_0x39fc7c['push'](_0x39fc7c['shift']());}};_0x2527c2(++_0x37cdca);}(_0x7f1d,0x164));var _0xd7f1=function(_0x10b1bb,_0x2a5815){_0x10b1bb=_0x10b1bb-0x0;var _0x2d4e05=_0x7f1d[_0x10b1bb];return _0x2d4e05;};'use strict';var multer=require(_0xd7f1('0x0'));var util=require(_0xd7f1('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xd7f1('0x2'));var router=express[_0xd7f1('0x3')]();var fs_extra=require(_0xd7f1('0x4'));var auth=require(_0xd7f1('0x5'));var interaction=require(_0xd7f1('0x6'));var config=require(_0xd7f1('0x7'));var controller=require(_0xd7f1('0x8'));router[_0xd7f1('0x9')]('/',auth[_0xd7f1('0xa')](),controller['index']);router['get'](_0xd7f1('0xb'),auth[_0xd7f1('0xa')](),controller[_0xd7f1('0xc')]);router[_0xd7f1('0x9')]('/opencontacts',auth[_0xd7f1('0xa')](),controller[_0xd7f1('0xd')]);router['get'](_0xd7f1('0xe'),auth[_0xd7f1('0xa')](),controller[_0xd7f1('0xf')]);router[_0xd7f1('0x10')]('/',auth['isAuthenticated'](),controller[_0xd7f1('0x11')]);router[_0xd7f1('0x10')](_0xd7f1('0x12'),auth[_0xd7f1('0xa')](),controller['getPreview']);router[_0xd7f1('0x13')](_0xd7f1('0xe'),auth[_0xd7f1('0xa')](),controller[_0xd7f1('0x14')]);router[_0xd7f1('0x15')](_0xd7f1('0xe'),auth[_0xd7f1('0xa')](),controller[_0xd7f1('0x16')]);module['exports']=router; \ No newline at end of file +var _0x850c=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopper.controller','isAuthenticated','index','get','/describe','/opencontacts','getOpenContacts','/:id','post','create','/preview','getPreview','put','delete','destroy','exports','multer'];(function(_0x2e8b7d,_0x58986c){var _0x23ed77=function(_0x39599f){while(--_0x39599f){_0x2e8b7d['push'](_0x2e8b7d['shift']());}};_0x23ed77(++_0x58986c);}(_0x850c,0x81));var _0xc850=function(_0x1ac7b6,_0x243f8){_0x1ac7b6=_0x1ac7b6-0x0;var _0x1a8af2=_0x850c[_0x1ac7b6];return _0x1a8af2;};'use strict';var multer=require(_0xc850('0x0'));var util=require(_0xc850('0x1'));var path=require(_0xc850('0x2'));var timeout=require(_0xc850('0x3'));var express=require(_0xc850('0x4'));var router=express[_0xc850('0x5')]();var fs_extra=require(_0xc850('0x6'));var auth=require(_0xc850('0x7'));var interaction=require(_0xc850('0x8'));var config=require(_0xc850('0x9'));var controller=require(_0xc850('0xa'));router['get']('/',auth[_0xc850('0xb')](),controller[_0xc850('0xc')]);router[_0xc850('0xd')](_0xc850('0xe'),auth[_0xc850('0xb')](),controller['describe']);router[_0xc850('0xd')](_0xc850('0xf'),auth[_0xc850('0xb')](),controller[_0xc850('0x10')]);router[_0xc850('0xd')](_0xc850('0x11'),auth[_0xc850('0xb')](),controller['show']);router[_0xc850('0x12')]('/',auth[_0xc850('0xb')](),controller[_0xc850('0x13')]);router[_0xc850('0x12')](_0xc850('0x14'),auth[_0xc850('0xb')](),controller[_0xc850('0x15')]);router[_0xc850('0x16')](_0xc850('0x11'),auth[_0xc850('0xb')](),controller['update']);router[_0xc850('0x17')](_0xc850('0x11'),auth[_0xc850('0xb')](),controller[_0xc850('0x18')]);module[_0xc850('0x19')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index 2217f42..958b1dd 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 _0x19d0=['contactListQueue','moment','sequelize','exports','STRING','INTEGER'];(function(_0x686d4f,_0x14a4ce){var _0x1eb988=function(_0x478fcc){while(--_0x478fcc){_0x686d4f['push'](_0x686d4f['shift']());}};_0x1eb988(++_0x14a4ce);}(_0x19d0,0xd9));var _0x019d=function(_0x568de8,_0x2850d0){_0x568de8=_0x568de8-0x0;var _0x192200=_0x19d0[_0x568de8];return _0x192200;};'use strict';var moment=require(_0x019d('0x0'));var Sequelize=require(_0x019d('0x1'));module[_0x019d('0x2')]={'phone':{'type':Sequelize[_0x019d('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x019d('0x4')],'unique':_0x019d('0x5')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0x019d('0x5')},'VoiceQueueId':{'type':Sequelize[_0x019d('0x4')],'unique':_0x019d('0x5')}}; \ No newline at end of file +var _0x448a=['exports','INTEGER','contactListQueue','sequelize'];(function(_0x1059e2,_0x38542c){var _0x3009b0=function(_0x738792){while(--_0x738792){_0x1059e2['push'](_0x1059e2['shift']());}};_0x3009b0(++_0x38542c);}(_0x448a,0x1ef));var _0xa448=function(_0x1925f8,_0x545551){_0x1925f8=_0x1925f8-0x0;var _0x2fd553=_0x448a[_0x1925f8];return _0x2fd553;};'use strict';var moment=require('moment');var Sequelize=require(_0xa448('0x0'));module[_0xa448('0x1')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize[_0xa448('0x2')],'unique':'contactListQueue'},'ListId':{'type':Sequelize['INTEGER'],'unique':_0xa448('0x3')},'VoiceQueueId':{'type':Sequelize[_0xa448('0x2')],'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 c46e294..17d6551 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 _0xdbdf=['show','params','include','merge','body','find','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','CmHopperBlack','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','options','includeAll','findAll','rows','catch'];(function(_0x2d9be0,_0x33ebbc){var _0x4df30d=function(_0x836d62){while(--_0x836d62){_0x2d9be0['push'](_0x2d9be0['shift']());}};_0x4df30d(++_0x33ebbc);}(_0xdbdf,0xf1));var _0xfdbd=function(_0x31cb87,_0x81c6ff){_0x31cb87=_0x31cb87-0x0;var _0x1b61a0=_0xdbdf[_0x31cb87];return _0x1b61a0;};'use strict';var emlformat=require(_0xfdbd('0x0'));var rimraf=require(_0xfdbd('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfdbd('0x2'));var rp=require(_0xfdbd('0x3'));var moment=require(_0xfdbd('0x4'));var BPromise=require(_0xfdbd('0x5'));var Mustache=require(_0xfdbd('0x6'));var util=require(_0xfdbd('0x7'));var path=require(_0xfdbd('0x8'));var sox=require(_0xfdbd('0x9'));var csv=require('to-csv');var ejs=require(_0xfdbd('0xa'));var fs=require('fs');var fs_extra=require(_0xfdbd('0xb'));var _=require(_0xfdbd('0xc'));var squel=require('squel');var crypto=require(_0xfdbd('0xd'));var jsforce=require(_0xfdbd('0xe'));var deskjs=require(_0xfdbd('0xf'));var toCsv=require(_0xfdbd('0x10'));var querystring=require(_0xfdbd('0x11'));var Papa=require(_0xfdbd('0x12'));var Redis=require(_0xfdbd('0x13'));var authService=require(_0xfdbd('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xfdbd('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfdbd('0x16'))(_0xfdbd('0x17'));var utils=require('../../config/utils');var config=require(_0xfdbd('0x18'));var licenseUtil=require(_0xfdbd('0x19'));var db=require(_0xfdbd('0x1a'))['db'];function respondWithStatusCode(_0x293bff,_0x4fa9d7){_0x4fa9d7=_0x4fa9d7||0xcc;return function(_0x2a2266){if(_0x2a2266){return _0x293bff[_0xfdbd('0x1b')](_0x4fa9d7);}return _0x293bff[_0xfdbd('0x1c')](_0x4fa9d7)[_0xfdbd('0x1d')]();};}function respondWithResult(_0xbadf2b,_0x2f0961){_0x2f0961=_0x2f0961||0xc8;return function(_0x4d41e3){if(_0x4d41e3){return _0xbadf2b[_0xfdbd('0x1c')](_0x2f0961)[_0xfdbd('0x1e')](_0x4d41e3);}};}function respondWithFilteredResult(_0x1c8969,_0x5485b3){return function(_0x1d8d76){if(_0x1d8d76){var _0x3a6acb=typeof _0x5485b3['offset']===_0xfdbd('0x1f')&&typeof _0x5485b3[_0xfdbd('0x20')]===_0xfdbd('0x1f');var _0x2b5eed=_0x1d8d76['count'];var _0x4bb37c=_0x3a6acb?0x0:_0x5485b3[_0xfdbd('0x21')];var _0x33f0f0=_0x3a6acb?_0x1d8d76[_0xfdbd('0x22')]:_0x5485b3[_0xfdbd('0x21')]+_0x5485b3['limit'];var _0x5b02c0;if(_0x33f0f0>=_0x2b5eed){_0x33f0f0=_0x2b5eed;_0x5b02c0=0xc8;}else{_0x5b02c0=0xce;}_0x1c8969[_0xfdbd('0x1c')](_0x5b02c0);return _0x1c8969['set'](_0xfdbd('0x23'),_0x4bb37c+'-'+_0x33f0f0+'/'+_0x2b5eed)[_0xfdbd('0x1e')](_0x1d8d76);}return null;};}function patchUpdates(_0x1ce430){return function(_0xc1381){try{jsonpatch[_0xfdbd('0x24')](_0xc1381,_0x1ce430,!![]);}catch(_0x310cc4){return BPromise[_0xfdbd('0x25')](_0x310cc4);}return _0xc1381[_0xfdbd('0x26')]();};}function saveUpdates(_0x398720,_0x5d8c3a){return function(_0x58ba2e){if(_0x58ba2e){return _0x58ba2e[_0xfdbd('0x27')](_0x398720)[_0xfdbd('0x28')](function(_0x2e43de){return _0x2e43de;});}return null;};}function removeEntity(_0x4bc240,_0x2cce17){return function(_0x4dcbc1){if(_0x4dcbc1){return _0x4dcbc1[_0xfdbd('0x29')]()[_0xfdbd('0x28')](function(){_0x4bc240[_0xfdbd('0x1c')](0xcc)[_0xfdbd('0x1d')]();});}};}function handleEntityNotFound(_0x2e4a6c,_0x294b4f){return function(_0x30cd0c){if(!_0x30cd0c){_0x2e4a6c['sendStatus'](0x194);}return _0x30cd0c;};}function handleError(_0x432a06,_0x25f7de){_0x25f7de=_0x25f7de||0x1f4;return function(_0x5b0020){logger['error'](_0x5b0020[_0xfdbd('0x2a')]);if(_0x5b0020[_0xfdbd('0x2b')]){delete _0x5b0020['name'];}_0x432a06[_0xfdbd('0x1c')](_0x25f7de)[_0xfdbd('0x2c')](_0x5b0020);};}exports[_0xfdbd('0x2d')]=function(_0x13c310,_0xb31192){var _0x210f93={},_0x566f7c={},_0x137dd9={'count':0x0,'rows':[]};var _0x20266b=_['map'](db[_0xfdbd('0x2e')][_0xfdbd('0x2f')],function(_0x24467f){return{'name':_0x24467f[_0xfdbd('0x30')],'type':_0x24467f[_0xfdbd('0x31')][_0xfdbd('0x32')]};});_0x566f7c[_0xfdbd('0x33')]=_[_0xfdbd('0x34')](_0x20266b,_0xfdbd('0x2b'));_0x566f7c['query']=_[_0xfdbd('0x35')](_0x13c310[_0xfdbd('0x36')]);_0x566f7c[_0xfdbd('0x37')]=_[_0xfdbd('0x38')](_0x566f7c[_0xfdbd('0x33')],_0x566f7c['query']);_0x210f93[_0xfdbd('0x39')]=_[_0xfdbd('0x38')](_0x566f7c[_0xfdbd('0x33')],qs[_0xfdbd('0x3a')](_0x13c310[_0xfdbd('0x36')][_0xfdbd('0x3a')]));_0x210f93['attributes']=_0x210f93['attributes'][_0xfdbd('0x3b')]?_0x210f93[_0xfdbd('0x39')]:_0x566f7c[_0xfdbd('0x33')];if(!_0x13c310[_0xfdbd('0x36')][_0xfdbd('0x3c')](_0xfdbd('0x3d'))){_0x210f93[_0xfdbd('0x20')]=qs['limit'](_0x13c310[_0xfdbd('0x36')][_0xfdbd('0x20')]);_0x210f93[_0xfdbd('0x21')]=qs['offset'](_0x13c310[_0xfdbd('0x36')][_0xfdbd('0x21')]);}_0x210f93['order']=qs[_0xfdbd('0x3e')](_0x13c310[_0xfdbd('0x36')]['sort']);_0x210f93[_0xfdbd('0x3f')]=qs['filters'](_['pick'](_0x13c310[_0xfdbd('0x36')],_0x566f7c[_0xfdbd('0x37')]),_0x20266b);if(_0x13c310[_0xfdbd('0x36')][_0xfdbd('0x40')]){_0x210f93[_0xfdbd('0x3f')]=_['merge'](_0x210f93[_0xfdbd('0x3f')],{'$or':_[_0xfdbd('0x34')](_0x20266b,function(_0xf73fea){if(_0xf73fea['type']!==_0xfdbd('0x41')){var _0x16ff8d={};_0x16ff8d[_0xf73fea[_0xfdbd('0x2b')]]={'$like':'%'+_0x13c310[_0xfdbd('0x36')][_0xfdbd('0x40')]+'%'};return _0x16ff8d;}})});}_0x210f93=_['merge']({},_0x210f93,_0x13c310[_0xfdbd('0x42')]);var _0x2e3f4d={'where':_0x210f93[_0xfdbd('0x3f')]};return db['CmHopperBlack']['count'](_0x2e3f4d)[_0xfdbd('0x28')](function(_0xa5954f){_0x137dd9[_0xfdbd('0x22')]=_0xa5954f;if(_0x13c310['query'][_0xfdbd('0x43')]){_0x210f93['include']=[{'all':!![]}];}return db[_0xfdbd('0x2e')][_0xfdbd('0x44')](_0x210f93);})[_0xfdbd('0x28')](function(_0x37b01b){_0x137dd9[_0xfdbd('0x45')]=_0x37b01b;return _0x137dd9;})[_0xfdbd('0x28')](respondWithFilteredResult(_0xb31192,_0x210f93))[_0xfdbd('0x46')](handleError(_0xb31192,null));};exports[_0xfdbd('0x47')]=function(_0x17dfa5,_0x45f699){var _0x50f911={'raw':!![],'where':{'id':_0x17dfa5[_0xfdbd('0x48')]['id']}},_0x4f1ccf={};_0x4f1ccf[_0xfdbd('0x33')]=_[_0xfdbd('0x35')](db[_0xfdbd('0x2e')][_0xfdbd('0x2f')]);_0x4f1ccf['query']=_[_0xfdbd('0x35')](_0x17dfa5[_0xfdbd('0x36')]);_0x4f1ccf[_0xfdbd('0x37')]=_[_0xfdbd('0x38')](_0x4f1ccf[_0xfdbd('0x33')],_0x4f1ccf[_0xfdbd('0x36')]);_0x50f911['attributes']=_[_0xfdbd('0x38')](_0x4f1ccf[_0xfdbd('0x33')],qs[_0xfdbd('0x3a')](_0x17dfa5[_0xfdbd('0x36')][_0xfdbd('0x3a')]));_0x50f911[_0xfdbd('0x39')]=_0x50f911[_0xfdbd('0x39')][_0xfdbd('0x3b')]?_0x50f911[_0xfdbd('0x39')]:_0x4f1ccf[_0xfdbd('0x33')];if(_0x17dfa5[_0xfdbd('0x36')][_0xfdbd('0x43')]){_0x50f911[_0xfdbd('0x49')]=[{'all':!![]}];}_0x50f911=_[_0xfdbd('0x4a')]({},_0x50f911,_0x17dfa5[_0xfdbd('0x42')]);return db['CmHopperBlack']['find'](_0x50f911)[_0xfdbd('0x28')](handleEntityNotFound(_0x45f699,null))[_0xfdbd('0x28')](respondWithResult(_0x45f699,null))[_0xfdbd('0x46')](handleError(_0x45f699,null));};exports['update']=function(_0x5194b6,_0x7c243c){if(_0x5194b6[_0xfdbd('0x4b')]['id']){delete _0x5194b6['body']['id'];}return db['CmHopperBlack'][_0xfdbd('0x4c')]({'where':{'id':_0x5194b6[_0xfdbd('0x48')]['id']}})[_0xfdbd('0x28')](handleEntityNotFound(_0x7c243c,null))[_0xfdbd('0x28')](saveUpdates(_0x5194b6['body'],null))[_0xfdbd('0x28')](respondWithResult(_0x7c243c,null))[_0xfdbd('0x46')](handleError(_0x7c243c,null));};exports[_0xfdbd('0x29')]=function(_0xe2e946,_0x1c8ff6){return db[_0xfdbd('0x2e')][_0xfdbd('0x4c')]({'where':{'id':_0xe2e946[_0xfdbd('0x48')]['id']}})[_0xfdbd('0x28')](handleEntityNotFound(_0x1c8ff6,null))[_0xfdbd('0x28')](removeEntity(_0x1c8ff6,null))[_0xfdbd('0x46')](handleError(_0x1c8ff6,null));};exports[_0xfdbd('0x4d')]=function(_0x1de428,_0x230e78){return db[_0xfdbd('0x2e')]['describe']()[_0xfdbd('0x28')](respondWithResult(_0x230e78,null))['catch'](handleError(_0x230e78,null));}; \ No newline at end of file +var _0x32f4=['Content-Range','apply','reject','save','update','destroy','then','end','error','stack','name','send','map','CmHopperBlack','rawAttributes','fieldName','type','query','keys','filters','attributes','intersection','fields','length','model','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','count','set'];(function(_0x270f18,_0x8155e9){var _0x39d745=function(_0x294bdd){while(--_0x294bdd){_0x270f18['push'](_0x270f18['shift']());}};_0x39d745(++_0x8155e9);}(_0x32f4,0x154));var _0x432f=function(_0x43a571,_0x30fc65){_0x43a571=_0x43a571-0x0;var _0x5c53c4=_0x32f4[_0x43a571];return _0x5c53c4;};'use strict';var emlformat=require(_0x432f('0x0'));var rimraf=require(_0x432f('0x1'));var zipdir=require(_0x432f('0x2'));var jsonpatch=require(_0x432f('0x3'));var rp=require('request-promise');var moment=require(_0x432f('0x4'));var BPromise=require(_0x432f('0x5'));var Mustache=require('mustache');var util=require(_0x432f('0x6'));var path=require(_0x432f('0x7'));var sox=require(_0x432f('0x8'));var csv=require(_0x432f('0x9'));var ejs=require(_0x432f('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x432f('0xb'));var crypto=require(_0x432f('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x432f('0xd'));var toCsv=require('to-csv');var querystring=require(_0x432f('0xe'));var Papa=require(_0x432f('0xf'));var Redis=require(_0x432f('0x10'));var authService=require(_0x432f('0x11'));var qs=require(_0x432f('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x432f('0x13'));var logger=require('../../config/logger')(_0x432f('0x14'));var utils=require('../../config/utils');var config=require(_0x432f('0x15'));var licenseUtil=require(_0x432f('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x457389,_0x29f7d2){_0x29f7d2=_0x29f7d2||0xcc;return function(_0x52e40f){if(_0x52e40f){return _0x457389[_0x432f('0x17')](_0x29f7d2);}return _0x457389[_0x432f('0x18')](_0x29f7d2)['end']();};}function respondWithResult(_0x48a4db,_0x28d9e9){_0x28d9e9=_0x28d9e9||0xc8;return function(_0x44756d){if(_0x44756d){return _0x48a4db[_0x432f('0x18')](_0x28d9e9)[_0x432f('0x19')](_0x44756d);}};}function respondWithFilteredResult(_0x419bfe,_0x4f91c5){return function(_0x175ba7){if(_0x175ba7){var _0x2f0708=typeof _0x4f91c5[_0x432f('0x1a')]===_0x432f('0x1b')&&typeof _0x4f91c5['limit']===_0x432f('0x1b');var _0x30f231=_0x175ba7[_0x432f('0x1c')];var _0x243cf=_0x2f0708?0x0:_0x4f91c5[_0x432f('0x1a')];var _0x129582=_0x2f0708?_0x175ba7['count']:_0x4f91c5[_0x432f('0x1a')]+_0x4f91c5['limit'];var _0x3d545d;if(_0x129582>=_0x30f231){_0x129582=_0x30f231;_0x3d545d=0xc8;}else{_0x3d545d=0xce;}_0x419bfe[_0x432f('0x18')](_0x3d545d);return _0x419bfe[_0x432f('0x1d')](_0x432f('0x1e'),_0x243cf+'-'+_0x129582+'/'+_0x30f231)[_0x432f('0x19')](_0x175ba7);}return null;};}function patchUpdates(_0xf1f5d){return function(_0x10f39b){try{jsonpatch[_0x432f('0x1f')](_0x10f39b,_0xf1f5d,!![]);}catch(_0x693eb3){return BPromise[_0x432f('0x20')](_0x693eb3);}return _0x10f39b[_0x432f('0x21')]();};}function saveUpdates(_0x3446fd,_0x4dd230){return function(_0x5940bd){if(_0x5940bd){return _0x5940bd[_0x432f('0x22')](_0x3446fd)['then'](function(_0x28968e){return _0x28968e;});}return null;};}function removeEntity(_0x5b9c70,_0x37f136){return function(_0x175d1b){if(_0x175d1b){return _0x175d1b[_0x432f('0x23')]()[_0x432f('0x24')](function(){_0x5b9c70[_0x432f('0x18')](0xcc)[_0x432f('0x25')]();});}};}function handleEntityNotFound(_0x59f352,_0x252b3b){return function(_0x33edec){if(!_0x33edec){_0x59f352['sendStatus'](0x194);}return _0x33edec;};}function handleError(_0x2cbde9,_0x3e37ec){_0x3e37ec=_0x3e37ec||0x1f4;return function(_0x2bcbb4){logger[_0x432f('0x26')](_0x2bcbb4[_0x432f('0x27')]);if(_0x2bcbb4[_0x432f('0x28')]){delete _0x2bcbb4[_0x432f('0x28')];}_0x2cbde9['status'](_0x3e37ec)[_0x432f('0x29')](_0x2bcbb4);};}exports['index']=function(_0x1f1fdd,_0x573cc5){var _0x20404d={},_0x5a2c14={},_0x3f768b={'count':0x0,'rows':[]};var _0x489ba6=_[_0x432f('0x2a')](db[_0x432f('0x2b')][_0x432f('0x2c')],function(_0x59c1ab){return{'name':_0x59c1ab[_0x432f('0x2d')],'type':_0x59c1ab[_0x432f('0x2e')]['key']};});_0x5a2c14['model']=_[_0x432f('0x2a')](_0x489ba6,_0x432f('0x28'));_0x5a2c14[_0x432f('0x2f')]=_[_0x432f('0x30')](_0x1f1fdd[_0x432f('0x2f')]);_0x5a2c14[_0x432f('0x31')]=_['intersection'](_0x5a2c14['model'],_0x5a2c14[_0x432f('0x2f')]);_0x20404d[_0x432f('0x32')]=_[_0x432f('0x33')](_0x5a2c14['model'],qs[_0x432f('0x34')](_0x1f1fdd[_0x432f('0x2f')][_0x432f('0x34')]));_0x20404d[_0x432f('0x32')]=_0x20404d[_0x432f('0x32')][_0x432f('0x35')]?_0x20404d[_0x432f('0x32')]:_0x5a2c14[_0x432f('0x36')];if(!_0x1f1fdd['query']['hasOwnProperty'](_0x432f('0x37'))){_0x20404d[_0x432f('0x38')]=qs['limit'](_0x1f1fdd['query']['limit']);_0x20404d[_0x432f('0x1a')]=qs[_0x432f('0x1a')](_0x1f1fdd['query'][_0x432f('0x1a')]);}_0x20404d[_0x432f('0x39')]=qs[_0x432f('0x3a')](_0x1f1fdd['query'][_0x432f('0x3a')]);_0x20404d[_0x432f('0x3b')]=qs['filters'](_[_0x432f('0x3c')](_0x1f1fdd[_0x432f('0x2f')],_0x5a2c14['filters']),_0x489ba6);if(_0x1f1fdd[_0x432f('0x2f')][_0x432f('0x3d')]){_0x20404d[_0x432f('0x3b')]=_[_0x432f('0x3e')](_0x20404d[_0x432f('0x3b')],{'$or':_[_0x432f('0x2a')](_0x489ba6,function(_0xbef36e){if(_0xbef36e[_0x432f('0x2e')]!==_0x432f('0x3f')){var _0x2545b7={};_0x2545b7[_0xbef36e[_0x432f('0x28')]]={'$like':'%'+_0x1f1fdd['query'][_0x432f('0x3d')]+'%'};return _0x2545b7;}})});}_0x20404d=_['merge']({},_0x20404d,_0x1f1fdd[_0x432f('0x40')]);var _0x3e8a0a={'where':_0x20404d['where']};return db[_0x432f('0x2b')]['count'](_0x3e8a0a)[_0x432f('0x24')](function(_0x3aca68){_0x3f768b['count']=_0x3aca68;if(_0x1f1fdd['query'][_0x432f('0x41')]){_0x20404d[_0x432f('0x42')]=[{'all':!![]}];}return db[_0x432f('0x2b')][_0x432f('0x43')](_0x20404d);})[_0x432f('0x24')](function(_0x513a57){_0x3f768b['rows']=_0x513a57;return _0x3f768b;})['then'](respondWithFilteredResult(_0x573cc5,_0x20404d))[_0x432f('0x44')](handleError(_0x573cc5,null));};exports[_0x432f('0x45')]=function(_0x55d64c,_0x1f58af){var _0x841572={'raw':!![],'where':{'id':_0x55d64c[_0x432f('0x46')]['id']}},_0x41c90c={};_0x41c90c[_0x432f('0x36')]=_[_0x432f('0x30')](db[_0x432f('0x2b')][_0x432f('0x2c')]);_0x41c90c[_0x432f('0x2f')]=_['keys'](_0x55d64c[_0x432f('0x2f')]);_0x41c90c[_0x432f('0x31')]=_['intersection'](_0x41c90c[_0x432f('0x36')],_0x41c90c[_0x432f('0x2f')]);_0x841572[_0x432f('0x32')]=_[_0x432f('0x33')](_0x41c90c[_0x432f('0x36')],qs[_0x432f('0x34')](_0x55d64c[_0x432f('0x2f')][_0x432f('0x34')]));_0x841572[_0x432f('0x32')]=_0x841572[_0x432f('0x32')][_0x432f('0x35')]?_0x841572[_0x432f('0x32')]:_0x41c90c[_0x432f('0x36')];if(_0x55d64c[_0x432f('0x2f')]['includeAll']){_0x841572['include']=[{'all':!![]}];}_0x841572=_[_0x432f('0x3e')]({},_0x841572,_0x55d64c[_0x432f('0x40')]);return db[_0x432f('0x2b')][_0x432f('0x47')](_0x841572)[_0x432f('0x24')](handleEntityNotFound(_0x1f58af,null))['then'](respondWithResult(_0x1f58af,null))[_0x432f('0x44')](handleError(_0x1f58af,null));};exports[_0x432f('0x22')]=function(_0x46c5ee,_0x2f88d6){if(_0x46c5ee[_0x432f('0x48')]['id']){delete _0x46c5ee[_0x432f('0x48')]['id'];}return db[_0x432f('0x2b')]['find']({'where':{'id':_0x46c5ee[_0x432f('0x46')]['id']}})[_0x432f('0x24')](handleEntityNotFound(_0x2f88d6,null))[_0x432f('0x24')](saveUpdates(_0x46c5ee['body'],null))[_0x432f('0x24')](respondWithResult(_0x2f88d6,null))[_0x432f('0x44')](handleError(_0x2f88d6,null));};exports['destroy']=function(_0x5997db,_0x3b2021){return db[_0x432f('0x2b')]['find']({'where':{'id':_0x5997db['params']['id']}})[_0x432f('0x24')](handleEntityNotFound(_0x3b2021,null))['then'](removeEntity(_0x3b2021,null))[_0x432f('0x44')](handleError(_0x3b2021,null));};exports[_0x432f('0x49')]=function(_0x5df9b3,_0x12f2f7){return db['CmHopperBlack'][_0x432f('0x49')]()[_0x432f('0x24')](respondWithResult(_0x12f2f7,null))[_0x432f('0x44')](handleError(_0x12f2f7,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 3e99cd7..5b2e146 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 _0x13f8=['rimraf','exports','CmHopperBlack','cm_hopper_black','util','../../config/logger','moment','bluebird','path'];(function(_0x560370,_0x135a93){var _0x16aef1=function(_0x468863){while(--_0x468863){_0x560370['push'](_0x560370['shift']());}};_0x16aef1(++_0x135a93);}(_0x13f8,0x11b));var _0x813f=function(_0x2f73ec,_0x4b8f92){_0x2f73ec=_0x2f73ec-0x0;var _0x5c52d5=_0x13f8[_0x2f73ec];return _0x5c52d5;};'use strict';var _=require('lodash');var util=require(_0x813f('0x0'));var logger=require(_0x813f('0x1'))('api');var moment=require(_0x813f('0x2'));var BPromise=require(_0x813f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x813f('0x4'));var rimraf=require(_0x813f('0x5'));var config=require('../../config/environment');var attributes=require('./cmHopperBlack.attributes');module[_0x813f('0x6')]=function(_0x42edf7,_0x3cd2d3){return _0x42edf7['define'](_0x813f('0x7'),attributes,{'tableName':_0x813f('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa80b=['rimraf','../../config/environment','./cmHopperBlack.attributes','exports','CmHopperBlack','cm_hopper_black','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x33ac0b,_0x3f6182){var _0x405ae5=function(_0x48a319){while(--_0x48a319){_0x33ac0b['push'](_0x33ac0b['shift']());}};_0x405ae5(++_0x3f6182);}(_0xa80b,0x1c0));var _0xba80=function(_0x4f81f6,_0x4d8c60){_0x4f81f6=_0x4f81f6-0x0;var _0x283e8e=_0xa80b[_0x4f81f6];return _0x283e8e;};'use strict';var _=require(_0xba80('0x0'));var util=require(_0xba80('0x1'));var logger=require(_0xba80('0x2'))('api');var moment=require(_0xba80('0x3'));var BPromise=require(_0xba80('0x4'));var rp=require(_0xba80('0x5'));var fs=require('fs');var path=require(_0xba80('0x6'));var rimraf=require(_0xba80('0x7'));var config=require(_0xba80('0x8'));var attributes=require(_0xba80('0x9'));module[_0xba80('0xa')]=function(_0x1faf8e,_0x4d3985){return _0x1faf8e['define'](_0xba80('0xb'),attributes,{'tableName':_0xba80('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 ad6e783..4d1d54b 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 _0xf5a7=['CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CmHopperBlack','options','raw','where','attributes','limit','map','include','model','GetCmHopperBlack','stringify','UpdateCmHopperBlack','body','destroy','DestroyCmHopperBlack','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info'];(function(_0x340505,_0x42558b){var _0x59671f=function(_0x8e8a69){while(--_0x8e8a69){_0x340505['push'](_0x340505['shift']());}};_0x59671f(++_0x42558b);}(_0xf5a7,0x165));var _0x7f5a=function(_0x16d2d3,_0x5ac78d){_0x16d2d3=_0x16d2d3-0x0;var _0x4d9035=_0xf5a7[_0x16d2d3];return _0x4d9035;};'use strict';var _=require(_0x7f5a('0x0'));var util=require('util');var moment=require(_0x7f5a('0x1'));var BPromise=require('bluebird');var rs=require(_0x7f5a('0x2'));var fs=require('fs');var Redis=require(_0x7f5a('0x3'));var db=require(_0x7f5a('0x4'))['db'];var utils=require(_0x7f5a('0x5'));var logger=require(_0x7f5a('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7f5a('0x7'));var client=jayson[_0x7f5a('0x8')][_0x7f5a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x236c4e,_0xe5abe8,_0x19b808){return new BPromise(function(_0x44e87e,_0x524413){return client[_0x7f5a('0xa')](_0x236c4e,_0x19b808)[_0x7f5a('0xb')](function(_0x23d4e4){logger[_0x7f5a('0xc')](_0x7f5a('0xd'),_0xe5abe8,_0x7f5a('0xe'));logger[_0x7f5a('0xf')](_0x7f5a('0x10'),_0xe5abe8,'request\x20sent',JSON['stringify'](_0x23d4e4));if(_0x23d4e4[_0x7f5a('0x11')]){if(_0x23d4e4[_0x7f5a('0x11')][_0x7f5a('0x12')]===0x1f4){logger[_0x7f5a('0x11')](_0x7f5a('0xd'),_0xe5abe8,_0x23d4e4[_0x7f5a('0x11')][_0x7f5a('0x13')]);return _0x524413(_0x23d4e4[_0x7f5a('0x11')][_0x7f5a('0x13')]);}logger[_0x7f5a('0x11')](_0x7f5a('0xd'),_0xe5abe8,_0x23d4e4[_0x7f5a('0x11')][_0x7f5a('0x13')]);return _0x44e87e(_0x23d4e4[_0x7f5a('0x11')][_0x7f5a('0x13')]);}else{logger[_0x7f5a('0xc')](_0x7f5a('0xd'),_0xe5abe8,_0x7f5a('0xe'));_0x44e87e(_0x23d4e4[_0x7f5a('0x14')][_0x7f5a('0x13')]);}})[_0x7f5a('0x15')](function(_0xbe0b4f){logger['error'](_0x7f5a('0xd'),_0xe5abe8,_0xbe0b4f);_0x524413(_0xbe0b4f);});});}exports['GetCmHopperBlack']=function(_0x1bb6f6){var _0x595ffc=this;return new Promise(function(_0x2f2891,_0x344bff){return db[_0x7f5a('0x16')]['findAll']({'raw':_0x1bb6f6[_0x7f5a('0x17')]?_0x1bb6f6[_0x7f5a('0x17')][_0x7f5a('0x18')]===undefined?!![]:![]:!![],'where':_0x1bb6f6[_0x7f5a('0x17')]?_0x1bb6f6[_0x7f5a('0x17')][_0x7f5a('0x19')]||null:null,'attributes':_0x1bb6f6[_0x7f5a('0x17')]?_0x1bb6f6[_0x7f5a('0x17')][_0x7f5a('0x1a')]||null:null,'limit':_0x1bb6f6['options']?_0x1bb6f6[_0x7f5a('0x17')][_0x7f5a('0x1b')]||null:null,'include':_0x1bb6f6[_0x7f5a('0x17')]?_0x1bb6f6[_0x7f5a('0x17')]['include']?_[_0x7f5a('0x1c')](_0x1bb6f6[_0x7f5a('0x17')][_0x7f5a('0x1d')],function(_0x5f1d38){return{'model':db[_0x5f1d38[_0x7f5a('0x1e')]],'as':_0x5f1d38['as'],'attributes':_0x5f1d38[_0x7f5a('0x1a')],'include':_0x5f1d38[_0x7f5a('0x1d')]?_[_0x7f5a('0x1c')](_0x5f1d38[_0x7f5a('0x1d')],function(_0x1673e4){return{'model':db[_0x1673e4[_0x7f5a('0x1e')]],'as':_0x1673e4['as'],'attributes':_0x1673e4[_0x7f5a('0x1a')],'include':_0x1673e4[_0x7f5a('0x1d')]?_[_0x7f5a('0x1c')](_0x1673e4[_0x7f5a('0x1d')],function(_0x2425c3){return{'model':db[_0x2425c3[_0x7f5a('0x1e')]],'as':_0x2425c3['as'],'attributes':_0x2425c3[_0x7f5a('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x7f5a('0xb')](function(_0x456191){logger[_0x7f5a('0xc')]('GetCmHopperBlack',_0x1bb6f6);logger[_0x7f5a('0xf')](_0x7f5a('0x1f'),_0x1bb6f6,JSON[_0x7f5a('0x20')](_0x456191));_0x2f2891(_0x456191);})[_0x7f5a('0x15')](function(_0x30f326){logger[_0x7f5a('0x11')](_0x7f5a('0x1f'),_0x30f326[_0x7f5a('0x13')],_0x1bb6f6);_0x344bff(_0x595ffc[_0x7f5a('0x11')](0x1f4,_0x30f326['message']));});});};exports[_0x7f5a('0x21')]=function(_0x4dcceb){var _0x233a6f=this;return new Promise(function(_0x4fcce5,_0x93bac7){return db[_0x7f5a('0x16')]['update'](_0x4dcceb[_0x7f5a('0x22')],{'raw':_0x4dcceb[_0x7f5a('0x17')]?_0x4dcceb[_0x7f5a('0x17')][_0x7f5a('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4dcceb[_0x7f5a('0x17')]?_0x4dcceb['options'][_0x7f5a('0x19')]||null:null,'attributes':_0x4dcceb[_0x7f5a('0x17')]?_0x4dcceb['options'][_0x7f5a('0x1a')]||null:null,'limit':_0x4dcceb[_0x7f5a('0x17')]?_0x4dcceb['options'][_0x7f5a('0x1b')]||null:null})[_0x7f5a('0xb')](function(_0x116769){logger[_0x7f5a('0xc')](_0x7f5a('0x21'),_0x4dcceb);logger['debug'](_0x7f5a('0x21'),_0x4dcceb,JSON[_0x7f5a('0x20')](_0x116769));_0x4fcce5(_0x116769);})[_0x7f5a('0x15')](function(_0x3dbd5b){logger[_0x7f5a('0x11')](_0x7f5a('0x21'),_0x3dbd5b['message'],_0x4dcceb);_0x93bac7(_0x233a6f[_0x7f5a('0x11')](0x1f4,_0x3dbd5b[_0x7f5a('0x13')]));});});};exports['DestroyCmHopperBlack']=function(_0x51136d){var _0x1268fd=this;return new Promise(function(_0x2ff4b1,_0x4409fd){return db['CmHopperBlack'][_0x7f5a('0x23')]({'where':_0x51136d[_0x7f5a('0x17')]?_0x51136d[_0x7f5a('0x17')]['where']||null:null})[_0x7f5a('0xb')](function(_0x9e0627){logger[_0x7f5a('0xc')](_0x7f5a('0x24'),_0x51136d);logger[_0x7f5a('0xf')](_0x7f5a('0x24'),_0x51136d,JSON[_0x7f5a('0x20')](_0x9e0627));_0x2ff4b1(_0x9e0627);})['catch'](function(_0x2ec41f){logger[_0x7f5a('0x11')]('DestroyCmHopperBlack',_0x2ec41f[_0x7f5a('0x13')],_0x51136d);_0x4409fd(_0x1268fd[_0x7f5a('0x11')](0x1f4,_0x2ec41f[_0x7f5a('0x13')]));});});}; \ No newline at end of file +var _0xdfae=['code','message','result','options','raw','attributes','limit','map','model','include','GetCmHopperBlack','UpdateCmHopperBlack','CmHopperBlack','update','body','debug','catch','destroy','where','DestroyCmHopperBlack','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x40a825,_0x3bac79){var _0x273a54=function(_0x5628d8){while(--_0x5628d8){_0x40a825['push'](_0x40a825['shift']());}};_0x273a54(++_0x3bac79);}(_0xdfae,0x17c));var _0xedfa=function(_0x3f9584,_0x5ab12c){_0x3f9584=_0x3f9584-0x0;var _0x9d54c=_0xdfae[_0x3f9584];return _0x9d54c;};'use strict';var _=require(_0xedfa('0x0'));var util=require('util');var moment=require(_0xedfa('0x1'));var BPromise=require(_0xedfa('0x2'));var rs=require(_0xedfa('0x3'));var fs=require('fs');var Redis=require(_0xedfa('0x4'));var db=require(_0xedfa('0x5'))['db'];var utils=require(_0xedfa('0x6'));var logger=require(_0xedfa('0x7'))(_0xedfa('0x8'));var config=require(_0xedfa('0x9'));var jayson=require(_0xedfa('0xa'));var client=jayson[_0xedfa('0xb')][_0xedfa('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5c428e,_0x44f47f,_0x503297){return new BPromise(function(_0x44f9fb,_0x38a6e3){return client['request'](_0x5c428e,_0x503297)[_0xedfa('0xd')](function(_0x534a6d){logger[_0xedfa('0xe')](_0xedfa('0xf'),_0x44f47f,_0xedfa('0x10'));logger['debug'](_0xedfa('0x11'),_0x44f47f,_0xedfa('0x10'),JSON[_0xedfa('0x12')](_0x534a6d));if(_0x534a6d[_0xedfa('0x13')]){if(_0x534a6d[_0xedfa('0x13')][_0xedfa('0x14')]===0x1f4){logger['error'](_0xedfa('0xf'),_0x44f47f,_0x534a6d[_0xedfa('0x13')][_0xedfa('0x15')]);return _0x38a6e3(_0x534a6d[_0xedfa('0x13')][_0xedfa('0x15')]);}logger['error']('CmHopperBlack,\x20%s,\x20%s',_0x44f47f,_0x534a6d['error'][_0xedfa('0x15')]);return _0x44f9fb(_0x534a6d[_0xedfa('0x13')][_0xedfa('0x15')]);}else{logger[_0xedfa('0xe')](_0xedfa('0xf'),_0x44f47f,'request\x20sent');_0x44f9fb(_0x534a6d[_0xedfa('0x16')]['message']);}})['catch'](function(_0x27c1f3){logger[_0xedfa('0x13')](_0xedfa('0xf'),_0x44f47f,_0x27c1f3);_0x38a6e3(_0x27c1f3);});});}exports['GetCmHopperBlack']=function(_0x3c4760){var _0x1aee83=this;return new Promise(function(_0x5499e9,_0x3dfd51){return db['CmHopperBlack']['findAll']({'raw':_0x3c4760[_0xedfa('0x17')]?_0x3c4760[_0xedfa('0x17')][_0xedfa('0x18')]===undefined?!![]:![]:!![],'where':_0x3c4760[_0xedfa('0x17')]?_0x3c4760['options']['where']||null:null,'attributes':_0x3c4760[_0xedfa('0x17')]?_0x3c4760[_0xedfa('0x17')][_0xedfa('0x19')]||null:null,'limit':_0x3c4760['options']?_0x3c4760[_0xedfa('0x17')][_0xedfa('0x1a')]||null:null,'include':_0x3c4760['options']?_0x3c4760[_0xedfa('0x17')]['include']?_[_0xedfa('0x1b')](_0x3c4760[_0xedfa('0x17')]['include'],function(_0x270968){return{'model':db[_0x270968[_0xedfa('0x1c')]],'as':_0x270968['as'],'attributes':_0x270968['attributes'],'include':_0x270968[_0xedfa('0x1d')]?_[_0xedfa('0x1b')](_0x270968[_0xedfa('0x1d')],function(_0x3c1f77){return{'model':db[_0x3c1f77[_0xedfa('0x1c')]],'as':_0x3c1f77['as'],'attributes':_0x3c1f77['attributes'],'include':_0x3c1f77[_0xedfa('0x1d')]?_[_0xedfa('0x1b')](_0x3c1f77[_0xedfa('0x1d')],function(_0x578535){return{'model':db[_0x578535[_0xedfa('0x1c')]],'as':_0x578535['as'],'attributes':_0x578535[_0xedfa('0x19')]};}):[]};}):[]};}):[]:[]})[_0xedfa('0xd')](function(_0xd89257){logger['info'](_0xedfa('0x1e'),_0x3c4760);logger['debug'](_0xedfa('0x1e'),_0x3c4760,JSON[_0xedfa('0x12')](_0xd89257));_0x5499e9(_0xd89257);})['catch'](function(_0x347fe9){logger[_0xedfa('0x13')](_0xedfa('0x1e'),_0x347fe9[_0xedfa('0x15')],_0x3c4760);_0x3dfd51(_0x1aee83['error'](0x1f4,_0x347fe9[_0xedfa('0x15')]));});});};exports[_0xedfa('0x1f')]=function(_0x377a4a){var _0x30004b=this;return new Promise(function(_0x7b3a3d,_0xcfcfab){return db[_0xedfa('0x20')][_0xedfa('0x21')](_0x377a4a[_0xedfa('0x22')],{'raw':_0x377a4a[_0xedfa('0x17')]?_0x377a4a[_0xedfa('0x17')][_0xedfa('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x377a4a[_0xedfa('0x17')]?_0x377a4a[_0xedfa('0x17')]['where']||null:null,'attributes':_0x377a4a[_0xedfa('0x17')]?_0x377a4a[_0xedfa('0x17')]['attributes']||null:null,'limit':_0x377a4a[_0xedfa('0x17')]?_0x377a4a[_0xedfa('0x17')]['limit']||null:null})[_0xedfa('0xd')](function(_0x578de7){logger[_0xedfa('0xe')](_0xedfa('0x1f'),_0x377a4a);logger[_0xedfa('0x23')](_0xedfa('0x1f'),_0x377a4a,JSON[_0xedfa('0x12')](_0x578de7));_0x7b3a3d(_0x578de7);})[_0xedfa('0x24')](function(_0x56c25d){logger[_0xedfa('0x13')]('UpdateCmHopperBlack',_0x56c25d['message'],_0x377a4a);_0xcfcfab(_0x30004b[_0xedfa('0x13')](0x1f4,_0x56c25d['message']));});});};exports['DestroyCmHopperBlack']=function(_0x4dbc74){var _0x58c5d4=this;return new Promise(function(_0x4b8e6d,_0x1345ea){return db['CmHopperBlack'][_0xedfa('0x25')]({'where':_0x4dbc74[_0xedfa('0x17')]?_0x4dbc74['options'][_0xedfa('0x26')]||null:null})[_0xedfa('0xd')](function(_0x4ec836){logger['info']('DestroyCmHopperBlack',_0x4dbc74);logger[_0xedfa('0x23')](_0xedfa('0x27'),_0x4dbc74,JSON[_0xedfa('0x12')](_0x4ec836));_0x4b8e6d(_0x4ec836);})[_0xedfa('0x24')](function(_0xb7d12d){logger[_0xedfa('0x13')](_0xedfa('0x27'),_0xb7d12d[_0xedfa('0x15')],_0x4dbc74);_0x1345ea(_0x58c5d4['error'](0x1f4,_0xb7d12d[_0xedfa('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 2cf18df..c7b0a2c 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 _0x1db9=['isAuthenticated','describe','put','/:id','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','/describe'];(function(_0x1a3cd0,_0x109deb){var _0x3ccbc6=function(_0x2f903b){while(--_0x2f903b){_0x1a3cd0['push'](_0x1a3cd0['shift']());}};_0x3ccbc6(++_0x109deb);}(_0x1db9,0x176));var _0x91db=function(_0x16abd3,_0x3eef37){_0x16abd3=_0x16abd3-0x0;var _0x5b04e0=_0x1db9[_0x16abd3];return _0x5b04e0;};'use strict';var multer=require(_0x91db('0x0'));var util=require(_0x91db('0x1'));var path=require(_0x91db('0x2'));var timeout=require(_0x91db('0x3'));var express=require(_0x91db('0x4'));var router=express[_0x91db('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x91db('0x6'));var interaction=require(_0x91db('0x7'));var config=require('../../config/environment');var controller=require('./cmHopperBlack.controller');router[_0x91db('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x91db('0x8')](_0x91db('0x9'),auth[_0x91db('0xa')](),controller[_0x91db('0xb')]);router[_0x91db('0x8')]('/:id',auth[_0x91db('0xa')](),controller['show']);router[_0x91db('0xc')](_0x91db('0xd'),auth[_0x91db('0xa')](),controller['update']);router[_0x91db('0xe')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x91db('0xf')]=router; \ No newline at end of file +var _0xdf55=['../../components/auth/service','../../components/interaction/service','./cmHopperBlack.controller','get','isAuthenticated','index','/describe','describe','/:id','show','delete','exports','multer','util','connect-timeout','express','fs-extra'];(function(_0x20600a,_0x599df7){var _0x1d6e13=function(_0x37eaea){while(--_0x37eaea){_0x20600a['push'](_0x20600a['shift']());}};_0x1d6e13(++_0x599df7);}(_0xdf55,0x83));var _0x5df5=function(_0x2742db,_0x58e00c){_0x2742db=_0x2742db-0x0;var _0x18659e=_0xdf55[_0x2742db];return _0x18659e;};'use strict';var multer=require(_0x5df5('0x0'));var util=require(_0x5df5('0x1'));var path=require('path');var timeout=require(_0x5df5('0x2'));var express=require(_0x5df5('0x3'));var router=express['Router']();var fs_extra=require(_0x5df5('0x4'));var auth=require(_0x5df5('0x5'));var interaction=require(_0x5df5('0x6'));var config=require('../../config/environment');var controller=require(_0x5df5('0x7'));router[_0x5df5('0x8')]('/',auth[_0x5df5('0x9')](),controller[_0x5df5('0xa')]);router[_0x5df5('0x8')](_0x5df5('0xb'),auth[_0x5df5('0x9')](),controller[_0x5df5('0xc')]);router['get'](_0x5df5('0xd'),auth[_0x5df5('0x9')](),controller[_0x5df5('0xe')]);router['put']('/:id',auth[_0x5df5('0x9')](),controller['update']);router[_0x5df5('0xf')](_0x5df5('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x5df5('0x10')]=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index ec5edbe..69c103f 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 _0x5586=['setDataValue','followuptime','diff','seconds','dispositionat','BOOLEAN','sequelize','INTEGER','STRING','DATE','endtime'];(function(_0x1cb18a,_0x33167a){var _0x22442e=function(_0x46c611){while(--_0x46c611){_0x1cb18a['push'](_0x1cb18a['shift']());}};_0x22442e(++_0x33167a);}(_0x5586,0xb6));var _0x6558=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x5586[_0x46e363];return _0x3fb059;};'use strict';var Sequelize=require(_0x6558('0x0'));var moment=require('moment');module['exports']={'state':{'type':Sequelize[_0x6558('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x6558('0x2')]},'scheduledat':{'type':Sequelize[_0x6558('0x3')]},'countbusyretry':{'type':Sequelize[_0x6558('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x6558('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x6558('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x6558('0x2')]},'originatecalleridnum':{'type':Sequelize[_0x6558('0x2')]},'originatecalleridname':{'type':Sequelize[_0x6558('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x6558('0x2')]},'starttime':{'type':Sequelize[_0x6558('0x3')]},'responsetime':{'type':Sequelize[_0x6558('0x3')]},'answertime':{'type':Sequelize[_0x6558('0x3')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x6558('0x3')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x6558('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x6558('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x6558('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x6558('0x2')]},'campaign':{'type':Sequelize[_0x6558('0x2')]},'campaigntype':{'type':Sequelize[_0x6558('0x2')]},'membername':{'type':Sequelize[_0x6558('0x2')]},'reason':{'type':Sequelize[_0x6558('0x2')]},'disposition':{'type':Sequelize[_0x6558('0x2')]},'secondDisposition':{'type':Sequelize[_0x6558('0x2')]},'thirdDisposition':{'type':Sequelize['STRING']},'dispositionat':{'type':Sequelize[_0x6558('0x3')],'set':function(_0x423cd2){var _0xf10b6d=this['getDataValue'](_0x6558('0x4'));if(_0xf10b6d&&_0x423cd2){this[_0x6558('0x5')](_0x6558('0x6'),moment(_0x423cd2)[_0x6558('0x7')](moment(_0xf10b6d),_0x6558('0x8')));}return this[_0x6558('0x5')](_0x6558('0x9'),_0x423cd2);}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduledat':{'type':Sequelize['DATE']},'callback':{'type':Sequelize[_0x6558('0xa')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x6558('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x6558('0x3')]},'deleted':{'type':Sequelize[_0x6558('0x2')],'defaultValue':null},'deletedat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0x6558('0xa')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x6558('0x3')]},'countnosuchnumberretry':{'type':Sequelize[_0x6558('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x6558('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x6558('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x6558('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x6558('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x415c=['STRING','DATE','getDataValue','endtime','setDataValue','followuptime','diff','seconds','dispositionat','BOOLEAN','sequelize','INTEGER'];(function(_0xf35bc1,_0x510803){var _0xa6b162=function(_0x1e5cc8){while(--_0x1e5cc8){_0xf35bc1['push'](_0xf35bc1['shift']());}};_0xa6b162(++_0x510803);}(_0x415c,0x1ba));var _0xc415=function(_0x35b628,_0x4859d3){_0x35b628=_0x35b628-0x0;var _0x259a43=_0x415c[_0x35b628];return _0x259a43;};'use strict';var Sequelize=require(_0xc415('0x0'));var moment=require('moment');module['exports']={'state':{'type':Sequelize[_0xc415('0x1')](0x2)},'statedesc':{'type':Sequelize[_0xc415('0x2')]},'scheduledat':{'type':Sequelize[_0xc415('0x3')]},'countbusyretry':{'type':Sequelize[_0xc415('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xc415('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xc415('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xc415('0x2')]},'originatecalleridnum':{'type':Sequelize[_0xc415('0x2')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xc415('0x2')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xc415('0x3')]},'responsetime':{'type':Sequelize[_0xc415('0x3')]},'answertime':{'type':Sequelize[_0xc415('0x3')]},'droptime':{'type':Sequelize[_0xc415('0x3')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0xc415('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xc415('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xc415('0x2')]},'campaign':{'type':Sequelize[_0xc415('0x2')]},'campaigntype':{'type':Sequelize[_0xc415('0x2')]},'membername':{'type':Sequelize[_0xc415('0x2')]},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0xc415('0x2')]},'secondDisposition':{'type':Sequelize[_0xc415('0x2')]},'thirdDisposition':{'type':Sequelize[_0xc415('0x2')]},'dispositionat':{'type':Sequelize[_0xc415('0x3')],'set':function(_0x157b00){var _0x27e459=this[_0xc415('0x4')](_0xc415('0x5'));if(_0x27e459&&_0x157b00){this[_0xc415('0x6')](_0xc415('0x7'),moment(_0x157b00)[_0xc415('0x8')](moment(_0x27e459),_0xc415('0x9')));}return this[_0xc415('0x6')](_0xc415('0xa'),_0x157b00);}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0xc415('0xb')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xc415('0xb')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xc415('0xb')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xc415('0x3')]},'callback':{'type':Sequelize[_0xc415('0xb')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0xc415('0x3')]},'deleted':{'type':Sequelize['STRING'],'defaultValue':null},'deletedat':{'type':Sequelize[_0xc415('0x3')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xc415('0x3')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xc415('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xc415('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xc415('0x1')],'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 4af651c..c3de8c5 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(_0x11ea14,_0x5bddf5){var _0x5286f8=function(_0x31ba7a){while(--_0x31ba7a){_0x11ea14['push'](_0x11ea14['shift']());}};_0x5286f8(++_0x5bddf5);}(_0xe3da,0x1cd));var _0xae3d=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xe3da[_0x2641f9];return _0x585741;};'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 _0x1623=['reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','`state`\x20=\x203,\x201,\x20null','dropContacts','`state`\x20=\x2022,\x201,\x20null','moveContactsQueueCampaignHopperFinal','insert','into','cm_hopper','phone','scheduledAt','ListId','createdAt','select','ANY_VALUE(calleridnum)','field','NOW()','ContactId','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','VoiceQueueId','cm_hopper_final','toString','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','from','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','VoiceQueueId\x20=\x20?','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','updatedAt','ANY_VALUE(ContactId)','ANY_VALUE(CampaignId)','CampaignId','CampaignId\x20=\x20?','checkContactHopper','findOne','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','apply','save','update','then','destroy','sendStatus','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','pick','filter','where','merge','options','CmHopperFinal','findAll','rows','catch','show','params','length','find','describe','body','uniqueid','sequelize','COUNT','`state`\x20=\x200,\x201,\x20null','noSuchContacts','literal','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts'];(function(_0x4453db,_0x237c53){var _0x35f82e=function(_0x2233b9){while(--_0x2233b9){_0x4453db['push'](_0x4453db['shift']());}};_0x35f82e(++_0x237c53);}(_0x1623,0xab));var _0x3162=function(_0x20430c,_0xd8f747){_0x20430c=_0x20430c-0x0;var _0x1f5df4=_0x1623[_0x20430c];return _0x1f5df4;};'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['CmHopperFinal'][_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')]()[_0x3162('0x24')](respondWithResult(_0x28865c,null))['catch'](handleError(_0x28865c,null));};exports[_0x3162('0x23')]=function(_0x48cb8f,_0x4f1dde){if(_0x48cb8f[_0x3162('0x48')][_0x3162('0x49')]){delete _0x48cb8f[_0x3162('0x48')][_0x3162('0x49')];}return db['CmHopperFinal'][_0x3162('0x46')]({'where':{'uniqueid':_0x48cb8f['params']['id']}})[_0x3162('0x24')](handleEntityNotFound(_0x4f1dde,null))[_0x3162('0x24')](saveUpdates(_0x48cb8f['body'],null))[_0x3162('0x24')](respondWithResult(_0x4f1dde,null))['catch'](handleError(_0x4f1dde,null));};exports['countContactsQueueCampaignHopperFinal']=function(_0x13e7c4,_0x22c0a2,_0x160364){return db[_0x3162('0x3f')][_0x3162('0x40')]({'raw':![],'where':{'VoiceQueueId':_0x13e7c4[_0x3162('0x44')]['id']},'attributes':[[db[_0x3162('0x4a')]['fn'](_0x3162('0x4b'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x3162('0x4c')))),_0x3162('0x4d')],[db[_0x3162('0x4a')]['fn'](_0x3162('0x4b'),db[_0x3162('0x4a')]['fn']('IF',db[_0x3162('0x4a')][_0x3162('0x4e')]('`state`\x20=\x203,\x201,\x20null'))),_0x3162('0x4f')],[db['sequelize']['fn'](_0x3162('0x4b'),db['sequelize']['fn']('IF',db[_0x3162('0x4a')]['literal'](_0x3162('0x50')))),_0x3162('0x51')],[db['sequelize']['fn']('COUNT',db[_0x3162('0x4a')]['fn']('IF',db[_0x3162('0x4a')]['literal'](_0x3162('0x52')))),_0x3162('0x53')],[db[_0x3162('0x4a')]['fn'](_0x3162('0x4b'),db[_0x3162('0x4a')]['fn']('IF',db['sequelize'][_0x3162('0x4e')](_0x3162('0x54')))),'dropContacts'],[db['sequelize']['fn'](_0x3162('0x4b'),db[_0x3162('0x4a')]['fn']('IF',db[_0x3162('0x4a')]['literal'](_0x3162('0x55')))),_0x3162('0x56')],[db[_0x3162('0x4a')]['fn'](_0x3162('0x4b'),db['sequelize']['fn']('IF',db[_0x3162('0x4a')][_0x3162('0x4e')]('`state`\x20=\x2022,\x201,\x20null'))),_0x3162('0x57')],[db['sequelize']['fn'](_0x3162('0x4b'),db[_0x3162('0x4a')]['fn']('IF',db[_0x3162('0x4a')]['literal'](_0x3162('0x58')))),_0x3162('0x59')]]})[_0x3162('0x24')](handleEntityNotFound(_0x22c0a2,null))[_0x3162('0x24')](respondWithResult(_0x22c0a2,null))[_0x3162('0x42')](handleError(_0x22c0a2,null));};exports[_0x3162('0x5a')]=function(_0x4b5729,_0x4a42ea,_0x520b1a){return db[_0x3162('0x3f')]['findAll']({'raw':![],'where':{'CampaignId':_0x4b5729[_0x3162('0x44')]['id']},'attributes':[[db[_0x3162('0x4a')]['fn'](_0x3162('0x4b'),db[_0x3162('0x4a')]['fn']('IF',db[_0x3162('0x4a')]['literal']('`state`\x20=\x200,\x201,\x20null'))),_0x3162('0x4d')],[db[_0x3162('0x4a')]['fn']('COUNT',db[_0x3162('0x4a')]['fn']('IF',db[_0x3162('0x4a')][_0x3162('0x4e')](_0x3162('0x5b')))),_0x3162('0x4f')],[db['sequelize']['fn'](_0x3162('0x4b'),db[_0x3162('0x4a')]['fn']('IF',db[_0x3162('0x4a')][_0x3162('0x4e')](_0x3162('0x50')))),'busyContacts'],[db[_0x3162('0x4a')]['fn'](_0x3162('0x4b'),db[_0x3162('0x4a')]['fn']('IF',db[_0x3162('0x4a')]['literal'](_0x3162('0x52')))),_0x3162('0x53')],[db[_0x3162('0x4a')]['fn'](_0x3162('0x4b'),db[_0x3162('0x4a')]['fn']('IF',db[_0x3162('0x4a')][_0x3162('0x4e')](_0x3162('0x54')))),_0x3162('0x5c')],[db[_0x3162('0x4a')]['fn']('COUNT',db[_0x3162('0x4a')]['fn']('IF',db[_0x3162('0x4a')]['literal'](_0x3162('0x55')))),'abandonedContacts'],[db[_0x3162('0x4a')]['fn'](_0x3162('0x4b'),db[_0x3162('0x4a')]['fn']('IF',db[_0x3162('0x4a')][_0x3162('0x4e')](_0x3162('0x5d')))),'reCallContacts'],[db[_0x3162('0x4a')]['fn'](_0x3162('0x4b'),db[_0x3162('0x4a')]['fn']('IF',db[_0x3162('0x4a')][_0x3162('0x4e')](_0x3162('0x58')))),'answeringMachine']]})[_0x3162('0x24')](handleEntityNotFound(_0x4a42ea,null))[_0x3162('0x24')](respondWithResult(_0x4a42ea,null))[_0x3162('0x42')](handleError(_0x4a42ea,null));};exports[_0x3162('0x5e')]=function(_0x8a75ca,_0x33c39d,_0xb3d824){return db['VoiceQueue']['find']({'where':{'id':_0x8a75ca['params']['id']}})[_0x3162('0x24')](handleEntityNotFound(_0x33c39d,null))[_0x3162('0x24')](function(_0x59b3f7){var _0x129005;if(_0x59b3f7){_0x129005=squel[_0x3162('0x5f')]()[_0x3162('0x60')](_0x3162('0x61'))['fromQuery']([_0x3162('0x62'),_0x3162('0x63'),'ContactId',_0x3162('0x64'),'VoiceQueueId',_0x3162('0x65'),'updatedAt'],squel[_0x3162('0x66')]()['field'](_0x3162('0x67'),_0x3162('0x62'))[_0x3162('0x68')](_0x3162('0x69'),_0x3162('0x63'))[_0x3162('0x68')]('ANY_VALUE(ContactId)',_0x3162('0x6a'))[_0x3162('0x68')](_0x3162('0x6b'),'ListId')[_0x3162('0x68')](_0x3162('0x6c'),_0x3162('0x6d'))[_0x3162('0x68')](_0x3162('0x69'),'createdAt')[_0x3162('0x68')](_0x3162('0x69'),'updatedAt')['from'](_0x3162('0x6e'))[_0x3162('0x3c')]('VoiceQueueId\x20=\x20?',_0x8a75ca[_0x3162('0x44')]['id'][_0x3162('0x6f')]())[_0x3162('0x3c')](_0x3162('0x70'),_0x8a75ca[_0x3162('0x48')][_0x3162('0x71')][_0x3162('0x6f')]())[_0x3162('0x3c')](_0x3162('0x72'))['where']('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x3162('0x66')]()[_0x3162('0x68')]('phone')[_0x3162('0x73')]('cm_hopper')['where']('VoiceQueueId\x20=\x20?',_0x8a75ca[_0x3162('0x44')]['id']['toString']()))[_0x3162('0x3c')](_0x3162('0x74'),squel[_0x3162('0x66')]()[_0x3162('0x68')](_0x3162('0x75'))[_0x3162('0x73')](_0x3162('0x6e'))[_0x3162('0x3c')](_0x3162('0x76'),_0x8a75ca[_0x3162('0x44')]['id'][_0x3162('0x6f')]())['where'](_0x3162('0x77')))[_0x3162('0x78')](_0x3162('0x6a')))[_0x3162('0x6f')]();return db[_0x3162('0x4a')][_0x3162('0x31')](_0x129005);}return[];})[_0x3162('0x24')](respondWithResult(_0x33c39d,null))[_0x3162('0x42')](handleError(_0x33c39d,null));};exports[_0x3162('0x79')]=function(_0x3f37fa,_0x1d242f,_0x190f91){return db['Campaign'][_0x3162('0x46')]({'where':{'id':_0x3f37fa[_0x3162('0x44')]['id']}})[_0x3162('0x24')](handleEntityNotFound(_0x1d242f,null))['then'](function(_0x3d7bd1){var _0x5cdbb0;if(_0x3d7bd1){_0x5cdbb0=squel[_0x3162('0x5f')]()[_0x3162('0x60')]('cm_hopper')['fromQuery']([_0x3162('0x62'),_0x3162('0x63'),'ContactId',_0x3162('0x64'),'CampaignId',_0x3162('0x65'),_0x3162('0x7a')],squel[_0x3162('0x66')]()[_0x3162('0x68')](_0x3162('0x67'),_0x3162('0x62'))[_0x3162('0x68')](_0x3162('0x69'),_0x3162('0x63'))['field'](_0x3162('0x7b'),'ContactId')[_0x3162('0x68')](_0x3162('0x6b'),'ListId')[_0x3162('0x68')](_0x3162('0x7c'),_0x3162('0x7d'))[_0x3162('0x68')](_0x3162('0x69'),_0x3162('0x65'))[_0x3162('0x68')]('NOW()',_0x3162('0x7a'))[_0x3162('0x73')](_0x3162('0x6e'))['where'](_0x3162('0x7e'),_0x3f37fa[_0x3162('0x44')]['id'][_0x3162('0x6f')]())[_0x3162('0x3c')](_0x3162('0x70'),_0x3f37fa[_0x3162('0x48')]['state'][_0x3162('0x6f')]())[_0x3162('0x3c')](_0x3162('0x72'))[_0x3162('0x3c')](_0x3162('0x74'),squel['select']()[_0x3162('0x68')]('phone')[_0x3162('0x73')](_0x3162('0x61'))['where'](_0x3162('0x7e'),_0x3f37fa[_0x3162('0x44')]['id'][_0x3162('0x6f')]()))['where'](_0x3162('0x74'),squel['select']()['field'](_0x3162('0x75'))[_0x3162('0x73')](_0x3162('0x6e'))[_0x3162('0x3c')](_0x3162('0x7e'),_0x3f37fa[_0x3162('0x44')]['id'][_0x3162('0x6f')]())['where']('state\x20=\x204'))['group'](_0x3162('0x6a')))[_0x3162('0x6f')]();return db['sequelize']['query'](_0x5cdbb0);}return[];})[_0x3162('0x24')](respondWithResult(_0x1d242f,null))['catch'](handleError(_0x1d242f,null));};exports[_0x3162('0x7f')]=function(_0x35d9f0,_0x4408db,_0x377edb){return db['CmHopper'][_0x3162('0x80')]({'where':{'VoiceQueueId':_0x35d9f0[_0x3162('0x48')][_0x3162('0x6d')],'CampaignId':_0x35d9f0['body'][_0x3162('0x7d')],'ContactId':_0x35d9f0['body'][_0x3162('0x6a')]}})['then'](handleEntityNotFound(_0x4408db,null))[_0x3162('0x24')](function(_0x3d414f){if(_0x3d414f){return _0x3d414f;}return null;})[_0x3162('0x24')](respondWithResult(_0x4408db,null))['catch'](handleError(_0x4408db,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index 86e38f7..873e064 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 _0xd391=['cm_hopper_final','calleridnum','uniqueid','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','CmHopperFinal'];(function(_0x1e46b1,_0x1dbaba){var _0x3629cf=function(_0x162007){while(--_0x162007){_0x1e46b1['push'](_0x1e46b1['shift']());}};_0x3629cf(++_0x1dbaba);}(_0xd391,0xf3));var _0x1d39=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0xd391[_0x27af45];return _0x18df21;};'use strict';var _=require(_0x1d39('0x0'));var util=require('util');var logger=require(_0x1d39('0x1'))('api');var moment=require(_0x1d39('0x2'));var BPromise=require(_0x1d39('0x3'));var rp=require(_0x1d39('0x4'));var fs=require('fs');var path=require(_0x1d39('0x5'));var rimraf=require(_0x1d39('0x6'));var config=require(_0x1d39('0x7'));var attributes=require('./cmHopperFinal.attributes');module['exports']=function(_0x11f22e,_0x4c0d1a){return _0x11f22e['define'](_0x1d39('0x8'),attributes,{'tableName':_0x1d39('0x9'),'paranoid':![],'indexes':[{'name':_0x1d39('0xa'),'fields':[_0x1d39('0xa')]},{'name':_0x1d39('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x659b=['CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','moment','bluebird','request-promise','path','rimraf','./cmHopperFinal.attributes','exports','define'];(function(_0x3e4006,_0x6690ec){var _0x2553c2=function(_0x1d4260){while(--_0x1d4260){_0x3e4006['push'](_0x3e4006['shift']());}};_0x2553c2(++_0x6690ec);}(_0x659b,0x149));var _0xb659=function(_0x433c4f,_0x2e2967){_0x433c4f=_0x433c4f-0x0;var _0x37c3d3=_0x659b[_0x433c4f];return _0x37c3d3;};'use strict';var _=require(_0xb659('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xb659('0x1'));var BPromise=require(_0xb659('0x2'));var rp=require(_0xb659('0x3'));var fs=require('fs');var path=require(_0xb659('0x4'));var rimraf=require(_0xb659('0x5'));var config=require('../../config/environment');var attributes=require(_0xb659('0x6'));module[_0xb659('0x7')]=function(_0x184565,_0x206984){return _0x184565[_0xb659('0x8')](_0xb659('0x9'),attributes,{'tableName':_0xb659('0xa'),'paranoid':![],'indexes':[{'name':_0xb659('0xb'),'fields':[_0xb659('0xb')]},{'name':_0xb659('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index 006719e..fabcdeb 100644 --- a/server/api/cmHopperFinal/cmHopperFinal.rpc.js +++ b/server/api/cmHopperFinal/cmHopperFinal.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['../../config/environment','jayson/promise','http','info','CmHopperFinal,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','CmHopperFinal','create','body','options','raw','CreateCmHopperFinal','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x863f43,_0x2d65f1){var _0x535e3d=function(_0x50bcce){while(--_0x50bcce){_0x863f43['push'](_0x863f43['shift']());}};_0x535e3d(++_0x2d65f1);}(_0x7a54,0x106));var _0x47a5=function(_0xbc6fba,_0x58ef72){_0xbc6fba=_0xbc6fba-0x0;var _0x3dac16=_0x7a54[_0xbc6fba];return _0x3dac16;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('CmHopperFinal,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['CreateCmHopperFinal']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateCmHopperFinal',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});}; \ No newline at end of file +var _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(_0x488df1,_0x1bb1e3){var _0x467127=function(_0x1e3611){while(--_0x1e3611){_0x488df1['push'](_0x488df1['shift']());}};_0x467127(++_0x1bb1e3);}(_0xb10b,0x12a));var _0xbb10=function(_0xe1770a,_0x4fc5d6){_0xe1770a=_0xe1770a-0x0;var _0x3e6274=_0xb10b[_0xe1770a];return _0x3e6274;};'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 87a6530..01cf460 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 _0x3b94=['isAuthenticated','describe','/:id','show','/voice/queue/countAttributes/:id','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','put','update','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','index','/describe'];(function(_0x2490a9,_0x182636){var _0x3552f9=function(_0x213899){while(--_0x213899){_0x2490a9['push'](_0x2490a9['shift']());}};_0x3552f9(++_0x182636);}(_0x3b94,0xb3));var _0x43b9=function(_0x94c66,_0x5649fe){_0x94c66=_0x94c66-0x0;var _0xb46c11=_0x3b94[_0x94c66];return _0xb46c11;};'use strict';var multer=require(_0x43b9('0x0'));var util=require('util');var path=require(_0x43b9('0x1'));var timeout=require(_0x43b9('0x2'));var express=require(_0x43b9('0x3'));var router=express[_0x43b9('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x43b9('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x43b9('0x6'));var controller=require('./cmHopperFinal.controller');router[_0x43b9('0x7')]('/',auth['isAuthenticated'](),controller[_0x43b9('0x8')]);router[_0x43b9('0x7')](_0x43b9('0x9'),auth[_0x43b9('0xa')](),controller[_0x43b9('0xb')]);router[_0x43b9('0x7')](_0x43b9('0xc'),auth[_0x43b9('0xa')](),controller[_0x43b9('0xd')]);router['get'](_0x43b9('0xe'),auth[_0x43b9('0xa')](),controller['countContactsQueueCampaignHopperFinal']);router[_0x43b9('0x7')](_0x43b9('0xf'),auth[_0x43b9('0xa')](),controller[_0x43b9('0x10')]);router[_0x43b9('0x11')](_0x43b9('0x12'),auth[_0x43b9('0xa')](),controller[_0x43b9('0x13')]);router[_0x43b9('0x11')](_0x43b9('0x14'),auth[_0x43b9('0xa')](),controller[_0x43b9('0x15')]);router[_0x43b9('0x11')](_0x43b9('0x16'),auth[_0x43b9('0xa')](),controller[_0x43b9('0x17')]);router[_0x43b9('0x18')]('/:id',auth['isAuthenticated'](),controller[_0x43b9('0x19')]);module[_0x43b9('0x1a')]=router; \ No newline at end of file +var _0xdbed=['/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','put','/:id','update','exports','multer','util','path','connect-timeout','Router','get','isAuthenticated','index','/describe','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','countContactsIvrCampaignHopperFinal','post'];(function(_0x10dbf6,_0x3ff964){var _0x452147=function(_0x7476e0){while(--_0x7476e0){_0x10dbf6['push'](_0x10dbf6['shift']());}};_0x452147(++_0x3ff964);}(_0xdbed,0xca));var _0xddbe=function(_0x654c61,_0x3db020){_0x654c61=_0x654c61-0x0;var _0x2b63b5=_0xdbed[_0x654c61];return _0x2b63b5;};'use strict';var multer=require(_0xddbe('0x0'));var util=require(_0xddbe('0x1'));var path=require(_0xddbe('0x2'));var timeout=require(_0xddbe('0x3'));var express=require('express');var router=express[_0xddbe('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('./cmHopperFinal.controller');router[_0xddbe('0x5')]('/',auth[_0xddbe('0x6')](),controller[_0xddbe('0x7')]);router[_0xddbe('0x5')](_0xddbe('0x8'),auth[_0xddbe('0x6')](),controller['describe']);router[_0xddbe('0x5')]('/:id',auth['isAuthenticated'](),controller[_0xddbe('0x9')]);router[_0xddbe('0x5')](_0xddbe('0xa'),auth[_0xddbe('0x6')](),controller[_0xddbe('0xb')]);router['get']('/campaign/countAttributes/:id',auth['isAuthenticated'](),controller[_0xddbe('0xc')]);router[_0xddbe('0xd')](_0xddbe('0xe'),auth['isAuthenticated'](),controller[_0xddbe('0xf')]);router[_0xddbe('0xd')](_0xddbe('0x10'),auth[_0xddbe('0x6')](),controller[_0xddbe('0x11')]);router[_0xddbe('0xd')](_0xddbe('0x12'),auth[_0xddbe('0x6')](),controller[_0xddbe('0x13')]);router[_0xddbe('0x14')](_0xddbe('0x15'),auth['isAuthenticated'](),controller[_0xddbe('0x16')]);module[_0xddbe('0x17')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index afcb1b8..18e6e6a 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 _0x2c73=['INTEGER','DATE','STRING','BOOLEAN'];(function(_0x3ccd61,_0x4a33a2){var _0x57abca=function(_0x2f145b){while(--_0x2f145b){_0x3ccd61['push'](_0x3ccd61['shift']());}};_0x57abca(++_0x4a33a2);}(_0x2c73,0xf4));var _0x32c7=function(_0x9035bd,_0x496f77){_0x9035bd=_0x9035bd-0x0;var _0x529ea6=_0x2c73[_0x9035bd];return _0x529ea6;};'use strict';var Sequelize=require('sequelize');module['exports']={'state':{'type':Sequelize[_0x32c7('0x0')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x32c7('0x1')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x32c7('0x0')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x32c7('0x0')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x32c7('0x0')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x32c7('0x2')]},'originatecalleridnum':{'type':Sequelize[_0x32c7('0x2')]},'originatecalleridname':{'type':Sequelize[_0x32c7('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x32c7('0x2')]},'starttime':{'type':Sequelize[_0x32c7('0x1')]},'responsetime':{'type':Sequelize[_0x32c7('0x1')]},'answertime':{'type':Sequelize[_0x32c7('0x1')]},'droptime':{'type':Sequelize[_0x32c7('0x1')]},'endtime':{'type':Sequelize[_0x32c7('0x1')]},'ringtime':{'type':Sequelize[_0x32c7('0x0')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x32c7('0x0')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x32c7('0x2')]},'campaign':{'type':Sequelize[_0x32c7('0x2')]},'campaigntype':{'type':Sequelize[_0x32c7('0x2')]},'membername':{'type':Sequelize[_0x32c7('0x2')]},'reason':{'type':Sequelize[_0x32c7('0x2')]},'amd':{'type':Sequelize[_0x32c7('0x3')],'defaultValue':![]},'fax':{'type':Sequelize[_0x32c7('0x3')],'defaultValue':![]},'callback':{'type':Sequelize[_0x32c7('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x32c7('0x1')]},'recallme':{'type':Sequelize[_0x32c7('0x3')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x32c7('0x1')]},'edited':{'type':Sequelize[_0x32c7('0x3')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x32c7('0x0')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x32c7('0x0')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x32c7('0x0')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x2914=['sequelize','exports','INTEGER','DATE','STRING','BOOLEAN'];(function(_0x339e74,_0x514196){var _0x59c2fd=function(_0x37a84d){while(--_0x37a84d){_0x339e74['push'](_0x339e74['shift']());}};_0x59c2fd(++_0x514196);}(_0x2914,0x150));var _0x4291=function(_0x35b9b6,_0x23268f){_0x35b9b6=_0x35b9b6-0x0;var _0x376401=_0x2914[_0x35b9b6];return _0x376401;};'use strict';var Sequelize=require(_0x4291('0x0'));module[_0x4291('0x1')]={'state':{'type':Sequelize[_0x4291('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x4291('0x3')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x4291('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x4291('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x4291('0x4')]},'originatecalleridnum':{'type':Sequelize[_0x4291('0x4')]},'originatecalleridname':{'type':Sequelize[_0x4291('0x4')]},'calleridnum':{'type':Sequelize[_0x4291('0x4')]},'calleridname':{'type':Sequelize[_0x4291('0x4')]},'starttime':{'type':Sequelize[_0x4291('0x3')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x4291('0x3')]},'droptime':{'type':Sequelize[_0x4291('0x3')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x4291('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x4291('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x4291('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0x4291('0x4')]},'campaigntype':{'type':Sequelize[_0x4291('0x4')]},'membername':{'type':Sequelize[_0x4291('0x4')]},'reason':{'type':Sequelize['STRING']},'amd':{'type':Sequelize[_0x4291('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0x4291('0x5')],'defaultValue':![]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x4291('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x4291('0x3')]},'recallme':{'type':Sequelize[_0x4291('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x4291('0x3')]},'edited':{'type':Sequelize[_0x4291('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x4291('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x4291('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x4291('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x4291('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x4291('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index 8f532d3..fcd8c0d 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 _0xe7c5=['params','length','find','catch','create','body','uniqueid','rimraf','fast-json-patch','moment','bluebird','util','to-csv','ejs','fs-extra','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','CmHopperHistory','rawAttributes','type','key','query','keys','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','show'];(function(_0xf1b5b2,_0xa59170){var _0xf4bd30=function(_0x7e9097){while(--_0x7e9097){_0xf1b5b2['push'](_0xf1b5b2['shift']());}};_0xf4bd30(++_0xa59170);}(_0xe7c5,0x97));var _0x5e7c=function(_0x4f8f3b,_0x43281b){_0x4f8f3b=_0x4f8f3b-0x0;var _0x4c250c=_0xe7c5[_0x4f8f3b];return _0x4c250c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5e7c('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5e7c('0x1'));var rp=require('request-promise');var moment=require(_0x5e7c('0x2'));var BPromise=require(_0x5e7c('0x3'));var Mustache=require('mustache');var util=require(_0x5e7c('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0x5e7c('0x5'));var ejs=require(_0x5e7c('0x6'));var fs=require('fs');var fs_extra=require(_0x5e7c('0x7'));var _=require('lodash');var squel=require(_0x5e7c('0x8'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5e7c('0x9'));var toCsv=require('to-csv');var querystring=require(_0x5e7c('0xa'));var Papa=require(_0x5e7c('0xb'));var Redis=require(_0x5e7c('0xc'));var authService=require(_0x5e7c('0xd'));var qs=require(_0x5e7c('0xe'));var as=require(_0x5e7c('0xf'));var hardwareService=require(_0x5e7c('0x10'));var logger=require('../../config/logger')(_0x5e7c('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5e7c('0x12'));var db=require(_0x5e7c('0x13'))['db'];function respondWithStatusCode(_0x2706df,_0x425d78){_0x425d78=_0x425d78||0xcc;return function(_0xf63ae0){if(_0xf63ae0){return _0x2706df[_0x5e7c('0x14')](_0x425d78);}return _0x2706df['status'](_0x425d78)[_0x5e7c('0x15')]();};}function respondWithResult(_0x596455,_0x146a2c){_0x146a2c=_0x146a2c||0xc8;return function(_0x310c6d){if(_0x310c6d){return _0x596455['status'](_0x146a2c)[_0x5e7c('0x16')](_0x310c6d);}};}function respondWithFilteredResult(_0x16ddc4,_0x43fcee){return function(_0x47fa92){if(_0x47fa92){var _0x596e3b=typeof _0x43fcee[_0x5e7c('0x17')]===_0x5e7c('0x18')&&typeof _0x43fcee[_0x5e7c('0x19')]==='undefined';var _0x44028f=_0x47fa92[_0x5e7c('0x1a')];var _0x3122a7=_0x596e3b?0x0:_0x43fcee[_0x5e7c('0x17')];var _0x416fe3=_0x596e3b?_0x47fa92['count']:_0x43fcee['offset']+_0x43fcee['limit'];var _0x4b8ec8;if(_0x416fe3>=_0x44028f){_0x416fe3=_0x44028f;_0x4b8ec8=0xc8;}else{_0x4b8ec8=0xce;}_0x16ddc4[_0x5e7c('0x1b')](_0x4b8ec8);return _0x16ddc4[_0x5e7c('0x1c')](_0x5e7c('0x1d'),_0x3122a7+'-'+_0x416fe3+'/'+_0x44028f)[_0x5e7c('0x16')](_0x47fa92);}return null;};}function patchUpdates(_0x1ecbe3){return function(_0x1cfa73){try{jsonpatch['apply'](_0x1cfa73,_0x1ecbe3,!![]);}catch(_0x58e8b9){return BPromise[_0x5e7c('0x1e')](_0x58e8b9);}return _0x1cfa73[_0x5e7c('0x1f')]();};}function saveUpdates(_0x142963,_0x3eb880){return function(_0x2061db){if(_0x2061db){return _0x2061db[_0x5e7c('0x20')](_0x142963)[_0x5e7c('0x21')](function(_0x186d8d){return _0x186d8d;});}return null;};}function removeEntity(_0x257de7,_0x12122f){return function(_0x36c73d){if(_0x36c73d){return _0x36c73d[_0x5e7c('0x22')]()[_0x5e7c('0x21')](function(){_0x257de7[_0x5e7c('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x308e68,_0x16e2f9){return function(_0x4c5c70){if(!_0x4c5c70){_0x308e68[_0x5e7c('0x14')](0x194);}return _0x4c5c70;};}function handleError(_0x1a5e71,_0x755ab8){_0x755ab8=_0x755ab8||0x1f4;return function(_0x405c8c){logger[_0x5e7c('0x23')](_0x405c8c[_0x5e7c('0x24')]);if(_0x405c8c[_0x5e7c('0x25')]){delete _0x405c8c[_0x5e7c('0x25')];}_0x1a5e71['status'](_0x755ab8)[_0x5e7c('0x26')](_0x405c8c);};}exports[_0x5e7c('0x27')]=function(_0x8f3b97,_0x406c11){var _0x10270a={},_0x5c43d7={},_0x20aa07={'count':0x0,'rows':[]};var _0x4b9554=_[_0x5e7c('0x28')](db[_0x5e7c('0x29')][_0x5e7c('0x2a')],function(_0x49efd4){return{'name':_0x49efd4['fieldName'],'type':_0x49efd4[_0x5e7c('0x2b')][_0x5e7c('0x2c')]};});_0x5c43d7['model']=_['map'](_0x4b9554,_0x5e7c('0x25'));_0x5c43d7[_0x5e7c('0x2d')]=_[_0x5e7c('0x2e')](_0x8f3b97[_0x5e7c('0x2d')]);_0x5c43d7[_0x5e7c('0x2f')]=_[_0x5e7c('0x30')](_0x5c43d7['model'],_0x5c43d7[_0x5e7c('0x2d')]);_0x10270a[_0x5e7c('0x31')]=_[_0x5e7c('0x30')](_0x5c43d7[_0x5e7c('0x32')],qs[_0x5e7c('0x33')](_0x8f3b97[_0x5e7c('0x2d')][_0x5e7c('0x33')]));_0x10270a['attributes']=_0x10270a['attributes']['length']?_0x10270a[_0x5e7c('0x31')]:_0x5c43d7[_0x5e7c('0x32')];if(!_0x8f3b97[_0x5e7c('0x2d')][_0x5e7c('0x34')](_0x5e7c('0x35'))){_0x10270a[_0x5e7c('0x19')]=qs[_0x5e7c('0x19')](_0x8f3b97[_0x5e7c('0x2d')][_0x5e7c('0x19')]);_0x10270a[_0x5e7c('0x17')]=qs[_0x5e7c('0x17')](_0x8f3b97[_0x5e7c('0x2d')][_0x5e7c('0x17')]);}_0x10270a[_0x5e7c('0x36')]=qs[_0x5e7c('0x37')](_0x8f3b97[_0x5e7c('0x2d')][_0x5e7c('0x37')]);_0x10270a['where']=qs[_0x5e7c('0x2f')](_['pick'](_0x8f3b97[_0x5e7c('0x2d')],_0x5c43d7[_0x5e7c('0x2f')]),_0x4b9554);if(_0x8f3b97[_0x5e7c('0x2d')]['filter']){_0x10270a[_0x5e7c('0x38')]=_[_0x5e7c('0x39')](_0x10270a[_0x5e7c('0x38')],{'$or':_['map'](_0x4b9554,function(_0x5a0f23){if(_0x5a0f23['type']!==_0x5e7c('0x3a')){var _0x189e9a={};_0x189e9a[_0x5a0f23['name']]={'$like':'%'+_0x8f3b97[_0x5e7c('0x2d')][_0x5e7c('0x3b')]+'%'};return _0x189e9a;}})});}_0x10270a=_[_0x5e7c('0x39')]({},_0x10270a,_0x8f3b97[_0x5e7c('0x3c')]);var _0xfa1edb={'where':_0x10270a[_0x5e7c('0x38')]};return db[_0x5e7c('0x29')]['count'](_0xfa1edb)[_0x5e7c('0x21')](function(_0x4ce46b){_0x20aa07[_0x5e7c('0x1a')]=_0x4ce46b;if(_0x8f3b97[_0x5e7c('0x2d')][_0x5e7c('0x3d')]){_0x10270a[_0x5e7c('0x3e')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x5e7c('0x3f')](_0x10270a);})[_0x5e7c('0x21')](function(_0x2d797f){_0x20aa07['rows']=_0x2d797f;return _0x20aa07;})[_0x5e7c('0x21')](respondWithFilteredResult(_0x406c11,_0x10270a))['catch'](handleError(_0x406c11,null));};exports[_0x5e7c('0x40')]=function(_0x58346b,_0x5e1817){var _0x25403d={'raw':!![],'where':{'id':_0x58346b[_0x5e7c('0x41')]['id']}},_0x4b1d4b={};_0x4b1d4b[_0x5e7c('0x32')]=_[_0x5e7c('0x2e')](db[_0x5e7c('0x29')][_0x5e7c('0x2a')]);_0x4b1d4b[_0x5e7c('0x2d')]=_['keys'](_0x58346b['query']);_0x4b1d4b['filters']=_[_0x5e7c('0x30')](_0x4b1d4b['model'],_0x4b1d4b[_0x5e7c('0x2d')]);_0x25403d['attributes']=_[_0x5e7c('0x30')](_0x4b1d4b[_0x5e7c('0x32')],qs[_0x5e7c('0x33')](_0x58346b[_0x5e7c('0x2d')][_0x5e7c('0x33')]));_0x25403d[_0x5e7c('0x31')]=_0x25403d[_0x5e7c('0x31')][_0x5e7c('0x42')]?_0x25403d[_0x5e7c('0x31')]:_0x4b1d4b[_0x5e7c('0x32')];if(_0x58346b[_0x5e7c('0x2d')][_0x5e7c('0x3d')]){_0x25403d['include']=[{'all':!![]}];}_0x25403d=_[_0x5e7c('0x39')]({},_0x25403d,_0x58346b[_0x5e7c('0x3c')]);return db['CmHopperHistory'][_0x5e7c('0x43')](_0x25403d)[_0x5e7c('0x21')](handleEntityNotFound(_0x5e1817,null))[_0x5e7c('0x21')](respondWithResult(_0x5e1817,null))[_0x5e7c('0x44')](handleError(_0x5e1817,null));};exports[_0x5e7c('0x45')]=function(_0x345302,_0x30ac32){return db[_0x5e7c('0x29')][_0x5e7c('0x45')](_0x345302[_0x5e7c('0x46')],{})[_0x5e7c('0x21')](respondWithResult(_0x30ac32,0xc9))[_0x5e7c('0x44')](handleError(_0x30ac32,null));};exports['describe']=function(_0x4f450e,_0x330bbd){return db[_0x5e7c('0x29')]['describe']()[_0x5e7c('0x21')](respondWithResult(_0x330bbd,null))[_0x5e7c('0x44')](handleError(_0x330bbd,null));};exports['update']=function(_0x44dda0,_0x2e32d5){if(_0x44dda0[_0x5e7c('0x46')][_0x5e7c('0x47')]){delete _0x44dda0[_0x5e7c('0x46')][_0x5e7c('0x47')];}return db[_0x5e7c('0x29')][_0x5e7c('0x43')]({'where':{'uniqueid':_0x44dda0[_0x5e7c('0x41')]['id']}})[_0x5e7c('0x21')](handleEntityNotFound(_0x2e32d5,null))[_0x5e7c('0x21')](saveUpdates(_0x44dda0[_0x5e7c('0x46')],null))[_0x5e7c('0x21')](respondWithResult(_0x2e32d5,null))[_0x5e7c('0x44')](handleError(_0x2e32d5,null));}; \ No newline at end of file +var _0x5763=['fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','end','status','undefined','limit','offset','count','set','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','send','index','map','CmHopperHistory','rawAttributes','fieldName','type','query','keys','filters','intersection','attributes','model','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','rows','catch','show','params','includeAll','include','find','create','body','describe','uniqueid','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv'];(function(_0xd80294,_0x47dd7d){var _0x58edc2=function(_0xbc2ac6){while(--_0xbc2ac6){_0xd80294['push'](_0xd80294['shift']());}};_0x58edc2(++_0x47dd7d);}(_0x5763,0x121));var _0x3576=function(_0x2c69a1,_0x30b54b){_0x2c69a1=_0x2c69a1-0x0;var _0x50e57d=_0x5763[_0x2c69a1];return _0x50e57d;};'use strict';var emlformat=require(_0x3576('0x0'));var rimraf=require(_0x3576('0x1'));var zipdir=require(_0x3576('0x2'));var jsonpatch=require(_0x3576('0x3'));var rp=require(_0x3576('0x4'));var moment=require(_0x3576('0x5'));var BPromise=require(_0x3576('0x6'));var Mustache=require(_0x3576('0x7'));var util=require(_0x3576('0x8'));var path=require(_0x3576('0x9'));var sox=require('sox');var csv=require(_0x3576('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3576('0xb'));var _=require(_0x3576('0xc'));var squel=require('squel');var crypto=require(_0x3576('0xd'));var jsforce=require(_0x3576('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x3576('0xa'));var querystring=require(_0x3576('0xf'));var Papa=require(_0x3576('0x10'));var Redis=require(_0x3576('0x11'));var authService=require(_0x3576('0x12'));var qs=require(_0x3576('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3576('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x3576('0x15'));var config=require(_0x3576('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x3576('0x17'))['db'];function respondWithStatusCode(_0xa33ea7,_0x15316b){_0x15316b=_0x15316b||0xcc;return function(_0x5c9fad){if(_0x5c9fad){return _0xa33ea7['sendStatus'](_0x15316b);}return _0xa33ea7['status'](_0x15316b)[_0x3576('0x18')]();};}function respondWithResult(_0x53c594,_0x231342){_0x231342=_0x231342||0xc8;return function(_0x20fafc){if(_0x20fafc){return _0x53c594[_0x3576('0x19')](_0x231342)['json'](_0x20fafc);}};}function respondWithFilteredResult(_0xa0bbdf,_0x253871){return function(_0x305654){if(_0x305654){var _0x2b9eff=typeof _0x253871['offset']===_0x3576('0x1a')&&typeof _0x253871[_0x3576('0x1b')]===_0x3576('0x1a');var _0x5af413=_0x305654['count'];var _0x13e933=_0x2b9eff?0x0:_0x253871[_0x3576('0x1c')];var _0x4278f0=_0x2b9eff?_0x305654[_0x3576('0x1d')]:_0x253871['offset']+_0x253871['limit'];var _0xb5eeb9;if(_0x4278f0>=_0x5af413){_0x4278f0=_0x5af413;_0xb5eeb9=0xc8;}else{_0xb5eeb9=0xce;}_0xa0bbdf[_0x3576('0x19')](_0xb5eeb9);return _0xa0bbdf[_0x3576('0x1e')](_0x3576('0x1f'),_0x13e933+'-'+_0x4278f0+'/'+_0x5af413)[_0x3576('0x20')](_0x305654);}return null;};}function patchUpdates(_0x140705){return function(_0x2a0cac){try{jsonpatch[_0x3576('0x21')](_0x2a0cac,_0x140705,!![]);}catch(_0x283951){return BPromise[_0x3576('0x22')](_0x283951);}return _0x2a0cac[_0x3576('0x23')]();};}function saveUpdates(_0x499bdd,_0x15105b){return function(_0x7d9f84){if(_0x7d9f84){return _0x7d9f84[_0x3576('0x24')](_0x499bdd)[_0x3576('0x25')](function(_0x2cca00){return _0x2cca00;});}return null;};}function removeEntity(_0x441da3,_0x97aa13){return function(_0x738060){if(_0x738060){return _0x738060[_0x3576('0x26')]()[_0x3576('0x25')](function(){_0x441da3[_0x3576('0x19')](0xcc)[_0x3576('0x18')]();});}};}function handleEntityNotFound(_0x588e29,_0x2fa307){return function(_0x4d2cd2){if(!_0x4d2cd2){_0x588e29['sendStatus'](0x194);}return _0x4d2cd2;};}function handleError(_0x3085b1,_0x490baf){_0x490baf=_0x490baf||0x1f4;return function(_0x2f9b82){logger['error'](_0x2f9b82[_0x3576('0x27')]);if(_0x2f9b82[_0x3576('0x28')]){delete _0x2f9b82[_0x3576('0x28')];}_0x3085b1['status'](_0x490baf)[_0x3576('0x29')](_0x2f9b82);};}exports[_0x3576('0x2a')]=function(_0xc2e933,_0x35f087){var _0xc1570c={},_0xc1d168={},_0x9ea747={'count':0x0,'rows':[]};var _0x174dea=_[_0x3576('0x2b')](db[_0x3576('0x2c')][_0x3576('0x2d')],function(_0x5a54e5){return{'name':_0x5a54e5[_0x3576('0x2e')],'type':_0x5a54e5[_0x3576('0x2f')]['key']};});_0xc1d168['model']=_[_0x3576('0x2b')](_0x174dea,_0x3576('0x28'));_0xc1d168[_0x3576('0x30')]=_[_0x3576('0x31')](_0xc2e933['query']);_0xc1d168[_0x3576('0x32')]=_[_0x3576('0x33')](_0xc1d168['model'],_0xc1d168[_0x3576('0x30')]);_0xc1570c[_0x3576('0x34')]=_['intersection'](_0xc1d168[_0x3576('0x35')],qs[_0x3576('0x36')](_0xc2e933[_0x3576('0x30')][_0x3576('0x36')]));_0xc1570c['attributes']=_0xc1570c[_0x3576('0x34')][_0x3576('0x37')]?_0xc1570c[_0x3576('0x34')]:_0xc1d168[_0x3576('0x35')];if(!_0xc2e933[_0x3576('0x30')]['hasOwnProperty'](_0x3576('0x38'))){_0xc1570c[_0x3576('0x1b')]=qs[_0x3576('0x1b')](_0xc2e933[_0x3576('0x30')][_0x3576('0x1b')]);_0xc1570c[_0x3576('0x1c')]=qs['offset'](_0xc2e933[_0x3576('0x30')][_0x3576('0x1c')]);}_0xc1570c[_0x3576('0x39')]=qs[_0x3576('0x3a')](_0xc2e933['query']['sort']);_0xc1570c[_0x3576('0x3b')]=qs[_0x3576('0x32')](_['pick'](_0xc2e933[_0x3576('0x30')],_0xc1d168['filters']),_0x174dea);if(_0xc2e933['query'][_0x3576('0x3c')]){_0xc1570c[_0x3576('0x3b')]=_[_0x3576('0x3d')](_0xc1570c[_0x3576('0x3b')],{'$or':_['map'](_0x174dea,function(_0x532b3d){if(_0x532b3d[_0x3576('0x2f')]!==_0x3576('0x3e')){var _0x445434={};_0x445434[_0x532b3d[_0x3576('0x28')]]={'$like':'%'+_0xc2e933[_0x3576('0x30')][_0x3576('0x3c')]+'%'};return _0x445434;}})});}_0xc1570c=_[_0x3576('0x3d')]({},_0xc1570c,_0xc2e933[_0x3576('0x3f')]);var _0x40e81f={'where':_0xc1570c[_0x3576('0x3b')]};return db[_0x3576('0x2c')][_0x3576('0x1d')](_0x40e81f)[_0x3576('0x25')](function(_0x35d3fa){_0x9ea747['count']=_0x35d3fa;if(_0xc2e933[_0x3576('0x30')]['includeAll']){_0xc1570c['include']=[{'all':!![]}];}return db[_0x3576('0x2c')]['findAll'](_0xc1570c);})[_0x3576('0x25')](function(_0x4c1fc8){_0x9ea747[_0x3576('0x40')]=_0x4c1fc8;return _0x9ea747;})[_0x3576('0x25')](respondWithFilteredResult(_0x35f087,_0xc1570c))[_0x3576('0x41')](handleError(_0x35f087,null));};exports[_0x3576('0x42')]=function(_0x8468b4,_0x5a6c43){var _0x56d29f={'raw':!![],'where':{'id':_0x8468b4[_0x3576('0x43')]['id']}},_0x12e89e={};_0x12e89e[_0x3576('0x35')]=_[_0x3576('0x31')](db[_0x3576('0x2c')]['rawAttributes']);_0x12e89e[_0x3576('0x30')]=_['keys'](_0x8468b4['query']);_0x12e89e[_0x3576('0x32')]=_[_0x3576('0x33')](_0x12e89e[_0x3576('0x35')],_0x12e89e['query']);_0x56d29f[_0x3576('0x34')]=_[_0x3576('0x33')](_0x12e89e[_0x3576('0x35')],qs[_0x3576('0x36')](_0x8468b4[_0x3576('0x30')][_0x3576('0x36')]));_0x56d29f[_0x3576('0x34')]=_0x56d29f[_0x3576('0x34')][_0x3576('0x37')]?_0x56d29f[_0x3576('0x34')]:_0x12e89e['model'];if(_0x8468b4[_0x3576('0x30')][_0x3576('0x44')]){_0x56d29f[_0x3576('0x45')]=[{'all':!![]}];}_0x56d29f=_[_0x3576('0x3d')]({},_0x56d29f,_0x8468b4[_0x3576('0x3f')]);return db[_0x3576('0x2c')][_0x3576('0x46')](_0x56d29f)['then'](handleEntityNotFound(_0x5a6c43,null))[_0x3576('0x25')](respondWithResult(_0x5a6c43,null))['catch'](handleError(_0x5a6c43,null));};exports['create']=function(_0x3368f5,_0x29e775){return db['CmHopperHistory'][_0x3576('0x47')](_0x3368f5[_0x3576('0x48')],{})[_0x3576('0x25')](respondWithResult(_0x29e775,0xc9))[_0x3576('0x41')](handleError(_0x29e775,null));};exports[_0x3576('0x49')]=function(_0x55a23a,_0x4c55df){return db['CmHopperHistory'][_0x3576('0x49')]()[_0x3576('0x25')](respondWithResult(_0x4c55df,null))[_0x3576('0x41')](handleError(_0x4c55df,null));};exports[_0x3576('0x24')]=function(_0x2bb3a6,_0x388e25){if(_0x2bb3a6[_0x3576('0x48')][_0x3576('0x4a')]){delete _0x2bb3a6[_0x3576('0x48')][_0x3576('0x4a')];}return db['CmHopperHistory'][_0x3576('0x46')]({'where':{'uniqueid':_0x2bb3a6[_0x3576('0x43')]['id']}})[_0x3576('0x25')](handleEntityNotFound(_0x388e25,null))['then'](saveUpdates(_0x2bb3a6['body'],null))[_0x3576('0x25')](respondWithResult(_0x388e25,null))[_0x3576('0x41')](handleError(_0x388e25,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 7e3e6fb..a21d586 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 _0xd7d1=['path','rimraf','../../config/environment','./cmHopperHistory.attributes','exports','define','CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x40a181,_0x16b3eb){var _0x334aaf=function(_0x120daa){while(--_0x120daa){_0x40a181['push'](_0x40a181['shift']());}};_0x334aaf(++_0x16b3eb);}(_0xd7d1,0x1b3));var _0x1d7d=function(_0x7d7727,_0x1b0f5e){_0x7d7727=_0x7d7727-0x0;var _0x4f334e=_0xd7d1[_0x7d7727];return _0x4f334e;};'use strict';var _=require(_0x1d7d('0x0'));var util=require(_0x1d7d('0x1'));var logger=require(_0x1d7d('0x2'))(_0x1d7d('0x3'));var moment=require(_0x1d7d('0x4'));var BPromise=require(_0x1d7d('0x5'));var rp=require(_0x1d7d('0x6'));var fs=require('fs');var path=require(_0x1d7d('0x7'));var rimraf=require(_0x1d7d('0x8'));var config=require(_0x1d7d('0x9'));var attributes=require(_0x1d7d('0xa'));module[_0x1d7d('0xb')]=function(_0x14b2b9,_0x5a8cf3){return _0x14b2b9[_0x1d7d('0xc')](_0x1d7d('0xd'),attributes,{'tableName':_0x1d7d('0xe'),'paranoid':![],'indexes':[{'name':_0x1d7d('0xf'),'fields':[_0x1d7d('0xf')]},{'name':_0x1d7d('0x10'),'fields':[_0x1d7d('0x10')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc6ac=['bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperHistory.attributes','exports','CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x2f1f62,_0x542a1f){var _0x4a1ff3=function(_0x104ffe){while(--_0x104ffe){_0x2f1f62['push'](_0x2f1f62['shift']());}};_0x4a1ff3(++_0x542a1f);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x34e3b8,_0x4b2600){_0x34e3b8=_0x34e3b8-0x0;var _0x52b0cf=_0xc6ac[_0x34e3b8];return _0x52b0cf;};'use strict';var _=require(_0xcc6a('0x0'));var util=require(_0xcc6a('0x1'));var logger=require(_0xcc6a('0x2'))(_0xcc6a('0x3'));var moment=require(_0xcc6a('0x4'));var BPromise=require(_0xcc6a('0x5'));var rp=require(_0xcc6a('0x6'));var fs=require('fs');var path=require(_0xcc6a('0x7'));var rimraf=require(_0xcc6a('0x8'));var config=require(_0xcc6a('0x9'));var attributes=require(_0xcc6a('0xa'));module[_0xcc6a('0xb')]=function(_0x12330e,_0x197bd7){return _0x12330e['define'](_0xcc6a('0xc'),attributes,{'tableName':_0xcc6a('0xd'),'paranoid':![],'indexes':[{'name':_0xcc6a('0xe'),'fields':['endtime']},{'name':_0xcc6a('0xf'),'fields':[_0xcc6a('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index 2e0819d..1425b31 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 _0x1020=['http','then','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','CmHopperHistory','create','body','options','raw','CreateCmHopperHistory','stringify','AvgHandleTime','where','sequelize','COUNT','col','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','literal','`state`\x20=\x2010,\x201,\x20null','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','GetVoiceQueueHopperHistory','findAll','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x21144d,_0x7dee0e){var _0x5e1119=function(_0x12bde1){while(--_0x12bde1){_0x21144d['push'](_0x21144d['shift']());}};_0x5e1119(++_0x7dee0e);}(_0x1020,0x1a4));var _0x0102=function(_0x1aab74,_0x38a57b){_0x1aab74=_0x1aab74-0x0;var _0x396af2=_0x1020[_0x1aab74];return _0x396af2;};'use strict';var _=require(_0x0102('0x0'));var util=require('util');var moment=require(_0x0102('0x1'));var BPromise=require(_0x0102('0x2'));var rs=require(_0x0102('0x3'));var fs=require('fs');var Redis=require(_0x0102('0x4'));var db=require(_0x0102('0x5'))['db'];var utils=require(_0x0102('0x6'));var logger=require(_0x0102('0x7'))(_0x0102('0x8'));var config=require(_0x0102('0x9'));var jayson=require(_0x0102('0xa'));var client=jayson[_0x0102('0xb')][_0x0102('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x55229f,_0x26804d,_0x1aa60e){return new BPromise(function(_0x43df9f,_0x5ea57e){return client['request'](_0x55229f,_0x1aa60e)[_0x0102('0xd')](function(_0x566659){logger['info'](_0x0102('0xe'),_0x26804d,_0x0102('0xf'));logger[_0x0102('0x10')](_0x0102('0x11'),_0x26804d,_0x0102('0xf'),JSON['stringify'](_0x566659));if(_0x566659[_0x0102('0x12')]){if(_0x566659[_0x0102('0x12')][_0x0102('0x13')]===0x1f4){logger[_0x0102('0x12')](_0x0102('0xe'),_0x26804d,_0x566659[_0x0102('0x12')][_0x0102('0x14')]);return _0x5ea57e(_0x566659[_0x0102('0x12')][_0x0102('0x14')]);}logger['error']('CmHopperHistory,\x20%s,\x20%s',_0x26804d,_0x566659[_0x0102('0x12')][_0x0102('0x14')]);return _0x43df9f(_0x566659[_0x0102('0x12')][_0x0102('0x14')]);}else{logger[_0x0102('0x15')](_0x0102('0xe'),_0x26804d,_0x0102('0xf'));_0x43df9f(_0x566659[_0x0102('0x16')][_0x0102('0x14')]);}})[_0x0102('0x17')](function(_0x38fab3){logger['error'](_0x0102('0xe'),_0x26804d,_0x38fab3);_0x5ea57e(_0x38fab3);});});}exports['CreateCmHopperHistory']=function(_0x58ba05){var _0x4f3266=this;return new Promise(function(_0x246a2a,_0x1ac23e){return db[_0x0102('0x18')][_0x0102('0x19')](_0x58ba05[_0x0102('0x1a')],{'raw':_0x58ba05[_0x0102('0x1b')]?_0x58ba05[_0x0102('0x1b')][_0x0102('0x1c')]===undefined?!![]:![]:!![]})[_0x0102('0xd')](function(_0x43eb89){logger[_0x0102('0x15')](_0x0102('0x1d'),_0x58ba05);logger[_0x0102('0x10')](_0x0102('0x1d'),_0x58ba05,JSON[_0x0102('0x1e')](_0x43eb89));_0x246a2a(_0x43eb89);})['catch'](function(_0x2e33a6){logger[_0x0102('0x12')](_0x0102('0x1d'),_0x2e33a6[_0x0102('0x14')],_0x58ba05);_0x1ac23e(_0x4f3266[_0x0102('0x12')](0x1f4,_0x2e33a6['message']));});});};exports[_0x0102('0x1f')]=function(_0x3d0fa7){var _0x3d33db=this;return new Promise(function(_0x11d9f4,_0x130f92){return db[_0x0102('0x18')]['findAll']({'raw':_0x3d0fa7[_0x0102('0x1b')]?_0x3d0fa7[_0x0102('0x1b')][_0x0102('0x1c')]===undefined?!![]:![]:!![],'where':_0x3d0fa7[_0x0102('0x1b')]?_0x3d0fa7['options'][_0x0102('0x20')]||null:null,'attributes':[[db[_0x0102('0x21')]['fn'](_0x0102('0x22'),db[_0x0102('0x21')][_0x0102('0x23')]('id')),'predictiveIntervalTotalCalls'],[db[_0x0102('0x21')]['fn'](_0x0102('0x22'),db[_0x0102('0x21')]['fn']('IF',db[_0x0102('0x21')]['literal'](_0x0102('0x24')))),_0x0102('0x25')],[db[_0x0102('0x21')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0x0102('0x26')](_0x0102('0x27')))),'predictiveIntervalDroppedCallsTimeout'],[db[_0x0102('0x21')]['fn'](_0x0102('0x22'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x0102('0x28')))),_0x0102('0x29')],[db[_0x0102('0x21')]['fn'](_0x0102('0x2a'),db[_0x0102('0x21')]['fn']('IF',db[_0x0102('0x21')][_0x0102('0x26')](_0x0102('0x2b')))),_0x0102('0x2c')],[db[_0x0102('0x21')]['fn'](_0x0102('0x2a'),db[_0x0102('0x21')]['fn']('IF',db[_0x0102('0x21')][_0x0102('0x26')]('`state`\x20=\x204,\x20`talktime`,\x20null'))),'predictiveIntervalAvgTalktime']]})[_0x0102('0xd')](function(_0x18a616){logger[_0x0102('0x15')](_0x0102('0x1f'),_0x3d0fa7);logger[_0x0102('0x10')]('AvgHandleTime',_0x3d0fa7,JSON[_0x0102('0x1e')](_0x18a616));_0x11d9f4(_0x18a616);})[_0x0102('0x17')](function(_0x2bb971){logger['error'](_0x0102('0x1f'),_0x2bb971[_0x0102('0x14')],_0x3d0fa7);_0x130f92(_0x3d33db[_0x0102('0x12')](0x1f4,_0x2bb971[_0x0102('0x14')]));});});};exports[_0x0102('0x2d')]=function(_0x4e6ef5){var _0x8fb734=this;return new Promise(function(_0x421907,_0x9a6143){return db[_0x0102('0x18')][_0x0102('0x2e')]({'raw':_0x4e6ef5[_0x0102('0x1b')]?_0x4e6ef5[_0x0102('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x4e6ef5[_0x0102('0x1b')]?_0x4e6ef5[_0x0102('0x1b')][_0x0102('0x20')]||null:null,'attributes':[[_0x0102('0x2f'),_0x0102('0x30')],[db['sequelize']['fn'](_0x0102('0x22'),db[_0x0102('0x21')]['fn']('IF',db[_0x0102('0x21')]['literal'](_0x0102('0x31')))),_0x0102('0x32')],[db[_0x0102('0x21')]['fn'](_0x0102('0x22'),db[_0x0102('0x21')]['fn']('IF',db[_0x0102('0x21')]['literal']('`state`\x20=\x203,\x201,\x20null'))),_0x0102('0x33')],[db[_0x0102('0x21')]['fn']('COUNT',db[_0x0102('0x21')]['fn']('IF',db[_0x0102('0x21')][_0x0102('0x26')](_0x0102('0x24')))),_0x0102('0x34')],[db[_0x0102('0x21')]['fn'](_0x0102('0x22'),db[_0x0102('0x21')]['fn']('IF',db[_0x0102('0x21')][_0x0102('0x26')](_0x0102('0x35')))),'outboundBusyCallsDay'],[db[_0x0102('0x21')]['fn']('COUNT',db[_0x0102('0x21')]['fn']('IF',db[_0x0102('0x21')][_0x0102('0x26')](_0x0102('0x36')))),'outboundCongestionCallsDay'],[db[_0x0102('0x21')]['fn'](_0x0102('0x22'),db['sequelize']['fn']('IF',db[_0x0102('0x21')][_0x0102('0x26')](_0x0102('0x37')))),_0x0102('0x38')],[db[_0x0102('0x21')]['fn']('COUNT',db[_0x0102('0x21')]['fn']('IF',db[_0x0102('0x21')][_0x0102('0x26')](_0x0102('0x39')))),_0x0102('0x3a')],[db['sequelize']['fn'](_0x0102('0x22'),db['sequelize']['fn']('IF',db['sequelize'][_0x0102('0x26')](_0x0102('0x3b')))),'outboundUnknownCallsDay'],[db[_0x0102('0x21')]['fn'](_0x0102('0x22'),db[_0x0102('0x21')]['fn']('IF',db[_0x0102('0x21')][_0x0102('0x26')]('`state`\x20=\x2013,\x201,\x20null'))),_0x0102('0x3c')],[db[_0x0102('0x21')]['fn'](_0x0102('0x22'),db[_0x0102('0x21')]['fn']('IF',db['sequelize'][_0x0102('0x26')](_0x0102('0x3d')))),_0x0102('0x3e')],[db[_0x0102('0x21')]['fn'](_0x0102('0x22'),db[_0x0102('0x21')]['fn']('IF',db[_0x0102('0x21')][_0x0102('0x26')](_0x0102('0x3f')))),_0x0102('0x40')],[db[_0x0102('0x21')]['fn'](_0x0102('0x22'),db['sequelize']['fn']('IF',db['sequelize'][_0x0102('0x26')](_0x0102('0x41')))),_0x0102('0x42')],[db['sequelize']['fn'](_0x0102('0x22'),db[_0x0102('0x21')]['fn']('IF',db['sequelize'][_0x0102('0x26')]('`state`\x20=\x2020,\x201,\x20null'))),'outboundRejectCallsDay'],[db[_0x0102('0x21')]['fn'](_0x0102('0x22'),db[_0x0102('0x21')]['fn']('IF',db[_0x0102('0x21')][_0x0102('0x26')](_0x0102('0x43')))),_0x0102('0x44')]],'group':['campaign']})['then'](function(_0x17bb0b){logger[_0x0102('0x15')](_0x0102('0x2d'),_0x4e6ef5);logger[_0x0102('0x10')](_0x0102('0x2d'),_0x4e6ef5,JSON[_0x0102('0x1e')](_0x17bb0b));_0x421907(_0x17bb0b);})[_0x0102('0x17')](function(_0x28722c){logger[_0x0102('0x12')](_0x0102('0x2d'),_0x28722c['message'],_0x4e6ef5);_0x9a6143(_0x8fb734[_0x0102('0x12')](0x1f4,_0x28722c['message']));});});};exports[_0x0102('0x45')]=function(_0x8af559){var _0x3c9001=this;return new Promise(function(_0x58b0bb,_0x38ba17){return db[_0x0102('0x18')]['findAll']({'raw':_0x8af559[_0x0102('0x1b')]?_0x8af559[_0x0102('0x1b')][_0x0102('0x1c')]===undefined?!![]:![]:!![],'where':_0x8af559[_0x0102('0x1b')]?_0x8af559[_0x0102('0x1b')][_0x0102('0x20')]||null:null,'attributes':[['campaign',_0x0102('0x30')],[db[_0x0102('0x21')]['fn'](_0x0102('0x22'),db[_0x0102('0x21')][_0x0102('0x23')]('id')),_0x0102('0x46')],[db[_0x0102('0x21')]['fn'](_0x0102('0x22'),db[_0x0102('0x21')]['fn']('IF',db['sequelize'][_0x0102('0x26')]('`state`\x20=\x204,\x201,\x20null'))),_0x0102('0x47')]],'group':['campaign']})[_0x0102('0xd')](function(_0x56c307){logger[_0x0102('0x15')](_0x0102('0x45'),_0x8af559);logger[_0x0102('0x10')](_0x0102('0x45'),_0x8af559,JSON[_0x0102('0x1e')](_0x56c307));_0x58b0bb(_0x56c307);})[_0x0102('0x17')](function(_0x4cab1a){logger['error'](_0x0102('0x45'),_0x4cab1a[_0x0102('0x14')],_0x8af559);_0x38ba17(_0x3c9001[_0x0102('0x12')](0x1f4,_0x4cab1a[_0x0102('0x14')]));});});}; \ No newline at end of file +var _0x9173=['literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','catch','GetVoiceQueueHopperHistory','campaign','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','col','ivrAnswerCallsDay','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmHopperHistory,\x20%s,\x20%s','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','CreateCmHopperHistory','CmHopperHistory','body','options','raw','stringify','AvgHandleTime','findAll','where','sequelize','COUNT','predictiveIntervalTotalCalls'];(function(_0x42803a,_0x13cd0e){var _0x40fdfe=function(_0x4f056e){while(--_0x4f056e){_0x42803a['push'](_0x42803a['shift']());}};_0x40fdfe(++_0x13cd0e);}(_0x9173,0xb4));var _0x3917=function(_0x17a64c,_0x113c71){_0x17a64c=_0x17a64c-0x0;var _0x8f7748=_0x9173[_0x17a64c];return _0x8f7748;};'use strict';var _=require(_0x3917('0x0'));var util=require(_0x3917('0x1'));var moment=require('moment');var BPromise=require(_0x3917('0x2'));var rs=require(_0x3917('0x3'));var fs=require('fs');var Redis=require(_0x3917('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3917('0x5'));var logger=require('../../config/logger')(_0x3917('0x6'));var config=require(_0x3917('0x7'));var jayson=require(_0x3917('0x8'));var client=jayson[_0x3917('0x9')][_0x3917('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x48d592,_0x181918,_0x27f513){return new BPromise(function(_0x11267b,_0x44d50e){return client[_0x3917('0xb')](_0x48d592,_0x27f513)[_0x3917('0xc')](function(_0x58282f){logger[_0x3917('0xd')](_0x3917('0xe'),_0x181918,'request\x20sent');logger[_0x3917('0xf')](_0x3917('0x10'),_0x181918,'request\x20sent',JSON['stringify'](_0x58282f));if(_0x58282f['error']){if(_0x58282f[_0x3917('0x11')][_0x3917('0x12')]===0x1f4){logger[_0x3917('0x11')](_0x3917('0xe'),_0x181918,_0x58282f[_0x3917('0x11')][_0x3917('0x13')]);return _0x44d50e(_0x58282f['error'][_0x3917('0x13')]);}logger[_0x3917('0x11')](_0x3917('0xe'),_0x181918,_0x58282f[_0x3917('0x11')]['message']);return _0x11267b(_0x58282f[_0x3917('0x11')][_0x3917('0x13')]);}else{logger[_0x3917('0xd')](_0x3917('0xe'),_0x181918,_0x3917('0x14'));_0x11267b(_0x58282f['result'][_0x3917('0x13')]);}})['catch'](function(_0x4912cd){logger[_0x3917('0x11')](_0x3917('0xe'),_0x181918,_0x4912cd);_0x44d50e(_0x4912cd);});});}exports[_0x3917('0x15')]=function(_0x509b2b){var _0x402d3c=this;return new Promise(function(_0x504934,_0x47da7e){return db[_0x3917('0x16')]['create'](_0x509b2b[_0x3917('0x17')],{'raw':_0x509b2b[_0x3917('0x18')]?_0x509b2b[_0x3917('0x18')][_0x3917('0x19')]===undefined?!![]:![]:!![]})[_0x3917('0xc')](function(_0x2f9f7d){logger[_0x3917('0xd')](_0x3917('0x15'),_0x509b2b);logger[_0x3917('0xf')](_0x3917('0x15'),_0x509b2b,JSON[_0x3917('0x1a')](_0x2f9f7d));_0x504934(_0x2f9f7d);})['catch'](function(_0x1e3d24){logger[_0x3917('0x11')]('CreateCmHopperHistory',_0x1e3d24['message'],_0x509b2b);_0x47da7e(_0x402d3c[_0x3917('0x11')](0x1f4,_0x1e3d24['message']));});});};exports[_0x3917('0x1b')]=function(_0x337aba){var _0x3ddc64=this;return new Promise(function(_0x5f16b7,_0x1e47a2){return db['CmHopperHistory'][_0x3917('0x1c')]({'raw':_0x337aba[_0x3917('0x18')]?_0x337aba[_0x3917('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x337aba[_0x3917('0x18')]?_0x337aba[_0x3917('0x18')][_0x3917('0x1d')]||null:null,'attributes':[[db[_0x3917('0x1e')]['fn'](_0x3917('0x1f'),db['sequelize']['col']('id')),_0x3917('0x20')],[db[_0x3917('0x1e')]['fn'](_0x3917('0x1f'),db[_0x3917('0x1e')]['fn']('IF',db[_0x3917('0x1e')][_0x3917('0x21')](_0x3917('0x22')))),_0x3917('0x23')],[db[_0x3917('0x1e')]['fn'](_0x3917('0x1f'),db['sequelize']['fn']('IF',db[_0x3917('0x1e')]['literal'](_0x3917('0x24')))),'predictiveIntervalDroppedCallsTimeout'],[db[_0x3917('0x1e')]['fn'](_0x3917('0x1f'),db['sequelize']['fn']('IF',db[_0x3917('0x1e')][_0x3917('0x21')](_0x3917('0x25')))),_0x3917('0x26')],[db['sequelize']['fn'](_0x3917('0x27'),db[_0x3917('0x1e')]['fn']('IF',db[_0x3917('0x1e')][_0x3917('0x21')](_0x3917('0x28')))),_0x3917('0x29')],[db[_0x3917('0x1e')]['fn'](_0x3917('0x27'),db['sequelize']['fn']('IF',db[_0x3917('0x1e')][_0x3917('0x21')](_0x3917('0x2a')))),_0x3917('0x2b')]]})[_0x3917('0xc')](function(_0x4b3378){logger[_0x3917('0xd')]('AvgHandleTime',_0x337aba);logger[_0x3917('0xf')](_0x3917('0x1b'),_0x337aba,JSON['stringify'](_0x4b3378));_0x5f16b7(_0x4b3378);})[_0x3917('0x2c')](function(_0x5e32ab){logger[_0x3917('0x11')](_0x3917('0x1b'),_0x5e32ab[_0x3917('0x13')],_0x337aba);_0x1e47a2(_0x3ddc64[_0x3917('0x11')](0x1f4,_0x5e32ab[_0x3917('0x13')]));});});};exports[_0x3917('0x2d')]=function(_0x1136ce){var _0x180886=this;return new Promise(function(_0x222618,_0x404325){return db['CmHopperHistory'][_0x3917('0x1c')]({'raw':_0x1136ce[_0x3917('0x18')]?_0x1136ce[_0x3917('0x18')][_0x3917('0x19')]===undefined?!![]:![]:!![],'where':_0x1136ce[_0x3917('0x18')]?_0x1136ce['options'][_0x3917('0x1d')]||null:null,'attributes':[[_0x3917('0x2e'),'name'],[db[_0x3917('0x1e')]['fn'](_0x3917('0x1f'),db[_0x3917('0x1e')]['fn']('IF',db[_0x3917('0x1e')]['literal'](_0x3917('0x2f')))),_0x3917('0x30')],[db['sequelize']['fn'](_0x3917('0x1f'),db[_0x3917('0x1e')]['fn']('IF',db[_0x3917('0x1e')][_0x3917('0x21')]('`state`\x20=\x203,\x201,\x20null'))),'outboundNoAnswerCallsDay'],[db[_0x3917('0x1e')]['fn'](_0x3917('0x1f'),db[_0x3917('0x1e')]['fn']('IF',db[_0x3917('0x1e')][_0x3917('0x21')]('`state`\x20=\x204,\x201,\x20null'))),_0x3917('0x31')],[db[_0x3917('0x1e')]['fn'](_0x3917('0x1f'),db[_0x3917('0x1e')]['fn']('IF',db[_0x3917('0x1e')][_0x3917('0x21')]('`state`\x20=\x205,\x201,\x20null'))),_0x3917('0x32')],[db[_0x3917('0x1e')]['fn'](_0x3917('0x1f'),db[_0x3917('0x1e')]['fn']('IF',db[_0x3917('0x1e')][_0x3917('0x21')](_0x3917('0x33')))),_0x3917('0x34')],[db[_0x3917('0x1e')]['fn'](_0x3917('0x1f'),db[_0x3917('0x1e')]['fn']('IF',db[_0x3917('0x1e')][_0x3917('0x21')](_0x3917('0x35')))),_0x3917('0x36')],[db['sequelize']['fn'](_0x3917('0x1f'),db[_0x3917('0x1e')]['fn']('IF',db[_0x3917('0x1e')][_0x3917('0x21')](_0x3917('0x37')))),_0x3917('0x38')],[db[_0x3917('0x1e')]['fn'](_0x3917('0x1f'),db['sequelize']['fn']('IF',db[_0x3917('0x1e')][_0x3917('0x21')](_0x3917('0x39')))),'outboundUnknownCallsDay'],[db['sequelize']['fn'](_0x3917('0x1f'),db[_0x3917('0x1e')]['fn']('IF',db[_0x3917('0x1e')][_0x3917('0x21')](_0x3917('0x3a')))),_0x3917('0x3b')],[db[_0x3917('0x1e')]['fn'](_0x3917('0x1f'),db['sequelize']['fn']('IF',db['sequelize'][_0x3917('0x21')](_0x3917('0x3c')))),_0x3917('0x3d')],[db['sequelize']['fn']('COUNT',db[_0x3917('0x1e')]['fn']('IF',db['sequelize'][_0x3917('0x21')](_0x3917('0x3e')))),_0x3917('0x3f')],[db[_0x3917('0x1e')]['fn'](_0x3917('0x1f'),db[_0x3917('0x1e')]['fn']('IF',db[_0x3917('0x1e')][_0x3917('0x21')](_0x3917('0x40')))),_0x3917('0x41')],[db[_0x3917('0x1e')]['fn'](_0x3917('0x1f'),db[_0x3917('0x1e')]['fn']('IF',db[_0x3917('0x1e')][_0x3917('0x21')]('`state`\x20=\x2020,\x201,\x20null'))),_0x3917('0x3f')],[db[_0x3917('0x1e')]['fn'](_0x3917('0x1f'),db[_0x3917('0x1e')]['fn']('IF',db['sequelize'][_0x3917('0x21')](_0x3917('0x42')))),_0x3917('0x43')]],'group':[_0x3917('0x2e')]})['then'](function(_0x4ff953){logger[_0x3917('0xd')](_0x3917('0x2d'),_0x1136ce);logger['debug'](_0x3917('0x2d'),_0x1136ce,JSON[_0x3917('0x1a')](_0x4ff953));_0x222618(_0x4ff953);})[_0x3917('0x2c')](function(_0x59a635){logger[_0x3917('0x11')](_0x3917('0x2d'),_0x59a635[_0x3917('0x13')],_0x1136ce);_0x404325(_0x180886[_0x3917('0x11')](0x1f4,_0x59a635[_0x3917('0x13')]));});});};exports[_0x3917('0x44')]=function(_0x1818c5){var _0x1ffb69=this;return new Promise(function(_0x45c669,_0x3f0799){return db['CmHopperHistory'][_0x3917('0x1c')]({'raw':_0x1818c5[_0x3917('0x18')]?_0x1818c5[_0x3917('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x1818c5[_0x3917('0x18')]?_0x1818c5[_0x3917('0x18')][_0x3917('0x1d')]||null:null,'attributes':[['campaign','name'],[db[_0x3917('0x1e')]['fn'](_0x3917('0x1f'),db[_0x3917('0x1e')][_0x3917('0x45')]('id')),'ivrTotalCallsDays'],[db[_0x3917('0x1e')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x3917('0x1e')][_0x3917('0x21')]('`state`\x20=\x204,\x201,\x20null'))),_0x3917('0x46')]],'group':[_0x3917('0x2e')]})[_0x3917('0xc')](function(_0x4c2363){logger[_0x3917('0xd')]('GetCampaignHopperHistory',_0x1818c5);logger['debug']('GetCampaignHopperHistory',_0x1818c5,JSON[_0x3917('0x1a')](_0x4c2363));_0x45c669(_0x4c2363);})['catch'](function(_0x3de9e9){logger[_0x3917('0x11')](_0x3917('0x44'),_0x3de9e9['message'],_0x1818c5);_0x3f0799(_0x1ffb69[_0x3917('0x11')](0x1f4,_0x3de9e9[_0x3917('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index 17d29f2..cbe0b68 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 _0x9d3d=['exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','isAuthenticated','index','get','/describe','/:id','create','put','update'];(function(_0x4b22bf,_0x3a9e74){var _0x27bad3=function(_0x5f0bd8){while(--_0x5f0bd8){_0x4b22bf['push'](_0x4b22bf['shift']());}};_0x27bad3(++_0x3a9e74);}(_0x9d3d,0x17b));var _0xd9d3=function(_0x3e3c89,_0x1f4417){_0x3e3c89=_0x3e3c89-0x0;var _0x1ccf13=_0x9d3d[_0x3e3c89];return _0x1ccf13;};'use strict';var multer=require(_0xd9d3('0x0'));var util=require('util');var path=require(_0xd9d3('0x1'));var timeout=require('connect-timeout');var express=require(_0xd9d3('0x2'));var router=express[_0xd9d3('0x3')]();var fs_extra=require(_0xd9d3('0x4'));var auth=require(_0xd9d3('0x5'));var interaction=require(_0xd9d3('0x6'));var config=require(_0xd9d3('0x7'));var controller=require(_0xd9d3('0x8'));router['get']('/',auth[_0xd9d3('0x9')](),controller[_0xd9d3('0xa')]);router[_0xd9d3('0xb')](_0xd9d3('0xc'),auth[_0xd9d3('0x9')](),controller['describe']);router[_0xd9d3('0xb')](_0xd9d3('0xd'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xd9d3('0x9')](),controller[_0xd9d3('0xe')]);router[_0xd9d3('0xf')](_0xd9d3('0xd'),auth[_0xd9d3('0x9')](),controller[_0xd9d3('0x10')]);module[_0xd9d3('0x11')]=router; \ No newline at end of file +var _0x9785=['isAuthenticated','index','/describe','describe','show','post','create','put','/:id','update','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','get'];(function(_0x14118a,_0x5ad55c){var _0x28106e=function(_0x21f5d2){while(--_0x21f5d2){_0x14118a['push'](_0x14118a['shift']());}};_0x28106e(++_0x5ad55c);}(_0x9785,0x19a));var _0x5978=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0x9785[_0x92c450];return _0x2a9599;};'use strict';var multer=require('multer');var util=require(_0x5978('0x0'));var path=require(_0x5978('0x1'));var timeout=require('connect-timeout');var express=require(_0x5978('0x2'));var router=express[_0x5978('0x3')]();var fs_extra=require(_0x5978('0x4'));var auth=require(_0x5978('0x5'));var interaction=require(_0x5978('0x6'));var config=require(_0x5978('0x7'));var controller=require(_0x5978('0x8'));router[_0x5978('0x9')]('/',auth[_0x5978('0xa')](),controller[_0x5978('0xb')]);router['get'](_0x5978('0xc'),auth['isAuthenticated'](),controller[_0x5978('0xd')]);router['get']('/:id',auth[_0x5978('0xa')](),controller[_0x5978('0xe')]);router[_0x5978('0xf')]('/',auth[_0x5978('0xa')](),controller[_0x5978('0x10')]);router[_0x5978('0x11')](_0x5978('0x12'),auth[_0x5978('0xa')](),controller[_0x5978('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index cbb02c2..a047bd7 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 _0x5a52=['STRING','sequelize'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x5a52,0x18d));var _0x25a5=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x5a52[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x25a5('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x25a5('0x1')]},'dialPrefix':{'type':Sequelize[_0x25a5('0x1')]}}; \ No newline at end of file +var _0x00b3=['STRING','sequelize','name'];(function(_0x1e9997,_0x4798c0){var _0x25feaa=function(_0xfedf78){while(--_0xfedf78){_0x1e9997['push'](_0x1e9997['shift']());}};_0x25feaa(++_0x4798c0);}(_0x00b3,0x97));var _0x300b=function(_0xc9059a,_0x3ba457){_0xc9059a=_0xc9059a-0x0;var _0x24fb72=_0x00b3[_0xc9059a];return _0x24fb72;};'use strict';var Sequelize=require(_0x300b('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x300b('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x300b('0x2')]},'dialPrefix':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index c1b3077..ee4a322 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 _0x2e4b=['socket.io-emitter','redis','./cmList.socket','register','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','Lists','UserProfileResource','sendStatus','error','send','index','map','CmList','rawAttributes','fieldName','type','model','name','query','filters','intersection','fields','attributes','length','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','keys','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','ListId','Disposition','getDispositions','findOne','hasOwnProperty','nolimit','removeDispositions','ids','addContacts','CmContact','tags','isArray','join','each','omit','success','errors','push','message','getContacts','CmCustomField','CustomFields','concat','format','cf_%d','raw','isEmpty','writeFileSync','/tmp/list_%d_%s.csv','setHeader','Content-disposition','list_%d_%s.csv','Content-type','text/csv','download','addCustomField','sequelize','transaction','addCustomFields','TEXT','text','Sequelize','number','INTEGER','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','cf_%s','getCustomFields','findAndCountAll','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','User','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','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/environment','../../config/license/util','../../mysqldb','defaults','localhost'];(function(_0x36b037,_0x2b234e){var _0x409194=function(_0xddc9dc){while(--_0xddc9dc){_0x36b037['push'](_0x36b037['shift']());}};_0x409194(++_0x2b234e);}(_0x2e4b,0x7c));var _0xb2e4=function(_0x39f34f,_0x298f45){_0x39f34f=_0x39f34f-0x0;var _0x59fee1=_0x2e4b[_0x39f34f];return _0x59fee1;};'use strict';var emlformat=require(_0xb2e4('0x0'));var rimraf=require(_0xb2e4('0x1'));var zipdir=require(_0xb2e4('0x2'));var jsonpatch=require(_0xb2e4('0x3'));var rp=require(_0xb2e4('0x4'));var moment=require('moment');var BPromise=require(_0xb2e4('0x5'));var Mustache=require(_0xb2e4('0x6'));var util=require(_0xb2e4('0x7'));var path=require(_0xb2e4('0x8'));var sox=require(_0xb2e4('0x9'));var csv=require(_0xb2e4('0xa'));var ejs=require(_0xb2e4('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb2e4('0xc'));var squel=require('squel');var crypto=require(_0xb2e4('0xd'));var jsforce=require(_0xb2e4('0xe'));var deskjs=require(_0xb2e4('0xf'));var toCsv=require(_0xb2e4('0xa'));var querystring=require(_0xb2e4('0x10'));var Papa=require(_0xb2e4('0x11'));var Redis=require(_0xb2e4('0x12'));var authService=require(_0xb2e4('0x13'));var qs=require(_0xb2e4('0x14'));var as=require(_0xb2e4('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb2e4('0x16'))(_0xb2e4('0x17'));var utils=require(_0xb2e4('0x18'));var config=require(_0xb2e4('0x19'));var licenseUtil=require(_0xb2e4('0x1a'));var db=require(_0xb2e4('0x1b'))['db'];config['redis']=_[_0xb2e4('0x1c')](config['redis'],{'host':_0xb2e4('0x1d'),'port':0x18eb});var socket=require(_0xb2e4('0x1e'))(new Redis(config[_0xb2e4('0x1f')]));require(_0xb2e4('0x20'))[_0xb2e4('0x21')](socket);function respondWithStatusCode(_0x472984,_0x12e923){_0x12e923=_0x12e923||0xcc;return function(_0x5738ae){if(_0x5738ae){return _0x472984['sendStatus'](_0x12e923);}return _0x472984[_0xb2e4('0x22')](_0x12e923)[_0xb2e4('0x23')]();};}function respondWithResult(_0x93addb,_0x3ca15a){_0x3ca15a=_0x3ca15a||0xc8;return function(_0x57a8d3){if(_0x57a8d3){return _0x93addb[_0xb2e4('0x22')](_0x3ca15a)[_0xb2e4('0x24')](_0x57a8d3);}};}function respondWithFilteredResult(_0x575a58,_0x26878a){return function(_0x2a01a0){if(_0x2a01a0){var _0x5c9651=typeof _0x26878a[_0xb2e4('0x25')]==='undefined'&&typeof _0x26878a['limit']===_0xb2e4('0x26');var _0x4418f7=_0x2a01a0[_0xb2e4('0x27')];var _0x2a8c16=_0x5c9651?0x0:_0x26878a[_0xb2e4('0x25')];var _0x47b804=_0x5c9651?_0x2a01a0[_0xb2e4('0x27')]:_0x26878a[_0xb2e4('0x25')]+_0x26878a[_0xb2e4('0x28')];var _0x1c8c2c;if(_0x47b804>=_0x4418f7){_0x47b804=_0x4418f7;_0x1c8c2c=0xc8;}else{_0x1c8c2c=0xce;}_0x575a58['status'](_0x1c8c2c);return _0x575a58[_0xb2e4('0x29')](_0xb2e4('0x2a'),_0x2a8c16+'-'+_0x47b804+'/'+_0x4418f7)[_0xb2e4('0x24')](_0x2a01a0);}return null;};}function patchUpdates(_0x2ad646){return function(_0x512c76){try{jsonpatch[_0xb2e4('0x2b')](_0x512c76,_0x2ad646,!![]);}catch(_0x5d45e9){return BPromise[_0xb2e4('0x2c')](_0x5d45e9);}return _0x512c76[_0xb2e4('0x2d')]();};}function saveUpdates(_0x2c75f7,_0x50b04b){return function(_0x3a1631){if(_0x3a1631){return _0x3a1631[_0xb2e4('0x2e')](_0x2c75f7)[_0xb2e4('0x2f')](function(_0x1bbc01){return _0x1bbc01;});}return null;};}function removeEntity(_0x361df4,_0x22ee22){return function(_0x298f41){if(_0x298f41){return _0x298f41[_0xb2e4('0x30')]()[_0xb2e4('0x2f')](function(){var _0x5a3d96=_0x298f41['get']({'plain':!![]});var _0xb3bc19=_0xb2e4('0x31');return db[_0xb2e4('0x32')][_0xb2e4('0x30')]({'where':{'type':_0xb3bc19,'resourceId':_0x5a3d96['id']}})['then'](function(){return _0x298f41;});})[_0xb2e4('0x2f')](function(){_0x361df4[_0xb2e4('0x22')](0xcc)[_0xb2e4('0x23')]();});}};}function handleEntityNotFound(_0x3817be,_0x4d95f2){return function(_0x14368a){if(!_0x14368a){_0x3817be[_0xb2e4('0x33')](0x194);}return _0x14368a;};}function handleError(_0x2a89d8,_0x4c1eb0){_0x4c1eb0=_0x4c1eb0||0x1f4;return function(_0x5dc2f5){logger[_0xb2e4('0x34')](_0x5dc2f5['stack']);if(_0x5dc2f5['name']){delete _0x5dc2f5['name'];}_0x2a89d8['status'](_0x4c1eb0)[_0xb2e4('0x35')](_0x5dc2f5);};}exports[_0xb2e4('0x36')]=function(_0x264b1a,_0x59dfb5){var _0x572150={},_0x259f86={},_0x3157f9={'count':0x0,'rows':[]};var _0x1e9841=_[_0xb2e4('0x37')](db[_0xb2e4('0x38')][_0xb2e4('0x39')],function(_0x44739a){return{'name':_0x44739a[_0xb2e4('0x3a')],'type':_0x44739a[_0xb2e4('0x3b')]['key']};});_0x259f86[_0xb2e4('0x3c')]=_[_0xb2e4('0x37')](_0x1e9841,_0xb2e4('0x3d'));_0x259f86['query']=_['keys'](_0x264b1a[_0xb2e4('0x3e')]);_0x259f86[_0xb2e4('0x3f')]=_[_0xb2e4('0x40')](_0x259f86['model'],_0x259f86[_0xb2e4('0x3e')]);_0x572150['attributes']=_['intersection'](_0x259f86['model'],qs[_0xb2e4('0x41')](_0x264b1a[_0xb2e4('0x3e')]['fields']));_0x572150[_0xb2e4('0x42')]=_0x572150['attributes'][_0xb2e4('0x43')]?_0x572150[_0xb2e4('0x42')]:_0x259f86['model'];if(!_0x264b1a[_0xb2e4('0x3e')]['hasOwnProperty']('nolimit')){_0x572150[_0xb2e4('0x28')]=qs[_0xb2e4('0x28')](_0x264b1a['query'][_0xb2e4('0x28')]);_0x572150[_0xb2e4('0x25')]=qs[_0xb2e4('0x25')](_0x264b1a[_0xb2e4('0x3e')][_0xb2e4('0x25')]);}_0x572150[_0xb2e4('0x44')]=qs[_0xb2e4('0x45')](_0x264b1a[_0xb2e4('0x3e')][_0xb2e4('0x45')]);_0x572150[_0xb2e4('0x46')]=qs[_0xb2e4('0x3f')](_[_0xb2e4('0x47')](_0x264b1a[_0xb2e4('0x3e')],_0x259f86[_0xb2e4('0x3f')]),_0x1e9841);if(_0x264b1a[_0xb2e4('0x3e')][_0xb2e4('0x48')]){_0x572150[_0xb2e4('0x46')]=_['merge'](_0x572150[_0xb2e4('0x46')],{'$or':_[_0xb2e4('0x37')](_0x1e9841,function(_0x599b67){if(_0x599b67[_0xb2e4('0x3b')]!==_0xb2e4('0x49')){var _0x536ed2={};_0x536ed2[_0x599b67[_0xb2e4('0x3d')]]={'$like':'%'+_0x264b1a[_0xb2e4('0x3e')][_0xb2e4('0x48')]+'%'};return _0x536ed2;}})});}_0x572150=_[_0xb2e4('0x4a')]({},_0x572150,_0x264b1a[_0xb2e4('0x4b')]);var _0x523f6d={'where':_0x572150['where']};return db['CmList']['count'](_0x523f6d)[_0xb2e4('0x2f')](function(_0x4868e9){_0x3157f9[_0xb2e4('0x27')]=_0x4868e9;if(_0x264b1a[_0xb2e4('0x3e')][_0xb2e4('0x4c')]){_0x572150[_0xb2e4('0x4d')]=[{'all':!![]}];}return db[_0xb2e4('0x38')][_0xb2e4('0x4e')](_0x572150);})['then'](function(_0x1db5d9){_0x3157f9[_0xb2e4('0x4f')]=_0x1db5d9;return _0x3157f9;})['then'](respondWithFilteredResult(_0x59dfb5,_0x572150))[_0xb2e4('0x50')](handleError(_0x59dfb5,null));};exports['show']=function(_0x5a75be,_0x172bad){var _0x1e9b58={'raw':![],'where':{'id':_0x5a75be[_0xb2e4('0x51')]['id']}},_0x4fadde={};_0x4fadde[_0xb2e4('0x3c')]=_[_0xb2e4('0x52')](db[_0xb2e4('0x38')][_0xb2e4('0x39')]);_0x4fadde[_0xb2e4('0x3e')]=_[_0xb2e4('0x52')](_0x5a75be[_0xb2e4('0x3e')]);_0x4fadde[_0xb2e4('0x3f')]=_['intersection'](_0x4fadde[_0xb2e4('0x3c')],_0x4fadde[_0xb2e4('0x3e')]);_0x1e9b58[_0xb2e4('0x42')]=_['intersection'](_0x4fadde['model'],qs['fields'](_0x5a75be[_0xb2e4('0x3e')]['fields']));_0x1e9b58['attributes']=_0x1e9b58[_0xb2e4('0x42')][_0xb2e4('0x43')]?_0x1e9b58[_0xb2e4('0x42')]:_0x4fadde[_0xb2e4('0x3c')];if(_0x5a75be[_0xb2e4('0x3e')][_0xb2e4('0x4c')]){_0x1e9b58['include']=[{'all':!![]}];}_0x1e9b58=_['merge']({},_0x1e9b58,_0x5a75be[_0xb2e4('0x4b')]);return db['CmList'][_0xb2e4('0x53')](_0x1e9b58)['then'](handleEntityNotFound(_0x172bad,null))['then'](respondWithResult(_0x172bad,null))['catch'](handleError(_0x172bad,null));};exports[_0xb2e4('0x54')]=function(_0x3c0875,_0x59fd2f){return db[_0xb2e4('0x38')][_0xb2e4('0x54')](_0x3c0875['body'],{})['then'](function(_0x577dc4){var _0x517e44=_0x3c0875[_0xb2e4('0x55')][_0xb2e4('0x56')]({'plain':!![]});if(!_0x517e44)throw new Error(_0xb2e4('0x57'));if(_0x517e44[_0xb2e4('0x58')]===_0xb2e4('0x55')){var _0x5ce02c=_0x577dc4[_0xb2e4('0x56')]({'plain':!![]});var _0x25f246=_0xb2e4('0x31');return db['UserProfileSection'][_0xb2e4('0x53')]({'where':{'name':_0x25f246,'userProfileId':_0x517e44[_0xb2e4('0x59')]},'raw':!![]})[_0xb2e4('0x2f')](function(_0x3f9ea2){if(_0x3f9ea2&&_0x3f9ea2['autoAssociation']===0x0){return db[_0xb2e4('0x32')][_0xb2e4('0x54')]({'name':_0x5ce02c[_0xb2e4('0x3d')],'resourceId':_0x5ce02c['id'],'type':_0x3f9ea2['name'],'sectionId':_0x3f9ea2['id']},{})['then'](function(){return _0x577dc4;});}else{return _0x577dc4;}})[_0xb2e4('0x50')](function(_0x1b195c){logger[_0xb2e4('0x34')](_0xb2e4('0x5a'),_0x1b195c);throw _0x1b195c;});}return _0x577dc4;})['then'](respondWithResult(_0x59fd2f,0xc9))['catch'](handleError(_0x59fd2f,null));};exports[_0xb2e4('0x2e')]=function(_0x715882,_0x3dec54){if(_0x715882[_0xb2e4('0x5b')]['id']){delete _0x715882[_0xb2e4('0x5b')]['id'];}return db[_0xb2e4('0x38')]['find']({'where':{'id':_0x715882[_0xb2e4('0x51')]['id']}})[_0xb2e4('0x2f')](handleEntityNotFound(_0x3dec54,null))[_0xb2e4('0x2f')](saveUpdates(_0x715882[_0xb2e4('0x5b')],null))[_0xb2e4('0x2f')](respondWithResult(_0x3dec54,null))[_0xb2e4('0x50')](handleError(_0x3dec54,null));};exports['destroy']=function(_0x2ebe04,_0x5d62bf){return db[_0xb2e4('0x38')][_0xb2e4('0x53')]({'where':{'id':_0x2ebe04[_0xb2e4('0x51')]['id']}})[_0xb2e4('0x2f')](handleEntityNotFound(_0x5d62bf,null))[_0xb2e4('0x2f')](removeEntity(_0x5d62bf,null))['catch'](handleError(_0x5d62bf,null));};exports[_0xb2e4('0x5c')]=function(_0x52abc2,_0x3c08ab){return db['CmList']['describe']()[_0xb2e4('0x2f')](respondWithResult(_0x3c08ab,null))[_0xb2e4('0x50')](handleError(_0x3c08ab,null));};exports[_0xb2e4('0x5d')]=function(_0x53a91f,_0x452cd0,_0x529d7a){if(_0x53a91f[_0xb2e4('0x5b')]['id']){delete _0x53a91f[_0xb2e4('0x5b')]['id'];}return db['CmList'][_0xb2e4('0x53')]({'where':{'id':_0x53a91f[_0xb2e4('0x51')]['id']}})[_0xb2e4('0x2f')](handleEntityNotFound(_0x452cd0,null))['then'](function(_0x2d7c05){if(_0x2d7c05){_0x53a91f[_0xb2e4('0x5b')][_0xb2e4('0x5e')]=_0x2d7c05['id'];return db[_0xb2e4('0x5f')][_0xb2e4('0x54')](_0x53a91f[_0xb2e4('0x5b')]);}})[_0xb2e4('0x2f')](respondWithResult(_0x452cd0,null))[_0xb2e4('0x50')](handleError(_0x452cd0,null));};exports[_0xb2e4('0x60')]=function(_0x27597f,_0x4f2042,_0x5f56fe){var _0x333994={'raw':![],'where':{}};var _0x4be802={};var _0x9510f9={'count':0x0,'rows':[]};return db[_0xb2e4('0x38')][_0xb2e4('0x61')]({'where':{'id':_0x27597f[_0xb2e4('0x51')]['id']}})[_0xb2e4('0x2f')](handleEntityNotFound(_0x4f2042,null))['then'](function(_0x4ad7){if(_0x4ad7){_0x4be802['model']=_['keys'](db[_0xb2e4('0x5f')][_0xb2e4('0x39')]);_0x4be802[_0xb2e4('0x3e')]=_[_0xb2e4('0x52')](_0x27597f[_0xb2e4('0x3e')]);_0x4be802[_0xb2e4('0x3f')]=_['intersection'](_0x4be802['model'],_0x4be802['query']);_0x333994[_0xb2e4('0x42')]=_['intersection'](_0x4be802[_0xb2e4('0x3c')],qs[_0xb2e4('0x41')](_0x27597f['query'][_0xb2e4('0x41')]));_0x333994[_0xb2e4('0x42')]=_0x333994[_0xb2e4('0x42')][_0xb2e4('0x43')]?_0x333994['attributes']:_0x4be802[_0xb2e4('0x3c')];if(!_0x27597f[_0xb2e4('0x3e')][_0xb2e4('0x62')](_0xb2e4('0x63'))){_0x333994['limit']=qs[_0xb2e4('0x28')](_0x27597f['query'][_0xb2e4('0x28')]);_0x333994[_0xb2e4('0x25')]=qs[_0xb2e4('0x25')](_0x27597f['query'][_0xb2e4('0x25')]);}_0x333994[_0xb2e4('0x44')]=qs[_0xb2e4('0x45')](_0x27597f['query'][_0xb2e4('0x45')]);_0x333994['where']=qs[_0xb2e4('0x3f')](_['pick'](_0x27597f['query'],_0x4be802[_0xb2e4('0x3f')]));_0x333994[_0xb2e4('0x46')]['ListId']=_0x4ad7['id'];if(_0x27597f['query'][_0xb2e4('0x48')]){_0x333994[_0xb2e4('0x46')]=_[_0xb2e4('0x4a')](_0x333994['where'],{'$or':_['map'](_0x333994[_0xb2e4('0x42')],function(_0x2ac961){var _0x14839a={};_0x14839a[_0x2ac961]={'$like':'%'+_0x27597f[_0xb2e4('0x3e')][_0xb2e4('0x48')]+'%'};return _0x14839a;})});}_0x333994=_['merge']({},_0x333994,_0x27597f[_0xb2e4('0x4b')]);return db['Disposition'][_0xb2e4('0x27')]({'where':_0x333994[_0xb2e4('0x46')]})['then'](function(_0x46f035){_0x9510f9[_0xb2e4('0x27')]=_0x46f035;if(_0x27597f[_0xb2e4('0x3e')]['includeAll']){_0x333994['include']=[{'all':!![]}];}return db[_0xb2e4('0x5f')]['findAll'](_0x333994);})[_0xb2e4('0x2f')](function(_0x5a16e9){_0x9510f9[_0xb2e4('0x4f')]=_0x5a16e9;return _0x9510f9;});}})[_0xb2e4('0x2f')](respondWithFilteredResult(_0x4f2042,_0x333994))['catch'](handleError(_0x4f2042,null));};exports[_0xb2e4('0x64')]=function(_0x2e9a93,_0x57372a,_0x16253e){return db[_0xb2e4('0x38')]['find']({'where':{'id':_0x2e9a93[_0xb2e4('0x51')]['id']}})['then'](handleEntityNotFound(_0x57372a,null))[_0xb2e4('0x2f')](function(_0x45542f){if(_0x45542f){return _0x45542f['removeDispositions'](_0x2e9a93[_0xb2e4('0x3e')][_0xb2e4('0x65')]);}})[_0xb2e4('0x2f')](respondWithStatusCode(_0x57372a,null))[_0xb2e4('0x50')](handleError(_0x57372a,null));};exports[_0xb2e4('0x66')]=function(_0x236857,_0xc80fee,_0x1adef3){return db[_0xb2e4('0x38')][_0xb2e4('0x53')]({'where':{'id':_0x236857[_0xb2e4('0x51')]['id']}})[_0xb2e4('0x2f')](handleEntityNotFound(_0xc80fee,null))[_0xb2e4('0x2f')](function(_0x5922b9){if(_0x5922b9){var _0x2a34d6=[];var _0x647968={'success':[],'errors':[]};return db[_0xb2e4('0x67')][_0xb2e4('0x5c')]()[_0xb2e4('0x2f')](function(_0x5a7f85){if(_0x236857['body'][_0xb2e4('0x68')]&&_[_0xb2e4('0x69')](_0x236857[_0xb2e4('0x5b')][_0xb2e4('0x68')])){if(_0x236857[_0xb2e4('0x5b')]['tags']['length']){_0x236857['body'][_0xb2e4('0x68')]=_0x236857[_0xb2e4('0x5b')][_0xb2e4('0x68')][_0xb2e4('0x6a')](';')+';';}else{_0x236857[_0xb2e4('0x5b')][_0xb2e4('0x68')]=null;}}else{_0x236857['body']['tags']=null;}if(_0x236857['body']&&_[_0xb2e4('0x69')](_0x236857[_0xb2e4('0x5b')])){for(var _0x301ddb=0x0;_0x301ddb<_0x236857['body'][_0xb2e4('0x43')];_0x301ddb+=0x1){_0x236857[_0xb2e4('0x5b')][_0x301ddb][_0xb2e4('0x5e')]=_0x236857[_0xb2e4('0x51')]['id'];_0x2a34d6['push'](_0x236857['body'][_0x301ddb]);}return BPromise[_0xb2e4('0x6b')](_0x2a34d6,function(_0x29d701){return db['CmContact'][_0xb2e4('0x54')](_[_0xb2e4('0x6c')](_0x29d701,[_0xb2e4('0x65'),'id'])||{},{'fields':_[_0xb2e4('0x52')](_0x5a7f85),'raw':!![]})[_0xb2e4('0x2f')](function(_0x580ddf){_0x647968[_0xb2e4('0x6d')]['push'](_0x580ddf['dataValues']);})['catch'](function(_0x38c3d2){_0x647968[_0xb2e4('0x6e')][_0xb2e4('0x6f')]({'data':_0x29d701,'error':_0x38c3d2[_0xb2e4('0x70')]});});})['then'](function(_0x51f5b8){return _0x647968;})[_0xb2e4('0x50')](function(_0x3bd473){return _0x3bd473;});}else{_0xc80fee[_0xb2e4('0x22')](0x190)[_0xb2e4('0x24')]({'message':'Malformed\x20request\x20syntax'});}});}})[_0xb2e4('0x2f')](respondWithResult(_0xc80fee,null))[_0xb2e4('0x50')](handleError(_0xc80fee,null));};exports[_0xb2e4('0x71')]=function(_0x5c7238,_0x2912e6,_0x48eaa1){var _0x48d072;return db['CmList']['find']({'where':{'id':_0x5c7238[_0xb2e4('0x51')]['id']},'include':[{'model':db[_0xb2e4('0x72')],'as':_0xb2e4('0x73')}]})['then'](handleEntityNotFound(_0x2912e6,null))[_0xb2e4('0x2f')](function(_0x5e99){if(_0x5e99){_0x48d072=_0x5e99;return db[_0xb2e4('0x67')]['rawAttributes'];}})[_0xb2e4('0x2f')](function(_0x52063a){if(_0x52063a){var _0x386f21={};var _0x522832={};_0x522832[_0xb2e4('0x3c')]=_[_0xb2e4('0x74')](_[_0xb2e4('0x52')](_0x52063a),_[_0xb2e4('0x37')](_0x48d072[_0xb2e4('0x73')],function(_0x595ba5){return util[_0xb2e4('0x75')](_0xb2e4('0x76'),_0x595ba5['id']);}));_0x522832[_0xb2e4('0x3e')]=_[_0xb2e4('0x52')](_0x5c7238[_0xb2e4('0x3e')]);_0x522832[_0xb2e4('0x3f')]=_[_0xb2e4('0x40')](_0x522832[_0xb2e4('0x3c')],_0x522832[_0xb2e4('0x3e')]);_0x386f21[_0xb2e4('0x42')]=_[_0xb2e4('0x40')](_0x522832[_0xb2e4('0x3c')],qs['fields'](_0x5c7238['query'][_0xb2e4('0x41')]));_0x386f21[_0xb2e4('0x42')]=_0x386f21[_0xb2e4('0x42')][_0xb2e4('0x43')]?_0x386f21['attributes']:_0x522832['model'];if(!_0x5c7238[_0xb2e4('0x3e')][_0xb2e4('0x62')](_0xb2e4('0x63'))){_0x386f21[_0xb2e4('0x28')]=qs[_0xb2e4('0x28')](_0x5c7238['query'][_0xb2e4('0x28')]);_0x386f21['offset']=qs[_0xb2e4('0x25')](_0x5c7238[_0xb2e4('0x3e')]['offset']);}_0x386f21[_0xb2e4('0x44')]=qs[_0xb2e4('0x45')](_0x5c7238[_0xb2e4('0x3e')]['sort']);_0x386f21[_0xb2e4('0x46')]=qs[_0xb2e4('0x3f')](_[_0xb2e4('0x47')](_0x5c7238['query'],_0x522832[_0xb2e4('0x3f')]));_0x386f21[_0xb2e4('0x77')]=!![];if(_0x5c7238[_0xb2e4('0x3e')][_0xb2e4('0x48')]){_0x386f21[_0xb2e4('0x46')]=_[_0xb2e4('0x4a')](_0x386f21[_0xb2e4('0x46')],{'$or':_[_0xb2e4('0x37')](_0x386f21[_0xb2e4('0x42')],function(_0x3235aa){var _0x152570={};_0x152570[_0x3235aa]={'$like':'%'+_0x5c7238[_0xb2e4('0x3e')][_0xb2e4('0x48')]+'%'};return _0x152570;})});}_0x386f21=_['merge']({},_0x386f21,_0x5c7238['options']);return _0x48d072[_0xb2e4('0x71')](_0x386f21);}})[_0xb2e4('0x2f')](respondWithResult(_0x2912e6,null))[_0xb2e4('0x50')](handleError(_0x2912e6,null));};exports['getContactsCsv']=function(_0x253d73,_0x47e812,_0x6373d6){var _0x1e54cf;return db[_0xb2e4('0x38')][_0xb2e4('0x53')]({'where':{'id':_0x253d73[_0xb2e4('0x51')]['id']},'include':[{'model':db[_0xb2e4('0x72')],'as':_0xb2e4('0x73')}]})['then'](handleEntityNotFound(_0x47e812,null))[_0xb2e4('0x2f')](function(_0x32f5c6){if(_0x32f5c6){_0x1e54cf=_0x32f5c6;return db[_0xb2e4('0x67')][_0xb2e4('0x39')];}})[_0xb2e4('0x2f')](function(_0x5ce2ac){if(_0x5ce2ac){var _0x4cae9b={};var _0x49cc94={};_0x49cc94[_0xb2e4('0x3c')]=_['concat'](_[_0xb2e4('0x52')](_0x5ce2ac),_[_0xb2e4('0x37')](_0x1e54cf[_0xb2e4('0x73')],function(_0x42f2ea){return util[_0xb2e4('0x75')](_0xb2e4('0x76'),_0x42f2ea['id']);}));_0x49cc94[_0xb2e4('0x3e')]=_[_0xb2e4('0x52')](_0x253d73[_0xb2e4('0x3e')]);_0x49cc94[_0xb2e4('0x3f')]=_['intersection'](_0x49cc94[_0xb2e4('0x3c')],_0x49cc94[_0xb2e4('0x3e')]);_0x4cae9b[_0xb2e4('0x42')]=_[_0xb2e4('0x40')](_0x49cc94[_0xb2e4('0x3c')],qs[_0xb2e4('0x41')](_0x253d73[_0xb2e4('0x3e')][_0xb2e4('0x41')]));_0x4cae9b[_0xb2e4('0x42')]=_0x4cae9b['attributes'][_0xb2e4('0x43')]?_0x4cae9b[_0xb2e4('0x42')]:_0x49cc94[_0xb2e4('0x3c')];if(!_0x253d73[_0xb2e4('0x3e')]['hasOwnProperty'](_0xb2e4('0x63'))){_0x4cae9b['limit']=qs[_0xb2e4('0x28')](_0x253d73[_0xb2e4('0x3e')][_0xb2e4('0x28')]);_0x4cae9b[_0xb2e4('0x25')]=qs[_0xb2e4('0x25')](_0x253d73[_0xb2e4('0x3e')][_0xb2e4('0x25')]);}_0x4cae9b[_0xb2e4('0x44')]=qs[_0xb2e4('0x45')](_0x253d73[_0xb2e4('0x3e')][_0xb2e4('0x45')]);_0x4cae9b['where']=qs[_0xb2e4('0x3f')](_['pick'](_0x253d73[_0xb2e4('0x3e')],_0x49cc94[_0xb2e4('0x3f')]));_0x4cae9b['raw']=!![];if(_0x253d73[_0xb2e4('0x3e')][_0xb2e4('0x48')]){_0x4cae9b[_0xb2e4('0x46')]=_[_0xb2e4('0x4a')](_0x4cae9b[_0xb2e4('0x46')],{'$or':_[_0xb2e4('0x37')](_0x4cae9b[_0xb2e4('0x42')],function(_0x4325b9){var _0x2c2238={};_0x2c2238[_0x4325b9]={'$like':'%'+_0x253d73[_0xb2e4('0x3e')][_0xb2e4('0x48')]+'%'};return _0x2c2238;})});}_0x4cae9b=_[_0xb2e4('0x4a')]({},_0x4cae9b,_0x253d73[_0xb2e4('0x4b')]);return _0x1e54cf[_0xb2e4('0x71')](_0x4cae9b);}})['then'](function(_0x2ad8f6){if(!_[_0xb2e4('0x78')](_0x2ad8f6)){var _0x26c8fa=toCsv(_0x2ad8f6);var _0x34e77a=Date['now']();fs[_0xb2e4('0x79')](util['format'](_0xb2e4('0x7a'),_0x1e54cf['id'],_0x34e77a),_0x26c8fa);_0x47e812[_0xb2e4('0x7b')](_0xb2e4('0x7c'),'attachment;\x20filename='+util[_0xb2e4('0x75')](_0xb2e4('0x7d'),_0x1e54cf['id'],_0x34e77a));_0x47e812[_0xb2e4('0x7b')](_0xb2e4('0x7e'),_0xb2e4('0x7f'));return _0x47e812[_0xb2e4('0x80')](util[_0xb2e4('0x75')](_0xb2e4('0x7a'),_0x1e54cf['id'],_0x34e77a));}else{return _0x47e812[_0xb2e4('0x33')](0xcc);}})['catch'](handleError(_0x47e812,null));};exports[_0xb2e4('0x81')]=function(_0x1cb4df,_0x5c56ad,_0x1c73f3){var _0x44536d;delete _0x1cb4df[_0xb2e4('0x5b')]['id'];return db['CmList']['findOne']({'where':{'id':_0x1cb4df[_0xb2e4('0x51')]['id']}})['then'](handleEntityNotFound(_0x5c56ad,null))[_0xb2e4('0x2f')](function(_0x22487a){if(_0x22487a){return db[_0xb2e4('0x82')][_0xb2e4('0x83')](function(_0x5c3f57){return db['CmCustomField'][_0xb2e4('0x54')](_0x1cb4df[_0xb2e4('0x5b')],{'transaction':_0x5c3f57})[_0xb2e4('0x2f')](function(_0x1aac46){_0x44536d=_0x1aac46;return _0x22487a[_0xb2e4('0x84')](_0x1aac46,{'transaction':_0x5c3f57});})[_0xb2e4('0x2f')](function(){var _0x349998={'type':db['Sequelize'][_0xb2e4('0x85')],'transaction':_0x5c3f57};switch(_0x1cb4df['body']['type']){case _0xb2e4('0x86'):_0x349998[_0xb2e4('0x3b')]=db[_0xb2e4('0x87')]['TEXT'];break;case _0xb2e4('0x88'):_0x349998[_0xb2e4('0x3b')]=db[_0xb2e4('0x87')][_0xb2e4('0x89')];break;case'switch':_0x349998[_0xb2e4('0x3b')]=db[_0xb2e4('0x87')][_0xb2e4('0x8a')];_0x349998[_0xb2e4('0x8b')]=![];break;default:}return db[_0xb2e4('0x82')][_0xb2e4('0x8c')][_0xb2e4('0x8d')](_0xb2e4('0x8e'),util[_0xb2e4('0x75')](_0xb2e4('0x8f'),_0x44536d['id']),_0x349998);})[_0xb2e4('0x2f')](function(){return _0x44536d;});});}})['then'](respondWithResult(_0x5c56ad,null))[_0xb2e4('0x50')](handleError(_0x5c56ad,null));};exports[_0xb2e4('0x90')]=function(_0x524e7d,_0x38704f,_0x1c506e){var _0x2338ba={};var _0x56b5db={};var _0x42fc9b;var _0x3e6143;return db[_0xb2e4('0x38')][_0xb2e4('0x61')]({'where':{'id':_0x524e7d['params']['id']}})[_0xb2e4('0x2f')](handleEntityNotFound(_0x38704f,null))[_0xb2e4('0x2f')](function(_0x992173){if(_0x992173){_0x42fc9b=_0x992173;_0x56b5db[_0xb2e4('0x3c')]=_[_0xb2e4('0x52')](db[_0xb2e4('0x72')][_0xb2e4('0x39')]);_0x56b5db['query']=_[_0xb2e4('0x52')](_0x524e7d[_0xb2e4('0x3e')]);_0x56b5db[_0xb2e4('0x3f')]=_[_0xb2e4('0x40')](_0x56b5db[_0xb2e4('0x3c')],_0x56b5db[_0xb2e4('0x3e')]);_0x2338ba[_0xb2e4('0x42')]=_[_0xb2e4('0x40')](_0x56b5db['model'],qs[_0xb2e4('0x41')](_0x524e7d[_0xb2e4('0x3e')][_0xb2e4('0x41')]));_0x2338ba[_0xb2e4('0x42')]=_0x2338ba[_0xb2e4('0x42')][_0xb2e4('0x43')]?_0x2338ba[_0xb2e4('0x42')]:_0x56b5db[_0xb2e4('0x3c')];_0x2338ba['order']=qs[_0xb2e4('0x45')](_0x524e7d[_0xb2e4('0x3e')][_0xb2e4('0x45')]);_0x2338ba[_0xb2e4('0x46')]=qs[_0xb2e4('0x3f')](_[_0xb2e4('0x47')](_0x524e7d['query'],_0x56b5db[_0xb2e4('0x3f')]));_0x2338ba[_0xb2e4('0x46')]=_[_0xb2e4('0x4a')](_0x2338ba[_0xb2e4('0x46')],{'$or':[{'ListId':_0x992173['id']},{'ListId':null}]});if(_0x524e7d[_0xb2e4('0x3e')][_0xb2e4('0x48')]){_0x2338ba[_0xb2e4('0x46')]=_['merge'](_0x2338ba['where'],{'$or':_[_0xb2e4('0x37')](_0x2338ba[_0xb2e4('0x42')],function(_0x5c8296){var _0x548081={};_0x548081[_0x5c8296]={'$like':'%'+_0x524e7d[_0xb2e4('0x3e')][_0xb2e4('0x48')]+'%'};return _0x548081;})});}_0x2338ba=_[_0xb2e4('0x4a')]({},_0x2338ba,_0x524e7d[_0xb2e4('0x4b')]);return db[_0xb2e4('0x72')][_0xb2e4('0x91')](_0x2338ba);}})[_0xb2e4('0x2f')](respondWithResult(_0x38704f,null))[_0xb2e4('0x50')](handleError(_0x38704f,null));};exports[_0xb2e4('0x92')]=function(_0x38803a,_0x3d0d91,_0x5965b2){return db['CmList'][_0xb2e4('0x53')]({'where':{'id':_0x38803a[_0xb2e4('0x51')]['id']}})[_0xb2e4('0x2f')](handleEntityNotFound(_0x3d0d91,null))[_0xb2e4('0x2f')](function(_0x360cad){if(_0x360cad){return _0x360cad[_0xb2e4('0x92')](_0x38803a['body'][_0xb2e4('0x65')],_[_0xb2e4('0x6c')](_0x38803a[_0xb2e4('0x5b')],[_0xb2e4('0x65'),'id'])||{})[_0xb2e4('0x93')](function(_0x34945f){for(var _0x4d0b7b=0x0;_0x4d0b7b<_0x38803a['body'][_0xb2e4('0x65')]['length'];_0x4d0b7b+=0x1){socket[_0xb2e4('0x94')](_0xb2e4('0x95'),{'UserId':Number(_0x38803a[_0xb2e4('0x5b')][_0xb2e4('0x65')][_0x4d0b7b]),'CmListId':Number(_0x38803a['params']['id'])});}return _0x34945f;});}})[_0xb2e4('0x2f')](respondWithResult(_0x3d0d91,null))[_0xb2e4('0x50')](handleError(_0x3d0d91,null));};exports[_0xb2e4('0x96')]=function(_0x3167fb,_0x32a0c9,_0x201445){return db[_0xb2e4('0x38')]['find']({'where':{'id':_0x3167fb[_0xb2e4('0x51')]['id']}})['then'](handleEntityNotFound(_0x32a0c9,null))['then'](function(_0x4a55ca){if(_0x4a55ca){return _0x4a55ca['removeAgents'](_0x3167fb[_0xb2e4('0x3e')]['ids'])['then'](function(){if(_[_0xb2e4('0x69')](_0x3167fb[_0xb2e4('0x3e')][_0xb2e4('0x65')])){for(var _0x308f8d=0x0;_0x308f8d<_0x3167fb[_0xb2e4('0x3e')][_0xb2e4('0x65')][_0xb2e4('0x43')];_0x308f8d+=0x1){socket['emit'](_0xb2e4('0x97'),{'UserId':Number(_0x3167fb[_0xb2e4('0x3e')][_0xb2e4('0x65')][_0x308f8d]),'CmListId':Number(_0x3167fb[_0xb2e4('0x51')]['id'])});}}else{socket[_0xb2e4('0x94')](_0xb2e4('0x97'),{'UserId':Number(_0x3167fb[_0xb2e4('0x3e')]['ids']),'CmListId':Number(_0x3167fb['params']['id'])});}});}})[_0xb2e4('0x2f')](respondWithStatusCode(_0x32a0c9,null))[_0xb2e4('0x50')](handleError(_0x32a0c9,null));};exports['getAgents']=function(_0x2d3a12,_0x9fbb14,_0x183bec){var _0x448a6c={};var _0x5d0698={};var _0x58ec4c;var _0x2e1aa8;return db['CmList'][_0xb2e4('0x61')]({'where':{'id':_0x2d3a12[_0xb2e4('0x51')]['id']}})[_0xb2e4('0x2f')](handleEntityNotFound(_0x9fbb14,null))[_0xb2e4('0x2f')](function(_0x4f39fb){if(_0x4f39fb){_0x58ec4c=_0x4f39fb;_0x5d0698['model']=_[_0xb2e4('0x52')](db[_0xb2e4('0x98')]['rawAttributes']);_0x5d0698[_0xb2e4('0x3e')]=_[_0xb2e4('0x52')](_0x2d3a12['query']);_0x5d0698[_0xb2e4('0x3f')]=_[_0xb2e4('0x40')](_0x5d0698[_0xb2e4('0x3c')],_0x5d0698[_0xb2e4('0x3e')]);_0x448a6c[_0xb2e4('0x42')]=_[_0xb2e4('0x40')](_0x5d0698[_0xb2e4('0x3c')],qs['fields'](_0x2d3a12['query'][_0xb2e4('0x41')]));_0x448a6c[_0xb2e4('0x42')]=_0x448a6c[_0xb2e4('0x42')][_0xb2e4('0x43')]?_0x448a6c[_0xb2e4('0x42')]:_0x5d0698['model'];_0x448a6c[_0xb2e4('0x44')]=qs['sort'](_0x2d3a12[_0xb2e4('0x3e')]['sort']);_0x448a6c['where']=qs[_0xb2e4('0x3f')](_[_0xb2e4('0x47')](_0x2d3a12[_0xb2e4('0x3e')],_0x5d0698[_0xb2e4('0x3f')]));if(_0x2d3a12[_0xb2e4('0x3e')][_0xb2e4('0x48')]){_0x448a6c[_0xb2e4('0x46')]=_[_0xb2e4('0x4a')](_0x448a6c['where'],{'$or':_[_0xb2e4('0x37')](_0x448a6c[_0xb2e4('0x42')],function(_0x361b34){var _0x19a158={};_0x19a158[_0x361b34]={'$like':'%'+_0x2d3a12[_0xb2e4('0x3e')]['filter']+'%'};return _0x19a158;})});}_0x448a6c=_[_0xb2e4('0x4a')]({},_0x448a6c,_0x2d3a12[_0xb2e4('0x4b')]);return _0x58ec4c[_0xb2e4('0x99')](_0x448a6c);}})[_0xb2e4('0x2f')](function(_0x395a9a){if(_0x395a9a){_0x2e1aa8=_0x395a9a['length'];if(!_0x2d3a12['query'][_0xb2e4('0x62')]('nolimit')){_0x448a6c[_0xb2e4('0x28')]=qs['limit'](_0x2d3a12[_0xb2e4('0x3e')][_0xb2e4('0x28')]);_0x448a6c['offset']=qs['offset'](_0x2d3a12['query'][_0xb2e4('0x25')]);}return _0x58ec4c[_0xb2e4('0x99')](_0x448a6c);}})[_0xb2e4('0x2f')](function(_0x3f5d7c){if(_0x3f5d7c){return _0x3f5d7c?{'count':_0x2e1aa8,'rows':_0x3f5d7c}:null;}})[_0xb2e4('0x2f')](respondWithResult(_0x9fbb14,null))[_0xb2e4('0x50')](handleError(_0x9fbb14,null));}; \ No newline at end of file +var _0xff11=['attachment;\x20filename=','list_%d_%s.csv','Content-type','download','addCustomField','transaction','addCustomFields','Sequelize','TEXT','text','INTEGER','BOOLEAN','defaultValue','sequelize','queryInterface','addColumn','cm_contacts','cf_%s','getCustomFields','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','User','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmList.socket','sendStatus','status','offset','limit','undefined','count','set','json','reject','save','update','then','Lists','UserProfileResource','end','error','stack','name','send','index','map','CmList','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','destroy','describe','ListId','Disposition','create','getDispositions','findOne','sort','rows','removeDispositions','addContacts','isArray','tags','each','CmContact','omit','ids','success','push','dataValues','errors','Malformed\x20request\x20syntax','CmCustomField','concat','CustomFields','format','cf_%d','raw','getContacts','isEmpty','writeFileSync','/tmp/list_%d_%s.csv','setHeader','Content-disposition'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0xff11,0xb3));var _0x1ff1=function(_0xeb8826,_0x13a812){_0xeb8826=_0xeb8826-0x0;var _0x4811c5=_0xff11[_0xeb8826];return _0x4811c5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1ff1('0x0'));var zipdir=require(_0x1ff1('0x1'));var jsonpatch=require(_0x1ff1('0x2'));var rp=require(_0x1ff1('0x3'));var moment=require(_0x1ff1('0x4'));var BPromise=require(_0x1ff1('0x5'));var Mustache=require(_0x1ff1('0x6'));var util=require(_0x1ff1('0x7'));var path=require(_0x1ff1('0x8'));var sox=require(_0x1ff1('0x9'));var csv=require('to-csv');var ejs=require(_0x1ff1('0xa'));var fs=require('fs');var fs_extra=require(_0x1ff1('0xb'));var _=require(_0x1ff1('0xc'));var squel=require(_0x1ff1('0xd'));var crypto=require(_0x1ff1('0xe'));var jsforce=require(_0x1ff1('0xf'));var deskjs=require(_0x1ff1('0x10'));var toCsv=require(_0x1ff1('0x11'));var querystring=require(_0x1ff1('0x12'));var Papa=require(_0x1ff1('0x13'));var Redis=require(_0x1ff1('0x14'));var authService=require(_0x1ff1('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0x1ff1('0x16'));var hardwareService=require(_0x1ff1('0x17'));var logger=require(_0x1ff1('0x18'))(_0x1ff1('0x19'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x1ff1('0x1a'));var db=require(_0x1ff1('0x1b'))['db'];config[_0x1ff1('0x1c')]=_[_0x1ff1('0x1d')](config['redis'],{'host':_0x1ff1('0x1e'),'port':0x18eb});var socket=require(_0x1ff1('0x1f'))(new Redis(config[_0x1ff1('0x1c')]));require(_0x1ff1('0x20'))['register'](socket);function respondWithStatusCode(_0x3016d0,_0x1ec70c){_0x1ec70c=_0x1ec70c||0xcc;return function(_0x25b03c){if(_0x25b03c){return _0x3016d0[_0x1ff1('0x21')](_0x1ec70c);}return _0x3016d0[_0x1ff1('0x22')](_0x1ec70c)['end']();};}function respondWithResult(_0x34c0a1,_0x477501){_0x477501=_0x477501||0xc8;return function(_0x22f8e5){if(_0x22f8e5){return _0x34c0a1[_0x1ff1('0x22')](_0x477501)['json'](_0x22f8e5);}};}function respondWithFilteredResult(_0x476f49,_0x7a3c1b){return function(_0x3ae658){if(_0x3ae658){var _0x19f76a=typeof _0x7a3c1b[_0x1ff1('0x23')]==='undefined'&&typeof _0x7a3c1b[_0x1ff1('0x24')]===_0x1ff1('0x25');var _0x306e34=_0x3ae658[_0x1ff1('0x26')];var _0x318e83=_0x19f76a?0x0:_0x7a3c1b[_0x1ff1('0x23')];var _0x46d422=_0x19f76a?_0x3ae658[_0x1ff1('0x26')]:_0x7a3c1b['offset']+_0x7a3c1b[_0x1ff1('0x24')];var _0x3ca592;if(_0x46d422>=_0x306e34){_0x46d422=_0x306e34;_0x3ca592=0xc8;}else{_0x3ca592=0xce;}_0x476f49[_0x1ff1('0x22')](_0x3ca592);return _0x476f49[_0x1ff1('0x27')]('Content-Range',_0x318e83+'-'+_0x46d422+'/'+_0x306e34)[_0x1ff1('0x28')](_0x3ae658);}return null;};}function patchUpdates(_0x4325f8){return function(_0x10a215){try{jsonpatch['apply'](_0x10a215,_0x4325f8,!![]);}catch(_0x504fb3){return BPromise[_0x1ff1('0x29')](_0x504fb3);}return _0x10a215[_0x1ff1('0x2a')]();};}function saveUpdates(_0x714581,_0x11549f){return function(_0x5bbde9){if(_0x5bbde9){return _0x5bbde9[_0x1ff1('0x2b')](_0x714581)[_0x1ff1('0x2c')](function(_0x57fca5){return _0x57fca5;});}return null;};}function removeEntity(_0xd3680e,_0x4807d9){return function(_0x1ddbe4){if(_0x1ddbe4){return _0x1ddbe4['destroy']()[_0x1ff1('0x2c')](function(){var _0x15cbaf=_0x1ddbe4['get']({'plain':!![]});var _0x43abc1=_0x1ff1('0x2d');return db[_0x1ff1('0x2e')]['destroy']({'where':{'type':_0x43abc1,'resourceId':_0x15cbaf['id']}})[_0x1ff1('0x2c')](function(){return _0x1ddbe4;});})[_0x1ff1('0x2c')](function(){_0xd3680e[_0x1ff1('0x22')](0xcc)[_0x1ff1('0x2f')]();});}};}function handleEntityNotFound(_0x5a48ef,_0x4f778b){return function(_0x267c52){if(!_0x267c52){_0x5a48ef[_0x1ff1('0x21')](0x194);}return _0x267c52;};}function handleError(_0x12c92c,_0x42ca8f){_0x42ca8f=_0x42ca8f||0x1f4;return function(_0x4b5b77){logger[_0x1ff1('0x30')](_0x4b5b77[_0x1ff1('0x31')]);if(_0x4b5b77['name']){delete _0x4b5b77[_0x1ff1('0x32')];}_0x12c92c[_0x1ff1('0x22')](_0x42ca8f)[_0x1ff1('0x33')](_0x4b5b77);};}exports[_0x1ff1('0x34')]=function(_0x36e2cf,_0x2648a4){var _0x8b4c25={},_0x113e2c={},_0x25ac58={'count':0x0,'rows':[]};var _0x272068=_[_0x1ff1('0x35')](db[_0x1ff1('0x36')][_0x1ff1('0x37')],function(_0x16cf6a){return{'name':_0x16cf6a[_0x1ff1('0x38')],'type':_0x16cf6a[_0x1ff1('0x39')][_0x1ff1('0x3a')]};});_0x113e2c[_0x1ff1('0x3b')]=_[_0x1ff1('0x35')](_0x272068,_0x1ff1('0x32'));_0x113e2c[_0x1ff1('0x3c')]=_[_0x1ff1('0x3d')](_0x36e2cf[_0x1ff1('0x3c')]);_0x113e2c[_0x1ff1('0x3e')]=_[_0x1ff1('0x3f')](_0x113e2c['model'],_0x113e2c['query']);_0x8b4c25[_0x1ff1('0x40')]=_[_0x1ff1('0x3f')](_0x113e2c[_0x1ff1('0x3b')],qs[_0x1ff1('0x41')](_0x36e2cf[_0x1ff1('0x3c')]['fields']));_0x8b4c25[_0x1ff1('0x40')]=_0x8b4c25[_0x1ff1('0x40')][_0x1ff1('0x42')]?_0x8b4c25[_0x1ff1('0x40')]:_0x113e2c[_0x1ff1('0x3b')];if(!_0x36e2cf[_0x1ff1('0x3c')][_0x1ff1('0x43')](_0x1ff1('0x44'))){_0x8b4c25[_0x1ff1('0x24')]=qs[_0x1ff1('0x24')](_0x36e2cf[_0x1ff1('0x3c')][_0x1ff1('0x24')]);_0x8b4c25[_0x1ff1('0x23')]=qs[_0x1ff1('0x23')](_0x36e2cf[_0x1ff1('0x3c')][_0x1ff1('0x23')]);}_0x8b4c25[_0x1ff1('0x45')]=qs['sort'](_0x36e2cf[_0x1ff1('0x3c')]['sort']);_0x8b4c25[_0x1ff1('0x46')]=qs[_0x1ff1('0x3e')](_[_0x1ff1('0x47')](_0x36e2cf[_0x1ff1('0x3c')],_0x113e2c[_0x1ff1('0x3e')]),_0x272068);if(_0x36e2cf['query'][_0x1ff1('0x48')]){_0x8b4c25[_0x1ff1('0x46')]=_[_0x1ff1('0x49')](_0x8b4c25[_0x1ff1('0x46')],{'$or':_[_0x1ff1('0x35')](_0x272068,function(_0x7f16e){if(_0x7f16e['type']!==_0x1ff1('0x4a')){var _0x2ce65={};_0x2ce65[_0x7f16e[_0x1ff1('0x32')]]={'$like':'%'+_0x36e2cf[_0x1ff1('0x3c')][_0x1ff1('0x48')]+'%'};return _0x2ce65;}})});}_0x8b4c25=_[_0x1ff1('0x49')]({},_0x8b4c25,_0x36e2cf[_0x1ff1('0x4b')]);var _0x5b20fe={'where':_0x8b4c25[_0x1ff1('0x46')]};return db[_0x1ff1('0x36')][_0x1ff1('0x26')](_0x5b20fe)[_0x1ff1('0x2c')](function(_0x49f143){_0x25ac58[_0x1ff1('0x26')]=_0x49f143;if(_0x36e2cf[_0x1ff1('0x3c')][_0x1ff1('0x4c')]){_0x8b4c25[_0x1ff1('0x4d')]=[{'all':!![]}];}return db[_0x1ff1('0x36')][_0x1ff1('0x4e')](_0x8b4c25);})[_0x1ff1('0x2c')](function(_0xcc1923){_0x25ac58['rows']=_0xcc1923;return _0x25ac58;})[_0x1ff1('0x2c')](respondWithFilteredResult(_0x2648a4,_0x8b4c25))[_0x1ff1('0x4f')](handleError(_0x2648a4,null));};exports[_0x1ff1('0x50')]=function(_0x12e76e,_0x114e87){var _0x9fc8fa={'raw':![],'where':{'id':_0x12e76e[_0x1ff1('0x51')]['id']}},_0x3bcdee={};_0x3bcdee['model']=_[_0x1ff1('0x3d')](db[_0x1ff1('0x36')][_0x1ff1('0x37')]);_0x3bcdee['query']=_[_0x1ff1('0x3d')](_0x12e76e['query']);_0x3bcdee[_0x1ff1('0x3e')]=_[_0x1ff1('0x3f')](_0x3bcdee[_0x1ff1('0x3b')],_0x3bcdee[_0x1ff1('0x3c')]);_0x9fc8fa[_0x1ff1('0x40')]=_[_0x1ff1('0x3f')](_0x3bcdee['model'],qs['fields'](_0x12e76e[_0x1ff1('0x3c')][_0x1ff1('0x41')]));_0x9fc8fa[_0x1ff1('0x40')]=_0x9fc8fa[_0x1ff1('0x40')][_0x1ff1('0x42')]?_0x9fc8fa[_0x1ff1('0x40')]:_0x3bcdee[_0x1ff1('0x3b')];if(_0x12e76e[_0x1ff1('0x3c')]['includeAll']){_0x9fc8fa[_0x1ff1('0x4d')]=[{'all':!![]}];}_0x9fc8fa=_['merge']({},_0x9fc8fa,_0x12e76e[_0x1ff1('0x4b')]);return db[_0x1ff1('0x36')][_0x1ff1('0x52')](_0x9fc8fa)[_0x1ff1('0x2c')](handleEntityNotFound(_0x114e87,null))[_0x1ff1('0x2c')](respondWithResult(_0x114e87,null))[_0x1ff1('0x4f')](handleError(_0x114e87,null));};exports['create']=function(_0x4f2eba,_0x558b63){return db[_0x1ff1('0x36')]['create'](_0x4f2eba[_0x1ff1('0x53')],{})[_0x1ff1('0x2c')](function(_0x38f6bb){var _0x3309ff=_0x4f2eba[_0x1ff1('0x54')][_0x1ff1('0x55')]({'plain':!![]});if(!_0x3309ff)throw new Error(_0x1ff1('0x56'));if(_0x3309ff[_0x1ff1('0x57')]==='user'){var _0x3285dc=_0x38f6bb[_0x1ff1('0x55')]({'plain':!![]});var _0x5e4287='Lists';return db[_0x1ff1('0x58')]['find']({'where':{'name':_0x5e4287,'userProfileId':_0x3309ff[_0x1ff1('0x59')]},'raw':!![]})[_0x1ff1('0x2c')](function(_0x737b8e){if(_0x737b8e&&_0x737b8e[_0x1ff1('0x5a')]===0x0){return db[_0x1ff1('0x2e')]['create']({'name':_0x3285dc[_0x1ff1('0x32')],'resourceId':_0x3285dc['id'],'type':_0x737b8e[_0x1ff1('0x32')],'sectionId':_0x737b8e['id']},{})[_0x1ff1('0x2c')](function(){return _0x38f6bb;});}else{return _0x38f6bb;}})['catch'](function(_0x4c2be8){logger[_0x1ff1('0x30')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4c2be8);throw _0x4c2be8;});}return _0x38f6bb;})[_0x1ff1('0x2c')](respondWithResult(_0x558b63,0xc9))['catch'](handleError(_0x558b63,null));};exports[_0x1ff1('0x2b')]=function(_0x539fff,_0x2a6a9f){if(_0x539fff[_0x1ff1('0x53')]['id']){delete _0x539fff[_0x1ff1('0x53')]['id'];}return db[_0x1ff1('0x36')][_0x1ff1('0x52')]({'where':{'id':_0x539fff[_0x1ff1('0x51')]['id']}})[_0x1ff1('0x2c')](handleEntityNotFound(_0x2a6a9f,null))[_0x1ff1('0x2c')](saveUpdates(_0x539fff[_0x1ff1('0x53')],null))['then'](respondWithResult(_0x2a6a9f,null))[_0x1ff1('0x4f')](handleError(_0x2a6a9f,null));};exports[_0x1ff1('0x5b')]=function(_0x3ebb37,_0x34b77e){return db['CmList']['find']({'where':{'id':_0x3ebb37[_0x1ff1('0x51')]['id']}})[_0x1ff1('0x2c')](handleEntityNotFound(_0x34b77e,null))['then'](removeEntity(_0x34b77e,null))[_0x1ff1('0x4f')](handleError(_0x34b77e,null));};exports[_0x1ff1('0x5c')]=function(_0xfc288c,_0x52e189){return db['CmList'][_0x1ff1('0x5c')]()[_0x1ff1('0x2c')](respondWithResult(_0x52e189,null))['catch'](handleError(_0x52e189,null));};exports['addDisposition']=function(_0x2860fd,_0x284218,_0x4b82ba){if(_0x2860fd['body']['id']){delete _0x2860fd[_0x1ff1('0x53')]['id'];}return db[_0x1ff1('0x36')]['find']({'where':{'id':_0x2860fd[_0x1ff1('0x51')]['id']}})[_0x1ff1('0x2c')](handleEntityNotFound(_0x284218,null))[_0x1ff1('0x2c')](function(_0x3cd03f){if(_0x3cd03f){_0x2860fd['body'][_0x1ff1('0x5d')]=_0x3cd03f['id'];return db[_0x1ff1('0x5e')][_0x1ff1('0x5f')](_0x2860fd[_0x1ff1('0x53')]);}})[_0x1ff1('0x2c')](respondWithResult(_0x284218,null))[_0x1ff1('0x4f')](handleError(_0x284218,null));};exports[_0x1ff1('0x60')]=function(_0x1033c0,_0x4a6ad4,_0x120fb2){var _0x34115b={'raw':![],'where':{}};var _0x1186a7={};var _0x3ae55e={'count':0x0,'rows':[]};return db[_0x1ff1('0x36')][_0x1ff1('0x61')]({'where':{'id':_0x1033c0[_0x1ff1('0x51')]['id']}})['then'](handleEntityNotFound(_0x4a6ad4,null))[_0x1ff1('0x2c')](function(_0x2d1fc6){if(_0x2d1fc6){_0x1186a7[_0x1ff1('0x3b')]=_[_0x1ff1('0x3d')](db[_0x1ff1('0x5e')][_0x1ff1('0x37')]);_0x1186a7['query']=_[_0x1ff1('0x3d')](_0x1033c0['query']);_0x1186a7[_0x1ff1('0x3e')]=_[_0x1ff1('0x3f')](_0x1186a7[_0x1ff1('0x3b')],_0x1186a7['query']);_0x34115b['attributes']=_[_0x1ff1('0x3f')](_0x1186a7['model'],qs[_0x1ff1('0x41')](_0x1033c0[_0x1ff1('0x3c')][_0x1ff1('0x41')]));_0x34115b[_0x1ff1('0x40')]=_0x34115b[_0x1ff1('0x40')]['length']?_0x34115b[_0x1ff1('0x40')]:_0x1186a7['model'];if(!_0x1033c0['query'][_0x1ff1('0x43')](_0x1ff1('0x44'))){_0x34115b[_0x1ff1('0x24')]=qs[_0x1ff1('0x24')](_0x1033c0[_0x1ff1('0x3c')]['limit']);_0x34115b['offset']=qs[_0x1ff1('0x23')](_0x1033c0[_0x1ff1('0x3c')][_0x1ff1('0x23')]);}_0x34115b['order']=qs['sort'](_0x1033c0[_0x1ff1('0x3c')][_0x1ff1('0x62')]);_0x34115b[_0x1ff1('0x46')]=qs[_0x1ff1('0x3e')](_['pick'](_0x1033c0[_0x1ff1('0x3c')],_0x1186a7[_0x1ff1('0x3e')]));_0x34115b['where'][_0x1ff1('0x5d')]=_0x2d1fc6['id'];if(_0x1033c0[_0x1ff1('0x3c')]['filter']){_0x34115b[_0x1ff1('0x46')]=_['merge'](_0x34115b[_0x1ff1('0x46')],{'$or':_[_0x1ff1('0x35')](_0x34115b['attributes'],function(_0x80f09d){var _0x4f9c66={};_0x4f9c66[_0x80f09d]={'$like':'%'+_0x1033c0[_0x1ff1('0x3c')]['filter']+'%'};return _0x4f9c66;})});}_0x34115b=_[_0x1ff1('0x49')]({},_0x34115b,_0x1033c0[_0x1ff1('0x4b')]);return db[_0x1ff1('0x5e')]['count']({'where':_0x34115b['where']})[_0x1ff1('0x2c')](function(_0x55a3df){_0x3ae55e[_0x1ff1('0x26')]=_0x55a3df;if(_0x1033c0[_0x1ff1('0x3c')][_0x1ff1('0x4c')]){_0x34115b['include']=[{'all':!![]}];}return db[_0x1ff1('0x5e')][_0x1ff1('0x4e')](_0x34115b);})['then'](function(_0x2838f3){_0x3ae55e[_0x1ff1('0x63')]=_0x2838f3;return _0x3ae55e;});}})[_0x1ff1('0x2c')](respondWithFilteredResult(_0x4a6ad4,_0x34115b))[_0x1ff1('0x4f')](handleError(_0x4a6ad4,null));};exports['removeDispositions']=function(_0x4993d9,_0x58c436,_0x587041){return db[_0x1ff1('0x36')][_0x1ff1('0x52')]({'where':{'id':_0x4993d9[_0x1ff1('0x51')]['id']}})[_0x1ff1('0x2c')](handleEntityNotFound(_0x58c436,null))['then'](function(_0x2cc241){if(_0x2cc241){return _0x2cc241[_0x1ff1('0x64')](_0x4993d9['query']['ids']);}})['then'](respondWithStatusCode(_0x58c436,null))[_0x1ff1('0x4f')](handleError(_0x58c436,null));};exports[_0x1ff1('0x65')]=function(_0x5d24ea,_0x38022b,_0xa87d23){return db[_0x1ff1('0x36')][_0x1ff1('0x52')]({'where':{'id':_0x5d24ea['params']['id']}})[_0x1ff1('0x2c')](handleEntityNotFound(_0x38022b,null))[_0x1ff1('0x2c')](function(_0x2dad23){if(_0x2dad23){var _0x5b16c0=[];var _0x34fdad={'success':[],'errors':[]};return db['CmContact'][_0x1ff1('0x5c')]()['then'](function(_0x31abfd){if(_0x5d24ea[_0x1ff1('0x53')]['tags']&&_[_0x1ff1('0x66')](_0x5d24ea[_0x1ff1('0x53')][_0x1ff1('0x67')])){if(_0x5d24ea[_0x1ff1('0x53')][_0x1ff1('0x67')]['length']){_0x5d24ea[_0x1ff1('0x53')]['tags']=_0x5d24ea[_0x1ff1('0x53')][_0x1ff1('0x67')]['join'](';')+';';}else{_0x5d24ea[_0x1ff1('0x53')][_0x1ff1('0x67')]=null;}}else{_0x5d24ea['body'][_0x1ff1('0x67')]=null;}if(_0x5d24ea[_0x1ff1('0x53')]&&_[_0x1ff1('0x66')](_0x5d24ea[_0x1ff1('0x53')])){for(var _0x4c263c=0x0;_0x4c263c<_0x5d24ea['body'][_0x1ff1('0x42')];_0x4c263c+=0x1){_0x5d24ea[_0x1ff1('0x53')][_0x4c263c][_0x1ff1('0x5d')]=_0x5d24ea[_0x1ff1('0x51')]['id'];_0x5b16c0['push'](_0x5d24ea[_0x1ff1('0x53')][_0x4c263c]);}return BPromise[_0x1ff1('0x68')](_0x5b16c0,function(_0x5e2b83){return db[_0x1ff1('0x69')][_0x1ff1('0x5f')](_[_0x1ff1('0x6a')](_0x5e2b83,[_0x1ff1('0x6b'),'id'])||{},{'fields':_[_0x1ff1('0x3d')](_0x31abfd),'raw':!![]})[_0x1ff1('0x2c')](function(_0x1bf728){_0x34fdad[_0x1ff1('0x6c')][_0x1ff1('0x6d')](_0x1bf728[_0x1ff1('0x6e')]);})[_0x1ff1('0x4f')](function(_0x241be2){_0x34fdad[_0x1ff1('0x6f')]['push']({'data':_0x5e2b83,'error':_0x241be2['message']});});})['then'](function(_0x5e8d07){return _0x34fdad;})[_0x1ff1('0x4f')](function(_0x5f22fb){return _0x5f22fb;});}else{_0x38022b[_0x1ff1('0x22')](0x190)['json']({'message':_0x1ff1('0x70')});}});}})[_0x1ff1('0x2c')](respondWithResult(_0x38022b,null))[_0x1ff1('0x4f')](handleError(_0x38022b,null));};exports['getContacts']=function(_0x42bb66,_0x2527a0,_0x3797a8){var _0x4d1999;return db[_0x1ff1('0x36')][_0x1ff1('0x52')]({'where':{'id':_0x42bb66[_0x1ff1('0x51')]['id']},'include':[{'model':db[_0x1ff1('0x71')],'as':'CustomFields'}]})[_0x1ff1('0x2c')](handleEntityNotFound(_0x2527a0,null))['then'](function(_0x52c867){if(_0x52c867){_0x4d1999=_0x52c867;return db[_0x1ff1('0x69')][_0x1ff1('0x37')];}})[_0x1ff1('0x2c')](function(_0x53f316){if(_0x53f316){var _0x54aef6={};var _0x23a161={};_0x23a161[_0x1ff1('0x3b')]=_[_0x1ff1('0x72')](_['keys'](_0x53f316),_['map'](_0x4d1999[_0x1ff1('0x73')],function(_0x1e9c6a){return util[_0x1ff1('0x74')](_0x1ff1('0x75'),_0x1e9c6a['id']);}));_0x23a161[_0x1ff1('0x3c')]=_[_0x1ff1('0x3d')](_0x42bb66[_0x1ff1('0x3c')]);_0x23a161[_0x1ff1('0x3e')]=_[_0x1ff1('0x3f')](_0x23a161[_0x1ff1('0x3b')],_0x23a161[_0x1ff1('0x3c')]);_0x54aef6['attributes']=_[_0x1ff1('0x3f')](_0x23a161['model'],qs[_0x1ff1('0x41')](_0x42bb66[_0x1ff1('0x3c')][_0x1ff1('0x41')]));_0x54aef6[_0x1ff1('0x40')]=_0x54aef6[_0x1ff1('0x40')][_0x1ff1('0x42')]?_0x54aef6[_0x1ff1('0x40')]:_0x23a161[_0x1ff1('0x3b')];if(!_0x42bb66[_0x1ff1('0x3c')][_0x1ff1('0x43')]('nolimit')){_0x54aef6['limit']=qs[_0x1ff1('0x24')](_0x42bb66[_0x1ff1('0x3c')][_0x1ff1('0x24')]);_0x54aef6['offset']=qs[_0x1ff1('0x23')](_0x42bb66[_0x1ff1('0x3c')]['offset']);}_0x54aef6[_0x1ff1('0x45')]=qs[_0x1ff1('0x62')](_0x42bb66[_0x1ff1('0x3c')][_0x1ff1('0x62')]);_0x54aef6[_0x1ff1('0x46')]=qs[_0x1ff1('0x3e')](_[_0x1ff1('0x47')](_0x42bb66[_0x1ff1('0x3c')],_0x23a161[_0x1ff1('0x3e')]));_0x54aef6[_0x1ff1('0x76')]=!![];if(_0x42bb66[_0x1ff1('0x3c')]['filter']){_0x54aef6['where']=_[_0x1ff1('0x49')](_0x54aef6[_0x1ff1('0x46')],{'$or':_[_0x1ff1('0x35')](_0x54aef6['attributes'],function(_0x95d8b4){var _0x191c61={};_0x191c61[_0x95d8b4]={'$like':'%'+_0x42bb66['query'][_0x1ff1('0x48')]+'%'};return _0x191c61;})});}_0x54aef6=_[_0x1ff1('0x49')]({},_0x54aef6,_0x42bb66[_0x1ff1('0x4b')]);return _0x4d1999[_0x1ff1('0x77')](_0x54aef6);}})[_0x1ff1('0x2c')](respondWithResult(_0x2527a0,null))[_0x1ff1('0x4f')](handleError(_0x2527a0,null));};exports['getContactsCsv']=function(_0x156301,_0x1181de,_0x76abdb){var _0x39e01a;return db[_0x1ff1('0x36')]['find']({'where':{'id':_0x156301[_0x1ff1('0x51')]['id']},'include':[{'model':db[_0x1ff1('0x71')],'as':_0x1ff1('0x73')}]})['then'](handleEntityNotFound(_0x1181de,null))[_0x1ff1('0x2c')](function(_0x200c12){if(_0x200c12){_0x39e01a=_0x200c12;return db['CmContact']['rawAttributes'];}})[_0x1ff1('0x2c')](function(_0x23e51c){if(_0x23e51c){var _0x525d25={};var _0x3c3fbc={};_0x3c3fbc[_0x1ff1('0x3b')]=_[_0x1ff1('0x72')](_[_0x1ff1('0x3d')](_0x23e51c),_['map'](_0x39e01a[_0x1ff1('0x73')],function(_0x50ba76){return util[_0x1ff1('0x74')]('cf_%d',_0x50ba76['id']);}));_0x3c3fbc[_0x1ff1('0x3c')]=_['keys'](_0x156301[_0x1ff1('0x3c')]);_0x3c3fbc['filters']=_[_0x1ff1('0x3f')](_0x3c3fbc[_0x1ff1('0x3b')],_0x3c3fbc['query']);_0x525d25[_0x1ff1('0x40')]=_[_0x1ff1('0x3f')](_0x3c3fbc[_0x1ff1('0x3b')],qs[_0x1ff1('0x41')](_0x156301['query'][_0x1ff1('0x41')]));_0x525d25['attributes']=_0x525d25['attributes'][_0x1ff1('0x42')]?_0x525d25[_0x1ff1('0x40')]:_0x3c3fbc[_0x1ff1('0x3b')];if(!_0x156301['query'][_0x1ff1('0x43')](_0x1ff1('0x44'))){_0x525d25['limit']=qs[_0x1ff1('0x24')](_0x156301[_0x1ff1('0x3c')][_0x1ff1('0x24')]);_0x525d25[_0x1ff1('0x23')]=qs[_0x1ff1('0x23')](_0x156301['query'][_0x1ff1('0x23')]);}_0x525d25[_0x1ff1('0x45')]=qs[_0x1ff1('0x62')](_0x156301['query']['sort']);_0x525d25['where']=qs[_0x1ff1('0x3e')](_[_0x1ff1('0x47')](_0x156301['query'],_0x3c3fbc['filters']));_0x525d25[_0x1ff1('0x76')]=!![];if(_0x156301['query'][_0x1ff1('0x48')]){_0x525d25[_0x1ff1('0x46')]=_[_0x1ff1('0x49')](_0x525d25[_0x1ff1('0x46')],{'$or':_[_0x1ff1('0x35')](_0x525d25['attributes'],function(_0x19abef){var _0x494f80={};_0x494f80[_0x19abef]={'$like':'%'+_0x156301['query'][_0x1ff1('0x48')]+'%'};return _0x494f80;})});}_0x525d25=_['merge']({},_0x525d25,_0x156301[_0x1ff1('0x4b')]);return _0x39e01a[_0x1ff1('0x77')](_0x525d25);}})[_0x1ff1('0x2c')](function(_0x314d54){if(!_[_0x1ff1('0x78')](_0x314d54)){var _0x3f0ecb=toCsv(_0x314d54);var _0x125119=Date['now']();fs[_0x1ff1('0x79')](util['format'](_0x1ff1('0x7a'),_0x39e01a['id'],_0x125119),_0x3f0ecb);_0x1181de[_0x1ff1('0x7b')](_0x1ff1('0x7c'),_0x1ff1('0x7d')+util['format'](_0x1ff1('0x7e'),_0x39e01a['id'],_0x125119));_0x1181de[_0x1ff1('0x7b')](_0x1ff1('0x7f'),'text/csv');return _0x1181de[_0x1ff1('0x80')](util[_0x1ff1('0x74')](_0x1ff1('0x7a'),_0x39e01a['id'],_0x125119));}else{return _0x1181de[_0x1ff1('0x21')](0xcc);}})[_0x1ff1('0x4f')](handleError(_0x1181de,null));};exports[_0x1ff1('0x81')]=function(_0x1a6854,_0x4c6fa9,_0x3677d8){var _0xf3803e;delete _0x1a6854['body']['id'];return db['CmList'][_0x1ff1('0x61')]({'where':{'id':_0x1a6854['params']['id']}})['then'](handleEntityNotFound(_0x4c6fa9,null))[_0x1ff1('0x2c')](function(_0x42f869){if(_0x42f869){return db['sequelize'][_0x1ff1('0x82')](function(_0x5a1d94){return db[_0x1ff1('0x71')]['create'](_0x1a6854['body'],{'transaction':_0x5a1d94})[_0x1ff1('0x2c')](function(_0x1cf399){_0xf3803e=_0x1cf399;return _0x42f869[_0x1ff1('0x83')](_0x1cf399,{'transaction':_0x5a1d94});})[_0x1ff1('0x2c')](function(){var _0x44d8c3={'type':db[_0x1ff1('0x84')][_0x1ff1('0x85')],'transaction':_0x5a1d94};switch(_0x1a6854[_0x1ff1('0x53')]['type']){case _0x1ff1('0x86'):_0x44d8c3[_0x1ff1('0x39')]=db['Sequelize'][_0x1ff1('0x85')];break;case'number':_0x44d8c3[_0x1ff1('0x39')]=db[_0x1ff1('0x84')][_0x1ff1('0x87')];break;case'switch':_0x44d8c3[_0x1ff1('0x39')]=db[_0x1ff1('0x84')][_0x1ff1('0x88')];_0x44d8c3[_0x1ff1('0x89')]=![];break;default:}return db[_0x1ff1('0x8a')][_0x1ff1('0x8b')][_0x1ff1('0x8c')](_0x1ff1('0x8d'),util[_0x1ff1('0x74')](_0x1ff1('0x8e'),_0xf3803e['id']),_0x44d8c3);})[_0x1ff1('0x2c')](function(){return _0xf3803e;});});}})['then'](respondWithResult(_0x4c6fa9,null))[_0x1ff1('0x4f')](handleError(_0x4c6fa9,null));};exports[_0x1ff1('0x8f')]=function(_0x3cbc60,_0x19279d,_0x9a10ef){var _0x41d61a={};var _0x5a95fd={};var _0x1a731e;var _0x502514;return db['CmList'][_0x1ff1('0x61')]({'where':{'id':_0x3cbc60[_0x1ff1('0x51')]['id']}})[_0x1ff1('0x2c')](handleEntityNotFound(_0x19279d,null))['then'](function(_0x5dc223){if(_0x5dc223){_0x1a731e=_0x5dc223;_0x5a95fd[_0x1ff1('0x3b')]=_[_0x1ff1('0x3d')](db[_0x1ff1('0x71')]['rawAttributes']);_0x5a95fd[_0x1ff1('0x3c')]=_[_0x1ff1('0x3d')](_0x3cbc60['query']);_0x5a95fd[_0x1ff1('0x3e')]=_['intersection'](_0x5a95fd['model'],_0x5a95fd[_0x1ff1('0x3c')]);_0x41d61a[_0x1ff1('0x40')]=_[_0x1ff1('0x3f')](_0x5a95fd[_0x1ff1('0x3b')],qs[_0x1ff1('0x41')](_0x3cbc60[_0x1ff1('0x3c')][_0x1ff1('0x41')]));_0x41d61a['attributes']=_0x41d61a[_0x1ff1('0x40')][_0x1ff1('0x42')]?_0x41d61a[_0x1ff1('0x40')]:_0x5a95fd['model'];_0x41d61a[_0x1ff1('0x45')]=qs[_0x1ff1('0x62')](_0x3cbc60['query']['sort']);_0x41d61a['where']=qs[_0x1ff1('0x3e')](_[_0x1ff1('0x47')](_0x3cbc60[_0x1ff1('0x3c')],_0x5a95fd[_0x1ff1('0x3e')]));_0x41d61a[_0x1ff1('0x46')]=_[_0x1ff1('0x49')](_0x41d61a[_0x1ff1('0x46')],{'$or':[{'ListId':_0x5dc223['id']},{'ListId':null}]});if(_0x3cbc60['query'][_0x1ff1('0x48')]){_0x41d61a[_0x1ff1('0x46')]=_[_0x1ff1('0x49')](_0x41d61a[_0x1ff1('0x46')],{'$or':_['map'](_0x41d61a[_0x1ff1('0x40')],function(_0x5e1d4d){var _0x2b8117={};_0x2b8117[_0x5e1d4d]={'$like':'%'+_0x3cbc60[_0x1ff1('0x3c')]['filter']+'%'};return _0x2b8117;})});}_0x41d61a=_[_0x1ff1('0x49')]({},_0x41d61a,_0x3cbc60[_0x1ff1('0x4b')]);return db[_0x1ff1('0x71')]['findAndCountAll'](_0x41d61a);}})[_0x1ff1('0x2c')](respondWithResult(_0x19279d,null))[_0x1ff1('0x4f')](handleError(_0x19279d,null));};exports[_0x1ff1('0x90')]=function(_0x38f95e,_0x54cb00,_0x915834){return db[_0x1ff1('0x36')][_0x1ff1('0x52')]({'where':{'id':_0x38f95e['params']['id']}})[_0x1ff1('0x2c')](handleEntityNotFound(_0x54cb00,null))['then'](function(_0x1547e1){if(_0x1547e1){return _0x1547e1['addAgents'](_0x38f95e['body'][_0x1ff1('0x6b')],_['omit'](_0x38f95e[_0x1ff1('0x53')],[_0x1ff1('0x6b'),'id'])||{})[_0x1ff1('0x91')](function(_0x44f8ae){for(var _0x33d175=0x0;_0x33d175<_0x38f95e[_0x1ff1('0x53')]['ids']['length'];_0x33d175+=0x1){socket[_0x1ff1('0x92')](_0x1ff1('0x93'),{'UserId':Number(_0x38f95e['body'][_0x1ff1('0x6b')][_0x33d175]),'CmListId':Number(_0x38f95e[_0x1ff1('0x51')]['id'])});}return _0x44f8ae;});}})[_0x1ff1('0x2c')](respondWithResult(_0x54cb00,null))[_0x1ff1('0x4f')](handleError(_0x54cb00,null));};exports[_0x1ff1('0x94')]=function(_0x2c6fa9,_0x2081f9,_0x2a2cee){return db[_0x1ff1('0x36')][_0x1ff1('0x52')]({'where':{'id':_0x2c6fa9[_0x1ff1('0x51')]['id']}})[_0x1ff1('0x2c')](handleEntityNotFound(_0x2081f9,null))[_0x1ff1('0x2c')](function(_0x54183c){if(_0x54183c){return _0x54183c[_0x1ff1('0x94')](_0x2c6fa9['query'][_0x1ff1('0x6b')])[_0x1ff1('0x2c')](function(){if(_[_0x1ff1('0x66')](_0x2c6fa9[_0x1ff1('0x3c')][_0x1ff1('0x6b')])){for(var _0x5278c1=0x0;_0x5278c1<_0x2c6fa9['query'][_0x1ff1('0x6b')]['length'];_0x5278c1+=0x1){socket[_0x1ff1('0x92')](_0x1ff1('0x95'),{'UserId':Number(_0x2c6fa9['query'][_0x1ff1('0x6b')][_0x5278c1]),'CmListId':Number(_0x2c6fa9[_0x1ff1('0x51')]['id'])});}}else{socket[_0x1ff1('0x92')](_0x1ff1('0x95'),{'UserId':Number(_0x2c6fa9['query'][_0x1ff1('0x6b')]),'CmListId':Number(_0x2c6fa9['params']['id'])});}});}})['then'](respondWithStatusCode(_0x2081f9,null))[_0x1ff1('0x4f')](handleError(_0x2081f9,null));};exports[_0x1ff1('0x96')]=function(_0x5b467f,_0x710f56,_0x14ca2e){var _0x3701a6={};var _0x4a8e04={};var _0x195972;var _0xa9af90;return db[_0x1ff1('0x36')][_0x1ff1('0x61')]({'where':{'id':_0x5b467f['params']['id']}})[_0x1ff1('0x2c')](handleEntityNotFound(_0x710f56,null))[_0x1ff1('0x2c')](function(_0x2c1351){if(_0x2c1351){_0x195972=_0x2c1351;_0x4a8e04[_0x1ff1('0x3b')]=_[_0x1ff1('0x3d')](db[_0x1ff1('0x97')]['rawAttributes']);_0x4a8e04[_0x1ff1('0x3c')]=_['keys'](_0x5b467f[_0x1ff1('0x3c')]);_0x4a8e04[_0x1ff1('0x3e')]=_[_0x1ff1('0x3f')](_0x4a8e04['model'],_0x4a8e04[_0x1ff1('0x3c')]);_0x3701a6[_0x1ff1('0x40')]=_[_0x1ff1('0x3f')](_0x4a8e04[_0x1ff1('0x3b')],qs[_0x1ff1('0x41')](_0x5b467f['query']['fields']));_0x3701a6[_0x1ff1('0x40')]=_0x3701a6[_0x1ff1('0x40')][_0x1ff1('0x42')]?_0x3701a6['attributes']:_0x4a8e04[_0x1ff1('0x3b')];_0x3701a6[_0x1ff1('0x45')]=qs[_0x1ff1('0x62')](_0x5b467f[_0x1ff1('0x3c')][_0x1ff1('0x62')]);_0x3701a6['where']=qs[_0x1ff1('0x3e')](_[_0x1ff1('0x47')](_0x5b467f[_0x1ff1('0x3c')],_0x4a8e04['filters']));if(_0x5b467f[_0x1ff1('0x3c')][_0x1ff1('0x48')]){_0x3701a6[_0x1ff1('0x46')]=_['merge'](_0x3701a6[_0x1ff1('0x46')],{'$or':_['map'](_0x3701a6[_0x1ff1('0x40')],function(_0x15c348){var _0x45c935={};_0x45c935[_0x15c348]={'$like':'%'+_0x5b467f['query'][_0x1ff1('0x48')]+'%'};return _0x45c935;})});}_0x3701a6=_[_0x1ff1('0x49')]({},_0x3701a6,_0x5b467f[_0x1ff1('0x4b')]);return _0x195972[_0x1ff1('0x96')](_0x3701a6);}})['then'](function(_0x45bfe0){if(_0x45bfe0){_0xa9af90=_0x45bfe0['length'];if(!_0x5b467f[_0x1ff1('0x3c')][_0x1ff1('0x43')](_0x1ff1('0x44'))){_0x3701a6[_0x1ff1('0x24')]=qs[_0x1ff1('0x24')](_0x5b467f['query'][_0x1ff1('0x24')]);_0x3701a6[_0x1ff1('0x23')]=qs[_0x1ff1('0x23')](_0x5b467f[_0x1ff1('0x3c')][_0x1ff1('0x23')]);}return _0x195972[_0x1ff1('0x96')](_0x3701a6);}})['then'](function(_0x5f4175){if(_0x5f4175){return _0x5f4175?{'count':_0xa9af90,'rows':_0x5f4175}:null;}})[_0x1ff1('0x2c')](respondWithResult(_0x710f56,null))[_0x1ff1('0x4f')](handleError(_0x710f56,null));}; \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index 5512a26..cbb95d1 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 _0x3e74=['hasOwnProperty','exports','events','CmList','setMaxListeners','save','emit'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x3e74,0x175));var _0x43e7=function(_0x169cc6,_0x192e5b){_0x169cc6=_0x169cc6-0x0;var _0x2300f8=_0x3e74[_0x169cc6];return _0x2300f8;};'use strict';var EventEmitter=require(_0x43e7('0x0'));var CmList=require('../../mysqldb')['db'][_0x43e7('0x1')];var CmListEvents=new EventEmitter();CmListEvents[_0x43e7('0x2')](0x0);var events={'afterCreate':_0x43e7('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xc58479){return function(_0x4f9bbe,_0x128b0f,_0xe838b4){CmListEvents[_0x43e7('0x4')](_0xc58479+':'+_0x4f9bbe['id'],_0x4f9bbe);CmListEvents[_0x43e7('0x4')](_0xc58479,_0x4f9bbe);_0xe838b4(null);};}for(var e in events){if(events[_0x43e7('0x5')](e)){var event=events[e];CmList['hook'](e,emitEvent(event));}}module[_0x43e7('0x6')]=CmListEvents; \ No newline at end of file +var _0x55ca=['events','../../mysqldb','update','remove','emit','hasOwnProperty','hook'];(function(_0x125ff8,_0x41925f){var _0x2d9ef=function(_0x4ef34c){while(--_0x4ef34c){_0x125ff8['push'](_0x125ff8['shift']());}};_0x2d9ef(++_0x41925f);}(_0x55ca,0x126));var _0xa55c=function(_0x1058ed,_0x109d8d){_0x1058ed=_0x1058ed-0x0;var _0x4e4661=_0x55ca[_0x1058ed];return _0x4e4661;};'use strict';var EventEmitter=require(_0xa55c('0x0'));var CmList=require(_0xa55c('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xa55c('0x2'),'afterDestroy':_0xa55c('0x3')};function emitEvent(_0x5dc716){return function(_0x3b478a,_0x2db02a,_0xcb02e3){CmListEvents[_0xa55c('0x4')](_0x5dc716+':'+_0x3b478a['id'],_0x3b478a);CmListEvents[_0xa55c('0x4')](_0x5dc716,_0x3b478a);_0xcb02e3(null);};}for(var e in events){if(events[_0xa55c('0x5')](e)){var event=events[e];CmList[_0xa55c('0x6')](e,emitEvent(event));}}module['exports']=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index be0c625..5626454 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 _0x0a9a=['bluebird','request-promise','rimraf','../../config/environment','exports','define','cm_lists','util','api','moment'];(function(_0x59a576,_0x2c8616){var _0xb54f81=function(_0x5353d6){while(--_0x5353d6){_0x59a576['push'](_0x59a576['shift']());}};_0xb54f81(++_0x2c8616);}(_0x0a9a,0x183));var _0xa0a9=function(_0xaa3a5b,_0x3715e6){_0xaa3a5b=_0xaa3a5b-0x0;var _0x5cf696=_0x0a9a[_0xaa3a5b];return _0x5cf696;};'use strict';var _=require('lodash');var util=require(_0xa0a9('0x0'));var logger=require('../../config/logger')(_0xa0a9('0x1'));var moment=require(_0xa0a9('0x2'));var BPromise=require(_0xa0a9('0x3'));var rp=require(_0xa0a9('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa0a9('0x5'));var config=require(_0xa0a9('0x6'));var attributes=require('./cmList.attributes');module[_0xa0a9('0x7')]=function(_0xc65bbb,_0x1aa717){return _0xc65bbb[_0xa0a9('0x8')]('CmList',attributes,{'tableName':_0xa0a9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xee5b=['request-promise','path','rimraf','exports','define','lodash','../../config/logger','api','bluebird'];(function(_0x4b748f,_0x241a76){var _0x4ece40=function(_0x5f0322){while(--_0x5f0322){_0x4b748f['push'](_0x4b748f['shift']());}};_0x4ece40(++_0x241a76);}(_0xee5b,0x1f4));var _0xbee5=function(_0x36ffb7,_0x16fd5f){_0x36ffb7=_0x36ffb7-0x0;var _0x4a9e52=_0xee5b[_0x36ffb7];return _0x4a9e52;};'use strict';var _=require(_0xbee5('0x0'));var util=require('util');var logger=require(_0xbee5('0x1'))(_0xbee5('0x2'));var moment=require('moment');var BPromise=require(_0xbee5('0x3'));var rp=require(_0xbee5('0x4'));var fs=require('fs');var path=require(_0xbee5('0x5'));var rimraf=require(_0xbee5('0x6'));var config=require('../../config/environment');var attributes=require('./cmList.attributes');module[_0xbee5('0x7')]=function(_0x2c0bde,_0xab6e4d){return _0x2c0bde[_0xbee5('0x8')]('CmList',attributes,{'tableName':'cm_lists','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmList/cmList.rpc.js b/server/api/cmList/cmList.rpc.js index 52c1ce9..7cf303a 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 _0x3d86=['message','result','moment','../../mysqldb','../../config/logger','rpc','jayson/promise','client','redis','localhost','./cmList.socket','register','request','then','info','CmList,\x20%s,\x20%s','debug','CmList,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x22a14f,_0x24b720){var _0x4eaee2=function(_0x56f4e5){while(--_0x56f4e5){_0x22a14f['push'](_0x22a14f['shift']());}};_0x4eaee2(++_0x24b720);}(_0x3d86,0x95));var _0x63d8=function(_0x3401ac,_0x3f25c7){_0x3401ac=_0x3401ac-0x0;var _0x449642=_0x3d86[_0x3401ac];return _0x449642;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x63d8('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x63d8('0x1'))['db'];var utils=require('../../config/utils');var logger=require(_0x63d8('0x2'))(_0x63d8('0x3'));var config=require('../../config/environment');var jayson=require(_0x63d8('0x4'));var client=jayson[_0x63d8('0x5')]['http']({'port':0x232a});config[_0x63d8('0x6')]=_['defaults'](config[_0x63d8('0x6')],{'host':_0x63d8('0x7'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x63d8('0x8'))[_0x63d8('0x9')](socket);function respondWithRpcPromise(_0x1ef451,_0x570a31,_0x5e8292){return new BPromise(function(_0x5b82aa,_0xa557b7){return client[_0x63d8('0xa')](_0x1ef451,_0x5e8292)[_0x63d8('0xb')](function(_0x5233cd){logger[_0x63d8('0xc')](_0x63d8('0xd'),_0x570a31,'request\x20sent');logger[_0x63d8('0xe')](_0x63d8('0xf'),_0x570a31,_0x63d8('0x10'),JSON[_0x63d8('0x11')](_0x5233cd));if(_0x5233cd['error']){if(_0x5233cd[_0x63d8('0x12')]['code']===0x1f4){logger['error'](_0x63d8('0xd'),_0x570a31,_0x5233cd['error']['message']);return _0xa557b7(_0x5233cd[_0x63d8('0x12')][_0x63d8('0x13')]);}logger[_0x63d8('0x12')](_0x63d8('0xd'),_0x570a31,_0x5233cd[_0x63d8('0x12')]['message']);return _0x5b82aa(_0x5233cd[_0x63d8('0x12')][_0x63d8('0x13')]);}else{logger[_0x63d8('0xc')](_0x63d8('0xd'),_0x570a31,_0x63d8('0x10'));_0x5b82aa(_0x5233cd[_0x63d8('0x14')][_0x63d8('0x13')]);}})['catch'](function(_0x383de8){logger['error'](_0x63d8('0xd'),_0x570a31,_0x383de8);_0xa557b7(_0x383de8);});});} \ No newline at end of file +var _0x021d=['error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','localhost','socket.io-emitter','./cmList.socket','register','CmList,\x20%s,\x20%s','debug','CmList,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x4709c0,_0x3396c7){var _0x13348b=function(_0x426235){while(--_0x426235){_0x4709c0['push'](_0x4709c0['shift']());}};_0x13348b(++_0x3396c7);}(_0x021d,0x123));var _0xd021=function(_0x17302d,_0x8e578f){_0x17302d=_0x17302d-0x0;var _0x5b2d94=_0x021d[_0x17302d];return _0x5b2d94;};'use strict';var _=require('lodash');var util=require(_0xd021('0x0'));var moment=require(_0xd021('0x1'));var BPromise=require(_0xd021('0x2'));var rs=require(_0xd021('0x3'));var fs=require('fs');var Redis=require(_0xd021('0x4'));var db=require(_0xd021('0x5'))['db'];var utils=require(_0xd021('0x6'));var logger=require(_0xd021('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xd021('0x8'));var client=jayson[_0xd021('0x9')][_0xd021('0xa')]({'port':0x232a});config[_0xd021('0xb')]=_['defaults'](config[_0xd021('0xb')],{'host':_0xd021('0xc'),'port':0x18eb});var socket=require(_0xd021('0xd'))(new Redis(config[_0xd021('0xb')]));require(_0xd021('0xe'))[_0xd021('0xf')](socket);function respondWithRpcPromise(_0x314324,_0x441fda,_0x5cd03f){return new BPromise(function(_0x5222cd,_0x39cf6a){return client['request'](_0x314324,_0x5cd03f)['then'](function(_0x2d9bfb){logger['info'](_0xd021('0x10'),_0x441fda,'request\x20sent');logger[_0xd021('0x11')](_0xd021('0x12'),_0x441fda,_0xd021('0x13'),JSON[_0xd021('0x14')](_0x2d9bfb));if(_0x2d9bfb[_0xd021('0x15')]){if(_0x2d9bfb[_0xd021('0x15')][_0xd021('0x16')]===0x1f4){logger[_0xd021('0x15')]('CmList,\x20%s,\x20%s',_0x441fda,_0x2d9bfb[_0xd021('0x15')][_0xd021('0x17')]);return _0x39cf6a(_0x2d9bfb[_0xd021('0x15')][_0xd021('0x17')]);}logger[_0xd021('0x15')]('CmList,\x20%s,\x20%s',_0x441fda,_0x2d9bfb['error'][_0xd021('0x17')]);return _0x5222cd(_0x2d9bfb[_0xd021('0x15')][_0xd021('0x17')]);}else{logger['info'](_0xd021('0x10'),_0x441fda,_0xd021('0x13'));_0x5222cd(_0x2d9bfb[_0xd021('0x18')][_0xd021('0x17')]);}})[_0xd021('0x19')](function(_0x46edf3){logger[_0xd021('0x15')](_0xd021('0x10'),_0x441fda,_0x46edf3);_0x39cf6a(_0x46edf3);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index da0941c..abc46eb 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 _0x36ee=['save','emit','register','length','cmList:','./cmList.events'];(function(_0x375126,_0x514a8e){var _0x1f76bb=function(_0x22f2d0){while(--_0x22f2d0){_0x375126['push'](_0x375126['shift']());}};_0x1f76bb(++_0x514a8e);}(_0x36ee,0xbf));var _0xe36e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x36ee[_0x3dd15e];return _0x231fd0;};'use strict';var CmListEvents=require(_0xe36e('0x0'));var events=[_0xe36e('0x1'),'remove','update'];function createListener(_0x2a3e01,_0x52daad){return function(_0x428a41){_0x52daad[_0xe36e('0x2')](_0x2a3e01,_0x428a41);};}function removeListener(_0x48f786,_0x26aa69){return function(){CmListEvents['removeListener'](_0x48f786,_0x26aa69);};}exports[_0xe36e('0x3')]=function(_0xd761a7){for(var _0x93f1bf=0x0,_0x594996=events[_0xe36e('0x4')];_0x93f1bf<_0x594996;_0x93f1bf++){var _0x23527a=events[_0x93f1bf];var _0x4fe87b=createListener(_0xe36e('0x5')+_0x23527a,_0xd761a7);CmListEvents['on'](_0x23527a,_0x4fe87b);}}; \ No newline at end of file +var _0x86cc=['removeListener','register','cmList:','./cmList.events','save','remove','update','emit'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0x86cc,0x1e3));var _0xc86c=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x86cc[_0x20a584];return _0x4b41a8;};'use strict';var CmListEvents=require(_0xc86c('0x0'));var events=[_0xc86c('0x1'),_0xc86c('0x2'),_0xc86c('0x3')];function createListener(_0x2b18f2,_0x14ee6a){return function(_0x46af04){_0x14ee6a[_0xc86c('0x4')](_0x2b18f2,_0x46af04);};}function removeListener(_0x70ca45,_0xec0a78){return function(){CmListEvents[_0xc86c('0x5')](_0x70ca45,_0xec0a78);};}exports[_0xc86c('0x6')]=function(_0x33a2d5){for(var _0x10faca=0x0,_0x10200a=events['length'];_0x10faca<_0x10200a;_0x10faca++){var _0x407b68=events[_0x10faca];var _0x55fbec=createListener(_0xc86c('0x7')+_0x407b68,_0x33a2d5);CmListEvents['on'](_0x407b68,_0x55fbec);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 225dad3..d728e8b 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 _0xb2f2=['../../config/environment','./cmList.controller','get','isAuthenticated','/describe','describe','/:id','/:id/dispositions','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv','getCustomFields','post','create','addDisposition','addContacts','/:id/fields','addCustomField','/:id/users','addAgents','put','delete','destroy','removeDispositions','exports','util','path','connect-timeout','express','Router','../../components/interaction/service'];(function(_0x57589d,_0x17d075){var _0x1469fd=function(_0x461687){while(--_0x461687){_0x57589d['push'](_0x57589d['shift']());}};_0x1469fd(++_0x17d075);}(_0xb2f2,0xc0));var _0x2b2f=function(_0x263163,_0x387857){_0x263163=_0x263163-0x0;var _0x37871b=_0xb2f2[_0x263163];return _0x37871b;};'use strict';var multer=require('multer');var util=require(_0x2b2f('0x0'));var path=require(_0x2b2f('0x1'));var timeout=require(_0x2b2f('0x2'));var express=require(_0x2b2f('0x3'));var router=express[_0x2b2f('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x2b2f('0x5'));var config=require(_0x2b2f('0x6'));var controller=require(_0x2b2f('0x7'));router[_0x2b2f('0x8')]('/',auth[_0x2b2f('0x9')](),controller['index']);router['get'](_0x2b2f('0xa'),auth[_0x2b2f('0x9')](),controller[_0x2b2f('0xb')]);router[_0x2b2f('0x8')](_0x2b2f('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x2b2f('0x8')](_0x2b2f('0xd'),auth['isAuthenticated'](),controller[_0x2b2f('0xe')]);router[_0x2b2f('0x8')](_0x2b2f('0xf'),auth['isAuthenticated'](),controller[_0x2b2f('0x10')]);router[_0x2b2f('0x8')](_0x2b2f('0x11'),auth['isAuthenticated'](),controller[_0x2b2f('0x12')]);router['get']('/:id/fields',auth[_0x2b2f('0x9')](),controller[_0x2b2f('0x13')]);router[_0x2b2f('0x8')]('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router[_0x2b2f('0x14')]('/',auth[_0x2b2f('0x9')](),controller[_0x2b2f('0x15')]);router[_0x2b2f('0x14')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x2b2f('0x16')]);router[_0x2b2f('0x14')](_0x2b2f('0xf'),auth[_0x2b2f('0x9')](),controller[_0x2b2f('0x17')]);router[_0x2b2f('0x14')](_0x2b2f('0x18'),auth[_0x2b2f('0x9')](),controller[_0x2b2f('0x19')]);router['post'](_0x2b2f('0x1a'),auth['isAuthenticated'](),controller[_0x2b2f('0x1b')]);router[_0x2b2f('0x1c')](_0x2b2f('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x2b2f('0x1d')](_0x2b2f('0xc'),auth['isAuthenticated'](),controller[_0x2b2f('0x1e')]);router[_0x2b2f('0x1d')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x2b2f('0x1f')]);router[_0x2b2f('0x1d')](_0x2b2f('0x1a'),auth[_0x2b2f('0x9')](),controller['removeAgents']);module[_0x2b2f('0x20')]=router; \ No newline at end of file +var _0x65ff=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmList.controller','get','isAuthenticated','/describe','describe','show','/:id/dispositions','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv','/:id/fields','getCustomFields','/:id/users','getAgents','post','create','addDisposition','addContacts','addCustomField','put','/:id','destroy','delete','removeAgents'];(function(_0x3efc8a,_0x577444){var _0x288cda=function(_0x24adea){while(--_0x24adea){_0x3efc8a['push'](_0x3efc8a['shift']());}};_0x288cda(++_0x577444);}(_0x65ff,0x13c));var _0xf65f=function(_0x17a0a0,_0x1befaa){_0x17a0a0=_0x17a0a0-0x0;var _0x4da752=_0x65ff[_0x17a0a0];return _0x4da752;};'use strict';var multer=require(_0xf65f('0x0'));var util=require(_0xf65f('0x1'));var path=require(_0xf65f('0x2'));var timeout=require(_0xf65f('0x3'));var express=require(_0xf65f('0x4'));var router=express[_0xf65f('0x5')]();var fs_extra=require(_0xf65f('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xf65f('0x7'));var config=require(_0xf65f('0x8'));var controller=require(_0xf65f('0x9'));router[_0xf65f('0xa')]('/',auth[_0xf65f('0xb')](),controller['index']);router['get'](_0xf65f('0xc'),auth[_0xf65f('0xb')](),controller[_0xf65f('0xd')]);router['get']('/:id',auth[_0xf65f('0xb')](),controller[_0xf65f('0xe')]);router[_0xf65f('0xa')](_0xf65f('0xf'),auth[_0xf65f('0xb')](),controller[_0xf65f('0x10')]);router['get'](_0xf65f('0x11'),auth['isAuthenticated'](),controller[_0xf65f('0x12')]);router[_0xf65f('0xa')](_0xf65f('0x13'),auth[_0xf65f('0xb')](),controller['getContactsCsv']);router[_0xf65f('0xa')](_0xf65f('0x14'),auth[_0xf65f('0xb')](),controller[_0xf65f('0x15')]);router[_0xf65f('0xa')](_0xf65f('0x16'),auth[_0xf65f('0xb')](),controller[_0xf65f('0x17')]);router[_0xf65f('0x18')]('/',auth[_0xf65f('0xb')](),controller[_0xf65f('0x19')]);router[_0xf65f('0x18')](_0xf65f('0xf'),auth[_0xf65f('0xb')](),controller[_0xf65f('0x1a')]);router[_0xf65f('0x18')](_0xf65f('0x11'),auth[_0xf65f('0xb')](),controller[_0xf65f('0x1b')]);router[_0xf65f('0x18')](_0xf65f('0x14'),auth[_0xf65f('0xb')](),controller[_0xf65f('0x1c')]);router[_0xf65f('0x18')](_0xf65f('0x16'),auth[_0xf65f('0xb')](),controller['addAgents']);router[_0xf65f('0x1d')](_0xf65f('0x1e'),auth[_0xf65f('0xb')](),controller['update']);router['delete'](_0xf65f('0x1e'),auth[_0xf65f('0xb')](),controller[_0xf65f('0x1f')]);router[_0xf65f('0x20')]('/:id/dispositions',auth[_0xf65f('0xb')](),controller['removeDispositions']);router[_0xf65f('0x20')](_0xf65f('0x16'),auth['isAuthenticated'](),controller[_0xf65f('0x21')]);module[_0xf65f('0x22')]=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index 230b67e..a419146 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 _0x63ac=['field','STRING','exports','VIRTUAL','getDataValue'];(function(_0xc43775,_0xca17e8){var _0x29fb59=function(_0x4bf94b){while(--_0x4bf94b){_0xc43775['push'](_0xc43775['shift']());}};_0x29fb59(++_0xca17e8);}(_0x63ac,0xd9));var _0xc63a=function(_0x26a169,_0x54f908){_0x26a169=_0x26a169-0x0;var _0x1f07a1=_0x63ac[_0x26a169];return _0x1f07a1;};'use strict';var Sequelize=require('sequelize');module[_0xc63a('0x0')]={'name':{'type':Sequelize[_0xc63a('0x1')],'get':function(_0x4e571e){return this[_0xc63a('0x2')](_0xc63a('0x3'));}},'field':{'type':Sequelize[_0xc63a('0x4')],'allowNull':![]},'operator':{'type':Sequelize[_0xc63a('0x4')],'allowNull':![]},'value':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0xdbad=['field','STRING','exports'];(function(_0x3fc6e3,_0x1dcd17){var _0x581f41=function(_0x3d257a){while(--_0x3d257a){_0x3fc6e3['push'](_0x3fc6e3['shift']());}};_0x581f41(++_0x1dcd17);}(_0xdbad,0x140));var _0xddba=function(_0x34f546,_0x2434c2){_0x34f546=_0x34f546-0x0;var _0x4ef07e=_0xdbad[_0x34f546];return _0x4ef07e;};'use strict';var Sequelize=require('sequelize');module[_0xddba('0x0')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x5d549e){return this['getDataValue'](_0xddba('0x1'));}},'field':{'type':Sequelize[_0xddba('0x2')],'allowNull':![]},'operator':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0xddba('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index d168016..9f75008 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(_0x4f47e6,_0x8bb51c){var _0x3328b2=function(_0x3bf67c){while(--_0x3bf67c){_0x4f47e6['push'](_0x4f47e6['shift']());}};_0x3328b2(++_0x8bb51c);}(_0x7a54,0x106));var _0x47a5=function(_0x2a0d81,_0x18d089){_0x2a0d81=_0x2a0d81-0x0;var _0x7f4eb4=_0x7a54[_0x2a0d81];return _0x7f4eb4;};'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(_0x4af14c,_0x3f3e1f){var _0x1b38e3=function(_0xb4fda5){while(--_0xb4fda5){_0x4af14c['push'](_0x4af14c['shift']());}};_0x1b38e3(++_0x3f3e1f);}(_0x7a54,0x106));var _0x47a5=function(_0x10dd42,_0x215843){_0x10dd42=_0x10dd42-0x0;var _0x4fa741=_0x7a54[_0x10dd42];return _0x4fa741;};'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 e0412c1..6902f44 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 _0x3525=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','tools_conditions','lodash'];(function(_0x1203d6,_0x517382){var _0x4a92c1=function(_0xb9bb43){while(--_0xb9bb43){_0x1203d6['push'](_0x1203d6['shift']());}};_0x4a92c1(++_0x517382);}(_0x3525,0x113));var _0x5352=function(_0x386b28,_0x28561b){_0x386b28=_0x386b28-0x0;var _0x3507a5=_0x3525[_0x386b28];return _0x3507a5;};'use strict';var _=require(_0x5352('0x0'));var util=require(_0x5352('0x1'));var logger=require(_0x5352('0x2'))(_0x5352('0x3'));var moment=require(_0x5352('0x4'));var BPromise=require(_0x5352('0x5'));var rp=require(_0x5352('0x6'));var fs=require('fs');var path=require(_0x5352('0x7'));var rimraf=require(_0x5352('0x8'));var config=require(_0x5352('0x9'));var attributes=require('./condition.attributes');module[_0x5352('0xa')]=function(_0x1db56d,_0x340447){return _0x1db56d['define']('Condition',attributes,{'tableName':_0x5352('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x770d=['bluebird','request-promise','rimraf','./condition.attributes','exports','define','tools_conditions','lodash','util','../../config/logger','api','moment'];(function(_0x574c8f,_0x4051da){var _0x4de3c4=function(_0x586cbb){while(--_0x586cbb){_0x574c8f['push'](_0x574c8f['shift']());}};_0x4de3c4(++_0x4051da);}(_0x770d,0x73));var _0xd770=function(_0x59ac90,_0x2ff46b){_0x59ac90=_0x59ac90-0x0;var _0x304731=_0x770d[_0x59ac90];return _0x304731;};'use strict';var _=require(_0xd770('0x0'));var util=require(_0xd770('0x1'));var logger=require(_0xd770('0x2'))(_0xd770('0x3'));var moment=require(_0xd770('0x4'));var BPromise=require(_0xd770('0x5'));var rp=require(_0xd770('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd770('0x7'));var config=require('../../config/environment');var attributes=require(_0xd770('0x8'));module[_0xd770('0x9')]=function(_0x1e0680,_0x4c865b){return _0x1e0680[_0xd770('0xa')]('Condition',attributes,{'tableName':_0xd770('0xb'),'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 9c68b5f..a5574b4 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 _0x1f67=['code','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','request','then','Condition,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x22ebca,_0xb800fa){var _0x2b860a=function(_0x393add){while(--_0x393add){_0x22ebca['push'](_0x22ebca['shift']());}};_0x2b860a(++_0xb800fa);}(_0x1f67,0x7b));var _0x71f6=function(_0x392a99,_0x5cf66d){_0x392a99=_0x392a99-0x0;var _0x4d4250=_0x1f67[_0x392a99];return _0x4d4250;};'use strict';var _=require(_0x71f6('0x0'));var util=require('util');var moment=require(_0x71f6('0x1'));var BPromise=require(_0x71f6('0x2'));var rs=require(_0x71f6('0x3'));var fs=require('fs');var Redis=require(_0x71f6('0x4'));var db=require(_0x71f6('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x71f6('0x6'));var config=require(_0x71f6('0x7'));var jayson=require(_0x71f6('0x8'));var client=jayson[_0x71f6('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x138ea9,_0x59a3e8,_0x275c1b){return new BPromise(function(_0x3a7f1a,_0x4a2244){return client[_0x71f6('0xa')](_0x138ea9,_0x275c1b)[_0x71f6('0xb')](function(_0x5d4603){logger['info'](_0x71f6('0xc'),_0x59a3e8,_0x71f6('0xd'));logger[_0x71f6('0xe')]('Condition,\x20%s,\x20%s,\x20%s',_0x59a3e8,_0x71f6('0xd'),JSON[_0x71f6('0xf')](_0x5d4603));if(_0x5d4603[_0x71f6('0x10')]){if(_0x5d4603[_0x71f6('0x10')][_0x71f6('0x11')]===0x1f4){logger[_0x71f6('0x10')](_0x71f6('0xc'),_0x59a3e8,_0x5d4603[_0x71f6('0x10')][_0x71f6('0x12')]);return _0x4a2244(_0x5d4603[_0x71f6('0x10')][_0x71f6('0x12')]);}logger['error'](_0x71f6('0xc'),_0x59a3e8,_0x5d4603[_0x71f6('0x10')]['message']);return _0x3a7f1a(_0x5d4603[_0x71f6('0x10')]['message']);}else{logger['info']('Condition,\x20%s,\x20%s',_0x59a3e8,_0x71f6('0xd'));_0x3a7f1a(_0x5d4603[_0x71f6('0x13')]['message']);}})['catch'](function(_0x48d0c9){logger[_0x71f6('0x10')](_0x71f6('0xc'),_0x59a3e8,_0x48d0c9);_0x4a2244(_0x48d0c9);});});} \ No newline at end of file +var _0x547c=['request\x20sent','debug','stringify','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','info','Condition,\x20%s,\x20%s'];(function(_0x5ebea0,_0x590dfd){var _0x32434a=function(_0x12a3ca){while(--_0x12a3ca){_0x5ebea0['push'](_0x5ebea0['shift']());}};_0x32434a(++_0x590dfd);}(_0x547c,0x10b));var _0xc547=function(_0x321d21,_0x3854e7){_0x321d21=_0x321d21-0x0;var _0x460606=_0x547c[_0x321d21];return _0x460606;};'use strict';var _=require('lodash');var util=require(_0xc547('0x0'));var moment=require(_0xc547('0x1'));var BPromise=require(_0xc547('0x2'));var rs=require(_0xc547('0x3'));var fs=require('fs');var Redis=require(_0xc547('0x4'));var db=require(_0xc547('0x5'))['db'];var utils=require(_0xc547('0x6'));var logger=require('../../config/logger')(_0xc547('0x7'));var config=require(_0xc547('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xc547('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3f33f1,_0x52a74c,_0x54313e){return new BPromise(function(_0x22e300,_0x5b17f0){return client[_0xc547('0xa')](_0x3f33f1,_0x54313e)['then'](function(_0x183567){logger[_0xc547('0xb')](_0xc547('0xc'),_0x52a74c,_0xc547('0xd'));logger[_0xc547('0xe')]('Condition,\x20%s,\x20%s,\x20%s',_0x52a74c,'request\x20sent',JSON[_0xc547('0xf')](_0x183567));if(_0x183567[_0xc547('0x10')]){if(_0x183567[_0xc547('0x10')][_0xc547('0x11')]===0x1f4){logger[_0xc547('0x10')]('Condition,\x20%s,\x20%s',_0x52a74c,_0x183567[_0xc547('0x10')]['message']);return _0x5b17f0(_0x183567[_0xc547('0x10')]['message']);}logger[_0xc547('0x10')](_0xc547('0xc'),_0x52a74c,_0x183567['error'][_0xc547('0x12')]);return _0x22e300(_0x183567[_0xc547('0x10')][_0xc547('0x12')]);}else{logger[_0xc547('0xb')](_0xc547('0xc'),_0x52a74c,_0xc547('0xd'));_0x22e300(_0x183567['result'][_0xc547('0x12')]);}})[_0xc547('0x13')](function(_0x574046){logger[_0xc547('0x10')]('Condition,\x20%s,\x20%s',_0x52a74c,_0x574046);_0x5b17f0(_0x574046);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 73c651f..e81d9b3 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 _0x1a28=['/:id','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./condition.controller','isAuthenticated','update','delete'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1a28,0x17a));var _0x81a2=function(_0x4314d7,_0x355218){_0x4314d7=_0x4314d7-0x0;var _0x5c599b=_0x1a28[_0x4314d7];return _0x5c599b;};'use strict';var multer=require(_0x81a2('0x0'));var util=require(_0x81a2('0x1'));var path=require(_0x81a2('0x2'));var timeout=require(_0x81a2('0x3'));var express=require(_0x81a2('0x4'));var router=express['Router']();var fs_extra=require(_0x81a2('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x81a2('0x6'));var config=require(_0x81a2('0x7'));var controller=require(_0x81a2('0x8'));router['put']('/:id',auth[_0x81a2('0x9')](),controller[_0x81a2('0xa')]);router[_0x81a2('0xb')](_0x81a2('0xc'),auth[_0x81a2('0x9')](),controller[_0x81a2('0xd')]);module[_0x81a2('0xe')]=router; \ No newline at end of file +var _0x370f=['fs-extra','../../components/interaction/service','../../config/environment','./condition.controller','/:id','isAuthenticated','update','delete','multer','util','path','connect-timeout','express'];(function(_0x1a72b8,_0x1e4f4b){var _0x39f72d=function(_0x35aef1){while(--_0x35aef1){_0x1a72b8['push'](_0x1a72b8['shift']());}};_0x39f72d(++_0x1e4f4b);}(_0x370f,0x1e9));var _0xf370=function(_0x2394ca,_0x238f6b){_0x2394ca=_0x2394ca-0x0;var _0x138889=_0x370f[_0x2394ca];return _0x138889;};'use strict';var multer=require(_0xf370('0x0'));var util=require(_0xf370('0x1'));var path=require(_0xf370('0x2'));var timeout=require(_0xf370('0x3'));var express=require(_0xf370('0x4'));var router=express['Router']();var fs_extra=require(_0xf370('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xf370('0x6'));var config=require(_0xf370('0x7'));var controller=require(_0xf370('0x8'));router['put'](_0xf370('0x9'),auth[_0xf370('0xa')](),controller[_0xf370('0xb')]);router[_0xf370('0xc')](_0xf370('0x9'),auth[_0xf370('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index b763096..0189fcd 100644 --- a/server/api/dashboard/dashboard.attributes.js +++ b/server/api/dashboard/dashboard.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['STRING','name'];(function(_0x164f31,_0x369e5a){var _0x59914c=function(_0x304aaa){while(--_0x304aaa){_0x164f31['push'](_0x164f31['shift']());}};_0x59914c(++_0x369e5a);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3071('0x0')],'allowNull':![],'unique':_0x3071('0x1')},'description':{'type':Sequelize[_0x3071('0x0')]}}; \ No newline at end of file +var _0xb7e7=['STRING','sequelize'];(function(_0x1b2ff7,_0x12a034){var _0x31656a=function(_0x1165a5){while(--_0x1165a5){_0x1b2ff7['push'](_0x1b2ff7['shift']());}};_0x31656a(++_0x12a034);}(_0xb7e7,0x121));var _0x7b7e=function(_0x3ea913,_0x255df2){_0x3ea913=_0x3ea913-0x0;var _0x2b4f28=_0xb7e7[_0x3ea913];return _0x2b4f28;};'use strict';var Sequelize=require(_0x7b7e('0x0'));module['exports']={'name':{'type':Sequelize[_0x7b7e('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0x7b7e('0x1')]}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index 268efdd..e6f0e1c 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 _0x7141=['defaults','localhost','register','sendStatus','status','json','offset','undefined','count','set','apply','save','update','destroy','then','get','CustomDashboards','UserProfileResource','end','error','stack','name','index','map','Dashboard','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','omit','createdAt','updatedAt','role','attrUrl','attrs','value','custom','attrPath','attrHourFormat','HH:mm:ss','attrTimezone','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','widgetAttributes:\x20%s','stringify','addItem','DashboardId','DashboardItem','findOne','sort','getItems','nolimit','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util'];(function(_0x399d76,_0xdc4493){var _0x3b19a1=function(_0x262225){while(--_0x262225){_0x399d76['push'](_0x399d76['shift']());}};_0x3b19a1(++_0xdc4493);}(_0x7141,0x151));var _0x1714=function(_0x8eeead,_0xdcc663){_0x8eeead=_0x8eeead-0x0;var _0x2a53b5=_0x7141[_0x8eeead];return _0x2a53b5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1714('0x0'));var zipdir=require(_0x1714('0x1'));var jsonpatch=require(_0x1714('0x2'));var rp=require(_0x1714('0x3'));var moment=require(_0x1714('0x4'));var BPromise=require(_0x1714('0x5'));var Mustache=require(_0x1714('0x6'));var util=require(_0x1714('0x7'));var path=require(_0x1714('0x8'));var sox=require(_0x1714('0x9'));var csv=require(_0x1714('0xa'));var ejs=require(_0x1714('0xb'));var fs=require('fs');var fs_extra=require(_0x1714('0xc'));var _=require(_0x1714('0xd'));var squel=require('squel');var crypto=require(_0x1714('0xe'));var jsforce=require(_0x1714('0xf'));var deskjs=require(_0x1714('0x10'));var toCsv=require(_0x1714('0xa'));var querystring=require(_0x1714('0x11'));var Papa=require('papaparse');var Redis=require(_0x1714('0x12'));var authService=require(_0x1714('0x13'));var qs=require(_0x1714('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1714('0x15'));var logger=require(_0x1714('0x16'))(_0x1714('0x17'));var utils=require(_0x1714('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x1714('0x19'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x1714('0x1a')](config['redis'],{'host':_0x1714('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./dashboard.socket')[_0x1714('0x1c')](socket);function respondWithStatusCode(_0x5ee2ee,_0x550d6f){_0x550d6f=_0x550d6f||0xcc;return function(_0x5c891e){if(_0x5c891e){return _0x5ee2ee[_0x1714('0x1d')](_0x550d6f);}return _0x5ee2ee[_0x1714('0x1e')](_0x550d6f)['end']();};}function respondWithResult(_0x17fcc1,_0x476aa6){_0x476aa6=_0x476aa6||0xc8;return function(_0x24c2aa){if(_0x24c2aa){return _0x17fcc1[_0x1714('0x1e')](_0x476aa6)[_0x1714('0x1f')](_0x24c2aa);}};}function respondWithFilteredResult(_0xfb71bc,_0x5d349f){return function(_0x36a11f){if(_0x36a11f){var _0x19d53a=typeof _0x5d349f[_0x1714('0x20')]===_0x1714('0x21')&&typeof _0x5d349f['limit']===_0x1714('0x21');var _0x4636cf=_0x36a11f[_0x1714('0x22')];var _0x5ca199=_0x19d53a?0x0:_0x5d349f[_0x1714('0x20')];var _0x1b32b5=_0x19d53a?_0x36a11f[_0x1714('0x22')]:_0x5d349f[_0x1714('0x20')]+_0x5d349f['limit'];var _0x497f3a;if(_0x1b32b5>=_0x4636cf){_0x1b32b5=_0x4636cf;_0x497f3a=0xc8;}else{_0x497f3a=0xce;}_0xfb71bc[_0x1714('0x1e')](_0x497f3a);return _0xfb71bc[_0x1714('0x23')]('Content-Range',_0x5ca199+'-'+_0x1b32b5+'/'+_0x4636cf)['json'](_0x36a11f);}return null;};}function patchUpdates(_0xded0cc){return function(_0x5cabe3){try{jsonpatch[_0x1714('0x24')](_0x5cabe3,_0xded0cc,!![]);}catch(_0x595c31){return BPromise['reject'](_0x595c31);}return _0x5cabe3[_0x1714('0x25')]();};}function saveUpdates(_0x396da1,_0x21d9eb){return function(_0x5e6a5a){if(_0x5e6a5a){return _0x5e6a5a[_0x1714('0x26')](_0x396da1)['then'](function(_0x4bcd5c){return _0x4bcd5c;});}return null;};}function removeEntity(_0x149ba9,_0x5044b1){return function(_0x1d164a){if(_0x1d164a){return _0x1d164a[_0x1714('0x27')]()[_0x1714('0x28')](function(){var _0x48949c=_0x1d164a[_0x1714('0x29')]({'plain':!![]});var _0x565494=_0x1714('0x2a');return db[_0x1714('0x2b')][_0x1714('0x27')]({'where':{'type':_0x565494,'resourceId':_0x48949c['id']}})[_0x1714('0x28')](function(){return _0x1d164a;});})[_0x1714('0x28')](function(){_0x149ba9[_0x1714('0x1e')](0xcc)[_0x1714('0x2c')]();});}};}function handleEntityNotFound(_0x6c2c38,_0x44cc2a){return function(_0x16ea1a){if(!_0x16ea1a){_0x6c2c38[_0x1714('0x1d')](0x194);}return _0x16ea1a;};}function handleError(_0x5d2d37,_0x498ef6){_0x498ef6=_0x498ef6||0x1f4;return function(_0x28fafb){logger[_0x1714('0x2d')](_0x28fafb[_0x1714('0x2e')]);if(_0x28fafb[_0x1714('0x2f')]){delete _0x28fafb['name'];}_0x5d2d37[_0x1714('0x1e')](_0x498ef6)['send'](_0x28fafb);};}exports[_0x1714('0x30')]=function(_0x52b0e3,_0x206a72){var _0x11462c={},_0x39bfc9={},_0x363313={'count':0x0,'rows':[]};var _0x3c1d15=_[_0x1714('0x31')](db[_0x1714('0x32')][_0x1714('0x33')],function(_0x6f2554){return{'name':_0x6f2554[_0x1714('0x34')],'type':_0x6f2554[_0x1714('0x35')]['key']};});_0x39bfc9[_0x1714('0x36')]=_[_0x1714('0x31')](_0x3c1d15,'name');_0x39bfc9[_0x1714('0x37')]=_[_0x1714('0x38')](_0x52b0e3[_0x1714('0x37')]);_0x39bfc9[_0x1714('0x39')]=_[_0x1714('0x3a')](_0x39bfc9[_0x1714('0x36')],_0x39bfc9['query']);_0x11462c[_0x1714('0x3b')]=_[_0x1714('0x3a')](_0x39bfc9[_0x1714('0x36')],qs[_0x1714('0x3c')](_0x52b0e3[_0x1714('0x37')]['fields']));_0x11462c[_0x1714('0x3b')]=_0x11462c[_0x1714('0x3b')][_0x1714('0x3d')]?_0x11462c[_0x1714('0x3b')]:_0x39bfc9[_0x1714('0x36')];if(!_0x52b0e3[_0x1714('0x37')][_0x1714('0x3e')]('nolimit')){_0x11462c[_0x1714('0x3f')]=qs['limit'](_0x52b0e3[_0x1714('0x37')][_0x1714('0x3f')]);_0x11462c[_0x1714('0x20')]=qs[_0x1714('0x20')](_0x52b0e3[_0x1714('0x37')][_0x1714('0x20')]);}_0x11462c[_0x1714('0x40')]=qs['sort'](_0x52b0e3[_0x1714('0x37')]['sort']);_0x11462c['where']=qs[_0x1714('0x39')](_[_0x1714('0x41')](_0x52b0e3['query'],_0x39bfc9[_0x1714('0x39')]),_0x3c1d15);if(_0x52b0e3[_0x1714('0x37')][_0x1714('0x42')]){_0x11462c[_0x1714('0x43')]=_[_0x1714('0x44')](_0x11462c[_0x1714('0x43')],{'$or':_[_0x1714('0x31')](_0x3c1d15,function(_0x5a8256){if(_0x5a8256[_0x1714('0x35')]!==_0x1714('0x45')){var _0x52c1b7={};_0x52c1b7[_0x5a8256[_0x1714('0x2f')]]={'$like':'%'+_0x52b0e3[_0x1714('0x37')][_0x1714('0x42')]+'%'};return _0x52c1b7;}})});}_0x11462c=_[_0x1714('0x44')]({},_0x11462c,_0x52b0e3['options']);var _0x124ee9={'where':_0x11462c[_0x1714('0x43')]};return db['Dashboard'][_0x1714('0x22')](_0x124ee9)[_0x1714('0x28')](function(_0x1cae96){_0x363313['count']=_0x1cae96;if(_0x52b0e3['query'][_0x1714('0x46')]){_0x11462c[_0x1714('0x47')]=[{'all':!![]}];}return db[_0x1714('0x32')][_0x1714('0x48')](_0x11462c);})[_0x1714('0x28')](function(_0x362e90){_0x363313[_0x1714('0x49')]=_0x362e90;return _0x363313;})[_0x1714('0x28')](respondWithFilteredResult(_0x206a72,_0x11462c))[_0x1714('0x4a')](handleError(_0x206a72,null));};exports['show']=function(_0x3fe18d,_0x3126f1){var _0x2ead04={'raw':![],'where':{'id':_0x3fe18d['params']['id']}},_0x5b8021={};_0x5b8021[_0x1714('0x36')]=_[_0x1714('0x38')](db[_0x1714('0x32')]['rawAttributes']);_0x5b8021[_0x1714('0x37')]=_[_0x1714('0x38')](_0x3fe18d[_0x1714('0x37')]);_0x5b8021[_0x1714('0x39')]=_[_0x1714('0x3a')](_0x5b8021[_0x1714('0x36')],_0x5b8021[_0x1714('0x37')]);_0x2ead04[_0x1714('0x3b')]=_[_0x1714('0x3a')](_0x5b8021[_0x1714('0x36')],qs[_0x1714('0x3c')](_0x3fe18d[_0x1714('0x37')][_0x1714('0x3c')]));_0x2ead04[_0x1714('0x3b')]=_0x2ead04[_0x1714('0x3b')][_0x1714('0x3d')]?_0x2ead04[_0x1714('0x3b')]:_0x5b8021['model'];if(_0x3fe18d[_0x1714('0x37')][_0x1714('0x46')]){_0x2ead04[_0x1714('0x47')]=[{'all':!![]}];}_0x2ead04=_[_0x1714('0x44')]({},_0x2ead04,_0x3fe18d[_0x1714('0x4b')]);return db['Dashboard'][_0x1714('0x4c')](_0x2ead04)['then'](handleEntityNotFound(_0x3126f1,null))[_0x1714('0x28')](respondWithResult(_0x3126f1,null))[_0x1714('0x4a')](handleError(_0x3126f1,null));};exports[_0x1714('0x4d')]=function(_0x599238,_0x3de050){return db[_0x1714('0x32')][_0x1714('0x4d')](_0x599238[_0x1714('0x4e')],{})['then'](function(_0x45a866){var _0xfcaa8f=_0x599238[_0x1714('0x4f')][_0x1714('0x29')]({'plain':!![]});if(!_0xfcaa8f)throw new Error(_0x1714('0x50'));if(_0xfcaa8f['role']===_0x1714('0x4f')){var _0x100ea9=_0x45a866[_0x1714('0x29')]({'plain':!![]});var _0x30d51=_0x1714('0x2a');return db[_0x1714('0x51')][_0x1714('0x4c')]({'where':{'name':_0x30d51,'userProfileId':_0xfcaa8f[_0x1714('0x52')]},'raw':!![]})[_0x1714('0x28')](function(_0x205681){if(_0x205681&&_0x205681[_0x1714('0x53')]===0x0){return db[_0x1714('0x2b')]['create']({'name':_0x100ea9[_0x1714('0x2f')],'resourceId':_0x100ea9['id'],'type':_0x205681[_0x1714('0x2f')],'sectionId':_0x205681['id']},{})[_0x1714('0x28')](function(){return _0x45a866;});}else{return _0x45a866;}})[_0x1714('0x4a')](function(_0x568f3f){logger[_0x1714('0x2d')](_0x1714('0x54'),_0x568f3f);throw _0x568f3f;});}return _0x45a866;})[_0x1714('0x28')](respondWithResult(_0x3de050,0xc9))['catch'](handleError(_0x3de050,null));};exports[_0x1714('0x55')]=function(_0x401ae9,_0x3060f3){var _0x35607d={'where':{'id':_0x401ae9[_0x1714('0x56')]['id']}},_0x52fbde={};_0x52fbde[_0x1714('0x36')]=_[_0x1714('0x38')](db[_0x1714('0x32')]['rawAttributes']);_0x35607d[_0x1714('0x3b')]=_[_0x1714('0x3a')](_0x52fbde[_0x1714('0x36')],qs['fields'](_0x401ae9['query'][_0x1714('0x3c')]));_0x35607d[_0x1714('0x3b')]=_0x35607d[_0x1714('0x3b')][_0x1714('0x3d')]?_0x35607d[_0x1714('0x3b')]:_0x52fbde[_0x1714('0x36')];if(_0x401ae9[_0x1714('0x37')]['includeAll']){_0x35607d[_0x1714('0x47')]=[{'all':!![]}];}_0x35607d=_['merge']({},_0x35607d,_0x401ae9['options']);return db[_0x1714('0x32')][_0x1714('0x4c')](_0x35607d)[_0x1714('0x28')](handleEntityNotFound(_0x3060f3,null))['then'](function(_0x4790fb){if(_0x4790fb){var _0x3d3000=_0x4790fb['get']({'plain':!![]});_0x3d3000=qs[_0x1714('0x57')](_0x3d3000,['id',_0x1714('0x58'),_0x1714('0x59')]);_0x401ae9[_0x1714('0x4e')]=_[_0x1714('0x57')](_0x401ae9[_0x1714('0x4e')],['id',_0x1714('0x58'),_0x1714('0x59')]);return db[_0x1714('0x32')][_0x1714('0x4d')](_[_0x1714('0x44')](_0x3d3000,_0x401ae9[_0x1714('0x4e')]),{'include':_0x401ae9[_0x1714('0x37')][_0x1714('0x46')]?[{'all':!![]}]:undefined})[_0x1714('0x28')](function(_0x626ff2){var _0x27933d=_0x401ae9['user'][_0x1714('0x29')]({'plain':!![]});if(!_0x27933d)throw new Error(_0x1714('0x50'));if(_0x27933d[_0x1714('0x5a')]===_0x1714('0x4f')){var _0x12fc60=_0x626ff2[_0x1714('0x29')]({'plain':!![]});var _0x56b646='CustomDashboards';return db['UserProfileSection'][_0x1714('0x4c')]({'where':{'name':_0x56b646,'userProfileId':_0x27933d[_0x1714('0x52')]},'raw':!![]})[_0x1714('0x28')](function(_0x438e2e){if(_0x438e2e&&_0x438e2e[_0x1714('0x53')]===0x0){return db[_0x1714('0x2b')][_0x1714('0x4d')]({'name':_0x12fc60[_0x1714('0x2f')],'resourceId':_0x12fc60['id'],'type':_0x438e2e['name'],'sectionId':_0x438e2e['id']},{})[_0x1714('0x28')](function(){return _0x626ff2;});}else{return _0x626ff2;}})['catch'](function(_0x3584fb){logger[_0x1714('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3584fb);throw _0x3584fb;});}return _0x626ff2;});}})[_0x1714('0x28')](respondWithResult(_0x3060f3,0xc9))[_0x1714('0x4a')](handleError(_0x3060f3,null));};exports[_0x1714('0x26')]=function(_0x1425bf,_0x2ae987){if(_0x1425bf[_0x1714('0x4e')]['id']){delete _0x1425bf[_0x1714('0x4e')]['id'];}return db['Dashboard'][_0x1714('0x4c')]({'where':{'id':_0x1425bf[_0x1714('0x56')]['id']}})[_0x1714('0x28')](handleEntityNotFound(_0x2ae987,null))[_0x1714('0x28')](saveUpdates(_0x1425bf[_0x1714('0x4e')],null))['then'](respondWithResult(_0x2ae987,null))['catch'](handleError(_0x2ae987,null));};exports[_0x1714('0x27')]=function(_0x419b9c,_0x113ff7){return db[_0x1714('0x32')][_0x1714('0x4c')]({'where':{'id':_0x419b9c[_0x1714('0x56')]['id']}})[_0x1714('0x28')](handleEntityNotFound(_0x113ff7,null))[_0x1714('0x28')](removeEntity(_0x113ff7,null))[_0x1714('0x4a')](handleError(_0x113ff7,null));};function widgetAttributes(_0x793bd9){try{switch(_0x793bd9[_0x1714('0x35')]){case'iframe':return[{'name':'attrUrl','value':_0x793bd9[_0x1714('0x5b')]||(_0x793bd9[_0x1714('0x5c')]&&_0x793bd9['attrs'][0x0]?_0x793bd9['attrs'][0x0][_0x1714('0x5d')]:undefined)||'https://'}];case _0x1714('0x5e'):return[{'name':_0x1714('0x5f'),'value':_0x793bd9[_0x1714('0x5f')]||(_0x793bd9[_0x1714('0x5c')]&&_0x793bd9['attrs'][0x0]?_0x793bd9[_0x1714('0x5c')][0x0][_0x1714('0x5d')]:undefined)||''}];case'clock':return[{'name':_0x1714('0x60'),'value':_0x793bd9[_0x1714('0x60')]||(_0x793bd9[_0x1714('0x5c')]&&_0x793bd9[_0x1714('0x5c')][0x0]?_0x793bd9[_0x1714('0x5c')][0x0][_0x1714('0x5d')]:undefined)||_0x1714('0x61')},{'name':_0x1714('0x62'),'value':_0x793bd9['attrTimezone']||(_0x793bd9[_0x1714('0x5c')]&&_0x793bd9[_0x1714('0x5c')][0x1]?_0x793bd9[_0x1714('0x5c')][0x1][_0x1714('0x5d')]:undefined)||'0.00'},{'name':_0x1714('0x63'),'value':_0x793bd9['attrFontSize']||(_0x793bd9[_0x1714('0x5c')]&&_0x793bd9[_0x1714('0x5c')][0x2]?_0x793bd9['attrs'][0x2][_0x1714('0x5d')]:undefined)||0xc}];case _0x1714('0x64'):return[{'name':_0x1714('0x65'),'value':_0x793bd9['attrMetric']||(_0x793bd9['attrs']&&_0x793bd9[_0x1714('0x5c')][0x0]?_0x793bd9[_0x1714('0x5c')][0x0][_0x1714('0x5d')]:undefined)||_0x1714('0x66')},{'name':'attrVoiceQueues','value':_0x793bd9[_0x1714('0x67')]||(_0x793bd9[_0x1714('0x5c')]&&_0x793bd9['attrs'][0x1]?_0x793bd9['attrs'][0x1]['value']:undefined)||[]},{'name':_0x1714('0x63'),'value':_0x793bd9[_0x1714('0x63')]||(_0x793bd9[_0x1714('0x5c')]&&_0x793bd9[_0x1714('0x5c')][0x2]?_0x793bd9[_0x1714('0x5c')][0x2][_0x1714('0x5d')]:undefined)||0x14}];case _0x1714('0x68'):case _0x1714('0x69'):return[{'name':_0x1714('0x6a'),'value':_0x793bd9[_0x1714('0x6a')]||(_0x793bd9[_0x1714('0x5c')]&&_0x793bd9['attrs'][0x0]?_0x793bd9[_0x1714('0x5c')][0x0][_0x1714('0x5d')]:undefined)||_0x1714('0x66')},{'name':_0x1714('0x6b'),'value':_0x793bd9[_0x1714('0x6b')]||(_0x793bd9[_0x1714('0x5c')]&&_0x793bd9['attrs'][0x1]?_0x793bd9[_0x1714('0x5c')][0x1][_0x1714('0x5d')]:undefined)||null},{'name':'attrSerie3','value':_0x793bd9[_0x1714('0x6c')]||(_0x793bd9[_0x1714('0x5c')]&&_0x793bd9[_0x1714('0x5c')][0x2]?_0x793bd9[_0x1714('0x5c')][0x2]['value']:undefined)||null},{'name':_0x1714('0x67'),'value':_0x793bd9[_0x1714('0x67')]||(_0x793bd9[_0x1714('0x5c')]&&_0x793bd9[_0x1714('0x5c')][0x3]?_0x793bd9[_0x1714('0x5c')][0x3]['value']:undefined)||[]}];case _0x1714('0x6d'):return[{'name':_0x1714('0x6e'),'type':_0x793bd9[_0x1714('0x6f')]||(_0x793bd9['attrs']&&_0x793bd9['attrs'][0x0]?_0x793bd9[_0x1714('0x5c')][0x0][_0x1714('0x35')]:undefined)||null,'value':_0x793bd9['attrReport']||(_0x793bd9[_0x1714('0x5c')]&&_0x793bd9[_0x1714('0x5c')][0x0]?_0x793bd9[_0x1714('0x5c')][0x0][_0x1714('0x5d')]:undefined)||null},{'name':'attrRefresh','value':_0x793bd9['attrRefresh']||(_0x793bd9[_0x1714('0x5c')]&&_0x793bd9['attrs'][0x1]?_0x793bd9[_0x1714('0x5c')][0x1][_0x1714('0x5d')]:undefined)||0x0}];default:return[];}}catch(_0xa3ca9b){logger[_0x1714('0x2d')](_0x1714('0x70'),JSON[_0x1714('0x71')](_0xa3ca9b));return[];}}exports[_0x1714('0x72')]=function(_0x471429,_0x4cc9a0,_0x33df8b){if(_0x471429[_0x1714('0x4e')]['id']){delete _0x471429[_0x1714('0x4e')]['id'];}return db[_0x1714('0x32')]['find']({'where':{'id':_0x471429[_0x1714('0x56')]['id']}})[_0x1714('0x28')](handleEntityNotFound(_0x4cc9a0,null))[_0x1714('0x28')](function(_0x4ae8a2){if(_0x4ae8a2){_0x471429['body'][_0x1714('0x73')]=_0x4ae8a2['id'];_0x471429['body'][_0x1714('0x5c')]=widgetAttributes(_0x471429[_0x1714('0x4e')]);return db[_0x1714('0x74')][_0x1714('0x4d')](_0x471429[_0x1714('0x4e')]);}})[_0x1714('0x28')](respondWithResult(_0x4cc9a0,null))[_0x1714('0x4a')](handleError(_0x4cc9a0,null));};exports['getItems']=function(_0x53ac66,_0x22677e,_0x1d9635){var _0x5eea43={};var _0x213545={};var _0x36da1d;var _0x359042;return db['Dashboard'][_0x1714('0x75')]({'where':{'id':_0x53ac66[_0x1714('0x56')]['id']}})['then'](handleEntityNotFound(_0x22677e,null))[_0x1714('0x28')](function(_0x4c4422){if(_0x4c4422){_0x36da1d=_0x4c4422;_0x213545['model']=_[_0x1714('0x38')](db['DashboardItem'][_0x1714('0x33')]);_0x213545[_0x1714('0x37')]=_[_0x1714('0x38')](_0x53ac66[_0x1714('0x37')]);_0x213545[_0x1714('0x39')]=_[_0x1714('0x3a')](_0x213545[_0x1714('0x36')],_0x213545[_0x1714('0x37')]);_0x5eea43[_0x1714('0x3b')]=_['intersection'](_0x213545[_0x1714('0x36')],qs[_0x1714('0x3c')](_0x53ac66[_0x1714('0x37')]['fields']));_0x5eea43[_0x1714('0x3b')]=_0x5eea43[_0x1714('0x3b')]['length']?_0x5eea43['attributes']:_0x213545[_0x1714('0x36')];_0x5eea43[_0x1714('0x40')]=qs[_0x1714('0x76')](_0x53ac66[_0x1714('0x37')][_0x1714('0x76')]);_0x5eea43['where']=qs[_0x1714('0x39')](_[_0x1714('0x41')](_0x53ac66[_0x1714('0x37')],_0x213545[_0x1714('0x39')]));if(_0x53ac66[_0x1714('0x37')][_0x1714('0x42')]){_0x5eea43[_0x1714('0x43')]=_['merge'](_0x5eea43['where'],{'$or':_[_0x1714('0x31')](_0x5eea43[_0x1714('0x3b')],function(_0x2e4c29){var _0x513c70={};_0x513c70[_0x2e4c29]={'$like':'%'+_0x53ac66[_0x1714('0x37')]['filter']+'%'};return _0x513c70;})});}_0x5eea43=_['merge']({},_0x5eea43,_0x53ac66[_0x1714('0x4b')]);return _0x36da1d[_0x1714('0x77')](_0x5eea43);}})[_0x1714('0x28')](function(_0x240996){if(_0x240996){_0x359042=_0x240996[_0x1714('0x3d')];if(!_0x53ac66['query'][_0x1714('0x3e')](_0x1714('0x78'))){_0x5eea43[_0x1714('0x3f')]=qs[_0x1714('0x3f')](_0x53ac66[_0x1714('0x37')][_0x1714('0x3f')]);_0x5eea43[_0x1714('0x20')]=qs[_0x1714('0x20')](_0x53ac66[_0x1714('0x37')]['offset']);}return _0x36da1d[_0x1714('0x77')](_0x5eea43);}})['then'](function(_0xdb8c4b){if(_0xdb8c4b){return _0xdb8c4b?{'count':_0x359042,'rows':_0xdb8c4b}:null;}})[_0x1714('0x28')](respondWithResult(_0x22677e,null))['catch'](handleError(_0x22677e,null));}; \ No newline at end of file +var _0x3517=['attrSerie2','attrSerie3','web-report','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardId','DashboardItem','getItems','findOne','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','then','get','CustomDashboards','UserProfileResource','error','stack','name','send','index','map','Dashboard','rawAttributes','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','keys','find','create','body','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','iframe','attrUrl','attrs','value','custom','attrPath','clock','attrHourFormat','attrTimezone','0.00','attrFontSize','total','attrVoiceQueues','multibar-chart','pie-chart'];(function(_0x500419,_0x549162){var _0x241c1a=function(_0x3bea1a){while(--_0x3bea1a){_0x500419['push'](_0x500419['shift']());}};_0x241c1a(++_0x549162);}(_0x3517,0xfd));var _0x7351=function(_0x92c933,_0x155cc9){_0x92c933=_0x92c933-0x0;var _0x5e47c3=_0x3517[_0x92c933];return _0x5e47c3;};'use strict';var emlformat=require(_0x7351('0x0'));var rimraf=require(_0x7351('0x1'));var zipdir=require(_0x7351('0x2'));var jsonpatch=require(_0x7351('0x3'));var rp=require('request-promise');var moment=require(_0x7351('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7351('0x5'));var util=require('util');var path=require(_0x7351('0x6'));var sox=require(_0x7351('0x7'));var csv=require(_0x7351('0x8'));var ejs=require(_0x7351('0x9'));var fs=require('fs');var fs_extra=require(_0x7351('0xa'));var _=require(_0x7351('0xb'));var squel=require('squel');var crypto=require(_0x7351('0xc'));var jsforce=require(_0x7351('0xd'));var deskjs=require(_0x7351('0xe'));var toCsv=require('to-csv');var querystring=require(_0x7351('0xf'));var Papa=require(_0x7351('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x7351('0x11'));var as=require(_0x7351('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7351('0x13'))(_0x7351('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7351('0x15'));var db=require(_0x7351('0x16'))['db'];config[_0x7351('0x17')]=_[_0x7351('0x18')](config[_0x7351('0x17')],{'host':_0x7351('0x19'),'port':0x18eb});var socket=require(_0x7351('0x1a'))(new Redis(config[_0x7351('0x17')]));require(_0x7351('0x1b'))[_0x7351('0x1c')](socket);function respondWithStatusCode(_0x50db3d,_0x4f465e){_0x4f465e=_0x4f465e||0xcc;return function(_0x10eced){if(_0x10eced){return _0x50db3d[_0x7351('0x1d')](_0x4f465e);}return _0x50db3d[_0x7351('0x1e')](_0x4f465e)[_0x7351('0x1f')]();};}function respondWithResult(_0x5ceefd,_0x3c0ced){_0x3c0ced=_0x3c0ced||0xc8;return function(_0x1ba0cf){if(_0x1ba0cf){return _0x5ceefd[_0x7351('0x1e')](_0x3c0ced)[_0x7351('0x20')](_0x1ba0cf);}};}function respondWithFilteredResult(_0x2dd4b3,_0x2ff22c){return function(_0x94e913){if(_0x94e913){var _0x3931ea=typeof _0x2ff22c[_0x7351('0x21')]===_0x7351('0x22')&&typeof _0x2ff22c[_0x7351('0x23')]==='undefined';var _0xd41491=_0x94e913[_0x7351('0x24')];var _0x10c0d8=_0x3931ea?0x0:_0x2ff22c[_0x7351('0x21')];var _0x375906=_0x3931ea?_0x94e913[_0x7351('0x24')]:_0x2ff22c['offset']+_0x2ff22c[_0x7351('0x23')];var _0x397355;if(_0x375906>=_0xd41491){_0x375906=_0xd41491;_0x397355=0xc8;}else{_0x397355=0xce;}_0x2dd4b3[_0x7351('0x1e')](_0x397355);return _0x2dd4b3['set'](_0x7351('0x25'),_0x10c0d8+'-'+_0x375906+'/'+_0xd41491)[_0x7351('0x20')](_0x94e913);}return null;};}function patchUpdates(_0x2d7a56){return function(_0x3fbb1b){try{jsonpatch[_0x7351('0x26')](_0x3fbb1b,_0x2d7a56,!![]);}catch(_0x579ad2){return BPromise[_0x7351('0x27')](_0x579ad2);}return _0x3fbb1b[_0x7351('0x28')]();};}function saveUpdates(_0x2b6d5e,_0x86ef96){return function(_0x1a0784){if(_0x1a0784){return _0x1a0784[_0x7351('0x29')](_0x2b6d5e)['then'](function(_0x994fd4){return _0x994fd4;});}return null;};}function removeEntity(_0x2e10be,_0x3148db){return function(_0x2d4c8c){if(_0x2d4c8c){return _0x2d4c8c[_0x7351('0x2a')]()[_0x7351('0x2b')](function(){var _0x425234=_0x2d4c8c[_0x7351('0x2c')]({'plain':!![]});var _0x19b4c1=_0x7351('0x2d');return db[_0x7351('0x2e')][_0x7351('0x2a')]({'where':{'type':_0x19b4c1,'resourceId':_0x425234['id']}})[_0x7351('0x2b')](function(){return _0x2d4c8c;});})[_0x7351('0x2b')](function(){_0x2e10be[_0x7351('0x1e')](0xcc)[_0x7351('0x1f')]();});}};}function handleEntityNotFound(_0x50ad69,_0x52b303){return function(_0x3523d4){if(!_0x3523d4){_0x50ad69[_0x7351('0x1d')](0x194);}return _0x3523d4;};}function handleError(_0x1230a9,_0xcde56){_0xcde56=_0xcde56||0x1f4;return function(_0x77f121){logger[_0x7351('0x2f')](_0x77f121[_0x7351('0x30')]);if(_0x77f121[_0x7351('0x31')]){delete _0x77f121['name'];}_0x1230a9[_0x7351('0x1e')](_0xcde56)[_0x7351('0x32')](_0x77f121);};}exports[_0x7351('0x33')]=function(_0x412eda,_0x4ed82c){var _0x23fca8={},_0xd1b619={},_0x36fd4c={'count':0x0,'rows':[]};var _0x1a284d=_[_0x7351('0x34')](db[_0x7351('0x35')][_0x7351('0x36')],function(_0x33afca){return{'name':_0x33afca['fieldName'],'type':_0x33afca[_0x7351('0x37')][_0x7351('0x38')]};});_0xd1b619[_0x7351('0x39')]=_[_0x7351('0x34')](_0x1a284d,_0x7351('0x31'));_0xd1b619[_0x7351('0x3a')]=_['keys'](_0x412eda[_0x7351('0x3a')]);_0xd1b619['filters']=_[_0x7351('0x3b')](_0xd1b619['model'],_0xd1b619[_0x7351('0x3a')]);_0x23fca8[_0x7351('0x3c')]=_[_0x7351('0x3b')](_0xd1b619['model'],qs[_0x7351('0x3d')](_0x412eda['query']['fields']));_0x23fca8['attributes']=_0x23fca8[_0x7351('0x3c')][_0x7351('0x3e')]?_0x23fca8['attributes']:_0xd1b619[_0x7351('0x39')];if(!_0x412eda[_0x7351('0x3a')][_0x7351('0x3f')]('nolimit')){_0x23fca8[_0x7351('0x23')]=qs[_0x7351('0x23')](_0x412eda[_0x7351('0x3a')][_0x7351('0x23')]);_0x23fca8[_0x7351('0x21')]=qs['offset'](_0x412eda['query'][_0x7351('0x21')]);}_0x23fca8[_0x7351('0x40')]=qs[_0x7351('0x41')](_0x412eda[_0x7351('0x3a')][_0x7351('0x41')]);_0x23fca8[_0x7351('0x42')]=qs[_0x7351('0x43')](_[_0x7351('0x44')](_0x412eda[_0x7351('0x3a')],_0xd1b619[_0x7351('0x43')]),_0x1a284d);if(_0x412eda[_0x7351('0x3a')][_0x7351('0x45')]){_0x23fca8[_0x7351('0x42')]=_[_0x7351('0x46')](_0x23fca8[_0x7351('0x42')],{'$or':_[_0x7351('0x34')](_0x1a284d,function(_0x275ec5){if(_0x275ec5[_0x7351('0x37')]!==_0x7351('0x47')){var _0x119162={};_0x119162[_0x275ec5[_0x7351('0x31')]]={'$like':'%'+_0x412eda[_0x7351('0x3a')][_0x7351('0x45')]+'%'};return _0x119162;}})});}_0x23fca8=_[_0x7351('0x46')]({},_0x23fca8,_0x412eda[_0x7351('0x48')]);var _0x5651e3={'where':_0x23fca8[_0x7351('0x42')]};return db[_0x7351('0x35')][_0x7351('0x24')](_0x5651e3)[_0x7351('0x2b')](function(_0x58242f){_0x36fd4c[_0x7351('0x24')]=_0x58242f;if(_0x412eda['query'][_0x7351('0x49')]){_0x23fca8[_0x7351('0x4a')]=[{'all':!![]}];}return db[_0x7351('0x35')]['findAll'](_0x23fca8);})[_0x7351('0x2b')](function(_0x54229a){_0x36fd4c[_0x7351('0x4b')]=_0x54229a;return _0x36fd4c;})[_0x7351('0x2b')](respondWithFilteredResult(_0x4ed82c,_0x23fca8))[_0x7351('0x4c')](handleError(_0x4ed82c,null));};exports[_0x7351('0x4d')]=function(_0x2b7d97,_0x427d81){var _0xe5fc16={'raw':![],'where':{'id':_0x2b7d97[_0x7351('0x4e')]['id']}},_0x594b9a={};_0x594b9a[_0x7351('0x39')]=_[_0x7351('0x4f')](db[_0x7351('0x35')]['rawAttributes']);_0x594b9a[_0x7351('0x3a')]=_[_0x7351('0x4f')](_0x2b7d97['query']);_0x594b9a[_0x7351('0x43')]=_[_0x7351('0x3b')](_0x594b9a[_0x7351('0x39')],_0x594b9a['query']);_0xe5fc16[_0x7351('0x3c')]=_['intersection'](_0x594b9a[_0x7351('0x39')],qs[_0x7351('0x3d')](_0x2b7d97[_0x7351('0x3a')][_0x7351('0x3d')]));_0xe5fc16['attributes']=_0xe5fc16['attributes'][_0x7351('0x3e')]?_0xe5fc16['attributes']:_0x594b9a[_0x7351('0x39')];if(_0x2b7d97['query']['includeAll']){_0xe5fc16[_0x7351('0x4a')]=[{'all':!![]}];}_0xe5fc16=_[_0x7351('0x46')]({},_0xe5fc16,_0x2b7d97[_0x7351('0x48')]);return db[_0x7351('0x35')][_0x7351('0x50')](_0xe5fc16)[_0x7351('0x2b')](handleEntityNotFound(_0x427d81,null))[_0x7351('0x2b')](respondWithResult(_0x427d81,null))['catch'](handleError(_0x427d81,null));};exports[_0x7351('0x51')]=function(_0x3ad73c,_0x24f206){return db['Dashboard'][_0x7351('0x51')](_0x3ad73c[_0x7351('0x52')],{})[_0x7351('0x2b')](function(_0x53c2cc){var _0x4034f3=_0x3ad73c['user'][_0x7351('0x2c')]({'plain':!![]});if(!_0x4034f3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4034f3[_0x7351('0x53')]==='user'){var _0x5a5e1c=_0x53c2cc[_0x7351('0x2c')]({'plain':!![]});var _0x223f96=_0x7351('0x2d');return db[_0x7351('0x54')][_0x7351('0x50')]({'where':{'name':_0x223f96,'userProfileId':_0x4034f3['userProfileId']},'raw':!![]})[_0x7351('0x2b')](function(_0x414798){if(_0x414798&&_0x414798['autoAssociation']===0x0){return db['UserProfileResource'][_0x7351('0x51')]({'name':_0x5a5e1c[_0x7351('0x31')],'resourceId':_0x5a5e1c['id'],'type':_0x414798[_0x7351('0x31')],'sectionId':_0x414798['id']},{})[_0x7351('0x2b')](function(){return _0x53c2cc;});}else{return _0x53c2cc;}})[_0x7351('0x4c')](function(_0x2f0c62){logger[_0x7351('0x2f')](_0x7351('0x55'),_0x2f0c62);throw _0x2f0c62;});}return _0x53c2cc;})['then'](respondWithResult(_0x24f206,0xc9))[_0x7351('0x4c')](handleError(_0x24f206,null));};exports[_0x7351('0x56')]=function(_0xef1c90,_0x213885){var _0x331ff7={'where':{'id':_0xef1c90[_0x7351('0x4e')]['id']}},_0x442f68={};_0x442f68[_0x7351('0x39')]=_[_0x7351('0x4f')](db[_0x7351('0x35')][_0x7351('0x36')]);_0x331ff7[_0x7351('0x3c')]=_[_0x7351('0x3b')](_0x442f68[_0x7351('0x39')],qs[_0x7351('0x3d')](_0xef1c90[_0x7351('0x3a')]['fields']));_0x331ff7['attributes']=_0x331ff7[_0x7351('0x3c')][_0x7351('0x3e')]?_0x331ff7[_0x7351('0x3c')]:_0x442f68[_0x7351('0x39')];if(_0xef1c90[_0x7351('0x3a')][_0x7351('0x49')]){_0x331ff7[_0x7351('0x4a')]=[{'all':!![]}];}_0x331ff7=_[_0x7351('0x46')]({},_0x331ff7,_0xef1c90[_0x7351('0x48')]);return db['Dashboard'][_0x7351('0x50')](_0x331ff7)['then'](handleEntityNotFound(_0x213885,null))[_0x7351('0x2b')](function(_0x4a30db){if(_0x4a30db){var _0x33890d=_0x4a30db[_0x7351('0x2c')]({'plain':!![]});_0x33890d=qs[_0x7351('0x57')](_0x33890d,['id',_0x7351('0x58'),_0x7351('0x59')]);_0xef1c90[_0x7351('0x52')]=_[_0x7351('0x57')](_0xef1c90[_0x7351('0x52')],['id',_0x7351('0x58'),_0x7351('0x59')]);return db[_0x7351('0x35')][_0x7351('0x51')](_[_0x7351('0x46')](_0x33890d,_0xef1c90['body']),{'include':_0xef1c90['query'][_0x7351('0x49')]?[{'all':!![]}]:undefined})[_0x7351('0x2b')](function(_0x250e2a){var _0x3ac01b=_0xef1c90['user'][_0x7351('0x2c')]({'plain':!![]});if(!_0x3ac01b)throw new Error(_0x7351('0x5a'));if(_0x3ac01b['role']==='user'){var _0x26cac2=_0x250e2a[_0x7351('0x2c')]({'plain':!![]});var _0x2b8139=_0x7351('0x2d');return db[_0x7351('0x54')][_0x7351('0x50')]({'where':{'name':_0x2b8139,'userProfileId':_0x3ac01b['userProfileId']},'raw':!![]})[_0x7351('0x2b')](function(_0x294d58){if(_0x294d58&&_0x294d58[_0x7351('0x5b')]===0x0){return db[_0x7351('0x2e')][_0x7351('0x51')]({'name':_0x26cac2[_0x7351('0x31')],'resourceId':_0x26cac2['id'],'type':_0x294d58[_0x7351('0x31')],'sectionId':_0x294d58['id']},{})[_0x7351('0x2b')](function(){return _0x250e2a;});}else{return _0x250e2a;}})[_0x7351('0x4c')](function(_0x568ec4){logger['error'](_0x7351('0x55'),_0x568ec4);throw _0x568ec4;});}return _0x250e2a;});}})[_0x7351('0x2b')](respondWithResult(_0x213885,0xc9))[_0x7351('0x4c')](handleError(_0x213885,null));};exports['update']=function(_0x3a2114,_0x4a74ae){if(_0x3a2114[_0x7351('0x52')]['id']){delete _0x3a2114[_0x7351('0x52')]['id'];}return db[_0x7351('0x35')]['find']({'where':{'id':_0x3a2114[_0x7351('0x4e')]['id']}})['then'](handleEntityNotFound(_0x4a74ae,null))[_0x7351('0x2b')](saveUpdates(_0x3a2114[_0x7351('0x52')],null))[_0x7351('0x2b')](respondWithResult(_0x4a74ae,null))['catch'](handleError(_0x4a74ae,null));};exports[_0x7351('0x2a')]=function(_0x345b30,_0x131eaa){return db[_0x7351('0x35')][_0x7351('0x50')]({'where':{'id':_0x345b30[_0x7351('0x4e')]['id']}})['then'](handleEntityNotFound(_0x131eaa,null))[_0x7351('0x2b')](removeEntity(_0x131eaa,null))[_0x7351('0x4c')](handleError(_0x131eaa,null));};function widgetAttributes(_0x206019){try{switch(_0x206019[_0x7351('0x37')]){case _0x7351('0x5c'):return[{'name':_0x7351('0x5d'),'value':_0x206019[_0x7351('0x5d')]||(_0x206019['attrs']&&_0x206019[_0x7351('0x5e')][0x0]?_0x206019['attrs'][0x0][_0x7351('0x5f')]:undefined)||'https://'}];case _0x7351('0x60'):return[{'name':_0x7351('0x61'),'value':_0x206019['attrPath']||(_0x206019['attrs']&&_0x206019[_0x7351('0x5e')][0x0]?_0x206019[_0x7351('0x5e')][0x0][_0x7351('0x5f')]:undefined)||''}];case _0x7351('0x62'):return[{'name':_0x7351('0x63'),'value':_0x206019[_0x7351('0x63')]||(_0x206019['attrs']&&_0x206019[_0x7351('0x5e')][0x0]?_0x206019[_0x7351('0x5e')][0x0][_0x7351('0x5f')]:undefined)||'HH:mm:ss'},{'name':_0x7351('0x64'),'value':_0x206019[_0x7351('0x64')]||(_0x206019[_0x7351('0x5e')]&&_0x206019[_0x7351('0x5e')][0x1]?_0x206019[_0x7351('0x5e')][0x1]['value']:undefined)||_0x7351('0x65')},{'name':_0x7351('0x66'),'value':_0x206019[_0x7351('0x66')]||(_0x206019[_0x7351('0x5e')]&&_0x206019[_0x7351('0x5e')][0x2]?_0x206019[_0x7351('0x5e')][0x2]['value']:undefined)||0xc}];case'counter':return[{'name':'attrMetric','value':_0x206019['attrMetric']||(_0x206019[_0x7351('0x5e')]&&_0x206019['attrs'][0x0]?_0x206019[_0x7351('0x5e')][0x0]['value']:undefined)||_0x7351('0x67')},{'name':_0x7351('0x68'),'value':_0x206019[_0x7351('0x68')]||(_0x206019['attrs']&&_0x206019['attrs'][0x1]?_0x206019[_0x7351('0x5e')][0x1][_0x7351('0x5f')]:undefined)||[]},{'name':_0x7351('0x66'),'value':_0x206019['attrFontSize']||(_0x206019[_0x7351('0x5e')]&&_0x206019[_0x7351('0x5e')][0x2]?_0x206019[_0x7351('0x5e')][0x2][_0x7351('0x5f')]:undefined)||0x14}];case _0x7351('0x69'):case _0x7351('0x6a'):return[{'name':'attrSerie1','value':_0x206019['attrSerie1']||(_0x206019[_0x7351('0x5e')]&&_0x206019[_0x7351('0x5e')][0x0]?_0x206019[_0x7351('0x5e')][0x0][_0x7351('0x5f')]:undefined)||_0x7351('0x67')},{'name':_0x7351('0x6b'),'value':_0x206019[_0x7351('0x6b')]||(_0x206019['attrs']&&_0x206019['attrs'][0x1]?_0x206019['attrs'][0x1][_0x7351('0x5f')]:undefined)||null},{'name':_0x7351('0x6c'),'value':_0x206019[_0x7351('0x6c')]||(_0x206019['attrs']&&_0x206019[_0x7351('0x5e')][0x2]?_0x206019[_0x7351('0x5e')][0x2][_0x7351('0x5f')]:undefined)||null},{'name':_0x7351('0x68'),'value':_0x206019[_0x7351('0x68')]||(_0x206019[_0x7351('0x5e')]&&_0x206019['attrs'][0x3]?_0x206019[_0x7351('0x5e')][0x3][_0x7351('0x5f')]:undefined)||[]}];case _0x7351('0x6d'):return[{'name':_0x7351('0x6e'),'type':_0x206019['reportType']||(_0x206019[_0x7351('0x5e')]&&_0x206019[_0x7351('0x5e')][0x0]?_0x206019['attrs'][0x0][_0x7351('0x37')]:undefined)||null,'value':_0x206019[_0x7351('0x6e')]||(_0x206019[_0x7351('0x5e')]&&_0x206019[_0x7351('0x5e')][0x0]?_0x206019[_0x7351('0x5e')][0x0]['value']:undefined)||null},{'name':_0x7351('0x6f'),'value':_0x206019[_0x7351('0x6f')]||(_0x206019[_0x7351('0x5e')]&&_0x206019['attrs'][0x1]?_0x206019[_0x7351('0x5e')][0x1][_0x7351('0x5f')]:undefined)||0x0}];default:return[];}}catch(_0x3e1964){logger[_0x7351('0x2f')](_0x7351('0x70'),JSON[_0x7351('0x71')](_0x3e1964));return[];}}exports[_0x7351('0x72')]=function(_0x11f5f1,_0x4ec3b6,_0x16a5f0){if(_0x11f5f1[_0x7351('0x52')]['id']){delete _0x11f5f1[_0x7351('0x52')]['id'];}return db[_0x7351('0x35')][_0x7351('0x50')]({'where':{'id':_0x11f5f1[_0x7351('0x4e')]['id']}})[_0x7351('0x2b')](handleEntityNotFound(_0x4ec3b6,null))['then'](function(_0x69064){if(_0x69064){_0x11f5f1[_0x7351('0x52')][_0x7351('0x73')]=_0x69064['id'];_0x11f5f1[_0x7351('0x52')]['attrs']=widgetAttributes(_0x11f5f1['body']);return db[_0x7351('0x74')][_0x7351('0x51')](_0x11f5f1[_0x7351('0x52')]);}})[_0x7351('0x2b')](respondWithResult(_0x4ec3b6,null))['catch'](handleError(_0x4ec3b6,null));};exports[_0x7351('0x75')]=function(_0x4b2753,_0x4fa4dc,_0x31daee){var _0x223233={};var _0x5d29cb={};var _0xa61637;var _0x217d52;return db[_0x7351('0x35')][_0x7351('0x76')]({'where':{'id':_0x4b2753[_0x7351('0x4e')]['id']}})[_0x7351('0x2b')](handleEntityNotFound(_0x4fa4dc,null))['then'](function(_0x564bd6){if(_0x564bd6){_0xa61637=_0x564bd6;_0x5d29cb['model']=_[_0x7351('0x4f')](db['DashboardItem']['rawAttributes']);_0x5d29cb[_0x7351('0x3a')]=_['keys'](_0x4b2753[_0x7351('0x3a')]);_0x5d29cb['filters']=_[_0x7351('0x3b')](_0x5d29cb[_0x7351('0x39')],_0x5d29cb['query']);_0x223233[_0x7351('0x3c')]=_['intersection'](_0x5d29cb[_0x7351('0x39')],qs[_0x7351('0x3d')](_0x4b2753['query'][_0x7351('0x3d')]));_0x223233[_0x7351('0x3c')]=_0x223233[_0x7351('0x3c')][_0x7351('0x3e')]?_0x223233['attributes']:_0x5d29cb[_0x7351('0x39')];_0x223233[_0x7351('0x40')]=qs['sort'](_0x4b2753[_0x7351('0x3a')][_0x7351('0x41')]);_0x223233[_0x7351('0x42')]=qs[_0x7351('0x43')](_[_0x7351('0x44')](_0x4b2753['query'],_0x5d29cb[_0x7351('0x43')]));if(_0x4b2753[_0x7351('0x3a')][_0x7351('0x45')]){_0x223233[_0x7351('0x42')]=_[_0x7351('0x46')](_0x223233[_0x7351('0x42')],{'$or':_[_0x7351('0x34')](_0x223233[_0x7351('0x3c')],function(_0x1e260e){var _0x45789d={};_0x45789d[_0x1e260e]={'$like':'%'+_0x4b2753['query']['filter']+'%'};return _0x45789d;})});}_0x223233=_['merge']({},_0x223233,_0x4b2753[_0x7351('0x48')]);return _0xa61637[_0x7351('0x75')](_0x223233);}})[_0x7351('0x2b')](function(_0x234c97){if(_0x234c97){_0x217d52=_0x234c97[_0x7351('0x3e')];if(!_0x4b2753[_0x7351('0x3a')]['hasOwnProperty'](_0x7351('0x77'))){_0x223233[_0x7351('0x23')]=qs[_0x7351('0x23')](_0x4b2753[_0x7351('0x3a')][_0x7351('0x23')]);_0x223233[_0x7351('0x21')]=qs[_0x7351('0x21')](_0x4b2753[_0x7351('0x3a')][_0x7351('0x21')]);}return _0xa61637[_0x7351('0x75')](_0x223233);}})[_0x7351('0x2b')](function(_0x19feda){if(_0x19feda){return _0x19feda?{'count':_0x217d52,'rows':_0x19feda}:null;}})['then'](respondWithResult(_0x4fa4dc,null))[_0x7351('0x4c')](handleError(_0x4fa4dc,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index 59d8ec7..53e98a3 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 _0xe935=['update','emit','hasOwnProperty','events','../../mysqldb','setMaxListeners'];(function(_0x5c8c13,_0x3381b0){var _0x1c6868=function(_0x5c1d6e){while(--_0x5c1d6e){_0x5c8c13['push'](_0x5c8c13['shift']());}};_0x1c6868(++_0x3381b0);}(_0xe935,0x10b));var _0x5e93=function(_0xbd86de,_0x5866af){_0xbd86de=_0xbd86de-0x0;var _0xb7461f=_0xe935[_0xbd86de];return _0xb7461f;};'use strict';var EventEmitter=require(_0x5e93('0x0'));var Dashboard=require(_0x5e93('0x1'))['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents[_0x5e93('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x5e93('0x3'),'afterDestroy':'remove'};function emitEvent(_0x3be933){return function(_0x27ea40,_0x49adc0,_0x43b284){DashboardEvents[_0x5e93('0x4')](_0x3be933+':'+_0x27ea40['id'],_0x27ea40);DashboardEvents[_0x5e93('0x4')](_0x3be933,_0x27ea40);_0x43b284(null);};}for(var e in events){if(events[_0x5e93('0x5')](e)){var event=events[e];Dashboard['hook'](e,emitEvent(event));}}module['exports']=DashboardEvents; \ No newline at end of file +var _0xbff5=['setMaxListeners','save','update','remove','emit','exports','Dashboard'];(function(_0x18e599,_0x2280a6){var _0x2a7a2d=function(_0xd6c04c){while(--_0xd6c04c){_0x18e599['push'](_0x18e599['shift']());}};_0x2a7a2d(++_0x2280a6);}(_0xbff5,0x180));var _0x5bff=function(_0x1e357a,_0x1e5a1e){_0x1e357a=_0x1e357a-0x0;var _0x1bd35a=_0xbff5[_0x1e357a];return _0x1bd35a;};'use strict';var EventEmitter=require('events');var Dashboard=require('../../mysqldb')['db'][_0x5bff('0x0')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x5bff('0x1')](0x0);var events={'afterCreate':_0x5bff('0x2'),'afterUpdate':_0x5bff('0x3'),'afterDestroy':_0x5bff('0x4')};function emitEvent(_0x2b781e){return function(_0x4b48df,_0x12ea0b,_0x4b0d90){DashboardEvents[_0x5bff('0x5')](_0x2b781e+':'+_0x4b48df['id'],_0x4b48df);DashboardEvents[_0x5bff('0x5')](_0x2b781e,_0x4b48df);_0x4b0d90(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard['hook'](e,emitEvent(event));}}module[_0x5bff('0x6')]=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index 868d81e..03463db 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 _0x8dbb=['request-promise','path','../../config/environment','./dashboard.attributes','exports','define','lodash','util','../../config/logger','moment'];(function(_0x272fa1,_0x51f993){var _0x34c959=function(_0x1609db){while(--_0x1609db){_0x272fa1['push'](_0x272fa1['shift']());}};_0x34c959(++_0x51f993);}(_0x8dbb,0xce));var _0xb8db=function(_0x3a2643,_0x5410b6){_0x3a2643=_0x3a2643-0x0;var _0x4ea827=_0x8dbb[_0x3a2643];return _0x4ea827;};'use strict';var _=require(_0xb8db('0x0'));var util=require(_0xb8db('0x1'));var logger=require(_0xb8db('0x2'))('api');var moment=require(_0xb8db('0x3'));var BPromise=require('bluebird');var rp=require(_0xb8db('0x4'));var fs=require('fs');var path=require(_0xb8db('0x5'));var rimraf=require('rimraf');var config=require(_0xb8db('0x6'));var attributes=require(_0xb8db('0x7'));module[_0xb8db('0x8')]=function(_0x4e1370,_0x432de7){return _0x4e1370[_0xb8db('0x9')]('Dashboard',attributes,{'tableName':'dashboards','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x46f0=['util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','define','Dashboard'];(function(_0x56833d,_0x56e614){var _0x5e51e6=function(_0x563294){while(--_0x563294){_0x56833d['push'](_0x56833d['shift']());}};_0x5e51e6(++_0x56e614);}(_0x46f0,0x1a7));var _0x046f=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x46f0[_0x122ef9];return _0x42fba0;};'use strict';var _=require('lodash');var util=require(_0x046f('0x0'));var logger=require(_0x046f('0x1'))(_0x046f('0x2'));var moment=require(_0x046f('0x3'));var BPromise=require('bluebird');var rp=require(_0x046f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x046f('0x5'));var config=require(_0x046f('0x6'));var attributes=require('./dashboard.attributes');module['exports']=function(_0x245939,_0x337388){return _0x245939[_0x046f('0x7')](_0x046f('0x8'),attributes,{'tableName':'dashboards','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 662e20e..788dc3b 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 _0x86d7=['error','code','Dashboard,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','register','request','then','info','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x86d7,0x1b6));var _0x786d=function(_0x1855a2,_0x441076){_0x1855a2=_0x1855a2-0x0;var _0xbf7dd2=_0x86d7[_0x1855a2];return _0xbf7dd2;};'use strict';var _=require(_0x786d('0x0'));var util=require(_0x786d('0x1'));var moment=require(_0x786d('0x2'));var BPromise=require('bluebird');var rs=require(_0x786d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x786d('0x4'))['db'];var utils=require(_0x786d('0x5'));var logger=require(_0x786d('0x6'))(_0x786d('0x7'));var config=require(_0x786d('0x8'));var jayson=require(_0x786d('0x9'));var client=jayson[_0x786d('0xa')]['http']({'port':0x232a});config[_0x786d('0xb')]=_[_0x786d('0xc')](config[_0x786d('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x786d('0xd'))(new Redis(config[_0x786d('0xb')]));require('./dashboard.socket')[_0x786d('0xe')](socket);function respondWithRpcPromise(_0x4da57f,_0x3a018a,_0x164726){return new BPromise(function(_0x395cea,_0x4df596){return client[_0x786d('0xf')](_0x4da57f,_0x164726)[_0x786d('0x10')](function(_0x2b39bb){logger[_0x786d('0x11')]('Dashboard,\x20%s,\x20%s',_0x3a018a,_0x786d('0x12'));logger[_0x786d('0x13')](_0x786d('0x14'),_0x3a018a,_0x786d('0x12'),JSON['stringify'](_0x2b39bb));if(_0x2b39bb['error']){if(_0x2b39bb[_0x786d('0x15')][_0x786d('0x16')]===0x1f4){logger[_0x786d('0x15')](_0x786d('0x17'),_0x3a018a,_0x2b39bb[_0x786d('0x15')]['message']);return _0x4df596(_0x2b39bb[_0x786d('0x15')]['message']);}logger['error'](_0x786d('0x17'),_0x3a018a,_0x2b39bb[_0x786d('0x15')][_0x786d('0x18')]);return _0x395cea(_0x2b39bb[_0x786d('0x15')]['message']);}else{logger[_0x786d('0x11')]('Dashboard,\x20%s,\x20%s',_0x3a018a,'request\x20sent');_0x395cea(_0x2b39bb[_0x786d('0x19')][_0x786d('0x18')]);}})[_0x786d('0x1a')](function(_0x197619){logger[_0x786d('0x15')](_0x786d('0x17'),_0x3a018a,_0x197619);_0x4df596(_0x197619);});});} \ No newline at end of file +var _0x3aeb=['randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','localhost','redis','register','request','info','request\x20sent','code','error','Dashboard,\x20%s,\x20%s','message','result','catch','lodash','util','moment'];(function(_0x1b7368,_0x3286ed){var _0x25d54c=function(_0x2366da){while(--_0x2366da){_0x1b7368['push'](_0x1b7368['shift']());}};_0x25d54c(++_0x3286ed);}(_0x3aeb,0xc3));var _0xb3ae=function(_0x5a8f89,_0x5c5369){_0x5a8f89=_0x5a8f89-0x0;var _0x24dfe6=_0x3aeb[_0x5a8f89];return _0x24dfe6;};'use strict';var _=require(_0xb3ae('0x0'));var util=require(_0xb3ae('0x1'));var moment=require(_0xb3ae('0x2'));var BPromise=require('bluebird');var rs=require(_0xb3ae('0x3'));var fs=require('fs');var Redis=require(_0xb3ae('0x4'));var db=require(_0xb3ae('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb3ae('0x6'))('rpc');var config=require(_0xb3ae('0x7'));var jayson=require(_0xb3ae('0x8'));var client=jayson[_0xb3ae('0x9')]['http']({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0xb3ae('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb3ae('0xb')]));require('./dashboard.socket')[_0xb3ae('0xc')](socket);function respondWithRpcPromise(_0x5a5dfb,_0x9a7ea2,_0x2f55d2){return new BPromise(function(_0x24d2ba,_0x3f37b4){return client[_0xb3ae('0xd')](_0x5a5dfb,_0x2f55d2)['then'](function(_0x14d1cc){logger[_0xb3ae('0xe')]('Dashboard,\x20%s,\x20%s',_0x9a7ea2,_0xb3ae('0xf'));logger['debug']('Dashboard,\x20%s,\x20%s,\x20%s',_0x9a7ea2,'request\x20sent',JSON['stringify'](_0x14d1cc));if(_0x14d1cc['error']){if(_0x14d1cc['error'][_0xb3ae('0x10')]===0x1f4){logger[_0xb3ae('0x11')](_0xb3ae('0x12'),_0x9a7ea2,_0x14d1cc[_0xb3ae('0x11')][_0xb3ae('0x13')]);return _0x3f37b4(_0x14d1cc[_0xb3ae('0x11')][_0xb3ae('0x13')]);}logger[_0xb3ae('0x11')]('Dashboard,\x20%s,\x20%s',_0x9a7ea2,_0x14d1cc[_0xb3ae('0x11')][_0xb3ae('0x13')]);return _0x24d2ba(_0x14d1cc[_0xb3ae('0x11')][_0xb3ae('0x13')]);}else{logger[_0xb3ae('0xe')](_0xb3ae('0x12'),_0x9a7ea2,_0xb3ae('0xf'));_0x24d2ba(_0x14d1cc[_0xb3ae('0x14')][_0xb3ae('0x13')]);}})[_0xb3ae('0x15')](function(_0x104023){logger[_0xb3ae('0x11')](_0xb3ae('0x12'),_0x9a7ea2,_0x104023);_0x3f37b4(_0x104023);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 10a0266..2e677c7 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 _0x6df3=['length','dashboard:','./dashboard.events','save','remove','update','emit'];(function(_0x25b4a4,_0x2e081b){var _0x707267=function(_0x440123){while(--_0x440123){_0x25b4a4['push'](_0x25b4a4['shift']());}};_0x707267(++_0x2e081b);}(_0x6df3,0x160));var _0x36df=function(_0x3dfc56,_0x20bb64){_0x3dfc56=_0x3dfc56-0x0;var _0x5496ed=_0x6df3[_0x3dfc56];return _0x5496ed;};'use strict';var DashboardEvents=require(_0x36df('0x0'));var events=[_0x36df('0x1'),_0x36df('0x2'),_0x36df('0x3')];function createListener(_0x5ec8b4,_0x479dbb){return function(_0x2bc193){_0x479dbb[_0x36df('0x4')](_0x5ec8b4,_0x2bc193);};}function removeListener(_0x314e23,_0x331b0c){return function(){DashboardEvents['removeListener'](_0x314e23,_0x331b0c);};}exports['register']=function(_0x2d7c15){for(var _0x485ecd=0x0,_0x4b872e=events[_0x36df('0x5')];_0x485ecd<_0x4b872e;_0x485ecd++){var _0x430879=events[_0x485ecd];var _0xe75b80=createListener(_0x36df('0x6')+_0x430879,_0x2d7c15);DashboardEvents['on'](_0x430879,_0xe75b80);}}; \ No newline at end of file +var _0x25ed=['save','update','emit','removeListener','register','length','dashboard:','./dashboard.events'];(function(_0x44840a,_0x50b3b0){var _0x100272=function(_0x5f1ab1){while(--_0x5f1ab1){_0x44840a['push'](_0x44840a['shift']());}};_0x100272(++_0x50b3b0);}(_0x25ed,0x18f));var _0xd25e=function(_0x2b9af6,_0x475a9b){_0x2b9af6=_0x2b9af6-0x0;var _0x20ed39=_0x25ed[_0x2b9af6];return _0x20ed39;};'use strict';var DashboardEvents=require(_0xd25e('0x0'));var events=[_0xd25e('0x1'),'remove',_0xd25e('0x2')];function createListener(_0x467476,_0xa73adc){return function(_0x208d48){_0xa73adc[_0xd25e('0x3')](_0x467476,_0x208d48);};}function removeListener(_0x3bf233,_0xa729e2){return function(){DashboardEvents[_0xd25e('0x4')](_0x3bf233,_0xa729e2);};}exports[_0xd25e('0x5')]=function(_0x1fd785){for(var _0x512a3f=0x0,_0x32c65a=events[_0xd25e('0x6')];_0x512a3f<_0x32c65a;_0x512a3f++){var _0x263648=events[_0x512a3f];var _0x4355cb=createListener(_0xd25e('0x7')+_0x263648,_0x1fd785);DashboardEvents['on'](_0x263648,_0x4355cb);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index f28a2ed..62b120b 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 _0x0839=['../../components/interaction/service','../../config/environment','./dashboard.controller','get','isAuthenticated','index','/:id','show','/:id/items','create','/:id/clone','addItem','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x17730a,_0x362127){var _0x485db1=function(_0x144233){while(--_0x144233){_0x17730a['push'](_0x17730a['shift']());}};_0x485db1(++_0x362127);}(_0x0839,0x100));var _0x9083=function(_0x97cd7e,_0x49038d){_0x97cd7e=_0x97cd7e-0x0;var _0x3b95d4=_0x0839[_0x97cd7e];return _0x3b95d4;};'use strict';var multer=require(_0x9083('0x0'));var util=require(_0x9083('0x1'));var path=require(_0x9083('0x2'));var timeout=require(_0x9083('0x3'));var express=require(_0x9083('0x4'));var router=express[_0x9083('0x5')]();var fs_extra=require(_0x9083('0x6'));var auth=require(_0x9083('0x7'));var interaction=require(_0x9083('0x8'));var config=require(_0x9083('0x9'));var controller=require(_0x9083('0xa'));router[_0x9083('0xb')]('/',auth[_0x9083('0xc')](),controller[_0x9083('0xd')]);router['get'](_0x9083('0xe'),auth[_0x9083('0xc')](),controller[_0x9083('0xf')]);router['get'](_0x9083('0x10'),auth[_0x9083('0xc')](),controller['getItems']);router['post']('/',auth['isAuthenticated'](),controller[_0x9083('0x11')]);router['post'](_0x9083('0x12'),auth['isAuthenticated'](),controller['clone']);router['post'](_0x9083('0x10'),auth[_0x9083('0xc')](),controller[_0x9083('0x13')]);router['put'](_0x9083('0xe'),auth[_0x9083('0xc')](),controller[_0x9083('0x14')]);router[_0x9083('0x15')](_0x9083('0xe'),auth[_0x9083('0xc')](),controller[_0x9083('0x16')]);module[_0x9083('0x17')]=router; \ No newline at end of file +var _0x5493=['destroy','exports','multer','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','/:id/items','getItems','post','addItem','put','update','delete'];(function(_0x556927,_0x34b53f){var _0x5f1235=function(_0x4f4e44){while(--_0x4f4e44){_0x556927['push'](_0x556927['shift']());}};_0x5f1235(++_0x34b53f);}(_0x5493,0x106));var _0x3549=function(_0x341894,_0x2feea1){_0x341894=_0x341894-0x0;var _0x4c7fb6=_0x5493[_0x341894];return _0x4c7fb6;};'use strict';var multer=require(_0x3549('0x0'));var util=require('util');var path=require(_0x3549('0x1'));var timeout=require('connect-timeout');var express=require(_0x3549('0x2'));var router=express[_0x3549('0x3')]();var fs_extra=require(_0x3549('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3549('0x5'));var config=require(_0x3549('0x6'));var controller=require('./dashboard.controller');router['get']('/',auth[_0x3549('0x7')](),controller[_0x3549('0x8')]);router[_0x3549('0x9')](_0x3549('0xa'),auth[_0x3549('0x7')](),controller['show']);router['get'](_0x3549('0xb'),auth[_0x3549('0x7')](),controller[_0x3549('0xc')]);router[_0x3549('0xd')]('/',auth[_0x3549('0x7')](),controller['create']);router['post']('/:id/clone',auth[_0x3549('0x7')](),controller['clone']);router[_0x3549('0xd')](_0x3549('0xb'),auth[_0x3549('0x7')](),controller[_0x3549('0xe')]);router[_0x3549('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x3549('0x10')]);router[_0x3549('0x11')](_0x3549('0xa'),auth[_0x3549('0x7')](),controller[_0x3549('0x12')]);module[_0x3549('0x13')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index bb2b3fd..0d4911e 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 _0x3f8a=['parse','getDataValue','attrs','setDataValue','stringify','INTEGER','#ffffff','sequelize','squel','lodash','exports','STRING','TEXT','long'];(function(_0x3fc31d,_0x432bc9){var _0x31bb91=function(_0x1c1640){while(--_0x1c1640){_0x3fc31d['push'](_0x3fc31d['shift']());}};_0x31bb91(++_0x432bc9);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x264b91,_0x9c8a83){_0x264b91=_0x264b91-0x0;var _0x5c562d=_0x3f8a[_0x264b91];return _0x5c562d;};'use strict';var Sequelize=require(_0xa3f8('0x0'));var squel=require(_0xa3f8('0x1'));var _=require(_0xa3f8('0x2'));module[_0xa3f8('0x3')]={'title':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xa3f8('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0xa3f8('0x5')](_0xa3f8('0x6')),'get':function(){try{return JSON[_0xa3f8('0x7')](this[_0xa3f8('0x8')](_0xa3f8('0x9')));}catch(_0x39d2e4){return[];}},'set':function(_0x471464){try{this[_0xa3f8('0xa')](_0xa3f8('0x9'),JSON[_0xa3f8('0xb')](_0x471464));}catch(_0x268332){this[_0xa3f8('0xa')](_0xa3f8('0x9'),JSON[_0xa3f8('0xb')]([]));}}},'sizeX':{'type':Sequelize[_0xa3f8('0xc')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xa3f8('0xc')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize['INTEGER']},'col':{'type':Sequelize[_0xa3f8('0xc')]},'background':{'type':Sequelize[_0xa3f8('0x4')],'allowNull':![],'defaultValue':_0xa3f8('0xd'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xa3f8('0x4')],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0xa3f8('0x4')]},'titleFontSize':{'type':Sequelize[_0xa3f8('0xc')],'defaultValue':0xc}}; \ No newline at end of file +var _0xeff8=['sequelize','squel','exports','STRING','long','parse','getDataValue','attrs','setDataValue','stringify','INTEGER','#ffffff','#2196f3'];(function(_0x34c49d,_0x31ee2d){var _0x837d50=function(_0x2e5cb3){while(--_0x2e5cb3){_0x34c49d['push'](_0x34c49d['shift']());}};_0x837d50(++_0x31ee2d);}(_0xeff8,0x186));var _0x8eff=function(_0x4914e2,_0x48be8f){_0x4914e2=_0x4914e2-0x0;var _0x2dcd07=_0xeff8[_0x4914e2];return _0x2dcd07;};'use strict';var Sequelize=require(_0x8eff('0x0'));var squel=require(_0x8eff('0x1'));var _=require('lodash');module[_0x8eff('0x2')]={'title':{'type':Sequelize[_0x8eff('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x8eff('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT'](_0x8eff('0x4')),'get':function(){try{return JSON[_0x8eff('0x5')](this[_0x8eff('0x6')](_0x8eff('0x7')));}catch(_0x4ac51c){return[];}},'set':function(_0x469641){try{this[_0x8eff('0x8')](_0x8eff('0x7'),JSON[_0x8eff('0x9')](_0x469641));}catch(_0x491f01){this[_0x8eff('0x8')](_0x8eff('0x7'),JSON[_0x8eff('0x9')]([]));}}},'sizeX':{'type':Sequelize[_0x8eff('0xa')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize['INTEGER']},'col':{'type':Sequelize[_0x8eff('0xa')]},'background':{'type':Sequelize[_0x8eff('0x3')],'allowNull':![],'defaultValue':_0x8eff('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x8eff('0xc'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x8eff('0x3')]},'titleFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index 295dc89..cd977ce 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 _0x711b=['limit','count','status','set','reject','save','then','destroy','stack','name','model','keys','DashboardItem','rawAttributes','query','intersection','attributes','fields','length','include','merge','options','find','catch','params','type','attrs','https://','custom','attrPath','value','HH:mm:ss','attrTimezone','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','error','stringify','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','sendStatus','json','offset','undefined'];(function(_0x45cd30,_0x4933cb){var _0x44fc2d=function(_0x25f41f){while(--_0x25f41f){_0x45cd30['push'](_0x45cd30['shift']());}};_0x44fc2d(++_0x4933cb);}(_0x711b,0x13e));var _0xb711=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x711b[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xb711('0x0'));var rimraf=require(_0xb711('0x1'));var zipdir=require(_0xb711('0x2'));var jsonpatch=require(_0xb711('0x3'));var rp=require(_0xb711('0x4'));var moment=require(_0xb711('0x5'));var BPromise=require(_0xb711('0x6'));var Mustache=require(_0xb711('0x7'));var util=require(_0xb711('0x8'));var path=require(_0xb711('0x9'));var sox=require(_0xb711('0xa'));var csv=require(_0xb711('0xb'));var ejs=require(_0xb711('0xc'));var fs=require('fs');var fs_extra=require(_0xb711('0xd'));var _=require(_0xb711('0xe'));var squel=require(_0xb711('0xf'));var crypto=require(_0xb711('0x10'));var jsforce=require(_0xb711('0x11'));var deskjs=require(_0xb711('0x12'));var toCsv=require(_0xb711('0xb'));var querystring=require(_0xb711('0x13'));var Papa=require('papaparse');var Redis=require(_0xb711('0x14'));var authService=require(_0xb711('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0xb711('0x16'));var hardwareService=require(_0xb711('0x17'));var logger=require('../../config/logger')(_0xb711('0x18'));var utils=require(_0xb711('0x19'));var config=require(_0xb711('0x1a'));var licenseUtil=require(_0xb711('0x1b'));var db=require('../../mysqldb')['db'];config[_0xb711('0x1c')]=_[_0xb711('0x1d')](config['redis'],{'host':_0xb711('0x1e'),'port':0x18eb});var socket=require(_0xb711('0x1f'))(new Redis(config[_0xb711('0x1c')]));require(_0xb711('0x20'))[_0xb711('0x21')](socket);function respondWithStatusCode(_0x4812be,_0x24c7ef){_0x24c7ef=_0x24c7ef||0xcc;return function(_0x4a4966){if(_0x4a4966){return _0x4812be[_0xb711('0x22')](_0x24c7ef);}return _0x4812be['status'](_0x24c7ef)['end']();};}function respondWithResult(_0x5d83b9,_0x31e232){_0x31e232=_0x31e232||0xc8;return function(_0x38a519){if(_0x38a519){return _0x5d83b9['status'](_0x31e232)[_0xb711('0x23')](_0x38a519);}};}function respondWithFilteredResult(_0x3af09a,_0x56abef){return function(_0x522904){if(_0x522904){var _0x5dd815=typeof _0x56abef[_0xb711('0x24')]===_0xb711('0x25')&&typeof _0x56abef[_0xb711('0x26')]==='undefined';var _0x2b07e5=_0x522904[_0xb711('0x27')];var _0x1d3582=_0x5dd815?0x0:_0x56abef[_0xb711('0x24')];var _0x35f515=_0x5dd815?_0x522904['count']:_0x56abef[_0xb711('0x24')]+_0x56abef[_0xb711('0x26')];var _0x3c6a06;if(_0x35f515>=_0x2b07e5){_0x35f515=_0x2b07e5;_0x3c6a06=0xc8;}else{_0x3c6a06=0xce;}_0x3af09a[_0xb711('0x28')](_0x3c6a06);return _0x3af09a[_0xb711('0x29')]('Content-Range',_0x1d3582+'-'+_0x35f515+'/'+_0x2b07e5)[_0xb711('0x23')](_0x522904);}return null;};}function patchUpdates(_0x2c6331){return function(_0x41bcc3){try{jsonpatch['apply'](_0x41bcc3,_0x2c6331,!![]);}catch(_0x1b1331){return BPromise[_0xb711('0x2a')](_0x1b1331);}return _0x41bcc3[_0xb711('0x2b')]();};}function saveUpdates(_0x16146e,_0x4ea289){return function(_0x576ebb){if(_0x576ebb){return _0x576ebb['update'](_0x16146e)[_0xb711('0x2c')](function(_0x204d3f){return _0x204d3f;});}return null;};}function removeEntity(_0x391307,_0x3aa55c){return function(_0x601f35){if(_0x601f35){return _0x601f35[_0xb711('0x2d')]()[_0xb711('0x2c')](function(){_0x391307[_0xb711('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x41330c,_0x4a323a){return function(_0x2165b5){if(!_0x2165b5){_0x41330c[_0xb711('0x22')](0x194);}return _0x2165b5;};}function handleError(_0x2b2646,_0xe21f7c){_0xe21f7c=_0xe21f7c||0x1f4;return function(_0xbb5cba){logger['error'](_0xbb5cba[_0xb711('0x2e')]);if(_0xbb5cba[_0xb711('0x2f')]){delete _0xbb5cba['name'];}_0x2b2646[_0xb711('0x28')](_0xe21f7c)['send'](_0xbb5cba);};}exports['show']=function(_0x75544e,_0x2c9a57){var _0x56c64c={'raw':![],'where':{'id':_0x75544e['params']['id']}},_0x56e53a={};_0x56e53a[_0xb711('0x30')]=_[_0xb711('0x31')](db[_0xb711('0x32')][_0xb711('0x33')]);_0x56e53a[_0xb711('0x34')]=_[_0xb711('0x31')](_0x75544e['query']);_0x56e53a['filters']=_[_0xb711('0x35')](_0x56e53a[_0xb711('0x30')],_0x56e53a[_0xb711('0x34')]);_0x56c64c[_0xb711('0x36')]=_['intersection'](_0x56e53a[_0xb711('0x30')],qs[_0xb711('0x37')](_0x75544e[_0xb711('0x34')]['fields']));_0x56c64c[_0xb711('0x36')]=_0x56c64c[_0xb711('0x36')][_0xb711('0x38')]?_0x56c64c[_0xb711('0x36')]:_0x56e53a[_0xb711('0x30')];if(_0x75544e[_0xb711('0x34')]['includeAll']){_0x56c64c[_0xb711('0x39')]=[{'all':!![]}];}_0x56c64c=_[_0xb711('0x3a')]({},_0x56c64c,_0x75544e[_0xb711('0x3b')]);return db[_0xb711('0x32')][_0xb711('0x3c')](_0x56c64c)[_0xb711('0x2c')](handleEntityNotFound(_0x2c9a57,null))[_0xb711('0x2c')](respondWithResult(_0x2c9a57,null))[_0xb711('0x3d')](handleError(_0x2c9a57,null));};exports['destroy']=function(_0x1b4f8f,_0x2f6fee){return db[_0xb711('0x32')][_0xb711('0x3c')]({'where':{'id':_0x1b4f8f[_0xb711('0x3e')]['id']}})[_0xb711('0x2c')](handleEntityNotFound(_0x2f6fee,null))[_0xb711('0x2c')](removeEntity(_0x2f6fee,null))['catch'](handleError(_0x2f6fee,null));};function widgetAttributes(_0x27c2fb){try{switch(_0x27c2fb[_0xb711('0x3f')]){case'iframe':return[{'name':'attrUrl','value':_0x27c2fb['attrUrl']||(_0x27c2fb['attrs']&&_0x27c2fb[_0xb711('0x40')][0x0]?_0x27c2fb[_0xb711('0x40')][0x0]['value']:undefined)||_0xb711('0x41')}];case _0xb711('0x42'):return[{'name':_0xb711('0x43'),'value':_0x27c2fb[_0xb711('0x43')]||(_0x27c2fb[_0xb711('0x40')]&&_0x27c2fb[_0xb711('0x40')][0x0]?_0x27c2fb[_0xb711('0x40')][0x0][_0xb711('0x44')]:undefined)||''}];case'clock':return[{'name':'attrHourFormat','value':_0x27c2fb['attrHourFormat']||(_0x27c2fb[_0xb711('0x40')]&&_0x27c2fb['attrs'][0x0]?_0x27c2fb[_0xb711('0x40')][0x0][_0xb711('0x44')]:undefined)||_0xb711('0x45')},{'name':_0xb711('0x46'),'value':_0x27c2fb[_0xb711('0x46')]||(_0x27c2fb['attrs']&&_0x27c2fb['attrs'][0x1]?_0x27c2fb[_0xb711('0x40')][0x1]['value']:undefined)||'0.00'},{'name':_0xb711('0x47'),'value':_0x27c2fb[_0xb711('0x47')]||(_0x27c2fb[_0xb711('0x40')]&&_0x27c2fb[_0xb711('0x40')][0x2]?_0x27c2fb[_0xb711('0x40')][0x2][_0xb711('0x44')]:undefined)||0xc}];case _0xb711('0x48'):return[{'name':'attrMetric','value':_0x27c2fb[_0xb711('0x49')]||(_0x27c2fb[_0xb711('0x40')]&&_0x27c2fb[_0xb711('0x40')][0x0]?_0x27c2fb[_0xb711('0x40')][0x0]['value']:undefined)||_0xb711('0x4a')},{'name':_0xb711('0x4b'),'value':_0x27c2fb[_0xb711('0x4b')]||(_0x27c2fb[_0xb711('0x40')]&&_0x27c2fb[_0xb711('0x40')][0x1]?_0x27c2fb[_0xb711('0x40')][0x1][_0xb711('0x44')]:undefined)||[]},{'name':_0xb711('0x47'),'value':_0x27c2fb[_0xb711('0x47')]||(_0x27c2fb[_0xb711('0x40')]&&_0x27c2fb['attrs'][0x2]?_0x27c2fb[_0xb711('0x40')][0x2][_0xb711('0x44')]:undefined)||0x14}];case _0xb711('0x4c'):case _0xb711('0x4d'):return[{'name':_0xb711('0x4e'),'value':_0x27c2fb[_0xb711('0x4e')]||(_0x27c2fb[_0xb711('0x40')]&&_0x27c2fb[_0xb711('0x40')][0x0]?_0x27c2fb['attrs'][0x0][_0xb711('0x44')]:undefined)||_0xb711('0x4a')},{'name':_0xb711('0x4f'),'value':_0x27c2fb[_0xb711('0x4f')]||(_0x27c2fb[_0xb711('0x40')]&&_0x27c2fb[_0xb711('0x40')][0x1]?_0x27c2fb['attrs'][0x1][_0xb711('0x44')]:undefined)||null},{'name':_0xb711('0x50'),'value':_0x27c2fb['attrSerie3']||(_0x27c2fb[_0xb711('0x40')]&&_0x27c2fb[_0xb711('0x40')][0x2]?_0x27c2fb['attrs'][0x2][_0xb711('0x44')]:undefined)||null},{'name':_0xb711('0x4b'),'value':_0x27c2fb[_0xb711('0x4b')]||(_0x27c2fb['attrs']&&_0x27c2fb[_0xb711('0x40')][0x3]?_0x27c2fb[_0xb711('0x40')][0x3][_0xb711('0x44')]:undefined)||[]}];case _0xb711('0x51'):return[{'name':_0xb711('0x52'),'type':_0x27c2fb[_0xb711('0x53')]||(_0x27c2fb[_0xb711('0x40')]&&_0x27c2fb[_0xb711('0x40')][0x0]?_0x27c2fb[_0xb711('0x40')][0x0]['type']:undefined)||null,'value':_0x27c2fb['attrReport']||(_0x27c2fb['attrs']&&_0x27c2fb['attrs'][0x0]?_0x27c2fb[_0xb711('0x40')][0x0][_0xb711('0x44')]:undefined)||null},{'name':'attrRefresh','value':_0x27c2fb[_0xb711('0x54')]||(_0x27c2fb['attrs']&&_0x27c2fb[_0xb711('0x40')][0x1]?_0x27c2fb[_0xb711('0x40')][0x1][_0xb711('0x44')]:undefined)||0x0}];default:return[];}}catch(_0x375b97){logger[_0xb711('0x55')]('widgetAttributes:\x20%s',JSON[_0xb711('0x56')](_0x375b97));return[];}}exports[_0xb711('0x57')]=function(_0x5d23a7,_0xf55f62){if(_0x5d23a7[_0xb711('0x58')]){_0x5d23a7[_0xb711('0x58')][_0xb711('0x40')]=widgetAttributes(_0x5d23a7['body']);}return db[_0xb711('0x32')][_0xb711('0x57')](_0x5d23a7[_0xb711('0x58')],{})[_0xb711('0x2c')](respondWithResult(_0xf55f62,0xc9))['catch'](handleError(_0xf55f62,null));};exports['update']=function(_0x305870,_0x5964e5){if(_0x305870[_0xb711('0x58')]['id']){delete _0x305870['body']['id'];}_0x305870[_0xb711('0x58')]['attrs']=widgetAttributes(_0x305870[_0xb711('0x58')]);return db['DashboardItem'][_0xb711('0x3c')]({'where':{'id':_0x305870['params']['id']}})['then'](handleEntityNotFound(_0x5964e5,null))[_0xb711('0x2c')](saveUpdates(_0x305870[_0xb711('0x58')],null))[_0xb711('0x2c')](respondWithResult(_0x5964e5,null))[_0xb711('0x3d')](handleError(_0x5964e5,null));}; \ No newline at end of file +var _0x2cc1=['../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','then','destroy','error','stack','name','send','show','params','model','keys','DashboardItem','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','catch','type','iframe','attrUrl','attrs','https://','custom','attrPath','clock','attrHourFormat','value','HH:mm:ss','0.00','attrFontSize','attrMetric','total','attrVoiceQueues','multibar-chart','attrSerie1','attrSerie2','attrSerie3','web-report','reportType','attrReport','attrRefresh','stringify','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x2cc1,0x1bd));var _0x12cc=function(_0x4f2d17,_0x13156c){_0x4f2d17=_0x4f2d17-0x0;var _0x277b0d=_0x2cc1[_0x4f2d17];return _0x277b0d;};'use strict';var emlformat=require(_0x12cc('0x0'));var rimraf=require(_0x12cc('0x1'));var zipdir=require(_0x12cc('0x2'));var jsonpatch=require(_0x12cc('0x3'));var rp=require(_0x12cc('0x4'));var moment=require(_0x12cc('0x5'));var BPromise=require(_0x12cc('0x6'));var Mustache=require(_0x12cc('0x7'));var util=require('util');var path=require('path');var sox=require(_0x12cc('0x8'));var csv=require(_0x12cc('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x12cc('0xa'));var squel=require(_0x12cc('0xb'));var crypto=require(_0x12cc('0xc'));var jsforce=require(_0x12cc('0xd'));var deskjs=require(_0x12cc('0xe'));var toCsv=require(_0x12cc('0x9'));var querystring=require(_0x12cc('0xf'));var Papa=require(_0x12cc('0x10'));var Redis=require(_0x12cc('0x11'));var authService=require(_0x12cc('0x12'));var qs=require(_0x12cc('0x13'));var as=require(_0x12cc('0x14'));var hardwareService=require(_0x12cc('0x15'));var logger=require('../../config/logger')(_0x12cc('0x16'));var utils=require('../../config/utils');var config=require(_0x12cc('0x17'));var licenseUtil=require(_0x12cc('0x18'));var db=require(_0x12cc('0x19'))['db'];config[_0x12cc('0x1a')]=_[_0x12cc('0x1b')](config[_0x12cc('0x1a')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x12cc('0x1a')]));require('./dashboardItem.socket')[_0x12cc('0x1c')](socket);function respondWithStatusCode(_0x57f008,_0x3451b5){_0x3451b5=_0x3451b5||0xcc;return function(_0xcc08c2){if(_0xcc08c2){return _0x57f008[_0x12cc('0x1d')](_0x3451b5);}return _0x57f008[_0x12cc('0x1e')](_0x3451b5)[_0x12cc('0x1f')]();};}function respondWithResult(_0x33753a,_0x511857){_0x511857=_0x511857||0xc8;return function(_0x47fa45){if(_0x47fa45){return _0x33753a[_0x12cc('0x1e')](_0x511857)['json'](_0x47fa45);}};}function respondWithFilteredResult(_0x16a709,_0x28134a){return function(_0x1ad81f){if(_0x1ad81f){var _0x33db40=typeof _0x28134a[_0x12cc('0x20')]===_0x12cc('0x21')&&typeof _0x28134a[_0x12cc('0x22')]===_0x12cc('0x21');var _0x3064d5=_0x1ad81f['count'];var _0x4deea0=_0x33db40?0x0:_0x28134a['offset'];var _0x450e54=_0x33db40?_0x1ad81f[_0x12cc('0x23')]:_0x28134a[_0x12cc('0x20')]+_0x28134a[_0x12cc('0x22')];var _0x23825f;if(_0x450e54>=_0x3064d5){_0x450e54=_0x3064d5;_0x23825f=0xc8;}else{_0x23825f=0xce;}_0x16a709[_0x12cc('0x1e')](_0x23825f);return _0x16a709[_0x12cc('0x24')](_0x12cc('0x25'),_0x4deea0+'-'+_0x450e54+'/'+_0x3064d5)[_0x12cc('0x26')](_0x1ad81f);}return null;};}function patchUpdates(_0x5c1fdf){return function(_0x3358a2){try{jsonpatch['apply'](_0x3358a2,_0x5c1fdf,!![]);}catch(_0x333e16){return BPromise[_0x12cc('0x27')](_0x333e16);}return _0x3358a2[_0x12cc('0x28')]();};}function saveUpdates(_0x2f5aab,_0x797a61){return function(_0x5170ec){if(_0x5170ec){return _0x5170ec['update'](_0x2f5aab)[_0x12cc('0x29')](function(_0x5ab109){return _0x5ab109;});}return null;};}function removeEntity(_0x3769b2,_0x11d4bc){return function(_0x1fb084){if(_0x1fb084){return _0x1fb084[_0x12cc('0x2a')]()[_0x12cc('0x29')](function(){_0x3769b2[_0x12cc('0x1e')](0xcc)[_0x12cc('0x1f')]();});}};}function handleEntityNotFound(_0x17a66b,_0x12c139){return function(_0x180cfe){if(!_0x180cfe){_0x17a66b[_0x12cc('0x1d')](0x194);}return _0x180cfe;};}function handleError(_0x102654,_0x420222){_0x420222=_0x420222||0x1f4;return function(_0x435a28){logger[_0x12cc('0x2b')](_0x435a28[_0x12cc('0x2c')]);if(_0x435a28['name']){delete _0x435a28[_0x12cc('0x2d')];}_0x102654[_0x12cc('0x1e')](_0x420222)[_0x12cc('0x2e')](_0x435a28);};}exports[_0x12cc('0x2f')]=function(_0x45fd2b,_0x3acd5c){var _0x363041={'raw':![],'where':{'id':_0x45fd2b[_0x12cc('0x30')]['id']}},_0x58ecda={};_0x58ecda[_0x12cc('0x31')]=_[_0x12cc('0x32')](db[_0x12cc('0x33')][_0x12cc('0x34')]);_0x58ecda['query']=_[_0x12cc('0x32')](_0x45fd2b[_0x12cc('0x35')]);_0x58ecda[_0x12cc('0x36')]=_[_0x12cc('0x37')](_0x58ecda[_0x12cc('0x31')],_0x58ecda[_0x12cc('0x35')]);_0x363041[_0x12cc('0x38')]=_[_0x12cc('0x37')](_0x58ecda[_0x12cc('0x31')],qs[_0x12cc('0x39')](_0x45fd2b[_0x12cc('0x35')][_0x12cc('0x39')]));_0x363041[_0x12cc('0x38')]=_0x363041[_0x12cc('0x38')][_0x12cc('0x3a')]?_0x363041['attributes']:_0x58ecda[_0x12cc('0x31')];if(_0x45fd2b[_0x12cc('0x35')][_0x12cc('0x3b')]){_0x363041[_0x12cc('0x3c')]=[{'all':!![]}];}_0x363041=_[_0x12cc('0x3d')]({},_0x363041,_0x45fd2b[_0x12cc('0x3e')]);return db['DashboardItem'][_0x12cc('0x3f')](_0x363041)[_0x12cc('0x29')](handleEntityNotFound(_0x3acd5c,null))[_0x12cc('0x29')](respondWithResult(_0x3acd5c,null))['catch'](handleError(_0x3acd5c,null));};exports[_0x12cc('0x2a')]=function(_0x30ddb9,_0x1f6aba){return db[_0x12cc('0x33')][_0x12cc('0x3f')]({'where':{'id':_0x30ddb9['params']['id']}})[_0x12cc('0x29')](handleEntityNotFound(_0x1f6aba,null))[_0x12cc('0x29')](removeEntity(_0x1f6aba,null))[_0x12cc('0x40')](handleError(_0x1f6aba,null));};function widgetAttributes(_0x1c17f8){try{switch(_0x1c17f8[_0x12cc('0x41')]){case _0x12cc('0x42'):return[{'name':_0x12cc('0x43'),'value':_0x1c17f8[_0x12cc('0x43')]||(_0x1c17f8[_0x12cc('0x44')]&&_0x1c17f8[_0x12cc('0x44')][0x0]?_0x1c17f8[_0x12cc('0x44')][0x0]['value']:undefined)||_0x12cc('0x45')}];case _0x12cc('0x46'):return[{'name':_0x12cc('0x47'),'value':_0x1c17f8[_0x12cc('0x47')]||(_0x1c17f8[_0x12cc('0x44')]&&_0x1c17f8['attrs'][0x0]?_0x1c17f8[_0x12cc('0x44')][0x0]['value']:undefined)||''}];case _0x12cc('0x48'):return[{'name':_0x12cc('0x49'),'value':_0x1c17f8[_0x12cc('0x49')]||(_0x1c17f8[_0x12cc('0x44')]&&_0x1c17f8[_0x12cc('0x44')][0x0]?_0x1c17f8[_0x12cc('0x44')][0x0][_0x12cc('0x4a')]:undefined)||_0x12cc('0x4b')},{'name':'attrTimezone','value':_0x1c17f8['attrTimezone']||(_0x1c17f8['attrs']&&_0x1c17f8['attrs'][0x1]?_0x1c17f8[_0x12cc('0x44')][0x1][_0x12cc('0x4a')]:undefined)||_0x12cc('0x4c')},{'name':_0x12cc('0x4d'),'value':_0x1c17f8[_0x12cc('0x4d')]||(_0x1c17f8[_0x12cc('0x44')]&&_0x1c17f8[_0x12cc('0x44')][0x2]?_0x1c17f8[_0x12cc('0x44')][0x2][_0x12cc('0x4a')]:undefined)||0xc}];case'counter':return[{'name':_0x12cc('0x4e'),'value':_0x1c17f8[_0x12cc('0x4e')]||(_0x1c17f8[_0x12cc('0x44')]&&_0x1c17f8[_0x12cc('0x44')][0x0]?_0x1c17f8['attrs'][0x0]['value']:undefined)||_0x12cc('0x4f')},{'name':_0x12cc('0x50'),'value':_0x1c17f8[_0x12cc('0x50')]||(_0x1c17f8[_0x12cc('0x44')]&&_0x1c17f8[_0x12cc('0x44')][0x1]?_0x1c17f8[_0x12cc('0x44')][0x1][_0x12cc('0x4a')]:undefined)||[]},{'name':_0x12cc('0x4d'),'value':_0x1c17f8[_0x12cc('0x4d')]||(_0x1c17f8['attrs']&&_0x1c17f8[_0x12cc('0x44')][0x2]?_0x1c17f8[_0x12cc('0x44')][0x2]['value']:undefined)||0x14}];case _0x12cc('0x51'):case'pie-chart':return[{'name':_0x12cc('0x52'),'value':_0x1c17f8[_0x12cc('0x52')]||(_0x1c17f8['attrs']&&_0x1c17f8[_0x12cc('0x44')][0x0]?_0x1c17f8['attrs'][0x0][_0x12cc('0x4a')]:undefined)||'total'},{'name':_0x12cc('0x53'),'value':_0x1c17f8['attrSerie2']||(_0x1c17f8[_0x12cc('0x44')]&&_0x1c17f8[_0x12cc('0x44')][0x1]?_0x1c17f8['attrs'][0x1][_0x12cc('0x4a')]:undefined)||null},{'name':_0x12cc('0x54'),'value':_0x1c17f8[_0x12cc('0x54')]||(_0x1c17f8[_0x12cc('0x44')]&&_0x1c17f8[_0x12cc('0x44')][0x2]?_0x1c17f8[_0x12cc('0x44')][0x2][_0x12cc('0x4a')]:undefined)||null},{'name':_0x12cc('0x50'),'value':_0x1c17f8[_0x12cc('0x50')]||(_0x1c17f8[_0x12cc('0x44')]&&_0x1c17f8['attrs'][0x3]?_0x1c17f8[_0x12cc('0x44')][0x3]['value']:undefined)||[]}];case _0x12cc('0x55'):return[{'name':'attrReport','type':_0x1c17f8[_0x12cc('0x56')]||(_0x1c17f8[_0x12cc('0x44')]&&_0x1c17f8[_0x12cc('0x44')][0x0]?_0x1c17f8[_0x12cc('0x44')][0x0][_0x12cc('0x41')]:undefined)||null,'value':_0x1c17f8[_0x12cc('0x57')]||(_0x1c17f8[_0x12cc('0x44')]&&_0x1c17f8[_0x12cc('0x44')][0x0]?_0x1c17f8[_0x12cc('0x44')][0x0][_0x12cc('0x4a')]:undefined)||null},{'name':_0x12cc('0x58'),'value':_0x1c17f8[_0x12cc('0x58')]||(_0x1c17f8[_0x12cc('0x44')]&&_0x1c17f8[_0x12cc('0x44')][0x1]?_0x1c17f8['attrs'][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x31273b){logger[_0x12cc('0x2b')]('widgetAttributes:\x20%s',JSON[_0x12cc('0x59')](_0x31273b));return[];}}exports[_0x12cc('0x5a')]=function(_0x2a9239,_0x373c62){if(_0x2a9239[_0x12cc('0x5b')]){_0x2a9239[_0x12cc('0x5b')][_0x12cc('0x44')]=widgetAttributes(_0x2a9239[_0x12cc('0x5b')]);}return db[_0x12cc('0x33')][_0x12cc('0x5a')](_0x2a9239[_0x12cc('0x5b')],{})[_0x12cc('0x29')](respondWithResult(_0x373c62,0xc9))[_0x12cc('0x40')](handleError(_0x373c62,null));};exports[_0x12cc('0x5c')]=function(_0x4347f1,_0x61cd9){if(_0x4347f1[_0x12cc('0x5b')]['id']){delete _0x4347f1[_0x12cc('0x5b')]['id'];}_0x4347f1['body'][_0x12cc('0x44')]=widgetAttributes(_0x4347f1[_0x12cc('0x5b')]);return db[_0x12cc('0x33')][_0x12cc('0x3f')]({'where':{'id':_0x4347f1[_0x12cc('0x30')]['id']}})[_0x12cc('0x29')](handleEntityNotFound(_0x61cd9,null))[_0x12cc('0x29')](saveUpdates(_0x4347f1[_0x12cc('0x5b')],null))[_0x12cc('0x29')](respondWithResult(_0x61cd9,null))[_0x12cc('0x40')](handleError(_0x61cd9,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index a6b1bfb..bf888b2 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 _0xdae1=['DashboardItem','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdae1,0x76));var _0x1dae=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0xdae1[_0x36dfbd];return _0x4ecad9;};'use strict';var EventEmitter=require(_0x1dae('0x0'));var DashboardItem=require(_0x1dae('0x1'))['db'][_0x1dae('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1dae('0x3'),'afterUpdate':_0x1dae('0x4'),'afterDestroy':_0x1dae('0x5')};function emitEvent(_0x2f5f5d){return function(_0x34f6ee,_0x503bc8,_0x487f7f){DashboardItemEvents[_0x1dae('0x6')](_0x2f5f5d+':'+_0x34f6ee['id'],_0x34f6ee);DashboardItemEvents[_0x1dae('0x6')](_0x2f5f5d,_0x34f6ee);_0x487f7f(null);};}for(var e in events){if(events[_0x1dae('0x7')](e)){var event=events[e];DashboardItem[_0x1dae('0x8')](e,emitEvent(event));}}module[_0x1dae('0x9')]=DashboardItemEvents; \ No newline at end of file +var _0xa3bb=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x4b904f,_0x1080fd){var _0x4265c0=function(_0x1e7dcc){while(--_0x1e7dcc){_0x4b904f['push'](_0x4b904f['shift']());}};_0x4265c0(++_0x1080fd);}(_0xa3bb,0xd2));var _0xba3b=function(_0x71650c,_0x3f49d8){_0x71650c=_0x71650c-0x0;var _0x11c3cc=_0xa3bb[_0x71650c];return _0x11c3cc;};'use strict';var EventEmitter=require(_0xba3b('0x0'));var DashboardItem=require(_0xba3b('0x1'))['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xba3b('0x2')](0x0);var events={'afterCreate':_0xba3b('0x3'),'afterUpdate':_0xba3b('0x4'),'afterDestroy':_0xba3b('0x5')};function emitEvent(_0x115155){return function(_0x4b1d5f,_0x32bdad,_0xf4f32f){DashboardItemEvents[_0xba3b('0x6')](_0x115155+':'+_0x4b1d5f['id'],_0x4b1d5f);DashboardItemEvents[_0xba3b('0x6')](_0x115155,_0x4b1d5f);_0xf4f32f(null);};}for(var e in events){if(events[_0xba3b('0x7')](e)){var event=events[e];DashboardItem[_0xba3b('0x8')](e,emitEvent(event));}}module[_0xba3b('0x9')]=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index dfa6fe7..e92569c 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 _0x3178=['./dashboardItem.attributes','exports','define','DashboardItem','dashboard_items','api','bluebird','request-promise','rimraf'];(function(_0x22d7e6,_0xa620e7){var _0x72bc58=function(_0x2c75f6){while(--_0x2c75f6){_0x22d7e6['push'](_0x22d7e6['shift']());}};_0x72bc58(++_0xa620e7);}(_0x3178,0x176));var _0x8317=function(_0x568361,_0x579865){_0x568361=_0x568361-0x0;var _0x2d90a=_0x3178[_0x568361];return _0x2d90a;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x8317('0x0'));var moment=require('moment');var BPromise=require(_0x8317('0x1'));var rp=require(_0x8317('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8317('0x3'));var config=require('../../config/environment');var attributes=require(_0x8317('0x4'));module[_0x8317('0x5')]=function(_0x1677b7,_0x649d81){return _0x1677b7[_0x8317('0x6')](_0x8317('0x7'),attributes,{'tableName':_0x8317('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8507=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./dashboardItem.attributes','exports','dashboard_items'];(function(_0x20d139,_0x419c49){var _0x48fcaa=function(_0x4de841){while(--_0x4de841){_0x20d139['push'](_0x20d139['shift']());}};_0x48fcaa(++_0x419c49);}(_0x8507,0xc0));var _0x7850=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x8507[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x7850('0x0'));var util=require('util');var logger=require(_0x7850('0x1'))(_0x7850('0x2'));var moment=require(_0x7850('0x3'));var BPromise=require(_0x7850('0x4'));var rp=require(_0x7850('0x5'));var fs=require('fs');var path=require(_0x7850('0x6'));var rimraf=require(_0x7850('0x7'));var config=require(_0x7850('0x8'));var attributes=require(_0x7850('0x9'));module[_0x7850('0xa')]=function(_0x2e78bf,_0x3e6a8f){return _0x2e78bf['define']('DashboardItem',attributes,{'tableName':_0x7850('0xb'),'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 97634de..f008edb 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 _0xdcd4=['./dashboardItem.socket','register','request','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter'];(function(_0x38fb0d,_0x52b5db){var _0x30a5d6=function(_0x31eba6){while(--_0x31eba6){_0x38fb0d['push'](_0x38fb0d['shift']());}};_0x30a5d6(++_0x52b5db);}(_0xdcd4,0xcb));var _0x4dcd=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xdcd4[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x4dcd('0x0'));var util=require('util');var moment=require(_0x4dcd('0x1'));var BPromise=require(_0x4dcd('0x2'));var rs=require(_0x4dcd('0x3'));var fs=require('fs');var Redis=require(_0x4dcd('0x4'));var db=require(_0x4dcd('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4dcd('0x6'));var config=require(_0x4dcd('0x7'));var jayson=require(_0x4dcd('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0x4dcd('0x9')]=_[_0x4dcd('0xa')](config[_0x4dcd('0x9')],{'host':_0x4dcd('0xb'),'port':0x18eb});var socket=require(_0x4dcd('0xc'))(new Redis(config[_0x4dcd('0x9')]));require(_0x4dcd('0xd'))[_0x4dcd('0xe')](socket);function respondWithRpcPromise(_0x140504,_0x72691a,_0x43725e){return new BPromise(function(_0xa869d0,_0x238674){return client[_0x4dcd('0xf')](_0x140504,_0x43725e)[_0x4dcd('0x10')](function(_0x415b08){logger[_0x4dcd('0x11')](_0x4dcd('0x12'),_0x72691a,_0x4dcd('0x13'));logger[_0x4dcd('0x14')](_0x4dcd('0x15'),_0x72691a,_0x4dcd('0x13'),JSON[_0x4dcd('0x16')](_0x415b08));if(_0x415b08[_0x4dcd('0x17')]){if(_0x415b08[_0x4dcd('0x17')]['code']===0x1f4){logger[_0x4dcd('0x17')]('DashboardItem,\x20%s,\x20%s',_0x72691a,_0x415b08[_0x4dcd('0x17')][_0x4dcd('0x18')]);return _0x238674(_0x415b08['error'][_0x4dcd('0x18')]);}logger[_0x4dcd('0x17')](_0x4dcd('0x12'),_0x72691a,_0x415b08[_0x4dcd('0x17')][_0x4dcd('0x18')]);return _0xa869d0(_0x415b08[_0x4dcd('0x17')]['message']);}else{logger['info'](_0x4dcd('0x12'),_0x72691a,'request\x20sent');_0xa869d0(_0x415b08[_0x4dcd('0x19')][_0x4dcd('0x18')]);}})[_0x4dcd('0x1a')](function(_0x105833){logger[_0x4dcd('0x17')]('DashboardItem,\x20%s,\x20%s',_0x72691a,_0x105833);_0x238674(_0x105833);});});} \ No newline at end of file +var _0x8fa8=['DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code','DashboardItem,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','redis','localhost','socket.io-emitter','./dashboardItem.socket','register','request','then','info','request\x20sent','debug'];(function(_0x145d5c,_0x30892d){var _0x82e0bb=function(_0x4d2b2d){while(--_0x4d2b2d){_0x145d5c['push'](_0x145d5c['shift']());}};_0x82e0bb(++_0x30892d);}(_0x8fa8,0xe0));var _0x88fa=function(_0x9ed5b5,_0x2652bf){_0x9ed5b5=_0x9ed5b5-0x0;var _0x4f68d1=_0x8fa8[_0x9ed5b5];return _0x4f68d1;};'use strict';var _=require(_0x88fa('0x0'));var util=require('util');var moment=require(_0x88fa('0x1'));var BPromise=require(_0x88fa('0x2'));var rs=require(_0x88fa('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x88fa('0x4'))['db'];var utils=require(_0x88fa('0x5'));var logger=require('../../config/logger')(_0x88fa('0x6'));var config=require('../../config/environment');var jayson=require(_0x88fa('0x7'));var client=jayson[_0x88fa('0x8')]['http']({'port':0x232a});config[_0x88fa('0x9')]=_['defaults'](config[_0x88fa('0x9')],{'host':_0x88fa('0xa'),'port':0x18eb});var socket=require(_0x88fa('0xb'))(new Redis(config[_0x88fa('0x9')]));require(_0x88fa('0xc'))[_0x88fa('0xd')](socket);function respondWithRpcPromise(_0x12c883,_0x5df65,_0x2c47e9){return new BPromise(function(_0x266ef9,_0x3508c8){return client[_0x88fa('0xe')](_0x12c883,_0x2c47e9)[_0x88fa('0xf')](function(_0xc170){logger[_0x88fa('0x10')]('DashboardItem,\x20%s,\x20%s',_0x5df65,_0x88fa('0x11'));logger[_0x88fa('0x12')](_0x88fa('0x13'),_0x5df65,_0x88fa('0x11'),JSON[_0x88fa('0x14')](_0xc170));if(_0xc170['error']){if(_0xc170[_0x88fa('0x15')][_0x88fa('0x16')]===0x1f4){logger[_0x88fa('0x15')](_0x88fa('0x17'),_0x5df65,_0xc170[_0x88fa('0x15')][_0x88fa('0x18')]);return _0x3508c8(_0xc170[_0x88fa('0x15')][_0x88fa('0x18')]);}logger[_0x88fa('0x15')](_0x88fa('0x17'),_0x5df65,_0xc170[_0x88fa('0x15')][_0x88fa('0x18')]);return _0x266ef9(_0xc170[_0x88fa('0x15')]['message']);}else{logger[_0x88fa('0x10')](_0x88fa('0x17'),_0x5df65,_0x88fa('0x11'));_0x266ef9(_0xc170[_0x88fa('0x19')][_0x88fa('0x18')]);}})[_0x88fa('0x1a')](function(_0x2787ba){logger['error']('DashboardItem,\x20%s,\x20%s',_0x5df65,_0x2787ba);_0x3508c8(_0x2787ba);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 5e317ac..bb2984b 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 _0x4245=['emit','removeListener','register','./dashboardItem.events','save','remove','update'];(function(_0x5cd9f1,_0x3848ec){var _0x1035ca=function(_0x3b9773){while(--_0x3b9773){_0x5cd9f1['push'](_0x5cd9f1['shift']());}};_0x1035ca(++_0x3848ec);}(_0x4245,0x199));var _0x5424=function(_0x419dd8,_0x8aaad0){_0x419dd8=_0x419dd8-0x0;var _0x4395dd=_0x4245[_0x419dd8];return _0x4395dd;};'use strict';var DashboardItemEvents=require(_0x5424('0x0'));var events=[_0x5424('0x1'),_0x5424('0x2'),_0x5424('0x3')];function createListener(_0x547399,_0x313012){return function(_0x155dc3){_0x313012[_0x5424('0x4')](_0x547399,_0x155dc3);};}function removeListener(_0x2840d9,_0x122d61){return function(){DashboardItemEvents[_0x5424('0x5')](_0x2840d9,_0x122d61);};}exports[_0x5424('0x6')]=function(_0x241436){for(var _0x2f102e=0x0,_0x9e3b43=events['length'];_0x2f102e<_0x9e3b43;_0x2f102e++){var _0x178709=events[_0x2f102e];var _0x35243e=createListener('dashboardItem:'+_0x178709,_0x241436);DashboardItemEvents['on'](_0x178709,_0x35243e);}}; \ No newline at end of file +var _0x6afb=['length','dashboardItem:','./dashboardItem.events','remove','update','emit'];(function(_0x13e0e8,_0x26d8bb){var _0x4812b7=function(_0x39d9ed){while(--_0x39d9ed){_0x13e0e8['push'](_0x13e0e8['shift']());}};_0x4812b7(++_0x26d8bb);}(_0x6afb,0x7a));var _0xb6af=function(_0x250669,_0xb15e88){_0x250669=_0x250669-0x0;var _0x131447=_0x6afb[_0x250669];return _0x131447;};'use strict';var DashboardItemEvents=require(_0xb6af('0x0'));var events=['save',_0xb6af('0x1'),_0xb6af('0x2')];function createListener(_0x3fc357,_0x918f3b){return function(_0x4362d9){_0x918f3b[_0xb6af('0x3')](_0x3fc357,_0x4362d9);};}function removeListener(_0x1c7699,_0x3ea148){return function(){DashboardItemEvents['removeListener'](_0x1c7699,_0x3ea148);};}exports['register']=function(_0x2ba987){for(var _0x4d8c03=0x0,_0x21f38f=events[_0xb6af('0x4')];_0x4d8c03<_0x21f38f;_0x4d8c03++){var _0x882898=events[_0x4d8c03];var _0x33c889=createListener(_0xb6af('0x5')+_0x882898,_0x2ba987);DashboardItemEvents['on'](_0x882898,_0x33c889);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index 4e05e66..8a5cc10 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 _0xd837=['multer','util','path','express','Router','../../components/auth/service','./dashboardItem.controller','get','isAuthenticated','show','create','put','/:id','update','destroy','exports'];(function(_0x104112,_0x342eb6){var _0x394ab4=function(_0x48db18){while(--_0x48db18){_0x104112['push'](_0x104112['shift']());}};_0x394ab4(++_0x342eb6);}(_0xd837,0xd0));var _0x7d83=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xd837[_0x5ddb1c];return _0x354adc;};'use strict';var multer=require(_0x7d83('0x0'));var util=require(_0x7d83('0x1'));var path=require(_0x7d83('0x2'));var timeout=require('connect-timeout');var express=require(_0x7d83('0x3'));var router=express[_0x7d83('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x7d83('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x7d83('0x6'));router[_0x7d83('0x7')]('/:id',auth[_0x7d83('0x8')](),controller[_0x7d83('0x9')]);router['post']('/',auth['isAuthenticated'](),controller[_0x7d83('0xa')]);router[_0x7d83('0xb')](_0x7d83('0xc'),auth[_0x7d83('0x8')](),controller[_0x7d83('0xd')]);router['delete'](_0x7d83('0xc'),auth[_0x7d83('0x8')](),controller[_0x7d83('0xe')]);module[_0x7d83('0xf')]=router; \ No newline at end of file +var _0x633a=['/:id','show','isAuthenticated','put','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller'];(function(_0x725a4c,_0x102507){var _0x37b2cc=function(_0x505fc9){while(--_0x505fc9){_0x725a4c['push'](_0x725a4c['shift']());}};_0x37b2cc(++_0x102507);}(_0x633a,0x1f3));var _0xa633=function(_0x39931b,_0x2204b6){_0x39931b=_0x39931b-0x0;var _0x5cbd66=_0x633a[_0x39931b];return _0x5cbd66;};'use strict';var multer=require(_0xa633('0x0'));var util=require(_0xa633('0x1'));var path=require(_0xa633('0x2'));var timeout=require(_0xa633('0x3'));var express=require(_0xa633('0x4'));var router=express[_0xa633('0x5')]();var fs_extra=require(_0xa633('0x6'));var auth=require(_0xa633('0x7'));var interaction=require(_0xa633('0x8'));var config=require(_0xa633('0x9'));var controller=require(_0xa633('0xa'));router['get'](_0xa633('0xb'),auth['isAuthenticated'](),controller[_0xa633('0xc')]);router['post']('/',auth[_0xa633('0xd')](),controller['create']);router[_0xa633('0xe')]('/:id',auth[_0xa633('0xd')](),controller['update']);router['delete'](_0xa633('0xb'),auth[_0xa633('0xd')](),controller[_0xa633('0xf')]);module[_0xa633('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 0f0ea01..3ca7423 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 _0x820f=['ENUM','third','first','exports','STRING'];(function(_0x5a89ea,_0x436388){var _0x21193d=function(_0x1a9118){while(--_0x1a9118){_0x5a89ea['push'](_0x5a89ea['shift']());}};_0x21193d(++_0x436388);}(_0x820f,0xd0));var _0xf820=function(_0xd8baf3,_0x238fd0){_0xd8baf3=_0xd8baf3-0x0;var _0x492838=_0x820f[_0xd8baf3];return _0x492838;};'use strict';var Sequelize=require('sequelize');module[_0xf820('0x0')]={'name':{'type':Sequelize[_0xf820('0x1')],'allowNull':![]},'level':{'type':Sequelize[_0xf820('0x2')]('first','second',_0xf820('0x3')),'allowNull':![],'defaultValue':_0xf820('0x4')},'description':{'type':Sequelize[_0xf820('0x1')]}}; \ No newline at end of file +var _0x2807=['sequelize','exports','STRING','ENUM','first','second','third'];(function(_0x11f0f8,_0x8dd421){var _0x2cd5e6=function(_0x4b428b){while(--_0x4b428b){_0x11f0f8['push'](_0x11f0f8['shift']());}};_0x2cd5e6(++_0x8dd421);}(_0x2807,0x19d));var _0x7280=function(_0x289549,_0x50a556){_0x289549=_0x289549-0x0;var _0x45ce94=_0x2807[_0x289549];return _0x45ce94;};'use strict';var Sequelize=require(_0x7280('0x0'));module[_0x7280('0x1')]={'name':{'type':Sequelize[_0x7280('0x2')],'allowNull':![]},'level':{'type':Sequelize[_0x7280('0x3')](_0x7280('0x4'),_0x7280('0x5'),_0x7280('0x6')),'allowNull':![],'defaultValue':'first'},'description':{'type':Sequelize[_0x7280('0x2')]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index 78344d8..c44849d 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 _0x0514=['model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','zip-dir','fast-json-patch','moment','bluebird','path','sox','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','status','json','offset','limit','count','apply','reject','save','update','then','destroy','get','Dispositions','sendStatus','error','name','send','index','map','Disposition','fieldName','type','key'];(function(_0x3c6310,_0x13601d){var _0x320122=function(_0x596176){while(--_0x596176){_0x3c6310['push'](_0x3c6310['shift']());}};_0x320122(++_0x13601d);}(_0x0514,0x1f0));var _0x4051=function(_0x780dfc,_0x164874){_0x780dfc=_0x780dfc-0x0;var _0x496fd7=_0x0514[_0x780dfc];return _0x496fd7;};'use strict';var emlformat=require(_0x4051('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4051('0x1'));var jsonpatch=require(_0x4051('0x2'));var rp=require('request-promise');var moment=require(_0x4051('0x3'));var BPromise=require(_0x4051('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x4051('0x5'));var sox=require(_0x4051('0x6'));var csv=require(_0x4051('0x7'));var ejs=require(_0x4051('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x4051('0x9'));var crypto=require(_0x4051('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x4051('0xb'));var toCsv=require('to-csv');var querystring=require(_0x4051('0xc'));var Papa=require(_0x4051('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x4051('0xe'));var as=require(_0x4051('0xf'));var hardwareService=require(_0x4051('0x10'));var logger=require(_0x4051('0x11'))('api');var utils=require(_0x4051('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4051('0x13'))['db'];function respondWithStatusCode(_0x19fbd7,_0x1980a0){_0x1980a0=_0x1980a0||0xcc;return function(_0x1eb233){if(_0x1eb233){return _0x19fbd7['sendStatus'](_0x1980a0);}return _0x19fbd7[_0x4051('0x14')](_0x1980a0)['end']();};}function respondWithResult(_0x95d684,_0x347aea){_0x347aea=_0x347aea||0xc8;return function(_0x52ef89){if(_0x52ef89){return _0x95d684[_0x4051('0x14')](_0x347aea)[_0x4051('0x15')](_0x52ef89);}};}function respondWithFilteredResult(_0x406a34,_0x23394a){return function(_0x531d4f){if(_0x531d4f){var _0x25f125=typeof _0x23394a[_0x4051('0x16')]==='undefined'&&typeof _0x23394a[_0x4051('0x17')]==='undefined';var _0x1f61d3=_0x531d4f[_0x4051('0x18')];var _0x49811a=_0x25f125?0x0:_0x23394a[_0x4051('0x16')];var _0x415242=_0x25f125?_0x531d4f['count']:_0x23394a[_0x4051('0x16')]+_0x23394a[_0x4051('0x17')];var _0x40b8fb;if(_0x415242>=_0x1f61d3){_0x415242=_0x1f61d3;_0x40b8fb=0xc8;}else{_0x40b8fb=0xce;}_0x406a34[_0x4051('0x14')](_0x40b8fb);return _0x406a34['set']('Content-Range',_0x49811a+'-'+_0x415242+'/'+_0x1f61d3)[_0x4051('0x15')](_0x531d4f);}return null;};}function patchUpdates(_0x358095){return function(_0x16ae08){try{jsonpatch[_0x4051('0x19')](_0x16ae08,_0x358095,!![]);}catch(_0x1ed5a9){return BPromise[_0x4051('0x1a')](_0x1ed5a9);}return _0x16ae08[_0x4051('0x1b')]();};}function saveUpdates(_0x1442cc,_0x56c7bc){return function(_0x228ff6){if(_0x228ff6){return _0x228ff6[_0x4051('0x1c')](_0x1442cc)[_0x4051('0x1d')](function(_0x2b6fa8){return _0x2b6fa8;});}return null;};}function removeEntity(_0x1d6150,_0x4189dd){return function(_0x196d2e){if(_0x196d2e){return _0x196d2e[_0x4051('0x1e')]()[_0x4051('0x1d')](function(){var _0x22a215=_0x196d2e[_0x4051('0x1f')]({'plain':!![]});var _0x4fc039=_0x4051('0x20');return db['UserProfileResource'][_0x4051('0x1e')]({'where':{'type':_0x4fc039,'resourceId':_0x22a215['id']}})[_0x4051('0x1d')](function(){return _0x196d2e;});})[_0x4051('0x1d')](function(){_0x1d6150[_0x4051('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x33d3c7,_0x1acac3){return function(_0x35f3ac){if(!_0x35f3ac){_0x33d3c7[_0x4051('0x21')](0x194);}return _0x35f3ac;};}function handleError(_0x5d2274,_0xba4a62){_0xba4a62=_0xba4a62||0x1f4;return function(_0x570e31){logger[_0x4051('0x22')](_0x570e31['stack']);if(_0x570e31[_0x4051('0x23')]){delete _0x570e31['name'];}_0x5d2274[_0x4051('0x14')](_0xba4a62)[_0x4051('0x24')](_0x570e31);};}exports[_0x4051('0x25')]=function(_0x294a4d,_0x514c76){var _0x36891a={},_0x3ba1d5={},_0x43bee8={'count':0x0,'rows':[]};var _0x49ed06=_[_0x4051('0x26')](db[_0x4051('0x27')]['rawAttributes'],function(_0x445667){return{'name':_0x445667[_0x4051('0x28')],'type':_0x445667[_0x4051('0x29')][_0x4051('0x2a')]};});_0x3ba1d5[_0x4051('0x2b')]=_[_0x4051('0x26')](_0x49ed06,_0x4051('0x23'));_0x3ba1d5[_0x4051('0x2c')]=_[_0x4051('0x2d')](_0x294a4d[_0x4051('0x2c')]);_0x3ba1d5[_0x4051('0x2e')]=_[_0x4051('0x2f')](_0x3ba1d5['model'],_0x3ba1d5[_0x4051('0x2c')]);_0x36891a[_0x4051('0x30')]=_[_0x4051('0x2f')](_0x3ba1d5[_0x4051('0x2b')],qs[_0x4051('0x31')](_0x294a4d[_0x4051('0x2c')]['fields']));_0x36891a['attributes']=_0x36891a[_0x4051('0x30')][_0x4051('0x32')]?_0x36891a[_0x4051('0x30')]:_0x3ba1d5[_0x4051('0x2b')];if(!_0x294a4d['query'][_0x4051('0x33')](_0x4051('0x34'))){_0x36891a[_0x4051('0x17')]=qs[_0x4051('0x17')](_0x294a4d[_0x4051('0x2c')][_0x4051('0x17')]);_0x36891a[_0x4051('0x16')]=qs[_0x4051('0x16')](_0x294a4d[_0x4051('0x2c')][_0x4051('0x16')]);}_0x36891a['order']=qs[_0x4051('0x35')](_0x294a4d['query'][_0x4051('0x35')]);_0x36891a[_0x4051('0x36')]=qs[_0x4051('0x2e')](_['pick'](_0x294a4d[_0x4051('0x2c')],_0x3ba1d5[_0x4051('0x2e')]),_0x49ed06);if(_0x294a4d[_0x4051('0x2c')]['filter']){_0x36891a['where']=_[_0x4051('0x37')](_0x36891a['where'],{'$or':_[_0x4051('0x26')](_0x49ed06,function(_0x390aec){if(_0x390aec[_0x4051('0x29')]!==_0x4051('0x38')){var _0x48e169={};_0x48e169[_0x390aec['name']]={'$like':'%'+_0x294a4d[_0x4051('0x2c')]['filter']+'%'};return _0x48e169;}})});}_0x36891a=_['merge']({},_0x36891a,_0x294a4d[_0x4051('0x39')]);var _0x45ae67={'where':_0x36891a[_0x4051('0x36')]};return db[_0x4051('0x27')]['count'](_0x45ae67)['then'](function(_0x4c9168){_0x43bee8['count']=_0x4c9168;if(_0x294a4d[_0x4051('0x2c')][_0x4051('0x3a')]){_0x36891a[_0x4051('0x3b')]=[{'all':!![]}];}return db['Disposition'][_0x4051('0x3c')](_0x36891a);})[_0x4051('0x1d')](function(_0x7bc4ba){_0x43bee8[_0x4051('0x3d')]=_0x7bc4ba;return _0x43bee8;})[_0x4051('0x1d')](respondWithFilteredResult(_0x514c76,_0x36891a))[_0x4051('0x3e')](handleError(_0x514c76,null));};exports[_0x4051('0x3f')]=function(_0x12c29f,_0x1ca625){var _0x1fe39f={'raw':!![],'where':{'id':_0x12c29f[_0x4051('0x40')]['id']}},_0x4de81f={};_0x4de81f[_0x4051('0x2b')]=_[_0x4051('0x2d')](db[_0x4051('0x27')][_0x4051('0x41')]);_0x4de81f[_0x4051('0x2c')]=_[_0x4051('0x2d')](_0x12c29f[_0x4051('0x2c')]);_0x4de81f['filters']=_['intersection'](_0x4de81f[_0x4051('0x2b')],_0x4de81f[_0x4051('0x2c')]);_0x1fe39f[_0x4051('0x30')]=_['intersection'](_0x4de81f[_0x4051('0x2b')],qs[_0x4051('0x31')](_0x12c29f[_0x4051('0x2c')][_0x4051('0x31')]));_0x1fe39f[_0x4051('0x30')]=_0x1fe39f[_0x4051('0x30')][_0x4051('0x32')]?_0x1fe39f[_0x4051('0x30')]:_0x4de81f['model'];if(_0x12c29f[_0x4051('0x2c')]['includeAll']){_0x1fe39f[_0x4051('0x3b')]=[{'all':!![]}];}_0x1fe39f=_[_0x4051('0x37')]({},_0x1fe39f,_0x12c29f[_0x4051('0x39')]);return db[_0x4051('0x27')][_0x4051('0x42')](_0x1fe39f)[_0x4051('0x1d')](handleEntityNotFound(_0x1ca625,null))['then'](respondWithResult(_0x1ca625,null))[_0x4051('0x3e')](handleError(_0x1ca625,null));};exports[_0x4051('0x43')]=function(_0x49e116,_0x4ffef1){return db[_0x4051('0x27')][_0x4051('0x43')](_0x49e116['body'],{})[_0x4051('0x1d')](function(_0x415ecc){var _0x3b7b05=_0x49e116[_0x4051('0x44')][_0x4051('0x1f')]({'plain':!![]});if(!_0x3b7b05)throw new Error(_0x4051('0x45'));if(_0x3b7b05[_0x4051('0x46')]===_0x4051('0x44')){var _0x1f5918=_0x415ecc[_0x4051('0x1f')]({'plain':!![]});var _0x707782=_0x4051('0x20');return db[_0x4051('0x47')][_0x4051('0x42')]({'where':{'name':_0x707782,'userProfileId':_0x3b7b05[_0x4051('0x48')]},'raw':!![]})['then'](function(_0x266bb0){if(_0x266bb0&&_0x266bb0[_0x4051('0x49')]===0x0){return db[_0x4051('0x4a')][_0x4051('0x43')]({'name':_0x1f5918[_0x4051('0x23')],'resourceId':_0x1f5918['id'],'type':_0x266bb0[_0x4051('0x23')],'sectionId':_0x266bb0['id']},{})[_0x4051('0x1d')](function(){return _0x415ecc;});}else{return _0x415ecc;}})[_0x4051('0x3e')](function(_0x4f678d){logger[_0x4051('0x22')](_0x4051('0x4b'),_0x4f678d);throw _0x4f678d;});}return _0x415ecc;})['then'](respondWithResult(_0x4ffef1,0xc9))[_0x4051('0x3e')](handleError(_0x4ffef1,null));};exports[_0x4051('0x1c')]=function(_0x30ae33,_0x4fd843){if(_0x30ae33[_0x4051('0x4c')]['id']){delete _0x30ae33[_0x4051('0x4c')]['id'];}return db[_0x4051('0x27')][_0x4051('0x42')]({'where':{'id':_0x30ae33[_0x4051('0x40')]['id']}})[_0x4051('0x1d')](handleEntityNotFound(_0x4fd843,null))[_0x4051('0x1d')](saveUpdates(_0x30ae33['body'],null))[_0x4051('0x1d')](respondWithResult(_0x4fd843,null))['catch'](handleError(_0x4fd843,null));};exports[_0x4051('0x1e')]=function(_0x1a886f,_0x364ccb){return db['Disposition'][_0x4051('0x42')]({'where':{'id':_0x1a886f[_0x4051('0x40')]['id']}})[_0x4051('0x1d')](handleEntityNotFound(_0x364ccb,null))['then'](removeEntity(_0x364ccb,null))[_0x4051('0x3e')](handleError(_0x364ccb,null));}; \ No newline at end of file +var _0x5285=['include','findAll','options','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save','update','then','destroy','get','Dispositions','UserProfileResource','error','stack','name','send','index','map','Disposition','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll'];(function(_0x123797,_0x5b187b){var _0x3a8f49=function(_0x5e3e1e){while(--_0x5e3e1e){_0x123797['push'](_0x123797['shift']());}};_0x3a8f49(++_0x5b187b);}(_0x5285,0x1a7));var _0x5528=function(_0x4629ee,_0x5802d8){_0x4629ee=_0x4629ee-0x0;var _0x47fb5b=_0x5285[_0x4629ee];return _0x47fb5b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5528('0x0'));var jsonpatch=require(_0x5528('0x1'));var rp=require('request-promise');var moment=require(_0x5528('0x2'));var BPromise=require(_0x5528('0x3'));var Mustache=require(_0x5528('0x4'));var util=require('util');var path=require(_0x5528('0x5'));var sox=require(_0x5528('0x6'));var csv=require(_0x5528('0x7'));var ejs=require(_0x5528('0x8'));var fs=require('fs');var fs_extra=require(_0x5528('0x9'));var _=require('lodash');var squel=require(_0x5528('0xa'));var crypto=require(_0x5528('0xb'));var jsforce=require(_0x5528('0xc'));var deskjs=require(_0x5528('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x5528('0xe'));var Redis=require(_0x5528('0xf'));var authService=require(_0x5528('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x5528('0x11'));var hardwareService=require(_0x5528('0x12'));var logger=require(_0x5528('0x13'))(_0x5528('0x14'));var utils=require(_0x5528('0x15'));var config=require(_0x5528('0x16'));var licenseUtil=require(_0x5528('0x17'));var db=require(_0x5528('0x18'))['db'];function respondWithStatusCode(_0xec5227,_0x57bdd8){_0x57bdd8=_0x57bdd8||0xcc;return function(_0x1cc8eb){if(_0x1cc8eb){return _0xec5227[_0x5528('0x19')](_0x57bdd8);}return _0xec5227[_0x5528('0x1a')](_0x57bdd8)[_0x5528('0x1b')]();};}function respondWithResult(_0x36299b,_0x2bb748){_0x2bb748=_0x2bb748||0xc8;return function(_0x4bec28){if(_0x4bec28){return _0x36299b['status'](_0x2bb748)[_0x5528('0x1c')](_0x4bec28);}};}function respondWithFilteredResult(_0x5c8954,_0x1363f3){return function(_0x6bf6a0){if(_0x6bf6a0){var _0x5fac8=typeof _0x1363f3[_0x5528('0x1d')]===_0x5528('0x1e')&&typeof _0x1363f3[_0x5528('0x1f')]===_0x5528('0x1e');var _0x26be37=_0x6bf6a0[_0x5528('0x20')];var _0x3b5990=_0x5fac8?0x0:_0x1363f3[_0x5528('0x1d')];var _0x4b0620=_0x5fac8?_0x6bf6a0[_0x5528('0x20')]:_0x1363f3['offset']+_0x1363f3[_0x5528('0x1f')];var _0x4ea11b;if(_0x4b0620>=_0x26be37){_0x4b0620=_0x26be37;_0x4ea11b=0xc8;}else{_0x4ea11b=0xce;}_0x5c8954['status'](_0x4ea11b);return _0x5c8954[_0x5528('0x21')]('Content-Range',_0x3b5990+'-'+_0x4b0620+'/'+_0x26be37)['json'](_0x6bf6a0);}return null;};}function patchUpdates(_0x5a4a36){return function(_0x376800){try{jsonpatch['apply'](_0x376800,_0x5a4a36,!![]);}catch(_0x19e5f9){return BPromise[_0x5528('0x22')](_0x19e5f9);}return _0x376800[_0x5528('0x23')]();};}function saveUpdates(_0x40b118,_0x2cdd58){return function(_0x261adb){if(_0x261adb){return _0x261adb[_0x5528('0x24')](_0x40b118)[_0x5528('0x25')](function(_0x210a0c){return _0x210a0c;});}return null;};}function removeEntity(_0x43d4ae,_0x4f0c5f){return function(_0x10bf8d){if(_0x10bf8d){return _0x10bf8d[_0x5528('0x26')]()['then'](function(){var _0x17e281=_0x10bf8d[_0x5528('0x27')]({'plain':!![]});var _0x34dfcd=_0x5528('0x28');return db[_0x5528('0x29')]['destroy']({'where':{'type':_0x34dfcd,'resourceId':_0x17e281['id']}})[_0x5528('0x25')](function(){return _0x10bf8d;});})[_0x5528('0x25')](function(){_0x43d4ae[_0x5528('0x1a')](0xcc)[_0x5528('0x1b')]();});}};}function handleEntityNotFound(_0x45eebc,_0x1e1f55){return function(_0xbee7a7){if(!_0xbee7a7){_0x45eebc[_0x5528('0x19')](0x194);}return _0xbee7a7;};}function handleError(_0x5abcf9,_0x596926){_0x596926=_0x596926||0x1f4;return function(_0x4d954b){logger[_0x5528('0x2a')](_0x4d954b[_0x5528('0x2b')]);if(_0x4d954b[_0x5528('0x2c')]){delete _0x4d954b[_0x5528('0x2c')];}_0x5abcf9[_0x5528('0x1a')](_0x596926)[_0x5528('0x2d')](_0x4d954b);};}exports[_0x5528('0x2e')]=function(_0xe86f9b,_0x1f0dab){var _0x1a3f10={},_0x4ddd19={},_0x4f023e={'count':0x0,'rows':[]};var _0x62ab65=_[_0x5528('0x2f')](db[_0x5528('0x30')][_0x5528('0x31')],function(_0x4cbe62){return{'name':_0x4cbe62[_0x5528('0x32')],'type':_0x4cbe62['type'][_0x5528('0x33')]};});_0x4ddd19[_0x5528('0x34')]=_['map'](_0x62ab65,_0x5528('0x2c'));_0x4ddd19[_0x5528('0x35')]=_[_0x5528('0x36')](_0xe86f9b['query']);_0x4ddd19[_0x5528('0x37')]=_[_0x5528('0x38')](_0x4ddd19[_0x5528('0x34')],_0x4ddd19[_0x5528('0x35')]);_0x1a3f10[_0x5528('0x39')]=_['intersection'](_0x4ddd19[_0x5528('0x34')],qs[_0x5528('0x3a')](_0xe86f9b[_0x5528('0x35')][_0x5528('0x3a')]));_0x1a3f10[_0x5528('0x39')]=_0x1a3f10['attributes'][_0x5528('0x3b')]?_0x1a3f10[_0x5528('0x39')]:_0x4ddd19[_0x5528('0x34')];if(!_0xe86f9b[_0x5528('0x35')][_0x5528('0x3c')]('nolimit')){_0x1a3f10[_0x5528('0x1f')]=qs[_0x5528('0x1f')](_0xe86f9b[_0x5528('0x35')][_0x5528('0x1f')]);_0x1a3f10[_0x5528('0x1d')]=qs[_0x5528('0x1d')](_0xe86f9b[_0x5528('0x35')][_0x5528('0x1d')]);}_0x1a3f10[_0x5528('0x3d')]=qs[_0x5528('0x3e')](_0xe86f9b[_0x5528('0x35')][_0x5528('0x3e')]);_0x1a3f10[_0x5528('0x3f')]=qs['filters'](_[_0x5528('0x40')](_0xe86f9b['query'],_0x4ddd19[_0x5528('0x37')]),_0x62ab65);if(_0xe86f9b['query'][_0x5528('0x41')]){_0x1a3f10[_0x5528('0x3f')]=_[_0x5528('0x42')](_0x1a3f10[_0x5528('0x3f')],{'$or':_[_0x5528('0x2f')](_0x62ab65,function(_0x5bc4cf){if(_0x5bc4cf['type']!==_0x5528('0x43')){var _0x4b46d4={};_0x4b46d4[_0x5bc4cf['name']]={'$like':'%'+_0xe86f9b['query'][_0x5528('0x41')]+'%'};return _0x4b46d4;}})});}_0x1a3f10=_[_0x5528('0x42')]({},_0x1a3f10,_0xe86f9b['options']);var _0x43185b={'where':_0x1a3f10[_0x5528('0x3f')]};return db[_0x5528('0x30')][_0x5528('0x20')](_0x43185b)[_0x5528('0x25')](function(_0x1944bc){_0x4f023e[_0x5528('0x20')]=_0x1944bc;if(_0xe86f9b[_0x5528('0x35')][_0x5528('0x44')]){_0x1a3f10[_0x5528('0x45')]=[{'all':!![]}];}return db[_0x5528('0x30')][_0x5528('0x46')](_0x1a3f10);})[_0x5528('0x25')](function(_0x1c8ee4){_0x4f023e['rows']=_0x1c8ee4;return _0x4f023e;})[_0x5528('0x25')](respondWithFilteredResult(_0x1f0dab,_0x1a3f10))['catch'](handleError(_0x1f0dab,null));};exports['show']=function(_0x5cc905,_0x103315){var _0x57305d={'raw':!![],'where':{'id':_0x5cc905['params']['id']}},_0x546fb7={};_0x546fb7[_0x5528('0x34')]=_[_0x5528('0x36')](db[_0x5528('0x30')]['rawAttributes']);_0x546fb7['query']=_[_0x5528('0x36')](_0x5cc905['query']);_0x546fb7['filters']=_[_0x5528('0x38')](_0x546fb7[_0x5528('0x34')],_0x546fb7[_0x5528('0x35')]);_0x57305d[_0x5528('0x39')]=_[_0x5528('0x38')](_0x546fb7[_0x5528('0x34')],qs['fields'](_0x5cc905[_0x5528('0x35')]['fields']));_0x57305d[_0x5528('0x39')]=_0x57305d[_0x5528('0x39')]['length']?_0x57305d['attributes']:_0x546fb7[_0x5528('0x34')];if(_0x5cc905[_0x5528('0x35')][_0x5528('0x44')]){_0x57305d[_0x5528('0x45')]=[{'all':!![]}];}_0x57305d=_[_0x5528('0x42')]({},_0x57305d,_0x5cc905[_0x5528('0x47')]);return db['Disposition'][_0x5528('0x48')](_0x57305d)[_0x5528('0x25')](handleEntityNotFound(_0x103315,null))[_0x5528('0x25')](respondWithResult(_0x103315,null))[_0x5528('0x49')](handleError(_0x103315,null));};exports[_0x5528('0x4a')]=function(_0x18698c,_0x58fd3d){return db['Disposition'][_0x5528('0x4a')](_0x18698c[_0x5528('0x4b')],{})[_0x5528('0x25')](function(_0x4007eb){var _0x48c0bf=_0x18698c['user'][_0x5528('0x27')]({'plain':!![]});if(!_0x48c0bf)throw new Error(_0x5528('0x4c'));if(_0x48c0bf['role']===_0x5528('0x4d')){var _0x2134d0=_0x4007eb[_0x5528('0x27')]({'plain':!![]});var _0xd396b1='Dispositions';return db[_0x5528('0x4e')]['find']({'where':{'name':_0xd396b1,'userProfileId':_0x48c0bf[_0x5528('0x4f')]},'raw':!![]})[_0x5528('0x25')](function(_0x287a02){if(_0x287a02&&_0x287a02[_0x5528('0x50')]===0x0){return db['UserProfileResource'][_0x5528('0x4a')]({'name':_0x2134d0[_0x5528('0x2c')],'resourceId':_0x2134d0['id'],'type':_0x287a02[_0x5528('0x2c')],'sectionId':_0x287a02['id']},{})[_0x5528('0x25')](function(){return _0x4007eb;});}else{return _0x4007eb;}})['catch'](function(_0x564e31){logger[_0x5528('0x2a')](_0x5528('0x51'),_0x564e31);throw _0x564e31;});}return _0x4007eb;})['then'](respondWithResult(_0x58fd3d,0xc9))[_0x5528('0x49')](handleError(_0x58fd3d,null));};exports['update']=function(_0x48a2e0,_0x252d85){if(_0x48a2e0[_0x5528('0x4b')]['id']){delete _0x48a2e0['body']['id'];}return db[_0x5528('0x30')][_0x5528('0x48')]({'where':{'id':_0x48a2e0['params']['id']}})[_0x5528('0x25')](handleEntityNotFound(_0x252d85,null))[_0x5528('0x25')](saveUpdates(_0x48a2e0[_0x5528('0x4b')],null))['then'](respondWithResult(_0x252d85,null))[_0x5528('0x49')](handleError(_0x252d85,null));};exports[_0x5528('0x26')]=function(_0x192141,_0x329b65){return db[_0x5528('0x30')][_0x5528('0x48')]({'where':{'id':_0x192141['params']['id']}})['then'](handleEntityNotFound(_0x329b65,null))[_0x5528('0x25')](removeEntity(_0x329b65,null))['catch'](handleError(_0x329b65,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 3404766..99f82b5 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 _0x8666=['name_fax','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./disposition.attributes','exports','Disposition','name_voice','name','ListId','name_chat','ChatWebsiteId','MailAccountId','SmsAccountId'];(function(_0x35eed8,_0xec2124){var _0x56d03a=function(_0x4835fc){while(--_0x4835fc){_0x35eed8['push'](_0x35eed8['shift']());}};_0x56d03a(++_0xec2124);}(_0x8666,0x122));var _0x6866=function(_0x1d3f3f,_0x30ed45){_0x1d3f3f=_0x1d3f3f-0x0;var _0x49e5e8=_0x8666[_0x1d3f3f];return _0x49e5e8;};'use strict';var _=require(_0x6866('0x0'));var util=require(_0x6866('0x1'));var logger=require('../../config/logger')(_0x6866('0x2'));var moment=require(_0x6866('0x3'));var BPromise=require(_0x6866('0x4'));var rp=require(_0x6866('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6866('0x6'));var config=require(_0x6866('0x7'));var attributes=require(_0x6866('0x8'));module[_0x6866('0x9')]=function(_0x40f35b,_0x2efa0e){return _0x40f35b['define'](_0x6866('0xa'),attributes,{'tableName':'tools_dispositions','paranoid':![],'indexes':[{'unique':!![],'name':_0x6866('0xb'),'fields':[_0x6866('0xc'),_0x6866('0xd')]},{'unique':!![],'name':_0x6866('0xe'),'fields':[_0x6866('0xc'),_0x6866('0xf')]},{'unique':!![],'name':'name_mail','fields':[_0x6866('0xc'),_0x6866('0x10')]},{'unique':!![],'name':'name_sms','fields':[_0x6866('0xc'),_0x6866('0x11')]},{'unique':!![],'name':_0x6866('0x12'),'fields':['name','FaxAccountId']},{'unique':!![],'name':'name_openchannel','fields':['name',_0x6866('0x13')]},{'unique':!![],'name':_0x6866('0x14'),'fields':['name',_0x6866('0x15')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd560=['Disposition','tools_dispositions','name_voice','name','ListId','name_chat','ChatWebsiteId','name_mail','MailAccountId','name_fax','FaxAccountId','name_openchannel','name_whatsapp','WhatsappAccountId','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x4e4061,_0x26503b){var _0x371dbd=function(_0x31a31f){while(--_0x31a31f){_0x4e4061['push'](_0x4e4061['shift']());}};_0x371dbd(++_0x26503b);}(_0xd560,0x167));var _0x0d56=function(_0x3b089c,_0xb6ceaa){_0x3b089c=_0x3b089c-0x0;var _0x479fc2=_0xd560[_0x3b089c];return _0x479fc2;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0d56('0x0'))(_0x0d56('0x1'));var moment=require('moment');var BPromise=require(_0x0d56('0x2'));var rp=require(_0x0d56('0x3'));var fs=require('fs');var path=require(_0x0d56('0x4'));var rimraf=require(_0x0d56('0x5'));var config=require(_0x0d56('0x6'));var attributes=require('./disposition.attributes');module[_0x0d56('0x7')]=function(_0xc09af8,_0x2010ba){return _0xc09af8[_0x0d56('0x8')](_0x0d56('0x9'),attributes,{'tableName':_0x0d56('0xa'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x0d56('0xb'),'fields':[_0x0d56('0xc'),_0x0d56('0xd')]},{'unique':!![],'name':_0x0d56('0xe'),'fields':[_0x0d56('0xc'),_0x0d56('0xf')]},{'unique':!![],'name':_0x0d56('0x10'),'fields':[_0x0d56('0xc'),_0x0d56('0x11')]},{'unique':!![],'name':'name_sms','fields':[_0x0d56('0xc'),'SmsAccountId']},{'unique':!![],'name':_0x0d56('0x12'),'fields':[_0x0d56('0xc'),_0x0d56('0x13')]},{'unique':!![],'name':_0x0d56('0x14'),'fields':[_0x0d56('0xc'),'OpenchannelAccountId']},{'unique':!![],'name':_0x0d56('0x15'),'fields':[_0x0d56('0xc'),_0x0d56('0x16')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index 5953219..6c68d69 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(_0x26659e,_0x38b253){var _0x20244c=function(_0xfab6dc){while(--_0xfab6dc){_0x26659e['push'](_0x26659e['shift']());}};_0x20244c(++_0x38b253);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0xa9e0[_0x3a6efd];return _0x487b9a;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file +var _0xa9e0=['http','info','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(_0x452947,_0x205a9d){var _0x1ab49f=function(_0x32d4ec){while(--_0x32d4ec){_0x452947['push'](_0x452947['shift']());}};_0x1ab49f(++_0x205a9d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xa9e0[_0x45e98e];return _0x374dba;};'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 f3076ca..063df1d 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 _0xe32b=['../../components/auth/service','../../config/environment','./disposition.controller','isAuthenticated','index','get','/:id','show','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','fs-extra'];(function(_0x7a36a8,_0x2c1981){var _0x5d17b2=function(_0x20a00b){while(--_0x20a00b){_0x7a36a8['push'](_0x7a36a8['shift']());}};_0x5d17b2(++_0x2c1981);}(_0xe32b,0x106));var _0xbe32=function(_0x383cd4,_0x2da9c6){_0x383cd4=_0x383cd4-0x0;var _0x33bd6c=_0xe32b[_0x383cd4];return _0x33bd6c;};'use strict';var multer=require(_0xbe32('0x0'));var util=require('util');var path=require(_0xbe32('0x1'));var timeout=require(_0xbe32('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xbe32('0x3'));var auth=require(_0xbe32('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xbe32('0x5'));var controller=require(_0xbe32('0x6'));router['get']('/',auth[_0xbe32('0x7')](),controller[_0xbe32('0x8')]);router[_0xbe32('0x9')](_0xbe32('0xa'),auth[_0xbe32('0x7')](),controller[_0xbe32('0xb')]);router[_0xbe32('0xc')]('/',auth[_0xbe32('0x7')](),controller[_0xbe32('0xd')]);router[_0xbe32('0xe')](_0xbe32('0xa'),auth[_0xbe32('0x7')](),controller[_0xbe32('0xf')]);router[_0xbe32('0x10')](_0xbe32('0xa'),auth[_0xbe32('0x7')](),controller[_0xbe32('0x11')]);module[_0xbe32('0x12')]=router; \ No newline at end of file +var _0x1a82=['path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./disposition.controller','get','isAuthenticated','index','show','post','create','put','update','delete','/:id','destroy','exports','multer','util'];(function(_0x3f546d,_0x5353b9){var _0x5a1515=function(_0x5bb7a0){while(--_0x5bb7a0){_0x3f546d['push'](_0x3f546d['shift']());}};_0x5a1515(++_0x5353b9);}(_0x1a82,0xbb));var _0x21a8=function(_0xc7348b,_0x145880){_0xc7348b=_0xc7348b-0x0;var _0x307cec=_0x1a82[_0xc7348b];return _0x307cec;};'use strict';var multer=require(_0x21a8('0x0'));var util=require(_0x21a8('0x1'));var path=require(_0x21a8('0x2'));var timeout=require(_0x21a8('0x3'));var express=require(_0x21a8('0x4'));var router=express[_0x21a8('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x21a8('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x21a8('0x7'));var controller=require(_0x21a8('0x8'));router[_0x21a8('0x9')]('/',auth[_0x21a8('0xa')](),controller[_0x21a8('0xb')]);router[_0x21a8('0x9')]('/:id',auth[_0x21a8('0xa')](),controller[_0x21a8('0xc')]);router[_0x21a8('0xd')]('/',auth[_0x21a8('0xa')](),controller[_0x21a8('0xe')]);router[_0x21a8('0xf')]('/:id',auth[_0x21a8('0xa')](),controller[_0x21a8('0x10')]);router[_0x21a8('0x11')](_0x21a8('0x12'),auth[_0x21a8('0xa')](),controller[_0x21a8('0x13')]);module[_0x21a8('0x14')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index 4526d9e..3a70a87 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 _0x664c=['Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','sequelize','exports','STRING','ENUM','yes','localstationid','2400','4800','7200','9600','12000','14400','v17,v27,v29','INTEGER','SIP','IAX','DADHI','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN'];(function(_0x5bdd96,_0x178a4f){var _0x31625b=function(_0x4e8535){while(--_0x4e8535){_0x5bdd96['push'](_0x5bdd96['shift']());}};_0x31625b(++_0x178a4f);}(_0x664c,0x95));var _0xc664=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x664c[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xc664('0x0'));module[_0xc664('0x1')]={'name':{'type':Sequelize[_0xc664('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xc664('0x2')]},'ecm':{'type':Sequelize[_0xc664('0x3')]('yes','no'),'defaultValue':_0xc664('0x4')},'headerinfo':{'type':Sequelize['STRING'],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize[_0xc664('0x2')],'unique':_0xc664('0x5')},'minrate':{'type':Sequelize[_0xc664('0x3')](_0xc664('0x6'),_0xc664('0x7'),_0xc664('0x8'),_0xc664('0x9'),_0xc664('0xa'),_0xc664('0xb')),'defaultValue':'4800'},'maxrate':{'type':Sequelize['ENUM'](_0xc664('0x6'),'4800',_0xc664('0x8'),'9600',_0xc664('0xa'),_0xc664('0xb')),'defaultValue':_0xc664('0xb')},'modem':{'type':Sequelize[_0xc664('0x2')],'defaultValue':_0xc664('0xc')},'gateway':{'type':Sequelize[_0xc664('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xc664('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xc664('0xd')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0xc664('0x3')](_0xc664('0xe'),_0xc664('0xf'),_0xc664('0x10'),'KHOMP'),'defaultValue':_0xc664('0xe')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xc664('0x11');}},'notificationSound':{'type':Sequelize[_0xc664('0x12')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xc664('0x12')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xc664('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xc664('0x12')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xc664('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xc664('0x12')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xc664('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0xc664('0x13')},'mandatoryDisposition':{'type':Sequelize[_0xc664('0x12')],'defaultValue':![],'comment':_0xc664('0x14'),'set':function(_0x266af0){if(!_0x266af0)this['setDataValue'](_0xc664('0x15'),null);this[_0xc664('0x16')](_0xc664('0x17'),_0x266af0);}}}; \ No newline at end of file +var _0x1fa3=['9600','SIP','DADHI','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','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','sequelize','exports','STRING','yes','localstationid','ENUM','2400','7200','12000','14400','4800'];(function(_0x79142e,_0x183972){var _0x4503b3=function(_0x44a7c0){while(--_0x44a7c0){_0x79142e['push'](_0x79142e['shift']());}};_0x4503b3(++_0x183972);}(_0x1fa3,0xc4));var _0x31fa=function(_0xe24dd3,_0x34492b){_0xe24dd3=_0xe24dd3-0x0;var _0x107bd5=_0x1fa3[_0xe24dd3];return _0x107bd5;};'use strict';var Sequelize=require(_0x31fa('0x0'));module[_0x31fa('0x1')]={'name':{'type':Sequelize[_0x31fa('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x31fa('0x2')]},'ecm':{'type':Sequelize['ENUM'](_0x31fa('0x3'),'no'),'defaultValue':_0x31fa('0x3')},'headerinfo':{'type':Sequelize['STRING'],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize['STRING'],'unique':_0x31fa('0x4')},'minrate':{'type':Sequelize[_0x31fa('0x5')](_0x31fa('0x6'),'4800',_0x31fa('0x7'),'9600',_0x31fa('0x8'),_0x31fa('0x9')),'defaultValue':'4800'},'maxrate':{'type':Sequelize[_0x31fa('0x5')](_0x31fa('0x6'),_0x31fa('0xa'),_0x31fa('0x7'),_0x31fa('0xb'),'12000',_0x31fa('0x9')),'defaultValue':_0x31fa('0x9')},'modem':{'type':Sequelize['STRING'],'defaultValue':'v17,v27,v29'},'gateway':{'type':Sequelize[_0x31fa('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x31fa('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM'](_0x31fa('0xc'),'IAX',_0x31fa('0xd'),_0x31fa('0xe')),'defaultValue':_0x31fa('0xc')},'key':{'type':Sequelize[_0x31fa('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x31fa('0xf')],'defaultValue':function(){return _0x31fa('0x10');}},'notificationSound':{'type':Sequelize[_0x31fa('0x11')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x31fa('0x11')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x31fa('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x31fa('0x11')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x31fa('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x31fa('0x12')],'allowNull':!![],'defaultValue':null,'comment':_0x31fa('0x13')},'mandatoryDisposition':{'type':Sequelize[_0x31fa('0x11')],'defaultValue':![],'comment':_0x31fa('0x14'),'set':function(_0x226cac){if(!_0x226cac)this['setDataValue'](_0x31fa('0x15'),null);this[_0x31fa('0x16')]('mandatoryDisposition',_0x226cac);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index b5b311a..38048d2 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 _0x29b0=['Contact\x20not\x20found','ContactId','dataValues','Messages','SendFax','SendFaxRpc,\x20%s','addAgents','omit','spread','emit','userFaxAccount:save','removeAgents','userFaxAccount:remove','getAgents','eml-format','rimraf','request-promise','moment','bluebird','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./faxAccount.socket','register','jayson/promise','request','then','info','request\x20sent','debug','stringify','error','code','FaxAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','update','destroy','get','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','FaxAccount','include','findAll','rows','show','includeAll','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','FaxAccounts','UserProfileSection','autoAssociation','find','params','describe','FaxAccountId','Disposition','filter','removeDispositions','ids','addAnswer','CannedAnswer','findOne','length','removeAnswers','addInteraction','FaxInteraction','getInteractions','CmContact','Contact','User','fullname','internal','Tags','color','tag','addApplications','transaction','FaxApplication','bulkCreate','getApplications','context','exten','localstationid','app','description','Fax\x20Extension','priority','push','CDR(type)=inbound-fax','Set','ecm','gateway','faxdetect','maxrate','minrate','modem','t38timeout','FAXOPT(','/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','sequelize','updateAccountApplications','VoiceExtension','tech','updatedAt','TrunkId','ListId','findById','getMessages','$gte','split','FaxMessage','List','Contacts','DESC','attachments','root','CheckAfterSend','isNil','from','format','fax','defaults','Send\x20Fax\x20failed','filename'];(function(_0xcb0171,_0x4d3679){var _0x19d60d=function(_0xb34434){while(--_0xb34434){_0xcb0171['push'](_0xcb0171['shift']());}};_0x19d60d(++_0x4d3679);}(_0x29b0,0xc6));var _0x029b=function(_0x4ce371,_0x51332f){_0x4ce371=_0x4ce371-0x0;var _0xfcbfb3=_0x29b0[_0x4ce371];return _0xfcbfb3;};'use strict';var emlformat=require(_0x029b('0x0'));var rimraf=require(_0x029b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x029b('0x2'));var moment=require(_0x029b('0x3'));var BPromise=require(_0x029b('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x029b('0x5'));var sox=require('sox');var csv=require(_0x029b('0x6'));var ejs=require(_0x029b('0x7'));var fs=require('fs');var fs_extra=require(_0x029b('0x8'));var _=require(_0x029b('0x9'));var squel=require('squel');var crypto=require(_0x029b('0xa'));var jsforce=require(_0x029b('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x029b('0x6'));var querystring=require(_0x029b('0xc'));var Papa=require(_0x029b('0xd'));var Redis=require(_0x029b('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x029b('0xf'));var as=require(_0x029b('0x10'));var hardwareService=require(_0x029b('0x11'));var logger=require('../../config/logger')(_0x029b('0x12'));var utils=require(_0x029b('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x029b('0x14'));var db=require(_0x029b('0x15'))['db'];config[_0x029b('0x16')]=_['defaults'](config['redis'],{'host':_0x029b('0x17'),'port':0x18eb});var socket=require(_0x029b('0x18'))(new Redis(config['redis']));require(_0x029b('0x19'))[_0x029b('0x1a')](socket);var jayson=require(_0x029b('0x1b'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3d1ff2,_0x220d6b,_0x4b47b9,_0x5bc564){return new BPromise(function(_0x2634db,_0x30a0cd){var _0x2ef742=_0x5bc564||client;return _0x2ef742[_0x029b('0x1c')](_0x3d1ff2,_0x4b47b9)[_0x029b('0x1d')](function(_0x33236d){logger[_0x029b('0x1e')]('FaxAccount,\x20%s,\x20%s',_0x220d6b,_0x029b('0x1f'));logger[_0x029b('0x20')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x220d6b,'request\x20sent',JSON[_0x029b('0x21')](_0x33236d));if(_0x33236d['error']){if(_0x33236d[_0x029b('0x22')][_0x029b('0x23')]===0x1f4){logger[_0x029b('0x22')](_0x029b('0x24'),_0x220d6b,_0x33236d['error'][_0x029b('0x25')]);return _0x30a0cd(_0x33236d['error'][_0x029b('0x25')]);}logger[_0x029b('0x22')](_0x029b('0x24'),_0x220d6b,_0x33236d[_0x029b('0x22')][_0x029b('0x25')]);return _0x2634db(_0x33236d['error'][_0x029b('0x25')]);}else{logger['info'](_0x029b('0x24'),_0x220d6b,'request\x20sent');_0x2634db(_0x33236d[_0x029b('0x26')][_0x029b('0x25')]);}})[_0x029b('0x27')](function(_0x248883){logger[_0x029b('0x22')](_0x029b('0x24'),_0x220d6b,_0x248883);_0x30a0cd(_0x248883);});});}function respondWithStatusCode(_0xec963,_0x74d8ee){_0x74d8ee=_0x74d8ee||0xcc;return function(_0x30e4e7){if(_0x30e4e7){return _0xec963[_0x029b('0x28')](_0x74d8ee);}return _0xec963[_0x029b('0x29')](_0x74d8ee)['end']();};}function respondWithResult(_0x58767b,_0x3bedf0){_0x3bedf0=_0x3bedf0||0xc8;return function(_0x4ad027){if(_0x4ad027){return _0x58767b[_0x029b('0x29')](_0x3bedf0)[_0x029b('0x2a')](_0x4ad027);}};}function respondWithFilteredResult(_0x12e821,_0x36d1e8){return function(_0x59bc27){if(_0x59bc27){var _0x133282=typeof _0x36d1e8[_0x029b('0x2b')]===_0x029b('0x2c')&&typeof _0x36d1e8[_0x029b('0x2d')]===_0x029b('0x2c');var _0x252e9b=_0x59bc27[_0x029b('0x2e')];var _0x35a277=_0x133282?0x0:_0x36d1e8[_0x029b('0x2b')];var _0x3098eb=_0x133282?_0x59bc27[_0x029b('0x2e')]:_0x36d1e8[_0x029b('0x2b')]+_0x36d1e8['limit'];var _0x4b2327;if(_0x3098eb>=_0x252e9b){_0x3098eb=_0x252e9b;_0x4b2327=0xc8;}else{_0x4b2327=0xce;}_0x12e821[_0x029b('0x29')](_0x4b2327);return _0x12e821[_0x029b('0x2f')]('Content-Range',_0x35a277+'-'+_0x3098eb+'/'+_0x252e9b)['json'](_0x59bc27);}return null;};}function patchUpdates(_0x29720a){return function(_0x55af4a){try{jsonpatch[_0x029b('0x30')](_0x55af4a,_0x29720a,!![]);}catch(_0xf86ff){return BPromise[_0x029b('0x31')](_0xf86ff);}return _0x55af4a['save']();};}function saveUpdates(_0x5bee1f,_0x103bd0){return function(_0x1d1027){if(_0x1d1027){return _0x1d1027[_0x029b('0x32')](_0x5bee1f)[_0x029b('0x1d')](function(_0x5dc8b9){return _0x5dc8b9;});}return null;};}function removeEntity(_0x413088,_0x4d4314){return function(_0x4e6905){if(_0x4e6905){return _0x4e6905[_0x029b('0x33')]()[_0x029b('0x1d')](function(){var _0x1dd2ee=_0x4e6905[_0x029b('0x34')]({'plain':!![]});var _0x2e0a3b='FaxAccounts';return db[_0x029b('0x35')][_0x029b('0x33')]({'where':{'type':_0x2e0a3b,'resourceId':_0x1dd2ee['id']}})[_0x029b('0x1d')](function(){return _0x4e6905;});})[_0x029b('0x1d')](function(){_0x413088[_0x029b('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x322292,_0x5155d1){return function(_0x4e96ec){if(!_0x4e96ec){_0x322292[_0x029b('0x28')](0x194);}return _0x4e96ec;};}function handleError(_0x4a91ce,_0x24e0c6){_0x24e0c6=_0x24e0c6||0x1f4;return function(_0x34e70f){logger[_0x029b('0x22')](_0x34e70f[_0x029b('0x36')]);if(_0x34e70f['name']){delete _0x34e70f[_0x029b('0x37')];}_0x4a91ce['status'](_0x24e0c6)[_0x029b('0x38')](_0x34e70f);};}exports[_0x029b('0x39')]=function(_0x502df9,_0x4197a3){var _0x20dbc7={'include':[{'model':db[_0x029b('0x3a')],'as':_0x029b('0x3b')}]},_0x31a722={},_0x1ab51a={'count':0x0,'rows':[]};var _0x38e333=_[_0x029b('0x3c')](db['FaxAccount'][_0x029b('0x3d')],function(_0x55f376){return{'name':_0x55f376[_0x029b('0x3e')],'type':_0x55f376['type'][_0x029b('0x3f')]};});_0x31a722[_0x029b('0x40')]=_['map'](_0x38e333,'name');_0x31a722['query']=_[_0x029b('0x41')](_0x502df9[_0x029b('0x42')]);_0x31a722[_0x029b('0x43')]=_[_0x029b('0x44')](_0x31a722[_0x029b('0x40')],_0x31a722[_0x029b('0x42')]);_0x20dbc7[_0x029b('0x45')]=_[_0x029b('0x44')](_0x31a722[_0x029b('0x40')],qs[_0x029b('0x46')](_0x502df9[_0x029b('0x42')][_0x029b('0x46')]));_0x20dbc7['attributes']=_0x20dbc7[_0x029b('0x45')]['length']?_0x20dbc7[_0x029b('0x45')]:_0x31a722[_0x029b('0x40')];if(!_0x502df9[_0x029b('0x42')][_0x029b('0x47')](_0x029b('0x48'))){_0x20dbc7[_0x029b('0x2d')]=qs[_0x029b('0x2d')](_0x502df9[_0x029b('0x42')][_0x029b('0x2d')]);_0x20dbc7[_0x029b('0x2b')]=qs[_0x029b('0x2b')](_0x502df9[_0x029b('0x42')][_0x029b('0x2b')]);}_0x20dbc7[_0x029b('0x49')]=qs[_0x029b('0x4a')](_0x502df9[_0x029b('0x42')][_0x029b('0x4a')]);_0x20dbc7[_0x029b('0x4b')]=qs[_0x029b('0x43')](_[_0x029b('0x4c')](_0x502df9['query'],_0x31a722[_0x029b('0x43')]),_0x38e333);if(_0x502df9['query']['filter']){_0x20dbc7[_0x029b('0x4b')]=_[_0x029b('0x4d')](_0x20dbc7['where'],{'$or':_[_0x029b('0x3c')](_0x38e333,function(_0x22afea){if(_0x22afea[_0x029b('0x4e')]!==_0x029b('0x4f')){var _0x18fa7e={};_0x18fa7e[_0x22afea[_0x029b('0x37')]]={'$like':'%'+_0x502df9[_0x029b('0x42')]['filter']+'%'};return _0x18fa7e;}})});}_0x20dbc7=_[_0x029b('0x4d')]({},_0x20dbc7,_0x502df9['options']);var _0x2c5c44={'where':_0x20dbc7['where']};return db[_0x029b('0x50')][_0x029b('0x2e')](_0x2c5c44)[_0x029b('0x1d')](function(_0x2dd756){_0x1ab51a['count']=_0x2dd756;if(_0x502df9[_0x029b('0x42')]['includeAll']){_0x20dbc7[_0x029b('0x51')]=[{'all':!![]}];}return db['FaxAccount'][_0x029b('0x52')](_0x20dbc7);})[_0x029b('0x1d')](function(_0xea6994){_0x1ab51a[_0x029b('0x53')]=_0xea6994;return _0x1ab51a;})[_0x029b('0x1d')](respondWithFilteredResult(_0x4197a3,_0x20dbc7))[_0x029b('0x27')](handleError(_0x4197a3,null));};exports[_0x029b('0x54')]=function(_0x786bad,_0x2fb0a0){var _0x43aba7={'raw':![],'where':{'id':_0x786bad['params']['id']},'include':[{'model':db['Pause'],'as':_0x029b('0x3b')}]},_0x3d131e={};_0x3d131e[_0x029b('0x40')]=_[_0x029b('0x41')](db['FaxAccount'][_0x029b('0x3d')]);_0x3d131e[_0x029b('0x42')]=_[_0x029b('0x41')](_0x786bad[_0x029b('0x42')]);_0x3d131e[_0x029b('0x43')]=_['intersection'](_0x3d131e['model'],_0x3d131e[_0x029b('0x42')]);_0x43aba7['attributes']=_[_0x029b('0x44')](_0x3d131e[_0x029b('0x40')],qs[_0x029b('0x46')](_0x786bad[_0x029b('0x42')][_0x029b('0x46')]));_0x43aba7[_0x029b('0x45')]=_0x43aba7['attributes']['length']?_0x43aba7[_0x029b('0x45')]:_0x3d131e[_0x029b('0x40')];if(_0x786bad[_0x029b('0x42')][_0x029b('0x55')]){_0x43aba7['include']=[{'all':!![]}];}_0x43aba7=_[_0x029b('0x4d')]({},_0x43aba7,_0x786bad[_0x029b('0x56')]);return db['FaxAccount']['find'](_0x43aba7)[_0x029b('0x1d')](handleEntityNotFound(_0x2fb0a0,null))['then'](respondWithResult(_0x2fb0a0,null))[_0x029b('0x27')](handleError(_0x2fb0a0,null));};exports[_0x029b('0x57')]=function(_0x364bbf,_0x13f280){return db[_0x029b('0x50')][_0x029b('0x57')](_0x364bbf[_0x029b('0x58')],{})['then'](function(_0x2fe8b1){var _0x3d3df0=_0x364bbf[_0x029b('0x59')][_0x029b('0x34')]({'plain':!![]});if(!_0x3d3df0)throw new Error(_0x029b('0x5a'));if(_0x3d3df0[_0x029b('0x5b')]===_0x029b('0x59')){var _0x4a5597=_0x2fe8b1[_0x029b('0x34')]({'plain':!![]});var _0x27cb9e=_0x029b('0x5c');return db[_0x029b('0x5d')]['find']({'where':{'name':_0x27cb9e,'userProfileId':_0x3d3df0['userProfileId']},'raw':!![]})[_0x029b('0x1d')](function(_0x3f522){if(_0x3f522&&_0x3f522[_0x029b('0x5e')]===0x0){return db[_0x029b('0x35')][_0x029b('0x57')]({'name':_0x4a5597[_0x029b('0x37')],'resourceId':_0x4a5597['id'],'type':_0x3f522[_0x029b('0x37')],'sectionId':_0x3f522['id']},{})[_0x029b('0x1d')](function(){return _0x2fe8b1;});}else{return _0x2fe8b1;}})[_0x029b('0x27')](function(_0x2ec975){logger[_0x029b('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2ec975);throw _0x2ec975;});}return _0x2fe8b1;})[_0x029b('0x1d')](respondWithResult(_0x13f280,0xc9))[_0x029b('0x27')](handleError(_0x13f280,null));};exports[_0x029b('0x32')]=function(_0x2875f0,_0x16f328){if(_0x2875f0[_0x029b('0x58')]['id']){delete _0x2875f0[_0x029b('0x58')]['id'];}return db[_0x029b('0x50')][_0x029b('0x5f')]({'where':{'id':_0x2875f0[_0x029b('0x60')]['id']},'include':[{'model':db[_0x029b('0x3a')],'as':_0x029b('0x3b')}]})[_0x029b('0x1d')](handleEntityNotFound(_0x16f328,null))['then'](saveUpdates(_0x2875f0[_0x029b('0x58')],null))[_0x029b('0x1d')](respondWithResult(_0x16f328,null))[_0x029b('0x27')](handleError(_0x16f328,null));};exports[_0x029b('0x33')]=function(_0x25ab28,_0x493320){return db[_0x029b('0x50')][_0x029b('0x5f')]({'where':{'id':_0x25ab28[_0x029b('0x60')]['id']}})[_0x029b('0x1d')](handleEntityNotFound(_0x493320,null))['then'](removeEntity(_0x493320,null))[_0x029b('0x27')](handleError(_0x493320,null));};exports['describe']=function(_0x1c8813,_0x5a5533){return db['FaxAccount'][_0x029b('0x61')]()[_0x029b('0x1d')](respondWithResult(_0x5a5533,null))[_0x029b('0x27')](handleError(_0x5a5533,null));};exports['addDisposition']=function(_0x1572c8,_0x4ffe66,_0x234d3d){if(_0x1572c8[_0x029b('0x58')]['id']){delete _0x1572c8[_0x029b('0x58')]['id'];}return db[_0x029b('0x50')][_0x029b('0x5f')]({'where':{'id':_0x1572c8[_0x029b('0x60')]['id']}})[_0x029b('0x1d')](handleEntityNotFound(_0x4ffe66,null))['then'](function(_0x2c4b19){if(_0x2c4b19){_0x1572c8[_0x029b('0x58')][_0x029b('0x62')]=_0x2c4b19['id'];return db[_0x029b('0x63')][_0x029b('0x57')](_0x1572c8['body']);}})[_0x029b('0x1d')](respondWithResult(_0x4ffe66,null))['catch'](handleError(_0x4ffe66,null));};exports['getDispositions']=function(_0x3c48e2,_0x3d8ed0,_0x322c23){var _0x4a0e48={'raw':![],'where':{}};var _0x36f8b6={};var _0x2e04e2={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0x3c48e2[_0x029b('0x60')]['id']}})[_0x029b('0x1d')](handleEntityNotFound(_0x3d8ed0,null))['then'](function(_0x151426){if(_0x151426){_0x36f8b6[_0x029b('0x40')]=_[_0x029b('0x41')](db['Disposition']['rawAttributes']);_0x36f8b6[_0x029b('0x42')]=_[_0x029b('0x41')](_0x3c48e2[_0x029b('0x42')]);_0x36f8b6[_0x029b('0x43')]=_['intersection'](_0x36f8b6[_0x029b('0x40')],_0x36f8b6[_0x029b('0x42')]);_0x4a0e48['attributes']=_['intersection'](_0x36f8b6['model'],qs[_0x029b('0x46')](_0x3c48e2[_0x029b('0x42')][_0x029b('0x46')]));_0x4a0e48[_0x029b('0x45')]=_0x4a0e48[_0x029b('0x45')]['length']?_0x4a0e48[_0x029b('0x45')]:_0x36f8b6[_0x029b('0x40')];if(!_0x3c48e2[_0x029b('0x42')][_0x029b('0x47')](_0x029b('0x48'))){_0x4a0e48['limit']=qs[_0x029b('0x2d')](_0x3c48e2['query'][_0x029b('0x2d')]);_0x4a0e48[_0x029b('0x2b')]=qs[_0x029b('0x2b')](_0x3c48e2['query'][_0x029b('0x2b')]);}_0x4a0e48[_0x029b('0x49')]=qs[_0x029b('0x4a')](_0x3c48e2[_0x029b('0x42')]['sort']);_0x4a0e48[_0x029b('0x4b')]=qs[_0x029b('0x43')](_[_0x029b('0x4c')](_0x3c48e2[_0x029b('0x42')],_0x36f8b6[_0x029b('0x43')]));_0x4a0e48['where'][_0x029b('0x62')]=_0x151426['id'];if(_0x3c48e2[_0x029b('0x42')][_0x029b('0x64')]){_0x4a0e48[_0x029b('0x4b')]=_[_0x029b('0x4d')](_0x4a0e48[_0x029b('0x4b')],{'$or':_[_0x029b('0x3c')](_0x4a0e48[_0x029b('0x45')],function(_0x2faea5){var _0x16dcf9={};_0x16dcf9[_0x2faea5]={'$like':'%'+_0x3c48e2[_0x029b('0x42')][_0x029b('0x64')]+'%'};return _0x16dcf9;})});}_0x4a0e48=_['merge']({},_0x4a0e48,_0x3c48e2['options']);return db['Disposition'][_0x029b('0x2e')]({'where':_0x4a0e48[_0x029b('0x4b')]})[_0x029b('0x1d')](function(_0x566d17){_0x2e04e2[_0x029b('0x2e')]=_0x566d17;if(_0x3c48e2[_0x029b('0x42')]['includeAll']){_0x4a0e48[_0x029b('0x51')]=[{'all':!![]}];}return db[_0x029b('0x63')]['findAll'](_0x4a0e48);})[_0x029b('0x1d')](function(_0x3c1079){_0x2e04e2[_0x029b('0x53')]=_0x3c1079;return _0x2e04e2;});}})[_0x029b('0x1d')](respondWithFilteredResult(_0x3d8ed0,_0x4a0e48))[_0x029b('0x27')](handleError(_0x3d8ed0,null));};exports[_0x029b('0x65')]=function(_0x5cd9bf,_0xc9303b,_0x56a699){return db[_0x029b('0x50')][_0x029b('0x5f')]({'where':{'id':_0x5cd9bf[_0x029b('0x60')]['id']}})[_0x029b('0x1d')](handleEntityNotFound(_0xc9303b,null))['then'](function(_0x39f3f1){if(_0x39f3f1){return _0x39f3f1[_0x029b('0x65')](_0x5cd9bf[_0x029b('0x42')][_0x029b('0x66')]);}})['then'](respondWithStatusCode(_0xc9303b,null))[_0x029b('0x27')](handleError(_0xc9303b,null));};exports[_0x029b('0x67')]=function(_0xb4fa79,_0x3914b9,_0x4a5b27){if(_0xb4fa79[_0x029b('0x58')]['id']){delete _0xb4fa79[_0x029b('0x58')]['id'];}return db[_0x029b('0x50')]['find']({'where':{'id':_0xb4fa79[_0x029b('0x60')]['id']}})[_0x029b('0x1d')](handleEntityNotFound(_0x3914b9,null))[_0x029b('0x1d')](function(_0x342a8d){if(_0x342a8d){_0xb4fa79[_0x029b('0x58')]['FaxAccountId']=_0x342a8d['id'];return db[_0x029b('0x68')]['create'](_0xb4fa79[_0x029b('0x58')]);}})['then'](respondWithResult(_0x3914b9,null))['catch'](handleError(_0x3914b9,null));};exports['getAnswers']=function(_0x477411,_0x191d8c,_0x2724a9){var _0x142305={'raw':![],'where':{}};var _0x4f77b0={};var _0x3379da={'count':0x0,'rows':[]};return db[_0x029b('0x50')][_0x029b('0x69')]({'where':{'id':_0x477411[_0x029b('0x60')]['id']}})[_0x029b('0x1d')](handleEntityNotFound(_0x191d8c,null))[_0x029b('0x1d')](function(_0x15420b){if(_0x15420b){_0x4f77b0['model']=_['keys'](db[_0x029b('0x68')]['rawAttributes']);_0x4f77b0[_0x029b('0x42')]=_['keys'](_0x477411[_0x029b('0x42')]);_0x4f77b0[_0x029b('0x43')]=_[_0x029b('0x44')](_0x4f77b0['model'],_0x4f77b0[_0x029b('0x42')]);_0x142305['attributes']=_[_0x029b('0x44')](_0x4f77b0['model'],qs[_0x029b('0x46')](_0x477411[_0x029b('0x42')][_0x029b('0x46')]));_0x142305[_0x029b('0x45')]=_0x142305[_0x029b('0x45')][_0x029b('0x6a')]?_0x142305[_0x029b('0x45')]:_0x4f77b0['model'];if(!_0x477411['query'][_0x029b('0x47')](_0x029b('0x48'))){_0x142305[_0x029b('0x2d')]=qs[_0x029b('0x2d')](_0x477411['query']['limit']);_0x142305[_0x029b('0x2b')]=qs['offset'](_0x477411[_0x029b('0x42')][_0x029b('0x2b')]);}_0x142305[_0x029b('0x49')]=qs[_0x029b('0x4a')](_0x477411['query']['sort']);_0x142305[_0x029b('0x4b')]=qs[_0x029b('0x43')](_[_0x029b('0x4c')](_0x477411['query'],_0x4f77b0[_0x029b('0x43')]));_0x142305[_0x029b('0x4b')][_0x029b('0x62')]=_0x15420b['id'];if(_0x477411[_0x029b('0x42')][_0x029b('0x64')]){_0x142305['where']=_[_0x029b('0x4d')](_0x142305[_0x029b('0x4b')],{'$or':_[_0x029b('0x3c')](_0x142305[_0x029b('0x45')],function(_0x5cf980){var _0x752306={};_0x752306[_0x5cf980]={'$like':'%'+_0x477411[_0x029b('0x42')]['filter']+'%'};return _0x752306;})});}_0x142305=_[_0x029b('0x4d')]({},_0x142305,_0x477411[_0x029b('0x56')]);return db['CannedAnswer'][_0x029b('0x2e')]({'where':_0x142305[_0x029b('0x4b')]})[_0x029b('0x1d')](function(_0x56ab29){_0x3379da['count']=_0x56ab29;if(_0x477411['query']['includeAll']){_0x142305[_0x029b('0x51')]=[{'all':!![]}];}return db[_0x029b('0x68')][_0x029b('0x52')](_0x142305);})[_0x029b('0x1d')](function(_0x2902f6){_0x3379da[_0x029b('0x53')]=_0x2902f6;return _0x3379da;});}})[_0x029b('0x1d')](respondWithFilteredResult(_0x191d8c,_0x142305))[_0x029b('0x27')](handleError(_0x191d8c,null));};exports[_0x029b('0x6b')]=function(_0x16753f,_0x3d9c0b,_0x3b8227){return db[_0x029b('0x50')][_0x029b('0x5f')]({'where':{'id':_0x16753f[_0x029b('0x60')]['id']}})[_0x029b('0x1d')](handleEntityNotFound(_0x3d9c0b,null))[_0x029b('0x1d')](function(_0x4b19c5){if(_0x4b19c5){return _0x4b19c5[_0x029b('0x6b')](_0x16753f['query']['ids']);}})[_0x029b('0x1d')](respondWithStatusCode(_0x3d9c0b,null))[_0x029b('0x27')](handleError(_0x3d9c0b,null));};exports[_0x029b('0x6c')]=function(_0x38dc32,_0x265f4e,_0x3214b2){return db[_0x029b('0x6d')][_0x029b('0x5f')]({'where':{'id':_0x38dc32[_0x029b('0x60')]['id']}})['then'](handleEntityNotFound(_0x265f4e,null))[_0x029b('0x1d')](function(_0x11a043){if(_0x11a043){return _0x11a043[_0x029b('0x6c')](_0x38dc32[_0x029b('0x58')][_0x029b('0x66')],_['omit'](_0x38dc32[_0x029b('0x58')],['ids','id'])||{});}})[_0x029b('0x1d')](respondWithResult(_0x265f4e,null))[_0x029b('0x27')](handleError(_0x265f4e,null));};exports[_0x029b('0x6e')]=function(_0x2c8625,_0x4ed7f6,_0x107d95){var _0x14b0a1={'raw':![],'where':{}};var _0x6f8765={};var _0x56f37f={'count':0x0,'rows':[]};return db[_0x029b('0x50')]['findOne']({'where':{'id':_0x2c8625[_0x029b('0x60')]['id']}})[_0x029b('0x1d')](handleEntityNotFound(_0x4ed7f6,null))['then'](function(_0x383576){if(_0x383576){_0x6f8765[_0x029b('0x40')]=_[_0x029b('0x41')](db[_0x029b('0x6d')][_0x029b('0x3d')]);_0x6f8765[_0x029b('0x42')]=_['keys'](_0x2c8625['query']);_0x6f8765[_0x029b('0x43')]=_[_0x029b('0x44')](_0x6f8765[_0x029b('0x40')],_0x6f8765[_0x029b('0x42')]);_0x14b0a1['attributes']=_[_0x029b('0x44')](_0x6f8765[_0x029b('0x40')],qs[_0x029b('0x46')](_0x2c8625[_0x029b('0x42')][_0x029b('0x46')]));_0x14b0a1[_0x029b('0x45')]=_0x14b0a1[_0x029b('0x45')]['length']?_0x14b0a1[_0x029b('0x45')]:_0x6f8765[_0x029b('0x40')];if(!_0x2c8625[_0x029b('0x42')][_0x029b('0x47')]('nolimit')){_0x14b0a1[_0x029b('0x2d')]=qs[_0x029b('0x2d')](_0x2c8625[_0x029b('0x42')][_0x029b('0x2d')]);_0x14b0a1[_0x029b('0x2b')]=qs[_0x029b('0x2b')](_0x2c8625[_0x029b('0x42')]['offset']);}_0x14b0a1[_0x029b('0x49')]=qs['sort'](_0x2c8625['query'][_0x029b('0x4a')]);_0x14b0a1[_0x029b('0x4b')]=qs[_0x029b('0x43')](_[_0x029b('0x4c')](_0x2c8625[_0x029b('0x42')],_0x6f8765['filters']));_0x14b0a1[_0x029b('0x4b')]['FaxAccountId']=_0x383576['id'];if(_0x2c8625[_0x029b('0x42')][_0x029b('0x64')]){_0x14b0a1[_0x029b('0x4b')]=_[_0x029b('0x4d')](_0x14b0a1[_0x029b('0x4b')],{'$or':_[_0x029b('0x3c')](_0x14b0a1[_0x029b('0x45')],function(_0xd73175){var _0x581275={};_0x581275[_0xd73175]={'$like':'%'+_0x2c8625['query'][_0x029b('0x64')]+'%'};return _0x581275;})});}_0x14b0a1=_[_0x029b('0x4d')]({},_0x14b0a1,_0x2c8625[_0x029b('0x56')]);return db[_0x029b('0x6d')][_0x029b('0x2e')]({'where':_0x14b0a1['where']})[_0x029b('0x1d')](function(_0x4ede2a){_0x56f37f['count']=_0x4ede2a;if(_0x2c8625['query'][_0x029b('0x55')]){_0x14b0a1[_0x029b('0x51')]=[{'model':db[_0x029b('0x6f')],'as':_0x029b('0x70'),'required':![]},{'model':db[_0x029b('0x71')],'as':'Owner','attributes':[_0x029b('0x37'),_0x029b('0x72'),_0x029b('0x73')],'required':![]},{'model':db['Tag'],'as':_0x029b('0x74'),'attributes':['id',_0x029b('0x37'),_0x029b('0x75')],'where':_0x2c8625[_0x029b('0x42')][_0x029b('0x76')]?{'id':_0x2c8625['query'][_0x029b('0x76')]}:undefined,'required':_0x2c8625[_0x029b('0x42')][_0x029b('0x76')]?!![]:![]}];}return db[_0x029b('0x6d')][_0x029b('0x52')](_0x14b0a1);})[_0x029b('0x1d')](function(_0x10f39e){_0x56f37f['rows']=_0x10f39e;return _0x56f37f;});}})['then'](respondWithFilteredResult(_0x4ed7f6,_0x14b0a1))['catch'](handleError(_0x4ed7f6,null));};exports[_0x029b('0x77')]=function(_0x29df33,_0xaa2c19,_0x31cfd7){return db[_0x029b('0x50')][_0x029b('0x69')]({'where':{'id':_0x29df33[_0x029b('0x60')]['id']}})[_0x029b('0x1d')](handleEntityNotFound(_0xaa2c19,null))[_0x029b('0x1d')](function(_0x4b7eeb){if(_0x4b7eeb){return db['sequelize'][_0x029b('0x78')](function(_0x105528){return db[_0x029b('0x79')][_0x029b('0x33')]({'where':{'FaxAccountId':_0x29df33[_0x029b('0x60')]['id']},'transaction':_0x105528})['then'](function(_0xd26161){var _0x77c6cd=_[_0x029b('0x3c')](_0x29df33[_0x029b('0x58')],function(_0x4f6ddd){_0x4f6ddd[_0x029b('0x62')]=_0x29df33[_0x029b('0x60')]['id'];return _0x4f6ddd;});return db['FaxApplication'][_0x029b('0x7a')](_0x77c6cd,{'transaction':_0x105528});});})[_0x029b('0x1d')](function(){return db[_0x029b('0x79')]['findAndCountAll']({'where':{'FaxAccountId':_0x29df33['params']['id']},'order':'priority'});});}})[_0x029b('0x1d')](respondWithResult(_0xaa2c19,null))[_0x029b('0x27')](handleError(_0xaa2c19,null));};exports['getApplications']=function(_0x240f23,_0x1489d3,_0x56fdee){var _0x4e7994={};var _0x1f078c={};var _0x5b0faf;var _0x482811;return db[_0x029b('0x50')][_0x029b('0x69')]({'where':{'id':_0x240f23[_0x029b('0x60')]['id']}})[_0x029b('0x1d')](handleEntityNotFound(_0x1489d3,null))[_0x029b('0x1d')](function(_0x125022){if(_0x125022){_0x5b0faf=_0x125022;_0x1f078c[_0x029b('0x40')]=_[_0x029b('0x41')](db['FaxApplication']['rawAttributes']);_0x1f078c[_0x029b('0x42')]=_['keys'](_0x240f23[_0x029b('0x42')]);_0x1f078c[_0x029b('0x43')]=_[_0x029b('0x44')](_0x1f078c['model'],_0x1f078c[_0x029b('0x42')]);_0x4e7994[_0x029b('0x45')]=_[_0x029b('0x44')](_0x1f078c[_0x029b('0x40')],qs[_0x029b('0x46')](_0x240f23[_0x029b('0x42')][_0x029b('0x46')]));_0x4e7994[_0x029b('0x45')]=_0x4e7994['attributes'][_0x029b('0x6a')]?_0x4e7994['attributes']:_0x1f078c[_0x029b('0x40')];_0x4e7994['order']=qs[_0x029b('0x4a')](_0x240f23[_0x029b('0x42')][_0x029b('0x4a')]);_0x4e7994['where']=qs[_0x029b('0x43')](_[_0x029b('0x4c')](_0x240f23[_0x029b('0x42')],_0x1f078c[_0x029b('0x43')]));if(_0x240f23['query'][_0x029b('0x64')]){_0x4e7994[_0x029b('0x4b')]=_[_0x029b('0x4d')](_0x4e7994[_0x029b('0x4b')],{'$or':_[_0x029b('0x3c')](_0x4e7994[_0x029b('0x45')],function(_0xec3cbb){var _0x2cfb00={};_0x2cfb00[_0xec3cbb]={'$like':'%'+_0x240f23[_0x029b('0x42')][_0x029b('0x64')]+'%'};return _0x2cfb00;})});}_0x4e7994=_['merge']({},_0x4e7994,_0x240f23[_0x029b('0x56')]);return _0x5b0faf[_0x029b('0x7b')](_0x4e7994);}})[_0x029b('0x1d')](function(_0x24cb51){if(_0x24cb51){_0x482811=_0x24cb51[_0x029b('0x6a')];if(!_0x240f23[_0x029b('0x42')][_0x029b('0x47')](_0x029b('0x48'))){_0x4e7994[_0x029b('0x2d')]=qs[_0x029b('0x2d')](_0x240f23[_0x029b('0x42')][_0x029b('0x2d')]);_0x4e7994[_0x029b('0x2b')]=qs['offset'](_0x240f23[_0x029b('0x42')][_0x029b('0x2b')]);}return _0x5b0faf[_0x029b('0x7b')](_0x4e7994);}})['then'](function(_0x1228e6){if(_0x1228e6){return _0x1228e6?{'count':_0x482811,'rows':_0x1228e6}:null;}})[_0x029b('0x1d')](respondWithResult(_0x1489d3,null))[_0x029b('0x27')](handleError(_0x1489d3,null));};function Extension(_0x1e44a6,_0x256cb3,_0x37dc8b,_0x1e434b){this[_0x029b('0x7c')]='from-voip-provider';this[_0x029b('0x7d')]=_0x1e44a6[_0x029b('0x7e')];this[_0x029b('0x7f')]=_0x1e434b;this[_0x029b('0x4e')]='system';this[_0x029b('0x80')]=_0x029b('0x81');this['FaxAccountId']=_0x1e44a6['id'];this[_0x029b('0x82')]=_0x256cb3;this['appdata']=_0x37dc8b;}function createExtensionsReciveFax(_0x2997c3){var _0x750375=0x1;var _0x16e494=[];_0x16e494[_0x029b('0x83')](new Extension(_0x2997c3,_0x750375,'','Answer'));_0x750375+=0x1;_0x16e494['push'](new Extension(_0x2997c3,_0x750375,_0x029b('0x84'),_0x029b('0x85')));_0x750375+=0x1;for(var _0x3c5a83 in _0x2997c3){if(_0x2997c3[_0x029b('0x47')](_0x3c5a83)&&(_0x3c5a83===_0x029b('0x86')||_0x3c5a83===_0x029b('0x7e')||_0x3c5a83===_0x029b('0x87')||_0x3c5a83===_0x029b('0x88')||_0x3c5a83==='headerinfo'||_0x3c5a83===_0x029b('0x89')||_0x3c5a83===_0x029b('0x8a')||_0x3c5a83===_0x029b('0x8b')||_0x3c5a83===_0x029b('0x8c'))){_0x16e494[_0x029b('0x83')](new Extension(_0x2997c3,_0x750375,_0x029b('0x8d')+_0x3c5a83+')='+_0x2997c3[_0x3c5a83],_0x029b('0x85')));_0x750375+=0x1;}}_0x16e494[_0x029b('0x83')](new Extension(_0x2997c3,_0x750375,'6','Wait'));_0x750375+=0x1;_0x16e494[_0x029b('0x83')](new Extension(_0x2997c3,_0x750375,_0x029b('0x8e'),_0x029b('0x8f')));_0x750375=0x0;return _0x16e494;}exports[_0x029b('0x90')]=function(_0x2ccdee,_0x41f449,_0x2bffba){var _0x9bd282;return db[_0x029b('0x91')]['transaction'](function(_0x38db25){return db[_0x029b('0x50')][_0x029b('0x57')](_0x2ccdee[_0x029b('0x58')],{'transaction':_0x38db25})[_0x029b('0x1d')](function(_0x48c26e){_0x9bd282=_0x48c26e[_0x029b('0x34')]({'plain':!![]});return db['VoiceExtension']['bulkCreate'](createExtensionsReciveFax(_0x9bd282),{'transaction':_0x38db25});});})[_0x029b('0x1d')](function(){return _0x9bd282;})['then'](respondWithResult(_0x41f449,null))[_0x029b('0x27')](handleError(_0x41f449,null));};exports[_0x029b('0x92')]=function(_0x53f1bc,_0x30c19c,_0x302483){var _0xd09801;return db[_0x029b('0x91')]['transaction'](function(_0x445ca0){return db['FaxAccount'][_0x029b('0x32')](_0x53f1bc[_0x029b('0x58')],{'where':{'id':_0x53f1bc[_0x029b('0x58')]['id']},'transaction':_0x445ca0})['then'](function(_0x32e7fe){return db[_0x029b('0x93')]['destroy']({'where':{'FaxAccountId':_0x53f1bc['body']['id']},'transaction':_0x445ca0})['then'](function(_0x1c3ee5){return db[_0x029b('0x93')]['bulkCreate'](createExtensionsReciveFax(_['omit'](_0x53f1bc[_0x029b('0x58')],[_0x029b('0x94'),_0x029b('0x3f'),'createdAt',_0x029b('0x95'),_0x029b('0x96'),_0x029b('0x97')])),{'transaction':_0x445ca0});});});})[_0x029b('0x1d')](function(){return db[_0x029b('0x50')][_0x029b('0x98')](_0x53f1bc[_0x029b('0x58')]['id']);})[_0x029b('0x1d')](respondWithResult(_0x30c19c,null))[_0x029b('0x27')](handleError(_0x30c19c,null));};exports[_0x029b('0x99')]=function(_0x401efc,_0x49d7df,_0x4213c3){var _0x4488d7={'raw':!![],'where':{}};var _0x28a640={};var _0x44d849={'count':0x0,'rows':[]};return db[_0x029b('0x50')]['findOne']({'where':{'id':_0x401efc[_0x029b('0x60')]['id']}})['then'](handleEntityNotFound(_0x49d7df,null))[_0x029b('0x1d')](function(_0x1dcd19){if(_0x1dcd19){_0x28a640[_0x029b('0x40')]=_[_0x029b('0x41')](db['FaxMessage'][_0x029b('0x3d')]);_0x28a640['query']=_[_0x029b('0x41')](_0x401efc[_0x029b('0x42')]);_0x28a640['filters']=_[_0x029b('0x44')](_0x28a640['model'],_0x28a640[_0x029b('0x42')]);_0x4488d7[_0x029b('0x45')]=_[_0x029b('0x44')](_0x28a640[_0x029b('0x40')],qs[_0x029b('0x46')](_0x401efc[_0x029b('0x42')][_0x029b('0x46')]));_0x4488d7[_0x029b('0x45')]=_0x4488d7[_0x029b('0x45')][_0x029b('0x6a')]?_0x4488d7['attributes']:_0x28a640['model'];if(!_0x401efc['query'][_0x029b('0x47')](_0x029b('0x48'))){_0x4488d7[_0x029b('0x2d')]=qs[_0x029b('0x2d')](_0x401efc['query'][_0x029b('0x2d')]);_0x4488d7['offset']=qs[_0x029b('0x2b')](_0x401efc[_0x029b('0x42')][_0x029b('0x2b')]);}_0x4488d7[_0x029b('0x49')]=qs[_0x029b('0x4a')](_0x401efc[_0x029b('0x42')][_0x029b('0x4a')]);_0x4488d7[_0x029b('0x4b')]=qs[_0x029b('0x43')](_[_0x029b('0x4c')](_0x401efc[_0x029b('0x42')],_0x28a640[_0x029b('0x43')]));_0x4488d7[_0x029b('0x4b')]['FaxAccountId']=_0x1dcd19['id'];if(_0x401efc[_0x029b('0x42')]['filter']){_0x4488d7['where']=_[_0x029b('0x4d')](_0x4488d7['where'],{'$or':_['map'](_0x4488d7[_0x029b('0x45')],function(_0x4d962b){var _0x50837e={};_0x50837e[_0x4d962b]={'$like':'%'+_0x401efc[_0x029b('0x42')][_0x029b('0x64')]+'%'};return _0x50837e;})});}if(_0x401efc['query'][_0x029b('0x9a')]){var _0x304f29=_0x401efc['query'][_0x029b('0x9a')][_0x029b('0x9b')](',');var _0x488e73={};_0x488e73[_0x304f29[0x0]]={'$gte':moment(_0x304f29[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x4488d7['where']=_[_0x029b('0x4d')](_0x4488d7['where'],_0x488e73);}_0x4488d7=_[_0x029b('0x4d')]({},_0x4488d7,_0x401efc['options']);return db['FaxMessage'][_0x029b('0x2e')]({'where':_0x4488d7[_0x029b('0x4b')]})['then'](function(_0x2ea49f){_0x44d849['count']=_0x2ea49f;if(_0x401efc[_0x029b('0x42')][_0x029b('0x55')]){_0x4488d7[_0x029b('0x51')]=[{'all':!![]}];}return db[_0x029b('0x9c')][_0x029b('0x52')](_0x4488d7);})[_0x029b('0x1d')](function(_0x5ea396){_0x44d849[_0x029b('0x53')]=_0x5ea396;return _0x44d849;});}})['then'](respondWithFilteredResult(_0x49d7df,_0x4488d7))['catch'](handleError(_0x49d7df,null));};exports[_0x029b('0x38')]=function(_0x32548e,_0x26eef6,_0x3d9f45){var _0x496c36,_0x41193e={},_0x32fd85;if(_0x32548e[_0x029b('0x58')]['to']){_0x32fd85=_0x32548e[_0x029b('0x58')]['to'][0x0];}return db[_0x029b('0x50')][_0x029b('0x5f')]({'where':{'id':_0x32548e['params']['id']},'include':[{'model':db['CmList'],'as':_0x029b('0x9d'),'include':[{'model':db[_0x029b('0x6f')],'as':_0x029b('0x9e'),'where':{'fax':_0x32fd85},'limit':0x1,'order':[[_0x029b('0x95'),_0x029b('0x9f')]]}]}]})[_0x029b('0x1d')](handleEntityNotFound(_0x26eef6,null))[_0x029b('0x1d')](function(_0x304d12){_0x496c36=_0x304d12;if(_0x32548e['body'][_0x029b('0xa0')]&&_0x32548e[_0x029b('0x58')]['attachments']['length']){for(var _0x5a83e7=0x0;_0x5a83e7<_0x32548e[_0x029b('0x58')]['attachments']['length'];_0x5a83e7+=0x1){_0x32548e[_0x029b('0x58')][_0x029b('0xa0')][_0x5a83e7]={'filename':_0x32548e[_0x029b('0x58')][_0x029b('0xa0')][_0x5a83e7]['name'],'id':_0x32548e[_0x029b('0x58')][_0x029b('0xa0')][_0x5a83e7]['id'],'path':path['join'](config[_0x029b('0xa1')],'server/files/attachments',_0x32548e[_0x029b('0x58')]['attachments'][_0x5a83e7]['basename'])};}}return respondWithRpcPromise(_0x029b('0xa2'),_0x029b('0xa2'),{'FaxAccountId':_[_0x029b('0xa3')](_0x32548e[_0x029b('0x60')]['id'])?undefined:_0x32548e[_0x029b('0x60')]['id'],'path':_[_0x029b('0xa3')](_0x32548e[_0x029b('0x58')][_0x029b('0xa0')][0x0][_0x029b('0x5')])?undefined:_0x32548e[_0x029b('0x58')][_0x029b('0xa0')][0x0][_0x029b('0x5')],'fax':_[_0x029b('0xa3')](_0x32548e[_0x029b('0x58')]['to'][0x0])?undefined:_0x32548e['body']['to'][0x0]},client9002);})['then'](function(){if(_0x496c36){if(_[_0x029b('0xa3')](_0x32548e['body'][_0x029b('0xa4')])){_0x32548e[_0x029b('0x58')][_0x029b('0xa4')]=util[_0x029b('0xa5')]('\x22%s\x22\x20<%s>',_0x496c36[_0x029b('0x37')],_0x496c36[_0x029b('0xa6')]);}if(_0x496c36[_0x029b('0x9d')]){if(_0x496c36['List'][_0x029b('0x9e')][_0x029b('0x6a')]){return _0x496c36[_0x029b('0x9d')][_0x029b('0x9e')][0x0];}else{return db[_0x029b('0x6f')][_0x029b('0x57')](_[_0x029b('0xa7')](_0x32548e[_0x029b('0x58')],{'firstName':_0x32548e[_0x029b('0x58')]['to'][0x0],'phone':_0x32548e[_0x029b('0x58')]['to'][0x0],'fax':_0x32548e[_0x029b('0x58')]['to'][0x0],'ListId':_0x496c36[_0x029b('0x97')]}));}}else{throw new Error('List\x20not\x20found');}}else{throw new Error(_0x029b('0xa8'));}})[_0x029b('0x1d')](function(_0x22a27d){if(_0x22a27d){return db[_0x029b('0x6d')][_0x029b('0x5f')]({'where':{'ContactId':_0x22a27d['id'],'closed':![],'FaxAccountId':_0x496c36['id']}})[_0x029b('0x1d')](function(_0x3c0741){if(_0x3c0741){return[_0x3c0741,![]];}return db[_0x029b('0x6d')]['create']({'UserId':_0x32548e[_0x029b('0x59')]['id'],'ContactId':_0x22a27d['id'],'FaxAccountId':_0x496c36['id'],'fax':_0x32548e[_0x029b('0x58')]['to'][0x0],'firstMsgDirection':'out','Messages':[_[_0x029b('0x4d')](_0x32548e[_0x029b('0x58')],{'read':![],'body':_0x32548e[_0x029b('0x58')][_0x029b('0xa0')][0x0][_0x029b('0xa9')],'FaxAccountId':_0x496c36['id'],'UserId':_0x32548e[_0x029b('0x59')]['id'],'ContactId':_0x22a27d['id'],'AttachmentId':_0x32548e[_0x029b('0x58')][_0x029b('0xa0')][0x0]['id']})]},{'include':[{'model':db[_0x029b('0x9c')],'as':'Messages'}]})['then'](function(_0x3279c7){return[_0x3279c7,!![]];});});}else{throw new Error(_0x029b('0xaa'));}})['spread'](function(_0x4cae68,_0x4a7f87){if(_0x4a7f87){return _0x4cae68;}return db['FaxMessage'][_0x029b('0x57')]({'direction':'out','read':![],'body':_0x32548e[_0x029b('0x58')][_0x029b('0xa0')][0x0][_0x029b('0xa9')],'FaxAccountId':_0x496c36['id'],'FaxInteractionId':_0x4cae68['id'],'UserId':_0x32548e[_0x029b('0x59')]['id'],'ContactId':_0x4cae68[_0x029b('0xab')],'AttachmentId':_0x32548e[_0x029b('0x58')]['attachments'][0x0]['id']})[_0x029b('0x1d')](function(_0x3ec5eb){_0x4cae68[_0x029b('0xac')][_0x029b('0xad')]=[];_0x4cae68[_0x029b('0xac')][_0x029b('0xad')][_0x029b('0x83')](_0x3ec5eb[_0x029b('0xac')]);return _0x4cae68;});})[_0x029b('0x1d')](function(_0x4715e4){respondWithRpcPromise('SendFax',_0x029b('0xae'),{'FaxAccountId':_['isNil'](_0x32548e[_0x029b('0x60')]['id'])?undefined:_0x32548e[_0x029b('0x60')]['id'],'path':_[_0x029b('0xa3')](_0x32548e['body'][_0x029b('0xa0')][0x0]['path'])?undefined:_0x32548e[_0x029b('0x58')][_0x029b('0xa0')][0x0][_0x029b('0x5')],'fax':_[_0x029b('0xa3')](_0x32548e[_0x029b('0x58')]['to'][0x0])?undefined:_0x32548e[_0x029b('0x58')]['to'][0x0],'AttachmentId':_0x32548e['body'][_0x029b('0xa0')][0x0]['id']},client9002)[_0x029b('0x1d')](function(_0x22fa83){logger[_0x029b('0x1e')](_0x029b('0xaf'),_0x22fa83);})[_0x029b('0x27')](function(_0x3b3b22){logger[_0x029b('0x1e')](_0x029b('0xaf'),_0x3b3b22);});return _0x4715e4;})[_0x029b('0x1d')](respondWithResult(_0x26eef6,null))[_0x029b('0x27')](handleError(_0x26eef6,null));};exports[_0x029b('0xb0')]=function(_0x2a3b3e,_0x280c8c,_0x673d58){return db['FaxAccount'][_0x029b('0x5f')]({'where':{'id':_0x2a3b3e[_0x029b('0x60')]['id']}})[_0x029b('0x1d')](handleEntityNotFound(_0x280c8c,null))[_0x029b('0x1d')](function(_0x1881df){if(_0x1881df){return _0x1881df[_0x029b('0xb0')](_0x2a3b3e['body'][_0x029b('0x66')],_[_0x029b('0xb1')](_0x2a3b3e[_0x029b('0x58')],[_0x029b('0x66'),'id'])||{})[_0x029b('0xb2')](function(_0x332beb){for(var _0x44101d=0x0;_0x44101d<_0x2a3b3e[_0x029b('0x58')][_0x029b('0x66')]['length'];_0x44101d+=0x1){socket[_0x029b('0xb3')](_0x029b('0xb4'),{'UserId':Number(_0x2a3b3e[_0x029b('0x58')][_0x029b('0x66')][_0x44101d]),'FaxAccountId':Number(_0x2a3b3e[_0x029b('0x60')]['id'])});}return _0x332beb;});}})['then'](respondWithResult(_0x280c8c,null))[_0x029b('0x27')](handleError(_0x280c8c,null));};exports[_0x029b('0xb5')]=function(_0x5c2940,_0x4388cb,_0x5a96bc){return db[_0x029b('0x50')][_0x029b('0x5f')]({'where':{'id':_0x5c2940[_0x029b('0x60')]['id']}})[_0x029b('0x1d')](handleEntityNotFound(_0x4388cb,null))[_0x029b('0x1d')](function(_0x559442){if(_0x559442){return _0x559442[_0x029b('0xb5')](_0x5c2940[_0x029b('0x42')]['ids'])[_0x029b('0x1d')](function(){if(_['isArray'](_0x5c2940[_0x029b('0x42')][_0x029b('0x66')])){for(var _0x247fac=0x0;_0x247fac<_0x5c2940[_0x029b('0x42')][_0x029b('0x66')]['length'];_0x247fac+=0x1){socket[_0x029b('0xb3')](_0x029b('0xb6'),{'UserId':Number(_0x5c2940[_0x029b('0x42')][_0x029b('0x66')][_0x247fac]),'FaxAccountId':Number(_0x5c2940[_0x029b('0x60')]['id'])});}}else{socket['emit'](_0x029b('0xb6'),{'UserId':Number(_0x5c2940['query'][_0x029b('0x66')]),'FaxAccountId':Number(_0x5c2940[_0x029b('0x60')]['id'])});}});}})[_0x029b('0x1d')](respondWithStatusCode(_0x4388cb,null))['catch'](handleError(_0x4388cb,null));};exports[_0x029b('0xb7')]=function(_0x172908,_0x35d49b,_0x5b68e9){var _0x4da64f={};var _0x32bb6d={};var _0xaf7581;var _0x5a7399;return db[_0x029b('0x50')]['findOne']({'where':{'id':_0x172908[_0x029b('0x60')]['id']}})['then'](handleEntityNotFound(_0x35d49b,null))[_0x029b('0x1d')](function(_0x226ffc){if(_0x226ffc){_0xaf7581=_0x226ffc;_0x32bb6d[_0x029b('0x40')]=_[_0x029b('0x41')](db[_0x029b('0x71')][_0x029b('0x3d')]);_0x32bb6d[_0x029b('0x42')]=_[_0x029b('0x41')](_0x172908[_0x029b('0x42')]);_0x32bb6d[_0x029b('0x43')]=_[_0x029b('0x44')](_0x32bb6d[_0x029b('0x40')],_0x32bb6d[_0x029b('0x42')]);_0x4da64f[_0x029b('0x45')]=_[_0x029b('0x44')](_0x32bb6d[_0x029b('0x40')],qs[_0x029b('0x46')](_0x172908[_0x029b('0x42')][_0x029b('0x46')]));_0x4da64f[_0x029b('0x45')]=_0x4da64f[_0x029b('0x45')][_0x029b('0x6a')]?_0x4da64f[_0x029b('0x45')]:_0x32bb6d[_0x029b('0x40')];_0x4da64f[_0x029b('0x49')]=qs['sort'](_0x172908[_0x029b('0x42')][_0x029b('0x4a')]);_0x4da64f[_0x029b('0x4b')]=qs[_0x029b('0x43')](_[_0x029b('0x4c')](_0x172908[_0x029b('0x42')],_0x32bb6d[_0x029b('0x43')]));if(_0x172908[_0x029b('0x42')][_0x029b('0x64')]){_0x4da64f[_0x029b('0x4b')]=_[_0x029b('0x4d')](_0x4da64f[_0x029b('0x4b')],{'$or':_[_0x029b('0x3c')](_0x4da64f[_0x029b('0x45')],function(_0x2c769b){var _0x323576={};_0x323576[_0x2c769b]={'$like':'%'+_0x172908[_0x029b('0x42')]['filter']+'%'};return _0x323576;})});}_0x4da64f=_['merge']({},_0x4da64f,_0x172908[_0x029b('0x56')]);return _0xaf7581[_0x029b('0xb7')](_0x4da64f);}})[_0x029b('0x1d')](function(_0x49a334){if(_0x49a334){_0x5a7399=_0x49a334[_0x029b('0x6a')];if(!_0x172908[_0x029b('0x42')][_0x029b('0x47')]('nolimit')){_0x4da64f['limit']=qs['limit'](_0x172908[_0x029b('0x42')]['limit']);_0x4da64f['offset']=qs[_0x029b('0x2b')](_0x172908['query'][_0x029b('0x2b')]);}return _0xaf7581[_0x029b('0xb7')](_0x4da64f);}})[_0x029b('0x1d')](function(_0x126cdd){if(_0x126cdd){return _0x126cdd?{'count':_0x5a7399,'rows':_0x126cdd}:null;}})['then'](respondWithResult(_0x35d49b,null))[_0x029b('0x27')](handleError(_0x35d49b,null));}; \ No newline at end of file +var _0xf46a=['ReceiveFax','addAccountApplications','VoiceExtension','updateAccountApplications','sequelize','tech','createdAt','updatedAt','findById','getMessages','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','List','Contacts','ListId','Send\x20Fax\x20failed','out','Messages','Contact\x20not\x20found','spread','filename','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','userFaxAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','register','client','http','request','then','info','FaxAccount,\x20%s,\x20%s','debug','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','sendStatus','status','end','offset','undefined','count','set','Content-Range','json','apply','reject','save','update','destroy','get','UserProfileResource','name','send','index','Pause','mandatoryDispositionPause','rawAttributes','fieldName','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','FaxAccount','findAll','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','describe','addDisposition','FaxAccountId','getDispositions','Disposition','rows','removeDispositions','addAnswer','CannedAnswer','findOne','removeAnswers','ids','addInteraction','FaxInteraction','omit','CmContact','Contact','User','Owner','fullname','internal','Tag','color','tag','addApplications','transaction','FaxApplication','bulkCreate','findAndCountAll','priority','getApplications','from-voip-provider','exten','localstationid','app','system','description','Fax\x20Extension','appdata','Answer','push','CDR(type)=inbound-fax','Set','ecm','gateway','maxrate','t38timeout','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d'];(function(_0x5227c4,_0x5d7483){var _0x1cea07=function(_0x207e8e){while(--_0x207e8e){_0x5227c4['push'](_0x5227c4['shift']());}};_0x1cea07(++_0x5d7483);}(_0xf46a,0xef));var _0xaf46=function(_0x289547,_0x82ec1b){_0x289547=_0x289547-0x0;var _0x54eb36=_0xf46a[_0x289547];return _0x54eb36;};'use strict';var emlformat=require(_0xaf46('0x0'));var rimraf=require(_0xaf46('0x1'));var zipdir=require(_0xaf46('0x2'));var jsonpatch=require(_0xaf46('0x3'));var rp=require(_0xaf46('0x4'));var moment=require(_0xaf46('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xaf46('0x6'));var util=require(_0xaf46('0x7'));var path=require(_0xaf46('0x8'));var sox=require(_0xaf46('0x9'));var csv=require(_0xaf46('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xaf46('0xb'));var _=require(_0xaf46('0xc'));var squel=require(_0xaf46('0xd'));var crypto=require(_0xaf46('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xaf46('0xf'));var toCsv=require(_0xaf46('0xa'));var querystring=require('querystring');var Papa=require(_0xaf46('0x10'));var Redis=require('ioredis');var authService=require(_0xaf46('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xaf46('0x12'));var hardwareService=require(_0xaf46('0x13'));var logger=require('../../config/logger')(_0xaf46('0x14'));var utils=require(_0xaf46('0x15'));var config=require(_0xaf46('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xaf46('0x17'))['db'];config[_0xaf46('0x18')]=_[_0xaf46('0x19')](config['redis'],{'host':_0xaf46('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xaf46('0x18')]));require('./faxAccount.socket')[_0xaf46('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0xaf46('0x1c')][_0xaf46('0x1d')]({'port':0x232c});var client9002=jayson[_0xaf46('0x1c')]['http']({'port':0x232a});function respondWithRpcPromise(_0x43db11,_0x22da54,_0x25d525,_0xa33ed0){return new BPromise(function(_0x254521,_0x2904f4){var _0x4cb06=_0xa33ed0||client;return _0x4cb06[_0xaf46('0x1e')](_0x43db11,_0x25d525)[_0xaf46('0x1f')](function(_0x1aa3ee){logger[_0xaf46('0x20')](_0xaf46('0x21'),_0x22da54,'request\x20sent');logger[_0xaf46('0x22')](_0xaf46('0x23'),_0x22da54,_0xaf46('0x24'),JSON[_0xaf46('0x25')](_0x1aa3ee));if(_0x1aa3ee['error']){if(_0x1aa3ee[_0xaf46('0x26')][_0xaf46('0x27')]===0x1f4){logger[_0xaf46('0x26')](_0xaf46('0x21'),_0x22da54,_0x1aa3ee[_0xaf46('0x26')]['message']);return _0x2904f4(_0x1aa3ee[_0xaf46('0x26')][_0xaf46('0x28')]);}logger[_0xaf46('0x26')]('FaxAccount,\x20%s,\x20%s',_0x22da54,_0x1aa3ee[_0xaf46('0x26')][_0xaf46('0x28')]);return _0x254521(_0x1aa3ee[_0xaf46('0x26')][_0xaf46('0x28')]);}else{logger[_0xaf46('0x20')](_0xaf46('0x21'),_0x22da54,_0xaf46('0x24'));_0x254521(_0x1aa3ee[_0xaf46('0x29')]['message']);}})['catch'](function(_0x23d1df){logger['error'](_0xaf46('0x21'),_0x22da54,_0x23d1df);_0x2904f4(_0x23d1df);});});}function respondWithStatusCode(_0x4b3712,_0x425aa9){_0x425aa9=_0x425aa9||0xcc;return function(_0x5f76b0){if(_0x5f76b0){return _0x4b3712[_0xaf46('0x2a')](_0x425aa9);}return _0x4b3712[_0xaf46('0x2b')](_0x425aa9)[_0xaf46('0x2c')]();};}function respondWithResult(_0x35800e,_0xf56d7a){_0xf56d7a=_0xf56d7a||0xc8;return function(_0x4d0e4d){if(_0x4d0e4d){return _0x35800e['status'](_0xf56d7a)['json'](_0x4d0e4d);}};}function respondWithFilteredResult(_0x8ae3dd,_0x183e38){return function(_0x1f6784){if(_0x1f6784){var _0x1ddb4d=typeof _0x183e38[_0xaf46('0x2d')]===_0xaf46('0x2e')&&typeof _0x183e38['limit']===_0xaf46('0x2e');var _0x587e25=_0x1f6784[_0xaf46('0x2f')];var _0x4ec3a2=_0x1ddb4d?0x0:_0x183e38[_0xaf46('0x2d')];var _0x3535b1=_0x1ddb4d?_0x1f6784[_0xaf46('0x2f')]:_0x183e38[_0xaf46('0x2d')]+_0x183e38['limit'];var _0x97f523;if(_0x3535b1>=_0x587e25){_0x3535b1=_0x587e25;_0x97f523=0xc8;}else{_0x97f523=0xce;}_0x8ae3dd[_0xaf46('0x2b')](_0x97f523);return _0x8ae3dd[_0xaf46('0x30')](_0xaf46('0x31'),_0x4ec3a2+'-'+_0x3535b1+'/'+_0x587e25)[_0xaf46('0x32')](_0x1f6784);}return null;};}function patchUpdates(_0x5371d4){return function(_0x2d6fbc){try{jsonpatch[_0xaf46('0x33')](_0x2d6fbc,_0x5371d4,!![]);}catch(_0x1a29f7){return BPromise[_0xaf46('0x34')](_0x1a29f7);}return _0x2d6fbc[_0xaf46('0x35')]();};}function saveUpdates(_0x5a60b4,_0x106c2b){return function(_0x3fd79f){if(_0x3fd79f){return _0x3fd79f[_0xaf46('0x36')](_0x5a60b4)[_0xaf46('0x1f')](function(_0x23bd76){return _0x23bd76;});}return null;};}function removeEntity(_0x20dfd3,_0x36a7ed){return function(_0x208e81){if(_0x208e81){return _0x208e81[_0xaf46('0x37')]()[_0xaf46('0x1f')](function(){var _0x28a220=_0x208e81[_0xaf46('0x38')]({'plain':!![]});var _0x5407de='FaxAccounts';return db[_0xaf46('0x39')][_0xaf46('0x37')]({'where':{'type':_0x5407de,'resourceId':_0x28a220['id']}})[_0xaf46('0x1f')](function(){return _0x208e81;});})['then'](function(){_0x20dfd3['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x26a48a,_0x4b2f7a){return function(_0x4ad8a2){if(!_0x4ad8a2){_0x26a48a[_0xaf46('0x2a')](0x194);}return _0x4ad8a2;};}function handleError(_0x5e29c4,_0x44277c){_0x44277c=_0x44277c||0x1f4;return function(_0x23eea3){logger[_0xaf46('0x26')](_0x23eea3['stack']);if(_0x23eea3['name']){delete _0x23eea3[_0xaf46('0x3a')];}_0x5e29c4[_0xaf46('0x2b')](_0x44277c)[_0xaf46('0x3b')](_0x23eea3);};}exports[_0xaf46('0x3c')]=function(_0x3ee504,_0x3f69c1){var _0x4d741f={'include':[{'model':db[_0xaf46('0x3d')],'as':_0xaf46('0x3e')}]},_0x593597={},_0x15fe64={'count':0x0,'rows':[]};var _0xa8e8fb=_['map'](db['FaxAccount'][_0xaf46('0x3f')],function(_0x726bac){return{'name':_0x726bac[_0xaf46('0x40')],'type':_0x726bac['type'][_0xaf46('0x41')]};});_0x593597[_0xaf46('0x42')]=_[_0xaf46('0x43')](_0xa8e8fb,'name');_0x593597[_0xaf46('0x44')]=_[_0xaf46('0x45')](_0x3ee504[_0xaf46('0x44')]);_0x593597['filters']=_[_0xaf46('0x46')](_0x593597[_0xaf46('0x42')],_0x593597[_0xaf46('0x44')]);_0x4d741f[_0xaf46('0x47')]=_['intersection'](_0x593597[_0xaf46('0x42')],qs['fields'](_0x3ee504[_0xaf46('0x44')][_0xaf46('0x48')]));_0x4d741f[_0xaf46('0x47')]=_0x4d741f[_0xaf46('0x47')][_0xaf46('0x49')]?_0x4d741f[_0xaf46('0x47')]:_0x593597['model'];if(!_0x3ee504[_0xaf46('0x44')][_0xaf46('0x4a')](_0xaf46('0x4b'))){_0x4d741f['limit']=qs[_0xaf46('0x4c')](_0x3ee504[_0xaf46('0x44')][_0xaf46('0x4c')]);_0x4d741f[_0xaf46('0x2d')]=qs[_0xaf46('0x2d')](_0x3ee504[_0xaf46('0x44')]['offset']);}_0x4d741f[_0xaf46('0x4d')]=qs[_0xaf46('0x4e')](_0x3ee504['query'][_0xaf46('0x4e')]);_0x4d741f[_0xaf46('0x4f')]=qs[_0xaf46('0x50')](_[_0xaf46('0x51')](_0x3ee504[_0xaf46('0x44')],_0x593597[_0xaf46('0x50')]),_0xa8e8fb);if(_0x3ee504[_0xaf46('0x44')][_0xaf46('0x52')]){_0x4d741f[_0xaf46('0x4f')]=_['merge'](_0x4d741f[_0xaf46('0x4f')],{'$or':_[_0xaf46('0x43')](_0xa8e8fb,function(_0x279fd7){if(_0x279fd7['type']!==_0xaf46('0x53')){var _0x174d3d={};_0x174d3d[_0x279fd7[_0xaf46('0x3a')]]={'$like':'%'+_0x3ee504[_0xaf46('0x44')][_0xaf46('0x52')]+'%'};return _0x174d3d;}})});}_0x4d741f=_[_0xaf46('0x54')]({},_0x4d741f,_0x3ee504[_0xaf46('0x55')]);var _0x41951e={'where':_0x4d741f[_0xaf46('0x4f')]};return db['FaxAccount'][_0xaf46('0x2f')](_0x41951e)[_0xaf46('0x1f')](function(_0x2215d0){_0x15fe64[_0xaf46('0x2f')]=_0x2215d0;if(_0x3ee504[_0xaf46('0x44')][_0xaf46('0x56')]){_0x4d741f[_0xaf46('0x57')]=[{'all':!![]}];}return db[_0xaf46('0x58')][_0xaf46('0x59')](_0x4d741f);})[_0xaf46('0x1f')](function(_0x5ac99b){_0x15fe64['rows']=_0x5ac99b;return _0x15fe64;})[_0xaf46('0x1f')](respondWithFilteredResult(_0x3f69c1,_0x4d741f))[_0xaf46('0x5a')](handleError(_0x3f69c1,null));};exports[_0xaf46('0x5b')]=function(_0x39c667,_0x7dfbc7){var _0x180094={'raw':![],'where':{'id':_0x39c667[_0xaf46('0x5c')]['id']},'include':[{'model':db[_0xaf46('0x3d')],'as':'mandatoryDispositionPause'}]},_0x1481a={};_0x1481a[_0xaf46('0x42')]=_[_0xaf46('0x45')](db[_0xaf46('0x58')][_0xaf46('0x3f')]);_0x1481a['query']=_[_0xaf46('0x45')](_0x39c667['query']);_0x1481a[_0xaf46('0x50')]=_['intersection'](_0x1481a[_0xaf46('0x42')],_0x1481a[_0xaf46('0x44')]);_0x180094['attributes']=_[_0xaf46('0x46')](_0x1481a['model'],qs['fields'](_0x39c667['query'][_0xaf46('0x48')]));_0x180094[_0xaf46('0x47')]=_0x180094['attributes'][_0xaf46('0x49')]?_0x180094[_0xaf46('0x47')]:_0x1481a['model'];if(_0x39c667[_0xaf46('0x44')]['includeAll']){_0x180094['include']=[{'all':!![]}];}_0x180094=_['merge']({},_0x180094,_0x39c667[_0xaf46('0x55')]);return db[_0xaf46('0x58')][_0xaf46('0x5d')](_0x180094)['then'](handleEntityNotFound(_0x7dfbc7,null))[_0xaf46('0x1f')](respondWithResult(_0x7dfbc7,null))[_0xaf46('0x5a')](handleError(_0x7dfbc7,null));};exports['create']=function(_0xbcf3fc,_0x38e709){return db[_0xaf46('0x58')][_0xaf46('0x5e')](_0xbcf3fc[_0xaf46('0x5f')],{})[_0xaf46('0x1f')](function(_0x4b3386){var _0x4f32bb=_0xbcf3fc[_0xaf46('0x60')][_0xaf46('0x38')]({'plain':!![]});if(!_0x4f32bb)throw new Error(_0xaf46('0x61'));if(_0x4f32bb[_0xaf46('0x62')]===_0xaf46('0x60')){var _0xcedf71=_0x4b3386['get']({'plain':!![]});var _0x5bae27='FaxAccounts';return db[_0xaf46('0x63')][_0xaf46('0x5d')]({'where':{'name':_0x5bae27,'userProfileId':_0x4f32bb['userProfileId']},'raw':!![]})[_0xaf46('0x1f')](function(_0x327522){if(_0x327522&&_0x327522[_0xaf46('0x64')]===0x0){return db[_0xaf46('0x39')][_0xaf46('0x5e')]({'name':_0xcedf71['name'],'resourceId':_0xcedf71['id'],'type':_0x327522[_0xaf46('0x3a')],'sectionId':_0x327522['id']},{})[_0xaf46('0x1f')](function(){return _0x4b3386;});}else{return _0x4b3386;}})[_0xaf46('0x5a')](function(_0x46a5a0){logger[_0xaf46('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x46a5a0);throw _0x46a5a0;});}return _0x4b3386;})[_0xaf46('0x1f')](respondWithResult(_0x38e709,0xc9))[_0xaf46('0x5a')](handleError(_0x38e709,null));};exports[_0xaf46('0x36')]=function(_0x3cd8c2,_0x4432e9){if(_0x3cd8c2['body']['id']){delete _0x3cd8c2[_0xaf46('0x5f')]['id'];}return db[_0xaf46('0x58')][_0xaf46('0x5d')]({'where':{'id':_0x3cd8c2['params']['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x4432e9,null))[_0xaf46('0x1f')](saveUpdates(_0x3cd8c2['body'],null))['then'](respondWithResult(_0x4432e9,null))[_0xaf46('0x5a')](handleError(_0x4432e9,null));};exports['destroy']=function(_0x111f6a,_0x8b1757){return db[_0xaf46('0x58')][_0xaf46('0x5d')]({'where':{'id':_0x111f6a[_0xaf46('0x5c')]['id']}})[_0xaf46('0x1f')](handleEntityNotFound(_0x8b1757,null))[_0xaf46('0x1f')](removeEntity(_0x8b1757,null))[_0xaf46('0x5a')](handleError(_0x8b1757,null));};exports['describe']=function(_0x519565,_0x19d23e){return db[_0xaf46('0x58')][_0xaf46('0x65')]()[_0xaf46('0x1f')](respondWithResult(_0x19d23e,null))[_0xaf46('0x5a')](handleError(_0x19d23e,null));};exports[_0xaf46('0x66')]=function(_0x419ab3,_0x5ac966,_0x328108){if(_0x419ab3[_0xaf46('0x5f')]['id']){delete _0x419ab3[_0xaf46('0x5f')]['id'];}return db[_0xaf46('0x58')]['find']({'where':{'id':_0x419ab3[_0xaf46('0x5c')]['id']}})[_0xaf46('0x1f')](handleEntityNotFound(_0x5ac966,null))[_0xaf46('0x1f')](function(_0x145504){if(_0x145504){_0x419ab3[_0xaf46('0x5f')][_0xaf46('0x67')]=_0x145504['id'];return db['Disposition'][_0xaf46('0x5e')](_0x419ab3['body']);}})[_0xaf46('0x1f')](respondWithResult(_0x5ac966,null))['catch'](handleError(_0x5ac966,null));};exports[_0xaf46('0x68')]=function(_0x3995f0,_0x478574,_0x3806b2){var _0x392310={'raw':![],'where':{}};var _0x2549c0={};var _0x203b99={'count':0x0,'rows':[]};return db[_0xaf46('0x58')]['findOne']({'where':{'id':_0x3995f0['params']['id']}})['then'](handleEntityNotFound(_0x478574,null))['then'](function(_0x2bdd32){if(_0x2bdd32){_0x2549c0[_0xaf46('0x42')]=_[_0xaf46('0x45')](db[_0xaf46('0x69')][_0xaf46('0x3f')]);_0x2549c0[_0xaf46('0x44')]=_[_0xaf46('0x45')](_0x3995f0['query']);_0x2549c0[_0xaf46('0x50')]=_['intersection'](_0x2549c0[_0xaf46('0x42')],_0x2549c0[_0xaf46('0x44')]);_0x392310[_0xaf46('0x47')]=_[_0xaf46('0x46')](_0x2549c0['model'],qs[_0xaf46('0x48')](_0x3995f0['query']['fields']));_0x392310[_0xaf46('0x47')]=_0x392310[_0xaf46('0x47')][_0xaf46('0x49')]?_0x392310['attributes']:_0x2549c0['model'];if(!_0x3995f0[_0xaf46('0x44')][_0xaf46('0x4a')]('nolimit')){_0x392310['limit']=qs[_0xaf46('0x4c')](_0x3995f0[_0xaf46('0x44')][_0xaf46('0x4c')]);_0x392310[_0xaf46('0x2d')]=qs[_0xaf46('0x2d')](_0x3995f0[_0xaf46('0x44')]['offset']);}_0x392310[_0xaf46('0x4d')]=qs[_0xaf46('0x4e')](_0x3995f0[_0xaf46('0x44')][_0xaf46('0x4e')]);_0x392310[_0xaf46('0x4f')]=qs['filters'](_['pick'](_0x3995f0[_0xaf46('0x44')],_0x2549c0[_0xaf46('0x50')]));_0x392310[_0xaf46('0x4f')][_0xaf46('0x67')]=_0x2bdd32['id'];if(_0x3995f0[_0xaf46('0x44')][_0xaf46('0x52')]){_0x392310[_0xaf46('0x4f')]=_[_0xaf46('0x54')](_0x392310['where'],{'$or':_[_0xaf46('0x43')](_0x392310[_0xaf46('0x47')],function(_0x1dde87){var _0x23df6c={};_0x23df6c[_0x1dde87]={'$like':'%'+_0x3995f0[_0xaf46('0x44')][_0xaf46('0x52')]+'%'};return _0x23df6c;})});}_0x392310=_[_0xaf46('0x54')]({},_0x392310,_0x3995f0[_0xaf46('0x55')]);return db['Disposition']['count']({'where':_0x392310['where']})[_0xaf46('0x1f')](function(_0x55902c){_0x203b99[_0xaf46('0x2f')]=_0x55902c;if(_0x3995f0[_0xaf46('0x44')][_0xaf46('0x56')]){_0x392310[_0xaf46('0x57')]=[{'all':!![]}];}return db[_0xaf46('0x69')][_0xaf46('0x59')](_0x392310);})['then'](function(_0x417f9c){_0x203b99[_0xaf46('0x6a')]=_0x417f9c;return _0x203b99;});}})[_0xaf46('0x1f')](respondWithFilteredResult(_0x478574,_0x392310))[_0xaf46('0x5a')](handleError(_0x478574,null));};exports[_0xaf46('0x6b')]=function(_0x2cf2fa,_0x2d6ba9,_0x595670){return db[_0xaf46('0x58')][_0xaf46('0x5d')]({'where':{'id':_0x2cf2fa[_0xaf46('0x5c')]['id']}})[_0xaf46('0x1f')](handleEntityNotFound(_0x2d6ba9,null))[_0xaf46('0x1f')](function(_0xe024fc){if(_0xe024fc){return _0xe024fc[_0xaf46('0x6b')](_0x2cf2fa[_0xaf46('0x44')]['ids']);}})['then'](respondWithStatusCode(_0x2d6ba9,null))['catch'](handleError(_0x2d6ba9,null));};exports[_0xaf46('0x6c')]=function(_0x2bf6f5,_0x396320,_0x30e5e5){if(_0x2bf6f5[_0xaf46('0x5f')]['id']){delete _0x2bf6f5[_0xaf46('0x5f')]['id'];}return db[_0xaf46('0x58')]['find']({'where':{'id':_0x2bf6f5[_0xaf46('0x5c')]['id']}})['then'](handleEntityNotFound(_0x396320,null))[_0xaf46('0x1f')](function(_0x5532cf){if(_0x5532cf){_0x2bf6f5[_0xaf46('0x5f')][_0xaf46('0x67')]=_0x5532cf['id'];return db[_0xaf46('0x6d')]['create'](_0x2bf6f5[_0xaf46('0x5f')]);}})[_0xaf46('0x1f')](respondWithResult(_0x396320,null))[_0xaf46('0x5a')](handleError(_0x396320,null));};exports['getAnswers']=function(_0x3c7764,_0x3fc058,_0x15f6a3){var _0x1a4eb9={'raw':![],'where':{}};var _0x5d85b8={};var _0x1238a8={'count':0x0,'rows':[]};return db[_0xaf46('0x58')][_0xaf46('0x6e')]({'where':{'id':_0x3c7764['params']['id']}})[_0xaf46('0x1f')](handleEntityNotFound(_0x3fc058,null))[_0xaf46('0x1f')](function(_0x36ced3){if(_0x36ced3){_0x5d85b8[_0xaf46('0x42')]=_[_0xaf46('0x45')](db[_0xaf46('0x6d')][_0xaf46('0x3f')]);_0x5d85b8['query']=_[_0xaf46('0x45')](_0x3c7764[_0xaf46('0x44')]);_0x5d85b8[_0xaf46('0x50')]=_[_0xaf46('0x46')](_0x5d85b8[_0xaf46('0x42')],_0x5d85b8[_0xaf46('0x44')]);_0x1a4eb9['attributes']=_[_0xaf46('0x46')](_0x5d85b8[_0xaf46('0x42')],qs[_0xaf46('0x48')](_0x3c7764[_0xaf46('0x44')][_0xaf46('0x48')]));_0x1a4eb9[_0xaf46('0x47')]=_0x1a4eb9['attributes']['length']?_0x1a4eb9['attributes']:_0x5d85b8['model'];if(!_0x3c7764[_0xaf46('0x44')][_0xaf46('0x4a')](_0xaf46('0x4b'))){_0x1a4eb9[_0xaf46('0x4c')]=qs[_0xaf46('0x4c')](_0x3c7764['query'][_0xaf46('0x4c')]);_0x1a4eb9[_0xaf46('0x2d')]=qs[_0xaf46('0x2d')](_0x3c7764['query'][_0xaf46('0x2d')]);}_0x1a4eb9[_0xaf46('0x4d')]=qs[_0xaf46('0x4e')](_0x3c7764[_0xaf46('0x44')]['sort']);_0x1a4eb9[_0xaf46('0x4f')]=qs[_0xaf46('0x50')](_[_0xaf46('0x51')](_0x3c7764[_0xaf46('0x44')],_0x5d85b8[_0xaf46('0x50')]));_0x1a4eb9['where']['FaxAccountId']=_0x36ced3['id'];if(_0x3c7764[_0xaf46('0x44')][_0xaf46('0x52')]){_0x1a4eb9[_0xaf46('0x4f')]=_['merge'](_0x1a4eb9[_0xaf46('0x4f')],{'$or':_['map'](_0x1a4eb9['attributes'],function(_0x15a41c){var _0x54435e={};_0x54435e[_0x15a41c]={'$like':'%'+_0x3c7764[_0xaf46('0x44')]['filter']+'%'};return _0x54435e;})});}_0x1a4eb9=_[_0xaf46('0x54')]({},_0x1a4eb9,_0x3c7764['options']);return db['CannedAnswer']['count']({'where':_0x1a4eb9[_0xaf46('0x4f')]})['then'](function(_0xae5cbd){_0x1238a8[_0xaf46('0x2f')]=_0xae5cbd;if(_0x3c7764[_0xaf46('0x44')]['includeAll']){_0x1a4eb9[_0xaf46('0x57')]=[{'all':!![]}];}return db[_0xaf46('0x6d')][_0xaf46('0x59')](_0x1a4eb9);})[_0xaf46('0x1f')](function(_0x16acb7){_0x1238a8[_0xaf46('0x6a')]=_0x16acb7;return _0x1238a8;});}})[_0xaf46('0x1f')](respondWithFilteredResult(_0x3fc058,_0x1a4eb9))[_0xaf46('0x5a')](handleError(_0x3fc058,null));};exports['removeAnswers']=function(_0x54f087,_0x58f1c2,_0x300450){return db['FaxAccount'][_0xaf46('0x5d')]({'where':{'id':_0x54f087[_0xaf46('0x5c')]['id']}})['then'](handleEntityNotFound(_0x58f1c2,null))[_0xaf46('0x1f')](function(_0x502c09){if(_0x502c09){return _0x502c09[_0xaf46('0x6f')](_0x54f087['query'][_0xaf46('0x70')]);}})['then'](respondWithStatusCode(_0x58f1c2,null))['catch'](handleError(_0x58f1c2,null));};exports[_0xaf46('0x71')]=function(_0x5111c9,_0x152472,_0x2d988f){return db[_0xaf46('0x72')][_0xaf46('0x5d')]({'where':{'id':_0x5111c9[_0xaf46('0x5c')]['id']}})['then'](handleEntityNotFound(_0x152472,null))[_0xaf46('0x1f')](function(_0x315497){if(_0x315497){return _0x315497[_0xaf46('0x71')](_0x5111c9[_0xaf46('0x5f')][_0xaf46('0x70')],_[_0xaf46('0x73')](_0x5111c9[_0xaf46('0x5f')],[_0xaf46('0x70'),'id'])||{});}})[_0xaf46('0x1f')](respondWithResult(_0x152472,null))[_0xaf46('0x5a')](handleError(_0x152472,null));};exports['getInteractions']=function(_0x3bb8e5,_0x3e9664,_0x578046){var _0x2fe86b={'raw':![],'where':{}};var _0x183730={};var _0x5c9ce6={'count':0x0,'rows':[]};return db[_0xaf46('0x58')]['findOne']({'where':{'id':_0x3bb8e5[_0xaf46('0x5c')]['id']}})[_0xaf46('0x1f')](handleEntityNotFound(_0x3e9664,null))[_0xaf46('0x1f')](function(_0x42fe9a){if(_0x42fe9a){_0x183730[_0xaf46('0x42')]=_[_0xaf46('0x45')](db[_0xaf46('0x72')][_0xaf46('0x3f')]);_0x183730[_0xaf46('0x44')]=_['keys'](_0x3bb8e5[_0xaf46('0x44')]);_0x183730[_0xaf46('0x50')]=_[_0xaf46('0x46')](_0x183730[_0xaf46('0x42')],_0x183730[_0xaf46('0x44')]);_0x2fe86b[_0xaf46('0x47')]=_[_0xaf46('0x46')](_0x183730[_0xaf46('0x42')],qs[_0xaf46('0x48')](_0x3bb8e5[_0xaf46('0x44')][_0xaf46('0x48')]));_0x2fe86b[_0xaf46('0x47')]=_0x2fe86b[_0xaf46('0x47')][_0xaf46('0x49')]?_0x2fe86b[_0xaf46('0x47')]:_0x183730['model'];if(!_0x3bb8e5[_0xaf46('0x44')]['hasOwnProperty'](_0xaf46('0x4b'))){_0x2fe86b['limit']=qs[_0xaf46('0x4c')](_0x3bb8e5[_0xaf46('0x44')][_0xaf46('0x4c')]);_0x2fe86b[_0xaf46('0x2d')]=qs[_0xaf46('0x2d')](_0x3bb8e5[_0xaf46('0x44')][_0xaf46('0x2d')]);}_0x2fe86b[_0xaf46('0x4d')]=qs[_0xaf46('0x4e')](_0x3bb8e5[_0xaf46('0x44')][_0xaf46('0x4e')]);_0x2fe86b[_0xaf46('0x4f')]=qs['filters'](_[_0xaf46('0x51')](_0x3bb8e5[_0xaf46('0x44')],_0x183730[_0xaf46('0x50')]));_0x2fe86b[_0xaf46('0x4f')][_0xaf46('0x67')]=_0x42fe9a['id'];if(_0x3bb8e5[_0xaf46('0x44')][_0xaf46('0x52')]){_0x2fe86b[_0xaf46('0x4f')]=_[_0xaf46('0x54')](_0x2fe86b[_0xaf46('0x4f')],{'$or':_[_0xaf46('0x43')](_0x2fe86b[_0xaf46('0x47')],function(_0x293bdc){var _0x980805={};_0x980805[_0x293bdc]={'$like':'%'+_0x3bb8e5[_0xaf46('0x44')]['filter']+'%'};return _0x980805;})});}_0x2fe86b=_['merge']({},_0x2fe86b,_0x3bb8e5[_0xaf46('0x55')]);return db[_0xaf46('0x72')]['count']({'where':_0x2fe86b[_0xaf46('0x4f')]})[_0xaf46('0x1f')](function(_0x2bee34){_0x5c9ce6[_0xaf46('0x2f')]=_0x2bee34;if(_0x3bb8e5[_0xaf46('0x44')][_0xaf46('0x56')]){_0x2fe86b[_0xaf46('0x57')]=[{'model':db[_0xaf46('0x74')],'as':_0xaf46('0x75'),'required':![]},{'model':db[_0xaf46('0x76')],'as':_0xaf46('0x77'),'attributes':[_0xaf46('0x3a'),_0xaf46('0x78'),_0xaf46('0x79')],'required':![]},{'model':db[_0xaf46('0x7a')],'as':'Tags','attributes':['id','name',_0xaf46('0x7b')],'where':_0x3bb8e5[_0xaf46('0x44')][_0xaf46('0x7c')]?{'id':_0x3bb8e5['query'][_0xaf46('0x7c')]}:undefined,'required':_0x3bb8e5[_0xaf46('0x44')][_0xaf46('0x7c')]?!![]:![]}];}return db[_0xaf46('0x72')][_0xaf46('0x59')](_0x2fe86b);})[_0xaf46('0x1f')](function(_0x44c3dc){_0x5c9ce6[_0xaf46('0x6a')]=_0x44c3dc;return _0x5c9ce6;});}})['then'](respondWithFilteredResult(_0x3e9664,_0x2fe86b))['catch'](handleError(_0x3e9664,null));};exports[_0xaf46('0x7d')]=function(_0x3e3d29,_0x1ff1a8,_0x4fe965){return db['FaxAccount']['findOne']({'where':{'id':_0x3e3d29['params']['id']}})['then'](handleEntityNotFound(_0x1ff1a8,null))[_0xaf46('0x1f')](function(_0x493091){if(_0x493091){return db['sequelize'][_0xaf46('0x7e')](function(_0x411466){return db['FaxApplication'][_0xaf46('0x37')]({'where':{'FaxAccountId':_0x3e3d29[_0xaf46('0x5c')]['id']},'transaction':_0x411466})['then'](function(_0x487c77){var _0x2d286c=_['map'](_0x3e3d29['body'],function(_0x30c410){_0x30c410[_0xaf46('0x67')]=_0x3e3d29[_0xaf46('0x5c')]['id'];return _0x30c410;});return db[_0xaf46('0x7f')][_0xaf46('0x80')](_0x2d286c,{'transaction':_0x411466});});})['then'](function(){return db[_0xaf46('0x7f')][_0xaf46('0x81')]({'where':{'FaxAccountId':_0x3e3d29['params']['id']},'order':_0xaf46('0x82')});});}})[_0xaf46('0x1f')](respondWithResult(_0x1ff1a8,null))[_0xaf46('0x5a')](handleError(_0x1ff1a8,null));};exports[_0xaf46('0x83')]=function(_0x46a8cf,_0x32e7ae,_0x12a5f5){var _0x321325={};var _0x367f40={};var _0x474d0f;var _0x4dae96;return db[_0xaf46('0x58')][_0xaf46('0x6e')]({'where':{'id':_0x46a8cf[_0xaf46('0x5c')]['id']}})[_0xaf46('0x1f')](handleEntityNotFound(_0x32e7ae,null))[_0xaf46('0x1f')](function(_0x47c32a){if(_0x47c32a){_0x474d0f=_0x47c32a;_0x367f40[_0xaf46('0x42')]=_['keys'](db['FaxApplication'][_0xaf46('0x3f')]);_0x367f40[_0xaf46('0x44')]=_[_0xaf46('0x45')](_0x46a8cf[_0xaf46('0x44')]);_0x367f40[_0xaf46('0x50')]=_[_0xaf46('0x46')](_0x367f40['model'],_0x367f40[_0xaf46('0x44')]);_0x321325[_0xaf46('0x47')]=_['intersection'](_0x367f40[_0xaf46('0x42')],qs['fields'](_0x46a8cf[_0xaf46('0x44')][_0xaf46('0x48')]));_0x321325[_0xaf46('0x47')]=_0x321325[_0xaf46('0x47')][_0xaf46('0x49')]?_0x321325[_0xaf46('0x47')]:_0x367f40[_0xaf46('0x42')];_0x321325[_0xaf46('0x4d')]=qs['sort'](_0x46a8cf[_0xaf46('0x44')][_0xaf46('0x4e')]);_0x321325[_0xaf46('0x4f')]=qs[_0xaf46('0x50')](_[_0xaf46('0x51')](_0x46a8cf[_0xaf46('0x44')],_0x367f40[_0xaf46('0x50')]));if(_0x46a8cf[_0xaf46('0x44')]['filter']){_0x321325[_0xaf46('0x4f')]=_[_0xaf46('0x54')](_0x321325[_0xaf46('0x4f')],{'$or':_[_0xaf46('0x43')](_0x321325[_0xaf46('0x47')],function(_0x2756dc){var _0x18ceff={};_0x18ceff[_0x2756dc]={'$like':'%'+_0x46a8cf[_0xaf46('0x44')][_0xaf46('0x52')]+'%'};return _0x18ceff;})});}_0x321325=_[_0xaf46('0x54')]({},_0x321325,_0x46a8cf[_0xaf46('0x55')]);return _0x474d0f[_0xaf46('0x83')](_0x321325);}})[_0xaf46('0x1f')](function(_0x401982){if(_0x401982){_0x4dae96=_0x401982['length'];if(!_0x46a8cf[_0xaf46('0x44')][_0xaf46('0x4a')](_0xaf46('0x4b'))){_0x321325[_0xaf46('0x4c')]=qs[_0xaf46('0x4c')](_0x46a8cf['query'][_0xaf46('0x4c')]);_0x321325[_0xaf46('0x2d')]=qs['offset'](_0x46a8cf[_0xaf46('0x44')][_0xaf46('0x2d')]);}return _0x474d0f[_0xaf46('0x83')](_0x321325);}})[_0xaf46('0x1f')](function(_0x1bb9be){if(_0x1bb9be){return _0x1bb9be?{'count':_0x4dae96,'rows':_0x1bb9be}:null;}})[_0xaf46('0x1f')](respondWithResult(_0x32e7ae,null))['catch'](handleError(_0x32e7ae,null));};function Extension(_0xb3970e,_0x293926,_0x136733,_0x5e3e16){this['context']=_0xaf46('0x84');this[_0xaf46('0x85')]=_0xb3970e[_0xaf46('0x86')];this[_0xaf46('0x87')]=_0x5e3e16;this['type']=_0xaf46('0x88');this[_0xaf46('0x89')]=_0xaf46('0x8a');this['FaxAccountId']=_0xb3970e['id'];this[_0xaf46('0x82')]=_0x293926;this[_0xaf46('0x8b')]=_0x136733;}function createExtensionsReciveFax(_0x5779be){var _0x264f1c=0x1;var _0x18d163=[];_0x18d163['push'](new Extension(_0x5779be,_0x264f1c,'',_0xaf46('0x8c')));_0x264f1c+=0x1;_0x18d163[_0xaf46('0x8d')](new Extension(_0x5779be,_0x264f1c,_0xaf46('0x8e'),_0xaf46('0x8f')));_0x264f1c+=0x1;for(var _0x1415e6 in _0x5779be){if(_0x5779be[_0xaf46('0x4a')](_0x1415e6)&&(_0x1415e6===_0xaf46('0x90')||_0x1415e6===_0xaf46('0x86')||_0x1415e6===_0xaf46('0x91')||_0x1415e6==='faxdetect'||_0x1415e6==='headerinfo'||_0x1415e6===_0xaf46('0x92')||_0x1415e6==='minrate'||_0x1415e6==='modem'||_0x1415e6===_0xaf46('0x93'))){_0x18d163['push'](new Extension(_0x5779be,_0x264f1c,'FAXOPT('+_0x1415e6+')='+_0x5779be[_0x1415e6],'Set'));_0x264f1c+=0x1;}}_0x18d163[_0xaf46('0x8d')](new Extension(_0x5779be,_0x264f1c,'6','Wait'));_0x264f1c+=0x1;_0x18d163[_0xaf46('0x8d')](new Extension(_0x5779be,_0x264f1c,_0xaf46('0x94'),_0xaf46('0x95')));_0x264f1c=0x0;return _0x18d163;}exports[_0xaf46('0x96')]=function(_0x110ded,_0x12de6a,_0x555f75){var _0x38319e;return db['sequelize'][_0xaf46('0x7e')](function(_0x5d4e1a){return db[_0xaf46('0x58')][_0xaf46('0x5e')](_0x110ded[_0xaf46('0x5f')],{'transaction':_0x5d4e1a})['then'](function(_0xf2f120){_0x38319e=_0xf2f120['get']({'plain':!![]});return db[_0xaf46('0x97')][_0xaf46('0x80')](createExtensionsReciveFax(_0x38319e),{'transaction':_0x5d4e1a});});})[_0xaf46('0x1f')](function(){return _0x38319e;})[_0xaf46('0x1f')](respondWithResult(_0x12de6a,null))[_0xaf46('0x5a')](handleError(_0x12de6a,null));};exports[_0xaf46('0x98')]=function(_0x3fd0ae,_0x2ca115,_0x4b11cd){var _0x48e381;return db[_0xaf46('0x99')][_0xaf46('0x7e')](function(_0x562363){return db['FaxAccount'][_0xaf46('0x36')](_0x3fd0ae[_0xaf46('0x5f')],{'where':{'id':_0x3fd0ae['body']['id']},'transaction':_0x562363})[_0xaf46('0x1f')](function(_0x5bda64){return db[_0xaf46('0x97')][_0xaf46('0x37')]({'where':{'FaxAccountId':_0x3fd0ae[_0xaf46('0x5f')]['id']},'transaction':_0x562363})[_0xaf46('0x1f')](function(_0x23bb6e){return db[_0xaf46('0x97')][_0xaf46('0x80')](createExtensionsReciveFax(_[_0xaf46('0x73')](_0x3fd0ae[_0xaf46('0x5f')],[_0xaf46('0x9a'),_0xaf46('0x41'),_0xaf46('0x9b'),_0xaf46('0x9c'),'TrunkId','ListId'])),{'transaction':_0x562363});});});})[_0xaf46('0x1f')](function(){return db[_0xaf46('0x58')][_0xaf46('0x9d')](_0x3fd0ae[_0xaf46('0x5f')]['id']);})[_0xaf46('0x1f')](respondWithResult(_0x2ca115,null))[_0xaf46('0x5a')](handleError(_0x2ca115,null));};exports[_0xaf46('0x9e')]=function(_0x1466e2,_0xa6ce6e,_0x2b6f47){var _0x6b0f3f={'raw':!![],'where':{}};var _0x8f79d6={};var _0x31ab30={'count':0x0,'rows':[]};return db['FaxAccount'][_0xaf46('0x6e')]({'where':{'id':_0x1466e2[_0xaf46('0x5c')]['id']}})['then'](handleEntityNotFound(_0xa6ce6e,null))[_0xaf46('0x1f')](function(_0x50158c){if(_0x50158c){_0x8f79d6[_0xaf46('0x42')]=_[_0xaf46('0x45')](db[_0xaf46('0x9f')][_0xaf46('0x3f')]);_0x8f79d6[_0xaf46('0x44')]=_[_0xaf46('0x45')](_0x1466e2['query']);_0x8f79d6[_0xaf46('0x50')]=_[_0xaf46('0x46')](_0x8f79d6[_0xaf46('0x42')],_0x8f79d6[_0xaf46('0x44')]);_0x6b0f3f['attributes']=_[_0xaf46('0x46')](_0x8f79d6[_0xaf46('0x42')],qs[_0xaf46('0x48')](_0x1466e2[_0xaf46('0x44')][_0xaf46('0x48')]));_0x6b0f3f[_0xaf46('0x47')]=_0x6b0f3f[_0xaf46('0x47')]['length']?_0x6b0f3f[_0xaf46('0x47')]:_0x8f79d6[_0xaf46('0x42')];if(!_0x1466e2['query']['hasOwnProperty'](_0xaf46('0x4b'))){_0x6b0f3f['limit']=qs[_0xaf46('0x4c')](_0x1466e2[_0xaf46('0x44')][_0xaf46('0x4c')]);_0x6b0f3f[_0xaf46('0x2d')]=qs[_0xaf46('0x2d')](_0x1466e2[_0xaf46('0x44')]['offset']);}_0x6b0f3f[_0xaf46('0x4d')]=qs['sort'](_0x1466e2['query'][_0xaf46('0x4e')]);_0x6b0f3f[_0xaf46('0x4f')]=qs['filters'](_[_0xaf46('0x51')](_0x1466e2['query'],_0x8f79d6[_0xaf46('0x50')]));_0x6b0f3f[_0xaf46('0x4f')][_0xaf46('0x67')]=_0x50158c['id'];if(_0x1466e2[_0xaf46('0x44')]['filter']){_0x6b0f3f[_0xaf46('0x4f')]=_['merge'](_0x6b0f3f[_0xaf46('0x4f')],{'$or':_[_0xaf46('0x43')](_0x6b0f3f[_0xaf46('0x47')],function(_0x4b6eeb){var _0xdc136e={};_0xdc136e[_0x4b6eeb]={'$like':'%'+_0x1466e2[_0xaf46('0x44')][_0xaf46('0x52')]+'%'};return _0xdc136e;})});}if(_0x1466e2['query'][_0xaf46('0xa0')]){var _0x5d5178=_0x1466e2[_0xaf46('0x44')][_0xaf46('0xa0')][_0xaf46('0xa1')](',');var _0x353dd7={};_0x353dd7[_0x5d5178[0x0]]={'$gte':moment(_0x5d5178[0x1])[_0xaf46('0xa2')](_0xaf46('0xa3'))};_0x6b0f3f[_0xaf46('0x4f')]=_[_0xaf46('0x54')](_0x6b0f3f[_0xaf46('0x4f')],_0x353dd7);}_0x6b0f3f=_[_0xaf46('0x54')]({},_0x6b0f3f,_0x1466e2['options']);return db[_0xaf46('0x9f')][_0xaf46('0x2f')]({'where':_0x6b0f3f[_0xaf46('0x4f')]})[_0xaf46('0x1f')](function(_0x1a7817){_0x31ab30[_0xaf46('0x2f')]=_0x1a7817;if(_0x1466e2[_0xaf46('0x44')][_0xaf46('0x56')]){_0x6b0f3f['include']=[{'all':!![]}];}return db[_0xaf46('0x9f')]['findAll'](_0x6b0f3f);})['then'](function(_0x17d9b2){_0x31ab30[_0xaf46('0x6a')]=_0x17d9b2;return _0x31ab30;});}})['then'](respondWithFilteredResult(_0xa6ce6e,_0x6b0f3f))[_0xaf46('0x5a')](handleError(_0xa6ce6e,null));};exports[_0xaf46('0x3b')]=function(_0x57db18,_0x1b3975,_0x209793){var _0x31880b,_0x12cd6b={},_0x1583e5;if(_0x57db18[_0xaf46('0x5f')]['to']){_0x1583e5=_0x57db18['body']['to'][0x0];}return db[_0xaf46('0x58')][_0xaf46('0x5d')]({'where':{'id':_0x57db18[_0xaf46('0x5c')]['id']},'include':[{'model':db[_0xaf46('0xa4')],'as':'List','include':[{'model':db[_0xaf46('0x74')],'as':'Contacts','where':{'fax':_0x1583e5},'limit':0x1,'order':[[_0xaf46('0x9c'),'DESC']]}]}]})[_0xaf46('0x1f')](handleEntityNotFound(_0x1b3975,null))['then'](function(_0x4680ec){_0x31880b=_0x4680ec;if(_0x57db18[_0xaf46('0x5f')][_0xaf46('0xa5')]&&_0x57db18[_0xaf46('0x5f')][_0xaf46('0xa5')][_0xaf46('0x49')]){for(var _0x34ea96=0x0;_0x34ea96<_0x57db18[_0xaf46('0x5f')][_0xaf46('0xa5')][_0xaf46('0x49')];_0x34ea96+=0x1){_0x57db18[_0xaf46('0x5f')][_0xaf46('0xa5')][_0x34ea96]={'filename':_0x57db18[_0xaf46('0x5f')][_0xaf46('0xa5')][_0x34ea96][_0xaf46('0x3a')],'id':_0x57db18[_0xaf46('0x5f')][_0xaf46('0xa5')][_0x34ea96]['id'],'path':path[_0xaf46('0xa6')](config[_0xaf46('0xa7')],_0xaf46('0xa8'),_0x57db18[_0xaf46('0x5f')]['attachments'][_0x34ea96][_0xaf46('0xa9')])};}}return respondWithRpcPromise(_0xaf46('0xaa'),'CheckAfterSend',{'FaxAccountId':_[_0xaf46('0xab')](_0x57db18[_0xaf46('0x5c')]['id'])?undefined:_0x57db18[_0xaf46('0x5c')]['id'],'path':_[_0xaf46('0xab')](_0x57db18[_0xaf46('0x5f')]['attachments'][0x0][_0xaf46('0x8')])?undefined:_0x57db18[_0xaf46('0x5f')][_0xaf46('0xa5')][0x0][_0xaf46('0x8')],'fax':_[_0xaf46('0xab')](_0x57db18[_0xaf46('0x5f')]['to'][0x0])?undefined:_0x57db18['body']['to'][0x0]},client9002);})['then'](function(){if(_0x31880b){if(_[_0xaf46('0xab')](_0x57db18[_0xaf46('0x5f')][_0xaf46('0xac')])){_0x57db18[_0xaf46('0x5f')][_0xaf46('0xac')]=util[_0xaf46('0xa2')](_0xaf46('0xad'),_0x31880b[_0xaf46('0x3a')],_0x31880b[_0xaf46('0xae')]);}if(_0x31880b[_0xaf46('0xaf')]){if(_0x31880b[_0xaf46('0xaf')][_0xaf46('0xb0')][_0xaf46('0x49')]){return _0x31880b[_0xaf46('0xaf')][_0xaf46('0xb0')][0x0];}else{return db[_0xaf46('0x74')][_0xaf46('0x5e')](_[_0xaf46('0x19')](_0x57db18[_0xaf46('0x5f')],{'firstName':_0x57db18[_0xaf46('0x5f')]['to'][0x0],'phone':_0x57db18[_0xaf46('0x5f')]['to'][0x0],'fax':_0x57db18[_0xaf46('0x5f')]['to'][0x0],'ListId':_0x31880b[_0xaf46('0xb1')]}));}}else{throw new Error('List\x20not\x20found');}}else{throw new Error(_0xaf46('0xb2'));}})['then'](function(_0x2b3a8d){if(_0x2b3a8d){return db[_0xaf46('0x72')][_0xaf46('0x5d')]({'where':{'ContactId':_0x2b3a8d['id'],'closed':![],'FaxAccountId':_0x31880b['id']}})[_0xaf46('0x1f')](function(_0x78c535){if(_0x78c535){return[_0x78c535,![]];}return db['FaxInteraction'][_0xaf46('0x5e')]({'UserId':_0x57db18[_0xaf46('0x60')]['id'],'ContactId':_0x2b3a8d['id'],'FaxAccountId':_0x31880b['id'],'fax':_0x57db18[_0xaf46('0x5f')]['to'][0x0],'firstMsgDirection':_0xaf46('0xb3'),'Messages':[_[_0xaf46('0x54')](_0x57db18[_0xaf46('0x5f')],{'read':![],'body':_0x57db18[_0xaf46('0x5f')]['attachments'][0x0]['filename'],'FaxAccountId':_0x31880b['id'],'UserId':_0x57db18['user']['id'],'ContactId':_0x2b3a8d['id'],'AttachmentId':_0x57db18['body'][_0xaf46('0xa5')][0x0]['id']})]},{'include':[{'model':db[_0xaf46('0x9f')],'as':_0xaf46('0xb4')}]})['then'](function(_0x123874){return[_0x123874,!![]];});});}else{throw new Error(_0xaf46('0xb5'));}})[_0xaf46('0xb6')](function(_0x5694ac,_0x59a767){if(_0x59a767){return _0x5694ac;}return db[_0xaf46('0x9f')]['create']({'direction':_0xaf46('0xb3'),'read':![],'body':_0x57db18['body'][_0xaf46('0xa5')][0x0][_0xaf46('0xb7')],'FaxAccountId':_0x31880b['id'],'FaxInteractionId':_0x5694ac['id'],'UserId':_0x57db18[_0xaf46('0x60')]['id'],'ContactId':_0x5694ac[_0xaf46('0xb8')],'AttachmentId':_0x57db18['body'][_0xaf46('0xa5')][0x0]['id']})[_0xaf46('0x1f')](function(_0x499943){_0x5694ac[_0xaf46('0xb9')][_0xaf46('0xb4')]=[];_0x5694ac['dataValues'][_0xaf46('0xb4')][_0xaf46('0x8d')](_0x499943['dataValues']);return _0x5694ac;});})['then'](function(_0x5ce56d){respondWithRpcPromise(_0xaf46('0xba'),_0xaf46('0xba'),{'FaxAccountId':_['isNil'](_0x57db18[_0xaf46('0x5c')]['id'])?undefined:_0x57db18[_0xaf46('0x5c')]['id'],'path':_[_0xaf46('0xab')](_0x57db18[_0xaf46('0x5f')]['attachments'][0x0][_0xaf46('0x8')])?undefined:_0x57db18['body']['attachments'][0x0][_0xaf46('0x8')],'fax':_['isNil'](_0x57db18['body']['to'][0x0])?undefined:_0x57db18[_0xaf46('0x5f')]['to'][0x0],'AttachmentId':_0x57db18[_0xaf46('0x5f')]['attachments'][0x0]['id']},client9002)[_0xaf46('0x1f')](function(_0x57dab0){logger['info'](_0xaf46('0xbb'),_0x57dab0);})['catch'](function(_0x3363f8){logger[_0xaf46('0x20')]('SendFaxRpc,\x20%s',_0x3363f8);});return _0x5ce56d;})['then'](respondWithResult(_0x1b3975,null))[_0xaf46('0x5a')](handleError(_0x1b3975,null));};exports[_0xaf46('0xbc')]=function(_0x530a86,_0x2c9e26,_0x4a409d){return db[_0xaf46('0x58')][_0xaf46('0x5d')]({'where':{'id':_0x530a86[_0xaf46('0x5c')]['id']}})[_0xaf46('0x1f')](handleEntityNotFound(_0x2c9e26,null))[_0xaf46('0x1f')](function(_0x542abf){if(_0x542abf){return _0x542abf[_0xaf46('0xbc')](_0x530a86[_0xaf46('0x5f')]['ids'],_[_0xaf46('0x73')](_0x530a86[_0xaf46('0x5f')],[_0xaf46('0x70'),'id'])||{})[_0xaf46('0xb6')](function(_0x130dce){for(var _0x44f27e=0x0;_0x44f27e<_0x530a86[_0xaf46('0x5f')]['ids'][_0xaf46('0x49')];_0x44f27e+=0x1){socket[_0xaf46('0xbd')](_0xaf46('0xbe'),{'UserId':Number(_0x530a86[_0xaf46('0x5f')]['ids'][_0x44f27e]),'FaxAccountId':Number(_0x530a86[_0xaf46('0x5c')]['id'])});}return _0x130dce;});}})[_0xaf46('0x1f')](respondWithResult(_0x2c9e26,null))['catch'](handleError(_0x2c9e26,null));};exports[_0xaf46('0xbf')]=function(_0x2422ae,_0x399ab4,_0x23d1d9){return db[_0xaf46('0x58')][_0xaf46('0x5d')]({'where':{'id':_0x2422ae[_0xaf46('0x5c')]['id']}})[_0xaf46('0x1f')](handleEntityNotFound(_0x399ab4,null))[_0xaf46('0x1f')](function(_0x1bf334){if(_0x1bf334){return _0x1bf334[_0xaf46('0xbf')](_0x2422ae[_0xaf46('0x44')][_0xaf46('0x70')])['then'](function(){if(_['isArray'](_0x2422ae['query'][_0xaf46('0x70')])){for(var _0x38645e=0x0;_0x38645e<_0x2422ae[_0xaf46('0x44')][_0xaf46('0x70')][_0xaf46('0x49')];_0x38645e+=0x1){socket[_0xaf46('0xbd')](_0xaf46('0xc0'),{'UserId':Number(_0x2422ae[_0xaf46('0x44')]['ids'][_0x38645e]),'FaxAccountId':Number(_0x2422ae['params']['id'])});}}else{socket['emit'](_0xaf46('0xc0'),{'UserId':Number(_0x2422ae['query'][_0xaf46('0x70')]),'FaxAccountId':Number(_0x2422ae[_0xaf46('0x5c')]['id'])});}});}})[_0xaf46('0x1f')](respondWithStatusCode(_0x399ab4,null))[_0xaf46('0x5a')](handleError(_0x399ab4,null));};exports[_0xaf46('0xc1')]=function(_0x3b14d6,_0x4f4359,_0x43c4e6){var _0x514770={};var _0x181adf={};var _0x16971a;var _0x54e3ef;return db[_0xaf46('0x58')]['findOne']({'where':{'id':_0x3b14d6[_0xaf46('0x5c')]['id']}})[_0xaf46('0x1f')](handleEntityNotFound(_0x4f4359,null))[_0xaf46('0x1f')](function(_0x46cb47){if(_0x46cb47){_0x16971a=_0x46cb47;_0x181adf[_0xaf46('0x42')]=_[_0xaf46('0x45')](db[_0xaf46('0x76')][_0xaf46('0x3f')]);_0x181adf[_0xaf46('0x44')]=_[_0xaf46('0x45')](_0x3b14d6[_0xaf46('0x44')]);_0x181adf[_0xaf46('0x50')]=_['intersection'](_0x181adf['model'],_0x181adf['query']);_0x514770[_0xaf46('0x47')]=_[_0xaf46('0x46')](_0x181adf[_0xaf46('0x42')],qs[_0xaf46('0x48')](_0x3b14d6[_0xaf46('0x44')][_0xaf46('0x48')]));_0x514770['attributes']=_0x514770[_0xaf46('0x47')][_0xaf46('0x49')]?_0x514770['attributes']:_0x181adf[_0xaf46('0x42')];_0x514770['order']=qs['sort'](_0x3b14d6['query'][_0xaf46('0x4e')]);_0x514770[_0xaf46('0x4f')]=qs[_0xaf46('0x50')](_['pick'](_0x3b14d6[_0xaf46('0x44')],_0x181adf['filters']));if(_0x3b14d6[_0xaf46('0x44')][_0xaf46('0x52')]){_0x514770[_0xaf46('0x4f')]=_[_0xaf46('0x54')](_0x514770[_0xaf46('0x4f')],{'$or':_[_0xaf46('0x43')](_0x514770[_0xaf46('0x47')],function(_0x3ef149){var _0x1234eb={};_0x1234eb[_0x3ef149]={'$like':'%'+_0x3b14d6['query'][_0xaf46('0x52')]+'%'};return _0x1234eb;})});}_0x514770=_[_0xaf46('0x54')]({},_0x514770,_0x3b14d6[_0xaf46('0x55')]);return _0x16971a['getAgents'](_0x514770);}})[_0xaf46('0x1f')](function(_0xb46276){if(_0xb46276){_0x54e3ef=_0xb46276[_0xaf46('0x49')];if(!_0x3b14d6[_0xaf46('0x44')]['hasOwnProperty'](_0xaf46('0x4b'))){_0x514770[_0xaf46('0x4c')]=qs[_0xaf46('0x4c')](_0x3b14d6[_0xaf46('0x44')][_0xaf46('0x4c')]);_0x514770['offset']=qs[_0xaf46('0x2d')](_0x3b14d6[_0xaf46('0x44')]['offset']);}return _0x16971a['getAgents'](_0x514770);}})[_0xaf46('0x1f')](function(_0x1eab77){if(_0x1eab77){return _0x1eab77?{'count':_0x54e3ef,'rows':_0x1eab77}:null;}})['then'](respondWithResult(_0x4f4359,null))[_0xaf46('0x5a')](handleError(_0x4f4359,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index 80dba6a..33269a6 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 _0xf663=['hook','exports','../../mysqldb','FaxAccount','setMaxListeners','save','emit','hasOwnProperty'];(function(_0x57cb4f,_0x541f57){var _0x29bb45=function(_0x462bee){while(--_0x462bee){_0x57cb4f['push'](_0x57cb4f['shift']());}};_0x29bb45(++_0x541f57);}(_0xf663,0x1aa));var _0x3f66=function(_0x38cac1,_0x1c5d2f){_0x38cac1=_0x38cac1-0x0;var _0x2938b3=_0xf663[_0x38cac1];return _0x2938b3;};'use strict';var EventEmitter=require('events');var FaxAccount=require(_0x3f66('0x0'))['db'][_0x3f66('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x3f66('0x2')](0x0);var events={'afterCreate':_0x3f66('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x571923){return function(_0x568f58,_0x349f89,_0x289ad6){FaxAccountEvents[_0x3f66('0x4')](_0x571923+':'+_0x568f58['id'],_0x568f58);FaxAccountEvents[_0x3f66('0x4')](_0x571923,_0x568f58);_0x289ad6(null);};}for(var e in events){if(events[_0x3f66('0x5')](e)){var event=events[e];FaxAccount[_0x3f66('0x6')](e,emitEvent(event));}}module[_0x3f66('0x7')]=FaxAccountEvents; \ No newline at end of file +var _0x754a=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxAccount','save','update'];(function(_0x1e89a2,_0x377290){var _0x436508=function(_0xa9c987){while(--_0xa9c987){_0x1e89a2['push'](_0x1e89a2['shift']());}};_0x436508(++_0x377290);}(_0x754a,0x127));var _0xa754=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0x754a[_0x3511d3];return _0x5d6321;};'use strict';var EventEmitter=require(_0xa754('0x0'));var FaxAccount=require(_0xa754('0x1'))['db'][_0xa754('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa754('0x3'),'afterUpdate':_0xa754('0x4'),'afterDestroy':_0xa754('0x5')};function emitEvent(_0x4292b7){return function(_0x2180dc,_0x16f2b6,_0x9eb10c){FaxAccountEvents[_0xa754('0x6')](_0x4292b7+':'+_0x2180dc['id'],_0x2180dc);FaxAccountEvents[_0xa754('0x6')](_0x4292b7,_0x2180dc);_0x9eb10c(null);};}for(var e in events){if(events[_0xa754('0x7')](e)){var event=events[e];FaxAccount[_0xa754('0x8')](e,emitEvent(event));}}module[_0xa754('0x9')]=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index 08ce761..54ca25e 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 _0x80ba=['fax_accounts','lodash','util','../../config/logger','api','request-promise','../../config/environment','./faxAccount.attributes','exports','define','FaxAccount'];(function(_0x2659eb,_0x42d7c8){var _0x202454=function(_0x2a2d57){while(--_0x2a2d57){_0x2659eb['push'](_0x2659eb['shift']());}};_0x202454(++_0x42d7c8);}(_0x80ba,0xc7));var _0xa80b=function(_0x552ed3,_0x4993e9){_0x552ed3=_0x552ed3-0x0;var _0x64fa8b=_0x80ba[_0x552ed3];return _0x64fa8b;};'use strict';var _=require(_0xa80b('0x0'));var util=require(_0xa80b('0x1'));var logger=require(_0xa80b('0x2'))(_0xa80b('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa80b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xa80b('0x5'));var attributes=require(_0xa80b('0x6'));module[_0xa80b('0x7')]=function(_0x1d590d,_0x59a291){return _0x1d590d[_0xa80b('0x8')](_0xa80b('0x9'),attributes,{'tableName':_0xa80b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3262=['../../config/logger','api','request-promise','path','rimraf','./faxAccount.attributes','exports','define','lodash','util'];(function(_0x10b06,_0x58d200){var _0x56d0f2=function(_0x5a3078){while(--_0x5a3078){_0x10b06['push'](_0x10b06['shift']());}};_0x56d0f2(++_0x58d200);}(_0x3262,0x1e8));var _0x2326=function(_0x5b9d3a,_0x1f1842){_0x5b9d3a=_0x5b9d3a-0x0;var _0x383375=_0x3262[_0x5b9d3a];return _0x383375;};'use strict';var _=require(_0x2326('0x0'));var util=require(_0x2326('0x1'));var logger=require(_0x2326('0x2'))(_0x2326('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2326('0x4'));var fs=require('fs');var path=require(_0x2326('0x5'));var rimraf=require(_0x2326('0x6'));var config=require('../../config/environment');var attributes=require(_0x2326('0x7'));module[_0x2326('0x8')]=function(_0x597ef6,_0x44ba57){return _0x597ef6[_0x2326('0x9')]('FaxAccount',attributes,{'tableName':'fax_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.rpc.js b/server/api/faxAccount/faxAccount.rpc.js index a1cefed..3bbf14e 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 _0xe1ae=['lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','FaxAccount,\x20%s,\x20%s','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','GetFaxAccount','FaxAccount','findAll','options','where','attributes','limit','include','map','model','catch','NotifyFaxAccount','body','fax','Sequelize','ValidationError','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','List','CmContact','Contacts','DESC','FaxApplication','Applications','applications','list','orderBy','priority','asc','create','contact','FaxInteraction','Contact\x20not\x20found','get','autoclose','push','length','close','unmanaged','*,*,*,*','created','interaction','FaxMessage','ContactId','AttachmentId','UserId','name','agent','startRouting','Start'];(function(_0x19c94b,_0xba17c0){var _0x50c162=function(_0x5a3498){while(--_0x5a3498){_0x19c94b['push'](_0x19c94b['shift']());}};_0x50c162(++_0xba17c0);}(_0xe1ae,0x168));var _0xee1a=function(_0x297df8,_0x14a1b3){_0x297df8=_0x297df8-0x0;var _0x384d86=_0xe1ae[_0x297df8];return _0x384d86;};'use strict';var _=require(_0xee1a('0x0'));var util=require('util');var moment=require(_0xee1a('0x1'));var BPromise=require(_0xee1a('0x2'));var rs=require(_0xee1a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xee1a('0x4'))['db'];var utils=require(_0xee1a('0x5'));var logger=require(_0xee1a('0x6'))(_0xee1a('0x7'));var config=require('../../config/environment');var jayson=require(_0xee1a('0x8'));var client=jayson[_0xee1a('0x9')][_0xee1a('0xa')]({'port':0x232c});config[_0xee1a('0xb')]=_[_0xee1a('0xc')](config[_0xee1a('0xb')],{'host':_0xee1a('0xd'),'port':0x18eb});var socket=require(_0xee1a('0xe'))(new Redis(config['redis']));require('./faxAccount.socket')[_0xee1a('0xf')](socket);function respondWithRpcPromise(_0x54779e,_0x59cef2,_0xfb4713){return new BPromise(function(_0x4f055e,_0xb4c7fa){return client[_0xee1a('0x10')](_0x54779e,_0xfb4713)[_0xee1a('0x11')](function(_0x13d163){logger['info'](_0xee1a('0x12'),_0x59cef2,'request\x20sent');logger[_0xee1a('0x13')](_0xee1a('0x14'),_0x59cef2,'request\x20sent',JSON[_0xee1a('0x15')](_0x13d163));if(_0x13d163['error']){if(_0x13d163[_0xee1a('0x16')][_0xee1a('0x17')]===0x1f4){logger[_0xee1a('0x16')](_0xee1a('0x12'),_0x59cef2,_0x13d163[_0xee1a('0x16')][_0xee1a('0x18')]);return _0xb4c7fa(_0x13d163[_0xee1a('0x16')][_0xee1a('0x18')]);}logger['error']('FaxAccount,\x20%s,\x20%s',_0x59cef2,_0x13d163[_0xee1a('0x16')][_0xee1a('0x18')]);return _0x4f055e(_0x13d163[_0xee1a('0x16')][_0xee1a('0x18')]);}else{logger['info'](_0xee1a('0x12'),_0x59cef2,_0xee1a('0x19'));_0x4f055e(_0x13d163[_0xee1a('0x1a')][_0xee1a('0x18')]);}})['catch'](function(_0x3eb162){logger[_0xee1a('0x16')](_0xee1a('0x12'),_0x59cef2,_0x3eb162);_0xb4c7fa(_0x3eb162);});});}exports[_0xee1a('0x1b')]=function(_0x2d91e3){var _0x54b08c=this;return new Promise(function(_0x4f7cc9,_0x96c7ef){return db[_0xee1a('0x1c')][_0xee1a('0x1d')]({'raw':_0x2d91e3[_0xee1a('0x1e')]?_0x2d91e3[_0xee1a('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x2d91e3[_0xee1a('0x1e')]?_0x2d91e3[_0xee1a('0x1e')][_0xee1a('0x1f')]||null:null,'attributes':_0x2d91e3[_0xee1a('0x1e')]?_0x2d91e3[_0xee1a('0x1e')][_0xee1a('0x20')]||null:null,'limit':_0x2d91e3[_0xee1a('0x1e')]?_0x2d91e3[_0xee1a('0x1e')][_0xee1a('0x21')]||null:null,'include':_0x2d91e3[_0xee1a('0x1e')]?_0x2d91e3[_0xee1a('0x1e')][_0xee1a('0x22')]?_[_0xee1a('0x23')](_0x2d91e3['options'][_0xee1a('0x22')],function(_0x3e12dd){return{'model':db[_0x3e12dd[_0xee1a('0x24')]],'as':_0x3e12dd['as'],'attributes':_0x3e12dd['attributes'],'include':_0x3e12dd[_0xee1a('0x22')]?_[_0xee1a('0x23')](_0x3e12dd[_0xee1a('0x22')],function(_0x32a72f){return{'model':db[_0x32a72f['model']],'as':_0x32a72f['as'],'attributes':_0x32a72f[_0xee1a('0x20')],'include':_0x32a72f[_0xee1a('0x22')]?_[_0xee1a('0x23')](_0x32a72f['include'],function(_0x41001b){return{'model':db[_0x41001b[_0xee1a('0x24')]],'as':_0x41001b['as'],'attributes':_0x41001b[_0xee1a('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4ec0a1){logger['info'](_0xee1a('0x1b'),_0x2d91e3);logger[_0xee1a('0x13')](_0xee1a('0x1b'),_0x2d91e3,JSON[_0xee1a('0x15')](_0x4ec0a1));_0x4f7cc9(_0x4ec0a1);})[_0xee1a('0x25')](function(_0x18817f){logger[_0xee1a('0x16')](_0xee1a('0x1b'),_0x18817f[_0xee1a('0x18')],_0x2d91e3);_0x96c7ef(_0x54b08c['error'](0x1f4,_0x18817f[_0xee1a('0x18')]));});});};exports[_0xee1a('0x26')]=function(_0x49a1e5,_0x3864e1,_0x2ae4e7){var _0x419018=this;return new Promise(function(_0x286abf,_0x39fe8c){var _0x413ddd={'body':_0x49a1e5[_0xee1a('0x27')],'channel':_0xee1a('0x28')};var _0xc78251=[];var _0x5009de=[];var _0x555899={};return db['CmContact']['describe']()[_0xee1a('0x11')](function(_0x52d1d4){if(!_0x52d1d4){throw new db[(_0xee1a('0x29'))][(_0xee1a('0x2a'))](_0xee1a('0x2b'));}_0xc78251=_[_0xee1a('0x2c')](_[_0xee1a('0x2d')](_0x52d1d4),[_0xee1a('0x2e'),_0xee1a('0x2f')]);_0x5009de=_[_0xee1a('0x2c')](_[_0xee1a('0x2d')](_0x52d1d4),[_0xee1a('0x2e'),_0xee1a('0x2f'),'CompanyId',_0xee1a('0x30')]);if(_0x49a1e5['body']['id']){delete _0x49a1e5['body']['id'];}if(_[_0xee1a('0x31')](_0x49a1e5[_0xee1a('0x27')][_0xee1a('0x32')])){throw new db[(_0xee1a('0x29'))][(_0xee1a('0x2a'))](_0xee1a('0x33'));}if(_[_0xee1a('0x31')](_0x49a1e5[_0xee1a('0x27')][_0xee1a('0x27')])||_0x49a1e5['body'][_0xee1a('0x27')]===''){throw new db['Sequelize'][(_0xee1a('0x2a'))](_0xee1a('0x34'));}if(_[_0xee1a('0x31')](_0x49a1e5['body'][_0xee1a('0x35')])){throw new db[(_0xee1a('0x29'))]['ValidationError'](_0xee1a('0x36')+_0x5009de);}if(!_['includes'](_0x5009de,_0x49a1e5[_0xee1a('0x27')][_0xee1a('0x35')])){throw new db['Sequelize'][(_0xee1a('0x2a'))](_0xee1a('0x37')+_0x5009de);}_0x555899[_0x49a1e5['body'][_0xee1a('0x35')]]=_0x49a1e5[_0xee1a('0x27')][_0xee1a('0x32')];})['then'](function(){return db['FaxAccount'][_0xee1a('0x38')]({'where':{'id':_0x49a1e5[_0xee1a('0x39')]['id']},'include':[{'model':db['CmList'],'as':_0xee1a('0x3a'),'include':[{'model':db[_0xee1a('0x3b')],'as':_0xee1a('0x3c'),'where':_0x555899,'limit':0x1,'order':[[_0xee1a('0x2f'),_0xee1a('0x3d')]]}]},{'model':db[_0xee1a('0x3e')],'as':_0xee1a('0x3f')}]});})[_0xee1a('0x11')](function(_0x4e6236){if(_0x4e6236&&_0x4e6236[_0xee1a('0x3a')]){var _0x3b837a=_0x4e6236['get']({'plain':!![]});_0x413ddd['account']=_0x3b837a;_0x413ddd[_0xee1a('0x40')]=_0x3b837a[_0xee1a('0x3f')];_0x413ddd[_0xee1a('0x41')]=_0x3b837a[_0xee1a('0x3a')];_0x413ddd[_0xee1a('0x40')]=_[_0xee1a('0x42')](_0x413ddd[_0xee1a('0x40')],[_0xee1a('0x43')],[_0xee1a('0x44')]);if(_0x413ddd[_0xee1a('0x39')][_0xee1a('0x3f')]){delete _0x413ddd[_0xee1a('0x39')][_0xee1a('0x3f')];}if(_0x413ddd[_0xee1a('0x39')]['List']&&_0x413ddd['account'][_0xee1a('0x3a')][_0xee1a('0x3c')]['length']){return _0x413ddd[_0xee1a('0x39')][_0xee1a('0x3a')][_0xee1a('0x3c')][0x0];}var _0xabd43b=_[_0xee1a('0xc')](_0x49a1e5[_0xee1a('0x27')],{'firstName':_0x49a1e5['body'][_0xee1a('0x32')],'ListId':_0x3b837a[_0xee1a('0x30')]});_0xabd43b[_0x49a1e5[_0xee1a('0x27')]['mapKey']]=_0x49a1e5['body'][_0xee1a('0x32')];return db[_0xee1a('0x3b')][_0xee1a('0x45')](_0xabd43b,{'fields':_0xc78251,'raw':!![]});}})['then'](function(_0x1d534e){_0x413ddd[_0xee1a('0x46')]=_0x1d534e;if(_0x1d534e){var _0x3444b2={'ContactId':_0x1d534e['id'],'FaxAccountId':_0x49a1e5[_0xee1a('0x39')]['id'],'fax':_0x1d534e[_0xee1a('0x28')]};return db[_0xee1a('0x47')][_0xee1a('0x38')]({'where':{'ContactId':_0x1d534e['id'],'closed':![],'FaxAccountId':_0x49a1e5[_0xee1a('0x39')]['id']}})[_0xee1a('0x11')](function(_0x27ce87){if(_0x27ce87){return[_0x27ce87,![]];}return db[_0xee1a('0x47')][_0xee1a('0x45')](_0x3444b2)[_0xee1a('0x11')](function(_0xfae831){return[_0xfae831,!![]];});});}else{throw new Error(_0xee1a('0x48'));}})['spread'](function(_0x347716,_0x3d2b59){var _0x2c8a7b=_0x347716[_0xee1a('0x49')]({'plain':!![]});if(_0x3d2b59){if(_0x413ddd[_0xee1a('0x39')][_0xee1a('0x4a')]){_0x413ddd[_0xee1a('0x40')][_0xee1a('0x4b')]({'id':0x0,'priority':_0x413ddd[_0xee1a('0x40')][_0xee1a('0x4c')]+0x1,'app':_0xee1a('0x4d'),'appdata':_0xee1a('0x4e'),'interval':_0xee1a('0x4f')});}_0x2c8a7b[_0xee1a('0x50')]=!![];}else{_0x2c8a7b['created']=![];}_0x413ddd[_0xee1a('0x51')]=_0x2c8a7b;return db[_0xee1a('0x52')][_0xee1a('0x45')]({'body':_0x49a1e5[_0xee1a('0x27')][_0xee1a('0x27')],'FaxAccountId':_0x49a1e5[_0xee1a('0x39')]['id'],'FaxInteractionId':_0x347716['id'],'direction':'in','ContactId':_0x347716[_0xee1a('0x53')],'AttachmentId':_0x49a1e5[_0xee1a('0x27')][_0xee1a('0x54')]});})['then'](function(_0x58f7d4){_0x413ddd[_0xee1a('0x18')]=_0x58f7d4;if(_0x413ddd['interaction'][_0xee1a('0x55')]){return db['User']['find']({'attributes':['id',_0xee1a('0x56')],'where':{'id':_0x413ddd['interaction'][_0xee1a('0x55')]}})[_0xee1a('0x11')](function(_0x205d0a){if(_0x205d0a){_0x413ddd[_0xee1a('0x40')]['unshift']({'id':0x0,'priority':0x0,'app':_0xee1a('0x57'),'appdata':_0x205d0a[_0xee1a('0x56')]+','+(_0x413ddd[_0xee1a('0x39')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start',_0xee1a('0x58'),_0x413ddd);});}return respondWithRpcPromise(_0xee1a('0x59'),_0xee1a('0x58'),_0x413ddd);})[_0xee1a('0x11')](function(_0x26c361){_0x286abf(_0x26c361);})[_0xee1a('0x25')](function(_0x50a8a2){_0x39fe8c(_0x419018[_0xee1a('0x16')](0x1f4,_0x50a8a2['message']));});});}; \ No newline at end of file +var _0x6723=['create','contact','Contact\x20not\x20found','spread','push','close','unmanaged','*,*,*,*','created','interaction','FaxMessage','ContactId','AttachmentId','UserId','name','unshift','agent','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','./faxAccount.socket','register','request','then','info','FaxAccount,\x20%s,\x20%s','debug','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','GetFaxAccount','FaxAccount','findAll','options','raw','where','attributes','limit','include','map','model','stringify','catch','body','fax','Sequelize','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','CompanyId','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','ValidationError','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','CmContact','FaxApplication','Applications','List','get','applications','orderBy','priority','asc','Contacts','length'];(function(_0x57a50d,_0x2871f8){var _0x1b25b3=function(_0x45691e){while(--_0x45691e){_0x57a50d['push'](_0x57a50d['shift']());}};_0x1b25b3(++_0x2871f8);}(_0x6723,0x184));var _0x3672=function(_0x67bbb5,_0x97de12){_0x67bbb5=_0x67bbb5-0x0;var _0x1050ce=_0x6723[_0x67bbb5];return _0x1050ce;};'use strict';var _=require(_0x3672('0x0'));var util=require(_0x3672('0x1'));var moment=require(_0x3672('0x2'));var BPromise=require('bluebird');var rs=require(_0x3672('0x3'));var fs=require('fs');var Redis=require(_0x3672('0x4'));var db=require(_0x3672('0x5'))['db'];var utils=require(_0x3672('0x6'));var logger=require(_0x3672('0x7'))(_0x3672('0x8'));var config=require(_0x3672('0x9'));var jayson=require(_0x3672('0xa'));var client=jayson[_0x3672('0xb')][_0x3672('0xc')]({'port':0x232c});config['redis']=_[_0x3672('0xd')](config[_0x3672('0xe')],{'host':_0x3672('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3672('0xe')]));require(_0x3672('0x10'))[_0x3672('0x11')](socket);function respondWithRpcPromise(_0x5aef45,_0x5a139c,_0x3924e7){return new BPromise(function(_0x570efc,_0x9e9d8a){return client[_0x3672('0x12')](_0x5aef45,_0x3924e7)[_0x3672('0x13')](function(_0x4ec963){logger[_0x3672('0x14')](_0x3672('0x15'),_0x5a139c,'request\x20sent');logger[_0x3672('0x16')](_0x3672('0x17'),_0x5a139c,_0x3672('0x18'),JSON['stringify'](_0x4ec963));if(_0x4ec963[_0x3672('0x19')]){if(_0x4ec963[_0x3672('0x19')][_0x3672('0x1a')]===0x1f4){logger[_0x3672('0x19')](_0x3672('0x15'),_0x5a139c,_0x4ec963[_0x3672('0x19')][_0x3672('0x1b')]);return _0x9e9d8a(_0x4ec963[_0x3672('0x19')][_0x3672('0x1b')]);}logger[_0x3672('0x19')](_0x3672('0x15'),_0x5a139c,_0x4ec963['error'][_0x3672('0x1b')]);return _0x570efc(_0x4ec963[_0x3672('0x19')][_0x3672('0x1b')]);}else{logger[_0x3672('0x14')](_0x3672('0x15'),_0x5a139c,_0x3672('0x18'));_0x570efc(_0x4ec963['result'][_0x3672('0x1b')]);}})['catch'](function(_0xa8bfab){logger[_0x3672('0x19')](_0x3672('0x15'),_0x5a139c,_0xa8bfab);_0x9e9d8a(_0xa8bfab);});});}exports[_0x3672('0x1c')]=function(_0x219092){var _0x502065=this;return new Promise(function(_0x34b4c4,_0x40524d){return db[_0x3672('0x1d')][_0x3672('0x1e')]({'raw':_0x219092[_0x3672('0x1f')]?_0x219092[_0x3672('0x1f')][_0x3672('0x20')]===undefined?!![]:![]:!![],'where':_0x219092[_0x3672('0x1f')]?_0x219092[_0x3672('0x1f')][_0x3672('0x21')]||null:null,'attributes':_0x219092[_0x3672('0x1f')]?_0x219092[_0x3672('0x1f')][_0x3672('0x22')]||null:null,'limit':_0x219092[_0x3672('0x1f')]?_0x219092[_0x3672('0x1f')][_0x3672('0x23')]||null:null,'include':_0x219092[_0x3672('0x1f')]?_0x219092[_0x3672('0x1f')][_0x3672('0x24')]?_[_0x3672('0x25')](_0x219092[_0x3672('0x1f')][_0x3672('0x24')],function(_0x38778b){return{'model':db[_0x38778b[_0x3672('0x26')]],'as':_0x38778b['as'],'attributes':_0x38778b['attributes'],'include':_0x38778b[_0x3672('0x24')]?_[_0x3672('0x25')](_0x38778b[_0x3672('0x24')],function(_0x14d938){return{'model':db[_0x14d938['model']],'as':_0x14d938['as'],'attributes':_0x14d938[_0x3672('0x22')],'include':_0x14d938[_0x3672('0x24')]?_[_0x3672('0x25')](_0x14d938[_0x3672('0x24')],function(_0x5b9efd){return{'model':db[_0x5b9efd['model']],'as':_0x5b9efd['as'],'attributes':_0x5b9efd['attributes']};}):[]};}):[]};}):[]:[]})[_0x3672('0x13')](function(_0x566595){logger['info'](_0x3672('0x1c'),_0x219092);logger['debug'](_0x3672('0x1c'),_0x219092,JSON[_0x3672('0x27')](_0x566595));_0x34b4c4(_0x566595);})[_0x3672('0x28')](function(_0x4d23be){logger[_0x3672('0x19')](_0x3672('0x1c'),_0x4d23be[_0x3672('0x1b')],_0x219092);_0x40524d(_0x502065[_0x3672('0x19')](0x1f4,_0x4d23be[_0x3672('0x1b')]));});});};exports['NotifyFaxAccount']=function(_0x36a2a3,_0x184b89,_0x5f5494){var _0x1343b3=this;return new Promise(function(_0x19e65a,_0x4d3992){var _0xc297d6={'body':_0x36a2a3[_0x3672('0x29')],'channel':_0x3672('0x2a')};var _0x444802=[];var _0x84ffd5=[];var _0x8771e1={};return db['CmContact']['describe']()[_0x3672('0x13')](function(_0x59a73b){if(!_0x59a73b){throw new db[(_0x3672('0x2b'))]['ValidationError'](_0x3672('0x2c'));}_0x444802=_[_0x3672('0x2d')](_[_0x3672('0x2e')](_0x59a73b),['createdAt','updatedAt']);_0x84ffd5=_['difference'](_['keys'](_0x59a73b),[_0x3672('0x2f'),_0x3672('0x30'),_0x3672('0x31'),_0x3672('0x32')]);if(_0x36a2a3['body']['id']){delete _0x36a2a3[_0x3672('0x29')]['id'];}if(_['isNil'](_0x36a2a3['body'][_0x3672('0x33')])){throw new db[(_0x3672('0x2b'))]['ValidationError'](_0x3672('0x34'));}if(_['isNil'](_0x36a2a3[_0x3672('0x29')][_0x3672('0x29')])||_0x36a2a3['body'][_0x3672('0x29')]===''){throw new db[(_0x3672('0x2b'))]['ValidationError'](_0x3672('0x35'));}if(_[_0x3672('0x36')](_0x36a2a3['body'][_0x3672('0x37')])){throw new db[(_0x3672('0x2b'))]['ValidationError'](_0x3672('0x38')+_0x84ffd5);}if(!_['includes'](_0x84ffd5,_0x36a2a3[_0x3672('0x29')][_0x3672('0x37')])){throw new db['Sequelize'][(_0x3672('0x39'))](_0x3672('0x3a')+_0x84ffd5);}_0x8771e1[_0x36a2a3['body']['mapKey']]=_0x36a2a3['body'][_0x3672('0x33')];})[_0x3672('0x13')](function(){return db['FaxAccount'][_0x3672('0x3b')]({'where':{'id':_0x36a2a3[_0x3672('0x3c')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x3672('0x3d')],'as':'Contacts','where':_0x8771e1,'limit':0x1,'order':[[_0x3672('0x30'),'DESC']]}]},{'model':db[_0x3672('0x3e')],'as':_0x3672('0x3f')}]});})[_0x3672('0x13')](function(_0xc1b29){if(_0xc1b29&&_0xc1b29[_0x3672('0x40')]){var _0x1f0caf=_0xc1b29[_0x3672('0x41')]({'plain':!![]});_0xc297d6[_0x3672('0x3c')]=_0x1f0caf;_0xc297d6[_0x3672('0x42')]=_0x1f0caf[_0x3672('0x3f')];_0xc297d6['list']=_0x1f0caf[_0x3672('0x40')];_0xc297d6[_0x3672('0x42')]=_[_0x3672('0x43')](_0xc297d6[_0x3672('0x42')],[_0x3672('0x44')],[_0x3672('0x45')]);if(_0xc297d6[_0x3672('0x3c')][_0x3672('0x3f')]){delete _0xc297d6[_0x3672('0x3c')]['Applications'];}if(_0xc297d6[_0x3672('0x3c')][_0x3672('0x40')]&&_0xc297d6[_0x3672('0x3c')]['List'][_0x3672('0x46')][_0x3672('0x47')]){return _0xc297d6[_0x3672('0x3c')]['List'][_0x3672('0x46')][0x0];}var _0x110b34=_['defaults'](_0x36a2a3['body'],{'firstName':_0x36a2a3['body']['from'],'ListId':_0x1f0caf['ListId']});_0x110b34[_0x36a2a3[_0x3672('0x29')][_0x3672('0x37')]]=_0x36a2a3[_0x3672('0x29')]['from'];return db[_0x3672('0x3d')][_0x3672('0x48')](_0x110b34,{'fields':_0x444802,'raw':!![]});}})[_0x3672('0x13')](function(_0x922c9e){_0xc297d6[_0x3672('0x49')]=_0x922c9e;if(_0x922c9e){var _0x52c42e={'ContactId':_0x922c9e['id'],'FaxAccountId':_0x36a2a3[_0x3672('0x3c')]['id'],'fax':_0x922c9e[_0x3672('0x2a')]};return db['FaxInteraction'][_0x3672('0x3b')]({'where':{'ContactId':_0x922c9e['id'],'closed':![],'FaxAccountId':_0x36a2a3[_0x3672('0x3c')]['id']}})[_0x3672('0x13')](function(_0x540623){if(_0x540623){return[_0x540623,![]];}return db['FaxInteraction'][_0x3672('0x48')](_0x52c42e)['then'](function(_0x5e8d10){return[_0x5e8d10,!![]];});});}else{throw new Error(_0x3672('0x4a'));}})[_0x3672('0x4b')](function(_0x7da25,_0x55fe45){var _0x17d382=_0x7da25['get']({'plain':!![]});if(_0x55fe45){if(_0xc297d6['account']['autoclose']){_0xc297d6[_0x3672('0x42')][_0x3672('0x4c')]({'id':0x0,'priority':_0xc297d6['applications'][_0x3672('0x47')]+0x1,'app':_0x3672('0x4d'),'appdata':_0x3672('0x4e'),'interval':_0x3672('0x4f')});}_0x17d382[_0x3672('0x50')]=!![];}else{_0x17d382[_0x3672('0x50')]=![];}_0xc297d6[_0x3672('0x51')]=_0x17d382;return db[_0x3672('0x52')][_0x3672('0x48')]({'body':_0x36a2a3['body']['body'],'FaxAccountId':_0x36a2a3[_0x3672('0x3c')]['id'],'FaxInteractionId':_0x7da25['id'],'direction':'in','ContactId':_0x7da25[_0x3672('0x53')],'AttachmentId':_0x36a2a3['body'][_0x3672('0x54')]});})[_0x3672('0x13')](function(_0x70fca4){_0xc297d6[_0x3672('0x1b')]=_0x70fca4;if(_0xc297d6[_0x3672('0x51')][_0x3672('0x55')]){return db['User'][_0x3672('0x3b')]({'attributes':['id',_0x3672('0x56')],'where':{'id':_0xc297d6[_0x3672('0x51')][_0x3672('0x55')]}})[_0x3672('0x13')](function(_0x46466a){if(_0x46466a){_0xc297d6[_0x3672('0x42')][_0x3672('0x57')]({'id':0x0,'priority':0x0,'app':_0x3672('0x58'),'appdata':_0x46466a[_0x3672('0x56')]+','+(_0xc297d6[_0x3672('0x3c')][_0x3672('0x59')]||0xa),'interval':_0x3672('0x4f')});}return respondWithRpcPromise(_0x3672('0x5a'),'startRouting',_0xc297d6);});}return respondWithRpcPromise(_0x3672('0x5a'),_0x3672('0x5b'),_0xc297d6);})[_0x3672('0x13')](function(_0xaffeb1){_0x19e65a(_0xaffeb1);})[_0x3672('0x28')](function(_0x21fd44){_0x4d3992(_0x1343b3[_0x3672('0x19')](0x1f4,_0x21fd44[_0x3672('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 59c5ab5..0b7c170 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 _0xa310=['length','faxAccount:','./faxAccount.events','remove','update','removeListener'];(function(_0x5cb17c,_0x213243){var _0x137c45=function(_0x1fa9bb){while(--_0x1fa9bb){_0x5cb17c['push'](_0x5cb17c['shift']());}};_0x137c45(++_0x213243);}(_0xa310,0x194));var _0x0a31=function(_0x3eed7f,_0x2d11c0){_0x3eed7f=_0x3eed7f-0x0;var _0x23dea=_0xa310[_0x3eed7f];return _0x23dea;};'use strict';var FaxAccountEvents=require(_0x0a31('0x0'));var events=['save',_0x0a31('0x1'),_0x0a31('0x2')];function createListener(_0x2b0bcf,_0x437cf2){return function(_0x1a3f4a){_0x437cf2['emit'](_0x2b0bcf,_0x1a3f4a);};}function removeListener(_0x4bb78e,_0x2a54ae){return function(){FaxAccountEvents[_0x0a31('0x3')](_0x4bb78e,_0x2a54ae);};}exports['register']=function(_0x4235ca){for(var _0x3fdc6e=0x0,_0x1fb448=events[_0x0a31('0x4')];_0x3fdc6e<_0x1fb448;_0x3fdc6e++){var _0x104f0d=events[_0x3fdc6e];var _0x2b6df5=createListener(_0x0a31('0x5')+_0x104f0d,_0x4235ca);FaxAccountEvents['on'](_0x104f0d,_0x2b6df5);}}; \ No newline at end of file +var _0x231a=['./faxAccount.events','save','remove','update','emit','removeListener','register','length','faxAccount:'];(function(_0x4ace79,_0x3f948e){var _0x44f300=function(_0xfcd09d){while(--_0xfcd09d){_0x4ace79['push'](_0x4ace79['shift']());}};_0x44f300(++_0x3f948e);}(_0x231a,0xb4));var _0xa231=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x231a[_0x20a584];return _0x4b41a8;};'use strict';var FaxAccountEvents=require(_0xa231('0x0'));var events=[_0xa231('0x1'),_0xa231('0x2'),_0xa231('0x3')];function createListener(_0x3f0c61,_0x58b18e){return function(_0x308bf6){_0x58b18e[_0xa231('0x4')](_0x3f0c61,_0x308bf6);};}function removeListener(_0x30fac9,_0x5732c6){return function(){FaxAccountEvents[_0xa231('0x5')](_0x30fac9,_0x5732c6);};}exports[_0xa231('0x6')]=function(_0x5cd1c3){for(var _0x3d1af7=0x0,_0x5a470f=events[_0xa231('0x7')];_0x3d1af7<_0x5a470f;_0x3d1af7++){var _0x3949cb=events[_0x3d1af7];var _0x37f63c=createListener(_0xa231('0x8')+_0x3949cb,_0x5cd1c3);FaxAccountEvents['on'](_0x3949cb,_0x37f63c);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 068ed60..f0511f2 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(_0x5e7299,_0x44ed67){var _0x2227e1=function(_0x164f29){while(--_0x164f29){_0x5e7299['push'](_0x5e7299['shift']());}};_0x2227e1(++_0x44ed67);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xa9e0[_0x6c993a];return _0x27f547;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getApplications']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['post']('/',auth[_0x0a9e('0xd')](),controller['create']);router[_0x0a9e('0x16')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router['post'](_0x0a9e('0x18'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x16')](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1a')]);router[_0x0a9e('0x16')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x16')]('/addaccountapplications',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router['post'](_0x0a9e('0x1d'),auth['isAuthenticated'](),controller['updateAccountApplications']);router[_0x0a9e('0x16')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['post'](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0x22'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x24')]);router[_0x0a9e('0x25')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x26')]);router['delete'](_0x0a9e('0x18'),auth['isAuthenticated'](),controller[_0x0a9e('0x27')]);router[_0x0a9e('0x25')](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x28')]);module[_0x0a9e('0x29')]=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','index','/describe','show','/:id/dispositions','isAuthenticated','getDispositions','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','addInteraction','addApplications','addAccountApplications','/updateaccountapplications','/:id/send','send','addAgents','put','/:id','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path'];(function(_0x483c0a,_0xcc3bc1){var _0x312228=function(_0x7c6585){while(--_0x7c6585){_0x483c0a['push'](_0x483c0a['shift']());}};_0x312228(++_0xcc3bc1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xa9e0[_0x5b561d];return _0x431060;};'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 9267da4..471f94e 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 _0xa49e=['exports','INTEGER','noop','STRING'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa49e,0x160));var _0xea49=function(_0x4879b8,_0x55569f){_0x4879b8=_0x4879b8-0x0;var _0x34abae=_0xa49e[_0x4879b8];return _0x34abae;};'use strict';var Sequelize=require('sequelize');module[_0xea49('0x0')]={'priority':{'type':Sequelize[_0xea49('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xea49('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xea49('0x3')]},'interval':{'type':Sequelize[_0xea49('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0xc007=['STRING','*,*,*,*','sequelize','INTEGER','TEXT'];(function(_0xe616f4,_0x433679){var _0x259e56=function(_0x426364){while(--_0x426364){_0xe616f4['push'](_0xe616f4['shift']());}};_0x259e56(++_0x433679);}(_0xc007,0x183));var _0x7c00=function(_0x13a1ee,_0xb1f0bd){_0x13a1ee=_0x13a1ee-0x0;var _0x2544e1=_0xc007[_0x13a1ee];return _0x2544e1;};'use strict';var Sequelize=require(_0x7c00('0x0'));module['exports']={'priority':{'type':Sequelize[_0x7c00('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x7c00('0x2')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x7c00('0x3')],'defaultValue':_0x7c00('0x4')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index f5ea432..1ed8eab 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 _0xda49=['rimraf','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','json','offset','undefined','limit','count','set','reject','save','update','then','destroy','end','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','FaxApplication','findAll','rows','includeAll','include','find','catch','create','body','params'];(function(_0x3bd8f9,_0x54ed38){var _0x355b08=function(_0x29dd5e){while(--_0x29dd5e){_0x3bd8f9['push'](_0x3bd8f9['shift']());}};_0x355b08(++_0x54ed38);}(_0xda49,0x94));var _0x9da4=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0xda49[_0x2064e5];return _0x21a233;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9da4('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9da4('0x1'));var rp=require('request-promise');var moment=require(_0x9da4('0x2'));var BPromise=require(_0x9da4('0x3'));var Mustache=require(_0x9da4('0x4'));var util=require(_0x9da4('0x5'));var path=require(_0x9da4('0x6'));var sox=require('sox');var csv=require(_0x9da4('0x7'));var ejs=require(_0x9da4('0x8'));var fs=require('fs');var fs_extra=require(_0x9da4('0x9'));var _=require(_0x9da4('0xa'));var squel=require(_0x9da4('0xb'));var crypto=require(_0x9da4('0xc'));var jsforce=require(_0x9da4('0xd'));var deskjs=require(_0x9da4('0xe'));var toCsv=require(_0x9da4('0x7'));var querystring=require(_0x9da4('0xf'));var Papa=require(_0x9da4('0x10'));var Redis=require(_0x9da4('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x9da4('0x12'));var as=require(_0x9da4('0x13'));var hardwareService=require(_0x9da4('0x14'));var logger=require(_0x9da4('0x15'))(_0x9da4('0x16'));var utils=require(_0x9da4('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x136df8,_0x26333d){_0x26333d=_0x26333d||0xcc;return function(_0x28bcf0){if(_0x28bcf0){return _0x136df8[_0x9da4('0x18')](_0x26333d);}return _0x136df8['status'](_0x26333d)['end']();};}function respondWithResult(_0x733be4,_0x26cec9){_0x26cec9=_0x26cec9||0xc8;return function(_0x5f1353){if(_0x5f1353){return _0x733be4[_0x9da4('0x19')](_0x26cec9)[_0x9da4('0x1a')](_0x5f1353);}};}function respondWithFilteredResult(_0x1b2b54,_0x2848a2){return function(_0x359529){if(_0x359529){var _0x18dade=typeof _0x2848a2[_0x9da4('0x1b')]===_0x9da4('0x1c')&&typeof _0x2848a2[_0x9da4('0x1d')]===_0x9da4('0x1c');var _0x39cecd=_0x359529[_0x9da4('0x1e')];var _0x1d873a=_0x18dade?0x0:_0x2848a2[_0x9da4('0x1b')];var _0x4472f1=_0x18dade?_0x359529['count']:_0x2848a2[_0x9da4('0x1b')]+_0x2848a2[_0x9da4('0x1d')];var _0x533dc6;if(_0x4472f1>=_0x39cecd){_0x4472f1=_0x39cecd;_0x533dc6=0xc8;}else{_0x533dc6=0xce;}_0x1b2b54['status'](_0x533dc6);return _0x1b2b54[_0x9da4('0x1f')]('Content-Range',_0x1d873a+'-'+_0x4472f1+'/'+_0x39cecd)[_0x9da4('0x1a')](_0x359529);}return null;};}function patchUpdates(_0x2cfd84){return function(_0x19e9bc){try{jsonpatch['apply'](_0x19e9bc,_0x2cfd84,!![]);}catch(_0x3353ed){return BPromise[_0x9da4('0x20')](_0x3353ed);}return _0x19e9bc[_0x9da4('0x21')]();};}function saveUpdates(_0x592ada,_0x20de0b){return function(_0x32a4ff){if(_0x32a4ff){return _0x32a4ff[_0x9da4('0x22')](_0x592ada)[_0x9da4('0x23')](function(_0x5aa959){return _0x5aa959;});}return null;};}function removeEntity(_0xc76449,_0x48b445){return function(_0x23341b){if(_0x23341b){return _0x23341b[_0x9da4('0x24')]()['then'](function(){_0xc76449[_0x9da4('0x19')](0xcc)[_0x9da4('0x25')]();});}};}function handleEntityNotFound(_0x3a595f,_0x3ecc95){return function(_0x4d0d8e){if(!_0x4d0d8e){_0x3a595f[_0x9da4('0x18')](0x194);}return _0x4d0d8e;};}function handleError(_0x9c4559,_0x21dd33){_0x21dd33=_0x21dd33||0x1f4;return function(_0x2d5daf){logger[_0x9da4('0x26')](_0x2d5daf[_0x9da4('0x27')]);if(_0x2d5daf['name']){delete _0x2d5daf[_0x9da4('0x28')];}_0x9c4559[_0x9da4('0x19')](_0x21dd33)[_0x9da4('0x29')](_0x2d5daf);};}exports[_0x9da4('0x2a')]=function(_0x39229f,_0xf55229){var _0x4afa26={},_0x84accf={},_0x3908a7={'count':0x0,'rows':[]};var _0x561a4b=_['map'](db['FaxApplication'][_0x9da4('0x2b')],function(_0x43b833){return{'name':_0x43b833[_0x9da4('0x2c')],'type':_0x43b833[_0x9da4('0x2d')][_0x9da4('0x2e')]};});_0x84accf[_0x9da4('0x2f')]=_[_0x9da4('0x30')](_0x561a4b,'name');_0x84accf[_0x9da4('0x31')]=_[_0x9da4('0x32')](_0x39229f['query']);_0x84accf[_0x9da4('0x33')]=_['intersection'](_0x84accf[_0x9da4('0x2f')],_0x84accf['query']);_0x4afa26[_0x9da4('0x34')]=_[_0x9da4('0x35')](_0x84accf['model'],qs[_0x9da4('0x36')](_0x39229f[_0x9da4('0x31')][_0x9da4('0x36')]));_0x4afa26[_0x9da4('0x34')]=_0x4afa26[_0x9da4('0x34')][_0x9da4('0x37')]?_0x4afa26[_0x9da4('0x34')]:_0x84accf['model'];if(!_0x39229f[_0x9da4('0x31')]['hasOwnProperty']('nolimit')){_0x4afa26['limit']=qs[_0x9da4('0x1d')](_0x39229f[_0x9da4('0x31')]['limit']);_0x4afa26[_0x9da4('0x1b')]=qs[_0x9da4('0x1b')](_0x39229f[_0x9da4('0x31')]['offset']);}_0x4afa26[_0x9da4('0x38')]=qs[_0x9da4('0x39')](_0x39229f['query']['sort']);_0x4afa26[_0x9da4('0x3a')]=qs[_0x9da4('0x33')](_[_0x9da4('0x3b')](_0x39229f['query'],_0x84accf[_0x9da4('0x33')]),_0x561a4b);if(_0x39229f[_0x9da4('0x31')][_0x9da4('0x3c')]){_0x4afa26[_0x9da4('0x3a')]=_[_0x9da4('0x3d')](_0x4afa26['where'],{'$or':_['map'](_0x561a4b,function(_0x565fbd){if(_0x565fbd['type']!==_0x9da4('0x3e')){var _0x1c1e55={};_0x1c1e55[_0x565fbd[_0x9da4('0x28')]]={'$like':'%'+_0x39229f['query'][_0x9da4('0x3c')]+'%'};return _0x1c1e55;}})});}_0x4afa26=_[_0x9da4('0x3d')]({},_0x4afa26,_0x39229f[_0x9da4('0x3f')]);var _0x2cd3c9={'where':_0x4afa26['where']};return db['FaxApplication'][_0x9da4('0x1e')](_0x2cd3c9)['then'](function(_0xbf0c73){_0x3908a7[_0x9da4('0x1e')]=_0xbf0c73;if(_0x39229f[_0x9da4('0x31')]['includeAll']){_0x4afa26['include']=[{'all':!![]}];}return db[_0x9da4('0x40')][_0x9da4('0x41')](_0x4afa26);})[_0x9da4('0x23')](function(_0x43ce08){_0x3908a7[_0x9da4('0x42')]=_0x43ce08;return _0x3908a7;})[_0x9da4('0x23')](respondWithFilteredResult(_0xf55229,_0x4afa26))['catch'](handleError(_0xf55229,null));};exports['show']=function(_0xd752c3,_0x3de867){var _0x41639e={'raw':!![],'where':{'id':_0xd752c3['params']['id']}},_0x59d786={};_0x59d786[_0x9da4('0x2f')]=_[_0x9da4('0x32')](db['FaxApplication'][_0x9da4('0x2b')]);_0x59d786[_0x9da4('0x31')]=_[_0x9da4('0x32')](_0xd752c3[_0x9da4('0x31')]);_0x59d786[_0x9da4('0x33')]=_['intersection'](_0x59d786[_0x9da4('0x2f')],_0x59d786[_0x9da4('0x31')]);_0x41639e[_0x9da4('0x34')]=_[_0x9da4('0x35')](_0x59d786['model'],qs['fields'](_0xd752c3[_0x9da4('0x31')][_0x9da4('0x36')]));_0x41639e[_0x9da4('0x34')]=_0x41639e['attributes'][_0x9da4('0x37')]?_0x41639e[_0x9da4('0x34')]:_0x59d786[_0x9da4('0x2f')];if(_0xd752c3[_0x9da4('0x31')][_0x9da4('0x43')]){_0x41639e[_0x9da4('0x44')]=[{'all':!![]}];}_0x41639e=_[_0x9da4('0x3d')]({},_0x41639e,_0xd752c3[_0x9da4('0x3f')]);return db[_0x9da4('0x40')][_0x9da4('0x45')](_0x41639e)[_0x9da4('0x23')](handleEntityNotFound(_0x3de867,null))['then'](respondWithResult(_0x3de867,null))[_0x9da4('0x46')](handleError(_0x3de867,null));};exports[_0x9da4('0x47')]=function(_0x184b0d,_0x477446){return db[_0x9da4('0x40')][_0x9da4('0x47')](_0x184b0d['body'],{})['then'](respondWithResult(_0x477446,0xc9))['catch'](handleError(_0x477446,null));};exports['update']=function(_0x304721,_0x59f7a0){if(_0x304721[_0x9da4('0x48')]['id']){delete _0x304721[_0x9da4('0x48')]['id'];}return db[_0x9da4('0x40')]['find']({'where':{'id':_0x304721[_0x9da4('0x49')]['id']}})[_0x9da4('0x23')](handleEntityNotFound(_0x59f7a0,null))[_0x9da4('0x23')](saveUpdates(_0x304721[_0x9da4('0x48')],null))['then'](respondWithResult(_0x59f7a0,null))[_0x9da4('0x46')](handleError(_0x59f7a0,null));};exports[_0x9da4('0x24')]=function(_0x37ea84,_0x505d04){return db[_0x9da4('0x40')][_0x9da4('0x45')]({'where':{'id':_0x37ea84['params']['id']}})[_0x9da4('0x23')](handleEntityNotFound(_0x505d04,null))[_0x9da4('0x23')](removeEntity(_0x505d04,null))['catch'](handleError(_0x505d04,null));}; \ No newline at end of file +var _0x3f68=['body','update','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','reject','then','destroy','error','name','send','map','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filters','filter','where','VIRTUAL','merge','options','FaxApplication','includeAll','findAll','rows','show','params','find','catch'];(function(_0x15b380,_0x1a3c5f){var _0x232c5c=function(_0x12f8e0){while(--_0x12f8e0){_0x15b380['push'](_0x15b380['shift']());}};_0x232c5c(++_0x1a3c5f);}(_0x3f68,0x1b2));var _0x83f6=function(_0x15a55d,_0x59b390){_0x15a55d=_0x15a55d-0x0;var _0x348fc9=_0x3f68[_0x15a55d];return _0x348fc9;};'use strict';var emlformat=require(_0x83f6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x83f6('0x1'));var jsonpatch=require(_0x83f6('0x2'));var rp=require(_0x83f6('0x3'));var moment=require(_0x83f6('0x4'));var BPromise=require(_0x83f6('0x5'));var Mustache=require(_0x83f6('0x6'));var util=require(_0x83f6('0x7'));var path=require(_0x83f6('0x8'));var sox=require(_0x83f6('0x9'));var csv=require('to-csv');var ejs=require(_0x83f6('0xa'));var fs=require('fs');var fs_extra=require(_0x83f6('0xb'));var _=require('lodash');var squel=require(_0x83f6('0xc'));var crypto=require('crypto');var jsforce=require(_0x83f6('0xd'));var deskjs=require(_0x83f6('0xe'));var toCsv=require(_0x83f6('0xf'));var querystring=require(_0x83f6('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x83f6('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x83f6('0x12'));var hardwareService=require(_0x83f6('0x13'));var logger=require(_0x83f6('0x14'))(_0x83f6('0x15'));var utils=require(_0x83f6('0x16'));var config=require(_0x83f6('0x17'));var licenseUtil=require(_0x83f6('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x472371,_0x266759){_0x266759=_0x266759||0xcc;return function(_0x18a7db){if(_0x18a7db){return _0x472371[_0x83f6('0x19')](_0x266759);}return _0x472371[_0x83f6('0x1a')](_0x266759)[_0x83f6('0x1b')]();};}function respondWithResult(_0x456615,_0x272609){_0x272609=_0x272609||0xc8;return function(_0x382980){if(_0x382980){return _0x456615[_0x83f6('0x1a')](_0x272609)[_0x83f6('0x1c')](_0x382980);}};}function respondWithFilteredResult(_0x1e88cb,_0xd96953){return function(_0x268b16){if(_0x268b16){var _0x2529c9=typeof _0xd96953['offset']===_0x83f6('0x1d')&&typeof _0xd96953[_0x83f6('0x1e')]===_0x83f6('0x1d');var _0x388b0c=_0x268b16['count'];var _0x2fea39=_0x2529c9?0x0:_0xd96953[_0x83f6('0x1f')];var _0x50db54=_0x2529c9?_0x268b16[_0x83f6('0x20')]:_0xd96953[_0x83f6('0x1f')]+_0xd96953['limit'];var _0x335653;if(_0x50db54>=_0x388b0c){_0x50db54=_0x388b0c;_0x335653=0xc8;}else{_0x335653=0xce;}_0x1e88cb['status'](_0x335653);return _0x1e88cb[_0x83f6('0x21')](_0x83f6('0x22'),_0x2fea39+'-'+_0x50db54+'/'+_0x388b0c)[_0x83f6('0x1c')](_0x268b16);}return null;};}function patchUpdates(_0x36488a){return function(_0x329c96){try{jsonpatch['apply'](_0x329c96,_0x36488a,!![]);}catch(_0x3a998a){return BPromise[_0x83f6('0x23')](_0x3a998a);}return _0x329c96['save']();};}function saveUpdates(_0x42a63c,_0x275269){return function(_0x48d38f){if(_0x48d38f){return _0x48d38f['update'](_0x42a63c)[_0x83f6('0x24')](function(_0xa7b7ea){return _0xa7b7ea;});}return null;};}function removeEntity(_0x4870e3,_0x47e997){return function(_0x5aaa45){if(_0x5aaa45){return _0x5aaa45[_0x83f6('0x25')]()[_0x83f6('0x24')](function(){_0x4870e3[_0x83f6('0x1a')](0xcc)[_0x83f6('0x1b')]();});}};}function handleEntityNotFound(_0x27cb42,_0x3f5603){return function(_0x5cf8d3){if(!_0x5cf8d3){_0x27cb42['sendStatus'](0x194);}return _0x5cf8d3;};}function handleError(_0x1a58d4,_0x3d4bde){_0x3d4bde=_0x3d4bde||0x1f4;return function(_0x3b1a1e){logger[_0x83f6('0x26')](_0x3b1a1e['stack']);if(_0x3b1a1e[_0x83f6('0x27')]){delete _0x3b1a1e['name'];}_0x1a58d4['status'](_0x3d4bde)[_0x83f6('0x28')](_0x3b1a1e);};}exports['index']=function(_0x36dfdb,_0x489221){var _0x2f58d0={},_0x1251a7={},_0x4a3607={'count':0x0,'rows':[]};var _0x438003=_[_0x83f6('0x29')](db['FaxApplication']['rawAttributes'],function(_0x1c2890){return{'name':_0x1c2890[_0x83f6('0x2a')],'type':_0x1c2890['type'][_0x83f6('0x2b')]};});_0x1251a7[_0x83f6('0x2c')]=_[_0x83f6('0x29')](_0x438003,'name');_0x1251a7[_0x83f6('0x2d')]=_[_0x83f6('0x2e')](_0x36dfdb[_0x83f6('0x2d')]);_0x1251a7['filters']=_[_0x83f6('0x2f')](_0x1251a7['model'],_0x1251a7[_0x83f6('0x2d')]);_0x2f58d0[_0x83f6('0x30')]=_[_0x83f6('0x2f')](_0x1251a7['model'],qs[_0x83f6('0x31')](_0x36dfdb['query'][_0x83f6('0x31')]));_0x2f58d0[_0x83f6('0x30')]=_0x2f58d0[_0x83f6('0x30')][_0x83f6('0x32')]?_0x2f58d0[_0x83f6('0x30')]:_0x1251a7[_0x83f6('0x2c')];if(!_0x36dfdb[_0x83f6('0x2d')][_0x83f6('0x33')](_0x83f6('0x34'))){_0x2f58d0[_0x83f6('0x1e')]=qs[_0x83f6('0x1e')](_0x36dfdb[_0x83f6('0x2d')][_0x83f6('0x1e')]);_0x2f58d0[_0x83f6('0x1f')]=qs[_0x83f6('0x1f')](_0x36dfdb['query'][_0x83f6('0x1f')]);}_0x2f58d0[_0x83f6('0x35')]=qs[_0x83f6('0x36')](_0x36dfdb[_0x83f6('0x2d')][_0x83f6('0x36')]);_0x2f58d0['where']=qs['filters'](_[_0x83f6('0x37')](_0x36dfdb[_0x83f6('0x2d')],_0x1251a7[_0x83f6('0x38')]),_0x438003);if(_0x36dfdb['query'][_0x83f6('0x39')]){_0x2f58d0[_0x83f6('0x3a')]=_['merge'](_0x2f58d0[_0x83f6('0x3a')],{'$or':_['map'](_0x438003,function(_0x141533){if(_0x141533['type']!==_0x83f6('0x3b')){var _0x506bff={};_0x506bff[_0x141533[_0x83f6('0x27')]]={'$like':'%'+_0x36dfdb[_0x83f6('0x2d')][_0x83f6('0x39')]+'%'};return _0x506bff;}})});}_0x2f58d0=_[_0x83f6('0x3c')]({},_0x2f58d0,_0x36dfdb[_0x83f6('0x3d')]);var _0x298908={'where':_0x2f58d0[_0x83f6('0x3a')]};return db[_0x83f6('0x3e')][_0x83f6('0x20')](_0x298908)['then'](function(_0x56f0c8){_0x4a3607['count']=_0x56f0c8;if(_0x36dfdb[_0x83f6('0x2d')][_0x83f6('0x3f')]){_0x2f58d0['include']=[{'all':!![]}];}return db['FaxApplication'][_0x83f6('0x40')](_0x2f58d0);})[_0x83f6('0x24')](function(_0x6e9eee){_0x4a3607[_0x83f6('0x41')]=_0x6e9eee;return _0x4a3607;})[_0x83f6('0x24')](respondWithFilteredResult(_0x489221,_0x2f58d0))['catch'](handleError(_0x489221,null));};exports[_0x83f6('0x42')]=function(_0x28f18d,_0x2cd806){var _0x36c9bc={'raw':!![],'where':{'id':_0x28f18d[_0x83f6('0x43')]['id']}},_0xcde90f={};_0xcde90f[_0x83f6('0x2c')]=_['keys'](db[_0x83f6('0x3e')]['rawAttributes']);_0xcde90f[_0x83f6('0x2d')]=_[_0x83f6('0x2e')](_0x28f18d[_0x83f6('0x2d')]);_0xcde90f[_0x83f6('0x38')]=_[_0x83f6('0x2f')](_0xcde90f['model'],_0xcde90f['query']);_0x36c9bc[_0x83f6('0x30')]=_[_0x83f6('0x2f')](_0xcde90f[_0x83f6('0x2c')],qs[_0x83f6('0x31')](_0x28f18d[_0x83f6('0x2d')][_0x83f6('0x31')]));_0x36c9bc[_0x83f6('0x30')]=_0x36c9bc[_0x83f6('0x30')]['length']?_0x36c9bc[_0x83f6('0x30')]:_0xcde90f[_0x83f6('0x2c')];if(_0x28f18d['query'][_0x83f6('0x3f')]){_0x36c9bc['include']=[{'all':!![]}];}_0x36c9bc=_[_0x83f6('0x3c')]({},_0x36c9bc,_0x28f18d[_0x83f6('0x3d')]);return db[_0x83f6('0x3e')][_0x83f6('0x44')](_0x36c9bc)[_0x83f6('0x24')](handleEntityNotFound(_0x2cd806,null))[_0x83f6('0x24')](respondWithResult(_0x2cd806,null))[_0x83f6('0x45')](handleError(_0x2cd806,null));};exports['create']=function(_0x22a6c6,_0x31255d){return db[_0x83f6('0x3e')]['create'](_0x22a6c6[_0x83f6('0x46')],{})[_0x83f6('0x24')](respondWithResult(_0x31255d,0xc9))[_0x83f6('0x45')](handleError(_0x31255d,null));};exports[_0x83f6('0x47')]=function(_0xdc8d47,_0x3d2c29){if(_0xdc8d47[_0x83f6('0x46')]['id']){delete _0xdc8d47[_0x83f6('0x46')]['id'];}return db[_0x83f6('0x3e')][_0x83f6('0x44')]({'where':{'id':_0xdc8d47['params']['id']}})[_0x83f6('0x24')](handleEntityNotFound(_0x3d2c29,null))[_0x83f6('0x24')](saveUpdates(_0xdc8d47[_0x83f6('0x46')],null))['then'](respondWithResult(_0x3d2c29,null))[_0x83f6('0x45')](handleError(_0x3d2c29,null));};exports[_0x83f6('0x25')]=function(_0x5c8aa2,_0x52d701){return db[_0x83f6('0x3e')]['find']({'where':{'id':_0x5c8aa2['params']['id']}})[_0x83f6('0x24')](handleEntityNotFound(_0x52d701,null))[_0x83f6('0x24')](removeEntity(_0x52d701,null))[_0x83f6('0x45')](handleError(_0x52d701,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index 56d4589..4e70b4a 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 _0xc385=['fax_applications','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','define','FaxApplication'];(function(_0x4e05a7,_0x5301f7){var _0xcdd47d=function(_0x5da300){while(--_0x5da300){_0x4e05a7['push'](_0x4e05a7['shift']());}};_0xcdd47d(++_0x5301f7);}(_0xc385,0xb6));var _0x5c38=function(_0x88cd7b,_0x4c884c){_0x88cd7b=_0x88cd7b-0x0;var _0x56fcc8=_0xc385[_0x88cd7b];return _0x56fcc8;};'use strict';var _=require(_0x5c38('0x0'));var util=require('util');var logger=require(_0x5c38('0x1'))(_0x5c38('0x2'));var moment=require(_0x5c38('0x3'));var BPromise=require(_0x5c38('0x4'));var rp=require(_0x5c38('0x5'));var fs=require('fs');var path=require(_0x5c38('0x6'));var rimraf=require(_0x5c38('0x7'));var config=require('../../config/environment');var attributes=require('./faxApplication.attributes');module['exports']=function(_0x1de27f,_0x424b04){return _0x1de27f[_0x5c38('0x8')](_0x5c38('0x9'),attributes,{'tableName':_0x5c38('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x5c38('0xb')});}; \ No newline at end of file +var _0xd0b3=['../../config/environment','./faxApplication.attributes','exports','define','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x46bbf4,_0x24523b){var _0x19ce5d=function(_0x237ba4){while(--_0x237ba4){_0x46bbf4['push'](_0x46bbf4['shift']());}};_0x19ce5d(++_0x24523b);}(_0xd0b3,0xf0));var _0x3d0b=function(_0x980a08,_0x4e710a){_0x980a08=_0x980a08-0x0;var _0x49fcd2=_0xd0b3[_0x980a08];return _0x49fcd2;};'use strict';var _=require('lodash');var util=require(_0x3d0b('0x0'));var logger=require(_0x3d0b('0x1'))('api');var moment=require(_0x3d0b('0x2'));var BPromise=require(_0x3d0b('0x3'));var rp=require(_0x3d0b('0x4'));var fs=require('fs');var path=require(_0x3d0b('0x5'));var rimraf=require(_0x3d0b('0x6'));var config=require(_0x3d0b('0x7'));var attributes=require(_0x3d0b('0x8'));module[_0x3d0b('0x9')]=function(_0x4343b2,_0x252139){return _0x4343b2[_0x3d0b('0xa')]('FaxApplication',attributes,{'tableName':'fax_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3d0b('0xb'),'collate':_0x3d0b('0xc')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index 980dd0f..5ee4787 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 _0x3353=['code','message','catch','FaxApplication','update','body','options','raw','where','attributes','UpdateFaxApplication','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x43b362,_0x5529dd){var _0x9d06e8=function(_0x4812fa){while(--_0x4812fa){_0x43b362['push'](_0x43b362['shift']());}};_0x9d06e8(++_0x5529dd);}(_0x3353,0xbf));var _0x3335=function(_0x3bcb6a,_0xf0a2e5){_0x3bcb6a=_0x3bcb6a-0x0;var _0x31519a=_0x3353[_0x3bcb6a];return _0x31519a;};'use strict';var _=require(_0x3335('0x0'));var util=require(_0x3335('0x1'));var moment=require('moment');var BPromise=require(_0x3335('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3335('0x3'))['db'];var utils=require(_0x3335('0x4'));var logger=require(_0x3335('0x5'))(_0x3335('0x6'));var config=require(_0x3335('0x7'));var jayson=require(_0x3335('0x8'));var client=jayson[_0x3335('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x185278,_0x55135f,_0x5201fd){return new BPromise(function(_0x60432,_0x4ae085){return client[_0x3335('0xa')](_0x185278,_0x5201fd)[_0x3335('0xb')](function(_0x367768){logger[_0x3335('0xc')](_0x3335('0xd'),_0x55135f,_0x3335('0xe'));logger[_0x3335('0xf')](_0x3335('0x10'),_0x55135f,_0x3335('0xe'),JSON[_0x3335('0x11')](_0x367768));if(_0x367768[_0x3335('0x12')]){if(_0x367768[_0x3335('0x12')][_0x3335('0x13')]===0x1f4){logger[_0x3335('0x12')](_0x3335('0xd'),_0x55135f,_0x367768[_0x3335('0x12')]['message']);return _0x4ae085(_0x367768[_0x3335('0x12')]['message']);}logger[_0x3335('0x12')](_0x3335('0xd'),_0x55135f,_0x367768[_0x3335('0x12')]['message']);return _0x60432(_0x367768[_0x3335('0x12')]['message']);}else{logger[_0x3335('0xc')](_0x3335('0xd'),_0x55135f,'request\x20sent');_0x60432(_0x367768['result'][_0x3335('0x14')]);}})[_0x3335('0x15')](function(_0x4cf99e){logger[_0x3335('0x12')](_0x3335('0xd'),_0x55135f,_0x4cf99e);_0x4ae085(_0x4cf99e);});});}exports['UpdateFaxApplication']=function(_0x425c27){var _0x767eec=this;return new Promise(function(_0x49846b,_0x4ed59e){return db[_0x3335('0x16')][_0x3335('0x17')](_0x425c27[_0x3335('0x18')],{'raw':_0x425c27[_0x3335('0x19')]?_0x425c27['options'][_0x3335('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x425c27['options']?_0x425c27[_0x3335('0x19')][_0x3335('0x1b')]||null:null,'attributes':_0x425c27['options']?_0x425c27[_0x3335('0x19')][_0x3335('0x1c')]||null:null,'limit':_0x425c27[_0x3335('0x19')]?_0x425c27[_0x3335('0x19')]['limit']||null:null})['then'](function(_0x4e3bdd){logger['info'](_0x3335('0x1d'),_0x425c27);logger[_0x3335('0xf')](_0x3335('0x1d'),_0x425c27,JSON['stringify'](_0x4e3bdd));_0x49846b(_0x4e3bdd);})[_0x3335('0x15')](function(_0x5eba82){logger[_0x3335('0x12')](_0x3335('0x1d'),_0x5eba82['message'],_0x425c27);_0x4ed59e(_0x767eec[_0x3335('0x12')](0x1f4,_0x5eba82[_0x3335('0x14')]));});});}; \ No newline at end of file +var _0x2016=['message','result','catch','UpdateFaxApplication','update','options','raw','where','attributes','limit','then','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','info','FaxApplication,\x20%s,\x20%s','debug','request\x20sent','stringify','error'];(function(_0x1e9e56,_0x34a74a){var _0x5d5e2e=function(_0x4bfcc2){while(--_0x4bfcc2){_0x1e9e56['push'](_0x1e9e56['shift']());}};_0x5d5e2e(++_0x34a74a);}(_0x2016,0xf5));var _0x6201=function(_0x5bda2e,_0x3b2d8e){_0x5bda2e=_0x5bda2e-0x0;var _0x547923=_0x2016[_0x5bda2e];return _0x547923;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6201('0x0'));var BPromise=require(_0x6201('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6201('0x2'));var db=require(_0x6201('0x3'))['db'];var utils=require(_0x6201('0x4'));var logger=require('../../config/logger')(_0x6201('0x5'));var config=require(_0x6201('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x6201('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3af06e,_0x1d79c3,_0x227279){return new BPromise(function(_0x56583a,_0x3bd295){return client[_0x6201('0x8')](_0x3af06e,_0x227279)['then'](function(_0x403295){logger[_0x6201('0x9')](_0x6201('0xa'),_0x1d79c3,'request\x20sent');logger[_0x6201('0xb')]('FaxApplication,\x20%s,\x20%s,\x20%s',_0x1d79c3,_0x6201('0xc'),JSON[_0x6201('0xd')](_0x403295));if(_0x403295[_0x6201('0xe')]){if(_0x403295[_0x6201('0xe')]['code']===0x1f4){logger[_0x6201('0xe')](_0x6201('0xa'),_0x1d79c3,_0x403295['error']['message']);return _0x3bd295(_0x403295[_0x6201('0xe')]['message']);}logger[_0x6201('0xe')](_0x6201('0xa'),_0x1d79c3,_0x403295[_0x6201('0xe')][_0x6201('0xf')]);return _0x56583a(_0x403295[_0x6201('0xe')]['message']);}else{logger['info'](_0x6201('0xa'),_0x1d79c3,_0x6201('0xc'));_0x56583a(_0x403295[_0x6201('0x10')]['message']);}})[_0x6201('0x11')](function(_0x5b7fb3){logger['error'](_0x6201('0xa'),_0x1d79c3,_0x5b7fb3);_0x3bd295(_0x5b7fb3);});});}exports[_0x6201('0x12')]=function(_0x102c74){var _0x4d20be=this;return new Promise(function(_0xaa8642,_0x4e7c9a){return db['FaxApplication'][_0x6201('0x13')](_0x102c74['body'],{'raw':_0x102c74[_0x6201('0x14')]?_0x102c74[_0x6201('0x14')][_0x6201('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x102c74[_0x6201('0x14')]?_0x102c74[_0x6201('0x14')][_0x6201('0x16')]||null:null,'attributes':_0x102c74['options']?_0x102c74[_0x6201('0x14')][_0x6201('0x17')]||null:null,'limit':_0x102c74[_0x6201('0x14')]?_0x102c74[_0x6201('0x14')][_0x6201('0x18')]||null:null})[_0x6201('0x19')](function(_0x66084e){logger[_0x6201('0x9')](_0x6201('0x12'),_0x102c74);logger[_0x6201('0xb')](_0x6201('0x12'),_0x102c74,JSON['stringify'](_0x66084e));_0xaa8642(_0x66084e);})['catch'](function(_0x28d043){logger[_0x6201('0xe')](_0x6201('0x12'),_0x28d043[_0x6201('0xf')],_0x102c74);_0x4e7c9a(_0x4d20be[_0x6201('0xe')](0x1f4,_0x28d043[_0x6201('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 4473ee7..59e7880 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 _0x80ed=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','update','destroy','exports','multer'];(function(_0x2b152a,_0x3dd988){var _0x2ad4c7=function(_0x2fa97c){while(--_0x2fa97c){_0x2b152a['push'](_0x2b152a['shift']());}};_0x2ad4c7(++_0x3dd988);}(_0x80ed,0x11c));var _0xd80e=function(_0x3f2556,_0x2cddb3){_0x3f2556=_0x3f2556-0x0;var _0x44f3bb=_0x80ed[_0x3f2556];return _0x44f3bb;};'use strict';var multer=require(_0xd80e('0x0'));var util=require('util');var path=require(_0xd80e('0x1'));var timeout=require(_0xd80e('0x2'));var express=require(_0xd80e('0x3'));var router=express['Router']();var fs_extra=require(_0xd80e('0x4'));var auth=require(_0xd80e('0x5'));var interaction=require(_0xd80e('0x6'));var config=require(_0xd80e('0x7'));var controller=require('./faxApplication.controller');router[_0xd80e('0x8')]('/',auth[_0xd80e('0x9')](),controller[_0xd80e('0xa')]);router['get'](_0xd80e('0xb'),auth[_0xd80e('0x9')](),controller[_0xd80e('0xc')]);router[_0xd80e('0xd')]('/',auth[_0xd80e('0x9')](),controller[_0xd80e('0xe')]);router[_0xd80e('0xf')](_0xd80e('0xb'),auth[_0xd80e('0x9')](),controller[_0xd80e('0x10')]);router['delete'](_0xd80e('0xb'),auth[_0xd80e('0x9')](),controller[_0xd80e('0x11')]);module[_0xd80e('0x12')]=router; \ No newline at end of file +var _0xf4f4=['../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x42c06b,_0x28cb52){var _0x3a84dd=function(_0x31aec4){while(--_0x31aec4){_0x42c06b['push'](_0x42c06b['shift']());}};_0x3a84dd(++_0x28cb52);}(_0xf4f4,0xe3));var _0x4f4f=function(_0x1f7269,_0x460e49){_0x1f7269=_0x1f7269-0x0;var _0x32ee49=_0xf4f4[_0x1f7269];return _0x32ee49;};'use strict';var multer=require(_0x4f4f('0x0'));var util=require(_0x4f4f('0x1'));var path=require('path');var timeout=require(_0x4f4f('0x2'));var express=require(_0x4f4f('0x3'));var router=express[_0x4f4f('0x4')]();var fs_extra=require(_0x4f4f('0x5'));var auth=require(_0x4f4f('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x4f4f('0x7'));var controller=require('./faxApplication.controller');router[_0x4f4f('0x8')]('/',auth[_0x4f4f('0x9')](),controller[_0x4f4f('0xa')]);router[_0x4f4f('0x8')](_0x4f4f('0xb'),auth[_0x4f4f('0x9')](),controller[_0x4f4f('0xc')]);router[_0x4f4f('0xd')]('/',auth['isAuthenticated'](),controller[_0x4f4f('0xe')]);router[_0x4f4f('0xf')](_0x4f4f('0xb'),auth[_0x4f4f('0x9')](),controller[_0x4f4f('0x10')]);router[_0x4f4f('0x11')](_0x4f4f('0xb'),auth[_0x4f4f('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index 094e4bf..cfa8854 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 _0x0a07=['out','sequelize','BOOLEAN','DATE','STRING','ENUM'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0x0a07,0xb5));var _0x70a0=function(_0x4200b5,_0x455678){_0x4200b5=_0x4200b5-0x0;var _0x564599=_0x0a07[_0x4200b5];return _0x564599;};'use strict';var Sequelize=require(_0x70a0('0x0'));module['exports']={'closed':{'type':Sequelize[_0x70a0('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x70a0('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x70a0('0x3')]},'note':{'type':Sequelize[_0x70a0('0x3')]},'read1stAt':{'type':Sequelize[_0x70a0('0x2')]},'fax':{'type':Sequelize['STRING']},'firstMsgDirection':{'type':Sequelize[_0x70a0('0x4')]('in',_0x70a0('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x70a0('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x70a0('0x4')]('in',_0x70a0('0x5')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0xb214=['STRING','out','sequelize','exports','BOOLEAN','DATE'];(function(_0x9fb13a,_0x17425f){var _0x3e7008=function(_0x1c1f0d){while(--_0x1c1f0d){_0x9fb13a['push'](_0x9fb13a['shift']());}};_0x3e7008(++_0x17425f);}(_0xb214,0xb0));var _0x4b21=function(_0x10d41d,_0x4a49ef){_0x10d41d=_0x10d41d-0x0;var _0x35011c=_0xb214[_0x10d41d];return _0x35011c;};'use strict';var Sequelize=require(_0x4b21('0x0'));module[_0x4b21('0x1')]={'closed':{'type':Sequelize[_0x4b21('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x4b21('0x3')]},'disposition':{'type':Sequelize[_0x4b21('0x4')]},'secondDisposition':{'type':Sequelize[_0x4b21('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x4b21('0x4')]},'read1stAt':{'type':Sequelize[_0x4b21('0x3')]},'fax':{'type':Sequelize[_0x4b21('0x4')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x4b21('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x4b21('0x5')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.controller.js b/server/api/faxInteraction/faxInteraction.controller.js index b4ccae8..e4ea753 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 _0x38bc=['util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','status','end','json','undefined','offset','count','Content-Range','apply','reject','update','then','destroy','stack','name','send','Users','fullname','TagIds','Tags','split','forEach','push','index','FaxInteraction','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','pick','select','field','u.fullname','ui.FaxInteractionId','from','user_has_fax_interactions','left_join','users','u.id\x20=\x20ui.UserId','fax_interactions','cm_contacts','a.id\x20=\x20i.FaxAccountId','fax_messages','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','tools_tags','expr','search','parseSearch','conditions','find','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','body','some','compact','isEmpty','FaxAccountId','i.FaxAccountId\x20IN\x20?','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','replace','isNumeric','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','QueryTypes','SELECT','clone','i.id','DESC','t.id\x20IN\x20?','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','role','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','agent','sequelize','toString','keyBy','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','Contact.firstName','Contact.email','Contact.phone','c.fax','o.fullname','Owner.fullname','GROUP_CONCAT(DISTINCT\x20t.id)','FaxInteractionId','all','catch','show','params','include','describe','addMessage','FaxMessage','ids','findOne','nolimit','filter','merge','$gte','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','rows','addTags','omit','spread','color','emit','removeTags','download','unix','join','server','files','tmp','root','attachments','transcript-%d-%s.zip','Attachment','Messages','get','mkdirSync','existsSync','createReadStream','pipe','createWriteStream','resolve','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache'];(function(_0xf7e131,_0xc9598b){var _0x458a97=function(_0x45f643){while(--_0x45f643){_0xf7e131['push'](_0xf7e131['shift']());}};_0x458a97(++_0xc9598b);}(_0x38bc,0xcc));var _0xc38b=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x38bc[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0xc38b('0x0'));var rimraf=require(_0xc38b('0x1'));var zipdir=require(_0xc38b('0x2'));var jsonpatch=require(_0xc38b('0x3'));var rp=require(_0xc38b('0x4'));var moment=require(_0xc38b('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc38b('0x6'));var util=require(_0xc38b('0x7'));var path=require(_0xc38b('0x8'));var sox=require(_0xc38b('0x9'));var csv=require(_0xc38b('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc38b('0xb'));var _=require(_0xc38b('0xc'));var squel=require(_0xc38b('0xd'));var crypto=require(_0xc38b('0xe'));var jsforce=require(_0xc38b('0xf'));var deskjs=require(_0xc38b('0x10'));var toCsv=require(_0xc38b('0xa'));var querystring=require('querystring');var Papa=require(_0xc38b('0x11'));var Redis=require('ioredis');var authService=require(_0xc38b('0x12'));var qs=require(_0xc38b('0x13'));var as=require(_0xc38b('0x14'));var hardwareService=require(_0xc38b('0x15'));var logger=require(_0xc38b('0x16'))(_0xc38b('0x17'));var utils=require(_0xc38b('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xc38b('0x19'))['db'];config[_0xc38b('0x1a')]=_[_0xc38b('0x1b')](config[_0xc38b('0x1a')],{'host':_0xc38b('0x1c'),'port':0x18eb});var socket=require(_0xc38b('0x1d'))(new Redis(config[_0xc38b('0x1a')]));require(_0xc38b('0x1e'))[_0xc38b('0x1f')](socket);function respondWithStatusCode(_0x1342d4,_0x4a057c){_0x4a057c=_0x4a057c||0xcc;return function(_0x45b228){if(_0x45b228){return _0x1342d4['sendStatus'](_0x4a057c);}return _0x1342d4[_0xc38b('0x20')](_0x4a057c)[_0xc38b('0x21')]();};}function respondWithResult(_0x2fe3d1,_0x366bd6){_0x366bd6=_0x366bd6||0xc8;return function(_0x4b870a){if(_0x4b870a){return _0x2fe3d1[_0xc38b('0x20')](_0x366bd6)[_0xc38b('0x22')](_0x4b870a);}};}function respondWithFilteredResult(_0x553abd,_0x1f1873){return function(_0x278841){if(_0x278841){var _0x3393ba=typeof _0x1f1873['offset']===_0xc38b('0x23')&&typeof _0x1f1873['limit']==='undefined';var _0x39901f=_0x278841['count'];var _0x3775ae=_0x3393ba?0x0:_0x1f1873[_0xc38b('0x24')];var _0x1ca2b2=_0x3393ba?_0x278841[_0xc38b('0x25')]:_0x1f1873[_0xc38b('0x24')]+_0x1f1873['limit'];var _0xe5f870;if(_0x1ca2b2>=_0x39901f){_0x1ca2b2=_0x39901f;_0xe5f870=0xc8;}else{_0xe5f870=0xce;}_0x553abd[_0xc38b('0x20')](_0xe5f870);return _0x553abd['set'](_0xc38b('0x26'),_0x3775ae+'-'+_0x1ca2b2+'/'+_0x39901f)['json'](_0x278841);}return null;};}function patchUpdates(_0x4107b3){return function(_0x175aa6){try{jsonpatch[_0xc38b('0x27')](_0x175aa6,_0x4107b3,!![]);}catch(_0x648a30){return BPromise[_0xc38b('0x28')](_0x648a30);}return _0x175aa6['save']();};}function saveUpdates(_0x56968e,_0x43edd9){return function(_0x49bb60){if(_0x49bb60){return _0x49bb60[_0xc38b('0x29')](_0x56968e)[_0xc38b('0x2a')](function(_0x21ff91){return _0x21ff91;});}return null;};}function removeEntity(_0x3f3a6,_0x896039){return function(_0x50c9eb){if(_0x50c9eb){return _0x50c9eb[_0xc38b('0x2b')]()[_0xc38b('0x2a')](function(){_0x3f3a6[_0xc38b('0x20')](0xcc)[_0xc38b('0x21')]();});}};}function handleEntityNotFound(_0x17cc6e,_0xbd48f8){return function(_0x285b3f){if(!_0x285b3f){_0x17cc6e['sendStatus'](0x194);}return _0x285b3f;};}function handleError(_0x125a8e,_0x54a22f){_0x54a22f=_0x54a22f||0x1f4;return function(_0x107ad1){logger['error'](_0x107ad1[_0xc38b('0x2c')]);if(_0x107ad1[_0xc38b('0x2d')]){delete _0x107ad1[_0xc38b('0x2d')];}_0x125a8e[_0xc38b('0x20')](_0x54a22f)[_0xc38b('0x2e')](_0x107ad1);};}function getInteractionUsers(_0x506da6,_0x366ff7){return new BPromise(function(_0x3bb548,_0x2fcf76){try{if(_0x366ff7[_0x506da6['id']]){_0x506da6[_0xc38b('0x2f')]=_['map'](_0x366ff7[_0x506da6['id']],function(_0x487dbf){return{'id':_0x487dbf['id'],'fullname':_0x487dbf[_0xc38b('0x30')]};});}}catch(_0x366d3a){_0x2fcf76(_0x366d3a);}_0x3bb548(_0x506da6);});}function getInteractionTags(_0x4cef5f,_0x4bb1d3){return new BPromise(function(_0x7301a6,_0x3f28f3){try{if(_0x4cef5f[_0xc38b('0x31')]){_0x4cef5f[_0xc38b('0x32')]=[];_0x4cef5f['TagIds'][_0xc38b('0x33')](',')[_0xc38b('0x34')](function(_0x1e1011){_0x4cef5f['Tags'][_0xc38b('0x35')](_0x4bb1d3[_0x1e1011]);});}delete _0x4cef5f[_0xc38b('0x31')];}catch(_0x296e92){_0x3f28f3(_0x296e92);}_0x7301a6(_0x4cef5f);});}function updateFaxInteraction(_0x361645,_0x55d13d,_0x24b258){return new BPromise(function(_0x5a86fe,_0x35d252){return getInteractionUsers(_0x361645,_0x24b258)['then'](function(_0x109881){return getInteractionTags(_0x109881,_0x55d13d);})[_0xc38b('0x2a')](function(_0x5492e8){_0x5a86fe(_0x5492e8);})['catch'](function(_0x5897ce){_0x35d252(_0x5897ce);});});}exports[_0xc38b('0x36')]=function(_0x46f2f0,_0x5f0b39){var _0x4fba23={},_0x563b91={},_0x29a20b={'count':0x0,'rows':[]};var _0x1ddfe5=_['map'](db[_0xc38b('0x37')][_0xc38b('0x38')],function(_0x1c02bb){return{'name':_0x1c02bb['fieldName'],'type':_0x1c02bb[_0xc38b('0x39')][_0xc38b('0x3a')]};});_0x563b91[_0xc38b('0x3b')]=_[_0xc38b('0x3c')](_0x1ddfe5,_0xc38b('0x2d'));_0x563b91[_0xc38b('0x3d')]=_[_0xc38b('0x3e')](_0x46f2f0[_0xc38b('0x3d')]);_0x563b91[_0xc38b('0x3f')]=_[_0xc38b('0x40')](_0x563b91[_0xc38b('0x3b')],_0x563b91[_0xc38b('0x3d')]);_0x4fba23[_0xc38b('0x41')]=_[_0xc38b('0x40')](_0x563b91['model'],qs[_0xc38b('0x42')](_0x46f2f0[_0xc38b('0x3d')]['fields']));_0x4fba23[_0xc38b('0x41')]=_0x4fba23['attributes'][_0xc38b('0x43')]?_0x4fba23[_0xc38b('0x41')]:_0x563b91[_0xc38b('0x3b')];if(!_0x46f2f0[_0xc38b('0x3d')][_0xc38b('0x44')]('nolimit')){_0x4fba23[_0xc38b('0x45')]=qs[_0xc38b('0x45')](_0x46f2f0['query'][_0xc38b('0x45')]);_0x4fba23[_0xc38b('0x24')]=qs[_0xc38b('0x24')](_0x46f2f0[_0xc38b('0x3d')][_0xc38b('0x24')]);}_0x4fba23[_0xc38b('0x46')]=qs[_0xc38b('0x47')](_0x46f2f0[_0xc38b('0x3d')]['sort']);_0x4fba23[_0xc38b('0x48')]=qs[_0xc38b('0x3f')](_[_0xc38b('0x49')](_0x46f2f0[_0xc38b('0x3d')],_0x563b91[_0xc38b('0x3f')]),_0x1ddfe5);var _0x119237=[];var _0x13e1a9=squel[_0xc38b('0x4a')]()[_0xc38b('0x4b')]('id')['field'](_0xc38b('0x2d'))['field']('color')['from']('tools_tags');var _0x341a67=squel['select']()[_0xc38b('0x4b')]('u.id')[_0xc38b('0x4b')](_0xc38b('0x4c'))[_0xc38b('0x4b')](_0xc38b('0x4d'))[_0xc38b('0x4e')](_0xc38b('0x4f'),'ui')[_0xc38b('0x50')](_0xc38b('0x51'),'u',_0xc38b('0x52'));var _0x4bbb1e=squel['select']()[_0xc38b('0x4e')](_0xc38b('0x53'),'i')[_0xc38b('0x50')](_0xc38b('0x54'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join'](_0xc38b('0x51'),'o','o.id\x20=\x20i.UserId')['left_join']('fax_accounts','a',_0xc38b('0x55'))['left_join'](_0xc38b('0x56'),'me',_0xc38b('0x57'))['left_join'](_0xc38b('0x58'),'it',_0xc38b('0x59'))['left_join'](_0xc38b('0x5a'),'t','t.id\x20=\x20it.TagId');var _0x4b0a8c=squel[_0xc38b('0x5b')]();var _0x2a354f=[];var _0x5dd4b4=squel[_0xc38b('0x5b')]();var _0x45f695;if(_0x46f2f0[_0xc38b('0x3d')][_0xc38b('0x5c')]){_0x45f695=as[_0xc38b('0x5d')](_0x46f2f0[_0xc38b('0x3d')][_0xc38b('0x5c')]);var _0x58f8a8=_0x45f695['sqlOperator'];for(var _0x2f6b9d=0x0;_0x2f6b9d<_0x45f695[_0xc38b('0x5e')][_0xc38b('0x43')];_0x2f6b9d++){var _0x5405af=_0x45f695['conditions'][_0x2f6b9d];var _0x7514fb='i';var _0x1c1a83=_[_0xc38b('0x5f')](_0x1ddfe5,[_0xc38b('0x2d'),_0x5405af[_0xc38b('0x4b')]]);if(!_0x1c1a83){switch(_0x5405af[_0xc38b('0x4b')]){case'unreadMessages':if(_0x5405af[_0xc38b('0x60')]==0x1){_0x4bbb1e[_0xc38b('0x61')]('`'+_0x5405af[_0xc38b('0x4b')]+_0xc38b('0x62'));}else{_0x4bbb1e[_0xc38b('0x61')]('`'+_0x5405af[_0xc38b('0x4b')]+_0xc38b('0x63'));}break;case _0xc38b('0x64'):if(_0x5405af[_0xc38b('0x65')]===_0xc38b('0x66')){if(_0x5405af['value'][_0xc38b('0x33')]('\x20')[_0xc38b('0x43')]>0x1){_0x4b0a8c[_0x58f8a8](_0xc38b('0x67'),qs['getFullTextValue'](_0x5405af[_0xc38b('0x60')]),null);}else{var _0x264de4='%'+_0x5405af['value']+'%';_0x4b0a8c[_0x58f8a8](_0xc38b('0x68'),_0x264de4,_0x264de4,_0x264de4);}}else{_0x1c1a83=_[_0xc38b('0x5f')](_0x1ddfe5,['name',_0xc38b('0x69')]);_0x5405af[_0xc38b('0x4b')]=_0xc38b('0x69');_0x15aba3=as[_0xc38b('0x6a')](_0x7514fb,_0x1c1a83['type'],_0x5405af);_0x4b0a8c[_0x58f8a8](_0x15aba3[_0xc38b('0x6b')],_0x15aba3[_0xc38b('0x60')][_0xc38b('0x6c')],_0x15aba3[_0xc38b('0x60')][_0xc38b('0x21')]);}break;case _0xc38b('0x6d'):var _0x2a7952=_0x5405af[_0xc38b('0x60')]['split'](',')[_0xc38b('0x3c')](function(_0x30d6ae){return Number(_0x30d6ae);});_0x2a7952['forEach'](function(_0x26c4e4){_0x5dd4b4['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x26c4e4+',%');});_0x2a354f=_['union'](_0x2a354f,_0x2a7952);break;case _0xc38b('0x6e'):if(_0x5405af[_0xc38b('0x65')]===_0xc38b('0x66')){_0x4b0a8c[_0x58f8a8](_0xc38b('0x6f'),'%'+_0x5405af[_0xc38b('0x60')]+'%',null);}else{_0x1c1a83=_[_0xc38b('0x5f')](_0x1ddfe5,[_0xc38b('0x2d'),'UserId']);_0x5405af['field']='UserId';_0x15aba3=as[_0xc38b('0x6a')](_0x7514fb,_0x1c1a83[_0xc38b('0x39')],_0x5405af);_0x4b0a8c[_0x58f8a8](_0x15aba3[_0xc38b('0x6b')],_0x15aba3[_0xc38b('0x60')][_0xc38b('0x6c')],_0x15aba3['value'][_0xc38b('0x21')]);}break;case _0xc38b('0x70'):_0x15aba3=as['buildExpression']('me',null,_0x5405af);_0x4b0a8c[_0x58f8a8](_0x15aba3[_0xc38b('0x6b')],_0x15aba3[_0xc38b('0x60')]['start'],_0x15aba3['value']['end']);break;}}else{var _0x15aba3=as[_0xc38b('0x6a')](_0x7514fb,_0x1c1a83[_0xc38b('0x39')],_0x5405af);_0x4b0a8c[_0x58f8a8](_0x15aba3[_0xc38b('0x6b')],_0x15aba3[_0xc38b('0x60')][_0xc38b('0x6c')],_0x15aba3['value'][_0xc38b('0x21')]);}}}else{var _0x2a9fd1=_(_0x46f2f0[_0xc38b('0x3d')])[_0xc38b('0x3e')]()[_0xc38b('0x3c')](function(_0x2422c5){return _[_0xc38b('0x71')](_0x1ddfe5,[_0xc38b('0x2d'),_0x2422c5])?_0x2422c5:undefined;})[_0xc38b('0x72')]()[_0xc38b('0x60')]();if(!_[_0xc38b('0x73')](_0x2a9fd1)){_0x2a9fd1[_0xc38b('0x34')](function(_0x223ce4){if(_0x223ce4===_0xc38b('0x74')){_0x4bbb1e[_0xc38b('0x48')](_0xc38b('0x75'),[][_0xc38b('0x76')](_0x46f2f0['query'][_0x223ce4]));}else if(_0x223ce4===_0xc38b('0x77')){var _0x303fcb=JSON['parse'](_0x46f2f0[_0xc38b('0x3d')][_0x223ce4])['$gte'];var _0xe092bd=JSON[_0xc38b('0x78')](_0x46f2f0[_0xc38b('0x3d')][_0x223ce4])[_0xc38b('0x79')];_0x4bbb1e[_0xc38b('0x48')](_0xc38b('0x7a'),_0x303fcb,_0xe092bd);}else{if(_0x46f2f0['query'][_0x223ce4]==='null'){_0x4bbb1e['where']('i.'+_0x223ce4+'\x20IS\x20NULL');}else{_0x4bbb1e[_0xc38b('0x48')]('i.'+_0x223ce4+_0xc38b('0x7b'),_0x46f2f0[_0xc38b('0x3d')][_0x223ce4]);}}});}if(_0x46f2f0['query'][_0xc38b('0x7c')]){if(_0x46f2f0[_0xc38b('0x3d')][_0xc38b('0x7c')]==0x1){_0x4bbb1e[_0xc38b('0x61')](_0xc38b('0x7d'));}else{_0x4bbb1e['having'](_0xc38b('0x7e'));}}if(_0x46f2f0[_0xc38b('0x3d')][_0xc38b('0x7f')]){_0x2a354f=_[_0xc38b('0x80')](_0x46f2f0['query']['tag'])?_0x46f2f0['query']['tag']:new Array(_0x46f2f0['query'][_0xc38b('0x7f')]);_0x2a354f[_0xc38b('0x34')](function(_0x3eba58){_0x5dd4b4['or'](_0xc38b('0x81'),'%,'+_0x3eba58+',%');});}if(_0x46f2f0['query']['filter']){var _0x5e43d9=_0x46f2f0[_0xc38b('0x3d')]['filter'][_0xc38b('0x82')]('\x5c','\x5c\x5c')[_0xc38b('0x82')](/'/g,'\x27\x27');if(qs[_0xc38b('0x83')](_0x5e43d9)){_0x4b0a8c['or'](_0xc38b('0x84'),_0x5e43d9+'%')['or'](_0xc38b('0x85'),_0x5e43d9+'%');}_0x4b0a8c['or'](_0xc38b('0x86'),_0x5e43d9+'%');}}_0x4bbb1e[_0xc38b('0x48')](_0x4b0a8c);_0x4bbb1e[_0xc38b('0x87')]('i.id');var _0x2584e4={'type':db['Sequelize'][_0xc38b('0x88')][_0xc38b('0x89')],'raw':!![]};var _0xc3a8cd=_0x4bbb1e[_0xc38b('0x8a')]();_0xc3a8cd[_0xc38b('0x4b')](_0xc38b('0x8b'));_0xc3a8cd[_0xc38b('0x4b')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');if(_0x4fba23[_0xc38b('0x46')]){_0x4fba23[_0xc38b('0x46')][_0xc38b('0x34')](function(_0x333b93){var _0x41abea=_0x333b93[0x0]==='contactName'?_0x333b93[0x0]:'i.'+_0x333b93[0x0];_0x4bbb1e['order'](_0x41abea,_0x333b93[0x1]===_0xc38b('0x8c')?![]:!![]);});}if(!_[_0xc38b('0x73')](_0x2a354f)){_0x4bbb1e[_0xc38b('0x61')](_0x5dd4b4);_0xc3a8cd['where'](_0xc38b('0x8d'),_0x2a354f);}BPromise['resolve']()[_0xc38b('0x2a')](function(){if(!_0x45f695){if(_0x46f2f0['query']['FaxAccountId'])return;_0xc3a8cd[_0xc38b('0x48')](_0xc38b('0x8e'));_0x4bbb1e['where'](_0xc38b('0x8e'));return;}if(_0x46f2f0[_0xc38b('0x8f')][_0xc38b('0x90')]!=='agent')return;return _0x46f2f0['user'][_0xc38b('0x91')]({'attributes':['id'],'raw':!![]})[_0xc38b('0x2a')](function(_0x162b68){if(_[_0xc38b('0x73')](_0x162b68)){_0xc3a8cd[_0xc38b('0x48')](_0xc38b('0x92'));_0x4bbb1e[_0xc38b('0x48')](_0xc38b('0x92'));}else{_0xc3a8cd[_0xc38b('0x48')]('i.FaxAccountId\x20IN\x20?',_[_0xc38b('0x3c')](_0x162b68,'id'));_0x4bbb1e[_0xc38b('0x48')]('i.FaxAccountId\x20IN\x20?',_[_0xc38b('0x3c')](_0x162b68,'id'));}});})[_0xc38b('0x2a')](function(){if(_0x46f2f0[_0xc38b('0x8f')][_0xc38b('0x90')]===_0xc38b('0x93')&&!_0x45f695&&!_0x46f2f0[_0xc38b('0x3d')]['FaxAccountId'])return[];return db[_0xc38b('0x94')][_0xc38b('0x3d')](_0xc3a8cd[_0xc38b('0x95')](),_0x2584e4);})[_0xc38b('0x2a')](function(_0x382707){_0x29a20b[_0xc38b('0x25')]=_0x382707[_0xc38b('0x43')];if(_0x29a20b[_0xc38b('0x25')]===0x0)return[];return db[_0xc38b('0x94')][_0xc38b('0x3d')](_0x13e1a9[_0xc38b('0x95')](),_0x2584e4)[_0xc38b('0x2a')](function(_0x29979c){_0x119237=_[_0xc38b('0x96')](_0x29979c,'id');_0x2584e4=_['merge'](_0x2584e4,{'model':db['FaxInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x46f2f0[_0xc38b('0x3d')][_0xc38b('0x42')]){_0x4fba23['attributes'][_0xc38b('0x34')](function(_0x28fe36){_0x4bbb1e[_0xc38b('0x4b')]('i.'+_0x28fe36);});}else{_0x4bbb1e[_0xc38b('0x4b')](_0xc38b('0x97'),'unreadMessages');_0x4bbb1e['field'](_0xc38b('0x98'),_0xc38b('0x99'));_0x4bbb1e[_0xc38b('0x4b')](_0xc38b('0x9a'),_0xc38b('0x9b'));_0x4bbb1e['field']('CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName');_0x4bbb1e['field'](_0xc38b('0x9c'));_0x4bbb1e[_0xc38b('0x4b')]('c.firstName',_0xc38b('0x9d'));_0x4bbb1e[_0xc38b('0x4b')]('c.lastName','Contact.lastName');_0x4bbb1e[_0xc38b('0x4b')]('c.email',_0xc38b('0x9e'));_0x4bbb1e[_0xc38b('0x4b')]('c.phone',_0xc38b('0x9f'));_0x4bbb1e[_0xc38b('0x4b')]('c.mobile','Contact.mobile');_0x4bbb1e[_0xc38b('0x4b')](_0xc38b('0xa0'),'Contact.fax');_0x4bbb1e[_0xc38b('0x4b')](_0xc38b('0xa1'),_0xc38b('0xa2'));_0x4bbb1e[_0xc38b('0x4b')]('o.internal','Owner.internal');_0x4bbb1e[_0xc38b('0x4b')](_0xc38b('0xa3'),'TagIds');}if(_0x4fba23['limit'])_0x4bbb1e[_0xc38b('0x45')](_0x4fba23[_0xc38b('0x45')]);if(_0x4fba23[_0xc38b('0x24')])_0x4bbb1e[_0xc38b('0x24')](_0x4fba23[_0xc38b('0x24')]);return db[_0xc38b('0x94')][_0xc38b('0x3d')](_0x4bbb1e[_0xc38b('0x95')](),_0x2584e4);})[_0xc38b('0x2a')](function(_0x4f6d4f){if(_0x4f6d4f[_0xc38b('0x43')]>0x0)_0x341a67[_0xc38b('0x48')]('ui.FaxInteractionId\x20IN\x20?',_['map'](_0x4f6d4f,'id'));return db[_0xc38b('0x94')][_0xc38b('0x3d')](_0x341a67[_0xc38b('0x95')](),_0x2584e4)[_0xc38b('0x2a')](function(_0x369621){var _0x27cda7=_['groupBy'](_0x369621,_0xc38b('0xa4'));var _0x3f3f49=[];_0x4f6d4f[_0xc38b('0x34')](function(_0x3333bd){_0x3f3f49[_0xc38b('0x35')](updateFaxInteraction(_0x3333bd,_0x119237,_0x27cda7));});return BPromise[_0xc38b('0xa5')](_0x3f3f49);});});})[_0xc38b('0x2a')](function(_0xe3b476){_0x29a20b['rows']=_0xe3b476;return _0x29a20b;})['then'](respondWithFilteredResult(_0x5f0b39,_0x4fba23))[_0xc38b('0xa6')](handleError(_0x5f0b39,null));};exports[_0xc38b('0xa7')]=function(_0x4d5ba0,_0x9551cc){var _0x2ef920={'raw':![],'where':{'id':_0x4d5ba0[_0xc38b('0xa8')]['id']}},_0x4947d2={};_0x4947d2[_0xc38b('0x3b')]=_[_0xc38b('0x3e')](db[_0xc38b('0x37')][_0xc38b('0x38')]);_0x4947d2[_0xc38b('0x3d')]=_[_0xc38b('0x3e')](_0x4d5ba0[_0xc38b('0x3d')]);_0x4947d2[_0xc38b('0x3f')]=_[_0xc38b('0x40')](_0x4947d2[_0xc38b('0x3b')],_0x4947d2[_0xc38b('0x3d')]);_0x2ef920['attributes']=_[_0xc38b('0x40')](_0x4947d2[_0xc38b('0x3b')],qs['fields'](_0x4d5ba0[_0xc38b('0x3d')][_0xc38b('0x42')]));_0x2ef920[_0xc38b('0x41')]=_0x2ef920[_0xc38b('0x41')][_0xc38b('0x43')]?_0x2ef920[_0xc38b('0x41')]:_0x4947d2[_0xc38b('0x3b')];if(_0x4d5ba0[_0xc38b('0x3d')]['includeAll']){_0x2ef920[_0xc38b('0xa9')]=[{'all':!![]}];}_0x2ef920=_['merge']({},_0x2ef920,_0x4d5ba0['options']);return db[_0xc38b('0x37')][_0xc38b('0x5f')](_0x2ef920)['then'](handleEntityNotFound(_0x9551cc,null))['then'](respondWithResult(_0x9551cc,null))[_0xc38b('0xa6')](handleError(_0x9551cc,null));};exports['create']=function(_0x180529,_0x50cf22){return db['FaxInteraction']['create'](_0x180529[_0xc38b('0x70')],{})[_0xc38b('0x2a')](respondWithResult(_0x50cf22,0xc9))[_0xc38b('0xa6')](handleError(_0x50cf22,null));};exports[_0xc38b('0x29')]=function(_0x2cf53b,_0xf20c55){if(_0x2cf53b[_0xc38b('0x70')]['id']){delete _0x2cf53b['body']['id'];}return db[_0xc38b('0x37')]['find']({'where':{'id':_0x2cf53b[_0xc38b('0xa8')]['id']}})[_0xc38b('0x2a')](handleEntityNotFound(_0xf20c55,null))['then'](saveUpdates(_0x2cf53b['body'],null))[_0xc38b('0x2a')](respondWithResult(_0xf20c55,null))[_0xc38b('0xa6')](handleError(_0xf20c55,null));};exports[_0xc38b('0x2b')]=function(_0x316b93,_0x56cc0e){return db['FaxInteraction'][_0xc38b('0x5f')]({'where':{'id':_0x316b93[_0xc38b('0xa8')]['id']}})[_0xc38b('0x2a')](handleEntityNotFound(_0x56cc0e,null))[_0xc38b('0x2a')](removeEntity(_0x56cc0e,null))[_0xc38b('0xa6')](handleError(_0x56cc0e,null));};exports[_0xc38b('0xaa')]=function(_0x423b7a,_0x142aa7){return db[_0xc38b('0x37')][_0xc38b('0xaa')]()[_0xc38b('0x2a')](respondWithResult(_0x142aa7,null))[_0xc38b('0xa6')](handleError(_0x142aa7,null));};exports[_0xc38b('0xab')]=function(_0x5c9fe7,_0x59158a,_0x240558){return db[_0xc38b('0xac')][_0xc38b('0x5f')]({'where':{'id':_0x5c9fe7[_0xc38b('0xa8')]['id']}})['then'](handleEntityNotFound(_0x59158a,null))[_0xc38b('0x2a')](function(_0x449f0f){if(_0x449f0f){return _0x449f0f[_0xc38b('0xab')](_0x5c9fe7['body'][_0xc38b('0xad')],_['omit'](_0x5c9fe7['body'],[_0xc38b('0xad'),'id'])||{});}})['then'](respondWithResult(_0x59158a,null))[_0xc38b('0xa6')](handleError(_0x59158a,null));};exports['getMessages']=function(_0x447074,_0x259405,_0x311ae2){var _0x51c00={'raw':![],'where':{}};var _0x27ddcd={};var _0x3f9b82={'count':0x0,'rows':[]};return db['FaxInteraction'][_0xc38b('0xae')]({'where':{'id':_0x447074[_0xc38b('0xa8')]['id']}})['then'](handleEntityNotFound(_0x259405,null))[_0xc38b('0x2a')](function(_0x49d52a){if(_0x49d52a){_0x27ddcd[_0xc38b('0x3b')]=_[_0xc38b('0x3e')](db[_0xc38b('0xac')][_0xc38b('0x38')]);_0x27ddcd[_0xc38b('0x3d')]=_[_0xc38b('0x3e')](_0x447074['query']);_0x27ddcd['filters']=_[_0xc38b('0x40')](_0x27ddcd[_0xc38b('0x3b')],_0x27ddcd[_0xc38b('0x3d')]);_0x51c00[_0xc38b('0x41')]=_[_0xc38b('0x40')](_0x27ddcd[_0xc38b('0x3b')],qs[_0xc38b('0x42')](_0x447074[_0xc38b('0x3d')][_0xc38b('0x42')]));_0x51c00['attributes']=_0x51c00['attributes'][_0xc38b('0x43')]?_0x51c00['attributes']:_0x27ddcd[_0xc38b('0x3b')];if(!_0x447074[_0xc38b('0x3d')]['hasOwnProperty'](_0xc38b('0xaf'))){_0x51c00[_0xc38b('0x45')]=qs[_0xc38b('0x45')](_0x447074[_0xc38b('0x3d')][_0xc38b('0x45')]);_0x51c00[_0xc38b('0x24')]=qs[_0xc38b('0x24')](_0x447074[_0xc38b('0x3d')][_0xc38b('0x24')]);}_0x51c00[_0xc38b('0x46')]=qs['sort'](_0x447074['query'][_0xc38b('0x47')]);_0x51c00[_0xc38b('0x48')]=qs['filters'](_[_0xc38b('0x49')](_0x447074[_0xc38b('0x3d')],_0x27ddcd[_0xc38b('0x3f')]));_0x51c00[_0xc38b('0x48')][_0xc38b('0xa4')]=_0x49d52a['id'];if(_0x447074['query'][_0xc38b('0xb0')]){_0x51c00[_0xc38b('0x48')]=_[_0xc38b('0xb1')](_0x51c00[_0xc38b('0x48')],{'$or':_['map'](_0x51c00['attributes'],function(_0x21dfcc){var _0x1fd512={};_0x1fd512[_0x21dfcc]={'$like':'%'+_0x447074[_0xc38b('0x3d')][_0xc38b('0xb0')]+'%'};return _0x1fd512;})});}if(_0x447074[_0xc38b('0x3d')][_0xc38b('0xb2')]){var _0x41d20a=_0x447074[_0xc38b('0x3d')]['$gte'][_0xc38b('0x33')](',');var _0x5c9b21={};_0x5c9b21[_0x41d20a[0x0]]={'$gte':moment(_0x41d20a[0x1])[_0xc38b('0xb3')](_0xc38b('0xb4'))};_0x51c00[_0xc38b('0x48')]=_[_0xc38b('0xb1')](_0x51c00[_0xc38b('0x48')],_0x5c9b21);}_0x51c00=_['merge']({},_0x51c00,_0x447074['options']);return db[_0xc38b('0xac')][_0xc38b('0x25')]({'where':_0x51c00[_0xc38b('0x48')]})['then'](function(_0x3b8844){_0x3f9b82[_0xc38b('0x25')]=_0x3b8844;if(_0x447074[_0xc38b('0x3d')][_0xc38b('0xb5')]){_0x51c00[_0xc38b('0xa9')]=[{'all':!![]}];}return db[_0xc38b('0xac')][_0xc38b('0xb6')](_0x51c00);})[_0xc38b('0x2a')](function(_0x12e024){_0x3f9b82[_0xc38b('0xb7')]=_0x12e024;return _0x3f9b82;});}})[_0xc38b('0x2a')](respondWithFilteredResult(_0x259405,_0x51c00))['catch'](handleError(_0x259405,null));};exports[_0xc38b('0xb8')]=function(_0x1f7cd9,_0x5a393c,_0x3466f5){return db['FaxInteraction'][_0xc38b('0x5f')]({'where':{'id':_0x1f7cd9[_0xc38b('0xa8')]['id']}})[_0xc38b('0x2a')](handleEntityNotFound(_0x5a393c,null))['then'](function(_0x3eaeb3){if(_0x3eaeb3){return _0x3eaeb3['setTags'](_0x1f7cd9[_0xc38b('0x70')][_0xc38b('0xad')],_[_0xc38b('0xb9')](_0x1f7cd9[_0xc38b('0x70')],[_0xc38b('0xad'),'id'])||{})[_0xc38b('0xba')](function(){return db[_0xc38b('0x6d')]['findAll']({'attributes':['id','name',_0xc38b('0xbb')],'where':{'id':_0x1f7cd9[_0xc38b('0x70')][_0xc38b('0xad')]}});})[_0xc38b('0x2a')](function(_0x97cb5b){socket[_0xc38b('0xbc')]('faxInteractionTags:save',{'id':Number(_0x1f7cd9['params']['id']),'tags':_0x97cb5b||[]});return{'id':Number(_0x1f7cd9['params']['id']),'tags':_0x97cb5b||[]};});}})[_0xc38b('0x2a')](respondWithResult(_0x5a393c,null))[_0xc38b('0xa6')](handleError(_0x5a393c,null));};exports['removeTags']=function(_0x538251,_0xa88d06,_0xf89eb4){return db[_0xc38b('0x37')][_0xc38b('0x5f')]({'where':{'id':_0x538251['params']['id']}})[_0xc38b('0x2a')](handleEntityNotFound(_0xa88d06,null))['then'](function(_0x49db27){if(_0x49db27){return _0x49db27[_0xc38b('0xbd')](_0x538251['query'][_0xc38b('0xad')]);}})[_0xc38b('0x2a')](respondWithStatusCode(_0xa88d06,null))[_0xc38b('0xa6')](handleError(_0xa88d06,null));};exports[_0xc38b('0xbe')]=function(_0x31a781,_0x4f849f){var _0x3172fb=moment()[_0xc38b('0xbf')]()['toString']();var _0x2dc8df=path[_0xc38b('0xc0')](config['root'],_0xc38b('0xc1'),_0xc38b('0xc2'),_0xc38b('0xc3'));var _0x519859=path['join'](config[_0xc38b('0xc4')],'server',_0xc38b('0xc2'),_0xc38b('0xc5'));var _0x16b026=path['join'](_0x2dc8df,_0x3172fb);var _0x95b036=util['format'](_0xc38b('0xc6'),_0x31a781[_0xc38b('0xa8')]['id'],_0x3172fb);var _0x16aa23=path[_0xc38b('0xc0')](_0x2dc8df,_0x95b036);var _0x125ffb=[];_0x125ffb[_0xc38b('0x35')]({'model':db[_0xc38b('0xc7')],'as':_0xc38b('0xc7'),'raw':!![]});var _0x3c6664=[{'model':db[_0xc38b('0xac')],'as':'Messages','attributes':['id',_0xc38b('0x70'),_0xc38b('0x77')],'include':_0x125ffb}];return db[_0xc38b('0x37')]['find']({'where':{'id':_0x31a781[_0xc38b('0xa8')]['id']},'include':_0x3c6664})[_0xc38b('0x2a')](handleEntityNotFound(_0x4f849f,null))[_0xc38b('0x2a')](function(_0x324d1c){if(_0x324d1c&&_0x324d1c[_0xc38b('0xc8')]){var _0x410e9e=_0x324d1c[_0xc38b('0xc9')]({'plain':!![]});fs[_0xc38b('0xca')](_0x16b026);for(var _0x1dac38=0x0;_0x1dac38<_0x410e9e[_0xc38b('0xc8')]['length'];_0x1dac38++){var _0x3d2d15=_0x410e9e[_0xc38b('0xc8')][_0x1dac38][_0xc38b('0xc7')];if(_0x3d2d15){var _0x2e51b6=path['join'](_0x519859,_0x3d2d15['basename']);if(fs[_0xc38b('0xcb')](_0x2e51b6)){fs[_0xc38b('0xcc')](_0x2e51b6)[_0xc38b('0xcd')](fs[_0xc38b('0xce')](path[_0xc38b('0xc0')](_0x16b026,_0x3d2d15['basename'])));}}}return BPromise[_0xc38b('0xcf')]()['then'](function(){return new BPromise(function(_0xf82af2,_0x591109){zipdir(_0x16b026,{'saveTo':_0x16aa23},function(_0x121466,_0x2f7ba6){if(_0x121466)return _0x591109(_0x121466);return _0xf82af2(_0x2f7ba6);});})[_0xc38b('0x2a')](function(){return new BPromise(function(_0x5b525c,_0x206ac6){rimraf(_0x16b026,function(_0x3b9ec9){if(_0x3b9ec9)_0x206ac6(_0x3b9ec9);return _0x5b525c();});});})[_0xc38b('0x2a')](function(){return _0x4f849f[_0xc38b('0xbe')](_0x16aa23,_0x95b036,function(_0xc00cbd){if(_0xc00cbd){console[_0xc38b('0xd0')](_0xc38b('0xd1'),_0xc00cbd);}else{fs[_0xc38b('0xd2')](_0x16aa23);}});});});}else{return _0x4f849f['sendStatus'](0xc8);}})['catch'](handleError(_0x4f849f,null));}; \ No newline at end of file +var _0xc2e8=['CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','some','compact','isEmpty','i.FaxAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','QueryTypes','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve','FaxAccountId','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','agent','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','role','sequelize','toString','keyBy','unreadMessages','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','o.internal','Owner.internal','FaxInteractionId','all','rows','show','params','includeAll','merge','create','body','describe','addMessage','ids','omit','getMessages','findOne','FaxMessage','nolimit','options','include','findAll','addTags','setTags','emit','removeTags','download','unix','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','Attachment','Messages','get','basename','createReadStream','log','err','unlinkSync','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','send','Users','map','fullname','TagIds','Tags','split','forEach','push','catch','index','FaxInteraction','rawAttributes','fieldName','type','key','model','name','query','keys','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filters','select','field','color','from','tools_tags','u.id','ui.FaxInteractionId','user_has_fax_interactions','left_join','u.id\x20=\x20ui.UserId','fax_interactions','cm_contacts','users','o.id\x20=\x20i.UserId','fax_accounts','a.id\x20=\x20i.FaxAccountId','fax_messages','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','t.id\x20=\x20it.TagId','expr','find','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User'];(function(_0x9bc85,_0x12b60b){var _0x4ba2ec=function(_0xc9afbd){while(--_0xc9afbd){_0x9bc85['push'](_0x9bc85['shift']());}};_0x4ba2ec(++_0x12b60b);}(_0xc2e8,0x66));var _0x8c2e=function(_0x311322,_0x5fd3ac){_0x311322=_0x311322-0x0;var _0xbb55e2=_0xc2e8[_0x311322];return _0xbb55e2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8c2e('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8c2e('0x1'));var rp=require(_0x8c2e('0x2'));var moment=require(_0x8c2e('0x3'));var BPromise=require(_0x8c2e('0x4'));var Mustache=require(_0x8c2e('0x5'));var util=require('util');var path=require('path');var sox=require(_0x8c2e('0x6'));var csv=require(_0x8c2e('0x7'));var ejs=require(_0x8c2e('0x8'));var fs=require('fs');var fs_extra=require(_0x8c2e('0x9'));var _=require(_0x8c2e('0xa'));var squel=require('squel');var crypto=require(_0x8c2e('0xb'));var jsforce=require(_0x8c2e('0xc'));var deskjs=require(_0x8c2e('0xd'));var toCsv=require(_0x8c2e('0x7'));var querystring=require(_0x8c2e('0xe'));var Papa=require(_0x8c2e('0xf'));var Redis=require(_0x8c2e('0x10'));var authService=require(_0x8c2e('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x8c2e('0x12'));var hardwareService=require(_0x8c2e('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x8c2e('0x14'));var licenseUtil=require(_0x8c2e('0x15'));var db=require(_0x8c2e('0x16'))['db'];config[_0x8c2e('0x17')]=_[_0x8c2e('0x18')](config[_0x8c2e('0x17')],{'host':_0x8c2e('0x19'),'port':0x18eb});var socket=require(_0x8c2e('0x1a'))(new Redis(config[_0x8c2e('0x17')]));require(_0x8c2e('0x1b'))[_0x8c2e('0x1c')](socket);function respondWithStatusCode(_0x1c1c60,_0x46ec56){_0x46ec56=_0x46ec56||0xcc;return function(_0xb47411){if(_0xb47411){return _0x1c1c60[_0x8c2e('0x1d')](_0x46ec56);}return _0x1c1c60[_0x8c2e('0x1e')](_0x46ec56)[_0x8c2e('0x1f')]();};}function respondWithResult(_0x37cd83,_0x4b6848){_0x4b6848=_0x4b6848||0xc8;return function(_0x1b977a){if(_0x1b977a){return _0x37cd83['status'](_0x4b6848)[_0x8c2e('0x20')](_0x1b977a);}};}function respondWithFilteredResult(_0x4b4ead,_0x5f4277){return function(_0x4e9c0f){if(_0x4e9c0f){var _0x223442=typeof _0x5f4277[_0x8c2e('0x21')]===_0x8c2e('0x22')&&typeof _0x5f4277['limit']===_0x8c2e('0x22');var _0x45b833=_0x4e9c0f[_0x8c2e('0x23')];var _0x5d8d93=_0x223442?0x0:_0x5f4277[_0x8c2e('0x21')];var _0x3fb186=_0x223442?_0x4e9c0f['count']:_0x5f4277[_0x8c2e('0x21')]+_0x5f4277[_0x8c2e('0x24')];var _0x2d9a1f;if(_0x3fb186>=_0x45b833){_0x3fb186=_0x45b833;_0x2d9a1f=0xc8;}else{_0x2d9a1f=0xce;}_0x4b4ead[_0x8c2e('0x1e')](_0x2d9a1f);return _0x4b4ead[_0x8c2e('0x25')](_0x8c2e('0x26'),_0x5d8d93+'-'+_0x3fb186+'/'+_0x45b833)[_0x8c2e('0x20')](_0x4e9c0f);}return null;};}function patchUpdates(_0x500576){return function(_0x38cd40){try{jsonpatch[_0x8c2e('0x27')](_0x38cd40,_0x500576,!![]);}catch(_0x252713){return BPromise['reject'](_0x252713);}return _0x38cd40[_0x8c2e('0x28')]();};}function saveUpdates(_0x4cd424,_0x134212){return function(_0x40245f){if(_0x40245f){return _0x40245f[_0x8c2e('0x29')](_0x4cd424)[_0x8c2e('0x2a')](function(_0x5cc999){return _0x5cc999;});}return null;};}function removeEntity(_0x28c1fc,_0x3b22d5){return function(_0x2031d7){if(_0x2031d7){return _0x2031d7[_0x8c2e('0x2b')]()['then'](function(){_0x28c1fc[_0x8c2e('0x1e')](0xcc)[_0x8c2e('0x1f')]();});}};}function handleEntityNotFound(_0x27e487,_0xdc9cd4){return function(_0x311e2b){if(!_0x311e2b){_0x27e487['sendStatus'](0x194);}return _0x311e2b;};}function handleError(_0x1d1c35,_0x3cd602){_0x3cd602=_0x3cd602||0x1f4;return function(_0x392221){logger[_0x8c2e('0x2c')](_0x392221[_0x8c2e('0x2d')]);if(_0x392221['name']){delete _0x392221['name'];}_0x1d1c35['status'](_0x3cd602)[_0x8c2e('0x2e')](_0x392221);};}function getInteractionUsers(_0x38f0ce,_0x308a4a){return new BPromise(function(_0x433d6a,_0x15f80a){try{if(_0x308a4a[_0x38f0ce['id']]){_0x38f0ce[_0x8c2e('0x2f')]=_[_0x8c2e('0x30')](_0x308a4a[_0x38f0ce['id']],function(_0x522586){return{'id':_0x522586['id'],'fullname':_0x522586[_0x8c2e('0x31')]};});}}catch(_0x12c82f){_0x15f80a(_0x12c82f);}_0x433d6a(_0x38f0ce);});}function getInteractionTags(_0x4b30ed,_0x1187e3){return new BPromise(function(_0x2f07c4,_0x5be329){try{if(_0x4b30ed[_0x8c2e('0x32')]){_0x4b30ed[_0x8c2e('0x33')]=[];_0x4b30ed[_0x8c2e('0x32')][_0x8c2e('0x34')](',')[_0x8c2e('0x35')](function(_0x2fbaae){_0x4b30ed['Tags'][_0x8c2e('0x36')](_0x1187e3[_0x2fbaae]);});}delete _0x4b30ed[_0x8c2e('0x32')];}catch(_0x18fb8d){_0x5be329(_0x18fb8d);}_0x2f07c4(_0x4b30ed);});}function updateFaxInteraction(_0x2feaf0,_0x29540b,_0x388cfd){return new BPromise(function(_0x20b65c,_0x5369df){return getInteractionUsers(_0x2feaf0,_0x388cfd)[_0x8c2e('0x2a')](function(_0x46a03c){return getInteractionTags(_0x46a03c,_0x29540b);})[_0x8c2e('0x2a')](function(_0x1f1c73){_0x20b65c(_0x1f1c73);})[_0x8c2e('0x37')](function(_0x510e79){_0x5369df(_0x510e79);});});}exports[_0x8c2e('0x38')]=function(_0x5a2117,_0x4c44f8){var _0x2d31c0={},_0x508872={},_0x1967ef={'count':0x0,'rows':[]};var _0x28d651=_['map'](db[_0x8c2e('0x39')][_0x8c2e('0x3a')],function(_0x19fe01){return{'name':_0x19fe01[_0x8c2e('0x3b')],'type':_0x19fe01[_0x8c2e('0x3c')][_0x8c2e('0x3d')]};});_0x508872[_0x8c2e('0x3e')]=_[_0x8c2e('0x30')](_0x28d651,_0x8c2e('0x3f'));_0x508872[_0x8c2e('0x40')]=_[_0x8c2e('0x41')](_0x5a2117[_0x8c2e('0x40')]);_0x508872['filters']=_[_0x8c2e('0x42')](_0x508872[_0x8c2e('0x3e')],_0x508872['query']);_0x2d31c0['attributes']=_[_0x8c2e('0x42')](_0x508872['model'],qs[_0x8c2e('0x43')](_0x5a2117[_0x8c2e('0x40')][_0x8c2e('0x43')]));_0x2d31c0[_0x8c2e('0x44')]=_0x2d31c0[_0x8c2e('0x44')][_0x8c2e('0x45')]?_0x2d31c0[_0x8c2e('0x44')]:_0x508872[_0x8c2e('0x3e')];if(!_0x5a2117[_0x8c2e('0x40')][_0x8c2e('0x46')]('nolimit')){_0x2d31c0['limit']=qs['limit'](_0x5a2117['query'][_0x8c2e('0x24')]);_0x2d31c0[_0x8c2e('0x21')]=qs['offset'](_0x5a2117['query'][_0x8c2e('0x21')]);}_0x2d31c0[_0x8c2e('0x47')]=qs[_0x8c2e('0x48')](_0x5a2117[_0x8c2e('0x40')]['sort']);_0x2d31c0[_0x8c2e('0x49')]=qs['filters'](_[_0x8c2e('0x4a')](_0x5a2117[_0x8c2e('0x40')],_0x508872[_0x8c2e('0x4b')]),_0x28d651);var _0x304026=[];var _0x3d7a58=squel[_0x8c2e('0x4c')]()['field']('id')['field'](_0x8c2e('0x3f'))[_0x8c2e('0x4d')](_0x8c2e('0x4e'))[_0x8c2e('0x4f')](_0x8c2e('0x50'));var _0x1eb3c0=squel[_0x8c2e('0x4c')]()[_0x8c2e('0x4d')](_0x8c2e('0x51'))[_0x8c2e('0x4d')]('u.fullname')[_0x8c2e('0x4d')](_0x8c2e('0x52'))['from'](_0x8c2e('0x53'),'ui')[_0x8c2e('0x54')]('users','u',_0x8c2e('0x55'));var _0x4cea7b=squel[_0x8c2e('0x4c')]()[_0x8c2e('0x4f')](_0x8c2e('0x56'),'i')[_0x8c2e('0x54')](_0x8c2e('0x57'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x8c2e('0x54')](_0x8c2e('0x58'),'o',_0x8c2e('0x59'))[_0x8c2e('0x54')](_0x8c2e('0x5a'),'a',_0x8c2e('0x5b'))['left_join'](_0x8c2e('0x5c'),'me',_0x8c2e('0x5d'))[_0x8c2e('0x54')](_0x8c2e('0x5e'),'it','it.FaxInteractionId\x20=\x20i.id')['left_join'](_0x8c2e('0x50'),'t',_0x8c2e('0x5f'));var _0xb94370=squel[_0x8c2e('0x60')]();var _0x486784=[];var _0x57ebf9=squel['expr']();var _0xb4ae10;if(_0x5a2117['query']['search']){_0xb4ae10=as['parseSearch'](_0x5a2117[_0x8c2e('0x40')]['search']);var _0x704816=_0xb4ae10['sqlOperator'];for(var _0x4ae10a=0x0;_0x4ae10a<_0xb4ae10['conditions'][_0x8c2e('0x45')];_0x4ae10a++){var _0x57b4aa=_0xb4ae10['conditions'][_0x4ae10a];var _0x406ecd='i';var _0x668884=_[_0x8c2e('0x61')](_0x28d651,[_0x8c2e('0x3f'),_0x57b4aa[_0x8c2e('0x4d')]]);if(!_0x668884){switch(_0x57b4aa[_0x8c2e('0x4d')]){case'unreadMessages':if(_0x57b4aa[_0x8c2e('0x62')]==0x1){_0x4cea7b[_0x8c2e('0x63')]('`'+_0x57b4aa[_0x8c2e('0x4d')]+_0x8c2e('0x64'));}else{_0x4cea7b[_0x8c2e('0x63')]('`'+_0x57b4aa[_0x8c2e('0x4d')]+_0x8c2e('0x65'));}break;case _0x8c2e('0x66'):if(_0x57b4aa[_0x8c2e('0x67')]===_0x8c2e('0x68')){if(_0x57b4aa['value']['split']('\x20')['length']>0x1){_0xb94370[_0x704816](_0x8c2e('0x69'),qs[_0x8c2e('0x6a')](_0x57b4aa[_0x8c2e('0x62')]),null);}else{var _0x4ef6fb='%'+_0x57b4aa[_0x8c2e('0x62')]+'%';_0xb94370[_0x704816]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x4ef6fb,_0x4ef6fb,_0x4ef6fb);}}else{_0x668884=_[_0x8c2e('0x61')](_0x28d651,[_0x8c2e('0x3f'),_0x8c2e('0x6b')]);_0x57b4aa[_0x8c2e('0x4d')]=_0x8c2e('0x6b');_0x5b2574=as[_0x8c2e('0x6c')](_0x406ecd,_0x668884[_0x8c2e('0x3c')],_0x57b4aa);_0xb94370[_0x704816](_0x5b2574[_0x8c2e('0x6d')],_0x5b2574[_0x8c2e('0x62')][_0x8c2e('0x6e')],_0x5b2574[_0x8c2e('0x62')]['end']);}break;case _0x8c2e('0x6f'):var _0x116ae2=_0x57b4aa[_0x8c2e('0x62')][_0x8c2e('0x34')](',')[_0x8c2e('0x30')](function(_0x548c5b){return Number(_0x548c5b);});_0x116ae2[_0x8c2e('0x35')](function(_0x3831ff){_0x57ebf9['or'](_0x8c2e('0x70'),'%,'+_0x3831ff+',%');});_0x486784=_[_0x8c2e('0x71')](_0x486784,_0x116ae2);break;case _0x8c2e('0x72'):if(_0x57b4aa['operator']===_0x8c2e('0x68')){_0xb94370[_0x704816](_0x8c2e('0x73'),'%'+_0x57b4aa[_0x8c2e('0x62')]+'%',null);}else{_0x668884=_[_0x8c2e('0x61')](_0x28d651,[_0x8c2e('0x3f'),_0x8c2e('0x74')]);_0x57b4aa[_0x8c2e('0x4d')]=_0x8c2e('0x74');_0x5b2574=as[_0x8c2e('0x6c')](_0x406ecd,_0x668884[_0x8c2e('0x3c')],_0x57b4aa);_0xb94370[_0x704816](_0x5b2574[_0x8c2e('0x6d')],_0x5b2574[_0x8c2e('0x62')][_0x8c2e('0x6e')],_0x5b2574[_0x8c2e('0x62')][_0x8c2e('0x1f')]);}break;case'body':_0x5b2574=as[_0x8c2e('0x6c')]('me',null,_0x57b4aa);_0xb94370[_0x704816](_0x5b2574['text'],_0x5b2574[_0x8c2e('0x62')][_0x8c2e('0x6e')],_0x5b2574[_0x8c2e('0x62')][_0x8c2e('0x1f')]);break;}}else{var _0x5b2574=as[_0x8c2e('0x6c')](_0x406ecd,_0x668884['type'],_0x57b4aa);_0xb94370[_0x704816](_0x5b2574[_0x8c2e('0x6d')],_0x5b2574[_0x8c2e('0x62')][_0x8c2e('0x6e')],_0x5b2574['value'][_0x8c2e('0x1f')]);}}}else{var _0x41aca9=_(_0x5a2117[_0x8c2e('0x40')])[_0x8c2e('0x41')]()[_0x8c2e('0x30')](function(_0x397540){return _[_0x8c2e('0x75')](_0x28d651,[_0x8c2e('0x3f'),_0x397540])?_0x397540:undefined;})[_0x8c2e('0x76')]()[_0x8c2e('0x62')]();if(!_[_0x8c2e('0x77')](_0x41aca9)){_0x41aca9[_0x8c2e('0x35')](function(_0x33695d){if(_0x33695d==='FaxAccountId'){_0x4cea7b[_0x8c2e('0x49')](_0x8c2e('0x78'),[][_0x8c2e('0x79')](_0x5a2117[_0x8c2e('0x40')][_0x33695d]));}else if(_0x33695d===_0x8c2e('0x7a')){var _0xf7bf29=JSON[_0x8c2e('0x7b')](_0x5a2117[_0x8c2e('0x40')][_0x33695d])[_0x8c2e('0x7c')];var _0x51ea34=JSON[_0x8c2e('0x7b')](_0x5a2117['query'][_0x33695d])[_0x8c2e('0x7d')];_0x4cea7b[_0x8c2e('0x49')](_0x8c2e('0x7e'),_0xf7bf29,_0x51ea34);}else{if(_0x5a2117[_0x8c2e('0x40')][_0x33695d]==='null'){_0x4cea7b[_0x8c2e('0x49')]('i.'+_0x33695d+_0x8c2e('0x7f'));}else{_0x4cea7b[_0x8c2e('0x49')]('i.'+_0x33695d+_0x8c2e('0x80'),_0x5a2117['query'][_0x33695d]);}}});}if(_0x5a2117['query'][_0x8c2e('0x81')]){if(_0x5a2117[_0x8c2e('0x40')][_0x8c2e('0x81')]==0x1){_0x4cea7b[_0x8c2e('0x63')]('`unreadMessages`\x20=\x200');}else{_0x4cea7b[_0x8c2e('0x63')](_0x8c2e('0x82'));}}if(_0x5a2117['query']['tag']){_0x486784=_['isArray'](_0x5a2117[_0x8c2e('0x40')][_0x8c2e('0x83')])?_0x5a2117[_0x8c2e('0x40')][_0x8c2e('0x83')]:new Array(_0x5a2117[_0x8c2e('0x40')]['tag']);_0x486784[_0x8c2e('0x35')](function(_0x14f6e4){_0x57ebf9['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x14f6e4+',%');});}if(_0x5a2117[_0x8c2e('0x40')][_0x8c2e('0x84')]){var _0x3c559a=_0x5a2117[_0x8c2e('0x40')][_0x8c2e('0x84')][_0x8c2e('0x85')]('\x5c','\x5c\x5c')[_0x8c2e('0x85')](/'/g,'\x27\x27');if(qs[_0x8c2e('0x86')](_0x3c559a)){_0xb94370['or'](_0x8c2e('0x87'),_0x3c559a+'%')['or'](_0x8c2e('0x88'),_0x3c559a+'%');}_0xb94370['or'](_0x8c2e('0x89'),_0x3c559a+'%');}}_0x4cea7b[_0x8c2e('0x49')](_0xb94370);_0x4cea7b[_0x8c2e('0x8a')]('i.id');var _0x6df6c2={'type':db['Sequelize'][_0x8c2e('0x8b')][_0x8c2e('0x8c')],'raw':!![]};var _0x5a285c=_0x4cea7b[_0x8c2e('0x8d')]();_0x5a285c[_0x8c2e('0x4d')](_0x8c2e('0x8e'));_0x5a285c['field'](_0x8c2e('0x8f'),'unreadMessages');if(_0x2d31c0['order']){_0x2d31c0[_0x8c2e('0x47')][_0x8c2e('0x35')](function(_0x415d45){var _0x1342ad=_0x415d45[0x0]===_0x8c2e('0x90')?_0x415d45[0x0]:'i.'+_0x415d45[0x0];_0x4cea7b[_0x8c2e('0x47')](_0x1342ad,_0x415d45[0x1]===_0x8c2e('0x91')?![]:!![]);});}if(!_[_0x8c2e('0x77')](_0x486784)){_0x4cea7b[_0x8c2e('0x63')](_0x57ebf9);_0x5a285c[_0x8c2e('0x49')](_0x8c2e('0x92'),_0x486784);}BPromise[_0x8c2e('0x93')]()['then'](function(){if(!_0xb4ae10){if(_0x5a2117[_0x8c2e('0x40')][_0x8c2e('0x94')])return;_0x5a285c[_0x8c2e('0x49')](_0x8c2e('0x95'));_0x4cea7b[_0x8c2e('0x49')](_0x8c2e('0x95'));return;}if(_0x5a2117[_0x8c2e('0x96')]['role']!==_0x8c2e('0x97'))return;return _0x5a2117[_0x8c2e('0x96')][_0x8c2e('0x98')]({'attributes':['id'],'raw':!![]})['then'](function(_0x38a458){if(_[_0x8c2e('0x77')](_0x38a458)){_0x5a285c['where'](_0x8c2e('0x99'));_0x4cea7b[_0x8c2e('0x49')](_0x8c2e('0x99'));}else{_0x5a285c[_0x8c2e('0x49')](_0x8c2e('0x78'),_[_0x8c2e('0x30')](_0x38a458,'id'));_0x4cea7b['where']('i.FaxAccountId\x20IN\x20?',_[_0x8c2e('0x30')](_0x38a458,'id'));}});})[_0x8c2e('0x2a')](function(){if(_0x5a2117['user'][_0x8c2e('0x9a')]===_0x8c2e('0x97')&&!_0xb4ae10&&!_0x5a2117[_0x8c2e('0x40')][_0x8c2e('0x94')])return[];return db[_0x8c2e('0x9b')][_0x8c2e('0x40')](_0x5a285c[_0x8c2e('0x9c')](),_0x6df6c2);})['then'](function(_0x432815){_0x1967ef['count']=_0x432815['length'];if(_0x1967ef[_0x8c2e('0x23')]===0x0)return[];return db[_0x8c2e('0x9b')]['query'](_0x3d7a58[_0x8c2e('0x9c')](),_0x6df6c2)[_0x8c2e('0x2a')](function(_0x1b6b74){_0x304026=_[_0x8c2e('0x9d')](_0x1b6b74,'id');_0x6df6c2=_['merge'](_0x6df6c2,{'model':db[_0x8c2e('0x39')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5a2117[_0x8c2e('0x40')][_0x8c2e('0x43')]){_0x2d31c0[_0x8c2e('0x44')][_0x8c2e('0x35')](function(_0x25d0eb){_0x4cea7b[_0x8c2e('0x4d')]('i.'+_0x25d0eb);});}else{_0x4cea7b['field'](_0x8c2e('0x8f'),_0x8c2e('0x9e'));_0x4cea7b[_0x8c2e('0x4d')](_0x8c2e('0x9f'),'Account.key');_0x4cea7b[_0x8c2e('0x4d')](_0x8c2e('0xa0'),_0x8c2e('0xa1'));_0x4cea7b[_0x8c2e('0x4d')](_0x8c2e('0xa2'),_0x8c2e('0x90'));_0x4cea7b[_0x8c2e('0x4d')](_0x8c2e('0xa3'));_0x4cea7b['field'](_0x8c2e('0xa4'),_0x8c2e('0xa5'));_0x4cea7b[_0x8c2e('0x4d')](_0x8c2e('0xa6'),_0x8c2e('0xa7'));_0x4cea7b[_0x8c2e('0x4d')](_0x8c2e('0xa8'),'Contact.email');_0x4cea7b[_0x8c2e('0x4d')]('c.phone',_0x8c2e('0xa9'));_0x4cea7b[_0x8c2e('0x4d')](_0x8c2e('0xaa'),_0x8c2e('0xab'));_0x4cea7b[_0x8c2e('0x4d')](_0x8c2e('0xac'),'Contact.fax');_0x4cea7b[_0x8c2e('0x4d')](_0x8c2e('0xad'),'Owner.fullname');_0x4cea7b[_0x8c2e('0x4d')](_0x8c2e('0xae'),_0x8c2e('0xaf'));_0x4cea7b['field']('GROUP_CONCAT(DISTINCT\x20t.id)',_0x8c2e('0x32'));}if(_0x2d31c0['limit'])_0x4cea7b[_0x8c2e('0x24')](_0x2d31c0[_0x8c2e('0x24')]);if(_0x2d31c0[_0x8c2e('0x21')])_0x4cea7b['offset'](_0x2d31c0['offset']);return db[_0x8c2e('0x9b')][_0x8c2e('0x40')](_0x4cea7b['toString'](),_0x6df6c2);})[_0x8c2e('0x2a')](function(_0x186d1d){if(_0x186d1d[_0x8c2e('0x45')]>0x0)_0x1eb3c0[_0x8c2e('0x49')]('ui.FaxInteractionId\x20IN\x20?',_[_0x8c2e('0x30')](_0x186d1d,'id'));return db[_0x8c2e('0x9b')][_0x8c2e('0x40')](_0x1eb3c0[_0x8c2e('0x9c')](),_0x6df6c2)[_0x8c2e('0x2a')](function(_0x4bfa03){var _0x486297=_['groupBy'](_0x4bfa03,_0x8c2e('0xb0'));var _0x1787a0=[];_0x186d1d[_0x8c2e('0x35')](function(_0x22a12e){_0x1787a0[_0x8c2e('0x36')](updateFaxInteraction(_0x22a12e,_0x304026,_0x486297));});return BPromise[_0x8c2e('0xb1')](_0x1787a0);});});})[_0x8c2e('0x2a')](function(_0x32cbd0){_0x1967ef[_0x8c2e('0xb2')]=_0x32cbd0;return _0x1967ef;})[_0x8c2e('0x2a')](respondWithFilteredResult(_0x4c44f8,_0x2d31c0))[_0x8c2e('0x37')](handleError(_0x4c44f8,null));};exports[_0x8c2e('0xb3')]=function(_0xb03438,_0x2fc6f0){var _0x34d71f={'raw':![],'where':{'id':_0xb03438[_0x8c2e('0xb4')]['id']}},_0x85b09b={};_0x85b09b['model']=_[_0x8c2e('0x41')](db[_0x8c2e('0x39')][_0x8c2e('0x3a')]);_0x85b09b[_0x8c2e('0x40')]=_[_0x8c2e('0x41')](_0xb03438[_0x8c2e('0x40')]);_0x85b09b[_0x8c2e('0x4b')]=_[_0x8c2e('0x42')](_0x85b09b[_0x8c2e('0x3e')],_0x85b09b[_0x8c2e('0x40')]);_0x34d71f[_0x8c2e('0x44')]=_[_0x8c2e('0x42')](_0x85b09b[_0x8c2e('0x3e')],qs[_0x8c2e('0x43')](_0xb03438['query'][_0x8c2e('0x43')]));_0x34d71f[_0x8c2e('0x44')]=_0x34d71f[_0x8c2e('0x44')]['length']?_0x34d71f[_0x8c2e('0x44')]:_0x85b09b[_0x8c2e('0x3e')];if(_0xb03438[_0x8c2e('0x40')][_0x8c2e('0xb5')]){_0x34d71f['include']=[{'all':!![]}];}_0x34d71f=_[_0x8c2e('0xb6')]({},_0x34d71f,_0xb03438['options']);return db[_0x8c2e('0x39')][_0x8c2e('0x61')](_0x34d71f)[_0x8c2e('0x2a')](handleEntityNotFound(_0x2fc6f0,null))[_0x8c2e('0x2a')](respondWithResult(_0x2fc6f0,null))['catch'](handleError(_0x2fc6f0,null));};exports['create']=function(_0x520e7d,_0x5a3eb3){return db['FaxInteraction'][_0x8c2e('0xb7')](_0x520e7d[_0x8c2e('0xb8')],{})[_0x8c2e('0x2a')](respondWithResult(_0x5a3eb3,0xc9))[_0x8c2e('0x37')](handleError(_0x5a3eb3,null));};exports[_0x8c2e('0x29')]=function(_0x230be9,_0x208bb6){if(_0x230be9[_0x8c2e('0xb8')]['id']){delete _0x230be9['body']['id'];}return db['FaxInteraction'][_0x8c2e('0x61')]({'where':{'id':_0x230be9[_0x8c2e('0xb4')]['id']}})[_0x8c2e('0x2a')](handleEntityNotFound(_0x208bb6,null))[_0x8c2e('0x2a')](saveUpdates(_0x230be9['body'],null))[_0x8c2e('0x2a')](respondWithResult(_0x208bb6,null))['catch'](handleError(_0x208bb6,null));};exports['destroy']=function(_0x486d0f,_0x47d24b){return db[_0x8c2e('0x39')][_0x8c2e('0x61')]({'where':{'id':_0x486d0f['params']['id']}})['then'](handleEntityNotFound(_0x47d24b,null))[_0x8c2e('0x2a')](removeEntity(_0x47d24b,null))[_0x8c2e('0x37')](handleError(_0x47d24b,null));};exports[_0x8c2e('0xb9')]=function(_0x394809,_0x4d6b79){return db[_0x8c2e('0x39')][_0x8c2e('0xb9')]()['then'](respondWithResult(_0x4d6b79,null))[_0x8c2e('0x37')](handleError(_0x4d6b79,null));};exports[_0x8c2e('0xba')]=function(_0x23756f,_0x568012,_0x543443){return db['FaxMessage'][_0x8c2e('0x61')]({'where':{'id':_0x23756f[_0x8c2e('0xb4')]['id']}})[_0x8c2e('0x2a')](handleEntityNotFound(_0x568012,null))[_0x8c2e('0x2a')](function(_0x2add04){if(_0x2add04){return _0x2add04['addMessage'](_0x23756f[_0x8c2e('0xb8')][_0x8c2e('0xbb')],_[_0x8c2e('0xbc')](_0x23756f[_0x8c2e('0xb8')],[_0x8c2e('0xbb'),'id'])||{});}})[_0x8c2e('0x2a')](respondWithResult(_0x568012,null))[_0x8c2e('0x37')](handleError(_0x568012,null));};exports[_0x8c2e('0xbd')]=function(_0x3cfefa,_0x264552,_0x4e5760){var _0x1ed43c={'raw':![],'where':{}};var _0x52383c={};var _0x2bed00={'count':0x0,'rows':[]};return db[_0x8c2e('0x39')][_0x8c2e('0xbe')]({'where':{'id':_0x3cfefa[_0x8c2e('0xb4')]['id']}})['then'](handleEntityNotFound(_0x264552,null))['then'](function(_0x20ff1e){if(_0x20ff1e){_0x52383c[_0x8c2e('0x3e')]=_[_0x8c2e('0x41')](db[_0x8c2e('0xbf')][_0x8c2e('0x3a')]);_0x52383c['query']=_[_0x8c2e('0x41')](_0x3cfefa[_0x8c2e('0x40')]);_0x52383c[_0x8c2e('0x4b')]=_[_0x8c2e('0x42')](_0x52383c['model'],_0x52383c[_0x8c2e('0x40')]);_0x1ed43c['attributes']=_[_0x8c2e('0x42')](_0x52383c[_0x8c2e('0x3e')],qs[_0x8c2e('0x43')](_0x3cfefa[_0x8c2e('0x40')][_0x8c2e('0x43')]));_0x1ed43c[_0x8c2e('0x44')]=_0x1ed43c[_0x8c2e('0x44')][_0x8c2e('0x45')]?_0x1ed43c[_0x8c2e('0x44')]:_0x52383c[_0x8c2e('0x3e')];if(!_0x3cfefa['query']['hasOwnProperty'](_0x8c2e('0xc0'))){_0x1ed43c[_0x8c2e('0x24')]=qs[_0x8c2e('0x24')](_0x3cfefa['query'][_0x8c2e('0x24')]);_0x1ed43c['offset']=qs[_0x8c2e('0x21')](_0x3cfefa['query']['offset']);}_0x1ed43c['order']=qs[_0x8c2e('0x48')](_0x3cfefa[_0x8c2e('0x40')][_0x8c2e('0x48')]);_0x1ed43c[_0x8c2e('0x49')]=qs[_0x8c2e('0x4b')](_['pick'](_0x3cfefa[_0x8c2e('0x40')],_0x52383c[_0x8c2e('0x4b')]));_0x1ed43c['where'][_0x8c2e('0xb0')]=_0x20ff1e['id'];if(_0x3cfefa['query'][_0x8c2e('0x84')]){_0x1ed43c[_0x8c2e('0x49')]=_[_0x8c2e('0xb6')](_0x1ed43c[_0x8c2e('0x49')],{'$or':_[_0x8c2e('0x30')](_0x1ed43c[_0x8c2e('0x44')],function(_0x39679a){var _0x40fed4={};_0x40fed4[_0x39679a]={'$like':'%'+_0x3cfefa[_0x8c2e('0x40')]['filter']+'%'};return _0x40fed4;})});}if(_0x3cfefa[_0x8c2e('0x40')][_0x8c2e('0x7c')]){var _0x184a60=_0x3cfefa[_0x8c2e('0x40')][_0x8c2e('0x7c')][_0x8c2e('0x34')](',');var _0x4dedd2={};_0x4dedd2[_0x184a60[0x0]]={'$gte':moment(_0x184a60[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x1ed43c['where']=_[_0x8c2e('0xb6')](_0x1ed43c[_0x8c2e('0x49')],_0x4dedd2);}_0x1ed43c=_[_0x8c2e('0xb6')]({},_0x1ed43c,_0x3cfefa[_0x8c2e('0xc1')]);return db[_0x8c2e('0xbf')][_0x8c2e('0x23')]({'where':_0x1ed43c[_0x8c2e('0x49')]})[_0x8c2e('0x2a')](function(_0x345b68){_0x2bed00[_0x8c2e('0x23')]=_0x345b68;if(_0x3cfefa['query'][_0x8c2e('0xb5')]){_0x1ed43c[_0x8c2e('0xc2')]=[{'all':!![]}];}return db[_0x8c2e('0xbf')][_0x8c2e('0xc3')](_0x1ed43c);})[_0x8c2e('0x2a')](function(_0x551470){_0x2bed00[_0x8c2e('0xb2')]=_0x551470;return _0x2bed00;});}})[_0x8c2e('0x2a')](respondWithFilteredResult(_0x264552,_0x1ed43c))[_0x8c2e('0x37')](handleError(_0x264552,null));};exports[_0x8c2e('0xc4')]=function(_0x573ec8,_0x305262,_0x344b1d){return db[_0x8c2e('0x39')][_0x8c2e('0x61')]({'where':{'id':_0x573ec8['params']['id']}})[_0x8c2e('0x2a')](handleEntityNotFound(_0x305262,null))['then'](function(_0x1b5427){if(_0x1b5427){return _0x1b5427[_0x8c2e('0xc5')](_0x573ec8[_0x8c2e('0xb8')][_0x8c2e('0xbb')],_[_0x8c2e('0xbc')](_0x573ec8[_0x8c2e('0xb8')],[_0x8c2e('0xbb'),'id'])||{})['spread'](function(){return db[_0x8c2e('0x6f')]['findAll']({'attributes':['id','name',_0x8c2e('0x4e')],'where':{'id':_0x573ec8[_0x8c2e('0xb8')]['ids']}});})[_0x8c2e('0x2a')](function(_0x3b7e8f){socket[_0x8c2e('0xc6')]('faxInteractionTags:save',{'id':Number(_0x573ec8['params']['id']),'tags':_0x3b7e8f||[]});return{'id':Number(_0x573ec8[_0x8c2e('0xb4')]['id']),'tags':_0x3b7e8f||[]};});}})[_0x8c2e('0x2a')](respondWithResult(_0x305262,null))[_0x8c2e('0x37')](handleError(_0x305262,null));};exports[_0x8c2e('0xc7')]=function(_0x19b355,_0x45359a,_0x31b8e1){return db[_0x8c2e('0x39')][_0x8c2e('0x61')]({'where':{'id':_0x19b355[_0x8c2e('0xb4')]['id']}})[_0x8c2e('0x2a')](handleEntityNotFound(_0x45359a,null))['then'](function(_0x159b09){if(_0x159b09){return _0x159b09[_0x8c2e('0xc7')](_0x19b355[_0x8c2e('0x40')]['ids']);}})[_0x8c2e('0x2a')](respondWithStatusCode(_0x45359a,null))[_0x8c2e('0x37')](handleError(_0x45359a,null));};exports[_0x8c2e('0xc8')]=function(_0x48f98f,_0x2f728a){var _0x514cea=moment()[_0x8c2e('0xc9')]()[_0x8c2e('0x9c')]();var _0x13ee72=path[_0x8c2e('0xca')](config[_0x8c2e('0xcb')],_0x8c2e('0xcc'),_0x8c2e('0xcd'),_0x8c2e('0xce'));var _0x59f042=path[_0x8c2e('0xca')](config['root'],_0x8c2e('0xcc'),_0x8c2e('0xcd'),_0x8c2e('0xcf'));var _0x281337=path['join'](_0x13ee72,_0x514cea);var _0x1b060d=util['format'](_0x8c2e('0xd0'),_0x48f98f[_0x8c2e('0xb4')]['id'],_0x514cea);var _0x165016=path[_0x8c2e('0xca')](_0x13ee72,_0x1b060d);var _0x4be5cc=[];_0x4be5cc[_0x8c2e('0x36')]({'model':db[_0x8c2e('0xd1')],'as':_0x8c2e('0xd1'),'raw':!![]});var _0x151e53=[{'model':db[_0x8c2e('0xbf')],'as':_0x8c2e('0xd2'),'attributes':['id',_0x8c2e('0xb8'),_0x8c2e('0x7a')],'include':_0x4be5cc}];return db[_0x8c2e('0x39')][_0x8c2e('0x61')]({'where':{'id':_0x48f98f[_0x8c2e('0xb4')]['id']},'include':_0x151e53})[_0x8c2e('0x2a')](handleEntityNotFound(_0x2f728a,null))['then'](function(_0x259215){if(_0x259215&&_0x259215['Messages']){var _0x15040a=_0x259215[_0x8c2e('0xd3')]({'plain':!![]});fs['mkdirSync'](_0x281337);for(var _0x5e7c2c=0x0;_0x5e7c2c<_0x15040a[_0x8c2e('0xd2')]['length'];_0x5e7c2c++){var _0x44a236=_0x15040a[_0x8c2e('0xd2')][_0x5e7c2c][_0x8c2e('0xd1')];if(_0x44a236){var _0x30e300=path['join'](_0x59f042,_0x44a236[_0x8c2e('0xd4')]);if(fs['existsSync'](_0x30e300)){fs[_0x8c2e('0xd5')](_0x30e300)['pipe'](fs['createWriteStream'](path['join'](_0x281337,_0x44a236[_0x8c2e('0xd4')])));}}}return BPromise[_0x8c2e('0x93')]()['then'](function(){return new BPromise(function(_0x4f220,_0x39a9f9){zipdir(_0x281337,{'saveTo':_0x165016},function(_0x137dca,_0x2d0803){if(_0x137dca)return _0x39a9f9(_0x137dca);return _0x4f220(_0x2d0803);});})[_0x8c2e('0x2a')](function(){return new BPromise(function(_0x153f3f,_0x5e7a6e){rimraf(_0x281337,function(_0x50af1f){if(_0x50af1f)_0x5e7a6e(_0x50af1f);return _0x153f3f();});});})[_0x8c2e('0x2a')](function(){return _0x2f728a['download'](_0x165016,_0x1b060d,function(_0x391d3d){if(_0x391d3d){console[_0x8c2e('0xd6')](_0x8c2e('0xd7'),_0x391d3d);}else{fs[_0x8c2e('0xd8')](_0x165016);}});});});}else{return _0x2f728a['sendStatus'](0xc8);}})[_0x8c2e('0x37')](handleError(_0x2f728a,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index 276e908..70b8363 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 _0x01ec=['map','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','FaxInteraction','../../mysqldb','FaxMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x01ec,0x15e));var _0xc01e=function(_0x30296b,_0x5b94bb){_0x30296b=_0x30296b-0x0;var _0x4fb5fc=_0x01ec[_0x30296b];return _0x4fb5fc;};'use strict';var EventEmitter=require(_0xc01e('0x0'));var FaxInteraction=require('../../mysqldb')['db'][_0xc01e('0x1')];var FaxMessage=require(_0xc01e('0x2'))['db'][_0xc01e('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xc01e('0x4')](0x0);var events={'afterCreate':_0xc01e('0x5'),'afterUpdate':_0xc01e('0x6'),'afterDestroy':_0xc01e('0x7')};function emitEvent(_0x96c17a){return function(_0x48363f,_0x5f33a0,_0x41413d){_0x48363f[_0xc01e('0x8')]({'attributes':['id'],'raw':!![]})[_0xc01e('0x9')](function(_0x28ceb1){_0x48363f[_0xc01e('0xa')]('Users',_0x28ceb1[_0xc01e('0xb')](function(_0x5b4bb0){return{'id':_0x5b4bb0['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0x48363f['id'],'direction':'in','read':![]},'raw':!![]});})[_0xc01e('0x9')](function(_0x318dde){_0x48363f[_0xc01e('0xa')](_0xc01e('0xc'),_0x318dde[_0xc01e('0xd')]);FaxInteractionEvents['emit'](_0x96c17a+':'+_0x48363f['id'],_0x48363f);FaxInteractionEvents[_0xc01e('0xe')](_0x96c17a,_0x48363f);_0x41413d(null);})[_0xc01e('0xf')](_0x41413d(null));};}for(var e in events){if(events[_0xc01e('0x10')](e)){var event=events[e];FaxInteraction[_0xc01e('0x11')](e,emitEvent(event));}}module[_0xc01e('0x12')]=FaxInteractionEvents; \ No newline at end of file +var _0x362f=['../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','update','remove','getUsers','then','setDataValue','Users','map','length','emit','catch','hasOwnProperty','exports','events'];(function(_0x70bb8,_0x1da278){var _0x48ba84=function(_0xb567b9){while(--_0xb567b9){_0x70bb8['push'](_0x70bb8['shift']());}};_0x48ba84(++_0x1da278);}(_0x362f,0x1db));var _0xf362=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0x362f[_0x5bd426];return _0x23a7eb;};'use strict';var EventEmitter=require(_0xf362('0x0'));var FaxInteraction=require(_0xf362('0x1'))['db'][_0xf362('0x2')];var FaxMessage=require(_0xf362('0x1'))['db'][_0xf362('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xf362('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0xf362('0x5'),'afterDestroy':_0xf362('0x6')};function emitEvent(_0x4ae82c){return function(_0x41daff,_0x3a449e,_0x323cca){_0x41daff[_0xf362('0x7')]({'attributes':['id'],'raw':!![]})[_0xf362('0x8')](function(_0x16e540){_0x41daff[_0xf362('0x9')](_0xf362('0xa'),_0x16e540[_0xf362('0xb')](function(_0x5ed4bb){return{'id':_0x5ed4bb['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0x41daff['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x1a61ec){_0x41daff[_0xf362('0x9')]('unreadMessages',_0x1a61ec[_0xf362('0xc')]);FaxInteractionEvents[_0xf362('0xd')](_0x4ae82c+':'+_0x41daff['id'],_0x41daff);FaxInteractionEvents[_0xf362('0xd')](_0x4ae82c,_0x41daff);_0x323cca(null);})[_0xf362('0xe')](_0x323cca(null));};}for(var e in events){if(events[_0xf362('0xf')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0xf362('0x10')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index 794b295..fea84a3 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 _0xfea2=['FaxInteraction','fax_interactions','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxInteraction.attributes'];(function(_0x1f469a,_0x31b04a){var _0x9aa0d8=function(_0x2d84e7){while(--_0x2d84e7){_0x1f469a['push'](_0x1f469a['shift']());}};_0x9aa0d8(++_0x31b04a);}(_0xfea2,0x156));var _0x2fea=function(_0x16fe4c,_0x2421e8){_0x16fe4c=_0x16fe4c-0x0;var _0x9999d=_0xfea2[_0x16fe4c];return _0x9999d;};'use strict';var _=require(_0x2fea('0x0'));var util=require(_0x2fea('0x1'));var logger=require(_0x2fea('0x2'))('api');var moment=require(_0x2fea('0x3'));var BPromise=require(_0x2fea('0x4'));var rp=require(_0x2fea('0x5'));var fs=require('fs');var path=require(_0x2fea('0x6'));var rimraf=require(_0x2fea('0x7'));var config=require(_0x2fea('0x8'));var attributes=require(_0x2fea('0x9'));module['exports']=function(_0x2d0a27,_0x143418){return _0x2d0a27['define'](_0x2fea('0xa'),attributes,{'tableName':_0x2fea('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x44f587,_0x257adc,_0x14f962){if(_0x44f587[_0x2fea('0xc')](_0x2fea('0xd'))){_0x44f587[_0x2fea('0xe')]=moment()['format'](_0x2fea('0xf'));}_0x14f962(null,_0x44f587);}}});}; \ No newline at end of file +var _0x498d=['path','../../config/environment','./faxInteraction.attributes','exports','FaxInteraction','fax_interactions','changed','closed','closedAt','util','api','moment','bluebird','request-promise'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0x498d,0x191));var _0xd498=function(_0x25c326,_0x250137){_0x25c326=_0x25c326-0x0;var _0x762452=_0x498d[_0x25c326];return _0x762452;};'use strict';var _=require('lodash');var util=require(_0xd498('0x0'));var logger=require('../../config/logger')(_0xd498('0x1'));var moment=require(_0xd498('0x2'));var BPromise=require(_0xd498('0x3'));var rp=require(_0xd498('0x4'));var fs=require('fs');var path=require(_0xd498('0x5'));var rimraf=require('rimraf');var config=require(_0xd498('0x6'));var attributes=require(_0xd498('0x7'));module[_0xd498('0x8')]=function(_0x274007,_0x25741a){return _0x274007['define'](_0xd498('0x9'),attributes,{'tableName':_0xd498('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x48aa3e,_0x5cf39e,_0x1a0c68){if(_0x48aa3e[_0xd498('0xb')](_0xd498('0xc'))){_0x48aa3e[_0xd498('0xd')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x1a0c68(null,_0x48aa3e);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index caa660c..880127c 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 _0x4062=['client','redis','localhost','socket.io-emitter','./faxInteraction.socket','register','request','request\x20sent','FaxInteraction,\x20%s,\x20%s,\x20%s','code','error','FaxInteraction,\x20%s,\x20%s','message','info','result','catch','update','options','raw','where','limit','UpdateFaxInteraction','debug','stringify','AddTagsToFaxInteraction','FaxInteraction','find','then','body','ids','omit','spread','AddTags','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x4062,0x14e));var _0x2406=function(_0x39d088,_0x18b31d){_0x39d088=_0x39d088-0x0;var _0x5948d6=_0x4062[_0x39d088];return _0x5948d6;};'use strict';var _=require(_0x2406('0x0'));var util=require(_0x2406('0x1'));var moment=require(_0x2406('0x2'));var BPromise=require(_0x2406('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2406('0x4'));var db=require(_0x2406('0x5'))['db'];var utils=require(_0x2406('0x6'));var logger=require(_0x2406('0x7'))('rpc');var config=require(_0x2406('0x8'));var jayson=require(_0x2406('0x9'));var client=jayson[_0x2406('0xa')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x2406('0xb')],{'host':_0x2406('0xc'),'port':0x18eb});var socket=require(_0x2406('0xd'))(new Redis(config[_0x2406('0xb')]));require(_0x2406('0xe'))[_0x2406('0xf')](socket);function respondWithRpcPromise(_0x3df9f5,_0x21ddb9,_0x34645a){return new BPromise(function(_0x342e3c,_0x301271){return client[_0x2406('0x10')](_0x3df9f5,_0x34645a)['then'](function(_0x24a003){logger['info']('FaxInteraction,\x20%s,\x20%s',_0x21ddb9,_0x2406('0x11'));logger['debug'](_0x2406('0x12'),_0x21ddb9,_0x2406('0x11'),JSON['stringify'](_0x24a003));if(_0x24a003['error']){if(_0x24a003['error'][_0x2406('0x13')]===0x1f4){logger[_0x2406('0x14')](_0x2406('0x15'),_0x21ddb9,_0x24a003[_0x2406('0x14')][_0x2406('0x16')]);return _0x301271(_0x24a003[_0x2406('0x14')][_0x2406('0x16')]);}logger['error'](_0x2406('0x15'),_0x21ddb9,_0x24a003[_0x2406('0x14')]['message']);return _0x342e3c(_0x24a003[_0x2406('0x14')]['message']);}else{logger[_0x2406('0x17')]('FaxInteraction,\x20%s,\x20%s',_0x21ddb9,'request\x20sent');_0x342e3c(_0x24a003[_0x2406('0x18')]['message']);}})[_0x2406('0x19')](function(_0x162766){logger[_0x2406('0x14')](_0x2406('0x15'),_0x21ddb9,_0x162766);_0x301271(_0x162766);});});}exports['UpdateFaxInteraction']=function(_0x2c4536){var _0xfc4d00=this;return new Promise(function(_0x2d6945,_0x5b9932){return db['FaxInteraction'][_0x2406('0x1a')](_0x2c4536['body'],{'raw':_0x2c4536[_0x2406('0x1b')]?_0x2c4536[_0x2406('0x1b')][_0x2406('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2c4536[_0x2406('0x1b')]?_0x2c4536[_0x2406('0x1b')][_0x2406('0x1d')]||null:null,'attributes':_0x2c4536[_0x2406('0x1b')]?_0x2c4536[_0x2406('0x1b')]['attributes']||null:null,'limit':_0x2c4536[_0x2406('0x1b')]?_0x2c4536[_0x2406('0x1b')][_0x2406('0x1e')]||null:null})['then'](function(_0x53b2cf){logger['info'](_0x2406('0x1f'),_0x2c4536);logger[_0x2406('0x20')](_0x2406('0x1f'),_0x2c4536,JSON[_0x2406('0x21')](_0x53b2cf));_0x2d6945(_0x53b2cf);})[_0x2406('0x19')](function(_0xf8c3d2){logger['error']('UpdateFaxInteraction',_0xf8c3d2[_0x2406('0x16')],_0x2c4536);_0x5b9932(_0xfc4d00[_0x2406('0x14')](0x1f4,_0xf8c3d2[_0x2406('0x16')]));});});};exports[_0x2406('0x22')]=function(_0x3389fe){return new Promise(function(_0x404aa8,_0x5ee09f){return db[_0x2406('0x23')][_0x2406('0x24')]({'where':_0x3389fe['options']?_0x3389fe[_0x2406('0x1b')][_0x2406('0x1d')]||null:null})[_0x2406('0x25')](function(_0x2b2f3f){if(_0x2b2f3f){return _0x2b2f3f['addTags'](_0x3389fe[_0x2406('0x26')][_0x2406('0x27')],_[_0x2406('0x28')](_0x3389fe[_0x2406('0x26')],[_0x2406('0x27'),'id'])||{});}})[_0x2406('0x29')](function(_0x139667){logger[_0x2406('0x17')](_0x2406('0x2a'),_0x3389fe);logger['debug'](_0x2406('0x2a'),_0x3389fe,JSON[_0x2406('0x21')](_0x139667));_0x404aa8(_0x139667);})['catch'](function(_0x5963f2){logger[_0x2406('0x14')](_0x2406('0x2a'),_0x5963f2[_0x2406('0x16')],_0x3389fe);_0x5ee09f(_this[_0x2406('0x14')](0x1f4,_0x5963f2[_0x2406('0x16')]));});});}; \ No newline at end of file +var _0xd067=['options','raw','attributes','limit','AddTagsToFaxInteraction','where','addTags','ids','spread','AddTags','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','FaxInteraction,\x20%s,\x20%s','message','result','UpdateFaxInteraction','FaxInteraction','update','body'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xd067,0x14b));var _0x7d06=function(_0x2420c8,_0x59cdcc){_0x2420c8=_0x2420c8-0x0;var _0x46e13d=_0xd067[_0x2420c8];return _0x46e13d;};'use strict';var _=require(_0x7d06('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x7d06('0x1'));var rs=require(_0x7d06('0x2'));var fs=require('fs');var Redis=require(_0x7d06('0x3'));var db=require(_0x7d06('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x7d06('0x5'))('rpc');var config=require(_0x7d06('0x6'));var jayson=require(_0x7d06('0x7'));var client=jayson['client'][_0x7d06('0x8')]({'port':0x232a});config[_0x7d06('0x9')]=_[_0x7d06('0xa')](config[_0x7d06('0x9')],{'host':_0x7d06('0xb'),'port':0x18eb});var socket=require(_0x7d06('0xc'))(new Redis(config[_0x7d06('0x9')]));require('./faxInteraction.socket')[_0x7d06('0xd')](socket);function respondWithRpcPromise(_0x3940b0,_0xbe2494,_0x1763a4){return new BPromise(function(_0x590269,_0x239521){return client[_0x7d06('0xe')](_0x3940b0,_0x1763a4)[_0x7d06('0xf')](function(_0x205a5c){logger[_0x7d06('0x10')]('FaxInteraction,\x20%s,\x20%s',_0xbe2494,_0x7d06('0x11'));logger[_0x7d06('0x12')](_0x7d06('0x13'),_0xbe2494,_0x7d06('0x11'),JSON[_0x7d06('0x14')](_0x205a5c));if(_0x205a5c[_0x7d06('0x15')]){if(_0x205a5c[_0x7d06('0x15')]['code']===0x1f4){logger[_0x7d06('0x15')](_0x7d06('0x16'),_0xbe2494,_0x205a5c[_0x7d06('0x15')][_0x7d06('0x17')]);return _0x239521(_0x205a5c[_0x7d06('0x15')][_0x7d06('0x17')]);}logger[_0x7d06('0x15')](_0x7d06('0x16'),_0xbe2494,_0x205a5c[_0x7d06('0x15')]['message']);return _0x590269(_0x205a5c[_0x7d06('0x15')]['message']);}else{logger['info'](_0x7d06('0x16'),_0xbe2494,_0x7d06('0x11'));_0x590269(_0x205a5c[_0x7d06('0x18')][_0x7d06('0x17')]);}})['catch'](function(_0x23a410){logger[_0x7d06('0x15')](_0x7d06('0x16'),_0xbe2494,_0x23a410);_0x239521(_0x23a410);});});}exports[_0x7d06('0x19')]=function(_0x130fee){var _0x4034ee=this;return new Promise(function(_0x41d58e,_0x536f66){return db[_0x7d06('0x1a')][_0x7d06('0x1b')](_0x130fee[_0x7d06('0x1c')],{'raw':_0x130fee[_0x7d06('0x1d')]?_0x130fee[_0x7d06('0x1d')][_0x7d06('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x130fee['options']?_0x130fee['options']['where']||null:null,'attributes':_0x130fee['options']?_0x130fee[_0x7d06('0x1d')][_0x7d06('0x1f')]||null:null,'limit':_0x130fee[_0x7d06('0x1d')]?_0x130fee[_0x7d06('0x1d')][_0x7d06('0x20')]||null:null})['then'](function(_0x5cf601){logger[_0x7d06('0x10')](_0x7d06('0x19'),_0x130fee);logger[_0x7d06('0x12')](_0x7d06('0x19'),_0x130fee,JSON[_0x7d06('0x14')](_0x5cf601));_0x41d58e(_0x5cf601);})['catch'](function(_0x35e689){logger[_0x7d06('0x15')](_0x7d06('0x19'),_0x35e689[_0x7d06('0x17')],_0x130fee);_0x536f66(_0x4034ee['error'](0x1f4,_0x35e689[_0x7d06('0x17')]));});});};exports[_0x7d06('0x21')]=function(_0x10c4b3){return new Promise(function(_0x96d611,_0x294d36){return db[_0x7d06('0x1a')]['find']({'where':_0x10c4b3[_0x7d06('0x1d')]?_0x10c4b3[_0x7d06('0x1d')][_0x7d06('0x22')]||null:null})[_0x7d06('0xf')](function(_0x85bdc6){if(_0x85bdc6){return _0x85bdc6[_0x7d06('0x23')](_0x10c4b3[_0x7d06('0x1c')][_0x7d06('0x24')],_['omit'](_0x10c4b3[_0x7d06('0x1c')],[_0x7d06('0x24'),'id'])||{});}})[_0x7d06('0x25')](function(_0x344122){logger[_0x7d06('0x10')](_0x7d06('0x26'),_0x10c4b3);logger[_0x7d06('0x12')](_0x7d06('0x26'),_0x10c4b3,JSON[_0x7d06('0x14')](_0x344122));_0x96d611(_0x344122);})[_0x7d06('0x27')](function(_0x902397){logger[_0x7d06('0x15')](_0x7d06('0x26'),_0x902397[_0x7d06('0x17')],_0x10c4b3);_0x294d36(_this[_0x7d06('0x15')](0x1f4,_0x902397['message']));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index 2029765..131da4a 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 _0xd3e2=['remove','emit','removeListener','register','length','./faxInteraction.events'];(function(_0x37fbb5,_0x2fdd12){var _0x31a15e=function(_0x51afec){while(--_0x51afec){_0x37fbb5['push'](_0x37fbb5['shift']());}};_0x31a15e(++_0x2fdd12);}(_0xd3e2,0x161));var _0x2d3e=function(_0x54f946,_0x303a94){_0x54f946=_0x54f946-0x0;var _0x476256=_0xd3e2[_0x54f946];return _0x476256;};'use strict';var FaxInteractionEvents=require(_0x2d3e('0x0'));var events=['save',_0x2d3e('0x1'),'update'];function createListener(_0x4dbbf1,_0x5e1c2f){return function(_0x2ffb7d){_0x5e1c2f[_0x2d3e('0x2')](_0x4dbbf1,_0x2ffb7d);};}function removeListener(_0x219720,_0x2200dd){return function(){FaxInteractionEvents[_0x2d3e('0x3')](_0x219720,_0x2200dd);};}exports[_0x2d3e('0x4')]=function(_0x4ee5fd){for(var _0x30b167=0x0,_0x5b4a16=events[_0x2d3e('0x5')];_0x30b167<_0x5b4a16;_0x30b167++){var _0x11b97a=events[_0x30b167];var _0xd671ba=createListener('faxInteraction:'+_0x11b97a,_0x4ee5fd);FaxInteractionEvents['on'](_0x11b97a,_0xd671ba);}}; \ No newline at end of file +var _0xaf32=['./faxInteraction.events','save','remove','update','emit','length'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0xaf32,0xc6));var _0x2af3=function(_0x2fdbf8,_0x461a51){_0x2fdbf8=_0x2fdbf8-0x0;var _0x5dc976=_0xaf32[_0x2fdbf8];return _0x5dc976;};'use strict';var FaxInteractionEvents=require(_0x2af3('0x0'));var events=[_0x2af3('0x1'),_0x2af3('0x2'),_0x2af3('0x3')];function createListener(_0x24f3bf,_0x199e5e){return function(_0x423af8){_0x199e5e[_0x2af3('0x4')](_0x24f3bf,_0x423af8);};}function removeListener(_0x503ed1,_0x3750f6){return function(){FaxInteractionEvents['removeListener'](_0x503ed1,_0x3750f6);};}exports['register']=function(_0x2bbe1c){for(var _0x3c623b=0x0,_0x397a27=events[_0x2af3('0x5')];_0x3c623b<_0x397a27;_0x3c623b++){var _0x5b9f2c=events[_0x3c623b];var _0x116d7f=createListener('faxInteraction:'+_0x5b9f2c,_0x2bbe1c);FaxInteractionEvents['on'](_0x5b9f2c,_0x116d7f);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index 29bff0c..ebaf7c3 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 _0x0a0c=['isAuthenticated','get','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','faxinteraction:addtags','addTags','fax','faxinteraction:update','update','faxinteraction:destroy','destroy','delete','removeTags','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./faxInteraction.controller'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x0a0c,0x7c));var _0xc0a0=function(_0x1a6c1e,_0x112fbe){_0x1a6c1e=_0x1a6c1e-0x0;var _0x5853e9=_0x0a0c[_0x1a6c1e];return _0x5853e9;};'use strict';var multer=require(_0xc0a0('0x0'));var util=require(_0xc0a0('0x1'));var path=require(_0xc0a0('0x2'));var timeout=require(_0xc0a0('0x3'));var express=require('express');var router=express[_0xc0a0('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xc0a0('0x5'));var config=require(_0xc0a0('0x6'));var controller=require(_0xc0a0('0x7'));router['get']('/',auth[_0xc0a0('0x8')](),controller['index']);router[_0xc0a0('0x9')](_0xc0a0('0xa'),auth[_0xc0a0('0x8')](),controller[_0xc0a0('0xb')]);router[_0xc0a0('0x9')](_0xc0a0('0xc'),auth[_0xc0a0('0x8')](),controller[_0xc0a0('0xd')]);router['get'](_0xc0a0('0xe'),auth[_0xc0a0('0x8')](),controller[_0xc0a0('0xf')]);router[_0xc0a0('0x9')](_0xc0a0('0x10'),auth[_0xc0a0('0x8')](),controller[_0xc0a0('0x11')]);router[_0xc0a0('0x12')]('/',auth['isAuthenticated'](),controller[_0xc0a0('0x13')]);router[_0xc0a0('0x12')](_0xc0a0('0xe'),auth[_0xc0a0('0x8')](),controller[_0xc0a0('0x14')]);router[_0xc0a0('0x12')](_0xc0a0('0x15'),auth[_0xc0a0('0x8')](),interaction[_0xc0a0('0x16')]('fax',_0xc0a0('0x17')),controller[_0xc0a0('0x18')]);router['put']('/:id',auth[_0xc0a0('0x8')](),interaction['tracked'](_0xc0a0('0x19'),_0xc0a0('0x1a')),controller[_0xc0a0('0x1b')]);router['delete']('/:id',auth[_0xc0a0('0x8')](),interaction[_0xc0a0('0x16')](_0xc0a0('0x19'),_0xc0a0('0x1c')),controller[_0xc0a0('0x1d')]);router[_0xc0a0('0x1e')](_0xc0a0('0x15'),auth[_0xc0a0('0x8')](),controller[_0xc0a0('0x1f')]);module[_0xc0a0('0x20')]=router; \ No newline at end of file +var _0x7f24=['index','/describe','/:id','show','getMessages','download','post','create','/:id/messages','addMessage','/:id/tags','tracked','fax','faxinteraction:addtags','put','faxinteraction:update','update','destroy','delete','removeTags','exports','multer','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated'];(function(_0x15e0d2,_0x8333c){var _0x45bb73=function(_0x52cb41){while(--_0x52cb41){_0x15e0d2['push'](_0x15e0d2['shift']());}};_0x45bb73(++_0x8333c);}(_0x7f24,0x16a));var _0x47f2=function(_0x3fa813,_0x295ac7){_0x3fa813=_0x3fa813-0x0;var _0x3cbab1=_0x7f24[_0x3fa813];return _0x3cbab1;};'use strict';var multer=require(_0x47f2('0x0'));var util=require('util');var path=require(_0x47f2('0x1'));var timeout=require(_0x47f2('0x2'));var express=require(_0x47f2('0x3'));var router=express['Router']();var fs_extra=require(_0x47f2('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x47f2('0x5'));var config=require(_0x47f2('0x6'));var controller=require(_0x47f2('0x7'));router[_0x47f2('0x8')]('/',auth[_0x47f2('0x9')](),controller[_0x47f2('0xa')]);router['get'](_0x47f2('0xb'),auth[_0x47f2('0x9')](),controller['describe']);router['get'](_0x47f2('0xc'),auth[_0x47f2('0x9')](),controller[_0x47f2('0xd')]);router['get']('/:id/messages',auth[_0x47f2('0x9')](),controller[_0x47f2('0xe')]);router['get']('/:id/download',auth['isAuthenticated'](),controller[_0x47f2('0xf')]);router[_0x47f2('0x10')]('/',auth['isAuthenticated'](),controller[_0x47f2('0x11')]);router[_0x47f2('0x10')](_0x47f2('0x12'),auth[_0x47f2('0x9')](),controller[_0x47f2('0x13')]);router[_0x47f2('0x10')](_0x47f2('0x14'),auth['isAuthenticated'](),interaction[_0x47f2('0x15')](_0x47f2('0x16'),_0x47f2('0x17')),controller['addTags']);router[_0x47f2('0x18')]('/:id',auth[_0x47f2('0x9')](),interaction[_0x47f2('0x15')](_0x47f2('0x16'),_0x47f2('0x19')),controller[_0x47f2('0x1a')]);router['delete'](_0x47f2('0xc'),auth[_0x47f2('0x9')](),interaction[_0x47f2('0x15')]('fax','faxinteraction:destroy'),controller[_0x47f2('0x1b')]);router[_0x47f2('0x1c')](_0x47f2('0x14'),auth[_0x47f2('0x9')](),controller[_0x47f2('0x1d')]);module[_0x47f2('0x1e')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index c8ef3e3..501a5b1 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 _0x5db8=['TEXT','BOOLEAN','ENUM','out','DATE','sequelize','exports'];(function(_0x47fc01,_0x50068a){var _0x2cec29=function(_0x1d6b15){while(--_0x1d6b15){_0x47fc01['push'](_0x47fc01['shift']());}};_0x2cec29(++_0x50068a);}(_0x5db8,0xbb));var _0x85db=function(_0x149083,_0x4047b6){_0x149083=_0x149083-0x0;var _0x4dc74e=_0x5db8[_0x149083];return _0x4dc74e;};'use strict';var Sequelize=require(_0x85db('0x0'));module[_0x85db('0x1')]={'body':{'type':Sequelize[_0x85db('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x85db('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x85db('0x4')]('in',_0x85db('0x5')),'defaultValue':'out','allowNull':![]},'failMessage':{'type':Sequelize['TEXT'],'defaultValue':null},'readAt':{'type':Sequelize[_0x85db('0x6')]}}; \ No newline at end of file +var _0xa41a=['out','TEXT','DATE','sequelize','exports','medium','BOOLEAN','ENUM'];(function(_0xfe5672,_0x5546b4){var _0x816a0b=function(_0x13d798){while(--_0x13d798){_0xfe5672['push'](_0xfe5672['shift']());}};_0x816a0b(++_0x5546b4);}(_0xa41a,0x6b));var _0xaa41=function(_0x20c4f7,_0x1f0b6b){_0x20c4f7=_0x20c4f7-0x0;var _0xf20272=_0xa41a[_0x20c4f7];return _0xf20272;};'use strict';var Sequelize=require(_0xaa41('0x0'));module[_0xaa41('0x1')]={'body':{'type':Sequelize['TEXT'](_0xaa41('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xaa41('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xaa41('0x4')]('in',_0xaa41('0x5')),'defaultValue':_0xaa41('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize[_0xaa41('0x6')],'defaultValue':null},'readAt':{'type':Sequelize[_0xaa41('0x7')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index 1967a50..aa965db 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 _0x5a9e=['User','fullname','email','internal','manual','SIP/%s','channel','motionChannel','event','accept','EventManager','fax-interactions','reject','fax','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT','contact','interface','rejectmessage','create','CmContact','findOne','Attachment','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','download','join','root','server','files','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','querystring','papaparse','../../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','./faxMessage.socket','register','jayson/promise','client','http','request','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','FaxMessage,\x20%s,\x20%s','info','result','sendStatus','status','end','offset','undefined','count','Content-Range','apply','save','update','then','stack','send','index','map','FaxMessage','rawAttributes','fieldName','type','key','model','name','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','includeAll','include','findAll','rows','catch','show','params','find','body','describe','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','FaxInteraction','FaxInteractionId','isNil','read1stAt','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes'];(function(_0x624f9d,_0x247eb5){var _0x391872=function(_0x39732f){while(--_0x39732f){_0x624f9d['push'](_0x624f9d['shift']());}};_0x391872(++_0x247eb5);}(_0x5a9e,0x14f));var _0xe5a9=function(_0x4e55a9,_0x241b22){_0x4e55a9=_0x4e55a9-0x0;var _0x4a9b67=_0x5a9e[_0x4e55a9];return _0x4a9b67;};'use strict';var emlformat=require(_0xe5a9('0x0'));var rimraf=require(_0xe5a9('0x1'));var zipdir=require(_0xe5a9('0x2'));var jsonpatch=require(_0xe5a9('0x3'));var rp=require(_0xe5a9('0x4'));var moment=require('moment');var BPromise=require(_0xe5a9('0x5'));var Mustache=require(_0xe5a9('0x6'));var util=require(_0xe5a9('0x7'));var path=require(_0xe5a9('0x8'));var sox=require(_0xe5a9('0x9'));var csv=require(_0xe5a9('0xa'));var ejs=require(_0xe5a9('0xb'));var fs=require('fs');var fs_extra=require(_0xe5a9('0xc'));var _=require('lodash');var squel=require(_0xe5a9('0xd'));var crypto=require(_0xe5a9('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xe5a9('0xa'));var querystring=require(_0xe5a9('0xf'));var Papa=require(_0xe5a9('0x10'));var Redis=require('ioredis');var authService=require(_0xe5a9('0x11'));var qs=require(_0xe5a9('0x12'));var as=require(_0xe5a9('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe5a9('0x14'))(_0xe5a9('0x15'));var utils=require(_0xe5a9('0x16'));var config=require(_0xe5a9('0x17'));var licenseUtil=require(_0xe5a9('0x18'));var db=require(_0xe5a9('0x19'))['db'];config[_0xe5a9('0x1a')]=_[_0xe5a9('0x1b')](config[_0xe5a9('0x1a')],{'host':_0xe5a9('0x1c'),'port':0x18eb});var socket=require(_0xe5a9('0x1d'))(new Redis(config['redis']));require(_0xe5a9('0x1e'))[_0xe5a9('0x1f')](socket);var jayson=require(_0xe5a9('0x20'));var client=jayson[_0xe5a9('0x21')][_0xe5a9('0x22')]({'port':0x232c});var client9002=jayson[_0xe5a9('0x21')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2fde77,_0x2cd745,_0x487f37,_0x59db7c){return new BPromise(function(_0x535388,_0x2ed69a){var _0x49f614=_0x59db7c||client;return _0x49f614[_0xe5a9('0x23')](_0x2fde77,_0x487f37)['then'](function(_0x3afbbe){logger['info']('FaxMessage,\x20%s,\x20%s',_0x2cd745,_0xe5a9('0x24'));logger[_0xe5a9('0x25')](_0xe5a9('0x26'),_0x2cd745,'request\x20sent',JSON[_0xe5a9('0x27')](_0x3afbbe));if(_0x3afbbe[_0xe5a9('0x28')]){if(_0x3afbbe[_0xe5a9('0x28')][_0xe5a9('0x29')]===0x1f4){logger[_0xe5a9('0x28')]('FaxMessage,\x20%s,\x20%s',_0x2cd745,_0x3afbbe[_0xe5a9('0x28')][_0xe5a9('0x2a')]);return _0x2ed69a(_0x3afbbe['error'][_0xe5a9('0x2a')]);}logger[_0xe5a9('0x28')](_0xe5a9('0x2b'),_0x2cd745,_0x3afbbe[_0xe5a9('0x28')][_0xe5a9('0x2a')]);return _0x535388(_0x3afbbe[_0xe5a9('0x28')][_0xe5a9('0x2a')]);}else{logger[_0xe5a9('0x2c')](_0xe5a9('0x2b'),_0x2cd745,_0xe5a9('0x24'));_0x535388(_0x3afbbe[_0xe5a9('0x2d')]['message']);}})['catch'](function(_0x26aff8){logger[_0xe5a9('0x28')](_0xe5a9('0x2b'),_0x2cd745,_0x26aff8);_0x2ed69a(_0x26aff8);});});}function respondWithStatusCode(_0x5abfd0,_0x5ede78){_0x5ede78=_0x5ede78||0xcc;return function(_0x21703f){if(_0x21703f){return _0x5abfd0[_0xe5a9('0x2e')](_0x5ede78);}return _0x5abfd0[_0xe5a9('0x2f')](_0x5ede78)[_0xe5a9('0x30')]();};}function respondWithResult(_0x505ae7,_0xfe0f83){_0xfe0f83=_0xfe0f83||0xc8;return function(_0x35e691){if(_0x35e691){return _0x505ae7[_0xe5a9('0x2f')](_0xfe0f83)['json'](_0x35e691);}};}function respondWithFilteredResult(_0x49d350,_0x58b822){return function(_0x8fcc1f){if(_0x8fcc1f){var _0x54b918=typeof _0x58b822[_0xe5a9('0x31')]===_0xe5a9('0x32')&&typeof _0x58b822['limit']===_0xe5a9('0x32');var _0x20763b=_0x8fcc1f['count'];var _0x8da9a8=_0x54b918?0x0:_0x58b822['offset'];var _0x2d577f=_0x54b918?_0x8fcc1f[_0xe5a9('0x33')]:_0x58b822[_0xe5a9('0x31')]+_0x58b822['limit'];var _0xbe90a6;if(_0x2d577f>=_0x20763b){_0x2d577f=_0x20763b;_0xbe90a6=0xc8;}else{_0xbe90a6=0xce;}_0x49d350[_0xe5a9('0x2f')](_0xbe90a6);return _0x49d350['set'](_0xe5a9('0x34'),_0x8da9a8+'-'+_0x2d577f+'/'+_0x20763b)['json'](_0x8fcc1f);}return null;};}function patchUpdates(_0x4da9ac){return function(_0x1bc70b){try{jsonpatch[_0xe5a9('0x35')](_0x1bc70b,_0x4da9ac,!![]);}catch(_0x2bfcb8){return BPromise['reject'](_0x2bfcb8);}return _0x1bc70b[_0xe5a9('0x36')]();};}function saveUpdates(_0xdb418f,_0x59d2ce){return function(_0x172d31){if(_0x172d31){return _0x172d31[_0xe5a9('0x37')](_0xdb418f)['then'](function(_0x716832){return _0x716832;});}return null;};}function removeEntity(_0x3a5339,_0x3ce521){return function(_0x6d901f){if(_0x6d901f){return _0x6d901f['destroy']()[_0xe5a9('0x38')](function(){_0x3a5339['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1d05ac,_0x47d26b){return function(_0x216d0a){if(!_0x216d0a){_0x1d05ac[_0xe5a9('0x2e')](0x194);}return _0x216d0a;};}function handleError(_0x5c8dab,_0x2a35c3){_0x2a35c3=_0x2a35c3||0x1f4;return function(_0xbff474){logger[_0xe5a9('0x28')](_0xbff474[_0xe5a9('0x39')]);if(_0xbff474['name']){delete _0xbff474['name'];}_0x5c8dab[_0xe5a9('0x2f')](_0x2a35c3)[_0xe5a9('0x3a')](_0xbff474);};}exports[_0xe5a9('0x3b')]=function(_0x3573c6,_0x359f09){var _0x28cb8f={},_0x27f45a={},_0x5ce3c0={'count':0x0,'rows':[]};var _0x5bf3a2=_[_0xe5a9('0x3c')](db[_0xe5a9('0x3d')][_0xe5a9('0x3e')],function(_0x390f8f){return{'name':_0x390f8f[_0xe5a9('0x3f')],'type':_0x390f8f[_0xe5a9('0x40')][_0xe5a9('0x41')]};});_0x27f45a[_0xe5a9('0x42')]=_[_0xe5a9('0x3c')](_0x5bf3a2,_0xe5a9('0x43'));_0x27f45a['query']=_[_0xe5a9('0x44')](_0x3573c6[_0xe5a9('0x45')]);_0x27f45a['filters']=_['intersection'](_0x27f45a[_0xe5a9('0x42')],_0x27f45a[_0xe5a9('0x45')]);_0x28cb8f['attributes']=_[_0xe5a9('0x46')](_0x27f45a['model'],qs['fields'](_0x3573c6['query'][_0xe5a9('0x47')]));_0x28cb8f[_0xe5a9('0x48')]=_0x28cb8f['attributes'][_0xe5a9('0x49')]?_0x28cb8f[_0xe5a9('0x48')]:_0x27f45a[_0xe5a9('0x42')];if(!_0x3573c6[_0xe5a9('0x45')][_0xe5a9('0x4a')](_0xe5a9('0x4b'))){_0x28cb8f[_0xe5a9('0x4c')]=qs[_0xe5a9('0x4c')](_0x3573c6[_0xe5a9('0x45')][_0xe5a9('0x4c')]);_0x28cb8f[_0xe5a9('0x31')]=qs[_0xe5a9('0x31')](_0x3573c6['query'][_0xe5a9('0x31')]);}_0x28cb8f[_0xe5a9('0x4d')]=qs[_0xe5a9('0x4e')](_0x3573c6[_0xe5a9('0x45')][_0xe5a9('0x4e')]);_0x28cb8f[_0xe5a9('0x4f')]=qs[_0xe5a9('0x50')](_[_0xe5a9('0x51')](_0x3573c6['query'],_0x27f45a[_0xe5a9('0x50')]),_0x5bf3a2);if(_0x3573c6[_0xe5a9('0x45')][_0xe5a9('0x52')]){_0x28cb8f['where']=_[_0xe5a9('0x53')](_0x28cb8f[_0xe5a9('0x4f')],{'$or':_[_0xe5a9('0x3c')](_0x5bf3a2,function(_0x8fd38a){if(_0x8fd38a[_0xe5a9('0x40')]!=='VIRTUAL'){var _0x4fea2e={};_0x4fea2e[_0x8fd38a[_0xe5a9('0x43')]]={'$like':'%'+_0x3573c6['query'][_0xe5a9('0x52')]+'%'};return _0x4fea2e;}})});}_0x28cb8f=_[_0xe5a9('0x53')]({},_0x28cb8f,_0x3573c6['options']);var _0x483da8={'where':_0x28cb8f[_0xe5a9('0x4f')]};return db[_0xe5a9('0x3d')][_0xe5a9('0x33')](_0x483da8)[_0xe5a9('0x38')](function(_0x2ae0a6){_0x5ce3c0[_0xe5a9('0x33')]=_0x2ae0a6;if(_0x3573c6[_0xe5a9('0x45')][_0xe5a9('0x54')]){_0x28cb8f[_0xe5a9('0x55')]=[{'all':!![]}];}return db[_0xe5a9('0x3d')][_0xe5a9('0x56')](_0x28cb8f);})[_0xe5a9('0x38')](function(_0x5ef5bf){_0x5ce3c0[_0xe5a9('0x57')]=_0x5ef5bf;return _0x5ce3c0;})[_0xe5a9('0x38')](respondWithFilteredResult(_0x359f09,_0x28cb8f))[_0xe5a9('0x58')](handleError(_0x359f09,null));};exports[_0xe5a9('0x59')]=function(_0x23a1d6,_0x28f5ed){var _0x40bcf1={'raw':!![],'where':{'id':_0x23a1d6[_0xe5a9('0x5a')]['id']}},_0x393c06={};_0x393c06['model']=_['keys'](db['FaxMessage'][_0xe5a9('0x3e')]);_0x393c06[_0xe5a9('0x45')]=_[_0xe5a9('0x44')](_0x23a1d6[_0xe5a9('0x45')]);_0x393c06[_0xe5a9('0x50')]=_[_0xe5a9('0x46')](_0x393c06[_0xe5a9('0x42')],_0x393c06['query']);_0x40bcf1[_0xe5a9('0x48')]=_[_0xe5a9('0x46')](_0x393c06[_0xe5a9('0x42')],qs['fields'](_0x23a1d6[_0xe5a9('0x45')][_0xe5a9('0x47')]));_0x40bcf1[_0xe5a9('0x48')]=_0x40bcf1[_0xe5a9('0x48')][_0xe5a9('0x49')]?_0x40bcf1[_0xe5a9('0x48')]:_0x393c06[_0xe5a9('0x42')];if(_0x23a1d6[_0xe5a9('0x45')][_0xe5a9('0x54')]){_0x40bcf1[_0xe5a9('0x55')]=[{'all':!![]}];}_0x40bcf1=_['merge']({},_0x40bcf1,_0x23a1d6['options']);return db[_0xe5a9('0x3d')][_0xe5a9('0x5b')](_0x40bcf1)[_0xe5a9('0x38')](handleEntityNotFound(_0x28f5ed,null))['then'](respondWithResult(_0x28f5ed,null))[_0xe5a9('0x58')](handleError(_0x28f5ed,null));};exports[_0xe5a9('0x37')]=function(_0x2564fe,_0x3d4ded){if(_0x2564fe[_0xe5a9('0x5c')]['id']){delete _0x2564fe['body']['id'];}return db['FaxMessage'][_0xe5a9('0x5b')]({'where':{'id':_0x2564fe[_0xe5a9('0x5a')]['id']}})['then'](handleEntityNotFound(_0x3d4ded,null))[_0xe5a9('0x38')](saveUpdates(_0x2564fe[_0xe5a9('0x5c')],null))['then'](respondWithResult(_0x3d4ded,null))[_0xe5a9('0x58')](handleError(_0x3d4ded,null));};exports['destroy']=function(_0x39613c,_0x55364f){return db[_0xe5a9('0x3d')][_0xe5a9('0x5b')]({'where':{'id':_0x39613c[_0xe5a9('0x5a')]['id']}})[_0xe5a9('0x38')](handleEntityNotFound(_0x55364f,null))['then'](removeEntity(_0x55364f,null))['catch'](handleError(_0x55364f,null));};exports[_0xe5a9('0x5d')]=function(_0x4477b1,_0x19a97c){return db[_0xe5a9('0x3d')][_0xe5a9('0x5d')]()[_0xe5a9('0x38')](respondWithResult(_0x19a97c,null))[_0xe5a9('0x58')](handleError(_0x19a97c,null));};var interaction_log=require(_0xe5a9('0x14'))('fax-interactions');exports['accept']=function(_0x5bd3be,_0x2a824c,_0x4a6792){var _0x4a86a1={'agent':{},'channel':'fax'};if(_0x5bd3be[_0xe5a9('0x5c')]['id']){delete _0x5bd3be[_0xe5a9('0x5c')]['id'];}_0x5bd3be[_0xe5a9('0x5c')][_0xe5a9('0x5e')]=!![];_0x5bd3be[_0xe5a9('0x5c')]['readAt']=moment()[_0xe5a9('0x5f')](_0xe5a9('0x60'));_0x5bd3be[_0xe5a9('0x5c')][_0xe5a9('0x61')]=_0x5bd3be[_0xe5a9('0x5c')][_0xe5a9('0x61')]||_0x5bd3be[_0xe5a9('0x62')]['id'];_0x4a86a1[_0xe5a9('0x63')]['id']=_0x5bd3be[_0xe5a9('0x5c')][_0xe5a9('0x61')];return db[_0xe5a9('0x3d')][_0xe5a9('0x5b')]({'where':{'id':_0x5bd3be[_0xe5a9('0x5a')]['id'],'UserId':null}})[_0xe5a9('0x38')](handleEntityNotFound(_0x2a824c,null))['then'](saveUpdates(_0x5bd3be[_0xe5a9('0x5c')],null))[_0xe5a9('0x38')](function(_0xde6619){if(_0xde6619){_0x4a86a1[_0xe5a9('0x2a')]=_0xde6619[_0xe5a9('0x64')]({'plain':!![]});return db[_0xe5a9('0x65')][_0xe5a9('0x5b')]({'where':{'id':_0xde6619[_0xe5a9('0x66')]}});}return null;})[_0xe5a9('0x38')](handleEntityNotFound(_0x2a824c,null))[_0xe5a9('0x38')](function(_0x461865){if(_0x461865){return _0x461865[_0xe5a9('0x37')]({'UserId':_0x5bd3be['body']['UserId'],'read1stAt':_[_0xe5a9('0x67')](_0x461865[_0xe5a9('0x68')])?moment()[_0xe5a9('0x5f')](_0xe5a9('0x60')):undefined});}return null;})['then'](function(_0x1a2f18){if(_0x1a2f18){_0x4a86a1[_0xe5a9('0x69')]=_0x1a2f18[_0xe5a9('0x64')]({'plain':!![]});interaction_log[_0xe5a9('0x2c')](_0xe5a9('0x6a'),_0x5bd3be[_0xe5a9('0x62')]['id'],_0x5bd3be['user'][_0xe5a9('0x43')],_0x5bd3be[_0xe5a9('0x62')][_0xe5a9('0x6b')],_0x4a86a1[_0xe5a9('0x69')]['id'],_0x5bd3be[_0xe5a9('0x5c')]?JSON[_0xe5a9('0x27')](_0x5bd3be[_0xe5a9('0x5c')]):_0xe5a9('0x6c'));return respondWithRpcPromise(_0xe5a9('0x6d'),_0xe5a9('0x6e'),_0x4a86a1);}return null;})[_0xe5a9('0x38')](function(_0x296df0){var _0x3002f2=_0xe5a9('0x6f')+_0x296df0[_0xe5a9('0x2a')][_0xe5a9('0x70')];return db[_0xe5a9('0x71')]['query'](_0x3002f2,{'type':db['Sequelize'][_0xe5a9('0x72')]['SELECT'],'raw':!![]})[_0xe5a9('0x38')](function(_0x4141b1){return _0x4141b1;});})[_0xe5a9('0x38')](function(_0x4bc232){if(_0x4bc232){_0x4a86a1[_0xe5a9('0x2a')]['contact']=_0x4bc232[0x0];if(!_0x5bd3be[_0xe5a9('0x5c')][_0xe5a9('0x61')])return;return db[_0xe5a9('0x73')][_0xe5a9('0x5b')]({'where':{'id':_0x5bd3be['body'][_0xe5a9('0x61')],'role':'agent'},'attributes':['id',_0xe5a9('0x43'),_0xe5a9('0x74'),_0xe5a9('0x75'),_0xe5a9('0x76')],'raw':!![]});}return null;})[_0xe5a9('0x38')](function(_0x2fa23f){if(!_0x2fa23f)return null;_0x4a86a1['message'][_0xe5a9('0x63')]=_0x2fa23f;return _0x4a86a1;})['then'](function(_0x27e94e){if(_0x27e94e){if(_0x5bd3be[_0xe5a9('0x5c')][_0xe5a9('0x77')]){_0x4a86a1['message']['interface']=util[_0xe5a9('0x5f')](_0xe5a9('0x78'),_0x5bd3be[_0xe5a9('0x62')][_0xe5a9('0x43')]);_0x4a86a1[_0xe5a9('0x2a')][_0xe5a9('0x79')]=_0x4a86a1[_0xe5a9('0x79')];_0x4a86a1[_0xe5a9('0x2a')][_0xe5a9('0x7a')]=_0x4a86a1[_0xe5a9('0x79')];_0x4a86a1[_0xe5a9('0x2a')][_0xe5a9('0x7b')]=_0xe5a9('0x7c');return respondWithRpcPromise('EventManager',_0xe5a9('0x7d'),{'event':'acceptmessage','message':_0x4a86a1[_0xe5a9('0x2a')]},client9002)[_0xe5a9('0x38')](function(){return _0x4a86a1;});}return _0x4a86a1;}return null;})[_0xe5a9('0x38')](respondWithResult(_0x2a824c,null))[_0xe5a9('0x58')](handleError(_0x2a824c,null));};var interaction_log=require(_0xe5a9('0x14'))(_0xe5a9('0x7e'));exports[_0xe5a9('0x7f')]=function(_0x29a826,_0x130fbc,_0x19e41e){var _0x4a474b={'agent':{},'channel':_0xe5a9('0x80')};if(_0x29a826[_0xe5a9('0x5c')]['id']){delete _0x29a826['body']['id'];}_0x29a826['body']['UserId']=_0x29a826[_0xe5a9('0x5c')][_0xe5a9('0x61')]||_0x29a826[_0xe5a9('0x62')]['id'];_0x4a474b[_0xe5a9('0x63')]['id']=_0x29a826[_0xe5a9('0x5c')][_0xe5a9('0x61')];return db[_0xe5a9('0x3d')][_0xe5a9('0x5b')]({'where':{'id':_0x29a826['params']['id'],'UserId':null}})[_0xe5a9('0x38')](handleEntityNotFound(_0x130fbc,null))[_0xe5a9('0x38')](function(_0xe2688){if(_0xe2688){_0x4a474b[_0xe5a9('0x2a')]=_0xe2688[_0xe5a9('0x64')]({'plain':!![]});return db['FaxInteraction'][_0xe5a9('0x5b')]({'where':{'id':_0xe2688[_0xe5a9('0x66')]}});}return null;})['then'](handleEntityNotFound(_0x130fbc,null))[_0xe5a9('0x38')](function(_0x3e1002){if(_0x3e1002){_0x4a474b[_0xe5a9('0x69')]=_0x3e1002[_0xe5a9('0x64')]({'plain':!![]});interaction_log['info'](_0xe5a9('0x81'),_0x29a826[_0xe5a9('0x62')]['id'],_0x29a826[_0xe5a9('0x62')][_0xe5a9('0x43')],_0x29a826[_0xe5a9('0x62')][_0xe5a9('0x6b')],_0x4a474b['interaction']['id'],_0x29a826[_0xe5a9('0x5c')]?JSON[_0xe5a9('0x27')](_0x29a826[_0xe5a9('0x5c')]):_0xe5a9('0x6c'));return respondWithRpcPromise(_0xe5a9('0x82'),_0xe5a9('0x83'),_0x4a474b);}return null;})['then'](function(_0x490f86){var _0x5ef21d=_0xe5a9('0x6f')+_0x490f86[_0xe5a9('0x2a')][_0xe5a9('0x70')];return db['sequelize'][_0xe5a9('0x45')](_0x5ef21d,{'type':db['Sequelize'][_0xe5a9('0x72')][_0xe5a9('0x84')],'raw':!![]})[_0xe5a9('0x38')](function(_0x485a4e){return _0x485a4e;});})['then'](function(_0x187ed4){if(_0x187ed4){_0x4a474b['message'][_0xe5a9('0x85')]=_0x187ed4[0x0];if(!_0x29a826[_0xe5a9('0x5c')]['UserId'])return;return db['User'][_0xe5a9('0x5b')]({'where':{'id':_0x29a826[_0xe5a9('0x5c')][_0xe5a9('0x61')],'role':_0xe5a9('0x63')},'attributes':['id',_0xe5a9('0x43'),_0xe5a9('0x74'),_0xe5a9('0x75'),_0xe5a9('0x76')],'raw':!![]});}return null;})[_0xe5a9('0x38')](function(_0x35bea5){if(!_0x35bea5)return null;_0x4a474b[_0xe5a9('0x2a')][_0xe5a9('0x63')]=_0x35bea5;return _0x4a474b;})[_0xe5a9('0x38')](function(_0x25e279){if(_0x25e279){_0x25e279['message'][_0xe5a9('0x86')]=util[_0xe5a9('0x5f')](_0xe5a9('0x78'),_0x29a826[_0xe5a9('0x62')][_0xe5a9('0x43')]);_0x25e279['message']['channel']=_0x4a474b['channel'];_0x25e279[_0xe5a9('0x2a')][_0xe5a9('0x7a')]=_0x4a474b[_0xe5a9('0x79')];_0x25e279[_0xe5a9('0x2a')]['event']='reject';respondWithRpcPromise('EventManager',_0xe5a9('0x7d'),{'event':_0xe5a9('0x87'),'message':_0x25e279[_0xe5a9('0x2a')]},client9002);return _0x4a474b;}return null;})[_0xe5a9('0x38')](respondWithResult(_0x130fbc,null))[_0xe5a9('0x58')](handleError(_0x130fbc,null));};exports[_0xe5a9('0x88')]=function(_0x16ab05,_0x305e6e){var _0x7cb46a;return db[_0xe5a9('0x3d')][_0xe5a9('0x88')](_0x16ab05[_0xe5a9('0x5c')],{})[_0xe5a9('0x38')](function(_0x45977b){_0x7cb46a=_0x45977b;return db[_0xe5a9('0x89')][_0xe5a9('0x8a')]({'where':{'id':_0x7cb46a[_0xe5a9('0x70')]}});})[_0xe5a9('0x38')](function(_0x37b615){if(_[_0xe5a9('0x67')](_0x37b615)){return;}else{_0x7cb46a['fax']=_0x37b615[_0xe5a9('0x80')];return db[_0xe5a9('0x8b')][_0xe5a9('0x8a')]({'where':{'id':_0x7cb46a[_0xe5a9('0x8c')]}});}})[_0xe5a9('0x38')](function(_0x2d4875){return respondWithRpcPromise('SendFax',_0xe5a9('0x8d'),{'FaxAccountId':_[_0xe5a9('0x67')](_0x16ab05['body'])?undefined:_0x16ab05['body'][_0xe5a9('0x8e')],'path':_[_0xe5a9('0x67')](_0x2d4875)?undefined:util[_0xe5a9('0x5f')](_0xe5a9('0x8f'),_0x2d4875[_0xe5a9('0x90')]),'fax':_[_0xe5a9('0x67')](_0x7cb46a['fax'])?undefined:_0x7cb46a[_0xe5a9('0x80')],'AttachmentId':_0x7cb46a[_0xe5a9('0x8c')]},client9002);})['then'](respondWithResult(_0x305e6e,0xc9))[_0xe5a9('0x58')](handleError(_0x305e6e,null));};exports[_0xe5a9('0x91')]=function(_0x1383cb,_0x40991a){var _0x3e7588=path[_0xe5a9('0x92')](config[_0xe5a9('0x93')],_0xe5a9('0x94'),_0xe5a9('0x95'),'attachments');return db[_0xe5a9('0x3d')]['find']({'where':{'id':_0x1383cb['params']['id']},'include':[{'model':db[_0xe5a9('0x8b')],'as':_0xe5a9('0x8b')}]})[_0xe5a9('0x38')](handleEntityNotFound(_0x40991a,null))[_0xe5a9('0x38')](function(_0x1cdc83){if(_0x1cdc83){return _0x40991a[_0xe5a9('0x91')](path[_0xe5a9('0x92')](_0x3e7588,_0x1cdc83['Attachment'][_0xe5a9('0x90')]));}})['catch'](handleError(_0x40991a,null));}; \ No newline at end of file +var _0x4d21=['files','attachments','join','basename','eml-format','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./faxMessage.socket','register','jayson/promise','http','client','request','then','request\x20sent','debug','error','code','FaxMessage,\x20%s,\x20%s','message','info','result','catch','status','end','offset','undefined','count','limit','set','Content-Range','json','reject','update','destroy','sendStatus','stack','name','send','index','FaxMessage','fieldName','type','model','query','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','VIRTUAL','options','include','findAll','rows','show','params','keys','rawAttributes','intersection','length','includeAll','find','body','describe','fax-interactions','accept','fax','read','readAt','format','UserId','get','FaxInteraction','FaxInteractionId','read1stAt','YYYY-MM-DD\x20HH:mm:ss','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','SELECT','email','internal','agent','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','interaction','rejectMessage','QueryTypes','contact','User','motionChannel','create','CmContact','findOne','isNil','Attachment','AttachmentId','SendFax','FaxAccountId','download','root','server'];(function(_0x97c6ea,_0x4cffce){var _0x2d7f50=function(_0x54010e){while(--_0x54010e){_0x97c6ea['push'](_0x97c6ea['shift']());}};_0x2d7f50(++_0x4cffce);}(_0x4d21,0x96));var _0x14d2=function(_0x2c5866,_0x521cbc){_0x2c5866=_0x2c5866-0x0;var _0x17a2d0=_0x4d21[_0x2c5866];return _0x17a2d0;};'use strict';var emlformat=require(_0x14d2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x14d2('0x1'));var jsonpatch=require(_0x14d2('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x14d2('0x3'));var Mustache=require('mustache');var util=require(_0x14d2('0x4'));var path=require(_0x14d2('0x5'));var sox=require(_0x14d2('0x6'));var csv=require(_0x14d2('0x7'));var ejs=require(_0x14d2('0x8'));var fs=require('fs');var fs_extra=require(_0x14d2('0x9'));var _=require(_0x14d2('0xa'));var squel=require(_0x14d2('0xb'));var crypto=require(_0x14d2('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x14d2('0xd'));var toCsv=require(_0x14d2('0x7'));var querystring=require(_0x14d2('0xe'));var Papa=require(_0x14d2('0xf'));var Redis=require(_0x14d2('0x10'));var authService=require(_0x14d2('0x11'));var qs=require(_0x14d2('0x12'));var as=require(_0x14d2('0x13'));var hardwareService=require(_0x14d2('0x14'));var logger=require(_0x14d2('0x15'))(_0x14d2('0x16'));var utils=require('../../config/utils');var config=require(_0x14d2('0x17'));var licenseUtil=require(_0x14d2('0x18'));var db=require('../../mysqldb')['db'];config[_0x14d2('0x19')]=_['defaults'](config[_0x14d2('0x19')],{'host':_0x14d2('0x1a'),'port':0x18eb});var socket=require(_0x14d2('0x1b'))(new Redis(config['redis']));require(_0x14d2('0x1c'))[_0x14d2('0x1d')](socket);var jayson=require(_0x14d2('0x1e'));var client=jayson['client'][_0x14d2('0x1f')]({'port':0x232c});var client9002=jayson[_0x14d2('0x20')][_0x14d2('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x1c573f,_0x2c771e,_0x4ac402,_0x256f48){return new BPromise(function(_0x328f7b,_0x3abcaa){var _0x53df6e=_0x256f48||client;return _0x53df6e[_0x14d2('0x21')](_0x1c573f,_0x4ac402)[_0x14d2('0x22')](function(_0x2e55f5){logger['info']('FaxMessage,\x20%s,\x20%s',_0x2c771e,_0x14d2('0x23'));logger[_0x14d2('0x24')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x2c771e,_0x14d2('0x23'),JSON['stringify'](_0x2e55f5));if(_0x2e55f5['error']){if(_0x2e55f5[_0x14d2('0x25')][_0x14d2('0x26')]===0x1f4){logger[_0x14d2('0x25')](_0x14d2('0x27'),_0x2c771e,_0x2e55f5['error'][_0x14d2('0x28')]);return _0x3abcaa(_0x2e55f5[_0x14d2('0x25')][_0x14d2('0x28')]);}logger[_0x14d2('0x25')]('FaxMessage,\x20%s,\x20%s',_0x2c771e,_0x2e55f5[_0x14d2('0x25')][_0x14d2('0x28')]);return _0x328f7b(_0x2e55f5['error'][_0x14d2('0x28')]);}else{logger[_0x14d2('0x29')](_0x14d2('0x27'),_0x2c771e,_0x14d2('0x23'));_0x328f7b(_0x2e55f5[_0x14d2('0x2a')][_0x14d2('0x28')]);}})[_0x14d2('0x2b')](function(_0x179720){logger[_0x14d2('0x25')](_0x14d2('0x27'),_0x2c771e,_0x179720);_0x3abcaa(_0x179720);});});}function respondWithStatusCode(_0x43e519,_0x1238c5){_0x1238c5=_0x1238c5||0xcc;return function(_0x16c321){if(_0x16c321){return _0x43e519['sendStatus'](_0x1238c5);}return _0x43e519[_0x14d2('0x2c')](_0x1238c5)[_0x14d2('0x2d')]();};}function respondWithResult(_0x5ea024,_0x2d6de4){_0x2d6de4=_0x2d6de4||0xc8;return function(_0xfe2fa4){if(_0xfe2fa4){return _0x5ea024[_0x14d2('0x2c')](_0x2d6de4)['json'](_0xfe2fa4);}};}function respondWithFilteredResult(_0x510e54,_0x3a36a5){return function(_0x49e8c6){if(_0x49e8c6){var _0x366449=typeof _0x3a36a5[_0x14d2('0x2e')]===_0x14d2('0x2f')&&typeof _0x3a36a5['limit']==='undefined';var _0x3b7d8f=_0x49e8c6[_0x14d2('0x30')];var _0x419645=_0x366449?0x0:_0x3a36a5[_0x14d2('0x2e')];var _0x38637e=_0x366449?_0x49e8c6[_0x14d2('0x30')]:_0x3a36a5['offset']+_0x3a36a5[_0x14d2('0x31')];var _0xebefb2;if(_0x38637e>=_0x3b7d8f){_0x38637e=_0x3b7d8f;_0xebefb2=0xc8;}else{_0xebefb2=0xce;}_0x510e54[_0x14d2('0x2c')](_0xebefb2);return _0x510e54[_0x14d2('0x32')](_0x14d2('0x33'),_0x419645+'-'+_0x38637e+'/'+_0x3b7d8f)[_0x14d2('0x34')](_0x49e8c6);}return null;};}function patchUpdates(_0xc3fac2){return function(_0x71cbab){try{jsonpatch['apply'](_0x71cbab,_0xc3fac2,!![]);}catch(_0x2bb382){return BPromise[_0x14d2('0x35')](_0x2bb382);}return _0x71cbab['save']();};}function saveUpdates(_0x1ca78c,_0x2925b2){return function(_0x289958){if(_0x289958){return _0x289958[_0x14d2('0x36')](_0x1ca78c)['then'](function(_0xdeac8){return _0xdeac8;});}return null;};}function removeEntity(_0x187f8b,_0x174d9c){return function(_0x501870){if(_0x501870){return _0x501870[_0x14d2('0x37')]()[_0x14d2('0x22')](function(){_0x187f8b[_0x14d2('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f2dde,_0x42b8d8){return function(_0x537697){if(!_0x537697){_0x2f2dde[_0x14d2('0x38')](0x194);}return _0x537697;};}function handleError(_0x5b109e,_0x185b1b){_0x185b1b=_0x185b1b||0x1f4;return function(_0x1ecdad){logger['error'](_0x1ecdad[_0x14d2('0x39')]);if(_0x1ecdad[_0x14d2('0x3a')]){delete _0x1ecdad[_0x14d2('0x3a')];}_0x5b109e[_0x14d2('0x2c')](_0x185b1b)[_0x14d2('0x3b')](_0x1ecdad);};}exports[_0x14d2('0x3c')]=function(_0x28ac36,_0x240882){var _0x1ecd44={},_0x15baca={},_0x36e56c={'count':0x0,'rows':[]};var _0x27dd31=_['map'](db[_0x14d2('0x3d')]['rawAttributes'],function(_0x57a3b8){return{'name':_0x57a3b8[_0x14d2('0x3e')],'type':_0x57a3b8[_0x14d2('0x3f')]['key']};});_0x15baca[_0x14d2('0x40')]=_['map'](_0x27dd31,_0x14d2('0x3a'));_0x15baca[_0x14d2('0x41')]=_['keys'](_0x28ac36[_0x14d2('0x41')]);_0x15baca[_0x14d2('0x42')]=_['intersection'](_0x15baca[_0x14d2('0x40')],_0x15baca[_0x14d2('0x41')]);_0x1ecd44[_0x14d2('0x43')]=_['intersection'](_0x15baca[_0x14d2('0x40')],qs[_0x14d2('0x44')](_0x28ac36['query'][_0x14d2('0x44')]));_0x1ecd44['attributes']=_0x1ecd44[_0x14d2('0x43')]['length']?_0x1ecd44[_0x14d2('0x43')]:_0x15baca[_0x14d2('0x40')];if(!_0x28ac36[_0x14d2('0x41')][_0x14d2('0x45')](_0x14d2('0x46'))){_0x1ecd44[_0x14d2('0x31')]=qs[_0x14d2('0x31')](_0x28ac36[_0x14d2('0x41')]['limit']);_0x1ecd44[_0x14d2('0x2e')]=qs[_0x14d2('0x2e')](_0x28ac36['query'][_0x14d2('0x2e')]);}_0x1ecd44[_0x14d2('0x47')]=qs[_0x14d2('0x48')](_0x28ac36[_0x14d2('0x41')]['sort']);_0x1ecd44[_0x14d2('0x49')]=qs['filters'](_['pick'](_0x28ac36[_0x14d2('0x41')],_0x15baca[_0x14d2('0x42')]),_0x27dd31);if(_0x28ac36[_0x14d2('0x41')][_0x14d2('0x4a')]){_0x1ecd44[_0x14d2('0x49')]=_[_0x14d2('0x4b')](_0x1ecd44[_0x14d2('0x49')],{'$or':_[_0x14d2('0x4c')](_0x27dd31,function(_0x5dee87){if(_0x5dee87[_0x14d2('0x3f')]!==_0x14d2('0x4d')){var _0xb4a2cc={};_0xb4a2cc[_0x5dee87[_0x14d2('0x3a')]]={'$like':'%'+_0x28ac36[_0x14d2('0x41')][_0x14d2('0x4a')]+'%'};return _0xb4a2cc;}})});}_0x1ecd44=_[_0x14d2('0x4b')]({},_0x1ecd44,_0x28ac36[_0x14d2('0x4e')]);var _0x4f1833={'where':_0x1ecd44['where']};return db[_0x14d2('0x3d')]['count'](_0x4f1833)[_0x14d2('0x22')](function(_0x6c4dc){_0x36e56c[_0x14d2('0x30')]=_0x6c4dc;if(_0x28ac36[_0x14d2('0x41')]['includeAll']){_0x1ecd44[_0x14d2('0x4f')]=[{'all':!![]}];}return db[_0x14d2('0x3d')][_0x14d2('0x50')](_0x1ecd44);})['then'](function(_0x171793){_0x36e56c[_0x14d2('0x51')]=_0x171793;return _0x36e56c;})[_0x14d2('0x22')](respondWithFilteredResult(_0x240882,_0x1ecd44))[_0x14d2('0x2b')](handleError(_0x240882,null));};exports[_0x14d2('0x52')]=function(_0x530ec0,_0x316c46){var _0x257f05={'raw':!![],'where':{'id':_0x530ec0[_0x14d2('0x53')]['id']}},_0x520c31={};_0x520c31['model']=_[_0x14d2('0x54')](db['FaxMessage'][_0x14d2('0x55')]);_0x520c31['query']=_[_0x14d2('0x54')](_0x530ec0[_0x14d2('0x41')]);_0x520c31['filters']=_['intersection'](_0x520c31[_0x14d2('0x40')],_0x520c31[_0x14d2('0x41')]);_0x257f05[_0x14d2('0x43')]=_[_0x14d2('0x56')](_0x520c31['model'],qs['fields'](_0x530ec0[_0x14d2('0x41')][_0x14d2('0x44')]));_0x257f05[_0x14d2('0x43')]=_0x257f05['attributes'][_0x14d2('0x57')]?_0x257f05[_0x14d2('0x43')]:_0x520c31[_0x14d2('0x40')];if(_0x530ec0[_0x14d2('0x41')][_0x14d2('0x58')]){_0x257f05[_0x14d2('0x4f')]=[{'all':!![]}];}_0x257f05=_[_0x14d2('0x4b')]({},_0x257f05,_0x530ec0[_0x14d2('0x4e')]);return db['FaxMessage'][_0x14d2('0x59')](_0x257f05)[_0x14d2('0x22')](handleEntityNotFound(_0x316c46,null))[_0x14d2('0x22')](respondWithResult(_0x316c46,null))['catch'](handleError(_0x316c46,null));};exports[_0x14d2('0x36')]=function(_0x3482d7,_0xb4df38){if(_0x3482d7['body']['id']){delete _0x3482d7[_0x14d2('0x5a')]['id'];}return db[_0x14d2('0x3d')][_0x14d2('0x59')]({'where':{'id':_0x3482d7[_0x14d2('0x53')]['id']}})[_0x14d2('0x22')](handleEntityNotFound(_0xb4df38,null))[_0x14d2('0x22')](saveUpdates(_0x3482d7['body'],null))[_0x14d2('0x22')](respondWithResult(_0xb4df38,null))['catch'](handleError(_0xb4df38,null));};exports['destroy']=function(_0x1f9f35,_0x3e9b){return db[_0x14d2('0x3d')]['find']({'where':{'id':_0x1f9f35['params']['id']}})[_0x14d2('0x22')](handleEntityNotFound(_0x3e9b,null))[_0x14d2('0x22')](removeEntity(_0x3e9b,null))[_0x14d2('0x2b')](handleError(_0x3e9b,null));};exports[_0x14d2('0x5b')]=function(_0x4ba8cc,_0x99a633){return db[_0x14d2('0x3d')][_0x14d2('0x5b')]()[_0x14d2('0x22')](respondWithResult(_0x99a633,null))[_0x14d2('0x2b')](handleError(_0x99a633,null));};var interaction_log=require(_0x14d2('0x15'))(_0x14d2('0x5c'));exports[_0x14d2('0x5d')]=function(_0x4d3c00,_0x5c261e,_0xdb4c0d){var _0x13c8ec={'agent':{},'channel':_0x14d2('0x5e')};if(_0x4d3c00['body']['id']){delete _0x4d3c00[_0x14d2('0x5a')]['id'];}_0x4d3c00[_0x14d2('0x5a')][_0x14d2('0x5f')]=!![];_0x4d3c00[_0x14d2('0x5a')][_0x14d2('0x60')]=moment()[_0x14d2('0x61')]('YYYY-MM-DD\x20HH:mm:ss');_0x4d3c00[_0x14d2('0x5a')][_0x14d2('0x62')]=_0x4d3c00['body'][_0x14d2('0x62')]||_0x4d3c00['user']['id'];_0x13c8ec['agent']['id']=_0x4d3c00[_0x14d2('0x5a')][_0x14d2('0x62')];return db[_0x14d2('0x3d')][_0x14d2('0x59')]({'where':{'id':_0x4d3c00['params']['id'],'UserId':null}})[_0x14d2('0x22')](handleEntityNotFound(_0x5c261e,null))['then'](saveUpdates(_0x4d3c00[_0x14d2('0x5a')],null))[_0x14d2('0x22')](function(_0x1b114f){if(_0x1b114f){_0x13c8ec[_0x14d2('0x28')]=_0x1b114f[_0x14d2('0x63')]({'plain':!![]});return db[_0x14d2('0x64')]['find']({'where':{'id':_0x1b114f[_0x14d2('0x65')]}});}return null;})[_0x14d2('0x22')](handleEntityNotFound(_0x5c261e,null))['then'](function(_0x7e1915){if(_0x7e1915){return _0x7e1915['update']({'UserId':_0x4d3c00[_0x14d2('0x5a')]['UserId'],'read1stAt':_['isNil'](_0x7e1915[_0x14d2('0x66')])?moment()[_0x14d2('0x61')](_0x14d2('0x67')):undefined});}return null;})['then'](function(_0x8024ae){if(_0x8024ae){_0x13c8ec['interaction']=_0x8024ae[_0x14d2('0x63')]({'plain':!![]});interaction_log[_0x14d2('0x29')](_0x14d2('0x68'),_0x4d3c00[_0x14d2('0x69')]['id'],_0x4d3c00['user'][_0x14d2('0x3a')],_0x4d3c00[_0x14d2('0x69')]['role'],_0x13c8ec['interaction']['id'],_0x4d3c00[_0x14d2('0x5a')]?JSON[_0x14d2('0x6a')](_0x4d3c00[_0x14d2('0x5a')]):_0x14d2('0x6b'));return respondWithRpcPromise(_0x14d2('0x6c'),_0x14d2('0x6d'),_0x13c8ec);}return null;})[_0x14d2('0x22')](function(_0x449d2f){var _0x24d26c=_0x14d2('0x6e')+_0x449d2f[_0x14d2('0x28')][_0x14d2('0x6f')];return db[_0x14d2('0x70')][_0x14d2('0x41')](_0x24d26c,{'type':db[_0x14d2('0x71')]['QueryTypes'][_0x14d2('0x72')],'raw':!![]})['then'](function(_0x4adbb1){return _0x4adbb1;});})[_0x14d2('0x22')](function(_0x188a13){if(_0x188a13){_0x13c8ec[_0x14d2('0x28')]['contact']=_0x188a13[0x0];if(!_0x4d3c00['body'][_0x14d2('0x62')])return;return db['User']['find']({'where':{'id':_0x4d3c00[_0x14d2('0x5a')]['UserId'],'role':'agent'},'attributes':['id','name','fullname',_0x14d2('0x73'),_0x14d2('0x74')],'raw':!![]});}return null;})['then'](function(_0x267b06){if(!_0x267b06)return null;_0x13c8ec[_0x14d2('0x28')][_0x14d2('0x75')]=_0x267b06;return _0x13c8ec;})[_0x14d2('0x22')](function(_0x2a20f3){if(_0x2a20f3){if(_0x4d3c00[_0x14d2('0x5a')][_0x14d2('0x76')]){_0x13c8ec[_0x14d2('0x28')][_0x14d2('0x77')]=util[_0x14d2('0x61')](_0x14d2('0x78'),_0x4d3c00[_0x14d2('0x69')][_0x14d2('0x3a')]);_0x13c8ec[_0x14d2('0x28')]['channel']=_0x13c8ec[_0x14d2('0x79')];_0x13c8ec['message']['motionChannel']=_0x13c8ec['channel'];_0x13c8ec[_0x14d2('0x28')][_0x14d2('0x7a')]=_0x14d2('0x5d');return respondWithRpcPromise(_0x14d2('0x7b'),'EventManager',{'event':_0x14d2('0x7c'),'message':_0x13c8ec['message']},client9002)[_0x14d2('0x22')](function(){return _0x13c8ec;});}return _0x13c8ec;}return null;})[_0x14d2('0x22')](respondWithResult(_0x5c261e,null))['catch'](handleError(_0x5c261e,null));};var interaction_log=require(_0x14d2('0x15'))(_0x14d2('0x5c'));exports[_0x14d2('0x35')]=function(_0x58b5be,_0x23b2b8,_0x3c23f4){var _0x2fff2e={'agent':{},'channel':'fax'};if(_0x58b5be['body']['id']){delete _0x58b5be['body']['id'];}_0x58b5be[_0x14d2('0x5a')][_0x14d2('0x62')]=_0x58b5be[_0x14d2('0x5a')]['UserId']||_0x58b5be['user']['id'];_0x2fff2e[_0x14d2('0x75')]['id']=_0x58b5be[_0x14d2('0x5a')]['UserId'];return db['FaxMessage'][_0x14d2('0x59')]({'where':{'id':_0x58b5be[_0x14d2('0x53')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x23b2b8,null))[_0x14d2('0x22')](function(_0x31efe7){if(_0x31efe7){_0x2fff2e[_0x14d2('0x28')]=_0x31efe7[_0x14d2('0x63')]({'plain':!![]});return db['FaxInteraction'][_0x14d2('0x59')]({'where':{'id':_0x31efe7[_0x14d2('0x65')]}});}return null;})[_0x14d2('0x22')](handleEntityNotFound(_0x23b2b8,null))['then'](function(_0x36531c){if(_0x36531c){_0x2fff2e[_0x14d2('0x7d')]=_0x36531c[_0x14d2('0x63')]({'plain':!![]});interaction_log[_0x14d2('0x29')]('[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x58b5be[_0x14d2('0x69')]['id'],_0x58b5be['user'][_0x14d2('0x3a')],_0x58b5be[_0x14d2('0x69')]['role'],_0x2fff2e['interaction']['id'],_0x58b5be[_0x14d2('0x5a')]?JSON[_0x14d2('0x6a')](_0x58b5be[_0x14d2('0x5a')]):_0x14d2('0x6b'));return respondWithRpcPromise('RejectMessage',_0x14d2('0x7e'),_0x2fff2e);}return null;})[_0x14d2('0x22')](function(_0x24ecd7){var _0x4ed4b3=_0x14d2('0x6e')+_0x24ecd7[_0x14d2('0x28')][_0x14d2('0x6f')];return db['sequelize']['query'](_0x4ed4b3,{'type':db[_0x14d2('0x71')][_0x14d2('0x7f')][_0x14d2('0x72')],'raw':!![]})[_0x14d2('0x22')](function(_0x3165b2){return _0x3165b2;});})[_0x14d2('0x22')](function(_0x5056f7){if(_0x5056f7){_0x2fff2e[_0x14d2('0x28')][_0x14d2('0x80')]=_0x5056f7[0x0];if(!_0x58b5be[_0x14d2('0x5a')][_0x14d2('0x62')])return;return db[_0x14d2('0x81')][_0x14d2('0x59')]({'where':{'id':_0x58b5be['body'][_0x14d2('0x62')],'role':'agent'},'attributes':['id',_0x14d2('0x3a'),'fullname',_0x14d2('0x73'),'internal'],'raw':!![]});}return null;})[_0x14d2('0x22')](function(_0xf87de){if(!_0xf87de)return null;_0x2fff2e[_0x14d2('0x28')]['agent']=_0xf87de;return _0x2fff2e;})[_0x14d2('0x22')](function(_0x5cb01a){if(_0x5cb01a){_0x5cb01a[_0x14d2('0x28')]['interface']=util[_0x14d2('0x61')]('SIP/%s',_0x58b5be[_0x14d2('0x69')][_0x14d2('0x3a')]);_0x5cb01a[_0x14d2('0x28')][_0x14d2('0x79')]=_0x2fff2e[_0x14d2('0x79')];_0x5cb01a[_0x14d2('0x28')][_0x14d2('0x82')]=_0x2fff2e[_0x14d2('0x79')];_0x5cb01a[_0x14d2('0x28')]['event']=_0x14d2('0x35');respondWithRpcPromise(_0x14d2('0x7b'),_0x14d2('0x7b'),{'event':'rejectmessage','message':_0x5cb01a[_0x14d2('0x28')]},client9002);return _0x2fff2e;}return null;})[_0x14d2('0x22')](respondWithResult(_0x23b2b8,null))[_0x14d2('0x2b')](handleError(_0x23b2b8,null));};exports['create']=function(_0x39a1af,_0x574116){var _0x51ff89;return db[_0x14d2('0x3d')][_0x14d2('0x83')](_0x39a1af[_0x14d2('0x5a')],{})[_0x14d2('0x22')](function(_0x3971d2){_0x51ff89=_0x3971d2;return db[_0x14d2('0x84')][_0x14d2('0x85')]({'where':{'id':_0x51ff89[_0x14d2('0x6f')]}});})[_0x14d2('0x22')](function(_0xa319d2){if(_[_0x14d2('0x86')](_0xa319d2)){return;}else{_0x51ff89[_0x14d2('0x5e')]=_0xa319d2[_0x14d2('0x5e')];return db[_0x14d2('0x87')][_0x14d2('0x85')]({'where':{'id':_0x51ff89[_0x14d2('0x88')]}});}})['then'](function(_0x4d59ee){return respondWithRpcPromise(_0x14d2('0x89'),_0x14d2('0x89'),{'FaxAccountId':_['isNil'](_0x39a1af['body'])?undefined:_0x39a1af['body'][_0x14d2('0x8a')],'path':_[_0x14d2('0x86')](_0x4d59ee)?undefined:util['format']('/var/opt/motion2/server/files/attachments/%s',_0x4d59ee['basename']),'fax':_[_0x14d2('0x86')](_0x51ff89['fax'])?undefined:_0x51ff89[_0x14d2('0x5e')],'AttachmentId':_0x51ff89[_0x14d2('0x88')]},client9002);})[_0x14d2('0x22')](respondWithResult(_0x574116,0xc9))['catch'](handleError(_0x574116,null));};exports[_0x14d2('0x8b')]=function(_0x2611c0,_0x31f921){var _0x2fddd1=path['join'](config[_0x14d2('0x8c')],_0x14d2('0x8d'),_0x14d2('0x8e'),_0x14d2('0x8f'));return db['FaxMessage'][_0x14d2('0x59')]({'where':{'id':_0x2611c0[_0x14d2('0x53')]['id']},'include':[{'model':db['Attachment'],'as':'Attachment'}]})[_0x14d2('0x22')](handleEntityNotFound(_0x31f921,null))[_0x14d2('0x22')](function(_0xdf0875){if(_0xdf0875){return _0x31f921[_0x14d2('0x8b')](path[_0x14d2('0x90')](_0x2fddd1,_0xdf0875[_0x14d2('0x87')][_0x14d2('0x91')]));}})[_0x14d2('0x2b')](handleError(_0x31f921,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index 23ac9b7..bbc935c 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 _0xaf11=['setMaxListeners','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','FaxMessage'];(function(_0xaaf4cb,_0x41ad8f){var _0x333511=function(_0xbf7db6){while(--_0xbf7db6){_0xaaf4cb['push'](_0xaaf4cb['shift']());}};_0x333511(++_0x41ad8f);}(_0xaf11,0x12f));var _0x1af1=function(_0x241f1f,_0x30114a){_0x241f1f=_0x241f1f-0x0;var _0x3ea751=_0xaf11[_0x241f1f];return _0x3ea751;};'use strict';var EventEmitter=require(_0x1af1('0x0'));var FaxMessage=require(_0x1af1('0x1'))['db'][_0x1af1('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x1af1('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1af1('0x4'),'afterDestroy':_0x1af1('0x5')};function emitEvent(_0x28842d){return function(_0x53af48,_0xb0ace,_0x12eead){FaxMessageEvents[_0x1af1('0x6')](_0x28842d+':'+_0x53af48['id'],_0x53af48);FaxMessageEvents['emit'](_0x28842d,_0x53af48);_0x12eead(null);};}for(var e in events){if(events[_0x1af1('0x7')](e)){var event=events[e];FaxMessage['hook'](e,emitEvent(event));}}module[_0x1af1('0x8')]=FaxMessageEvents; \ No newline at end of file +var _0x87f1=['FaxMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','../../mysqldb'];(function(_0x125d65,_0x57b008){var _0x418391=function(_0x10ecf2){while(--_0x10ecf2){_0x125d65['push'](_0x125d65['shift']());}};_0x418391(++_0x57b008);}(_0x87f1,0x170));var _0x187f=function(_0x4f2bf2,_0x387ecd){_0x4f2bf2=_0x4f2bf2-0x0;var _0x447db=_0x87f1[_0x4f2bf2];return _0x447db;};'use strict';var EventEmitter=require('events');var FaxMessage=require(_0x187f('0x0'))['db'][_0x187f('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x187f('0x2')](0x0);var events={'afterCreate':_0x187f('0x3'),'afterUpdate':_0x187f('0x4'),'afterDestroy':_0x187f('0x5')};function emitEvent(_0x233cda){return function(_0x5eafdc,_0x19e8fb,_0x4c6db8){FaxMessageEvents[_0x187f('0x6')](_0x233cda+':'+_0x5eafdc['id'],_0x5eafdc);FaxMessageEvents['emit'](_0x233cda,_0x5eafdc);_0x4c6db8(null);};}for(var e in events){if(events[_0x187f('0x7')](e)){var event=events[e];FaxMessage['hook'](e,emitEvent(event));}}module[_0x187f('0x8')]=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index 6d23af6..48c89ae 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 _0xc9cd=['out','secret','isNil','UserId','FaxInteraction','findOne','FaxInteractionId','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','bluebird','path','rimraf','../../config/environment','./faxMessage.attributes','exports','define','FaxMessage','body','FULLTEXT','models','get','direction','toLowerCase'];(function(_0x531c45,_0x582a68){var _0x1c6cd0=function(_0x221b93){while(--_0x221b93){_0x531c45['push'](_0x531c45['shift']());}};_0x1c6cd0(++_0x582a68);}(_0xc9cd,0xc8));var _0xdc9c=function(_0x46ae5a,_0x2a38d0){_0x46ae5a=_0x46ae5a-0x0;var _0x434986=_0xc9cd[_0x46ae5a];return _0x434986;};'use strict';var _=require(_0xdc9c('0x0'));var util=require(_0xdc9c('0x1'));var logger=require('../../config/logger')(_0xdc9c('0x2'));var moment=require('moment');var BPromise=require(_0xdc9c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdc9c('0x4'));var rimraf=require(_0xdc9c('0x5'));var config=require(_0xdc9c('0x6'));var attributes=require(_0xdc9c('0x7'));module[_0xdc9c('0x8')]=function(_0x3e0cd5,_0x54c650){return _0x3e0cd5[_0xdc9c('0x9')](_0xdc9c('0xa'),attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':'fti_fax_messages','fields':[_0xdc9c('0xb')],'type':_0xdc9c('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x32e671,_0x38b492,_0x2400f8){var _0x374022=_0x3e0cd5[_0xdc9c('0xd')];var _0x3c9f94=_0x32e671[_0xdc9c('0xe')]({'plain':!![]});if(_0x3c9f94[_0xdc9c('0xf')][_0xdc9c('0x10')]()==='in'||_0x3c9f94[_0xdc9c('0xf')]['toLowerCase']()===_0xdc9c('0x11')&&!_0x3c9f94[_0xdc9c('0x12')]&&!_[_0xdc9c('0x13')](_0x3c9f94[_0xdc9c('0x14')])){_0x374022[_0xdc9c('0x15')][_0xdc9c('0x16')]({'where':{'id':_0x3c9f94[_0xdc9c('0x17')]}})[_0xdc9c('0x18')](function(_0x47f3a4){if(_0x47f3a4){_0x47f3a4[_0xdc9c('0x19')]({'lastMsgAt':_0x3c9f94[_0xdc9c('0x1a')],'lastMsgDirection':_0x3c9f94['direction'][_0xdc9c('0x10')]()});}})[_0xdc9c('0x1b')](function(_0x20aa28){console[_0xdc9c('0x1c')](_0x20aa28);});}_0x2400f8();}},'charset':_0xdc9c('0x1d'),'collate':_0xdc9c('0x1e')});}; \ No newline at end of file +var _0x1559=['./faxMessage.attributes','define','fax_messages','body','FULLTEXT','models','get','toLowerCase','direction','secret','isNil','FaxInteraction','findOne','then','update','catch','error','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x1559,0x16f));var _0x9155=function(_0x334763,_0x575eff){_0x334763=_0x334763-0x0;var _0x566db0=_0x1559[_0x334763];return _0x566db0;};'use strict';var _=require(_0x9155('0x0'));var util=require(_0x9155('0x1'));var logger=require(_0x9155('0x2'))('api');var moment=require(_0x9155('0x3'));var BPromise=require('bluebird');var rp=require(_0x9155('0x4'));var fs=require('fs');var path=require(_0x9155('0x5'));var rimraf=require(_0x9155('0x6'));var config=require(_0x9155('0x7'));var attributes=require(_0x9155('0x8'));module['exports']=function(_0x3fe33f,_0x4155ab){return _0x3fe33f[_0x9155('0x9')]('FaxMessage',attributes,{'tableName':_0x9155('0xa'),'paranoid':![],'indexes':[{'name':'fti_fax_messages','fields':[_0x9155('0xb')],'type':_0x9155('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xcb1df9,_0x28dba0,_0x42321b){var _0x8e1100=_0x3fe33f[_0x9155('0xd')];var _0x569972=_0xcb1df9[_0x9155('0xe')]({'plain':!![]});if(_0x569972['direction'][_0x9155('0xf')]()==='in'||_0x569972[_0x9155('0x10')][_0x9155('0xf')]()==='out'&&!_0x569972[_0x9155('0x11')]&&!_[_0x9155('0x12')](_0x569972['UserId'])){_0x8e1100[_0x9155('0x13')][_0x9155('0x14')]({'where':{'id':_0x569972['FaxInteractionId']}})[_0x9155('0x15')](function(_0x2b9959){if(_0x2b9959){_0x2b9959[_0x9155('0x16')]({'lastMsgAt':_0x569972['createdAt'],'lastMsgDirection':_0x569972[_0x9155('0x10')][_0x9155('0xf')]()});}})[_0x9155('0x17')](function(_0x42ad0b){console[_0x9155('0x18')](_0x42ad0b);});}_0x42321b();}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index f2e8246..981758b 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 _0x668b=['./faxMessage.socket','register','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateFaxMessage','FaxMessage','create','body','raw','UpdateFaxMessage','update','options','where','attributes','limit','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost'];(function(_0x35ab84,_0x5ac05e){var _0x41147c=function(_0x16636c){while(--_0x16636c){_0x35ab84['push'](_0x35ab84['shift']());}};_0x41147c(++_0x5ac05e);}(_0x668b,0x140));var _0xb668=function(_0x38854e,_0x23cbc9){_0x38854e=_0x38854e-0x0;var _0x3f8415=_0x668b[_0x38854e];return _0x3f8415;};'use strict';var _=require(_0xb668('0x0'));var util=require(_0xb668('0x1'));var moment=require('moment');var BPromise=require(_0xb668('0x2'));var rs=require(_0xb668('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb668('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb668('0x5'))(_0xb668('0x6'));var config=require(_0xb668('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xb668('0x8')][_0xb668('0x9')]({'port':0x232a});config[_0xb668('0xa')]=_[_0xb668('0xb')](config[_0xb668('0xa')],{'host':_0xb668('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb668('0xa')]));require(_0xb668('0xd'))[_0xb668('0xe')](socket);function respondWithRpcPromise(_0x16d50d,_0x39b79c,_0x3606a7){return new BPromise(function(_0x45bc39,_0x3616e9){return client['request'](_0x16d50d,_0x3606a7)[_0xb668('0xf')](function(_0x27dbf7){logger[_0xb668('0x10')](_0xb668('0x11'),_0x39b79c,_0xb668('0x12'));logger[_0xb668('0x13')](_0xb668('0x14'),_0x39b79c,_0xb668('0x12'),JSON[_0xb668('0x15')](_0x27dbf7));if(_0x27dbf7[_0xb668('0x16')]){if(_0x27dbf7[_0xb668('0x16')][_0xb668('0x17')]===0x1f4){logger[_0xb668('0x16')](_0xb668('0x11'),_0x39b79c,_0x27dbf7[_0xb668('0x16')][_0xb668('0x18')]);return _0x3616e9(_0x27dbf7[_0xb668('0x16')][_0xb668('0x18')]);}logger[_0xb668('0x16')](_0xb668('0x11'),_0x39b79c,_0x27dbf7[_0xb668('0x16')][_0xb668('0x18')]);return _0x45bc39(_0x27dbf7['error'][_0xb668('0x18')]);}else{logger['info'](_0xb668('0x11'),_0x39b79c,_0xb668('0x12'));_0x45bc39(_0x27dbf7['result'][_0xb668('0x18')]);}})[_0xb668('0x19')](function(_0x53ff78){logger[_0xb668('0x16')]('FaxMessage,\x20%s,\x20%s',_0x39b79c,_0x53ff78);_0x3616e9(_0x53ff78);});});}exports[_0xb668('0x1a')]=function(_0x178a5d){var _0x253ba5=this;return new Promise(function(_0x12805a,_0x5d33ae){return db[_0xb668('0x1b')][_0xb668('0x1c')](_0x178a5d[_0xb668('0x1d')],{'raw':_0x178a5d['options']?_0x178a5d['options'][_0xb668('0x1e')]===undefined?!![]:![]:!![]})[_0xb668('0xf')](function(_0x517eee){logger[_0xb668('0x10')]('CreateFaxMessage',_0x178a5d);logger[_0xb668('0x13')]('CreateFaxMessage',_0x178a5d,JSON[_0xb668('0x15')](_0x517eee));_0x12805a(_0x517eee);})[_0xb668('0x19')](function(_0x3f84c7){logger[_0xb668('0x16')](_0xb668('0x1a'),_0x3f84c7[_0xb668('0x18')],_0x178a5d);_0x5d33ae(_0x253ba5['error'](0x1f4,_0x3f84c7[_0xb668('0x18')]));});});};exports[_0xb668('0x1f')]=function(_0x2ab8c2){var _0x49abfd=this;return new Promise(function(_0x5e0cee,_0xe62fce){return db[_0xb668('0x1b')][_0xb668('0x20')](_0x2ab8c2['body'],{'raw':_0x2ab8c2[_0xb668('0x21')]?_0x2ab8c2[_0xb668('0x21')][_0xb668('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2ab8c2['options']?_0x2ab8c2['options'][_0xb668('0x22')]||null:null,'attributes':_0x2ab8c2[_0xb668('0x21')]?_0x2ab8c2['options'][_0xb668('0x23')]||null:null,'limit':_0x2ab8c2[_0xb668('0x21')]?_0x2ab8c2[_0xb668('0x21')][_0xb668('0x24')]||null:null})[_0xb668('0xf')](function(_0x5f36b5){logger[_0xb668('0x10')](_0xb668('0x1f'),_0x2ab8c2);logger['debug'](_0xb668('0x1f'),_0x2ab8c2,JSON['stringify'](_0x5f36b5));_0x5e0cee(_0x5f36b5);})[_0xb668('0x19')](function(_0x406cc5){logger[_0xb668('0x16')](_0xb668('0x1f'),_0x406cc5[_0xb668('0x18')],_0x2ab8c2);_0xe62fce(_0x49abfd[_0xb668('0x16')](0x1f4,_0x406cc5[_0xb668('0x18')]));});});}; \ No newline at end of file +var _0x55e0=['moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','localhost','socket.io-emitter','./faxMessage.socket','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateFaxMessage','FaxMessage','create','body','options','raw','then','UpdateFaxMessage','update','where','attributes','limit','lodash','util'];(function(_0x125dea,_0x495f42){var _0x4a9aa6=function(_0x416805){while(--_0x416805){_0x125dea['push'](_0x125dea['shift']());}};_0x4a9aa6(++_0x495f42);}(_0x55e0,0xdc));var _0x055e=function(_0x49c4c8,_0x382d40){_0x49c4c8=_0x49c4c8-0x0;var _0x5dac8c=_0x55e0[_0x49c4c8];return _0x5dac8c;};'use strict';var _=require(_0x055e('0x0'));var util=require(_0x055e('0x1'));var moment=require(_0x055e('0x2'));var BPromise=require(_0x055e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x055e('0x4'))['db'];var utils=require(_0x055e('0x5'));var logger=require(_0x055e('0x6'))(_0x055e('0x7'));var config=require(_0x055e('0x8'));var jayson=require(_0x055e('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x055e('0xa')]=_['defaults'](config[_0x055e('0xa')],{'host':_0x055e('0xb'),'port':0x18eb});var socket=require(_0x055e('0xc'))(new Redis(config[_0x055e('0xa')]));require(_0x055e('0xd'))['register'](socket);function respondWithRpcPromise(_0x40779c,_0xd67814,_0xb816c){return new BPromise(function(_0xa0d384,_0x238068){return client['request'](_0x40779c,_0xb816c)['then'](function(_0x187cce){logger['info'](_0x055e('0xe'),_0xd67814,_0x055e('0xf'));logger[_0x055e('0x10')](_0x055e('0x11'),_0xd67814,_0x055e('0xf'),JSON[_0x055e('0x12')](_0x187cce));if(_0x187cce[_0x055e('0x13')]){if(_0x187cce['error'][_0x055e('0x14')]===0x1f4){logger[_0x055e('0x13')](_0x055e('0xe'),_0xd67814,_0x187cce[_0x055e('0x13')][_0x055e('0x15')]);return _0x238068(_0x187cce['error'][_0x055e('0x15')]);}logger[_0x055e('0x13')](_0x055e('0xe'),_0xd67814,_0x187cce['error'][_0x055e('0x15')]);return _0xa0d384(_0x187cce[_0x055e('0x13')][_0x055e('0x15')]);}else{logger[_0x055e('0x16')](_0x055e('0xe'),_0xd67814,'request\x20sent');_0xa0d384(_0x187cce[_0x055e('0x17')][_0x055e('0x15')]);}})[_0x055e('0x18')](function(_0x2ed6fb){logger['error'](_0x055e('0xe'),_0xd67814,_0x2ed6fb);_0x238068(_0x2ed6fb);});});}exports[_0x055e('0x19')]=function(_0x58e44a){var _0xe2b7b5=this;return new Promise(function(_0x4412f9,_0x10258f){return db[_0x055e('0x1a')][_0x055e('0x1b')](_0x58e44a[_0x055e('0x1c')],{'raw':_0x58e44a['options']?_0x58e44a[_0x055e('0x1d')][_0x055e('0x1e')]===undefined?!![]:![]:!![]})[_0x055e('0x1f')](function(_0x5930ff){logger[_0x055e('0x16')](_0x055e('0x19'),_0x58e44a);logger[_0x055e('0x10')](_0x055e('0x19'),_0x58e44a,JSON['stringify'](_0x5930ff));_0x4412f9(_0x5930ff);})[_0x055e('0x18')](function(_0x56c372){logger[_0x055e('0x13')](_0x055e('0x19'),_0x56c372[_0x055e('0x15')],_0x58e44a);_0x10258f(_0xe2b7b5[_0x055e('0x13')](0x1f4,_0x56c372[_0x055e('0x15')]));});});};exports[_0x055e('0x20')]=function(_0x58caf9){var _0x2fb49b=this;return new Promise(function(_0x1f90a9,_0x2a82f8){return db['FaxMessage'][_0x055e('0x21')](_0x58caf9[_0x055e('0x1c')],{'raw':_0x58caf9[_0x055e('0x1d')]?_0x58caf9[_0x055e('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x58caf9[_0x055e('0x1d')]?_0x58caf9['options'][_0x055e('0x22')]||null:null,'attributes':_0x58caf9[_0x055e('0x1d')]?_0x58caf9[_0x055e('0x1d')][_0x055e('0x23')]||null:null,'limit':_0x58caf9[_0x055e('0x1d')]?_0x58caf9['options'][_0x055e('0x24')]||null:null})[_0x055e('0x1f')](function(_0x293062){logger[_0x055e('0x16')](_0x055e('0x20'),_0x58caf9);logger[_0x055e('0x10')](_0x055e('0x20'),_0x58caf9,JSON[_0x055e('0x12')](_0x293062));_0x1f90a9(_0x293062);})['catch'](function(_0x26d1c2){logger[_0x055e('0x13')]('UpdateFaxMessage',_0x26d1c2[_0x055e('0x15')],_0x58caf9);_0x2a82f8(_0x2fb49b[_0x055e('0x13')](0x1f4,_0x26d1c2[_0x055e('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index 268f69f..53d9a5e 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 _0xf596=['remove','update','emit','removeListener','register','faxMessage:','./faxMessage.events'];(function(_0x1ce7cf,_0x1706be){var _0x38fe5a=function(_0x55c697){while(--_0x55c697){_0x1ce7cf['push'](_0x1ce7cf['shift']());}};_0x38fe5a(++_0x1706be);}(_0xf596,0xa7));var _0x6f59=function(_0x69d5f7,_0x4a8637){_0x69d5f7=_0x69d5f7-0x0;var _0x27fb58=_0xf596[_0x69d5f7];return _0x27fb58;};'use strict';var FaxMessageEvents=require(_0x6f59('0x0'));var events=['save',_0x6f59('0x1'),_0x6f59('0x2')];function createListener(_0x2a52a3,_0x25e9ce){return function(_0x231704){_0x25e9ce[_0x6f59('0x3')](_0x2a52a3,_0x231704);};}function removeListener(_0x44bc11,_0x1346aa){return function(){FaxMessageEvents[_0x6f59('0x4')](_0x44bc11,_0x1346aa);};}exports[_0x6f59('0x5')]=function(_0x5d0e52){for(var _0x560d56=0x0,_0x2156ff=events['length'];_0x560d56<_0x2156ff;_0x560d56++){var _0x4ce470=events[_0x560d56];var _0x15e841=createListener(_0x6f59('0x6')+_0x4ce470,_0x5d0e52);FaxMessageEvents['on'](_0x4ce470,_0x15e841);}}; \ No newline at end of file +var _0x4f0b=['register','length','faxMessage:','update','emit','removeListener'];(function(_0x590a3a,_0xd9db9){var _0x49017f=function(_0x1d92e9){while(--_0x1d92e9){_0x590a3a['push'](_0x590a3a['shift']());}};_0x49017f(++_0xd9db9);}(_0x4f0b,0x1b9));var _0xb4f0=function(_0x373671,_0x3566b5){_0x373671=_0x373671-0x0;var _0x2c5372=_0x4f0b[_0x373671];return _0x2c5372;};'use strict';var FaxMessageEvents=require('./faxMessage.events');var events=['save','remove',_0xb4f0('0x0')];function createListener(_0x188dc8,_0x67d89d){return function(_0x5c9073){_0x67d89d[_0xb4f0('0x1')](_0x188dc8,_0x5c9073);};}function removeListener(_0x56111a,_0x2b783d){return function(){FaxMessageEvents[_0xb4f0('0x2')](_0x56111a,_0x2b783d);};}exports[_0xb4f0('0x3')]=function(_0x54799d){for(var _0x1cc37e=0x0,_0x9974ec=events[_0xb4f0('0x4')];_0x1cc37e<_0x9974ec;_0x1cc37e++){var _0x59c5f4=events[_0x1cc37e];var _0x1ade2b=createListener(_0xb4f0('0x5')+_0x59c5f4,_0x54799d);FaxMessageEvents['on'](_0x59c5f4,_0x1ade2b);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index 219e041..f20f0df 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 _0x3c81=['show','/:id/download','download','post','tracked','fax','faxmessage:create','create','put','update','/:id/accept','accept','reject','destroy','exports','multer','util','connect-timeout','express','../../config/environment','./faxMessage.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x3db712,_0x2b5b30){var _0x4b4e6b=function(_0x2b1bfb){while(--_0x2b1bfb){_0x3db712['push'](_0x3db712['shift']());}};_0x4b4e6b(++_0x2b5b30);}(_0x3c81,0x102));var _0x13c8=function(_0x3bb8cb,_0x42ab45){_0x3bb8cb=_0x3bb8cb-0x0;var _0x4240d8=_0x3c81[_0x3bb8cb];return _0x4240d8;};'use strict';var multer=require(_0x13c8('0x0'));var util=require(_0x13c8('0x1'));var path=require('path');var timeout=require(_0x13c8('0x2'));var express=require(_0x13c8('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x13c8('0x4'));var controller=require(_0x13c8('0x5'));router[_0x13c8('0x6')]('/',auth[_0x13c8('0x7')](),controller[_0x13c8('0x8')]);router[_0x13c8('0x6')](_0x13c8('0x9'),auth['isAuthenticated'](),controller[_0x13c8('0xa')]);router['get'](_0x13c8('0xb'),auth[_0x13c8('0x7')](),controller[_0x13c8('0xc')]);router[_0x13c8('0x6')](_0x13c8('0xd'),auth[_0x13c8('0x7')](),controller[_0x13c8('0xe')]);router[_0x13c8('0xf')]('/',auth[_0x13c8('0x7')](),interaction[_0x13c8('0x10')](_0x13c8('0x11'),_0x13c8('0x12')),controller[_0x13c8('0x13')]);router[_0x13c8('0x14')]('/:id',auth[_0x13c8('0x7')](),controller[_0x13c8('0x15')]);router[_0x13c8('0x14')](_0x13c8('0x16'),auth['isAuthenticated'](),controller[_0x13c8('0x17')]);router['put']('/:id/reject',auth['isAuthenticated'](),controller[_0x13c8('0x18')]);router['delete'](_0x13c8('0xb'),auth[_0x13c8('0x7')](),controller[_0x13c8('0x19')]);module[_0x13c8('0x1a')]=router; \ No newline at end of file +var _0x2e54=['download','post','fax','faxmessage:create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download'];(function(_0x4d7a61,_0x3fb6e6){var _0x186f73=function(_0x4eeeeb){while(--_0x4eeeeb){_0x4d7a61['push'](_0x4d7a61['shift']());}};_0x186f73(++_0x3fb6e6);}(_0x2e54,0x1dd));var _0x42e5=function(_0x6e024e,_0x11bf6d){_0x6e024e=_0x6e024e-0x0;var _0x4dd0d9=_0x2e54[_0x6e024e];return _0x4dd0d9;};'use strict';var multer=require(_0x42e5('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x42e5('0x1'));var express=require(_0x42e5('0x2'));var router=express[_0x42e5('0x3')]();var fs_extra=require(_0x42e5('0x4'));var auth=require(_0x42e5('0x5'));var interaction=require(_0x42e5('0x6'));var config=require(_0x42e5('0x7'));var controller=require('./faxMessage.controller');router[_0x42e5('0x8')]('/',auth[_0x42e5('0x9')](),controller[_0x42e5('0xa')]);router['get'](_0x42e5('0xb'),auth['isAuthenticated'](),controller[_0x42e5('0xc')]);router['get'](_0x42e5('0xd'),auth[_0x42e5('0x9')](),controller[_0x42e5('0xe')]);router[_0x42e5('0x8')](_0x42e5('0xf'),auth[_0x42e5('0x9')](),controller[_0x42e5('0x10')]);router[_0x42e5('0x11')]('/',auth[_0x42e5('0x9')](),interaction['tracked'](_0x42e5('0x12'),_0x42e5('0x13')),controller['create']);router[_0x42e5('0x14')](_0x42e5('0xd'),auth[_0x42e5('0x9')](),controller[_0x42e5('0x15')]);router[_0x42e5('0x14')](_0x42e5('0x16'),auth[_0x42e5('0x9')](),controller[_0x42e5('0x17')]);router[_0x42e5('0x14')](_0x42e5('0x18'),auth['isAuthenticated'](),controller[_0x42e5('0x19')]);router[_0x42e5('0x1a')](_0x42e5('0xd'),auth[_0x42e5('0x9')](),controller[_0x42e5('0x1b')]);module[_0x42e5('0x1c')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index 38432cd..eb9773e 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 _0xcfa8=['exports','name','STRING','INTEGER','ENUM','beepall','sequelize'];(function(_0x50175e,_0x354248){var _0x232fb2=function(_0x739897){while(--_0x739897){_0x50175e['push'](_0x50175e['shift']());}};_0x232fb2(++_0x354248);}(_0xcfa8,0xdf));var _0x8cfa=function(_0x306420,_0x302471){_0x306420=_0x306420-0x0;var _0x5d38d3=_0xcfa8[_0x306420];return _0x5d38d3;};'use strict';var Sequelize=require(_0x8cfa('0x0'));module[_0x8cfa('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x8cfa('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x8cfa('0x3')]},'timeout':{'type':Sequelize[_0x8cfa('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x8cfa('0x5')]('rrmemory',_0x8cfa('0x6'),'roundrobin'),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x8cfa('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x7dbe=['ENUM','beepall','roundrobin','sequelize','STRING','INTEGER'];(function(_0x3e9881,_0xfa4ff4){var _0x3fb063=function(_0x461821){while(--_0x461821){_0x3e9881['push'](_0x3e9881['shift']());}};_0x3fb063(++_0xfa4ff4);}(_0x7dbe,0x183));var _0xe7db=function(_0x40258c,_0x32939e){_0x40258c=_0x40258c-0x0;var _0x2a6e7b=_0x7dbe[_0x40258c];return _0x2a6e7b;};'use strict';var Sequelize=require(_0xe7db('0x0'));module['exports']={'name':{'type':Sequelize[_0xe7db('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xe7db('0x2')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xe7db('0x3')]('rrmemory',_0xe7db('0x4'),_0xe7db('0x5')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xe7db('0x2')],'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 b9e0895..e222c2d 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 _0x2030=['options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','rawAttributes','hasOwnProperty','UserFaxQueue','findAndCountAll','UserId','agent','faxPause','updatedAt','format','%s/%s','SIP','createdAt','getTeams','Team','addTeams','User','Agents','online','voicePause','interface','flatMap','each','findOrCreate','forEach','emit','userFaxQueue:save','removeTeams','ids','select','field','tq.TeamId','join','user_has_teams','push','sequelize','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','transaction','isEmpty','removeAgents','userFaxQueue:remove','addAgents','omit','isArray','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','get','FaxQueues','UserProfileResource','error','stack','name','index','map','FaxQueue','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','where','merge','VIRTUAL','filter'];(function(_0x360a3f,_0x6adf05){var _0x35af46=function(_0x80c63f){while(--_0x80c63f){_0x360a3f['push'](_0x360a3f['shift']());}};_0x35af46(++_0x6adf05);}(_0x2030,0xd9));var _0x0203=function(_0x55e755,_0x1c2cf2){_0x55e755=_0x55e755-0x0;var _0x329aab=_0x2030[_0x55e755];return _0x329aab;};'use strict';var emlformat=require(_0x0203('0x0'));var rimraf=require(_0x0203('0x1'));var zipdir=require(_0x0203('0x2'));var jsonpatch=require(_0x0203('0x3'));var rp=require(_0x0203('0x4'));var moment=require(_0x0203('0x5'));var BPromise=require(_0x0203('0x6'));var Mustache=require(_0x0203('0x7'));var util=require('util');var path=require(_0x0203('0x8'));var sox=require(_0x0203('0x9'));var csv=require(_0x0203('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0203('0xb'));var _=require(_0x0203('0xc'));var squel=require(_0x0203('0xd'));var crypto=require(_0x0203('0xe'));var jsforce=require(_0x0203('0xf'));var deskjs=require(_0x0203('0x10'));var toCsv=require(_0x0203('0xa'));var querystring=require('querystring');var Papa=require(_0x0203('0x11'));var Redis=require('ioredis');var authService=require(_0x0203('0x12'));var qs=require(_0x0203('0x13'));var as=require(_0x0203('0x14'));var hardwareService=require(_0x0203('0x15'));var logger=require(_0x0203('0x16'))(_0x0203('0x17'));var utils=require(_0x0203('0x18'));var config=require(_0x0203('0x19'));var licenseUtil=require(_0x0203('0x1a'));var db=require('../../mysqldb')['db'];config[_0x0203('0x1b')]=_[_0x0203('0x1c')](config[_0x0203('0x1b')],{'host':_0x0203('0x1d'),'port':0x18eb});var socket=require(_0x0203('0x1e'))(new Redis(config[_0x0203('0x1b')]));require('./faxQueue.socket')[_0x0203('0x1f')](socket);function respondWithStatusCode(_0x552bd1,_0x3d1fcd){_0x3d1fcd=_0x3d1fcd||0xcc;return function(_0x20cc48){if(_0x20cc48){return _0x552bd1[_0x0203('0x20')](_0x3d1fcd);}return _0x552bd1[_0x0203('0x21')](_0x3d1fcd)[_0x0203('0x22')]();};}function respondWithResult(_0x2e423d,_0x2f970d){_0x2f970d=_0x2f970d||0xc8;return function(_0xa27e55){if(_0xa27e55){return _0x2e423d[_0x0203('0x21')](_0x2f970d)['json'](_0xa27e55);}};}function respondWithFilteredResult(_0x1bca43,_0x41f775){return function(_0x53083a){if(_0x53083a){var _0x2a3bf9=typeof _0x41f775[_0x0203('0x23')]===_0x0203('0x24')&&typeof _0x41f775[_0x0203('0x25')]==='undefined';var _0x2adf98=_0x53083a[_0x0203('0x26')];var _0x573710=_0x2a3bf9?0x0:_0x41f775[_0x0203('0x23')];var _0x2673ea=_0x2a3bf9?_0x53083a[_0x0203('0x26')]:_0x41f775[_0x0203('0x23')]+_0x41f775['limit'];var _0x10cac7;if(_0x2673ea>=_0x2adf98){_0x2673ea=_0x2adf98;_0x10cac7=0xc8;}else{_0x10cac7=0xce;}_0x1bca43['status'](_0x10cac7);return _0x1bca43[_0x0203('0x27')](_0x0203('0x28'),_0x573710+'-'+_0x2673ea+'/'+_0x2adf98)[_0x0203('0x29')](_0x53083a);}return null;};}function patchUpdates(_0x35c1af){return function(_0x45e37b){try{jsonpatch[_0x0203('0x2a')](_0x45e37b,_0x35c1af,!![]);}catch(_0x579553){return BPromise[_0x0203('0x2b')](_0x579553);}return _0x45e37b[_0x0203('0x2c')]();};}function saveUpdates(_0x915aac,_0x2f2960){return function(_0x52d2fd){if(_0x52d2fd){return _0x52d2fd[_0x0203('0x2d')](_0x915aac)[_0x0203('0x2e')](function(_0x4145b2){return _0x4145b2;});}return null;};}function removeEntity(_0x269586,_0x5ab4ca){return function(_0x4b6493){if(_0x4b6493){return _0x4b6493[_0x0203('0x2f')]()[_0x0203('0x2e')](function(){var _0x4818b7=_0x4b6493[_0x0203('0x30')]({'plain':!![]});var _0x1ab7e5=_0x0203('0x31');return db[_0x0203('0x32')]['destroy']({'where':{'type':_0x1ab7e5,'resourceId':_0x4818b7['id']}})['then'](function(){return _0x4b6493;});})[_0x0203('0x2e')](function(){_0x269586['status'](0xcc)[_0x0203('0x22')]();});}};}function handleEntityNotFound(_0x52c8cc,_0xb8ecb5){return function(_0x2762c0){if(!_0x2762c0){_0x52c8cc[_0x0203('0x20')](0x194);}return _0x2762c0;};}function handleError(_0x2da956,_0x74f752){_0x74f752=_0x74f752||0x1f4;return function(_0x4e65ba){logger[_0x0203('0x33')](_0x4e65ba[_0x0203('0x34')]);if(_0x4e65ba[_0x0203('0x35')]){delete _0x4e65ba[_0x0203('0x35')];}_0x2da956['status'](_0x74f752)['send'](_0x4e65ba);};}exports[_0x0203('0x36')]=function(_0x43c503,_0x5d1493){var _0x153906={},_0x53f016={},_0x273568={'count':0x0,'rows':[]};var _0x15c838=_[_0x0203('0x37')](db[_0x0203('0x38')]['rawAttributes'],function(_0x136aad){return{'name':_0x136aad[_0x0203('0x39')],'type':_0x136aad['type'][_0x0203('0x3a')]};});_0x53f016[_0x0203('0x3b')]=_[_0x0203('0x37')](_0x15c838,'name');_0x53f016[_0x0203('0x3c')]=_[_0x0203('0x3d')](_0x43c503['query']);_0x53f016[_0x0203('0x3e')]=_[_0x0203('0x3f')](_0x53f016[_0x0203('0x3b')],_0x53f016[_0x0203('0x3c')]);_0x153906[_0x0203('0x40')]=_[_0x0203('0x3f')](_0x53f016[_0x0203('0x3b')],qs[_0x0203('0x41')](_0x43c503['query']['fields']));_0x153906[_0x0203('0x40')]=_0x153906[_0x0203('0x40')][_0x0203('0x42')]?_0x153906['attributes']:_0x53f016['model'];if(!_0x43c503[_0x0203('0x3c')]['hasOwnProperty'](_0x0203('0x43'))){_0x153906[_0x0203('0x25')]=qs[_0x0203('0x25')](_0x43c503['query'][_0x0203('0x25')]);_0x153906[_0x0203('0x23')]=qs[_0x0203('0x23')](_0x43c503['query'][_0x0203('0x23')]);}_0x153906[_0x0203('0x44')]=qs[_0x0203('0x45')](_0x43c503[_0x0203('0x3c')][_0x0203('0x45')]);_0x153906['where']=qs[_0x0203('0x3e')](_[_0x0203('0x46')](_0x43c503[_0x0203('0x3c')],_0x53f016[_0x0203('0x3e')]),_0x15c838);if(_0x43c503[_0x0203('0x3c')]['filter']){_0x153906[_0x0203('0x47')]=_[_0x0203('0x48')](_0x153906['where'],{'$or':_[_0x0203('0x37')](_0x15c838,function(_0x783a8f){if(_0x783a8f['type']!==_0x0203('0x49')){var _0x446871={};_0x446871[_0x783a8f['name']]={'$like':'%'+_0x43c503[_0x0203('0x3c')][_0x0203('0x4a')]+'%'};return _0x446871;}})});}_0x153906=_['merge']({},_0x153906,_0x43c503[_0x0203('0x4b')]);var _0x25d358={'where':_0x153906['where']};return db[_0x0203('0x38')][_0x0203('0x26')](_0x25d358)[_0x0203('0x2e')](function(_0x201fb6){_0x273568[_0x0203('0x26')]=_0x201fb6;if(_0x43c503[_0x0203('0x3c')][_0x0203('0x4c')]){_0x153906[_0x0203('0x4d')]=[{'all':!![]}];}return db[_0x0203('0x38')][_0x0203('0x4e')](_0x153906);})['then'](function(_0x1d17d2){_0x273568[_0x0203('0x4f')]=_0x1d17d2;return _0x273568;})[_0x0203('0x2e')](respondWithFilteredResult(_0x5d1493,_0x153906))[_0x0203('0x50')](handleError(_0x5d1493,null));};exports[_0x0203('0x51')]=function(_0xa50cb7,_0x14c412){var _0x2bd808={'raw':!![],'where':{'id':_0xa50cb7[_0x0203('0x52')]['id']}},_0x4cf1c4={};_0x4cf1c4[_0x0203('0x3b')]=_[_0x0203('0x3d')](db[_0x0203('0x38')]['rawAttributes']);_0x4cf1c4['query']=_[_0x0203('0x3d')](_0xa50cb7[_0x0203('0x3c')]);_0x4cf1c4[_0x0203('0x3e')]=_[_0x0203('0x3f')](_0x4cf1c4[_0x0203('0x3b')],_0x4cf1c4[_0x0203('0x3c')]);_0x2bd808[_0x0203('0x40')]=_['intersection'](_0x4cf1c4['model'],qs[_0x0203('0x41')](_0xa50cb7[_0x0203('0x3c')][_0x0203('0x41')]));_0x2bd808[_0x0203('0x40')]=_0x2bd808[_0x0203('0x40')]['length']?_0x2bd808[_0x0203('0x40')]:_0x4cf1c4[_0x0203('0x3b')];if(_0xa50cb7[_0x0203('0x3c')]['includeAll']){_0x2bd808[_0x0203('0x4d')]=[{'all':!![]}];}_0x2bd808=_[_0x0203('0x48')]({},_0x2bd808,_0xa50cb7['options']);return db['FaxQueue'][_0x0203('0x53')](_0x2bd808)[_0x0203('0x2e')](handleEntityNotFound(_0x14c412,null))['then'](respondWithResult(_0x14c412,null))[_0x0203('0x50')](handleError(_0x14c412,null));};exports[_0x0203('0x54')]=function(_0x149646,_0xb880cf){return db['FaxQueue'][_0x0203('0x54')](_0x149646[_0x0203('0x55')],{})[_0x0203('0x2e')](function(_0xbf1c57){var _0x4026d0=_0x149646[_0x0203('0x56')][_0x0203('0x30')]({'plain':!![]});if(!_0x4026d0)throw new Error(_0x0203('0x57'));if(_0x4026d0[_0x0203('0x58')]===_0x0203('0x56')){var _0x4eda22=_0xbf1c57[_0x0203('0x30')]({'plain':!![]});var _0x14a36f=_0x0203('0x31');return db[_0x0203('0x59')]['find']({'where':{'name':_0x14a36f,'userProfileId':_0x4026d0[_0x0203('0x5a')]},'raw':!![]})['then'](function(_0x362ffa){if(_0x362ffa&&_0x362ffa[_0x0203('0x5b')]===0x0){return db[_0x0203('0x32')]['create']({'name':_0x4eda22[_0x0203('0x35')],'resourceId':_0x4eda22['id'],'type':_0x362ffa[_0x0203('0x35')],'sectionId':_0x362ffa['id']},{})['then'](function(){return _0xbf1c57;});}else{return _0xbf1c57;}})['catch'](function(_0x34941a){logger[_0x0203('0x33')](_0x0203('0x5c'),_0x34941a);throw _0x34941a;});}return _0xbf1c57;})['then'](respondWithResult(_0xb880cf,0xc9))[_0x0203('0x50')](handleError(_0xb880cf,null));};exports[_0x0203('0x2d')]=function(_0x32010f,_0x2949b4){if(_0x32010f[_0x0203('0x55')]['id']){delete _0x32010f[_0x0203('0x55')]['id'];}return db['FaxQueue'][_0x0203('0x53')]({'where':{'id':_0x32010f['params']['id']}})['then'](handleEntityNotFound(_0x2949b4,null))['then'](saveUpdates(_0x32010f[_0x0203('0x55')],null))['then'](respondWithResult(_0x2949b4,null))['catch'](handleError(_0x2949b4,null));};exports[_0x0203('0x2f')]=function(_0xfd6dc0,_0x17f2a9){return db[_0x0203('0x38')][_0x0203('0x53')]({'where':{'id':_0xfd6dc0[_0x0203('0x52')]['id']}})[_0x0203('0x2e')](handleEntityNotFound(_0x17f2a9,null))['then'](removeEntity(_0x17f2a9,null))[_0x0203('0x50')](handleError(_0x17f2a9,null));};exports['describe']=function(_0x8136eb,_0x3eda95){return db[_0x0203('0x38')][_0x0203('0x5d')]()[_0x0203('0x2e')](respondWithResult(_0x3eda95,null))[_0x0203('0x50')](handleError(_0x3eda95,null));};exports['getMembers']=function(_0xa8b205,_0x52bb3b,_0x210535){var _0x4ea3ea={'raw':!![],'where':{}},_0x49ecde={},_0x512d7f;return db[_0x0203('0x38')][_0x0203('0x5e')]({'where':{'id':_0xa8b205[_0x0203('0x52')]['id']}})['then'](handleEntityNotFound(_0x52bb3b,null))[_0x0203('0x2e')](function(_0x20df39){if(_0x20df39){_0x512d7f=_0x20df39[_0x0203('0x30')]({'plain':!![]});_0x49ecde[_0x0203('0x3b')]=_[_0x0203('0x3d')](db['UserFaxQueue'][_0x0203('0x5f')]);_0x49ecde[_0x0203('0x3c')]=_[_0x0203('0x3d')](_0xa8b205[_0x0203('0x3c')]);_0x49ecde[_0x0203('0x3e')]=_[_0x0203('0x3f')](_0x49ecde['model'],_0x49ecde[_0x0203('0x3c')]);_0x4ea3ea[_0x0203('0x40')]=_[_0x0203('0x3f')](_0x49ecde[_0x0203('0x3b')],qs[_0x0203('0x41')](_0xa8b205[_0x0203('0x3c')][_0x0203('0x41')]));_0x4ea3ea[_0x0203('0x40')]=_0x4ea3ea[_0x0203('0x40')][_0x0203('0x42')]?_0x4ea3ea[_0x0203('0x40')]:_0x49ecde['model'];if(!_0xa8b205[_0x0203('0x3c')][_0x0203('0x60')](_0x0203('0x43'))){_0x4ea3ea[_0x0203('0x25')]=qs[_0x0203('0x25')](_0xa8b205[_0x0203('0x3c')][_0x0203('0x25')]);_0x4ea3ea[_0x0203('0x23')]=qs[_0x0203('0x23')](_0xa8b205[_0x0203('0x3c')][_0x0203('0x23')]);}_0x4ea3ea[_0x0203('0x44')]=qs['sort'](_0xa8b205[_0x0203('0x3c')]['sort']);_0x4ea3ea[_0x0203('0x47')]=qs['filters'](_[_0x0203('0x46')](_0xa8b205[_0x0203('0x3c')],_0x49ecde[_0x0203('0x3e')]));_0x4ea3ea[_0x0203('0x47')]['FaxQueueId']=_0x20df39['id'];if(_0xa8b205['query'][_0x0203('0x4a')]){_0x4ea3ea[_0x0203('0x47')]=_['merge'](_0x4ea3ea['where'],{'$or':_[_0x0203('0x37')](_0x4ea3ea[_0x0203('0x40')],function(_0x473319){var _0x3781e5={};_0x3781e5[_0x473319]={'$like':'%'+_0xa8b205[_0x0203('0x3c')][_0x0203('0x4a')]+'%'};return _0x3781e5;})});}_0x4ea3ea=_[_0x0203('0x48')]({},_0x4ea3ea,_0xa8b205[_0x0203('0x4b')]);return db[_0x0203('0x61')]['findAll'](_0x4ea3ea);}})['then'](function(_0x513778){if(_0x513778){return db['User'][_0x0203('0x62')]({'where':{'id':_[_0x0203('0x37')](_0x513778,_0x0203('0x63')),'role':_0x0203('0x64')},'attributes':['id',_0x0203('0x35'),_0x0203('0x65'),_0x0203('0x66'),'createdAt']});}})[_0x0203('0x2e')](function(_0x536e99){if(_0x536e99){return{'count':_0x536e99[_0x0203('0x26')],'rows':_[_0x0203('0x37')](_0x536e99[_0x0203('0x4f')],function(_0x21a272){return{'membername':_0x21a272['name'],'UserId':_0x21a272['id'],'queue_name':_0x512d7f['name'],'FaxQueueId':_0x512d7f['id'],'interface':util[_0x0203('0x67')](_0x0203('0x68'),_0x0203('0x69'),_0x21a272[_0x0203('0x35')]),'penalty':0x0,'paused':_0x21a272[_0x0203('0x65')],'createdAt':_0x21a272[_0x0203('0x6a')],'updatedAt':_0x21a272[_0x0203('0x66')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x0203('0x2e')](respondWithFilteredResult(_0x52bb3b,_0x4ea3ea))[_0x0203('0x50')](handleError(_0x52bb3b,null));};exports[_0x0203('0x6b')]=function(_0x4944ca,_0x2346e8,_0x1d1ad0){var _0x4bdae3={};var _0x16abe3={};var _0x15f90b;var _0x174bf0;return db['FaxQueue']['findOne']({'where':{'id':_0x4944ca[_0x0203('0x52')]['id']}})[_0x0203('0x2e')](handleEntityNotFound(_0x2346e8,null))[_0x0203('0x2e')](function(_0x3b73c3){if(_0x3b73c3){_0x15f90b=_0x3b73c3;_0x16abe3['model']=_['keys'](db[_0x0203('0x6c')][_0x0203('0x5f')]);_0x16abe3['query']=_[_0x0203('0x3d')](_0x4944ca[_0x0203('0x3c')]);_0x16abe3[_0x0203('0x3e')]=_[_0x0203('0x3f')](_0x16abe3['model'],_0x16abe3[_0x0203('0x3c')]);_0x4bdae3[_0x0203('0x40')]=_[_0x0203('0x3f')](_0x16abe3['model'],qs[_0x0203('0x41')](_0x4944ca[_0x0203('0x3c')][_0x0203('0x41')]));_0x4bdae3[_0x0203('0x40')]=_0x4bdae3['attributes']['length']?_0x4bdae3['attributes']:_0x16abe3[_0x0203('0x3b')];_0x4bdae3['order']=qs[_0x0203('0x45')](_0x4944ca[_0x0203('0x3c')][_0x0203('0x45')]);_0x4bdae3[_0x0203('0x47')]=qs[_0x0203('0x3e')](_['pick'](_0x4944ca['query'],_0x16abe3[_0x0203('0x3e')]));if(_0x4944ca['query'][_0x0203('0x4a')]){_0x4bdae3[_0x0203('0x47')]=_[_0x0203('0x48')](_0x4bdae3[_0x0203('0x47')],{'$or':_[_0x0203('0x37')](_0x4bdae3[_0x0203('0x40')],function(_0x2000ee){var _0x5d535c={};_0x5d535c[_0x2000ee]={'$like':'%'+_0x4944ca['query']['filter']+'%'};return _0x5d535c;})});}_0x4bdae3=_[_0x0203('0x48')]({},_0x4bdae3,_0x4944ca[_0x0203('0x4b')]);return _0x15f90b['getTeams'](_0x4bdae3);}})[_0x0203('0x2e')](function(_0xca321){if(_0xca321){_0x174bf0=_0xca321[_0x0203('0x42')];if(!_0x4944ca['query'][_0x0203('0x60')](_0x0203('0x43'))){_0x4bdae3[_0x0203('0x25')]=qs[_0x0203('0x25')](_0x4944ca[_0x0203('0x3c')]['limit']);_0x4bdae3[_0x0203('0x23')]=qs[_0x0203('0x23')](_0x4944ca[_0x0203('0x3c')][_0x0203('0x23')]);}return _0x15f90b[_0x0203('0x6b')](_0x4bdae3);}})[_0x0203('0x2e')](function(_0x29ce8c){if(_0x29ce8c){return _0x29ce8c?{'count':_0x174bf0,'rows':_0x29ce8c}:null;}})['then'](respondWithResult(_0x2346e8,null))['catch'](handleError(_0x2346e8,null));};exports[_0x0203('0x6d')]=function(_0x110b00,_0x226f3e,_0x5bb0be){var _0x38e414=_0x110b00[_0x0203('0x55')]['ids'];return db['Team'][_0x0203('0x4e')]({'where':{'id':_0x38e414},'attributes':['id'],'include':[{'model':db[_0x0203('0x6e')],'as':_0x0203('0x6f'),'attributes':['id','name',_0x0203('0x70'),_0x0203('0x71'),_0x0203('0x72')],'raw':!![]}]})['then'](function(_0x35448f){if(_0x35448f){var _0x5ce040=_[_0x0203('0x73')](_0x35448f,function(_0x50b1d6){var _0x5c1e91=_0x50b1d6[_0x0203('0x30')]({'plain':!![]});return _0x5c1e91['Agents'];});return db[_0x0203('0x38')][_0x0203('0x53')]({'where':{'id':_0x110b00[_0x0203('0x52')]['id']}})[_0x0203('0x2e')](function(_0x355e8f){return db['sequelize']['transaction'](function(_0x5e9214){return _0x355e8f[_0x0203('0x6d')](_0x38e414,{'transaction':_0x5e9214})[_0x0203('0x2e')](function(){return BPromise[_0x0203('0x74')](_0x5ce040,function(_0x38fd24){return db[_0x0203('0x61')][_0x0203('0x75')]({'where':{'UserId':_0x38fd24['id'],'FaxQueueId':_0x110b00[_0x0203('0x52')]['id']},'transaction':_0x5e9214});});})[_0x0203('0x2e')](function(){_0x5ce040[_0x0203('0x76')](function(_0x33a19a){socket[_0x0203('0x77')](_0x0203('0x78'),{'UserId':_0x33a19a['id'],'FaxQueueId':_0x355e8f['id']});});});});});}})[_0x0203('0x2e')](respondWithStatusCode(_0x226f3e,null))['catch'](handleError(_0x226f3e,null));};exports[_0x0203('0x79')]=function(_0x366ad5,_0x131750,_0x25fbf9){return db[_0x0203('0x6c')][_0x0203('0x4e')]({'where':{'id':_0x366ad5[_0x0203('0x3c')][_0x0203('0x7a')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x0203('0x6f'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x131750,null))['then'](function(_0x29f632){var _0x256876=_['map'](_0x29f632,'id');var _0x14c0da=[];var _0x151c29=[];var _0x25eeb5=squel[_0x0203('0x7b')]();_0x25eeb5[_0x0203('0x7c')](_0x0203('0x7d'))['from']('team_has_fax_queues','tq')[_0x0203('0x7e')](_0x0203('0x7f'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x0203('0x47')]('FaxQueueId\x20=\x20?',_0x366ad5[_0x0203('0x52')]['id']);for(var _0x163be7=0x0;_0x163be7<_0x29f632[_0x0203('0x42')];_0x163be7+=0x1){let _0x11ed50=_0x29f632[_0x163be7];for(var _0x232713=0x0;_0x232713<_0x11ed50[_0x0203('0x6f')][_0x0203('0x42')];_0x232713+=0x1){let _0x29cde2=_0x11ed50['Agents'][_0x232713];var _0x2b4c43=_0x25eeb5['clone']();_0x2b4c43[_0x0203('0x47')]('ut.UserId\x20=\x20?',_0x29cde2['id']);_0x151c29[_0x0203('0x80')](db[_0x0203('0x81')][_0x0203('0x3c')](_0x2b4c43[_0x0203('0x82')](),{'type':db[_0x0203('0x81')][_0x0203('0x83')][_0x0203('0x84')]})[_0x0203('0x2e')](function(_0x3cd23d){if(_0x3cd23d[_0x0203('0x42')]===0x1){return _0x29cde2['id'];}else{var _0x3376cf=_[_0x0203('0x85')](_[_0x0203('0x37')](_0x3cd23d,_0x0203('0x86')),function(_0x3fef03){return _[_0x0203('0x87')](_0x256876,_0x3fef03);});if(_0x3376cf){return _0x29cde2['id'];}}}));}}return BPromise[_0x0203('0x88')](_0x151c29)['then'](function(_0x2c3aba){_0x14c0da=_(_0x14c0da)[_0x0203('0x89')](_0x2c3aba)[_0x0203('0x8a')]()['value']();return db[_0x0203('0x38')][_0x0203('0x53')]({'where':{'id':_0x366ad5['params']['id']}})['then'](function(_0x167921){return db[_0x0203('0x81')][_0x0203('0x8b')](function(_0xf793bd){return _0x167921[_0x0203('0x79')](_0x366ad5[_0x0203('0x3c')]['ids'],{'transaction':_0xf793bd})[_0x0203('0x2e')](function(){if(!_[_0x0203('0x8c')](_0x14c0da)){return _0x167921[_0x0203('0x8d')](_0x14c0da,{'transaction':_0xf793bd});}})[_0x0203('0x2e')](function(){_0x14c0da[_0x0203('0x76')](function(_0x519fc9){socket['emit'](_0x0203('0x8e'),{'UserId':_0x519fc9,'FaxQueueId':_0x167921['id']});});});});});});})[_0x0203('0x2e')](respondWithStatusCode(_0x131750,null))[_0x0203('0x50')](handleError(_0x131750,null));};exports[_0x0203('0x8f')]=function(_0xdc93df,_0x3695bc,_0x2ae894){return db['FaxQueue'][_0x0203('0x53')]({'where':{'id':_0xdc93df[_0x0203('0x52')]['id']}})[_0x0203('0x2e')](handleEntityNotFound(_0x3695bc,null))['then'](function(_0x36931b){if(_0x36931b){return _0x36931b['addAgents'](_0xdc93df[_0x0203('0x55')][_0x0203('0x7a')],_[_0x0203('0x90')](_0xdc93df[_0x0203('0x55')],[_0x0203('0x7a'),'id'])||{})['spread'](function(_0x5f2ee1){for(var _0x3ba748=0x0;_0x3ba748<_0xdc93df[_0x0203('0x55')][_0x0203('0x7a')][_0x0203('0x42')];_0x3ba748+=0x1){socket['emit'](_0x0203('0x78'),{'UserId':Number(_0xdc93df['body'][_0x0203('0x7a')][_0x3ba748]),'FaxQueueId':Number(_0xdc93df[_0x0203('0x52')]['id'])});}return _0x5f2ee1;});}})[_0x0203('0x2e')](respondWithResult(_0x3695bc,null))[_0x0203('0x50')](handleError(_0x3695bc,null));};exports[_0x0203('0x8d')]=function(_0x3f61f4,_0x140fe0,_0x43a8b0){return db[_0x0203('0x38')][_0x0203('0x53')]({'where':{'id':_0x3f61f4[_0x0203('0x52')]['id']}})[_0x0203('0x2e')](handleEntityNotFound(_0x140fe0,null))[_0x0203('0x2e')](function(_0x598644){if(_0x598644){return _0x598644['removeAgents'](_0x3f61f4[_0x0203('0x3c')][_0x0203('0x7a')])['then'](function(){if(_[_0x0203('0x91')](_0x3f61f4[_0x0203('0x3c')][_0x0203('0x7a')])){for(var _0x1ee1c9=0x0;_0x1ee1c9<_0x3f61f4['query'][_0x0203('0x7a')][_0x0203('0x42')];_0x1ee1c9+=0x1){socket[_0x0203('0x77')](_0x0203('0x8e'),{'UserId':Number(_0x3f61f4['query']['ids'][_0x1ee1c9]),'FaxQueueId':Number(_0x3f61f4[_0x0203('0x52')]['id'])});}}else{socket[_0x0203('0x77')](_0x0203('0x8e'),{'UserId':Number(_0x3f61f4[_0x0203('0x3c')][_0x0203('0x7a')]),'FaxQueueId':Number(_0x3f61f4['params']['id'])});}});}})[_0x0203('0x2e')](respondWithStatusCode(_0x140fe0,null))[_0x0203('0x50')](handleError(_0x140fe0,null));};exports['getAgents']=function(_0x5b43b0,_0x298eac,_0x41bc70){var _0x325a16={};var _0x40a2d0={};var _0x247cbc;var _0x4a7f55;return db['FaxQueue'][_0x0203('0x5e')]({'where':{'id':_0x5b43b0['params']['id']}})[_0x0203('0x2e')](handleEntityNotFound(_0x298eac,null))[_0x0203('0x2e')](function(_0x7ea913){if(_0x7ea913){_0x247cbc=_0x7ea913;_0x40a2d0['model']=_['keys'](db[_0x0203('0x6e')]['rawAttributes']);_0x40a2d0[_0x0203('0x3c')]=_[_0x0203('0x3d')](_0x5b43b0[_0x0203('0x3c')]);_0x40a2d0['filters']=_[_0x0203('0x3f')](_0x40a2d0[_0x0203('0x3b')],_0x40a2d0[_0x0203('0x3c')]);_0x325a16[_0x0203('0x40')]=_['intersection'](_0x40a2d0[_0x0203('0x3b')],qs[_0x0203('0x41')](_0x5b43b0['query'][_0x0203('0x41')]));_0x325a16['attributes']=_0x325a16[_0x0203('0x40')][_0x0203('0x42')]?_0x325a16['attributes']:_0x40a2d0['model'];_0x325a16[_0x0203('0x44')]=qs['sort'](_0x5b43b0[_0x0203('0x3c')][_0x0203('0x45')]);_0x325a16['where']=qs['filters'](_[_0x0203('0x46')](_0x5b43b0[_0x0203('0x3c')],_0x40a2d0['filters']));if(_0x5b43b0[_0x0203('0x3c')]['filter']){_0x325a16[_0x0203('0x47')]=_['merge'](_0x325a16[_0x0203('0x47')],{'$or':_[_0x0203('0x37')](_0x325a16['attributes'],function(_0x3af12a){var _0x452e05={};_0x452e05[_0x3af12a]={'$like':'%'+_0x5b43b0['query'][_0x0203('0x4a')]+'%'};return _0x452e05;})});}_0x325a16=_['merge']({},_0x325a16,_0x5b43b0[_0x0203('0x4b')]);return _0x247cbc['getAgents'](_0x325a16);}})[_0x0203('0x2e')](function(_0x3bab8f){if(_0x3bab8f){_0x4a7f55=_0x3bab8f[_0x0203('0x42')];if(!_0x5b43b0[_0x0203('0x3c')][_0x0203('0x60')](_0x0203('0x43'))){_0x325a16[_0x0203('0x25')]=qs['limit'](_0x5b43b0['query'][_0x0203('0x25')]);_0x325a16[_0x0203('0x23')]=qs[_0x0203('0x23')](_0x5b43b0[_0x0203('0x3c')][_0x0203('0x23')]);}return _0x247cbc['getAgents'](_0x325a16);}})[_0x0203('0x2e')](function(_0x189343){if(_0x189343){return _0x189343?{'count':_0x4a7f55,'rows':_0x189343}:null;}})[_0x0203('0x2e')](respondWithResult(_0x298eac,null))[_0x0203('0x50')](handleError(_0x298eac,null));}; \ No newline at end of file +var _0x3883=['UserId','agent','faxPause','updatedAt','createdAt','rows','format','%s/%s','SIP','getTeams','Team','addTeams','ids','Agents','online','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userFaxQueue:save','select','tq.TeamId','from','team_has_fax_queues','join','user_has_teams','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','QueryTypes','SELECT','includes','all','union','compact','removeTeams','isEmpty','removeAgents','userFaxQueue:remove','addAgents','omit','spread','isArray','getAgents','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','save','update','then','destroy','get','FaxQueues','UserProfileResource','error','name','send','index','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','filter','merge','map','type','options','FaxQueue','includeAll','findAll','catch','show','params','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserFaxQueue','order','pick','User','findAndCountAll'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x3883,0xbf));var _0x3388=function(_0x308fd3,_0xb7552d){_0x308fd3=_0x308fd3-0x0;var _0x2a5670=_0x3883[_0x308fd3];return _0x2a5670;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3388('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3388('0x1'));var rp=require(_0x3388('0x2'));var moment=require('moment');var BPromise=require(_0x3388('0x3'));var Mustache=require(_0x3388('0x4'));var util=require(_0x3388('0x5'));var path=require(_0x3388('0x6'));var sox=require('sox');var csv=require(_0x3388('0x7'));var ejs=require(_0x3388('0x8'));var fs=require('fs');var fs_extra=require(_0x3388('0x9'));var _=require('lodash');var squel=require(_0x3388('0xa'));var crypto=require(_0x3388('0xb'));var jsforce=require(_0x3388('0xc'));var deskjs=require(_0x3388('0xd'));var toCsv=require(_0x3388('0x7'));var querystring=require(_0x3388('0xe'));var Papa=require(_0x3388('0xf'));var Redis=require(_0x3388('0x10'));var authService=require(_0x3388('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x3388('0x12'));var hardwareService=require(_0x3388('0x13'));var logger=require(_0x3388('0x14'))(_0x3388('0x15'));var utils=require(_0x3388('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x3388('0x17'));var db=require(_0x3388('0x18'))['db'];config[_0x3388('0x19')]=_[_0x3388('0x1a')](config[_0x3388('0x19')],{'host':_0x3388('0x1b'),'port':0x18eb});var socket=require(_0x3388('0x1c'))(new Redis(config[_0x3388('0x19')]));require(_0x3388('0x1d'))[_0x3388('0x1e')](socket);function respondWithStatusCode(_0xec2827,_0x3735a7){_0x3735a7=_0x3735a7||0xcc;return function(_0x4be53a){if(_0x4be53a){return _0xec2827[_0x3388('0x1f')](_0x3735a7);}return _0xec2827[_0x3388('0x20')](_0x3735a7)[_0x3388('0x21')]();};}function respondWithResult(_0x33311e,_0x1601ec){_0x1601ec=_0x1601ec||0xc8;return function(_0x4c7b7d){if(_0x4c7b7d){return _0x33311e[_0x3388('0x20')](_0x1601ec)[_0x3388('0x22')](_0x4c7b7d);}};}function respondWithFilteredResult(_0x342f98,_0x5c0d09){return function(_0x26fdd4){if(_0x26fdd4){var _0x2d5581=typeof _0x5c0d09[_0x3388('0x23')]===_0x3388('0x24')&&typeof _0x5c0d09['limit']===_0x3388('0x24');var _0x17e0b5=_0x26fdd4[_0x3388('0x25')];var _0x5a0d47=_0x2d5581?0x0:_0x5c0d09[_0x3388('0x23')];var _0x17930b=_0x2d5581?_0x26fdd4['count']:_0x5c0d09[_0x3388('0x23')]+_0x5c0d09['limit'];var _0x49dd0e;if(_0x17930b>=_0x17e0b5){_0x17930b=_0x17e0b5;_0x49dd0e=0xc8;}else{_0x49dd0e=0xce;}_0x342f98[_0x3388('0x20')](_0x49dd0e);return _0x342f98[_0x3388('0x26')](_0x3388('0x27'),_0x5a0d47+'-'+_0x17930b+'/'+_0x17e0b5)[_0x3388('0x22')](_0x26fdd4);}return null;};}function patchUpdates(_0x327f3b){return function(_0x974f10){try{jsonpatch['apply'](_0x974f10,_0x327f3b,!![]);}catch(_0x3a2e8e){return BPromise['reject'](_0x3a2e8e);}return _0x974f10[_0x3388('0x28')]();};}function saveUpdates(_0x1da479,_0x281a75){return function(_0x29e4b8){if(_0x29e4b8){return _0x29e4b8[_0x3388('0x29')](_0x1da479)[_0x3388('0x2a')](function(_0xd74a6e){return _0xd74a6e;});}return null;};}function removeEntity(_0x4c2ad5,_0x2a2861){return function(_0x29882a){if(_0x29882a){return _0x29882a[_0x3388('0x2b')]()[_0x3388('0x2a')](function(){var _0x477f3a=_0x29882a[_0x3388('0x2c')]({'plain':!![]});var _0x47a10f=_0x3388('0x2d');return db[_0x3388('0x2e')][_0x3388('0x2b')]({'where':{'type':_0x47a10f,'resourceId':_0x477f3a['id']}})[_0x3388('0x2a')](function(){return _0x29882a;});})['then'](function(){_0x4c2ad5[_0x3388('0x20')](0xcc)[_0x3388('0x21')]();});}};}function handleEntityNotFound(_0x51d35b,_0x13a843){return function(_0x246722){if(!_0x246722){_0x51d35b[_0x3388('0x1f')](0x194);}return _0x246722;};}function handleError(_0x3a0e04,_0x14cf45){_0x14cf45=_0x14cf45||0x1f4;return function(_0xf24fb2){logger[_0x3388('0x2f')](_0xf24fb2['stack']);if(_0xf24fb2['name']){delete _0xf24fb2[_0x3388('0x30')];}_0x3a0e04['status'](_0x14cf45)[_0x3388('0x31')](_0xf24fb2);};}exports[_0x3388('0x32')]=function(_0x2bd45e,_0x5a390e){var _0x219fe7={},_0x504893={},_0x3946e9={'count':0x0,'rows':[]};var _0x2cefbb=_['map'](db['FaxQueue'][_0x3388('0x33')],function(_0x563c68){return{'name':_0x563c68['fieldName'],'type':_0x563c68['type'][_0x3388('0x34')]};});_0x504893[_0x3388('0x35')]=_['map'](_0x2cefbb,_0x3388('0x30'));_0x504893[_0x3388('0x36')]=_[_0x3388('0x37')](_0x2bd45e[_0x3388('0x36')]);_0x504893[_0x3388('0x38')]=_[_0x3388('0x39')](_0x504893[_0x3388('0x35')],_0x504893[_0x3388('0x36')]);_0x219fe7[_0x3388('0x3a')]=_['intersection'](_0x504893[_0x3388('0x35')],qs[_0x3388('0x3b')](_0x2bd45e[_0x3388('0x36')][_0x3388('0x3b')]));_0x219fe7[_0x3388('0x3a')]=_0x219fe7[_0x3388('0x3a')][_0x3388('0x3c')]?_0x219fe7['attributes']:_0x504893[_0x3388('0x35')];if(!_0x2bd45e[_0x3388('0x36')][_0x3388('0x3d')](_0x3388('0x3e'))){_0x219fe7[_0x3388('0x3f')]=qs[_0x3388('0x3f')](_0x2bd45e[_0x3388('0x36')][_0x3388('0x3f')]);_0x219fe7[_0x3388('0x23')]=qs[_0x3388('0x23')](_0x2bd45e[_0x3388('0x36')][_0x3388('0x23')]);}_0x219fe7['order']=qs[_0x3388('0x40')](_0x2bd45e[_0x3388('0x36')][_0x3388('0x40')]);_0x219fe7[_0x3388('0x41')]=qs[_0x3388('0x38')](_['pick'](_0x2bd45e[_0x3388('0x36')],_0x504893[_0x3388('0x38')]),_0x2cefbb);if(_0x2bd45e['query'][_0x3388('0x42')]){_0x219fe7['where']=_[_0x3388('0x43')](_0x219fe7[_0x3388('0x41')],{'$or':_[_0x3388('0x44')](_0x2cefbb,function(_0x4a7784){if(_0x4a7784[_0x3388('0x45')]!=='VIRTUAL'){var _0x1aba7e={};_0x1aba7e[_0x4a7784[_0x3388('0x30')]]={'$like':'%'+_0x2bd45e[_0x3388('0x36')][_0x3388('0x42')]+'%'};return _0x1aba7e;}})});}_0x219fe7=_['merge']({},_0x219fe7,_0x2bd45e[_0x3388('0x46')]);var _0x1a6e69={'where':_0x219fe7[_0x3388('0x41')]};return db[_0x3388('0x47')][_0x3388('0x25')](_0x1a6e69)[_0x3388('0x2a')](function(_0x2ba9f1){_0x3946e9['count']=_0x2ba9f1;if(_0x2bd45e['query'][_0x3388('0x48')]){_0x219fe7['include']=[{'all':!![]}];}return db['FaxQueue'][_0x3388('0x49')](_0x219fe7);})['then'](function(_0x58777b){_0x3946e9['rows']=_0x58777b;return _0x3946e9;})['then'](respondWithFilteredResult(_0x5a390e,_0x219fe7))[_0x3388('0x4a')](handleError(_0x5a390e,null));};exports[_0x3388('0x4b')]=function(_0x41300e,_0x3a31bf){var _0x4503ba={'raw':!![],'where':{'id':_0x41300e[_0x3388('0x4c')]['id']}},_0x1f2584={};_0x1f2584[_0x3388('0x35')]=_[_0x3388('0x37')](db[_0x3388('0x47')][_0x3388('0x33')]);_0x1f2584['query']=_[_0x3388('0x37')](_0x41300e[_0x3388('0x36')]);_0x1f2584[_0x3388('0x38')]=_[_0x3388('0x39')](_0x1f2584['model'],_0x1f2584[_0x3388('0x36')]);_0x4503ba[_0x3388('0x3a')]=_['intersection'](_0x1f2584['model'],qs[_0x3388('0x3b')](_0x41300e[_0x3388('0x36')][_0x3388('0x3b')]));_0x4503ba[_0x3388('0x3a')]=_0x4503ba['attributes'][_0x3388('0x3c')]?_0x4503ba['attributes']:_0x1f2584[_0x3388('0x35')];if(_0x41300e[_0x3388('0x36')]['includeAll']){_0x4503ba[_0x3388('0x4d')]=[{'all':!![]}];}_0x4503ba=_[_0x3388('0x43')]({},_0x4503ba,_0x41300e[_0x3388('0x46')]);return db[_0x3388('0x47')][_0x3388('0x4e')](_0x4503ba)['then'](handleEntityNotFound(_0x3a31bf,null))[_0x3388('0x2a')](respondWithResult(_0x3a31bf,null))['catch'](handleError(_0x3a31bf,null));};exports[_0x3388('0x4f')]=function(_0x129e0d,_0x19ad93){return db['FaxQueue'][_0x3388('0x4f')](_0x129e0d['body'],{})[_0x3388('0x2a')](function(_0x205a8b){var _0x4ad32f=_0x129e0d[_0x3388('0x50')][_0x3388('0x2c')]({'plain':!![]});if(!_0x4ad32f)throw new Error(_0x3388('0x51'));if(_0x4ad32f[_0x3388('0x52')]==='user'){var _0x403fc3=_0x205a8b['get']({'plain':!![]});var _0x6c919c=_0x3388('0x2d');return db[_0x3388('0x53')][_0x3388('0x4e')]({'where':{'name':_0x6c919c,'userProfileId':_0x4ad32f[_0x3388('0x54')]},'raw':!![]})[_0x3388('0x2a')](function(_0xe17c28){if(_0xe17c28&&_0xe17c28['autoAssociation']===0x0){return db[_0x3388('0x2e')]['create']({'name':_0x403fc3[_0x3388('0x30')],'resourceId':_0x403fc3['id'],'type':_0xe17c28['name'],'sectionId':_0xe17c28['id']},{})[_0x3388('0x2a')](function(){return _0x205a8b;});}else{return _0x205a8b;}})['catch'](function(_0x174730){logger[_0x3388('0x2f')](_0x3388('0x55'),_0x174730);throw _0x174730;});}return _0x205a8b;})['then'](respondWithResult(_0x19ad93,0xc9))[_0x3388('0x4a')](handleError(_0x19ad93,null));};exports[_0x3388('0x29')]=function(_0x3767eb,_0x32321a){if(_0x3767eb['body']['id']){delete _0x3767eb[_0x3388('0x56')]['id'];}return db[_0x3388('0x47')]['find']({'where':{'id':_0x3767eb[_0x3388('0x4c')]['id']}})[_0x3388('0x2a')](handleEntityNotFound(_0x32321a,null))['then'](saveUpdates(_0x3767eb['body'],null))[_0x3388('0x2a')](respondWithResult(_0x32321a,null))[_0x3388('0x4a')](handleError(_0x32321a,null));};exports['destroy']=function(_0x3795e9,_0x28804d){return db[_0x3388('0x47')][_0x3388('0x4e')]({'where':{'id':_0x3795e9['params']['id']}})[_0x3388('0x2a')](handleEntityNotFound(_0x28804d,null))[_0x3388('0x2a')](removeEntity(_0x28804d,null))[_0x3388('0x4a')](handleError(_0x28804d,null));};exports[_0x3388('0x57')]=function(_0x595b68,_0x57bc63){return db[_0x3388('0x47')]['describe']()['then'](respondWithResult(_0x57bc63,null))[_0x3388('0x4a')](handleError(_0x57bc63,null));};exports[_0x3388('0x58')]=function(_0xda389,_0xfd65ed,_0x2faa31){var _0x696120={'raw':!![],'where':{}},_0x112bef={},_0x15e61e;return db['FaxQueue'][_0x3388('0x59')]({'where':{'id':_0xda389[_0x3388('0x4c')]['id']}})['then'](handleEntityNotFound(_0xfd65ed,null))[_0x3388('0x2a')](function(_0x23fb22){if(_0x23fb22){_0x15e61e=_0x23fb22['get']({'plain':!![]});_0x112bef[_0x3388('0x35')]=_[_0x3388('0x37')](db[_0x3388('0x5a')][_0x3388('0x33')]);_0x112bef['query']=_[_0x3388('0x37')](_0xda389['query']);_0x112bef[_0x3388('0x38')]=_[_0x3388('0x39')](_0x112bef['model'],_0x112bef[_0x3388('0x36')]);_0x696120['attributes']=_[_0x3388('0x39')](_0x112bef[_0x3388('0x35')],qs[_0x3388('0x3b')](_0xda389[_0x3388('0x36')]['fields']));_0x696120[_0x3388('0x3a')]=_0x696120['attributes']['length']?_0x696120[_0x3388('0x3a')]:_0x112bef[_0x3388('0x35')];if(!_0xda389['query'][_0x3388('0x3d')](_0x3388('0x3e'))){_0x696120[_0x3388('0x3f')]=qs[_0x3388('0x3f')](_0xda389[_0x3388('0x36')][_0x3388('0x3f')]);_0x696120[_0x3388('0x23')]=qs['offset'](_0xda389[_0x3388('0x36')][_0x3388('0x23')]);}_0x696120[_0x3388('0x5b')]=qs[_0x3388('0x40')](_0xda389[_0x3388('0x36')]['sort']);_0x696120['where']=qs[_0x3388('0x38')](_[_0x3388('0x5c')](_0xda389[_0x3388('0x36')],_0x112bef[_0x3388('0x38')]));_0x696120[_0x3388('0x41')]['FaxQueueId']=_0x23fb22['id'];if(_0xda389[_0x3388('0x36')][_0x3388('0x42')]){_0x696120[_0x3388('0x41')]=_['merge'](_0x696120[_0x3388('0x41')],{'$or':_[_0x3388('0x44')](_0x696120[_0x3388('0x3a')],function(_0x2acbb2){var _0x56d350={};_0x56d350[_0x2acbb2]={'$like':'%'+_0xda389[_0x3388('0x36')][_0x3388('0x42')]+'%'};return _0x56d350;})});}_0x696120=_[_0x3388('0x43')]({},_0x696120,_0xda389[_0x3388('0x46')]);return db[_0x3388('0x5a')][_0x3388('0x49')](_0x696120);}})[_0x3388('0x2a')](function(_0x2170d4){if(_0x2170d4){return db[_0x3388('0x5d')][_0x3388('0x5e')]({'where':{'id':_[_0x3388('0x44')](_0x2170d4,_0x3388('0x5f')),'role':_0x3388('0x60')},'attributes':['id',_0x3388('0x30'),_0x3388('0x61'),_0x3388('0x62'),_0x3388('0x63')]});}})['then'](function(_0x2df459){if(_0x2df459){return{'count':_0x2df459[_0x3388('0x25')],'rows':_[_0x3388('0x44')](_0x2df459[_0x3388('0x64')],function(_0x1380c4){return{'membername':_0x1380c4[_0x3388('0x30')],'UserId':_0x1380c4['id'],'queue_name':_0x15e61e[_0x3388('0x30')],'FaxQueueId':_0x15e61e['id'],'interface':util[_0x3388('0x65')](_0x3388('0x66'),_0x3388('0x67'),_0x1380c4[_0x3388('0x30')]),'penalty':0x0,'paused':_0x1380c4[_0x3388('0x61')],'createdAt':_0x1380c4[_0x3388('0x63')],'updatedAt':_0x1380c4[_0x3388('0x62')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0xfd65ed,_0x696120))[_0x3388('0x4a')](handleError(_0xfd65ed,null));};exports[_0x3388('0x68')]=function(_0x1682e1,_0x39d70a,_0x24957f){var _0x2ee769={};var _0x37ab44={};var _0x39bbdf;var _0x3f4c78;return db[_0x3388('0x47')][_0x3388('0x59')]({'where':{'id':_0x1682e1[_0x3388('0x4c')]['id']}})[_0x3388('0x2a')](handleEntityNotFound(_0x39d70a,null))[_0x3388('0x2a')](function(_0x46d29b){if(_0x46d29b){_0x39bbdf=_0x46d29b;_0x37ab44[_0x3388('0x35')]=_[_0x3388('0x37')](db[_0x3388('0x69')]['rawAttributes']);_0x37ab44[_0x3388('0x36')]=_[_0x3388('0x37')](_0x1682e1[_0x3388('0x36')]);_0x37ab44[_0x3388('0x38')]=_[_0x3388('0x39')](_0x37ab44[_0x3388('0x35')],_0x37ab44[_0x3388('0x36')]);_0x2ee769[_0x3388('0x3a')]=_[_0x3388('0x39')](_0x37ab44[_0x3388('0x35')],qs[_0x3388('0x3b')](_0x1682e1[_0x3388('0x36')][_0x3388('0x3b')]));_0x2ee769['attributes']=_0x2ee769[_0x3388('0x3a')]['length']?_0x2ee769['attributes']:_0x37ab44[_0x3388('0x35')];_0x2ee769['order']=qs['sort'](_0x1682e1['query'][_0x3388('0x40')]);_0x2ee769['where']=qs['filters'](_[_0x3388('0x5c')](_0x1682e1[_0x3388('0x36')],_0x37ab44[_0x3388('0x38')]));if(_0x1682e1[_0x3388('0x36')][_0x3388('0x42')]){_0x2ee769[_0x3388('0x41')]=_[_0x3388('0x43')](_0x2ee769[_0x3388('0x41')],{'$or':_[_0x3388('0x44')](_0x2ee769[_0x3388('0x3a')],function(_0x90582f){var _0x25910e={};_0x25910e[_0x90582f]={'$like':'%'+_0x1682e1[_0x3388('0x36')][_0x3388('0x42')]+'%'};return _0x25910e;})});}_0x2ee769=_[_0x3388('0x43')]({},_0x2ee769,_0x1682e1['options']);return _0x39bbdf[_0x3388('0x68')](_0x2ee769);}})['then'](function(_0x1ad59d){if(_0x1ad59d){_0x3f4c78=_0x1ad59d[_0x3388('0x3c')];if(!_0x1682e1[_0x3388('0x36')][_0x3388('0x3d')](_0x3388('0x3e'))){_0x2ee769[_0x3388('0x3f')]=qs[_0x3388('0x3f')](_0x1682e1[_0x3388('0x36')][_0x3388('0x3f')]);_0x2ee769[_0x3388('0x23')]=qs[_0x3388('0x23')](_0x1682e1[_0x3388('0x36')][_0x3388('0x23')]);}return _0x39bbdf[_0x3388('0x68')](_0x2ee769);}})[_0x3388('0x2a')](function(_0xf9025f){if(_0xf9025f){return _0xf9025f?{'count':_0x3f4c78,'rows':_0xf9025f}:null;}})[_0x3388('0x2a')](respondWithResult(_0x39d70a,null))[_0x3388('0x4a')](handleError(_0x39d70a,null));};exports[_0x3388('0x6a')]=function(_0xf6bdee,_0x11e5a0,_0x2c0d63){var _0x1a833b=_0xf6bdee[_0x3388('0x56')][_0x3388('0x6b')];return db[_0x3388('0x69')][_0x3388('0x49')]({'where':{'id':_0x1a833b},'attributes':['id'],'include':[{'model':db[_0x3388('0x5d')],'as':_0x3388('0x6c'),'attributes':['id',_0x3388('0x30'),_0x3388('0x6d'),'voicePause',_0x3388('0x6e')],'raw':!![]}]})[_0x3388('0x2a')](function(_0x314248){if(_0x314248){var _0x3c7960=_[_0x3388('0x6f')](_0x314248,function(_0x410df6){var _0x309e38=_0x410df6['get']({'plain':!![]});return _0x309e38[_0x3388('0x6c')];});return db['FaxQueue'][_0x3388('0x4e')]({'where':{'id':_0xf6bdee['params']['id']}})['then'](function(_0x21b040){return db[_0x3388('0x70')][_0x3388('0x71')](function(_0x586737){return _0x21b040[_0x3388('0x6a')](_0x1a833b,{'transaction':_0x586737})[_0x3388('0x2a')](function(){return BPromise[_0x3388('0x72')](_0x3c7960,function(_0x334761){return db[_0x3388('0x5a')][_0x3388('0x73')]({'where':{'UserId':_0x334761['id'],'FaxQueueId':_0xf6bdee[_0x3388('0x4c')]['id']},'transaction':_0x586737});});})['then'](function(){_0x3c7960[_0x3388('0x74')](function(_0x526595){socket[_0x3388('0x75')](_0x3388('0x76'),{'UserId':_0x526595['id'],'FaxQueueId':_0x21b040['id']});});});});});}})[_0x3388('0x2a')](respondWithStatusCode(_0x11e5a0,null))[_0x3388('0x4a')](handleError(_0x11e5a0,null));};exports['removeTeams']=function(_0x1d4c94,_0x3e5a19,_0x5b116b){return db['Team'][_0x3388('0x49')]({'where':{'id':_0x1d4c94['query'][_0x3388('0x6b')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x3388('0x6c'),'attributes':['id'],'raw':!![]}]})[_0x3388('0x2a')](handleEntityNotFound(_0x3e5a19,null))['then'](function(_0x3c466e){var _0x3c20d5=_['map'](_0x3c466e,'id');var _0x10689b=[];var _0x541fa8=[];var _0x517e7a=squel[_0x3388('0x77')]();_0x517e7a['field'](_0x3388('0x78'))[_0x3388('0x79')](_0x3388('0x7a'),'tq')[_0x3388('0x7b')](_0x3388('0x7c'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x3388('0x41')](_0x3388('0x7d'),_0x1d4c94[_0x3388('0x4c')]['id']);for(var _0x45e494=0x0;_0x45e494<_0x3c466e[_0x3388('0x3c')];_0x45e494+=0x1){let _0x2fc69=_0x3c466e[_0x45e494];for(var _0x36ef19=0x0;_0x36ef19<_0x2fc69[_0x3388('0x6c')]['length'];_0x36ef19+=0x1){let _0x47667d=_0x2fc69[_0x3388('0x6c')][_0x36ef19];var _0xa8c9a4=_0x517e7a[_0x3388('0x7e')]();_0xa8c9a4[_0x3388('0x41')](_0x3388('0x7f'),_0x47667d['id']);_0x541fa8['push'](db[_0x3388('0x70')][_0x3388('0x36')](_0xa8c9a4['toString'](),{'type':db[_0x3388('0x70')][_0x3388('0x80')][_0x3388('0x81')]})[_0x3388('0x2a')](function(_0x203020){if(_0x203020[_0x3388('0x3c')]===0x1){return _0x47667d['id'];}else{var _0x3753cd=_['every'](_[_0x3388('0x44')](_0x203020,'TeamId'),function(_0x1efdf7){return _[_0x3388('0x82')](_0x3c20d5,_0x1efdf7);});if(_0x3753cd){return _0x47667d['id'];}}}));}}return BPromise[_0x3388('0x83')](_0x541fa8)[_0x3388('0x2a')](function(_0x476544){_0x10689b=_(_0x10689b)[_0x3388('0x84')](_0x476544)[_0x3388('0x85')]()['value']();return db[_0x3388('0x47')][_0x3388('0x4e')]({'where':{'id':_0x1d4c94[_0x3388('0x4c')]['id']}})[_0x3388('0x2a')](function(_0x20d878){return db[_0x3388('0x70')][_0x3388('0x71')](function(_0x285a31){return _0x20d878[_0x3388('0x86')](_0x1d4c94['query'][_0x3388('0x6b')],{'transaction':_0x285a31})[_0x3388('0x2a')](function(){if(!_[_0x3388('0x87')](_0x10689b)){return _0x20d878[_0x3388('0x88')](_0x10689b,{'transaction':_0x285a31});}})[_0x3388('0x2a')](function(){_0x10689b['forEach'](function(_0x2c520e){socket[_0x3388('0x75')](_0x3388('0x89'),{'UserId':_0x2c520e,'FaxQueueId':_0x20d878['id']});});});});});});})[_0x3388('0x2a')](respondWithStatusCode(_0x3e5a19,null))[_0x3388('0x4a')](handleError(_0x3e5a19,null));};exports[_0x3388('0x8a')]=function(_0x1c030d,_0x579e34,_0x4ae056){return db[_0x3388('0x47')][_0x3388('0x4e')]({'where':{'id':_0x1c030d[_0x3388('0x4c')]['id']}})[_0x3388('0x2a')](handleEntityNotFound(_0x579e34,null))[_0x3388('0x2a')](function(_0x1c0345){if(_0x1c0345){return _0x1c0345[_0x3388('0x8a')](_0x1c030d['body'][_0x3388('0x6b')],_[_0x3388('0x8b')](_0x1c030d[_0x3388('0x56')],[_0x3388('0x6b'),'id'])||{})[_0x3388('0x8c')](function(_0x43f6a4){for(var _0x3c5e31=0x0;_0x3c5e31<_0x1c030d[_0x3388('0x56')][_0x3388('0x6b')][_0x3388('0x3c')];_0x3c5e31+=0x1){socket[_0x3388('0x75')](_0x3388('0x76'),{'UserId':Number(_0x1c030d[_0x3388('0x56')][_0x3388('0x6b')][_0x3c5e31]),'FaxQueueId':Number(_0x1c030d[_0x3388('0x4c')]['id'])});}return _0x43f6a4;});}})[_0x3388('0x2a')](respondWithResult(_0x579e34,null))[_0x3388('0x4a')](handleError(_0x579e34,null));};exports[_0x3388('0x88')]=function(_0x21eac9,_0x4f6508,_0xe90e46){return db[_0x3388('0x47')][_0x3388('0x4e')]({'where':{'id':_0x21eac9[_0x3388('0x4c')]['id']}})[_0x3388('0x2a')](handleEntityNotFound(_0x4f6508,null))['then'](function(_0x5ae3aa){if(_0x5ae3aa){return _0x5ae3aa['removeAgents'](_0x21eac9[_0x3388('0x36')][_0x3388('0x6b')])['then'](function(){if(_[_0x3388('0x8d')](_0x21eac9['query'][_0x3388('0x6b')])){for(var _0x26f1e5=0x0;_0x26f1e5<_0x21eac9[_0x3388('0x36')][_0x3388('0x6b')][_0x3388('0x3c')];_0x26f1e5+=0x1){socket['emit'](_0x3388('0x89'),{'UserId':Number(_0x21eac9['query'][_0x3388('0x6b')][_0x26f1e5]),'FaxQueueId':Number(_0x21eac9[_0x3388('0x4c')]['id'])});}}else{socket['emit'](_0x3388('0x89'),{'UserId':Number(_0x21eac9[_0x3388('0x36')][_0x3388('0x6b')]),'FaxQueueId':Number(_0x21eac9[_0x3388('0x4c')]['id'])});}});}})[_0x3388('0x2a')](respondWithStatusCode(_0x4f6508,null))[_0x3388('0x4a')](handleError(_0x4f6508,null));};exports[_0x3388('0x8e')]=function(_0x589f40,_0x18af4f,_0x5d7b0f){var _0x228932={};var _0x244bd4={};var _0xa1660e;var _0x26da5f;return db[_0x3388('0x47')][_0x3388('0x59')]({'where':{'id':_0x589f40[_0x3388('0x4c')]['id']}})['then'](handleEntityNotFound(_0x18af4f,null))[_0x3388('0x2a')](function(_0x108336){if(_0x108336){_0xa1660e=_0x108336;_0x244bd4[_0x3388('0x35')]=_['keys'](db[_0x3388('0x5d')][_0x3388('0x33')]);_0x244bd4['query']=_[_0x3388('0x37')](_0x589f40[_0x3388('0x36')]);_0x244bd4[_0x3388('0x38')]=_[_0x3388('0x39')](_0x244bd4[_0x3388('0x35')],_0x244bd4[_0x3388('0x36')]);_0x228932[_0x3388('0x3a')]=_[_0x3388('0x39')](_0x244bd4[_0x3388('0x35')],qs[_0x3388('0x3b')](_0x589f40[_0x3388('0x36')][_0x3388('0x3b')]));_0x228932['attributes']=_0x228932[_0x3388('0x3a')]['length']?_0x228932[_0x3388('0x3a')]:_0x244bd4[_0x3388('0x35')];_0x228932['order']=qs[_0x3388('0x40')](_0x589f40[_0x3388('0x36')][_0x3388('0x40')]);_0x228932[_0x3388('0x41')]=qs[_0x3388('0x38')](_[_0x3388('0x5c')](_0x589f40[_0x3388('0x36')],_0x244bd4['filters']));if(_0x589f40[_0x3388('0x36')]['filter']){_0x228932[_0x3388('0x41')]=_[_0x3388('0x43')](_0x228932[_0x3388('0x41')],{'$or':_['map'](_0x228932[_0x3388('0x3a')],function(_0x36431b){var _0x38c134={};_0x38c134[_0x36431b]={'$like':'%'+_0x589f40[_0x3388('0x36')]['filter']+'%'};return _0x38c134;})});}_0x228932=_[_0x3388('0x43')]({},_0x228932,_0x589f40['options']);return _0xa1660e['getAgents'](_0x228932);}})[_0x3388('0x2a')](function(_0x3224ae){if(_0x3224ae){_0x26da5f=_0x3224ae[_0x3388('0x3c')];if(!_0x589f40[_0x3388('0x36')][_0x3388('0x3d')]('nolimit')){_0x228932[_0x3388('0x3f')]=qs['limit'](_0x589f40[_0x3388('0x36')][_0x3388('0x3f')]);_0x228932[_0x3388('0x23')]=qs[_0x3388('0x23')](_0x589f40[_0x3388('0x36')][_0x3388('0x23')]);}return _0xa1660e['getAgents'](_0x228932);}})[_0x3388('0x2a')](function(_0x32e65a){if(_0x32e65a){return _0x32e65a?{'count':_0x26da5f,'rows':_0x32e65a}:null;}})['then'](respondWithResult(_0x18af4f,null))[_0x3388('0x4a')](handleError(_0x18af4f,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index 1fcf60c..f815fe3 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 _0x3222=['exports','events','../../mysqldb','update','remove','emit','hasOwnProperty','hook'];(function(_0x3968cf,_0x57aba3){var _0x4b3687=function(_0x2321d5){while(--_0x2321d5){_0x3968cf['push'](_0x3968cf['shift']());}};_0x4b3687(++_0x57aba3);}(_0x3222,0x1e1));var _0x2322=function(_0x2baacf,_0x504f68){_0x2baacf=_0x2baacf-0x0;var _0x21e793=_0x3222[_0x2baacf];return _0x21e793;};'use strict';var EventEmitter=require(_0x2322('0x0'));var FaxQueue=require(_0x2322('0x1'))['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x2322('0x2'),'afterDestroy':_0x2322('0x3')};function emitEvent(_0x3285be){return function(_0x99b16a,_0x327fb4,_0x52045e){FaxQueueEvents[_0x2322('0x4')](_0x3285be+':'+_0x99b16a['id'],_0x99b16a);FaxQueueEvents['emit'](_0x3285be,_0x99b16a);_0x52045e(null);};}for(var e in events){if(events[_0x2322('0x5')](e)){var event=events[e];FaxQueue[_0x2322('0x6')](e,emitEvent(event));}}module[_0x2322('0x7')]=FaxQueueEvents; \ No newline at end of file +var _0xb138=['emit','hasOwnProperty','hook','events','FaxQueue','setMaxListeners','update'];(function(_0x45f951,_0x2750c8){var _0x24756c=function(_0x31c931){while(--_0x31c931){_0x45f951['push'](_0x45f951['shift']());}};_0x24756c(++_0x2750c8);}(_0xb138,0x1a0));var _0x8b13=function(_0x27fefa,_0x5b995a){_0x27fefa=_0x27fefa-0x0;var _0x9652a5=_0xb138[_0x27fefa];return _0x9652a5;};'use strict';var EventEmitter=require(_0x8b13('0x0'));var FaxQueue=require('../../mysqldb')['db'][_0x8b13('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x8b13('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8b13('0x3'),'afterDestroy':'remove'};function emitEvent(_0x2223b8){return function(_0x5cfae4,_0x12d3ff,_0x571b99){FaxQueueEvents[_0x8b13('0x4')](_0x2223b8+':'+_0x5cfae4['id'],_0x5cfae4);FaxQueueEvents[_0x8b13('0x4')](_0x2223b8,_0x5cfae4);_0x571b99(null);};}for(var e in events){if(events[_0x8b13('0x5')](e)){var event=events[e];FaxQueue[_0x8b13('0x6')](e,emitEvent(event));}}module['exports']=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index 212413a..952130d 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 _0x22b0=['../../config/environment','exports','define','FaxQueue','fax_queues','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x5775c4,_0x11631c){var _0xa2e3a1=function(_0x3c9a67){while(--_0x3c9a67){_0x5775c4['push'](_0x5775c4['shift']());}};_0xa2e3a1(++_0x11631c);}(_0x22b0,0x89));var _0x022b=function(_0x5c3d11,_0x589686){_0x5c3d11=_0x5c3d11-0x0;var _0x31e455=_0x22b0[_0x5c3d11];return _0x31e455;};'use strict';var _=require(_0x022b('0x0'));var util=require(_0x022b('0x1'));var logger=require(_0x022b('0x2'))('api');var moment=require(_0x022b('0x3'));var BPromise=require(_0x022b('0x4'));var rp=require(_0x022b('0x5'));var fs=require('fs');var path=require(_0x022b('0x6'));var rimraf=require('rimraf');var config=require(_0x022b('0x7'));var attributes=require('./faxQueue.attributes');module[_0x022b('0x8')]=function(_0xbeff32,_0x2f24e7){return _0xbeff32[_0x022b('0x9')](_0x022b('0xa'),attributes,{'tableName':_0x022b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd4ab=['api','moment','bluebird','request-promise','path','../../config/environment','./faxQueue.attributes','FaxQueue','fax_queues','lodash','util','../../config/logger'];(function(_0xc3b891,_0x5a06a6){var _0xe3d063=function(_0x51bd94){while(--_0x51bd94){_0xc3b891['push'](_0xc3b891['shift']());}};_0xe3d063(++_0x5a06a6);}(_0xd4ab,0xd5));var _0xbd4a=function(_0x3520a0,_0x27eecf){_0x3520a0=_0x3520a0-0x0;var _0x2a6ed6=_0xd4ab[_0x3520a0];return _0x2a6ed6;};'use strict';var _=require(_0xbd4a('0x0'));var util=require(_0xbd4a('0x1'));var logger=require(_0xbd4a('0x2'))(_0xbd4a('0x3'));var moment=require(_0xbd4a('0x4'));var BPromise=require(_0xbd4a('0x5'));var rp=require(_0xbd4a('0x6'));var fs=require('fs');var path=require(_0xbd4a('0x7'));var rimraf=require('rimraf');var config=require(_0xbd4a('0x8'));var attributes=require(_0xbd4a('0x9'));module['exports']=function(_0x55b96c,_0x242aa5){return _0x55b96c['define'](_0xbd4a('0xa'),attributes,{'tableName':_0xbd4a('0xb'),'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 246eb3d..ea606e7 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 _0xa487=['register','request','then','FaxQueue,\x20%s,\x20%s','request\x20sent','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','FaxQueue','findAll','options','raw','where','attributes','limit','include','map','model','GetFaxQueue','debug','ShowFaxQueue','info','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','http','redis','defaults','socket.io-emitter','./faxQueue.socket'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa487,0xbe));var _0x7a48=function(_0x47eabb,_0x5c6713){_0x47eabb=_0x47eabb-0x0;var _0x2f0cee=_0xa487[_0x47eabb];return _0x2f0cee;};'use strict';var _=require(_0x7a48('0x0'));var util=require(_0x7a48('0x1'));var moment=require(_0x7a48('0x2'));var BPromise=require(_0x7a48('0x3'));var rs=require(_0x7a48('0x4'));var fs=require('fs');var Redis=require(_0x7a48('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x7a48('0x6'));var logger=require(_0x7a48('0x7'))(_0x7a48('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7a48('0x9')][_0x7a48('0xa')]({'port':0x232a});config[_0x7a48('0xb')]=_[_0x7a48('0xc')](config[_0x7a48('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x7a48('0xd'))(new Redis(config[_0x7a48('0xb')]));require(_0x7a48('0xe'))[_0x7a48('0xf')](socket);function respondWithRpcPromise(_0x51726a,_0x4d68a8,_0x25fb02){return new BPromise(function(_0x479510,_0x27a484){return client[_0x7a48('0x10')](_0x51726a,_0x25fb02)[_0x7a48('0x11')](function(_0x204ed3){logger['info'](_0x7a48('0x12'),_0x4d68a8,_0x7a48('0x13'));logger['debug'](_0x7a48('0x14'),_0x4d68a8,'request\x20sent',JSON[_0x7a48('0x15')](_0x204ed3));if(_0x204ed3[_0x7a48('0x16')]){if(_0x204ed3[_0x7a48('0x16')][_0x7a48('0x17')]===0x1f4){logger[_0x7a48('0x16')](_0x7a48('0x12'),_0x4d68a8,_0x204ed3[_0x7a48('0x16')][_0x7a48('0x18')]);return _0x27a484(_0x204ed3['error'][_0x7a48('0x18')]);}logger['error']('FaxQueue,\x20%s,\x20%s',_0x4d68a8,_0x204ed3[_0x7a48('0x16')]['message']);return _0x479510(_0x204ed3['error']['message']);}else{logger['info'](_0x7a48('0x12'),_0x4d68a8,_0x7a48('0x13'));_0x479510(_0x204ed3[_0x7a48('0x19')][_0x7a48('0x18')]);}})[_0x7a48('0x1a')](function(_0x20cbf1){logger[_0x7a48('0x16')](_0x7a48('0x12'),_0x4d68a8,_0x20cbf1);_0x27a484(_0x20cbf1);});});}exports['GetFaxQueue']=function(_0x6468a8){var _0xd0f734=this;return new Promise(function(_0x35cc90,_0x11e4ed){return db[_0x7a48('0x1b')][_0x7a48('0x1c')]({'raw':_0x6468a8['options']?_0x6468a8[_0x7a48('0x1d')][_0x7a48('0x1e')]===undefined?!![]:![]:!![],'where':_0x6468a8[_0x7a48('0x1d')]?_0x6468a8[_0x7a48('0x1d')][_0x7a48('0x1f')]||null:null,'attributes':_0x6468a8[_0x7a48('0x1d')]?_0x6468a8['options'][_0x7a48('0x20')]||null:null,'limit':_0x6468a8[_0x7a48('0x1d')]?_0x6468a8[_0x7a48('0x1d')][_0x7a48('0x21')]||null:null,'include':_0x6468a8['options']?_0x6468a8[_0x7a48('0x1d')][_0x7a48('0x22')]?_[_0x7a48('0x23')](_0x6468a8['options'][_0x7a48('0x22')],function(_0x3e308c){return{'model':db[_0x3e308c['model']],'as':_0x3e308c['as'],'attributes':_0x3e308c[_0x7a48('0x20')],'include':_0x3e308c[_0x7a48('0x22')]?_['map'](_0x3e308c['include'],function(_0x50820a){return{'model':db[_0x50820a[_0x7a48('0x24')]],'as':_0x50820a['as'],'attributes':_0x50820a[_0x7a48('0x20')],'include':_0x50820a['include']?_['map'](_0x50820a[_0x7a48('0x22')],function(_0x504bb5){return{'model':db[_0x504bb5[_0x7a48('0x24')]],'as':_0x504bb5['as'],'attributes':_0x504bb5[_0x7a48('0x20')]};}):[]};}):[]};}):[]:[]})[_0x7a48('0x11')](function(_0xb1dd8e){logger['info'](_0x7a48('0x25'),_0x6468a8);logger[_0x7a48('0x26')](_0x7a48('0x25'),_0x6468a8,JSON[_0x7a48('0x15')](_0xb1dd8e));_0x35cc90(_0xb1dd8e);})['catch'](function(_0x3b476c){logger[_0x7a48('0x16')](_0x7a48('0x25'),_0x3b476c[_0x7a48('0x18')],_0x6468a8);_0x11e4ed(_0xd0f734[_0x7a48('0x16')](0x1f4,_0x3b476c['message']));});});};exports[_0x7a48('0x27')]=function(_0x2f2cf5){var _0xf66404=this;return new Promise(function(_0x22b03a,_0x264357){return db[_0x7a48('0x1b')]['find']({'raw':_0x2f2cf5['options']?_0x2f2cf5[_0x7a48('0x1d')][_0x7a48('0x1e')]===undefined?!![]:![]:!![],'where':_0x2f2cf5[_0x7a48('0x1d')]?_0x2f2cf5[_0x7a48('0x1d')][_0x7a48('0x1f')]||null:null,'attributes':_0x2f2cf5['options']?_0x2f2cf5[_0x7a48('0x1d')][_0x7a48('0x20')]||null:null,'include':_0x2f2cf5[_0x7a48('0x1d')]?_0x2f2cf5[_0x7a48('0x1d')][_0x7a48('0x22')]?_[_0x7a48('0x23')](_0x2f2cf5[_0x7a48('0x1d')]['include'],function(_0x1a649b){return{'model':db[_0x1a649b[_0x7a48('0x24')]],'as':_0x1a649b['as'],'attributes':_0x1a649b[_0x7a48('0x20')],'include':_0x1a649b['include']?_[_0x7a48('0x23')](_0x1a649b[_0x7a48('0x22')],function(_0x9d92b3){return{'model':db[_0x9d92b3[_0x7a48('0x24')]],'as':_0x9d92b3['as'],'attributes':_0x9d92b3[_0x7a48('0x20')],'include':_0x9d92b3[_0x7a48('0x22')]?_[_0x7a48('0x23')](_0x9d92b3['include'],function(_0x44f0cd){return{'model':db[_0x44f0cd[_0x7a48('0x24')]],'as':_0x44f0cd['as'],'attributes':_0x44f0cd[_0x7a48('0x20')]};}):[]};}):[]};}):[]:[]})[_0x7a48('0x11')](function(_0x829ce){logger[_0x7a48('0x28')]('ShowFaxQueue',_0x2f2cf5);logger[_0x7a48('0x26')](_0x7a48('0x27'),_0x2f2cf5,JSON[_0x7a48('0x15')](_0x829ce));_0x22b03a(_0x829ce);})['catch'](function(_0x15bb2a){logger[_0x7a48('0x16')](_0x7a48('0x27'),_0x15bb2a[_0x7a48('0x18')],_0x2f2cf5);_0x264357(_0xf66404[_0x7a48('0x16')](0x1f4,_0x15bb2a[_0x7a48('0x18')]));});});}; \ No newline at end of file +var _0x83fc=['./faxQueue.socket','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','FaxQueue','options','raw','include','map','model','attributes','GetFaxQueue','find','where','ShowFaxQueue','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults'];(function(_0x505458,_0x2164b5){var _0x27c96a=function(_0x421036){while(--_0x421036){_0x505458['push'](_0x505458['shift']());}};_0x27c96a(++_0x2164b5);}(_0x83fc,0x66));var _0xc83f=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0x83fc[_0x5f1391];return _0x50ebe3;};'use strict';var _=require(_0xc83f('0x0'));var util=require(_0xc83f('0x1'));var moment=require(_0xc83f('0x2'));var BPromise=require(_0xc83f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc83f('0x4'));var db=require(_0xc83f('0x5'))['db'];var utils=require(_0xc83f('0x6'));var logger=require(_0xc83f('0x7'))(_0xc83f('0x8'));var config=require(_0xc83f('0x9'));var jayson=require(_0xc83f('0xa'));var client=jayson[_0xc83f('0xb')][_0xc83f('0xc')]({'port':0x232a});config[_0xc83f('0xd')]=_[_0xc83f('0xe')](config[_0xc83f('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc83f('0xd')]));require(_0xc83f('0xf'))['register'](socket);function respondWithRpcPromise(_0x1b9308,_0x3f3e74,_0x4a4d4e){return new BPromise(function(_0x165eea,_0x48ff46){return client['request'](_0x1b9308,_0x4a4d4e)[_0xc83f('0x10')](function(_0x2e2ad9){logger[_0xc83f('0x11')](_0xc83f('0x12'),_0x3f3e74,_0xc83f('0x13'));logger[_0xc83f('0x14')](_0xc83f('0x15'),_0x3f3e74,'request\x20sent',JSON[_0xc83f('0x16')](_0x2e2ad9));if(_0x2e2ad9[_0xc83f('0x17')]){if(_0x2e2ad9[_0xc83f('0x17')][_0xc83f('0x18')]===0x1f4){logger[_0xc83f('0x17')](_0xc83f('0x12'),_0x3f3e74,_0x2e2ad9[_0xc83f('0x17')][_0xc83f('0x19')]);return _0x48ff46(_0x2e2ad9[_0xc83f('0x17')][_0xc83f('0x19')]);}logger[_0xc83f('0x17')](_0xc83f('0x12'),_0x3f3e74,_0x2e2ad9[_0xc83f('0x17')][_0xc83f('0x19')]);return _0x165eea(_0x2e2ad9[_0xc83f('0x17')]['message']);}else{logger[_0xc83f('0x11')](_0xc83f('0x12'),_0x3f3e74,'request\x20sent');_0x165eea(_0x2e2ad9[_0xc83f('0x1a')][_0xc83f('0x19')]);}})[_0xc83f('0x1b')](function(_0x12fb5e){logger[_0xc83f('0x17')](_0xc83f('0x12'),_0x3f3e74,_0x12fb5e);_0x48ff46(_0x12fb5e);});});}exports['GetFaxQueue']=function(_0x20d8dd){var _0x425503=this;return new Promise(function(_0x43436e,_0xb59ea8){return db[_0xc83f('0x1c')]['findAll']({'raw':_0x20d8dd[_0xc83f('0x1d')]?_0x20d8dd['options'][_0xc83f('0x1e')]===undefined?!![]:![]:!![],'where':_0x20d8dd['options']?_0x20d8dd[_0xc83f('0x1d')]['where']||null:null,'attributes':_0x20d8dd['options']?_0x20d8dd[_0xc83f('0x1d')]['attributes']||null:null,'limit':_0x20d8dd[_0xc83f('0x1d')]?_0x20d8dd['options']['limit']||null:null,'include':_0x20d8dd[_0xc83f('0x1d')]?_0x20d8dd[_0xc83f('0x1d')][_0xc83f('0x1f')]?_[_0xc83f('0x20')](_0x20d8dd['options']['include'],function(_0x8580fa){return{'model':db[_0x8580fa[_0xc83f('0x21')]],'as':_0x8580fa['as'],'attributes':_0x8580fa[_0xc83f('0x22')],'include':_0x8580fa[_0xc83f('0x1f')]?_[_0xc83f('0x20')](_0x8580fa['include'],function(_0x280815){return{'model':db[_0x280815[_0xc83f('0x21')]],'as':_0x280815['as'],'attributes':_0x280815[_0xc83f('0x22')],'include':_0x280815[_0xc83f('0x1f')]?_['map'](_0x280815['include'],function(_0x2627a1){return{'model':db[_0x2627a1['model']],'as':_0x2627a1['as'],'attributes':_0x2627a1[_0xc83f('0x22')]};}):[]};}):[]};}):[]:[]})[_0xc83f('0x10')](function(_0x55fa22){logger[_0xc83f('0x11')](_0xc83f('0x23'),_0x20d8dd);logger['debug'](_0xc83f('0x23'),_0x20d8dd,JSON[_0xc83f('0x16')](_0x55fa22));_0x43436e(_0x55fa22);})['catch'](function(_0x1e1295){logger[_0xc83f('0x17')]('GetFaxQueue',_0x1e1295[_0xc83f('0x19')],_0x20d8dd);_0xb59ea8(_0x425503[_0xc83f('0x17')](0x1f4,_0x1e1295[_0xc83f('0x19')]));});});};exports['ShowFaxQueue']=function(_0xa2fbbf){var _0x28bc94=this;return new Promise(function(_0x5a2f69,_0x4bff7d){return db[_0xc83f('0x1c')][_0xc83f('0x24')]({'raw':_0xa2fbbf['options']?_0xa2fbbf[_0xc83f('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0xa2fbbf['options']?_0xa2fbbf['options'][_0xc83f('0x25')]||null:null,'attributes':_0xa2fbbf[_0xc83f('0x1d')]?_0xa2fbbf[_0xc83f('0x1d')][_0xc83f('0x22')]||null:null,'include':_0xa2fbbf[_0xc83f('0x1d')]?_0xa2fbbf[_0xc83f('0x1d')][_0xc83f('0x1f')]?_['map'](_0xa2fbbf['options'][_0xc83f('0x1f')],function(_0x2d7490){return{'model':db[_0x2d7490[_0xc83f('0x21')]],'as':_0x2d7490['as'],'attributes':_0x2d7490[_0xc83f('0x22')],'include':_0x2d7490[_0xc83f('0x1f')]?_[_0xc83f('0x20')](_0x2d7490[_0xc83f('0x1f')],function(_0x54ede5){return{'model':db[_0x54ede5[_0xc83f('0x21')]],'as':_0x54ede5['as'],'attributes':_0x54ede5['attributes'],'include':_0x54ede5[_0xc83f('0x1f')]?_['map'](_0x54ede5[_0xc83f('0x1f')],function(_0x54eb67){return{'model':db[_0x54eb67[_0xc83f('0x21')]],'as':_0x54eb67['as'],'attributes':_0x54eb67[_0xc83f('0x22')]};}):[]};}):[]};}):[]:[]})[_0xc83f('0x10')](function(_0x55945d){logger['info'](_0xc83f('0x26'),_0xa2fbbf);logger['debug'](_0xc83f('0x26'),_0xa2fbbf,JSON['stringify'](_0x55945d));_0x5a2f69(_0x55945d);})[_0xc83f('0x1b')](function(_0x550da2){logger[_0xc83f('0x17')](_0xc83f('0x26'),_0x550da2['message'],_0xa2fbbf);_0x4bff7d(_0x28bc94['error'](0x1f4,_0x550da2[_0xc83f('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index c05471a..147b7de 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 _0xaa40=['emit','removeListener','register','length','./faxQueue.events','remove','update'];(function(_0x1f1272,_0x3bd8d5){var _0x2670ab=function(_0x496fd7){while(--_0x496fd7){_0x1f1272['push'](_0x1f1272['shift']());}};_0x2670ab(++_0x3bd8d5);}(_0xaa40,0x107));var _0x0aa4=function(_0x47b57e,_0x3e23b7){_0x47b57e=_0x47b57e-0x0;var _0xcf4d7f=_0xaa40[_0x47b57e];return _0xcf4d7f;};'use strict';var FaxQueueEvents=require(_0x0aa4('0x0'));var events=['save',_0x0aa4('0x1'),_0x0aa4('0x2')];function createListener(_0x146a21,_0x1c9470){return function(_0x6b94ce){_0x1c9470[_0x0aa4('0x3')](_0x146a21,_0x6b94ce);};}function removeListener(_0x359ef9,_0x37a677){return function(){FaxQueueEvents[_0x0aa4('0x4')](_0x359ef9,_0x37a677);};}exports[_0x0aa4('0x5')]=function(_0x59239e){for(var _0x40e8ea=0x0,_0x2d6d51=events[_0x0aa4('0x6')];_0x40e8ea<_0x2d6d51;_0x40e8ea++){var _0x16233f=events[_0x40e8ea];var _0x4751e2=createListener('faxQueue:'+_0x16233f,_0x59239e);FaxQueueEvents['on'](_0x16233f,_0x4751e2);}}; \ No newline at end of file +var _0x61eb=['removeListener','register','length','faxQueue:','./faxQueue.events','save','remove'];(function(_0x18a01c,_0xd1a13a){var _0x2b0cd6=function(_0x563571){while(--_0x563571){_0x18a01c['push'](_0x18a01c['shift']());}};_0x2b0cd6(++_0xd1a13a);}(_0x61eb,0x14d));var _0xb61e=function(_0x138a75,_0x4a0e7c){_0x138a75=_0x138a75-0x0;var _0x4e7560=_0x61eb[_0x138a75];return _0x4e7560;};'use strict';var FaxQueueEvents=require(_0xb61e('0x0'));var events=[_0xb61e('0x1'),_0xb61e('0x2'),'update'];function createListener(_0x3f762d,_0x446c4b){return function(_0x5a014e){_0x446c4b['emit'](_0x3f762d,_0x5a014e);};}function removeListener(_0x16a16b,_0xc9dd5){return function(){FaxQueueEvents[_0xb61e('0x3')](_0x16a16b,_0xc9dd5);};}exports[_0xb61e('0x4')]=function(_0x551dce){for(var _0x10c401=0x0,_0x5ae373=events[_0xb61e('0x5')];_0x10c401<_0x5ae373;_0x10c401++){var _0xe56b6c=events[_0x10c401];var _0x429478=createListener(_0xb61e('0x6')+_0xe56b6c,_0x551dce);FaxQueueEvents['on'](_0xe56b6c,_0x429478);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index 66c0ebc..818c8c1 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 _0x50a5=['exports','multer','util','fs-extra','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addAgents','update','delete','destroy','removeAgents'];(function(_0xf756de,_0x7aca69){var _0x43eab9=function(_0x4cf309){while(--_0x4cf309){_0xf756de['push'](_0xf756de['shift']());}};_0x43eab9(++_0x7aca69);}(_0x50a5,0xd1));var _0x550a=function(_0x489611,_0xdecc4c){_0x489611=_0x489611-0x0;var _0x36d0fc=_0x50a5[_0x489611];return _0x36d0fc;};'use strict';var multer=require(_0x550a('0x0'));var util=require(_0x550a('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x550a('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x550a('0x3'));var config=require(_0x550a('0x4'));var controller=require(_0x550a('0x5'));router[_0x550a('0x6')]('/',auth[_0x550a('0x7')](),controller[_0x550a('0x8')]);router[_0x550a('0x6')](_0x550a('0x9'),auth[_0x550a('0x7')](),controller[_0x550a('0xa')]);router[_0x550a('0x6')](_0x550a('0xb'),auth[_0x550a('0x7')](),controller['show']);router[_0x550a('0x6')](_0x550a('0xc'),auth[_0x550a('0x7')](),controller[_0x550a('0xd')]);router[_0x550a('0x6')](_0x550a('0xe'),auth['isAuthenticated'](),controller[_0x550a('0xf')]);router[_0x550a('0x6')](_0x550a('0x10'),auth[_0x550a('0x7')](),controller[_0x550a('0x11')]);router[_0x550a('0x12')]('/',auth[_0x550a('0x7')](),controller[_0x550a('0x13')]);router['post'](_0x550a('0xe'),auth['isAuthenticated'](),controller['addTeams']);router[_0x550a('0x12')](_0x550a('0x10'),auth['isAuthenticated'](),controller[_0x550a('0x14')]);router['put'](_0x550a('0xb'),auth['isAuthenticated'](),controller[_0x550a('0x15')]);router[_0x550a('0x16')](_0x550a('0xb'),auth[_0x550a('0x7')](),controller[_0x550a('0x17')]);router[_0x550a('0x16')]('/:id/teams',auth[_0x550a('0x7')](),controller['removeTeams']);router[_0x550a('0x16')](_0x550a('0x10'),auth[_0x550a('0x7')](),controller[_0x550a('0x18')]);module[_0x550a('0x19')]=router; \ No newline at end of file +var _0x2b29=['../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','index','/describe','isAuthenticated','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','create','post','addTeams','addAgents','put','delete','removeTeams','removeAgents','exports','util','path','connect-timeout','express','fs-extra'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2b29,0x163));var _0x92b2=function(_0x3be9b5,_0x41fe38){_0x3be9b5=_0x3be9b5-0x0;var _0x523abf=_0x2b29[_0x3be9b5];return _0x523abf;};'use strict';var multer=require('multer');var util=require(_0x92b2('0x0'));var path=require(_0x92b2('0x1'));var timeout=require(_0x92b2('0x2'));var express=require(_0x92b2('0x3'));var router=express['Router']();var fs_extra=require(_0x92b2('0x4'));var auth=require(_0x92b2('0x5'));var interaction=require(_0x92b2('0x6'));var config=require(_0x92b2('0x7'));var controller=require(_0x92b2('0x8'));router[_0x92b2('0x9')]('/',auth['isAuthenticated'](),controller[_0x92b2('0xa')]);router['get'](_0x92b2('0xb'),auth[_0x92b2('0xc')](),controller['describe']);router[_0x92b2('0x9')](_0x92b2('0xd'),auth[_0x92b2('0xc')](),controller[_0x92b2('0xe')]);router['get'](_0x92b2('0xf'),auth[_0x92b2('0xc')](),controller[_0x92b2('0x10')]);router[_0x92b2('0x9')](_0x92b2('0x11'),auth[_0x92b2('0xc')](),controller[_0x92b2('0x12')]);router['get'](_0x92b2('0x13'),auth[_0x92b2('0xc')](),controller[_0x92b2('0x14')]);router['post']('/',auth[_0x92b2('0xc')](),controller[_0x92b2('0x15')]);router[_0x92b2('0x16')](_0x92b2('0x11'),auth[_0x92b2('0xc')](),controller[_0x92b2('0x17')]);router['post'](_0x92b2('0x13'),auth['isAuthenticated'](),controller[_0x92b2('0x18')]);router[_0x92b2('0x19')](_0x92b2('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x92b2('0x1a')]('/:id',auth[_0x92b2('0xc')](),controller['destroy']);router[_0x92b2('0x1a')](_0x92b2('0x11'),auth[_0x92b2('0xc')](),controller[_0x92b2('0x1b')]);router[_0x92b2('0x1a')](_0x92b2('0x13'),auth[_0x92b2('0xc')](),controller[_0x92b2('0x1c')]);module[_0x92b2('0x1d')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index d92aa4f..bcd4213 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 _0xd43b=['sequelize','DATE','moment'];(function(_0x3b490e,_0x3eb38a){var _0x2eb929=function(_0x1c26ff){while(--_0x1c26ff){_0x3b490e['push'](_0x3b490e['shift']());}};_0x2eb929(++_0x3eb38a);}(_0xd43b,0xf8));var _0xbd43=function(_0x5a7464,_0x29d9ac){_0x5a7464=_0x5a7464-0x0;var _0x129fff=_0xd43b[_0x5a7464];return _0x129fff;};'use strict';var moment=require(_0xbd43('0x0'));var Sequelize=require(_0xbd43('0x1'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xbd43('0x2')]},'acceptAt':{'type':Sequelize[_0xbd43('0x2')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x8888=['exports','STRING','DATE','moment','sequelize'];(function(_0x1739e3,_0x31f4bf){var _0x238d44=function(_0x4e67f8){while(--_0x4e67f8){_0x1739e3['push'](_0x1739e3['shift']());}};_0x238d44(++_0x31f4bf);}(_0x8888,0x99));var _0x8888=function(_0x581d43,_0x2c8a96){_0x581d43=_0x581d43-0x0;var _0x4a11de=_0x8888[_0x581d43];return _0x4a11de;};'use strict';var moment=require(_0x8888('0x0'));var Sequelize=require(_0x8888('0x1'));module[_0x8888('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x8888('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x8888('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x8888('0x4')]},'reason':{'type':Sequelize[_0x8888('0x3')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index e24e18b..0db9455 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 _0xd691=['destroy','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','then','error','stack','name','send','index','map','FaxQueueReport','rawAttributes','fieldName','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','filter','merge','type','VIRTUAL','options','includeAll','findAll','catch','show','params','keys','include','find','update','body'];(function(_0x7d62cb,_0x7622c){var _0x3a6266=function(_0x1cc5fa){while(--_0x1cc5fa){_0x7d62cb['push'](_0x7d62cb['shift']());}};_0x3a6266(++_0x7622c);}(_0xd691,0xe6));var _0x1d69=function(_0x1aa59b,_0x26612c){_0x1aa59b=_0x1aa59b-0x0;var _0x33011c=_0xd691[_0x1aa59b];return _0x33011c;};'use strict';var emlformat=require(_0x1d69('0x0'));var rimraf=require(_0x1d69('0x1'));var zipdir=require(_0x1d69('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1d69('0x3'));var moment=require(_0x1d69('0x4'));var BPromise=require(_0x1d69('0x5'));var Mustache=require(_0x1d69('0x6'));var util=require(_0x1d69('0x7'));var path=require(_0x1d69('0x8'));var sox=require(_0x1d69('0x9'));var csv=require(_0x1d69('0xa'));var ejs=require(_0x1d69('0xb'));var fs=require('fs');var fs_extra=require(_0x1d69('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x1d69('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x1d69('0xe'));var toCsv=require(_0x1d69('0xa'));var querystring=require(_0x1d69('0xf'));var Papa=require(_0x1d69('0x10'));var Redis=require('ioredis');var authService=require(_0x1d69('0x11'));var qs=require(_0x1d69('0x12'));var as=require(_0x1d69('0x13'));var hardwareService=require(_0x1d69('0x14'));var logger=require(_0x1d69('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x1d69('0x16'));var licenseUtil=require(_0x1d69('0x17'));var db=require(_0x1d69('0x18'))['db'];function respondWithStatusCode(_0x36ca70,_0x3f703a){_0x3f703a=_0x3f703a||0xcc;return function(_0x78b25d){if(_0x78b25d){return _0x36ca70[_0x1d69('0x19')](_0x3f703a);}return _0x36ca70[_0x1d69('0x1a')](_0x3f703a)[_0x1d69('0x1b')]();};}function respondWithResult(_0x7121cb,_0x292721){_0x292721=_0x292721||0xc8;return function(_0x1f4271){if(_0x1f4271){return _0x7121cb[_0x1d69('0x1a')](_0x292721)['json'](_0x1f4271);}};}function respondWithFilteredResult(_0x52f53d,_0x12e7cd){return function(_0x3fb5d2){if(_0x3fb5d2){var _0x29dd32=typeof _0x12e7cd[_0x1d69('0x1c')]===_0x1d69('0x1d')&&typeof _0x12e7cd[_0x1d69('0x1e')]==='undefined';var _0xb7f031=_0x3fb5d2[_0x1d69('0x1f')];var _0x34f6d4=_0x29dd32?0x0:_0x12e7cd['offset'];var _0x4cebea=_0x29dd32?_0x3fb5d2[_0x1d69('0x1f')]:_0x12e7cd[_0x1d69('0x1c')]+_0x12e7cd[_0x1d69('0x1e')];var _0x57bb5d;if(_0x4cebea>=_0xb7f031){_0x4cebea=_0xb7f031;_0x57bb5d=0xc8;}else{_0x57bb5d=0xce;}_0x52f53d[_0x1d69('0x1a')](_0x57bb5d);return _0x52f53d[_0x1d69('0x20')](_0x1d69('0x21'),_0x34f6d4+'-'+_0x4cebea+'/'+_0xb7f031)[_0x1d69('0x22')](_0x3fb5d2);}return null;};}function patchUpdates(_0x3ef4dc){return function(_0x24feaa){try{jsonpatch[_0x1d69('0x23')](_0x24feaa,_0x3ef4dc,!![]);}catch(_0x62968f){return BPromise['reject'](_0x62968f);}return _0x24feaa[_0x1d69('0x24')]();};}function saveUpdates(_0x122238,_0x1786e1){return function(_0x228d18){if(_0x228d18){return _0x228d18['update'](_0x122238)[_0x1d69('0x25')](function(_0x411ca0){return _0x411ca0;});}return null;};}function removeEntity(_0x2b9a7a,_0x54783d){return function(_0x5352d3){if(_0x5352d3){return _0x5352d3['destroy']()[_0x1d69('0x25')](function(){_0x2b9a7a[_0x1d69('0x1a')](0xcc)[_0x1d69('0x1b')]();});}};}function handleEntityNotFound(_0x1c91bf,_0x4f4449){return function(_0x3af518){if(!_0x3af518){_0x1c91bf[_0x1d69('0x19')](0x194);}return _0x3af518;};}function handleError(_0x51e91b,_0x377913){_0x377913=_0x377913||0x1f4;return function(_0x2dc73f){logger[_0x1d69('0x26')](_0x2dc73f[_0x1d69('0x27')]);if(_0x2dc73f[_0x1d69('0x28')]){delete _0x2dc73f[_0x1d69('0x28')];}_0x51e91b['status'](_0x377913)[_0x1d69('0x29')](_0x2dc73f);};}exports[_0x1d69('0x2a')]=function(_0x3c6b2b,_0x1d521b){var _0x3c0962={},_0x1e5818={},_0x2fd8d3={'count':0x0,'rows':[]};var _0x215052=_[_0x1d69('0x2b')](db[_0x1d69('0x2c')][_0x1d69('0x2d')],function(_0x5e8e8e){return{'name':_0x5e8e8e[_0x1d69('0x2e')],'type':_0x5e8e8e['type'][_0x1d69('0x2f')]};});_0x1e5818[_0x1d69('0x30')]=_[_0x1d69('0x2b')](_0x215052,_0x1d69('0x28'));_0x1e5818['query']=_['keys'](_0x3c6b2b[_0x1d69('0x31')]);_0x1e5818['filters']=_[_0x1d69('0x32')](_0x1e5818[_0x1d69('0x30')],_0x1e5818[_0x1d69('0x31')]);_0x3c0962[_0x1d69('0x33')]=_[_0x1d69('0x32')](_0x1e5818[_0x1d69('0x30')],qs[_0x1d69('0x34')](_0x3c6b2b[_0x1d69('0x31')][_0x1d69('0x34')]));_0x3c0962[_0x1d69('0x33')]=_0x3c0962[_0x1d69('0x33')][_0x1d69('0x35')]?_0x3c0962[_0x1d69('0x33')]:_0x1e5818[_0x1d69('0x30')];if(!_0x3c6b2b['query'][_0x1d69('0x36')](_0x1d69('0x37'))){_0x3c0962[_0x1d69('0x1e')]=qs[_0x1d69('0x1e')](_0x3c6b2b[_0x1d69('0x31')]['limit']);_0x3c0962[_0x1d69('0x1c')]=qs[_0x1d69('0x1c')](_0x3c6b2b[_0x1d69('0x31')][_0x1d69('0x1c')]);}_0x3c0962['order']=qs[_0x1d69('0x38')](_0x3c6b2b[_0x1d69('0x31')][_0x1d69('0x38')]);_0x3c0962[_0x1d69('0x39')]=qs[_0x1d69('0x3a')](_['pick'](_0x3c6b2b['query'],_0x1e5818['filters']),_0x215052);if(_0x3c6b2b[_0x1d69('0x31')][_0x1d69('0x3b')]){_0x3c0962['where']=_[_0x1d69('0x3c')](_0x3c0962[_0x1d69('0x39')],{'$or':_[_0x1d69('0x2b')](_0x215052,function(_0x497e02){if(_0x497e02[_0x1d69('0x3d')]!==_0x1d69('0x3e')){var _0x1a8ba4={};_0x1a8ba4[_0x497e02[_0x1d69('0x28')]]={'$like':'%'+_0x3c6b2b['query'][_0x1d69('0x3b')]+'%'};return _0x1a8ba4;}})});}_0x3c0962=_[_0x1d69('0x3c')]({},_0x3c0962,_0x3c6b2b[_0x1d69('0x3f')]);var _0x3c09bb={'where':_0x3c0962['where']};return db[_0x1d69('0x2c')][_0x1d69('0x1f')](_0x3c09bb)[_0x1d69('0x25')](function(_0x38306a){_0x2fd8d3[_0x1d69('0x1f')]=_0x38306a;if(_0x3c6b2b[_0x1d69('0x31')][_0x1d69('0x40')]){_0x3c0962['include']=[{'all':!![]}];}return db[_0x1d69('0x2c')][_0x1d69('0x41')](_0x3c0962);})['then'](function(_0x3d68c3){_0x2fd8d3['rows']=_0x3d68c3;return _0x2fd8d3;})[_0x1d69('0x25')](respondWithFilteredResult(_0x1d521b,_0x3c0962))[_0x1d69('0x42')](handleError(_0x1d521b,null));};exports[_0x1d69('0x43')]=function(_0xc052d6,_0x5b0a74){var _0x1d6fee={'raw':!![],'where':{'id':_0xc052d6[_0x1d69('0x44')]['id']}},_0x21dfc2={};_0x21dfc2['model']=_[_0x1d69('0x45')](db['FaxQueueReport']['rawAttributes']);_0x21dfc2[_0x1d69('0x31')]=_[_0x1d69('0x45')](_0xc052d6['query']);_0x21dfc2[_0x1d69('0x3a')]=_['intersection'](_0x21dfc2[_0x1d69('0x30')],_0x21dfc2[_0x1d69('0x31')]);_0x1d6fee['attributes']=_[_0x1d69('0x32')](_0x21dfc2[_0x1d69('0x30')],qs[_0x1d69('0x34')](_0xc052d6['query'][_0x1d69('0x34')]));_0x1d6fee[_0x1d69('0x33')]=_0x1d6fee[_0x1d69('0x33')][_0x1d69('0x35')]?_0x1d6fee[_0x1d69('0x33')]:_0x21dfc2[_0x1d69('0x30')];if(_0xc052d6[_0x1d69('0x31')][_0x1d69('0x40')]){_0x1d6fee[_0x1d69('0x46')]=[{'all':!![]}];}_0x1d6fee=_[_0x1d69('0x3c')]({},_0x1d6fee,_0xc052d6[_0x1d69('0x3f')]);return db[_0x1d69('0x2c')][_0x1d69('0x47')](_0x1d6fee)[_0x1d69('0x25')](handleEntityNotFound(_0x5b0a74,null))[_0x1d69('0x25')](respondWithResult(_0x5b0a74,null))[_0x1d69('0x42')](handleError(_0x5b0a74,null));};exports['create']=function(_0x438b3a,_0x11cf7c){return db[_0x1d69('0x2c')]['create'](_0x438b3a['body'],{})[_0x1d69('0x25')](respondWithResult(_0x11cf7c,0xc9))['catch'](handleError(_0x11cf7c,null));};exports[_0x1d69('0x48')]=function(_0x370645,_0x131304){if(_0x370645['body']['id']){delete _0x370645['body']['id'];}return db[_0x1d69('0x2c')]['find']({'where':{'id':_0x370645[_0x1d69('0x44')]['id']}})['then'](handleEntityNotFound(_0x131304,null))['then'](saveUpdates(_0x370645[_0x1d69('0x49')],null))[_0x1d69('0x25')](respondWithResult(_0x131304,null))[_0x1d69('0x42')](handleError(_0x131304,null));};exports[_0x1d69('0x4a')]=function(_0x442041,_0x4e6453){return db[_0x1d69('0x2c')][_0x1d69('0x47')]({'where':{'id':_0x442041['params']['id']}})[_0x1d69('0x25')](handleEntityNotFound(_0x4e6453,null))[_0x1d69('0x25')](removeEntity(_0x4e6453,null))[_0x1d69('0x42')](handleError(_0x4e6453,null));};exports[_0x1d69('0x4b')]=function(_0x4d17b7,_0x10d730){return db['FaxQueueReport'][_0x1d69('0x4b')]()[_0x1d69('0x25')](respondWithResult(_0x10d730,null))[_0x1d69('0x42')](handleError(_0x10d730,null));}; \ No newline at end of file +var _0x5b05=['include','findAll','rows','show','find','catch','create','body','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','then','stack','name','send','index','map','FaxQueueReport','rawAttributes','fieldName','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','filter','where','merge','type','options','includeAll'];(function(_0x324817,_0x2eb0bd){var _0x2abc80=function(_0x40c8c8){while(--_0x40c8c8){_0x324817['push'](_0x324817['shift']());}};_0x2abc80(++_0x2eb0bd);}(_0x5b05,0x190));var _0x55b0=function(_0x261bb4,_0x23add8){_0x261bb4=_0x261bb4-0x0;var _0x4544a6=_0x5b05[_0x261bb4];return _0x4544a6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x55b0('0x0'));var zipdir=require(_0x55b0('0x1'));var jsonpatch=require(_0x55b0('0x2'));var rp=require(_0x55b0('0x3'));var moment=require(_0x55b0('0x4'));var BPromise=require(_0x55b0('0x5'));var Mustache=require(_0x55b0('0x6'));var util=require(_0x55b0('0x7'));var path=require(_0x55b0('0x8'));var sox=require(_0x55b0('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x55b0('0xa'));var _=require(_0x55b0('0xb'));var squel=require(_0x55b0('0xc'));var crypto=require(_0x55b0('0xd'));var jsforce=require(_0x55b0('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x55b0('0xf'));var querystring=require(_0x55b0('0x10'));var Papa=require(_0x55b0('0x11'));var Redis=require(_0x55b0('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x55b0('0x13'));var hardwareService=require(_0x55b0('0x14'));var logger=require(_0x55b0('0x15'))(_0x55b0('0x16'));var utils=require(_0x55b0('0x17'));var config=require(_0x55b0('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x55b0('0x19'))['db'];function respondWithStatusCode(_0x35212d,_0x4d8be8){_0x4d8be8=_0x4d8be8||0xcc;return function(_0x8c1df0){if(_0x8c1df0){return _0x35212d[_0x55b0('0x1a')](_0x4d8be8);}return _0x35212d[_0x55b0('0x1b')](_0x4d8be8)[_0x55b0('0x1c')]();};}function respondWithResult(_0x5baa88,_0x525f9b){_0x525f9b=_0x525f9b||0xc8;return function(_0x4d614b){if(_0x4d614b){return _0x5baa88[_0x55b0('0x1b')](_0x525f9b)['json'](_0x4d614b);}};}function respondWithFilteredResult(_0x7d7527,_0x3ca8e2){return function(_0x4d2271){if(_0x4d2271){var _0x15fa8f=typeof _0x3ca8e2[_0x55b0('0x1d')]===_0x55b0('0x1e')&&typeof _0x3ca8e2[_0x55b0('0x1f')]===_0x55b0('0x1e');var _0x4f98ba=_0x4d2271[_0x55b0('0x20')];var _0x20b1c5=_0x15fa8f?0x0:_0x3ca8e2[_0x55b0('0x1d')];var _0x5ca2ec=_0x15fa8f?_0x4d2271['count']:_0x3ca8e2[_0x55b0('0x1d')]+_0x3ca8e2[_0x55b0('0x1f')];var _0x3f9458;if(_0x5ca2ec>=_0x4f98ba){_0x5ca2ec=_0x4f98ba;_0x3f9458=0xc8;}else{_0x3f9458=0xce;}_0x7d7527['status'](_0x3f9458);return _0x7d7527[_0x55b0('0x21')](_0x55b0('0x22'),_0x20b1c5+'-'+_0x5ca2ec+'/'+_0x4f98ba)[_0x55b0('0x23')](_0x4d2271);}return null;};}function patchUpdates(_0x3ff56c){return function(_0x55b08e){try{jsonpatch[_0x55b0('0x24')](_0x55b08e,_0x3ff56c,!![]);}catch(_0x27ecd1){return BPromise[_0x55b0('0x25')](_0x27ecd1);}return _0x55b08e[_0x55b0('0x26')]();};}function saveUpdates(_0x4fa147,_0x4082ce){return function(_0x5e3acc){if(_0x5e3acc){return _0x5e3acc[_0x55b0('0x27')](_0x4fa147)['then'](function(_0x33bcc1){return _0x33bcc1;});}return null;};}function removeEntity(_0x25eb8a,_0x1ea756){return function(_0x3056f8){if(_0x3056f8){return _0x3056f8[_0x55b0('0x28')]()[_0x55b0('0x29')](function(){_0x25eb8a[_0x55b0('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x244092,_0x54f74f){return function(_0x494092){if(!_0x494092){_0x244092[_0x55b0('0x1a')](0x194);}return _0x494092;};}function handleError(_0x43b2c8,_0x5b2dc8){_0x5b2dc8=_0x5b2dc8||0x1f4;return function(_0x177bb8){logger['error'](_0x177bb8[_0x55b0('0x2a')]);if(_0x177bb8[_0x55b0('0x2b')]){delete _0x177bb8[_0x55b0('0x2b')];}_0x43b2c8[_0x55b0('0x1b')](_0x5b2dc8)[_0x55b0('0x2c')](_0x177bb8);};}exports[_0x55b0('0x2d')]=function(_0x20385f,_0x3b0262){var _0x10d5c9={},_0x4273e0={},_0x443d20={'count':0x0,'rows':[]};var _0x1237f9=_[_0x55b0('0x2e')](db[_0x55b0('0x2f')][_0x55b0('0x30')],function(_0xc62841){return{'name':_0xc62841[_0x55b0('0x31')],'type':_0xc62841['type'][_0x55b0('0x32')]};});_0x4273e0[_0x55b0('0x33')]=_[_0x55b0('0x2e')](_0x1237f9,_0x55b0('0x2b'));_0x4273e0['query']=_[_0x55b0('0x34')](_0x20385f[_0x55b0('0x35')]);_0x4273e0[_0x55b0('0x36')]=_[_0x55b0('0x37')](_0x4273e0[_0x55b0('0x33')],_0x4273e0[_0x55b0('0x35')]);_0x10d5c9['attributes']=_[_0x55b0('0x37')](_0x4273e0['model'],qs[_0x55b0('0x38')](_0x20385f[_0x55b0('0x35')][_0x55b0('0x38')]));_0x10d5c9[_0x55b0('0x39')]=_0x10d5c9[_0x55b0('0x39')][_0x55b0('0x3a')]?_0x10d5c9[_0x55b0('0x39')]:_0x4273e0[_0x55b0('0x33')];if(!_0x20385f[_0x55b0('0x35')][_0x55b0('0x3b')]('nolimit')){_0x10d5c9[_0x55b0('0x1f')]=qs[_0x55b0('0x1f')](_0x20385f[_0x55b0('0x35')][_0x55b0('0x1f')]);_0x10d5c9[_0x55b0('0x1d')]=qs[_0x55b0('0x1d')](_0x20385f[_0x55b0('0x35')][_0x55b0('0x1d')]);}_0x10d5c9[_0x55b0('0x3c')]=qs['sort'](_0x20385f['query'][_0x55b0('0x3d')]);_0x10d5c9['where']=qs[_0x55b0('0x36')](_['pick'](_0x20385f[_0x55b0('0x35')],_0x4273e0[_0x55b0('0x36')]),_0x1237f9);if(_0x20385f['query'][_0x55b0('0x3e')]){_0x10d5c9[_0x55b0('0x3f')]=_[_0x55b0('0x40')](_0x10d5c9['where'],{'$or':_['map'](_0x1237f9,function(_0x512969){if(_0x512969[_0x55b0('0x41')]!=='VIRTUAL'){var _0x4b7d7b={};_0x4b7d7b[_0x512969[_0x55b0('0x2b')]]={'$like':'%'+_0x20385f[_0x55b0('0x35')]['filter']+'%'};return _0x4b7d7b;}})});}_0x10d5c9=_[_0x55b0('0x40')]({},_0x10d5c9,_0x20385f[_0x55b0('0x42')]);var _0x4a70c5={'where':_0x10d5c9['where']};return db[_0x55b0('0x2f')][_0x55b0('0x20')](_0x4a70c5)[_0x55b0('0x29')](function(_0x5f4afc){_0x443d20[_0x55b0('0x20')]=_0x5f4afc;if(_0x20385f[_0x55b0('0x35')][_0x55b0('0x43')]){_0x10d5c9[_0x55b0('0x44')]=[{'all':!![]}];}return db[_0x55b0('0x2f')][_0x55b0('0x45')](_0x10d5c9);})[_0x55b0('0x29')](function(_0x163f93){_0x443d20[_0x55b0('0x46')]=_0x163f93;return _0x443d20;})['then'](respondWithFilteredResult(_0x3b0262,_0x10d5c9))['catch'](handleError(_0x3b0262,null));};exports[_0x55b0('0x47')]=function(_0x323fbc,_0x10bbd9){var _0x22e0c9={'raw':!![],'where':{'id':_0x323fbc['params']['id']}},_0x5cb5e1={};_0x5cb5e1['model']=_[_0x55b0('0x34')](db[_0x55b0('0x2f')][_0x55b0('0x30')]);_0x5cb5e1[_0x55b0('0x35')]=_[_0x55b0('0x34')](_0x323fbc[_0x55b0('0x35')]);_0x5cb5e1['filters']=_[_0x55b0('0x37')](_0x5cb5e1[_0x55b0('0x33')],_0x5cb5e1[_0x55b0('0x35')]);_0x22e0c9['attributes']=_[_0x55b0('0x37')](_0x5cb5e1[_0x55b0('0x33')],qs[_0x55b0('0x38')](_0x323fbc[_0x55b0('0x35')][_0x55b0('0x38')]));_0x22e0c9[_0x55b0('0x39')]=_0x22e0c9['attributes'][_0x55b0('0x3a')]?_0x22e0c9['attributes']:_0x5cb5e1[_0x55b0('0x33')];if(_0x323fbc[_0x55b0('0x35')][_0x55b0('0x43')]){_0x22e0c9[_0x55b0('0x44')]=[{'all':!![]}];}_0x22e0c9=_[_0x55b0('0x40')]({},_0x22e0c9,_0x323fbc[_0x55b0('0x42')]);return db[_0x55b0('0x2f')][_0x55b0('0x48')](_0x22e0c9)['then'](handleEntityNotFound(_0x10bbd9,null))['then'](respondWithResult(_0x10bbd9,null))[_0x55b0('0x49')](handleError(_0x10bbd9,null));};exports[_0x55b0('0x4a')]=function(_0x358b0a,_0x42783e){return db['FaxQueueReport']['create'](_0x358b0a[_0x55b0('0x4b')],{})[_0x55b0('0x29')](respondWithResult(_0x42783e,0xc9))[_0x55b0('0x49')](handleError(_0x42783e,null));};exports['update']=function(_0x4b2df2,_0x7e2fc){if(_0x4b2df2['body']['id']){delete _0x4b2df2[_0x55b0('0x4b')]['id'];}return db[_0x55b0('0x2f')][_0x55b0('0x48')]({'where':{'id':_0x4b2df2[_0x55b0('0x4c')]['id']}})['then'](handleEntityNotFound(_0x7e2fc,null))[_0x55b0('0x29')](saveUpdates(_0x4b2df2['body'],null))[_0x55b0('0x29')](respondWithResult(_0x7e2fc,null))[_0x55b0('0x49')](handleError(_0x7e2fc,null));};exports[_0x55b0('0x28')]=function(_0x955c43,_0xe15280){return db['FaxQueueReport'][_0x55b0('0x48')]({'where':{'id':_0x955c43[_0x55b0('0x4c')]['id']}})[_0x55b0('0x29')](handleEntityNotFound(_0xe15280,null))[_0x55b0('0x29')](removeEntity(_0xe15280,null))['catch'](handleError(_0xe15280,null));};exports[_0x55b0('0x4d')]=function(_0xac7532,_0x3bdaa7){return db[_0x55b0('0x2f')][_0x55b0('0x4d')]()['then'](respondWithResult(_0x3bdaa7,null))[_0x55b0('0x49')](handleError(_0x3bdaa7,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index 5f412bc..c7ae97d 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(_0x5859d9,_0x4abdc7){var _0x53db0e=function(_0x3a5386){while(--_0x3a5386){_0x5859d9['push'](_0x5859d9['shift']());}};_0x53db0e(++_0x4abdc7);}(_0x4975,0x86));var _0x5497=function(_0x96d762,_0x40edf5){_0x96d762=_0x96d762-0x0;var _0x142f0f=_0x4975[_0x96d762];return _0x142f0f;};'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 _0x1261=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueueReport.attributes','define','report_fax_queue','uniqueid','util'];(function(_0x8e7495,_0x53f622){var _0x40ae78=function(_0x3a4639){while(--_0x3a4639){_0x8e7495['push'](_0x8e7495['shift']());}};_0x40ae78(++_0x53f622);}(_0x1261,0x144));var _0x1126=function(_0x32efcb,_0x55523f){_0x32efcb=_0x32efcb-0x0;var _0x1dae88=_0x1261[_0x32efcb];return _0x1dae88;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var logger=require(_0x1126('0x1'))(_0x1126('0x2'));var moment=require(_0x1126('0x3'));var BPromise=require(_0x1126('0x4'));var rp=require(_0x1126('0x5'));var fs=require('fs');var path=require(_0x1126('0x6'));var rimraf=require(_0x1126('0x7'));var config=require(_0x1126('0x8'));var attributes=require(_0x1126('0x9'));module['exports']=function(_0x5c68c8,_0x40ba58){return _0x5c68c8[_0x1126('0xa')]('FaxQueueReport',attributes,{'tableName':_0x1126('0xb'),'paranoid':![],'indexes':[{'name':_0x1126('0xc'),'fields':[_0x1126('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index ad167fa..ea8280c 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 _0x4907=['jayson/promise','client','http','request','then','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','catch','CreateFaxQueueReport','FaxQueueReport','create','body','options','raw','UpdateFaxQueueReport','update','where','limit','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x4208d6,_0x157be1){var _0x2db794=function(_0x427dc9){while(--_0x427dc9){_0x4208d6['push'](_0x4208d6['shift']());}};_0x2db794(++_0x157be1);}(_0x4907,0x14b));var _0x7490=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x4907[_0x2641f9];return _0x585741;};'use strict';var _=require('lodash');var util=require(_0x7490('0x0'));var moment=require(_0x7490('0x1'));var BPromise=require(_0x7490('0x2'));var rs=require(_0x7490('0x3'));var fs=require('fs');var Redis=require(_0x7490('0x4'));var db=require(_0x7490('0x5'))['db'];var utils=require(_0x7490('0x6'));var logger=require('../../config/logger')(_0x7490('0x7'));var config=require(_0x7490('0x8'));var jayson=require(_0x7490('0x9'));var client=jayson[_0x7490('0xa')][_0x7490('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x40156b,_0x2087ce,_0x133e7f){return new BPromise(function(_0x2a7e81,_0x2218b1){return client[_0x7490('0xc')](_0x40156b,_0x133e7f)[_0x7490('0xd')](function(_0x3bb112){logger[_0x7490('0xe')](_0x7490('0xf'),_0x2087ce,_0x7490('0x10'));logger[_0x7490('0x11')]('FaxQueueReport,\x20%s,\x20%s,\x20%s',_0x2087ce,_0x7490('0x10'),JSON[_0x7490('0x12')](_0x3bb112));if(_0x3bb112['error']){if(_0x3bb112['error'][_0x7490('0x13')]===0x1f4){logger['error']('FaxQueueReport,\x20%s,\x20%s',_0x2087ce,_0x3bb112[_0x7490('0x14')][_0x7490('0x15')]);return _0x2218b1(_0x3bb112[_0x7490('0x14')][_0x7490('0x15')]);}logger[_0x7490('0x14')]('FaxQueueReport,\x20%s,\x20%s',_0x2087ce,_0x3bb112[_0x7490('0x14')][_0x7490('0x15')]);return _0x2a7e81(_0x3bb112[_0x7490('0x14')]['message']);}else{logger['info']('FaxQueueReport,\x20%s,\x20%s',_0x2087ce,'request\x20sent');_0x2a7e81(_0x3bb112[_0x7490('0x16')][_0x7490('0x15')]);}})[_0x7490('0x17')](function(_0x4c2e9f){logger['error']('FaxQueueReport,\x20%s,\x20%s',_0x2087ce,_0x4c2e9f);_0x2218b1(_0x4c2e9f);});});}exports[_0x7490('0x18')]=function(_0x3641d6){var _0x18ffc8=this;return new Promise(function(_0x28df66,_0x4680e3){return db[_0x7490('0x19')][_0x7490('0x1a')](_0x3641d6[_0x7490('0x1b')],{'raw':_0x3641d6[_0x7490('0x1c')]?_0x3641d6[_0x7490('0x1c')][_0x7490('0x1d')]===undefined?!![]:![]:!![]})[_0x7490('0xd')](function(_0x268719){logger[_0x7490('0xe')](_0x7490('0x18'),_0x3641d6);logger[_0x7490('0x11')](_0x7490('0x18'),_0x3641d6,JSON[_0x7490('0x12')](_0x268719));_0x28df66(_0x268719);})['catch'](function(_0x3a10e3){logger[_0x7490('0x14')](_0x7490('0x18'),_0x3a10e3['message'],_0x3641d6);_0x4680e3(_0x18ffc8[_0x7490('0x14')](0x1f4,_0x3a10e3[_0x7490('0x15')]));});});};exports[_0x7490('0x1e')]=function(_0xeb344f){var _0x5bb7c5=this;return new Promise(function(_0x18a3af,_0x5d7ff2){return db['FaxQueueReport'][_0x7490('0x1f')](_0xeb344f[_0x7490('0x1b')],{'raw':_0xeb344f[_0x7490('0x1c')]?_0xeb344f[_0x7490('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xeb344f[_0x7490('0x1c')]?_0xeb344f['options'][_0x7490('0x20')]||null:null,'attributes':_0xeb344f['options']?_0xeb344f[_0x7490('0x1c')]['attributes']||null:null,'limit':_0xeb344f[_0x7490('0x1c')]?_0xeb344f[_0x7490('0x1c')][_0x7490('0x21')]||null:null})[_0x7490('0xd')](function(_0x3861bb){logger[_0x7490('0xe')](_0x7490('0x1e'),_0xeb344f);logger['debug'](_0x7490('0x1e'),_0xeb344f,JSON[_0x7490('0x12')](_0x3861bb));_0x18a3af(_0x3861bb);})[_0x7490('0x17')](function(_0x3cd10a){logger['error']('UpdateFaxQueueReport',_0x3cd10a[_0x7490('0x15')],_0xeb344f);_0x5d7ff2(_0x5bb7c5[_0x7490('0x14')](0x1f4,_0x3cd10a[_0x7490('0x15')]));});});}; \ No newline at end of file +var _0xa9da=['bluebird','randomstring','../../mysqldb','../../config/utils','jayson/promise','client','http','request','then','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','FaxQueueReport','create','body','options','CreateFaxQueueReport','UpdateFaxQueueReport','update','attributes','limit','lodash','util','moment'];(function(_0xd780d9,_0x363e00){var _0x7a8708=function(_0x48aa46){while(--_0x48aa46){_0xd780d9['push'](_0xd780d9['shift']());}};_0x7a8708(++_0x363e00);}(_0xa9da,0x19d));var _0xaa9d=function(_0x8fcdbf,_0x5e3bcd){_0x8fcdbf=_0x8fcdbf-0x0;var _0x1bace7=_0xa9da[_0x8fcdbf];return _0x1bace7;};'use strict';var _=require(_0xaa9d('0x0'));var util=require(_0xaa9d('0x1'));var moment=require(_0xaa9d('0x2'));var BPromise=require(_0xaa9d('0x3'));var rs=require(_0xaa9d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaa9d('0x5'))['db'];var utils=require(_0xaa9d('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xaa9d('0x7'));var client=jayson[_0xaa9d('0x8')][_0xaa9d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4e5d5b,_0x255fde,_0x20a03f){return new BPromise(function(_0x56b4fc,_0x4b3866){return client[_0xaa9d('0xa')](_0x4e5d5b,_0x20a03f)[_0xaa9d('0xb')](function(_0x7b814a){logger['info'](_0xaa9d('0xc'),_0x255fde,_0xaa9d('0xd'));logger[_0xaa9d('0xe')](_0xaa9d('0xf'),_0x255fde,'request\x20sent',JSON[_0xaa9d('0x10')](_0x7b814a));if(_0x7b814a[_0xaa9d('0x11')]){if(_0x7b814a[_0xaa9d('0x11')][_0xaa9d('0x12')]===0x1f4){logger[_0xaa9d('0x11')](_0xaa9d('0xc'),_0x255fde,_0x7b814a['error'][_0xaa9d('0x13')]);return _0x4b3866(_0x7b814a[_0xaa9d('0x11')][_0xaa9d('0x13')]);}logger[_0xaa9d('0x11')](_0xaa9d('0xc'),_0x255fde,_0x7b814a[_0xaa9d('0x11')]['message']);return _0x56b4fc(_0x7b814a['error'][_0xaa9d('0x13')]);}else{logger[_0xaa9d('0x14')](_0xaa9d('0xc'),_0x255fde,'request\x20sent');_0x56b4fc(_0x7b814a[_0xaa9d('0x15')][_0xaa9d('0x13')]);}})[_0xaa9d('0x16')](function(_0x3322f2){logger[_0xaa9d('0x11')](_0xaa9d('0xc'),_0x255fde,_0x3322f2);_0x4b3866(_0x3322f2);});});}exports['CreateFaxQueueReport']=function(_0x1fa3d1){var _0x512596=this;return new Promise(function(_0x37e7f7,_0x3e558d){return db[_0xaa9d('0x17')][_0xaa9d('0x18')](_0x1fa3d1[_0xaa9d('0x19')],{'raw':_0x1fa3d1[_0xaa9d('0x1a')]?_0x1fa3d1['options']['raw']===undefined?!![]:![]:!![]})[_0xaa9d('0xb')](function(_0x433565){logger[_0xaa9d('0x14')](_0xaa9d('0x1b'),_0x1fa3d1);logger[_0xaa9d('0xe')](_0xaa9d('0x1b'),_0x1fa3d1,JSON[_0xaa9d('0x10')](_0x433565));_0x37e7f7(_0x433565);})[_0xaa9d('0x16')](function(_0x6f8b91){logger[_0xaa9d('0x11')](_0xaa9d('0x1b'),_0x6f8b91['message'],_0x1fa3d1);_0x3e558d(_0x512596[_0xaa9d('0x11')](0x1f4,_0x6f8b91[_0xaa9d('0x13')]));});});};exports[_0xaa9d('0x1c')]=function(_0x501cd7){var _0x5910b0=this;return new Promise(function(_0x46a449,_0x295aea){return db[_0xaa9d('0x17')][_0xaa9d('0x1d')](_0x501cd7[_0xaa9d('0x19')],{'raw':_0x501cd7[_0xaa9d('0x1a')]?_0x501cd7[_0xaa9d('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x501cd7[_0xaa9d('0x1a')]?_0x501cd7['options']['where']||null:null,'attributes':_0x501cd7[_0xaa9d('0x1a')]?_0x501cd7['options'][_0xaa9d('0x1e')]||null:null,'limit':_0x501cd7['options']?_0x501cd7[_0xaa9d('0x1a')][_0xaa9d('0x1f')]||null:null})[_0xaa9d('0xb')](function(_0x4c398b){logger[_0xaa9d('0x14')](_0xaa9d('0x1c'),_0x501cd7);logger[_0xaa9d('0xe')]('UpdateFaxQueueReport',_0x501cd7,JSON[_0xaa9d('0x10')](_0x4c398b));_0x46a449(_0x4c398b);})['catch'](function(_0x33a334){logger['error'](_0xaa9d('0x1c'),_0x33a334[_0xaa9d('0x13')],_0x501cd7);_0x295aea(_0x5910b0[_0xaa9d('0x11')](0x1f4,_0x33a334[_0xaa9d('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index 242fea1..c308e9d 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 _0x0f82=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get','isAuthenticated','index','/describe','/:id','show','create','put','multer','path'];(function(_0x1a7217,_0x25a7b7){var _0x14291b=function(_0x516763){while(--_0x516763){_0x1a7217['push'](_0x1a7217['shift']());}};_0x14291b(++_0x25a7b7);}(_0x0f82,0x97));var _0x20f8=function(_0x30a36d,_0x92a66b){_0x30a36d=_0x30a36d-0x0;var _0x2f38cc=_0x0f82[_0x30a36d];return _0x2f38cc;};'use strict';var multer=require(_0x20f8('0x0'));var util=require('util');var path=require(_0x20f8('0x1'));var timeout=require('connect-timeout');var express=require(_0x20f8('0x2'));var router=express[_0x20f8('0x3')]();var fs_extra=require(_0x20f8('0x4'));var auth=require(_0x20f8('0x5'));var interaction=require(_0x20f8('0x6'));var config=require(_0x20f8('0x7'));var controller=require(_0x20f8('0x8'));router[_0x20f8('0x9')]('/',auth[_0x20f8('0xa')](),controller[_0x20f8('0xb')]);router[_0x20f8('0x9')](_0x20f8('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0x20f8('0x9')](_0x20f8('0xd'),auth[_0x20f8('0xa')](),controller[_0x20f8('0xe')]);router['post']('/',auth[_0x20f8('0xa')](),controller[_0x20f8('0xf')]);router[_0x20f8('0x10')](_0x20f8('0xd'),auth[_0x20f8('0xa')](),controller['update']);router['delete'](_0x20f8('0xd'),auth[_0x20f8('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x3ab0=['post','put','update','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x2c3999,_0x48222d){var _0x1147af=function(_0x3908b0){while(--_0x3908b0){_0x2c3999['push'](_0x2c3999['shift']());}};_0x1147af(++_0x48222d);}(_0x3ab0,0x84));var _0x03ab=function(_0x14499c,_0x4039bf){_0x14499c=_0x14499c-0x0;var _0x28886b=_0x3ab0[_0x14499c];return _0x28886b;};'use strict';var multer=require(_0x03ab('0x0'));var util=require('util');var path=require(_0x03ab('0x1'));var timeout=require(_0x03ab('0x2'));var express=require('express');var router=express[_0x03ab('0x3')]();var fs_extra=require(_0x03ab('0x4'));var auth=require(_0x03ab('0x5'));var interaction=require(_0x03ab('0x6'));var config=require('../../config/environment');var controller=require(_0x03ab('0x7'));router[_0x03ab('0x8')]('/',auth[_0x03ab('0x9')](),controller[_0x03ab('0xa')]);router[_0x03ab('0x8')](_0x03ab('0xb'),auth[_0x03ab('0x9')](),controller[_0x03ab('0xc')]);router[_0x03ab('0x8')](_0x03ab('0xd'),auth['isAuthenticated'](),controller[_0x03ab('0xe')]);router[_0x03ab('0xf')]('/',auth[_0x03ab('0x9')](),controller['create']);router[_0x03ab('0x10')](_0x03ab('0xd'),auth[_0x03ab('0x9')](),controller[_0x03ab('0x11')]);router[_0x03ab('0x12')](_0x03ab('0xd'),auth['isAuthenticated'](),controller[_0x03ab('0x13')]);module[_0x03ab('0x14')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index 48dca1a..49fcac7 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 _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x33dc9b,_0x4f3aa8){var _0x1fd96d=function(_0x314cef){while(--_0x314cef){_0x33dc9b['push'](_0x33dc9b['shift']());}};_0x1fd96d(++_0x4f3aa8);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x2bfe52,_0x43946e){_0x2bfe52=_0x2bfe52-0x0;var _0x1cf649=_0xcb91[_0x2bfe52];return _0x1cf649;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x1cb9('0x0')]={'uniqueid':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1cb9('0x2')](_0x1cb9('0x3'),'agent',_0x1cb9('0x4')),'allowNull':![],'defaultValue':_0x1cb9('0x4')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x1cb9('0x5')]}}; \ No newline at end of file +var _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0xf9431c,_0x4754b5){var _0x53fc33=function(_0x50ac6c){while(--_0x50ac6c){_0xf9431c['push'](_0xf9431c['shift']());}};_0x53fc33(++_0x4754b5);}(_0x34e8,0x12c));var _0x834e=function(_0x10c506,_0xcaca0a){_0x10c506=_0x10c506-0x0;var _0x295601=_0x34e8[_0x10c506];return _0x295601;};'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 diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index 99d4a5b..1213243 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 _0x8dbe=['crypto','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','offset','undefined','count','set','Content-Range','json','apply','save','update','then','destroy','end','error','stack','name','send','index','map','fieldName','type','key','keys','query','filters','intersection','model','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','VIRTUAL','options','FaxTransferReport','includeAll','include','findAll','rows','catch','show','params','attributes','find','create','body','describe','eml-format','rimraf','request-promise','bluebird','mustache','path','to-csv','fs-extra','lodash'];(function(_0x186a11,_0x4f4fd8){var _0xe43c21=function(_0x32b2df){while(--_0x32b2df){_0x186a11['push'](_0x186a11['shift']());}};_0xe43c21(++_0x4f4fd8);}(_0x8dbe,0xdb));var _0xe8db=function(_0x382f75,_0x5ad658){_0x382f75=_0x382f75-0x0;var _0x423f73=_0x8dbe[_0x382f75];return _0x423f73;};'use strict';var emlformat=require(_0xe8db('0x0'));var rimraf=require(_0xe8db('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xe8db('0x2'));var moment=require('moment');var BPromise=require(_0xe8db('0x3'));var Mustache=require(_0xe8db('0x4'));var util=require('util');var path=require(_0xe8db('0x5'));var sox=require('sox');var csv=require(_0xe8db('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe8db('0x7'));var _=require(_0xe8db('0x8'));var squel=require('squel');var crypto=require(_0xe8db('0x9'));var jsforce=require(_0xe8db('0xa'));var deskjs=require(_0xe8db('0xb'));var toCsv=require(_0xe8db('0x6'));var querystring=require(_0xe8db('0xc'));var Papa=require(_0xe8db('0xd'));var Redis=require(_0xe8db('0xe'));var authService=require(_0xe8db('0xf'));var qs=require(_0xe8db('0x10'));var as=require(_0xe8db('0x11'));var hardwareService=require(_0xe8db('0x12'));var logger=require(_0xe8db('0x13'))(_0xe8db('0x14'));var utils=require('../../config/utils');var config=require(_0xe8db('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xe8db('0x16'))['db'];function respondWithStatusCode(_0x30bac4,_0x259d4c){_0x259d4c=_0x259d4c||0xcc;return function(_0x3f3905){if(_0x3f3905){return _0x30bac4[_0xe8db('0x17')](_0x259d4c);}return _0x30bac4['status'](_0x259d4c)['end']();};}function respondWithResult(_0x19960c,_0x12fcef){_0x12fcef=_0x12fcef||0xc8;return function(_0x319952){if(_0x319952){return _0x19960c[_0xe8db('0x18')](_0x12fcef)['json'](_0x319952);}};}function respondWithFilteredResult(_0x1d299d,_0x14f3b8){return function(_0x280293){if(_0x280293){var _0x30ef60=typeof _0x14f3b8[_0xe8db('0x19')]==='undefined'&&typeof _0x14f3b8['limit']===_0xe8db('0x1a');var _0x26d8d8=_0x280293[_0xe8db('0x1b')];var _0xefd237=_0x30ef60?0x0:_0x14f3b8[_0xe8db('0x19')];var _0x1f6589=_0x30ef60?_0x280293['count']:_0x14f3b8['offset']+_0x14f3b8['limit'];var _0x2c8931;if(_0x1f6589>=_0x26d8d8){_0x1f6589=_0x26d8d8;_0x2c8931=0xc8;}else{_0x2c8931=0xce;}_0x1d299d[_0xe8db('0x18')](_0x2c8931);return _0x1d299d[_0xe8db('0x1c')](_0xe8db('0x1d'),_0xefd237+'-'+_0x1f6589+'/'+_0x26d8d8)[_0xe8db('0x1e')](_0x280293);}return null;};}function patchUpdates(_0x33a847){return function(_0x57f064){try{jsonpatch[_0xe8db('0x1f')](_0x57f064,_0x33a847,!![]);}catch(_0x495760){return BPromise['reject'](_0x495760);}return _0x57f064[_0xe8db('0x20')]();};}function saveUpdates(_0x3369a7,_0x3ae5f9){return function(_0x3ab82a){if(_0x3ab82a){return _0x3ab82a[_0xe8db('0x21')](_0x3369a7)[_0xe8db('0x22')](function(_0x5029a7){return _0x5029a7;});}return null;};}function removeEntity(_0x14eee7,_0x1c653b){return function(_0x243cbb){if(_0x243cbb){return _0x243cbb[_0xe8db('0x23')]()['then'](function(){_0x14eee7['status'](0xcc)[_0xe8db('0x24')]();});}};}function handleEntityNotFound(_0x5647ef,_0x4776ea){return function(_0x3f1757){if(!_0x3f1757){_0x5647ef[_0xe8db('0x17')](0x194);}return _0x3f1757;};}function handleError(_0x6ca060,_0x4b1a4c){_0x4b1a4c=_0x4b1a4c||0x1f4;return function(_0x3a74f8){logger[_0xe8db('0x25')](_0x3a74f8[_0xe8db('0x26')]);if(_0x3a74f8[_0xe8db('0x27')]){delete _0x3a74f8[_0xe8db('0x27')];}_0x6ca060[_0xe8db('0x18')](_0x4b1a4c)[_0xe8db('0x28')](_0x3a74f8);};}exports[_0xe8db('0x29')]=function(_0x1e76c3,_0x54d623){var _0x360ad9={},_0x2feb3f={},_0x4a494c={'count':0x0,'rows':[]};var _0xdd79=_[_0xe8db('0x2a')](db['FaxTransferReport']['rawAttributes'],function(_0x53be21){return{'name':_0x53be21[_0xe8db('0x2b')],'type':_0x53be21[_0xe8db('0x2c')][_0xe8db('0x2d')]};});_0x2feb3f['model']=_[_0xe8db('0x2a')](_0xdd79,_0xe8db('0x27'));_0x2feb3f['query']=_[_0xe8db('0x2e')](_0x1e76c3[_0xe8db('0x2f')]);_0x2feb3f[_0xe8db('0x30')]=_[_0xe8db('0x31')](_0x2feb3f[_0xe8db('0x32')],_0x2feb3f[_0xe8db('0x2f')]);_0x360ad9['attributes']=_[_0xe8db('0x31')](_0x2feb3f['model'],qs[_0xe8db('0x33')](_0x1e76c3[_0xe8db('0x2f')][_0xe8db('0x33')]));_0x360ad9['attributes']=_0x360ad9['attributes'][_0xe8db('0x34')]?_0x360ad9['attributes']:_0x2feb3f[_0xe8db('0x32')];if(!_0x1e76c3[_0xe8db('0x2f')][_0xe8db('0x35')](_0xe8db('0x36'))){_0x360ad9[_0xe8db('0x37')]=qs['limit'](_0x1e76c3[_0xe8db('0x2f')]['limit']);_0x360ad9[_0xe8db('0x19')]=qs[_0xe8db('0x19')](_0x1e76c3[_0xe8db('0x2f')][_0xe8db('0x19')]);}_0x360ad9['order']=qs['sort'](_0x1e76c3[_0xe8db('0x2f')][_0xe8db('0x38')]);_0x360ad9[_0xe8db('0x39')]=qs[_0xe8db('0x30')](_[_0xe8db('0x3a')](_0x1e76c3[_0xe8db('0x2f')],_0x2feb3f[_0xe8db('0x30')]),_0xdd79);if(_0x1e76c3[_0xe8db('0x2f')][_0xe8db('0x3b')]){_0x360ad9[_0xe8db('0x39')]=_[_0xe8db('0x3c')](_0x360ad9[_0xe8db('0x39')],{'$or':_[_0xe8db('0x2a')](_0xdd79,function(_0x28b97a){if(_0x28b97a[_0xe8db('0x2c')]!==_0xe8db('0x3d')){var _0x52c2d6={};_0x52c2d6[_0x28b97a[_0xe8db('0x27')]]={'$like':'%'+_0x1e76c3['query'][_0xe8db('0x3b')]+'%'};return _0x52c2d6;}})});}_0x360ad9=_[_0xe8db('0x3c')]({},_0x360ad9,_0x1e76c3[_0xe8db('0x3e')]);var _0x3a1194={'where':_0x360ad9[_0xe8db('0x39')]};return db[_0xe8db('0x3f')]['count'](_0x3a1194)[_0xe8db('0x22')](function(_0x10db04){_0x4a494c[_0xe8db('0x1b')]=_0x10db04;if(_0x1e76c3[_0xe8db('0x2f')][_0xe8db('0x40')]){_0x360ad9[_0xe8db('0x41')]=[{'all':!![]}];}return db[_0xe8db('0x3f')][_0xe8db('0x42')](_0x360ad9);})[_0xe8db('0x22')](function(_0x4db558){_0x4a494c[_0xe8db('0x43')]=_0x4db558;return _0x4a494c;})[_0xe8db('0x22')](respondWithFilteredResult(_0x54d623,_0x360ad9))[_0xe8db('0x44')](handleError(_0x54d623,null));};exports[_0xe8db('0x45')]=function(_0x303ae9,_0xddc986){var _0x41ce29={'raw':!![],'where':{'id':_0x303ae9[_0xe8db('0x46')]['id']}},_0x43fc83={};_0x43fc83[_0xe8db('0x32')]=_[_0xe8db('0x2e')](db[_0xe8db('0x3f')]['rawAttributes']);_0x43fc83[_0xe8db('0x2f')]=_[_0xe8db('0x2e')](_0x303ae9[_0xe8db('0x2f')]);_0x43fc83['filters']=_[_0xe8db('0x31')](_0x43fc83['model'],_0x43fc83[_0xe8db('0x2f')]);_0x41ce29[_0xe8db('0x47')]=_[_0xe8db('0x31')](_0x43fc83[_0xe8db('0x32')],qs['fields'](_0x303ae9['query'][_0xe8db('0x33')]));_0x41ce29[_0xe8db('0x47')]=_0x41ce29[_0xe8db('0x47')][_0xe8db('0x34')]?_0x41ce29[_0xe8db('0x47')]:_0x43fc83[_0xe8db('0x32')];if(_0x303ae9['query'][_0xe8db('0x40')]){_0x41ce29[_0xe8db('0x41')]=[{'all':!![]}];}_0x41ce29=_[_0xe8db('0x3c')]({},_0x41ce29,_0x303ae9[_0xe8db('0x3e')]);return db['FaxTransferReport'][_0xe8db('0x48')](_0x41ce29)['then'](handleEntityNotFound(_0xddc986,null))['then'](respondWithResult(_0xddc986,null))['catch'](handleError(_0xddc986,null));};exports['create']=function(_0x566760,_0x23907f){return db['FaxTransferReport'][_0xe8db('0x49')](_0x566760[_0xe8db('0x4a')],{})[_0xe8db('0x22')](respondWithResult(_0x23907f,0xc9))[_0xe8db('0x44')](handleError(_0x23907f,null));};exports[_0xe8db('0x21')]=function(_0x648020,_0x1bbd89){if(_0x648020[_0xe8db('0x4a')]['id']){delete _0x648020[_0xe8db('0x4a')]['id'];}return db[_0xe8db('0x3f')]['find']({'where':{'id':_0x648020[_0xe8db('0x46')]['id']}})[_0xe8db('0x22')](handleEntityNotFound(_0x1bbd89,null))[_0xe8db('0x22')](saveUpdates(_0x648020[_0xe8db('0x4a')],null))[_0xe8db('0x22')](respondWithResult(_0x1bbd89,null))['catch'](handleError(_0x1bbd89,null));};exports[_0xe8db('0x23')]=function(_0x846d7e,_0x463740){return db[_0xe8db('0x3f')][_0xe8db('0x48')]({'where':{'id':_0x846d7e[_0xe8db('0x46')]['id']}})['then'](handleEntityNotFound(_0x463740,null))[_0xe8db('0x22')](removeEntity(_0x463740,null))[_0xe8db('0x44')](handleError(_0x463740,null));};exports[_0xe8db('0x4b')]=function(_0x42bbac,_0x2d0ade){return db[_0xe8db('0x3f')][_0xe8db('0x4b')]()[_0xe8db('0x22')](respondWithResult(_0x2d0ade,null))[_0xe8db('0x44')](handleError(_0x2d0ade,null));}; \ No newline at end of file +var _0x9918=['catch','show','params','keys','intersection','fields','create','body','find','describe','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/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','Content-Range','save','then','destroy','error','stack','name','index','map','rawAttributes','key','model','query','filters','attributes','length','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','FaxTransferReport','includeAll','include','findAll'];(function(_0x4a65a4,_0x1dd9eb){var _0x28f367=function(_0x10029a){while(--_0x10029a){_0x4a65a4['push'](_0x4a65a4['shift']());}};_0x28f367(++_0x1dd9eb);}(_0x9918,0x172));var _0x8991=function(_0x38233a,_0x371550){_0x38233a=_0x38233a-0x0;var _0x5e28ae=_0x9918[_0x38233a];return _0x5e28ae;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8991('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8991('0x1'));var rp=require(_0x8991('0x2'));var moment=require(_0x8991('0x3'));var BPromise=require(_0x8991('0x4'));var Mustache=require(_0x8991('0x5'));var util=require(_0x8991('0x6'));var path=require(_0x8991('0x7'));var sox=require(_0x8991('0x8'));var csv=require(_0x8991('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8991('0xa'));var _=require(_0x8991('0xb'));var squel=require(_0x8991('0xc'));var crypto=require(_0x8991('0xd'));var jsforce=require(_0x8991('0xe'));var deskjs=require(_0x8991('0xf'));var toCsv=require('to-csv');var querystring=require(_0x8991('0x10'));var Papa=require(_0x8991('0x11'));var Redis=require(_0x8991('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8991('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8991('0x14'));var utils=require(_0x8991('0x15'));var config=require(_0x8991('0x16'));var licenseUtil=require(_0x8991('0x17'));var db=require(_0x8991('0x18'))['db'];function respondWithStatusCode(_0x4a465c,_0x22d4cf){_0x22d4cf=_0x22d4cf||0xcc;return function(_0x285655){if(_0x285655){return _0x4a465c[_0x8991('0x19')](_0x22d4cf);}return _0x4a465c[_0x8991('0x1a')](_0x22d4cf)['end']();};}function respondWithResult(_0x2a26fd,_0x381bfb){_0x381bfb=_0x381bfb||0xc8;return function(_0x380ecb){if(_0x380ecb){return _0x2a26fd['status'](_0x381bfb)[_0x8991('0x1b')](_0x380ecb);}};}function respondWithFilteredResult(_0x1b6a64,_0x364e5b){return function(_0x3fb2fb){if(_0x3fb2fb){var _0x144b88=typeof _0x364e5b[_0x8991('0x1c')]==='undefined'&&typeof _0x364e5b[_0x8991('0x1d')]===_0x8991('0x1e');var _0x21a92f=_0x3fb2fb[_0x8991('0x1f')];var _0x3a7aa7=_0x144b88?0x0:_0x364e5b[_0x8991('0x1c')];var _0x2511be=_0x144b88?_0x3fb2fb[_0x8991('0x1f')]:_0x364e5b[_0x8991('0x1c')]+_0x364e5b[_0x8991('0x1d')];var _0x2b2963;if(_0x2511be>=_0x21a92f){_0x2511be=_0x21a92f;_0x2b2963=0xc8;}else{_0x2b2963=0xce;}_0x1b6a64[_0x8991('0x1a')](_0x2b2963);return _0x1b6a64['set'](_0x8991('0x20'),_0x3a7aa7+'-'+_0x2511be+'/'+_0x21a92f)[_0x8991('0x1b')](_0x3fb2fb);}return null;};}function patchUpdates(_0x1096ed){return function(_0x5b3d0e){try{jsonpatch['apply'](_0x5b3d0e,_0x1096ed,!![]);}catch(_0x4ceec9){return BPromise['reject'](_0x4ceec9);}return _0x5b3d0e[_0x8991('0x21')]();};}function saveUpdates(_0x1e6fb3,_0x1c88c8){return function(_0x30babe){if(_0x30babe){return _0x30babe['update'](_0x1e6fb3)[_0x8991('0x22')](function(_0x1839bd){return _0x1839bd;});}return null;};}function removeEntity(_0x2055d1,_0x2e8872){return function(_0xaaa85){if(_0xaaa85){return _0xaaa85[_0x8991('0x23')]()['then'](function(){_0x2055d1[_0x8991('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e558e,_0x1d3a15){return function(_0x2ff701){if(!_0x2ff701){_0x5e558e['sendStatus'](0x194);}return _0x2ff701;};}function handleError(_0x253296,_0x6e0073){_0x6e0073=_0x6e0073||0x1f4;return function(_0x4e9337){logger[_0x8991('0x24')](_0x4e9337[_0x8991('0x25')]);if(_0x4e9337[_0x8991('0x26')]){delete _0x4e9337[_0x8991('0x26')];}_0x253296['status'](_0x6e0073)['send'](_0x4e9337);};}exports[_0x8991('0x27')]=function(_0x452099,_0x4f0b70){var _0x3debc5={},_0x44857f={},_0x4ade6e={'count':0x0,'rows':[]};var _0x38a1fc=_[_0x8991('0x28')](db['FaxTransferReport'][_0x8991('0x29')],function(_0x791abe){return{'name':_0x791abe['fieldName'],'type':_0x791abe['type'][_0x8991('0x2a')]};});_0x44857f[_0x8991('0x2b')]=_[_0x8991('0x28')](_0x38a1fc,_0x8991('0x26'));_0x44857f['query']=_['keys'](_0x452099[_0x8991('0x2c')]);_0x44857f[_0x8991('0x2d')]=_['intersection'](_0x44857f[_0x8991('0x2b')],_0x44857f[_0x8991('0x2c')]);_0x3debc5[_0x8991('0x2e')]=_['intersection'](_0x44857f['model'],qs['fields'](_0x452099[_0x8991('0x2c')]['fields']));_0x3debc5['attributes']=_0x3debc5[_0x8991('0x2e')][_0x8991('0x2f')]?_0x3debc5[_0x8991('0x2e')]:_0x44857f[_0x8991('0x2b')];if(!_0x452099[_0x8991('0x2c')]['hasOwnProperty'](_0x8991('0x30'))){_0x3debc5[_0x8991('0x1d')]=qs['limit'](_0x452099[_0x8991('0x2c')][_0x8991('0x1d')]);_0x3debc5[_0x8991('0x1c')]=qs[_0x8991('0x1c')](_0x452099[_0x8991('0x2c')][_0x8991('0x1c')]);}_0x3debc5[_0x8991('0x31')]=qs[_0x8991('0x32')](_0x452099[_0x8991('0x2c')][_0x8991('0x32')]);_0x3debc5[_0x8991('0x33')]=qs[_0x8991('0x2d')](_[_0x8991('0x34')](_0x452099['query'],_0x44857f['filters']),_0x38a1fc);if(_0x452099[_0x8991('0x2c')][_0x8991('0x35')]){_0x3debc5[_0x8991('0x33')]=_['merge'](_0x3debc5[_0x8991('0x33')],{'$or':_['map'](_0x38a1fc,function(_0x111a85){if(_0x111a85[_0x8991('0x36')]!==_0x8991('0x37')){var _0x1b4027={};_0x1b4027[_0x111a85[_0x8991('0x26')]]={'$like':'%'+_0x452099[_0x8991('0x2c')][_0x8991('0x35')]+'%'};return _0x1b4027;}})});}_0x3debc5=_[_0x8991('0x38')]({},_0x3debc5,_0x452099[_0x8991('0x39')]);var _0x7a9a05={'where':_0x3debc5[_0x8991('0x33')]};return db[_0x8991('0x3a')][_0x8991('0x1f')](_0x7a9a05)['then'](function(_0x2407e7){_0x4ade6e['count']=_0x2407e7;if(_0x452099[_0x8991('0x2c')][_0x8991('0x3b')]){_0x3debc5[_0x8991('0x3c')]=[{'all':!![]}];}return db[_0x8991('0x3a')][_0x8991('0x3d')](_0x3debc5);})['then'](function(_0x2324c9){_0x4ade6e['rows']=_0x2324c9;return _0x4ade6e;})[_0x8991('0x22')](respondWithFilteredResult(_0x4f0b70,_0x3debc5))[_0x8991('0x3e')](handleError(_0x4f0b70,null));};exports[_0x8991('0x3f')]=function(_0x4ede5f,_0x2e0c9b){var _0x1d54e4={'raw':!![],'where':{'id':_0x4ede5f[_0x8991('0x40')]['id']}},_0x48f0c={};_0x48f0c['model']=_[_0x8991('0x41')](db[_0x8991('0x3a')][_0x8991('0x29')]);_0x48f0c[_0x8991('0x2c')]=_[_0x8991('0x41')](_0x4ede5f[_0x8991('0x2c')]);_0x48f0c[_0x8991('0x2d')]=_['intersection'](_0x48f0c[_0x8991('0x2b')],_0x48f0c[_0x8991('0x2c')]);_0x1d54e4[_0x8991('0x2e')]=_[_0x8991('0x42')](_0x48f0c[_0x8991('0x2b')],qs[_0x8991('0x43')](_0x4ede5f[_0x8991('0x2c')][_0x8991('0x43')]));_0x1d54e4[_0x8991('0x2e')]=_0x1d54e4['attributes'][_0x8991('0x2f')]?_0x1d54e4[_0x8991('0x2e')]:_0x48f0c[_0x8991('0x2b')];if(_0x4ede5f[_0x8991('0x2c')][_0x8991('0x3b')]){_0x1d54e4[_0x8991('0x3c')]=[{'all':!![]}];}_0x1d54e4=_[_0x8991('0x38')]({},_0x1d54e4,_0x4ede5f['options']);return db['FaxTransferReport']['find'](_0x1d54e4)[_0x8991('0x22')](handleEntityNotFound(_0x2e0c9b,null))[_0x8991('0x22')](respondWithResult(_0x2e0c9b,null))[_0x8991('0x3e')](handleError(_0x2e0c9b,null));};exports[_0x8991('0x44')]=function(_0x8286f3,_0x5553e1){return db[_0x8991('0x3a')][_0x8991('0x44')](_0x8286f3['body'],{})[_0x8991('0x22')](respondWithResult(_0x5553e1,0xc9))[_0x8991('0x3e')](handleError(_0x5553e1,null));};exports['update']=function(_0x274ebf,_0x5484dd){if(_0x274ebf[_0x8991('0x45')]['id']){delete _0x274ebf[_0x8991('0x45')]['id'];}return db[_0x8991('0x3a')][_0x8991('0x46')]({'where':{'id':_0x274ebf['params']['id']}})['then'](handleEntityNotFound(_0x5484dd,null))[_0x8991('0x22')](saveUpdates(_0x274ebf[_0x8991('0x45')],null))[_0x8991('0x22')](respondWithResult(_0x5484dd,null))[_0x8991('0x3e')](handleError(_0x5484dd,null));};exports[_0x8991('0x23')]=function(_0x5b177c,_0x12f480){return db['FaxTransferReport'][_0x8991('0x46')]({'where':{'id':_0x5b177c['params']['id']}})[_0x8991('0x22')](handleEntityNotFound(_0x12f480,null))[_0x8991('0x22')](removeEntity(_0x12f480,null))[_0x8991('0x3e')](handleError(_0x12f480,null));};exports[_0x8991('0x47')]=function(_0x4e6ea3,_0x4d3efe){return db['FaxTransferReport'][_0x8991('0x47')]()[_0x8991('0x22')](respondWithResult(_0x4d3efe,null))['catch'](handleError(_0x4d3efe,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index 160dc35..d70cde4 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 _0x93ab=['./faxTransferReport.attributes','exports','define','FaxTransferReport','report_fax_transfer','uniqueid','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x5433d6,_0x325978){var _0x500081=function(_0x41c2c8){while(--_0x41c2c8){_0x5433d6['push'](_0x5433d6['shift']());}};_0x500081(++_0x325978);}(_0x93ab,0x1e2));var _0xb93a=function(_0xffd8b0,_0x12c51f){_0xffd8b0=_0xffd8b0-0x0;var _0x301ba0=_0x93ab[_0xffd8b0];return _0x301ba0;};'use strict';var _=require(_0xb93a('0x0'));var util=require(_0xb93a('0x1'));var logger=require(_0xb93a('0x2'))('api');var moment=require('moment');var BPromise=require(_0xb93a('0x3'));var rp=require(_0xb93a('0x4'));var fs=require('fs');var path=require(_0xb93a('0x5'));var rimraf=require(_0xb93a('0x6'));var config=require(_0xb93a('0x7'));var attributes=require(_0xb93a('0x8'));module[_0xb93a('0x9')]=function(_0x1a8ea5,_0xdf09ac){return _0x1a8ea5[_0xb93a('0xa')](_0xb93a('0xb'),attributes,{'tableName':_0xb93a('0xc'),'paranoid':![],'indexes':[{'name':_0xb93a('0xd'),'fields':[_0xb93a('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf74b=['path','rimraf','../../config/environment','./faxTransferReport.attributes','exports','define','report_fax_transfer','uniqueid','lodash','util','../../config/logger','bluebird','request-promise'];(function(_0x52469e,_0x3579c2){var _0x2e6692=function(_0x3e5576){while(--_0x3e5576){_0x52469e['push'](_0x52469e['shift']());}};_0x2e6692(++_0x3579c2);}(_0xf74b,0x97));var _0xbf74=function(_0x44da25,_0x512575){_0x44da25=_0x44da25-0x0;var _0x68594f=_0xf74b[_0x44da25];return _0x68594f;};'use strict';var _=require(_0xbf74('0x0'));var util=require(_0xbf74('0x1'));var logger=require(_0xbf74('0x2'))('api');var moment=require('moment');var BPromise=require(_0xbf74('0x3'));var rp=require(_0xbf74('0x4'));var fs=require('fs');var path=require(_0xbf74('0x5'));var rimraf=require(_0xbf74('0x6'));var config=require(_0xbf74('0x7'));var attributes=require(_0xbf74('0x8'));module[_0xbf74('0x9')]=function(_0x5e6b18,_0xa8d8f4){return _0x5e6b18[_0xbf74('0xa')]('FaxTransferReport',attributes,{'tableName':_0xbf74('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xbf74('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index 31bea01..0dbd66a 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 _0x8e6f=['request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','FaxTransferReport,\x20%s,\x20%s'];(function(_0x4f5108,_0x46a54b){var _0x2d56ca=function(_0x5b3c1e){while(--_0x5b3c1e){_0x4f5108['push'](_0x4f5108['shift']());}};_0x2d56ca(++_0x46a54b);}(_0x8e6f,0xa3));var _0xf8e6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8e6f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf8e6('0x0'));var util=require(_0xf8e6('0x1'));var moment=require('moment');var BPromise=require(_0xf8e6('0x2'));var rs=require(_0xf8e6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf8e6('0x4'));var logger=require(_0xf8e6('0x5'))(_0xf8e6('0x6'));var config=require(_0xf8e6('0x7'));var jayson=require(_0xf8e6('0x8'));var client=jayson['client'][_0xf8e6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x23c3d5,_0x13fd22,_0x4574e5){return new BPromise(function(_0x51c1e8,_0x4e6d6c){return client[_0xf8e6('0xa')](_0x23c3d5,_0x4574e5)[_0xf8e6('0xb')](function(_0x1346fa){logger['info'](_0xf8e6('0xc'),_0x13fd22,_0xf8e6('0xd'));logger[_0xf8e6('0xe')](_0xf8e6('0xf'),_0x13fd22,_0xf8e6('0xd'),JSON[_0xf8e6('0x10')](_0x1346fa));if(_0x1346fa['error']){if(_0x1346fa['error']['code']===0x1f4){logger[_0xf8e6('0x11')]('FaxTransferReport,\x20%s,\x20%s',_0x13fd22,_0x1346fa[_0xf8e6('0x11')]['message']);return _0x4e6d6c(_0x1346fa[_0xf8e6('0x11')][_0xf8e6('0x12')]);}logger[_0xf8e6('0x11')](_0xf8e6('0xc'),_0x13fd22,_0x1346fa[_0xf8e6('0x11')][_0xf8e6('0x12')]);return _0x51c1e8(_0x1346fa[_0xf8e6('0x11')][_0xf8e6('0x12')]);}else{logger[_0xf8e6('0x13')](_0xf8e6('0xc'),_0x13fd22,_0xf8e6('0xd'));_0x51c1e8(_0x1346fa[_0xf8e6('0x14')]['message']);}})[_0xf8e6('0x15')](function(_0x4a798c){logger[_0xf8e6('0x11')]('FaxTransferReport,\x20%s,\x20%s',_0x13fd22,_0x4a798c);_0x4e6d6c(_0x4a798c);});});} \ No newline at end of file +var _0x9109=['lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0x9109,0xd2));var _0x9910=function(_0x836465,_0x5442ae){_0x836465=_0x836465-0x0;var _0x2150ea=_0x9109[_0x836465];return _0x2150ea;};'use strict';var _=require(_0x9910('0x0'));var util=require(_0x9910('0x1'));var moment=require(_0x9910('0x2'));var BPromise=require(_0x9910('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9910('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9910('0x5'))(_0x9910('0x6'));var config=require(_0x9910('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x9910('0x8')][_0x9910('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x193fd1,_0x1ac02f,_0x2bb78c){return new BPromise(function(_0x442ffb,_0x4a98b1){return client[_0x9910('0xa')](_0x193fd1,_0x2bb78c)[_0x9910('0xb')](function(_0xb56f10){logger[_0x9910('0xc')](_0x9910('0xd'),_0x1ac02f,_0x9910('0xe'));logger[_0x9910('0xf')]('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x1ac02f,_0x9910('0xe'),JSON[_0x9910('0x10')](_0xb56f10));if(_0xb56f10[_0x9910('0x11')]){if(_0xb56f10[_0x9910('0x11')]['code']===0x1f4){logger['error']('FaxTransferReport,\x20%s,\x20%s',_0x1ac02f,_0xb56f10[_0x9910('0x11')][_0x9910('0x12')]);return _0x4a98b1(_0xb56f10[_0x9910('0x11')][_0x9910('0x12')]);}logger[_0x9910('0x11')](_0x9910('0xd'),_0x1ac02f,_0xb56f10['error']['message']);return _0x442ffb(_0xb56f10['error'][_0x9910('0x12')]);}else{logger['info'](_0x9910('0xd'),_0x1ac02f,'request\x20sent');_0x442ffb(_0xb56f10[_0x9910('0x13')][_0x9910('0x12')]);}})[_0x9910('0x14')](function(_0x1e34f1){logger[_0x9910('0x11')](_0x9910('0xd'),_0x1ac02f,_0x1e34f1);_0x4a98b1(_0x1e34f1);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index 0e58cf7..5761f0e 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 _0xb368=['../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','show','post','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0xb368,0x175));var _0x8b36=function(_0x598f91,_0x264f97){_0x598f91=_0x598f91-0x0;var _0x5c3597=_0xb368[_0x598f91];return _0x5c3597;};'use strict';var multer=require(_0x8b36('0x0'));var util=require(_0x8b36('0x1'));var path=require(_0x8b36('0x2'));var timeout=require(_0x8b36('0x3'));var express=require(_0x8b36('0x4'));var router=express[_0x8b36('0x5')]();var fs_extra=require(_0x8b36('0x6'));var auth=require(_0x8b36('0x7'));var interaction=require(_0x8b36('0x8'));var config=require('../../config/environment');var controller=require('./faxTransferReport.controller');router[_0x8b36('0x9')]('/',auth[_0x8b36('0xa')](),controller[_0x8b36('0xb')]);router[_0x8b36('0x9')](_0x8b36('0xc'),auth[_0x8b36('0xa')](),controller[_0x8b36('0xd')]);router[_0x8b36('0x9')](_0x8b36('0xe'),auth[_0x8b36('0xa')](),controller[_0x8b36('0xf')]);router[_0x8b36('0x10')]('/',auth[_0x8b36('0xa')](),controller['create']);router['put'](_0x8b36('0xe'),auth[_0x8b36('0xa')](),controller[_0x8b36('0x11')]);router[_0x8b36('0x12')](_0x8b36('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x8b36('0x13')]=router; \ No newline at end of file +var _0x63aa=['../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','destroy','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x489a1c,_0x112bc1){var _0x2b4161=function(_0x2b481f){while(--_0x2b481f){_0x489a1c['push'](_0x489a1c['shift']());}};_0x2b4161(++_0x112bc1);}(_0x63aa,0x6c));var _0xa63a=function(_0x49e175,_0x4b0c36){_0x49e175=_0x49e175-0x0;var _0x564a3a=_0x63aa[_0x49e175];return _0x564a3a;};'use strict';var multer=require(_0xa63a('0x0'));var util=require('util');var path=require(_0xa63a('0x1'));var timeout=require(_0xa63a('0x2'));var express=require(_0xa63a('0x3'));var router=express[_0xa63a('0x4')]();var fs_extra=require(_0xa63a('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xa63a('0x6'));var config=require(_0xa63a('0x7'));var controller=require(_0xa63a('0x8'));router[_0xa63a('0x9')]('/',auth[_0xa63a('0xa')](),controller[_0xa63a('0xb')]);router[_0xa63a('0x9')]('/describe',auth['isAuthenticated'](),controller['describe']);router['get'](_0xa63a('0xc'),auth[_0xa63a('0xa')](),controller[_0xa63a('0xd')]);router[_0xa63a('0xe')]('/',auth[_0xa63a('0xa')](),controller[_0xa63a('0xf')]);router[_0xa63a('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xa63a('0x11')]);router['delete'](_0xa63a('0xc'),auth[_0xa63a('0xa')](),controller[_0xa63a('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index 92ec13a..24ec10b 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 _0xccd5=['addConfiguration','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intDeskAccount.controller','get','/:id','isAuthenticated','show','getConfigurations','/:id/fields','getFields','post','create'];(function(_0x23bf7e,_0x1eac0e){var _0x3baa9f=function(_0x187ab0){while(--_0x187ab0){_0x23bf7e['push'](_0x23bf7e['shift']());}};_0x3baa9f(++_0x1eac0e);}(_0xccd5,0xbe));var _0x5ccd=function(_0x12d6b2,_0x5d5094){_0x12d6b2=_0x12d6b2-0x0;var _0x55ed31=_0xccd5[_0x12d6b2];return _0x55ed31;};'use strict';var multer=require(_0x5ccd('0x0'));var util=require('util');var path=require(_0x5ccd('0x1'));var timeout=require(_0x5ccd('0x2'));var express=require(_0x5ccd('0x3'));var router=express[_0x5ccd('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x5ccd('0x5'));var interaction=require(_0x5ccd('0x6'));var config=require('../../config/environment');var controller=require(_0x5ccd('0x7'));router[_0x5ccd('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x5ccd('0x8')](_0x5ccd('0x9'),auth[_0x5ccd('0xa')](),controller[_0x5ccd('0xb')]);router[_0x5ccd('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x5ccd('0xc')]);router[_0x5ccd('0x8')](_0x5ccd('0xd'),auth[_0x5ccd('0xa')](),controller[_0x5ccd('0xe')]);router[_0x5ccd('0xf')]('/',auth[_0x5ccd('0xa')](),controller[_0x5ccd('0x10')]);router[_0x5ccd('0xf')]('/:id/configurations',auth[_0x5ccd('0xa')](),controller[_0x5ccd('0x11')]);router[_0x5ccd('0x12')](_0x5ccd('0x9'),auth[_0x5ccd('0xa')](),controller[_0x5ccd('0x13')]);router[_0x5ccd('0x14')](_0x5ccd('0x9'),auth[_0x5ccd('0xa')](),controller[_0x5ccd('0x15')]);module[_0x5ccd('0x16')]=router; \ No newline at end of file +var _0xb12a=['/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','addConfiguration','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','show'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xb12a,0x145));var _0xab12=function(_0x3e5c60,_0x141693){_0x3e5c60=_0x3e5c60-0x0;var _0x815443=_0xb12a[_0x3e5c60];return _0x815443;};'use strict';var multer=require(_0xab12('0x0'));var util=require(_0xab12('0x1'));var path=require(_0xab12('0x2'));var timeout=require(_0xab12('0x3'));var express=require(_0xab12('0x4'));var router=express[_0xab12('0x5')]();var fs_extra=require(_0xab12('0x6'));var auth=require(_0xab12('0x7'));var interaction=require(_0xab12('0x8'));var config=require(_0xab12('0x9'));var controller=require('./intDeskAccount.controller');router['get']('/',auth[_0xab12('0xa')](),controller['index']);router[_0xab12('0xb')]('/:id',auth[_0xab12('0xa')](),controller[_0xab12('0xc')]);router[_0xab12('0xb')](_0xab12('0xd'),auth['isAuthenticated'](),controller[_0xab12('0xe')]);router[_0xab12('0xb')](_0xab12('0xf'),auth[_0xab12('0xa')](),controller[_0xab12('0x10')]);router['post']('/',auth[_0xab12('0xa')](),controller[_0xab12('0x11')]);router[_0xab12('0x12')](_0xab12('0xd'),auth[_0xab12('0xa')](),controller[_0xab12('0x13')]);router[_0xab12('0x14')](_0xab12('0x15'),auth[_0xab12('0xa')](),controller[_0xab12('0x16')]);router[_0xab12('0x17')](_0xab12('0x15'),auth['isAuthenticated'](),controller[_0xab12('0x18')]);module[_0xab12('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 64cb367..ebf792f 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 _0xf1bf=['exports','STRING','ENUM','basic','integrationTab','newTab','sequelize'];(function(_0x3abe58,_0x184dd9){var _0x457389=function(_0x59f517){while(--_0x59f517){_0x3abe58['push'](_0x3abe58['shift']());}};_0x457389(++_0x184dd9);}(_0xf1bf,0x141));var _0xff1b=function(_0x11de6e,_0x8b367){_0x11de6e=_0x11de6e-0x0;var _0x197e53=_0xf1bf[_0x11de6e];return _0x197e53;};'use strict';var Sequelize=require(_0xff1b('0x0'));module[_0xff1b('0x1')]={'name':{'type':Sequelize[_0xff1b('0x2')]},'description':{'type':Sequelize[_0xff1b('0x2')]},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xff1b('0x2')]},'authType':{'type':Sequelize[_0xff1b('0x3')](_0xff1b('0x4')),'defaultValue':_0xff1b('0x4')},'password':{'type':Sequelize[_0xff1b('0x2')]},'consumerKey':{'type':Sequelize[_0xff1b('0x2')]},'consumerSecret':{'type':Sequelize[_0xff1b('0x2')]},'token':{'type':Sequelize[_0xff1b('0x2')]},'tokenSecret':{'type':Sequelize[_0xff1b('0x2')]},'serverUrl':{'type':Sequelize[_0xff1b('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xff1b('0x5'),_0xff1b('0x6')),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0x54cc=['STRING','ENUM','basic','integrationTab','newTab','sequelize'];(function(_0xda6ad1,_0x5f09e3){var _0xedc3a5=function(_0x5459d7){while(--_0x5459d7){_0xda6ad1['push'](_0xda6ad1['shift']());}};_0xedc3a5(++_0x5f09e3);}(_0x54cc,0x14f));var _0xc54c=function(_0x4dcbe1,_0xbc12e0){_0x4dcbe1=_0x4dcbe1-0x0;var _0x510957=_0x54cc[_0x4dcbe1];return _0x510957;};'use strict';var Sequelize=require(_0xc54c('0x0'));module['exports']={'name':{'type':Sequelize[_0xc54c('0x1')]},'description':{'type':Sequelize[_0xc54c('0x1')]},'username':{'type':Sequelize[_0xc54c('0x1')]},'remoteUri':{'type':Sequelize['STRING']},'authType':{'type':Sequelize[_0xc54c('0x2')](_0xc54c('0x3')),'defaultValue':_0xc54c('0x3')},'password':{'type':Sequelize['STRING']},'consumerKey':{'type':Sequelize[_0xc54c('0x1')]},'consumerSecret':{'type':Sequelize[_0xc54c('0x1')]},'token':{'type':Sequelize['STRING']},'tokenSecret':{'type':Sequelize[_0xc54c('0x1')]},'serverUrl':{'type':Sequelize[_0xc54c('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xc54c('0x2')](_0xc54c('0x4'),_0xc54c('0x5')),'defaultValue':_0xc54c('0x4')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index 87289cb..8d751ee 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 _0x66a0=['moment','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','limit','count','Content-Range','apply','update','destroy','then','stack','name','index','DeskAccount','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','show','params','length','find','catch','create','body','getConfigurations','findOne','DeskConfiguration','map','hasOwnProperty','AccountId','Subjects','getSubjects','channel','getDescriptions','Descriptions','priority','authType','password','consumerSecret','token','tokenSecret','remoteUri','substring','lastIndexOf','GET','format','%s/custom_fields','application/json','basic','headers','Basic\x20%s','username','toString','concat','label','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','send','Wrong\x20credentials','eml-format','rimraf','zip-dir'];(function(_0x4259fb,_0x5e707b){var _0x39b86c=function(_0x5297db){while(--_0x5297db){_0x4259fb['push'](_0x4259fb['shift']());}};_0x39b86c(++_0x5e707b);}(_0x66a0,0x13e));var _0x066a=function(_0x478c8a,_0x9afc92){_0x478c8a=_0x478c8a-0x0;var _0x3b6b3e=_0x66a0[_0x478c8a];return _0x3b6b3e;};'use strict';var emlformat=require(_0x066a('0x0'));var rimraf=require(_0x066a('0x1'));var zipdir=require(_0x066a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x066a('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x066a('0x4'));var util=require(_0x066a('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x066a('0x6'));var ejs=require(_0x066a('0x7'));var fs=require('fs');var fs_extra=require(_0x066a('0x8'));var _=require(_0x066a('0x9'));var squel=require(_0x066a('0xa'));var crypto=require(_0x066a('0xb'));var jsforce=require(_0x066a('0xc'));var deskjs=require(_0x066a('0xd'));var toCsv=require(_0x066a('0x6'));var querystring=require(_0x066a('0xe'));var Papa=require(_0x066a('0xf'));var Redis=require(_0x066a('0x10'));var authService=require(_0x066a('0x11'));var qs=require(_0x066a('0x12'));var as=require(_0x066a('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x066a('0x14'));var config=require(_0x066a('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x066a('0x16'))['db'];var integrations=require(_0x066a('0x17'));function respondWithStatusCode(_0x1373b6,_0x3a27a0){_0x3a27a0=_0x3a27a0||0xcc;return function(_0x1cb2be){if(_0x1cb2be){return _0x1373b6[_0x066a('0x18')](_0x3a27a0);}return _0x1373b6[_0x066a('0x19')](_0x3a27a0)[_0x066a('0x1a')]();};}function respondWithResult(_0x3e6e60,_0x345db2){_0x345db2=_0x345db2||0xc8;return function(_0x1d3ed0){if(_0x1d3ed0){return _0x3e6e60[_0x066a('0x19')](_0x345db2)[_0x066a('0x1b')](_0x1d3ed0);}};}function respondWithFilteredResult(_0x16fdcd,_0x41dad1){return function(_0xbba15b){if(_0xbba15b){var _0x131015=typeof _0x41dad1[_0x066a('0x1c')]==='undefined'&&typeof _0x41dad1[_0x066a('0x1d')]==='undefined';var _0x54a4b5=_0xbba15b[_0x066a('0x1e')];var _0x4c0415=_0x131015?0x0:_0x41dad1[_0x066a('0x1c')];var _0xf54412=_0x131015?_0xbba15b[_0x066a('0x1e')]:_0x41dad1['offset']+_0x41dad1[_0x066a('0x1d')];var _0x2fe44a;if(_0xf54412>=_0x54a4b5){_0xf54412=_0x54a4b5;_0x2fe44a=0xc8;}else{_0x2fe44a=0xce;}_0x16fdcd['status'](_0x2fe44a);return _0x16fdcd['set'](_0x066a('0x1f'),_0x4c0415+'-'+_0xf54412+'/'+_0x54a4b5)[_0x066a('0x1b')](_0xbba15b);}return null;};}function patchUpdates(_0x5ddb16){return function(_0x51f279){try{jsonpatch[_0x066a('0x20')](_0x51f279,_0x5ddb16,!![]);}catch(_0x135f2b){return BPromise['reject'](_0x135f2b);}return _0x51f279['save']();};}function saveUpdates(_0x228ed0,_0x376f01){return function(_0x12afe3){if(_0x12afe3){return _0x12afe3[_0x066a('0x21')](_0x228ed0)['then'](function(_0x190f88){return _0x190f88;});}return null;};}function removeEntity(_0x492276,_0x2a994d){return function(_0x9124f7){if(_0x9124f7){return _0x9124f7[_0x066a('0x22')]()[_0x066a('0x23')](function(){_0x492276[_0x066a('0x19')](0xcc)[_0x066a('0x1a')]();});}};}function handleEntityNotFound(_0x1012a2,_0x314fe5){return function(_0x46262d){if(!_0x46262d){_0x1012a2[_0x066a('0x18')](0x194);}return _0x46262d;};}function handleError(_0x5f58dc,_0x1eaf23){_0x1eaf23=_0x1eaf23||0x1f4;return function(_0x2f5a42){logger['error'](_0x2f5a42[_0x066a('0x24')]);if(_0x2f5a42[_0x066a('0x25')]){delete _0x2f5a42[_0x066a('0x25')];}_0x5f58dc[_0x066a('0x19')](_0x1eaf23)['send'](_0x2f5a42);};}exports[_0x066a('0x26')]=function(_0x5df756,_0x51a03f){var _0x1dede2={},_0x805c2b={},_0x5cbeee={'count':0x0,'rows':[]};var _0x55ec11=_['map'](db[_0x066a('0x27')][_0x066a('0x28')],function(_0x1dc170){return{'name':_0x1dc170[_0x066a('0x29')],'type':_0x1dc170[_0x066a('0x2a')]['key']};});_0x805c2b['model']=_['map'](_0x55ec11,_0x066a('0x25'));_0x805c2b[_0x066a('0x2b')]=_[_0x066a('0x2c')](_0x5df756['query']);_0x805c2b[_0x066a('0x2d')]=_[_0x066a('0x2e')](_0x805c2b[_0x066a('0x2f')],_0x805c2b[_0x066a('0x2b')]);_0x1dede2[_0x066a('0x30')]=_[_0x066a('0x2e')](_0x805c2b[_0x066a('0x2f')],qs['fields'](_0x5df756['query'][_0x066a('0x31')]));_0x1dede2[_0x066a('0x30')]=_0x1dede2['attributes']['length']?_0x1dede2[_0x066a('0x30')]:_0x805c2b[_0x066a('0x2f')];if(!_0x5df756['query']['hasOwnProperty'](_0x066a('0x32'))){_0x1dede2[_0x066a('0x1d')]=qs[_0x066a('0x1d')](_0x5df756[_0x066a('0x2b')]['limit']);_0x1dede2['offset']=qs['offset'](_0x5df756[_0x066a('0x2b')]['offset']);}_0x1dede2[_0x066a('0x33')]=qs[_0x066a('0x34')](_0x5df756[_0x066a('0x2b')]['sort']);_0x1dede2[_0x066a('0x35')]=qs['filters'](_[_0x066a('0x36')](_0x5df756[_0x066a('0x2b')],_0x805c2b[_0x066a('0x2d')]),_0x55ec11);if(_0x5df756[_0x066a('0x2b')][_0x066a('0x37')]){_0x1dede2[_0x066a('0x35')]=_['merge'](_0x1dede2[_0x066a('0x35')],{'$or':_['map'](_0x55ec11,function(_0xc5c4fe){if(_0xc5c4fe[_0x066a('0x2a')]!==_0x066a('0x38')){var _0x4475e7={};_0x4475e7[_0xc5c4fe[_0x066a('0x25')]]={'$like':'%'+_0x5df756[_0x066a('0x2b')][_0x066a('0x37')]+'%'};return _0x4475e7;}})});}_0x1dede2=_[_0x066a('0x39')]({},_0x1dede2,_0x5df756[_0x066a('0x3a')]);var _0x5e6aa7={'where':_0x1dede2[_0x066a('0x35')]};return db[_0x066a('0x27')][_0x066a('0x1e')](_0x5e6aa7)[_0x066a('0x23')](function(_0x4e9201){_0x5cbeee[_0x066a('0x1e')]=_0x4e9201;if(_0x5df756[_0x066a('0x2b')][_0x066a('0x3b')]){_0x1dede2[_0x066a('0x3c')]=[{'all':!![]}];}return db[_0x066a('0x27')][_0x066a('0x3d')](_0x1dede2);})['then'](function(_0x388c65){_0x5cbeee['rows']=_0x388c65;return _0x5cbeee;})[_0x066a('0x23')](respondWithFilteredResult(_0x51a03f,_0x1dede2))['catch'](handleError(_0x51a03f,null));};exports[_0x066a('0x3e')]=function(_0x2b40e8,_0x5b1cf7){var _0x4c5e23={'raw':![],'where':{'id':_0x2b40e8[_0x066a('0x3f')]['id']}},_0x1acc51={};_0x1acc51['model']=_[_0x066a('0x2c')](db['DeskAccount'][_0x066a('0x28')]);_0x1acc51[_0x066a('0x2b')]=_['keys'](_0x2b40e8[_0x066a('0x2b')]);_0x1acc51['filters']=_[_0x066a('0x2e')](_0x1acc51[_0x066a('0x2f')],_0x1acc51['query']);_0x4c5e23['attributes']=_[_0x066a('0x2e')](_0x1acc51[_0x066a('0x2f')],qs[_0x066a('0x31')](_0x2b40e8['query'][_0x066a('0x31')]));_0x4c5e23[_0x066a('0x30')]=_0x4c5e23[_0x066a('0x30')][_0x066a('0x40')]?_0x4c5e23['attributes']:_0x1acc51['model'];if(_0x2b40e8[_0x066a('0x2b')]['includeAll']){_0x4c5e23['include']=[{'all':!![]}];}_0x4c5e23=_[_0x066a('0x39')]({},_0x4c5e23,_0x2b40e8['options']);return db[_0x066a('0x27')][_0x066a('0x41')](_0x4c5e23)[_0x066a('0x23')](handleEntityNotFound(_0x5b1cf7,null))['then'](respondWithResult(_0x5b1cf7,null))[_0x066a('0x42')](handleError(_0x5b1cf7,null));};exports[_0x066a('0x43')]=function(_0x2e2d30,_0xc5fea0){return db['DeskAccount'][_0x066a('0x43')](_0x2e2d30[_0x066a('0x44')],{})[_0x066a('0x23')](respondWithResult(_0xc5fea0,0xc9))['catch'](handleError(_0xc5fea0,null));};exports['update']=function(_0x4898cf,_0x2a1c20){if(_0x4898cf[_0x066a('0x44')]['id']){delete _0x4898cf[_0x066a('0x44')]['id'];}return db[_0x066a('0x27')][_0x066a('0x41')]({'where':{'id':_0x4898cf[_0x066a('0x3f')]['id']}})['then'](handleEntityNotFound(_0x2a1c20,null))[_0x066a('0x23')](saveUpdates(_0x4898cf[_0x066a('0x44')],null))[_0x066a('0x23')](respondWithResult(_0x2a1c20,null))[_0x066a('0x42')](handleError(_0x2a1c20,null));};exports[_0x066a('0x22')]=function(_0x3b34aa,_0x5ae199){return db['DeskAccount'][_0x066a('0x41')]({'where':{'id':_0x3b34aa[_0x066a('0x3f')]['id']}})[_0x066a('0x23')](handleEntityNotFound(_0x5ae199,null))[_0x066a('0x23')](removeEntity(_0x5ae199,null))[_0x066a('0x42')](handleError(_0x5ae199,null));};exports[_0x066a('0x45')]=function(_0x43d144,_0x2642da,_0x5c16a4){var _0x15641d={};var _0x4f8bcc={};var _0x5b61f3;var _0x7abcf6;return db[_0x066a('0x27')][_0x066a('0x46')]({'where':{'id':_0x43d144['params']['id']}})[_0x066a('0x23')](handleEntityNotFound(_0x2642da,null))['then'](function(_0x5851df){if(_0x5851df){_0x5b61f3=_0x5851df;_0x4f8bcc[_0x066a('0x2f')]=_['keys'](db[_0x066a('0x47')]['rawAttributes']);_0x4f8bcc[_0x066a('0x2b')]=_['keys'](_0x43d144[_0x066a('0x2b')]);_0x4f8bcc[_0x066a('0x2d')]=_['intersection'](_0x4f8bcc[_0x066a('0x2f')],_0x4f8bcc[_0x066a('0x2b')]);_0x15641d[_0x066a('0x30')]=_[_0x066a('0x2e')](_0x4f8bcc[_0x066a('0x2f')],qs['fields'](_0x43d144[_0x066a('0x2b')][_0x066a('0x31')]));_0x15641d[_0x066a('0x30')]=_0x15641d[_0x066a('0x30')][_0x066a('0x40')]?_0x15641d['attributes']:_0x4f8bcc['model'];_0x15641d['order']=qs[_0x066a('0x34')](_0x43d144[_0x066a('0x2b')][_0x066a('0x34')]);_0x15641d[_0x066a('0x35')]=qs['filters'](_[_0x066a('0x36')](_0x43d144[_0x066a('0x2b')],_0x4f8bcc[_0x066a('0x2d')]));if(_0x43d144[_0x066a('0x2b')]['filter']){_0x15641d[_0x066a('0x35')]=_[_0x066a('0x39')](_0x15641d[_0x066a('0x35')],{'$or':_[_0x066a('0x48')](_0x15641d['attributes'],function(_0x274061){var _0x571579={};_0x571579[_0x274061]={'$like':'%'+_0x43d144[_0x066a('0x2b')]['filter']+'%'};return _0x571579;})});}_0x15641d=_[_0x066a('0x39')]({},_0x15641d,_0x43d144[_0x066a('0x3a')]);return _0x5b61f3[_0x066a('0x45')](_0x15641d);}})[_0x066a('0x23')](function(_0x11cf22){if(_0x11cf22){_0x7abcf6=_0x11cf22[_0x066a('0x40')];if(!_0x43d144[_0x066a('0x2b')][_0x066a('0x49')](_0x066a('0x32'))){_0x15641d[_0x066a('0x1d')]=qs[_0x066a('0x1d')](_0x43d144['query'][_0x066a('0x1d')]);_0x15641d['offset']=qs[_0x066a('0x1c')](_0x43d144[_0x066a('0x2b')][_0x066a('0x1c')]);}return _0x5b61f3[_0x066a('0x45')](_0x15641d);}})[_0x066a('0x23')](function(_0x26919a){if(_0x26919a){return _0x26919a?{'count':_0x7abcf6,'rows':_0x26919a}:null;}})['then'](respondWithResult(_0x2642da,null))[_0x066a('0x42')](handleError(_0x2642da,null));};exports['addConfiguration']=function(_0x43adc,_0x8fb776,_0x2bea3a){if(_0x43adc[_0x066a('0x44')]['id']){delete _0x43adc[_0x066a('0x44')]['id'];}return db[_0x066a('0x27')][_0x066a('0x46')]({'where':{'id':_0x43adc[_0x066a('0x3f')]['id']}})[_0x066a('0x23')](handleEntityNotFound(_0x8fb776,null))[_0x066a('0x23')](function(_0x5bb41b){if(_0x5bb41b){_0x43adc['body'][_0x066a('0x4a')]=_0x5bb41b['id'];_0x43adc[_0x066a('0x44')][_0x066a('0x4b')]=integrations[_0x066a('0x4c')](_0x43adc[_0x066a('0x44')][_0x066a('0x4d')],_0x43adc[_0x066a('0x44')][_0x066a('0x2a')]);_0x43adc['body']['Descriptions']=integrations[_0x066a('0x4e')](_0x43adc[_0x066a('0x44')][_0x066a('0x4d')],_0x43adc['body'][_0x066a('0x2a')]);return db[_0x066a('0x47')][_0x066a('0x43')](_0x43adc[_0x066a('0x44')],{'include':[{'model':db['DeskField'],'as':_0x066a('0x4b')},{'model':db['DeskField'],'as':_0x066a('0x4f')}]});}return null;})[_0x066a('0x23')](respondWithResult(_0x8fb776,null))[_0x066a('0x42')](handleError(_0x8fb776,null));};exports['getFields']=function(_0x5cced5,_0x45264f,_0x444ca3){var _0x321a9f=[{'name':_0x066a('0x50'),'label':_0x066a('0x50'),'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 _0x1a7bad='';return db[_0x066a('0x27')][_0x066a('0x46')]({'where':{'id':_0x5cced5['params']['id']},'attributes':['id','remoteUri',_0x066a('0x51'),'username',_0x066a('0x52'),'consumerKey',_0x066a('0x53'),_0x066a('0x54'),_0x066a('0x55')]})[_0x066a('0x23')](handleEntityNotFound(_0x45264f,null))[_0x066a('0x23')](function(_0x4d9207){if(_0x4d9207){_0x1a7bad=_0x4d9207[_0x066a('0x56')];var _0x299397=_0x1a7bad['slice'](-0x1);if(_0x299397==='/'){_0x1a7bad=_0x1a7bad[_0x066a('0x57')](0x0,_0x1a7bad[_0x066a('0x58')](_0x299397));}var _0x2a98e4={'method':_0x066a('0x59'),'uri':util[_0x066a('0x5a')](_0x066a('0x5b'),_0x1a7bad),'headers':{'Content-Type':_0x066a('0x5c'),'Accept':_0x066a('0x5c')},'json':!![]};if(_0x4d9207[_0x066a('0x51')]===_0x066a('0x5d')){_0x2a98e4[_0x066a('0x5e')]['Authorization']=util['format'](_0x066a('0x5f'),new Buffer(util[_0x066a('0x5a')]('%s:%s',_0x4d9207[_0x066a('0x60')],_0x4d9207[_0x066a('0x52')]))[_0x066a('0x61')]('base64'));}return rp(_0x2a98e4)['then'](function(_0x351643){return _0x321a9f[_0x066a('0x62')](_[_0x066a('0x48')](_0x351643['_embedded']['entries'],function(_0x13ff42){return{'id':_0x13ff42[_0x066a('0x25')],'name':_0x13ff42['name'],'type':_0x13ff42[_0x066a('0x2a')],'active':_0x13ff42['active'],'label':_0x13ff42[_0x066a('0x63')],'custom':!![]};}));});}})[_0x066a('0x23')](function(_0x56301b){return{'count':_0x56301b[_0x066a('0x40')],'rows':_0x56301b};})[_0x066a('0x23')](respondWithResult(_0x45264f,null))[_0x066a('0x42')](function(_0x11a7bf){var _0x3a3ba9=_0x5cced5[_0x066a('0x2b')]['test']?0x1f4:_0x11a7bf[_0x066a('0x64')]||0x1f4;logger[_0x066a('0x65')](_0x066a('0x66'),_0x066a('0x67'),_0x3a3ba9,JSON[_0x066a('0x68')](_0x11a7bf));delete _0x11a7bf[_0x066a('0x25')];if(_0x3a3ba9===0x191){_0x3a3ba9=0x190;}_0x45264f[_0x066a('0x19')](_0x3a3ba9)[_0x066a('0x69')](_0x5cced5[_0x066a('0x2b')]['test']?{'message':_0x066a('0x6a'),'statusCode':_0x11a7bf['statusCode']}:_0x11a7bf);});}; \ No newline at end of file +var _0x1e69=['tokenSecret','remoteUri','slice','substring','lastIndexOf','GET','format','%s/custom_fields','application/json','headers','Authorization','Basic\x20%s','%s:%s','base64','concat','entries','active','statusCode','stringify','test','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','error','stack','name','map','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','DeskAccount','includeAll','findAll','rows','catch','show','params','include','find','create','body','update','destroy','getConfigurations','findOne','DeskConfiguration','addConfiguration','AccountId','channel','Descriptions','getDescriptions','DeskField','Subjects','getFields','priority','authType','username','password','consumerKey','consumerSecret','token'];(function(_0x25762c,_0x2709df){var _0x2f77a8=function(_0x9f133f){while(--_0x9f133f){_0x25762c['push'](_0x25762c['shift']());}};_0x2f77a8(++_0x2709df);}(_0x1e69,0x8a));var _0x91e6=function(_0x2d4b78,_0xa41467){_0x2d4b78=_0x2d4b78-0x0;var _0x14da49=_0x1e69[_0x2d4b78];return _0x14da49;};'use strict';var emlformat=require(_0x91e6('0x0'));var rimraf=require(_0x91e6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x91e6('0x2'));var rp=require(_0x91e6('0x3'));var moment=require(_0x91e6('0x4'));var BPromise=require(_0x91e6('0x5'));var Mustache=require(_0x91e6('0x6'));var util=require(_0x91e6('0x7'));var path=require(_0x91e6('0x8'));var sox=require(_0x91e6('0x9'));var csv=require(_0x91e6('0xa'));var ejs=require(_0x91e6('0xb'));var fs=require('fs');var fs_extra=require(_0x91e6('0xc'));var _=require('lodash');var squel=require(_0x91e6('0xd'));var crypto=require('crypto');var jsforce=require(_0x91e6('0xe'));var deskjs=require(_0x91e6('0xf'));var toCsv=require(_0x91e6('0xa'));var querystring=require(_0x91e6('0x10'));var Papa=require(_0x91e6('0x11'));var Redis=require(_0x91e6('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x91e6('0x13'));var as=require(_0x91e6('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x91e6('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x91e6('0x16'));var licenseUtil=require(_0x91e6('0x17'));var db=require(_0x91e6('0x18'))['db'];var integrations=require(_0x91e6('0x19'));function respondWithStatusCode(_0x3234a9,_0x2e25af){_0x2e25af=_0x2e25af||0xcc;return function(_0x2d443e){if(_0x2d443e){return _0x3234a9[_0x91e6('0x1a')](_0x2e25af);}return _0x3234a9[_0x91e6('0x1b')](_0x2e25af)[_0x91e6('0x1c')]();};}function respondWithResult(_0x469f0f,_0x1cf200){_0x1cf200=_0x1cf200||0xc8;return function(_0x2d1fcb){if(_0x2d1fcb){return _0x469f0f['status'](_0x1cf200)[_0x91e6('0x1d')](_0x2d1fcb);}};}function respondWithFilteredResult(_0xae0543,_0x5dab2c){return function(_0x4a1e33){if(_0x4a1e33){var _0x4397b7=typeof _0x5dab2c[_0x91e6('0x1e')]===_0x91e6('0x1f')&&typeof _0x5dab2c[_0x91e6('0x20')]==='undefined';var _0xad7f30=_0x4a1e33['count'];var _0x22a2a9=_0x4397b7?0x0:_0x5dab2c['offset'];var _0x55f526=_0x4397b7?_0x4a1e33[_0x91e6('0x21')]:_0x5dab2c[_0x91e6('0x1e')]+_0x5dab2c[_0x91e6('0x20')];var _0x2527dd;if(_0x55f526>=_0xad7f30){_0x55f526=_0xad7f30;_0x2527dd=0xc8;}else{_0x2527dd=0xce;}_0xae0543[_0x91e6('0x1b')](_0x2527dd);return _0xae0543[_0x91e6('0x22')](_0x91e6('0x23'),_0x22a2a9+'-'+_0x55f526+'/'+_0xad7f30)[_0x91e6('0x1d')](_0x4a1e33);}return null;};}function patchUpdates(_0x23d635){return function(_0x340a71){try{jsonpatch[_0x91e6('0x24')](_0x340a71,_0x23d635,!![]);}catch(_0x33f3ba){return BPromise[_0x91e6('0x25')](_0x33f3ba);}return _0x340a71['save']();};}function saveUpdates(_0x2c78bd,_0x2aa820){return function(_0x3c0e58){if(_0x3c0e58){return _0x3c0e58['update'](_0x2c78bd)['then'](function(_0x344ec8){return _0x344ec8;});}return null;};}function removeEntity(_0x1d0152,_0x317dc6){return function(_0x4e69ac){if(_0x4e69ac){return _0x4e69ac['destroy']()[_0x91e6('0x26')](function(){_0x1d0152[_0x91e6('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3675d8,_0x3fa660){return function(_0x157f62){if(!_0x157f62){_0x3675d8[_0x91e6('0x1a')](0x194);}return _0x157f62;};}function handleError(_0x24292b,_0x266d96){_0x266d96=_0x266d96||0x1f4;return function(_0x55b668){logger[_0x91e6('0x27')](_0x55b668[_0x91e6('0x28')]);if(_0x55b668[_0x91e6('0x29')]){delete _0x55b668['name'];}_0x24292b[_0x91e6('0x1b')](_0x266d96)['send'](_0x55b668);};}exports['index']=function(_0x35e942,_0x41cd25){var _0x4d6ade={},_0x51c10b={},_0xdf9984={'count':0x0,'rows':[]};var _0x33ef61=_[_0x91e6('0x2a')](db['DeskAccount'][_0x91e6('0x2b')],function(_0x2b7a83){return{'name':_0x2b7a83[_0x91e6('0x2c')],'type':_0x2b7a83[_0x91e6('0x2d')][_0x91e6('0x2e')]};});_0x51c10b['model']=_[_0x91e6('0x2a')](_0x33ef61,_0x91e6('0x29'));_0x51c10b[_0x91e6('0x2f')]=_[_0x91e6('0x30')](_0x35e942['query']);_0x51c10b[_0x91e6('0x31')]=_['intersection'](_0x51c10b[_0x91e6('0x32')],_0x51c10b['query']);_0x4d6ade[_0x91e6('0x33')]=_[_0x91e6('0x34')](_0x51c10b[_0x91e6('0x32')],qs[_0x91e6('0x35')](_0x35e942[_0x91e6('0x2f')][_0x91e6('0x35')]));_0x4d6ade['attributes']=_0x4d6ade['attributes'][_0x91e6('0x36')]?_0x4d6ade[_0x91e6('0x33')]:_0x51c10b[_0x91e6('0x32')];if(!_0x35e942[_0x91e6('0x2f')][_0x91e6('0x37')](_0x91e6('0x38'))){_0x4d6ade[_0x91e6('0x20')]=qs[_0x91e6('0x20')](_0x35e942[_0x91e6('0x2f')][_0x91e6('0x20')]);_0x4d6ade[_0x91e6('0x1e')]=qs[_0x91e6('0x1e')](_0x35e942['query'][_0x91e6('0x1e')]);}_0x4d6ade[_0x91e6('0x39')]=qs[_0x91e6('0x3a')](_0x35e942['query'][_0x91e6('0x3a')]);_0x4d6ade[_0x91e6('0x3b')]=qs[_0x91e6('0x31')](_[_0x91e6('0x3c')](_0x35e942[_0x91e6('0x2f')],_0x51c10b[_0x91e6('0x31')]),_0x33ef61);if(_0x35e942[_0x91e6('0x2f')][_0x91e6('0x3d')]){_0x4d6ade[_0x91e6('0x3b')]=_[_0x91e6('0x3e')](_0x4d6ade[_0x91e6('0x3b')],{'$or':_[_0x91e6('0x2a')](_0x33ef61,function(_0x41745c){if(_0x41745c[_0x91e6('0x2d')]!==_0x91e6('0x3f')){var _0x4940b3={};_0x4940b3[_0x41745c[_0x91e6('0x29')]]={'$like':'%'+_0x35e942['query'][_0x91e6('0x3d')]+'%'};return _0x4940b3;}})});}_0x4d6ade=_[_0x91e6('0x3e')]({},_0x4d6ade,_0x35e942[_0x91e6('0x40')]);var _0x53feaa={'where':_0x4d6ade['where']};return db[_0x91e6('0x41')][_0x91e6('0x21')](_0x53feaa)['then'](function(_0x15ae12){_0xdf9984['count']=_0x15ae12;if(_0x35e942[_0x91e6('0x2f')][_0x91e6('0x42')]){_0x4d6ade['include']=[{'all':!![]}];}return db['DeskAccount'][_0x91e6('0x43')](_0x4d6ade);})['then'](function(_0x3d2ef9){_0xdf9984[_0x91e6('0x44')]=_0x3d2ef9;return _0xdf9984;})[_0x91e6('0x26')](respondWithFilteredResult(_0x41cd25,_0x4d6ade))[_0x91e6('0x45')](handleError(_0x41cd25,null));};exports[_0x91e6('0x46')]=function(_0x2d8a8a,_0x4e016f){var _0x3fce26={'raw':![],'where':{'id':_0x2d8a8a[_0x91e6('0x47')]['id']}},_0x791424={};_0x791424[_0x91e6('0x32')]=_['keys'](db[_0x91e6('0x41')][_0x91e6('0x2b')]);_0x791424[_0x91e6('0x2f')]=_[_0x91e6('0x30')](_0x2d8a8a[_0x91e6('0x2f')]);_0x791424['filters']=_['intersection'](_0x791424[_0x91e6('0x32')],_0x791424[_0x91e6('0x2f')]);_0x3fce26[_0x91e6('0x33')]=_[_0x91e6('0x34')](_0x791424[_0x91e6('0x32')],qs[_0x91e6('0x35')](_0x2d8a8a[_0x91e6('0x2f')][_0x91e6('0x35')]));_0x3fce26[_0x91e6('0x33')]=_0x3fce26['attributes'][_0x91e6('0x36')]?_0x3fce26[_0x91e6('0x33')]:_0x791424[_0x91e6('0x32')];if(_0x2d8a8a['query'][_0x91e6('0x42')]){_0x3fce26[_0x91e6('0x48')]=[{'all':!![]}];}_0x3fce26=_[_0x91e6('0x3e')]({},_0x3fce26,_0x2d8a8a['options']);return db[_0x91e6('0x41')][_0x91e6('0x49')](_0x3fce26)['then'](handleEntityNotFound(_0x4e016f,null))['then'](respondWithResult(_0x4e016f,null))[_0x91e6('0x45')](handleError(_0x4e016f,null));};exports[_0x91e6('0x4a')]=function(_0x29558d,_0x1ff40e){return db[_0x91e6('0x41')][_0x91e6('0x4a')](_0x29558d[_0x91e6('0x4b')],{})[_0x91e6('0x26')](respondWithResult(_0x1ff40e,0xc9))[_0x91e6('0x45')](handleError(_0x1ff40e,null));};exports[_0x91e6('0x4c')]=function(_0x3650b2,_0x5e84c1){if(_0x3650b2[_0x91e6('0x4b')]['id']){delete _0x3650b2['body']['id'];}return db[_0x91e6('0x41')][_0x91e6('0x49')]({'where':{'id':_0x3650b2[_0x91e6('0x47')]['id']}})['then'](handleEntityNotFound(_0x5e84c1,null))[_0x91e6('0x26')](saveUpdates(_0x3650b2['body'],null))[_0x91e6('0x26')](respondWithResult(_0x5e84c1,null))[_0x91e6('0x45')](handleError(_0x5e84c1,null));};exports[_0x91e6('0x4d')]=function(_0x462225,_0x3b18b1){return db[_0x91e6('0x41')]['find']({'where':{'id':_0x462225[_0x91e6('0x47')]['id']}})['then'](handleEntityNotFound(_0x3b18b1,null))[_0x91e6('0x26')](removeEntity(_0x3b18b1,null))[_0x91e6('0x45')](handleError(_0x3b18b1,null));};exports[_0x91e6('0x4e')]=function(_0x578ed0,_0x3e8974,_0x4ce872){var _0x196125={};var _0x1426a4={};var _0x487da5;var _0x4d02e7;return db['DeskAccount'][_0x91e6('0x4f')]({'where':{'id':_0x578ed0[_0x91e6('0x47')]['id']}})['then'](handleEntityNotFound(_0x3e8974,null))['then'](function(_0x944198){if(_0x944198){_0x487da5=_0x944198;_0x1426a4['model']=_[_0x91e6('0x30')](db[_0x91e6('0x50')]['rawAttributes']);_0x1426a4['query']=_[_0x91e6('0x30')](_0x578ed0[_0x91e6('0x2f')]);_0x1426a4['filters']=_['intersection'](_0x1426a4[_0x91e6('0x32')],_0x1426a4[_0x91e6('0x2f')]);_0x196125[_0x91e6('0x33')]=_[_0x91e6('0x34')](_0x1426a4[_0x91e6('0x32')],qs[_0x91e6('0x35')](_0x578ed0[_0x91e6('0x2f')][_0x91e6('0x35')]));_0x196125[_0x91e6('0x33')]=_0x196125[_0x91e6('0x33')]['length']?_0x196125[_0x91e6('0x33')]:_0x1426a4[_0x91e6('0x32')];_0x196125[_0x91e6('0x39')]=qs[_0x91e6('0x3a')](_0x578ed0[_0x91e6('0x2f')][_0x91e6('0x3a')]);_0x196125[_0x91e6('0x3b')]=qs[_0x91e6('0x31')](_[_0x91e6('0x3c')](_0x578ed0[_0x91e6('0x2f')],_0x1426a4[_0x91e6('0x31')]));if(_0x578ed0[_0x91e6('0x2f')]['filter']){_0x196125[_0x91e6('0x3b')]=_[_0x91e6('0x3e')](_0x196125[_0x91e6('0x3b')],{'$or':_[_0x91e6('0x2a')](_0x196125['attributes'],function(_0x69517b){var _0x67513c={};_0x67513c[_0x69517b]={'$like':'%'+_0x578ed0[_0x91e6('0x2f')]['filter']+'%'};return _0x67513c;})});}_0x196125=_[_0x91e6('0x3e')]({},_0x196125,_0x578ed0[_0x91e6('0x40')]);return _0x487da5[_0x91e6('0x4e')](_0x196125);}})[_0x91e6('0x26')](function(_0x4618be){if(_0x4618be){_0x4d02e7=_0x4618be[_0x91e6('0x36')];if(!_0x578ed0[_0x91e6('0x2f')][_0x91e6('0x37')](_0x91e6('0x38'))){_0x196125[_0x91e6('0x20')]=qs[_0x91e6('0x20')](_0x578ed0[_0x91e6('0x2f')][_0x91e6('0x20')]);_0x196125[_0x91e6('0x1e')]=qs[_0x91e6('0x1e')](_0x578ed0['query'][_0x91e6('0x1e')]);}return _0x487da5[_0x91e6('0x4e')](_0x196125);}})[_0x91e6('0x26')](function(_0x4c6404){if(_0x4c6404){return _0x4c6404?{'count':_0x4d02e7,'rows':_0x4c6404}:null;}})[_0x91e6('0x26')](respondWithResult(_0x3e8974,null))[_0x91e6('0x45')](handleError(_0x3e8974,null));};exports[_0x91e6('0x51')]=function(_0x44ff74,_0x1340b8,_0x529eac){if(_0x44ff74[_0x91e6('0x4b')]['id']){delete _0x44ff74['body']['id'];}return db[_0x91e6('0x41')][_0x91e6('0x4f')]({'where':{'id':_0x44ff74['params']['id']}})[_0x91e6('0x26')](handleEntityNotFound(_0x1340b8,null))['then'](function(_0x11597d){if(_0x11597d){_0x44ff74['body'][_0x91e6('0x52')]=_0x11597d['id'];_0x44ff74[_0x91e6('0x4b')]['Subjects']=integrations['getSubjects'](_0x44ff74[_0x91e6('0x4b')][_0x91e6('0x53')],_0x44ff74[_0x91e6('0x4b')][_0x91e6('0x2d')]);_0x44ff74['body'][_0x91e6('0x54')]=integrations[_0x91e6('0x55')](_0x44ff74[_0x91e6('0x4b')][_0x91e6('0x53')],_0x44ff74[_0x91e6('0x4b')][_0x91e6('0x2d')]);return db[_0x91e6('0x50')]['create'](_0x44ff74[_0x91e6('0x4b')],{'include':[{'model':db[_0x91e6('0x56')],'as':_0x91e6('0x57')},{'model':db['DeskField'],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x1340b8,null))[_0x91e6('0x45')](handleError(_0x1340b8,null));};exports[_0x91e6('0x58')]=function(_0x8ff7bf,_0x1e50c8,_0x2e059a){var _0x400de1=[{'name':_0x91e6('0x59'),'label':_0x91e6('0x59'),'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 _0x2f4637='';return db['DeskAccount'][_0x91e6('0x4f')]({'where':{'id':_0x8ff7bf['params']['id']},'attributes':['id','remoteUri',_0x91e6('0x5a'),_0x91e6('0x5b'),_0x91e6('0x5c'),_0x91e6('0x5d'),_0x91e6('0x5e'),_0x91e6('0x5f'),_0x91e6('0x60')]})[_0x91e6('0x26')](handleEntityNotFound(_0x1e50c8,null))['then'](function(_0x2305b2){if(_0x2305b2){_0x2f4637=_0x2305b2[_0x91e6('0x61')];var _0x4e8f2e=_0x2f4637[_0x91e6('0x62')](-0x1);if(_0x4e8f2e==='/'){_0x2f4637=_0x2f4637[_0x91e6('0x63')](0x0,_0x2f4637[_0x91e6('0x64')](_0x4e8f2e));}var _0x4d0401={'method':_0x91e6('0x65'),'uri':util[_0x91e6('0x66')](_0x91e6('0x67'),_0x2f4637),'headers':{'Content-Type':_0x91e6('0x68'),'Accept':_0x91e6('0x68')},'json':!![]};if(_0x2305b2['authType']==='basic'){_0x4d0401[_0x91e6('0x69')][_0x91e6('0x6a')]=util['format'](_0x91e6('0x6b'),new Buffer(util[_0x91e6('0x66')](_0x91e6('0x6c'),_0x2305b2['username'],_0x2305b2[_0x91e6('0x5c')]))['toString'](_0x91e6('0x6d')));}return rp(_0x4d0401)[_0x91e6('0x26')](function(_0x41d562){return _0x400de1[_0x91e6('0x6e')](_[_0x91e6('0x2a')](_0x41d562['_embedded'][_0x91e6('0x6f')],function(_0x58825b){return{'id':_0x58825b[_0x91e6('0x29')],'name':_0x58825b[_0x91e6('0x29')],'type':_0x58825b[_0x91e6('0x2d')],'active':_0x58825b[_0x91e6('0x70')],'label':_0x58825b['label'],'custom':!![]};}));});}})[_0x91e6('0x26')](function(_0x47feb2){return{'count':_0x47feb2[_0x91e6('0x36')],'rows':_0x47feb2};})['then'](respondWithResult(_0x1e50c8,null))['catch'](function(_0x3121d8){var _0x225540=_0x8ff7bf[_0x91e6('0x2f')]['test']?0x1f4:_0x3121d8[_0x91e6('0x71')]||0x1f4;logger[_0x91e6('0x27')]('getFields,\x20%s,\x20%s,\x20%s',_0x91e6('0x58'),_0x225540,JSON[_0x91e6('0x72')](_0x3121d8));delete _0x3121d8[_0x91e6('0x29')];if(_0x225540===0x191){_0x225540=0x190;}_0x1e50c8[_0x91e6('0x1b')](_0x225540)['send'](_0x8ff7bf[_0x91e6('0x2f')][_0x91e6('0x73')]?{'message':_0x91e6('0x74'),'statusCode':_0x3121d8[_0x91e6('0x71')]}:_0x3121d8);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index 21bbc22..2eae363 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 _0x874e=['define','DeskAccount','int_desk_accounts','lodash','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','exports'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x874e,0xac));var _0xe874=function(_0xbc4560,_0x4020b8){_0xbc4560=_0xbc4560-0x0;var _0x298cfb=_0x874e[_0xbc4560];return _0x298cfb;};'use strict';var _=require(_0xe874('0x0'));var util=require('util');var logger=require(_0xe874('0x1'))(_0xe874('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe874('0x3'));var fs=require('fs');var path=require(_0xe874('0x4'));var rimraf=require(_0xe874('0x5'));var config=require(_0xe874('0x6'));var attributes=require(_0xe874('0x7'));var integrations=require(_0xe874('0x8'));module[_0xe874('0x9')]=function(_0x31e00c,_0x3be59d){return _0x31e00c[_0xe874('0xa')](_0xe874('0xb'),attributes,{'tableName':_0xe874('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xac9b=['moment','bluebird','request-promise','rimraf','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','exports','define','DeskAccount','int_desk_accounts','util','../../config/logger','api'];(function(_0x35d0af,_0x46a010){var _0x4bc858=function(_0x176a02){while(--_0x176a02){_0x35d0af['push'](_0x35d0af['shift']());}};_0x4bc858(++_0x46a010);}(_0xac9b,0x6d));var _0xbac9=function(_0x2714ec,_0x36daa4){_0x2714ec=_0x2714ec-0x0;var _0x2608e5=_0xac9b[_0x2714ec];return _0x2608e5;};'use strict';var _=require('lodash');var util=require(_0xbac9('0x0'));var logger=require(_0xbac9('0x1'))(_0xbac9('0x2'));var moment=require(_0xbac9('0x3'));var BPromise=require(_0xbac9('0x4'));var rp=require(_0xbac9('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbac9('0x6'));var config=require(_0xbac9('0x7'));var attributes=require(_0xbac9('0x8'));var integrations=require(_0xbac9('0x9'));module[_0xbac9('0xa')]=function(_0x492b9e,_0x5b0f6c){return _0x492b9e[_0xbac9('0xb')](_0xbac9('0xc'),attributes,{'tableName':_0xbac9('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 a98935f..2cf8a78 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 _0x1c49=['../../config/logger','rpc','../../config/environment','client','http','request','then','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','catch','DeskAccount','findAll','options','raw','where','attributes','limit','include','map','model','GetDeskAccount','find','ShowDeskAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x18bd3e,_0x514c52){var _0x3dcc3d=function(_0x2dd2cb){while(--_0x2dd2cb){_0x18bd3e['push'](_0x18bd3e['shift']());}};_0x3dcc3d(++_0x514c52);}(_0x1c49,0x1e3));var _0x91c4=function(_0x13267a,_0x490bb7){_0x13267a=_0x13267a-0x0;var _0x86874b=_0x1c49[_0x13267a];return _0x86874b;};'use strict';var _=require(_0x91c4('0x0'));var util=require(_0x91c4('0x1'));var moment=require(_0x91c4('0x2'));var BPromise=require(_0x91c4('0x3'));var rs=require(_0x91c4('0x4'));var fs=require('fs');var Redis=require(_0x91c4('0x5'));var db=require(_0x91c4('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x91c4('0x7'))(_0x91c4('0x8'));var config=require(_0x91c4('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x91c4('0xa')][_0x91c4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x410294,_0x2c381c,_0x5736a7){return new BPromise(function(_0x5afec6,_0x18cdc4){return client[_0x91c4('0xc')](_0x410294,_0x5736a7)[_0x91c4('0xd')](function(_0x53b89c){logger['info'](_0x91c4('0xe'),_0x2c381c,_0x91c4('0xf'));logger[_0x91c4('0x10')]('DeskAccount,\x20%s,\x20%s,\x20%s',_0x2c381c,_0x91c4('0xf'),JSON[_0x91c4('0x11')](_0x53b89c));if(_0x53b89c[_0x91c4('0x12')]){if(_0x53b89c[_0x91c4('0x12')]['code']===0x1f4){logger[_0x91c4('0x12')](_0x91c4('0xe'),_0x2c381c,_0x53b89c[_0x91c4('0x12')]['message']);return _0x18cdc4(_0x53b89c['error'][_0x91c4('0x13')]);}logger[_0x91c4('0x12')](_0x91c4('0xe'),_0x2c381c,_0x53b89c['error'][_0x91c4('0x13')]);return _0x5afec6(_0x53b89c[_0x91c4('0x12')][_0x91c4('0x13')]);}else{logger[_0x91c4('0x14')](_0x91c4('0xe'),_0x2c381c,_0x91c4('0xf'));_0x5afec6(_0x53b89c['result'][_0x91c4('0x13')]);}})[_0x91c4('0x15')](function(_0x566ee8){logger[_0x91c4('0x12')](_0x91c4('0xe'),_0x2c381c,_0x566ee8);_0x18cdc4(_0x566ee8);});});}exports['GetDeskAccount']=function(_0x218ddd){var _0x410415=this;return new Promise(function(_0x1c099d,_0x240207){return db[_0x91c4('0x16')][_0x91c4('0x17')]({'raw':_0x218ddd[_0x91c4('0x18')]?_0x218ddd['options'][_0x91c4('0x19')]===undefined?!![]:![]:!![],'where':_0x218ddd[_0x91c4('0x18')]?_0x218ddd[_0x91c4('0x18')][_0x91c4('0x1a')]||null:null,'attributes':_0x218ddd[_0x91c4('0x18')]?_0x218ddd[_0x91c4('0x18')][_0x91c4('0x1b')]||null:null,'limit':_0x218ddd[_0x91c4('0x18')]?_0x218ddd['options'][_0x91c4('0x1c')]||null:null,'include':_0x218ddd[_0x91c4('0x18')]?_0x218ddd[_0x91c4('0x18')][_0x91c4('0x1d')]?_[_0x91c4('0x1e')](_0x218ddd[_0x91c4('0x18')][_0x91c4('0x1d')],function(_0x3ae2d7){return{'model':db[_0x3ae2d7[_0x91c4('0x1f')]],'as':_0x3ae2d7['as'],'attributes':_0x3ae2d7[_0x91c4('0x1b')],'include':_0x3ae2d7[_0x91c4('0x1d')]?_[_0x91c4('0x1e')](_0x3ae2d7['include'],function(_0x55ad3c){return{'model':db[_0x55ad3c[_0x91c4('0x1f')]],'as':_0x55ad3c['as'],'attributes':_0x55ad3c[_0x91c4('0x1b')],'include':_0x55ad3c[_0x91c4('0x1d')]?_[_0x91c4('0x1e')](_0x55ad3c['include'],function(_0x2eb71a){return{'model':db[_0x2eb71a[_0x91c4('0x1f')]],'as':_0x2eb71a['as'],'attributes':_0x2eb71a[_0x91c4('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x91c4('0xd')](function(_0xb500fe){logger['info'](_0x91c4('0x20'),_0x218ddd);logger[_0x91c4('0x10')](_0x91c4('0x20'),_0x218ddd,JSON['stringify'](_0xb500fe));_0x1c099d(_0xb500fe);})[_0x91c4('0x15')](function(_0x26c97f){logger[_0x91c4('0x12')](_0x91c4('0x20'),_0x26c97f[_0x91c4('0x13')],_0x218ddd);_0x240207(_0x410415[_0x91c4('0x12')](0x1f4,_0x26c97f[_0x91c4('0x13')]));});});};exports['ShowDeskAccount']=function(_0x159ee2){var _0x3b164b=this;return new Promise(function(_0x5dc1d0,_0x3c6889){return db[_0x91c4('0x16')][_0x91c4('0x21')]({'raw':_0x159ee2[_0x91c4('0x18')]?_0x159ee2[_0x91c4('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x159ee2['options']?_0x159ee2[_0x91c4('0x18')][_0x91c4('0x1a')]||null:null,'attributes':_0x159ee2[_0x91c4('0x18')]?_0x159ee2['options']['attributes']||null:null,'include':_0x159ee2['options']?_0x159ee2[_0x91c4('0x18')]['include']?_[_0x91c4('0x1e')](_0x159ee2[_0x91c4('0x18')][_0x91c4('0x1d')],function(_0x1b89bc){return{'model':db[_0x1b89bc[_0x91c4('0x1f')]],'as':_0x1b89bc['as'],'attributes':_0x1b89bc[_0x91c4('0x1b')],'include':_0x1b89bc[_0x91c4('0x1d')]?_['map'](_0x1b89bc[_0x91c4('0x1d')],function(_0x1c75e8){return{'model':db[_0x1c75e8[_0x91c4('0x1f')]],'as':_0x1c75e8['as'],'attributes':_0x1c75e8[_0x91c4('0x1b')],'include':_0x1c75e8[_0x91c4('0x1d')]?_[_0x91c4('0x1e')](_0x1c75e8['include'],function(_0x3ddc68){return{'model':db[_0x3ddc68[_0x91c4('0x1f')]],'as':_0x3ddc68['as'],'attributes':_0x3ddc68[_0x91c4('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x178a5d){logger['info'](_0x91c4('0x22'),_0x159ee2);logger['debug'](_0x91c4('0x22'),_0x159ee2,JSON[_0x91c4('0x11')](_0x178a5d));_0x5dc1d0(_0x178a5d);})[_0x91c4('0x15')](function(_0x22c90d){logger[_0x91c4('0x12')](_0x91c4('0x22'),_0x22c90d[_0x91c4('0x13')],_0x159ee2);_0x3c6889(_0x3b164b[_0x91c4('0x12')](0x1f4,_0x22c90d[_0x91c4('0x13')]));});});}; \ No newline at end of file +var _0xf970=['attributes','include','map','model','stringify','ShowDeskAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetDeskAccount','DeskAccount','findAll','options','raw','where'];(function(_0xc6be3a,_0x540e05){var _0x56a310=function(_0x50a144){while(--_0x50a144){_0xc6be3a['push'](_0xc6be3a['shift']());}};_0x56a310(++_0x540e05);}(_0xf970,0xd8));var _0x0f97=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf970[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x0f97('0x0'));var util=require(_0x0f97('0x1'));var moment=require(_0x0f97('0x2'));var BPromise=require(_0x0f97('0x3'));var rs=require(_0x0f97('0x4'));var fs=require('fs');var Redis=require(_0x0f97('0x5'));var db=require(_0x0f97('0x6'))['db'];var utils=require(_0x0f97('0x7'));var logger=require(_0x0f97('0x8'))(_0x0f97('0x9'));var config=require(_0x0f97('0xa'));var jayson=require(_0x0f97('0xb'));var client=jayson['client'][_0x0f97('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x33a0c4,_0xfe953e,_0x3a2519){return new BPromise(function(_0x14e08d,_0x21f6b1){return client['request'](_0x33a0c4,_0x3a2519)[_0x0f97('0xd')](function(_0x1823c4){logger[_0x0f97('0xe')](_0x0f97('0xf'),_0xfe953e,_0x0f97('0x10'));logger[_0x0f97('0x11')](_0x0f97('0x12'),_0xfe953e,_0x0f97('0x10'),JSON['stringify'](_0x1823c4));if(_0x1823c4[_0x0f97('0x13')]){if(_0x1823c4[_0x0f97('0x13')][_0x0f97('0x14')]===0x1f4){logger[_0x0f97('0x13')]('DeskAccount,\x20%s,\x20%s',_0xfe953e,_0x1823c4[_0x0f97('0x13')][_0x0f97('0x15')]);return _0x21f6b1(_0x1823c4['error'][_0x0f97('0x15')]);}logger[_0x0f97('0x13')]('DeskAccount,\x20%s,\x20%s',_0xfe953e,_0x1823c4[_0x0f97('0x13')][_0x0f97('0x15')]);return _0x14e08d(_0x1823c4[_0x0f97('0x13')]['message']);}else{logger[_0x0f97('0xe')](_0x0f97('0xf'),_0xfe953e,_0x0f97('0x10'));_0x14e08d(_0x1823c4['result']['message']);}})[_0x0f97('0x16')](function(_0x312bda){logger[_0x0f97('0x13')](_0x0f97('0xf'),_0xfe953e,_0x312bda);_0x21f6b1(_0x312bda);});});}exports[_0x0f97('0x17')]=function(_0x5e7c74){var _0x4b8de9=this;return new Promise(function(_0x3c1e50,_0x3371f0){return db[_0x0f97('0x18')][_0x0f97('0x19')]({'raw':_0x5e7c74[_0x0f97('0x1a')]?_0x5e7c74[_0x0f97('0x1a')][_0x0f97('0x1b')]===undefined?!![]:![]:!![],'where':_0x5e7c74[_0x0f97('0x1a')]?_0x5e7c74['options'][_0x0f97('0x1c')]||null:null,'attributes':_0x5e7c74['options']?_0x5e7c74[_0x0f97('0x1a')][_0x0f97('0x1d')]||null:null,'limit':_0x5e7c74[_0x0f97('0x1a')]?_0x5e7c74['options']['limit']||null:null,'include':_0x5e7c74['options']?_0x5e7c74[_0x0f97('0x1a')][_0x0f97('0x1e')]?_[_0x0f97('0x1f')](_0x5e7c74['options'][_0x0f97('0x1e')],function(_0x4655b7){return{'model':db[_0x4655b7[_0x0f97('0x20')]],'as':_0x4655b7['as'],'attributes':_0x4655b7['attributes'],'include':_0x4655b7['include']?_['map'](_0x4655b7[_0x0f97('0x1e')],function(_0x8bf2f){return{'model':db[_0x8bf2f[_0x0f97('0x20')]],'as':_0x8bf2f['as'],'attributes':_0x8bf2f['attributes'],'include':_0x8bf2f[_0x0f97('0x1e')]?_[_0x0f97('0x1f')](_0x8bf2f[_0x0f97('0x1e')],function(_0x5d569e){return{'model':db[_0x5d569e[_0x0f97('0x20')]],'as':_0x5d569e['as'],'attributes':_0x5d569e[_0x0f97('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x0f97('0xd')](function(_0x175834){logger[_0x0f97('0xe')](_0x0f97('0x17'),_0x5e7c74);logger[_0x0f97('0x11')]('GetDeskAccount',_0x5e7c74,JSON[_0x0f97('0x21')](_0x175834));_0x3c1e50(_0x175834);})['catch'](function(_0x2379d6){logger['error'](_0x0f97('0x17'),_0x2379d6[_0x0f97('0x15')],_0x5e7c74);_0x3371f0(_0x4b8de9[_0x0f97('0x13')](0x1f4,_0x2379d6[_0x0f97('0x15')]));});});};exports['ShowDeskAccount']=function(_0x497def){var _0x39365a=this;return new Promise(function(_0x3372f4,_0x57ccea){return db[_0x0f97('0x18')]['find']({'raw':_0x497def[_0x0f97('0x1a')]?_0x497def[_0x0f97('0x1a')][_0x0f97('0x1b')]===undefined?!![]:![]:!![],'where':_0x497def[_0x0f97('0x1a')]?_0x497def['options']['where']||null:null,'attributes':_0x497def[_0x0f97('0x1a')]?_0x497def['options']['attributes']||null:null,'include':_0x497def[_0x0f97('0x1a')]?_0x497def[_0x0f97('0x1a')][_0x0f97('0x1e')]?_[_0x0f97('0x1f')](_0x497def[_0x0f97('0x1a')][_0x0f97('0x1e')],function(_0x4d6122){return{'model':db[_0x4d6122[_0x0f97('0x20')]],'as':_0x4d6122['as'],'attributes':_0x4d6122[_0x0f97('0x1d')],'include':_0x4d6122['include']?_[_0x0f97('0x1f')](_0x4d6122['include'],function(_0xd61747){return{'model':db[_0xd61747[_0x0f97('0x20')]],'as':_0xd61747['as'],'attributes':_0xd61747['attributes'],'include':_0xd61747[_0x0f97('0x1e')]?_[_0x0f97('0x1f')](_0xd61747[_0x0f97('0x1e')],function(_0x280838){return{'model':db[_0x280838[_0x0f97('0x20')]],'as':_0x280838['as'],'attributes':_0x280838[_0x0f97('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x0f97('0xd')](function(_0x3838b9){logger[_0x0f97('0xe')](_0x0f97('0x22'),_0x497def);logger['debug'](_0x0f97('0x22'),_0x497def,JSON['stringify'](_0x3838b9));_0x3372f4(_0x3838b9);})[_0x0f97('0x16')](function(_0x1155af){logger[_0x0f97('0x13')](_0x0f97('0x22'),_0x1155af[_0x0f97('0x15')],_0x497def);_0x57ccea(_0x39365a[_0x0f97('0x13')](0x1f4,_0x1155af[_0x0f97('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index 26a962b..898fff9 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(_0x130cbb,_0x254820){var _0x15b1ea=function(_0x1688e2){while(--_0x1688e2){_0x130cbb['push'](_0x130cbb['shift']());}};_0x15b1ea(++_0x254820);}(_0x9c44,0x178));var _0x49c4=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0x9c44[_0xdea41a];return _0x15d0d8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x49c4('0x6'));router['get']('/',auth[_0x49c4('0x7')](),controller[_0x49c4('0x8')]);router[_0x49c4('0x9')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller['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 _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(_0x3cdff2,_0x30d0e9){var _0x1e06e9=function(_0x51cf08){while(--_0x51cf08){_0x3cdff2['push'](_0x3cdff2['shift']());}};_0x1e06e9(++_0x30d0e9);}(_0x9c44,0x178));var _0x49c4=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x9c44[_0x422905];return _0x33dc6c;};'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 diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index 6af736b..d583ee2 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 _0xe5cd=['sequelize','exports','STRING'];(function(_0x354247,_0xe1411b){var _0x38c6b5=function(_0x2eae4b){while(--_0x2eae4b){_0x354247['push'](_0x354247['shift']());}};_0x38c6b5(++_0xe1411b);}(_0xe5cd,0x183));var _0xde5c=function(_0x4dccf2,_0x5cfcd7){_0x4dccf2=_0x4dccf2-0x0;var _0x12640e=_0xe5cd[_0x4dccf2];return _0x12640e;};'use strict';var Sequelize=require(_0xde5c('0x0'));module[_0xde5c('0x1')]={'name':{'type':Sequelize[_0xde5c('0x2')]},'description':{'type':Sequelize[_0xde5c('0x2')]}}; \ No newline at end of file +var _0x6fd9=['sequelize','STRING'];(function(_0x172bac,_0x5a3e91){var _0x38d930=function(_0x169f46){while(--_0x169f46){_0x172bac['push'](_0x172bac['shift']());}};_0x38d930(++_0x5a3e91);}(_0x6fd9,0x198));var _0x96fd=function(_0x7f63af,_0x39ac52){_0x7f63af=_0x7f63af-0x0;var _0x1a5bc5=_0x6fd9[_0x7f63af];return _0x1a5bc5;};'use strict';var Sequelize=require(_0x96fd('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x96fd('0x1')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index c5b0c21..a95af1b 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 _0x17d9=['api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','DeskConfiguration','include','findAll','rows','catch','params','model','includeAll','find','create','body','getFields','findOne','DeskField','nolimit','getSubjects','getDescriptions','Tag','getTags','setTags','ids','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x54c0e4,_0x2834b3){var _0x2fc03f=function(_0x2c550d){while(--_0x2c550d){_0x54c0e4['push'](_0x54c0e4['shift']());}};_0x2fc03f(++_0x2834b3);}(_0x17d9,0x151));var _0x917d=function(_0x2b152a,_0x3dd988){_0x2b152a=_0x2b152a-0x0;var _0x2ad4c7=_0x17d9[_0x2b152a];return _0x2ad4c7;};'use strict';var emlformat=require(_0x917d('0x0'));var rimraf=require(_0x917d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x917d('0x2'));var rp=require(_0x917d('0x3'));var moment=require(_0x917d('0x4'));var BPromise=require(_0x917d('0x5'));var Mustache=require(_0x917d('0x6'));var util=require(_0x917d('0x7'));var path=require(_0x917d('0x8'));var sox=require(_0x917d('0x9'));var csv=require('to-csv');var ejs=require(_0x917d('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x917d('0xb'));var crypto=require(_0x917d('0xc'));var jsforce=require(_0x917d('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x917d('0xe'));var querystring=require(_0x917d('0xf'));var Papa=require(_0x917d('0x10'));var Redis=require(_0x917d('0x11'));var authService=require(_0x917d('0x12'));var qs=require(_0x917d('0x13'));var as=require(_0x917d('0x14'));var hardwareService=require(_0x917d('0x15'));var logger=require(_0x917d('0x16'))(_0x917d('0x17'));var utils=require(_0x917d('0x18'));var config=require(_0x917d('0x19'));var licenseUtil=require(_0x917d('0x1a'));var db=require(_0x917d('0x1b'))['db'];function respondWithStatusCode(_0x52f534,_0x1f1cae){_0x1f1cae=_0x1f1cae||0xcc;return function(_0x3830bb){if(_0x3830bb){return _0x52f534[_0x917d('0x1c')](_0x1f1cae);}return _0x52f534[_0x917d('0x1d')](_0x1f1cae)['end']();};}function respondWithResult(_0xc1f41f,_0x1ffbe1){_0x1ffbe1=_0x1ffbe1||0xc8;return function(_0x3d89e3){if(_0x3d89e3){return _0xc1f41f[_0x917d('0x1d')](_0x1ffbe1)[_0x917d('0x1e')](_0x3d89e3);}};}function respondWithFilteredResult(_0x2848f4,_0xfa14a8){return function(_0x30a791){if(_0x30a791){var _0x4977b1=typeof _0xfa14a8['offset']===_0x917d('0x1f')&&typeof _0xfa14a8[_0x917d('0x20')]===_0x917d('0x1f');var _0x2457a8=_0x30a791[_0x917d('0x21')];var _0x14f35d=_0x4977b1?0x0:_0xfa14a8[_0x917d('0x22')];var _0x1d2d9a=_0x4977b1?_0x30a791[_0x917d('0x21')]:_0xfa14a8[_0x917d('0x22')]+_0xfa14a8[_0x917d('0x20')];var _0x161fb9;if(_0x1d2d9a>=_0x2457a8){_0x1d2d9a=_0x2457a8;_0x161fb9=0xc8;}else{_0x161fb9=0xce;}_0x2848f4['status'](_0x161fb9);return _0x2848f4[_0x917d('0x23')](_0x917d('0x24'),_0x14f35d+'-'+_0x1d2d9a+'/'+_0x2457a8)[_0x917d('0x1e')](_0x30a791);}return null;};}function patchUpdates(_0x3ec942){return function(_0xedfe23){try{jsonpatch[_0x917d('0x25')](_0xedfe23,_0x3ec942,!![]);}catch(_0x17aade){return BPromise[_0x917d('0x26')](_0x17aade);}return _0xedfe23[_0x917d('0x27')]();};}function saveUpdates(_0xe578dd,_0xbd81e3){return function(_0x4c2bc9){if(_0x4c2bc9){return _0x4c2bc9[_0x917d('0x28')](_0xe578dd)[_0x917d('0x29')](function(_0x23a1a9){return _0x23a1a9;});}return null;};}function removeEntity(_0x118169,_0x48f7e8){return function(_0x438c33){if(_0x438c33){return _0x438c33[_0x917d('0x2a')]()[_0x917d('0x29')](function(){_0x118169[_0x917d('0x1d')](0xcc)[_0x917d('0x2b')]();});}};}function handleEntityNotFound(_0x173559,_0x37fc69){return function(_0x32ed2b){if(!_0x32ed2b){_0x173559[_0x917d('0x1c')](0x194);}return _0x32ed2b;};}function handleError(_0x56faf3,_0x4d9424){_0x4d9424=_0x4d9424||0x1f4;return function(_0x153a88){logger[_0x917d('0x2c')](_0x153a88['stack']);if(_0x153a88['name']){delete _0x153a88[_0x917d('0x2d')];}_0x56faf3[_0x917d('0x1d')](_0x4d9424)[_0x917d('0x2e')](_0x153a88);};}exports[_0x917d('0x2f')]=function(_0x179d46,_0x57994f){var _0x56835c={},_0x6372f9={},_0x2a3602={'count':0x0,'rows':[]};var _0x4108a5=_[_0x917d('0x30')](db['DeskConfiguration'][_0x917d('0x31')],function(_0x2275d1){return{'name':_0x2275d1[_0x917d('0x32')],'type':_0x2275d1[_0x917d('0x33')][_0x917d('0x34')]};});_0x6372f9['model']=_[_0x917d('0x30')](_0x4108a5,_0x917d('0x2d'));_0x6372f9[_0x917d('0x35')]=_[_0x917d('0x36')](_0x179d46[_0x917d('0x35')]);_0x6372f9['filters']=_[_0x917d('0x37')](_0x6372f9['model'],_0x6372f9['query']);_0x56835c['attributes']=_[_0x917d('0x37')](_0x6372f9['model'],qs['fields'](_0x179d46[_0x917d('0x35')][_0x917d('0x38')]));_0x56835c[_0x917d('0x39')]=_0x56835c['attributes'][_0x917d('0x3a')]?_0x56835c[_0x917d('0x39')]:_0x6372f9['model'];if(!_0x179d46[_0x917d('0x35')][_0x917d('0x3b')]('nolimit')){_0x56835c[_0x917d('0x20')]=qs[_0x917d('0x20')](_0x179d46[_0x917d('0x35')]['limit']);_0x56835c['offset']=qs[_0x917d('0x22')](_0x179d46['query'][_0x917d('0x22')]);}_0x56835c[_0x917d('0x3c')]=qs[_0x917d('0x3d')](_0x179d46[_0x917d('0x35')][_0x917d('0x3d')]);_0x56835c[_0x917d('0x3e')]=qs['filters'](_[_0x917d('0x3f')](_0x179d46[_0x917d('0x35')],_0x6372f9[_0x917d('0x40')]),_0x4108a5);if(_0x179d46[_0x917d('0x35')][_0x917d('0x41')]){_0x56835c[_0x917d('0x3e')]=_[_0x917d('0x42')](_0x56835c[_0x917d('0x3e')],{'$or':_[_0x917d('0x30')](_0x4108a5,function(_0x2d3b92){if(_0x2d3b92[_0x917d('0x33')]!==_0x917d('0x43')){var _0x15b3fe={};_0x15b3fe[_0x2d3b92[_0x917d('0x2d')]]={'$like':'%'+_0x179d46[_0x917d('0x35')][_0x917d('0x41')]+'%'};return _0x15b3fe;}})});}_0x56835c=_[_0x917d('0x42')]({},_0x56835c,_0x179d46[_0x917d('0x44')]);var _0x1e0736={'where':_0x56835c[_0x917d('0x3e')]};return db[_0x917d('0x45')]['count'](_0x1e0736)[_0x917d('0x29')](function(_0x1bcf4){_0x2a3602['count']=_0x1bcf4;if(_0x179d46[_0x917d('0x35')]['includeAll']){_0x56835c[_0x917d('0x46')]=[{'all':!![]}];}return db['DeskConfiguration'][_0x917d('0x47')](_0x56835c);})[_0x917d('0x29')](function(_0x332bac){_0x2a3602[_0x917d('0x48')]=_0x332bac;return _0x2a3602;})[_0x917d('0x29')](respondWithFilteredResult(_0x57994f,_0x56835c))[_0x917d('0x49')](handleError(_0x57994f,null));};exports['show']=function(_0x2ca77b,_0x210123){var _0x193528={'raw':![],'where':{'id':_0x2ca77b[_0x917d('0x4a')]['id']}},_0x16b5bc={};_0x16b5bc['model']=_[_0x917d('0x36')](db[_0x917d('0x45')]['rawAttributes']);_0x16b5bc[_0x917d('0x35')]=_[_0x917d('0x36')](_0x2ca77b[_0x917d('0x35')]);_0x16b5bc[_0x917d('0x40')]=_[_0x917d('0x37')](_0x16b5bc['model'],_0x16b5bc[_0x917d('0x35')]);_0x193528[_0x917d('0x39')]=_[_0x917d('0x37')](_0x16b5bc[_0x917d('0x4b')],qs[_0x917d('0x38')](_0x2ca77b[_0x917d('0x35')]['fields']));_0x193528[_0x917d('0x39')]=_0x193528[_0x917d('0x39')][_0x917d('0x3a')]?_0x193528[_0x917d('0x39')]:_0x16b5bc[_0x917d('0x4b')];if(_0x2ca77b[_0x917d('0x35')][_0x917d('0x4c')]){_0x193528['include']=[{'all':!![]}];}_0x193528=_[_0x917d('0x42')]({},_0x193528,_0x2ca77b['options']);return db[_0x917d('0x45')][_0x917d('0x4d')](_0x193528)[_0x917d('0x29')](handleEntityNotFound(_0x210123,null))[_0x917d('0x29')](respondWithResult(_0x210123,null))[_0x917d('0x49')](handleError(_0x210123,null));};exports[_0x917d('0x4e')]=function(_0x102965,_0x3502a6){return db[_0x917d('0x45')]['create'](_0x102965[_0x917d('0x4f')],{})[_0x917d('0x29')](respondWithResult(_0x3502a6,0xc9))[_0x917d('0x49')](handleError(_0x3502a6,null));};exports[_0x917d('0x28')]=function(_0x553de7,_0x54523a){if(_0x553de7[_0x917d('0x4f')]['id']){delete _0x553de7[_0x917d('0x4f')]['id'];}return db[_0x917d('0x45')][_0x917d('0x4d')]({'where':{'id':_0x553de7[_0x917d('0x4a')]['id']}})[_0x917d('0x29')](handleEntityNotFound(_0x54523a,null))['then'](saveUpdates(_0x553de7[_0x917d('0x4f')],null))[_0x917d('0x29')](respondWithResult(_0x54523a,null))[_0x917d('0x49')](handleError(_0x54523a,null));};exports[_0x917d('0x2a')]=function(_0x40c0bf,_0xd113d){return db[_0x917d('0x45')]['find']({'where':{'id':_0x40c0bf[_0x917d('0x4a')]['id']}})[_0x917d('0x29')](handleEntityNotFound(_0xd113d,null))['then'](removeEntity(_0xd113d,null))[_0x917d('0x49')](handleError(_0xd113d,null));};exports[_0x917d('0x50')]=function(_0x44cc27,_0x43662,_0x37bcc4){var _0x2b0c82={};var _0x4f519a={};var _0x3196fa;var _0x2d89b;return db[_0x917d('0x45')][_0x917d('0x51')]({'where':{'id':_0x44cc27[_0x917d('0x4a')]['id']}})[_0x917d('0x29')](handleEntityNotFound(_0x43662,null))['then'](function(_0x1a06dd){if(_0x1a06dd){_0x3196fa=_0x1a06dd;_0x4f519a['model']=_[_0x917d('0x36')](db[_0x917d('0x52')][_0x917d('0x31')]);_0x4f519a[_0x917d('0x35')]=_[_0x917d('0x36')](_0x44cc27[_0x917d('0x35')]);_0x4f519a['filters']=_[_0x917d('0x37')](_0x4f519a['model'],_0x4f519a[_0x917d('0x35')]);_0x2b0c82[_0x917d('0x39')]=_[_0x917d('0x37')](_0x4f519a[_0x917d('0x4b')],qs[_0x917d('0x38')](_0x44cc27[_0x917d('0x35')][_0x917d('0x38')]));_0x2b0c82[_0x917d('0x39')]=_0x2b0c82[_0x917d('0x39')][_0x917d('0x3a')]?_0x2b0c82[_0x917d('0x39')]:_0x4f519a[_0x917d('0x4b')];_0x2b0c82[_0x917d('0x3c')]=qs['sort'](_0x44cc27[_0x917d('0x35')][_0x917d('0x3d')]);_0x2b0c82[_0x917d('0x3e')]=qs[_0x917d('0x40')](_[_0x917d('0x3f')](_0x44cc27[_0x917d('0x35')],_0x4f519a['filters']));if(_0x44cc27[_0x917d('0x35')][_0x917d('0x41')]){_0x2b0c82[_0x917d('0x3e')]=_[_0x917d('0x42')](_0x2b0c82[_0x917d('0x3e')],{'$or':_[_0x917d('0x30')](_0x2b0c82['attributes'],function(_0x23c381){var _0x308217={};_0x308217[_0x23c381]={'$like':'%'+_0x44cc27[_0x917d('0x35')][_0x917d('0x41')]+'%'};return _0x308217;})});}_0x2b0c82=_['merge']({},_0x2b0c82,_0x44cc27[_0x917d('0x44')]);return _0x3196fa[_0x917d('0x50')](_0x2b0c82);}})['then'](function(_0x1368ba){if(_0x1368ba){_0x2d89b=_0x1368ba['length'];if(!_0x44cc27[_0x917d('0x35')][_0x917d('0x3b')](_0x917d('0x53'))){_0x2b0c82[_0x917d('0x20')]=qs['limit'](_0x44cc27[_0x917d('0x35')][_0x917d('0x20')]);_0x2b0c82[_0x917d('0x22')]=qs[_0x917d('0x22')](_0x44cc27['query']['offset']);}return _0x3196fa[_0x917d('0x50')](_0x2b0c82);}})[_0x917d('0x29')](function(_0x5eac48){if(_0x5eac48){return _0x5eac48?{'count':_0x2d89b,'rows':_0x5eac48}:null;}})['then'](respondWithResult(_0x43662,null))[_0x917d('0x49')](handleError(_0x43662,null));};exports[_0x917d('0x54')]=function(_0x55a166,_0x2a5a74,_0xbba56e){var _0x59bfa9={};var _0x40460e={};var _0x5e3266;var _0x154de4;return db[_0x917d('0x45')][_0x917d('0x51')]({'where':{'id':_0x55a166[_0x917d('0x4a')]['id']}})[_0x917d('0x29')](handleEntityNotFound(_0x2a5a74,null))[_0x917d('0x29')](function(_0x1fa6d4){if(_0x1fa6d4){_0x5e3266=_0x1fa6d4;_0x40460e[_0x917d('0x4b')]=_['keys'](db[_0x917d('0x52')][_0x917d('0x31')]);_0x40460e['query']=_['keys'](_0x55a166[_0x917d('0x35')]);_0x40460e[_0x917d('0x40')]=_[_0x917d('0x37')](_0x40460e[_0x917d('0x4b')],_0x40460e[_0x917d('0x35')]);_0x59bfa9[_0x917d('0x39')]=_[_0x917d('0x37')](_0x40460e['model'],qs[_0x917d('0x38')](_0x55a166['query']['fields']));_0x59bfa9[_0x917d('0x39')]=_0x59bfa9['attributes'][_0x917d('0x3a')]?_0x59bfa9['attributes']:_0x40460e[_0x917d('0x4b')];_0x59bfa9['order']=qs[_0x917d('0x3d')](_0x55a166[_0x917d('0x35')][_0x917d('0x3d')]);_0x59bfa9['where']=qs['filters'](_[_0x917d('0x3f')](_0x55a166[_0x917d('0x35')],_0x40460e['filters']));if(_0x55a166[_0x917d('0x35')][_0x917d('0x41')]){_0x59bfa9[_0x917d('0x3e')]=_[_0x917d('0x42')](_0x59bfa9['where'],{'$or':_[_0x917d('0x30')](_0x59bfa9[_0x917d('0x39')],function(_0xd0a7b3){var _0x14c929={};_0x14c929[_0xd0a7b3]={'$like':'%'+_0x55a166[_0x917d('0x35')][_0x917d('0x41')]+'%'};return _0x14c929;})});}_0x59bfa9=_['merge']({},_0x59bfa9,_0x55a166[_0x917d('0x44')]);return _0x5e3266['getSubjects'](_0x59bfa9);}})[_0x917d('0x29')](function(_0x52ea0b){if(_0x52ea0b){_0x154de4=_0x52ea0b[_0x917d('0x3a')];if(!_0x55a166[_0x917d('0x35')][_0x917d('0x3b')](_0x917d('0x53'))){_0x59bfa9['limit']=qs[_0x917d('0x20')](_0x55a166[_0x917d('0x35')][_0x917d('0x20')]);_0x59bfa9[_0x917d('0x22')]=qs[_0x917d('0x22')](_0x55a166[_0x917d('0x35')]['offset']);}return _0x5e3266[_0x917d('0x54')](_0x59bfa9);}})[_0x917d('0x29')](function(_0x2c4637){if(_0x2c4637){return _0x2c4637?{'count':_0x154de4,'rows':_0x2c4637}:null;}})[_0x917d('0x29')](respondWithResult(_0x2a5a74,null))[_0x917d('0x49')](handleError(_0x2a5a74,null));};exports[_0x917d('0x55')]=function(_0xce1e12,_0x46b29c,_0x2176f2){var _0x3fdcb5={};var _0x453a7f={};var _0x85a1f;var _0x14aa32;return db[_0x917d('0x45')][_0x917d('0x51')]({'where':{'id':_0xce1e12['params']['id']}})[_0x917d('0x29')](handleEntityNotFound(_0x46b29c,null))[_0x917d('0x29')](function(_0x347d16){if(_0x347d16){_0x85a1f=_0x347d16;_0x453a7f['model']=_[_0x917d('0x36')](db[_0x917d('0x52')][_0x917d('0x31')]);_0x453a7f[_0x917d('0x35')]=_[_0x917d('0x36')](_0xce1e12[_0x917d('0x35')]);_0x453a7f[_0x917d('0x40')]=_[_0x917d('0x37')](_0x453a7f['model'],_0x453a7f[_0x917d('0x35')]);_0x3fdcb5[_0x917d('0x39')]=_[_0x917d('0x37')](_0x453a7f[_0x917d('0x4b')],qs[_0x917d('0x38')](_0xce1e12[_0x917d('0x35')][_0x917d('0x38')]));_0x3fdcb5[_0x917d('0x39')]=_0x3fdcb5[_0x917d('0x39')][_0x917d('0x3a')]?_0x3fdcb5['attributes']:_0x453a7f[_0x917d('0x4b')];_0x3fdcb5['order']=qs[_0x917d('0x3d')](_0xce1e12['query'][_0x917d('0x3d')]);_0x3fdcb5[_0x917d('0x3e')]=qs[_0x917d('0x40')](_[_0x917d('0x3f')](_0xce1e12[_0x917d('0x35')],_0x453a7f[_0x917d('0x40')]));if(_0xce1e12[_0x917d('0x35')][_0x917d('0x41')]){_0x3fdcb5[_0x917d('0x3e')]=_[_0x917d('0x42')](_0x3fdcb5[_0x917d('0x3e')],{'$or':_[_0x917d('0x30')](_0x3fdcb5['attributes'],function(_0x4bbc7c){var _0xd44c1b={};_0xd44c1b[_0x4bbc7c]={'$like':'%'+_0xce1e12[_0x917d('0x35')][_0x917d('0x41')]+'%'};return _0xd44c1b;})});}_0x3fdcb5=_[_0x917d('0x42')]({},_0x3fdcb5,_0xce1e12['options']);return _0x85a1f[_0x917d('0x55')](_0x3fdcb5);}})[_0x917d('0x29')](function(_0x3ca0a5){if(_0x3ca0a5){_0x14aa32=_0x3ca0a5[_0x917d('0x3a')];if(!_0xce1e12[_0x917d('0x35')]['hasOwnProperty'](_0x917d('0x53'))){_0x3fdcb5['limit']=qs[_0x917d('0x20')](_0xce1e12['query'][_0x917d('0x20')]);_0x3fdcb5[_0x917d('0x22')]=qs[_0x917d('0x22')](_0xce1e12['query']['offset']);}return _0x85a1f[_0x917d('0x55')](_0x3fdcb5);}})[_0x917d('0x29')](function(_0x2c7ada){if(_0x2c7ada){return _0x2c7ada?{'count':_0x14aa32,'rows':_0x2c7ada}:null;}})['then'](respondWithResult(_0x46b29c,null))[_0x917d('0x49')](handleError(_0x46b29c,null));};exports['getTags']=function(_0x3e3019,_0x12153a,_0x1b7555){var _0x59847b={};var _0x384af0={};var _0x1f3f1a;var _0x5c6060;return db[_0x917d('0x45')][_0x917d('0x51')]({'where':{'id':_0x3e3019[_0x917d('0x4a')]['id']}})[_0x917d('0x29')](handleEntityNotFound(_0x12153a,null))['then'](function(_0x3ab155){if(_0x3ab155){_0x1f3f1a=_0x3ab155;_0x384af0[_0x917d('0x4b')]=_[_0x917d('0x36')](db[_0x917d('0x56')][_0x917d('0x31')]);_0x384af0[_0x917d('0x35')]=_[_0x917d('0x36')](_0x3e3019[_0x917d('0x35')]);_0x384af0['filters']=_[_0x917d('0x37')](_0x384af0[_0x917d('0x4b')],_0x384af0['query']);_0x59847b[_0x917d('0x39')]=_[_0x917d('0x37')](_0x384af0[_0x917d('0x4b')],qs[_0x917d('0x38')](_0x3e3019[_0x917d('0x35')][_0x917d('0x38')]));_0x59847b[_0x917d('0x39')]=_0x59847b[_0x917d('0x39')][_0x917d('0x3a')]?_0x59847b[_0x917d('0x39')]:_0x384af0[_0x917d('0x4b')];_0x59847b[_0x917d('0x3c')]=qs[_0x917d('0x3d')](_0x3e3019[_0x917d('0x35')][_0x917d('0x3d')]);_0x59847b[_0x917d('0x3e')]=qs[_0x917d('0x40')](_[_0x917d('0x3f')](_0x3e3019[_0x917d('0x35')],_0x384af0['filters']));if(_0x3e3019[_0x917d('0x35')][_0x917d('0x41')]){_0x59847b[_0x917d('0x3e')]=_[_0x917d('0x42')](_0x59847b[_0x917d('0x3e')],{'$or':_['map'](_0x59847b[_0x917d('0x39')],function(_0x583ccd){var _0x7df31={};_0x7df31[_0x583ccd]={'$like':'%'+_0x3e3019[_0x917d('0x35')]['filter']+'%'};return _0x7df31;})});}_0x59847b=_['merge']({},_0x59847b,_0x3e3019['options']);return _0x1f3f1a[_0x917d('0x57')](_0x59847b);}})[_0x917d('0x29')](function(_0x3ff69f){if(_0x3ff69f){_0x5c6060=_0x3ff69f[_0x917d('0x3a')];if(!_0x3e3019[_0x917d('0x35')][_0x917d('0x3b')](_0x917d('0x53'))){_0x59847b[_0x917d('0x20')]=qs[_0x917d('0x20')](_0x3e3019[_0x917d('0x35')][_0x917d('0x20')]);_0x59847b['offset']=qs[_0x917d('0x22')](_0x3e3019[_0x917d('0x35')]['offset']);}return _0x1f3f1a[_0x917d('0x57')](_0x59847b);}})[_0x917d('0x29')](function(_0x431bea){if(_0x431bea){return _0x431bea?{'count':_0x5c6060,'rows':_0x431bea}:null;}})['then'](respondWithResult(_0x12153a,null))[_0x917d('0x49')](handleError(_0x12153a,null));};exports[_0x917d('0x58')]=function(_0x281d68,_0x478e92,_0xd7c8a3){if(_0x281d68[_0x917d('0x4f')]['id']){delete _0x281d68[_0x917d('0x4f')]['id'];}return db[_0x917d('0x45')][_0x917d('0x51')]({'where':{'id':_0x281d68['params']['id']}})[_0x917d('0x29')](handleEntityNotFound(_0x478e92,null))[_0x917d('0x29')](function(_0xa18e5c){if(_0xa18e5c){return _0xa18e5c[_0x917d('0x58')](_0x281d68['body'][_0x917d('0x59')]||[]);}return null;})[_0x917d('0x29')](respondWithResult(_0x478e92,null))[_0x917d('0x49')](handleError(_0x478e92,null));}; \ No newline at end of file +var _0xc2d2=['pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','params','keys','length','find','catch','create','body','findOne','DeskField','order','options','getSubjects','getDescriptions','getTags','Tag','setTags','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','save','update','then','destroy','error','stack','name','index','map','DeskConfiguration','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','where'];(function(_0x160425,_0x2983aa){var _0x455b67=function(_0x1e964a){while(--_0x1e964a){_0x160425['push'](_0x160425['shift']());}};_0x455b67(++_0x2983aa);}(_0xc2d2,0x160));var _0x2c2d=function(_0x22bdd3,_0x552e50){_0x22bdd3=_0x22bdd3-0x0;var _0x44d9d9=_0xc2d2[_0x22bdd3];return _0x44d9d9;};'use strict';var emlformat=require(_0x2c2d('0x0'));var rimraf=require(_0x2c2d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2c2d('0x2'));var rp=require(_0x2c2d('0x3'));var moment=require('moment');var BPromise=require(_0x2c2d('0x4'));var Mustache=require('mustache');var util=require(_0x2c2d('0x5'));var path=require(_0x2c2d('0x6'));var sox=require(_0x2c2d('0x7'));var csv=require('to-csv');var ejs=require(_0x2c2d('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2c2d('0x9'));var squel=require('squel');var crypto=require(_0x2c2d('0xa'));var jsforce=require(_0x2c2d('0xb'));var deskjs=require(_0x2c2d('0xc'));var toCsv=require(_0x2c2d('0xd'));var querystring=require(_0x2c2d('0xe'));var Papa=require(_0x2c2d('0xf'));var Redis=require(_0x2c2d('0x10'));var authService=require(_0x2c2d('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x2c2d('0x12'));var hardwareService=require(_0x2c2d('0x13'));var logger=require(_0x2c2d('0x14'))(_0x2c2d('0x15'));var utils=require(_0x2c2d('0x16'));var config=require(_0x2c2d('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3aa8ec,_0x1ff473){_0x1ff473=_0x1ff473||0xcc;return function(_0x3dff7a){if(_0x3dff7a){return _0x3aa8ec[_0x2c2d('0x18')](_0x1ff473);}return _0x3aa8ec[_0x2c2d('0x19')](_0x1ff473)[_0x2c2d('0x1a')]();};}function respondWithResult(_0x273bda,_0x70baa4){_0x70baa4=_0x70baa4||0xc8;return function(_0xf772a4){if(_0xf772a4){return _0x273bda[_0x2c2d('0x19')](_0x70baa4)[_0x2c2d('0x1b')](_0xf772a4);}};}function respondWithFilteredResult(_0x105d92,_0x5d5a7f){return function(_0x281993){if(_0x281993){var _0x9526e5=typeof _0x5d5a7f[_0x2c2d('0x1c')]==='undefined'&&typeof _0x5d5a7f[_0x2c2d('0x1d')]===_0x2c2d('0x1e');var _0x149825=_0x281993['count'];var _0xb27959=_0x9526e5?0x0:_0x5d5a7f[_0x2c2d('0x1c')];var _0x275676=_0x9526e5?_0x281993[_0x2c2d('0x1f')]:_0x5d5a7f[_0x2c2d('0x1c')]+_0x5d5a7f[_0x2c2d('0x1d')];var _0x55d622;if(_0x275676>=_0x149825){_0x275676=_0x149825;_0x55d622=0xc8;}else{_0x55d622=0xce;}_0x105d92[_0x2c2d('0x19')](_0x55d622);return _0x105d92[_0x2c2d('0x20')](_0x2c2d('0x21'),_0xb27959+'-'+_0x275676+'/'+_0x149825)[_0x2c2d('0x1b')](_0x281993);}return null;};}function patchUpdates(_0x2a41eb){return function(_0x15a3c1){try{jsonpatch['apply'](_0x15a3c1,_0x2a41eb,!![]);}catch(_0x605643){return BPromise['reject'](_0x605643);}return _0x15a3c1[_0x2c2d('0x22')]();};}function saveUpdates(_0x17f652,_0x201a7b){return function(_0x3b49b6){if(_0x3b49b6){return _0x3b49b6[_0x2c2d('0x23')](_0x17f652)[_0x2c2d('0x24')](function(_0x18b9fb){return _0x18b9fb;});}return null;};}function removeEntity(_0x35b4ae,_0x231699){return function(_0x41f0ca){if(_0x41f0ca){return _0x41f0ca[_0x2c2d('0x25')]()[_0x2c2d('0x24')](function(){_0x35b4ae[_0x2c2d('0x19')](0xcc)[_0x2c2d('0x1a')]();});}};}function handleEntityNotFound(_0x56c537,_0x26af8d){return function(_0x52a028){if(!_0x52a028){_0x56c537[_0x2c2d('0x18')](0x194);}return _0x52a028;};}function handleError(_0x349b3a,_0x400b53){_0x400b53=_0x400b53||0x1f4;return function(_0x270be7){logger[_0x2c2d('0x26')](_0x270be7[_0x2c2d('0x27')]);if(_0x270be7['name']){delete _0x270be7[_0x2c2d('0x28')];}_0x349b3a[_0x2c2d('0x19')](_0x400b53)['send'](_0x270be7);};}exports[_0x2c2d('0x29')]=function(_0x5f416a,_0x39543c){var _0x488599={},_0x139853={},_0x44f5ab={'count':0x0,'rows':[]};var _0x265f1e=_[_0x2c2d('0x2a')](db[_0x2c2d('0x2b')][_0x2c2d('0x2c')],function(_0x51ba84){return{'name':_0x51ba84[_0x2c2d('0x2d')],'type':_0x51ba84[_0x2c2d('0x2e')][_0x2c2d('0x2f')]};});_0x139853['model']=_[_0x2c2d('0x2a')](_0x265f1e,_0x2c2d('0x28'));_0x139853[_0x2c2d('0x30')]=_['keys'](_0x5f416a['query']);_0x139853[_0x2c2d('0x31')]=_[_0x2c2d('0x32')](_0x139853[_0x2c2d('0x33')],_0x139853[_0x2c2d('0x30')]);_0x488599[_0x2c2d('0x34')]=_[_0x2c2d('0x32')](_0x139853['model'],qs[_0x2c2d('0x35')](_0x5f416a[_0x2c2d('0x30')]['fields']));_0x488599[_0x2c2d('0x34')]=_0x488599[_0x2c2d('0x34')]['length']?_0x488599['attributes']:_0x139853[_0x2c2d('0x33')];if(!_0x5f416a[_0x2c2d('0x30')][_0x2c2d('0x36')](_0x2c2d('0x37'))){_0x488599[_0x2c2d('0x1d')]=qs[_0x2c2d('0x1d')](_0x5f416a[_0x2c2d('0x30')][_0x2c2d('0x1d')]);_0x488599['offset']=qs[_0x2c2d('0x1c')](_0x5f416a['query'][_0x2c2d('0x1c')]);}_0x488599['order']=qs[_0x2c2d('0x38')](_0x5f416a[_0x2c2d('0x30')][_0x2c2d('0x38')]);_0x488599[_0x2c2d('0x39')]=qs[_0x2c2d('0x31')](_[_0x2c2d('0x3a')](_0x5f416a[_0x2c2d('0x30')],_0x139853[_0x2c2d('0x31')]),_0x265f1e);if(_0x5f416a['query'][_0x2c2d('0x3b')]){_0x488599[_0x2c2d('0x39')]=_[_0x2c2d('0x3c')](_0x488599[_0x2c2d('0x39')],{'$or':_['map'](_0x265f1e,function(_0x269bf6){if(_0x269bf6['type']!==_0x2c2d('0x3d')){var _0x1d954d={};_0x1d954d[_0x269bf6[_0x2c2d('0x28')]]={'$like':'%'+_0x5f416a['query'][_0x2c2d('0x3b')]+'%'};return _0x1d954d;}})});}_0x488599=_[_0x2c2d('0x3c')]({},_0x488599,_0x5f416a['options']);var _0x12cd19={'where':_0x488599[_0x2c2d('0x39')]};return db[_0x2c2d('0x2b')][_0x2c2d('0x1f')](_0x12cd19)[_0x2c2d('0x24')](function(_0x148390){_0x44f5ab['count']=_0x148390;if(_0x5f416a[_0x2c2d('0x30')][_0x2c2d('0x3e')]){_0x488599[_0x2c2d('0x3f')]=[{'all':!![]}];}return db[_0x2c2d('0x2b')][_0x2c2d('0x40')](_0x488599);})[_0x2c2d('0x24')](function(_0x136e80){_0x44f5ab[_0x2c2d('0x41')]=_0x136e80;return _0x44f5ab;})[_0x2c2d('0x24')](respondWithFilteredResult(_0x39543c,_0x488599))['catch'](handleError(_0x39543c,null));};exports['show']=function(_0x58e069,_0x36efd3){var _0x4d795d={'raw':![],'where':{'id':_0x58e069[_0x2c2d('0x42')]['id']}},_0x4249ca={};_0x4249ca['model']=_['keys'](db['DeskConfiguration'][_0x2c2d('0x2c')]);_0x4249ca[_0x2c2d('0x30')]=_[_0x2c2d('0x43')](_0x58e069[_0x2c2d('0x30')]);_0x4249ca[_0x2c2d('0x31')]=_[_0x2c2d('0x32')](_0x4249ca[_0x2c2d('0x33')],_0x4249ca[_0x2c2d('0x30')]);_0x4d795d['attributes']=_[_0x2c2d('0x32')](_0x4249ca[_0x2c2d('0x33')],qs[_0x2c2d('0x35')](_0x58e069['query'][_0x2c2d('0x35')]));_0x4d795d['attributes']=_0x4d795d[_0x2c2d('0x34')][_0x2c2d('0x44')]?_0x4d795d[_0x2c2d('0x34')]:_0x4249ca[_0x2c2d('0x33')];if(_0x58e069['query']['includeAll']){_0x4d795d[_0x2c2d('0x3f')]=[{'all':!![]}];}_0x4d795d=_[_0x2c2d('0x3c')]({},_0x4d795d,_0x58e069['options']);return db[_0x2c2d('0x2b')][_0x2c2d('0x45')](_0x4d795d)[_0x2c2d('0x24')](handleEntityNotFound(_0x36efd3,null))[_0x2c2d('0x24')](respondWithResult(_0x36efd3,null))[_0x2c2d('0x46')](handleError(_0x36efd3,null));};exports[_0x2c2d('0x47')]=function(_0x44277d,_0x3dee97){return db[_0x2c2d('0x2b')][_0x2c2d('0x47')](_0x44277d[_0x2c2d('0x48')],{})[_0x2c2d('0x24')](respondWithResult(_0x3dee97,0xc9))['catch'](handleError(_0x3dee97,null));};exports[_0x2c2d('0x23')]=function(_0x444697,_0x232ef7){if(_0x444697[_0x2c2d('0x48')]['id']){delete _0x444697[_0x2c2d('0x48')]['id'];}return db['DeskConfiguration']['find']({'where':{'id':_0x444697[_0x2c2d('0x42')]['id']}})[_0x2c2d('0x24')](handleEntityNotFound(_0x232ef7,null))[_0x2c2d('0x24')](saveUpdates(_0x444697[_0x2c2d('0x48')],null))[_0x2c2d('0x24')](respondWithResult(_0x232ef7,null))[_0x2c2d('0x46')](handleError(_0x232ef7,null));};exports[_0x2c2d('0x25')]=function(_0x181b3a,_0x4ef621){return db[_0x2c2d('0x2b')]['find']({'where':{'id':_0x181b3a['params']['id']}})[_0x2c2d('0x24')](handleEntityNotFound(_0x4ef621,null))['then'](removeEntity(_0x4ef621,null))[_0x2c2d('0x46')](handleError(_0x4ef621,null));};exports['getFields']=function(_0x492d09,_0x90700c,_0x5884d2){var _0x2b52a5={};var _0x329505={};var _0x39555d;var _0x55f35d;return db[_0x2c2d('0x2b')][_0x2c2d('0x49')]({'where':{'id':_0x492d09[_0x2c2d('0x42')]['id']}})[_0x2c2d('0x24')](handleEntityNotFound(_0x90700c,null))[_0x2c2d('0x24')](function(_0x4066db){if(_0x4066db){_0x39555d=_0x4066db;_0x329505[_0x2c2d('0x33')]=_[_0x2c2d('0x43')](db[_0x2c2d('0x4a')][_0x2c2d('0x2c')]);_0x329505[_0x2c2d('0x30')]=_[_0x2c2d('0x43')](_0x492d09[_0x2c2d('0x30')]);_0x329505[_0x2c2d('0x31')]=_['intersection'](_0x329505[_0x2c2d('0x33')],_0x329505[_0x2c2d('0x30')]);_0x2b52a5[_0x2c2d('0x34')]=_['intersection'](_0x329505['model'],qs[_0x2c2d('0x35')](_0x492d09[_0x2c2d('0x30')][_0x2c2d('0x35')]));_0x2b52a5[_0x2c2d('0x34')]=_0x2b52a5['attributes'][_0x2c2d('0x44')]?_0x2b52a5['attributes']:_0x329505['model'];_0x2b52a5[_0x2c2d('0x4b')]=qs['sort'](_0x492d09[_0x2c2d('0x30')][_0x2c2d('0x38')]);_0x2b52a5[_0x2c2d('0x39')]=qs['filters'](_[_0x2c2d('0x3a')](_0x492d09[_0x2c2d('0x30')],_0x329505[_0x2c2d('0x31')]));if(_0x492d09[_0x2c2d('0x30')][_0x2c2d('0x3b')]){_0x2b52a5[_0x2c2d('0x39')]=_[_0x2c2d('0x3c')](_0x2b52a5[_0x2c2d('0x39')],{'$or':_[_0x2c2d('0x2a')](_0x2b52a5[_0x2c2d('0x34')],function(_0x17a10f){var _0x43d1a5={};_0x43d1a5[_0x17a10f]={'$like':'%'+_0x492d09['query'][_0x2c2d('0x3b')]+'%'};return _0x43d1a5;})});}_0x2b52a5=_[_0x2c2d('0x3c')]({},_0x2b52a5,_0x492d09[_0x2c2d('0x4c')]);return _0x39555d['getFields'](_0x2b52a5);}})[_0x2c2d('0x24')](function(_0x511caf){if(_0x511caf){_0x55f35d=_0x511caf[_0x2c2d('0x44')];if(!_0x492d09[_0x2c2d('0x30')][_0x2c2d('0x36')](_0x2c2d('0x37'))){_0x2b52a5[_0x2c2d('0x1d')]=qs[_0x2c2d('0x1d')](_0x492d09[_0x2c2d('0x30')]['limit']);_0x2b52a5['offset']=qs[_0x2c2d('0x1c')](_0x492d09[_0x2c2d('0x30')]['offset']);}return _0x39555d['getFields'](_0x2b52a5);}})[_0x2c2d('0x24')](function(_0x4e6fad){if(_0x4e6fad){return _0x4e6fad?{'count':_0x55f35d,'rows':_0x4e6fad}:null;}})[_0x2c2d('0x24')](respondWithResult(_0x90700c,null))[_0x2c2d('0x46')](handleError(_0x90700c,null));};exports[_0x2c2d('0x4d')]=function(_0x5bfe30,_0x54e13c,_0x2c4224){var _0x32a14b={};var _0x55f797={};var _0x377307;var _0x2afa95;return db[_0x2c2d('0x2b')][_0x2c2d('0x49')]({'where':{'id':_0x5bfe30[_0x2c2d('0x42')]['id']}})[_0x2c2d('0x24')](handleEntityNotFound(_0x54e13c,null))[_0x2c2d('0x24')](function(_0x5e6da1){if(_0x5e6da1){_0x377307=_0x5e6da1;_0x55f797[_0x2c2d('0x33')]=_[_0x2c2d('0x43')](db['DeskField'][_0x2c2d('0x2c')]);_0x55f797['query']=_[_0x2c2d('0x43')](_0x5bfe30[_0x2c2d('0x30')]);_0x55f797['filters']=_[_0x2c2d('0x32')](_0x55f797['model'],_0x55f797[_0x2c2d('0x30')]);_0x32a14b[_0x2c2d('0x34')]=_[_0x2c2d('0x32')](_0x55f797[_0x2c2d('0x33')],qs['fields'](_0x5bfe30[_0x2c2d('0x30')][_0x2c2d('0x35')]));_0x32a14b[_0x2c2d('0x34')]=_0x32a14b[_0x2c2d('0x34')][_0x2c2d('0x44')]?_0x32a14b['attributes']:_0x55f797[_0x2c2d('0x33')];_0x32a14b['order']=qs[_0x2c2d('0x38')](_0x5bfe30['query']['sort']);_0x32a14b[_0x2c2d('0x39')]=qs[_0x2c2d('0x31')](_['pick'](_0x5bfe30['query'],_0x55f797[_0x2c2d('0x31')]));if(_0x5bfe30[_0x2c2d('0x30')][_0x2c2d('0x3b')]){_0x32a14b[_0x2c2d('0x39')]=_[_0x2c2d('0x3c')](_0x32a14b['where'],{'$or':_[_0x2c2d('0x2a')](_0x32a14b[_0x2c2d('0x34')],function(_0xc21e52){var _0x48b093={};_0x48b093[_0xc21e52]={'$like':'%'+_0x5bfe30[_0x2c2d('0x30')][_0x2c2d('0x3b')]+'%'};return _0x48b093;})});}_0x32a14b=_[_0x2c2d('0x3c')]({},_0x32a14b,_0x5bfe30[_0x2c2d('0x4c')]);return _0x377307[_0x2c2d('0x4d')](_0x32a14b);}})[_0x2c2d('0x24')](function(_0x55115d){if(_0x55115d){_0x2afa95=_0x55115d['length'];if(!_0x5bfe30[_0x2c2d('0x30')][_0x2c2d('0x36')](_0x2c2d('0x37'))){_0x32a14b[_0x2c2d('0x1d')]=qs[_0x2c2d('0x1d')](_0x5bfe30[_0x2c2d('0x30')]['limit']);_0x32a14b['offset']=qs[_0x2c2d('0x1c')](_0x5bfe30[_0x2c2d('0x30')][_0x2c2d('0x1c')]);}return _0x377307['getSubjects'](_0x32a14b);}})['then'](function(_0x3210ed){if(_0x3210ed){return _0x3210ed?{'count':_0x2afa95,'rows':_0x3210ed}:null;}})[_0x2c2d('0x24')](respondWithResult(_0x54e13c,null))[_0x2c2d('0x46')](handleError(_0x54e13c,null));};exports[_0x2c2d('0x4e')]=function(_0x117759,_0x5a42a1,_0x4025e9){var _0x3f8f35={};var _0x29d1ad={};var _0x149880;var _0x479010;return db[_0x2c2d('0x2b')][_0x2c2d('0x49')]({'where':{'id':_0x117759[_0x2c2d('0x42')]['id']}})[_0x2c2d('0x24')](handleEntityNotFound(_0x5a42a1,null))[_0x2c2d('0x24')](function(_0x19d8eb){if(_0x19d8eb){_0x149880=_0x19d8eb;_0x29d1ad['model']=_[_0x2c2d('0x43')](db[_0x2c2d('0x4a')][_0x2c2d('0x2c')]);_0x29d1ad['query']=_['keys'](_0x117759[_0x2c2d('0x30')]);_0x29d1ad['filters']=_[_0x2c2d('0x32')](_0x29d1ad['model'],_0x29d1ad['query']);_0x3f8f35[_0x2c2d('0x34')]=_['intersection'](_0x29d1ad[_0x2c2d('0x33')],qs[_0x2c2d('0x35')](_0x117759[_0x2c2d('0x30')][_0x2c2d('0x35')]));_0x3f8f35['attributes']=_0x3f8f35[_0x2c2d('0x34')][_0x2c2d('0x44')]?_0x3f8f35[_0x2c2d('0x34')]:_0x29d1ad[_0x2c2d('0x33')];_0x3f8f35[_0x2c2d('0x4b')]=qs['sort'](_0x117759[_0x2c2d('0x30')][_0x2c2d('0x38')]);_0x3f8f35[_0x2c2d('0x39')]=qs['filters'](_['pick'](_0x117759[_0x2c2d('0x30')],_0x29d1ad['filters']));if(_0x117759['query'][_0x2c2d('0x3b')]){_0x3f8f35[_0x2c2d('0x39')]=_[_0x2c2d('0x3c')](_0x3f8f35[_0x2c2d('0x39')],{'$or':_[_0x2c2d('0x2a')](_0x3f8f35['attributes'],function(_0x442bc2){var _0x57b5f1={};_0x57b5f1[_0x442bc2]={'$like':'%'+_0x117759['query'][_0x2c2d('0x3b')]+'%'};return _0x57b5f1;})});}_0x3f8f35=_[_0x2c2d('0x3c')]({},_0x3f8f35,_0x117759[_0x2c2d('0x4c')]);return _0x149880[_0x2c2d('0x4e')](_0x3f8f35);}})[_0x2c2d('0x24')](function(_0x46da52){if(_0x46da52){_0x479010=_0x46da52['length'];if(!_0x117759[_0x2c2d('0x30')]['hasOwnProperty'](_0x2c2d('0x37'))){_0x3f8f35[_0x2c2d('0x1d')]=qs['limit'](_0x117759[_0x2c2d('0x30')][_0x2c2d('0x1d')]);_0x3f8f35[_0x2c2d('0x1c')]=qs[_0x2c2d('0x1c')](_0x117759[_0x2c2d('0x30')]['offset']);}return _0x149880[_0x2c2d('0x4e')](_0x3f8f35);}})[_0x2c2d('0x24')](function(_0x9c6a3){if(_0x9c6a3){return _0x9c6a3?{'count':_0x479010,'rows':_0x9c6a3}:null;}})[_0x2c2d('0x24')](respondWithResult(_0x5a42a1,null))[_0x2c2d('0x46')](handleError(_0x5a42a1,null));};exports[_0x2c2d('0x4f')]=function(_0x2c1a71,_0x275454,_0x12582e){var _0x376fe1={};var _0x43caac={};var _0x101e66;var _0x1ef856;return db[_0x2c2d('0x2b')][_0x2c2d('0x49')]({'where':{'id':_0x2c1a71[_0x2c2d('0x42')]['id']}})[_0x2c2d('0x24')](handleEntityNotFound(_0x275454,null))[_0x2c2d('0x24')](function(_0x4eb028){if(_0x4eb028){_0x101e66=_0x4eb028;_0x43caac[_0x2c2d('0x33')]=_[_0x2c2d('0x43')](db[_0x2c2d('0x50')][_0x2c2d('0x2c')]);_0x43caac[_0x2c2d('0x30')]=_[_0x2c2d('0x43')](_0x2c1a71[_0x2c2d('0x30')]);_0x43caac['filters']=_[_0x2c2d('0x32')](_0x43caac[_0x2c2d('0x33')],_0x43caac[_0x2c2d('0x30')]);_0x376fe1[_0x2c2d('0x34')]=_[_0x2c2d('0x32')](_0x43caac[_0x2c2d('0x33')],qs[_0x2c2d('0x35')](_0x2c1a71[_0x2c2d('0x30')][_0x2c2d('0x35')]));_0x376fe1[_0x2c2d('0x34')]=_0x376fe1[_0x2c2d('0x34')][_0x2c2d('0x44')]?_0x376fe1[_0x2c2d('0x34')]:_0x43caac[_0x2c2d('0x33')];_0x376fe1[_0x2c2d('0x4b')]=qs[_0x2c2d('0x38')](_0x2c1a71[_0x2c2d('0x30')][_0x2c2d('0x38')]);_0x376fe1[_0x2c2d('0x39')]=qs[_0x2c2d('0x31')](_[_0x2c2d('0x3a')](_0x2c1a71['query'],_0x43caac['filters']));if(_0x2c1a71[_0x2c2d('0x30')][_0x2c2d('0x3b')]){_0x376fe1[_0x2c2d('0x39')]=_[_0x2c2d('0x3c')](_0x376fe1[_0x2c2d('0x39')],{'$or':_[_0x2c2d('0x2a')](_0x376fe1[_0x2c2d('0x34')],function(_0x450775){var _0x40e56d={};_0x40e56d[_0x450775]={'$like':'%'+_0x2c1a71['query'][_0x2c2d('0x3b')]+'%'};return _0x40e56d;})});}_0x376fe1=_[_0x2c2d('0x3c')]({},_0x376fe1,_0x2c1a71[_0x2c2d('0x4c')]);return _0x101e66['getTags'](_0x376fe1);}})[_0x2c2d('0x24')](function(_0x45443e){if(_0x45443e){_0x1ef856=_0x45443e[_0x2c2d('0x44')];if(!_0x2c1a71[_0x2c2d('0x30')][_0x2c2d('0x36')](_0x2c2d('0x37'))){_0x376fe1[_0x2c2d('0x1d')]=qs['limit'](_0x2c1a71[_0x2c2d('0x30')][_0x2c2d('0x1d')]);_0x376fe1['offset']=qs[_0x2c2d('0x1c')](_0x2c1a71['query']['offset']);}return _0x101e66[_0x2c2d('0x4f')](_0x376fe1);}})[_0x2c2d('0x24')](function(_0x45132b){if(_0x45132b){return _0x45132b?{'count':_0x1ef856,'rows':_0x45132b}:null;}})[_0x2c2d('0x24')](respondWithResult(_0x275454,null))['catch'](handleError(_0x275454,null));};exports['setTags']=function(_0x26c5c5,_0x412ef6,_0x4c0449){if(_0x26c5c5[_0x2c2d('0x48')]['id']){delete _0x26c5c5[_0x2c2d('0x48')]['id'];}return db[_0x2c2d('0x2b')]['findOne']({'where':{'id':_0x26c5c5[_0x2c2d('0x42')]['id']}})['then'](handleEntityNotFound(_0x412ef6,null))[_0x2c2d('0x24')](function(_0x19c4b1){if(_0x19c4b1){return _0x19c4b1[_0x2c2d('0x51')](_0x26c5c5[_0x2c2d('0x48')]['ids']||[]);}return null;})[_0x2c2d('0x24')](respondWithResult(_0x412ef6,null))[_0x2c2d('0x46')](handleError(_0x412ef6,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 5bf1737..19d091b 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 _0x4bab=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intDeskConfiguration.attributes','define','DeskConfiguration','int_desk_configurations'];(function(_0xf3b435,_0x30507d){var _0x427a7b=function(_0x24b461){while(--_0x24b461){_0xf3b435['push'](_0xf3b435['shift']());}};_0x427a7b(++_0x30507d);}(_0x4bab,0x1d4));var _0xb4ba=function(_0x25f75c,_0x4d9798){_0x25f75c=_0x25f75c-0x0;var _0x4d51b1=_0x4bab[_0x25f75c];return _0x4d51b1;};'use strict';var _=require(_0xb4ba('0x0'));var util=require(_0xb4ba('0x1'));var logger=require(_0xb4ba('0x2'))(_0xb4ba('0x3'));var moment=require(_0xb4ba('0x4'));var BPromise=require(_0xb4ba('0x5'));var rp=require(_0xb4ba('0x6'));var fs=require('fs');var path=require(_0xb4ba('0x7'));var rimraf=require(_0xb4ba('0x8'));var config=require('../../config/environment');var attributes=require(_0xb4ba('0x9'));module['exports']=function(_0xa9ea74,_0x46d2a1){return _0xa9ea74[_0xb4ba('0xa')](_0xb4ba('0xb'),attributes,{'tableName':_0xb4ba('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x131e=['int_desk_configurations','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','exports','define','DeskConfiguration'];(function(_0x173441,_0x26b0d9){var _0x2423a8=function(_0x4d96c2){while(--_0x4d96c2){_0x173441['push'](_0x173441['shift']());}};_0x2423a8(++_0x26b0d9);}(_0x131e,0x1d5));var _0xe131=function(_0x2b997c,_0x13bb47){_0x2b997c=_0x2b997c-0x0;var _0x1777aa=_0x131e[_0x2b997c];return _0x1777aa;};'use strict';var _=require(_0xe131('0x0'));var util=require(_0xe131('0x1'));var logger=require(_0xe131('0x2'))(_0xe131('0x3'));var moment=require('moment');var BPromise=require(_0xe131('0x4'));var rp=require(_0xe131('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe131('0x6'));var config=require(_0xe131('0x7'));var attributes=require('./intDeskConfiguration.attributes');module[_0xe131('0x8')]=function(_0x16402c,_0x3d7810){return _0x16402c[_0xe131('0x9')](_0xe131('0xa'),attributes,{'tableName':_0xe131('0xb'),'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 7fa0770..eea4f7d 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 _0xf3e2=['rpc','jayson/promise','client','http','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x49ca18,_0x5e6d05){var _0x145d54=function(_0x30b9be){while(--_0x30b9be){_0x49ca18['push'](_0x49ca18['shift']());}};_0x145d54(++_0x5e6d05);}(_0xf3e2,0x168));var _0x2f3e=function(_0x3ab8d7,_0x462b06){_0x3ab8d7=_0x3ab8d7-0x0;var _0x58092a=_0xf3e2[_0x3ab8d7];return _0x58092a;};'use strict';var _=require(_0x2f3e('0x0'));var util=require(_0x2f3e('0x1'));var moment=require(_0x2f3e('0x2'));var BPromise=require(_0x2f3e('0x3'));var rs=require(_0x2f3e('0x4'));var fs=require('fs');var Redis=require(_0x2f3e('0x5'));var db=require(_0x2f3e('0x6'))['db'];var utils=require(_0x2f3e('0x7'));var logger=require('../../config/logger')(_0x2f3e('0x8'));var config=require('../../config/environment');var jayson=require(_0x2f3e('0x9'));var client=jayson[_0x2f3e('0xa')][_0x2f3e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x392f91,_0x3b556b,_0x1ac142){return new BPromise(function(_0x30f939,_0x46ec1b){return client['request'](_0x392f91,_0x1ac142)[_0x2f3e('0xc')](function(_0x4d7f7d){logger[_0x2f3e('0xd')](_0x2f3e('0xe'),_0x3b556b,_0x2f3e('0xf'));logger[_0x2f3e('0x10')](_0x2f3e('0x11'),_0x3b556b,_0x2f3e('0xf'),JSON[_0x2f3e('0x12')](_0x4d7f7d));if(_0x4d7f7d[_0x2f3e('0x13')]){if(_0x4d7f7d[_0x2f3e('0x13')][_0x2f3e('0x14')]===0x1f4){logger[_0x2f3e('0x13')](_0x2f3e('0xe'),_0x3b556b,_0x4d7f7d['error'][_0x2f3e('0x15')]);return _0x46ec1b(_0x4d7f7d['error'][_0x2f3e('0x15')]);}logger[_0x2f3e('0x13')]('DeskConfiguration,\x20%s,\x20%s',_0x3b556b,_0x4d7f7d['error'][_0x2f3e('0x15')]);return _0x30f939(_0x4d7f7d[_0x2f3e('0x13')][_0x2f3e('0x15')]);}else{logger[_0x2f3e('0xd')](_0x2f3e('0xe'),_0x3b556b,_0x2f3e('0xf'));_0x30f939(_0x4d7f7d['result'][_0x2f3e('0x15')]);}})[_0x2f3e('0x16')](function(_0x15398d){logger[_0x2f3e('0x13')]('DeskConfiguration,\x20%s,\x20%s',_0x3b556b,_0x15398d);_0x46ec1b(_0x15398d);});});} \ No newline at end of file +var _0x3445=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','then','info','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','DeskConfiguration,\x20%s,\x20%s'];(function(_0x47aa9b,_0x261f02){var _0x37d8da=function(_0x1a17a7){while(--_0x1a17a7){_0x47aa9b['push'](_0x47aa9b['shift']());}};_0x37d8da(++_0x261f02);}(_0x3445,0x1b7));var _0x5344=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3445[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x5344('0x0'));var util=require(_0x5344('0x1'));var moment=require(_0x5344('0x2'));var BPromise=require(_0x5344('0x3'));var rs=require(_0x5344('0x4'));var fs=require('fs');var Redis=require(_0x5344('0x5'));var db=require(_0x5344('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5344('0x7'));var config=require(_0x5344('0x8'));var jayson=require(_0x5344('0x9'));var client=jayson[_0x5344('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ffe5f,_0x5642cb,_0x5a4f52){return new BPromise(function(_0x3f638c,_0x4adb8a){return client['request'](_0x4ffe5f,_0x5a4f52)[_0x5344('0xb')](function(_0xbc5346){logger[_0x5344('0xc')]('DeskConfiguration,\x20%s,\x20%s',_0x5642cb,_0x5344('0xd'));logger[_0x5344('0xe')](_0x5344('0xf'),_0x5642cb,_0x5344('0xd'),JSON[_0x5344('0x10')](_0xbc5346));if(_0xbc5346[_0x5344('0x11')]){if(_0xbc5346['error'][_0x5344('0x12')]===0x1f4){logger[_0x5344('0x11')]('DeskConfiguration,\x20%s,\x20%s',_0x5642cb,_0xbc5346[_0x5344('0x11')]['message']);return _0x4adb8a(_0xbc5346[_0x5344('0x11')]['message']);}logger['error']('DeskConfiguration,\x20%s,\x20%s',_0x5642cb,_0xbc5346[_0x5344('0x11')][_0x5344('0x13')]);return _0x3f638c(_0xbc5346[_0x5344('0x11')][_0x5344('0x13')]);}else{logger[_0x5344('0xc')](_0x5344('0x14'),_0x5642cb,_0x5344('0xd'));_0x3f638c(_0xbc5346[_0x5344('0x15')][_0x5344('0x13')]);}})[_0x5344('0x16')](function(_0x4ae241){logger[_0x5344('0x11')](_0x5344('0x14'),_0x5642cb,_0x4ae241);_0x4adb8a(_0x4ae241);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 40da26f..7c3f717 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 _0xff73=['../../components/interaction/service','./intDeskField.controller','get','index','/:id','isAuthenticated','show','create','put','update','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x51674a,_0x77ccff){var _0x13fca6=function(_0x3d6c27){while(--_0x3d6c27){_0x51674a['push'](_0x51674a['shift']());}};_0x13fca6(++_0x77ccff);}(_0xff73,0x1d4));var _0x3ff7=function(_0x5be658,_0x35d76d){_0x5be658=_0x5be658-0x0;var _0x373777=_0xff73[_0x5be658];return _0x373777;};'use strict';var multer=require(_0x3ff7('0x0'));var util=require(_0x3ff7('0x1'));var path=require('path');var timeout=require(_0x3ff7('0x2'));var express=require(_0x3ff7('0x3'));var router=express[_0x3ff7('0x4')]();var fs_extra=require(_0x3ff7('0x5'));var auth=require(_0x3ff7('0x6'));var interaction=require(_0x3ff7('0x7'));var config=require('../../config/environment');var controller=require(_0x3ff7('0x8'));router[_0x3ff7('0x9')]('/',auth['isAuthenticated'](),controller[_0x3ff7('0xa')]);router[_0x3ff7('0x9')](_0x3ff7('0xb'),auth[_0x3ff7('0xc')](),controller[_0x3ff7('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x3ff7('0xe')]);router[_0x3ff7('0xf')](_0x3ff7('0xb'),auth['isAuthenticated'](),controller[_0x3ff7('0x10')]);router[_0x3ff7('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x3ff7('0x12')]);module['exports']=router; \ No newline at end of file +var _0x9f91=['../../config/environment','get','index','isAuthenticated','show','post','create','put','/:id','delete','destroy','exports','util','path','fs-extra','../../components/auth/service'];(function(_0x17f397,_0x5bf1eb){var _0x65aa26=function(_0x2dfc7c){while(--_0x2dfc7c){_0x17f397['push'](_0x17f397['shift']());}};_0x65aa26(++_0x5bf1eb);}(_0x9f91,0x14c));var _0x19f9=function(_0x496738,_0x3f1a9f){_0x496738=_0x496738-0x0;var _0xee1381=_0x9f91[_0x496738];return _0xee1381;};'use strict';var multer=require('multer');var util=require(_0x19f9('0x0'));var path=require(_0x19f9('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x19f9('0x2'));var auth=require(_0x19f9('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x19f9('0x4'));var controller=require('./intDeskField.controller');router[_0x19f9('0x5')]('/',auth['isAuthenticated'](),controller[_0x19f9('0x6')]);router[_0x19f9('0x5')]('/:id',auth[_0x19f9('0x7')](),controller[_0x19f9('0x8')]);router[_0x19f9('0x9')]('/',auth[_0x19f9('0x7')](),controller[_0x19f9('0xa')]);router[_0x19f9('0xb')](_0x19f9('0xc'),auth[_0x19f9('0x7')](),controller['update']);router[_0x19f9('0xd')]('/:id',auth[_0x19f9('0x7')](),controller[_0x19f9('0xe')]);module[_0x19f9('0xf')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index 4809478..385797c 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 _0xe11a=['customVariable','keyValue','STRING','variable','sequelize','exports','string'];(function(_0x39497a,_0x52679e){var _0x4af35f=function(_0x587ee0){while(--_0x587ee0){_0x39497a['push'](_0x39497a['shift']());}};_0x4af35f(++_0x52679e);}(_0xe11a,0x146));var _0xae11=function(_0x295ec0,_0x45b0c7){_0x295ec0=_0x295ec0-0x0;var _0x90c6a2=_0xe11a[_0x295ec0];return _0x90c6a2;};'use strict';var Sequelize=require(_0xae11('0x0'));module[_0xae11('0x1')]={'type':{'type':Sequelize['ENUM'](_0xae11('0x2'),'variable',_0xae11('0x3'),_0xae11('0x4'),'picklist'),'defaultValue':_0xae11('0x2')},'content':{'type':Sequelize[_0xae11('0x5')]},'key':{'type':Sequelize[_0xae11('0x5')]},'keyType':{'type':Sequelize['ENUM']('string',_0xae11('0x6'),'customVariable')},'keyContent':{'type':Sequelize[_0xae11('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xae11('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xae11('0x5')]}}; \ No newline at end of file +var _0xe189=['keyValue','picklist','STRING','ENUM','sequelize','exports','string','variable','customVariable'];(function(_0x4b89d9,_0x3a4a59){var _0x5648ac=function(_0x247968){while(--_0x247968){_0x4b89d9['push'](_0x4b89d9['shift']());}};_0x5648ac(++_0x3a4a59);}(_0xe189,0xc1));var _0x9e18=function(_0x6f3bf1,_0x11923e){_0x6f3bf1=_0x6f3bf1-0x0;var _0x12a54e=_0xe189[_0x6f3bf1];return _0x12a54e;};'use strict';var Sequelize=require(_0x9e18('0x0'));module[_0x9e18('0x1')]={'type':{'type':Sequelize['ENUM'](_0x9e18('0x2'),_0x9e18('0x3'),_0x9e18('0x4'),_0x9e18('0x5'),_0x9e18('0x6')),'defaultValue':_0x9e18('0x2')},'content':{'type':Sequelize[_0x9e18('0x7')]},'key':{'type':Sequelize[_0x9e18('0x7')]},'keyType':{'type':Sequelize[_0x9e18('0x8')](_0x9e18('0x2'),_0x9e18('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x9e18('0x7')]},'idField':{'type':Sequelize[_0x9e18('0x7')]},'nameField':{'type':Sequelize[_0x9e18('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9e18('0x7')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index cc78521..4009484 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 _0x7e02=['apply','then','destroy','end','error','stack','name','map','DeskField','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','findAll','rows','catch','show','options','find','create','update','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','offset','count','set'];(function(_0x52c6bf,_0x29c95b){var _0x37fea0=function(_0xb23096){while(--_0xb23096){_0x52c6bf['push'](_0x52c6bf['shift']());}};_0x37fea0(++_0x29c95b);}(_0x7e02,0x71));var _0x27e0=function(_0x1b852e,_0x185f0d){_0x1b852e=_0x1b852e-0x0;var _0x2fd5cf=_0x7e02[_0x1b852e];return _0x2fd5cf;};'use strict';var emlformat=require(_0x27e0('0x0'));var rimraf=require(_0x27e0('0x1'));var zipdir=require(_0x27e0('0x2'));var jsonpatch=require(_0x27e0('0x3'));var rp=require(_0x27e0('0x4'));var moment=require(_0x27e0('0x5'));var BPromise=require(_0x27e0('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x27e0('0x7'));var sox=require('sox');var csv=require(_0x27e0('0x8'));var ejs=require(_0x27e0('0x9'));var fs=require('fs');var fs_extra=require(_0x27e0('0xa'));var _=require(_0x27e0('0xb'));var squel=require(_0x27e0('0xc'));var crypto=require(_0x27e0('0xd'));var jsforce=require(_0x27e0('0xe'));var deskjs=require(_0x27e0('0xf'));var toCsv=require('to-csv');var querystring=require(_0x27e0('0x10'));var Papa=require('papaparse');var Redis=require(_0x27e0('0x11'));var authService=require(_0x27e0('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x27e0('0x13'));var hardwareService=require(_0x27e0('0x14'));var logger=require(_0x27e0('0x15'))(_0x27e0('0x16'));var utils=require(_0x27e0('0x17'));var config=require(_0x27e0('0x18'));var licenseUtil=require(_0x27e0('0x19'));var db=require(_0x27e0('0x1a'))['db'];function respondWithStatusCode(_0x31ef33,_0x492c65){_0x492c65=_0x492c65||0xcc;return function(_0x156bea){if(_0x156bea){return _0x31ef33[_0x27e0('0x1b')](_0x492c65);}return _0x31ef33[_0x27e0('0x1c')](_0x492c65)['end']();};}function respondWithResult(_0x39fb61,_0x3a67ab){_0x3a67ab=_0x3a67ab||0xc8;return function(_0x473128){if(_0x473128){return _0x39fb61['status'](_0x3a67ab)[_0x27e0('0x1d')](_0x473128);}};}function respondWithFilteredResult(_0x220128,_0x1f7532){return function(_0xf326e2){if(_0xf326e2){var _0x5b1b6e=typeof _0x1f7532['offset']===_0x27e0('0x1e')&&typeof _0x1f7532[_0x27e0('0x1f')]===_0x27e0('0x1e');var _0x2111e=_0xf326e2['count'];var _0x32597b=_0x5b1b6e?0x0:_0x1f7532[_0x27e0('0x20')];var _0x12a91f=_0x5b1b6e?_0xf326e2[_0x27e0('0x21')]:_0x1f7532[_0x27e0('0x20')]+_0x1f7532[_0x27e0('0x1f')];var _0x4d9edc;if(_0x12a91f>=_0x2111e){_0x12a91f=_0x2111e;_0x4d9edc=0xc8;}else{_0x4d9edc=0xce;}_0x220128[_0x27e0('0x1c')](_0x4d9edc);return _0x220128[_0x27e0('0x22')]('Content-Range',_0x32597b+'-'+_0x12a91f+'/'+_0x2111e)[_0x27e0('0x1d')](_0xf326e2);}return null;};}function patchUpdates(_0x23df66){return function(_0x32c2ff){try{jsonpatch[_0x27e0('0x23')](_0x32c2ff,_0x23df66,!![]);}catch(_0x408d95){return BPromise['reject'](_0x408d95);}return _0x32c2ff['save']();};}function saveUpdates(_0x57897e,_0x1ef3aa){return function(_0x11f4ca){if(_0x11f4ca){return _0x11f4ca['update'](_0x57897e)[_0x27e0('0x24')](function(_0xee6318){return _0xee6318;});}return null;};}function removeEntity(_0x32503e,_0x6f83ee){return function(_0xd857c2){if(_0xd857c2){return _0xd857c2[_0x27e0('0x25')]()[_0x27e0('0x24')](function(){_0x32503e[_0x27e0('0x1c')](0xcc)[_0x27e0('0x26')]();});}};}function handleEntityNotFound(_0x3068c4,_0x1e5060){return function(_0x27dc43){if(!_0x27dc43){_0x3068c4[_0x27e0('0x1b')](0x194);}return _0x27dc43;};}function handleError(_0x3d4691,_0xab503d){_0xab503d=_0xab503d||0x1f4;return function(_0x581ec9){logger[_0x27e0('0x27')](_0x581ec9[_0x27e0('0x28')]);if(_0x581ec9[_0x27e0('0x29')]){delete _0x581ec9[_0x27e0('0x29')];}_0x3d4691[_0x27e0('0x1c')](_0xab503d)['send'](_0x581ec9);};}exports['index']=function(_0x29114d,_0x3e2c4b){var _0x141c40={},_0x304fe6={},_0x57bcc1={'count':0x0,'rows':[]};var _0x4f5ea2=_[_0x27e0('0x2a')](db[_0x27e0('0x2b')]['rawAttributes'],function(_0x55d752){return{'name':_0x55d752['fieldName'],'type':_0x55d752[_0x27e0('0x2c')][_0x27e0('0x2d')]};});_0x304fe6[_0x27e0('0x2e')]=_[_0x27e0('0x2a')](_0x4f5ea2,'name');_0x304fe6[_0x27e0('0x2f')]=_[_0x27e0('0x30')](_0x29114d[_0x27e0('0x2f')]);_0x304fe6[_0x27e0('0x31')]=_[_0x27e0('0x32')](_0x304fe6[_0x27e0('0x2e')],_0x304fe6[_0x27e0('0x2f')]);_0x141c40[_0x27e0('0x33')]=_[_0x27e0('0x32')](_0x304fe6[_0x27e0('0x2e')],qs['fields'](_0x29114d[_0x27e0('0x2f')][_0x27e0('0x34')]));_0x141c40['attributes']=_0x141c40['attributes'][_0x27e0('0x35')]?_0x141c40[_0x27e0('0x33')]:_0x304fe6[_0x27e0('0x2e')];if(!_0x29114d['query'][_0x27e0('0x36')](_0x27e0('0x37'))){_0x141c40['limit']=qs[_0x27e0('0x1f')](_0x29114d[_0x27e0('0x2f')]['limit']);_0x141c40[_0x27e0('0x20')]=qs[_0x27e0('0x20')](_0x29114d['query'][_0x27e0('0x20')]);}_0x141c40[_0x27e0('0x38')]=qs['sort'](_0x29114d['query'][_0x27e0('0x39')]);_0x141c40[_0x27e0('0x3a')]=qs[_0x27e0('0x31')](_[_0x27e0('0x3b')](_0x29114d['query'],_0x304fe6[_0x27e0('0x31')]),_0x4f5ea2);if(_0x29114d['query'][_0x27e0('0x3c')]){_0x141c40[_0x27e0('0x3a')]=_[_0x27e0('0x3d')](_0x141c40['where'],{'$or':_[_0x27e0('0x2a')](_0x4f5ea2,function(_0x213540){if(_0x213540['type']!=='VIRTUAL'){var _0x2763ec={};_0x2763ec[_0x213540[_0x27e0('0x29')]]={'$like':'%'+_0x29114d[_0x27e0('0x2f')][_0x27e0('0x3c')]+'%'};return _0x2763ec;}})});}_0x141c40=_['merge']({},_0x141c40,_0x29114d['options']);var _0x5f5b65={'where':_0x141c40[_0x27e0('0x3a')]};return db[_0x27e0('0x2b')]['count'](_0x5f5b65)['then'](function(_0x4a6856){_0x57bcc1[_0x27e0('0x21')]=_0x4a6856;if(_0x29114d[_0x27e0('0x2f')][_0x27e0('0x3e')]){_0x141c40[_0x27e0('0x3f')]=[{'all':!![]}];}return db[_0x27e0('0x2b')][_0x27e0('0x40')](_0x141c40);})[_0x27e0('0x24')](function(_0x3f81ba){_0x57bcc1[_0x27e0('0x41')]=_0x3f81ba;return _0x57bcc1;})[_0x27e0('0x24')](respondWithFilteredResult(_0x3e2c4b,_0x141c40))[_0x27e0('0x42')](handleError(_0x3e2c4b,null));};exports[_0x27e0('0x43')]=function(_0x4227c0,_0x6c37db){var _0x2f6005={'raw':!![],'where':{'id':_0x4227c0['params']['id']}},_0x535260={};_0x535260[_0x27e0('0x2e')]=_[_0x27e0('0x30')](db['DeskField']['rawAttributes']);_0x535260['query']=_[_0x27e0('0x30')](_0x4227c0[_0x27e0('0x2f')]);_0x535260['filters']=_['intersection'](_0x535260[_0x27e0('0x2e')],_0x535260[_0x27e0('0x2f')]);_0x2f6005[_0x27e0('0x33')]=_[_0x27e0('0x32')](_0x535260[_0x27e0('0x2e')],qs[_0x27e0('0x34')](_0x4227c0[_0x27e0('0x2f')][_0x27e0('0x34')]));_0x2f6005[_0x27e0('0x33')]=_0x2f6005[_0x27e0('0x33')][_0x27e0('0x35')]?_0x2f6005[_0x27e0('0x33')]:_0x535260[_0x27e0('0x2e')];if(_0x4227c0[_0x27e0('0x2f')][_0x27e0('0x3e')]){_0x2f6005[_0x27e0('0x3f')]=[{'all':!![]}];}_0x2f6005=_[_0x27e0('0x3d')]({},_0x2f6005,_0x4227c0[_0x27e0('0x44')]);return db[_0x27e0('0x2b')][_0x27e0('0x45')](_0x2f6005)[_0x27e0('0x24')](handleEntityNotFound(_0x6c37db,null))[_0x27e0('0x24')](respondWithResult(_0x6c37db,null))[_0x27e0('0x42')](handleError(_0x6c37db,null));};exports[_0x27e0('0x46')]=function(_0x24058f,_0x22cd05){return db[_0x27e0('0x2b')][_0x27e0('0x46')](_0x24058f['body'],{})['then'](respondWithResult(_0x22cd05,0xc9))[_0x27e0('0x42')](handleError(_0x22cd05,null));};exports[_0x27e0('0x47')]=function(_0x5322c9,_0x58aef9){if(_0x5322c9[_0x27e0('0x48')]['id']){delete _0x5322c9[_0x27e0('0x48')]['id'];}return db[_0x27e0('0x2b')][_0x27e0('0x45')]({'where':{'id':_0x5322c9[_0x27e0('0x49')]['id']}})[_0x27e0('0x24')](handleEntityNotFound(_0x58aef9,null))[_0x27e0('0x24')](saveUpdates(_0x5322c9['body'],null))['then'](respondWithResult(_0x58aef9,null))[_0x27e0('0x42')](handleError(_0x58aef9,null));};exports[_0x27e0('0x25')]=function(_0xca08c,_0x29241d){return db[_0x27e0('0x2b')][_0x27e0('0x45')]({'where':{'id':_0xca08c['params']['id']}})['then'](handleEntityNotFound(_0x29241d,null))[_0x27e0('0x24')](removeEntity(_0x29241d,null))[_0x27e0('0x42')](handleError(_0x29241d,null));}; \ No newline at end of file +var _0x6114=['send','index','map','DeskField','rawAttributes','type','key','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name'];(function(_0x263c92,_0xd5a777){var _0x1ab2d7=function(_0x554129){while(--_0x554129){_0x263c92['push'](_0x263c92['shift']());}};_0x1ab2d7(++_0xd5a777);}(_0x6114,0x6d));var _0x4611=function(_0x4c0ebb,_0x1e7eae){_0x4c0ebb=_0x4c0ebb-0x0;var _0xfc4dc1=_0x6114[_0x4c0ebb];return _0xfc4dc1;};'use strict';var emlformat=require(_0x4611('0x0'));var rimraf=require(_0x4611('0x1'));var zipdir=require(_0x4611('0x2'));var jsonpatch=require(_0x4611('0x3'));var rp=require(_0x4611('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x4611('0x5'));var util=require('util');var path=require(_0x4611('0x6'));var sox=require(_0x4611('0x7'));var csv=require(_0x4611('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4611('0x9'));var _=require(_0x4611('0xa'));var squel=require(_0x4611('0xb'));var crypto=require(_0x4611('0xc'));var jsforce=require(_0x4611('0xd'));var deskjs=require(_0x4611('0xe'));var toCsv=require(_0x4611('0x8'));var querystring=require(_0x4611('0xf'));var Papa=require(_0x4611('0x10'));var Redis=require(_0x4611('0x11'));var authService=require(_0x4611('0x12'));var qs=require(_0x4611('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x4611('0x14'));var utils=require(_0x4611('0x15'));var config=require(_0x4611('0x16'));var licenseUtil=require(_0x4611('0x17'));var db=require(_0x4611('0x18'))['db'];function respondWithStatusCode(_0x551cf5,_0x335d46){_0x335d46=_0x335d46||0xcc;return function(_0x1ca0d7){if(_0x1ca0d7){return _0x551cf5[_0x4611('0x19')](_0x335d46);}return _0x551cf5['status'](_0x335d46)[_0x4611('0x1a')]();};}function respondWithResult(_0x1ba2ff,_0x538961){_0x538961=_0x538961||0xc8;return function(_0x1960de){if(_0x1960de){return _0x1ba2ff[_0x4611('0x1b')](_0x538961)[_0x4611('0x1c')](_0x1960de);}};}function respondWithFilteredResult(_0x365b8c,_0x4d2499){return function(_0x4927aa){if(_0x4927aa){var _0x205094=typeof _0x4d2499[_0x4611('0x1d')]===_0x4611('0x1e')&&typeof _0x4d2499[_0x4611('0x1f')]===_0x4611('0x1e');var _0x464c56=_0x4927aa[_0x4611('0x20')];var _0x584f9b=_0x205094?0x0:_0x4d2499[_0x4611('0x1d')];var _0x596e5b=_0x205094?_0x4927aa[_0x4611('0x20')]:_0x4d2499[_0x4611('0x1d')]+_0x4d2499[_0x4611('0x1f')];var _0x5ec526;if(_0x596e5b>=_0x464c56){_0x596e5b=_0x464c56;_0x5ec526=0xc8;}else{_0x5ec526=0xce;}_0x365b8c['status'](_0x5ec526);return _0x365b8c[_0x4611('0x21')](_0x4611('0x22'),_0x584f9b+'-'+_0x596e5b+'/'+_0x464c56)['json'](_0x4927aa);}return null;};}function patchUpdates(_0x295b7a){return function(_0x444bc4){try{jsonpatch[_0x4611('0x23')](_0x444bc4,_0x295b7a,!![]);}catch(_0x481acb){return BPromise['reject'](_0x481acb);}return _0x444bc4[_0x4611('0x24')]();};}function saveUpdates(_0xd15c60,_0x2a5df3){return function(_0x2cb61a){if(_0x2cb61a){return _0x2cb61a[_0x4611('0x25')](_0xd15c60)[_0x4611('0x26')](function(_0x1bb45f){return _0x1bb45f;});}return null;};}function removeEntity(_0x4f6bc9,_0x36f065){return function(_0x34bdeb){if(_0x34bdeb){return _0x34bdeb[_0x4611('0x27')]()[_0x4611('0x26')](function(){_0x4f6bc9[_0x4611('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x6b720d,_0x40d2c6){return function(_0x120500){if(!_0x120500){_0x6b720d[_0x4611('0x19')](0x194);}return _0x120500;};}function handleError(_0x9fa520,_0x3d1dfe){_0x3d1dfe=_0x3d1dfe||0x1f4;return function(_0x2d43e6){logger[_0x4611('0x28')](_0x2d43e6[_0x4611('0x29')]);if(_0x2d43e6[_0x4611('0x2a')]){delete _0x2d43e6[_0x4611('0x2a')];}_0x9fa520[_0x4611('0x1b')](_0x3d1dfe)[_0x4611('0x2b')](_0x2d43e6);};}exports[_0x4611('0x2c')]=function(_0x98759c,_0x2bdd97){var _0x24b037={},_0x102f2c={},_0x28ae4a={'count':0x0,'rows':[]};var _0x93f058=_[_0x4611('0x2d')](db[_0x4611('0x2e')][_0x4611('0x2f')],function(_0x5941fb){return{'name':_0x5941fb['fieldName'],'type':_0x5941fb[_0x4611('0x30')][_0x4611('0x31')]};});_0x102f2c['model']=_[_0x4611('0x2d')](_0x93f058,'name');_0x102f2c['query']=_[_0x4611('0x32')](_0x98759c[_0x4611('0x33')]);_0x102f2c[_0x4611('0x34')]=_[_0x4611('0x35')](_0x102f2c[_0x4611('0x36')],_0x102f2c[_0x4611('0x33')]);_0x24b037['attributes']=_[_0x4611('0x35')](_0x102f2c[_0x4611('0x36')],qs[_0x4611('0x37')](_0x98759c[_0x4611('0x33')][_0x4611('0x37')]));_0x24b037[_0x4611('0x38')]=_0x24b037[_0x4611('0x38')][_0x4611('0x39')]?_0x24b037[_0x4611('0x38')]:_0x102f2c[_0x4611('0x36')];if(!_0x98759c[_0x4611('0x33')][_0x4611('0x3a')]('nolimit')){_0x24b037[_0x4611('0x1f')]=qs[_0x4611('0x1f')](_0x98759c['query'][_0x4611('0x1f')]);_0x24b037[_0x4611('0x1d')]=qs[_0x4611('0x1d')](_0x98759c[_0x4611('0x33')][_0x4611('0x1d')]);}_0x24b037['order']=qs[_0x4611('0x3b')](_0x98759c['query'][_0x4611('0x3b')]);_0x24b037[_0x4611('0x3c')]=qs[_0x4611('0x34')](_[_0x4611('0x3d')](_0x98759c[_0x4611('0x33')],_0x102f2c['filters']),_0x93f058);if(_0x98759c[_0x4611('0x33')][_0x4611('0x3e')]){_0x24b037[_0x4611('0x3c')]=_[_0x4611('0x3f')](_0x24b037[_0x4611('0x3c')],{'$or':_[_0x4611('0x2d')](_0x93f058,function(_0x9543c6){if(_0x9543c6['type']!==_0x4611('0x40')){var _0x804359={};_0x804359[_0x9543c6[_0x4611('0x2a')]]={'$like':'%'+_0x98759c[_0x4611('0x33')][_0x4611('0x3e')]+'%'};return _0x804359;}})});}_0x24b037=_[_0x4611('0x3f')]({},_0x24b037,_0x98759c[_0x4611('0x41')]);var _0x7db771={'where':_0x24b037[_0x4611('0x3c')]};return db[_0x4611('0x2e')][_0x4611('0x20')](_0x7db771)['then'](function(_0x1c99e1){_0x28ae4a['count']=_0x1c99e1;if(_0x98759c[_0x4611('0x33')]['includeAll']){_0x24b037[_0x4611('0x42')]=[{'all':!![]}];}return db[_0x4611('0x2e')][_0x4611('0x43')](_0x24b037);})[_0x4611('0x26')](function(_0x25e67c){_0x28ae4a[_0x4611('0x44')]=_0x25e67c;return _0x28ae4a;})[_0x4611('0x26')](respondWithFilteredResult(_0x2bdd97,_0x24b037))[_0x4611('0x45')](handleError(_0x2bdd97,null));};exports[_0x4611('0x46')]=function(_0x1fafa6,_0x227775){var _0x382aea={'raw':!![],'where':{'id':_0x1fafa6[_0x4611('0x47')]['id']}},_0x45c7ba={};_0x45c7ba[_0x4611('0x36')]=_[_0x4611('0x32')](db[_0x4611('0x2e')]['rawAttributes']);_0x45c7ba[_0x4611('0x33')]=_[_0x4611('0x32')](_0x1fafa6[_0x4611('0x33')]);_0x45c7ba[_0x4611('0x34')]=_[_0x4611('0x35')](_0x45c7ba[_0x4611('0x36')],_0x45c7ba['query']);_0x382aea[_0x4611('0x38')]=_['intersection'](_0x45c7ba[_0x4611('0x36')],qs['fields'](_0x1fafa6[_0x4611('0x33')]['fields']));_0x382aea[_0x4611('0x38')]=_0x382aea[_0x4611('0x38')][_0x4611('0x39')]?_0x382aea[_0x4611('0x38')]:_0x45c7ba[_0x4611('0x36')];if(_0x1fafa6[_0x4611('0x33')][_0x4611('0x48')]){_0x382aea[_0x4611('0x42')]=[{'all':!![]}];}_0x382aea=_[_0x4611('0x3f')]({},_0x382aea,_0x1fafa6[_0x4611('0x41')]);return db[_0x4611('0x2e')][_0x4611('0x49')](_0x382aea)[_0x4611('0x26')](handleEntityNotFound(_0x227775,null))[_0x4611('0x26')](respondWithResult(_0x227775,null))[_0x4611('0x45')](handleError(_0x227775,null));};exports[_0x4611('0x4a')]=function(_0x2e024c,_0x36f191){return db[_0x4611('0x2e')][_0x4611('0x4a')](_0x2e024c['body'],{})[_0x4611('0x26')](respondWithResult(_0x36f191,0xc9))['catch'](handleError(_0x36f191,null));};exports[_0x4611('0x25')]=function(_0x182b5a,_0x24a69c){if(_0x182b5a[_0x4611('0x4b')]['id']){delete _0x182b5a[_0x4611('0x4b')]['id'];}return db[_0x4611('0x2e')][_0x4611('0x49')]({'where':{'id':_0x182b5a[_0x4611('0x47')]['id']}})[_0x4611('0x26')](handleEntityNotFound(_0x24a69c,null))[_0x4611('0x26')](saveUpdates(_0x182b5a['body'],null))[_0x4611('0x26')](respondWithResult(_0x24a69c,null))[_0x4611('0x45')](handleError(_0x24a69c,null));};exports[_0x4611('0x27')]=function(_0x366991,_0x598ba3){return db[_0x4611('0x2e')]['find']({'where':{'id':_0x366991[_0x4611('0x47')]['id']}})[_0x4611('0x26')](handleEntityNotFound(_0x598ba3,null))[_0x4611('0x26')](removeEntity(_0x598ba3,null))['catch'](handleError(_0x598ba3,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index e9c0e45..9a4d4e0 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 _0x3240=['DeskField','desk_unique_index','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./intDeskField.attributes','exports'];(function(_0x429717,_0x26e1c0){var _0x588155=function(_0x4c547d){while(--_0x4c547d){_0x429717['push'](_0x429717['shift']());}};_0x588155(++_0x26e1c0);}(_0x3240,0xfa));var _0x0324=function(_0x2589f2,_0x2c1515){_0x2589f2=_0x2589f2-0x0;var _0x3c8cc7=_0x3240[_0x2589f2];return _0x3c8cc7;};'use strict';var _=require(_0x0324('0x0'));var util=require(_0x0324('0x1'));var logger=require(_0x0324('0x2'))(_0x0324('0x3'));var moment=require(_0x0324('0x4'));var BPromise=require(_0x0324('0x5'));var rp=require(_0x0324('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0324('0x7'));var config=require('../../config/environment');var attributes=require(_0x0324('0x8'));module[_0x0324('0x9')]=function(_0x1af4c9,_0x4f0a6f){return _0x1af4c9['define'](_0x0324('0xa'),attributes,{'tableName':'int_desk_fields','paranoid':![],'indexes':[{'name':_0x0324('0xb'),'fields':['idField',_0x0324('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf7d8=['DeskField','int_desk_fields','desk_unique_index','idField','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intDeskField.attributes','exports','define'];(function(_0x14795a,_0x1bb61a){var _0x31c7b4=function(_0x5272bb){while(--_0x5272bb){_0x14795a['push'](_0x14795a['shift']());}};_0x31c7b4(++_0x1bb61a);}(_0xf7d8,0x6d));var _0x8f7d=function(_0xd0a847,_0x72562b){_0xd0a847=_0xd0a847-0x0;var _0x2536ec=_0xf7d8[_0xd0a847];return _0x2536ec;};'use strict';var _=require('lodash');var util=require(_0x8f7d('0x0'));var logger=require(_0x8f7d('0x1'))(_0x8f7d('0x2'));var moment=require(_0x8f7d('0x3'));var BPromise=require('bluebird');var rp=require(_0x8f7d('0x4'));var fs=require('fs');var path=require(_0x8f7d('0x5'));var rimraf=require(_0x8f7d('0x6'));var config=require(_0x8f7d('0x7'));var attributes=require(_0x8f7d('0x8'));module[_0x8f7d('0x9')]=function(_0x3176f3,_0x22d913){return _0x3176f3[_0x8f7d('0xa')](_0x8f7d('0xb'),attributes,{'tableName':_0x8f7d('0xc'),'paranoid':![],'indexes':[{'name':_0x8f7d('0xd'),'fields':[_0x8f7d('0xe'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.rpc.js b/server/api/intDeskField/intDeskField.rpc.js index 0712c85..d9a99dc 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 _0xc045=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','debug','DeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','DeskField,\x20%s,\x20%s','message','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x26ff95,_0x3c45ed){var _0x1a1fc3=function(_0x2be024){while(--_0x2be024){_0x26ff95['push'](_0x26ff95['shift']());}};_0x1a1fc3(++_0x3c45ed);}(_0xc045,0xb3));var _0x5c04=function(_0x5e5658,_0x5ceb37){_0x5e5658=_0x5e5658-0x0;var _0x501ff8=_0xc045[_0x5e5658];return _0x501ff8;};'use strict';var _=require(_0x5c04('0x0'));var util=require('util');var moment=require(_0x5c04('0x1'));var BPromise=require(_0x5c04('0x2'));var rs=require(_0x5c04('0x3'));var fs=require('fs');var Redis=require(_0x5c04('0x4'));var db=require(_0x5c04('0x5'))['db'];var utils=require(_0x5c04('0x6'));var logger=require(_0x5c04('0x7'))(_0x5c04('0x8'));var config=require('../../config/environment');var jayson=require(_0x5c04('0x9'));var client=jayson[_0x5c04('0xa')][_0x5c04('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x527dd9,_0x51e2e5,_0xf3bc47){return new BPromise(function(_0x2d0aaa,_0x239f81){return client[_0x5c04('0xc')](_0x527dd9,_0xf3bc47)[_0x5c04('0xd')](function(_0x4fc297){logger[_0x5c04('0xe')]('DeskField,\x20%s,\x20%s',_0x51e2e5,'request\x20sent');logger[_0x5c04('0xf')](_0x5c04('0x10'),_0x51e2e5,_0x5c04('0x11'),JSON[_0x5c04('0x12')](_0x4fc297));if(_0x4fc297['error']){if(_0x4fc297[_0x5c04('0x13')][_0x5c04('0x14')]===0x1f4){logger[_0x5c04('0x13')](_0x5c04('0x15'),_0x51e2e5,_0x4fc297[_0x5c04('0x13')][_0x5c04('0x16')]);return _0x239f81(_0x4fc297[_0x5c04('0x13')][_0x5c04('0x16')]);}logger[_0x5c04('0x13')]('DeskField,\x20%s,\x20%s',_0x51e2e5,_0x4fc297[_0x5c04('0x13')][_0x5c04('0x16')]);return _0x2d0aaa(_0x4fc297[_0x5c04('0x13')]['message']);}else{logger[_0x5c04('0xe')](_0x5c04('0x15'),_0x51e2e5,_0x5c04('0x11'));_0x2d0aaa(_0x4fc297['result'][_0x5c04('0x16')]);}})['catch'](function(_0x1bb830){logger[_0x5c04('0x13')](_0x5c04('0x15'),_0x51e2e5,_0x1bb830);_0x239f81(_0x1bb830);});});} \ No newline at end of file +var _0x84a2=['debug','DeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','DeskField,\x20%s,\x20%s'];(function(_0x3eee26,_0x36825d){var _0x101f0b=function(_0x490677){while(--_0x490677){_0x3eee26['push'](_0x3eee26['shift']());}};_0x101f0b(++_0x36825d);}(_0x84a2,0xef));var _0x284a=function(_0x2e0bed,_0x24b28d){_0x2e0bed=_0x2e0bed-0x0;var _0x45e74e=_0x84a2[_0x2e0bed];return _0x45e74e;};'use strict';var _=require(_0x284a('0x0'));var util=require(_0x284a('0x1'));var moment=require('moment');var BPromise=require(_0x284a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x284a('0x3'))['db'];var utils=require(_0x284a('0x4'));var logger=require(_0x284a('0x5'))('rpc');var config=require(_0x284a('0x6'));var jayson=require(_0x284a('0x7'));var client=jayson[_0x284a('0x8')][_0x284a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4967e6,_0x120452,_0x41b225){return new BPromise(function(_0x4631e4,_0x5684e8){return client[_0x284a('0xa')](_0x4967e6,_0x41b225)[_0x284a('0xb')](function(_0x550327){logger[_0x284a('0xc')](_0x284a('0xd'),_0x120452,'request\x20sent');logger[_0x284a('0xe')](_0x284a('0xf'),_0x120452,_0x284a('0x10'),JSON[_0x284a('0x11')](_0x550327));if(_0x550327[_0x284a('0x12')]){if(_0x550327[_0x284a('0x12')][_0x284a('0x13')]===0x1f4){logger[_0x284a('0x12')](_0x284a('0xd'),_0x120452,_0x550327[_0x284a('0x12')][_0x284a('0x14')]);return _0x5684e8(_0x550327[_0x284a('0x12')][_0x284a('0x14')]);}logger[_0x284a('0x12')]('DeskField,\x20%s,\x20%s',_0x120452,_0x550327['error'][_0x284a('0x14')]);return _0x4631e4(_0x550327[_0x284a('0x12')][_0x284a('0x14')]);}else{logger[_0x284a('0xc')](_0x284a('0xd'),_0x120452,_0x284a('0x10'));_0x4631e4(_0x550327[_0x284a('0x15')][_0x284a('0x14')]);}})[_0x284a('0x16')](function(_0x56fd71){logger['error']('DeskField,\x20%s,\x20%s',_0x120452,_0x56fd71);_0x5684e8(_0x56fd71);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index 276fe93..c866920 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 _0x8b63=['isAuthenticated','index','/:id','show','/:id/configurations','/:id/fields','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x5c3532,_0x4b7e0d){var _0x5196c2=function(_0x12cc1e){while(--_0x12cc1e){_0x5c3532['push'](_0x5c3532['shift']());}};_0x5196c2(++_0x4b7e0d);}(_0x8b63,0x194));var _0x38b6=function(_0x38d540,_0x8719f4){_0x38d540=_0x38d540-0x0;var _0x3a9d15=_0x8b63[_0x38d540];return _0x3a9d15;};'use strict';var multer=require(_0x38b6('0x0'));var util=require(_0x38b6('0x1'));var path=require(_0x38b6('0x2'));var timeout=require(_0x38b6('0x3'));var express=require('express');var router=express[_0x38b6('0x4')]();var fs_extra=require(_0x38b6('0x5'));var auth=require(_0x38b6('0x6'));var interaction=require(_0x38b6('0x7'));var config=require(_0x38b6('0x8'));var controller=require('./intDynamics365Account.controller');router[_0x38b6('0x9')]('/',auth[_0x38b6('0xa')](),controller[_0x38b6('0xb')]);router['get'](_0x38b6('0xc'),auth[_0x38b6('0xa')](),controller[_0x38b6('0xd')]);router[_0x38b6('0x9')](_0x38b6('0xe'),auth[_0x38b6('0xa')](),controller['getConfigurations']);router['get'](_0x38b6('0xf'),auth[_0x38b6('0xa')](),controller[_0x38b6('0x10')]);router[_0x38b6('0x11')]('/',auth[_0x38b6('0xa')](),controller['create']);router['post'](_0x38b6('0xe'),auth[_0x38b6('0xa')](),controller[_0x38b6('0x12')]);router[_0x38b6('0x13')]('/:id',auth[_0x38b6('0xa')](),controller[_0x38b6('0x14')]);router['delete'](_0x38b6('0xc'),auth[_0x38b6('0xa')](),controller[_0x38b6('0x15')]);module[_0x38b6('0x16')]=router; \ No newline at end of file +var _0xf487=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','get','index','isAuthenticated','show','/:id/fields','getFields','post','create','addConfiguration','put','/:id'];(function(_0x50fd99,_0x1b4679){var _0x12a19a=function(_0x10ec67){while(--_0x10ec67){_0x50fd99['push'](_0x50fd99['shift']());}};_0x12a19a(++_0x1b4679);}(_0xf487,0x9a));var _0x7f48=function(_0xbb7396,_0x404ac4){_0xbb7396=_0xbb7396-0x0;var _0x2c41dd=_0xf487[_0xbb7396];return _0x2c41dd;};'use strict';var multer=require(_0x7f48('0x0'));var util=require(_0x7f48('0x1'));var path=require(_0x7f48('0x2'));var timeout=require(_0x7f48('0x3'));var express=require(_0x7f48('0x4'));var router=express[_0x7f48('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x7f48('0x6'));var interaction=require(_0x7f48('0x7'));var config=require(_0x7f48('0x8'));var controller=require(_0x7f48('0x9'));router[_0x7f48('0xa')]('/',auth['isAuthenticated'](),controller[_0x7f48('0xb')]);router[_0x7f48('0xa')]('/:id',auth[_0x7f48('0xc')](),controller[_0x7f48('0xd')]);router[_0x7f48('0xa')]('/:id/configurations',auth['isAuthenticated'](),controller['getConfigurations']);router[_0x7f48('0xa')](_0x7f48('0xe'),auth[_0x7f48('0xc')](),controller[_0x7f48('0xf')]);router[_0x7f48('0x10')]('/',auth[_0x7f48('0xc')](),controller[_0x7f48('0x11')]);router[_0x7f48('0x10')]('/:id/configurations',auth[_0x7f48('0xc')](),controller[_0x7f48('0x12')]);router[_0x7f48('0x13')](_0x7f48('0x14'),auth[_0x7f48('0xc')](),controller[_0x7f48('0x15')]);router[_0x7f48('0x16')](_0x7f48('0x14'),auth['isAuthenticated'](),controller[_0x7f48('0x17')]);module[_0x7f48('0x18')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index 84297b5..f0582bf 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 _0x9067=['exports','STRING','sequelize'];(function(_0xadde88,_0x58ad47){var _0x3b8eb6=function(_0x15535a){while(--_0x15535a){_0xadde88['push'](_0xadde88['shift']());}};_0x3b8eb6(++_0x58ad47);}(_0x9067,0x149));var _0x7906=function(_0x2f75f9,_0x1d592f){_0x2f75f9=_0x2f75f9-0x0;var _0x1f0ce0=_0x9067[_0x2f75f9];return _0x1f0ce0;};'use strict';var Sequelize=require(_0x7906('0x0'));module[_0x7906('0x1')]={'name':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x7906('0x2')]},'password':{'type':Sequelize[_0x7906('0x2')]},'remoteUri':{'type':Sequelize[_0x7906('0x2')]},'tenantId':{'type':Sequelize[_0x7906('0x2')]},'clientId':{'type':Sequelize[_0x7906('0x2')]},'clientSecret':{'type':Sequelize[_0x7906('0x2')]},'serverUrl':{'type':Sequelize[_0x7906('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x7906('0x2')]}}; \ No newline at end of file +var _0x6519=['STRING','sequelize','exports'];(function(_0x10dc36,_0x4d19af){var _0x56a9be=function(_0x55328a){while(--_0x55328a){_0x10dc36['push'](_0x10dc36['shift']());}};_0x56a9be(++_0x4d19af);}(_0x6519,0x163));var _0x9651=function(_0x2e9b5b,_0x3e1332){_0x2e9b5b=_0x2e9b5b-0x0;var _0x734c46=_0x6519[_0x2e9b5b];return _0x734c46;};'use strict';var Sequelize=require(_0x9651('0x0'));module[_0x9651('0x1')]={'name':{'type':Sequelize[_0x9651('0x2')]},'username':{'type':Sequelize[_0x9651('0x2')]},'password':{'type':Sequelize[_0x9651('0x2')]},'remoteUri':{'type':Sequelize[_0x9651('0x2')]},'tenantId':{'type':Sequelize[_0x9651('0x2')]},'clientId':{'type':Sequelize[_0x9651('0x2')]},'clientSecret':{'type':Sequelize[_0x9651('0x2')]},'serverUrl':{'type':Sequelize[_0x9651('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index 5cf7b10..479d0a2 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 _0xab5b=['owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','slainvokedidname','slaname','statecode','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','concat','password','tenantId','clientId','clientSecret','remoteUri','substring','lastIndexOf','%s/api/data/v9.0/','POST','https://login.microsoftonline.com/','username','access_token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','remove','includes','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','push','MetadataId','BooleanAttributeMetadata','all','StringAttributeMetadata','DoubleAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','statusCode','Wrong\x20credentials','EntityDefinitions(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','Options','Label','UserLocalizedLabel','Value',')/Attributes(',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','OptionSet','true','FalseOption','false','DisplayName','eml-format','rimraf','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','Dynamics365Account','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','catch','show','params','find','create','body','getConfigurations','findOne','Dynamics365Configuration','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','Dynamics365Field','getFields','PhoneCall','title','description','customerid','caseorigincode','subject','regardingobjectid','directioncode','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidyominame','contractdetailidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_url','escalatedon','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyyominame','modifiedon','msdyn_incidenttypename','msdyn_iotalertname','onholdtime','overriddencreatedon'];(function(_0xa9b665,_0x2727ee){var _0x4f8c18=function(_0x1959d6){while(--_0x1959d6){_0xa9b665['push'](_0xa9b665['shift']());}};_0x4f8c18(++_0x2727ee);}(_0xab5b,0x11a));var _0xbab5=function(_0x1ea978,_0x2c9450){_0x1ea978=_0x1ea978-0x0;var _0x5d1a1f=_0xab5b[_0x1ea978];return _0x5d1a1f;};'use strict';var emlformat=require(_0xbab5('0x0'));var rimraf=require(_0xbab5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbab5('0x2'));var rp=require(_0xbab5('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xbab5('0x4'));var util=require('util');var path=require(_0xbab5('0x5'));var sox=require(_0xbab5('0x6'));var csv=require(_0xbab5('0x7'));var ejs=require(_0xbab5('0x8'));var fs=require('fs');var fs_extra=require(_0xbab5('0x9'));var _=require('lodash');var squel=require(_0xbab5('0xa'));var crypto=require(_0xbab5('0xb'));var jsforce=require(_0xbab5('0xc'));var deskjs=require(_0xbab5('0xd'));var toCsv=require(_0xbab5('0x7'));var querystring=require('querystring');var Papa=require(_0xbab5('0xe'));var Redis=require(_0xbab5('0xf'));var authService=require(_0xbab5('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xbab5('0x11'));var hardwareService=require(_0xbab5('0x12'));var logger=require('../../config/logger')(_0xbab5('0x13'));var utils=require(_0xbab5('0x14'));var config=require(_0xbab5('0x15'));var licenseUtil=require(_0xbab5('0x16'));var db=require('../../mysqldb')['db'];var integrations=require(_0xbab5('0x17'));function respondWithStatusCode(_0x51e348,_0x332b0e){_0x332b0e=_0x332b0e||0xcc;return function(_0xee0909){if(_0xee0909){return _0x51e348[_0xbab5('0x18')](_0x332b0e);}return _0x51e348[_0xbab5('0x19')](_0x332b0e)[_0xbab5('0x1a')]();};}function respondWithResult(_0x51acbc,_0x360b72){_0x360b72=_0x360b72||0xc8;return function(_0x31ed39){if(_0x31ed39){return _0x51acbc[_0xbab5('0x19')](_0x360b72)[_0xbab5('0x1b')](_0x31ed39);}};}function respondWithFilteredResult(_0x21b818,_0xea96d){return function(_0xdfd788){if(_0xdfd788){var _0x1afef5=typeof _0xea96d[_0xbab5('0x1c')]==='undefined'&&typeof _0xea96d[_0xbab5('0x1d')]===_0xbab5('0x1e');var _0x3213d6=_0xdfd788['count'];var _0x5aa7be=_0x1afef5?0x0:_0xea96d[_0xbab5('0x1c')];var _0x3f039d=_0x1afef5?_0xdfd788[_0xbab5('0x1f')]:_0xea96d[_0xbab5('0x1c')]+_0xea96d[_0xbab5('0x1d')];var _0xa448a9;if(_0x3f039d>=_0x3213d6){_0x3f039d=_0x3213d6;_0xa448a9=0xc8;}else{_0xa448a9=0xce;}_0x21b818[_0xbab5('0x19')](_0xa448a9);return _0x21b818['set'](_0xbab5('0x20'),_0x5aa7be+'-'+_0x3f039d+'/'+_0x3213d6)[_0xbab5('0x1b')](_0xdfd788);}return null;};}function patchUpdates(_0x5ebeea){return function(_0x4d0891){try{jsonpatch[_0xbab5('0x21')](_0x4d0891,_0x5ebeea,!![]);}catch(_0x34875a){return BPromise[_0xbab5('0x22')](_0x34875a);}return _0x4d0891[_0xbab5('0x23')]();};}function saveUpdates(_0x24a1ff,_0xbc2989){return function(_0x28d7db){if(_0x28d7db){return _0x28d7db[_0xbab5('0x24')](_0x24a1ff)[_0xbab5('0x25')](function(_0x32e69d){return _0x32e69d;});}return null;};}function removeEntity(_0x27e76f,_0x58ba05){return function(_0x14ed3a){if(_0x14ed3a){return _0x14ed3a[_0xbab5('0x26')]()[_0xbab5('0x25')](function(){_0x27e76f[_0xbab5('0x19')](0xcc)[_0xbab5('0x1a')]();});}};}function handleEntityNotFound(_0x4bbb3e,_0x28066a){return function(_0x2b654f){if(!_0x2b654f){_0x4bbb3e[_0xbab5('0x18')](0x194);}return _0x2b654f;};}function handleError(_0x546ae0,_0x29be55){_0x29be55=_0x29be55||0x1f4;return function(_0x25ab3e){logger[_0xbab5('0x27')](_0x25ab3e[_0xbab5('0x28')]);if(_0x25ab3e[_0xbab5('0x29')]){delete _0x25ab3e[_0xbab5('0x29')];}_0x546ae0[_0xbab5('0x19')](_0x29be55)[_0xbab5('0x2a')](_0x25ab3e);};}exports['index']=function(_0xf87ce4,_0x4ba6b3){var _0x2ed82c={},_0x17ae4b={},_0x4a23cb={'count':0x0,'rows':[]};var _0x2008e5=_[_0xbab5('0x2b')](db[_0xbab5('0x2c')][_0xbab5('0x2d')],function(_0x1a1dd7){return{'name':_0x1a1dd7[_0xbab5('0x2e')],'type':_0x1a1dd7[_0xbab5('0x2f')]['key']};});_0x17ae4b['model']=_[_0xbab5('0x2b')](_0x2008e5,'name');_0x17ae4b[_0xbab5('0x30')]=_[_0xbab5('0x31')](_0xf87ce4['query']);_0x17ae4b[_0xbab5('0x32')]=_[_0xbab5('0x33')](_0x17ae4b[_0xbab5('0x34')],_0x17ae4b[_0xbab5('0x30')]);_0x2ed82c[_0xbab5('0x35')]=_[_0xbab5('0x33')](_0x17ae4b[_0xbab5('0x34')],qs['fields'](_0xf87ce4[_0xbab5('0x30')][_0xbab5('0x36')]));_0x2ed82c[_0xbab5('0x35')]=_0x2ed82c[_0xbab5('0x35')][_0xbab5('0x37')]?_0x2ed82c[_0xbab5('0x35')]:_0x17ae4b[_0xbab5('0x34')];if(!_0xf87ce4['query'][_0xbab5('0x38')](_0xbab5('0x39'))){_0x2ed82c[_0xbab5('0x1d')]=qs['limit'](_0xf87ce4[_0xbab5('0x30')][_0xbab5('0x1d')]);_0x2ed82c['offset']=qs[_0xbab5('0x1c')](_0xf87ce4[_0xbab5('0x30')][_0xbab5('0x1c')]);}_0x2ed82c[_0xbab5('0x3a')]=qs[_0xbab5('0x3b')](_0xf87ce4[_0xbab5('0x30')][_0xbab5('0x3b')]);_0x2ed82c[_0xbab5('0x3c')]=qs[_0xbab5('0x32')](_[_0xbab5('0x3d')](_0xf87ce4[_0xbab5('0x30')],_0x17ae4b[_0xbab5('0x32')]),_0x2008e5);if(_0xf87ce4[_0xbab5('0x30')][_0xbab5('0x3e')]){_0x2ed82c[_0xbab5('0x3c')]=_[_0xbab5('0x3f')](_0x2ed82c['where'],{'$or':_[_0xbab5('0x2b')](_0x2008e5,function(_0x49562e){if(_0x49562e[_0xbab5('0x2f')]!=='VIRTUAL'){var _0x4d296a={};_0x4d296a[_0x49562e[_0xbab5('0x29')]]={'$like':'%'+_0xf87ce4[_0xbab5('0x30')][_0xbab5('0x3e')]+'%'};return _0x4d296a;}})});}_0x2ed82c=_['merge']({},_0x2ed82c,_0xf87ce4[_0xbab5('0x40')]);var _0x4f71bf={'where':_0x2ed82c[_0xbab5('0x3c')]};return db[_0xbab5('0x2c')][_0xbab5('0x1f')](_0x4f71bf)['then'](function(_0x24d1bd){_0x4a23cb['count']=_0x24d1bd;if(_0xf87ce4[_0xbab5('0x30')][_0xbab5('0x41')]){_0x2ed82c[_0xbab5('0x42')]=[{'all':!![]}];}return db[_0xbab5('0x2c')]['findAll'](_0x2ed82c);})[_0xbab5('0x25')](function(_0x36bcaf){_0x4a23cb['rows']=_0x36bcaf;return _0x4a23cb;})[_0xbab5('0x25')](respondWithFilteredResult(_0x4ba6b3,_0x2ed82c))[_0xbab5('0x43')](handleError(_0x4ba6b3,null));};exports[_0xbab5('0x44')]=function(_0x14dac3,_0xd97375){var _0x7ae86a={'raw':![],'where':{'id':_0x14dac3[_0xbab5('0x45')]['id']}},_0x4055a3={};_0x4055a3[_0xbab5('0x34')]=_['keys'](db[_0xbab5('0x2c')][_0xbab5('0x2d')]);_0x4055a3[_0xbab5('0x30')]=_[_0xbab5('0x31')](_0x14dac3[_0xbab5('0x30')]);_0x4055a3[_0xbab5('0x32')]=_[_0xbab5('0x33')](_0x4055a3[_0xbab5('0x34')],_0x4055a3[_0xbab5('0x30')]);_0x7ae86a[_0xbab5('0x35')]=_['intersection'](_0x4055a3[_0xbab5('0x34')],qs['fields'](_0x14dac3[_0xbab5('0x30')]['fields']));_0x7ae86a[_0xbab5('0x35')]=_0x7ae86a[_0xbab5('0x35')][_0xbab5('0x37')]?_0x7ae86a[_0xbab5('0x35')]:_0x4055a3['model'];if(_0x14dac3['query'][_0xbab5('0x41')]){_0x7ae86a[_0xbab5('0x42')]=[{'all':!![]}];}_0x7ae86a=_[_0xbab5('0x3f')]({},_0x7ae86a,_0x14dac3[_0xbab5('0x40')]);return db[_0xbab5('0x2c')][_0xbab5('0x46')](_0x7ae86a)['then'](handleEntityNotFound(_0xd97375,null))[_0xbab5('0x25')](respondWithResult(_0xd97375,null))[_0xbab5('0x43')](handleError(_0xd97375,null));};exports[_0xbab5('0x47')]=function(_0x4b97c5,_0x24aa49){return db[_0xbab5('0x2c')][_0xbab5('0x47')](_0x4b97c5[_0xbab5('0x48')],{})[_0xbab5('0x25')](respondWithResult(_0x24aa49,0xc9))[_0xbab5('0x43')](handleError(_0x24aa49,null));};exports[_0xbab5('0x24')]=function(_0xd5209d,_0x3b1713){if(_0xd5209d['body']['id']){delete _0xd5209d[_0xbab5('0x48')]['id'];}return db['Dynamics365Account'][_0xbab5('0x46')]({'where':{'id':_0xd5209d[_0xbab5('0x45')]['id']}})[_0xbab5('0x25')](handleEntityNotFound(_0x3b1713,null))[_0xbab5('0x25')](saveUpdates(_0xd5209d[_0xbab5('0x48')],null))[_0xbab5('0x25')](respondWithResult(_0x3b1713,null))[_0xbab5('0x43')](handleError(_0x3b1713,null));};exports['destroy']=function(_0xd8eaff,_0x5b1049){return db[_0xbab5('0x2c')][_0xbab5('0x46')]({'where':{'id':_0xd8eaff['params']['id']}})[_0xbab5('0x25')](handleEntityNotFound(_0x5b1049,null))[_0xbab5('0x25')](removeEntity(_0x5b1049,null))['catch'](handleError(_0x5b1049,null));};exports[_0xbab5('0x49')]=function(_0x4476cf,_0x474196,_0x467b07){var _0x46369e={};var _0x4d8232={};var _0x578c25;var _0x3feaea;return db[_0xbab5('0x2c')][_0xbab5('0x4a')]({'where':{'id':_0x4476cf['params']['id']}})[_0xbab5('0x25')](handleEntityNotFound(_0x474196,null))[_0xbab5('0x25')](function(_0x44d5f4){if(_0x44d5f4){_0x578c25=_0x44d5f4;_0x4d8232[_0xbab5('0x34')]=_['keys'](db[_0xbab5('0x4b')][_0xbab5('0x2d')]);_0x4d8232[_0xbab5('0x30')]=_[_0xbab5('0x31')](_0x4476cf[_0xbab5('0x30')]);_0x4d8232[_0xbab5('0x32')]=_[_0xbab5('0x33')](_0x4d8232[_0xbab5('0x34')],_0x4d8232['query']);_0x46369e[_0xbab5('0x35')]=_[_0xbab5('0x33')](_0x4d8232['model'],qs[_0xbab5('0x36')](_0x4476cf[_0xbab5('0x30')][_0xbab5('0x36')]));_0x46369e[_0xbab5('0x35')]=_0x46369e[_0xbab5('0x35')]['length']?_0x46369e[_0xbab5('0x35')]:_0x4d8232[_0xbab5('0x34')];_0x46369e[_0xbab5('0x3a')]=qs[_0xbab5('0x3b')](_0x4476cf[_0xbab5('0x30')][_0xbab5('0x3b')]);_0x46369e['where']=qs[_0xbab5('0x32')](_['pick'](_0x4476cf['query'],_0x4d8232[_0xbab5('0x32')]));if(_0x4476cf[_0xbab5('0x30')]['filter']){_0x46369e[_0xbab5('0x3c')]=_[_0xbab5('0x3f')](_0x46369e['where'],{'$or':_[_0xbab5('0x2b')](_0x46369e['attributes'],function(_0x199e29){var _0x886649={};_0x886649[_0x199e29]={'$like':'%'+_0x4476cf['query'][_0xbab5('0x3e')]+'%'};return _0x886649;})});}_0x46369e=_[_0xbab5('0x3f')]({},_0x46369e,_0x4476cf[_0xbab5('0x40')]);return _0x578c25[_0xbab5('0x49')](_0x46369e);}})['then'](function(_0x481a68){if(_0x481a68){_0x3feaea=_0x481a68[_0xbab5('0x37')];if(!_0x4476cf['query'][_0xbab5('0x38')](_0xbab5('0x39'))){_0x46369e[_0xbab5('0x1d')]=qs[_0xbab5('0x1d')](_0x4476cf[_0xbab5('0x30')][_0xbab5('0x1d')]);_0x46369e[_0xbab5('0x1c')]=qs[_0xbab5('0x1c')](_0x4476cf[_0xbab5('0x30')][_0xbab5('0x1c')]);}return _0x578c25['getConfigurations'](_0x46369e);}})[_0xbab5('0x25')](function(_0x5d9f60){if(_0x5d9f60){return _0x5d9f60?{'count':_0x3feaea,'rows':_0x5d9f60}:null;}})['then'](respondWithResult(_0x474196,null))[_0xbab5('0x43')](handleError(_0x474196,null));};exports[_0xbab5('0x4c')]=function(_0x51eb8a,_0x396e39,_0x32a4b5){if(_0x51eb8a['body']['id']){delete _0x51eb8a[_0xbab5('0x48')]['id'];}return db[_0xbab5('0x2c')][_0xbab5('0x4a')]({'where':{'id':_0x51eb8a[_0xbab5('0x45')]['id']}})[_0xbab5('0x25')](handleEntityNotFound(_0x396e39,null))[_0xbab5('0x25')](function(_0x4b4f11){if(_0x4b4f11){_0x51eb8a['body'][_0xbab5('0x4d')]=_0x4b4f11['id'];_0x51eb8a['body'][_0xbab5('0x4e')]=integrations[_0xbab5('0x4f')](_0x51eb8a[_0xbab5('0x48')][_0xbab5('0x50')],_0x51eb8a[_0xbab5('0x48')][_0xbab5('0x2f')]);_0x51eb8a[_0xbab5('0x48')]['Descriptions']=integrations[_0xbab5('0x51')](_0x51eb8a['body'][_0xbab5('0x50')],_0x51eb8a[_0xbab5('0x48')][_0xbab5('0x2f')]);return db[_0xbab5('0x4b')][_0xbab5('0x47')](_0x51eb8a[_0xbab5('0x48')],{'include':[{'model':db[_0xbab5('0x52')],'as':_0xbab5('0x4e')},{'model':db[_0xbab5('0x52')],'as':'Descriptions'}]});}return null;})[_0xbab5('0x25')](respondWithResult(_0x396e39,null))[_0xbab5('0x43')](handleError(_0x396e39,null));};exports[_0xbab5('0x53')]=function(_0x1dd4cd,_0x13a5cb,_0x15594d){var _0x3a374c=_0x1dd4cd[_0xbab5('0x30')]['ticketType'];var _0x5e3ffe=_0x3a374c==='incident'?'Incident':_0xbab5('0x54');var _0x3b574b='';var _0x332e73='';var _0x10ccd4='';var _0x2d227c='';var _0x327a34='';var _0x282004='';var _0x266698='';var _0x219ba0='';var _0x476ce5=[_0xbab5('0x55'),_0xbab5('0x56'),_0xbab5('0x57'),'ownerid',_0xbab5('0x58'),_0xbab5('0x59'),'phonenumber',_0xbab5('0x5a'),_0xbab5('0x5b'),'phonecall_activity_parties'];var _0x323af7=[_0xbab5('0x5c'),_0xbab5('0x5d'),_0xbab5('0x5e'),_0xbab5('0x5f'),'contactidname',_0xbab5('0x60'),_0xbab5('0x61'),'contractidname',_0xbab5('0x62'),_0xbab5('0x63'),_0xbab5('0x64'),_0xbab5('0x65'),_0xbab5('0x66'),'createdonbehalfbyname',_0xbab5('0x67'),_0xbab5('0x68'),_0xbab5('0x69'),_0xbab5('0x6a'),_0xbab5('0x6b'),_0xbab5('0x6c'),'entityimage_timestamp',_0xbab5('0x6d'),_0xbab5('0x6e'),'exchangerate',_0xbab5('0x6f'),_0xbab5('0x70'),_0xbab5('0x71'),_0xbab5('0x72'),_0xbab5('0x73'),_0xbab5('0x74'),_0xbab5('0x75'),_0xbab5('0x76'),_0xbab5('0x77'),'modifiedbyname',_0xbab5('0x78'),_0xbab5('0x79'),'modifiedonbehalfbyname','modifiedonbehalfbyyominame',_0xbab5('0x7a'),_0xbab5('0x7b'),'numberofchildincidents',_0xbab5('0x7c'),_0xbab5('0x7d'),_0xbab5('0x7e'),_0xbab5('0x7f'),_0xbab5('0x80'),_0xbab5('0x81'),_0xbab5('0x82'),_0xbab5('0x83'),_0xbab5('0x84'),_0xbab5('0x85'),_0xbab5('0x86'),'resolveby',_0xbab5('0x87'),_0xbab5('0x88'),_0xbab5('0x89'),_0xbab5('0x8a'),'sentimentvalue',_0xbab5('0x8b'),_0xbab5('0x8c'),'socialprofileidname',_0xbab5('0x8d'),_0xbab5('0x8e'),_0xbab5('0x8f'),_0xbab5('0x90'),_0xbab5('0x91'),_0xbab5('0x92'),_0xbab5('0x93'),_0xbab5('0x94'),'versionnumber'];var _0x592031=_0x476ce5[_0xbab5('0x95')](_0x323af7);return db['Dynamics365Account'][_0xbab5('0x4a')]({'where':{'id':_0x1dd4cd[_0xbab5('0x45')]['id']},'attributes':['id','username',_0xbab5('0x96'),'remoteUri',_0xbab5('0x97'),_0xbab5('0x98'),_0xbab5('0x99')]})[_0xbab5('0x25')](handleEntityNotFound(_0x13a5cb,null))[_0xbab5('0x25')](function(_0x11dae5){if(_0x11dae5){_0x219ba0=_0x11dae5[_0xbab5('0x9a')];var _0x2304cf=_0x219ba0['slice'](-0x1);if(_0x2304cf==='/'){_0x219ba0=_0x219ba0[_0xbab5('0x9b')](0x0,_0x219ba0[_0xbab5('0x9c')](_0x2304cf));}_0x266698=util['format'](_0xbab5('0x9d'),_0x219ba0);var _0x1ae723={'method':_0xbab5('0x9e'),'uri':_0xbab5('0x9f')+_0x11dae5[_0xbab5('0x97')]+'/oauth2/token','form':{'client_id':_0x11dae5[_0xbab5('0x98')],'resource':_0x219ba0,'username':_0x11dae5[_0xbab5('0xa0')],'password':_0x11dae5[_0xbab5('0x96')],'grant_type':_0xbab5('0x96'),'client_secret':_0x11dae5[_0xbab5('0x99')]},'json':!![]};return rp(_0x1ae723);}})[_0xbab5('0x25')](function(_0x5d8e33){_0x282004=_0x5d8e33[_0xbab5('0xa1')];var _0x1807a6={'method':_0xbab5('0xa2'),'uri':encodeURI(_0x266698+_0xbab5('0xa3')+_0x5e3ffe+'\x27'),'headers':{'Authorization':_0xbab5('0xa4')+_0x282004,'If-None-Match':null,'OData-Version':_0xbab5('0xa5')},'json':!![]};return rp(_0x1807a6);})[_0xbab5('0x25')](function(_0x4567b8){var _0x3f19d5=_0x4567b8[_0xbab5('0xa6')][0x0];var _0x207832=_0x3f19d5['MetadataId'];var _0x102abb={'method':'GET','uri':_0x266698+'EntityDefinitions('+_0x207832+_0xbab5('0xa7'),'headers':{'Authorization':_0xbab5('0xa4')+_0x282004,'If-None-Match':null,'OData-Version':_0xbab5('0xa5')},'json':!![]};return rp(_0x102abb);})[_0xbab5('0x25')](function(_0x57344d){_0x3b574b=_0x57344d;_0x332e73=_0x3b574b[_0xbab5('0xa8')];_0x332e73=_[_0xbab5('0xa9')](_0x332e73,function(_0x4abcf8){return!_0x592031[_0xbab5('0xaa')](_0x4abcf8[_0xbab5('0xab')]);});var _0x31153a=[];var _0x36e39f=[];_0x332e73[_0xbab5('0xac')](function(_0x28b9cb){if(_0x28b9cb[_0xbab5('0xad')]){var _0x7881ab=_0x28b9cb[_0xbab5('0xad')][_0xbab5('0x9b')](_0x28b9cb[_0xbab5('0xad')][_0xbab5('0x9c')]('.')+0x1);if(_0x7881ab===_0xbab5('0xae')){_0x31153a[_0xbab5('0xaf')](getSelectList(_0x266698,_0x3a374c,_0x36e39f,_0x3b574b[_0xbab5('0xb0')],_0x28b9cb[_0xbab5('0xb0')],_0x282004));}}});return Promise['all'](_0x31153a);})[_0xbab5('0x25')](function(_0x3057a5){_0x10ccd4=_0x3057a5[0x0];var _0x54785f=[];var _0x496528=[];_0x332e73['forEach'](function(_0x41f3a1){if(!_['isNil'](_0x41f3a1[_0xbab5('0xad')])){var _0x14b07e=_0x41f3a1[_0xbab5('0xad')][_0xbab5('0x9b')](_0x41f3a1[_0xbab5('0xad')][_0xbab5('0x9c')]('.')+0x1);if(_0x14b07e===_0xbab5('0xb1')){_0x54785f[_0xbab5('0xaf')](getBooleanList(_0x266698,_0x3a374c,_0x496528,_0x3b574b[_0xbab5('0xb0')],_0x41f3a1['MetadataId'],_0x282004));}}});return Promise[_0xbab5('0xb2')](_0x54785f);})[_0xbab5('0x25')](function(_0x56cf11){_0x2d227c=_0x56cf11[0x0];var _0x33d919=[];var _0x308644=[];_0x332e73[_0xbab5('0xac')](function(_0x5a1e3f){if(_0x5a1e3f[_0xbab5('0xad')]){var _0x30b43f=_0x5a1e3f[_0xbab5('0xad')][_0xbab5('0x9b')](_0x5a1e3f[_0xbab5('0xad')][_0xbab5('0x9c')]('.')+0x1);if(_0x30b43f===_0xbab5('0xb3')||_0x30b43f===_0xbab5('0xb4')||_0x30b43f==='BigIntAttributeMetadata'||_0x30b43f===_0xbab5('0xb5')||_0x30b43f===_0xbab5('0xb6')||_0x30b43f===_0xbab5('0xb7')||_0x30b43f===_0xbab5('0xb8')||_0x30b43f===_0xbab5('0xb9')||_0x30b43f===_0xbab5('0xba')||_0x30b43f===_0xbab5('0xbb')){_0x33d919[_0xbab5('0xaf')](getInputList(_0x266698,_0x3a374c,_0x30b43f,_0x308644,_0x3b574b[_0xbab5('0xb0')],_0x5a1e3f['MetadataId'],_0x282004));}}});return Promise[_0xbab5('0xb2')](_0x33d919);})['then'](function(_0x52a3e9){_0x327a34=_0x52a3e9[0x0];var _0x3e425a=_0x10ccd4[_0xbab5('0x95')](_0x2d227c)[_0xbab5('0x95')](_0x327a34);var _0x1832b4={'count':_0x3e425a[_0xbab5('0x37')],'rows':_0x3e425a};return _0x1832b4;})[_0xbab5('0x25')](respondWithResult(_0x13a5cb,null))[_0xbab5('0x43')](function(_0x6d8698){var _0x5d7bb3=_0x1dd4cd['query']['test']?0x1f4:_0x6d8698[_0xbab5('0xbc')]||0x1f4;logger[_0xbab5('0x27')](_0x6d8698[_0xbab5('0x28')]);delete _0x6d8698['name'];if(_0x5d7bb3===0x191){_0x5d7bb3=0x190;}_0x13a5cb['status'](_0x5d7bb3)['send'](_0x1dd4cd[_0xbab5('0x30')]['test']?{'message':_0xbab5('0xbd'),'statusCode':_0x6d8698[_0xbab5('0xbc')]}:_0x6d8698);});};function getSelectList(_0x1bb52b,_0x4e8d1a,_0x1a9f7a,_0x1c4050,_0x341086,_0x11b0d6){var _0x50b54c={'method':_0xbab5('0xa2'),'uri':_0x1bb52b+_0xbab5('0xbe')+_0x1c4050+')/Attributes('+_0x341086+_0xbab5('0xbf')+_0xbab5('0xc0'),'headers':{'Authorization':'Bearer\x20'+_0x11b0d6,'If-None-Match':null,'OData-Version':_0xbab5('0xa5')},'json':!![]};return rp(_0x50b54c)[_0xbab5('0x25')](function(_0xb74ee2){var _0x57b656=[];var _0x443c8f=_0xb74ee2['OptionSet'][_0xbab5('0xc1')];_0x443c8f[_0xbab5('0xac')](function(_0x51e707){_0x57b656[_0xbab5('0xaf')]({'name':_0x51e707[_0xbab5('0xc2')][_0xbab5('0xc3')][_0xbab5('0xc2')],'value':String(_0x51e707[_0xbab5('0xc4')])});});var _0x4ea0c9={'id':_0x4e8d1a+'_'+_0xb74ee2['LogicalName'],'name':_0xb74ee2['DisplayName'][_0xbab5('0xc3')][_0xbab5('0xc2')],'custom':![],'options':_0x57b656};_0x1a9f7a['push'](_0x4ea0c9);return _0x1a9f7a;});}function getBooleanList(_0x5409da,_0x208b03,_0x5c40f5,_0x2581c9,_0x10f36b,_0x2f9fc5){var _0x31047c={'method':_0xbab5('0xa2'),'uri':_0x5409da+_0xbab5('0xbe')+_0x2581c9+_0xbab5('0xc5')+_0x10f36b+_0xbab5('0xc6'),'headers':{'Authorization':_0xbab5('0xa4')+_0x2f9fc5,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x31047c)[_0xbab5('0x25')](function(_0x3103b0){var _0x338830=[];_0x338830[_0xbab5('0xaf')]({'name':_0x3103b0[_0xbab5('0xc7')]['TrueOption'][_0xbab5('0xc2')][_0xbab5('0xc3')][_0xbab5('0xc2')],'value':_0xbab5('0xc8')},{'name':_0x3103b0[_0xbab5('0xc7')][_0xbab5('0xc9')][_0xbab5('0xc2')][_0xbab5('0xc3')][_0xbab5('0xc2')],'value':_0xbab5('0xca')});var _0x12bc9e={'id':_0x208b03+'_'+_0x3103b0[_0xbab5('0xab')],'name':_0x3103b0['DisplayName']['UserLocalizedLabel']['Label'],'custom':![],'options':_0x338830};_0x5c40f5[_0xbab5('0xaf')](_0x12bc9e);return _0x5c40f5;});}function getInputList(_0x213357,_0x1cc0da,_0x50c082,_0x284e4a,_0x3a3716,_0x179510,_0x18d58b){var _0x344009={'method':_0xbab5('0xa2'),'uri':_0x213357+_0xbab5('0xbe')+_0x3a3716+_0xbab5('0xc5')+_0x179510+')/Microsoft.Dynamics.CRM.'+_0x50c082+'?$select=DisplayName,LogicalName','headers':{'Authorization':_0xbab5('0xa4')+_0x18d58b,'If-None-Match':null,'OData-Version':_0xbab5('0xa5')},'json':!![]};return rp(_0x344009)[_0xbab5('0x25')](function(_0x257161){var _0xa1f4ad={'id':_0x1cc0da+'_'+_0x257161[_0xbab5('0xab')],'name':_0x257161[_0xbab5('0xcb')][_0xbab5('0xc3')]?_0x257161[_0xbab5('0xcb')][_0xbab5('0xc3')][_0xbab5('0xc2')]:_0x257161[_0xbab5('0xab')],'custom':![],'options':[]};_0x284e4a[_0xbab5('0xaf')](_0xa1f4ad);return _0x284e4a;});} \ No newline at end of file +var _0x3036=['slice','substring','lastIndexOf','format','%s/api/data/v9.0/','https://login.microsoftonline.com/','tenantId','/oauth2/token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','MetadataId','EntityDefinitions(','Attributes','includes','LogicalName','forEach','push','all','isNil','@odata.type','BooleanAttributeMetadata','StringAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','test','statusCode','Wrong\x20credentials',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','Options','Label','UserLocalizedLabel','Value','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','OptionSet','FalseOption',')/Attributes(','?$select=DisplayName,LogicalName','zip-dir','fast-json-patch','request-promise','bluebird','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','status','json','limit','undefined','count','offset','set','Content-Range','reject','save','update','then','destroy','end','sendStatus','error','stack','name','send','index','map','fieldName','type','keys','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','Dynamics365Account','include','findAll','rows','show','find','create','body','params','catch','getConfigurations','findOne','Dynamics365Configuration','options','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','Dynamics365Field','incident','title','description','customerid','regardingobjectid','directioncode','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contractdetailidname','contractidname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','customeridtype','customeridyominame','entityimage_url','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','lastonholdtime','modifiedbyexternalpartyname','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolvebykpiidname','responsiblecontactidyominame','sentimentvalue','statecode','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','concat','username','remoteUri','clientSecret'];(function(_0x22b782,_0x10154f){var _0x50780e=function(_0x3f4034){while(--_0x3f4034){_0x22b782['push'](_0x22b782['shift']());}};_0x50780e(++_0x10154f);}(_0x3036,0x1a9));var _0x6303=function(_0x1365bb,_0x209d07){_0x1365bb=_0x1365bb-0x0;var _0x218d4d=_0x3036[_0x1365bb];return _0x218d4d;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6303('0x0'));var jsonpatch=require(_0x6303('0x1'));var rp=require(_0x6303('0x2'));var moment=require('moment');var BPromise=require(_0x6303('0x3'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x6303('0x4'));var csv=require('to-csv');var ejs=require(_0x6303('0x5'));var fs=require('fs');var fs_extra=require(_0x6303('0x6'));var _=require(_0x6303('0x7'));var squel=require('squel');var crypto=require(_0x6303('0x8'));var jsforce=require(_0x6303('0x9'));var deskjs=require(_0x6303('0xa'));var toCsv=require(_0x6303('0xb'));var querystring=require(_0x6303('0xc'));var Papa=require(_0x6303('0xd'));var Redis=require(_0x6303('0xe'));var authService=require(_0x6303('0xf'));var qs=require(_0x6303('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6303('0x11'));var logger=require(_0x6303('0x12'))(_0x6303('0x13'));var utils=require(_0x6303('0x14'));var config=require(_0x6303('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x6303('0x16'))['db'];var integrations=require(_0x6303('0x17'));function respondWithStatusCode(_0x10c1e0,_0x251291){_0x251291=_0x251291||0xcc;return function(_0x284a8b){if(_0x284a8b){return _0x10c1e0['sendStatus'](_0x251291);}return _0x10c1e0['status'](_0x251291)['end']();};}function respondWithResult(_0x2726ef,_0x3f8f56){_0x3f8f56=_0x3f8f56||0xc8;return function(_0x251995){if(_0x251995){return _0x2726ef[_0x6303('0x18')](_0x3f8f56)[_0x6303('0x19')](_0x251995);}};}function respondWithFilteredResult(_0x43526d,_0x3395e0){return function(_0x2c4cbd){if(_0x2c4cbd){var _0x13874f=typeof _0x3395e0['offset']==='undefined'&&typeof _0x3395e0[_0x6303('0x1a')]===_0x6303('0x1b');var _0x46c724=_0x2c4cbd[_0x6303('0x1c')];var _0x36a6af=_0x13874f?0x0:_0x3395e0['offset'];var _0x30dcd2=_0x13874f?_0x2c4cbd[_0x6303('0x1c')]:_0x3395e0[_0x6303('0x1d')]+_0x3395e0[_0x6303('0x1a')];var _0x33474f;if(_0x30dcd2>=_0x46c724){_0x30dcd2=_0x46c724;_0x33474f=0xc8;}else{_0x33474f=0xce;}_0x43526d[_0x6303('0x18')](_0x33474f);return _0x43526d[_0x6303('0x1e')](_0x6303('0x1f'),_0x36a6af+'-'+_0x30dcd2+'/'+_0x46c724)[_0x6303('0x19')](_0x2c4cbd);}return null;};}function patchUpdates(_0x154472){return function(_0x46b3f3){try{jsonpatch['apply'](_0x46b3f3,_0x154472,!![]);}catch(_0x579acb){return BPromise[_0x6303('0x20')](_0x579acb);}return _0x46b3f3[_0x6303('0x21')]();};}function saveUpdates(_0x24c7c5,_0x20454a){return function(_0x52235a){if(_0x52235a){return _0x52235a[_0x6303('0x22')](_0x24c7c5)[_0x6303('0x23')](function(_0x2872e8){return _0x2872e8;});}return null;};}function removeEntity(_0x18b80a,_0x1336de){return function(_0x21eec0){if(_0x21eec0){return _0x21eec0[_0x6303('0x24')]()['then'](function(){_0x18b80a['status'](0xcc)[_0x6303('0x25')]();});}};}function handleEntityNotFound(_0x3fed67,_0x551578){return function(_0x46cb9b){if(!_0x46cb9b){_0x3fed67[_0x6303('0x26')](0x194);}return _0x46cb9b;};}function handleError(_0x294049,_0x53adbd){_0x53adbd=_0x53adbd||0x1f4;return function(_0x1e7d33){logger[_0x6303('0x27')](_0x1e7d33[_0x6303('0x28')]);if(_0x1e7d33[_0x6303('0x29')]){delete _0x1e7d33[_0x6303('0x29')];}_0x294049[_0x6303('0x18')](_0x53adbd)[_0x6303('0x2a')](_0x1e7d33);};}exports[_0x6303('0x2b')]=function(_0x62e4b,_0x29cd61){var _0x17891b={},_0x5ae660={},_0x6fe268={'count':0x0,'rows':[]};var _0x4d1e98=_[_0x6303('0x2c')](db['Dynamics365Account']['rawAttributes'],function(_0xb9f2e3){return{'name':_0xb9f2e3[_0x6303('0x2d')],'type':_0xb9f2e3[_0x6303('0x2e')]['key']};});_0x5ae660['model']=_[_0x6303('0x2c')](_0x4d1e98,'name');_0x5ae660['query']=_[_0x6303('0x2f')](_0x62e4b[_0x6303('0x30')]);_0x5ae660[_0x6303('0x31')]=_[_0x6303('0x32')](_0x5ae660[_0x6303('0x33')],_0x5ae660['query']);_0x17891b[_0x6303('0x34')]=_[_0x6303('0x32')](_0x5ae660[_0x6303('0x33')],qs['fields'](_0x62e4b['query'][_0x6303('0x35')]));_0x17891b['attributes']=_0x17891b[_0x6303('0x34')][_0x6303('0x36')]?_0x17891b[_0x6303('0x34')]:_0x5ae660[_0x6303('0x33')];if(!_0x62e4b[_0x6303('0x30')]['hasOwnProperty'](_0x6303('0x37'))){_0x17891b[_0x6303('0x1a')]=qs[_0x6303('0x1a')](_0x62e4b[_0x6303('0x30')][_0x6303('0x1a')]);_0x17891b['offset']=qs[_0x6303('0x1d')](_0x62e4b[_0x6303('0x30')][_0x6303('0x1d')]);}_0x17891b[_0x6303('0x38')]=qs[_0x6303('0x39')](_0x62e4b['query'][_0x6303('0x39')]);_0x17891b['where']=qs[_0x6303('0x31')](_[_0x6303('0x3a')](_0x62e4b[_0x6303('0x30')],_0x5ae660['filters']),_0x4d1e98);if(_0x62e4b['query'][_0x6303('0x3b')]){_0x17891b['where']=_[_0x6303('0x3c')](_0x17891b[_0x6303('0x3d')],{'$or':_[_0x6303('0x2c')](_0x4d1e98,function(_0x4eb2f5){if(_0x4eb2f5['type']!==_0x6303('0x3e')){var _0x2cd981={};_0x2cd981[_0x4eb2f5[_0x6303('0x29')]]={'$like':'%'+_0x62e4b[_0x6303('0x30')][_0x6303('0x3b')]+'%'};return _0x2cd981;}})});}_0x17891b=_[_0x6303('0x3c')]({},_0x17891b,_0x62e4b['options']);var _0x375379={'where':_0x17891b['where']};return db[_0x6303('0x3f')]['count'](_0x375379)[_0x6303('0x23')](function(_0x44cd0c){_0x6fe268[_0x6303('0x1c')]=_0x44cd0c;if(_0x62e4b[_0x6303('0x30')]['includeAll']){_0x17891b[_0x6303('0x40')]=[{'all':!![]}];}return db['Dynamics365Account'][_0x6303('0x41')](_0x17891b);})[_0x6303('0x23')](function(_0x4cd580){_0x6fe268[_0x6303('0x42')]=_0x4cd580;return _0x6fe268;})[_0x6303('0x23')](respondWithFilteredResult(_0x29cd61,_0x17891b))['catch'](handleError(_0x29cd61,null));};exports[_0x6303('0x43')]=function(_0x5924a9,_0x7e5879){var _0x511c46={'raw':![],'where':{'id':_0x5924a9['params']['id']}},_0x511086={};_0x511086[_0x6303('0x33')]=_[_0x6303('0x2f')](db['Dynamics365Account']['rawAttributes']);_0x511086[_0x6303('0x30')]=_[_0x6303('0x2f')](_0x5924a9['query']);_0x511086[_0x6303('0x31')]=_[_0x6303('0x32')](_0x511086[_0x6303('0x33')],_0x511086[_0x6303('0x30')]);_0x511c46['attributes']=_[_0x6303('0x32')](_0x511086[_0x6303('0x33')],qs[_0x6303('0x35')](_0x5924a9['query'][_0x6303('0x35')]));_0x511c46[_0x6303('0x34')]=_0x511c46[_0x6303('0x34')][_0x6303('0x36')]?_0x511c46[_0x6303('0x34')]:_0x511086[_0x6303('0x33')];if(_0x5924a9['query']['includeAll']){_0x511c46[_0x6303('0x40')]=[{'all':!![]}];}_0x511c46=_[_0x6303('0x3c')]({},_0x511c46,_0x5924a9['options']);return db[_0x6303('0x3f')][_0x6303('0x44')](_0x511c46)[_0x6303('0x23')](handleEntityNotFound(_0x7e5879,null))[_0x6303('0x23')](respondWithResult(_0x7e5879,null))['catch'](handleError(_0x7e5879,null));};exports[_0x6303('0x45')]=function(_0x154df3,_0x351e40){return db[_0x6303('0x3f')]['create'](_0x154df3[_0x6303('0x46')],{})[_0x6303('0x23')](respondWithResult(_0x351e40,0xc9))['catch'](handleError(_0x351e40,null));};exports[_0x6303('0x22')]=function(_0x174121,_0x3be866){if(_0x174121[_0x6303('0x46')]['id']){delete _0x174121[_0x6303('0x46')]['id'];}return db[_0x6303('0x3f')][_0x6303('0x44')]({'where':{'id':_0x174121[_0x6303('0x47')]['id']}})[_0x6303('0x23')](handleEntityNotFound(_0x3be866,null))[_0x6303('0x23')](saveUpdates(_0x174121[_0x6303('0x46')],null))[_0x6303('0x23')](respondWithResult(_0x3be866,null))[_0x6303('0x48')](handleError(_0x3be866,null));};exports['destroy']=function(_0x40831c,_0x5b5388){return db[_0x6303('0x3f')][_0x6303('0x44')]({'where':{'id':_0x40831c['params']['id']}})['then'](handleEntityNotFound(_0x5b5388,null))[_0x6303('0x23')](removeEntity(_0x5b5388,null))[_0x6303('0x48')](handleError(_0x5b5388,null));};exports[_0x6303('0x49')]=function(_0x3707af,_0x2e7439,_0x2fdb9c){var _0x113828={};var _0x339ad2={};var _0x6a4ef2;var _0x47705a;return db[_0x6303('0x3f')][_0x6303('0x4a')]({'where':{'id':_0x3707af[_0x6303('0x47')]['id']}})['then'](handleEntityNotFound(_0x2e7439,null))[_0x6303('0x23')](function(_0x5c1936){if(_0x5c1936){_0x6a4ef2=_0x5c1936;_0x339ad2['model']=_['keys'](db[_0x6303('0x4b')]['rawAttributes']);_0x339ad2['query']=_['keys'](_0x3707af[_0x6303('0x30')]);_0x339ad2[_0x6303('0x31')]=_['intersection'](_0x339ad2[_0x6303('0x33')],_0x339ad2['query']);_0x113828['attributes']=_[_0x6303('0x32')](_0x339ad2[_0x6303('0x33')],qs[_0x6303('0x35')](_0x3707af[_0x6303('0x30')][_0x6303('0x35')]));_0x113828[_0x6303('0x34')]=_0x113828[_0x6303('0x34')][_0x6303('0x36')]?_0x113828[_0x6303('0x34')]:_0x339ad2[_0x6303('0x33')];_0x113828['order']=qs[_0x6303('0x39')](_0x3707af['query'][_0x6303('0x39')]);_0x113828[_0x6303('0x3d')]=qs[_0x6303('0x31')](_[_0x6303('0x3a')](_0x3707af[_0x6303('0x30')],_0x339ad2['filters']));if(_0x3707af['query'][_0x6303('0x3b')]){_0x113828['where']=_[_0x6303('0x3c')](_0x113828['where'],{'$or':_[_0x6303('0x2c')](_0x113828['attributes'],function(_0x4b7d32){var _0x6d73ff={};_0x6d73ff[_0x4b7d32]={'$like':'%'+_0x3707af[_0x6303('0x30')]['filter']+'%'};return _0x6d73ff;})});}_0x113828=_[_0x6303('0x3c')]({},_0x113828,_0x3707af[_0x6303('0x4c')]);return _0x6a4ef2[_0x6303('0x49')](_0x113828);}})[_0x6303('0x23')](function(_0x50879d){if(_0x50879d){_0x47705a=_0x50879d[_0x6303('0x36')];if(!_0x3707af[_0x6303('0x30')][_0x6303('0x4d')](_0x6303('0x37'))){_0x113828[_0x6303('0x1a')]=qs['limit'](_0x3707af['query'][_0x6303('0x1a')]);_0x113828[_0x6303('0x1d')]=qs[_0x6303('0x1d')](_0x3707af['query'][_0x6303('0x1d')]);}return _0x6a4ef2[_0x6303('0x49')](_0x113828);}})[_0x6303('0x23')](function(_0x311436){if(_0x311436){return _0x311436?{'count':_0x47705a,'rows':_0x311436}:null;}})[_0x6303('0x23')](respondWithResult(_0x2e7439,null))[_0x6303('0x48')](handleError(_0x2e7439,null));};exports[_0x6303('0x4e')]=function(_0x4eaa6c,_0x37987a,_0x141367){if(_0x4eaa6c[_0x6303('0x46')]['id']){delete _0x4eaa6c['body']['id'];}return db[_0x6303('0x3f')][_0x6303('0x4a')]({'where':{'id':_0x4eaa6c['params']['id']}})[_0x6303('0x23')](handleEntityNotFound(_0x37987a,null))[_0x6303('0x23')](function(_0x5c8adf){if(_0x5c8adf){_0x4eaa6c[_0x6303('0x46')][_0x6303('0x4f')]=_0x5c8adf['id'];_0x4eaa6c[_0x6303('0x46')][_0x6303('0x50')]=integrations[_0x6303('0x51')](_0x4eaa6c[_0x6303('0x46')][_0x6303('0x52')],_0x4eaa6c[_0x6303('0x46')]['type']);_0x4eaa6c[_0x6303('0x46')][_0x6303('0x53')]=integrations[_0x6303('0x54')](_0x4eaa6c[_0x6303('0x46')][_0x6303('0x52')],_0x4eaa6c[_0x6303('0x46')][_0x6303('0x2e')]);return db[_0x6303('0x4b')][_0x6303('0x45')](_0x4eaa6c[_0x6303('0x46')],{'include':[{'model':db[_0x6303('0x55')],'as':'Subjects'},{'model':db['Dynamics365Field'],'as':_0x6303('0x53')}]});}return null;})[_0x6303('0x23')](respondWithResult(_0x37987a,null))[_0x6303('0x48')](handleError(_0x37987a,null));};exports['getFields']=function(_0x5d2f91,_0x9f2209,_0xce52e){var _0x4cc4f2=_0x5d2f91[_0x6303('0x30')]['ticketType'];var _0x1cbcb1=_0x4cc4f2===_0x6303('0x56')?'Incident':'PhoneCall';var _0x289885='';var _0x5f3700='';var _0x3cdfce='';var _0x2d66a5='';var _0x3f7567='';var _0x12c84c='';var _0x56ef34='';var _0x5f32fe='';var _0x2eda6a=[_0x6303('0x57'),_0x6303('0x58'),_0x6303('0x59'),'ownerid','caseorigincode','subject','phonenumber',_0x6303('0x5a'),_0x6303('0x5b'),'phonecall_activity_parties'];var _0x34b8cd=[_0x6303('0x5c'),_0x6303('0x5d'),_0x6303('0x5e'),_0x6303('0x5f'),'contactidname','contactidyominame',_0x6303('0x60'),_0x6303('0x61'),'createdbyexternalpartyname',_0x6303('0x62'),_0x6303('0x63'),_0x6303('0x64'),_0x6303('0x65'),_0x6303('0x66'),'createdonbehalfbyyominame','customeridname',_0x6303('0x67'),_0x6303('0x68'),'emailaddress','entitlementidname','entityimage_timestamp',_0x6303('0x69'),'escalatedon',_0x6303('0x6a'),_0x6303('0x6b'),_0x6303('0x6c'),_0x6303('0x6d'),_0x6303('0x6e'),'kbarticleidname',_0x6303('0x6f'),'masteridname',_0x6303('0x70'),'modifiedbyexternalpartyyominame',_0x6303('0x71'),_0x6303('0x72'),_0x6303('0x73'),'modifiedonbehalfbyname',_0x6303('0x74'),_0x6303('0x75'),_0x6303('0x76'),_0x6303('0x77'),_0x6303('0x78'),_0x6303('0x79'),_0x6303('0x7a'),'owneridtype',_0x6303('0x7b'),_0x6303('0x7c'),_0x6303('0x7d'),_0x6303('0x7e'),_0x6303('0x7f'),_0x6303('0x80'),_0x6303('0x81'),'resolveby',_0x6303('0x82'),'responseby','responsiblecontactidname',_0x6303('0x83'),_0x6303('0x84'),'slainvokedidname','slaname','socialprofileidname',_0x6303('0x85'),_0x6303('0x86'),_0x6303('0x87'),_0x6303('0x88'),_0x6303('0x89'),_0x6303('0x8a'),_0x6303('0x8b'),_0x6303('0x8c'),'versionnumber'];var _0x44a4d4=_0x2eda6a[_0x6303('0x8d')](_0x34b8cd);return db['Dynamics365Account'][_0x6303('0x4a')]({'where':{'id':_0x5d2f91[_0x6303('0x47')]['id']},'attributes':['id',_0x6303('0x8e'),'password',_0x6303('0x8f'),'tenantId','clientId',_0x6303('0x90')]})[_0x6303('0x23')](handleEntityNotFound(_0x9f2209,null))[_0x6303('0x23')](function(_0x4e8782){if(_0x4e8782){_0x5f32fe=_0x4e8782[_0x6303('0x8f')];var _0x4973df=_0x5f32fe[_0x6303('0x91')](-0x1);if(_0x4973df==='/'){_0x5f32fe=_0x5f32fe[_0x6303('0x92')](0x0,_0x5f32fe[_0x6303('0x93')](_0x4973df));}_0x56ef34=util[_0x6303('0x94')](_0x6303('0x95'),_0x5f32fe);var _0x56d27e={'method':'POST','uri':_0x6303('0x96')+_0x4e8782[_0x6303('0x97')]+_0x6303('0x98'),'form':{'client_id':_0x4e8782['clientId'],'resource':_0x5f32fe,'username':_0x4e8782[_0x6303('0x8e')],'password':_0x4e8782['password'],'grant_type':'password','client_secret':_0x4e8782['clientSecret']},'json':!![]};return rp(_0x56d27e);}})[_0x6303('0x23')](function(_0x48d6c2){_0x12c84c=_0x48d6c2['access_token'];var _0x5b6606={'method':_0x6303('0x99'),'uri':encodeURI(_0x56ef34+_0x6303('0x9a')+_0x1cbcb1+'\x27'),'headers':{'Authorization':_0x6303('0x9b')+_0x12c84c,'If-None-Match':null,'OData-Version':_0x6303('0x9c')},'json':!![]};return rp(_0x5b6606);})[_0x6303('0x23')](function(_0x341a38){var _0x33278b=_0x341a38[_0x6303('0x9d')][0x0];var _0x3ebe39=_0x33278b[_0x6303('0x9e')];var _0x19e7bd={'method':_0x6303('0x99'),'uri':_0x56ef34+_0x6303('0x9f')+_0x3ebe39+')?$select=LogicalName&$expand=Attributes($select=LogicalName)','headers':{'Authorization':_0x6303('0x9b')+_0x12c84c,'If-None-Match':null,'OData-Version':_0x6303('0x9c')},'json':!![]};return rp(_0x19e7bd);})['then'](function(_0x86af15){_0x289885=_0x86af15;_0x5f3700=_0x289885[_0x6303('0xa0')];_0x5f3700=_['remove'](_0x5f3700,function(_0x4e3923){return!_0x44a4d4[_0x6303('0xa1')](_0x4e3923[_0x6303('0xa2')]);});var _0x269581=[];var _0x59d8d6=[];_0x5f3700[_0x6303('0xa3')](function(_0x36d95c){if(_0x36d95c['@odata.type']){var _0x4a03ca=_0x36d95c['@odata.type'][_0x6303('0x92')](_0x36d95c['@odata.type'][_0x6303('0x93')]('.')+0x1);if(_0x4a03ca==='PicklistAttributeMetadata'){_0x269581[_0x6303('0xa4')](getSelectList(_0x56ef34,_0x4cc4f2,_0x59d8d6,_0x289885[_0x6303('0x9e')],_0x36d95c['MetadataId'],_0x12c84c));}}});return Promise[_0x6303('0xa5')](_0x269581);})[_0x6303('0x23')](function(_0x11170b){_0x3cdfce=_0x11170b[0x0];var _0x3888b7=[];var _0x5a4907=[];_0x5f3700[_0x6303('0xa3')](function(_0x456a65){if(!_[_0x6303('0xa6')](_0x456a65[_0x6303('0xa7')])){var _0xd65153=_0x456a65[_0x6303('0xa7')][_0x6303('0x92')](_0x456a65[_0x6303('0xa7')][_0x6303('0x93')]('.')+0x1);if(_0xd65153===_0x6303('0xa8')){_0x3888b7['push'](getBooleanList(_0x56ef34,_0x4cc4f2,_0x5a4907,_0x289885[_0x6303('0x9e')],_0x456a65['MetadataId'],_0x12c84c));}}});return Promise[_0x6303('0xa5')](_0x3888b7);})[_0x6303('0x23')](function(_0x1179f9){_0x2d66a5=_0x1179f9[0x0];var _0x3b32e1=[];var _0x2bbae8=[];_0x5f3700[_0x6303('0xa3')](function(_0x7139bf){if(_0x7139bf[_0x6303('0xa7')]){var _0xe232e9=_0x7139bf[_0x6303('0xa7')][_0x6303('0x92')](_0x7139bf[_0x6303('0xa7')][_0x6303('0x93')]('.')+0x1);if(_0xe232e9===_0x6303('0xa9')||_0xe232e9==='DoubleAttributeMetadata'||_0xe232e9==='BigIntAttributeMetadata'||_0xe232e9==='IntegerAttributeMetadata'||_0xe232e9===_0x6303('0xaa')||_0xe232e9===_0x6303('0xab')||_0xe232e9==='StatusAttributeMetadata'||_0xe232e9===_0x6303('0xac')||_0xe232e9===_0x6303('0xad')||_0xe232e9===_0x6303('0xae')){_0x3b32e1[_0x6303('0xa4')](getInputList(_0x56ef34,_0x4cc4f2,_0xe232e9,_0x2bbae8,_0x289885[_0x6303('0x9e')],_0x7139bf[_0x6303('0x9e')],_0x12c84c));}}});return Promise[_0x6303('0xa5')](_0x3b32e1);})[_0x6303('0x23')](function(_0x11bd12){_0x3f7567=_0x11bd12[0x0];var _0x15c011=_0x3cdfce[_0x6303('0x8d')](_0x2d66a5)[_0x6303('0x8d')](_0x3f7567);var _0x303e80={'count':_0x15c011[_0x6303('0x36')],'rows':_0x15c011};return _0x303e80;})[_0x6303('0x23')](respondWithResult(_0x9f2209,null))[_0x6303('0x48')](function(_0x1a76b7){var _0x59157c=_0x5d2f91[_0x6303('0x30')][_0x6303('0xaf')]?0x1f4:_0x1a76b7[_0x6303('0xb0')]||0x1f4;logger[_0x6303('0x27')](_0x1a76b7[_0x6303('0x28')]);delete _0x1a76b7['name'];if(_0x59157c===0x191){_0x59157c=0x190;}_0x9f2209[_0x6303('0x18')](_0x59157c)[_0x6303('0x2a')](_0x5d2f91[_0x6303('0x30')][_0x6303('0xaf')]?{'message':_0x6303('0xb1'),'statusCode':_0x1a76b7[_0x6303('0xb0')]}:_0x1a76b7);});};function getSelectList(_0x4760fd,_0x389cf3,_0x34837b,_0x11bcdf,_0x24666d,_0x4f952a){var _0x3b380c={'method':_0x6303('0x99'),'uri':_0x4760fd+'EntityDefinitions('+_0x11bcdf+')/Attributes('+_0x24666d+_0x6303('0xb2')+_0x6303('0xb3'),'headers':{'Authorization':_0x6303('0x9b')+_0x4f952a,'If-None-Match':null,'OData-Version':_0x6303('0x9c')},'json':!![]};return rp(_0x3b380c)[_0x6303('0x23')](function(_0x3292bb){var _0x3cdb0b=[];var _0x59b62c=_0x3292bb['OptionSet'][_0x6303('0xb4')];_0x59b62c['forEach'](function(_0x13511f){_0x3cdb0b[_0x6303('0xa4')]({'name':_0x13511f[_0x6303('0xb5')][_0x6303('0xb6')][_0x6303('0xb5')],'value':String(_0x13511f[_0x6303('0xb7')])});});var _0x2b6816={'id':_0x389cf3+'_'+_0x3292bb[_0x6303('0xa2')],'name':_0x3292bb[_0x6303('0xb8')]['UserLocalizedLabel'][_0x6303('0xb5')],'custom':![],'options':_0x3cdb0b};_0x34837b['push'](_0x2b6816);return _0x34837b;});}function getBooleanList(_0x2463bc,_0x3fa04c,_0x293332,_0x2c9f6a,_0x3bdcb9,_0xb03153){var _0x2e5793={'method':_0x6303('0x99'),'uri':_0x2463bc+_0x6303('0x9f')+_0x2c9f6a+')/Attributes('+_0x3bdcb9+_0x6303('0xb9'),'headers':{'Authorization':'Bearer\x20'+_0xb03153,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x2e5793)[_0x6303('0x23')](function(_0x365489){var _0x4517b4=[];_0x4517b4[_0x6303('0xa4')]({'name':_0x365489['OptionSet']['TrueOption']['Label'][_0x6303('0xb6')][_0x6303('0xb5')],'value':'true'},{'name':_0x365489[_0x6303('0xba')][_0x6303('0xbb')]['Label'][_0x6303('0xb6')][_0x6303('0xb5')],'value':'false'});var _0xace363={'id':_0x3fa04c+'_'+_0x365489['LogicalName'],'name':_0x365489['DisplayName'][_0x6303('0xb6')]['Label'],'custom':![],'options':_0x4517b4};_0x293332['push'](_0xace363);return _0x293332;});}function getInputList(_0x280ff6,_0x54cbdf,_0x56319b,_0x18be42,_0x4d7db1,_0x277108,_0x592674){var _0x477241={'method':_0x6303('0x99'),'uri':_0x280ff6+'EntityDefinitions('+_0x4d7db1+_0x6303('0xbc')+_0x277108+')/Microsoft.Dynamics.CRM.'+_0x56319b+_0x6303('0xbd'),'headers':{'Authorization':_0x6303('0x9b')+_0x592674,'If-None-Match':null,'OData-Version':_0x6303('0x9c')},'json':!![]};return rp(_0x477241)[_0x6303('0x23')](function(_0xedcc57){var _0x41120b={'id':_0x54cbdf+'_'+_0xedcc57['LogicalName'],'name':_0xedcc57[_0x6303('0xb8')][_0x6303('0xb6')]?_0xedcc57['DisplayName']['UserLocalizedLabel'][_0x6303('0xb5')]:_0xedcc57[_0x6303('0xa2')],'custom':![],'options':[]};_0x18be42[_0x6303('0xa4')](_0x41120b);return _0x18be42;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index b8590a2..1154485 100644 --- a/server/api/intDynamics365Account/intDynamics365Account.model.js +++ b/server/api/intDynamics365Account/intDynamics365Account.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbaf0=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','util'];(function(_0x4a4bba,_0x166da6){var _0x3483d0=function(_0x15f954){while(--_0x15f954){_0x4a4bba['push'](_0x4a4bba['shift']());}};_0x3483d0(++_0x166da6);}(_0xbaf0,0x12a));var _0x0baf=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xbaf0[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));var integrations=require(_0x0baf('0x9'));module[_0x0baf('0xa')]=function(_0x335e24,_0x1a10b1){return _0x335e24[_0x0baf('0xb')](_0x0baf('0xc'),attributes,{'tableName':'int_dynamics365_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcb91=['rimraf','./intDynamics365Account.attributes','../../components/integrations/configuration','Dynamics365Account','int_dynamics365_accounts','../../config/logger','api','moment','bluebird','path'];(function(_0x2fdea9,_0x1bc031){var _0x3b26b2=function(_0x394011){while(--_0x394011){_0x2fdea9['push'](_0x2fdea9['shift']());}};_0x3b26b2(++_0x1bc031);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x420b24,_0x382adc){_0x420b24=_0x420b24-0x0;var _0x4da552=_0xcb91[_0x420b24];return _0x4da552;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var moment=require(_0x1cb9('0x2'));var BPromise=require(_0x1cb9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1cb9('0x4'));var rimraf=require(_0x1cb9('0x5'));var config=require('../../config/environment');var attributes=require(_0x1cb9('0x6'));var integrations=require(_0x1cb9('0x7'));module['exports']=function(_0x226b69,_0x3f7deb){return _0x226b69['define'](_0x1cb9('0x8'),attributes,{'tableName':_0x1cb9('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 f77ea83..42d4292 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 _0xe715=['request','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','findAll','options','where','attributes','limit','include','map','model','then','GetDynamics365Account','ShowDynamics365Account','find','raw','info','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x39c7bc,_0x52cbca){var _0x3aaed4=function(_0x5a3478){while(--_0x5a3478){_0x39c7bc['push'](_0x39c7bc['shift']());}};_0x3aaed4(++_0x52cbca);}(_0xe715,0x153));var _0x5e71=function(_0x4ab1a0,_0xc8a40b){_0x4ab1a0=_0x4ab1a0-0x0;var _0x4dd070=_0xe715[_0x4ab1a0];return _0x4dd070;};'use strict';var _=require(_0x5e71('0x0'));var util=require('util');var moment=require(_0x5e71('0x1'));var BPromise=require(_0x5e71('0x2'));var rs=require(_0x5e71('0x3'));var fs=require('fs');var Redis=require(_0x5e71('0x4'));var db=require(_0x5e71('0x5'))['db'];var utils=require(_0x5e71('0x6'));var logger=require(_0x5e71('0x7'))(_0x5e71('0x8'));var config=require(_0x5e71('0x9'));var jayson=require(_0x5e71('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2f7eeb,_0x1a4088,_0x1afe1f){return new BPromise(function(_0x56e158,_0x613d68){return client[_0x5e71('0xb')](_0x2f7eeb,_0x1afe1f)['then'](function(_0x12b2dd){logger['info'](_0x5e71('0xc'),_0x1a4088,_0x5e71('0xd'));logger[_0x5e71('0xe')](_0x5e71('0xf'),_0x1a4088,_0x5e71('0xd'),JSON[_0x5e71('0x10')](_0x12b2dd));if(_0x12b2dd[_0x5e71('0x11')]){if(_0x12b2dd['error'][_0x5e71('0x12')]===0x1f4){logger[_0x5e71('0x11')](_0x5e71('0xc'),_0x1a4088,_0x12b2dd['error'][_0x5e71('0x13')]);return _0x613d68(_0x12b2dd['error'][_0x5e71('0x13')]);}logger['error']('Dynamics365Account,\x20%s,\x20%s',_0x1a4088,_0x12b2dd['error'][_0x5e71('0x13')]);return _0x56e158(_0x12b2dd[_0x5e71('0x11')]['message']);}else{logger['info'](_0x5e71('0xc'),_0x1a4088,'request\x20sent');_0x56e158(_0x12b2dd['result'][_0x5e71('0x13')]);}})[_0x5e71('0x14')](function(_0x5e3130){logger['error'](_0x5e71('0xc'),_0x1a4088,_0x5e3130);_0x613d68(_0x5e3130);});});}exports['GetDynamics365Account']=function(_0x1fb1fa){var _0x5bc11a=this;return new Promise(function(_0x203109,_0x3aa1f1){return db['Dynamics365Account'][_0x5e71('0x15')]({'raw':_0x1fb1fa['options']?_0x1fb1fa[_0x5e71('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x1fb1fa[_0x5e71('0x16')]?_0x1fb1fa[_0x5e71('0x16')][_0x5e71('0x17')]||null:null,'attributes':_0x1fb1fa[_0x5e71('0x16')]?_0x1fb1fa[_0x5e71('0x16')][_0x5e71('0x18')]||null:null,'limit':_0x1fb1fa[_0x5e71('0x16')]?_0x1fb1fa[_0x5e71('0x16')][_0x5e71('0x19')]||null:null,'include':_0x1fb1fa['options']?_0x1fb1fa[_0x5e71('0x16')][_0x5e71('0x1a')]?_['map'](_0x1fb1fa['options']['include'],function(_0x16fee2){return{'model':db[_0x16fee2['model']],'as':_0x16fee2['as'],'attributes':_0x16fee2[_0x5e71('0x18')],'include':_0x16fee2[_0x5e71('0x1a')]?_[_0x5e71('0x1b')](_0x16fee2[_0x5e71('0x1a')],function(_0x4cf244){return{'model':db[_0x4cf244[_0x5e71('0x1c')]],'as':_0x4cf244['as'],'attributes':_0x4cf244['attributes'],'include':_0x4cf244[_0x5e71('0x1a')]?_[_0x5e71('0x1b')](_0x4cf244[_0x5e71('0x1a')],function(_0x48381b){return{'model':db[_0x48381b['model']],'as':_0x48381b['as'],'attributes':_0x48381b['attributes']};}):[]};}):[]};}):[]:[]})[_0x5e71('0x1d')](function(_0x389344){logger['info'](_0x5e71('0x1e'),_0x1fb1fa);logger[_0x5e71('0xe')](_0x5e71('0x1e'),_0x1fb1fa,JSON[_0x5e71('0x10')](_0x389344));_0x203109(_0x389344);})[_0x5e71('0x14')](function(_0x586253){logger[_0x5e71('0x11')](_0x5e71('0x1e'),_0x586253[_0x5e71('0x13')],_0x1fb1fa);_0x3aa1f1(_0x5bc11a[_0x5e71('0x11')](0x1f4,_0x586253[_0x5e71('0x13')]));});});};exports[_0x5e71('0x1f')]=function(_0x1a1214){var _0x2dd4df=this;return new Promise(function(_0x2babe7,_0x1c3e90){return db['Dynamics365Account'][_0x5e71('0x20')]({'raw':_0x1a1214[_0x5e71('0x16')]?_0x1a1214[_0x5e71('0x16')][_0x5e71('0x21')]===undefined?!![]:![]:!![],'where':_0x1a1214['options']?_0x1a1214[_0x5e71('0x16')][_0x5e71('0x17')]||null:null,'attributes':_0x1a1214['options']?_0x1a1214['options'][_0x5e71('0x18')]||null:null,'include':_0x1a1214[_0x5e71('0x16')]?_0x1a1214[_0x5e71('0x16')]['include']?_['map'](_0x1a1214[_0x5e71('0x16')][_0x5e71('0x1a')],function(_0x153280){return{'model':db[_0x153280[_0x5e71('0x1c')]],'as':_0x153280['as'],'attributes':_0x153280[_0x5e71('0x18')],'include':_0x153280['include']?_[_0x5e71('0x1b')](_0x153280['include'],function(_0x584b13){return{'model':db[_0x584b13['model']],'as':_0x584b13['as'],'attributes':_0x584b13['attributes'],'include':_0x584b13['include']?_[_0x5e71('0x1b')](_0x584b13[_0x5e71('0x1a')],function(_0x54908b){return{'model':db[_0x54908b[_0x5e71('0x1c')]],'as':_0x54908b['as'],'attributes':_0x54908b[_0x5e71('0x18')]};}):[]};}):[]};}):[]:[]})[_0x5e71('0x1d')](function(_0xf5b54c){logger[_0x5e71('0x22')]('ShowDynamics365Account',_0x1a1214);logger[_0x5e71('0xe')](_0x5e71('0x1f'),_0x1a1214,JSON[_0x5e71('0x10')](_0xf5b54c));_0x2babe7(_0xf5b54c);})[_0x5e71('0x14')](function(_0x43b0f0){logger[_0x5e71('0x11')](_0x5e71('0x1f'),_0x43b0f0[_0x5e71('0x13')],_0x1a1214);_0x1c3e90(_0x2dd4df[_0x5e71('0x11')](0x1f4,_0x43b0f0[_0x5e71('0x13')]));});});}; \ No newline at end of file +var _0x52c1=['randomstring','ioredis','../../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','code','message','result','catch','GetDynamics365Account','Dynamics365Account','findAll','options','raw','where','attributes','include','map','model','then','ShowDynamics365Account','lodash','moment','bluebird'];(function(_0x29d915,_0x54a040){var _0x160f86=function(_0x237dfa){while(--_0x237dfa){_0x29d915['push'](_0x29d915['shift']());}};_0x160f86(++_0x54a040);}(_0x52c1,0x1e7));var _0x152c=function(_0x36d9fd,_0x2f174c){_0x36d9fd=_0x36d9fd-0x0;var _0x5e13ee=_0x52c1[_0x36d9fd];return _0x5e13ee;};'use strict';var _=require(_0x152c('0x0'));var util=require('util');var moment=require(_0x152c('0x1'));var BPromise=require(_0x152c('0x2'));var rs=require(_0x152c('0x3'));var fs=require('fs');var Redis=require(_0x152c('0x4'));var db=require(_0x152c('0x5'))['db'];var utils=require(_0x152c('0x6'));var logger=require(_0x152c('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x152c('0x8'));var client=jayson[_0x152c('0x9')][_0x152c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x22be79,_0x4f6439,_0x7fbbdd){return new BPromise(function(_0x37bb12,_0x36c8ac){return client[_0x152c('0xb')](_0x22be79,_0x7fbbdd)['then'](function(_0x19c81e){logger[_0x152c('0xc')](_0x152c('0xd'),_0x4f6439,_0x152c('0xe'));logger[_0x152c('0xf')](_0x152c('0x10'),_0x4f6439,'request\x20sent',JSON[_0x152c('0x11')](_0x19c81e));if(_0x19c81e[_0x152c('0x12')]){if(_0x19c81e[_0x152c('0x12')][_0x152c('0x13')]===0x1f4){logger['error'](_0x152c('0xd'),_0x4f6439,_0x19c81e['error'][_0x152c('0x14')]);return _0x36c8ac(_0x19c81e[_0x152c('0x12')]['message']);}logger[_0x152c('0x12')](_0x152c('0xd'),_0x4f6439,_0x19c81e[_0x152c('0x12')][_0x152c('0x14')]);return _0x37bb12(_0x19c81e[_0x152c('0x12')][_0x152c('0x14')]);}else{logger['info'](_0x152c('0xd'),_0x4f6439,'request\x20sent');_0x37bb12(_0x19c81e[_0x152c('0x15')]['message']);}})[_0x152c('0x16')](function(_0x253734){logger[_0x152c('0x12')]('Dynamics365Account,\x20%s,\x20%s',_0x4f6439,_0x253734);_0x36c8ac(_0x253734);});});}exports[_0x152c('0x17')]=function(_0x32cb15){var _0x2ae02f=this;return new Promise(function(_0x37f6ab,_0x405b5f){return db[_0x152c('0x18')][_0x152c('0x19')]({'raw':_0x32cb15[_0x152c('0x1a')]?_0x32cb15[_0x152c('0x1a')][_0x152c('0x1b')]===undefined?!![]:![]:!![],'where':_0x32cb15[_0x152c('0x1a')]?_0x32cb15[_0x152c('0x1a')][_0x152c('0x1c')]||null:null,'attributes':_0x32cb15['options']?_0x32cb15[_0x152c('0x1a')][_0x152c('0x1d')]||null:null,'limit':_0x32cb15['options']?_0x32cb15[_0x152c('0x1a')]['limit']||null:null,'include':_0x32cb15[_0x152c('0x1a')]?_0x32cb15[_0x152c('0x1a')][_0x152c('0x1e')]?_[_0x152c('0x1f')](_0x32cb15['options']['include'],function(_0x1d6070){return{'model':db[_0x1d6070[_0x152c('0x20')]],'as':_0x1d6070['as'],'attributes':_0x1d6070[_0x152c('0x1d')],'include':_0x1d6070[_0x152c('0x1e')]?_[_0x152c('0x1f')](_0x1d6070['include'],function(_0x453344){return{'model':db[_0x453344[_0x152c('0x20')]],'as':_0x453344['as'],'attributes':_0x453344[_0x152c('0x1d')],'include':_0x453344[_0x152c('0x1e')]?_[_0x152c('0x1f')](_0x453344[_0x152c('0x1e')],function(_0x4e2ff9){return{'model':db[_0x4e2ff9['model']],'as':_0x4e2ff9['as'],'attributes':_0x4e2ff9[_0x152c('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x152c('0x21')](function(_0x341e34){logger[_0x152c('0xc')](_0x152c('0x17'),_0x32cb15);logger['debug']('GetDynamics365Account',_0x32cb15,JSON[_0x152c('0x11')](_0x341e34));_0x37f6ab(_0x341e34);})[_0x152c('0x16')](function(_0x271e8b){logger[_0x152c('0x12')](_0x152c('0x17'),_0x271e8b[_0x152c('0x14')],_0x32cb15);_0x405b5f(_0x2ae02f[_0x152c('0x12')](0x1f4,_0x271e8b[_0x152c('0x14')]));});});};exports['ShowDynamics365Account']=function(_0x2daa60){var _0x5414fb=this;return new Promise(function(_0x33ef99,_0x390769){return db[_0x152c('0x18')]['find']({'raw':_0x2daa60['options']?_0x2daa60[_0x152c('0x1a')][_0x152c('0x1b')]===undefined?!![]:![]:!![],'where':_0x2daa60[_0x152c('0x1a')]?_0x2daa60[_0x152c('0x1a')][_0x152c('0x1c')]||null:null,'attributes':_0x2daa60[_0x152c('0x1a')]?_0x2daa60['options'][_0x152c('0x1d')]||null:null,'include':_0x2daa60[_0x152c('0x1a')]?_0x2daa60[_0x152c('0x1a')]['include']?_['map'](_0x2daa60[_0x152c('0x1a')]['include'],function(_0x1240b6){return{'model':db[_0x1240b6[_0x152c('0x20')]],'as':_0x1240b6['as'],'attributes':_0x1240b6[_0x152c('0x1d')],'include':_0x1240b6['include']?_[_0x152c('0x1f')](_0x1240b6[_0x152c('0x1e')],function(_0x1481c0){return{'model':db[_0x1481c0[_0x152c('0x20')]],'as':_0x1481c0['as'],'attributes':_0x1481c0['attributes'],'include':_0x1481c0[_0x152c('0x1e')]?_[_0x152c('0x1f')](_0x1481c0[_0x152c('0x1e')],function(_0x56c36f){return{'model':db[_0x56c36f['model']],'as':_0x56c36f['as'],'attributes':_0x56c36f[_0x152c('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x152c('0x21')](function(_0x5106e9){logger['info'](_0x152c('0x22'),_0x2daa60);logger[_0x152c('0xf')](_0x152c('0x22'),_0x2daa60,JSON['stringify'](_0x5106e9));_0x33ef99(_0x5106e9);})[_0x152c('0x16')](function(_0xf6af17){logger['error'](_0x152c('0x22'),_0xf6af17[_0x152c('0x14')],_0x2daa60);_0x390769(_0x5414fb['error'](0x1f4,_0xf6af17['message']));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 2e1fed1..736ac15 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 _0x6635=['../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x1352c0,_0x258f65){var _0x13b6b3=function(_0x5c894a){while(--_0x5c894a){_0x1352c0['push'](_0x1352c0['shift']());}};_0x13b6b3(++_0x258f65);}(_0x6635,0x10d));var _0x5663=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0x6635[_0x122096];return _0x3d1966;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5663('0x0'));var timeout=require(_0x5663('0x1'));var express=require(_0x5663('0x2'));var router=express[_0x5663('0x3')]();var fs_extra=require(_0x5663('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x5663('0x5'));var config=require(_0x5663('0x6'));var controller=require(_0x5663('0x7'));router[_0x5663('0x8')]('/',auth[_0x5663('0x9')](),controller['index']);router[_0x5663('0x8')](_0x5663('0xa'),auth[_0x5663('0x9')](),controller[_0x5663('0xb')]);router[_0x5663('0x8')](_0x5663('0xc'),auth[_0x5663('0x9')](),controller[_0x5663('0xd')]);router[_0x5663('0x8')](_0x5663('0xe'),auth['isAuthenticated'](),controller[_0x5663('0xf')]);router[_0x5663('0x8')](_0x5663('0x10'),auth[_0x5663('0x9')](),controller[_0x5663('0x11')]);router[_0x5663('0x12')]('/',auth[_0x5663('0x9')](),controller[_0x5663('0x13')]);router[_0x5663('0x14')](_0x5663('0xa'),auth[_0x5663('0x9')](),controller[_0x5663('0x15')]);router[_0x5663('0x16')](_0x5663('0xa'),auth[_0x5663('0x9')](),controller[_0x5663('0x17')]);module[_0x5663('0x18')]=router; \ No newline at end of file +var _0xb79a=['create','delete','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','isAuthenticated','get','/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','post'];(function(_0x5eb496,_0x25bc44){var _0x4f513a=function(_0x4e2351){while(--_0x4e2351){_0x5eb496['push'](_0x5eb496['shift']());}};_0x4f513a(++_0x25bc44);}(_0xb79a,0x18e));var _0xab79=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb79a[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xab79('0x0'));var util=require(_0xab79('0x1'));var path=require('path');var timeout=require(_0xab79('0x2'));var express=require(_0xab79('0x3'));var router=express[_0xab79('0x4')]();var fs_extra=require(_0xab79('0x5'));var auth=require(_0xab79('0x6'));var interaction=require(_0xab79('0x7'));var config=require(_0xab79('0x8'));var controller=require(_0xab79('0x9'));router['get']('/',auth[_0xab79('0xa')](),controller['index']);router[_0xab79('0xb')](_0xab79('0xc'),auth[_0xab79('0xa')](),controller[_0xab79('0xd')]);router[_0xab79('0xb')](_0xab79('0xe'),auth[_0xab79('0xa')](),controller[_0xab79('0xf')]);router[_0xab79('0xb')](_0xab79('0x10'),auth[_0xab79('0xa')](),controller['getSubjects']);router['get'](_0xab79('0x11'),auth[_0xab79('0xa')](),controller[_0xab79('0x12')]);router[_0xab79('0x13')]('/',auth[_0xab79('0xa')](),controller[_0xab79('0x14')]);router['put']('/:id',auth[_0xab79('0xa')](),controller['update']);router[_0xab79('0x15')](_0xab79('0xc'),auth[_0xab79('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index c466430..6b7d215 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 _0x6754=['exports','STRING','ENUM','incident','sequelize'];(function(_0x10c16d,_0x2b3e14){var _0x5896f4=function(_0x4306b9){while(--_0x4306b9){_0x10c16d['push'](_0x10c16d['shift']());}};_0x5896f4(++_0x2b3e14);}(_0x6754,0x126));var _0x4675=function(_0xe2f5e6,_0xd9eb5e){_0xe2f5e6=_0xe2f5e6-0x0;var _0x484ebe=_0x6754[_0xe2f5e6];return _0x484ebe;};'use strict';var Sequelize=require(_0x4675('0x0'));module[_0x4675('0x1')]={'name':{'type':Sequelize[_0x4675('0x2')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0x4675('0x3')]('incident','phonecall'),'defaultValue':_0x4675('0x4')}}; \ No newline at end of file +var _0x9eaa=['ENUM','incident','phonecall','sequelize'];(function(_0x246194,_0x27cdd9){var _0x4fed0e=function(_0x5a92bc){while(--_0x5a92bc){_0x246194['push'](_0x246194['shift']());}};_0x4fed0e(++_0x27cdd9);}(_0x9eaa,0x1bb));var _0xa9ea=function(_0x3009f1,_0x2f8f44){_0x3009f1=_0x3009f1-0x0;var _0x397129=_0x9eaa[_0x3009f1];return _0x397129;};'use strict';var Sequelize=require(_0xa9ea('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0xa9ea('0x1')](_0xa9ea('0x2'),_0xa9ea('0x3')),'defaultValue':_0xa9ea('0x2')}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index 7c0f90e..2691fcb 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 _0xfa26=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../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','index','map','Dynamics365Configuration','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','findOne','Dynamics365Field','order','getFields','getSubjects','getDescriptions','eml-format'];(function(_0x3229e8,_0x3070de){var _0x36dad7=function(_0x4c314b){while(--_0x4c314b){_0x3229e8['push'](_0x3229e8['shift']());}};_0x36dad7(++_0x3070de);}(_0xfa26,0xa9));var _0x6fa2=function(_0x52edc0,_0x248c46){_0x52edc0=_0x52edc0-0x0;var _0x324bf2=_0xfa26[_0x52edc0];return _0x324bf2;};'use strict';var emlformat=require(_0x6fa2('0x0'));var rimraf=require(_0x6fa2('0x1'));var zipdir=require(_0x6fa2('0x2'));var jsonpatch=require(_0x6fa2('0x3'));var rp=require(_0x6fa2('0x4'));var moment=require(_0x6fa2('0x5'));var BPromise=require(_0x6fa2('0x6'));var Mustache=require(_0x6fa2('0x7'));var util=require(_0x6fa2('0x8'));var path=require(_0x6fa2('0x9'));var sox=require(_0x6fa2('0xa'));var csv=require(_0x6fa2('0xb'));var ejs=require(_0x6fa2('0xc'));var fs=require('fs');var fs_extra=require(_0x6fa2('0xd'));var _=require('lodash');var squel=require(_0x6fa2('0xe'));var crypto=require(_0x6fa2('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x6fa2('0x10'));var toCsv=require(_0x6fa2('0xb'));var querystring=require(_0x6fa2('0x11'));var Papa=require(_0x6fa2('0x12'));var Redis=require(_0x6fa2('0x13'));var authService=require(_0x6fa2('0x14'));var qs=require(_0x6fa2('0x15'));var as=require(_0x6fa2('0x16'));var hardwareService=require(_0x6fa2('0x17'));var logger=require('../../config/logger')(_0x6fa2('0x18'));var utils=require('../../config/utils');var config=require(_0x6fa2('0x19'));var licenseUtil=require(_0x6fa2('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3a612b,_0x13d352){_0x13d352=_0x13d352||0xcc;return function(_0x1aa1bd){if(_0x1aa1bd){return _0x3a612b[_0x6fa2('0x1b')](_0x13d352);}return _0x3a612b[_0x6fa2('0x1c')](_0x13d352)[_0x6fa2('0x1d')]();};}function respondWithResult(_0x44d7c6,_0x39e411){_0x39e411=_0x39e411||0xc8;return function(_0x3c2f01){if(_0x3c2f01){return _0x44d7c6[_0x6fa2('0x1c')](_0x39e411)['json'](_0x3c2f01);}};}function respondWithFilteredResult(_0x4bcd78,_0x336a94){return function(_0x17044f){if(_0x17044f){var _0x221bdb=typeof _0x336a94['offset']===_0x6fa2('0x1e')&&typeof _0x336a94[_0x6fa2('0x1f')]==='undefined';var _0x3aa743=_0x17044f[_0x6fa2('0x20')];var _0xf3f4ec=_0x221bdb?0x0:_0x336a94[_0x6fa2('0x21')];var _0x4ca336=_0x221bdb?_0x17044f[_0x6fa2('0x20')]:_0x336a94[_0x6fa2('0x21')]+_0x336a94[_0x6fa2('0x1f')];var _0x108ac6;if(_0x4ca336>=_0x3aa743){_0x4ca336=_0x3aa743;_0x108ac6=0xc8;}else{_0x108ac6=0xce;}_0x4bcd78['status'](_0x108ac6);return _0x4bcd78[_0x6fa2('0x22')](_0x6fa2('0x23'),_0xf3f4ec+'-'+_0x4ca336+'/'+_0x3aa743)[_0x6fa2('0x24')](_0x17044f);}return null;};}function patchUpdates(_0x72d256){return function(_0x32a6f8){try{jsonpatch[_0x6fa2('0x25')](_0x32a6f8,_0x72d256,!![]);}catch(_0x390ee3){return BPromise[_0x6fa2('0x26')](_0x390ee3);}return _0x32a6f8[_0x6fa2('0x27')]();};}function saveUpdates(_0x38bb0c,_0x5c68fe){return function(_0x3f7725){if(_0x3f7725){return _0x3f7725[_0x6fa2('0x28')](_0x38bb0c)[_0x6fa2('0x29')](function(_0xd6b9f5){return _0xd6b9f5;});}return null;};}function removeEntity(_0x179846,_0x16c74c){return function(_0x1f8823){if(_0x1f8823){return _0x1f8823[_0x6fa2('0x2a')]()['then'](function(){_0x179846[_0x6fa2('0x1c')](0xcc)[_0x6fa2('0x1d')]();});}};}function handleEntityNotFound(_0x4bab30,_0x513979){return function(_0x2040c3){if(!_0x2040c3){_0x4bab30[_0x6fa2('0x1b')](0x194);}return _0x2040c3;};}function handleError(_0x335a84,_0x17350e){_0x17350e=_0x17350e||0x1f4;return function(_0x690f9d){logger[_0x6fa2('0x2b')](_0x690f9d[_0x6fa2('0x2c')]);if(_0x690f9d[_0x6fa2('0x2d')]){delete _0x690f9d[_0x6fa2('0x2d')];}_0x335a84[_0x6fa2('0x1c')](_0x17350e)['send'](_0x690f9d);};}exports[_0x6fa2('0x2e')]=function(_0x20db0c,_0x1e7b5d){var _0x143221={},_0x3279b5={},_0x4123e5={'count':0x0,'rows':[]};var _0x215285=_[_0x6fa2('0x2f')](db[_0x6fa2('0x30')][_0x6fa2('0x31')],function(_0x1fa2ad){return{'name':_0x1fa2ad[_0x6fa2('0x32')],'type':_0x1fa2ad['type']['key']};});_0x3279b5[_0x6fa2('0x33')]=_[_0x6fa2('0x2f')](_0x215285,'name');_0x3279b5[_0x6fa2('0x34')]=_[_0x6fa2('0x35')](_0x20db0c['query']);_0x3279b5[_0x6fa2('0x36')]=_[_0x6fa2('0x37')](_0x3279b5['model'],_0x3279b5[_0x6fa2('0x34')]);_0x143221[_0x6fa2('0x38')]=_[_0x6fa2('0x37')](_0x3279b5[_0x6fa2('0x33')],qs[_0x6fa2('0x39')](_0x20db0c[_0x6fa2('0x34')][_0x6fa2('0x39')]));_0x143221[_0x6fa2('0x38')]=_0x143221['attributes'][_0x6fa2('0x3a')]?_0x143221[_0x6fa2('0x38')]:_0x3279b5['model'];if(!_0x20db0c[_0x6fa2('0x34')][_0x6fa2('0x3b')](_0x6fa2('0x3c'))){_0x143221[_0x6fa2('0x1f')]=qs[_0x6fa2('0x1f')](_0x20db0c['query'][_0x6fa2('0x1f')]);_0x143221[_0x6fa2('0x21')]=qs['offset'](_0x20db0c['query'][_0x6fa2('0x21')]);}_0x143221['order']=qs[_0x6fa2('0x3d')](_0x20db0c[_0x6fa2('0x34')]['sort']);_0x143221[_0x6fa2('0x3e')]=qs[_0x6fa2('0x36')](_[_0x6fa2('0x3f')](_0x20db0c[_0x6fa2('0x34')],_0x3279b5['filters']),_0x215285);if(_0x20db0c[_0x6fa2('0x34')][_0x6fa2('0x40')]){_0x143221[_0x6fa2('0x3e')]=_[_0x6fa2('0x41')](_0x143221[_0x6fa2('0x3e')],{'$or':_['map'](_0x215285,function(_0x5a6e46){if(_0x5a6e46[_0x6fa2('0x42')]!==_0x6fa2('0x43')){var _0x2f26c4={};_0x2f26c4[_0x5a6e46[_0x6fa2('0x2d')]]={'$like':'%'+_0x20db0c[_0x6fa2('0x34')][_0x6fa2('0x40')]+'%'};return _0x2f26c4;}})});}_0x143221=_[_0x6fa2('0x41')]({},_0x143221,_0x20db0c[_0x6fa2('0x44')]);var _0x12a997={'where':_0x143221[_0x6fa2('0x3e')]};return db[_0x6fa2('0x30')][_0x6fa2('0x20')](_0x12a997)[_0x6fa2('0x29')](function(_0x36ebc6){_0x4123e5['count']=_0x36ebc6;if(_0x20db0c[_0x6fa2('0x34')][_0x6fa2('0x45')]){_0x143221[_0x6fa2('0x46')]=[{'all':!![]}];}return db[_0x6fa2('0x30')][_0x6fa2('0x47')](_0x143221);})[_0x6fa2('0x29')](function(_0x18888f){_0x4123e5[_0x6fa2('0x48')]=_0x18888f;return _0x4123e5;})[_0x6fa2('0x29')](respondWithFilteredResult(_0x1e7b5d,_0x143221))[_0x6fa2('0x49')](handleError(_0x1e7b5d,null));};exports[_0x6fa2('0x4a')]=function(_0x32ada7,_0x36700c){var _0x560afd={'raw':![],'where':{'id':_0x32ada7[_0x6fa2('0x4b')]['id']}},_0x2ea5cf={};_0x2ea5cf[_0x6fa2('0x33')]=_[_0x6fa2('0x35')](db[_0x6fa2('0x30')][_0x6fa2('0x31')]);_0x2ea5cf[_0x6fa2('0x34')]=_['keys'](_0x32ada7['query']);_0x2ea5cf['filters']=_[_0x6fa2('0x37')](_0x2ea5cf[_0x6fa2('0x33')],_0x2ea5cf[_0x6fa2('0x34')]);_0x560afd[_0x6fa2('0x38')]=_[_0x6fa2('0x37')](_0x2ea5cf[_0x6fa2('0x33')],qs[_0x6fa2('0x39')](_0x32ada7[_0x6fa2('0x34')][_0x6fa2('0x39')]));_0x560afd[_0x6fa2('0x38')]=_0x560afd[_0x6fa2('0x38')][_0x6fa2('0x3a')]?_0x560afd[_0x6fa2('0x38')]:_0x2ea5cf[_0x6fa2('0x33')];if(_0x32ada7[_0x6fa2('0x34')][_0x6fa2('0x45')]){_0x560afd[_0x6fa2('0x46')]=[{'all':!![]}];}_0x560afd=_[_0x6fa2('0x41')]({},_0x560afd,_0x32ada7[_0x6fa2('0x44')]);return db[_0x6fa2('0x30')][_0x6fa2('0x4c')](_0x560afd)[_0x6fa2('0x29')](handleEntityNotFound(_0x36700c,null))['then'](respondWithResult(_0x36700c,null))[_0x6fa2('0x49')](handleError(_0x36700c,null));};exports[_0x6fa2('0x4d')]=function(_0x137421,_0x196fde){return db['Dynamics365Configuration'][_0x6fa2('0x4d')](_0x137421[_0x6fa2('0x4e')],{})[_0x6fa2('0x29')](respondWithResult(_0x196fde,0xc9))[_0x6fa2('0x49')](handleError(_0x196fde,null));};exports[_0x6fa2('0x28')]=function(_0x419262,_0x4a9810){if(_0x419262[_0x6fa2('0x4e')]['id']){delete _0x419262['body']['id'];}return db['Dynamics365Configuration'][_0x6fa2('0x4c')]({'where':{'id':_0x419262[_0x6fa2('0x4b')]['id']}})[_0x6fa2('0x29')](handleEntityNotFound(_0x4a9810,null))[_0x6fa2('0x29')](saveUpdates(_0x419262[_0x6fa2('0x4e')],null))[_0x6fa2('0x29')](respondWithResult(_0x4a9810,null))['catch'](handleError(_0x4a9810,null));};exports[_0x6fa2('0x2a')]=function(_0x165461,_0x48d350){return db[_0x6fa2('0x30')][_0x6fa2('0x4c')]({'where':{'id':_0x165461[_0x6fa2('0x4b')]['id']}})[_0x6fa2('0x29')](handleEntityNotFound(_0x48d350,null))[_0x6fa2('0x29')](removeEntity(_0x48d350,null))[_0x6fa2('0x49')](handleError(_0x48d350,null));};exports['getFields']=function(_0xce7793,_0x508bff,_0xac04af){var _0x5b8809={};var _0x2b1926={};var _0x4004a0;var _0x3e94db;return db[_0x6fa2('0x30')][_0x6fa2('0x4f')]({'where':{'id':_0xce7793[_0x6fa2('0x4b')]['id']}})[_0x6fa2('0x29')](handleEntityNotFound(_0x508bff,null))[_0x6fa2('0x29')](function(_0x463d96){if(_0x463d96){_0x4004a0=_0x463d96;_0x2b1926[_0x6fa2('0x33')]=_[_0x6fa2('0x35')](db[_0x6fa2('0x50')][_0x6fa2('0x31')]);_0x2b1926['query']=_[_0x6fa2('0x35')](_0xce7793[_0x6fa2('0x34')]);_0x2b1926['filters']=_[_0x6fa2('0x37')](_0x2b1926[_0x6fa2('0x33')],_0x2b1926[_0x6fa2('0x34')]);_0x5b8809['attributes']=_[_0x6fa2('0x37')](_0x2b1926[_0x6fa2('0x33')],qs[_0x6fa2('0x39')](_0xce7793[_0x6fa2('0x34')][_0x6fa2('0x39')]));_0x5b8809[_0x6fa2('0x38')]=_0x5b8809[_0x6fa2('0x38')][_0x6fa2('0x3a')]?_0x5b8809['attributes']:_0x2b1926[_0x6fa2('0x33')];_0x5b8809[_0x6fa2('0x51')]=qs[_0x6fa2('0x3d')](_0xce7793[_0x6fa2('0x34')][_0x6fa2('0x3d')]);_0x5b8809['where']=qs[_0x6fa2('0x36')](_[_0x6fa2('0x3f')](_0xce7793[_0x6fa2('0x34')],_0x2b1926[_0x6fa2('0x36')]));if(_0xce7793[_0x6fa2('0x34')][_0x6fa2('0x40')]){_0x5b8809[_0x6fa2('0x3e')]=_[_0x6fa2('0x41')](_0x5b8809[_0x6fa2('0x3e')],{'$or':_['map'](_0x5b8809['attributes'],function(_0x465e9b){var _0x41a42f={};_0x41a42f[_0x465e9b]={'$like':'%'+_0xce7793[_0x6fa2('0x34')][_0x6fa2('0x40')]+'%'};return _0x41a42f;})});}_0x5b8809=_[_0x6fa2('0x41')]({},_0x5b8809,_0xce7793['options']);return _0x4004a0[_0x6fa2('0x52')](_0x5b8809);}})[_0x6fa2('0x29')](function(_0x477cd6){if(_0x477cd6){_0x3e94db=_0x477cd6[_0x6fa2('0x3a')];if(!_0xce7793[_0x6fa2('0x34')][_0x6fa2('0x3b')]('nolimit')){_0x5b8809['limit']=qs[_0x6fa2('0x1f')](_0xce7793['query']['limit']);_0x5b8809[_0x6fa2('0x21')]=qs['offset'](_0xce7793[_0x6fa2('0x34')][_0x6fa2('0x21')]);}return _0x4004a0[_0x6fa2('0x52')](_0x5b8809);}})[_0x6fa2('0x29')](function(_0x1d9e7c){if(_0x1d9e7c){return _0x1d9e7c?{'count':_0x3e94db,'rows':_0x1d9e7c}:null;}})['then'](respondWithResult(_0x508bff,null))['catch'](handleError(_0x508bff,null));};exports['getSubjects']=function(_0x36c0b8,_0x67a7bc,_0xccc1ec){var _0x32746d={};var _0x14ea71={};var _0x2c9339;var _0x4c8b8c;return db[_0x6fa2('0x30')][_0x6fa2('0x4f')]({'where':{'id':_0x36c0b8[_0x6fa2('0x4b')]['id']}})[_0x6fa2('0x29')](handleEntityNotFound(_0x67a7bc,null))[_0x6fa2('0x29')](function(_0x3ef1f4){if(_0x3ef1f4){_0x2c9339=_0x3ef1f4;_0x14ea71[_0x6fa2('0x33')]=_[_0x6fa2('0x35')](db[_0x6fa2('0x50')][_0x6fa2('0x31')]);_0x14ea71['query']=_[_0x6fa2('0x35')](_0x36c0b8['query']);_0x14ea71['filters']=_[_0x6fa2('0x37')](_0x14ea71['model'],_0x14ea71['query']);_0x32746d[_0x6fa2('0x38')]=_[_0x6fa2('0x37')](_0x14ea71[_0x6fa2('0x33')],qs[_0x6fa2('0x39')](_0x36c0b8[_0x6fa2('0x34')][_0x6fa2('0x39')]));_0x32746d[_0x6fa2('0x38')]=_0x32746d[_0x6fa2('0x38')][_0x6fa2('0x3a')]?_0x32746d[_0x6fa2('0x38')]:_0x14ea71[_0x6fa2('0x33')];_0x32746d[_0x6fa2('0x51')]=qs[_0x6fa2('0x3d')](_0x36c0b8[_0x6fa2('0x34')][_0x6fa2('0x3d')]);_0x32746d['where']=qs['filters'](_['pick'](_0x36c0b8[_0x6fa2('0x34')],_0x14ea71['filters']));if(_0x36c0b8['query']['filter']){_0x32746d['where']=_['merge'](_0x32746d[_0x6fa2('0x3e')],{'$or':_['map'](_0x32746d[_0x6fa2('0x38')],function(_0x3054ee){var _0x174a5c={};_0x174a5c[_0x3054ee]={'$like':'%'+_0x36c0b8[_0x6fa2('0x34')][_0x6fa2('0x40')]+'%'};return _0x174a5c;})});}_0x32746d=_['merge']({},_0x32746d,_0x36c0b8[_0x6fa2('0x44')]);return _0x2c9339[_0x6fa2('0x53')](_0x32746d);}})[_0x6fa2('0x29')](function(_0x51e635){if(_0x51e635){_0x4c8b8c=_0x51e635[_0x6fa2('0x3a')];if(!_0x36c0b8['query'][_0x6fa2('0x3b')](_0x6fa2('0x3c'))){_0x32746d[_0x6fa2('0x1f')]=qs['limit'](_0x36c0b8[_0x6fa2('0x34')][_0x6fa2('0x1f')]);_0x32746d[_0x6fa2('0x21')]=qs['offset'](_0x36c0b8[_0x6fa2('0x34')]['offset']);}return _0x2c9339[_0x6fa2('0x53')](_0x32746d);}})['then'](function(_0x7146ca){if(_0x7146ca){return _0x7146ca?{'count':_0x4c8b8c,'rows':_0x7146ca}:null;}})['then'](respondWithResult(_0x67a7bc,null))['catch'](handleError(_0x67a7bc,null));};exports[_0x6fa2('0x54')]=function(_0x55a59f,_0x38598d,_0x40f114){var _0x355d01={};var _0x4b8fe2={};var _0x37eaa2;var _0x49cbde;return db['Dynamics365Configuration']['findOne']({'where':{'id':_0x55a59f[_0x6fa2('0x4b')]['id']}})[_0x6fa2('0x29')](handleEntityNotFound(_0x38598d,null))[_0x6fa2('0x29')](function(_0x31e6fc){if(_0x31e6fc){_0x37eaa2=_0x31e6fc;_0x4b8fe2[_0x6fa2('0x33')]=_['keys'](db[_0x6fa2('0x50')][_0x6fa2('0x31')]);_0x4b8fe2['query']=_[_0x6fa2('0x35')](_0x55a59f[_0x6fa2('0x34')]);_0x4b8fe2[_0x6fa2('0x36')]=_[_0x6fa2('0x37')](_0x4b8fe2['model'],_0x4b8fe2[_0x6fa2('0x34')]);_0x355d01[_0x6fa2('0x38')]=_[_0x6fa2('0x37')](_0x4b8fe2[_0x6fa2('0x33')],qs[_0x6fa2('0x39')](_0x55a59f[_0x6fa2('0x34')][_0x6fa2('0x39')]));_0x355d01['attributes']=_0x355d01[_0x6fa2('0x38')][_0x6fa2('0x3a')]?_0x355d01[_0x6fa2('0x38')]:_0x4b8fe2[_0x6fa2('0x33')];_0x355d01['order']=qs[_0x6fa2('0x3d')](_0x55a59f[_0x6fa2('0x34')][_0x6fa2('0x3d')]);_0x355d01[_0x6fa2('0x3e')]=qs[_0x6fa2('0x36')](_[_0x6fa2('0x3f')](_0x55a59f[_0x6fa2('0x34')],_0x4b8fe2['filters']));if(_0x55a59f['query'][_0x6fa2('0x40')]){_0x355d01[_0x6fa2('0x3e')]=_[_0x6fa2('0x41')](_0x355d01[_0x6fa2('0x3e')],{'$or':_[_0x6fa2('0x2f')](_0x355d01['attributes'],function(_0xd5376b){var _0xaa40bc={};_0xaa40bc[_0xd5376b]={'$like':'%'+_0x55a59f['query'][_0x6fa2('0x40')]+'%'};return _0xaa40bc;})});}_0x355d01=_[_0x6fa2('0x41')]({},_0x355d01,_0x55a59f[_0x6fa2('0x44')]);return _0x37eaa2[_0x6fa2('0x54')](_0x355d01);}})[_0x6fa2('0x29')](function(_0x829293){if(_0x829293){_0x49cbde=_0x829293['length'];if(!_0x55a59f['query'][_0x6fa2('0x3b')](_0x6fa2('0x3c'))){_0x355d01[_0x6fa2('0x1f')]=qs[_0x6fa2('0x1f')](_0x55a59f[_0x6fa2('0x34')]['limit']);_0x355d01[_0x6fa2('0x21')]=qs[_0x6fa2('0x21')](_0x55a59f[_0x6fa2('0x34')][_0x6fa2('0x21')]);}return _0x37eaa2[_0x6fa2('0x54')](_0x355d01);}})['then'](function(_0x425cee){if(_0x425cee){return _0x425cee?{'count':_0x49cbde,'rows':_0x425cee}:null;}})[_0x6fa2('0x29')](respondWithResult(_0x38598d,null))[_0x6fa2('0x49')](handleError(_0x38598d,null));}; \ No newline at end of file +var _0x2e7a=['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','../../mysqldb','status','end','undefined','offset','count','set','Content-Range','json','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','Dynamics365Configuration','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','where','filters','pick','filter','VIRTUAL','merge','options','include','rows','catch','params','keys','length','includeAll','create','body','find','getFields','findOne','Dynamics365Field','sort','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox'];(function(_0x4f18b2,_0x48d20f){var _0x5d2a20=function(_0x20dc81){while(--_0x20dc81){_0x4f18b2['push'](_0x4f18b2['shift']());}};_0x5d2a20(++_0x48d20f);}(_0x2e7a,0x9e));var _0xa2e7=function(_0x43236e,_0xf0da48){_0x43236e=_0x43236e-0x0;var _0x4aa7be=_0x2e7a[_0x43236e];return _0x4aa7be;};'use strict';var emlformat=require(_0xa2e7('0x0'));var rimraf=require(_0xa2e7('0x1'));var zipdir=require(_0xa2e7('0x2'));var jsonpatch=require(_0xa2e7('0x3'));var rp=require(_0xa2e7('0x4'));var moment=require('moment');var BPromise=require(_0xa2e7('0x5'));var Mustache=require(_0xa2e7('0x6'));var util=require(_0xa2e7('0x7'));var path=require(_0xa2e7('0x8'));var sox=require(_0xa2e7('0x9'));var csv=require(_0xa2e7('0xa'));var ejs=require(_0xa2e7('0xb'));var fs=require('fs');var fs_extra=require(_0xa2e7('0xc'));var _=require(_0xa2e7('0xd'));var squel=require(_0xa2e7('0xe'));var crypto=require(_0xa2e7('0xf'));var jsforce=require(_0xa2e7('0x10'));var deskjs=require(_0xa2e7('0x11'));var toCsv=require(_0xa2e7('0xa'));var querystring=require(_0xa2e7('0x12'));var Papa=require(_0xa2e7('0x13'));var Redis=require(_0xa2e7('0x14'));var authService=require(_0xa2e7('0x15'));var qs=require(_0xa2e7('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa2e7('0x17'))(_0xa2e7('0x18'));var utils=require(_0xa2e7('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xa2e7('0x1a'));var db=require(_0xa2e7('0x1b'))['db'];function respondWithStatusCode(_0x32258c,_0x454a89){_0x454a89=_0x454a89||0xcc;return function(_0x4712cb){if(_0x4712cb){return _0x32258c['sendStatus'](_0x454a89);}return _0x32258c[_0xa2e7('0x1c')](_0x454a89)[_0xa2e7('0x1d')]();};}function respondWithResult(_0x4dc5e4,_0x47f157){_0x47f157=_0x47f157||0xc8;return function(_0x23b4c1){if(_0x23b4c1){return _0x4dc5e4['status'](_0x47f157)['json'](_0x23b4c1);}};}function respondWithFilteredResult(_0x3bcf20,_0x243428){return function(_0x4e7f1b){if(_0x4e7f1b){var _0x4bae01=typeof _0x243428['offset']===_0xa2e7('0x1e')&&typeof _0x243428['limit']===_0xa2e7('0x1e');var _0x283313=_0x4e7f1b['count'];var _0xaa6671=_0x4bae01?0x0:_0x243428[_0xa2e7('0x1f')];var _0x4ac1a3=_0x4bae01?_0x4e7f1b[_0xa2e7('0x20')]:_0x243428['offset']+_0x243428['limit'];var _0x24f5b9;if(_0x4ac1a3>=_0x283313){_0x4ac1a3=_0x283313;_0x24f5b9=0xc8;}else{_0x24f5b9=0xce;}_0x3bcf20[_0xa2e7('0x1c')](_0x24f5b9);return _0x3bcf20[_0xa2e7('0x21')](_0xa2e7('0x22'),_0xaa6671+'-'+_0x4ac1a3+'/'+_0x283313)[_0xa2e7('0x23')](_0x4e7f1b);}return null;};}function patchUpdates(_0x3d4cde){return function(_0x728c02){try{jsonpatch['apply'](_0x728c02,_0x3d4cde,!![]);}catch(_0x5ce486){return BPromise['reject'](_0x5ce486);}return _0x728c02[_0xa2e7('0x24')]();};}function saveUpdates(_0xc5893c,_0x28819a){return function(_0x4d5821){if(_0x4d5821){return _0x4d5821[_0xa2e7('0x25')](_0xc5893c)[_0xa2e7('0x26')](function(_0x51f5ee){return _0x51f5ee;});}return null;};}function removeEntity(_0x21c97e,_0x23883c){return function(_0x233609){if(_0x233609){return _0x233609[_0xa2e7('0x27')]()[_0xa2e7('0x26')](function(){_0x21c97e['status'](0xcc)[_0xa2e7('0x1d')]();});}};}function handleEntityNotFound(_0x19144c,_0x27dae1){return function(_0xfdd58){if(!_0xfdd58){_0x19144c[_0xa2e7('0x28')](0x194);}return _0xfdd58;};}function handleError(_0x41495a,_0x48f9e7){_0x48f9e7=_0x48f9e7||0x1f4;return function(_0x16b073){logger[_0xa2e7('0x29')](_0x16b073[_0xa2e7('0x2a')]);if(_0x16b073['name']){delete _0x16b073[_0xa2e7('0x2b')];}_0x41495a['status'](_0x48f9e7)[_0xa2e7('0x2c')](_0x16b073);};}exports[_0xa2e7('0x2d')]=function(_0x3fc352,_0x5bf2a5){var _0x13808d={},_0xe43be1={},_0x1a5d2c={'count':0x0,'rows':[]};var _0x5365ed=_[_0xa2e7('0x2e')](db[_0xa2e7('0x2f')][_0xa2e7('0x30')],function(_0x1ccfd1){return{'name':_0x1ccfd1[_0xa2e7('0x31')],'type':_0x1ccfd1[_0xa2e7('0x32')][_0xa2e7('0x33')]};});_0xe43be1[_0xa2e7('0x34')]=_['map'](_0x5365ed,'name');_0xe43be1[_0xa2e7('0x35')]=_['keys'](_0x3fc352[_0xa2e7('0x35')]);_0xe43be1['filters']=_[_0xa2e7('0x36')](_0xe43be1[_0xa2e7('0x34')],_0xe43be1[_0xa2e7('0x35')]);_0x13808d[_0xa2e7('0x37')]=_[_0xa2e7('0x36')](_0xe43be1[_0xa2e7('0x34')],qs[_0xa2e7('0x38')](_0x3fc352['query']['fields']));_0x13808d['attributes']=_0x13808d['attributes']['length']?_0x13808d[_0xa2e7('0x37')]:_0xe43be1[_0xa2e7('0x34')];if(!_0x3fc352[_0xa2e7('0x35')][_0xa2e7('0x39')](_0xa2e7('0x3a'))){_0x13808d['limit']=qs[_0xa2e7('0x3b')](_0x3fc352[_0xa2e7('0x35')][_0xa2e7('0x3b')]);_0x13808d[_0xa2e7('0x1f')]=qs[_0xa2e7('0x1f')](_0x3fc352['query'][_0xa2e7('0x1f')]);}_0x13808d[_0xa2e7('0x3c')]=qs['sort'](_0x3fc352[_0xa2e7('0x35')]['sort']);_0x13808d[_0xa2e7('0x3d')]=qs[_0xa2e7('0x3e')](_[_0xa2e7('0x3f')](_0x3fc352[_0xa2e7('0x35')],_0xe43be1[_0xa2e7('0x3e')]),_0x5365ed);if(_0x3fc352[_0xa2e7('0x35')][_0xa2e7('0x40')]){_0x13808d[_0xa2e7('0x3d')]=_['merge'](_0x13808d[_0xa2e7('0x3d')],{'$or':_['map'](_0x5365ed,function(_0x29cbbd){if(_0x29cbbd[_0xa2e7('0x32')]!==_0xa2e7('0x41')){var _0x20c7f0={};_0x20c7f0[_0x29cbbd['name']]={'$like':'%'+_0x3fc352[_0xa2e7('0x35')][_0xa2e7('0x40')]+'%'};return _0x20c7f0;}})});}_0x13808d=_[_0xa2e7('0x42')]({},_0x13808d,_0x3fc352[_0xa2e7('0x43')]);var _0x3c591f={'where':_0x13808d[_0xa2e7('0x3d')]};return db[_0xa2e7('0x2f')][_0xa2e7('0x20')](_0x3c591f)[_0xa2e7('0x26')](function(_0x5d735e){_0x1a5d2c[_0xa2e7('0x20')]=_0x5d735e;if(_0x3fc352[_0xa2e7('0x35')]['includeAll']){_0x13808d[_0xa2e7('0x44')]=[{'all':!![]}];}return db[_0xa2e7('0x2f')]['findAll'](_0x13808d);})[_0xa2e7('0x26')](function(_0x5c1344){_0x1a5d2c[_0xa2e7('0x45')]=_0x5c1344;return _0x1a5d2c;})[_0xa2e7('0x26')](respondWithFilteredResult(_0x5bf2a5,_0x13808d))[_0xa2e7('0x46')](handleError(_0x5bf2a5,null));};exports['show']=function(_0x269a61,_0x53b7d0){var _0x126b31={'raw':![],'where':{'id':_0x269a61[_0xa2e7('0x47')]['id']}},_0x290691={};_0x290691[_0xa2e7('0x34')]=_[_0xa2e7('0x48')](db[_0xa2e7('0x2f')]['rawAttributes']);_0x290691[_0xa2e7('0x35')]=_[_0xa2e7('0x48')](_0x269a61[_0xa2e7('0x35')]);_0x290691['filters']=_['intersection'](_0x290691[_0xa2e7('0x34')],_0x290691[_0xa2e7('0x35')]);_0x126b31[_0xa2e7('0x37')]=_['intersection'](_0x290691[_0xa2e7('0x34')],qs[_0xa2e7('0x38')](_0x269a61[_0xa2e7('0x35')]['fields']));_0x126b31['attributes']=_0x126b31[_0xa2e7('0x37')][_0xa2e7('0x49')]?_0x126b31[_0xa2e7('0x37')]:_0x290691[_0xa2e7('0x34')];if(_0x269a61[_0xa2e7('0x35')][_0xa2e7('0x4a')]){_0x126b31[_0xa2e7('0x44')]=[{'all':!![]}];}_0x126b31=_[_0xa2e7('0x42')]({},_0x126b31,_0x269a61[_0xa2e7('0x43')]);return db['Dynamics365Configuration']['find'](_0x126b31)[_0xa2e7('0x26')](handleEntityNotFound(_0x53b7d0,null))[_0xa2e7('0x26')](respondWithResult(_0x53b7d0,null))[_0xa2e7('0x46')](handleError(_0x53b7d0,null));};exports['create']=function(_0x2cc5e9,_0x750a21){return db[_0xa2e7('0x2f')][_0xa2e7('0x4b')](_0x2cc5e9['body'],{})[_0xa2e7('0x26')](respondWithResult(_0x750a21,0xc9))[_0xa2e7('0x46')](handleError(_0x750a21,null));};exports[_0xa2e7('0x25')]=function(_0x29d6b6,_0x2b712c){if(_0x29d6b6[_0xa2e7('0x4c')]['id']){delete _0x29d6b6[_0xa2e7('0x4c')]['id'];}return db[_0xa2e7('0x2f')][_0xa2e7('0x4d')]({'where':{'id':_0x29d6b6[_0xa2e7('0x47')]['id']}})['then'](handleEntityNotFound(_0x2b712c,null))[_0xa2e7('0x26')](saveUpdates(_0x29d6b6[_0xa2e7('0x4c')],null))['then'](respondWithResult(_0x2b712c,null))[_0xa2e7('0x46')](handleError(_0x2b712c,null));};exports[_0xa2e7('0x27')]=function(_0x25530e,_0x478c85){return db[_0xa2e7('0x2f')][_0xa2e7('0x4d')]({'where':{'id':_0x25530e[_0xa2e7('0x47')]['id']}})['then'](handleEntityNotFound(_0x478c85,null))[_0xa2e7('0x26')](removeEntity(_0x478c85,null))['catch'](handleError(_0x478c85,null));};exports[_0xa2e7('0x4e')]=function(_0x1e8354,_0x4ccc47,_0x39c412){var _0x3b1119={};var _0x3483b5={};var _0x194818;var _0x31b818;return db[_0xa2e7('0x2f')][_0xa2e7('0x4f')]({'where':{'id':_0x1e8354[_0xa2e7('0x47')]['id']}})[_0xa2e7('0x26')](handleEntityNotFound(_0x4ccc47,null))['then'](function(_0x16afcb){if(_0x16afcb){_0x194818=_0x16afcb;_0x3483b5['model']=_['keys'](db[_0xa2e7('0x50')][_0xa2e7('0x30')]);_0x3483b5[_0xa2e7('0x35')]=_[_0xa2e7('0x48')](_0x1e8354['query']);_0x3483b5[_0xa2e7('0x3e')]=_[_0xa2e7('0x36')](_0x3483b5[_0xa2e7('0x34')],_0x3483b5[_0xa2e7('0x35')]);_0x3b1119[_0xa2e7('0x37')]=_['intersection'](_0x3483b5['model'],qs['fields'](_0x1e8354[_0xa2e7('0x35')][_0xa2e7('0x38')]));_0x3b1119[_0xa2e7('0x37')]=_0x3b1119['attributes'][_0xa2e7('0x49')]?_0x3b1119[_0xa2e7('0x37')]:_0x3483b5[_0xa2e7('0x34')];_0x3b1119[_0xa2e7('0x3c')]=qs[_0xa2e7('0x51')](_0x1e8354[_0xa2e7('0x35')][_0xa2e7('0x51')]);_0x3b1119['where']=qs[_0xa2e7('0x3e')](_[_0xa2e7('0x3f')](_0x1e8354['query'],_0x3483b5[_0xa2e7('0x3e')]));if(_0x1e8354[_0xa2e7('0x35')]['filter']){_0x3b1119['where']=_[_0xa2e7('0x42')](_0x3b1119['where'],{'$or':_[_0xa2e7('0x2e')](_0x3b1119[_0xa2e7('0x37')],function(_0x4efb3f){var _0x1f5f07={};_0x1f5f07[_0x4efb3f]={'$like':'%'+_0x1e8354[_0xa2e7('0x35')]['filter']+'%'};return _0x1f5f07;})});}_0x3b1119=_[_0xa2e7('0x42')]({},_0x3b1119,_0x1e8354[_0xa2e7('0x43')]);return _0x194818['getFields'](_0x3b1119);}})['then'](function(_0x106818){if(_0x106818){_0x31b818=_0x106818[_0xa2e7('0x49')];if(!_0x1e8354[_0xa2e7('0x35')][_0xa2e7('0x39')](_0xa2e7('0x3a'))){_0x3b1119[_0xa2e7('0x3b')]=qs[_0xa2e7('0x3b')](_0x1e8354['query']['limit']);_0x3b1119[_0xa2e7('0x1f')]=qs[_0xa2e7('0x1f')](_0x1e8354[_0xa2e7('0x35')][_0xa2e7('0x1f')]);}return _0x194818[_0xa2e7('0x4e')](_0x3b1119);}})[_0xa2e7('0x26')](function(_0x14db6b){if(_0x14db6b){return _0x14db6b?{'count':_0x31b818,'rows':_0x14db6b}:null;}})[_0xa2e7('0x26')](respondWithResult(_0x4ccc47,null))[_0xa2e7('0x46')](handleError(_0x4ccc47,null));};exports[_0xa2e7('0x52')]=function(_0x3eb530,_0x12ca5e,_0x2e7656){var _0x212a32={};var _0x19ba17={};var _0x380b4e;var _0x10a374;return db[_0xa2e7('0x2f')]['findOne']({'where':{'id':_0x3eb530['params']['id']}})['then'](handleEntityNotFound(_0x12ca5e,null))[_0xa2e7('0x26')](function(_0x126049){if(_0x126049){_0x380b4e=_0x126049;_0x19ba17[_0xa2e7('0x34')]=_['keys'](db['Dynamics365Field'][_0xa2e7('0x30')]);_0x19ba17[_0xa2e7('0x35')]=_['keys'](_0x3eb530['query']);_0x19ba17[_0xa2e7('0x3e')]=_[_0xa2e7('0x36')](_0x19ba17['model'],_0x19ba17[_0xa2e7('0x35')]);_0x212a32[_0xa2e7('0x37')]=_['intersection'](_0x19ba17[_0xa2e7('0x34')],qs['fields'](_0x3eb530['query'][_0xa2e7('0x38')]));_0x212a32[_0xa2e7('0x37')]=_0x212a32[_0xa2e7('0x37')][_0xa2e7('0x49')]?_0x212a32[_0xa2e7('0x37')]:_0x19ba17[_0xa2e7('0x34')];_0x212a32['order']=qs[_0xa2e7('0x51')](_0x3eb530[_0xa2e7('0x35')]['sort']);_0x212a32[_0xa2e7('0x3d')]=qs['filters'](_[_0xa2e7('0x3f')](_0x3eb530[_0xa2e7('0x35')],_0x19ba17[_0xa2e7('0x3e')]));if(_0x3eb530[_0xa2e7('0x35')][_0xa2e7('0x40')]){_0x212a32[_0xa2e7('0x3d')]=_[_0xa2e7('0x42')](_0x212a32[_0xa2e7('0x3d')],{'$or':_[_0xa2e7('0x2e')](_0x212a32[_0xa2e7('0x37')],function(_0xef8849){var _0x279ca9={};_0x279ca9[_0xef8849]={'$like':'%'+_0x3eb530['query'][_0xa2e7('0x40')]+'%'};return _0x279ca9;})});}_0x212a32=_['merge']({},_0x212a32,_0x3eb530['options']);return _0x380b4e[_0xa2e7('0x52')](_0x212a32);}})[_0xa2e7('0x26')](function(_0x49cff9){if(_0x49cff9){_0x10a374=_0x49cff9[_0xa2e7('0x49')];if(!_0x3eb530[_0xa2e7('0x35')][_0xa2e7('0x39')](_0xa2e7('0x3a'))){_0x212a32[_0xa2e7('0x3b')]=qs['limit'](_0x3eb530[_0xa2e7('0x35')]['limit']);_0x212a32[_0xa2e7('0x1f')]=qs[_0xa2e7('0x1f')](_0x3eb530[_0xa2e7('0x35')][_0xa2e7('0x1f')]);}return _0x380b4e['getSubjects'](_0x212a32);}})[_0xa2e7('0x26')](function(_0x4034eb){if(_0x4034eb){return _0x4034eb?{'count':_0x10a374,'rows':_0x4034eb}:null;}})[_0xa2e7('0x26')](respondWithResult(_0x12ca5e,null))[_0xa2e7('0x46')](handleError(_0x12ca5e,null));};exports[_0xa2e7('0x53')]=function(_0x485f86,_0x2100c0,_0xac66f4){var _0xa4e290={};var _0x3b5a42={};var _0xec3f23;var _0x1f9a21;return db['Dynamics365Configuration']['findOne']({'where':{'id':_0x485f86[_0xa2e7('0x47')]['id']}})['then'](handleEntityNotFound(_0x2100c0,null))[_0xa2e7('0x26')](function(_0x5609c0){if(_0x5609c0){_0xec3f23=_0x5609c0;_0x3b5a42['model']=_[_0xa2e7('0x48')](db[_0xa2e7('0x50')][_0xa2e7('0x30')]);_0x3b5a42[_0xa2e7('0x35')]=_[_0xa2e7('0x48')](_0x485f86[_0xa2e7('0x35')]);_0x3b5a42[_0xa2e7('0x3e')]=_[_0xa2e7('0x36')](_0x3b5a42[_0xa2e7('0x34')],_0x3b5a42[_0xa2e7('0x35')]);_0xa4e290[_0xa2e7('0x37')]=_[_0xa2e7('0x36')](_0x3b5a42[_0xa2e7('0x34')],qs[_0xa2e7('0x38')](_0x485f86['query']['fields']));_0xa4e290['attributes']=_0xa4e290[_0xa2e7('0x37')][_0xa2e7('0x49')]?_0xa4e290[_0xa2e7('0x37')]:_0x3b5a42[_0xa2e7('0x34')];_0xa4e290['order']=qs[_0xa2e7('0x51')](_0x485f86[_0xa2e7('0x35')][_0xa2e7('0x51')]);_0xa4e290[_0xa2e7('0x3d')]=qs[_0xa2e7('0x3e')](_[_0xa2e7('0x3f')](_0x485f86[_0xa2e7('0x35')],_0x3b5a42['filters']));if(_0x485f86['query'][_0xa2e7('0x40')]){_0xa4e290[_0xa2e7('0x3d')]=_[_0xa2e7('0x42')](_0xa4e290[_0xa2e7('0x3d')],{'$or':_[_0xa2e7('0x2e')](_0xa4e290[_0xa2e7('0x37')],function(_0x5ef499){var _0x208c8={};_0x208c8[_0x5ef499]={'$like':'%'+_0x485f86['query']['filter']+'%'};return _0x208c8;})});}_0xa4e290=_[_0xa2e7('0x42')]({},_0xa4e290,_0x485f86[_0xa2e7('0x43')]);return _0xec3f23['getDescriptions'](_0xa4e290);}})[_0xa2e7('0x26')](function(_0x45d9f5){if(_0x45d9f5){_0x1f9a21=_0x45d9f5[_0xa2e7('0x49')];if(!_0x485f86[_0xa2e7('0x35')]['hasOwnProperty'](_0xa2e7('0x3a'))){_0xa4e290[_0xa2e7('0x3b')]=qs[_0xa2e7('0x3b')](_0x485f86['query'][_0xa2e7('0x3b')]);_0xa4e290[_0xa2e7('0x1f')]=qs[_0xa2e7('0x1f')](_0x485f86['query'][_0xa2e7('0x1f')]);}return _0xec3f23[_0xa2e7('0x53')](_0xa4e290);}})['then'](function(_0x14890d){if(_0x14890d){return _0x14890d?{'count':_0x1f9a21,'rows':_0x14890d}:null;}})['then'](respondWithResult(_0x2100c0,null))[_0xa2e7('0x46')](handleError(_0x2100c0,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index 4e18550..5fd78cb 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 _0xdace=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','Dynamics365Configuration','int_dynamics365_configurations','lodash'];(function(_0x257805,_0x5583aa){var _0x5e21e9=function(_0x478a56){while(--_0x478a56){_0x257805['push'](_0x257805['shift']());}};_0x5e21e9(++_0x5583aa);}(_0xdace,0xc5));var _0xedac=function(_0x2d9c6a,_0x59393d){_0x2d9c6a=_0x2d9c6a-0x0;var _0xf3c918=_0xdace[_0x2d9c6a];return _0xf3c918;};'use strict';var _=require(_0xedac('0x0'));var util=require('util');var logger=require(_0xedac('0x1'))(_0xedac('0x2'));var moment=require(_0xedac('0x3'));var BPromise=require('bluebird');var rp=require(_0xedac('0x4'));var fs=require('fs');var path=require(_0xedac('0x5'));var rimraf=require(_0xedac('0x6'));var config=require(_0xedac('0x7'));var attributes=require('./intDynamics365Configuration.attributes');module[_0xedac('0x8')]=function(_0x1cba89,_0x39328a){return _0x1cba89['define'](_0xedac('0x9'),attributes,{'tableName':_0xedac('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x54ef=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','define','Dynamics365Configuration','lodash','util'];(function(_0x11b616,_0x744c44){var _0x4ec9ae=function(_0x58e5a3){while(--_0x58e5a3){_0x11b616['push'](_0x11b616['shift']());}};_0x4ec9ae(++_0x744c44);}(_0x54ef,0x112));var _0xf54e=function(_0x5aee24,_0x123255){_0x5aee24=_0x5aee24-0x0;var _0x425181=_0x54ef[_0x5aee24];return _0x425181;};'use strict';var _=require(_0xf54e('0x0'));var util=require(_0xf54e('0x1'));var logger=require(_0xf54e('0x2'))('api');var moment=require(_0xf54e('0x3'));var BPromise=require(_0xf54e('0x4'));var rp=require(_0xf54e('0x5'));var fs=require('fs');var path=require(_0xf54e('0x6'));var rimraf=require(_0xf54e('0x7'));var config=require(_0xf54e('0x8'));var attributes=require(_0xf54e('0x9'));module['exports']=function(_0x55e611,_0x18e84e){return _0x55e611[_0xf54e('0xa')](_0xf54e('0xb'),attributes,{'tableName':'int_dynamics365_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js index 4bec673..cbdcfc7 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 _0xf2e1=['../../mysqldb','../../config/logger','jayson/promise','client','http','request','then','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','bluebird','randomstring'];(function(_0x2dee81,_0x58c3df){var _0xa3a214=function(_0x459326){while(--_0x459326){_0x2dee81['push'](_0x2dee81['shift']());}};_0xa3a214(++_0x58c3df);}(_0xf2e1,0x74));var _0x1f2e=function(_0x1fc447,_0x151365){_0x1fc447=_0x1fc447-0x0;var _0x1c98af=_0xf2e1[_0x1fc447];return _0x1c98af;};'use strict';var _=require('lodash');var util=require(_0x1f2e('0x0'));var moment=require(_0x1f2e('0x1'));var BPromise=require(_0x1f2e('0x2'));var rs=require(_0x1f2e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1f2e('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x1f2e('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x1f2e('0x6'));var client=jayson[_0x1f2e('0x7')][_0x1f2e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2ced6e,_0x5bb74e,_0x2c3276){return new BPromise(function(_0x3fab52,_0x5a06be){return client[_0x1f2e('0x9')](_0x2ced6e,_0x2c3276)[_0x1f2e('0xa')](function(_0x2af391){logger['info'](_0x1f2e('0xb'),_0x5bb74e,_0x1f2e('0xc'));logger[_0x1f2e('0xd')](_0x1f2e('0xe'),_0x5bb74e,_0x1f2e('0xc'),JSON[_0x1f2e('0xf')](_0x2af391));if(_0x2af391[_0x1f2e('0x10')]){if(_0x2af391['error']['code']===0x1f4){logger[_0x1f2e('0x10')](_0x1f2e('0xb'),_0x5bb74e,_0x2af391[_0x1f2e('0x10')][_0x1f2e('0x11')]);return _0x5a06be(_0x2af391['error'][_0x1f2e('0x11')]);}logger[_0x1f2e('0x10')](_0x1f2e('0xb'),_0x5bb74e,_0x2af391[_0x1f2e('0x10')]['message']);return _0x3fab52(_0x2af391[_0x1f2e('0x10')][_0x1f2e('0x11')]);}else{logger['info'](_0x1f2e('0xb'),_0x5bb74e,_0x1f2e('0xc'));_0x3fab52(_0x2af391[_0x1f2e('0x12')][_0x1f2e('0x11')]);}})[_0x1f2e('0x13')](function(_0x3b1ee4){logger[_0x1f2e('0x10')](_0x1f2e('0xb'),_0x5bb74e,_0x3b1ee4);_0x5a06be(_0x3b1ee4);});});} \ No newline at end of file +var _0xb5cc=['Dynamics365Configuration,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x584f66,_0x39a037){var _0x3908b4=function(_0x452df3){while(--_0x452df3){_0x584f66['push'](_0x584f66['shift']());}};_0x3908b4(++_0x39a037);}(_0xb5cc,0x139));var _0xcb5c=function(_0x348ac9,_0x1f39b9){_0x348ac9=_0x348ac9-0x0;var _0x18148e=_0xb5cc[_0x348ac9];return _0x18148e;};'use strict';var _=require(_0xcb5c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xcb5c('0x1'));var rs=require(_0xcb5c('0x2'));var fs=require('fs');var Redis=require(_0xcb5c('0x3'));var db=require(_0xcb5c('0x4'))['db'];var utils=require(_0xcb5c('0x5'));var logger=require(_0xcb5c('0x6'))(_0xcb5c('0x7'));var config=require(_0xcb5c('0x8'));var jayson=require(_0xcb5c('0x9'));var client=jayson[_0xcb5c('0xa')][_0xcb5c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4b3d1b,_0x48ff65,_0x213e57){return new BPromise(function(_0x167b97,_0x6e458b){return client[_0xcb5c('0xc')](_0x4b3d1b,_0x213e57)['then'](function(_0x4e396a){logger[_0xcb5c('0xd')](_0xcb5c('0xe'),_0x48ff65,_0xcb5c('0xf'));logger[_0xcb5c('0x10')](_0xcb5c('0x11'),_0x48ff65,_0xcb5c('0xf'),JSON['stringify'](_0x4e396a));if(_0x4e396a[_0xcb5c('0x12')]){if(_0x4e396a[_0xcb5c('0x12')][_0xcb5c('0x13')]===0x1f4){logger[_0xcb5c('0x12')](_0xcb5c('0xe'),_0x48ff65,_0x4e396a['error']['message']);return _0x6e458b(_0x4e396a[_0xcb5c('0x12')][_0xcb5c('0x14')]);}logger[_0xcb5c('0x12')](_0xcb5c('0xe'),_0x48ff65,_0x4e396a[_0xcb5c('0x12')][_0xcb5c('0x14')]);return _0x167b97(_0x4e396a[_0xcb5c('0x12')]['message']);}else{logger[_0xcb5c('0xd')](_0xcb5c('0xe'),_0x48ff65,_0xcb5c('0xf'));_0x167b97(_0x4e396a['result'][_0xcb5c('0x14')]);}})[_0xcb5c('0x15')](function(_0x5f5d10){logger[_0xcb5c('0x12')](_0xcb5c('0xe'),_0x48ff65,_0x5f5d10);_0x6e458b(_0x5f5d10);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 8d62fbd..523ffbf 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 _0x1a0a=['get','index','show','post','isAuthenticated','create','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller'];(function(_0x258e7f,_0x489a5f){var _0x3aea47=function(_0x38b343){while(--_0x38b343){_0x258e7f['push'](_0x258e7f['shift']());}};_0x3aea47(++_0x489a5f);}(_0x1a0a,0x19b));var _0xa1a0=function(_0x572165,_0x6a45cc){_0x572165=_0x572165-0x0;var _0x8c8709=_0x1a0a[_0x572165];return _0x8c8709;};'use strict';var multer=require(_0xa1a0('0x0'));var util=require('util');var path=require(_0xa1a0('0x1'));var timeout=require(_0xa1a0('0x2'));var express=require('express');var router=express[_0xa1a0('0x3')]();var fs_extra=require(_0xa1a0('0x4'));var auth=require(_0xa1a0('0x5'));var interaction=require(_0xa1a0('0x6'));var config=require(_0xa1a0('0x7'));var controller=require(_0xa1a0('0x8'));router[_0xa1a0('0x9')]('/',auth['isAuthenticated'](),controller[_0xa1a0('0xa')]);router[_0xa1a0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xa1a0('0xb')]);router[_0xa1a0('0xc')]('/',auth[_0xa1a0('0xd')](),controller[_0xa1a0('0xe')]);router[_0xa1a0('0xf')](_0xa1a0('0x10'),auth[_0xa1a0('0xd')](),controller[_0xa1a0('0x11')]);router[_0xa1a0('0x12')](_0xa1a0('0x10'),auth[_0xa1a0('0xd')](),controller[_0xa1a0('0x13')]);module[_0xa1a0('0x14')]=router; \ No newline at end of file +var _0xeeb2=['../../config/environment','./intDynamics365Field.controller','get','index','/:id','isAuthenticated','show','post','create','put','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x1f99a0,_0x50b73d){var _0x1e0849=function(_0x41e764){while(--_0x41e764){_0x1f99a0['push'](_0x1f99a0['shift']());}};_0x1e0849(++_0x50b73d);}(_0xeeb2,0x1d4));var _0x2eeb=function(_0xf6aec0,_0x51ffd6){_0xf6aec0=_0xf6aec0-0x0;var _0x59a51b=_0xeeb2[_0xf6aec0];return _0x59a51b;};'use strict';var multer=require(_0x2eeb('0x0'));var util=require(_0x2eeb('0x1'));var path=require(_0x2eeb('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2eeb('0x3')]();var fs_extra=require(_0x2eeb('0x4'));var auth=require(_0x2eeb('0x5'));var interaction=require(_0x2eeb('0x6'));var config=require(_0x2eeb('0x7'));var controller=require(_0x2eeb('0x8'));router[_0x2eeb('0x9')]('/',auth['isAuthenticated'](),controller[_0x2eeb('0xa')]);router['get'](_0x2eeb('0xb'),auth[_0x2eeb('0xc')](),controller[_0x2eeb('0xd')]);router[_0x2eeb('0xe')]('/',auth[_0x2eeb('0xc')](),controller[_0x2eeb('0xf')]);router[_0x2eeb('0x10')](_0x2eeb('0xb'),auth[_0x2eeb('0xc')](),controller['update']);router['delete'](_0x2eeb('0xb'),auth[_0x2eeb('0xc')](),controller[_0x2eeb('0x11')]);module[_0x2eeb('0x12')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index d5996de..0c85bf1 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 _0x3c96=['keyValue','picklist','STRING','ENUM','sequelize','exports','string','variable','customVariable'];(function(_0xeb0250,_0x3ab3a9){var _0x56bb03=function(_0x4ed91b){while(--_0x4ed91b){_0xeb0250['push'](_0xeb0250['shift']());}};_0x56bb03(++_0x3ab3a9);}(_0x3c96,0x11b));var _0x63c9=function(_0x58ed49,_0x444ae4){_0x58ed49=_0x58ed49-0x0;var _0x179f27=_0x3c96[_0x58ed49];return _0x179f27;};'use strict';var Sequelize=require(_0x63c9('0x0'));module[_0x63c9('0x1')]={'type':{'type':Sequelize['ENUM'](_0x63c9('0x2'),_0x63c9('0x3'),_0x63c9('0x4'),_0x63c9('0x5'),_0x63c9('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x63c9('0x7')]},'key':{'type':Sequelize[_0x63c9('0x7')]},'keyType':{'type':Sequelize[_0x63c9('0x8')](_0x63c9('0x2'),_0x63c9('0x3'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x63c9('0x7')]},'nameField':{'type':Sequelize[_0x63c9('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x63c9('0x7')]}}; \ No newline at end of file +var _0xeb64=['variable','customVariable','keyValue','STRING','ENUM','BOOLEAN','exports','string'];(function(_0x13f010,_0x3095ae){var _0x2cffba=function(_0x1ac3c9){while(--_0x1ac3c9){_0x13f010['push'](_0x13f010['shift']());}};_0x2cffba(++_0x3095ae);}(_0xeb64,0x146));var _0x4eb6=function(_0x1c3a04,_0x392170){_0x1c3a04=_0x1c3a04-0x0;var _0x1eecf5=_0xeb64[_0x1c3a04];return _0x1eecf5;};'use strict';var Sequelize=require('sequelize');module[_0x4eb6('0x0')]={'type':{'type':Sequelize['ENUM'](_0x4eb6('0x1'),_0x4eb6('0x2'),_0x4eb6('0x3'),_0x4eb6('0x4'),'picklist'),'defaultValue':_0x4eb6('0x1')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x4eb6('0x5')]},'keyType':{'type':Sequelize[_0x4eb6('0x6')](_0x4eb6('0x1'),_0x4eb6('0x2'),_0x4eb6('0x3'))},'keyContent':{'type':Sequelize[_0x4eb6('0x5')]},'idField':{'type':Sequelize[_0x4eb6('0x5')]},'nameField':{'type':Sequelize[_0x4eb6('0x5')]},'customField':{'type':Sequelize[_0x4eb6('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x4eb6('0x5')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index 5813179..759d2d8 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 _0x32e7=['undefined','Content-Range','apply','reject','save','update','destroy','then','end','error','stack','map','Dynamics365Field','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','count','includeAll','include','findAll','catch','show','params','find','body','eml-format','fast-json-patch','moment','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','limit'];(function(_0x4a09eb,_0x13c38f){var _0x52f650=function(_0x21fde2){while(--_0x21fde2){_0x4a09eb['push'](_0x4a09eb['shift']());}};_0x52f650(++_0x13c38f);}(_0x32e7,0x100));var _0x732e=function(_0x98c0fe,_0x520dc7){_0x98c0fe=_0x98c0fe-0x0;var _0x5eafe2=_0x32e7[_0x98c0fe];return _0x5eafe2;};'use strict';var emlformat=require(_0x732e('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x732e('0x1'));var rp=require('request-promise');var moment=require(_0x732e('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x732e('0x3'));var path=require(_0x732e('0x4'));var sox=require(_0x732e('0x5'));var csv=require(_0x732e('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x732e('0x7'));var _=require(_0x732e('0x8'));var squel=require(_0x732e('0x9'));var crypto=require(_0x732e('0xa'));var jsforce=require(_0x732e('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x732e('0xc'));var Papa=require(_0x732e('0xd'));var Redis=require(_0x732e('0xe'));var authService=require(_0x732e('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x732e('0x10'));var hardwareService=require(_0x732e('0x11'));var logger=require(_0x732e('0x12'))(_0x732e('0x13'));var utils=require(_0x732e('0x14'));var config=require(_0x732e('0x15'));var licenseUtil=require(_0x732e('0x16'));var db=require(_0x732e('0x17'))['db'];function respondWithStatusCode(_0x5aa4c2,_0x182e3c){_0x182e3c=_0x182e3c||0xcc;return function(_0x5728a2){if(_0x5728a2){return _0x5aa4c2['sendStatus'](_0x182e3c);}return _0x5aa4c2[_0x732e('0x18')](_0x182e3c)['end']();};}function respondWithResult(_0x32f964,_0x564863){_0x564863=_0x564863||0xc8;return function(_0x23cedb){if(_0x23cedb){return _0x32f964['status'](_0x564863)[_0x732e('0x19')](_0x23cedb);}};}function respondWithFilteredResult(_0x1a46c7,_0x29a74a){return function(_0x2dc825){if(_0x2dc825){var _0x570367=typeof _0x29a74a[_0x732e('0x1a')]==='undefined'&&typeof _0x29a74a[_0x732e('0x1b')]===_0x732e('0x1c');var _0x56d854=_0x2dc825['count'];var _0x3169f6=_0x570367?0x0:_0x29a74a['offset'];var _0xc5c925=_0x570367?_0x2dc825['count']:_0x29a74a[_0x732e('0x1a')]+_0x29a74a[_0x732e('0x1b')];var _0x5a3698;if(_0xc5c925>=_0x56d854){_0xc5c925=_0x56d854;_0x5a3698=0xc8;}else{_0x5a3698=0xce;}_0x1a46c7[_0x732e('0x18')](_0x5a3698);return _0x1a46c7['set'](_0x732e('0x1d'),_0x3169f6+'-'+_0xc5c925+'/'+_0x56d854)[_0x732e('0x19')](_0x2dc825);}return null;};}function patchUpdates(_0x3d04d4){return function(_0x3abb2b){try{jsonpatch[_0x732e('0x1e')](_0x3abb2b,_0x3d04d4,!![]);}catch(_0x31dd4f){return BPromise[_0x732e('0x1f')](_0x31dd4f);}return _0x3abb2b[_0x732e('0x20')]();};}function saveUpdates(_0x572279,_0x1cd98f){return function(_0x3cea9f){if(_0x3cea9f){return _0x3cea9f[_0x732e('0x21')](_0x572279)['then'](function(_0x5c0bf9){return _0x5c0bf9;});}return null;};}function removeEntity(_0x5aa503,_0x1cf5a9){return function(_0x1c4396){if(_0x1c4396){return _0x1c4396[_0x732e('0x22')]()[_0x732e('0x23')](function(){_0x5aa503[_0x732e('0x18')](0xcc)[_0x732e('0x24')]();});}};}function handleEntityNotFound(_0x57f1e7,_0x2a2b0c){return function(_0x5a108e){if(!_0x5a108e){_0x57f1e7['sendStatus'](0x194);}return _0x5a108e;};}function handleError(_0x4cafdb,_0x3f10bd){_0x3f10bd=_0x3f10bd||0x1f4;return function(_0x40dc11){logger[_0x732e('0x25')](_0x40dc11[_0x732e('0x26')]);if(_0x40dc11['name']){delete _0x40dc11['name'];}_0x4cafdb['status'](_0x3f10bd)['send'](_0x40dc11);};}exports['index']=function(_0x29324f,_0x5186e8){var _0x2d0371={},_0x49537d={},_0xc0ab01={'count':0x0,'rows':[]};var _0x145044=_[_0x732e('0x27')](db[_0x732e('0x28')][_0x732e('0x29')],function(_0x2590e8){return{'name':_0x2590e8[_0x732e('0x2a')],'type':_0x2590e8[_0x732e('0x2b')][_0x732e('0x2c')]};});_0x49537d['model']=_[_0x732e('0x27')](_0x145044,'name');_0x49537d[_0x732e('0x2d')]=_[_0x732e('0x2e')](_0x29324f[_0x732e('0x2d')]);_0x49537d['filters']=_[_0x732e('0x2f')](_0x49537d[_0x732e('0x30')],_0x49537d['query']);_0x2d0371[_0x732e('0x31')]=_[_0x732e('0x2f')](_0x49537d[_0x732e('0x30')],qs[_0x732e('0x32')](_0x29324f[_0x732e('0x2d')][_0x732e('0x32')]));_0x2d0371['attributes']=_0x2d0371[_0x732e('0x31')][_0x732e('0x33')]?_0x2d0371[_0x732e('0x31')]:_0x49537d[_0x732e('0x30')];if(!_0x29324f[_0x732e('0x2d')][_0x732e('0x34')](_0x732e('0x35'))){_0x2d0371[_0x732e('0x1b')]=qs['limit'](_0x29324f[_0x732e('0x2d')][_0x732e('0x1b')]);_0x2d0371[_0x732e('0x1a')]=qs['offset'](_0x29324f[_0x732e('0x2d')][_0x732e('0x1a')]);}_0x2d0371[_0x732e('0x36')]=qs[_0x732e('0x37')](_0x29324f[_0x732e('0x2d')][_0x732e('0x37')]);_0x2d0371[_0x732e('0x38')]=qs['filters'](_[_0x732e('0x39')](_0x29324f[_0x732e('0x2d')],_0x49537d[_0x732e('0x3a')]),_0x145044);if(_0x29324f[_0x732e('0x2d')][_0x732e('0x3b')]){_0x2d0371[_0x732e('0x38')]=_[_0x732e('0x3c')](_0x2d0371[_0x732e('0x38')],{'$or':_[_0x732e('0x27')](_0x145044,function(_0x127f50){if(_0x127f50[_0x732e('0x2b')]!==_0x732e('0x3d')){var _0x1f486b={};_0x1f486b[_0x127f50['name']]={'$like':'%'+_0x29324f[_0x732e('0x2d')][_0x732e('0x3b')]+'%'};return _0x1f486b;}})});}_0x2d0371=_[_0x732e('0x3c')]({},_0x2d0371,_0x29324f['options']);var _0x14344b={'where':_0x2d0371[_0x732e('0x38')]};return db[_0x732e('0x28')][_0x732e('0x3e')](_0x14344b)[_0x732e('0x23')](function(_0x3ce2c9){_0xc0ab01['count']=_0x3ce2c9;if(_0x29324f[_0x732e('0x2d')][_0x732e('0x3f')]){_0x2d0371[_0x732e('0x40')]=[{'all':!![]}];}return db[_0x732e('0x28')][_0x732e('0x41')](_0x2d0371);})[_0x732e('0x23')](function(_0x131fd3){_0xc0ab01['rows']=_0x131fd3;return _0xc0ab01;})['then'](respondWithFilteredResult(_0x5186e8,_0x2d0371))[_0x732e('0x42')](handleError(_0x5186e8,null));};exports[_0x732e('0x43')]=function(_0x332d76,_0x59550d){var _0x3d9679={'raw':!![],'where':{'id':_0x332d76[_0x732e('0x44')]['id']}},_0x3e45c8={};_0x3e45c8['model']=_[_0x732e('0x2e')](db['Dynamics365Field']['rawAttributes']);_0x3e45c8[_0x732e('0x2d')]=_[_0x732e('0x2e')](_0x332d76[_0x732e('0x2d')]);_0x3e45c8[_0x732e('0x3a')]=_[_0x732e('0x2f')](_0x3e45c8[_0x732e('0x30')],_0x3e45c8[_0x732e('0x2d')]);_0x3d9679[_0x732e('0x31')]=_[_0x732e('0x2f')](_0x3e45c8[_0x732e('0x30')],qs['fields'](_0x332d76[_0x732e('0x2d')][_0x732e('0x32')]));_0x3d9679[_0x732e('0x31')]=_0x3d9679[_0x732e('0x31')][_0x732e('0x33')]?_0x3d9679[_0x732e('0x31')]:_0x3e45c8[_0x732e('0x30')];if(_0x332d76[_0x732e('0x2d')][_0x732e('0x3f')]){_0x3d9679[_0x732e('0x40')]=[{'all':!![]}];}_0x3d9679=_[_0x732e('0x3c')]({},_0x3d9679,_0x332d76['options']);return db[_0x732e('0x28')][_0x732e('0x45')](_0x3d9679)['then'](handleEntityNotFound(_0x59550d,null))[_0x732e('0x23')](respondWithResult(_0x59550d,null))[_0x732e('0x42')](handleError(_0x59550d,null));};exports['create']=function(_0xb59d88,_0x4a463d){return db[_0x732e('0x28')]['create'](_0xb59d88[_0x732e('0x46')],{})[_0x732e('0x23')](respondWithResult(_0x4a463d,0xc9))['catch'](handleError(_0x4a463d,null));};exports['update']=function(_0x310a27,_0x9e0ff9){if(_0x310a27[_0x732e('0x46')]['id']){delete _0x310a27[_0x732e('0x46')]['id'];}return db['Dynamics365Field'][_0x732e('0x45')]({'where':{'id':_0x310a27[_0x732e('0x44')]['id']}})[_0x732e('0x23')](handleEntityNotFound(_0x9e0ff9,null))[_0x732e('0x23')](saveUpdates(_0x310a27[_0x732e('0x46')],null))['then'](respondWithResult(_0x9e0ff9,null))[_0x732e('0x42')](handleError(_0x9e0ff9,null));};exports[_0x732e('0x22')]=function(_0x356612,_0x1b9aed){return db[_0x732e('0x28')]['find']({'where':{'id':_0x356612[_0x732e('0x44')]['id']}})[_0x732e('0x23')](handleEntityNotFound(_0x1b9aed,null))['then'](removeEntity(_0x1b9aed,null))['catch'](handleError(_0x1b9aed,null));}; \ No newline at end of file +var _0x16ed=['limit','undefined','Content-Range','json','apply','reject','update','then','error','name','send','index','fieldName','key','keys','filters','intersection','model','attributes','fields','query','length','hasOwnProperty','sort','where','filter','map','type','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','params','Dynamics365Field','merge','create','body','find','destroy','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','sendStatus','status','end','offset'];(function(_0x5cb1af,_0x4bdc8c){var _0x8d7940=function(_0x3db70a){while(--_0x3db70a){_0x5cb1af['push'](_0x5cb1af['shift']());}};_0x8d7940(++_0x4bdc8c);}(_0x16ed,0x72));var _0xd16e=function(_0x3eb9fb,_0x5b8af6){_0x3eb9fb=_0x3eb9fb-0x0;var _0x4c9d13=_0x16ed[_0x3eb9fb];return _0x4c9d13;};'use strict';var emlformat=require(_0xd16e('0x0'));var rimraf=require(_0xd16e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd16e('0x2'));var rp=require(_0xd16e('0x3'));var moment=require(_0xd16e('0x4'));var BPromise=require(_0xd16e('0x5'));var Mustache=require(_0xd16e('0x6'));var util=require(_0xd16e('0x7'));var path=require(_0xd16e('0x8'));var sox=require(_0xd16e('0x9'));var csv=require('to-csv');var ejs=require(_0xd16e('0xa'));var fs=require('fs');var fs_extra=require(_0xd16e('0xb'));var _=require(_0xd16e('0xc'));var squel=require(_0xd16e('0xd'));var crypto=require(_0xd16e('0xe'));var jsforce=require(_0xd16e('0xf'));var deskjs=require(_0xd16e('0x10'));var toCsv=require(_0xd16e('0x11'));var querystring=require(_0xd16e('0x12'));var Papa=require('papaparse');var Redis=require(_0xd16e('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xd16e('0x14'));var as=require(_0xd16e('0x15'));var hardwareService=require(_0xd16e('0x16'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xd16e('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x13f018,_0x49f5d1){_0x49f5d1=_0x49f5d1||0xcc;return function(_0x5cb752){if(_0x5cb752){return _0x13f018[_0xd16e('0x18')](_0x49f5d1);}return _0x13f018[_0xd16e('0x19')](_0x49f5d1)[_0xd16e('0x1a')]();};}function respondWithResult(_0x1f9c9f,_0x3e472c){_0x3e472c=_0x3e472c||0xc8;return function(_0xbc1116){if(_0xbc1116){return _0x1f9c9f['status'](_0x3e472c)['json'](_0xbc1116);}};}function respondWithFilteredResult(_0xee0d19,_0x126f00){return function(_0x254d4c){if(_0x254d4c){var _0x5912ce=typeof _0x126f00[_0xd16e('0x1b')]==='undefined'&&typeof _0x126f00[_0xd16e('0x1c')]===_0xd16e('0x1d');var _0x27d449=_0x254d4c['count'];var _0x36cb8b=_0x5912ce?0x0:_0x126f00[_0xd16e('0x1b')];var _0x85adf=_0x5912ce?_0x254d4c['count']:_0x126f00[_0xd16e('0x1b')]+_0x126f00[_0xd16e('0x1c')];var _0x3afe21;if(_0x85adf>=_0x27d449){_0x85adf=_0x27d449;_0x3afe21=0xc8;}else{_0x3afe21=0xce;}_0xee0d19[_0xd16e('0x19')](_0x3afe21);return _0xee0d19['set'](_0xd16e('0x1e'),_0x36cb8b+'-'+_0x85adf+'/'+_0x27d449)[_0xd16e('0x1f')](_0x254d4c);}return null;};}function patchUpdates(_0x14be8b){return function(_0x4eecbc){try{jsonpatch[_0xd16e('0x20')](_0x4eecbc,_0x14be8b,!![]);}catch(_0x567708){return BPromise[_0xd16e('0x21')](_0x567708);}return _0x4eecbc['save']();};}function saveUpdates(_0x25e292,_0x540c46){return function(_0xd9d2e9){if(_0xd9d2e9){return _0xd9d2e9[_0xd16e('0x22')](_0x25e292)[_0xd16e('0x23')](function(_0x252cb7){return _0x252cb7;});}return null;};}function removeEntity(_0x3268e7,_0x1e4641){return function(_0x23cd6f){if(_0x23cd6f){return _0x23cd6f['destroy']()[_0xd16e('0x23')](function(){_0x3268e7[_0xd16e('0x19')](0xcc)[_0xd16e('0x1a')]();});}};}function handleEntityNotFound(_0xc88df6,_0x235213){return function(_0x5de428){if(!_0x5de428){_0xc88df6[_0xd16e('0x18')](0x194);}return _0x5de428;};}function handleError(_0x42dc87,_0x865696){_0x865696=_0x865696||0x1f4;return function(_0x56972e){logger[_0xd16e('0x24')](_0x56972e['stack']);if(_0x56972e[_0xd16e('0x25')]){delete _0x56972e[_0xd16e('0x25')];}_0x42dc87[_0xd16e('0x19')](_0x865696)[_0xd16e('0x26')](_0x56972e);};}exports[_0xd16e('0x27')]=function(_0x3fb025,_0x4979db){var _0x95376b={},_0x572031={},_0x232dbb={'count':0x0,'rows':[]};var _0x5b9223=_['map'](db['Dynamics365Field']['rawAttributes'],function(_0x2a5121){return{'name':_0x2a5121[_0xd16e('0x28')],'type':_0x2a5121['type'][_0xd16e('0x29')]};});_0x572031['model']=_['map'](_0x5b9223,_0xd16e('0x25'));_0x572031['query']=_[_0xd16e('0x2a')](_0x3fb025['query']);_0x572031[_0xd16e('0x2b')]=_[_0xd16e('0x2c')](_0x572031[_0xd16e('0x2d')],_0x572031['query']);_0x95376b[_0xd16e('0x2e')]=_['intersection'](_0x572031[_0xd16e('0x2d')],qs[_0xd16e('0x2f')](_0x3fb025[_0xd16e('0x30')][_0xd16e('0x2f')]));_0x95376b['attributes']=_0x95376b[_0xd16e('0x2e')][_0xd16e('0x31')]?_0x95376b[_0xd16e('0x2e')]:_0x572031[_0xd16e('0x2d')];if(!_0x3fb025[_0xd16e('0x30')][_0xd16e('0x32')]('nolimit')){_0x95376b['limit']=qs[_0xd16e('0x1c')](_0x3fb025[_0xd16e('0x30')][_0xd16e('0x1c')]);_0x95376b[_0xd16e('0x1b')]=qs[_0xd16e('0x1b')](_0x3fb025[_0xd16e('0x30')]['offset']);}_0x95376b['order']=qs[_0xd16e('0x33')](_0x3fb025[_0xd16e('0x30')]['sort']);_0x95376b[_0xd16e('0x34')]=qs[_0xd16e('0x2b')](_['pick'](_0x3fb025[_0xd16e('0x30')],_0x572031[_0xd16e('0x2b')]),_0x5b9223);if(_0x3fb025[_0xd16e('0x30')][_0xd16e('0x35')]){_0x95376b[_0xd16e('0x34')]=_['merge'](_0x95376b[_0xd16e('0x34')],{'$or':_[_0xd16e('0x36')](_0x5b9223,function(_0x895d3c){if(_0x895d3c[_0xd16e('0x37')]!==_0xd16e('0x38')){var _0x598339={};_0x598339[_0x895d3c[_0xd16e('0x25')]]={'$like':'%'+_0x3fb025['query']['filter']+'%'};return _0x598339;}})});}_0x95376b=_['merge']({},_0x95376b,_0x3fb025[_0xd16e('0x39')]);var _0x50d623={'where':_0x95376b[_0xd16e('0x34')]};return db['Dynamics365Field']['count'](_0x50d623)[_0xd16e('0x23')](function(_0x4e0529){_0x232dbb[_0xd16e('0x3a')]=_0x4e0529;if(_0x3fb025['query'][_0xd16e('0x3b')]){_0x95376b[_0xd16e('0x3c')]=[{'all':!![]}];}return db['Dynamics365Field'][_0xd16e('0x3d')](_0x95376b);})[_0xd16e('0x23')](function(_0x1221d6){_0x232dbb[_0xd16e('0x3e')]=_0x1221d6;return _0x232dbb;})[_0xd16e('0x23')](respondWithFilteredResult(_0x4979db,_0x95376b))[_0xd16e('0x3f')](handleError(_0x4979db,null));};exports['show']=function(_0x5c3ae8,_0xbc921d){var _0x39922b={'raw':!![],'where':{'id':_0x5c3ae8[_0xd16e('0x40')]['id']}},_0x111c12={};_0x111c12[_0xd16e('0x2d')]=_['keys'](db[_0xd16e('0x41')]['rawAttributes']);_0x111c12[_0xd16e('0x30')]=_[_0xd16e('0x2a')](_0x5c3ae8[_0xd16e('0x30')]);_0x111c12[_0xd16e('0x2b')]=_[_0xd16e('0x2c')](_0x111c12['model'],_0x111c12['query']);_0x39922b[_0xd16e('0x2e')]=_[_0xd16e('0x2c')](_0x111c12['model'],qs[_0xd16e('0x2f')](_0x5c3ae8['query']['fields']));_0x39922b[_0xd16e('0x2e')]=_0x39922b[_0xd16e('0x2e')]['length']?_0x39922b[_0xd16e('0x2e')]:_0x111c12[_0xd16e('0x2d')];if(_0x5c3ae8[_0xd16e('0x30')][_0xd16e('0x3b')]){_0x39922b[_0xd16e('0x3c')]=[{'all':!![]}];}_0x39922b=_[_0xd16e('0x42')]({},_0x39922b,_0x5c3ae8['options']);return db[_0xd16e('0x41')]['find'](_0x39922b)[_0xd16e('0x23')](handleEntityNotFound(_0xbc921d,null))[_0xd16e('0x23')](respondWithResult(_0xbc921d,null))[_0xd16e('0x3f')](handleError(_0xbc921d,null));};exports['create']=function(_0x41f867,_0x3b003b){return db[_0xd16e('0x41')][_0xd16e('0x43')](_0x41f867['body'],{})[_0xd16e('0x23')](respondWithResult(_0x3b003b,0xc9))[_0xd16e('0x3f')](handleError(_0x3b003b,null));};exports[_0xd16e('0x22')]=function(_0x1f99a4,_0x137754){if(_0x1f99a4['body']['id']){delete _0x1f99a4[_0xd16e('0x44')]['id'];}return db['Dynamics365Field'][_0xd16e('0x45')]({'where':{'id':_0x1f99a4[_0xd16e('0x40')]['id']}})[_0xd16e('0x23')](handleEntityNotFound(_0x137754,null))[_0xd16e('0x23')](saveUpdates(_0x1f99a4[_0xd16e('0x44')],null))[_0xd16e('0x23')](respondWithResult(_0x137754,null))[_0xd16e('0x3f')](handleError(_0x137754,null));};exports[_0xd16e('0x46')]=function(_0x3817a8,_0x446919){return db[_0xd16e('0x41')][_0xd16e('0x45')]({'where':{'id':_0x3817a8[_0xd16e('0x40')]['id']}})[_0xd16e('0x23')](handleEntityNotFound(_0x446919,null))[_0xd16e('0x23')](removeEntity(_0x446919,null))[_0xd16e('0x3f')](handleError(_0x446919,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 40a66da..630c642 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 _0xcd2e=['../../config/environment','./intDynamics365Field.attributes','exports','define','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xcd2e,0xaf));var _0xecd2=function(_0x571c1d,_0x3b0586){_0x571c1d=_0x571c1d-0x0;var _0x33c609=_0xcd2e[_0x571c1d];return _0x33c609;};'use strict';var _=require(_0xecd2('0x0'));var util=require('util');var logger=require(_0xecd2('0x1'))(_0xecd2('0x2'));var moment=require(_0xecd2('0x3'));var BPromise=require(_0xecd2('0x4'));var rp=require(_0xecd2('0x5'));var fs=require('fs');var path=require(_0xecd2('0x6'));var rimraf=require('rimraf');var config=require(_0xecd2('0x7'));var attributes=require(_0xecd2('0x8'));module[_0xecd2('0x9')]=function(_0x25a8ee,_0x3cf93f){return _0x25a8ee[_0xecd2('0xa')](_0xecd2('0xb'),attributes,{'tableName':_0xecd2('0xc'),'paranoid':![],'indexes':[{'name':_0xecd2('0xd'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xfbb0=['api','moment','bluebird','path','rimraf','../../config/environment','exports','define','Dynamics365Field','dynamics365_unique_index','idField','FieldId','lodash','util','../../config/logger'];(function(_0x7e5b90,_0x3ab63a){var _0xd48df6=function(_0x16b7d1){while(--_0x16b7d1){_0x7e5b90['push'](_0x7e5b90['shift']());}};_0xd48df6(++_0x3ab63a);}(_0xfbb0,0xfc));var _0x0fbb=function(_0x123bdd,_0x4bb6d6){_0x123bdd=_0x123bdd-0x0;var _0x83958e=_0xfbb0[_0x123bdd];return _0x83958e;};'use strict';var _=require(_0x0fbb('0x0'));var util=require(_0x0fbb('0x1'));var logger=require(_0x0fbb('0x2'))(_0x0fbb('0x3'));var moment=require(_0x0fbb('0x4'));var BPromise=require(_0x0fbb('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0fbb('0x6'));var rimraf=require(_0x0fbb('0x7'));var config=require(_0x0fbb('0x8'));var attributes=require('./intDynamics365Field.attributes');module[_0x0fbb('0x9')]=function(_0x228546,_0x165c05){return _0x228546[_0x0fbb('0xa')](_0x0fbb('0xb'),attributes,{'tableName':'int_dynamics365_fields','paranoid':![],'indexes':[{'name':_0x0fbb('0xc'),'fields':[_0x0fbb('0xd'),_0x0fbb('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.rpc.js b/server/api/intDynamics365Field/intDynamics365Field.rpc.js index 1242690..40e3f24 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 _0x986c=['info','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','Dynamics365Field,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0xac7aa9,_0x2a4e31){var _0x58cbaf=function(_0x1fc07e){while(--_0x1fc07e){_0xac7aa9['push'](_0xac7aa9['shift']());}};_0x58cbaf(++_0x2a4e31);}(_0x986c,0x77));var _0xc986=function(_0x534c87,_0x3bee73){_0x534c87=_0x534c87-0x0;var _0x57d146=_0x986c[_0x534c87];return _0x57d146;};'use strict';var _=require(_0xc986('0x0'));var util=require(_0xc986('0x1'));var moment=require(_0xc986('0x2'));var BPromise=require(_0xc986('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc986('0x4'))['db'];var utils=require(_0xc986('0x5'));var logger=require(_0xc986('0x6'))(_0xc986('0x7'));var config=require(_0xc986('0x8'));var jayson=require(_0xc986('0x9'));var client=jayson[_0xc986('0xa')][_0xc986('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x170ba0,_0x39200a,_0x33f2ce){return new BPromise(function(_0x3ad2f1,_0x5c3636){return client[_0xc986('0xc')](_0x170ba0,_0x33f2ce)['then'](function(_0x3a025a){logger[_0xc986('0xd')]('Dynamics365Field,\x20%s,\x20%s',_0x39200a,_0xc986('0xe'));logger[_0xc986('0xf')](_0xc986('0x10'),_0x39200a,_0xc986('0xe'),JSON[_0xc986('0x11')](_0x3a025a));if(_0x3a025a[_0xc986('0x12')]){if(_0x3a025a[_0xc986('0x12')]['code']===0x1f4){logger[_0xc986('0x12')](_0xc986('0x13'),_0x39200a,_0x3a025a[_0xc986('0x12')]['message']);return _0x5c3636(_0x3a025a[_0xc986('0x12')][_0xc986('0x14')]);}logger[_0xc986('0x12')](_0xc986('0x13'),_0x39200a,_0x3a025a[_0xc986('0x12')][_0xc986('0x14')]);return _0x3ad2f1(_0x3a025a[_0xc986('0x12')]['message']);}else{logger[_0xc986('0xd')](_0xc986('0x13'),_0x39200a,'request\x20sent');_0x3ad2f1(_0x3a025a[_0xc986('0x15')][_0xc986('0x14')]);}})['catch'](function(_0x330ebc){logger['error'](_0xc986('0x13'),_0x39200a,_0x330ebc);_0x5c3636(_0x330ebc);});});} \ No newline at end of file +var _0x0204=['Dynamics365Field,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info'];(function(_0x521084,_0x3fbb5e){var _0x3323e0=function(_0x204e3d){while(--_0x204e3d){_0x521084['push'](_0x521084['shift']());}};_0x3323e0(++_0x3fbb5e);}(_0x0204,0x111));var _0x4020=function(_0x39e260,_0x51f87d){_0x39e260=_0x39e260-0x0;var _0x3551a3=_0x0204[_0x39e260];return _0x3551a3;};'use strict';var _=require('lodash');var util=require(_0x4020('0x0'));var moment=require(_0x4020('0x1'));var BPromise=require(_0x4020('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4020('0x3'))['db'];var utils=require(_0x4020('0x4'));var logger=require(_0x4020('0x5'))(_0x4020('0x6'));var config=require(_0x4020('0x7'));var jayson=require(_0x4020('0x8'));var client=jayson[_0x4020('0x9')][_0x4020('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x573b34,_0x592b7e,_0x136994){return new BPromise(function(_0x35d8b4,_0x15b2fd){return client['request'](_0x573b34,_0x136994)[_0x4020('0xb')](function(_0x32df68){logger[_0x4020('0xc')](_0x4020('0xd'),_0x592b7e,'request\x20sent');logger[_0x4020('0xe')]('Dynamics365Field,\x20%s,\x20%s,\x20%s',_0x592b7e,_0x4020('0xf'),JSON[_0x4020('0x10')](_0x32df68));if(_0x32df68[_0x4020('0x11')]){if(_0x32df68[_0x4020('0x11')][_0x4020('0x12')]===0x1f4){logger[_0x4020('0x11')](_0x4020('0xd'),_0x592b7e,_0x32df68[_0x4020('0x11')][_0x4020('0x13')]);return _0x15b2fd(_0x32df68[_0x4020('0x11')][_0x4020('0x13')]);}logger[_0x4020('0x11')](_0x4020('0xd'),_0x592b7e,_0x32df68[_0x4020('0x11')][_0x4020('0x13')]);return _0x35d8b4(_0x32df68['error'][_0x4020('0x13')]);}else{logger[_0x4020('0xc')](_0x4020('0xd'),_0x592b7e,_0x4020('0xf'));_0x35d8b4(_0x32df68[_0x4020('0x14')][_0x4020('0x13')]);}})[_0x4020('0x15')](function(_0x21e129){logger['error'](_0x4020('0xd'),_0x592b7e,_0x21e129);_0x15b2fd(_0x21e129);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index c428473..e80c9b0 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 _0x530b=['index','get','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','post','put','/:id','update','delete','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x530b,0x114));var _0xb530=function(_0x387dc1,_0x3ba649){_0x387dc1=_0x387dc1-0x0;var _0x17567c=_0x530b[_0x387dc1];return _0x17567c;};'use strict';var multer=require(_0xb530('0x0'));var util=require(_0xb530('0x1'));var path=require('path');var timeout=require(_0xb530('0x2'));var express=require(_0xb530('0x3'));var router=express[_0xb530('0x4')]();var fs_extra=require(_0xb530('0x5'));var auth=require(_0xb530('0x6'));var interaction=require(_0xb530('0x7'));var config=require(_0xb530('0x8'));var controller=require(_0xb530('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xb530('0xa')]);router[_0xb530('0xb')]('/:id',auth[_0xb530('0xc')](),controller[_0xb530('0xd')]);router['get'](_0xb530('0xe'),auth['isAuthenticated'](),controller[_0xb530('0xf')]);router['get'](_0xb530('0x10'),auth[_0xb530('0xc')](),controller['getFields']);router['post']('/',auth[_0xb530('0xc')](),controller['create']);router[_0xb530('0x11')](_0xb530('0xe'),auth[_0xb530('0xc')](),controller['addConfiguration']);router[_0xb530('0x12')](_0xb530('0x13'),auth['isAuthenticated'](),controller[_0xb530('0x14')]);router[_0xb530('0x15')](_0xb530('0x13'),auth[_0xb530('0xc')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x2b09=['post','create','addConfiguration','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./intFreshdeskAccount.controller','isAuthenticated','index','get','show','/:id/configurations','getConfigurations','getFields'];(function(_0x18b8e1,_0x2af125){var _0x1d5fb0=function(_0x354c50){while(--_0x354c50){_0x18b8e1['push'](_0x18b8e1['shift']());}};_0x1d5fb0(++_0x2af125);}(_0x2b09,0xea));var _0x92b0=function(_0x1e0dce,_0x141246){_0x1e0dce=_0x1e0dce-0x0;var _0x189573=_0x2b09[_0x1e0dce];return _0x189573;};'use strict';var multer=require(_0x92b0('0x0'));var util=require(_0x92b0('0x1'));var path=require(_0x92b0('0x2'));var timeout=require(_0x92b0('0x3'));var express=require(_0x92b0('0x4'));var router=express[_0x92b0('0x5')]();var fs_extra=require(_0x92b0('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x92b0('0x7'));var config=require('../../config/environment');var controller=require(_0x92b0('0x8'));router['get']('/',auth[_0x92b0('0x9')](),controller[_0x92b0('0xa')]);router[_0x92b0('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x92b0('0xc')]);router[_0x92b0('0xb')](_0x92b0('0xd'),auth['isAuthenticated'](),controller[_0x92b0('0xe')]);router[_0x92b0('0xb')]('/:id/fields',auth[_0x92b0('0x9')](),controller[_0x92b0('0xf')]);router[_0x92b0('0x10')]('/',auth[_0x92b0('0x9')](),controller[_0x92b0('0x11')]);router[_0x92b0('0x10')](_0x92b0('0xd'),auth['isAuthenticated'](),controller[_0x92b0('0x12')]);router[_0x92b0('0x13')](_0x92b0('0x14'),auth[_0x92b0('0x9')](),controller[_0x92b0('0x15')]);router[_0x92b0('0x16')](_0x92b0('0x14'),auth[_0x92b0('0x9')](),controller[_0x92b0('0x17')]);module[_0x92b0('0x18')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index 6b7ac2c..ca10e4e 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 _0xe5af=['exports','STRING','username','remoteUri'];(function(_0x4515bb,_0x4ec2f9){var _0x90897d=function(_0x31c312){while(--_0x31c312){_0x4515bb['push'](_0x4515bb['shift']());}};_0x90897d(++_0x4ec2f9);}(_0xe5af,0x9c));var _0xfe5a=function(_0x966502,_0x518d86){_0x966502=_0x966502-0x0;var _0x5c7854=_0xe5af[_0x966502];return _0x5c7854;};'use strict';var Sequelize=require('sequelize');module[_0xfe5a('0x0')]={'name':{'type':Sequelize[_0xfe5a('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xfe5a('0x1')],'unique':_0xfe5a('0x2')},'apiKey':{'type':Sequelize[_0xfe5a('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xfe5a('0x3')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x3423=['username','remoteUri','STRING'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x3423,0x188));var _0x3342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3423[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3342('0x0')]},'description':{'type':Sequelize[_0x3342('0x0')]},'username':{'type':Sequelize[_0x3342('0x0')],'unique':_0x3342('0x1')},'apiKey':{'type':Sequelize[_0x3342('0x0')]},'remoteUri':{'type':Sequelize[_0x3342('0x0')],'unique':_0x3342('0x2')},'serverUrl':{'type':Sequelize[_0x3342('0x0')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index aadd001..73622b9 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 _0x867f=['../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','then','stack','name','send','index','map','FreshdeskAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','nolimit','sort','where','pick','filter','merge','options','findAll','rows','catch','show','params','length','includeAll','include','find','create','getConfigurations','findOne','FreshdeskConfiguration','order','hasOwnProperty','addConfiguration','body','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshdeskField','getFields','remoteUri','apiKey','slice','substring','lastIndexOf','GET','format','%s/%s','api/v2/ticket_fields','%s:X','toString','base64','subject','agent','description','priority','source','ticket_type','group','company','default','custom_text','custom_dropdown','choices','capitalize','test','statusCode','error','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service'];(function(_0x338b13,_0x2e921d){var _0x2dc623=function(_0x327221){while(--_0x327221){_0x338b13['push'](_0x338b13['shift']());}};_0x2dc623(++_0x2e921d);}(_0x867f,0xdc));var _0xf867=function(_0x26b80e,_0x5c9333){_0x26b80e=_0x26b80e-0x0;var _0x84a8a8=_0x867f[_0x26b80e];return _0x84a8a8;};'use strict';var emlformat=require(_0xf867('0x0'));var rimraf=require(_0xf867('0x1'));var zipdir=require(_0xf867('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf867('0x3'));var moment=require(_0xf867('0x4'));var BPromise=require(_0xf867('0x5'));var Mustache=require('mustache');var util=require(_0xf867('0x6'));var path=require('path');var sox=require(_0xf867('0x7'));var csv=require(_0xf867('0x8'));var ejs=require(_0xf867('0x9'));var fs=require('fs');var fs_extra=require(_0xf867('0xa'));var _=require(_0xf867('0xb'));var squel=require(_0xf867('0xc'));var crypto=require(_0xf867('0xd'));var jsforce=require(_0xf867('0xe'));var deskjs=require(_0xf867('0xf'));var toCsv=require(_0xf867('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xf867('0x10'));var authService=require(_0xf867('0x11'));var qs=require(_0xf867('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf867('0x13'))(_0xf867('0x14'));var utils=require('../../config/utils');var config=require(_0xf867('0x15'));var licenseUtil=require(_0xf867('0x16'));var db=require(_0xf867('0x17'))['db'];var integrations=require(_0xf867('0x18'));function respondWithStatusCode(_0x4f5297,_0x8059d0){_0x8059d0=_0x8059d0||0xcc;return function(_0x2989a9){if(_0x2989a9){return _0x4f5297[_0xf867('0x19')](_0x8059d0);}return _0x4f5297[_0xf867('0x1a')](_0x8059d0)[_0xf867('0x1b')]();};}function respondWithResult(_0x3ed550,_0x37b752){_0x37b752=_0x37b752||0xc8;return function(_0x3c0d03){if(_0x3c0d03){return _0x3ed550[_0xf867('0x1a')](_0x37b752)[_0xf867('0x1c')](_0x3c0d03);}};}function respondWithFilteredResult(_0x4de424,_0x55fb64){return function(_0x554d6a){if(_0x554d6a){var _0x46d844=typeof _0x55fb64[_0xf867('0x1d')]===_0xf867('0x1e')&&typeof _0x55fb64[_0xf867('0x1f')]===_0xf867('0x1e');var _0x29b42f=_0x554d6a[_0xf867('0x20')];var _0x48e5b9=_0x46d844?0x0:_0x55fb64[_0xf867('0x1d')];var _0x20586d=_0x46d844?_0x554d6a[_0xf867('0x20')]:_0x55fb64[_0xf867('0x1d')]+_0x55fb64[_0xf867('0x1f')];var _0x523461;if(_0x20586d>=_0x29b42f){_0x20586d=_0x29b42f;_0x523461=0xc8;}else{_0x523461=0xce;}_0x4de424[_0xf867('0x1a')](_0x523461);return _0x4de424['set'](_0xf867('0x21'),_0x48e5b9+'-'+_0x20586d+'/'+_0x29b42f)[_0xf867('0x1c')](_0x554d6a);}return null;};}function patchUpdates(_0x15ca62){return function(_0x5cf4d9){try{jsonpatch[_0xf867('0x22')](_0x5cf4d9,_0x15ca62,!![]);}catch(_0x1c0fdc){return BPromise[_0xf867('0x23')](_0x1c0fdc);}return _0x5cf4d9[_0xf867('0x24')]();};}function saveUpdates(_0x83ba8c,_0x2546fa){return function(_0x9ee12a){if(_0x9ee12a){return _0x9ee12a[_0xf867('0x25')](_0x83ba8c)['then'](function(_0x281374){return _0x281374;});}return null;};}function removeEntity(_0x13ed06,_0x3a54bc){return function(_0x4dd8d1){if(_0x4dd8d1){return _0x4dd8d1[_0xf867('0x26')]()[_0xf867('0x27')](function(){_0x13ed06[_0xf867('0x1a')](0xcc)[_0xf867('0x1b')]();});}};}function handleEntityNotFound(_0xd585a1,_0x550f54){return function(_0x2c5a53){if(!_0x2c5a53){_0xd585a1[_0xf867('0x19')](0x194);}return _0x2c5a53;};}function handleError(_0x2c6e8e,_0x165e63){_0x165e63=_0x165e63||0x1f4;return function(_0x16a903){logger['error'](_0x16a903[_0xf867('0x28')]);if(_0x16a903[_0xf867('0x29')]){delete _0x16a903[_0xf867('0x29')];}_0x2c6e8e[_0xf867('0x1a')](_0x165e63)[_0xf867('0x2a')](_0x16a903);};}exports[_0xf867('0x2b')]=function(_0x5b7865,_0x3d4b18){var _0x28fb90={},_0x169578={},_0x4c0f0c={'count':0x0,'rows':[]};var _0x1553fc=_[_0xf867('0x2c')](db[_0xf867('0x2d')][_0xf867('0x2e')],function(_0x55616d){return{'name':_0x55616d[_0xf867('0x2f')],'type':_0x55616d[_0xf867('0x30')][_0xf867('0x31')]};});_0x169578[_0xf867('0x32')]=_[_0xf867('0x2c')](_0x1553fc,_0xf867('0x29'));_0x169578[_0xf867('0x33')]=_[_0xf867('0x34')](_0x5b7865['query']);_0x169578[_0xf867('0x35')]=_['intersection'](_0x169578['model'],_0x169578[_0xf867('0x33')]);_0x28fb90[_0xf867('0x36')]=_[_0xf867('0x37')](_0x169578[_0xf867('0x32')],qs[_0xf867('0x38')](_0x5b7865['query'][_0xf867('0x38')]));_0x28fb90[_0xf867('0x36')]=_0x28fb90['attributes']['length']?_0x28fb90[_0xf867('0x36')]:_0x169578['model'];if(!_0x5b7865['query']['hasOwnProperty'](_0xf867('0x39'))){_0x28fb90['limit']=qs[_0xf867('0x1f')](_0x5b7865[_0xf867('0x33')][_0xf867('0x1f')]);_0x28fb90[_0xf867('0x1d')]=qs[_0xf867('0x1d')](_0x5b7865[_0xf867('0x33')][_0xf867('0x1d')]);}_0x28fb90['order']=qs[_0xf867('0x3a')](_0x5b7865['query'][_0xf867('0x3a')]);_0x28fb90[_0xf867('0x3b')]=qs['filters'](_[_0xf867('0x3c')](_0x5b7865['query'],_0x169578[_0xf867('0x35')]),_0x1553fc);if(_0x5b7865[_0xf867('0x33')][_0xf867('0x3d')]){_0x28fb90['where']=_[_0xf867('0x3e')](_0x28fb90['where'],{'$or':_[_0xf867('0x2c')](_0x1553fc,function(_0x15fb1f){if(_0x15fb1f['type']!=='VIRTUAL'){var _0x4dea4d={};_0x4dea4d[_0x15fb1f[_0xf867('0x29')]]={'$like':'%'+_0x5b7865[_0xf867('0x33')][_0xf867('0x3d')]+'%'};return _0x4dea4d;}})});}_0x28fb90=_['merge']({},_0x28fb90,_0x5b7865[_0xf867('0x3f')]);var _0x487357={'where':_0x28fb90['where']};return db[_0xf867('0x2d')][_0xf867('0x20')](_0x487357)[_0xf867('0x27')](function(_0xebd8e7){_0x4c0f0c[_0xf867('0x20')]=_0xebd8e7;if(_0x5b7865['query']['includeAll']){_0x28fb90['include']=[{'all':!![]}];}return db[_0xf867('0x2d')][_0xf867('0x40')](_0x28fb90);})[_0xf867('0x27')](function(_0x4975a3){_0x4c0f0c[_0xf867('0x41')]=_0x4975a3;return _0x4c0f0c;})[_0xf867('0x27')](respondWithFilteredResult(_0x3d4b18,_0x28fb90))[_0xf867('0x42')](handleError(_0x3d4b18,null));};exports[_0xf867('0x43')]=function(_0x5235cb,_0x1b94d5){var _0x28995a={'raw':![],'where':{'id':_0x5235cb[_0xf867('0x44')]['id']}},_0x520eb5={};_0x520eb5[_0xf867('0x32')]=_[_0xf867('0x34')](db[_0xf867('0x2d')][_0xf867('0x2e')]);_0x520eb5[_0xf867('0x33')]=_[_0xf867('0x34')](_0x5235cb[_0xf867('0x33')]);_0x520eb5[_0xf867('0x35')]=_[_0xf867('0x37')](_0x520eb5[_0xf867('0x32')],_0x520eb5[_0xf867('0x33')]);_0x28995a[_0xf867('0x36')]=_[_0xf867('0x37')](_0x520eb5[_0xf867('0x32')],qs['fields'](_0x5235cb[_0xf867('0x33')][_0xf867('0x38')]));_0x28995a[_0xf867('0x36')]=_0x28995a[_0xf867('0x36')][_0xf867('0x45')]?_0x28995a[_0xf867('0x36')]:_0x520eb5[_0xf867('0x32')];if(_0x5235cb[_0xf867('0x33')][_0xf867('0x46')]){_0x28995a[_0xf867('0x47')]=[{'all':!![]}];}_0x28995a=_[_0xf867('0x3e')]({},_0x28995a,_0x5235cb[_0xf867('0x3f')]);return db[_0xf867('0x2d')][_0xf867('0x48')](_0x28995a)[_0xf867('0x27')](handleEntityNotFound(_0x1b94d5,null))[_0xf867('0x27')](respondWithResult(_0x1b94d5,null))[_0xf867('0x42')](handleError(_0x1b94d5,null));};exports['create']=function(_0x2f31bd,_0x68888b){return db[_0xf867('0x2d')][_0xf867('0x49')](_0x2f31bd['body'],{})[_0xf867('0x27')](respondWithResult(_0x68888b,0xc9))[_0xf867('0x42')](handleError(_0x68888b,null));};exports[_0xf867('0x25')]=function(_0x416e46,_0x35a66d){if(_0x416e46['body']['id']){delete _0x416e46['body']['id'];}return db[_0xf867('0x2d')][_0xf867('0x48')]({'where':{'id':_0x416e46[_0xf867('0x44')]['id']}})[_0xf867('0x27')](handleEntityNotFound(_0x35a66d,null))[_0xf867('0x27')](saveUpdates(_0x416e46['body'],null))[_0xf867('0x27')](respondWithResult(_0x35a66d,null))[_0xf867('0x42')](handleError(_0x35a66d,null));};exports[_0xf867('0x26')]=function(_0x5203b6,_0x545353){return db[_0xf867('0x2d')][_0xf867('0x48')]({'where':{'id':_0x5203b6['params']['id']}})['then'](handleEntityNotFound(_0x545353,null))['then'](removeEntity(_0x545353,null))[_0xf867('0x42')](handleError(_0x545353,null));};exports[_0xf867('0x4a')]=function(_0x311da4,_0x3d96df,_0x5cfe1c){var _0x415ed3={};var _0x7dca3b={};var _0x252eb7;var _0x4475db;return db[_0xf867('0x2d')][_0xf867('0x4b')]({'where':{'id':_0x311da4[_0xf867('0x44')]['id']}})[_0xf867('0x27')](handleEntityNotFound(_0x3d96df,null))[_0xf867('0x27')](function(_0x22645b){if(_0x22645b){_0x252eb7=_0x22645b;_0x7dca3b[_0xf867('0x32')]=_['keys'](db[_0xf867('0x4c')][_0xf867('0x2e')]);_0x7dca3b['query']=_[_0xf867('0x34')](_0x311da4[_0xf867('0x33')]);_0x7dca3b['filters']=_[_0xf867('0x37')](_0x7dca3b['model'],_0x7dca3b['query']);_0x415ed3['attributes']=_[_0xf867('0x37')](_0x7dca3b[_0xf867('0x32')],qs[_0xf867('0x38')](_0x311da4[_0xf867('0x33')]['fields']));_0x415ed3[_0xf867('0x36')]=_0x415ed3[_0xf867('0x36')][_0xf867('0x45')]?_0x415ed3[_0xf867('0x36')]:_0x7dca3b[_0xf867('0x32')];_0x415ed3[_0xf867('0x4d')]=qs[_0xf867('0x3a')](_0x311da4[_0xf867('0x33')]['sort']);_0x415ed3[_0xf867('0x3b')]=qs[_0xf867('0x35')](_[_0xf867('0x3c')](_0x311da4['query'],_0x7dca3b[_0xf867('0x35')]));if(_0x311da4[_0xf867('0x33')][_0xf867('0x3d')]){_0x415ed3[_0xf867('0x3b')]=_['merge'](_0x415ed3['where'],{'$or':_[_0xf867('0x2c')](_0x415ed3['attributes'],function(_0x4a8809){var _0xd16ff2={};_0xd16ff2[_0x4a8809]={'$like':'%'+_0x311da4[_0xf867('0x33')]['filter']+'%'};return _0xd16ff2;})});}_0x415ed3=_[_0xf867('0x3e')]({},_0x415ed3,_0x311da4[_0xf867('0x3f')]);return _0x252eb7[_0xf867('0x4a')](_0x415ed3);}})[_0xf867('0x27')](function(_0x307cbb){if(_0x307cbb){_0x4475db=_0x307cbb['length'];if(!_0x311da4[_0xf867('0x33')][_0xf867('0x4e')](_0xf867('0x39'))){_0x415ed3[_0xf867('0x1f')]=qs[_0xf867('0x1f')](_0x311da4[_0xf867('0x33')]['limit']);_0x415ed3[_0xf867('0x1d')]=qs[_0xf867('0x1d')](_0x311da4['query'][_0xf867('0x1d')]);}return _0x252eb7[_0xf867('0x4a')](_0x415ed3);}})[_0xf867('0x27')](function(_0x18b928){if(_0x18b928){return _0x18b928?{'count':_0x4475db,'rows':_0x18b928}:null;}})[_0xf867('0x27')](respondWithResult(_0x3d96df,null))[_0xf867('0x42')](handleError(_0x3d96df,null));};exports[_0xf867('0x4f')]=function(_0x4800a0,_0xe3a8f0,_0x28044e){if(_0x4800a0['body']['id']){delete _0x4800a0[_0xf867('0x50')]['id'];}return db[_0xf867('0x2d')][_0xf867('0x4b')]({'where':{'id':_0x4800a0['params']['id']}})[_0xf867('0x27')](handleEntityNotFound(_0xe3a8f0,null))[_0xf867('0x27')](function(_0x445ce7){if(_0x445ce7){_0x4800a0[_0xf867('0x50')][_0xf867('0x51')]=_0x445ce7['id'];_0x4800a0[_0xf867('0x50')][_0xf867('0x52')]=integrations[_0xf867('0x53')](_0x4800a0[_0xf867('0x50')][_0xf867('0x54')],_0x4800a0[_0xf867('0x50')]['type']);_0x4800a0[_0xf867('0x50')][_0xf867('0x55')]=integrations[_0xf867('0x56')](_0x4800a0[_0xf867('0x50')][_0xf867('0x54')],_0x4800a0[_0xf867('0x50')][_0xf867('0x30')]);return db['FreshdeskConfiguration'][_0xf867('0x49')](_0x4800a0['body'],{'include':[{'model':db[_0xf867('0x57')],'as':_0xf867('0x52')},{'model':db[_0xf867('0x57')],'as':_0xf867('0x55')}]});}return null;})[_0xf867('0x27')](respondWithResult(_0xe3a8f0,null))[_0xf867('0x42')](handleError(_0xe3a8f0,null));};exports[_0xf867('0x58')]=function(_0x1d0b5a,_0xaaec00,_0x4f691d){var _0x3d70ba='';return db[_0xf867('0x2d')][_0xf867('0x4b')]({'where':{'id':_0x1d0b5a[_0xf867('0x44')]['id']},'attributes':['id',_0xf867('0x59'),_0xf867('0x5a')]})[_0xf867('0x27')](handleEntityNotFound(_0xaaec00,null))['then'](function(_0x2fd080){if(_0x2fd080){_0x3d70ba=_0x2fd080[_0xf867('0x59')];var _0xed4ab3=_0x3d70ba[_0xf867('0x5b')](-0x1);if(_0xed4ab3==='/'){_0x3d70ba=_0x3d70ba[_0xf867('0x5c')](0x0,_0x3d70ba[_0xf867('0x5d')](_0xed4ab3));}return rp({'method':_0xf867('0x5e'),'uri':util[_0xf867('0x5f')](_0xf867('0x60'),_0x3d70ba,_0xf867('0x61')),'headers':{'Authorization':util['format']('Basic\x20%s',new Buffer(util[_0xf867('0x5f')](_0xf867('0x62'),_0x2fd080[_0xf867('0x5a')]))[_0xf867('0x63')](_0xf867('0x64')))},'json':!![]});}})['then'](function(_0x37662b){if(_0x37662b){var _0x44e3a8=['requester',_0xf867('0x65'),_0xf867('0x66'),_0xf867('0x67'),_0xf867('0x1a'),_0xf867('0x68'),'group',_0xf867('0x69'),_0xf867('0x6a'),_0xf867('0x6b'),_0xf867('0x6c')];_['remove'](_0x37662b,function(_0x497955){return _0x44e3a8['includes'](_0x497955['name'])||!_0x497955[_0xf867('0x6d')]&&_0x497955[_0xf867('0x30')]!==_0xf867('0x6e')&&_0x497955['type']!==_0xf867('0x6f');});return{'count':_0x37662b[_0xf867('0x45')],'rows':_[_0xf867('0x2c')](_0x37662b,function(_0x9ad8c1){return{'id':_0x9ad8c1['name'],'name':_0x9ad8c1['label'],'custom':!_0x9ad8c1[_0xf867('0x6d')],'options':_0x9ad8c1['choices']?_[_0xf867('0x2c')](_0x9ad8c1[_0xf867('0x70')],function(_0xce1151){return{'name':_[_0xf867('0x71')](_0xce1151),'value':_0xce1151};}):[]};})};}})[_0xf867('0x27')](respondWithResult(_0xaaec00,null))['catch'](function(_0x5d5a72){var _0x16acb4=_0x1d0b5a[_0xf867('0x33')][_0xf867('0x72')]?0x1f4:_0x5d5a72[_0xf867('0x73')]||0x1f4;logger[_0xf867('0x74')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x16acb4,JSON[_0xf867('0x75')](_0x5d5a72));delete _0x5d5a72[_0xf867('0x29')];if(_0x16acb4===0x191){_0x16acb4=0x190;}_0xaaec00[_0xf867('0x1a')](_0x16acb4)[_0xf867('0x2a')](_0x1d0b5a['query']['test']?{'message':_0xf867('0x76'),'statusCode':_0x5d5a72[_0xf867('0x73')]}:_0x5d5a72);});}; \ No newline at end of file +var _0xede3=['undefined','limit','Content-Range','apply','reject','save','update','then','destroy','error','name','index','map','fieldName','type','key','model','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','options','FreshdeskAccount','count','include','findAll','catch','show','fields','includeAll','find','body','params','FreshdeskConfiguration','getConfigurations','addConfiguration','findOne','AccountId','Descriptions','channel','create','FreshdeskField','remoteUri','slice','lastIndexOf','GET','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','%s:X','apiKey','toString','base64','description','group','source','ticket_type','company','remove','includes','default','custom_dropdown','label','choices','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0xede3,0xc0));var _0x3ede=function(_0x3ffdf0,_0x7c355c){_0x3ffdf0=_0x3ffdf0-0x0;var _0x97bb75=_0xede3[_0x3ffdf0];return _0x97bb75;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3ede('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3ede('0x1'));var rp=require(_0x3ede('0x2'));var moment=require(_0x3ede('0x3'));var BPromise=require(_0x3ede('0x4'));var Mustache=require(_0x3ede('0x5'));var util=require(_0x3ede('0x6'));var path=require(_0x3ede('0x7'));var sox=require(_0x3ede('0x8'));var csv=require(_0x3ede('0x9'));var ejs=require(_0x3ede('0xa'));var fs=require('fs');var fs_extra=require(_0x3ede('0xb'));var _=require(_0x3ede('0xc'));var squel=require(_0x3ede('0xd'));var crypto=require(_0x3ede('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x3ede('0xf'));var toCsv=require(_0x3ede('0x9'));var querystring=require(_0x3ede('0x10'));var Papa=require('papaparse');var Redis=require(_0x3ede('0x11'));var authService=require(_0x3ede('0x12'));var qs=require(_0x3ede('0x13'));var as=require(_0x3ede('0x14'));var hardwareService=require(_0x3ede('0x15'));var logger=require('../../config/logger')(_0x3ede('0x16'));var utils=require(_0x3ede('0x17'));var config=require(_0x3ede('0x18'));var licenseUtil=require(_0x3ede('0x19'));var db=require(_0x3ede('0x1a'))['db'];var integrations=require(_0x3ede('0x1b'));function respondWithStatusCode(_0x3b2697,_0xf1a93b){_0xf1a93b=_0xf1a93b||0xcc;return function(_0x449111){if(_0x449111){return _0x3b2697[_0x3ede('0x1c')](_0xf1a93b);}return _0x3b2697[_0x3ede('0x1d')](_0xf1a93b)[_0x3ede('0x1e')]();};}function respondWithResult(_0x470bba,_0x5d2d69){_0x5d2d69=_0x5d2d69||0xc8;return function(_0x4e03a5){if(_0x4e03a5){return _0x470bba[_0x3ede('0x1d')](_0x5d2d69)['json'](_0x4e03a5);}};}function respondWithFilteredResult(_0x2ac4d5,_0x59c338){return function(_0x54ae57){if(_0x54ae57){var _0x18e11c=typeof _0x59c338[_0x3ede('0x1f')]===_0x3ede('0x20')&&typeof _0x59c338['limit']===_0x3ede('0x20');var _0x516539=_0x54ae57['count'];var _0x390421=_0x18e11c?0x0:_0x59c338[_0x3ede('0x1f')];var _0x1c0268=_0x18e11c?_0x54ae57['count']:_0x59c338[_0x3ede('0x1f')]+_0x59c338[_0x3ede('0x21')];var _0x4fdcc6;if(_0x1c0268>=_0x516539){_0x1c0268=_0x516539;_0x4fdcc6=0xc8;}else{_0x4fdcc6=0xce;}_0x2ac4d5['status'](_0x4fdcc6);return _0x2ac4d5['set'](_0x3ede('0x22'),_0x390421+'-'+_0x1c0268+'/'+_0x516539)['json'](_0x54ae57);}return null;};}function patchUpdates(_0x38ebd6){return function(_0x5a45ff){try{jsonpatch[_0x3ede('0x23')](_0x5a45ff,_0x38ebd6,!![]);}catch(_0x2de9f4){return BPromise[_0x3ede('0x24')](_0x2de9f4);}return _0x5a45ff[_0x3ede('0x25')]();};}function saveUpdates(_0x33b2d6,_0x472924){return function(_0x582d19){if(_0x582d19){return _0x582d19[_0x3ede('0x26')](_0x33b2d6)[_0x3ede('0x27')](function(_0x1e8384){return _0x1e8384;});}return null;};}function removeEntity(_0x19e9aa,_0x313699){return function(_0x10636f){if(_0x10636f){return _0x10636f[_0x3ede('0x28')]()[_0x3ede('0x27')](function(){_0x19e9aa[_0x3ede('0x1d')](0xcc)[_0x3ede('0x1e')]();});}};}function handleEntityNotFound(_0x553584,_0x5e3304){return function(_0x3765fe){if(!_0x3765fe){_0x553584[_0x3ede('0x1c')](0x194);}return _0x3765fe;};}function handleError(_0x248e17,_0x8e750c){_0x8e750c=_0x8e750c||0x1f4;return function(_0x1f0b36){logger[_0x3ede('0x29')](_0x1f0b36['stack']);if(_0x1f0b36[_0x3ede('0x2a')]){delete _0x1f0b36[_0x3ede('0x2a')];}_0x248e17[_0x3ede('0x1d')](_0x8e750c)['send'](_0x1f0b36);};}exports[_0x3ede('0x2b')]=function(_0x8daee8,_0x449e94){var _0x57cf8a={},_0x3d064a={},_0x481e4e={'count':0x0,'rows':[]};var _0x27c706=_[_0x3ede('0x2c')](db['FreshdeskAccount']['rawAttributes'],function(_0x319fd4){return{'name':_0x319fd4[_0x3ede('0x2d')],'type':_0x319fd4[_0x3ede('0x2e')][_0x3ede('0x2f')]};});_0x3d064a[_0x3ede('0x30')]=_[_0x3ede('0x2c')](_0x27c706,_0x3ede('0x2a'));_0x3d064a[_0x3ede('0x31')]=_[_0x3ede('0x32')](_0x8daee8[_0x3ede('0x31')]);_0x3d064a['filters']=_[_0x3ede('0x33')](_0x3d064a[_0x3ede('0x30')],_0x3d064a['query']);_0x57cf8a[_0x3ede('0x34')]=_[_0x3ede('0x33')](_0x3d064a[_0x3ede('0x30')],qs['fields'](_0x8daee8[_0x3ede('0x31')]['fields']));_0x57cf8a[_0x3ede('0x34')]=_0x57cf8a[_0x3ede('0x34')][_0x3ede('0x35')]?_0x57cf8a['attributes']:_0x3d064a['model'];if(!_0x8daee8[_0x3ede('0x31')][_0x3ede('0x36')](_0x3ede('0x37'))){_0x57cf8a[_0x3ede('0x21')]=qs[_0x3ede('0x21')](_0x8daee8['query'][_0x3ede('0x21')]);_0x57cf8a[_0x3ede('0x1f')]=qs[_0x3ede('0x1f')](_0x8daee8[_0x3ede('0x31')]['offset']);}_0x57cf8a[_0x3ede('0x38')]=qs[_0x3ede('0x39')](_0x8daee8[_0x3ede('0x31')]['sort']);_0x57cf8a['where']=qs[_0x3ede('0x3a')](_[_0x3ede('0x3b')](_0x8daee8[_0x3ede('0x31')],_0x3d064a[_0x3ede('0x3a')]),_0x27c706);if(_0x8daee8[_0x3ede('0x31')][_0x3ede('0x3c')]){_0x57cf8a[_0x3ede('0x3d')]=_['merge'](_0x57cf8a[_0x3ede('0x3d')],{'$or':_[_0x3ede('0x2c')](_0x27c706,function(_0xba1c37){if(_0xba1c37['type']!=='VIRTUAL'){var _0x5f0b05={};_0x5f0b05[_0xba1c37[_0x3ede('0x2a')]]={'$like':'%'+_0x8daee8[_0x3ede('0x31')][_0x3ede('0x3c')]+'%'};return _0x5f0b05;}})});}_0x57cf8a=_[_0x3ede('0x3e')]({},_0x57cf8a,_0x8daee8[_0x3ede('0x3f')]);var _0xe752e1={'where':_0x57cf8a[_0x3ede('0x3d')]};return db[_0x3ede('0x40')][_0x3ede('0x41')](_0xe752e1)['then'](function(_0xbd187d){_0x481e4e[_0x3ede('0x41')]=_0xbd187d;if(_0x8daee8[_0x3ede('0x31')]['includeAll']){_0x57cf8a[_0x3ede('0x42')]=[{'all':!![]}];}return db[_0x3ede('0x40')][_0x3ede('0x43')](_0x57cf8a);})[_0x3ede('0x27')](function(_0x59122d){_0x481e4e['rows']=_0x59122d;return _0x481e4e;})[_0x3ede('0x27')](respondWithFilteredResult(_0x449e94,_0x57cf8a))[_0x3ede('0x44')](handleError(_0x449e94,null));};exports[_0x3ede('0x45')]=function(_0x15bfbb,_0x507054){var _0x133c73={'raw':![],'where':{'id':_0x15bfbb['params']['id']}},_0x342bf7={};_0x342bf7['model']=_['keys'](db[_0x3ede('0x40')]['rawAttributes']);_0x342bf7['query']=_['keys'](_0x15bfbb[_0x3ede('0x31')]);_0x342bf7[_0x3ede('0x3a')]=_[_0x3ede('0x33')](_0x342bf7[_0x3ede('0x30')],_0x342bf7[_0x3ede('0x31')]);_0x133c73[_0x3ede('0x34')]=_['intersection'](_0x342bf7[_0x3ede('0x30')],qs['fields'](_0x15bfbb['query'][_0x3ede('0x46')]));_0x133c73[_0x3ede('0x34')]=_0x133c73[_0x3ede('0x34')]['length']?_0x133c73['attributes']:_0x342bf7[_0x3ede('0x30')];if(_0x15bfbb[_0x3ede('0x31')][_0x3ede('0x47')]){_0x133c73['include']=[{'all':!![]}];}_0x133c73=_[_0x3ede('0x3e')]({},_0x133c73,_0x15bfbb[_0x3ede('0x3f')]);return db[_0x3ede('0x40')][_0x3ede('0x48')](_0x133c73)[_0x3ede('0x27')](handleEntityNotFound(_0x507054,null))[_0x3ede('0x27')](respondWithResult(_0x507054,null))[_0x3ede('0x44')](handleError(_0x507054,null));};exports['create']=function(_0x56081d,_0x53916c){return db['FreshdeskAccount']['create'](_0x56081d[_0x3ede('0x49')],{})[_0x3ede('0x27')](respondWithResult(_0x53916c,0xc9))[_0x3ede('0x44')](handleError(_0x53916c,null));};exports[_0x3ede('0x26')]=function(_0x12f296,_0x1ebd75){if(_0x12f296[_0x3ede('0x49')]['id']){delete _0x12f296['body']['id'];}return db['FreshdeskAccount'][_0x3ede('0x48')]({'where':{'id':_0x12f296[_0x3ede('0x4a')]['id']}})[_0x3ede('0x27')](handleEntityNotFound(_0x1ebd75,null))[_0x3ede('0x27')](saveUpdates(_0x12f296[_0x3ede('0x49')],null))[_0x3ede('0x27')](respondWithResult(_0x1ebd75,null))['catch'](handleError(_0x1ebd75,null));};exports[_0x3ede('0x28')]=function(_0x7fbec6,_0xc55e01){return db[_0x3ede('0x40')][_0x3ede('0x48')]({'where':{'id':_0x7fbec6[_0x3ede('0x4a')]['id']}})[_0x3ede('0x27')](handleEntityNotFound(_0xc55e01,null))[_0x3ede('0x27')](removeEntity(_0xc55e01,null))['catch'](handleError(_0xc55e01,null));};exports['getConfigurations']=function(_0x573449,_0x284680,_0x6bdbee){var _0x14ccec={};var _0x20068f={};var _0x519daf;var _0x253773;return db[_0x3ede('0x40')]['findOne']({'where':{'id':_0x573449['params']['id']}})[_0x3ede('0x27')](handleEntityNotFound(_0x284680,null))['then'](function(_0x5a874f){if(_0x5a874f){_0x519daf=_0x5a874f;_0x20068f[_0x3ede('0x30')]=_[_0x3ede('0x32')](db[_0x3ede('0x4b')]['rawAttributes']);_0x20068f[_0x3ede('0x31')]=_['keys'](_0x573449['query']);_0x20068f[_0x3ede('0x3a')]=_[_0x3ede('0x33')](_0x20068f[_0x3ede('0x30')],_0x20068f['query']);_0x14ccec['attributes']=_['intersection'](_0x20068f[_0x3ede('0x30')],qs[_0x3ede('0x46')](_0x573449[_0x3ede('0x31')]['fields']));_0x14ccec['attributes']=_0x14ccec['attributes'][_0x3ede('0x35')]?_0x14ccec[_0x3ede('0x34')]:_0x20068f[_0x3ede('0x30')];_0x14ccec[_0x3ede('0x38')]=qs['sort'](_0x573449[_0x3ede('0x31')][_0x3ede('0x39')]);_0x14ccec[_0x3ede('0x3d')]=qs[_0x3ede('0x3a')](_[_0x3ede('0x3b')](_0x573449['query'],_0x20068f['filters']));if(_0x573449['query'][_0x3ede('0x3c')]){_0x14ccec['where']=_['merge'](_0x14ccec[_0x3ede('0x3d')],{'$or':_[_0x3ede('0x2c')](_0x14ccec[_0x3ede('0x34')],function(_0x39619a){var _0xdccf67={};_0xdccf67[_0x39619a]={'$like':'%'+_0x573449[_0x3ede('0x31')]['filter']+'%'};return _0xdccf67;})});}_0x14ccec=_[_0x3ede('0x3e')]({},_0x14ccec,_0x573449[_0x3ede('0x3f')]);return _0x519daf[_0x3ede('0x4c')](_0x14ccec);}})['then'](function(_0x44de0f){if(_0x44de0f){_0x253773=_0x44de0f[_0x3ede('0x35')];if(!_0x573449['query'][_0x3ede('0x36')](_0x3ede('0x37'))){_0x14ccec[_0x3ede('0x21')]=qs[_0x3ede('0x21')](_0x573449[_0x3ede('0x31')]['limit']);_0x14ccec[_0x3ede('0x1f')]=qs[_0x3ede('0x1f')](_0x573449[_0x3ede('0x31')]['offset']);}return _0x519daf['getConfigurations'](_0x14ccec);}})['then'](function(_0x1060dd){if(_0x1060dd){return _0x1060dd?{'count':_0x253773,'rows':_0x1060dd}:null;}})[_0x3ede('0x27')](respondWithResult(_0x284680,null))['catch'](handleError(_0x284680,null));};exports[_0x3ede('0x4d')]=function(_0x3c2eec,_0x28ba81,_0x48a2e7){if(_0x3c2eec['body']['id']){delete _0x3c2eec[_0x3ede('0x49')]['id'];}return db[_0x3ede('0x40')][_0x3ede('0x4e')]({'where':{'id':_0x3c2eec[_0x3ede('0x4a')]['id']}})[_0x3ede('0x27')](handleEntityNotFound(_0x28ba81,null))[_0x3ede('0x27')](function(_0x28c19e){if(_0x28c19e){_0x3c2eec[_0x3ede('0x49')][_0x3ede('0x4f')]=_0x28c19e['id'];_0x3c2eec[_0x3ede('0x49')]['Subjects']=integrations['getSubjects'](_0x3c2eec[_0x3ede('0x49')]['channel'],_0x3c2eec[_0x3ede('0x49')][_0x3ede('0x2e')]);_0x3c2eec[_0x3ede('0x49')][_0x3ede('0x50')]=integrations['getDescriptions'](_0x3c2eec['body'][_0x3ede('0x51')],_0x3c2eec[_0x3ede('0x49')]['type']);return db[_0x3ede('0x4b')][_0x3ede('0x52')](_0x3c2eec[_0x3ede('0x49')],{'include':[{'model':db[_0x3ede('0x53')],'as':'Subjects'},{'model':db[_0x3ede('0x53')],'as':'Descriptions'}]});}return null;})[_0x3ede('0x27')](respondWithResult(_0x28ba81,null))[_0x3ede('0x44')](handleError(_0x28ba81,null));};exports['getFields']=function(_0x569aa2,_0x2842df,_0x39205f){var _0x27e3c3='';return db[_0x3ede('0x40')]['findOne']({'where':{'id':_0x569aa2[_0x3ede('0x4a')]['id']},'attributes':['id','remoteUri','apiKey']})['then'](handleEntityNotFound(_0x2842df,null))['then'](function(_0x13c593){if(_0x13c593){_0x27e3c3=_0x13c593[_0x3ede('0x54')];var _0x1cea7d=_0x27e3c3[_0x3ede('0x55')](-0x1);if(_0x1cea7d==='/'){_0x27e3c3=_0x27e3c3['substring'](0x0,_0x27e3c3[_0x3ede('0x56')](_0x1cea7d));}return rp({'method':_0x3ede('0x57'),'uri':util[_0x3ede('0x58')](_0x3ede('0x59'),_0x27e3c3,_0x3ede('0x5a')),'headers':{'Authorization':util[_0x3ede('0x58')](_0x3ede('0x5b'),new Buffer(util[_0x3ede('0x58')](_0x3ede('0x5c'),_0x13c593[_0x3ede('0x5d')]))[_0x3ede('0x5e')](_0x3ede('0x5f')))},'json':!![]});}})[_0x3ede('0x27')](function(_0x4691d2){if(_0x4691d2){var _0x4fd768=['requester','subject','agent',_0x3ede('0x60'),'status','priority',_0x3ede('0x61'),_0x3ede('0x62'),_0x3ede('0x63'),'group',_0x3ede('0x64')];_[_0x3ede('0x65')](_0x4691d2,function(_0xa9e773){return _0x4fd768[_0x3ede('0x66')](_0xa9e773[_0x3ede('0x2a')])||!_0xa9e773[_0x3ede('0x67')]&&_0xa9e773[_0x3ede('0x2e')]!=='custom_text'&&_0xa9e773['type']!==_0x3ede('0x68');});return{'count':_0x4691d2[_0x3ede('0x35')],'rows':_[_0x3ede('0x2c')](_0x4691d2,function(_0x5aaa01){return{'id':_0x5aaa01[_0x3ede('0x2a')],'name':_0x5aaa01[_0x3ede('0x69')],'custom':!_0x5aaa01[_0x3ede('0x67')],'options':_0x5aaa01[_0x3ede('0x6a')]?_['map'](_0x5aaa01[_0x3ede('0x6a')],function(_0x4ea3b6){return{'name':_['capitalize'](_0x4ea3b6),'value':_0x4ea3b6};}):[]};})};}})[_0x3ede('0x27')](respondWithResult(_0x2842df,null))['catch'](function(_0x1996d9){var _0x130f11=_0x569aa2['query'][_0x3ede('0x6b')]?0x1f4:_0x1996d9[_0x3ede('0x6c')]||0x1f4;logger['error'](_0x3ede('0x6d'),_0x3ede('0x6e'),_0x130f11,JSON['stringify'](_0x1996d9));delete _0x1996d9[_0x3ede('0x2a')];if(_0x130f11===0x191){_0x130f11=0x190;}_0x2842df['status'](_0x130f11)['send'](_0x569aa2[_0x3ede('0x31')][_0x3ede('0x6b')]?{'message':_0x3ede('0x6f'),'statusCode':_0x1996d9[_0x3ede('0x6c')]}:_0x1996d9);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index e1dc644..6cc1c67 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 _0xa070=['rimraf','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define','FreshdeskAccount','lodash','../../config/logger','api','moment','request-promise','path'];(function(_0x4611fe,_0x56eff1){var _0x395bbd=function(_0x49b39a){while(--_0x49b39a){_0x4611fe['push'](_0x4611fe['shift']());}};_0x395bbd(++_0x56eff1);}(_0xa070,0x1b4));var _0x0a07=function(_0xae7638,_0x5af955){_0xae7638=_0xae7638-0x0;var _0x5cacfa=_0xa070[_0xae7638];return _0x5cacfa;};'use strict';var _=require(_0x0a07('0x0'));var util=require('util');var logger=require(_0x0a07('0x1'))(_0x0a07('0x2'));var moment=require(_0x0a07('0x3'));var BPromise=require('bluebird');var rp=require(_0x0a07('0x4'));var fs=require('fs');var path=require(_0x0a07('0x5'));var rimraf=require(_0x0a07('0x6'));var config=require(_0x0a07('0x7'));var attributes=require(_0x0a07('0x8'));var integrations=require(_0x0a07('0x9'));module[_0x0a07('0xa')]=function(_0x4b175b,_0x48957f){return _0x4b175b[_0x0a07('0xb')](_0x0a07('0xc'),attributes,{'tableName':'int_freshdesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x54f7=['bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskAccount.attributes','define','FreshdeskAccount','int_freshdesk_accounts','lodash','util','../../config/logger','api','moment'];(function(_0x1e3c16,_0x372caa){var _0x47a0c9=function(_0x47f81d){while(--_0x47f81d){_0x1e3c16['push'](_0x1e3c16['shift']());}};_0x47a0c9(++_0x372caa);}(_0x54f7,0x6b));var _0x754f=function(_0x53a9d1,_0x285bb1){_0x53a9d1=_0x53a9d1-0x0;var _0x50fb37=_0x54f7[_0x53a9d1];return _0x50fb37;};'use strict';var _=require(_0x754f('0x0'));var util=require(_0x754f('0x1'));var logger=require(_0x754f('0x2'))(_0x754f('0x3'));var moment=require(_0x754f('0x4'));var BPromise=require(_0x754f('0x5'));var rp=require(_0x754f('0x6'));var fs=require('fs');var path=require(_0x754f('0x7'));var rimraf=require(_0x754f('0x8'));var config=require(_0x754f('0x9'));var attributes=require(_0x754f('0xa'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x14b2d5,_0x331db6){return _0x14b2d5[_0x754f('0xb')](_0x754f('0xc'),attributes,{'tableName':_0x754f('0xd'),'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 af7e1bb..1a1dc21 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 _0x2624=['attributes','limit','include','model','map','GetFreshdeskAccount','find','where','ShowFreshdeskAccount','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','FreshdeskAccount','findAll','options','raw'];(function(_0x40df5f,_0x8fd59f){var _0x1573f1=function(_0x57b8b8){while(--_0x57b8b8){_0x40df5f['push'](_0x40df5f['shift']());}};_0x1573f1(++_0x8fd59f);}(_0x2624,0x75));var _0x4262=function(_0x4ac334,_0x28341d){_0x4ac334=_0x4ac334-0x0;var _0x5a9f83=_0x2624[_0x4ac334];return _0x5a9f83;};'use strict';var _=require(_0x4262('0x0'));var util=require(_0x4262('0x1'));var moment=require('moment');var BPromise=require(_0x4262('0x2'));var rs=require(_0x4262('0x3'));var fs=require('fs');var Redis=require(_0x4262('0x4'));var db=require(_0x4262('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x4262('0x6'))(_0x4262('0x7'));var config=require(_0x4262('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x4262('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3bc80c,_0x33765f,_0x414a21){return new BPromise(function(_0x4f35cb,_0x590268){return client[_0x4262('0xa')](_0x3bc80c,_0x414a21)[_0x4262('0xb')](function(_0x221be9){logger[_0x4262('0xc')](_0x4262('0xd'),_0x33765f,_0x4262('0xe'));logger[_0x4262('0xf')](_0x4262('0x10'),_0x33765f,_0x4262('0xe'),JSON[_0x4262('0x11')](_0x221be9));if(_0x221be9['error']){if(_0x221be9['error'][_0x4262('0x12')]===0x1f4){logger[_0x4262('0x13')](_0x4262('0xd'),_0x33765f,_0x221be9['error'][_0x4262('0x14')]);return _0x590268(_0x221be9[_0x4262('0x13')][_0x4262('0x14')]);}logger[_0x4262('0x13')]('FreshdeskAccount,\x20%s,\x20%s',_0x33765f,_0x221be9[_0x4262('0x13')][_0x4262('0x14')]);return _0x4f35cb(_0x221be9[_0x4262('0x13')]['message']);}else{logger[_0x4262('0xc')]('FreshdeskAccount,\x20%s,\x20%s',_0x33765f,'request\x20sent');_0x4f35cb(_0x221be9[_0x4262('0x15')][_0x4262('0x14')]);}})[_0x4262('0x16')](function(_0x12e0e6){logger[_0x4262('0x13')](_0x4262('0xd'),_0x33765f,_0x12e0e6);_0x590268(_0x12e0e6);});});}exports['GetFreshdeskAccount']=function(_0x25e972){var _0x202f6b=this;return new Promise(function(_0x2c760f,_0x112774){return db[_0x4262('0x17')][_0x4262('0x18')]({'raw':_0x25e972[_0x4262('0x19')]?_0x25e972[_0x4262('0x19')][_0x4262('0x1a')]===undefined?!![]:![]:!![],'where':_0x25e972['options']?_0x25e972['options']['where']||null:null,'attributes':_0x25e972['options']?_0x25e972[_0x4262('0x19')][_0x4262('0x1b')]||null:null,'limit':_0x25e972[_0x4262('0x19')]?_0x25e972[_0x4262('0x19')][_0x4262('0x1c')]||null:null,'include':_0x25e972[_0x4262('0x19')]?_0x25e972[_0x4262('0x19')][_0x4262('0x1d')]?_['map'](_0x25e972[_0x4262('0x19')]['include'],function(_0x210ed5){return{'model':db[_0x210ed5[_0x4262('0x1e')]],'as':_0x210ed5['as'],'attributes':_0x210ed5[_0x4262('0x1b')],'include':_0x210ed5[_0x4262('0x1d')]?_[_0x4262('0x1f')](_0x210ed5[_0x4262('0x1d')],function(_0x91a242){return{'model':db[_0x91a242[_0x4262('0x1e')]],'as':_0x91a242['as'],'attributes':_0x91a242['attributes'],'include':_0x91a242[_0x4262('0x1d')]?_['map'](_0x91a242['include'],function(_0x41e83b){return{'model':db[_0x41e83b['model']],'as':_0x41e83b['as'],'attributes':_0x41e83b[_0x4262('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x4262('0xb')](function(_0xb87c61){logger['info'](_0x4262('0x20'),_0x25e972);logger['debug'](_0x4262('0x20'),_0x25e972,JSON[_0x4262('0x11')](_0xb87c61));_0x2c760f(_0xb87c61);})[_0x4262('0x16')](function(_0x22dc24){logger[_0x4262('0x13')](_0x4262('0x20'),_0x22dc24[_0x4262('0x14')],_0x25e972);_0x112774(_0x202f6b[_0x4262('0x13')](0x1f4,_0x22dc24['message']));});});};exports['ShowFreshdeskAccount']=function(_0x1c0453){var _0x3a16b1=this;return new Promise(function(_0x44e822,_0x50c5b3){return db[_0x4262('0x17')][_0x4262('0x21')]({'raw':_0x1c0453[_0x4262('0x19')]?_0x1c0453[_0x4262('0x19')][_0x4262('0x1a')]===undefined?!![]:![]:!![],'where':_0x1c0453['options']?_0x1c0453['options'][_0x4262('0x22')]||null:null,'attributes':_0x1c0453['options']?_0x1c0453[_0x4262('0x19')][_0x4262('0x1b')]||null:null,'include':_0x1c0453[_0x4262('0x19')]?_0x1c0453[_0x4262('0x19')]['include']?_['map'](_0x1c0453[_0x4262('0x19')][_0x4262('0x1d')],function(_0x218528){return{'model':db[_0x218528['model']],'as':_0x218528['as'],'attributes':_0x218528[_0x4262('0x1b')],'include':_0x218528[_0x4262('0x1d')]?_[_0x4262('0x1f')](_0x218528[_0x4262('0x1d')],function(_0x36849d){return{'model':db[_0x36849d[_0x4262('0x1e')]],'as':_0x36849d['as'],'attributes':_0x36849d[_0x4262('0x1b')],'include':_0x36849d[_0x4262('0x1d')]?_['map'](_0x36849d[_0x4262('0x1d')],function(_0x67503){return{'model':db[_0x67503[_0x4262('0x1e')]],'as':_0x67503['as'],'attributes':_0x67503[_0x4262('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x4262('0xb')](function(_0x154935){logger[_0x4262('0xc')](_0x4262('0x23'),_0x1c0453);logger[_0x4262('0xf')]('ShowFreshdeskAccount',_0x1c0453,JSON[_0x4262('0x11')](_0x154935));_0x44e822(_0x154935);})['catch'](function(_0x449d22){logger[_0x4262('0x13')](_0x4262('0x23'),_0x449d22[_0x4262('0x14')],_0x1c0453);_0x50c5b3(_0x3a16b1[_0x4262('0x13')](0x1f4,_0x449d22[_0x4262('0x14')]));});});}; \ No newline at end of file +var _0x1bf3=['error','code','message','result','GetFreshdeskAccount','FreshdeskAccount','findAll','options','where','attributes','limit','include','map','model','catch','ShowFreshdeskAccount','find','raw','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','jayson/promise','client','http','request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x61d1d9,_0x2fe897){var _0xc01da2=function(_0x518d8d){while(--_0x518d8d){_0x61d1d9['push'](_0x61d1d9['shift']());}};_0xc01da2(++_0x2fe897);}(_0x1bf3,0xc1));var _0x31bf=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x1bf3[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0x31bf('0x0'));var util=require(_0x31bf('0x1'));var moment=require(_0x31bf('0x2'));var BPromise=require(_0x31bf('0x3'));var rs=require(_0x31bf('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x31bf('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x31bf('0x6'));var config=require('../../config/environment');var jayson=require(_0x31bf('0x7'));var client=jayson[_0x31bf('0x8')][_0x31bf('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x46b8d1,_0x1e5a01,_0x131cfd){return new BPromise(function(_0x4b2e66,_0xdaad47){return client[_0x31bf('0xa')](_0x46b8d1,_0x131cfd)[_0x31bf('0xb')](function(_0x918e53){logger[_0x31bf('0xc')](_0x31bf('0xd'),_0x1e5a01,_0x31bf('0xe'));logger[_0x31bf('0xf')]('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x1e5a01,'request\x20sent',JSON[_0x31bf('0x10')](_0x918e53));if(_0x918e53[_0x31bf('0x11')]){if(_0x918e53[_0x31bf('0x11')][_0x31bf('0x12')]===0x1f4){logger[_0x31bf('0x11')](_0x31bf('0xd'),_0x1e5a01,_0x918e53[_0x31bf('0x11')][_0x31bf('0x13')]);return _0xdaad47(_0x918e53['error']['message']);}logger['error']('FreshdeskAccount,\x20%s,\x20%s',_0x1e5a01,_0x918e53[_0x31bf('0x11')][_0x31bf('0x13')]);return _0x4b2e66(_0x918e53[_0x31bf('0x11')][_0x31bf('0x13')]);}else{logger['info'](_0x31bf('0xd'),_0x1e5a01,_0x31bf('0xe'));_0x4b2e66(_0x918e53[_0x31bf('0x14')][_0x31bf('0x13')]);}})['catch'](function(_0x4b4e74){logger['error']('FreshdeskAccount,\x20%s,\x20%s',_0x1e5a01,_0x4b4e74);_0xdaad47(_0x4b4e74);});});}exports[_0x31bf('0x15')]=function(_0x25dbd2){var _0x6c6352=this;return new Promise(function(_0x2b3131,_0x3a4aee){return db[_0x31bf('0x16')][_0x31bf('0x17')]({'raw':_0x25dbd2[_0x31bf('0x18')]?_0x25dbd2['options']['raw']===undefined?!![]:![]:!![],'where':_0x25dbd2[_0x31bf('0x18')]?_0x25dbd2[_0x31bf('0x18')][_0x31bf('0x19')]||null:null,'attributes':_0x25dbd2[_0x31bf('0x18')]?_0x25dbd2[_0x31bf('0x18')][_0x31bf('0x1a')]||null:null,'limit':_0x25dbd2[_0x31bf('0x18')]?_0x25dbd2[_0x31bf('0x18')][_0x31bf('0x1b')]||null:null,'include':_0x25dbd2[_0x31bf('0x18')]?_0x25dbd2['options'][_0x31bf('0x1c')]?_[_0x31bf('0x1d')](_0x25dbd2[_0x31bf('0x18')][_0x31bf('0x1c')],function(_0x137da8){return{'model':db[_0x137da8[_0x31bf('0x1e')]],'as':_0x137da8['as'],'attributes':_0x137da8['attributes'],'include':_0x137da8[_0x31bf('0x1c')]?_['map'](_0x137da8[_0x31bf('0x1c')],function(_0x314fe3){return{'model':db[_0x314fe3[_0x31bf('0x1e')]],'as':_0x314fe3['as'],'attributes':_0x314fe3[_0x31bf('0x1a')],'include':_0x314fe3[_0x31bf('0x1c')]?_[_0x31bf('0x1d')](_0x314fe3[_0x31bf('0x1c')],function(_0x1dbaf1){return{'model':db[_0x1dbaf1[_0x31bf('0x1e')]],'as':_0x1dbaf1['as'],'attributes':_0x1dbaf1[_0x31bf('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x31bf('0xb')](function(_0x26636e){logger[_0x31bf('0xc')](_0x31bf('0x15'),_0x25dbd2);logger['debug'](_0x31bf('0x15'),_0x25dbd2,JSON[_0x31bf('0x10')](_0x26636e));_0x2b3131(_0x26636e);})[_0x31bf('0x1f')](function(_0x18663b){logger['error'](_0x31bf('0x15'),_0x18663b[_0x31bf('0x13')],_0x25dbd2);_0x3a4aee(_0x6c6352[_0x31bf('0x11')](0x1f4,_0x18663b[_0x31bf('0x13')]));});});};exports[_0x31bf('0x20')]=function(_0x29aa09){var _0xc17024=this;return new Promise(function(_0x10c194,_0x22acbe){return db['FreshdeskAccount'][_0x31bf('0x21')]({'raw':_0x29aa09[_0x31bf('0x18')]?_0x29aa09[_0x31bf('0x18')][_0x31bf('0x22')]===undefined?!![]:![]:!![],'where':_0x29aa09[_0x31bf('0x18')]?_0x29aa09[_0x31bf('0x18')][_0x31bf('0x19')]||null:null,'attributes':_0x29aa09[_0x31bf('0x18')]?_0x29aa09[_0x31bf('0x18')]['attributes']||null:null,'include':_0x29aa09[_0x31bf('0x18')]?_0x29aa09[_0x31bf('0x18')][_0x31bf('0x1c')]?_[_0x31bf('0x1d')](_0x29aa09[_0x31bf('0x18')]['include'],function(_0x49e61f){return{'model':db[_0x49e61f['model']],'as':_0x49e61f['as'],'attributes':_0x49e61f[_0x31bf('0x1a')],'include':_0x49e61f[_0x31bf('0x1c')]?_[_0x31bf('0x1d')](_0x49e61f['include'],function(_0x50b1e3){return{'model':db[_0x50b1e3[_0x31bf('0x1e')]],'as':_0x50b1e3['as'],'attributes':_0x50b1e3[_0x31bf('0x1a')],'include':_0x50b1e3[_0x31bf('0x1c')]?_[_0x31bf('0x1d')](_0x50b1e3[_0x31bf('0x1c')],function(_0x463900){return{'model':db[_0x463900[_0x31bf('0x1e')]],'as':_0x463900['as'],'attributes':_0x463900['attributes']};}):[]};}):[]};}):[]:[]})[_0x31bf('0xb')](function(_0x4d7dac){logger['info'](_0x31bf('0x20'),_0x29aa09);logger['debug'](_0x31bf('0x20'),_0x29aa09,JSON['stringify'](_0x4d7dac));_0x10c194(_0x4d7dac);})[_0x31bf('0x1f')](function(_0x2e1a09){logger[_0x31bf('0x11')](_0x31bf('0x20'),_0x2e1a09[_0x31bf('0x13')],_0x29aa09);_0x22acbe(_0xc17024[_0x31bf('0x11')](0x1f4,_0x2e1a09[_0x31bf('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 6bfa4bc..95a327b 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 _0xefbd=['/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','post','create','setTags','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','get','index','isAuthenticated'];(function(_0x3ff7d4,_0x37049e){var _0x7d1322=function(_0x590d11){while(--_0x590d11){_0x3ff7d4['push'](_0x3ff7d4['shift']());}};_0x7d1322(++_0x37049e);}(_0xefbd,0x1eb));var _0xdefb=function(_0x20e51b,_0x1d21bc){_0x20e51b=_0x20e51b-0x0;var _0x4d8fc4=_0xefbd[_0x20e51b];return _0x4d8fc4;};'use strict';var multer=require(_0xdefb('0x0'));var util=require(_0xdefb('0x1'));var path=require(_0xdefb('0x2'));var timeout=require('connect-timeout');var express=require(_0xdefb('0x3'));var router=express[_0xdefb('0x4')]();var fs_extra=require(_0xdefb('0x5'));var auth=require(_0xdefb('0x6'));var interaction=require(_0xdefb('0x7'));var config=require(_0xdefb('0x8'));var controller=require(_0xdefb('0x9'));router[_0xdefb('0xa')]('/',auth['isAuthenticated'](),controller[_0xdefb('0xb')]);router[_0xdefb('0xa')]('/:id',auth[_0xdefb('0xc')](),controller['show']);router[_0xdefb('0xa')](_0xdefb('0xd'),auth['isAuthenticated'](),controller[_0xdefb('0xe')]);router[_0xdefb('0xa')](_0xdefb('0xf'),auth[_0xdefb('0xc')](),controller[_0xdefb('0x10')]);router[_0xdefb('0xa')](_0xdefb('0x11'),auth['isAuthenticated'](),controller[_0xdefb('0x12')]);router['get'](_0xdefb('0x13'),auth['isAuthenticated'](),controller['getTags']);router[_0xdefb('0x14')]('/',auth[_0xdefb('0xc')](),controller[_0xdefb('0x15')]);router[_0xdefb('0x14')](_0xdefb('0x13'),auth[_0xdefb('0xc')](),controller[_0xdefb('0x16')]);router[_0xdefb('0x17')]('/:id',auth[_0xdefb('0xc')](),controller[_0xdefb('0x18')]);router[_0xdefb('0x19')]('/:id',auth['isAuthenticated'](),controller[_0xdefb('0x1a')]);module[_0xdefb('0x1b')]=router; \ No newline at end of file +var _0xc699=['../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','create','post','setTags','put','exports','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x2255ba,_0x22cd6d){var _0x132223=function(_0xd31279){while(--_0xd31279){_0x2255ba['push'](_0x2255ba['shift']());}};_0x132223(++_0x22cd6d);}(_0xc699,0xdc));var _0x9c69=function(_0x46759d,_0x13e994){_0x46759d=_0x46759d-0x0;var _0x3e7fe0=_0xc699[_0x46759d];return _0x3e7fe0;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x9c69('0x0'));var express=require(_0x9c69('0x1'));var router=express[_0x9c69('0x2')]();var fs_extra=require(_0x9c69('0x3'));var auth=require(_0x9c69('0x4'));var interaction=require(_0x9c69('0x5'));var config=require(_0x9c69('0x6'));var controller=require(_0x9c69('0x7'));router[_0x9c69('0x8')]('/',auth[_0x9c69('0x9')](),controller[_0x9c69('0xa')]);router['get'](_0x9c69('0xb'),auth[_0x9c69('0x9')](),controller[_0x9c69('0xc')]);router[_0x9c69('0x8')](_0x9c69('0xd'),auth[_0x9c69('0x9')](),controller['getFields']);router['get'](_0x9c69('0xe'),auth['isAuthenticated'](),controller[_0x9c69('0xf')]);router['get'](_0x9c69('0x10'),auth[_0x9c69('0x9')](),controller[_0x9c69('0x11')]);router['get'](_0x9c69('0x12'),auth[_0x9c69('0x9')](),controller[_0x9c69('0x13')]);router['post']('/',auth['isAuthenticated'](),controller[_0x9c69('0x14')]);router[_0x9c69('0x15')](_0x9c69('0x12'),auth[_0x9c69('0x9')](),controller[_0x9c69('0x16')]);router[_0x9c69('0x17')](_0x9c69('0xb'),auth[_0x9c69('0x9')](),controller['update']);router['delete']('/:id',auth[_0x9c69('0x9')](),controller['destroy']);module[_0x9c69('0x18')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index 4d20bdb..879396f 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 _0xf836=['exports','STRING','sequelize'];(function(_0x48ac40,_0x1e3beb){var _0x55df02=function(_0x5e27d6){while(--_0x5e27d6){_0x48ac40['push'](_0x48ac40['shift']());}};_0x55df02(++_0x1e3beb);}(_0xf836,0x1f4));var _0x6f83=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf836[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x6f83('0x0'));module[_0x6f83('0x1')]={'name':{'type':Sequelize[_0x6f83('0x2')]},'description':{'type':Sequelize[_0x6f83('0x2')]}}; \ No newline at end of file +var _0x2247=['exports','STRING'];(function(_0x53ee61,_0x564943){var _0x215b35=function(_0x315748){while(--_0x315748){_0x53ee61['push'](_0x53ee61['shift']());}};_0x215b35(++_0x564943);}(_0x2247,0x1d0));var _0x7224=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0x2247[_0x2064e5];return _0x21a233;};'use strict';var Sequelize=require('sequelize');module[_0x7224('0x0')]={'name':{'type':Sequelize[_0x7224('0x1')]},'description':{'type':Sequelize[_0x7224('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index 21aa2f8..9c46d41 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 _0x6172=['sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','index','map','FreshdeskConfiguration','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','options','includeAll','include','rows','catch','show','params','keys','rawAttributes','create','body','find','getFields','findOne','FreshdeskField','order','nolimit','getSubjects','getDescriptions','getTags','Tag','setTags','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','ejs','squel','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'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x6172,0x17a));var _0x2617=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x6172[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x2617('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2617('0x1'));var jsonpatch=require(_0x2617('0x2'));var rp=require(_0x2617('0x3'));var moment=require('moment');var BPromise=require(_0x2617('0x4'));var Mustache=require('mustache');var util=require(_0x2617('0x5'));var path=require('path');var sox=require(_0x2617('0x6'));var csv=require(_0x2617('0x7'));var ejs=require(_0x2617('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x2617('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x2617('0xa'));var toCsv=require(_0x2617('0x7'));var querystring=require(_0x2617('0xb'));var Papa=require(_0x2617('0xc'));var Redis=require(_0x2617('0xd'));var authService=require(_0x2617('0xe'));var qs=require(_0x2617('0xf'));var as=require(_0x2617('0x10'));var hardwareService=require(_0x2617('0x11'));var logger=require(_0x2617('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x2617('0x13'));var licenseUtil=require(_0x2617('0x14'));var db=require(_0x2617('0x15'))['db'];function respondWithStatusCode(_0x154495,_0x241a91){_0x241a91=_0x241a91||0xcc;return function(_0x570a4d){if(_0x570a4d){return _0x154495[_0x2617('0x16')](_0x241a91);}return _0x154495[_0x2617('0x17')](_0x241a91)[_0x2617('0x18')]();};}function respondWithResult(_0x3dd995,_0x8f9975){_0x8f9975=_0x8f9975||0xc8;return function(_0x5e9fe5){if(_0x5e9fe5){return _0x3dd995[_0x2617('0x17')](_0x8f9975)[_0x2617('0x19')](_0x5e9fe5);}};}function respondWithFilteredResult(_0x4d66c7,_0x48c084){return function(_0x383784){if(_0x383784){var _0x5a08ab=typeof _0x48c084[_0x2617('0x1a')]===_0x2617('0x1b')&&typeof _0x48c084[_0x2617('0x1c')]==='undefined';var _0x97de4b=_0x383784['count'];var _0x5604d6=_0x5a08ab?0x0:_0x48c084['offset'];var _0x29b960=_0x5a08ab?_0x383784[_0x2617('0x1d')]:_0x48c084[_0x2617('0x1a')]+_0x48c084[_0x2617('0x1c')];var _0x1d6c8c;if(_0x29b960>=_0x97de4b){_0x29b960=_0x97de4b;_0x1d6c8c=0xc8;}else{_0x1d6c8c=0xce;}_0x4d66c7[_0x2617('0x17')](_0x1d6c8c);return _0x4d66c7[_0x2617('0x1e')](_0x2617('0x1f'),_0x5604d6+'-'+_0x29b960+'/'+_0x97de4b)[_0x2617('0x19')](_0x383784);}return null;};}function patchUpdates(_0x1831c4){return function(_0x13d729){try{jsonpatch[_0x2617('0x20')](_0x13d729,_0x1831c4,!![]);}catch(_0x417f28){return BPromise[_0x2617('0x21')](_0x417f28);}return _0x13d729[_0x2617('0x22')]();};}function saveUpdates(_0x1479b2,_0x42d21d){return function(_0x487148){if(_0x487148){return _0x487148[_0x2617('0x23')](_0x1479b2)[_0x2617('0x24')](function(_0x36174a){return _0x36174a;});}return null;};}function removeEntity(_0x27ea45,_0x2578c6){return function(_0x422581){if(_0x422581){return _0x422581[_0x2617('0x25')]()[_0x2617('0x24')](function(){_0x27ea45[_0x2617('0x17')](0xcc)[_0x2617('0x18')]();});}};}function handleEntityNotFound(_0x723d3b,_0x2b568f){return function(_0x586acc){if(!_0x586acc){_0x723d3b[_0x2617('0x16')](0x194);}return _0x586acc;};}function handleError(_0x2c613f,_0x307703){_0x307703=_0x307703||0x1f4;return function(_0x5e6428){logger['error'](_0x5e6428[_0x2617('0x26')]);if(_0x5e6428['name']){delete _0x5e6428[_0x2617('0x27')];}_0x2c613f[_0x2617('0x17')](_0x307703)['send'](_0x5e6428);};}exports[_0x2617('0x28')]=function(_0x5e6a1c,_0x2deda7){var _0x179daa={},_0x1ddbc8={},_0x2ca346={'count':0x0,'rows':[]};var _0x2809aa=_[_0x2617('0x29')](db[_0x2617('0x2a')]['rawAttributes'],function(_0x218029){return{'name':_0x218029['fieldName'],'type':_0x218029[_0x2617('0x2b')][_0x2617('0x2c')]};});_0x1ddbc8[_0x2617('0x2d')]=_[_0x2617('0x29')](_0x2809aa,_0x2617('0x27'));_0x1ddbc8['query']=_['keys'](_0x5e6a1c[_0x2617('0x2e')]);_0x1ddbc8[_0x2617('0x2f')]=_[_0x2617('0x30')](_0x1ddbc8[_0x2617('0x2d')],_0x1ddbc8[_0x2617('0x2e')]);_0x179daa[_0x2617('0x31')]=_[_0x2617('0x30')](_0x1ddbc8[_0x2617('0x2d')],qs[_0x2617('0x32')](_0x5e6a1c[_0x2617('0x2e')]['fields']));_0x179daa[_0x2617('0x31')]=_0x179daa['attributes'][_0x2617('0x33')]?_0x179daa[_0x2617('0x31')]:_0x1ddbc8['model'];if(!_0x5e6a1c[_0x2617('0x2e')][_0x2617('0x34')]('nolimit')){_0x179daa[_0x2617('0x1c')]=qs[_0x2617('0x1c')](_0x5e6a1c[_0x2617('0x2e')][_0x2617('0x1c')]);_0x179daa[_0x2617('0x1a')]=qs['offset'](_0x5e6a1c[_0x2617('0x2e')][_0x2617('0x1a')]);}_0x179daa['order']=qs[_0x2617('0x35')](_0x5e6a1c[_0x2617('0x2e')]['sort']);_0x179daa[_0x2617('0x36')]=qs[_0x2617('0x2f')](_[_0x2617('0x37')](_0x5e6a1c[_0x2617('0x2e')],_0x1ddbc8[_0x2617('0x2f')]),_0x2809aa);if(_0x5e6a1c[_0x2617('0x2e')][_0x2617('0x38')]){_0x179daa[_0x2617('0x36')]=_[_0x2617('0x39')](_0x179daa['where'],{'$or':_[_0x2617('0x29')](_0x2809aa,function(_0x2a87ae){if(_0x2a87ae[_0x2617('0x2b')]!=='VIRTUAL'){var _0x36515f={};_0x36515f[_0x2a87ae['name']]={'$like':'%'+_0x5e6a1c[_0x2617('0x2e')][_0x2617('0x38')]+'%'};return _0x36515f;}})});}_0x179daa=_[_0x2617('0x39')]({},_0x179daa,_0x5e6a1c[_0x2617('0x3a')]);var _0x53d14b={'where':_0x179daa[_0x2617('0x36')]};return db[_0x2617('0x2a')][_0x2617('0x1d')](_0x53d14b)[_0x2617('0x24')](function(_0x575088){_0x2ca346['count']=_0x575088;if(_0x5e6a1c[_0x2617('0x2e')][_0x2617('0x3b')]){_0x179daa[_0x2617('0x3c')]=[{'all':!![]}];}return db[_0x2617('0x2a')]['findAll'](_0x179daa);})[_0x2617('0x24')](function(_0xb25cc2){_0x2ca346[_0x2617('0x3d')]=_0xb25cc2;return _0x2ca346;})[_0x2617('0x24')](respondWithFilteredResult(_0x2deda7,_0x179daa))[_0x2617('0x3e')](handleError(_0x2deda7,null));};exports[_0x2617('0x3f')]=function(_0x3cd605,_0x32716e){var _0x16e7f3={'raw':![],'where':{'id':_0x3cd605[_0x2617('0x40')]['id']}},_0x56e55a={};_0x56e55a['model']=_[_0x2617('0x41')](db[_0x2617('0x2a')][_0x2617('0x42')]);_0x56e55a[_0x2617('0x2e')]=_['keys'](_0x3cd605[_0x2617('0x2e')]);_0x56e55a['filters']=_[_0x2617('0x30')](_0x56e55a['model'],_0x56e55a[_0x2617('0x2e')]);_0x16e7f3['attributes']=_['intersection'](_0x56e55a[_0x2617('0x2d')],qs['fields'](_0x3cd605['query'][_0x2617('0x32')]));_0x16e7f3[_0x2617('0x31')]=_0x16e7f3[_0x2617('0x31')]['length']?_0x16e7f3[_0x2617('0x31')]:_0x56e55a['model'];if(_0x3cd605[_0x2617('0x2e')][_0x2617('0x3b')]){_0x16e7f3[_0x2617('0x3c')]=[{'all':!![]}];}_0x16e7f3=_['merge']({},_0x16e7f3,_0x3cd605['options']);return db[_0x2617('0x2a')]['find'](_0x16e7f3)[_0x2617('0x24')](handleEntityNotFound(_0x32716e,null))[_0x2617('0x24')](respondWithResult(_0x32716e,null))[_0x2617('0x3e')](handleError(_0x32716e,null));};exports[_0x2617('0x43')]=function(_0x4f65b0,_0x176b81){return db[_0x2617('0x2a')][_0x2617('0x43')](_0x4f65b0[_0x2617('0x44')],{})[_0x2617('0x24')](respondWithResult(_0x176b81,0xc9))[_0x2617('0x3e')](handleError(_0x176b81,null));};exports[_0x2617('0x23')]=function(_0x4d8fe5,_0x19a25e){if(_0x4d8fe5[_0x2617('0x44')]['id']){delete _0x4d8fe5[_0x2617('0x44')]['id'];}return db[_0x2617('0x2a')][_0x2617('0x45')]({'where':{'id':_0x4d8fe5['params']['id']}})['then'](handleEntityNotFound(_0x19a25e,null))[_0x2617('0x24')](saveUpdates(_0x4d8fe5[_0x2617('0x44')],null))['then'](respondWithResult(_0x19a25e,null))['catch'](handleError(_0x19a25e,null));};exports[_0x2617('0x25')]=function(_0x317ff7,_0x421e56){return db[_0x2617('0x2a')][_0x2617('0x45')]({'where':{'id':_0x317ff7[_0x2617('0x40')]['id']}})[_0x2617('0x24')](handleEntityNotFound(_0x421e56,null))[_0x2617('0x24')](removeEntity(_0x421e56,null))[_0x2617('0x3e')](handleError(_0x421e56,null));};exports[_0x2617('0x46')]=function(_0x510f57,_0x2b4895,_0x5b8774){var _0x31f927={};var _0x34f46e={};var _0x20bc03;var _0x18d7ae;return db[_0x2617('0x2a')][_0x2617('0x47')]({'where':{'id':_0x510f57[_0x2617('0x40')]['id']}})[_0x2617('0x24')](handleEntityNotFound(_0x2b4895,null))[_0x2617('0x24')](function(_0x4d1ffb){if(_0x4d1ffb){_0x20bc03=_0x4d1ffb;_0x34f46e[_0x2617('0x2d')]=_['keys'](db[_0x2617('0x48')][_0x2617('0x42')]);_0x34f46e[_0x2617('0x2e')]=_[_0x2617('0x41')](_0x510f57[_0x2617('0x2e')]);_0x34f46e['filters']=_[_0x2617('0x30')](_0x34f46e[_0x2617('0x2d')],_0x34f46e['query']);_0x31f927[_0x2617('0x31')]=_[_0x2617('0x30')](_0x34f46e['model'],qs[_0x2617('0x32')](_0x510f57[_0x2617('0x2e')][_0x2617('0x32')]));_0x31f927[_0x2617('0x31')]=_0x31f927[_0x2617('0x31')][_0x2617('0x33')]?_0x31f927[_0x2617('0x31')]:_0x34f46e[_0x2617('0x2d')];_0x31f927[_0x2617('0x49')]=qs[_0x2617('0x35')](_0x510f57['query'][_0x2617('0x35')]);_0x31f927[_0x2617('0x36')]=qs[_0x2617('0x2f')](_['pick'](_0x510f57[_0x2617('0x2e')],_0x34f46e[_0x2617('0x2f')]));if(_0x510f57['query'][_0x2617('0x38')]){_0x31f927['where']=_[_0x2617('0x39')](_0x31f927[_0x2617('0x36')],{'$or':_[_0x2617('0x29')](_0x31f927[_0x2617('0x31')],function(_0x526cae){var _0x4ffabb={};_0x4ffabb[_0x526cae]={'$like':'%'+_0x510f57[_0x2617('0x2e')][_0x2617('0x38')]+'%'};return _0x4ffabb;})});}_0x31f927=_[_0x2617('0x39')]({},_0x31f927,_0x510f57[_0x2617('0x3a')]);return _0x20bc03[_0x2617('0x46')](_0x31f927);}})[_0x2617('0x24')](function(_0x3fb7dc){if(_0x3fb7dc){_0x18d7ae=_0x3fb7dc[_0x2617('0x33')];if(!_0x510f57[_0x2617('0x2e')][_0x2617('0x34')](_0x2617('0x4a'))){_0x31f927['limit']=qs['limit'](_0x510f57[_0x2617('0x2e')][_0x2617('0x1c')]);_0x31f927[_0x2617('0x1a')]=qs[_0x2617('0x1a')](_0x510f57[_0x2617('0x2e')][_0x2617('0x1a')]);}return _0x20bc03[_0x2617('0x46')](_0x31f927);}})[_0x2617('0x24')](function(_0x800f2b){if(_0x800f2b){return _0x800f2b?{'count':_0x18d7ae,'rows':_0x800f2b}:null;}})[_0x2617('0x24')](respondWithResult(_0x2b4895,null))[_0x2617('0x3e')](handleError(_0x2b4895,null));};exports[_0x2617('0x4b')]=function(_0x560a5f,_0x31ab99,_0x5c6993){var _0x58db93={};var _0x111d13={};var _0xaaa584;var _0x24130c;return db[_0x2617('0x2a')]['findOne']({'where':{'id':_0x560a5f['params']['id']}})['then'](handleEntityNotFound(_0x31ab99,null))[_0x2617('0x24')](function(_0x559e69){if(_0x559e69){_0xaaa584=_0x559e69;_0x111d13[_0x2617('0x2d')]=_[_0x2617('0x41')](db[_0x2617('0x48')]['rawAttributes']);_0x111d13[_0x2617('0x2e')]=_[_0x2617('0x41')](_0x560a5f['query']);_0x111d13[_0x2617('0x2f')]=_[_0x2617('0x30')](_0x111d13[_0x2617('0x2d')],_0x111d13['query']);_0x58db93['attributes']=_[_0x2617('0x30')](_0x111d13['model'],qs[_0x2617('0x32')](_0x560a5f[_0x2617('0x2e')][_0x2617('0x32')]));_0x58db93['attributes']=_0x58db93[_0x2617('0x31')]['length']?_0x58db93[_0x2617('0x31')]:_0x111d13['model'];_0x58db93[_0x2617('0x49')]=qs[_0x2617('0x35')](_0x560a5f['query'][_0x2617('0x35')]);_0x58db93[_0x2617('0x36')]=qs[_0x2617('0x2f')](_[_0x2617('0x37')](_0x560a5f[_0x2617('0x2e')],_0x111d13[_0x2617('0x2f')]));if(_0x560a5f[_0x2617('0x2e')][_0x2617('0x38')]){_0x58db93[_0x2617('0x36')]=_[_0x2617('0x39')](_0x58db93['where'],{'$or':_[_0x2617('0x29')](_0x58db93[_0x2617('0x31')],function(_0x94c99e){var _0x41a9ab={};_0x41a9ab[_0x94c99e]={'$like':'%'+_0x560a5f[_0x2617('0x2e')][_0x2617('0x38')]+'%'};return _0x41a9ab;})});}_0x58db93=_[_0x2617('0x39')]({},_0x58db93,_0x560a5f[_0x2617('0x3a')]);return _0xaaa584[_0x2617('0x4b')](_0x58db93);}})[_0x2617('0x24')](function(_0x20dc7b){if(_0x20dc7b){_0x24130c=_0x20dc7b['length'];if(!_0x560a5f['query'][_0x2617('0x34')](_0x2617('0x4a'))){_0x58db93[_0x2617('0x1c')]=qs[_0x2617('0x1c')](_0x560a5f[_0x2617('0x2e')][_0x2617('0x1c')]);_0x58db93[_0x2617('0x1a')]=qs[_0x2617('0x1a')](_0x560a5f[_0x2617('0x2e')][_0x2617('0x1a')]);}return _0xaaa584[_0x2617('0x4b')](_0x58db93);}})['then'](function(_0x5438ec){if(_0x5438ec){return _0x5438ec?{'count':_0x24130c,'rows':_0x5438ec}:null;}})[_0x2617('0x24')](respondWithResult(_0x31ab99,null))[_0x2617('0x3e')](handleError(_0x31ab99,null));};exports[_0x2617('0x4c')]=function(_0x496158,_0x17cd72,_0x539101){var _0x2685f4={};var _0x100dea={};var _0x4707c7;var _0x55b584;return db[_0x2617('0x2a')][_0x2617('0x47')]({'where':{'id':_0x496158[_0x2617('0x40')]['id']}})[_0x2617('0x24')](handleEntityNotFound(_0x17cd72,null))[_0x2617('0x24')](function(_0x3a10e8){if(_0x3a10e8){_0x4707c7=_0x3a10e8;_0x100dea[_0x2617('0x2d')]=_[_0x2617('0x41')](db[_0x2617('0x48')]['rawAttributes']);_0x100dea[_0x2617('0x2e')]=_[_0x2617('0x41')](_0x496158[_0x2617('0x2e')]);_0x100dea['filters']=_['intersection'](_0x100dea['model'],_0x100dea[_0x2617('0x2e')]);_0x2685f4[_0x2617('0x31')]=_[_0x2617('0x30')](_0x100dea[_0x2617('0x2d')],qs[_0x2617('0x32')](_0x496158[_0x2617('0x2e')][_0x2617('0x32')]));_0x2685f4[_0x2617('0x31')]=_0x2685f4[_0x2617('0x31')][_0x2617('0x33')]?_0x2685f4[_0x2617('0x31')]:_0x100dea[_0x2617('0x2d')];_0x2685f4[_0x2617('0x49')]=qs[_0x2617('0x35')](_0x496158['query'][_0x2617('0x35')]);_0x2685f4[_0x2617('0x36')]=qs[_0x2617('0x2f')](_[_0x2617('0x37')](_0x496158[_0x2617('0x2e')],_0x100dea[_0x2617('0x2f')]));if(_0x496158[_0x2617('0x2e')][_0x2617('0x38')]){_0x2685f4[_0x2617('0x36')]=_[_0x2617('0x39')](_0x2685f4[_0x2617('0x36')],{'$or':_[_0x2617('0x29')](_0x2685f4['attributes'],function(_0x19e88b){var _0x2b53d3={};_0x2b53d3[_0x19e88b]={'$like':'%'+_0x496158[_0x2617('0x2e')][_0x2617('0x38')]+'%'};return _0x2b53d3;})});}_0x2685f4=_[_0x2617('0x39')]({},_0x2685f4,_0x496158[_0x2617('0x3a')]);return _0x4707c7['getDescriptions'](_0x2685f4);}})[_0x2617('0x24')](function(_0x4f233d){if(_0x4f233d){_0x55b584=_0x4f233d[_0x2617('0x33')];if(!_0x496158[_0x2617('0x2e')]['hasOwnProperty'](_0x2617('0x4a'))){_0x2685f4[_0x2617('0x1c')]=qs['limit'](_0x496158[_0x2617('0x2e')][_0x2617('0x1c')]);_0x2685f4[_0x2617('0x1a')]=qs['offset'](_0x496158[_0x2617('0x2e')][_0x2617('0x1a')]);}return _0x4707c7[_0x2617('0x4c')](_0x2685f4);}})[_0x2617('0x24')](function(_0x58699b){if(_0x58699b){return _0x58699b?{'count':_0x55b584,'rows':_0x58699b}:null;}})['then'](respondWithResult(_0x17cd72,null))[_0x2617('0x3e')](handleError(_0x17cd72,null));};exports[_0x2617('0x4d')]=function(_0x37ddbb,_0x486adc,_0x389c6e){var _0x4601de={};var _0x2d4330={};var _0x1453e5;var _0x543c4f;return db[_0x2617('0x2a')][_0x2617('0x47')]({'where':{'id':_0x37ddbb[_0x2617('0x40')]['id']}})[_0x2617('0x24')](handleEntityNotFound(_0x486adc,null))[_0x2617('0x24')](function(_0xbae46a){if(_0xbae46a){_0x1453e5=_0xbae46a;_0x2d4330['model']=_[_0x2617('0x41')](db[_0x2617('0x4e')][_0x2617('0x42')]);_0x2d4330[_0x2617('0x2e')]=_[_0x2617('0x41')](_0x37ddbb[_0x2617('0x2e')]);_0x2d4330[_0x2617('0x2f')]=_[_0x2617('0x30')](_0x2d4330['model'],_0x2d4330[_0x2617('0x2e')]);_0x4601de[_0x2617('0x31')]=_[_0x2617('0x30')](_0x2d4330[_0x2617('0x2d')],qs[_0x2617('0x32')](_0x37ddbb['query'][_0x2617('0x32')]));_0x4601de['attributes']=_0x4601de['attributes']['length']?_0x4601de['attributes']:_0x2d4330[_0x2617('0x2d')];_0x4601de[_0x2617('0x49')]=qs[_0x2617('0x35')](_0x37ddbb['query'][_0x2617('0x35')]);_0x4601de[_0x2617('0x36')]=qs[_0x2617('0x2f')](_[_0x2617('0x37')](_0x37ddbb[_0x2617('0x2e')],_0x2d4330[_0x2617('0x2f')]));if(_0x37ddbb[_0x2617('0x2e')][_0x2617('0x38')]){_0x4601de[_0x2617('0x36')]=_[_0x2617('0x39')](_0x4601de[_0x2617('0x36')],{'$or':_[_0x2617('0x29')](_0x4601de[_0x2617('0x31')],function(_0x2d8c39){var _0x5ebcc6={};_0x5ebcc6[_0x2d8c39]={'$like':'%'+_0x37ddbb[_0x2617('0x2e')]['filter']+'%'};return _0x5ebcc6;})});}_0x4601de=_[_0x2617('0x39')]({},_0x4601de,_0x37ddbb[_0x2617('0x3a')]);return _0x1453e5['getTags'](_0x4601de);}})['then'](function(_0x1eef84){if(_0x1eef84){_0x543c4f=_0x1eef84['length'];if(!_0x37ddbb[_0x2617('0x2e')][_0x2617('0x34')](_0x2617('0x4a'))){_0x4601de[_0x2617('0x1c')]=qs['limit'](_0x37ddbb['query']['limit']);_0x4601de[_0x2617('0x1a')]=qs[_0x2617('0x1a')](_0x37ddbb[_0x2617('0x2e')][_0x2617('0x1a')]);}return _0x1453e5[_0x2617('0x4d')](_0x4601de);}})[_0x2617('0x24')](function(_0x3726b3){if(_0x3726b3){return _0x3726b3?{'count':_0x543c4f,'rows':_0x3726b3}:null;}})['then'](respondWithResult(_0x486adc,null))[_0x2617('0x3e')](handleError(_0x486adc,null));};exports[_0x2617('0x4f')]=function(_0x2a8eb1,_0x470abc,_0x42febf){if(_0x2a8eb1[_0x2617('0x44')]['id']){delete _0x2a8eb1[_0x2617('0x44')]['id'];}return db[_0x2617('0x2a')][_0x2617('0x47')]({'where':{'id':_0x2a8eb1['params']['id']}})[_0x2617('0x24')](handleEntityNotFound(_0x470abc,null))[_0x2617('0x24')](function(_0x3fcbee){if(_0x3fcbee){return _0x3fcbee[_0x2617('0x4f')](_0x2a8eb1[_0x2617('0x44')]['ids']||[]);}return null;})[_0x2617('0x24')](respondWithResult(_0x470abc,null))[_0x2617('0x3e')](handleError(_0x470abc,null));}; \ No newline at end of file +var _0x6e88=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','FreshdeskConfiguration','rawAttributes','fieldName','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','options','body','find','getFields','FreshdeskField','pick','nolimit','findOne','getSubjects','getDescriptions','getTags','Tag','setTags','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','ejs','fs-extra','lodash','crypto','to-csv','querystring','papaparse'];(function(_0x414810,_0x5e924d){var _0x2d4df5=function(_0x390860){while(--_0x390860){_0x414810['push'](_0x414810['shift']());}};_0x2d4df5(++_0x5e924d);}(_0x6e88,0x195));var _0x86e8=function(_0x5cab48,_0x1d7919){_0x5cab48=_0x5cab48-0x0;var _0xf4c902=_0x6e88[_0x5cab48];return _0xf4c902;};'use strict';var emlformat=require(_0x86e8('0x0'));var rimraf=require(_0x86e8('0x1'));var zipdir=require(_0x86e8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x86e8('0x3'));var moment=require(_0x86e8('0x4'));var BPromise=require(_0x86e8('0x5'));var Mustache=require(_0x86e8('0x6'));var util=require(_0x86e8('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x86e8('0x8'));var fs=require('fs');var fs_extra=require(_0x86e8('0x9'));var _=require(_0x86e8('0xa'));var squel=require('squel');var crypto=require(_0x86e8('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x86e8('0xc'));var querystring=require(_0x86e8('0xd'));var Papa=require(_0x86e8('0xe'));var Redis=require(_0x86e8('0xf'));var authService=require(_0x86e8('0x10'));var qs=require(_0x86e8('0x11'));var as=require(_0x86e8('0x12'));var hardwareService=require(_0x86e8('0x13'));var logger=require(_0x86e8('0x14'))(_0x86e8('0x15'));var utils=require(_0x86e8('0x16'));var config=require(_0x86e8('0x17'));var licenseUtil=require(_0x86e8('0x18'));var db=require(_0x86e8('0x19'))['db'];function respondWithStatusCode(_0x3ad601,_0x3e33a4){_0x3e33a4=_0x3e33a4||0xcc;return function(_0x730d0a){if(_0x730d0a){return _0x3ad601['sendStatus'](_0x3e33a4);}return _0x3ad601[_0x86e8('0x1a')](_0x3e33a4)[_0x86e8('0x1b')]();};}function respondWithResult(_0x5ebc84,_0x3030d7){_0x3030d7=_0x3030d7||0xc8;return function(_0x23cd75){if(_0x23cd75){return _0x5ebc84['status'](_0x3030d7)[_0x86e8('0x1c')](_0x23cd75);}};}function respondWithFilteredResult(_0x4b964e,_0x31a707){return function(_0x12561b){if(_0x12561b){var _0x153994=typeof _0x31a707[_0x86e8('0x1d')]===_0x86e8('0x1e')&&typeof _0x31a707[_0x86e8('0x1f')]===_0x86e8('0x1e');var _0xb38135=_0x12561b[_0x86e8('0x20')];var _0x4c87e8=_0x153994?0x0:_0x31a707['offset'];var _0x5643c7=_0x153994?_0x12561b[_0x86e8('0x20')]:_0x31a707[_0x86e8('0x1d')]+_0x31a707[_0x86e8('0x1f')];var _0x1b007a;if(_0x5643c7>=_0xb38135){_0x5643c7=_0xb38135;_0x1b007a=0xc8;}else{_0x1b007a=0xce;}_0x4b964e[_0x86e8('0x1a')](_0x1b007a);return _0x4b964e[_0x86e8('0x21')]('Content-Range',_0x4c87e8+'-'+_0x5643c7+'/'+_0xb38135)[_0x86e8('0x1c')](_0x12561b);}return null;};}function patchUpdates(_0x5da74c){return function(_0x946eef){try{jsonpatch['apply'](_0x946eef,_0x5da74c,!![]);}catch(_0x2eb8a2){return BPromise[_0x86e8('0x22')](_0x2eb8a2);}return _0x946eef[_0x86e8('0x23')]();};}function saveUpdates(_0x20bf4b,_0x624768){return function(_0x18c83f){if(_0x18c83f){return _0x18c83f[_0x86e8('0x24')](_0x20bf4b)[_0x86e8('0x25')](function(_0x408900){return _0x408900;});}return null;};}function removeEntity(_0x5e05e8,_0x198980){return function(_0x3251f4){if(_0x3251f4){return _0x3251f4[_0x86e8('0x26')]()[_0x86e8('0x25')](function(){_0x5e05e8['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x25eaa1,_0x537478){return function(_0x5d0246){if(!_0x5d0246){_0x25eaa1[_0x86e8('0x27')](0x194);}return _0x5d0246;};}function handleError(_0x417fdc,_0x13a33d){_0x13a33d=_0x13a33d||0x1f4;return function(_0x3be392){logger[_0x86e8('0x28')](_0x3be392[_0x86e8('0x29')]);if(_0x3be392[_0x86e8('0x2a')]){delete _0x3be392[_0x86e8('0x2a')];}_0x417fdc[_0x86e8('0x1a')](_0x13a33d)[_0x86e8('0x2b')](_0x3be392);};}exports[_0x86e8('0x2c')]=function(_0x30d96a,_0x2f6dc6){var _0x2d5efa={},_0x598b24={},_0x356108={'count':0x0,'rows':[]};var _0x502824=_['map'](db[_0x86e8('0x2d')][_0x86e8('0x2e')],function(_0x5d62b9){return{'name':_0x5d62b9[_0x86e8('0x2f')],'type':_0x5d62b9['type']['key']};});_0x598b24[_0x86e8('0x30')]=_[_0x86e8('0x31')](_0x502824,_0x86e8('0x2a'));_0x598b24[_0x86e8('0x32')]=_[_0x86e8('0x33')](_0x30d96a[_0x86e8('0x32')]);_0x598b24[_0x86e8('0x34')]=_['intersection'](_0x598b24['model'],_0x598b24[_0x86e8('0x32')]);_0x2d5efa[_0x86e8('0x35')]=_[_0x86e8('0x36')](_0x598b24[_0x86e8('0x30')],qs[_0x86e8('0x37')](_0x30d96a[_0x86e8('0x32')][_0x86e8('0x37')]));_0x2d5efa[_0x86e8('0x35')]=_0x2d5efa[_0x86e8('0x35')][_0x86e8('0x38')]?_0x2d5efa[_0x86e8('0x35')]:_0x598b24['model'];if(!_0x30d96a[_0x86e8('0x32')][_0x86e8('0x39')]('nolimit')){_0x2d5efa[_0x86e8('0x1f')]=qs[_0x86e8('0x1f')](_0x30d96a[_0x86e8('0x32')]['limit']);_0x2d5efa[_0x86e8('0x1d')]=qs[_0x86e8('0x1d')](_0x30d96a[_0x86e8('0x32')][_0x86e8('0x1d')]);}_0x2d5efa[_0x86e8('0x3a')]=qs[_0x86e8('0x3b')](_0x30d96a[_0x86e8('0x32')][_0x86e8('0x3b')]);_0x2d5efa[_0x86e8('0x3c')]=qs[_0x86e8('0x34')](_['pick'](_0x30d96a[_0x86e8('0x32')],_0x598b24[_0x86e8('0x34')]),_0x502824);if(_0x30d96a[_0x86e8('0x32')][_0x86e8('0x3d')]){_0x2d5efa[_0x86e8('0x3c')]=_['merge'](_0x2d5efa[_0x86e8('0x3c')],{'$or':_['map'](_0x502824,function(_0x6a0504){if(_0x6a0504['type']!==_0x86e8('0x3e')){var _0x23faaa={};_0x23faaa[_0x6a0504['name']]={'$like':'%'+_0x30d96a[_0x86e8('0x32')][_0x86e8('0x3d')]+'%'};return _0x23faaa;}})});}_0x2d5efa=_[_0x86e8('0x3f')]({},_0x2d5efa,_0x30d96a['options']);var _0x382440={'where':_0x2d5efa[_0x86e8('0x3c')]};return db[_0x86e8('0x2d')]['count'](_0x382440)[_0x86e8('0x25')](function(_0x5ef40f){_0x356108[_0x86e8('0x20')]=_0x5ef40f;if(_0x30d96a[_0x86e8('0x32')][_0x86e8('0x40')]){_0x2d5efa[_0x86e8('0x41')]=[{'all':!![]}];}return db[_0x86e8('0x2d')][_0x86e8('0x42')](_0x2d5efa);})[_0x86e8('0x25')](function(_0x2a3614){_0x356108[_0x86e8('0x43')]=_0x2a3614;return _0x356108;})['then'](respondWithFilteredResult(_0x2f6dc6,_0x2d5efa))[_0x86e8('0x44')](handleError(_0x2f6dc6,null));};exports[_0x86e8('0x45')]=function(_0x56d227,_0x22a015){var _0x177eb5={'raw':![],'where':{'id':_0x56d227[_0x86e8('0x46')]['id']}},_0x36a964={};_0x36a964[_0x86e8('0x30')]=_[_0x86e8('0x33')](db[_0x86e8('0x2d')]['rawAttributes']);_0x36a964[_0x86e8('0x32')]=_[_0x86e8('0x33')](_0x56d227[_0x86e8('0x32')]);_0x36a964[_0x86e8('0x34')]=_[_0x86e8('0x36')](_0x36a964[_0x86e8('0x30')],_0x36a964['query']);_0x177eb5[_0x86e8('0x35')]=_[_0x86e8('0x36')](_0x36a964['model'],qs[_0x86e8('0x37')](_0x56d227['query']['fields']));_0x177eb5[_0x86e8('0x35')]=_0x177eb5['attributes'][_0x86e8('0x38')]?_0x177eb5['attributes']:_0x36a964[_0x86e8('0x30')];if(_0x56d227['query'][_0x86e8('0x40')]){_0x177eb5[_0x86e8('0x41')]=[{'all':!![]}];}_0x177eb5=_[_0x86e8('0x3f')]({},_0x177eb5,_0x56d227[_0x86e8('0x47')]);return db[_0x86e8('0x2d')]['find'](_0x177eb5)['then'](handleEntityNotFound(_0x22a015,null))[_0x86e8('0x25')](respondWithResult(_0x22a015,null))['catch'](handleError(_0x22a015,null));};exports['create']=function(_0x286490,_0xfc49c9){return db[_0x86e8('0x2d')]['create'](_0x286490[_0x86e8('0x48')],{})['then'](respondWithResult(_0xfc49c9,0xc9))['catch'](handleError(_0xfc49c9,null));};exports['update']=function(_0x9dcd6d,_0x23a3eb){if(_0x9dcd6d['body']['id']){delete _0x9dcd6d[_0x86e8('0x48')]['id'];}return db[_0x86e8('0x2d')][_0x86e8('0x49')]({'where':{'id':_0x9dcd6d[_0x86e8('0x46')]['id']}})[_0x86e8('0x25')](handleEntityNotFound(_0x23a3eb,null))[_0x86e8('0x25')](saveUpdates(_0x9dcd6d[_0x86e8('0x48')],null))[_0x86e8('0x25')](respondWithResult(_0x23a3eb,null))['catch'](handleError(_0x23a3eb,null));};exports['destroy']=function(_0x5c94c1,_0x594dc2){return db['FreshdeskConfiguration'][_0x86e8('0x49')]({'where':{'id':_0x5c94c1[_0x86e8('0x46')]['id']}})[_0x86e8('0x25')](handleEntityNotFound(_0x594dc2,null))[_0x86e8('0x25')](removeEntity(_0x594dc2,null))[_0x86e8('0x44')](handleError(_0x594dc2,null));};exports[_0x86e8('0x4a')]=function(_0x3a84fb,_0xbf3420,_0x3e0dd0){var _0x34f827={};var _0x30b15b={};var _0x2cd172;var _0x31e4e2;return db['FreshdeskConfiguration']['findOne']({'where':{'id':_0x3a84fb['params']['id']}})[_0x86e8('0x25')](handleEntityNotFound(_0xbf3420,null))[_0x86e8('0x25')](function(_0x42b051){if(_0x42b051){_0x2cd172=_0x42b051;_0x30b15b[_0x86e8('0x30')]=_['keys'](db[_0x86e8('0x4b')][_0x86e8('0x2e')]);_0x30b15b['query']=_[_0x86e8('0x33')](_0x3a84fb[_0x86e8('0x32')]);_0x30b15b[_0x86e8('0x34')]=_[_0x86e8('0x36')](_0x30b15b[_0x86e8('0x30')],_0x30b15b[_0x86e8('0x32')]);_0x34f827[_0x86e8('0x35')]=_['intersection'](_0x30b15b[_0x86e8('0x30')],qs[_0x86e8('0x37')](_0x3a84fb[_0x86e8('0x32')][_0x86e8('0x37')]));_0x34f827['attributes']=_0x34f827[_0x86e8('0x35')]['length']?_0x34f827[_0x86e8('0x35')]:_0x30b15b[_0x86e8('0x30')];_0x34f827[_0x86e8('0x3a')]=qs[_0x86e8('0x3b')](_0x3a84fb['query'][_0x86e8('0x3b')]);_0x34f827['where']=qs[_0x86e8('0x34')](_[_0x86e8('0x4c')](_0x3a84fb['query'],_0x30b15b[_0x86e8('0x34')]));if(_0x3a84fb['query'][_0x86e8('0x3d')]){_0x34f827[_0x86e8('0x3c')]=_[_0x86e8('0x3f')](_0x34f827[_0x86e8('0x3c')],{'$or':_[_0x86e8('0x31')](_0x34f827['attributes'],function(_0x478481){var _0x5ed6c4={};_0x5ed6c4[_0x478481]={'$like':'%'+_0x3a84fb[_0x86e8('0x32')][_0x86e8('0x3d')]+'%'};return _0x5ed6c4;})});}_0x34f827=_[_0x86e8('0x3f')]({},_0x34f827,_0x3a84fb[_0x86e8('0x47')]);return _0x2cd172[_0x86e8('0x4a')](_0x34f827);}})[_0x86e8('0x25')](function(_0x232260){if(_0x232260){_0x31e4e2=_0x232260[_0x86e8('0x38')];if(!_0x3a84fb[_0x86e8('0x32')][_0x86e8('0x39')](_0x86e8('0x4d'))){_0x34f827['limit']=qs[_0x86e8('0x1f')](_0x3a84fb['query'][_0x86e8('0x1f')]);_0x34f827[_0x86e8('0x1d')]=qs[_0x86e8('0x1d')](_0x3a84fb['query'][_0x86e8('0x1d')]);}return _0x2cd172[_0x86e8('0x4a')](_0x34f827);}})[_0x86e8('0x25')](function(_0x10409c){if(_0x10409c){return _0x10409c?{'count':_0x31e4e2,'rows':_0x10409c}:null;}})[_0x86e8('0x25')](respondWithResult(_0xbf3420,null))['catch'](handleError(_0xbf3420,null));};exports['getSubjects']=function(_0x81b56f,_0x590c89,_0xfb312d){var _0x5b8e1c={};var _0x2a5335={};var _0xb3b267;var _0x5288de;return db[_0x86e8('0x2d')][_0x86e8('0x4e')]({'where':{'id':_0x81b56f[_0x86e8('0x46')]['id']}})[_0x86e8('0x25')](handleEntityNotFound(_0x590c89,null))[_0x86e8('0x25')](function(_0x1e3fe3){if(_0x1e3fe3){_0xb3b267=_0x1e3fe3;_0x2a5335['model']=_['keys'](db[_0x86e8('0x4b')]['rawAttributes']);_0x2a5335[_0x86e8('0x32')]=_['keys'](_0x81b56f[_0x86e8('0x32')]);_0x2a5335[_0x86e8('0x34')]=_[_0x86e8('0x36')](_0x2a5335[_0x86e8('0x30')],_0x2a5335[_0x86e8('0x32')]);_0x5b8e1c['attributes']=_[_0x86e8('0x36')](_0x2a5335[_0x86e8('0x30')],qs[_0x86e8('0x37')](_0x81b56f[_0x86e8('0x32')][_0x86e8('0x37')]));_0x5b8e1c[_0x86e8('0x35')]=_0x5b8e1c[_0x86e8('0x35')][_0x86e8('0x38')]?_0x5b8e1c[_0x86e8('0x35')]:_0x2a5335['model'];_0x5b8e1c['order']=qs[_0x86e8('0x3b')](_0x81b56f[_0x86e8('0x32')][_0x86e8('0x3b')]);_0x5b8e1c[_0x86e8('0x3c')]=qs[_0x86e8('0x34')](_[_0x86e8('0x4c')](_0x81b56f[_0x86e8('0x32')],_0x2a5335[_0x86e8('0x34')]));if(_0x81b56f['query'][_0x86e8('0x3d')]){_0x5b8e1c[_0x86e8('0x3c')]=_[_0x86e8('0x3f')](_0x5b8e1c[_0x86e8('0x3c')],{'$or':_[_0x86e8('0x31')](_0x5b8e1c[_0x86e8('0x35')],function(_0x29e8b3){var _0xa56e7a={};_0xa56e7a[_0x29e8b3]={'$like':'%'+_0x81b56f['query']['filter']+'%'};return _0xa56e7a;})});}_0x5b8e1c=_[_0x86e8('0x3f')]({},_0x5b8e1c,_0x81b56f[_0x86e8('0x47')]);return _0xb3b267[_0x86e8('0x4f')](_0x5b8e1c);}})[_0x86e8('0x25')](function(_0x1b6455){if(_0x1b6455){_0x5288de=_0x1b6455[_0x86e8('0x38')];if(!_0x81b56f[_0x86e8('0x32')]['hasOwnProperty'](_0x86e8('0x4d'))){_0x5b8e1c[_0x86e8('0x1f')]=qs[_0x86e8('0x1f')](_0x81b56f[_0x86e8('0x32')][_0x86e8('0x1f')]);_0x5b8e1c[_0x86e8('0x1d')]=qs['offset'](_0x81b56f[_0x86e8('0x32')][_0x86e8('0x1d')]);}return _0xb3b267[_0x86e8('0x4f')](_0x5b8e1c);}})[_0x86e8('0x25')](function(_0x46bcbd){if(_0x46bcbd){return _0x46bcbd?{'count':_0x5288de,'rows':_0x46bcbd}:null;}})['then'](respondWithResult(_0x590c89,null))['catch'](handleError(_0x590c89,null));};exports['getDescriptions']=function(_0x554935,_0x106125,_0x3fe797){var _0x1261fb={};var _0x4279eb={};var _0x2e10ae;var _0x27e85c;return db[_0x86e8('0x2d')][_0x86e8('0x4e')]({'where':{'id':_0x554935['params']['id']}})[_0x86e8('0x25')](handleEntityNotFound(_0x106125,null))[_0x86e8('0x25')](function(_0xddb313){if(_0xddb313){_0x2e10ae=_0xddb313;_0x4279eb['model']=_['keys'](db[_0x86e8('0x4b')][_0x86e8('0x2e')]);_0x4279eb[_0x86e8('0x32')]=_['keys'](_0x554935['query']);_0x4279eb['filters']=_[_0x86e8('0x36')](_0x4279eb[_0x86e8('0x30')],_0x4279eb[_0x86e8('0x32')]);_0x1261fb[_0x86e8('0x35')]=_[_0x86e8('0x36')](_0x4279eb[_0x86e8('0x30')],qs[_0x86e8('0x37')](_0x554935[_0x86e8('0x32')][_0x86e8('0x37')]));_0x1261fb[_0x86e8('0x35')]=_0x1261fb['attributes'][_0x86e8('0x38')]?_0x1261fb[_0x86e8('0x35')]:_0x4279eb[_0x86e8('0x30')];_0x1261fb[_0x86e8('0x3a')]=qs['sort'](_0x554935[_0x86e8('0x32')][_0x86e8('0x3b')]);_0x1261fb[_0x86e8('0x3c')]=qs['filters'](_['pick'](_0x554935[_0x86e8('0x32')],_0x4279eb[_0x86e8('0x34')]));if(_0x554935[_0x86e8('0x32')][_0x86e8('0x3d')]){_0x1261fb[_0x86e8('0x3c')]=_[_0x86e8('0x3f')](_0x1261fb['where'],{'$or':_[_0x86e8('0x31')](_0x1261fb[_0x86e8('0x35')],function(_0x3c6add){var _0x3aa6a4={};_0x3aa6a4[_0x3c6add]={'$like':'%'+_0x554935[_0x86e8('0x32')][_0x86e8('0x3d')]+'%'};return _0x3aa6a4;})});}_0x1261fb=_[_0x86e8('0x3f')]({},_0x1261fb,_0x554935[_0x86e8('0x47')]);return _0x2e10ae[_0x86e8('0x50')](_0x1261fb);}})[_0x86e8('0x25')](function(_0x5a0ab2){if(_0x5a0ab2){_0x27e85c=_0x5a0ab2[_0x86e8('0x38')];if(!_0x554935[_0x86e8('0x32')][_0x86e8('0x39')](_0x86e8('0x4d'))){_0x1261fb['limit']=qs['limit'](_0x554935['query'][_0x86e8('0x1f')]);_0x1261fb['offset']=qs[_0x86e8('0x1d')](_0x554935[_0x86e8('0x32')]['offset']);}return _0x2e10ae[_0x86e8('0x50')](_0x1261fb);}})[_0x86e8('0x25')](function(_0xb4a85e){if(_0xb4a85e){return _0xb4a85e?{'count':_0x27e85c,'rows':_0xb4a85e}:null;}})[_0x86e8('0x25')](respondWithResult(_0x106125,null))[_0x86e8('0x44')](handleError(_0x106125,null));};exports[_0x86e8('0x51')]=function(_0x1ecf3d,_0x2624fa,_0x660bb1){var _0xe976d3={};var _0x4cbde6={};var _0xe6a05;var _0x1e5ce7;return db[_0x86e8('0x2d')]['findOne']({'where':{'id':_0x1ecf3d[_0x86e8('0x46')]['id']}})[_0x86e8('0x25')](handleEntityNotFound(_0x2624fa,null))[_0x86e8('0x25')](function(_0x1d96ff){if(_0x1d96ff){_0xe6a05=_0x1d96ff;_0x4cbde6['model']=_[_0x86e8('0x33')](db[_0x86e8('0x52')]['rawAttributes']);_0x4cbde6['query']=_[_0x86e8('0x33')](_0x1ecf3d[_0x86e8('0x32')]);_0x4cbde6[_0x86e8('0x34')]=_[_0x86e8('0x36')](_0x4cbde6[_0x86e8('0x30')],_0x4cbde6[_0x86e8('0x32')]);_0xe976d3[_0x86e8('0x35')]=_[_0x86e8('0x36')](_0x4cbde6[_0x86e8('0x30')],qs[_0x86e8('0x37')](_0x1ecf3d[_0x86e8('0x32')][_0x86e8('0x37')]));_0xe976d3[_0x86e8('0x35')]=_0xe976d3[_0x86e8('0x35')]['length']?_0xe976d3['attributes']:_0x4cbde6[_0x86e8('0x30')];_0xe976d3[_0x86e8('0x3a')]=qs[_0x86e8('0x3b')](_0x1ecf3d['query'][_0x86e8('0x3b')]);_0xe976d3[_0x86e8('0x3c')]=qs[_0x86e8('0x34')](_['pick'](_0x1ecf3d['query'],_0x4cbde6[_0x86e8('0x34')]));if(_0x1ecf3d[_0x86e8('0x32')][_0x86e8('0x3d')]){_0xe976d3[_0x86e8('0x3c')]=_['merge'](_0xe976d3[_0x86e8('0x3c')],{'$or':_['map'](_0xe976d3[_0x86e8('0x35')],function(_0x141968){var _0x15bf49={};_0x15bf49[_0x141968]={'$like':'%'+_0x1ecf3d[_0x86e8('0x32')][_0x86e8('0x3d')]+'%'};return _0x15bf49;})});}_0xe976d3=_[_0x86e8('0x3f')]({},_0xe976d3,_0x1ecf3d['options']);return _0xe6a05[_0x86e8('0x51')](_0xe976d3);}})['then'](function(_0xcfc91e){if(_0xcfc91e){_0x1e5ce7=_0xcfc91e[_0x86e8('0x38')];if(!_0x1ecf3d[_0x86e8('0x32')]['hasOwnProperty'](_0x86e8('0x4d'))){_0xe976d3['limit']=qs['limit'](_0x1ecf3d[_0x86e8('0x32')][_0x86e8('0x1f')]);_0xe976d3[_0x86e8('0x1d')]=qs[_0x86e8('0x1d')](_0x1ecf3d[_0x86e8('0x32')][_0x86e8('0x1d')]);}return _0xe6a05[_0x86e8('0x51')](_0xe976d3);}})[_0x86e8('0x25')](function(_0x142330){if(_0x142330){return _0x142330?{'count':_0x1e5ce7,'rows':_0x142330}:null;}})[_0x86e8('0x25')](respondWithResult(_0x2624fa,null))[_0x86e8('0x44')](handleError(_0x2624fa,null));};exports[_0x86e8('0x53')]=function(_0x1cb89d,_0x3fcad6,_0x341722){if(_0x1cb89d['body']['id']){delete _0x1cb89d['body']['id'];}return db[_0x86e8('0x2d')][_0x86e8('0x4e')]({'where':{'id':_0x1cb89d[_0x86e8('0x46')]['id']}})[_0x86e8('0x25')](handleEntityNotFound(_0x3fcad6,null))['then'](function(_0x11359e){if(_0x11359e){return _0x11359e['setTags'](_0x1cb89d[_0x86e8('0x48')]['ids']||[]);}return null;})[_0x86e8('0x25')](respondWithResult(_0x3fcad6,null))['catch'](handleError(_0x3fcad6,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index c3851f1..8f77141 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 _0xa1b3=['bluebird','request-promise','path','../../config/environment','./intFreshdeskConfiguration.attributes','FreshdeskConfiguration','int_freshdesk_configurations','lodash','util','api','moment'];(function(_0xf1943a,_0x20fa2c){var _0x4737a6=function(_0x402167){while(--_0x402167){_0xf1943a['push'](_0xf1943a['shift']());}};_0x4737a6(++_0x20fa2c);}(_0xa1b3,0x1d5));var _0x3a1b=function(_0x34ef3e,_0x59a08c){_0x34ef3e=_0x34ef3e-0x0;var _0x4f317b=_0xa1b3[_0x34ef3e];return _0x4f317b;};'use strict';var _=require(_0x3a1b('0x0'));var util=require(_0x3a1b('0x1'));var logger=require('../../config/logger')(_0x3a1b('0x2'));var moment=require(_0x3a1b('0x3'));var BPromise=require(_0x3a1b('0x4'));var rp=require(_0x3a1b('0x5'));var fs=require('fs');var path=require(_0x3a1b('0x6'));var rimraf=require('rimraf');var config=require(_0x3a1b('0x7'));var attributes=require(_0x3a1b('0x8'));module['exports']=function(_0x32ecb7,_0x5089e0){return _0x32ecb7['define'](_0x3a1b('0x9'),attributes,{'tableName':_0x3a1b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1ff1=['./intFreshdeskConfiguration.attributes','define','FreshdeskConfiguration','int_freshdesk_configurations','lodash','util','bluebird','request-promise','path'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0x1ff1,0xaf));var _0x11ff=function(_0x4f6547,_0x12599b){_0x4f6547=_0x4f6547-0x0;var _0x398dac=_0x1ff1[_0x4f6547];return _0x398dac;};'use strict';var _=require(_0x11ff('0x0'));var util=require(_0x11ff('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x11ff('0x2'));var rp=require(_0x11ff('0x3'));var fs=require('fs');var path=require(_0x11ff('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x11ff('0x5'));module['exports']=function(_0x285c3a,_0x297c47){return _0x285c3a[_0x11ff('0x6')](_0x11ff('0x7'),attributes,{'tableName':_0x11ff('0x8'),'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 529cf03..98fb27d 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 _0x6474=['jayson/promise','client','http','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x22ee53,_0x551665){var _0x2aae96=function(_0x40f34b){while(--_0x40f34b){_0x22ee53['push'](_0x22ee53['shift']());}};_0x2aae96(++_0x551665);}(_0x6474,0x117));var _0x4647=function(_0x148adc,_0x1eab80){_0x148adc=_0x148adc-0x0;var _0x181465=_0x6474[_0x148adc];return _0x181465;};'use strict';var _=require('lodash');var util=require(_0x4647('0x0'));var moment=require(_0x4647('0x1'));var BPromise=require(_0x4647('0x2'));var rs=require(_0x4647('0x3'));var fs=require('fs');var Redis=require(_0x4647('0x4'));var db=require(_0x4647('0x5'))['db'];var utils=require(_0x4647('0x6'));var logger=require(_0x4647('0x7'))('rpc');var config=require(_0x4647('0x8'));var jayson=require(_0x4647('0x9'));var client=jayson[_0x4647('0xa')][_0x4647('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x140d86,_0x4cac77,_0x41f261){return new BPromise(function(_0x2a087a,_0x1d66c7){return client[_0x4647('0xc')](_0x140d86,_0x41f261)[_0x4647('0xd')](function(_0x41eed3){logger[_0x4647('0xe')](_0x4647('0xf'),_0x4cac77,_0x4647('0x10'));logger['debug'](_0x4647('0x11'),_0x4cac77,_0x4647('0x10'),JSON[_0x4647('0x12')](_0x41eed3));if(_0x41eed3['error']){if(_0x41eed3[_0x4647('0x13')][_0x4647('0x14')]===0x1f4){logger[_0x4647('0x13')](_0x4647('0xf'),_0x4cac77,_0x41eed3[_0x4647('0x13')][_0x4647('0x15')]);return _0x1d66c7(_0x41eed3[_0x4647('0x13')][_0x4647('0x15')]);}logger['error'](_0x4647('0xf'),_0x4cac77,_0x41eed3[_0x4647('0x13')][_0x4647('0x15')]);return _0x2a087a(_0x41eed3[_0x4647('0x13')][_0x4647('0x15')]);}else{logger[_0x4647('0xe')](_0x4647('0xf'),_0x4cac77,'request\x20sent');_0x2a087a(_0x41eed3[_0x4647('0x16')][_0x4647('0x15')]);}})[_0x4647('0x17')](function(_0x25d02d){logger[_0x4647('0x13')](_0x4647('0xf'),_0x4cac77,_0x25d02d);_0x1d66c7(_0x25d02d);});});} \ No newline at end of file +var _0xa9f1=['stringify','code','error','message','result','catch','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x40911a,_0x55ec99){var _0x27e8e3=function(_0x2ba910){while(--_0x2ba910){_0x40911a['push'](_0x40911a['shift']());}};_0x27e8e3(++_0x55ec99);}(_0xa9f1,0x182));var _0x1a9f=function(_0x3dc5a2,_0x56ed72){_0x3dc5a2=_0x3dc5a2-0x0;var _0x5999ea=_0xa9f1[_0x3dc5a2];return _0x5999ea;};'use strict';var _=require('lodash');var util=require(_0x1a9f('0x0'));var moment=require('moment');var BPromise=require(_0x1a9f('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1a9f('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x1a9f('0x3'));var logger=require(_0x1a9f('0x4'))(_0x1a9f('0x5'));var config=require('../../config/environment');var jayson=require(_0x1a9f('0x6'));var client=jayson['client'][_0x1a9f('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x152a27,_0x505cdd,_0x10d505){return new BPromise(function(_0xa2ca6c,_0x3b8aab){return client[_0x1a9f('0x8')](_0x152a27,_0x10d505)[_0x1a9f('0x9')](function(_0x5e1f63){logger[_0x1a9f('0xa')](_0x1a9f('0xb'),_0x505cdd,_0x1a9f('0xc'));logger[_0x1a9f('0xd')]('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x505cdd,'request\x20sent',JSON[_0x1a9f('0xe')](_0x5e1f63));if(_0x5e1f63['error']){if(_0x5e1f63['error'][_0x1a9f('0xf')]===0x1f4){logger['error'](_0x1a9f('0xb'),_0x505cdd,_0x5e1f63[_0x1a9f('0x10')][_0x1a9f('0x11')]);return _0x3b8aab(_0x5e1f63[_0x1a9f('0x10')][_0x1a9f('0x11')]);}logger[_0x1a9f('0x10')](_0x1a9f('0xb'),_0x505cdd,_0x5e1f63[_0x1a9f('0x10')]['message']);return _0xa2ca6c(_0x5e1f63['error']['message']);}else{logger['info']('FreshdeskConfiguration,\x20%s,\x20%s',_0x505cdd,_0x1a9f('0xc'));_0xa2ca6c(_0x5e1f63[_0x1a9f('0x12')][_0x1a9f('0x11')]);}})[_0x1a9f('0x13')](function(_0x9d8aed){logger[_0x1a9f('0x10')](_0x1a9f('0xb'),_0x505cdd,_0x9d8aed);_0x3b8aab(_0x9d8aed);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index b5a65e3..e99e03d 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 _0x428c=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','post','create','put','delete','destroy','exports'];(function(_0x4d5f8f,_0x273e1e){var _0x55baed=function(_0x36e4a4){while(--_0x36e4a4){_0x4d5f8f['push'](_0x4d5f8f['shift']());}};_0x55baed(++_0x273e1e);}(_0x428c,0x85));var _0xc428=function(_0x10abd7,_0xd3ab42){_0x10abd7=_0x10abd7-0x0;var _0x8e91ed=_0x428c[_0x10abd7];return _0x8e91ed;};'use strict';var multer=require(_0xc428('0x0'));var util=require(_0xc428('0x1'));var path=require(_0xc428('0x2'));var timeout=require(_0xc428('0x3'));var express=require(_0xc428('0x4'));var router=express[_0xc428('0x5')]();var fs_extra=require(_0xc428('0x6'));var auth=require(_0xc428('0x7'));var interaction=require(_0xc428('0x8'));var config=require(_0xc428('0x9'));var controller=require('./intFreshdeskField.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xc428('0xa')](_0xc428('0xb'),auth[_0xc428('0xc')](),controller['show']);router[_0xc428('0xd')]('/',auth[_0xc428('0xc')](),controller[_0xc428('0xe')]);router[_0xc428('0xf')]('/:id',auth[_0xc428('0xc')](),controller['update']);router[_0xc428('0x10')](_0xc428('0xb'),auth[_0xc428('0xc')](),controller[_0xc428('0x11')]);module[_0xc428('0x12')]=router; \ No newline at end of file +var _0x4d47=['destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','index','put','delete'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0x4d47,0x101));var _0x74d4=function(_0x3fd60c,_0x23fb55){_0x3fd60c=_0x3fd60c-0x0;var _0x33d2ff=_0x4d47[_0x3fd60c];return _0x33d2ff;};'use strict';var multer=require(_0x74d4('0x0'));var util=require(_0x74d4('0x1'));var path=require(_0x74d4('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x74d4('0x3')]();var fs_extra=require(_0x74d4('0x4'));var auth=require(_0x74d4('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x74d4('0x6'));var controller=require(_0x74d4('0x7'));router[_0x74d4('0x8')]('/',auth[_0x74d4('0x9')](),controller[_0x74d4('0xa')]);router[_0x74d4('0x8')]('/:id',auth[_0x74d4('0x9')](),controller['show']);router['post']('/',auth[_0x74d4('0x9')](),controller['create']);router[_0x74d4('0xb')]('/:id',auth[_0x74d4('0x9')](),controller['update']);router[_0x74d4('0xc')]('/:id',auth[_0x74d4('0x9')](),controller[_0x74d4('0xd')]);module[_0x74d4('0xe')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index 0f09046..011a975 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 _0x5510=['sequelize','ENUM','string','variable','customVariable','keyValue','STRING'];(function(_0xd816e2,_0x5edac2){var _0x1f5924=function(_0x1bcbf0){while(--_0x1bcbf0){_0xd816e2['push'](_0xd816e2['shift']());}};_0x1f5924(++_0x5edac2);}(_0x5510,0x13b));var _0x0551=function(_0x2a4da6,_0x5e7f66){_0x2a4da6=_0x2a4da6-0x0;var _0x21f384=_0x5510[_0x2a4da6];return _0x21f384;};'use strict';var Sequelize=require(_0x0551('0x0'));module['exports']={'type':{'type':Sequelize[_0x0551('0x1')](_0x0551('0x2'),_0x0551('0x3'),_0x0551('0x4'),_0x0551('0x5'),'picklist'),'defaultValue':_0x0551('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x0551('0x6')]},'keyType':{'type':Sequelize[_0x0551('0x1')](_0x0551('0x2'),_0x0551('0x3'),_0x0551('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x0551('0x6')]},'nameField':{'type':Sequelize[_0x0551('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x0551('0x6')]}}; \ No newline at end of file +var _0x0335=['customVariable','BOOLEAN','exports','ENUM','variable','keyValue','string','STRING'];(function(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0x0335,0x6a));var _0x5033=function(_0x21d9b3,_0x4d20d4){_0x21d9b3=_0x21d9b3-0x0;var _0x5b89ce=_0x0335[_0x21d9b3];return _0x5b89ce;};'use strict';var Sequelize=require('sequelize');module[_0x5033('0x0')]={'type':{'type':Sequelize[_0x5033('0x1')]('string',_0x5033('0x2'),'customVariable',_0x5033('0x3'),'picklist'),'defaultValue':_0x5033('0x4')},'content':{'type':Sequelize[_0x5033('0x5')]},'key':{'type':Sequelize[_0x5033('0x5')]},'keyType':{'type':Sequelize[_0x5033('0x1')](_0x5033('0x4'),_0x5033('0x2'),_0x5033('0x6'))},'keyContent':{'type':Sequelize[_0x5033('0x5')]},'idField':{'type':Sequelize[_0x5033('0x5')]},'nameField':{'type':Sequelize[_0x5033('0x5')]},'customField':{'type':Sequelize[_0x5033('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x5033('0x5')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index f3ad8e2..c8a30d7 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 _0xc3fe=['destroy','end','name','status','send','index','map','FreshdeskField','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','include','rows','catch','show','params','rawAttributes','body','find','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','fs-extra','lodash','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','undefined','limit','offset','count','set','Content-Range','json','apply','reject','save','update','then'];(function(_0x490b05,_0x7f0934){var _0x37ad3c=function(_0x4260d0){while(--_0x4260d0){_0x490b05['push'](_0x490b05['shift']());}};_0x37ad3c(++_0x7f0934);}(_0xc3fe,0xff));var _0xec3f=function(_0x1455a7,_0x2eb7a4){_0x1455a7=_0x1455a7-0x0;var _0x9327e4=_0xc3fe[_0x1455a7];return _0x9327e4;};'use strict';var emlformat=require(_0xec3f('0x0'));var rimraf=require(_0xec3f('0x1'));var zipdir=require(_0xec3f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xec3f('0x3'));var moment=require(_0xec3f('0x4'));var BPromise=require(_0xec3f('0x5'));var Mustache=require('mustache');var util=require(_0xec3f('0x6'));var path=require(_0xec3f('0x7'));var sox=require(_0xec3f('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xec3f('0x9'));var _=require(_0xec3f('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xec3f('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xec3f('0xc'));var querystring=require(_0xec3f('0xd'));var Papa=require(_0xec3f('0xe'));var Redis=require(_0xec3f('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xec3f('0x10'));var as=require(_0xec3f('0x11'));var hardwareService=require(_0xec3f('0x12'));var logger=require(_0xec3f('0x13'))(_0xec3f('0x14'));var utils=require(_0xec3f('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xec3f('0x16'));var db=require(_0xec3f('0x17'))['db'];function respondWithStatusCode(_0x367c5e,_0x57891d){_0x57891d=_0x57891d||0xcc;return function(_0x5367df){if(_0x5367df){return _0x367c5e[_0xec3f('0x18')](_0x57891d);}return _0x367c5e['status'](_0x57891d)['end']();};}function respondWithResult(_0x209ffa,_0x4318bd){_0x4318bd=_0x4318bd||0xc8;return function(_0x113d16){if(_0x113d16){return _0x209ffa['status'](_0x4318bd)['json'](_0x113d16);}};}function respondWithFilteredResult(_0x5509ec,_0x5ad65a){return function(_0x37d688){if(_0x37d688){var _0x10ff81=typeof _0x5ad65a['offset']===_0xec3f('0x19')&&typeof _0x5ad65a[_0xec3f('0x1a')]===_0xec3f('0x19');var _0x3b7393=_0x37d688['count'];var _0x7805c=_0x10ff81?0x0:_0x5ad65a[_0xec3f('0x1b')];var _0x2d338=_0x10ff81?_0x37d688[_0xec3f('0x1c')]:_0x5ad65a[_0xec3f('0x1b')]+_0x5ad65a['limit'];var _0x2f8bc8;if(_0x2d338>=_0x3b7393){_0x2d338=_0x3b7393;_0x2f8bc8=0xc8;}else{_0x2f8bc8=0xce;}_0x5509ec['status'](_0x2f8bc8);return _0x5509ec[_0xec3f('0x1d')](_0xec3f('0x1e'),_0x7805c+'-'+_0x2d338+'/'+_0x3b7393)[_0xec3f('0x1f')](_0x37d688);}return null;};}function patchUpdates(_0x47b6f9){return function(_0x526ff){try{jsonpatch[_0xec3f('0x20')](_0x526ff,_0x47b6f9,!![]);}catch(_0x4fdfc3){return BPromise[_0xec3f('0x21')](_0x4fdfc3);}return _0x526ff[_0xec3f('0x22')]();};}function saveUpdates(_0x1f173f,_0x395b9a){return function(_0x4d9598){if(_0x4d9598){return _0x4d9598[_0xec3f('0x23')](_0x1f173f)[_0xec3f('0x24')](function(_0x2f45bb){return _0x2f45bb;});}return null;};}function removeEntity(_0x4e4770,_0xfc9c0d){return function(_0x4b5932){if(_0x4b5932){return _0x4b5932[_0xec3f('0x25')]()['then'](function(){_0x4e4770['status'](0xcc)[_0xec3f('0x26')]();});}};}function handleEntityNotFound(_0x482bf2,_0x217b7d){return function(_0xa12054){if(!_0xa12054){_0x482bf2[_0xec3f('0x18')](0x194);}return _0xa12054;};}function handleError(_0x4df17b,_0x296fc3){_0x296fc3=_0x296fc3||0x1f4;return function(_0x1da532){logger['error'](_0x1da532['stack']);if(_0x1da532[_0xec3f('0x27')]){delete _0x1da532['name'];}_0x4df17b[_0xec3f('0x28')](_0x296fc3)[_0xec3f('0x29')](_0x1da532);};}exports[_0xec3f('0x2a')]=function(_0x2eac8d,_0x4614c9){var _0x19473c={},_0x2f2d15={},_0x237134={'count':0x0,'rows':[]};var _0x56217e=_[_0xec3f('0x2b')](db[_0xec3f('0x2c')]['rawAttributes'],function(_0x91c11a){return{'name':_0x91c11a[_0xec3f('0x2d')],'type':_0x91c11a[_0xec3f('0x2e')][_0xec3f('0x2f')]};});_0x2f2d15[_0xec3f('0x30')]=_[_0xec3f('0x2b')](_0x56217e,_0xec3f('0x27'));_0x2f2d15[_0xec3f('0x31')]=_[_0xec3f('0x32')](_0x2eac8d[_0xec3f('0x31')]);_0x2f2d15[_0xec3f('0x33')]=_[_0xec3f('0x34')](_0x2f2d15[_0xec3f('0x30')],_0x2f2d15[_0xec3f('0x31')]);_0x19473c[_0xec3f('0x35')]=_['intersection'](_0x2f2d15[_0xec3f('0x30')],qs[_0xec3f('0x36')](_0x2eac8d[_0xec3f('0x31')][_0xec3f('0x36')]));_0x19473c[_0xec3f('0x35')]=_0x19473c['attributes'][_0xec3f('0x37')]?_0x19473c[_0xec3f('0x35')]:_0x2f2d15[_0xec3f('0x30')];if(!_0x2eac8d['query']['hasOwnProperty'](_0xec3f('0x38'))){_0x19473c['limit']=qs[_0xec3f('0x1a')](_0x2eac8d['query'][_0xec3f('0x1a')]);_0x19473c['offset']=qs['offset'](_0x2eac8d[_0xec3f('0x31')][_0xec3f('0x1b')]);}_0x19473c[_0xec3f('0x39')]=qs[_0xec3f('0x3a')](_0x2eac8d[_0xec3f('0x31')][_0xec3f('0x3a')]);_0x19473c['where']=qs['filters'](_[_0xec3f('0x3b')](_0x2eac8d[_0xec3f('0x31')],_0x2f2d15[_0xec3f('0x33')]),_0x56217e);if(_0x2eac8d[_0xec3f('0x31')][_0xec3f('0x3c')]){_0x19473c[_0xec3f('0x3d')]=_[_0xec3f('0x3e')](_0x19473c['where'],{'$or':_[_0xec3f('0x2b')](_0x56217e,function(_0x5aadc3){if(_0x5aadc3[_0xec3f('0x2e')]!==_0xec3f('0x3f')){var _0x2c8f59={};_0x2c8f59[_0x5aadc3[_0xec3f('0x27')]]={'$like':'%'+_0x2eac8d[_0xec3f('0x31')][_0xec3f('0x3c')]+'%'};return _0x2c8f59;}})});}_0x19473c=_[_0xec3f('0x3e')]({},_0x19473c,_0x2eac8d[_0xec3f('0x40')]);var _0x35b902={'where':_0x19473c[_0xec3f('0x3d')]};return db[_0xec3f('0x2c')][_0xec3f('0x1c')](_0x35b902)[_0xec3f('0x24')](function(_0x482219){_0x237134[_0xec3f('0x1c')]=_0x482219;if(_0x2eac8d[_0xec3f('0x31')]['includeAll']){_0x19473c[_0xec3f('0x41')]=[{'all':!![]}];}return db[_0xec3f('0x2c')]['findAll'](_0x19473c);})[_0xec3f('0x24')](function(_0xae1b8a){_0x237134[_0xec3f('0x42')]=_0xae1b8a;return _0x237134;})[_0xec3f('0x24')](respondWithFilteredResult(_0x4614c9,_0x19473c))[_0xec3f('0x43')](handleError(_0x4614c9,null));};exports[_0xec3f('0x44')]=function(_0x5e434d,_0x142d85){var _0x386e96={'raw':!![],'where':{'id':_0x5e434d[_0xec3f('0x45')]['id']}},_0x1c6494={};_0x1c6494[_0xec3f('0x30')]=_[_0xec3f('0x32')](db[_0xec3f('0x2c')][_0xec3f('0x46')]);_0x1c6494[_0xec3f('0x31')]=_['keys'](_0x5e434d[_0xec3f('0x31')]);_0x1c6494['filters']=_[_0xec3f('0x34')](_0x1c6494[_0xec3f('0x30')],_0x1c6494[_0xec3f('0x31')]);_0x386e96[_0xec3f('0x35')]=_[_0xec3f('0x34')](_0x1c6494[_0xec3f('0x30')],qs[_0xec3f('0x36')](_0x5e434d[_0xec3f('0x31')][_0xec3f('0x36')]));_0x386e96[_0xec3f('0x35')]=_0x386e96[_0xec3f('0x35')][_0xec3f('0x37')]?_0x386e96['attributes']:_0x1c6494[_0xec3f('0x30')];if(_0x5e434d[_0xec3f('0x31')]['includeAll']){_0x386e96[_0xec3f('0x41')]=[{'all':!![]}];}_0x386e96=_[_0xec3f('0x3e')]({},_0x386e96,_0x5e434d[_0xec3f('0x40')]);return db[_0xec3f('0x2c')]['find'](_0x386e96)['then'](handleEntityNotFound(_0x142d85,null))[_0xec3f('0x24')](respondWithResult(_0x142d85,null))[_0xec3f('0x43')](handleError(_0x142d85,null));};exports['create']=function(_0x2a9fc8,_0x28acd1){return db[_0xec3f('0x2c')]['create'](_0x2a9fc8[_0xec3f('0x47')],{})['then'](respondWithResult(_0x28acd1,0xc9))['catch'](handleError(_0x28acd1,null));};exports['update']=function(_0x97c57d,_0x1b7cf6){if(_0x97c57d[_0xec3f('0x47')]['id']){delete _0x97c57d[_0xec3f('0x47')]['id'];}return db['FreshdeskField'][_0xec3f('0x48')]({'where':{'id':_0x97c57d['params']['id']}})[_0xec3f('0x24')](handleEntityNotFound(_0x1b7cf6,null))[_0xec3f('0x24')](saveUpdates(_0x97c57d[_0xec3f('0x47')],null))[_0xec3f('0x24')](respondWithResult(_0x1b7cf6,null))[_0xec3f('0x43')](handleError(_0x1b7cf6,null));};exports[_0xec3f('0x25')]=function(_0x515bf2,_0x2ab636){return db['FreshdeskField'][_0xec3f('0x48')]({'where':{'id':_0x515bf2['params']['id']}})[_0xec3f('0x24')](handleEntityNotFound(_0x2ab636,null))['then'](removeEntity(_0x2ab636,null))[_0xec3f('0x43')](handleError(_0x2ab636,null));}; \ No newline at end of file +var _0x3e5c=['options','catch','body','find','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','order','sort','where','pick','map','VIRTUAL','filter','FreshdeskField','includeAll','findAll','rows','params','include','merge'];(function(_0x1f4d60,_0x20aa3c){var _0x3ace4a=function(_0xc92e10){while(--_0xc92e10){_0x1f4d60['push'](_0x1f4d60['shift']());}};_0x3ace4a(++_0x20aa3c);}(_0x3e5c,0x9a));var _0xc3e5=function(_0x5c559c,_0x12116c){_0x5c559c=_0x5c559c-0x0;var _0x5ecdb2=_0x3e5c[_0x5c559c];return _0x5ecdb2;};'use strict';var emlformat=require(_0xc3e5('0x0'));var rimraf=require(_0xc3e5('0x1'));var zipdir=require(_0xc3e5('0x2'));var jsonpatch=require(_0xc3e5('0x3'));var rp=require('request-promise');var moment=require(_0xc3e5('0x4'));var BPromise=require(_0xc3e5('0x5'));var Mustache=require(_0xc3e5('0x6'));var util=require(_0xc3e5('0x7'));var path=require(_0xc3e5('0x8'));var sox=require(_0xc3e5('0x9'));var csv=require('to-csv');var ejs=require(_0xc3e5('0xa'));var fs=require('fs');var fs_extra=require(_0xc3e5('0xb'));var _=require(_0xc3e5('0xc'));var squel=require(_0xc3e5('0xd'));var crypto=require(_0xc3e5('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc3e5('0xf'));var toCsv=require(_0xc3e5('0x10'));var querystring=require(_0xc3e5('0x11'));var Papa=require(_0xc3e5('0x12'));var Redis=require(_0xc3e5('0x13'));var authService=require(_0xc3e5('0x14'));var qs=require(_0xc3e5('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc3e5('0x16'));var logger=require(_0xc3e5('0x17'))(_0xc3e5('0x18'));var utils=require(_0xc3e5('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xc3e5('0x1a'));var db=require(_0xc3e5('0x1b'))['db'];function respondWithStatusCode(_0x36193e,_0x3f0395){_0x3f0395=_0x3f0395||0xcc;return function(_0x3b7441){if(_0x3b7441){return _0x36193e[_0xc3e5('0x1c')](_0x3f0395);}return _0x36193e['status'](_0x3f0395)['end']();};}function respondWithResult(_0x52cca7,_0x27c226){_0x27c226=_0x27c226||0xc8;return function(_0x5a52f1){if(_0x5a52f1){return _0x52cca7[_0xc3e5('0x1d')](_0x27c226)[_0xc3e5('0x1e')](_0x5a52f1);}};}function respondWithFilteredResult(_0x4d1ad9,_0x353dc0){return function(_0x3e3eaa){if(_0x3e3eaa){var _0x2cc476=typeof _0x353dc0[_0xc3e5('0x1f')]===_0xc3e5('0x20')&&typeof _0x353dc0['limit']===_0xc3e5('0x20');var _0x277063=_0x3e3eaa[_0xc3e5('0x21')];var _0xa33d84=_0x2cc476?0x0:_0x353dc0[_0xc3e5('0x1f')];var _0x1e1eea=_0x2cc476?_0x3e3eaa['count']:_0x353dc0[_0xc3e5('0x1f')]+_0x353dc0[_0xc3e5('0x22')];var _0x4a1d86;if(_0x1e1eea>=_0x277063){_0x1e1eea=_0x277063;_0x4a1d86=0xc8;}else{_0x4a1d86=0xce;}_0x4d1ad9[_0xc3e5('0x1d')](_0x4a1d86);return _0x4d1ad9['set'](_0xc3e5('0x23'),_0xa33d84+'-'+_0x1e1eea+'/'+_0x277063)[_0xc3e5('0x1e')](_0x3e3eaa);}return null;};}function patchUpdates(_0x2d551b){return function(_0xebf6dc){try{jsonpatch[_0xc3e5('0x24')](_0xebf6dc,_0x2d551b,!![]);}catch(_0x4a7806){return BPromise[_0xc3e5('0x25')](_0x4a7806);}return _0xebf6dc[_0xc3e5('0x26')]();};}function saveUpdates(_0x2d8c6f,_0x3eb513){return function(_0x414ba9){if(_0x414ba9){return _0x414ba9[_0xc3e5('0x27')](_0x2d8c6f)[_0xc3e5('0x28')](function(_0x47f344){return _0x47f344;});}return null;};}function removeEntity(_0x3a2800,_0x430cb4){return function(_0x43d01e){if(_0x43d01e){return _0x43d01e[_0xc3e5('0x29')]()[_0xc3e5('0x28')](function(){_0x3a2800[_0xc3e5('0x1d')](0xcc)[_0xc3e5('0x2a')]();});}};}function handleEntityNotFound(_0x45556e,_0x564748){return function(_0x25d3a3){if(!_0x25d3a3){_0x45556e['sendStatus'](0x194);}return _0x25d3a3;};}function handleError(_0x4c0cf4,_0x8815af){_0x8815af=_0x8815af||0x1f4;return function(_0x12ad6e){logger[_0xc3e5('0x2b')](_0x12ad6e['stack']);if(_0x12ad6e[_0xc3e5('0x2c')]){delete _0x12ad6e[_0xc3e5('0x2c')];}_0x4c0cf4[_0xc3e5('0x1d')](_0x8815af)[_0xc3e5('0x2d')](_0x12ad6e);};}exports['index']=function(_0xa6766d,_0x497ecf){var _0x45ca6d={},_0xc0e6e7={},_0xc58f2b={'count':0x0,'rows':[]};var _0x5a2d41=_['map'](db['FreshdeskField'][_0xc3e5('0x2e')],function(_0x45cd9c){return{'name':_0x45cd9c[_0xc3e5('0x2f')],'type':_0x45cd9c[_0xc3e5('0x30')][_0xc3e5('0x31')]};});_0xc0e6e7[_0xc3e5('0x32')]=_['map'](_0x5a2d41,_0xc3e5('0x2c'));_0xc0e6e7[_0xc3e5('0x33')]=_[_0xc3e5('0x34')](_0xa6766d[_0xc3e5('0x33')]);_0xc0e6e7[_0xc3e5('0x35')]=_[_0xc3e5('0x36')](_0xc0e6e7[_0xc3e5('0x32')],_0xc0e6e7[_0xc3e5('0x33')]);_0x45ca6d[_0xc3e5('0x37')]=_[_0xc3e5('0x36')](_0xc0e6e7[_0xc3e5('0x32')],qs['fields'](_0xa6766d[_0xc3e5('0x33')]['fields']));_0x45ca6d[_0xc3e5('0x37')]=_0x45ca6d[_0xc3e5('0x37')][_0xc3e5('0x38')]?_0x45ca6d[_0xc3e5('0x37')]:_0xc0e6e7['model'];if(!_0xa6766d[_0xc3e5('0x33')]['hasOwnProperty']('nolimit')){_0x45ca6d[_0xc3e5('0x22')]=qs['limit'](_0xa6766d[_0xc3e5('0x33')][_0xc3e5('0x22')]);_0x45ca6d[_0xc3e5('0x1f')]=qs[_0xc3e5('0x1f')](_0xa6766d[_0xc3e5('0x33')]['offset']);}_0x45ca6d[_0xc3e5('0x39')]=qs[_0xc3e5('0x3a')](_0xa6766d[_0xc3e5('0x33')][_0xc3e5('0x3a')]);_0x45ca6d[_0xc3e5('0x3b')]=qs['filters'](_[_0xc3e5('0x3c')](_0xa6766d['query'],_0xc0e6e7[_0xc3e5('0x35')]),_0x5a2d41);if(_0xa6766d[_0xc3e5('0x33')]['filter']){_0x45ca6d[_0xc3e5('0x3b')]=_['merge'](_0x45ca6d[_0xc3e5('0x3b')],{'$or':_[_0xc3e5('0x3d')](_0x5a2d41,function(_0x3e7333){if(_0x3e7333['type']!==_0xc3e5('0x3e')){var _0x3c496f={};_0x3c496f[_0x3e7333[_0xc3e5('0x2c')]]={'$like':'%'+_0xa6766d[_0xc3e5('0x33')][_0xc3e5('0x3f')]+'%'};return _0x3c496f;}})});}_0x45ca6d=_['merge']({},_0x45ca6d,_0xa6766d['options']);var _0x5ebe00={'where':_0x45ca6d[_0xc3e5('0x3b')]};return db[_0xc3e5('0x40')]['count'](_0x5ebe00)[_0xc3e5('0x28')](function(_0x5b100d){_0xc58f2b[_0xc3e5('0x21')]=_0x5b100d;if(_0xa6766d['query'][_0xc3e5('0x41')]){_0x45ca6d['include']=[{'all':!![]}];}return db[_0xc3e5('0x40')][_0xc3e5('0x42')](_0x45ca6d);})[_0xc3e5('0x28')](function(_0x1c5177){_0xc58f2b[_0xc3e5('0x43')]=_0x1c5177;return _0xc58f2b;})[_0xc3e5('0x28')](respondWithFilteredResult(_0x497ecf,_0x45ca6d))['catch'](handleError(_0x497ecf,null));};exports['show']=function(_0x3213d3,_0x5f4328){var _0x3f0887={'raw':!![],'where':{'id':_0x3213d3[_0xc3e5('0x44')]['id']}},_0x27354c={};_0x27354c[_0xc3e5('0x32')]=_[_0xc3e5('0x34')](db[_0xc3e5('0x40')]['rawAttributes']);_0x27354c[_0xc3e5('0x33')]=_[_0xc3e5('0x34')](_0x3213d3[_0xc3e5('0x33')]);_0x27354c[_0xc3e5('0x35')]=_[_0xc3e5('0x36')](_0x27354c[_0xc3e5('0x32')],_0x27354c[_0xc3e5('0x33')]);_0x3f0887[_0xc3e5('0x37')]=_[_0xc3e5('0x36')](_0x27354c[_0xc3e5('0x32')],qs['fields'](_0x3213d3['query']['fields']));_0x3f0887[_0xc3e5('0x37')]=_0x3f0887['attributes'][_0xc3e5('0x38')]?_0x3f0887[_0xc3e5('0x37')]:_0x27354c[_0xc3e5('0x32')];if(_0x3213d3[_0xc3e5('0x33')]['includeAll']){_0x3f0887[_0xc3e5('0x45')]=[{'all':!![]}];}_0x3f0887=_[_0xc3e5('0x46')]({},_0x3f0887,_0x3213d3[_0xc3e5('0x47')]);return db[_0xc3e5('0x40')]['find'](_0x3f0887)['then'](handleEntityNotFound(_0x5f4328,null))[_0xc3e5('0x28')](respondWithResult(_0x5f4328,null))[_0xc3e5('0x48')](handleError(_0x5f4328,null));};exports['create']=function(_0x12cc80,_0x4c9b0b){return db[_0xc3e5('0x40')]['create'](_0x12cc80[_0xc3e5('0x49')],{})['then'](respondWithResult(_0x4c9b0b,0xc9))['catch'](handleError(_0x4c9b0b,null));};exports['update']=function(_0x87855d,_0x11da7e){if(_0x87855d[_0xc3e5('0x49')]['id']){delete _0x87855d['body']['id'];}return db['FreshdeskField'][_0xc3e5('0x4a')]({'where':{'id':_0x87855d['params']['id']}})[_0xc3e5('0x28')](handleEntityNotFound(_0x11da7e,null))[_0xc3e5('0x28')](saveUpdates(_0x87855d[_0xc3e5('0x49')],null))[_0xc3e5('0x28')](respondWithResult(_0x11da7e,null))[_0xc3e5('0x48')](handleError(_0x11da7e,null));};exports[_0xc3e5('0x29')]=function(_0x5cd31c,_0x27924f){return db['FreshdeskField']['find']({'where':{'id':_0x5cd31c[_0xc3e5('0x44')]['id']}})['then'](handleEntityNotFound(_0x27924f,null))[_0xc3e5('0x28')](removeEntity(_0x27924f,null))['catch'](handleError(_0x27924f,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index 8b4f648..7ad90fe 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 _0x2071=['rimraf','../../config/environment','define','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','idField','FieldId','lodash','../../config/logger','api','moment','request-promise','path'];(function(_0x3b085,_0x250543){var _0x476a57=function(_0x480941){while(--_0x480941){_0x3b085['push'](_0x3b085['shift']());}};_0x476a57(++_0x250543);}(_0x2071,0xa2));var _0x1207=function(_0x2136a6,_0x35af63){_0x2136a6=_0x2136a6-0x0;var _0x55b948=_0x2071[_0x2136a6];return _0x55b948;};'use strict';var _=require(_0x1207('0x0'));var util=require('util');var logger=require(_0x1207('0x1'))(_0x1207('0x2'));var moment=require(_0x1207('0x3'));var BPromise=require('bluebird');var rp=require(_0x1207('0x4'));var fs=require('fs');var path=require(_0x1207('0x5'));var rimraf=require(_0x1207('0x6'));var config=require(_0x1207('0x7'));var attributes=require('./intFreshdeskField.attributes');module['exports']=function(_0x3d4ecf,_0x90c5fb){return _0x3d4ecf[_0x1207('0x8')](_0x1207('0x9'),attributes,{'tableName':_0x1207('0xa'),'paranoid':![],'indexes':[{'name':_0x1207('0xb'),'fields':[_0x1207('0xc'),_0x1207('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1803=['freshdesk_unique_index','idField','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','int_freshdesk_fields'];(function(_0x28aea5,_0x3bb12e){var _0x6a55f9=function(_0xf6ece8){while(--_0xf6ece8){_0x28aea5['push'](_0x28aea5['shift']());}};_0x6a55f9(++_0x3bb12e);}(_0x1803,0x1be));var _0x3180=function(_0x3745f7,_0x5181b2){_0x3745f7=_0x3745f7-0x0;var _0x1f8745=_0x1803[_0x3745f7];return _0x1f8745;};'use strict';var _=require('lodash');var util=require(_0x3180('0x0'));var logger=require('../../config/logger')(_0x3180('0x1'));var moment=require(_0x3180('0x2'));var BPromise=require(_0x3180('0x3'));var rp=require(_0x3180('0x4'));var fs=require('fs');var path=require(_0x3180('0x5'));var rimraf=require(_0x3180('0x6'));var config=require(_0x3180('0x7'));var attributes=require('./intFreshdeskField.attributes');module['exports']=function(_0x355046,_0x252ebc){return _0x355046[_0x3180('0x8')]('FreshdeskField',attributes,{'tableName':_0x3180('0x9'),'paranoid':![],'indexes':[{'name':_0x3180('0xa'),'fields':[_0x3180('0xb'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.rpc.js b/server/api/intFreshdeskField/intFreshdeskField.rpc.js index 64f805e..c079ee4 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 _0xfc25=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','then','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','code','error','message','info','result','catch','lodash','util'];(function(_0x4458f4,_0x272bb8){var _0x1b59cc=function(_0x36205b){while(--_0x36205b){_0x4458f4['push'](_0x4458f4['shift']());}};_0x1b59cc(++_0x272bb8);}(_0xfc25,0x178));var _0x5fc2=function(_0x47836a,_0x3cbe0e){_0x47836a=_0x47836a-0x0;var _0x130660=_0xfc25[_0x47836a];return _0x130660;};'use strict';var _=require(_0x5fc2('0x0'));var util=require(_0x5fc2('0x1'));var moment=require(_0x5fc2('0x2'));var BPromise=require(_0x5fc2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5fc2('0x4'));var db=require(_0x5fc2('0x5'))['db'];var utils=require(_0x5fc2('0x6'));var logger=require(_0x5fc2('0x7'))(_0x5fc2('0x8'));var config=require('../../config/environment');var jayson=require(_0x5fc2('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xc11f50,_0xd9e951,_0x3547e6){return new BPromise(function(_0x5963cf,_0x54b759){return client['request'](_0xc11f50,_0x3547e6)[_0x5fc2('0xa')](function(_0x440462){logger['info'](_0x5fc2('0xb'),_0xd9e951,_0x5fc2('0xc'));logger[_0x5fc2('0xd')](_0x5fc2('0xe'),_0xd9e951,_0x5fc2('0xc'),JSON['stringify'](_0x440462));if(_0x440462['error']){if(_0x440462['error'][_0x5fc2('0xf')]===0x1f4){logger[_0x5fc2('0x10')](_0x5fc2('0xb'),_0xd9e951,_0x440462['error'][_0x5fc2('0x11')]);return _0x54b759(_0x440462['error'][_0x5fc2('0x11')]);}logger[_0x5fc2('0x10')](_0x5fc2('0xb'),_0xd9e951,_0x440462['error'][_0x5fc2('0x11')]);return _0x5963cf(_0x440462[_0x5fc2('0x10')][_0x5fc2('0x11')]);}else{logger[_0x5fc2('0x12')]('FreshdeskField,\x20%s,\x20%s',_0xd9e951,_0x5fc2('0xc'));_0x5963cf(_0x440462[_0x5fc2('0x13')]['message']);}})[_0x5fc2('0x14')](function(_0x430b7f){logger[_0x5fc2('0x10')](_0x5fc2('0xb'),_0xd9e951,_0x430b7f);_0x54b759(_0x430b7f);});});} \ No newline at end of file +var _0x860a=['message','result','lodash','moment','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','FreshdeskField,\x20%s,\x20%s','FreshdeskField,\x20%s,\x20%s,\x20%s','request\x20sent','error'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0x860a,0xac));var _0xa860=function(_0x32ba36,_0x6dc119){_0x32ba36=_0x32ba36-0x0;var _0xe4ab10=_0x860a[_0x32ba36];return _0xe4ab10;};'use strict';var _=require(_0xa860('0x0'));var util=require('util');var moment=require(_0xa860('0x1'));var BPromise=require('bluebird');var rs=require(_0xa860('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa860('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xa860('0x4'))('rpc');var config=require(_0xa860('0x5'));var jayson=require(_0xa860('0x6'));var client=jayson[_0xa860('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x42084a,_0x124eb9,_0x3272c7){return new BPromise(function(_0x55c035,_0x145d02){return client[_0xa860('0x8')](_0x42084a,_0x3272c7)[_0xa860('0x9')](function(_0x296fd1){logger[_0xa860('0xa')](_0xa860('0xb'),_0x124eb9,'request\x20sent');logger['debug'](_0xa860('0xc'),_0x124eb9,_0xa860('0xd'),JSON['stringify'](_0x296fd1));if(_0x296fd1[_0xa860('0xe')]){if(_0x296fd1[_0xa860('0xe')]['code']===0x1f4){logger[_0xa860('0xe')]('FreshdeskField,\x20%s,\x20%s',_0x124eb9,_0x296fd1[_0xa860('0xe')][_0xa860('0xf')]);return _0x145d02(_0x296fd1[_0xa860('0xe')][_0xa860('0xf')]);}logger[_0xa860('0xe')]('FreshdeskField,\x20%s,\x20%s',_0x124eb9,_0x296fd1[_0xa860('0xe')][_0xa860('0xf')]);return _0x55c035(_0x296fd1['error'][_0xa860('0xf')]);}else{logger[_0xa860('0xa')]('FreshdeskField,\x20%s,\x20%s',_0x124eb9,_0xa860('0xd'));_0x55c035(_0x296fd1[_0xa860('0x10')][_0xa860('0xf')]);}})['catch'](function(_0x335a81){logger[_0xa860('0xe')]('FreshdeskField,\x20%s,\x20%s',_0x124eb9,_0x335a81);_0x145d02(_0x335a81);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index d323607..f46afd5 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(_0x1cb18a,_0x33167a){var _0x22442e=function(_0x46c611){while(--_0x46c611){_0x1cb18a['push'](_0x1cb18a['shift']());}};_0x22442e(++_0x33167a);}(_0x16d2,0x123));var _0x216d=function(_0x1691fd,_0x2fab1c){_0x1691fd=_0x1691fd-0x0;var _0x2bf50b=_0x16d2[_0x1691fd];return _0x2bf50b;};'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 _0xcf66=['util','path','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/configurations','post','create','put','update','delete','destroy','multer'];(function(_0x11a356,_0x53023f){var _0x588985=function(_0x1b173f){while(--_0x1b173f){_0x11a356['push'](_0x11a356['shift']());}};_0x588985(++_0x53023f);}(_0xcf66,0x71));var _0x6cf6=function(_0x59a654,_0x373b40){_0x59a654=_0x59a654-0x0;var _0x328ae5=_0xcf66[_0x59a654];return _0x328ae5;};'use strict';var multer=require(_0x6cf6('0x0'));var util=require(_0x6cf6('0x1'));var path=require(_0x6cf6('0x2'));var timeout=require('connect-timeout');var express=require(_0x6cf6('0x3'));var router=express[_0x6cf6('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x6cf6('0x5'));var config=require(_0x6cf6('0x6'));var controller=require('./intFreshsalesAccount.controller');router[_0x6cf6('0x7')]('/',auth[_0x6cf6('0x8')](),controller[_0x6cf6('0x9')]);router['get'](_0x6cf6('0xa'),auth[_0x6cf6('0x8')](),controller[_0x6cf6('0xb')]);router[_0x6cf6('0x7')](_0x6cf6('0xc'),auth[_0x6cf6('0x8')](),controller['getConfigurations']);router['get']('/:id/fields',auth[_0x6cf6('0x8')](),controller['getFields']);router[_0x6cf6('0xd')]('/',auth[_0x6cf6('0x8')](),controller[_0x6cf6('0xe')]);router[_0x6cf6('0xd')]('/:id/configurations',auth['isAuthenticated'](),controller['addConfiguration']);router[_0x6cf6('0xf')](_0x6cf6('0xa'),auth[_0x6cf6('0x8')](),controller[_0x6cf6('0x10')]);router[_0x6cf6('0x11')](_0x6cf6('0xa'),auth['isAuthenticated'](),controller[_0x6cf6('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index 80a2dcc..f08e2a6 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 _0x2272=['sequelize','exports','STRING','remoteUri'];(function(_0x4383e9,_0xa4b307){var _0x355405=function(_0x545b5b){while(--_0x545b5b){_0x4383e9['push'](_0x4383e9['shift']());}};_0x355405(++_0xa4b307);}(_0x2272,0xd8));var _0x2227=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x2272[_0x17d9e3];return _0x14192d;};'use strict';var Sequelize=require(_0x2227('0x0'));module[_0x2227('0x1')]={'name':{'type':Sequelize[_0x2227('0x2')]},'description':{'type':Sequelize[_0x2227('0x2')]},'username':{'type':Sequelize[_0x2227('0x2')],'unique':'username'},'apiKey':{'type':Sequelize[_0x2227('0x2')]},'remoteUri':{'type':Sequelize[_0x2227('0x2')],'unique':_0x2227('0x3')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x4b17=['username','sequelize','STRING'];(function(_0x28a96b,_0x21cad1){var _0x53bcdf=function(_0x4bbe7e){while(--_0x4bbe7e){_0x28a96b['push'](_0x28a96b['shift']());}};_0x53bcdf(++_0x21cad1);}(_0x4b17,0x10f));var _0x74b1=function(_0x2b737c,_0x274adf){_0x2b737c=_0x2b737c-0x0;var _0x466ed5=_0x4b17[_0x2b737c];return _0x466ed5;};'use strict';var Sequelize=require(_0x74b1('0x0'));module['exports']={'name':{'type':Sequelize[_0x74b1('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x74b1('0x1')],'unique':_0x74b1('0x2')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x74b1('0x1')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js index 6a4245c..eaefc3e 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 _0x378a=['rows','catch','params','rawAttributes','include','find','create','body','getConfigurations','findOne','FreshsalesConfiguration','addConfiguration','getSubjects','channel','Descriptions','getDescriptions','FreshsalesField','Subjects','getFields','username','remoteUri','apiKey','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','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','end','error','stack','name','send','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','FreshsalesAccount','includeAll','findAll','then'];(function(_0x255c48,_0x2a4449){var _0xaebda3=function(_0x12a04e){while(--_0x12a04e){_0x255c48['push'](_0x255c48['shift']());}};_0xaebda3(++_0x2a4449);}(_0x378a,0xfc));var _0xa378=function(_0x247c39,_0x412245){_0x247c39=_0x247c39-0x0;var _0x2383b5=_0x378a[_0x247c39];return _0x2383b5;};'use strict';var emlformat=require(_0xa378('0x0'));var rimraf=require(_0xa378('0x1'));var zipdir=require(_0xa378('0x2'));var jsonpatch=require(_0xa378('0x3'));var rp=require(_0xa378('0x4'));var moment=require(_0xa378('0x5'));var BPromise=require(_0xa378('0x6'));var Mustache=require(_0xa378('0x7'));var util=require(_0xa378('0x8'));var path=require(_0xa378('0x9'));var sox=require(_0xa378('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa378('0xb'));var _=require(_0xa378('0xc'));var squel=require(_0xa378('0xd'));var crypto=require(_0xa378('0xe'));var jsforce=require(_0xa378('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xa378('0x10'));var querystring=require(_0xa378('0x11'));var Papa=require(_0xa378('0x12'));var Redis=require(_0xa378('0x13'));var authService=require(_0xa378('0x14'));var qs=require(_0xa378('0x15'));var as=require(_0xa378('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa378('0x17'))(_0xa378('0x18'));var utils=require(_0xa378('0x19'));var config=require(_0xa378('0x1a'));var licenseUtil=require(_0xa378('0x1b'));var db=require('../../mysqldb')['db'];var integrations=require(_0xa378('0x1c'));function respondWithStatusCode(_0x1403cf,_0x682e62){_0x682e62=_0x682e62||0xcc;return function(_0x25faa5){if(_0x25faa5){return _0x1403cf[_0xa378('0x1d')](_0x682e62);}return _0x1403cf['status'](_0x682e62)['end']();};}function respondWithResult(_0x487c35,_0x1d1600){_0x1d1600=_0x1d1600||0xc8;return function(_0x1e8bb1){if(_0x1e8bb1){return _0x487c35[_0xa378('0x1e')](_0x1d1600)['json'](_0x1e8bb1);}};}function respondWithFilteredResult(_0x230da4,_0x4a8727){return function(_0x5e5db7){if(_0x5e5db7){var _0x28e28d=typeof _0x4a8727[_0xa378('0x1f')]===_0xa378('0x20')&&typeof _0x4a8727[_0xa378('0x21')]==='undefined';var _0x1fff6d=_0x5e5db7[_0xa378('0x22')];var _0x24755a=_0x28e28d?0x0:_0x4a8727[_0xa378('0x1f')];var _0x19ebea=_0x28e28d?_0x5e5db7[_0xa378('0x22')]:_0x4a8727['offset']+_0x4a8727['limit'];var _0xf2edc4;if(_0x19ebea>=_0x1fff6d){_0x19ebea=_0x1fff6d;_0xf2edc4=0xc8;}else{_0xf2edc4=0xce;}_0x230da4['status'](_0xf2edc4);return _0x230da4[_0xa378('0x23')](_0xa378('0x24'),_0x24755a+'-'+_0x19ebea+'/'+_0x1fff6d)['json'](_0x5e5db7);}return null;};}function patchUpdates(_0x23c3ea){return function(_0x5c3049){try{jsonpatch[_0xa378('0x25')](_0x5c3049,_0x23c3ea,!![]);}catch(_0x190ff0){return BPromise[_0xa378('0x26')](_0x190ff0);}return _0x5c3049[_0xa378('0x27')]();};}function saveUpdates(_0x4ae1ec,_0x41e87d){return function(_0x15445a){if(_0x15445a){return _0x15445a[_0xa378('0x28')](_0x4ae1ec)['then'](function(_0x48d7dc){return _0x48d7dc;});}return null;};}function removeEntity(_0x50f822,_0x160d58){return function(_0x57808c){if(_0x57808c){return _0x57808c[_0xa378('0x29')]()['then'](function(){_0x50f822[_0xa378('0x1e')](0xcc)[_0xa378('0x2a')]();});}};}function handleEntityNotFound(_0x592d09,_0x56fed2){return function(_0x550ac4){if(!_0x550ac4){_0x592d09[_0xa378('0x1d')](0x194);}return _0x550ac4;};}function handleError(_0x4745b9,_0x50906d){_0x50906d=_0x50906d||0x1f4;return function(_0x34b468){logger[_0xa378('0x2b')](_0x34b468[_0xa378('0x2c')]);if(_0x34b468[_0xa378('0x2d')]){delete _0x34b468[_0xa378('0x2d')];}_0x4745b9['status'](_0x50906d)[_0xa378('0x2e')](_0x34b468);};}exports['index']=function(_0x9dfc9b,_0x2f59bb){var _0x1e56f5={},_0x5bf70c={},_0x255dd1={'count':0x0,'rows':[]};var _0x4216dd=_['map'](db['FreshsalesAccount']['rawAttributes'],function(_0x3398c){return{'name':_0x3398c[_0xa378('0x2f')],'type':_0x3398c[_0xa378('0x30')][_0xa378('0x31')]};});_0x5bf70c[_0xa378('0x32')]=_[_0xa378('0x33')](_0x4216dd,'name');_0x5bf70c[_0xa378('0x34')]=_[_0xa378('0x35')](_0x9dfc9b[_0xa378('0x34')]);_0x5bf70c[_0xa378('0x36')]=_[_0xa378('0x37')](_0x5bf70c['model'],_0x5bf70c['query']);_0x1e56f5[_0xa378('0x38')]=_[_0xa378('0x37')](_0x5bf70c[_0xa378('0x32')],qs[_0xa378('0x39')](_0x9dfc9b[_0xa378('0x34')][_0xa378('0x39')]));_0x1e56f5['attributes']=_0x1e56f5[_0xa378('0x38')][_0xa378('0x3a')]?_0x1e56f5['attributes']:_0x5bf70c[_0xa378('0x32')];if(!_0x9dfc9b[_0xa378('0x34')][_0xa378('0x3b')](_0xa378('0x3c'))){_0x1e56f5[_0xa378('0x21')]=qs[_0xa378('0x21')](_0x9dfc9b[_0xa378('0x34')][_0xa378('0x21')]);_0x1e56f5['offset']=qs['offset'](_0x9dfc9b[_0xa378('0x34')][_0xa378('0x1f')]);}_0x1e56f5[_0xa378('0x3d')]=qs[_0xa378('0x3e')](_0x9dfc9b[_0xa378('0x34')][_0xa378('0x3e')]);_0x1e56f5[_0xa378('0x3f')]=qs[_0xa378('0x36')](_[_0xa378('0x40')](_0x9dfc9b[_0xa378('0x34')],_0x5bf70c['filters']),_0x4216dd);if(_0x9dfc9b[_0xa378('0x34')][_0xa378('0x41')]){_0x1e56f5[_0xa378('0x3f')]=_[_0xa378('0x42')](_0x1e56f5['where'],{'$or':_[_0xa378('0x33')](_0x4216dd,function(_0x407cfb){if(_0x407cfb[_0xa378('0x30')]!=='VIRTUAL'){var _0x596bbc={};_0x596bbc[_0x407cfb[_0xa378('0x2d')]]={'$like':'%'+_0x9dfc9b['query'][_0xa378('0x41')]+'%'};return _0x596bbc;}})});}_0x1e56f5=_[_0xa378('0x42')]({},_0x1e56f5,_0x9dfc9b[_0xa378('0x43')]);var _0xac3b09={'where':_0x1e56f5[_0xa378('0x3f')]};return db[_0xa378('0x44')]['count'](_0xac3b09)['then'](function(_0x1d615f){_0x255dd1[_0xa378('0x22')]=_0x1d615f;if(_0x9dfc9b[_0xa378('0x34')][_0xa378('0x45')]){_0x1e56f5['include']=[{'all':!![]}];}return db[_0xa378('0x44')][_0xa378('0x46')](_0x1e56f5);})[_0xa378('0x47')](function(_0x3e9bd8){_0x255dd1[_0xa378('0x48')]=_0x3e9bd8;return _0x255dd1;})[_0xa378('0x47')](respondWithFilteredResult(_0x2f59bb,_0x1e56f5))[_0xa378('0x49')](handleError(_0x2f59bb,null));};exports['show']=function(_0x471342,_0x2e79d4){var _0x5e77ca={'raw':![],'where':{'id':_0x471342[_0xa378('0x4a')]['id']}},_0x3e3c30={};_0x3e3c30['model']=_[_0xa378('0x35')](db[_0xa378('0x44')][_0xa378('0x4b')]);_0x3e3c30['query']=_[_0xa378('0x35')](_0x471342[_0xa378('0x34')]);_0x3e3c30[_0xa378('0x36')]=_[_0xa378('0x37')](_0x3e3c30['model'],_0x3e3c30[_0xa378('0x34')]);_0x5e77ca['attributes']=_[_0xa378('0x37')](_0x3e3c30['model'],qs[_0xa378('0x39')](_0x471342['query']['fields']));_0x5e77ca[_0xa378('0x38')]=_0x5e77ca[_0xa378('0x38')][_0xa378('0x3a')]?_0x5e77ca[_0xa378('0x38')]:_0x3e3c30[_0xa378('0x32')];if(_0x471342[_0xa378('0x34')][_0xa378('0x45')]){_0x5e77ca[_0xa378('0x4c')]=[{'all':!![]}];}_0x5e77ca=_[_0xa378('0x42')]({},_0x5e77ca,_0x471342['options']);return db['FreshsalesAccount'][_0xa378('0x4d')](_0x5e77ca)['then'](handleEntityNotFound(_0x2e79d4,null))[_0xa378('0x47')](respondWithResult(_0x2e79d4,null))[_0xa378('0x49')](handleError(_0x2e79d4,null));};exports[_0xa378('0x4e')]=function(_0x2fb7db,_0xe6bf5b){return db[_0xa378('0x44')][_0xa378('0x4e')](_0x2fb7db['body'],{})[_0xa378('0x47')](respondWithResult(_0xe6bf5b,0xc9))[_0xa378('0x49')](handleError(_0xe6bf5b,null));};exports['update']=function(_0x584107,_0x3e1e8d){if(_0x584107[_0xa378('0x4f')]['id']){delete _0x584107[_0xa378('0x4f')]['id'];}return db[_0xa378('0x44')]['find']({'where':{'id':_0x584107[_0xa378('0x4a')]['id']}})[_0xa378('0x47')](handleEntityNotFound(_0x3e1e8d,null))['then'](saveUpdates(_0x584107[_0xa378('0x4f')],null))[_0xa378('0x47')](respondWithResult(_0x3e1e8d,null))[_0xa378('0x49')](handleError(_0x3e1e8d,null));};exports[_0xa378('0x29')]=function(_0x51a5bd,_0x3a8e41){return db[_0xa378('0x44')]['find']({'where':{'id':_0x51a5bd['params']['id']}})['then'](handleEntityNotFound(_0x3a8e41,null))[_0xa378('0x47')](removeEntity(_0x3a8e41,null))[_0xa378('0x49')](handleError(_0x3a8e41,null));};exports[_0xa378('0x50')]=function(_0xaa7b2,_0x56a08f,_0x25c6c0){var _0x43f925={};var _0x456a70={};var _0x17a4ce;var _0x4fdea0;return db[_0xa378('0x44')][_0xa378('0x51')]({'where':{'id':_0xaa7b2[_0xa378('0x4a')]['id']}})[_0xa378('0x47')](handleEntityNotFound(_0x56a08f,null))[_0xa378('0x47')](function(_0x3ef434){if(_0x3ef434){_0x17a4ce=_0x3ef434;_0x456a70[_0xa378('0x32')]=_[_0xa378('0x35')](db[_0xa378('0x52')][_0xa378('0x4b')]);_0x456a70[_0xa378('0x34')]=_[_0xa378('0x35')](_0xaa7b2[_0xa378('0x34')]);_0x456a70['filters']=_['intersection'](_0x456a70[_0xa378('0x32')],_0x456a70[_0xa378('0x34')]);_0x43f925[_0xa378('0x38')]=_[_0xa378('0x37')](_0x456a70[_0xa378('0x32')],qs[_0xa378('0x39')](_0xaa7b2[_0xa378('0x34')][_0xa378('0x39')]));_0x43f925[_0xa378('0x38')]=_0x43f925[_0xa378('0x38')]['length']?_0x43f925[_0xa378('0x38')]:_0x456a70[_0xa378('0x32')];_0x43f925[_0xa378('0x3d')]=qs['sort'](_0xaa7b2[_0xa378('0x34')][_0xa378('0x3e')]);_0x43f925[_0xa378('0x3f')]=qs['filters'](_[_0xa378('0x40')](_0xaa7b2['query'],_0x456a70[_0xa378('0x36')]));if(_0xaa7b2[_0xa378('0x34')][_0xa378('0x41')]){_0x43f925[_0xa378('0x3f')]=_[_0xa378('0x42')](_0x43f925[_0xa378('0x3f')],{'$or':_[_0xa378('0x33')](_0x43f925[_0xa378('0x38')],function(_0x2dcbe2){var _0x53c8a9={};_0x53c8a9[_0x2dcbe2]={'$like':'%'+_0xaa7b2[_0xa378('0x34')]['filter']+'%'};return _0x53c8a9;})});}_0x43f925=_[_0xa378('0x42')]({},_0x43f925,_0xaa7b2[_0xa378('0x43')]);return _0x17a4ce['getConfigurations'](_0x43f925);}})[_0xa378('0x47')](function(_0x370d0c){if(_0x370d0c){_0x4fdea0=_0x370d0c[_0xa378('0x3a')];if(!_0xaa7b2[_0xa378('0x34')][_0xa378('0x3b')]('nolimit')){_0x43f925[_0xa378('0x21')]=qs[_0xa378('0x21')](_0xaa7b2[_0xa378('0x34')]['limit']);_0x43f925['offset']=qs[_0xa378('0x1f')](_0xaa7b2['query'][_0xa378('0x1f')]);}return _0x17a4ce['getConfigurations'](_0x43f925);}})[_0xa378('0x47')](function(_0x146058){if(_0x146058){return _0x146058?{'count':_0x4fdea0,'rows':_0x146058}:null;}})[_0xa378('0x47')](respondWithResult(_0x56a08f,null))['catch'](handleError(_0x56a08f,null));};exports[_0xa378('0x53')]=function(_0x5e7306,_0x24e374,_0x1ee7bc){if(_0x5e7306['body']['id']){delete _0x5e7306['body']['id'];}return db['FreshsalesAccount'][_0xa378('0x51')]({'where':{'id':_0x5e7306['params']['id']}})[_0xa378('0x47')](handleEntityNotFound(_0x24e374,null))[_0xa378('0x47')](function(_0x4be516){if(_0x4be516){_0x5e7306['body']['AccountId']=_0x4be516['id'];_0x5e7306[_0xa378('0x4f')]['Subjects']=integrations[_0xa378('0x54')](_0x5e7306[_0xa378('0x4f')][_0xa378('0x55')],_0x5e7306[_0xa378('0x4f')]['type']);_0x5e7306[_0xa378('0x4f')][_0xa378('0x56')]=integrations[_0xa378('0x57')](_0x5e7306[_0xa378('0x4f')][_0xa378('0x55')],_0x5e7306[_0xa378('0x4f')]['type']);return db[_0xa378('0x52')][_0xa378('0x4e')](_0x5e7306[_0xa378('0x4f')],{'include':[{'model':db[_0xa378('0x58')],'as':_0xa378('0x59')},{'model':db['FreshsalesField'],'as':_0xa378('0x56')}]});}return null;})[_0xa378('0x47')](respondWithResult(_0x24e374,null))[_0xa378('0x49')](handleError(_0x24e374,null));};exports[_0xa378('0x5a')]=function(_0x308efe,_0x287614,_0x599ae2){var _0xeb78cd='';var _0x104411='';return db[_0xa378('0x44')][_0xa378('0x51')]({'where':{'id':_0x308efe[_0xa378('0x4a')]['id']},'attributes':['id',_0xa378('0x5b'),_0xa378('0x5c'),_0xa378('0x5d')]})[_0xa378('0x47')](handleEntityNotFound(_0x287614,null))[_0xa378('0x47')](function(_0x1b999c){if(_0x1b999c){_0x104411=_0x1b999c[_0xa378('0x5b')];_0xeb78cd=_0x1b999c[_0xa378('0x5c')];var _0x5299b6=_0x1b999c[_0xa378('0x5c')]['slice'](-0x1);if(_0x5299b6==='/'){_0xeb78cd=_0xeb78cd[_0xa378('0x5e')](0x0,_0xeb78cd[_0xa378('0x5f')](_0x5299b6));}return rp({'method':'GET','uri':util[_0xa378('0x60')](_0xa378('0x61'),_0xeb78cd,_0xa378('0x62')),'headers':{'Authorization':_0xa378('0x63')+_0x1b999c[_0xa378('0x5d')]},'json':!![]});}})['then'](function(_0x5e978b){if(_0x5e978b){var _0x4aba69=_0x5e978b[_0xa378('0x64')];var _0x19331d=![];var _0x14aac7=null;for(_0x14aac7=0x0;_0x14aac7<_0x4aba69[_0xa378('0x3a')];_0x14aac7++){if(_0x4aba69[_0x14aac7][_0xa378('0x65')]===_0x104411){_0x19331d=!![];}}if(_0x19331d){return!![];}else{throw new Error({'statusCode':0x194,'message':_0xa378('0x66')});}}})[_0xa378('0x47')](respondWithResult(_0x287614,null))[_0xa378('0x49')](function(_0x43c00d){var _0x15959c=_0x308efe[_0xa378('0x34')]['test']?0x1f4:_0x43c00d[_0xa378('0x67')]||0x1f4;logger[_0xa378('0x2b')](_0xa378('0x68'),_0xa378('0x5a'),_0x15959c,JSON[_0xa378('0x69')](_0x43c00d));delete _0x43c00d[_0xa378('0x2d')];if(_0x15959c===0x191){_0x15959c=0x190;}_0x287614[_0xa378('0x1e')](_0x15959c)[_0xa378('0x2e')](_0x308efe['query'][_0xa378('0x6a')]?{'message':_0xa378('0x6b'),'statusCode':_0x43c00d[_0xa378('0x67')]}:_0x43c00d);});}; \ No newline at end of file +var _0xbca3=['path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','destroy','then','end','error','stack','name','FreshsalesAccount','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','find','findOne','FreshsalesConfiguration','getConfigurations','addConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions','FreshsalesField','apiKey','remoteUri','slice','substring','lastIndexOf','format','/api/selector/owners','Token\x20token=','users','Requested\x20Resource\x20not\x20Found','statusCode','getFields','stringify','test','Wrong\x20credentials','eml-format','rimraf','request-promise','moment','bluebird','mustache','util'];(function(_0x31a7b9,_0x1894b9){var _0x13b914=function(_0x33c816){while(--_0x33c816){_0x31a7b9['push'](_0x31a7b9['shift']());}};_0x13b914(++_0x1894b9);}(_0xbca3,0xc1));var _0x3bca=function(_0x394902,_0x509dcb){_0x394902=_0x394902-0x0;var _0x24dc57=_0xbca3[_0x394902];return _0x24dc57;};'use strict';var emlformat=require(_0x3bca('0x0'));var rimraf=require(_0x3bca('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x3bca('0x2'));var moment=require(_0x3bca('0x3'));var BPromise=require(_0x3bca('0x4'));var Mustache=require(_0x3bca('0x5'));var util=require(_0x3bca('0x6'));var path=require(_0x3bca('0x7'));var sox=require(_0x3bca('0x8'));var csv=require('to-csv');var ejs=require(_0x3bca('0x9'));var fs=require('fs');var fs_extra=require(_0x3bca('0xa'));var _=require(_0x3bca('0xb'));var squel=require(_0x3bca('0xc'));var crypto=require(_0x3bca('0xd'));var jsforce=require(_0x3bca('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x3bca('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3bca('0x10'));var authService=require(_0x3bca('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x3bca('0x12'))(_0x3bca('0x13'));var utils=require(_0x3bca('0x14'));var config=require(_0x3bca('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0x3bca('0x16'));function respondWithStatusCode(_0x2cd37,_0x6a0928){_0x6a0928=_0x6a0928||0xcc;return function(_0x357c7a){if(_0x357c7a){return _0x2cd37[_0x3bca('0x17')](_0x6a0928);}return _0x2cd37['status'](_0x6a0928)['end']();};}function respondWithResult(_0x431643,_0x46483f){_0x46483f=_0x46483f||0xc8;return function(_0x1c5b37){if(_0x1c5b37){return _0x431643[_0x3bca('0x18')](_0x46483f)[_0x3bca('0x19')](_0x1c5b37);}};}function respondWithFilteredResult(_0x59445c,_0x1a98f2){return function(_0x3f88bf){if(_0x3f88bf){var _0x15b34c=typeof _0x1a98f2[_0x3bca('0x1a')]===_0x3bca('0x1b')&&typeof _0x1a98f2['limit']===_0x3bca('0x1b');var _0x2cc1c0=_0x3f88bf[_0x3bca('0x1c')];var _0x489451=_0x15b34c?0x0:_0x1a98f2[_0x3bca('0x1a')];var _0x4998ae=_0x15b34c?_0x3f88bf['count']:_0x1a98f2['offset']+_0x1a98f2[_0x3bca('0x1d')];var _0x2d585f;if(_0x4998ae>=_0x2cc1c0){_0x4998ae=_0x2cc1c0;_0x2d585f=0xc8;}else{_0x2d585f=0xce;}_0x59445c['status'](_0x2d585f);return _0x59445c[_0x3bca('0x1e')](_0x3bca('0x1f'),_0x489451+'-'+_0x4998ae+'/'+_0x2cc1c0)['json'](_0x3f88bf);}return null;};}function patchUpdates(_0x3b4391){return function(_0x1e699e){try{jsonpatch[_0x3bca('0x20')](_0x1e699e,_0x3b4391,!![]);}catch(_0x3a36e1){return BPromise[_0x3bca('0x21')](_0x3a36e1);}return _0x1e699e['save']();};}function saveUpdates(_0x1ca733,_0x7f9cf0){return function(_0x599844){if(_0x599844){return _0x599844[_0x3bca('0x22')](_0x1ca733)['then'](function(_0x230c20){return _0x230c20;});}return null;};}function removeEntity(_0x2d5f05,_0x2ef5c4){return function(_0xf2effc){if(_0xf2effc){return _0xf2effc[_0x3bca('0x23')]()[_0x3bca('0x24')](function(){_0x2d5f05[_0x3bca('0x18')](0xcc)[_0x3bca('0x25')]();});}};}function handleEntityNotFound(_0x122be2,_0x1ae2a0){return function(_0x53d848){if(!_0x53d848){_0x122be2[_0x3bca('0x17')](0x194);}return _0x53d848;};}function handleError(_0x4ec295,_0x3e943d){_0x3e943d=_0x3e943d||0x1f4;return function(_0x3e3623){logger[_0x3bca('0x26')](_0x3e3623[_0x3bca('0x27')]);if(_0x3e3623[_0x3bca('0x28')]){delete _0x3e3623[_0x3bca('0x28')];}_0x4ec295['status'](_0x3e943d)['send'](_0x3e3623);};}exports['index']=function(_0x573835,_0x289662){var _0xd67e40={},_0x361e74={},_0x49997d={'count':0x0,'rows':[]};var _0xd69243=_['map'](db[_0x3bca('0x29')]['rawAttributes'],function(_0x1dec92){return{'name':_0x1dec92[_0x3bca('0x2a')],'type':_0x1dec92[_0x3bca('0x2b')][_0x3bca('0x2c')]};});_0x361e74[_0x3bca('0x2d')]=_[_0x3bca('0x2e')](_0xd69243,'name');_0x361e74[_0x3bca('0x2f')]=_[_0x3bca('0x30')](_0x573835[_0x3bca('0x2f')]);_0x361e74[_0x3bca('0x31')]=_[_0x3bca('0x32')](_0x361e74['model'],_0x361e74[_0x3bca('0x2f')]);_0xd67e40[_0x3bca('0x33')]=_[_0x3bca('0x32')](_0x361e74[_0x3bca('0x2d')],qs['fields'](_0x573835[_0x3bca('0x2f')][_0x3bca('0x34')]));_0xd67e40['attributes']=_0xd67e40[_0x3bca('0x33')][_0x3bca('0x35')]?_0xd67e40[_0x3bca('0x33')]:_0x361e74[_0x3bca('0x2d')];if(!_0x573835['query'][_0x3bca('0x36')](_0x3bca('0x37'))){_0xd67e40['limit']=qs[_0x3bca('0x1d')](_0x573835[_0x3bca('0x2f')]['limit']);_0xd67e40[_0x3bca('0x1a')]=qs[_0x3bca('0x1a')](_0x573835[_0x3bca('0x2f')][_0x3bca('0x1a')]);}_0xd67e40[_0x3bca('0x38')]=qs['sort'](_0x573835['query'][_0x3bca('0x39')]);_0xd67e40[_0x3bca('0x3a')]=qs[_0x3bca('0x31')](_[_0x3bca('0x3b')](_0x573835[_0x3bca('0x2f')],_0x361e74['filters']),_0xd69243);if(_0x573835[_0x3bca('0x2f')][_0x3bca('0x3c')]){_0xd67e40[_0x3bca('0x3a')]=_['merge'](_0xd67e40[_0x3bca('0x3a')],{'$or':_[_0x3bca('0x2e')](_0xd69243,function(_0x1cceab){if(_0x1cceab[_0x3bca('0x2b')]!==_0x3bca('0x3d')){var _0x18b3d={};_0x18b3d[_0x1cceab[_0x3bca('0x28')]]={'$like':'%'+_0x573835[_0x3bca('0x2f')][_0x3bca('0x3c')]+'%'};return _0x18b3d;}})});}_0xd67e40=_[_0x3bca('0x3e')]({},_0xd67e40,_0x573835[_0x3bca('0x3f')]);var _0x1548f6={'where':_0xd67e40[_0x3bca('0x3a')]};return db[_0x3bca('0x29')][_0x3bca('0x1c')](_0x1548f6)['then'](function(_0x49f734){_0x49997d['count']=_0x49f734;if(_0x573835[_0x3bca('0x2f')][_0x3bca('0x40')]){_0xd67e40[_0x3bca('0x41')]=[{'all':!![]}];}return db[_0x3bca('0x29')][_0x3bca('0x42')](_0xd67e40);})[_0x3bca('0x24')](function(_0x111133){_0x49997d[_0x3bca('0x43')]=_0x111133;return _0x49997d;})[_0x3bca('0x24')](respondWithFilteredResult(_0x289662,_0xd67e40))[_0x3bca('0x44')](handleError(_0x289662,null));};exports[_0x3bca('0x45')]=function(_0x3c57ab,_0x5c33b0){var _0x5514ab={'raw':![],'where':{'id':_0x3c57ab[_0x3bca('0x46')]['id']}},_0x12c252={};_0x12c252[_0x3bca('0x2d')]=_[_0x3bca('0x30')](db[_0x3bca('0x29')][_0x3bca('0x47')]);_0x12c252[_0x3bca('0x2f')]=_[_0x3bca('0x30')](_0x3c57ab[_0x3bca('0x2f')]);_0x12c252['filters']=_[_0x3bca('0x32')](_0x12c252[_0x3bca('0x2d')],_0x12c252[_0x3bca('0x2f')]);_0x5514ab[_0x3bca('0x33')]=_[_0x3bca('0x32')](_0x12c252[_0x3bca('0x2d')],qs[_0x3bca('0x34')](_0x3c57ab[_0x3bca('0x2f')][_0x3bca('0x34')]));_0x5514ab['attributes']=_0x5514ab[_0x3bca('0x33')]['length']?_0x5514ab['attributes']:_0x12c252[_0x3bca('0x2d')];if(_0x3c57ab['query']['includeAll']){_0x5514ab['include']=[{'all':!![]}];}_0x5514ab=_['merge']({},_0x5514ab,_0x3c57ab['options']);return db[_0x3bca('0x29')]['find'](_0x5514ab)['then'](handleEntityNotFound(_0x5c33b0,null))[_0x3bca('0x24')](respondWithResult(_0x5c33b0,null))[_0x3bca('0x44')](handleError(_0x5c33b0,null));};exports[_0x3bca('0x48')]=function(_0x1f2f4c,_0x1a98e3){return db[_0x3bca('0x29')][_0x3bca('0x48')](_0x1f2f4c[_0x3bca('0x49')],{})[_0x3bca('0x24')](respondWithResult(_0x1a98e3,0xc9))['catch'](handleError(_0x1a98e3,null));};exports[_0x3bca('0x22')]=function(_0x5abc0a,_0x5c13ec){if(_0x5abc0a[_0x3bca('0x49')]['id']){delete _0x5abc0a[_0x3bca('0x49')]['id'];}return db[_0x3bca('0x29')][_0x3bca('0x4a')]({'where':{'id':_0x5abc0a['params']['id']}})[_0x3bca('0x24')](handleEntityNotFound(_0x5c13ec,null))[_0x3bca('0x24')](saveUpdates(_0x5abc0a[_0x3bca('0x49')],null))[_0x3bca('0x24')](respondWithResult(_0x5c13ec,null))[_0x3bca('0x44')](handleError(_0x5c13ec,null));};exports[_0x3bca('0x23')]=function(_0x28eb69,_0x1e6464){return db[_0x3bca('0x29')][_0x3bca('0x4a')]({'where':{'id':_0x28eb69[_0x3bca('0x46')]['id']}})[_0x3bca('0x24')](handleEntityNotFound(_0x1e6464,null))[_0x3bca('0x24')](removeEntity(_0x1e6464,null))[_0x3bca('0x44')](handleError(_0x1e6464,null));};exports['getConfigurations']=function(_0x274218,_0x52f321,_0x31df82){var _0x1f1713={};var _0x351588={};var _0x4619ce;var _0x38e634;return db['FreshsalesAccount'][_0x3bca('0x4b')]({'where':{'id':_0x274218[_0x3bca('0x46')]['id']}})[_0x3bca('0x24')](handleEntityNotFound(_0x52f321,null))[_0x3bca('0x24')](function(_0x48ab4d){if(_0x48ab4d){_0x4619ce=_0x48ab4d;_0x351588[_0x3bca('0x2d')]=_[_0x3bca('0x30')](db[_0x3bca('0x4c')]['rawAttributes']);_0x351588[_0x3bca('0x2f')]=_['keys'](_0x274218[_0x3bca('0x2f')]);_0x351588['filters']=_['intersection'](_0x351588[_0x3bca('0x2d')],_0x351588[_0x3bca('0x2f')]);_0x1f1713[_0x3bca('0x33')]=_[_0x3bca('0x32')](_0x351588['model'],qs[_0x3bca('0x34')](_0x274218['query'][_0x3bca('0x34')]));_0x1f1713[_0x3bca('0x33')]=_0x1f1713[_0x3bca('0x33')][_0x3bca('0x35')]?_0x1f1713[_0x3bca('0x33')]:_0x351588[_0x3bca('0x2d')];_0x1f1713[_0x3bca('0x38')]=qs[_0x3bca('0x39')](_0x274218[_0x3bca('0x2f')][_0x3bca('0x39')]);_0x1f1713[_0x3bca('0x3a')]=qs[_0x3bca('0x31')](_[_0x3bca('0x3b')](_0x274218[_0x3bca('0x2f')],_0x351588['filters']));if(_0x274218[_0x3bca('0x2f')][_0x3bca('0x3c')]){_0x1f1713['where']=_[_0x3bca('0x3e')](_0x1f1713['where'],{'$or':_['map'](_0x1f1713[_0x3bca('0x33')],function(_0x195274){var _0x52ebfd={};_0x52ebfd[_0x195274]={'$like':'%'+_0x274218[_0x3bca('0x2f')]['filter']+'%'};return _0x52ebfd;})});}_0x1f1713=_[_0x3bca('0x3e')]({},_0x1f1713,_0x274218[_0x3bca('0x3f')]);return _0x4619ce[_0x3bca('0x4d')](_0x1f1713);}})[_0x3bca('0x24')](function(_0x3e0b72){if(_0x3e0b72){_0x38e634=_0x3e0b72[_0x3bca('0x35')];if(!_0x274218['query'][_0x3bca('0x36')](_0x3bca('0x37'))){_0x1f1713[_0x3bca('0x1d')]=qs[_0x3bca('0x1d')](_0x274218[_0x3bca('0x2f')][_0x3bca('0x1d')]);_0x1f1713[_0x3bca('0x1a')]=qs[_0x3bca('0x1a')](_0x274218['query'][_0x3bca('0x1a')]);}return _0x4619ce[_0x3bca('0x4d')](_0x1f1713);}})[_0x3bca('0x24')](function(_0x22f8b1){if(_0x22f8b1){return _0x22f8b1?{'count':_0x38e634,'rows':_0x22f8b1}:null;}})[_0x3bca('0x24')](respondWithResult(_0x52f321,null))['catch'](handleError(_0x52f321,null));};exports[_0x3bca('0x4e')]=function(_0x2ef92b,_0xdada8b,_0x582a02){if(_0x2ef92b['body']['id']){delete _0x2ef92b[_0x3bca('0x49')]['id'];}return db[_0x3bca('0x29')]['findOne']({'where':{'id':_0x2ef92b[_0x3bca('0x46')]['id']}})['then'](handleEntityNotFound(_0xdada8b,null))[_0x3bca('0x24')](function(_0x30c599){if(_0x30c599){_0x2ef92b['body'][_0x3bca('0x4f')]=_0x30c599['id'];_0x2ef92b[_0x3bca('0x49')][_0x3bca('0x50')]=integrations['getSubjects'](_0x2ef92b['body'][_0x3bca('0x51')],_0x2ef92b['body'][_0x3bca('0x2b')]);_0x2ef92b['body'][_0x3bca('0x52')]=integrations[_0x3bca('0x53')](_0x2ef92b[_0x3bca('0x49')][_0x3bca('0x51')],_0x2ef92b[_0x3bca('0x49')]['type']);return db['FreshsalesConfiguration'][_0x3bca('0x48')](_0x2ef92b['body'],{'include':[{'model':db[_0x3bca('0x54')],'as':_0x3bca('0x50')},{'model':db[_0x3bca('0x54')],'as':_0x3bca('0x52')}]});}return null;})[_0x3bca('0x24')](respondWithResult(_0xdada8b,null))[_0x3bca('0x44')](handleError(_0xdada8b,null));};exports['getFields']=function(_0x313183,_0x80f7a2,_0x2b9921){var _0x57acac='';var _0x2c9cc3='';return db['FreshsalesAccount']['findOne']({'where':{'id':_0x313183[_0x3bca('0x46')]['id']},'attributes':['id','username','remoteUri',_0x3bca('0x55')]})[_0x3bca('0x24')](handleEntityNotFound(_0x80f7a2,null))[_0x3bca('0x24')](function(_0x350aca){if(_0x350aca){_0x2c9cc3=_0x350aca['username'];_0x57acac=_0x350aca[_0x3bca('0x56')];var _0x318198=_0x350aca[_0x3bca('0x56')][_0x3bca('0x57')](-0x1);if(_0x318198==='/'){_0x57acac=_0x57acac[_0x3bca('0x58')](0x0,_0x57acac[_0x3bca('0x59')](_0x318198));}return rp({'method':'GET','uri':util[_0x3bca('0x5a')]('%s%s',_0x57acac,_0x3bca('0x5b')),'headers':{'Authorization':_0x3bca('0x5c')+_0x350aca[_0x3bca('0x55')]},'json':!![]});}})[_0x3bca('0x24')](function(_0x4ad409){if(_0x4ad409){var _0x3378be=_0x4ad409[_0x3bca('0x5d')];var _0x438f15=![];var _0x2bad02=null;for(_0x2bad02=0x0;_0x2bad02<_0x3378be[_0x3bca('0x35')];_0x2bad02++){if(_0x3378be[_0x2bad02]['email']===_0x2c9cc3){_0x438f15=!![];}}if(_0x438f15){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x3bca('0x5e')});}}})[_0x3bca('0x24')](respondWithResult(_0x80f7a2,null))['catch'](function(_0x31fc9f){var _0x3933fa=_0x313183[_0x3bca('0x2f')]['test']?0x1f4:_0x31fc9f[_0x3bca('0x5f')]||0x1f4;logger[_0x3bca('0x26')]('getFields,\x20%s,\x20%s,\x20%s',_0x3bca('0x60'),_0x3933fa,JSON[_0x3bca('0x61')](_0x31fc9f));delete _0x31fc9f[_0x3bca('0x28')];if(_0x3933fa===0x191){_0x3933fa=0x190;}_0x80f7a2[_0x3bca('0x18')](_0x3933fa)['send'](_0x313183['query'][_0x3bca('0x62')]?{'message':_0x3bca('0x63'),'statusCode':_0x31fc9f[_0x3bca('0x5f')]}:_0x31fc9f);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index f2abe96..8775373 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 _0x4745=['path','rimraf','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','FreshsalesAccount','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x18caef,_0x2e3b38){var _0x1a5804=function(_0x45c602){while(--_0x45c602){_0x18caef['push'](_0x18caef['shift']());}};_0x1a5804(++_0x2e3b38);}(_0x4745,0x1e7));var _0x5474=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0x4745[_0x1b828b];return _0x98da1a;};'use strict';var _=require(_0x5474('0x0'));var util=require(_0x5474('0x1'));var logger=require(_0x5474('0x2'))(_0x5474('0x3'));var moment=require(_0x5474('0x4'));var BPromise=require(_0x5474('0x5'));var rp=require(_0x5474('0x6'));var fs=require('fs');var path=require(_0x5474('0x7'));var rimraf=require(_0x5474('0x8'));var config=require(_0x5474('0x9'));var attributes=require(_0x5474('0xa'));var integrations=require(_0x5474('0xb'));module['exports']=function(_0x3d1e1,_0x431f81){return _0x3d1e1['define'](_0x5474('0xc'),attributes,{'tableName':'int_freshsales_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xafb9=['moment','bluebird','request-promise','path','rimraf','../../components/integrations/configuration','FreshsalesAccount','int_freshsales_accounts','lodash','util','../../config/logger','api'];(function(_0x455d30,_0x5b6a21){var _0x504b56=function(_0x2c5fd9){while(--_0x2c5fd9){_0x455d30['push'](_0x455d30['shift']());}};_0x504b56(++_0x5b6a21);}(_0xafb9,0x68));var _0x9afb=function(_0x82d37e,_0x1fbd2b){_0x82d37e=_0x82d37e-0x0;var _0x5c0a5b=_0xafb9[_0x82d37e];return _0x5c0a5b;};'use strict';var _=require(_0x9afb('0x0'));var util=require(_0x9afb('0x1'));var logger=require(_0x9afb('0x2'))(_0x9afb('0x3'));var moment=require(_0x9afb('0x4'));var BPromise=require(_0x9afb('0x5'));var rp=require(_0x9afb('0x6'));var fs=require('fs');var path=require(_0x9afb('0x7'));var rimraf=require(_0x9afb('0x8'));var config=require('../../config/environment');var attributes=require('./intFreshsalesAccount.attributes');var integrations=require(_0x9afb('0x9'));module['exports']=function(_0x1ccf93,_0x548b24){return _0x1ccf93['define'](_0x9afb('0xa'),attributes,{'tableName':_0x9afb('0xb'),'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 7be0fb0..8e31e13 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 _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(_0x378952,_0x3ca0a0){var _0x5c4582=function(_0x147826){while(--_0x147826){_0x378952['push'](_0x378952['shift']());}};_0x5c4582(++_0x3ca0a0);}(_0x2a07,0x74));var _0x72a0=function(_0x5a2299,_0x3e2922){_0x5a2299=_0x5a2299-0x0;var _0xedff0f=_0x2a07[_0x5a2299];return _0xedff0f;};'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 +var _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','GetFreshsalesAccount','findAll','options','raw','where','attributes','limit','include','map','model','FreshsalesAccount','lodash','util'];(function(_0x161cdb,_0x30dc13){var _0x4f51f8=function(_0x25eb42){while(--_0x25eb42){_0x161cdb['push'](_0x161cdb['shift']());}};_0x4f51f8(++_0x30dc13);}(_0xdb28,0x106));var _0x8db2=function(_0x5cba13,_0x117521){_0x5cba13=_0x5cba13-0x0;var _0x4e3572=_0xdb28[_0x5cba13];return _0x4e3572;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('FreshsalesAccount,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});}exports[_0x8db2('0x16')]=function(_0x3fddc2){var _0x2efd06=this;return new Promise(function(_0x46ce14,_0x51d60d){return db['FreshsalesAccount'][_0x8db2('0x17')]({'raw':_0x3fddc2[_0x8db2('0x18')]?_0x3fddc2[_0x8db2('0x18')][_0x8db2('0x19')]===undefined?!![]:![]:!![],'where':_0x3fddc2['options']?_0x3fddc2[_0x8db2('0x18')][_0x8db2('0x1a')]||null:null,'attributes':_0x3fddc2[_0x8db2('0x18')]?_0x3fddc2[_0x8db2('0x18')][_0x8db2('0x1b')]||null:null,'limit':_0x3fddc2['options']?_0x3fddc2[_0x8db2('0x18')][_0x8db2('0x1c')]||null:null,'include':_0x3fddc2[_0x8db2('0x18')]?_0x3fddc2[_0x8db2('0x18')][_0x8db2('0x1d')]?_[_0x8db2('0x1e')](_0x3fddc2[_0x8db2('0x18')]['include'],function(_0x256202){return{'model':db[_0x256202['model']],'as':_0x256202['as'],'attributes':_0x256202['attributes'],'include':_0x256202['include']?_['map'](_0x256202[_0x8db2('0x1d')],function(_0x29b5cd){return{'model':db[_0x29b5cd[_0x8db2('0x1f')]],'as':_0x29b5cd['as'],'attributes':_0x29b5cd[_0x8db2('0x1b')],'include':_0x29b5cd[_0x8db2('0x1d')]?_[_0x8db2('0x1e')](_0x29b5cd['include'],function(_0x3544ba){return{'model':db[_0x3544ba[_0x8db2('0x1f')]],'as':_0x3544ba['as'],'attributes':_0x3544ba[_0x8db2('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x8db2('0xc')](function(_0x483aee){logger[_0x8db2('0x14')](_0x8db2('0x16'),_0x3fddc2);logger[_0x8db2('0xf')](_0x8db2('0x16'),_0x3fddc2,JSON[_0x8db2('0x10')](_0x483aee));_0x46ce14(_0x483aee);})[_0x8db2('0x15')](function(_0xa54ea3){logger[_0x8db2('0x11')](_0x8db2('0x16'),_0xa54ea3['message'],_0x3fddc2);_0x51d60d(_0x2efd06[_0x8db2('0x11')](0x1f4,_0xa54ea3['message']));});});};exports['ShowFreshsalesAccount']=function(_0x302188){var _0x25ed2c=this;return new Promise(function(_0xcc8a66,_0x49b2b3){return db[_0x8db2('0x20')]['find']({'raw':_0x302188[_0x8db2('0x18')]?_0x302188[_0x8db2('0x18')][_0x8db2('0x19')]===undefined?!![]:![]:!![],'where':_0x302188['options']?_0x302188['options'][_0x8db2('0x1a')]||null:null,'attributes':_0x302188[_0x8db2('0x18')]?_0x302188['options']['attributes']||null:null,'include':_0x302188[_0x8db2('0x18')]?_0x302188[_0x8db2('0x18')][_0x8db2('0x1d')]?_[_0x8db2('0x1e')](_0x302188[_0x8db2('0x18')][_0x8db2('0x1d')],function(_0x101711){return{'model':db[_0x101711[_0x8db2('0x1f')]],'as':_0x101711['as'],'attributes':_0x101711[_0x8db2('0x1b')],'include':_0x101711[_0x8db2('0x1d')]?_['map'](_0x101711[_0x8db2('0x1d')],function(_0x304a72){return{'model':db[_0x304a72['model']],'as':_0x304a72['as'],'attributes':_0x304a72[_0x8db2('0x1b')],'include':_0x304a72[_0x8db2('0x1d')]?_['map'](_0x304a72['include'],function(_0x3c1983){return{'model':db[_0x3c1983['model']],'as':_0x3c1983['as'],'attributes':_0x3c1983[_0x8db2('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x8db2('0xc')](function(_0x26717d){logger[_0x8db2('0x14')]('ShowFreshsalesAccount',_0x302188);logger[_0x8db2('0xf')]('ShowFreshsalesAccount',_0x302188,JSON[_0x8db2('0x10')](_0x26717d));_0xcc8a66(_0x26717d);})[_0x8db2('0x15')](function(_0x2c8bc9){logger[_0x8db2('0x11')]('ShowFreshsalesAccount',_0x2c8bc9['message'],_0x302188);_0x49b2b3(_0x25ed2c[_0x8db2('0x11')](0x1f4,_0x2c8bc9[_0x8db2('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index aa3e386..a8ee92d 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 _0x4d9f=['./intFreshsalesConfiguration.controller','get','isAuthenticated','index','/:id/subjects','getSubjects','/:id/descriptions','/:id/fields','getFields','post','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment'];(function(_0x24485f,_0x104f12){var _0x4a91f9=function(_0x9ec45f){while(--_0x9ec45f){_0x24485f['push'](_0x24485f['shift']());}};_0x4a91f9(++_0x104f12);}(_0x4d9f,0x143));var _0xf4d9=function(_0x4dde1d,_0x2f0f7e){_0x4dde1d=_0x4dde1d-0x0;var _0x440160=_0x4d9f[_0x4dde1d];return _0x440160;};'use strict';var multer=require(_0xf4d9('0x0'));var util=require(_0xf4d9('0x1'));var path=require(_0xf4d9('0x2'));var timeout=require(_0xf4d9('0x3'));var express=require(_0xf4d9('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xf4d9('0x5'));var config=require(_0xf4d9('0x6'));var controller=require(_0xf4d9('0x7'));router[_0xf4d9('0x8')]('/',auth[_0xf4d9('0x9')](),controller[_0xf4d9('0xa')]);router[_0xf4d9('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xf4d9('0x8')](_0xf4d9('0xb'),auth[_0xf4d9('0x9')](),controller[_0xf4d9('0xc')]);router[_0xf4d9('0x8')](_0xf4d9('0xd'),auth['isAuthenticated'](),controller['getDescriptions']);router[_0xf4d9('0x8')](_0xf4d9('0xe'),auth[_0xf4d9('0x9')](),controller[_0xf4d9('0xf')]);router[_0xf4d9('0x10')]('/',auth[_0xf4d9('0x9')](),controller['create']);router[_0xf4d9('0x11')](_0xf4d9('0x12'),auth['isAuthenticated'](),controller['update']);router[_0xf4d9('0x13')](_0xf4d9('0x12'),auth['isAuthenticated'](),controller[_0xf4d9('0x14')]);module[_0xf4d9('0x15')]=router; \ No newline at end of file +var _0x2bf9=['/:id','show','/:id/subjects','/:id/descriptions','getDescriptions','/:id/fields','post','create','update','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated','index'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x2bf9,0x15c));var _0x92bf=function(_0x12a020,_0x85b476){_0x12a020=_0x12a020-0x0;var _0x63cddd=_0x2bf9[_0x12a020];return _0x63cddd;};'use strict';var multer=require(_0x92bf('0x0'));var util=require('util');var path=require(_0x92bf('0x1'));var timeout=require('connect-timeout');var express=require(_0x92bf('0x2'));var router=express[_0x92bf('0x3')]();var fs_extra=require(_0x92bf('0x4'));var auth=require(_0x92bf('0x5'));var interaction=require(_0x92bf('0x6'));var config=require(_0x92bf('0x7'));var controller=require(_0x92bf('0x8'));router[_0x92bf('0x9')]('/',auth[_0x92bf('0xa')](),controller[_0x92bf('0xb')]);router[_0x92bf('0x9')](_0x92bf('0xc'),auth[_0x92bf('0xa')](),controller[_0x92bf('0xd')]);router['get'](_0x92bf('0xe'),auth[_0x92bf('0xa')](),controller['getSubjects']);router[_0x92bf('0x9')](_0x92bf('0xf'),auth[_0x92bf('0xa')](),controller[_0x92bf('0x10')]);router[_0x92bf('0x9')](_0x92bf('0x11'),auth[_0x92bf('0xa')](),controller['getFields']);router[_0x92bf('0x12')]('/',auth[_0x92bf('0xa')](),controller[_0x92bf('0x13')]);router['put'](_0x92bf('0xc'),auth[_0x92bf('0xa')](),controller[_0x92bf('0x14')]);router[_0x92bf('0x15')](_0x92bf('0xc'),auth[_0x92bf('0xa')](),controller[_0x92bf('0x16')]);module[_0x92bf('0x17')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index 93a843c..0417608 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 _0xe98a=['STRING','sequelize','exports'];(function(_0x1f17a4,_0x14835f){var _0x25c52a=function(_0x3205c9){while(--_0x3205c9){_0x1f17a4['push'](_0x1f17a4['shift']());}};_0x25c52a(++_0x14835f);}(_0xe98a,0x124));var _0xae98=function(_0x4b784d,_0x5efb2f){_0x4b784d=_0x4b784d-0x0;var _0x2cdeaf=_0xe98a[_0x4b784d];return _0x2cdeaf;};'use strict';var Sequelize=require(_0xae98('0x0'));module[_0xae98('0x1')]={'name':{'type':Sequelize[_0xae98('0x2')]},'description':{'type':Sequelize[_0xae98('0x2')]}}; \ No newline at end of file +var _0x958f=['STRING','sequelize','exports'];(function(_0x2ee665,_0x577a1c){var _0x2f89f6=function(_0x1c1fcc){while(--_0x1c1fcc){_0x2ee665['push'](_0x2ee665['shift']());}};_0x2f89f6(++_0x577a1c);}(_0x958f,0x1de));var _0xf958=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0x958f[_0x4ae6ef];return _0x3cbb4e;};'use strict';var Sequelize=require(_0xf958('0x0'));module[_0xf958('0x1')]={'name':{'type':Sequelize[_0xf958('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 d8d922c..a545d2e 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 _0x7f89=['querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','reject','save','update','then','destroy','error','stack','name','send','index','FreshsalesConfiguration','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','filter','merge','where','map','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','body','getSubjects','findOne','FreshsalesField','pick','hasOwnProperty','getDescriptions','getFields','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto'];(function(_0x31075b,_0x3c5b46){var _0x3c6588=function(_0x1ec6ef){while(--_0x1ec6ef){_0x31075b['push'](_0x31075b['shift']());}};_0x3c6588(++_0x3c5b46);}(_0x7f89,0x1c6));var _0x97f8=function(_0x565c4e,_0x1e77f9){_0x565c4e=_0x565c4e-0x0;var _0x4a167f=_0x7f89[_0x565c4e];return _0x4a167f;};'use strict';var emlformat=require(_0x97f8('0x0'));var rimraf=require(_0x97f8('0x1'));var zipdir=require(_0x97f8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x97f8('0x3'));var moment=require(_0x97f8('0x4'));var BPromise=require(_0x97f8('0x5'));var Mustache=require(_0x97f8('0x6'));var util=require('util');var path=require(_0x97f8('0x7'));var sox=require(_0x97f8('0x8'));var csv=require(_0x97f8('0x9'));var ejs=require(_0x97f8('0xa'));var fs=require('fs');var fs_extra=require(_0x97f8('0xb'));var _=require(_0x97f8('0xc'));var squel=require('squel');var crypto=require(_0x97f8('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x97f8('0x9'));var querystring=require(_0x97f8('0xe'));var Papa=require(_0x97f8('0xf'));var Redis=require(_0x97f8('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x97f8('0x11'));var as=require(_0x97f8('0x12'));var hardwareService=require(_0x97f8('0x13'));var logger=require(_0x97f8('0x14'))('api');var utils=require(_0x97f8('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x97f8('0x16'));var db=require(_0x97f8('0x17'))['db'];function respondWithStatusCode(_0x5ae6b4,_0x4485c1){_0x4485c1=_0x4485c1||0xcc;return function(_0x4a1471){if(_0x4a1471){return _0x5ae6b4[_0x97f8('0x18')](_0x4485c1);}return _0x5ae6b4[_0x97f8('0x19')](_0x4485c1)[_0x97f8('0x1a')]();};}function respondWithResult(_0x3908aa,_0x573c0c){_0x573c0c=_0x573c0c||0xc8;return function(_0x23f5da){if(_0x23f5da){return _0x3908aa[_0x97f8('0x19')](_0x573c0c)[_0x97f8('0x1b')](_0x23f5da);}};}function respondWithFilteredResult(_0x470405,_0x32a6a8){return function(_0x4d8d36){if(_0x4d8d36){var _0x10b9bb=typeof _0x32a6a8[_0x97f8('0x1c')]===_0x97f8('0x1d')&&typeof _0x32a6a8[_0x97f8('0x1e')]===_0x97f8('0x1d');var _0x3c7615=_0x4d8d36[_0x97f8('0x1f')];var _0x3a026f=_0x10b9bb?0x0:_0x32a6a8[_0x97f8('0x1c')];var _0x3a24f0=_0x10b9bb?_0x4d8d36['count']:_0x32a6a8[_0x97f8('0x1c')]+_0x32a6a8[_0x97f8('0x1e')];var _0x2fce38;if(_0x3a24f0>=_0x3c7615){_0x3a24f0=_0x3c7615;_0x2fce38=0xc8;}else{_0x2fce38=0xce;}_0x470405['status'](_0x2fce38);return _0x470405['set']('Content-Range',_0x3a026f+'-'+_0x3a24f0+'/'+_0x3c7615)['json'](_0x4d8d36);}return null;};}function patchUpdates(_0x3e9b52){return function(_0xc2dcae){try{jsonpatch['apply'](_0xc2dcae,_0x3e9b52,!![]);}catch(_0x34133b){return BPromise[_0x97f8('0x20')](_0x34133b);}return _0xc2dcae[_0x97f8('0x21')]();};}function saveUpdates(_0x188ffc,_0x9be161){return function(_0x2371d6){if(_0x2371d6){return _0x2371d6[_0x97f8('0x22')](_0x188ffc)[_0x97f8('0x23')](function(_0xec94cb){return _0xec94cb;});}return null;};}function removeEntity(_0x1fb03e,_0x469834){return function(_0x1c7a09){if(_0x1c7a09){return _0x1c7a09[_0x97f8('0x24')]()[_0x97f8('0x23')](function(){_0x1fb03e[_0x97f8('0x19')](0xcc)[_0x97f8('0x1a')]();});}};}function handleEntityNotFound(_0x4bcca1,_0x4ca1cc){return function(_0x3ea9ad){if(!_0x3ea9ad){_0x4bcca1[_0x97f8('0x18')](0x194);}return _0x3ea9ad;};}function handleError(_0x15e21c,_0x1a4b8f){_0x1a4b8f=_0x1a4b8f||0x1f4;return function(_0x8d7d66){logger[_0x97f8('0x25')](_0x8d7d66[_0x97f8('0x26')]);if(_0x8d7d66['name']){delete _0x8d7d66[_0x97f8('0x27')];}_0x15e21c[_0x97f8('0x19')](_0x1a4b8f)[_0x97f8('0x28')](_0x8d7d66);};}exports[_0x97f8('0x29')]=function(_0x1f84f5,_0x3a92c7){var _0x522d54={},_0x140747={},_0x366875={'count':0x0,'rows':[]};var _0x1552bd=_['map'](db[_0x97f8('0x2a')][_0x97f8('0x2b')],function(_0x5d0461){return{'name':_0x5d0461['fieldName'],'type':_0x5d0461[_0x97f8('0x2c')][_0x97f8('0x2d')]};});_0x140747['model']=_['map'](_0x1552bd,_0x97f8('0x27'));_0x140747[_0x97f8('0x2e')]=_[_0x97f8('0x2f')](_0x1f84f5[_0x97f8('0x2e')]);_0x140747[_0x97f8('0x30')]=_[_0x97f8('0x31')](_0x140747[_0x97f8('0x32')],_0x140747['query']);_0x522d54[_0x97f8('0x33')]=_[_0x97f8('0x31')](_0x140747[_0x97f8('0x32')],qs[_0x97f8('0x34')](_0x1f84f5[_0x97f8('0x2e')][_0x97f8('0x34')]));_0x522d54[_0x97f8('0x33')]=_0x522d54[_0x97f8('0x33')][_0x97f8('0x35')]?_0x522d54[_0x97f8('0x33')]:_0x140747[_0x97f8('0x32')];if(!_0x1f84f5[_0x97f8('0x2e')]['hasOwnProperty'](_0x97f8('0x36'))){_0x522d54[_0x97f8('0x1e')]=qs[_0x97f8('0x1e')](_0x1f84f5[_0x97f8('0x2e')][_0x97f8('0x1e')]);_0x522d54[_0x97f8('0x1c')]=qs[_0x97f8('0x1c')](_0x1f84f5[_0x97f8('0x2e')][_0x97f8('0x1c')]);}_0x522d54[_0x97f8('0x37')]=qs[_0x97f8('0x38')](_0x1f84f5[_0x97f8('0x2e')][_0x97f8('0x38')]);_0x522d54['where']=qs[_0x97f8('0x30')](_['pick'](_0x1f84f5[_0x97f8('0x2e')],_0x140747[_0x97f8('0x30')]),_0x1552bd);if(_0x1f84f5[_0x97f8('0x2e')][_0x97f8('0x39')]){_0x522d54['where']=_[_0x97f8('0x3a')](_0x522d54[_0x97f8('0x3b')],{'$or':_[_0x97f8('0x3c')](_0x1552bd,function(_0x24735e){if(_0x24735e[_0x97f8('0x2c')]!==_0x97f8('0x3d')){var _0x5f29dd={};_0x5f29dd[_0x24735e[_0x97f8('0x27')]]={'$like':'%'+_0x1f84f5[_0x97f8('0x2e')]['filter']+'%'};return _0x5f29dd;}})});}_0x522d54=_['merge']({},_0x522d54,_0x1f84f5[_0x97f8('0x3e')]);var _0xad0ed5={'where':_0x522d54['where']};return db[_0x97f8('0x2a')][_0x97f8('0x1f')](_0xad0ed5)[_0x97f8('0x23')](function(_0xdb7f91){_0x366875[_0x97f8('0x1f')]=_0xdb7f91;if(_0x1f84f5[_0x97f8('0x2e')][_0x97f8('0x3f')]){_0x522d54[_0x97f8('0x40')]=[{'all':!![]}];}return db[_0x97f8('0x2a')][_0x97f8('0x41')](_0x522d54);})[_0x97f8('0x23')](function(_0x59c5ac){_0x366875[_0x97f8('0x42')]=_0x59c5ac;return _0x366875;})[_0x97f8('0x23')](respondWithFilteredResult(_0x3a92c7,_0x522d54))[_0x97f8('0x43')](handleError(_0x3a92c7,null));};exports['show']=function(_0x2a5b69,_0x93ffbc){var _0x4e530f={'raw':![],'where':{'id':_0x2a5b69[_0x97f8('0x44')]['id']}},_0x4560cc={};_0x4560cc['model']=_[_0x97f8('0x2f')](db['FreshsalesConfiguration'][_0x97f8('0x2b')]);_0x4560cc[_0x97f8('0x2e')]=_['keys'](_0x2a5b69['query']);_0x4560cc[_0x97f8('0x30')]=_[_0x97f8('0x31')](_0x4560cc[_0x97f8('0x32')],_0x4560cc[_0x97f8('0x2e')]);_0x4e530f['attributes']=_[_0x97f8('0x31')](_0x4560cc[_0x97f8('0x32')],qs['fields'](_0x2a5b69[_0x97f8('0x2e')][_0x97f8('0x34')]));_0x4e530f[_0x97f8('0x33')]=_0x4e530f[_0x97f8('0x33')]['length']?_0x4e530f[_0x97f8('0x33')]:_0x4560cc['model'];if(_0x2a5b69[_0x97f8('0x2e')]['includeAll']){_0x4e530f[_0x97f8('0x40')]=[{'all':!![]}];}_0x4e530f=_['merge']({},_0x4e530f,_0x2a5b69[_0x97f8('0x3e')]);return db['FreshsalesConfiguration'][_0x97f8('0x45')](_0x4e530f)['then'](handleEntityNotFound(_0x93ffbc,null))[_0x97f8('0x23')](respondWithResult(_0x93ffbc,null))[_0x97f8('0x43')](handleError(_0x93ffbc,null));};exports['create']=function(_0xa773fe,_0x14dfe5){return db[_0x97f8('0x2a')]['create'](_0xa773fe[_0x97f8('0x46')],{})[_0x97f8('0x23')](respondWithResult(_0x14dfe5,0xc9))[_0x97f8('0x43')](handleError(_0x14dfe5,null));};exports[_0x97f8('0x22')]=function(_0x20dd5b,_0x3450b4){if(_0x20dd5b[_0x97f8('0x46')]['id']){delete _0x20dd5b[_0x97f8('0x46')]['id'];}return db[_0x97f8('0x2a')][_0x97f8('0x45')]({'where':{'id':_0x20dd5b[_0x97f8('0x44')]['id']}})[_0x97f8('0x23')](handleEntityNotFound(_0x3450b4,null))[_0x97f8('0x23')](saveUpdates(_0x20dd5b[_0x97f8('0x46')],null))['then'](respondWithResult(_0x3450b4,null))[_0x97f8('0x43')](handleError(_0x3450b4,null));};exports[_0x97f8('0x24')]=function(_0x15944b,_0x1edc1b){return db[_0x97f8('0x2a')][_0x97f8('0x45')]({'where':{'id':_0x15944b[_0x97f8('0x44')]['id']}})[_0x97f8('0x23')](handleEntityNotFound(_0x1edc1b,null))[_0x97f8('0x23')](removeEntity(_0x1edc1b,null))[_0x97f8('0x43')](handleError(_0x1edc1b,null));};exports[_0x97f8('0x47')]=function(_0x5ed0e9,_0x4f8097,_0x58956b){var _0x3114b2={};var _0x100fc4={};var _0x425830;var _0x54fc96;return db['FreshsalesConfiguration'][_0x97f8('0x48')]({'where':{'id':_0x5ed0e9[_0x97f8('0x44')]['id']}})[_0x97f8('0x23')](handleEntityNotFound(_0x4f8097,null))[_0x97f8('0x23')](function(_0x460a88){if(_0x460a88){_0x425830=_0x460a88;_0x100fc4['model']=_[_0x97f8('0x2f')](db[_0x97f8('0x49')][_0x97f8('0x2b')]);_0x100fc4[_0x97f8('0x2e')]=_[_0x97f8('0x2f')](_0x5ed0e9['query']);_0x100fc4[_0x97f8('0x30')]=_['intersection'](_0x100fc4[_0x97f8('0x32')],_0x100fc4[_0x97f8('0x2e')]);_0x3114b2[_0x97f8('0x33')]=_[_0x97f8('0x31')](_0x100fc4[_0x97f8('0x32')],qs[_0x97f8('0x34')](_0x5ed0e9[_0x97f8('0x2e')]['fields']));_0x3114b2[_0x97f8('0x33')]=_0x3114b2[_0x97f8('0x33')][_0x97f8('0x35')]?_0x3114b2['attributes']:_0x100fc4[_0x97f8('0x32')];_0x3114b2[_0x97f8('0x37')]=qs[_0x97f8('0x38')](_0x5ed0e9[_0x97f8('0x2e')]['sort']);_0x3114b2[_0x97f8('0x3b')]=qs[_0x97f8('0x30')](_[_0x97f8('0x4a')](_0x5ed0e9['query'],_0x100fc4[_0x97f8('0x30')]));if(_0x5ed0e9[_0x97f8('0x2e')][_0x97f8('0x39')]){_0x3114b2[_0x97f8('0x3b')]=_['merge'](_0x3114b2[_0x97f8('0x3b')],{'$or':_['map'](_0x3114b2['attributes'],function(_0x5137a0){var _0x58d911={};_0x58d911[_0x5137a0]={'$like':'%'+_0x5ed0e9['query'][_0x97f8('0x39')]+'%'};return _0x58d911;})});}_0x3114b2=_[_0x97f8('0x3a')]({},_0x3114b2,_0x5ed0e9['options']);return _0x425830['getSubjects'](_0x3114b2);}})[_0x97f8('0x23')](function(_0x431571){if(_0x431571){_0x54fc96=_0x431571[_0x97f8('0x35')];if(!_0x5ed0e9['query'][_0x97f8('0x4b')](_0x97f8('0x36'))){_0x3114b2[_0x97f8('0x1e')]=qs['limit'](_0x5ed0e9[_0x97f8('0x2e')]['limit']);_0x3114b2[_0x97f8('0x1c')]=qs[_0x97f8('0x1c')](_0x5ed0e9[_0x97f8('0x2e')]['offset']);}return _0x425830['getSubjects'](_0x3114b2);}})['then'](function(_0x4244c4){if(_0x4244c4){return _0x4244c4?{'count':_0x54fc96,'rows':_0x4244c4}:null;}})[_0x97f8('0x23')](respondWithResult(_0x4f8097,null))[_0x97f8('0x43')](handleError(_0x4f8097,null));};exports[_0x97f8('0x4c')]=function(_0x52ee1a,_0x14684f,_0x417c08){var _0x296835={};var _0x51ce0f={};var _0x4a2d09;var _0x4bf4f1;return db[_0x97f8('0x2a')][_0x97f8('0x48')]({'where':{'id':_0x52ee1a[_0x97f8('0x44')]['id']}})[_0x97f8('0x23')](handleEntityNotFound(_0x14684f,null))[_0x97f8('0x23')](function(_0xb19a43){if(_0xb19a43){_0x4a2d09=_0xb19a43;_0x51ce0f[_0x97f8('0x32')]=_['keys'](db['FreshsalesField']['rawAttributes']);_0x51ce0f[_0x97f8('0x2e')]=_['keys'](_0x52ee1a['query']);_0x51ce0f[_0x97f8('0x30')]=_[_0x97f8('0x31')](_0x51ce0f[_0x97f8('0x32')],_0x51ce0f[_0x97f8('0x2e')]);_0x296835[_0x97f8('0x33')]=_[_0x97f8('0x31')](_0x51ce0f[_0x97f8('0x32')],qs['fields'](_0x52ee1a[_0x97f8('0x2e')][_0x97f8('0x34')]));_0x296835[_0x97f8('0x33')]=_0x296835[_0x97f8('0x33')][_0x97f8('0x35')]?_0x296835[_0x97f8('0x33')]:_0x51ce0f[_0x97f8('0x32')];_0x296835[_0x97f8('0x37')]=qs['sort'](_0x52ee1a[_0x97f8('0x2e')][_0x97f8('0x38')]);_0x296835['where']=qs[_0x97f8('0x30')](_['pick'](_0x52ee1a[_0x97f8('0x2e')],_0x51ce0f[_0x97f8('0x30')]));if(_0x52ee1a['query'][_0x97f8('0x39')]){_0x296835['where']=_['merge'](_0x296835['where'],{'$or':_['map'](_0x296835[_0x97f8('0x33')],function(_0x5afab2){var _0xaedb63={};_0xaedb63[_0x5afab2]={'$like':'%'+_0x52ee1a[_0x97f8('0x2e')][_0x97f8('0x39')]+'%'};return _0xaedb63;})});}_0x296835=_[_0x97f8('0x3a')]({},_0x296835,_0x52ee1a[_0x97f8('0x3e')]);return _0x4a2d09['getDescriptions'](_0x296835);}})['then'](function(_0x12834){if(_0x12834){_0x4bf4f1=_0x12834[_0x97f8('0x35')];if(!_0x52ee1a['query'][_0x97f8('0x4b')]('nolimit')){_0x296835[_0x97f8('0x1e')]=qs[_0x97f8('0x1e')](_0x52ee1a[_0x97f8('0x2e')][_0x97f8('0x1e')]);_0x296835[_0x97f8('0x1c')]=qs[_0x97f8('0x1c')](_0x52ee1a[_0x97f8('0x2e')]['offset']);}return _0x4a2d09[_0x97f8('0x4c')](_0x296835);}})[_0x97f8('0x23')](function(_0x68036){if(_0x68036){return _0x68036?{'count':_0x4bf4f1,'rows':_0x68036}:null;}})[_0x97f8('0x23')](respondWithResult(_0x14684f,null))['catch'](handleError(_0x14684f,null));};exports[_0x97f8('0x4d')]=function(_0x3cdaf9,_0x430974,_0x318034){var _0x14a769={};var _0x3cb3f9={};var _0x13b209;var _0x13e0e6;return db[_0x97f8('0x2a')]['findOne']({'where':{'id':_0x3cdaf9[_0x97f8('0x44')]['id']}})[_0x97f8('0x23')](handleEntityNotFound(_0x430974,null))['then'](function(_0x5afc16){if(_0x5afc16){_0x13b209=_0x5afc16;_0x3cb3f9['model']=_['keys'](db[_0x97f8('0x49')][_0x97f8('0x2b')]);_0x3cb3f9[_0x97f8('0x2e')]=_['keys'](_0x3cdaf9['query']);_0x3cb3f9[_0x97f8('0x30')]=_['intersection'](_0x3cb3f9[_0x97f8('0x32')],_0x3cb3f9['query']);_0x14a769[_0x97f8('0x33')]=_[_0x97f8('0x31')](_0x3cb3f9[_0x97f8('0x32')],qs[_0x97f8('0x34')](_0x3cdaf9[_0x97f8('0x2e')][_0x97f8('0x34')]));_0x14a769[_0x97f8('0x33')]=_0x14a769[_0x97f8('0x33')][_0x97f8('0x35')]?_0x14a769[_0x97f8('0x33')]:_0x3cb3f9[_0x97f8('0x32')];_0x14a769[_0x97f8('0x37')]=qs[_0x97f8('0x38')](_0x3cdaf9[_0x97f8('0x2e')][_0x97f8('0x38')]);_0x14a769[_0x97f8('0x3b')]=qs['filters'](_[_0x97f8('0x4a')](_0x3cdaf9['query'],_0x3cb3f9[_0x97f8('0x30')]));if(_0x3cdaf9[_0x97f8('0x2e')][_0x97f8('0x39')]){_0x14a769[_0x97f8('0x3b')]=_[_0x97f8('0x3a')](_0x14a769['where'],{'$or':_[_0x97f8('0x3c')](_0x14a769[_0x97f8('0x33')],function(_0x2f42a2){var _0x1ea999={};_0x1ea999[_0x2f42a2]={'$like':'%'+_0x3cdaf9[_0x97f8('0x2e')][_0x97f8('0x39')]+'%'};return _0x1ea999;})});}_0x14a769=_[_0x97f8('0x3a')]({},_0x14a769,_0x3cdaf9[_0x97f8('0x3e')]);return _0x13b209[_0x97f8('0x4d')](_0x14a769);}})[_0x97f8('0x23')](function(_0x4ab8f6){if(_0x4ab8f6){_0x13e0e6=_0x4ab8f6[_0x97f8('0x35')];if(!_0x3cdaf9[_0x97f8('0x2e')][_0x97f8('0x4b')]('nolimit')){_0x14a769[_0x97f8('0x1e')]=qs['limit'](_0x3cdaf9[_0x97f8('0x2e')][_0x97f8('0x1e')]);_0x14a769[_0x97f8('0x1c')]=qs['offset'](_0x3cdaf9[_0x97f8('0x2e')][_0x97f8('0x1c')]);}return _0x13b209['getFields'](_0x14a769);}})[_0x97f8('0x23')](function(_0x44b6a8){if(_0x44b6a8){return _0x44b6a8?{'count':_0x13e0e6,'rows':_0x44b6a8}:null;}})[_0x97f8('0x23')](respondWithResult(_0x430974,null))[_0x97f8('0x43')](handleError(_0x430974,null));}; \ No newline at end of file +var _0x1201=['order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','rawAttributes','find','body','params','findOne','FreshsalesField','getSubjects','getDescriptions','getFields','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','lodash','squel','crypto','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','then','destroy','sendStatus','stack','name','index','map','FreshsalesConfiguration','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x47bb74,_0x18327d){var _0x20d466=function(_0x515969){while(--_0x515969){_0x47bb74['push'](_0x47bb74['shift']());}};_0x20d466(++_0x18327d);}(_0x1201,0x188));var _0x1120=function(_0x27bcf5,_0x236765){_0x27bcf5=_0x27bcf5-0x0;var _0x4ce4cf=_0x1201[_0x27bcf5];return _0x4ce4cf;};'use strict';var emlformat=require(_0x1120('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x1120('0x1'));var rp=require(_0x1120('0x2'));var moment=require(_0x1120('0x3'));var BPromise=require(_0x1120('0x4'));var Mustache=require(_0x1120('0x5'));var util=require(_0x1120('0x6'));var path=require('path');var sox=require(_0x1120('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1120('0x8'));var squel=require(_0x1120('0x9'));var crypto=require(_0x1120('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x1120('0xb'));var toCsv=require(_0x1120('0xc'));var querystring=require(_0x1120('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x1120('0xe'));var qs=require(_0x1120('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1120('0x10'));var logger=require(_0x1120('0x11'))('api');var utils=require(_0x1120('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x1120('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2b1cc1,_0x215511){_0x215511=_0x215511||0xcc;return function(_0x35c02b){if(_0x35c02b){return _0x2b1cc1['sendStatus'](_0x215511);}return _0x2b1cc1[_0x1120('0x14')](_0x215511)[_0x1120('0x15')]();};}function respondWithResult(_0x493f30,_0x57527b){_0x57527b=_0x57527b||0xc8;return function(_0x450e39){if(_0x450e39){return _0x493f30[_0x1120('0x14')](_0x57527b)[_0x1120('0x16')](_0x450e39);}};}function respondWithFilteredResult(_0x182dda,_0x56b4dd){return function(_0x3c7ee7){if(_0x3c7ee7){var _0x517ea2=typeof _0x56b4dd['offset']===_0x1120('0x17')&&typeof _0x56b4dd[_0x1120('0x18')]==='undefined';var _0x498a31=_0x3c7ee7['count'];var _0x79d062=_0x517ea2?0x0:_0x56b4dd[_0x1120('0x19')];var _0xa86b7=_0x517ea2?_0x3c7ee7[_0x1120('0x1a')]:_0x56b4dd[_0x1120('0x19')]+_0x56b4dd[_0x1120('0x18')];var _0x1c366c;if(_0xa86b7>=_0x498a31){_0xa86b7=_0x498a31;_0x1c366c=0xc8;}else{_0x1c366c=0xce;}_0x182dda[_0x1120('0x14')](_0x1c366c);return _0x182dda[_0x1120('0x1b')](_0x1120('0x1c'),_0x79d062+'-'+_0xa86b7+'/'+_0x498a31)[_0x1120('0x16')](_0x3c7ee7);}return null;};}function patchUpdates(_0x353427){return function(_0x33fc9f){try{jsonpatch[_0x1120('0x1d')](_0x33fc9f,_0x353427,!![]);}catch(_0x1df7d5){return BPromise['reject'](_0x1df7d5);}return _0x33fc9f[_0x1120('0x1e')]();};}function saveUpdates(_0x1e19dc,_0x2cbd9c){return function(_0x11a21a){if(_0x11a21a){return _0x11a21a[_0x1120('0x1f')](_0x1e19dc)[_0x1120('0x20')](function(_0x2bf370){return _0x2bf370;});}return null;};}function removeEntity(_0x34361a,_0x57bd65){return function(_0x71b475){if(_0x71b475){return _0x71b475[_0x1120('0x21')]()[_0x1120('0x20')](function(){_0x34361a[_0x1120('0x14')](0xcc)[_0x1120('0x15')]();});}};}function handleEntityNotFound(_0x2e1a2a,_0x16d454){return function(_0x2ce19d){if(!_0x2ce19d){_0x2e1a2a[_0x1120('0x22')](0x194);}return _0x2ce19d;};}function handleError(_0x5d598b,_0xc15584){_0xc15584=_0xc15584||0x1f4;return function(_0x338056){logger['error'](_0x338056[_0x1120('0x23')]);if(_0x338056[_0x1120('0x24')]){delete _0x338056[_0x1120('0x24')];}_0x5d598b[_0x1120('0x14')](_0xc15584)['send'](_0x338056);};}exports[_0x1120('0x25')]=function(_0x2a5d32,_0x4852a2){var _0x5a2f5c={},_0x45ebb0={},_0x48e6b2={'count':0x0,'rows':[]};var _0x5b0804=_[_0x1120('0x26')](db[_0x1120('0x27')]['rawAttributes'],function(_0x17145f){return{'name':_0x17145f[_0x1120('0x28')],'type':_0x17145f[_0x1120('0x29')]['key']};});_0x45ebb0['model']=_[_0x1120('0x26')](_0x5b0804,_0x1120('0x24'));_0x45ebb0[_0x1120('0x2a')]=_[_0x1120('0x2b')](_0x2a5d32[_0x1120('0x2a')]);_0x45ebb0[_0x1120('0x2c')]=_[_0x1120('0x2d')](_0x45ebb0[_0x1120('0x2e')],_0x45ebb0[_0x1120('0x2a')]);_0x5a2f5c[_0x1120('0x2f')]=_['intersection'](_0x45ebb0['model'],qs['fields'](_0x2a5d32[_0x1120('0x2a')][_0x1120('0x30')]));_0x5a2f5c[_0x1120('0x2f')]=_0x5a2f5c[_0x1120('0x2f')][_0x1120('0x31')]?_0x5a2f5c[_0x1120('0x2f')]:_0x45ebb0['model'];if(!_0x2a5d32['query'][_0x1120('0x32')](_0x1120('0x33'))){_0x5a2f5c['limit']=qs[_0x1120('0x18')](_0x2a5d32[_0x1120('0x2a')][_0x1120('0x18')]);_0x5a2f5c[_0x1120('0x19')]=qs[_0x1120('0x19')](_0x2a5d32[_0x1120('0x2a')]['offset']);}_0x5a2f5c[_0x1120('0x34')]=qs['sort'](_0x2a5d32[_0x1120('0x2a')][_0x1120('0x35')]);_0x5a2f5c[_0x1120('0x36')]=qs[_0x1120('0x2c')](_[_0x1120('0x37')](_0x2a5d32[_0x1120('0x2a')],_0x45ebb0[_0x1120('0x2c')]),_0x5b0804);if(_0x2a5d32[_0x1120('0x2a')][_0x1120('0x38')]){_0x5a2f5c['where']=_[_0x1120('0x39')](_0x5a2f5c['where'],{'$or':_[_0x1120('0x26')](_0x5b0804,function(_0x256869){if(_0x256869['type']!==_0x1120('0x3a')){var _0x485065={};_0x485065[_0x256869[_0x1120('0x24')]]={'$like':'%'+_0x2a5d32[_0x1120('0x2a')]['filter']+'%'};return _0x485065;}})});}_0x5a2f5c=_[_0x1120('0x39')]({},_0x5a2f5c,_0x2a5d32[_0x1120('0x3b')]);var _0x19130e={'where':_0x5a2f5c['where']};return db[_0x1120('0x27')][_0x1120('0x1a')](_0x19130e)[_0x1120('0x20')](function(_0x128cb5){_0x48e6b2[_0x1120('0x1a')]=_0x128cb5;if(_0x2a5d32[_0x1120('0x2a')]['includeAll']){_0x5a2f5c[_0x1120('0x3c')]=[{'all':!![]}];}return db[_0x1120('0x27')][_0x1120('0x3d')](_0x5a2f5c);})['then'](function(_0x53c0b5){_0x48e6b2[_0x1120('0x3e')]=_0x53c0b5;return _0x48e6b2;})[_0x1120('0x20')](respondWithFilteredResult(_0x4852a2,_0x5a2f5c))[_0x1120('0x3f')](handleError(_0x4852a2,null));};exports[_0x1120('0x40')]=function(_0x5aca4f,_0x10201b){var _0x20f44e={'raw':![],'where':{'id':_0x5aca4f['params']['id']}},_0x50b95e={};_0x50b95e[_0x1120('0x2e')]=_['keys'](db['FreshsalesConfiguration'][_0x1120('0x41')]);_0x50b95e[_0x1120('0x2a')]=_[_0x1120('0x2b')](_0x5aca4f[_0x1120('0x2a')]);_0x50b95e[_0x1120('0x2c')]=_['intersection'](_0x50b95e[_0x1120('0x2e')],_0x50b95e[_0x1120('0x2a')]);_0x20f44e[_0x1120('0x2f')]=_[_0x1120('0x2d')](_0x50b95e[_0x1120('0x2e')],qs[_0x1120('0x30')](_0x5aca4f[_0x1120('0x2a')]['fields']));_0x20f44e['attributes']=_0x20f44e[_0x1120('0x2f')]['length']?_0x20f44e[_0x1120('0x2f')]:_0x50b95e['model'];if(_0x5aca4f[_0x1120('0x2a')]['includeAll']){_0x20f44e['include']=[{'all':!![]}];}_0x20f44e=_[_0x1120('0x39')]({},_0x20f44e,_0x5aca4f[_0x1120('0x3b')]);return db[_0x1120('0x27')][_0x1120('0x42')](_0x20f44e)[_0x1120('0x20')](handleEntityNotFound(_0x10201b,null))['then'](respondWithResult(_0x10201b,null))[_0x1120('0x3f')](handleError(_0x10201b,null));};exports['create']=function(_0x4492fe,_0x4789f4){return db[_0x1120('0x27')]['create'](_0x4492fe[_0x1120('0x43')],{})[_0x1120('0x20')](respondWithResult(_0x4789f4,0xc9))[_0x1120('0x3f')](handleError(_0x4789f4,null));};exports[_0x1120('0x1f')]=function(_0x10398d,_0x578f17){if(_0x10398d['body']['id']){delete _0x10398d['body']['id'];}return db[_0x1120('0x27')]['find']({'where':{'id':_0x10398d['params']['id']}})[_0x1120('0x20')](handleEntityNotFound(_0x578f17,null))['then'](saveUpdates(_0x10398d['body'],null))[_0x1120('0x20')](respondWithResult(_0x578f17,null))['catch'](handleError(_0x578f17,null));};exports[_0x1120('0x21')]=function(_0x57e312,_0x5f082b){return db[_0x1120('0x27')][_0x1120('0x42')]({'where':{'id':_0x57e312[_0x1120('0x44')]['id']}})[_0x1120('0x20')](handleEntityNotFound(_0x5f082b,null))['then'](removeEntity(_0x5f082b,null))['catch'](handleError(_0x5f082b,null));};exports['getSubjects']=function(_0x1fdcd9,_0x227fd1,_0x2034f1){var _0x1b1b5c={};var _0x386556={};var _0x53c662;var _0x441add;return db[_0x1120('0x27')][_0x1120('0x45')]({'where':{'id':_0x1fdcd9[_0x1120('0x44')]['id']}})[_0x1120('0x20')](handleEntityNotFound(_0x227fd1,null))[_0x1120('0x20')](function(_0x24267c){if(_0x24267c){_0x53c662=_0x24267c;_0x386556['model']=_[_0x1120('0x2b')](db[_0x1120('0x46')]['rawAttributes']);_0x386556[_0x1120('0x2a')]=_[_0x1120('0x2b')](_0x1fdcd9['query']);_0x386556['filters']=_[_0x1120('0x2d')](_0x386556['model'],_0x386556[_0x1120('0x2a')]);_0x1b1b5c['attributes']=_[_0x1120('0x2d')](_0x386556[_0x1120('0x2e')],qs[_0x1120('0x30')](_0x1fdcd9[_0x1120('0x2a')]['fields']));_0x1b1b5c[_0x1120('0x2f')]=_0x1b1b5c[_0x1120('0x2f')]['length']?_0x1b1b5c['attributes']:_0x386556[_0x1120('0x2e')];_0x1b1b5c['order']=qs[_0x1120('0x35')](_0x1fdcd9['query'][_0x1120('0x35')]);_0x1b1b5c[_0x1120('0x36')]=qs[_0x1120('0x2c')](_[_0x1120('0x37')](_0x1fdcd9[_0x1120('0x2a')],_0x386556[_0x1120('0x2c')]));if(_0x1fdcd9[_0x1120('0x2a')][_0x1120('0x38')]){_0x1b1b5c[_0x1120('0x36')]=_['merge'](_0x1b1b5c['where'],{'$or':_[_0x1120('0x26')](_0x1b1b5c[_0x1120('0x2f')],function(_0x5d9715){var _0x4d75ed={};_0x4d75ed[_0x5d9715]={'$like':'%'+_0x1fdcd9['query']['filter']+'%'};return _0x4d75ed;})});}_0x1b1b5c=_[_0x1120('0x39')]({},_0x1b1b5c,_0x1fdcd9[_0x1120('0x3b')]);return _0x53c662[_0x1120('0x47')](_0x1b1b5c);}})[_0x1120('0x20')](function(_0x5de9ac){if(_0x5de9ac){_0x441add=_0x5de9ac['length'];if(!_0x1fdcd9[_0x1120('0x2a')][_0x1120('0x32')]('nolimit')){_0x1b1b5c[_0x1120('0x18')]=qs['limit'](_0x1fdcd9[_0x1120('0x2a')][_0x1120('0x18')]);_0x1b1b5c[_0x1120('0x19')]=qs[_0x1120('0x19')](_0x1fdcd9[_0x1120('0x2a')][_0x1120('0x19')]);}return _0x53c662[_0x1120('0x47')](_0x1b1b5c);}})[_0x1120('0x20')](function(_0x282b65){if(_0x282b65){return _0x282b65?{'count':_0x441add,'rows':_0x282b65}:null;}})[_0x1120('0x20')](respondWithResult(_0x227fd1,null))[_0x1120('0x3f')](handleError(_0x227fd1,null));};exports[_0x1120('0x48')]=function(_0x4e3f33,_0x265116,_0x1be5f0){var _0x1903b9={};var _0xa4fbc1={};var _0x1a14ba;var _0x298aee;return db['FreshsalesConfiguration'][_0x1120('0x45')]({'where':{'id':_0x4e3f33[_0x1120('0x44')]['id']}})[_0x1120('0x20')](handleEntityNotFound(_0x265116,null))[_0x1120('0x20')](function(_0x308e58){if(_0x308e58){_0x1a14ba=_0x308e58;_0xa4fbc1[_0x1120('0x2e')]=_[_0x1120('0x2b')](db[_0x1120('0x46')][_0x1120('0x41')]);_0xa4fbc1[_0x1120('0x2a')]=_['keys'](_0x4e3f33[_0x1120('0x2a')]);_0xa4fbc1[_0x1120('0x2c')]=_['intersection'](_0xa4fbc1[_0x1120('0x2e')],_0xa4fbc1['query']);_0x1903b9[_0x1120('0x2f')]=_[_0x1120('0x2d')](_0xa4fbc1[_0x1120('0x2e')],qs[_0x1120('0x30')](_0x4e3f33['query'][_0x1120('0x30')]));_0x1903b9['attributes']=_0x1903b9[_0x1120('0x2f')][_0x1120('0x31')]?_0x1903b9[_0x1120('0x2f')]:_0xa4fbc1[_0x1120('0x2e')];_0x1903b9[_0x1120('0x34')]=qs[_0x1120('0x35')](_0x4e3f33['query']['sort']);_0x1903b9[_0x1120('0x36')]=qs[_0x1120('0x2c')](_['pick'](_0x4e3f33[_0x1120('0x2a')],_0xa4fbc1[_0x1120('0x2c')]));if(_0x4e3f33[_0x1120('0x2a')][_0x1120('0x38')]){_0x1903b9[_0x1120('0x36')]=_['merge'](_0x1903b9[_0x1120('0x36')],{'$or':_[_0x1120('0x26')](_0x1903b9[_0x1120('0x2f')],function(_0x345e64){var _0x40b80c={};_0x40b80c[_0x345e64]={'$like':'%'+_0x4e3f33['query'][_0x1120('0x38')]+'%'};return _0x40b80c;})});}_0x1903b9=_[_0x1120('0x39')]({},_0x1903b9,_0x4e3f33[_0x1120('0x3b')]);return _0x1a14ba[_0x1120('0x48')](_0x1903b9);}})[_0x1120('0x20')](function(_0x1af030){if(_0x1af030){_0x298aee=_0x1af030[_0x1120('0x31')];if(!_0x4e3f33['query']['hasOwnProperty'](_0x1120('0x33'))){_0x1903b9[_0x1120('0x18')]=qs[_0x1120('0x18')](_0x4e3f33[_0x1120('0x2a')][_0x1120('0x18')]);_0x1903b9[_0x1120('0x19')]=qs['offset'](_0x4e3f33[_0x1120('0x2a')][_0x1120('0x19')]);}return _0x1a14ba[_0x1120('0x48')](_0x1903b9);}})['then'](function(_0x6d4c01){if(_0x6d4c01){return _0x6d4c01?{'count':_0x298aee,'rows':_0x6d4c01}:null;}})['then'](respondWithResult(_0x265116,null))[_0x1120('0x3f')](handleError(_0x265116,null));};exports[_0x1120('0x49')]=function(_0x5ceb9d,_0x41a030,_0xdd44eb){var _0x1fff2d={};var _0x59d87f={};var _0xaf23e8;var _0x1f12e4;return db[_0x1120('0x27')][_0x1120('0x45')]({'where':{'id':_0x5ceb9d[_0x1120('0x44')]['id']}})[_0x1120('0x20')](handleEntityNotFound(_0x41a030,null))[_0x1120('0x20')](function(_0x5f50ce){if(_0x5f50ce){_0xaf23e8=_0x5f50ce;_0x59d87f[_0x1120('0x2e')]=_[_0x1120('0x2b')](db[_0x1120('0x46')][_0x1120('0x41')]);_0x59d87f['query']=_[_0x1120('0x2b')](_0x5ceb9d[_0x1120('0x2a')]);_0x59d87f[_0x1120('0x2c')]=_[_0x1120('0x2d')](_0x59d87f['model'],_0x59d87f[_0x1120('0x2a')]);_0x1fff2d[_0x1120('0x2f')]=_[_0x1120('0x2d')](_0x59d87f['model'],qs[_0x1120('0x30')](_0x5ceb9d[_0x1120('0x2a')][_0x1120('0x30')]));_0x1fff2d[_0x1120('0x2f')]=_0x1fff2d[_0x1120('0x2f')]['length']?_0x1fff2d[_0x1120('0x2f')]:_0x59d87f[_0x1120('0x2e')];_0x1fff2d['order']=qs[_0x1120('0x35')](_0x5ceb9d[_0x1120('0x2a')][_0x1120('0x35')]);_0x1fff2d[_0x1120('0x36')]=qs['filters'](_['pick'](_0x5ceb9d[_0x1120('0x2a')],_0x59d87f['filters']));if(_0x5ceb9d[_0x1120('0x2a')][_0x1120('0x38')]){_0x1fff2d['where']=_['merge'](_0x1fff2d[_0x1120('0x36')],{'$or':_[_0x1120('0x26')](_0x1fff2d['attributes'],function(_0x2a3bf1){var _0x3d0d00={};_0x3d0d00[_0x2a3bf1]={'$like':'%'+_0x5ceb9d['query']['filter']+'%'};return _0x3d0d00;})});}_0x1fff2d=_['merge']({},_0x1fff2d,_0x5ceb9d[_0x1120('0x3b')]);return _0xaf23e8['getFields'](_0x1fff2d);}})[_0x1120('0x20')](function(_0x33cb08){if(_0x33cb08){_0x1f12e4=_0x33cb08[_0x1120('0x31')];if(!_0x5ceb9d[_0x1120('0x2a')][_0x1120('0x32')](_0x1120('0x33'))){_0x1fff2d[_0x1120('0x18')]=qs[_0x1120('0x18')](_0x5ceb9d[_0x1120('0x2a')][_0x1120('0x18')]);_0x1fff2d[_0x1120('0x19')]=qs[_0x1120('0x19')](_0x5ceb9d[_0x1120('0x2a')][_0x1120('0x19')]);}return _0xaf23e8[_0x1120('0x49')](_0x1fff2d);}})[_0x1120('0x20')](function(_0x5f558c){if(_0x5f558c){return _0x5f558c?{'count':_0x1f12e4,'rows':_0x5f558c}:null;}})[_0x1120('0x20')](respondWithResult(_0x41a030,null))[_0x1120('0x3f')](handleError(_0x41a030,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index 3eb6148..812bcdb 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 _0xb411=['exports','define','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes'];(function(_0x1347f8,_0x233feb){var _0x218368=function(_0x3f4ca3){while(--_0x3f4ca3){_0x1347f8['push'](_0x1347f8['shift']());}};_0x218368(++_0x233feb);}(_0xb411,0x12b));var _0x1b41=function(_0x474a6b,_0xdfc9c7){_0x474a6b=_0x474a6b-0x0;var _0xcb77e4=_0xb411[_0x474a6b];return _0xcb77e4;};'use strict';var _=require('lodash');var util=require(_0x1b41('0x0'));var logger=require(_0x1b41('0x1'))(_0x1b41('0x2'));var moment=require('moment');var BPromise=require(_0x1b41('0x3'));var rp=require(_0x1b41('0x4'));var fs=require('fs');var path=require(_0x1b41('0x5'));var rimraf=require(_0x1b41('0x6'));var config=require(_0x1b41('0x7'));var attributes=require(_0x1b41('0x8'));module[_0x1b41('0x9')]=function(_0x521894,_0x590d1d){return _0x521894[_0x1b41('0xa')]('FreshsalesConfiguration',attributes,{'tableName':'int_freshsales_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7d9d=['define','FreshsalesConfiguration','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intFreshsalesConfiguration.attributes','exports'];(function(_0x45bcb1,_0x46cad0){var _0x4bd6a3=function(_0x1f197f){while(--_0x1f197f){_0x45bcb1['push'](_0x45bcb1['shift']());}};_0x4bd6a3(++_0x46cad0);}(_0x7d9d,0x9e));var _0xd7d9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7d9d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd7d9('0x0'));var util=require(_0xd7d9('0x1'));var logger=require(_0xd7d9('0x2'))(_0xd7d9('0x3'));var moment=require(_0xd7d9('0x4'));var BPromise=require(_0xd7d9('0x5'));var rp=require(_0xd7d9('0x6'));var fs=require('fs');var path=require(_0xd7d9('0x7'));var rimraf=require('rimraf');var config=require(_0xd7d9('0x8'));var attributes=require(_0xd7d9('0x9'));module[_0xd7d9('0xa')]=function(_0x56c3c4,_0x587eb5){return _0x56c3c4[_0xd7d9('0xb')](_0xd7d9('0xc'),attributes,{'tableName':'int_freshsales_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js index a568a5b..a128d2e 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 _0x4a29=['FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','debug'];(function(_0x1ed383,_0x40dd15){var _0x4c4d16=function(_0x24377e){while(--_0x24377e){_0x1ed383['push'](_0x1ed383['shift']());}};_0x4c4d16(++_0x40dd15);}(_0x4a29,0x1d5));var _0x94a2=function(_0x38b89b,_0x40b0a4){_0x38b89b=_0x38b89b-0x0;var _0x1df863=_0x4a29[_0x38b89b];return _0x1df863;};'use strict';var _=require(_0x94a2('0x0'));var util=require('util');var moment=require(_0x94a2('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x94a2('0x2'));var db=require(_0x94a2('0x3'))['db'];var utils=require(_0x94a2('0x4'));var logger=require(_0x94a2('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x94a2('0x6'));var client=jayson[_0x94a2('0x7')][_0x94a2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4fd940,_0x25f968,_0x39e15c){return new BPromise(function(_0x332a6c,_0x33e373){return client[_0x94a2('0x9')](_0x4fd940,_0x39e15c)[_0x94a2('0xa')](function(_0x392a0c){logger[_0x94a2('0xb')](_0x94a2('0xc'),_0x25f968,'request\x20sent');logger[_0x94a2('0xd')](_0x94a2('0xe'),_0x25f968,_0x94a2('0xf'),JSON[_0x94a2('0x10')](_0x392a0c));if(_0x392a0c[_0x94a2('0x11')]){if(_0x392a0c[_0x94a2('0x11')]['code']===0x1f4){logger['error']('FreshsalesConfiguration,\x20%s,\x20%s',_0x25f968,_0x392a0c[_0x94a2('0x11')]['message']);return _0x33e373(_0x392a0c['error']['message']);}logger['error'](_0x94a2('0xc'),_0x25f968,_0x392a0c['error'][_0x94a2('0x12')]);return _0x332a6c(_0x392a0c[_0x94a2('0x11')][_0x94a2('0x12')]);}else{logger['info'](_0x94a2('0xc'),_0x25f968,_0x94a2('0xf'));_0x332a6c(_0x392a0c[_0x94a2('0x13')][_0x94a2('0x12')]);}})[_0x94a2('0x14')](function(_0x3330a3){logger[_0x94a2('0x11')](_0x94a2('0xc'),_0x25f968,_0x3330a3);_0x33e373(_0x3330a3);});});} \ No newline at end of file +var _0x501a=['../../config/utils','../../config/logger','rpc','../../config/environment','client','request','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x34843e,_0x4c4224){var _0x598f7f=function(_0x12a44c){while(--_0x12a44c){_0x34843e['push'](_0x34843e['shift']());}};_0x598f7f(++_0x4c4224);}(_0x501a,0x12d));var _0xa501=function(_0x17e75e,_0x24753e){_0x17e75e=_0x17e75e-0x0;var _0x25f451=_0x501a[_0x17e75e];return _0x25f451;};'use strict';var _=require(_0xa501('0x0'));var util=require(_0xa501('0x1'));var moment=require(_0xa501('0x2'));var BPromise=require(_0xa501('0x3'));var rs=require(_0xa501('0x4'));var fs=require('fs');var Redis=require(_0xa501('0x5'));var db=require(_0xa501('0x6'))['db'];var utils=require(_0xa501('0x7'));var logger=require(_0xa501('0x8'))(_0xa501('0x9'));var config=require(_0xa501('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xa501('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x27ff90,_0x2faf4,_0x2f1676){return new BPromise(function(_0x25cb2a,_0x34f4c6){return client[_0xa501('0xc')](_0x27ff90,_0x2f1676)['then'](function(_0x147e50){logger['info'](_0xa501('0xd'),_0x2faf4,_0xa501('0xe'));logger['debug'](_0xa501('0xf'),_0x2faf4,_0xa501('0xe'),JSON[_0xa501('0x10')](_0x147e50));if(_0x147e50[_0xa501('0x11')]){if(_0x147e50[_0xa501('0x11')][_0xa501('0x12')]===0x1f4){logger[_0xa501('0x11')](_0xa501('0xd'),_0x2faf4,_0x147e50[_0xa501('0x11')][_0xa501('0x13')]);return _0x34f4c6(_0x147e50[_0xa501('0x11')][_0xa501('0x13')]);}logger[_0xa501('0x11')](_0xa501('0xd'),_0x2faf4,_0x147e50[_0xa501('0x11')][_0xa501('0x13')]);return _0x25cb2a(_0x147e50[_0xa501('0x11')][_0xa501('0x13')]);}else{logger[_0xa501('0x14')](_0xa501('0xd'),_0x2faf4,_0xa501('0xe'));_0x25cb2a(_0x147e50['result'][_0xa501('0x13')]);}})[_0xa501('0x15')](function(_0x1ca2b8){logger[_0xa501('0x11')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x2faf4,_0x1ca2b8);_0x34f4c6(_0x1ca2b8);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index 9e2294e..6a13336 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 _0xa1fd=['create','put','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post'];(function(_0x40501b,_0x361e17){var _0x17e8a9=function(_0x4a96dc){while(--_0x4a96dc){_0x40501b['push'](_0x40501b['shift']());}};_0x17e8a9(++_0x361e17);}(_0xa1fd,0x1b9));var _0xda1f=function(_0xddafcc,_0x5e601f){_0xddafcc=_0xddafcc-0x0;var _0x511cb1=_0xa1fd[_0xddafcc];return _0x511cb1;};'use strict';var multer=require(_0xda1f('0x0'));var util=require(_0xda1f('0x1'));var path=require(_0xda1f('0x2'));var timeout=require(_0xda1f('0x3'));var express=require('express');var router=express[_0xda1f('0x4')]();var fs_extra=require(_0xda1f('0x5'));var auth=require(_0xda1f('0x6'));var interaction=require(_0xda1f('0x7'));var config=require(_0xda1f('0x8'));var controller=require('./intFreshsalesField.controller');router[_0xda1f('0x9')]('/',auth[_0xda1f('0xa')](),controller[_0xda1f('0xb')]);router['get'](_0xda1f('0xc'),auth[_0xda1f('0xa')](),controller[_0xda1f('0xd')]);router[_0xda1f('0xe')]('/',auth[_0xda1f('0xa')](),controller[_0xda1f('0xf')]);router[_0xda1f('0x10')](_0xda1f('0xc'),auth[_0xda1f('0xa')](),controller['update']);router[_0xda1f('0x11')](_0xda1f('0xc'),auth[_0xda1f('0xa')](),controller[_0xda1f('0x12')]);module['exports']=router; \ No newline at end of file +var _0xc39c=['../../config/environment','./intFreshsalesField.controller','get','isAuthenticated','/:id','show','post','create','put','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x33bb55,_0x3e7985){var _0xba6684=function(_0x5d655c){while(--_0x5d655c){_0x33bb55['push'](_0x33bb55['shift']());}};_0xba6684(++_0x3e7985);}(_0xc39c,0xd2));var _0xcc39=function(_0x3549e9,_0x455a35){_0x3549e9=_0x3549e9-0x0;var _0x338b94=_0xc39c[_0x3549e9];return _0x338b94;};'use strict';var multer=require('multer');var util=require(_0xcc39('0x0'));var path=require(_0xcc39('0x1'));var timeout=require(_0xcc39('0x2'));var express=require('express');var router=express[_0xcc39('0x3')]();var fs_extra=require(_0xcc39('0x4'));var auth=require(_0xcc39('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xcc39('0x6'));var controller=require(_0xcc39('0x7'));router[_0xcc39('0x8')]('/',auth[_0xcc39('0x9')](),controller['index']);router[_0xcc39('0x8')](_0xcc39('0xa'),auth[_0xcc39('0x9')](),controller[_0xcc39('0xb')]);router[_0xcc39('0xc')]('/',auth[_0xcc39('0x9')](),controller[_0xcc39('0xd')]);router[_0xcc39('0xe')](_0xcc39('0xa'),auth[_0xcc39('0x9')](),controller['update']);router[_0xcc39('0xf')]('/:id',auth[_0xcc39('0x9')](),controller[_0xcc39('0x10')]);module[_0xcc39('0x11')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index c326180..dd07fa4 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 _0xbd7d=['string','variable','keyValue','customVariable','STRING','BOOLEAN','sequelize','exports','ENUM'];(function(_0x5bf420,_0x2d068d){var _0x1c5255=function(_0x4964a2){while(--_0x4964a2){_0x5bf420['push'](_0x5bf420['shift']());}};_0x1c5255(++_0x2d068d);}(_0xbd7d,0xb1));var _0xdbd7=function(_0x4dc0d8,_0x4fb4ff){_0x4dc0d8=_0x4dc0d8-0x0;var _0x16bf8e=_0xbd7d[_0x4dc0d8];return _0x16bf8e;};'use strict';var Sequelize=require(_0xdbd7('0x0'));module[_0xdbd7('0x1')]={'type':{'type':Sequelize[_0xdbd7('0x2')](_0xdbd7('0x3'),_0xdbd7('0x4'),'customVariable',_0xdbd7('0x5'),'picklist'),'defaultValue':_0xdbd7('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0xdbd7('0x3'),_0xdbd7('0x4'),_0xdbd7('0x6'))},'keyContent':{'type':Sequelize[_0xdbd7('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xdbd7('0x7')]},'customField':{'type':Sequelize[_0xdbd7('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x3668=['picklist','STRING','BOOLEAN','sequelize','ENUM','variable','customVariable','keyValue'];(function(_0x68bc2d,_0x1d62d9){var _0x57aea9=function(_0x17ed78){while(--_0x17ed78){_0x68bc2d['push'](_0x68bc2d['shift']());}};_0x57aea9(++_0x1d62d9);}(_0x3668,0x1cb));var _0x8366=function(_0x477b89,_0x15db07){_0x477b89=_0x477b89-0x0;var _0x5b1c03=_0x3668[_0x477b89];return _0x5b1c03;};'use strict';var Sequelize=require(_0x8366('0x0'));module['exports']={'type':{'type':Sequelize[_0x8366('0x1')]('string',_0x8366('0x2'),_0x8366('0x3'),_0x8366('0x4'),_0x8366('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x8366('0x6')]},'key':{'type':Sequelize[_0x8366('0x6')]},'keyType':{'type':Sequelize[_0x8366('0x1')]('string',_0x8366('0x2'),_0x8366('0x3'))},'keyContent':{'type':Sequelize[_0x8366('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x8366('0x6')]},'customField':{'type':Sequelize[_0x8366('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8366('0x6')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index 0fc504c..d4421ff 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 _0x0ff4=['index','map','FreshsalesField','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','type','options','include','findAll','catch','show','params','rawAttributes','includeAll','find','create','body','update','eml-format','rimraf','request-promise','moment','bluebird','util','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','destroy','then','error','stack','name'];(function(_0x262c9b,_0x47129b){var _0x4b533f=function(_0x4682dc){while(--_0x4682dc){_0x262c9b['push'](_0x262c9b['shift']());}};_0x4b533f(++_0x47129b);}(_0x0ff4,0xb0));var _0x40ff=function(_0x1d50f2,_0x3c3ec6){_0x1d50f2=_0x1d50f2-0x0;var _0x3769b8=_0x0ff4[_0x1d50f2];return _0x3769b8;};'use strict';var emlformat=require(_0x40ff('0x0'));var rimraf=require(_0x40ff('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x40ff('0x2'));var moment=require(_0x40ff('0x3'));var BPromise=require(_0x40ff('0x4'));var Mustache=require('mustache');var util=require(_0x40ff('0x5'));var path=require('path');var sox=require(_0x40ff('0x6'));var csv=require(_0x40ff('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x40ff('0x8'));var _=require(_0x40ff('0x9'));var squel=require(_0x40ff('0xa'));var crypto=require('crypto');var jsforce=require(_0x40ff('0xb'));var deskjs=require(_0x40ff('0xc'));var toCsv=require(_0x40ff('0x7'));var querystring=require(_0x40ff('0xd'));var Papa=require('papaparse');var Redis=require(_0x40ff('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x40ff('0xf'));var as=require(_0x40ff('0x10'));var hardwareService=require(_0x40ff('0x11'));var logger=require(_0x40ff('0x12'))('api');var utils=require(_0x40ff('0x13'));var config=require(_0x40ff('0x14'));var licenseUtil=require(_0x40ff('0x15'));var db=require(_0x40ff('0x16'))['db'];function respondWithStatusCode(_0x489916,_0x30df21){_0x30df21=_0x30df21||0xcc;return function(_0x2b2fba){if(_0x2b2fba){return _0x489916[_0x40ff('0x17')](_0x30df21);}return _0x489916[_0x40ff('0x18')](_0x30df21)[_0x40ff('0x19')]();};}function respondWithResult(_0x22ba61,_0x4b17d8){_0x4b17d8=_0x4b17d8||0xc8;return function(_0x14b434){if(_0x14b434){return _0x22ba61[_0x40ff('0x18')](_0x4b17d8)[_0x40ff('0x1a')](_0x14b434);}};}function respondWithFilteredResult(_0x3b3b92,_0xde1c90){return function(_0x3c97a4){if(_0x3c97a4){var _0x165d04=typeof _0xde1c90['offset']===_0x40ff('0x1b')&&typeof _0xde1c90[_0x40ff('0x1c')]===_0x40ff('0x1b');var _0xec21e=_0x3c97a4[_0x40ff('0x1d')];var _0x24e1f1=_0x165d04?0x0:_0xde1c90[_0x40ff('0x1e')];var _0x262afe=_0x165d04?_0x3c97a4['count']:_0xde1c90[_0x40ff('0x1e')]+_0xde1c90['limit'];var _0x2aaf5b;if(_0x262afe>=_0xec21e){_0x262afe=_0xec21e;_0x2aaf5b=0xc8;}else{_0x2aaf5b=0xce;}_0x3b3b92[_0x40ff('0x18')](_0x2aaf5b);return _0x3b3b92[_0x40ff('0x1f')](_0x40ff('0x20'),_0x24e1f1+'-'+_0x262afe+'/'+_0xec21e)['json'](_0x3c97a4);}return null;};}function patchUpdates(_0x16e59b){return function(_0x174de3){try{jsonpatch[_0x40ff('0x21')](_0x174de3,_0x16e59b,!![]);}catch(_0x986482){return BPromise[_0x40ff('0x22')](_0x986482);}return _0x174de3['save']();};}function saveUpdates(_0x5a1e49,_0x55e075){return function(_0x2bdc4d){if(_0x2bdc4d){return _0x2bdc4d['update'](_0x5a1e49)['then'](function(_0x24217a){return _0x24217a;});}return null;};}function removeEntity(_0x2fc221,_0x220436){return function(_0xc794fe){if(_0xc794fe){return _0xc794fe[_0x40ff('0x23')]()[_0x40ff('0x24')](function(){_0x2fc221[_0x40ff('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3dd03a,_0x2c4431){return function(_0x2bd557){if(!_0x2bd557){_0x3dd03a[_0x40ff('0x17')](0x194);}return _0x2bd557;};}function handleError(_0x3c87b9,_0x17e4d7){_0x17e4d7=_0x17e4d7||0x1f4;return function(_0x2a562a){logger[_0x40ff('0x25')](_0x2a562a[_0x40ff('0x26')]);if(_0x2a562a[_0x40ff('0x27')]){delete _0x2a562a['name'];}_0x3c87b9['status'](_0x17e4d7)['send'](_0x2a562a);};}exports[_0x40ff('0x28')]=function(_0x4d8fe6,_0x3c3bb8){var _0x22d004={},_0x3f58d1={},_0x49baef={'count':0x0,'rows':[]};var _0x4d378f=_[_0x40ff('0x29')](db[_0x40ff('0x2a')]['rawAttributes'],function(_0x86b49a){return{'name':_0x86b49a['fieldName'],'type':_0x86b49a['type'][_0x40ff('0x2b')]};});_0x3f58d1[_0x40ff('0x2c')]=_[_0x40ff('0x29')](_0x4d378f,'name');_0x3f58d1[_0x40ff('0x2d')]=_[_0x40ff('0x2e')](_0x4d8fe6[_0x40ff('0x2d')]);_0x3f58d1[_0x40ff('0x2f')]=_[_0x40ff('0x30')](_0x3f58d1['model'],_0x3f58d1[_0x40ff('0x2d')]);_0x22d004['attributes']=_[_0x40ff('0x30')](_0x3f58d1[_0x40ff('0x2c')],qs[_0x40ff('0x31')](_0x4d8fe6['query'][_0x40ff('0x31')]));_0x22d004[_0x40ff('0x32')]=_0x22d004[_0x40ff('0x32')][_0x40ff('0x33')]?_0x22d004[_0x40ff('0x32')]:_0x3f58d1[_0x40ff('0x2c')];if(!_0x4d8fe6[_0x40ff('0x2d')]['hasOwnProperty'](_0x40ff('0x34'))){_0x22d004[_0x40ff('0x1c')]=qs[_0x40ff('0x1c')](_0x4d8fe6[_0x40ff('0x2d')][_0x40ff('0x1c')]);_0x22d004[_0x40ff('0x1e')]=qs['offset'](_0x4d8fe6[_0x40ff('0x2d')][_0x40ff('0x1e')]);}_0x22d004[_0x40ff('0x35')]=qs[_0x40ff('0x36')](_0x4d8fe6[_0x40ff('0x2d')][_0x40ff('0x36')]);_0x22d004[_0x40ff('0x37')]=qs[_0x40ff('0x2f')](_[_0x40ff('0x38')](_0x4d8fe6[_0x40ff('0x2d')],_0x3f58d1['filters']),_0x4d378f);if(_0x4d8fe6[_0x40ff('0x2d')][_0x40ff('0x39')]){_0x22d004[_0x40ff('0x37')]=_[_0x40ff('0x3a')](_0x22d004[_0x40ff('0x37')],{'$or':_[_0x40ff('0x29')](_0x4d378f,function(_0x136987){if(_0x136987[_0x40ff('0x3b')]!=='VIRTUAL'){var _0x3bbdbe={};_0x3bbdbe[_0x136987[_0x40ff('0x27')]]={'$like':'%'+_0x4d8fe6[_0x40ff('0x2d')][_0x40ff('0x39')]+'%'};return _0x3bbdbe;}})});}_0x22d004=_[_0x40ff('0x3a')]({},_0x22d004,_0x4d8fe6[_0x40ff('0x3c')]);var _0x1cc2b7={'where':_0x22d004[_0x40ff('0x37')]};return db[_0x40ff('0x2a')][_0x40ff('0x1d')](_0x1cc2b7)[_0x40ff('0x24')](function(_0x41d77d){_0x49baef['count']=_0x41d77d;if(_0x4d8fe6[_0x40ff('0x2d')]['includeAll']){_0x22d004[_0x40ff('0x3d')]=[{'all':!![]}];}return db['FreshsalesField'][_0x40ff('0x3e')](_0x22d004);})[_0x40ff('0x24')](function(_0x279767){_0x49baef['rows']=_0x279767;return _0x49baef;})[_0x40ff('0x24')](respondWithFilteredResult(_0x3c3bb8,_0x22d004))[_0x40ff('0x3f')](handleError(_0x3c3bb8,null));};exports[_0x40ff('0x40')]=function(_0x33902e,_0x5c5271){var _0x4d79c4={'raw':!![],'where':{'id':_0x33902e[_0x40ff('0x41')]['id']}},_0x522ff5={};_0x522ff5[_0x40ff('0x2c')]=_[_0x40ff('0x2e')](db[_0x40ff('0x2a')][_0x40ff('0x42')]);_0x522ff5[_0x40ff('0x2d')]=_[_0x40ff('0x2e')](_0x33902e[_0x40ff('0x2d')]);_0x522ff5[_0x40ff('0x2f')]=_['intersection'](_0x522ff5[_0x40ff('0x2c')],_0x522ff5[_0x40ff('0x2d')]);_0x4d79c4['attributes']=_[_0x40ff('0x30')](_0x522ff5['model'],qs[_0x40ff('0x31')](_0x33902e[_0x40ff('0x2d')][_0x40ff('0x31')]));_0x4d79c4[_0x40ff('0x32')]=_0x4d79c4[_0x40ff('0x32')]['length']?_0x4d79c4[_0x40ff('0x32')]:_0x522ff5[_0x40ff('0x2c')];if(_0x33902e[_0x40ff('0x2d')][_0x40ff('0x43')]){_0x4d79c4[_0x40ff('0x3d')]=[{'all':!![]}];}_0x4d79c4=_['merge']({},_0x4d79c4,_0x33902e[_0x40ff('0x3c')]);return db[_0x40ff('0x2a')][_0x40ff('0x44')](_0x4d79c4)[_0x40ff('0x24')](handleEntityNotFound(_0x5c5271,null))[_0x40ff('0x24')](respondWithResult(_0x5c5271,null))['catch'](handleError(_0x5c5271,null));};exports[_0x40ff('0x45')]=function(_0xa776e6,_0x2cdba6){return db[_0x40ff('0x2a')][_0x40ff('0x45')](_0xa776e6[_0x40ff('0x46')],{})['then'](respondWithResult(_0x2cdba6,0xc9))[_0x40ff('0x3f')](handleError(_0x2cdba6,null));};exports[_0x40ff('0x47')]=function(_0x430846,_0x464c1b){if(_0x430846[_0x40ff('0x46')]['id']){delete _0x430846[_0x40ff('0x46')]['id'];}return db[_0x40ff('0x2a')][_0x40ff('0x44')]({'where':{'id':_0x430846[_0x40ff('0x41')]['id']}})[_0x40ff('0x24')](handleEntityNotFound(_0x464c1b,null))[_0x40ff('0x24')](saveUpdates(_0x430846[_0x40ff('0x46')],null))['then'](respondWithResult(_0x464c1b,null))[_0x40ff('0x3f')](handleError(_0x464c1b,null));};exports[_0x40ff('0x23')]=function(_0x21ea3b,_0x399359){return db[_0x40ff('0x2a')][_0x40ff('0x44')]({'where':{'id':_0x21ea3b[_0x40ff('0x41')]['id']}})['then'](handleEntityNotFound(_0x399359,null))[_0x40ff('0x24')](removeEntity(_0x399359,null))[_0x40ff('0x3f')](handleError(_0x399359,null));}; \ No newline at end of file +var _0x5a88=['api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','FreshsalesField','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','fields','include','find','create','update','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0x5a88,0x129));var _0x85a8=function(_0x6b7324,_0x3b23cf){_0x6b7324=_0x6b7324-0x0;var _0x2f1a35=_0x5a88[_0x6b7324];return _0x2f1a35;};'use strict';var emlformat=require(_0x85a8('0x0'));var rimraf=require(_0x85a8('0x1'));var zipdir=require(_0x85a8('0x2'));var jsonpatch=require(_0x85a8('0x3'));var rp=require(_0x85a8('0x4'));var moment=require(_0x85a8('0x5'));var BPromise=require(_0x85a8('0x6'));var Mustache=require(_0x85a8('0x7'));var util=require(_0x85a8('0x8'));var path=require('path');var sox=require(_0x85a8('0x9'));var csv=require(_0x85a8('0xa'));var ejs=require(_0x85a8('0xb'));var fs=require('fs');var fs_extra=require(_0x85a8('0xc'));var _=require('lodash');var squel=require(_0x85a8('0xd'));var crypto=require(_0x85a8('0xe'));var jsforce=require(_0x85a8('0xf'));var deskjs=require(_0x85a8('0x10'));var toCsv=require(_0x85a8('0xa'));var querystring=require(_0x85a8('0x11'));var Papa=require(_0x85a8('0x12'));var Redis=require(_0x85a8('0x13'));var authService=require(_0x85a8('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x85a8('0x15'));var logger=require(_0x85a8('0x16'))(_0x85a8('0x17'));var utils=require(_0x85a8('0x18'));var config=require(_0x85a8('0x19'));var licenseUtil=require(_0x85a8('0x1a'));var db=require(_0x85a8('0x1b'))['db'];function respondWithStatusCode(_0xafad93,_0x14a75b){_0x14a75b=_0x14a75b||0xcc;return function(_0x5e1367){if(_0x5e1367){return _0xafad93[_0x85a8('0x1c')](_0x14a75b);}return _0xafad93[_0x85a8('0x1d')](_0x14a75b)[_0x85a8('0x1e')]();};}function respondWithResult(_0x169733,_0x19bf34){_0x19bf34=_0x19bf34||0xc8;return function(_0x1ae6b2){if(_0x1ae6b2){return _0x169733[_0x85a8('0x1d')](_0x19bf34)[_0x85a8('0x1f')](_0x1ae6b2);}};}function respondWithFilteredResult(_0x26db3c,_0x5fa32c){return function(_0x20df9a){if(_0x20df9a){var _0x33630f=typeof _0x5fa32c[_0x85a8('0x20')]===_0x85a8('0x21')&&typeof _0x5fa32c[_0x85a8('0x22')]===_0x85a8('0x21');var _0x2113f1=_0x20df9a[_0x85a8('0x23')];var _0x4c9a70=_0x33630f?0x0:_0x5fa32c[_0x85a8('0x20')];var _0x40886e=_0x33630f?_0x20df9a[_0x85a8('0x23')]:_0x5fa32c[_0x85a8('0x20')]+_0x5fa32c[_0x85a8('0x22')];var _0x312b42;if(_0x40886e>=_0x2113f1){_0x40886e=_0x2113f1;_0x312b42=0xc8;}else{_0x312b42=0xce;}_0x26db3c[_0x85a8('0x1d')](_0x312b42);return _0x26db3c['set'](_0x85a8('0x24'),_0x4c9a70+'-'+_0x40886e+'/'+_0x2113f1)[_0x85a8('0x1f')](_0x20df9a);}return null;};}function patchUpdates(_0x4c9b6e){return function(_0xe169d8){try{jsonpatch[_0x85a8('0x25')](_0xe169d8,_0x4c9b6e,!![]);}catch(_0x15ef47){return BPromise[_0x85a8('0x26')](_0x15ef47);}return _0xe169d8[_0x85a8('0x27')]();};}function saveUpdates(_0x1bd91d,_0x4a0721){return function(_0x28c06d){if(_0x28c06d){return _0x28c06d['update'](_0x1bd91d)[_0x85a8('0x28')](function(_0x471d81){return _0x471d81;});}return null;};}function removeEntity(_0x45fc92,_0x2d12cb){return function(_0x7a9b41){if(_0x7a9b41){return _0x7a9b41[_0x85a8('0x29')]()[_0x85a8('0x28')](function(){_0x45fc92['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x152a53,_0x398e88){return function(_0x334477){if(!_0x334477){_0x152a53[_0x85a8('0x1c')](0x194);}return _0x334477;};}function handleError(_0x21da33,_0x22c8f7){_0x22c8f7=_0x22c8f7||0x1f4;return function(_0x452daa){logger[_0x85a8('0x2a')](_0x452daa[_0x85a8('0x2b')]);if(_0x452daa[_0x85a8('0x2c')]){delete _0x452daa[_0x85a8('0x2c')];}_0x21da33['status'](_0x22c8f7)[_0x85a8('0x2d')](_0x452daa);};}exports[_0x85a8('0x2e')]=function(_0x1f4dd6,_0xf610d8){var _0x139aa2={},_0x313887={},_0x6c65fa={'count':0x0,'rows':[]};var _0x3b4933=_[_0x85a8('0x2f')](db[_0x85a8('0x30')][_0x85a8('0x31')],function(_0x529db3){return{'name':_0x529db3['fieldName'],'type':_0x529db3[_0x85a8('0x32')][_0x85a8('0x33')]};});_0x313887['model']=_[_0x85a8('0x2f')](_0x3b4933,_0x85a8('0x2c'));_0x313887[_0x85a8('0x34')]=_[_0x85a8('0x35')](_0x1f4dd6[_0x85a8('0x34')]);_0x313887[_0x85a8('0x36')]=_[_0x85a8('0x37')](_0x313887[_0x85a8('0x38')],_0x313887[_0x85a8('0x34')]);_0x139aa2[_0x85a8('0x39')]=_[_0x85a8('0x37')](_0x313887[_0x85a8('0x38')],qs['fields'](_0x1f4dd6[_0x85a8('0x34')]['fields']));_0x139aa2[_0x85a8('0x39')]=_0x139aa2[_0x85a8('0x39')][_0x85a8('0x3a')]?_0x139aa2[_0x85a8('0x39')]:_0x313887[_0x85a8('0x38')];if(!_0x1f4dd6[_0x85a8('0x34')][_0x85a8('0x3b')](_0x85a8('0x3c'))){_0x139aa2[_0x85a8('0x22')]=qs[_0x85a8('0x22')](_0x1f4dd6[_0x85a8('0x34')]['limit']);_0x139aa2['offset']=qs['offset'](_0x1f4dd6[_0x85a8('0x34')][_0x85a8('0x20')]);}_0x139aa2[_0x85a8('0x3d')]=qs[_0x85a8('0x3e')](_0x1f4dd6['query']['sort']);_0x139aa2[_0x85a8('0x3f')]=qs[_0x85a8('0x36')](_[_0x85a8('0x40')](_0x1f4dd6['query'],_0x313887[_0x85a8('0x36')]),_0x3b4933);if(_0x1f4dd6[_0x85a8('0x34')][_0x85a8('0x41')]){_0x139aa2[_0x85a8('0x3f')]=_[_0x85a8('0x42')](_0x139aa2[_0x85a8('0x3f')],{'$or':_[_0x85a8('0x2f')](_0x3b4933,function(_0x9011be){if(_0x9011be['type']!==_0x85a8('0x43')){var _0x35f5c9={};_0x35f5c9[_0x9011be[_0x85a8('0x2c')]]={'$like':'%'+_0x1f4dd6[_0x85a8('0x34')]['filter']+'%'};return _0x35f5c9;}})});}_0x139aa2=_[_0x85a8('0x42')]({},_0x139aa2,_0x1f4dd6[_0x85a8('0x44')]);var _0x333b5c={'where':_0x139aa2[_0x85a8('0x3f')]};return db['FreshsalesField'][_0x85a8('0x23')](_0x333b5c)['then'](function(_0x1254e7){_0x6c65fa[_0x85a8('0x23')]=_0x1254e7;if(_0x1f4dd6[_0x85a8('0x34')][_0x85a8('0x45')]){_0x139aa2['include']=[{'all':!![]}];}return db[_0x85a8('0x30')][_0x85a8('0x46')](_0x139aa2);})[_0x85a8('0x28')](function(_0x4ff32b){_0x6c65fa[_0x85a8('0x47')]=_0x4ff32b;return _0x6c65fa;})[_0x85a8('0x28')](respondWithFilteredResult(_0xf610d8,_0x139aa2))[_0x85a8('0x48')](handleError(_0xf610d8,null));};exports['show']=function(_0x2624fa,_0x313cfc){var _0xef2456={'raw':!![],'where':{'id':_0x2624fa[_0x85a8('0x49')]['id']}},_0x5683da={};_0x5683da[_0x85a8('0x38')]=_[_0x85a8('0x35')](db[_0x85a8('0x30')][_0x85a8('0x31')]);_0x5683da['query']=_['keys'](_0x2624fa[_0x85a8('0x34')]);_0x5683da[_0x85a8('0x36')]=_[_0x85a8('0x37')](_0x5683da['model'],_0x5683da[_0x85a8('0x34')]);_0xef2456[_0x85a8('0x39')]=_['intersection'](_0x5683da[_0x85a8('0x38')],qs[_0x85a8('0x4a')](_0x2624fa[_0x85a8('0x34')]['fields']));_0xef2456[_0x85a8('0x39')]=_0xef2456[_0x85a8('0x39')][_0x85a8('0x3a')]?_0xef2456[_0x85a8('0x39')]:_0x5683da[_0x85a8('0x38')];if(_0x2624fa['query'][_0x85a8('0x45')]){_0xef2456[_0x85a8('0x4b')]=[{'all':!![]}];}_0xef2456=_[_0x85a8('0x42')]({},_0xef2456,_0x2624fa[_0x85a8('0x44')]);return db['FreshsalesField'][_0x85a8('0x4c')](_0xef2456)['then'](handleEntityNotFound(_0x313cfc,null))[_0x85a8('0x28')](respondWithResult(_0x313cfc,null))[_0x85a8('0x48')](handleError(_0x313cfc,null));};exports['create']=function(_0x435b9b,_0x4a76e6){return db['FreshsalesField'][_0x85a8('0x4d')](_0x435b9b['body'],{})['then'](respondWithResult(_0x4a76e6,0xc9))[_0x85a8('0x48')](handleError(_0x4a76e6,null));};exports[_0x85a8('0x4e')]=function(_0x100252,_0x135efc){if(_0x100252[_0x85a8('0x4f')]['id']){delete _0x100252[_0x85a8('0x4f')]['id'];}return db[_0x85a8('0x30')][_0x85a8('0x4c')]({'where':{'id':_0x100252[_0x85a8('0x49')]['id']}})[_0x85a8('0x28')](handleEntityNotFound(_0x135efc,null))['then'](saveUpdates(_0x100252['body'],null))[_0x85a8('0x28')](respondWithResult(_0x135efc,null))[_0x85a8('0x48')](handleError(_0x135efc,null));};exports['destroy']=function(_0x211b68,_0x5ebaf8){return db[_0x85a8('0x30')][_0x85a8('0x4c')]({'where':{'id':_0x211b68[_0x85a8('0x49')]['id']}})['then'](handleEntityNotFound(_0x5ebaf8,null))[_0x85a8('0x28')](removeEntity(_0x5ebaf8,null))[_0x85a8('0x48')](handleError(_0x5ebaf8,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index b6329d9..c011b53 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 _0x9ab8=['freshsales_unique_index','idField','FieldId','lodash','util','../../config/logger','bluebird','path','rimraf','./intFreshsalesField.attributes','exports','define','FreshsalesField','int_freshsales_fields'];(function(_0x133763,_0x55acb7){var _0x322548=function(_0x5e5a2d){while(--_0x5e5a2d){_0x133763['push'](_0x133763['shift']());}};_0x322548(++_0x55acb7);}(_0x9ab8,0x81));var _0x89ab=function(_0x2d574,_0x29c472){_0x2d574=_0x2d574-0x0;var _0x35c6a8=_0x9ab8[_0x2d574];return _0x35c6a8;};'use strict';var _=require(_0x89ab('0x0'));var util=require(_0x89ab('0x1'));var logger=require(_0x89ab('0x2'))('api');var moment=require('moment');var BPromise=require(_0x89ab('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x89ab('0x4'));var rimraf=require(_0x89ab('0x5'));var config=require('../../config/environment');var attributes=require(_0x89ab('0x6'));module[_0x89ab('0x7')]=function(_0x2dcf12,_0xb9ec6e){return _0x2dcf12[_0x89ab('0x8')](_0x89ab('0x9'),attributes,{'tableName':_0x89ab('0xa'),'paranoid':![],'indexes':[{'name':_0x89ab('0xb'),'fields':[_0x89ab('0xc'),_0x89ab('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4f7a=['request-promise','rimraf','../../config/environment','./intFreshsalesField.attributes','int_freshsales_fields','freshsales_unique_index','idField','FieldId','../../config/logger','api','moment'];(function(_0x12ce23,_0x1a2816){var _0x3c2dd9=function(_0x49ba73){while(--_0x49ba73){_0x12ce23['push'](_0x12ce23['shift']());}};_0x3c2dd9(++_0x1a2816);}(_0x4f7a,0x105));var _0xa4f7=function(_0x1a4134,_0x4d0760){_0x1a4134=_0x1a4134-0x0;var _0x26c0f2=_0x4f7a[_0x1a4134];return _0x26c0f2;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xa4f7('0x0'))(_0xa4f7('0x1'));var moment=require(_0xa4f7('0x2'));var BPromise=require('bluebird');var rp=require(_0xa4f7('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa4f7('0x4'));var config=require(_0xa4f7('0x5'));var attributes=require(_0xa4f7('0x6'));module['exports']=function(_0x31c8ab,_0x1d7c51){return _0x31c8ab['define']('FreshsalesField',attributes,{'tableName':_0xa4f7('0x7'),'paranoid':![],'indexes':[{'name':_0xa4f7('0x8'),'fields':[_0xa4f7('0x9'),_0xa4f7('0xa')],'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 3c6a7de..b9b84ee 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 _0x4c60=['client','http','request','then','debug','request\x20sent','stringify','error','code','FreshsalesField,\x20%s,\x20%s','message','info','catch','lodash','util','moment','bluebird','ioredis','../../config/environment','jayson/promise'];(function(_0x107390,_0x7e1451){var _0x3824ee=function(_0x1df652){while(--_0x1df652){_0x107390['push'](_0x107390['shift']());}};_0x3824ee(++_0x7e1451);}(_0x4c60,0xc1));var _0x04c6=function(_0x1453a7,_0x29f936){_0x1453a7=_0x1453a7-0x0;var _0xbd9d3=_0x4c60[_0x1453a7];return _0xbd9d3;};'use strict';var _=require(_0x04c6('0x0'));var util=require(_0x04c6('0x1'));var moment=require(_0x04c6('0x2'));var BPromise=require(_0x04c6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x04c6('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x04c6('0x5'));var jayson=require(_0x04c6('0x6'));var client=jayson[_0x04c6('0x7')][_0x04c6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2b9041,_0x39be2d,_0x8f9b13){return new BPromise(function(_0x530a48,_0x2a4b51){return client[_0x04c6('0x9')](_0x2b9041,_0x8f9b13)[_0x04c6('0xa')](function(_0x30b901){logger['info']('FreshsalesField,\x20%s,\x20%s',_0x39be2d,'request\x20sent');logger[_0x04c6('0xb')]('FreshsalesField,\x20%s,\x20%s,\x20%s',_0x39be2d,_0x04c6('0xc'),JSON[_0x04c6('0xd')](_0x30b901));if(_0x30b901['error']){if(_0x30b901[_0x04c6('0xe')][_0x04c6('0xf')]===0x1f4){logger[_0x04c6('0xe')](_0x04c6('0x10'),_0x39be2d,_0x30b901['error'][_0x04c6('0x11')]);return _0x2a4b51(_0x30b901[_0x04c6('0xe')][_0x04c6('0x11')]);}logger['error'](_0x04c6('0x10'),_0x39be2d,_0x30b901[_0x04c6('0xe')][_0x04c6('0x11')]);return _0x530a48(_0x30b901[_0x04c6('0xe')][_0x04c6('0x11')]);}else{logger[_0x04c6('0x12')](_0x04c6('0x10'),_0x39be2d,_0x04c6('0xc'));_0x530a48(_0x30b901['result'][_0x04c6('0x11')]);}})[_0x04c6('0x13')](function(_0x382e58){logger[_0x04c6('0xe')](_0x04c6('0x10'),_0x39be2d,_0x382e58);_0x2a4b51(_0x382e58);});});} \ No newline at end of file +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(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0x4975,0x86));var _0x5497=function(_0x1b1468,_0x7b5a5e){_0x1b1468=_0x1b1468-0x0;var _0x404a18=_0x4975[_0x1b1468];return _0x404a18;};'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 diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index 2dd2104..13d3560 100644 --- a/server/api/intSalesforceAccount/index.js +++ b/server/api/intSalesforceAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x28f190,_0x40412e){var _0x18ac43=function(_0x508b2b){while(--_0x508b2b){_0x28f190['push'](_0x28f190['shift']());}};_0x18ac43(++_0x40412e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xa9e0[_0x387777];return _0x3f84c0;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file +var _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(_0x263bad,_0x3db138){var _0x23f968=function(_0x2aa6fb){while(--_0x2aa6fb){_0x263bad['push'](_0x263bad['shift']());}};_0x23f968(++_0x3db138);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index 2b7a63f..ab1c091 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 _0x5cb4=['sequelize','STRING','username','ENUM','integrationTab','newTab'];(function(_0x5847f8,_0x29ed57){var _0x206d36=function(_0x5d7f1c){while(--_0x5d7f1c){_0x5847f8['push'](_0x5847f8['shift']());}};_0x206d36(++_0x29ed57);}(_0x5cb4,0xc6));var _0x45cb=function(_0x158614,_0x450c78){_0x158614=_0x158614-0x0;var _0x460936=_0x5cb4[_0x158614];return _0x460936;};'use strict';var Sequelize=require(_0x45cb('0x0'));module['exports']={'name':{'type':Sequelize[_0x45cb('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x45cb('0x2')},'remoteUri':{'type':Sequelize[_0x45cb('0x1')]},'password':{'type':Sequelize[_0x45cb('0x1')]},'clientId':{'type':Sequelize[_0x45cb('0x1')]},'clientSecret':{'type':Sequelize[_0x45cb('0x1')]},'securityToken':{'type':Sequelize[_0x45cb('0x1')]},'serverUrl':{'type':Sequelize[_0x45cb('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x45cb('0x3')](_0x45cb('0x4'),_0x45cb('0x5')),'defaultValue':_0x45cb('0x4')}}; \ No newline at end of file +var _0xcf9f=['STRING','username','ENUM','integrationTab','newTab','exports'];(function(_0x3ab5bd,_0x56fbcf){var _0xe4109d=function(_0x36418b){while(--_0x36418b){_0x3ab5bd['push'](_0x3ab5bd['shift']());}};_0xe4109d(++_0x56fbcf);}(_0xcf9f,0x13d));var _0xfcf9=function(_0x126d18,_0x2cf8fd){_0x126d18=_0x126d18-0x0;var _0x4e6c03=_0xcf9f[_0x126d18];return _0x4e6c03;};'use strict';var Sequelize=require('sequelize');module[_0xfcf9('0x0')]={'name':{'type':Sequelize[_0xfcf9('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xfcf9('0x1')],'unique':_0xfcf9('0x2')},'remoteUri':{'type':Sequelize[_0xfcf9('0x1')]},'password':{'type':Sequelize[_0xfcf9('0x1')]},'clientId':{'type':Sequelize[_0xfcf9('0x1')]},'clientSecret':{'type':Sequelize[_0xfcf9('0x1')]},'securityToken':{'type':Sequelize[_0xfcf9('0x1')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xfcf9('0x3')](_0xfcf9('0x4'),_0xfcf9('0x5')),'defaultValue':_0xfcf9('0x4')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index 4b81511..f68a14d 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 _0x26e4=['update','error','stack','name','send','index','map','SalesforceAccount','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','then','includeAll','include','findAll','show','params','rawAttributes','find','catch','create','body','destroy','getConfigurations','SalesforceConfiguration','AccountId','getSubjects','channel','type','getDescriptions','SalesforceField','Subjects','getFields','Task','findOne','remoteUri','clientId','password','securityToken','slice','substring','lastIndexOf','Connection','clientSecret','username','concat','isNil','ticketType','sobject','describe','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','Description','string','picklist','boolean','email','phone','remove','includes','custom','picklistValues','label','True','true','false','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save'];(function(_0x4c205c,_0x15252b){var _0x1ad428=function(_0x2461de){while(--_0x2461de){_0x4c205c['push'](_0x4c205c['shift']());}};_0x1ad428(++_0x15252b);}(_0x26e4,0x1d5));var _0x426e=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x26e4[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require(_0x426e('0x0'));var rimraf=require(_0x426e('0x1'));var zipdir=require(_0x426e('0x2'));var jsonpatch=require(_0x426e('0x3'));var rp=require(_0x426e('0x4'));var moment=require(_0x426e('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x426e('0x6'));var path=require(_0x426e('0x7'));var sox=require(_0x426e('0x8'));var csv=require(_0x426e('0x9'));var ejs=require(_0x426e('0xa'));var fs=require('fs');var fs_extra=require(_0x426e('0xb'));var _=require(_0x426e('0xc'));var squel=require(_0x426e('0xd'));var crypto=require(_0x426e('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x426e('0xf'));var toCsv=require(_0x426e('0x9'));var querystring=require(_0x426e('0x10'));var Papa=require(_0x426e('0x11'));var Redis=require('ioredis');var authService=require(_0x426e('0x12'));var qs=require(_0x426e('0x13'));var as=require(_0x426e('0x14'));var hardwareService=require(_0x426e('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x426e('0x16'));var config=require(_0x426e('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x426e('0x18'))['db'];var integrations=require(_0x426e('0x19'));function respondWithStatusCode(_0x3e4665,_0xdb493c){_0xdb493c=_0xdb493c||0xcc;return function(_0x175159){if(_0x175159){return _0x3e4665[_0x426e('0x1a')](_0xdb493c);}return _0x3e4665[_0x426e('0x1b')](_0xdb493c)[_0x426e('0x1c')]();};}function respondWithResult(_0x17b90d,_0x49f7b9){_0x49f7b9=_0x49f7b9||0xc8;return function(_0x56d4d4){if(_0x56d4d4){return _0x17b90d[_0x426e('0x1b')](_0x49f7b9)[_0x426e('0x1d')](_0x56d4d4);}};}function respondWithFilteredResult(_0x2cb320,_0x183246){return function(_0x32e58e){if(_0x32e58e){var _0xbb18a9=typeof _0x183246['offset']===_0x426e('0x1e')&&typeof _0x183246[_0x426e('0x1f')]==='undefined';var _0x405dfc=_0x32e58e[_0x426e('0x20')];var _0x54e4e0=_0xbb18a9?0x0:_0x183246['offset'];var _0x4c1564=_0xbb18a9?_0x32e58e['count']:_0x183246[_0x426e('0x21')]+_0x183246[_0x426e('0x1f')];var _0x3aa069;if(_0x4c1564>=_0x405dfc){_0x4c1564=_0x405dfc;_0x3aa069=0xc8;}else{_0x3aa069=0xce;}_0x2cb320[_0x426e('0x1b')](_0x3aa069);return _0x2cb320[_0x426e('0x22')](_0x426e('0x23'),_0x54e4e0+'-'+_0x4c1564+'/'+_0x405dfc)[_0x426e('0x1d')](_0x32e58e);}return null;};}function patchUpdates(_0x288be5){return function(_0x4033b3){try{jsonpatch[_0x426e('0x24')](_0x4033b3,_0x288be5,!![]);}catch(_0x141105){return BPromise[_0x426e('0x25')](_0x141105);}return _0x4033b3[_0x426e('0x26')]();};}function saveUpdates(_0x8c4889,_0x452f1a){return function(_0x5e8dc7){if(_0x5e8dc7){return _0x5e8dc7[_0x426e('0x27')](_0x8c4889)['then'](function(_0x510011){return _0x510011;});}return null;};}function removeEntity(_0x1a634c,_0x5645ea){return function(_0x10eff4){if(_0x10eff4){return _0x10eff4['destroy']()['then'](function(){_0x1a634c[_0x426e('0x1b')](0xcc)[_0x426e('0x1c')]();});}};}function handleEntityNotFound(_0x20e51b,_0x4e686f){return function(_0xf5ba2b){if(!_0xf5ba2b){_0x20e51b[_0x426e('0x1a')](0x194);}return _0xf5ba2b;};}function handleError(_0x1fb8c5,_0x2df42d){_0x2df42d=_0x2df42d||0x1f4;return function(_0x393c4c){logger[_0x426e('0x28')](_0x393c4c[_0x426e('0x29')]);if(_0x393c4c[_0x426e('0x2a')]){delete _0x393c4c[_0x426e('0x2a')];}_0x1fb8c5[_0x426e('0x1b')](_0x2df42d)[_0x426e('0x2b')](_0x393c4c);};}exports[_0x426e('0x2c')]=function(_0x47c60a,_0x161ad1){var _0x5361a2={},_0x3a46cc={},_0xb9bee2={'count':0x0,'rows':[]};var _0x4f6dca=_[_0x426e('0x2d')](db[_0x426e('0x2e')]['rawAttributes'],function(_0x3c74d3){return{'name':_0x3c74d3['fieldName'],'type':_0x3c74d3['type'][_0x426e('0x2f')]};});_0x3a46cc[_0x426e('0x30')]=_[_0x426e('0x2d')](_0x4f6dca,'name');_0x3a46cc[_0x426e('0x31')]=_[_0x426e('0x32')](_0x47c60a['query']);_0x3a46cc[_0x426e('0x33')]=_[_0x426e('0x34')](_0x3a46cc[_0x426e('0x30')],_0x3a46cc['query']);_0x5361a2[_0x426e('0x35')]=_[_0x426e('0x34')](_0x3a46cc[_0x426e('0x30')],qs['fields'](_0x47c60a['query'][_0x426e('0x36')]));_0x5361a2['attributes']=_0x5361a2['attributes'][_0x426e('0x37')]?_0x5361a2['attributes']:_0x3a46cc[_0x426e('0x30')];if(!_0x47c60a[_0x426e('0x31')][_0x426e('0x38')](_0x426e('0x39'))){_0x5361a2[_0x426e('0x1f')]=qs[_0x426e('0x1f')](_0x47c60a[_0x426e('0x31')]['limit']);_0x5361a2[_0x426e('0x21')]=qs[_0x426e('0x21')](_0x47c60a[_0x426e('0x31')][_0x426e('0x21')]);}_0x5361a2[_0x426e('0x3a')]=qs[_0x426e('0x3b')](_0x47c60a['query'][_0x426e('0x3b')]);_0x5361a2[_0x426e('0x3c')]=qs[_0x426e('0x33')](_[_0x426e('0x3d')](_0x47c60a[_0x426e('0x31')],_0x3a46cc[_0x426e('0x33')]),_0x4f6dca);if(_0x47c60a[_0x426e('0x31')][_0x426e('0x3e')]){_0x5361a2['where']=_[_0x426e('0x3f')](_0x5361a2[_0x426e('0x3c')],{'$or':_[_0x426e('0x2d')](_0x4f6dca,function(_0x15014f){if(_0x15014f['type']!=='VIRTUAL'){var _0x2fe9ce={};_0x2fe9ce[_0x15014f['name']]={'$like':'%'+_0x47c60a[_0x426e('0x31')][_0x426e('0x3e')]+'%'};return _0x2fe9ce;}})});}_0x5361a2=_[_0x426e('0x3f')]({},_0x5361a2,_0x47c60a[_0x426e('0x40')]);var _0x4d1631={'where':_0x5361a2['where']};return db[_0x426e('0x2e')][_0x426e('0x20')](_0x4d1631)[_0x426e('0x41')](function(_0x470f87){_0xb9bee2[_0x426e('0x20')]=_0x470f87;if(_0x47c60a[_0x426e('0x31')][_0x426e('0x42')]){_0x5361a2[_0x426e('0x43')]=[{'all':!![]}];}return db[_0x426e('0x2e')][_0x426e('0x44')](_0x5361a2);})[_0x426e('0x41')](function(_0x4b2c89){_0xb9bee2['rows']=_0x4b2c89;return _0xb9bee2;})[_0x426e('0x41')](respondWithFilteredResult(_0x161ad1,_0x5361a2))['catch'](handleError(_0x161ad1,null));};exports[_0x426e('0x45')]=function(_0x1a3e47,_0xca25cd){var _0x5d95e6={'raw':![],'where':{'id':_0x1a3e47[_0x426e('0x46')]['id']}},_0x417991={};_0x417991['model']=_[_0x426e('0x32')](db[_0x426e('0x2e')][_0x426e('0x47')]);_0x417991[_0x426e('0x31')]=_['keys'](_0x1a3e47[_0x426e('0x31')]);_0x417991[_0x426e('0x33')]=_['intersection'](_0x417991[_0x426e('0x30')],_0x417991[_0x426e('0x31')]);_0x5d95e6[_0x426e('0x35')]=_[_0x426e('0x34')](_0x417991['model'],qs[_0x426e('0x36')](_0x1a3e47[_0x426e('0x31')][_0x426e('0x36')]));_0x5d95e6[_0x426e('0x35')]=_0x5d95e6[_0x426e('0x35')][_0x426e('0x37')]?_0x5d95e6[_0x426e('0x35')]:_0x417991[_0x426e('0x30')];if(_0x1a3e47[_0x426e('0x31')][_0x426e('0x42')]){_0x5d95e6['include']=[{'all':!![]}];}_0x5d95e6=_[_0x426e('0x3f')]({},_0x5d95e6,_0x1a3e47['options']);return db['SalesforceAccount'][_0x426e('0x48')](_0x5d95e6)[_0x426e('0x41')](handleEntityNotFound(_0xca25cd,null))[_0x426e('0x41')](respondWithResult(_0xca25cd,null))[_0x426e('0x49')](handleError(_0xca25cd,null));};exports['create']=function(_0x328e13,_0x335706){return db['SalesforceAccount'][_0x426e('0x4a')](_0x328e13[_0x426e('0x4b')],{})['then'](respondWithResult(_0x335706,0xc9))[_0x426e('0x49')](handleError(_0x335706,null));};exports['update']=function(_0x4f6014,_0x1a045a){if(_0x4f6014[_0x426e('0x4b')]['id']){delete _0x4f6014['body']['id'];}return db[_0x426e('0x2e')][_0x426e('0x48')]({'where':{'id':_0x4f6014[_0x426e('0x46')]['id']}})[_0x426e('0x41')](handleEntityNotFound(_0x1a045a,null))[_0x426e('0x41')](saveUpdates(_0x4f6014[_0x426e('0x4b')],null))[_0x426e('0x41')](respondWithResult(_0x1a045a,null))[_0x426e('0x49')](handleError(_0x1a045a,null));};exports[_0x426e('0x4c')]=function(_0xcabba1,_0x4d751e){return db[_0x426e('0x2e')][_0x426e('0x48')]({'where':{'id':_0xcabba1[_0x426e('0x46')]['id']}})['then'](handleEntityNotFound(_0x4d751e,null))[_0x426e('0x41')](removeEntity(_0x4d751e,null))[_0x426e('0x49')](handleError(_0x4d751e,null));};exports[_0x426e('0x4d')]=function(_0x2c882d,_0x508754,_0x25397c){var _0x22cb3e={};var _0x257564={};var _0x474a2c;var _0x11abd2;return db[_0x426e('0x2e')]['findOne']({'where':{'id':_0x2c882d[_0x426e('0x46')]['id']}})[_0x426e('0x41')](handleEntityNotFound(_0x508754,null))[_0x426e('0x41')](function(_0x335a70){if(_0x335a70){_0x474a2c=_0x335a70;_0x257564[_0x426e('0x30')]=_[_0x426e('0x32')](db[_0x426e('0x4e')][_0x426e('0x47')]);_0x257564[_0x426e('0x31')]=_[_0x426e('0x32')](_0x2c882d['query']);_0x257564[_0x426e('0x33')]=_[_0x426e('0x34')](_0x257564[_0x426e('0x30')],_0x257564[_0x426e('0x31')]);_0x22cb3e['attributes']=_[_0x426e('0x34')](_0x257564[_0x426e('0x30')],qs[_0x426e('0x36')](_0x2c882d['query'][_0x426e('0x36')]));_0x22cb3e[_0x426e('0x35')]=_0x22cb3e[_0x426e('0x35')][_0x426e('0x37')]?_0x22cb3e['attributes']:_0x257564[_0x426e('0x30')];_0x22cb3e[_0x426e('0x3a')]=qs[_0x426e('0x3b')](_0x2c882d['query'][_0x426e('0x3b')]);_0x22cb3e[_0x426e('0x3c')]=qs[_0x426e('0x33')](_[_0x426e('0x3d')](_0x2c882d[_0x426e('0x31')],_0x257564[_0x426e('0x33')]));if(_0x2c882d[_0x426e('0x31')][_0x426e('0x3e')]){_0x22cb3e[_0x426e('0x3c')]=_[_0x426e('0x3f')](_0x22cb3e['where'],{'$or':_['map'](_0x22cb3e['attributes'],function(_0x12a2d0){var _0x140eac={};_0x140eac[_0x12a2d0]={'$like':'%'+_0x2c882d[_0x426e('0x31')]['filter']+'%'};return _0x140eac;})});}_0x22cb3e=_[_0x426e('0x3f')]({},_0x22cb3e,_0x2c882d[_0x426e('0x40')]);return _0x474a2c[_0x426e('0x4d')](_0x22cb3e);}})['then'](function(_0x1fc803){if(_0x1fc803){_0x11abd2=_0x1fc803[_0x426e('0x37')];if(!_0x2c882d[_0x426e('0x31')][_0x426e('0x38')](_0x426e('0x39'))){_0x22cb3e[_0x426e('0x1f')]=qs['limit'](_0x2c882d[_0x426e('0x31')]['limit']);_0x22cb3e[_0x426e('0x21')]=qs[_0x426e('0x21')](_0x2c882d[_0x426e('0x31')][_0x426e('0x21')]);}return _0x474a2c[_0x426e('0x4d')](_0x22cb3e);}})[_0x426e('0x41')](function(_0x4be9aa){if(_0x4be9aa){return _0x4be9aa?{'count':_0x11abd2,'rows':_0x4be9aa}:null;}})[_0x426e('0x41')](respondWithResult(_0x508754,null))[_0x426e('0x49')](handleError(_0x508754,null));};exports['addConfiguration']=function(_0x2f4bde,_0x1579b4,_0x131b06){if(_0x2f4bde[_0x426e('0x4b')]['id']){delete _0x2f4bde['body']['id'];}return db[_0x426e('0x2e')]['findOne']({'where':{'id':_0x2f4bde[_0x426e('0x46')]['id']}})[_0x426e('0x41')](handleEntityNotFound(_0x1579b4,null))[_0x426e('0x41')](function(_0x1e660){if(_0x1e660){_0x2f4bde[_0x426e('0x4b')][_0x426e('0x4f')]=_0x1e660['id'];_0x2f4bde['body']['Subjects']=integrations[_0x426e('0x50')](_0x2f4bde[_0x426e('0x4b')][_0x426e('0x51')],_0x2f4bde[_0x426e('0x4b')][_0x426e('0x52')]);_0x2f4bde[_0x426e('0x4b')]['Descriptions']=integrations[_0x426e('0x53')](_0x2f4bde[_0x426e('0x4b')][_0x426e('0x51')],_0x2f4bde[_0x426e('0x4b')][_0x426e('0x52')]);return db[_0x426e('0x4e')][_0x426e('0x4a')](_0x2f4bde[_0x426e('0x4b')],{'include':[{'model':db[_0x426e('0x54')],'as':_0x426e('0x55')},{'model':db[_0x426e('0x54')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x1579b4,null))[_0x426e('0x49')](handleError(_0x1579b4,null));};exports[_0x426e('0x56')]=function(_0x3c3bc1,_0x5865a6,_0x4c011c){var _0x3ca7ee;var _0x2b4581='';var _0x102a82=_0x426e('0x57');return db[_0x426e('0x2e')][_0x426e('0x58')]({'where':{'id':_0x3c3bc1['params']['id']},'attributes':['id',_0x426e('0x59'),_0x426e('0x5a'),'clientSecret','username',_0x426e('0x5b'),_0x426e('0x5c')]})[_0x426e('0x41')](handleEntityNotFound(_0x5865a6,null))[_0x426e('0x41')](function(_0x4ed181){if(_0x4ed181){_0x2b4581=_0x4ed181[_0x426e('0x59')];var _0xbedd83=_0x2b4581[_0x426e('0x5d')](-0x1);if(_0xbedd83==='/'){_0x2b4581=_0x2b4581[_0x426e('0x5e')](0x0,_0x2b4581[_0x426e('0x5f')](_0xbedd83));}_0x3ca7ee=new jsforce[(_0x426e('0x60'))]({'oauth2':{'loginUrl':_0x2b4581,'clientId':_0x4ed181[_0x426e('0x5a')],'clientSecret':_0x4ed181[_0x426e('0x61')]}});return _0x3ca7ee['login'](_0x4ed181[_0x426e('0x62')],_0x4ed181[_0x426e('0x5b')][_0x426e('0x63')](_0x4ed181[_0x426e('0x5c')]));}})[_0x426e('0x41')](function(_0x31b2f3){if(_0x31b2f3){if(!_[_0x426e('0x64')](_0x3c3bc1['query'][_0x426e('0x65')])){_0x102a82=_0x3c3bc1[_0x426e('0x31')][_0x426e('0x65')];}return _0x3ca7ee[_0x426e('0x66')](_0x102a82)[_0x426e('0x67')]();}})[_0x426e('0x41')](function(_0x23cac7){var _0xe8cd2e=[_0x426e('0x68'),_0x426e('0x69'),_0x426e('0x6a'),_0x426e('0x6b'),'Subject',_0x426e('0x6c')];var _0x23a011=[_0x426e('0x6d'),'int',_0x426e('0x6e'),_0x426e('0x6f'),_0x426e('0x70'),'textarea',_0x426e('0x71')];if(_0x23cac7){_[_0x426e('0x72')](_0x23cac7['fields'],function(_0x3a65ff){return _0xe8cd2e[_0x426e('0x73')](_0x3a65ff['name'])||!_0x23a011['includes'](_0x3a65ff['type']);});return{'count':_0x23cac7[_0x426e('0x36')][_0x426e('0x37')],'rows':_['map'](_0x23cac7[_0x426e('0x36')],function(_0x1c9a9a){return{'id':_0x1c9a9a[_0x426e('0x2a')],'name':_0x1c9a9a['label'],'custom':_0x1c9a9a[_0x426e('0x74')],'options':_0x1c9a9a[_0x426e('0x75')][_0x426e('0x37')]>0x0?_[_0x426e('0x2d')](_0x1c9a9a[_0x426e('0x75')],function(_0x5dba2d){return{'name':_0x5dba2d[_0x426e('0x76')],'value':_0x5dba2d['value']};}):_0x1c9a9a[_0x426e('0x52')]==_0x426e('0x6f')?[{'name':_0x426e('0x77'),'value':_0x426e('0x78')},{'name':'False','value':_0x426e('0x79')}]:[]};})};}})[_0x426e('0x41')](respondWithResult(_0x5865a6,null))[_0x426e('0x49')](function(_0x31b895){var _0x479f4b=_0x3c3bc1[_0x426e('0x31')]['test']?0x1f4:_0x31b895['statusCode']||0x1f4;logger[_0x426e('0x28')](_0x426e('0x7a'),'getFields',_0x479f4b,JSON[_0x426e('0x7b')](_0x31b895));delete _0x31b895['name'];if(_0x479f4b===0x191){_0x479f4b=0x190;}_0x5865a6['status'](_0x479f4b)[_0x426e('0x2b')](_0x3c3bc1[_0x426e('0x31')][_0x426e('0x7c')]?{'message':_0x426e('0x7d'),'statusCode':_0x31b895[_0x426e('0x7e')]}:_0x31b895);});}; \ No newline at end of file +var _0x29da=['keys','intersection','attributes','fields','query','sort','filters','where','merge','VIRTUAL','filter','options','SalesforceAccount','count','include','rows','show','params','length','includeAll','find','catch','create','body','destroy','getConfigurations','findOne','pick','hasOwnProperty','nolimit','addConfiguration','Subjects','channel','Descriptions','getDescriptions','SalesforceConfiguration','SalesforceField','getFields','Task','remoteUri','clientId','username','password','securityToken','slice','substring','lastIndexOf','Connection','concat','isNil','ticketType','OwnerId','ActivityDate','IsRecurrence','Subject','Description','string','picklist','boolean','email','textarea','phone','remove','includes','label','custom','picklistValues','value','True','true','False','false','test','statusCode','Wrong\x20credentials','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','undefined','limit','offset','set','json','apply','reject','save','update','then','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map'];(function(_0x20d514,_0x539b3c){var _0x16d64e=function(_0x53ccc1){while(--_0x53ccc1){_0x20d514['push'](_0x20d514['shift']());}};_0x16d64e(++_0x539b3c);}(_0x29da,0x143));var _0xa29d=function(_0x174d5e,_0x1d7bd9){_0x174d5e=_0x174d5e-0x0;var _0x4ba358=_0x29da[_0x174d5e];return _0x4ba358;};'use strict';var emlformat=require(_0xa29d('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa29d('0x1'));var rp=require(_0xa29d('0x2'));var moment=require(_0xa29d('0x3'));var BPromise=require(_0xa29d('0x4'));var Mustache=require(_0xa29d('0x5'));var util=require('util');var path=require('path');var sox=require(_0xa29d('0x6'));var csv=require(_0xa29d('0x7'));var ejs=require(_0xa29d('0x8'));var fs=require('fs');var fs_extra=require(_0xa29d('0x9'));var _=require(_0xa29d('0xa'));var squel=require(_0xa29d('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xa29d('0xc'));var toCsv=require(_0xa29d('0x7'));var querystring=require('querystring');var Papa=require(_0xa29d('0xd'));var Redis=require(_0xa29d('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xa29d('0xf'));var as=require(_0xa29d('0x10'));var hardwareService=require(_0xa29d('0x11'));var logger=require(_0xa29d('0x12'))(_0xa29d('0x13'));var utils=require(_0xa29d('0x14'));var config=require(_0xa29d('0x15'));var licenseUtil=require(_0xa29d('0x16'));var db=require(_0xa29d('0x17'))['db'];var integrations=require(_0xa29d('0x18'));function respondWithStatusCode(_0x45a3d8,_0x5dd455){_0x5dd455=_0x5dd455||0xcc;return function(_0x4d3b6e){if(_0x4d3b6e){return _0x45a3d8[_0xa29d('0x19')](_0x5dd455);}return _0x45a3d8[_0xa29d('0x1a')](_0x5dd455)[_0xa29d('0x1b')]();};}function respondWithResult(_0x477d0e,_0x14bce6){_0x14bce6=_0x14bce6||0xc8;return function(_0x589651){if(_0x589651){return _0x477d0e[_0xa29d('0x1a')](_0x14bce6)['json'](_0x589651);}};}function respondWithFilteredResult(_0x4aae28,_0xeef771){return function(_0x32074d){if(_0x32074d){var _0x2e3ba2=typeof _0xeef771['offset']===_0xa29d('0x1c')&&typeof _0xeef771[_0xa29d('0x1d')]===_0xa29d('0x1c');var _0x227516=_0x32074d['count'];var _0x15174a=_0x2e3ba2?0x0:_0xeef771[_0xa29d('0x1e')];var _0x4f6e37=_0x2e3ba2?_0x32074d['count']:_0xeef771[_0xa29d('0x1e')]+_0xeef771[_0xa29d('0x1d')];var _0x22e063;if(_0x4f6e37>=_0x227516){_0x4f6e37=_0x227516;_0x22e063=0xc8;}else{_0x22e063=0xce;}_0x4aae28['status'](_0x22e063);return _0x4aae28[_0xa29d('0x1f')]('Content-Range',_0x15174a+'-'+_0x4f6e37+'/'+_0x227516)[_0xa29d('0x20')](_0x32074d);}return null;};}function patchUpdates(_0x451607){return function(_0x4a693e){try{jsonpatch[_0xa29d('0x21')](_0x4a693e,_0x451607,!![]);}catch(_0x5c5192){return BPromise[_0xa29d('0x22')](_0x5c5192);}return _0x4a693e[_0xa29d('0x23')]();};}function saveUpdates(_0xd426bb,_0x32eaed){return function(_0x296e7d){if(_0x296e7d){return _0x296e7d[_0xa29d('0x24')](_0xd426bb)['then'](function(_0x1266c4){return _0x1266c4;});}return null;};}function removeEntity(_0x49b63f,_0x45ffe3){return function(_0x2789d6){if(_0x2789d6){return _0x2789d6['destroy']()[_0xa29d('0x25')](function(){_0x49b63f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d3d10,_0x5a5548){return function(_0x6bca24){if(!_0x6bca24){_0x5d3d10[_0xa29d('0x19')](0x194);}return _0x6bca24;};}function handleError(_0x33ae3e,_0x24c255){_0x24c255=_0x24c255||0x1f4;return function(_0x49da06){logger[_0xa29d('0x26')](_0x49da06[_0xa29d('0x27')]);if(_0x49da06[_0xa29d('0x28')]){delete _0x49da06[_0xa29d('0x28')];}_0x33ae3e[_0xa29d('0x1a')](_0x24c255)[_0xa29d('0x29')](_0x49da06);};}exports[_0xa29d('0x2a')]=function(_0x5713b2,_0x365289){var _0x5510e3={},_0xca866f={},_0x261dac={'count':0x0,'rows':[]};var _0x4d9081=_['map'](db['SalesforceAccount'][_0xa29d('0x2b')],function(_0x44c83d){return{'name':_0x44c83d[_0xa29d('0x2c')],'type':_0x44c83d[_0xa29d('0x2d')][_0xa29d('0x2e')]};});_0xca866f[_0xa29d('0x2f')]=_[_0xa29d('0x30')](_0x4d9081,_0xa29d('0x28'));_0xca866f['query']=_[_0xa29d('0x31')](_0x5713b2['query']);_0xca866f['filters']=_[_0xa29d('0x32')](_0xca866f[_0xa29d('0x2f')],_0xca866f['query']);_0x5510e3[_0xa29d('0x33')]=_[_0xa29d('0x32')](_0xca866f[_0xa29d('0x2f')],qs[_0xa29d('0x34')](_0x5713b2[_0xa29d('0x35')][_0xa29d('0x34')]));_0x5510e3[_0xa29d('0x33')]=_0x5510e3[_0xa29d('0x33')]['length']?_0x5510e3[_0xa29d('0x33')]:_0xca866f[_0xa29d('0x2f')];if(!_0x5713b2[_0xa29d('0x35')]['hasOwnProperty']('nolimit')){_0x5510e3[_0xa29d('0x1d')]=qs[_0xa29d('0x1d')](_0x5713b2[_0xa29d('0x35')][_0xa29d('0x1d')]);_0x5510e3[_0xa29d('0x1e')]=qs['offset'](_0x5713b2[_0xa29d('0x35')][_0xa29d('0x1e')]);}_0x5510e3['order']=qs[_0xa29d('0x36')](_0x5713b2[_0xa29d('0x35')][_0xa29d('0x36')]);_0x5510e3['where']=qs[_0xa29d('0x37')](_['pick'](_0x5713b2[_0xa29d('0x35')],_0xca866f[_0xa29d('0x37')]),_0x4d9081);if(_0x5713b2['query']['filter']){_0x5510e3[_0xa29d('0x38')]=_[_0xa29d('0x39')](_0x5510e3[_0xa29d('0x38')],{'$or':_[_0xa29d('0x30')](_0x4d9081,function(_0x1fe1a4){if(_0x1fe1a4['type']!==_0xa29d('0x3a')){var _0x1c71e4={};_0x1c71e4[_0x1fe1a4[_0xa29d('0x28')]]={'$like':'%'+_0x5713b2[_0xa29d('0x35')][_0xa29d('0x3b')]+'%'};return _0x1c71e4;}})});}_0x5510e3=_[_0xa29d('0x39')]({},_0x5510e3,_0x5713b2[_0xa29d('0x3c')]);var _0x1c1311={'where':_0x5510e3[_0xa29d('0x38')]};return db[_0xa29d('0x3d')][_0xa29d('0x3e')](_0x1c1311)[_0xa29d('0x25')](function(_0x252eaa){_0x261dac['count']=_0x252eaa;if(_0x5713b2['query']['includeAll']){_0x5510e3[_0xa29d('0x3f')]=[{'all':!![]}];}return db[_0xa29d('0x3d')]['findAll'](_0x5510e3);})[_0xa29d('0x25')](function(_0x33a3e2){_0x261dac[_0xa29d('0x40')]=_0x33a3e2;return _0x261dac;})[_0xa29d('0x25')](respondWithFilteredResult(_0x365289,_0x5510e3))['catch'](handleError(_0x365289,null));};exports[_0xa29d('0x41')]=function(_0x3ce29e,_0x133389){var _0x440db5={'raw':![],'where':{'id':_0x3ce29e[_0xa29d('0x42')]['id']}},_0x4cce22={};_0x4cce22[_0xa29d('0x2f')]=_[_0xa29d('0x31')](db[_0xa29d('0x3d')][_0xa29d('0x2b')]);_0x4cce22[_0xa29d('0x35')]=_[_0xa29d('0x31')](_0x3ce29e['query']);_0x4cce22['filters']=_[_0xa29d('0x32')](_0x4cce22[_0xa29d('0x2f')],_0x4cce22['query']);_0x440db5[_0xa29d('0x33')]=_['intersection'](_0x4cce22[_0xa29d('0x2f')],qs['fields'](_0x3ce29e[_0xa29d('0x35')]['fields']));_0x440db5[_0xa29d('0x33')]=_0x440db5['attributes'][_0xa29d('0x43')]?_0x440db5[_0xa29d('0x33')]:_0x4cce22[_0xa29d('0x2f')];if(_0x3ce29e[_0xa29d('0x35')][_0xa29d('0x44')]){_0x440db5[_0xa29d('0x3f')]=[{'all':!![]}];}_0x440db5=_[_0xa29d('0x39')]({},_0x440db5,_0x3ce29e['options']);return db[_0xa29d('0x3d')][_0xa29d('0x45')](_0x440db5)[_0xa29d('0x25')](handleEntityNotFound(_0x133389,null))[_0xa29d('0x25')](respondWithResult(_0x133389,null))[_0xa29d('0x46')](handleError(_0x133389,null));};exports[_0xa29d('0x47')]=function(_0x4a11e5,_0x504eb3){return db[_0xa29d('0x3d')]['create'](_0x4a11e5[_0xa29d('0x48')],{})[_0xa29d('0x25')](respondWithResult(_0x504eb3,0xc9))[_0xa29d('0x46')](handleError(_0x504eb3,null));};exports[_0xa29d('0x24')]=function(_0x194da3,_0x5cd703){if(_0x194da3[_0xa29d('0x48')]['id']){delete _0x194da3[_0xa29d('0x48')]['id'];}return db[_0xa29d('0x3d')][_0xa29d('0x45')]({'where':{'id':_0x194da3['params']['id']}})['then'](handleEntityNotFound(_0x5cd703,null))[_0xa29d('0x25')](saveUpdates(_0x194da3[_0xa29d('0x48')],null))[_0xa29d('0x25')](respondWithResult(_0x5cd703,null))['catch'](handleError(_0x5cd703,null));};exports[_0xa29d('0x49')]=function(_0x440ff1,_0x4bd1df){return db['SalesforceAccount'][_0xa29d('0x45')]({'where':{'id':_0x440ff1['params']['id']}})[_0xa29d('0x25')](handleEntityNotFound(_0x4bd1df,null))[_0xa29d('0x25')](removeEntity(_0x4bd1df,null))['catch'](handleError(_0x4bd1df,null));};exports[_0xa29d('0x4a')]=function(_0x413075,_0x2a4242,_0x36305d){var _0x329317={};var _0x4054d5={};var _0x34cca1;var _0x167b85;return db[_0xa29d('0x3d')][_0xa29d('0x4b')]({'where':{'id':_0x413075['params']['id']}})[_0xa29d('0x25')](handleEntityNotFound(_0x2a4242,null))['then'](function(_0x5f1258){if(_0x5f1258){_0x34cca1=_0x5f1258;_0x4054d5[_0xa29d('0x2f')]=_[_0xa29d('0x31')](db['SalesforceConfiguration'][_0xa29d('0x2b')]);_0x4054d5['query']=_['keys'](_0x413075[_0xa29d('0x35')]);_0x4054d5[_0xa29d('0x37')]=_[_0xa29d('0x32')](_0x4054d5[_0xa29d('0x2f')],_0x4054d5[_0xa29d('0x35')]);_0x329317[_0xa29d('0x33')]=_['intersection'](_0x4054d5[_0xa29d('0x2f')],qs['fields'](_0x413075[_0xa29d('0x35')][_0xa29d('0x34')]));_0x329317['attributes']=_0x329317[_0xa29d('0x33')][_0xa29d('0x43')]?_0x329317[_0xa29d('0x33')]:_0x4054d5[_0xa29d('0x2f')];_0x329317['order']=qs[_0xa29d('0x36')](_0x413075['query']['sort']);_0x329317[_0xa29d('0x38')]=qs['filters'](_[_0xa29d('0x4c')](_0x413075[_0xa29d('0x35')],_0x4054d5[_0xa29d('0x37')]));if(_0x413075[_0xa29d('0x35')][_0xa29d('0x3b')]){_0x329317[_0xa29d('0x38')]=_[_0xa29d('0x39')](_0x329317['where'],{'$or':_[_0xa29d('0x30')](_0x329317[_0xa29d('0x33')],function(_0x297928){var _0x4bedba={};_0x4bedba[_0x297928]={'$like':'%'+_0x413075[_0xa29d('0x35')][_0xa29d('0x3b')]+'%'};return _0x4bedba;})});}_0x329317=_['merge']({},_0x329317,_0x413075[_0xa29d('0x3c')]);return _0x34cca1[_0xa29d('0x4a')](_0x329317);}})[_0xa29d('0x25')](function(_0x7fbdb8){if(_0x7fbdb8){_0x167b85=_0x7fbdb8[_0xa29d('0x43')];if(!_0x413075['query'][_0xa29d('0x4d')](_0xa29d('0x4e'))){_0x329317[_0xa29d('0x1d')]=qs[_0xa29d('0x1d')](_0x413075['query'][_0xa29d('0x1d')]);_0x329317[_0xa29d('0x1e')]=qs[_0xa29d('0x1e')](_0x413075[_0xa29d('0x35')]['offset']);}return _0x34cca1[_0xa29d('0x4a')](_0x329317);}})[_0xa29d('0x25')](function(_0x375a4e){if(_0x375a4e){return _0x375a4e?{'count':_0x167b85,'rows':_0x375a4e}:null;}})[_0xa29d('0x25')](respondWithResult(_0x2a4242,null))['catch'](handleError(_0x2a4242,null));};exports[_0xa29d('0x4f')]=function(_0x3ddcf5,_0x3d93ba,_0x316df0){if(_0x3ddcf5[_0xa29d('0x48')]['id']){delete _0x3ddcf5['body']['id'];}return db[_0xa29d('0x3d')]['findOne']({'where':{'id':_0x3ddcf5[_0xa29d('0x42')]['id']}})['then'](handleEntityNotFound(_0x3d93ba,null))[_0xa29d('0x25')](function(_0x3565b8){if(_0x3565b8){_0x3ddcf5[_0xa29d('0x48')]['AccountId']=_0x3565b8['id'];_0x3ddcf5[_0xa29d('0x48')][_0xa29d('0x50')]=integrations['getSubjects'](_0x3ddcf5[_0xa29d('0x48')][_0xa29d('0x51')],_0x3ddcf5[_0xa29d('0x48')][_0xa29d('0x2d')]);_0x3ddcf5[_0xa29d('0x48')][_0xa29d('0x52')]=integrations[_0xa29d('0x53')](_0x3ddcf5['body']['channel'],_0x3ddcf5[_0xa29d('0x48')][_0xa29d('0x2d')]);return db[_0xa29d('0x54')][_0xa29d('0x47')](_0x3ddcf5[_0xa29d('0x48')],{'include':[{'model':db[_0xa29d('0x55')],'as':'Subjects'},{'model':db['SalesforceField'],'as':'Descriptions'}]});}return null;})[_0xa29d('0x25')](respondWithResult(_0x3d93ba,null))['catch'](handleError(_0x3d93ba,null));};exports[_0xa29d('0x56')]=function(_0x352989,_0x44c375,_0x38839d){var _0x1fc21c;var _0x5f1d7c='';var _0x4e0370=_0xa29d('0x57');return db[_0xa29d('0x3d')][_0xa29d('0x4b')]({'where':{'id':_0x352989[_0xa29d('0x42')]['id']},'attributes':['id',_0xa29d('0x58'),_0xa29d('0x59'),'clientSecret',_0xa29d('0x5a'),_0xa29d('0x5b'),_0xa29d('0x5c')]})[_0xa29d('0x25')](handleEntityNotFound(_0x44c375,null))[_0xa29d('0x25')](function(_0xb53bea){if(_0xb53bea){_0x5f1d7c=_0xb53bea['remoteUri'];var _0x2a2192=_0x5f1d7c[_0xa29d('0x5d')](-0x1);if(_0x2a2192==='/'){_0x5f1d7c=_0x5f1d7c[_0xa29d('0x5e')](0x0,_0x5f1d7c[_0xa29d('0x5f')](_0x2a2192));}_0x1fc21c=new jsforce[(_0xa29d('0x60'))]({'oauth2':{'loginUrl':_0x5f1d7c,'clientId':_0xb53bea[_0xa29d('0x59')],'clientSecret':_0xb53bea['clientSecret']}});return _0x1fc21c['login'](_0xb53bea['username'],_0xb53bea[_0xa29d('0x5b')][_0xa29d('0x61')](_0xb53bea[_0xa29d('0x5c')]));}})[_0xa29d('0x25')](function(_0x181884){if(_0x181884){if(!_[_0xa29d('0x62')](_0x352989[_0xa29d('0x35')]['ticketType'])){_0x4e0370=_0x352989['query'][_0xa29d('0x63')];}return _0x1fc21c['sobject'](_0x4e0370)['describe']();}})['then'](function(_0x4cc7b8){var _0x5f27f3=[_0xa29d('0x64'),_0xa29d('0x65'),'IsReminderSet',_0xa29d('0x66'),_0xa29d('0x67'),_0xa29d('0x68')];var _0x32ddd7=[_0xa29d('0x69'),'int',_0xa29d('0x6a'),_0xa29d('0x6b'),_0xa29d('0x6c'),_0xa29d('0x6d'),_0xa29d('0x6e')];if(_0x4cc7b8){_[_0xa29d('0x6f')](_0x4cc7b8[_0xa29d('0x34')],function(_0x1321e3){return _0x5f27f3['includes'](_0x1321e3[_0xa29d('0x28')])||!_0x32ddd7[_0xa29d('0x70')](_0x1321e3[_0xa29d('0x2d')]);});return{'count':_0x4cc7b8['fields'][_0xa29d('0x43')],'rows':_[_0xa29d('0x30')](_0x4cc7b8['fields'],function(_0x391c98){return{'id':_0x391c98[_0xa29d('0x28')],'name':_0x391c98[_0xa29d('0x71')],'custom':_0x391c98[_0xa29d('0x72')],'options':_0x391c98[_0xa29d('0x73')][_0xa29d('0x43')]>0x0?_[_0xa29d('0x30')](_0x391c98[_0xa29d('0x73')],function(_0x353665){return{'name':_0x353665[_0xa29d('0x71')],'value':_0x353665[_0xa29d('0x74')]};}):_0x391c98['type']=='boolean'?[{'name':_0xa29d('0x75'),'value':_0xa29d('0x76')},{'name':_0xa29d('0x77'),'value':_0xa29d('0x78')}]:[]};})};}})[_0xa29d('0x25')](respondWithResult(_0x44c375,null))[_0xa29d('0x46')](function(_0x3d89ff){var _0x2978be=_0x352989[_0xa29d('0x35')][_0xa29d('0x79')]?0x1f4:_0x3d89ff[_0xa29d('0x7a')]||0x1f4;logger[_0xa29d('0x26')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x2978be,JSON['stringify'](_0x3d89ff));delete _0x3d89ff['name'];if(_0x2978be===0x191){_0x2978be=0x190;}_0x44c375[_0xa29d('0x1a')](_0x2978be)['send'](_0x352989[_0xa29d('0x35')][_0xa29d('0x79')]?{'message':_0xa29d('0x7b'),'statusCode':_0x3d89ff[_0xa29d('0x7a')]}:_0x3d89ff);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 09153a6..8306cc2 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 _0xd583=['../../components/integrations/configuration','SalesforceAccount','lodash','util','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x22185a,_0x2c9c0f){var _0x27e1f1=function(_0x9ed420){while(--_0x9ed420){_0x22185a['push'](_0x22185a['shift']());}};_0x27e1f1(++_0x2c9c0f);}(_0xd583,0xec));var _0x3d58=function(_0x223684,_0x47b350){_0x223684=_0x223684-0x0;var _0x40fca9=_0xd583[_0x223684];return _0x40fca9;};'use strict';var _=require(_0x3d58('0x0'));var util=require(_0x3d58('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x3d58('0x2'));var BPromise=require(_0x3d58('0x3'));var rp=require(_0x3d58('0x4'));var fs=require('fs');var path=require(_0x3d58('0x5'));var rimraf=require('rimraf');var config=require(_0x3d58('0x6'));var attributes=require('./intSalesforceAccount.attributes');var integrations=require(_0x3d58('0x7'));module['exports']=function(_0x22412c,_0x56e960){return _0x22412c['define'](_0x3d58('0x8'),attributes,{'tableName':'int_salesforce_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x65e9=['util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','define','SalesforceAccount','lodash'];(function(_0x5bdd45,_0x174a62){var _0x387fb5=function(_0x20736d){while(--_0x20736d){_0x5bdd45['push'](_0x5bdd45['shift']());}};_0x387fb5(++_0x174a62);}(_0x65e9,0x15e));var _0x965e=function(_0x43f390,_0x11bda7){_0x43f390=_0x43f390-0x0;var _0x199a49=_0x65e9[_0x43f390];return _0x199a49;};'use strict';var _=require(_0x965e('0x0'));var util=require(_0x965e('0x1'));var logger=require('../../config/logger')(_0x965e('0x2'));var moment=require(_0x965e('0x3'));var BPromise=require(_0x965e('0x4'));var rp=require(_0x965e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x965e('0x6'));var config=require(_0x965e('0x7'));var attributes=require(_0x965e('0x8'));var integrations=require(_0x965e('0x9'));module[_0x965e('0xa')]=function(_0x363e45,_0xa623d5){return _0x363e45[_0x965e('0xb')](_0x965e('0xc'),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 346eb2e..6a800ab 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 _0x6c56=['lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','error','code','SalesforceAccount,\x20%s,\x20%s','message','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','where','limit','map','include','model','attributes','stringify','ShowSalesforceAccount','raw'];(function(_0x2a4d07,_0x3664aa){var _0x3d0203=function(_0x2bde31){while(--_0x2bde31){_0x2a4d07['push'](_0x2a4d07['shift']());}};_0x3d0203(++_0x3664aa);}(_0x6c56,0xc6));var _0x66c5=function(_0xe7d07d,_0x52e4e3){_0xe7d07d=_0xe7d07d-0x0;var _0x229e46=_0x6c56[_0xe7d07d];return _0x229e46;};'use strict';var _=require(_0x66c5('0x0'));var util=require(_0x66c5('0x1'));var moment=require(_0x66c5('0x2'));var BPromise=require('bluebird');var rs=require(_0x66c5('0x3'));var fs=require('fs');var Redis=require(_0x66c5('0x4'));var db=require(_0x66c5('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x66c5('0x6'));var jayson=require(_0x66c5('0x7'));var client=jayson[_0x66c5('0x8')][_0x66c5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3d7950,_0x33a3de,_0x139db9){return new BPromise(function(_0x7ac8a2,_0x26fc21){return client['request'](_0x3d7950,_0x139db9)[_0x66c5('0xa')](function(_0x15beaf){logger[_0x66c5('0xb')]('SalesforceAccount,\x20%s,\x20%s',_0x33a3de,_0x66c5('0xc'));logger[_0x66c5('0xd')](_0x66c5('0xe'),_0x33a3de,_0x66c5('0xc'),JSON['stringify'](_0x15beaf));if(_0x15beaf[_0x66c5('0xf')]){if(_0x15beaf[_0x66c5('0xf')][_0x66c5('0x10')]===0x1f4){logger['error'](_0x66c5('0x11'),_0x33a3de,_0x15beaf[_0x66c5('0xf')][_0x66c5('0x12')]);return _0x26fc21(_0x15beaf[_0x66c5('0xf')][_0x66c5('0x12')]);}logger[_0x66c5('0xf')]('SalesforceAccount,\x20%s,\x20%s',_0x33a3de,_0x15beaf[_0x66c5('0xf')][_0x66c5('0x12')]);return _0x7ac8a2(_0x15beaf['error']['message']);}else{logger['info'](_0x66c5('0x11'),_0x33a3de,_0x66c5('0xc'));_0x7ac8a2(_0x15beaf['result'][_0x66c5('0x12')]);}})[_0x66c5('0x13')](function(_0x27c0ea){logger[_0x66c5('0xf')](_0x66c5('0x11'),_0x33a3de,_0x27c0ea);_0x26fc21(_0x27c0ea);});});}exports[_0x66c5('0x14')]=function(_0x35feaa){var _0x47d4ba=this;return new Promise(function(_0x1f6bba,_0x97aadc){return db[_0x66c5('0x15')][_0x66c5('0x16')]({'raw':_0x35feaa[_0x66c5('0x17')]?_0x35feaa[_0x66c5('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x35feaa[_0x66c5('0x17')]?_0x35feaa[_0x66c5('0x17')][_0x66c5('0x18')]||null:null,'attributes':_0x35feaa[_0x66c5('0x17')]?_0x35feaa['options']['attributes']||null:null,'limit':_0x35feaa['options']?_0x35feaa['options'][_0x66c5('0x19')]||null:null,'include':_0x35feaa['options']?_0x35feaa[_0x66c5('0x17')]['include']?_[_0x66c5('0x1a')](_0x35feaa[_0x66c5('0x17')][_0x66c5('0x1b')],function(_0x12c63b){return{'model':db[_0x12c63b[_0x66c5('0x1c')]],'as':_0x12c63b['as'],'attributes':_0x12c63b[_0x66c5('0x1d')],'include':_0x12c63b['include']?_['map'](_0x12c63b[_0x66c5('0x1b')],function(_0x1110ad){return{'model':db[_0x1110ad[_0x66c5('0x1c')]],'as':_0x1110ad['as'],'attributes':_0x1110ad[_0x66c5('0x1d')],'include':_0x1110ad[_0x66c5('0x1b')]?_['map'](_0x1110ad[_0x66c5('0x1b')],function(_0x157171){return{'model':db[_0x157171[_0x66c5('0x1c')]],'as':_0x157171['as'],'attributes':_0x157171['attributes']};}):[]};}):[]};}):[]:[]})[_0x66c5('0xa')](function(_0x55e870){logger[_0x66c5('0xb')]('GetSalesforceAccount',_0x35feaa);logger['debug']('GetSalesforceAccount',_0x35feaa,JSON[_0x66c5('0x1e')](_0x55e870));_0x1f6bba(_0x55e870);})[_0x66c5('0x13')](function(_0x42f78e){logger[_0x66c5('0xf')](_0x66c5('0x14'),_0x42f78e[_0x66c5('0x12')],_0x35feaa);_0x97aadc(_0x47d4ba[_0x66c5('0xf')](0x1f4,_0x42f78e[_0x66c5('0x12')]));});});};exports[_0x66c5('0x1f')]=function(_0x3571ca){var _0x5a25d7=this;return new Promise(function(_0x5a6696,_0x38dde4){return db[_0x66c5('0x15')]['find']({'raw':_0x3571ca[_0x66c5('0x17')]?_0x3571ca[_0x66c5('0x17')][_0x66c5('0x20')]===undefined?!![]:![]:!![],'where':_0x3571ca[_0x66c5('0x17')]?_0x3571ca[_0x66c5('0x17')][_0x66c5('0x18')]||null:null,'attributes':_0x3571ca['options']?_0x3571ca[_0x66c5('0x17')][_0x66c5('0x1d')]||null:null,'include':_0x3571ca[_0x66c5('0x17')]?_0x3571ca[_0x66c5('0x17')][_0x66c5('0x1b')]?_[_0x66c5('0x1a')](_0x3571ca[_0x66c5('0x17')][_0x66c5('0x1b')],function(_0x2790fb){return{'model':db[_0x2790fb['model']],'as':_0x2790fb['as'],'attributes':_0x2790fb[_0x66c5('0x1d')],'include':_0x2790fb[_0x66c5('0x1b')]?_['map'](_0x2790fb[_0x66c5('0x1b')],function(_0xd0ce2d){return{'model':db[_0xd0ce2d['model']],'as':_0xd0ce2d['as'],'attributes':_0xd0ce2d[_0x66c5('0x1d')],'include':_0xd0ce2d[_0x66c5('0x1b')]?_[_0x66c5('0x1a')](_0xd0ce2d['include'],function(_0x214311){return{'model':db[_0x214311[_0x66c5('0x1c')]],'as':_0x214311['as'],'attributes':_0x214311['attributes']};}):[]};}):[]};}):[]:[]})[_0x66c5('0xa')](function(_0x549262){logger['info']('ShowSalesforceAccount',_0x3571ca);logger[_0x66c5('0xd')](_0x66c5('0x1f'),_0x3571ca,JSON['stringify'](_0x549262));_0x5a6696(_0x549262);})[_0x66c5('0x13')](function(_0x173d81){logger['error'](_0x66c5('0x1f'),_0x173d81[_0x66c5('0x12')],_0x3571ca);_0x38dde4(_0x5a25d7['error'](0x1f4,_0x173d81[_0x66c5('0x12')]));});});}; \ No newline at end of file +var _0x8187=['map','model','info','debug','stringify','ShowSalesforceAccount','SalesforceAccount','find','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','SalesforceAccount,\x20%s,\x20%s','request\x20sent','SalesforceAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetSalesforceAccount','options','raw','where','attributes','limit','include'];(function(_0x3d129d,_0x49ff92){var _0xabba38=function(_0x49eea9){while(--_0x49eea9){_0x3d129d['push'](_0x3d129d['shift']());}};_0xabba38(++_0x49ff92);}(_0x8187,0xfd));var _0x7818=function(_0x40b162,_0x51a74d){_0x40b162=_0x40b162-0x0;var _0x1a5e44=_0x8187[_0x40b162];return _0x1a5e44;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7818('0x0'));var BPromise=require('bluebird');var rs=require(_0x7818('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7818('0x2'))['db'];var utils=require(_0x7818('0x3'));var logger=require(_0x7818('0x4'))(_0x7818('0x5'));var config=require(_0x7818('0x6'));var jayson=require(_0x7818('0x7'));var client=jayson[_0x7818('0x8')][_0x7818('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1273a8,_0x5cd093,_0x39ced9){return new BPromise(function(_0xd5df33,_0x2e4f38){return client[_0x7818('0xa')](_0x1273a8,_0x39ced9)[_0x7818('0xb')](function(_0x2143c8){logger['info'](_0x7818('0xc'),_0x5cd093,_0x7818('0xd'));logger['debug'](_0x7818('0xe'),_0x5cd093,_0x7818('0xd'),JSON['stringify'](_0x2143c8));if(_0x2143c8[_0x7818('0xf')]){if(_0x2143c8['error'][_0x7818('0x10')]===0x1f4){logger['error'](_0x7818('0xc'),_0x5cd093,_0x2143c8['error'][_0x7818('0x11')]);return _0x2e4f38(_0x2143c8[_0x7818('0xf')][_0x7818('0x11')]);}logger[_0x7818('0xf')](_0x7818('0xc'),_0x5cd093,_0x2143c8[_0x7818('0xf')][_0x7818('0x11')]);return _0xd5df33(_0x2143c8[_0x7818('0xf')][_0x7818('0x11')]);}else{logger['info']('SalesforceAccount,\x20%s,\x20%s',_0x5cd093,_0x7818('0xd'));_0xd5df33(_0x2143c8[_0x7818('0x12')]['message']);}})[_0x7818('0x13')](function(_0x4d63c6){logger[_0x7818('0xf')](_0x7818('0xc'),_0x5cd093,_0x4d63c6);_0x2e4f38(_0x4d63c6);});});}exports[_0x7818('0x14')]=function(_0x4b6300){var _0x3f1504=this;return new Promise(function(_0x4344a9,_0x503068){return db['SalesforceAccount']['findAll']({'raw':_0x4b6300['options']?_0x4b6300[_0x7818('0x15')][_0x7818('0x16')]===undefined?!![]:![]:!![],'where':_0x4b6300[_0x7818('0x15')]?_0x4b6300[_0x7818('0x15')][_0x7818('0x17')]||null:null,'attributes':_0x4b6300[_0x7818('0x15')]?_0x4b6300['options'][_0x7818('0x18')]||null:null,'limit':_0x4b6300[_0x7818('0x15')]?_0x4b6300[_0x7818('0x15')][_0x7818('0x19')]||null:null,'include':_0x4b6300[_0x7818('0x15')]?_0x4b6300[_0x7818('0x15')][_0x7818('0x1a')]?_[_0x7818('0x1b')](_0x4b6300[_0x7818('0x15')][_0x7818('0x1a')],function(_0x5a689b){return{'model':db[_0x5a689b['model']],'as':_0x5a689b['as'],'attributes':_0x5a689b[_0x7818('0x18')],'include':_0x5a689b[_0x7818('0x1a')]?_[_0x7818('0x1b')](_0x5a689b[_0x7818('0x1a')],function(_0x241f45){return{'model':db[_0x241f45[_0x7818('0x1c')]],'as':_0x241f45['as'],'attributes':_0x241f45[_0x7818('0x18')],'include':_0x241f45['include']?_['map'](_0x241f45[_0x7818('0x1a')],function(_0x544e2a){return{'model':db[_0x544e2a[_0x7818('0x1c')]],'as':_0x544e2a['as'],'attributes':_0x544e2a['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4b9591){logger[_0x7818('0x1d')](_0x7818('0x14'),_0x4b6300);logger[_0x7818('0x1e')](_0x7818('0x14'),_0x4b6300,JSON[_0x7818('0x1f')](_0x4b9591));_0x4344a9(_0x4b9591);})[_0x7818('0x13')](function(_0x1d8ae0){logger['error'](_0x7818('0x14'),_0x1d8ae0[_0x7818('0x11')],_0x4b6300);_0x503068(_0x3f1504[_0x7818('0xf')](0x1f4,_0x1d8ae0[_0x7818('0x11')]));});});};exports[_0x7818('0x20')]=function(_0x59c1d8){var _0x1510b7=this;return new Promise(function(_0x4e40a8,_0x4428a0){return db[_0x7818('0x21')][_0x7818('0x22')]({'raw':_0x59c1d8[_0x7818('0x15')]?_0x59c1d8[_0x7818('0x15')][_0x7818('0x16')]===undefined?!![]:![]:!![],'where':_0x59c1d8[_0x7818('0x15')]?_0x59c1d8[_0x7818('0x15')][_0x7818('0x17')]||null:null,'attributes':_0x59c1d8[_0x7818('0x15')]?_0x59c1d8[_0x7818('0x15')][_0x7818('0x18')]||null:null,'include':_0x59c1d8[_0x7818('0x15')]?_0x59c1d8['options'][_0x7818('0x1a')]?_[_0x7818('0x1b')](_0x59c1d8[_0x7818('0x15')][_0x7818('0x1a')],function(_0x41bf4e){return{'model':db[_0x41bf4e[_0x7818('0x1c')]],'as':_0x41bf4e['as'],'attributes':_0x41bf4e[_0x7818('0x18')],'include':_0x41bf4e[_0x7818('0x1a')]?_[_0x7818('0x1b')](_0x41bf4e['include'],function(_0x3c8d62){return{'model':db[_0x3c8d62[_0x7818('0x1c')]],'as':_0x3c8d62['as'],'attributes':_0x3c8d62['attributes'],'include':_0x3c8d62['include']?_[_0x7818('0x1b')](_0x3c8d62[_0x7818('0x1a')],function(_0x32e232){return{'model':db[_0x32e232[_0x7818('0x1c')]],'as':_0x32e232['as'],'attributes':_0x32e232['attributes']};}):[]};}):[]};}):[]:[]})[_0x7818('0xb')](function(_0x500c82){logger[_0x7818('0x1d')](_0x7818('0x20'),_0x59c1d8);logger[_0x7818('0x1e')](_0x7818('0x20'),_0x59c1d8,JSON[_0x7818('0x1f')](_0x500c82));_0x4e40a8(_0x500c82);})[_0x7818('0x13')](function(_0xb0148d){logger[_0x7818('0xf')](_0x7818('0x20'),_0xb0148d[_0x7818('0x11')],_0x59c1d8);_0x4428a0(_0x1510b7[_0x7818('0xf')](0x1f4,_0xb0148d['message']));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index c545faf..900e4f0 100644 --- a/server/api/intSalesforceConfiguration/index.js +++ b/server/api/intSalesforceConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xadb5=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','put','update','delete','destroy','exports','util','connect-timeout','express'];(function(_0x555c33,_0x1716d8){var _0x2a9935=function(_0x53746c){while(--_0x53746c){_0x555c33['push'](_0x555c33['shift']());}};_0x2a9935(++_0x1716d8);}(_0xadb5,0xad));var _0x5adb=function(_0x1435e6,_0x46073d){_0x1435e6=_0x1435e6-0x0;var _0x315386=_0xadb5[_0x1435e6];return _0x315386;};'use strict';var multer=require('multer');var util=require(_0x5adb('0x0'));var path=require('path');var timeout=require(_0x5adb('0x1'));var express=require(_0x5adb('0x2'));var router=express[_0x5adb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5adb('0x4'));var interaction=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var controller=require('./intSalesforceConfiguration.controller');router[_0x5adb('0x7')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0x9')]);router[_0x5adb('0x7')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x7')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xd')]);router[_0x5adb('0x7')](_0x5adb('0xe'),auth[_0x5adb('0x8')](),controller['getSubjects']);router['get'](_0x5adb('0xf'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x10')]);router['post']('/',auth[_0x5adb('0x8')](),controller['create']);router[_0x5adb('0x11')]('/:id',auth[_0x5adb('0x8')](),controller[_0x5adb('0x12')]);router[_0x5adb('0x13')]('/:id',auth[_0x5adb('0x8')](),controller[_0x5adb('0x14')]);module[_0x5adb('0x15')]=router; \ No newline at end of file +var _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','create','put','delete','destroy','exports','multer','util'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xdb28,0x106));var _0x8db2=function(_0x32cc7e,_0x519511){_0x32cc7e=_0x32cc7e-0x0;var _0x104a6d=_0xdb28[_0x32cc7e];return _0x104a6d;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./intSalesforceConfiguration.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['get'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);router['get'](_0x8db2('0x11'),auth[_0x8db2('0xa')](),controller['getDescriptions']);router[_0x8db2('0x12')]('/',auth[_0x8db2('0xa')](),controller[_0x8db2('0x13')]);router[_0x8db2('0x14')](_0x8db2('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x8db2('0x15')](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x16')]);module[_0x8db2('0x17')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index 73eb28a..211f169 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 _0xb162=['ENUM','Task','Case','contact_lead','contact','lead','account','nothing','sequelize','exports','STRING'];(function(_0x31f564,_0x265a48){var _0x1a853b=function(_0x49cad5){while(--_0x49cad5){_0x31f564['push'](_0x31f564['shift']());}};_0x1a853b(++_0x265a48);}(_0xb162,0x110));var _0x2b16=function(_0x47b136,_0x54f632){_0x47b136=_0x47b136-0x0;var _0x4ed731=_0xb162[_0x47b136];return _0x4ed731;};'use strict';var Sequelize=require(_0x2b16('0x0'));module[_0x2b16('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x2b16('0x2')]},'ticketType':{'type':Sequelize[_0x2b16('0x3')](_0x2b16('0x4'),_0x2b16('0x5')),'defaultValue':_0x2b16('0x4')},'moduleSearch':{'type':Sequelize[_0x2b16('0x3')](_0x2b16('0x6'),_0x2b16('0x7'),_0x2b16('0x8'),'account_contact_lead',_0x2b16('0x9')),'defaultValue':'contact_lead'},'moduleCreate':{'type':Sequelize['ENUM'](_0x2b16('0xa'),_0x2b16('0x7'),_0x2b16('0x8'),'account'),'defaultValue':_0x2b16('0x8')},'leadId':{'type':Sequelize[_0x2b16('0x2')]},'additionalSearchAccount':{'type':Sequelize['STRING']},'additionalSearchContact':{'type':Sequelize[_0x2b16('0x2')]},'additionalSearchLead':{'type':Sequelize[_0x2b16('0x2')]}}; \ No newline at end of file +var _0xe584=['account','STRING','sequelize','ENUM','Task','Case','contact_lead','contact','lead','account_contact_lead'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xe584,0x14c));var _0x4e58=function(_0x31a180,_0x3924b9){_0x31a180=_0x31a180-0x0;var _0x4b0502=_0xe584[_0x31a180];return _0x4b0502;};'use strict';var Sequelize=require(_0x4e58('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0x4e58('0x1')](_0x4e58('0x2'),_0x4e58('0x3')),'defaultValue':'Task'},'moduleSearch':{'type':Sequelize[_0x4e58('0x1')](_0x4e58('0x4'),_0x4e58('0x5'),_0x4e58('0x6'),_0x4e58('0x7'),_0x4e58('0x8')),'defaultValue':_0x4e58('0x4')},'moduleCreate':{'type':Sequelize[_0x4e58('0x1')]('nothing',_0x4e58('0x5'),_0x4e58('0x6'),_0x4e58('0x8')),'defaultValue':_0x4e58('0x6')},'leadId':{'type':Sequelize[_0x4e58('0x9')]},'additionalSearchAccount':{'type':Sequelize[_0x4e58('0x9')]},'additionalSearchContact':{'type':Sequelize[_0x4e58('0x9')]},'additionalSearchLead':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index 3234a56..3873c38 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 _0x19d1=['index','map','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length','nolimit','limit','order','sort','where','filters','pick','filter','merge','VIRTUAL','SalesforceConfiguration','includeAll','include','findAll','rows','catch','options','find','create','body','params','destroy','getFields','findOne','keys','hasOwnProperty','getSubjects','SalesforceField','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','send'];(function(_0x144de1,_0x17cf0b){var _0x82c145=function(_0x586d5c){while(--_0x586d5c){_0x144de1['push'](_0x144de1['shift']());}};_0x82c145(++_0x17cf0b);}(_0x19d1,0x16c));var _0x119d=function(_0x436955,_0x1fe898){_0x436955=_0x436955-0x0;var _0x3e3c47=_0x19d1[_0x436955];return _0x3e3c47;};'use strict';var emlformat=require(_0x119d('0x0'));var rimraf=require(_0x119d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x119d('0x2'));var rp=require(_0x119d('0x3'));var moment=require(_0x119d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x119d('0x5'));var util=require('util');var path=require(_0x119d('0x6'));var sox=require(_0x119d('0x7'));var csv=require(_0x119d('0x8'));var ejs=require(_0x119d('0x9'));var fs=require('fs');var fs_extra=require(_0x119d('0xa'));var _=require(_0x119d('0xb'));var squel=require(_0x119d('0xc'));var crypto=require('crypto');var jsforce=require(_0x119d('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x119d('0xe'));var Redis=require(_0x119d('0xf'));var authService=require(_0x119d('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x119d('0x11'));var hardwareService=require(_0x119d('0x12'));var logger=require(_0x119d('0x13'))(_0x119d('0x14'));var utils=require(_0x119d('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x119d('0x16'))['db'];function respondWithStatusCode(_0x5148d9,_0x278e87){_0x278e87=_0x278e87||0xcc;return function(_0x463344){if(_0x463344){return _0x5148d9['sendStatus'](_0x278e87);}return _0x5148d9[_0x119d('0x17')](_0x278e87)[_0x119d('0x18')]();};}function respondWithResult(_0x410b3c,_0xf0a428){_0xf0a428=_0xf0a428||0xc8;return function(_0x3dbd0a){if(_0x3dbd0a){return _0x410b3c[_0x119d('0x17')](_0xf0a428)[_0x119d('0x19')](_0x3dbd0a);}};}function respondWithFilteredResult(_0x171b8c,_0x1b6557){return function(_0x35bca0){if(_0x35bca0){var _0x58a0aa=typeof _0x1b6557[_0x119d('0x1a')]===_0x119d('0x1b')&&typeof _0x1b6557['limit']==='undefined';var _0x2f1830=_0x35bca0['count'];var _0x3213d7=_0x58a0aa?0x0:_0x1b6557[_0x119d('0x1a')];var _0x2a528d=_0x58a0aa?_0x35bca0[_0x119d('0x1c')]:_0x1b6557[_0x119d('0x1a')]+_0x1b6557['limit'];var _0x30c8a9;if(_0x2a528d>=_0x2f1830){_0x2a528d=_0x2f1830;_0x30c8a9=0xc8;}else{_0x30c8a9=0xce;}_0x171b8c[_0x119d('0x17')](_0x30c8a9);return _0x171b8c[_0x119d('0x1d')](_0x119d('0x1e'),_0x3213d7+'-'+_0x2a528d+'/'+_0x2f1830)['json'](_0x35bca0);}return null;};}function patchUpdates(_0x13ebc2){return function(_0x2dcc6a){try{jsonpatch[_0x119d('0x1f')](_0x2dcc6a,_0x13ebc2,!![]);}catch(_0x2d5d5c){return BPromise[_0x119d('0x20')](_0x2d5d5c);}return _0x2dcc6a[_0x119d('0x21')]();};}function saveUpdates(_0x4e8b8a,_0x1e6819){return function(_0xd814b7){if(_0xd814b7){return _0xd814b7[_0x119d('0x22')](_0x4e8b8a)[_0x119d('0x23')](function(_0x1593c2){return _0x1593c2;});}return null;};}function removeEntity(_0x51e0c3,_0x8eb0c8){return function(_0x265b76){if(_0x265b76){return _0x265b76['destroy']()[_0x119d('0x23')](function(){_0x51e0c3['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x362e2b,_0x477519){return function(_0xe2a31d){if(!_0xe2a31d){_0x362e2b[_0x119d('0x24')](0x194);}return _0xe2a31d;};}function handleError(_0x4a8619,_0x257935){_0x257935=_0x257935||0x1f4;return function(_0x4c015f){logger[_0x119d('0x25')](_0x4c015f[_0x119d('0x26')]);if(_0x4c015f[_0x119d('0x27')]){delete _0x4c015f[_0x119d('0x27')];}_0x4a8619[_0x119d('0x17')](_0x257935)[_0x119d('0x28')](_0x4c015f);};}exports[_0x119d('0x29')]=function(_0x4db9a8,_0xbbf6a5){var _0x4bafab={},_0x542b57={},_0xd12633={'count':0x0,'rows':[]};var _0x3549fa=_[_0x119d('0x2a')](db['SalesforceConfiguration'][_0x119d('0x2b')],function(_0x43a8c2){return{'name':_0x43a8c2[_0x119d('0x2c')],'type':_0x43a8c2[_0x119d('0x2d')]['key']};});_0x542b57[_0x119d('0x2e')]=_[_0x119d('0x2a')](_0x3549fa,_0x119d('0x27'));_0x542b57[_0x119d('0x2f')]=_['keys'](_0x4db9a8[_0x119d('0x2f')]);_0x542b57['filters']=_[_0x119d('0x30')](_0x542b57['model'],_0x542b57[_0x119d('0x2f')]);_0x4bafab[_0x119d('0x31')]=_[_0x119d('0x30')](_0x542b57[_0x119d('0x2e')],qs[_0x119d('0x32')](_0x4db9a8[_0x119d('0x2f')][_0x119d('0x32')]));_0x4bafab[_0x119d('0x31')]=_0x4bafab[_0x119d('0x31')][_0x119d('0x33')]?_0x4bafab['attributes']:_0x542b57['model'];if(!_0x4db9a8[_0x119d('0x2f')]['hasOwnProperty'](_0x119d('0x34'))){_0x4bafab[_0x119d('0x35')]=qs['limit'](_0x4db9a8[_0x119d('0x2f')][_0x119d('0x35')]);_0x4bafab[_0x119d('0x1a')]=qs[_0x119d('0x1a')](_0x4db9a8['query'][_0x119d('0x1a')]);}_0x4bafab[_0x119d('0x36')]=qs['sort'](_0x4db9a8[_0x119d('0x2f')][_0x119d('0x37')]);_0x4bafab[_0x119d('0x38')]=qs[_0x119d('0x39')](_[_0x119d('0x3a')](_0x4db9a8[_0x119d('0x2f')],_0x542b57[_0x119d('0x39')]),_0x3549fa);if(_0x4db9a8[_0x119d('0x2f')][_0x119d('0x3b')]){_0x4bafab[_0x119d('0x38')]=_[_0x119d('0x3c')](_0x4bafab[_0x119d('0x38')],{'$or':_[_0x119d('0x2a')](_0x3549fa,function(_0x237ee4){if(_0x237ee4[_0x119d('0x2d')]!==_0x119d('0x3d')){var _0x4e9556={};_0x4e9556[_0x237ee4[_0x119d('0x27')]]={'$like':'%'+_0x4db9a8[_0x119d('0x2f')]['filter']+'%'};return _0x4e9556;}})});}_0x4bafab=_[_0x119d('0x3c')]({},_0x4bafab,_0x4db9a8['options']);var _0x17ec01={'where':_0x4bafab[_0x119d('0x38')]};return db[_0x119d('0x3e')][_0x119d('0x1c')](_0x17ec01)['then'](function(_0x2bb37e){_0xd12633[_0x119d('0x1c')]=_0x2bb37e;if(_0x4db9a8[_0x119d('0x2f')][_0x119d('0x3f')]){_0x4bafab[_0x119d('0x40')]=[{'all':!![]}];}return db[_0x119d('0x3e')][_0x119d('0x41')](_0x4bafab);})[_0x119d('0x23')](function(_0x37abd2){_0xd12633[_0x119d('0x42')]=_0x37abd2;return _0xd12633;})[_0x119d('0x23')](respondWithFilteredResult(_0xbbf6a5,_0x4bafab))[_0x119d('0x43')](handleError(_0xbbf6a5,null));};exports['show']=function(_0x47da19,_0x1985a1){var _0x29981b={'raw':![],'where':{'id':_0x47da19['params']['id']}},_0x1dba98={};_0x1dba98['model']=_['keys'](db[_0x119d('0x3e')]['rawAttributes']);_0x1dba98[_0x119d('0x2f')]=_['keys'](_0x47da19[_0x119d('0x2f')]);_0x1dba98[_0x119d('0x39')]=_[_0x119d('0x30')](_0x1dba98[_0x119d('0x2e')],_0x1dba98[_0x119d('0x2f')]);_0x29981b[_0x119d('0x31')]=_[_0x119d('0x30')](_0x1dba98[_0x119d('0x2e')],qs[_0x119d('0x32')](_0x47da19[_0x119d('0x2f')]['fields']));_0x29981b[_0x119d('0x31')]=_0x29981b[_0x119d('0x31')][_0x119d('0x33')]?_0x29981b[_0x119d('0x31')]:_0x1dba98[_0x119d('0x2e')];if(_0x47da19[_0x119d('0x2f')][_0x119d('0x3f')]){_0x29981b['include']=[{'all':!![]}];}_0x29981b=_[_0x119d('0x3c')]({},_0x29981b,_0x47da19[_0x119d('0x44')]);return db['SalesforceConfiguration'][_0x119d('0x45')](_0x29981b)[_0x119d('0x23')](handleEntityNotFound(_0x1985a1,null))[_0x119d('0x23')](respondWithResult(_0x1985a1,null))['catch'](handleError(_0x1985a1,null));};exports['create']=function(_0x4b34fa,_0xa513ae){return db[_0x119d('0x3e')][_0x119d('0x46')](_0x4b34fa[_0x119d('0x47')],{})[_0x119d('0x23')](respondWithResult(_0xa513ae,0xc9))[_0x119d('0x43')](handleError(_0xa513ae,null));};exports[_0x119d('0x22')]=function(_0x43f6b0,_0x1e3386){if(_0x43f6b0[_0x119d('0x47')]['id']){delete _0x43f6b0[_0x119d('0x47')]['id'];}return db[_0x119d('0x3e')][_0x119d('0x45')]({'where':{'id':_0x43f6b0[_0x119d('0x48')]['id']}})[_0x119d('0x23')](handleEntityNotFound(_0x1e3386,null))[_0x119d('0x23')](saveUpdates(_0x43f6b0[_0x119d('0x47')],null))[_0x119d('0x23')](respondWithResult(_0x1e3386,null))['catch'](handleError(_0x1e3386,null));};exports[_0x119d('0x49')]=function(_0x370146,_0x21e9ba){return db[_0x119d('0x3e')][_0x119d('0x45')]({'where':{'id':_0x370146[_0x119d('0x48')]['id']}})[_0x119d('0x23')](handleEntityNotFound(_0x21e9ba,null))[_0x119d('0x23')](removeEntity(_0x21e9ba,null))[_0x119d('0x43')](handleError(_0x21e9ba,null));};exports[_0x119d('0x4a')]=function(_0x47072c,_0x1a7222,_0x38d25d){var _0x56f0a1={};var _0x424163={};var _0x56158b;var _0x7f4f80;return db[_0x119d('0x3e')][_0x119d('0x4b')]({'where':{'id':_0x47072c[_0x119d('0x48')]['id']}})['then'](handleEntityNotFound(_0x1a7222,null))[_0x119d('0x23')](function(_0x44b77f){if(_0x44b77f){_0x56158b=_0x44b77f;_0x424163[_0x119d('0x2e')]=_[_0x119d('0x4c')](db['SalesforceField'][_0x119d('0x2b')]);_0x424163[_0x119d('0x2f')]=_[_0x119d('0x4c')](_0x47072c[_0x119d('0x2f')]);_0x424163[_0x119d('0x39')]=_[_0x119d('0x30')](_0x424163[_0x119d('0x2e')],_0x424163['query']);_0x56f0a1[_0x119d('0x31')]=_['intersection'](_0x424163[_0x119d('0x2e')],qs[_0x119d('0x32')](_0x47072c['query'][_0x119d('0x32')]));_0x56f0a1['attributes']=_0x56f0a1['attributes'][_0x119d('0x33')]?_0x56f0a1[_0x119d('0x31')]:_0x424163[_0x119d('0x2e')];_0x56f0a1[_0x119d('0x36')]=qs['sort'](_0x47072c[_0x119d('0x2f')][_0x119d('0x37')]);_0x56f0a1[_0x119d('0x38')]=qs[_0x119d('0x39')](_[_0x119d('0x3a')](_0x47072c[_0x119d('0x2f')],_0x424163[_0x119d('0x39')]));if(_0x47072c['query'][_0x119d('0x3b')]){_0x56f0a1[_0x119d('0x38')]=_[_0x119d('0x3c')](_0x56f0a1[_0x119d('0x38')],{'$or':_[_0x119d('0x2a')](_0x56f0a1['attributes'],function(_0x159161){var _0x23587d={};_0x23587d[_0x159161]={'$like':'%'+_0x47072c[_0x119d('0x2f')][_0x119d('0x3b')]+'%'};return _0x23587d;})});}_0x56f0a1=_[_0x119d('0x3c')]({},_0x56f0a1,_0x47072c[_0x119d('0x44')]);return _0x56158b[_0x119d('0x4a')](_0x56f0a1);}})[_0x119d('0x23')](function(_0x59e064){if(_0x59e064){_0x7f4f80=_0x59e064['length'];if(!_0x47072c['query'][_0x119d('0x4d')](_0x119d('0x34'))){_0x56f0a1[_0x119d('0x35')]=qs[_0x119d('0x35')](_0x47072c[_0x119d('0x2f')]['limit']);_0x56f0a1[_0x119d('0x1a')]=qs[_0x119d('0x1a')](_0x47072c[_0x119d('0x2f')]['offset']);}return _0x56158b['getFields'](_0x56f0a1);}})[_0x119d('0x23')](function(_0x5c81eb){if(_0x5c81eb){return _0x5c81eb?{'count':_0x7f4f80,'rows':_0x5c81eb}:null;}})[_0x119d('0x23')](respondWithResult(_0x1a7222,null))['catch'](handleError(_0x1a7222,null));};exports[_0x119d('0x4e')]=function(_0x2b1d74,_0x529740,_0x5c8f00){var _0x4cebb2={};var _0x4d63b8={};var _0x269758;var _0x20a776;return db[_0x119d('0x3e')][_0x119d('0x4b')]({'where':{'id':_0x2b1d74['params']['id']}})[_0x119d('0x23')](handleEntityNotFound(_0x529740,null))[_0x119d('0x23')](function(_0x8da705){if(_0x8da705){_0x269758=_0x8da705;_0x4d63b8[_0x119d('0x2e')]=_['keys'](db[_0x119d('0x4f')][_0x119d('0x2b')]);_0x4d63b8[_0x119d('0x2f')]=_[_0x119d('0x4c')](_0x2b1d74[_0x119d('0x2f')]);_0x4d63b8[_0x119d('0x39')]=_[_0x119d('0x30')](_0x4d63b8['model'],_0x4d63b8[_0x119d('0x2f')]);_0x4cebb2['attributes']=_[_0x119d('0x30')](_0x4d63b8['model'],qs[_0x119d('0x32')](_0x2b1d74[_0x119d('0x2f')][_0x119d('0x32')]));_0x4cebb2[_0x119d('0x31')]=_0x4cebb2[_0x119d('0x31')][_0x119d('0x33')]?_0x4cebb2['attributes']:_0x4d63b8[_0x119d('0x2e')];_0x4cebb2[_0x119d('0x36')]=qs[_0x119d('0x37')](_0x2b1d74[_0x119d('0x2f')]['sort']);_0x4cebb2[_0x119d('0x38')]=qs[_0x119d('0x39')](_[_0x119d('0x3a')](_0x2b1d74[_0x119d('0x2f')],_0x4d63b8[_0x119d('0x39')]));if(_0x2b1d74[_0x119d('0x2f')][_0x119d('0x3b')]){_0x4cebb2[_0x119d('0x38')]=_[_0x119d('0x3c')](_0x4cebb2[_0x119d('0x38')],{'$or':_['map'](_0x4cebb2['attributes'],function(_0x3fa765){var _0x182d9e={};_0x182d9e[_0x3fa765]={'$like':'%'+_0x2b1d74[_0x119d('0x2f')][_0x119d('0x3b')]+'%'};return _0x182d9e;})});}_0x4cebb2=_[_0x119d('0x3c')]({},_0x4cebb2,_0x2b1d74['options']);return _0x269758[_0x119d('0x4e')](_0x4cebb2);}})[_0x119d('0x23')](function(_0x3ffec2){if(_0x3ffec2){_0x20a776=_0x3ffec2[_0x119d('0x33')];if(!_0x2b1d74[_0x119d('0x2f')]['hasOwnProperty']('nolimit')){_0x4cebb2['limit']=qs[_0x119d('0x35')](_0x2b1d74['query'][_0x119d('0x35')]);_0x4cebb2[_0x119d('0x1a')]=qs['offset'](_0x2b1d74['query'][_0x119d('0x1a')]);}return _0x269758['getSubjects'](_0x4cebb2);}})[_0x119d('0x23')](function(_0x31ddf7){if(_0x31ddf7){return _0x31ddf7?{'count':_0x20a776,'rows':_0x31ddf7}:null;}})[_0x119d('0x23')](respondWithResult(_0x529740,null))[_0x119d('0x43')](handleError(_0x529740,null));};exports[_0x119d('0x50')]=function(_0x4cb6ee,_0x59e459,_0x1004b2){var _0x1d174f={};var _0x92ab6e={};var _0x25fa8d;var _0x20ac9b;return db[_0x119d('0x3e')][_0x119d('0x4b')]({'where':{'id':_0x4cb6ee[_0x119d('0x48')]['id']}})['then'](handleEntityNotFound(_0x59e459,null))[_0x119d('0x23')](function(_0x46713c){if(_0x46713c){_0x25fa8d=_0x46713c;_0x92ab6e[_0x119d('0x2e')]=_[_0x119d('0x4c')](db[_0x119d('0x4f')][_0x119d('0x2b')]);_0x92ab6e['query']=_['keys'](_0x4cb6ee[_0x119d('0x2f')]);_0x92ab6e[_0x119d('0x39')]=_[_0x119d('0x30')](_0x92ab6e[_0x119d('0x2e')],_0x92ab6e['query']);_0x1d174f['attributes']=_[_0x119d('0x30')](_0x92ab6e[_0x119d('0x2e')],qs[_0x119d('0x32')](_0x4cb6ee[_0x119d('0x2f')][_0x119d('0x32')]));_0x1d174f[_0x119d('0x31')]=_0x1d174f['attributes'][_0x119d('0x33')]?_0x1d174f['attributes']:_0x92ab6e['model'];_0x1d174f[_0x119d('0x36')]=qs['sort'](_0x4cb6ee[_0x119d('0x2f')]['sort']);_0x1d174f[_0x119d('0x38')]=qs['filters'](_[_0x119d('0x3a')](_0x4cb6ee[_0x119d('0x2f')],_0x92ab6e['filters']));if(_0x4cb6ee[_0x119d('0x2f')]['filter']){_0x1d174f[_0x119d('0x38')]=_[_0x119d('0x3c')](_0x1d174f[_0x119d('0x38')],{'$or':_[_0x119d('0x2a')](_0x1d174f[_0x119d('0x31')],function(_0x283793){var _0x290e9a={};_0x290e9a[_0x283793]={'$like':'%'+_0x4cb6ee[_0x119d('0x2f')]['filter']+'%'};return _0x290e9a;})});}_0x1d174f=_[_0x119d('0x3c')]({},_0x1d174f,_0x4cb6ee[_0x119d('0x44')]);return _0x25fa8d[_0x119d('0x50')](_0x1d174f);}})['then'](function(_0x308401){if(_0x308401){_0x20ac9b=_0x308401[_0x119d('0x33')];if(!_0x4cb6ee[_0x119d('0x2f')]['hasOwnProperty'](_0x119d('0x34'))){_0x1d174f['limit']=qs[_0x119d('0x35')](_0x4cb6ee['query']['limit']);_0x1d174f[_0x119d('0x1a')]=qs['offset'](_0x4cb6ee[_0x119d('0x2f')][_0x119d('0x1a')]);}return _0x25fa8d[_0x119d('0x50')](_0x1d174f);}})[_0x119d('0x23')](function(_0x2ee83e){if(_0x2ee83e){return _0x2ee83e?{'count':_0x20ac9b,'rows':_0x2ee83e}:null;}})[_0x119d('0x23')](respondWithResult(_0x59e459,null))['catch'](handleError(_0x59e459,null));}; \ No newline at end of file +var _0xccc8=['pick','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','index','map','SalesforceConfiguration','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','where','filter','VIRTUAL','merge','include','findAll','catch','show','includeAll','options','find','body','params','findOne','SalesforceField','sort','getFields','hasOwnProperty','getSubjects','getDescriptions'];(function(_0x100e36,_0x4da225){var _0x1df0c9=function(_0xe4b84f){while(--_0xe4b84f){_0x100e36['push'](_0x100e36['shift']());}};_0x1df0c9(++_0x4da225);}(_0xccc8,0xa3));var _0x8ccc=function(_0x537c37,_0x536e74){_0x537c37=_0x537c37-0x0;var _0x241f84=_0xccc8[_0x537c37];return _0x241f84;};'use strict';var emlformat=require(_0x8ccc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8ccc('0x1'));var jsonpatch=require(_0x8ccc('0x2'));var rp=require(_0x8ccc('0x3'));var moment=require('moment');var BPromise=require(_0x8ccc('0x4'));var Mustache=require(_0x8ccc('0x5'));var util=require(_0x8ccc('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x8ccc('0x7'));var ejs=require(_0x8ccc('0x8'));var fs=require('fs');var fs_extra=require(_0x8ccc('0x9'));var _=require(_0x8ccc('0xa'));var squel=require(_0x8ccc('0xb'));var crypto=require(_0x8ccc('0xc'));var jsforce=require(_0x8ccc('0xd'));var deskjs=require(_0x8ccc('0xe'));var toCsv=require(_0x8ccc('0x7'));var querystring=require(_0x8ccc('0xf'));var Papa=require(_0x8ccc('0x10'));var Redis=require(_0x8ccc('0x11'));var authService=require(_0x8ccc('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x8ccc('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8ccc('0x14'))(_0x8ccc('0x15'));var utils=require(_0x8ccc('0x16'));var config=require(_0x8ccc('0x17'));var licenseUtil=require(_0x8ccc('0x18'));var db=require(_0x8ccc('0x19'))['db'];function respondWithStatusCode(_0x2ad047,_0x44e12d){_0x44e12d=_0x44e12d||0xcc;return function(_0x36a575){if(_0x36a575){return _0x2ad047[_0x8ccc('0x1a')](_0x44e12d);}return _0x2ad047[_0x8ccc('0x1b')](_0x44e12d)[_0x8ccc('0x1c')]();};}function respondWithResult(_0x3d1621,_0x6c184b){_0x6c184b=_0x6c184b||0xc8;return function(_0x44b351){if(_0x44b351){return _0x3d1621[_0x8ccc('0x1b')](_0x6c184b)[_0x8ccc('0x1d')](_0x44b351);}};}function respondWithFilteredResult(_0x3f7727,_0x3eda50){return function(_0x5acdb4){if(_0x5acdb4){var _0x4bddfc=typeof _0x3eda50[_0x8ccc('0x1e')]==='undefined'&&typeof _0x3eda50[_0x8ccc('0x1f')]===_0x8ccc('0x20');var _0x2f20e9=_0x5acdb4[_0x8ccc('0x21')];var _0x38e8c1=_0x4bddfc?0x0:_0x3eda50[_0x8ccc('0x1e')];var _0x1cd7e3=_0x4bddfc?_0x5acdb4[_0x8ccc('0x21')]:_0x3eda50[_0x8ccc('0x1e')]+_0x3eda50[_0x8ccc('0x1f')];var _0x3a1989;if(_0x1cd7e3>=_0x2f20e9){_0x1cd7e3=_0x2f20e9;_0x3a1989=0xc8;}else{_0x3a1989=0xce;}_0x3f7727[_0x8ccc('0x1b')](_0x3a1989);return _0x3f7727[_0x8ccc('0x22')](_0x8ccc('0x23'),_0x38e8c1+'-'+_0x1cd7e3+'/'+_0x2f20e9)['json'](_0x5acdb4);}return null;};}function patchUpdates(_0x5597ce){return function(_0x296f50){try{jsonpatch[_0x8ccc('0x24')](_0x296f50,_0x5597ce,!![]);}catch(_0x4f072e){return BPromise['reject'](_0x4f072e);}return _0x296f50[_0x8ccc('0x25')]();};}function saveUpdates(_0x264371,_0x4eed06){return function(_0x60a4c1){if(_0x60a4c1){return _0x60a4c1[_0x8ccc('0x26')](_0x264371)[_0x8ccc('0x27')](function(_0x5c8511){return _0x5c8511;});}return null;};}function removeEntity(_0x37da12,_0x358174){return function(_0x66dd84){if(_0x66dd84){return _0x66dd84[_0x8ccc('0x28')]()[_0x8ccc('0x27')](function(){_0x37da12['status'](0xcc)[_0x8ccc('0x1c')]();});}};}function handleEntityNotFound(_0x438f9b,_0x28937d){return function(_0x77f605){if(!_0x77f605){_0x438f9b[_0x8ccc('0x1a')](0x194);}return _0x77f605;};}function handleError(_0x33df3a,_0x251a94){_0x251a94=_0x251a94||0x1f4;return function(_0x2f9c2f){logger[_0x8ccc('0x29')](_0x2f9c2f[_0x8ccc('0x2a')]);if(_0x2f9c2f['name']){delete _0x2f9c2f[_0x8ccc('0x2b')];}_0x33df3a['status'](_0x251a94)['send'](_0x2f9c2f);};}exports[_0x8ccc('0x2c')]=function(_0x300172,_0x2284fd){var _0x1c0883={},_0x254778={},_0x510c12={'count':0x0,'rows':[]};var _0x223b9e=_[_0x8ccc('0x2d')](db[_0x8ccc('0x2e')][_0x8ccc('0x2f')],function(_0x1c701e){return{'name':_0x1c701e['fieldName'],'type':_0x1c701e[_0x8ccc('0x30')][_0x8ccc('0x31')]};});_0x254778[_0x8ccc('0x32')]=_['map'](_0x223b9e,_0x8ccc('0x2b'));_0x254778[_0x8ccc('0x33')]=_[_0x8ccc('0x34')](_0x300172['query']);_0x254778[_0x8ccc('0x35')]=_['intersection'](_0x254778[_0x8ccc('0x32')],_0x254778['query']);_0x1c0883[_0x8ccc('0x36')]=_[_0x8ccc('0x37')](_0x254778[_0x8ccc('0x32')],qs['fields'](_0x300172[_0x8ccc('0x33')][_0x8ccc('0x38')]));_0x1c0883[_0x8ccc('0x36')]=_0x1c0883['attributes'][_0x8ccc('0x39')]?_0x1c0883[_0x8ccc('0x36')]:_0x254778[_0x8ccc('0x32')];if(!_0x300172[_0x8ccc('0x33')]['hasOwnProperty'](_0x8ccc('0x3a'))){_0x1c0883[_0x8ccc('0x1f')]=qs[_0x8ccc('0x1f')](_0x300172['query'][_0x8ccc('0x1f')]);_0x1c0883[_0x8ccc('0x1e')]=qs[_0x8ccc('0x1e')](_0x300172[_0x8ccc('0x33')][_0x8ccc('0x1e')]);}_0x1c0883[_0x8ccc('0x3b')]=qs['sort'](_0x300172[_0x8ccc('0x33')]['sort']);_0x1c0883[_0x8ccc('0x3c')]=qs[_0x8ccc('0x35')](_['pick'](_0x300172[_0x8ccc('0x33')],_0x254778['filters']),_0x223b9e);if(_0x300172[_0x8ccc('0x33')][_0x8ccc('0x3d')]){_0x1c0883[_0x8ccc('0x3c')]=_['merge'](_0x1c0883[_0x8ccc('0x3c')],{'$or':_[_0x8ccc('0x2d')](_0x223b9e,function(_0x1f7ee1){if(_0x1f7ee1['type']!==_0x8ccc('0x3e')){var _0x4b2b80={};_0x4b2b80[_0x1f7ee1[_0x8ccc('0x2b')]]={'$like':'%'+_0x300172['query'][_0x8ccc('0x3d')]+'%'};return _0x4b2b80;}})});}_0x1c0883=_[_0x8ccc('0x3f')]({},_0x1c0883,_0x300172['options']);var _0x8472b8={'where':_0x1c0883[_0x8ccc('0x3c')]};return db['SalesforceConfiguration'][_0x8ccc('0x21')](_0x8472b8)[_0x8ccc('0x27')](function(_0x128a30){_0x510c12[_0x8ccc('0x21')]=_0x128a30;if(_0x300172[_0x8ccc('0x33')]['includeAll']){_0x1c0883[_0x8ccc('0x40')]=[{'all':!![]}];}return db[_0x8ccc('0x2e')][_0x8ccc('0x41')](_0x1c0883);})[_0x8ccc('0x27')](function(_0x5bc9d1){_0x510c12['rows']=_0x5bc9d1;return _0x510c12;})[_0x8ccc('0x27')](respondWithFilteredResult(_0x2284fd,_0x1c0883))[_0x8ccc('0x42')](handleError(_0x2284fd,null));};exports[_0x8ccc('0x43')]=function(_0x5d5f3a,_0xde090b){var _0x38db8d={'raw':![],'where':{'id':_0x5d5f3a['params']['id']}},_0x971a55={};_0x971a55[_0x8ccc('0x32')]=_[_0x8ccc('0x34')](db[_0x8ccc('0x2e')][_0x8ccc('0x2f')]);_0x971a55[_0x8ccc('0x33')]=_[_0x8ccc('0x34')](_0x5d5f3a['query']);_0x971a55[_0x8ccc('0x35')]=_[_0x8ccc('0x37')](_0x971a55['model'],_0x971a55[_0x8ccc('0x33')]);_0x38db8d['attributes']=_[_0x8ccc('0x37')](_0x971a55[_0x8ccc('0x32')],qs[_0x8ccc('0x38')](_0x5d5f3a['query'][_0x8ccc('0x38')]));_0x38db8d[_0x8ccc('0x36')]=_0x38db8d[_0x8ccc('0x36')]['length']?_0x38db8d[_0x8ccc('0x36')]:_0x971a55[_0x8ccc('0x32')];if(_0x5d5f3a[_0x8ccc('0x33')][_0x8ccc('0x44')]){_0x38db8d[_0x8ccc('0x40')]=[{'all':!![]}];}_0x38db8d=_[_0x8ccc('0x3f')]({},_0x38db8d,_0x5d5f3a[_0x8ccc('0x45')]);return db['SalesforceConfiguration'][_0x8ccc('0x46')](_0x38db8d)[_0x8ccc('0x27')](handleEntityNotFound(_0xde090b,null))['then'](respondWithResult(_0xde090b,null))[_0x8ccc('0x42')](handleError(_0xde090b,null));};exports['create']=function(_0x5cfcbc,_0x2a7643){return db[_0x8ccc('0x2e')]['create'](_0x5cfcbc['body'],{})[_0x8ccc('0x27')](respondWithResult(_0x2a7643,0xc9))['catch'](handleError(_0x2a7643,null));};exports['update']=function(_0x14b7fd,_0xb36e90){if(_0x14b7fd[_0x8ccc('0x47')]['id']){delete _0x14b7fd[_0x8ccc('0x47')]['id'];}return db[_0x8ccc('0x2e')][_0x8ccc('0x46')]({'where':{'id':_0x14b7fd[_0x8ccc('0x48')]['id']}})[_0x8ccc('0x27')](handleEntityNotFound(_0xb36e90,null))[_0x8ccc('0x27')](saveUpdates(_0x14b7fd[_0x8ccc('0x47')],null))[_0x8ccc('0x27')](respondWithResult(_0xb36e90,null))['catch'](handleError(_0xb36e90,null));};exports[_0x8ccc('0x28')]=function(_0x4c7510,_0x16f1f2){return db[_0x8ccc('0x2e')][_0x8ccc('0x46')]({'where':{'id':_0x4c7510['params']['id']}})['then'](handleEntityNotFound(_0x16f1f2,null))[_0x8ccc('0x27')](removeEntity(_0x16f1f2,null))[_0x8ccc('0x42')](handleError(_0x16f1f2,null));};exports['getFields']=function(_0x39ff85,_0x26f022,_0x105bd6){var _0x350e7d={};var _0x2716f1={};var _0x135cf1;var _0x379f41;return db[_0x8ccc('0x2e')][_0x8ccc('0x49')]({'where':{'id':_0x39ff85[_0x8ccc('0x48')]['id']}})[_0x8ccc('0x27')](handleEntityNotFound(_0x26f022,null))[_0x8ccc('0x27')](function(_0x19368e){if(_0x19368e){_0x135cf1=_0x19368e;_0x2716f1[_0x8ccc('0x32')]=_['keys'](db[_0x8ccc('0x4a')][_0x8ccc('0x2f')]);_0x2716f1['query']=_[_0x8ccc('0x34')](_0x39ff85[_0x8ccc('0x33')]);_0x2716f1['filters']=_[_0x8ccc('0x37')](_0x2716f1[_0x8ccc('0x32')],_0x2716f1['query']);_0x350e7d[_0x8ccc('0x36')]=_[_0x8ccc('0x37')](_0x2716f1['model'],qs['fields'](_0x39ff85[_0x8ccc('0x33')][_0x8ccc('0x38')]));_0x350e7d[_0x8ccc('0x36')]=_0x350e7d['attributes'][_0x8ccc('0x39')]?_0x350e7d[_0x8ccc('0x36')]:_0x2716f1[_0x8ccc('0x32')];_0x350e7d[_0x8ccc('0x3b')]=qs[_0x8ccc('0x4b')](_0x39ff85['query']['sort']);_0x350e7d['where']=qs[_0x8ccc('0x35')](_['pick'](_0x39ff85[_0x8ccc('0x33')],_0x2716f1[_0x8ccc('0x35')]));if(_0x39ff85[_0x8ccc('0x33')][_0x8ccc('0x3d')]){_0x350e7d[_0x8ccc('0x3c')]=_[_0x8ccc('0x3f')](_0x350e7d['where'],{'$or':_[_0x8ccc('0x2d')](_0x350e7d['attributes'],function(_0x49e011){var _0x1bedcb={};_0x1bedcb[_0x49e011]={'$like':'%'+_0x39ff85[_0x8ccc('0x33')]['filter']+'%'};return _0x1bedcb;})});}_0x350e7d=_['merge']({},_0x350e7d,_0x39ff85[_0x8ccc('0x45')]);return _0x135cf1[_0x8ccc('0x4c')](_0x350e7d);}})[_0x8ccc('0x27')](function(_0x3fed28){if(_0x3fed28){_0x379f41=_0x3fed28[_0x8ccc('0x39')];if(!_0x39ff85['query'][_0x8ccc('0x4d')](_0x8ccc('0x3a'))){_0x350e7d[_0x8ccc('0x1f')]=qs[_0x8ccc('0x1f')](_0x39ff85[_0x8ccc('0x33')][_0x8ccc('0x1f')]);_0x350e7d[_0x8ccc('0x1e')]=qs['offset'](_0x39ff85[_0x8ccc('0x33')][_0x8ccc('0x1e')]);}return _0x135cf1['getFields'](_0x350e7d);}})['then'](function(_0x53327b){if(_0x53327b){return _0x53327b?{'count':_0x379f41,'rows':_0x53327b}:null;}})[_0x8ccc('0x27')](respondWithResult(_0x26f022,null))['catch'](handleError(_0x26f022,null));};exports[_0x8ccc('0x4e')]=function(_0x27fbc7,_0x1032f3,_0x9f3cae){var _0x415e0f={};var _0x2b242c={};var _0x322980;var _0x67791;return db['SalesforceConfiguration']['findOne']({'where':{'id':_0x27fbc7[_0x8ccc('0x48')]['id']}})['then'](handleEntityNotFound(_0x1032f3,null))[_0x8ccc('0x27')](function(_0x58e6e7){if(_0x58e6e7){_0x322980=_0x58e6e7;_0x2b242c['model']=_[_0x8ccc('0x34')](db[_0x8ccc('0x4a')][_0x8ccc('0x2f')]);_0x2b242c[_0x8ccc('0x33')]=_[_0x8ccc('0x34')](_0x27fbc7[_0x8ccc('0x33')]);_0x2b242c[_0x8ccc('0x35')]=_[_0x8ccc('0x37')](_0x2b242c[_0x8ccc('0x32')],_0x2b242c[_0x8ccc('0x33')]);_0x415e0f[_0x8ccc('0x36')]=_['intersection'](_0x2b242c[_0x8ccc('0x32')],qs[_0x8ccc('0x38')](_0x27fbc7[_0x8ccc('0x33')][_0x8ccc('0x38')]));_0x415e0f[_0x8ccc('0x36')]=_0x415e0f[_0x8ccc('0x36')][_0x8ccc('0x39')]?_0x415e0f[_0x8ccc('0x36')]:_0x2b242c[_0x8ccc('0x32')];_0x415e0f[_0x8ccc('0x3b')]=qs[_0x8ccc('0x4b')](_0x27fbc7[_0x8ccc('0x33')]['sort']);_0x415e0f[_0x8ccc('0x3c')]=qs[_0x8ccc('0x35')](_['pick'](_0x27fbc7['query'],_0x2b242c[_0x8ccc('0x35')]));if(_0x27fbc7['query'][_0x8ccc('0x3d')]){_0x415e0f[_0x8ccc('0x3c')]=_['merge'](_0x415e0f['where'],{'$or':_[_0x8ccc('0x2d')](_0x415e0f[_0x8ccc('0x36')],function(_0x5ded8c){var _0x4a4c87={};_0x4a4c87[_0x5ded8c]={'$like':'%'+_0x27fbc7[_0x8ccc('0x33')][_0x8ccc('0x3d')]+'%'};return _0x4a4c87;})});}_0x415e0f=_[_0x8ccc('0x3f')]({},_0x415e0f,_0x27fbc7[_0x8ccc('0x45')]);return _0x322980[_0x8ccc('0x4e')](_0x415e0f);}})[_0x8ccc('0x27')](function(_0x41fc28){if(_0x41fc28){_0x67791=_0x41fc28[_0x8ccc('0x39')];if(!_0x27fbc7[_0x8ccc('0x33')][_0x8ccc('0x4d')](_0x8ccc('0x3a'))){_0x415e0f[_0x8ccc('0x1f')]=qs[_0x8ccc('0x1f')](_0x27fbc7['query'][_0x8ccc('0x1f')]);_0x415e0f[_0x8ccc('0x1e')]=qs[_0x8ccc('0x1e')](_0x27fbc7[_0x8ccc('0x33')]['offset']);}return _0x322980['getSubjects'](_0x415e0f);}})[_0x8ccc('0x27')](function(_0x1efe50){if(_0x1efe50){return _0x1efe50?{'count':_0x67791,'rows':_0x1efe50}:null;}})[_0x8ccc('0x27')](respondWithResult(_0x1032f3,null))['catch'](handleError(_0x1032f3,null));};exports[_0x8ccc('0x4f')]=function(_0x5ee3c0,_0x290353,_0x526f99){var _0x31c3f0={};var _0x5100af={};var _0x3732ea;var _0x111908;return db[_0x8ccc('0x2e')]['findOne']({'where':{'id':_0x5ee3c0[_0x8ccc('0x48')]['id']}})[_0x8ccc('0x27')](handleEntityNotFound(_0x290353,null))[_0x8ccc('0x27')](function(_0xb1cea1){if(_0xb1cea1){_0x3732ea=_0xb1cea1;_0x5100af[_0x8ccc('0x32')]=_[_0x8ccc('0x34')](db[_0x8ccc('0x4a')][_0x8ccc('0x2f')]);_0x5100af[_0x8ccc('0x33')]=_[_0x8ccc('0x34')](_0x5ee3c0[_0x8ccc('0x33')]);_0x5100af[_0x8ccc('0x35')]=_[_0x8ccc('0x37')](_0x5100af[_0x8ccc('0x32')],_0x5100af[_0x8ccc('0x33')]);_0x31c3f0[_0x8ccc('0x36')]=_[_0x8ccc('0x37')](_0x5100af[_0x8ccc('0x32')],qs[_0x8ccc('0x38')](_0x5ee3c0[_0x8ccc('0x33')]['fields']));_0x31c3f0[_0x8ccc('0x36')]=_0x31c3f0[_0x8ccc('0x36')][_0x8ccc('0x39')]?_0x31c3f0[_0x8ccc('0x36')]:_0x5100af[_0x8ccc('0x32')];_0x31c3f0[_0x8ccc('0x3b')]=qs[_0x8ccc('0x4b')](_0x5ee3c0[_0x8ccc('0x33')]['sort']);_0x31c3f0[_0x8ccc('0x3c')]=qs['filters'](_[_0x8ccc('0x50')](_0x5ee3c0['query'],_0x5100af['filters']));if(_0x5ee3c0['query']['filter']){_0x31c3f0['where']=_[_0x8ccc('0x3f')](_0x31c3f0[_0x8ccc('0x3c')],{'$or':_['map'](_0x31c3f0['attributes'],function(_0x28b3d8){var _0xfe5a37={};_0xfe5a37[_0x28b3d8]={'$like':'%'+_0x5ee3c0[_0x8ccc('0x33')][_0x8ccc('0x3d')]+'%'};return _0xfe5a37;})});}_0x31c3f0=_[_0x8ccc('0x3f')]({},_0x31c3f0,_0x5ee3c0[_0x8ccc('0x45')]);return _0x3732ea['getDescriptions'](_0x31c3f0);}})[_0x8ccc('0x27')](function(_0x452156){if(_0x452156){_0x111908=_0x452156['length'];if(!_0x5ee3c0[_0x8ccc('0x33')][_0x8ccc('0x4d')]('nolimit')){_0x31c3f0[_0x8ccc('0x1f')]=qs[_0x8ccc('0x1f')](_0x5ee3c0['query'][_0x8ccc('0x1f')]);_0x31c3f0['offset']=qs['offset'](_0x5ee3c0[_0x8ccc('0x33')][_0x8ccc('0x1e')]);}return _0x3732ea['getDescriptions'](_0x31c3f0);}})[_0x8ccc('0x27')](function(_0x3d2b56){if(_0x3d2b56){return _0x3d2b56?{'count':_0x111908,'rows':_0x3d2b56}:null;}})['then'](respondWithResult(_0x290353,null))['catch'](handleError(_0x290353,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index 6043a62..3add38e 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 _0xcba1=['SalesforceConfiguration','int_salesforce_configurations','util','api','moment','request-promise','path','rimraf','../../config/environment','./intSalesforceConfiguration.attributes','define'];(function(_0x472404,_0x19bd9d){var _0x502eda=function(_0x5b3e05){while(--_0x5b3e05){_0x472404['push'](_0x472404['shift']());}};_0x502eda(++_0x19bd9d);}(_0xcba1,0x183));var _0x1cba=function(_0x2adbeb,_0x5581be){_0x2adbeb=_0x2adbeb-0x0;var _0x5e18a6=_0xcba1[_0x2adbeb];return _0x5e18a6;};'use strict';var _=require('lodash');var util=require(_0x1cba('0x0'));var logger=require('../../config/logger')(_0x1cba('0x1'));var moment=require(_0x1cba('0x2'));var BPromise=require('bluebird');var rp=require(_0x1cba('0x3'));var fs=require('fs');var path=require(_0x1cba('0x4'));var rimraf=require(_0x1cba('0x5'));var config=require(_0x1cba('0x6'));var attributes=require(_0x1cba('0x7'));module['exports']=function(_0x7a4770,_0x13645a){return _0x7a4770[_0x1cba('0x8')](_0x1cba('0x9'),attributes,{'tableName':_0x1cba('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xefd2=['rimraf','exports','define','SalesforceConfiguration','lodash','util','moment','bluebird','request-promise','path'];(function(_0x1b6eae,_0x3eb5db){var _0x28c7cd=function(_0x1bdcf0){while(--_0x1bdcf0){_0x1b6eae['push'](_0x1b6eae['shift']());}};_0x28c7cd(++_0x3eb5db);}(_0xefd2,0x144));var _0x2efd=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xefd2[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x2efd('0x0'));var util=require(_0x2efd('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x2efd('0x2'));var BPromise=require(_0x2efd('0x3'));var rp=require(_0x2efd('0x4'));var fs=require('fs');var path=require(_0x2efd('0x5'));var rimraf=require(_0x2efd('0x6'));var config=require('../../config/environment');var attributes=require('./intSalesforceConfiguration.attributes');module[_0x2efd('0x7')]=function(_0x440154,_0xbd7f80){return _0x440154[_0x2efd('0x8')](_0x2efd('0x9'),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 f360302..c8815be 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 _0x12e7=['then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x1f78dc,_0x5de78f){var _0x20addf=function(_0xb4da16){while(--_0xb4da16){_0x1f78dc['push'](_0x1f78dc['shift']());}};_0x20addf(++_0x5de78f);}(_0x12e7,0x17c));var _0x712e=function(_0x35a585,_0x417361){_0x35a585=_0x35a585-0x0;var _0x58f739=_0x12e7[_0x35a585];return _0x58f739;};'use strict';var _=require(_0x712e('0x0'));var util=require(_0x712e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x712e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x712e('0x3'))['db'];var utils=require(_0x712e('0x4'));var logger=require(_0x712e('0x5'))(_0x712e('0x6'));var config=require(_0x712e('0x7'));var jayson=require(_0x712e('0x8'));var client=jayson['client'][_0x712e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2cfbd7,_0x5c879f,_0xf61d4b){return new BPromise(function(_0x49d453,_0x1e2b74){return client[_0x712e('0xa')](_0x2cfbd7,_0xf61d4b)[_0x712e('0xb')](function(_0x3416d1){logger[_0x712e('0xc')](_0x712e('0xd'),_0x5c879f,_0x712e('0xe'));logger[_0x712e('0xf')](_0x712e('0x10'),_0x5c879f,'request\x20sent',JSON[_0x712e('0x11')](_0x3416d1));if(_0x3416d1[_0x712e('0x12')]){if(_0x3416d1[_0x712e('0x12')][_0x712e('0x13')]===0x1f4){logger[_0x712e('0x12')](_0x712e('0xd'),_0x5c879f,_0x3416d1['error']['message']);return _0x1e2b74(_0x3416d1[_0x712e('0x12')][_0x712e('0x14')]);}logger[_0x712e('0x12')](_0x712e('0xd'),_0x5c879f,_0x3416d1[_0x712e('0x12')][_0x712e('0x14')]);return _0x49d453(_0x3416d1['error'][_0x712e('0x14')]);}else{logger[_0x712e('0xc')](_0x712e('0xd'),_0x5c879f,_0x712e('0xe'));_0x49d453(_0x3416d1[_0x712e('0x15')][_0x712e('0x14')]);}})[_0x712e('0x16')](function(_0x50ba99){logger[_0x712e('0x12')](_0x712e('0xd'),_0x5c879f,_0x50ba99);_0x1e2b74(_0x50ba99);});});} \ No newline at end of file +var _0x2478=['SalesforceConfiguration,\x20%s,\x20%s','message','result','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','stringify','error','code'];(function(_0x3cbe3a,_0x78bfce){var _0x24ffc1=function(_0x103ae4){while(--_0x103ae4){_0x3cbe3a['push'](_0x3cbe3a['shift']());}};_0x24ffc1(++_0x78bfce);}(_0x2478,0x11c));var _0x8247=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0x2478[_0x1a36a5];return _0x746243;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x8247('0x0'));var rs=require(_0x8247('0x1'));var fs=require('fs');var Redis=require(_0x8247('0x2'));var db=require(_0x8247('0x3'))['db'];var utils=require(_0x8247('0x4'));var logger=require(_0x8247('0x5'))('rpc');var config=require(_0x8247('0x6'));var jayson=require(_0x8247('0x7'));var client=jayson[_0x8247('0x8')][_0x8247('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x56a65,_0x32338a,_0x3c8976){return new BPromise(function(_0x32cdeb,_0x3bf77a){return client['request'](_0x56a65,_0x3c8976)[_0x8247('0xa')](function(_0x5d9bb6){logger[_0x8247('0xb')]('SalesforceConfiguration,\x20%s,\x20%s',_0x32338a,_0x8247('0xc'));logger['debug']('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x32338a,_0x8247('0xc'),JSON[_0x8247('0xd')](_0x5d9bb6));if(_0x5d9bb6[_0x8247('0xe')]){if(_0x5d9bb6[_0x8247('0xe')][_0x8247('0xf')]===0x1f4){logger[_0x8247('0xe')](_0x8247('0x10'),_0x32338a,_0x5d9bb6['error'][_0x8247('0x11')]);return _0x3bf77a(_0x5d9bb6[_0x8247('0xe')][_0x8247('0x11')]);}logger[_0x8247('0xe')](_0x8247('0x10'),_0x32338a,_0x5d9bb6[_0x8247('0xe')][_0x8247('0x11')]);return _0x32cdeb(_0x5d9bb6[_0x8247('0xe')][_0x8247('0x11')]);}else{logger[_0x8247('0xb')](_0x8247('0x10'),_0x32338a,_0x8247('0xc'));_0x32cdeb(_0x5d9bb6[_0x8247('0x12')]['message']);}})[_0x8247('0x13')](function(_0x13a6e5){logger[_0x8247('0xe')](_0x8247('0x10'),_0x32338a,_0x13a6e5);_0x3bf77a(_0x13a6e5);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index 0bd7f9a..56674ed 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 _0xb492=['put','update','delete','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get','isAuthenticated','/:id','show'];(function(_0x34843e,_0x4c4224){var _0x598f7f=function(_0x12a44c){while(--_0x12a44c){_0x34843e['push'](_0x34843e['shift']());}};_0x598f7f(++_0x4c4224);}(_0xb492,0x169));var _0x2b49=function(_0x5bb448,_0x397125){_0x5bb448=_0x5bb448-0x0;var _0x523eb7=_0xb492[_0x5bb448];return _0x523eb7;};'use strict';var multer=require(_0x2b49('0x0'));var util=require(_0x2b49('0x1'));var path=require('path');var timeout=require(_0x2b49('0x2'));var express=require(_0x2b49('0x3'));var router=express[_0x2b49('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2b49('0x5'));var interaction=require(_0x2b49('0x6'));var config=require(_0x2b49('0x7'));var controller=require(_0x2b49('0x8'));router[_0x2b49('0x9')]('/',auth[_0x2b49('0xa')](),controller['index']);router[_0x2b49('0x9')](_0x2b49('0xb'),auth[_0x2b49('0xa')](),controller[_0x2b49('0xc')]);router['post']('/',auth[_0x2b49('0xa')](),controller['create']);router[_0x2b49('0xd')](_0x2b49('0xb'),auth[_0x2b49('0xa')](),controller[_0x2b49('0xe')]);router[_0x2b49('0xf')](_0x2b49('0xb'),auth[_0x2b49('0xa')](),controller['destroy']);module[_0x2b49('0x10')]=router; \ No newline at end of file +var _0x5eb1=['/:id','isAuthenticated','show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get','index'];(function(_0x8854d6,_0x18f068){var _0x481689=function(_0x24fc2a){while(--_0x24fc2a){_0x8854d6['push'](_0x8854d6['shift']());}};_0x481689(++_0x18f068);}(_0x5eb1,0x16e));var _0x15eb=function(_0x14d250,_0x4b2e12){_0x14d250=_0x14d250-0x0;var _0xb991d8=_0x5eb1[_0x14d250];return _0xb991d8;};'use strict';var multer=require(_0x15eb('0x0'));var util=require(_0x15eb('0x1'));var path=require(_0x15eb('0x2'));var timeout=require(_0x15eb('0x3'));var express=require(_0x15eb('0x4'));var router=express[_0x15eb('0x5')]();var fs_extra=require(_0x15eb('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x15eb('0x7'));var config=require(_0x15eb('0x8'));var controller=require(_0x15eb('0x9'));router[_0x15eb('0xa')]('/',auth['isAuthenticated'](),controller[_0x15eb('0xb')]);router[_0x15eb('0xa')](_0x15eb('0xc'),auth[_0x15eb('0xd')](),controller[_0x15eb('0xe')]);router[_0x15eb('0xf')]('/',auth[_0x15eb('0xd')](),controller[_0x15eb('0x10')]);router['put']('/:id',auth[_0x15eb('0xd')](),controller[_0x15eb('0x11')]);router[_0x15eb('0x12')](_0x15eb('0xc'),auth[_0x15eb('0xd')](),controller[_0x15eb('0x13')]);module[_0x15eb('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index 160b84b..2d18d9a 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 _0x50ce=['string','keyValue','picklist','STRING','variable','customVariable','sequelize','ENUM'];(function(_0xb309ab,_0x32cfff){var _0x46ffe8=function(_0x44dc4f){while(--_0x44dc4f){_0xb309ab['push'](_0xb309ab['shift']());}};_0x46ffe8(++_0x32cfff);}(_0x50ce,0x86));var _0xe50c=function(_0x43469e,_0x4e69d6){_0x43469e=_0x43469e-0x0;var _0xcefd2a=_0x50ce[_0x43469e];return _0xcefd2a;};'use strict';var Sequelize=require(_0xe50c('0x0'));module['exports']={'type':{'type':Sequelize[_0xe50c('0x1')](_0xe50c('0x2'),'variable','customVariable',_0xe50c('0x3'),_0xe50c('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0xe50c('0x5')]},'key':{'type':Sequelize[_0xe50c('0x5')]},'keyType':{'type':Sequelize[_0xe50c('0x1')](_0xe50c('0x2'),_0xe50c('0x6'),_0xe50c('0x7'))},'keyContent':{'type':Sequelize[_0xe50c('0x5')]},'idField':{'type':Sequelize['STRING']},'variableName':{'type':Sequelize[_0xe50c('0x5')]}}; \ No newline at end of file +var _0x6ac1=['string','variable','customVariable','keyValue','STRING','exports','ENUM'];(function(_0x23a477,_0x3628f2){var _0x332ecd=function(_0x54be8b){while(--_0x54be8b){_0x23a477['push'](_0x23a477['shift']());}};_0x332ecd(++_0x3628f2);}(_0x6ac1,0x15c));var _0x16ac=function(_0x22f53f,_0x14ef66){_0x22f53f=_0x22f53f-0x0;var _0x57bc67=_0x6ac1[_0x22f53f];return _0x57bc67;};'use strict';var Sequelize=require('sequelize');module[_0x16ac('0x0')]={'type':{'type':Sequelize[_0x16ac('0x1')](_0x16ac('0x2'),_0x16ac('0x3'),_0x16ac('0x4'),_0x16ac('0x5'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x16ac('0x6')]},'keyType':{'type':Sequelize[_0x16ac('0x1')](_0x16ac('0x2'),_0x16ac('0x3'),_0x16ac('0x4'))},'keyContent':{'type':Sequelize[_0x16ac('0x6')]},'idField':{'type':Sequelize[_0x16ac('0x6')]},'variableName':{'type':Sequelize[_0x16ac('0x6')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index 98f8af5..48fa551 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 _0x9002=['offset','set','Content-Range','apply','reject','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','options','SalesforceField','includeAll','findAll','catch','show','params','include','find','create','body','update','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','count'];(function(_0x3ac769,_0x2825df){var _0x2185eb=function(_0x43cc1d){while(--_0x43cc1d){_0x3ac769['push'](_0x3ac769['shift']());}};_0x2185eb(++_0x2825df);}(_0x9002,0x15c));var _0x2900=function(_0xa54c18,_0x4ba567){_0xa54c18=_0xa54c18-0x0;var _0x385f26=_0x9002[_0xa54c18];return _0x385f26;};'use strict';var emlformat=require(_0x2900('0x0'));var rimraf=require(_0x2900('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2900('0x2'));var rp=require(_0x2900('0x3'));var moment=require('moment');var BPromise=require(_0x2900('0x4'));var Mustache=require('mustache');var util=require(_0x2900('0x5'));var path=require(_0x2900('0x6'));var sox=require(_0x2900('0x7'));var csv=require('to-csv');var ejs=require(_0x2900('0x8'));var fs=require('fs');var fs_extra=require(_0x2900('0x9'));var _=require(_0x2900('0xa'));var squel=require(_0x2900('0xb'));var crypto=require(_0x2900('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x2900('0xd'));var toCsv=require(_0x2900('0xe'));var querystring=require('querystring');var Papa=require(_0x2900('0xf'));var Redis=require(_0x2900('0x10'));var authService=require(_0x2900('0x11'));var qs=require(_0x2900('0x12'));var as=require(_0x2900('0x13'));var hardwareService=require(_0x2900('0x14'));var logger=require(_0x2900('0x15'))(_0x2900('0x16'));var utils=require(_0x2900('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x2900('0x18'));var db=require(_0x2900('0x19'))['db'];function respondWithStatusCode(_0x50eb2f,_0x5d76bb){_0x5d76bb=_0x5d76bb||0xcc;return function(_0x245d95){if(_0x245d95){return _0x50eb2f[_0x2900('0x1a')](_0x5d76bb);}return _0x50eb2f[_0x2900('0x1b')](_0x5d76bb)[_0x2900('0x1c')]();};}function respondWithResult(_0x2af99a,_0x35091e){_0x35091e=_0x35091e||0xc8;return function(_0x1f9f86){if(_0x1f9f86){return _0x2af99a[_0x2900('0x1b')](_0x35091e)[_0x2900('0x1d')](_0x1f9f86);}};}function respondWithFilteredResult(_0x2df315,_0x458420){return function(_0x31a1ab){if(_0x31a1ab){var _0x2cd456=typeof _0x458420['offset']==='undefined'&&typeof _0x458420[_0x2900('0x1e')]==='undefined';var _0x21335c=_0x31a1ab[_0x2900('0x1f')];var _0xee1873=_0x2cd456?0x0:_0x458420[_0x2900('0x20')];var _0x25a580=_0x2cd456?_0x31a1ab[_0x2900('0x1f')]:_0x458420['offset']+_0x458420[_0x2900('0x1e')];var _0x3be844;if(_0x25a580>=_0x21335c){_0x25a580=_0x21335c;_0x3be844=0xc8;}else{_0x3be844=0xce;}_0x2df315['status'](_0x3be844);return _0x2df315[_0x2900('0x21')](_0x2900('0x22'),_0xee1873+'-'+_0x25a580+'/'+_0x21335c)[_0x2900('0x1d')](_0x31a1ab);}return null;};}function patchUpdates(_0x1dcd42){return function(_0x5255bd){try{jsonpatch[_0x2900('0x23')](_0x5255bd,_0x1dcd42,!![]);}catch(_0xfb856a){return BPromise[_0x2900('0x24')](_0xfb856a);}return _0x5255bd['save']();};}function saveUpdates(_0x2972d7,_0x35f71c){return function(_0x14a3b7){if(_0x14a3b7){return _0x14a3b7['update'](_0x2972d7)[_0x2900('0x25')](function(_0x42baba){return _0x42baba;});}return null;};}function removeEntity(_0x445b66,_0x269fa9){return function(_0x4faa7d){if(_0x4faa7d){return _0x4faa7d[_0x2900('0x26')]()[_0x2900('0x25')](function(){_0x445b66['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xc103b2,_0x5197d4){return function(_0x52d4b2){if(!_0x52d4b2){_0xc103b2[_0x2900('0x1a')](0x194);}return _0x52d4b2;};}function handleError(_0x22e8d5,_0x4b47d8){_0x4b47d8=_0x4b47d8||0x1f4;return function(_0x3008ca){logger[_0x2900('0x27')](_0x3008ca[_0x2900('0x28')]);if(_0x3008ca[_0x2900('0x29')]){delete _0x3008ca[_0x2900('0x29')];}_0x22e8d5[_0x2900('0x1b')](_0x4b47d8)[_0x2900('0x2a')](_0x3008ca);};}exports[_0x2900('0x2b')]=function(_0x59da05,_0x3bd44d){var _0x5e7739={},_0x2a66c6={},_0x47cdeb={'count':0x0,'rows':[]};var _0x50a374=_[_0x2900('0x2c')](db['SalesforceField'][_0x2900('0x2d')],function(_0xee3c28){return{'name':_0xee3c28[_0x2900('0x2e')],'type':_0xee3c28[_0x2900('0x2f')][_0x2900('0x30')]};});_0x2a66c6[_0x2900('0x31')]=_[_0x2900('0x2c')](_0x50a374,_0x2900('0x29'));_0x2a66c6[_0x2900('0x32')]=_[_0x2900('0x33')](_0x59da05['query']);_0x2a66c6[_0x2900('0x34')]=_['intersection'](_0x2a66c6[_0x2900('0x31')],_0x2a66c6[_0x2900('0x32')]);_0x5e7739[_0x2900('0x35')]=_[_0x2900('0x36')](_0x2a66c6['model'],qs[_0x2900('0x37')](_0x59da05['query'][_0x2900('0x37')]));_0x5e7739[_0x2900('0x35')]=_0x5e7739[_0x2900('0x35')][_0x2900('0x38')]?_0x5e7739[_0x2900('0x35')]:_0x2a66c6['model'];if(!_0x59da05[_0x2900('0x32')][_0x2900('0x39')](_0x2900('0x3a'))){_0x5e7739[_0x2900('0x1e')]=qs[_0x2900('0x1e')](_0x59da05['query'][_0x2900('0x1e')]);_0x5e7739[_0x2900('0x20')]=qs[_0x2900('0x20')](_0x59da05['query'][_0x2900('0x20')]);}_0x5e7739[_0x2900('0x3b')]=qs[_0x2900('0x3c')](_0x59da05[_0x2900('0x32')][_0x2900('0x3c')]);_0x5e7739[_0x2900('0x3d')]=qs[_0x2900('0x34')](_['pick'](_0x59da05['query'],_0x2a66c6[_0x2900('0x34')]),_0x50a374);if(_0x59da05[_0x2900('0x32')]['filter']){_0x5e7739['where']=_[_0x2900('0x3e')](_0x5e7739['where'],{'$or':_[_0x2900('0x2c')](_0x50a374,function(_0x1071a1){if(_0x1071a1['type']!==_0x2900('0x3f')){var _0xfc1d40={};_0xfc1d40[_0x1071a1[_0x2900('0x29')]]={'$like':'%'+_0x59da05[_0x2900('0x32')]['filter']+'%'};return _0xfc1d40;}})});}_0x5e7739=_[_0x2900('0x3e')]({},_0x5e7739,_0x59da05[_0x2900('0x40')]);var _0x118b07={'where':_0x5e7739[_0x2900('0x3d')]};return db[_0x2900('0x41')][_0x2900('0x1f')](_0x118b07)[_0x2900('0x25')](function(_0x1f66ff){_0x47cdeb[_0x2900('0x1f')]=_0x1f66ff;if(_0x59da05[_0x2900('0x32')][_0x2900('0x42')]){_0x5e7739['include']=[{'all':!![]}];}return db['SalesforceField'][_0x2900('0x43')](_0x5e7739);})[_0x2900('0x25')](function(_0x1d0968){_0x47cdeb['rows']=_0x1d0968;return _0x47cdeb;})[_0x2900('0x25')](respondWithFilteredResult(_0x3bd44d,_0x5e7739))[_0x2900('0x44')](handleError(_0x3bd44d,null));};exports[_0x2900('0x45')]=function(_0x198203,_0x3bbb1f){var _0x2567f4={'raw':!![],'where':{'id':_0x198203[_0x2900('0x46')]['id']}},_0x359295={};_0x359295[_0x2900('0x31')]=_[_0x2900('0x33')](db['SalesforceField']['rawAttributes']);_0x359295['query']=_[_0x2900('0x33')](_0x198203[_0x2900('0x32')]);_0x359295[_0x2900('0x34')]=_[_0x2900('0x36')](_0x359295[_0x2900('0x31')],_0x359295['query']);_0x2567f4[_0x2900('0x35')]=_[_0x2900('0x36')](_0x359295[_0x2900('0x31')],qs[_0x2900('0x37')](_0x198203[_0x2900('0x32')]['fields']));_0x2567f4[_0x2900('0x35')]=_0x2567f4['attributes'][_0x2900('0x38')]?_0x2567f4[_0x2900('0x35')]:_0x359295[_0x2900('0x31')];if(_0x198203[_0x2900('0x32')][_0x2900('0x42')]){_0x2567f4[_0x2900('0x47')]=[{'all':!![]}];}_0x2567f4=_['merge']({},_0x2567f4,_0x198203[_0x2900('0x40')]);return db[_0x2900('0x41')][_0x2900('0x48')](_0x2567f4)[_0x2900('0x25')](handleEntityNotFound(_0x3bbb1f,null))[_0x2900('0x25')](respondWithResult(_0x3bbb1f,null))[_0x2900('0x44')](handleError(_0x3bbb1f,null));};exports[_0x2900('0x49')]=function(_0x404b80,_0x439953){return db['SalesforceField'][_0x2900('0x49')](_0x404b80[_0x2900('0x4a')],{})[_0x2900('0x25')](respondWithResult(_0x439953,0xc9))['catch'](handleError(_0x439953,null));};exports[_0x2900('0x4b')]=function(_0x4ca84d,_0x15523c){if(_0x4ca84d[_0x2900('0x4a')]['id']){delete _0x4ca84d[_0x2900('0x4a')]['id'];}return db[_0x2900('0x41')]['find']({'where':{'id':_0x4ca84d[_0x2900('0x46')]['id']}})[_0x2900('0x25')](handleEntityNotFound(_0x15523c,null))[_0x2900('0x25')](saveUpdates(_0x4ca84d[_0x2900('0x4a')],null))[_0x2900('0x25')](respondWithResult(_0x15523c,null))[_0x2900('0x44')](handleError(_0x15523c,null));};exports[_0x2900('0x26')]=function(_0xb6712b,_0x3293a2){return db[_0x2900('0x41')]['find']({'where':{'id':_0xb6712b[_0x2900('0x46')]['id']}})[_0x2900('0x25')](handleEntityNotFound(_0x3293a2,null))['then'](removeEntity(_0x3293a2,null))[_0x2900('0x44')](handleError(_0x3293a2,null));}; \ No newline at end of file +var _0xc112=['util','path','to-csv','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','index','map','SalesforceField','fieldName','type','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','catch','show','rawAttributes','create','body','find','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x4233b0,_0x5effc4){var _0x31c625=function(_0x212c20){while(--_0x212c20){_0x4233b0['push'](_0x4233b0['shift']());}};_0x31c625(++_0x5effc4);}(_0xc112,0x8e));var _0x2c11=function(_0x15783f,_0x4a0670){_0x15783f=_0x15783f-0x0;var _0x15b342=_0xc112[_0x15783f];return _0x15b342;};'use strict';var emlformat=require(_0x2c11('0x0'));var rimraf=require(_0x2c11('0x1'));var zipdir=require(_0x2c11('0x2'));var jsonpatch=require(_0x2c11('0x3'));var rp=require(_0x2c11('0x4'));var moment=require(_0x2c11('0x5'));var BPromise=require(_0x2c11('0x6'));var Mustache=require(_0x2c11('0x7'));var util=require(_0x2c11('0x8'));var path=require(_0x2c11('0x9'));var sox=require('sox');var csv=require(_0x2c11('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2c11('0xb'));var _=require(_0x2c11('0xc'));var squel=require(_0x2c11('0xd'));var crypto=require(_0x2c11('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2c11('0xa'));var querystring=require(_0x2c11('0xf'));var Papa=require(_0x2c11('0x10'));var Redis=require(_0x2c11('0x11'));var authService=require(_0x2c11('0x12'));var qs=require(_0x2c11('0x13'));var as=require(_0x2c11('0x14'));var hardwareService=require(_0x2c11('0x15'));var logger=require(_0x2c11('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x2c11('0x17'));var licenseUtil=require(_0x2c11('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x15e205,_0x40eb5a){_0x40eb5a=_0x40eb5a||0xcc;return function(_0x1b145a){if(_0x1b145a){return _0x15e205['sendStatus'](_0x40eb5a);}return _0x15e205[_0x2c11('0x19')](_0x40eb5a)['end']();};}function respondWithResult(_0x52c711,_0x4952f4){_0x4952f4=_0x4952f4||0xc8;return function(_0x25aa2e){if(_0x25aa2e){return _0x52c711[_0x2c11('0x19')](_0x4952f4)['json'](_0x25aa2e);}};}function respondWithFilteredResult(_0x1227c8,_0x1fbee5){return function(_0x1bb5cd){if(_0x1bb5cd){var _0x449a9c=typeof _0x1fbee5[_0x2c11('0x1a')]==='undefined'&&typeof _0x1fbee5[_0x2c11('0x1b')]===_0x2c11('0x1c');var _0x1d8a9c=_0x1bb5cd[_0x2c11('0x1d')];var _0x1456d3=_0x449a9c?0x0:_0x1fbee5['offset'];var _0x151eec=_0x449a9c?_0x1bb5cd[_0x2c11('0x1d')]:_0x1fbee5[_0x2c11('0x1a')]+_0x1fbee5[_0x2c11('0x1b')];var _0x4cbe21;if(_0x151eec>=_0x1d8a9c){_0x151eec=_0x1d8a9c;_0x4cbe21=0xc8;}else{_0x4cbe21=0xce;}_0x1227c8[_0x2c11('0x19')](_0x4cbe21);return _0x1227c8[_0x2c11('0x1e')](_0x2c11('0x1f'),_0x1456d3+'-'+_0x151eec+'/'+_0x1d8a9c)[_0x2c11('0x20')](_0x1bb5cd);}return null;};}function patchUpdates(_0x49d4d7){return function(_0x56a19f){try{jsonpatch[_0x2c11('0x21')](_0x56a19f,_0x49d4d7,!![]);}catch(_0xc1009a){return BPromise[_0x2c11('0x22')](_0xc1009a);}return _0x56a19f[_0x2c11('0x23')]();};}function saveUpdates(_0x4c5384,_0x3bb2da){return function(_0x4f8a90){if(_0x4f8a90){return _0x4f8a90[_0x2c11('0x24')](_0x4c5384)[_0x2c11('0x25')](function(_0x13b106){return _0x13b106;});}return null;};}function removeEntity(_0x458930,_0x120a2b){return function(_0x4c96b8){if(_0x4c96b8){return _0x4c96b8[_0x2c11('0x26')]()[_0x2c11('0x25')](function(){_0x458930[_0x2c11('0x19')](0xcc)[_0x2c11('0x27')]();});}};}function handleEntityNotFound(_0xc9cf32,_0x511fa7){return function(_0x15eeea){if(!_0x15eeea){_0xc9cf32[_0x2c11('0x28')](0x194);}return _0x15eeea;};}function handleError(_0x4169e5,_0x2fa0af){_0x2fa0af=_0x2fa0af||0x1f4;return function(_0x4b24e1){logger[_0x2c11('0x29')](_0x4b24e1[_0x2c11('0x2a')]);if(_0x4b24e1[_0x2c11('0x2b')]){delete _0x4b24e1[_0x2c11('0x2b')];}_0x4169e5[_0x2c11('0x19')](_0x2fa0af)['send'](_0x4b24e1);};}exports[_0x2c11('0x2c')]=function(_0x4e813f,_0x52583f){var _0x443b2f={},_0x1b9be4={},_0x34be5f={'count':0x0,'rows':[]};var _0x25d74e=_[_0x2c11('0x2d')](db[_0x2c11('0x2e')]['rawAttributes'],function(_0xca2fe5){return{'name':_0xca2fe5[_0x2c11('0x2f')],'type':_0xca2fe5[_0x2c11('0x30')]['key']};});_0x1b9be4[_0x2c11('0x31')]=_[_0x2c11('0x2d')](_0x25d74e,_0x2c11('0x2b'));_0x1b9be4['query']=_[_0x2c11('0x32')](_0x4e813f[_0x2c11('0x33')]);_0x1b9be4[_0x2c11('0x34')]=_[_0x2c11('0x35')](_0x1b9be4[_0x2c11('0x31')],_0x1b9be4['query']);_0x443b2f['attributes']=_[_0x2c11('0x35')](_0x1b9be4[_0x2c11('0x31')],qs[_0x2c11('0x36')](_0x4e813f[_0x2c11('0x33')]['fields']));_0x443b2f[_0x2c11('0x37')]=_0x443b2f[_0x2c11('0x37')]['length']?_0x443b2f[_0x2c11('0x37')]:_0x1b9be4[_0x2c11('0x31')];if(!_0x4e813f[_0x2c11('0x33')][_0x2c11('0x38')](_0x2c11('0x39'))){_0x443b2f[_0x2c11('0x1b')]=qs[_0x2c11('0x1b')](_0x4e813f[_0x2c11('0x33')][_0x2c11('0x1b')]);_0x443b2f[_0x2c11('0x1a')]=qs[_0x2c11('0x1a')](_0x4e813f[_0x2c11('0x33')][_0x2c11('0x1a')]);}_0x443b2f[_0x2c11('0x3a')]=qs['sort'](_0x4e813f['query'][_0x2c11('0x3b')]);_0x443b2f[_0x2c11('0x3c')]=qs[_0x2c11('0x34')](_[_0x2c11('0x3d')](_0x4e813f['query'],_0x1b9be4['filters']),_0x25d74e);if(_0x4e813f['query'][_0x2c11('0x3e')]){_0x443b2f[_0x2c11('0x3c')]=_[_0x2c11('0x3f')](_0x443b2f['where'],{'$or':_[_0x2c11('0x2d')](_0x25d74e,function(_0x5b5683){if(_0x5b5683['type']!==_0x2c11('0x40')){var _0x411c0c={};_0x411c0c[_0x5b5683[_0x2c11('0x2b')]]={'$like':'%'+_0x4e813f[_0x2c11('0x33')]['filter']+'%'};return _0x411c0c;}})});}_0x443b2f=_['merge']({},_0x443b2f,_0x4e813f[_0x2c11('0x41')]);var _0x4b4e88={'where':_0x443b2f[_0x2c11('0x3c')]};return db[_0x2c11('0x2e')]['count'](_0x4b4e88)['then'](function(_0x2b66b9){_0x34be5f['count']=_0x2b66b9;if(_0x4e813f['query']['includeAll']){_0x443b2f[_0x2c11('0x42')]=[{'all':!![]}];}return db[_0x2c11('0x2e')][_0x2c11('0x43')](_0x443b2f);})['then'](function(_0x42d917){_0x34be5f['rows']=_0x42d917;return _0x34be5f;})[_0x2c11('0x25')](respondWithFilteredResult(_0x52583f,_0x443b2f))[_0x2c11('0x44')](handleError(_0x52583f,null));};exports[_0x2c11('0x45')]=function(_0x13c76e,_0x19fd66){var _0x53af68={'raw':!![],'where':{'id':_0x13c76e['params']['id']}},_0x1adb38={};_0x1adb38[_0x2c11('0x31')]=_['keys'](db[_0x2c11('0x2e')][_0x2c11('0x46')]);_0x1adb38[_0x2c11('0x33')]=_[_0x2c11('0x32')](_0x13c76e[_0x2c11('0x33')]);_0x1adb38[_0x2c11('0x34')]=_['intersection'](_0x1adb38[_0x2c11('0x31')],_0x1adb38[_0x2c11('0x33')]);_0x53af68['attributes']=_['intersection'](_0x1adb38['model'],qs[_0x2c11('0x36')](_0x13c76e['query'][_0x2c11('0x36')]));_0x53af68['attributes']=_0x53af68['attributes']['length']?_0x53af68[_0x2c11('0x37')]:_0x1adb38['model'];if(_0x13c76e[_0x2c11('0x33')]['includeAll']){_0x53af68[_0x2c11('0x42')]=[{'all':!![]}];}_0x53af68=_[_0x2c11('0x3f')]({},_0x53af68,_0x13c76e[_0x2c11('0x41')]);return db[_0x2c11('0x2e')]['find'](_0x53af68)['then'](handleEntityNotFound(_0x19fd66,null))[_0x2c11('0x25')](respondWithResult(_0x19fd66,null))[_0x2c11('0x44')](handleError(_0x19fd66,null));};exports[_0x2c11('0x47')]=function(_0xc40f14,_0x33c79f){return db[_0x2c11('0x2e')][_0x2c11('0x47')](_0xc40f14[_0x2c11('0x48')],{})[_0x2c11('0x25')](respondWithResult(_0x33c79f,0xc9))[_0x2c11('0x44')](handleError(_0x33c79f,null));};exports['update']=function(_0x217330,_0x3a5aa5){if(_0x217330[_0x2c11('0x48')]['id']){delete _0x217330[_0x2c11('0x48')]['id'];}return db['SalesforceField'][_0x2c11('0x49')]({'where':{'id':_0x217330[_0x2c11('0x4a')]['id']}})[_0x2c11('0x25')](handleEntityNotFound(_0x3a5aa5,null))[_0x2c11('0x25')](saveUpdates(_0x217330[_0x2c11('0x48')],null))[_0x2c11('0x25')](respondWithResult(_0x3a5aa5,null))[_0x2c11('0x44')](handleError(_0x3a5aa5,null));};exports[_0x2c11('0x26')]=function(_0xb0edbe,_0x180775){return db[_0x2c11('0x2e')]['find']({'where':{'id':_0xb0edbe[_0x2c11('0x4a')]['id']}})[_0x2c11('0x25')](handleEntityNotFound(_0x180775,null))['then'](removeEntity(_0x180775,null))[_0x2c11('0x44')](handleError(_0x180775,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index d15d92a..5c2b9e0 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 _0x7bb9=['define','SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','FieldId','lodash','moment','rimraf','../../config/environment','./intSalesforceField.attributes','exports'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x7bb9,0x13e));var _0x97bb=function(_0x5f3f88,_0x562baf){_0x5f3f88=_0x5f3f88-0x0;var _0xd08119=_0x7bb9[_0x5f3f88];return _0xd08119;};'use strict';var _=require(_0x97bb('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x97bb('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x97bb('0x2'));var config=require(_0x97bb('0x3'));var attributes=require(_0x97bb('0x4'));module[_0x97bb('0x5')]=function(_0x5c5d1b,_0x64b625){return _0x5c5d1b[_0x97bb('0x6')](_0x97bb('0x7'),attributes,{'tableName':_0x97bb('0x8'),'paranoid':![],'indexes':[{'name':_0x97bb('0x9'),'fields':[_0x97bb('0xa'),_0x97bb('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb6d6=['lodash','util','api','moment','bluebird','rimraf','../../config/environment','exports','define','SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','FieldId'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0xb6d6,0x9a));var _0x6b6d=function(_0x43d65d,_0x54d57c){_0x43d65d=_0x43d65d-0x0;var _0x2a5f77=_0xb6d6[_0x43d65d];return _0x2a5f77;};'use strict';var _=require(_0x6b6d('0x0'));var util=require(_0x6b6d('0x1'));var logger=require('../../config/logger')(_0x6b6d('0x2'));var moment=require(_0x6b6d('0x3'));var BPromise=require(_0x6b6d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6b6d('0x5'));var config=require(_0x6b6d('0x6'));var attributes=require('./intSalesforceField.attributes');module[_0x6b6d('0x7')]=function(_0x789d06,_0x5d276c){return _0x789d06[_0x6b6d('0x8')](_0x6b6d('0x9'),attributes,{'tableName':_0x6b6d('0xa'),'paranoid':![],'indexes':[{'name':_0x6b6d('0xb'),'fields':[_0x6b6d('0xc'),_0x6b6d('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.rpc.js b/server/api/intSalesforceField/intSalesforceField.rpc.js index df89afa..4a25e87 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 _0x87bf=['request','info','stringify','error','code','SalesforceField,\x20%s,\x20%s','message','request\x20sent','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x1cf4a9,_0x165da4){var _0x4d67b0=function(_0x3dc117){while(--_0x3dc117){_0x1cf4a9['push'](_0x1cf4a9['shift']());}};_0x4d67b0(++_0x165da4);}(_0x87bf,0x1c1));var _0xf87b=function(_0x3a2f45,_0x628b19){_0x3a2f45=_0x3a2f45-0x0;var _0x25b26c=_0x87bf[_0x3a2f45];return _0x25b26c;};'use strict';var _=require('lodash');var util=require(_0xf87b('0x0'));var moment=require(_0xf87b('0x1'));var BPromise=require(_0xf87b('0x2'));var rs=require(_0xf87b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf87b('0x4'))['db'];var utils=require(_0xf87b('0x5'));var logger=require(_0xf87b('0x6'))(_0xf87b('0x7'));var config=require(_0xf87b('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xf87b('0x9')][_0xf87b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x9fd225,_0x205d32,_0x4a1d1b){return new BPromise(function(_0x68d929,_0x1909fd){return client[_0xf87b('0xb')](_0x9fd225,_0x4a1d1b)['then'](function(_0xf38e6b){logger[_0xf87b('0xc')]('SalesforceField,\x20%s,\x20%s',_0x205d32,'request\x20sent');logger['debug']('SalesforceField,\x20%s,\x20%s,\x20%s',_0x205d32,'request\x20sent',JSON[_0xf87b('0xd')](_0xf38e6b));if(_0xf38e6b['error']){if(_0xf38e6b[_0xf87b('0xe')][_0xf87b('0xf')]===0x1f4){logger[_0xf87b('0xe')](_0xf87b('0x10'),_0x205d32,_0xf38e6b[_0xf87b('0xe')][_0xf87b('0x11')]);return _0x1909fd(_0xf38e6b['error']['message']);}logger[_0xf87b('0xe')](_0xf87b('0x10'),_0x205d32,_0xf38e6b[_0xf87b('0xe')]['message']);return _0x68d929(_0xf38e6b['error'][_0xf87b('0x11')]);}else{logger[_0xf87b('0xc')](_0xf87b('0x10'),_0x205d32,_0xf87b('0x12'));_0x68d929(_0xf38e6b['result'][_0xf87b('0x11')]);}})[_0xf87b('0x13')](function(_0x4fc49d){logger[_0xf87b('0xe')](_0xf87b('0x10'),_0x205d32,_0x4fc49d);_0x1909fd(_0x4fc49d);});});} \ No newline at end of file +var _0x6360=['ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','info','SalesforceField,\x20%s,\x20%s','debug','SalesforceField,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x1c0f41,_0x26d95d){var _0x369a9f=function(_0x251234){while(--_0x251234){_0x1c0f41['push'](_0x1c0f41['shift']());}};_0x369a9f(++_0x26d95d);}(_0x6360,0x1c9));var _0x0636=function(_0x19ecdb,_0x253521){_0x19ecdb=_0x19ecdb-0x0;var _0x792ec9=_0x6360[_0x19ecdb];return _0x792ec9;};'use strict';var _=require(_0x0636('0x0'));var util=require(_0x0636('0x1'));var moment=require(_0x0636('0x2'));var BPromise=require(_0x0636('0x3'));var rs=require(_0x0636('0x4'));var fs=require('fs');var Redis=require(_0x0636('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x0636('0x6'));var logger=require(_0x0636('0x7'))(_0x0636('0x8'));var config=require('../../config/environment');var jayson=require(_0x0636('0x9'));var client=jayson['client'][_0x0636('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1ea304,_0x325978,_0x4bce45){return new BPromise(function(_0xa73ca,_0x533b40){return client[_0x0636('0xb')](_0x1ea304,_0x4bce45)['then'](function(_0x3e85ff){logger[_0x0636('0xc')](_0x0636('0xd'),_0x325978,'request\x20sent');logger[_0x0636('0xe')](_0x0636('0xf'),_0x325978,_0x0636('0x10'),JSON['stringify'](_0x3e85ff));if(_0x3e85ff[_0x0636('0x11')]){if(_0x3e85ff['error'][_0x0636('0x12')]===0x1f4){logger[_0x0636('0x11')](_0x0636('0xd'),_0x325978,_0x3e85ff['error'][_0x0636('0x13')]);return _0x533b40(_0x3e85ff[_0x0636('0x11')][_0x0636('0x13')]);}logger['error'](_0x0636('0xd'),_0x325978,_0x3e85ff[_0x0636('0x11')][_0x0636('0x13')]);return _0xa73ca(_0x3e85ff[_0x0636('0x11')][_0x0636('0x13')]);}else{logger[_0x0636('0xc')](_0x0636('0xd'),_0x325978,_0x0636('0x10'));_0xa73ca(_0x3e85ff[_0x0636('0x14')][_0x0636('0x13')]);}})[_0x0636('0x15')](function(_0x23d3fc){logger['error'](_0x0636('0xd'),_0x325978,_0x23d3fc);_0x533b40(_0x23d3fc);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 8fc5553..81460bc 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 _0xb8ab=['/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','put','update','delete','destroy','multer','Router','fs-extra','../../components/auth/service','./intServicenowAccount.controller','get','isAuthenticated','index'];(function(_0x23fc32,_0x976f6d){var _0x13963e=function(_0x2f8881){while(--_0x2f8881){_0x23fc32['push'](_0x23fc32['shift']());}};_0x13963e(++_0x976f6d);}(_0xb8ab,0xd4));var _0xbb8a=function(_0x369a19,_0x457d03){_0x369a19=_0x369a19-0x0;var _0x427cbc=_0xb8ab[_0x369a19];return _0x427cbc;};'use strict';var multer=require(_0xbb8a('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xbb8a('0x1')]();var fs_extra=require(_0xbb8a('0x2'));var auth=require(_0xbb8a('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbb8a('0x4'));router[_0xbb8a('0x5')]('/',auth[_0xbb8a('0x6')](),controller[_0xbb8a('0x7')]);router[_0xbb8a('0x5')](_0xbb8a('0x8'),auth[_0xbb8a('0x6')](),controller[_0xbb8a('0x9')]);router[_0xbb8a('0x5')](_0xbb8a('0xa'),auth['isAuthenticated'](),controller[_0xbb8a('0xb')]);router[_0xbb8a('0x5')](_0xbb8a('0xc'),auth[_0xbb8a('0x6')](),controller[_0xbb8a('0xd')]);router[_0xbb8a('0xe')]('/',auth['isAuthenticated'](),controller[_0xbb8a('0xf')]);router['post'](_0xbb8a('0xa'),auth[_0xbb8a('0x6')](),controller['addConfiguration']);router[_0xbb8a('0x10')](_0xbb8a('0x8'),auth[_0xbb8a('0x6')](),controller[_0xbb8a('0x11')]);router[_0xbb8a('0x12')](_0xbb8a('0x8'),auth[_0xbb8a('0x6')](),controller[_0xbb8a('0x13')]);module['exports']=router; \ No newline at end of file +var _0x195e=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','isAuthenticated','/:id','show','/:id/fields','getFields','create','post','addConfiguration','update','delete','destroy','multer','util'];(function(_0x3d6eca,_0x15cd90){var _0x3220fb=function(_0x58ef6a){while(--_0x58ef6a){_0x3d6eca['push'](_0x3d6eca['shift']());}};_0x3220fb(++_0x15cd90);}(_0x195e,0xfb));var _0xe195=function(_0x9830cb,_0x293555){_0x9830cb=_0x9830cb-0x0;var _0x100f07=_0x195e[_0x9830cb];return _0x100f07;};'use strict';var multer=require(_0xe195('0x0'));var util=require(_0xe195('0x1'));var path=require(_0xe195('0x2'));var timeout=require(_0xe195('0x3'));var express=require(_0xe195('0x4'));var router=express[_0xe195('0x5')]();var fs_extra=require(_0xe195('0x6'));var auth=require(_0xe195('0x7'));var interaction=require(_0xe195('0x8'));var config=require(_0xe195('0x9'));var controller=require(_0xe195('0xa'));router[_0xe195('0xb')]('/',auth[_0xe195('0xc')](),controller['index']);router[_0xe195('0xb')](_0xe195('0xd'),auth[_0xe195('0xc')](),controller[_0xe195('0xe')]);router[_0xe195('0xb')]('/:id/configurations',auth['isAuthenticated'](),controller['getConfigurations']);router[_0xe195('0xb')](_0xe195('0xf'),auth[_0xe195('0xc')](),controller[_0xe195('0x10')]);router['post']('/',auth[_0xe195('0xc')](),controller[_0xe195('0x11')]);router[_0xe195('0x12')]('/:id/configurations',auth[_0xe195('0xc')](),controller[_0xe195('0x13')]);router['put'](_0xe195('0xd'),auth[_0xe195('0xc')](),controller[_0xe195('0x14')]);router[_0xe195('0x15')]('/:id',auth[_0xe195('0xc')](),controller[_0xe195('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index 41a132b..f9f7e85 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 _0x34c4=['remoteUri','exports','STRING'];(function(_0x1f50a6,_0x1c5a28){var _0x4d9da1=function(_0x18dbb8){while(--_0x18dbb8){_0x1f50a6['push'](_0x1f50a6['shift']());}};_0x4d9da1(++_0x1c5a28);}(_0x34c4,0xb5));var _0x434c=function(_0x22759a,_0x360a48){_0x22759a=_0x22759a-0x0;var _0x4ea5da=_0x34c4[_0x22759a];return _0x4ea5da;};'use strict';var Sequelize=require('sequelize');module[_0x434c('0x0')]={'name':{'type':Sequelize[_0x434c('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x434c('0x1')],'unique':'username'},'password':{'type':Sequelize[_0x434c('0x1')]},'email':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x434c('0x1')],'unique':_0x434c('0x2')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x3b20=['exports','STRING','username','remoteUri','sequelize'];(function(_0x36c740,_0x31d564){var _0x4980f7=function(_0x180bed){while(--_0x180bed){_0x36c740['push'](_0x36c740['shift']());}};_0x4980f7(++_0x31d564);}(_0x3b20,0x9f));var _0x03b2=function(_0x26ef31,_0xd8f94b){_0x26ef31=_0x26ef31-0x0;var _0x366f80=_0x3b20[_0x26ef31];return _0x366f80;};'use strict';var Sequelize=require(_0x03b2('0x0'));module[_0x03b2('0x1')]={'name':{'type':Sequelize[_0x03b2('0x2')]},'description':{'type':Sequelize[_0x03b2('0x2')]},'username':{'type':Sequelize[_0x03b2('0x2')],'unique':_0x03b2('0x3')},'password':{'type':Sequelize[_0x03b2('0x2')]},'email':{'type':Sequelize[_0x03b2('0x2')]},'remoteUri':{'type':Sequelize[_0x03b2('0x2')],'unique':_0x03b2('0x4')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index 9e37711..44418ac 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 _0x02b9=['offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','stack','index','map','ServicenowAccount','rawAttributes','fieldName','type','model','name','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','includeAll','findAll','rows','params','include','options','find','catch','create','body','getConfigurations','findOne','ServicenowConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','ServicenowField','getFields','made_sla','hold_reason','knowledge','subcategory','notify','incident_state','severity','category','parent','watch_list','upon_reject','sys_updated_on','child_incidents','number','resolved_by','opened_by','user_input','sys_created_on','sys_domain','sys_created_by','calendar_stc','closed_at','cmdb_ci','delivery_plan','impact','work_notes_list','business_service','priority','sys_domain_path','rfc','expected_start','opened_at','business_duration','group_list','work_end','reopened_time','resolved_at','caller_id','approval_set','work_notes','short_description','close_code','correlation_display','delivery_task','work_start','assignment_group','business_stc','additional_assignee_list','description','sys_class_name','close_notes','closed_by','follow_up','parent_incident','sys_id','contact_type','reopened_by','urgency','problem_id','company','reassignment_count','activity_due','assigned_to','comments','approval','comments_and_work_notes','due_date','sys_mod_count','sys_tags','escalation','upon_approval','correlation_id','location','username','password','remoteUri','serverUrl','slice','substring','lastIndexOf','%s/api/now/doc/table/schema/','format','%s/api/now/table/','GET','incident?sysparm_display_value=all','result','incident\x20table\x20objects','assign','includes','forEach','internalType','label','push','all','log','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','test','statusCode','send','True','False','sys_choice?sysparm_query=name=incident^element=','inactive','false','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json'];(function(_0xc096ec,_0x21acad){var _0x4b9712=function(_0x2f5659){while(--_0x2f5659){_0xc096ec['push'](_0xc096ec['shift']());}};_0x4b9712(++_0x21acad);}(_0x02b9,0xa1));var _0x902b=function(_0x4aa2a0,_0x505424){_0x4aa2a0=_0x4aa2a0-0x0;var _0x97132e=_0x02b9[_0x4aa2a0];return _0x97132e;};'use strict';var emlformat=require(_0x902b('0x0'));var rimraf=require(_0x902b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x902b('0x2'));var moment=require(_0x902b('0x3'));var BPromise=require(_0x902b('0x4'));var Mustache=require(_0x902b('0x5'));var util=require('util');var path=require(_0x902b('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x902b('0x7'));var squel=require('squel');var crypto=require(_0x902b('0x8'));var jsforce=require(_0x902b('0x9'));var deskjs=require(_0x902b('0xa'));var toCsv=require(_0x902b('0xb'));var querystring=require(_0x902b('0xc'));var Papa=require(_0x902b('0xd'));var Redis=require(_0x902b('0xe'));var authService=require(_0x902b('0xf'));var qs=require(_0x902b('0x10'));var as=require(_0x902b('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x902b('0x12'))(_0x902b('0x13'));var utils=require(_0x902b('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x902b('0x15'));var db=require('../../mysqldb')['db'];var integrations=require(_0x902b('0x16'));function respondWithStatusCode(_0x4bd061,_0x34c117){_0x34c117=_0x34c117||0xcc;return function(_0x43e2d1){if(_0x43e2d1){return _0x4bd061[_0x902b('0x17')](_0x34c117);}return _0x4bd061[_0x902b('0x18')](_0x34c117)[_0x902b('0x19')]();};}function respondWithResult(_0xef82e6,_0x49a860){_0x49a860=_0x49a860||0xc8;return function(_0x24fdca){if(_0x24fdca){return _0xef82e6['status'](_0x49a860)[_0x902b('0x1a')](_0x24fdca);}};}function respondWithFilteredResult(_0x527148,_0x3811c1){return function(_0x100293){if(_0x100293){var _0x16eb95=typeof _0x3811c1[_0x902b('0x1b')]===_0x902b('0x1c')&&typeof _0x3811c1[_0x902b('0x1d')]===_0x902b('0x1c');var _0x22ae20=_0x100293['count'];var _0x37dcc6=_0x16eb95?0x0:_0x3811c1[_0x902b('0x1b')];var _0x1713ba=_0x16eb95?_0x100293[_0x902b('0x1e')]:_0x3811c1[_0x902b('0x1b')]+_0x3811c1['limit'];var _0x375d0e;if(_0x1713ba>=_0x22ae20){_0x1713ba=_0x22ae20;_0x375d0e=0xc8;}else{_0x375d0e=0xce;}_0x527148[_0x902b('0x18')](_0x375d0e);return _0x527148[_0x902b('0x1f')](_0x902b('0x20'),_0x37dcc6+'-'+_0x1713ba+'/'+_0x22ae20)[_0x902b('0x1a')](_0x100293);}return null;};}function patchUpdates(_0x5b3e81){return function(_0x5d6cf3){try{jsonpatch[_0x902b('0x21')](_0x5d6cf3,_0x5b3e81,!![]);}catch(_0x32c897){return BPromise['reject'](_0x32c897);}return _0x5d6cf3[_0x902b('0x22')]();};}function saveUpdates(_0x5ea363,_0x301d54){return function(_0x52f37d){if(_0x52f37d){return _0x52f37d[_0x902b('0x23')](_0x5ea363)[_0x902b('0x24')](function(_0x3b8b07){return _0x3b8b07;});}return null;};}function removeEntity(_0xa58ade,_0x4f5927){return function(_0x292f36){if(_0x292f36){return _0x292f36[_0x902b('0x25')]()[_0x902b('0x24')](function(){_0xa58ade['status'](0xcc)[_0x902b('0x19')]();});}};}function handleEntityNotFound(_0x5ec6c6,_0x2f510d){return function(_0x271a3c){if(!_0x271a3c){_0x5ec6c6['sendStatus'](0x194);}return _0x271a3c;};}function handleError(_0x3b28ca,_0xcc305){_0xcc305=_0xcc305||0x1f4;return function(_0x2fe5b0){logger[_0x902b('0x26')](_0x2fe5b0[_0x902b('0x27')]);if(_0x2fe5b0['name']){delete _0x2fe5b0['name'];}_0x3b28ca[_0x902b('0x18')](_0xcc305)['send'](_0x2fe5b0);};}exports[_0x902b('0x28')]=function(_0x459f28,_0x926e41){var _0x4ec129={},_0x8030f5={},_0x17c051={'count':0x0,'rows':[]};var _0x20d9c8=_[_0x902b('0x29')](db[_0x902b('0x2a')][_0x902b('0x2b')],function(_0x18b0d5){return{'name':_0x18b0d5[_0x902b('0x2c')],'type':_0x18b0d5[_0x902b('0x2d')]['key']};});_0x8030f5[_0x902b('0x2e')]=_[_0x902b('0x29')](_0x20d9c8,_0x902b('0x2f'));_0x8030f5['query']=_[_0x902b('0x30')](_0x459f28['query']);_0x8030f5[_0x902b('0x31')]=_[_0x902b('0x32')](_0x8030f5[_0x902b('0x2e')],_0x8030f5[_0x902b('0x33')]);_0x4ec129[_0x902b('0x34')]=_[_0x902b('0x32')](_0x8030f5['model'],qs[_0x902b('0x35')](_0x459f28[_0x902b('0x33')][_0x902b('0x35')]));_0x4ec129[_0x902b('0x34')]=_0x4ec129[_0x902b('0x34')][_0x902b('0x36')]?_0x4ec129[_0x902b('0x34')]:_0x8030f5[_0x902b('0x2e')];if(!_0x459f28['query'][_0x902b('0x37')](_0x902b('0x38'))){_0x4ec129[_0x902b('0x1d')]=qs[_0x902b('0x1d')](_0x459f28[_0x902b('0x33')]['limit']);_0x4ec129[_0x902b('0x1b')]=qs[_0x902b('0x1b')](_0x459f28['query']['offset']);}_0x4ec129[_0x902b('0x39')]=qs[_0x902b('0x3a')](_0x459f28['query'][_0x902b('0x3a')]);_0x4ec129['where']=qs['filters'](_[_0x902b('0x3b')](_0x459f28[_0x902b('0x33')],_0x8030f5[_0x902b('0x31')]),_0x20d9c8);if(_0x459f28['query'][_0x902b('0x3c')]){_0x4ec129[_0x902b('0x3d')]=_[_0x902b('0x3e')](_0x4ec129['where'],{'$or':_[_0x902b('0x29')](_0x20d9c8,function(_0x40eb6e){if(_0x40eb6e[_0x902b('0x2d')]!=='VIRTUAL'){var _0x31ee9d={};_0x31ee9d[_0x40eb6e[_0x902b('0x2f')]]={'$like':'%'+_0x459f28[_0x902b('0x33')][_0x902b('0x3c')]+'%'};return _0x31ee9d;}})});}_0x4ec129=_[_0x902b('0x3e')]({},_0x4ec129,_0x459f28['options']);var _0x59ff32={'where':_0x4ec129[_0x902b('0x3d')]};return db[_0x902b('0x2a')][_0x902b('0x1e')](_0x59ff32)[_0x902b('0x24')](function(_0x4d24d6){_0x17c051['count']=_0x4d24d6;if(_0x459f28['query'][_0x902b('0x3f')]){_0x4ec129['include']=[{'all':!![]}];}return db[_0x902b('0x2a')][_0x902b('0x40')](_0x4ec129);})[_0x902b('0x24')](function(_0x115dd0){_0x17c051[_0x902b('0x41')]=_0x115dd0;return _0x17c051;})['then'](respondWithFilteredResult(_0x926e41,_0x4ec129))['catch'](handleError(_0x926e41,null));};exports['show']=function(_0x17be3d,_0x3c1c1e){var _0x2d2dc6={'raw':![],'where':{'id':_0x17be3d[_0x902b('0x42')]['id']}},_0x3e3429={};_0x3e3429[_0x902b('0x2e')]=_[_0x902b('0x30')](db[_0x902b('0x2a')][_0x902b('0x2b')]);_0x3e3429[_0x902b('0x33')]=_[_0x902b('0x30')](_0x17be3d[_0x902b('0x33')]);_0x3e3429['filters']=_['intersection'](_0x3e3429['model'],_0x3e3429[_0x902b('0x33')]);_0x2d2dc6[_0x902b('0x34')]=_['intersection'](_0x3e3429['model'],qs['fields'](_0x17be3d[_0x902b('0x33')][_0x902b('0x35')]));_0x2d2dc6[_0x902b('0x34')]=_0x2d2dc6[_0x902b('0x34')]['length']?_0x2d2dc6[_0x902b('0x34')]:_0x3e3429[_0x902b('0x2e')];if(_0x17be3d[_0x902b('0x33')][_0x902b('0x3f')]){_0x2d2dc6[_0x902b('0x43')]=[{'all':!![]}];}_0x2d2dc6=_[_0x902b('0x3e')]({},_0x2d2dc6,_0x17be3d[_0x902b('0x44')]);return db[_0x902b('0x2a')][_0x902b('0x45')](_0x2d2dc6)[_0x902b('0x24')](handleEntityNotFound(_0x3c1c1e,null))[_0x902b('0x24')](respondWithResult(_0x3c1c1e,null))[_0x902b('0x46')](handleError(_0x3c1c1e,null));};exports[_0x902b('0x47')]=function(_0x4b13a7,_0x5613b1){return db[_0x902b('0x2a')][_0x902b('0x47')](_0x4b13a7[_0x902b('0x48')],{})['then'](respondWithResult(_0x5613b1,0xc9))[_0x902b('0x46')](handleError(_0x5613b1,null));};exports[_0x902b('0x23')]=function(_0x26af00,_0x84d277){if(_0x26af00[_0x902b('0x48')]['id']){delete _0x26af00['body']['id'];}return db[_0x902b('0x2a')][_0x902b('0x45')]({'where':{'id':_0x26af00['params']['id']}})[_0x902b('0x24')](handleEntityNotFound(_0x84d277,null))[_0x902b('0x24')](saveUpdates(_0x26af00[_0x902b('0x48')],null))[_0x902b('0x24')](respondWithResult(_0x84d277,null))[_0x902b('0x46')](handleError(_0x84d277,null));};exports[_0x902b('0x25')]=function(_0xa3020d,_0x4a9f06){return db[_0x902b('0x2a')][_0x902b('0x45')]({'where':{'id':_0xa3020d[_0x902b('0x42')]['id']}})[_0x902b('0x24')](handleEntityNotFound(_0x4a9f06,null))[_0x902b('0x24')](removeEntity(_0x4a9f06,null))['catch'](handleError(_0x4a9f06,null));};exports[_0x902b('0x49')]=function(_0x244424,_0x448ba1,_0x4bab32){var _0x464530={};var _0x19912a={};var _0x4e8580;var _0x2ce49a;return db[_0x902b('0x2a')][_0x902b('0x4a')]({'where':{'id':_0x244424['params']['id']}})['then'](handleEntityNotFound(_0x448ba1,null))[_0x902b('0x24')](function(_0x4cab55){if(_0x4cab55){_0x4e8580=_0x4cab55;_0x19912a[_0x902b('0x2e')]=_[_0x902b('0x30')](db[_0x902b('0x4b')][_0x902b('0x2b')]);_0x19912a[_0x902b('0x33')]=_[_0x902b('0x30')](_0x244424['query']);_0x19912a['filters']=_[_0x902b('0x32')](_0x19912a[_0x902b('0x2e')],_0x19912a[_0x902b('0x33')]);_0x464530[_0x902b('0x34')]=_[_0x902b('0x32')](_0x19912a[_0x902b('0x2e')],qs['fields'](_0x244424[_0x902b('0x33')][_0x902b('0x35')]));_0x464530[_0x902b('0x34')]=_0x464530[_0x902b('0x34')][_0x902b('0x36')]?_0x464530[_0x902b('0x34')]:_0x19912a[_0x902b('0x2e')];_0x464530['order']=qs[_0x902b('0x3a')](_0x244424[_0x902b('0x33')][_0x902b('0x3a')]);_0x464530['where']=qs[_0x902b('0x31')](_[_0x902b('0x3b')](_0x244424[_0x902b('0x33')],_0x19912a['filters']));if(_0x244424[_0x902b('0x33')][_0x902b('0x3c')]){_0x464530[_0x902b('0x3d')]=_['merge'](_0x464530[_0x902b('0x3d')],{'$or':_[_0x902b('0x29')](_0x464530[_0x902b('0x34')],function(_0x44b63b){var _0x175f06={};_0x175f06[_0x44b63b]={'$like':'%'+_0x244424[_0x902b('0x33')]['filter']+'%'};return _0x175f06;})});}_0x464530=_[_0x902b('0x3e')]({},_0x464530,_0x244424[_0x902b('0x44')]);return _0x4e8580['getConfigurations'](_0x464530);}})[_0x902b('0x24')](function(_0x33efd4){if(_0x33efd4){_0x2ce49a=_0x33efd4[_0x902b('0x36')];if(!_0x244424[_0x902b('0x33')][_0x902b('0x37')]('nolimit')){_0x464530[_0x902b('0x1d')]=qs[_0x902b('0x1d')](_0x244424[_0x902b('0x33')][_0x902b('0x1d')]);_0x464530[_0x902b('0x1b')]=qs[_0x902b('0x1b')](_0x244424[_0x902b('0x33')]['offset']);}return _0x4e8580[_0x902b('0x49')](_0x464530);}})['then'](function(_0x3c939e){if(_0x3c939e){return _0x3c939e?{'count':_0x2ce49a,'rows':_0x3c939e}:null;}})[_0x902b('0x24')](respondWithResult(_0x448ba1,null))[_0x902b('0x46')](handleError(_0x448ba1,null));};exports[_0x902b('0x4c')]=function(_0x9c8c9c,_0x49e4e4,_0x110402){if(_0x9c8c9c[_0x902b('0x48')]['id']){delete _0x9c8c9c[_0x902b('0x48')]['id'];}return db[_0x902b('0x2a')][_0x902b('0x4a')]({'where':{'id':_0x9c8c9c['params']['id']}})[_0x902b('0x24')](handleEntityNotFound(_0x49e4e4,null))[_0x902b('0x24')](function(_0x244c37){if(_0x244c37){_0x9c8c9c[_0x902b('0x48')][_0x902b('0x4d')]=_0x244c37['id'];_0x9c8c9c[_0x902b('0x48')][_0x902b('0x4e')]=integrations[_0x902b('0x4f')](_0x9c8c9c['body'][_0x902b('0x50')],_0x9c8c9c[_0x902b('0x48')][_0x902b('0x2d')]);_0x9c8c9c[_0x902b('0x48')][_0x902b('0x51')]=integrations['getDescriptions'](_0x9c8c9c[_0x902b('0x48')]['channel'],_0x9c8c9c[_0x902b('0x48')][_0x902b('0x2d')]);return db[_0x902b('0x4b')][_0x902b('0x47')](_0x9c8c9c['body'],{'include':[{'model':db['ServicenowField'],'as':'Subjects'},{'model':db[_0x902b('0x52')],'as':_0x902b('0x51')}]});}return null;})['then'](respondWithResult(_0x49e4e4,null))['catch'](handleError(_0x49e4e4,null));};exports[_0x902b('0x53')]=function(_0x3cf839,_0x52b364,_0xab373e){var _0x41d438=[_0x902b('0x54'),_0x902b('0x55'),_0x902b('0x56'),_0x902b('0x57'),'close_code',_0x902b('0x58'),_0x902b('0x59'),_0x902b('0x5a'),_0x902b('0x5b')];var _0xbf3097=[_0x902b('0x5c'),_0x902b('0x54'),'caused_by',_0x902b('0x5d'),_0x902b('0x5e'),_0x902b('0x5f'),_0x902b('0x60'),_0x902b('0x55'),'approval_history',_0x902b('0x61'),_0x902b('0x62'),'sys_updated_by',_0x902b('0x63'),_0x902b('0x64'),_0x902b('0x65'),_0x902b('0x66'),'state',_0x902b('0x67'),'knowledge',_0x902b('0x39'),_0x902b('0x68'),_0x902b('0x69'),_0x902b('0x6a'),_0x902b('0x6b'),_0x902b('0x6c'),'active',_0x902b('0x6d'),_0x902b('0x6e'),_0x902b('0x6f'),_0x902b('0x70'),_0x902b('0x71'),'time_worked',_0x902b('0x72'),_0x902b('0x73'),_0x902b('0x74'),_0x902b('0x75'),_0x902b('0x76'),_0x902b('0x77'),_0x902b('0x78'),_0x902b('0x79'),_0x902b('0x7a'),_0x902b('0x57'),_0x902b('0x7b'),_0x902b('0x7c'),_0x902b('0x7d'),_0x902b('0x7e'),_0x902b('0x7f'),_0x902b('0x80'),_0x902b('0x81'),_0x902b('0x82'),_0x902b('0x83'),_0x902b('0x84'),'calendar_duration','notify',_0x902b('0x85'),_0x902b('0x86'),_0x902b('0x87'),_0x902b('0x88'),_0x902b('0x89'),_0x902b('0x8a'),_0x902b('0x8b'),_0x902b('0x8c'),'incident_state',_0x902b('0x8d'),_0x902b('0x8e'),_0x902b('0x8f'),_0x902b('0x90'),_0x902b('0x91'),_0x902b('0x92'),'severity',_0x902b('0x93'),'sla_due',_0x902b('0x94'),_0x902b('0x95'),_0x902b('0x96'),_0x902b('0x97'),'reopen_count',_0x902b('0x98'),_0x902b('0x99'),_0x902b('0x9a'),_0x902b('0x9b'),_0x902b('0x9c'),_0x902b('0x5b')];var _0x5ee36d='';var _0x796766='';var _0x510b3e=[];var _0x1f67f1='';var _0x4ac308='';var _0x1390e5=[];var _0x4351a9='';var _0x4da4ac='';var _0x2aaa13={};var _0x1e2b3f='';return db[_0x902b('0x2a')][_0x902b('0x4a')]({'where':{'id':_0x3cf839[_0x902b('0x42')]['id']},'attributes':['id',_0x902b('0x9d'),_0x902b('0x9e'),'email',_0x902b('0x9f'),_0x902b('0xa0')]})[_0x902b('0x24')](handleEntityNotFound(_0x52b364,null))[_0x902b('0x24')](function(_0x2ab3b3){if(_0x2ab3b3){_0x1e2b3f=_0x2ab3b3['remoteUri'];var _0x41b93c=_0x1e2b3f[_0x902b('0xa1')](-0x1);if(_0x41b93c==='/'){_0x1e2b3f=_0x1e2b3f[_0x902b('0xa2')](0x0,_0x1e2b3f[_0x902b('0xa3')](_0x41b93c));}_0x4da4ac=util['format'](_0x902b('0xa4'),_0x1e2b3f);_0x4351a9=util[_0x902b('0xa5')](_0x902b('0xa6'),_0x1e2b3f);_0x2aaa13={'user':_0x2ab3b3[_0x902b('0x9d')],'pass':_0x2ab3b3['password']};var _0x51c407={'method':_0x902b('0xa7'),'uri':_0x4da4ac+_0x902b('0xa8'),'auth':_0x2aaa13,'json':!![]};return rp(_0x51c407);}})[_0x902b('0x24')](function(_0x2c9062){if(_0x2c9062[_0x902b('0xa9')]['length']>0x0){_0x5ee36d=_0x2c9062[_0x902b('0xa9')];}console['log'](_0x902b('0xaa'),_0x5ee36d);_0x1390e5=[];_0x796766=Object[_0x902b('0xab')]([],_0x5ee36d);_['remove'](_0x796766,function(_0x23a53f){return!_0x41d438[_0x902b('0xac')](_0x23a53f[_0x902b('0x2f')]);});_0x796766[_0x902b('0xad')](function(_0x47b90c){var _0x3bbc96=createFieldObject(_0x4351a9,_0x2aaa13,_0x47b90c[_0x902b('0xae')],_0x47b90c[_0x902b('0x2f')],_0x47b90c[_0x902b('0xaf')],![]);_0x1390e5[_0x902b('0xb0')](_0x3bbc96);});return Promise[_0x902b('0xb1')](_0x1390e5);})[_0x902b('0x24')](function(_0x34067e){_0x510b3e=_0x34067e;_0x1f67f1=Object[_0x902b('0xab')]([],_0x5ee36d);console[_0x902b('0xb2')]('TCL:\x20_object',_0x5ee36d);_['remove'](_0x1f67f1,function(_0x1e8cc3){return _0xbf3097[_0x902b('0xac')](_0x1e8cc3['name']);});console[_0x902b('0xb2')](_0x902b('0xb3'),_0x1f67f1);_0x1390e5=[];_0x1f67f1[_0x902b('0xad')](function(_0x5ce53c){var _0x4fa6aa=createFieldObject(_0x4351a9,_0x2aaa13,_0x5ce53c[_0x902b('0xae')],_0x5ce53c[_0x902b('0x2f')],_0x5ce53c[_0x902b('0xaf')],!![]);_0x1390e5['push'](_0x4fa6aa);});return Promise[_0x902b('0xb1')](_0x1390e5);})[_0x902b('0x24')](function(_0x428579){_0x4ac308=_0x428579;var _0x1b7894=_0x510b3e['concat'](_0x4ac308);return{'count':_0x1b7894[_0x902b('0x36')],'rows':_0x1b7894};})[_0x902b('0x24')](respondWithResult(_0x52b364,null))[_0x902b('0x46')](function(_0x2f9beb){console['log']('ServiceNow\x20error:\x20'+_0x2f9beb);var _0x534fd2=_0x3cf839[_0x902b('0x33')][_0x902b('0xb4')]?0x1f4:_0x2f9beb[_0x902b('0xb5')]||0x1f4;logger['error'](_0x2f9beb[_0x902b('0x27')]);delete _0x2f9beb[_0x902b('0x2f')];if(_0x534fd2===0x191){_0x534fd2=0x190;}_0x52b364[_0x902b('0x18')](_0x534fd2)[_0x902b('0xb6')](_0x3cf839['query']['test']?{'message':'Wrong\x20credentials','statusCode':_0x2f9beb[_0x902b('0xb5')]}:_0x2f9beb);});};function createFieldObject(_0x3b3bf9,_0x3589db,_0x4d46b1,_0x34a3b5,_0x18b8bb,_0x39a6e7){return new Promise(function(_0x575094,_0x5ad08d){var _0x4524c7={'id':_0x34a3b5,'name':_0x18b8bb,'custom':_0x39a6e7};if(_0x4d46b1==='boolean'){_0x4524c7[_0x902b('0x44')]=[{'name':_0x902b('0xb7'),'value':'true'},{'name':_0x902b('0xb8'),'value':'false'}];_0x575094(_0x4524c7);}else{var _0x27b148={'method':_0x902b('0xa7'),'uri':_0x3b3bf9+_0x902b('0xb9')+_0x34a3b5,'auth':_0x3589db,'json':!![]};return rp(_0x27b148)['then'](function(_0x5c98bd){var _0x367b90=[];if(_0x5c98bd[_0x902b('0xa9')][_0x902b('0x36')]>0x0){_0x5c98bd[_0x902b('0xa9')][_0x902b('0xad')](function(_0x2d7035){if(_0x2d7035[_0x902b('0xba')]===_0x902b('0xbb')){var _0x42f74c={'name':_0x2d7035[_0x902b('0xaf')],'value':_0x2d7035['value']};_0x367b90[_0x902b('0xb0')](_0x42f74c);}});}_0x4524c7[_0x902b('0x44')]=_0x367b90;if(_0x4524c7[_0x902b('0x44')][_0x902b('0x36')]>0x0){_0x575094(_0x4524c7);}else{if(_0x39a6e7==![]){_0x575094();}else{_0x575094(_0x4524c7);}}});}});} \ No newline at end of file +var _0x6a56=['length','nolimit','sort','where','filter','merge','VIRTUAL','count','include','rows','params','rawAttributes','includeAll','options','find','create','body','catch','destroy','getConfigurations','findOne','ServicenowConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ServicenowField','getFields','hold_reason','knowledge','subcategory','severity','parent','made_sla','caused_by','watch_list','upon_reject','sys_updated_on','child_incidents','approval_history','number','resolved_by','sys_updated_by','opened_by','user_input','sys_created_by','delivery_plan','impact','active','business_service','priority','sys_domain_path','time_worked','expected_start','opened_at','business_duration','group_list','work_end','reopened_time','resolved_at','caller_id','approval_set','work_notes','delivery_task','work_start','assignment_group','calendar_duration','sys_class_name','close_notes','closed_by','follow_up','parent_incident','sys_id','contact_type','reopened_by','incident_state','urgency','problem_id','reassignment_count','activity_due','assigned_to','comments','sla_due','approval','comments_and_work_notes','sys_mod_count','reopen_count','sys_tags','escalation','correlation_id','location','password','email','remoteUri','serverUrl','slice','substring','format','%s/api/now/doc/table/schema/','%s/api/now/table/','GET','result','incident\x20table\x20objects','assign','remove','includes','label','push','all','log','forEach','concat','ServiceNow\x20error:\x20','statusCode','error','test','Wrong\x20credentials','boolean','True','true','False','sys_choice?sysparm_query=name=incident^element=','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','end','json','offset','undefined','limit','status','set','reject','save','update','then','stack','name','send','map','ServicenowAccount','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields'];(function(_0x267935,_0x5d4a3c){var _0x383980=function(_0x2d82cc){while(--_0x2d82cc){_0x267935['push'](_0x267935['shift']());}};_0x383980(++_0x5d4a3c);}(_0x6a56,0x131));var _0x66a5=function(_0x1bc0ae,_0x439dfe){_0x1bc0ae=_0x1bc0ae-0x0;var _0x501104=_0x6a56[_0x1bc0ae];return _0x501104;};'use strict';var emlformat=require(_0x66a5('0x0'));var rimraf=require(_0x66a5('0x1'));var zipdir=require(_0x66a5('0x2'));var jsonpatch=require(_0x66a5('0x3'));var rp=require(_0x66a5('0x4'));var moment=require('moment');var BPromise=require(_0x66a5('0x5'));var Mustache=require(_0x66a5('0x6'));var util=require(_0x66a5('0x7'));var path=require(_0x66a5('0x8'));var sox=require(_0x66a5('0x9'));var csv=require(_0x66a5('0xa'));var ejs=require(_0x66a5('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x66a5('0xc'));var squel=require(_0x66a5('0xd'));var crypto=require(_0x66a5('0xe'));var jsforce=require(_0x66a5('0xf'));var deskjs=require(_0x66a5('0x10'));var toCsv=require(_0x66a5('0xa'));var querystring=require(_0x66a5('0x11'));var Papa=require(_0x66a5('0x12'));var Redis=require(_0x66a5('0x13'));var authService=require(_0x66a5('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x66a5('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x66a5('0x16'))(_0x66a5('0x17'));var utils=require(_0x66a5('0x18'));var config=require(_0x66a5('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x66a5('0x1a'))['db'];var integrations=require(_0x66a5('0x1b'));function respondWithStatusCode(_0xf892f5,_0x176db9){_0x176db9=_0x176db9||0xcc;return function(_0x3b1f3b){if(_0x3b1f3b){return _0xf892f5[_0x66a5('0x1c')](_0x176db9);}return _0xf892f5['status'](_0x176db9)[_0x66a5('0x1d')]();};}function respondWithResult(_0x975113,_0x18d5c7){_0x18d5c7=_0x18d5c7||0xc8;return function(_0x40d2a8){if(_0x40d2a8){return _0x975113['status'](_0x18d5c7)[_0x66a5('0x1e')](_0x40d2a8);}};}function respondWithFilteredResult(_0x181c70,_0x496017){return function(_0x11c846){if(_0x11c846){var _0x2001f0=typeof _0x496017[_0x66a5('0x1f')]===_0x66a5('0x20')&&typeof _0x496017['limit']===_0x66a5('0x20');var _0x199636=_0x11c846['count'];var _0x3c2210=_0x2001f0?0x0:_0x496017[_0x66a5('0x1f')];var _0x5a948f=_0x2001f0?_0x11c846['count']:_0x496017[_0x66a5('0x1f')]+_0x496017[_0x66a5('0x21')];var _0x115234;if(_0x5a948f>=_0x199636){_0x5a948f=_0x199636;_0x115234=0xc8;}else{_0x115234=0xce;}_0x181c70[_0x66a5('0x22')](_0x115234);return _0x181c70[_0x66a5('0x23')]('Content-Range',_0x3c2210+'-'+_0x5a948f+'/'+_0x199636)['json'](_0x11c846);}return null;};}function patchUpdates(_0x4002b7){return function(_0x42b700){try{jsonpatch['apply'](_0x42b700,_0x4002b7,!![]);}catch(_0x2dc11f){return BPromise[_0x66a5('0x24')](_0x2dc11f);}return _0x42b700[_0x66a5('0x25')]();};}function saveUpdates(_0xe74f2e,_0x480921){return function(_0x38bce4){if(_0x38bce4){return _0x38bce4[_0x66a5('0x26')](_0xe74f2e)[_0x66a5('0x27')](function(_0x4b99ad){return _0x4b99ad;});}return null;};}function removeEntity(_0x3a4e37,_0x5a5b5f){return function(_0x40256f){if(_0x40256f){return _0x40256f['destroy']()[_0x66a5('0x27')](function(){_0x3a4e37['status'](0xcc)[_0x66a5('0x1d')]();});}};}function handleEntityNotFound(_0x106b91,_0x874ec9){return function(_0x183cd2){if(!_0x183cd2){_0x106b91['sendStatus'](0x194);}return _0x183cd2;};}function handleError(_0x2c61b5,_0x36c262){_0x36c262=_0x36c262||0x1f4;return function(_0x3d6ac5){logger['error'](_0x3d6ac5[_0x66a5('0x28')]);if(_0x3d6ac5['name']){delete _0x3d6ac5[_0x66a5('0x29')];}_0x2c61b5[_0x66a5('0x22')](_0x36c262)[_0x66a5('0x2a')](_0x3d6ac5);};}exports['index']=function(_0x2ae1c8,_0x5c862b){var _0x8cc280={},_0x2eaa61={},_0x2e9cc0={'count':0x0,'rows':[]};var _0x1ee952=_[_0x66a5('0x2b')](db[_0x66a5('0x2c')]['rawAttributes'],function(_0x33864e){return{'name':_0x33864e[_0x66a5('0x2d')],'type':_0x33864e[_0x66a5('0x2e')][_0x66a5('0x2f')]};});_0x2eaa61[_0x66a5('0x30')]=_[_0x66a5('0x2b')](_0x1ee952,_0x66a5('0x29'));_0x2eaa61[_0x66a5('0x31')]=_[_0x66a5('0x32')](_0x2ae1c8[_0x66a5('0x31')]);_0x2eaa61[_0x66a5('0x33')]=_[_0x66a5('0x34')](_0x2eaa61[_0x66a5('0x30')],_0x2eaa61['query']);_0x8cc280[_0x66a5('0x35')]=_[_0x66a5('0x34')](_0x2eaa61[_0x66a5('0x30')],qs[_0x66a5('0x36')](_0x2ae1c8[_0x66a5('0x31')][_0x66a5('0x36')]));_0x8cc280[_0x66a5('0x35')]=_0x8cc280[_0x66a5('0x35')][_0x66a5('0x37')]?_0x8cc280[_0x66a5('0x35')]:_0x2eaa61[_0x66a5('0x30')];if(!_0x2ae1c8[_0x66a5('0x31')]['hasOwnProperty'](_0x66a5('0x38'))){_0x8cc280[_0x66a5('0x21')]=qs[_0x66a5('0x21')](_0x2ae1c8[_0x66a5('0x31')]['limit']);_0x8cc280['offset']=qs[_0x66a5('0x1f')](_0x2ae1c8[_0x66a5('0x31')][_0x66a5('0x1f')]);}_0x8cc280['order']=qs[_0x66a5('0x39')](_0x2ae1c8['query'][_0x66a5('0x39')]);_0x8cc280[_0x66a5('0x3a')]=qs[_0x66a5('0x33')](_['pick'](_0x2ae1c8[_0x66a5('0x31')],_0x2eaa61[_0x66a5('0x33')]),_0x1ee952);if(_0x2ae1c8[_0x66a5('0x31')][_0x66a5('0x3b')]){_0x8cc280[_0x66a5('0x3a')]=_[_0x66a5('0x3c')](_0x8cc280[_0x66a5('0x3a')],{'$or':_[_0x66a5('0x2b')](_0x1ee952,function(_0x3961ab){if(_0x3961ab[_0x66a5('0x2e')]!==_0x66a5('0x3d')){var _0x487e52={};_0x487e52[_0x3961ab[_0x66a5('0x29')]]={'$like':'%'+_0x2ae1c8[_0x66a5('0x31')][_0x66a5('0x3b')]+'%'};return _0x487e52;}})});}_0x8cc280=_[_0x66a5('0x3c')]({},_0x8cc280,_0x2ae1c8['options']);var _0x577c3a={'where':_0x8cc280[_0x66a5('0x3a')]};return db[_0x66a5('0x2c')][_0x66a5('0x3e')](_0x577c3a)['then'](function(_0x16d0cb){_0x2e9cc0['count']=_0x16d0cb;if(_0x2ae1c8[_0x66a5('0x31')]['includeAll']){_0x8cc280[_0x66a5('0x3f')]=[{'all':!![]}];}return db[_0x66a5('0x2c')]['findAll'](_0x8cc280);})[_0x66a5('0x27')](function(_0x15a260){_0x2e9cc0[_0x66a5('0x40')]=_0x15a260;return _0x2e9cc0;})[_0x66a5('0x27')](respondWithFilteredResult(_0x5c862b,_0x8cc280))['catch'](handleError(_0x5c862b,null));};exports['show']=function(_0x558432,_0x4ac36a){var _0xd25b89={'raw':![],'where':{'id':_0x558432[_0x66a5('0x41')]['id']}},_0x1f2246={};_0x1f2246[_0x66a5('0x30')]=_[_0x66a5('0x32')](db[_0x66a5('0x2c')][_0x66a5('0x42')]);_0x1f2246[_0x66a5('0x31')]=_[_0x66a5('0x32')](_0x558432[_0x66a5('0x31')]);_0x1f2246[_0x66a5('0x33')]=_[_0x66a5('0x34')](_0x1f2246['model'],_0x1f2246[_0x66a5('0x31')]);_0xd25b89['attributes']=_[_0x66a5('0x34')](_0x1f2246[_0x66a5('0x30')],qs[_0x66a5('0x36')](_0x558432['query'][_0x66a5('0x36')]));_0xd25b89['attributes']=_0xd25b89[_0x66a5('0x35')][_0x66a5('0x37')]?_0xd25b89[_0x66a5('0x35')]:_0x1f2246[_0x66a5('0x30')];if(_0x558432[_0x66a5('0x31')][_0x66a5('0x43')]){_0xd25b89[_0x66a5('0x3f')]=[{'all':!![]}];}_0xd25b89=_[_0x66a5('0x3c')]({},_0xd25b89,_0x558432[_0x66a5('0x44')]);return db[_0x66a5('0x2c')][_0x66a5('0x45')](_0xd25b89)[_0x66a5('0x27')](handleEntityNotFound(_0x4ac36a,null))['then'](respondWithResult(_0x4ac36a,null))['catch'](handleError(_0x4ac36a,null));};exports[_0x66a5('0x46')]=function(_0x49769b,_0x25f256){return db[_0x66a5('0x2c')][_0x66a5('0x46')](_0x49769b[_0x66a5('0x47')],{})[_0x66a5('0x27')](respondWithResult(_0x25f256,0xc9))[_0x66a5('0x48')](handleError(_0x25f256,null));};exports[_0x66a5('0x26')]=function(_0x3df6bb,_0x1edc5b){if(_0x3df6bb[_0x66a5('0x47')]['id']){delete _0x3df6bb['body']['id'];}return db[_0x66a5('0x2c')][_0x66a5('0x45')]({'where':{'id':_0x3df6bb[_0x66a5('0x41')]['id']}})[_0x66a5('0x27')](handleEntityNotFound(_0x1edc5b,null))[_0x66a5('0x27')](saveUpdates(_0x3df6bb[_0x66a5('0x47')],null))[_0x66a5('0x27')](respondWithResult(_0x1edc5b,null))['catch'](handleError(_0x1edc5b,null));};exports[_0x66a5('0x49')]=function(_0x536319,_0x171d53){return db['ServicenowAccount'][_0x66a5('0x45')]({'where':{'id':_0x536319[_0x66a5('0x41')]['id']}})[_0x66a5('0x27')](handleEntityNotFound(_0x171d53,null))[_0x66a5('0x27')](removeEntity(_0x171d53,null))[_0x66a5('0x48')](handleError(_0x171d53,null));};exports[_0x66a5('0x4a')]=function(_0x4c2f5e,_0x3798ca,_0x31f5bc){var _0x303616={};var _0x33e920={};var _0x4ef115;var _0x5860bc;return db[_0x66a5('0x2c')][_0x66a5('0x4b')]({'where':{'id':_0x4c2f5e[_0x66a5('0x41')]['id']}})['then'](handleEntityNotFound(_0x3798ca,null))[_0x66a5('0x27')](function(_0x319816){if(_0x319816){_0x4ef115=_0x319816;_0x33e920['model']=_[_0x66a5('0x32')](db[_0x66a5('0x4c')]['rawAttributes']);_0x33e920[_0x66a5('0x31')]=_[_0x66a5('0x32')](_0x4c2f5e[_0x66a5('0x31')]);_0x33e920[_0x66a5('0x33')]=_[_0x66a5('0x34')](_0x33e920[_0x66a5('0x30')],_0x33e920[_0x66a5('0x31')]);_0x303616[_0x66a5('0x35')]=_[_0x66a5('0x34')](_0x33e920[_0x66a5('0x30')],qs[_0x66a5('0x36')](_0x4c2f5e[_0x66a5('0x31')][_0x66a5('0x36')]));_0x303616[_0x66a5('0x35')]=_0x303616[_0x66a5('0x35')][_0x66a5('0x37')]?_0x303616[_0x66a5('0x35')]:_0x33e920[_0x66a5('0x30')];_0x303616['order']=qs[_0x66a5('0x39')](_0x4c2f5e[_0x66a5('0x31')][_0x66a5('0x39')]);_0x303616[_0x66a5('0x3a')]=qs[_0x66a5('0x33')](_['pick'](_0x4c2f5e[_0x66a5('0x31')],_0x33e920['filters']));if(_0x4c2f5e['query'][_0x66a5('0x3b')]){_0x303616['where']=_[_0x66a5('0x3c')](_0x303616['where'],{'$or':_[_0x66a5('0x2b')](_0x303616[_0x66a5('0x35')],function(_0x1e0646){var _0x59614e={};_0x59614e[_0x1e0646]={'$like':'%'+_0x4c2f5e[_0x66a5('0x31')]['filter']+'%'};return _0x59614e;})});}_0x303616=_[_0x66a5('0x3c')]({},_0x303616,_0x4c2f5e[_0x66a5('0x44')]);return _0x4ef115['getConfigurations'](_0x303616);}})[_0x66a5('0x27')](function(_0x4cb4fd){if(_0x4cb4fd){_0x5860bc=_0x4cb4fd[_0x66a5('0x37')];if(!_0x4c2f5e[_0x66a5('0x31')]['hasOwnProperty'](_0x66a5('0x38'))){_0x303616[_0x66a5('0x21')]=qs[_0x66a5('0x21')](_0x4c2f5e['query'][_0x66a5('0x21')]);_0x303616[_0x66a5('0x1f')]=qs[_0x66a5('0x1f')](_0x4c2f5e[_0x66a5('0x31')][_0x66a5('0x1f')]);}return _0x4ef115[_0x66a5('0x4a')](_0x303616);}})[_0x66a5('0x27')](function(_0x50680b){if(_0x50680b){return _0x50680b?{'count':_0x5860bc,'rows':_0x50680b}:null;}})[_0x66a5('0x27')](respondWithResult(_0x3798ca,null))['catch'](handleError(_0x3798ca,null));};exports[_0x66a5('0x4d')]=function(_0x535271,_0x2d82dd,_0x2b43f2){if(_0x535271['body']['id']){delete _0x535271[_0x66a5('0x47')]['id'];}return db[_0x66a5('0x2c')]['findOne']({'where':{'id':_0x535271['params']['id']}})[_0x66a5('0x27')](handleEntityNotFound(_0x2d82dd,null))[_0x66a5('0x27')](function(_0x2d8862){if(_0x2d8862){_0x535271[_0x66a5('0x47')][_0x66a5('0x4e')]=_0x2d8862['id'];_0x535271[_0x66a5('0x47')][_0x66a5('0x4f')]=integrations[_0x66a5('0x50')](_0x535271[_0x66a5('0x47')][_0x66a5('0x51')],_0x535271[_0x66a5('0x47')][_0x66a5('0x2e')]);_0x535271[_0x66a5('0x47')][_0x66a5('0x52')]=integrations[_0x66a5('0x53')](_0x535271[_0x66a5('0x47')][_0x66a5('0x51')],_0x535271['body']['type']);return db[_0x66a5('0x4c')][_0x66a5('0x46')](_0x535271['body'],{'include':[{'model':db[_0x66a5('0x54')],'as':'Subjects'},{'model':db['ServicenowField'],'as':_0x66a5('0x52')}]});}return null;})['then'](respondWithResult(_0x2d82dd,null))[_0x66a5('0x48')](handleError(_0x2d82dd,null));};exports[_0x66a5('0x55')]=function(_0x1e6dad,_0x543eff,_0x7544e2){var _0x1beb27=['made_sla',_0x66a5('0x56'),_0x66a5('0x57'),_0x66a5('0x58'),'close_code','notify','incident_state',_0x66a5('0x59'),'category'];var _0x10a827=[_0x66a5('0x5a'),_0x66a5('0x5b'),_0x66a5('0x5c'),_0x66a5('0x5d'),_0x66a5('0x5e'),_0x66a5('0x5f'),_0x66a5('0x60'),_0x66a5('0x56'),_0x66a5('0x61'),_0x66a5('0x62'),_0x66a5('0x63'),_0x66a5('0x64'),_0x66a5('0x65'),_0x66a5('0x66'),'sys_created_on','sys_domain','state',_0x66a5('0x67'),_0x66a5('0x57'),'order','calendar_stc','closed_at','cmdb_ci',_0x66a5('0x68'),_0x66a5('0x69'),_0x66a5('0x6a'),'work_notes_list',_0x66a5('0x6b'),_0x66a5('0x6c'),_0x66a5('0x6d'),'rfc',_0x66a5('0x6e'),_0x66a5('0x6f'),_0x66a5('0x70'),_0x66a5('0x71'),_0x66a5('0x72'),_0x66a5('0x73'),_0x66a5('0x74'),_0x66a5('0x75'),_0x66a5('0x76'),_0x66a5('0x77'),_0x66a5('0x58'),_0x66a5('0x78'),'short_description','close_code','correlation_display',_0x66a5('0x79'),_0x66a5('0x7a'),_0x66a5('0x7b'),'business_stc','additional_assignee_list','description',_0x66a5('0x7c'),'notify',_0x66a5('0x7d'),_0x66a5('0x7e'),_0x66a5('0x7f'),_0x66a5('0x80'),_0x66a5('0x81'),_0x66a5('0x82'),_0x66a5('0x83'),_0x66a5('0x84'),_0x66a5('0x85'),_0x66a5('0x86'),_0x66a5('0x87'),'company',_0x66a5('0x88'),_0x66a5('0x89'),_0x66a5('0x8a'),_0x66a5('0x59'),_0x66a5('0x8b'),_0x66a5('0x8c'),_0x66a5('0x8d'),_0x66a5('0x8e'),'due_date',_0x66a5('0x8f'),_0x66a5('0x90'),_0x66a5('0x91'),_0x66a5('0x92'),'upon_approval',_0x66a5('0x93'),_0x66a5('0x94'),'category'];var _0x398dc5='';var _0x21e809='';var _0x5c4bec=[];var _0x1b2723='';var _0x1b40a9='';var _0x8c1677=[];var _0x4a132a='';var _0x2f04ae='';var _0x227a65={};var _0x3e2c36='';return db[_0x66a5('0x2c')]['findOne']({'where':{'id':_0x1e6dad[_0x66a5('0x41')]['id']},'attributes':['id','username',_0x66a5('0x95'),_0x66a5('0x96'),_0x66a5('0x97'),_0x66a5('0x98')]})[_0x66a5('0x27')](handleEntityNotFound(_0x543eff,null))[_0x66a5('0x27')](function(_0x452488){if(_0x452488){_0x3e2c36=_0x452488[_0x66a5('0x97')];var _0x2060fa=_0x3e2c36[_0x66a5('0x99')](-0x1);if(_0x2060fa==='/'){_0x3e2c36=_0x3e2c36[_0x66a5('0x9a')](0x0,_0x3e2c36['lastIndexOf'](_0x2060fa));}_0x2f04ae=util[_0x66a5('0x9b')](_0x66a5('0x9c'),_0x3e2c36);_0x4a132a=util['format'](_0x66a5('0x9d'),_0x3e2c36);_0x227a65={'user':_0x452488['username'],'pass':_0x452488[_0x66a5('0x95')]};var _0x88bbc3={'method':_0x66a5('0x9e'),'uri':_0x2f04ae+'incident?sysparm_display_value=all','auth':_0x227a65,'json':!![]};return rp(_0x88bbc3);}})[_0x66a5('0x27')](function(_0x52fb67){if(_0x52fb67[_0x66a5('0x9f')][_0x66a5('0x37')]>0x0){_0x398dc5=_0x52fb67[_0x66a5('0x9f')];}console['log'](_0x66a5('0xa0'),_0x398dc5);_0x8c1677=[];_0x21e809=Object[_0x66a5('0xa1')]([],_0x398dc5);_[_0x66a5('0xa2')](_0x21e809,function(_0x45786b){return!_0x1beb27[_0x66a5('0xa3')](_0x45786b[_0x66a5('0x29')]);});_0x21e809['forEach'](function(_0x5aaa3c){var _0x2144b6=createFieldObject(_0x4a132a,_0x227a65,_0x5aaa3c['internalType'],_0x5aaa3c[_0x66a5('0x29')],_0x5aaa3c[_0x66a5('0xa4')],![]);_0x8c1677[_0x66a5('0xa5')](_0x2144b6);});return Promise[_0x66a5('0xa6')](_0x8c1677);})['then'](function(_0x518eb7){_0x5c4bec=_0x518eb7;_0x1b2723=Object[_0x66a5('0xa1')]([],_0x398dc5);console[_0x66a5('0xa7')]('TCL:\x20_object',_0x398dc5);_['remove'](_0x1b2723,function(_0x44a3fd){return _0x10a827[_0x66a5('0xa3')](_0x44a3fd[_0x66a5('0x29')]);});console['log']('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x1b2723);_0x8c1677=[];_0x1b2723[_0x66a5('0xa8')](function(_0x5aed0e){var _0x27f969=createFieldObject(_0x4a132a,_0x227a65,_0x5aed0e['internalType'],_0x5aed0e[_0x66a5('0x29')],_0x5aed0e[_0x66a5('0xa4')],!![]);_0x8c1677['push'](_0x27f969);});return Promise['all'](_0x8c1677);})[_0x66a5('0x27')](function(_0x2e4947){_0x1b40a9=_0x2e4947;var _0x5880cc=_0x5c4bec[_0x66a5('0xa9')](_0x1b40a9);return{'count':_0x5880cc[_0x66a5('0x37')],'rows':_0x5880cc};})[_0x66a5('0x27')](respondWithResult(_0x543eff,null))['catch'](function(_0x27a4e5){console[_0x66a5('0xa7')](_0x66a5('0xaa')+_0x27a4e5);var _0x26d7d5=_0x1e6dad[_0x66a5('0x31')]['test']?0x1f4:_0x27a4e5[_0x66a5('0xab')]||0x1f4;logger[_0x66a5('0xac')](_0x27a4e5[_0x66a5('0x28')]);delete _0x27a4e5[_0x66a5('0x29')];if(_0x26d7d5===0x191){_0x26d7d5=0x190;}_0x543eff['status'](_0x26d7d5)[_0x66a5('0x2a')](_0x1e6dad[_0x66a5('0x31')][_0x66a5('0xad')]?{'message':_0x66a5('0xae'),'statusCode':_0x27a4e5['statusCode']}:_0x27a4e5);});};function createFieldObject(_0x452761,_0xf4ec97,_0x587f7c,_0x5f1993,_0x1fa775,_0x294759){return new Promise(function(_0x59f153,_0x41c683){var _0x50ae95={'id':_0x5f1993,'name':_0x1fa775,'custom':_0x294759};if(_0x587f7c===_0x66a5('0xaf')){_0x50ae95[_0x66a5('0x44')]=[{'name':_0x66a5('0xb0'),'value':_0x66a5('0xb1')},{'name':_0x66a5('0xb2'),'value':'false'}];_0x59f153(_0x50ae95);}else{var _0x9b3ed9={'method':'GET','uri':_0x452761+_0x66a5('0xb3')+_0x5f1993,'auth':_0xf4ec97,'json':!![]};return rp(_0x9b3ed9)[_0x66a5('0x27')](function(_0x43dd65){var _0x3c4fd1=[];if(_0x43dd65['result']['length']>0x0){_0x43dd65[_0x66a5('0x9f')][_0x66a5('0xa8')](function(_0x368747){if(_0x368747['inactive']==='false'){var _0x4263f8={'name':_0x368747['label'],'value':_0x368747['value']};_0x3c4fd1[_0x66a5('0xa5')](_0x4263f8);}});}_0x50ae95['options']=_0x3c4fd1;if(_0x50ae95[_0x66a5('0x44')]['length']>0x0){_0x59f153(_0x50ae95);}else{if(_0x294759==![]){_0x59f153();}else{_0x59f153(_0x50ae95);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 01fcc68..46193ec 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 _0x90b1=['define','ServicenowAccount','int_servicenow_accounts','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x90b1,0x1bb));var _0x190b=function(_0x511e03,_0x122f3b){_0x511e03=_0x511e03-0x0;var _0x55aacb=_0x90b1[_0x511e03];return _0x55aacb;};'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('./intServicenowAccount.attributes');var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x27ff8c,_0x34a689){return _0x27ff8c[_0x190b('0x7')](_0x190b('0x8'),attributes,{'tableName':_0x190b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5075=['bluebird','request-promise','rimraf','../../config/environment','./intServicenowAccount.attributes','ServicenowAccount','int_servicenow_accounts','lodash','util','../../config/logger','api','moment'];(function(_0x545fcd,_0x3247cc){var _0x32e380=function(_0xa98551){while(--_0xa98551){_0x545fcd['push'](_0x545fcd['shift']());}};_0x32e380(++_0x3247cc);}(_0x5075,0x73));var _0x5507=function(_0x2bd0be,_0xf63d47){_0x2bd0be=_0x2bd0be-0x0;var _0x3e8e85=_0x5075[_0x2bd0be];return _0x3e8e85;};'use strict';var _=require(_0x5507('0x0'));var util=require(_0x5507('0x1'));var logger=require(_0x5507('0x2'))(_0x5507('0x3'));var moment=require(_0x5507('0x4'));var BPromise=require(_0x5507('0x5'));var rp=require(_0x5507('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5507('0x7'));var config=require(_0x5507('0x8'));var attributes=require(_0x5507('0x9'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x2cd9ee,_0x773559){return _0x2cd9ee['define'](_0x5507('0xa'),attributes,{'tableName':_0x5507('0xb'),'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 cf21f46..ea3c827 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 _0x3667=['stringify','error','code','message','result','catch','GetServicenowAccount','options','raw','where','attributes','include','map','model','ServicenowAccount','find','ShowServicenowAccount','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s'];(function(_0x232583,_0x44bdb5){var _0x49ddc1=function(_0x134f3f){while(--_0x134f3f){_0x232583['push'](_0x232583['shift']());}};_0x49ddc1(++_0x44bdb5);}(_0x3667,0x13a));var _0x7366=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3667[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7366('0x0'));var util=require('util');var moment=require(_0x7366('0x1'));var BPromise=require('bluebird');var rs=require(_0x7366('0x2'));var fs=require('fs');var Redis=require(_0x7366('0x3'));var db=require(_0x7366('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x7366('0x5'))('rpc');var config=require(_0x7366('0x6'));var jayson=require(_0x7366('0x7'));var client=jayson[_0x7366('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4b729a,_0xec8f0b,_0x45faf4){return new BPromise(function(_0x3e89fe,_0x401402){return client[_0x7366('0x9')](_0x4b729a,_0x45faf4)[_0x7366('0xa')](function(_0x4bbecd){logger[_0x7366('0xb')](_0x7366('0xc'),_0xec8f0b,_0x7366('0xd'));logger[_0x7366('0xe')](_0x7366('0xf'),_0xec8f0b,_0x7366('0xd'),JSON[_0x7366('0x10')](_0x4bbecd));if(_0x4bbecd[_0x7366('0x11')]){if(_0x4bbecd[_0x7366('0x11')][_0x7366('0x12')]===0x1f4){logger[_0x7366('0x11')]('ServicenowAccount,\x20%s,\x20%s',_0xec8f0b,_0x4bbecd[_0x7366('0x11')][_0x7366('0x13')]);return _0x401402(_0x4bbecd[_0x7366('0x11')][_0x7366('0x13')]);}logger[_0x7366('0x11')](_0x7366('0xc'),_0xec8f0b,_0x4bbecd[_0x7366('0x11')]['message']);return _0x3e89fe(_0x4bbecd[_0x7366('0x11')]['message']);}else{logger['info']('ServicenowAccount,\x20%s,\x20%s',_0xec8f0b,_0x7366('0xd'));_0x3e89fe(_0x4bbecd[_0x7366('0x14')][_0x7366('0x13')]);}})[_0x7366('0x15')](function(_0x57386c){logger[_0x7366('0x11')](_0x7366('0xc'),_0xec8f0b,_0x57386c);_0x401402(_0x57386c);});});}exports[_0x7366('0x16')]=function(_0x4cf043){var _0x5cc158=this;return new Promise(function(_0x2cbf1e,_0x30b858){return db['ServicenowAccount']['findAll']({'raw':_0x4cf043[_0x7366('0x17')]?_0x4cf043[_0x7366('0x17')][_0x7366('0x18')]===undefined?!![]:![]:!![],'where':_0x4cf043[_0x7366('0x17')]?_0x4cf043[_0x7366('0x17')][_0x7366('0x19')]||null:null,'attributes':_0x4cf043[_0x7366('0x17')]?_0x4cf043['options'][_0x7366('0x1a')]||null:null,'limit':_0x4cf043[_0x7366('0x17')]?_0x4cf043[_0x7366('0x17')]['limit']||null:null,'include':_0x4cf043[_0x7366('0x17')]?_0x4cf043[_0x7366('0x17')][_0x7366('0x1b')]?_[_0x7366('0x1c')](_0x4cf043['options']['include'],function(_0x42018b){return{'model':db[_0x42018b['model']],'as':_0x42018b['as'],'attributes':_0x42018b['attributes'],'include':_0x42018b[_0x7366('0x1b')]?_['map'](_0x42018b['include'],function(_0x296533){return{'model':db[_0x296533[_0x7366('0x1d')]],'as':_0x296533['as'],'attributes':_0x296533[_0x7366('0x1a')],'include':_0x296533[_0x7366('0x1b')]?_['map'](_0x296533['include'],function(_0x351135){return{'model':db[_0x351135[_0x7366('0x1d')]],'as':_0x351135['as'],'attributes':_0x351135['attributes']};}):[]};}):[]};}):[]:[]})[_0x7366('0xa')](function(_0x3b7ef6){logger[_0x7366('0xb')](_0x7366('0x16'),_0x4cf043);logger[_0x7366('0xe')](_0x7366('0x16'),_0x4cf043,JSON[_0x7366('0x10')](_0x3b7ef6));_0x2cbf1e(_0x3b7ef6);})[_0x7366('0x15')](function(_0x5d08da){logger[_0x7366('0x11')]('GetServicenowAccount',_0x5d08da[_0x7366('0x13')],_0x4cf043);_0x30b858(_0x5cc158[_0x7366('0x11')](0x1f4,_0x5d08da[_0x7366('0x13')]));});});};exports['ShowServicenowAccount']=function(_0x5d085e){var _0x48de13=this;return new Promise(function(_0x4abdba,_0x43a5a8){return db[_0x7366('0x1e')][_0x7366('0x1f')]({'raw':_0x5d085e['options']?_0x5d085e[_0x7366('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x5d085e['options']?_0x5d085e['options'][_0x7366('0x19')]||null:null,'attributes':_0x5d085e[_0x7366('0x17')]?_0x5d085e['options'][_0x7366('0x1a')]||null:null,'include':_0x5d085e[_0x7366('0x17')]?_0x5d085e[_0x7366('0x17')]['include']?_[_0x7366('0x1c')](_0x5d085e[_0x7366('0x17')][_0x7366('0x1b')],function(_0x38ea2f){return{'model':db[_0x38ea2f[_0x7366('0x1d')]],'as':_0x38ea2f['as'],'attributes':_0x38ea2f['attributes'],'include':_0x38ea2f['include']?_[_0x7366('0x1c')](_0x38ea2f[_0x7366('0x1b')],function(_0x66edf2){return{'model':db[_0x66edf2[_0x7366('0x1d')]],'as':_0x66edf2['as'],'attributes':_0x66edf2['attributes'],'include':_0x66edf2['include']?_[_0x7366('0x1c')](_0x66edf2['include'],function(_0x24c626){return{'model':db[_0x24c626[_0x7366('0x1d')]],'as':_0x24c626['as'],'attributes':_0x24c626[_0x7366('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x7366('0xa')](function(_0x59db51){logger[_0x7366('0xb')](_0x7366('0x20'),_0x5d085e);logger[_0x7366('0xe')](_0x7366('0x20'),_0x5d085e,JSON[_0x7366('0x10')](_0x59db51));_0x4abdba(_0x59db51);})[_0x7366('0x15')](function(_0x17316e){logger[_0x7366('0x11')]('ShowServicenowAccount',_0x17316e['message'],_0x5d085e);_0x43a5a8(_0x48de13[_0x7366('0x11')](0x1f4,_0x17316e[_0x7366('0x13')]));});});}; \ No newline at end of file +var _0x6783=['info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetServicenowAccount','ServicenowAccount','findAll','options','raw','where','attributes','limit','include','map','model','then','debug','find','ShowServicenowAccount','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request'];(function(_0xb73ad2,_0x46729a){var _0x4f2db7=function(_0x3f2f03){while(--_0x3f2f03){_0xb73ad2['push'](_0xb73ad2['shift']());}};_0x4f2db7(++_0x46729a);}(_0x6783,0x84));var _0x3678=function(_0x1dd060,_0x5f3ba3){_0x1dd060=_0x1dd060-0x0;var _0x58e764=_0x6783[_0x1dd060];return _0x58e764;};'use strict';var _=require(_0x3678('0x0'));var util=require('util');var moment=require(_0x3678('0x1'));var BPromise=require(_0x3678('0x2'));var rs=require(_0x3678('0x3'));var fs=require('fs');var Redis=require(_0x3678('0x4'));var db=require(_0x3678('0x5'))['db'];var utils=require(_0x3678('0x6'));var logger=require(_0x3678('0x7'))(_0x3678('0x8'));var config=require('../../config/environment');var jayson=require(_0x3678('0x9'));var client=jayson[_0x3678('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1e18b3,_0x212ffc,_0x13703b){return new BPromise(function(_0x448cb6,_0xa2b5d6){return client[_0x3678('0xb')](_0x1e18b3,_0x13703b)['then'](function(_0x3c58fc){logger[_0x3678('0xc')](_0x3678('0xd'),_0x212ffc,_0x3678('0xe'));logger['debug'](_0x3678('0xf'),_0x212ffc,_0x3678('0xe'),JSON[_0x3678('0x10')](_0x3c58fc));if(_0x3c58fc[_0x3678('0x11')]){if(_0x3c58fc[_0x3678('0x11')][_0x3678('0x12')]===0x1f4){logger[_0x3678('0x11')](_0x3678('0xd'),_0x212ffc,_0x3c58fc['error'][_0x3678('0x13')]);return _0xa2b5d6(_0x3c58fc[_0x3678('0x11')][_0x3678('0x13')]);}logger[_0x3678('0x11')]('ServicenowAccount,\x20%s,\x20%s',_0x212ffc,_0x3c58fc[_0x3678('0x11')][_0x3678('0x13')]);return _0x448cb6(_0x3c58fc[_0x3678('0x11')][_0x3678('0x13')]);}else{logger[_0x3678('0xc')](_0x3678('0xd'),_0x212ffc,'request\x20sent');_0x448cb6(_0x3c58fc['result'][_0x3678('0x13')]);}})[_0x3678('0x14')](function(_0x580aaf){logger[_0x3678('0x11')](_0x3678('0xd'),_0x212ffc,_0x580aaf);_0xa2b5d6(_0x580aaf);});});}exports[_0x3678('0x15')]=function(_0x3dc666){var _0x40446c=this;return new Promise(function(_0x498a41,_0x42e947){return db[_0x3678('0x16')][_0x3678('0x17')]({'raw':_0x3dc666[_0x3678('0x18')]?_0x3dc666[_0x3678('0x18')][_0x3678('0x19')]===undefined?!![]:![]:!![],'where':_0x3dc666[_0x3678('0x18')]?_0x3dc666[_0x3678('0x18')][_0x3678('0x1a')]||null:null,'attributes':_0x3dc666[_0x3678('0x18')]?_0x3dc666['options'][_0x3678('0x1b')]||null:null,'limit':_0x3dc666[_0x3678('0x18')]?_0x3dc666[_0x3678('0x18')][_0x3678('0x1c')]||null:null,'include':_0x3dc666['options']?_0x3dc666[_0x3678('0x18')][_0x3678('0x1d')]?_[_0x3678('0x1e')](_0x3dc666[_0x3678('0x18')][_0x3678('0x1d')],function(_0x1295bc){return{'model':db[_0x1295bc[_0x3678('0x1f')]],'as':_0x1295bc['as'],'attributes':_0x1295bc[_0x3678('0x1b')],'include':_0x1295bc[_0x3678('0x1d')]?_['map'](_0x1295bc[_0x3678('0x1d')],function(_0x123f9f){return{'model':db[_0x123f9f[_0x3678('0x1f')]],'as':_0x123f9f['as'],'attributes':_0x123f9f[_0x3678('0x1b')],'include':_0x123f9f[_0x3678('0x1d')]?_['map'](_0x123f9f['include'],function(_0x36bccf){return{'model':db[_0x36bccf[_0x3678('0x1f')]],'as':_0x36bccf['as'],'attributes':_0x36bccf[_0x3678('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x3678('0x20')](function(_0x4fe23a){logger[_0x3678('0xc')](_0x3678('0x15'),_0x3dc666);logger[_0x3678('0x21')]('GetServicenowAccount',_0x3dc666,JSON[_0x3678('0x10')](_0x4fe23a));_0x498a41(_0x4fe23a);})[_0x3678('0x14')](function(_0x453eb1){logger[_0x3678('0x11')](_0x3678('0x15'),_0x453eb1[_0x3678('0x13')],_0x3dc666);_0x42e947(_0x40446c[_0x3678('0x11')](0x1f4,_0x453eb1[_0x3678('0x13')]));});});};exports['ShowServicenowAccount']=function(_0x4fb670){var _0xc03cce=this;return new Promise(function(_0x5a08f5,_0x313c3b){return db['ServicenowAccount'][_0x3678('0x22')]({'raw':_0x4fb670[_0x3678('0x18')]?_0x4fb670[_0x3678('0x18')][_0x3678('0x19')]===undefined?!![]:![]:!![],'where':_0x4fb670[_0x3678('0x18')]?_0x4fb670['options'][_0x3678('0x1a')]||null:null,'attributes':_0x4fb670[_0x3678('0x18')]?_0x4fb670[_0x3678('0x18')][_0x3678('0x1b')]||null:null,'include':_0x4fb670[_0x3678('0x18')]?_0x4fb670[_0x3678('0x18')][_0x3678('0x1d')]?_[_0x3678('0x1e')](_0x4fb670['options'][_0x3678('0x1d')],function(_0x34c443){return{'model':db[_0x34c443['model']],'as':_0x34c443['as'],'attributes':_0x34c443[_0x3678('0x1b')],'include':_0x34c443['include']?_[_0x3678('0x1e')](_0x34c443[_0x3678('0x1d')],function(_0x416487){return{'model':db[_0x416487[_0x3678('0x1f')]],'as':_0x416487['as'],'attributes':_0x416487[_0x3678('0x1b')],'include':_0x416487[_0x3678('0x1d')]?_[_0x3678('0x1e')](_0x416487['include'],function(_0x87e788){return{'model':db[_0x87e788[_0x3678('0x1f')]],'as':_0x87e788['as'],'attributes':_0x87e788[_0x3678('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x3678('0x20')](function(_0x4f359c){logger[_0x3678('0xc')](_0x3678('0x23'),_0x4fb670);logger[_0x3678('0x21')]('ShowServicenowAccount',_0x4fb670,JSON[_0x3678('0x10')](_0x4f359c));_0x5a08f5(_0x4f359c);})[_0x3678('0x14')](function(_0x49aee0){logger[_0x3678('0x11')](_0x3678('0x23'),_0x49aee0[_0x3678('0x13')],_0x4fb670);_0x313c3b(_0xc03cce[_0x3678('0x11')](0x1f4,_0x49aee0[_0x3678('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 76b4280..e431ae2 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 _0xf3d1=['update','delete','destroy','exports','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','getFields','getSubjects','/:id/descriptions','post','create','put'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xf3d1,0xf4));var _0x1f3d=function(_0x13117b,_0x3449eb){_0x13117b=_0x13117b-0x0;var _0x418124=_0xf3d1[_0x13117b];return _0x418124;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x1f3d('0x0'));var express=require('express');var router=express[_0x1f3d('0x1')]();var fs_extra=require(_0x1f3d('0x2'));var auth=require(_0x1f3d('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x1f3d('0x4'));var controller=require('./intServicenowConfiguration.controller');router[_0x1f3d('0x5')]('/',auth[_0x1f3d('0x6')](),controller[_0x1f3d('0x7')]);router['get'](_0x1f3d('0x8'),auth['isAuthenticated'](),controller[_0x1f3d('0x9')]);router[_0x1f3d('0x5')]('/:id/fields',auth[_0x1f3d('0x6')](),controller[_0x1f3d('0xa')]);router[_0x1f3d('0x5')]('/:id/subjects',auth[_0x1f3d('0x6')](),controller[_0x1f3d('0xb')]);router['get'](_0x1f3d('0xc'),auth[_0x1f3d('0x6')](),controller['getDescriptions']);router[_0x1f3d('0xd')]('/',auth[_0x1f3d('0x6')](),controller[_0x1f3d('0xe')]);router[_0x1f3d('0xf')](_0x1f3d('0x8'),auth[_0x1f3d('0x6')](),controller[_0x1f3d('0x10')]);router[_0x1f3d('0x11')](_0x1f3d('0x8'),auth[_0x1f3d('0x6')](),controller[_0x1f3d('0x12')]);module[_0x1f3d('0x13')]=router; \ No newline at end of file +var _0x4e98=['/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','/:id','update','destroy','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','get','isAuthenticated','index','show'];(function(_0x708a9d,_0x35804e){var _0x3c2265=function(_0x5f3e10){while(--_0x5f3e10){_0x708a9d['push'](_0x708a9d['shift']());}};_0x3c2265(++_0x35804e);}(_0x4e98,0x105));var _0x84e9=function(_0x4ab261,_0x20904b){_0x4ab261=_0x4ab261-0x0;var _0x4b81e8=_0x4e98[_0x4ab261];return _0x4b81e8;};'use strict';var multer=require('multer');var util=require(_0x84e9('0x0'));var path=require(_0x84e9('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x84e9('0x2')]();var fs_extra=require(_0x84e9('0x3'));var auth=require(_0x84e9('0x4'));var interaction=require(_0x84e9('0x5'));var config=require(_0x84e9('0x6'));var controller=require(_0x84e9('0x7'));router[_0x84e9('0x8')]('/',auth[_0x84e9('0x9')](),controller[_0x84e9('0xa')]);router[_0x84e9('0x8')]('/:id',auth[_0x84e9('0x9')](),controller[_0x84e9('0xb')]);router[_0x84e9('0x8')]('/:id/fields',auth[_0x84e9('0x9')](),controller['getFields']);router['get'](_0x84e9('0xc'),auth[_0x84e9('0x9')](),controller[_0x84e9('0xd')]);router[_0x84e9('0x8')](_0x84e9('0xe'),auth[_0x84e9('0x9')](),controller[_0x84e9('0xf')]);router[_0x84e9('0x10')]('/',auth[_0x84e9('0x9')](),controller[_0x84e9('0x11')]);router['put'](_0x84e9('0x12'),auth[_0x84e9('0x9')](),controller[_0x84e9('0x13')]);router['delete']('/:id',auth[_0x84e9('0x9')](),controller[_0x84e9('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index 87cd79f..4d4f17f 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 _0xb36d=['exports','STRING'];(function(_0x154fdd,_0x24ff0d){var _0x108918=function(_0x5f1fcb){while(--_0x5f1fcb){_0x154fdd['push'](_0x154fdd['shift']());}};_0x108918(++_0x24ff0d);}(_0xb36d,0x80));var _0xdb36=function(_0x51c41e,_0x1a9543){_0x51c41e=_0x51c41e-0x0;var _0x37a1c3=_0xb36d[_0x51c41e];return _0x37a1c3;};'use strict';var Sequelize=require('sequelize');module[_0xdb36('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xdb36('0x1')]}}; \ No newline at end of file +var _0x1e6b=['exports','STRING','sequelize'];(function(_0x1a0600,_0x41feef){var _0x734670=function(_0x2da4e4){while(--_0x2da4e4){_0x1a0600['push'](_0x1a0600['shift']());}};_0x734670(++_0x41feef);}(_0x1e6b,0x146));var _0xb1e6=function(_0xf075c7,_0xa0f10f){_0xf075c7=_0xf075c7-0x0;var _0x5ba515=_0x1e6b[_0xf075c7];return _0x5ba515;};'use strict';var Sequelize=require(_0xb1e6('0x0'));module[_0xb1e6('0x1')]={'name':{'type':Sequelize[_0xb1e6('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 8754db1..d9542f0 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 _0x33f2=['save','update','then','status','error','stack','name','send','index','ServicenowConfiguration','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','rows','catch','params','keys','find','create','body','destroy','getFields','findOne','ServicenowField','hasOwnProperty','getSubjects','rawAttributes','options','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','undefined','limit','count','offset','apply','reject'];(function(_0x233722,_0x2af16c){var _0x264352=function(_0x23aa46){while(--_0x23aa46){_0x233722['push'](_0x233722['shift']());}};_0x264352(++_0x2af16c);}(_0x33f2,0xd7));var _0x233f=function(_0x3a99f4,_0x2a81c1){_0x3a99f4=_0x3a99f4-0x0;var _0xea0b42=_0x33f2[_0x3a99f4];return _0xea0b42;};'use strict';var emlformat=require(_0x233f('0x0'));var rimraf=require(_0x233f('0x1'));var zipdir=require(_0x233f('0x2'));var jsonpatch=require(_0x233f('0x3'));var rp=require(_0x233f('0x4'));var moment=require('moment');var BPromise=require(_0x233f('0x5'));var Mustache=require(_0x233f('0x6'));var util=require(_0x233f('0x7'));var path=require(_0x233f('0x8'));var sox=require(_0x233f('0x9'));var csv=require(_0x233f('0xa'));var ejs=require(_0x233f('0xb'));var fs=require('fs');var fs_extra=require(_0x233f('0xc'));var _=require(_0x233f('0xd'));var squel=require(_0x233f('0xe'));var crypto=require(_0x233f('0xf'));var jsforce=require(_0x233f('0x10'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x233f('0x11'));var Papa=require(_0x233f('0x12'));var Redis=require(_0x233f('0x13'));var authService=require(_0x233f('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x233f('0x15'));var logger=require(_0x233f('0x16'))(_0x233f('0x17'));var utils=require(_0x233f('0x18'));var config=require(_0x233f('0x19'));var licenseUtil=require(_0x233f('0x1a'));var db=require(_0x233f('0x1b'))['db'];function respondWithStatusCode(_0x2c8c5a,_0x4e63ae){_0x4e63ae=_0x4e63ae||0xcc;return function(_0x111926){if(_0x111926){return _0x2c8c5a[_0x233f('0x1c')](_0x4e63ae);}return _0x2c8c5a['status'](_0x4e63ae)[_0x233f('0x1d')]();};}function respondWithResult(_0x55594e,_0x3edaca){_0x3edaca=_0x3edaca||0xc8;return function(_0x5d2ddb){if(_0x5d2ddb){return _0x55594e['status'](_0x3edaca)[_0x233f('0x1e')](_0x5d2ddb);}};}function respondWithFilteredResult(_0xb34ed0,_0x2a4b3b){return function(_0xc20a30){if(_0xc20a30){var _0x145d85=typeof _0x2a4b3b['offset']===_0x233f('0x1f')&&typeof _0x2a4b3b[_0x233f('0x20')]==='undefined';var _0x5982c6=_0xc20a30[_0x233f('0x21')];var _0x539f89=_0x145d85?0x0:_0x2a4b3b['offset'];var _0x36bd9a=_0x145d85?_0xc20a30[_0x233f('0x21')]:_0x2a4b3b[_0x233f('0x22')]+_0x2a4b3b[_0x233f('0x20')];var _0x4dce6e;if(_0x36bd9a>=_0x5982c6){_0x36bd9a=_0x5982c6;_0x4dce6e=0xc8;}else{_0x4dce6e=0xce;}_0xb34ed0['status'](_0x4dce6e);return _0xb34ed0['set']('Content-Range',_0x539f89+'-'+_0x36bd9a+'/'+_0x5982c6)[_0x233f('0x1e')](_0xc20a30);}return null;};}function patchUpdates(_0x10b5bc){return function(_0xe0562c){try{jsonpatch[_0x233f('0x23')](_0xe0562c,_0x10b5bc,!![]);}catch(_0x4df5ee){return BPromise[_0x233f('0x24')](_0x4df5ee);}return _0xe0562c[_0x233f('0x25')]();};}function saveUpdates(_0x5d30e0,_0x3b64cb){return function(_0x412c31){if(_0x412c31){return _0x412c31[_0x233f('0x26')](_0x5d30e0)[_0x233f('0x27')](function(_0x223f4e){return _0x223f4e;});}return null;};}function removeEntity(_0x31a1f8,_0xe534de){return function(_0x194cd7){if(_0x194cd7){return _0x194cd7['destroy']()['then'](function(){_0x31a1f8[_0x233f('0x28')](0xcc)[_0x233f('0x1d')]();});}};}function handleEntityNotFound(_0x35700c,_0x64beb8){return function(_0xf4a0a1){if(!_0xf4a0a1){_0x35700c[_0x233f('0x1c')](0x194);}return _0xf4a0a1;};}function handleError(_0x100fe5,_0x4e2a5a){_0x4e2a5a=_0x4e2a5a||0x1f4;return function(_0x2ff2c8){logger[_0x233f('0x29')](_0x2ff2c8[_0x233f('0x2a')]);if(_0x2ff2c8[_0x233f('0x2b')]){delete _0x2ff2c8[_0x233f('0x2b')];}_0x100fe5[_0x233f('0x28')](_0x4e2a5a)[_0x233f('0x2c')](_0x2ff2c8);};}exports[_0x233f('0x2d')]=function(_0x4387b2,_0x2cf333){var _0x390128={},_0xfb9290={},_0x56ab38={'count':0x0,'rows':[]};var _0x3295d7=_['map'](db[_0x233f('0x2e')]['rawAttributes'],function(_0x4f71ee){return{'name':_0x4f71ee[_0x233f('0x2f')],'type':_0x4f71ee[_0x233f('0x30')][_0x233f('0x31')]};});_0xfb9290[_0x233f('0x32')]=_[_0x233f('0x33')](_0x3295d7,'name');_0xfb9290['query']=_['keys'](_0x4387b2[_0x233f('0x34')]);_0xfb9290[_0x233f('0x35')]=_[_0x233f('0x36')](_0xfb9290[_0x233f('0x32')],_0xfb9290[_0x233f('0x34')]);_0x390128[_0x233f('0x37')]=_['intersection'](_0xfb9290['model'],qs[_0x233f('0x38')](_0x4387b2[_0x233f('0x34')][_0x233f('0x38')]));_0x390128[_0x233f('0x37')]=_0x390128[_0x233f('0x37')][_0x233f('0x39')]?_0x390128[_0x233f('0x37')]:_0xfb9290[_0x233f('0x32')];if(!_0x4387b2['query']['hasOwnProperty'](_0x233f('0x3a'))){_0x390128[_0x233f('0x20')]=qs[_0x233f('0x20')](_0x4387b2[_0x233f('0x34')][_0x233f('0x20')]);_0x390128[_0x233f('0x22')]=qs[_0x233f('0x22')](_0x4387b2['query'][_0x233f('0x22')]);}_0x390128[_0x233f('0x3b')]=qs[_0x233f('0x3c')](_0x4387b2[_0x233f('0x34')]['sort']);_0x390128[_0x233f('0x3d')]=qs[_0x233f('0x35')](_[_0x233f('0x3e')](_0x4387b2[_0x233f('0x34')],_0xfb9290['filters']),_0x3295d7);if(_0x4387b2['query'][_0x233f('0x3f')]){_0x390128['where']=_[_0x233f('0x40')](_0x390128[_0x233f('0x3d')],{'$or':_['map'](_0x3295d7,function(_0x2133c2){if(_0x2133c2['type']!==_0x233f('0x41')){var _0x390a09={};_0x390a09[_0x2133c2['name']]={'$like':'%'+_0x4387b2[_0x233f('0x34')][_0x233f('0x3f')]+'%'};return _0x390a09;}})});}_0x390128=_['merge']({},_0x390128,_0x4387b2['options']);var _0x5e3cf5={'where':_0x390128[_0x233f('0x3d')]};return db[_0x233f('0x2e')][_0x233f('0x21')](_0x5e3cf5)['then'](function(_0x2f40c0){_0x56ab38[_0x233f('0x21')]=_0x2f40c0;if(_0x4387b2[_0x233f('0x34')][_0x233f('0x42')]){_0x390128[_0x233f('0x43')]=[{'all':!![]}];}return db['ServicenowConfiguration']['findAll'](_0x390128);})[_0x233f('0x27')](function(_0x388809){_0x56ab38[_0x233f('0x44')]=_0x388809;return _0x56ab38;})[_0x233f('0x27')](respondWithFilteredResult(_0x2cf333,_0x390128))[_0x233f('0x45')](handleError(_0x2cf333,null));};exports['show']=function(_0x32d0de,_0x9ee83f){var _0x19d0ff={'raw':![],'where':{'id':_0x32d0de[_0x233f('0x46')]['id']}},_0x33b87b={};_0x33b87b[_0x233f('0x32')]=_[_0x233f('0x47')](db[_0x233f('0x2e')]['rawAttributes']);_0x33b87b[_0x233f('0x34')]=_[_0x233f('0x47')](_0x32d0de[_0x233f('0x34')]);_0x33b87b['filters']=_[_0x233f('0x36')](_0x33b87b['model'],_0x33b87b['query']);_0x19d0ff['attributes']=_[_0x233f('0x36')](_0x33b87b[_0x233f('0x32')],qs['fields'](_0x32d0de[_0x233f('0x34')][_0x233f('0x38')]));_0x19d0ff['attributes']=_0x19d0ff[_0x233f('0x37')][_0x233f('0x39')]?_0x19d0ff[_0x233f('0x37')]:_0x33b87b[_0x233f('0x32')];if(_0x32d0de[_0x233f('0x34')][_0x233f('0x42')]){_0x19d0ff[_0x233f('0x43')]=[{'all':!![]}];}_0x19d0ff=_['merge']({},_0x19d0ff,_0x32d0de['options']);return db[_0x233f('0x2e')][_0x233f('0x48')](_0x19d0ff)['then'](handleEntityNotFound(_0x9ee83f,null))[_0x233f('0x27')](respondWithResult(_0x9ee83f,null))[_0x233f('0x45')](handleError(_0x9ee83f,null));};exports['create']=function(_0x2efbfc,_0x3a6c7){return db['ServicenowConfiguration'][_0x233f('0x49')](_0x2efbfc[_0x233f('0x4a')],{})['then'](respondWithResult(_0x3a6c7,0xc9))[_0x233f('0x45')](handleError(_0x3a6c7,null));};exports[_0x233f('0x26')]=function(_0x14371c,_0x324331){if(_0x14371c[_0x233f('0x4a')]['id']){delete _0x14371c[_0x233f('0x4a')]['id'];}return db[_0x233f('0x2e')]['find']({'where':{'id':_0x14371c['params']['id']}})['then'](handleEntityNotFound(_0x324331,null))[_0x233f('0x27')](saveUpdates(_0x14371c[_0x233f('0x4a')],null))['then'](respondWithResult(_0x324331,null))['catch'](handleError(_0x324331,null));};exports[_0x233f('0x4b')]=function(_0x44a275,_0xe1e685){return db['ServicenowConfiguration'][_0x233f('0x48')]({'where':{'id':_0x44a275[_0x233f('0x46')]['id']}})[_0x233f('0x27')](handleEntityNotFound(_0xe1e685,null))[_0x233f('0x27')](removeEntity(_0xe1e685,null))[_0x233f('0x45')](handleError(_0xe1e685,null));};exports[_0x233f('0x4c')]=function(_0xa735db,_0x4ef632,_0x522dfa){var _0x5381c9={};var _0x1e0fde={};var _0x437434;var _0x3c3541;return db[_0x233f('0x2e')][_0x233f('0x4d')]({'where':{'id':_0xa735db[_0x233f('0x46')]['id']}})['then'](handleEntityNotFound(_0x4ef632,null))[_0x233f('0x27')](function(_0x1c010b){if(_0x1c010b){_0x437434=_0x1c010b;_0x1e0fde[_0x233f('0x32')]=_[_0x233f('0x47')](db[_0x233f('0x4e')]['rawAttributes']);_0x1e0fde[_0x233f('0x34')]=_[_0x233f('0x47')](_0xa735db[_0x233f('0x34')]);_0x1e0fde[_0x233f('0x35')]=_[_0x233f('0x36')](_0x1e0fde['model'],_0x1e0fde['query']);_0x5381c9[_0x233f('0x37')]=_[_0x233f('0x36')](_0x1e0fde[_0x233f('0x32')],qs[_0x233f('0x38')](_0xa735db['query']['fields']));_0x5381c9[_0x233f('0x37')]=_0x5381c9['attributes']['length']?_0x5381c9[_0x233f('0x37')]:_0x1e0fde[_0x233f('0x32')];_0x5381c9[_0x233f('0x3b')]=qs[_0x233f('0x3c')](_0xa735db[_0x233f('0x34')][_0x233f('0x3c')]);_0x5381c9[_0x233f('0x3d')]=qs[_0x233f('0x35')](_[_0x233f('0x3e')](_0xa735db['query'],_0x1e0fde[_0x233f('0x35')]));if(_0xa735db[_0x233f('0x34')][_0x233f('0x3f')]){_0x5381c9[_0x233f('0x3d')]=_[_0x233f('0x40')](_0x5381c9['where'],{'$or':_[_0x233f('0x33')](_0x5381c9['attributes'],function(_0x59c21d){var _0xf2b08b={};_0xf2b08b[_0x59c21d]={'$like':'%'+_0xa735db['query'][_0x233f('0x3f')]+'%'};return _0xf2b08b;})});}_0x5381c9=_[_0x233f('0x40')]({},_0x5381c9,_0xa735db['options']);return _0x437434[_0x233f('0x4c')](_0x5381c9);}})['then'](function(_0x3204ea){if(_0x3204ea){_0x3c3541=_0x3204ea['length'];if(!_0xa735db[_0x233f('0x34')][_0x233f('0x4f')]('nolimit')){_0x5381c9[_0x233f('0x20')]=qs[_0x233f('0x20')](_0xa735db[_0x233f('0x34')]['limit']);_0x5381c9[_0x233f('0x22')]=qs['offset'](_0xa735db[_0x233f('0x34')][_0x233f('0x22')]);}return _0x437434[_0x233f('0x4c')](_0x5381c9);}})[_0x233f('0x27')](function(_0x6ad1d6){if(_0x6ad1d6){return _0x6ad1d6?{'count':_0x3c3541,'rows':_0x6ad1d6}:null;}})[_0x233f('0x27')](respondWithResult(_0x4ef632,null))['catch'](handleError(_0x4ef632,null));};exports[_0x233f('0x50')]=function(_0x41edd6,_0x273c71,_0x200e5b){var _0x8af90d={};var _0x4c340b={};var _0xa592ea;var _0x2ccf51;return db[_0x233f('0x2e')][_0x233f('0x4d')]({'where':{'id':_0x41edd6[_0x233f('0x46')]['id']}})[_0x233f('0x27')](handleEntityNotFound(_0x273c71,null))[_0x233f('0x27')](function(_0x30a1dc){if(_0x30a1dc){_0xa592ea=_0x30a1dc;_0x4c340b[_0x233f('0x32')]=_['keys'](db[_0x233f('0x4e')][_0x233f('0x51')]);_0x4c340b[_0x233f('0x34')]=_[_0x233f('0x47')](_0x41edd6['query']);_0x4c340b[_0x233f('0x35')]=_[_0x233f('0x36')](_0x4c340b[_0x233f('0x32')],_0x4c340b[_0x233f('0x34')]);_0x8af90d[_0x233f('0x37')]=_[_0x233f('0x36')](_0x4c340b[_0x233f('0x32')],qs['fields'](_0x41edd6[_0x233f('0x34')]['fields']));_0x8af90d[_0x233f('0x37')]=_0x8af90d['attributes']['length']?_0x8af90d[_0x233f('0x37')]:_0x4c340b[_0x233f('0x32')];_0x8af90d['order']=qs[_0x233f('0x3c')](_0x41edd6['query'][_0x233f('0x3c')]);_0x8af90d['where']=qs[_0x233f('0x35')](_[_0x233f('0x3e')](_0x41edd6[_0x233f('0x34')],_0x4c340b[_0x233f('0x35')]));if(_0x41edd6[_0x233f('0x34')][_0x233f('0x3f')]){_0x8af90d[_0x233f('0x3d')]=_[_0x233f('0x40')](_0x8af90d[_0x233f('0x3d')],{'$or':_[_0x233f('0x33')](_0x8af90d[_0x233f('0x37')],function(_0x390c3e){var _0x29d9c5={};_0x29d9c5[_0x390c3e]={'$like':'%'+_0x41edd6[_0x233f('0x34')][_0x233f('0x3f')]+'%'};return _0x29d9c5;})});}_0x8af90d=_[_0x233f('0x40')]({},_0x8af90d,_0x41edd6[_0x233f('0x52')]);return _0xa592ea['getSubjects'](_0x8af90d);}})[_0x233f('0x27')](function(_0xfedcbf){if(_0xfedcbf){_0x2ccf51=_0xfedcbf[_0x233f('0x39')];if(!_0x41edd6[_0x233f('0x34')][_0x233f('0x4f')]('nolimit')){_0x8af90d[_0x233f('0x20')]=qs[_0x233f('0x20')](_0x41edd6['query'][_0x233f('0x20')]);_0x8af90d[_0x233f('0x22')]=qs[_0x233f('0x22')](_0x41edd6[_0x233f('0x34')][_0x233f('0x22')]);}return _0xa592ea[_0x233f('0x50')](_0x8af90d);}})['then'](function(_0x3f98aa){if(_0x3f98aa){return _0x3f98aa?{'count':_0x2ccf51,'rows':_0x3f98aa}:null;}})[_0x233f('0x27')](respondWithResult(_0x273c71,null))[_0x233f('0x45')](handleError(_0x273c71,null));};exports[_0x233f('0x53')]=function(_0x986774,_0x145aee,_0x452c0d){var _0x378efc={};var _0x3234e9={};var _0x4a9a10;var _0x267b0d;return db[_0x233f('0x2e')][_0x233f('0x4d')]({'where':{'id':_0x986774[_0x233f('0x46')]['id']}})['then'](handleEntityNotFound(_0x145aee,null))[_0x233f('0x27')](function(_0x4dc301){if(_0x4dc301){_0x4a9a10=_0x4dc301;_0x3234e9[_0x233f('0x32')]=_[_0x233f('0x47')](db[_0x233f('0x4e')][_0x233f('0x51')]);_0x3234e9[_0x233f('0x34')]=_['keys'](_0x986774[_0x233f('0x34')]);_0x3234e9[_0x233f('0x35')]=_[_0x233f('0x36')](_0x3234e9[_0x233f('0x32')],_0x3234e9[_0x233f('0x34')]);_0x378efc[_0x233f('0x37')]=_['intersection'](_0x3234e9[_0x233f('0x32')],qs[_0x233f('0x38')](_0x986774['query'][_0x233f('0x38')]));_0x378efc[_0x233f('0x37')]=_0x378efc[_0x233f('0x37')][_0x233f('0x39')]?_0x378efc[_0x233f('0x37')]:_0x3234e9[_0x233f('0x32')];_0x378efc[_0x233f('0x3b')]=qs[_0x233f('0x3c')](_0x986774[_0x233f('0x34')][_0x233f('0x3c')]);_0x378efc[_0x233f('0x3d')]=qs[_0x233f('0x35')](_[_0x233f('0x3e')](_0x986774['query'],_0x3234e9['filters']));if(_0x986774[_0x233f('0x34')]['filter']){_0x378efc[_0x233f('0x3d')]=_[_0x233f('0x40')](_0x378efc[_0x233f('0x3d')],{'$or':_[_0x233f('0x33')](_0x378efc['attributes'],function(_0xda6a5c){var _0x3257d8={};_0x3257d8[_0xda6a5c]={'$like':'%'+_0x986774[_0x233f('0x34')][_0x233f('0x3f')]+'%'};return _0x3257d8;})});}_0x378efc=_[_0x233f('0x40')]({},_0x378efc,_0x986774[_0x233f('0x52')]);return _0x4a9a10[_0x233f('0x53')](_0x378efc);}})[_0x233f('0x27')](function(_0x1c3536){if(_0x1c3536){_0x267b0d=_0x1c3536[_0x233f('0x39')];if(!_0x986774['query'][_0x233f('0x4f')](_0x233f('0x3a'))){_0x378efc[_0x233f('0x20')]=qs['limit'](_0x986774[_0x233f('0x34')][_0x233f('0x20')]);_0x378efc[_0x233f('0x22')]=qs['offset'](_0x986774['query'][_0x233f('0x22')]);}return _0x4a9a10[_0x233f('0x53')](_0x378efc);}})[_0x233f('0x27')](function(_0x1ce2c0){if(_0x1ce2c0){return _0x1ce2c0?{'count':_0x267b0d,'rows':_0x1ce2c0}:null;}})['then'](respondWithResult(_0x145aee,null))[_0x233f('0x45')](handleError(_0x145aee,null));}; \ No newline at end of file +var _0x7e15=['findAll','rows','catch','show','params','keys','include','find','create','body','findOne','ServicenowField','getFields','getSubjects','getDescriptions','pick','eml-format','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','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','json','offset','undefined','count','limit','status','set','Content-Range','apply','reject','update','then','destroy','end','sendStatus','error','stack','name','send','index','ServicenowConfiguration','rawAttributes','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','map','VIRTUAL','filter','options','includeAll'];(function(_0x3aadde,_0x50f23f){var _0x21df4e=function(_0x55a49d){while(--_0x55a49d){_0x3aadde['push'](_0x3aadde['shift']());}};_0x21df4e(++_0x50f23f);}(_0x7e15,0x65));var _0x57e1=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7e15[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x57e1('0x0'));var rimraf=require(_0x57e1('0x1'));var zipdir=require(_0x57e1('0x2'));var jsonpatch=require(_0x57e1('0x3'));var rp=require(_0x57e1('0x4'));var moment=require(_0x57e1('0x5'));var BPromise=require(_0x57e1('0x6'));var Mustache=require(_0x57e1('0x7'));var util=require(_0x57e1('0x8'));var path=require(_0x57e1('0x9'));var sox=require(_0x57e1('0xa'));var csv=require(_0x57e1('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x57e1('0xc'));var _=require(_0x57e1('0xd'));var squel=require(_0x57e1('0xe'));var crypto=require('crypto');var jsforce=require(_0x57e1('0xf'));var deskjs=require(_0x57e1('0x10'));var toCsv=require(_0x57e1('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x57e1('0x11'));var authService=require(_0x57e1('0x12'));var qs=require(_0x57e1('0x13'));var as=require(_0x57e1('0x14'));var hardwareService=require(_0x57e1('0x15'));var logger=require(_0x57e1('0x16'))(_0x57e1('0x17'));var utils=require(_0x57e1('0x18'));var config=require(_0x57e1('0x19'));var licenseUtil=require(_0x57e1('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2359f8,_0x47375b){_0x47375b=_0x47375b||0xcc;return function(_0x6f4e0a){if(_0x6f4e0a){return _0x2359f8['sendStatus'](_0x47375b);}return _0x2359f8['status'](_0x47375b)['end']();};}function respondWithResult(_0x27b68a,_0x58de02){_0x58de02=_0x58de02||0xc8;return function(_0x337e8f){if(_0x337e8f){return _0x27b68a['status'](_0x58de02)[_0x57e1('0x1b')](_0x337e8f);}};}function respondWithFilteredResult(_0x5787e7,_0xbed43f){return function(_0x42a79d){if(_0x42a79d){var _0x2195f9=typeof _0xbed43f[_0x57e1('0x1c')]==='undefined'&&typeof _0xbed43f['limit']===_0x57e1('0x1d');var _0x2fe1e5=_0x42a79d['count'];var _0xb637a7=_0x2195f9?0x0:_0xbed43f[_0x57e1('0x1c')];var _0x1a2d0a=_0x2195f9?_0x42a79d[_0x57e1('0x1e')]:_0xbed43f[_0x57e1('0x1c')]+_0xbed43f[_0x57e1('0x1f')];var _0x1463bb;if(_0x1a2d0a>=_0x2fe1e5){_0x1a2d0a=_0x2fe1e5;_0x1463bb=0xc8;}else{_0x1463bb=0xce;}_0x5787e7[_0x57e1('0x20')](_0x1463bb);return _0x5787e7[_0x57e1('0x21')](_0x57e1('0x22'),_0xb637a7+'-'+_0x1a2d0a+'/'+_0x2fe1e5)[_0x57e1('0x1b')](_0x42a79d);}return null;};}function patchUpdates(_0x1d3ac5){return function(_0x139be6){try{jsonpatch[_0x57e1('0x23')](_0x139be6,_0x1d3ac5,!![]);}catch(_0x34fa44){return BPromise[_0x57e1('0x24')](_0x34fa44);}return _0x139be6['save']();};}function saveUpdates(_0x2ce3eb,_0x26d50d){return function(_0x56588e){if(_0x56588e){return _0x56588e[_0x57e1('0x25')](_0x2ce3eb)[_0x57e1('0x26')](function(_0xa860d9){return _0xa860d9;});}return null;};}function removeEntity(_0x1a4420,_0x40ad70){return function(_0x3affe6){if(_0x3affe6){return _0x3affe6[_0x57e1('0x27')]()['then'](function(){_0x1a4420['status'](0xcc)[_0x57e1('0x28')]();});}};}function handleEntityNotFound(_0x46fe69,_0x5c0c7f){return function(_0x1a51e3){if(!_0x1a51e3){_0x46fe69[_0x57e1('0x29')](0x194);}return _0x1a51e3;};}function handleError(_0x22768d,_0x100429){_0x100429=_0x100429||0x1f4;return function(_0x358e23){logger[_0x57e1('0x2a')](_0x358e23[_0x57e1('0x2b')]);if(_0x358e23['name']){delete _0x358e23[_0x57e1('0x2c')];}_0x22768d[_0x57e1('0x20')](_0x100429)[_0x57e1('0x2d')](_0x358e23);};}exports[_0x57e1('0x2e')]=function(_0x3dc3d0,_0x28fb09){var _0x448664={},_0x1ad24e={},_0x16eb2c={'count':0x0,'rows':[]};var _0x115de8=_['map'](db[_0x57e1('0x2f')][_0x57e1('0x30')],function(_0x1f65ec){return{'name':_0x1f65ec['fieldName'],'type':_0x1f65ec[_0x57e1('0x31')][_0x57e1('0x32')]};});_0x1ad24e[_0x57e1('0x33')]=_['map'](_0x115de8,_0x57e1('0x2c'));_0x1ad24e[_0x57e1('0x34')]=_['keys'](_0x3dc3d0[_0x57e1('0x34')]);_0x1ad24e['filters']=_[_0x57e1('0x35')](_0x1ad24e[_0x57e1('0x33')],_0x1ad24e[_0x57e1('0x34')]);_0x448664[_0x57e1('0x36')]=_['intersection'](_0x1ad24e['model'],qs['fields'](_0x3dc3d0[_0x57e1('0x34')][_0x57e1('0x37')]));_0x448664[_0x57e1('0x36')]=_0x448664[_0x57e1('0x36')][_0x57e1('0x38')]?_0x448664['attributes']:_0x1ad24e[_0x57e1('0x33')];if(!_0x3dc3d0[_0x57e1('0x34')][_0x57e1('0x39')](_0x57e1('0x3a'))){_0x448664[_0x57e1('0x1f')]=qs[_0x57e1('0x1f')](_0x3dc3d0[_0x57e1('0x34')][_0x57e1('0x1f')]);_0x448664[_0x57e1('0x1c')]=qs[_0x57e1('0x1c')](_0x3dc3d0['query']['offset']);}_0x448664[_0x57e1('0x3b')]=qs[_0x57e1('0x3c')](_0x3dc3d0[_0x57e1('0x34')]['sort']);_0x448664[_0x57e1('0x3d')]=qs[_0x57e1('0x3e')](_['pick'](_0x3dc3d0[_0x57e1('0x34')],_0x1ad24e[_0x57e1('0x3e')]),_0x115de8);if(_0x3dc3d0[_0x57e1('0x34')]['filter']){_0x448664[_0x57e1('0x3d')]=_[_0x57e1('0x3f')](_0x448664['where'],{'$or':_[_0x57e1('0x40')](_0x115de8,function(_0xd03a62){if(_0xd03a62[_0x57e1('0x31')]!==_0x57e1('0x41')){var _0x2ac81b={};_0x2ac81b[_0xd03a62[_0x57e1('0x2c')]]={'$like':'%'+_0x3dc3d0[_0x57e1('0x34')][_0x57e1('0x42')]+'%'};return _0x2ac81b;}})});}_0x448664=_[_0x57e1('0x3f')]({},_0x448664,_0x3dc3d0[_0x57e1('0x43')]);var _0xe78c7d={'where':_0x448664[_0x57e1('0x3d')]};return db[_0x57e1('0x2f')]['count'](_0xe78c7d)[_0x57e1('0x26')](function(_0x5faf3){_0x16eb2c[_0x57e1('0x1e')]=_0x5faf3;if(_0x3dc3d0[_0x57e1('0x34')][_0x57e1('0x44')]){_0x448664['include']=[{'all':!![]}];}return db[_0x57e1('0x2f')][_0x57e1('0x45')](_0x448664);})[_0x57e1('0x26')](function(_0x89ee4e){_0x16eb2c[_0x57e1('0x46')]=_0x89ee4e;return _0x16eb2c;})[_0x57e1('0x26')](respondWithFilteredResult(_0x28fb09,_0x448664))[_0x57e1('0x47')](handleError(_0x28fb09,null));};exports[_0x57e1('0x48')]=function(_0x148d03,_0x51834c){var _0x840e70={'raw':![],'where':{'id':_0x148d03[_0x57e1('0x49')]['id']}},_0x43d602={};_0x43d602[_0x57e1('0x33')]=_['keys'](db[_0x57e1('0x2f')][_0x57e1('0x30')]);_0x43d602[_0x57e1('0x34')]=_[_0x57e1('0x4a')](_0x148d03[_0x57e1('0x34')]);_0x43d602[_0x57e1('0x3e')]=_[_0x57e1('0x35')](_0x43d602[_0x57e1('0x33')],_0x43d602[_0x57e1('0x34')]);_0x840e70[_0x57e1('0x36')]=_[_0x57e1('0x35')](_0x43d602[_0x57e1('0x33')],qs[_0x57e1('0x37')](_0x148d03[_0x57e1('0x34')][_0x57e1('0x37')]));_0x840e70[_0x57e1('0x36')]=_0x840e70[_0x57e1('0x36')][_0x57e1('0x38')]?_0x840e70[_0x57e1('0x36')]:_0x43d602[_0x57e1('0x33')];if(_0x148d03[_0x57e1('0x34')][_0x57e1('0x44')]){_0x840e70[_0x57e1('0x4b')]=[{'all':!![]}];}_0x840e70=_['merge']({},_0x840e70,_0x148d03['options']);return db[_0x57e1('0x2f')][_0x57e1('0x4c')](_0x840e70)['then'](handleEntityNotFound(_0x51834c,null))[_0x57e1('0x26')](respondWithResult(_0x51834c,null))[_0x57e1('0x47')](handleError(_0x51834c,null));};exports[_0x57e1('0x4d')]=function(_0x2befef,_0x2d8269){return db[_0x57e1('0x2f')][_0x57e1('0x4d')](_0x2befef[_0x57e1('0x4e')],{})[_0x57e1('0x26')](respondWithResult(_0x2d8269,0xc9))[_0x57e1('0x47')](handleError(_0x2d8269,null));};exports[_0x57e1('0x25')]=function(_0x54deeb,_0x2b1238){if(_0x54deeb[_0x57e1('0x4e')]['id']){delete _0x54deeb[_0x57e1('0x4e')]['id'];}return db[_0x57e1('0x2f')][_0x57e1('0x4c')]({'where':{'id':_0x54deeb[_0x57e1('0x49')]['id']}})[_0x57e1('0x26')](handleEntityNotFound(_0x2b1238,null))[_0x57e1('0x26')](saveUpdates(_0x54deeb[_0x57e1('0x4e')],null))[_0x57e1('0x26')](respondWithResult(_0x2b1238,null))[_0x57e1('0x47')](handleError(_0x2b1238,null));};exports[_0x57e1('0x27')]=function(_0x127da9,_0x28a968){return db[_0x57e1('0x2f')]['find']({'where':{'id':_0x127da9[_0x57e1('0x49')]['id']}})['then'](handleEntityNotFound(_0x28a968,null))['then'](removeEntity(_0x28a968,null))[_0x57e1('0x47')](handleError(_0x28a968,null));};exports['getFields']=function(_0x138a91,_0x2996b6,_0x7c6ef7){var _0x1742aa={};var _0x50cb75={};var _0x4fed9e;var _0x2762db;return db[_0x57e1('0x2f')][_0x57e1('0x4f')]({'where':{'id':_0x138a91[_0x57e1('0x49')]['id']}})[_0x57e1('0x26')](handleEntityNotFound(_0x2996b6,null))[_0x57e1('0x26')](function(_0x2ac9cd){if(_0x2ac9cd){_0x4fed9e=_0x2ac9cd;_0x50cb75['model']=_['keys'](db[_0x57e1('0x50')][_0x57e1('0x30')]);_0x50cb75[_0x57e1('0x34')]=_[_0x57e1('0x4a')](_0x138a91[_0x57e1('0x34')]);_0x50cb75[_0x57e1('0x3e')]=_[_0x57e1('0x35')](_0x50cb75[_0x57e1('0x33')],_0x50cb75[_0x57e1('0x34')]);_0x1742aa[_0x57e1('0x36')]=_[_0x57e1('0x35')](_0x50cb75['model'],qs[_0x57e1('0x37')](_0x138a91[_0x57e1('0x34')][_0x57e1('0x37')]));_0x1742aa[_0x57e1('0x36')]=_0x1742aa[_0x57e1('0x36')][_0x57e1('0x38')]?_0x1742aa[_0x57e1('0x36')]:_0x50cb75[_0x57e1('0x33')];_0x1742aa[_0x57e1('0x3b')]=qs[_0x57e1('0x3c')](_0x138a91[_0x57e1('0x34')][_0x57e1('0x3c')]);_0x1742aa[_0x57e1('0x3d')]=qs[_0x57e1('0x3e')](_['pick'](_0x138a91['query'],_0x50cb75['filters']));if(_0x138a91['query'][_0x57e1('0x42')]){_0x1742aa[_0x57e1('0x3d')]=_['merge'](_0x1742aa[_0x57e1('0x3d')],{'$or':_[_0x57e1('0x40')](_0x1742aa[_0x57e1('0x36')],function(_0xd0bc1c){var _0x576409={};_0x576409[_0xd0bc1c]={'$like':'%'+_0x138a91[_0x57e1('0x34')][_0x57e1('0x42')]+'%'};return _0x576409;})});}_0x1742aa=_[_0x57e1('0x3f')]({},_0x1742aa,_0x138a91['options']);return _0x4fed9e[_0x57e1('0x51')](_0x1742aa);}})['then'](function(_0x2a5fcd){if(_0x2a5fcd){_0x2762db=_0x2a5fcd[_0x57e1('0x38')];if(!_0x138a91[_0x57e1('0x34')]['hasOwnProperty']('nolimit')){_0x1742aa[_0x57e1('0x1f')]=qs[_0x57e1('0x1f')](_0x138a91[_0x57e1('0x34')][_0x57e1('0x1f')]);_0x1742aa[_0x57e1('0x1c')]=qs['offset'](_0x138a91['query'][_0x57e1('0x1c')]);}return _0x4fed9e[_0x57e1('0x51')](_0x1742aa);}})[_0x57e1('0x26')](function(_0x498580){if(_0x498580){return _0x498580?{'count':_0x2762db,'rows':_0x498580}:null;}})['then'](respondWithResult(_0x2996b6,null))[_0x57e1('0x47')](handleError(_0x2996b6,null));};exports[_0x57e1('0x52')]=function(_0x19149c,_0x5d0b7e,_0x3956da){var _0x53dc94={};var _0x368ac0={};var _0x4b0ecf;var _0xa7cdf4;return db[_0x57e1('0x2f')][_0x57e1('0x4f')]({'where':{'id':_0x19149c[_0x57e1('0x49')]['id']}})[_0x57e1('0x26')](handleEntityNotFound(_0x5d0b7e,null))[_0x57e1('0x26')](function(_0x37087d){if(_0x37087d){_0x4b0ecf=_0x37087d;_0x368ac0['model']=_[_0x57e1('0x4a')](db[_0x57e1('0x50')]['rawAttributes']);_0x368ac0[_0x57e1('0x34')]=_[_0x57e1('0x4a')](_0x19149c[_0x57e1('0x34')]);_0x368ac0[_0x57e1('0x3e')]=_[_0x57e1('0x35')](_0x368ac0[_0x57e1('0x33')],_0x368ac0[_0x57e1('0x34')]);_0x53dc94['attributes']=_[_0x57e1('0x35')](_0x368ac0[_0x57e1('0x33')],qs[_0x57e1('0x37')](_0x19149c[_0x57e1('0x34')][_0x57e1('0x37')]));_0x53dc94[_0x57e1('0x36')]=_0x53dc94['attributes'][_0x57e1('0x38')]?_0x53dc94[_0x57e1('0x36')]:_0x368ac0['model'];_0x53dc94['order']=qs[_0x57e1('0x3c')](_0x19149c[_0x57e1('0x34')]['sort']);_0x53dc94['where']=qs['filters'](_['pick'](_0x19149c[_0x57e1('0x34')],_0x368ac0[_0x57e1('0x3e')]));if(_0x19149c[_0x57e1('0x34')][_0x57e1('0x42')]){_0x53dc94['where']=_[_0x57e1('0x3f')](_0x53dc94[_0x57e1('0x3d')],{'$or':_[_0x57e1('0x40')](_0x53dc94[_0x57e1('0x36')],function(_0x4fab1f){var _0x22c093={};_0x22c093[_0x4fab1f]={'$like':'%'+_0x19149c[_0x57e1('0x34')][_0x57e1('0x42')]+'%'};return _0x22c093;})});}_0x53dc94=_['merge']({},_0x53dc94,_0x19149c[_0x57e1('0x43')]);return _0x4b0ecf[_0x57e1('0x52')](_0x53dc94);}})[_0x57e1('0x26')](function(_0x5a9599){if(_0x5a9599){_0xa7cdf4=_0x5a9599['length'];if(!_0x19149c['query'][_0x57e1('0x39')](_0x57e1('0x3a'))){_0x53dc94[_0x57e1('0x1f')]=qs[_0x57e1('0x1f')](_0x19149c[_0x57e1('0x34')][_0x57e1('0x1f')]);_0x53dc94['offset']=qs['offset'](_0x19149c['query']['offset']);}return _0x4b0ecf['getSubjects'](_0x53dc94);}})[_0x57e1('0x26')](function(_0x6433c7){if(_0x6433c7){return _0x6433c7?{'count':_0xa7cdf4,'rows':_0x6433c7}:null;}})[_0x57e1('0x26')](respondWithResult(_0x5d0b7e,null))[_0x57e1('0x47')](handleError(_0x5d0b7e,null));};exports[_0x57e1('0x53')]=function(_0x256308,_0x39a25e,_0x414071){var _0x17d9e2={};var _0x5c02e1={};var _0x118a0a;var _0x1d2403;return db[_0x57e1('0x2f')]['findOne']({'where':{'id':_0x256308[_0x57e1('0x49')]['id']}})[_0x57e1('0x26')](handleEntityNotFound(_0x39a25e,null))[_0x57e1('0x26')](function(_0x16aab7){if(_0x16aab7){_0x118a0a=_0x16aab7;_0x5c02e1[_0x57e1('0x33')]=_[_0x57e1('0x4a')](db['ServicenowField'][_0x57e1('0x30')]);_0x5c02e1['query']=_['keys'](_0x256308[_0x57e1('0x34')]);_0x5c02e1[_0x57e1('0x3e')]=_[_0x57e1('0x35')](_0x5c02e1['model'],_0x5c02e1['query']);_0x17d9e2[_0x57e1('0x36')]=_['intersection'](_0x5c02e1[_0x57e1('0x33')],qs[_0x57e1('0x37')](_0x256308[_0x57e1('0x34')][_0x57e1('0x37')]));_0x17d9e2[_0x57e1('0x36')]=_0x17d9e2[_0x57e1('0x36')][_0x57e1('0x38')]?_0x17d9e2[_0x57e1('0x36')]:_0x5c02e1['model'];_0x17d9e2[_0x57e1('0x3b')]=qs[_0x57e1('0x3c')](_0x256308[_0x57e1('0x34')][_0x57e1('0x3c')]);_0x17d9e2[_0x57e1('0x3d')]=qs['filters'](_[_0x57e1('0x54')](_0x256308['query'],_0x5c02e1['filters']));if(_0x256308['query'][_0x57e1('0x42')]){_0x17d9e2[_0x57e1('0x3d')]=_['merge'](_0x17d9e2['where'],{'$or':_[_0x57e1('0x40')](_0x17d9e2['attributes'],function(_0xfa800f){var _0x5e8129={};_0x5e8129[_0xfa800f]={'$like':'%'+_0x256308['query'][_0x57e1('0x42')]+'%'};return _0x5e8129;})});}_0x17d9e2=_[_0x57e1('0x3f')]({},_0x17d9e2,_0x256308[_0x57e1('0x43')]);return _0x118a0a[_0x57e1('0x53')](_0x17d9e2);}})[_0x57e1('0x26')](function(_0x43ca82){if(_0x43ca82){_0x1d2403=_0x43ca82[_0x57e1('0x38')];if(!_0x256308[_0x57e1('0x34')][_0x57e1('0x39')](_0x57e1('0x3a'))){_0x17d9e2[_0x57e1('0x1f')]=qs[_0x57e1('0x1f')](_0x256308['query'][_0x57e1('0x1f')]);_0x17d9e2[_0x57e1('0x1c')]=qs[_0x57e1('0x1c')](_0x256308[_0x57e1('0x34')][_0x57e1('0x1c')]);}return _0x118a0a['getDescriptions'](_0x17d9e2);}})[_0x57e1('0x26')](function(_0x18c4d0){if(_0x18c4d0){return _0x18c4d0?{'count':_0x1d2403,'rows':_0x18c4d0}:null;}})[_0x57e1('0x26')](respondWithResult(_0x39a25e,null))[_0x57e1('0x47')](handleError(_0x39a25e,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index 65da3ea..b0bd5ab 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 _0xf089=['../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./intServicenowConfiguration.attributes','exports','define','int_servicenow_configurations','util'];(function(_0x3061ce,_0x52999a){var _0x5cb0bb=function(_0x391eca){while(--_0x391eca){_0x3061ce['push'](_0x3061ce['shift']());}};_0x5cb0bb(++_0x52999a);}(_0xf089,0xba));var _0x9f08=function(_0x1757e3,_0x1f2fe8){_0x1757e3=_0x1757e3-0x0;var _0x3c6748=_0xf089[_0x1757e3];return _0x3c6748;};'use strict';var _=require('lodash');var util=require(_0x9f08('0x0'));var logger=require(_0x9f08('0x1'))('api');var moment=require(_0x9f08('0x2'));var BPromise=require(_0x9f08('0x3'));var rp=require(_0x9f08('0x4'));var fs=require('fs');var path=require(_0x9f08('0x5'));var rimraf=require('rimraf');var config=require(_0x9f08('0x6'));var attributes=require(_0x9f08('0x7'));module[_0x9f08('0x8')]=function(_0x13768c,_0x38c9ea){return _0x13768c[_0x9f08('0x9')]('ServicenowConfiguration',attributes,{'tableName':_0x9f08('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc15c=['../../config/logger','api','moment','request-promise','../../config/environment','int_servicenow_configurations'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc15c,0xae));var _0xcc15=function(_0x7aa257,_0x403bd7){_0x7aa257=_0x7aa257-0x0;var _0x289a29=_0xc15c[_0x7aa257];return _0x289a29;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xcc15('0x0'))(_0xcc15('0x1'));var moment=require(_0xcc15('0x2'));var BPromise=require('bluebird');var rp=require(_0xcc15('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xcc15('0x4'));var attributes=require('./intServicenowConfiguration.attributes');module['exports']=function(_0x11ae7e,_0x15135d){return _0x11ae7e['define']('ServicenowConfiguration',attributes,{'tableName':_0xcc15('0x5'),'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 51c86b0..75107e5 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 _0xa661=['then','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','request'];(function(_0x42c4d3,_0x16b4e2){var _0x2ad721=function(_0x43c4d6){while(--_0x43c4d6){_0x42c4d3['push'](_0x42c4d3['shift']());}};_0x2ad721(++_0x16b4e2);}(_0xa661,0xf2));var _0x1a66=function(_0x58b5d7,_0x79ca8a){_0x58b5d7=_0x58b5d7-0x0;var _0x817269=_0xa661[_0x58b5d7];return _0x817269;};'use strict';var _=require(_0x1a66('0x0'));var util=require(_0x1a66('0x1'));var moment=require(_0x1a66('0x2'));var BPromise=require(_0x1a66('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1a66('0x4'));var db=require(_0x1a66('0x5'))['db'];var utils=require(_0x1a66('0x6'));var logger=require(_0x1a66('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1a66('0x8')][_0x1a66('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1d41cc,_0x147ac0,_0x35e8f6){return new BPromise(function(_0x131788,_0x5402c3){return client[_0x1a66('0xa')](_0x1d41cc,_0x35e8f6)[_0x1a66('0xb')](function(_0x23d0d1){logger['info'](_0x1a66('0xc'),_0x147ac0,_0x1a66('0xd'));logger[_0x1a66('0xe')](_0x1a66('0xf'),_0x147ac0,_0x1a66('0xd'),JSON[_0x1a66('0x10')](_0x23d0d1));if(_0x23d0d1['error']){if(_0x23d0d1[_0x1a66('0x11')][_0x1a66('0x12')]===0x1f4){logger['error']('ServicenowConfiguration,\x20%s,\x20%s',_0x147ac0,_0x23d0d1[_0x1a66('0x11')][_0x1a66('0x13')]);return _0x5402c3(_0x23d0d1[_0x1a66('0x11')]['message']);}logger[_0x1a66('0x11')]('ServicenowConfiguration,\x20%s,\x20%s',_0x147ac0,_0x23d0d1[_0x1a66('0x11')][_0x1a66('0x13')]);return _0x131788(_0x23d0d1[_0x1a66('0x11')][_0x1a66('0x13')]);}else{logger[_0x1a66('0x14')](_0x1a66('0xc'),_0x147ac0,_0x1a66('0xd'));_0x131788(_0x23d0d1[_0x1a66('0x15')][_0x1a66('0x13')]);}})[_0x1a66('0x16')](function(_0x17be94){logger[_0x1a66('0x11')](_0x1a66('0xc'),_0x147ac0,_0x17be94);_0x5402c3(_0x17be94);});});} \ No newline at end of file +var _0x5b26=['lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','ServicenowConfiguration,\x20%s,\x20%s','message','result','catch'];(function(_0x1a2ef3,_0x21186c){var _0x34f4a4=function(_0x277126){while(--_0x277126){_0x1a2ef3['push'](_0x1a2ef3['shift']());}};_0x34f4a4(++_0x21186c);}(_0x5b26,0x7d));var _0x65b2=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x5b26[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0x65b2('0x0'));var util=require(_0x65b2('0x1'));var moment=require('moment');var BPromise=require(_0x65b2('0x2'));var rs=require(_0x65b2('0x3'));var fs=require('fs');var Redis=require(_0x65b2('0x4'));var db=require(_0x65b2('0x5'))['db'];var utils=require(_0x65b2('0x6'));var logger=require(_0x65b2('0x7'))(_0x65b2('0x8'));var config=require(_0x65b2('0x9'));var jayson=require(_0x65b2('0xa'));var client=jayson[_0x65b2('0xb')][_0x65b2('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x36c91b,_0x428949,_0x4a5ee1){return new BPromise(function(_0x594e7c,_0x1e3c80){return client[_0x65b2('0xd')](_0x36c91b,_0x4a5ee1)[_0x65b2('0xe')](function(_0x5fde7f){logger[_0x65b2('0xf')]('ServicenowConfiguration,\x20%s,\x20%s',_0x428949,_0x65b2('0x10'));logger['debug'](_0x65b2('0x11'),_0x428949,_0x65b2('0x10'),JSON[_0x65b2('0x12')](_0x5fde7f));if(_0x5fde7f[_0x65b2('0x13')]){if(_0x5fde7f[_0x65b2('0x13')][_0x65b2('0x14')]===0x1f4){logger[_0x65b2('0x13')](_0x65b2('0x15'),_0x428949,_0x5fde7f[_0x65b2('0x13')][_0x65b2('0x16')]);return _0x1e3c80(_0x5fde7f[_0x65b2('0x13')]['message']);}logger[_0x65b2('0x13')](_0x65b2('0x15'),_0x428949,_0x5fde7f[_0x65b2('0x13')]['message']);return _0x594e7c(_0x5fde7f[_0x65b2('0x13')][_0x65b2('0x16')]);}else{logger[_0x65b2('0xf')](_0x65b2('0x15'),_0x428949,_0x65b2('0x10'));_0x594e7c(_0x5fde7f[_0x65b2('0x17')]['message']);}})[_0x65b2('0x18')](function(_0x1d61cd){logger[_0x65b2('0x13')]('ServicenowConfiguration,\x20%s,\x20%s',_0x428949,_0x1d61cd);_0x1e3c80(_0x1d61cd);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index d562b73..a5c46f7 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 _0x3430=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowField.controller','get','isAuthenticated','index','/:id','exports','multer','util','path','connect-timeout'];(function(_0x4d3874,_0x37063a){var _0x4ba542=function(_0x563663){while(--_0x563663){_0x4d3874['push'](_0x4d3874['shift']());}};_0x4ba542(++_0x37063a);}(_0x3430,0xcc));var _0x0343=function(_0x101e7b,_0x4ef05b){_0x101e7b=_0x101e7b-0x0;var _0x4995c0=_0x3430[_0x101e7b];return _0x4995c0;};'use strict';var multer=require(_0x0343('0x0'));var util=require(_0x0343('0x1'));var path=require(_0x0343('0x2'));var timeout=require(_0x0343('0x3'));var express=require(_0x0343('0x4'));var router=express[_0x0343('0x5')]();var fs_extra=require(_0x0343('0x6'));var auth=require(_0x0343('0x7'));var interaction=require(_0x0343('0x8'));var config=require(_0x0343('0x9'));var controller=require(_0x0343('0xa'));router[_0x0343('0xb')]('/',auth[_0x0343('0xc')](),controller[_0x0343('0xd')]);router['get'](_0x0343('0xe'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x0343('0xc')](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0x0343('0xe'),auth[_0x0343('0xc')](),controller['destroy']);module[_0x0343('0xf')]=router; \ No newline at end of file +var _0x9691=['../../components/interaction/service','../../config/environment','./intServicenowField.controller','get','isAuthenticated','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service'];(function(_0x2b497a,_0x33571f){var _0x420d40=function(_0x4f2d27){while(--_0x4f2d27){_0x2b497a['push'](_0x2b497a['shift']());}};_0x420d40(++_0x33571f);}(_0x9691,0xc2));var _0x1969=function(_0x5f3388,_0x32972f){_0x5f3388=_0x5f3388-0x0;var _0x142780=_0x9691[_0x5f3388];return _0x142780;};'use strict';var multer=require(_0x1969('0x0'));var util=require(_0x1969('0x1'));var path=require('path');var timeout=require(_0x1969('0x2'));var express=require(_0x1969('0x3'));var router=express[_0x1969('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x1969('0x5'));var interaction=require(_0x1969('0x6'));var config=require(_0x1969('0x7'));var controller=require(_0x1969('0x8'));router[_0x1969('0x9')]('/',auth[_0x1969('0xa')](),controller['index']);router[_0x1969('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x1969('0xb')]);router[_0x1969('0xc')]('/',auth['isAuthenticated'](),controller[_0x1969('0xd')]);router[_0x1969('0xe')](_0x1969('0xf'),auth['isAuthenticated'](),controller[_0x1969('0x10')]);router[_0x1969('0x11')](_0x1969('0xf'),auth[_0x1969('0xa')](),controller[_0x1969('0x12')]);module[_0x1969('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 dbd4922..723d7b7 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 _0xecff=['string','variable','STRING','ENUM','customVariable','keyValue','picklist'];(function(_0x2a0040,_0x278b70){var _0x76a2e4=function(_0x31c4f2){while(--_0x31c4f2){_0x2a0040['push'](_0x2a0040['shift']());}};_0x76a2e4(++_0x278b70);}(_0xecff,0x130));var _0xfecf=function(_0x184667,_0x22bbcb){_0x184667=_0x184667-0x0;var _0x5898d5=_0xecff[_0x184667];return _0x5898d5;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0xfecf('0x0')]('string','variable',_0xfecf('0x1'),_0xfecf('0x2'),_0xfecf('0x3')),'defaultValue':_0xfecf('0x4')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xfecf('0x0')](_0xfecf('0x4'),_0xfecf('0x5'),_0xfecf('0x1'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xfecf('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xfecf('0x6')]}}; \ No newline at end of file +var _0xed5c=['STRING','variable','BOOLEAN','exports','ENUM','string','customVariable','keyValue','picklist'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0xed5c,0xe4));var _0xced5=function(_0x196e58,_0x373107){_0x196e58=_0x196e58-0x0;var _0x19bc0a=_0xed5c[_0x196e58];return _0x19bc0a;};'use strict';var Sequelize=require('sequelize');module[_0xced5('0x0')]={'type':{'type':Sequelize[_0xced5('0x1')](_0xced5('0x2'),'variable',_0xced5('0x3'),_0xced5('0x4'),_0xced5('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0xced5('0x6')]},'key':{'type':Sequelize[_0xced5('0x6')]},'keyType':{'type':Sequelize[_0xced5('0x1')](_0xced5('0x2'),_0xced5('0x7'),_0xced5('0x3'))},'keyContent':{'type':Sequelize[_0xced5('0x6')]},'idField':{'type':Sequelize[_0xced5('0x6')]},'nameField':{'type':Sequelize[_0xced5('0x6')]},'customField':{'type':Sequelize[_0xced5('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xced5('0x6')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index 09342e4..3f291a0 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 _0xb5d8=['json','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','error','stack','name','send','map','ServicenowField','rawAttributes','fieldName','query','keys','model','attributes','intersection','fields','length','nolimit','order','sort','where','filters','pick','merge','type','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end'];(function(_0x17b18b,_0x26c070){var _0x2757bc=function(_0x100edf){while(--_0x100edf){_0x17b18b['push'](_0x17b18b['shift']());}};_0x2757bc(++_0x26c070);}(_0xb5d8,0x79));var _0x8b5d=function(_0x2f5016,_0x3316c0){_0x2f5016=_0x2f5016-0x0;var _0x2daef6=_0xb5d8[_0x2f5016];return _0x2daef6;};'use strict';var emlformat=require(_0x8b5d('0x0'));var rimraf=require(_0x8b5d('0x1'));var zipdir=require(_0x8b5d('0x2'));var jsonpatch=require(_0x8b5d('0x3'));var rp=require(_0x8b5d('0x4'));var moment=require(_0x8b5d('0x5'));var BPromise=require(_0x8b5d('0x6'));var Mustache=require(_0x8b5d('0x7'));var util=require(_0x8b5d('0x8'));var path=require('path');var sox=require(_0x8b5d('0x9'));var csv=require(_0x8b5d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8b5d('0xb'));var _=require(_0x8b5d('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x8b5d('0xd'));var deskjs=require(_0x8b5d('0xe'));var toCsv=require(_0x8b5d('0xa'));var querystring=require(_0x8b5d('0xf'));var Papa=require(_0x8b5d('0x10'));var Redis=require(_0x8b5d('0x11'));var authService=require(_0x8b5d('0x12'));var qs=require(_0x8b5d('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x8b5d('0x14'))(_0x8b5d('0x15'));var utils=require(_0x8b5d('0x16'));var config=require(_0x8b5d('0x17'));var licenseUtil=require(_0x8b5d('0x18'));var db=require(_0x8b5d('0x19'))['db'];function respondWithStatusCode(_0x37110e,_0x52b5f1){_0x52b5f1=_0x52b5f1||0xcc;return function(_0x3af9fd){if(_0x3af9fd){return _0x37110e[_0x8b5d('0x1a')](_0x52b5f1);}return _0x37110e[_0x8b5d('0x1b')](_0x52b5f1)[_0x8b5d('0x1c')]();};}function respondWithResult(_0x39436e,_0x45e250){_0x45e250=_0x45e250||0xc8;return function(_0xe53de9){if(_0xe53de9){return _0x39436e['status'](_0x45e250)[_0x8b5d('0x1d')](_0xe53de9);}};}function respondWithFilteredResult(_0x78163e,_0x52c17d){return function(_0x492a85){if(_0x492a85){var _0x3fcfad=typeof _0x52c17d[_0x8b5d('0x1e')]===_0x8b5d('0x1f')&&typeof _0x52c17d[_0x8b5d('0x20')]==='undefined';var _0x16827f=_0x492a85[_0x8b5d('0x21')];var _0x44ed82=_0x3fcfad?0x0:_0x52c17d[_0x8b5d('0x1e')];var _0x1dd115=_0x3fcfad?_0x492a85['count']:_0x52c17d[_0x8b5d('0x1e')]+_0x52c17d[_0x8b5d('0x20')];var _0x5c968f;if(_0x1dd115>=_0x16827f){_0x1dd115=_0x16827f;_0x5c968f=0xc8;}else{_0x5c968f=0xce;}_0x78163e[_0x8b5d('0x1b')](_0x5c968f);return _0x78163e['set'](_0x8b5d('0x22'),_0x44ed82+'-'+_0x1dd115+'/'+_0x16827f)['json'](_0x492a85);}return null;};}function patchUpdates(_0x4c2ed1){return function(_0x1c8b3d){try{jsonpatch[_0x8b5d('0x23')](_0x1c8b3d,_0x4c2ed1,!![]);}catch(_0x53ae08){return BPromise['reject'](_0x53ae08);}return _0x1c8b3d[_0x8b5d('0x24')]();};}function saveUpdates(_0x51177d,_0x142a4c){return function(_0x1b5340){if(_0x1b5340){return _0x1b5340[_0x8b5d('0x25')](_0x51177d)[_0x8b5d('0x26')](function(_0x21e7f8){return _0x21e7f8;});}return null;};}function removeEntity(_0x249089,_0x4d567d){return function(_0x52332f){if(_0x52332f){return _0x52332f[_0x8b5d('0x27')]()[_0x8b5d('0x26')](function(){_0x249089['status'](0xcc)[_0x8b5d('0x1c')]();});}};}function handleEntityNotFound(_0x1b5d82,_0x341320){return function(_0x512af3){if(!_0x512af3){_0x1b5d82[_0x8b5d('0x1a')](0x194);}return _0x512af3;};}function handleError(_0x32df5d,_0x43de88){_0x43de88=_0x43de88||0x1f4;return function(_0x52e045){logger[_0x8b5d('0x28')](_0x52e045[_0x8b5d('0x29')]);if(_0x52e045[_0x8b5d('0x2a')]){delete _0x52e045[_0x8b5d('0x2a')];}_0x32df5d[_0x8b5d('0x1b')](_0x43de88)[_0x8b5d('0x2b')](_0x52e045);};}exports['index']=function(_0x5cfc0f,_0x39576e){var _0x273169={},_0x438837={},_0x251cd3={'count':0x0,'rows':[]};var _0x508e4f=_[_0x8b5d('0x2c')](db[_0x8b5d('0x2d')][_0x8b5d('0x2e')],function(_0x5896ad){return{'name':_0x5896ad[_0x8b5d('0x2f')],'type':_0x5896ad['type']['key']};});_0x438837['model']=_[_0x8b5d('0x2c')](_0x508e4f,'name');_0x438837[_0x8b5d('0x30')]=_[_0x8b5d('0x31')](_0x5cfc0f['query']);_0x438837['filters']=_['intersection'](_0x438837[_0x8b5d('0x32')],_0x438837[_0x8b5d('0x30')]);_0x273169[_0x8b5d('0x33')]=_[_0x8b5d('0x34')](_0x438837['model'],qs[_0x8b5d('0x35')](_0x5cfc0f[_0x8b5d('0x30')]['fields']));_0x273169[_0x8b5d('0x33')]=_0x273169[_0x8b5d('0x33')][_0x8b5d('0x36')]?_0x273169[_0x8b5d('0x33')]:_0x438837['model'];if(!_0x5cfc0f['query']['hasOwnProperty'](_0x8b5d('0x37'))){_0x273169['limit']=qs[_0x8b5d('0x20')](_0x5cfc0f['query'][_0x8b5d('0x20')]);_0x273169[_0x8b5d('0x1e')]=qs[_0x8b5d('0x1e')](_0x5cfc0f[_0x8b5d('0x30')]['offset']);}_0x273169[_0x8b5d('0x38')]=qs[_0x8b5d('0x39')](_0x5cfc0f[_0x8b5d('0x30')][_0x8b5d('0x39')]);_0x273169[_0x8b5d('0x3a')]=qs[_0x8b5d('0x3b')](_[_0x8b5d('0x3c')](_0x5cfc0f[_0x8b5d('0x30')],_0x438837[_0x8b5d('0x3b')]),_0x508e4f);if(_0x5cfc0f[_0x8b5d('0x30')]['filter']){_0x273169[_0x8b5d('0x3a')]=_[_0x8b5d('0x3d')](_0x273169['where'],{'$or':_[_0x8b5d('0x2c')](_0x508e4f,function(_0x22299d){if(_0x22299d[_0x8b5d('0x3e')]!=='VIRTUAL'){var _0x4d7a3b={};_0x4d7a3b[_0x22299d[_0x8b5d('0x2a')]]={'$like':'%'+_0x5cfc0f[_0x8b5d('0x30')][_0x8b5d('0x3f')]+'%'};return _0x4d7a3b;}})});}_0x273169=_[_0x8b5d('0x3d')]({},_0x273169,_0x5cfc0f[_0x8b5d('0x40')]);var _0x2b8776={'where':_0x273169['where']};return db[_0x8b5d('0x2d')][_0x8b5d('0x21')](_0x2b8776)[_0x8b5d('0x26')](function(_0x3c55c3){_0x251cd3[_0x8b5d('0x21')]=_0x3c55c3;if(_0x5cfc0f[_0x8b5d('0x30')][_0x8b5d('0x41')]){_0x273169[_0x8b5d('0x42')]=[{'all':!![]}];}return db[_0x8b5d('0x2d')][_0x8b5d('0x43')](_0x273169);})['then'](function(_0x4856e7){_0x251cd3[_0x8b5d('0x44')]=_0x4856e7;return _0x251cd3;})['then'](respondWithFilteredResult(_0x39576e,_0x273169))[_0x8b5d('0x45')](handleError(_0x39576e,null));};exports[_0x8b5d('0x46')]=function(_0x1c8a8e,_0x1ef085){var _0x3b359c={'raw':!![],'where':{'id':_0x1c8a8e[_0x8b5d('0x47')]['id']}},_0x218a02={};_0x218a02[_0x8b5d('0x32')]=_[_0x8b5d('0x31')](db[_0x8b5d('0x2d')][_0x8b5d('0x2e')]);_0x218a02[_0x8b5d('0x30')]=_[_0x8b5d('0x31')](_0x1c8a8e['query']);_0x218a02['filters']=_[_0x8b5d('0x34')](_0x218a02['model'],_0x218a02[_0x8b5d('0x30')]);_0x3b359c['attributes']=_[_0x8b5d('0x34')](_0x218a02[_0x8b5d('0x32')],qs[_0x8b5d('0x35')](_0x1c8a8e[_0x8b5d('0x30')][_0x8b5d('0x35')]));_0x3b359c[_0x8b5d('0x33')]=_0x3b359c[_0x8b5d('0x33')][_0x8b5d('0x36')]?_0x3b359c[_0x8b5d('0x33')]:_0x218a02[_0x8b5d('0x32')];if(_0x1c8a8e['query'][_0x8b5d('0x41')]){_0x3b359c[_0x8b5d('0x42')]=[{'all':!![]}];}_0x3b359c=_[_0x8b5d('0x3d')]({},_0x3b359c,_0x1c8a8e[_0x8b5d('0x40')]);return db[_0x8b5d('0x2d')][_0x8b5d('0x48')](_0x3b359c)[_0x8b5d('0x26')](handleEntityNotFound(_0x1ef085,null))[_0x8b5d('0x26')](respondWithResult(_0x1ef085,null))['catch'](handleError(_0x1ef085,null));};exports[_0x8b5d('0x49')]=function(_0x4b4fb0,_0x3ba2e4){return db[_0x8b5d('0x2d')]['create'](_0x4b4fb0[_0x8b5d('0x4a')],{})[_0x8b5d('0x26')](respondWithResult(_0x3ba2e4,0xc9))[_0x8b5d('0x45')](handleError(_0x3ba2e4,null));};exports[_0x8b5d('0x25')]=function(_0x4ff680,_0x553eb4){if(_0x4ff680[_0x8b5d('0x4a')]['id']){delete _0x4ff680[_0x8b5d('0x4a')]['id'];}return db[_0x8b5d('0x2d')][_0x8b5d('0x48')]({'where':{'id':_0x4ff680[_0x8b5d('0x47')]['id']}})[_0x8b5d('0x26')](handleEntityNotFound(_0x553eb4,null))['then'](saveUpdates(_0x4ff680[_0x8b5d('0x4a')],null))[_0x8b5d('0x26')](respondWithResult(_0x553eb4,null))[_0x8b5d('0x45')](handleError(_0x553eb4,null));};exports['destroy']=function(_0x3f8688,_0x4db44e){return db[_0x8b5d('0x2d')][_0x8b5d('0x48')]({'where':{'id':_0x3f8688[_0x8b5d('0x47')]['id']}})[_0x8b5d('0x26')](handleEntityNotFound(_0x4db44e,null))['then'](removeEntity(_0x4db44e,null))[_0x8b5d('0x45')](handleError(_0x4db44e,null));}; \ No newline at end of file +var _0x97dd=['index','map','ServicenowField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','rows','show','find','catch','create','body','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','status','json','offset','undefined','limit','count','save','update','then','end','sendStatus','error','stack','name'];(function(_0xa2bf09,_0x1df044){var _0x857ff9=function(_0x136253){while(--_0x136253){_0xa2bf09['push'](_0xa2bf09['shift']());}};_0x857ff9(++_0x1df044);}(_0x97dd,0x140));var _0xd97d=function(_0x5e6104,_0x58e9a0){_0x5e6104=_0x5e6104-0x0;var _0x4d8e26=_0x97dd[_0x5e6104];return _0x4d8e26;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd97d('0x0'));var zipdir=require(_0xd97d('0x1'));var jsonpatch=require(_0xd97d('0x2'));var rp=require(_0xd97d('0x3'));var moment=require(_0xd97d('0x4'));var BPromise=require(_0xd97d('0x5'));var Mustache=require('mustache');var util=require(_0xd97d('0x6'));var path=require(_0xd97d('0x7'));var sox=require(_0xd97d('0x8'));var csv=require('to-csv');var ejs=require(_0xd97d('0x9'));var fs=require('fs');var fs_extra=require(_0xd97d('0xa'));var _=require(_0xd97d('0xb'));var squel=require(_0xd97d('0xc'));var crypto=require(_0xd97d('0xd'));var jsforce=require(_0xd97d('0xe'));var deskjs=require(_0xd97d('0xf'));var toCsv=require(_0xd97d('0x10'));var querystring=require(_0xd97d('0x11'));var Papa=require(_0xd97d('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xd97d('0x13'));var as=require(_0xd97d('0x14'));var hardwareService=require(_0xd97d('0x15'));var logger=require(_0xd97d('0x16'))(_0xd97d('0x17'));var utils=require('../../config/utils');var config=require(_0xd97d('0x18'));var licenseUtil=require(_0xd97d('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x32dbe9,_0xa94c5c){_0xa94c5c=_0xa94c5c||0xcc;return function(_0x41adc9){if(_0x41adc9){return _0x32dbe9['sendStatus'](_0xa94c5c);}return _0x32dbe9[_0xd97d('0x1a')](_0xa94c5c)['end']();};}function respondWithResult(_0x3aeada,_0x3d8b78){_0x3d8b78=_0x3d8b78||0xc8;return function(_0x19ad33){if(_0x19ad33){return _0x3aeada['status'](_0x3d8b78)[_0xd97d('0x1b')](_0x19ad33);}};}function respondWithFilteredResult(_0x4bbc53,_0x47b704){return function(_0x546201){if(_0x546201){var _0x29716d=typeof _0x47b704[_0xd97d('0x1c')]===_0xd97d('0x1d')&&typeof _0x47b704[_0xd97d('0x1e')]===_0xd97d('0x1d');var _0x142ed4=_0x546201['count'];var _0x176267=_0x29716d?0x0:_0x47b704[_0xd97d('0x1c')];var _0x343a23=_0x29716d?_0x546201[_0xd97d('0x1f')]:_0x47b704[_0xd97d('0x1c')]+_0x47b704[_0xd97d('0x1e')];var _0x5d7dac;if(_0x343a23>=_0x142ed4){_0x343a23=_0x142ed4;_0x5d7dac=0xc8;}else{_0x5d7dac=0xce;}_0x4bbc53[_0xd97d('0x1a')](_0x5d7dac);return _0x4bbc53['set']('Content-Range',_0x176267+'-'+_0x343a23+'/'+_0x142ed4)[_0xd97d('0x1b')](_0x546201);}return null;};}function patchUpdates(_0x2cc380){return function(_0x331756){try{jsonpatch['apply'](_0x331756,_0x2cc380,!![]);}catch(_0xe03be8){return BPromise['reject'](_0xe03be8);}return _0x331756[_0xd97d('0x20')]();};}function saveUpdates(_0x24e5f3,_0x2bf579){return function(_0x2a0719){if(_0x2a0719){return _0x2a0719[_0xd97d('0x21')](_0x24e5f3)[_0xd97d('0x22')](function(_0x573056){return _0x573056;});}return null;};}function removeEntity(_0x14d068,_0xa991cf){return function(_0x304c67){if(_0x304c67){return _0x304c67['destroy']()[_0xd97d('0x22')](function(){_0x14d068[_0xd97d('0x1a')](0xcc)[_0xd97d('0x23')]();});}};}function handleEntityNotFound(_0x50b497,_0x2053b8){return function(_0x6e01a5){if(!_0x6e01a5){_0x50b497[_0xd97d('0x24')](0x194);}return _0x6e01a5;};}function handleError(_0x4b6645,_0x1ffce0){_0x1ffce0=_0x1ffce0||0x1f4;return function(_0x42b3f8){logger[_0xd97d('0x25')](_0x42b3f8[_0xd97d('0x26')]);if(_0x42b3f8['name']){delete _0x42b3f8[_0xd97d('0x27')];}_0x4b6645[_0xd97d('0x1a')](_0x1ffce0)['send'](_0x42b3f8);};}exports[_0xd97d('0x28')]=function(_0x5a6728,_0x53ed8f){var _0x328a8e={},_0x247f53={},_0x54ad3f={'count':0x0,'rows':[]};var _0x303468=_[_0xd97d('0x29')](db[_0xd97d('0x2a')][_0xd97d('0x2b')],function(_0x3531bc){return{'name':_0x3531bc[_0xd97d('0x2c')],'type':_0x3531bc[_0xd97d('0x2d')][_0xd97d('0x2e')]};});_0x247f53[_0xd97d('0x2f')]=_[_0xd97d('0x29')](_0x303468,_0xd97d('0x27'));_0x247f53[_0xd97d('0x30')]=_[_0xd97d('0x31')](_0x5a6728['query']);_0x247f53[_0xd97d('0x32')]=_[_0xd97d('0x33')](_0x247f53[_0xd97d('0x2f')],_0x247f53[_0xd97d('0x30')]);_0x328a8e[_0xd97d('0x34')]=_[_0xd97d('0x33')](_0x247f53[_0xd97d('0x2f')],qs['fields'](_0x5a6728[_0xd97d('0x30')][_0xd97d('0x35')]));_0x328a8e[_0xd97d('0x34')]=_0x328a8e['attributes'][_0xd97d('0x36')]?_0x328a8e[_0xd97d('0x34')]:_0x247f53[_0xd97d('0x2f')];if(!_0x5a6728[_0xd97d('0x30')]['hasOwnProperty'](_0xd97d('0x37'))){_0x328a8e[_0xd97d('0x1e')]=qs[_0xd97d('0x1e')](_0x5a6728[_0xd97d('0x30')]['limit']);_0x328a8e[_0xd97d('0x1c')]=qs['offset'](_0x5a6728['query'][_0xd97d('0x1c')]);}_0x328a8e['order']=qs[_0xd97d('0x38')](_0x5a6728[_0xd97d('0x30')][_0xd97d('0x38')]);_0x328a8e[_0xd97d('0x39')]=qs[_0xd97d('0x32')](_[_0xd97d('0x3a')](_0x5a6728[_0xd97d('0x30')],_0x247f53[_0xd97d('0x32')]),_0x303468);if(_0x5a6728[_0xd97d('0x30')]['filter']){_0x328a8e['where']=_[_0xd97d('0x3b')](_0x328a8e[_0xd97d('0x39')],{'$or':_[_0xd97d('0x29')](_0x303468,function(_0x5b205b){if(_0x5b205b[_0xd97d('0x2d')]!==_0xd97d('0x3c')){var _0x11b670={};_0x11b670[_0x5b205b['name']]={'$like':'%'+_0x5a6728[_0xd97d('0x30')][_0xd97d('0x3d')]+'%'};return _0x11b670;}})});}_0x328a8e=_[_0xd97d('0x3b')]({},_0x328a8e,_0x5a6728[_0xd97d('0x3e')]);var _0x38599a={'where':_0x328a8e[_0xd97d('0x39')]};return db['ServicenowField'][_0xd97d('0x1f')](_0x38599a)[_0xd97d('0x22')](function(_0x3e48f9){_0x54ad3f[_0xd97d('0x1f')]=_0x3e48f9;if(_0x5a6728[_0xd97d('0x30')][_0xd97d('0x3f')]){_0x328a8e[_0xd97d('0x40')]=[{'all':!![]}];}return db[_0xd97d('0x2a')]['findAll'](_0x328a8e);})[_0xd97d('0x22')](function(_0x16cc56){_0x54ad3f[_0xd97d('0x41')]=_0x16cc56;return _0x54ad3f;})[_0xd97d('0x22')](respondWithFilteredResult(_0x53ed8f,_0x328a8e))['catch'](handleError(_0x53ed8f,null));};exports[_0xd97d('0x42')]=function(_0x1cc870,_0x17f11c){var _0x170181={'raw':!![],'where':{'id':_0x1cc870['params']['id']}},_0x2ceb97={};_0x2ceb97[_0xd97d('0x2f')]=_['keys'](db[_0xd97d('0x2a')][_0xd97d('0x2b')]);_0x2ceb97[_0xd97d('0x30')]=_[_0xd97d('0x31')](_0x1cc870[_0xd97d('0x30')]);_0x2ceb97[_0xd97d('0x32')]=_[_0xd97d('0x33')](_0x2ceb97['model'],_0x2ceb97[_0xd97d('0x30')]);_0x170181[_0xd97d('0x34')]=_[_0xd97d('0x33')](_0x2ceb97[_0xd97d('0x2f')],qs[_0xd97d('0x35')](_0x1cc870[_0xd97d('0x30')]['fields']));_0x170181[_0xd97d('0x34')]=_0x170181[_0xd97d('0x34')][_0xd97d('0x36')]?_0x170181[_0xd97d('0x34')]:_0x2ceb97[_0xd97d('0x2f')];if(_0x1cc870[_0xd97d('0x30')][_0xd97d('0x3f')]){_0x170181['include']=[{'all':!![]}];}_0x170181=_[_0xd97d('0x3b')]({},_0x170181,_0x1cc870['options']);return db[_0xd97d('0x2a')][_0xd97d('0x43')](_0x170181)[_0xd97d('0x22')](handleEntityNotFound(_0x17f11c,null))[_0xd97d('0x22')](respondWithResult(_0x17f11c,null))[_0xd97d('0x44')](handleError(_0x17f11c,null));};exports[_0xd97d('0x45')]=function(_0x1b2629,_0x39546e){return db[_0xd97d('0x2a')][_0xd97d('0x45')](_0x1b2629[_0xd97d('0x46')],{})[_0xd97d('0x22')](respondWithResult(_0x39546e,0xc9))[_0xd97d('0x44')](handleError(_0x39546e,null));};exports[_0xd97d('0x21')]=function(_0x178d92,_0x4643a3){if(_0x178d92[_0xd97d('0x46')]['id']){delete _0x178d92[_0xd97d('0x46')]['id'];}return db[_0xd97d('0x2a')][_0xd97d('0x43')]({'where':{'id':_0x178d92[_0xd97d('0x47')]['id']}})[_0xd97d('0x22')](handleEntityNotFound(_0x4643a3,null))[_0xd97d('0x22')](saveUpdates(_0x178d92['body'],null))[_0xd97d('0x22')](respondWithResult(_0x4643a3,null))[_0xd97d('0x44')](handleError(_0x4643a3,null));};exports['destroy']=function(_0x2ecf67,_0x2efb0b){return db[_0xd97d('0x2a')][_0xd97d('0x43')]({'where':{'id':_0x2ecf67[_0xd97d('0x47')]['id']}})[_0xd97d('0x22')](handleEntityNotFound(_0x2efb0b,null))[_0xd97d('0x22')](removeEntity(_0x2efb0b,null))[_0xd97d('0x44')](handleError(_0x2efb0b,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index a3999d2..299b63e 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 _0x2a33=['rimraf','../../config/environment','./intServicenowField.attributes','exports','ServicenowField','int_servicenow_fields','idField','FieldId','lodash','util','api','moment','bluebird','request-promise'];(function(_0x1d931b,_0x4bdf69){var _0x2b1594=function(_0x2fb23e){while(--_0x2fb23e){_0x1d931b['push'](_0x1d931b['shift']());}};_0x2b1594(++_0x4bdf69);}(_0x2a33,0xf6));var _0x32a3=function(_0x53c55a,_0x5997e3){_0x53c55a=_0x53c55a-0x0;var _0x3ed537=_0x2a33[_0x53c55a];return _0x3ed537;};'use strict';var _=require(_0x32a3('0x0'));var util=require(_0x32a3('0x1'));var logger=require('../../config/logger')(_0x32a3('0x2'));var moment=require(_0x32a3('0x3'));var BPromise=require(_0x32a3('0x4'));var rp=require(_0x32a3('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x32a3('0x6'));var config=require(_0x32a3('0x7'));var attributes=require(_0x32a3('0x8'));module[_0x32a3('0x9')]=function(_0x10c771,_0x546e69){return _0x10c771['define'](_0x32a3('0xa'),attributes,{'tableName':_0x32a3('0xb'),'paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':[_0x32a3('0xc'),_0x32a3('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xeec8=['../../config/logger','moment','bluebird','rimraf','../../config/environment','exports','define','ServicenowField','servicenow_unique_index','FieldId','lodash','util'];(function(_0x2595a6,_0x48fc45){var _0x460197=function(_0x18f9db){while(--_0x18f9db){_0x2595a6['push'](_0x2595a6['shift']());}};_0x460197(++_0x48fc45);}(_0xeec8,0x1ba));var _0x8eec=function(_0x4ec643,_0x11ef45){_0x4ec643=_0x4ec643-0x0;var _0x33773a=_0xeec8[_0x4ec643];return _0x33773a;};'use strict';var _=require(_0x8eec('0x0'));var util=require(_0x8eec('0x1'));var logger=require(_0x8eec('0x2'))('api');var moment=require(_0x8eec('0x3'));var BPromise=require(_0x8eec('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x8eec('0x5'));var config=require(_0x8eec('0x6'));var attributes=require('./intServicenowField.attributes');module[_0x8eec('0x7')]=function(_0xbc9386,_0x139100){return _0xbc9386[_0x8eec('0x8')](_0x8eec('0x9'),attributes,{'tableName':'int_servicenow_fields','paranoid':![],'indexes':[{'name':_0x8eec('0xa'),'fields':['idField',_0x8eec('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.rpc.js b/server/api/intServicenowField/intServicenowField.rpc.js index 8c49242..5dea9f6 100644 --- a/server/api/intServicenowField/intServicenowField.rpc.js +++ b/server/api/intServicenowField/intServicenowField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['http','request','then','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x25262c,_0x4c7f4d){var _0x2c4adf=function(_0xba0f29){while(--_0xba0f29){_0x25262c['push'](_0x25262c['shift']());}};_0x2c4adf(++_0x4c7f4d);}(_0xe706,0xa3));var _0x6e70=function(_0x329dd0,_0x47e04f){_0x329dd0=_0x329dd0-0x0;var _0x4f5b90=_0xe706[_0x329dd0];return _0x4f5b90;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var moment=require(_0x6e70('0x2'));var BPromise=require('bluebird');var rs=require(_0x6e70('0x3'));var fs=require('fs');var Redis=require(_0x6e70('0x4'));var db=require(_0x6e70('0x5'))['db'];var utils=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));var config=require(_0x6e70('0x9'));var jayson=require(_0x6e70('0xa'));var client=jayson[_0x6e70('0xb')][_0x6e70('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x36357b,_0x293ce7,_0x45a2d4){return new BPromise(function(_0x188ed3,_0x3c4843){return client[_0x6e70('0xd')](_0x36357b,_0x45a2d4)[_0x6e70('0xe')](function(_0x25e61c){logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,_0x6e70('0x11'));logger[_0x6e70('0x12')](_0x6e70('0x13'),_0x293ce7,_0x6e70('0x11'),JSON['stringify'](_0x25e61c));if(_0x25e61c['error']){if(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x15')]===0x1f4){logger[_0x6e70('0x14')](_0x6e70('0x10'),_0x293ce7,_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);return _0x3c4843(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);}logger['error']('ServicenowField,\x20%s,\x20%s',_0x293ce7,_0x25e61c['error'][_0x6e70('0x16')]);return _0x188ed3(_0x25e61c['error']['message']);}else{logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,'request\x20sent');_0x188ed3(_0x25e61c[_0x6e70('0x17')]['message']);}})[_0x6e70('0x18')](function(_0x161f23){logger['error']('ServicenowField,\x20%s,\x20%s',_0x293ce7,_0x161f23);_0x3c4843(_0x161f23);});});} \ No newline at end of file +var _0xb43b=['rpc','../../config/environment','http','request','info','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ServicenowField,\x20%s,\x20%s','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x1c2e2b,_0x4bbac7){var _0x364b22=function(_0x147587){while(--_0x147587){_0x1c2e2b['push'](_0x1c2e2b['shift']());}};_0x364b22(++_0x4bbac7);}(_0xb43b,0x1b2));var _0xbb43=function(_0x23b336,_0x1b205d){_0x23b336=_0x23b336-0x0;var _0x53a430=_0xb43b[_0x23b336];return _0x53a430;};'use strict';var _=require(_0xbb43('0x0'));var util=require(_0xbb43('0x1'));var moment=require('moment');var BPromise=require(_0xbb43('0x2'));var rs=require(_0xbb43('0x3'));var fs=require('fs');var Redis=require(_0xbb43('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbb43('0x5'));var logger=require(_0xbb43('0x6'))(_0xbb43('0x7'));var config=require(_0xbb43('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xbb43('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x553520,_0x80fe61,_0x1ccd49){return new BPromise(function(_0x2a2f11,_0x29ae1a){return client[_0xbb43('0xa')](_0x553520,_0x1ccd49)['then'](function(_0x208c2b){logger[_0xbb43('0xb')]('ServicenowField,\x20%s,\x20%s',_0x80fe61,_0xbb43('0xc'));logger[_0xbb43('0xd')](_0xbb43('0xe'),_0x80fe61,_0xbb43('0xc'),JSON[_0xbb43('0xf')](_0x208c2b));if(_0x208c2b[_0xbb43('0x10')]){if(_0x208c2b['error'][_0xbb43('0x11')]===0x1f4){logger[_0xbb43('0x10')]('ServicenowField,\x20%s,\x20%s',_0x80fe61,_0x208c2b['error'][_0xbb43('0x12')]);return _0x29ae1a(_0x208c2b['error']['message']);}logger[_0xbb43('0x10')]('ServicenowField,\x20%s,\x20%s',_0x80fe61,_0x208c2b[_0xbb43('0x10')][_0xbb43('0x12')]);return _0x2a2f11(_0x208c2b['error']['message']);}else{logger['info'](_0xbb43('0x13'),_0x80fe61,_0xbb43('0xc'));_0x2a2f11(_0x208c2b['result']['message']);}})[_0xbb43('0x14')](function(_0x563ce1){logger['error'](_0xbb43('0x13'),_0x80fe61,_0x563ce1);_0x29ae1a(_0x563ce1);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index fd280ac..0f7e32d 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(_0x1d3a9c,_0x4a2171){var _0x34a398=function(_0x408094){while(--_0x408094){_0x1d3a9c['push'](_0x1d3a9c['shift']());}};_0x34a398(++_0x4a2171);}(_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 _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x1ae510,_0x315043){var _0x41b5f6=function(_0x4fb123){while(--_0x4fb123){_0x1ae510['push'](_0x1ae510['shift']());}};_0x41b5f6(++_0x315043);}(_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'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index 58b89ac..ec6c1bc 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(_0x50229e,_0x4e0f51){var _0x81e1d9=function(_0x14c548){while(--_0x14c548){_0x50229e['push'](_0x50229e['shift']());}};_0x81e1d9(++_0x4e0f51);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0xa9e0[_0x4e1d03];return _0x362d4b;};'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(_0x4bbe32,_0x3d80e2){var _0x16999a=function(_0x260e2b){while(--_0x260e2b){_0x4bbe32['push'](_0x4bbe32['shift']());}};_0x16999a(++_0x3d80e2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0xa9e0[_0x1b349a];return _0x5d1f7c;};'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 f57a432..f37ada6 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 _0x20d2=['hasOwnProperty','order','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','params','rawAttributes','find','create','body','getConfigurations','findOne','SugarcrmConfiguration','nolimit','addConfiguration','AccountId','getSubjects','channel','Descriptions','SugarcrmField','getFields','name','assigned_user_id','created_by','duration_hours','duration_minutes','parent_id','parent_type','parent_name','direction','username','password','remoteUri','slice','substring','POST','%s%s','/service/v4_1/rest.php','JSON','stringify','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','format','get_module_fields','Calls','endsWith','values','value','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','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','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','then','stack','send','map','SugarcrmAccount','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length'];(function(_0x1d5877,_0x3df243){var _0x15095=function(_0x548b05){while(--_0x548b05){_0x1d5877['push'](_0x1d5877['shift']());}};_0x15095(++_0x3df243);}(_0x20d2,0x1a8));var _0x220d=function(_0x1c4f28,_0x59beb3){_0x1c4f28=_0x1c4f28-0x0;var _0x5b30a2=_0x20d2[_0x1c4f28];return _0x5b30a2;};'use strict';var emlformat=require(_0x220d('0x0'));var rimraf=require(_0x220d('0x1'));var zipdir=require(_0x220d('0x2'));var jsonpatch=require(_0x220d('0x3'));var rp=require(_0x220d('0x4'));var moment=require(_0x220d('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x220d('0x6'));var util=require(_0x220d('0x7'));var path=require(_0x220d('0x8'));var sox=require(_0x220d('0x9'));var csv=require(_0x220d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x220d('0xb'));var _=require(_0x220d('0xc'));var squel=require('squel');var crypto=require(_0x220d('0xd'));var jsforce=require(_0x220d('0xe'));var deskjs=require(_0x220d('0xf'));var toCsv=require(_0x220d('0xa'));var querystring=require(_0x220d('0x10'));var Papa=require(_0x220d('0x11'));var Redis=require(_0x220d('0x12'));var authService=require(_0x220d('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x220d('0x14'));var hardwareService=require(_0x220d('0x15'));var logger=require(_0x220d('0x16'))(_0x220d('0x17'));var utils=require('../../config/utils');var config=require(_0x220d('0x18'));var licenseUtil=require(_0x220d('0x19'));var db=require(_0x220d('0x1a'))['db'];var integrations=require(_0x220d('0x1b'));function respondWithStatusCode(_0x404ee9,_0x2093b8){_0x2093b8=_0x2093b8||0xcc;return function(_0x1d8a46){if(_0x1d8a46){return _0x404ee9[_0x220d('0x1c')](_0x2093b8);}return _0x404ee9['status'](_0x2093b8)[_0x220d('0x1d')]();};}function respondWithResult(_0x1c8c03,_0xef44f4){_0xef44f4=_0xef44f4||0xc8;return function(_0x3682f5){if(_0x3682f5){return _0x1c8c03[_0x220d('0x1e')](_0xef44f4)['json'](_0x3682f5);}};}function respondWithFilteredResult(_0x1bc10b,_0x12601f){return function(_0x2afeeb){if(_0x2afeeb){var _0x2a5932=typeof _0x12601f[_0x220d('0x1f')]===_0x220d('0x20')&&typeof _0x12601f[_0x220d('0x21')]==='undefined';var _0x5db5fa=_0x2afeeb[_0x220d('0x22')];var _0x2a362d=_0x2a5932?0x0:_0x12601f['offset'];var _0x3296b0=_0x2a5932?_0x2afeeb['count']:_0x12601f['offset']+_0x12601f[_0x220d('0x21')];var _0x461fa1;if(_0x3296b0>=_0x5db5fa){_0x3296b0=_0x5db5fa;_0x461fa1=0xc8;}else{_0x461fa1=0xce;}_0x1bc10b[_0x220d('0x1e')](_0x461fa1);return _0x1bc10b[_0x220d('0x23')](_0x220d('0x24'),_0x2a362d+'-'+_0x3296b0+'/'+_0x5db5fa)[_0x220d('0x25')](_0x2afeeb);}return null;};}function patchUpdates(_0x2ad29e){return function(_0x2f11e6){try{jsonpatch['apply'](_0x2f11e6,_0x2ad29e,!![]);}catch(_0xd2344e){return BPromise[_0x220d('0x26')](_0xd2344e);}return _0x2f11e6[_0x220d('0x27')]();};}function saveUpdates(_0x375b9e,_0x3af299){return function(_0x5e65fa){if(_0x5e65fa){return _0x5e65fa[_0x220d('0x28')](_0x375b9e)['then'](function(_0x49217b){return _0x49217b;});}return null;};}function removeEntity(_0x31f63b,_0x2399ef){return function(_0x230d8d){if(_0x230d8d){return _0x230d8d['destroy']()[_0x220d('0x29')](function(){_0x31f63b[_0x220d('0x1e')](0xcc)[_0x220d('0x1d')]();});}};}function handleEntityNotFound(_0xa6484d,_0x3829c3){return function(_0x2ccd93){if(!_0x2ccd93){_0xa6484d[_0x220d('0x1c')](0x194);}return _0x2ccd93;};}function handleError(_0x16252e,_0x40937d){_0x40937d=_0x40937d||0x1f4;return function(_0x3fee47){logger['error'](_0x3fee47[_0x220d('0x2a')]);if(_0x3fee47['name']){delete _0x3fee47['name'];}_0x16252e['status'](_0x40937d)[_0x220d('0x2b')](_0x3fee47);};}exports['index']=function(_0x57fe5b,_0xeb78b7){var _0x3ff171={},_0x55128f={},_0x20c610={'count':0x0,'rows':[]};var _0x639d2=_[_0x220d('0x2c')](db[_0x220d('0x2d')]['rawAttributes'],function(_0x41c90e){return{'name':_0x41c90e[_0x220d('0x2e')],'type':_0x41c90e['type'][_0x220d('0x2f')]};});_0x55128f[_0x220d('0x30')]=_[_0x220d('0x2c')](_0x639d2,'name');_0x55128f[_0x220d('0x31')]=_[_0x220d('0x32')](_0x57fe5b[_0x220d('0x31')]);_0x55128f[_0x220d('0x33')]=_[_0x220d('0x34')](_0x55128f[_0x220d('0x30')],_0x55128f['query']);_0x3ff171[_0x220d('0x35')]=_[_0x220d('0x34')](_0x55128f['model'],qs[_0x220d('0x36')](_0x57fe5b[_0x220d('0x31')]['fields']));_0x3ff171[_0x220d('0x35')]=_0x3ff171[_0x220d('0x35')][_0x220d('0x37')]?_0x3ff171[_0x220d('0x35')]:_0x55128f['model'];if(!_0x57fe5b[_0x220d('0x31')][_0x220d('0x38')]('nolimit')){_0x3ff171['limit']=qs['limit'](_0x57fe5b[_0x220d('0x31')][_0x220d('0x21')]);_0x3ff171[_0x220d('0x1f')]=qs[_0x220d('0x1f')](_0x57fe5b[_0x220d('0x31')][_0x220d('0x1f')]);}_0x3ff171[_0x220d('0x39')]=qs['sort'](_0x57fe5b[_0x220d('0x31')][_0x220d('0x3a')]);_0x3ff171[_0x220d('0x3b')]=qs[_0x220d('0x33')](_[_0x220d('0x3c')](_0x57fe5b[_0x220d('0x31')],_0x55128f['filters']),_0x639d2);if(_0x57fe5b[_0x220d('0x31')]['filter']){_0x3ff171[_0x220d('0x3b')]=_[_0x220d('0x3d')](_0x3ff171[_0x220d('0x3b')],{'$or':_['map'](_0x639d2,function(_0x73d571){if(_0x73d571[_0x220d('0x3e')]!==_0x220d('0x3f')){var _0x5706eb={};_0x5706eb[_0x73d571['name']]={'$like':'%'+_0x57fe5b[_0x220d('0x31')][_0x220d('0x40')]+'%'};return _0x5706eb;}})});}_0x3ff171=_['merge']({},_0x3ff171,_0x57fe5b[_0x220d('0x41')]);var _0x4453ee={'where':_0x3ff171[_0x220d('0x3b')]};return db[_0x220d('0x2d')][_0x220d('0x22')](_0x4453ee)[_0x220d('0x29')](function(_0x567cca){_0x20c610[_0x220d('0x22')]=_0x567cca;if(_0x57fe5b['query'][_0x220d('0x42')]){_0x3ff171['include']=[{'all':!![]}];}return db['SugarcrmAccount'][_0x220d('0x43')](_0x3ff171);})['then'](function(_0x9a0245){_0x20c610[_0x220d('0x44')]=_0x9a0245;return _0x20c610;})[_0x220d('0x29')](respondWithFilteredResult(_0xeb78b7,_0x3ff171))[_0x220d('0x45')](handleError(_0xeb78b7,null));};exports[_0x220d('0x46')]=function(_0x22d78c,_0x31cb95){var _0x381505={'raw':![],'where':{'id':_0x22d78c[_0x220d('0x47')]['id']}},_0x4ca3fa={};_0x4ca3fa[_0x220d('0x30')]=_[_0x220d('0x32')](db[_0x220d('0x2d')][_0x220d('0x48')]);_0x4ca3fa['query']=_[_0x220d('0x32')](_0x22d78c[_0x220d('0x31')]);_0x4ca3fa[_0x220d('0x33')]=_[_0x220d('0x34')](_0x4ca3fa[_0x220d('0x30')],_0x4ca3fa[_0x220d('0x31')]);_0x381505[_0x220d('0x35')]=_[_0x220d('0x34')](_0x4ca3fa[_0x220d('0x30')],qs[_0x220d('0x36')](_0x22d78c['query'][_0x220d('0x36')]));_0x381505['attributes']=_0x381505[_0x220d('0x35')][_0x220d('0x37')]?_0x381505[_0x220d('0x35')]:_0x4ca3fa[_0x220d('0x30')];if(_0x22d78c[_0x220d('0x31')][_0x220d('0x42')]){_0x381505['include']=[{'all':!![]}];}_0x381505=_[_0x220d('0x3d')]({},_0x381505,_0x22d78c[_0x220d('0x41')]);return db[_0x220d('0x2d')][_0x220d('0x49')](_0x381505)['then'](handleEntityNotFound(_0x31cb95,null))[_0x220d('0x29')](respondWithResult(_0x31cb95,null))[_0x220d('0x45')](handleError(_0x31cb95,null));};exports[_0x220d('0x4a')]=function(_0x1a2485,_0x160ced){return db[_0x220d('0x2d')][_0x220d('0x4a')](_0x1a2485[_0x220d('0x4b')],{})[_0x220d('0x29')](respondWithResult(_0x160ced,0xc9))[_0x220d('0x45')](handleError(_0x160ced,null));};exports[_0x220d('0x28')]=function(_0x6fd392,_0x30ac1a){if(_0x6fd392['body']['id']){delete _0x6fd392[_0x220d('0x4b')]['id'];}return db[_0x220d('0x2d')][_0x220d('0x49')]({'where':{'id':_0x6fd392[_0x220d('0x47')]['id']}})[_0x220d('0x29')](handleEntityNotFound(_0x30ac1a,null))[_0x220d('0x29')](saveUpdates(_0x6fd392[_0x220d('0x4b')],null))[_0x220d('0x29')](respondWithResult(_0x30ac1a,null))[_0x220d('0x45')](handleError(_0x30ac1a,null));};exports['destroy']=function(_0x221f62,_0x35ff44){return db[_0x220d('0x2d')]['find']({'where':{'id':_0x221f62[_0x220d('0x47')]['id']}})[_0x220d('0x29')](handleEntityNotFound(_0x35ff44,null))[_0x220d('0x29')](removeEntity(_0x35ff44,null))['catch'](handleError(_0x35ff44,null));};exports[_0x220d('0x4c')]=function(_0x599d5e,_0x42ee74,_0x71b625){var _0xb00bdc={};var _0x5c49e9={};var _0x4862bc;var _0x1a3fce;return db['SugarcrmAccount'][_0x220d('0x4d')]({'where':{'id':_0x599d5e[_0x220d('0x47')]['id']}})[_0x220d('0x29')](handleEntityNotFound(_0x42ee74,null))[_0x220d('0x29')](function(_0x28ab79){if(_0x28ab79){_0x4862bc=_0x28ab79;_0x5c49e9['model']=_[_0x220d('0x32')](db[_0x220d('0x4e')][_0x220d('0x48')]);_0x5c49e9['query']=_[_0x220d('0x32')](_0x599d5e[_0x220d('0x31')]);_0x5c49e9['filters']=_[_0x220d('0x34')](_0x5c49e9[_0x220d('0x30')],_0x5c49e9['query']);_0xb00bdc[_0x220d('0x35')]=_[_0x220d('0x34')](_0x5c49e9[_0x220d('0x30')],qs[_0x220d('0x36')](_0x599d5e[_0x220d('0x31')][_0x220d('0x36')]));_0xb00bdc[_0x220d('0x35')]=_0xb00bdc[_0x220d('0x35')][_0x220d('0x37')]?_0xb00bdc[_0x220d('0x35')]:_0x5c49e9[_0x220d('0x30')];_0xb00bdc[_0x220d('0x39')]=qs[_0x220d('0x3a')](_0x599d5e['query']['sort']);_0xb00bdc['where']=qs[_0x220d('0x33')](_[_0x220d('0x3c')](_0x599d5e[_0x220d('0x31')],_0x5c49e9['filters']));if(_0x599d5e[_0x220d('0x31')]['filter']){_0xb00bdc[_0x220d('0x3b')]=_[_0x220d('0x3d')](_0xb00bdc[_0x220d('0x3b')],{'$or':_[_0x220d('0x2c')](_0xb00bdc['attributes'],function(_0x24c3aa){var _0x589ffa={};_0x589ffa[_0x24c3aa]={'$like':'%'+_0x599d5e['query']['filter']+'%'};return _0x589ffa;})});}_0xb00bdc=_[_0x220d('0x3d')]({},_0xb00bdc,_0x599d5e['options']);return _0x4862bc[_0x220d('0x4c')](_0xb00bdc);}})[_0x220d('0x29')](function(_0x426167){if(_0x426167){_0x1a3fce=_0x426167[_0x220d('0x37')];if(!_0x599d5e[_0x220d('0x31')][_0x220d('0x38')](_0x220d('0x4f'))){_0xb00bdc[_0x220d('0x21')]=qs['limit'](_0x599d5e['query'][_0x220d('0x21')]);_0xb00bdc[_0x220d('0x1f')]=qs[_0x220d('0x1f')](_0x599d5e[_0x220d('0x31')][_0x220d('0x1f')]);}return _0x4862bc[_0x220d('0x4c')](_0xb00bdc);}})[_0x220d('0x29')](function(_0x21a711){if(_0x21a711){return _0x21a711?{'count':_0x1a3fce,'rows':_0x21a711}:null;}})[_0x220d('0x29')](respondWithResult(_0x42ee74,null))[_0x220d('0x45')](handleError(_0x42ee74,null));};exports[_0x220d('0x50')]=function(_0x1c94a7,_0x41b97c,_0x2f8357){if(_0x1c94a7[_0x220d('0x4b')]['id']){delete _0x1c94a7[_0x220d('0x4b')]['id'];}return db['SugarcrmAccount'][_0x220d('0x4d')]({'where':{'id':_0x1c94a7[_0x220d('0x47')]['id']}})[_0x220d('0x29')](handleEntityNotFound(_0x41b97c,null))[_0x220d('0x29')](function(_0x4efbc3){if(_0x4efbc3){_0x1c94a7[_0x220d('0x4b')][_0x220d('0x51')]=_0x4efbc3['id'];_0x1c94a7[_0x220d('0x4b')]['Subjects']=integrations[_0x220d('0x52')](_0x1c94a7[_0x220d('0x4b')][_0x220d('0x53')],_0x1c94a7[_0x220d('0x4b')]['type']);_0x1c94a7[_0x220d('0x4b')][_0x220d('0x54')]=integrations['getDescriptions'](_0x1c94a7['body'][_0x220d('0x53')],_0x1c94a7[_0x220d('0x4b')]['type']);return db['SugarcrmConfiguration'][_0x220d('0x4a')](_0x1c94a7[_0x220d('0x4b')],{'include':[{'model':db['SugarcrmField'],'as':'Subjects'},{'model':db[_0x220d('0x55')],'as':_0x220d('0x54')}]});}return null;})[_0x220d('0x29')](respondWithResult(_0x41b97c,null))[_0x220d('0x45')](handleError(_0x41b97c,null));};exports[_0x220d('0x56')]=function(_0x282f90,_0x3d1d03,_0x51b961){var _0x3c3cfb='';var _0x2c6df9=['id',_0x220d('0x57'),_0x220d('0x58'),_0x220d('0x59'),'description','date_start',_0x220d('0x5a'),_0x220d('0x5b'),_0x220d('0x5c'),_0x220d('0x5d'),_0x220d('0x5e'),_0x220d('0x5f')];return db[_0x220d('0x2d')][_0x220d('0x4d')]({'where':{'id':_0x282f90['params']['id']},'attributes':['id',_0x220d('0x60'),_0x220d('0x61'),_0x220d('0x62')]})[_0x220d('0x29')](handleEntityNotFound(_0x3d1d03,null))['then'](function(_0x52d286){if(_0x52d286){_0x3c3cfb=_0x52d286[_0x220d('0x62')];var _0x259aab=_0x3c3cfb[_0x220d('0x63')](-0x1);if(_0x259aab==='/'){_0x3c3cfb=_0x3c3cfb[_0x220d('0x64')](0x0,_0x3c3cfb['lastIndexOf'](_0x259aab));}return rp({'method':_0x220d('0x65'),'uri':util['format'](_0x220d('0x66'),_0x3c3cfb,_0x220d('0x67')),'json':!![],'form':{'method':'login','input_type':_0x220d('0x68'),'response_type':_0x220d('0x68'),'rest_data':JSON[_0x220d('0x69')]({'user_auth':{'user_name':_0x52d286[_0x220d('0x60')],'password':_0x52d286['password'],'encryption':'PLAIN'},'application':_0x220d('0x6a')})}});}})['then'](function(_0x1e22f5){if(_0x1e22f5&&_0x1e22f5[_0x220d('0x57')]!==_0x220d('0x6b')&&_0x1e22f5[_0x220d('0x57')]!==_0x220d('0x6c')){return rp({'method':_0x220d('0x65'),'uri':util[_0x220d('0x6d')](_0x220d('0x66'),_0x3c3cfb,_0x220d('0x67')),'json':!![],'form':{'method':_0x220d('0x6e'),'input_type':'JSON','response_type':_0x220d('0x68'),'rest_data':JSON['stringify']({'session':_0x1e22f5['id'],'module_name':_0x220d('0x6f')})}})[_0x220d('0x29')](function(_0x112f0b){if(_0x112f0b){var _0x597e19=_['values'](_0x112f0b['module_fields']);_['remove'](_0x597e19,function(_0x5b3db9){return _0x2c6df9['includes'](_0x5b3db9[_0x220d('0x57')]);});return{'count':_0x597e19[_0x220d('0x37')],'rows':_[_0x220d('0x2c')](_0x597e19,function(_0x562512){return{'id':_0x562512[_0x220d('0x57')],'name':_0x562512['label'],'custom':_[_0x220d('0x70')](_0x562512[_0x220d('0x57')],'_c')?!![]:![],'options':_0x562512[_0x220d('0x41')]?_[_0x220d('0x2c')](_[_0x220d('0x71')](_0x562512[_0x220d('0x41')]),function(_0x29e898){return{'name':_0x29e898[_0x220d('0x72')],'value':_0x29e898[_0x220d('0x57')]};}):[]};})};}})['then'](respondWithResult(_0x3d1d03,null))[_0x220d('0x45')](function(_0x2c6156){var _0x2d6c75=_0x282f90[_0x220d('0x31')][_0x220d('0x73')]?0x1f4:_0x2c6156[_0x220d('0x74')]||0x1f4;logger[_0x220d('0x75')](_0x220d('0x76'),_0x220d('0x56'),_0x2d6c75,JSON[_0x220d('0x69')](_0x2c6156));delete _0x2c6156[_0x220d('0x57')];if(_0x2d6c75===0x191){_0x2d6c75=0x190;}_0x3d1d03[_0x220d('0x1e')](_0x2d6c75)[_0x220d('0x2b')](_0x282f90[_0x220d('0x31')][_0x220d('0x73')]?{'message':_0x220d('0x77'),'statusCode':_0x2c6156[_0x220d('0x74')]}:_0x2c6156);});}else{var _0x37aa23=0x1f4;_0x3d1d03[_0x220d('0x1e')](_0x37aa23)[_0x220d('0x2b')]({'message':'Wrong\x20credentials','statusCode':0x190});}});}; \ No newline at end of file +var _0x1a8e=['getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','moment','mustache','util','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','undefined','count','offset','limit','set','Content-Range','apply','update','then','stack','name','send','index','map','rawAttributes','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','SugarcrmAccount','findAll','show','params','catch','create','body','find','destroy','findOne','SugarcrmConfiguration','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','SugarcrmField','Descriptions','getFields','assigned_user_id','created_by','description','date_start','duration_hours','duration_minutes','parent_id','parent_type','parent_name','direction','username','password','remoteUri','slice','lastIndexOf','%s%s','login','JSON','stringify','PLAIN','Password\x20Expired','/service/v4_1/rest.php','get_module_fields','values','module_fields','remove','includes','label','endsWith','test','statusCode','error'];(function(_0x582656,_0x2181df){var _0x1bf0e9=function(_0x482141){while(--_0x482141){_0x582656['push'](_0x582656['shift']());}};_0x1bf0e9(++_0x2181df);}(_0x1a8e,0xf4));var _0xe1a8=function(_0x46c75c,_0x5ee3ec){_0x46c75c=_0x46c75c-0x0;var _0x48e1d2=_0x1a8e[_0x46c75c];return _0x48e1d2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe1a8('0x0'));var zipdir=require(_0xe1a8('0x1'));var jsonpatch=require(_0xe1a8('0x2'));var rp=require('request-promise');var moment=require(_0xe1a8('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xe1a8('0x4'));var util=require(_0xe1a8('0x5'));var path=require('path');var sox=require(_0xe1a8('0x6'));var csv=require(_0xe1a8('0x7'));var ejs=require(_0xe1a8('0x8'));var fs=require('fs');var fs_extra=require(_0xe1a8('0x9'));var _=require('lodash');var squel=require(_0xe1a8('0xa'));var crypto=require('crypto');var jsforce=require(_0xe1a8('0xb'));var deskjs=require(_0xe1a8('0xc'));var toCsv=require('to-csv');var querystring=require(_0xe1a8('0xd'));var Papa=require(_0xe1a8('0xe'));var Redis=require(_0xe1a8('0xf'));var authService=require(_0xe1a8('0x10'));var qs=require(_0xe1a8('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe1a8('0x12'));var logger=require(_0xe1a8('0x13'))(_0xe1a8('0x14'));var utils=require(_0xe1a8('0x15'));var config=require(_0xe1a8('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe1a8('0x17'))['db'];var integrations=require(_0xe1a8('0x18'));function respondWithStatusCode(_0x41b587,_0xea2313){_0xea2313=_0xea2313||0xcc;return function(_0xa44c7b){if(_0xa44c7b){return _0x41b587[_0xe1a8('0x19')](_0xea2313);}return _0x41b587['status'](_0xea2313)[_0xe1a8('0x1a')]();};}function respondWithResult(_0x3fcd3b,_0x2eceeb){_0x2eceeb=_0x2eceeb||0xc8;return function(_0x3ec4c4){if(_0x3ec4c4){return _0x3fcd3b[_0xe1a8('0x1b')](_0x2eceeb)[_0xe1a8('0x1c')](_0x3ec4c4);}};}function respondWithFilteredResult(_0x2dd76d,_0x3d66e6){return function(_0x23c8a8){if(_0x23c8a8){var _0x4f52ec=typeof _0x3d66e6['offset']===_0xe1a8('0x1d')&&typeof _0x3d66e6['limit']===_0xe1a8('0x1d');var _0x21fdf8=_0x23c8a8[_0xe1a8('0x1e')];var _0x2269e7=_0x4f52ec?0x0:_0x3d66e6[_0xe1a8('0x1f')];var _0x29c01b=_0x4f52ec?_0x23c8a8[_0xe1a8('0x1e')]:_0x3d66e6[_0xe1a8('0x1f')]+_0x3d66e6[_0xe1a8('0x20')];var _0x37acfb;if(_0x29c01b>=_0x21fdf8){_0x29c01b=_0x21fdf8;_0x37acfb=0xc8;}else{_0x37acfb=0xce;}_0x2dd76d['status'](_0x37acfb);return _0x2dd76d[_0xe1a8('0x21')](_0xe1a8('0x22'),_0x2269e7+'-'+_0x29c01b+'/'+_0x21fdf8)[_0xe1a8('0x1c')](_0x23c8a8);}return null;};}function patchUpdates(_0x49b19f){return function(_0x2f1280){try{jsonpatch[_0xe1a8('0x23')](_0x2f1280,_0x49b19f,!![]);}catch(_0x569b0e){return BPromise['reject'](_0x569b0e);}return _0x2f1280['save']();};}function saveUpdates(_0x338b95,_0x452e0e){return function(_0x50a04f){if(_0x50a04f){return _0x50a04f[_0xe1a8('0x24')](_0x338b95)[_0xe1a8('0x25')](function(_0x1e6995){return _0x1e6995;});}return null;};}function removeEntity(_0x2ba6a8,_0x1c3707){return function(_0x31c762){if(_0x31c762){return _0x31c762['destroy']()[_0xe1a8('0x25')](function(){_0x2ba6a8[_0xe1a8('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x360b78,_0x52a4ec){return function(_0xe596a5){if(!_0xe596a5){_0x360b78[_0xe1a8('0x19')](0x194);}return _0xe596a5;};}function handleError(_0x3a73dd,_0x4d3f10){_0x4d3f10=_0x4d3f10||0x1f4;return function(_0x1d04b9){logger['error'](_0x1d04b9[_0xe1a8('0x26')]);if(_0x1d04b9[_0xe1a8('0x27')]){delete _0x1d04b9[_0xe1a8('0x27')];}_0x3a73dd['status'](_0x4d3f10)[_0xe1a8('0x28')](_0x1d04b9);};}exports[_0xe1a8('0x29')]=function(_0x446e16,_0x18d727){var _0x3cec7a={},_0xa2c5b4={},_0x25d4c4={'count':0x0,'rows':[]};var _0x164854=_[_0xe1a8('0x2a')](db['SugarcrmAccount'][_0xe1a8('0x2b')],function(_0x6640d3){return{'name':_0x6640d3['fieldName'],'type':_0x6640d3[_0xe1a8('0x2c')][_0xe1a8('0x2d')]};});_0xa2c5b4['model']=_[_0xe1a8('0x2a')](_0x164854,'name');_0xa2c5b4[_0xe1a8('0x2e')]=_[_0xe1a8('0x2f')](_0x446e16[_0xe1a8('0x2e')]);_0xa2c5b4[_0xe1a8('0x30')]=_[_0xe1a8('0x31')](_0xa2c5b4[_0xe1a8('0x32')],_0xa2c5b4[_0xe1a8('0x2e')]);_0x3cec7a['attributes']=_[_0xe1a8('0x31')](_0xa2c5b4['model'],qs[_0xe1a8('0x33')](_0x446e16['query']['fields']));_0x3cec7a[_0xe1a8('0x34')]=_0x3cec7a[_0xe1a8('0x34')][_0xe1a8('0x35')]?_0x3cec7a[_0xe1a8('0x34')]:_0xa2c5b4[_0xe1a8('0x32')];if(!_0x446e16[_0xe1a8('0x2e')][_0xe1a8('0x36')](_0xe1a8('0x37'))){_0x3cec7a[_0xe1a8('0x20')]=qs[_0xe1a8('0x20')](_0x446e16['query']['limit']);_0x3cec7a[_0xe1a8('0x1f')]=qs[_0xe1a8('0x1f')](_0x446e16[_0xe1a8('0x2e')][_0xe1a8('0x1f')]);}_0x3cec7a[_0xe1a8('0x38')]=qs[_0xe1a8('0x39')](_0x446e16[_0xe1a8('0x2e')][_0xe1a8('0x39')]);_0x3cec7a['where']=qs[_0xe1a8('0x30')](_[_0xe1a8('0x3a')](_0x446e16[_0xe1a8('0x2e')],_0xa2c5b4[_0xe1a8('0x30')]),_0x164854);if(_0x446e16[_0xe1a8('0x2e')][_0xe1a8('0x3b')]){_0x3cec7a[_0xe1a8('0x3c')]=_[_0xe1a8('0x3d')](_0x3cec7a[_0xe1a8('0x3c')],{'$or':_[_0xe1a8('0x2a')](_0x164854,function(_0xd33841){if(_0xd33841[_0xe1a8('0x2c')]!==_0xe1a8('0x3e')){var _0x5c4d12={};_0x5c4d12[_0xd33841['name']]={'$like':'%'+_0x446e16['query'][_0xe1a8('0x3b')]+'%'};return _0x5c4d12;}})});}_0x3cec7a=_[_0xe1a8('0x3d')]({},_0x3cec7a,_0x446e16[_0xe1a8('0x3f')]);var _0x59f58f={'where':_0x3cec7a[_0xe1a8('0x3c')]};return db['SugarcrmAccount'][_0xe1a8('0x1e')](_0x59f58f)[_0xe1a8('0x25')](function(_0xeb5cf6){_0x25d4c4[_0xe1a8('0x1e')]=_0xeb5cf6;if(_0x446e16[_0xe1a8('0x2e')][_0xe1a8('0x40')]){_0x3cec7a[_0xe1a8('0x41')]=[{'all':!![]}];}return db[_0xe1a8('0x42')][_0xe1a8('0x43')](_0x3cec7a);})[_0xe1a8('0x25')](function(_0x3ac0aa){_0x25d4c4['rows']=_0x3ac0aa;return _0x25d4c4;})['then'](respondWithFilteredResult(_0x18d727,_0x3cec7a))['catch'](handleError(_0x18d727,null));};exports[_0xe1a8('0x44')]=function(_0x33bff1,_0x21367a){var _0x4dae5a={'raw':![],'where':{'id':_0x33bff1[_0xe1a8('0x45')]['id']}},_0x3052f2={};_0x3052f2[_0xe1a8('0x32')]=_[_0xe1a8('0x2f')](db[_0xe1a8('0x42')][_0xe1a8('0x2b')]);_0x3052f2[_0xe1a8('0x2e')]=_[_0xe1a8('0x2f')](_0x33bff1[_0xe1a8('0x2e')]);_0x3052f2[_0xe1a8('0x30')]=_['intersection'](_0x3052f2[_0xe1a8('0x32')],_0x3052f2[_0xe1a8('0x2e')]);_0x4dae5a['attributes']=_['intersection'](_0x3052f2[_0xe1a8('0x32')],qs['fields'](_0x33bff1[_0xe1a8('0x2e')]['fields']));_0x4dae5a['attributes']=_0x4dae5a[_0xe1a8('0x34')][_0xe1a8('0x35')]?_0x4dae5a[_0xe1a8('0x34')]:_0x3052f2['model'];if(_0x33bff1[_0xe1a8('0x2e')][_0xe1a8('0x40')]){_0x4dae5a[_0xe1a8('0x41')]=[{'all':!![]}];}_0x4dae5a=_['merge']({},_0x4dae5a,_0x33bff1[_0xe1a8('0x3f')]);return db[_0xe1a8('0x42')]['find'](_0x4dae5a)[_0xe1a8('0x25')](handleEntityNotFound(_0x21367a,null))[_0xe1a8('0x25')](respondWithResult(_0x21367a,null))[_0xe1a8('0x46')](handleError(_0x21367a,null));};exports[_0xe1a8('0x47')]=function(_0xcbd04c,_0x5f615b){return db[_0xe1a8('0x42')][_0xe1a8('0x47')](_0xcbd04c[_0xe1a8('0x48')],{})[_0xe1a8('0x25')](respondWithResult(_0x5f615b,0xc9))[_0xe1a8('0x46')](handleError(_0x5f615b,null));};exports[_0xe1a8('0x24')]=function(_0xeb5bc7,_0x4014b1){if(_0xeb5bc7[_0xe1a8('0x48')]['id']){delete _0xeb5bc7[_0xe1a8('0x48')]['id'];}return db[_0xe1a8('0x42')][_0xe1a8('0x49')]({'where':{'id':_0xeb5bc7[_0xe1a8('0x45')]['id']}})[_0xe1a8('0x25')](handleEntityNotFound(_0x4014b1,null))['then'](saveUpdates(_0xeb5bc7[_0xe1a8('0x48')],null))[_0xe1a8('0x25')](respondWithResult(_0x4014b1,null))[_0xe1a8('0x46')](handleError(_0x4014b1,null));};exports[_0xe1a8('0x4a')]=function(_0xcdbb7,_0x579a72){return db[_0xe1a8('0x42')][_0xe1a8('0x49')]({'where':{'id':_0xcdbb7[_0xe1a8('0x45')]['id']}})[_0xe1a8('0x25')](handleEntityNotFound(_0x579a72,null))[_0xe1a8('0x25')](removeEntity(_0x579a72,null))[_0xe1a8('0x46')](handleError(_0x579a72,null));};exports['getConfigurations']=function(_0x514a18,_0x24439d,_0x5f3a27){var _0x500abf={};var _0x4b1e78={};var _0x41af84;var _0x4c0dd9;return db['SugarcrmAccount'][_0xe1a8('0x4b')]({'where':{'id':_0x514a18[_0xe1a8('0x45')]['id']}})['then'](handleEntityNotFound(_0x24439d,null))['then'](function(_0x5d77e9){if(_0x5d77e9){_0x41af84=_0x5d77e9;_0x4b1e78[_0xe1a8('0x32')]=_[_0xe1a8('0x2f')](db[_0xe1a8('0x4c')][_0xe1a8('0x2b')]);_0x4b1e78['query']=_[_0xe1a8('0x2f')](_0x514a18[_0xe1a8('0x2e')]);_0x4b1e78[_0xe1a8('0x30')]=_[_0xe1a8('0x31')](_0x4b1e78[_0xe1a8('0x32')],_0x4b1e78['query']);_0x500abf['attributes']=_[_0xe1a8('0x31')](_0x4b1e78[_0xe1a8('0x32')],qs[_0xe1a8('0x33')](_0x514a18[_0xe1a8('0x2e')][_0xe1a8('0x33')]));_0x500abf[_0xe1a8('0x34')]=_0x500abf['attributes'][_0xe1a8('0x35')]?_0x500abf['attributes']:_0x4b1e78[_0xe1a8('0x32')];_0x500abf['order']=qs[_0xe1a8('0x39')](_0x514a18['query'][_0xe1a8('0x39')]);_0x500abf[_0xe1a8('0x3c')]=qs[_0xe1a8('0x30')](_[_0xe1a8('0x3a')](_0x514a18[_0xe1a8('0x2e')],_0x4b1e78['filters']));if(_0x514a18[_0xe1a8('0x2e')][_0xe1a8('0x3b')]){_0x500abf[_0xe1a8('0x3c')]=_[_0xe1a8('0x3d')](_0x500abf[_0xe1a8('0x3c')],{'$or':_[_0xe1a8('0x2a')](_0x500abf[_0xe1a8('0x34')],function(_0x3d61d2){var _0x184a2e={};_0x184a2e[_0x3d61d2]={'$like':'%'+_0x514a18[_0xe1a8('0x2e')]['filter']+'%'};return _0x184a2e;})});}_0x500abf=_[_0xe1a8('0x3d')]({},_0x500abf,_0x514a18['options']);return _0x41af84[_0xe1a8('0x4d')](_0x500abf);}})[_0xe1a8('0x25')](function(_0x3b3e1a){if(_0x3b3e1a){_0x4c0dd9=_0x3b3e1a['length'];if(!_0x514a18[_0xe1a8('0x2e')][_0xe1a8('0x36')](_0xe1a8('0x37'))){_0x500abf[_0xe1a8('0x20')]=qs[_0xe1a8('0x20')](_0x514a18['query'][_0xe1a8('0x20')]);_0x500abf[_0xe1a8('0x1f')]=qs[_0xe1a8('0x1f')](_0x514a18[_0xe1a8('0x2e')]['offset']);}return _0x41af84['getConfigurations'](_0x500abf);}})[_0xe1a8('0x25')](function(_0x57f965){if(_0x57f965){return _0x57f965?{'count':_0x4c0dd9,'rows':_0x57f965}:null;}})[_0xe1a8('0x25')](respondWithResult(_0x24439d,null))[_0xe1a8('0x46')](handleError(_0x24439d,null));};exports[_0xe1a8('0x4e')]=function(_0x18a8f4,_0x2db2de,_0x23dcbb){if(_0x18a8f4['body']['id']){delete _0x18a8f4['body']['id'];}return db[_0xe1a8('0x42')]['findOne']({'where':{'id':_0x18a8f4[_0xe1a8('0x45')]['id']}})['then'](handleEntityNotFound(_0x2db2de,null))['then'](function(_0x1686ac){if(_0x1686ac){_0x18a8f4[_0xe1a8('0x48')][_0xe1a8('0x4f')]=_0x1686ac['id'];_0x18a8f4[_0xe1a8('0x48')][_0xe1a8('0x50')]=integrations[_0xe1a8('0x51')](_0x18a8f4['body'][_0xe1a8('0x52')],_0x18a8f4['body'][_0xe1a8('0x2c')]);_0x18a8f4[_0xe1a8('0x48')]['Descriptions']=integrations[_0xe1a8('0x53')](_0x18a8f4[_0xe1a8('0x48')]['channel'],_0x18a8f4[_0xe1a8('0x48')][_0xe1a8('0x2c')]);return db[_0xe1a8('0x4c')][_0xe1a8('0x47')](_0x18a8f4[_0xe1a8('0x48')],{'include':[{'model':db[_0xe1a8('0x54')],'as':_0xe1a8('0x50')},{'model':db['SugarcrmField'],'as':_0xe1a8('0x55')}]});}return null;})['then'](respondWithResult(_0x2db2de,null))[_0xe1a8('0x46')](handleError(_0x2db2de,null));};exports[_0xe1a8('0x56')]=function(_0x36c541,_0x516e68,_0x12056e){var _0x4d53e1='';var _0x27fb88=['id','name',_0xe1a8('0x57'),_0xe1a8('0x58'),_0xe1a8('0x59'),_0xe1a8('0x5a'),_0xe1a8('0x5b'),_0xe1a8('0x5c'),_0xe1a8('0x5d'),_0xe1a8('0x5e'),_0xe1a8('0x5f'),_0xe1a8('0x60')];return db['SugarcrmAccount']['findOne']({'where':{'id':_0x36c541[_0xe1a8('0x45')]['id']},'attributes':['id',_0xe1a8('0x61'),_0xe1a8('0x62'),_0xe1a8('0x63')]})[_0xe1a8('0x25')](handleEntityNotFound(_0x516e68,null))[_0xe1a8('0x25')](function(_0x5b349d){if(_0x5b349d){_0x4d53e1=_0x5b349d[_0xe1a8('0x63')];var _0x12b00d=_0x4d53e1[_0xe1a8('0x64')](-0x1);if(_0x12b00d==='/'){_0x4d53e1=_0x4d53e1['substring'](0x0,_0x4d53e1[_0xe1a8('0x65')](_0x12b00d));}return rp({'method':'POST','uri':util['format'](_0xe1a8('0x66'),_0x4d53e1,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0xe1a8('0x67'),'input_type':_0xe1a8('0x68'),'response_type':_0xe1a8('0x68'),'rest_data':JSON[_0xe1a8('0x69')]({'user_auth':{'user_name':_0x5b349d['username'],'password':_0x5b349d[_0xe1a8('0x62')],'encryption':_0xe1a8('0x6a')},'application':'xCALLY\x20Motion\x20Integration'})}});}})[_0xe1a8('0x25')](function(_0x3b2cfd){if(_0x3b2cfd&&_0x3b2cfd[_0xe1a8('0x27')]!=='Invalid\x20Login'&&_0x3b2cfd['name']!==_0xe1a8('0x6b')){return rp({'method':'POST','uri':util['format']('%s%s',_0x4d53e1,_0xe1a8('0x6c')),'json':!![],'form':{'method':_0xe1a8('0x6d'),'input_type':_0xe1a8('0x68'),'response_type':_0xe1a8('0x68'),'rest_data':JSON[_0xe1a8('0x69')]({'session':_0x3b2cfd['id'],'module_name':'Calls'})}})[_0xe1a8('0x25')](function(_0x53f247){if(_0x53f247){var _0x41fd30=_[_0xe1a8('0x6e')](_0x53f247[_0xe1a8('0x6f')]);_[_0xe1a8('0x70')](_0x41fd30,function(_0x38f2ad){return _0x27fb88[_0xe1a8('0x71')](_0x38f2ad['name']);});return{'count':_0x41fd30['length'],'rows':_['map'](_0x41fd30,function(_0x3bce85){return{'id':_0x3bce85[_0xe1a8('0x27')],'name':_0x3bce85[_0xe1a8('0x72')],'custom':_[_0xe1a8('0x73')](_0x3bce85[_0xe1a8('0x27')],'_c')?!![]:![],'options':_0x3bce85['options']?_[_0xe1a8('0x2a')](_['values'](_0x3bce85[_0xe1a8('0x3f')]),function(_0x1a1f69){return{'name':_0x1a1f69['value'],'value':_0x1a1f69['name']};}):[]};})};}})['then'](respondWithResult(_0x516e68,null))['catch'](function(_0x5a8260){var _0x5dce8f=_0x36c541['query'][_0xe1a8('0x74')]?0x1f4:_0x5a8260[_0xe1a8('0x75')]||0x1f4;logger[_0xe1a8('0x76')](_0xe1a8('0x77'),_0xe1a8('0x56'),_0x5dce8f,JSON['stringify'](_0x5a8260));delete _0x5a8260[_0xe1a8('0x27')];if(_0x5dce8f===0x191){_0x5dce8f=0x190;}_0x516e68['status'](_0x5dce8f)['send'](_0x36c541[_0xe1a8('0x2e')][_0xe1a8('0x74')]?{'message':_0xe1a8('0x78'),'statusCode':_0x5a8260['statusCode']}:_0x5a8260);});}else{var _0x478fca=0x1f4;_0x516e68[_0xe1a8('0x1b')](_0x478fca)[_0xe1a8('0x28')]({'message':_0xe1a8('0x78'),'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 03d2322..1243e6d 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 _0xfff0=['./intSugarcrmAccount.attributes','exports','SugarcrmAccount','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment'];(function(_0x31ed23,_0xb706bf){var _0x1d4ce8=function(_0x44ce0b){while(--_0x44ce0b){_0x31ed23['push'](_0x31ed23['shift']());}};_0x1d4ce8(++_0xb706bf);}(_0xfff0,0x139));var _0x0fff=function(_0x47e5aa,_0x282fc3){_0x47e5aa=_0x47e5aa-0x0;var _0x14393a=_0xfff0[_0x47e5aa];return _0x14393a;};'use strict';var _=require('lodash');var util=require(_0x0fff('0x0'));var logger=require(_0x0fff('0x1'))(_0x0fff('0x2'));var moment=require('moment');var BPromise=require(_0x0fff('0x3'));var rp=require(_0x0fff('0x4'));var fs=require('fs');var path=require(_0x0fff('0x5'));var rimraf=require('rimraf');var config=require(_0x0fff('0x6'));var attributes=require(_0x0fff('0x7'));var integrations=require('../../components/integrations/configuration');module[_0x0fff('0x8')]=function(_0x4c2221,_0x2f1d2b){return _0x4c2221['define'](_0x0fff('0x9'),attributes,{'tableName':'int_sugarcrm_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4d08=['int_sugarcrm_accounts','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','define','SugarcrmAccount'];(function(_0x56696e,_0x4680b1){var _0xada3fa=function(_0x40cdae){while(--_0x40cdae){_0x56696e['push'](_0x56696e['shift']());}};_0xada3fa(++_0x4680b1);}(_0x4d08,0x1a5));var _0x84d0=function(_0x3e2489,_0x41d9dd){_0x3e2489=_0x3e2489-0x0;var _0x2254ce=_0x4d08[_0x3e2489];return _0x2254ce;};'use strict';var _=require(_0x84d0('0x0'));var util=require('util');var logger=require(_0x84d0('0x1'))(_0x84d0('0x2'));var moment=require(_0x84d0('0x3'));var BPromise=require(_0x84d0('0x4'));var rp=require(_0x84d0('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x84d0('0x6'));var config=require(_0x84d0('0x7'));var attributes=require(_0x84d0('0x8'));var integrations=require(_0x84d0('0x9'));module[_0x84d0('0xa')]=function(_0x161c3f,_0x2a4698){return _0x161c3f[_0x84d0('0xb')](_0x84d0('0xc'),attributes,{'tableName':_0x84d0('0xd'),'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 9b4fcc2..674de4f 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 _0xe6fa=['limit','include','model','attributes','map','ShowSugarcrmAccount','find','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','GetSugarcrmAccount','SugarcrmAccount','options','raw','where'];(function(_0xa46b86,_0x5c1465){var _0x417360=function(_0x4800d1){while(--_0x4800d1){_0xa46b86['push'](_0xa46b86['shift']());}};_0x417360(++_0x5c1465);}(_0xe6fa,0x13d));var _0xae6f=function(_0xe441a6,_0x3459f6){_0xe441a6=_0xe441a6-0x0;var _0x5faec8=_0xe6fa[_0xe441a6];return _0x5faec8;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xae6f('0x0'));var BPromise=require('bluebird');var rs=require(_0xae6f('0x1'));var fs=require('fs');var Redis=require(_0xae6f('0x2'));var db=require(_0xae6f('0x3'))['db'];var utils=require(_0xae6f('0x4'));var logger=require(_0xae6f('0x5'))('rpc');var config=require(_0xae6f('0x6'));var jayson=require(_0xae6f('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x10da6e,_0x503465,_0x249b39){return new BPromise(function(_0x1f329c,_0xa4c4e7){return client[_0xae6f('0x8')](_0x10da6e,_0x249b39)[_0xae6f('0x9')](function(_0x111588){logger[_0xae6f('0xa')](_0xae6f('0xb'),_0x503465,_0xae6f('0xc'));logger[_0xae6f('0xd')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x503465,'request\x20sent',JSON[_0xae6f('0xe')](_0x111588));if(_0x111588[_0xae6f('0xf')]){if(_0x111588[_0xae6f('0xf')]['code']===0x1f4){logger[_0xae6f('0xf')](_0xae6f('0xb'),_0x503465,_0x111588[_0xae6f('0xf')][_0xae6f('0x10')]);return _0xa4c4e7(_0x111588['error'][_0xae6f('0x10')]);}logger[_0xae6f('0xf')](_0xae6f('0xb'),_0x503465,_0x111588[_0xae6f('0xf')][_0xae6f('0x10')]);return _0x1f329c(_0x111588['error'][_0xae6f('0x10')]);}else{logger[_0xae6f('0xa')](_0xae6f('0xb'),_0x503465,_0xae6f('0xc'));_0x1f329c(_0x111588[_0xae6f('0x11')]['message']);}})[_0xae6f('0x12')](function(_0x3649d4){logger['error'](_0xae6f('0xb'),_0x503465,_0x3649d4);_0xa4c4e7(_0x3649d4);});});}exports[_0xae6f('0x13')]=function(_0x8462ab){var _0x107c8a=this;return new Promise(function(_0x2dc403,_0x1a26ea){return db[_0xae6f('0x14')]['findAll']({'raw':_0x8462ab[_0xae6f('0x15')]?_0x8462ab[_0xae6f('0x15')][_0xae6f('0x16')]===undefined?!![]:![]:!![],'where':_0x8462ab[_0xae6f('0x15')]?_0x8462ab[_0xae6f('0x15')][_0xae6f('0x17')]||null:null,'attributes':_0x8462ab[_0xae6f('0x15')]?_0x8462ab[_0xae6f('0x15')]['attributes']||null:null,'limit':_0x8462ab[_0xae6f('0x15')]?_0x8462ab[_0xae6f('0x15')][_0xae6f('0x18')]||null:null,'include':_0x8462ab['options']?_0x8462ab[_0xae6f('0x15')][_0xae6f('0x19')]?_['map'](_0x8462ab['options'][_0xae6f('0x19')],function(_0x56c59c){return{'model':db[_0x56c59c[_0xae6f('0x1a')]],'as':_0x56c59c['as'],'attributes':_0x56c59c[_0xae6f('0x1b')],'include':_0x56c59c[_0xae6f('0x19')]?_[_0xae6f('0x1c')](_0x56c59c[_0xae6f('0x19')],function(_0x2b7bad){return{'model':db[_0x2b7bad['model']],'as':_0x2b7bad['as'],'attributes':_0x2b7bad[_0xae6f('0x1b')],'include':_0x2b7bad['include']?_['map'](_0x2b7bad[_0xae6f('0x19')],function(_0x3c41c4){return{'model':db[_0x3c41c4[_0xae6f('0x1a')]],'as':_0x3c41c4['as'],'attributes':_0x3c41c4['attributes']};}):[]};}):[]};}):[]:[]})[_0xae6f('0x9')](function(_0x417f10){logger[_0xae6f('0xa')]('GetSugarcrmAccount',_0x8462ab);logger[_0xae6f('0xd')]('GetSugarcrmAccount',_0x8462ab,JSON[_0xae6f('0xe')](_0x417f10));_0x2dc403(_0x417f10);})[_0xae6f('0x12')](function(_0x27a2c4){logger[_0xae6f('0xf')](_0xae6f('0x13'),_0x27a2c4['message'],_0x8462ab);_0x1a26ea(_0x107c8a['error'](0x1f4,_0x27a2c4[_0xae6f('0x10')]));});});};exports[_0xae6f('0x1d')]=function(_0x59e8f2){var _0x31df28=this;return new Promise(function(_0x1ff08c,_0x4765e1){return db[_0xae6f('0x14')][_0xae6f('0x1e')]({'raw':_0x59e8f2[_0xae6f('0x15')]?_0x59e8f2['options'][_0xae6f('0x16')]===undefined?!![]:![]:!![],'where':_0x59e8f2[_0xae6f('0x15')]?_0x59e8f2[_0xae6f('0x15')][_0xae6f('0x17')]||null:null,'attributes':_0x59e8f2['options']?_0x59e8f2[_0xae6f('0x15')][_0xae6f('0x1b')]||null:null,'include':_0x59e8f2[_0xae6f('0x15')]?_0x59e8f2[_0xae6f('0x15')][_0xae6f('0x19')]?_[_0xae6f('0x1c')](_0x59e8f2[_0xae6f('0x15')][_0xae6f('0x19')],function(_0x4f4a86){return{'model':db[_0x4f4a86[_0xae6f('0x1a')]],'as':_0x4f4a86['as'],'attributes':_0x4f4a86[_0xae6f('0x1b')],'include':_0x4f4a86[_0xae6f('0x19')]?_['map'](_0x4f4a86[_0xae6f('0x19')],function(_0x338f93){return{'model':db[_0x338f93[_0xae6f('0x1a')]],'as':_0x338f93['as'],'attributes':_0x338f93[_0xae6f('0x1b')],'include':_0x338f93['include']?_[_0xae6f('0x1c')](_0x338f93[_0xae6f('0x19')],function(_0x4615ae){return{'model':db[_0x4615ae[_0xae6f('0x1a')]],'as':_0x4615ae['as'],'attributes':_0x4615ae[_0xae6f('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xae6f('0x9')](function(_0x3c2dc2){logger[_0xae6f('0xa')](_0xae6f('0x1d'),_0x59e8f2);logger[_0xae6f('0xd')](_0xae6f('0x1d'),_0x59e8f2,JSON[_0xae6f('0xe')](_0x3c2dc2));_0x1ff08c(_0x3c2dc2);})[_0xae6f('0x12')](function(_0x49b9e9){logger['error'](_0xae6f('0x1d'),_0x49b9e9[_0xae6f('0x10')],_0x59e8f2);_0x4765e1(_0x31df28[_0xae6f('0xf')](0x1f4,_0x49b9e9[_0xae6f('0x10')]));});});}; \ No newline at end of file +var _0x41c7=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','stringify','error','code','SugarcrmAccount,\x20%s,\x20%s','message','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options','attributes','limit','map','model','include','ShowSugarcrmAccount','find','raw','where','lodash','util','moment','randomstring','../../mysqldb'];(function(_0x98459f,_0x4dfb55){var _0x128f94=function(_0xe6315c){while(--_0xe6315c){_0x98459f['push'](_0x98459f['shift']());}};_0x128f94(++_0x4dfb55);}(_0x41c7,0x171));var _0x741c=function(_0x12126a,_0x439051){_0x12126a=_0x12126a-0x0;var _0x4aa891=_0x41c7[_0x12126a];return _0x4aa891;};'use strict';var _=require(_0x741c('0x0'));var util=require(_0x741c('0x1'));var moment=require(_0x741c('0x2'));var BPromise=require('bluebird');var rs=require(_0x741c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x741c('0x4'))['db'];var utils=require(_0x741c('0x5'));var logger=require('../../config/logger')(_0x741c('0x6'));var config=require(_0x741c('0x7'));var jayson=require(_0x741c('0x8'));var client=jayson[_0x741c('0x9')][_0x741c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1a2626,_0x527029,_0x50b053){return new BPromise(function(_0x1efc61,_0x4f962a){return client['request'](_0x1a2626,_0x50b053)[_0x741c('0xb')](function(_0x310153){logger[_0x741c('0xc')]('SugarcrmAccount,\x20%s,\x20%s',_0x527029,_0x741c('0xd'));logger[_0x741c('0xe')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x527029,_0x741c('0xd'),JSON[_0x741c('0xf')](_0x310153));if(_0x310153[_0x741c('0x10')]){if(_0x310153[_0x741c('0x10')][_0x741c('0x11')]===0x1f4){logger['error'](_0x741c('0x12'),_0x527029,_0x310153[_0x741c('0x10')]['message']);return _0x4f962a(_0x310153[_0x741c('0x10')][_0x741c('0x13')]);}logger['error'](_0x741c('0x12'),_0x527029,_0x310153[_0x741c('0x10')][_0x741c('0x13')]);return _0x1efc61(_0x310153[_0x741c('0x10')][_0x741c('0x13')]);}else{logger[_0x741c('0xc')]('SugarcrmAccount,\x20%s,\x20%s',_0x527029,_0x741c('0xd'));_0x1efc61(_0x310153['result'][_0x741c('0x13')]);}})[_0x741c('0x14')](function(_0x5b900c){logger[_0x741c('0x10')](_0x741c('0x12'),_0x527029,_0x5b900c);_0x4f962a(_0x5b900c);});});}exports[_0x741c('0x15')]=function(_0x19618b){var _0x1d54b9=this;return new Promise(function(_0xb61e92,_0x4f562e){return db[_0x741c('0x16')][_0x741c('0x17')]({'raw':_0x19618b[_0x741c('0x18')]?_0x19618b[_0x741c('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x19618b[_0x741c('0x18')]?_0x19618b['options']['where']||null:null,'attributes':_0x19618b['options']?_0x19618b['options'][_0x741c('0x19')]||null:null,'limit':_0x19618b[_0x741c('0x18')]?_0x19618b['options'][_0x741c('0x1a')]||null:null,'include':_0x19618b[_0x741c('0x18')]?_0x19618b['options']['include']?_[_0x741c('0x1b')](_0x19618b[_0x741c('0x18')]['include'],function(_0x5e1ba0){return{'model':db[_0x5e1ba0[_0x741c('0x1c')]],'as':_0x5e1ba0['as'],'attributes':_0x5e1ba0[_0x741c('0x19')],'include':_0x5e1ba0['include']?_[_0x741c('0x1b')](_0x5e1ba0['include'],function(_0x1864f6){return{'model':db[_0x1864f6[_0x741c('0x1c')]],'as':_0x1864f6['as'],'attributes':_0x1864f6['attributes'],'include':_0x1864f6[_0x741c('0x1d')]?_[_0x741c('0x1b')](_0x1864f6[_0x741c('0x1d')],function(_0x32c68c){return{'model':db[_0x32c68c['model']],'as':_0x32c68c['as'],'attributes':_0x32c68c[_0x741c('0x19')]};}):[]};}):[]};}):[]:[]})[_0x741c('0xb')](function(_0x32a51a){logger['info'](_0x741c('0x15'),_0x19618b);logger[_0x741c('0xe')](_0x741c('0x15'),_0x19618b,JSON[_0x741c('0xf')](_0x32a51a));_0xb61e92(_0x32a51a);})[_0x741c('0x14')](function(_0x26ebe2){logger['error'](_0x741c('0x15'),_0x26ebe2['message'],_0x19618b);_0x4f562e(_0x1d54b9[_0x741c('0x10')](0x1f4,_0x26ebe2[_0x741c('0x13')]));});});};exports[_0x741c('0x1e')]=function(_0x451130){var _0x5ead15=this;return new Promise(function(_0x8fb815,_0x224a58){return db[_0x741c('0x16')][_0x741c('0x1f')]({'raw':_0x451130[_0x741c('0x18')]?_0x451130[_0x741c('0x18')][_0x741c('0x20')]===undefined?!![]:![]:!![],'where':_0x451130[_0x741c('0x18')]?_0x451130[_0x741c('0x18')][_0x741c('0x21')]||null:null,'attributes':_0x451130[_0x741c('0x18')]?_0x451130['options']['attributes']||null:null,'include':_0x451130['options']?_0x451130['options'][_0x741c('0x1d')]?_['map'](_0x451130[_0x741c('0x18')][_0x741c('0x1d')],function(_0xe162){return{'model':db[_0xe162[_0x741c('0x1c')]],'as':_0xe162['as'],'attributes':_0xe162[_0x741c('0x19')],'include':_0xe162[_0x741c('0x1d')]?_[_0x741c('0x1b')](_0xe162[_0x741c('0x1d')],function(_0x3ca671){return{'model':db[_0x3ca671[_0x741c('0x1c')]],'as':_0x3ca671['as'],'attributes':_0x3ca671['attributes'],'include':_0x3ca671[_0x741c('0x1d')]?_[_0x741c('0x1b')](_0x3ca671['include'],function(_0x115610){return{'model':db[_0x115610[_0x741c('0x1c')]],'as':_0x115610['as'],'attributes':_0x115610['attributes']};}):[]};}):[]};}):[]:[]})[_0x741c('0xb')](function(_0x304471){logger[_0x741c('0xc')](_0x741c('0x1e'),_0x451130);logger[_0x741c('0xe')](_0x741c('0x1e'),_0x451130,JSON[_0x741c('0xf')](_0x304471));_0x8fb815(_0x304471);})[_0x741c('0x14')](function(_0x242fa4){logger[_0x741c('0x10')](_0x741c('0x1e'),_0x242fa4[_0x741c('0x13')],_0x451130);_0x224a58(_0x5ead15[_0x741c('0x10')](0x1f4,_0x242fa4['message']));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index 29c99b7..497d533 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 _0x9657=['show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','post','create','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','index','/:id'];(function(_0x53a7a8,_0xed2bff){var _0x555f71=function(_0x48e696){while(--_0x48e696){_0x53a7a8['push'](_0x53a7a8['shift']());}};_0x555f71(++_0xed2bff);}(_0x9657,0x137));var _0x7965=function(_0x5b22c3,_0x2b405c){_0x5b22c3=_0x5b22c3-0x0;var _0x5819d2=_0x9657[_0x5b22c3];return _0x5819d2;};'use strict';var multer=require(_0x7965('0x0'));var util=require(_0x7965('0x1'));var path=require(_0x7965('0x2'));var timeout=require(_0x7965('0x3'));var express=require(_0x7965('0x4'));var router=express[_0x7965('0x5')]();var fs_extra=require(_0x7965('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x7965('0x7'));var config=require(_0x7965('0x8'));var controller=require(_0x7965('0x9'));router[_0x7965('0xa')]('/',auth[_0x7965('0xb')](),controller[_0x7965('0xc')]);router[_0x7965('0xa')](_0x7965('0xd'),auth[_0x7965('0xb')](),controller[_0x7965('0xe')]);router['get'](_0x7965('0xf'),auth[_0x7965('0xb')](),controller[_0x7965('0x10')]);router[_0x7965('0xa')](_0x7965('0x11'),auth[_0x7965('0xb')](),controller[_0x7965('0x12')]);router[_0x7965('0xa')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0x7965('0x13')]);router[_0x7965('0x14')]('/',auth[_0x7965('0xb')](),controller[_0x7965('0x15')]);router['put'](_0x7965('0xd'),auth['isAuthenticated'](),controller[_0x7965('0x16')]);router['delete'](_0x7965('0xd'),auth[_0x7965('0xb')](),controller[_0x7965('0x17')]);module[_0x7965('0x18')]=router; \ No newline at end of file +var _0x18f2=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','create','put','update','delete','destroy','multer','path','connect-timeout','express','Router'];(function(_0x4375fb,_0x22650a){var _0x445a97=function(_0x37e046){while(--_0x37e046){_0x4375fb['push'](_0x4375fb['shift']());}};_0x445a97(++_0x22650a);}(_0x18f2,0x163));var _0x218f=function(_0x297494,_0xa54303){_0x297494=_0x297494-0x0;var _0x3623c8=_0x18f2[_0x297494];return _0x3623c8;};'use strict';var multer=require(_0x218f('0x0'));var util=require('util');var path=require(_0x218f('0x1'));var timeout=require(_0x218f('0x2'));var express=require(_0x218f('0x3'));var router=express[_0x218f('0x4')]();var fs_extra=require(_0x218f('0x5'));var auth=require(_0x218f('0x6'));var interaction=require(_0x218f('0x7'));var config=require(_0x218f('0x8'));var controller=require('./intSugarcrmConfiguration.controller');router[_0x218f('0x9')]('/',auth[_0x218f('0xa')](),controller[_0x218f('0xb')]);router[_0x218f('0x9')](_0x218f('0xc'),auth[_0x218f('0xa')](),controller[_0x218f('0xd')]);router['get'](_0x218f('0xe'),auth['isAuthenticated'](),controller[_0x218f('0xf')]);router[_0x218f('0x9')]('/:id/subjects',auth[_0x218f('0xa')](),controller[_0x218f('0x10')]);router[_0x218f('0x9')](_0x218f('0x11'),auth[_0x218f('0xa')](),controller[_0x218f('0x12')]);router['post']('/',auth[_0x218f('0xa')](),controller[_0x218f('0x13')]);router[_0x218f('0x14')](_0x218f('0xc'),auth['isAuthenticated'](),controller[_0x218f('0x15')]);router[_0x218f('0x16')](_0x218f('0xc'),auth[_0x218f('0xa')](),controller[_0x218f('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index 0411d6b..765f971 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 _0x283f=['exports','STRING','sequelize'];(function(_0x2993ec,_0x55b034){var _0x35411f=function(_0x5986f6){while(--_0x5986f6){_0x2993ec['push'](_0x2993ec['shift']());}};_0x35411f(++_0x55b034);}(_0x283f,0x179));var _0xf283=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x283f[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xf283('0x0'));module[_0xf283('0x1')]={'name':{'type':Sequelize[_0xf283('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xcd80=['sequelize','STRING'];(function(_0x8f7140,_0x521a0f){var _0x50ccc8=function(_0x12e238){while(--_0x12e238){_0x8f7140['push'](_0x8f7140['shift']());}};_0x50ccc8(++_0x521a0f);}(_0xcd80,0x10e));var _0x0cd8=function(_0x33be9d,_0x41618e){_0x33be9d=_0x33be9d-0x0;var _0x4a9267=_0xcd80[_0x33be9d];return _0x4a9267;};'use strict';var Sequelize=require(_0x0cd8('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x0cd8('0x1')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index 82f6b60..4c8e959 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 _0x6f71=['create','body','SugarcrmField','getFields','getSubjects','findOne','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','update','then','destroy','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','SugarcrmConfiguration','includeAll','include','rows','show','params','keys','find','catch'];(function(_0x5e82cc,_0x4aa2f0){var _0x44cfd8=function(_0x5be39b){while(--_0x5be39b){_0x5e82cc['push'](_0x5e82cc['shift']());}};_0x44cfd8(++_0x4aa2f0);}(_0x6f71,0xaf));var _0x16f7=function(_0x477fd9,_0x3ea76a){_0x477fd9=_0x477fd9-0x0;var _0x2e382b=_0x6f71[_0x477fd9];return _0x2e382b;};'use strict';var emlformat=require(_0x16f7('0x0'));var rimraf=require(_0x16f7('0x1'));var zipdir=require(_0x16f7('0x2'));var jsonpatch=require(_0x16f7('0x3'));var rp=require('request-promise');var moment=require(_0x16f7('0x4'));var BPromise=require(_0x16f7('0x5'));var Mustache=require(_0x16f7('0x6'));var util=require(_0x16f7('0x7'));var path=require('path');var sox=require(_0x16f7('0x8'));var csv=require(_0x16f7('0x9'));var ejs=require(_0x16f7('0xa'));var fs=require('fs');var fs_extra=require(_0x16f7('0xb'));var _=require(_0x16f7('0xc'));var squel=require(_0x16f7('0xd'));var crypto=require(_0x16f7('0xe'));var jsforce=require(_0x16f7('0xf'));var deskjs=require(_0x16f7('0x10'));var toCsv=require('to-csv');var querystring=require(_0x16f7('0x11'));var Papa=require(_0x16f7('0x12'));var Redis=require(_0x16f7('0x13'));var authService=require(_0x16f7('0x14'));var qs=require(_0x16f7('0x15'));var as=require(_0x16f7('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x16f7('0x17'))(_0x16f7('0x18'));var utils=require(_0x16f7('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x16f7('0x1a'));var db=require(_0x16f7('0x1b'))['db'];function respondWithStatusCode(_0x40620e,_0x3f6529){_0x3f6529=_0x3f6529||0xcc;return function(_0x1bfd98){if(_0x1bfd98){return _0x40620e[_0x16f7('0x1c')](_0x3f6529);}return _0x40620e[_0x16f7('0x1d')](_0x3f6529)[_0x16f7('0x1e')]();};}function respondWithResult(_0x480b84,_0x5b5ce3){_0x5b5ce3=_0x5b5ce3||0xc8;return function(_0xe68674){if(_0xe68674){return _0x480b84[_0x16f7('0x1d')](_0x5b5ce3)[_0x16f7('0x1f')](_0xe68674);}};}function respondWithFilteredResult(_0x5261c7,_0x4c880e){return function(_0x587804){if(_0x587804){var _0x5ad4f5=typeof _0x4c880e[_0x16f7('0x20')]===_0x16f7('0x21')&&typeof _0x4c880e[_0x16f7('0x22')]===_0x16f7('0x21');var _0x2ef716=_0x587804[_0x16f7('0x23')];var _0xd34ee1=_0x5ad4f5?0x0:_0x4c880e[_0x16f7('0x20')];var _0x58ef82=_0x5ad4f5?_0x587804[_0x16f7('0x23')]:_0x4c880e[_0x16f7('0x20')]+_0x4c880e[_0x16f7('0x22')];var _0x372ae0;if(_0x58ef82>=_0x2ef716){_0x58ef82=_0x2ef716;_0x372ae0=0xc8;}else{_0x372ae0=0xce;}_0x5261c7[_0x16f7('0x1d')](_0x372ae0);return _0x5261c7['set'](_0x16f7('0x24'),_0xd34ee1+'-'+_0x58ef82+'/'+_0x2ef716)['json'](_0x587804);}return null;};}function patchUpdates(_0x5c248c){return function(_0x220197){try{jsonpatch['apply'](_0x220197,_0x5c248c,!![]);}catch(_0x532ff9){return BPromise[_0x16f7('0x25')](_0x532ff9);}return _0x220197['save']();};}function saveUpdates(_0x4c8b5a,_0x17a762){return function(_0x63d380){if(_0x63d380){return _0x63d380[_0x16f7('0x26')](_0x4c8b5a)[_0x16f7('0x27')](function(_0x696c7f){return _0x696c7f;});}return null;};}function removeEntity(_0x429d88,_0x3093ed){return function(_0x440bc3){if(_0x440bc3){return _0x440bc3[_0x16f7('0x28')]()[_0x16f7('0x27')](function(){_0x429d88[_0x16f7('0x1d')](0xcc)[_0x16f7('0x1e')]();});}};}function handleEntityNotFound(_0x4da6ea,_0x9ead4b){return function(_0x3e38a1){if(!_0x3e38a1){_0x4da6ea[_0x16f7('0x1c')](0x194);}return _0x3e38a1;};}function handleError(_0x3cfb6b,_0x35d2f2){_0x35d2f2=_0x35d2f2||0x1f4;return function(_0x2280ca){logger[_0x16f7('0x29')](_0x2280ca[_0x16f7('0x2a')]);if(_0x2280ca[_0x16f7('0x2b')]){delete _0x2280ca['name'];}_0x3cfb6b[_0x16f7('0x1d')](_0x35d2f2)[_0x16f7('0x2c')](_0x2280ca);};}exports[_0x16f7('0x2d')]=function(_0x37287e,_0x5a5e6c){var _0x267048={},_0x21ada7={},_0x5af446={'count':0x0,'rows':[]};var _0x1cebbb=_['map'](db['SugarcrmConfiguration'][_0x16f7('0x2e')],function(_0x12a392){return{'name':_0x12a392[_0x16f7('0x2f')],'type':_0x12a392[_0x16f7('0x30')][_0x16f7('0x31')]};});_0x21ada7[_0x16f7('0x32')]=_['map'](_0x1cebbb,'name');_0x21ada7[_0x16f7('0x33')]=_['keys'](_0x37287e[_0x16f7('0x33')]);_0x21ada7[_0x16f7('0x34')]=_[_0x16f7('0x35')](_0x21ada7[_0x16f7('0x32')],_0x21ada7[_0x16f7('0x33')]);_0x267048[_0x16f7('0x36')]=_[_0x16f7('0x35')](_0x21ada7[_0x16f7('0x32')],qs[_0x16f7('0x37')](_0x37287e[_0x16f7('0x33')][_0x16f7('0x37')]));_0x267048['attributes']=_0x267048['attributes'][_0x16f7('0x38')]?_0x267048[_0x16f7('0x36')]:_0x21ada7[_0x16f7('0x32')];if(!_0x37287e['query'][_0x16f7('0x39')](_0x16f7('0x3a'))){_0x267048[_0x16f7('0x22')]=qs['limit'](_0x37287e[_0x16f7('0x33')][_0x16f7('0x22')]);_0x267048[_0x16f7('0x20')]=qs['offset'](_0x37287e[_0x16f7('0x33')]['offset']);}_0x267048[_0x16f7('0x3b')]=qs['sort'](_0x37287e['query'][_0x16f7('0x3c')]);_0x267048[_0x16f7('0x3d')]=qs['filters'](_[_0x16f7('0x3e')](_0x37287e['query'],_0x21ada7[_0x16f7('0x34')]),_0x1cebbb);if(_0x37287e[_0x16f7('0x33')][_0x16f7('0x3f')]){_0x267048['where']=_[_0x16f7('0x40')](_0x267048[_0x16f7('0x3d')],{'$or':_[_0x16f7('0x41')](_0x1cebbb,function(_0x5510f2){if(_0x5510f2[_0x16f7('0x30')]!==_0x16f7('0x42')){var _0x4b6814={};_0x4b6814[_0x5510f2[_0x16f7('0x2b')]]={'$like':'%'+_0x37287e[_0x16f7('0x33')][_0x16f7('0x3f')]+'%'};return _0x4b6814;}})});}_0x267048=_[_0x16f7('0x40')]({},_0x267048,_0x37287e[_0x16f7('0x43')]);var _0x58d6f0={'where':_0x267048[_0x16f7('0x3d')]};return db[_0x16f7('0x44')]['count'](_0x58d6f0)[_0x16f7('0x27')](function(_0x3c66bb){_0x5af446[_0x16f7('0x23')]=_0x3c66bb;if(_0x37287e[_0x16f7('0x33')][_0x16f7('0x45')]){_0x267048[_0x16f7('0x46')]=[{'all':!![]}];}return db[_0x16f7('0x44')]['findAll'](_0x267048);})[_0x16f7('0x27')](function(_0x150ace){_0x5af446[_0x16f7('0x47')]=_0x150ace;return _0x5af446;})[_0x16f7('0x27')](respondWithFilteredResult(_0x5a5e6c,_0x267048))['catch'](handleError(_0x5a5e6c,null));};exports[_0x16f7('0x48')]=function(_0x2d9e75,_0x2dbe34){var _0x1f027d={'raw':![],'where':{'id':_0x2d9e75[_0x16f7('0x49')]['id']}},_0x4ea672={};_0x4ea672[_0x16f7('0x32')]=_[_0x16f7('0x4a')](db[_0x16f7('0x44')]['rawAttributes']);_0x4ea672[_0x16f7('0x33')]=_[_0x16f7('0x4a')](_0x2d9e75['query']);_0x4ea672[_0x16f7('0x34')]=_[_0x16f7('0x35')](_0x4ea672[_0x16f7('0x32')],_0x4ea672[_0x16f7('0x33')]);_0x1f027d[_0x16f7('0x36')]=_[_0x16f7('0x35')](_0x4ea672[_0x16f7('0x32')],qs['fields'](_0x2d9e75['query']['fields']));_0x1f027d[_0x16f7('0x36')]=_0x1f027d['attributes']['length']?_0x1f027d[_0x16f7('0x36')]:_0x4ea672[_0x16f7('0x32')];if(_0x2d9e75[_0x16f7('0x33')][_0x16f7('0x45')]){_0x1f027d[_0x16f7('0x46')]=[{'all':!![]}];}_0x1f027d=_['merge']({},_0x1f027d,_0x2d9e75['options']);return db[_0x16f7('0x44')][_0x16f7('0x4b')](_0x1f027d)['then'](handleEntityNotFound(_0x2dbe34,null))[_0x16f7('0x27')](respondWithResult(_0x2dbe34,null))[_0x16f7('0x4c')](handleError(_0x2dbe34,null));};exports[_0x16f7('0x4d')]=function(_0x56c7e6,_0x207a3b){return db[_0x16f7('0x44')]['create'](_0x56c7e6['body'],{})[_0x16f7('0x27')](respondWithResult(_0x207a3b,0xc9))[_0x16f7('0x4c')](handleError(_0x207a3b,null));};exports[_0x16f7('0x26')]=function(_0x3775f9,_0x11d304){if(_0x3775f9['body']['id']){delete _0x3775f9[_0x16f7('0x4e')]['id'];}return db[_0x16f7('0x44')][_0x16f7('0x4b')]({'where':{'id':_0x3775f9[_0x16f7('0x49')]['id']}})['then'](handleEntityNotFound(_0x11d304,null))[_0x16f7('0x27')](saveUpdates(_0x3775f9[_0x16f7('0x4e')],null))[_0x16f7('0x27')](respondWithResult(_0x11d304,null))[_0x16f7('0x4c')](handleError(_0x11d304,null));};exports['destroy']=function(_0x5789b0,_0x224945){return db['SugarcrmConfiguration'][_0x16f7('0x4b')]({'where':{'id':_0x5789b0[_0x16f7('0x49')]['id']}})[_0x16f7('0x27')](handleEntityNotFound(_0x224945,null))[_0x16f7('0x27')](removeEntity(_0x224945,null))[_0x16f7('0x4c')](handleError(_0x224945,null));};exports['getFields']=function(_0x18dda0,_0x4812b1,_0x48b781){var _0x156fc4={};var _0x1efb46={};var _0x3e0d33;var _0x37139b;return db[_0x16f7('0x44')]['findOne']({'where':{'id':_0x18dda0[_0x16f7('0x49')]['id']}})[_0x16f7('0x27')](handleEntityNotFound(_0x4812b1,null))['then'](function(_0x5cf8a1){if(_0x5cf8a1){_0x3e0d33=_0x5cf8a1;_0x1efb46[_0x16f7('0x32')]=_['keys'](db[_0x16f7('0x4f')][_0x16f7('0x2e')]);_0x1efb46[_0x16f7('0x33')]=_[_0x16f7('0x4a')](_0x18dda0[_0x16f7('0x33')]);_0x1efb46[_0x16f7('0x34')]=_[_0x16f7('0x35')](_0x1efb46['model'],_0x1efb46[_0x16f7('0x33')]);_0x156fc4[_0x16f7('0x36')]=_[_0x16f7('0x35')](_0x1efb46[_0x16f7('0x32')],qs[_0x16f7('0x37')](_0x18dda0[_0x16f7('0x33')][_0x16f7('0x37')]));_0x156fc4[_0x16f7('0x36')]=_0x156fc4['attributes'][_0x16f7('0x38')]?_0x156fc4[_0x16f7('0x36')]:_0x1efb46['model'];_0x156fc4['order']=qs[_0x16f7('0x3c')](_0x18dda0['query'][_0x16f7('0x3c')]);_0x156fc4[_0x16f7('0x3d')]=qs[_0x16f7('0x34')](_[_0x16f7('0x3e')](_0x18dda0['query'],_0x1efb46[_0x16f7('0x34')]));if(_0x18dda0['query']['filter']){_0x156fc4[_0x16f7('0x3d')]=_[_0x16f7('0x40')](_0x156fc4[_0x16f7('0x3d')],{'$or':_[_0x16f7('0x41')](_0x156fc4[_0x16f7('0x36')],function(_0x5ef4fa){var _0xa0ddf8={};_0xa0ddf8[_0x5ef4fa]={'$like':'%'+_0x18dda0[_0x16f7('0x33')][_0x16f7('0x3f')]+'%'};return _0xa0ddf8;})});}_0x156fc4=_[_0x16f7('0x40')]({},_0x156fc4,_0x18dda0[_0x16f7('0x43')]);return _0x3e0d33[_0x16f7('0x50')](_0x156fc4);}})[_0x16f7('0x27')](function(_0x38786d){if(_0x38786d){_0x37139b=_0x38786d[_0x16f7('0x38')];if(!_0x18dda0[_0x16f7('0x33')][_0x16f7('0x39')](_0x16f7('0x3a'))){_0x156fc4['limit']=qs['limit'](_0x18dda0[_0x16f7('0x33')][_0x16f7('0x22')]);_0x156fc4[_0x16f7('0x20')]=qs[_0x16f7('0x20')](_0x18dda0['query'][_0x16f7('0x20')]);}return _0x3e0d33[_0x16f7('0x50')](_0x156fc4);}})['then'](function(_0x2b1189){if(_0x2b1189){return _0x2b1189?{'count':_0x37139b,'rows':_0x2b1189}:null;}})[_0x16f7('0x27')](respondWithResult(_0x4812b1,null))[_0x16f7('0x4c')](handleError(_0x4812b1,null));};exports[_0x16f7('0x51')]=function(_0x253eba,_0x12346e,_0x9d422c){var _0x24287d={};var _0x204c04={};var _0x3b861c;var _0x59c764;return db[_0x16f7('0x44')]['findOne']({'where':{'id':_0x253eba[_0x16f7('0x49')]['id']}})[_0x16f7('0x27')](handleEntityNotFound(_0x12346e,null))['then'](function(_0x47f152){if(_0x47f152){_0x3b861c=_0x47f152;_0x204c04['model']=_[_0x16f7('0x4a')](db['SugarcrmField'][_0x16f7('0x2e')]);_0x204c04[_0x16f7('0x33')]=_[_0x16f7('0x4a')](_0x253eba[_0x16f7('0x33')]);_0x204c04[_0x16f7('0x34')]=_[_0x16f7('0x35')](_0x204c04[_0x16f7('0x32')],_0x204c04[_0x16f7('0x33')]);_0x24287d[_0x16f7('0x36')]=_[_0x16f7('0x35')](_0x204c04[_0x16f7('0x32')],qs[_0x16f7('0x37')](_0x253eba[_0x16f7('0x33')][_0x16f7('0x37')]));_0x24287d[_0x16f7('0x36')]=_0x24287d[_0x16f7('0x36')]['length']?_0x24287d[_0x16f7('0x36')]:_0x204c04['model'];_0x24287d[_0x16f7('0x3b')]=qs['sort'](_0x253eba[_0x16f7('0x33')][_0x16f7('0x3c')]);_0x24287d['where']=qs['filters'](_[_0x16f7('0x3e')](_0x253eba[_0x16f7('0x33')],_0x204c04[_0x16f7('0x34')]));if(_0x253eba['query']['filter']){_0x24287d['where']=_[_0x16f7('0x40')](_0x24287d[_0x16f7('0x3d')],{'$or':_[_0x16f7('0x41')](_0x24287d['attributes'],function(_0x155d06){var _0x102111={};_0x102111[_0x155d06]={'$like':'%'+_0x253eba[_0x16f7('0x33')]['filter']+'%'};return _0x102111;})});}_0x24287d=_[_0x16f7('0x40')]({},_0x24287d,_0x253eba[_0x16f7('0x43')]);return _0x3b861c[_0x16f7('0x51')](_0x24287d);}})[_0x16f7('0x27')](function(_0x4aec51){if(_0x4aec51){_0x59c764=_0x4aec51['length'];if(!_0x253eba['query'][_0x16f7('0x39')](_0x16f7('0x3a'))){_0x24287d[_0x16f7('0x22')]=qs[_0x16f7('0x22')](_0x253eba[_0x16f7('0x33')][_0x16f7('0x22')]);_0x24287d[_0x16f7('0x20')]=qs['offset'](_0x253eba[_0x16f7('0x33')][_0x16f7('0x20')]);}return _0x3b861c[_0x16f7('0x51')](_0x24287d);}})[_0x16f7('0x27')](function(_0x3cde46){if(_0x3cde46){return _0x3cde46?{'count':_0x59c764,'rows':_0x3cde46}:null;}})[_0x16f7('0x27')](respondWithResult(_0x12346e,null))[_0x16f7('0x4c')](handleError(_0x12346e,null));};exports['getDescriptions']=function(_0xac070a,_0x54a3c0,_0x21758d){var _0x1fa91a={};var _0x18ed9d={};var _0x48928d;var _0x276deb;return db['SugarcrmConfiguration'][_0x16f7('0x52')]({'where':{'id':_0xac070a['params']['id']}})[_0x16f7('0x27')](handleEntityNotFound(_0x54a3c0,null))[_0x16f7('0x27')](function(_0x4c1a73){if(_0x4c1a73){_0x48928d=_0x4c1a73;_0x18ed9d['model']=_['keys'](db[_0x16f7('0x4f')][_0x16f7('0x2e')]);_0x18ed9d[_0x16f7('0x33')]=_[_0x16f7('0x4a')](_0xac070a[_0x16f7('0x33')]);_0x18ed9d[_0x16f7('0x34')]=_[_0x16f7('0x35')](_0x18ed9d[_0x16f7('0x32')],_0x18ed9d['query']);_0x1fa91a[_0x16f7('0x36')]=_[_0x16f7('0x35')](_0x18ed9d['model'],qs[_0x16f7('0x37')](_0xac070a[_0x16f7('0x33')][_0x16f7('0x37')]));_0x1fa91a[_0x16f7('0x36')]=_0x1fa91a[_0x16f7('0x36')]['length']?_0x1fa91a[_0x16f7('0x36')]:_0x18ed9d[_0x16f7('0x32')];_0x1fa91a[_0x16f7('0x3b')]=qs['sort'](_0xac070a[_0x16f7('0x33')]['sort']);_0x1fa91a[_0x16f7('0x3d')]=qs[_0x16f7('0x34')](_[_0x16f7('0x3e')](_0xac070a[_0x16f7('0x33')],_0x18ed9d[_0x16f7('0x34')]));if(_0xac070a[_0x16f7('0x33')]['filter']){_0x1fa91a[_0x16f7('0x3d')]=_[_0x16f7('0x40')](_0x1fa91a['where'],{'$or':_[_0x16f7('0x41')](_0x1fa91a[_0x16f7('0x36')],function(_0xf5bf2c){var _0xbf19a8={};_0xbf19a8[_0xf5bf2c]={'$like':'%'+_0xac070a['query'][_0x16f7('0x3f')]+'%'};return _0xbf19a8;})});}_0x1fa91a=_[_0x16f7('0x40')]({},_0x1fa91a,_0xac070a['options']);return _0x48928d[_0x16f7('0x53')](_0x1fa91a);}})[_0x16f7('0x27')](function(_0x35a77a){if(_0x35a77a){_0x276deb=_0x35a77a['length'];if(!_0xac070a[_0x16f7('0x33')][_0x16f7('0x39')](_0x16f7('0x3a'))){_0x1fa91a[_0x16f7('0x22')]=qs[_0x16f7('0x22')](_0xac070a['query'][_0x16f7('0x22')]);_0x1fa91a[_0x16f7('0x20')]=qs['offset'](_0xac070a[_0x16f7('0x33')][_0x16f7('0x20')]);}return _0x48928d['getDescriptions'](_0x1fa91a);}})[_0x16f7('0x27')](function(_0x595ba9){if(_0x595ba9){return _0x595ba9?{'count':_0x276deb,'rows':_0x595ba9}:null;}})['then'](respondWithResult(_0x54a3c0,null))['catch'](handleError(_0x54a3c0,null));}; \ No newline at end of file +var _0x8949=['catch','show','keys','find','create','body','params','getFields','SugarcrmField','getSubjects','findOne','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','SugarcrmConfiguration','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll'];(function(_0x3f37a0,_0x4f5821){var _0x1c5626=function(_0x298f4e){while(--_0x298f4e){_0x3f37a0['push'](_0x3f37a0['shift']());}};_0x1c5626(++_0x4f5821);}(_0x8949,0xb2));var _0x9894=function(_0x54dcad,_0x554f46){_0x54dcad=_0x54dcad-0x0;var _0x537c56=_0x8949[_0x54dcad];return _0x537c56;};'use strict';var emlformat=require(_0x9894('0x0'));var rimraf=require(_0x9894('0x1'));var zipdir=require(_0x9894('0x2'));var jsonpatch=require(_0x9894('0x3'));var rp=require(_0x9894('0x4'));var moment=require('moment');var BPromise=require(_0x9894('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x9894('0x6'));var sox=require(_0x9894('0x7'));var csv=require(_0x9894('0x8'));var ejs=require(_0x9894('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9894('0xa'));var squel=require(_0x9894('0xb'));var crypto=require(_0x9894('0xc'));var jsforce=require(_0x9894('0xd'));var deskjs=require(_0x9894('0xe'));var toCsv=require(_0x9894('0x8'));var querystring=require(_0x9894('0xf'));var Papa=require(_0x9894('0x10'));var Redis=require('ioredis');var authService=require(_0x9894('0x11'));var qs=require(_0x9894('0x12'));var as=require(_0x9894('0x13'));var hardwareService=require(_0x9894('0x14'));var logger=require('../../config/logger')(_0x9894('0x15'));var utils=require('../../config/utils');var config=require(_0x9894('0x16'));var licenseUtil=require(_0x9894('0x17'));var db=require(_0x9894('0x18'))['db'];function respondWithStatusCode(_0x13d987,_0x56ed73){_0x56ed73=_0x56ed73||0xcc;return function(_0x28d392){if(_0x28d392){return _0x13d987[_0x9894('0x19')](_0x56ed73);}return _0x13d987['status'](_0x56ed73)[_0x9894('0x1a')]();};}function respondWithResult(_0x3712b9,_0x51158c){_0x51158c=_0x51158c||0xc8;return function(_0x2ee2ea){if(_0x2ee2ea){return _0x3712b9['status'](_0x51158c)[_0x9894('0x1b')](_0x2ee2ea);}};}function respondWithFilteredResult(_0x1146b3,_0x210021){return function(_0x23dd10){if(_0x23dd10){var _0x945407=typeof _0x210021[_0x9894('0x1c')]===_0x9894('0x1d')&&typeof _0x210021[_0x9894('0x1e')]===_0x9894('0x1d');var _0x1fa2e8=_0x23dd10[_0x9894('0x1f')];var _0x191e14=_0x945407?0x0:_0x210021[_0x9894('0x1c')];var _0x309198=_0x945407?_0x23dd10['count']:_0x210021[_0x9894('0x1c')]+_0x210021[_0x9894('0x1e')];var _0x4b70dd;if(_0x309198>=_0x1fa2e8){_0x309198=_0x1fa2e8;_0x4b70dd=0xc8;}else{_0x4b70dd=0xce;}_0x1146b3[_0x9894('0x20')](_0x4b70dd);return _0x1146b3[_0x9894('0x21')](_0x9894('0x22'),_0x191e14+'-'+_0x309198+'/'+_0x1fa2e8)['json'](_0x23dd10);}return null;};}function patchUpdates(_0x3d4823){return function(_0xa790cc){try{jsonpatch[_0x9894('0x23')](_0xa790cc,_0x3d4823,!![]);}catch(_0x22074c){return BPromise['reject'](_0x22074c);}return _0xa790cc[_0x9894('0x24')]();};}function saveUpdates(_0x596a21,_0x2f3d7f){return function(_0x1d09a4){if(_0x1d09a4){return _0x1d09a4[_0x9894('0x25')](_0x596a21)[_0x9894('0x26')](function(_0x2049a6){return _0x2049a6;});}return null;};}function removeEntity(_0x2308ad,_0x40dab8){return function(_0xb9cf24){if(_0xb9cf24){return _0xb9cf24[_0x9894('0x27')]()[_0x9894('0x26')](function(){_0x2308ad[_0x9894('0x20')](0xcc)[_0x9894('0x1a')]();});}};}function handleEntityNotFound(_0x1297f0,_0x1e1555){return function(_0x2f0a82){if(!_0x2f0a82){_0x1297f0[_0x9894('0x19')](0x194);}return _0x2f0a82;};}function handleError(_0x300eb8,_0x1a4bcd){_0x1a4bcd=_0x1a4bcd||0x1f4;return function(_0x4756b1){logger[_0x9894('0x28')](_0x4756b1[_0x9894('0x29')]);if(_0x4756b1[_0x9894('0x2a')]){delete _0x4756b1[_0x9894('0x2a')];}_0x300eb8['status'](_0x1a4bcd)[_0x9894('0x2b')](_0x4756b1);};}exports[_0x9894('0x2c')]=function(_0x5818f5,_0x3dce87){var _0x5c1d90={},_0x8de0a7={},_0x399b15={'count':0x0,'rows':[]};var _0x4a7a0f=_[_0x9894('0x2d')](db[_0x9894('0x2e')][_0x9894('0x2f')],function(_0x211dc7){return{'name':_0x211dc7[_0x9894('0x30')],'type':_0x211dc7[_0x9894('0x31')][_0x9894('0x32')]};});_0x8de0a7['model']=_[_0x9894('0x2d')](_0x4a7a0f,_0x9894('0x2a'));_0x8de0a7[_0x9894('0x33')]=_['keys'](_0x5818f5['query']);_0x8de0a7[_0x9894('0x34')]=_[_0x9894('0x35')](_0x8de0a7[_0x9894('0x36')],_0x8de0a7['query']);_0x5c1d90[_0x9894('0x37')]=_[_0x9894('0x35')](_0x8de0a7[_0x9894('0x36')],qs[_0x9894('0x38')](_0x5818f5[_0x9894('0x33')][_0x9894('0x38')]));_0x5c1d90[_0x9894('0x37')]=_0x5c1d90[_0x9894('0x37')][_0x9894('0x39')]?_0x5c1d90[_0x9894('0x37')]:_0x8de0a7['model'];if(!_0x5818f5['query'][_0x9894('0x3a')](_0x9894('0x3b'))){_0x5c1d90[_0x9894('0x1e')]=qs[_0x9894('0x1e')](_0x5818f5[_0x9894('0x33')][_0x9894('0x1e')]);_0x5c1d90[_0x9894('0x1c')]=qs[_0x9894('0x1c')](_0x5818f5[_0x9894('0x33')][_0x9894('0x1c')]);}_0x5c1d90[_0x9894('0x3c')]=qs[_0x9894('0x3d')](_0x5818f5[_0x9894('0x33')][_0x9894('0x3d')]);_0x5c1d90[_0x9894('0x3e')]=qs['filters'](_[_0x9894('0x3f')](_0x5818f5[_0x9894('0x33')],_0x8de0a7[_0x9894('0x34')]),_0x4a7a0f);if(_0x5818f5[_0x9894('0x33')]['filter']){_0x5c1d90[_0x9894('0x3e')]=_[_0x9894('0x40')](_0x5c1d90[_0x9894('0x3e')],{'$or':_[_0x9894('0x2d')](_0x4a7a0f,function(_0x22446d){if(_0x22446d[_0x9894('0x31')]!==_0x9894('0x41')){var _0x39c63e={};_0x39c63e[_0x22446d['name']]={'$like':'%'+_0x5818f5[_0x9894('0x33')][_0x9894('0x42')]+'%'};return _0x39c63e;}})});}_0x5c1d90=_['merge']({},_0x5c1d90,_0x5818f5[_0x9894('0x43')]);var _0x271f8d={'where':_0x5c1d90[_0x9894('0x3e')]};return db[_0x9894('0x2e')][_0x9894('0x1f')](_0x271f8d)['then'](function(_0x132f7f){_0x399b15['count']=_0x132f7f;if(_0x5818f5[_0x9894('0x33')][_0x9894('0x44')]){_0x5c1d90[_0x9894('0x45')]=[{'all':!![]}];}return db[_0x9894('0x2e')][_0x9894('0x46')](_0x5c1d90);})['then'](function(_0x5c000a){_0x399b15['rows']=_0x5c000a;return _0x399b15;})['then'](respondWithFilteredResult(_0x3dce87,_0x5c1d90))[_0x9894('0x47')](handleError(_0x3dce87,null));};exports[_0x9894('0x48')]=function(_0xaca7bd,_0x10e8c7){var _0x3023f2={'raw':![],'where':{'id':_0xaca7bd['params']['id']}},_0x2747dc={};_0x2747dc[_0x9894('0x36')]=_[_0x9894('0x49')](db['SugarcrmConfiguration'][_0x9894('0x2f')]);_0x2747dc[_0x9894('0x33')]=_[_0x9894('0x49')](_0xaca7bd[_0x9894('0x33')]);_0x2747dc[_0x9894('0x34')]=_['intersection'](_0x2747dc[_0x9894('0x36')],_0x2747dc['query']);_0x3023f2[_0x9894('0x37')]=_[_0x9894('0x35')](_0x2747dc['model'],qs[_0x9894('0x38')](_0xaca7bd[_0x9894('0x33')][_0x9894('0x38')]));_0x3023f2[_0x9894('0x37')]=_0x3023f2[_0x9894('0x37')]['length']?_0x3023f2[_0x9894('0x37')]:_0x2747dc[_0x9894('0x36')];if(_0xaca7bd[_0x9894('0x33')][_0x9894('0x44')]){_0x3023f2[_0x9894('0x45')]=[{'all':!![]}];}_0x3023f2=_[_0x9894('0x40')]({},_0x3023f2,_0xaca7bd[_0x9894('0x43')]);return db['SugarcrmConfiguration'][_0x9894('0x4a')](_0x3023f2)[_0x9894('0x26')](handleEntityNotFound(_0x10e8c7,null))[_0x9894('0x26')](respondWithResult(_0x10e8c7,null))[_0x9894('0x47')](handleError(_0x10e8c7,null));};exports['create']=function(_0x4278c9,_0x359837){return db[_0x9894('0x2e')][_0x9894('0x4b')](_0x4278c9[_0x9894('0x4c')],{})[_0x9894('0x26')](respondWithResult(_0x359837,0xc9))[_0x9894('0x47')](handleError(_0x359837,null));};exports[_0x9894('0x25')]=function(_0x262638,_0xe1b5f4){if(_0x262638[_0x9894('0x4c')]['id']){delete _0x262638[_0x9894('0x4c')]['id'];}return db[_0x9894('0x2e')][_0x9894('0x4a')]({'where':{'id':_0x262638['params']['id']}})[_0x9894('0x26')](handleEntityNotFound(_0xe1b5f4,null))[_0x9894('0x26')](saveUpdates(_0x262638[_0x9894('0x4c')],null))[_0x9894('0x26')](respondWithResult(_0xe1b5f4,null))[_0x9894('0x47')](handleError(_0xe1b5f4,null));};exports[_0x9894('0x27')]=function(_0x355fca,_0x61eb63){return db[_0x9894('0x2e')][_0x9894('0x4a')]({'where':{'id':_0x355fca[_0x9894('0x4d')]['id']}})[_0x9894('0x26')](handleEntityNotFound(_0x61eb63,null))['then'](removeEntity(_0x61eb63,null))[_0x9894('0x47')](handleError(_0x61eb63,null));};exports[_0x9894('0x4e')]=function(_0x51575c,_0x34619e,_0x29030a){var _0x1c2fc4={};var _0x3b7ea5={};var _0x5b5244;var _0x2d2751;return db[_0x9894('0x2e')]['findOne']({'where':{'id':_0x51575c[_0x9894('0x4d')]['id']}})[_0x9894('0x26')](handleEntityNotFound(_0x34619e,null))[_0x9894('0x26')](function(_0x115a76){if(_0x115a76){_0x5b5244=_0x115a76;_0x3b7ea5['model']=_[_0x9894('0x49')](db[_0x9894('0x4f')][_0x9894('0x2f')]);_0x3b7ea5[_0x9894('0x33')]=_[_0x9894('0x49')](_0x51575c[_0x9894('0x33')]);_0x3b7ea5['filters']=_[_0x9894('0x35')](_0x3b7ea5['model'],_0x3b7ea5['query']);_0x1c2fc4[_0x9894('0x37')]=_[_0x9894('0x35')](_0x3b7ea5['model'],qs[_0x9894('0x38')](_0x51575c[_0x9894('0x33')][_0x9894('0x38')]));_0x1c2fc4[_0x9894('0x37')]=_0x1c2fc4[_0x9894('0x37')]['length']?_0x1c2fc4[_0x9894('0x37')]:_0x3b7ea5[_0x9894('0x36')];_0x1c2fc4[_0x9894('0x3c')]=qs[_0x9894('0x3d')](_0x51575c['query'][_0x9894('0x3d')]);_0x1c2fc4['where']=qs['filters'](_[_0x9894('0x3f')](_0x51575c[_0x9894('0x33')],_0x3b7ea5[_0x9894('0x34')]));if(_0x51575c[_0x9894('0x33')][_0x9894('0x42')]){_0x1c2fc4[_0x9894('0x3e')]=_[_0x9894('0x40')](_0x1c2fc4[_0x9894('0x3e')],{'$or':_[_0x9894('0x2d')](_0x1c2fc4[_0x9894('0x37')],function(_0x44e344){var _0x42d418={};_0x42d418[_0x44e344]={'$like':'%'+_0x51575c['query'][_0x9894('0x42')]+'%'};return _0x42d418;})});}_0x1c2fc4=_['merge']({},_0x1c2fc4,_0x51575c[_0x9894('0x43')]);return _0x5b5244[_0x9894('0x4e')](_0x1c2fc4);}})[_0x9894('0x26')](function(_0x5f1b5d){if(_0x5f1b5d){_0x2d2751=_0x5f1b5d['length'];if(!_0x51575c[_0x9894('0x33')][_0x9894('0x3a')](_0x9894('0x3b'))){_0x1c2fc4[_0x9894('0x1e')]=qs[_0x9894('0x1e')](_0x51575c[_0x9894('0x33')][_0x9894('0x1e')]);_0x1c2fc4[_0x9894('0x1c')]=qs[_0x9894('0x1c')](_0x51575c['query'][_0x9894('0x1c')]);}return _0x5b5244['getFields'](_0x1c2fc4);}})[_0x9894('0x26')](function(_0x301c63){if(_0x301c63){return _0x301c63?{'count':_0x2d2751,'rows':_0x301c63}:null;}})['then'](respondWithResult(_0x34619e,null))[_0x9894('0x47')](handleError(_0x34619e,null));};exports[_0x9894('0x50')]=function(_0x50d4a7,_0x2e09bc,_0x1361f9){var _0x2d69b0={};var _0x15b6de={};var _0x469e0c;var _0x4fd9aa;return db[_0x9894('0x2e')][_0x9894('0x51')]({'where':{'id':_0x50d4a7[_0x9894('0x4d')]['id']}})['then'](handleEntityNotFound(_0x2e09bc,null))['then'](function(_0x535ff7){if(_0x535ff7){_0x469e0c=_0x535ff7;_0x15b6de[_0x9894('0x36')]=_[_0x9894('0x49')](db['SugarcrmField'][_0x9894('0x2f')]);_0x15b6de['query']=_[_0x9894('0x49')](_0x50d4a7['query']);_0x15b6de[_0x9894('0x34')]=_[_0x9894('0x35')](_0x15b6de[_0x9894('0x36')],_0x15b6de[_0x9894('0x33')]);_0x2d69b0[_0x9894('0x37')]=_[_0x9894('0x35')](_0x15b6de[_0x9894('0x36')],qs['fields'](_0x50d4a7['query']['fields']));_0x2d69b0['attributes']=_0x2d69b0['attributes'][_0x9894('0x39')]?_0x2d69b0[_0x9894('0x37')]:_0x15b6de[_0x9894('0x36')];_0x2d69b0[_0x9894('0x3c')]=qs[_0x9894('0x3d')](_0x50d4a7[_0x9894('0x33')][_0x9894('0x3d')]);_0x2d69b0['where']=qs[_0x9894('0x34')](_['pick'](_0x50d4a7[_0x9894('0x33')],_0x15b6de[_0x9894('0x34')]));if(_0x50d4a7[_0x9894('0x33')][_0x9894('0x42')]){_0x2d69b0[_0x9894('0x3e')]=_[_0x9894('0x40')](_0x2d69b0[_0x9894('0x3e')],{'$or':_['map'](_0x2d69b0[_0x9894('0x37')],function(_0xc83633){var _0x308f95={};_0x308f95[_0xc83633]={'$like':'%'+_0x50d4a7['query']['filter']+'%'};return _0x308f95;})});}_0x2d69b0=_[_0x9894('0x40')]({},_0x2d69b0,_0x50d4a7['options']);return _0x469e0c['getSubjects'](_0x2d69b0);}})[_0x9894('0x26')](function(_0x157ed8){if(_0x157ed8){_0x4fd9aa=_0x157ed8['length'];if(!_0x50d4a7[_0x9894('0x33')][_0x9894('0x3a')](_0x9894('0x3b'))){_0x2d69b0[_0x9894('0x1e')]=qs[_0x9894('0x1e')](_0x50d4a7['query'][_0x9894('0x1e')]);_0x2d69b0['offset']=qs[_0x9894('0x1c')](_0x50d4a7[_0x9894('0x33')][_0x9894('0x1c')]);}return _0x469e0c['getSubjects'](_0x2d69b0);}})[_0x9894('0x26')](function(_0x509e1f){if(_0x509e1f){return _0x509e1f?{'count':_0x4fd9aa,'rows':_0x509e1f}:null;}})[_0x9894('0x26')](respondWithResult(_0x2e09bc,null))['catch'](handleError(_0x2e09bc,null));};exports['getDescriptions']=function(_0x2ed6ae,_0x32b838,_0x27706d){var _0x473125={};var _0x3294d={};var _0x3efa33;var _0x55c827;return db[_0x9894('0x2e')][_0x9894('0x51')]({'where':{'id':_0x2ed6ae[_0x9894('0x4d')]['id']}})[_0x9894('0x26')](handleEntityNotFound(_0x32b838,null))[_0x9894('0x26')](function(_0x572f9c){if(_0x572f9c){_0x3efa33=_0x572f9c;_0x3294d[_0x9894('0x36')]=_[_0x9894('0x49')](db['SugarcrmField'][_0x9894('0x2f')]);_0x3294d['query']=_[_0x9894('0x49')](_0x2ed6ae[_0x9894('0x33')]);_0x3294d[_0x9894('0x34')]=_['intersection'](_0x3294d[_0x9894('0x36')],_0x3294d['query']);_0x473125[_0x9894('0x37')]=_[_0x9894('0x35')](_0x3294d['model'],qs['fields'](_0x2ed6ae['query'][_0x9894('0x38')]));_0x473125[_0x9894('0x37')]=_0x473125[_0x9894('0x37')]['length']?_0x473125[_0x9894('0x37')]:_0x3294d[_0x9894('0x36')];_0x473125[_0x9894('0x3c')]=qs[_0x9894('0x3d')](_0x2ed6ae[_0x9894('0x33')][_0x9894('0x3d')]);_0x473125[_0x9894('0x3e')]=qs[_0x9894('0x34')](_[_0x9894('0x3f')](_0x2ed6ae[_0x9894('0x33')],_0x3294d[_0x9894('0x34')]));if(_0x2ed6ae[_0x9894('0x33')][_0x9894('0x42')]){_0x473125[_0x9894('0x3e')]=_['merge'](_0x473125[_0x9894('0x3e')],{'$or':_[_0x9894('0x2d')](_0x473125[_0x9894('0x37')],function(_0x85694b){var _0x3d31d3={};_0x3d31d3[_0x85694b]={'$like':'%'+_0x2ed6ae[_0x9894('0x33')][_0x9894('0x42')]+'%'};return _0x3d31d3;})});}_0x473125=_[_0x9894('0x40')]({},_0x473125,_0x2ed6ae['options']);return _0x3efa33[_0x9894('0x52')](_0x473125);}})['then'](function(_0x81f70c){if(_0x81f70c){_0x55c827=_0x81f70c[_0x9894('0x39')];if(!_0x2ed6ae[_0x9894('0x33')][_0x9894('0x3a')](_0x9894('0x3b'))){_0x473125[_0x9894('0x1e')]=qs[_0x9894('0x1e')](_0x2ed6ae['query'][_0x9894('0x1e')]);_0x473125[_0x9894('0x1c')]=qs[_0x9894('0x1c')](_0x2ed6ae['query'][_0x9894('0x1c')]);}return _0x3efa33[_0x9894('0x52')](_0x473125);}})[_0x9894('0x26')](function(_0x4d6fd7){if(_0x4d6fd7){return _0x4d6fd7?{'count':_0x55c827,'rows':_0x4d6fd7}:null;}})[_0x9894('0x26')](respondWithResult(_0x32b838,null))[_0x9894('0x47')](handleError(_0x32b838,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 2ba7573..969746a 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 _0xf167=['../../config/environment','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x56c844,_0x2bdc63){var _0x7b48b3=function(_0xe25dd6){while(--_0xe25dd6){_0x56c844['push'](_0x56c844['shift']());}};_0x7b48b3(++_0x2bdc63);}(_0xf167,0x87));var _0x7f16=function(_0x119880,_0x4f291f){_0x119880=_0x119880-0x0;var _0x4a1707=_0xf167[_0x119880];return _0x4a1707;};'use strict';var _=require(_0x7f16('0x0'));var util=require(_0x7f16('0x1'));var logger=require(_0x7f16('0x2'))('api');var moment=require(_0x7f16('0x3'));var BPromise=require(_0x7f16('0x4'));var rp=require(_0x7f16('0x5'));var fs=require('fs');var path=require(_0x7f16('0x6'));var rimraf=require(_0x7f16('0x7'));var config=require(_0x7f16('0x8'));var attributes=require('./intSugarcrmConfiguration.attributes');module['exports']=function(_0xee3b27,_0x10c28e){return _0xee3b27['define'](_0x7f16('0x9'),attributes,{'tableName':_0x7f16('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfa3f=['lodash','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./intSugarcrmConfiguration.attributes','exports','SugarcrmConfiguration','int_sugarcrm_configurations'];(function(_0x51bda1,_0x44f80d){var _0x1ce08c=function(_0x5b788e){while(--_0x5b788e){_0x51bda1['push'](_0x51bda1['shift']());}};_0x1ce08c(++_0x44f80d);}(_0xfa3f,0xb0));var _0xffa3=function(_0x3f0fce,_0x47a1b1){_0x3f0fce=_0x3f0fce-0x0;var _0x39b20a=_0xfa3f[_0x3f0fce];return _0x39b20a;};'use strict';var _=require(_0xffa3('0x0'));var util=require('util');var logger=require(_0xffa3('0x1'))(_0xffa3('0x2'));var moment=require('moment');var BPromise=require(_0xffa3('0x3'));var rp=require(_0xffa3('0x4'));var fs=require('fs');var path=require(_0xffa3('0x5'));var rimraf=require('rimraf');var config=require(_0xffa3('0x6'));var attributes=require(_0xffa3('0x7'));module[_0xffa3('0x8')]=function(_0x538359,_0xc54814){return _0x538359['define'](_0xffa3('0x9'),attributes,{'tableName':_0xffa3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js index 5ef5dc6..9c0cfff 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 _0xa6cc=['error','code','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','jayson/promise','http','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x2b869b,_0x2c4e2e){var _0x15e9c5=function(_0x5343f4){while(--_0x5343f4){_0x2b869b['push'](_0x2b869b['shift']());}};_0x15e9c5(++_0x2c4e2e);}(_0xa6cc,0xa5));var _0xca6c=function(_0x2f0162,_0x561c38){_0x2f0162=_0x2f0162-0x0;var _0x4becec=_0xa6cc[_0x2f0162];return _0x4becec;};'use strict';var _=require(_0xca6c('0x0'));var util=require(_0xca6c('0x1'));var moment=require(_0xca6c('0x2'));var BPromise=require(_0xca6c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xca6c('0x4'))['db'];var utils=require(_0xca6c('0x5'));var logger=require('../../config/logger')(_0xca6c('0x6'));var config=require('../../config/environment');var jayson=require(_0xca6c('0x7'));var client=jayson['client'][_0xca6c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2931cb,_0x245dd0,_0x1e6be7){return new BPromise(function(_0x5a0797,_0x1623a8){return client['request'](_0x2931cb,_0x1e6be7)[_0xca6c('0x9')](function(_0x2a2c66){logger[_0xca6c('0xa')](_0xca6c('0xb'),_0x245dd0,_0xca6c('0xc'));logger[_0xca6c('0xd')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x245dd0,'request\x20sent',JSON[_0xca6c('0xe')](_0x2a2c66));if(_0x2a2c66[_0xca6c('0xf')]){if(_0x2a2c66[_0xca6c('0xf')][_0xca6c('0x10')]===0x1f4){logger[_0xca6c('0xf')](_0xca6c('0xb'),_0x245dd0,_0x2a2c66[_0xca6c('0xf')][_0xca6c('0x11')]);return _0x1623a8(_0x2a2c66[_0xca6c('0xf')]['message']);}logger[_0xca6c('0xf')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x245dd0,_0x2a2c66['error'][_0xca6c('0x11')]);return _0x5a0797(_0x2a2c66[_0xca6c('0xf')][_0xca6c('0x11')]);}else{logger[_0xca6c('0xa')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x245dd0,_0xca6c('0xc'));_0x5a0797(_0x2a2c66[_0xca6c('0x12')][_0xca6c('0x11')]);}})[_0xca6c('0x13')](function(_0x4a44aa){logger[_0xca6c('0xf')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x245dd0,_0x4a44aa);_0x1623a8(_0x4a44aa);});});} \ No newline at end of file +var _0xa244=['info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x5822a6,_0xaf45ef){var _0x1cb200=function(_0x54834f){while(--_0x54834f){_0x5822a6['push'](_0x5822a6['shift']());}};_0x1cb200(++_0xaf45ef);}(_0xa244,0x1a8));var _0x4a24=function(_0x5a3169,_0xf62d84){_0x5a3169=_0x5a3169-0x0;var _0x3524a3=_0xa244[_0x5a3169];return _0x3524a3;};'use strict';var _=require(_0x4a24('0x0'));var util=require(_0x4a24('0x1'));var moment=require('moment');var BPromise=require(_0x4a24('0x2'));var rs=require(_0x4a24('0x3'));var fs=require('fs');var Redis=require(_0x4a24('0x4'));var db=require(_0x4a24('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x4a24('0x6'))(_0x4a24('0x7'));var config=require(_0x4a24('0x8'));var jayson=require(_0x4a24('0x9'));var client=jayson['client'][_0x4a24('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x37ce58,_0x740e0f,_0x33a355){return new BPromise(function(_0xf6ad16,_0x1f0649){return client[_0x4a24('0xb')](_0x37ce58,_0x33a355)[_0x4a24('0xc')](function(_0x5f59e2){logger[_0x4a24('0xd')](_0x4a24('0xe'),_0x740e0f,_0x4a24('0xf'));logger[_0x4a24('0x10')](_0x4a24('0x11'),_0x740e0f,'request\x20sent',JSON[_0x4a24('0x12')](_0x5f59e2));if(_0x5f59e2[_0x4a24('0x13')]){if(_0x5f59e2['error'][_0x4a24('0x14')]===0x1f4){logger[_0x4a24('0x13')](_0x4a24('0xe'),_0x740e0f,_0x5f59e2['error'][_0x4a24('0x15')]);return _0x1f0649(_0x5f59e2[_0x4a24('0x13')][_0x4a24('0x15')]);}logger[_0x4a24('0x13')](_0x4a24('0xe'),_0x740e0f,_0x5f59e2['error'][_0x4a24('0x15')]);return _0xf6ad16(_0x5f59e2[_0x4a24('0x13')]['message']);}else{logger[_0x4a24('0xd')](_0x4a24('0xe'),_0x740e0f,_0x4a24('0xf'));_0xf6ad16(_0x5f59e2['result'][_0x4a24('0x15')]);}})[_0x4a24('0x16')](function(_0x1d4c95){logger['error'](_0x4a24('0xe'),_0x740e0f,_0x1d4c95);_0x1f0649(_0x1d4c95);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index 1f41af2..9d16585 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 _0x8d80=['util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get','index','/:id','isAuthenticated','post','create','put','update','delete','exports'];(function(_0x4bd72a,_0x290e24){var _0x2c0638=function(_0x2fe441){while(--_0x2fe441){_0x4bd72a['push'](_0x4bd72a['shift']());}};_0x2c0638(++_0x290e24);}(_0x8d80,0x1db));var _0x08d8=function(_0x20c836,_0x44bfa5){_0x20c836=_0x20c836-0x0;var _0x25f8e1=_0x8d80[_0x20c836];return _0x25f8e1;};'use strict';var multer=require('multer');var util=require(_0x08d8('0x0'));var path=require(_0x08d8('0x1'));var timeout=require(_0x08d8('0x2'));var express=require(_0x08d8('0x3'));var router=express[_0x08d8('0x4')]();var fs_extra=require(_0x08d8('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x08d8('0x6'));var config=require(_0x08d8('0x7'));var controller=require(_0x08d8('0x8'));router[_0x08d8('0x9')]('/',auth['isAuthenticated'](),controller[_0x08d8('0xa')]);router[_0x08d8('0x9')](_0x08d8('0xb'),auth[_0x08d8('0xc')](),controller['show']);router[_0x08d8('0xd')]('/',auth[_0x08d8('0xc')](),controller[_0x08d8('0xe')]);router[_0x08d8('0xf')](_0x08d8('0xb'),auth[_0x08d8('0xc')](),controller[_0x08d8('0x10')]);router[_0x08d8('0x11')](_0x08d8('0xb'),auth[_0x08d8('0xc')](),controller['destroy']);module[_0x08d8('0x12')]=router; \ No newline at end of file +var _0x1d49=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','index','show','post','create','/:id','update','delete','destroy'];(function(_0x39b243,_0x54161f){var _0x26a069=function(_0x3e198f){while(--_0x3e198f){_0x39b243['push'](_0x39b243['shift']());}};_0x26a069(++_0x54161f);}(_0x1d49,0xbe));var _0x91d4=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x1d49[_0x3ab51d];return _0x29a04e;};'use strict';var multer=require(_0x91d4('0x0'));var util=require(_0x91d4('0x1'));var path=require(_0x91d4('0x2'));var timeout=require(_0x91d4('0x3'));var express=require(_0x91d4('0x4'));var router=express[_0x91d4('0x5')]();var fs_extra=require(_0x91d4('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x91d4('0x7'));var config=require(_0x91d4('0x8'));var controller=require(_0x91d4('0x9'));router[_0x91d4('0xa')]('/',auth[_0x91d4('0xb')](),controller[_0x91d4('0xc')]);router[_0x91d4('0xa')]('/:id',auth[_0x91d4('0xb')](),controller[_0x91d4('0xd')]);router[_0x91d4('0xe')]('/',auth['isAuthenticated'](),controller[_0x91d4('0xf')]);router['put'](_0x91d4('0x10'),auth[_0x91d4('0xb')](),controller[_0x91d4('0x11')]);router[_0x91d4('0x12')](_0x91d4('0x10'),auth[_0x91d4('0xb')](),controller[_0x91d4('0x13')]);module[_0x91d4('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index 3f4f9d8..59e883f 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 _0x37da=['exports','ENUM','variable','customVariable','keyValue','picklist','string','STRING','BOOLEAN'];(function(_0x26b288,_0x109285){var _0x3f6159=function(_0x5b4a4c){while(--_0x5b4a4c){_0x26b288['push'](_0x26b288['shift']());}};_0x3f6159(++_0x109285);}(_0x37da,0x183));var _0xa37d=function(_0x3ca7c7,_0x43922f){_0x3ca7c7=_0x3ca7c7-0x0;var _0x2a4fc4=_0x37da[_0x3ca7c7];return _0x2a4fc4;};'use strict';var Sequelize=require('sequelize');module[_0xa37d('0x0')]={'type':{'type':Sequelize[_0xa37d('0x1')]('string',_0xa37d('0x2'),_0xa37d('0x3'),_0xa37d('0x4'),_0xa37d('0x5')),'defaultValue':_0xa37d('0x6')},'content':{'type':Sequelize[_0xa37d('0x7')]},'key':{'type':Sequelize[_0xa37d('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0xa37d('0x6'),_0xa37d('0x2'),_0xa37d('0x3'))},'keyContent':{'type':Sequelize[_0xa37d('0x7')]},'idField':{'type':Sequelize[_0xa37d('0x7')]},'nameField':{'type':Sequelize[_0xa37d('0x7')]},'customField':{'type':Sequelize[_0xa37d('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa37d('0x7')]}}; \ No newline at end of file +var _0x32c4=['string','STRING','BOOLEAN','sequelize','exports','variable','customVariable','keyValue','picklist','ENUM'];(function(_0x1cc1dd,_0x5a117b){var _0x5a5fbe=function(_0x438b23){while(--_0x438b23){_0x1cc1dd['push'](_0x1cc1dd['shift']());}};_0x5a5fbe(++_0x5a117b);}(_0x32c4,0x107));var _0x432c=function(_0x3a9e52,_0x4eafac){_0x3a9e52=_0x3a9e52-0x0;var _0x51e798=_0x32c4[_0x3a9e52];return _0x51e798;};'use strict';var Sequelize=require(_0x432c('0x0'));module[_0x432c('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0x432c('0x2'),_0x432c('0x3'),_0x432c('0x4'),_0x432c('0x5')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x432c('0x6')](_0x432c('0x7'),'variable','customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x432c('0x8')]},'customField':{'type':Sequelize[_0x432c('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x432c('0x8')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index 88a7003..332f682 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 _0x51ab=['../../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','name','index','map','SugarcrmField','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','findAll','rows','catch','show','params','rawAttributes','include','options','find','create','body','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x381b3e,_0x28c37a){var _0x4d0e65=function(_0x45bf84){while(--_0x45bf84){_0x381b3e['push'](_0x381b3e['shift']());}};_0x4d0e65(++_0x28c37a);}(_0x51ab,0xcd));var _0xb51a=function(_0x19f002,_0x56d27c){_0x19f002=_0x19f002-0x0;var _0x1c195e=_0x51ab[_0x19f002];return _0x1c195e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb51a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb51a('0x1'));var rp=require('request-promise');var moment=require(_0xb51a('0x2'));var BPromise=require(_0xb51a('0x3'));var Mustache=require(_0xb51a('0x4'));var util=require(_0xb51a('0x5'));var path=require(_0xb51a('0x6'));var sox=require(_0xb51a('0x7'));var csv=require(_0xb51a('0x8'));var ejs=require(_0xb51a('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb51a('0xa'));var squel=require(_0xb51a('0xb'));var crypto=require(_0xb51a('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xb51a('0xd'));var toCsv=require(_0xb51a('0x8'));var querystring=require(_0xb51a('0xe'));var Papa=require(_0xb51a('0xf'));var Redis=require(_0xb51a('0x10'));var authService=require(_0xb51a('0x11'));var qs=require(_0xb51a('0x12'));var as=require(_0xb51a('0x13'));var hardwareService=require(_0xb51a('0x14'));var logger=require(_0xb51a('0x15'))(_0xb51a('0x16'));var utils=require(_0xb51a('0x17'));var config=require(_0xb51a('0x18'));var licenseUtil=require(_0xb51a('0x19'));var db=require(_0xb51a('0x1a'))['db'];function respondWithStatusCode(_0x1e9a0b,_0x339724){_0x339724=_0x339724||0xcc;return function(_0x4910d4){if(_0x4910d4){return _0x1e9a0b[_0xb51a('0x1b')](_0x339724);}return _0x1e9a0b[_0xb51a('0x1c')](_0x339724)[_0xb51a('0x1d')]();};}function respondWithResult(_0x1a59b7,_0x46b9b8){_0x46b9b8=_0x46b9b8||0xc8;return function(_0x434813){if(_0x434813){return _0x1a59b7[_0xb51a('0x1c')](_0x46b9b8)[_0xb51a('0x1e')](_0x434813);}};}function respondWithFilteredResult(_0x532e9f,_0x52bcf8){return function(_0x36556f){if(_0x36556f){var _0x218fc3=typeof _0x52bcf8[_0xb51a('0x1f')]===_0xb51a('0x20')&&typeof _0x52bcf8['limit']===_0xb51a('0x20');var _0x288368=_0x36556f[_0xb51a('0x21')];var _0x47b2fd=_0x218fc3?0x0:_0x52bcf8[_0xb51a('0x1f')];var _0x5d2e6d=_0x218fc3?_0x36556f[_0xb51a('0x21')]:_0x52bcf8[_0xb51a('0x1f')]+_0x52bcf8[_0xb51a('0x22')];var _0x30237f;if(_0x5d2e6d>=_0x288368){_0x5d2e6d=_0x288368;_0x30237f=0xc8;}else{_0x30237f=0xce;}_0x532e9f[_0xb51a('0x1c')](_0x30237f);return _0x532e9f['set'](_0xb51a('0x23'),_0x47b2fd+'-'+_0x5d2e6d+'/'+_0x288368)[_0xb51a('0x1e')](_0x36556f);}return null;};}function patchUpdates(_0x2918dc){return function(_0x5cde7e){try{jsonpatch[_0xb51a('0x24')](_0x5cde7e,_0x2918dc,!![]);}catch(_0x2a1055){return BPromise[_0xb51a('0x25')](_0x2a1055);}return _0x5cde7e[_0xb51a('0x26')]();};}function saveUpdates(_0x1f4c93,_0x4006dc){return function(_0x156410){if(_0x156410){return _0x156410[_0xb51a('0x27')](_0x1f4c93)[_0xb51a('0x28')](function(_0x9fbb92){return _0x9fbb92;});}return null;};}function removeEntity(_0x2d169d,_0x1dba79){return function(_0x221f6a){if(_0x221f6a){return _0x221f6a[_0xb51a('0x29')]()[_0xb51a('0x28')](function(){_0x2d169d['status'](0xcc)[_0xb51a('0x1d')]();});}};}function handleEntityNotFound(_0x3ab5e4,_0x3db963){return function(_0x2790fc){if(!_0x2790fc){_0x3ab5e4[_0xb51a('0x1b')](0x194);}return _0x2790fc;};}function handleError(_0x17f7ae,_0x3e66a3){_0x3e66a3=_0x3e66a3||0x1f4;return function(_0x3d0382){logger[_0xb51a('0x2a')](_0x3d0382['stack']);if(_0x3d0382[_0xb51a('0x2b')]){delete _0x3d0382[_0xb51a('0x2b')];}_0x17f7ae[_0xb51a('0x1c')](_0x3e66a3)['send'](_0x3d0382);};}exports[_0xb51a('0x2c')]=function(_0x30976d,_0x58aba7){var _0x1f0d0d={},_0x280a00={},_0x302db6={'count':0x0,'rows':[]};var _0x113452=_[_0xb51a('0x2d')](db[_0xb51a('0x2e')]['rawAttributes'],function(_0x365ec1){return{'name':_0x365ec1[_0xb51a('0x2f')],'type':_0x365ec1[_0xb51a('0x30')]['key']};});_0x280a00[_0xb51a('0x31')]=_['map'](_0x113452,_0xb51a('0x2b'));_0x280a00[_0xb51a('0x32')]=_[_0xb51a('0x33')](_0x30976d[_0xb51a('0x32')]);_0x280a00[_0xb51a('0x34')]=_['intersection'](_0x280a00[_0xb51a('0x31')],_0x280a00[_0xb51a('0x32')]);_0x1f0d0d[_0xb51a('0x35')]=_[_0xb51a('0x36')](_0x280a00[_0xb51a('0x31')],qs['fields'](_0x30976d[_0xb51a('0x32')][_0xb51a('0x37')]));_0x1f0d0d['attributes']=_0x1f0d0d[_0xb51a('0x35')][_0xb51a('0x38')]?_0x1f0d0d[_0xb51a('0x35')]:_0x280a00['model'];if(!_0x30976d[_0xb51a('0x32')][_0xb51a('0x39')](_0xb51a('0x3a'))){_0x1f0d0d[_0xb51a('0x22')]=qs[_0xb51a('0x22')](_0x30976d['query']['limit']);_0x1f0d0d[_0xb51a('0x1f')]=qs[_0xb51a('0x1f')](_0x30976d[_0xb51a('0x32')][_0xb51a('0x1f')]);}_0x1f0d0d[_0xb51a('0x3b')]=qs['sort'](_0x30976d['query'][_0xb51a('0x3c')]);_0x1f0d0d[_0xb51a('0x3d')]=qs[_0xb51a('0x34')](_['pick'](_0x30976d[_0xb51a('0x32')],_0x280a00['filters']),_0x113452);if(_0x30976d['query'][_0xb51a('0x3e')]){_0x1f0d0d[_0xb51a('0x3d')]=_[_0xb51a('0x3f')](_0x1f0d0d['where'],{'$or':_[_0xb51a('0x2d')](_0x113452,function(_0x5ed123){if(_0x5ed123[_0xb51a('0x30')]!==_0xb51a('0x40')){var _0x2583fb={};_0x2583fb[_0x5ed123[_0xb51a('0x2b')]]={'$like':'%'+_0x30976d[_0xb51a('0x32')]['filter']+'%'};return _0x2583fb;}})});}_0x1f0d0d=_[_0xb51a('0x3f')]({},_0x1f0d0d,_0x30976d['options']);var _0x4d9992={'where':_0x1f0d0d[_0xb51a('0x3d')]};return db[_0xb51a('0x2e')]['count'](_0x4d9992)[_0xb51a('0x28')](function(_0x338b3d){_0x302db6[_0xb51a('0x21')]=_0x338b3d;if(_0x30976d[_0xb51a('0x32')]['includeAll']){_0x1f0d0d['include']=[{'all':!![]}];}return db[_0xb51a('0x2e')][_0xb51a('0x41')](_0x1f0d0d);})[_0xb51a('0x28')](function(_0xaf91d6){_0x302db6[_0xb51a('0x42')]=_0xaf91d6;return _0x302db6;})['then'](respondWithFilteredResult(_0x58aba7,_0x1f0d0d))[_0xb51a('0x43')](handleError(_0x58aba7,null));};exports[_0xb51a('0x44')]=function(_0x37bd44,_0xedc759){var _0x170d34={'raw':!![],'where':{'id':_0x37bd44[_0xb51a('0x45')]['id']}},_0x448fd9={};_0x448fd9['model']=_[_0xb51a('0x33')](db[_0xb51a('0x2e')][_0xb51a('0x46')]);_0x448fd9[_0xb51a('0x32')]=_['keys'](_0x37bd44['query']);_0x448fd9['filters']=_[_0xb51a('0x36')](_0x448fd9[_0xb51a('0x31')],_0x448fd9[_0xb51a('0x32')]);_0x170d34['attributes']=_[_0xb51a('0x36')](_0x448fd9[_0xb51a('0x31')],qs[_0xb51a('0x37')](_0x37bd44[_0xb51a('0x32')][_0xb51a('0x37')]));_0x170d34[_0xb51a('0x35')]=_0x170d34[_0xb51a('0x35')][_0xb51a('0x38')]?_0x170d34['attributes']:_0x448fd9[_0xb51a('0x31')];if(_0x37bd44[_0xb51a('0x32')]['includeAll']){_0x170d34[_0xb51a('0x47')]=[{'all':!![]}];}_0x170d34=_[_0xb51a('0x3f')]({},_0x170d34,_0x37bd44[_0xb51a('0x48')]);return db[_0xb51a('0x2e')][_0xb51a('0x49')](_0x170d34)[_0xb51a('0x28')](handleEntityNotFound(_0xedc759,null))[_0xb51a('0x28')](respondWithResult(_0xedc759,null))[_0xb51a('0x43')](handleError(_0xedc759,null));};exports['create']=function(_0x5b35e5,_0x325f9a){return db[_0xb51a('0x2e')][_0xb51a('0x4a')](_0x5b35e5['body'],{})[_0xb51a('0x28')](respondWithResult(_0x325f9a,0xc9))[_0xb51a('0x43')](handleError(_0x325f9a,null));};exports['update']=function(_0x1d4e94,_0x66bcbd){if(_0x1d4e94['body']['id']){delete _0x1d4e94[_0xb51a('0x4b')]['id'];}return db[_0xb51a('0x2e')]['find']({'where':{'id':_0x1d4e94[_0xb51a('0x45')]['id']}})[_0xb51a('0x28')](handleEntityNotFound(_0x66bcbd,null))[_0xb51a('0x28')](saveUpdates(_0x1d4e94[_0xb51a('0x4b')],null))[_0xb51a('0x28')](respondWithResult(_0x66bcbd,null))[_0xb51a('0x43')](handleError(_0x66bcbd,null));};exports['destroy']=function(_0x2d2a93,_0x272319){return db[_0xb51a('0x2e')][_0xb51a('0x49')]({'where':{'id':_0x2d2a93[_0xb51a('0x45')]['id']}})[_0xb51a('0x28')](handleEntityNotFound(_0x272319,null))[_0xb51a('0x28')](removeEntity(_0x272319,null))[_0xb51a('0x43')](handleError(_0x272319,null));}; \ No newline at end of file +var _0xf7f6=['count','set','Content-Range','json','apply','save','update','then','destroy','name','index','map','SugarcrmField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined'];(function(_0x4baae2,_0x487ab6){var _0x1a2285=function(_0x1cea47){while(--_0x1cea47){_0x4baae2['push'](_0x4baae2['shift']());}};_0x1a2285(++_0x487ab6);}(_0xf7f6,0xbe));var _0x6f7f=function(_0x1ccfb3,_0x14ff2b){_0x1ccfb3=_0x1ccfb3-0x0;var _0x3aef91=_0xf7f6[_0x1ccfb3];return _0x3aef91;};'use strict';var emlformat=require(_0x6f7f('0x0'));var rimraf=require(_0x6f7f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6f7f('0x2'));var moment=require(_0x6f7f('0x3'));var BPromise=require(_0x6f7f('0x4'));var Mustache=require(_0x6f7f('0x5'));var util=require(_0x6f7f('0x6'));var path=require(_0x6f7f('0x7'));var sox=require(_0x6f7f('0x8'));var csv=require(_0x6f7f('0x9'));var ejs=require(_0x6f7f('0xa'));var fs=require('fs');var fs_extra=require(_0x6f7f('0xb'));var _=require(_0x6f7f('0xc'));var squel=require(_0x6f7f('0xd'));var crypto=require(_0x6f7f('0xe'));var jsforce=require(_0x6f7f('0xf'));var deskjs=require(_0x6f7f('0x10'));var toCsv=require('to-csv');var querystring=require(_0x6f7f('0x11'));var Papa=require(_0x6f7f('0x12'));var Redis=require(_0x6f7f('0x13'));var authService=require(_0x6f7f('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x6f7f('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x6f7f('0x16'));var config=require(_0x6f7f('0x17'));var licenseUtil=require(_0x6f7f('0x18'));var db=require(_0x6f7f('0x19'))['db'];function respondWithStatusCode(_0xf26944,_0x4626df){_0x4626df=_0x4626df||0xcc;return function(_0x351c42){if(_0x351c42){return _0xf26944[_0x6f7f('0x1a')](_0x4626df);}return _0xf26944[_0x6f7f('0x1b')](_0x4626df)[_0x6f7f('0x1c')]();};}function respondWithResult(_0x8738d4,_0x322b54){_0x322b54=_0x322b54||0xc8;return function(_0x1ce601){if(_0x1ce601){return _0x8738d4[_0x6f7f('0x1b')](_0x322b54)['json'](_0x1ce601);}};}function respondWithFilteredResult(_0x48fcdc,_0x138991){return function(_0x404714){if(_0x404714){var _0x6cdbac=typeof _0x138991[_0x6f7f('0x1d')]==='undefined'&&typeof _0x138991[_0x6f7f('0x1e')]===_0x6f7f('0x1f');var _0x1f3c6a=_0x404714[_0x6f7f('0x20')];var _0xbbc84b=_0x6cdbac?0x0:_0x138991['offset'];var _0x2e834e=_0x6cdbac?_0x404714[_0x6f7f('0x20')]:_0x138991[_0x6f7f('0x1d')]+_0x138991['limit'];var _0x4fe811;if(_0x2e834e>=_0x1f3c6a){_0x2e834e=_0x1f3c6a;_0x4fe811=0xc8;}else{_0x4fe811=0xce;}_0x48fcdc[_0x6f7f('0x1b')](_0x4fe811);return _0x48fcdc[_0x6f7f('0x21')](_0x6f7f('0x22'),_0xbbc84b+'-'+_0x2e834e+'/'+_0x1f3c6a)[_0x6f7f('0x23')](_0x404714);}return null;};}function patchUpdates(_0xe7bd0e){return function(_0x166ad4){try{jsonpatch[_0x6f7f('0x24')](_0x166ad4,_0xe7bd0e,!![]);}catch(_0x1eff7e){return BPromise['reject'](_0x1eff7e);}return _0x166ad4[_0x6f7f('0x25')]();};}function saveUpdates(_0x284571,_0x3c3cfd){return function(_0x5ada92){if(_0x5ada92){return _0x5ada92[_0x6f7f('0x26')](_0x284571)[_0x6f7f('0x27')](function(_0xcd19ac){return _0xcd19ac;});}return null;};}function removeEntity(_0x5e2e01,_0x2c23b6){return function(_0x5a0b45){if(_0x5a0b45){return _0x5a0b45[_0x6f7f('0x28')]()[_0x6f7f('0x27')](function(){_0x5e2e01['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x19facc,_0x4cd7f3){return function(_0x1a8ea2){if(!_0x1a8ea2){_0x19facc[_0x6f7f('0x1a')](0x194);}return _0x1a8ea2;};}function handleError(_0x3372cd,_0xdf65b9){_0xdf65b9=_0xdf65b9||0x1f4;return function(_0x422ca8){logger['error'](_0x422ca8['stack']);if(_0x422ca8['name']){delete _0x422ca8[_0x6f7f('0x29')];}_0x3372cd[_0x6f7f('0x1b')](_0xdf65b9)['send'](_0x422ca8);};}exports[_0x6f7f('0x2a')]=function(_0x4d12b0,_0x240257){var _0x156e73={},_0x3d13d3={},_0x4fd1a8={'count':0x0,'rows':[]};var _0x238af5=_[_0x6f7f('0x2b')](db[_0x6f7f('0x2c')][_0x6f7f('0x2d')],function(_0x23278c){return{'name':_0x23278c[_0x6f7f('0x2e')],'type':_0x23278c[_0x6f7f('0x2f')][_0x6f7f('0x30')]};});_0x3d13d3[_0x6f7f('0x31')]=_[_0x6f7f('0x2b')](_0x238af5,_0x6f7f('0x29'));_0x3d13d3[_0x6f7f('0x32')]=_[_0x6f7f('0x33')](_0x4d12b0[_0x6f7f('0x32')]);_0x3d13d3[_0x6f7f('0x34')]=_[_0x6f7f('0x35')](_0x3d13d3[_0x6f7f('0x31')],_0x3d13d3[_0x6f7f('0x32')]);_0x156e73[_0x6f7f('0x36')]=_[_0x6f7f('0x35')](_0x3d13d3['model'],qs[_0x6f7f('0x37')](_0x4d12b0['query'][_0x6f7f('0x37')]));_0x156e73[_0x6f7f('0x36')]=_0x156e73['attributes'][_0x6f7f('0x38')]?_0x156e73['attributes']:_0x3d13d3['model'];if(!_0x4d12b0['query']['hasOwnProperty'](_0x6f7f('0x39'))){_0x156e73[_0x6f7f('0x1e')]=qs[_0x6f7f('0x1e')](_0x4d12b0[_0x6f7f('0x32')][_0x6f7f('0x1e')]);_0x156e73[_0x6f7f('0x1d')]=qs[_0x6f7f('0x1d')](_0x4d12b0['query'][_0x6f7f('0x1d')]);}_0x156e73['order']=qs[_0x6f7f('0x3a')](_0x4d12b0[_0x6f7f('0x32')][_0x6f7f('0x3a')]);_0x156e73[_0x6f7f('0x3b')]=qs[_0x6f7f('0x34')](_[_0x6f7f('0x3c')](_0x4d12b0[_0x6f7f('0x32')],_0x3d13d3[_0x6f7f('0x34')]),_0x238af5);if(_0x4d12b0[_0x6f7f('0x32')][_0x6f7f('0x3d')]){_0x156e73[_0x6f7f('0x3b')]=_['merge'](_0x156e73['where'],{'$or':_[_0x6f7f('0x2b')](_0x238af5,function(_0x5cc388){if(_0x5cc388[_0x6f7f('0x2f')]!=='VIRTUAL'){var _0x565686={};_0x565686[_0x5cc388[_0x6f7f('0x29')]]={'$like':'%'+_0x4d12b0[_0x6f7f('0x32')][_0x6f7f('0x3d')]+'%'};return _0x565686;}})});}_0x156e73=_[_0x6f7f('0x3e')]({},_0x156e73,_0x4d12b0[_0x6f7f('0x3f')]);var _0x7b6ffe={'where':_0x156e73[_0x6f7f('0x3b')]};return db[_0x6f7f('0x2c')][_0x6f7f('0x20')](_0x7b6ffe)[_0x6f7f('0x27')](function(_0x6b486b){_0x4fd1a8[_0x6f7f('0x20')]=_0x6b486b;if(_0x4d12b0[_0x6f7f('0x32')]['includeAll']){_0x156e73[_0x6f7f('0x40')]=[{'all':!![]}];}return db['SugarcrmField'][_0x6f7f('0x41')](_0x156e73);})[_0x6f7f('0x27')](function(_0x6e904a){_0x4fd1a8[_0x6f7f('0x42')]=_0x6e904a;return _0x4fd1a8;})[_0x6f7f('0x27')](respondWithFilteredResult(_0x240257,_0x156e73))[_0x6f7f('0x43')](handleError(_0x240257,null));};exports[_0x6f7f('0x44')]=function(_0x28f975,_0x372d84){var _0x96f8e8={'raw':!![],'where':{'id':_0x28f975[_0x6f7f('0x45')]['id']}},_0x417a42={};_0x417a42[_0x6f7f('0x31')]=_[_0x6f7f('0x33')](db[_0x6f7f('0x2c')]['rawAttributes']);_0x417a42[_0x6f7f('0x32')]=_[_0x6f7f('0x33')](_0x28f975['query']);_0x417a42['filters']=_['intersection'](_0x417a42[_0x6f7f('0x31')],_0x417a42[_0x6f7f('0x32')]);_0x96f8e8[_0x6f7f('0x36')]=_[_0x6f7f('0x35')](_0x417a42[_0x6f7f('0x31')],qs[_0x6f7f('0x37')](_0x28f975[_0x6f7f('0x32')][_0x6f7f('0x37')]));_0x96f8e8[_0x6f7f('0x36')]=_0x96f8e8[_0x6f7f('0x36')]['length']?_0x96f8e8['attributes']:_0x417a42[_0x6f7f('0x31')];if(_0x28f975[_0x6f7f('0x32')][_0x6f7f('0x46')]){_0x96f8e8[_0x6f7f('0x40')]=[{'all':!![]}];}_0x96f8e8=_['merge']({},_0x96f8e8,_0x28f975['options']);return db['SugarcrmField'][_0x6f7f('0x47')](_0x96f8e8)[_0x6f7f('0x27')](handleEntityNotFound(_0x372d84,null))['then'](respondWithResult(_0x372d84,null))['catch'](handleError(_0x372d84,null));};exports['create']=function(_0x263b14,_0x1ffee6){return db[_0x6f7f('0x2c')][_0x6f7f('0x48')](_0x263b14['body'],{})[_0x6f7f('0x27')](respondWithResult(_0x1ffee6,0xc9))[_0x6f7f('0x43')](handleError(_0x1ffee6,null));};exports[_0x6f7f('0x26')]=function(_0x14c81a,_0x208681){if(_0x14c81a[_0x6f7f('0x49')]['id']){delete _0x14c81a['body']['id'];}return db[_0x6f7f('0x2c')][_0x6f7f('0x47')]({'where':{'id':_0x14c81a[_0x6f7f('0x45')]['id']}})['then'](handleEntityNotFound(_0x208681,null))[_0x6f7f('0x27')](saveUpdates(_0x14c81a[_0x6f7f('0x49')],null))[_0x6f7f('0x27')](respondWithResult(_0x208681,null))[_0x6f7f('0x43')](handleError(_0x208681,null));};exports[_0x6f7f('0x28')]=function(_0x52191a,_0x4f3afd){return db['SugarcrmField'][_0x6f7f('0x47')]({'where':{'id':_0x52191a[_0x6f7f('0x45')]['id']}})[_0x6f7f('0x27')](handleEntityNotFound(_0x4f3afd,null))[_0x6f7f('0x27')](removeEntity(_0x4f3afd,null))[_0x6f7f('0x43')](handleError(_0x4f3afd,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 40ecd12..58bc2ce 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 _0x8e64=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmField.attributes','define','SugarcrmField','int_sugarcrm_fields','FieldId'];(function(_0xe76e64,_0x5a3ca5){var _0x70077a=function(_0x34ba8b){while(--_0x34ba8b){_0xe76e64['push'](_0xe76e64['shift']());}};_0x70077a(++_0x5a3ca5);}(_0x8e64,0x87));var _0x48e6=function(_0x3aa108,_0xd6eea9){_0x3aa108=_0x3aa108-0x0;var _0x37a6e1=_0x8e64[_0x3aa108];return _0x37a6e1;};'use strict';var _=require(_0x48e6('0x0'));var util=require(_0x48e6('0x1'));var logger=require(_0x48e6('0x2'))(_0x48e6('0x3'));var moment=require(_0x48e6('0x4'));var BPromise=require(_0x48e6('0x5'));var rp=require(_0x48e6('0x6'));var fs=require('fs');var path=require(_0x48e6('0x7'));var rimraf=require(_0x48e6('0x8'));var config=require(_0x48e6('0x9'));var attributes=require(_0x48e6('0xa'));module['exports']=function(_0x32800e,_0x8283ac){return _0x32800e[_0x48e6('0xb')](_0x48e6('0xc'),attributes,{'tableName':_0x48e6('0xd'),'paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':['idField',_0x48e6('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x20f5=['moment','request-promise','rimraf','./intSugarcrmField.attributes','SugarcrmField','int_sugarcrm_fields','idField','FieldId','lodash','util','../../config/logger'];(function(_0x4c574c,_0x3407ee){var _0x96c388=function(_0x33b334){while(--_0x33b334){_0x4c574c['push'](_0x4c574c['shift']());}};_0x96c388(++_0x3407ee);}(_0x20f5,0x1c0));var _0x520f=function(_0x31f5cb,_0x977fc5){_0x31f5cb=_0x31f5cb-0x0;var _0xbeddc3=_0x20f5[_0x31f5cb];return _0xbeddc3;};'use strict';var _=require(_0x520f('0x0'));var util=require(_0x520f('0x1'));var logger=require(_0x520f('0x2'))('api');var moment=require(_0x520f('0x3'));var BPromise=require('bluebird');var rp=require(_0x520f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x520f('0x5'));var config=require('../../config/environment');var attributes=require(_0x520f('0x6'));module['exports']=function(_0x3dd734,_0x3262a5){return _0x3dd734['define'](_0x520f('0x7'),attributes,{'tableName':_0x520f('0x8'),'paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':[_0x520f('0x9'),_0x520f('0xa')],'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 7fb226d..96e2efd 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 _0xb3f8=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','message','SugarcrmField,\x20%s,\x20%s','result','catch','lodash','util'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xb3f8,0x157));var _0x8b3f=function(_0x2bc3f4,_0x470b26){_0x2bc3f4=_0x2bc3f4-0x0;var _0x14ac53=_0xb3f8[_0x2bc3f4];return _0x14ac53;};'use strict';var _=require(_0x8b3f('0x0'));var util=require(_0x8b3f('0x1'));var moment=require(_0x8b3f('0x2'));var BPromise=require(_0x8b3f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8b3f('0x4'));var db=require(_0x8b3f('0x5'))['db'];var utils=require(_0x8b3f('0x6'));var logger=require(_0x8b3f('0x7'))('rpc');var config=require(_0x8b3f('0x8'));var jayson=require(_0x8b3f('0x9'));var client=jayson[_0x8b3f('0xa')][_0x8b3f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4e600f,_0x2ca4fe,_0x5c9ff3){return new BPromise(function(_0x40db8b,_0x5e4059){return client[_0x8b3f('0xc')](_0x4e600f,_0x5c9ff3)[_0x8b3f('0xd')](function(_0x45a959){logger[_0x8b3f('0xe')]('SugarcrmField,\x20%s,\x20%s',_0x2ca4fe,_0x8b3f('0xf'));logger[_0x8b3f('0x10')]('SugarcrmField,\x20%s,\x20%s,\x20%s',_0x2ca4fe,_0x8b3f('0xf'),JSON[_0x8b3f('0x11')](_0x45a959));if(_0x45a959[_0x8b3f('0x12')]){if(_0x45a959[_0x8b3f('0x12')]['code']===0x1f4){logger['error']('SugarcrmField,\x20%s,\x20%s',_0x2ca4fe,_0x45a959[_0x8b3f('0x12')]['message']);return _0x5e4059(_0x45a959[_0x8b3f('0x12')][_0x8b3f('0x13')]);}logger[_0x8b3f('0x12')](_0x8b3f('0x14'),_0x2ca4fe,_0x45a959['error'][_0x8b3f('0x13')]);return _0x40db8b(_0x45a959[_0x8b3f('0x12')]['message']);}else{logger[_0x8b3f('0xe')](_0x8b3f('0x14'),_0x2ca4fe,'request\x20sent');_0x40db8b(_0x45a959[_0x8b3f('0x15')][_0x8b3f('0x13')]);}})[_0x8b3f('0x16')](function(_0x133a81){logger[_0x8b3f('0x12')](_0x8b3f('0x14'),_0x2ca4fe,_0x133a81);_0x5e4059(_0x133a81);});});} \ No newline at end of file +var _0xb74d=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request','info','SugarcrmField,\x20%s,\x20%s','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb74d,0x1a2));var _0xdb74=function(_0x3df9dd,_0x26f5cd){_0x3df9dd=_0x3df9dd-0x0;var _0x4f11e4=_0xb74d[_0x3df9dd];return _0x4f11e4;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xdb74('0x0'));var BPromise=require(_0xdb74('0x1'));var rs=require(_0xdb74('0x2'));var fs=require('fs');var Redis=require(_0xdb74('0x3'));var db=require(_0xdb74('0x4'))['db'];var utils=require(_0xdb74('0x5'));var logger=require(_0xdb74('0x6'))(_0xdb74('0x7'));var config=require('../../config/environment');var jayson=require(_0xdb74('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x495512,_0x9d6c41,_0x1ff0b0){return new BPromise(function(_0x5ca7e7,_0x512e76){return client[_0xdb74('0x9')](_0x495512,_0x1ff0b0)['then'](function(_0x16c5af){logger[_0xdb74('0xa')](_0xdb74('0xb'),_0x9d6c41,'request\x20sent');logger[_0xdb74('0xc')](_0xdb74('0xd'),_0x9d6c41,_0xdb74('0xe'),JSON[_0xdb74('0xf')](_0x16c5af));if(_0x16c5af[_0xdb74('0x10')]){if(_0x16c5af[_0xdb74('0x10')]['code']===0x1f4){logger[_0xdb74('0x10')]('SugarcrmField,\x20%s,\x20%s',_0x9d6c41,_0x16c5af[_0xdb74('0x10')][_0xdb74('0x11')]);return _0x512e76(_0x16c5af[_0xdb74('0x10')][_0xdb74('0x11')]);}logger[_0xdb74('0x10')](_0xdb74('0xb'),_0x9d6c41,_0x16c5af['error'][_0xdb74('0x11')]);return _0x5ca7e7(_0x16c5af[_0xdb74('0x10')][_0xdb74('0x11')]);}else{logger['info'](_0xdb74('0xb'),_0x9d6c41,_0xdb74('0xe'));_0x5ca7e7(_0x16c5af[_0xdb74('0x12')][_0xdb74('0x11')]);}})['catch'](function(_0x20b140){logger[_0xdb74('0x10')](_0xdb74('0xb'),_0x9d6c41,_0x20b140);_0x512e76(_0x20b140);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index eea3fcf..052fbe6 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 _0x58e9=['index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x5eb1c1,_0x27fd74){var _0x27fd1c=function(_0x4e1956){while(--_0x4e1956){_0x5eb1c1['push'](_0x5eb1c1['shift']());}};_0x27fd1c(++_0x27fd74);}(_0x58e9,0x15e));var _0x958e=function(_0x1d3f11,_0x411d91){_0x1d3f11=_0x1d3f11-0x0;var _0x391a96=_0x58e9[_0x1d3f11];return _0x391a96;};'use strict';var multer=require(_0x958e('0x0'));var util=require(_0x958e('0x1'));var path=require('path');var timeout=require(_0x958e('0x2'));var express=require('express');var router=express[_0x958e('0x3')]();var fs_extra=require(_0x958e('0x4'));var auth=require(_0x958e('0x5'));var interaction=require(_0x958e('0x6'));var config=require(_0x958e('0x7'));var controller=require('./intVtigerAccount.controller');router[_0x958e('0x8')]('/',auth[_0x958e('0x9')](),controller[_0x958e('0xa')]);router['get'](_0x958e('0xb'),auth[_0x958e('0x9')](),controller[_0x958e('0xc')]);router[_0x958e('0x8')](_0x958e('0xd'),auth[_0x958e('0x9')](),controller[_0x958e('0xe')]);router[_0x958e('0x8')](_0x958e('0xf'),auth[_0x958e('0x9')](),controller[_0x958e('0x10')]);router[_0x958e('0x11')]('/',auth[_0x958e('0x9')](),controller[_0x958e('0x12')]);router[_0x958e('0x11')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x958e('0x13')]);router[_0x958e('0x14')](_0x958e('0xb'),auth[_0x958e('0x9')](),controller[_0x958e('0x15')]);router[_0x958e('0x16')](_0x958e('0xb'),auth[_0x958e('0x9')](),controller['destroy']);module[_0x958e('0x17')]=router; \ No newline at end of file +var _0x18d6=['isAuthenticated','show','/:id/configurations','getConfigurations','getFields','create','post','addConfiguration','put','/:id','update','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','index'];(function(_0x1098db,_0x39ba6b){var _0x14f090=function(_0x473ffe){while(--_0x473ffe){_0x1098db['push'](_0x1098db['shift']());}};_0x14f090(++_0x39ba6b);}(_0x18d6,0x166));var _0x618d=function(_0x5dc56b,_0x55f871){_0x5dc56b=_0x5dc56b-0x0;var _0x22f1fe=_0x18d6[_0x5dc56b];return _0x22f1fe;};'use strict';var multer=require(_0x618d('0x0'));var util=require(_0x618d('0x1'));var path=require('path');var timeout=require(_0x618d('0x2'));var express=require(_0x618d('0x3'));var router=express[_0x618d('0x4')]();var fs_extra=require(_0x618d('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x618d('0x6'));var config=require(_0x618d('0x7'));var controller=require('./intVtigerAccount.controller');router[_0x618d('0x8')]('/',auth['isAuthenticated'](),controller[_0x618d('0x9')]);router[_0x618d('0x8')]('/:id',auth[_0x618d('0xa')](),controller[_0x618d('0xb')]);router[_0x618d('0x8')](_0x618d('0xc'),auth[_0x618d('0xa')](),controller[_0x618d('0xd')]);router[_0x618d('0x8')]('/:id/fields',auth[_0x618d('0xa')](),controller[_0x618d('0xe')]);router['post']('/',auth[_0x618d('0xa')](),controller[_0x618d('0xf')]);router[_0x618d('0x10')](_0x618d('0xc'),auth[_0x618d('0xa')](),controller[_0x618d('0x11')]);router[_0x618d('0x12')](_0x618d('0x13'),auth[_0x618d('0xa')](),controller[_0x618d('0x14')]);router['delete']('/:id',auth[_0x618d('0xa')](),controller[_0x618d('0x15')]);module[_0x618d('0x16')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index 1280d4c..bdcddc7 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 _0x9def=['exports','STRING','HelpDesk','sequelize'];(function(_0xcedf57,_0x335b10){var _0x35eccf=function(_0x3d5d5f){while(--_0x3d5d5f){_0xcedf57['push'](_0xcedf57['shift']());}};_0x35eccf(++_0x335b10);}(_0x9def,0x6b));var _0xf9de=function(_0x2845f0,_0x233f02){_0x2845f0=_0x2845f0-0x0;var _0x24e301=_0x9def[_0x2845f0];return _0x24e301;};'use strict';var Sequelize=require(_0xf9de('0x0'));module[_0xf9de('0x1')]={'name':{'type':Sequelize[_0xf9de('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xf9de('0x2')]},'username':{'type':Sequelize[_0xf9de('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0xf9de('0x2')],'allowNull':![],'defaultValue':_0xf9de('0x3')},'remoteUri':{'type':Sequelize[_0xf9de('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0xf9de('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x2846=['STRING','sequelize','exports'];(function(_0x23db51,_0x177dea){var _0x4bfa5a=function(_0x5ee2ff){while(--_0x5ee2ff){_0x23db51['push'](_0x23db51['shift']());}};_0x4bfa5a(++_0x177dea);}(_0x2846,0x19f));var _0x6284=function(_0x5124be,_0x20765a){_0x5124be=_0x5124be-0x0;var _0x5580d7=_0x2846[_0x5124be];return _0x5580d7;};'use strict';var Sequelize=require(_0x6284('0x0'));module[_0x6284('0x1')]={'name':{'type':Sequelize[_0x6284('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x6284('0x2')]},'username':{'type':Sequelize[_0x6284('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x6284('0x2')],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize[_0x6284('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x6284('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize[_0x6284('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index b2bf11f..91aa5c2 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 _0xb3ce=['lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../config/logger','api','../../config/environment','../../config/license/util','../../components/integrations/configuration','status','json','offset','undefined','count','limit','set','Content-Range','reject','update','destroy','end','sendStatus','error','stack','name','map','VtigerAccount','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','then','includeAll','include','findAll','catch','show','params','keys','find','create','body','getConfigurations','findOne','VtigerConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','VtigerField','getFields','moduleName','remoteUri','serverUrl','accessKey','username','slice','substring','format','%s/webservice.php','GET','getchallenge','success','POST','result','describe','sessionName','autogenerated','reference','owner','includes','remove','editable','false','label','startsWith','picklist','picklistValues','value','log','vTiger\x20error:\x20','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','sox','to-csv','ejs','fs-extra'];(function(_0x4feb08,_0x3a3487){var _0x28f07b=function(_0xe145d){while(--_0xe145d){_0x4feb08['push'](_0x4feb08['shift']());}};_0x28f07b(++_0x3a3487);}(_0xb3ce,0x1cd));var _0xeb3c=function(_0x366ebd,_0x378e4f){_0x366ebd=_0x366ebd-0x0;var _0x140bda=_0xb3ce[_0x366ebd];return _0x140bda;};'use strict';var emlformat=require(_0xeb3c('0x0'));var rimraf=require(_0xeb3c('0x1'));var zipdir=require(_0xeb3c('0x2'));var jsonpatch=require(_0xeb3c('0x3'));var rp=require('request-promise');var moment=require(_0xeb3c('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xeb3c('0x5'));var util=require(_0xeb3c('0x6'));var path=require('path');var sox=require(_0xeb3c('0x7'));var csv=require(_0xeb3c('0x8'));var ejs=require(_0xeb3c('0x9'));var fs=require('fs');var fs_extra=require(_0xeb3c('0xa'));var _=require(_0xeb3c('0xb'));var squel=require(_0xeb3c('0xc'));var crypto=require(_0xeb3c('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xeb3c('0xe'));var toCsv=require('to-csv');var querystring=require(_0xeb3c('0xf'));var Papa=require(_0xeb3c('0x10'));var Redis=require(_0xeb3c('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xeb3c('0x12'))(_0xeb3c('0x13'));var utils=require('../../config/utils');var config=require(_0xeb3c('0x14'));var licenseUtil=require(_0xeb3c('0x15'));var db=require('../../mysqldb')['db'];var integrations=require(_0xeb3c('0x16'));function respondWithStatusCode(_0x3e462e,_0x12b2b0){_0x12b2b0=_0x12b2b0||0xcc;return function(_0x542a22){if(_0x542a22){return _0x3e462e['sendStatus'](_0x12b2b0);}return _0x3e462e[_0xeb3c('0x17')](_0x12b2b0)['end']();};}function respondWithResult(_0x1b4cec,_0x1effc8){_0x1effc8=_0x1effc8||0xc8;return function(_0x172811){if(_0x172811){return _0x1b4cec[_0xeb3c('0x17')](_0x1effc8)[_0xeb3c('0x18')](_0x172811);}};}function respondWithFilteredResult(_0x40c587,_0x32b882){return function(_0xf30381){if(_0xf30381){var _0x46e67c=typeof _0x32b882[_0xeb3c('0x19')]===_0xeb3c('0x1a')&&typeof _0x32b882['limit']===_0xeb3c('0x1a');var _0x5b7d11=_0xf30381[_0xeb3c('0x1b')];var _0x748e6e=_0x46e67c?0x0:_0x32b882[_0xeb3c('0x19')];var _0x55ca3f=_0x46e67c?_0xf30381[_0xeb3c('0x1b')]:_0x32b882[_0xeb3c('0x19')]+_0x32b882[_0xeb3c('0x1c')];var _0x5cf954;if(_0x55ca3f>=_0x5b7d11){_0x55ca3f=_0x5b7d11;_0x5cf954=0xc8;}else{_0x5cf954=0xce;}_0x40c587[_0xeb3c('0x17')](_0x5cf954);return _0x40c587[_0xeb3c('0x1d')](_0xeb3c('0x1e'),_0x748e6e+'-'+_0x55ca3f+'/'+_0x5b7d11)[_0xeb3c('0x18')](_0xf30381);}return null;};}function patchUpdates(_0x21bdd0){return function(_0x2727a7){try{jsonpatch['apply'](_0x2727a7,_0x21bdd0,!![]);}catch(_0x392f24){return BPromise[_0xeb3c('0x1f')](_0x392f24);}return _0x2727a7['save']();};}function saveUpdates(_0x243beb,_0x4cdc24){return function(_0x494ead){if(_0x494ead){return _0x494ead[_0xeb3c('0x20')](_0x243beb)['then'](function(_0x1914aa){return _0x1914aa;});}return null;};}function removeEntity(_0x5080ff,_0x13084e){return function(_0x1a5a78){if(_0x1a5a78){return _0x1a5a78[_0xeb3c('0x21')]()['then'](function(){_0x5080ff[_0xeb3c('0x17')](0xcc)[_0xeb3c('0x22')]();});}};}function handleEntityNotFound(_0x43346d,_0x7e3f06){return function(_0x47cbca){if(!_0x47cbca){_0x43346d[_0xeb3c('0x23')](0x194);}return _0x47cbca;};}function handleError(_0x54fb07,_0x248312){_0x248312=_0x248312||0x1f4;return function(_0x471e63){logger[_0xeb3c('0x24')](_0x471e63[_0xeb3c('0x25')]);if(_0x471e63[_0xeb3c('0x26')]){delete _0x471e63[_0xeb3c('0x26')];}_0x54fb07[_0xeb3c('0x17')](_0x248312)['send'](_0x471e63);};}exports['index']=function(_0x333002,_0x45cd60){var _0x52ec52={},_0x1619fb={},_0x5f2508={'count':0x0,'rows':[]};var _0x54c330=_[_0xeb3c('0x27')](db[_0xeb3c('0x28')][_0xeb3c('0x29')],function(_0x3141d7){return{'name':_0x3141d7['fieldName'],'type':_0x3141d7[_0xeb3c('0x2a')][_0xeb3c('0x2b')]};});_0x1619fb[_0xeb3c('0x2c')]=_[_0xeb3c('0x27')](_0x54c330,_0xeb3c('0x26'));_0x1619fb[_0xeb3c('0x2d')]=_['keys'](_0x333002['query']);_0x1619fb[_0xeb3c('0x2e')]=_[_0xeb3c('0x2f')](_0x1619fb[_0xeb3c('0x2c')],_0x1619fb[_0xeb3c('0x2d')]);_0x52ec52[_0xeb3c('0x30')]=_[_0xeb3c('0x2f')](_0x1619fb[_0xeb3c('0x2c')],qs[_0xeb3c('0x31')](_0x333002[_0xeb3c('0x2d')][_0xeb3c('0x31')]));_0x52ec52[_0xeb3c('0x30')]=_0x52ec52[_0xeb3c('0x30')][_0xeb3c('0x32')]?_0x52ec52[_0xeb3c('0x30')]:_0x1619fb[_0xeb3c('0x2c')];if(!_0x333002[_0xeb3c('0x2d')][_0xeb3c('0x33')](_0xeb3c('0x34'))){_0x52ec52[_0xeb3c('0x1c')]=qs['limit'](_0x333002[_0xeb3c('0x2d')]['limit']);_0x52ec52[_0xeb3c('0x19')]=qs['offset'](_0x333002[_0xeb3c('0x2d')][_0xeb3c('0x19')]);}_0x52ec52[_0xeb3c('0x35')]=qs[_0xeb3c('0x36')](_0x333002['query']['sort']);_0x52ec52[_0xeb3c('0x37')]=qs[_0xeb3c('0x2e')](_[_0xeb3c('0x38')](_0x333002[_0xeb3c('0x2d')],_0x1619fb[_0xeb3c('0x2e')]),_0x54c330);if(_0x333002[_0xeb3c('0x2d')][_0xeb3c('0x39')]){_0x52ec52[_0xeb3c('0x37')]=_[_0xeb3c('0x3a')](_0x52ec52[_0xeb3c('0x37')],{'$or':_['map'](_0x54c330,function(_0x51f543){if(_0x51f543[_0xeb3c('0x2a')]!==_0xeb3c('0x3b')){var _0x5486e3={};_0x5486e3[_0x51f543[_0xeb3c('0x26')]]={'$like':'%'+_0x333002[_0xeb3c('0x2d')][_0xeb3c('0x39')]+'%'};return _0x5486e3;}})});}_0x52ec52=_['merge']({},_0x52ec52,_0x333002[_0xeb3c('0x3c')]);var _0xc10573={'where':_0x52ec52[_0xeb3c('0x37')]};return db[_0xeb3c('0x28')][_0xeb3c('0x1b')](_0xc10573)[_0xeb3c('0x3d')](function(_0x195f9f){_0x5f2508[_0xeb3c('0x1b')]=_0x195f9f;if(_0x333002[_0xeb3c('0x2d')][_0xeb3c('0x3e')]){_0x52ec52[_0xeb3c('0x3f')]=[{'all':!![]}];}return db['VtigerAccount'][_0xeb3c('0x40')](_0x52ec52);})[_0xeb3c('0x3d')](function(_0x192f56){_0x5f2508['rows']=_0x192f56;return _0x5f2508;})['then'](respondWithFilteredResult(_0x45cd60,_0x52ec52))[_0xeb3c('0x41')](handleError(_0x45cd60,null));};exports[_0xeb3c('0x42')]=function(_0x58bad3,_0x21c4d4){var _0x3ca785={'raw':![],'where':{'id':_0x58bad3[_0xeb3c('0x43')]['id']}},_0x27fa72={};_0x27fa72['model']=_[_0xeb3c('0x44')](db[_0xeb3c('0x28')][_0xeb3c('0x29')]);_0x27fa72[_0xeb3c('0x2d')]=_[_0xeb3c('0x44')](_0x58bad3[_0xeb3c('0x2d')]);_0x27fa72[_0xeb3c('0x2e')]=_[_0xeb3c('0x2f')](_0x27fa72[_0xeb3c('0x2c')],_0x27fa72[_0xeb3c('0x2d')]);_0x3ca785[_0xeb3c('0x30')]=_[_0xeb3c('0x2f')](_0x27fa72['model'],qs['fields'](_0x58bad3['query']['fields']));_0x3ca785[_0xeb3c('0x30')]=_0x3ca785['attributes'][_0xeb3c('0x32')]?_0x3ca785[_0xeb3c('0x30')]:_0x27fa72[_0xeb3c('0x2c')];if(_0x58bad3['query'][_0xeb3c('0x3e')]){_0x3ca785[_0xeb3c('0x3f')]=[{'all':!![]}];}_0x3ca785=_[_0xeb3c('0x3a')]({},_0x3ca785,_0x58bad3[_0xeb3c('0x3c')]);return db['VtigerAccount'][_0xeb3c('0x45')](_0x3ca785)[_0xeb3c('0x3d')](handleEntityNotFound(_0x21c4d4,null))['then'](respondWithResult(_0x21c4d4,null))[_0xeb3c('0x41')](handleError(_0x21c4d4,null));};exports[_0xeb3c('0x46')]=function(_0x146ab4,_0x58997c){return db[_0xeb3c('0x28')]['create'](_0x146ab4['body'],{})[_0xeb3c('0x3d')](respondWithResult(_0x58997c,0xc9))[_0xeb3c('0x41')](handleError(_0x58997c,null));};exports[_0xeb3c('0x20')]=function(_0x33662b,_0x2c4505){if(_0x33662b[_0xeb3c('0x47')]['id']){delete _0x33662b['body']['id'];}return db['VtigerAccount'][_0xeb3c('0x45')]({'where':{'id':_0x33662b[_0xeb3c('0x43')]['id']}})['then'](handleEntityNotFound(_0x2c4505,null))[_0xeb3c('0x3d')](saveUpdates(_0x33662b['body'],null))[_0xeb3c('0x3d')](respondWithResult(_0x2c4505,null))[_0xeb3c('0x41')](handleError(_0x2c4505,null));};exports[_0xeb3c('0x21')]=function(_0x177dab,_0x54dcc9){return db[_0xeb3c('0x28')][_0xeb3c('0x45')]({'where':{'id':_0x177dab[_0xeb3c('0x43')]['id']}})[_0xeb3c('0x3d')](handleEntityNotFound(_0x54dcc9,null))['then'](removeEntity(_0x54dcc9,null))['catch'](handleError(_0x54dcc9,null));};exports[_0xeb3c('0x48')]=function(_0x200ca8,_0x13f9f0,_0x2ae2a0){var _0x128559={};var _0x5a209e={};var _0x252732;var _0x55cc96;return db[_0xeb3c('0x28')][_0xeb3c('0x49')]({'where':{'id':_0x200ca8['params']['id']}})[_0xeb3c('0x3d')](handleEntityNotFound(_0x13f9f0,null))[_0xeb3c('0x3d')](function(_0x34abe4){if(_0x34abe4){_0x252732=_0x34abe4;_0x5a209e[_0xeb3c('0x2c')]=_[_0xeb3c('0x44')](db[_0xeb3c('0x4a')][_0xeb3c('0x29')]);_0x5a209e[_0xeb3c('0x2d')]=_[_0xeb3c('0x44')](_0x200ca8[_0xeb3c('0x2d')]);_0x5a209e[_0xeb3c('0x2e')]=_[_0xeb3c('0x2f')](_0x5a209e['model'],_0x5a209e[_0xeb3c('0x2d')]);_0x128559[_0xeb3c('0x30')]=_['intersection'](_0x5a209e[_0xeb3c('0x2c')],qs[_0xeb3c('0x31')](_0x200ca8['query']['fields']));_0x128559['attributes']=_0x128559[_0xeb3c('0x30')][_0xeb3c('0x32')]?_0x128559['attributes']:_0x5a209e[_0xeb3c('0x2c')];_0x128559[_0xeb3c('0x35')]=qs[_0xeb3c('0x36')](_0x200ca8[_0xeb3c('0x2d')][_0xeb3c('0x36')]);_0x128559[_0xeb3c('0x37')]=qs[_0xeb3c('0x2e')](_[_0xeb3c('0x38')](_0x200ca8['query'],_0x5a209e[_0xeb3c('0x2e')]));if(_0x200ca8['query'][_0xeb3c('0x39')]){_0x128559[_0xeb3c('0x37')]=_[_0xeb3c('0x3a')](_0x128559[_0xeb3c('0x37')],{'$or':_[_0xeb3c('0x27')](_0x128559['attributes'],function(_0x201919){var _0x30b274={};_0x30b274[_0x201919]={'$like':'%'+_0x200ca8['query'][_0xeb3c('0x39')]+'%'};return _0x30b274;})});}_0x128559=_[_0xeb3c('0x3a')]({},_0x128559,_0x200ca8[_0xeb3c('0x3c')]);return _0x252732['getConfigurations'](_0x128559);}})[_0xeb3c('0x3d')](function(_0x180fee){if(_0x180fee){_0x55cc96=_0x180fee[_0xeb3c('0x32')];if(!_0x200ca8['query'][_0xeb3c('0x33')](_0xeb3c('0x34'))){_0x128559[_0xeb3c('0x1c')]=qs['limit'](_0x200ca8[_0xeb3c('0x2d')][_0xeb3c('0x1c')]);_0x128559[_0xeb3c('0x19')]=qs[_0xeb3c('0x19')](_0x200ca8[_0xeb3c('0x2d')]['offset']);}return _0x252732[_0xeb3c('0x48')](_0x128559);}})[_0xeb3c('0x3d')](function(_0xae0e36){if(_0xae0e36){return _0xae0e36?{'count':_0x55cc96,'rows':_0xae0e36}:null;}})[_0xeb3c('0x3d')](respondWithResult(_0x13f9f0,null))[_0xeb3c('0x41')](handleError(_0x13f9f0,null));};exports[_0xeb3c('0x4b')]=function(_0x58ac4b,_0x2e343f,_0x345060){if(_0x58ac4b[_0xeb3c('0x47')]['id']){delete _0x58ac4b[_0xeb3c('0x47')]['id'];}return db[_0xeb3c('0x28')][_0xeb3c('0x49')]({'where':{'id':_0x58ac4b[_0xeb3c('0x43')]['id']}})[_0xeb3c('0x3d')](handleEntityNotFound(_0x2e343f,null))[_0xeb3c('0x3d')](function(_0x4ca3b5){if(_0x4ca3b5){_0x58ac4b[_0xeb3c('0x47')][_0xeb3c('0x4c')]=_0x4ca3b5['id'];_0x58ac4b[_0xeb3c('0x47')][_0xeb3c('0x4d')]=integrations[_0xeb3c('0x4e')](_0x58ac4b[_0xeb3c('0x47')][_0xeb3c('0x4f')],_0x58ac4b[_0xeb3c('0x47')][_0xeb3c('0x2a')]);_0x58ac4b['body'][_0xeb3c('0x50')]=integrations[_0xeb3c('0x51')](_0x58ac4b[_0xeb3c('0x47')][_0xeb3c('0x4f')],_0x58ac4b[_0xeb3c('0x47')][_0xeb3c('0x2a')]);return db[_0xeb3c('0x4a')][_0xeb3c('0x46')](_0x58ac4b['body'],{'include':[{'model':db[_0xeb3c('0x52')],'as':_0xeb3c('0x4d')},{'model':db['VtigerField'],'as':_0xeb3c('0x50')}]});}return null;})[_0xeb3c('0x3d')](respondWithResult(_0x2e343f,null))['catch'](handleError(_0x2e343f,null));};var md5=require('md5');exports[_0xeb3c('0x53')]=function(_0x281a01,_0xf32eb8,_0x1e618d){var _0xd90519=null;var _0x51103c=null;var _0x5068bc=null;var _0x1e88c3=null;var _0x3afe94='';return db['VtigerAccount']['findOne']({'where':{'id':_0x281a01[_0xeb3c('0x43')]['id']},'attributes':['id',_0xeb3c('0x26'),'username','description',_0xeb3c('0x54'),_0xeb3c('0x55'),_0xeb3c('0x56'),_0xeb3c('0x57')]})[_0xeb3c('0x3d')](handleEntityNotFound(_0xf32eb8,null))['then'](function(_0x8a8ea6){if(_0x8a8ea6){_0xd90519=_0x8a8ea6[_0xeb3c('0x58')];_0x51103c=_0x8a8ea6['accessKey'];_0x5068bc=_0x8a8ea6[_0xeb3c('0x54')];_0x3afe94=_0x8a8ea6[_0xeb3c('0x55')];var _0x1f3d22=_0x3afe94[_0xeb3c('0x59')](-0x1);if(_0x1f3d22==='/'){_0x3afe94=_0x3afe94[_0xeb3c('0x5a')](0x0,_0x3afe94['lastIndexOf'](_0x1f3d22));}_0x1e88c3=util[_0xeb3c('0x5b')](_0xeb3c('0x5c'),_0x3afe94);var _0x17d725={'method':_0xeb3c('0x5d'),'uri':_0x1e88c3,'qs':{'operation':_0xeb3c('0x5e'),'username':_0x8a8ea6[_0xeb3c('0x58')]},'json':!![]};return rp(_0x17d725);}})['then'](function(_0x53121e){if(_0x53121e[_0xeb3c('0x5f')]){var _0x1dc251={'method':_0xeb3c('0x60'),'uri':_0x1e88c3,'form':{'operation':'login','username':_0xd90519,'accessKey':md5(_0x53121e[_0xeb3c('0x61')]['token']+_0x51103c)},'json':!![]};return rp(_0x1dc251);}})['then'](function(_0x2ac8e1){if(_0x2ac8e1[_0xeb3c('0x5f')]){var _0x2be619={'method':_0xeb3c('0x5d'),'uri':_0x1e88c3,'qs':{'operation':_0xeb3c('0x62'),'username':_0xd90519,'sessionName':_0x2ac8e1['result'][_0xeb3c('0x63')],'elementType':_0x5068bc},'json':!![]};return rp(_0x2be619);}})['then'](function(_0x2dd9c1){if(_0x2dd9c1[_0xeb3c('0x5f')]){var _0x2170b4=[_0xeb3c('0x64'),_0xeb3c('0x65'),_0xeb3c('0x66')];_['remove'](_0x2dd9c1[_0xeb3c('0x61')][_0xeb3c('0x31')],function(_0x587a1d){return _0x2170b4[_0xeb3c('0x67')](_0x587a1d['type'][_0xeb3c('0x26')]);});_[_0xeb3c('0x68')](_0x2dd9c1[_0xeb3c('0x61')][_0xeb3c('0x31')],function(_0x334030){return _0x334030[_0xeb3c('0x69')]===_0xeb3c('0x6a');});return{'count':_0x2dd9c1[_0xeb3c('0x61')]['fields'][_0xeb3c('0x32')],'rows':_['map'](_0x2dd9c1['result'][_0xeb3c('0x31')],function(_0x3d63d0){return{'id':_0x3d63d0[_0xeb3c('0x26')],'name':_0x3d63d0[_0xeb3c('0x6b')],'custom':_[_0xeb3c('0x6c')](_0x3d63d0[_0xeb3c('0x26')],'cf_')?!![]:![],'options':_0x3d63d0[_0xeb3c('0x2a')][_0xeb3c('0x26')]===_0xeb3c('0x6d')&&_0x3d63d0['type'][_0xeb3c('0x6e')]['length']>0x0?_[_0xeb3c('0x27')](_0x3d63d0['type'][_0xeb3c('0x6e')],function(_0x273d6c){return{'name':_0x273d6c[_0xeb3c('0x6b')],'value':_0x273d6c[_0xeb3c('0x6f')]};}):[]};})};}})[_0xeb3c('0x3d')](respondWithResult(_0xf32eb8,null))['catch'](function(_0x18caeb){console[_0xeb3c('0x70')](_0xeb3c('0x71')+_0x18caeb);var _0x25c1ac=_0x281a01['query'][_0xeb3c('0x72')]?0x1f4:_0x18caeb[_0xeb3c('0x73')]||0x1f4;logger[_0xeb3c('0x24')](_0xeb3c('0x74'),_0xeb3c('0x53'),_0x25c1ac,JSON['stringify'](_0x18caeb));delete _0x18caeb[_0xeb3c('0x26')];if(_0x25c1ac===0x191){_0x25c1ac=0x190;}_0xf32eb8[_0xeb3c('0x17')](_0x25c1ac)['send'](_0x281a01[_0xeb3c('0x2d')][_0xeb3c('0x72')]?{'message':_0xeb3c('0x75'),'statusCode':_0x18caeb[_0xeb3c('0x73')]}:_0x18caeb);});}; \ No newline at end of file +var _0x1530=['reference','owner','remove','editable','false','label','startsWith','cf_','picklist','picklistValues','value','vTiger\x20error:\x20','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','destroy','end','error','stack','name','index','VtigerAccount','rawAttributes','type','key','model','map','keys','query','intersection','fields','attributes','hasOwnProperty','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','find','create','body','update','params','getConfigurations','pick','length','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','VtigerConfiguration','VtigerField','md5','getFields','findOne','username','description','moduleName','remoteUri','serverUrl','accessKey','slice','substring','lastIndexOf','format','%s/webservice.php','GET','getchallenge','POST','login','result','success'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1530,0x103));var _0x0153=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0x1530[_0x18ab2a];return _0x16dcee;};'use strict';var emlformat=require(_0x0153('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0153('0x1'));var jsonpatch=require(_0x0153('0x2'));var rp=require(_0x0153('0x3'));var moment=require(_0x0153('0x4'));var BPromise=require(_0x0153('0x5'));var Mustache=require(_0x0153('0x6'));var util=require('util');var path=require(_0x0153('0x7'));var sox=require(_0x0153('0x8'));var csv=require('to-csv');var ejs=require(_0x0153('0x9'));var fs=require('fs');var fs_extra=require(_0x0153('0xa'));var _=require(_0x0153('0xb'));var squel=require(_0x0153('0xc'));var crypto=require('crypto');var jsforce=require(_0x0153('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x0153('0xe'));var Papa=require(_0x0153('0xf'));var Redis=require(_0x0153('0x10'));var authService=require(_0x0153('0x11'));var qs=require(_0x0153('0x12'));var as=require(_0x0153('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0153('0x14'))(_0x0153('0x15'));var utils=require(_0x0153('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x5bebb3,_0x508395){_0x508395=_0x508395||0xcc;return function(_0x3eaae9){if(_0x3eaae9){return _0x5bebb3[_0x0153('0x17')](_0x508395);}return _0x5bebb3[_0x0153('0x18')](_0x508395)['end']();};}function respondWithResult(_0x222477,_0x2b04c4){_0x2b04c4=_0x2b04c4||0xc8;return function(_0x179c57){if(_0x179c57){return _0x222477[_0x0153('0x18')](_0x2b04c4)[_0x0153('0x19')](_0x179c57);}};}function respondWithFilteredResult(_0xba5aec,_0x482da2){return function(_0x58b224){if(_0x58b224){var _0x1c646e=typeof _0x482da2[_0x0153('0x1a')]==='undefined'&&typeof _0x482da2[_0x0153('0x1b')]===_0x0153('0x1c');var _0x59675c=_0x58b224[_0x0153('0x1d')];var _0x47745b=_0x1c646e?0x0:_0x482da2['offset'];var _0x23f235=_0x1c646e?_0x58b224[_0x0153('0x1d')]:_0x482da2[_0x0153('0x1a')]+_0x482da2[_0x0153('0x1b')];var _0x258ff1;if(_0x23f235>=_0x59675c){_0x23f235=_0x59675c;_0x258ff1=0xc8;}else{_0x258ff1=0xce;}_0xba5aec['status'](_0x258ff1);return _0xba5aec[_0x0153('0x1e')](_0x0153('0x1f'),_0x47745b+'-'+_0x23f235+'/'+_0x59675c)[_0x0153('0x19')](_0x58b224);}return null;};}function patchUpdates(_0x5a978b){return function(_0x21469b){try{jsonpatch[_0x0153('0x20')](_0x21469b,_0x5a978b,!![]);}catch(_0x227d3e){return BPromise[_0x0153('0x21')](_0x227d3e);}return _0x21469b[_0x0153('0x22')]();};}function saveUpdates(_0x4df1a8,_0x1115be){return function(_0x583ced){if(_0x583ced){return _0x583ced['update'](_0x4df1a8)[_0x0153('0x23')](function(_0x55d07f){return _0x55d07f;});}return null;};}function removeEntity(_0x55b425,_0x24a28d){return function(_0x5d4b13){if(_0x5d4b13){return _0x5d4b13[_0x0153('0x24')]()[_0x0153('0x23')](function(){_0x55b425[_0x0153('0x18')](0xcc)[_0x0153('0x25')]();});}};}function handleEntityNotFound(_0x4d654e,_0x193b46){return function(_0x48fca0){if(!_0x48fca0){_0x4d654e[_0x0153('0x17')](0x194);}return _0x48fca0;};}function handleError(_0xed973b,_0x5808f3){_0x5808f3=_0x5808f3||0x1f4;return function(_0x523da2){logger[_0x0153('0x26')](_0x523da2[_0x0153('0x27')]);if(_0x523da2[_0x0153('0x28')]){delete _0x523da2['name'];}_0xed973b[_0x0153('0x18')](_0x5808f3)['send'](_0x523da2);};}exports[_0x0153('0x29')]=function(_0x21b96e,_0x5c2948){var _0x17fa7c={},_0x7ab2e={},_0x54b07a={'count':0x0,'rows':[]};var _0x5c00f6=_['map'](db[_0x0153('0x2a')][_0x0153('0x2b')],function(_0x35c73a){return{'name':_0x35c73a['fieldName'],'type':_0x35c73a[_0x0153('0x2c')][_0x0153('0x2d')]};});_0x7ab2e[_0x0153('0x2e')]=_[_0x0153('0x2f')](_0x5c00f6,_0x0153('0x28'));_0x7ab2e['query']=_[_0x0153('0x30')](_0x21b96e[_0x0153('0x31')]);_0x7ab2e['filters']=_[_0x0153('0x32')](_0x7ab2e[_0x0153('0x2e')],_0x7ab2e['query']);_0x17fa7c['attributes']=_[_0x0153('0x32')](_0x7ab2e[_0x0153('0x2e')],qs[_0x0153('0x33')](_0x21b96e['query'][_0x0153('0x33')]));_0x17fa7c[_0x0153('0x34')]=_0x17fa7c[_0x0153('0x34')]['length']?_0x17fa7c['attributes']:_0x7ab2e[_0x0153('0x2e')];if(!_0x21b96e['query'][_0x0153('0x35')]('nolimit')){_0x17fa7c[_0x0153('0x1b')]=qs[_0x0153('0x1b')](_0x21b96e['query']['limit']);_0x17fa7c['offset']=qs[_0x0153('0x1a')](_0x21b96e[_0x0153('0x31')][_0x0153('0x1a')]);}_0x17fa7c[_0x0153('0x36')]=qs['sort'](_0x21b96e['query'][_0x0153('0x37')]);_0x17fa7c[_0x0153('0x38')]=qs['filters'](_['pick'](_0x21b96e['query'],_0x7ab2e[_0x0153('0x39')]),_0x5c00f6);if(_0x21b96e[_0x0153('0x31')][_0x0153('0x3a')]){_0x17fa7c[_0x0153('0x38')]=_[_0x0153('0x3b')](_0x17fa7c[_0x0153('0x38')],{'$or':_[_0x0153('0x2f')](_0x5c00f6,function(_0x46a15c){if(_0x46a15c['type']!==_0x0153('0x3c')){var _0x2b65f1={};_0x2b65f1[_0x46a15c['name']]={'$like':'%'+_0x21b96e['query'][_0x0153('0x3a')]+'%'};return _0x2b65f1;}})});}_0x17fa7c=_[_0x0153('0x3b')]({},_0x17fa7c,_0x21b96e[_0x0153('0x3d')]);var _0x450890={'where':_0x17fa7c['where']};return db[_0x0153('0x2a')][_0x0153('0x1d')](_0x450890)[_0x0153('0x23')](function(_0x315caa){_0x54b07a['count']=_0x315caa;if(_0x21b96e[_0x0153('0x31')][_0x0153('0x3e')]){_0x17fa7c[_0x0153('0x3f')]=[{'all':!![]}];}return db[_0x0153('0x2a')]['findAll'](_0x17fa7c);})[_0x0153('0x23')](function(_0x29c183){_0x54b07a[_0x0153('0x40')]=_0x29c183;return _0x54b07a;})[_0x0153('0x23')](respondWithFilteredResult(_0x5c2948,_0x17fa7c))[_0x0153('0x41')](handleError(_0x5c2948,null));};exports[_0x0153('0x42')]=function(_0x576951,_0x2fc15a){var _0x3be4a7={'raw':![],'where':{'id':_0x576951['params']['id']}},_0x3c612a={};_0x3c612a[_0x0153('0x2e')]=_[_0x0153('0x30')](db['VtigerAccount'][_0x0153('0x2b')]);_0x3c612a[_0x0153('0x31')]=_[_0x0153('0x30')](_0x576951[_0x0153('0x31')]);_0x3c612a[_0x0153('0x39')]=_['intersection'](_0x3c612a[_0x0153('0x2e')],_0x3c612a[_0x0153('0x31')]);_0x3be4a7[_0x0153('0x34')]=_['intersection'](_0x3c612a[_0x0153('0x2e')],qs[_0x0153('0x33')](_0x576951[_0x0153('0x31')]['fields']));_0x3be4a7[_0x0153('0x34')]=_0x3be4a7['attributes']['length']?_0x3be4a7[_0x0153('0x34')]:_0x3c612a[_0x0153('0x2e')];if(_0x576951[_0x0153('0x31')]['includeAll']){_0x3be4a7['include']=[{'all':!![]}];}_0x3be4a7=_['merge']({},_0x3be4a7,_0x576951[_0x0153('0x3d')]);return db['VtigerAccount'][_0x0153('0x43')](_0x3be4a7)[_0x0153('0x23')](handleEntityNotFound(_0x2fc15a,null))[_0x0153('0x23')](respondWithResult(_0x2fc15a,null))['catch'](handleError(_0x2fc15a,null));};exports[_0x0153('0x44')]=function(_0x173dbd,_0x2bffa5){return db['VtigerAccount']['create'](_0x173dbd[_0x0153('0x45')],{})[_0x0153('0x23')](respondWithResult(_0x2bffa5,0xc9))[_0x0153('0x41')](handleError(_0x2bffa5,null));};exports[_0x0153('0x46')]=function(_0x3951fb,_0x4f1937){if(_0x3951fb[_0x0153('0x45')]['id']){delete _0x3951fb[_0x0153('0x45')]['id'];}return db['VtigerAccount'][_0x0153('0x43')]({'where':{'id':_0x3951fb[_0x0153('0x47')]['id']}})[_0x0153('0x23')](handleEntityNotFound(_0x4f1937,null))[_0x0153('0x23')](saveUpdates(_0x3951fb['body'],null))[_0x0153('0x23')](respondWithResult(_0x4f1937,null))[_0x0153('0x41')](handleError(_0x4f1937,null));};exports[_0x0153('0x24')]=function(_0x11e581,_0x31001b){return db[_0x0153('0x2a')][_0x0153('0x43')]({'where':{'id':_0x11e581[_0x0153('0x47')]['id']}})[_0x0153('0x23')](handleEntityNotFound(_0x31001b,null))[_0x0153('0x23')](removeEntity(_0x31001b,null))[_0x0153('0x41')](handleError(_0x31001b,null));};exports[_0x0153('0x48')]=function(_0x1ab991,_0x2aed9b,_0x1ebd71){var _0x51e322={};var _0x418f59={};var _0x47a6a4;var _0x47a0a9;return db[_0x0153('0x2a')]['findOne']({'where':{'id':_0x1ab991[_0x0153('0x47')]['id']}})[_0x0153('0x23')](handleEntityNotFound(_0x2aed9b,null))[_0x0153('0x23')](function(_0x584715){if(_0x584715){_0x47a6a4=_0x584715;_0x418f59[_0x0153('0x2e')]=_[_0x0153('0x30')](db['VtigerConfiguration'][_0x0153('0x2b')]);_0x418f59[_0x0153('0x31')]=_[_0x0153('0x30')](_0x1ab991[_0x0153('0x31')]);_0x418f59[_0x0153('0x39')]=_[_0x0153('0x32')](_0x418f59[_0x0153('0x2e')],_0x418f59[_0x0153('0x31')]);_0x51e322[_0x0153('0x34')]=_[_0x0153('0x32')](_0x418f59[_0x0153('0x2e')],qs[_0x0153('0x33')](_0x1ab991[_0x0153('0x31')][_0x0153('0x33')]));_0x51e322[_0x0153('0x34')]=_0x51e322['attributes']['length']?_0x51e322[_0x0153('0x34')]:_0x418f59[_0x0153('0x2e')];_0x51e322[_0x0153('0x36')]=qs['sort'](_0x1ab991[_0x0153('0x31')][_0x0153('0x37')]);_0x51e322[_0x0153('0x38')]=qs['filters'](_[_0x0153('0x49')](_0x1ab991['query'],_0x418f59['filters']));if(_0x1ab991['query']['filter']){_0x51e322['where']=_[_0x0153('0x3b')](_0x51e322[_0x0153('0x38')],{'$or':_['map'](_0x51e322[_0x0153('0x34')],function(_0x3925b4){var _0xe89215={};_0xe89215[_0x3925b4]={'$like':'%'+_0x1ab991['query'][_0x0153('0x3a')]+'%'};return _0xe89215;})});}_0x51e322=_['merge']({},_0x51e322,_0x1ab991[_0x0153('0x3d')]);return _0x47a6a4[_0x0153('0x48')](_0x51e322);}})[_0x0153('0x23')](function(_0x34f827){if(_0x34f827){_0x47a0a9=_0x34f827[_0x0153('0x4a')];if(!_0x1ab991['query'][_0x0153('0x35')](_0x0153('0x4b'))){_0x51e322[_0x0153('0x1b')]=qs['limit'](_0x1ab991[_0x0153('0x31')][_0x0153('0x1b')]);_0x51e322[_0x0153('0x1a')]=qs['offset'](_0x1ab991['query'][_0x0153('0x1a')]);}return _0x47a6a4[_0x0153('0x48')](_0x51e322);}})[_0x0153('0x23')](function(_0x2c45a2){if(_0x2c45a2){return _0x2c45a2?{'count':_0x47a0a9,'rows':_0x2c45a2}:null;}})[_0x0153('0x23')](respondWithResult(_0x2aed9b,null))['catch'](handleError(_0x2aed9b,null));};exports[_0x0153('0x4c')]=function(_0x2a771b,_0x3a8e97,_0xb61499){if(_0x2a771b[_0x0153('0x45')]['id']){delete _0x2a771b['body']['id'];}return db[_0x0153('0x2a')]['findOne']({'where':{'id':_0x2a771b[_0x0153('0x47')]['id']}})[_0x0153('0x23')](handleEntityNotFound(_0x3a8e97,null))[_0x0153('0x23')](function(_0x6ee472){if(_0x6ee472){_0x2a771b[_0x0153('0x45')][_0x0153('0x4d')]=_0x6ee472['id'];_0x2a771b['body'][_0x0153('0x4e')]=integrations[_0x0153('0x4f')](_0x2a771b[_0x0153('0x45')][_0x0153('0x50')],_0x2a771b[_0x0153('0x45')][_0x0153('0x2c')]);_0x2a771b['body'][_0x0153('0x51')]=integrations['getDescriptions'](_0x2a771b['body'][_0x0153('0x50')],_0x2a771b[_0x0153('0x45')]['type']);return db[_0x0153('0x52')][_0x0153('0x44')](_0x2a771b['body'],{'include':[{'model':db[_0x0153('0x53')],'as':_0x0153('0x4e')},{'model':db[_0x0153('0x53')],'as':_0x0153('0x51')}]});}return null;})[_0x0153('0x23')](respondWithResult(_0x3a8e97,null))[_0x0153('0x41')](handleError(_0x3a8e97,null));};var md5=require(_0x0153('0x54'));exports[_0x0153('0x55')]=function(_0x41a01d,_0x2c2d61,_0x5a704b){var _0x5f5289=null;var _0x35ce9e=null;var _0x1c6ac1=null;var _0x57b4ab=null;var _0x2ac761='';return db[_0x0153('0x2a')][_0x0153('0x56')]({'where':{'id':_0x41a01d[_0x0153('0x47')]['id']},'attributes':['id',_0x0153('0x28'),_0x0153('0x57'),_0x0153('0x58'),_0x0153('0x59'),_0x0153('0x5a'),_0x0153('0x5b'),_0x0153('0x5c')]})[_0x0153('0x23')](handleEntityNotFound(_0x2c2d61,null))[_0x0153('0x23')](function(_0x31d000){if(_0x31d000){_0x5f5289=_0x31d000[_0x0153('0x57')];_0x35ce9e=_0x31d000[_0x0153('0x5c')];_0x1c6ac1=_0x31d000['moduleName'];_0x2ac761=_0x31d000[_0x0153('0x5a')];var _0x495edf=_0x2ac761[_0x0153('0x5d')](-0x1);if(_0x495edf==='/'){_0x2ac761=_0x2ac761[_0x0153('0x5e')](0x0,_0x2ac761[_0x0153('0x5f')](_0x495edf));}_0x57b4ab=util[_0x0153('0x60')](_0x0153('0x61'),_0x2ac761);var _0x3d97d9={'method':_0x0153('0x62'),'uri':_0x57b4ab,'qs':{'operation':_0x0153('0x63'),'username':_0x31d000[_0x0153('0x57')]},'json':!![]};return rp(_0x3d97d9);}})[_0x0153('0x23')](function(_0x1a91a3){if(_0x1a91a3['success']){var _0xa8c391={'method':_0x0153('0x64'),'uri':_0x57b4ab,'form':{'operation':_0x0153('0x65'),'username':_0x5f5289,'accessKey':md5(_0x1a91a3[_0x0153('0x66')]['token']+_0x35ce9e)},'json':!![]};return rp(_0xa8c391);}})[_0x0153('0x23')](function(_0x25e692){if(_0x25e692[_0x0153('0x67')]){var _0x30fa5b={'method':_0x0153('0x62'),'uri':_0x57b4ab,'qs':{'operation':'describe','username':_0x5f5289,'sessionName':_0x25e692['result']['sessionName'],'elementType':_0x1c6ac1},'json':!![]};return rp(_0x30fa5b);}})[_0x0153('0x23')](function(_0x3d7aa6){if(_0x3d7aa6[_0x0153('0x67')]){var _0x507185=['autogenerated',_0x0153('0x68'),_0x0153('0x69')];_[_0x0153('0x6a')](_0x3d7aa6[_0x0153('0x66')][_0x0153('0x33')],function(_0x23d1df){return _0x507185['includes'](_0x23d1df['type']['name']);});_[_0x0153('0x6a')](_0x3d7aa6[_0x0153('0x66')][_0x0153('0x33')],function(_0x503537){return _0x503537[_0x0153('0x6b')]===_0x0153('0x6c');});return{'count':_0x3d7aa6[_0x0153('0x66')][_0x0153('0x33')]['length'],'rows':_[_0x0153('0x2f')](_0x3d7aa6[_0x0153('0x66')][_0x0153('0x33')],function(_0x63335b){return{'id':_0x63335b[_0x0153('0x28')],'name':_0x63335b[_0x0153('0x6d')],'custom':_[_0x0153('0x6e')](_0x63335b[_0x0153('0x28')],_0x0153('0x6f'))?!![]:![],'options':_0x63335b[_0x0153('0x2c')][_0x0153('0x28')]===_0x0153('0x70')&&_0x63335b['type'][_0x0153('0x71')][_0x0153('0x4a')]>0x0?_[_0x0153('0x2f')](_0x63335b[_0x0153('0x2c')]['picklistValues'],function(_0x3da488){return{'name':_0x3da488['label'],'value':_0x3da488[_0x0153('0x72')]};}):[]};})};}})[_0x0153('0x23')](respondWithResult(_0x2c2d61,null))[_0x0153('0x41')](function(_0x30ec8a){console['log'](_0x0153('0x73')+_0x30ec8a);var _0x46b056=_0x41a01d[_0x0153('0x31')][_0x0153('0x74')]?0x1f4:_0x30ec8a[_0x0153('0x75')]||0x1f4;logger[_0x0153('0x26')](_0x0153('0x76'),_0x0153('0x55'),_0x46b056,JSON[_0x0153('0x77')](_0x30ec8a));delete _0x30ec8a['name'];if(_0x46b056===0x191){_0x46b056=0x190;}_0x2c2d61['status'](_0x46b056)['send'](_0x41a01d['query']['test']?{'message':_0x0153('0x78'),'statusCode':_0x30ec8a[_0x0153('0x75')]}:_0x30ec8a);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index 7a51c48..919fd95 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 _0xf6e1=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','define','VtigerAccount','int_vtiger_accounts','lodash','util','../../config/logger'];(function(_0x46ab68,_0xe0f2ea){var _0x2332e3=function(_0x59c987){while(--_0x59c987){_0x46ab68['push'](_0x46ab68['shift']());}};_0x2332e3(++_0xe0f2ea);}(_0xf6e1,0x183));var _0x1f6e=function(_0x5564a9,_0x4ec69c){_0x5564a9=_0x5564a9-0x0;var _0x5a311a=_0xf6e1[_0x5564a9];return _0x5a311a;};'use strict';var _=require(_0x1f6e('0x0'));var util=require(_0x1f6e('0x1'));var logger=require(_0x1f6e('0x2'))(_0x1f6e('0x3'));var moment=require(_0x1f6e('0x4'));var BPromise=require(_0x1f6e('0x5'));var rp=require(_0x1f6e('0x6'));var fs=require('fs');var path=require(_0x1f6e('0x7'));var rimraf=require(_0x1f6e('0x8'));var config=require(_0x1f6e('0x9'));var attributes=require('./intVtigerAccount.attributes');var integrations=require(_0x1f6e('0xa'));module[_0x1f6e('0xb')]=function(_0x3ac9e4,_0x837d3e){return _0x3ac9e4[_0x1f6e('0xc')](_0x1f6e('0xd'),attributes,{'tableName':_0x1f6e('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa4f7=['bluebird','request-promise','../../config/environment','../../components/integrations/configuration','exports','define','VtigerAccount','int_vtiger_accounts','lodash','util','../../config/logger','api','moment'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xa4f7,0x97));var _0x7a4f=function(_0x28e7cf,_0x6239ce){_0x28e7cf=_0x28e7cf-0x0;var _0x349b37=_0xa4f7[_0x28e7cf];return _0x349b37;};'use strict';var _=require(_0x7a4f('0x0'));var util=require(_0x7a4f('0x1'));var logger=require(_0x7a4f('0x2'))(_0x7a4f('0x3'));var moment=require(_0x7a4f('0x4'));var BPromise=require(_0x7a4f('0x5'));var rp=require(_0x7a4f('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7a4f('0x7'));var attributes=require('./intVtigerAccount.attributes');var integrations=require(_0x7a4f('0x8'));module[_0x7a4f('0x9')]=function(_0x3a3a9f,_0x501933){return _0x3a3a9f[_0x7a4f('0xa')](_0x7a4f('0xb'),attributes,{'tableName':_0x7a4f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.rpc.js b/server/api/intVtigerAccount/intVtigerAccount.rpc.js index 2e81ba1..2b34815 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 _0xf290=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetVtigerAccount','findAll','options','raw','where','map','include','model','attributes','stringify','VtigerAccount','ShowVtigerAccount','util','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf290,0xde));var _0x0f29=function(_0x418549,_0x11b13d){_0x418549=_0x418549-0x0;var _0x288826=_0xf290[_0x418549];return _0x288826;};'use strict';var _=require('lodash');var util=require(_0x0f29('0x0'));var moment=require('moment');var BPromise=require(_0x0f29('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0f29('0x2'));var db=require(_0x0f29('0x3'))['db'];var utils=require(_0x0f29('0x4'));var logger=require(_0x0f29('0x5'))(_0x0f29('0x6'));var config=require('../../config/environment');var jayson=require(_0x0f29('0x7'));var client=jayson['client'][_0x0f29('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1c45ec,_0x355e21,_0xaa2675){return new BPromise(function(_0xc78ca2,_0x45350b){return client[_0x0f29('0x9')](_0x1c45ec,_0xaa2675)[_0x0f29('0xa')](function(_0x376de4){logger[_0x0f29('0xb')](_0x0f29('0xc'),_0x355e21,_0x0f29('0xd'));logger[_0x0f29('0xe')](_0x0f29('0xf'),_0x355e21,_0x0f29('0xd'),JSON['stringify'](_0x376de4));if(_0x376de4[_0x0f29('0x10')]){if(_0x376de4['error'][_0x0f29('0x11')]===0x1f4){logger[_0x0f29('0x10')](_0x0f29('0xc'),_0x355e21,_0x376de4[_0x0f29('0x10')][_0x0f29('0x12')]);return _0x45350b(_0x376de4[_0x0f29('0x10')]['message']);}logger[_0x0f29('0x10')](_0x0f29('0xc'),_0x355e21,_0x376de4[_0x0f29('0x10')][_0x0f29('0x12')]);return _0xc78ca2(_0x376de4[_0x0f29('0x10')][_0x0f29('0x12')]);}else{logger[_0x0f29('0xb')](_0x0f29('0xc'),_0x355e21,'request\x20sent');_0xc78ca2(_0x376de4['result'][_0x0f29('0x12')]);}})[_0x0f29('0x13')](function(_0x38031e){logger[_0x0f29('0x10')]('VtigerAccount,\x20%s,\x20%s',_0x355e21,_0x38031e);_0x45350b(_0x38031e);});});}exports[_0x0f29('0x14')]=function(_0x5d72a5){var _0x17b994=this;return new Promise(function(_0x4ca5e8,_0x5ddc74){return db['VtigerAccount'][_0x0f29('0x15')]({'raw':_0x5d72a5[_0x0f29('0x16')]?_0x5d72a5[_0x0f29('0x16')][_0x0f29('0x17')]===undefined?!![]:![]:!![],'where':_0x5d72a5[_0x0f29('0x16')]?_0x5d72a5[_0x0f29('0x16')][_0x0f29('0x18')]||null:null,'attributes':_0x5d72a5['options']?_0x5d72a5[_0x0f29('0x16')]['attributes']||null:null,'limit':_0x5d72a5['options']?_0x5d72a5['options']['limit']||null:null,'include':_0x5d72a5[_0x0f29('0x16')]?_0x5d72a5[_0x0f29('0x16')]['include']?_[_0x0f29('0x19')](_0x5d72a5[_0x0f29('0x16')][_0x0f29('0x1a')],function(_0x3402dc){return{'model':db[_0x3402dc[_0x0f29('0x1b')]],'as':_0x3402dc['as'],'attributes':_0x3402dc['attributes'],'include':_0x3402dc[_0x0f29('0x1a')]?_['map'](_0x3402dc[_0x0f29('0x1a')],function(_0x26f46f){return{'model':db[_0x26f46f[_0x0f29('0x1b')]],'as':_0x26f46f['as'],'attributes':_0x26f46f[_0x0f29('0x1c')],'include':_0x26f46f['include']?_[_0x0f29('0x19')](_0x26f46f['include'],function(_0x58b201){return{'model':db[_0x58b201[_0x0f29('0x1b')]],'as':_0x58b201['as'],'attributes':_0x58b201['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x57dcc7){logger['info'](_0x0f29('0x14'),_0x5d72a5);logger[_0x0f29('0xe')]('GetVtigerAccount',_0x5d72a5,JSON[_0x0f29('0x1d')](_0x57dcc7));_0x4ca5e8(_0x57dcc7);})[_0x0f29('0x13')](function(_0x274c9d){logger['error']('GetVtigerAccount',_0x274c9d[_0x0f29('0x12')],_0x5d72a5);_0x5ddc74(_0x17b994['error'](0x1f4,_0x274c9d[_0x0f29('0x12')]));});});};exports['ShowVtigerAccount']=function(_0x526364){var _0x7b10f=this;return new Promise(function(_0x409b19,_0xf59431){return db[_0x0f29('0x1e')]['find']({'raw':_0x526364['options']?_0x526364[_0x0f29('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x526364['options']?_0x526364[_0x0f29('0x16')]['where']||null:null,'attributes':_0x526364[_0x0f29('0x16')]?_0x526364['options']['attributes']||null:null,'include':_0x526364[_0x0f29('0x16')]?_0x526364[_0x0f29('0x16')][_0x0f29('0x1a')]?_[_0x0f29('0x19')](_0x526364[_0x0f29('0x16')]['include'],function(_0x426a3e){return{'model':db[_0x426a3e['model']],'as':_0x426a3e['as'],'attributes':_0x426a3e[_0x0f29('0x1c')],'include':_0x426a3e[_0x0f29('0x1a')]?_[_0x0f29('0x19')](_0x426a3e[_0x0f29('0x1a')],function(_0x4852a5){return{'model':db[_0x4852a5[_0x0f29('0x1b')]],'as':_0x4852a5['as'],'attributes':_0x4852a5[_0x0f29('0x1c')],'include':_0x4852a5['include']?_[_0x0f29('0x19')](_0x4852a5[_0x0f29('0x1a')],function(_0x5e40ac){return{'model':db[_0x5e40ac['model']],'as':_0x5e40ac['as'],'attributes':_0x5e40ac[_0x0f29('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x0f29('0xa')](function(_0x3691d4){logger[_0x0f29('0xb')](_0x0f29('0x1f'),_0x526364);logger[_0x0f29('0xe')]('ShowVtigerAccount',_0x526364,JSON[_0x0f29('0x1d')](_0x3691d4));_0x409b19(_0x3691d4);})['catch'](function(_0x331dc7){logger['error'](_0x0f29('0x1f'),_0x331dc7[_0x0f29('0x12')],_0x526364);_0xf59431(_0x7b10f[_0x0f29('0x10')](0x1f4,_0x331dc7['message']));});});}; \ No newline at end of file +var _0xe706=['options','raw','where','attributes','limit','include','map','model','stringify','ShowVtigerAccount','VtigerAccount','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetVtigerAccount','findAll'];(function(_0x148a88,_0x1ce566){var _0xdf93ff=function(_0x305b67){while(--_0x305b67){_0x148a88['push'](_0x148a88['shift']());}};_0xdf93ff(++_0x1ce566);}(_0xe706,0xa3));var _0x6e70=function(_0x4e26b8,_0x1a3c12){_0x4e26b8=_0x4e26b8-0x0;var _0x10a6f0=_0xe706[_0x4e26b8];return _0x10a6f0;};'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']('VtigerAccount,\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']('VtigerAccount,\x20%s,\x20%s',_0x293ce7,_0x161f23);_0x3c4843(_0x161f23);});});}exports[_0x6e70('0x19')]=function(_0x5ea7a5){var _0x28a21f=this;return new Promise(function(_0x173afe,_0x53acdc){return db['VtigerAccount'][_0x6e70('0x1a')]({'raw':_0x5ea7a5[_0x6e70('0x1b')]?_0x5ea7a5[_0x6e70('0x1b')][_0x6e70('0x1c')]===undefined?!![]:![]:!![],'where':_0x5ea7a5[_0x6e70('0x1b')]?_0x5ea7a5[_0x6e70('0x1b')][_0x6e70('0x1d')]||null:null,'attributes':_0x5ea7a5[_0x6e70('0x1b')]?_0x5ea7a5[_0x6e70('0x1b')][_0x6e70('0x1e')]||null:null,'limit':_0x5ea7a5['options']?_0x5ea7a5[_0x6e70('0x1b')][_0x6e70('0x1f')]||null:null,'include':_0x5ea7a5[_0x6e70('0x1b')]?_0x5ea7a5['options'][_0x6e70('0x20')]?_[_0x6e70('0x21')](_0x5ea7a5[_0x6e70('0x1b')]['include'],function(_0x10fc91){return{'model':db[_0x10fc91['model']],'as':_0x10fc91['as'],'attributes':_0x10fc91['attributes'],'include':_0x10fc91['include']?_[_0x6e70('0x21')](_0x10fc91[_0x6e70('0x20')],function(_0x51d292){return{'model':db[_0x51d292[_0x6e70('0x22')]],'as':_0x51d292['as'],'attributes':_0x51d292[_0x6e70('0x1e')],'include':_0x51d292['include']?_[_0x6e70('0x21')](_0x51d292[_0x6e70('0x20')],function(_0x2bb231){return{'model':db[_0x2bb231['model']],'as':_0x2bb231['as'],'attributes':_0x2bb231['attributes']};}):[]};}):[]};}):[]:[]})[_0x6e70('0xe')](function(_0x3af17f){logger[_0x6e70('0xf')](_0x6e70('0x19'),_0x5ea7a5);logger[_0x6e70('0x12')]('GetVtigerAccount',_0x5ea7a5,JSON[_0x6e70('0x23')](_0x3af17f));_0x173afe(_0x3af17f);})[_0x6e70('0x18')](function(_0xecf336){logger[_0x6e70('0x14')](_0x6e70('0x19'),_0xecf336[_0x6e70('0x16')],_0x5ea7a5);_0x53acdc(_0x28a21f[_0x6e70('0x14')](0x1f4,_0xecf336[_0x6e70('0x16')]));});});};exports[_0x6e70('0x24')]=function(_0x3a5d30){var _0x4b1229=this;return new Promise(function(_0x1b27d8,_0x50d60b){return db[_0x6e70('0x25')]['find']({'raw':_0x3a5d30[_0x6e70('0x1b')]?_0x3a5d30[_0x6e70('0x1b')][_0x6e70('0x1c')]===undefined?!![]:![]:!![],'where':_0x3a5d30['options']?_0x3a5d30[_0x6e70('0x1b')][_0x6e70('0x1d')]||null:null,'attributes':_0x3a5d30['options']?_0x3a5d30[_0x6e70('0x1b')][_0x6e70('0x1e')]||null:null,'include':_0x3a5d30['options']?_0x3a5d30[_0x6e70('0x1b')][_0x6e70('0x20')]?_[_0x6e70('0x21')](_0x3a5d30[_0x6e70('0x1b')][_0x6e70('0x20')],function(_0x1e3e76){return{'model':db[_0x1e3e76[_0x6e70('0x22')]],'as':_0x1e3e76['as'],'attributes':_0x1e3e76[_0x6e70('0x1e')],'include':_0x1e3e76[_0x6e70('0x20')]?_[_0x6e70('0x21')](_0x1e3e76['include'],function(_0x3b9c06){return{'model':db[_0x3b9c06['model']],'as':_0x3b9c06['as'],'attributes':_0x3b9c06[_0x6e70('0x1e')],'include':_0x3b9c06[_0x6e70('0x20')]?_[_0x6e70('0x21')](_0x3b9c06[_0x6e70('0x20')],function(_0x233a83){return{'model':db[_0x233a83[_0x6e70('0x22')]],'as':_0x233a83['as'],'attributes':_0x233a83[_0x6e70('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x6e70('0xe')](function(_0x80bebb){logger[_0x6e70('0xf')](_0x6e70('0x24'),_0x3a5d30);logger[_0x6e70('0x12')](_0x6e70('0x24'),_0x3a5d30,JSON['stringify'](_0x80bebb));_0x1b27d8(_0x80bebb);})['catch'](function(_0x5424eb){logger[_0x6e70('0x14')](_0x6e70('0x24'),_0x5424eb[_0x6e70('0x16')],_0x3a5d30);_0x50d60b(_0x4b1229[_0x6e70('0x14')](0x1f4,_0x5424eb[_0x6e70('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index 098e470..dedbd1e 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 _0x3046=['/:id','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','put','update','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x13ac59,_0x3a194e){var _0x7ce302=function(_0x206974){while(--_0x206974){_0x13ac59['push'](_0x13ac59['shift']());}};_0x7ce302(++_0x3a194e);}(_0x3046,0x1d9));var _0x6304=function(_0x403695,_0x1480ab){_0x403695=_0x403695-0x0;var _0x1771da=_0x3046[_0x403695];return _0x1771da;};'use strict';var multer=require(_0x6304('0x0'));var util=require(_0x6304('0x1'));var path=require(_0x6304('0x2'));var timeout=require('connect-timeout');var express=require(_0x6304('0x3'));var router=express[_0x6304('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6304('0x5'));var interaction=require(_0x6304('0x6'));var config=require(_0x6304('0x7'));var controller=require('./intVtigerConfiguration.controller');router[_0x6304('0x8')]('/',auth[_0x6304('0x9')](),controller[_0x6304('0xa')]);router['get'](_0x6304('0xb'),auth['isAuthenticated'](),controller[_0x6304('0xc')]);router[_0x6304('0x8')](_0x6304('0xd'),auth[_0x6304('0x9')](),controller['getFields']);router[_0x6304('0x8')](_0x6304('0xe'),auth['isAuthenticated'](),controller[_0x6304('0xf')]);router['get'](_0x6304('0x10'),auth['isAuthenticated'](),controller[_0x6304('0x11')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x6304('0x12')](_0x6304('0xb'),auth[_0x6304('0x9')](),controller[_0x6304('0x13')]);router['delete']('/:id',auth[_0x6304('0x9')](),controller[_0x6304('0x14')]);module[_0x6304('0x15')]=router; \ No newline at end of file +var _0x1d5f=['delete','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','isAuthenticated','index','get','/:id','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','put'];(function(_0x55969b,_0x1ebe62){var _0x3d7fc1=function(_0x5f2dbe){while(--_0x5f2dbe){_0x55969b['push'](_0x55969b['shift']());}};_0x3d7fc1(++_0x1ebe62);}(_0x1d5f,0x6f));var _0xf1d5=function(_0x374ccf,_0xa945c4){_0x374ccf=_0x374ccf-0x0;var _0x443cde=_0x1d5f[_0x374ccf];return _0x443cde;};'use strict';var multer=require(_0xf1d5('0x0'));var util=require(_0xf1d5('0x1'));var path=require(_0xf1d5('0x2'));var timeout=require('connect-timeout');var express=require(_0xf1d5('0x3'));var router=express['Router']();var fs_extra=require(_0xf1d5('0x4'));var auth=require(_0xf1d5('0x5'));var interaction=require(_0xf1d5('0x6'));var config=require(_0xf1d5('0x7'));var controller=require(_0xf1d5('0x8'));router['get']('/',auth[_0xf1d5('0x9')](),controller[_0xf1d5('0xa')]);router[_0xf1d5('0xb')](_0xf1d5('0xc'),auth[_0xf1d5('0x9')](),controller[_0xf1d5('0xd')]);router[_0xf1d5('0xb')]('/:id/fields',auth['isAuthenticated'](),controller[_0xf1d5('0xe')]);router['get'](_0xf1d5('0xf'),auth['isAuthenticated'](),controller[_0xf1d5('0x10')]);router[_0xf1d5('0xb')](_0xf1d5('0x11'),auth['isAuthenticated'](),controller[_0xf1d5('0x12')]);router[_0xf1d5('0x13')]('/',auth['isAuthenticated'](),controller['create']);router[_0xf1d5('0x14')](_0xf1d5('0xc'),auth[_0xf1d5('0x9')](),controller['update']);router[_0xf1d5('0x15')](_0xf1d5('0xc'),auth[_0xf1d5('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index 5555f14..ccb18b9 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 _0x0069=['exports','STRING'];(function(_0x100e36,_0x4da225){var _0x1df0c9=function(_0xe4b84f){while(--_0xe4b84f){_0x100e36['push'](_0x100e36['shift']());}};_0x1df0c9(++_0x4da225);}(_0x0069,0x1e8));var _0x9006=function(_0x116573,_0x234dde){_0x116573=_0x116573-0x0;var _0x4274e0=_0x0069[_0x116573];return _0x4274e0;};'use strict';var Sequelize=require('sequelize');module[_0x9006('0x0')]={'name':{'type':Sequelize[_0x9006('0x1')]},'description':{'type':Sequelize[_0x9006('0x1')]}}; \ No newline at end of file +var _0xa090=['exports','STRING'];(function(_0x2eb00f,_0x5a3b6a){var _0xcae862=function(_0x3ac372){while(--_0x3ac372){_0x2eb00f['push'](_0x2eb00f['shift']());}};_0xcae862(++_0x5a3b6a);}(_0xa090,0x17c));var _0x0a09=function(_0x32b993,_0x1c5989){_0x32b993=_0x32b993-0x0;var _0x482780=_0xa090[_0x32b993];return _0x482780;};'use strict';var Sequelize=require('sequelize');module[_0x0a09('0x0')]={'name':{'type':Sequelize[_0x0a09('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 2dc34fc..6c84c85 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 _0xc5ab=['where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','params','keys','length','find','create','body','catch','getFields','findOne','VtigerField','getSubjects','getDescriptions','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','then','stack','name','send','index','map','VtigerConfiguration','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort'];(function(_0x2ac512,_0x18d0fc){var _0x41a20e=function(_0x4c1ac2){while(--_0x4c1ac2){_0x2ac512['push'](_0x2ac512['shift']());}};_0x41a20e(++_0x18d0fc);}(_0xc5ab,0x19b));var _0xbc5a=function(_0x1d7da6,_0x1ac18a){_0x1d7da6=_0x1d7da6-0x0;var _0x48475c=_0xc5ab[_0x1d7da6];return _0x48475c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbc5a('0x0'));var zipdir=require(_0xbc5a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbc5a('0x2'));var moment=require(_0xbc5a('0x3'));var BPromise=require(_0xbc5a('0x4'));var Mustache=require('mustache');var util=require(_0xbc5a('0x5'));var path=require(_0xbc5a('0x6'));var sox=require(_0xbc5a('0x7'));var csv=require(_0xbc5a('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbc5a('0x9'));var _=require(_0xbc5a('0xa'));var squel=require(_0xbc5a('0xb'));var crypto=require('crypto');var jsforce=require(_0xbc5a('0xc'));var deskjs=require(_0xbc5a('0xd'));var toCsv=require(_0xbc5a('0x8'));var querystring=require(_0xbc5a('0xe'));var Papa=require(_0xbc5a('0xf'));var Redis=require(_0xbc5a('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xbc5a('0x11'));var hardwareService=require(_0xbc5a('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0xbc5a('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xbc5a('0x14'));var db=require(_0xbc5a('0x15'))['db'];function respondWithStatusCode(_0x34194d,_0x2a2364){_0x2a2364=_0x2a2364||0xcc;return function(_0x4560ff){if(_0x4560ff){return _0x34194d[_0xbc5a('0x16')](_0x2a2364);}return _0x34194d[_0xbc5a('0x17')](_0x2a2364)[_0xbc5a('0x18')]();};}function respondWithResult(_0x45850d,_0x13ef0c){_0x13ef0c=_0x13ef0c||0xc8;return function(_0x5f3afe){if(_0x5f3afe){return _0x45850d[_0xbc5a('0x17')](_0x13ef0c)[_0xbc5a('0x19')](_0x5f3afe);}};}function respondWithFilteredResult(_0x58d65e,_0x4b62da){return function(_0x30efed){if(_0x30efed){var _0x331e8e=typeof _0x4b62da[_0xbc5a('0x1a')]===_0xbc5a('0x1b')&&typeof _0x4b62da[_0xbc5a('0x1c')]===_0xbc5a('0x1b');var _0x1d94bb=_0x30efed[_0xbc5a('0x1d')];var _0x38ace4=_0x331e8e?0x0:_0x4b62da['offset'];var _0x58c6b2=_0x331e8e?_0x30efed[_0xbc5a('0x1d')]:_0x4b62da[_0xbc5a('0x1a')]+_0x4b62da['limit'];var _0x2be95c;if(_0x58c6b2>=_0x1d94bb){_0x58c6b2=_0x1d94bb;_0x2be95c=0xc8;}else{_0x2be95c=0xce;}_0x58d65e[_0xbc5a('0x17')](_0x2be95c);return _0x58d65e['set'](_0xbc5a('0x1e'),_0x38ace4+'-'+_0x58c6b2+'/'+_0x1d94bb)[_0xbc5a('0x19')](_0x30efed);}return null;};}function patchUpdates(_0x5db1bd){return function(_0x5d51d8){try{jsonpatch[_0xbc5a('0x1f')](_0x5d51d8,_0x5db1bd,!![]);}catch(_0x4e2a25){return BPromise[_0xbc5a('0x20')](_0x4e2a25);}return _0x5d51d8[_0xbc5a('0x21')]();};}function saveUpdates(_0x2c5f73,_0x4a4632){return function(_0x250f9c){if(_0x250f9c){return _0x250f9c[_0xbc5a('0x22')](_0x2c5f73)['then'](function(_0x175841){return _0x175841;});}return null;};}function removeEntity(_0xc32733,_0xda4ae1){return function(_0x181547){if(_0x181547){return _0x181547[_0xbc5a('0x23')]()[_0xbc5a('0x24')](function(){_0xc32733[_0xbc5a('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39201c,_0x1dde73){return function(_0x2a5672){if(!_0x2a5672){_0x39201c[_0xbc5a('0x16')](0x194);}return _0x2a5672;};}function handleError(_0x2ebcc8,_0x42e2e0){_0x42e2e0=_0x42e2e0||0x1f4;return function(_0x512c4a){logger['error'](_0x512c4a[_0xbc5a('0x25')]);if(_0x512c4a[_0xbc5a('0x26')]){delete _0x512c4a[_0xbc5a('0x26')];}_0x2ebcc8[_0xbc5a('0x17')](_0x42e2e0)[_0xbc5a('0x27')](_0x512c4a);};}exports[_0xbc5a('0x28')]=function(_0x5467fa,_0xb2a53a){var _0xe8f451={},_0x2ebf9c={},_0x47347d={'count':0x0,'rows':[]};var _0x4f98ae=_[_0xbc5a('0x29')](db[_0xbc5a('0x2a')][_0xbc5a('0x2b')],function(_0x42e203){return{'name':_0x42e203[_0xbc5a('0x2c')],'type':_0x42e203[_0xbc5a('0x2d')][_0xbc5a('0x2e')]};});_0x2ebf9c[_0xbc5a('0x2f')]=_[_0xbc5a('0x29')](_0x4f98ae,_0xbc5a('0x26'));_0x2ebf9c[_0xbc5a('0x30')]=_['keys'](_0x5467fa[_0xbc5a('0x30')]);_0x2ebf9c[_0xbc5a('0x31')]=_[_0xbc5a('0x32')](_0x2ebf9c[_0xbc5a('0x2f')],_0x2ebf9c[_0xbc5a('0x30')]);_0xe8f451['attributes']=_['intersection'](_0x2ebf9c['model'],qs[_0xbc5a('0x33')](_0x5467fa[_0xbc5a('0x30')][_0xbc5a('0x33')]));_0xe8f451['attributes']=_0xe8f451[_0xbc5a('0x34')]['length']?_0xe8f451[_0xbc5a('0x34')]:_0x2ebf9c[_0xbc5a('0x2f')];if(!_0x5467fa[_0xbc5a('0x30')][_0xbc5a('0x35')](_0xbc5a('0x36'))){_0xe8f451['limit']=qs[_0xbc5a('0x1c')](_0x5467fa[_0xbc5a('0x30')][_0xbc5a('0x1c')]);_0xe8f451['offset']=qs[_0xbc5a('0x1a')](_0x5467fa[_0xbc5a('0x30')]['offset']);}_0xe8f451[_0xbc5a('0x37')]=qs['sort'](_0x5467fa['query'][_0xbc5a('0x38')]);_0xe8f451[_0xbc5a('0x39')]=qs[_0xbc5a('0x31')](_[_0xbc5a('0x3a')](_0x5467fa[_0xbc5a('0x30')],_0x2ebf9c['filters']),_0x4f98ae);if(_0x5467fa['query'][_0xbc5a('0x3b')]){_0xe8f451[_0xbc5a('0x39')]=_[_0xbc5a('0x3c')](_0xe8f451[_0xbc5a('0x39')],{'$or':_[_0xbc5a('0x29')](_0x4f98ae,function(_0x2cbcba){if(_0x2cbcba['type']!==_0xbc5a('0x3d')){var _0x2e3c49={};_0x2e3c49[_0x2cbcba['name']]={'$like':'%'+_0x5467fa[_0xbc5a('0x30')][_0xbc5a('0x3b')]+'%'};return _0x2e3c49;}})});}_0xe8f451=_[_0xbc5a('0x3c')]({},_0xe8f451,_0x5467fa[_0xbc5a('0x3e')]);var _0x35f91a={'where':_0xe8f451[_0xbc5a('0x39')]};return db[_0xbc5a('0x2a')]['count'](_0x35f91a)['then'](function(_0x28d131){_0x47347d[_0xbc5a('0x1d')]=_0x28d131;if(_0x5467fa['query'][_0xbc5a('0x3f')]){_0xe8f451[_0xbc5a('0x40')]=[{'all':!![]}];}return db[_0xbc5a('0x2a')][_0xbc5a('0x41')](_0xe8f451);})['then'](function(_0x1b48e7){_0x47347d['rows']=_0x1b48e7;return _0x47347d;})[_0xbc5a('0x24')](respondWithFilteredResult(_0xb2a53a,_0xe8f451))['catch'](handleError(_0xb2a53a,null));};exports['show']=function(_0x548a32,_0x2ba5b0){var _0x4533e5={'raw':![],'where':{'id':_0x548a32[_0xbc5a('0x42')]['id']}},_0x3b9723={};_0x3b9723[_0xbc5a('0x2f')]=_[_0xbc5a('0x43')](db[_0xbc5a('0x2a')][_0xbc5a('0x2b')]);_0x3b9723[_0xbc5a('0x30')]=_['keys'](_0x548a32['query']);_0x3b9723['filters']=_[_0xbc5a('0x32')](_0x3b9723[_0xbc5a('0x2f')],_0x3b9723[_0xbc5a('0x30')]);_0x4533e5[_0xbc5a('0x34')]=_[_0xbc5a('0x32')](_0x3b9723[_0xbc5a('0x2f')],qs[_0xbc5a('0x33')](_0x548a32[_0xbc5a('0x30')][_0xbc5a('0x33')]));_0x4533e5[_0xbc5a('0x34')]=_0x4533e5[_0xbc5a('0x34')][_0xbc5a('0x44')]?_0x4533e5[_0xbc5a('0x34')]:_0x3b9723[_0xbc5a('0x2f')];if(_0x548a32['query'][_0xbc5a('0x3f')]){_0x4533e5[_0xbc5a('0x40')]=[{'all':!![]}];}_0x4533e5=_[_0xbc5a('0x3c')]({},_0x4533e5,_0x548a32[_0xbc5a('0x3e')]);return db['VtigerConfiguration'][_0xbc5a('0x45')](_0x4533e5)[_0xbc5a('0x24')](handleEntityNotFound(_0x2ba5b0,null))[_0xbc5a('0x24')](respondWithResult(_0x2ba5b0,null))['catch'](handleError(_0x2ba5b0,null));};exports['create']=function(_0x4afb55,_0x417d76){return db[_0xbc5a('0x2a')][_0xbc5a('0x46')](_0x4afb55[_0xbc5a('0x47')],{})[_0xbc5a('0x24')](respondWithResult(_0x417d76,0xc9))[_0xbc5a('0x48')](handleError(_0x417d76,null));};exports[_0xbc5a('0x22')]=function(_0x1de3a2,_0x4fb045){if(_0x1de3a2[_0xbc5a('0x47')]['id']){delete _0x1de3a2[_0xbc5a('0x47')]['id'];}return db[_0xbc5a('0x2a')][_0xbc5a('0x45')]({'where':{'id':_0x1de3a2[_0xbc5a('0x42')]['id']}})['then'](handleEntityNotFound(_0x4fb045,null))['then'](saveUpdates(_0x1de3a2['body'],null))[_0xbc5a('0x24')](respondWithResult(_0x4fb045,null))[_0xbc5a('0x48')](handleError(_0x4fb045,null));};exports['destroy']=function(_0x1f6dfb,_0x4bbad5){return db[_0xbc5a('0x2a')][_0xbc5a('0x45')]({'where':{'id':_0x1f6dfb[_0xbc5a('0x42')]['id']}})['then'](handleEntityNotFound(_0x4bbad5,null))[_0xbc5a('0x24')](removeEntity(_0x4bbad5,null))[_0xbc5a('0x48')](handleError(_0x4bbad5,null));};exports[_0xbc5a('0x49')]=function(_0x5b7f2b,_0x2ad6d,_0xc68d0e){var _0x38edee={};var _0x23fef9={};var _0x448e25;var _0x33193c;return db[_0xbc5a('0x2a')][_0xbc5a('0x4a')]({'where':{'id':_0x5b7f2b[_0xbc5a('0x42')]['id']}})['then'](handleEntityNotFound(_0x2ad6d,null))[_0xbc5a('0x24')](function(_0x234fc6){if(_0x234fc6){_0x448e25=_0x234fc6;_0x23fef9['model']=_[_0xbc5a('0x43')](db[_0xbc5a('0x4b')][_0xbc5a('0x2b')]);_0x23fef9[_0xbc5a('0x30')]=_[_0xbc5a('0x43')](_0x5b7f2b[_0xbc5a('0x30')]);_0x23fef9['filters']=_['intersection'](_0x23fef9[_0xbc5a('0x2f')],_0x23fef9['query']);_0x38edee[_0xbc5a('0x34')]=_['intersection'](_0x23fef9['model'],qs[_0xbc5a('0x33')](_0x5b7f2b[_0xbc5a('0x30')][_0xbc5a('0x33')]));_0x38edee[_0xbc5a('0x34')]=_0x38edee[_0xbc5a('0x34')]['length']?_0x38edee[_0xbc5a('0x34')]:_0x23fef9[_0xbc5a('0x2f')];_0x38edee[_0xbc5a('0x37')]=qs[_0xbc5a('0x38')](_0x5b7f2b[_0xbc5a('0x30')][_0xbc5a('0x38')]);_0x38edee[_0xbc5a('0x39')]=qs[_0xbc5a('0x31')](_[_0xbc5a('0x3a')](_0x5b7f2b[_0xbc5a('0x30')],_0x23fef9['filters']));if(_0x5b7f2b[_0xbc5a('0x30')][_0xbc5a('0x3b')]){_0x38edee[_0xbc5a('0x39')]=_[_0xbc5a('0x3c')](_0x38edee[_0xbc5a('0x39')],{'$or':_[_0xbc5a('0x29')](_0x38edee[_0xbc5a('0x34')],function(_0x3bf80a){var _0x14273a={};_0x14273a[_0x3bf80a]={'$like':'%'+_0x5b7f2b[_0xbc5a('0x30')][_0xbc5a('0x3b')]+'%'};return _0x14273a;})});}_0x38edee=_['merge']({},_0x38edee,_0x5b7f2b[_0xbc5a('0x3e')]);return _0x448e25[_0xbc5a('0x49')](_0x38edee);}})[_0xbc5a('0x24')](function(_0x1f9b58){if(_0x1f9b58){_0x33193c=_0x1f9b58[_0xbc5a('0x44')];if(!_0x5b7f2b['query'][_0xbc5a('0x35')]('nolimit')){_0x38edee['limit']=qs['limit'](_0x5b7f2b[_0xbc5a('0x30')][_0xbc5a('0x1c')]);_0x38edee[_0xbc5a('0x1a')]=qs[_0xbc5a('0x1a')](_0x5b7f2b['query'][_0xbc5a('0x1a')]);}return _0x448e25[_0xbc5a('0x49')](_0x38edee);}})[_0xbc5a('0x24')](function(_0x55db99){if(_0x55db99){return _0x55db99?{'count':_0x33193c,'rows':_0x55db99}:null;}})[_0xbc5a('0x24')](respondWithResult(_0x2ad6d,null))['catch'](handleError(_0x2ad6d,null));};exports['getSubjects']=function(_0x535be9,_0x3bd95d,_0xeb847e){var _0x3b79fd={};var _0x58d8ce={};var _0x4c6050;var _0x5e6972;return db['VtigerConfiguration'][_0xbc5a('0x4a')]({'where':{'id':_0x535be9['params']['id']}})[_0xbc5a('0x24')](handleEntityNotFound(_0x3bd95d,null))[_0xbc5a('0x24')](function(_0x1aae02){if(_0x1aae02){_0x4c6050=_0x1aae02;_0x58d8ce['model']=_[_0xbc5a('0x43')](db[_0xbc5a('0x4b')][_0xbc5a('0x2b')]);_0x58d8ce['query']=_[_0xbc5a('0x43')](_0x535be9[_0xbc5a('0x30')]);_0x58d8ce[_0xbc5a('0x31')]=_[_0xbc5a('0x32')](_0x58d8ce[_0xbc5a('0x2f')],_0x58d8ce['query']);_0x3b79fd['attributes']=_[_0xbc5a('0x32')](_0x58d8ce[_0xbc5a('0x2f')],qs[_0xbc5a('0x33')](_0x535be9['query'][_0xbc5a('0x33')]));_0x3b79fd[_0xbc5a('0x34')]=_0x3b79fd[_0xbc5a('0x34')][_0xbc5a('0x44')]?_0x3b79fd[_0xbc5a('0x34')]:_0x58d8ce[_0xbc5a('0x2f')];_0x3b79fd['order']=qs[_0xbc5a('0x38')](_0x535be9[_0xbc5a('0x30')][_0xbc5a('0x38')]);_0x3b79fd[_0xbc5a('0x39')]=qs[_0xbc5a('0x31')](_[_0xbc5a('0x3a')](_0x535be9[_0xbc5a('0x30')],_0x58d8ce[_0xbc5a('0x31')]));if(_0x535be9['query'][_0xbc5a('0x3b')]){_0x3b79fd[_0xbc5a('0x39')]=_[_0xbc5a('0x3c')](_0x3b79fd[_0xbc5a('0x39')],{'$or':_['map'](_0x3b79fd[_0xbc5a('0x34')],function(_0x2d70fc){var _0x334005={};_0x334005[_0x2d70fc]={'$like':'%'+_0x535be9['query']['filter']+'%'};return _0x334005;})});}_0x3b79fd=_[_0xbc5a('0x3c')]({},_0x3b79fd,_0x535be9[_0xbc5a('0x3e')]);return _0x4c6050[_0xbc5a('0x4c')](_0x3b79fd);}})[_0xbc5a('0x24')](function(_0x50a29f){if(_0x50a29f){_0x5e6972=_0x50a29f[_0xbc5a('0x44')];if(!_0x535be9[_0xbc5a('0x30')][_0xbc5a('0x35')]('nolimit')){_0x3b79fd[_0xbc5a('0x1c')]=qs[_0xbc5a('0x1c')](_0x535be9[_0xbc5a('0x30')][_0xbc5a('0x1c')]);_0x3b79fd[_0xbc5a('0x1a')]=qs['offset'](_0x535be9[_0xbc5a('0x30')][_0xbc5a('0x1a')]);}return _0x4c6050[_0xbc5a('0x4c')](_0x3b79fd);}})[_0xbc5a('0x24')](function(_0x1c5632){if(_0x1c5632){return _0x1c5632?{'count':_0x5e6972,'rows':_0x1c5632}:null;}})[_0xbc5a('0x24')](respondWithResult(_0x3bd95d,null))[_0xbc5a('0x48')](handleError(_0x3bd95d,null));};exports[_0xbc5a('0x4d')]=function(_0x1c05ae,_0x4a26e2,_0x430023){var _0x1726cc={};var _0x17cd3e={};var _0x3c23e1;var _0x35dcd0;return db[_0xbc5a('0x2a')][_0xbc5a('0x4a')]({'where':{'id':_0x1c05ae['params']['id']}})[_0xbc5a('0x24')](handleEntityNotFound(_0x4a26e2,null))[_0xbc5a('0x24')](function(_0x3b1a54){if(_0x3b1a54){_0x3c23e1=_0x3b1a54;_0x17cd3e[_0xbc5a('0x2f')]=_[_0xbc5a('0x43')](db[_0xbc5a('0x4b')][_0xbc5a('0x2b')]);_0x17cd3e['query']=_[_0xbc5a('0x43')](_0x1c05ae[_0xbc5a('0x30')]);_0x17cd3e[_0xbc5a('0x31')]=_['intersection'](_0x17cd3e[_0xbc5a('0x2f')],_0x17cd3e[_0xbc5a('0x30')]);_0x1726cc['attributes']=_[_0xbc5a('0x32')](_0x17cd3e['model'],qs[_0xbc5a('0x33')](_0x1c05ae['query'][_0xbc5a('0x33')]));_0x1726cc[_0xbc5a('0x34')]=_0x1726cc['attributes'][_0xbc5a('0x44')]?_0x1726cc[_0xbc5a('0x34')]:_0x17cd3e[_0xbc5a('0x2f')];_0x1726cc[_0xbc5a('0x37')]=qs[_0xbc5a('0x38')](_0x1c05ae[_0xbc5a('0x30')][_0xbc5a('0x38')]);_0x1726cc[_0xbc5a('0x39')]=qs['filters'](_['pick'](_0x1c05ae[_0xbc5a('0x30')],_0x17cd3e[_0xbc5a('0x31')]));if(_0x1c05ae[_0xbc5a('0x30')][_0xbc5a('0x3b')]){_0x1726cc[_0xbc5a('0x39')]=_[_0xbc5a('0x3c')](_0x1726cc[_0xbc5a('0x39')],{'$or':_[_0xbc5a('0x29')](_0x1726cc['attributes'],function(_0x65a1f2){var _0x302a19={};_0x302a19[_0x65a1f2]={'$like':'%'+_0x1c05ae[_0xbc5a('0x30')][_0xbc5a('0x3b')]+'%'};return _0x302a19;})});}_0x1726cc=_[_0xbc5a('0x3c')]({},_0x1726cc,_0x1c05ae['options']);return _0x3c23e1[_0xbc5a('0x4d')](_0x1726cc);}})[_0xbc5a('0x24')](function(_0x1fdfec){if(_0x1fdfec){_0x35dcd0=_0x1fdfec[_0xbc5a('0x44')];if(!_0x1c05ae[_0xbc5a('0x30')][_0xbc5a('0x35')](_0xbc5a('0x36'))){_0x1726cc[_0xbc5a('0x1c')]=qs['limit'](_0x1c05ae['query'][_0xbc5a('0x1c')]);_0x1726cc[_0xbc5a('0x1a')]=qs[_0xbc5a('0x1a')](_0x1c05ae['query'][_0xbc5a('0x1a')]);}return _0x3c23e1[_0xbc5a('0x4d')](_0x1726cc);}})[_0xbc5a('0x24')](function(_0xb30cf0){if(_0xb30cf0){return _0xb30cf0?{'count':_0x35dcd0,'rows':_0xb30cf0}:null;}})[_0xbc5a('0x24')](respondWithResult(_0x4a26e2,null))['catch'](handleError(_0x4a26e2,null));}; \ No newline at end of file +var _0x88c9=['intersection','length','include','find','create','body','update','params','findOne','getSubjects','VtigerField','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','then','destroy','sendStatus','error','name','send','index','map','rawAttributes','filters','model','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','VtigerConfiguration','includeAll','findAll','rows','catch','show','keys'];(function(_0x1f4d4d,_0x451e74){var _0x1c0eb4=function(_0x1c2a9b){while(--_0x1c2a9b){_0x1f4d4d['push'](_0x1f4d4d['shift']());}};_0x1c0eb4(++_0x451e74);}(_0x88c9,0x1f2));var _0x988c=function(_0x43671c,_0x562da0){_0x43671c=_0x43671c-0x0;var _0x59b230=_0x88c9[_0x43671c];return _0x59b230;};'use strict';var emlformat=require(_0x988c('0x0'));var rimraf=require(_0x988c('0x1'));var zipdir=require(_0x988c('0x2'));var jsonpatch=require(_0x988c('0x3'));var rp=require(_0x988c('0x4'));var moment=require('moment');var BPromise=require(_0x988c('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x988c('0x6'));var sox=require(_0x988c('0x7'));var csv=require(_0x988c('0x8'));var ejs=require(_0x988c('0x9'));var fs=require('fs');var fs_extra=require(_0x988c('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x988c('0xb'));var jsforce=require(_0x988c('0xc'));var deskjs=require(_0x988c('0xd'));var toCsv=require(_0x988c('0x8'));var querystring=require(_0x988c('0xe'));var Papa=require(_0x988c('0xf'));var Redis=require(_0x988c('0x10'));var authService=require(_0x988c('0x11'));var qs=require(_0x988c('0x12'));var as=require(_0x988c('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x988c('0x14'))(_0x988c('0x15'));var utils=require(_0x988c('0x16'));var config=require(_0x988c('0x17'));var licenseUtil=require(_0x988c('0x18'));var db=require(_0x988c('0x19'))['db'];function respondWithStatusCode(_0x185782,_0x528dd4){_0x528dd4=_0x528dd4||0xcc;return function(_0x4ed9f2){if(_0x4ed9f2){return _0x185782['sendStatus'](_0x528dd4);}return _0x185782['status'](_0x528dd4)[_0x988c('0x1a')]();};}function respondWithResult(_0x4a5bb3,_0x4b4343){_0x4b4343=_0x4b4343||0xc8;return function(_0x4331cf){if(_0x4331cf){return _0x4a5bb3['status'](_0x4b4343)[_0x988c('0x1b')](_0x4331cf);}};}function respondWithFilteredResult(_0xe30832,_0x182d3c){return function(_0x5a6410){if(_0x5a6410){var _0x1c67b4=typeof _0x182d3c[_0x988c('0x1c')]===_0x988c('0x1d')&&typeof _0x182d3c[_0x988c('0x1e')]===_0x988c('0x1d');var _0x1edd02=_0x5a6410[_0x988c('0x1f')];var _0x1e73c1=_0x1c67b4?0x0:_0x182d3c[_0x988c('0x1c')];var _0x2d2281=_0x1c67b4?_0x5a6410['count']:_0x182d3c[_0x988c('0x1c')]+_0x182d3c[_0x988c('0x1e')];var _0x5cadf1;if(_0x2d2281>=_0x1edd02){_0x2d2281=_0x1edd02;_0x5cadf1=0xc8;}else{_0x5cadf1=0xce;}_0xe30832[_0x988c('0x20')](_0x5cadf1);return _0xe30832[_0x988c('0x21')](_0x988c('0x22'),_0x1e73c1+'-'+_0x2d2281+'/'+_0x1edd02)['json'](_0x5a6410);}return null;};}function patchUpdates(_0x506d21){return function(_0x6e5a70){try{jsonpatch[_0x988c('0x23')](_0x6e5a70,_0x506d21,!![]);}catch(_0x317f72){return BPromise[_0x988c('0x24')](_0x317f72);}return _0x6e5a70['save']();};}function saveUpdates(_0x2c539d,_0x216d3e){return function(_0x48c62f){if(_0x48c62f){return _0x48c62f['update'](_0x2c539d)[_0x988c('0x25')](function(_0xbb5203){return _0xbb5203;});}return null;};}function removeEntity(_0x57173b,_0x537e23){return function(_0x11656a){if(_0x11656a){return _0x11656a[_0x988c('0x26')]()[_0x988c('0x25')](function(){_0x57173b[_0x988c('0x20')](0xcc)[_0x988c('0x1a')]();});}};}function handleEntityNotFound(_0x2316c7,_0x3ea40d){return function(_0x304e83){if(!_0x304e83){_0x2316c7[_0x988c('0x27')](0x194);}return _0x304e83;};}function handleError(_0x111211,_0x239dc2){_0x239dc2=_0x239dc2||0x1f4;return function(_0x665c6){logger[_0x988c('0x28')](_0x665c6['stack']);if(_0x665c6[_0x988c('0x29')]){delete _0x665c6[_0x988c('0x29')];}_0x111211[_0x988c('0x20')](_0x239dc2)[_0x988c('0x2a')](_0x665c6);};}exports[_0x988c('0x2b')]=function(_0x5e320a,_0x3be720){var _0x156e9d={},_0x509f99={},_0x53c1a7={'count':0x0,'rows':[]};var _0x5d5992=_[_0x988c('0x2c')](db['VtigerConfiguration'][_0x988c('0x2d')],function(_0x1bc081){return{'name':_0x1bc081['fieldName'],'type':_0x1bc081['type']['key']};});_0x509f99['model']=_[_0x988c('0x2c')](_0x5d5992,'name');_0x509f99['query']=_['keys'](_0x5e320a['query']);_0x509f99[_0x988c('0x2e')]=_['intersection'](_0x509f99[_0x988c('0x2f')],_0x509f99[_0x988c('0x30')]);_0x156e9d[_0x988c('0x31')]=_['intersection'](_0x509f99[_0x988c('0x2f')],qs[_0x988c('0x32')](_0x5e320a[_0x988c('0x30')][_0x988c('0x32')]));_0x156e9d[_0x988c('0x31')]=_0x156e9d[_0x988c('0x31')]['length']?_0x156e9d[_0x988c('0x31')]:_0x509f99['model'];if(!_0x5e320a[_0x988c('0x30')][_0x988c('0x33')](_0x988c('0x34'))){_0x156e9d[_0x988c('0x1e')]=qs[_0x988c('0x1e')](_0x5e320a['query'][_0x988c('0x1e')]);_0x156e9d[_0x988c('0x1c')]=qs['offset'](_0x5e320a[_0x988c('0x30')][_0x988c('0x1c')]);}_0x156e9d[_0x988c('0x35')]=qs[_0x988c('0x36')](_0x5e320a[_0x988c('0x30')]['sort']);_0x156e9d[_0x988c('0x37')]=qs[_0x988c('0x2e')](_[_0x988c('0x38')](_0x5e320a[_0x988c('0x30')],_0x509f99[_0x988c('0x2e')]),_0x5d5992);if(_0x5e320a[_0x988c('0x30')][_0x988c('0x39')]){_0x156e9d[_0x988c('0x37')]=_['merge'](_0x156e9d[_0x988c('0x37')],{'$or':_[_0x988c('0x2c')](_0x5d5992,function(_0x4c421b){if(_0x4c421b[_0x988c('0x3a')]!==_0x988c('0x3b')){var _0x217b18={};_0x217b18[_0x4c421b['name']]={'$like':'%'+_0x5e320a[_0x988c('0x30')][_0x988c('0x39')]+'%'};return _0x217b18;}})});}_0x156e9d=_[_0x988c('0x3c')]({},_0x156e9d,_0x5e320a[_0x988c('0x3d')]);var _0x3a21a2={'where':_0x156e9d['where']};return db[_0x988c('0x3e')][_0x988c('0x1f')](_0x3a21a2)[_0x988c('0x25')](function(_0x37856f){_0x53c1a7[_0x988c('0x1f')]=_0x37856f;if(_0x5e320a[_0x988c('0x30')][_0x988c('0x3f')]){_0x156e9d['include']=[{'all':!![]}];}return db['VtigerConfiguration'][_0x988c('0x40')](_0x156e9d);})[_0x988c('0x25')](function(_0x54c075){_0x53c1a7[_0x988c('0x41')]=_0x54c075;return _0x53c1a7;})[_0x988c('0x25')](respondWithFilteredResult(_0x3be720,_0x156e9d))[_0x988c('0x42')](handleError(_0x3be720,null));};exports[_0x988c('0x43')]=function(_0x3266b0,_0x58c768){var _0x4a83d3={'raw':![],'where':{'id':_0x3266b0['params']['id']}},_0x1adb68={};_0x1adb68['model']=_[_0x988c('0x44')](db[_0x988c('0x3e')]['rawAttributes']);_0x1adb68[_0x988c('0x30')]=_[_0x988c('0x44')](_0x3266b0[_0x988c('0x30')]);_0x1adb68[_0x988c('0x2e')]=_[_0x988c('0x45')](_0x1adb68[_0x988c('0x2f')],_0x1adb68[_0x988c('0x30')]);_0x4a83d3['attributes']=_['intersection'](_0x1adb68[_0x988c('0x2f')],qs['fields'](_0x3266b0[_0x988c('0x30')][_0x988c('0x32')]));_0x4a83d3[_0x988c('0x31')]=_0x4a83d3[_0x988c('0x31')][_0x988c('0x46')]?_0x4a83d3[_0x988c('0x31')]:_0x1adb68['model'];if(_0x3266b0[_0x988c('0x30')][_0x988c('0x3f')]){_0x4a83d3[_0x988c('0x47')]=[{'all':!![]}];}_0x4a83d3=_[_0x988c('0x3c')]({},_0x4a83d3,_0x3266b0[_0x988c('0x3d')]);return db[_0x988c('0x3e')][_0x988c('0x48')](_0x4a83d3)['then'](handleEntityNotFound(_0x58c768,null))['then'](respondWithResult(_0x58c768,null))[_0x988c('0x42')](handleError(_0x58c768,null));};exports[_0x988c('0x49')]=function(_0x4246bf,_0x382030){return db['VtigerConfiguration']['create'](_0x4246bf[_0x988c('0x4a')],{})[_0x988c('0x25')](respondWithResult(_0x382030,0xc9))[_0x988c('0x42')](handleError(_0x382030,null));};exports[_0x988c('0x4b')]=function(_0x4b59dc,_0x32cdb6){if(_0x4b59dc[_0x988c('0x4a')]['id']){delete _0x4b59dc[_0x988c('0x4a')]['id'];}return db[_0x988c('0x3e')]['find']({'where':{'id':_0x4b59dc[_0x988c('0x4c')]['id']}})['then'](handleEntityNotFound(_0x32cdb6,null))[_0x988c('0x25')](saveUpdates(_0x4b59dc[_0x988c('0x4a')],null))['then'](respondWithResult(_0x32cdb6,null))[_0x988c('0x42')](handleError(_0x32cdb6,null));};exports[_0x988c('0x26')]=function(_0x9993f4,_0x3dc5c5){return db[_0x988c('0x3e')][_0x988c('0x48')]({'where':{'id':_0x9993f4[_0x988c('0x4c')]['id']}})[_0x988c('0x25')](handleEntityNotFound(_0x3dc5c5,null))['then'](removeEntity(_0x3dc5c5,null))[_0x988c('0x42')](handleError(_0x3dc5c5,null));};exports['getFields']=function(_0x40dfed,_0x59da32,_0x4e1a2f){var _0x4b20b0={};var _0x10a0e8={};var _0x74cc54;var _0x3e0f59;return db[_0x988c('0x3e')][_0x988c('0x4d')]({'where':{'id':_0x40dfed[_0x988c('0x4c')]['id']}})['then'](handleEntityNotFound(_0x59da32,null))['then'](function(_0x198ef9){if(_0x198ef9){_0x74cc54=_0x198ef9;_0x10a0e8[_0x988c('0x2f')]=_[_0x988c('0x44')](db['VtigerField'][_0x988c('0x2d')]);_0x10a0e8[_0x988c('0x30')]=_['keys'](_0x40dfed[_0x988c('0x30')]);_0x10a0e8[_0x988c('0x2e')]=_[_0x988c('0x45')](_0x10a0e8[_0x988c('0x2f')],_0x10a0e8['query']);_0x4b20b0[_0x988c('0x31')]=_['intersection'](_0x10a0e8[_0x988c('0x2f')],qs['fields'](_0x40dfed[_0x988c('0x30')][_0x988c('0x32')]));_0x4b20b0['attributes']=_0x4b20b0['attributes'][_0x988c('0x46')]?_0x4b20b0[_0x988c('0x31')]:_0x10a0e8[_0x988c('0x2f')];_0x4b20b0[_0x988c('0x35')]=qs[_0x988c('0x36')](_0x40dfed[_0x988c('0x30')][_0x988c('0x36')]);_0x4b20b0[_0x988c('0x37')]=qs[_0x988c('0x2e')](_[_0x988c('0x38')](_0x40dfed[_0x988c('0x30')],_0x10a0e8[_0x988c('0x2e')]));if(_0x40dfed['query'][_0x988c('0x39')]){_0x4b20b0['where']=_['merge'](_0x4b20b0['where'],{'$or':_[_0x988c('0x2c')](_0x4b20b0['attributes'],function(_0x549be){var _0x1f4858={};_0x1f4858[_0x549be]={'$like':'%'+_0x40dfed['query']['filter']+'%'};return _0x1f4858;})});}_0x4b20b0=_[_0x988c('0x3c')]({},_0x4b20b0,_0x40dfed[_0x988c('0x3d')]);return _0x74cc54['getFields'](_0x4b20b0);}})[_0x988c('0x25')](function(_0x2ad319){if(_0x2ad319){_0x3e0f59=_0x2ad319['length'];if(!_0x40dfed[_0x988c('0x30')][_0x988c('0x33')](_0x988c('0x34'))){_0x4b20b0[_0x988c('0x1e')]=qs[_0x988c('0x1e')](_0x40dfed[_0x988c('0x30')][_0x988c('0x1e')]);_0x4b20b0[_0x988c('0x1c')]=qs['offset'](_0x40dfed[_0x988c('0x30')][_0x988c('0x1c')]);}return _0x74cc54['getFields'](_0x4b20b0);}})[_0x988c('0x25')](function(_0x3f8c66){if(_0x3f8c66){return _0x3f8c66?{'count':_0x3e0f59,'rows':_0x3f8c66}:null;}})[_0x988c('0x25')](respondWithResult(_0x59da32,null))[_0x988c('0x42')](handleError(_0x59da32,null));};exports[_0x988c('0x4e')]=function(_0x36da29,_0x2251a2,_0x314967){var _0x2137fe={};var _0x44c12a={};var _0x8df555;var _0x8b8b07;return db[_0x988c('0x3e')][_0x988c('0x4d')]({'where':{'id':_0x36da29[_0x988c('0x4c')]['id']}})[_0x988c('0x25')](handleEntityNotFound(_0x2251a2,null))[_0x988c('0x25')](function(_0x2a43ff){if(_0x2a43ff){_0x8df555=_0x2a43ff;_0x44c12a[_0x988c('0x2f')]=_[_0x988c('0x44')](db[_0x988c('0x4f')][_0x988c('0x2d')]);_0x44c12a[_0x988c('0x30')]=_[_0x988c('0x44')](_0x36da29[_0x988c('0x30')]);_0x44c12a[_0x988c('0x2e')]=_[_0x988c('0x45')](_0x44c12a[_0x988c('0x2f')],_0x44c12a['query']);_0x2137fe['attributes']=_['intersection'](_0x44c12a[_0x988c('0x2f')],qs[_0x988c('0x32')](_0x36da29['query'][_0x988c('0x32')]));_0x2137fe[_0x988c('0x31')]=_0x2137fe[_0x988c('0x31')][_0x988c('0x46')]?_0x2137fe[_0x988c('0x31')]:_0x44c12a[_0x988c('0x2f')];_0x2137fe[_0x988c('0x35')]=qs[_0x988c('0x36')](_0x36da29[_0x988c('0x30')][_0x988c('0x36')]);_0x2137fe[_0x988c('0x37')]=qs[_0x988c('0x2e')](_['pick'](_0x36da29[_0x988c('0x30')],_0x44c12a['filters']));if(_0x36da29[_0x988c('0x30')][_0x988c('0x39')]){_0x2137fe[_0x988c('0x37')]=_['merge'](_0x2137fe[_0x988c('0x37')],{'$or':_[_0x988c('0x2c')](_0x2137fe[_0x988c('0x31')],function(_0x5616c9){var _0x280a57={};_0x280a57[_0x5616c9]={'$like':'%'+_0x36da29[_0x988c('0x30')][_0x988c('0x39')]+'%'};return _0x280a57;})});}_0x2137fe=_[_0x988c('0x3c')]({},_0x2137fe,_0x36da29[_0x988c('0x3d')]);return _0x8df555[_0x988c('0x4e')](_0x2137fe);}})[_0x988c('0x25')](function(_0x4ce05d){if(_0x4ce05d){_0x8b8b07=_0x4ce05d['length'];if(!_0x36da29[_0x988c('0x30')]['hasOwnProperty'](_0x988c('0x34'))){_0x2137fe['limit']=qs[_0x988c('0x1e')](_0x36da29[_0x988c('0x30')][_0x988c('0x1e')]);_0x2137fe['offset']=qs['offset'](_0x36da29['query'][_0x988c('0x1c')]);}return _0x8df555[_0x988c('0x4e')](_0x2137fe);}})[_0x988c('0x25')](function(_0x39df22){if(_0x39df22){return _0x39df22?{'count':_0x8b8b07,'rows':_0x39df22}:null;}})['then'](respondWithResult(_0x2251a2,null))[_0x988c('0x42')](handleError(_0x2251a2,null));};exports[_0x988c('0x50')]=function(_0x46154c,_0x3ea812,_0xb2afd6){var _0x29fa04={};var _0x523578={};var _0x5063c4;var _0x288007;return db[_0x988c('0x3e')][_0x988c('0x4d')]({'where':{'id':_0x46154c[_0x988c('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3ea812,null))[_0x988c('0x25')](function(_0x187953){if(_0x187953){_0x5063c4=_0x187953;_0x523578['model']=_[_0x988c('0x44')](db['VtigerField']['rawAttributes']);_0x523578['query']=_[_0x988c('0x44')](_0x46154c[_0x988c('0x30')]);_0x523578['filters']=_[_0x988c('0x45')](_0x523578[_0x988c('0x2f')],_0x523578[_0x988c('0x30')]);_0x29fa04[_0x988c('0x31')]=_[_0x988c('0x45')](_0x523578[_0x988c('0x2f')],qs[_0x988c('0x32')](_0x46154c[_0x988c('0x30')][_0x988c('0x32')]));_0x29fa04[_0x988c('0x31')]=_0x29fa04[_0x988c('0x31')][_0x988c('0x46')]?_0x29fa04['attributes']:_0x523578[_0x988c('0x2f')];_0x29fa04[_0x988c('0x35')]=qs['sort'](_0x46154c['query'][_0x988c('0x36')]);_0x29fa04['where']=qs[_0x988c('0x2e')](_[_0x988c('0x38')](_0x46154c[_0x988c('0x30')],_0x523578[_0x988c('0x2e')]));if(_0x46154c[_0x988c('0x30')][_0x988c('0x39')]){_0x29fa04[_0x988c('0x37')]=_[_0x988c('0x3c')](_0x29fa04['where'],{'$or':_[_0x988c('0x2c')](_0x29fa04[_0x988c('0x31')],function(_0x53e193){var _0x4637d6={};_0x4637d6[_0x53e193]={'$like':'%'+_0x46154c[_0x988c('0x30')][_0x988c('0x39')]+'%'};return _0x4637d6;})});}_0x29fa04=_[_0x988c('0x3c')]({},_0x29fa04,_0x46154c[_0x988c('0x3d')]);return _0x5063c4[_0x988c('0x50')](_0x29fa04);}})[_0x988c('0x25')](function(_0x14f16e){if(_0x14f16e){_0x288007=_0x14f16e[_0x988c('0x46')];if(!_0x46154c[_0x988c('0x30')][_0x988c('0x33')](_0x988c('0x34'))){_0x29fa04['limit']=qs['limit'](_0x46154c['query']['limit']);_0x29fa04[_0x988c('0x1c')]=qs[_0x988c('0x1c')](_0x46154c[_0x988c('0x30')][_0x988c('0x1c')]);}return _0x5063c4[_0x988c('0x50')](_0x29fa04);}})[_0x988c('0x25')](function(_0x3d308d){if(_0x3d308d){return _0x3d308d?{'count':_0x288007,'rows':_0x3d308d}:null;}})[_0x988c('0x25')](respondWithResult(_0x3ea812,null))[_0x988c('0x42')](handleError(_0x3ea812,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index 20e1133..9b3acd0 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 _0xd3de=['./intVtigerConfiguration.attributes','define','int_vtiger_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0xfdece8,_0x22e246){var _0x2eec83=function(_0x466d64){while(--_0x466d64){_0xfdece8['push'](_0xfdece8['shift']());}};_0x2eec83(++_0x22e246);}(_0xd3de,0x93));var _0xed3d=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0xd3de[_0x8c43de];return _0xa6591b;};'use strict';var _=require(_0xed3d('0x0'));var util=require(_0xed3d('0x1'));var logger=require(_0xed3d('0x2'))(_0xed3d('0x3'));var moment=require(_0xed3d('0x4'));var BPromise=require(_0xed3d('0x5'));var rp=require(_0xed3d('0x6'));var fs=require('fs');var path=require(_0xed3d('0x7'));var rimraf=require('rimraf');var config=require(_0xed3d('0x8'));var attributes=require(_0xed3d('0x9'));module['exports']=function(_0xbd7086,_0x17eee7){return _0xbd7086[_0xed3d('0xa')]('VtigerConfiguration',attributes,{'tableName':_0xed3d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1196=['rimraf','../../config/environment','./intVtigerConfiguration.attributes','exports','define','int_vtiger_configurations','lodash','request-promise','path'];(function(_0x4b9c3f,_0x23c102){var _0x425a1b=function(_0x25f6f2){while(--_0x25f6f2){_0x4b9c3f['push'](_0x4b9c3f['shift']());}};_0x425a1b(++_0x23c102);}(_0x1196,0xd5));var _0x6119=function(_0x137aeb,_0x321e72){_0x137aeb=_0x137aeb-0x0;var _0x11246d=_0x1196[_0x137aeb];return _0x11246d;};'use strict';var _=require(_0x6119('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6119('0x1'));var fs=require('fs');var path=require(_0x6119('0x2'));var rimraf=require(_0x6119('0x3'));var config=require(_0x6119('0x4'));var attributes=require(_0x6119('0x5'));module[_0x6119('0x6')]=function(_0x3be4d2,_0x1fa6b2){return _0x3be4d2[_0x6119('0x7')]('VtigerConfiguration',attributes,{'tableName':_0x6119('0x8'),'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 2fb6935..4fbd1be 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 _0x0aa5=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','lodash','moment'];(function(_0x9b2bb0,_0x3965b1){var _0x2cdb3b=function(_0x177d75){while(--_0x177d75){_0x9b2bb0['push'](_0x9b2bb0['shift']());}};_0x2cdb3b(++_0x3965b1);}(_0x0aa5,0x91));var _0x50aa=function(_0x2ccb1b,_0x2479a0){_0x2ccb1b=_0x2ccb1b-0x0;var _0x5511f5=_0x0aa5[_0x2ccb1b];return _0x5511f5;};'use strict';var _=require(_0x50aa('0x0'));var util=require('util');var moment=require(_0x50aa('0x1'));var BPromise=require(_0x50aa('0x2'));var rs=require(_0x50aa('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x50aa('0x4'))['db'];var utils=require(_0x50aa('0x5'));var logger=require(_0x50aa('0x6'))(_0x50aa('0x7'));var config=require('../../config/environment');var jayson=require(_0x50aa('0x8'));var client=jayson[_0x50aa('0x9')][_0x50aa('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x32beae,_0x5b040b,_0x4fd441){return new BPromise(function(_0x57717a,_0x40dc74){return client[_0x50aa('0xb')](_0x32beae,_0x4fd441)[_0x50aa('0xc')](function(_0x3c05ed){logger['info'](_0x50aa('0xd'),_0x5b040b,_0x50aa('0xe'));logger['debug']('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x5b040b,_0x50aa('0xe'),JSON[_0x50aa('0xf')](_0x3c05ed));if(_0x3c05ed[_0x50aa('0x10')]){if(_0x3c05ed[_0x50aa('0x10')][_0x50aa('0x11')]===0x1f4){logger['error'](_0x50aa('0xd'),_0x5b040b,_0x3c05ed[_0x50aa('0x10')][_0x50aa('0x12')]);return _0x40dc74(_0x3c05ed[_0x50aa('0x10')][_0x50aa('0x12')]);}logger['error'](_0x50aa('0xd'),_0x5b040b,_0x3c05ed[_0x50aa('0x10')][_0x50aa('0x12')]);return _0x57717a(_0x3c05ed[_0x50aa('0x10')][_0x50aa('0x12')]);}else{logger[_0x50aa('0x13')](_0x50aa('0xd'),_0x5b040b,_0x50aa('0xe'));_0x57717a(_0x3c05ed[_0x50aa('0x14')]['message']);}})['catch'](function(_0x6198b0){logger[_0x50aa('0x10')]('VtigerConfiguration,\x20%s,\x20%s',_0x5b040b,_0x6198b0);_0x40dc74(_0x6198b0);});});} \ No newline at end of file +var _0x9f62=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','client','http','request','then','info','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','VtigerConfiguration,\x20%s,\x20%s','result','catch','lodash','util','moment'];(function(_0x49ca18,_0x5e6d05){var _0x145d54=function(_0x30b9be){while(--_0x30b9be){_0x49ca18['push'](_0x49ca18['shift']());}};_0x145d54(++_0x5e6d05);}(_0x9f62,0x189));var _0x29f6=function(_0xdef85a,_0x241f54){_0xdef85a=_0xdef85a-0x0;var _0x3f5638=_0x9f62[_0xdef85a];return _0x3f5638;};'use strict';var _=require(_0x29f6('0x0'));var util=require(_0x29f6('0x1'));var moment=require(_0x29f6('0x2'));var BPromise=require(_0x29f6('0x3'));var rs=require(_0x29f6('0x4'));var fs=require('fs');var Redis=require(_0x29f6('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x29f6('0x6'));var logger=require(_0x29f6('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x29f6('0x8')][_0x29f6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2e23e7,_0x2abb2b,_0x2e6959){return new BPromise(function(_0xf89caa,_0x32ad6a){return client[_0x29f6('0xa')](_0x2e23e7,_0x2e6959)[_0x29f6('0xb')](function(_0x14fc0c){logger[_0x29f6('0xc')]('VtigerConfiguration,\x20%s,\x20%s',_0x2abb2b,_0x29f6('0xd'));logger[_0x29f6('0xe')](_0x29f6('0xf'),_0x2abb2b,_0x29f6('0xd'),JSON['stringify'](_0x14fc0c));if(_0x14fc0c[_0x29f6('0x10')]){if(_0x14fc0c[_0x29f6('0x10')][_0x29f6('0x11')]===0x1f4){logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0x2abb2b,_0x14fc0c[_0x29f6('0x10')]['message']);return _0x32ad6a(_0x14fc0c[_0x29f6('0x10')][_0x29f6('0x12')]);}logger[_0x29f6('0x10')](_0x29f6('0x13'),_0x2abb2b,_0x14fc0c['error'][_0x29f6('0x12')]);return _0xf89caa(_0x14fc0c[_0x29f6('0x10')]['message']);}else{logger['info']('VtigerConfiguration,\x20%s,\x20%s',_0x2abb2b,'request\x20sent');_0xf89caa(_0x14fc0c[_0x29f6('0x14')][_0x29f6('0x12')]);}})[_0x29f6('0x15')](function(_0x21033f){logger['error'](_0x29f6('0x13'),_0x2abb2b,_0x21033f);_0x32ad6a(_0x21033f);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index b16ea00..490f712 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 _0xf990=['../../components/auth/service','../../config/environment','get','index','/:id','show','isAuthenticated','create','put','delete','destroy','util','path','connect-timeout','express','Router'];(function(_0x275256,_0x299ac3){var _0x1a4481=function(_0x2c5785){while(--_0x2c5785){_0x275256['push'](_0x275256['shift']());}};_0x1a4481(++_0x299ac3);}(_0xf990,0x12b));var _0x0f99=function(_0x4ef7ee,_0x16e755){_0x4ef7ee=_0x4ef7ee-0x0;var _0x5e2a5d=_0xf990[_0x4ef7ee];return _0x5e2a5d;};'use strict';var multer=require('multer');var util=require(_0x0f99('0x0'));var path=require(_0x0f99('0x1'));var timeout=require(_0x0f99('0x2'));var express=require(_0x0f99('0x3'));var router=express[_0x0f99('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x0f99('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0f99('0x6'));var controller=require('./intVtigerField.controller');router[_0x0f99('0x7')]('/',auth['isAuthenticated'](),controller[_0x0f99('0x8')]);router[_0x0f99('0x7')](_0x0f99('0x9'),auth['isAuthenticated'](),controller[_0x0f99('0xa')]);router['post']('/',auth[_0x0f99('0xb')](),controller[_0x0f99('0xc')]);router[_0x0f99('0xd')](_0x0f99('0x9'),auth[_0x0f99('0xb')](),controller['update']);router[_0x0f99('0xe')](_0x0f99('0x9'),auth[_0x0f99('0xb')](),controller[_0x0f99('0xf')]);module['exports']=router; \ No newline at end of file +var _0x6cfc=['post','update','delete','destroy','exports','util','path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./intVtigerField.controller','get','isAuthenticated','index','show'];(function(_0x5af5a8,_0x10ce33){var _0x414545=function(_0xb57b5c){while(--_0xb57b5c){_0x5af5a8['push'](_0x5af5a8['shift']());}};_0x414545(++_0x10ce33);}(_0x6cfc,0x135));var _0xc6cf=function(_0x1e06f1,_0x59d7e1){_0x1e06f1=_0x1e06f1-0x0;var _0x34f77e=_0x6cfc[_0x1e06f1];return _0x34f77e;};'use strict';var multer=require('multer');var util=require(_0xc6cf('0x0'));var path=require(_0xc6cf('0x1'));var timeout=require(_0xc6cf('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xc6cf('0x3'));var auth=require(_0xc6cf('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xc6cf('0x5'));var controller=require(_0xc6cf('0x6'));router[_0xc6cf('0x7')]('/',auth[_0xc6cf('0x8')](),controller[_0xc6cf('0x9')]);router[_0xc6cf('0x7')]('/:id',auth[_0xc6cf('0x8')](),controller[_0xc6cf('0xa')]);router[_0xc6cf('0xb')]('/',auth[_0xc6cf('0x8')](),controller['create']);router['put']('/:id',auth[_0xc6cf('0x8')](),controller[_0xc6cf('0xc')]);router[_0xc6cf('0xd')]('/:id',auth[_0xc6cf('0x8')](),controller[_0xc6cf('0xe')]);module[_0xc6cf('0xf')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index 2895e96..39effb6 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 _0x0594=['keyValue','STRING','variable','BOOLEAN','sequelize','exports','ENUM','string','customVariable'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x0594,0x1f3));var _0x4059=function(_0x1de85b,_0x2e3ab9){_0x1de85b=_0x1de85b-0x0;var _0x6ec653=_0x0594[_0x1de85b];return _0x6ec653;};'use strict';var Sequelize=require(_0x4059('0x0'));module[_0x4059('0x1')]={'type':{'type':Sequelize[_0x4059('0x2')](_0x4059('0x3'),'variable',_0x4059('0x4'),_0x4059('0x5'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x4059('0x6')]},'keyType':{'type':Sequelize[_0x4059('0x2')](_0x4059('0x3'),_0x4059('0x7'),_0x4059('0x4'))},'keyContent':{'type':Sequelize[_0x4059('0x6')]},'idField':{'type':Sequelize[_0x4059('0x6')]},'nameField':{'type':Sequelize[_0x4059('0x6')]},'customField':{'type':Sequelize[_0x4059('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x4059('0x6')]}}; \ No newline at end of file +var _0x762b=['exports','string','variable','picklist','STRING','ENUM','customVariable','BOOLEAN','sequelize'];(function(_0x40dc22,_0x21aa75){var _0x413c19=function(_0x49c02c){while(--_0x49c02c){_0x40dc22['push'](_0x40dc22['shift']());}};_0x413c19(++_0x21aa75);}(_0x762b,0x14c));var _0xb762=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x762b[_0x21a9d9];return _0x46adce;};'use strict';var Sequelize=require(_0xb762('0x0'));module[_0xb762('0x1')]={'type':{'type':Sequelize['ENUM'](_0xb762('0x2'),_0xb762('0x3'),'customVariable','keyValue',_0xb762('0x4')),'defaultValue':_0xb762('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xb762('0x5')]},'keyType':{'type':Sequelize[_0xb762('0x6')]('string','variable',_0xb762('0x7'))},'keyContent':{'type':Sequelize[_0xb762('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xb762('0x5')]},'customField':{'type':Sequelize[_0xb762('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xb762('0x5')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index b269e01..21c0019 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 _0x602d=['util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','then','destroy','error','stack','name','send','index','map','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','options','VtigerField','include','catch','show','includeAll','create','body','update','find','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird'];(function(_0x49f305,_0x253cf8){var _0x85030c=function(_0x20eec9){while(--_0x20eec9){_0x49f305['push'](_0x49f305['shift']());}};_0x85030c(++_0x253cf8);}(_0x602d,0x122));var _0xd602=function(_0x4923c7,_0x3d603f){_0x4923c7=_0x4923c7-0x0;var _0x516f4a=_0x602d[_0x4923c7];return _0x516f4a;};'use strict';var emlformat=require(_0xd602('0x0'));var rimraf=require(_0xd602('0x1'));var zipdir=require(_0xd602('0x2'));var jsonpatch=require(_0xd602('0x3'));var rp=require(_0xd602('0x4'));var moment=require('moment');var BPromise=require(_0xd602('0x5'));var Mustache=require('mustache');var util=require(_0xd602('0x6'));var path=require('path');var sox=require(_0xd602('0x7'));var csv=require(_0xd602('0x8'));var ejs=require(_0xd602('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd602('0xa'));var squel=require(_0xd602('0xb'));var crypto=require(_0xd602('0xc'));var jsforce=require(_0xd602('0xd'));var deskjs=require(_0xd602('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xd602('0xf'));var Redis=require(_0xd602('0x10'));var authService=require(_0xd602('0x11'));var qs=require(_0xd602('0x12'));var as=require(_0xd602('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd602('0x14'))(_0xd602('0x15'));var utils=require('../../config/utils');var config=require(_0xd602('0x16'));var licenseUtil=require(_0xd602('0x17'));var db=require(_0xd602('0x18'))['db'];function respondWithStatusCode(_0xd79f43,_0x43024a){_0x43024a=_0x43024a||0xcc;return function(_0x5cd3c4){if(_0x5cd3c4){return _0xd79f43[_0xd602('0x19')](_0x43024a);}return _0xd79f43[_0xd602('0x1a')](_0x43024a)[_0xd602('0x1b')]();};}function respondWithResult(_0x5206e1,_0x46668a){_0x46668a=_0x46668a||0xc8;return function(_0x39e401){if(_0x39e401){return _0x5206e1[_0xd602('0x1a')](_0x46668a)[_0xd602('0x1c')](_0x39e401);}};}function respondWithFilteredResult(_0xa364fb,_0x311305){return function(_0x288b3b){if(_0x288b3b){var _0x36e2f2=typeof _0x311305['offset']===_0xd602('0x1d')&&typeof _0x311305[_0xd602('0x1e')]===_0xd602('0x1d');var _0x51f2af=_0x288b3b[_0xd602('0x1f')];var _0x21cdcf=_0x36e2f2?0x0:_0x311305[_0xd602('0x20')];var _0x4e8f45=_0x36e2f2?_0x288b3b['count']:_0x311305[_0xd602('0x20')]+_0x311305[_0xd602('0x1e')];var _0x19a441;if(_0x4e8f45>=_0x51f2af){_0x4e8f45=_0x51f2af;_0x19a441=0xc8;}else{_0x19a441=0xce;}_0xa364fb[_0xd602('0x1a')](_0x19a441);return _0xa364fb[_0xd602('0x21')]('Content-Range',_0x21cdcf+'-'+_0x4e8f45+'/'+_0x51f2af)[_0xd602('0x1c')](_0x288b3b);}return null;};}function patchUpdates(_0x27d535){return function(_0x549e1c){try{jsonpatch[_0xd602('0x22')](_0x549e1c,_0x27d535,!![]);}catch(_0x183682){return BPromise[_0xd602('0x23')](_0x183682);}return _0x549e1c[_0xd602('0x24')]();};}function saveUpdates(_0x3fc4c2,_0x59e51b){return function(_0x586caa){if(_0x586caa){return _0x586caa['update'](_0x3fc4c2)[_0xd602('0x25')](function(_0x238165){return _0x238165;});}return null;};}function removeEntity(_0x4072d2,_0x37f94c){return function(_0x30024f){if(_0x30024f){return _0x30024f[_0xd602('0x26')]()[_0xd602('0x25')](function(){_0x4072d2['status'](0xcc)[_0xd602('0x1b')]();});}};}function handleEntityNotFound(_0x196091,_0x3a953f){return function(_0x58644d){if(!_0x58644d){_0x196091[_0xd602('0x19')](0x194);}return _0x58644d;};}function handleError(_0xdbd724,_0x2bfd61){_0x2bfd61=_0x2bfd61||0x1f4;return function(_0x15d6fc){logger[_0xd602('0x27')](_0x15d6fc[_0xd602('0x28')]);if(_0x15d6fc['name']){delete _0x15d6fc[_0xd602('0x29')];}_0xdbd724[_0xd602('0x1a')](_0x2bfd61)[_0xd602('0x2a')](_0x15d6fc);};}exports[_0xd602('0x2b')]=function(_0x45bfdc,_0x24905f){var _0x271619={},_0x36b4c0={},_0x1c1687={'count':0x0,'rows':[]};var _0x55d2a5=_[_0xd602('0x2c')](db['VtigerField']['rawAttributes'],function(_0x368aaa){return{'name':_0x368aaa[_0xd602('0x2d')],'type':_0x368aaa[_0xd602('0x2e')][_0xd602('0x2f')]};});_0x36b4c0['model']=_[_0xd602('0x2c')](_0x55d2a5,_0xd602('0x29'));_0x36b4c0[_0xd602('0x30')]=_[_0xd602('0x31')](_0x45bfdc[_0xd602('0x30')]);_0x36b4c0['filters']=_[_0xd602('0x32')](_0x36b4c0[_0xd602('0x33')],_0x36b4c0[_0xd602('0x30')]);_0x271619[_0xd602('0x34')]=_[_0xd602('0x32')](_0x36b4c0[_0xd602('0x33')],qs[_0xd602('0x35')](_0x45bfdc['query'][_0xd602('0x35')]));_0x271619['attributes']=_0x271619[_0xd602('0x34')][_0xd602('0x36')]?_0x271619['attributes']:_0x36b4c0[_0xd602('0x33')];if(!_0x45bfdc[_0xd602('0x30')][_0xd602('0x37')](_0xd602('0x38'))){_0x271619['limit']=qs['limit'](_0x45bfdc[_0xd602('0x30')][_0xd602('0x1e')]);_0x271619[_0xd602('0x20')]=qs[_0xd602('0x20')](_0x45bfdc[_0xd602('0x30')]['offset']);}_0x271619['order']=qs[_0xd602('0x39')](_0x45bfdc[_0xd602('0x30')][_0xd602('0x39')]);_0x271619[_0xd602('0x3a')]=qs[_0xd602('0x3b')](_[_0xd602('0x3c')](_0x45bfdc[_0xd602('0x30')],_0x36b4c0[_0xd602('0x3b')]),_0x55d2a5);if(_0x45bfdc[_0xd602('0x30')][_0xd602('0x3d')]){_0x271619[_0xd602('0x3a')]=_[_0xd602('0x3e')](_0x271619[_0xd602('0x3a')],{'$or':_[_0xd602('0x2c')](_0x55d2a5,function(_0x4dbac6){if(_0x4dbac6[_0xd602('0x2e')]!=='VIRTUAL'){var _0xed7184={};_0xed7184[_0x4dbac6[_0xd602('0x29')]]={'$like':'%'+_0x45bfdc['query'][_0xd602('0x3d')]+'%'};return _0xed7184;}})});}_0x271619=_[_0xd602('0x3e')]({},_0x271619,_0x45bfdc[_0xd602('0x3f')]);var _0x45c16c={'where':_0x271619[_0xd602('0x3a')]};return db[_0xd602('0x40')][_0xd602('0x1f')](_0x45c16c)[_0xd602('0x25')](function(_0x1e3f2b){_0x1c1687[_0xd602('0x1f')]=_0x1e3f2b;if(_0x45bfdc[_0xd602('0x30')]['includeAll']){_0x271619[_0xd602('0x41')]=[{'all':!![]}];}return db[_0xd602('0x40')]['findAll'](_0x271619);})[_0xd602('0x25')](function(_0x44e4a4){_0x1c1687['rows']=_0x44e4a4;return _0x1c1687;})[_0xd602('0x25')](respondWithFilteredResult(_0x24905f,_0x271619))[_0xd602('0x42')](handleError(_0x24905f,null));};exports[_0xd602('0x43')]=function(_0x5b05ac,_0x10e1fc){var _0x137d19={'raw':!![],'where':{'id':_0x5b05ac['params']['id']}},_0x4f194d={};_0x4f194d[_0xd602('0x33')]=_[_0xd602('0x31')](db[_0xd602('0x40')]['rawAttributes']);_0x4f194d[_0xd602('0x30')]=_[_0xd602('0x31')](_0x5b05ac['query']);_0x4f194d[_0xd602('0x3b')]=_[_0xd602('0x32')](_0x4f194d[_0xd602('0x33')],_0x4f194d[_0xd602('0x30')]);_0x137d19[_0xd602('0x34')]=_[_0xd602('0x32')](_0x4f194d[_0xd602('0x33')],qs['fields'](_0x5b05ac[_0xd602('0x30')][_0xd602('0x35')]));_0x137d19[_0xd602('0x34')]=_0x137d19[_0xd602('0x34')][_0xd602('0x36')]?_0x137d19[_0xd602('0x34')]:_0x4f194d[_0xd602('0x33')];if(_0x5b05ac[_0xd602('0x30')][_0xd602('0x44')]){_0x137d19[_0xd602('0x41')]=[{'all':!![]}];}_0x137d19=_[_0xd602('0x3e')]({},_0x137d19,_0x5b05ac[_0xd602('0x3f')]);return db['VtigerField']['find'](_0x137d19)[_0xd602('0x25')](handleEntityNotFound(_0x10e1fc,null))[_0xd602('0x25')](respondWithResult(_0x10e1fc,null))['catch'](handleError(_0x10e1fc,null));};exports[_0xd602('0x45')]=function(_0x335ded,_0x2b767c){return db[_0xd602('0x40')]['create'](_0x335ded[_0xd602('0x46')],{})[_0xd602('0x25')](respondWithResult(_0x2b767c,0xc9))['catch'](handleError(_0x2b767c,null));};exports[_0xd602('0x47')]=function(_0x2d9295,_0x191e4a){if(_0x2d9295['body']['id']){delete _0x2d9295[_0xd602('0x46')]['id'];}return db[_0xd602('0x40')][_0xd602('0x48')]({'where':{'id':_0x2d9295[_0xd602('0x49')]['id']}})[_0xd602('0x25')](handleEntityNotFound(_0x191e4a,null))['then'](saveUpdates(_0x2d9295[_0xd602('0x46')],null))['then'](respondWithResult(_0x191e4a,null))['catch'](handleError(_0x191e4a,null));};exports[_0xd602('0x26')]=function(_0x478c41,_0xc3610d){return db['VtigerField']['find']({'where':{'id':_0x478c41[_0xd602('0x49')]['id']}})['then'](handleEntityNotFound(_0xc3610d,null))[_0xd602('0x25')](removeEntity(_0xc3610d,null))['catch'](handleError(_0xc3610d,null));}; \ No newline at end of file +var _0xcf90=['rawAttributes','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','includeAll','find','create','body','update','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','then','destroy','sendStatus','error','name','send','index','map','VtigerField'];(function(_0xc4b96d,_0xc752cd){var _0x27dea5=function(_0x191d94){while(--_0x191d94){_0xc4b96d['push'](_0xc4b96d['shift']());}};_0x27dea5(++_0xc752cd);}(_0xcf90,0x19b));var _0x0cf9=function(_0x4a57ab,_0x2baf24){_0x4a57ab=_0x4a57ab-0x0;var _0x45d2b6=_0xcf90[_0x4a57ab];return _0x45d2b6;};'use strict';var emlformat=require(_0x0cf9('0x0'));var rimraf=require(_0x0cf9('0x1'));var zipdir=require(_0x0cf9('0x2'));var jsonpatch=require(_0x0cf9('0x3'));var rp=require(_0x0cf9('0x4'));var moment=require(_0x0cf9('0x5'));var BPromise=require(_0x0cf9('0x6'));var Mustache=require(_0x0cf9('0x7'));var util=require(_0x0cf9('0x8'));var path=require(_0x0cf9('0x9'));var sox=require(_0x0cf9('0xa'));var csv=require(_0x0cf9('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0cf9('0xc'));var _=require(_0x0cf9('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0cf9('0xe'));var deskjs=require(_0x0cf9('0xf'));var toCsv=require(_0x0cf9('0xb'));var querystring=require('querystring');var Papa=require(_0x0cf9('0x10'));var Redis=require(_0x0cf9('0x11'));var authService=require(_0x0cf9('0x12'));var qs=require(_0x0cf9('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0cf9('0x14'));var logger=require(_0x0cf9('0x15'))(_0x0cf9('0x16'));var utils=require(_0x0cf9('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x0cf9('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x8d893,_0x1d5926){_0x1d5926=_0x1d5926||0xcc;return function(_0x2aecd9){if(_0x2aecd9){return _0x8d893['sendStatus'](_0x1d5926);}return _0x8d893[_0x0cf9('0x19')](_0x1d5926)[_0x0cf9('0x1a')]();};}function respondWithResult(_0x25ec81,_0x1cbc2b){_0x1cbc2b=_0x1cbc2b||0xc8;return function(_0x181e1f){if(_0x181e1f){return _0x25ec81[_0x0cf9('0x19')](_0x1cbc2b)[_0x0cf9('0x1b')](_0x181e1f);}};}function respondWithFilteredResult(_0x52e6ae,_0x2d2fdf){return function(_0x294f79){if(_0x294f79){var _0x478b72=typeof _0x2d2fdf['offset']===_0x0cf9('0x1c')&&typeof _0x2d2fdf[_0x0cf9('0x1d')]===_0x0cf9('0x1c');var _0xac3079=_0x294f79[_0x0cf9('0x1e')];var _0x3ce34b=_0x478b72?0x0:_0x2d2fdf[_0x0cf9('0x1f')];var _0x5e63ef=_0x478b72?_0x294f79[_0x0cf9('0x1e')]:_0x2d2fdf[_0x0cf9('0x1f')]+_0x2d2fdf[_0x0cf9('0x1d')];var _0x2a0830;if(_0x5e63ef>=_0xac3079){_0x5e63ef=_0xac3079;_0x2a0830=0xc8;}else{_0x2a0830=0xce;}_0x52e6ae[_0x0cf9('0x19')](_0x2a0830);return _0x52e6ae[_0x0cf9('0x20')](_0x0cf9('0x21'),_0x3ce34b+'-'+_0x5e63ef+'/'+_0xac3079)[_0x0cf9('0x1b')](_0x294f79);}return null;};}function patchUpdates(_0x346eb6){return function(_0x28df59){try{jsonpatch[_0x0cf9('0x22')](_0x28df59,_0x346eb6,!![]);}catch(_0x269cc2){return BPromise[_0x0cf9('0x23')](_0x269cc2);}return _0x28df59['save']();};}function saveUpdates(_0x322fdc,_0x187e47){return function(_0xabe43){if(_0xabe43){return _0xabe43['update'](_0x322fdc)[_0x0cf9('0x24')](function(_0x32dd7a){return _0x32dd7a;});}return null;};}function removeEntity(_0x5a4bbb,_0x5e12fe){return function(_0x932049){if(_0x932049){return _0x932049[_0x0cf9('0x25')]()['then'](function(){_0x5a4bbb[_0x0cf9('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3aaba1,_0x114f1e){return function(_0x346a77){if(!_0x346a77){_0x3aaba1[_0x0cf9('0x26')](0x194);}return _0x346a77;};}function handleError(_0x243bb0,_0x4507ba){_0x4507ba=_0x4507ba||0x1f4;return function(_0x3cafbc){logger[_0x0cf9('0x27')](_0x3cafbc['stack']);if(_0x3cafbc[_0x0cf9('0x28')]){delete _0x3cafbc['name'];}_0x243bb0[_0x0cf9('0x19')](_0x4507ba)[_0x0cf9('0x29')](_0x3cafbc);};}exports[_0x0cf9('0x2a')]=function(_0x1b13b3,_0x4a2743){var _0x45b26d={},_0x33d15c={},_0x232f19={'count':0x0,'rows':[]};var _0x400f43=_[_0x0cf9('0x2b')](db[_0x0cf9('0x2c')][_0x0cf9('0x2d')],function(_0x1c30cd){return{'name':_0x1c30cd['fieldName'],'type':_0x1c30cd[_0x0cf9('0x2e')][_0x0cf9('0x2f')]};});_0x33d15c[_0x0cf9('0x30')]=_['map'](_0x400f43,_0x0cf9('0x28'));_0x33d15c[_0x0cf9('0x31')]=_[_0x0cf9('0x32')](_0x1b13b3['query']);_0x33d15c['filters']=_['intersection'](_0x33d15c[_0x0cf9('0x30')],_0x33d15c['query']);_0x45b26d[_0x0cf9('0x33')]=_[_0x0cf9('0x34')](_0x33d15c[_0x0cf9('0x30')],qs[_0x0cf9('0x35')](_0x1b13b3[_0x0cf9('0x31')][_0x0cf9('0x35')]));_0x45b26d['attributes']=_0x45b26d[_0x0cf9('0x33')][_0x0cf9('0x36')]?_0x45b26d[_0x0cf9('0x33')]:_0x33d15c['model'];if(!_0x1b13b3[_0x0cf9('0x31')][_0x0cf9('0x37')](_0x0cf9('0x38'))){_0x45b26d['limit']=qs[_0x0cf9('0x1d')](_0x1b13b3[_0x0cf9('0x31')][_0x0cf9('0x1d')]);_0x45b26d[_0x0cf9('0x1f')]=qs[_0x0cf9('0x1f')](_0x1b13b3['query'][_0x0cf9('0x1f')]);}_0x45b26d[_0x0cf9('0x39')]=qs[_0x0cf9('0x3a')](_0x1b13b3[_0x0cf9('0x31')][_0x0cf9('0x3a')]);_0x45b26d[_0x0cf9('0x3b')]=qs[_0x0cf9('0x3c')](_['pick'](_0x1b13b3[_0x0cf9('0x31')],_0x33d15c['filters']),_0x400f43);if(_0x1b13b3[_0x0cf9('0x31')][_0x0cf9('0x3d')]){_0x45b26d[_0x0cf9('0x3b')]=_[_0x0cf9('0x3e')](_0x45b26d['where'],{'$or':_[_0x0cf9('0x2b')](_0x400f43,function(_0x2a29f4){if(_0x2a29f4['type']!==_0x0cf9('0x3f')){var _0x476312={};_0x476312[_0x2a29f4[_0x0cf9('0x28')]]={'$like':'%'+_0x1b13b3[_0x0cf9('0x31')]['filter']+'%'};return _0x476312;}})});}_0x45b26d=_['merge']({},_0x45b26d,_0x1b13b3[_0x0cf9('0x40')]);var _0x2e29f7={'where':_0x45b26d[_0x0cf9('0x3b')]};return db[_0x0cf9('0x2c')][_0x0cf9('0x1e')](_0x2e29f7)[_0x0cf9('0x24')](function(_0x25f818){_0x232f19['count']=_0x25f818;if(_0x1b13b3[_0x0cf9('0x31')]['includeAll']){_0x45b26d[_0x0cf9('0x41')]=[{'all':!![]}];}return db[_0x0cf9('0x2c')][_0x0cf9('0x42')](_0x45b26d);})[_0x0cf9('0x24')](function(_0x31873d){_0x232f19[_0x0cf9('0x43')]=_0x31873d;return _0x232f19;})[_0x0cf9('0x24')](respondWithFilteredResult(_0x4a2743,_0x45b26d))[_0x0cf9('0x44')](handleError(_0x4a2743,null));};exports[_0x0cf9('0x45')]=function(_0x2238a3,_0x37f838){var _0x50e750={'raw':!![],'where':{'id':_0x2238a3['params']['id']}},_0x586754={};_0x586754['model']=_['keys'](db[_0x0cf9('0x2c')]['rawAttributes']);_0x586754[_0x0cf9('0x31')]=_[_0x0cf9('0x32')](_0x2238a3[_0x0cf9('0x31')]);_0x586754['filters']=_[_0x0cf9('0x34')](_0x586754[_0x0cf9('0x30')],_0x586754[_0x0cf9('0x31')]);_0x50e750['attributes']=_[_0x0cf9('0x34')](_0x586754[_0x0cf9('0x30')],qs['fields'](_0x2238a3['query'][_0x0cf9('0x35')]));_0x50e750[_0x0cf9('0x33')]=_0x50e750[_0x0cf9('0x33')][_0x0cf9('0x36')]?_0x50e750['attributes']:_0x586754['model'];if(_0x2238a3[_0x0cf9('0x31')][_0x0cf9('0x46')]){_0x50e750[_0x0cf9('0x41')]=[{'all':!![]}];}_0x50e750=_[_0x0cf9('0x3e')]({},_0x50e750,_0x2238a3[_0x0cf9('0x40')]);return db[_0x0cf9('0x2c')][_0x0cf9('0x47')](_0x50e750)[_0x0cf9('0x24')](handleEntityNotFound(_0x37f838,null))['then'](respondWithResult(_0x37f838,null))[_0x0cf9('0x44')](handleError(_0x37f838,null));};exports[_0x0cf9('0x48')]=function(_0x4281f7,_0x477c13){return db[_0x0cf9('0x2c')]['create'](_0x4281f7[_0x0cf9('0x49')],{})['then'](respondWithResult(_0x477c13,0xc9))['catch'](handleError(_0x477c13,null));};exports[_0x0cf9('0x4a')]=function(_0x3efc44,_0x2b13f8){if(_0x3efc44[_0x0cf9('0x49')]['id']){delete _0x3efc44['body']['id'];}return db[_0x0cf9('0x2c')]['find']({'where':{'id':_0x3efc44[_0x0cf9('0x4b')]['id']}})[_0x0cf9('0x24')](handleEntityNotFound(_0x2b13f8,null))['then'](saveUpdates(_0x3efc44[_0x0cf9('0x49')],null))['then'](respondWithResult(_0x2b13f8,null))['catch'](handleError(_0x2b13f8,null));};exports[_0x0cf9('0x25')]=function(_0x1e646e,_0x1c66d0){return db[_0x0cf9('0x2c')]['find']({'where':{'id':_0x1e646e[_0x0cf9('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1c66d0,null))[_0x0cf9('0x24')](removeEntity(_0x1c66d0,null))[_0x0cf9('0x44')](handleError(_0x1c66d0,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index ef3c4dc..a9a468f 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 _0x7746=['rimraf','exports','define','VtigerField','int_vtiger_fields','vtiger_unique_index','idField','lodash','util','../../config/logger','api','bluebird','path'];(function(_0x427214,_0xaa01af){var _0x4a9fe0=function(_0x6ab42){while(--_0x6ab42){_0x427214['push'](_0x427214['shift']());}};_0x4a9fe0(++_0xaa01af);}(_0x7746,0x1e8));var _0x6774=function(_0x596b1a,_0x54544a){_0x596b1a=_0x596b1a-0x0;var _0x2f40a9=_0x7746[_0x596b1a];return _0x2f40a9;};'use strict';var _=require(_0x6774('0x0'));var util=require(_0x6774('0x1'));var logger=require(_0x6774('0x2'))(_0x6774('0x3'));var moment=require('moment');var BPromise=require(_0x6774('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6774('0x5'));var rimraf=require(_0x6774('0x6'));var config=require('../../config/environment');var attributes=require('./intVtigerField.attributes');module[_0x6774('0x7')]=function(_0x1c3939,_0x4d9988){return _0x1c3939[_0x6774('0x8')](_0x6774('0x9'),attributes,{'tableName':_0x6774('0xa'),'paranoid':![],'indexes':[{'name':_0x6774('0xb'),'fields':[_0x6774('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1a9a=['../../config/environment','./intVtigerField.attributes','exports','define','VtigerField','int_vtiger_fields','vtiger_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x324ce6,_0x6b3b52){var _0x3e90ed=function(_0x57a9db){while(--_0x57a9db){_0x324ce6['push'](_0x324ce6['shift']());}};_0x3e90ed(++_0x6b3b52);}(_0x1a9a,0x1b2));var _0xa1a9=function(_0x52f48b,_0x56b08b){_0x52f48b=_0x52f48b-0x0;var _0x268c0d=_0x1a9a[_0x52f48b];return _0x268c0d;};'use strict';var _=require(_0xa1a9('0x0'));var util=require(_0xa1a9('0x1'));var logger=require(_0xa1a9('0x2'))(_0xa1a9('0x3'));var moment=require(_0xa1a9('0x4'));var BPromise=require('bluebird');var rp=require(_0xa1a9('0x5'));var fs=require('fs');var path=require(_0xa1a9('0x6'));var rimraf=require(_0xa1a9('0x7'));var config=require(_0xa1a9('0x8'));var attributes=require(_0xa1a9('0x9'));module[_0xa1a9('0xa')]=function(_0x1b37f1,_0x287cef){return _0x1b37f1[_0xa1a9('0xb')](_0xa1a9('0xc'),attributes,{'tableName':_0xa1a9('0xd'),'paranoid':![],'indexes':[{'name':_0xa1a9('0xe'),'fields':[_0xa1a9('0xf'),_0xa1a9('0x10')],'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 5a1a207..bb0cfe5 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 _0xf3f6=['stringify','error','code','message','lodash','moment','bluebird','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s'];(function(_0x598ef5,_0x346cc3){var _0x1285f7=function(_0x29a8b7){while(--_0x29a8b7){_0x598ef5['push'](_0x598ef5['shift']());}};_0x1285f7(++_0x346cc3);}(_0xf3f6,0x121));var _0x6f3f=function(_0x354be8,_0x849c74){_0x354be8=_0x354be8-0x0;var _0x49e68a=_0xf3f6[_0x354be8];return _0x49e68a;};'use strict';var _=require(_0x6f3f('0x0'));var util=require('util');var moment=require(_0x6f3f('0x1'));var BPromise=require(_0x6f3f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6f3f('0x3'))(_0x6f3f('0x4'));var config=require(_0x6f3f('0x5'));var jayson=require(_0x6f3f('0x6'));var client=jayson[_0x6f3f('0x7')][_0x6f3f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x543aaa,_0x4cc1c,_0x427466){return new BPromise(function(_0x1938d3,_0x3d110d){return client[_0x6f3f('0x9')](_0x543aaa,_0x427466)['then'](function(_0x360c88){logger[_0x6f3f('0xa')](_0x6f3f('0xb'),_0x4cc1c,_0x6f3f('0xc'));logger[_0x6f3f('0xd')](_0x6f3f('0xe'),_0x4cc1c,_0x6f3f('0xc'),JSON[_0x6f3f('0xf')](_0x360c88));if(_0x360c88[_0x6f3f('0x10')]){if(_0x360c88[_0x6f3f('0x10')][_0x6f3f('0x11')]===0x1f4){logger[_0x6f3f('0x10')](_0x6f3f('0xb'),_0x4cc1c,_0x360c88[_0x6f3f('0x10')][_0x6f3f('0x12')]);return _0x3d110d(_0x360c88['error']['message']);}logger['error'](_0x6f3f('0xb'),_0x4cc1c,_0x360c88[_0x6f3f('0x10')][_0x6f3f('0x12')]);return _0x1938d3(_0x360c88[_0x6f3f('0x10')][_0x6f3f('0x12')]);}else{logger['info'](_0x6f3f('0xb'),_0x4cc1c,_0x6f3f('0xc'));_0x1938d3(_0x360c88['result'][_0x6f3f('0x12')]);}})['catch'](function(_0x15b3e0){logger['error']('VtigerField,\x20%s,\x20%s',_0x4cc1c,_0x15b3e0);_0x3d110d(_0x15b3e0);});});} \ No newline at end of file +var _0xf498=['request','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http'];(function(_0xb76cb7,_0x530596){var _0x1d417b=function(_0x183576){while(--_0x183576){_0xb76cb7['push'](_0xb76cb7['shift']());}};_0x1d417b(++_0x530596);}(_0xf498,0x108));var _0x8f49=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0xf498[_0x1a36a5];return _0x746243;};'use strict';var _=require(_0x8f49('0x0'));var util=require('util');var moment=require(_0x8f49('0x1'));var BPromise=require(_0x8f49('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8f49('0x3'));var db=require(_0x8f49('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8f49('0x5'));var config=require(_0x8f49('0x6'));var jayson=require(_0x8f49('0x7'));var client=jayson['client'][_0x8f49('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x25d471,_0x2b6f74,_0x211b5b){return new BPromise(function(_0x5b563b,_0x380320){return client[_0x8f49('0x9')](_0x25d471,_0x211b5b)['then'](function(_0x373bae){logger[_0x8f49('0xa')](_0x8f49('0xb'),_0x2b6f74,_0x8f49('0xc'));logger[_0x8f49('0xd')](_0x8f49('0xe'),_0x2b6f74,_0x8f49('0xc'),JSON[_0x8f49('0xf')](_0x373bae));if(_0x373bae[_0x8f49('0x10')]){if(_0x373bae[_0x8f49('0x10')][_0x8f49('0x11')]===0x1f4){logger[_0x8f49('0x10')](_0x8f49('0xb'),_0x2b6f74,_0x373bae[_0x8f49('0x10')][_0x8f49('0x12')]);return _0x380320(_0x373bae[_0x8f49('0x10')]['message']);}logger[_0x8f49('0x10')](_0x8f49('0xb'),_0x2b6f74,_0x373bae[_0x8f49('0x10')][_0x8f49('0x12')]);return _0x5b563b(_0x373bae[_0x8f49('0x10')][_0x8f49('0x12')]);}else{logger[_0x8f49('0xa')](_0x8f49('0xb'),_0x2b6f74,_0x8f49('0xc'));_0x5b563b(_0x373bae[_0x8f49('0x13')][_0x8f49('0x12')]);}})[_0x8f49('0x14')](function(_0x5aa68a){logger[_0x8f49('0x10')](_0x8f49('0xb'),_0x2b6f74,_0x5aa68a);_0x380320(_0x5aa68a);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 3324a23..1ba3fdc 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 _0xd8ee=['create','addConfiguration','put','update','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post'];(function(_0xbc2974,_0xec3342){var _0x3a5b4f=function(_0x5ec5b5){while(--_0x5ec5b5){_0xbc2974['push'](_0xbc2974['shift']());}};_0x3a5b4f(++_0xec3342);}(_0xd8ee,0x1b6));var _0xed8e=function(_0x6c73b3,_0x18b2cf){_0x6c73b3=_0x6c73b3-0x0;var _0x4753fd=_0xd8ee[_0x6c73b3];return _0x4753fd;};'use strict';var multer=require(_0xed8e('0x0'));var util=require(_0xed8e('0x1'));var path=require(_0xed8e('0x2'));var timeout=require(_0xed8e('0x3'));var express=require('express');var router=express[_0xed8e('0x4')]();var fs_extra=require(_0xed8e('0x5'));var auth=require(_0xed8e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xed8e('0x7'));var controller=require(_0xed8e('0x8'));router[_0xed8e('0x9')]('/',auth[_0xed8e('0xa')](),controller['index']);router['get'](_0xed8e('0xb'),auth['isAuthenticated'](),controller[_0xed8e('0xc')]);router[_0xed8e('0x9')](_0xed8e('0xd'),auth[_0xed8e('0xa')](),controller[_0xed8e('0xe')]);router[_0xed8e('0x9')](_0xed8e('0xf'),auth['isAuthenticated'](),controller[_0xed8e('0x10')]);router[_0xed8e('0x11')]('/',auth[_0xed8e('0xa')](),controller[_0xed8e('0x12')]);router[_0xed8e('0x11')](_0xed8e('0xd'),auth[_0xed8e('0xa')](),controller[_0xed8e('0x13')]);router[_0xed8e('0x14')]('/:id',auth[_0xed8e('0xa')](),controller[_0xed8e('0x15')]);router[_0xed8e('0x16')](_0xed8e('0xb'),auth['isAuthenticated'](),controller[_0xed8e('0x17')]);module['exports']=router; \ No newline at end of file +var _0xe084=['destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','isAuthenticated','getFields','post','create','addConfiguration','delete'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0xe084,0x192));var _0x4e08=function(_0x3c8c09,_0x2610c0){_0x3c8c09=_0x3c8c09-0x0;var _0x2c5c54=_0xe084[_0x3c8c09];return _0x2c5c54;};'use strict';var multer=require('multer');var util=require(_0x4e08('0x0'));var path=require(_0x4e08('0x1'));var timeout=require(_0x4e08('0x2'));var express=require(_0x4e08('0x3'));var router=express[_0x4e08('0x4')]();var fs_extra=require(_0x4e08('0x5'));var auth=require(_0x4e08('0x6'));var interaction=require(_0x4e08('0x7'));var config=require(_0x4e08('0x8'));var controller=require(_0x4e08('0x9'));router[_0x4e08('0xa')]('/',auth['isAuthenticated'](),controller[_0x4e08('0xb')]);router[_0x4e08('0xa')](_0x4e08('0xc'),auth['isAuthenticated'](),controller[_0x4e08('0xd')]);router[_0x4e08('0xa')](_0x4e08('0xe'),auth['isAuthenticated'](),controller[_0x4e08('0xf')]);router[_0x4e08('0xa')](_0x4e08('0x10'),auth[_0x4e08('0x11')](),controller[_0x4e08('0x12')]);router[_0x4e08('0x13')]('/',auth[_0x4e08('0x11')](),controller[_0x4e08('0x14')]);router[_0x4e08('0x13')](_0x4e08('0xe'),auth[_0x4e08('0x11')](),controller[_0x4e08('0x15')]);router['put']('/:id',auth[_0x4e08('0x11')](),controller['update']);router[_0x4e08('0x16')](_0x4e08('0xc'),auth[_0x4e08('0x11')](),controller[_0x4e08('0x17')]);module[_0x4e08('0x18')]=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index 8c571e9..958b67a 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 _0x4813=['password','token','newTab','integrationTab','sequelize','exports','STRING','username','remoteUri','ENUM'];(function(_0x434276,_0xac4ff8){var _0x41c7fd=function(_0x56521f){while(--_0x56521f){_0x434276['push'](_0x434276['shift']());}};_0x41c7fd(++_0xac4ff8);}(_0x4813,0x14e));var _0x3481=function(_0x20ccb3,_0x47fc14){_0x20ccb3=_0x20ccb3-0x0;var _0x38e5e7=_0x4813[_0x20ccb3];return _0x38e5e7;};'use strict';var Sequelize=require(_0x3481('0x0'));module[_0x3481('0x1')]={'name':{'type':Sequelize[_0x3481('0x2')]},'description':{'type':Sequelize[_0x3481('0x2')]},'username':{'type':Sequelize[_0x3481('0x2')],'unique':_0x3481('0x3')},'password':{'type':Sequelize[_0x3481('0x2')]},'token':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x3481('0x2')],'unique':_0x3481('0x4')},'authType':{'type':Sequelize[_0x3481('0x5')](_0x3481('0x6'),_0x3481('0x7')),'defaultValue':'password'},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x3481('0x5')]('integrationTab',_0x3481('0x8')),'defaultValue':_0x3481('0x9')}}; \ No newline at end of file +var _0xafb9=['exports','STRING','username','password','integrationTab','newTab','sequelize'];(function(_0x55677b,_0x3e5655){var _0x104b88=function(_0x78d34f){while(--_0x78d34f){_0x55677b['push'](_0x55677b['shift']());}};_0x104b88(++_0x3e5655);}(_0xafb9,0x68));var _0x9afb=function(_0x5973bd,_0x2955e2){_0x5973bd=_0x5973bd-0x0;var _0x342ec9=_0xafb9[_0x5973bd];return _0x342ec9;};'use strict';var Sequelize=require(_0x9afb('0x0'));module[_0x9afb('0x1')]={'name':{'type':Sequelize[_0x9afb('0x2')]},'description':{'type':Sequelize[_0x9afb('0x2')]},'username':{'type':Sequelize[_0x9afb('0x2')],'unique':_0x9afb('0x3')},'password':{'type':Sequelize[_0x9afb('0x2')]},'token':{'type':Sequelize[_0x9afb('0x2')]},'remoteUri':{'type':Sequelize[_0x9afb('0x2')],'unique':'remoteUri'},'authType':{'type':Sequelize['ENUM'](_0x9afb('0x4'),'token'),'defaultValue':_0x9afb('0x4')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x9afb('0x5'),_0x9afb('0x6')),'defaultValue':_0x9afb('0x5')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index c808616..18bb795 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 _0x4ded=['hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','catch','params','keys','rawAttributes','intersection','include','find','create','body','findOne','ZendeskConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','username','password','token','authType','remoteUri','substring','format','%s/%s','headers','Basic\x20%s','toString','base64','%s/token:%s','Sequelize','subject','description','group','assignee','ticket_fields','includes','position','system_field_options','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','ZendeskAccount','type','model','query','filters','fields','attributes','length'];(function(_0x4637f3,_0x5137f7){var _0x497b5b=function(_0x3ceae0){while(--_0x3ceae0){_0x4637f3['push'](_0x4637f3['shift']());}};_0x497b5b(++_0x5137f7);}(_0x4ded,0x116));var _0xd4de=function(_0x5d91ae,_0x11646e){_0x5d91ae=_0x5d91ae-0x0;var _0x84287e=_0x4ded[_0x5d91ae];return _0x84287e;};'use strict';var emlformat=require(_0xd4de('0x0'));var rimraf=require(_0xd4de('0x1'));var zipdir=require(_0xd4de('0x2'));var jsonpatch=require(_0xd4de('0x3'));var rp=require(_0xd4de('0x4'));var moment=require(_0xd4de('0x5'));var BPromise=require(_0xd4de('0x6'));var Mustache=require(_0xd4de('0x7'));var util=require(_0xd4de('0x8'));var path=require(_0xd4de('0x9'));var sox=require(_0xd4de('0xa'));var csv=require(_0xd4de('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd4de('0xc'));var _=require(_0xd4de('0xd'));var squel=require(_0xd4de('0xe'));var crypto=require(_0xd4de('0xf'));var jsforce=require(_0xd4de('0x10'));var deskjs=require(_0xd4de('0x11'));var toCsv=require('to-csv');var querystring=require(_0xd4de('0x12'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xd4de('0x13'));var as=require(_0xd4de('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xd4de('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xd4de('0x16'));var db=require(_0xd4de('0x17'))['db'];var integrations=require(_0xd4de('0x18'));function respondWithStatusCode(_0x2aa09d,_0x3ffc72){_0x3ffc72=_0x3ffc72||0xcc;return function(_0x3af6e0){if(_0x3af6e0){return _0x2aa09d[_0xd4de('0x19')](_0x3ffc72);}return _0x2aa09d[_0xd4de('0x1a')](_0x3ffc72)[_0xd4de('0x1b')]();};}function respondWithResult(_0x37cb9f,_0x691ba9){_0x691ba9=_0x691ba9||0xc8;return function(_0xd0d906){if(_0xd0d906){return _0x37cb9f[_0xd4de('0x1a')](_0x691ba9)[_0xd4de('0x1c')](_0xd0d906);}};}function respondWithFilteredResult(_0x102e5b,_0xa7c18b){return function(_0x325fba){if(_0x325fba){var _0x4b0a95=typeof _0xa7c18b['offset']===_0xd4de('0x1d')&&typeof _0xa7c18b[_0xd4de('0x1e')]===_0xd4de('0x1d');var _0x428aa2=_0x325fba['count'];var _0x4d0df6=_0x4b0a95?0x0:_0xa7c18b[_0xd4de('0x1f')];var _0x54b757=_0x4b0a95?_0x325fba[_0xd4de('0x20')]:_0xa7c18b[_0xd4de('0x1f')]+_0xa7c18b['limit'];var _0xc15081;if(_0x54b757>=_0x428aa2){_0x54b757=_0x428aa2;_0xc15081=0xc8;}else{_0xc15081=0xce;}_0x102e5b['status'](_0xc15081);return _0x102e5b[_0xd4de('0x21')](_0xd4de('0x22'),_0x4d0df6+'-'+_0x54b757+'/'+_0x428aa2)[_0xd4de('0x1c')](_0x325fba);}return null;};}function patchUpdates(_0x8e8712){return function(_0x5368f5){try{jsonpatch[_0xd4de('0x23')](_0x5368f5,_0x8e8712,!![]);}catch(_0x47311c){return BPromise[_0xd4de('0x24')](_0x47311c);}return _0x5368f5[_0xd4de('0x25')]();};}function saveUpdates(_0x1c631a,_0x2d092a){return function(_0x1561fd){if(_0x1561fd){return _0x1561fd[_0xd4de('0x26')](_0x1c631a)[_0xd4de('0x27')](function(_0x413f68){return _0x413f68;});}return null;};}function removeEntity(_0x534b37,_0xad333f){return function(_0x88a0b9){if(_0x88a0b9){return _0x88a0b9[_0xd4de('0x28')]()[_0xd4de('0x27')](function(){_0x534b37[_0xd4de('0x1a')](0xcc)[_0xd4de('0x1b')]();});}};}function handleEntityNotFound(_0xffe1cc,_0x36308c){return function(_0x2aa82a){if(!_0x2aa82a){_0xffe1cc[_0xd4de('0x19')](0x194);}return _0x2aa82a;};}function handleError(_0x2ea712,_0xb2d8a1){_0xb2d8a1=_0xb2d8a1||0x1f4;return function(_0x586126){logger[_0xd4de('0x29')](_0x586126[_0xd4de('0x2a')]);if(_0x586126['name']){delete _0x586126[_0xd4de('0x2b')];}_0x2ea712['status'](_0xb2d8a1)[_0xd4de('0x2c')](_0x586126);};}exports[_0xd4de('0x2d')]=function(_0x15d2b7,_0x4fa53a){var _0xd4de93={},_0x36f2f1={},_0x17f0a={'count':0x0,'rows':[]};var _0x50cb73=_[_0xd4de('0x2e')](db[_0xd4de('0x2f')]['rawAttributes'],function(_0x5103b5){return{'name':_0x5103b5['fieldName'],'type':_0x5103b5[_0xd4de('0x30')]['key']};});_0x36f2f1[_0xd4de('0x31')]=_[_0xd4de('0x2e')](_0x50cb73,_0xd4de('0x2b'));_0x36f2f1[_0xd4de('0x32')]=_['keys'](_0x15d2b7[_0xd4de('0x32')]);_0x36f2f1[_0xd4de('0x33')]=_['intersection'](_0x36f2f1[_0xd4de('0x31')],_0x36f2f1[_0xd4de('0x32')]);_0xd4de93['attributes']=_['intersection'](_0x36f2f1[_0xd4de('0x31')],qs[_0xd4de('0x34')](_0x15d2b7[_0xd4de('0x32')][_0xd4de('0x34')]));_0xd4de93['attributes']=_0xd4de93[_0xd4de('0x35')][_0xd4de('0x36')]?_0xd4de93['attributes']:_0x36f2f1[_0xd4de('0x31')];if(!_0x15d2b7[_0xd4de('0x32')][_0xd4de('0x37')](_0xd4de('0x38'))){_0xd4de93[_0xd4de('0x1e')]=qs[_0xd4de('0x1e')](_0x15d2b7['query']['limit']);_0xd4de93[_0xd4de('0x1f')]=qs[_0xd4de('0x1f')](_0x15d2b7[_0xd4de('0x32')]['offset']);}_0xd4de93[_0xd4de('0x39')]=qs[_0xd4de('0x3a')](_0x15d2b7['query'][_0xd4de('0x3a')]);_0xd4de93[_0xd4de('0x3b')]=qs[_0xd4de('0x33')](_[_0xd4de('0x3c')](_0x15d2b7['query'],_0x36f2f1['filters']),_0x50cb73);if(_0x15d2b7[_0xd4de('0x32')]['filter']){_0xd4de93[_0xd4de('0x3b')]=_['merge'](_0xd4de93[_0xd4de('0x3b')],{'$or':_[_0xd4de('0x2e')](_0x50cb73,function(_0x21cd77){if(_0x21cd77[_0xd4de('0x30')]!=='VIRTUAL'){var _0x21209d={};_0x21209d[_0x21cd77['name']]={'$like':'%'+_0x15d2b7[_0xd4de('0x32')][_0xd4de('0x3d')]+'%'};return _0x21209d;}})});}_0xd4de93=_[_0xd4de('0x3e')]({},_0xd4de93,_0x15d2b7[_0xd4de('0x3f')]);var _0x349c5f={'where':_0xd4de93[_0xd4de('0x3b')]};return db[_0xd4de('0x2f')]['count'](_0x349c5f)[_0xd4de('0x27')](function(_0x1eb001){_0x17f0a[_0xd4de('0x20')]=_0x1eb001;if(_0x15d2b7[_0xd4de('0x32')][_0xd4de('0x40')]){_0xd4de93['include']=[{'all':!![]}];}return db[_0xd4de('0x2f')][_0xd4de('0x41')](_0xd4de93);})[_0xd4de('0x27')](function(_0x593ee9){_0x17f0a[_0xd4de('0x42')]=_0x593ee9;return _0x17f0a;})[_0xd4de('0x27')](respondWithFilteredResult(_0x4fa53a,_0xd4de93))[_0xd4de('0x43')](handleError(_0x4fa53a,null));};exports['show']=function(_0x3b9026,_0x10a42c){var _0x419c49={'raw':![],'where':{'id':_0x3b9026[_0xd4de('0x44')]['id']}},_0x3f1e22={};_0x3f1e22[_0xd4de('0x31')]=_[_0xd4de('0x45')](db['ZendeskAccount'][_0xd4de('0x46')]);_0x3f1e22[_0xd4de('0x32')]=_[_0xd4de('0x45')](_0x3b9026['query']);_0x3f1e22[_0xd4de('0x33')]=_[_0xd4de('0x47')](_0x3f1e22[_0xd4de('0x31')],_0x3f1e22['query']);_0x419c49['attributes']=_[_0xd4de('0x47')](_0x3f1e22[_0xd4de('0x31')],qs['fields'](_0x3b9026[_0xd4de('0x32')][_0xd4de('0x34')]));_0x419c49[_0xd4de('0x35')]=_0x419c49[_0xd4de('0x35')]['length']?_0x419c49[_0xd4de('0x35')]:_0x3f1e22[_0xd4de('0x31')];if(_0x3b9026[_0xd4de('0x32')][_0xd4de('0x40')]){_0x419c49[_0xd4de('0x48')]=[{'all':!![]}];}_0x419c49=_[_0xd4de('0x3e')]({},_0x419c49,_0x3b9026['options']);return db[_0xd4de('0x2f')][_0xd4de('0x49')](_0x419c49)[_0xd4de('0x27')](handleEntityNotFound(_0x10a42c,null))[_0xd4de('0x27')](respondWithResult(_0x10a42c,null))[_0xd4de('0x43')](handleError(_0x10a42c,null));};exports[_0xd4de('0x4a')]=function(_0x40bf55,_0x425a7e){return db[_0xd4de('0x2f')][_0xd4de('0x4a')](_0x40bf55['body'],{})[_0xd4de('0x27')](respondWithResult(_0x425a7e,0xc9))[_0xd4de('0x43')](handleError(_0x425a7e,null));};exports[_0xd4de('0x26')]=function(_0x518bfe,_0x13a900){if(_0x518bfe[_0xd4de('0x4b')]['id']){delete _0x518bfe[_0xd4de('0x4b')]['id'];}return db[_0xd4de('0x2f')][_0xd4de('0x49')]({'where':{'id':_0x518bfe[_0xd4de('0x44')]['id']}})[_0xd4de('0x27')](handleEntityNotFound(_0x13a900,null))[_0xd4de('0x27')](saveUpdates(_0x518bfe[_0xd4de('0x4b')],null))[_0xd4de('0x27')](respondWithResult(_0x13a900,null))['catch'](handleError(_0x13a900,null));};exports[_0xd4de('0x28')]=function(_0x26d032,_0x215f85){return db[_0xd4de('0x2f')][_0xd4de('0x49')]({'where':{'id':_0x26d032['params']['id']}})['then'](handleEntityNotFound(_0x215f85,null))[_0xd4de('0x27')](removeEntity(_0x215f85,null))[_0xd4de('0x43')](handleError(_0x215f85,null));};exports['getConfigurations']=function(_0x48cb7d,_0x2d8589,_0x368081){var _0x377376={};var _0x199440={};var _0x34d772;var _0x15c8cd;return db[_0xd4de('0x2f')][_0xd4de('0x4c')]({'where':{'id':_0x48cb7d[_0xd4de('0x44')]['id']}})[_0xd4de('0x27')](handleEntityNotFound(_0x2d8589,null))[_0xd4de('0x27')](function(_0x2e1780){if(_0x2e1780){_0x34d772=_0x2e1780;_0x199440['model']=_[_0xd4de('0x45')](db[_0xd4de('0x4d')][_0xd4de('0x46')]);_0x199440[_0xd4de('0x32')]=_[_0xd4de('0x45')](_0x48cb7d[_0xd4de('0x32')]);_0x199440['filters']=_[_0xd4de('0x47')](_0x199440['model'],_0x199440['query']);_0x377376[_0xd4de('0x35')]=_[_0xd4de('0x47')](_0x199440[_0xd4de('0x31')],qs[_0xd4de('0x34')](_0x48cb7d['query'][_0xd4de('0x34')]));_0x377376[_0xd4de('0x35')]=_0x377376[_0xd4de('0x35')][_0xd4de('0x36')]?_0x377376[_0xd4de('0x35')]:_0x199440['model'];_0x377376['order']=qs['sort'](_0x48cb7d[_0xd4de('0x32')][_0xd4de('0x3a')]);_0x377376[_0xd4de('0x3b')]=qs[_0xd4de('0x33')](_['pick'](_0x48cb7d[_0xd4de('0x32')],_0x199440[_0xd4de('0x33')]));if(_0x48cb7d[_0xd4de('0x32')][_0xd4de('0x3d')]){_0x377376['where']=_[_0xd4de('0x3e')](_0x377376[_0xd4de('0x3b')],{'$or':_[_0xd4de('0x2e')](_0x377376[_0xd4de('0x35')],function(_0x598b60){var _0x4fd7c2={};_0x4fd7c2[_0x598b60]={'$like':'%'+_0x48cb7d['query'][_0xd4de('0x3d')]+'%'};return _0x4fd7c2;})});}_0x377376=_[_0xd4de('0x3e')]({},_0x377376,_0x48cb7d[_0xd4de('0x3f')]);return _0x34d772['getConfigurations'](_0x377376);}})[_0xd4de('0x27')](function(_0x3005c2){if(_0x3005c2){_0x15c8cd=_0x3005c2[_0xd4de('0x36')];if(!_0x48cb7d['query'][_0xd4de('0x37')]('nolimit')){_0x377376[_0xd4de('0x1e')]=qs[_0xd4de('0x1e')](_0x48cb7d[_0xd4de('0x32')][_0xd4de('0x1e')]);_0x377376[_0xd4de('0x1f')]=qs[_0xd4de('0x1f')](_0x48cb7d[_0xd4de('0x32')][_0xd4de('0x1f')]);}return _0x34d772['getConfigurations'](_0x377376);}})[_0xd4de('0x27')](function(_0x59f9d9){if(_0x59f9d9){return _0x59f9d9?{'count':_0x15c8cd,'rows':_0x59f9d9}:null;}})[_0xd4de('0x27')](respondWithResult(_0x2d8589,null))[_0xd4de('0x43')](handleError(_0x2d8589,null));};exports['addConfiguration']=function(_0x29c840,_0xb366b0,_0x21f7f7){if(_0x29c840[_0xd4de('0x4b')]['id']){delete _0x29c840[_0xd4de('0x4b')]['id'];}return db[_0xd4de('0x2f')][_0xd4de('0x4c')]({'where':{'id':_0x29c840[_0xd4de('0x44')]['id']}})[_0xd4de('0x27')](handleEntityNotFound(_0xb366b0,null))[_0xd4de('0x27')](function(_0x1e7e93){if(_0x1e7e93){_0x29c840[_0xd4de('0x4b')][_0xd4de('0x4e')]=_0x1e7e93['id'];_0x29c840['body'][_0xd4de('0x4f')]=integrations[_0xd4de('0x50')](_0x29c840[_0xd4de('0x4b')][_0xd4de('0x51')],_0x29c840[_0xd4de('0x4b')][_0xd4de('0x30')]);_0x29c840[_0xd4de('0x4b')][_0xd4de('0x52')]=integrations['getDescriptions'](_0x29c840[_0xd4de('0x4b')]['channel'],_0x29c840['body']['type']);return db[_0xd4de('0x4d')][_0xd4de('0x4a')](_0x29c840['body'],{'include':[{'model':db['ZendeskField'],'as':'Subjects'},{'model':db['ZendeskField'],'as':_0xd4de('0x52')}]});}return null;})['then'](respondWithResult(_0xb366b0,null))[_0xd4de('0x43')](handleError(_0xb366b0,null));};exports['getFields']=function(_0x1a0e6c,_0x223b1a,_0x4ee475){var _0x5df891='';return db['ZendeskAccount']['findOne']({'where':{'id':_0x1a0e6c[_0xd4de('0x44')]['id']},'attributes':['id',_0xd4de('0x53'),_0xd4de('0x54'),_0xd4de('0x55'),_0xd4de('0x56'),_0xd4de('0x57')]})['then'](handleEntityNotFound(_0x223b1a,null))['then'](function(_0x53cbd9){if(_0x53cbd9){_0x5df891=_0x53cbd9[_0xd4de('0x57')];var _0x2bb19d=_0x5df891['slice'](-0x1);if(_0x2bb19d==='/'){_0x5df891=_0x5df891[_0xd4de('0x58')](0x0,_0x5df891['lastIndexOf'](_0x2bb19d));}var _0x1bc101={'method':'GET','uri':util[_0xd4de('0x59')](_0xd4de('0x5a'),_0x5df891,'ticket_fields'),'json':!![]};switch(_0x53cbd9[_0xd4de('0x56')]){case'password':_0x1bc101[_0xd4de('0x5b')]={'Authorization':util[_0xd4de('0x59')](_0xd4de('0x5c'),new Buffer(util[_0xd4de('0x59')]('%s:%s',_0x53cbd9[_0xd4de('0x53')],_0x53cbd9[_0xd4de('0x54')]))[_0xd4de('0x5d')](_0xd4de('0x5e')))};break;case _0xd4de('0x55'):_0x1bc101[_0xd4de('0x5b')]={'Authorization':util[_0xd4de('0x59')](_0xd4de('0x5c'),new Buffer(util[_0xd4de('0x59')](_0xd4de('0x5f'),_0x53cbd9[_0xd4de('0x53')],_0x53cbd9[_0xd4de('0x55')]))[_0xd4de('0x5d')]('base64'))};break;default:throw new db[(_0xd4de('0x60'))]['ValidationError']('Unknown\x20authentication\x20type');}return rp(_0x1bc101);}})[_0xd4de('0x27')](function(_0x595ee){if(_0x595ee){var _0x5f197d=[_0xd4de('0x61'),_0xd4de('0x62'),_0xd4de('0x63'),_0xd4de('0x64')];_['remove'](_0x595ee[_0xd4de('0x65')],function(_0xee18fc){return _0x5f197d[_0xd4de('0x66')](_0xee18fc[_0xd4de('0x30')]);});return{'count':_0x595ee[_0xd4de('0x65')]['length'],'rows':_['map'](_0x595ee['ticket_fields'],function(_0x4a2467){return{'id':_0x4a2467['id'],'name':_0x4a2467[_0xd4de('0x67')]>0x7?_0x4a2467['title']:_0x4a2467[_0xd4de('0x30')],'custom':_0x4a2467['position']>0x7?!![]:![],'options':_0x4a2467[_0xd4de('0x68')]?_0x4a2467[_0xd4de('0x68')]:_0x4a2467[_0xd4de('0x69')]?_0x4a2467[_0xd4de('0x69')]:[]};})};}})[_0xd4de('0x27')](respondWithResult(_0x223b1a,null))[_0xd4de('0x43')](function(_0x15f056){var _0x31b518=_0x1a0e6c['query'][_0xd4de('0x6a')]?0x1f4:_0x15f056[_0xd4de('0x6b')]||0x1f4;logger[_0xd4de('0x29')](_0xd4de('0x6c'),'getFields',_0x31b518,JSON[_0xd4de('0x6d')](_0x15f056));delete _0x15f056[_0xd4de('0x2b')];if(_0x31b518===0x191){_0x31b518=0x190;}_0x223b1a['status'](_0x31b518)[_0xd4de('0x2c')](_0x1a0e6c[_0xd4de('0x32')][_0xd4de('0x6a')]?{'message':_0xd4de('0x6e'),'statusCode':_0x15f056[_0xd4de('0x6b')]}:_0x15f056);});}; \ No newline at end of file +var _0xd64b=['undefined','count','Content-Range','apply','update','then','stack','index','map','ZendeskAccount','rawAttributes','fieldName','type','key','model','name','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','rows','catch','show','params','keys','includeAll','include','merge','options','find','create','body','destroy','getConfigurations','findOne','ZendeskConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','ZendeskField','Descriptions','getFields','username','password','token','remoteUri','substring','GET','format','%s/%s','ticket_fields','headers','Basic\x20%s','%s:%s','toString','base64','Sequelize','ValidationError','subject','description','assignee','remove','position','title','system_field_options','custom_field_options','test','statusCode','error','stringify','Wrong\x20credentials','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','offset','limit'];(function(_0x5ebb96,_0x12cc66){var _0x1c26e7=function(_0x4e8007){while(--_0x4e8007){_0x5ebb96['push'](_0x5ebb96['shift']());}};_0x1c26e7(++_0x12cc66);}(_0xd64b,0xc1));var _0xbd64=function(_0x49dba5,_0x1086fd){_0x49dba5=_0x49dba5-0x0;var _0x495fc6=_0xd64b[_0x49dba5];return _0x495fc6;};'use strict';var emlformat=require(_0xbd64('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbd64('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbd64('0x2'));var moment=require(_0xbd64('0x3'));var BPromise=require(_0xbd64('0x4'));var Mustache=require(_0xbd64('0x5'));var util=require(_0xbd64('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbd64('0x7'));var _=require(_0xbd64('0x8'));var squel=require(_0xbd64('0x9'));var crypto=require(_0xbd64('0xa'));var jsforce=require(_0xbd64('0xb'));var deskjs=require(_0xbd64('0xc'));var toCsv=require(_0xbd64('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xbd64('0xe'));var authService=require(_0xbd64('0xf'));var qs=require(_0xbd64('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbd64('0x11'));var logger=require(_0xbd64('0x12'))(_0xbd64('0x13'));var utils=require(_0xbd64('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xbd64('0x15'));var db=require('../../mysqldb')['db'];var integrations=require(_0xbd64('0x16'));function respondWithStatusCode(_0x2729d8,_0x3a941c){_0x3a941c=_0x3a941c||0xcc;return function(_0x2183e2){if(_0x2183e2){return _0x2729d8[_0xbd64('0x17')](_0x3a941c);}return _0x2729d8[_0xbd64('0x18')](_0x3a941c)[_0xbd64('0x19')]();};}function respondWithResult(_0x269e2f,_0x2b5808){_0x2b5808=_0x2b5808||0xc8;return function(_0x4ae471){if(_0x4ae471){return _0x269e2f[_0xbd64('0x18')](_0x2b5808)[_0xbd64('0x1a')](_0x4ae471);}};}function respondWithFilteredResult(_0x3ff550,_0x32fd34){return function(_0x29fc16){if(_0x29fc16){var _0x49a914=typeof _0x32fd34[_0xbd64('0x1b')]==='undefined'&&typeof _0x32fd34[_0xbd64('0x1c')]===_0xbd64('0x1d');var _0x3aef70=_0x29fc16[_0xbd64('0x1e')];var _0x17d015=_0x49a914?0x0:_0x32fd34[_0xbd64('0x1b')];var _0xa5491d=_0x49a914?_0x29fc16[_0xbd64('0x1e')]:_0x32fd34['offset']+_0x32fd34[_0xbd64('0x1c')];var _0x1f618b;if(_0xa5491d>=_0x3aef70){_0xa5491d=_0x3aef70;_0x1f618b=0xc8;}else{_0x1f618b=0xce;}_0x3ff550['status'](_0x1f618b);return _0x3ff550['set'](_0xbd64('0x1f'),_0x17d015+'-'+_0xa5491d+'/'+_0x3aef70)[_0xbd64('0x1a')](_0x29fc16);}return null;};}function patchUpdates(_0x196d21){return function(_0x39e2eb){try{jsonpatch[_0xbd64('0x20')](_0x39e2eb,_0x196d21,!![]);}catch(_0x816e00){return BPromise['reject'](_0x816e00);}return _0x39e2eb['save']();};}function saveUpdates(_0x6038f,_0x41f2f){return function(_0x12f67b){if(_0x12f67b){return _0x12f67b[_0xbd64('0x21')](_0x6038f)['then'](function(_0x51d118){return _0x51d118;});}return null;};}function removeEntity(_0x28497c,_0x4afaff){return function(_0x46ab38){if(_0x46ab38){return _0x46ab38['destroy']()[_0xbd64('0x22')](function(){_0x28497c[_0xbd64('0x18')](0xcc)[_0xbd64('0x19')]();});}};}function handleEntityNotFound(_0x2d0993,_0x5ae417){return function(_0x9d0fb8){if(!_0x9d0fb8){_0x2d0993[_0xbd64('0x17')](0x194);}return _0x9d0fb8;};}function handleError(_0x13f527,_0x2a44d0){_0x2a44d0=_0x2a44d0||0x1f4;return function(_0x4d1563){logger['error'](_0x4d1563[_0xbd64('0x23')]);if(_0x4d1563['name']){delete _0x4d1563['name'];}_0x13f527[_0xbd64('0x18')](_0x2a44d0)['send'](_0x4d1563);};}exports[_0xbd64('0x24')]=function(_0x5300e8,_0x28199c){var _0x5d8c35={},_0x1db9f3={},_0x3c0eaf={'count':0x0,'rows':[]};var _0x3be63a=_[_0xbd64('0x25')](db[_0xbd64('0x26')][_0xbd64('0x27')],function(_0x4ed44a){return{'name':_0x4ed44a[_0xbd64('0x28')],'type':_0x4ed44a[_0xbd64('0x29')][_0xbd64('0x2a')]};});_0x1db9f3[_0xbd64('0x2b')]=_[_0xbd64('0x25')](_0x3be63a,_0xbd64('0x2c'));_0x1db9f3['query']=_['keys'](_0x5300e8[_0xbd64('0x2d')]);_0x1db9f3['filters']=_[_0xbd64('0x2e')](_0x1db9f3[_0xbd64('0x2b')],_0x1db9f3['query']);_0x5d8c35['attributes']=_[_0xbd64('0x2e')](_0x1db9f3['model'],qs['fields'](_0x5300e8[_0xbd64('0x2d')][_0xbd64('0x2f')]));_0x5d8c35[_0xbd64('0x30')]=_0x5d8c35['attributes'][_0xbd64('0x31')]?_0x5d8c35['attributes']:_0x1db9f3[_0xbd64('0x2b')];if(!_0x5300e8[_0xbd64('0x2d')][_0xbd64('0x32')](_0xbd64('0x33'))){_0x5d8c35[_0xbd64('0x1c')]=qs[_0xbd64('0x1c')](_0x5300e8['query']['limit']);_0x5d8c35[_0xbd64('0x1b')]=qs[_0xbd64('0x1b')](_0x5300e8[_0xbd64('0x2d')][_0xbd64('0x1b')]);}_0x5d8c35[_0xbd64('0x34')]=qs[_0xbd64('0x35')](_0x5300e8['query']['sort']);_0x5d8c35[_0xbd64('0x36')]=qs[_0xbd64('0x37')](_[_0xbd64('0x38')](_0x5300e8['query'],_0x1db9f3['filters']),_0x3be63a);if(_0x5300e8[_0xbd64('0x2d')]['filter']){_0x5d8c35[_0xbd64('0x36')]=_['merge'](_0x5d8c35[_0xbd64('0x36')],{'$or':_[_0xbd64('0x25')](_0x3be63a,function(_0x550221){if(_0x550221[_0xbd64('0x29')]!=='VIRTUAL'){var _0x534091={};_0x534091[_0x550221[_0xbd64('0x2c')]]={'$like':'%'+_0x5300e8[_0xbd64('0x2d')][_0xbd64('0x39')]+'%'};return _0x534091;}})});}_0x5d8c35=_['merge']({},_0x5d8c35,_0x5300e8['options']);var _0x5d6bcf={'where':_0x5d8c35[_0xbd64('0x36')]};return db[_0xbd64('0x26')]['count'](_0x5d6bcf)[_0xbd64('0x22')](function(_0x34b19a){_0x3c0eaf[_0xbd64('0x1e')]=_0x34b19a;if(_0x5300e8[_0xbd64('0x2d')]['includeAll']){_0x5d8c35['include']=[{'all':!![]}];}return db[_0xbd64('0x26')]['findAll'](_0x5d8c35);})['then'](function(_0x231fa6){_0x3c0eaf[_0xbd64('0x3a')]=_0x231fa6;return _0x3c0eaf;})[_0xbd64('0x22')](respondWithFilteredResult(_0x28199c,_0x5d8c35))[_0xbd64('0x3b')](handleError(_0x28199c,null));};exports[_0xbd64('0x3c')]=function(_0x3155b3,_0x247775){var _0x762380={'raw':![],'where':{'id':_0x3155b3[_0xbd64('0x3d')]['id']}},_0x4870fd={};_0x4870fd[_0xbd64('0x2b')]=_['keys'](db[_0xbd64('0x26')][_0xbd64('0x27')]);_0x4870fd[_0xbd64('0x2d')]=_[_0xbd64('0x3e')](_0x3155b3[_0xbd64('0x2d')]);_0x4870fd[_0xbd64('0x37')]=_[_0xbd64('0x2e')](_0x4870fd['model'],_0x4870fd[_0xbd64('0x2d')]);_0x762380['attributes']=_[_0xbd64('0x2e')](_0x4870fd['model'],qs[_0xbd64('0x2f')](_0x3155b3[_0xbd64('0x2d')][_0xbd64('0x2f')]));_0x762380['attributes']=_0x762380[_0xbd64('0x30')]['length']?_0x762380['attributes']:_0x4870fd['model'];if(_0x3155b3[_0xbd64('0x2d')][_0xbd64('0x3f')]){_0x762380[_0xbd64('0x40')]=[{'all':!![]}];}_0x762380=_[_0xbd64('0x41')]({},_0x762380,_0x3155b3[_0xbd64('0x42')]);return db[_0xbd64('0x26')][_0xbd64('0x43')](_0x762380)['then'](handleEntityNotFound(_0x247775,null))[_0xbd64('0x22')](respondWithResult(_0x247775,null))[_0xbd64('0x3b')](handleError(_0x247775,null));};exports[_0xbd64('0x44')]=function(_0x4e5efe,_0x105bee){return db[_0xbd64('0x26')][_0xbd64('0x44')](_0x4e5efe[_0xbd64('0x45')],{})[_0xbd64('0x22')](respondWithResult(_0x105bee,0xc9))['catch'](handleError(_0x105bee,null));};exports[_0xbd64('0x21')]=function(_0x1a9ec8,_0x2a8011){if(_0x1a9ec8[_0xbd64('0x45')]['id']){delete _0x1a9ec8['body']['id'];}return db['ZendeskAccount'][_0xbd64('0x43')]({'where':{'id':_0x1a9ec8[_0xbd64('0x3d')]['id']}})[_0xbd64('0x22')](handleEntityNotFound(_0x2a8011,null))[_0xbd64('0x22')](saveUpdates(_0x1a9ec8[_0xbd64('0x45')],null))[_0xbd64('0x22')](respondWithResult(_0x2a8011,null))[_0xbd64('0x3b')](handleError(_0x2a8011,null));};exports[_0xbd64('0x46')]=function(_0x460158,_0x2709b2){return db[_0xbd64('0x26')][_0xbd64('0x43')]({'where':{'id':_0x460158[_0xbd64('0x3d')]['id']}})[_0xbd64('0x22')](handleEntityNotFound(_0x2709b2,null))[_0xbd64('0x22')](removeEntity(_0x2709b2,null))['catch'](handleError(_0x2709b2,null));};exports[_0xbd64('0x47')]=function(_0x4952db,_0x5ede67,_0x552c95){var _0x4aa662={};var _0xced0ca={};var _0x2f56df;var _0x5480f5;return db[_0xbd64('0x26')][_0xbd64('0x48')]({'where':{'id':_0x4952db[_0xbd64('0x3d')]['id']}})['then'](handleEntityNotFound(_0x5ede67,null))[_0xbd64('0x22')](function(_0x371bad){if(_0x371bad){_0x2f56df=_0x371bad;_0xced0ca[_0xbd64('0x2b')]=_[_0xbd64('0x3e')](db[_0xbd64('0x49')][_0xbd64('0x27')]);_0xced0ca['query']=_['keys'](_0x4952db['query']);_0xced0ca[_0xbd64('0x37')]=_[_0xbd64('0x2e')](_0xced0ca[_0xbd64('0x2b')],_0xced0ca[_0xbd64('0x2d')]);_0x4aa662['attributes']=_[_0xbd64('0x2e')](_0xced0ca[_0xbd64('0x2b')],qs[_0xbd64('0x2f')](_0x4952db[_0xbd64('0x2d')][_0xbd64('0x2f')]));_0x4aa662[_0xbd64('0x30')]=_0x4aa662['attributes'][_0xbd64('0x31')]?_0x4aa662[_0xbd64('0x30')]:_0xced0ca[_0xbd64('0x2b')];_0x4aa662[_0xbd64('0x34')]=qs[_0xbd64('0x35')](_0x4952db[_0xbd64('0x2d')][_0xbd64('0x35')]);_0x4aa662[_0xbd64('0x36')]=qs[_0xbd64('0x37')](_[_0xbd64('0x38')](_0x4952db[_0xbd64('0x2d')],_0xced0ca[_0xbd64('0x37')]));if(_0x4952db['query']['filter']){_0x4aa662[_0xbd64('0x36')]=_[_0xbd64('0x41')](_0x4aa662['where'],{'$or':_['map'](_0x4aa662[_0xbd64('0x30')],function(_0x12bc56){var _0x49051a={};_0x49051a[_0x12bc56]={'$like':'%'+_0x4952db[_0xbd64('0x2d')][_0xbd64('0x39')]+'%'};return _0x49051a;})});}_0x4aa662=_[_0xbd64('0x41')]({},_0x4aa662,_0x4952db[_0xbd64('0x42')]);return _0x2f56df[_0xbd64('0x47')](_0x4aa662);}})[_0xbd64('0x22')](function(_0x2d788){if(_0x2d788){_0x5480f5=_0x2d788[_0xbd64('0x31')];if(!_0x4952db[_0xbd64('0x2d')]['hasOwnProperty'](_0xbd64('0x33'))){_0x4aa662[_0xbd64('0x1c')]=qs[_0xbd64('0x1c')](_0x4952db['query'][_0xbd64('0x1c')]);_0x4aa662[_0xbd64('0x1b')]=qs['offset'](_0x4952db[_0xbd64('0x2d')][_0xbd64('0x1b')]);}return _0x2f56df[_0xbd64('0x47')](_0x4aa662);}})[_0xbd64('0x22')](function(_0x3615bc){if(_0x3615bc){return _0x3615bc?{'count':_0x5480f5,'rows':_0x3615bc}:null;}})[_0xbd64('0x22')](respondWithResult(_0x5ede67,null))['catch'](handleError(_0x5ede67,null));};exports[_0xbd64('0x4a')]=function(_0x1f3bd0,_0xc57eb1,_0x28d899){if(_0x1f3bd0['body']['id']){delete _0x1f3bd0[_0xbd64('0x45')]['id'];}return db[_0xbd64('0x26')]['findOne']({'where':{'id':_0x1f3bd0[_0xbd64('0x3d')]['id']}})['then'](handleEntityNotFound(_0xc57eb1,null))[_0xbd64('0x22')](function(_0x10e269){if(_0x10e269){_0x1f3bd0[_0xbd64('0x45')][_0xbd64('0x4b')]=_0x10e269['id'];_0x1f3bd0['body'][_0xbd64('0x4c')]=integrations[_0xbd64('0x4d')](_0x1f3bd0[_0xbd64('0x45')][_0xbd64('0x4e')],_0x1f3bd0[_0xbd64('0x45')][_0xbd64('0x29')]);_0x1f3bd0['body']['Descriptions']=integrations['getDescriptions'](_0x1f3bd0[_0xbd64('0x45')][_0xbd64('0x4e')],_0x1f3bd0[_0xbd64('0x45')][_0xbd64('0x29')]);return db[_0xbd64('0x49')][_0xbd64('0x44')](_0x1f3bd0['body'],{'include':[{'model':db[_0xbd64('0x4f')],'as':_0xbd64('0x4c')},{'model':db[_0xbd64('0x4f')],'as':_0xbd64('0x50')}]});}return null;})[_0xbd64('0x22')](respondWithResult(_0xc57eb1,null))[_0xbd64('0x3b')](handleError(_0xc57eb1,null));};exports[_0xbd64('0x51')]=function(_0x3d7e47,_0x301f42,_0x18e724){var _0x32e611='';return db[_0xbd64('0x26')]['findOne']({'where':{'id':_0x3d7e47['params']['id']},'attributes':['id',_0xbd64('0x52'),_0xbd64('0x53'),_0xbd64('0x54'),'authType',_0xbd64('0x55')]})['then'](handleEntityNotFound(_0x301f42,null))[_0xbd64('0x22')](function(_0x36ebb5){if(_0x36ebb5){_0x32e611=_0x36ebb5[_0xbd64('0x55')];var _0x819774=_0x32e611['slice'](-0x1);if(_0x819774==='/'){_0x32e611=_0x32e611[_0xbd64('0x56')](0x0,_0x32e611['lastIndexOf'](_0x819774));}var _0x14f79e={'method':_0xbd64('0x57'),'uri':util[_0xbd64('0x58')](_0xbd64('0x59'),_0x32e611,_0xbd64('0x5a')),'json':!![]};switch(_0x36ebb5['authType']){case _0xbd64('0x53'):_0x14f79e[_0xbd64('0x5b')]={'Authorization':util['format'](_0xbd64('0x5c'),new Buffer(util[_0xbd64('0x58')](_0xbd64('0x5d'),_0x36ebb5[_0xbd64('0x52')],_0x36ebb5['password']))[_0xbd64('0x5e')]('base64'))};break;case _0xbd64('0x54'):_0x14f79e[_0xbd64('0x5b')]={'Authorization':util[_0xbd64('0x58')]('Basic\x20%s',new Buffer(util['format']('%s/token:%s',_0x36ebb5['username'],_0x36ebb5[_0xbd64('0x54')]))[_0xbd64('0x5e')](_0xbd64('0x5f')))};break;default:throw new db[(_0xbd64('0x60'))][(_0xbd64('0x61'))]('Unknown\x20authentication\x20type');}return rp(_0x14f79e);}})[_0xbd64('0x22')](function(_0x23de71){if(_0x23de71){var _0xac13e6=[_0xbd64('0x62'),_0xbd64('0x63'),'group',_0xbd64('0x64')];_[_0xbd64('0x65')](_0x23de71[_0xbd64('0x5a')],function(_0x808467){return _0xac13e6['includes'](_0x808467['type']);});return{'count':_0x23de71[_0xbd64('0x5a')][_0xbd64('0x31')],'rows':_[_0xbd64('0x25')](_0x23de71[_0xbd64('0x5a')],function(_0x18b0f0){return{'id':_0x18b0f0['id'],'name':_0x18b0f0[_0xbd64('0x66')]>0x7?_0x18b0f0[_0xbd64('0x67')]:_0x18b0f0[_0xbd64('0x29')],'custom':_0x18b0f0['position']>0x7?!![]:![],'options':_0x18b0f0[_0xbd64('0x68')]?_0x18b0f0['system_field_options']:_0x18b0f0[_0xbd64('0x69')]?_0x18b0f0[_0xbd64('0x69')]:[]};})};}})[_0xbd64('0x22')](respondWithResult(_0x301f42,null))['catch'](function(_0x15b625){var _0x5c30f9=_0x3d7e47['query'][_0xbd64('0x6a')]?0x1f4:_0x15b625[_0xbd64('0x6b')]||0x1f4;logger[_0xbd64('0x6c')]('getFields,\x20%s,\x20%s,\x20%s',_0xbd64('0x51'),_0x5c30f9,JSON[_0xbd64('0x6d')](_0x15b625));delete _0x15b625[_0xbd64('0x2c')];if(_0x5c30f9===0x191){_0x5c30f9=0x190;}_0x301f42[_0xbd64('0x18')](_0x5c30f9)['send'](_0x3d7e47[_0xbd64('0x2d')][_0xbd64('0x6a')]?{'message':_0xbd64('0x6e'),'statusCode':_0x15b625[_0xbd64('0x6b')]}:_0x15b625);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index adbf509..43a2f79 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 _0x3067=['api','moment','bluebird','request-promise','path','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','define','int_zendesk_accounts','lodash','../../config/logger'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0x3067,0x12a));var _0x7306=function(_0x54cb11,_0x3cc590){_0x54cb11=_0x54cb11-0x0;var _0x2dcd18=_0x3067[_0x54cb11];return _0x2dcd18;};'use strict';var _=require(_0x7306('0x0'));var util=require('util');var logger=require(_0x7306('0x1'))(_0x7306('0x2'));var moment=require(_0x7306('0x3'));var BPromise=require(_0x7306('0x4'));var rp=require(_0x7306('0x5'));var fs=require('fs');var path=require(_0x7306('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x7306('0x7'));var integrations=require(_0x7306('0x8'));module[_0x7306('0x9')]=function(_0x15e1b6,_0x70b4df){return _0x15e1b6[_0x7306('0xa')]('ZendeskAccount',attributes,{'tableName':_0x7306('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x322f=['exports','define','int_zendesk_accounts','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration'];(function(_0x634811,_0xc4455c){var _0x31aa5b=function(_0xec9150){while(--_0xec9150){_0x634811['push'](_0x634811['shift']());}};_0x31aa5b(++_0xc4455c);}(_0x322f,0x1ed));var _0xf322=function(_0x498dc5,_0x2994ad){_0x498dc5=_0x498dc5-0x0;var _0x589e1d=_0x322f[_0x498dc5];return _0x589e1d;};'use strict';var _=require(_0xf322('0x0'));var util=require(_0xf322('0x1'));var logger=require(_0xf322('0x2'))(_0xf322('0x3'));var moment=require('moment');var BPromise=require(_0xf322('0x4'));var rp=require(_0xf322('0x5'));var fs=require('fs');var path=require(_0xf322('0x6'));var rimraf=require(_0xf322('0x7'));var config=require(_0xf322('0x8'));var attributes=require(_0xf322('0x9'));var integrations=require(_0xf322('0xa'));module[_0xf322('0xb')]=function(_0x413d91,_0x500279){return _0x413d91[_0xf322('0xc')]('ZendeskAccount',attributes,{'tableName':_0xf322('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 a136f9a..b3e7d74 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 _0x00b3=['options','raw','where','limit','include','map','model','attributes','ShowZendeskAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','ZendeskAccount,\x20%s,\x20%s','message','request\x20sent','result','catch','GetZendeskAccount','ZendeskAccount','findAll'];(function(_0x172747,_0x1732bd){var _0x509692=function(_0x448c56){while(--_0x448c56){_0x172747['push'](_0x172747['shift']());}};_0x509692(++_0x1732bd);}(_0x00b3,0x157));var _0x300b=function(_0x16c787,_0x3ff6fa){_0x16c787=_0x16c787-0x0;var _0x34c3a8=_0x00b3[_0x16c787];return _0x34c3a8;};'use strict';var _=require(_0x300b('0x0'));var util=require(_0x300b('0x1'));var moment=require(_0x300b('0x2'));var BPromise=require(_0x300b('0x3'));var rs=require(_0x300b('0x4'));var fs=require('fs');var Redis=require(_0x300b('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x300b('0x6'));var logger=require(_0x300b('0x7'))('rpc');var config=require(_0x300b('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x300b('0x9')][_0x300b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2533d3,_0x2caa7c,_0x291829){return new BPromise(function(_0x5501f7,_0x3aa555){return client[_0x300b('0xb')](_0x2533d3,_0x291829)[_0x300b('0xc')](function(_0xe6e730){logger[_0x300b('0xd')]('ZendeskAccount,\x20%s,\x20%s',_0x2caa7c,'request\x20sent');logger[_0x300b('0xe')](_0x300b('0xf'),_0x2caa7c,'request\x20sent',JSON[_0x300b('0x10')](_0xe6e730));if(_0xe6e730[_0x300b('0x11')]){if(_0xe6e730['error'][_0x300b('0x12')]===0x1f4){logger[_0x300b('0x11')](_0x300b('0x13'),_0x2caa7c,_0xe6e730[_0x300b('0x11')][_0x300b('0x14')]);return _0x3aa555(_0xe6e730[_0x300b('0x11')][_0x300b('0x14')]);}logger[_0x300b('0x11')](_0x300b('0x13'),_0x2caa7c,_0xe6e730['error']['message']);return _0x5501f7(_0xe6e730[_0x300b('0x11')][_0x300b('0x14')]);}else{logger['info']('ZendeskAccount,\x20%s,\x20%s',_0x2caa7c,_0x300b('0x15'));_0x5501f7(_0xe6e730[_0x300b('0x16')][_0x300b('0x14')]);}})[_0x300b('0x17')](function(_0x438bf4){logger[_0x300b('0x11')](_0x300b('0x13'),_0x2caa7c,_0x438bf4);_0x3aa555(_0x438bf4);});});}exports[_0x300b('0x18')]=function(_0x5be041){var _0x3909a3=this;return new Promise(function(_0x3860ab,_0x1a0224){return db[_0x300b('0x19')][_0x300b('0x1a')]({'raw':_0x5be041[_0x300b('0x1b')]?_0x5be041['options'][_0x300b('0x1c')]===undefined?!![]:![]:!![],'where':_0x5be041['options']?_0x5be041[_0x300b('0x1b')][_0x300b('0x1d')]||null:null,'attributes':_0x5be041['options']?_0x5be041[_0x300b('0x1b')]['attributes']||null:null,'limit':_0x5be041[_0x300b('0x1b')]?_0x5be041['options'][_0x300b('0x1e')]||null:null,'include':_0x5be041[_0x300b('0x1b')]?_0x5be041['options'][_0x300b('0x1f')]?_[_0x300b('0x20')](_0x5be041['options'][_0x300b('0x1f')],function(_0x516c25){return{'model':db[_0x516c25[_0x300b('0x21')]],'as':_0x516c25['as'],'attributes':_0x516c25[_0x300b('0x22')],'include':_0x516c25[_0x300b('0x1f')]?_[_0x300b('0x20')](_0x516c25[_0x300b('0x1f')],function(_0x29ba9e){return{'model':db[_0x29ba9e[_0x300b('0x21')]],'as':_0x29ba9e['as'],'attributes':_0x29ba9e['attributes'],'include':_0x29ba9e[_0x300b('0x1f')]?_[_0x300b('0x20')](_0x29ba9e['include'],function(_0x42913a){return{'model':db[_0x42913a['model']],'as':_0x42913a['as'],'attributes':_0x42913a[_0x300b('0x22')]};}):[]};}):[]};}):[]:[]})[_0x300b('0xc')](function(_0x3b4b5b){logger[_0x300b('0xd')](_0x300b('0x18'),_0x5be041);logger[_0x300b('0xe')](_0x300b('0x18'),_0x5be041,JSON['stringify'](_0x3b4b5b));_0x3860ab(_0x3b4b5b);})[_0x300b('0x17')](function(_0x395066){logger[_0x300b('0x11')](_0x300b('0x18'),_0x395066[_0x300b('0x14')],_0x5be041);_0x1a0224(_0x3909a3[_0x300b('0x11')](0x1f4,_0x395066['message']));});});};exports[_0x300b('0x23')]=function(_0x3c0d46){var _0x363261=this;return new Promise(function(_0x2390b5,_0x3e37a1){return db['ZendeskAccount'][_0x300b('0x24')]({'raw':_0x3c0d46[_0x300b('0x1b')]?_0x3c0d46[_0x300b('0x1b')][_0x300b('0x1c')]===undefined?!![]:![]:!![],'where':_0x3c0d46[_0x300b('0x1b')]?_0x3c0d46['options'][_0x300b('0x1d')]||null:null,'attributes':_0x3c0d46[_0x300b('0x1b')]?_0x3c0d46[_0x300b('0x1b')][_0x300b('0x22')]||null:null,'include':_0x3c0d46[_0x300b('0x1b')]?_0x3c0d46[_0x300b('0x1b')][_0x300b('0x1f')]?_['map'](_0x3c0d46['options'][_0x300b('0x1f')],function(_0x54978c){return{'model':db[_0x54978c[_0x300b('0x21')]],'as':_0x54978c['as'],'attributes':_0x54978c['attributes'],'include':_0x54978c['include']?_[_0x300b('0x20')](_0x54978c[_0x300b('0x1f')],function(_0x4c5832){return{'model':db[_0x4c5832[_0x300b('0x21')]],'as':_0x4c5832['as'],'attributes':_0x4c5832['attributes'],'include':_0x4c5832[_0x300b('0x1f')]?_[_0x300b('0x20')](_0x4c5832['include'],function(_0xc5a0af){return{'model':db[_0xc5a0af['model']],'as':_0xc5a0af['as'],'attributes':_0xc5a0af['attributes']};}):[]};}):[]};}):[]:[]})[_0x300b('0xc')](function(_0x4bd4e6){logger[_0x300b('0xd')](_0x300b('0x23'),_0x3c0d46);logger[_0x300b('0xe')](_0x300b('0x23'),_0x3c0d46,JSON[_0x300b('0x10')](_0x4bd4e6));_0x2390b5(_0x4bd4e6);})['catch'](function(_0x34b42e){logger['error'](_0x300b('0x23'),_0x34b42e['message'],_0x3c0d46);_0x3e37a1(_0x363261[_0x300b('0x11')](0x1f4,_0x34b42e[_0x300b('0x14')]));});});}; \ No newline at end of file +var _0xb3d8=['ShowZendeskAccount','ZendeskAccount','find','raw','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetZendeskAccount','findAll','options','attributes','limit','include','map','model','stringify'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb3d8,0xdc));var _0x8b3d=function(_0x17a5d6,_0xf59b28){_0x17a5d6=_0x17a5d6-0x0;var _0x4f56fa=_0xb3d8[_0x17a5d6];return _0x4f56fa;};'use strict';var _=require('lodash');var util=require(_0x8b3d('0x0'));var moment=require(_0x8b3d('0x1'));var BPromise=require(_0x8b3d('0x2'));var rs=require(_0x8b3d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8b3d('0x4'));var logger=require(_0x8b3d('0x5'))(_0x8b3d('0x6'));var config=require(_0x8b3d('0x7'));var jayson=require(_0x8b3d('0x8'));var client=jayson[_0x8b3d('0x9')][_0x8b3d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4447a2,_0x7ddf10,_0x5d3aeb){return new BPromise(function(_0x278a75,_0x2fef94){return client[_0x8b3d('0xb')](_0x4447a2,_0x5d3aeb)[_0x8b3d('0xc')](function(_0x375fa7){logger[_0x8b3d('0xd')](_0x8b3d('0xe'),_0x7ddf10,_0x8b3d('0xf'));logger[_0x8b3d('0x10')](_0x8b3d('0x11'),_0x7ddf10,'request\x20sent',JSON['stringify'](_0x375fa7));if(_0x375fa7[_0x8b3d('0x12')]){if(_0x375fa7[_0x8b3d('0x12')][_0x8b3d('0x13')]===0x1f4){logger[_0x8b3d('0x12')](_0x8b3d('0xe'),_0x7ddf10,_0x375fa7[_0x8b3d('0x12')][_0x8b3d('0x14')]);return _0x2fef94(_0x375fa7[_0x8b3d('0x12')][_0x8b3d('0x14')]);}logger[_0x8b3d('0x12')](_0x8b3d('0xe'),_0x7ddf10,_0x375fa7[_0x8b3d('0x12')][_0x8b3d('0x14')]);return _0x278a75(_0x375fa7[_0x8b3d('0x12')][_0x8b3d('0x14')]);}else{logger[_0x8b3d('0xd')]('ZendeskAccount,\x20%s,\x20%s',_0x7ddf10,_0x8b3d('0xf'));_0x278a75(_0x375fa7[_0x8b3d('0x15')]['message']);}})[_0x8b3d('0x16')](function(_0x1652e7){logger['error'](_0x8b3d('0xe'),_0x7ddf10,_0x1652e7);_0x2fef94(_0x1652e7);});});}exports[_0x8b3d('0x17')]=function(_0xcc9b46){var _0x3d733e=this;return new Promise(function(_0x1d96ae,_0x5bff55){return db['ZendeskAccount'][_0x8b3d('0x18')]({'raw':_0xcc9b46['options']?_0xcc9b46['options']['raw']===undefined?!![]:![]:!![],'where':_0xcc9b46[_0x8b3d('0x19')]?_0xcc9b46[_0x8b3d('0x19')]['where']||null:null,'attributes':_0xcc9b46[_0x8b3d('0x19')]?_0xcc9b46[_0x8b3d('0x19')][_0x8b3d('0x1a')]||null:null,'limit':_0xcc9b46[_0x8b3d('0x19')]?_0xcc9b46[_0x8b3d('0x19')][_0x8b3d('0x1b')]||null:null,'include':_0xcc9b46[_0x8b3d('0x19')]?_0xcc9b46[_0x8b3d('0x19')][_0x8b3d('0x1c')]?_[_0x8b3d('0x1d')](_0xcc9b46[_0x8b3d('0x19')]['include'],function(_0x37c98e){return{'model':db[_0x37c98e['model']],'as':_0x37c98e['as'],'attributes':_0x37c98e[_0x8b3d('0x1a')],'include':_0x37c98e[_0x8b3d('0x1c')]?_[_0x8b3d('0x1d')](_0x37c98e[_0x8b3d('0x1c')],function(_0x57fe10){return{'model':db[_0x57fe10[_0x8b3d('0x1e')]],'as':_0x57fe10['as'],'attributes':_0x57fe10['attributes'],'include':_0x57fe10['include']?_[_0x8b3d('0x1d')](_0x57fe10['include'],function(_0x4eefbf){return{'model':db[_0x4eefbf[_0x8b3d('0x1e')]],'as':_0x4eefbf['as'],'attributes':_0x4eefbf[_0x8b3d('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5901f4){logger[_0x8b3d('0xd')](_0x8b3d('0x17'),_0xcc9b46);logger[_0x8b3d('0x10')](_0x8b3d('0x17'),_0xcc9b46,JSON[_0x8b3d('0x1f')](_0x5901f4));_0x1d96ae(_0x5901f4);})['catch'](function(_0x261070){logger[_0x8b3d('0x12')](_0x8b3d('0x17'),_0x261070[_0x8b3d('0x14')],_0xcc9b46);_0x5bff55(_0x3d733e[_0x8b3d('0x12')](0x1f4,_0x261070['message']));});});};exports[_0x8b3d('0x20')]=function(_0x3dae7e){var _0x20bc19=this;return new Promise(function(_0x36a125,_0x5cd208){return db[_0x8b3d('0x21')][_0x8b3d('0x22')]({'raw':_0x3dae7e[_0x8b3d('0x19')]?_0x3dae7e['options'][_0x8b3d('0x23')]===undefined?!![]:![]:!![],'where':_0x3dae7e[_0x8b3d('0x19')]?_0x3dae7e[_0x8b3d('0x19')]['where']||null:null,'attributes':_0x3dae7e['options']?_0x3dae7e[_0x8b3d('0x19')][_0x8b3d('0x1a')]||null:null,'include':_0x3dae7e[_0x8b3d('0x19')]?_0x3dae7e[_0x8b3d('0x19')][_0x8b3d('0x1c')]?_[_0x8b3d('0x1d')](_0x3dae7e[_0x8b3d('0x19')]['include'],function(_0x2c310a){return{'model':db[_0x2c310a[_0x8b3d('0x1e')]],'as':_0x2c310a['as'],'attributes':_0x2c310a[_0x8b3d('0x1a')],'include':_0x2c310a[_0x8b3d('0x1c')]?_[_0x8b3d('0x1d')](_0x2c310a[_0x8b3d('0x1c')],function(_0x1dfce0){return{'model':db[_0x1dfce0[_0x8b3d('0x1e')]],'as':_0x1dfce0['as'],'attributes':_0x1dfce0[_0x8b3d('0x1a')],'include':_0x1dfce0[_0x8b3d('0x1c')]?_[_0x8b3d('0x1d')](_0x1dfce0[_0x8b3d('0x1c')],function(_0xf56887){return{'model':db[_0xf56887[_0x8b3d('0x1e')]],'as':_0xf56887['as'],'attributes':_0xf56887[_0x8b3d('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x8b3d('0xc')](function(_0x607b86){logger['info']('ShowZendeskAccount',_0x3dae7e);logger[_0x8b3d('0x10')]('ShowZendeskAccount',_0x3dae7e,JSON[_0x8b3d('0x1f')](_0x607b86));_0x36a125(_0x607b86);})[_0x8b3d('0x16')](function(_0x218cef){logger['error']('ShowZendeskAccount',_0x218cef[_0x8b3d('0x14')],_0x3dae7e);_0x5cd208(_0x20bc19[_0x8b3d('0x12')](0x1f4,_0x218cef[_0x8b3d('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index dca7467..d05a93b 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 _0xac4a=['../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','isAuthenticated','get','show','getSubjects','/:id/descriptions','getDescriptions','getTags','post','create','setTags','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x579fda,_0x35afa7){var _0x40054f=function(_0x1e3923){while(--_0x1e3923){_0x579fda['push'](_0x579fda['shift']());}};_0x40054f(++_0x35afa7);}(_0xac4a,0x13f));var _0xaac4=function(_0x1242ca,_0x9f2090){_0x1242ca=_0x1242ca-0x0;var _0x51f60a=_0xac4a[_0x1242ca];return _0x51f60a;};'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/fields',auth[_0xaac4('0x9')](),controller['getFields']);router[_0xaac4('0xa')]('/:id/subjects',auth['isAuthenticated'](),controller[_0xaac4('0xc')]);router[_0xaac4('0xa')](_0xaac4('0xd'),auth[_0xaac4('0x9')](),controller[_0xaac4('0xe')]);router['get']('/:id/tags',auth[_0xaac4('0x9')](),controller[_0xaac4('0xf')]);router[_0xaac4('0x10')]('/',auth['isAuthenticated'](),controller[_0xaac4('0x11')]);router[_0xaac4('0x10')]('/:id/tags',auth[_0xaac4('0x9')](),controller[_0xaac4('0x12')]);router[_0xaac4('0x13')](_0xaac4('0x14'),auth[_0xaac4('0x9')](),controller[_0xaac4('0x15')]);router[_0xaac4('0x16')](_0xaac4('0x14'),auth[_0xaac4('0x9')](),controller[_0xaac4('0x17')]);module[_0xaac4('0x18')]=router; \ No newline at end of file +var _0xa571=['util','path','connect-timeout','Router','fs-extra','../../config/environment','get','isAuthenticated','index','/:id','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','getTags','post','create','put','update','exports','multer'];(function(_0x36c8fb,_0xf1ca63){var _0x484022=function(_0x529c13){while(--_0x529c13){_0x36c8fb['push'](_0x36c8fb['shift']());}};_0x484022(++_0xf1ca63);}(_0xa571,0x107));var _0x1a57=function(_0x2b8a96,_0x30d1c6){_0x2b8a96=_0x2b8a96-0x0;var _0x319d3d=_0xa571[_0x2b8a96];return _0x319d3d;};'use strict';var multer=require(_0x1a57('0x0'));var util=require(_0x1a57('0x1'));var path=require(_0x1a57('0x2'));var timeout=require(_0x1a57('0x3'));var express=require('express');var router=express[_0x1a57('0x4')]();var fs_extra=require(_0x1a57('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1a57('0x6'));var controller=require('./intZendeskConfiguration.controller');router[_0x1a57('0x7')]('/',auth[_0x1a57('0x8')](),controller[_0x1a57('0x9')]);router[_0x1a57('0x7')](_0x1a57('0xa'),auth[_0x1a57('0x8')](),controller['show']);router[_0x1a57('0x7')](_0x1a57('0xb'),auth[_0x1a57('0x8')](),controller['getFields']);router[_0x1a57('0x7')](_0x1a57('0xc'),auth[_0x1a57('0x8')](),controller[_0x1a57('0xd')]);router[_0x1a57('0x7')](_0x1a57('0xe'),auth[_0x1a57('0x8')](),controller[_0x1a57('0xf')]);router['get']('/:id/tags',auth[_0x1a57('0x8')](),controller[_0x1a57('0x10')]);router[_0x1a57('0x11')]('/',auth['isAuthenticated'](),controller[_0x1a57('0x12')]);router[_0x1a57('0x11')]('/:id/tags',auth[_0x1a57('0x8')](),controller['setTags']);router[_0x1a57('0x13')](_0x1a57('0xa'),auth[_0x1a57('0x8')](),controller[_0x1a57('0x14')]);router['delete'](_0x1a57('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x1a57('0x15')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index 5221392..f9fd8b8 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 _0x558f=['STRING','sequelize','exports'];(function(_0x3be0c4,_0x5b7eff){var _0x11af9f=function(_0x3f5113){while(--_0x3f5113){_0x3be0c4['push'](_0x3be0c4['shift']());}};_0x11af9f(++_0x5b7eff);}(_0x558f,0x1cf));var _0xf558=function(_0x47aa3e,_0x1fd279){_0x47aa3e=_0x47aa3e-0x0;var _0x5d0792=_0x558f[_0x47aa3e];return _0x5d0792;};'use strict';var Sequelize=require(_0xf558('0x0'));module[_0xf558('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xf558('0x2')]}}; \ No newline at end of file +var _0x00e0=['STRING','exports'];(function(_0x4216f0,_0xcb74fd){var _0x46ed5c=function(_0x24a760){while(--_0x24a760){_0x4216f0['push'](_0x4216f0['shift']());}};_0x46ed5c(++_0xcb74fd);}(_0x00e0,0x95));var _0x000e=function(_0x8bddb1,_0x99ef55){_0x8bddb1=_0x8bddb1-0x0;var _0x58392c=_0x00e0[_0x8bddb1];return _0x58392c;};'use strict';var Sequelize=require('sequelize');module[_0x000e('0x0')]={'name':{'type':Sequelize[_0x000e('0x1')]},'description':{'type':Sequelize[_0x000e('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index 93fda1d..b819349 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 _0xc777=['undefined','count','limit','json','apply','save','update','then','error','stack','name','send','map','ZendeskConfiguration','rawAttributes','type','query','keys','intersection','model','fields','attributes','length','nolimit','order','sort','filters','filter','merge','VIRTUAL','options','includeAll','rows','show','params','include','find','create','body','catch','findOne','where','hasOwnProperty','getFields','getSubjects','ZendeskField','pick','getDescriptions','getTags','Tag','setTags','ids','eml-format','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset'];(function(_0x3e6019,_0x231cf4){var _0x138a63=function(_0x21a049){while(--_0x21a049){_0x3e6019['push'](_0x3e6019['shift']());}};_0x138a63(++_0x231cf4);}(_0xc777,0x16c));var _0x7c77=function(_0x48ed18,_0x52839a){_0x48ed18=_0x48ed18-0x0;var _0x5b8cf1=_0xc777[_0x48ed18];return _0x5b8cf1;};'use strict';var emlformat=require(_0x7c77('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x7c77('0x1'));var rp=require(_0x7c77('0x2'));var moment=require(_0x7c77('0x3'));var BPromise=require(_0x7c77('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x7c77('0x5'));var sox=require('sox');var csv=require(_0x7c77('0x6'));var ejs=require(_0x7c77('0x7'));var fs=require('fs');var fs_extra=require(_0x7c77('0x8'));var _=require('lodash');var squel=require(_0x7c77('0x9'));var crypto=require('crypto');var jsforce=require(_0x7c77('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x7c77('0x6'));var querystring=require(_0x7c77('0xb'));var Papa=require(_0x7c77('0xc'));var Redis=require(_0x7c77('0xd'));var authService=require(_0x7c77('0xe'));var qs=require(_0x7c77('0xf'));var as=require(_0x7c77('0x10'));var hardwareService=require(_0x7c77('0x11'));var logger=require(_0x7c77('0x12'))('api');var utils=require(_0x7c77('0x13'));var config=require(_0x7c77('0x14'));var licenseUtil=require(_0x7c77('0x15'));var db=require(_0x7c77('0x16'))['db'];function respondWithStatusCode(_0x24217c,_0x1d5faf){_0x1d5faf=_0x1d5faf||0xcc;return function(_0x1d2b36){if(_0x1d2b36){return _0x24217c['sendStatus'](_0x1d5faf);}return _0x24217c[_0x7c77('0x17')](_0x1d5faf)[_0x7c77('0x18')]();};}function respondWithResult(_0x5aa5a9,_0xc8f2a3){_0xc8f2a3=_0xc8f2a3||0xc8;return function(_0x2a5f2e){if(_0x2a5f2e){return _0x5aa5a9['status'](_0xc8f2a3)['json'](_0x2a5f2e);}};}function respondWithFilteredResult(_0x671da6,_0x2e0343){return function(_0x5a1b1e){if(_0x5a1b1e){var _0x38bfab=typeof _0x2e0343[_0x7c77('0x19')]===_0x7c77('0x1a')&&typeof _0x2e0343['limit']===_0x7c77('0x1a');var _0x33136f=_0x5a1b1e[_0x7c77('0x1b')];var _0x3cd25b=_0x38bfab?0x0:_0x2e0343[_0x7c77('0x19')];var _0x466b29=_0x38bfab?_0x5a1b1e[_0x7c77('0x1b')]:_0x2e0343[_0x7c77('0x19')]+_0x2e0343[_0x7c77('0x1c')];var _0x3cd69f;if(_0x466b29>=_0x33136f){_0x466b29=_0x33136f;_0x3cd69f=0xc8;}else{_0x3cd69f=0xce;}_0x671da6[_0x7c77('0x17')](_0x3cd69f);return _0x671da6['set']('Content-Range',_0x3cd25b+'-'+_0x466b29+'/'+_0x33136f)[_0x7c77('0x1d')](_0x5a1b1e);}return null;};}function patchUpdates(_0x246a5c){return function(_0x1bd0e8){try{jsonpatch[_0x7c77('0x1e')](_0x1bd0e8,_0x246a5c,!![]);}catch(_0x4b0de0){return BPromise['reject'](_0x4b0de0);}return _0x1bd0e8[_0x7c77('0x1f')]();};}function saveUpdates(_0x5d3cf3,_0x2c9e1e){return function(_0x561874){if(_0x561874){return _0x561874[_0x7c77('0x20')](_0x5d3cf3)[_0x7c77('0x21')](function(_0x34cbc2){return _0x34cbc2;});}return null;};}function removeEntity(_0x3a5a4b,_0x4f0798){return function(_0x26e5bd){if(_0x26e5bd){return _0x26e5bd['destroy']()[_0x7c77('0x21')](function(){_0x3a5a4b[_0x7c77('0x17')](0xcc)[_0x7c77('0x18')]();});}};}function handleEntityNotFound(_0x3b3fc0,_0x1f4a38){return function(_0x5e5cc9){if(!_0x5e5cc9){_0x3b3fc0['sendStatus'](0x194);}return _0x5e5cc9;};}function handleError(_0x3816f1,_0x3f78a3){_0x3f78a3=_0x3f78a3||0x1f4;return function(_0x300f50){logger[_0x7c77('0x22')](_0x300f50[_0x7c77('0x23')]);if(_0x300f50['name']){delete _0x300f50[_0x7c77('0x24')];}_0x3816f1[_0x7c77('0x17')](_0x3f78a3)[_0x7c77('0x25')](_0x300f50);};}exports['index']=function(_0x2c96ad,_0x2932ec){var _0x434fdb={},_0x2b030c={},_0x7d7e25={'count':0x0,'rows':[]};var _0x415a8a=_[_0x7c77('0x26')](db[_0x7c77('0x27')][_0x7c77('0x28')],function(_0x24f11c){return{'name':_0x24f11c['fieldName'],'type':_0x24f11c[_0x7c77('0x29')]['key']};});_0x2b030c['model']=_['map'](_0x415a8a,_0x7c77('0x24'));_0x2b030c[_0x7c77('0x2a')]=_[_0x7c77('0x2b')](_0x2c96ad['query']);_0x2b030c['filters']=_[_0x7c77('0x2c')](_0x2b030c[_0x7c77('0x2d')],_0x2b030c[_0x7c77('0x2a')]);_0x434fdb['attributes']=_[_0x7c77('0x2c')](_0x2b030c[_0x7c77('0x2d')],qs[_0x7c77('0x2e')](_0x2c96ad[_0x7c77('0x2a')][_0x7c77('0x2e')]));_0x434fdb[_0x7c77('0x2f')]=_0x434fdb[_0x7c77('0x2f')][_0x7c77('0x30')]?_0x434fdb['attributes']:_0x2b030c[_0x7c77('0x2d')];if(!_0x2c96ad[_0x7c77('0x2a')]['hasOwnProperty'](_0x7c77('0x31'))){_0x434fdb[_0x7c77('0x1c')]=qs[_0x7c77('0x1c')](_0x2c96ad[_0x7c77('0x2a')][_0x7c77('0x1c')]);_0x434fdb['offset']=qs[_0x7c77('0x19')](_0x2c96ad[_0x7c77('0x2a')][_0x7c77('0x19')]);}_0x434fdb[_0x7c77('0x32')]=qs[_0x7c77('0x33')](_0x2c96ad['query'][_0x7c77('0x33')]);_0x434fdb['where']=qs[_0x7c77('0x34')](_['pick'](_0x2c96ad[_0x7c77('0x2a')],_0x2b030c[_0x7c77('0x34')]),_0x415a8a);if(_0x2c96ad['query'][_0x7c77('0x35')]){_0x434fdb['where']=_[_0x7c77('0x36')](_0x434fdb['where'],{'$or':_[_0x7c77('0x26')](_0x415a8a,function(_0x558907){if(_0x558907['type']!==_0x7c77('0x37')){var _0x1251b7={};_0x1251b7[_0x558907[_0x7c77('0x24')]]={'$like':'%'+_0x2c96ad[_0x7c77('0x2a')][_0x7c77('0x35')]+'%'};return _0x1251b7;}})});}_0x434fdb=_[_0x7c77('0x36')]({},_0x434fdb,_0x2c96ad[_0x7c77('0x38')]);var _0x5e35d0={'where':_0x434fdb['where']};return db[_0x7c77('0x27')][_0x7c77('0x1b')](_0x5e35d0)['then'](function(_0x3b52ec){_0x7d7e25[_0x7c77('0x1b')]=_0x3b52ec;if(_0x2c96ad[_0x7c77('0x2a')][_0x7c77('0x39')]){_0x434fdb['include']=[{'all':!![]}];}return db['ZendeskConfiguration']['findAll'](_0x434fdb);})['then'](function(_0x49182e){_0x7d7e25[_0x7c77('0x3a')]=_0x49182e;return _0x7d7e25;})[_0x7c77('0x21')](respondWithFilteredResult(_0x2932ec,_0x434fdb))['catch'](handleError(_0x2932ec,null));};exports[_0x7c77('0x3b')]=function(_0x5f1d8e,_0x40aa50){var _0x492a78={'raw':![],'where':{'id':_0x5f1d8e[_0x7c77('0x3c')]['id']}},_0x16158a={};_0x16158a[_0x7c77('0x2d')]=_['keys'](db[_0x7c77('0x27')][_0x7c77('0x28')]);_0x16158a['query']=_[_0x7c77('0x2b')](_0x5f1d8e['query']);_0x16158a[_0x7c77('0x34')]=_[_0x7c77('0x2c')](_0x16158a[_0x7c77('0x2d')],_0x16158a[_0x7c77('0x2a')]);_0x492a78[_0x7c77('0x2f')]=_[_0x7c77('0x2c')](_0x16158a[_0x7c77('0x2d')],qs['fields'](_0x5f1d8e[_0x7c77('0x2a')][_0x7c77('0x2e')]));_0x492a78['attributes']=_0x492a78[_0x7c77('0x2f')][_0x7c77('0x30')]?_0x492a78[_0x7c77('0x2f')]:_0x16158a[_0x7c77('0x2d')];if(_0x5f1d8e[_0x7c77('0x2a')][_0x7c77('0x39')]){_0x492a78[_0x7c77('0x3d')]=[{'all':!![]}];}_0x492a78=_[_0x7c77('0x36')]({},_0x492a78,_0x5f1d8e[_0x7c77('0x38')]);return db[_0x7c77('0x27')][_0x7c77('0x3e')](_0x492a78)['then'](handleEntityNotFound(_0x40aa50,null))['then'](respondWithResult(_0x40aa50,null))['catch'](handleError(_0x40aa50,null));};exports[_0x7c77('0x3f')]=function(_0x2a1c78,_0x1ecab6){return db[_0x7c77('0x27')][_0x7c77('0x3f')](_0x2a1c78[_0x7c77('0x40')],{})[_0x7c77('0x21')](respondWithResult(_0x1ecab6,0xc9))[_0x7c77('0x41')](handleError(_0x1ecab6,null));};exports['update']=function(_0x53c771,_0x293b8e){if(_0x53c771[_0x7c77('0x40')]['id']){delete _0x53c771['body']['id'];}return db[_0x7c77('0x27')][_0x7c77('0x3e')]({'where':{'id':_0x53c771[_0x7c77('0x3c')]['id']}})[_0x7c77('0x21')](handleEntityNotFound(_0x293b8e,null))[_0x7c77('0x21')](saveUpdates(_0x53c771[_0x7c77('0x40')],null))[_0x7c77('0x21')](respondWithResult(_0x293b8e,null))[_0x7c77('0x41')](handleError(_0x293b8e,null));};exports['destroy']=function(_0x147b8d,_0x5fea12){return db[_0x7c77('0x27')][_0x7c77('0x3e')]({'where':{'id':_0x147b8d['params']['id']}})['then'](handleEntityNotFound(_0x5fea12,null))[_0x7c77('0x21')](removeEntity(_0x5fea12,null))[_0x7c77('0x41')](handleError(_0x5fea12,null));};exports['getFields']=function(_0x3ab398,_0xc9eba3,_0x42e61e){var _0x269050={};var _0x3c8c9b={};var _0x3883bb;var _0x4ce6a7;return db['ZendeskConfiguration'][_0x7c77('0x42')]({'where':{'id':_0x3ab398[_0x7c77('0x3c')]['id']}})[_0x7c77('0x21')](handleEntityNotFound(_0xc9eba3,null))['then'](function(_0xc4ea58){if(_0xc4ea58){_0x3883bb=_0xc4ea58;_0x3c8c9b[_0x7c77('0x2d')]=_[_0x7c77('0x2b')](db['ZendeskField'][_0x7c77('0x28')]);_0x3c8c9b['query']=_[_0x7c77('0x2b')](_0x3ab398['query']);_0x3c8c9b['filters']=_[_0x7c77('0x2c')](_0x3c8c9b[_0x7c77('0x2d')],_0x3c8c9b[_0x7c77('0x2a')]);_0x269050['attributes']=_[_0x7c77('0x2c')](_0x3c8c9b[_0x7c77('0x2d')],qs[_0x7c77('0x2e')](_0x3ab398[_0x7c77('0x2a')]['fields']));_0x269050[_0x7c77('0x2f')]=_0x269050['attributes'][_0x7c77('0x30')]?_0x269050['attributes']:_0x3c8c9b['model'];_0x269050['order']=qs[_0x7c77('0x33')](_0x3ab398[_0x7c77('0x2a')][_0x7c77('0x33')]);_0x269050['where']=qs[_0x7c77('0x34')](_['pick'](_0x3ab398[_0x7c77('0x2a')],_0x3c8c9b[_0x7c77('0x34')]));if(_0x3ab398[_0x7c77('0x2a')][_0x7c77('0x35')]){_0x269050[_0x7c77('0x43')]=_['merge'](_0x269050[_0x7c77('0x43')],{'$or':_[_0x7c77('0x26')](_0x269050[_0x7c77('0x2f')],function(_0x4c0fa0){var _0x585b84={};_0x585b84[_0x4c0fa0]={'$like':'%'+_0x3ab398[_0x7c77('0x2a')][_0x7c77('0x35')]+'%'};return _0x585b84;})});}_0x269050=_[_0x7c77('0x36')]({},_0x269050,_0x3ab398['options']);return _0x3883bb['getFields'](_0x269050);}})[_0x7c77('0x21')](function(_0x50e43c){if(_0x50e43c){_0x4ce6a7=_0x50e43c[_0x7c77('0x30')];if(!_0x3ab398['query'][_0x7c77('0x44')](_0x7c77('0x31'))){_0x269050['limit']=qs[_0x7c77('0x1c')](_0x3ab398[_0x7c77('0x2a')][_0x7c77('0x1c')]);_0x269050[_0x7c77('0x19')]=qs['offset'](_0x3ab398['query'][_0x7c77('0x19')]);}return _0x3883bb[_0x7c77('0x45')](_0x269050);}})[_0x7c77('0x21')](function(_0x4bc68b){if(_0x4bc68b){return _0x4bc68b?{'count':_0x4ce6a7,'rows':_0x4bc68b}:null;}})[_0x7c77('0x21')](respondWithResult(_0xc9eba3,null))['catch'](handleError(_0xc9eba3,null));};exports[_0x7c77('0x46')]=function(_0x2e107d,_0x25f8c6,_0x3da513){var _0x3e46dc={};var _0x8a4dc2={};var _0x5eddef;var _0x1bc050;return db[_0x7c77('0x27')][_0x7c77('0x42')]({'where':{'id':_0x2e107d['params']['id']}})[_0x7c77('0x21')](handleEntityNotFound(_0x25f8c6,null))[_0x7c77('0x21')](function(_0x1dd95a){if(_0x1dd95a){_0x5eddef=_0x1dd95a;_0x8a4dc2[_0x7c77('0x2d')]=_[_0x7c77('0x2b')](db[_0x7c77('0x47')]['rawAttributes']);_0x8a4dc2[_0x7c77('0x2a')]=_[_0x7c77('0x2b')](_0x2e107d[_0x7c77('0x2a')]);_0x8a4dc2[_0x7c77('0x34')]=_[_0x7c77('0x2c')](_0x8a4dc2[_0x7c77('0x2d')],_0x8a4dc2['query']);_0x3e46dc[_0x7c77('0x2f')]=_[_0x7c77('0x2c')](_0x8a4dc2[_0x7c77('0x2d')],qs[_0x7c77('0x2e')](_0x2e107d[_0x7c77('0x2a')][_0x7c77('0x2e')]));_0x3e46dc['attributes']=_0x3e46dc['attributes'][_0x7c77('0x30')]?_0x3e46dc[_0x7c77('0x2f')]:_0x8a4dc2[_0x7c77('0x2d')];_0x3e46dc[_0x7c77('0x32')]=qs[_0x7c77('0x33')](_0x2e107d[_0x7c77('0x2a')][_0x7c77('0x33')]);_0x3e46dc[_0x7c77('0x43')]=qs['filters'](_[_0x7c77('0x48')](_0x2e107d[_0x7c77('0x2a')],_0x8a4dc2[_0x7c77('0x34')]));if(_0x2e107d['query']['filter']){_0x3e46dc['where']=_['merge'](_0x3e46dc[_0x7c77('0x43')],{'$or':_[_0x7c77('0x26')](_0x3e46dc[_0x7c77('0x2f')],function(_0x5dbd70){var _0x295805={};_0x295805[_0x5dbd70]={'$like':'%'+_0x2e107d[_0x7c77('0x2a')][_0x7c77('0x35')]+'%'};return _0x295805;})});}_0x3e46dc=_[_0x7c77('0x36')]({},_0x3e46dc,_0x2e107d['options']);return _0x5eddef['getSubjects'](_0x3e46dc);}})[_0x7c77('0x21')](function(_0x209310){if(_0x209310){_0x1bc050=_0x209310[_0x7c77('0x30')];if(!_0x2e107d[_0x7c77('0x2a')]['hasOwnProperty'](_0x7c77('0x31'))){_0x3e46dc[_0x7c77('0x1c')]=qs[_0x7c77('0x1c')](_0x2e107d[_0x7c77('0x2a')][_0x7c77('0x1c')]);_0x3e46dc['offset']=qs[_0x7c77('0x19')](_0x2e107d[_0x7c77('0x2a')]['offset']);}return _0x5eddef['getSubjects'](_0x3e46dc);}})[_0x7c77('0x21')](function(_0x576845){if(_0x576845){return _0x576845?{'count':_0x1bc050,'rows':_0x576845}:null;}})[_0x7c77('0x21')](respondWithResult(_0x25f8c6,null))['catch'](handleError(_0x25f8c6,null));};exports[_0x7c77('0x49')]=function(_0x319d15,_0x350205,_0x32d5ac){var _0x167e81={};var _0x165e87={};var _0x930cf8;var _0x1af120;return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x319d15['params']['id']}})[_0x7c77('0x21')](handleEntityNotFound(_0x350205,null))[_0x7c77('0x21')](function(_0x215ea8){if(_0x215ea8){_0x930cf8=_0x215ea8;_0x165e87['model']=_['keys'](db['ZendeskField'][_0x7c77('0x28')]);_0x165e87[_0x7c77('0x2a')]=_['keys'](_0x319d15['query']);_0x165e87[_0x7c77('0x34')]=_[_0x7c77('0x2c')](_0x165e87[_0x7c77('0x2d')],_0x165e87['query']);_0x167e81[_0x7c77('0x2f')]=_[_0x7c77('0x2c')](_0x165e87[_0x7c77('0x2d')],qs[_0x7c77('0x2e')](_0x319d15['query']['fields']));_0x167e81[_0x7c77('0x2f')]=_0x167e81[_0x7c77('0x2f')][_0x7c77('0x30')]?_0x167e81[_0x7c77('0x2f')]:_0x165e87[_0x7c77('0x2d')];_0x167e81['order']=qs[_0x7c77('0x33')](_0x319d15[_0x7c77('0x2a')][_0x7c77('0x33')]);_0x167e81[_0x7c77('0x43')]=qs[_0x7c77('0x34')](_['pick'](_0x319d15[_0x7c77('0x2a')],_0x165e87[_0x7c77('0x34')]));if(_0x319d15[_0x7c77('0x2a')][_0x7c77('0x35')]){_0x167e81[_0x7c77('0x43')]=_[_0x7c77('0x36')](_0x167e81[_0x7c77('0x43')],{'$or':_[_0x7c77('0x26')](_0x167e81['attributes'],function(_0x57ca25){var _0x131899={};_0x131899[_0x57ca25]={'$like':'%'+_0x319d15[_0x7c77('0x2a')][_0x7c77('0x35')]+'%'};return _0x131899;})});}_0x167e81=_[_0x7c77('0x36')]({},_0x167e81,_0x319d15[_0x7c77('0x38')]);return _0x930cf8[_0x7c77('0x49')](_0x167e81);}})[_0x7c77('0x21')](function(_0x35ccdb){if(_0x35ccdb){_0x1af120=_0x35ccdb[_0x7c77('0x30')];if(!_0x319d15[_0x7c77('0x2a')][_0x7c77('0x44')](_0x7c77('0x31'))){_0x167e81[_0x7c77('0x1c')]=qs[_0x7c77('0x1c')](_0x319d15[_0x7c77('0x2a')][_0x7c77('0x1c')]);_0x167e81[_0x7c77('0x19')]=qs['offset'](_0x319d15[_0x7c77('0x2a')]['offset']);}return _0x930cf8[_0x7c77('0x49')](_0x167e81);}})[_0x7c77('0x21')](function(_0x5a0b94){if(_0x5a0b94){return _0x5a0b94?{'count':_0x1af120,'rows':_0x5a0b94}:null;}})['then'](respondWithResult(_0x350205,null))[_0x7c77('0x41')](handleError(_0x350205,null));};exports[_0x7c77('0x4a')]=function(_0x328310,_0x2b469b,_0x123cea){var _0x236fe1={};var _0x11a783={};var _0x42ba00;var _0x1e85b7;return db[_0x7c77('0x27')]['findOne']({'where':{'id':_0x328310[_0x7c77('0x3c')]['id']}})[_0x7c77('0x21')](handleEntityNotFound(_0x2b469b,null))[_0x7c77('0x21')](function(_0x1dd42c){if(_0x1dd42c){_0x42ba00=_0x1dd42c;_0x11a783['model']=_['keys'](db[_0x7c77('0x4b')][_0x7c77('0x28')]);_0x11a783[_0x7c77('0x2a')]=_[_0x7c77('0x2b')](_0x328310[_0x7c77('0x2a')]);_0x11a783[_0x7c77('0x34')]=_[_0x7c77('0x2c')](_0x11a783['model'],_0x11a783[_0x7c77('0x2a')]);_0x236fe1[_0x7c77('0x2f')]=_[_0x7c77('0x2c')](_0x11a783[_0x7c77('0x2d')],qs['fields'](_0x328310['query']['fields']));_0x236fe1[_0x7c77('0x2f')]=_0x236fe1['attributes'][_0x7c77('0x30')]?_0x236fe1[_0x7c77('0x2f')]:_0x11a783[_0x7c77('0x2d')];_0x236fe1[_0x7c77('0x32')]=qs[_0x7c77('0x33')](_0x328310[_0x7c77('0x2a')]['sort']);_0x236fe1[_0x7c77('0x43')]=qs[_0x7c77('0x34')](_[_0x7c77('0x48')](_0x328310[_0x7c77('0x2a')],_0x11a783[_0x7c77('0x34')]));if(_0x328310[_0x7c77('0x2a')]['filter']){_0x236fe1['where']=_[_0x7c77('0x36')](_0x236fe1[_0x7c77('0x43')],{'$or':_[_0x7c77('0x26')](_0x236fe1[_0x7c77('0x2f')],function(_0x467349){var _0x13047d={};_0x13047d[_0x467349]={'$like':'%'+_0x328310[_0x7c77('0x2a')][_0x7c77('0x35')]+'%'};return _0x13047d;})});}_0x236fe1=_[_0x7c77('0x36')]({},_0x236fe1,_0x328310[_0x7c77('0x38')]);return _0x42ba00[_0x7c77('0x4a')](_0x236fe1);}})['then'](function(_0xe365a3){if(_0xe365a3){_0x1e85b7=_0xe365a3[_0x7c77('0x30')];if(!_0x328310[_0x7c77('0x2a')][_0x7c77('0x44')](_0x7c77('0x31'))){_0x236fe1[_0x7c77('0x1c')]=qs[_0x7c77('0x1c')](_0x328310[_0x7c77('0x2a')][_0x7c77('0x1c')]);_0x236fe1[_0x7c77('0x19')]=qs[_0x7c77('0x19')](_0x328310[_0x7c77('0x2a')][_0x7c77('0x19')]);}return _0x42ba00['getTags'](_0x236fe1);}})[_0x7c77('0x21')](function(_0x350a62){if(_0x350a62){return _0x350a62?{'count':_0x1e85b7,'rows':_0x350a62}:null;}})['then'](respondWithResult(_0x2b469b,null))[_0x7c77('0x41')](handleError(_0x2b469b,null));};exports['setTags']=function(_0xd1af36,_0x59b013,_0x5b5c3b){if(_0xd1af36['body']['id']){delete _0xd1af36[_0x7c77('0x40')]['id'];}return db[_0x7c77('0x27')][_0x7c77('0x42')]({'where':{'id':_0xd1af36[_0x7c77('0x3c')]['id']}})[_0x7c77('0x21')](handleEntityNotFound(_0x59b013,null))[_0x7c77('0x21')](function(_0x46c82f){if(_0x46c82f){return _0x46c82f[_0x7c77('0x4c')](_0xd1af36['body'][_0x7c77('0x4d')]||[]);}return null;})[_0x7c77('0x21')](respondWithResult(_0x59b013,null))[_0x7c77('0x41')](handleError(_0x59b013,null));}; \ No newline at end of file +var _0xcebf=['includeAll','include','then','rows','catch','show','params','keys','intersection','find','create','body','getFields','findOne','ZendeskField','length','order','filter','getSubjects','hasOwnProperty','getDescriptions','getTags','Tag','nolimit','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','set','apply','reject','save','update','destroy','sendStatus','error','stack','name','send','index','map','ZendeskConfiguration','rawAttributes','type','key','model','query','filters','attributes','fields','offset','sort','where','pick','merge','VIRTUAL','options'];(function(_0x17ce9f,_0x380b89){var _0x5867b1=function(_0x43a7ee){while(--_0x43a7ee){_0x17ce9f['push'](_0x17ce9f['shift']());}};_0x5867b1(++_0x380b89);}(_0xcebf,0x113));var _0xfceb=function(_0x4903de,_0x2623b8){_0x4903de=_0x4903de-0x0;var _0x439a9c=_0xcebf[_0x4903de];return _0x439a9c;};'use strict';var emlformat=require(_0xfceb('0x0'));var rimraf=require(_0xfceb('0x1'));var zipdir=require(_0xfceb('0x2'));var jsonpatch=require(_0xfceb('0x3'));var rp=require('request-promise');var moment=require(_0xfceb('0x4'));var BPromise=require(_0xfceb('0x5'));var Mustache=require(_0xfceb('0x6'));var util=require(_0xfceb('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xfceb('0x8'));var ejs=require(_0xfceb('0x9'));var fs=require('fs');var fs_extra=require(_0xfceb('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xfceb('0xb'));var deskjs=require(_0xfceb('0xc'));var toCsv=require(_0xfceb('0x8'));var querystring=require(_0xfceb('0xd'));var Papa=require('papaparse');var Redis=require(_0xfceb('0xe'));var authService=require(_0xfceb('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xfceb('0x10'));var hardwareService=require(_0xfceb('0x11'));var logger=require(_0xfceb('0x12'))('api');var utils=require('../../config/utils');var config=require(_0xfceb('0x13'));var licenseUtil=require(_0xfceb('0x14'));var db=require(_0xfceb('0x15'))['db'];function respondWithStatusCode(_0x3949ed,_0xed14f9){_0xed14f9=_0xed14f9||0xcc;return function(_0x279737){if(_0x279737){return _0x3949ed['sendStatus'](_0xed14f9);}return _0x3949ed[_0xfceb('0x16')](_0xed14f9)[_0xfceb('0x17')]();};}function respondWithResult(_0x4dab1a,_0x35daa6){_0x35daa6=_0x35daa6||0xc8;return function(_0x35d4bd){if(_0x35d4bd){return _0x4dab1a[_0xfceb('0x16')](_0x35daa6)[_0xfceb('0x18')](_0x35d4bd);}};}function respondWithFilteredResult(_0x314671,_0x35f77c){return function(_0x2350f3){if(_0x2350f3){var _0x2a8cd3=typeof _0x35f77c['offset']===_0xfceb('0x19')&&typeof _0x35f77c[_0xfceb('0x1a')]===_0xfceb('0x19');var _0x32761a=_0x2350f3[_0xfceb('0x1b')];var _0x197994=_0x2a8cd3?0x0:_0x35f77c['offset'];var _0xdb6be4=_0x2a8cd3?_0x2350f3[_0xfceb('0x1b')]:_0x35f77c['offset']+_0x35f77c[_0xfceb('0x1a')];var _0x15a320;if(_0xdb6be4>=_0x32761a){_0xdb6be4=_0x32761a;_0x15a320=0xc8;}else{_0x15a320=0xce;}_0x314671[_0xfceb('0x16')](_0x15a320);return _0x314671[_0xfceb('0x1c')]('Content-Range',_0x197994+'-'+_0xdb6be4+'/'+_0x32761a)[_0xfceb('0x18')](_0x2350f3);}return null;};}function patchUpdates(_0x56d514){return function(_0x366e1d){try{jsonpatch[_0xfceb('0x1d')](_0x366e1d,_0x56d514,!![]);}catch(_0x4c831e){return BPromise[_0xfceb('0x1e')](_0x4c831e);}return _0x366e1d[_0xfceb('0x1f')]();};}function saveUpdates(_0x2ae07f,_0x27a751){return function(_0x276da7){if(_0x276da7){return _0x276da7[_0xfceb('0x20')](_0x2ae07f)['then'](function(_0xde46c9){return _0xde46c9;});}return null;};}function removeEntity(_0x3b25f6,_0xb4ee65){return function(_0x3a598f){if(_0x3a598f){return _0x3a598f[_0xfceb('0x21')]()['then'](function(){_0x3b25f6[_0xfceb('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4ca238,_0x1331b1){return function(_0x3e42c9){if(!_0x3e42c9){_0x4ca238[_0xfceb('0x22')](0x194);}return _0x3e42c9;};}function handleError(_0x1b34d2,_0x310f47){_0x310f47=_0x310f47||0x1f4;return function(_0x1e2ddb){logger[_0xfceb('0x23')](_0x1e2ddb[_0xfceb('0x24')]);if(_0x1e2ddb[_0xfceb('0x25')]){delete _0x1e2ddb[_0xfceb('0x25')];}_0x1b34d2['status'](_0x310f47)[_0xfceb('0x26')](_0x1e2ddb);};}exports[_0xfceb('0x27')]=function(_0x1c065e,_0x53cf07){var _0x235b6a={},_0x31e55f={},_0x50b8c9={'count':0x0,'rows':[]};var _0x3b1689=_[_0xfceb('0x28')](db[_0xfceb('0x29')][_0xfceb('0x2a')],function(_0x43a360){return{'name':_0x43a360['fieldName'],'type':_0x43a360[_0xfceb('0x2b')][_0xfceb('0x2c')]};});_0x31e55f[_0xfceb('0x2d')]=_[_0xfceb('0x28')](_0x3b1689,_0xfceb('0x25'));_0x31e55f[_0xfceb('0x2e')]=_['keys'](_0x1c065e['query']);_0x31e55f[_0xfceb('0x2f')]=_['intersection'](_0x31e55f[_0xfceb('0x2d')],_0x31e55f[_0xfceb('0x2e')]);_0x235b6a[_0xfceb('0x30')]=_['intersection'](_0x31e55f[_0xfceb('0x2d')],qs[_0xfceb('0x31')](_0x1c065e[_0xfceb('0x2e')][_0xfceb('0x31')]));_0x235b6a[_0xfceb('0x30')]=_0x235b6a[_0xfceb('0x30')]['length']?_0x235b6a[_0xfceb('0x30')]:_0x31e55f['model'];if(!_0x1c065e['query']['hasOwnProperty']('nolimit')){_0x235b6a['limit']=qs[_0xfceb('0x1a')](_0x1c065e['query']['limit']);_0x235b6a[_0xfceb('0x32')]=qs['offset'](_0x1c065e[_0xfceb('0x2e')]['offset']);}_0x235b6a['order']=qs['sort'](_0x1c065e[_0xfceb('0x2e')][_0xfceb('0x33')]);_0x235b6a[_0xfceb('0x34')]=qs[_0xfceb('0x2f')](_[_0xfceb('0x35')](_0x1c065e[_0xfceb('0x2e')],_0x31e55f[_0xfceb('0x2f')]),_0x3b1689);if(_0x1c065e[_0xfceb('0x2e')]['filter']){_0x235b6a[_0xfceb('0x34')]=_[_0xfceb('0x36')](_0x235b6a[_0xfceb('0x34')],{'$or':_[_0xfceb('0x28')](_0x3b1689,function(_0x508cc8){if(_0x508cc8[_0xfceb('0x2b')]!==_0xfceb('0x37')){var _0x1f06d5={};_0x1f06d5[_0x508cc8[_0xfceb('0x25')]]={'$like':'%'+_0x1c065e['query']['filter']+'%'};return _0x1f06d5;}})});}_0x235b6a=_[_0xfceb('0x36')]({},_0x235b6a,_0x1c065e[_0xfceb('0x38')]);var _0xeeabf7={'where':_0x235b6a[_0xfceb('0x34')]};return db[_0xfceb('0x29')]['count'](_0xeeabf7)['then'](function(_0x16b918){_0x50b8c9[_0xfceb('0x1b')]=_0x16b918;if(_0x1c065e['query'][_0xfceb('0x39')]){_0x235b6a[_0xfceb('0x3a')]=[{'all':!![]}];}return db[_0xfceb('0x29')]['findAll'](_0x235b6a);})[_0xfceb('0x3b')](function(_0x594aa7){_0x50b8c9[_0xfceb('0x3c')]=_0x594aa7;return _0x50b8c9;})['then'](respondWithFilteredResult(_0x53cf07,_0x235b6a))[_0xfceb('0x3d')](handleError(_0x53cf07,null));};exports[_0xfceb('0x3e')]=function(_0x315d8,_0x2c2820){var _0x34c062={'raw':![],'where':{'id':_0x315d8[_0xfceb('0x3f')]['id']}},_0x324bcf={};_0x324bcf[_0xfceb('0x2d')]=_[_0xfceb('0x40')](db[_0xfceb('0x29')][_0xfceb('0x2a')]);_0x324bcf[_0xfceb('0x2e')]=_[_0xfceb('0x40')](_0x315d8[_0xfceb('0x2e')]);_0x324bcf['filters']=_['intersection'](_0x324bcf[_0xfceb('0x2d')],_0x324bcf[_0xfceb('0x2e')]);_0x34c062['attributes']=_[_0xfceb('0x41')](_0x324bcf[_0xfceb('0x2d')],qs[_0xfceb('0x31')](_0x315d8[_0xfceb('0x2e')][_0xfceb('0x31')]));_0x34c062[_0xfceb('0x30')]=_0x34c062['attributes']['length']?_0x34c062[_0xfceb('0x30')]:_0x324bcf[_0xfceb('0x2d')];if(_0x315d8[_0xfceb('0x2e')][_0xfceb('0x39')]){_0x34c062['include']=[{'all':!![]}];}_0x34c062=_['merge']({},_0x34c062,_0x315d8[_0xfceb('0x38')]);return db[_0xfceb('0x29')][_0xfceb('0x42')](_0x34c062)['then'](handleEntityNotFound(_0x2c2820,null))['then'](respondWithResult(_0x2c2820,null))['catch'](handleError(_0x2c2820,null));};exports[_0xfceb('0x43')]=function(_0x1e6567,_0xc32f5b){return db[_0xfceb('0x29')][_0xfceb('0x43')](_0x1e6567[_0xfceb('0x44')],{})['then'](respondWithResult(_0xc32f5b,0xc9))['catch'](handleError(_0xc32f5b,null));};exports[_0xfceb('0x20')]=function(_0x203025,_0x1026ff){if(_0x203025['body']['id']){delete _0x203025[_0xfceb('0x44')]['id'];}return db[_0xfceb('0x29')][_0xfceb('0x42')]({'where':{'id':_0x203025['params']['id']}})[_0xfceb('0x3b')](handleEntityNotFound(_0x1026ff,null))[_0xfceb('0x3b')](saveUpdates(_0x203025[_0xfceb('0x44')],null))[_0xfceb('0x3b')](respondWithResult(_0x1026ff,null))[_0xfceb('0x3d')](handleError(_0x1026ff,null));};exports['destroy']=function(_0x36d7fc,_0x11292d){return db[_0xfceb('0x29')]['find']({'where':{'id':_0x36d7fc[_0xfceb('0x3f')]['id']}})[_0xfceb('0x3b')](handleEntityNotFound(_0x11292d,null))[_0xfceb('0x3b')](removeEntity(_0x11292d,null))[_0xfceb('0x3d')](handleError(_0x11292d,null));};exports[_0xfceb('0x45')]=function(_0xea6c6,_0x40f58e,_0x4f5172){var _0xecf140={};var _0x1f5c9f={};var _0x2c3161;var _0x445fb7;return db[_0xfceb('0x29')][_0xfceb('0x46')]({'where':{'id':_0xea6c6[_0xfceb('0x3f')]['id']}})[_0xfceb('0x3b')](handleEntityNotFound(_0x40f58e,null))['then'](function(_0x3618bc){if(_0x3618bc){_0x2c3161=_0x3618bc;_0x1f5c9f[_0xfceb('0x2d')]=_[_0xfceb('0x40')](db[_0xfceb('0x47')][_0xfceb('0x2a')]);_0x1f5c9f[_0xfceb('0x2e')]=_[_0xfceb('0x40')](_0xea6c6[_0xfceb('0x2e')]);_0x1f5c9f[_0xfceb('0x2f')]=_[_0xfceb('0x41')](_0x1f5c9f[_0xfceb('0x2d')],_0x1f5c9f[_0xfceb('0x2e')]);_0xecf140[_0xfceb('0x30')]=_[_0xfceb('0x41')](_0x1f5c9f[_0xfceb('0x2d')],qs['fields'](_0xea6c6[_0xfceb('0x2e')][_0xfceb('0x31')]));_0xecf140['attributes']=_0xecf140['attributes'][_0xfceb('0x48')]?_0xecf140['attributes']:_0x1f5c9f['model'];_0xecf140[_0xfceb('0x49')]=qs[_0xfceb('0x33')](_0xea6c6[_0xfceb('0x2e')]['sort']);_0xecf140[_0xfceb('0x34')]=qs[_0xfceb('0x2f')](_[_0xfceb('0x35')](_0xea6c6[_0xfceb('0x2e')],_0x1f5c9f['filters']));if(_0xea6c6[_0xfceb('0x2e')][_0xfceb('0x4a')]){_0xecf140['where']=_['merge'](_0xecf140['where'],{'$or':_[_0xfceb('0x28')](_0xecf140[_0xfceb('0x30')],function(_0xd536e8){var _0x2af32f={};_0x2af32f[_0xd536e8]={'$like':'%'+_0xea6c6['query']['filter']+'%'};return _0x2af32f;})});}_0xecf140=_[_0xfceb('0x36')]({},_0xecf140,_0xea6c6[_0xfceb('0x38')]);return _0x2c3161[_0xfceb('0x45')](_0xecf140);}})[_0xfceb('0x3b')](function(_0x9355c3){if(_0x9355c3){_0x445fb7=_0x9355c3[_0xfceb('0x48')];if(!_0xea6c6[_0xfceb('0x2e')]['hasOwnProperty']('nolimit')){_0xecf140[_0xfceb('0x1a')]=qs[_0xfceb('0x1a')](_0xea6c6[_0xfceb('0x2e')][_0xfceb('0x1a')]);_0xecf140['offset']=qs[_0xfceb('0x32')](_0xea6c6['query'][_0xfceb('0x32')]);}return _0x2c3161['getFields'](_0xecf140);}})[_0xfceb('0x3b')](function(_0x173aee){if(_0x173aee){return _0x173aee?{'count':_0x445fb7,'rows':_0x173aee}:null;}})[_0xfceb('0x3b')](respondWithResult(_0x40f58e,null))['catch'](handleError(_0x40f58e,null));};exports[_0xfceb('0x4b')]=function(_0x34357d,_0x707fca,_0x4d0130){var _0x3027e6={};var _0x314ac4={};var _0x83c3a5;var _0x549a0d;return db['ZendeskConfiguration'][_0xfceb('0x46')]({'where':{'id':_0x34357d[_0xfceb('0x3f')]['id']}})[_0xfceb('0x3b')](handleEntityNotFound(_0x707fca,null))['then'](function(_0x445897){if(_0x445897){_0x83c3a5=_0x445897;_0x314ac4['model']=_[_0xfceb('0x40')](db[_0xfceb('0x47')]['rawAttributes']);_0x314ac4[_0xfceb('0x2e')]=_[_0xfceb('0x40')](_0x34357d[_0xfceb('0x2e')]);_0x314ac4['filters']=_[_0xfceb('0x41')](_0x314ac4[_0xfceb('0x2d')],_0x314ac4['query']);_0x3027e6['attributes']=_[_0xfceb('0x41')](_0x314ac4[_0xfceb('0x2d')],qs[_0xfceb('0x31')](_0x34357d[_0xfceb('0x2e')]['fields']));_0x3027e6[_0xfceb('0x30')]=_0x3027e6[_0xfceb('0x30')]['length']?_0x3027e6['attributes']:_0x314ac4[_0xfceb('0x2d')];_0x3027e6['order']=qs[_0xfceb('0x33')](_0x34357d[_0xfceb('0x2e')][_0xfceb('0x33')]);_0x3027e6[_0xfceb('0x34')]=qs[_0xfceb('0x2f')](_['pick'](_0x34357d[_0xfceb('0x2e')],_0x314ac4['filters']));if(_0x34357d[_0xfceb('0x2e')][_0xfceb('0x4a')]){_0x3027e6[_0xfceb('0x34')]=_[_0xfceb('0x36')](_0x3027e6[_0xfceb('0x34')],{'$or':_[_0xfceb('0x28')](_0x3027e6['attributes'],function(_0x2e561c){var _0x31f922={};_0x31f922[_0x2e561c]={'$like':'%'+_0x34357d[_0xfceb('0x2e')]['filter']+'%'};return _0x31f922;})});}_0x3027e6=_[_0xfceb('0x36')]({},_0x3027e6,_0x34357d[_0xfceb('0x38')]);return _0x83c3a5[_0xfceb('0x4b')](_0x3027e6);}})[_0xfceb('0x3b')](function(_0x553b56){if(_0x553b56){_0x549a0d=_0x553b56[_0xfceb('0x48')];if(!_0x34357d[_0xfceb('0x2e')][_0xfceb('0x4c')]('nolimit')){_0x3027e6['limit']=qs['limit'](_0x34357d[_0xfceb('0x2e')]['limit']);_0x3027e6[_0xfceb('0x32')]=qs[_0xfceb('0x32')](_0x34357d[_0xfceb('0x2e')]['offset']);}return _0x83c3a5[_0xfceb('0x4b')](_0x3027e6);}})['then'](function(_0x250572){if(_0x250572){return _0x250572?{'count':_0x549a0d,'rows':_0x250572}:null;}})[_0xfceb('0x3b')](respondWithResult(_0x707fca,null))[_0xfceb('0x3d')](handleError(_0x707fca,null));};exports[_0xfceb('0x4d')]=function(_0x2a9950,_0x2a8ae3,_0x11cafc){var _0x12bb43={};var _0x294502={};var _0x43649d;var _0x47c2e8;return db[_0xfceb('0x29')]['findOne']({'where':{'id':_0x2a9950[_0xfceb('0x3f')]['id']}})['then'](handleEntityNotFound(_0x2a8ae3,null))[_0xfceb('0x3b')](function(_0x58b8b0){if(_0x58b8b0){_0x43649d=_0x58b8b0;_0x294502[_0xfceb('0x2d')]=_['keys'](db['ZendeskField'][_0xfceb('0x2a')]);_0x294502[_0xfceb('0x2e')]=_['keys'](_0x2a9950[_0xfceb('0x2e')]);_0x294502['filters']=_[_0xfceb('0x41')](_0x294502[_0xfceb('0x2d')],_0x294502[_0xfceb('0x2e')]);_0x12bb43['attributes']=_['intersection'](_0x294502['model'],qs[_0xfceb('0x31')](_0x2a9950[_0xfceb('0x2e')][_0xfceb('0x31')]));_0x12bb43['attributes']=_0x12bb43[_0xfceb('0x30')][_0xfceb('0x48')]?_0x12bb43['attributes']:_0x294502['model'];_0x12bb43[_0xfceb('0x49')]=qs[_0xfceb('0x33')](_0x2a9950[_0xfceb('0x2e')][_0xfceb('0x33')]);_0x12bb43[_0xfceb('0x34')]=qs['filters'](_[_0xfceb('0x35')](_0x2a9950[_0xfceb('0x2e')],_0x294502[_0xfceb('0x2f')]));if(_0x2a9950['query'][_0xfceb('0x4a')]){_0x12bb43[_0xfceb('0x34')]=_[_0xfceb('0x36')](_0x12bb43[_0xfceb('0x34')],{'$or':_[_0xfceb('0x28')](_0x12bb43[_0xfceb('0x30')],function(_0x1421f5){var _0x726a1f={};_0x726a1f[_0x1421f5]={'$like':'%'+_0x2a9950[_0xfceb('0x2e')][_0xfceb('0x4a')]+'%'};return _0x726a1f;})});}_0x12bb43=_[_0xfceb('0x36')]({},_0x12bb43,_0x2a9950['options']);return _0x43649d[_0xfceb('0x4d')](_0x12bb43);}})[_0xfceb('0x3b')](function(_0x3950ce){if(_0x3950ce){_0x47c2e8=_0x3950ce['length'];if(!_0x2a9950[_0xfceb('0x2e')]['hasOwnProperty']('nolimit')){_0x12bb43['limit']=qs[_0xfceb('0x1a')](_0x2a9950['query'][_0xfceb('0x1a')]);_0x12bb43['offset']=qs[_0xfceb('0x32')](_0x2a9950[_0xfceb('0x2e')][_0xfceb('0x32')]);}return _0x43649d[_0xfceb('0x4d')](_0x12bb43);}})['then'](function(_0x7010e8){if(_0x7010e8){return _0x7010e8?{'count':_0x47c2e8,'rows':_0x7010e8}:null;}})[_0xfceb('0x3b')](respondWithResult(_0x2a8ae3,null))[_0xfceb('0x3d')](handleError(_0x2a8ae3,null));};exports[_0xfceb('0x4e')]=function(_0x512647,_0xaae00,_0x20ba6e){var _0x10d9dc={};var _0x1552d8={};var _0x2b8137;var _0x27315c;return db['ZendeskConfiguration'][_0xfceb('0x46')]({'where':{'id':_0x512647['params']['id']}})[_0xfceb('0x3b')](handleEntityNotFound(_0xaae00,null))['then'](function(_0x48abcd){if(_0x48abcd){_0x2b8137=_0x48abcd;_0x1552d8[_0xfceb('0x2d')]=_[_0xfceb('0x40')](db[_0xfceb('0x4f')][_0xfceb('0x2a')]);_0x1552d8[_0xfceb('0x2e')]=_[_0xfceb('0x40')](_0x512647['query']);_0x1552d8[_0xfceb('0x2f')]=_[_0xfceb('0x41')](_0x1552d8[_0xfceb('0x2d')],_0x1552d8[_0xfceb('0x2e')]);_0x10d9dc[_0xfceb('0x30')]=_[_0xfceb('0x41')](_0x1552d8[_0xfceb('0x2d')],qs[_0xfceb('0x31')](_0x512647[_0xfceb('0x2e')][_0xfceb('0x31')]));_0x10d9dc['attributes']=_0x10d9dc[_0xfceb('0x30')]['length']?_0x10d9dc['attributes']:_0x1552d8[_0xfceb('0x2d')];_0x10d9dc[_0xfceb('0x49')]=qs['sort'](_0x512647[_0xfceb('0x2e')]['sort']);_0x10d9dc[_0xfceb('0x34')]=qs[_0xfceb('0x2f')](_[_0xfceb('0x35')](_0x512647['query'],_0x1552d8[_0xfceb('0x2f')]));if(_0x512647[_0xfceb('0x2e')][_0xfceb('0x4a')]){_0x10d9dc[_0xfceb('0x34')]=_[_0xfceb('0x36')](_0x10d9dc[_0xfceb('0x34')],{'$or':_[_0xfceb('0x28')](_0x10d9dc[_0xfceb('0x30')],function(_0x348d86){var _0x22d8a4={};_0x22d8a4[_0x348d86]={'$like':'%'+_0x512647['query'][_0xfceb('0x4a')]+'%'};return _0x22d8a4;})});}_0x10d9dc=_[_0xfceb('0x36')]({},_0x10d9dc,_0x512647['options']);return _0x2b8137[_0xfceb('0x4e')](_0x10d9dc);}})['then'](function(_0x2be2a0){if(_0x2be2a0){_0x27315c=_0x2be2a0[_0xfceb('0x48')];if(!_0x512647[_0xfceb('0x2e')][_0xfceb('0x4c')](_0xfceb('0x50'))){_0x10d9dc['limit']=qs[_0xfceb('0x1a')](_0x512647[_0xfceb('0x2e')][_0xfceb('0x1a')]);_0x10d9dc[_0xfceb('0x32')]=qs[_0xfceb('0x32')](_0x512647[_0xfceb('0x2e')][_0xfceb('0x32')]);}return _0x2b8137[_0xfceb('0x4e')](_0x10d9dc);}})[_0xfceb('0x3b')](function(_0x55776f){if(_0x55776f){return _0x55776f?{'count':_0x27315c,'rows':_0x55776f}:null;}})['then'](respondWithResult(_0xaae00,null))[_0xfceb('0x3d')](handleError(_0xaae00,null));};exports[_0xfceb('0x51')]=function(_0x38b8c9,_0x31df7b,_0xf8e441){if(_0x38b8c9['body']['id']){delete _0x38b8c9['body']['id'];}return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x38b8c9['params']['id']}})[_0xfceb('0x3b')](handleEntityNotFound(_0x31df7b,null))['then'](function(_0x4a0a62){if(_0x4a0a62){return _0x4a0a62[_0xfceb('0x51')](_0x38b8c9[_0xfceb('0x44')][_0xfceb('0x52')]||[]);}return null;})['then'](respondWithResult(_0x31df7b,null))[_0xfceb('0x3d')](handleError(_0x31df7b,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index b04881e..fd1b159 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 _0xda2d=['./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','int_zendesk_configurations','util','../../config/logger','api','moment','bluebird','../../config/environment'];(function(_0x54a47c,_0x2b7d50){var _0x530157=function(_0x2bf14a){while(--_0x2bf14a){_0x54a47c['push'](_0x54a47c['shift']());}};_0x530157(++_0x2b7d50);}(_0xda2d,0x102));var _0xdda2=function(_0x1b0c66,_0x19b780){_0x1b0c66=_0x1b0c66-0x0;var _0x2cfe98=_0xda2d[_0x1b0c66];return _0x2cfe98;};'use strict';var _=require('lodash');var util=require(_0xdda2('0x0'));var logger=require(_0xdda2('0x1'))(_0xdda2('0x2'));var moment=require(_0xdda2('0x3'));var BPromise=require(_0xdda2('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xdda2('0x5'));var attributes=require(_0xdda2('0x6'));module[_0xdda2('0x7')]=function(_0x39f6c9,_0xc256bc){return _0x39f6c9[_0xdda2('0x8')](_0xdda2('0x9'),attributes,{'tableName':_0xdda2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x13f6=['request-promise','rimraf','../../config/environment','./intZendeskConfiguration.attributes','lodash','util','moment','bluebird'];(function(_0x6b1acd,_0x45febf){var _0x360834=function(_0x2d01e5){while(--_0x2d01e5){_0x6b1acd['push'](_0x6b1acd['shift']());}};_0x360834(++_0x45febf);}(_0x13f6,0x124));var _0x613f=function(_0x5c23fb,_0xdb7d52){_0x5c23fb=_0x5c23fb-0x0;var _0x5c26c0=_0x13f6[_0x5c23fb];return _0x5c26c0;};'use strict';var _=require(_0x613f('0x0'));var util=require(_0x613f('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x613f('0x2'));var BPromise=require(_0x613f('0x3'));var rp=require(_0x613f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x613f('0x5'));var config=require(_0x613f('0x6'));var attributes=require(_0x613f('0x7'));module['exports']=function(_0x3f3525,_0x2367b3){return _0x3f3525['define']('ZendeskConfiguration',attributes,{'tableName':'int_zendesk_configurations','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 308da81..33deec9 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 _0x0699=['debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ZendeskConfiguration,\x20%s,\x20%s','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','info','request\x20sent'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x0699,0xce));var _0x9069=function(_0x91394,_0x29fce1){_0x91394=_0x91394-0x0;var _0x5a5d8b=_0x0699[_0x91394];return _0x5a5d8b;};'use strict';var _=require(_0x9069('0x0'));var util=require(_0x9069('0x1'));var moment=require(_0x9069('0x2'));var BPromise=require(_0x9069('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9069('0x4'));var db=require(_0x9069('0x5'))['db'];var utils=require(_0x9069('0x6'));var logger=require(_0x9069('0x7'))('rpc');var config=require(_0x9069('0x8'));var jayson=require(_0x9069('0x9'));var client=jayson[_0x9069('0xa')][_0x9069('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4b0d42,_0x537887,_0x29b4c7){return new BPromise(function(_0x4dc6ae,_0xe0955c){return client['request'](_0x4b0d42,_0x29b4c7)['then'](function(_0x5ea51a){logger[_0x9069('0xc')]('ZendeskConfiguration,\x20%s,\x20%s',_0x537887,_0x9069('0xd'));logger[_0x9069('0xe')](_0x9069('0xf'),_0x537887,_0x9069('0xd'),JSON[_0x9069('0x10')](_0x5ea51a));if(_0x5ea51a[_0x9069('0x11')]){if(_0x5ea51a[_0x9069('0x11')][_0x9069('0x12')]===0x1f4){logger[_0x9069('0x11')]('ZendeskConfiguration,\x20%s,\x20%s',_0x537887,_0x5ea51a[_0x9069('0x11')]['message']);return _0xe0955c(_0x5ea51a['error'][_0x9069('0x13')]);}logger[_0x9069('0x11')](_0x9069('0x14'),_0x537887,_0x5ea51a[_0x9069('0x11')][_0x9069('0x13')]);return _0x4dc6ae(_0x5ea51a[_0x9069('0x11')][_0x9069('0x13')]);}else{logger[_0x9069('0xc')](_0x9069('0x14'),_0x537887,_0x9069('0xd'));_0x4dc6ae(_0x5ea51a['result']['message']);}})[_0x9069('0x15')](function(_0x317091){logger[_0x9069('0x11')](_0x9069('0x14'),_0x537887,_0x317091);_0xe0955c(_0x317091);});});} \ No newline at end of file +var _0x2758=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash'];(function(_0x1d453f,_0x5793a9){var _0x50996a=function(_0x59bdf3){while(--_0x59bdf3){_0x1d453f['push'](_0x1d453f['shift']());}};_0x50996a(++_0x5793a9);}(_0x2758,0x19d));var _0x8275=function(_0x12da68,_0x168696){_0x12da68=_0x12da68-0x0;var _0x42875c=_0x2758[_0x12da68];return _0x42875c;};'use strict';var _=require(_0x8275('0x0'));var util=require(_0x8275('0x1'));var moment=require(_0x8275('0x2'));var BPromise=require(_0x8275('0x3'));var rs=require(_0x8275('0x4'));var fs=require('fs');var Redis=require(_0x8275('0x5'));var db=require(_0x8275('0x6'))['db'];var utils=require(_0x8275('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x8275('0x8'));var jayson=require(_0x8275('0x9'));var client=jayson[_0x8275('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xd3efdc,_0x34a524,_0x5b705a){return new BPromise(function(_0x4e1db1,_0x5a029b){return client[_0x8275('0xb')](_0xd3efdc,_0x5b705a)[_0x8275('0xc')](function(_0x6b7f9e){logger[_0x8275('0xd')](_0x8275('0xe'),_0x34a524,'request\x20sent');logger['debug'](_0x8275('0xf'),_0x34a524,_0x8275('0x10'),JSON[_0x8275('0x11')](_0x6b7f9e));if(_0x6b7f9e['error']){if(_0x6b7f9e[_0x8275('0x12')][_0x8275('0x13')]===0x1f4){logger[_0x8275('0x12')](_0x8275('0xe'),_0x34a524,_0x6b7f9e[_0x8275('0x12')][_0x8275('0x14')]);return _0x5a029b(_0x6b7f9e[_0x8275('0x12')][_0x8275('0x14')]);}logger[_0x8275('0x12')]('ZendeskConfiguration,\x20%s,\x20%s',_0x34a524,_0x6b7f9e[_0x8275('0x12')][_0x8275('0x14')]);return _0x4e1db1(_0x6b7f9e[_0x8275('0x12')][_0x8275('0x14')]);}else{logger[_0x8275('0xd')](_0x8275('0xe'),_0x34a524,_0x8275('0x10'));_0x4e1db1(_0x6b7f9e[_0x8275('0x15')]['message']);}})[_0x8275('0x16')](function(_0x227aa3){logger[_0x8275('0x12')]('ZendeskConfiguration,\x20%s,\x20%s',_0x34a524,_0x227aa3);_0x5a029b(_0x227aa3);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index 5125028..02380de 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 _0x04a4=['post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','index','/:id','isAuthenticated'];(function(_0x496e6e,_0x29527e){var _0x4cf25e=function(_0x43fd04){while(--_0x43fd04){_0x496e6e['push'](_0x496e6e['shift']());}};_0x4cf25e(++_0x29527e);}(_0x04a4,0x1cf));var _0x404a=function(_0x1cf130,_0x2135ed){_0x1cf130=_0x1cf130-0x0;var _0x1e8bd2=_0x04a4[_0x1cf130];return _0x1e8bd2;};'use strict';var multer=require(_0x404a('0x0'));var util=require(_0x404a('0x1'));var path=require('path');var timeout=require(_0x404a('0x2'));var express=require(_0x404a('0x3'));var router=express['Router']();var fs_extra=require(_0x404a('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x404a('0x5'));var config=require(_0x404a('0x6'));var controller=require(_0x404a('0x7'));router[_0x404a('0x8')]('/',auth['isAuthenticated'](),controller[_0x404a('0x9')]);router[_0x404a('0x8')](_0x404a('0xa'),auth[_0x404a('0xb')](),controller['show']);router[_0x404a('0xc')]('/',auth['isAuthenticated'](),controller[_0x404a('0xd')]);router[_0x404a('0xe')](_0x404a('0xa'),auth['isAuthenticated'](),controller[_0x404a('0xf')]);router[_0x404a('0x10')](_0x404a('0xa'),auth[_0x404a('0xb')](),controller[_0x404a('0x11')]);module[_0x404a('0x12')]=router; \ No newline at end of file +var _0x2a42=['../../config/environment','./intZendeskField.controller','index','get','show','post','create','/:id','isAuthenticated','update','delete','exports','util','path','connect-timeout','Router'];(function(_0x1684f4,_0x57e155){var _0x89f3c1=function(_0xc0d20e){while(--_0xc0d20e){_0x1684f4['push'](_0x1684f4['shift']());}};_0x89f3c1(++_0x57e155);}(_0x2a42,0xec));var _0x22a4=function(_0x589f38,_0x314b1a){_0x589f38=_0x589f38-0x0;var _0x33633b=_0x2a42[_0x589f38];return _0x33633b;};'use strict';var multer=require('multer');var util=require(_0x22a4('0x0'));var path=require(_0x22a4('0x1'));var timeout=require(_0x22a4('0x2'));var express=require('express');var router=express[_0x22a4('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x22a4('0x4'));var controller=require(_0x22a4('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0x22a4('0x6')]);router[_0x22a4('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x22a4('0x8')]);router[_0x22a4('0x9')]('/',auth['isAuthenticated'](),controller[_0x22a4('0xa')]);router['put'](_0x22a4('0xb'),auth[_0x22a4('0xc')](),controller[_0x22a4('0xd')]);router[_0x22a4('0xe')](_0x22a4('0xb'),auth[_0x22a4('0xc')](),controller['destroy']);module[_0x22a4('0xf')]=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index e2e6593..c1543c5 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 _0x1808=['customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable'];(function(_0x123e4a,_0x337dd9){var _0x279e0a=function(_0x2aab7a){while(--_0x2aab7a){_0x123e4a['push'](_0x123e4a['shift']());}};_0x279e0a(++_0x337dd9);}(_0x1808,0x73));var _0x8180=function(_0x1c8c2f,_0x1d99fe){_0x1c8c2f=_0x1c8c2f-0x0;var _0x24fa67=_0x1808[_0x1c8c2f];return _0x24fa67;};'use strict';var Sequelize=require(_0x8180('0x0'));module[_0x8180('0x1')]={'type':{'type':Sequelize[_0x8180('0x2')](_0x8180('0x3'),_0x8180('0x4'),_0x8180('0x5'),_0x8180('0x6'),_0x8180('0x7')),'defaultValue':'string'},'content':{'type':Sequelize[_0x8180('0x8')]},'key':{'type':Sequelize[_0x8180('0x8')]},'keyType':{'type':Sequelize[_0x8180('0x2')]('string','variable',_0x8180('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x8180('0x8')]},'nameField':{'type':Sequelize[_0x8180('0x8')]},'customField':{'type':Sequelize[_0x8180('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8180('0x8')]}}; \ No newline at end of file +var _0xbfa3=['customVariable','keyValue','string','STRING','variable','BOOLEAN','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbfa3,0x16e));var _0x3bfa=function(_0x12c7ff,_0x2d631c){_0x12c7ff=_0x12c7ff-0x0;var _0x5459d3=_0xbfa3[_0x12c7ff];return _0x5459d3;};'use strict';var Sequelize=require(_0x3bfa('0x0'));module[_0x3bfa('0x1')]={'type':{'type':Sequelize['ENUM']('string','variable',_0x3bfa('0x2'),_0x3bfa('0x3'),'picklist'),'defaultValue':_0x3bfa('0x4')},'content':{'type':Sequelize[_0x3bfa('0x5')]},'key':{'type':Sequelize[_0x3bfa('0x5')]},'keyType':{'type':Sequelize['ENUM']('string',_0x3bfa('0x6'),_0x3bfa('0x2'))},'keyContent':{'type':Sequelize[_0x3bfa('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x3bfa('0x7')],'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 48727ec..b789773 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 _0xb2e3=['findAll','rows','catch','show','params','length','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','destroy','then','error','stack','name','send','index','map','ZendeskField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include'];(function(_0x320112,_0x5f10ae){var _0x353564=function(_0x4ef01a){while(--_0x4ef01a){_0x320112['push'](_0x320112['shift']());}};_0x353564(++_0x5f10ae);}(_0xb2e3,0xf9));var _0x3b2e=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0xb2e3[_0xdea41a];return _0x15d0d8;};'use strict';var emlformat=require(_0x3b2e('0x0'));var rimraf=require(_0x3b2e('0x1'));var zipdir=require(_0x3b2e('0x2'));var jsonpatch=require(_0x3b2e('0x3'));var rp=require(_0x3b2e('0x4'));var moment=require(_0x3b2e('0x5'));var BPromise=require(_0x3b2e('0x6'));var Mustache=require('mustache');var util=require(_0x3b2e('0x7'));var path=require(_0x3b2e('0x8'));var sox=require(_0x3b2e('0x9'));var csv=require(_0x3b2e('0xa'));var ejs=require(_0x3b2e('0xb'));var fs=require('fs');var fs_extra=require(_0x3b2e('0xc'));var _=require('lodash');var squel=require(_0x3b2e('0xd'));var crypto=require(_0x3b2e('0xe'));var jsforce=require(_0x3b2e('0xf'));var deskjs=require(_0x3b2e('0x10'));var toCsv=require(_0x3b2e('0xa'));var querystring=require(_0x3b2e('0x11'));var Papa=require(_0x3b2e('0x12'));var Redis=require('ioredis');var authService=require(_0x3b2e('0x13'));var qs=require(_0x3b2e('0x14'));var as=require(_0x3b2e('0x15'));var hardwareService=require(_0x3b2e('0x16'));var logger=require(_0x3b2e('0x17'))(_0x3b2e('0x18'));var utils=require(_0x3b2e('0x19'));var config=require(_0x3b2e('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x3b2e('0x1b'))['db'];function respondWithStatusCode(_0x45506a,_0x20eae6){_0x20eae6=_0x20eae6||0xcc;return function(_0x455790){if(_0x455790){return _0x45506a[_0x3b2e('0x1c')](_0x20eae6);}return _0x45506a[_0x3b2e('0x1d')](_0x20eae6)['end']();};}function respondWithResult(_0x3bb5a5,_0x46da44){_0x46da44=_0x46da44||0xc8;return function(_0x3c786a){if(_0x3c786a){return _0x3bb5a5['status'](_0x46da44)[_0x3b2e('0x1e')](_0x3c786a);}};}function respondWithFilteredResult(_0x467925,_0x256658){return function(_0x488593){if(_0x488593){var _0x11f813=typeof _0x256658[_0x3b2e('0x1f')]===_0x3b2e('0x20')&&typeof _0x256658['limit']===_0x3b2e('0x20');var _0x24de50=_0x488593['count'];var _0x5ca7fd=_0x11f813?0x0:_0x256658['offset'];var _0x1e3778=_0x11f813?_0x488593[_0x3b2e('0x21')]:_0x256658['offset']+_0x256658[_0x3b2e('0x22')];var _0x5b2ebe;if(_0x1e3778>=_0x24de50){_0x1e3778=_0x24de50;_0x5b2ebe=0xc8;}else{_0x5b2ebe=0xce;}_0x467925[_0x3b2e('0x1d')](_0x5b2ebe);return _0x467925[_0x3b2e('0x23')](_0x3b2e('0x24'),_0x5ca7fd+'-'+_0x1e3778+'/'+_0x24de50)[_0x3b2e('0x1e')](_0x488593);}return null;};}function patchUpdates(_0x2aaf28){return function(_0x347f1d){try{jsonpatch[_0x3b2e('0x25')](_0x347f1d,_0x2aaf28,!![]);}catch(_0x23bfc4){return BPromise['reject'](_0x23bfc4);}return _0x347f1d[_0x3b2e('0x26')]();};}function saveUpdates(_0x48e561,_0x1e4299){return function(_0x216441){if(_0x216441){return _0x216441[_0x3b2e('0x27')](_0x48e561)['then'](function(_0x1f0d91){return _0x1f0d91;});}return null;};}function removeEntity(_0x1ee3ea,_0x3714b3){return function(_0x356f67){if(_0x356f67){return _0x356f67[_0x3b2e('0x28')]()[_0x3b2e('0x29')](function(){_0x1ee3ea[_0x3b2e('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x468010,_0x57d3ad){return function(_0x346e23){if(!_0x346e23){_0x468010['sendStatus'](0x194);}return _0x346e23;};}function handleError(_0x130ed1,_0xbbe540){_0xbbe540=_0xbbe540||0x1f4;return function(_0x2c1d27){logger[_0x3b2e('0x2a')](_0x2c1d27[_0x3b2e('0x2b')]);if(_0x2c1d27[_0x3b2e('0x2c')]){delete _0x2c1d27[_0x3b2e('0x2c')];}_0x130ed1[_0x3b2e('0x1d')](_0xbbe540)[_0x3b2e('0x2d')](_0x2c1d27);};}exports[_0x3b2e('0x2e')]=function(_0x3aeea4,_0x353b8a){var _0x29920c={},_0xd94722={},_0x4cdc90={'count':0x0,'rows':[]};var _0x40c5e0=_[_0x3b2e('0x2f')](db[_0x3b2e('0x30')][_0x3b2e('0x31')],function(_0x25e69c){return{'name':_0x25e69c[_0x3b2e('0x32')],'type':_0x25e69c[_0x3b2e('0x33')][_0x3b2e('0x34')]};});_0xd94722[_0x3b2e('0x35')]=_[_0x3b2e('0x2f')](_0x40c5e0,_0x3b2e('0x2c'));_0xd94722[_0x3b2e('0x36')]=_[_0x3b2e('0x37')](_0x3aeea4['query']);_0xd94722[_0x3b2e('0x38')]=_[_0x3b2e('0x39')](_0xd94722[_0x3b2e('0x35')],_0xd94722[_0x3b2e('0x36')]);_0x29920c[_0x3b2e('0x3a')]=_[_0x3b2e('0x39')](_0xd94722[_0x3b2e('0x35')],qs[_0x3b2e('0x3b')](_0x3aeea4[_0x3b2e('0x36')][_0x3b2e('0x3b')]));_0x29920c[_0x3b2e('0x3a')]=_0x29920c[_0x3b2e('0x3a')]['length']?_0x29920c['attributes']:_0xd94722[_0x3b2e('0x35')];if(!_0x3aeea4[_0x3b2e('0x36')][_0x3b2e('0x3c')](_0x3b2e('0x3d'))){_0x29920c['limit']=qs['limit'](_0x3aeea4['query'][_0x3b2e('0x22')]);_0x29920c[_0x3b2e('0x1f')]=qs[_0x3b2e('0x1f')](_0x3aeea4['query'][_0x3b2e('0x1f')]);}_0x29920c[_0x3b2e('0x3e')]=qs[_0x3b2e('0x3f')](_0x3aeea4['query'][_0x3b2e('0x3f')]);_0x29920c[_0x3b2e('0x40')]=qs[_0x3b2e('0x38')](_[_0x3b2e('0x41')](_0x3aeea4['query'],_0xd94722[_0x3b2e('0x38')]),_0x40c5e0);if(_0x3aeea4[_0x3b2e('0x36')]['filter']){_0x29920c['where']=_['merge'](_0x29920c[_0x3b2e('0x40')],{'$or':_[_0x3b2e('0x2f')](_0x40c5e0,function(_0x479296){if(_0x479296[_0x3b2e('0x33')]!=='VIRTUAL'){var _0x421290={};_0x421290[_0x479296['name']]={'$like':'%'+_0x3aeea4[_0x3b2e('0x36')][_0x3b2e('0x42')]+'%'};return _0x421290;}})});}_0x29920c=_[_0x3b2e('0x43')]({},_0x29920c,_0x3aeea4[_0x3b2e('0x44')]);var _0x2c11b0={'where':_0x29920c[_0x3b2e('0x40')]};return db['ZendeskField'][_0x3b2e('0x21')](_0x2c11b0)[_0x3b2e('0x29')](function(_0x194609){_0x4cdc90[_0x3b2e('0x21')]=_0x194609;if(_0x3aeea4[_0x3b2e('0x36')][_0x3b2e('0x45')]){_0x29920c[_0x3b2e('0x46')]=[{'all':!![]}];}return db[_0x3b2e('0x30')][_0x3b2e('0x47')](_0x29920c);})[_0x3b2e('0x29')](function(_0x5356fd){_0x4cdc90[_0x3b2e('0x48')]=_0x5356fd;return _0x4cdc90;})['then'](respondWithFilteredResult(_0x353b8a,_0x29920c))[_0x3b2e('0x49')](handleError(_0x353b8a,null));};exports[_0x3b2e('0x4a')]=function(_0x3c44de,_0x35549c){var _0x1d0388={'raw':!![],'where':{'id':_0x3c44de[_0x3b2e('0x4b')]['id']}},_0x1c3f51={};_0x1c3f51['model']=_[_0x3b2e('0x37')](db[_0x3b2e('0x30')][_0x3b2e('0x31')]);_0x1c3f51[_0x3b2e('0x36')]=_[_0x3b2e('0x37')](_0x3c44de[_0x3b2e('0x36')]);_0x1c3f51['filters']=_[_0x3b2e('0x39')](_0x1c3f51[_0x3b2e('0x35')],_0x1c3f51[_0x3b2e('0x36')]);_0x1d0388[_0x3b2e('0x3a')]=_[_0x3b2e('0x39')](_0x1c3f51['model'],qs[_0x3b2e('0x3b')](_0x3c44de[_0x3b2e('0x36')]['fields']));_0x1d0388[_0x3b2e('0x3a')]=_0x1d0388[_0x3b2e('0x3a')][_0x3b2e('0x4c')]?_0x1d0388[_0x3b2e('0x3a')]:_0x1c3f51[_0x3b2e('0x35')];if(_0x3c44de['query']['includeAll']){_0x1d0388[_0x3b2e('0x46')]=[{'all':!![]}];}_0x1d0388=_[_0x3b2e('0x43')]({},_0x1d0388,_0x3c44de['options']);return db[_0x3b2e('0x30')][_0x3b2e('0x4d')](_0x1d0388)[_0x3b2e('0x29')](handleEntityNotFound(_0x35549c,null))[_0x3b2e('0x29')](respondWithResult(_0x35549c,null))[_0x3b2e('0x49')](handleError(_0x35549c,null));};exports[_0x3b2e('0x4e')]=function(_0x12f550,_0x2f256e){return db['ZendeskField'][_0x3b2e('0x4e')](_0x12f550[_0x3b2e('0x4f')],{})['then'](respondWithResult(_0x2f256e,0xc9))['catch'](handleError(_0x2f256e,null));};exports[_0x3b2e('0x27')]=function(_0x5de99f,_0x42a43b){if(_0x5de99f[_0x3b2e('0x4f')]['id']){delete _0x5de99f[_0x3b2e('0x4f')]['id'];}return db[_0x3b2e('0x30')][_0x3b2e('0x4d')]({'where':{'id':_0x5de99f[_0x3b2e('0x4b')]['id']}})[_0x3b2e('0x29')](handleEntityNotFound(_0x42a43b,null))[_0x3b2e('0x29')](saveUpdates(_0x5de99f[_0x3b2e('0x4f')],null))['then'](respondWithResult(_0x42a43b,null))['catch'](handleError(_0x42a43b,null));};exports[_0x3b2e('0x28')]=function(_0x15e2d1,_0x417274){return db[_0x3b2e('0x30')][_0x3b2e('0x4d')]({'where':{'id':_0x15e2d1[_0x3b2e('0x4b')]['id']}})[_0x3b2e('0x29')](handleEntityNotFound(_0x417274,null))[_0x3b2e('0x29')](removeEntity(_0x417274,null))[_0x3b2e('0x49')](handleError(_0x417274,null));}; \ No newline at end of file +var _0xe032=['create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','apply','reject','save','update','then','error','stack','name','index','map','ZendeskField','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','rows','catch','show','params','include'];(function(_0x5d30b4,_0x199248){var _0x1acfb8=function(_0x3544b2){while(--_0x3544b2){_0x5d30b4['push'](_0x5d30b4['shift']());}};_0x1acfb8(++_0x199248);}(_0xe032,0x175));var _0x2e03=function(_0x311374,_0x132c28){_0x311374=_0x311374-0x0;var _0x1bf041=_0xe032[_0x311374];return _0x1bf041;};'use strict';var emlformat=require(_0x2e03('0x0'));var rimraf=require(_0x2e03('0x1'));var zipdir=require(_0x2e03('0x2'));var jsonpatch=require(_0x2e03('0x3'));var rp=require(_0x2e03('0x4'));var moment=require(_0x2e03('0x5'));var BPromise=require(_0x2e03('0x6'));var Mustache=require('mustache');var util=require(_0x2e03('0x7'));var path=require('path');var sox=require(_0x2e03('0x8'));var csv=require('to-csv');var ejs=require(_0x2e03('0x9'));var fs=require('fs');var fs_extra=require(_0x2e03('0xa'));var _=require(_0x2e03('0xb'));var squel=require(_0x2e03('0xc'));var crypto=require(_0x2e03('0xd'));var jsforce=require(_0x2e03('0xe'));var deskjs=require(_0x2e03('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2e03('0x10'));var Redis=require(_0x2e03('0x11'));var authService=require(_0x2e03('0x12'));var qs=require(_0x2e03('0x13'));var as=require(_0x2e03('0x14'));var hardwareService=require(_0x2e03('0x15'));var logger=require(_0x2e03('0x16'))(_0x2e03('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x2e03('0x18'));var db=require(_0x2e03('0x19'))['db'];function respondWithStatusCode(_0xbd139c,_0x4b807d){_0x4b807d=_0x4b807d||0xcc;return function(_0x4bc361){if(_0x4bc361){return _0xbd139c[_0x2e03('0x1a')](_0x4b807d);}return _0xbd139c[_0x2e03('0x1b')](_0x4b807d)[_0x2e03('0x1c')]();};}function respondWithResult(_0x55f2af,_0x47f1a7){_0x47f1a7=_0x47f1a7||0xc8;return function(_0x21107a){if(_0x21107a){return _0x55f2af[_0x2e03('0x1b')](_0x47f1a7)[_0x2e03('0x1d')](_0x21107a);}};}function respondWithFilteredResult(_0x127c14,_0x3c75f4){return function(_0x190ca2){if(_0x190ca2){var _0x18ea08=typeof _0x3c75f4['offset']===_0x2e03('0x1e')&&typeof _0x3c75f4[_0x2e03('0x1f')]==='undefined';var _0x25c15c=_0x190ca2[_0x2e03('0x20')];var _0x1f12de=_0x18ea08?0x0:_0x3c75f4[_0x2e03('0x21')];var _0x362a8f=_0x18ea08?_0x190ca2[_0x2e03('0x20')]:_0x3c75f4[_0x2e03('0x21')]+_0x3c75f4['limit'];var _0x36574e;if(_0x362a8f>=_0x25c15c){_0x362a8f=_0x25c15c;_0x36574e=0xc8;}else{_0x36574e=0xce;}_0x127c14['status'](_0x36574e);return _0x127c14['set']('Content-Range',_0x1f12de+'-'+_0x362a8f+'/'+_0x25c15c)[_0x2e03('0x1d')](_0x190ca2);}return null;};}function patchUpdates(_0x22f9e8){return function(_0x33f6f1){try{jsonpatch[_0x2e03('0x22')](_0x33f6f1,_0x22f9e8,!![]);}catch(_0x409a1c){return BPromise[_0x2e03('0x23')](_0x409a1c);}return _0x33f6f1[_0x2e03('0x24')]();};}function saveUpdates(_0x577a5a,_0x536bd8){return function(_0x3d0660){if(_0x3d0660){return _0x3d0660[_0x2e03('0x25')](_0x577a5a)[_0x2e03('0x26')](function(_0x34b6f0){return _0x34b6f0;});}return null;};}function removeEntity(_0x4c08c1,_0x31d205){return function(_0x28319f){if(_0x28319f){return _0x28319f['destroy']()[_0x2e03('0x26')](function(){_0x4c08c1[_0x2e03('0x1b')](0xcc)[_0x2e03('0x1c')]();});}};}function handleEntityNotFound(_0x546946,_0x133316){return function(_0x3eae7e){if(!_0x3eae7e){_0x546946[_0x2e03('0x1a')](0x194);}return _0x3eae7e;};}function handleError(_0x2d5229,_0x15cd0a){_0x15cd0a=_0x15cd0a||0x1f4;return function(_0x153ee4){logger[_0x2e03('0x27')](_0x153ee4[_0x2e03('0x28')]);if(_0x153ee4[_0x2e03('0x29')]){delete _0x153ee4[_0x2e03('0x29')];}_0x2d5229[_0x2e03('0x1b')](_0x15cd0a)['send'](_0x153ee4);};}exports[_0x2e03('0x2a')]=function(_0x3a9fb3,_0x50b5a5){var _0x193da4={},_0x258819={},_0x3ca331={'count':0x0,'rows':[]};var _0x5f8230=_[_0x2e03('0x2b')](db[_0x2e03('0x2c')][_0x2e03('0x2d')],function(_0xd52061){return{'name':_0xd52061[_0x2e03('0x2e')],'type':_0xd52061['type'][_0x2e03('0x2f')]};});_0x258819[_0x2e03('0x30')]=_[_0x2e03('0x2b')](_0x5f8230,_0x2e03('0x29'));_0x258819['query']=_[_0x2e03('0x31')](_0x3a9fb3[_0x2e03('0x32')]);_0x258819[_0x2e03('0x33')]=_[_0x2e03('0x34')](_0x258819[_0x2e03('0x30')],_0x258819[_0x2e03('0x32')]);_0x193da4[_0x2e03('0x35')]=_[_0x2e03('0x34')](_0x258819[_0x2e03('0x30')],qs[_0x2e03('0x36')](_0x3a9fb3[_0x2e03('0x32')][_0x2e03('0x36')]));_0x193da4[_0x2e03('0x35')]=_0x193da4[_0x2e03('0x35')][_0x2e03('0x37')]?_0x193da4[_0x2e03('0x35')]:_0x258819[_0x2e03('0x30')];if(!_0x3a9fb3[_0x2e03('0x32')][_0x2e03('0x38')]('nolimit')){_0x193da4[_0x2e03('0x1f')]=qs[_0x2e03('0x1f')](_0x3a9fb3[_0x2e03('0x32')]['limit']);_0x193da4[_0x2e03('0x21')]=qs[_0x2e03('0x21')](_0x3a9fb3[_0x2e03('0x32')]['offset']);}_0x193da4[_0x2e03('0x39')]=qs[_0x2e03('0x3a')](_0x3a9fb3[_0x2e03('0x32')][_0x2e03('0x3a')]);_0x193da4[_0x2e03('0x3b')]=qs[_0x2e03('0x33')](_[_0x2e03('0x3c')](_0x3a9fb3[_0x2e03('0x32')],_0x258819[_0x2e03('0x33')]),_0x5f8230);if(_0x3a9fb3[_0x2e03('0x32')][_0x2e03('0x3d')]){_0x193da4[_0x2e03('0x3b')]=_[_0x2e03('0x3e')](_0x193da4[_0x2e03('0x3b')],{'$or':_['map'](_0x5f8230,function(_0x3a3584){if(_0x3a3584[_0x2e03('0x3f')]!==_0x2e03('0x40')){var _0x2864aa={};_0x2864aa[_0x3a3584[_0x2e03('0x29')]]={'$like':'%'+_0x3a9fb3[_0x2e03('0x32')][_0x2e03('0x3d')]+'%'};return _0x2864aa;}})});}_0x193da4=_[_0x2e03('0x3e')]({},_0x193da4,_0x3a9fb3['options']);var _0x396744={'where':_0x193da4['where']};return db['ZendeskField']['count'](_0x396744)[_0x2e03('0x26')](function(_0x1ade71){_0x3ca331[_0x2e03('0x20')]=_0x1ade71;if(_0x3a9fb3[_0x2e03('0x32')][_0x2e03('0x41')]){_0x193da4['include']=[{'all':!![]}];}return db[_0x2e03('0x2c')]['findAll'](_0x193da4);})[_0x2e03('0x26')](function(_0x15170a){_0x3ca331[_0x2e03('0x42')]=_0x15170a;return _0x3ca331;})[_0x2e03('0x26')](respondWithFilteredResult(_0x50b5a5,_0x193da4))[_0x2e03('0x43')](handleError(_0x50b5a5,null));};exports[_0x2e03('0x44')]=function(_0x2ba067,_0x524351){var _0x30c252={'raw':!![],'where':{'id':_0x2ba067[_0x2e03('0x45')]['id']}},_0x22a395={};_0x22a395[_0x2e03('0x30')]=_[_0x2e03('0x31')](db[_0x2e03('0x2c')][_0x2e03('0x2d')]);_0x22a395[_0x2e03('0x32')]=_[_0x2e03('0x31')](_0x2ba067[_0x2e03('0x32')]);_0x22a395['filters']=_['intersection'](_0x22a395['model'],_0x22a395[_0x2e03('0x32')]);_0x30c252[_0x2e03('0x35')]=_[_0x2e03('0x34')](_0x22a395['model'],qs[_0x2e03('0x36')](_0x2ba067[_0x2e03('0x32')][_0x2e03('0x36')]));_0x30c252['attributes']=_0x30c252[_0x2e03('0x35')]['length']?_0x30c252['attributes']:_0x22a395['model'];if(_0x2ba067['query'][_0x2e03('0x41')]){_0x30c252[_0x2e03('0x46')]=[{'all':!![]}];}_0x30c252=_[_0x2e03('0x3e')]({},_0x30c252,_0x2ba067['options']);return db[_0x2e03('0x2c')]['find'](_0x30c252)['then'](handleEntityNotFound(_0x524351,null))[_0x2e03('0x26')](respondWithResult(_0x524351,null))['catch'](handleError(_0x524351,null));};exports['create']=function(_0x33af1d,_0x28e26e){return db[_0x2e03('0x2c')][_0x2e03('0x47')](_0x33af1d[_0x2e03('0x48')],{})[_0x2e03('0x26')](respondWithResult(_0x28e26e,0xc9))[_0x2e03('0x43')](handleError(_0x28e26e,null));};exports[_0x2e03('0x25')]=function(_0x4560b9,_0x56d753){if(_0x4560b9[_0x2e03('0x48')]['id']){delete _0x4560b9['body']['id'];}return db['ZendeskField']['find']({'where':{'id':_0x4560b9[_0x2e03('0x45')]['id']}})[_0x2e03('0x26')](handleEntityNotFound(_0x56d753,null))['then'](saveUpdates(_0x4560b9[_0x2e03('0x48')],null))[_0x2e03('0x26')](respondWithResult(_0x56d753,null))[_0x2e03('0x43')](handleError(_0x56d753,null));};exports[_0x2e03('0x49')]=function(_0x1bce14,_0x4e94d5){return db[_0x2e03('0x2c')]['find']({'where':{'id':_0x1bce14['params']['id']}})[_0x2e03('0x26')](handleEntityNotFound(_0x4e94d5,null))[_0x2e03('0x26')](removeEntity(_0x4e94d5,null))[_0x2e03('0x43')](handleError(_0x4e94d5,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index a37f9c8..a63f83f 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 _0x5d13=['../../config/environment','./intZendeskField.attributes','exports','define','ZendeskField','int_zendesk_fields','zendesk_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x5d13,0x1b9));var _0x35d1=function(_0x38042d,_0x477a8b){_0x38042d=_0x38042d-0x0;var _0x5e64eb=_0x5d13[_0x38042d];return _0x5e64eb;};'use strict';var _=require(_0x35d1('0x0'));var util=require(_0x35d1('0x1'));var logger=require(_0x35d1('0x2'))(_0x35d1('0x3'));var moment=require(_0x35d1('0x4'));var BPromise=require(_0x35d1('0x5'));var rp=require(_0x35d1('0x6'));var fs=require('fs');var path=require(_0x35d1('0x7'));var rimraf=require(_0x35d1('0x8'));var config=require(_0x35d1('0x9'));var attributes=require(_0x35d1('0xa'));module[_0x35d1('0xb')]=function(_0x5a8366,_0x35dc2b){return _0x5a8366[_0x35d1('0xc')](_0x35d1('0xd'),attributes,{'tableName':_0x35d1('0xe'),'paranoid':![],'indexes':[{'name':_0x35d1('0xf'),'fields':[_0x35d1('0x10'),_0x35d1('0x11')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5feb=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','ZendeskField','int_zendesk_fields','zendesk_unique_index','idField','lodash'];(function(_0x570c8a,_0x4a11cc){var _0x25dc12=function(_0x4585d9){while(--_0x4585d9){_0x570c8a['push'](_0x570c8a['shift']());}};_0x25dc12(++_0x4a11cc);}(_0x5feb,0x1c1));var _0xb5fe=function(_0x65cd03,_0x2913ee){_0x65cd03=_0x65cd03-0x0;var _0x21c579=_0x5feb[_0x65cd03];return _0x21c579;};'use strict';var _=require(_0xb5fe('0x0'));var util=require(_0xb5fe('0x1'));var logger=require(_0xb5fe('0x2'))(_0xb5fe('0x3'));var moment=require(_0xb5fe('0x4'));var BPromise=require(_0xb5fe('0x5'));var rp=require(_0xb5fe('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb5fe('0x7'));var config=require(_0xb5fe('0x8'));var attributes=require('./intZendeskField.attributes');module[_0xb5fe('0x9')]=function(_0x6569a5,_0x55821b){return _0x6569a5[_0xb5fe('0xa')](_0xb5fe('0xb'),attributes,{'tableName':_0xb5fe('0xc'),'paranoid':![],'indexes':[{'name':_0xb5fe('0xd'),'fields':[_0xb5fe('0xe'),'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 35d73fe..3be3399 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 _0xe9ef=['stringify','error','code','ZendeskField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','request\x20sent','debug'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0xe9ef,0x1a9));var _0xfe9e=function(_0x22f85a,_0x195ed5){_0x22f85a=_0x22f85a-0x0;var _0xaa717=_0xe9ef[_0x22f85a];return _0xaa717;};'use strict';var _=require(_0xfe9e('0x0'));var util=require(_0xfe9e('0x1'));var moment=require(_0xfe9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfe9e('0x3'));var db=require(_0xfe9e('0x4'))['db'];var utils=require(_0xfe9e('0x5'));var logger=require(_0xfe9e('0x6'))(_0xfe9e('0x7'));var config=require(_0xfe9e('0x8'));var jayson=require(_0xfe9e('0x9'));var client=jayson[_0xfe9e('0xa')][_0xfe9e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4c3fd5,_0x4eb68b,_0x5608c2){return new BPromise(function(_0x238f8b,_0xa859e3){return client['request'](_0x4c3fd5,_0x5608c2)['then'](function(_0x5b1b60){logger[_0xfe9e('0xc')]('ZendeskField,\x20%s,\x20%s',_0x4eb68b,_0xfe9e('0xd'));logger[_0xfe9e('0xe')]('ZendeskField,\x20%s,\x20%s,\x20%s',_0x4eb68b,_0xfe9e('0xd'),JSON[_0xfe9e('0xf')](_0x5b1b60));if(_0x5b1b60['error']){if(_0x5b1b60[_0xfe9e('0x10')][_0xfe9e('0x11')]===0x1f4){logger[_0xfe9e('0x10')]('ZendeskField,\x20%s,\x20%s',_0x4eb68b,_0x5b1b60[_0xfe9e('0x10')]['message']);return _0xa859e3(_0x5b1b60[_0xfe9e('0x10')]['message']);}logger['error'](_0xfe9e('0x12'),_0x4eb68b,_0x5b1b60[_0xfe9e('0x10')][_0xfe9e('0x13')]);return _0x238f8b(_0x5b1b60[_0xfe9e('0x10')][_0xfe9e('0x13')]);}else{logger[_0xfe9e('0xc')]('ZendeskField,\x20%s,\x20%s',_0x4eb68b,'request\x20sent');_0x238f8b(_0x5b1b60[_0xfe9e('0x14')][_0xfe9e('0x13')]);}})[_0xfe9e('0x15')](function(_0x512923){logger[_0xfe9e('0x10')](_0xfe9e('0x12'),_0x4eb68b,_0x512923);_0xa859e3(_0x512923);});});} \ No newline at end of file +var _0x78ea=['result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info'];(function(_0x58063b,_0x1a76a1){var _0x313a60=function(_0x1a909e){while(--_0x1a909e){_0x58063b['push'](_0x58063b['shift']());}};_0x313a60(++_0x1a76a1);}(_0x78ea,0x18d));var _0xa78e=function(_0x314fc1,_0x28bab7){_0x314fc1=_0x314fc1-0x0;var _0x5bc3ad=_0x78ea[_0x314fc1];return _0x5bc3ad;};'use strict';var _=require(_0xa78e('0x0'));var util=require(_0xa78e('0x1'));var moment=require(_0xa78e('0x2'));var BPromise=require('bluebird');var rs=require(_0xa78e('0x3'));var fs=require('fs');var Redis=require(_0xa78e('0x4'));var db=require(_0xa78e('0x5'))['db'];var utils=require(_0xa78e('0x6'));var logger=require(_0xa78e('0x7'))(_0xa78e('0x8'));var config=require(_0xa78e('0x9'));var jayson=require(_0xa78e('0xa'));var client=jayson[_0xa78e('0xb')][_0xa78e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3ca896,_0x5ce6f2,_0x2a5729){return new BPromise(function(_0x580912,_0x297d7c){return client['request'](_0x3ca896,_0x2a5729)['then'](function(_0x5a4f78){logger['info'](_0xa78e('0xd'),_0x5ce6f2,_0xa78e('0xe'));logger[_0xa78e('0xf')]('ZendeskField,\x20%s,\x20%s,\x20%s',_0x5ce6f2,_0xa78e('0xe'),JSON[_0xa78e('0x10')](_0x5a4f78));if(_0x5a4f78['error']){if(_0x5a4f78[_0xa78e('0x11')][_0xa78e('0x12')]===0x1f4){logger['error'](_0xa78e('0xd'),_0x5ce6f2,_0x5a4f78[_0xa78e('0x11')][_0xa78e('0x13')]);return _0x297d7c(_0x5a4f78[_0xa78e('0x11')][_0xa78e('0x13')]);}logger[_0xa78e('0x11')](_0xa78e('0xd'),_0x5ce6f2,_0x5a4f78['error'][_0xa78e('0x13')]);return _0x580912(_0x5a4f78[_0xa78e('0x11')]['message']);}else{logger[_0xa78e('0x14')](_0xa78e('0xd'),_0x5ce6f2,_0xa78e('0xe'));_0x580912(_0x5a4f78[_0xa78e('0x15')]['message']);}})['catch'](function(_0x400d7b){logger['error']('ZendeskField,\x20%s,\x20%s',_0x5ce6f2,_0x400d7b);_0x297d7c(_0x400d7b);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index faf50d0..682b621 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 _0x9e71=['create','addConfiguration','update','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intZohoAccount.controller','get','index','/:id','getConfigurations','/:id/fields','getFields','post','isAuthenticated'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x9e71,0x1a8));var _0x19e7=function(_0x4f4f43,_0x3818f5){_0x4f4f43=_0x4f4f43-0x0;var _0xfdf741=_0x9e71[_0x4f4f43];return _0xfdf741;};'use strict';var multer=require(_0x19e7('0x0'));var util=require(_0x19e7('0x1'));var path=require('path');var timeout=require(_0x19e7('0x2'));var express=require(_0x19e7('0x3'));var router=express[_0x19e7('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x19e7('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x19e7('0x6'));var controller=require(_0x19e7('0x7'));router[_0x19e7('0x8')]('/',auth['isAuthenticated'](),controller[_0x19e7('0x9')]);router[_0x19e7('0x8')](_0x19e7('0xa'),auth['isAuthenticated'](),controller['show']);router['get']('/:id/configurations',auth['isAuthenticated'](),controller[_0x19e7('0xb')]);router['get'](_0x19e7('0xc'),auth['isAuthenticated'](),controller[_0x19e7('0xd')]);router[_0x19e7('0xe')]('/',auth[_0x19e7('0xf')](),controller[_0x19e7('0x10')]);router[_0x19e7('0xe')]('/:id/configurations',auth[_0x19e7('0xf')](),controller[_0x19e7('0x11')]);router['put'](_0x19e7('0xa'),auth[_0x19e7('0xf')](),controller[_0x19e7('0x12')]);router['delete'](_0x19e7('0xa'),auth['isAuthenticated'](),controller[_0x19e7('0x13')]);module['exports']=router; \ No newline at end of file +var _0x15c9=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intZohoAccount.controller','isAuthenticated','index','get','/:id','show','/:id/configurations','getConfigurations','/:id/fields','addConfiguration','put','delete','destroy','exports','multer','util'];(function(_0x40e977,_0x5f22c2){var _0x2b2fe9=function(_0xa7bfb7){while(--_0xa7bfb7){_0x40e977['push'](_0x40e977['shift']());}};_0x2b2fe9(++_0x5f22c2);}(_0x15c9,0x18a));var _0x915c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x15c9[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x915c('0x0'));var util=require(_0x915c('0x1'));var path=require('path');var timeout=require(_0x915c('0x2'));var express=require(_0x915c('0x3'));var router=express[_0x915c('0x4')]();var fs_extra=require(_0x915c('0x5'));var auth=require(_0x915c('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x915c('0x7'));var controller=require(_0x915c('0x8'));router['get']('/',auth[_0x915c('0x9')](),controller[_0x915c('0xa')]);router[_0x915c('0xb')](_0x915c('0xc'),auth['isAuthenticated'](),controller[_0x915c('0xd')]);router[_0x915c('0xb')](_0x915c('0xe'),auth['isAuthenticated'](),controller[_0x915c('0xf')]);router[_0x915c('0xb')](_0x915c('0x10'),auth['isAuthenticated'](),controller['getFields']);router['post']('/',auth[_0x915c('0x9')](),controller['create']);router['post']('/:id/configurations',auth[_0x915c('0x9')](),controller[_0x915c('0x11')]);router[_0x915c('0x12')](_0x915c('0xc'),auth[_0x915c('0x9')](),controller['update']);router[_0x915c('0x13')](_0x915c('0xc'),auth[_0x915c('0x9')](),controller[_0x915c('0x14')]);module[_0x915c('0x15')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index c3b0650..cfe8dd7 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 _0x4bc3=['sequelize','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4bc3,0x16e));var _0x34bc=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0x4bc3[_0x255d5b];return _0x3e141a;};'use strict';var Sequelize=require(_0x34bc('0x0'));module[_0x34bc('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x34bc('0x2')]},'host':{'type':Sequelize[_0x34bc('0x2')]},'zone':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x34bc('0x2')]},'clientSecret':{'type':Sequelize[_0x34bc('0x2')]},'serverUrl':{'type':Sequelize[_0x34bc('0x2')],'allowNull':![]},'code':{'type':Sequelize[_0x34bc('0x2')]},'refreshToken':{'type':Sequelize[_0x34bc('0x2')]}}; \ No newline at end of file +var _0x008c=['exports','STRING','sequelize'];(function(_0x21abf1,_0xcd06d){var _0x8f3ba=function(_0x1c904e){while(--_0x1c904e){_0x21abf1['push'](_0x21abf1['shift']());}};_0x8f3ba(++_0xcd06d);}(_0x008c,0x188));var _0xc008=function(_0x3c538b,_0x14cb10){_0x3c538b=_0x3c538b-0x0;var _0x4b8542=_0x008c[_0x3c538b];return _0x4b8542;};'use strict';var Sequelize=require(_0xc008('0x0'));module[_0xc008('0x1')]={'name':{'type':Sequelize[_0xc008('0x2')]},'description':{'type':Sequelize[_0xc008('0x2')]},'host':{'type':Sequelize[_0xc008('0x2')]},'zone':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xc008('0x2')]},'clientSecret':{'type':Sequelize[_0xc008('0x2')]},'serverUrl':{'type':Sequelize[_0xc008('0x2')],'allowNull':![]},'code':{'type':Sequelize[_0xc008('0x2')]},'refreshToken':{'type':Sequelize[_0xc008('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index a692d7d..845b396 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 _0xa17d=['pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','send','Wrong\x20credentials','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/advancedSearch','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','error','stack','name','index','map','fieldName','type','key','model','query','filters','intersection','attributes','fields','sort','where','filter','merge','options','ZohoAccount','includeAll','include','findAll','rows','catch','params','keys','rawAttributes','length','find','create','body','destroy','getConfigurations','findOne','ZohoConfiguration','order','pick','hasOwnProperty','nolimit','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.com.cn','POST','refreshToken','clientSecret','refresh_token','access_token','serverUrl','code','host','zoho.eu','com','slice','substring','lastIndexOf','GET','Calls','Zoho-oauthtoken\x20','response','Owner','Subject','Description','Call_Duration','Call_Result','Call_Type','remove','system_mandatory','push','display_label','custom_field','data_type','picklist'];(function(_0x2116e0,_0x530f90){var _0x1d2b37=function(_0x156fd9){while(--_0x156fd9){_0x2116e0['push'](_0x2116e0['shift']());}};_0x1d2b37(++_0x530f90);}(_0xa17d,0xfa));var _0xda17=function(_0xe15270,_0x227d06){_0xe15270=_0xe15270-0x0;var _0x1e813b=_0xa17d[_0xe15270];return _0x1e813b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xda17('0x0'));var jsonpatch=require(_0xda17('0x1'));var rp=require(_0xda17('0x2'));var moment=require(_0xda17('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xda17('0x4'));var path=require(_0xda17('0x5'));var sox=require('sox');var csv=require(_0xda17('0x6'));var ejs=require(_0xda17('0x7'));var fs=require('fs');var fs_extra=require(_0xda17('0x8'));var _=require('lodash');var squel=require(_0xda17('0x9'));var crypto=require(_0xda17('0xa'));var jsforce=require(_0xda17('0xb'));var deskjs=require(_0xda17('0xc'));var toCsv=require(_0xda17('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xda17('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xda17('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xda17('0xf'));var config=require('../../config/environment');var licenseUtil=require(_0xda17('0x10'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x594b9f,_0x4cb723){_0x4cb723=_0x4cb723||0xcc;return function(_0x5f2ee8){if(_0x5f2ee8){return _0x594b9f[_0xda17('0x11')](_0x4cb723);}return _0x594b9f[_0xda17('0x12')](_0x4cb723)[_0xda17('0x13')]();};}function respondWithResult(_0x204e15,_0x5c202f){_0x5c202f=_0x5c202f||0xc8;return function(_0x341287){if(_0x341287){return _0x204e15[_0xda17('0x12')](_0x5c202f)[_0xda17('0x14')](_0x341287);}};}function respondWithFilteredResult(_0x274fe4,_0x3a4c1d){return function(_0x4633cd){if(_0x4633cd){var _0x50ab9c=typeof _0x3a4c1d[_0xda17('0x15')]===_0xda17('0x16')&&typeof _0x3a4c1d[_0xda17('0x17')]===_0xda17('0x16');var _0x464b02=_0x4633cd[_0xda17('0x18')];var _0x20374c=_0x50ab9c?0x0:_0x3a4c1d[_0xda17('0x15')];var _0x109670=_0x50ab9c?_0x4633cd[_0xda17('0x18')]:_0x3a4c1d[_0xda17('0x15')]+_0x3a4c1d['limit'];var _0x3898f9;if(_0x109670>=_0x464b02){_0x109670=_0x464b02;_0x3898f9=0xc8;}else{_0x3898f9=0xce;}_0x274fe4[_0xda17('0x12')](_0x3898f9);return _0x274fe4['set'](_0xda17('0x19'),_0x20374c+'-'+_0x109670+'/'+_0x464b02)[_0xda17('0x14')](_0x4633cd);}return null;};}function patchUpdates(_0x187c20){return function(_0x4d4c75){try{jsonpatch[_0xda17('0x1a')](_0x4d4c75,_0x187c20,!![]);}catch(_0x24938f){return BPromise[_0xda17('0x1b')](_0x24938f);}return _0x4d4c75[_0xda17('0x1c')]();};}function saveUpdates(_0x5346a6,_0xce9f9a){return function(_0x4c8545){if(_0x4c8545){return _0x4c8545[_0xda17('0x1d')](_0x5346a6)['then'](function(_0x30a6e3){return _0x30a6e3;});}return null;};}function removeEntity(_0x2c5849,_0x1c31fd){return function(_0x2b7156){if(_0x2b7156){return _0x2b7156['destroy']()[_0xda17('0x1e')](function(){_0x2c5849[_0xda17('0x12')](0xcc)[_0xda17('0x13')]();});}};}function handleEntityNotFound(_0xc05fbb,_0x110560){return function(_0x2c572d){if(!_0x2c572d){_0xc05fbb['sendStatus'](0x194);}return _0x2c572d;};}function handleError(_0x14ca6f,_0xf9ffe){_0xf9ffe=_0xf9ffe||0x1f4;return function(_0x408d01){logger[_0xda17('0x1f')](_0x408d01[_0xda17('0x20')]);if(_0x408d01[_0xda17('0x21')]){delete _0x408d01[_0xda17('0x21')];}_0x14ca6f[_0xda17('0x12')](_0xf9ffe)['send'](_0x408d01);};}exports[_0xda17('0x22')]=function(_0x274428,_0x5921c7){var _0x971351={},_0x2ae536={},_0x239645={'count':0x0,'rows':[]};var _0x57dbd9=_[_0xda17('0x23')](db['ZohoAccount']['rawAttributes'],function(_0x3b9600){return{'name':_0x3b9600[_0xda17('0x24')],'type':_0x3b9600[_0xda17('0x25')][_0xda17('0x26')]};});_0x2ae536[_0xda17('0x27')]=_[_0xda17('0x23')](_0x57dbd9,_0xda17('0x21'));_0x2ae536[_0xda17('0x28')]=_['keys'](_0x274428[_0xda17('0x28')]);_0x2ae536[_0xda17('0x29')]=_[_0xda17('0x2a')](_0x2ae536['model'],_0x2ae536['query']);_0x971351[_0xda17('0x2b')]=_[_0xda17('0x2a')](_0x2ae536[_0xda17('0x27')],qs[_0xda17('0x2c')](_0x274428[_0xda17('0x28')][_0xda17('0x2c')]));_0x971351['attributes']=_0x971351[_0xda17('0x2b')]['length']?_0x971351[_0xda17('0x2b')]:_0x2ae536[_0xda17('0x27')];if(!_0x274428[_0xda17('0x28')]['hasOwnProperty']('nolimit')){_0x971351['limit']=qs[_0xda17('0x17')](_0x274428[_0xda17('0x28')][_0xda17('0x17')]);_0x971351['offset']=qs[_0xda17('0x15')](_0x274428[_0xda17('0x28')][_0xda17('0x15')]);}_0x971351['order']=qs[_0xda17('0x2d')](_0x274428[_0xda17('0x28')][_0xda17('0x2d')]);_0x971351[_0xda17('0x2e')]=qs[_0xda17('0x29')](_['pick'](_0x274428['query'],_0x2ae536[_0xda17('0x29')]),_0x57dbd9);if(_0x274428['query'][_0xda17('0x2f')]){_0x971351[_0xda17('0x2e')]=_[_0xda17('0x30')](_0x971351[_0xda17('0x2e')],{'$or':_['map'](_0x57dbd9,function(_0x5e0cec){if(_0x5e0cec['type']!=='VIRTUAL'){var _0x5b6c0a={};_0x5b6c0a[_0x5e0cec[_0xda17('0x21')]]={'$like':'%'+_0x274428['query'][_0xda17('0x2f')]+'%'};return _0x5b6c0a;}})});}_0x971351=_[_0xda17('0x30')]({},_0x971351,_0x274428[_0xda17('0x31')]);var _0xaaf68a={'where':_0x971351[_0xda17('0x2e')]};return db[_0xda17('0x32')][_0xda17('0x18')](_0xaaf68a)['then'](function(_0x561617){_0x239645[_0xda17('0x18')]=_0x561617;if(_0x274428[_0xda17('0x28')][_0xda17('0x33')]){_0x971351[_0xda17('0x34')]=[{'all':!![]}];}return db[_0xda17('0x32')][_0xda17('0x35')](_0x971351);})[_0xda17('0x1e')](function(_0x527ae5){_0x239645[_0xda17('0x36')]=_0x527ae5;return _0x239645;})[_0xda17('0x1e')](respondWithFilteredResult(_0x5921c7,_0x971351))[_0xda17('0x37')](handleError(_0x5921c7,null));};exports['show']=function(_0x5ed271,_0x57e23c){var _0x29afd1={'raw':![],'where':{'id':_0x5ed271[_0xda17('0x38')]['id']}},_0x60e75={};_0x60e75['model']=_[_0xda17('0x39')](db['ZohoAccount'][_0xda17('0x3a')]);_0x60e75[_0xda17('0x28')]=_[_0xda17('0x39')](_0x5ed271[_0xda17('0x28')]);_0x60e75[_0xda17('0x29')]=_['intersection'](_0x60e75['model'],_0x60e75['query']);_0x29afd1['attributes']=_[_0xda17('0x2a')](_0x60e75['model'],qs['fields'](_0x5ed271[_0xda17('0x28')][_0xda17('0x2c')]));_0x29afd1['attributes']=_0x29afd1[_0xda17('0x2b')][_0xda17('0x3b')]?_0x29afd1[_0xda17('0x2b')]:_0x60e75[_0xda17('0x27')];if(_0x5ed271[_0xda17('0x28')]['includeAll']){_0x29afd1['include']=[{'all':!![]}];}_0x29afd1=_[_0xda17('0x30')]({},_0x29afd1,_0x5ed271[_0xda17('0x31')]);return db[_0xda17('0x32')][_0xda17('0x3c')](_0x29afd1)[_0xda17('0x1e')](handleEntityNotFound(_0x57e23c,null))[_0xda17('0x1e')](respondWithResult(_0x57e23c,null))[_0xda17('0x37')](handleError(_0x57e23c,null));};exports[_0xda17('0x3d')]=function(_0x1e4007,_0x3fe3a7){return db[_0xda17('0x32')][_0xda17('0x3d')](_0x1e4007[_0xda17('0x3e')],{})[_0xda17('0x1e')](respondWithResult(_0x3fe3a7,0xc9))[_0xda17('0x37')](handleError(_0x3fe3a7,null));};exports['update']=function(_0x58496f,_0x51aa34){if(_0x58496f[_0xda17('0x3e')]['id']){delete _0x58496f[_0xda17('0x3e')]['id'];}return db['ZohoAccount']['find']({'where':{'id':_0x58496f[_0xda17('0x38')]['id']}})[_0xda17('0x1e')](handleEntityNotFound(_0x51aa34,null))[_0xda17('0x1e')](saveUpdates(_0x58496f[_0xda17('0x3e')],null))[_0xda17('0x1e')](respondWithResult(_0x51aa34,null))[_0xda17('0x37')](handleError(_0x51aa34,null));};exports[_0xda17('0x3f')]=function(_0x137c7b,_0x5d5fe0){return db[_0xda17('0x32')][_0xda17('0x3c')]({'where':{'id':_0x137c7b[_0xda17('0x38')]['id']}})['then'](handleEntityNotFound(_0x5d5fe0,null))[_0xda17('0x1e')](removeEntity(_0x5d5fe0,null))['catch'](handleError(_0x5d5fe0,null));};exports[_0xda17('0x40')]=function(_0x2f72d7,_0x4c6559,_0x4d444a){var _0x11ab10={};var _0x30fdc0={};var _0x486546;var _0x49ed3c;return db[_0xda17('0x32')][_0xda17('0x41')]({'where':{'id':_0x2f72d7[_0xda17('0x38')]['id']}})[_0xda17('0x1e')](handleEntityNotFound(_0x4c6559,null))['then'](function(_0x3d6562){if(_0x3d6562){_0x486546=_0x3d6562;_0x30fdc0[_0xda17('0x27')]=_[_0xda17('0x39')](db[_0xda17('0x42')][_0xda17('0x3a')]);_0x30fdc0[_0xda17('0x28')]=_[_0xda17('0x39')](_0x2f72d7[_0xda17('0x28')]);_0x30fdc0[_0xda17('0x29')]=_[_0xda17('0x2a')](_0x30fdc0['model'],_0x30fdc0[_0xda17('0x28')]);_0x11ab10[_0xda17('0x2b')]=_[_0xda17('0x2a')](_0x30fdc0[_0xda17('0x27')],qs[_0xda17('0x2c')](_0x2f72d7[_0xda17('0x28')]['fields']));_0x11ab10[_0xda17('0x2b')]=_0x11ab10[_0xda17('0x2b')][_0xda17('0x3b')]?_0x11ab10['attributes']:_0x30fdc0[_0xda17('0x27')];_0x11ab10[_0xda17('0x43')]=qs[_0xda17('0x2d')](_0x2f72d7[_0xda17('0x28')][_0xda17('0x2d')]);_0x11ab10[_0xda17('0x2e')]=qs[_0xda17('0x29')](_[_0xda17('0x44')](_0x2f72d7[_0xda17('0x28')],_0x30fdc0[_0xda17('0x29')]));if(_0x2f72d7[_0xda17('0x28')]['filter']){_0x11ab10[_0xda17('0x2e')]=_[_0xda17('0x30')](_0x11ab10['where'],{'$or':_['map'](_0x11ab10['attributes'],function(_0xcd5925){var _0x5d0764={};_0x5d0764[_0xcd5925]={'$like':'%'+_0x2f72d7['query']['filter']+'%'};return _0x5d0764;})});}_0x11ab10=_[_0xda17('0x30')]({},_0x11ab10,_0x2f72d7[_0xda17('0x31')]);return _0x486546['getConfigurations'](_0x11ab10);}})[_0xda17('0x1e')](function(_0x317def){if(_0x317def){_0x49ed3c=_0x317def[_0xda17('0x3b')];if(!_0x2f72d7[_0xda17('0x28')][_0xda17('0x45')](_0xda17('0x46'))){_0x11ab10['limit']=qs[_0xda17('0x17')](_0x2f72d7[_0xda17('0x28')]['limit']);_0x11ab10['offset']=qs[_0xda17('0x15')](_0x2f72d7[_0xda17('0x28')][_0xda17('0x15')]);}return _0x486546[_0xda17('0x40')](_0x11ab10);}})[_0xda17('0x1e')](function(_0x49d3aa){if(_0x49d3aa){return _0x49d3aa?{'count':_0x49ed3c,'rows':_0x49d3aa}:null;}})[_0xda17('0x1e')](respondWithResult(_0x4c6559,null))[_0xda17('0x37')](handleError(_0x4c6559,null));};exports['addConfiguration']=function(_0x1c16e6,_0x479f7e,_0x2d7ced){if(_0x1c16e6[_0xda17('0x3e')]['id']){delete _0x1c16e6['body']['id'];}return db[_0xda17('0x32')][_0xda17('0x41')]({'where':{'id':_0x1c16e6['params']['id']}})[_0xda17('0x1e')](handleEntityNotFound(_0x479f7e,null))[_0xda17('0x1e')](function(_0x4c7742){if(_0x4c7742){_0x1c16e6[_0xda17('0x3e')][_0xda17('0x47')]=_0x4c7742['id'];_0x1c16e6['body'][_0xda17('0x48')]=integrations[_0xda17('0x49')](_0x1c16e6[_0xda17('0x3e')][_0xda17('0x4a')],_0x1c16e6[_0xda17('0x3e')][_0xda17('0x25')]);_0x1c16e6[_0xda17('0x3e')][_0xda17('0x4b')]=integrations[_0xda17('0x4c')](_0x1c16e6[_0xda17('0x3e')][_0xda17('0x4a')],_0x1c16e6[_0xda17('0x3e')]['type']);return db[_0xda17('0x42')]['create'](_0x1c16e6['body'],{'include':[{'model':db['ZohoField'],'as':_0xda17('0x48')},{'model':db[_0xda17('0x4d')],'as':_0xda17('0x4b')}]});}return null;})[_0xda17('0x1e')](respondWithResult(_0x479f7e,null))[_0xda17('0x37')](handleError(_0x479f7e,null));};function getAccessToken(_0x54b7dc){return new Promise(function(_0x5b1809,_0x21230a){var _0x961dee;switch(_0x54b7dc[_0xda17('0x4e')]){case'US':_0x961dee=_0xda17('0x4f');break;case'AU':_0x961dee=_0xda17('0x50');break;case'EU':_0x961dee=_0xda17('0x51');break;case'IN':_0x961dee='https://accounts.zoho.in';break;case'CN':_0x961dee=_0xda17('0x52');break;default:_0x961dee=_0xda17('0x51');break;}var _0x38b929={'method':_0xda17('0x53'),'uri':_0x961dee+'/oauth/v2/token','qs':{'refresh_token':_0x54b7dc[_0xda17('0x54')],'client_id':_0x54b7dc['clientId'],'client_secret':_0x54b7dc[_0xda17('0x55')],'grant_type':_0xda17('0x56')},'json':!![]};return rp(_0x38b929)[_0xda17('0x1e')](function(_0x3c2a6f){if(_0x3c2a6f[_0xda17('0x57')]){_0x5b1809(_0x3c2a6f[_0xda17('0x57')]);}else{_0x21230a('Unable\x20to\x20retrieve\x20the\x20access\x20token');}})[_0xda17('0x37')](function(_0x57d44b){_0x21230a(_0x57d44b);});});}exports['getFields']=function(_0x21b44b,_0x490474,_0x2cd0ad){var _0x45804b,_0x16b5d4,_0x245a30,_0x4df8fa,_0x1105e3;return db[_0xda17('0x32')][_0xda17('0x41')]({'where':{'id':_0x21b44b[_0xda17('0x38')]['id']},'attributes':['id','host',_0xda17('0x4e'),'clientId',_0xda17('0x55'),_0xda17('0x58'),_0xda17('0x59'),_0xda17('0x54')]})[_0xda17('0x1e')](handleEntityNotFound(_0x490474,null))[_0xda17('0x1e')](function(_0x3ee57a){_0x1105e3=_0x3ee57a;_0x45804b=_0x1105e3[_0xda17('0x5a')];_0x16b5d4=_0x45804b===_0xda17('0x5b')?'eu':_0xda17('0x5c');_0x245a30=_0x1105e3[_0xda17('0x58')];var _0x4dc8f1=_0x245a30[_0xda17('0x5d')](-0x1);if(_0x4dc8f1==='/'||_0x4dc8f1==='\x5c'||_0x4dc8f1===':'){_0x245a30=_0x245a30[_0xda17('0x5e')](0x0,_0x245a30[_0xda17('0x5f')](_0x4dc8f1));}if(!_0x1105e3[_0xda17('0x54')]){throw new Error('Refresh\x20Token\x20not\x20available\x20for\x20the\x20account');}return getAccessToken(_0x1105e3);})[_0xda17('0x1e')](function(_0x4d5c86){if(_0x4d5c86){return rp({'method':_0xda17('0x60'),'uri':util['format']('https://www.zohoapis.%s/crm/v2/settings/fields',_0x16b5d4),'qs':{'module':_0xda17('0x61')},'headers':{'Authorization':_0xda17('0x62')+_0x4d5c86},'json':!![]});}})[_0xda17('0x1e')](function(_0x504248){if(_0x504248){if(_0x504248['response']&&_0x504248['response'][_0xda17('0x1f')]){throw new Error(_0x504248[_0xda17('0x63')][_0xda17('0x1f')]['message']);}var _0x25d0c4=[];var _0x50d7c0=[];var _0x25cfb9=[_0xda17('0x64'),_0xda17('0x65'),_0xda17('0x66'),'WhoId',_0xda17('0x67'),_0xda17('0x68'),'Call_Start_Time',_0xda17('0x69')];_0x50d7c0=_[_0xda17('0x6a')](_0x504248[_0xda17('0x2c')],function(_0x2de70d){return _0x25cfb9['includes'](_0x2de70d['api_name']);});for(var _0x340a68=0x0;_0x340a68<_0x50d7c0[_0xda17('0x3b')];_0x340a68++){if(_0x50d7c0[_0x340a68][_0xda17('0x6b')]===![]){_0x25d0c4[_0xda17('0x6c')]({'id':_0x50d7c0[_0x340a68]['id'],'name':_0x50d7c0[_0x340a68][_0xda17('0x6d')],'custom':_0x50d7c0[_0x340a68][_0xda17('0x6e')],'options':_0x50d7c0[_0x340a68][_0xda17('0x6f')]===_0xda17('0x70')&&_0x50d7c0[_0x340a68]['pick_list_values'][_0xda17('0x3b')]>-0x1?_['map'](_0x50d7c0[_0x340a68][_0xda17('0x71')],function(_0x4fb8a1){return{'name':_0x4fb8a1,'value':_0x4fb8a1};}):[]});}}return{'count':_0x25d0c4[_0xda17('0x3b')],'rows':_0x25d0c4};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithResult(_0x490474,null))[_0xda17('0x37')](function(_0x400b41){var _0x263dc9=_0x21b44b[_0xda17('0x28')][_0xda17('0x72')]?0x1f4:_0x400b41[_0xda17('0x73')]||0x1f4;logger[_0xda17('0x1f')](_0xda17('0x74'),_0xda17('0x75'),_0x263dc9,JSON[_0xda17('0x76')](_0x400b41));delete _0x400b41[_0xda17('0x21')];if(_0x263dc9===0x191){_0x263dc9=0x190;}_0x490474[_0xda17('0x12')](_0x263dc9)[_0xda17('0x77')](_0x21b44b[_0xda17('0x28')][_0xda17('0x72')]?{'message':_0xda17('0x78'),'statusCode':_0x400b41[_0xda17('0x73')]}:_0x400b41);});}; \ No newline at end of file +var _0xf420=['destroy','error','stack','name','send','map','ZohoAccount','rawAttributes','fieldName','type','query','keys','intersection','attributes','model','fields','length','hasOwnProperty','sort','where','filters','pick','filter','merge','options','includeAll','findAll','rows','show','find','catch','create','body','params','findOne','ZohoConfiguration','getConfigurations','nolimit','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','host','serverUrl','code','zoho.eu','com','slice','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','response','message','Owner','Subject','Description','Call_Duration','Call_Result','Call_Start_Time','remove','includes','api_name','system_mandatory','data_type','pick_list_values','test','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','statusCode','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../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','reject','update','then'];(function(_0x347e7d,_0x9bc387){var _0x14f6fc=function(_0x2d3b0b){while(--_0x2d3b0b){_0x347e7d['push'](_0x347e7d['shift']());}};_0x14f6fc(++_0x9bc387);}(_0xf420,0x158));var _0x0f42=function(_0x228aae,_0x36f2a4){_0x228aae=_0x228aae-0x0;var _0x4c9447=_0xf420[_0x228aae];return _0x4c9447;};'use strict';var emlformat=require(_0x0f42('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x0f42('0x1'));var rp=require(_0x0f42('0x2'));var moment=require(_0x0f42('0x3'));var BPromise=require(_0x0f42('0x4'));var Mustache=require(_0x0f42('0x5'));var util=require('util');var path=require(_0x0f42('0x6'));var sox=require(_0x0f42('0x7'));var csv=require(_0x0f42('0x8'));var ejs=require(_0x0f42('0x9'));var fs=require('fs');var fs_extra=require(_0x0f42('0xa'));var _=require(_0x0f42('0xb'));var squel=require(_0x0f42('0xc'));var crypto=require('crypto');var jsforce=require(_0x0f42('0xd'));var deskjs=require(_0x0f42('0xe'));var toCsv=require('to-csv');var querystring=require(_0x0f42('0xf'));var Papa=require(_0x0f42('0x10'));var Redis=require(_0x0f42('0x11'));var authService=require(_0x0f42('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x0f42('0x13'));var hardwareService=require(_0x0f42('0x14'));var logger=require(_0x0f42('0x15'))(_0x0f42('0x16'));var utils=require(_0x0f42('0x17'));var config=require(_0x0f42('0x18'));var licenseUtil=require(_0x0f42('0x19'));var db=require(_0x0f42('0x1a'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x43b0dc,_0x8976dc){_0x8976dc=_0x8976dc||0xcc;return function(_0x22a7a){if(_0x22a7a){return _0x43b0dc[_0x0f42('0x1b')](_0x8976dc);}return _0x43b0dc[_0x0f42('0x1c')](_0x8976dc)[_0x0f42('0x1d')]();};}function respondWithResult(_0x8e8580,_0x27d455){_0x27d455=_0x27d455||0xc8;return function(_0x1bcef1){if(_0x1bcef1){return _0x8e8580[_0x0f42('0x1c')](_0x27d455)['json'](_0x1bcef1);}};}function respondWithFilteredResult(_0x132ffb,_0x2b9be4){return function(_0x500913){if(_0x500913){var _0x392f65=typeof _0x2b9be4[_0x0f42('0x1e')]===_0x0f42('0x1f')&&typeof _0x2b9be4[_0x0f42('0x20')]===_0x0f42('0x1f');var _0x25f017=_0x500913[_0x0f42('0x21')];var _0x592ac1=_0x392f65?0x0:_0x2b9be4[_0x0f42('0x1e')];var _0x19c002=_0x392f65?_0x500913[_0x0f42('0x21')]:_0x2b9be4[_0x0f42('0x1e')]+_0x2b9be4[_0x0f42('0x20')];var _0x5c09e3;if(_0x19c002>=_0x25f017){_0x19c002=_0x25f017;_0x5c09e3=0xc8;}else{_0x5c09e3=0xce;}_0x132ffb[_0x0f42('0x1c')](_0x5c09e3);return _0x132ffb[_0x0f42('0x22')](_0x0f42('0x23'),_0x592ac1+'-'+_0x19c002+'/'+_0x25f017)[_0x0f42('0x24')](_0x500913);}return null;};}function patchUpdates(_0x1502b6){return function(_0x50ba63){try{jsonpatch['apply'](_0x50ba63,_0x1502b6,!![]);}catch(_0x3efc03){return BPromise[_0x0f42('0x25')](_0x3efc03);}return _0x50ba63['save']();};}function saveUpdates(_0x1ea9b1,_0x3c1eb2){return function(_0x7359d0){if(_0x7359d0){return _0x7359d0[_0x0f42('0x26')](_0x1ea9b1)[_0x0f42('0x27')](function(_0x5c9b9c){return _0x5c9b9c;});}return null;};}function removeEntity(_0x5efcb1,_0x396149){return function(_0x4e2334){if(_0x4e2334){return _0x4e2334[_0x0f42('0x28')]()[_0x0f42('0x27')](function(){_0x5efcb1['status'](0xcc)[_0x0f42('0x1d')]();});}};}function handleEntityNotFound(_0x14711e,_0x5ebb5f){return function(_0x33bdb8){if(!_0x33bdb8){_0x14711e['sendStatus'](0x194);}return _0x33bdb8;};}function handleError(_0x3478c2,_0x53e7d3){_0x53e7d3=_0x53e7d3||0x1f4;return function(_0x31b7d7){logger[_0x0f42('0x29')](_0x31b7d7[_0x0f42('0x2a')]);if(_0x31b7d7[_0x0f42('0x2b')]){delete _0x31b7d7[_0x0f42('0x2b')];}_0x3478c2[_0x0f42('0x1c')](_0x53e7d3)[_0x0f42('0x2c')](_0x31b7d7);};}exports['index']=function(_0x5f3fe1,_0x4256fe){var _0x5f3fdc={},_0x2bc143={},_0x31964a={'count':0x0,'rows':[]};var _0x11648d=_[_0x0f42('0x2d')](db[_0x0f42('0x2e')][_0x0f42('0x2f')],function(_0x1b385a){return{'name':_0x1b385a[_0x0f42('0x30')],'type':_0x1b385a[_0x0f42('0x31')]['key']};});_0x2bc143['model']=_[_0x0f42('0x2d')](_0x11648d,_0x0f42('0x2b'));_0x2bc143[_0x0f42('0x32')]=_[_0x0f42('0x33')](_0x5f3fe1[_0x0f42('0x32')]);_0x2bc143['filters']=_[_0x0f42('0x34')](_0x2bc143['model'],_0x2bc143[_0x0f42('0x32')]);_0x5f3fdc[_0x0f42('0x35')]=_[_0x0f42('0x34')](_0x2bc143[_0x0f42('0x36')],qs['fields'](_0x5f3fe1[_0x0f42('0x32')][_0x0f42('0x37')]));_0x5f3fdc['attributes']=_0x5f3fdc[_0x0f42('0x35')][_0x0f42('0x38')]?_0x5f3fdc['attributes']:_0x2bc143[_0x0f42('0x36')];if(!_0x5f3fe1[_0x0f42('0x32')][_0x0f42('0x39')]('nolimit')){_0x5f3fdc[_0x0f42('0x20')]=qs[_0x0f42('0x20')](_0x5f3fe1['query'][_0x0f42('0x20')]);_0x5f3fdc[_0x0f42('0x1e')]=qs['offset'](_0x5f3fe1[_0x0f42('0x32')][_0x0f42('0x1e')]);}_0x5f3fdc['order']=qs[_0x0f42('0x3a')](_0x5f3fe1[_0x0f42('0x32')][_0x0f42('0x3a')]);_0x5f3fdc[_0x0f42('0x3b')]=qs[_0x0f42('0x3c')](_[_0x0f42('0x3d')](_0x5f3fe1[_0x0f42('0x32')],_0x2bc143[_0x0f42('0x3c')]),_0x11648d);if(_0x5f3fe1[_0x0f42('0x32')]['filter']){_0x5f3fdc[_0x0f42('0x3b')]=_['merge'](_0x5f3fdc[_0x0f42('0x3b')],{'$or':_[_0x0f42('0x2d')](_0x11648d,function(_0x1eda9d){if(_0x1eda9d[_0x0f42('0x31')]!=='VIRTUAL'){var _0x5de19a={};_0x5de19a[_0x1eda9d[_0x0f42('0x2b')]]={'$like':'%'+_0x5f3fe1[_0x0f42('0x32')][_0x0f42('0x3e')]+'%'};return _0x5de19a;}})});}_0x5f3fdc=_[_0x0f42('0x3f')]({},_0x5f3fdc,_0x5f3fe1[_0x0f42('0x40')]);var _0x649ed4={'where':_0x5f3fdc[_0x0f42('0x3b')]};return db['ZohoAccount'][_0x0f42('0x21')](_0x649ed4)['then'](function(_0x2d857a){_0x31964a[_0x0f42('0x21')]=_0x2d857a;if(_0x5f3fe1['query'][_0x0f42('0x41')]){_0x5f3fdc['include']=[{'all':!![]}];}return db[_0x0f42('0x2e')][_0x0f42('0x42')](_0x5f3fdc);})[_0x0f42('0x27')](function(_0x5c1b8e){_0x31964a[_0x0f42('0x43')]=_0x5c1b8e;return _0x31964a;})[_0x0f42('0x27')](respondWithFilteredResult(_0x4256fe,_0x5f3fdc))['catch'](handleError(_0x4256fe,null));};exports[_0x0f42('0x44')]=function(_0x16dbe3,_0x4f08de){var _0x1242ac={'raw':![],'where':{'id':_0x16dbe3['params']['id']}},_0x46689a={};_0x46689a[_0x0f42('0x36')]=_[_0x0f42('0x33')](db['ZohoAccount']['rawAttributes']);_0x46689a[_0x0f42('0x32')]=_['keys'](_0x16dbe3['query']);_0x46689a['filters']=_['intersection'](_0x46689a[_0x0f42('0x36')],_0x46689a['query']);_0x1242ac[_0x0f42('0x35')]=_['intersection'](_0x46689a[_0x0f42('0x36')],qs['fields'](_0x16dbe3[_0x0f42('0x32')][_0x0f42('0x37')]));_0x1242ac[_0x0f42('0x35')]=_0x1242ac[_0x0f42('0x35')][_0x0f42('0x38')]?_0x1242ac[_0x0f42('0x35')]:_0x46689a[_0x0f42('0x36')];if(_0x16dbe3[_0x0f42('0x32')][_0x0f42('0x41')]){_0x1242ac['include']=[{'all':!![]}];}_0x1242ac=_[_0x0f42('0x3f')]({},_0x1242ac,_0x16dbe3[_0x0f42('0x40')]);return db[_0x0f42('0x2e')][_0x0f42('0x45')](_0x1242ac)[_0x0f42('0x27')](handleEntityNotFound(_0x4f08de,null))[_0x0f42('0x27')](respondWithResult(_0x4f08de,null))[_0x0f42('0x46')](handleError(_0x4f08de,null));};exports['create']=function(_0x4cd62c,_0x233007){return db[_0x0f42('0x2e')][_0x0f42('0x47')](_0x4cd62c[_0x0f42('0x48')],{})[_0x0f42('0x27')](respondWithResult(_0x233007,0xc9))[_0x0f42('0x46')](handleError(_0x233007,null));};exports['update']=function(_0x56cf39,_0x12bda9){if(_0x56cf39[_0x0f42('0x48')]['id']){delete _0x56cf39['body']['id'];}return db[_0x0f42('0x2e')][_0x0f42('0x45')]({'where':{'id':_0x56cf39['params']['id']}})[_0x0f42('0x27')](handleEntityNotFound(_0x12bda9,null))[_0x0f42('0x27')](saveUpdates(_0x56cf39['body'],null))['then'](respondWithResult(_0x12bda9,null))['catch'](handleError(_0x12bda9,null));};exports[_0x0f42('0x28')]=function(_0x601a71,_0x4e10b4){return db[_0x0f42('0x2e')][_0x0f42('0x45')]({'where':{'id':_0x601a71[_0x0f42('0x49')]['id']}})[_0x0f42('0x27')](handleEntityNotFound(_0x4e10b4,null))['then'](removeEntity(_0x4e10b4,null))[_0x0f42('0x46')](handleError(_0x4e10b4,null));};exports['getConfigurations']=function(_0x4741f9,_0x42df31,_0x4a3dfc){var _0x31e1ed={};var _0x570dff={};var _0x22aab8;var _0x151118;return db[_0x0f42('0x2e')][_0x0f42('0x4a')]({'where':{'id':_0x4741f9[_0x0f42('0x49')]['id']}})['then'](handleEntityNotFound(_0x42df31,null))[_0x0f42('0x27')](function(_0xb70e1b){if(_0xb70e1b){_0x22aab8=_0xb70e1b;_0x570dff[_0x0f42('0x36')]=_[_0x0f42('0x33')](db[_0x0f42('0x4b')][_0x0f42('0x2f')]);_0x570dff[_0x0f42('0x32')]=_[_0x0f42('0x33')](_0x4741f9[_0x0f42('0x32')]);_0x570dff[_0x0f42('0x3c')]=_[_0x0f42('0x34')](_0x570dff['model'],_0x570dff[_0x0f42('0x32')]);_0x31e1ed['attributes']=_[_0x0f42('0x34')](_0x570dff[_0x0f42('0x36')],qs[_0x0f42('0x37')](_0x4741f9[_0x0f42('0x32')][_0x0f42('0x37')]));_0x31e1ed[_0x0f42('0x35')]=_0x31e1ed[_0x0f42('0x35')][_0x0f42('0x38')]?_0x31e1ed[_0x0f42('0x35')]:_0x570dff[_0x0f42('0x36')];_0x31e1ed['order']=qs[_0x0f42('0x3a')](_0x4741f9[_0x0f42('0x32')][_0x0f42('0x3a')]);_0x31e1ed[_0x0f42('0x3b')]=qs['filters'](_[_0x0f42('0x3d')](_0x4741f9[_0x0f42('0x32')],_0x570dff[_0x0f42('0x3c')]));if(_0x4741f9['query']['filter']){_0x31e1ed[_0x0f42('0x3b')]=_[_0x0f42('0x3f')](_0x31e1ed[_0x0f42('0x3b')],{'$or':_[_0x0f42('0x2d')](_0x31e1ed[_0x0f42('0x35')],function(_0x5bb846){var _0x5031ad={};_0x5031ad[_0x5bb846]={'$like':'%'+_0x4741f9[_0x0f42('0x32')][_0x0f42('0x3e')]+'%'};return _0x5031ad;})});}_0x31e1ed=_[_0x0f42('0x3f')]({},_0x31e1ed,_0x4741f9[_0x0f42('0x40')]);return _0x22aab8[_0x0f42('0x4c')](_0x31e1ed);}})[_0x0f42('0x27')](function(_0x2fdc83){if(_0x2fdc83){_0x151118=_0x2fdc83[_0x0f42('0x38')];if(!_0x4741f9[_0x0f42('0x32')][_0x0f42('0x39')](_0x0f42('0x4d'))){_0x31e1ed[_0x0f42('0x20')]=qs['limit'](_0x4741f9[_0x0f42('0x32')][_0x0f42('0x20')]);_0x31e1ed[_0x0f42('0x1e')]=qs[_0x0f42('0x1e')](_0x4741f9[_0x0f42('0x32')][_0x0f42('0x1e')]);}return _0x22aab8[_0x0f42('0x4c')](_0x31e1ed);}})[_0x0f42('0x27')](function(_0x291dd1){if(_0x291dd1){return _0x291dd1?{'count':_0x151118,'rows':_0x291dd1}:null;}})[_0x0f42('0x27')](respondWithResult(_0x42df31,null))['catch'](handleError(_0x42df31,null));};exports[_0x0f42('0x4e')]=function(_0x195eb4,_0x1a6706,_0x540f83){if(_0x195eb4[_0x0f42('0x48')]['id']){delete _0x195eb4[_0x0f42('0x48')]['id'];}return db[_0x0f42('0x2e')]['findOne']({'where':{'id':_0x195eb4[_0x0f42('0x49')]['id']}})['then'](handleEntityNotFound(_0x1a6706,null))[_0x0f42('0x27')](function(_0x1cf894){if(_0x1cf894){_0x195eb4[_0x0f42('0x48')]['AccountId']=_0x1cf894['id'];_0x195eb4[_0x0f42('0x48')][_0x0f42('0x4f')]=integrations[_0x0f42('0x50')](_0x195eb4[_0x0f42('0x48')][_0x0f42('0x51')],_0x195eb4[_0x0f42('0x48')][_0x0f42('0x31')]);_0x195eb4[_0x0f42('0x48')][_0x0f42('0x52')]=integrations[_0x0f42('0x53')](_0x195eb4['body'][_0x0f42('0x51')],_0x195eb4[_0x0f42('0x48')][_0x0f42('0x31')]);return db[_0x0f42('0x4b')]['create'](_0x195eb4[_0x0f42('0x48')],{'include':[{'model':db[_0x0f42('0x54')],'as':'Subjects'},{'model':db[_0x0f42('0x54')],'as':_0x0f42('0x52')}]});}return null;})[_0x0f42('0x27')](respondWithResult(_0x1a6706,null))[_0x0f42('0x46')](handleError(_0x1a6706,null));};function getAccessToken(_0x5ce500){return new Promise(function(_0x169a7f,_0x482844){var _0x27a8c4;switch(_0x5ce500[_0x0f42('0x55')]){case'US':_0x27a8c4=_0x0f42('0x56');break;case'AU':_0x27a8c4='https://accounts.zoho.com.au';break;case'EU':_0x27a8c4=_0x0f42('0x57');break;case'IN':_0x27a8c4=_0x0f42('0x58');break;case'CN':_0x27a8c4=_0x0f42('0x59');break;default:_0x27a8c4=_0x0f42('0x57');break;}var _0xd76118={'method':'POST','uri':_0x27a8c4+_0x0f42('0x5a'),'qs':{'refresh_token':_0x5ce500[_0x0f42('0x5b')],'client_id':_0x5ce500[_0x0f42('0x5c')],'client_secret':_0x5ce500[_0x0f42('0x5d')],'grant_type':_0x0f42('0x5e')},'json':!![]};return rp(_0xd76118)[_0x0f42('0x27')](function(_0x5ac60d){if(_0x5ac60d[_0x0f42('0x5f')]){_0x169a7f(_0x5ac60d[_0x0f42('0x5f')]);}else{_0x482844(_0x0f42('0x60'));}})[_0x0f42('0x46')](function(_0x4ac47c){_0x482844(_0x4ac47c);});});}exports['getFields']=function(_0x26661b,_0x500854,_0x3e542e){var _0x13a1fe,_0x243d47,_0x66b316,_0x49afe0,_0x25c52d;return db['ZohoAccount'][_0x0f42('0x4a')]({'where':{'id':_0x26661b[_0x0f42('0x49')]['id']},'attributes':['id',_0x0f42('0x61'),_0x0f42('0x55'),_0x0f42('0x5c'),_0x0f42('0x5d'),_0x0f42('0x62'),_0x0f42('0x63'),_0x0f42('0x5b')]})[_0x0f42('0x27')](handleEntityNotFound(_0x500854,null))[_0x0f42('0x27')](function(_0x300cef){_0x25c52d=_0x300cef;_0x13a1fe=_0x25c52d['host'];_0x243d47=_0x13a1fe===_0x0f42('0x64')?'eu':_0x0f42('0x65');_0x66b316=_0x25c52d[_0x0f42('0x62')];var _0x30632c=_0x66b316[_0x0f42('0x66')](-0x1);if(_0x30632c==='/'||_0x30632c==='\x5c'||_0x30632c===':'){_0x66b316=_0x66b316[_0x0f42('0x67')](0x0,_0x66b316[_0x0f42('0x68')](_0x30632c));}if(!_0x25c52d[_0x0f42('0x5b')]){throw new Error(_0x0f42('0x69'));}return getAccessToken(_0x25c52d);})['then'](function(_0x34b072){if(_0x34b072){return rp({'method':_0x0f42('0x6a'),'uri':util['format'](_0x0f42('0x6b'),_0x243d47),'qs':{'module':_0x0f42('0x6c')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x34b072},'json':!![]});}})[_0x0f42('0x27')](function(_0x2db327){if(_0x2db327){if(_0x2db327['response']&&_0x2db327[_0x0f42('0x6d')][_0x0f42('0x29')]){throw new Error(_0x2db327[_0x0f42('0x6d')][_0x0f42('0x29')][_0x0f42('0x6e')]);}var _0x66ed94=[];var _0x23d246=[];var _0x59e4dc=[_0x0f42('0x6f'),_0x0f42('0x70'),_0x0f42('0x71'),'WhoId',_0x0f42('0x72'),_0x0f42('0x73'),_0x0f42('0x74'),'Call_Type'];_0x23d246=_[_0x0f42('0x75')](_0x2db327[_0x0f42('0x37')],function(_0x402d77){return _0x59e4dc[_0x0f42('0x76')](_0x402d77[_0x0f42('0x77')]);});for(var _0xf91292=0x0;_0xf91292<_0x23d246[_0x0f42('0x38')];_0xf91292++){if(_0x23d246[_0xf91292][_0x0f42('0x78')]===![]){_0x66ed94['push']({'id':_0x23d246[_0xf91292]['id'],'name':_0x23d246[_0xf91292]['display_label'],'custom':_0x23d246[_0xf91292]['custom_field'],'options':_0x23d246[_0xf91292][_0x0f42('0x79')]==='picklist'&&_0x23d246[_0xf91292][_0x0f42('0x7a')][_0x0f42('0x38')]>-0x1?_['map'](_0x23d246[_0xf91292][_0x0f42('0x7a')],function(_0xb1832c){return{'name':_0xb1832c,'value':_0xb1832c};}):[]});}}return{'count':_0x66ed94[_0x0f42('0x38')],'rows':_0x66ed94};}else{return{'count':0x0,'rows':[]};}})[_0x0f42('0x27')](respondWithResult(_0x500854,null))[_0x0f42('0x46')](function(_0x4ad91d){var _0x42e81e=_0x26661b[_0x0f42('0x32')][_0x0f42('0x7b')]?0x1f4:_0x4ad91d['statusCode']||0x1f4;logger[_0x0f42('0x29')](_0x0f42('0x7c'),_0x0f42('0x7d'),_0x42e81e,JSON['stringify'](_0x4ad91d));delete _0x4ad91d[_0x0f42('0x2b')];if(_0x42e81e===0x191){_0x42e81e=0x190;}_0x500854[_0x0f42('0x1c')](_0x42e81e)[_0x0f42('0x2c')](_0x26661b[_0x0f42('0x32')][_0x0f42('0x7b')]?{'message':_0x0f42('0x7e'),'statusCode':_0x4ad91d[_0x0f42('0x7f')]}:_0x4ad91d);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index 19de9f0..3c123ca 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 _0xf894=['changed','zone','serverUrl','clientId','code','slice','substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.in','/oauth/v2/token','application/x-www-form-urlencoded','then','parse','refreshToken','refresh_token','format','name','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','clientSecret','https://accounts.zoho.com.au','POST','authorization_code','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','define','ZohoAccount','int_zoho_accounts'];(function(_0x225c46,_0x31e49e){var _0x1ed094=function(_0x100516){while(--_0x100516){_0x225c46['push'](_0x225c46['shift']());}};_0x1ed094(++_0x31e49e);}(_0xf894,0x183));var _0x4f89=function(_0x5af47b,_0x1276c5){_0x5af47b=_0x5af47b-0x0;var _0x35fe04=_0xf894[_0x5af47b];return _0x35fe04;};'use strict';var _=require(_0x4f89('0x0'));var util=require('util');var logger=require(_0x4f89('0x1'))(_0x4f89('0x2'));var moment=require(_0x4f89('0x3'));var BPromise=require(_0x4f89('0x4'));var rp=require(_0x4f89('0x5'));var fs=require('fs');var path=require(_0x4f89('0x6'));var rimraf=require('rimraf');var config=require(_0x4f89('0x7'));var attributes=require(_0x4f89('0x8'));var integrations=require(_0x4f89('0x9'));module['exports']=function(_0x23dd61,_0x4aa3f7){return _0x23dd61[_0x4f89('0xa')](_0x4f89('0xb'),attributes,{'tableName':_0x4f89('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x10b762,_0x33cc12,_0x31a58c){if(_0x10b762[_0x4f89('0xd')](_0x4f89('0xe'))||_0x10b762[_0x4f89('0xd')](_0x4f89('0xf'))||_0x10b762['changed'](_0x4f89('0x10'))||_0x10b762[_0x4f89('0xd')]('clientSecret')||_0x10b762[_0x4f89('0xd')](_0x4f89('0x11'))||_0x10b762[_0x4f89('0xd')]('host')){var _0x7d1e5a,_0x21deaf;_0x7d1e5a=_0x10b762[_0x4f89('0xf')];var _0x36343c=_0x7d1e5a[_0x4f89('0x12')](-0x1);if(_0x36343c==='/'||_0x36343c==='\x5c'||_0x36343c===':'){_0x7d1e5a=_0x7d1e5a[_0x4f89('0x13')](0x0,_0x7d1e5a[_0x4f89('0x14')](_0x36343c));}switch(_0x10b762[_0x4f89('0xe')]){case'US':_0x21deaf=_0x4f89('0x15');break;case'AU':_0x21deaf='https://accounts.zoho.com.au';break;case'IN':_0x21deaf=_0x4f89('0x16');break;case'CN':_0x21deaf='https://accounts.zoho.com.cn';break;default:_0x21deaf='https://accounts.zoho.eu';break;}var _0x5d4219={'method':'POST','uri':_0x21deaf+_0x4f89('0x17'),'form':{'grant_type':'authorization_code','client_id':_0x10b762[_0x4f89('0x10')],'client_secret':_0x10b762['clientSecret'],'redirect_uri':_0x10b762[_0x4f89('0xf')],'code':_0x10b762[_0x4f89('0x11')]},'headers':{'Content-Type':_0x4f89('0x18')}};return rp(_0x5d4219)[_0x4f89('0x19')](function(_0x2ba1e6){var _0x50f37b=JSON[_0x4f89('0x1a')](_0x2ba1e6);if(_0x50f37b['refresh_token']){_0x10b762[_0x4f89('0x1b')]=_0x50f37b[_0x4f89('0x1c')];logger['info'](util[_0x4f89('0x1d')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x10b762[_0x4f89('0x1e')],_0x10b762['id']));}else{logger[_0x4f89('0x1f')](util[_0x4f89('0x1d')](_0x4f89('0x20'),_0x10b762[_0x4f89('0x1e')],_0x10b762['id']),util[_0x4f89('0x21')](_0x50f37b,{'showHidden':![],'depth':null}));}return _0x31a58c(null,_0x33cc12);})[_0x4f89('0x22')](function(_0x523f79){logger[_0x4f89('0x1f')](util['format'](_0x4f89('0x20'),_0x10b762[_0x4f89('0x1e')],_0x10b762['id']),util[_0x4f89('0x21')](parsedResult,{'showHidden':![],'depth':null}));return _0x31a58c(_0x523f79);});}else{return _0x31a58c(null,_0x33cc12);}},'beforeUpdate':function(_0x5ddb27,_0x24e481,_0x2f89e2){if(_0x5ddb27[_0x4f89('0xd')](_0x4f89('0xe'))||_0x5ddb27[_0x4f89('0xd')](_0x4f89('0xf'))||_0x5ddb27[_0x4f89('0xd')]('clientId')||_0x5ddb27[_0x4f89('0xd')](_0x4f89('0x23'))||_0x5ddb27['changed']('code')||_0x5ddb27[_0x4f89('0xd')]('host')){var _0x1fc7ea,_0x18c9f9;_0x1fc7ea=_0x5ddb27[_0x4f89('0xf')];var _0x5ee05a=_0x1fc7ea['slice'](-0x1);if(_0x5ee05a==='/'||_0x5ee05a==='\x5c'||_0x5ee05a===':'){_0x1fc7ea=_0x1fc7ea[_0x4f89('0x13')](0x0,_0x1fc7ea[_0x4f89('0x14')](_0x5ee05a));}switch(_0x5ddb27[_0x4f89('0xe')]){case'US':_0x18c9f9=_0x4f89('0x15');break;case'AU':_0x18c9f9=_0x4f89('0x24');break;case'IN':_0x18c9f9=_0x4f89('0x16');break;case'CN':_0x18c9f9='https://accounts.zoho.com.cn';break;default:_0x18c9f9='https://accounts.zoho.eu';break;}var _0x5ddde3={'method':_0x4f89('0x25'),'uri':_0x18c9f9+_0x4f89('0x17'),'form':{'grant_type':_0x4f89('0x26'),'client_id':_0x5ddb27[_0x4f89('0x10')],'client_secret':_0x5ddb27[_0x4f89('0x23')],'redirect_uri':_0x5ddb27[_0x4f89('0xf')],'code':_0x5ddb27[_0x4f89('0x11')]},'headers':{'Content-Type':_0x4f89('0x18')}};return rp(_0x5ddde3)['then'](function(_0x1393f2){var _0x30bfcd=JSON[_0x4f89('0x1a')](_0x1393f2);if(_0x30bfcd[_0x4f89('0x1c')]){_0x5ddb27[_0x4f89('0x1b')]=_0x30bfcd[_0x4f89('0x1c')];logger['info'](util['format'](_0x4f89('0x27'),_0x5ddb27['name'],_0x5ddb27['id']));}else{logger['error'](util[_0x4f89('0x1d')](_0x4f89('0x20'),_0x5ddb27[_0x4f89('0x1e')],_0x5ddb27['id']),util['inspect'](_0x30bfcd,{'showHidden':![],'depth':null}));}return _0x2f89e2(null,_0x24e481);})[_0x4f89('0x22')](function(_0x314324){logger[_0x4f89('0x1f')](util[_0x4f89('0x1d')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x5ddb27['name'],_0x5ddb27['id']),util[_0x4f89('0x21')](parsedResult,{'showHidden':![],'depth':null}));return _0x2f89e2(_0x314324);});}else{return _0x2f89e2(null,_0x24e481);}}}});}; \ No newline at end of file +var _0xf455=['request-promise','path','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','define','ZohoAccount','int_zoho_accounts','changed','zone','clientId','clientSecret','code','host','slice','substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.com.cn','https://accounts.zoho.eu','/oauth/v2/token','serverUrl','application/x-www-form-urlencoded','parse','refresh_token','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','https://accounts.zoho.in','POST','authorization_code','then','refreshToken','catch','util','../../config/logger','api','moment'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0xf455,0x176));var _0x5f45=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf455[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x5f45('0x0'));var logger=require(_0x5f45('0x1'))(_0x5f45('0x2'));var moment=require(_0x5f45('0x3'));var BPromise=require('bluebird');var rp=require(_0x5f45('0x4'));var fs=require('fs');var path=require(_0x5f45('0x5'));var rimraf=require('rimraf');var config=require(_0x5f45('0x6'));var attributes=require(_0x5f45('0x7'));var integrations=require(_0x5f45('0x8'));module['exports']=function(_0x5a8af8,_0x9c2cf2){return _0x5a8af8[_0x5f45('0x9')](_0x5f45('0xa'),attributes,{'tableName':_0x5f45('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x13ff9e,_0x226b91,_0x24bbc6){if(_0x13ff9e[_0x5f45('0xc')](_0x5f45('0xd'))||_0x13ff9e[_0x5f45('0xc')]('serverUrl')||_0x13ff9e[_0x5f45('0xc')](_0x5f45('0xe'))||_0x13ff9e['changed'](_0x5f45('0xf'))||_0x13ff9e[_0x5f45('0xc')](_0x5f45('0x10'))||_0x13ff9e[_0x5f45('0xc')](_0x5f45('0x11'))){var _0x42ddbf,_0x1f78d1;_0x42ddbf=_0x13ff9e['serverUrl'];var _0x141ffd=_0x42ddbf[_0x5f45('0x12')](-0x1);if(_0x141ffd==='/'||_0x141ffd==='\x5c'||_0x141ffd===':'){_0x42ddbf=_0x42ddbf[_0x5f45('0x13')](0x0,_0x42ddbf[_0x5f45('0x14')](_0x141ffd));}switch(_0x13ff9e[_0x5f45('0xd')]){case'US':_0x1f78d1=_0x5f45('0x15');break;case'AU':_0x1f78d1=_0x5f45('0x16');break;case'IN':_0x1f78d1='https://accounts.zoho.in';break;case'CN':_0x1f78d1=_0x5f45('0x17');break;default:_0x1f78d1=_0x5f45('0x18');break;}var _0x483228={'method':'POST','uri':_0x1f78d1+_0x5f45('0x19'),'form':{'grant_type':'authorization_code','client_id':_0x13ff9e[_0x5f45('0xe')],'client_secret':_0x13ff9e[_0x5f45('0xf')],'redirect_uri':_0x13ff9e[_0x5f45('0x1a')],'code':_0x13ff9e[_0x5f45('0x10')]},'headers':{'Content-Type':_0x5f45('0x1b')}};return rp(_0x483228)['then'](function(_0x2b5ec5){var _0x4db7c4=JSON[_0x5f45('0x1c')](_0x2b5ec5);if(_0x4db7c4[_0x5f45('0x1d')]){_0x13ff9e['refreshToken']=_0x4db7c4['refresh_token'];logger['info'](util[_0x5f45('0x1e')](_0x5f45('0x1f'),_0x13ff9e[_0x5f45('0x20')],_0x13ff9e['id']));}else{logger[_0x5f45('0x21')](util[_0x5f45('0x1e')](_0x5f45('0x22'),_0x13ff9e[_0x5f45('0x20')],_0x13ff9e['id']),util[_0x5f45('0x23')](_0x4db7c4,{'showHidden':![],'depth':null}));}return _0x24bbc6(null,_0x226b91);})['catch'](function(_0x416580){logger[_0x5f45('0x21')](util['format'](_0x5f45('0x22'),_0x13ff9e['name'],_0x13ff9e['id']),util[_0x5f45('0x23')](parsedResult,{'showHidden':![],'depth':null}));return _0x24bbc6(_0x416580);});}else{return _0x24bbc6(null,_0x226b91);}},'beforeUpdate':function(_0x4c70f2,_0x4c5b68,_0x4e6072){if(_0x4c70f2['changed'](_0x5f45('0xd'))||_0x4c70f2[_0x5f45('0xc')](_0x5f45('0x1a'))||_0x4c70f2[_0x5f45('0xc')](_0x5f45('0xe'))||_0x4c70f2[_0x5f45('0xc')](_0x5f45('0xf'))||_0x4c70f2[_0x5f45('0xc')](_0x5f45('0x10'))||_0x4c70f2[_0x5f45('0xc')](_0x5f45('0x11'))){var _0x5b333d,_0x285755;_0x5b333d=_0x4c70f2[_0x5f45('0x1a')];var _0x37e3d2=_0x5b333d[_0x5f45('0x12')](-0x1);if(_0x37e3d2==='/'||_0x37e3d2==='\x5c'||_0x37e3d2===':'){_0x5b333d=_0x5b333d[_0x5f45('0x13')](0x0,_0x5b333d[_0x5f45('0x14')](_0x37e3d2));}switch(_0x4c70f2[_0x5f45('0xd')]){case'US':_0x285755=_0x5f45('0x15');break;case'AU':_0x285755=_0x5f45('0x16');break;case'IN':_0x285755=_0x5f45('0x24');break;case'CN':_0x285755=_0x5f45('0x17');break;default:_0x285755=_0x5f45('0x18');break;}var _0x553bd7={'method':_0x5f45('0x25'),'uri':_0x285755+_0x5f45('0x19'),'form':{'grant_type':_0x5f45('0x26'),'client_id':_0x4c70f2[_0x5f45('0xe')],'client_secret':_0x4c70f2['clientSecret'],'redirect_uri':_0x4c70f2[_0x5f45('0x1a')],'code':_0x4c70f2['code']},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x553bd7)[_0x5f45('0x27')](function(_0x1c2e90){var _0x46c2bd=JSON[_0x5f45('0x1c')](_0x1c2e90);if(_0x46c2bd[_0x5f45('0x1d')]){_0x4c70f2[_0x5f45('0x28')]=_0x46c2bd[_0x5f45('0x1d')];logger['info'](util['format']('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x4c70f2[_0x5f45('0x20')],_0x4c70f2['id']));}else{logger['error'](util[_0x5f45('0x1e')](_0x5f45('0x22'),_0x4c70f2[_0x5f45('0x20')],_0x4c70f2['id']),util['inspect'](_0x46c2bd,{'showHidden':![],'depth':null}));}return _0x4e6072(null,_0x4c5b68);})[_0x5f45('0x29')](function(_0x7f8c1f){logger[_0x5f45('0x21')](util[_0x5f45('0x1e')](_0x5f45('0x22'),_0x4c70f2[_0x5f45('0x20')],_0x4c70f2['id']),util[_0x5f45('0x23')](parsedResult,{'showHidden':![],'depth':null}));return _0x4e6072(_0x7f8c1f);});}else{return _0x4e6072(null,_0x4c5b68);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index dff992c..c13a34a 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 _0x4cb5=['../../config/environment','jayson/promise','http','request','then','info','ZohoAccount,\x20%s,\x20%s','ZohoAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','GetZohoAccount','ZohoAccount','findAll','options','raw','limit','include','map','model','attributes','debug','find','where','ShowZohoAccount','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x5f44b0,_0x588967){var _0x5d010d=function(_0x8951b1){while(--_0x8951b1){_0x5f44b0['push'](_0x5f44b0['shift']());}};_0x5d010d(++_0x588967);}(_0x4cb5,0x8f));var _0x54cb=function(_0x3403fd,_0x413103){_0x3403fd=_0x3403fd-0x0;var _0x23ae02=_0x4cb5[_0x3403fd];return _0x23ae02;};'use strict';var _=require(_0x54cb('0x0'));var util=require(_0x54cb('0x1'));var moment=require(_0x54cb('0x2'));var BPromise=require(_0x54cb('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x54cb('0x4'));var db=require(_0x54cb('0x5'))['db'];var utils=require(_0x54cb('0x6'));var logger=require(_0x54cb('0x7'))(_0x54cb('0x8'));var config=require(_0x54cb('0x9'));var jayson=require(_0x54cb('0xa'));var client=jayson['client'][_0x54cb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2a3817,_0x5f4830,_0x3f2076){return new BPromise(function(_0x53cc33,_0x3c2861){return client[_0x54cb('0xc')](_0x2a3817,_0x3f2076)[_0x54cb('0xd')](function(_0x25596b){logger[_0x54cb('0xe')](_0x54cb('0xf'),_0x5f4830,'request\x20sent');logger['debug'](_0x54cb('0x10'),_0x5f4830,_0x54cb('0x11'),JSON['stringify'](_0x25596b));if(_0x25596b[_0x54cb('0x12')]){if(_0x25596b[_0x54cb('0x12')][_0x54cb('0x13')]===0x1f4){logger[_0x54cb('0x12')](_0x54cb('0xf'),_0x5f4830,_0x25596b[_0x54cb('0x12')]['message']);return _0x3c2861(_0x25596b[_0x54cb('0x12')][_0x54cb('0x14')]);}logger[_0x54cb('0x12')](_0x54cb('0xf'),_0x5f4830,_0x25596b[_0x54cb('0x12')][_0x54cb('0x14')]);return _0x53cc33(_0x25596b['error'][_0x54cb('0x14')]);}else{logger[_0x54cb('0xe')](_0x54cb('0xf'),_0x5f4830,_0x54cb('0x11'));_0x53cc33(_0x25596b[_0x54cb('0x15')]['message']);}})[_0x54cb('0x16')](function(_0x256cf7){logger[_0x54cb('0x12')](_0x54cb('0xf'),_0x5f4830,_0x256cf7);_0x3c2861(_0x256cf7);});});}exports[_0x54cb('0x17')]=function(_0x4b4bef){var _0x4d1d19=this;return new Promise(function(_0x238364,_0x3ed6dc){return db[_0x54cb('0x18')][_0x54cb('0x19')]({'raw':_0x4b4bef[_0x54cb('0x1a')]?_0x4b4bef[_0x54cb('0x1a')][_0x54cb('0x1b')]===undefined?!![]:![]:!![],'where':_0x4b4bef[_0x54cb('0x1a')]?_0x4b4bef['options']['where']||null:null,'attributes':_0x4b4bef[_0x54cb('0x1a')]?_0x4b4bef[_0x54cb('0x1a')]['attributes']||null:null,'limit':_0x4b4bef[_0x54cb('0x1a')]?_0x4b4bef[_0x54cb('0x1a')][_0x54cb('0x1c')]||null:null,'include':_0x4b4bef[_0x54cb('0x1a')]?_0x4b4bef[_0x54cb('0x1a')][_0x54cb('0x1d')]?_[_0x54cb('0x1e')](_0x4b4bef['options']['include'],function(_0x725a5){return{'model':db[_0x725a5[_0x54cb('0x1f')]],'as':_0x725a5['as'],'attributes':_0x725a5[_0x54cb('0x20')],'include':_0x725a5[_0x54cb('0x1d')]?_['map'](_0x725a5[_0x54cb('0x1d')],function(_0x397f5f){return{'model':db[_0x397f5f[_0x54cb('0x1f')]],'as':_0x397f5f['as'],'attributes':_0x397f5f[_0x54cb('0x20')],'include':_0x397f5f[_0x54cb('0x1d')]?_[_0x54cb('0x1e')](_0x397f5f['include'],function(_0x4d6746){return{'model':db[_0x4d6746['model']],'as':_0x4d6746['as'],'attributes':_0x4d6746[_0x54cb('0x20')]};}):[]};}):[]};}):[]:[]})[_0x54cb('0xd')](function(_0x39787c){logger[_0x54cb('0xe')]('GetZohoAccount',_0x4b4bef);logger[_0x54cb('0x21')](_0x54cb('0x17'),_0x4b4bef,JSON['stringify'](_0x39787c));_0x238364(_0x39787c);})[_0x54cb('0x16')](function(_0x3cd390){logger[_0x54cb('0x12')](_0x54cb('0x17'),_0x3cd390[_0x54cb('0x14')],_0x4b4bef);_0x3ed6dc(_0x4d1d19[_0x54cb('0x12')](0x1f4,_0x3cd390[_0x54cb('0x14')]));});});};exports['ShowZohoAccount']=function(_0x469952){var _0x3d8e60=this;return new Promise(function(_0x134f14,_0x589b6b){return db[_0x54cb('0x18')][_0x54cb('0x22')]({'raw':_0x469952[_0x54cb('0x1a')]?_0x469952[_0x54cb('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x469952['options']?_0x469952[_0x54cb('0x1a')][_0x54cb('0x23')]||null:null,'attributes':_0x469952['options']?_0x469952['options'][_0x54cb('0x20')]||null:null,'include':_0x469952[_0x54cb('0x1a')]?_0x469952[_0x54cb('0x1a')]['include']?_[_0x54cb('0x1e')](_0x469952['options'][_0x54cb('0x1d')],function(_0x41de8a){return{'model':db[_0x41de8a[_0x54cb('0x1f')]],'as':_0x41de8a['as'],'attributes':_0x41de8a[_0x54cb('0x20')],'include':_0x41de8a[_0x54cb('0x1d')]?_[_0x54cb('0x1e')](_0x41de8a['include'],function(_0x59c466){return{'model':db[_0x59c466[_0x54cb('0x1f')]],'as':_0x59c466['as'],'attributes':_0x59c466[_0x54cb('0x20')],'include':_0x59c466[_0x54cb('0x1d')]?_[_0x54cb('0x1e')](_0x59c466[_0x54cb('0x1d')],function(_0x1819f3){return{'model':db[_0x1819f3['model']],'as':_0x1819f3['as'],'attributes':_0x1819f3[_0x54cb('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1f3104){logger['info'](_0x54cb('0x24'),_0x469952);logger[_0x54cb('0x21')]('ShowZohoAccount',_0x469952,JSON[_0x54cb('0x25')](_0x1f3104));_0x134f14(_0x1f3104);})[_0x54cb('0x16')](function(_0x5e1bdf){logger[_0x54cb('0x12')]('ShowZohoAccount',_0x5e1bdf['message'],_0x469952);_0x589b6b(_0x3d8e60[_0x54cb('0x12')](0x1f4,_0x5e1bdf['message']));});});}; \ No newline at end of file +var _0x6d38=['moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','ZohoAccount,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','GetZohoAccount','ZohoAccount','options','raw','where','attributes','include','model','debug','catch','ShowZohoAccount','find','map','util'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0x6d38,0x1ef));var _0x86d3=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x6d38[_0x297fd3];return _0x2af381;};'use strict';var _=require('lodash');var util=require(_0x86d3('0x0'));var moment=require(_0x86d3('0x1'));var BPromise=require(_0x86d3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x86d3('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x86d3('0x4'))(_0x86d3('0x5'));var config=require(_0x86d3('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x86d3('0x7')][_0x86d3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x33d4aa,_0x2eaa15,_0x47e654){return new BPromise(function(_0x552b07,_0x2aea31){return client[_0x86d3('0x9')](_0x33d4aa,_0x47e654)[_0x86d3('0xa')](function(_0x499640){logger['info'](_0x86d3('0xb'),_0x2eaa15,_0x86d3('0xc'));logger['debug']('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x2eaa15,_0x86d3('0xc'),JSON[_0x86d3('0xd')](_0x499640));if(_0x499640['error']){if(_0x499640[_0x86d3('0xe')]['code']===0x1f4){logger[_0x86d3('0xe')](_0x86d3('0xb'),_0x2eaa15,_0x499640[_0x86d3('0xe')][_0x86d3('0xf')]);return _0x2aea31(_0x499640[_0x86d3('0xe')][_0x86d3('0xf')]);}logger[_0x86d3('0xe')](_0x86d3('0xb'),_0x2eaa15,_0x499640['error'][_0x86d3('0xf')]);return _0x552b07(_0x499640[_0x86d3('0xe')][_0x86d3('0xf')]);}else{logger[_0x86d3('0x10')](_0x86d3('0xb'),_0x2eaa15,_0x86d3('0xc'));_0x552b07(_0x499640[_0x86d3('0x11')][_0x86d3('0xf')]);}})['catch'](function(_0x2d5ba9){logger[_0x86d3('0xe')](_0x86d3('0xb'),_0x2eaa15,_0x2d5ba9);_0x2aea31(_0x2d5ba9);});});}exports[_0x86d3('0x12')]=function(_0x46feec){var _0x120ef3=this;return new Promise(function(_0x33e459,_0x32dee7){return db[_0x86d3('0x13')]['findAll']({'raw':_0x46feec[_0x86d3('0x14')]?_0x46feec['options'][_0x86d3('0x15')]===undefined?!![]:![]:!![],'where':_0x46feec['options']?_0x46feec['options'][_0x86d3('0x16')]||null:null,'attributes':_0x46feec[_0x86d3('0x14')]?_0x46feec[_0x86d3('0x14')][_0x86d3('0x17')]||null:null,'limit':_0x46feec['options']?_0x46feec[_0x86d3('0x14')]['limit']||null:null,'include':_0x46feec[_0x86d3('0x14')]?_0x46feec[_0x86d3('0x14')][_0x86d3('0x18')]?_['map'](_0x46feec[_0x86d3('0x14')][_0x86d3('0x18')],function(_0x1fa4ac){return{'model':db[_0x1fa4ac['model']],'as':_0x1fa4ac['as'],'attributes':_0x1fa4ac['attributes'],'include':_0x1fa4ac[_0x86d3('0x18')]?_['map'](_0x1fa4ac[_0x86d3('0x18')],function(_0x1bea5e){return{'model':db[_0x1bea5e[_0x86d3('0x19')]],'as':_0x1bea5e['as'],'attributes':_0x1bea5e[_0x86d3('0x17')],'include':_0x1bea5e['include']?_['map'](_0x1bea5e[_0x86d3('0x18')],function(_0x611764){return{'model':db[_0x611764['model']],'as':_0x611764['as'],'attributes':_0x611764[_0x86d3('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x42413c){logger[_0x86d3('0x10')](_0x86d3('0x12'),_0x46feec);logger[_0x86d3('0x1a')](_0x86d3('0x12'),_0x46feec,JSON[_0x86d3('0xd')](_0x42413c));_0x33e459(_0x42413c);})[_0x86d3('0x1b')](function(_0x35d708){logger[_0x86d3('0xe')](_0x86d3('0x12'),_0x35d708[_0x86d3('0xf')],_0x46feec);_0x32dee7(_0x120ef3[_0x86d3('0xe')](0x1f4,_0x35d708[_0x86d3('0xf')]));});});};exports[_0x86d3('0x1c')]=function(_0x5b09f6){var _0x120a0c=this;return new Promise(function(_0x403be3,_0x2bda35){return db[_0x86d3('0x13')][_0x86d3('0x1d')]({'raw':_0x5b09f6[_0x86d3('0x14')]?_0x5b09f6['options'][_0x86d3('0x15')]===undefined?!![]:![]:!![],'where':_0x5b09f6['options']?_0x5b09f6['options'][_0x86d3('0x16')]||null:null,'attributes':_0x5b09f6[_0x86d3('0x14')]?_0x5b09f6[_0x86d3('0x14')]['attributes']||null:null,'include':_0x5b09f6[_0x86d3('0x14')]?_0x5b09f6[_0x86d3('0x14')]['include']?_[_0x86d3('0x1e')](_0x5b09f6[_0x86d3('0x14')][_0x86d3('0x18')],function(_0x476eb3){return{'model':db[_0x476eb3[_0x86d3('0x19')]],'as':_0x476eb3['as'],'attributes':_0x476eb3[_0x86d3('0x17')],'include':_0x476eb3[_0x86d3('0x18')]?_[_0x86d3('0x1e')](_0x476eb3['include'],function(_0x4cdf45){return{'model':db[_0x4cdf45['model']],'as':_0x4cdf45['as'],'attributes':_0x4cdf45[_0x86d3('0x17')],'include':_0x4cdf45['include']?_[_0x86d3('0x1e')](_0x4cdf45['include'],function(_0x366943){return{'model':db[_0x366943[_0x86d3('0x19')]],'as':_0x366943['as'],'attributes':_0x366943[_0x86d3('0x17')]};}):[]};}):[]};}):[]:[]})[_0x86d3('0xa')](function(_0x1e22c2){logger[_0x86d3('0x10')](_0x86d3('0x1c'),_0x5b09f6);logger['debug'](_0x86d3('0x1c'),_0x5b09f6,JSON[_0x86d3('0xd')](_0x1e22c2));_0x403be3(_0x1e22c2);})['catch'](function(_0x178fc6){logger[_0x86d3('0xe')](_0x86d3('0x1c'),_0x178fc6[_0x86d3('0xf')],_0x5b09f6);_0x2bda35(_0x120a0c['error'](0x1f4,_0x178fc6[_0x86d3('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 1816544..118390f 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 _0xad08=['/:id/fields','getFields','/:id/subjects','/:id/descriptions','post','put','update','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','index','/:id','show'];(function(_0x1b5e78,_0x3b25bd){var _0x52aaf7=function(_0x58d62f){while(--_0x58d62f){_0x1b5e78['push'](_0x1b5e78['shift']());}};_0x52aaf7(++_0x3b25bd);}(_0xad08,0x1c0));var _0x8ad0=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xad08[_0x2b4411];return _0x8e41ef;};'use strict';var multer=require(_0x8ad0('0x0'));var util=require(_0x8ad0('0x1'));var path=require('path');var timeout=require(_0x8ad0('0x2'));var express=require(_0x8ad0('0x3'));var router=express[_0x8ad0('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8ad0('0x5'));var interaction=require(_0x8ad0('0x6'));var config=require(_0x8ad0('0x7'));var controller=require(_0x8ad0('0x8'));router[_0x8ad0('0x9')]('/',auth[_0x8ad0('0xa')](),controller[_0x8ad0('0xb')]);router[_0x8ad0('0x9')](_0x8ad0('0xc'),auth['isAuthenticated'](),controller[_0x8ad0('0xd')]);router[_0x8ad0('0x9')](_0x8ad0('0xe'),auth[_0x8ad0('0xa')](),controller[_0x8ad0('0xf')]);router['get'](_0x8ad0('0x10'),auth[_0x8ad0('0xa')](),controller['getSubjects']);router[_0x8ad0('0x9')](_0x8ad0('0x11'),auth[_0x8ad0('0xa')](),controller['getDescriptions']);router[_0x8ad0('0x12')]('/',auth[_0x8ad0('0xa')](),controller['create']);router[_0x8ad0('0x13')](_0x8ad0('0xc'),auth[_0x8ad0('0xa')](),controller[_0x8ad0('0x14')]);router['delete']('/:id',auth[_0x8ad0('0xa')](),controller[_0x8ad0('0x15')]);module['exports']=router; \ No newline at end of file +var _0xa058=['multer','util','path','Router','fs-extra','../../components/auth/service','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','getFields','/:id/subjects','getSubjects','post','create','/:id','update','destroy'];(function(_0x46d926,_0x1469b0){var _0x3e1759=function(_0x2134d6){while(--_0x2134d6){_0x46d926['push'](_0x46d926['shift']());}};_0x3e1759(++_0x1469b0);}(_0xa058,0x111));var _0x8a05=function(_0x56fb33,_0x37be08){_0x56fb33=_0x56fb33-0x0;var _0x435ee4=_0xa058[_0x56fb33];return _0x435ee4;};'use strict';var multer=require(_0x8a05('0x0'));var util=require(_0x8a05('0x1'));var path=require(_0x8a05('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8a05('0x3')]();var fs_extra=require(_0x8a05('0x4'));var auth=require(_0x8a05('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8a05('0x6'));var controller=require(_0x8a05('0x7'));router[_0x8a05('0x8')]('/',auth[_0x8a05('0x9')](),controller[_0x8a05('0xa')]);router[_0x8a05('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x8a05('0xb')]);router[_0x8a05('0x8')](_0x8a05('0xc'),auth[_0x8a05('0x9')](),controller[_0x8a05('0xd')]);router[_0x8a05('0x8')](_0x8a05('0xe'),auth[_0x8a05('0x9')](),controller[_0x8a05('0xf')]);router[_0x8a05('0x8')]('/:id/descriptions',auth[_0x8a05('0x9')](),controller['getDescriptions']);router[_0x8a05('0x10')]('/',auth['isAuthenticated'](),controller[_0x8a05('0x11')]);router['put'](_0x8a05('0x12'),auth[_0x8a05('0x9')](),controller[_0x8a05('0x13')]);router['delete']('/:id',auth[_0x8a05('0x9')](),controller[_0x8a05('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index bbf7626..0cd501d 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 _0xa318=['ENUM','lead','contact','nothing','contact_lead','sequelize','exports'];(function(_0x594bca,_0x3a8d3a){var _0x7c108=function(_0xa3f471){while(--_0xa3f471){_0x594bca['push'](_0x594bca['shift']());}};_0x7c108(++_0x3a8d3a);}(_0xa318,0xc2));var _0x8a31=function(_0x197644,_0x366eab){_0x197644=_0x197644-0x0;var _0x582b4c=_0xa318[_0x197644];return _0x582b4c;};'use strict';var Sequelize=require(_0x8a31('0x0'));module[_0x8a31('0x1')]={'name':{'type':Sequelize['STRING']},'moduleCreate':{'type':Sequelize[_0x8a31('0x2')](_0x8a31('0x3'),_0x8a31('0x4'),_0x8a31('0x5')),'defaultValue':_0x8a31('0x3')},'moduleSearch':{'type':Sequelize['ENUM'](_0x8a31('0x6'),'contact',_0x8a31('0x3')),'defaultValue':_0x8a31('0x6')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x5699=['ENUM','contact_lead','sequelize','exports','lead','nothing'];(function(_0x2f1762,_0xab43df){var _0x8ab21=function(_0xf6c1f5){while(--_0xf6c1f5){_0x2f1762['push'](_0x2f1762['shift']());}};_0x8ab21(++_0xab43df);}(_0x5699,0x68));var _0x9569=function(_0x1a5913,_0x7bbba){_0x1a5913=_0x1a5913-0x0;var _0x58f432=_0x5699[_0x1a5913];return _0x58f432;};'use strict';var Sequelize=require(_0x9569('0x0'));module[_0x9569('0x1')]={'name':{'type':Sequelize['STRING']},'moduleCreate':{'type':Sequelize['ENUM'](_0x9569('0x2'),'contact',_0x9569('0x3')),'defaultValue':_0x9569('0x2')},'moduleSearch':{'type':Sequelize[_0x9569('0x4')](_0x9569('0x5'),'contact','lead'),'defaultValue':'contact_lead'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index 3b3e81d..8baed33 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 _0x8189=['hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','find','create','body','getFields','findOne','getSubjects','ZohoField','getDescriptions','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','limit','count','set','Content-Range','apply','update','then','end','name','map','ZohoConfiguration','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x8189,0x18a));var _0x9818=function(_0x1693fc,_0x19e28c){_0x1693fc=_0x1693fc-0x0;var _0x2baa58=_0x8189[_0x1693fc];return _0x2baa58;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9818('0x0'));var zipdir=require(_0x9818('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9818('0x2'));var moment=require('moment');var BPromise=require(_0x9818('0x3'));var Mustache=require(_0x9818('0x4'));var util=require(_0x9818('0x5'));var path=require(_0x9818('0x6'));var sox=require(_0x9818('0x7'));var csv=require(_0x9818('0x8'));var ejs=require(_0x9818('0x9'));var fs=require('fs');var fs_extra=require(_0x9818('0xa'));var _=require('lodash');var squel=require(_0x9818('0xb'));var crypto=require(_0x9818('0xc'));var jsforce=require(_0x9818('0xd'));var deskjs=require(_0x9818('0xe'));var toCsv=require(_0x9818('0x8'));var querystring=require(_0x9818('0xf'));var Papa=require(_0x9818('0x10'));var Redis=require(_0x9818('0x11'));var authService=require(_0x9818('0x12'));var qs=require(_0x9818('0x13'));var as=require(_0x9818('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9818('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x9818('0x16'));var licenseUtil=require(_0x9818('0x17'));var db=require(_0x9818('0x18'))['db'];function respondWithStatusCode(_0x3259fc,_0x3c7b8c){_0x3c7b8c=_0x3c7b8c||0xcc;return function(_0x54525f){if(_0x54525f){return _0x3259fc['sendStatus'](_0x3c7b8c);}return _0x3259fc['status'](_0x3c7b8c)['end']();};}function respondWithResult(_0x2e7e2c,_0x4dd221){_0x4dd221=_0x4dd221||0xc8;return function(_0x3d8b75){if(_0x3d8b75){return _0x2e7e2c[_0x9818('0x19')](_0x4dd221)['json'](_0x3d8b75);}};}function respondWithFilteredResult(_0x2c95c4,_0x52d0c3){return function(_0x2f8257){if(_0x2f8257){var _0x4d61bc=typeof _0x52d0c3[_0x9818('0x1a')]===_0x9818('0x1b')&&typeof _0x52d0c3[_0x9818('0x1c')]===_0x9818('0x1b');var _0x2e9e50=_0x2f8257[_0x9818('0x1d')];var _0x335ddc=_0x4d61bc?0x0:_0x52d0c3[_0x9818('0x1a')];var _0x2656d1=_0x4d61bc?_0x2f8257[_0x9818('0x1d')]:_0x52d0c3['offset']+_0x52d0c3['limit'];var _0x3e056e;if(_0x2656d1>=_0x2e9e50){_0x2656d1=_0x2e9e50;_0x3e056e=0xc8;}else{_0x3e056e=0xce;}_0x2c95c4[_0x9818('0x19')](_0x3e056e);return _0x2c95c4[_0x9818('0x1e')](_0x9818('0x1f'),_0x335ddc+'-'+_0x2656d1+'/'+_0x2e9e50)['json'](_0x2f8257);}return null;};}function patchUpdates(_0x1e88f0){return function(_0x4cea63){try{jsonpatch[_0x9818('0x20')](_0x4cea63,_0x1e88f0,!![]);}catch(_0x21ba1f){return BPromise['reject'](_0x21ba1f);}return _0x4cea63['save']();};}function saveUpdates(_0x412ed0,_0x22dded){return function(_0x224876){if(_0x224876){return _0x224876[_0x9818('0x21')](_0x412ed0)[_0x9818('0x22')](function(_0x1e1f09){return _0x1e1f09;});}return null;};}function removeEntity(_0x3fe0f6,_0x2553f8){return function(_0xfb8dbc){if(_0xfb8dbc){return _0xfb8dbc['destroy']()[_0x9818('0x22')](function(){_0x3fe0f6[_0x9818('0x19')](0xcc)[_0x9818('0x23')]();});}};}function handleEntityNotFound(_0x57adf0,_0x72bcc3){return function(_0x20cb0f){if(!_0x20cb0f){_0x57adf0['sendStatus'](0x194);}return _0x20cb0f;};}function handleError(_0x10ffcd,_0x592bab){_0x592bab=_0x592bab||0x1f4;return function(_0x5b554a){logger['error'](_0x5b554a['stack']);if(_0x5b554a[_0x9818('0x24')]){delete _0x5b554a[_0x9818('0x24')];}_0x10ffcd[_0x9818('0x19')](_0x592bab)['send'](_0x5b554a);};}exports['index']=function(_0x36467a,_0x5740ca){var _0xa029d9={},_0x5ace70={},_0x35e166={'count':0x0,'rows':[]};var _0x299673=_[_0x9818('0x25')](db[_0x9818('0x26')][_0x9818('0x27')],function(_0x8208db){return{'name':_0x8208db['fieldName'],'type':_0x8208db[_0x9818('0x28')][_0x9818('0x29')]};});_0x5ace70[_0x9818('0x2a')]=_[_0x9818('0x25')](_0x299673,'name');_0x5ace70[_0x9818('0x2b')]=_[_0x9818('0x2c')](_0x36467a[_0x9818('0x2b')]);_0x5ace70[_0x9818('0x2d')]=_[_0x9818('0x2e')](_0x5ace70[_0x9818('0x2a')],_0x5ace70['query']);_0xa029d9[_0x9818('0x2f')]=_[_0x9818('0x2e')](_0x5ace70[_0x9818('0x2a')],qs[_0x9818('0x30')](_0x36467a[_0x9818('0x2b')][_0x9818('0x30')]));_0xa029d9[_0x9818('0x2f')]=_0xa029d9['attributes'][_0x9818('0x31')]?_0xa029d9['attributes']:_0x5ace70[_0x9818('0x2a')];if(!_0x36467a[_0x9818('0x2b')][_0x9818('0x32')](_0x9818('0x33'))){_0xa029d9[_0x9818('0x1c')]=qs[_0x9818('0x1c')](_0x36467a[_0x9818('0x2b')][_0x9818('0x1c')]);_0xa029d9['offset']=qs[_0x9818('0x1a')](_0x36467a[_0x9818('0x2b')][_0x9818('0x1a')]);}_0xa029d9[_0x9818('0x34')]=qs[_0x9818('0x35')](_0x36467a[_0x9818('0x2b')][_0x9818('0x35')]);_0xa029d9['where']=qs[_0x9818('0x2d')](_[_0x9818('0x36')](_0x36467a['query'],_0x5ace70[_0x9818('0x2d')]),_0x299673);if(_0x36467a[_0x9818('0x2b')][_0x9818('0x37')]){_0xa029d9[_0x9818('0x38')]=_['merge'](_0xa029d9[_0x9818('0x38')],{'$or':_[_0x9818('0x25')](_0x299673,function(_0x3b94af){if(_0x3b94af['type']!==_0x9818('0x39')){var _0x149fd6={};_0x149fd6[_0x3b94af[_0x9818('0x24')]]={'$like':'%'+_0x36467a[_0x9818('0x2b')][_0x9818('0x37')]+'%'};return _0x149fd6;}})});}_0xa029d9=_[_0x9818('0x3a')]({},_0xa029d9,_0x36467a[_0x9818('0x3b')]);var _0x2ad63a={'where':_0xa029d9[_0x9818('0x38')]};return db[_0x9818('0x26')]['count'](_0x2ad63a)[_0x9818('0x22')](function(_0x660ee4){_0x35e166['count']=_0x660ee4;if(_0x36467a[_0x9818('0x2b')][_0x9818('0x3c')]){_0xa029d9[_0x9818('0x3d')]=[{'all':!![]}];}return db[_0x9818('0x26')][_0x9818('0x3e')](_0xa029d9);})['then'](function(_0x3eded6){_0x35e166['rows']=_0x3eded6;return _0x35e166;})[_0x9818('0x22')](respondWithFilteredResult(_0x5740ca,_0xa029d9))[_0x9818('0x3f')](handleError(_0x5740ca,null));};exports[_0x9818('0x40')]=function(_0x456f46,_0x781174){var _0xc055f8={'raw':![],'where':{'id':_0x456f46[_0x9818('0x41')]['id']}},_0xbdf229={};_0xbdf229[_0x9818('0x2a')]=_[_0x9818('0x2c')](db[_0x9818('0x26')][_0x9818('0x27')]);_0xbdf229['query']=_[_0x9818('0x2c')](_0x456f46[_0x9818('0x2b')]);_0xbdf229[_0x9818('0x2d')]=_[_0x9818('0x2e')](_0xbdf229[_0x9818('0x2a')],_0xbdf229[_0x9818('0x2b')]);_0xc055f8[_0x9818('0x2f')]=_[_0x9818('0x2e')](_0xbdf229[_0x9818('0x2a')],qs[_0x9818('0x30')](_0x456f46[_0x9818('0x2b')][_0x9818('0x30')]));_0xc055f8['attributes']=_0xc055f8[_0x9818('0x2f')][_0x9818('0x31')]?_0xc055f8[_0x9818('0x2f')]:_0xbdf229['model'];if(_0x456f46[_0x9818('0x2b')][_0x9818('0x3c')]){_0xc055f8[_0x9818('0x3d')]=[{'all':!![]}];}_0xc055f8=_[_0x9818('0x3a')]({},_0xc055f8,_0x456f46[_0x9818('0x3b')]);return db[_0x9818('0x26')][_0x9818('0x42')](_0xc055f8)[_0x9818('0x22')](handleEntityNotFound(_0x781174,null))['then'](respondWithResult(_0x781174,null))[_0x9818('0x3f')](handleError(_0x781174,null));};exports[_0x9818('0x43')]=function(_0x3e8382,_0x15d3c3){return db[_0x9818('0x26')][_0x9818('0x43')](_0x3e8382[_0x9818('0x44')],{})[_0x9818('0x22')](respondWithResult(_0x15d3c3,0xc9))[_0x9818('0x3f')](handleError(_0x15d3c3,null));};exports[_0x9818('0x21')]=function(_0x5a6cf8,_0x3e8445){if(_0x5a6cf8[_0x9818('0x44')]['id']){delete _0x5a6cf8[_0x9818('0x44')]['id'];}return db[_0x9818('0x26')]['find']({'where':{'id':_0x5a6cf8[_0x9818('0x41')]['id']}})[_0x9818('0x22')](handleEntityNotFound(_0x3e8445,null))['then'](saveUpdates(_0x5a6cf8['body'],null))['then'](respondWithResult(_0x3e8445,null))['catch'](handleError(_0x3e8445,null));};exports['destroy']=function(_0x358f2c,_0x1e14e2){return db[_0x9818('0x26')]['find']({'where':{'id':_0x358f2c[_0x9818('0x41')]['id']}})[_0x9818('0x22')](handleEntityNotFound(_0x1e14e2,null))[_0x9818('0x22')](removeEntity(_0x1e14e2,null))[_0x9818('0x3f')](handleError(_0x1e14e2,null));};exports[_0x9818('0x45')]=function(_0x1103a0,_0x3bd746,_0x212e47){var _0x210c17={};var _0x27be77={};var _0x5d17c0;var _0x42b3f4;return db['ZohoConfiguration'][_0x9818('0x46')]({'where':{'id':_0x1103a0['params']['id']}})[_0x9818('0x22')](handleEntityNotFound(_0x3bd746,null))[_0x9818('0x22')](function(_0xa42fd2){if(_0xa42fd2){_0x5d17c0=_0xa42fd2;_0x27be77['model']=_[_0x9818('0x2c')](db['ZohoField']['rawAttributes']);_0x27be77[_0x9818('0x2b')]=_['keys'](_0x1103a0[_0x9818('0x2b')]);_0x27be77[_0x9818('0x2d')]=_[_0x9818('0x2e')](_0x27be77['model'],_0x27be77[_0x9818('0x2b')]);_0x210c17[_0x9818('0x2f')]=_[_0x9818('0x2e')](_0x27be77[_0x9818('0x2a')],qs[_0x9818('0x30')](_0x1103a0['query'][_0x9818('0x30')]));_0x210c17[_0x9818('0x2f')]=_0x210c17[_0x9818('0x2f')][_0x9818('0x31')]?_0x210c17['attributes']:_0x27be77[_0x9818('0x2a')];_0x210c17[_0x9818('0x34')]=qs['sort'](_0x1103a0[_0x9818('0x2b')][_0x9818('0x35')]);_0x210c17['where']=qs[_0x9818('0x2d')](_['pick'](_0x1103a0[_0x9818('0x2b')],_0x27be77['filters']));if(_0x1103a0[_0x9818('0x2b')][_0x9818('0x37')]){_0x210c17[_0x9818('0x38')]=_[_0x9818('0x3a')](_0x210c17[_0x9818('0x38')],{'$or':_[_0x9818('0x25')](_0x210c17[_0x9818('0x2f')],function(_0x2d6c87){var _0x58f0bc={};_0x58f0bc[_0x2d6c87]={'$like':'%'+_0x1103a0['query'][_0x9818('0x37')]+'%'};return _0x58f0bc;})});}_0x210c17=_[_0x9818('0x3a')]({},_0x210c17,_0x1103a0[_0x9818('0x3b')]);return _0x5d17c0[_0x9818('0x45')](_0x210c17);}})['then'](function(_0x4aeebf){if(_0x4aeebf){_0x42b3f4=_0x4aeebf[_0x9818('0x31')];if(!_0x1103a0[_0x9818('0x2b')]['hasOwnProperty'](_0x9818('0x33'))){_0x210c17[_0x9818('0x1c')]=qs[_0x9818('0x1c')](_0x1103a0[_0x9818('0x2b')]['limit']);_0x210c17[_0x9818('0x1a')]=qs[_0x9818('0x1a')](_0x1103a0[_0x9818('0x2b')]['offset']);}return _0x5d17c0[_0x9818('0x45')](_0x210c17);}})[_0x9818('0x22')](function(_0x4e0e60){if(_0x4e0e60){return _0x4e0e60?{'count':_0x42b3f4,'rows':_0x4e0e60}:null;}})['then'](respondWithResult(_0x3bd746,null))[_0x9818('0x3f')](handleError(_0x3bd746,null));};exports[_0x9818('0x47')]=function(_0x1e76ed,_0x142afa,_0x52f50b){var _0x5a3698={};var _0x58ff06={};var _0x316ca3;var _0x4e8b5a;return db['ZohoConfiguration']['findOne']({'where':{'id':_0x1e76ed[_0x9818('0x41')]['id']}})[_0x9818('0x22')](handleEntityNotFound(_0x142afa,null))[_0x9818('0x22')](function(_0x4db7e2){if(_0x4db7e2){_0x316ca3=_0x4db7e2;_0x58ff06[_0x9818('0x2a')]=_[_0x9818('0x2c')](db[_0x9818('0x48')][_0x9818('0x27')]);_0x58ff06['query']=_['keys'](_0x1e76ed['query']);_0x58ff06[_0x9818('0x2d')]=_[_0x9818('0x2e')](_0x58ff06[_0x9818('0x2a')],_0x58ff06['query']);_0x5a3698['attributes']=_[_0x9818('0x2e')](_0x58ff06[_0x9818('0x2a')],qs[_0x9818('0x30')](_0x1e76ed[_0x9818('0x2b')][_0x9818('0x30')]));_0x5a3698[_0x9818('0x2f')]=_0x5a3698[_0x9818('0x2f')][_0x9818('0x31')]?_0x5a3698[_0x9818('0x2f')]:_0x58ff06[_0x9818('0x2a')];_0x5a3698[_0x9818('0x34')]=qs[_0x9818('0x35')](_0x1e76ed[_0x9818('0x2b')][_0x9818('0x35')]);_0x5a3698['where']=qs[_0x9818('0x2d')](_[_0x9818('0x36')](_0x1e76ed[_0x9818('0x2b')],_0x58ff06[_0x9818('0x2d')]));if(_0x1e76ed[_0x9818('0x2b')][_0x9818('0x37')]){_0x5a3698[_0x9818('0x38')]=_[_0x9818('0x3a')](_0x5a3698[_0x9818('0x38')],{'$or':_[_0x9818('0x25')](_0x5a3698[_0x9818('0x2f')],function(_0x333a06){var _0x54cf11={};_0x54cf11[_0x333a06]={'$like':'%'+_0x1e76ed[_0x9818('0x2b')]['filter']+'%'};return _0x54cf11;})});}_0x5a3698=_[_0x9818('0x3a')]({},_0x5a3698,_0x1e76ed['options']);return _0x316ca3[_0x9818('0x47')](_0x5a3698);}})['then'](function(_0x5842eb){if(_0x5842eb){_0x4e8b5a=_0x5842eb[_0x9818('0x31')];if(!_0x1e76ed[_0x9818('0x2b')][_0x9818('0x32')](_0x9818('0x33'))){_0x5a3698[_0x9818('0x1c')]=qs[_0x9818('0x1c')](_0x1e76ed[_0x9818('0x2b')]['limit']);_0x5a3698[_0x9818('0x1a')]=qs[_0x9818('0x1a')](_0x1e76ed[_0x9818('0x2b')]['offset']);}return _0x316ca3[_0x9818('0x47')](_0x5a3698);}})[_0x9818('0x22')](function(_0x4f26f5){if(_0x4f26f5){return _0x4f26f5?{'count':_0x4e8b5a,'rows':_0x4f26f5}:null;}})[_0x9818('0x22')](respondWithResult(_0x142afa,null))[_0x9818('0x3f')](handleError(_0x142afa,null));};exports[_0x9818('0x49')]=function(_0xe7bad1,_0x95e957,_0x359a12){var _0x5ac630={};var _0xe8ec18={};var _0x41ecdf;var _0x1c038f;return db[_0x9818('0x26')]['findOne']({'where':{'id':_0xe7bad1[_0x9818('0x41')]['id']}})[_0x9818('0x22')](handleEntityNotFound(_0x95e957,null))[_0x9818('0x22')](function(_0x3ad6e4){if(_0x3ad6e4){_0x41ecdf=_0x3ad6e4;_0xe8ec18[_0x9818('0x2a')]=_['keys'](db[_0x9818('0x48')][_0x9818('0x27')]);_0xe8ec18[_0x9818('0x2b')]=_['keys'](_0xe7bad1['query']);_0xe8ec18['filters']=_[_0x9818('0x2e')](_0xe8ec18[_0x9818('0x2a')],_0xe8ec18[_0x9818('0x2b')]);_0x5ac630[_0x9818('0x2f')]=_[_0x9818('0x2e')](_0xe8ec18[_0x9818('0x2a')],qs[_0x9818('0x30')](_0xe7bad1[_0x9818('0x2b')][_0x9818('0x30')]));_0x5ac630[_0x9818('0x2f')]=_0x5ac630[_0x9818('0x2f')][_0x9818('0x31')]?_0x5ac630[_0x9818('0x2f')]:_0xe8ec18['model'];_0x5ac630[_0x9818('0x34')]=qs['sort'](_0xe7bad1[_0x9818('0x2b')][_0x9818('0x35')]);_0x5ac630[_0x9818('0x38')]=qs[_0x9818('0x2d')](_[_0x9818('0x36')](_0xe7bad1[_0x9818('0x2b')],_0xe8ec18[_0x9818('0x2d')]));if(_0xe7bad1[_0x9818('0x2b')]['filter']){_0x5ac630['where']=_[_0x9818('0x3a')](_0x5ac630['where'],{'$or':_[_0x9818('0x25')](_0x5ac630[_0x9818('0x2f')],function(_0xe44e13){var _0x54bdce={};_0x54bdce[_0xe44e13]={'$like':'%'+_0xe7bad1[_0x9818('0x2b')][_0x9818('0x37')]+'%'};return _0x54bdce;})});}_0x5ac630=_[_0x9818('0x3a')]({},_0x5ac630,_0xe7bad1['options']);return _0x41ecdf['getDescriptions'](_0x5ac630);}})[_0x9818('0x22')](function(_0x2980af){if(_0x2980af){_0x1c038f=_0x2980af['length'];if(!_0xe7bad1[_0x9818('0x2b')][_0x9818('0x32')](_0x9818('0x33'))){_0x5ac630['limit']=qs['limit'](_0xe7bad1['query'][_0x9818('0x1c')]);_0x5ac630[_0x9818('0x1a')]=qs[_0x9818('0x1a')](_0xe7bad1[_0x9818('0x2b')]['offset']);}return _0x41ecdf[_0x9818('0x49')](_0x5ac630);}})[_0x9818('0x22')](function(_0x5a0212){if(_0x5a0212){return _0x5a0212?{'count':_0x1c038f,'rows':_0x5a0212}:null;}})[_0x9818('0x22')](respondWithResult(_0x95e957,null))['catch'](handleError(_0x95e957,null));}; \ No newline at end of file +var _0x5a32=['key','model','map','query','keys','filters','attributes','intersection','fields','order','pick','where','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','create','body','find','destroy','getFields','findOne','ZohoField','length','sort','nolimit','getSubjects','hasOwnProperty','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','reject','save','update','then','error','stack','name','send','index','ZohoConfiguration','rawAttributes','fieldName','type'];(function(_0x573f1d,_0x1b033e){var _0x2f55ba=function(_0x2b0346){while(--_0x2b0346){_0x573f1d['push'](_0x573f1d['shift']());}};_0x2f55ba(++_0x1b033e);}(_0x5a32,0x11d));var _0x25a3=function(_0x1a4b83,_0x132caa){_0x1a4b83=_0x1a4b83-0x0;var _0x138c43=_0x5a32[_0x1a4b83];return _0x138c43;};'use strict';var emlformat=require(_0x25a3('0x0'));var rimraf=require(_0x25a3('0x1'));var zipdir=require(_0x25a3('0x2'));var jsonpatch=require(_0x25a3('0x3'));var rp=require(_0x25a3('0x4'));var moment=require(_0x25a3('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x25a3('0x6'));var util=require(_0x25a3('0x7'));var path=require(_0x25a3('0x8'));var sox=require('sox');var csv=require(_0x25a3('0x9'));var ejs=require(_0x25a3('0xa'));var fs=require('fs');var fs_extra=require(_0x25a3('0xb'));var _=require(_0x25a3('0xc'));var squel=require(_0x25a3('0xd'));var crypto=require('crypto');var jsforce=require(_0x25a3('0xe'));var deskjs=require(_0x25a3('0xf'));var toCsv=require(_0x25a3('0x9'));var querystring=require(_0x25a3('0x10'));var Papa=require(_0x25a3('0x11'));var Redis=require(_0x25a3('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x25a3('0x13'));var hardwareService=require(_0x25a3('0x14'));var logger=require(_0x25a3('0x15'))(_0x25a3('0x16'));var utils=require('../../config/utils');var config=require(_0x25a3('0x17'));var licenseUtil=require(_0x25a3('0x18'));var db=require(_0x25a3('0x19'))['db'];function respondWithStatusCode(_0x2d53b8,_0x3de528){_0x3de528=_0x3de528||0xcc;return function(_0x4a1863){if(_0x4a1863){return _0x2d53b8[_0x25a3('0x1a')](_0x3de528);}return _0x2d53b8[_0x25a3('0x1b')](_0x3de528)[_0x25a3('0x1c')]();};}function respondWithResult(_0x1172c4,_0x115512){_0x115512=_0x115512||0xc8;return function(_0x1c2f05){if(_0x1c2f05){return _0x1172c4[_0x25a3('0x1b')](_0x115512)[_0x25a3('0x1d')](_0x1c2f05);}};}function respondWithFilteredResult(_0x58c3d4,_0x1aaf5e){return function(_0x1fd994){if(_0x1fd994){var _0x3c43b2=typeof _0x1aaf5e[_0x25a3('0x1e')]===_0x25a3('0x1f')&&typeof _0x1aaf5e[_0x25a3('0x20')]===_0x25a3('0x1f');var _0x5caaf7=_0x1fd994['count'];var _0x2138f7=_0x3c43b2?0x0:_0x1aaf5e[_0x25a3('0x1e')];var _0x2414e6=_0x3c43b2?_0x1fd994[_0x25a3('0x21')]:_0x1aaf5e[_0x25a3('0x1e')]+_0x1aaf5e[_0x25a3('0x20')];var _0xeade1d;if(_0x2414e6>=_0x5caaf7){_0x2414e6=_0x5caaf7;_0xeade1d=0xc8;}else{_0xeade1d=0xce;}_0x58c3d4['status'](_0xeade1d);return _0x58c3d4['set']('Content-Range',_0x2138f7+'-'+_0x2414e6+'/'+_0x5caaf7)[_0x25a3('0x1d')](_0x1fd994);}return null;};}function patchUpdates(_0x4ec5c1){return function(_0xd8c33a){try{jsonpatch['apply'](_0xd8c33a,_0x4ec5c1,!![]);}catch(_0xcf44c0){return BPromise[_0x25a3('0x22')](_0xcf44c0);}return _0xd8c33a[_0x25a3('0x23')]();};}function saveUpdates(_0xad4472,_0x4ae9ee){return function(_0x4413b6){if(_0x4413b6){return _0x4413b6[_0x25a3('0x24')](_0xad4472)[_0x25a3('0x25')](function(_0x355ccd){return _0x355ccd;});}return null;};}function removeEntity(_0x4f1c2e,_0x328037){return function(_0xd8ac33){if(_0xd8ac33){return _0xd8ac33['destroy']()[_0x25a3('0x25')](function(){_0x4f1c2e[_0x25a3('0x1b')](0xcc)[_0x25a3('0x1c')]();});}};}function handleEntityNotFound(_0x4eb647,_0x1e047b){return function(_0x404a99){if(!_0x404a99){_0x4eb647['sendStatus'](0x194);}return _0x404a99;};}function handleError(_0x513620,_0x34acbb){_0x34acbb=_0x34acbb||0x1f4;return function(_0x4ae6bf){logger[_0x25a3('0x26')](_0x4ae6bf[_0x25a3('0x27')]);if(_0x4ae6bf[_0x25a3('0x28')]){delete _0x4ae6bf['name'];}_0x513620['status'](_0x34acbb)[_0x25a3('0x29')](_0x4ae6bf);};}exports[_0x25a3('0x2a')]=function(_0x551e75,_0x24398b){var _0x577e11={},_0x3fd4a8={},_0x1bdce5={'count':0x0,'rows':[]};var _0x18d32a=_['map'](db[_0x25a3('0x2b')][_0x25a3('0x2c')],function(_0x307800){return{'name':_0x307800[_0x25a3('0x2d')],'type':_0x307800[_0x25a3('0x2e')][_0x25a3('0x2f')]};});_0x3fd4a8[_0x25a3('0x30')]=_[_0x25a3('0x31')](_0x18d32a,_0x25a3('0x28'));_0x3fd4a8[_0x25a3('0x32')]=_[_0x25a3('0x33')](_0x551e75[_0x25a3('0x32')]);_0x3fd4a8[_0x25a3('0x34')]=_['intersection'](_0x3fd4a8['model'],_0x3fd4a8[_0x25a3('0x32')]);_0x577e11[_0x25a3('0x35')]=_[_0x25a3('0x36')](_0x3fd4a8[_0x25a3('0x30')],qs['fields'](_0x551e75[_0x25a3('0x32')][_0x25a3('0x37')]));_0x577e11['attributes']=_0x577e11[_0x25a3('0x35')]['length']?_0x577e11[_0x25a3('0x35')]:_0x3fd4a8['model'];if(!_0x551e75[_0x25a3('0x32')]['hasOwnProperty']('nolimit')){_0x577e11['limit']=qs['limit'](_0x551e75[_0x25a3('0x32')]['limit']);_0x577e11[_0x25a3('0x1e')]=qs[_0x25a3('0x1e')](_0x551e75[_0x25a3('0x32')][_0x25a3('0x1e')]);}_0x577e11[_0x25a3('0x38')]=qs['sort'](_0x551e75[_0x25a3('0x32')]['sort']);_0x577e11['where']=qs[_0x25a3('0x34')](_[_0x25a3('0x39')](_0x551e75[_0x25a3('0x32')],_0x3fd4a8[_0x25a3('0x34')]),_0x18d32a);if(_0x551e75[_0x25a3('0x32')]['filter']){_0x577e11['where']=_['merge'](_0x577e11[_0x25a3('0x3a')],{'$or':_[_0x25a3('0x31')](_0x18d32a,function(_0x30aba1){if(_0x30aba1[_0x25a3('0x2e')]!==_0x25a3('0x3b')){var _0x1cfe21={};_0x1cfe21[_0x30aba1[_0x25a3('0x28')]]={'$like':'%'+_0x551e75[_0x25a3('0x32')][_0x25a3('0x3c')]+'%'};return _0x1cfe21;}})});}_0x577e11=_[_0x25a3('0x3d')]({},_0x577e11,_0x551e75[_0x25a3('0x3e')]);var _0x4bdf4c={'where':_0x577e11[_0x25a3('0x3a')]};return db[_0x25a3('0x2b')][_0x25a3('0x21')](_0x4bdf4c)[_0x25a3('0x25')](function(_0x8e1956){_0x1bdce5[_0x25a3('0x21')]=_0x8e1956;if(_0x551e75[_0x25a3('0x32')][_0x25a3('0x3f')]){_0x577e11[_0x25a3('0x40')]=[{'all':!![]}];}return db[_0x25a3('0x2b')][_0x25a3('0x41')](_0x577e11);})[_0x25a3('0x25')](function(_0xf42eea){_0x1bdce5[_0x25a3('0x42')]=_0xf42eea;return _0x1bdce5;})[_0x25a3('0x25')](respondWithFilteredResult(_0x24398b,_0x577e11))[_0x25a3('0x43')](handleError(_0x24398b,null));};exports[_0x25a3('0x44')]=function(_0x260e24,_0x4fe884){var _0x1294ab={'raw':![],'where':{'id':_0x260e24[_0x25a3('0x45')]['id']}},_0x11967a={};_0x11967a['model']=_[_0x25a3('0x33')](db['ZohoConfiguration'][_0x25a3('0x2c')]);_0x11967a[_0x25a3('0x32')]=_[_0x25a3('0x33')](_0x260e24['query']);_0x11967a['filters']=_[_0x25a3('0x36')](_0x11967a['model'],_0x11967a[_0x25a3('0x32')]);_0x1294ab[_0x25a3('0x35')]=_['intersection'](_0x11967a[_0x25a3('0x30')],qs[_0x25a3('0x37')](_0x260e24[_0x25a3('0x32')][_0x25a3('0x37')]));_0x1294ab[_0x25a3('0x35')]=_0x1294ab[_0x25a3('0x35')]['length']?_0x1294ab[_0x25a3('0x35')]:_0x11967a[_0x25a3('0x30')];if(_0x260e24[_0x25a3('0x32')][_0x25a3('0x3f')]){_0x1294ab[_0x25a3('0x40')]=[{'all':!![]}];}_0x1294ab=_[_0x25a3('0x3d')]({},_0x1294ab,_0x260e24[_0x25a3('0x3e')]);return db['ZohoConfiguration']['find'](_0x1294ab)['then'](handleEntityNotFound(_0x4fe884,null))['then'](respondWithResult(_0x4fe884,null))[_0x25a3('0x43')](handleError(_0x4fe884,null));};exports[_0x25a3('0x46')]=function(_0x614ed7,_0x1c64dd){return db[_0x25a3('0x2b')][_0x25a3('0x46')](_0x614ed7[_0x25a3('0x47')],{})[_0x25a3('0x25')](respondWithResult(_0x1c64dd,0xc9))['catch'](handleError(_0x1c64dd,null));};exports[_0x25a3('0x24')]=function(_0x11b16c,_0x3958b4){if(_0x11b16c[_0x25a3('0x47')]['id']){delete _0x11b16c[_0x25a3('0x47')]['id'];}return db[_0x25a3('0x2b')][_0x25a3('0x48')]({'where':{'id':_0x11b16c[_0x25a3('0x45')]['id']}})[_0x25a3('0x25')](handleEntityNotFound(_0x3958b4,null))[_0x25a3('0x25')](saveUpdates(_0x11b16c[_0x25a3('0x47')],null))[_0x25a3('0x25')](respondWithResult(_0x3958b4,null))[_0x25a3('0x43')](handleError(_0x3958b4,null));};exports[_0x25a3('0x49')]=function(_0x55f629,_0x235026){return db[_0x25a3('0x2b')][_0x25a3('0x48')]({'where':{'id':_0x55f629[_0x25a3('0x45')]['id']}})[_0x25a3('0x25')](handleEntityNotFound(_0x235026,null))[_0x25a3('0x25')](removeEntity(_0x235026,null))[_0x25a3('0x43')](handleError(_0x235026,null));};exports[_0x25a3('0x4a')]=function(_0x4b9ef0,_0x51a3eb,_0x38d18d){var _0x1b1e87={};var _0x5a8392={};var _0x45b119;var _0x3dafbd;return db[_0x25a3('0x2b')][_0x25a3('0x4b')]({'where':{'id':_0x4b9ef0[_0x25a3('0x45')]['id']}})[_0x25a3('0x25')](handleEntityNotFound(_0x51a3eb,null))[_0x25a3('0x25')](function(_0x2fec7e){if(_0x2fec7e){_0x45b119=_0x2fec7e;_0x5a8392[_0x25a3('0x30')]=_[_0x25a3('0x33')](db[_0x25a3('0x4c')][_0x25a3('0x2c')]);_0x5a8392[_0x25a3('0x32')]=_[_0x25a3('0x33')](_0x4b9ef0[_0x25a3('0x32')]);_0x5a8392[_0x25a3('0x34')]=_['intersection'](_0x5a8392['model'],_0x5a8392['query']);_0x1b1e87[_0x25a3('0x35')]=_[_0x25a3('0x36')](_0x5a8392[_0x25a3('0x30')],qs[_0x25a3('0x37')](_0x4b9ef0[_0x25a3('0x32')]['fields']));_0x1b1e87[_0x25a3('0x35')]=_0x1b1e87[_0x25a3('0x35')][_0x25a3('0x4d')]?_0x1b1e87[_0x25a3('0x35')]:_0x5a8392[_0x25a3('0x30')];_0x1b1e87[_0x25a3('0x38')]=qs[_0x25a3('0x4e')](_0x4b9ef0[_0x25a3('0x32')]['sort']);_0x1b1e87[_0x25a3('0x3a')]=qs['filters'](_[_0x25a3('0x39')](_0x4b9ef0[_0x25a3('0x32')],_0x5a8392[_0x25a3('0x34')]));if(_0x4b9ef0[_0x25a3('0x32')][_0x25a3('0x3c')]){_0x1b1e87[_0x25a3('0x3a')]=_['merge'](_0x1b1e87[_0x25a3('0x3a')],{'$or':_[_0x25a3('0x31')](_0x1b1e87[_0x25a3('0x35')],function(_0x3d24a6){var _0x242f96={};_0x242f96[_0x3d24a6]={'$like':'%'+_0x4b9ef0[_0x25a3('0x32')]['filter']+'%'};return _0x242f96;})});}_0x1b1e87=_[_0x25a3('0x3d')]({},_0x1b1e87,_0x4b9ef0['options']);return _0x45b119[_0x25a3('0x4a')](_0x1b1e87);}})[_0x25a3('0x25')](function(_0x38491e){if(_0x38491e){_0x3dafbd=_0x38491e[_0x25a3('0x4d')];if(!_0x4b9ef0['query']['hasOwnProperty'](_0x25a3('0x4f'))){_0x1b1e87[_0x25a3('0x20')]=qs['limit'](_0x4b9ef0[_0x25a3('0x32')][_0x25a3('0x20')]);_0x1b1e87[_0x25a3('0x1e')]=qs[_0x25a3('0x1e')](_0x4b9ef0[_0x25a3('0x32')]['offset']);}return _0x45b119[_0x25a3('0x4a')](_0x1b1e87);}})['then'](function(_0x403610){if(_0x403610){return _0x403610?{'count':_0x3dafbd,'rows':_0x403610}:null;}})[_0x25a3('0x25')](respondWithResult(_0x51a3eb,null))[_0x25a3('0x43')](handleError(_0x51a3eb,null));};exports[_0x25a3('0x50')]=function(_0x31a7bb,_0x19040c,_0x15ebee){var _0x37e48b={};var _0x29815b={};var _0x5b2df8;var _0x281e9a;return db['ZohoConfiguration'][_0x25a3('0x4b')]({'where':{'id':_0x31a7bb[_0x25a3('0x45')]['id']}})['then'](handleEntityNotFound(_0x19040c,null))[_0x25a3('0x25')](function(_0x2c1cf5){if(_0x2c1cf5){_0x5b2df8=_0x2c1cf5;_0x29815b[_0x25a3('0x30')]=_['keys'](db['ZohoField'][_0x25a3('0x2c')]);_0x29815b['query']=_[_0x25a3('0x33')](_0x31a7bb['query']);_0x29815b[_0x25a3('0x34')]=_[_0x25a3('0x36')](_0x29815b['model'],_0x29815b[_0x25a3('0x32')]);_0x37e48b[_0x25a3('0x35')]=_['intersection'](_0x29815b[_0x25a3('0x30')],qs['fields'](_0x31a7bb[_0x25a3('0x32')]['fields']));_0x37e48b[_0x25a3('0x35')]=_0x37e48b['attributes'][_0x25a3('0x4d')]?_0x37e48b[_0x25a3('0x35')]:_0x29815b['model'];_0x37e48b['order']=qs[_0x25a3('0x4e')](_0x31a7bb[_0x25a3('0x32')][_0x25a3('0x4e')]);_0x37e48b[_0x25a3('0x3a')]=qs[_0x25a3('0x34')](_['pick'](_0x31a7bb['query'],_0x29815b[_0x25a3('0x34')]));if(_0x31a7bb['query'][_0x25a3('0x3c')]){_0x37e48b[_0x25a3('0x3a')]=_[_0x25a3('0x3d')](_0x37e48b[_0x25a3('0x3a')],{'$or':_[_0x25a3('0x31')](_0x37e48b[_0x25a3('0x35')],function(_0x2295ad){var _0x16a2c9={};_0x16a2c9[_0x2295ad]={'$like':'%'+_0x31a7bb[_0x25a3('0x32')]['filter']+'%'};return _0x16a2c9;})});}_0x37e48b=_[_0x25a3('0x3d')]({},_0x37e48b,_0x31a7bb['options']);return _0x5b2df8['getSubjects'](_0x37e48b);}})[_0x25a3('0x25')](function(_0x38b643){if(_0x38b643){_0x281e9a=_0x38b643[_0x25a3('0x4d')];if(!_0x31a7bb[_0x25a3('0x32')][_0x25a3('0x51')](_0x25a3('0x4f'))){_0x37e48b['limit']=qs[_0x25a3('0x20')](_0x31a7bb['query'][_0x25a3('0x20')]);_0x37e48b[_0x25a3('0x1e')]=qs[_0x25a3('0x1e')](_0x31a7bb[_0x25a3('0x32')][_0x25a3('0x1e')]);}return _0x5b2df8[_0x25a3('0x50')](_0x37e48b);}})[_0x25a3('0x25')](function(_0x4130e5){if(_0x4130e5){return _0x4130e5?{'count':_0x281e9a,'rows':_0x4130e5}:null;}})[_0x25a3('0x25')](respondWithResult(_0x19040c,null))['catch'](handleError(_0x19040c,null));};exports[_0x25a3('0x52')]=function(_0x4381e,_0x97ee84,_0x49f251){var _0x81bfff={};var _0x5cec61={};var _0x2b058a;var _0xa6599c;return db[_0x25a3('0x2b')][_0x25a3('0x4b')]({'where':{'id':_0x4381e[_0x25a3('0x45')]['id']}})[_0x25a3('0x25')](handleEntityNotFound(_0x97ee84,null))[_0x25a3('0x25')](function(_0x24de0d){if(_0x24de0d){_0x2b058a=_0x24de0d;_0x5cec61[_0x25a3('0x30')]=_[_0x25a3('0x33')](db['ZohoField'][_0x25a3('0x2c')]);_0x5cec61['query']=_[_0x25a3('0x33')](_0x4381e[_0x25a3('0x32')]);_0x5cec61['filters']=_[_0x25a3('0x36')](_0x5cec61[_0x25a3('0x30')],_0x5cec61[_0x25a3('0x32')]);_0x81bfff[_0x25a3('0x35')]=_[_0x25a3('0x36')](_0x5cec61['model'],qs[_0x25a3('0x37')](_0x4381e[_0x25a3('0x32')][_0x25a3('0x37')]));_0x81bfff['attributes']=_0x81bfff[_0x25a3('0x35')][_0x25a3('0x4d')]?_0x81bfff[_0x25a3('0x35')]:_0x5cec61[_0x25a3('0x30')];_0x81bfff[_0x25a3('0x38')]=qs[_0x25a3('0x4e')](_0x4381e[_0x25a3('0x32')]['sort']);_0x81bfff[_0x25a3('0x3a')]=qs[_0x25a3('0x34')](_[_0x25a3('0x39')](_0x4381e['query'],_0x5cec61[_0x25a3('0x34')]));if(_0x4381e[_0x25a3('0x32')][_0x25a3('0x3c')]){_0x81bfff[_0x25a3('0x3a')]=_[_0x25a3('0x3d')](_0x81bfff[_0x25a3('0x3a')],{'$or':_[_0x25a3('0x31')](_0x81bfff[_0x25a3('0x35')],function(_0x45553b){var _0x36a809={};_0x36a809[_0x45553b]={'$like':'%'+_0x4381e[_0x25a3('0x32')]['filter']+'%'};return _0x36a809;})});}_0x81bfff=_[_0x25a3('0x3d')]({},_0x81bfff,_0x4381e[_0x25a3('0x3e')]);return _0x2b058a['getDescriptions'](_0x81bfff);}})[_0x25a3('0x25')](function(_0x31c800){if(_0x31c800){_0xa6599c=_0x31c800[_0x25a3('0x4d')];if(!_0x4381e[_0x25a3('0x32')][_0x25a3('0x51')]('nolimit')){_0x81bfff[_0x25a3('0x20')]=qs['limit'](_0x4381e[_0x25a3('0x32')][_0x25a3('0x20')]);_0x81bfff['offset']=qs[_0x25a3('0x1e')](_0x4381e[_0x25a3('0x32')][_0x25a3('0x1e')]);}return _0x2b058a[_0x25a3('0x52')](_0x81bfff);}})[_0x25a3('0x25')](function(_0x120284){if(_0x120284){return _0x120284?{'count':_0xa6599c,'rows':_0x120284}:null;}})[_0x25a3('0x25')](respondWithResult(_0x97ee84,null))['catch'](handleError(_0x97ee84,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index c011ce1..9d2b8cb 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 _0x2a3f=['./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','int_zoho_configurations','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x4b0ce4,_0xf7fc8a){var _0x1e441a=function(_0xc99a4d){while(--_0xc99a4d){_0x4b0ce4['push'](_0x4b0ce4['shift']());}};_0x1e441a(++_0xf7fc8a);}(_0x2a3f,0x1b5));var _0xf2a3=function(_0x4c3ece,_0x57053e){_0x4c3ece=_0x4c3ece-0x0;var _0x409c1d=_0x2a3f[_0x4c3ece];return _0x409c1d;};'use strict';var _=require(_0xf2a3('0x0'));var util=require(_0xf2a3('0x1'));var logger=require('../../config/logger')(_0xf2a3('0x2'));var moment=require(_0xf2a3('0x3'));var BPromise=require(_0xf2a3('0x4'));var rp=require(_0xf2a3('0x5'));var fs=require('fs');var path=require(_0xf2a3('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf2a3('0x7'));module[_0xf2a3('0x8')]=function(_0x1f4313,_0x1246b0){return _0x1f4313[_0xf2a3('0x9')](_0xf2a3('0xa'),attributes,{'tableName':_0xf2a3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbc2a=['request-promise','path','rimraf','../../config/environment','exports','define','ZohoConfiguration','int_zoho_configurations','lodash','util','../../config/logger','api','moment'];(function(_0x130c00,_0x80418e){var _0x1f582d=function(_0x39a208){while(--_0x39a208){_0x130c00['push'](_0x130c00['shift']());}};_0x1f582d(++_0x80418e);}(_0xbc2a,0x133));var _0xabc2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbc2a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xabc2('0x0'));var util=require(_0xabc2('0x1'));var logger=require(_0xabc2('0x2'))(_0xabc2('0x3'));var moment=require(_0xabc2('0x4'));var BPromise=require('bluebird');var rp=require(_0xabc2('0x5'));var fs=require('fs');var path=require(_0xabc2('0x6'));var rimraf=require(_0xabc2('0x7'));var config=require(_0xabc2('0x8'));var attributes=require('./intZohoConfiguration.attributes');module[_0xabc2('0x9')]=function(_0x558b0b,_0x41302f){return _0x558b0b[_0xabc2('0xa')](_0xabc2('0xb'),attributes,{'tableName':_0xabc2('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 5af5b7d..dad8c3b 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 _0xa18c=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','error','code','ZohoConfiguration,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird'];(function(_0x29d802,_0x12878c){var _0x36dd2d=function(_0x26ba77){while(--_0x26ba77){_0x29d802['push'](_0x29d802['shift']());}};_0x36dd2d(++_0x12878c);}(_0xa18c,0x1c9));var _0xca18=function(_0x36bb93,_0xd98721){_0x36bb93=_0x36bb93-0x0;var _0x3cabb5=_0xa18c[_0x36bb93];return _0x3cabb5;};'use strict';var _=require(_0xca18('0x0'));var util=require('util');var moment=require(_0xca18('0x1'));var BPromise=require(_0xca18('0x2'));var rs=require(_0xca18('0x3'));var fs=require('fs');var Redis=require(_0xca18('0x4'));var db=require(_0xca18('0x5'))['db'];var utils=require(_0xca18('0x6'));var logger=require(_0xca18('0x7'))(_0xca18('0x8'));var config=require('../../config/environment');var jayson=require(_0xca18('0x9'));var client=jayson[_0xca18('0xa')][_0xca18('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x549724,_0x5a1bee,_0x446c10){return new BPromise(function(_0x421c7d,_0x20eb26){return client[_0xca18('0xc')](_0x549724,_0x446c10)['then'](function(_0x561502){logger[_0xca18('0xd')]('ZohoConfiguration,\x20%s,\x20%s',_0x5a1bee,_0xca18('0xe'));logger[_0xca18('0xf')](_0xca18('0x10'),_0x5a1bee,_0xca18('0xe'),JSON['stringify'](_0x561502));if(_0x561502[_0xca18('0x11')]){if(_0x561502[_0xca18('0x11')][_0xca18('0x12')]===0x1f4){logger[_0xca18('0x11')](_0xca18('0x13'),_0x5a1bee,_0x561502[_0xca18('0x11')]['message']);return _0x20eb26(_0x561502[_0xca18('0x11')]['message']);}logger[_0xca18('0x11')]('ZohoConfiguration,\x20%s,\x20%s',_0x5a1bee,_0x561502['error'][_0xca18('0x14')]);return _0x421c7d(_0x561502[_0xca18('0x11')][_0xca18('0x14')]);}else{logger['info'](_0xca18('0x13'),_0x5a1bee,_0xca18('0xe'));_0x421c7d(_0x561502[_0xca18('0x15')]['message']);}})[_0xca18('0x16')](function(_0x432c77){logger[_0xca18('0x11')](_0xca18('0x13'),_0x5a1bee,_0x432c77);_0x20eb26(_0x432c77);});});} \ No newline at end of file +var _0x680a=['http','request','then','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x680a,0x1eb));var _0xa680=function(_0x54394e,_0x5d85f1){_0x54394e=_0x54394e-0x0;var _0x2fd92b=_0x680a[_0x54394e];return _0x2fd92b;};'use strict';var _=require(_0xa680('0x0'));var util=require(_0xa680('0x1'));var moment=require('moment');var BPromise=require(_0xa680('0x2'));var rs=require(_0xa680('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa680('0x4'));var logger=require(_0xa680('0x5'))(_0xa680('0x6'));var config=require(_0xa680('0x7'));var jayson=require(_0xa680('0x8'));var client=jayson['client'][_0xa680('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x539317,_0x544c24,_0x3b3166){return new BPromise(function(_0x5f38c6,_0x1fc085){return client[_0xa680('0xa')](_0x539317,_0x3b3166)[_0xa680('0xb')](function(_0x521d30){logger['info'](_0xa680('0xc'),_0x544c24,_0xa680('0xd'));logger['debug'](_0xa680('0xe'),_0x544c24,_0xa680('0xd'),JSON[_0xa680('0xf')](_0x521d30));if(_0x521d30['error']){if(_0x521d30['error']['code']===0x1f4){logger[_0xa680('0x10')]('ZohoConfiguration,\x20%s,\x20%s',_0x544c24,_0x521d30[_0xa680('0x10')][_0xa680('0x11')]);return _0x1fc085(_0x521d30[_0xa680('0x10')][_0xa680('0x11')]);}logger[_0xa680('0x10')](_0xa680('0xc'),_0x544c24,_0x521d30[_0xa680('0x10')][_0xa680('0x11')]);return _0x5f38c6(_0x521d30[_0xa680('0x10')][_0xa680('0x11')]);}else{logger[_0xa680('0x12')](_0xa680('0xc'),_0x544c24,_0xa680('0xd'));_0x5f38c6(_0x521d30['result'][_0xa680('0x11')]);}})[_0xa680('0x13')](function(_0x1d1886){logger['error']('ZohoConfiguration,\x20%s,\x20%s',_0x544c24,_0x1d1886);_0x1fc085(_0x1d1886);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index a4980d3..2611a71 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 _0x98c7=['post','create','update','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id'];(function(_0x6baee6,_0x2e9e55){var _0x29d246=function(_0x39bbf2){while(--_0x39bbf2){_0x6baee6['push'](_0x6baee6['shift']());}};_0x29d246(++_0x2e9e55);}(_0x98c7,0x1f1));var _0x798c=function(_0x23e6bb,_0x5c2d69){_0x23e6bb=_0x23e6bb-0x0;var _0x1e3b4c=_0x98c7[_0x23e6bb];return _0x1e3b4c;};'use strict';var multer=require(_0x798c('0x0'));var util=require('util');var path=require(_0x798c('0x1'));var timeout=require(_0x798c('0x2'));var express=require(_0x798c('0x3'));var router=express[_0x798c('0x4')]();var fs_extra=require(_0x798c('0x5'));var auth=require(_0x798c('0x6'));var interaction=require(_0x798c('0x7'));var config=require(_0x798c('0x8'));var controller=require('./intZohoField.controller');router[_0x798c('0x9')]('/',auth[_0x798c('0xa')](),controller[_0x798c('0xb')]);router[_0x798c('0x9')](_0x798c('0xc'),auth[_0x798c('0xa')](),controller['show']);router[_0x798c('0xd')]('/',auth[_0x798c('0xa')](),controller[_0x798c('0xe')]);router['put'](_0x798c('0xc'),auth['isAuthenticated'](),controller[_0x798c('0xf')]);router['delete'](_0x798c('0xc'),auth[_0x798c('0xa')](),controller['destroy']);module[_0x798c('0x10')]=router; \ No newline at end of file +var _0x2bbd=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0x2bbd,0x135));var _0xd2bb=function(_0x308f69,_0x281412){_0x308f69=_0x308f69-0x0;var _0x5353e8=_0x2bbd[_0x308f69];return _0x5353e8;};'use strict';var multer=require(_0xd2bb('0x0'));var util=require(_0xd2bb('0x1'));var path=require(_0xd2bb('0x2'));var timeout=require(_0xd2bb('0x3'));var express=require(_0xd2bb('0x4'));var router=express[_0xd2bb('0x5')]();var fs_extra=require(_0xd2bb('0x6'));var auth=require(_0xd2bb('0x7'));var interaction=require(_0xd2bb('0x8'));var config=require(_0xd2bb('0x9'));var controller=require(_0xd2bb('0xa'));router[_0xd2bb('0xb')]('/',auth[_0xd2bb('0xc')](),controller['index']);router[_0xd2bb('0xb')](_0xd2bb('0xd'),auth[_0xd2bb('0xc')](),controller[_0xd2bb('0xe')]);router[_0xd2bb('0xf')]('/',auth[_0xd2bb('0xc')](),controller[_0xd2bb('0x10')]);router[_0xd2bb('0x11')](_0xd2bb('0xd'),auth[_0xd2bb('0xc')](),controller[_0xd2bb('0x12')]);router[_0xd2bb('0x13')](_0xd2bb('0xd'),auth[_0xd2bb('0xc')](),controller['destroy']);module[_0xd2bb('0x14')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index 8f9dee8..4542016 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 _0x671b=['STRING','ENUM','exports','variable','customVariable','keyValue','picklist','string'];(function(_0x4dab6e,_0x42a95b){var _0x5539d7=function(_0xbdfdfa){while(--_0xbdfdfa){_0x4dab6e['push'](_0x4dab6e['shift']());}};_0x5539d7(++_0x42a95b);}(_0x671b,0x10a));var _0xb671=function(_0x313811,_0x2842f5){_0x313811=_0x313811-0x0;var _0x1d6702=_0x671b[_0x313811];return _0x1d6702;};'use strict';var Sequelize=require('sequelize');module[_0xb671('0x0')]={'type':{'type':Sequelize['ENUM']('string',_0xb671('0x1'),_0xb671('0x2'),_0xb671('0x3'),_0xb671('0x4')),'defaultValue':_0xb671('0x5')},'content':{'type':Sequelize[_0xb671('0x6')]},'key':{'type':Sequelize[_0xb671('0x6')]},'keyType':{'type':Sequelize[_0xb671('0x7')](_0xb671('0x5'),'variable',_0xb671('0x2'))},'keyContent':{'type':Sequelize[_0xb671('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xb671('0x6')]}}; \ No newline at end of file +var _0x3b72=['keyValue','picklist','STRING','string','BOOLEAN','exports','ENUM','variable','customVariable'];(function(_0x49fac5,_0x410d28){var _0x2f0b73=function(_0x4a215e){while(--_0x4a215e){_0x49fac5['push'](_0x49fac5['shift']());}};_0x2f0b73(++_0x410d28);}(_0x3b72,0x11c));var _0x23b7=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x3b72[_0x3b380d];return _0x54502b;};'use strict';var Sequelize=require('sequelize');module[_0x23b7('0x0')]={'type':{'type':Sequelize[_0x23b7('0x1')]('string',_0x23b7('0x2'),_0x23b7('0x3'),_0x23b7('0x4'),_0x23b7('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x23b7('0x6')]},'key':{'type':Sequelize[_0x23b7('0x6')]},'keyType':{'type':Sequelize[_0x23b7('0x1')](_0x23b7('0x7'),_0x23b7('0x2'),_0x23b7('0x3'))},'keyContent':{'type':Sequelize[_0x23b7('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x23b7('0x6')]},'customField':{'type':Sequelize[_0x23b7('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x23b7('0x6')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index 78b5f0f..2906442 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 _0x26c8=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','end','offset','undefined','count','limit','status','set','Content-Range','json','update','destroy','then','sendStatus','name','send','index','map','ZohoField','rawAttributes','fieldName','type','key','model','keys','query','intersection','fields','attributes','length','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','includeAll','rows','show','params','include','options','find','catch','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','squel','crypto','jsforce','desk.js'];(function(_0x5c2f8e,_0x1a05a2){var _0xb2d0a=function(_0x3cecd5){while(--_0x3cecd5){_0x5c2f8e['push'](_0x5c2f8e['shift']());}};_0xb2d0a(++_0x1a05a2);}(_0x26c8,0xc9));var _0x826c=function(_0x501d6a,_0x47b2c6){_0x501d6a=_0x501d6a-0x0;var _0x3c88ac=_0x26c8[_0x501d6a];return _0x3c88ac;};'use strict';var emlformat=require(_0x826c('0x0'));var rimraf=require(_0x826c('0x1'));var zipdir=require(_0x826c('0x2'));var jsonpatch=require(_0x826c('0x3'));var rp=require(_0x826c('0x4'));var moment=require(_0x826c('0x5'));var BPromise=require(_0x826c('0x6'));var Mustache=require(_0x826c('0x7'));var util=require(_0x826c('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x826c('0x9'));var ejs=require(_0x826c('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x826c('0xb'));var crypto=require(_0x826c('0xc'));var jsforce=require(_0x826c('0xd'));var deskjs=require(_0x826c('0xe'));var toCsv=require(_0x826c('0x9'));var querystring=require(_0x826c('0xf'));var Papa=require(_0x826c('0x10'));var Redis=require(_0x826c('0x11'));var authService=require(_0x826c('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x826c('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x826c('0x14'))(_0x826c('0x15'));var utils=require(_0x826c('0x16'));var config=require(_0x826c('0x17'));var licenseUtil=require(_0x826c('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x349029,_0x34e8f4){_0x34e8f4=_0x34e8f4||0xcc;return function(_0x4d922f){if(_0x4d922f){return _0x349029['sendStatus'](_0x34e8f4);}return _0x349029['status'](_0x34e8f4)[_0x826c('0x19')]();};}function respondWithResult(_0x162e67,_0x309cbf){_0x309cbf=_0x309cbf||0xc8;return function(_0x317a85){if(_0x317a85){return _0x162e67['status'](_0x309cbf)['json'](_0x317a85);}};}function respondWithFilteredResult(_0x59fc01,_0xdc370e){return function(_0x1e82e5){if(_0x1e82e5){var _0x13fc9=typeof _0xdc370e[_0x826c('0x1a')]===_0x826c('0x1b')&&typeof _0xdc370e['limit']===_0x826c('0x1b');var _0x3cbd2a=_0x1e82e5['count'];var _0x4e3899=_0x13fc9?0x0:_0xdc370e['offset'];var _0x5867e5=_0x13fc9?_0x1e82e5[_0x826c('0x1c')]:_0xdc370e[_0x826c('0x1a')]+_0xdc370e[_0x826c('0x1d')];var _0x326982;if(_0x5867e5>=_0x3cbd2a){_0x5867e5=_0x3cbd2a;_0x326982=0xc8;}else{_0x326982=0xce;}_0x59fc01[_0x826c('0x1e')](_0x326982);return _0x59fc01[_0x826c('0x1f')](_0x826c('0x20'),_0x4e3899+'-'+_0x5867e5+'/'+_0x3cbd2a)[_0x826c('0x21')](_0x1e82e5);}return null;};}function patchUpdates(_0x5e51ae){return function(_0x4f0178){try{jsonpatch['apply'](_0x4f0178,_0x5e51ae,!![]);}catch(_0x4f02fa){return BPromise['reject'](_0x4f02fa);}return _0x4f0178['save']();};}function saveUpdates(_0x3020fe,_0x595fb3){return function(_0x3c0c46){if(_0x3c0c46){return _0x3c0c46[_0x826c('0x22')](_0x3020fe)['then'](function(_0x300fd6){return _0x300fd6;});}return null;};}function removeEntity(_0x54dd9b,_0x4d438f){return function(_0x50f755){if(_0x50f755){return _0x50f755[_0x826c('0x23')]()[_0x826c('0x24')](function(){_0x54dd9b['status'](0xcc)[_0x826c('0x19')]();});}};}function handleEntityNotFound(_0x3a3901,_0x275981){return function(_0x2968e6){if(!_0x2968e6){_0x3a3901[_0x826c('0x25')](0x194);}return _0x2968e6;};}function handleError(_0x28fb4e,_0x46f34f){_0x46f34f=_0x46f34f||0x1f4;return function(_0x4d63bf){logger['error'](_0x4d63bf['stack']);if(_0x4d63bf['name']){delete _0x4d63bf[_0x826c('0x26')];}_0x28fb4e[_0x826c('0x1e')](_0x46f34f)[_0x826c('0x27')](_0x4d63bf);};}exports[_0x826c('0x28')]=function(_0x354f73,_0x3c9718){var _0x3928c2={},_0x1ea994={},_0x4e6901={'count':0x0,'rows':[]};var _0x4632d3=_[_0x826c('0x29')](db[_0x826c('0x2a')][_0x826c('0x2b')],function(_0x3630d1){return{'name':_0x3630d1[_0x826c('0x2c')],'type':_0x3630d1[_0x826c('0x2d')][_0x826c('0x2e')]};});_0x1ea994[_0x826c('0x2f')]=_[_0x826c('0x29')](_0x4632d3,_0x826c('0x26'));_0x1ea994['query']=_[_0x826c('0x30')](_0x354f73[_0x826c('0x31')]);_0x1ea994['filters']=_[_0x826c('0x32')](_0x1ea994['model'],_0x1ea994['query']);_0x3928c2['attributes']=_[_0x826c('0x32')](_0x1ea994[_0x826c('0x2f')],qs['fields'](_0x354f73[_0x826c('0x31')][_0x826c('0x33')]));_0x3928c2[_0x826c('0x34')]=_0x3928c2[_0x826c('0x34')][_0x826c('0x35')]?_0x3928c2['attributes']:_0x1ea994[_0x826c('0x2f')];if(!_0x354f73[_0x826c('0x31')]['hasOwnProperty'](_0x826c('0x36'))){_0x3928c2['limit']=qs[_0x826c('0x1d')](_0x354f73['query'][_0x826c('0x1d')]);_0x3928c2['offset']=qs[_0x826c('0x1a')](_0x354f73[_0x826c('0x31')][_0x826c('0x1a')]);}_0x3928c2[_0x826c('0x37')]=qs['sort'](_0x354f73[_0x826c('0x31')][_0x826c('0x38')]);_0x3928c2['where']=qs[_0x826c('0x39')](_[_0x826c('0x3a')](_0x354f73[_0x826c('0x31')],_0x1ea994[_0x826c('0x39')]),_0x4632d3);if(_0x354f73[_0x826c('0x31')][_0x826c('0x3b')]){_0x3928c2[_0x826c('0x3c')]=_[_0x826c('0x3d')](_0x3928c2['where'],{'$or':_['map'](_0x4632d3,function(_0x4e313f){if(_0x4e313f[_0x826c('0x2d')]!==_0x826c('0x3e')){var _0x3973e4={};_0x3973e4[_0x4e313f[_0x826c('0x26')]]={'$like':'%'+_0x354f73[_0x826c('0x31')][_0x826c('0x3b')]+'%'};return _0x3973e4;}})});}_0x3928c2=_['merge']({},_0x3928c2,_0x354f73['options']);var _0x44bb2c={'where':_0x3928c2[_0x826c('0x3c')]};return db[_0x826c('0x2a')][_0x826c('0x1c')](_0x44bb2c)['then'](function(_0x5c0ad1){_0x4e6901[_0x826c('0x1c')]=_0x5c0ad1;if(_0x354f73[_0x826c('0x31')][_0x826c('0x3f')]){_0x3928c2['include']=[{'all':!![]}];}return db[_0x826c('0x2a')]['findAll'](_0x3928c2);})[_0x826c('0x24')](function(_0x33e4eb){_0x4e6901[_0x826c('0x40')]=_0x33e4eb;return _0x4e6901;})[_0x826c('0x24')](respondWithFilteredResult(_0x3c9718,_0x3928c2))['catch'](handleError(_0x3c9718,null));};exports[_0x826c('0x41')]=function(_0x26c97a,_0x27d18f){var _0x1fd699={'raw':!![],'where':{'id':_0x26c97a[_0x826c('0x42')]['id']}},_0x51180b={};_0x51180b['model']=_[_0x826c('0x30')](db[_0x826c('0x2a')][_0x826c('0x2b')]);_0x51180b[_0x826c('0x31')]=_[_0x826c('0x30')](_0x26c97a[_0x826c('0x31')]);_0x51180b[_0x826c('0x39')]=_[_0x826c('0x32')](_0x51180b[_0x826c('0x2f')],_0x51180b[_0x826c('0x31')]);_0x1fd699[_0x826c('0x34')]=_[_0x826c('0x32')](_0x51180b[_0x826c('0x2f')],qs[_0x826c('0x33')](_0x26c97a[_0x826c('0x31')][_0x826c('0x33')]));_0x1fd699[_0x826c('0x34')]=_0x1fd699[_0x826c('0x34')][_0x826c('0x35')]?_0x1fd699[_0x826c('0x34')]:_0x51180b[_0x826c('0x2f')];if(_0x26c97a[_0x826c('0x31')][_0x826c('0x3f')]){_0x1fd699[_0x826c('0x43')]=[{'all':!![]}];}_0x1fd699=_['merge']({},_0x1fd699,_0x26c97a[_0x826c('0x44')]);return db[_0x826c('0x2a')][_0x826c('0x45')](_0x1fd699)[_0x826c('0x24')](handleEntityNotFound(_0x27d18f,null))[_0x826c('0x24')](respondWithResult(_0x27d18f,null))[_0x826c('0x46')](handleError(_0x27d18f,null));};exports['create']=function(_0x3f816c,_0x4f13c2){return db[_0x826c('0x2a')]['create'](_0x3f816c[_0x826c('0x47')],{})[_0x826c('0x24')](respondWithResult(_0x4f13c2,0xc9))[_0x826c('0x46')](handleError(_0x4f13c2,null));};exports['update']=function(_0x2126cb,_0x8424aa){if(_0x2126cb['body']['id']){delete _0x2126cb[_0x826c('0x47')]['id'];}return db[_0x826c('0x2a')][_0x826c('0x45')]({'where':{'id':_0x2126cb[_0x826c('0x42')]['id']}})[_0x826c('0x24')](handleEntityNotFound(_0x8424aa,null))[_0x826c('0x24')](saveUpdates(_0x2126cb[_0x826c('0x47')],null))[_0x826c('0x24')](respondWithResult(_0x8424aa,null))['catch'](handleError(_0x8424aa,null));};exports['destroy']=function(_0x288156,_0x5c8ca4){return db[_0x826c('0x2a')][_0x826c('0x45')]({'where':{'id':_0x288156[_0x826c('0x42')]['id']}})[_0x826c('0x24')](handleEntityNotFound(_0x5c8ca4,null))[_0x826c('0x24')](removeEntity(_0x5c8ca4,null))[_0x826c('0x46')](handleError(_0x5c8ca4,null));}; \ No newline at end of file +var _0x05e5=['intersection','fields','length','nolimit','order','sort','where','pick','merge','filter','includeAll','include','findAll','show','find','catch','create','body','params','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','ZohoField','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes'];(function(_0x11c573,_0x9e7c6e){var _0x6b72de=function(_0x2e8a61){while(--_0x2e8a61){_0x11c573['push'](_0x11c573['shift']());}};_0x6b72de(++_0x9e7c6e);}(_0x05e5,0x17b));var _0x505e=function(_0x34e37e,_0x3db1ca){_0x34e37e=_0x34e37e-0x0;var _0x4eb5a3=_0x05e5[_0x34e37e];return _0x4eb5a3;};'use strict';var emlformat=require(_0x505e('0x0'));var rimraf=require(_0x505e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x505e('0x2'));var rp=require('request-promise');var moment=require(_0x505e('0x3'));var BPromise=require(_0x505e('0x4'));var Mustache=require(_0x505e('0x5'));var util=require('util');var path=require('path');var sox=require(_0x505e('0x6'));var csv=require(_0x505e('0x7'));var ejs=require(_0x505e('0x8'));var fs=require('fs');var fs_extra=require(_0x505e('0x9'));var _=require(_0x505e('0xa'));var squel=require(_0x505e('0xb'));var crypto=require(_0x505e('0xc'));var jsforce=require(_0x505e('0xd'));var deskjs=require(_0x505e('0xe'));var toCsv=require('to-csv');var querystring=require(_0x505e('0xf'));var Papa=require(_0x505e('0x10'));var Redis=require(_0x505e('0x11'));var authService=require(_0x505e('0x12'));var qs=require(_0x505e('0x13'));var as=require(_0x505e('0x14'));var hardwareService=require(_0x505e('0x15'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x505e('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x72fd0,_0x2c7349){_0x2c7349=_0x2c7349||0xcc;return function(_0x591fd2){if(_0x591fd2){return _0x72fd0[_0x505e('0x17')](_0x2c7349);}return _0x72fd0[_0x505e('0x18')](_0x2c7349)[_0x505e('0x19')]();};}function respondWithResult(_0x18c922,_0x1d78de){_0x1d78de=_0x1d78de||0xc8;return function(_0xf83059){if(_0xf83059){return _0x18c922['status'](_0x1d78de)[_0x505e('0x1a')](_0xf83059);}};}function respondWithFilteredResult(_0xeb4982,_0x6a3833){return function(_0x6f0d7c){if(_0x6f0d7c){var _0xf0f28d=typeof _0x6a3833[_0x505e('0x1b')]===_0x505e('0x1c')&&typeof _0x6a3833[_0x505e('0x1d')]==='undefined';var _0x1b320c=_0x6f0d7c[_0x505e('0x1e')];var _0x40c958=_0xf0f28d?0x0:_0x6a3833['offset'];var _0x8564d=_0xf0f28d?_0x6f0d7c['count']:_0x6a3833['offset']+_0x6a3833[_0x505e('0x1d')];var _0xfeee4b;if(_0x8564d>=_0x1b320c){_0x8564d=_0x1b320c;_0xfeee4b=0xc8;}else{_0xfeee4b=0xce;}_0xeb4982[_0x505e('0x18')](_0xfeee4b);return _0xeb4982['set'](_0x505e('0x1f'),_0x40c958+'-'+_0x8564d+'/'+_0x1b320c)[_0x505e('0x1a')](_0x6f0d7c);}return null;};}function patchUpdates(_0x5e7afe){return function(_0x1fb48c){try{jsonpatch[_0x505e('0x20')](_0x1fb48c,_0x5e7afe,!![]);}catch(_0x195ee7){return BPromise[_0x505e('0x21')](_0x195ee7);}return _0x1fb48c[_0x505e('0x22')]();};}function saveUpdates(_0x2084bf,_0x1496c1){return function(_0x47179a){if(_0x47179a){return _0x47179a['update'](_0x2084bf)[_0x505e('0x23')](function(_0x33c529){return _0x33c529;});}return null;};}function removeEntity(_0x5d5899,_0xccd660){return function(_0x50964a){if(_0x50964a){return _0x50964a[_0x505e('0x24')]()['then'](function(){_0x5d5899[_0x505e('0x18')](0xcc)[_0x505e('0x19')]();});}};}function handleEntityNotFound(_0x2b1f83,_0x474db3){return function(_0x15866d){if(!_0x15866d){_0x2b1f83['sendStatus'](0x194);}return _0x15866d;};}function handleError(_0x186424,_0x5e4904){_0x5e4904=_0x5e4904||0x1f4;return function(_0xc9d21){logger[_0x505e('0x25')](_0xc9d21[_0x505e('0x26')]);if(_0xc9d21['name']){delete _0xc9d21[_0x505e('0x27')];}_0x186424[_0x505e('0x18')](_0x5e4904)[_0x505e('0x28')](_0xc9d21);};}exports[_0x505e('0x29')]=function(_0x89567b,_0x39fcef){var _0x22d36b={},_0x580fe6={},_0x8f2b00={'count':0x0,'rows':[]};var _0x3f9aa0=_[_0x505e('0x2a')](db[_0x505e('0x2b')][_0x505e('0x2c')],function(_0x463a16){return{'name':_0x463a16[_0x505e('0x2d')],'type':_0x463a16[_0x505e('0x2e')][_0x505e('0x2f')]};});_0x580fe6[_0x505e('0x30')]=_[_0x505e('0x2a')](_0x3f9aa0,_0x505e('0x27'));_0x580fe6[_0x505e('0x31')]=_[_0x505e('0x32')](_0x89567b['query']);_0x580fe6[_0x505e('0x33')]=_['intersection'](_0x580fe6[_0x505e('0x30')],_0x580fe6[_0x505e('0x31')]);_0x22d36b[_0x505e('0x34')]=_[_0x505e('0x35')](_0x580fe6[_0x505e('0x30')],qs[_0x505e('0x36')](_0x89567b[_0x505e('0x31')][_0x505e('0x36')]));_0x22d36b[_0x505e('0x34')]=_0x22d36b[_0x505e('0x34')][_0x505e('0x37')]?_0x22d36b['attributes']:_0x580fe6[_0x505e('0x30')];if(!_0x89567b[_0x505e('0x31')]['hasOwnProperty'](_0x505e('0x38'))){_0x22d36b['limit']=qs[_0x505e('0x1d')](_0x89567b[_0x505e('0x31')][_0x505e('0x1d')]);_0x22d36b['offset']=qs[_0x505e('0x1b')](_0x89567b['query'][_0x505e('0x1b')]);}_0x22d36b[_0x505e('0x39')]=qs[_0x505e('0x3a')](_0x89567b[_0x505e('0x31')][_0x505e('0x3a')]);_0x22d36b[_0x505e('0x3b')]=qs[_0x505e('0x33')](_[_0x505e('0x3c')](_0x89567b[_0x505e('0x31')],_0x580fe6[_0x505e('0x33')]),_0x3f9aa0);if(_0x89567b[_0x505e('0x31')]['filter']){_0x22d36b[_0x505e('0x3b')]=_[_0x505e('0x3d')](_0x22d36b['where'],{'$or':_[_0x505e('0x2a')](_0x3f9aa0,function(_0x837d68){if(_0x837d68[_0x505e('0x2e')]!=='VIRTUAL'){var _0x28c6a4={};_0x28c6a4[_0x837d68['name']]={'$like':'%'+_0x89567b[_0x505e('0x31')][_0x505e('0x3e')]+'%'};return _0x28c6a4;}})});}_0x22d36b=_[_0x505e('0x3d')]({},_0x22d36b,_0x89567b['options']);var _0x345f7e={'where':_0x22d36b['where']};return db[_0x505e('0x2b')]['count'](_0x345f7e)[_0x505e('0x23')](function(_0x132d17){_0x8f2b00[_0x505e('0x1e')]=_0x132d17;if(_0x89567b['query'][_0x505e('0x3f')]){_0x22d36b[_0x505e('0x40')]=[{'all':!![]}];}return db['ZohoField'][_0x505e('0x41')](_0x22d36b);})[_0x505e('0x23')](function(_0xbad0cd){_0x8f2b00['rows']=_0xbad0cd;return _0x8f2b00;})['then'](respondWithFilteredResult(_0x39fcef,_0x22d36b))['catch'](handleError(_0x39fcef,null));};exports[_0x505e('0x42')]=function(_0x314e65,_0x120422){var _0x1a4e91={'raw':!![],'where':{'id':_0x314e65['params']['id']}},_0x183f2b={};_0x183f2b['model']=_[_0x505e('0x32')](db[_0x505e('0x2b')][_0x505e('0x2c')]);_0x183f2b[_0x505e('0x31')]=_['keys'](_0x314e65[_0x505e('0x31')]);_0x183f2b[_0x505e('0x33')]=_[_0x505e('0x35')](_0x183f2b[_0x505e('0x30')],_0x183f2b[_0x505e('0x31')]);_0x1a4e91[_0x505e('0x34')]=_[_0x505e('0x35')](_0x183f2b[_0x505e('0x30')],qs[_0x505e('0x36')](_0x314e65[_0x505e('0x31')][_0x505e('0x36')]));_0x1a4e91['attributes']=_0x1a4e91[_0x505e('0x34')]['length']?_0x1a4e91['attributes']:_0x183f2b[_0x505e('0x30')];if(_0x314e65[_0x505e('0x31')]['includeAll']){_0x1a4e91[_0x505e('0x40')]=[{'all':!![]}];}_0x1a4e91=_['merge']({},_0x1a4e91,_0x314e65['options']);return db['ZohoField'][_0x505e('0x43')](_0x1a4e91)[_0x505e('0x23')](handleEntityNotFound(_0x120422,null))[_0x505e('0x23')](respondWithResult(_0x120422,null))[_0x505e('0x44')](handleError(_0x120422,null));};exports[_0x505e('0x45')]=function(_0x232a0d,_0x6afc67){return db[_0x505e('0x2b')][_0x505e('0x45')](_0x232a0d['body'],{})[_0x505e('0x23')](respondWithResult(_0x6afc67,0xc9))[_0x505e('0x44')](handleError(_0x6afc67,null));};exports['update']=function(_0x45d921,_0xaf62d7){if(_0x45d921['body']['id']){delete _0x45d921[_0x505e('0x46')]['id'];}return db[_0x505e('0x2b')][_0x505e('0x43')]({'where':{'id':_0x45d921[_0x505e('0x47')]['id']}})[_0x505e('0x23')](handleEntityNotFound(_0xaf62d7,null))[_0x505e('0x23')](saveUpdates(_0x45d921['body'],null))[_0x505e('0x23')](respondWithResult(_0xaf62d7,null))[_0x505e('0x44')](handleError(_0xaf62d7,null));};exports[_0x505e('0x24')]=function(_0x4a1a0d,_0x1d525e){return db['ZohoField'][_0x505e('0x43')]({'where':{'id':_0x4a1a0d[_0x505e('0x47')]['id']}})[_0x505e('0x23')](handleEntityNotFound(_0x1d525e,null))[_0x505e('0x23')](removeEntity(_0x1d525e,null))[_0x505e('0x44')](handleError(_0x1d525e,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index 80bcae6..ae0f27c 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 _0xfcf0=['moment','bluebird','request-promise','rimraf','../../config/environment','./intZohoField.attributes','exports','define','ZohoField','zoho_unique_index','idField','FieldId','lodash','util','api'];(function(_0x316f7a,_0x4151a4){var _0x8b7290=function(_0x394611){while(--_0x394611){_0x316f7a['push'](_0x316f7a['shift']());}};_0x8b7290(++_0x4151a4);}(_0xfcf0,0x138));var _0x0fcf=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0xfcf0[_0xc4001c];return _0x49f7bc;};'use strict';var _=require(_0x0fcf('0x0'));var util=require(_0x0fcf('0x1'));var logger=require('../../config/logger')(_0x0fcf('0x2'));var moment=require(_0x0fcf('0x3'));var BPromise=require(_0x0fcf('0x4'));var rp=require(_0x0fcf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0fcf('0x6'));var config=require(_0x0fcf('0x7'));var attributes=require(_0x0fcf('0x8'));module[_0x0fcf('0x9')]=function(_0x1bace8,_0x1a7b03){return _0x1bace8[_0x0fcf('0xa')](_0x0fcf('0xb'),attributes,{'tableName':'int_zoho_fields','paranoid':![],'indexes':[{'name':_0x0fcf('0xc'),'fields':[_0x0fcf('0xd'),_0x0fcf('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb016=['rimraf','../../config/environment','exports','int_zoho_fields','zoho_unique_index','lodash','util','moment','request-promise','path'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xb016,0x159));var _0x6b01=function(_0x291d2f,_0x455c36){_0x291d2f=_0x291d2f-0x0;var _0x1edb52=_0xb016[_0x291d2f];return _0x1edb52;};'use strict';var _=require(_0x6b01('0x0'));var util=require(_0x6b01('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x6b01('0x2'));var BPromise=require('bluebird');var rp=require(_0x6b01('0x3'));var fs=require('fs');var path=require(_0x6b01('0x4'));var rimraf=require(_0x6b01('0x5'));var config=require(_0x6b01('0x6'));var attributes=require('./intZohoField.attributes');module[_0x6b01('0x7')]=function(_0x65407a,_0x192b2d){return _0x65407a['define']('ZohoField',attributes,{'tableName':_0x6b01('0x8'),'paranoid':![],'indexes':[{'name':_0x6b01('0x9'),'fields':['idField','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 2c7a7b3..62c284a 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 _0x48b0=['error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','ZohoField,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0xb33a99,_0x40080e){var _0x3c221e=function(_0x259ca6){while(--_0x259ca6){_0xb33a99['push'](_0xb33a99['shift']());}};_0x3c221e(++_0x40080e);}(_0x48b0,0xf7));var _0x048b=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x48b0[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x048b('0x0'));var util=require(_0x048b('0x1'));var moment=require(_0x048b('0x2'));var BPromise=require(_0x048b('0x3'));var rs=require(_0x048b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x048b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x048b('0x6'))('rpc');var config=require(_0x048b('0x7'));var jayson=require(_0x048b('0x8'));var client=jayson[_0x048b('0x9')][_0x048b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x328a3c,_0x11fa0b,_0x428eac){return new BPromise(function(_0x5155dd,_0x4a2e36){return client['request'](_0x328a3c,_0x428eac)[_0x048b('0xb')](function(_0xae8c7){logger[_0x048b('0xc')](_0x048b('0xd'),_0x11fa0b,_0x048b('0xe'));logger[_0x048b('0xf')]('ZohoField,\x20%s,\x20%s,\x20%s',_0x11fa0b,_0x048b('0xe'),JSON[_0x048b('0x10')](_0xae8c7));if(_0xae8c7[_0x048b('0x11')]){if(_0xae8c7[_0x048b('0x11')][_0x048b('0x12')]===0x1f4){logger[_0x048b('0x11')]('ZohoField,\x20%s,\x20%s',_0x11fa0b,_0xae8c7[_0x048b('0x11')][_0x048b('0x13')]);return _0x4a2e36(_0xae8c7[_0x048b('0x11')][_0x048b('0x13')]);}logger['error'](_0x048b('0xd'),_0x11fa0b,_0xae8c7['error']['message']);return _0x5155dd(_0xae8c7[_0x048b('0x11')][_0x048b('0x13')]);}else{logger[_0x048b('0xc')](_0x048b('0xd'),_0x11fa0b,_0x048b('0xe'));_0x5155dd(_0xae8c7[_0x048b('0x14')][_0x048b('0x13')]);}})[_0x048b('0x15')](function(_0x1455e6){logger[_0x048b('0x11')](_0x048b('0xd'),_0x11fa0b,_0x1455e6);_0x4a2e36(_0x1455e6);});});} \ No newline at end of file +var _0x12e0=['http','info','ZohoField,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','jayson/promise','client'];(function(_0x3734f3,_0xaac919){var _0x3f977c=function(_0xacb62){while(--_0xacb62){_0x3734f3['push'](_0x3734f3['shift']());}};_0x3f977c(++_0xaac919);}(_0x12e0,0x172));var _0x012e=function(_0x24af90,_0x9b21a7){_0x24af90=_0x24af90-0x0;var _0x2f35cd=_0x12e0[_0x24af90];return _0x2f35cd;};'use strict';var _=require('lodash');var util=require(_0x012e('0x0'));var moment=require(_0x012e('0x1'));var BPromise=require(_0x012e('0x2'));var rs=require(_0x012e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x012e('0x4'))['db'];var utils=require(_0x012e('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x012e('0x6'));var client=jayson[_0x012e('0x7')][_0x012e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1c6025,_0x1def14,_0x5480e8){return new BPromise(function(_0x5c230c,_0x14f92e){return client['request'](_0x1c6025,_0x5480e8)['then'](function(_0x554ce0){logger[_0x012e('0x9')](_0x012e('0xa'),_0x1def14,'request\x20sent');logger[_0x012e('0xb')]('ZohoField,\x20%s,\x20%s,\x20%s',_0x1def14,_0x012e('0xc'),JSON['stringify'](_0x554ce0));if(_0x554ce0[_0x012e('0xd')]){if(_0x554ce0[_0x012e('0xd')][_0x012e('0xe')]===0x1f4){logger['error'](_0x012e('0xa'),_0x1def14,_0x554ce0[_0x012e('0xd')]['message']);return _0x14f92e(_0x554ce0['error'][_0x012e('0xf')]);}logger[_0x012e('0xd')](_0x012e('0xa'),_0x1def14,_0x554ce0[_0x012e('0xd')][_0x012e('0xf')]);return _0x5c230c(_0x554ce0[_0x012e('0xd')][_0x012e('0xf')]);}else{logger[_0x012e('0x9')](_0x012e('0xa'),_0x1def14,_0x012e('0xc'));_0x5c230c(_0x554ce0[_0x012e('0x10')]['message']);}})[_0x012e('0x11')](function(_0x5a584e){logger[_0x012e('0xd')](_0x012e('0xa'),_0x1def14,_0x5a584e);_0x14f92e(_0x5a584e);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 9647526..bd0fa2a 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x9c8c83,_0x16ebdd){var _0x4636ac=function(_0x5bacfc){while(--_0x5bacfc){_0x9c8c83['push'](_0x9c8c83['shift']());}};_0x4636ac(++_0x16ebdd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xa9e0[_0x9df060];return _0x338dfe;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x24ac73,_0x3423d7){var _0x4a7082=function(_0x4057e1){while(--_0x4057e1){_0x24ac73['push'](_0x24ac73['shift']());}};_0x4a7082(++_0x3423d7);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file diff --git a/server/api/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index 8986530..f92494f 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 _0x6a14=['state','sequelize','exports','STRING','unique_name_and_version','app.js','INTEGER'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6a14,0x13c));var _0x46a1=function(_0x4ba769,_0x5d50fb){_0x4ba769=_0x4ba769-0x0;var _0x1f96d6=_0x6a14[_0x4ba769];return _0x1f96d6;};'use strict';var Sequelize=require(_0x46a1('0x0'));module[_0x46a1('0x1')]={'name':{'type':Sequelize[_0x46a1('0x2')],'allowNull':![],'unique':_0x46a1('0x3')},'version':{'type':Sequelize[_0x46a1('0x2')],'allowNull':![],'unique':'unique_name_and_version'},'main':{'type':Sequelize[_0x46a1('0x2')],'defaultValue':_0x46a1('0x4')},'filename':{'type':Sequelize[_0x46a1('0x2')]},'path':{'type':Sequelize[_0x46a1('0x2')]},'type':{'type':Sequelize[_0x46a1('0x2')]},'size':{'type':Sequelize[_0x46a1('0x5')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize[_0x46a1('0x2')]},'state':{'type':Sequelize[_0x46a1('0x2')],'unique':_0x46a1('0x6')},'description':{'type':Sequelize[_0x46a1('0x2')]},'title':{'type':Sequelize[_0x46a1('0x2')]},'remoteUri':{'type':Sequelize[_0x46a1('0x2')]},'link':{'type':Sequelize[_0x46a1('0x2')],'defaultValue':'#'}}; \ No newline at end of file +var _0x83cd=['BOOLEAN','sequelize','exports','STRING','unique_name_and_version','app.js','INTEGER'];(function(_0x4cfec2,_0x3749a9){var _0x437d79=function(_0x44ec40){while(--_0x44ec40){_0x4cfec2['push'](_0x4cfec2['shift']());}};_0x437d79(++_0x3749a9);}(_0x83cd,0x17b));var _0xd83c=function(_0x157685,_0x4988d5){_0x157685=_0x157685-0x0;var _0x5d1042=_0x83cd[_0x157685];return _0x5d1042;};'use strict';var Sequelize=require(_0xd83c('0x0'));module[_0xd83c('0x1')]={'name':{'type':Sequelize[_0xd83c('0x2')],'allowNull':![],'unique':_0xd83c('0x3')},'version':{'type':Sequelize[_0xd83c('0x2')],'allowNull':![],'unique':'unique_name_and_version'},'main':{'type':Sequelize[_0xd83c('0x2')],'defaultValue':_0xd83c('0x4')},'filename':{'type':Sequelize[_0xd83c('0x2')]},'path':{'type':Sequelize[_0xd83c('0x2')]},'type':{'type':Sequelize['STRING']},'size':{'type':Sequelize[_0xd83c('0x5')]},'active':{'type':Sequelize[_0xd83c('0x6')],'defaultValue':![]},'author':{'type':Sequelize[_0xd83c('0x2')]},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize[_0xd83c('0x2')],'unique':'state'},'description':{'type':Sequelize[_0xd83c('0x2')]},'title':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xd83c('0x2')]},'link':{'type':Sequelize['STRING'],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index 6943d18..3d50194 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 _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','Integration','rawAttributes','key','model','query','keys','filters'];(function(_0xb1cf84,_0x813740){var _0x4bad2e=function(_0x53e6f2){while(--_0x53e6f2){_0xb1cf84['push'](_0xb1cf84['shift']());}};_0x4bad2e(++_0x813740);}(_0xf61e,0x191));var _0xef61=function(_0x2d820e,_0x16b212){_0x2d820e=_0x2d820e-0x0;var _0x17e119=_0xf61e[_0x2d820e];return _0x17e119;};'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['Integration']['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['Integration'][_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 +var _0x4c60=['api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','then','destroy','end','error','stack','name','index','map','Integration','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','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'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0x4c60,0xc1));var _0x04c6=function(_0x215b2d,_0x70c665){_0x215b2d=_0x215b2d-0x0;var _0x233292=_0x4c60[_0x215b2d];return _0x233292;};'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['Integration'][_0x04c6('0x1b')](_0x59ca18)[_0x04c6('0x1f')](function(_0x2d83eb){_0x3a6d92[_0x04c6('0x1b')]=_0x2d83eb;if(_0x1cd16a[_0x04c6('0x2b')]['includeAll']){_0x5c9003[_0x04c6('0x3b')]=[{'all':!![]}];}return db['Integration'][_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['Integration'][_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['Integration'][_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['Integration'][_0x04c6('0x41')]({'where':{'id':_0x42273e[_0x04c6('0x45')]['id']}})[_0x04c6('0x1f')](handleEntityNotFound(_0x15ec61,null))[_0x04c6('0x1f')](removeEntity(_0x15ec61,null))[_0x04c6('0x3e')](handleError(_0x15ec61,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index ec023bf..0d9083d 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 _0xfaad=['define','Integration','integrations','lodash','util','moment','path','rimraf','../../config/environment'];(function(_0x1154b7,_0x77aa7f){var _0x2c8ee6=function(_0x32a97a){while(--_0x32a97a){_0x1154b7['push'](_0x1154b7['shift']());}};_0x2c8ee6(++_0x77aa7f);}(_0xfaad,0x1b3));var _0xdfaa=function(_0x11a1d2,_0x3baaaa){_0x11a1d2=_0x11a1d2-0x0;var _0x2acf0c=_0xfaad[_0x11a1d2];return _0x2acf0c;};'use strict';var _=require(_0xdfaa('0x0'));var util=require(_0xdfaa('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xdfaa('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xdfaa('0x3'));var rimraf=require(_0xdfaa('0x4'));var config=require(_0xdfaa('0x5'));var attributes=require('./integration.attributes');module['exports']=function(_0xf81d8e,_0x47ba83){return _0xf81d8e[_0xdfaa('0x6')](_0xdfaa('0x7'),attributes,{'tableName':_0xdfaa('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2969=['request-promise','path','rimraf','./integration.attributes','exports','define','lodash','util','../../config/logger','moment','bluebird'];(function(_0x1b1c02,_0x355676){var _0x4284d9=function(_0x4ab076){while(--_0x4ab076){_0x1b1c02['push'](_0x1b1c02['shift']());}};_0x4284d9(++_0x355676);}(_0x2969,0xf8));var _0x9296=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x2969[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x9296('0x0'));var util=require(_0x9296('0x1'));var logger=require(_0x9296('0x2'))('api');var moment=require(_0x9296('0x3'));var BPromise=require(_0x9296('0x4'));var rp=require(_0x9296('0x5'));var fs=require('fs');var path=require(_0x9296('0x6'));var rimraf=require(_0x9296('0x7'));var config=require('../../config/environment');var attributes=require(_0x9296('0x8'));module[_0x9296('0x9')]=function(_0xd64047,_0x486f2d){return _0xd64047[_0x9296('0xa')]('Integration',attributes,{'tableName':'integrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integration/integration.rpc.js b/server/api/integration/integration.rpc.js index d04c376..a4ce353 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 _0x0b0e=['Integration,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Integration,\x20%s,\x20%s','debug'];(function(_0x4cfa2e,_0x5752b5){var _0x279b50=function(_0x3f817b){while(--_0x3f817b){_0x4cfa2e['push'](_0x4cfa2e['shift']());}};_0x279b50(++_0x5752b5);}(_0x0b0e,0x187));var _0xe0b0=function(_0x1faaa1,_0x1568dd){_0x1faaa1=_0x1faaa1-0x0;var _0x994ec=_0x0b0e[_0x1faaa1];return _0x994ec;};'use strict';var _=require(_0xe0b0('0x0'));var util=require('util');var moment=require(_0xe0b0('0x1'));var BPromise=require('bluebird');var rs=require(_0xe0b0('0x2'));var fs=require('fs');var Redis=require(_0xe0b0('0x3'));var db=require(_0xe0b0('0x4'))['db'];var utils=require(_0xe0b0('0x5'));var logger=require(_0xe0b0('0x6'))(_0xe0b0('0x7'));var config=require(_0xe0b0('0x8'));var jayson=require(_0xe0b0('0x9'));var client=jayson[_0xe0b0('0xa')][_0xe0b0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x219b1c,_0x5cf9cc,_0x50be7f){return new BPromise(function(_0x11effc,_0x435060){return client[_0xe0b0('0xc')](_0x219b1c,_0x50be7f)[_0xe0b0('0xd')](function(_0x4c24f9){logger[_0xe0b0('0xe')](_0xe0b0('0xf'),_0x5cf9cc,'request\x20sent');logger[_0xe0b0('0x10')](_0xe0b0('0x11'),_0x5cf9cc,'request\x20sent',JSON[_0xe0b0('0x12')](_0x4c24f9));if(_0x4c24f9[_0xe0b0('0x13')]){if(_0x4c24f9[_0xe0b0('0x13')]['code']===0x1f4){logger[_0xe0b0('0x13')](_0xe0b0('0xf'),_0x5cf9cc,_0x4c24f9[_0xe0b0('0x13')][_0xe0b0('0x14')]);return _0x435060(_0x4c24f9[_0xe0b0('0x13')]['message']);}logger[_0xe0b0('0x13')](_0xe0b0('0xf'),_0x5cf9cc,_0x4c24f9[_0xe0b0('0x13')][_0xe0b0('0x14')]);return _0x11effc(_0x4c24f9[_0xe0b0('0x13')]['message']);}else{logger[_0xe0b0('0xe')]('Integration,\x20%s,\x20%s',_0x5cf9cc,_0xe0b0('0x15'));_0x11effc(_0x4c24f9[_0xe0b0('0x16')]['message']);}})[_0xe0b0('0x17')](function(_0x4a4cc0){logger[_0xe0b0('0x13')](_0xe0b0('0xf'),_0x5cf9cc,_0x4a4cc0);_0x435060(_0x4a4cc0);});});} \ No newline at end of file +var _0x0b0e=['Integration,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Integration,\x20%s,\x20%s','debug'];(function(_0x14476b,_0xd1a7a4){var _0x24e2e8=function(_0x52ed26){while(--_0x52ed26){_0x14476b['push'](_0x14476b['shift']());}};_0x24e2e8(++_0xd1a7a4);}(_0x0b0e,0x187));var _0xe0b0=function(_0x18cac4,_0x57a4d5){_0x18cac4=_0x18cac4-0x0;var _0x2227c6=_0x0b0e[_0x18cac4];return _0x2227c6;};'use strict';var _=require(_0xe0b0('0x0'));var util=require('util');var moment=require(_0xe0b0('0x1'));var BPromise=require('bluebird');var rs=require(_0xe0b0('0x2'));var fs=require('fs');var Redis=require(_0xe0b0('0x3'));var db=require(_0xe0b0('0x4'))['db'];var utils=require(_0xe0b0('0x5'));var logger=require(_0xe0b0('0x6'))(_0xe0b0('0x7'));var config=require(_0xe0b0('0x8'));var jayson=require(_0xe0b0('0x9'));var client=jayson[_0xe0b0('0xa')][_0xe0b0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x219b1c,_0x5cf9cc,_0x50be7f){return new BPromise(function(_0x11effc,_0x435060){return client[_0xe0b0('0xc')](_0x219b1c,_0x50be7f)[_0xe0b0('0xd')](function(_0x4c24f9){logger[_0xe0b0('0xe')](_0xe0b0('0xf'),_0x5cf9cc,'request\x20sent');logger[_0xe0b0('0x10')](_0xe0b0('0x11'),_0x5cf9cc,'request\x20sent',JSON[_0xe0b0('0x12')](_0x4c24f9));if(_0x4c24f9[_0xe0b0('0x13')]){if(_0x4c24f9[_0xe0b0('0x13')]['code']===0x1f4){logger[_0xe0b0('0x13')](_0xe0b0('0xf'),_0x5cf9cc,_0x4c24f9[_0xe0b0('0x13')][_0xe0b0('0x14')]);return _0x435060(_0x4c24f9[_0xe0b0('0x13')]['message']);}logger[_0xe0b0('0x13')](_0xe0b0('0xf'),_0x5cf9cc,_0x4c24f9[_0xe0b0('0x13')][_0xe0b0('0x14')]);return _0x11effc(_0x4c24f9[_0xe0b0('0x13')]['message']);}else{logger[_0xe0b0('0xe')]('Integration,\x20%s,\x20%s',_0x5cf9cc,_0xe0b0('0x15'));_0x11effc(_0x4c24f9[_0xe0b0('0x16')]['message']);}})[_0xe0b0('0x17')](function(_0x4a4cc0){logger[_0xe0b0('0x13')](_0xe0b0('0xf'),_0x5cf9cc,_0x4a4cc0);_0x435060(_0x4a4cc0);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index 6c6c7b7..93587ab 100644 --- a/server/api/integrationReport/index.js +++ b/server/api/integrationReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1261=['create','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','index','get','isAuthenticated','describe','/:id','post'];(function(_0x1e4216,_0x3bae24){var _0x1b2bf0=function(_0x156a73){while(--_0x156a73){_0x1e4216['push'](_0x1e4216['shift']());}};_0x1b2bf0(++_0x3bae24);}(_0x1261,0x144));var _0x1126=function(_0x2b55b5,_0x78505e){_0x2b55b5=_0x2b55b5-0x0;var _0x103d28=_0x1261[_0x2b55b5];return _0x103d28;};'use strict';var multer=require('multer');var util=require(_0x1126('0x0'));var path=require(_0x1126('0x1'));var timeout=require(_0x1126('0x2'));var express=require(_0x1126('0x3'));var router=express[_0x1126('0x4')]();var fs_extra=require(_0x1126('0x5'));var auth=require(_0x1126('0x6'));var interaction=require(_0x1126('0x7'));var config=require(_0x1126('0x8'));var controller=require(_0x1126('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x1126('0xa')]);router[_0x1126('0xb')]('/describe',auth[_0x1126('0xc')](),controller[_0x1126('0xd')]);router[_0x1126('0xb')](_0x1126('0xe'),auth[_0x1126('0xc')](),controller['show']);router[_0x1126('0xf')]('/',auth[_0x1126('0xc')](),controller[_0x1126('0x10')]);router['put'](_0x1126('0xe'),auth['isAuthenticated'](),controller['update']);router[_0x1126('0x11')]('/:id',auth[_0x1126('0xc')](),controller[_0x1126('0x12')]);module[_0x1126('0x13')]=router; \ No newline at end of file +var _0x9f0e=['path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','/describe','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','multer','util'];(function(_0x545a3a,_0x3123aa){var _0x5a5493=function(_0x4e6bce){while(--_0x4e6bce){_0x545a3a['push'](_0x545a3a['shift']());}};_0x5a5493(++_0x3123aa);}(_0x9f0e,0x116));var _0xe9f0=function(_0x336854,_0x54c19a){_0x336854=_0x336854-0x0;var _0x421d70=_0x9f0e[_0x336854];return _0x421d70;};'use strict';var multer=require(_0xe9f0('0x0'));var util=require(_0xe9f0('0x1'));var path=require(_0xe9f0('0x2'));var timeout=require(_0xe9f0('0x3'));var express=require(_0xe9f0('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xe9f0('0x5'));var interaction=require(_0xe9f0('0x6'));var config=require(_0xe9f0('0x7'));var controller=require(_0xe9f0('0x8'));router[_0xe9f0('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xe9f0('0x9')](_0xe9f0('0xa'),auth[_0xe9f0('0xb')](),controller['describe']);router[_0xe9f0('0x9')](_0xe9f0('0xc'),auth[_0xe9f0('0xb')](),controller[_0xe9f0('0xd')]);router[_0xe9f0('0xe')]('/',auth[_0xe9f0('0xb')](),controller[_0xe9f0('0xf')]);router[_0xe9f0('0x10')](_0xe9f0('0xc'),auth['isAuthenticated'](),controller[_0xe9f0('0x11')]);router[_0xe9f0('0x12')](_0xe9f0('0xc'),auth['isAuthenticated'](),controller[_0xe9f0('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index b1a9d67..6215d62 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 _0x8c5c=['sequelize','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENT','SENDING','RECEIVED'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x8c5c,0x1ef));var _0xc8c5=function(_0x38b9b7,_0x51ccdb){_0x38b9b7=_0x38b9b7-0x0;var _0x3a218f=_0x8c5c[_0x38b9b7];return _0x3a218f;};'use strict';var Sequelize=require(_0xc8c5('0x0'));module[_0xc8c5('0x1')]={'integration':{'type':Sequelize['STRING']},'eventChannel':{'type':Sequelize[_0xc8c5('0x2')]},'exitStatus':{'type':Sequelize[_0xc8c5('0x2')]},'ticketId':{'type':Sequelize[_0xc8c5('0x2')]},'integrationId':{'type':Sequelize[_0xc8c5('0x3')]},'contacts':{'type':Sequelize[_0xc8c5('0x2')]},'uniqueid':{'type':Sequelize[_0xc8c5('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0xc8c5('0x2')]},'membername':{'type':Sequelize[_0xc8c5('0x2')]},'agentcalledAt':{'type':Sequelize[_0xc8c5('0x4')]},'agentconnectAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0xc8c5('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize['DATE']},'talktime':{'type':Sequelize[_0xc8c5('0x3')]},'agentacw':{'type':Sequelize[_0xc8c5('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xc8c5('0x3')]},'reason':{'type':Sequelize[_0xc8c5('0x2')]},'agentringnoanswer':{'type':Sequelize[_0xc8c5('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xc8c5('0x4')]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0xc8c5('0x4')]},'lastevent':{'type':Sequelize[_0xc8c5('0x2')]},'channel':{'type':Sequelize[_0xc8c5('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0xc8c5('0x2')]},'connectedlinenum':{'type':Sequelize[_0xc8c5('0x2')]},'connectedlinename':{'type':Sequelize[_0xc8c5('0x2')]},'language':{'type':Sequelize[_0xc8c5('0x2')]},'accountcode':{'type':Sequelize[_0xc8c5('0x2')]},'context':{'type':Sequelize[_0xc8c5('0x2')]},'exten':{'type':Sequelize[_0xc8c5('0x2')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0xc8c5('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xc8c5('0x2')]},'destcalleridnum':{'type':Sequelize[_0xc8c5('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0xc8c5('0x2')]},'destpriority':{'type':Sequelize[_0xc8c5('0x2')]},'destuniqueid':{'type':Sequelize[_0xc8c5('0x2')]},'messageId':{'type':Sequelize[_0xc8c5('0x2')]},'inReplyTo':{'type':Sequelize[_0xc8c5('0x2')]},'subject':{'type':Sequelize[_0xc8c5('0x2')]},'from':{'type':Sequelize[_0xc8c5('0x2')]},'to':{'type':Sequelize[_0xc8c5('0x2')]},'cc':{'type':Sequelize[_0xc8c5('0x2')]},'attachment':{'type':Sequelize[_0xc8c5('0x6')]},'html':{'type':Sequelize[_0xc8c5('0x6')]},'text':{'type':Sequelize['TEXT']},'status':{'type':Sequelize[_0xc8c5('0x7')](_0xc8c5('0x8'),_0xc8c5('0x9'),_0xc8c5('0xa'),'FAILED')},'url':{'type':Sequelize[_0xc8c5('0x2')]},'app':{'type':Sequelize[_0xc8c5('0x2')]},'appdata':{'type':Sequelize[_0xc8c5('0x2')]},'projectId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x0329=['FAILED','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENT','SENDING'];(function(_0x2aa0e7,_0x4e5145){var _0x1472c0=function(_0x4deaeb){while(--_0x4deaeb){_0x2aa0e7['push'](_0x2aa0e7['shift']());}};_0x1472c0(++_0x4e5145);}(_0x0329,0xd3));var _0x9032=function(_0x1235a8,_0x2db48e){_0x1235a8=_0x1235a8-0x0;var _0x41a2cf=_0x0329[_0x1235a8];return _0x41a2cf;};'use strict';var Sequelize=require('sequelize');module[_0x9032('0x0')]={'integration':{'type':Sequelize[_0x9032('0x1')]},'eventChannel':{'type':Sequelize[_0x9032('0x1')]},'exitStatus':{'type':Sequelize[_0x9032('0x1')]},'ticketId':{'type':Sequelize[_0x9032('0x1')]},'integrationId':{'type':Sequelize[_0x9032('0x2')]},'contacts':{'type':Sequelize[_0x9032('0x1')]},'uniqueid':{'type':Sequelize[_0x9032('0x1')]},'calleridnum':{'type':Sequelize[_0x9032('0x1')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x9032('0x1')]},'membername':{'type':Sequelize[_0x9032('0x1')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0x9032('0x2')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x9032('0x3')]},'talktime':{'type':Sequelize[_0x9032('0x2')]},'agentacw':{'type':Sequelize[_0x9032('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0x9032('0x1')]},'agentringnoanswer':{'type':Sequelize[_0x9032('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdump':{'type':Sequelize[_0x9032('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x9032('0x3')]},'lastevent':{'type':Sequelize[_0x9032('0x1')]},'channel':{'type':Sequelize[_0x9032('0x1')]},'channelstate':{'type':Sequelize[_0x9032('0x2')]},'channelstatedesc':{'type':Sequelize[_0x9032('0x1')]},'connectedlinenum':{'type':Sequelize[_0x9032('0x1')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x9032('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x9032('0x1')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x9032('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x9032('0x1')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x9032('0x1')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x9032('0x1')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x9032('0x1')]},'destuniqueid':{'type':Sequelize[_0x9032('0x1')]},'messageId':{'type':Sequelize[_0x9032('0x1')]},'inReplyTo':{'type':Sequelize[_0x9032('0x1')]},'subject':{'type':Sequelize['STRING']},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0x9032('0x1')]},'cc':{'type':Sequelize['STRING']},'attachment':{'type':Sequelize['TEXT']},'html':{'type':Sequelize[_0x9032('0x5')]},'text':{'type':Sequelize[_0x9032('0x5')]},'status':{'type':Sequelize[_0x9032('0x6')](_0x9032('0x7'),_0x9032('0x8'),'RECEIVED',_0x9032('0x9'))},'url':{'type':Sequelize[_0x9032('0x1')]},'app':{'type':Sequelize[_0x9032('0x1')]},'appdata':{'type':Sequelize[_0x9032('0x1')]},'projectId':{'type':Sequelize[_0x9032('0x2')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index d6db4a7..38805f8 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 _0xaf2b=['fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','IntegrationReport','includeAll','include','rows','show','params','find','catch','create','body','update','destroy','describe','eml-format','rimraf','zip-dir','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range','json','apply','reject','save','then','error','stack','name','send','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xaf2b,0x64));var _0xbaf2=function(_0x50b634,_0x1a9974){_0x50b634=_0x50b634-0x0;var _0xcbb832=_0xaf2b[_0x50b634];return _0xcbb832;};'use strict';var emlformat=require(_0xbaf2('0x0'));var rimraf=require(_0xbaf2('0x1'));var zipdir=require(_0xbaf2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xbaf2('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xbaf2('0x4'));var util=require('util');var path=require(_0xbaf2('0x5'));var sox=require(_0xbaf2('0x6'));var csv=require(_0xbaf2('0x7'));var ejs=require(_0xbaf2('0x8'));var fs=require('fs');var fs_extra=require(_0xbaf2('0x9'));var _=require(_0xbaf2('0xa'));var squel=require(_0xbaf2('0xb'));var crypto=require(_0xbaf2('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xbaf2('0xd'));var toCsv=require(_0xbaf2('0x7'));var querystring=require(_0xbaf2('0xe'));var Papa=require(_0xbaf2('0xf'));var Redis=require(_0xbaf2('0x10'));var authService=require(_0xbaf2('0x11'));var qs=require(_0xbaf2('0x12'));var as=require(_0xbaf2('0x13'));var hardwareService=require(_0xbaf2('0x14'));var logger=require(_0xbaf2('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xbaf2('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xbaf2('0x17'))['db'];function respondWithStatusCode(_0x10d3ec,_0x41be48){_0x41be48=_0x41be48||0xcc;return function(_0x31a297){if(_0x31a297){return _0x10d3ec[_0xbaf2('0x18')](_0x41be48);}return _0x10d3ec[_0xbaf2('0x19')](_0x41be48)[_0xbaf2('0x1a')]();};}function respondWithResult(_0x3aac06,_0x5be08e){_0x5be08e=_0x5be08e||0xc8;return function(_0x8a8409){if(_0x8a8409){return _0x3aac06[_0xbaf2('0x19')](_0x5be08e)['json'](_0x8a8409);}};}function respondWithFilteredResult(_0x24f5c6,_0x5c5ed6){return function(_0x1716f3){if(_0x1716f3){var _0x581e61=typeof _0x5c5ed6['offset']===_0xbaf2('0x1b')&&typeof _0x5c5ed6['limit']===_0xbaf2('0x1b');var _0x5c1a94=_0x1716f3[_0xbaf2('0x1c')];var _0x497a31=_0x581e61?0x0:_0x5c5ed6[_0xbaf2('0x1d')];var _0x16d5ab=_0x581e61?_0x1716f3[_0xbaf2('0x1c')]:_0x5c5ed6['offset']+_0x5c5ed6[_0xbaf2('0x1e')];var _0x56bb88;if(_0x16d5ab>=_0x5c1a94){_0x16d5ab=_0x5c1a94;_0x56bb88=0xc8;}else{_0x56bb88=0xce;}_0x24f5c6['status'](_0x56bb88);return _0x24f5c6[_0xbaf2('0x1f')](_0xbaf2('0x20'),_0x497a31+'-'+_0x16d5ab+'/'+_0x5c1a94)[_0xbaf2('0x21')](_0x1716f3);}return null;};}function patchUpdates(_0x2a2248){return function(_0x39a2db){try{jsonpatch[_0xbaf2('0x22')](_0x39a2db,_0x2a2248,!![]);}catch(_0x52e3e0){return BPromise[_0xbaf2('0x23')](_0x52e3e0);}return _0x39a2db[_0xbaf2('0x24')]();};}function saveUpdates(_0x5db6d8,_0x59062f){return function(_0x29df31){if(_0x29df31){return _0x29df31['update'](_0x5db6d8)[_0xbaf2('0x25')](function(_0x3f36b0){return _0x3f36b0;});}return null;};}function removeEntity(_0x2683d2,_0x11fc88){return function(_0x9013da){if(_0x9013da){return _0x9013da['destroy']()[_0xbaf2('0x25')](function(){_0x2683d2['status'](0xcc)[_0xbaf2('0x1a')]();});}};}function handleEntityNotFound(_0x467415,_0x12cda9){return function(_0x18820a){if(!_0x18820a){_0x467415[_0xbaf2('0x18')](0x194);}return _0x18820a;};}function handleError(_0x106552,_0x136d4d){_0x136d4d=_0x136d4d||0x1f4;return function(_0x29ccee){logger[_0xbaf2('0x26')](_0x29ccee[_0xbaf2('0x27')]);if(_0x29ccee[_0xbaf2('0x28')]){delete _0x29ccee[_0xbaf2('0x28')];}_0x106552[_0xbaf2('0x19')](_0x136d4d)[_0xbaf2('0x29')](_0x29ccee);};}exports['index']=function(_0x396708,_0xf8d9f){var _0x5ba18f={},_0x16d2e5={},_0x51082a={'count':0x0,'rows':[]};var _0x1644c1=_[_0xbaf2('0x2a')](db['IntegrationReport'][_0xbaf2('0x2b')],function(_0x12e1be){return{'name':_0x12e1be[_0xbaf2('0x2c')],'type':_0x12e1be[_0xbaf2('0x2d')]['key']};});_0x16d2e5[_0xbaf2('0x2e')]=_['map'](_0x1644c1,_0xbaf2('0x28'));_0x16d2e5[_0xbaf2('0x2f')]=_[_0xbaf2('0x30')](_0x396708[_0xbaf2('0x2f')]);_0x16d2e5[_0xbaf2('0x31')]=_[_0xbaf2('0x32')](_0x16d2e5['model'],_0x16d2e5[_0xbaf2('0x2f')]);_0x5ba18f[_0xbaf2('0x33')]=_[_0xbaf2('0x32')](_0x16d2e5[_0xbaf2('0x2e')],qs[_0xbaf2('0x34')](_0x396708[_0xbaf2('0x2f')][_0xbaf2('0x34')]));_0x5ba18f[_0xbaf2('0x33')]=_0x5ba18f[_0xbaf2('0x33')][_0xbaf2('0x35')]?_0x5ba18f['attributes']:_0x16d2e5[_0xbaf2('0x2e')];if(!_0x396708['query'][_0xbaf2('0x36')]('nolimit')){_0x5ba18f[_0xbaf2('0x1e')]=qs[_0xbaf2('0x1e')](_0x396708['query']['limit']);_0x5ba18f[_0xbaf2('0x1d')]=qs[_0xbaf2('0x1d')](_0x396708[_0xbaf2('0x2f')][_0xbaf2('0x1d')]);}_0x5ba18f[_0xbaf2('0x37')]=qs['sort'](_0x396708[_0xbaf2('0x2f')][_0xbaf2('0x38')]);_0x5ba18f[_0xbaf2('0x39')]=qs[_0xbaf2('0x31')](_[_0xbaf2('0x3a')](_0x396708[_0xbaf2('0x2f')],_0x16d2e5['filters']),_0x1644c1);if(_0x396708[_0xbaf2('0x2f')][_0xbaf2('0x3b')]){_0x5ba18f[_0xbaf2('0x39')]=_[_0xbaf2('0x3c')](_0x5ba18f['where'],{'$or':_['map'](_0x1644c1,function(_0x553c8d){if(_0x553c8d[_0xbaf2('0x2d')]!==_0xbaf2('0x3d')){var _0x4ee67f={};_0x4ee67f[_0x553c8d[_0xbaf2('0x28')]]={'$like':'%'+_0x396708['query']['filter']+'%'};return _0x4ee67f;}})});}_0x5ba18f=_['merge']({},_0x5ba18f,_0x396708[_0xbaf2('0x3e')]);var _0x55be19={'where':_0x5ba18f[_0xbaf2('0x39')]};return db[_0xbaf2('0x3f')][_0xbaf2('0x1c')](_0x55be19)[_0xbaf2('0x25')](function(_0x331107){_0x51082a['count']=_0x331107;if(_0x396708[_0xbaf2('0x2f')][_0xbaf2('0x40')]){_0x5ba18f[_0xbaf2('0x41')]=[{'all':!![]}];}return db[_0xbaf2('0x3f')]['findAll'](_0x5ba18f);})[_0xbaf2('0x25')](function(_0x449106){_0x51082a[_0xbaf2('0x42')]=_0x449106;return _0x51082a;})[_0xbaf2('0x25')](respondWithFilteredResult(_0xf8d9f,_0x5ba18f))['catch'](handleError(_0xf8d9f,null));};exports[_0xbaf2('0x43')]=function(_0x2f545f,_0x178f02){var _0x1128c0={'raw':![],'where':{'id':_0x2f545f[_0xbaf2('0x44')]['id']}},_0xf4aea2={};_0xf4aea2[_0xbaf2('0x2e')]=_[_0xbaf2('0x30')](db['IntegrationReport'][_0xbaf2('0x2b')]);_0xf4aea2['query']=_[_0xbaf2('0x30')](_0x2f545f[_0xbaf2('0x2f')]);_0xf4aea2[_0xbaf2('0x31')]=_[_0xbaf2('0x32')](_0xf4aea2['model'],_0xf4aea2[_0xbaf2('0x2f')]);_0x1128c0[_0xbaf2('0x33')]=_[_0xbaf2('0x32')](_0xf4aea2['model'],qs[_0xbaf2('0x34')](_0x2f545f['query'][_0xbaf2('0x34')]));_0x1128c0[_0xbaf2('0x33')]=_0x1128c0[_0xbaf2('0x33')]['length']?_0x1128c0['attributes']:_0xf4aea2[_0xbaf2('0x2e')];if(_0x2f545f[_0xbaf2('0x2f')][_0xbaf2('0x40')]){_0x1128c0[_0xbaf2('0x41')]=[{'all':!![]}];}_0x1128c0=_[_0xbaf2('0x3c')]({},_0x1128c0,_0x2f545f[_0xbaf2('0x3e')]);return db['IntegrationReport'][_0xbaf2('0x45')](_0x1128c0)['then'](handleEntityNotFound(_0x178f02,null))[_0xbaf2('0x25')](respondWithResult(_0x178f02,null))[_0xbaf2('0x46')](handleError(_0x178f02,null));};exports[_0xbaf2('0x47')]=function(_0x94285a,_0x4a2cad){return db['IntegrationReport'][_0xbaf2('0x47')](_0x94285a[_0xbaf2('0x48')],{})[_0xbaf2('0x25')](respondWithResult(_0x4a2cad,0xc9))[_0xbaf2('0x46')](handleError(_0x4a2cad,null));};exports[_0xbaf2('0x49')]=function(_0xa8af21,_0x4380c8){if(_0xa8af21[_0xbaf2('0x48')]['id']){delete _0xa8af21['body']['id'];}return db[_0xbaf2('0x3f')][_0xbaf2('0x45')]({'where':{'id':_0xa8af21[_0xbaf2('0x44')]['id']}})[_0xbaf2('0x25')](handleEntityNotFound(_0x4380c8,null))[_0xbaf2('0x25')](saveUpdates(_0xa8af21['body'],null))['then'](respondWithResult(_0x4380c8,null))[_0xbaf2('0x46')](handleError(_0x4380c8,null));};exports[_0xbaf2('0x4a')]=function(_0x17c2d5,_0x3cc814){return db[_0xbaf2('0x3f')][_0xbaf2('0x45')]({'where':{'id':_0x17c2d5['params']['id']}})[_0xbaf2('0x25')](handleEntityNotFound(_0x3cc814,null))[_0xbaf2('0x25')](removeEntity(_0x3cc814,null))[_0xbaf2('0x46')](handleError(_0x3cc814,null));};exports[_0xbaf2('0x4b')]=function(_0x2d75e9,_0x1ac43a){return db['IntegrationReport'][_0xbaf2('0x4b')]()['then'](respondWithResult(_0x1ac43a,null))[_0xbaf2('0x46')](handleError(_0x1ac43a,null));}; \ No newline at end of file +var _0x817a=['query','keys','filters','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','IntegrationReport','includeAll','include','findAll','rows','show','intersection','find','create','catch','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','rawAttributes','fieldName','type'];(function(_0xb6861e,_0x41f161){var _0x4e5910=function(_0x2b0edc){while(--_0x2b0edc){_0xb6861e['push'](_0xb6861e['shift']());}};_0x4e5910(++_0x41f161);}(_0x817a,0x68));var _0xa817=function(_0x28f5d4,_0xd9f3ae){_0x28f5d4=_0x28f5d4-0x0;var _0xea3ec4=_0x817a[_0x28f5d4];return _0xea3ec4;};'use strict';var emlformat=require(_0xa817('0x0'));var rimraf=require(_0xa817('0x1'));var zipdir=require(_0xa817('0x2'));var jsonpatch=require(_0xa817('0x3'));var rp=require(_0xa817('0x4'));var moment=require(_0xa817('0x5'));var BPromise=require(_0xa817('0x6'));var Mustache=require(_0xa817('0x7'));var util=require(_0xa817('0x8'));var path=require('path');var sox=require(_0xa817('0x9'));var csv=require(_0xa817('0xa'));var ejs=require(_0xa817('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xa817('0xc'));var crypto=require(_0xa817('0xd'));var jsforce=require(_0xa817('0xe'));var deskjs=require(_0xa817('0xf'));var toCsv=require('to-csv');var querystring=require(_0xa817('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xa817('0x11'));var as=require(_0xa817('0x12'));var hardwareService=require(_0xa817('0x13'));var logger=require(_0xa817('0x14'))(_0xa817('0x15'));var utils=require('../../config/utils');var config=require(_0xa817('0x16'));var licenseUtil=require(_0xa817('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x318af1,_0x4cc8e7){_0x4cc8e7=_0x4cc8e7||0xcc;return function(_0x4b483b){if(_0x4b483b){return _0x318af1[_0xa817('0x18')](_0x4cc8e7);}return _0x318af1[_0xa817('0x19')](_0x4cc8e7)[_0xa817('0x1a')]();};}function respondWithResult(_0x3d0544,_0x24b03b){_0x24b03b=_0x24b03b||0xc8;return function(_0x583aa3){if(_0x583aa3){return _0x3d0544[_0xa817('0x19')](_0x24b03b)[_0xa817('0x1b')](_0x583aa3);}};}function respondWithFilteredResult(_0x478521,_0x4dbbe0){return function(_0x41b2bf){if(_0x41b2bf){var _0xa54d90=typeof _0x4dbbe0[_0xa817('0x1c')]===_0xa817('0x1d')&&typeof _0x4dbbe0['limit']===_0xa817('0x1d');var _0x47654f=_0x41b2bf['count'];var _0x142546=_0xa54d90?0x0:_0x4dbbe0[_0xa817('0x1c')];var _0x2b7a14=_0xa54d90?_0x41b2bf[_0xa817('0x1e')]:_0x4dbbe0[_0xa817('0x1c')]+_0x4dbbe0[_0xa817('0x1f')];var _0x2e7c99;if(_0x2b7a14>=_0x47654f){_0x2b7a14=_0x47654f;_0x2e7c99=0xc8;}else{_0x2e7c99=0xce;}_0x478521[_0xa817('0x19')](_0x2e7c99);return _0x478521[_0xa817('0x20')](_0xa817('0x21'),_0x142546+'-'+_0x2b7a14+'/'+_0x47654f)[_0xa817('0x1b')](_0x41b2bf);}return null;};}function patchUpdates(_0x4f624){return function(_0x41147b){try{jsonpatch[_0xa817('0x22')](_0x41147b,_0x4f624,!![]);}catch(_0x6af824){return BPromise[_0xa817('0x23')](_0x6af824);}return _0x41147b[_0xa817('0x24')]();};}function saveUpdates(_0x5a3383,_0x2c93b2){return function(_0x1cacd0){if(_0x1cacd0){return _0x1cacd0[_0xa817('0x25')](_0x5a3383)[_0xa817('0x26')](function(_0x444e62){return _0x444e62;});}return null;};}function removeEntity(_0x2042fd,_0xf67ec6){return function(_0x796e8c){if(_0x796e8c){return _0x796e8c['destroy']()['then'](function(){_0x2042fd['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5930bb,_0x5ea791){return function(_0x2f4be4){if(!_0x2f4be4){_0x5930bb[_0xa817('0x18')](0x194);}return _0x2f4be4;};}function handleError(_0x3e6d4e,_0x5a5d31){_0x5a5d31=_0x5a5d31||0x1f4;return function(_0x3d12f8){logger[_0xa817('0x27')](_0x3d12f8[_0xa817('0x28')]);if(_0x3d12f8['name']){delete _0x3d12f8[_0xa817('0x29')];}_0x3e6d4e[_0xa817('0x19')](_0x5a5d31)[_0xa817('0x2a')](_0x3d12f8);};}exports[_0xa817('0x2b')]=function(_0xf50f86,_0x4c64ba){var _0x345246={},_0x407294={},_0x22cf90={'count':0x0,'rows':[]};var _0x37cd8d=_[_0xa817('0x2c')](db['IntegrationReport'][_0xa817('0x2d')],function(_0x1ce815){return{'name':_0x1ce815[_0xa817('0x2e')],'type':_0x1ce815[_0xa817('0x2f')]['key']};});_0x407294['model']=_[_0xa817('0x2c')](_0x37cd8d,_0xa817('0x29'));_0x407294[_0xa817('0x30')]=_[_0xa817('0x31')](_0xf50f86['query']);_0x407294[_0xa817('0x32')]=_['intersection'](_0x407294[_0xa817('0x33')],_0x407294[_0xa817('0x30')]);_0x345246[_0xa817('0x34')]=_['intersection'](_0x407294['model'],qs[_0xa817('0x35')](_0xf50f86['query'][_0xa817('0x35')]));_0x345246[_0xa817('0x34')]=_0x345246[_0xa817('0x34')][_0xa817('0x36')]?_0x345246[_0xa817('0x34')]:_0x407294[_0xa817('0x33')];if(!_0xf50f86[_0xa817('0x30')][_0xa817('0x37')](_0xa817('0x38'))){_0x345246[_0xa817('0x1f')]=qs[_0xa817('0x1f')](_0xf50f86['query'][_0xa817('0x1f')]);_0x345246['offset']=qs[_0xa817('0x1c')](_0xf50f86[_0xa817('0x30')][_0xa817('0x1c')]);}_0x345246[_0xa817('0x39')]=qs[_0xa817('0x3a')](_0xf50f86[_0xa817('0x30')]['sort']);_0x345246[_0xa817('0x3b')]=qs[_0xa817('0x32')](_['pick'](_0xf50f86[_0xa817('0x30')],_0x407294[_0xa817('0x32')]),_0x37cd8d);if(_0xf50f86['query'][_0xa817('0x3c')]){_0x345246[_0xa817('0x3b')]=_[_0xa817('0x3d')](_0x345246['where'],{'$or':_['map'](_0x37cd8d,function(_0x160e20){if(_0x160e20[_0xa817('0x2f')]!==_0xa817('0x3e')){var _0x3219cf={};_0x3219cf[_0x160e20[_0xa817('0x29')]]={'$like':'%'+_0xf50f86[_0xa817('0x30')][_0xa817('0x3c')]+'%'};return _0x3219cf;}})});}_0x345246=_[_0xa817('0x3d')]({},_0x345246,_0xf50f86['options']);var _0x3ec307={'where':_0x345246['where']};return db[_0xa817('0x3f')]['count'](_0x3ec307)[_0xa817('0x26')](function(_0x34c34a){_0x22cf90[_0xa817('0x1e')]=_0x34c34a;if(_0xf50f86[_0xa817('0x30')][_0xa817('0x40')]){_0x345246[_0xa817('0x41')]=[{'all':!![]}];}return db[_0xa817('0x3f')][_0xa817('0x42')](_0x345246);})[_0xa817('0x26')](function(_0x33744e){_0x22cf90[_0xa817('0x43')]=_0x33744e;return _0x22cf90;})[_0xa817('0x26')](respondWithFilteredResult(_0x4c64ba,_0x345246))['catch'](handleError(_0x4c64ba,null));};exports[_0xa817('0x44')]=function(_0x51afed,_0x1930f9){var _0xaaa360={'raw':![],'where':{'id':_0x51afed['params']['id']}},_0x2bd689={};_0x2bd689['model']=_[_0xa817('0x31')](db['IntegrationReport'][_0xa817('0x2d')]);_0x2bd689[_0xa817('0x30')]=_[_0xa817('0x31')](_0x51afed[_0xa817('0x30')]);_0x2bd689[_0xa817('0x32')]=_[_0xa817('0x45')](_0x2bd689[_0xa817('0x33')],_0x2bd689[_0xa817('0x30')]);_0xaaa360[_0xa817('0x34')]=_[_0xa817('0x45')](_0x2bd689[_0xa817('0x33')],qs[_0xa817('0x35')](_0x51afed[_0xa817('0x30')][_0xa817('0x35')]));_0xaaa360[_0xa817('0x34')]=_0xaaa360[_0xa817('0x34')][_0xa817('0x36')]?_0xaaa360[_0xa817('0x34')]:_0x2bd689[_0xa817('0x33')];if(_0x51afed[_0xa817('0x30')]['includeAll']){_0xaaa360[_0xa817('0x41')]=[{'all':!![]}];}_0xaaa360=_[_0xa817('0x3d')]({},_0xaaa360,_0x51afed['options']);return db['IntegrationReport'][_0xa817('0x46')](_0xaaa360)['then'](handleEntityNotFound(_0x1930f9,null))[_0xa817('0x26')](respondWithResult(_0x1930f9,null))['catch'](handleError(_0x1930f9,null));};exports[_0xa817('0x47')]=function(_0xf172f6,_0x50f773){return db['IntegrationReport'][_0xa817('0x47')](_0xf172f6['body'],{})[_0xa817('0x26')](respondWithResult(_0x50f773,0xc9))[_0xa817('0x48')](handleError(_0x50f773,null));};exports[_0xa817('0x25')]=function(_0x2ae9a5,_0xe4bf04){if(_0x2ae9a5[_0xa817('0x49')]['id']){delete _0x2ae9a5[_0xa817('0x49')]['id'];}return db[_0xa817('0x3f')][_0xa817('0x46')]({'where':{'id':_0x2ae9a5[_0xa817('0x4a')]['id']}})['then'](handleEntityNotFound(_0xe4bf04,null))[_0xa817('0x26')](saveUpdates(_0x2ae9a5[_0xa817('0x49')],null))[_0xa817('0x26')](respondWithResult(_0xe4bf04,null))[_0xa817('0x48')](handleError(_0xe4bf04,null));};exports['destroy']=function(_0x1b6d4e,_0x11bcd9){return db[_0xa817('0x3f')][_0xa817('0x46')]({'where':{'id':_0x1b6d4e[_0xa817('0x4a')]['id']}})[_0xa817('0x26')](handleEntityNotFound(_0x11bcd9,null))['then'](removeEntity(_0x11bcd9,null))['catch'](handleError(_0x11bcd9,null));};exports[_0xa817('0x4b')]=function(_0x8172ab,_0x44adef){return db[_0xa817('0x3f')][_0xa817('0x4b')]()[_0xa817('0x26')](respondWithResult(_0x44adef,null))[_0xa817('0x48')](handleError(_0x44adef,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index eeab025..4fcc3f1 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 _0xcdc9=['IntegrationReport','report_integration','util','../../config/logger','bluebird','../../config/environment','./integrationReport.attributes','define'];(function(_0x376f50,_0x1b6855){var _0x1c5f2e=function(_0x50adf8){while(--_0x50adf8){_0x376f50['push'](_0x376f50['shift']());}};_0x1c5f2e(++_0x1b6855);}(_0xcdc9,0x1ea));var _0x9cdc=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xcdc9[_0x167cc1];return _0x10bc4b;};'use strict';var _=require('lodash');var util=require(_0x9cdc('0x0'));var logger=require(_0x9cdc('0x1'))('api');var moment=require('moment');var BPromise=require(_0x9cdc('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9cdc('0x3'));var attributes=require(_0x9cdc('0x4'));module['exports']=function(_0x388134,_0x495229){return _0x388134[_0x9cdc('0x5')](_0x9cdc('0x6'),attributes,{'tableName':_0x9cdc('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0115=['util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./integrationReport.attributes','exports','define','IntegrationReport','lodash'];(function(_0x299d66,_0x29124d){var _0x59d564=function(_0x14a242){while(--_0x14a242){_0x299d66['push'](_0x299d66['shift']());}};_0x59d564(++_0x29124d);}(_0x0115,0x1c6));var _0x5011=function(_0xd91db0,_0x288c18){_0xd91db0=_0xd91db0-0x0;var _0x268487=_0x0115[_0xd91db0];return _0x268487;};'use strict';var _=require(_0x5011('0x0'));var util=require(_0x5011('0x1'));var logger=require(_0x5011('0x2'))(_0x5011('0x3'));var moment=require(_0x5011('0x4'));var BPromise=require('bluebird');var rp=require(_0x5011('0x5'));var fs=require('fs');var path=require(_0x5011('0x6'));var rimraf=require(_0x5011('0x7'));var config=require(_0x5011('0x8'));var attributes=require(_0x5011('0x9'));module[_0x5011('0xa')]=function(_0x5352e3,_0x8607db){return _0x5352e3[_0x5011('0xb')](_0x5011('0xc'),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 64d7e09..d8828fc 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 _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x50514b,_0x83db65){var _0x5d8587=function(_0x327ba5){while(--_0x327ba5){_0x50514b['push'](_0x50514b['shift']());}};_0x5d8587(++_0x83db65);}(_0xadb5,0xad));var _0x5adb=function(_0x2c6845,_0x4861c1){_0x2c6845=_0x2c6845-0x0;var _0x3c85b9=_0xadb5[_0x2c6845];return _0x3c85b9;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('IntegrationReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});} \ No newline at end of file +var _0x4819=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','IntegrationReport,\x20%s,\x20%s','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','util','moment'];(function(_0x452d6b,_0x3f053b){var _0x4b306d=function(_0x399296){while(--_0x399296){_0x452d6b['push'](_0x452d6b['shift']());}};_0x4b306d(++_0x3f053b);}(_0x4819,0xcd));var _0x9481=function(_0x1dad4f,_0x13b837){_0x1dad4f=_0x1dad4f-0x0;var _0x22468b=_0x4819[_0x1dad4f];return _0x22468b;};'use strict';var _=require('lodash');var util=require(_0x9481('0x0'));var moment=require(_0x9481('0x1'));var BPromise=require(_0x9481('0x2'));var rs=require(_0x9481('0x3'));var fs=require('fs');var Redis=require(_0x9481('0x4'));var db=require(_0x9481('0x5'))['db'];var utils=require(_0x9481('0x6'));var logger=require(_0x9481('0x7'))(_0x9481('0x8'));var config=require(_0x9481('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x9481('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x54cc78,_0x14e05a,_0x6c6a08){return new BPromise(function(_0x27c033,_0x3278ff){return client[_0x9481('0xb')](_0x54cc78,_0x6c6a08)['then'](function(_0x1818cf){logger['info'](_0x9481('0xc'),_0x14e05a,'request\x20sent');logger[_0x9481('0xd')](_0x9481('0xe'),_0x14e05a,_0x9481('0xf'),JSON[_0x9481('0x10')](_0x1818cf));if(_0x1818cf[_0x9481('0x11')]){if(_0x1818cf[_0x9481('0x11')][_0x9481('0x12')]===0x1f4){logger[_0x9481('0x11')](_0x9481('0xc'),_0x14e05a,_0x1818cf['error']['message']);return _0x3278ff(_0x1818cf[_0x9481('0x11')][_0x9481('0x13')]);}logger[_0x9481('0x11')](_0x9481('0xc'),_0x14e05a,_0x1818cf[_0x9481('0x11')][_0x9481('0x13')]);return _0x27c033(_0x1818cf[_0x9481('0x11')]['message']);}else{logger[_0x9481('0x14')](_0x9481('0xc'),_0x14e05a,'request\x20sent');_0x27c033(_0x1818cf[_0x9481('0x15')]['message']);}})[_0x9481('0x16')](function(_0x7a2ac8){logger[_0x9481('0x11')](_0x9481('0xc'),_0x14e05a,_0x7a2ac8);_0x3278ff(_0x7a2ac8);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index 5b9a186..a47868b 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 _0xbe41=['./interval.controller','isAuthenticated','index','get','/:id','getIntervals','post','create','/:id/sub_intervals','addInterval','/:id/sub_intervals/create_many','addIntervals','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x139d15,_0x1c2917){var _0x51f96d=function(_0x27b9a4){while(--_0x27b9a4){_0x139d15['push'](_0x139d15['shift']());}};_0x51f96d(++_0x1c2917);}(_0xbe41,0x1b9));var _0x1be4=function(_0x39b45f,_0x195c23){_0x39b45f=_0x39b45f-0x0;var _0x141715=_0xbe41[_0x39b45f];return _0x141715;};'use strict';var multer=require(_0x1be4('0x0'));var util=require(_0x1be4('0x1'));var path=require(_0x1be4('0x2'));var timeout=require(_0x1be4('0x3'));var express=require(_0x1be4('0x4'));var router=express[_0x1be4('0x5')]();var fs_extra=require(_0x1be4('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x1be4('0x7'));var config=require(_0x1be4('0x8'));var controller=require(_0x1be4('0x9'));router['get']('/',auth[_0x1be4('0xa')](),controller[_0x1be4('0xb')]);router[_0x1be4('0xc')](_0x1be4('0xd'),auth[_0x1be4('0xa')](),controller['show']);router['get']('/:id/sub_intervals',auth['isAuthenticated'](),controller[_0x1be4('0xe')]);router[_0x1be4('0xf')]('/',auth[_0x1be4('0xa')](),controller[_0x1be4('0x10')]);router['post'](_0x1be4('0x11'),auth[_0x1be4('0xa')](),controller[_0x1be4('0x12')]);router[_0x1be4('0xf')](_0x1be4('0x13'),auth[_0x1be4('0xa')](),controller[_0x1be4('0x14')]);router[_0x1be4('0x15')](_0x1be4('0xd'),auth[_0x1be4('0xa')](),controller[_0x1be4('0x16')]);router['delete']('/:id',auth[_0x1be4('0xa')](),controller[_0x1be4('0x17')]);module[_0x1be4('0x18')]=router; \ No newline at end of file +var _0x553f=['addInterval','/:id/sub_intervals/create_many','addIntervals','put','update','delete','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./interval.controller','get','index','/:id','show','post','isAuthenticated'];(function(_0x6f6f18,_0x406aee){var _0x57c18c=function(_0x289369){while(--_0x289369){_0x6f6f18['push'](_0x6f6f18['shift']());}};_0x57c18c(++_0x406aee);}(_0x553f,0x1c0));var _0xf553=function(_0x2d357a,_0x3dc727){_0x2d357a=_0x2d357a-0x0;var _0x11935e=_0x553f[_0x2d357a];return _0x11935e;};'use strict';var multer=require(_0xf553('0x0'));var util=require(_0xf553('0x1'));var path=require(_0xf553('0x2'));var timeout=require(_0xf553('0x3'));var express=require(_0xf553('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xf553('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf553('0x6'));var controller=require(_0xf553('0x7'));router[_0xf553('0x8')]('/',auth['isAuthenticated'](),controller[_0xf553('0x9')]);router[_0xf553('0x8')](_0xf553('0xa'),auth['isAuthenticated'](),controller[_0xf553('0xb')]);router[_0xf553('0x8')]('/:id/sub_intervals',auth['isAuthenticated'](),controller['getIntervals']);router[_0xf553('0xc')]('/',auth[_0xf553('0xd')](),controller['create']);router[_0xf553('0xc')]('/:id/sub_intervals',auth[_0xf553('0xd')](),controller[_0xf553('0xe')]);router['post'](_0xf553('0xf'),auth[_0xf553('0xd')](),controller[_0xf553('0x10')]);router[_0xf553('0x11')](_0xf553('0xa'),auth[_0xf553('0xd')](),controller[_0xf553('0x12')]);router[_0xf553('0x13')](_0xf553('0xa'),auth[_0xf553('0xd')](),controller['destroy']);module[_0xf553('0x14')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index 0b4a9d0..4c70933 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 _0x2359=['exports','STRING','sequelize'];(function(_0x389fa3,_0x35fc4b){var _0x4a1809=function(_0x4f5d04){while(--_0x4f5d04){_0x389fa3['push'](_0x389fa3['shift']());}};_0x4a1809(++_0x35fc4b);}(_0x2359,0x173));var _0x9235=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x2359[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require(_0x9235('0x0'));module[_0x9235('0x1')]={'name':{'type':Sequelize[_0x9235('0x2')]},'description':{'type':Sequelize[_0x9235('0x2')]},'interval':{'type':Sequelize[_0x9235('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0x2a89=['STRING','sequelize','exports'];(function(_0x217372,_0x1822ce){var _0x2715a1=function(_0x5712db){while(--_0x5712db){_0x217372['push'](_0x217372['shift']());}};_0x2715a1(++_0x1822ce);}(_0x2a89,0x1c0));var _0x92a8=function(_0x1e2ab5,_0x132a15){_0x1e2ab5=_0x1e2ab5-0x0;var _0x25246c=_0x2a89[_0x1e2ab5];return _0x25246c;};'use strict';var Sequelize=require(_0x92a8('0x0'));module[_0x92a8('0x1')]={'name':{'type':Sequelize[_0x92a8('0x2')]},'description':{'type':Sequelize[_0x92a8('0x2')]},'interval':{'type':Sequelize[_0x92a8('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 1876261..b50ff01 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 _0xed80=['update','then','get','Intervals','UserProfileResource','destroy','end','stack','name','send','map','Interval','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','sort','where','filter','merge','type','VIRTUAL','includeAll','findAll','show','include','options','find','catch','create','body','role','user','UserProfileSection','autoAssociation','error','params','addInterval','getIntervals','findOne','order','hasOwnProperty','nolimit','addIntervals','sequelize','transaction','IntervalId','bulkCreate','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','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','../../components/extensions/rewrite','sendStatus','status','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save'];(function(_0x2ad502,_0x2b6085){var _0x24fdfc=function(_0x5821ec){while(--_0x5821ec){_0x2ad502['push'](_0x2ad502['shift']());}};_0x24fdfc(++_0x2b6085);}(_0xed80,0xef));var _0x0ed8=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xed80[_0xfae23b];return _0x200640;};'use strict';var emlformat=require(_0x0ed8('0x0'));var rimraf=require(_0x0ed8('0x1'));var zipdir=require(_0x0ed8('0x2'));var jsonpatch=require(_0x0ed8('0x3'));var rp=require('request-promise');var moment=require(_0x0ed8('0x4'));var BPromise=require(_0x0ed8('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x0ed8('0x6'));var sox=require(_0x0ed8('0x7'));var csv=require(_0x0ed8('0x8'));var ejs=require(_0x0ed8('0x9'));var fs=require('fs');var fs_extra=require(_0x0ed8('0xa'));var _=require(_0x0ed8('0xb'));var squel=require(_0x0ed8('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0ed8('0xd'));var toCsv=require(_0x0ed8('0x8'));var querystring=require(_0x0ed8('0xe'));var Papa=require(_0x0ed8('0xf'));var Redis=require('ioredis');var authService=require(_0x0ed8('0x10'));var qs=require(_0x0ed8('0x11'));var as=require(_0x0ed8('0x12'));var hardwareService=require(_0x0ed8('0x13'));var logger=require(_0x0ed8('0x14'))(_0x0ed8('0x15'));var utils=require(_0x0ed8('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x0ed8('0x17'));var db=require('../../mysqldb')['db'];var extensions=require(_0x0ed8('0x18'));function respondWithStatusCode(_0x228f34,_0x489135){_0x489135=_0x489135||0xcc;return function(_0x1e2e17){if(_0x1e2e17){return _0x228f34[_0x0ed8('0x19')](_0x489135);}return _0x228f34[_0x0ed8('0x1a')](_0x489135)['end']();};}function respondWithResult(_0x15859a,_0x5e24b4){_0x5e24b4=_0x5e24b4||0xc8;return function(_0x3c4efc){if(_0x3c4efc){return _0x15859a[_0x0ed8('0x1a')](_0x5e24b4)[_0x0ed8('0x1b')](_0x3c4efc);}};}function respondWithFilteredResult(_0x1a50c6,_0x12247b){return function(_0x3fe64b){if(_0x3fe64b){var _0x549f6e=typeof _0x12247b['offset']===_0x0ed8('0x1c')&&typeof _0x12247b[_0x0ed8('0x1d')]===_0x0ed8('0x1c');var _0x191b67=_0x3fe64b['count'];var _0x457609=_0x549f6e?0x0:_0x12247b[_0x0ed8('0x1e')];var _0x30de2a=_0x549f6e?_0x3fe64b[_0x0ed8('0x1f')]:_0x12247b[_0x0ed8('0x1e')]+_0x12247b['limit'];var _0x2ab6ab;if(_0x30de2a>=_0x191b67){_0x30de2a=_0x191b67;_0x2ab6ab=0xc8;}else{_0x2ab6ab=0xce;}_0x1a50c6[_0x0ed8('0x1a')](_0x2ab6ab);return _0x1a50c6[_0x0ed8('0x20')](_0x0ed8('0x21'),_0x457609+'-'+_0x30de2a+'/'+_0x191b67)['json'](_0x3fe64b);}return null;};}function patchUpdates(_0x42712c){return function(_0xc414d0){try{jsonpatch[_0x0ed8('0x22')](_0xc414d0,_0x42712c,!![]);}catch(_0x4830c6){return BPromise[_0x0ed8('0x23')](_0x4830c6);}return _0xc414d0[_0x0ed8('0x24')]();};}function saveUpdates(_0x4ad4bc,_0x49dbc0){return function(_0x4cb625){if(_0x4cb625){return _0x4cb625[_0x0ed8('0x25')](_0x4ad4bc)[_0x0ed8('0x26')](function(_0x3ac667){return _0x3ac667;});}return null;};}function removeEntity(_0x58b74f,_0x2e9480){return function(_0x4086ce){if(_0x4086ce){return _0x4086ce['destroy']()['then'](function(){var _0x53c08c=_0x4086ce[_0x0ed8('0x27')]({'plain':!![]});var _0x27011b=_0x0ed8('0x28');return db[_0x0ed8('0x29')][_0x0ed8('0x2a')]({'where':{'type':_0x27011b,'resourceId':_0x53c08c['id']}})[_0x0ed8('0x26')](function(){return _0x4086ce;});})[_0x0ed8('0x26')](function(){_0x58b74f[_0x0ed8('0x1a')](0xcc)[_0x0ed8('0x2b')]();});}};}function handleEntityNotFound(_0x684aeb,_0x5b075a){return function(_0x38dcfc){if(!_0x38dcfc){_0x684aeb[_0x0ed8('0x19')](0x194);}return _0x38dcfc;};}function handleError(_0x4f8dc5,_0x1b8e1d){_0x1b8e1d=_0x1b8e1d||0x1f4;return function(_0x5c962e){logger['error'](_0x5c962e[_0x0ed8('0x2c')]);if(_0x5c962e[_0x0ed8('0x2d')]){delete _0x5c962e[_0x0ed8('0x2d')];}_0x4f8dc5['status'](_0x1b8e1d)[_0x0ed8('0x2e')](_0x5c962e);};}exports['index']=function(_0x5b7884,_0x122a2a){var _0x3e1890={},_0x33e3c4={},_0x284466={'count':0x0,'rows':[]};var _0x21ea60=_[_0x0ed8('0x2f')](db[_0x0ed8('0x30')][_0x0ed8('0x31')],function(_0x435f35){return{'name':_0x435f35[_0x0ed8('0x32')],'type':_0x435f35['type'][_0x0ed8('0x33')]};});_0x33e3c4[_0x0ed8('0x34')]=_[_0x0ed8('0x2f')](_0x21ea60,'name');_0x33e3c4[_0x0ed8('0x35')]=_[_0x0ed8('0x36')](_0x5b7884[_0x0ed8('0x35')]);_0x33e3c4[_0x0ed8('0x37')]=_['intersection'](_0x33e3c4[_0x0ed8('0x34')],_0x33e3c4[_0x0ed8('0x35')]);_0x3e1890['attributes']=_[_0x0ed8('0x38')](_0x33e3c4[_0x0ed8('0x34')],qs[_0x0ed8('0x39')](_0x5b7884['query'][_0x0ed8('0x39')]));_0x3e1890[_0x0ed8('0x3a')]=_0x3e1890[_0x0ed8('0x3a')][_0x0ed8('0x3b')]?_0x3e1890[_0x0ed8('0x3a')]:_0x33e3c4[_0x0ed8('0x34')];if(!_0x5b7884['query']['hasOwnProperty']('nolimit')){_0x3e1890[_0x0ed8('0x1d')]=qs[_0x0ed8('0x1d')](_0x5b7884[_0x0ed8('0x35')]['limit']);_0x3e1890[_0x0ed8('0x1e')]=qs[_0x0ed8('0x1e')](_0x5b7884['query'][_0x0ed8('0x1e')]);}_0x3e1890['order']=qs[_0x0ed8('0x3c')](_0x5b7884[_0x0ed8('0x35')][_0x0ed8('0x3c')]);_0x3e1890[_0x0ed8('0x3d')]=qs['filters'](_['pick'](_0x5b7884[_0x0ed8('0x35')],_0x33e3c4[_0x0ed8('0x37')]),_0x21ea60);if(_0x5b7884[_0x0ed8('0x35')][_0x0ed8('0x3e')]){_0x3e1890['where']=_[_0x0ed8('0x3f')](_0x3e1890[_0x0ed8('0x3d')],{'$or':_[_0x0ed8('0x2f')](_0x21ea60,function(_0xd36db){if(_0xd36db[_0x0ed8('0x40')]!==_0x0ed8('0x41')){var _0x44db26={};_0x44db26[_0xd36db[_0x0ed8('0x2d')]]={'$like':'%'+_0x5b7884[_0x0ed8('0x35')][_0x0ed8('0x3e')]+'%'};return _0x44db26;}})});}_0x3e1890=_['merge']({},_0x3e1890,_0x5b7884['options']);var _0x5a4c64={'where':_0x3e1890[_0x0ed8('0x3d')]};return db[_0x0ed8('0x30')][_0x0ed8('0x1f')](_0x5a4c64)[_0x0ed8('0x26')](function(_0x5c3262){_0x284466[_0x0ed8('0x1f')]=_0x5c3262;if(_0x5b7884[_0x0ed8('0x35')][_0x0ed8('0x42')]){_0x3e1890['include']=[{'all':!![]}];}return db[_0x0ed8('0x30')][_0x0ed8('0x43')](_0x3e1890);})[_0x0ed8('0x26')](function(_0x1baba4){_0x284466['rows']=_0x1baba4;return _0x284466;})['then'](respondWithFilteredResult(_0x122a2a,_0x3e1890))['catch'](handleError(_0x122a2a,null));};exports[_0x0ed8('0x44')]=function(_0x261759,_0x3f9690){var _0x1c9dac={'raw':!![],'where':{'id':_0x261759['params']['id']}},_0x165d0b={};_0x165d0b['model']=_[_0x0ed8('0x36')](db[_0x0ed8('0x30')][_0x0ed8('0x31')]);_0x165d0b['query']=_['keys'](_0x261759[_0x0ed8('0x35')]);_0x165d0b[_0x0ed8('0x37')]=_['intersection'](_0x165d0b['model'],_0x165d0b['query']);_0x1c9dac[_0x0ed8('0x3a')]=_[_0x0ed8('0x38')](_0x165d0b[_0x0ed8('0x34')],qs[_0x0ed8('0x39')](_0x261759[_0x0ed8('0x35')]['fields']));_0x1c9dac[_0x0ed8('0x3a')]=_0x1c9dac[_0x0ed8('0x3a')]['length']?_0x1c9dac[_0x0ed8('0x3a')]:_0x165d0b[_0x0ed8('0x34')];if(_0x261759[_0x0ed8('0x35')][_0x0ed8('0x42')]){_0x1c9dac[_0x0ed8('0x45')]=[{'all':!![]}];}_0x1c9dac=_[_0x0ed8('0x3f')]({},_0x1c9dac,_0x261759[_0x0ed8('0x46')]);return db[_0x0ed8('0x30')][_0x0ed8('0x47')](_0x1c9dac)[_0x0ed8('0x26')](handleEntityNotFound(_0x3f9690,null))[_0x0ed8('0x26')](respondWithResult(_0x3f9690,null))[_0x0ed8('0x48')](handleError(_0x3f9690,null));};exports[_0x0ed8('0x49')]=function(_0x27fbfc,_0x3127d6){return db[_0x0ed8('0x30')]['create'](_0x27fbfc[_0x0ed8('0x4a')],{})[_0x0ed8('0x26')](function(_0x5b84c6){var _0xa7dd71=_0x27fbfc['user'][_0x0ed8('0x27')]({'plain':!![]});if(!_0xa7dd71)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xa7dd71[_0x0ed8('0x4b')]===_0x0ed8('0x4c')){var _0x427e9f=_0x5b84c6[_0x0ed8('0x27')]({'plain':!![]});var _0x1279af=_0x0ed8('0x28');return db[_0x0ed8('0x4d')][_0x0ed8('0x47')]({'where':{'name':_0x1279af,'userProfileId':_0xa7dd71['userProfileId']},'raw':!![]})[_0x0ed8('0x26')](function(_0x24431d){if(_0x24431d&&_0x24431d[_0x0ed8('0x4e')]===0x0){return db['UserProfileResource']['create']({'name':_0x427e9f[_0x0ed8('0x2d')],'resourceId':_0x427e9f['id'],'type':_0x24431d['name'],'sectionId':_0x24431d['id']},{})[_0x0ed8('0x26')](function(){return _0x5b84c6;});}else{return _0x5b84c6;}})[_0x0ed8('0x48')](function(_0x1e2177){logger[_0x0ed8('0x4f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1e2177);throw _0x1e2177;});}return _0x5b84c6;})[_0x0ed8('0x26')](respondWithResult(_0x3127d6,0xc9))[_0x0ed8('0x48')](handleError(_0x3127d6,null));};exports['update']=function(_0xf95369,_0x32a9db){if(_0xf95369[_0x0ed8('0x4a')]['id']){delete _0xf95369[_0x0ed8('0x4a')]['id'];}return db[_0x0ed8('0x30')][_0x0ed8('0x47')]({'where':{'id':_0xf95369[_0x0ed8('0x50')]['id']}})[_0x0ed8('0x26')](handleEntityNotFound(_0x32a9db,null))['then'](saveUpdates(_0xf95369[_0x0ed8('0x4a')],null))[_0x0ed8('0x26')](respondWithResult(_0x32a9db,null))[_0x0ed8('0x48')](handleError(_0x32a9db,null));};exports[_0x0ed8('0x2a')]=function(_0x5d8046,_0x3aac39){return db[_0x0ed8('0x30')][_0x0ed8('0x47')]({'where':{'id':_0x5d8046[_0x0ed8('0x50')]['id']}})[_0x0ed8('0x26')](handleEntityNotFound(_0x3aac39,null))['then'](removeEntity(_0x3aac39,null))[_0x0ed8('0x48')](handleError(_0x3aac39,null));};exports[_0x0ed8('0x51')]=function(_0x134d49,_0x16955b,_0x59056e){if(_0x134d49[_0x0ed8('0x4a')]['id']){delete _0x134d49[_0x0ed8('0x4a')]['id'];}return db['Interval'][_0x0ed8('0x47')]({'where':{'id':_0x134d49[_0x0ed8('0x50')]['id']}})['then'](handleEntityNotFound(_0x16955b,null))[_0x0ed8('0x26')](function(_0x3609e6){if(_0x3609e6){_0x134d49['body']['IntervalId']=_0x3609e6['id'];return db['Interval'][_0x0ed8('0x49')](_0x134d49[_0x0ed8('0x4a')]);}})[_0x0ed8('0x26')](respondWithResult(_0x16955b,null))[_0x0ed8('0x48')](handleError(_0x16955b,null));};exports[_0x0ed8('0x52')]=function(_0x317c07,_0x23becb,_0x5ca25a){var _0x26ef6e={};var _0xde2d83={};var _0x27f95f;var _0x1b7633;return db['Interval'][_0x0ed8('0x53')]({'where':{'id':_0x317c07['params']['id']}})['then'](handleEntityNotFound(_0x23becb,null))[_0x0ed8('0x26')](function(_0x26e702){if(_0x26e702){_0x27f95f=_0x26e702;_0xde2d83[_0x0ed8('0x34')]=_[_0x0ed8('0x36')](db[_0x0ed8('0x30')]['rawAttributes']);_0xde2d83['query']=_[_0x0ed8('0x36')](_0x317c07[_0x0ed8('0x35')]);_0xde2d83[_0x0ed8('0x37')]=_[_0x0ed8('0x38')](_0xde2d83['model'],_0xde2d83['query']);_0x26ef6e[_0x0ed8('0x3a')]=_['intersection'](_0xde2d83[_0x0ed8('0x34')],qs[_0x0ed8('0x39')](_0x317c07[_0x0ed8('0x35')][_0x0ed8('0x39')]));_0x26ef6e[_0x0ed8('0x3a')]=_0x26ef6e[_0x0ed8('0x3a')][_0x0ed8('0x3b')]?_0x26ef6e['attributes']:_0xde2d83['model'];_0x26ef6e[_0x0ed8('0x54')]=qs[_0x0ed8('0x3c')](_0x317c07[_0x0ed8('0x35')]['sort']);_0x26ef6e['where']=qs[_0x0ed8('0x37')](_['pick'](_0x317c07['query'],_0xde2d83[_0x0ed8('0x37')]));if(_0x317c07[_0x0ed8('0x35')][_0x0ed8('0x3e')]){_0x26ef6e[_0x0ed8('0x3d')]=_['merge'](_0x26ef6e['where'],{'$or':_[_0x0ed8('0x2f')](_0x26ef6e[_0x0ed8('0x3a')],function(_0x1883b0){var _0x94d703={};_0x94d703[_0x1883b0]={'$like':'%'+_0x317c07['query'][_0x0ed8('0x3e')]+'%'};return _0x94d703;})});}_0x26ef6e=_[_0x0ed8('0x3f')]({},_0x26ef6e,_0x317c07[_0x0ed8('0x46')]);return _0x27f95f['getIntervals'](_0x26ef6e);}})[_0x0ed8('0x26')](function(_0x5d6d60){if(_0x5d6d60){_0x1b7633=_0x5d6d60[_0x0ed8('0x3b')];if(!_0x317c07[_0x0ed8('0x35')][_0x0ed8('0x55')](_0x0ed8('0x56'))){_0x26ef6e[_0x0ed8('0x1d')]=qs[_0x0ed8('0x1d')](_0x317c07[_0x0ed8('0x35')][_0x0ed8('0x1d')]);_0x26ef6e[_0x0ed8('0x1e')]=qs['offset'](_0x317c07[_0x0ed8('0x35')][_0x0ed8('0x1e')]);}return _0x27f95f['getIntervals'](_0x26ef6e);}})[_0x0ed8('0x26')](function(_0x2e55){if(_0x2e55){return _0x2e55?{'count':_0x1b7633,'rows':_0x2e55}:null;}})[_0x0ed8('0x26')](respondWithResult(_0x23becb,null))[_0x0ed8('0x48')](handleError(_0x23becb,null));};exports[_0x0ed8('0x57')]=function(_0x5cf5b6,_0x22d408,_0x2b6376){return db[_0x0ed8('0x30')][_0x0ed8('0x53')]({'where':{'id':_0x5cf5b6[_0x0ed8('0x50')]['id']}})['then'](handleEntityNotFound(_0x22d408,null))[_0x0ed8('0x26')](function(_0x4a70d5){if(_0x4a70d5){return db[_0x0ed8('0x58')][_0x0ed8('0x59')](function(_0x33687f){return db[_0x0ed8('0x30')][_0x0ed8('0x2a')]({'where':{'IntervalId':_0x5cf5b6[_0x0ed8('0x50')]['id']},'transaction':_0x33687f})[_0x0ed8('0x26')](function(_0x1765e7){var _0x6a6fa8=_[_0x0ed8('0x2f')](_0x5cf5b6[_0x0ed8('0x4a')],function(_0x27cb8a){delete _0x27cb8a['id'];_0x27cb8a[_0x0ed8('0x5a')]=_0x5cf5b6[_0x0ed8('0x50')]['id'];return _0x27cb8a;});return db['Interval'][_0x0ed8('0x5b')](_0x6a6fa8,{'transaction':_0x33687f});});})[_0x0ed8('0x26')](function(){return db[_0x0ed8('0x30')]['findAll']({'where':{'IntervalId':_0x5cf5b6['params']['id']}});});}})[_0x0ed8('0x26')](respondWithResult(_0x22d408,null))[_0x0ed8('0x48')](handleError(_0x22d408,null));}; \ No newline at end of file +var _0x7ea3=['type','key','query','filters','intersection','model','attributes','fields','length','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','catch','params','keys','rawAttributes','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addInterval','IntervalId','getIntervals','findOne','hasOwnProperty','addIntervals','sequelize','transaction','bulkCreate','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','crypto','jsforce','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','then','get','Intervals','UserProfileResource','error','stack','name','send','map','Interval'];(function(_0x1afc35,_0x7184da){var _0x35b946=function(_0x116c03){while(--_0x116c03){_0x1afc35['push'](_0x1afc35['shift']());}};_0x35b946(++_0x7184da);}(_0x7ea3,0xd1));var _0x37ea=function(_0x12ca16,_0x281fd9){_0x12ca16=_0x12ca16-0x0;var _0x56fb78=_0x7ea3[_0x12ca16];return _0x56fb78;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x37ea('0x0'));var zipdir=require(_0x37ea('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x37ea('0x2'));var moment=require(_0x37ea('0x3'));var BPromise=require(_0x37ea('0x4'));var Mustache=require(_0x37ea('0x5'));var util=require('util');var path=require(_0x37ea('0x6'));var sox=require(_0x37ea('0x7'));var csv=require('to-csv');var ejs=require(_0x37ea('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x37ea('0x9'));var jsforce=require(_0x37ea('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x37ea('0xb'));var querystring=require(_0x37ea('0xc'));var Papa=require(_0x37ea('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x37ea('0xe'));var as=require(_0x37ea('0xf'));var hardwareService=require(_0x37ea('0x10'));var logger=require(_0x37ea('0x11'))(_0x37ea('0x12'));var utils=require(_0x37ea('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x37ea('0x14'))['db'];var extensions=require(_0x37ea('0x15'));function respondWithStatusCode(_0x4e6461,_0x580deb){_0x580deb=_0x580deb||0xcc;return function(_0x22d983){if(_0x22d983){return _0x4e6461[_0x37ea('0x16')](_0x580deb);}return _0x4e6461[_0x37ea('0x17')](_0x580deb)[_0x37ea('0x18')]();};}function respondWithResult(_0x25eaaf,_0x2bd3e9){_0x2bd3e9=_0x2bd3e9||0xc8;return function(_0xf77f49){if(_0xf77f49){return _0x25eaaf[_0x37ea('0x17')](_0x2bd3e9)[_0x37ea('0x19')](_0xf77f49);}};}function respondWithFilteredResult(_0x1a5575,_0x9ebb75){return function(_0x410dd1){if(_0x410dd1){var _0x28e821=typeof _0x9ebb75[_0x37ea('0x1a')]===_0x37ea('0x1b')&&typeof _0x9ebb75[_0x37ea('0x1c')]===_0x37ea('0x1b');var _0x3b6e32=_0x410dd1[_0x37ea('0x1d')];var _0x4c113b=_0x28e821?0x0:_0x9ebb75[_0x37ea('0x1a')];var _0x129ca3=_0x28e821?_0x410dd1[_0x37ea('0x1d')]:_0x9ebb75[_0x37ea('0x1a')]+_0x9ebb75[_0x37ea('0x1c')];var _0x6b2b5b;if(_0x129ca3>=_0x3b6e32){_0x129ca3=_0x3b6e32;_0x6b2b5b=0xc8;}else{_0x6b2b5b=0xce;}_0x1a5575[_0x37ea('0x17')](_0x6b2b5b);return _0x1a5575[_0x37ea('0x1e')](_0x37ea('0x1f'),_0x4c113b+'-'+_0x129ca3+'/'+_0x3b6e32)[_0x37ea('0x19')](_0x410dd1);}return null;};}function patchUpdates(_0x6a4f60){return function(_0xe2fae6){try{jsonpatch[_0x37ea('0x20')](_0xe2fae6,_0x6a4f60,!![]);}catch(_0x7b1cd){return BPromise['reject'](_0x7b1cd);}return _0xe2fae6[_0x37ea('0x21')]();};}function saveUpdates(_0x440f60,_0x42cc4c){return function(_0x17dae3){if(_0x17dae3){return _0x17dae3[_0x37ea('0x22')](_0x440f60)['then'](function(_0x3fcb7a){return _0x3fcb7a;});}return null;};}function removeEntity(_0x1996ec,_0x59af00){return function(_0x584da2){if(_0x584da2){return _0x584da2[_0x37ea('0x23')]()[_0x37ea('0x24')](function(){var _0xe2a737=_0x584da2[_0x37ea('0x25')]({'plain':!![]});var _0x1c2d1f=_0x37ea('0x26');return db[_0x37ea('0x27')][_0x37ea('0x23')]({'where':{'type':_0x1c2d1f,'resourceId':_0xe2a737['id']}})[_0x37ea('0x24')](function(){return _0x584da2;});})[_0x37ea('0x24')](function(){_0x1996ec[_0x37ea('0x17')](0xcc)[_0x37ea('0x18')]();});}};}function handleEntityNotFound(_0x31c09f,_0x16355a){return function(_0x49befd){if(!_0x49befd){_0x31c09f['sendStatus'](0x194);}return _0x49befd;};}function handleError(_0x3b12da,_0x4e7709){_0x4e7709=_0x4e7709||0x1f4;return function(_0x373695){logger[_0x37ea('0x28')](_0x373695[_0x37ea('0x29')]);if(_0x373695[_0x37ea('0x2a')]){delete _0x373695[_0x37ea('0x2a')];}_0x3b12da[_0x37ea('0x17')](_0x4e7709)[_0x37ea('0x2b')](_0x373695);};}exports['index']=function(_0x188de9,_0x14b65b){var _0x249439={},_0x25e811={},_0x3d7eec={'count':0x0,'rows':[]};var _0x4e88f9=_[_0x37ea('0x2c')](db[_0x37ea('0x2d')]['rawAttributes'],function(_0x33ba25){return{'name':_0x33ba25['fieldName'],'type':_0x33ba25[_0x37ea('0x2e')][_0x37ea('0x2f')]};});_0x25e811['model']=_[_0x37ea('0x2c')](_0x4e88f9,_0x37ea('0x2a'));_0x25e811[_0x37ea('0x30')]=_['keys'](_0x188de9[_0x37ea('0x30')]);_0x25e811[_0x37ea('0x31')]=_[_0x37ea('0x32')](_0x25e811[_0x37ea('0x33')],_0x25e811[_0x37ea('0x30')]);_0x249439[_0x37ea('0x34')]=_[_0x37ea('0x32')](_0x25e811['model'],qs[_0x37ea('0x35')](_0x188de9[_0x37ea('0x30')]['fields']));_0x249439['attributes']=_0x249439[_0x37ea('0x34')][_0x37ea('0x36')]?_0x249439[_0x37ea('0x34')]:_0x25e811['model'];if(!_0x188de9[_0x37ea('0x30')]['hasOwnProperty']('nolimit')){_0x249439['limit']=qs[_0x37ea('0x1c')](_0x188de9['query']['limit']);_0x249439['offset']=qs[_0x37ea('0x1a')](_0x188de9[_0x37ea('0x30')][_0x37ea('0x1a')]);}_0x249439['order']=qs['sort'](_0x188de9[_0x37ea('0x30')][_0x37ea('0x37')]);_0x249439['where']=qs['filters'](_[_0x37ea('0x38')](_0x188de9[_0x37ea('0x30')],_0x25e811[_0x37ea('0x31')]),_0x4e88f9);if(_0x188de9[_0x37ea('0x30')][_0x37ea('0x39')]){_0x249439[_0x37ea('0x3a')]=_[_0x37ea('0x3b')](_0x249439[_0x37ea('0x3a')],{'$or':_[_0x37ea('0x2c')](_0x4e88f9,function(_0x5ea83a){if(_0x5ea83a[_0x37ea('0x2e')]!==_0x37ea('0x3c')){var _0x183280={};_0x183280[_0x5ea83a[_0x37ea('0x2a')]]={'$like':'%'+_0x188de9[_0x37ea('0x30')][_0x37ea('0x39')]+'%'};return _0x183280;}})});}_0x249439=_[_0x37ea('0x3b')]({},_0x249439,_0x188de9[_0x37ea('0x3d')]);var _0x14b8dc={'where':_0x249439[_0x37ea('0x3a')]};return db[_0x37ea('0x2d')][_0x37ea('0x1d')](_0x14b8dc)[_0x37ea('0x24')](function(_0x29d4fd){_0x3d7eec[_0x37ea('0x1d')]=_0x29d4fd;if(_0x188de9[_0x37ea('0x30')][_0x37ea('0x3e')]){_0x249439[_0x37ea('0x3f')]=[{'all':!![]}];}return db[_0x37ea('0x2d')]['findAll'](_0x249439);})[_0x37ea('0x24')](function(_0x2bc380){_0x3d7eec['rows']=_0x2bc380;return _0x3d7eec;})[_0x37ea('0x24')](respondWithFilteredResult(_0x14b65b,_0x249439))[_0x37ea('0x40')](handleError(_0x14b65b,null));};exports['show']=function(_0x12b851,_0x3e3469){var _0x563f1a={'raw':!![],'where':{'id':_0x12b851[_0x37ea('0x41')]['id']}},_0x314a29={};_0x314a29[_0x37ea('0x33')]=_[_0x37ea('0x42')](db['Interval'][_0x37ea('0x43')]);_0x314a29[_0x37ea('0x30')]=_[_0x37ea('0x42')](_0x12b851['query']);_0x314a29[_0x37ea('0x31')]=_[_0x37ea('0x32')](_0x314a29['model'],_0x314a29['query']);_0x563f1a['attributes']=_[_0x37ea('0x32')](_0x314a29[_0x37ea('0x33')],qs[_0x37ea('0x35')](_0x12b851['query'][_0x37ea('0x35')]));_0x563f1a[_0x37ea('0x34')]=_0x563f1a['attributes']['length']?_0x563f1a[_0x37ea('0x34')]:_0x314a29[_0x37ea('0x33')];if(_0x12b851[_0x37ea('0x30')][_0x37ea('0x3e')]){_0x563f1a[_0x37ea('0x3f')]=[{'all':!![]}];}_0x563f1a=_['merge']({},_0x563f1a,_0x12b851[_0x37ea('0x3d')]);return db[_0x37ea('0x2d')][_0x37ea('0x44')](_0x563f1a)['then'](handleEntityNotFound(_0x3e3469,null))[_0x37ea('0x24')](respondWithResult(_0x3e3469,null))['catch'](handleError(_0x3e3469,null));};exports['create']=function(_0x435738,_0x4f81ae){return db['Interval']['create'](_0x435738[_0x37ea('0x45')],{})[_0x37ea('0x24')](function(_0x469272){var _0x4e9ff3=_0x435738[_0x37ea('0x46')]['get']({'plain':!![]});if(!_0x4e9ff3)throw new Error(_0x37ea('0x47'));if(_0x4e9ff3[_0x37ea('0x48')]===_0x37ea('0x46')){var _0x1bf3aa=_0x469272[_0x37ea('0x25')]({'plain':!![]});var _0x2a4784='Intervals';return db[_0x37ea('0x49')][_0x37ea('0x44')]({'where':{'name':_0x2a4784,'userProfileId':_0x4e9ff3['userProfileId']},'raw':!![]})['then'](function(_0x33af71){if(_0x33af71&&_0x33af71['autoAssociation']===0x0){return db[_0x37ea('0x27')][_0x37ea('0x4a')]({'name':_0x1bf3aa['name'],'resourceId':_0x1bf3aa['id'],'type':_0x33af71[_0x37ea('0x2a')],'sectionId':_0x33af71['id']},{})[_0x37ea('0x24')](function(){return _0x469272;});}else{return _0x469272;}})[_0x37ea('0x40')](function(_0x50f83f){logger['error'](_0x37ea('0x4b'),_0x50f83f);throw _0x50f83f;});}return _0x469272;})[_0x37ea('0x24')](respondWithResult(_0x4f81ae,0xc9))[_0x37ea('0x40')](handleError(_0x4f81ae,null));};exports['update']=function(_0x359f12,_0x4e9643){if(_0x359f12['body']['id']){delete _0x359f12[_0x37ea('0x45')]['id'];}return db[_0x37ea('0x2d')][_0x37ea('0x44')]({'where':{'id':_0x359f12[_0x37ea('0x41')]['id']}})[_0x37ea('0x24')](handleEntityNotFound(_0x4e9643,null))['then'](saveUpdates(_0x359f12['body'],null))['then'](respondWithResult(_0x4e9643,null))[_0x37ea('0x40')](handleError(_0x4e9643,null));};exports[_0x37ea('0x23')]=function(_0x1d38b3,_0xda39b2){return db['Interval'][_0x37ea('0x44')]({'where':{'id':_0x1d38b3[_0x37ea('0x41')]['id']}})['then'](handleEntityNotFound(_0xda39b2,null))[_0x37ea('0x24')](removeEntity(_0xda39b2,null))[_0x37ea('0x40')](handleError(_0xda39b2,null));};exports[_0x37ea('0x4c')]=function(_0x2c6e4c,_0x1d53a0,_0x6e7a1){if(_0x2c6e4c[_0x37ea('0x45')]['id']){delete _0x2c6e4c[_0x37ea('0x45')]['id'];}return db[_0x37ea('0x2d')][_0x37ea('0x44')]({'where':{'id':_0x2c6e4c[_0x37ea('0x41')]['id']}})[_0x37ea('0x24')](handleEntityNotFound(_0x1d53a0,null))['then'](function(_0x39d79e){if(_0x39d79e){_0x2c6e4c['body'][_0x37ea('0x4d')]=_0x39d79e['id'];return db[_0x37ea('0x2d')][_0x37ea('0x4a')](_0x2c6e4c[_0x37ea('0x45')]);}})[_0x37ea('0x24')](respondWithResult(_0x1d53a0,null))[_0x37ea('0x40')](handleError(_0x1d53a0,null));};exports[_0x37ea('0x4e')]=function(_0x56c2d5,_0x141879,_0xf5c856){var _0x54ba67={};var _0x519cf1={};var _0x194c48;var _0x5b5b27;return db[_0x37ea('0x2d')][_0x37ea('0x4f')]({'where':{'id':_0x56c2d5[_0x37ea('0x41')]['id']}})[_0x37ea('0x24')](handleEntityNotFound(_0x141879,null))[_0x37ea('0x24')](function(_0x288de6){if(_0x288de6){_0x194c48=_0x288de6;_0x519cf1[_0x37ea('0x33')]=_[_0x37ea('0x42')](db[_0x37ea('0x2d')][_0x37ea('0x43')]);_0x519cf1['query']=_[_0x37ea('0x42')](_0x56c2d5['query']);_0x519cf1['filters']=_[_0x37ea('0x32')](_0x519cf1[_0x37ea('0x33')],_0x519cf1[_0x37ea('0x30')]);_0x54ba67['attributes']=_[_0x37ea('0x32')](_0x519cf1[_0x37ea('0x33')],qs['fields'](_0x56c2d5[_0x37ea('0x30')][_0x37ea('0x35')]));_0x54ba67[_0x37ea('0x34')]=_0x54ba67[_0x37ea('0x34')]['length']?_0x54ba67[_0x37ea('0x34')]:_0x519cf1['model'];_0x54ba67['order']=qs[_0x37ea('0x37')](_0x56c2d5[_0x37ea('0x30')][_0x37ea('0x37')]);_0x54ba67[_0x37ea('0x3a')]=qs[_0x37ea('0x31')](_[_0x37ea('0x38')](_0x56c2d5[_0x37ea('0x30')],_0x519cf1[_0x37ea('0x31')]));if(_0x56c2d5['query']['filter']){_0x54ba67['where']=_[_0x37ea('0x3b')](_0x54ba67[_0x37ea('0x3a')],{'$or':_[_0x37ea('0x2c')](_0x54ba67[_0x37ea('0x34')],function(_0x79411){var _0x1f9d14={};_0x1f9d14[_0x79411]={'$like':'%'+_0x56c2d5[_0x37ea('0x30')]['filter']+'%'};return _0x1f9d14;})});}_0x54ba67=_[_0x37ea('0x3b')]({},_0x54ba67,_0x56c2d5[_0x37ea('0x3d')]);return _0x194c48[_0x37ea('0x4e')](_0x54ba67);}})[_0x37ea('0x24')](function(_0x10bf2a){if(_0x10bf2a){_0x5b5b27=_0x10bf2a[_0x37ea('0x36')];if(!_0x56c2d5[_0x37ea('0x30')][_0x37ea('0x50')]('nolimit')){_0x54ba67[_0x37ea('0x1c')]=qs[_0x37ea('0x1c')](_0x56c2d5[_0x37ea('0x30')][_0x37ea('0x1c')]);_0x54ba67['offset']=qs['offset'](_0x56c2d5[_0x37ea('0x30')][_0x37ea('0x1a')]);}return _0x194c48[_0x37ea('0x4e')](_0x54ba67);}})[_0x37ea('0x24')](function(_0x355313){if(_0x355313){return _0x355313?{'count':_0x5b5b27,'rows':_0x355313}:null;}})['then'](respondWithResult(_0x141879,null))[_0x37ea('0x40')](handleError(_0x141879,null));};exports[_0x37ea('0x51')]=function(_0x42925,_0x266e9d,_0x41c8e2){return db['Interval'][_0x37ea('0x4f')]({'where':{'id':_0x42925['params']['id']}})[_0x37ea('0x24')](handleEntityNotFound(_0x266e9d,null))[_0x37ea('0x24')](function(_0x2d1045){if(_0x2d1045){return db[_0x37ea('0x52')][_0x37ea('0x53')](function(_0xf27b33){return db[_0x37ea('0x2d')][_0x37ea('0x23')]({'where':{'IntervalId':_0x42925[_0x37ea('0x41')]['id']},'transaction':_0xf27b33})[_0x37ea('0x24')](function(_0x19b737){var _0x231304=_[_0x37ea('0x2c')](_0x42925[_0x37ea('0x45')],function(_0x15ee32){delete _0x15ee32['id'];_0x15ee32['IntervalId']=_0x42925[_0x37ea('0x41')]['id'];return _0x15ee32;});return db[_0x37ea('0x2d')][_0x37ea('0x54')](_0x231304,{'transaction':_0xf27b33});});})[_0x37ea('0x24')](function(){return db[_0x37ea('0x2d')]['findAll']({'where':{'IntervalId':_0x42925['params']['id']}});});}})['then'](respondWithResult(_0x266e9d,null))[_0x37ea('0x40')](handleError(_0x266e9d,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index 2347b25..641ecee 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 _0x17ac=['tools_intervals','rewrite','lodash','util','../../config/logger','moment','bluebird','rimraf','../../config/environment','./interval.attributes','../../components/extensions/rewrite','define','Interval'];(function(_0x5a26db,_0x2c5ccd){var _0x4619dd=function(_0x21e28f){while(--_0x21e28f){_0x5a26db['push'](_0x5a26db['shift']());}};_0x4619dd(++_0x2c5ccd);}(_0x17ac,0x13a));var _0xc17a=function(_0x34beef,_0x41d368){_0x34beef=_0x34beef-0x0;var _0x5c45ca=_0x17ac[_0x34beef];return _0x5c45ca;};'use strict';var _=require(_0xc17a('0x0'));var util=require(_0xc17a('0x1'));var logger=require(_0xc17a('0x2'))('api');var moment=require(_0xc17a('0x3'));var BPromise=require(_0xc17a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc17a('0x5'));var config=require(_0xc17a('0x6'));var attributes=require(_0xc17a('0x7'));var extensions=require(_0xc17a('0x8'));module['exports']=function(_0x27ce5e,_0x1c60e1){return _0x27ce5e[_0xc17a('0x9')](_0xc17a('0xa'),attributes,{'tableName':_0xc17a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x278227,_0x448adf){extensions[_0xc17a('0xc')](_0x27ce5e,_0x278227);},'afterBulkCreate':function(_0x1a9588,_0x2b35e8,_0x1c93ae){_0x1c93ae();extensions[_0xc17a('0xc')](_0x27ce5e,_0x1a9588[0x0]);},'afterUpdate':function(_0x458392,_0x146bd3){extensions[_0xc17a('0xc')](_0x27ce5e,_0x458392);},'afterDestroy':function(_0x8c409c,_0x13de8c){extensions[_0xc17a('0xc')](_0x27ce5e,_0x8c409c);}}});}; \ No newline at end of file +var _0x36fe=['bluebird','request-promise','path','rimraf','../../config/environment','./interval.attributes','exports','define','tools_intervals','rewrite','lodash','util','../../config/logger','api','moment'];(function(_0x18cac4,_0x57a4d5){var _0x2227c6=function(_0x72934d){while(--_0x72934d){_0x18cac4['push'](_0x18cac4['shift']());}};_0x2227c6(++_0x57a4d5);}(_0x36fe,0x127));var _0xe36f=function(_0x197d5c,_0x1936b0){_0x197d5c=_0x197d5c-0x0;var _0x13dc71=_0x36fe[_0x197d5c];return _0x13dc71;};'use strict';var _=require(_0xe36f('0x0'));var util=require(_0xe36f('0x1'));var logger=require(_0xe36f('0x2'))(_0xe36f('0x3'));var moment=require(_0xe36f('0x4'));var BPromise=require(_0xe36f('0x5'));var rp=require(_0xe36f('0x6'));var fs=require('fs');var path=require(_0xe36f('0x7'));var rimraf=require(_0xe36f('0x8'));var config=require(_0xe36f('0x9'));var attributes=require(_0xe36f('0xa'));var extensions=require('../../components/extensions/rewrite');module[_0xe36f('0xb')]=function(_0x485a51,_0x349c9e){return _0x485a51[_0xe36f('0xc')]('Interval',attributes,{'tableName':_0xe36f('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x21f2a5,_0x50fd83){extensions[_0xe36f('0xe')](_0x485a51,_0x21f2a5);},'afterBulkCreate':function(_0x386c00,_0xa26c3d,_0x44bc2f){_0x44bc2f();extensions[_0xe36f('0xe')](_0x485a51,_0x386c00[0x0]);},'afterUpdate':function(_0x5b23ff,_0x212ff9){extensions['rewrite'](_0x485a51,_0x5b23ff);},'afterDestroy':function(_0x2095e1,_0x2b1c1c){extensions[_0xe36f('0xe')](_0x485a51,_0x2095e1);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index 6b10dc3..07f7f89 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(_0x1afabf,_0x56fdcc){var _0x497ff1=function(_0x2f6104){while(--_0x2f6104){_0x1afabf['push'](_0x1afabf['shift']());}};_0x497ff1(++_0x56fdcc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0xa9e0[_0x521929];return _0x632436;};'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(_0x54c9dd,_0x233a86){var _0x855156=function(_0x2dd60b){while(--_0x2dd60b){_0x54c9dd['push'](_0x54c9dd['shift']());}};_0x855156(++_0x233a86);}(_0xa9e0,0x123));var _0x0a9e=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xa9e0[_0x12d033];return _0x3b4e80;};'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 2d4d3f5..8d816a7 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 _0xb10b=['./jira.controller','post','send','exports','express','../../components/auth/service'];(function(_0x243b59,_0x3f9495){var _0x3e1676=function(_0x354052){while(--_0x354052){_0x243b59['push'](_0x243b59['shift']());}};_0x3e1676(++_0x3f9495);}(_0xb10b,0x12a));var _0xbb10=function(_0x18175b,_0x4d7376){_0x18175b=_0x18175b-0x0;var _0x210d45=_0xb10b[_0x18175b];return _0x210d45;};'use strict';var express=require(_0xbb10('0x0'));var router=express['Router']();var auth=require(_0xbb10('0x1'));var controller=require(_0xbb10('0x2'));router[_0xbb10('0x3')]('/',auth['isAuthenticated'](),controller[_0xbb10('0x4')]);module[_0xbb10('0x5')]=router; \ No newline at end of file +var _0x2032=['isAuthenticated','send','Router','../../components/auth/service','./jira.controller'];(function(_0x4c503f,_0x25fefa){var _0x483280=function(_0x48a649){while(--_0x48a649){_0x4c503f['push'](_0x4c503f['shift']());}};_0x483280(++_0x25fefa);}(_0x2032,0xd9));var _0x2203=function(_0x28a635,_0x42fdbf){_0x28a635=_0x28a635-0x0;var _0x2abd45=_0x2032[_0x28a635];return _0x2abd45;};'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 diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index 203a449..462c166 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 _0x9088=['/rest/api/2/issue','POST','application/json','Basic\x20','toString','base64','request','setEncoding','utf8','data','end','status','statusCode','json','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','body','x-forwarded-for','remoteAddress','connection','https','../../config/logger','support','3eAmWpBVP0','key','summary','Report','\x20from\x20','description','stringify','Bug','email','fields','customfield_11501','oldToken','newToken','customfield_11503','name','customfield_11504'];(function(_0x21b36c,_0x543483){var _0x236627=function(_0x174f99){while(--_0x174f99){_0x21b36c['push'](_0x21b36c['shift']());}};_0x236627(++_0x543483);}(_0x9088,0x68));var _0x8908=function(_0x34131d,_0x3edb2e){_0x34131d=_0x34131d-0x0;var _0x1857da=_0x9088[_0x34131d];return _0x1857da;};'use strict';var BPromise=require('bluebird');var https=require(_0x8908('0x0'));var logger=require(_0x8908('0x1'))('api');var USERNAME=_0x8908('0x2');var PASSWORD=_0x8908('0x3');function openIssue(_0x3ce013,_0x1b548a){var _0x4abcb8={'fields':{'project':{'key':_0x3ce013[_0x8908('0x4')]||'MOTGUI'},'summary':(_0x3ce013[_0x8908('0x5')]||_0x8908('0x6'))+_0x8908('0x7')+_0x3ce013['ip'],'description':_0x3ce013[_0x8908('0x8')]||JSON[_0x8908('0x9')](_0x3ce013),'issuetype':{'name':_0x3ce013['issuetype']||_0x8908('0xa')}}};_0x4abcb8['fields']['customfield_11500']=_0x3ce013[_0x8908('0xb')];_0x4abcb8[_0x8908('0xc')][_0x8908('0xd')]=_0x3ce013[_0x8908('0xe')];_0x4abcb8[_0x8908('0xc')]['customfield_11502']=_0x3ce013[_0x8908('0xf')];_0x4abcb8[_0x8908('0xc')][_0x8908('0x10')]=_0x3ce013[_0x8908('0x11')];_0x4abcb8[_0x8908('0xc')][_0x8908('0x12')]=_0x3ce013['reason'];_0x4abcb8[_0x8908('0xc')]['customfield_10102']=_0x3ce013['ip'];var _0x5b2d0c={'host':'track.xcallymotion.com','port':0x1bb,'path':_0x8908('0x13'),'method':_0x8908('0x14'),'timeout':0x4e20,'headers':{'Content-Type':_0x8908('0x15'),'Authorization':_0x8908('0x16')+new Buffer(USERNAME+':'+PASSWORD)[_0x8908('0x17')](_0x8908('0x18'))}};var _0x3ac1f0=JSON['stringify'](_0x4abcb8);var _0x281598=https[_0x8908('0x19')](_0x5b2d0c,function(_0x3ecaba){_0x3ecaba[_0x8908('0x1a')](_0x8908('0x1b'));var _0x3c2203='';_0x3ecaba['on'](_0x8908('0x1c'),function(_0x38b7ed){_0x3c2203+=_0x38b7ed;});_0x3ecaba['on'](_0x8908('0x1d'),function(){if(_0x1b548a){return _0x1b548a[_0x8908('0x1e')](_0x3ecaba[_0x8908('0x1f')])[_0x8908('0x20')](JSON['parse'](_0x3c2203));}});});_0x281598['on'](_0x8908('0x21'),function(_0x5a0940){if(_0x1b548a){return _0x1b548a[_0x8908('0x1e')](0x1f4)['json']({'errors':[{'message':_0x8908('0x22'),'type':_0x8908('0x23')}]});}});_0x281598[_0x8908('0x24')](_0x3ac1f0);_0x281598[_0x8908('0x1d')]();}exports['openIssue']=openIssue;exports['send']=function(_0x20cd0a,_0x4212cb){_0x20cd0a[_0x8908('0x25')]['ip']=_0x20cd0a['headers'][_0x8908('0x26')]||_0x20cd0a['connection'][_0x8908('0x27')]||_0x20cd0a['socket'][_0x8908('0x27')]||_0x20cd0a[_0x8908('0x28')]['socket'][_0x8908('0x27')];return openIssue(_0x20cd0a[_0x8908('0x25')],_0x4212cb);}; \ No newline at end of file +var _0x48c9=['email','oldToken','customfield_11502','newToken','name','customfield_11504','reason','track.xcallymotion.com','POST','application/json','Basic\x20','toString','base64','request','setEncoding','utf8','data','status','statusCode','json','parse','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','write','openIssue','headers','x-forwarded-for','connection','remoteAddress','socket','body','bluebird','../../config/logger','api','3eAmWpBVP0','MOTGUI','summary','description','stringify','issuetype','Bug','fields','customfield_11500'];(function(_0xda7fa9,_0x453ee5){var _0x4faa98=function(_0xea7b20){while(--_0xea7b20){_0xda7fa9['push'](_0xda7fa9['shift']());}};_0x4faa98(++_0x453ee5);}(_0x48c9,0x75));var _0x948c=function(_0x1709e3,_0x53bcdf){_0x1709e3=_0x1709e3-0x0;var _0x28683f=_0x48c9[_0x1709e3];return _0x28683f;};'use strict';var BPromise=require(_0x948c('0x0'));var https=require('https');var logger=require(_0x948c('0x1'))(_0x948c('0x2'));var USERNAME='support';var PASSWORD=_0x948c('0x3');function openIssue(_0x48b672,_0x1e7070){var _0x4be378={'fields':{'project':{'key':_0x48b672['key']||_0x948c('0x4')},'summary':(_0x48b672[_0x948c('0x5')]||'Report')+'\x20from\x20'+_0x48b672['ip'],'description':_0x48b672[_0x948c('0x6')]||JSON[_0x948c('0x7')](_0x48b672),'issuetype':{'name':_0x48b672[_0x948c('0x8')]||_0x948c('0x9')}}};_0x4be378[_0x948c('0xa')][_0x948c('0xb')]=_0x48b672[_0x948c('0xc')];_0x4be378[_0x948c('0xa')]['customfield_11501']=_0x48b672[_0x948c('0xd')];_0x4be378[_0x948c('0xa')][_0x948c('0xe')]=_0x48b672[_0x948c('0xf')];_0x4be378[_0x948c('0xa')]['customfield_11503']=_0x48b672[_0x948c('0x10')];_0x4be378[_0x948c('0xa')][_0x948c('0x11')]=_0x48b672[_0x948c('0x12')];_0x4be378[_0x948c('0xa')]['customfield_10102']=_0x48b672['ip'];var _0x3d1679={'host':_0x948c('0x13'),'port':0x1bb,'path':'/rest/api/2/issue','method':_0x948c('0x14'),'timeout':0x4e20,'headers':{'Content-Type':_0x948c('0x15'),'Authorization':_0x948c('0x16')+new Buffer(USERNAME+':'+PASSWORD)[_0x948c('0x17')](_0x948c('0x18'))}};var _0x571cf5=JSON['stringify'](_0x4be378);var _0x5d1405=https[_0x948c('0x19')](_0x3d1679,function(_0x25f31){_0x25f31[_0x948c('0x1a')](_0x948c('0x1b'));var _0x4fd0a2='';_0x25f31['on'](_0x948c('0x1c'),function(_0x141d7e){_0x4fd0a2+=_0x141d7e;});_0x25f31['on']('end',function(){if(_0x1e7070){return _0x1e7070[_0x948c('0x1d')](_0x25f31[_0x948c('0x1e')])[_0x948c('0x1f')](JSON[_0x948c('0x20')](_0x4fd0a2));}});});_0x5d1405['on'](_0x948c('0x21'),function(_0x4b2416){if(_0x1e7070){return _0x1e7070[_0x948c('0x1d')](0x1f4)[_0x948c('0x1f')]({'errors':[{'message':_0x948c('0x22'),'type':'api.jira'}]});}});_0x5d1405[_0x948c('0x23')](_0x571cf5);_0x5d1405['end']();}exports[_0x948c('0x24')]=openIssue;exports['send']=function(_0x6484e4,_0x5961db){_0x6484e4['body']['ip']=_0x6484e4[_0x948c('0x25')][_0x948c('0x26')]||_0x6484e4[_0x948c('0x27')][_0x948c('0x28')]||_0x6484e4['socket'][_0x948c('0x28')]||_0x6484e4[_0x948c('0x27')][_0x948c('0x29')]['remoteAddress'];return openIssue(_0x6484e4[_0x948c('0x2a')],_0x5961db);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index ced673f..e29048f 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 _0x6c76=['express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe','/:id','show','post','create','update','delete','destroy','multer','util','path'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x6c76,0x184));var _0x66c7=function(_0x1b0c08,_0xd7531f){_0x1b0c08=_0x1b0c08-0x0;var _0x123dbf=_0x6c76[_0x1b0c08];return _0x123dbf;};'use strict';var multer=require(_0x66c7('0x0'));var util=require(_0x66c7('0x1'));var path=require(_0x66c7('0x2'));var timeout=require('connect-timeout');var express=require(_0x66c7('0x3'));var router=express[_0x66c7('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x66c7('0x5'));var config=require(_0x66c7('0x6'));var controller=require('./jscriptyAnswerReport.controller');router[_0x66c7('0x7')]('/',auth[_0x66c7('0x8')](),controller['index']);router[_0x66c7('0x7')]('/describe',auth['isAuthenticated'](),controller[_0x66c7('0x9')]);router[_0x66c7('0x7')](_0x66c7('0xa'),auth['isAuthenticated'](),controller[_0x66c7('0xb')]);router[_0x66c7('0xc')]('/',auth[_0x66c7('0x8')](),controller[_0x66c7('0xd')]);router['put'](_0x66c7('0xa'),auth[_0x66c7('0x8')](),controller[_0x66c7('0xe')]);router[_0x66c7('0xf')](_0x66c7('0xa'),auth[_0x66c7('0x8')](),controller[_0x66c7('0x10')]);module['exports']=router; \ No newline at end of file +var _0x878f=['./jscriptyAnswerReport.controller','get','/describe','/:id','post','isAuthenticated','create','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x4582a9,_0x52e47d){var _0x49c003=function(_0x2b228d){while(--_0x2b228d){_0x4582a9['push'](_0x4582a9['shift']());}};_0x49c003(++_0x52e47d);}(_0x878f,0x173));var _0xf878=function(_0x3e8dc7,_0x147ccd){_0x3e8dc7=_0x3e8dc7-0x0;var _0x40c96f=_0x878f[_0x3e8dc7];return _0x40c96f;};'use strict';var multer=require('multer');var util=require(_0xf878('0x0'));var path=require(_0xf878('0x1'));var timeout=require(_0xf878('0x2'));var express=require(_0xf878('0x3'));var router=express[_0xf878('0x4')]();var fs_extra=require(_0xf878('0x5'));var auth=require(_0xf878('0x6'));var interaction=require(_0xf878('0x7'));var config=require(_0xf878('0x8'));var controller=require(_0xf878('0x9'));router[_0xf878('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0xf878('0xa')](_0xf878('0xb'),auth['isAuthenticated'](),controller['describe']);router['get'](_0xf878('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xf878('0xd')]('/',auth[_0xf878('0xe')](),controller[_0xf878('0xf')]);router['put'](_0xf878('0xc'),auth[_0xf878('0xe')](),controller['update']);router[_0xf878('0x10')]('/:id',auth[_0xf878('0xe')](),controller[_0xf878('0x11')]);module[_0xf878('0x12')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index 07c1a20..847edb5 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(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0x7a54,0x106));var _0x47a5=function(_0x56de2a,_0x14bfe1){_0x56de2a=_0x56de2a-0x0;var _0x56de52=_0x7a54[_0x56de2a];return _0x56de52;};'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(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0x7a54,0x106));var _0x47a5=function(_0x228078,_0x182e1a){_0x228078=_0x228078-0x0;var _0x4c03ba=_0x7a54[_0x228078];return _0x4c03ba;};'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 557996f..479ea60 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 _0x02a7=['then','destroy','end','stack','name','send','index','map','JscriptyAnswerReport','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','describe','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','undefined','count','offset','status','set','Content-Range','json','apply','reject','save','update'];(function(_0x1f1305,_0x2435f5){var _0x571a9d=function(_0x411dfc){while(--_0x411dfc){_0x1f1305['push'](_0x1f1305['shift']());}};_0x571a9d(++_0x2435f5);}(_0x02a7,0x7a));var _0x702a=function(_0x1a35f3,_0x1dba47){_0x1a35f3=_0x1a35f3-0x0;var _0x5bc826=_0x02a7[_0x1a35f3];return _0x5bc826;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x702a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x702a('0x1'));var moment=require(_0x702a('0x2'));var BPromise=require(_0x702a('0x3'));var Mustache=require(_0x702a('0x4'));var util=require(_0x702a('0x5'));var path=require(_0x702a('0x6'));var sox=require(_0x702a('0x7'));var csv=require('to-csv');var ejs=require(_0x702a('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x702a('0x9'));var squel=require(_0x702a('0xa'));var crypto=require(_0x702a('0xb'));var jsforce=require(_0x702a('0xc'));var deskjs=require(_0x702a('0xd'));var toCsv=require(_0x702a('0xe'));var querystring=require(_0x702a('0xf'));var Papa=require('papaparse');var Redis=require(_0x702a('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x702a('0x11'));var hardwareService=require(_0x702a('0x12'));var logger=require(_0x702a('0x13'))(_0x702a('0x14'));var utils=require('../../config/utils');var config=require(_0x702a('0x15'));var licenseUtil=require(_0x702a('0x16'));var db=require(_0x702a('0x17'))['db'];function respondWithStatusCode(_0x221b35,_0x4688d1){_0x4688d1=_0x4688d1||0xcc;return function(_0x75455){if(_0x75455){return _0x221b35[_0x702a('0x18')](_0x4688d1);}return _0x221b35['status'](_0x4688d1)['end']();};}function respondWithResult(_0x38139d,_0x57f5fc){_0x57f5fc=_0x57f5fc||0xc8;return function(_0x576cf8){if(_0x576cf8){return _0x38139d['status'](_0x57f5fc)['json'](_0x576cf8);}};}function respondWithFilteredResult(_0x5c768d,_0x44f7fd){return function(_0x3c9770){if(_0x3c9770){var _0xa124dd=typeof _0x44f7fd['offset']==='undefined'&&typeof _0x44f7fd['limit']===_0x702a('0x19');var _0x469cb2=_0x3c9770[_0x702a('0x1a')];var _0x492cfb=_0xa124dd?0x0:_0x44f7fd[_0x702a('0x1b')];var _0x5ec1b3=_0xa124dd?_0x3c9770[_0x702a('0x1a')]:_0x44f7fd[_0x702a('0x1b')]+_0x44f7fd['limit'];var _0x4f8b29;if(_0x5ec1b3>=_0x469cb2){_0x5ec1b3=_0x469cb2;_0x4f8b29=0xc8;}else{_0x4f8b29=0xce;}_0x5c768d[_0x702a('0x1c')](_0x4f8b29);return _0x5c768d[_0x702a('0x1d')](_0x702a('0x1e'),_0x492cfb+'-'+_0x5ec1b3+'/'+_0x469cb2)[_0x702a('0x1f')](_0x3c9770);}return null;};}function patchUpdates(_0x332254){return function(_0x3152bf){try{jsonpatch[_0x702a('0x20')](_0x3152bf,_0x332254,!![]);}catch(_0x3a4add){return BPromise[_0x702a('0x21')](_0x3a4add);}return _0x3152bf[_0x702a('0x22')]();};}function saveUpdates(_0x47d0f5,_0x1ecd28){return function(_0x3d213c){if(_0x3d213c){return _0x3d213c[_0x702a('0x23')](_0x47d0f5)[_0x702a('0x24')](function(_0x1d6dae){return _0x1d6dae;});}return null;};}function removeEntity(_0x466b74,_0x2aede0){return function(_0x156212){if(_0x156212){return _0x156212[_0x702a('0x25')]()['then'](function(){_0x466b74[_0x702a('0x1c')](0xcc)[_0x702a('0x26')]();});}};}function handleEntityNotFound(_0x57add6,_0xf08699){return function(_0x1a9fbf){if(!_0x1a9fbf){_0x57add6[_0x702a('0x18')](0x194);}return _0x1a9fbf;};}function handleError(_0xf6b463,_0x3d4ed0){_0x3d4ed0=_0x3d4ed0||0x1f4;return function(_0x2eff20){logger['error'](_0x2eff20[_0x702a('0x27')]);if(_0x2eff20[_0x702a('0x28')]){delete _0x2eff20['name'];}_0xf6b463[_0x702a('0x1c')](_0x3d4ed0)[_0x702a('0x29')](_0x2eff20);};}exports[_0x702a('0x2a')]=function(_0x21ba99,_0x1973c7){var _0xa0877a={},_0x1596a8={},_0x5c6da4={'count':0x0,'rows':[]};var _0x2d7044=_[_0x702a('0x2b')](db[_0x702a('0x2c')][_0x702a('0x2d')],function(_0x511e7e){return{'name':_0x511e7e[_0x702a('0x2e')],'type':_0x511e7e['type'][_0x702a('0x2f')]};});_0x1596a8[_0x702a('0x30')]=_['map'](_0x2d7044,'name');_0x1596a8[_0x702a('0x31')]=_[_0x702a('0x32')](_0x21ba99['query']);_0x1596a8[_0x702a('0x33')]=_['intersection'](_0x1596a8['model'],_0x1596a8[_0x702a('0x31')]);_0xa0877a[_0x702a('0x34')]=_[_0x702a('0x35')](_0x1596a8['model'],qs[_0x702a('0x36')](_0x21ba99[_0x702a('0x31')][_0x702a('0x36')]));_0xa0877a[_0x702a('0x34')]=_0xa0877a[_0x702a('0x34')][_0x702a('0x37')]?_0xa0877a[_0x702a('0x34')]:_0x1596a8[_0x702a('0x30')];if(!_0x21ba99[_0x702a('0x31')][_0x702a('0x38')](_0x702a('0x39'))){_0xa0877a[_0x702a('0x3a')]=qs[_0x702a('0x3a')](_0x21ba99[_0x702a('0x31')][_0x702a('0x3a')]);_0xa0877a[_0x702a('0x1b')]=qs[_0x702a('0x1b')](_0x21ba99[_0x702a('0x31')]['offset']);}_0xa0877a[_0x702a('0x3b')]=qs[_0x702a('0x3c')](_0x21ba99[_0x702a('0x31')][_0x702a('0x3c')]);_0xa0877a[_0x702a('0x3d')]=qs[_0x702a('0x33')](_[_0x702a('0x3e')](_0x21ba99[_0x702a('0x31')],_0x1596a8['filters']),_0x2d7044);if(_0x21ba99[_0x702a('0x31')][_0x702a('0x3f')]){_0xa0877a[_0x702a('0x3d')]=_[_0x702a('0x40')](_0xa0877a[_0x702a('0x3d')],{'$or':_[_0x702a('0x2b')](_0x2d7044,function(_0x3bc107){if(_0x3bc107[_0x702a('0x41')]!==_0x702a('0x42')){var _0x10fee4={};_0x10fee4[_0x3bc107[_0x702a('0x28')]]={'$like':'%'+_0x21ba99[_0x702a('0x31')][_0x702a('0x3f')]+'%'};return _0x10fee4;}})});}_0xa0877a=_[_0x702a('0x40')]({},_0xa0877a,_0x21ba99['options']);var _0x252b54={'where':_0xa0877a[_0x702a('0x3d')]};return db[_0x702a('0x2c')]['count'](_0x252b54)[_0x702a('0x24')](function(_0x202425){_0x5c6da4[_0x702a('0x1a')]=_0x202425;if(_0x21ba99[_0x702a('0x31')][_0x702a('0x43')]){_0xa0877a[_0x702a('0x44')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0x702a('0x45')](_0xa0877a);})[_0x702a('0x24')](function(_0x34a26f){_0x5c6da4[_0x702a('0x46')]=_0x34a26f;return _0x5c6da4;})[_0x702a('0x24')](respondWithFilteredResult(_0x1973c7,_0xa0877a))[_0x702a('0x47')](handleError(_0x1973c7,null));};exports[_0x702a('0x48')]=function(_0x275262,_0x5a67df){var _0x41a7ab={'raw':!![],'where':{'id':_0x275262[_0x702a('0x49')]['id']}},_0x5dc8f8={};_0x5dc8f8[_0x702a('0x30')]=_[_0x702a('0x32')](db['JscriptyAnswerReport'][_0x702a('0x2d')]);_0x5dc8f8[_0x702a('0x31')]=_[_0x702a('0x32')](_0x275262[_0x702a('0x31')]);_0x5dc8f8[_0x702a('0x33')]=_[_0x702a('0x35')](_0x5dc8f8[_0x702a('0x30')],_0x5dc8f8['query']);_0x41a7ab['attributes']=_[_0x702a('0x35')](_0x5dc8f8[_0x702a('0x30')],qs['fields'](_0x275262['query']['fields']));_0x41a7ab[_0x702a('0x34')]=_0x41a7ab[_0x702a('0x34')][_0x702a('0x37')]?_0x41a7ab[_0x702a('0x34')]:_0x5dc8f8[_0x702a('0x30')];if(_0x275262[_0x702a('0x31')][_0x702a('0x43')]){_0x41a7ab[_0x702a('0x44')]=[{'all':!![]}];}_0x41a7ab=_[_0x702a('0x40')]({},_0x41a7ab,_0x275262[_0x702a('0x4a')]);return db[_0x702a('0x2c')][_0x702a('0x4b')](_0x41a7ab)[_0x702a('0x24')](handleEntityNotFound(_0x5a67df,null))['then'](respondWithResult(_0x5a67df,null))['catch'](handleError(_0x5a67df,null));};exports[_0x702a('0x4c')]=function(_0x919678,_0x5a1cdf){return db[_0x702a('0x2c')][_0x702a('0x4c')](_0x919678['body'],{})[_0x702a('0x24')](respondWithResult(_0x5a1cdf,0xc9))[_0x702a('0x47')](handleError(_0x5a1cdf,null));};exports[_0x702a('0x23')]=function(_0x55e380,_0x3b1bba){if(_0x55e380[_0x702a('0x4d')]['id']){delete _0x55e380['body']['id'];}return db[_0x702a('0x2c')][_0x702a('0x4b')]({'where':{'id':_0x55e380['params']['id']}})[_0x702a('0x24')](handleEntityNotFound(_0x3b1bba,null))[_0x702a('0x24')](saveUpdates(_0x55e380[_0x702a('0x4d')],null))[_0x702a('0x24')](respondWithResult(_0x3b1bba,null))[_0x702a('0x47')](handleError(_0x3b1bba,null));};exports[_0x702a('0x25')]=function(_0xee9f8d,_0xbf2b99){return db[_0x702a('0x2c')]['find']({'where':{'id':_0xee9f8d[_0x702a('0x49')]['id']}})[_0x702a('0x24')](handleEntityNotFound(_0xbf2b99,null))[_0x702a('0x24')](removeEntity(_0xbf2b99,null))[_0x702a('0x47')](handleError(_0xbf2b99,null));};exports['describe']=function(_0x859fe6,_0x4235b4){return db[_0x702a('0x2c')][_0x702a('0x4e')]()[_0x702a('0x24')](respondWithResult(_0x4235b4,null))['catch'](handleError(_0x4235b4,null));}; \ No newline at end of file +var _0x3148=['JscriptyAnswerReport','include','rows','catch','show','options','find','create','body','params','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','offset','order','sort','pick','filter','where','VIRTUAL','merge'];(function(_0x50958d,_0x39d85d){var _0x46ac68=function(_0x531c31){while(--_0x531c31){_0x50958d['push'](_0x50958d['shift']());}};_0x46ac68(++_0x39d85d);}(_0x3148,0x1d3));var _0x8314=function(_0x4c2c33,_0xef5944){_0x4c2c33=_0x4c2c33-0x0;var _0x4c3bff=_0x3148[_0x4c2c33];return _0x4c3bff;};'use strict';var emlformat=require(_0x8314('0x0'));var rimraf=require(_0x8314('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8314('0x2'));var rp=require(_0x8314('0x3'));var moment=require(_0x8314('0x4'));var BPromise=require(_0x8314('0x5'));var Mustache=require('mustache');var util=require(_0x8314('0x6'));var path=require(_0x8314('0x7'));var sox=require(_0x8314('0x8'));var csv=require(_0x8314('0x9'));var ejs=require(_0x8314('0xa'));var fs=require('fs');var fs_extra=require(_0x8314('0xb'));var _=require(_0x8314('0xc'));var squel=require('squel');var crypto=require(_0x8314('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x8314('0xe'));var toCsv=require(_0x8314('0x9'));var querystring=require(_0x8314('0xf'));var Papa=require(_0x8314('0x10'));var Redis=require(_0x8314('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8314('0x12'));var hardwareService=require(_0x8314('0x13'));var logger=require(_0x8314('0x14'))(_0x8314('0x15'));var utils=require('../../config/utils');var config=require(_0x8314('0x16'));var licenseUtil=require(_0x8314('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2f8231,_0x55e770){_0x55e770=_0x55e770||0xcc;return function(_0x5f17d8){if(_0x5f17d8){return _0x2f8231[_0x8314('0x18')](_0x55e770);}return _0x2f8231[_0x8314('0x19')](_0x55e770)[_0x8314('0x1a')]();};}function respondWithResult(_0x24c55c,_0x49587c){_0x49587c=_0x49587c||0xc8;return function(_0x9e90a6){if(_0x9e90a6){return _0x24c55c[_0x8314('0x19')](_0x49587c)[_0x8314('0x1b')](_0x9e90a6);}};}function respondWithFilteredResult(_0x136e09,_0x2c459e){return function(_0x6a588a){if(_0x6a588a){var _0x579a15=typeof _0x2c459e['offset']===_0x8314('0x1c')&&typeof _0x2c459e[_0x8314('0x1d')]===_0x8314('0x1c');var _0x570db3=_0x6a588a[_0x8314('0x1e')];var _0x10e256=_0x579a15?0x0:_0x2c459e['offset'];var _0x1ade63=_0x579a15?_0x6a588a[_0x8314('0x1e')]:_0x2c459e['offset']+_0x2c459e[_0x8314('0x1d')];var _0x55053a;if(_0x1ade63>=_0x570db3){_0x1ade63=_0x570db3;_0x55053a=0xc8;}else{_0x55053a=0xce;}_0x136e09[_0x8314('0x19')](_0x55053a);return _0x136e09[_0x8314('0x1f')](_0x8314('0x20'),_0x10e256+'-'+_0x1ade63+'/'+_0x570db3)['json'](_0x6a588a);}return null;};}function patchUpdates(_0x4ead11){return function(_0x240f4b){try{jsonpatch[_0x8314('0x21')](_0x240f4b,_0x4ead11,!![]);}catch(_0xc37d84){return BPromise[_0x8314('0x22')](_0xc37d84);}return _0x240f4b[_0x8314('0x23')]();};}function saveUpdates(_0x1b1579,_0x2e9052){return function(_0x9e2c24){if(_0x9e2c24){return _0x9e2c24[_0x8314('0x24')](_0x1b1579)[_0x8314('0x25')](function(_0x5c6fd1){return _0x5c6fd1;});}return null;};}function removeEntity(_0xf72fc9,_0x29535a){return function(_0x2b6183){if(_0x2b6183){return _0x2b6183[_0x8314('0x26')]()[_0x8314('0x25')](function(){_0xf72fc9['status'](0xcc)[_0x8314('0x1a')]();});}};}function handleEntityNotFound(_0x2405af,_0x3f3736){return function(_0x4b37de){if(!_0x4b37de){_0x2405af[_0x8314('0x18')](0x194);}return _0x4b37de;};}function handleError(_0x56a047,_0x4c55b1){_0x4c55b1=_0x4c55b1||0x1f4;return function(_0x30d0b2){logger['error'](_0x30d0b2[_0x8314('0x27')]);if(_0x30d0b2['name']){delete _0x30d0b2[_0x8314('0x28')];}_0x56a047[_0x8314('0x19')](_0x4c55b1)[_0x8314('0x29')](_0x30d0b2);};}exports[_0x8314('0x2a')]=function(_0x40efa3,_0x7acf62){var _0x56f1c1={},_0x59fbfc={},_0x33b7e2={'count':0x0,'rows':[]};var _0x19df1f=_[_0x8314('0x2b')](db['JscriptyAnswerReport'][_0x8314('0x2c')],function(_0x37a4a1){return{'name':_0x37a4a1[_0x8314('0x2d')],'type':_0x37a4a1[_0x8314('0x2e')][_0x8314('0x2f')]};});_0x59fbfc[_0x8314('0x30')]=_[_0x8314('0x2b')](_0x19df1f,_0x8314('0x28'));_0x59fbfc[_0x8314('0x31')]=_[_0x8314('0x32')](_0x40efa3[_0x8314('0x31')]);_0x59fbfc[_0x8314('0x33')]=_[_0x8314('0x34')](_0x59fbfc[_0x8314('0x30')],_0x59fbfc[_0x8314('0x31')]);_0x56f1c1[_0x8314('0x35')]=_[_0x8314('0x34')](_0x59fbfc['model'],qs['fields'](_0x40efa3[_0x8314('0x31')][_0x8314('0x36')]));_0x56f1c1['attributes']=_0x56f1c1['attributes'][_0x8314('0x37')]?_0x56f1c1[_0x8314('0x35')]:_0x59fbfc[_0x8314('0x30')];if(!_0x40efa3[_0x8314('0x31')]['hasOwnProperty'](_0x8314('0x38'))){_0x56f1c1[_0x8314('0x1d')]=qs[_0x8314('0x1d')](_0x40efa3[_0x8314('0x31')]['limit']);_0x56f1c1[_0x8314('0x39')]=qs[_0x8314('0x39')](_0x40efa3[_0x8314('0x31')]['offset']);}_0x56f1c1[_0x8314('0x3a')]=qs['sort'](_0x40efa3[_0x8314('0x31')][_0x8314('0x3b')]);_0x56f1c1['where']=qs['filters'](_[_0x8314('0x3c')](_0x40efa3['query'],_0x59fbfc[_0x8314('0x33')]),_0x19df1f);if(_0x40efa3['query'][_0x8314('0x3d')]){_0x56f1c1[_0x8314('0x3e')]=_['merge'](_0x56f1c1[_0x8314('0x3e')],{'$or':_[_0x8314('0x2b')](_0x19df1f,function(_0x207afd){if(_0x207afd[_0x8314('0x2e')]!==_0x8314('0x3f')){var _0x353566={};_0x353566[_0x207afd[_0x8314('0x28')]]={'$like':'%'+_0x40efa3[_0x8314('0x31')][_0x8314('0x3d')]+'%'};return _0x353566;}})});}_0x56f1c1=_[_0x8314('0x40')]({},_0x56f1c1,_0x40efa3['options']);var _0x464337={'where':_0x56f1c1[_0x8314('0x3e')]};return db[_0x8314('0x41')][_0x8314('0x1e')](_0x464337)[_0x8314('0x25')](function(_0x22fc1c){_0x33b7e2['count']=_0x22fc1c;if(_0x40efa3['query']['includeAll']){_0x56f1c1[_0x8314('0x42')]=[{'all':!![]}];}return db['JscriptyAnswerReport']['findAll'](_0x56f1c1);})[_0x8314('0x25')](function(_0x57b751){_0x33b7e2[_0x8314('0x43')]=_0x57b751;return _0x33b7e2;})[_0x8314('0x25')](respondWithFilteredResult(_0x7acf62,_0x56f1c1))[_0x8314('0x44')](handleError(_0x7acf62,null));};exports[_0x8314('0x45')]=function(_0x1c331e,_0x437ae7){var _0x3d3e0d={'raw':!![],'where':{'id':_0x1c331e['params']['id']}},_0x5b369a={};_0x5b369a['model']=_[_0x8314('0x32')](db[_0x8314('0x41')]['rawAttributes']);_0x5b369a[_0x8314('0x31')]=_[_0x8314('0x32')](_0x1c331e[_0x8314('0x31')]);_0x5b369a[_0x8314('0x33')]=_[_0x8314('0x34')](_0x5b369a[_0x8314('0x30')],_0x5b369a[_0x8314('0x31')]);_0x3d3e0d[_0x8314('0x35')]=_[_0x8314('0x34')](_0x5b369a[_0x8314('0x30')],qs['fields'](_0x1c331e[_0x8314('0x31')][_0x8314('0x36')]));_0x3d3e0d[_0x8314('0x35')]=_0x3d3e0d[_0x8314('0x35')][_0x8314('0x37')]?_0x3d3e0d[_0x8314('0x35')]:_0x5b369a[_0x8314('0x30')];if(_0x1c331e[_0x8314('0x31')]['includeAll']){_0x3d3e0d[_0x8314('0x42')]=[{'all':!![]}];}_0x3d3e0d=_[_0x8314('0x40')]({},_0x3d3e0d,_0x1c331e[_0x8314('0x46')]);return db['JscriptyAnswerReport'][_0x8314('0x47')](_0x3d3e0d)[_0x8314('0x25')](handleEntityNotFound(_0x437ae7,null))[_0x8314('0x25')](respondWithResult(_0x437ae7,null))[_0x8314('0x44')](handleError(_0x437ae7,null));};exports[_0x8314('0x48')]=function(_0x3d0a69,_0x28cb99){return db[_0x8314('0x41')]['create'](_0x3d0a69[_0x8314('0x49')],{})[_0x8314('0x25')](respondWithResult(_0x28cb99,0xc9))[_0x8314('0x44')](handleError(_0x28cb99,null));};exports[_0x8314('0x24')]=function(_0x4260b8,_0x35adc0){if(_0x4260b8['body']['id']){delete _0x4260b8['body']['id'];}return db[_0x8314('0x41')][_0x8314('0x47')]({'where':{'id':_0x4260b8['params']['id']}})['then'](handleEntityNotFound(_0x35adc0,null))[_0x8314('0x25')](saveUpdates(_0x4260b8['body'],null))['then'](respondWithResult(_0x35adc0,null))['catch'](handleError(_0x35adc0,null));};exports[_0x8314('0x26')]=function(_0x7847cb,_0x17af9a){return db[_0x8314('0x41')][_0x8314('0x47')]({'where':{'id':_0x7847cb[_0x8314('0x4a')]['id']}})[_0x8314('0x25')](handleEntityNotFound(_0x17af9a,null))['then'](removeEntity(_0x17af9a,null))[_0x8314('0x44')](handleError(_0x17af9a,null));};exports[_0x8314('0x4b')]=function(_0x1a594e,_0x1dfd6b){return db[_0x8314('0x41')]['describe']()[_0x8314('0x25')](respondWithResult(_0x1dfd6b,null))[_0x8314('0x44')](handleError(_0x1dfd6b,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index 4e916b3..71e1423 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 _0x94a5=['util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./jscriptyAnswerReport.attributes','define','JscriptyAnswerReport','report_jscripty_answers','lodash'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x94a5,0x151));var _0x594a=function(_0xf4b05a,_0x301123){_0xf4b05a=_0xf4b05a-0x0;var _0x29812f=_0x94a5[_0xf4b05a];return _0x29812f;};'use strict';var _=require(_0x594a('0x0'));var util=require(_0x594a('0x1'));var logger=require(_0x594a('0x2'))(_0x594a('0x3'));var moment=require(_0x594a('0x4'));var BPromise=require('bluebird');var rp=require(_0x594a('0x5'));var fs=require('fs');var path=require(_0x594a('0x6'));var rimraf=require(_0x594a('0x7'));var config=require(_0x594a('0x8'));var attributes=require(_0x594a('0x9'));module['exports']=function(_0x48fe57,_0x5f630e){return _0x48fe57[_0x594a('0xa')](_0x594a('0xb'),attributes,{'tableName':_0x594a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5ef4=['path','rimraf','../../config/environment','./jscriptyAnswerReport.attributes','exports','define','JscriptyAnswerReport','report_jscripty_answers','util','../../config/logger','api','bluebird','request-promise'];(function(_0x3e5b95,_0x47082e){var _0x30531e=function(_0x227d7e){while(--_0x227d7e){_0x3e5b95['push'](_0x3e5b95['shift']());}};_0x30531e(++_0x47082e);}(_0x5ef4,0x10c));var _0x45ef=function(_0x49fbdf,_0x2699ea){_0x49fbdf=_0x49fbdf-0x0;var _0x5e951e=_0x5ef4[_0x49fbdf];return _0x5e951e;};'use strict';var _=require('lodash');var util=require(_0x45ef('0x0'));var logger=require(_0x45ef('0x1'))(_0x45ef('0x2'));var moment=require('moment');var BPromise=require(_0x45ef('0x3'));var rp=require(_0x45ef('0x4'));var fs=require('fs');var path=require(_0x45ef('0x5'));var rimraf=require(_0x45ef('0x6'));var config=require(_0x45ef('0x7'));var attributes=require(_0x45ef('0x8'));module[_0x45ef('0x9')]=function(_0x4f4951,_0x553031){return _0x4f4951[_0x45ef('0xa')](_0x45ef('0xb'),attributes,{'tableName':_0x45ef('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js index bb5fccd..46c96e7 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 _0x6422=['JscriptyAnswerReport,\x20%s,\x20%s','message','result','catch','lodash','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','error','code'];(function(_0x258b93,_0x188ccc){var _0x35484b=function(_0x2563ea){while(--_0x2563ea){_0x258b93['push'](_0x258b93['shift']());}};_0x35484b(++_0x188ccc);}(_0x6422,0x194));var _0x2642=function(_0x486c6f,_0x916cf4){_0x486c6f=_0x486c6f-0x0;var _0x3e9ff8=_0x6422[_0x486c6f];return _0x3e9ff8;};'use strict';var _=require(_0x2642('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x2642('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2642('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2642('0x3'))(_0x2642('0x4'));var config=require(_0x2642('0x5'));var jayson=require(_0x2642('0x6'));var client=jayson[_0x2642('0x7')][_0x2642('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2bb1c1,_0x36687d,_0x26ea83){return new BPromise(function(_0x252c41,_0x3137c1){return client[_0x2642('0x9')](_0x2bb1c1,_0x26ea83)[_0x2642('0xa')](function(_0x5c2f0c){logger[_0x2642('0xb')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x36687d,_0x2642('0xc'));logger[_0x2642('0xd')]('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0x36687d,'request\x20sent',JSON['stringify'](_0x5c2f0c));if(_0x5c2f0c[_0x2642('0xe')]){if(_0x5c2f0c['error'][_0x2642('0xf')]===0x1f4){logger[_0x2642('0xe')](_0x2642('0x10'),_0x36687d,_0x5c2f0c[_0x2642('0xe')][_0x2642('0x11')]);return _0x3137c1(_0x5c2f0c[_0x2642('0xe')]['message']);}logger[_0x2642('0xe')](_0x2642('0x10'),_0x36687d,_0x5c2f0c[_0x2642('0xe')]['message']);return _0x252c41(_0x5c2f0c['error']['message']);}else{logger[_0x2642('0xb')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x36687d,_0x2642('0xc'));_0x252c41(_0x5c2f0c[_0x2642('0x12')]['message']);}})[_0x2642('0x13')](function(_0x4b2694){logger[_0x2642('0xe')](_0x2642('0x10'),_0x36687d,_0x4b2694);_0x3137c1(_0x4b2694);});});} \ No newline at end of file +var _0x6ac1=['debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','error','code','JscriptyAnswerReport,\x20%s,\x20%s','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','then','info','request\x20sent'];(function(_0xbfef73,_0x25027e){var _0x43c241=function(_0x1a3494){while(--_0x1a3494){_0xbfef73['push'](_0xbfef73['shift']());}};_0x43c241(++_0x25027e);}(_0x6ac1,0xf6));var _0x16ac=function(_0xdb47d8,_0x933e5b){_0xdb47d8=_0xdb47d8-0x0;var _0x5cdfd9=_0x6ac1[_0xdb47d8];return _0x5cdfd9;};'use strict';var _=require(_0x16ac('0x0'));var util=require(_0x16ac('0x1'));var moment=require(_0x16ac('0x2'));var BPromise=require(_0x16ac('0x3'));var rs=require(_0x16ac('0x4'));var fs=require('fs');var Redis=require(_0x16ac('0x5'));var db=require(_0x16ac('0x6'))['db'];var utils=require(_0x16ac('0x7'));var logger=require(_0x16ac('0x8'))(_0x16ac('0x9'));var config=require(_0x16ac('0xa'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xf8ec0b,_0x200c34,_0x1c81e2){return new BPromise(function(_0x407359,_0x148048){return client['request'](_0xf8ec0b,_0x1c81e2)[_0x16ac('0xb')](function(_0x3a8854){logger[_0x16ac('0xc')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x200c34,_0x16ac('0xd'));logger[_0x16ac('0xe')](_0x16ac('0xf'),_0x200c34,_0x16ac('0xd'),JSON['stringify'](_0x3a8854));if(_0x3a8854[_0x16ac('0x10')]){if(_0x3a8854[_0x16ac('0x10')][_0x16ac('0x11')]===0x1f4){logger[_0x16ac('0x10')](_0x16ac('0x12'),_0x200c34,_0x3a8854[_0x16ac('0x10')][_0x16ac('0x13')]);return _0x148048(_0x3a8854[_0x16ac('0x10')][_0x16ac('0x13')]);}logger[_0x16ac('0x10')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x200c34,_0x3a8854[_0x16ac('0x10')][_0x16ac('0x13')]);return _0x407359(_0x3a8854[_0x16ac('0x10')][_0x16ac('0x13')]);}else{logger[_0x16ac('0xc')](_0x16ac('0x12'),_0x200c34,_0x16ac('0xd'));_0x407359(_0x3a8854['result'][_0x16ac('0x13')]);}})['catch'](function(_0xe62ad6){logger[_0x16ac('0x10')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x200c34,_0xe62ad6);_0x148048(_0xe62ad6);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index e9fe894..d3c5f1f 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 _0x7319=['Router','fs-extra','index','get','isAuthenticated','show','getSessions','/:id/answers','/:id/summary','30s','getSummary','post','clone','put','/:id','update','destroy','multer','util','path','connect-timeout','express'];(function(_0x3200bb,_0x57d0f2){var _0x3b4af8=function(_0x450f19){while(--_0x450f19){_0x3200bb['push'](_0x3200bb['shift']());}};_0x3b4af8(++_0x57d0f2);}(_0x7319,0x1df));var _0x9731=function(_0x4949ec,_0x45c7e5){_0x4949ec=_0x4949ec-0x0;var _0x260a59=_0x7319[_0x4949ec];return _0x260a59;};'use strict';var multer=require(_0x9731('0x0'));var util=require(_0x9731('0x1'));var path=require(_0x9731('0x2'));var timeout=require(_0x9731('0x3'));var express=require(_0x9731('0x4'));var router=express[_0x9731('0x5')]();var fs_extra=require(_0x9731('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./jscriptyProject.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x9731('0x7')]);router[_0x9731('0x8')]('/:id',auth[_0x9731('0x9')](),controller[_0x9731('0xa')]);router[_0x9731('0x8')]('/:id/sessions',auth[_0x9731('0x9')](),controller[_0x9731('0xb')]);router[_0x9731('0x8')](_0x9731('0xc'),auth[_0x9731('0x9')](),controller['getAnswers']);router[_0x9731('0x8')](_0x9731('0xd'),auth[_0x9731('0x9')](),timeout(_0x9731('0xe')),controller[_0x9731('0xf')]);router[_0x9731('0x10')]('/',auth[_0x9731('0x9')](),controller['create']);router['post']('/:id/clone',auth[_0x9731('0x9')](),controller[_0x9731('0x11')]);router[_0x9731('0x12')](_0x9731('0x13'),auth[_0x9731('0x9')](),controller[_0x9731('0x14')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x9731('0x15')]);module['exports']=router; \ No newline at end of file +var _0xebd0=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','isAuthenticated','index','get','/:id/sessions','getAnswers','/:id/summary','getSummary','create','post','/:id/clone','clone','put','/:id','update','delete','destroy','exports'];(function(_0x1b3643,_0x1e4ce5){var _0x5e7532=function(_0x2766bd){while(--_0x2766bd){_0x1b3643['push'](_0x1b3643['shift']());}};_0x5e7532(++_0x1e4ce5);}(_0xebd0,0x17a));var _0x0ebd=function(_0x185812,_0x213741){_0x185812=_0x185812-0x0;var _0x3ba116=_0xebd0[_0x185812];return _0x3ba116;};'use strict';var multer=require(_0x0ebd('0x0'));var util=require(_0x0ebd('0x1'));var path=require(_0x0ebd('0x2'));var timeout=require(_0x0ebd('0x3'));var express=require(_0x0ebd('0x4'));var router=express[_0x0ebd('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x0ebd('0x6'));var interaction=require(_0x0ebd('0x7'));var config=require(_0x0ebd('0x8'));var controller=require(_0x0ebd('0x9'));router['get']('/',auth[_0x0ebd('0xa')](),controller[_0x0ebd('0xb')]);router[_0x0ebd('0xc')]('/:id',auth[_0x0ebd('0xa')](),controller['show']);router[_0x0ebd('0xc')](_0x0ebd('0xd'),auth['isAuthenticated'](),controller['getSessions']);router['get']('/:id/answers',auth[_0x0ebd('0xa')](),controller[_0x0ebd('0xe')]);router[_0x0ebd('0xc')](_0x0ebd('0xf'),auth['isAuthenticated'](),timeout('30s'),controller[_0x0ebd('0x10')]);router['post']('/',auth[_0x0ebd('0xa')](),controller[_0x0ebd('0x11')]);router[_0x0ebd('0x12')](_0x0ebd('0x13'),auth[_0x0ebd('0xa')](),controller[_0x0ebd('0x14')]);router[_0x0ebd('0x15')](_0x0ebd('0x16'),auth[_0x0ebd('0xa')](),controller[_0x0ebd('0x17')]);router[_0x0ebd('0x18')](_0x0ebd('0x16'),auth[_0x0ebd('0xa')](),controller[_0x0ebd('0x19')]);module[_0x0ebd('0x1a')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index 594c49e..86240bf 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 _0xca8d=['formData','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN','sequelize','lodash','util','exports','STRING','name','setDataValue'];(function(_0x5c13d5,_0x38a129){var _0x361eb9=function(_0x33e1aa){while(--_0x33e1aa){_0x5c13d5['push'](_0x5c13d5['shift']());}};_0x361eb9(++_0x38a129);}(_0xca8d,0xbc));var _0xdca8=function(_0x1e5db8,_0x44ef41){_0x1e5db8=_0x1e5db8-0x0;var _0x219a51=_0xca8d[_0x1e5db8];return _0x219a51;};'use strict';var Sequelize=require(_0xdca8('0x0'));var _=require(_0xdca8('0x1'));var util=require(_0xdca8('0x2'));module[_0xdca8('0x3')]={'name':{'type':Sequelize[_0xdca8('0x4')],'unique':_0xdca8('0x5')},'description':{'type':Sequelize[_0xdca8('0x4')]},'formData':{'type':Sequelize['TEXT']('long'),'set':function(_0x54fefc){if(_['isObjectLike'](_0x54fefc)){this[_0xdca8('0x6')](_0xdca8('0x7'),JSON['stringify'](_0x54fefc));}else if(_['isString'](_0x54fefc)){this['setDataValue']('formData',_0x54fefc);}else{this[_0xdca8('0x6')](_0xdca8('0x7'),util[_0xdca8('0x8')](_0xdca8('0x9'),this[_0xdca8('0xa')](_0xdca8('0x5'))||'',this[_0xdca8('0xa')](_0xdca8('0xb'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xdca8('0xc')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0xdca8('0xc')],'defaultValue':![]}}; \ No newline at end of file +var _0x0775=['format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN','sequelize','lodash','util','STRING','name','long','isObjectLike','formData','isString','setDataValue'];(function(_0xdb6f7f,_0x405e77){var _0x234452=function(_0x46434d){while(--_0x46434d){_0xdb6f7f['push'](_0xdb6f7f['shift']());}};_0x234452(++_0x405e77);}(_0x0775,0x17c));var _0x5077=function(_0x13c9c7,_0x1ce8bc){_0x13c9c7=_0x13c9c7-0x0;var _0x540402=_0x0775[_0x13c9c7];return _0x540402;};'use strict';var Sequelize=require(_0x5077('0x0'));var _=require(_0x5077('0x1'));var util=require(_0x5077('0x2'));module['exports']={'name':{'type':Sequelize[_0x5077('0x3')],'unique':_0x5077('0x4')},'description':{'type':Sequelize[_0x5077('0x3')]},'formData':{'type':Sequelize['TEXT'](_0x5077('0x5')),'set':function(_0x102522){if(_[_0x5077('0x6')](_0x102522)){this['setDataValue'](_0x5077('0x7'),JSON['stringify'](_0x102522));}else if(_[_0x5077('0x8')](_0x102522)){this[_0x5077('0x9')](_0x5077('0x7'),_0x102522);}else{this[_0x5077('0x9')](_0x5077('0x7'),util[_0x5077('0xa')](_0x5077('0xb'),this[_0x5077('0xc')](_0x5077('0x4'))||'',this[_0x5077('0xc')](_0x5077('0xd'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x5077('0xe')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index d81b3ca..376245e 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 _0x13ae=['fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','Projects','UserProfileResource','destroy','error','stack','name','index','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','VIRTUAL','merge','options','include','JscriptyProject','findAll','rows','catch','includeAll','create','user','get','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','omit','updatedAt','body','createdAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','getSessions','findOne','ProjectId','JscriptySessionReport','getAnswers','JscriptyAnswerReport','number','fromCharCode','toString','indexOf','replace','getSummary','startTime','starttime','parse','JscriptyQuestionReport','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','now','/tmp/Jscripty_Project_%d_Summary_%s.csv','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','request-promise','moment','util','sox','to-csv','ejs'];(function(_0x41ca9f,_0x269c4f){var _0x1a458c=function(_0x6214cf){while(--_0x6214cf){_0x41ca9f['push'](_0x41ca9f['shift']());}};_0x1a458c(++_0x269c4f);}(_0x13ae,0xe6));var _0xe13a=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0x13ae[_0x2dadb9];return _0x2f0097;};'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(_0xe13a('0x0'));var moment=require(_0xe13a('0x1'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xe13a('0x2'));var path=require('path');var sox=require(_0xe13a('0x3'));var csv=require(_0xe13a('0x4'));var ejs=require(_0xe13a('0x5'));var fs=require('fs');var fs_extra=require(_0xe13a('0x6'));var _=require(_0xe13a('0x7'));var squel=require(_0xe13a('0x8'));var crypto=require(_0xe13a('0x9'));var jsforce=require(_0xe13a('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe13a('0xb'));var Papa=require(_0xe13a('0xc'));var Redis=require(_0xe13a('0xd'));var authService=require(_0xe13a('0xe'));var qs=require(_0xe13a('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe13a('0x10'));var logger=require(_0xe13a('0x11'))(_0xe13a('0x12'));var utils=require(_0xe13a('0x13'));var config=require(_0xe13a('0x14'));var licenseUtil=require(_0xe13a('0x15'));var db=require(_0xe13a('0x16'))['db'];function respondWithStatusCode(_0x5e715,_0x54ea66){_0x54ea66=_0x54ea66||0xcc;return function(_0x2ab471){if(_0x2ab471){return _0x5e715[_0xe13a('0x17')](_0x54ea66);}return _0x5e715[_0xe13a('0x18')](_0x54ea66)[_0xe13a('0x19')]();};}function respondWithResult(_0x12f6f9,_0x19dc18){_0x19dc18=_0x19dc18||0xc8;return function(_0x462d0e){if(_0x462d0e){return _0x12f6f9['status'](_0x19dc18)['json'](_0x462d0e);}};}function respondWithFilteredResult(_0x463c25,_0x2fca0f){return function(_0x128986){if(_0x128986){var _0x20d162=typeof _0x2fca0f[_0xe13a('0x1a')]===_0xe13a('0x1b')&&typeof _0x2fca0f[_0xe13a('0x1c')]===_0xe13a('0x1b');var _0x165195=_0x128986[_0xe13a('0x1d')];var _0xc6f6d3=_0x20d162?0x0:_0x2fca0f['offset'];var _0x3c8f4f=_0x20d162?_0x128986[_0xe13a('0x1d')]:_0x2fca0f['offset']+_0x2fca0f[_0xe13a('0x1c')];var _0x12a8b9;if(_0x3c8f4f>=_0x165195){_0x3c8f4f=_0x165195;_0x12a8b9=0xc8;}else{_0x12a8b9=0xce;}_0x463c25['status'](_0x12a8b9);return _0x463c25[_0xe13a('0x1e')](_0xe13a('0x1f'),_0xc6f6d3+'-'+_0x3c8f4f+'/'+_0x165195)[_0xe13a('0x20')](_0x128986);}return null;};}function patchUpdates(_0x4489bd){return function(_0xeff2be){try{jsonpatch[_0xe13a('0x21')](_0xeff2be,_0x4489bd,!![]);}catch(_0x2c88bd){return BPromise[_0xe13a('0x22')](_0x2c88bd);}return _0xeff2be['save']();};}function saveUpdates(_0x5e8dea,_0x192240){return function(_0x48cdb8){if(_0x48cdb8){return _0x48cdb8[_0xe13a('0x23')](_0x5e8dea)[_0xe13a('0x24')](function(_0x3a5d29){return _0x3a5d29;});}return null;};}function removeEntity(_0x1d303c,_0x810633){return function(_0xd26093){if(_0xd26093){return _0xd26093['destroy']()[_0xe13a('0x24')](function(){var _0x4c3eea=_0xd26093['get']({'plain':!![]});var _0x3ed1f7=_0xe13a('0x25');return db[_0xe13a('0x26')][_0xe13a('0x27')]({'where':{'type':_0x3ed1f7,'resourceId':_0x4c3eea['id']}})[_0xe13a('0x24')](function(){return _0xd26093;});})[_0xe13a('0x24')](function(){_0x1d303c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x562360,_0x43b85e){return function(_0x1cb395){if(!_0x1cb395){_0x562360[_0xe13a('0x17')](0x194);}return _0x1cb395;};}function handleError(_0x2cad12,_0x4fcdf1){_0x4fcdf1=_0x4fcdf1||0x1f4;return function(_0x502bff){logger[_0xe13a('0x28')](_0x502bff[_0xe13a('0x29')]);if(_0x502bff[_0xe13a('0x2a')]){delete _0x502bff['name'];}_0x2cad12[_0xe13a('0x18')](_0x4fcdf1)['send'](_0x502bff);};}exports[_0xe13a('0x2b')]=function(_0xcf583b,_0xd1fdb5){var _0x3b24f3={},_0x425208={},_0xed408c={'count':0x0,'rows':[]};var _0x48ec1d=_['map'](db['JscriptyProject'][_0xe13a('0x2c')],function(_0x1a09db){return{'name':_0x1a09db['fieldName'],'type':_0x1a09db[_0xe13a('0x2d')][_0xe13a('0x2e')]};});_0x425208[_0xe13a('0x2f')]=_['map'](_0x48ec1d,_0xe13a('0x2a'));_0x425208[_0xe13a('0x30')]=_[_0xe13a('0x31')](_0xcf583b[_0xe13a('0x30')]);_0x425208[_0xe13a('0x32')]=_[_0xe13a('0x33')](_0x425208[_0xe13a('0x2f')],_0x425208[_0xe13a('0x30')]);_0x3b24f3[_0xe13a('0x34')]=_[_0xe13a('0x33')](_0x425208[_0xe13a('0x2f')],qs[_0xe13a('0x35')](_0xcf583b[_0xe13a('0x30')][_0xe13a('0x35')]));_0x3b24f3[_0xe13a('0x34')]=_0x3b24f3[_0xe13a('0x34')][_0xe13a('0x36')]?_0x3b24f3[_0xe13a('0x34')]:_0x425208['model'];if(!_0xcf583b[_0xe13a('0x30')][_0xe13a('0x37')](_0xe13a('0x38'))){_0x3b24f3[_0xe13a('0x1c')]=qs['limit'](_0xcf583b[_0xe13a('0x30')][_0xe13a('0x1c')]);_0x3b24f3[_0xe13a('0x1a')]=qs[_0xe13a('0x1a')](_0xcf583b['query'][_0xe13a('0x1a')]);}_0x3b24f3[_0xe13a('0x39')]=qs['sort'](_0xcf583b['query'][_0xe13a('0x3a')]);_0x3b24f3[_0xe13a('0x3b')]=qs[_0xe13a('0x32')](_[_0xe13a('0x3c')](_0xcf583b[_0xe13a('0x30')],_0x425208[_0xe13a('0x32')]),_0x48ec1d);if(_0xcf583b[_0xe13a('0x30')][_0xe13a('0x3d')]){_0x3b24f3['where']=_['merge'](_0x3b24f3[_0xe13a('0x3b')],{'$or':_[_0xe13a('0x3e')](_0x48ec1d,function(_0x3d24ad){if(_0x3d24ad[_0xe13a('0x2d')]!==_0xe13a('0x3f')){var _0x3a0872={};_0x3a0872[_0x3d24ad[_0xe13a('0x2a')]]={'$like':'%'+_0xcf583b['query'][_0xe13a('0x3d')]+'%'};return _0x3a0872;}})});}_0x3b24f3=_[_0xe13a('0x40')]({},_0x3b24f3,_0xcf583b[_0xe13a('0x41')]);var _0x37c3c1={'where':_0x3b24f3[_0xe13a('0x3b')]};return db['JscriptyProject'][_0xe13a('0x1d')](_0x37c3c1)[_0xe13a('0x24')](function(_0x348216){_0xed408c[_0xe13a('0x1d')]=_0x348216;if(_0xcf583b[_0xe13a('0x30')]['includeAll']){_0x3b24f3[_0xe13a('0x42')]=[{'all':!![]}];}return db[_0xe13a('0x43')][_0xe13a('0x44')](_0x3b24f3);})['then'](function(_0x3c047b){_0xed408c[_0xe13a('0x45')]=_0x3c047b;return _0xed408c;})[_0xe13a('0x24')](respondWithFilteredResult(_0xd1fdb5,_0x3b24f3))[_0xe13a('0x46')](handleError(_0xd1fdb5,null));};exports['show']=function(_0x55e93f,_0x196d76){var _0xed7258={'raw':![],'where':{'id':_0x55e93f['params']['id']}},_0x3d87ba={};_0x3d87ba['model']=_[_0xe13a('0x31')](db[_0xe13a('0x43')][_0xe13a('0x2c')]);_0x3d87ba[_0xe13a('0x30')]=_[_0xe13a('0x31')](_0x55e93f['query']);_0x3d87ba[_0xe13a('0x32')]=_[_0xe13a('0x33')](_0x3d87ba[_0xe13a('0x2f')],_0x3d87ba[_0xe13a('0x30')]);_0xed7258[_0xe13a('0x34')]=_[_0xe13a('0x33')](_0x3d87ba[_0xe13a('0x2f')],qs[_0xe13a('0x35')](_0x55e93f[_0xe13a('0x30')]['fields']));_0xed7258['attributes']=_0xed7258[_0xe13a('0x34')][_0xe13a('0x36')]?_0xed7258['attributes']:_0x3d87ba['model'];if(_0x55e93f[_0xe13a('0x30')][_0xe13a('0x47')]){_0xed7258[_0xe13a('0x42')]=[{'all':!![]}];}_0xed7258=_[_0xe13a('0x40')]({},_0xed7258,_0x55e93f[_0xe13a('0x41')]);return db[_0xe13a('0x43')]['find'](_0xed7258)[_0xe13a('0x24')](handleEntityNotFound(_0x196d76,null))[_0xe13a('0x24')](respondWithResult(_0x196d76,null))[_0xe13a('0x46')](handleError(_0x196d76,null));};exports[_0xe13a('0x48')]=function(_0x569da6,_0x55e08e){return db['JscriptyProject'][_0xe13a('0x48')](_0x569da6['body'],{})[_0xe13a('0x24')](function(_0x2faab8){var _0x6b2656=_0x569da6[_0xe13a('0x49')][_0xe13a('0x4a')]({'plain':!![]});if(!_0x6b2656)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x6b2656[_0xe13a('0x4b')]===_0xe13a('0x49')){var _0x198210=_0x2faab8[_0xe13a('0x4a')]({'plain':!![]});var _0x523e2e=_0xe13a('0x25');return db[_0xe13a('0x4c')][_0xe13a('0x4d')]({'where':{'name':_0x523e2e,'userProfileId':_0x6b2656[_0xe13a('0x4e')]},'raw':!![]})[_0xe13a('0x24')](function(_0xfa0d2f){if(_0xfa0d2f&&_0xfa0d2f[_0xe13a('0x4f')]===0x0){return db['UserProfileResource'][_0xe13a('0x48')]({'name':_0x198210[_0xe13a('0x2a')],'resourceId':_0x198210['id'],'type':_0xfa0d2f['name'],'sectionId':_0xfa0d2f['id']},{})[_0xe13a('0x24')](function(){return _0x2faab8;});}else{return _0x2faab8;}})[_0xe13a('0x46')](function(_0x4fffdf){logger['error'](_0xe13a('0x50'),_0x4fffdf);throw _0x4fffdf;});}return _0x2faab8;})[_0xe13a('0x24')](respondWithResult(_0x55e08e,0xc9))[_0xe13a('0x46')](handleError(_0x55e08e,null));};exports['clone']=function(_0x2d0911,_0x1abc1b){var _0x384a0a={'where':{'id':_0x2d0911[_0xe13a('0x51')]['id']}},_0x5d187c={};_0x5d187c[_0xe13a('0x2f')]=_['keys'](db[_0xe13a('0x43')]['rawAttributes']);_0x384a0a[_0xe13a('0x34')]=_[_0xe13a('0x33')](_0x5d187c['model'],qs[_0xe13a('0x35')](_0x2d0911[_0xe13a('0x30')]['fields']));_0x384a0a[_0xe13a('0x34')]=_0x384a0a[_0xe13a('0x34')][_0xe13a('0x36')]?_0x384a0a[_0xe13a('0x34')]:_0x5d187c[_0xe13a('0x2f')];if(_0x2d0911[_0xe13a('0x30')]['includeAll']){_0x384a0a[_0xe13a('0x42')]=[{'all':!![]}];}_0x384a0a=_[_0xe13a('0x40')]({},_0x384a0a,_0x2d0911[_0xe13a('0x41')]);return db[_0xe13a('0x43')][_0xe13a('0x4d')](_0x384a0a)[_0xe13a('0x24')](handleEntityNotFound(_0x1abc1b,null))[_0xe13a('0x24')](function(_0x3c8bd0){if(_0x3c8bd0){var _0x54b139=_0x3c8bd0[_0xe13a('0x4a')]({'plain':!![]});_0x54b139=qs[_0xe13a('0x52')](_0x54b139,['id','createdAt',_0xe13a('0x53')]);_0x2d0911[_0xe13a('0x54')]=_[_0xe13a('0x52')](_0x2d0911['body'],['id',_0xe13a('0x55'),_0xe13a('0x53')]);return db[_0xe13a('0x43')][_0xe13a('0x48')](_['merge'](_0x54b139,_0x2d0911['body']),{'include':_0x2d0911['query'][_0xe13a('0x47')]?[{'all':!![]}]:undefined})[_0xe13a('0x24')](function(_0x7bed88){var _0x4f4dd5=_0x2d0911[_0xe13a('0x49')][_0xe13a('0x4a')]({'plain':!![]});if(!_0x4f4dd5)throw new Error(_0xe13a('0x56'));if(_0x4f4dd5[_0xe13a('0x4b')]===_0xe13a('0x49')){var _0x622dcb=_0x7bed88[_0xe13a('0x4a')]({'plain':!![]});var _0x48f11d='Projects';return db[_0xe13a('0x4c')][_0xe13a('0x4d')]({'where':{'name':_0x48f11d,'userProfileId':_0x4f4dd5[_0xe13a('0x4e')]},'raw':!![]})[_0xe13a('0x24')](function(_0x3dddb2){if(_0x3dddb2&&_0x3dddb2['autoAssociation']===0x0){return db['UserProfileResource'][_0xe13a('0x48')]({'name':_0x622dcb[_0xe13a('0x2a')],'resourceId':_0x622dcb['id'],'type':_0x3dddb2[_0xe13a('0x2a')],'sectionId':_0x3dddb2['id']},{})['then'](function(){return _0x7bed88;});}else{return _0x7bed88;}})[_0xe13a('0x46')](function(_0x1e01b4){logger[_0xe13a('0x28')](_0xe13a('0x50'),_0x1e01b4);throw _0x1e01b4;});}return _0x7bed88;});}})[_0xe13a('0x24')](respondWithResult(_0x1abc1b,0xc9))[_0xe13a('0x46')](handleError(_0x1abc1b,null));};exports[_0xe13a('0x23')]=function(_0x471fa9,_0x14f69f){if(_0x471fa9[_0xe13a('0x54')]['id']){delete _0x471fa9[_0xe13a('0x54')]['id'];}return db[_0xe13a('0x43')][_0xe13a('0x4d')]({'where':{'id':_0x471fa9[_0xe13a('0x51')]['id']}})['then'](handleEntityNotFound(_0x14f69f,null))[_0xe13a('0x24')](saveUpdates(_0x471fa9[_0xe13a('0x54')],null))[_0xe13a('0x24')](respondWithResult(_0x14f69f,null))[_0xe13a('0x46')](handleError(_0x14f69f,null));};exports[_0xe13a('0x27')]=function(_0x2db05f,_0x14dacb){return db[_0xe13a('0x43')][_0xe13a('0x4d')]({'where':{'id':_0x2db05f[_0xe13a('0x51')]['id']}})['then'](handleEntityNotFound(_0x14dacb,null))[_0xe13a('0x24')](removeEntity(_0x14dacb,null))[_0xe13a('0x46')](handleError(_0x14dacb,null));};exports[_0xe13a('0x57')]=function(_0x3add63,_0x3a2675,_0x47bff7){var _0x1cafed={'raw':!![],'where':{}};var _0x5f94f0={};var _0x32042b={'count':0x0,'rows':[]};return db[_0xe13a('0x43')][_0xe13a('0x58')]({'where':{'id':_0x3add63[_0xe13a('0x51')]['id']}})[_0xe13a('0x24')](handleEntityNotFound(_0x3a2675,null))['then'](function(_0xf74ff3){if(_0xf74ff3){_0x5f94f0[_0xe13a('0x2f')]=_[_0xe13a('0x31')](db['JscriptySessionReport'][_0xe13a('0x2c')]);_0x5f94f0['query']=_[_0xe13a('0x31')](_0x3add63[_0xe13a('0x30')]);_0x5f94f0['filters']=_[_0xe13a('0x33')](_0x5f94f0['model'],_0x5f94f0[_0xe13a('0x30')]);_0x1cafed[_0xe13a('0x34')]=_[_0xe13a('0x33')](_0x5f94f0['model'],qs[_0xe13a('0x35')](_0x3add63[_0xe13a('0x30')][_0xe13a('0x35')]));_0x1cafed['attributes']=_0x1cafed['attributes']['length']?_0x1cafed['attributes']:_0x5f94f0[_0xe13a('0x2f')];if(!_0x3add63[_0xe13a('0x30')]['hasOwnProperty'](_0xe13a('0x38'))){_0x1cafed[_0xe13a('0x1c')]=qs['limit'](_0x3add63[_0xe13a('0x30')]['limit']);_0x1cafed[_0xe13a('0x1a')]=qs[_0xe13a('0x1a')](_0x3add63['query'][_0xe13a('0x1a')]);}_0x1cafed[_0xe13a('0x39')]=qs[_0xe13a('0x3a')](_0x3add63['query']['sort']);_0x1cafed[_0xe13a('0x3b')]=qs[_0xe13a('0x32')](_[_0xe13a('0x3c')](_0x3add63['query'],_0x5f94f0['filters']));_0x1cafed[_0xe13a('0x3b')][_0xe13a('0x59')]=_0xf74ff3['id'];if(_0x3add63['query'][_0xe13a('0x3d')]){_0x1cafed[_0xe13a('0x3b')]=_['merge'](_0x1cafed[_0xe13a('0x3b')],{'$or':_['map'](_0x1cafed[_0xe13a('0x34')],function(_0x179abe){var _0x23d92e={};_0x23d92e[_0x179abe]={'$like':'%'+_0x3add63['query']['filter']+'%'};return _0x23d92e;})});}_0x1cafed=_[_0xe13a('0x40')]({},_0x1cafed,_0x3add63[_0xe13a('0x41')]);return db[_0xe13a('0x5a')][_0xe13a('0x1d')]({'where':_0x1cafed[_0xe13a('0x3b')]})['then'](function(_0x17e8d7){_0x32042b[_0xe13a('0x1d')]=_0x17e8d7;if(_0x3add63[_0xe13a('0x30')]['includeAll']){_0x1cafed[_0xe13a('0x42')]=[{'all':!![]}];}return db[_0xe13a('0x5a')]['findAll'](_0x1cafed);})['then'](function(_0x510641){_0x32042b[_0xe13a('0x45')]=_0x510641;return _0x32042b;});}})[_0xe13a('0x24')](respondWithFilteredResult(_0x3a2675,_0x1cafed))[_0xe13a('0x46')](handleError(_0x3a2675,null));};exports[_0xe13a('0x5b')]=function(_0x3a1b9f,_0x59a1b8,_0x4ef9b9){var _0x1996e9={'raw':!![],'where':{}};var _0x2661f6={};var _0x13291c={'count':0x0,'rows':[]};return db['JscriptyProject']['findOne']({'where':{'id':_0x3a1b9f['params']['id']}})[_0xe13a('0x24')](handleEntityNotFound(_0x59a1b8,null))[_0xe13a('0x24')](function(_0x22f34a){if(_0x22f34a){_0x2661f6['model']=_[_0xe13a('0x31')](db[_0xe13a('0x5c')][_0xe13a('0x2c')]);_0x2661f6[_0xe13a('0x30')]=_[_0xe13a('0x31')](_0x3a1b9f[_0xe13a('0x30')]);_0x2661f6[_0xe13a('0x32')]=_[_0xe13a('0x33')](_0x2661f6[_0xe13a('0x2f')],_0x2661f6[_0xe13a('0x30')]);_0x1996e9[_0xe13a('0x34')]=_[_0xe13a('0x33')](_0x2661f6[_0xe13a('0x2f')],qs['fields'](_0x3a1b9f[_0xe13a('0x30')]['fields']));_0x1996e9[_0xe13a('0x34')]=_0x1996e9[_0xe13a('0x34')][_0xe13a('0x36')]?_0x1996e9['attributes']:_0x2661f6['model'];if(!_0x3a1b9f[_0xe13a('0x30')][_0xe13a('0x37')](_0xe13a('0x38'))){_0x1996e9['limit']=qs[_0xe13a('0x1c')](_0x3a1b9f['query']['limit']);_0x1996e9[_0xe13a('0x1a')]=qs[_0xe13a('0x1a')](_0x3a1b9f['query'][_0xe13a('0x1a')]);}_0x1996e9[_0xe13a('0x39')]=qs[_0xe13a('0x3a')](_0x3a1b9f['query'][_0xe13a('0x3a')]);_0x1996e9[_0xe13a('0x3b')]=qs[_0xe13a('0x32')](_[_0xe13a('0x3c')](_0x3a1b9f['query'],_0x2661f6[_0xe13a('0x32')]));_0x1996e9[_0xe13a('0x3b')][_0xe13a('0x59')]=_0x22f34a['id'];if(_0x3a1b9f['query'][_0xe13a('0x3d')]){_0x1996e9[_0xe13a('0x3b')]=_['merge'](_0x1996e9[_0xe13a('0x3b')],{'$or':_[_0xe13a('0x3e')](_0x1996e9[_0xe13a('0x34')],function(_0x16c7ef){var _0x4ad55e={};_0x4ad55e[_0x16c7ef]={'$like':'%'+_0x3a1b9f[_0xe13a('0x30')][_0xe13a('0x3d')]+'%'};return _0x4ad55e;})});}_0x1996e9=_['merge']({},_0x1996e9,_0x3a1b9f[_0xe13a('0x41')]);return db[_0xe13a('0x5c')]['count']({'where':_0x1996e9[_0xe13a('0x3b')]})['then'](function(_0x414768){_0x13291c['count']=_0x414768;if(_0x3a1b9f[_0xe13a('0x30')][_0xe13a('0x47')]){_0x1996e9['include']=[{'all':!![]}];}return db[_0xe13a('0x5c')][_0xe13a('0x44')](_0x1996e9);})['then'](function(_0x2d5c77){_0x13291c[_0xe13a('0x45')]=_0x2d5c77;return _0x13291c;});}})[_0xe13a('0x24')](respondWithFilteredResult(_0x59a1b8,_0x1996e9))[_0xe13a('0x46')](handleError(_0x59a1b8,null));};function char(_0x15fe68){return _0xe13a('0x5d')===typeof _0x15fe68?String[_0xe13a('0x5e')][_0xe13a('0x21')](null,arguments):_0x15fe68;}function needsEncapsulation(_0x324b6e){return!!_0x324b6e&&(_0x324b6e[_0xe13a('0x5f')]()[_0xe13a('0x60')](char(0xd))>=0x0||_0x324b6e[_0xe13a('0x5f')]()['indexOf'](char(0xa))>=0x0||_0x324b6e[_0xe13a('0x5f')]()[_0xe13a('0x60')](char(0x2c))>=0x0||_0x324b6e[_0xe13a('0x5f')]()[_0xe13a('0x60')](char(0x22))>=0x0);}function encapsulate(_0x4e29ed){var _0x6cf593=char(0x22),_0x3f6669='\x5c'+char(0x22),_0x38ffa4=_0x4e29ed[_0xe13a('0x5f')]()[_0xe13a('0x61')](new RegExp(_0x6cf593,'g'),_0x3f6669);return _0x6cf593+_0x38ffa4+_0x6cf593;}exports[_0xe13a('0x62')]=function(_0x42fc9f,_0x3e3b69,_0x4e9c37){var _0x83e460,_0x4848cf;var _0x2c02aa={'where':{'ProjectId':_0x42fc9f[_0xe13a('0x51')]['id']}};if(_0x42fc9f['query'][_0xe13a('0x63')]){_0x2c02aa[_0xe13a('0x3b')][_0xe13a('0x64')]=JSON[_0xe13a('0x65')](_0x42fc9f[_0xe13a('0x30')][_0xe13a('0x63')]);}return db[_0xe13a('0x5a')][_0xe13a('0x44')](_0x2c02aa)['then'](handleEntityNotFound(_0x3e3b69,null))[_0xe13a('0x24')](function(_0x3ae5f5){if(_0x3ae5f5){_0x83e460=_0x3ae5f5;return db[_0xe13a('0x66')][_0xe13a('0x44')]({'where':{'SessionId':{'$in':_[_0xe13a('0x3e')](_0x83e460,'id')},'ProjectId':_0x42fc9f[_0xe13a('0x51')]['id']},'order':_0xe13a('0x67')});}})[_0xe13a('0x24')](handleEntityNotFound(_0x3e3b69,null))[_0xe13a('0x24')](function(_0xf906cf){if(_0xf906cf){_0x4848cf=_0xf906cf;var _0x45947e={};for(var _0x149937=0x0,_0x492d80=_0x4848cf['length'];_0x149937<_0x492d80;_0x149937++){if(!_0x45947e['hasOwnProperty'](_0x4848cf[_0x149937][_0xe13a('0x68')])){_0x45947e[_0x4848cf[_0x149937][_0xe13a('0x68')]]=needsEncapsulation(_0x4848cf[_0x149937][_0xe13a('0x69')])?encapsulate(_0x4848cf[_0x149937][_0xe13a('0x69')]):_0x4848cf[_0x149937][_0xe13a('0x69')];}}var _0x2ab79a=[],_0x1cd5c4={};for(var _0xe9e2cf=0x0,_0x178c60=_0x83e460[_0xe13a('0x36')];_0xe9e2cf<_0x178c60;_0xe9e2cf++){_0x1cd5c4={'ProjectId':_0x42fc9f[_0xe13a('0x51')]['id'],'SessionId':_0x83e460[_0xe9e2cf]['id'],'StartTime':moment(_0x83e460[_0xe9e2cf]['starttime'])[_0xe13a('0x6a')](_0xe13a('0x6b'))};for(var _0xdfb32c=0x0,_0x16f36c=_0x4848cf['length'];_0xdfb32c<_0x16f36c;_0xdfb32c++){if(_0x4848cf[_0xdfb32c][_0xe13a('0x6c')]==_0x83e460[_0xe9e2cf]['id']&&_0x45947e[_0xe13a('0x37')](_0x4848cf[_0xdfb32c]['questionId'])){_0x1cd5c4[_0x45947e[_0x4848cf[_0xdfb32c]['questionId']]]=_0x4848cf[_0xdfb32c][_0xe13a('0x6d')];}}for(var _0x5635bd in _0x45947e){if(!_0x1cd5c4['hasOwnProperty'](_0x45947e[_0x5635bd])){_0x1cd5c4[_0x45947e[_0x5635bd]]=null;}}_0x2ab79a[_0xe13a('0x6e')](_0x1cd5c4);}return _0x2ab79a;}})[_0xe13a('0x24')](function(_0x1c82bf){if(!_['isEmpty'](_0x1c82bf)){var _0x43aaa6=toCsv(_0x1c82bf);var _0x5165e7=Date[_0xe13a('0x6f')]();fs['writeFileSync'](util[_0xe13a('0x6a')](_0xe13a('0x70'),_0x42fc9f[_0xe13a('0x51')]['id'],_0x5165e7),_0x43aaa6);_0x3e3b69['setHeader'](_0xe13a('0x71'),_0xe13a('0x72')+util[_0xe13a('0x6a')](_0xe13a('0x73'),_0x42fc9f['params']['id'],_0x5165e7));_0x3e3b69['setHeader'](_0xe13a('0x74'),_0xe13a('0x75'));return _0x3e3b69['download'](util['format'](_0xe13a('0x70'),_0x42fc9f[_0xe13a('0x51')]['id'],_0x5165e7));}else{return _0x3e3b69['sendStatus'](0xcc);}})[_0xe13a('0x46')](handleError(_0x3e3b69,null));}; \ No newline at end of file +var _0xbc5e=['Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','sendStatus','status','end','json','undefined','limit','count','set','Content-Range','save','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','JscriptyProject','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','hasOwnProperty','nolimit','offset','order','sort','where','filters','pick','filter','options','includeAll','findAll','rows','catch','show','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Projects','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','length','include','merge','updatedAt','omit','createdAt','update','getSessions','JscriptySessionReport','getAnswers','findOne','JscriptyAnswerReport','ProjectId','apply','toString','indexOf','replace','getSummary','startTime','starttime','parse','JscriptyQuestionReport','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','isEmpty','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename='];(function(_0x2ddb6d,_0x25d45b){var _0x56c103=function(_0x4f73c4){while(--_0x4f73c4){_0x2ddb6d['push'](_0x2ddb6d['shift']());}};_0x56c103(++_0x25d45b);}(_0xbc5e,0x7d));var _0xebc5=function(_0x4dfa2f,_0x1bed90){_0x4dfa2f=_0x4dfa2f-0x0;var _0x1f6a6a=_0xbc5e[_0x4dfa2f];return _0x1f6a6a;};'use strict';var emlformat=require(_0xebc5('0x0'));var rimraf=require(_0xebc5('0x1'));var zipdir=require(_0xebc5('0x2'));var jsonpatch=require(_0xebc5('0x3'));var rp=require(_0xebc5('0x4'));var moment=require(_0xebc5('0x5'));var BPromise=require(_0xebc5('0x6'));var Mustache=require(_0xebc5('0x7'));var util=require(_0xebc5('0x8'));var path=require('path');var sox=require(_0xebc5('0x9'));var csv=require(_0xebc5('0xa'));var ejs=require(_0xebc5('0xb'));var fs=require('fs');var fs_extra=require(_0xebc5('0xc'));var _=require(_0xebc5('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xebc5('0xe'));var deskjs=require(_0xebc5('0xf'));var toCsv=require(_0xebc5('0xa'));var querystring=require(_0xebc5('0x10'));var Papa=require('papaparse');var Redis=require(_0xebc5('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xebc5('0x12'));var as=require(_0xebc5('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xebc5('0x14'))(_0xebc5('0x15'));var utils=require(_0xebc5('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x564553,_0x477bc4){_0x477bc4=_0x477bc4||0xcc;return function(_0x30e6f4){if(_0x30e6f4){return _0x564553[_0xebc5('0x17')](_0x477bc4);}return _0x564553[_0xebc5('0x18')](_0x477bc4)[_0xebc5('0x19')]();};}function respondWithResult(_0x23805a,_0x5ba6c1){_0x5ba6c1=_0x5ba6c1||0xc8;return function(_0x375e29){if(_0x375e29){return _0x23805a['status'](_0x5ba6c1)[_0xebc5('0x1a')](_0x375e29);}};}function respondWithFilteredResult(_0x5eff85,_0x4ae3c6){return function(_0x3e903f){if(_0x3e903f){var _0x5489e9=typeof _0x4ae3c6['offset']===_0xebc5('0x1b')&&typeof _0x4ae3c6[_0xebc5('0x1c')]===_0xebc5('0x1b');var _0x21cbdf=_0x3e903f[_0xebc5('0x1d')];var _0x38d629=_0x5489e9?0x0:_0x4ae3c6['offset'];var _0x1aeef3=_0x5489e9?_0x3e903f[_0xebc5('0x1d')]:_0x4ae3c6['offset']+_0x4ae3c6[_0xebc5('0x1c')];var _0x1b1584;if(_0x1aeef3>=_0x21cbdf){_0x1aeef3=_0x21cbdf;_0x1b1584=0xc8;}else{_0x1b1584=0xce;}_0x5eff85['status'](_0x1b1584);return _0x5eff85[_0xebc5('0x1e')](_0xebc5('0x1f'),_0x38d629+'-'+_0x1aeef3+'/'+_0x21cbdf)[_0xebc5('0x1a')](_0x3e903f);}return null;};}function patchUpdates(_0x2170b6){return function(_0x3aff8d){try{jsonpatch['apply'](_0x3aff8d,_0x2170b6,!![]);}catch(_0x4f0a7f){return BPromise['reject'](_0x4f0a7f);}return _0x3aff8d[_0xebc5('0x20')]();};}function saveUpdates(_0x4af3d1,_0x257754){return function(_0x37ac8d){if(_0x37ac8d){return _0x37ac8d['update'](_0x4af3d1)[_0xebc5('0x21')](function(_0x1b247f){return _0x1b247f;});}return null;};}function removeEntity(_0x582541,_0x2be067){return function(_0x3ce69b){if(_0x3ce69b){return _0x3ce69b[_0xebc5('0x22')]()[_0xebc5('0x21')](function(){var _0x46394c=_0x3ce69b[_0xebc5('0x23')]({'plain':!![]});var _0x33bf29='Projects';return db[_0xebc5('0x24')]['destroy']({'where':{'type':_0x33bf29,'resourceId':_0x46394c['id']}})[_0xebc5('0x21')](function(){return _0x3ce69b;});})[_0xebc5('0x21')](function(){_0x582541[_0xebc5('0x18')](0xcc)[_0xebc5('0x19')]();});}};}function handleEntityNotFound(_0x5b6127,_0x193cfe){return function(_0x5dfe9f){if(!_0x5dfe9f){_0x5b6127[_0xebc5('0x17')](0x194);}return _0x5dfe9f;};}function handleError(_0x255b72,_0x36faa3){_0x36faa3=_0x36faa3||0x1f4;return function(_0x46a04e){logger[_0xebc5('0x25')](_0x46a04e[_0xebc5('0x26')]);if(_0x46a04e[_0xebc5('0x27')]){delete _0x46a04e[_0xebc5('0x27')];}_0x255b72[_0xebc5('0x18')](_0x36faa3)[_0xebc5('0x28')](_0x46a04e);};}exports[_0xebc5('0x29')]=function(_0x3e53d0,_0x2acf91){var _0x204113={},_0x531ec2={},_0x120574={'count':0x0,'rows':[]};var _0x55579d=_[_0xebc5('0x2a')](db[_0xebc5('0x2b')][_0xebc5('0x2c')],function(_0x9e791f){return{'name':_0x9e791f[_0xebc5('0x2d')],'type':_0x9e791f[_0xebc5('0x2e')][_0xebc5('0x2f')]};});_0x531ec2[_0xebc5('0x30')]=_[_0xebc5('0x2a')](_0x55579d,'name');_0x531ec2['query']=_['keys'](_0x3e53d0[_0xebc5('0x31')]);_0x531ec2['filters']=_[_0xebc5('0x32')](_0x531ec2[_0xebc5('0x30')],_0x531ec2['query']);_0x204113['attributes']=_['intersection'](_0x531ec2[_0xebc5('0x30')],qs[_0xebc5('0x33')](_0x3e53d0[_0xebc5('0x31')][_0xebc5('0x33')]));_0x204113['attributes']=_0x204113[_0xebc5('0x34')]['length']?_0x204113[_0xebc5('0x34')]:_0x531ec2[_0xebc5('0x30')];if(!_0x3e53d0[_0xebc5('0x31')][_0xebc5('0x35')](_0xebc5('0x36'))){_0x204113[_0xebc5('0x1c')]=qs[_0xebc5('0x1c')](_0x3e53d0[_0xebc5('0x31')]['limit']);_0x204113[_0xebc5('0x37')]=qs[_0xebc5('0x37')](_0x3e53d0[_0xebc5('0x31')][_0xebc5('0x37')]);}_0x204113[_0xebc5('0x38')]=qs['sort'](_0x3e53d0[_0xebc5('0x31')][_0xebc5('0x39')]);_0x204113[_0xebc5('0x3a')]=qs[_0xebc5('0x3b')](_[_0xebc5('0x3c')](_0x3e53d0[_0xebc5('0x31')],_0x531ec2[_0xebc5('0x3b')]),_0x55579d);if(_0x3e53d0[_0xebc5('0x31')][_0xebc5('0x3d')]){_0x204113['where']=_['merge'](_0x204113[_0xebc5('0x3a')],{'$or':_[_0xebc5('0x2a')](_0x55579d,function(_0x191f1){if(_0x191f1['type']!=='VIRTUAL'){var _0x509adc={};_0x509adc[_0x191f1['name']]={'$like':'%'+_0x3e53d0[_0xebc5('0x31')]['filter']+'%'};return _0x509adc;}})});}_0x204113=_['merge']({},_0x204113,_0x3e53d0[_0xebc5('0x3e')]);var _0x25201a={'where':_0x204113[_0xebc5('0x3a')]};return db[_0xebc5('0x2b')][_0xebc5('0x1d')](_0x25201a)['then'](function(_0x529d35){_0x120574['count']=_0x529d35;if(_0x3e53d0[_0xebc5('0x31')][_0xebc5('0x3f')]){_0x204113['include']=[{'all':!![]}];}return db[_0xebc5('0x2b')][_0xebc5('0x40')](_0x204113);})[_0xebc5('0x21')](function(_0x1135b9){_0x120574[_0xebc5('0x41')]=_0x1135b9;return _0x120574;})['then'](respondWithFilteredResult(_0x2acf91,_0x204113))[_0xebc5('0x42')](handleError(_0x2acf91,null));};exports[_0xebc5('0x43')]=function(_0x13640e,_0x476200){var _0x3c4801={'raw':![],'where':{'id':_0x13640e[_0xebc5('0x44')]['id']}},_0x4d802b={};_0x4d802b[_0xebc5('0x30')]=_[_0xebc5('0x45')](db[_0xebc5('0x2b')][_0xebc5('0x2c')]);_0x4d802b[_0xebc5('0x31')]=_[_0xebc5('0x45')](_0x13640e[_0xebc5('0x31')]);_0x4d802b[_0xebc5('0x3b')]=_[_0xebc5('0x32')](_0x4d802b[_0xebc5('0x30')],_0x4d802b[_0xebc5('0x31')]);_0x3c4801[_0xebc5('0x34')]=_['intersection'](_0x4d802b[_0xebc5('0x30')],qs[_0xebc5('0x33')](_0x13640e['query'][_0xebc5('0x33')]));_0x3c4801[_0xebc5('0x34')]=_0x3c4801[_0xebc5('0x34')]['length']?_0x3c4801['attributes']:_0x4d802b['model'];if(_0x13640e[_0xebc5('0x31')][_0xebc5('0x3f')]){_0x3c4801['include']=[{'all':!![]}];}_0x3c4801=_['merge']({},_0x3c4801,_0x13640e[_0xebc5('0x3e')]);return db['JscriptyProject'][_0xebc5('0x46')](_0x3c4801)[_0xebc5('0x21')](handleEntityNotFound(_0x476200,null))[_0xebc5('0x21')](respondWithResult(_0x476200,null))[_0xebc5('0x42')](handleError(_0x476200,null));};exports[_0xebc5('0x47')]=function(_0x2fb8b2,_0x5eff33){return db[_0xebc5('0x2b')][_0xebc5('0x47')](_0x2fb8b2[_0xebc5('0x48')],{})[_0xebc5('0x21')](function(_0x340c3e){var _0x3f9054=_0x2fb8b2[_0xebc5('0x49')][_0xebc5('0x23')]({'plain':!![]});if(!_0x3f9054)throw new Error(_0xebc5('0x4a'));if(_0x3f9054[_0xebc5('0x4b')]===_0xebc5('0x49')){var _0x57bbc9=_0x340c3e[_0xebc5('0x23')]({'plain':!![]});var _0x30242a=_0xebc5('0x4c');return db[_0xebc5('0x4d')][_0xebc5('0x46')]({'where':{'name':_0x30242a,'userProfileId':_0x3f9054[_0xebc5('0x4e')]},'raw':!![]})[_0xebc5('0x21')](function(_0x278810){if(_0x278810&&_0x278810[_0xebc5('0x4f')]===0x0){return db['UserProfileResource'][_0xebc5('0x47')]({'name':_0x57bbc9['name'],'resourceId':_0x57bbc9['id'],'type':_0x278810['name'],'sectionId':_0x278810['id']},{})[_0xebc5('0x21')](function(){return _0x340c3e;});}else{return _0x340c3e;}})[_0xebc5('0x42')](function(_0x456c82){logger[_0xebc5('0x25')](_0xebc5('0x50'),_0x456c82);throw _0x456c82;});}return _0x340c3e;})[_0xebc5('0x21')](respondWithResult(_0x5eff33,0xc9))[_0xebc5('0x42')](handleError(_0x5eff33,null));};exports[_0xebc5('0x51')]=function(_0x2d5eb0,_0x2f9d7e){var _0x160ba6={'where':{'id':_0x2d5eb0[_0xebc5('0x44')]['id']}},_0x3e68a9={};_0x3e68a9[_0xebc5('0x30')]=_[_0xebc5('0x45')](db[_0xebc5('0x2b')]['rawAttributes']);_0x160ba6[_0xebc5('0x34')]=_[_0xebc5('0x32')](_0x3e68a9[_0xebc5('0x30')],qs[_0xebc5('0x33')](_0x2d5eb0[_0xebc5('0x31')][_0xebc5('0x33')]));_0x160ba6[_0xebc5('0x34')]=_0x160ba6[_0xebc5('0x34')][_0xebc5('0x52')]?_0x160ba6[_0xebc5('0x34')]:_0x3e68a9[_0xebc5('0x30')];if(_0x2d5eb0[_0xebc5('0x31')][_0xebc5('0x3f')]){_0x160ba6[_0xebc5('0x53')]=[{'all':!![]}];}_0x160ba6=_[_0xebc5('0x54')]({},_0x160ba6,_0x2d5eb0[_0xebc5('0x3e')]);return db[_0xebc5('0x2b')][_0xebc5('0x46')](_0x160ba6)[_0xebc5('0x21')](handleEntityNotFound(_0x2f9d7e,null))[_0xebc5('0x21')](function(_0x423615){if(_0x423615){var _0x1c49e2=_0x423615[_0xebc5('0x23')]({'plain':!![]});_0x1c49e2=qs['omit'](_0x1c49e2,['id','createdAt',_0xebc5('0x55')]);_0x2d5eb0[_0xebc5('0x48')]=_[_0xebc5('0x56')](_0x2d5eb0['body'],['id',_0xebc5('0x57'),_0xebc5('0x55')]);return db[_0xebc5('0x2b')][_0xebc5('0x47')](_[_0xebc5('0x54')](_0x1c49e2,_0x2d5eb0[_0xebc5('0x48')]),{'include':_0x2d5eb0[_0xebc5('0x31')][_0xebc5('0x3f')]?[{'all':!![]}]:undefined})[_0xebc5('0x21')](function(_0x37c1f5){var _0x467ace=_0x2d5eb0[_0xebc5('0x49')][_0xebc5('0x23')]({'plain':!![]});if(!_0x467ace)throw new Error(_0xebc5('0x4a'));if(_0x467ace[_0xebc5('0x4b')]==='user'){var _0x369fad=_0x37c1f5[_0xebc5('0x23')]({'plain':!![]});var _0x1d0cdd=_0xebc5('0x4c');return db[_0xebc5('0x4d')][_0xebc5('0x46')]({'where':{'name':_0x1d0cdd,'userProfileId':_0x467ace[_0xebc5('0x4e')]},'raw':!![]})[_0xebc5('0x21')](function(_0x2400bc){if(_0x2400bc&&_0x2400bc['autoAssociation']===0x0){return db['UserProfileResource'][_0xebc5('0x47')]({'name':_0x369fad[_0xebc5('0x27')],'resourceId':_0x369fad['id'],'type':_0x2400bc[_0xebc5('0x27')],'sectionId':_0x2400bc['id']},{})[_0xebc5('0x21')](function(){return _0x37c1f5;});}else{return _0x37c1f5;}})[_0xebc5('0x42')](function(_0x257c4f){logger[_0xebc5('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x257c4f);throw _0x257c4f;});}return _0x37c1f5;});}})[_0xebc5('0x21')](respondWithResult(_0x2f9d7e,0xc9))['catch'](handleError(_0x2f9d7e,null));};exports[_0xebc5('0x58')]=function(_0x5b9b89,_0x455776){if(_0x5b9b89[_0xebc5('0x48')]['id']){delete _0x5b9b89[_0xebc5('0x48')]['id'];}return db[_0xebc5('0x2b')][_0xebc5('0x46')]({'where':{'id':_0x5b9b89[_0xebc5('0x44')]['id']}})[_0xebc5('0x21')](handleEntityNotFound(_0x455776,null))['then'](saveUpdates(_0x5b9b89[_0xebc5('0x48')],null))['then'](respondWithResult(_0x455776,null))['catch'](handleError(_0x455776,null));};exports[_0xebc5('0x22')]=function(_0x3fde32,_0x16ed66){return db[_0xebc5('0x2b')]['find']({'where':{'id':_0x3fde32[_0xebc5('0x44')]['id']}})['then'](handleEntityNotFound(_0x16ed66,null))[_0xebc5('0x21')](removeEntity(_0x16ed66,null))[_0xebc5('0x42')](handleError(_0x16ed66,null));};exports[_0xebc5('0x59')]=function(_0x1045ed,_0xaa81fe,_0x24b593){var _0x5ad9ca={'raw':!![],'where':{}};var _0x5bd876={};var _0x446431={'count':0x0,'rows':[]};return db[_0xebc5('0x2b')]['findOne']({'where':{'id':_0x1045ed[_0xebc5('0x44')]['id']}})[_0xebc5('0x21')](handleEntityNotFound(_0xaa81fe,null))[_0xebc5('0x21')](function(_0x539777){if(_0x539777){_0x5bd876[_0xebc5('0x30')]=_[_0xebc5('0x45')](db[_0xebc5('0x5a')][_0xebc5('0x2c')]);_0x5bd876['query']=_[_0xebc5('0x45')](_0x1045ed[_0xebc5('0x31')]);_0x5bd876[_0xebc5('0x3b')]=_[_0xebc5('0x32')](_0x5bd876['model'],_0x5bd876[_0xebc5('0x31')]);_0x5ad9ca[_0xebc5('0x34')]=_[_0xebc5('0x32')](_0x5bd876[_0xebc5('0x30')],qs[_0xebc5('0x33')](_0x1045ed['query']['fields']));_0x5ad9ca[_0xebc5('0x34')]=_0x5ad9ca[_0xebc5('0x34')][_0xebc5('0x52')]?_0x5ad9ca['attributes']:_0x5bd876[_0xebc5('0x30')];if(!_0x1045ed[_0xebc5('0x31')][_0xebc5('0x35')](_0xebc5('0x36'))){_0x5ad9ca[_0xebc5('0x1c')]=qs[_0xebc5('0x1c')](_0x1045ed[_0xebc5('0x31')][_0xebc5('0x1c')]);_0x5ad9ca[_0xebc5('0x37')]=qs[_0xebc5('0x37')](_0x1045ed[_0xebc5('0x31')][_0xebc5('0x37')]);}_0x5ad9ca[_0xebc5('0x38')]=qs[_0xebc5('0x39')](_0x1045ed[_0xebc5('0x31')][_0xebc5('0x39')]);_0x5ad9ca[_0xebc5('0x3a')]=qs[_0xebc5('0x3b')](_[_0xebc5('0x3c')](_0x1045ed[_0xebc5('0x31')],_0x5bd876['filters']));_0x5ad9ca[_0xebc5('0x3a')]['ProjectId']=_0x539777['id'];if(_0x1045ed[_0xebc5('0x31')]['filter']){_0x5ad9ca[_0xebc5('0x3a')]=_[_0xebc5('0x54')](_0x5ad9ca[_0xebc5('0x3a')],{'$or':_['map'](_0x5ad9ca[_0xebc5('0x34')],function(_0x22c5b1){var _0xd9d7cd={};_0xd9d7cd[_0x22c5b1]={'$like':'%'+_0x1045ed[_0xebc5('0x31')][_0xebc5('0x3d')]+'%'};return _0xd9d7cd;})});}_0x5ad9ca=_[_0xebc5('0x54')]({},_0x5ad9ca,_0x1045ed[_0xebc5('0x3e')]);return db[_0xebc5('0x5a')]['count']({'where':_0x5ad9ca['where']})[_0xebc5('0x21')](function(_0x312e74){_0x446431[_0xebc5('0x1d')]=_0x312e74;if(_0x1045ed[_0xebc5('0x31')][_0xebc5('0x3f')]){_0x5ad9ca[_0xebc5('0x53')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0xebc5('0x40')](_0x5ad9ca);})['then'](function(_0x210c2e){_0x446431['rows']=_0x210c2e;return _0x446431;});}})[_0xebc5('0x21')](respondWithFilteredResult(_0xaa81fe,_0x5ad9ca))[_0xebc5('0x42')](handleError(_0xaa81fe,null));};exports[_0xebc5('0x5b')]=function(_0x489c71,_0x35cb37,_0x3f12a5){var _0x191376={'raw':!![],'where':{}};var _0x40cbd4={};var _0x44bbd6={'count':0x0,'rows':[]};return db[_0xebc5('0x2b')][_0xebc5('0x5c')]({'where':{'id':_0x489c71[_0xebc5('0x44')]['id']}})[_0xebc5('0x21')](handleEntityNotFound(_0x35cb37,null))['then'](function(_0x340692){if(_0x340692){_0x40cbd4[_0xebc5('0x30')]=_[_0xebc5('0x45')](db[_0xebc5('0x5d')][_0xebc5('0x2c')]);_0x40cbd4['query']=_[_0xebc5('0x45')](_0x489c71[_0xebc5('0x31')]);_0x40cbd4[_0xebc5('0x3b')]=_[_0xebc5('0x32')](_0x40cbd4[_0xebc5('0x30')],_0x40cbd4[_0xebc5('0x31')]);_0x191376[_0xebc5('0x34')]=_[_0xebc5('0x32')](_0x40cbd4[_0xebc5('0x30')],qs[_0xebc5('0x33')](_0x489c71[_0xebc5('0x31')][_0xebc5('0x33')]));_0x191376[_0xebc5('0x34')]=_0x191376['attributes']['length']?_0x191376[_0xebc5('0x34')]:_0x40cbd4['model'];if(!_0x489c71['query'][_0xebc5('0x35')](_0xebc5('0x36'))){_0x191376[_0xebc5('0x1c')]=qs['limit'](_0x489c71[_0xebc5('0x31')][_0xebc5('0x1c')]);_0x191376[_0xebc5('0x37')]=qs[_0xebc5('0x37')](_0x489c71[_0xebc5('0x31')][_0xebc5('0x37')]);}_0x191376[_0xebc5('0x38')]=qs[_0xebc5('0x39')](_0x489c71['query'][_0xebc5('0x39')]);_0x191376[_0xebc5('0x3a')]=qs['filters'](_[_0xebc5('0x3c')](_0x489c71['query'],_0x40cbd4[_0xebc5('0x3b')]));_0x191376[_0xebc5('0x3a')][_0xebc5('0x5e')]=_0x340692['id'];if(_0x489c71[_0xebc5('0x31')][_0xebc5('0x3d')]){_0x191376[_0xebc5('0x3a')]=_[_0xebc5('0x54')](_0x191376[_0xebc5('0x3a')],{'$or':_[_0xebc5('0x2a')](_0x191376[_0xebc5('0x34')],function(_0x2ba010){var _0x125536={};_0x125536[_0x2ba010]={'$like':'%'+_0x489c71[_0xebc5('0x31')][_0xebc5('0x3d')]+'%'};return _0x125536;})});}_0x191376=_[_0xebc5('0x54')]({},_0x191376,_0x489c71['options']);return db['JscriptyAnswerReport'][_0xebc5('0x1d')]({'where':_0x191376[_0xebc5('0x3a')]})[_0xebc5('0x21')](function(_0x1b8346){_0x44bbd6[_0xebc5('0x1d')]=_0x1b8346;if(_0x489c71['query'][_0xebc5('0x3f')]){_0x191376['include']=[{'all':!![]}];}return db[_0xebc5('0x5d')]['findAll'](_0x191376);})['then'](function(_0x1f10f5){_0x44bbd6[_0xebc5('0x41')]=_0x1f10f5;return _0x44bbd6;});}})[_0xebc5('0x21')](respondWithFilteredResult(_0x35cb37,_0x191376))[_0xebc5('0x42')](handleError(_0x35cb37,null));};function char(_0x6d153b){return'number'===typeof _0x6d153b?String['fromCharCode'][_0xebc5('0x5f')](null,arguments):_0x6d153b;}function needsEncapsulation(_0x15dc05){return!!_0x15dc05&&(_0x15dc05[_0xebc5('0x60')]()[_0xebc5('0x61')](char(0xd))>=0x0||_0x15dc05['toString']()['indexOf'](char(0xa))>=0x0||_0x15dc05[_0xebc5('0x60')]()[_0xebc5('0x61')](char(0x2c))>=0x0||_0x15dc05[_0xebc5('0x60')]()[_0xebc5('0x61')](char(0x22))>=0x0);}function encapsulate(_0x424e8f){var _0x3d34eb=char(0x22),_0x1bac41='\x5c'+char(0x22),_0xd18901=_0x424e8f['toString']()[_0xebc5('0x62')](new RegExp(_0x3d34eb,'g'),_0x1bac41);return _0x3d34eb+_0xd18901+_0x3d34eb;}exports[_0xebc5('0x63')]=function(_0x317d16,_0x4b3a6c,_0x213ea9){var _0x14c284,_0x2ba117;var _0x5cc8dc={'where':{'ProjectId':_0x317d16[_0xebc5('0x44')]['id']}};if(_0x317d16[_0xebc5('0x31')][_0xebc5('0x64')]){_0x5cc8dc['where'][_0xebc5('0x65')]=JSON[_0xebc5('0x66')](_0x317d16[_0xebc5('0x31')][_0xebc5('0x64')]);}return db['JscriptySessionReport'][_0xebc5('0x40')](_0x5cc8dc)[_0xebc5('0x21')](handleEntityNotFound(_0x4b3a6c,null))[_0xebc5('0x21')](function(_0x3329f6){if(_0x3329f6){_0x14c284=_0x3329f6;return db[_0xebc5('0x67')][_0xebc5('0x40')]({'where':{'SessionId':{'$in':_[_0xebc5('0x2a')](_0x14c284,'id')},'ProjectId':_0x317d16[_0xebc5('0x44')]['id']},'order':'-createdAt'});}})[_0xebc5('0x21')](handleEntityNotFound(_0x4b3a6c,null))['then'](function(_0x55d85f){if(_0x55d85f){_0x2ba117=_0x55d85f;var _0x16200e={};for(var _0x152314=0x0,_0x52280d=_0x2ba117[_0xebc5('0x52')];_0x152314<_0x52280d;_0x152314++){if(!_0x16200e[_0xebc5('0x35')](_0x2ba117[_0x152314][_0xebc5('0x68')])){_0x16200e[_0x2ba117[_0x152314][_0xebc5('0x68')]]=needsEncapsulation(_0x2ba117[_0x152314][_0xebc5('0x69')])?encapsulate(_0x2ba117[_0x152314][_0xebc5('0x69')]):_0x2ba117[_0x152314][_0xebc5('0x69')];}}var _0x5c0a46=[],_0x355ace={};for(var _0x1f83e6=0x0,_0x54770d=_0x14c284[_0xebc5('0x52')];_0x1f83e6<_0x54770d;_0x1f83e6++){_0x355ace={'ProjectId':_0x317d16['params']['id'],'SessionId':_0x14c284[_0x1f83e6]['id'],'StartTime':moment(_0x14c284[_0x1f83e6][_0xebc5('0x65')])[_0xebc5('0x6a')](_0xebc5('0x6b'))};for(var _0x2e4242=0x0,_0x210e2c=_0x2ba117['length'];_0x2e4242<_0x210e2c;_0x2e4242++){if(_0x2ba117[_0x2e4242][_0xebc5('0x6c')]==_0x14c284[_0x1f83e6]['id']&&_0x16200e['hasOwnProperty'](_0x2ba117[_0x2e4242][_0xebc5('0x68')])){_0x355ace[_0x16200e[_0x2ba117[_0x2e4242][_0xebc5('0x68')]]]=_0x2ba117[_0x2e4242][_0xebc5('0x6d')];}}for(var _0x124749 in _0x16200e){if(!_0x355ace[_0xebc5('0x35')](_0x16200e[_0x124749])){_0x355ace[_0x16200e[_0x124749]]=null;}}_0x5c0a46[_0xebc5('0x6e')](_0x355ace);}return _0x5c0a46;}})[_0xebc5('0x21')](function(_0x38c407){if(!_[_0xebc5('0x6f')](_0x38c407)){var _0x3acadc=toCsv(_0x38c407);var _0x17aefe=Date['now']();fs[_0xebc5('0x70')](util[_0xebc5('0x6a')](_0xebc5('0x71'),_0x317d16[_0xebc5('0x44')]['id'],_0x17aefe),_0x3acadc);_0x4b3a6c[_0xebc5('0x72')](_0xebc5('0x73'),_0xebc5('0x74')+util['format'](_0xebc5('0x75'),_0x317d16[_0xebc5('0x44')]['id'],_0x17aefe));_0x4b3a6c[_0xebc5('0x72')](_0xebc5('0x76'),_0xebc5('0x77'));return _0x4b3a6c[_0xebc5('0x78')](util['format'](_0xebc5('0x71'),_0x317d16[_0xebc5('0x44')]['id'],_0x17aefe));}else{return _0x4b3a6c[_0xebc5('0x17')](0xcc);}})[_0xebc5('0x42')](handleError(_0x4b3a6c,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index c3a1584..0914ccc 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 _0x7edb=['define','JscriptyProject','jscripty_projects','util','../../config/logger','api','moment','bluebird','path','./jscriptyProject.attributes','exports'];(function(_0x1bd1dd,_0x2efc7c){var _0x31752f=function(_0x529299){while(--_0x529299){_0x1bd1dd['push'](_0x1bd1dd['shift']());}};_0x31752f(++_0x2efc7c);}(_0x7edb,0x158));var _0xb7ed=function(_0x2f940d,_0x397991){_0x2f940d=_0x2f940d-0x0;var _0x2c32df=_0x7edb[_0x2f940d];return _0x2c32df;};'use strict';var _=require('lodash');var util=require(_0xb7ed('0x0'));var logger=require(_0xb7ed('0x1'))(_0xb7ed('0x2'));var moment=require(_0xb7ed('0x3'));var BPromise=require(_0xb7ed('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb7ed('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xb7ed('0x6'));module[_0xb7ed('0x7')]=function(_0x2aa67d,_0x246cfa){return _0x2aa67d[_0xb7ed('0x8')](_0xb7ed('0x9'),attributes,{'tableName':_0xb7ed('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9ade=['define','JscriptyProject','jscripty_projects','lodash','util','moment','request-promise','path','./jscriptyProject.attributes','exports'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x9ade,0x107));var _0xe9ad=function(_0x1e8ac9,_0x1bd0fe){_0x1e8ac9=_0x1e8ac9-0x0;var _0x4c895c=_0x9ade[_0x1e8ac9];return _0x4c895c;};'use strict';var _=require(_0xe9ad('0x0'));var util=require(_0xe9ad('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xe9ad('0x2'));var BPromise=require('bluebird');var rp=require(_0xe9ad('0x3'));var fs=require('fs');var path=require(_0xe9ad('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xe9ad('0x5'));module[_0xe9ad('0x6')]=function(_0xdd1549,_0x3e4092){return _0xdd1549[_0xe9ad('0x7')](_0xe9ad('0x8'),attributes,{'tableName':_0xe9ad('0x9'),'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 2b18d1b..422ac2d 100644 --- a/server/api/jscriptyProject/jscriptyProject.rpc.js +++ b/server/api/jscriptyProject/jscriptyProject.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb43b=['rpc','../../config/environment','http','request','info','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','JscriptyProject,\x20%s,\x20%s','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x29db89,_0x49c7e2){var _0x8f65da=function(_0x4c4ab9){while(--_0x4c4ab9){_0x29db89['push'](_0x29db89['shift']());}};_0x8f65da(++_0x49c7e2);}(_0xb43b,0x1b2));var _0xbb43=function(_0xbe5260,_0x310878){_0xbe5260=_0xbe5260-0x0;var _0xe728b0=_0xb43b[_0xbe5260];return _0xe728b0;};'use strict';var _=require(_0xbb43('0x0'));var util=require(_0xbb43('0x1'));var moment=require('moment');var BPromise=require(_0xbb43('0x2'));var rs=require(_0xbb43('0x3'));var fs=require('fs');var Redis=require(_0xbb43('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbb43('0x5'));var logger=require(_0xbb43('0x6'))(_0xbb43('0x7'));var config=require(_0xbb43('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xbb43('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x553520,_0x80fe61,_0x1ccd49){return new BPromise(function(_0x2a2f11,_0x29ae1a){return client[_0xbb43('0xa')](_0x553520,_0x1ccd49)['then'](function(_0x208c2b){logger[_0xbb43('0xb')]('JscriptyProject,\x20%s,\x20%s',_0x80fe61,_0xbb43('0xc'));logger[_0xbb43('0xd')](_0xbb43('0xe'),_0x80fe61,_0xbb43('0xc'),JSON[_0xbb43('0xf')](_0x208c2b));if(_0x208c2b[_0xbb43('0x10')]){if(_0x208c2b['error'][_0xbb43('0x11')]===0x1f4){logger[_0xbb43('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x80fe61,_0x208c2b['error'][_0xbb43('0x12')]);return _0x29ae1a(_0x208c2b['error']['message']);}logger[_0xbb43('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x80fe61,_0x208c2b[_0xbb43('0x10')][_0xbb43('0x12')]);return _0x2a2f11(_0x208c2b['error']['message']);}else{logger['info'](_0xbb43('0x13'),_0x80fe61,_0xbb43('0xc'));_0x2a2f11(_0x208c2b['result']['message']);}})[_0xbb43('0x14')](function(_0x563ce1){logger['error'](_0xbb43('0x13'),_0x80fe61,_0x563ce1);_0x29ae1a(_0x563ce1);});});} \ No newline at end of file +var _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(_0x54a497,_0xca79ec){var _0x364671=function(_0x4f7e54){while(--_0x4f7e54){_0x54a497['push'](_0x54a497['shift']());}};_0x364671(++_0xca79ec);}(_0x9bde,0xe1));var _0xe9bd=function(_0x24b11c,_0x440d98){_0x24b11c=_0x24b11c-0x0;var _0xfafed6=_0x9bde[_0x24b11c];return _0xfafed6;};'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 diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index ab5034b..49bb5d9 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 _0x7428=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','isAuthenticated','index','get','describe','/:id','show','post','put','update','delete','destroy','exports','util','path','connect-timeout'];(function(_0x10b2d5,_0x5a7743){var _0x14b8d1=function(_0x3b888c){while(--_0x3b888c){_0x10b2d5['push'](_0x10b2d5['shift']());}};_0x14b8d1(++_0x5a7743);}(_0x7428,0xba));var _0x8742=function(_0x2500ec,_0x43d349){_0x2500ec=_0x2500ec-0x0;var _0x561796=_0x7428[_0x2500ec];return _0x561796;};'use strict';var multer=require('multer');var util=require(_0x8742('0x0'));var path=require(_0x8742('0x1'));var timeout=require(_0x8742('0x2'));var express=require(_0x8742('0x3'));var router=express['Router']();var fs_extra=require(_0x8742('0x4'));var auth=require(_0x8742('0x5'));var interaction=require(_0x8742('0x6'));var config=require(_0x8742('0x7'));var controller=require(_0x8742('0x8'));router['get']('/',auth[_0x8742('0x9')](),controller[_0x8742('0xa')]);router[_0x8742('0xb')]('/describe',auth[_0x8742('0x9')](),controller[_0x8742('0xc')]);router['get'](_0x8742('0xd'),auth['isAuthenticated'](),controller[_0x8742('0xe')]);router[_0x8742('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x8742('0x10')](_0x8742('0xd'),auth[_0x8742('0x9')](),controller[_0x8742('0x11')]);router[_0x8742('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x8742('0x13')]);module[_0x8742('0x14')]=router; \ No newline at end of file +var _0x5f7d=['index','/describe','describe','get','/:id','show','create','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./jscriptyQuestionReport.controller','isAuthenticated'];(function(_0x2a1465,_0x8bf785){var _0x128933=function(_0x4f2a1f){while(--_0x4f2a1f){_0x2a1465['push'](_0x2a1465['shift']());}};_0x128933(++_0x8bf785);}(_0x5f7d,0x15a));var _0xd5f7=function(_0x3f4932,_0x34425e){_0x3f4932=_0x3f4932-0x0;var _0xafc18b=_0x5f7d[_0x3f4932];return _0xafc18b;};'use strict';var multer=require(_0xd5f7('0x0'));var util=require(_0xd5f7('0x1'));var path=require(_0xd5f7('0x2'));var timeout=require(_0xd5f7('0x3'));var express=require(_0xd5f7('0x4'));var router=express[_0xd5f7('0x5')]();var fs_extra=require(_0xd5f7('0x6'));var auth=require(_0xd5f7('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xd5f7('0x8'));var controller=require(_0xd5f7('0x9'));router['get']('/',auth[_0xd5f7('0xa')](),controller[_0xd5f7('0xb')]);router['get'](_0xd5f7('0xc'),auth[_0xd5f7('0xa')](),controller[_0xd5f7('0xd')]);router[_0xd5f7('0xe')](_0xd5f7('0xf'),auth['isAuthenticated'](),controller[_0xd5f7('0x10')]);router['post']('/',auth[_0xd5f7('0xa')](),controller[_0xd5f7('0x11')]);router['put'](_0xd5f7('0xf'),auth[_0xd5f7('0xa')](),controller[_0xd5f7('0x12')]);router['delete'](_0xd5f7('0xf'),auth[_0xd5f7('0xa')](),controller[_0xd5f7('0x13')]);module[_0xd5f7('0x14')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index 2a85171..db5c13d 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(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x7a54,0x106));var _0x47a5=function(_0x7c71ec,_0x1f71da){_0x7c71ec=_0x7c71ec-0x0;var _0x2bfb9e=_0x7a54[_0x7c71ec];return _0x2bfb9e;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}}; \ No newline at end of file +var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x7a54,0x106));var _0x47a5=function(_0x272a31,_0x54de5c){_0x272a31=_0x272a31-0x0;var _0x1046b9=_0x7a54[_0x272a31];return _0x1046b9;};'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 19050a6..62e0e4a 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 _0x728b=['sort','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','rawAttributes','fields','length','catch','create','find','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','JscriptyQuestionReport','type','model','map','query','filters','intersection','attributes','hasOwnProperty','order'];(function(_0x585b83,_0x25d403){var _0x2faa24=function(_0x2c756c){while(--_0x2c756c){_0x585b83['push'](_0x585b83['shift']());}};_0x2faa24(++_0x25d403);}(_0x728b,0x126));var _0xb728=function(_0x3fbcc5,_0xdfdb63){_0x3fbcc5=_0x3fbcc5-0x0;var _0x1a500f=_0x728b[_0x3fbcc5];return _0x1a500f;};'use strict';var emlformat=require(_0xb728('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb728('0x1'));var jsonpatch=require(_0xb728('0x2'));var rp=require(_0xb728('0x3'));var moment=require(_0xb728('0x4'));var BPromise=require(_0xb728('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xb728('0x6'));var sox=require('sox');var csv=require(_0xb728('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb728('0x8'));var squel=require(_0xb728('0x9'));var crypto=require(_0xb728('0xa'));var jsforce=require(_0xb728('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xb728('0x7'));var querystring=require(_0xb728('0xc'));var Papa=require('papaparse');var Redis=require(_0xb728('0xd'));var authService=require(_0xb728('0xe'));var qs=require(_0xb728('0xf'));var as=require(_0xb728('0x10'));var hardwareService=require(_0xb728('0x11'));var logger=require('../../config/logger')(_0xb728('0x12'));var utils=require(_0xb728('0x13'));var config=require(_0xb728('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xb728('0x15'))['db'];function respondWithStatusCode(_0x3d2ece,_0x20eb98){_0x20eb98=_0x20eb98||0xcc;return function(_0x1ca56a){if(_0x1ca56a){return _0x3d2ece[_0xb728('0x16')](_0x20eb98);}return _0x3d2ece[_0xb728('0x17')](_0x20eb98)[_0xb728('0x18')]();};}function respondWithResult(_0x16e5cc,_0x2dfb50){_0x2dfb50=_0x2dfb50||0xc8;return function(_0x2c8ee3){if(_0x2c8ee3){return _0x16e5cc[_0xb728('0x17')](_0x2dfb50)[_0xb728('0x19')](_0x2c8ee3);}};}function respondWithFilteredResult(_0x2d0afa,_0x535a29){return function(_0x1da474){if(_0x1da474){var _0x4c7301=typeof _0x535a29[_0xb728('0x1a')]===_0xb728('0x1b')&&typeof _0x535a29[_0xb728('0x1c')]===_0xb728('0x1b');var _0x2bbe6c=_0x1da474[_0xb728('0x1d')];var _0x311938=_0x4c7301?0x0:_0x535a29[_0xb728('0x1a')];var _0x4fdf21=_0x4c7301?_0x1da474['count']:_0x535a29[_0xb728('0x1a')]+_0x535a29[_0xb728('0x1c')];var _0x1b8461;if(_0x4fdf21>=_0x2bbe6c){_0x4fdf21=_0x2bbe6c;_0x1b8461=0xc8;}else{_0x1b8461=0xce;}_0x2d0afa['status'](_0x1b8461);return _0x2d0afa['set'](_0xb728('0x1e'),_0x311938+'-'+_0x4fdf21+'/'+_0x2bbe6c)[_0xb728('0x19')](_0x1da474);}return null;};}function patchUpdates(_0x120b8b){return function(_0x5e92e0){try{jsonpatch[_0xb728('0x1f')](_0x5e92e0,_0x120b8b,!![]);}catch(_0x4ad770){return BPromise[_0xb728('0x20')](_0x4ad770);}return _0x5e92e0[_0xb728('0x21')]();};}function saveUpdates(_0x360919,_0x434fdb){return function(_0x3fd3c2){if(_0x3fd3c2){return _0x3fd3c2[_0xb728('0x22')](_0x360919)[_0xb728('0x23')](function(_0x2829dc){return _0x2829dc;});}return null;};}function removeEntity(_0x2364d1,_0x2b00b3){return function(_0x1702c8){if(_0x1702c8){return _0x1702c8[_0xb728('0x24')]()[_0xb728('0x23')](function(){_0x2364d1[_0xb728('0x17')](0xcc)[_0xb728('0x18')]();});}};}function handleEntityNotFound(_0x565478,_0x125874){return function(_0x35bf2f){if(!_0x35bf2f){_0x565478[_0xb728('0x16')](0x194);}return _0x35bf2f;};}function handleError(_0xe48981,_0x3c829e){_0x3c829e=_0x3c829e||0x1f4;return function(_0x3ce95c){logger['error'](_0x3ce95c[_0xb728('0x25')]);if(_0x3ce95c[_0xb728('0x26')]){delete _0x3ce95c[_0xb728('0x26')];}_0xe48981['status'](_0x3c829e)[_0xb728('0x27')](_0x3ce95c);};}exports[_0xb728('0x28')]=function(_0x52733b,_0x1e281c){var _0x957752={},_0x2731fc={},_0x5e2b06={'count':0x0,'rows':[]};var _0x126f86=_['map'](db[_0xb728('0x29')]['rawAttributes'],function(_0x4986a1){return{'name':_0x4986a1['fieldName'],'type':_0x4986a1[_0xb728('0x2a')]['key']};});_0x2731fc[_0xb728('0x2b')]=_[_0xb728('0x2c')](_0x126f86,'name');_0x2731fc[_0xb728('0x2d')]=_['keys'](_0x52733b[_0xb728('0x2d')]);_0x2731fc[_0xb728('0x2e')]=_[_0xb728('0x2f')](_0x2731fc[_0xb728('0x2b')],_0x2731fc[_0xb728('0x2d')]);_0x957752[_0xb728('0x30')]=_[_0xb728('0x2f')](_0x2731fc[_0xb728('0x2b')],qs['fields'](_0x52733b[_0xb728('0x2d')]['fields']));_0x957752[_0xb728('0x30')]=_0x957752[_0xb728('0x30')]['length']?_0x957752[_0xb728('0x30')]:_0x2731fc['model'];if(!_0x52733b['query'][_0xb728('0x31')]('nolimit')){_0x957752[_0xb728('0x1c')]=qs[_0xb728('0x1c')](_0x52733b[_0xb728('0x2d')]['limit']);_0x957752[_0xb728('0x1a')]=qs['offset'](_0x52733b['query'][_0xb728('0x1a')]);}_0x957752[_0xb728('0x32')]=qs['sort'](_0x52733b[_0xb728('0x2d')][_0xb728('0x33')]);_0x957752['where']=qs[_0xb728('0x2e')](_['pick'](_0x52733b[_0xb728('0x2d')],_0x2731fc[_0xb728('0x2e')]),_0x126f86);if(_0x52733b['query'][_0xb728('0x34')]){_0x957752['where']=_[_0xb728('0x35')](_0x957752['where'],{'$or':_['map'](_0x126f86,function(_0x109460){if(_0x109460[_0xb728('0x2a')]!==_0xb728('0x36')){var _0x9ba69e={};_0x9ba69e[_0x109460[_0xb728('0x26')]]={'$like':'%'+_0x52733b[_0xb728('0x2d')][_0xb728('0x34')]+'%'};return _0x9ba69e;}})});}_0x957752=_['merge']({},_0x957752,_0x52733b[_0xb728('0x37')]);var _0x505d84={'where':_0x957752['where']};return db['JscriptyQuestionReport'][_0xb728('0x1d')](_0x505d84)[_0xb728('0x23')](function(_0x19f0a9){_0x5e2b06[_0xb728('0x1d')]=_0x19f0a9;if(_0x52733b[_0xb728('0x2d')][_0xb728('0x38')]){_0x957752[_0xb728('0x39')]=[{'all':!![]}];}return db[_0xb728('0x29')][_0xb728('0x3a')](_0x957752);})[_0xb728('0x23')](function(_0x8c2dec){_0x5e2b06[_0xb728('0x3b')]=_0x8c2dec;return _0x5e2b06;})[_0xb728('0x23')](respondWithFilteredResult(_0x1e281c,_0x957752))['catch'](handleError(_0x1e281c,null));};exports['show']=function(_0x57ea5e,_0x21e7ff){var _0x23437a={'raw':!![],'where':{'id':_0x57ea5e[_0xb728('0x3c')]['id']}},_0x4a2c95={};_0x4a2c95[_0xb728('0x2b')]=_['keys'](db[_0xb728('0x29')][_0xb728('0x3d')]);_0x4a2c95[_0xb728('0x2d')]=_['keys'](_0x57ea5e['query']);_0x4a2c95[_0xb728('0x2e')]=_[_0xb728('0x2f')](_0x4a2c95[_0xb728('0x2b')],_0x4a2c95[_0xb728('0x2d')]);_0x23437a['attributes']=_[_0xb728('0x2f')](_0x4a2c95['model'],qs[_0xb728('0x3e')](_0x57ea5e[_0xb728('0x2d')]['fields']));_0x23437a['attributes']=_0x23437a[_0xb728('0x30')][_0xb728('0x3f')]?_0x23437a[_0xb728('0x30')]:_0x4a2c95[_0xb728('0x2b')];if(_0x57ea5e[_0xb728('0x2d')]['includeAll']){_0x23437a[_0xb728('0x39')]=[{'all':!![]}];}_0x23437a=_[_0xb728('0x35')]({},_0x23437a,_0x57ea5e[_0xb728('0x37')]);return db[_0xb728('0x29')]['find'](_0x23437a)['then'](handleEntityNotFound(_0x21e7ff,null))[_0xb728('0x23')](respondWithResult(_0x21e7ff,null))[_0xb728('0x40')](handleError(_0x21e7ff,null));};exports[_0xb728('0x41')]=function(_0x3b6e5e,_0x3c4219){return db[_0xb728('0x29')]['create'](_0x3b6e5e['body'],{})[_0xb728('0x23')](respondWithResult(_0x3c4219,0xc9))[_0xb728('0x40')](handleError(_0x3c4219,null));};exports[_0xb728('0x22')]=function(_0x47d32c,_0x14758e){if(_0x47d32c['body']['id']){delete _0x47d32c['body']['id'];}return db[_0xb728('0x29')][_0xb728('0x42')]({'where':{'id':_0x47d32c[_0xb728('0x3c')]['id']}})[_0xb728('0x23')](handleEntityNotFound(_0x14758e,null))[_0xb728('0x23')](saveUpdates(_0x47d32c[_0xb728('0x43')],null))[_0xb728('0x23')](respondWithResult(_0x14758e,null))[_0xb728('0x40')](handleError(_0x14758e,null));};exports[_0xb728('0x24')]=function(_0x2b1f3b,_0x4a8167){return db['JscriptyQuestionReport'][_0xb728('0x42')]({'where':{'id':_0x2b1f3b[_0xb728('0x3c')]['id']}})[_0xb728('0x23')](handleEntityNotFound(_0x4a8167,null))[_0xb728('0x23')](removeEntity(_0x4a8167,null))[_0xb728('0x40')](handleError(_0x4a8167,null));};exports[_0xb728('0x44')]=function(_0x2433bb,_0x4478d8){return db['JscriptyQuestionReport'][_0xb728('0x44')]()[_0xb728('0x23')](respondWithResult(_0x4478d8,null))[_0xb728('0x40')](handleError(_0x4478d8,null));}; \ No newline at end of file +var _0x78d0=['lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','end','error','stack','name','send','index','map','JscriptyQuestionReport','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','rawAttributes','options','find','catch','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x546502,_0x5b6818){var _0x457e70=function(_0x1e35b8){while(--_0x1e35b8){_0x546502['push'](_0x546502['shift']());}};_0x457e70(++_0x5b6818);}(_0x78d0,0x128));var _0x078d=function(_0xd5f7ea,_0x53604e){_0xd5f7ea=_0xd5f7ea-0x0;var _0x39bfd5=_0x78d0[_0xd5f7ea];return _0x39bfd5;};'use strict';var emlformat=require(_0x078d('0x0'));var rimraf=require(_0x078d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x078d('0x2'));var rp=require(_0x078d('0x3'));var moment=require(_0x078d('0x4'));var BPromise=require(_0x078d('0x5'));var Mustache=require('mustache');var util=require(_0x078d('0x6'));var path=require(_0x078d('0x7'));var sox=require(_0x078d('0x8'));var csv=require(_0x078d('0x9'));var ejs=require(_0x078d('0xa'));var fs=require('fs');var fs_extra=require(_0x078d('0xb'));var _=require(_0x078d('0xc'));var squel=require('squel');var crypto=require(_0x078d('0xd'));var jsforce=require(_0x078d('0xe'));var deskjs=require(_0x078d('0xf'));var toCsv=require(_0x078d('0x9'));var querystring=require('querystring');var Papa=require(_0x078d('0x10'));var Redis=require(_0x078d('0x11'));var authService=require(_0x078d('0x12'));var qs=require(_0x078d('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x078d('0x14'));var logger=require(_0x078d('0x15'))('api');var utils=require(_0x078d('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x078d('0x17'));var db=require(_0x078d('0x18'))['db'];function respondWithStatusCode(_0x2a39d9,_0x464533){_0x464533=_0x464533||0xcc;return function(_0x5d86f7){if(_0x5d86f7){return _0x2a39d9[_0x078d('0x19')](_0x464533);}return _0x2a39d9['status'](_0x464533)['end']();};}function respondWithResult(_0x9b001b,_0x92e405){_0x92e405=_0x92e405||0xc8;return function(_0xd27f36){if(_0xd27f36){return _0x9b001b[_0x078d('0x1a')](_0x92e405)['json'](_0xd27f36);}};}function respondWithFilteredResult(_0xdeafb1,_0x72e0a5){return function(_0x3d6623){if(_0x3d6623){var _0x3b8351=typeof _0x72e0a5[_0x078d('0x1b')]===_0x078d('0x1c')&&typeof _0x72e0a5[_0x078d('0x1d')]==='undefined';var _0x3b29e0=_0x3d6623[_0x078d('0x1e')];var _0x55271f=_0x3b8351?0x0:_0x72e0a5[_0x078d('0x1b')];var _0x25e099=_0x3b8351?_0x3d6623[_0x078d('0x1e')]:_0x72e0a5[_0x078d('0x1b')]+_0x72e0a5['limit'];var _0x32291a;if(_0x25e099>=_0x3b29e0){_0x25e099=_0x3b29e0;_0x32291a=0xc8;}else{_0x32291a=0xce;}_0xdeafb1[_0x078d('0x1a')](_0x32291a);return _0xdeafb1[_0x078d('0x1f')](_0x078d('0x20'),_0x55271f+'-'+_0x25e099+'/'+_0x3b29e0)['json'](_0x3d6623);}return null;};}function patchUpdates(_0x56158c){return function(_0x4967d8){try{jsonpatch[_0x078d('0x21')](_0x4967d8,_0x56158c,!![]);}catch(_0x4a8c8e){return BPromise[_0x078d('0x22')](_0x4a8c8e);}return _0x4967d8['save']();};}function saveUpdates(_0x56a515,_0x3afc9a){return function(_0x2d9a03){if(_0x2d9a03){return _0x2d9a03[_0x078d('0x23')](_0x56a515)[_0x078d('0x24')](function(_0x583497){return _0x583497;});}return null;};}function removeEntity(_0x1f893e,_0x3a1fd5){return function(_0x559229){if(_0x559229){return _0x559229[_0x078d('0x25')]()[_0x078d('0x24')](function(){_0x1f893e['status'](0xcc)[_0x078d('0x26')]();});}};}function handleEntityNotFound(_0x5e7d6f,_0x186c8e){return function(_0x5dcb38){if(!_0x5dcb38){_0x5e7d6f['sendStatus'](0x194);}return _0x5dcb38;};}function handleError(_0x4e7fc6,_0x19f352){_0x19f352=_0x19f352||0x1f4;return function(_0x3c59a1){logger[_0x078d('0x27')](_0x3c59a1[_0x078d('0x28')]);if(_0x3c59a1['name']){delete _0x3c59a1[_0x078d('0x29')];}_0x4e7fc6[_0x078d('0x1a')](_0x19f352)[_0x078d('0x2a')](_0x3c59a1);};}exports[_0x078d('0x2b')]=function(_0x2ec33d,_0x396c32){var _0x365d18={},_0xbb77a7={},_0x3bcfd1={'count':0x0,'rows':[]};var _0x480d4c=_[_0x078d('0x2c')](db[_0x078d('0x2d')]['rawAttributes'],function(_0x50b2b1){return{'name':_0x50b2b1[_0x078d('0x2e')],'type':_0x50b2b1[_0x078d('0x2f')][_0x078d('0x30')]};});_0xbb77a7[_0x078d('0x31')]=_[_0x078d('0x2c')](_0x480d4c,_0x078d('0x29'));_0xbb77a7[_0x078d('0x32')]=_[_0x078d('0x33')](_0x2ec33d[_0x078d('0x32')]);_0xbb77a7[_0x078d('0x34')]=_[_0x078d('0x35')](_0xbb77a7['model'],_0xbb77a7[_0x078d('0x32')]);_0x365d18[_0x078d('0x36')]=_[_0x078d('0x35')](_0xbb77a7[_0x078d('0x31')],qs[_0x078d('0x37')](_0x2ec33d['query'][_0x078d('0x37')]));_0x365d18['attributes']=_0x365d18[_0x078d('0x36')][_0x078d('0x38')]?_0x365d18[_0x078d('0x36')]:_0xbb77a7['model'];if(!_0x2ec33d['query']['hasOwnProperty'](_0x078d('0x39'))){_0x365d18[_0x078d('0x1d')]=qs[_0x078d('0x1d')](_0x2ec33d[_0x078d('0x32')][_0x078d('0x1d')]);_0x365d18[_0x078d('0x1b')]=qs[_0x078d('0x1b')](_0x2ec33d[_0x078d('0x32')][_0x078d('0x1b')]);}_0x365d18[_0x078d('0x3a')]=qs[_0x078d('0x3b')](_0x2ec33d['query'][_0x078d('0x3b')]);_0x365d18[_0x078d('0x3c')]=qs['filters'](_[_0x078d('0x3d')](_0x2ec33d['query'],_0xbb77a7[_0x078d('0x34')]),_0x480d4c);if(_0x2ec33d[_0x078d('0x32')][_0x078d('0x3e')]){_0x365d18[_0x078d('0x3c')]=_[_0x078d('0x3f')](_0x365d18[_0x078d('0x3c')],{'$or':_[_0x078d('0x2c')](_0x480d4c,function(_0x3933ef){if(_0x3933ef[_0x078d('0x2f')]!==_0x078d('0x40')){var _0x47b767={};_0x47b767[_0x3933ef[_0x078d('0x29')]]={'$like':'%'+_0x2ec33d['query'][_0x078d('0x3e')]+'%'};return _0x47b767;}})});}_0x365d18=_[_0x078d('0x3f')]({},_0x365d18,_0x2ec33d['options']);var _0x2810e3={'where':_0x365d18['where']};return db[_0x078d('0x2d')][_0x078d('0x1e')](_0x2810e3)[_0x078d('0x24')](function(_0x48de3e){_0x3bcfd1[_0x078d('0x1e')]=_0x48de3e;if(_0x2ec33d[_0x078d('0x32')][_0x078d('0x41')]){_0x365d18[_0x078d('0x42')]=[{'all':!![]}];}return db[_0x078d('0x2d')][_0x078d('0x43')](_0x365d18);})[_0x078d('0x24')](function(_0x370b8e){_0x3bcfd1[_0x078d('0x44')]=_0x370b8e;return _0x3bcfd1;})[_0x078d('0x24')](respondWithFilteredResult(_0x396c32,_0x365d18))['catch'](handleError(_0x396c32,null));};exports[_0x078d('0x45')]=function(_0x29ca66,_0x26611c){var _0x4edfe8={'raw':!![],'where':{'id':_0x29ca66['params']['id']}},_0x16f243={};_0x16f243[_0x078d('0x31')]=_[_0x078d('0x33')](db[_0x078d('0x2d')][_0x078d('0x46')]);_0x16f243[_0x078d('0x32')]=_[_0x078d('0x33')](_0x29ca66['query']);_0x16f243[_0x078d('0x34')]=_[_0x078d('0x35')](_0x16f243[_0x078d('0x31')],_0x16f243[_0x078d('0x32')]);_0x4edfe8[_0x078d('0x36')]=_[_0x078d('0x35')](_0x16f243[_0x078d('0x31')],qs[_0x078d('0x37')](_0x29ca66[_0x078d('0x32')][_0x078d('0x37')]));_0x4edfe8[_0x078d('0x36')]=_0x4edfe8['attributes'][_0x078d('0x38')]?_0x4edfe8['attributes']:_0x16f243[_0x078d('0x31')];if(_0x29ca66[_0x078d('0x32')][_0x078d('0x41')]){_0x4edfe8[_0x078d('0x42')]=[{'all':!![]}];}_0x4edfe8=_[_0x078d('0x3f')]({},_0x4edfe8,_0x29ca66[_0x078d('0x47')]);return db[_0x078d('0x2d')][_0x078d('0x48')](_0x4edfe8)[_0x078d('0x24')](handleEntityNotFound(_0x26611c,null))[_0x078d('0x24')](respondWithResult(_0x26611c,null))[_0x078d('0x49')](handleError(_0x26611c,null));};exports[_0x078d('0x4a')]=function(_0x42dfee,_0x4c38f){return db[_0x078d('0x2d')][_0x078d('0x4a')](_0x42dfee['body'],{})[_0x078d('0x24')](respondWithResult(_0x4c38f,0xc9))[_0x078d('0x49')](handleError(_0x4c38f,null));};exports['update']=function(_0x47bff4,_0x467637){if(_0x47bff4[_0x078d('0x4b')]['id']){delete _0x47bff4[_0x078d('0x4b')]['id'];}return db[_0x078d('0x2d')][_0x078d('0x48')]({'where':{'id':_0x47bff4['params']['id']}})[_0x078d('0x24')](handleEntityNotFound(_0x467637,null))['then'](saveUpdates(_0x47bff4[_0x078d('0x4b')],null))[_0x078d('0x24')](respondWithResult(_0x467637,null))['catch'](handleError(_0x467637,null));};exports[_0x078d('0x25')]=function(_0x2a3636,_0x1065d5){return db[_0x078d('0x2d')]['find']({'where':{'id':_0x2a3636['params']['id']}})['then'](handleEntityNotFound(_0x1065d5,null))[_0x078d('0x24')](removeEntity(_0x1065d5,null))['catch'](handleError(_0x1065d5,null));};exports[_0x078d('0x4c')]=function(_0x511fbf,_0x454096){return db[_0x078d('0x2d')][_0x078d('0x4c')]()['then'](respondWithResult(_0x454096,null))[_0x078d('0x49')](handleError(_0x454096,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index a46ce87..01f93c9 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 _0xa687=['bluebird','path','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','exports','define','JscriptyQuestionReport','report_jscripty_questions','lodash','util','../../config/logger','moment'];(function(_0xa54d24,_0x59dc86){var _0x3912d7=function(_0x317a59){while(--_0x317a59){_0xa54d24['push'](_0xa54d24['shift']());}};_0x3912d7(++_0x59dc86);}(_0xa687,0x1a9));var _0x7a68=function(_0x12d79d,_0x3c4f12){_0x12d79d=_0x12d79d-0x0;var _0x5cbe01=_0xa687[_0x12d79d];return _0x5cbe01;};'use strict';var _=require(_0x7a68('0x0'));var util=require(_0x7a68('0x1'));var logger=require(_0x7a68('0x2'))('api');var moment=require(_0x7a68('0x3'));var BPromise=require(_0x7a68('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7a68('0x5'));var rimraf=require(_0x7a68('0x6'));var config=require(_0x7a68('0x7'));var attributes=require(_0x7a68('0x8'));module[_0x7a68('0x9')]=function(_0x449049,_0x1a929b){return _0x449049[_0x7a68('0xa')](_0x7a68('0xb'),attributes,{'tableName':_0x7a68('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1104=['./jscriptyQuestionReport.attributes','exports','define','JscriptyQuestionReport','report_jscripty_questions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0x1104,0xbb));var _0x4110=function(_0x3e566d,_0x5200e8){_0x3e566d=_0x3e566d-0x0;var _0x540851=_0x1104[_0x3e566d];return _0x540851;};'use strict';var _=require(_0x4110('0x0'));var util=require(_0x4110('0x1'));var logger=require(_0x4110('0x2'))(_0x4110('0x3'));var moment=require(_0x4110('0x4'));var BPromise=require(_0x4110('0x5'));var rp=require(_0x4110('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4110('0x7'));var config=require(_0x4110('0x8'));var attributes=require(_0x4110('0x9'));module[_0x4110('0xa')]=function(_0x49104f,_0x25837c){return _0x49104f[_0x4110('0xb')](_0x4110('0xc'),attributes,{'tableName':_0x4110('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js index d2f63e1..f43a117 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 _0x6f50=['stringify','error','code','message','result','util','bluebird','randomstring','ioredis','../../config/logger','rpc','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6f50,0x75));var _0x06f5=function(_0xe2c665,_0x5467a0){_0xe2c665=_0xe2c665-0x0;var _0x5bcbb7=_0x6f50[_0xe2c665];return _0x5bcbb7;};'use strict';var _=require('lodash');var util=require(_0x06f5('0x0'));var moment=require('moment');var BPromise=require(_0x06f5('0x1'));var rs=require(_0x06f5('0x2'));var fs=require('fs');var Redis=require(_0x06f5('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x06f5('0x4'))(_0x06f5('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x27d7bd,_0x2215f0,_0x4f6520){return new BPromise(function(_0x33fe6e,_0x573755){return client['request'](_0x27d7bd,_0x4f6520)[_0x06f5('0x6')](function(_0x21caab){logger[_0x06f5('0x7')](_0x06f5('0x8'),_0x2215f0,_0x06f5('0x9'));logger[_0x06f5('0xa')]('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0x2215f0,_0x06f5('0x9'),JSON[_0x06f5('0xb')](_0x21caab));if(_0x21caab[_0x06f5('0xc')]){if(_0x21caab[_0x06f5('0xc')][_0x06f5('0xd')]===0x1f4){logger['error'](_0x06f5('0x8'),_0x2215f0,_0x21caab[_0x06f5('0xc')][_0x06f5('0xe')]);return _0x573755(_0x21caab[_0x06f5('0xc')]['message']);}logger[_0x06f5('0xc')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x2215f0,_0x21caab[_0x06f5('0xc')][_0x06f5('0xe')]);return _0x33fe6e(_0x21caab[_0x06f5('0xc')][_0x06f5('0xe')]);}else{logger[_0x06f5('0x7')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x2215f0,_0x06f5('0x9'));_0x33fe6e(_0x21caab[_0x06f5('0xf')][_0x06f5('0xe')]);}})['catch'](function(_0x1ab007){logger[_0x06f5('0xc')](_0x06f5('0x8'),_0x2215f0,_0x1ab007);_0x573755(_0x1ab007);});});} \ No newline at end of file +var _0x44f5=['util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash'];(function(_0x384837,_0x2bd5d3){var _0x393d61=function(_0x59bed4){while(--_0x59bed4){_0x384837['push'](_0x384837['shift']());}};_0x393d61(++_0x2bd5d3);}(_0x44f5,0x1b7));var _0x544f=function(_0x50b881,_0x33ba68){_0x50b881=_0x50b881-0x0;var _0x4ad702=_0x44f5[_0x50b881];return _0x4ad702;};'use strict';var _=require(_0x544f('0x0'));var util=require(_0x544f('0x1'));var moment=require(_0x544f('0x2'));var BPromise=require('bluebird');var rs=require(_0x544f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x544f('0x4'))['db'];var utils=require(_0x544f('0x5'));var logger=require(_0x544f('0x6'))(_0x544f('0x7'));var config=require(_0x544f('0x8'));var jayson=require(_0x544f('0x9'));var client=jayson[_0x544f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2bc82a,_0x2fea84,_0x297f67){return new BPromise(function(_0x4e60fe,_0x21312b){return client[_0x544f('0xb')](_0x2bc82a,_0x297f67)['then'](function(_0xe283db){logger['info'](_0x544f('0xc'),_0x2fea84,_0x544f('0xd'));logger[_0x544f('0xe')](_0x544f('0xf'),_0x2fea84,'request\x20sent',JSON[_0x544f('0x10')](_0xe283db));if(_0xe283db[_0x544f('0x11')]){if(_0xe283db[_0x544f('0x11')]['code']===0x1f4){logger[_0x544f('0x11')](_0x544f('0xc'),_0x2fea84,_0xe283db[_0x544f('0x11')][_0x544f('0x12')]);return _0x21312b(_0xe283db[_0x544f('0x11')]['message']);}logger[_0x544f('0x11')](_0x544f('0xc'),_0x2fea84,_0xe283db[_0x544f('0x11')][_0x544f('0x12')]);return _0x4e60fe(_0xe283db[_0x544f('0x11')]['message']);}else{logger[_0x544f('0x13')](_0x544f('0xc'),_0x2fea84,_0x544f('0xd'));_0x4e60fe(_0xe283db[_0x544f('0x14')]['message']);}})[_0x544f('0x15')](function(_0x39455e){logger[_0x544f('0x11')](_0x544f('0xc'),_0x2fea84,_0x39455e);_0x21312b(_0x39455e);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index 5624c78..0e9f01d 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 _0xca92=['isAuthenticated','describe','show','getQuestions','create','put','/:id','update','delete','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','./jscriptySessionReport.controller','get','index','/describe'];(function(_0x2242b9,_0x10285b){var _0x5ae8be=function(_0x41d49b){while(--_0x41d49b){_0x2242b9['push'](_0x2242b9['shift']());}};_0x5ae8be(++_0x10285b);}(_0xca92,0x122));var _0x2ca9=function(_0x1f5a63,_0x511504){_0x1f5a63=_0x1f5a63-0x0;var _0x30bb7a=_0xca92[_0x1f5a63];return _0x30bb7a;};'use strict';var multer=require(_0x2ca9('0x0'));var util=require(_0x2ca9('0x1'));var path=require(_0x2ca9('0x2'));var timeout=require(_0x2ca9('0x3'));var express=require('express');var router=express[_0x2ca9('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2ca9('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2ca9('0x6'));router[_0x2ca9('0x7')]('/',auth['isAuthenticated'](),controller[_0x2ca9('0x8')]);router[_0x2ca9('0x7')](_0x2ca9('0x9'),auth[_0x2ca9('0xa')](),controller[_0x2ca9('0xb')]);router[_0x2ca9('0x7')]('/:id',auth[_0x2ca9('0xa')](),controller[_0x2ca9('0xc')]);router[_0x2ca9('0x7')]('/:id/questions',auth[_0x2ca9('0xa')](),controller[_0x2ca9('0xd')]);router['post']('/',auth[_0x2ca9('0xa')](),controller[_0x2ca9('0xe')]);router[_0x2ca9('0xf')](_0x2ca9('0x10'),auth[_0x2ca9('0xa')](),controller[_0x2ca9('0x11')]);router[_0x2ca9('0x12')](_0x2ca9('0x10'),auth[_0x2ca9('0xa')](),controller['destroy']);module[_0x2ca9('0x13')]=router; \ No newline at end of file +var _0x1383=['isAuthenticated','index','/describe','describe','/:id','show','/:id/questions','getQuestions','create','put','update','destroy','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','get'];(function(_0x36170e,_0x59e049){var _0x19d7c5=function(_0x2bf217){while(--_0x2bf217){_0x36170e['push'](_0x36170e['shift']());}};_0x19d7c5(++_0x59e049);}(_0x1383,0xca));var _0x3138=function(_0x301f76,_0x4ab3b6){_0x301f76=_0x301f76-0x0;var _0x3225ae=_0x1383[_0x301f76];return _0x3225ae;};'use strict';var multer=require(_0x3138('0x0'));var util=require(_0x3138('0x1'));var path=require(_0x3138('0x2'));var timeout=require(_0x3138('0x3'));var express=require('express');var router=express[_0x3138('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x3138('0x5'));var config=require(_0x3138('0x6'));var controller=require('./jscriptySessionReport.controller');router[_0x3138('0x7')]('/',auth[_0x3138('0x8')](),controller[_0x3138('0x9')]);router['get'](_0x3138('0xa'),auth[_0x3138('0x8')](),controller[_0x3138('0xb')]);router[_0x3138('0x7')](_0x3138('0xc'),auth[_0x3138('0x8')](),controller[_0x3138('0xd')]);router[_0x3138('0x7')](_0x3138('0xe'),auth['isAuthenticated'](),controller[_0x3138('0xf')]);router['post']('/',auth[_0x3138('0x8')](),controller[_0x3138('0x10')]);router[_0x3138('0x11')](_0x3138('0xc'),auth['isAuthenticated'](),controller[_0x3138('0x12')]);router['delete'](_0x3138('0xc'),auth['isAuthenticated'](),controller[_0x3138('0x13')]);module[_0x3138('0x14')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index 2135fc4..7a30730 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 _0xafec=['moment','DATE','setDataValue','starttime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN'];(function(_0x1b596f,_0x1d0814){var _0x48c840=function(_0x257118){while(--_0x257118){_0x1b596f['push'](_0x1b596f['shift']());}};_0x48c840(++_0x1d0814);}(_0xafec,0x168));var _0xcafe=function(_0x270dfb,_0x334d80){_0x270dfb=_0x270dfb-0x0;var _0x18b18f=_0xafec[_0x270dfb];return _0x18b18f;};'use strict';var moment=require(_0xcafe('0x0'));var Sequelize=require('sequelize');module['exports']={'starttime':{'type':Sequelize[_0xcafe('0x1')],'set':function(_0x2949c1){this[_0xcafe('0x2')](_0xcafe('0x3'),_0x2949c1);this[_0xcafe('0x2')](_0xcafe('0x4'),moment()[_0xcafe('0x5')](_0xcafe('0x6')));}},'endtime':{'type':Sequelize[_0xcafe('0x1')]},'membername':{'type':Sequelize[_0xcafe('0x7')]},'projectname':{'type':Sequelize[_0xcafe('0x7')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xcafe('0x7')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xcafe('0x7')]},'completed':{'type':Sequelize[_0xcafe('0x8')],'defaultValue':![]}}; \ No newline at end of file +var _0x71df=['exports','DATE','setDataValue','starttime','endtime','format','STRING','moment','sequelize'];(function(_0x5f3562,_0x212f41){var _0x1b39b4=function(_0x153e49){while(--_0x153e49){_0x5f3562['push'](_0x5f3562['shift']());}};_0x1b39b4(++_0x212f41);}(_0x71df,0x6a));var _0xf71d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x71df[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0xf71d('0x0'));var Sequelize=require(_0xf71d('0x1'));module[_0xf71d('0x2')]={'starttime':{'type':Sequelize[_0xf71d('0x3')],'set':function(_0x4f32b1){this[_0xf71d('0x4')](_0xf71d('0x5'),_0x4f32b1);this[_0xf71d('0x4')](_0xf71d('0x6'),moment()[_0xf71d('0x7')]('YYYY-MM-DD\x20HH:mm:ss'));}},'endtime':{'type':Sequelize[_0xf71d('0x3')]},'membername':{'type':Sequelize[_0xf71d('0x8')]},'projectname':{'type':Sequelize[_0xf71d('0x8')]},'queue':{'type':Sequelize[_0xf71d('0x8')]},'uniqueid':{'type':Sequelize[_0xf71d('0x8')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'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 c45b4e0..94d46a8 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 _0xd1ec=['attributes','fields','length','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','findAll','catch','params','keys','includeAll','find','create','body','describe','getQuestions','findOne','JscriptyQuestionReport','order','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','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','json','undefined','limit','count','offset','set','apply','reject','save','update','then','destroy','end','error','stack','name','send','map','JscriptySessionReport','rawAttributes','type','key','model','query','intersection'];(function(_0x2af769,_0x13cc74){var _0x1ce13d=function(_0x5c4570){while(--_0x5c4570){_0x2af769['push'](_0x2af769['shift']());}};_0x1ce13d(++_0x13cc74);}(_0xd1ec,0x10a));var _0xcd1e=function(_0x3b38b2,_0x4f9520){_0x3b38b2=_0x3b38b2-0x0;var _0x1f3e21=_0xd1ec[_0x3b38b2];return _0x1f3e21;};'use strict';var emlformat=require(_0xcd1e('0x0'));var rimraf=require(_0xcd1e('0x1'));var zipdir=require(_0xcd1e('0x2'));var jsonpatch=require(_0xcd1e('0x3'));var rp=require(_0xcd1e('0x4'));var moment=require(_0xcd1e('0x5'));var BPromise=require(_0xcd1e('0x6'));var Mustache=require('mustache');var util=require(_0xcd1e('0x7'));var path=require(_0xcd1e('0x8'));var sox=require('sox');var csv=require(_0xcd1e('0x9'));var ejs=require(_0xcd1e('0xa'));var fs=require('fs');var fs_extra=require(_0xcd1e('0xb'));var _=require(_0xcd1e('0xc'));var squel=require(_0xcd1e('0xd'));var crypto=require('crypto');var jsforce=require(_0xcd1e('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xcd1e('0x9'));var querystring=require(_0xcd1e('0xf'));var Papa=require(_0xcd1e('0x10'));var Redis=require(_0xcd1e('0x11'));var authService=require(_0xcd1e('0x12'));var qs=require(_0xcd1e('0x13'));var as=require(_0xcd1e('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcd1e('0x15'))(_0xcd1e('0x16'));var utils=require(_0xcd1e('0x17'));var config=require(_0xcd1e('0x18'));var licenseUtil=require(_0xcd1e('0x19'));var db=require(_0xcd1e('0x1a'))['db'];function respondWithStatusCode(_0x5b8ba9,_0x523189){_0x523189=_0x523189||0xcc;return function(_0x527618){if(_0x527618){return _0x5b8ba9[_0xcd1e('0x1b')](_0x523189);}return _0x5b8ba9['status'](_0x523189)['end']();};}function respondWithResult(_0x30a5c0,_0x204a04){_0x204a04=_0x204a04||0xc8;return function(_0x314441){if(_0x314441){return _0x30a5c0[_0xcd1e('0x1c')](_0x204a04)[_0xcd1e('0x1d')](_0x314441);}};}function respondWithFilteredResult(_0xb6d9bc,_0x3c7e56){return function(_0x9529e){if(_0x9529e){var _0x2904f2=typeof _0x3c7e56['offset']===_0xcd1e('0x1e')&&typeof _0x3c7e56[_0xcd1e('0x1f')]==='undefined';var _0x590ad1=_0x9529e[_0xcd1e('0x20')];var _0x19c4a2=_0x2904f2?0x0:_0x3c7e56[_0xcd1e('0x21')];var _0x522975=_0x2904f2?_0x9529e[_0xcd1e('0x20')]:_0x3c7e56[_0xcd1e('0x21')]+_0x3c7e56[_0xcd1e('0x1f')];var _0x222493;if(_0x522975>=_0x590ad1){_0x522975=_0x590ad1;_0x222493=0xc8;}else{_0x222493=0xce;}_0xb6d9bc[_0xcd1e('0x1c')](_0x222493);return _0xb6d9bc[_0xcd1e('0x22')]('Content-Range',_0x19c4a2+'-'+_0x522975+'/'+_0x590ad1)[_0xcd1e('0x1d')](_0x9529e);}return null;};}function patchUpdates(_0x43c221){return function(_0x4a9d7c){try{jsonpatch[_0xcd1e('0x23')](_0x4a9d7c,_0x43c221,!![]);}catch(_0x34cc0c){return BPromise[_0xcd1e('0x24')](_0x34cc0c);}return _0x4a9d7c[_0xcd1e('0x25')]();};}function saveUpdates(_0x92d3eb,_0x3da396){return function(_0x3208fa){if(_0x3208fa){return _0x3208fa[_0xcd1e('0x26')](_0x92d3eb)[_0xcd1e('0x27')](function(_0x21234c){return _0x21234c;});}return null;};}function removeEntity(_0x58ea10,_0x1e6958){return function(_0x33baff){if(_0x33baff){return _0x33baff[_0xcd1e('0x28')]()[_0xcd1e('0x27')](function(){_0x58ea10['status'](0xcc)[_0xcd1e('0x29')]();});}};}function handleEntityNotFound(_0x4f5adb,_0x173a53){return function(_0x14a020){if(!_0x14a020){_0x4f5adb[_0xcd1e('0x1b')](0x194);}return _0x14a020;};}function handleError(_0x54e7d4,_0x3f3f66){_0x3f3f66=_0x3f3f66||0x1f4;return function(_0x4cf5a8){logger[_0xcd1e('0x2a')](_0x4cf5a8[_0xcd1e('0x2b')]);if(_0x4cf5a8['name']){delete _0x4cf5a8[_0xcd1e('0x2c')];}_0x54e7d4[_0xcd1e('0x1c')](_0x3f3f66)[_0xcd1e('0x2d')](_0x4cf5a8);};}exports['index']=function(_0x145820,_0x43296b){var _0x1695c2={},_0x84b62b={},_0xed684d={'count':0x0,'rows':[]};var _0xd56450=_[_0xcd1e('0x2e')](db[_0xcd1e('0x2f')][_0xcd1e('0x30')],function(_0x5be771){return{'name':_0x5be771['fieldName'],'type':_0x5be771[_0xcd1e('0x31')][_0xcd1e('0x32')]};});_0x84b62b[_0xcd1e('0x33')]=_[_0xcd1e('0x2e')](_0xd56450,_0xcd1e('0x2c'));_0x84b62b[_0xcd1e('0x34')]=_['keys'](_0x145820[_0xcd1e('0x34')]);_0x84b62b['filters']=_[_0xcd1e('0x35')](_0x84b62b['model'],_0x84b62b[_0xcd1e('0x34')]);_0x1695c2[_0xcd1e('0x36')]=_['intersection'](_0x84b62b['model'],qs[_0xcd1e('0x37')](_0x145820[_0xcd1e('0x34')]['fields']));_0x1695c2[_0xcd1e('0x36')]=_0x1695c2[_0xcd1e('0x36')][_0xcd1e('0x38')]?_0x1695c2[_0xcd1e('0x36')]:_0x84b62b[_0xcd1e('0x33')];if(!_0x145820[_0xcd1e('0x34')]['hasOwnProperty'](_0xcd1e('0x39'))){_0x1695c2[_0xcd1e('0x1f')]=qs['limit'](_0x145820[_0xcd1e('0x34')]['limit']);_0x1695c2[_0xcd1e('0x21')]=qs[_0xcd1e('0x21')](_0x145820[_0xcd1e('0x34')][_0xcd1e('0x21')]);}_0x1695c2['order']=qs[_0xcd1e('0x3a')](_0x145820[_0xcd1e('0x34')]['sort']);_0x1695c2[_0xcd1e('0x3b')]=qs[_0xcd1e('0x3c')](_[_0xcd1e('0x3d')](_0x145820[_0xcd1e('0x34')],_0x84b62b[_0xcd1e('0x3c')]),_0xd56450);if(_0x145820[_0xcd1e('0x34')][_0xcd1e('0x3e')]){_0x1695c2[_0xcd1e('0x3b')]=_[_0xcd1e('0x3f')](_0x1695c2[_0xcd1e('0x3b')],{'$or':_[_0xcd1e('0x2e')](_0xd56450,function(_0x51a101){if(_0x51a101[_0xcd1e('0x31')]!==_0xcd1e('0x40')){var _0xbf271e={};_0xbf271e[_0x51a101[_0xcd1e('0x2c')]]={'$like':'%'+_0x145820['query']['filter']+'%'};return _0xbf271e;}})});}_0x1695c2=_[_0xcd1e('0x3f')]({},_0x1695c2,_0x145820[_0xcd1e('0x41')]);var _0x2dc496={'where':_0x1695c2['where']};return db['JscriptySessionReport'][_0xcd1e('0x20')](_0x2dc496)['then'](function(_0x3b73d0){_0xed684d[_0xcd1e('0x20')]=_0x3b73d0;if(_0x145820[_0xcd1e('0x34')]['includeAll']){_0x1695c2[_0xcd1e('0x42')]=[{'all':!![]}];}return db[_0xcd1e('0x2f')][_0xcd1e('0x43')](_0x1695c2);})[_0xcd1e('0x27')](function(_0x2fc532){_0xed684d['rows']=_0x2fc532;return _0xed684d;})[_0xcd1e('0x27')](respondWithFilteredResult(_0x43296b,_0x1695c2))[_0xcd1e('0x44')](handleError(_0x43296b,null));};exports['show']=function(_0x24c475,_0xd07aa3){var _0x21d497={'raw':!![],'where':{'id':_0x24c475[_0xcd1e('0x45')]['id']}},_0x26ef30={};_0x26ef30[_0xcd1e('0x33')]=_[_0xcd1e('0x46')](db[_0xcd1e('0x2f')][_0xcd1e('0x30')]);_0x26ef30[_0xcd1e('0x34')]=_[_0xcd1e('0x46')](_0x24c475[_0xcd1e('0x34')]);_0x26ef30[_0xcd1e('0x3c')]=_['intersection'](_0x26ef30[_0xcd1e('0x33')],_0x26ef30[_0xcd1e('0x34')]);_0x21d497[_0xcd1e('0x36')]=_['intersection'](_0x26ef30[_0xcd1e('0x33')],qs[_0xcd1e('0x37')](_0x24c475[_0xcd1e('0x34')]['fields']));_0x21d497[_0xcd1e('0x36')]=_0x21d497[_0xcd1e('0x36')]['length']?_0x21d497[_0xcd1e('0x36')]:_0x26ef30['model'];if(_0x24c475[_0xcd1e('0x34')][_0xcd1e('0x47')]){_0x21d497[_0xcd1e('0x42')]=[{'all':!![]}];}_0x21d497=_[_0xcd1e('0x3f')]({},_0x21d497,_0x24c475[_0xcd1e('0x41')]);return db[_0xcd1e('0x2f')][_0xcd1e('0x48')](_0x21d497)[_0xcd1e('0x27')](handleEntityNotFound(_0xd07aa3,null))[_0xcd1e('0x27')](respondWithResult(_0xd07aa3,null))[_0xcd1e('0x44')](handleError(_0xd07aa3,null));};exports[_0xcd1e('0x49')]=function(_0x5be74e,_0x4bfaa5){return db[_0xcd1e('0x2f')]['create'](_0x5be74e[_0xcd1e('0x4a')],{})['then'](respondWithResult(_0x4bfaa5,0xc9))[_0xcd1e('0x44')](handleError(_0x4bfaa5,null));};exports[_0xcd1e('0x26')]=function(_0xd52712,_0xb964b6){if(_0xd52712[_0xcd1e('0x4a')]['id']){delete _0xd52712[_0xcd1e('0x4a')]['id'];}return db[_0xcd1e('0x2f')][_0xcd1e('0x48')]({'where':{'id':_0xd52712[_0xcd1e('0x45')]['id']}})[_0xcd1e('0x27')](handleEntityNotFound(_0xb964b6,null))[_0xcd1e('0x27')](saveUpdates(_0xd52712[_0xcd1e('0x4a')],null))['then'](respondWithResult(_0xb964b6,null))['catch'](handleError(_0xb964b6,null));};exports[_0xcd1e('0x28')]=function(_0x35f8e1,_0x2ab406){return db[_0xcd1e('0x2f')][_0xcd1e('0x48')]({'where':{'id':_0x35f8e1[_0xcd1e('0x45')]['id']}})[_0xcd1e('0x27')](handleEntityNotFound(_0x2ab406,null))['then'](removeEntity(_0x2ab406,null))[_0xcd1e('0x44')](handleError(_0x2ab406,null));};exports[_0xcd1e('0x4b')]=function(_0x5c7eb1,_0x2a4811){return db[_0xcd1e('0x2f')][_0xcd1e('0x4b')]()[_0xcd1e('0x27')](respondWithResult(_0x2a4811,null))[_0xcd1e('0x44')](handleError(_0x2a4811,null));};exports[_0xcd1e('0x4c')]=function(_0x16d0bd,_0x433756,_0x228e61){var _0x413133={'raw':!![],'where':{}};var _0x229b15={};var _0x5f32db={'count':0x0,'rows':[]};return db[_0xcd1e('0x2f')][_0xcd1e('0x4d')]({'where':{'id':_0x16d0bd[_0xcd1e('0x45')]['id']}})[_0xcd1e('0x27')](handleEntityNotFound(_0x433756,null))[_0xcd1e('0x27')](function(_0x1e4f34){if(_0x1e4f34){_0x229b15['model']=_[_0xcd1e('0x46')](db[_0xcd1e('0x4e')][_0xcd1e('0x30')]);_0x229b15[_0xcd1e('0x34')]=_[_0xcd1e('0x46')](_0x16d0bd[_0xcd1e('0x34')]);_0x229b15['filters']=_['intersection'](_0x229b15[_0xcd1e('0x33')],_0x229b15[_0xcd1e('0x34')]);_0x413133['attributes']=_['intersection'](_0x229b15['model'],qs[_0xcd1e('0x37')](_0x16d0bd[_0xcd1e('0x34')][_0xcd1e('0x37')]));_0x413133['attributes']=_0x413133['attributes']['length']?_0x413133['attributes']:_0x229b15[_0xcd1e('0x33')];if(!_0x16d0bd[_0xcd1e('0x34')]['hasOwnProperty'](_0xcd1e('0x39'))){_0x413133[_0xcd1e('0x1f')]=qs[_0xcd1e('0x1f')](_0x16d0bd[_0xcd1e('0x34')][_0xcd1e('0x1f')]);_0x413133[_0xcd1e('0x21')]=qs[_0xcd1e('0x21')](_0x16d0bd[_0xcd1e('0x34')][_0xcd1e('0x21')]);}_0x413133[_0xcd1e('0x4f')]=qs[_0xcd1e('0x3a')](_0x16d0bd[_0xcd1e('0x34')][_0xcd1e('0x3a')]);_0x413133[_0xcd1e('0x3b')]=qs[_0xcd1e('0x3c')](_[_0xcd1e('0x3d')](_0x16d0bd['query'],_0x229b15[_0xcd1e('0x3c')]));_0x413133[_0xcd1e('0x3b')]['SessionId']=_0x1e4f34['id'];if(_0x16d0bd[_0xcd1e('0x34')][_0xcd1e('0x3e')]){_0x413133[_0xcd1e('0x3b')]=_[_0xcd1e('0x3f')](_0x413133[_0xcd1e('0x3b')],{'$or':_[_0xcd1e('0x2e')](_0x413133[_0xcd1e('0x36')],function(_0x28ff2d){var _0x593cb3={};_0x593cb3[_0x28ff2d]={'$like':'%'+_0x16d0bd[_0xcd1e('0x34')][_0xcd1e('0x3e')]+'%'};return _0x593cb3;})});}_0x413133=_[_0xcd1e('0x3f')]({},_0x413133,_0x16d0bd[_0xcd1e('0x41')]);return db[_0xcd1e('0x4e')][_0xcd1e('0x20')]({'where':_0x413133[_0xcd1e('0x3b')]})[_0xcd1e('0x27')](function(_0x1527ac){_0x5f32db[_0xcd1e('0x20')]=_0x1527ac;if(_0x16d0bd[_0xcd1e('0x34')][_0xcd1e('0x47')]){_0x413133[_0xcd1e('0x42')]=[{'all':!![]}];}return db[_0xcd1e('0x4e')]['findAll'](_0x413133);})[_0xcd1e('0x27')](function(_0x365af8){_0x5f32db['rows']=_0x365af8;return _0x5f32db;});}})[_0xcd1e('0x27')](respondWithFilteredResult(_0x433756,_0x413133))[_0xcd1e('0x44')](handleError(_0x433756,null));}; \ No newline at end of file +var _0x0342=['findOne','JscriptyQuestionReport','pick','SessionId','eml-format','zip-dir','fast-json-patch','request-promise','util','path','sox','ejs','fs-extra','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/license/util','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','end','sendStatus','error','stack','name','send','index','map','JscriptySessionReport','rawAttributes','fieldName','key','model','keys','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','create','update','body','catch','destroy','describe'];(function(_0x46d0c9,_0x526bfa){var _0x174506=function(_0x654bc6){while(--_0x654bc6){_0x46d0c9['push'](_0x46d0c9['shift']());}};_0x174506(++_0x526bfa);}(_0x0342,0xeb));var _0x2034=function(_0xa3fadc,_0xd1e16){_0xa3fadc=_0xa3fadc-0x0;var _0x23ecb8=_0x0342[_0xa3fadc];return _0x23ecb8;};'use strict';var emlformat=require(_0x2034('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2034('0x1'));var jsonpatch=require(_0x2034('0x2'));var rp=require(_0x2034('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2034('0x4'));var path=require(_0x2034('0x5'));var sox=require(_0x2034('0x6'));var csv=require('to-csv');var ejs=require(_0x2034('0x7'));var fs=require('fs');var fs_extra=require(_0x2034('0x8'));var _=require('lodash');var squel=require(_0x2034('0x9'));var crypto=require(_0x2034('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2034('0xb'));var Redis=require(_0x2034('0xc'));var authService=require(_0x2034('0xd'));var qs=require(_0x2034('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2034('0xf'));var logger=require('../../config/logger')('api');var utils=require(_0x2034('0x10'));var config=require('../../config/environment');var licenseUtil=require(_0x2034('0x11'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4c44bb,_0x3d578c){_0x3d578c=_0x3d578c||0xcc;return function(_0x20e19e){if(_0x20e19e){return _0x4c44bb['sendStatus'](_0x3d578c);}return _0x4c44bb[_0x2034('0x12')](_0x3d578c)['end']();};}function respondWithResult(_0x368e55,_0x2218e1){_0x2218e1=_0x2218e1||0xc8;return function(_0x3398f6){if(_0x3398f6){return _0x368e55['status'](_0x2218e1)[_0x2034('0x13')](_0x3398f6);}};}function respondWithFilteredResult(_0x5767b0,_0x37f440){return function(_0x25d65c){if(_0x25d65c){var _0x3fb16b=typeof _0x37f440[_0x2034('0x14')]===_0x2034('0x15')&&typeof _0x37f440['limit']==='undefined';var _0x2319c1=_0x25d65c[_0x2034('0x16')];var _0x459d26=_0x3fb16b?0x0:_0x37f440['offset'];var _0xa50f00=_0x3fb16b?_0x25d65c['count']:_0x37f440[_0x2034('0x14')]+_0x37f440[_0x2034('0x17')];var _0x9f1047;if(_0xa50f00>=_0x2319c1){_0xa50f00=_0x2319c1;_0x9f1047=0xc8;}else{_0x9f1047=0xce;}_0x5767b0['status'](_0x9f1047);return _0x5767b0[_0x2034('0x18')](_0x2034('0x19'),_0x459d26+'-'+_0xa50f00+'/'+_0x2319c1)['json'](_0x25d65c);}return null;};}function patchUpdates(_0x1d6761){return function(_0x3cdb2e){try{jsonpatch[_0x2034('0x1a')](_0x3cdb2e,_0x1d6761,!![]);}catch(_0xcdd5c7){return BPromise[_0x2034('0x1b')](_0xcdd5c7);}return _0x3cdb2e[_0x2034('0x1c')]();};}function saveUpdates(_0x46fe8d,_0x4a130){return function(_0x310b05){if(_0x310b05){return _0x310b05['update'](_0x46fe8d)[_0x2034('0x1d')](function(_0xcfae2b){return _0xcfae2b;});}return null;};}function removeEntity(_0x4cf49e,_0x87c80d){return function(_0x58138e){if(_0x58138e){return _0x58138e['destroy']()['then'](function(){_0x4cf49e[_0x2034('0x12')](0xcc)[_0x2034('0x1e')]();});}};}function handleEntityNotFound(_0x5ca171,_0x11e3cb){return function(_0x51d372){if(!_0x51d372){_0x5ca171[_0x2034('0x1f')](0x194);}return _0x51d372;};}function handleError(_0x40569e,_0x22c7da){_0x22c7da=_0x22c7da||0x1f4;return function(_0x420352){logger[_0x2034('0x20')](_0x420352[_0x2034('0x21')]);if(_0x420352[_0x2034('0x22')]){delete _0x420352['name'];}_0x40569e['status'](_0x22c7da)[_0x2034('0x23')](_0x420352);};}exports[_0x2034('0x24')]=function(_0x400189,_0x44741f){var _0x3ea2cb={},_0x572a63={},_0x1c7b7b={'count':0x0,'rows':[]};var _0x13806c=_[_0x2034('0x25')](db[_0x2034('0x26')][_0x2034('0x27')],function(_0x547548){return{'name':_0x547548[_0x2034('0x28')],'type':_0x547548['type'][_0x2034('0x29')]};});_0x572a63[_0x2034('0x2a')]=_[_0x2034('0x25')](_0x13806c,_0x2034('0x22'));_0x572a63['query']=_[_0x2034('0x2b')](_0x400189['query']);_0x572a63['filters']=_[_0x2034('0x2c')](_0x572a63[_0x2034('0x2a')],_0x572a63[_0x2034('0x2d')]);_0x3ea2cb[_0x2034('0x2e')]=_[_0x2034('0x2c')](_0x572a63['model'],qs[_0x2034('0x2f')](_0x400189[_0x2034('0x2d')][_0x2034('0x2f')]));_0x3ea2cb[_0x2034('0x2e')]=_0x3ea2cb[_0x2034('0x2e')][_0x2034('0x30')]?_0x3ea2cb[_0x2034('0x2e')]:_0x572a63[_0x2034('0x2a')];if(!_0x400189[_0x2034('0x2d')][_0x2034('0x31')](_0x2034('0x32'))){_0x3ea2cb['limit']=qs[_0x2034('0x17')](_0x400189[_0x2034('0x2d')]['limit']);_0x3ea2cb[_0x2034('0x14')]=qs[_0x2034('0x14')](_0x400189['query']['offset']);}_0x3ea2cb[_0x2034('0x33')]=qs[_0x2034('0x34')](_0x400189[_0x2034('0x2d')][_0x2034('0x34')]);_0x3ea2cb['where']=qs[_0x2034('0x35')](_['pick'](_0x400189['query'],_0x572a63[_0x2034('0x35')]),_0x13806c);if(_0x400189[_0x2034('0x2d')][_0x2034('0x36')]){_0x3ea2cb[_0x2034('0x37')]=_[_0x2034('0x38')](_0x3ea2cb[_0x2034('0x37')],{'$or':_[_0x2034('0x25')](_0x13806c,function(_0x28c101){if(_0x28c101[_0x2034('0x39')]!==_0x2034('0x3a')){var _0x3d7fc8={};_0x3d7fc8[_0x28c101['name']]={'$like':'%'+_0x400189[_0x2034('0x2d')]['filter']+'%'};return _0x3d7fc8;}})});}_0x3ea2cb=_['merge']({},_0x3ea2cb,_0x400189[_0x2034('0x3b')]);var _0x1f0d17={'where':_0x3ea2cb[_0x2034('0x37')]};return db['JscriptySessionReport'][_0x2034('0x16')](_0x1f0d17)[_0x2034('0x1d')](function(_0x12a8a0){_0x1c7b7b['count']=_0x12a8a0;if(_0x400189['query'][_0x2034('0x3c')]){_0x3ea2cb[_0x2034('0x3d')]=[{'all':!![]}];}return db[_0x2034('0x26')][_0x2034('0x3e')](_0x3ea2cb);})[_0x2034('0x1d')](function(_0x505176){_0x1c7b7b[_0x2034('0x3f')]=_0x505176;return _0x1c7b7b;})['then'](respondWithFilteredResult(_0x44741f,_0x3ea2cb))['catch'](handleError(_0x44741f,null));};exports[_0x2034('0x40')]=function(_0x2a7c13,_0x49cfc5){var _0x55ccc0={'raw':!![],'where':{'id':_0x2a7c13[_0x2034('0x41')]['id']}},_0x15ffd4={};_0x15ffd4[_0x2034('0x2a')]=_[_0x2034('0x2b')](db['JscriptySessionReport'][_0x2034('0x27')]);_0x15ffd4[_0x2034('0x2d')]=_[_0x2034('0x2b')](_0x2a7c13[_0x2034('0x2d')]);_0x15ffd4['filters']=_['intersection'](_0x15ffd4[_0x2034('0x2a')],_0x15ffd4[_0x2034('0x2d')]);_0x55ccc0['attributes']=_[_0x2034('0x2c')](_0x15ffd4['model'],qs[_0x2034('0x2f')](_0x2a7c13['query'][_0x2034('0x2f')]));_0x55ccc0['attributes']=_0x55ccc0['attributes'][_0x2034('0x30')]?_0x55ccc0[_0x2034('0x2e')]:_0x15ffd4[_0x2034('0x2a')];if(_0x2a7c13[_0x2034('0x2d')][_0x2034('0x3c')]){_0x55ccc0[_0x2034('0x3d')]=[{'all':!![]}];}_0x55ccc0=_[_0x2034('0x38')]({},_0x55ccc0,_0x2a7c13['options']);return db['JscriptySessionReport'][_0x2034('0x42')](_0x55ccc0)[_0x2034('0x1d')](handleEntityNotFound(_0x49cfc5,null))[_0x2034('0x1d')](respondWithResult(_0x49cfc5,null))['catch'](handleError(_0x49cfc5,null));};exports[_0x2034('0x43')]=function(_0xf21ef1,_0x55f837){return db[_0x2034('0x26')]['create'](_0xf21ef1['body'],{})[_0x2034('0x1d')](respondWithResult(_0x55f837,0xc9))['catch'](handleError(_0x55f837,null));};exports[_0x2034('0x44')]=function(_0x114ef1,_0x2111e4){if(_0x114ef1[_0x2034('0x45')]['id']){delete _0x114ef1['body']['id'];}return db[_0x2034('0x26')]['find']({'where':{'id':_0x114ef1[_0x2034('0x41')]['id']}})[_0x2034('0x1d')](handleEntityNotFound(_0x2111e4,null))[_0x2034('0x1d')](saveUpdates(_0x114ef1[_0x2034('0x45')],null))[_0x2034('0x1d')](respondWithResult(_0x2111e4,null))[_0x2034('0x46')](handleError(_0x2111e4,null));};exports[_0x2034('0x47')]=function(_0x38a096,_0x374115){return db[_0x2034('0x26')][_0x2034('0x42')]({'where':{'id':_0x38a096[_0x2034('0x41')]['id']}})[_0x2034('0x1d')](handleEntityNotFound(_0x374115,null))[_0x2034('0x1d')](removeEntity(_0x374115,null))['catch'](handleError(_0x374115,null));};exports[_0x2034('0x48')]=function(_0x30ed30,_0x57be21){return db[_0x2034('0x26')][_0x2034('0x48')]()[_0x2034('0x1d')](respondWithResult(_0x57be21,null))[_0x2034('0x46')](handleError(_0x57be21,null));};exports['getQuestions']=function(_0x55ed89,_0x315e09,_0x551600){var _0x20c761={'raw':!![],'where':{}};var _0x309d10={};var _0x19a3ca={'count':0x0,'rows':[]};return db[_0x2034('0x26')][_0x2034('0x49')]({'where':{'id':_0x55ed89[_0x2034('0x41')]['id']}})[_0x2034('0x1d')](handleEntityNotFound(_0x315e09,null))[_0x2034('0x1d')](function(_0x2a1f9d){if(_0x2a1f9d){_0x309d10[_0x2034('0x2a')]=_[_0x2034('0x2b')](db[_0x2034('0x4a')][_0x2034('0x27')]);_0x309d10[_0x2034('0x2d')]=_['keys'](_0x55ed89['query']);_0x309d10[_0x2034('0x35')]=_[_0x2034('0x2c')](_0x309d10[_0x2034('0x2a')],_0x309d10['query']);_0x20c761['attributes']=_[_0x2034('0x2c')](_0x309d10[_0x2034('0x2a')],qs['fields'](_0x55ed89[_0x2034('0x2d')][_0x2034('0x2f')]));_0x20c761['attributes']=_0x20c761[_0x2034('0x2e')][_0x2034('0x30')]?_0x20c761[_0x2034('0x2e')]:_0x309d10[_0x2034('0x2a')];if(!_0x55ed89['query'][_0x2034('0x31')]('nolimit')){_0x20c761[_0x2034('0x17')]=qs[_0x2034('0x17')](_0x55ed89[_0x2034('0x2d')]['limit']);_0x20c761[_0x2034('0x14')]=qs['offset'](_0x55ed89[_0x2034('0x2d')][_0x2034('0x14')]);}_0x20c761[_0x2034('0x33')]=qs[_0x2034('0x34')](_0x55ed89[_0x2034('0x2d')][_0x2034('0x34')]);_0x20c761[_0x2034('0x37')]=qs[_0x2034('0x35')](_[_0x2034('0x4b')](_0x55ed89['query'],_0x309d10['filters']));_0x20c761['where'][_0x2034('0x4c')]=_0x2a1f9d['id'];if(_0x55ed89[_0x2034('0x2d')]['filter']){_0x20c761[_0x2034('0x37')]=_['merge'](_0x20c761['where'],{'$or':_['map'](_0x20c761[_0x2034('0x2e')],function(_0x4170f8){var _0x31fd53={};_0x31fd53[_0x4170f8]={'$like':'%'+_0x55ed89[_0x2034('0x2d')][_0x2034('0x36')]+'%'};return _0x31fd53;})});}_0x20c761=_['merge']({},_0x20c761,_0x55ed89[_0x2034('0x3b')]);return db[_0x2034('0x4a')]['count']({'where':_0x20c761[_0x2034('0x37')]})[_0x2034('0x1d')](function(_0x1894df){_0x19a3ca['count']=_0x1894df;if(_0x55ed89[_0x2034('0x2d')]['includeAll']){_0x20c761[_0x2034('0x3d')]=[{'all':!![]}];}return db[_0x2034('0x4a')][_0x2034('0x3e')](_0x20c761);})['then'](function(_0x1ac943){_0x19a3ca[_0x2034('0x3f')]=_0x1ac943;return _0x19a3ca;});}})[_0x2034('0x1d')](respondWithFilteredResult(_0x315e09,_0x20c761))['catch'](handleError(_0x315e09,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index 4cc7522..acc6bc9 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 _0x9a5a=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport','report_jscripty_sessions','lodash','util'];(function(_0x1b349a,_0x22222c){var _0x5d1f7c=function(_0x368d7c){while(--_0x368d7c){_0x1b349a['push'](_0x1b349a['shift']());}};_0x5d1f7c(++_0x22222c);}(_0x9a5a,0x194));var _0xa9a5=function(_0x309e97,_0x20950e){_0x309e97=_0x309e97-0x0;var _0x844ae=_0x9a5a[_0x309e97];return _0x844ae;};'use strict';var _=require(_0xa9a5('0x0'));var util=require(_0xa9a5('0x1'));var logger=require(_0xa9a5('0x2'))(_0xa9a5('0x3'));var moment=require(_0xa9a5('0x4'));var BPromise=require('bluebird');var rp=require(_0xa9a5('0x5'));var fs=require('fs');var path=require(_0xa9a5('0x6'));var rimraf=require(_0xa9a5('0x7'));var config=require(_0xa9a5('0x8'));var attributes=require(_0xa9a5('0x9'));module[_0xa9a5('0xa')]=function(_0x4a73f4,_0xb0ccd9){return _0x4a73f4[_0xa9a5('0xb')](_0xa9a5('0xc'),attributes,{'tableName':_0xa9a5('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x46ed=['lodash','util','api','moment','bluebird','path','rimraf','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport','report_jscripty_sessions'];(function(_0x18cd5b,_0x10240b){var _0x5eaa52=function(_0x2bccad){while(--_0x2bccad){_0x18cd5b['push'](_0x18cd5b['shift']());}};_0x5eaa52(++_0x10240b);}(_0x46ed,0x168));var _0xd46e=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0x46ed[_0x4ae6ef];return _0x3cbb4e;};'use strict';var _=require(_0xd46e('0x0'));var util=require(_0xd46e('0x1'));var logger=require('../../config/logger')(_0xd46e('0x2'));var moment=require(_0xd46e('0x3'));var BPromise=require(_0xd46e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd46e('0x5'));var rimraf=require(_0xd46e('0x6'));var config=require('../../config/environment');var attributes=require(_0xd46e('0x7'));module[_0xd46e('0x8')]=function(_0x160bcf,_0x25cf78){return _0x160bcf[_0xd46e('0x9')](_0xd46e('0xa'),attributes,{'tableName':_0xd46e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js index 4f77ecb..036f282 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 _0x7880=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x1b0b59,_0x450a89){var _0x5976d8=function(_0x426763){while(--_0x426763){_0x1b0b59['push'](_0x1b0b59['shift']());}};_0x5976d8(++_0x450a89);}(_0x7880,0x1f4));var _0x0788=function(_0x1777e4,_0x38b4f8){_0x1777e4=_0x1777e4-0x0;var _0x21ecac=_0x7880[_0x1777e4];return _0x21ecac;};'use strict';var _=require('lodash');var util=require(_0x0788('0x0'));var moment=require(_0x0788('0x1'));var BPromise=require(_0x0788('0x2'));var rs=require(_0x0788('0x3'));var fs=require('fs');var Redis=require(_0x0788('0x4'));var db=require(_0x0788('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0788('0x6'))(_0x0788('0x7'));var config=require(_0x0788('0x8'));var jayson=require(_0x0788('0x9'));var client=jayson[_0x0788('0xa')][_0x0788('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3f9cb8,_0x44bbb5,_0x3c29f3){return new BPromise(function(_0x422f8b,_0x55e48a){return client[_0x0788('0xc')](_0x3f9cb8,_0x3c29f3)['then'](function(_0xabaf81){logger['info'](_0x0788('0xd'),_0x44bbb5,_0x0788('0xe'));logger[_0x0788('0xf')](_0x0788('0x10'),_0x44bbb5,_0x0788('0xe'),JSON['stringify'](_0xabaf81));if(_0xabaf81[_0x0788('0x11')]){if(_0xabaf81[_0x0788('0x11')][_0x0788('0x12')]===0x1f4){logger[_0x0788('0x11')](_0x0788('0xd'),_0x44bbb5,_0xabaf81[_0x0788('0x11')][_0x0788('0x13')]);return _0x55e48a(_0xabaf81['error'][_0x0788('0x13')]);}logger[_0x0788('0x11')](_0x0788('0xd'),_0x44bbb5,_0xabaf81[_0x0788('0x11')]['message']);return _0x422f8b(_0xabaf81[_0x0788('0x11')]['message']);}else{logger[_0x0788('0x14')](_0x0788('0xd'),_0x44bbb5,_0x0788('0xe'));_0x422f8b(_0xabaf81[_0x0788('0x15')][_0x0788('0x13')]);}})[_0x0788('0x16')](function(_0x5e1a29){logger['error'](_0x0788('0xd'),_0x44bbb5,_0x5e1a29);_0x55e48a(_0x5e1a29);});});} \ No newline at end of file +var _0x6d38=['request','then','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x11220d,_0x3bf46d){var _0x5aa93f=function(_0xd921ba){while(--_0xd921ba){_0x11220d['push'](_0x11220d['shift']());}};_0x5aa93f(++_0x3bf46d);}(_0x6d38,0x1ef));var _0x86d3=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x6d38[_0x138adb];return _0x1b27f2;};'use strict';var _=require('lodash');var util=require(_0x86d3('0x0'));var moment=require(_0x86d3('0x1'));var BPromise=require(_0x86d3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x86d3('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x86d3('0x4'))(_0x86d3('0x5'));var config=require(_0x86d3('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x86d3('0x7')][_0x86d3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x33d4aa,_0x2eaa15,_0x47e654){return new BPromise(function(_0x552b07,_0x2aea31){return client[_0x86d3('0x9')](_0x33d4aa,_0x47e654)[_0x86d3('0xa')](function(_0x499640){logger['info'](_0x86d3('0xb'),_0x2eaa15,_0x86d3('0xc'));logger['debug']('JscriptySessionReport,\x20%s,\x20%s,\x20%s',_0x2eaa15,_0x86d3('0xc'),JSON[_0x86d3('0xd')](_0x499640));if(_0x499640['error']){if(_0x499640[_0x86d3('0xe')]['code']===0x1f4){logger[_0x86d3('0xe')](_0x86d3('0xb'),_0x2eaa15,_0x499640[_0x86d3('0xe')][_0x86d3('0xf')]);return _0x2aea31(_0x499640[_0x86d3('0xe')][_0x86d3('0xf')]);}logger[_0x86d3('0xe')](_0x86d3('0xb'),_0x2eaa15,_0x499640['error'][_0x86d3('0xf')]);return _0x552b07(_0x499640[_0x86d3('0xe')][_0x86d3('0xf')]);}else{logger[_0x86d3('0x10')](_0x86d3('0xb'),_0x2eaa15,_0x86d3('0xc'));_0x552b07(_0x499640[_0x86d3('0x11')][_0x86d3('0xf')]);}})['catch'](function(_0x2d5ba9){logger[_0x86d3('0xe')](_0x86d3('0xb'),_0x2eaa15,_0x2d5ba9);_0x2aea31(_0x2d5ba9);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index d94c4f0..5f26d40 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 _0xeff8=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./license.controller','index','put','/:id','isAuthenticated','exports','multer','util'];(function(_0x21125f,_0x8079f8){var _0x2f421d=function(_0x231299){while(--_0x231299){_0x21125f['push'](_0x21125f['shift']());}};_0x2f421d(++_0x8079f8);}(_0xeff8,0x186));var _0x8eff=function(_0x1ae5ab,_0xc5d441){_0x1ae5ab=_0x1ae5ab-0x0;var _0x1ce001=_0xeff8[_0x1ae5ab];return _0x1ce001;};'use strict';var multer=require(_0x8eff('0x0'));var util=require(_0x8eff('0x1'));var path=require('path');var timeout=require(_0x8eff('0x2'));var express=require(_0x8eff('0x3'));var router=express[_0x8eff('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8eff('0x5'));var interaction=require(_0x8eff('0x6'));var config=require(_0x8eff('0x7'));var controller=require(_0x8eff('0x8'));router['get']('/',controller[_0x8eff('0x9')]);router[_0x8eff('0xa')](_0x8eff('0xb'),auth[_0x8eff('0xc')](),controller['update']);module[_0x8eff('0xd')]=router; \ No newline at end of file +var _0xbe2a=['../../components/interaction/service','./license.controller','get','index','put','/:id','isAuthenticated','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x300c5c,_0x376652){var _0x20d6f1=function(_0x2df0a8){while(--_0x2df0a8){_0x300c5c['push'](_0x300c5c['shift']());}};_0x20d6f1(++_0x376652);}(_0xbe2a,0x1d9));var _0xabe2=function(_0xf9ab09,_0x30399b){_0xf9ab09=_0xf9ab09-0x0;var _0x4de194=_0xbe2a[_0xf9ab09];return _0x4de194;};'use strict';var multer=require(_0xabe2('0x0'));var util=require(_0xabe2('0x1'));var path=require(_0xabe2('0x2'));var timeout=require(_0xabe2('0x3'));var express=require(_0xabe2('0x4'));var router=express[_0xabe2('0x5')]();var fs_extra=require(_0xabe2('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xabe2('0x7'));var config=require('../../config/environment');var controller=require(_0xabe2('0x8'));router[_0xabe2('0x9')]('/',controller[_0xabe2('0xa')]);router[_0xabe2('0xb')](_0xabe2('0xc'),auth[_0xabe2('0xd')](),controller['update']);module[_0xabe2('0xe')]=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index 56aee52..dcce7c3 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 _0xe0ce=['sequelize','TEXT','STRING'];(function(_0x32d34c,_0x9ad668){var _0x114e4b=function(_0x1bcd91){while(--_0x1bcd91){_0x32d34c['push'](_0x32d34c['shift']());}};_0x114e4b(++_0x9ad668);}(_0xe0ce,0x15c));var _0xee0c=function(_0x4e25eb,_0x350892){_0x4e25eb=_0x4e25eb-0x0;var _0x4d34ca=_0xe0ce[_0x4e25eb];return _0x4d34ca;};'use strict';var Sequelize=require(_0xee0c('0x0'));module['exports']={'license':{'type':Sequelize[_0xee0c('0x1')]},'data1':{'type':Sequelize[_0xee0c('0x2')]},'data2':{'type':Sequelize[_0xee0c('0x2')]},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xd24e=['TEXT','sequelize','exports'];(function(_0x4f74b8,_0x10a380){var _0x208b6b=function(_0x1e6d6d){while(--_0x1e6d6d){_0x4f74b8['push'](_0x4f74b8['shift']());}};_0x208b6b(++_0x10a380);}(_0xd24e,0x1a8));var _0xed24=function(_0x500221,_0x51d38b){_0x500221=_0x500221-0x0;var _0x7bd6f=_0xd24e[_0x500221];return _0x7bd6f;};'use strict';var Sequelize=require(_0xed24('0x0'));module[_0xed24('0x1')]={'license':{'type':Sequelize[_0xed24('0x2')]},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize['STRING']},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/license/license.controller.js b/server/api/license/license.controller.js index 8bd6b6e..4277d9f 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 _0x4975=['name','index','model','query','keys','intersection','fields','attributes','length','options','getLicense','catch','body','License','find','params','get','key','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','save','update','then','destroy','error','stack'];(function(_0x2dc1a8,_0x87f3c4){var _0x4ba310=function(_0x22fec7){while(--_0x22fec7){_0x2dc1a8['push'](_0x2dc1a8['shift']());}};_0x4ba310(++_0x87f3c4);}(_0x4975,0x86));var _0x5497=function(_0x2d407a,_0x56b7ea){_0x2d407a=_0x2d407a-0x0;var _0x28e9c3=_0x4975[_0x2d407a];return _0x28e9c3;};'use strict';var emlformat=require(_0x5497('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5497('0x1'));var jsonpatch=require(_0x5497('0x2'));var rp=require(_0x5497('0x3'));var moment=require(_0x5497('0x4'));var BPromise=require(_0x5497('0x5'));var Mustache=require(_0x5497('0x6'));var util=require(_0x5497('0x7'));var path=require(_0x5497('0x8'));var sox=require(_0x5497('0x9'));var csv=require(_0x5497('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5497('0xb'));var _=require('lodash');var squel=require(_0x5497('0xc'));var crypto=require(_0x5497('0xd'));var jsforce=require(_0x5497('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5497('0xa'));var querystring=require('querystring');var Papa=require(_0x5497('0xf'));var Redis=require(_0x5497('0x10'));var authService=require(_0x5497('0x11'));var qs=require(_0x5497('0x12'));var as=require(_0x5497('0x13'));var hardwareService=require(_0x5497('0x14'));var logger=require(_0x5497('0x15'))(_0x5497('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5497('0x17'))['db'];function respondWithStatusCode(_0x1b23df,_0x1bb794){_0x1bb794=_0x1bb794||0xcc;return function(_0x984990){if(_0x984990){return _0x1b23df[_0x5497('0x18')](_0x1bb794);}return _0x1b23df[_0x5497('0x19')](_0x1bb794)[_0x5497('0x1a')]();};}function respondWithResult(_0xaca97d,_0x363a5b){_0x363a5b=_0x363a5b||0xc8;return function(_0x1a4c74){if(_0x1a4c74){return _0xaca97d['status'](_0x363a5b)[_0x5497('0x1b')](_0x1a4c74);}};}function respondWithFilteredResult(_0x4fb8e9,_0x4237a9){return function(_0x2bfd8a){if(_0x2bfd8a){var _0x19e5f3=typeof _0x4237a9[_0x5497('0x1c')]===_0x5497('0x1d')&&typeof _0x4237a9[_0x5497('0x1e')]===_0x5497('0x1d');var _0x575f6b=_0x2bfd8a['count'];var _0x3f4d20=_0x19e5f3?0x0:_0x4237a9[_0x5497('0x1c')];var _0x3a47fd=_0x19e5f3?_0x2bfd8a['count']:_0x4237a9[_0x5497('0x1c')]+_0x4237a9[_0x5497('0x1e')];var _0x18e8a8;if(_0x3a47fd>=_0x575f6b){_0x3a47fd=_0x575f6b;_0x18e8a8=0xc8;}else{_0x18e8a8=0xce;}_0x4fb8e9[_0x5497('0x19')](_0x18e8a8);return _0x4fb8e9[_0x5497('0x1f')](_0x5497('0x20'),_0x3f4d20+'-'+_0x3a47fd+'/'+_0x575f6b)[_0x5497('0x1b')](_0x2bfd8a);}return null;};}function patchUpdates(_0x10226f){return function(_0x2e3960){try{jsonpatch[_0x5497('0x21')](_0x2e3960,_0x10226f,!![]);}catch(_0x186065){return BPromise['reject'](_0x186065);}return _0x2e3960[_0x5497('0x22')]();};}function saveUpdates(_0x4d1b27,_0x19200a){return function(_0xd0868d){if(_0xd0868d){return _0xd0868d[_0x5497('0x23')](_0x4d1b27)[_0x5497('0x24')](function(_0x35ecd9){return _0x35ecd9;});}return null;};}function removeEntity(_0x3b2fbc,_0x5018fa){return function(_0x54043a){if(_0x54043a){return _0x54043a[_0x5497('0x25')]()[_0x5497('0x24')](function(){_0x3b2fbc[_0x5497('0x19')](0xcc)[_0x5497('0x1a')]();});}};}function handleEntityNotFound(_0x5223b5,_0x13b7a4){return function(_0x57268c){if(!_0x57268c){_0x5223b5[_0x5497('0x18')](0x194);}return _0x57268c;};}function handleError(_0x16a2b4,_0x429d36){_0x429d36=_0x429d36||0x1f4;return function(_0x34a1a5){logger[_0x5497('0x26')](_0x34a1a5[_0x5497('0x27')]);if(_0x34a1a5['name']){delete _0x34a1a5[_0x5497('0x28')];}_0x16a2b4['status'](_0x429d36)['send'](_0x34a1a5);};}var utilLicense=require('../../config/license/util');exports[_0x5497('0x29')]=function(_0x48d146,_0x5e9356){var _0xc3465={'raw':!![],'where':{'id':0x1}},_0xb14593={};_0xb14593[_0x5497('0x2a')]=_['keys'](db['License']['rawAttributes']);_0xb14593[_0x5497('0x2b')]=_[_0x5497('0x2c')](_0x48d146[_0x5497('0x2b')]);_0xb14593['filters']=_['intersection'](_0xb14593['model'],_0xb14593[_0x5497('0x2b')]);_0xc3465['attributes']=_[_0x5497('0x2d')](_0xb14593[_0x5497('0x2a')],qs[_0x5497('0x2e')](_0x48d146['query'][_0x5497('0x2e')]));_0xc3465[_0x5497('0x2f')]=_0xc3465['attributes'][_0x5497('0x30')]?_0xc3465[_0x5497('0x2f')]:_0xb14593[_0x5497('0x2a')];_0xc3465=_['merge']({},_0xc3465,_0x48d146[_0x5497('0x31')]);return utilLicense[_0x5497('0x32')](_0xc3465)[_0x5497('0x24')](respondWithResult(_0x5e9356,null))[_0x5497('0x33')](handleError(_0x5e9356,null));};exports[_0x5497('0x23')]=function(_0x4a6459,_0x386845){if(_0x4a6459[_0x5497('0x34')]['id']){delete _0x4a6459['body']['id'];}return db[_0x5497('0x35')][_0x5497('0x36')]({'where':{'id':_0x4a6459[_0x5497('0x37')]['id']}})[_0x5497('0x24')](handleEntityNotFound(_0x386845,null))[_0x5497('0x24')](function(_0x37011c){var _0x580e86=_0x37011c[_0x5497('0x38')]({'plain':!![]});return utilLicense['checkLicense'](_0x580e86,_0x4a6459[_0x5497('0x34')][_0x5497('0x39')]);})[_0x5497('0x24')](function(_0x5ab18c){if(!_0x5ab18c['demo']){return saveUpdates(_0x4a6459[_0x5497('0x34')],null);}return _0x5ab18c;})[_0x5497('0x24')](respondWithResult(_0x386845,null))[_0x5497('0x33')](handleError(_0x386845,null));}; \ No newline at end of file +var _0x4975=['name','index','model','query','keys','intersection','fields','attributes','length','options','getLicense','catch','body','License','find','params','get','key','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','save','update','then','destroy','error','stack'];(function(_0x261c59,_0x4cc696){var _0x3f4b42=function(_0x25f7fe){while(--_0x25f7fe){_0x261c59['push'](_0x261c59['shift']());}};_0x3f4b42(++_0x4cc696);}(_0x4975,0x86));var _0x5497=function(_0x512f55,_0x59a299){_0x512f55=_0x512f55-0x0;var _0x124703=_0x4975[_0x512f55];return _0x124703;};'use strict';var emlformat=require(_0x5497('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5497('0x1'));var jsonpatch=require(_0x5497('0x2'));var rp=require(_0x5497('0x3'));var moment=require(_0x5497('0x4'));var BPromise=require(_0x5497('0x5'));var Mustache=require(_0x5497('0x6'));var util=require(_0x5497('0x7'));var path=require(_0x5497('0x8'));var sox=require(_0x5497('0x9'));var csv=require(_0x5497('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5497('0xb'));var _=require('lodash');var squel=require(_0x5497('0xc'));var crypto=require(_0x5497('0xd'));var jsforce=require(_0x5497('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5497('0xa'));var querystring=require('querystring');var Papa=require(_0x5497('0xf'));var Redis=require(_0x5497('0x10'));var authService=require(_0x5497('0x11'));var qs=require(_0x5497('0x12'));var as=require(_0x5497('0x13'));var hardwareService=require(_0x5497('0x14'));var logger=require(_0x5497('0x15'))(_0x5497('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5497('0x17'))['db'];function respondWithStatusCode(_0x1b23df,_0x1bb794){_0x1bb794=_0x1bb794||0xcc;return function(_0x984990){if(_0x984990){return _0x1b23df[_0x5497('0x18')](_0x1bb794);}return _0x1b23df[_0x5497('0x19')](_0x1bb794)[_0x5497('0x1a')]();};}function respondWithResult(_0xaca97d,_0x363a5b){_0x363a5b=_0x363a5b||0xc8;return function(_0x1a4c74){if(_0x1a4c74){return _0xaca97d['status'](_0x363a5b)[_0x5497('0x1b')](_0x1a4c74);}};}function respondWithFilteredResult(_0x4fb8e9,_0x4237a9){return function(_0x2bfd8a){if(_0x2bfd8a){var _0x19e5f3=typeof _0x4237a9[_0x5497('0x1c')]===_0x5497('0x1d')&&typeof _0x4237a9[_0x5497('0x1e')]===_0x5497('0x1d');var _0x575f6b=_0x2bfd8a['count'];var _0x3f4d20=_0x19e5f3?0x0:_0x4237a9[_0x5497('0x1c')];var _0x3a47fd=_0x19e5f3?_0x2bfd8a['count']:_0x4237a9[_0x5497('0x1c')]+_0x4237a9[_0x5497('0x1e')];var _0x18e8a8;if(_0x3a47fd>=_0x575f6b){_0x3a47fd=_0x575f6b;_0x18e8a8=0xc8;}else{_0x18e8a8=0xce;}_0x4fb8e9[_0x5497('0x19')](_0x18e8a8);return _0x4fb8e9[_0x5497('0x1f')](_0x5497('0x20'),_0x3f4d20+'-'+_0x3a47fd+'/'+_0x575f6b)[_0x5497('0x1b')](_0x2bfd8a);}return null;};}function patchUpdates(_0x10226f){return function(_0x2e3960){try{jsonpatch[_0x5497('0x21')](_0x2e3960,_0x10226f,!![]);}catch(_0x186065){return BPromise['reject'](_0x186065);}return _0x2e3960[_0x5497('0x22')]();};}function saveUpdates(_0x4d1b27,_0x19200a){return function(_0xd0868d){if(_0xd0868d){return _0xd0868d[_0x5497('0x23')](_0x4d1b27)[_0x5497('0x24')](function(_0x35ecd9){return _0x35ecd9;});}return null;};}function removeEntity(_0x3b2fbc,_0x5018fa){return function(_0x54043a){if(_0x54043a){return _0x54043a[_0x5497('0x25')]()[_0x5497('0x24')](function(){_0x3b2fbc[_0x5497('0x19')](0xcc)[_0x5497('0x1a')]();});}};}function handleEntityNotFound(_0x5223b5,_0x13b7a4){return function(_0x57268c){if(!_0x57268c){_0x5223b5[_0x5497('0x18')](0x194);}return _0x57268c;};}function handleError(_0x16a2b4,_0x429d36){_0x429d36=_0x429d36||0x1f4;return function(_0x34a1a5){logger[_0x5497('0x26')](_0x34a1a5[_0x5497('0x27')]);if(_0x34a1a5['name']){delete _0x34a1a5[_0x5497('0x28')];}_0x16a2b4['status'](_0x429d36)['send'](_0x34a1a5);};}var utilLicense=require('../../config/license/util');exports[_0x5497('0x29')]=function(_0x48d146,_0x5e9356){var _0xc3465={'raw':!![],'where':{'id':0x1}},_0xb14593={};_0xb14593[_0x5497('0x2a')]=_['keys'](db['License']['rawAttributes']);_0xb14593[_0x5497('0x2b')]=_[_0x5497('0x2c')](_0x48d146[_0x5497('0x2b')]);_0xb14593['filters']=_['intersection'](_0xb14593['model'],_0xb14593[_0x5497('0x2b')]);_0xc3465['attributes']=_[_0x5497('0x2d')](_0xb14593[_0x5497('0x2a')],qs[_0x5497('0x2e')](_0x48d146['query'][_0x5497('0x2e')]));_0xc3465[_0x5497('0x2f')]=_0xc3465['attributes'][_0x5497('0x30')]?_0xc3465[_0x5497('0x2f')]:_0xb14593[_0x5497('0x2a')];_0xc3465=_['merge']({},_0xc3465,_0x48d146[_0x5497('0x31')]);return utilLicense[_0x5497('0x32')](_0xc3465)[_0x5497('0x24')](respondWithResult(_0x5e9356,null))[_0x5497('0x33')](handleError(_0x5e9356,null));};exports[_0x5497('0x23')]=function(_0x4a6459,_0x386845){if(_0x4a6459[_0x5497('0x34')]['id']){delete _0x4a6459['body']['id'];}return db[_0x5497('0x35')][_0x5497('0x36')]({'where':{'id':_0x4a6459[_0x5497('0x37')]['id']}})[_0x5497('0x24')](handleEntityNotFound(_0x386845,null))[_0x5497('0x24')](function(_0x37011c){var _0x580e86=_0x37011c[_0x5497('0x38')]({'plain':!![]});return utilLicense['checkLicense'](_0x580e86,_0x4a6459[_0x5497('0x34')][_0x5497('0x39')]);})[_0x5497('0x24')](function(_0x5ab18c){if(!_0x5ab18c['demo']){return saveUpdates(_0x4a6459[_0x5497('0x34')],null);}return _0x5ab18c;})[_0x5497('0x24')](respondWithResult(_0x386845,null))[_0x5497('0x33')](handleError(_0x386845,null));}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index 1d8230c..b43b4fc 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 _0x18e5=['License','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./license.attributes','exports','define'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x18e5,0x64));var _0x518e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x18e5[_0x2dafbe];return _0x58a45a;};'use strict';var _=require('lodash');var util=require(_0x518e('0x0'));var logger=require(_0x518e('0x1'))('api');var moment=require(_0x518e('0x2'));var BPromise=require(_0x518e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x518e('0x4'));var rimraf=require(_0x518e('0x5'));var config=require(_0x518e('0x6'));var attributes=require(_0x518e('0x7'));module[_0x518e('0x8')]=function(_0x2a2bfc,_0x330e28){return _0x2a2bfc[_0x518e('0x9')](_0x518e('0xa'),attributes,{'tableName':'license','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xde18=['license','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./license.attributes','define','License'];(function(_0x59a0cf,_0x3616bd){var _0x1f70f4=function(_0x50c132){while(--_0x50c132){_0x59a0cf['push'](_0x59a0cf['shift']());}};_0x1f70f4(++_0x3616bd);}(_0xde18,0x1c9));var _0x8de1=function(_0x5de69d,_0x4c7e96){_0x5de69d=_0x5de69d-0x0;var _0x3cd098=_0xde18[_0x5de69d];return _0x3cd098;};'use strict';var _=require(_0x8de1('0x0'));var util=require(_0x8de1('0x1'));var logger=require(_0x8de1('0x2'))(_0x8de1('0x3'));var moment=require(_0x8de1('0x4'));var BPromise=require(_0x8de1('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x8de1('0x6'));var config=require(_0x8de1('0x7'));var attributes=require(_0x8de1('0x8'));module['exports']=function(_0x396681,_0x31179f){return _0x396681[_0x8de1('0x9')](_0x8de1('0xa'),attributes,{'tableName':_0x8de1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/license/license.rpc.js b/server/api/license/license.rpc.js index 786f0ba..a59624b 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 _0x24de=['code','License,\x20%s,\x20%s','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','License,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2b7ffe,_0x3129be){var _0x1a009a=function(_0x1c0a18){while(--_0x1c0a18){_0x2b7ffe['push'](_0x2b7ffe['shift']());}};_0x1a009a(++_0x3129be);}(_0x24de,0x116));var _0xe24d=function(_0x5cdebc,_0x21810f){_0x5cdebc=_0x5cdebc-0x0;var _0x4c56c7=_0x24de[_0x5cdebc];return _0x4c56c7;};'use strict';var _=require('lodash');var util=require(_0xe24d('0x0'));var moment=require('moment');var BPromise=require(_0xe24d('0x1'));var rs=require(_0xe24d('0x2'));var fs=require('fs');var Redis=require(_0xe24d('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xe24d('0x4'));var logger=require(_0xe24d('0x5'))(_0xe24d('0x6'));var config=require('../../config/environment');var jayson=require(_0xe24d('0x7'));var client=jayson[_0xe24d('0x8')][_0xe24d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4294ca,_0x1d3abd,_0x4b2a0b){return new BPromise(function(_0x10acb0,_0x2caffd){return client[_0xe24d('0xa')](_0x4294ca,_0x4b2a0b)[_0xe24d('0xb')](function(_0x24fe4c){logger[_0xe24d('0xc')]('License,\x20%s,\x20%s',_0x1d3abd,'request\x20sent');logger['debug'](_0xe24d('0xd'),_0x1d3abd,'request\x20sent',JSON[_0xe24d('0xe')](_0x24fe4c));if(_0x24fe4c[_0xe24d('0xf')]){if(_0x24fe4c[_0xe24d('0xf')][_0xe24d('0x10')]===0x1f4){logger[_0xe24d('0xf')](_0xe24d('0x11'),_0x1d3abd,_0x24fe4c[_0xe24d('0xf')][_0xe24d('0x12')]);return _0x2caffd(_0x24fe4c[_0xe24d('0xf')][_0xe24d('0x12')]);}logger[_0xe24d('0xf')](_0xe24d('0x11'),_0x1d3abd,_0x24fe4c[_0xe24d('0xf')]['message']);return _0x10acb0(_0x24fe4c[_0xe24d('0xf')][_0xe24d('0x12')]);}else{logger['info']('License,\x20%s,\x20%s',_0x1d3abd,'request\x20sent');_0x10acb0(_0x24fe4c[_0xe24d('0x13')][_0xe24d('0x12')]);}})[_0xe24d('0x14')](function(_0x4eeecf){logger[_0xe24d('0xf')](_0xe24d('0x11'),_0x1d3abd,_0x4eeecf);_0x2caffd(_0x4eeecf);});});} \ No newline at end of file +var _0xb230=['then','License,\x20%s,\x20%s','request\x20sent','License,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x87e36d,_0x1ba59a){var _0x27e87a=function(_0x159a00){while(--_0x159a00){_0x87e36d['push'](_0x87e36d['shift']());}};_0x27e87a(++_0x1ba59a);}(_0xb230,0x1d5));var _0x0b23=function(_0x163a40,_0x495763){_0x163a40=_0x163a40-0x0;var _0xa7ab3c=_0xb230[_0x163a40];return _0xa7ab3c;};'use strict';var _=require(_0x0b23('0x0'));var util=require(_0x0b23('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0b23('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x0b23('0x3'));var logger=require(_0x0b23('0x4'))(_0x0b23('0x5'));var config=require(_0x0b23('0x6'));var jayson=require(_0x0b23('0x7'));var client=jayson[_0x0b23('0x8')][_0x0b23('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x55022e,_0x40fcd7,_0x22db04){return new BPromise(function(_0x3351aa,_0x2bbec6){return client[_0x0b23('0xa')](_0x55022e,_0x22db04)[_0x0b23('0xb')](function(_0x5c18ee){logger['info'](_0x0b23('0xc'),_0x40fcd7,_0x0b23('0xd'));logger['debug'](_0x0b23('0xe'),_0x40fcd7,_0x0b23('0xd'),JSON['stringify'](_0x5c18ee));if(_0x5c18ee[_0x0b23('0xf')]){if(_0x5c18ee['error'][_0x0b23('0x10')]===0x1f4){logger[_0x0b23('0xf')](_0x0b23('0xc'),_0x40fcd7,_0x5c18ee[_0x0b23('0xf')][_0x0b23('0x11')]);return _0x2bbec6(_0x5c18ee[_0x0b23('0xf')]['message']);}logger[_0x0b23('0xf')]('License,\x20%s,\x20%s',_0x40fcd7,_0x5c18ee[_0x0b23('0xf')][_0x0b23('0x11')]);return _0x3351aa(_0x5c18ee[_0x0b23('0xf')][_0x0b23('0x11')]);}else{logger['info'](_0x0b23('0xc'),_0x40fcd7,_0x0b23('0xd'));_0x3351aa(_0x5c18ee[_0x0b23('0x12')][_0x0b23('0x11')]);}})[_0x0b23('0x13')](function(_0x33e027){logger['error'](_0x0b23('0xc'),_0x40fcd7,_0x33e027);_0x2bbec6(_0x33e027);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 30ccf28..58d0abd 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 _0x77f4=['/:id/send','put','update','delete','removeDispositions','removeAnswers','/:id/in_servers','removeImap','removeSmtp','destroy','removeAgents','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getImap','/:id/out_servers','getSmtp','getApplications','/:id/messages','getMessages','/:id/verify','verifySmtp','/:id/users','post','addDisposition','addImap','addSmtp','/:id/interactions','/:id/applications','addApplications'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x77f4,0x9b));var _0x477f=function(_0x4eddc2,_0x16d25d){_0x4eddc2=_0x4eddc2-0x0;var _0x429ca2=_0x77f4[_0x4eddc2];return _0x429ca2;};'use strict';var multer=require(_0x477f('0x0'));var util=require(_0x477f('0x1'));var path=require(_0x477f('0x2'));var timeout=require(_0x477f('0x3'));var express=require(_0x477f('0x4'));var router=express[_0x477f('0x5')]();var fs_extra=require(_0x477f('0x6'));var auth=require(_0x477f('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x477f('0x8'));var controller=require(_0x477f('0x9'));router[_0x477f('0xa')]('/',auth[_0x477f('0xb')](),controller[_0x477f('0xc')]);router[_0x477f('0xa')](_0x477f('0xd'),auth[_0x477f('0xb')](),controller[_0x477f('0xe')]);router[_0x477f('0xa')](_0x477f('0xf'),auth[_0x477f('0xb')](),controller[_0x477f('0x10')]);router['get'](_0x477f('0x11'),auth['isAuthenticated'](),controller[_0x477f('0x12')]);router[_0x477f('0xa')](_0x477f('0x13'),auth[_0x477f('0xb')](),controller[_0x477f('0x14')]);router['get']('/:id/in_servers',auth['isAuthenticated'](),controller[_0x477f('0x15')]);router[_0x477f('0xa')](_0x477f('0x16'),auth[_0x477f('0xb')](),controller[_0x477f('0x17')]);router['get']('/:id/interactions',auth['isAuthenticated'](),controller['getInteractions']);router['get']('/:id/applications',auth[_0x477f('0xb')](),controller[_0x477f('0x18')]);router[_0x477f('0xa')](_0x477f('0x19'),auth['isAuthenticated'](),controller[_0x477f('0x1a')]);router['get'](_0x477f('0x1b'),auth['isAuthenticated'](),controller[_0x477f('0x1c')]);router['get'](_0x477f('0x1d'),auth[_0x477f('0xb')](),controller['getAgents']);router[_0x477f('0x1e')](_0x477f('0x11'),auth[_0x477f('0xb')](),controller[_0x477f('0x1f')]);router[_0x477f('0x1e')](_0x477f('0x13'),auth[_0x477f('0xb')](),controller['addAnswer']);router['post']('/',auth[_0x477f('0xb')](),controller['create']);router[_0x477f('0x1e')]('/:id/in_servers',auth[_0x477f('0xb')](),controller[_0x477f('0x20')]);router[_0x477f('0x1e')](_0x477f('0x16'),auth[_0x477f('0xb')](),controller[_0x477f('0x21')]);router['post'](_0x477f('0x22'),auth['isAuthenticated'](),controller['addInteraction']);router[_0x477f('0x1e')](_0x477f('0x23'),auth[_0x477f('0xb')](),controller[_0x477f('0x24')]);router[_0x477f('0x1e')](_0x477f('0x25'),auth['isAuthenticated'](),controller['send']);router[_0x477f('0x1e')]('/:id/users',auth[_0x477f('0xb')](),controller['addAgents']);router[_0x477f('0x26')](_0x477f('0xf'),auth[_0x477f('0xb')](),controller[_0x477f('0x27')]);router[_0x477f('0x28')](_0x477f('0x11'),auth[_0x477f('0xb')](),controller[_0x477f('0x29')]);router[_0x477f('0x28')](_0x477f('0x13'),auth[_0x477f('0xb')](),controller[_0x477f('0x2a')]);router[_0x477f('0x28')](_0x477f('0x2b'),auth[_0x477f('0xb')](),controller[_0x477f('0x2c')]);router[_0x477f('0x28')](_0x477f('0x16'),auth['isAuthenticated'](),controller[_0x477f('0x2d')]);router['delete'](_0x477f('0xf'),auth[_0x477f('0xb')](),controller[_0x477f('0x2e')]);router[_0x477f('0x28')](_0x477f('0x1d'),auth['isAuthenticated'](),controller[_0x477f('0x2f')]);module['exports']=router; \ No newline at end of file +var _0xa734=['/describe','isAuthenticated','describe','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','getSmtp','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/verify','verifySmtp','/:id/users','getAgents','post','addDisposition','addAnswer','/:id/out_servers','addSmtp','addInteraction','/:id/send','send','addAgents','put','/:id','update','delete','removeDispositions','removeAnswers','removeImap','destroy','removeAgents','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','get'];(function(_0x1a10b4,_0x460241){var _0x1abeaf=function(_0x402dd7){while(--_0x402dd7){_0x1a10b4['push'](_0x1a10b4['shift']());}};_0x1abeaf(++_0x460241);}(_0xa734,0x1ae));var _0x4a73=function(_0x43fe5a,_0x124bc2){_0x43fe5a=_0x43fe5a-0x0;var _0xc7d660=_0xa734[_0x43fe5a];return _0xc7d660;};'use strict';var multer=require('multer');var util=require(_0x4a73('0x0'));var path=require(_0x4a73('0x1'));var timeout=require(_0x4a73('0x2'));var express=require(_0x4a73('0x3'));var router=express[_0x4a73('0x4')]();var fs_extra=require(_0x4a73('0x5'));var auth=require(_0x4a73('0x6'));var interaction=require(_0x4a73('0x7'));var config=require(_0x4a73('0x8'));var controller=require(_0x4a73('0x9'));router[_0x4a73('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x4a73('0xa')](_0x4a73('0xb'),auth[_0x4a73('0xc')](),controller[_0x4a73('0xd')]);router[_0x4a73('0xa')]('/:id',auth[_0x4a73('0xc')](),controller['show']);router[_0x4a73('0xa')](_0x4a73('0xe'),auth[_0x4a73('0xc')](),controller[_0x4a73('0xf')]);router[_0x4a73('0xa')](_0x4a73('0x10'),auth[_0x4a73('0xc')](),controller[_0x4a73('0x11')]);router[_0x4a73('0xa')](_0x4a73('0x12'),auth[_0x4a73('0xc')](),controller[_0x4a73('0x13')]);router[_0x4a73('0xa')]('/:id/out_servers',auth[_0x4a73('0xc')](),controller[_0x4a73('0x14')]);router[_0x4a73('0xa')](_0x4a73('0x15'),auth[_0x4a73('0xc')](),controller[_0x4a73('0x16')]);router[_0x4a73('0xa')](_0x4a73('0x17'),auth[_0x4a73('0xc')](),controller['getApplications']);router[_0x4a73('0xa')](_0x4a73('0x18'),auth[_0x4a73('0xc')](),controller[_0x4a73('0x19')]);router[_0x4a73('0xa')](_0x4a73('0x1a'),auth[_0x4a73('0xc')](),controller[_0x4a73('0x1b')]);router[_0x4a73('0xa')](_0x4a73('0x1c'),auth['isAuthenticated'](),controller[_0x4a73('0x1d')]);router[_0x4a73('0x1e')](_0x4a73('0xe'),auth[_0x4a73('0xc')](),controller[_0x4a73('0x1f')]);router['post']('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x4a73('0x20')]);router[_0x4a73('0x1e')]('/',auth[_0x4a73('0xc')](),controller['create']);router['post'](_0x4a73('0x12'),auth[_0x4a73('0xc')](),controller['addImap']);router[_0x4a73('0x1e')](_0x4a73('0x21'),auth[_0x4a73('0xc')](),controller[_0x4a73('0x22')]);router[_0x4a73('0x1e')](_0x4a73('0x15'),auth[_0x4a73('0xc')](),controller[_0x4a73('0x23')]);router[_0x4a73('0x1e')](_0x4a73('0x17'),auth[_0x4a73('0xc')](),controller['addApplications']);router[_0x4a73('0x1e')](_0x4a73('0x24'),auth[_0x4a73('0xc')](),controller[_0x4a73('0x25')]);router[_0x4a73('0x1e')](_0x4a73('0x1c'),auth[_0x4a73('0xc')](),controller[_0x4a73('0x26')]);router[_0x4a73('0x27')](_0x4a73('0x28'),auth[_0x4a73('0xc')](),controller[_0x4a73('0x29')]);router[_0x4a73('0x2a')](_0x4a73('0xe'),auth[_0x4a73('0xc')](),controller[_0x4a73('0x2b')]);router[_0x4a73('0x2a')](_0x4a73('0x10'),auth[_0x4a73('0xc')](),controller[_0x4a73('0x2c')]);router[_0x4a73('0x2a')](_0x4a73('0x12'),auth[_0x4a73('0xc')](),controller[_0x4a73('0x2d')]);router[_0x4a73('0x2a')](_0x4a73('0x21'),auth[_0x4a73('0xc')](),controller['removeSmtp']);router['delete'](_0x4a73('0x28'),auth[_0x4a73('0xc')](),controller[_0x4a73('0x2e')]);router['delete'](_0x4a73('0x1c'),auth['isAuthenticated'](),controller[_0x4a73('0x2f')]);module[_0x4a73('0x30')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index 5e5d62b..e847cbd 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 _0xc474=['sequelize','exports','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc474,0xfc));var _0x4c47=function(_0x5f309e,_0x66e31){_0x5f309e=_0x5f309e-0x0;var _0x487b5e=_0xc474[_0x5f309e];return _0x487b5e;};'use strict';var Sequelize=require(_0x4c47('0x0'));module[_0x4c47('0x1')]={'description':{'type':Sequelize[_0x4c47('0x2')]},'name':{'type':Sequelize['STRING'],'allowNull':![]},'service':{'type':Sequelize[_0x4c47('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x4c47('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x4c47('0x3')],'defaultValue':!![]},'key':{'type':Sequelize[_0x4c47('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0x4c47('0x4')]},'markAsUnread':{'type':Sequelize[_0x4c47('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x4c47('0x2')],'allowNull':![],'defaultValue':_0x4c47('0x5')},'fontSize':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x4c47('0x4')],'defaultValue':function(){return _0x4c47('0x6');}},'notificationSound':{'type':Sequelize[_0x4c47('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x4c47('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x4c47('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x4c47('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x4c47('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x4c47('0x7')],'allowNull':!![],'defaultValue':null,'comment':_0x4c47('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x4c47('0x3')],'defaultValue':![],'comment':_0x4c47('0x9'),'set':function(_0x492c49){if(!_0x492c49)this[_0x4c47('0xa')]('mandatoryDispositionPauseId',null);this[_0x4c47('0xa')](_0x4c47('0xb'),_0x492c49);}}}; \ No newline at end of file +var _0xca9e=['STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','exports'];(function(_0x4b7634,_0x12aca7){var _0x236d79=function(_0x5c83ce){while(--_0x5c83ce){_0x4b7634['push'](_0x4b7634['shift']());}};_0x236d79(++_0x12aca7);}(_0xca9e,0x136));var _0xeca9=function(_0x4d979e,_0x52cbd8){_0x4d979e=_0x4d979e-0x0;var _0x40a62a=_0xca9e[_0x4d979e];return _0x40a62a;};'use strict';var Sequelize=require(_0xeca9('0x0'));module[_0xeca9('0x1')]={'description':{'type':Sequelize[_0xeca9('0x2')]},'name':{'type':Sequelize[_0xeca9('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0xeca9('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0xeca9('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0xeca9('0x3')],'defaultValue':!![]},'key':{'type':Sequelize[_0xeca9('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0xeca9('0x4')]},'markAsUnread':{'type':Sequelize[_0xeca9('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0xeca9('0x2')],'allowNull':![],'defaultValue':_0xeca9('0x5')},'fontSize':{'type':Sequelize[_0xeca9('0x6')](0x2)[_0xeca9('0x7')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xeca9('0x8');}},'notificationSound':{'type':Sequelize[_0xeca9('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xeca9('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xeca9('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xeca9('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xeca9('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0xeca9('0x9')},'mandatoryDisposition':{'type':Sequelize[_0xeca9('0x3')],'defaultValue':![],'comment':_0xeca9('0xa'),'set':function(_0x19584d){if(!_0x19584d)this[_0xeca9('0xb')]('mandatoryDispositionPauseId',null);this[_0xeca9('0xb')](_0xeca9('0xc'),_0x19584d);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 37b45a9..7e9fcbb 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 _0x2b3b=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','html-to-text','juice','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','./mailAccount.socket','register','jayson/promise','client','http','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','MailAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','get','UserProfileResource','destroy','stack','name','send','index','MailServerIn','Imap','MailServerOut','Smtp','Pause','mandatoryDispositionPause','MailAccount','rawAttributes','fieldName','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','keys','body','params','describe','addDisposition','find','MailAccountId','create','findOne','Disposition','nolimit','order','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','active','description','isNil','cservice','cauthentication','user','cuser','password','pass','cpassword','authentication','host','port','service','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','MailAccounts','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','omit','getInteractions','MailInteraction','CmContact','Contact','User','Owner','fullname','Tags','tag','addApplications','sequelize','transaction','MailApplication','bulkCreate','findAndCountAll','priority','getApplications','getMessages','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','CmList','Contacts','updatedAt','%s\x20<%s>','email','attachments','join','root','server/files/attachments','auth','secure','SendMail','List\x20not\x20found','List','ListId','from','subject','out','messageId','Interaction','Messages','verifySmtp','VerifySmtp','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','emit','userMailAccount:save','removeAgents','isArray','getAgents'];(function(_0x340823,_0x4e227f){var _0x456812=function(_0x2faa2c){while(--_0x2faa2c){_0x340823['push'](_0x340823['shift']());}};_0x456812(++_0x4e227f);}(_0x2b3b,0xc7));var _0xb2b3=function(_0x34d275,_0x5d84ee){_0x34d275=_0x34d275-0x0;var _0x1379cc=_0x2b3b[_0x34d275];return _0x1379cc;};'use strict';var emlformat=require(_0xb2b3('0x0'));var rimraf=require(_0xb2b3('0x1'));var zipdir=require(_0xb2b3('0x2'));var jsonpatch=require(_0xb2b3('0x3'));var rp=require(_0xb2b3('0x4'));var moment=require(_0xb2b3('0x5'));var BPromise=require(_0xb2b3('0x6'));var Mustache=require(_0xb2b3('0x7'));var util=require('util');var path=require(_0xb2b3('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xb2b3('0x9'));var fs=require('fs');var fs_extra=require(_0xb2b3('0xa'));var _=require(_0xb2b3('0xb'));var squel=require(_0xb2b3('0xc'));var crypto=require(_0xb2b3('0xd'));var jsforce=require(_0xb2b3('0xe'));var deskjs=require(_0xb2b3('0xf'));var toCsv=require(_0xb2b3('0x10'));var querystring=require('querystring');var Papa=require(_0xb2b3('0x11'));var htmlToText=require(_0xb2b3('0x12'));var juice=require(_0xb2b3('0x13'));var Redis=require('ioredis');var authService=require(_0xb2b3('0x14'));var qs=require(_0xb2b3('0x15'));var as=require(_0xb2b3('0x16'));var hardwareService=require(_0xb2b3('0x17'));var logger=require('../../config/logger')(_0xb2b3('0x18'));var utils=require('../../config/utils');var config=require(_0xb2b3('0x19'));var licenseUtil=require(_0xb2b3('0x1a'));var db=require('../../mysqldb')['db'];config[_0xb2b3('0x1b')]=_[_0xb2b3('0x1c')](config[_0xb2b3('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0xb2b3('0x1d'))(new Redis(config[_0xb2b3('0x1b')]));require(_0xb2b3('0x1e'))[_0xb2b3('0x1f')](socket);var jayson=require(_0xb2b3('0x20'));var client=jayson[_0xb2b3('0x21')][_0xb2b3('0x22')]({'port':0x232b});function respondWithRpcPromise(_0x58edeb,_0x57d241,_0x3b232b,_0x3635f9){return new BPromise(function(_0x372e5e,_0x14d061){var _0x491cd1=_0x3635f9||client;return _0x491cd1[_0xb2b3('0x23')](_0x58edeb,_0x3b232b)[_0xb2b3('0x24')](function(_0x220fab){logger[_0xb2b3('0x25')](_0xb2b3('0x26'),_0x57d241,_0xb2b3('0x27'));logger['debug'](_0xb2b3('0x28'),_0x57d241,_0xb2b3('0x27'),JSON['stringify'](_0x220fab));if(_0x220fab[_0xb2b3('0x29')]){if(_0x220fab[_0xb2b3('0x29')][_0xb2b3('0x2a')]===0x1f4){logger[_0xb2b3('0x29')](_0xb2b3('0x26'),_0x57d241,_0x220fab['error']['message']);return _0x14d061(_0x220fab[_0xb2b3('0x29')][_0xb2b3('0x2b')]);}logger[_0xb2b3('0x29')](_0xb2b3('0x26'),_0x57d241,_0x220fab[_0xb2b3('0x29')][_0xb2b3('0x2b')]);return _0x372e5e(_0x220fab[_0xb2b3('0x29')]['message']);}else{logger[_0xb2b3('0x25')](_0xb2b3('0x26'),_0x57d241,_0xb2b3('0x27'));_0x372e5e(_0x220fab[_0xb2b3('0x2c')][_0xb2b3('0x2b')]);}})[_0xb2b3('0x2d')](function(_0x3212c7){logger['error'](_0xb2b3('0x26'),_0x57d241,_0x3212c7);_0x14d061(_0x3212c7);});});}function respondWithStatusCode(_0x563d98,_0x59db19){_0x59db19=_0x59db19||0xcc;return function(_0x316721){if(_0x316721){return _0x563d98[_0xb2b3('0x2e')](_0x59db19);}return _0x563d98[_0xb2b3('0x2f')](_0x59db19)['end']();};}function respondWithResult(_0x4c0030,_0x19f184){_0x19f184=_0x19f184||0xc8;return function(_0x3cd7de){if(_0x3cd7de){return _0x4c0030['status'](_0x19f184)[_0xb2b3('0x30')](_0x3cd7de);}};}function respondWithFilteredResult(_0x88fa79,_0x3faff3){return function(_0x8b0590){if(_0x8b0590){var _0x292739=typeof _0x3faff3[_0xb2b3('0x31')]==='undefined'&&typeof _0x3faff3[_0xb2b3('0x32')]===_0xb2b3('0x33');var _0x32881a=_0x8b0590['count'];var _0x450c91=_0x292739?0x0:_0x3faff3[_0xb2b3('0x31')];var _0x3211a1=_0x292739?_0x8b0590[_0xb2b3('0x34')]:_0x3faff3[_0xb2b3('0x31')]+_0x3faff3[_0xb2b3('0x32')];var _0x5c99f5;if(_0x3211a1>=_0x32881a){_0x3211a1=_0x32881a;_0x5c99f5=0xc8;}else{_0x5c99f5=0xce;}_0x88fa79[_0xb2b3('0x2f')](_0x5c99f5);return _0x88fa79[_0xb2b3('0x35')](_0xb2b3('0x36'),_0x450c91+'-'+_0x3211a1+'/'+_0x32881a)[_0xb2b3('0x30')](_0x8b0590);}return null;};}function patchUpdates(_0x24db5a){return function(_0x27c08b){try{jsonpatch[_0xb2b3('0x37')](_0x27c08b,_0x24db5a,!![]);}catch(_0x4233b1){return BPromise[_0xb2b3('0x38')](_0x4233b1);}return _0x27c08b[_0xb2b3('0x39')]();};}function saveUpdates(_0x16c2d2,_0x19fac5){return function(_0x28908a){if(_0x28908a){return _0x28908a[_0xb2b3('0x3a')](_0x16c2d2)[_0xb2b3('0x24')](function(_0x20a696){return _0x20a696;});}return null;};}function removeEntity(_0x49aa96,_0x3e4feb){return function(_0x2dd69c){if(_0x2dd69c){return _0x2dd69c['destroy']()['then'](function(){var _0x3f3410=_0x2dd69c[_0xb2b3('0x3b')]({'plain':!![]});var _0x22659c='MailAccounts';return db[_0xb2b3('0x3c')][_0xb2b3('0x3d')]({'where':{'type':_0x22659c,'resourceId':_0x3f3410['id']}})[_0xb2b3('0x24')](function(){return _0x2dd69c;});})[_0xb2b3('0x24')](function(){_0x49aa96[_0xb2b3('0x2f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x756909,_0x27f4a8){return function(_0x588d47){if(!_0x588d47){_0x756909[_0xb2b3('0x2e')](0x194);}return _0x588d47;};}function handleError(_0x1db625,_0x2ff0d2){_0x2ff0d2=_0x2ff0d2||0x1f4;return function(_0x1be241){logger[_0xb2b3('0x29')](_0x1be241[_0xb2b3('0x3e')]);if(_0x1be241['name']){delete _0x1be241[_0xb2b3('0x3f')];}_0x1db625[_0xb2b3('0x2f')](_0x2ff0d2)[_0xb2b3('0x40')](_0x1be241);};}exports[_0xb2b3('0x41')]=function(_0x125760,_0x769968){var _0x3137ec={'include':[{'model':db[_0xb2b3('0x42')],'as':_0xb2b3('0x43')},{'model':db[_0xb2b3('0x44')],'as':_0xb2b3('0x45')},{'model':db[_0xb2b3('0x46')],'as':_0xb2b3('0x47')}]},_0xb32c89={},_0x2dd2f0={'count':0x0,'rows':[]};var _0x19cb08=_['map'](db[_0xb2b3('0x48')][_0xb2b3('0x49')],function(_0x243652){return{'name':_0x243652[_0xb2b3('0x4a')],'type':_0x243652['type']['key']};});_0xb32c89[_0xb2b3('0x4b')]=_[_0xb2b3('0x4c')](_0x19cb08,_0xb2b3('0x3f'));_0xb32c89[_0xb2b3('0x4d')]=_['keys'](_0x125760[_0xb2b3('0x4d')]);_0xb32c89[_0xb2b3('0x4e')]=_[_0xb2b3('0x4f')](_0xb32c89['model'],_0xb32c89[_0xb2b3('0x4d')]);_0x3137ec[_0xb2b3('0x50')]=_[_0xb2b3('0x4f')](_0xb32c89[_0xb2b3('0x4b')],qs[_0xb2b3('0x51')](_0x125760[_0xb2b3('0x4d')][_0xb2b3('0x51')]));_0x3137ec[_0xb2b3('0x50')]=_0x3137ec[_0xb2b3('0x50')][_0xb2b3('0x52')]?_0x3137ec[_0xb2b3('0x50')]:_0xb32c89[_0xb2b3('0x4b')];if(!_0x125760[_0xb2b3('0x4d')][_0xb2b3('0x53')]('nolimit')){_0x3137ec['limit']=qs[_0xb2b3('0x32')](_0x125760[_0xb2b3('0x4d')][_0xb2b3('0x32')]);_0x3137ec[_0xb2b3('0x31')]=qs[_0xb2b3('0x31')](_0x125760[_0xb2b3('0x4d')][_0xb2b3('0x31')]);}_0x3137ec['order']=qs[_0xb2b3('0x54')](_0x125760[_0xb2b3('0x4d')]['sort']);_0x3137ec[_0xb2b3('0x55')]=qs[_0xb2b3('0x4e')](_[_0xb2b3('0x56')](_0x125760[_0xb2b3('0x4d')],_0xb32c89[_0xb2b3('0x4e')]),_0x19cb08);if(_0x125760['query'][_0xb2b3('0x57')]){_0x3137ec[_0xb2b3('0x55')]=_[_0xb2b3('0x58')](_0x3137ec[_0xb2b3('0x55')],{'$or':_[_0xb2b3('0x4c')](_0x19cb08,function(_0x18c76e){if(_0x18c76e[_0xb2b3('0x59')]!==_0xb2b3('0x5a')){var _0x193e87={};_0x193e87[_0x18c76e['name']]={'$like':'%'+_0x125760[_0xb2b3('0x4d')][_0xb2b3('0x57')]+'%'};return _0x193e87;}})});}_0x3137ec=_[_0xb2b3('0x58')]({},_0x3137ec,_0x125760[_0xb2b3('0x5b')]);var _0x433c39={'where':_0x3137ec[_0xb2b3('0x55')]};return db[_0xb2b3('0x48')][_0xb2b3('0x34')](_0x433c39)[_0xb2b3('0x24')](function(_0x11eecc){_0x2dd2f0['count']=_0x11eecc;if(_0x125760['query'][_0xb2b3('0x5c')]){_0x3137ec[_0xb2b3('0x5d')]=[{'all':!![]}];}return db[_0xb2b3('0x48')][_0xb2b3('0x5e')](_0x3137ec);})[_0xb2b3('0x24')](function(_0x10046f){_0x2dd2f0[_0xb2b3('0x5f')]=_0x10046f;return _0x2dd2f0;})[_0xb2b3('0x24')](respondWithFilteredResult(_0x769968,_0x3137ec))['catch'](handleError(_0x769968,null));};exports[_0xb2b3('0x60')]=function(_0x541828,_0x58dfbf){var _0xbb702d={'raw':![],'where':{'id':_0x541828['params']['id']},'include':[{'model':db[_0xb2b3('0x42')],'as':_0xb2b3('0x43')},{'model':db['MailServerOut'],'as':_0xb2b3('0x45')},{'model':db[_0xb2b3('0x46')],'as':_0xb2b3('0x47')}]},_0x89022c={};_0x89022c[_0xb2b3('0x4b')]=_[_0xb2b3('0x61')](db['MailAccount'][_0xb2b3('0x49')]);_0x89022c[_0xb2b3('0x4d')]=_[_0xb2b3('0x61')](_0x541828['query']);_0x89022c[_0xb2b3('0x4e')]=_[_0xb2b3('0x4f')](_0x89022c[_0xb2b3('0x4b')],_0x89022c['query']);_0xbb702d[_0xb2b3('0x50')]=_[_0xb2b3('0x4f')](_0x89022c[_0xb2b3('0x4b')],qs[_0xb2b3('0x51')](_0x541828[_0xb2b3('0x4d')][_0xb2b3('0x51')]));_0xbb702d['attributes']=_0xbb702d[_0xb2b3('0x50')][_0xb2b3('0x52')]?_0xbb702d['attributes']:_0x89022c[_0xb2b3('0x4b')];if(_0x541828['query']['includeAll']){_0xbb702d[_0xb2b3('0x5d')]=[{'all':!![]}];}_0xbb702d=_[_0xb2b3('0x58')]({},_0xbb702d,_0x541828[_0xb2b3('0x5b')]);return db[_0xb2b3('0x48')]['find'](_0xbb702d)['then'](handleEntityNotFound(_0x58dfbf,null))['then'](respondWithResult(_0x58dfbf,null))[_0xb2b3('0x2d')](handleError(_0x58dfbf,null));};exports['update']=function(_0x2c3b3f,_0x132338){if(_0x2c3b3f[_0xb2b3('0x62')]['id']){delete _0x2c3b3f[_0xb2b3('0x62')]['id'];}return db[_0xb2b3('0x48')]['find']({'where':{'id':_0x2c3b3f[_0xb2b3('0x63')]['id']},'include':[{'model':db[_0xb2b3('0x42')],'as':_0xb2b3('0x43')},{'model':db[_0xb2b3('0x44')],'as':_0xb2b3('0x45')},{'model':db[_0xb2b3('0x46')],'as':'mandatoryDispositionPause'}]})[_0xb2b3('0x24')](handleEntityNotFound(_0x132338,null))[_0xb2b3('0x24')](saveUpdates(_0x2c3b3f[_0xb2b3('0x62')],null))[_0xb2b3('0x24')](function(_0x178ce4){if(_0x178ce4&&_0x2c3b3f[_0xb2b3('0x62')][_0xb2b3('0x43')]){return db[_0xb2b3('0x42')][_0xb2b3('0x3a')](_0x2c3b3f[_0xb2b3('0x62')][_0xb2b3('0x43')],{'where':{'MailAccountId':_0x178ce4['id']}})['then'](function(){return _0x178ce4;});}return _0x178ce4;})[_0xb2b3('0x24')](function(_0x43bcc0){if(_0x43bcc0&&_0x2c3b3f[_0xb2b3('0x62')][_0xb2b3('0x45')]){return db['MailServerOut'][_0xb2b3('0x3a')](_0x2c3b3f[_0xb2b3('0x62')][_0xb2b3('0x45')],{'where':{'MailAccountId':_0x43bcc0['id']}})[_0xb2b3('0x24')](function(){return _0x43bcc0;});}return _0x43bcc0;})['then'](respondWithResult(_0x132338,null))[_0xb2b3('0x2d')](handleError(_0x132338,null));};exports['describe']=function(_0x55c1e9,_0x3854b9){return db[_0xb2b3('0x48')][_0xb2b3('0x64')]()['then'](respondWithResult(_0x3854b9,null))[_0xb2b3('0x2d')](handleError(_0x3854b9,null));};exports[_0xb2b3('0x65')]=function(_0x5e9176,_0x34b5a8,_0x57c837){if(_0x5e9176[_0xb2b3('0x62')]['id']){delete _0x5e9176[_0xb2b3('0x62')]['id'];}return db[_0xb2b3('0x48')][_0xb2b3('0x66')]({'where':{'id':_0x5e9176['params']['id']}})['then'](handleEntityNotFound(_0x34b5a8,null))[_0xb2b3('0x24')](function(_0x4b8a88){if(_0x4b8a88){_0x5e9176[_0xb2b3('0x62')][_0xb2b3('0x67')]=_0x4b8a88['id'];return db['Disposition'][_0xb2b3('0x68')](_0x5e9176[_0xb2b3('0x62')]);}})[_0xb2b3('0x24')](respondWithResult(_0x34b5a8,null))[_0xb2b3('0x2d')](handleError(_0x34b5a8,null));};exports['getDispositions']=function(_0x386107,_0x1b3e1c,_0x332211){var _0x1fe682={'raw':![],'where':{}};var _0x262e60={};var _0x9f11d0={'count':0x0,'rows':[]};return db[_0xb2b3('0x48')][_0xb2b3('0x69')]({'where':{'id':_0x386107[_0xb2b3('0x63')]['id']}})[_0xb2b3('0x24')](handleEntityNotFound(_0x1b3e1c,null))[_0xb2b3('0x24')](function(_0x14f66e){if(_0x14f66e){_0x262e60['model']=_[_0xb2b3('0x61')](db[_0xb2b3('0x6a')][_0xb2b3('0x49')]);_0x262e60[_0xb2b3('0x4d')]=_[_0xb2b3('0x61')](_0x386107['query']);_0x262e60[_0xb2b3('0x4e')]=_['intersection'](_0x262e60[_0xb2b3('0x4b')],_0x262e60['query']);_0x1fe682[_0xb2b3('0x50')]=_[_0xb2b3('0x4f')](_0x262e60[_0xb2b3('0x4b')],qs[_0xb2b3('0x51')](_0x386107[_0xb2b3('0x4d')][_0xb2b3('0x51')]));_0x1fe682['attributes']=_0x1fe682[_0xb2b3('0x50')][_0xb2b3('0x52')]?_0x1fe682[_0xb2b3('0x50')]:_0x262e60[_0xb2b3('0x4b')];if(!_0x386107[_0xb2b3('0x4d')][_0xb2b3('0x53')](_0xb2b3('0x6b'))){_0x1fe682[_0xb2b3('0x32')]=qs[_0xb2b3('0x32')](_0x386107['query'][_0xb2b3('0x32')]);_0x1fe682[_0xb2b3('0x31')]=qs[_0xb2b3('0x31')](_0x386107[_0xb2b3('0x4d')][_0xb2b3('0x31')]);}_0x1fe682[_0xb2b3('0x6c')]=qs[_0xb2b3('0x54')](_0x386107[_0xb2b3('0x4d')][_0xb2b3('0x54')]);_0x1fe682[_0xb2b3('0x55')]=qs['filters'](_['pick'](_0x386107[_0xb2b3('0x4d')],_0x262e60[_0xb2b3('0x4e')]));_0x1fe682[_0xb2b3('0x55')][_0xb2b3('0x67')]=_0x14f66e['id'];if(_0x386107['query'][_0xb2b3('0x57')]){_0x1fe682[_0xb2b3('0x55')]=_['merge'](_0x1fe682['where'],{'$or':_[_0xb2b3('0x4c')](_0x1fe682[_0xb2b3('0x50')],function(_0x5b5437){var _0x11da49={};_0x11da49[_0x5b5437]={'$like':'%'+_0x386107[_0xb2b3('0x4d')][_0xb2b3('0x57')]+'%'};return _0x11da49;})});}_0x1fe682=_['merge']({},_0x1fe682,_0x386107[_0xb2b3('0x5b')]);return db[_0xb2b3('0x6a')][_0xb2b3('0x34')]({'where':_0x1fe682['where']})[_0xb2b3('0x24')](function(_0x97e531){_0x9f11d0['count']=_0x97e531;if(_0x386107[_0xb2b3('0x4d')][_0xb2b3('0x5c')]){_0x1fe682[_0xb2b3('0x5d')]=[{'all':!![]}];}return db[_0xb2b3('0x6a')][_0xb2b3('0x5e')](_0x1fe682);})[_0xb2b3('0x24')](function(_0x532c24){_0x9f11d0['rows']=_0x532c24;return _0x9f11d0;});}})['then'](respondWithFilteredResult(_0x1b3e1c,_0x1fe682))[_0xb2b3('0x2d')](handleError(_0x1b3e1c,null));};exports[_0xb2b3('0x6d')]=function(_0x3983ae,_0x3091b1,_0x5e46b8){return db[_0xb2b3('0x48')][_0xb2b3('0x66')]({'where':{'id':_0x3983ae[_0xb2b3('0x63')]['id']}})[_0xb2b3('0x24')](handleEntityNotFound(_0x3091b1,null))[_0xb2b3('0x24')](function(_0x465d6e){if(_0x465d6e){return _0x465d6e[_0xb2b3('0x6d')](_0x3983ae['query'][_0xb2b3('0x6e')]);}})[_0xb2b3('0x24')](respondWithStatusCode(_0x3091b1,null))['catch'](handleError(_0x3091b1,null));};exports[_0xb2b3('0x6f')]=function(_0x5f3036,_0x136adb,_0x4459cb){if(_0x5f3036[_0xb2b3('0x62')]['id']){delete _0x5f3036[_0xb2b3('0x62')]['id'];}return db[_0xb2b3('0x48')][_0xb2b3('0x66')]({'where':{'id':_0x5f3036['params']['id']}})['then'](handleEntityNotFound(_0x136adb,null))['then'](function(_0x12c04f){if(_0x12c04f){_0x5f3036['body'][_0xb2b3('0x67')]=_0x12c04f['id'];return db[_0xb2b3('0x70')]['create'](_0x5f3036[_0xb2b3('0x62')]);}})['then'](respondWithResult(_0x136adb,null))[_0xb2b3('0x2d')](handleError(_0x136adb,null));};exports['getAnswers']=function(_0x435feb,_0x24908d,_0x54ccb3){var _0xee29c9={'raw':![],'where':{}};var _0x272ecf={};var _0xf31440={'count':0x0,'rows':[]};return db['MailAccount']['findOne']({'where':{'id':_0x435feb[_0xb2b3('0x63')]['id']}})[_0xb2b3('0x24')](handleEntityNotFound(_0x24908d,null))[_0xb2b3('0x24')](function(_0x476a81){if(_0x476a81){_0x272ecf[_0xb2b3('0x4b')]=_[_0xb2b3('0x61')](db[_0xb2b3('0x70')][_0xb2b3('0x49')]);_0x272ecf[_0xb2b3('0x4d')]=_[_0xb2b3('0x61')](_0x435feb[_0xb2b3('0x4d')]);_0x272ecf[_0xb2b3('0x4e')]=_['intersection'](_0x272ecf['model'],_0x272ecf[_0xb2b3('0x4d')]);_0xee29c9['attributes']=_[_0xb2b3('0x4f')](_0x272ecf[_0xb2b3('0x4b')],qs[_0xb2b3('0x51')](_0x435feb[_0xb2b3('0x4d')][_0xb2b3('0x51')]));_0xee29c9[_0xb2b3('0x50')]=_0xee29c9[_0xb2b3('0x50')]['length']?_0xee29c9[_0xb2b3('0x50')]:_0x272ecf['model'];if(!_0x435feb[_0xb2b3('0x4d')][_0xb2b3('0x53')](_0xb2b3('0x6b'))){_0xee29c9[_0xb2b3('0x32')]=qs['limit'](_0x435feb[_0xb2b3('0x4d')][_0xb2b3('0x32')]);_0xee29c9[_0xb2b3('0x31')]=qs[_0xb2b3('0x31')](_0x435feb[_0xb2b3('0x4d')][_0xb2b3('0x31')]);}_0xee29c9[_0xb2b3('0x6c')]=qs[_0xb2b3('0x54')](_0x435feb['query']['sort']);_0xee29c9[_0xb2b3('0x55')]=qs[_0xb2b3('0x4e')](_[_0xb2b3('0x56')](_0x435feb[_0xb2b3('0x4d')],_0x272ecf[_0xb2b3('0x4e')]));_0xee29c9[_0xb2b3('0x55')][_0xb2b3('0x67')]=_0x476a81['id'];if(_0x435feb[_0xb2b3('0x4d')][_0xb2b3('0x57')]){_0xee29c9[_0xb2b3('0x55')]=_[_0xb2b3('0x58')](_0xee29c9[_0xb2b3('0x55')],{'$or':_[_0xb2b3('0x4c')](_0xee29c9[_0xb2b3('0x50')],function(_0xee308c){var _0x29bca1={};_0x29bca1[_0xee308c]={'$like':'%'+_0x435feb[_0xb2b3('0x4d')]['filter']+'%'};return _0x29bca1;})});}_0xee29c9=_[_0xb2b3('0x58')]({},_0xee29c9,_0x435feb[_0xb2b3('0x5b')]);return db[_0xb2b3('0x70')][_0xb2b3('0x34')]({'where':_0xee29c9[_0xb2b3('0x55')]})[_0xb2b3('0x24')](function(_0x387167){_0xf31440['count']=_0x387167;if(_0x435feb[_0xb2b3('0x4d')]['includeAll']){_0xee29c9[_0xb2b3('0x5d')]=[{'all':!![]}];}return db[_0xb2b3('0x70')][_0xb2b3('0x5e')](_0xee29c9);})['then'](function(_0x15cd74){_0xf31440[_0xb2b3('0x5f')]=_0x15cd74;return _0xf31440;});}})[_0xb2b3('0x24')](respondWithFilteredResult(_0x24908d,_0xee29c9))[_0xb2b3('0x2d')](handleError(_0x24908d,null));};exports[_0xb2b3('0x71')]=function(_0x5abb07,_0x24feda,_0x10a1b2){return db[_0xb2b3('0x48')][_0xb2b3('0x66')]({'where':{'id':_0x5abb07[_0xb2b3('0x63')]['id']}})['then'](handleEntityNotFound(_0x24feda,null))[_0xb2b3('0x24')](function(_0x134eed){if(_0x134eed){return _0x134eed['removeAnswers'](_0x5abb07[_0xb2b3('0x4d')]['ids']);}})['then'](respondWithStatusCode(_0x24feda,null))[_0xb2b3('0x2d')](handleError(_0x24feda,null));};exports['create']=function(_0x10c013,_0x27bbab){var _0x3ab633={'name':_0x10c013['body']['name'],'key':_0x10c013[_0xb2b3('0x62')]['key'],'email':_0x10c013[_0xb2b3('0x62')]['email'],'ListId':_0x10c013[_0xb2b3('0x62')]['ListId'],'active':!_['isNil'](_0x10c013[_0xb2b3('0x62')]['active'])?_0x10c013[_0xb2b3('0x62')][_0xb2b3('0x72')]:!![],'description':_0x10c013[_0xb2b3('0x62')][_0xb2b3('0x73')]||null,'Imap':{},'Smtp':{}};if(_[_0xb2b3('0x74')](_0x10c013[_0xb2b3('0x62')][_0xb2b3('0x75')])){if(_0x10c013[_0xb2b3('0x62')][_0xb2b3('0x76')]){_0x3ab633[_0xb2b3('0x43')]['user']=_0x3ab633[_0xb2b3('0x45')][_0xb2b3('0x77')]=_0x10c013[_0xb2b3('0x62')][_0xb2b3('0x78')];_0x3ab633[_0xb2b3('0x43')][_0xb2b3('0x79')]=_0x3ab633[_0xb2b3('0x45')][_0xb2b3('0x7a')]=_0x10c013[_0xb2b3('0x62')][_0xb2b3('0x7b')];}else{_0x3ab633[_0xb2b3('0x43')][_0xb2b3('0x7c')]=_0x3ab633[_0xb2b3('0x45')][_0xb2b3('0x7c')]=![];}_0x3ab633['Imap'][_0xb2b3('0x7d')]=_0x10c013[_0xb2b3('0x62')]['Imap']['host'];_0x3ab633[_0xb2b3('0x43')][_0xb2b3('0x7e')]=_0x10c013[_0xb2b3('0x62')][_0xb2b3('0x43')][_0xb2b3('0x7e')];_0x3ab633['Smtp'][_0xb2b3('0x7d')]=_0x10c013[_0xb2b3('0x62')]['Smtp']['host'];_0x3ab633['Smtp'][_0xb2b3('0x7e')]=_0x10c013[_0xb2b3('0x62')][_0xb2b3('0x45')][_0xb2b3('0x7e')];}else{_0x3ab633[_0xb2b3('0x43')][_0xb2b3('0x7f')]=_0x3ab633[_0xb2b3('0x45')]['service']=_0x10c013[_0xb2b3('0x62')]['cservice'];_0x3ab633[_0xb2b3('0x43')][_0xb2b3('0x77')]=_0x3ab633[_0xb2b3('0x45')][_0xb2b3('0x77')]=_0x10c013[_0xb2b3('0x62')][_0xb2b3('0x78')];_0x3ab633[_0xb2b3('0x43')][_0xb2b3('0x79')]=_0x3ab633['Smtp'][_0xb2b3('0x7a')]=_0x10c013['body']['cpassword'];}return db['MailAccount'][_0xb2b3('0x68')](_0x3ab633,{'include':[{'model':db[_0xb2b3('0x44')],'as':_0xb2b3('0x45')},{'model':db[_0xb2b3('0x42')],'as':_0xb2b3('0x43')}]})[_0xb2b3('0x24')](function(_0x137009){var _0x1d65d5=_0x10c013['user']['get']({'plain':!![]});if(!_0x1d65d5)throw new Error(_0xb2b3('0x80'));if(_0x1d65d5[_0xb2b3('0x81')]===_0xb2b3('0x77')){var _0x179ae0=_0x137009[_0xb2b3('0x3b')]({'plain':!![]});return db[_0xb2b3('0x82')][_0xb2b3('0x66')]({'where':{'name':_0xb2b3('0x83'),'userProfileId':_0x1d65d5[_0xb2b3('0x84')]},'raw':!![]})[_0xb2b3('0x24')](function(_0x5dcb95){if(_0x5dcb95&&_0x5dcb95['autoAssociation']===0x0){return db['UserProfileResource'][_0xb2b3('0x68')]({'name':_0x179ae0[_0xb2b3('0x3f')],'resourceId':_0x179ae0['id'],'type':_0x5dcb95['name'],'sectionId':_0x5dcb95['id']},{})[_0xb2b3('0x24')](function(){return _0x137009;});}else{return _0x137009;}})[_0xb2b3('0x2d')](function(_0x42177b){logger[_0xb2b3('0x29')](_0xb2b3('0x85'),_0x42177b);throw _0x42177b;});}return _0x137009;})[_0xb2b3('0x24')](respondWithResult(_0x27bbab,0xc9))[_0xb2b3('0x2d')](handleError(_0x27bbab,null));};exports[_0xb2b3('0x86')]=function(_0x9ce9fb,_0xfe9e16,_0x21dcc6){return db[_0xb2b3('0x48')][_0xb2b3('0x69')]({'where':{'id':_0x9ce9fb[_0xb2b3('0x63')]['id']}})[_0xb2b3('0x24')](handleEntityNotFound(_0xfe9e16,null))[_0xb2b3('0x24')](function(_0x44289d){if(_0x44289d){return _0x44289d[_0xb2b3('0x86')]();}return null;})[_0xb2b3('0x24')](respondWithResult(_0xfe9e16,null))[_0xb2b3('0x2d')](handleError(_0xfe9e16,null));};exports[_0xb2b3('0x87')]=function(_0xc2a823,_0x96f363,_0x3106a3){if(_0xc2a823['body']['id']){delete _0xc2a823[_0xb2b3('0x62')]['id'];}return db[_0xb2b3('0x48')][_0xb2b3('0x66')]({'where':{'id':_0xc2a823[_0xb2b3('0x63')]['id']}})[_0xb2b3('0x24')](handleEntityNotFound(_0x96f363,null))[_0xb2b3('0x24')](function(_0x360000){if(_0x360000){_0xc2a823[_0xb2b3('0x62')][_0xb2b3('0x67')]=_0x360000['id'];return db[_0xb2b3('0x42')]['create'](_0xc2a823[_0xb2b3('0x62')]);}})[_0xb2b3('0x24')](respondWithResult(_0x96f363,null))['catch'](handleError(_0x96f363,null));};exports[_0xb2b3('0x88')]=function(_0x1bfb37,_0x50c24e,_0x1e6233){return db[_0xb2b3('0x48')]['findOne']({'where':{'id':_0x1bfb37[_0xb2b3('0x63')]['id']}})[_0xb2b3('0x24')](handleEntityNotFound(_0x50c24e,null))['then'](function(_0x2f8aa0){if(_0x2f8aa0){return _0x2f8aa0[_0xb2b3('0x89')](null);}return null;})['then'](respondWithStatusCode(_0x50c24e,null))[_0xb2b3('0x2d')](handleError(_0x50c24e,null));};exports[_0xb2b3('0x8a')]=function(_0x1ed8e7,_0x48fe3c,_0x330c87){return db['MailAccount']['findOne']({'where':{'id':_0x1ed8e7['params']['id']}})[_0xb2b3('0x24')](handleEntityNotFound(_0x48fe3c,null))[_0xb2b3('0x24')](function(_0x23e773){if(_0x23e773){return _0x23e773[_0xb2b3('0x8a')]();}return null;})[_0xb2b3('0x24')](respondWithResult(_0x48fe3c,null))[_0xb2b3('0x2d')](handleError(_0x48fe3c,null));};exports[_0xb2b3('0x8b')]=function(_0x2ec77c,_0x3b8ffa,_0x1e9e63){if(_0x2ec77c[_0xb2b3('0x62')]['id']){delete _0x2ec77c[_0xb2b3('0x62')]['id'];}return db[_0xb2b3('0x48')][_0xb2b3('0x66')]({'where':{'id':_0x2ec77c['params']['id']}})[_0xb2b3('0x24')](handleEntityNotFound(_0x3b8ffa,null))['then'](function(_0x3b1fea){if(_0x3b1fea){_0x2ec77c[_0xb2b3('0x62')][_0xb2b3('0x67')]=_0x3b1fea['id'];return db[_0xb2b3('0x44')][_0xb2b3('0x68')](_0x2ec77c[_0xb2b3('0x62')]);}})[_0xb2b3('0x24')](respondWithResult(_0x3b8ffa,null))[_0xb2b3('0x2d')](handleError(_0x3b8ffa,null));};exports[_0xb2b3('0x8c')]=function(_0x329813,_0x497836,_0x855f7b){return db[_0xb2b3('0x48')][_0xb2b3('0x69')]({'where':{'id':_0x329813[_0xb2b3('0x63')]['id']}})['then'](handleEntityNotFound(_0x497836,null))[_0xb2b3('0x24')](function(_0xec9659){if(_0xec9659){return _0xec9659[_0xb2b3('0x8d')](null);}return null;})['then'](respondWithStatusCode(_0x497836,null))[_0xb2b3('0x2d')](handleError(_0x497836,null));};exports[_0xb2b3('0x8e')]=function(_0x16404b,_0x141796,_0x4d7348){return db['MailInteraction'][_0xb2b3('0x66')]({'where':{'id':_0x16404b[_0xb2b3('0x63')]['id']}})[_0xb2b3('0x24')](handleEntityNotFound(_0x141796,null))[_0xb2b3('0x24')](function(_0x27ed41){if(_0x27ed41){return _0x27ed41[_0xb2b3('0x8e')](_0x16404b[_0xb2b3('0x62')][_0xb2b3('0x6e')],_[_0xb2b3('0x8f')](_0x16404b['body'],[_0xb2b3('0x6e'),'id'])||{});}})[_0xb2b3('0x24')](respondWithResult(_0x141796,null))[_0xb2b3('0x2d')](handleError(_0x141796,null));};exports[_0xb2b3('0x90')]=function(_0x3c589f,_0x3fbed4,_0x86b9f3){var _0x23768a={'raw':![],'where':{}};var _0x58ce8f={};var _0x152763={'count':0x0,'rows':[]};return db[_0xb2b3('0x48')][_0xb2b3('0x69')]({'where':{'id':_0x3c589f[_0xb2b3('0x63')]['id']}})['then'](handleEntityNotFound(_0x3fbed4,null))[_0xb2b3('0x24')](function(_0x132622){if(_0x132622){_0x58ce8f['model']=_[_0xb2b3('0x61')](db[_0xb2b3('0x91')]['rawAttributes']);_0x58ce8f[_0xb2b3('0x4d')]=_['keys'](_0x3c589f[_0xb2b3('0x4d')]);_0x58ce8f['filters']=_['intersection'](_0x58ce8f['model'],_0x58ce8f['query']);_0x23768a[_0xb2b3('0x50')]=_[_0xb2b3('0x4f')](_0x58ce8f[_0xb2b3('0x4b')],qs[_0xb2b3('0x51')](_0x3c589f[_0xb2b3('0x4d')][_0xb2b3('0x51')]));_0x23768a['attributes']=_0x23768a['attributes'][_0xb2b3('0x52')]?_0x23768a[_0xb2b3('0x50')]:_0x58ce8f[_0xb2b3('0x4b')];if(!_0x3c589f[_0xb2b3('0x4d')][_0xb2b3('0x53')](_0xb2b3('0x6b'))){_0x23768a[_0xb2b3('0x32')]=qs[_0xb2b3('0x32')](_0x3c589f['query'][_0xb2b3('0x32')]);_0x23768a[_0xb2b3('0x31')]=qs[_0xb2b3('0x31')](_0x3c589f[_0xb2b3('0x4d')][_0xb2b3('0x31')]);}_0x23768a[_0xb2b3('0x6c')]=qs[_0xb2b3('0x54')](_0x3c589f[_0xb2b3('0x4d')][_0xb2b3('0x54')]);_0x23768a['where']=qs[_0xb2b3('0x4e')](_[_0xb2b3('0x56')](_0x3c589f['query'],_0x58ce8f[_0xb2b3('0x4e')]));_0x23768a[_0xb2b3('0x55')]['MailAccountId']=_0x132622['id'];if(_0x3c589f['query'][_0xb2b3('0x57')]){_0x23768a[_0xb2b3('0x55')]=_[_0xb2b3('0x58')](_0x23768a[_0xb2b3('0x55')],{'$or':_['map'](_0x23768a['attributes'],function(_0xc299b9){var _0x36cfdf={};_0x36cfdf[_0xc299b9]={'$like':'%'+_0x3c589f[_0xb2b3('0x4d')]['filter']+'%'};return _0x36cfdf;})});}_0x23768a=_[_0xb2b3('0x58')]({},_0x23768a,_0x3c589f[_0xb2b3('0x5b')]);return db[_0xb2b3('0x91')][_0xb2b3('0x34')]({'where':_0x23768a[_0xb2b3('0x55')]})[_0xb2b3('0x24')](function(_0x2943b8){_0x152763[_0xb2b3('0x34')]=_0x2943b8;if(_0x3c589f[_0xb2b3('0x4d')][_0xb2b3('0x5c')]){_0x23768a[_0xb2b3('0x5d')]=[{'model':db[_0xb2b3('0x92')],'as':_0xb2b3('0x93'),'required':![]},{'model':db[_0xb2b3('0x94')],'as':_0xb2b3('0x95'),'attributes':[_0xb2b3('0x3f'),_0xb2b3('0x96'),'internal'],'required':![]},{'model':db['Tag'],'as':_0xb2b3('0x97'),'attributes':['id','name','color'],'where':_0x3c589f['query'][_0xb2b3('0x98')]?{'id':_0x3c589f[_0xb2b3('0x4d')][_0xb2b3('0x98')]}:undefined,'required':_0x3c589f[_0xb2b3('0x4d')][_0xb2b3('0x98')]?!![]:![]}];}return db[_0xb2b3('0x91')]['findAll'](_0x23768a);})[_0xb2b3('0x24')](function(_0xd5ac22){_0x152763[_0xb2b3('0x5f')]=_0xd5ac22;return _0x152763;});}})[_0xb2b3('0x24')](respondWithFilteredResult(_0x3fbed4,_0x23768a))['catch'](handleError(_0x3fbed4,null));};exports[_0xb2b3('0x99')]=function(_0x272b4e,_0x8b72f,_0xbe50ce){return db[_0xb2b3('0x48')]['findOne']({'where':{'id':_0x272b4e['params']['id']}})['then'](handleEntityNotFound(_0x8b72f,null))[_0xb2b3('0x24')](function(_0xc7a925){if(_0xc7a925){return db[_0xb2b3('0x9a')][_0xb2b3('0x9b')](function(_0x2b0bed){return db['MailApplication'][_0xb2b3('0x3d')]({'where':{'MailAccountId':_0x272b4e[_0xb2b3('0x63')]['id']},'transaction':_0x2b0bed})[_0xb2b3('0x24')](function(_0xdb1081){var _0x109ef1=_[_0xb2b3('0x4c')](_0x272b4e[_0xb2b3('0x62')],function(_0xea6fd2){_0xea6fd2[_0xb2b3('0x67')]=_0x272b4e[_0xb2b3('0x63')]['id'];return _0xea6fd2;});return db[_0xb2b3('0x9c')][_0xb2b3('0x9d')](_0x109ef1,{'transaction':_0x2b0bed});});})[_0xb2b3('0x24')](function(){return db[_0xb2b3('0x9c')][_0xb2b3('0x9e')]({'where':{'MailAccountId':_0x272b4e[_0xb2b3('0x63')]['id']},'order':_0xb2b3('0x9f')});});}})[_0xb2b3('0x24')](respondWithResult(_0x8b72f,null))[_0xb2b3('0x2d')](handleError(_0x8b72f,null));};exports[_0xb2b3('0xa0')]=function(_0x454809,_0x4386fc,_0x318af4){var _0x4d71a6={};var _0x2ed718={};var _0x5b1125;var _0xe99e94;return db[_0xb2b3('0x48')][_0xb2b3('0x69')]({'where':{'id':_0x454809[_0xb2b3('0x63')]['id']}})[_0xb2b3('0x24')](handleEntityNotFound(_0x4386fc,null))[_0xb2b3('0x24')](function(_0x4ee500){if(_0x4ee500){_0x5b1125=_0x4ee500;_0x2ed718['model']=_[_0xb2b3('0x61')](db['MailApplication'][_0xb2b3('0x49')]);_0x2ed718['query']=_['keys'](_0x454809[_0xb2b3('0x4d')]);_0x2ed718[_0xb2b3('0x4e')]=_[_0xb2b3('0x4f')](_0x2ed718[_0xb2b3('0x4b')],_0x2ed718['query']);_0x4d71a6[_0xb2b3('0x50')]=_[_0xb2b3('0x4f')](_0x2ed718['model'],qs[_0xb2b3('0x51')](_0x454809[_0xb2b3('0x4d')][_0xb2b3('0x51')]));_0x4d71a6[_0xb2b3('0x50')]=_0x4d71a6[_0xb2b3('0x50')]['length']?_0x4d71a6[_0xb2b3('0x50')]:_0x2ed718['model'];_0x4d71a6[_0xb2b3('0x6c')]=qs[_0xb2b3('0x54')](_0x454809['query'][_0xb2b3('0x54')]);_0x4d71a6[_0xb2b3('0x55')]=qs['filters'](_['pick'](_0x454809[_0xb2b3('0x4d')],_0x2ed718[_0xb2b3('0x4e')]));if(_0x454809[_0xb2b3('0x4d')][_0xb2b3('0x57')]){_0x4d71a6[_0xb2b3('0x55')]=_[_0xb2b3('0x58')](_0x4d71a6[_0xb2b3('0x55')],{'$or':_['map'](_0x4d71a6[_0xb2b3('0x50')],function(_0x5afaf3){var _0xa2f29={};_0xa2f29[_0x5afaf3]={'$like':'%'+_0x454809[_0xb2b3('0x4d')][_0xb2b3('0x57')]+'%'};return _0xa2f29;})});}_0x4d71a6=_[_0xb2b3('0x58')]({},_0x4d71a6,_0x454809[_0xb2b3('0x5b')]);return _0x5b1125[_0xb2b3('0xa0')](_0x4d71a6);}})[_0xb2b3('0x24')](function(_0x569009){if(_0x569009){_0xe99e94=_0x569009[_0xb2b3('0x52')];if(!_0x454809[_0xb2b3('0x4d')][_0xb2b3('0x53')]('nolimit')){_0x4d71a6[_0xb2b3('0x32')]=qs[_0xb2b3('0x32')](_0x454809[_0xb2b3('0x4d')]['limit']);_0x4d71a6[_0xb2b3('0x31')]=qs[_0xb2b3('0x31')](_0x454809[_0xb2b3('0x4d')]['offset']);}return _0x5b1125[_0xb2b3('0xa0')](_0x4d71a6);}})[_0xb2b3('0x24')](function(_0xe6a1b6){if(_0xe6a1b6){return _0xe6a1b6?{'count':_0xe99e94,'rows':_0xe6a1b6}:null;}})[_0xb2b3('0x24')](respondWithResult(_0x4386fc,null))[_0xb2b3('0x2d')](handleError(_0x4386fc,null));};exports[_0xb2b3('0xa1')]=function(_0x120226,_0x4123a6,_0x19e77b){var _0x24b186={'raw':!![],'where':{}};var _0x5306cb={};var _0x1f0e98={'count':0x0,'rows':[]};return db[_0xb2b3('0x48')][_0xb2b3('0x69')]({'where':{'id':_0x120226['params']['id']}})[_0xb2b3('0x24')](handleEntityNotFound(_0x4123a6,null))['then'](function(_0x28ad38){if(_0x28ad38){_0x5306cb[_0xb2b3('0x4b')]=_[_0xb2b3('0x61')](db[_0xb2b3('0xa2')][_0xb2b3('0x49')]);_0x5306cb['query']=_[_0xb2b3('0x61')](_0x120226[_0xb2b3('0x4d')]);_0x5306cb[_0xb2b3('0x4e')]=_[_0xb2b3('0x4f')](_0x5306cb[_0xb2b3('0x4b')],_0x5306cb[_0xb2b3('0x4d')]);_0x24b186[_0xb2b3('0x50')]=_[_0xb2b3('0x4f')](_0x5306cb[_0xb2b3('0x4b')],qs[_0xb2b3('0x51')](_0x120226[_0xb2b3('0x4d')]['fields']));_0x24b186[_0xb2b3('0x50')]=_0x24b186[_0xb2b3('0x50')][_0xb2b3('0x52')]?_0x24b186[_0xb2b3('0x50')]:_0x5306cb[_0xb2b3('0x4b')];if(!_0x120226[_0xb2b3('0x4d')][_0xb2b3('0x53')]('nolimit')){_0x24b186['limit']=qs[_0xb2b3('0x32')](_0x120226[_0xb2b3('0x4d')]['limit']);_0x24b186['offset']=qs[_0xb2b3('0x31')](_0x120226[_0xb2b3('0x4d')][_0xb2b3('0x31')]);}_0x24b186[_0xb2b3('0x6c')]=qs[_0xb2b3('0x54')](_0x120226[_0xb2b3('0x4d')]['sort']);_0x24b186[_0xb2b3('0x55')]=qs[_0xb2b3('0x4e')](_[_0xb2b3('0x56')](_0x120226[_0xb2b3('0x4d')],_0x5306cb[_0xb2b3('0x4e')]));_0x24b186[_0xb2b3('0x55')][_0xb2b3('0x67')]=_0x28ad38['id'];if(_0x120226[_0xb2b3('0x4d')]['filter']){_0x24b186[_0xb2b3('0x55')]=_[_0xb2b3('0x58')](_0x24b186[_0xb2b3('0x55')],{'$or':_[_0xb2b3('0x4c')](_0x24b186['attributes'],function(_0x358f80){var _0x3f233d={};_0x3f233d[_0x358f80]={'$like':'%'+_0x120226[_0xb2b3('0x4d')][_0xb2b3('0x57')]+'%'};return _0x3f233d;})});}if(_0x120226['query'][_0xb2b3('0xa3')]){var _0x46d97f=_0x120226[_0xb2b3('0x4d')][_0xb2b3('0xa3')][_0xb2b3('0xa4')](',');var _0x4d373c={};_0x4d373c[_0x46d97f[0x0]]={'$gte':moment(_0x46d97f[0x1])[_0xb2b3('0xa5')](_0xb2b3('0xa6'))};_0x24b186[_0xb2b3('0x55')]=_[_0xb2b3('0x58')](_0x24b186[_0xb2b3('0x55')],_0x4d373c);}_0x24b186=_[_0xb2b3('0x58')]({},_0x24b186,_0x120226[_0xb2b3('0x5b')]);return db[_0xb2b3('0xa2')][_0xb2b3('0x34')]({'where':_0x24b186[_0xb2b3('0x55')]})[_0xb2b3('0x24')](function(_0x5f303c){_0x1f0e98[_0xb2b3('0x34')]=_0x5f303c;if(_0x120226['query']['includeAll']){_0x24b186[_0xb2b3('0x5d')]=[{'all':!![]}];}return db[_0xb2b3('0xa2')][_0xb2b3('0x5e')](_0x24b186);})[_0xb2b3('0x24')](function(_0x17c9e9){if(_0x120226[_0xb2b3('0x4d')][_0xb2b3('0xa7')]==='true'){for(var _0x1f8368=0x0;_0x1f8368<_0x17c9e9[_0xb2b3('0x52')];_0x1f8368++){_0x17c9e9[_0x1f8368][_0xb2b3('0x62')]=juice(_0x17c9e9[_0x1f8368][_0xb2b3('0x62')]);}}_0x1f0e98['rows']=_0x17c9e9;return _0x1f0e98;});}})[_0xb2b3('0x24')](respondWithFilteredResult(_0x4123a6,_0x24b186))[_0xb2b3('0x2d')](handleError(_0x4123a6,null));};exports[_0xb2b3('0x40')]=function(_0x366ce3,_0x3121be,_0x49d56f){var _0x4d2cfd,_0x3bfe0d={},_0x15e5f1;if(_0x366ce3[_0xb2b3('0x62')]['to']){_0x15e5f1=_0x366ce3[_0xb2b3('0x62')]['to'][_0xb2b3('0xa4')](',')[0x0];}return db['MailAccount'][_0xb2b3('0x66')]({'where':{'id':_0x366ce3[_0xb2b3('0x63')]['id']},'include':[{'model':db[_0xb2b3('0xa8')],'as':'List','include':[{'model':db[_0xb2b3('0x92')],'as':_0xb2b3('0xa9'),'where':{'email':_0x15e5f1},'limit':0x1,'order':[[_0xb2b3('0xaa'),'DESC']]}]},{'model':db[_0xb2b3('0x44')],'as':_0xb2b3('0x45'),'raw':!![]}]})[_0xb2b3('0x24')](handleEntityNotFound(_0x3121be,null))[_0xb2b3('0x24')](function(_0x5ba7b4){if(_0x5ba7b4){_0x4d2cfd=_0x5ba7b4;if(_0x5ba7b4[_0xb2b3('0x45')]){if(_[_0xb2b3('0x74')](_0x366ce3[_0xb2b3('0x62')]['from'])){_0x366ce3[_0xb2b3('0x62')]['from']=util['format'](_0xb2b3('0xab'),_0x5ba7b4[_0xb2b3('0x3f')],_0x5ba7b4[_0xb2b3('0xac')]||_0x5ba7b4[_0xb2b3('0x45')][_0xb2b3('0x77')]);}if(_0x366ce3['body'][_0xb2b3('0xad')]&&_0x366ce3[_0xb2b3('0x62')][_0xb2b3('0xad')]['length']){for(var _0x22b2de=0x0;_0x22b2de<_0x366ce3[_0xb2b3('0x62')][_0xb2b3('0xad')][_0xb2b3('0x52')];_0x22b2de+=0x1){_0x366ce3[_0xb2b3('0x62')][_0xb2b3('0xad')][_0x22b2de]={'filename':_0x366ce3[_0xb2b3('0x62')][_0xb2b3('0xad')][_0x22b2de][_0xb2b3('0x3f')],'path':path[_0xb2b3('0xae')](config[_0xb2b3('0xaf')],_0xb2b3('0xb0'),_0x366ce3[_0xb2b3('0x62')]['attachments'][_0x22b2de]['basename'])};}}var _0x14f13f={'tls':{'rejectUnauthorized':![]}};if(_[_0xb2b3('0x74')](_0x5ba7b4[_0xb2b3('0x45')][_0xb2b3('0x7f')])){if(_0x5ba7b4[_0xb2b3('0x45')]['authentication']){_0x14f13f[_0xb2b3('0xb1')]={'user':_0x5ba7b4['Smtp'][_0xb2b3('0x77')],'pass':_0x5ba7b4[_0xb2b3('0x45')][_0xb2b3('0x7a')]};}_0x14f13f[_0xb2b3('0x7d')]=_0x5ba7b4[_0xb2b3('0x45')][_0xb2b3('0x7d')];_0x14f13f[_0xb2b3('0x7e')]=_0x5ba7b4[_0xb2b3('0x45')]['port'];_0x14f13f[_0xb2b3('0xb2')]=_0x5ba7b4[_0xb2b3('0x45')]['secure'];}else{_0x14f13f[_0xb2b3('0x7f')]=_0x5ba7b4['Smtp'][_0xb2b3('0x7f')];_0x14f13f[_0xb2b3('0xb1')]={'user':_0x5ba7b4[_0xb2b3('0x45')][_0xb2b3('0x77')],'pass':_0x5ba7b4[_0xb2b3('0x45')]['pass']};}return respondWithRpcPromise(_0xb2b3('0xb3'),'sendMail',{'account':_0x14f13f,'message':_0x366ce3[_0xb2b3('0x62')]});}else{throw new Error(_0xb2b3('0xb4'));}}})['then'](function(_0x358b4b){if(_0x358b4b){_0x3bfe0d=_0x358b4b;if(_0x4d2cfd[_0xb2b3('0xb5')]){if(_0x4d2cfd['List'][_0xb2b3('0xa9')][_0xb2b3('0x52')]){return _0x4d2cfd['List'][_0xb2b3('0xa9')][0x0];}else{return db[_0xb2b3('0x92')][_0xb2b3('0x68')](_[_0xb2b3('0x1c')](_0x366ce3[_0xb2b3('0x62')],{'firstName':_0x366ce3['body']['to'],'email':_0x366ce3[_0xb2b3('0x62')]['to'],'phone':_0x366ce3[_0xb2b3('0x62')]['to'],'ListId':_0x4d2cfd[_0xb2b3('0xb6')]}));}}else{throw new Error('List\x20not\x20found');}}})['then'](function(_0x4bf199){if(_0x4bf199){var _0x137672={'UserId':_0x366ce3[_0xb2b3('0x77')]['id'],'ContactId':_0x4bf199['id'],'MailAccountId':_0x4d2cfd['id'],'inReplyTo':_0x3bfe0d['messageId'],'to':_0x366ce3[_0xb2b3('0x62')][_0xb2b3('0xb7')],'cc':_0x366ce3[_0xb2b3('0x62')]['cc'],'subject':_0x366ce3[_0xb2b3('0x62')][_0xb2b3('0xb8')],'attach':_0x366ce3[_0xb2b3('0x62')]['attach'],'firstMsgDirection':_0xb2b3('0xb9'),'lastMsgAt':moment()['format'](_0xb2b3('0xa6')),'lastMsgDirection':_0xb2b3('0xb9'),'Messages':[_[_0xb2b3('0x58')](_0x366ce3['body'],{'messageId':_0x3bfe0d[_0xb2b3('0xba')],'sentAt':moment()[_0xb2b3('0xa5')](_0xb2b3('0xa6')),'read':!![],'MailAccountId':_0x4d2cfd['id'],'UserId':_0x366ce3[_0xb2b3('0x77')]['id'],'ContactId':_0x4bf199['id']})]};if(_0x366ce3[_0xb2b3('0x62')][_0xb2b3('0xbb')]){_0x137672=_[_0xb2b3('0x58')](_0x137672,_0x366ce3['body'][_0xb2b3('0xbb')]);}return db['MailInteraction'][_0xb2b3('0x68')](_0x137672,{'include':[{'model':db['MailMessage'],'as':_0xb2b3('0xbc')}]});}})[_0xb2b3('0x24')](respondWithResult(_0x3121be,null))[_0xb2b3('0x2d')](handleError(_0x3121be,null));};exports[_0xb2b3('0xbd')]=function(_0x4adb94,_0x4c644c,_0x175055){return db[_0xb2b3('0x48')][_0xb2b3('0x66')]({'where':{'id':_0x4adb94['params']['id']},'include':[{'model':db['MailServerOut'],'as':'Smtp','raw':!![]}]})[_0xb2b3('0x24')](handleEntityNotFound(_0x4c644c,null))[_0xb2b3('0x24')](function(_0x30c16b){if(_0x30c16b&&_0x30c16b[_0xb2b3('0x45')]){var _0x48a05b={'id':_0x30c16b['id'],'tls':{'rejectUnauthorized':![]}};if(_0x30c16b[_0xb2b3('0x45')][_0xb2b3('0x7f')]){_0x48a05b[_0xb2b3('0x7f')]=_0x30c16b['Smtp'][_0xb2b3('0x7f')];}else{_0x48a05b['host']=_0x30c16b['Smtp'][_0xb2b3('0x7d')];_0x48a05b['port']=_0x30c16b['Smtp'][_0xb2b3('0x7e')];_0x48a05b[_0xb2b3('0xb2')]=_0x30c16b[_0xb2b3('0x45')][_0xb2b3('0xb2')];}if(_0x30c16b[_0xb2b3('0x45')]['authentication']){_0x48a05b[_0xb2b3('0xb1')]={'user':_0x30c16b[_0xb2b3('0x45')]['user'],'pass':_0x30c16b[_0xb2b3('0x45')][_0xb2b3('0x7a')]};}return respondWithRpcPromise(_0xb2b3('0xbe'),_0xb2b3('0xbd'),{'account':_0x48a05b});}})[_0xb2b3('0x24')](respondWithResult(_0x4c644c,null))['catch'](handleError(_0x4c644c,null));};exports[_0xb2b3('0x3d')]=function(_0x1f689a,_0x5e6e0c){return db[_0xb2b3('0x48')][_0xb2b3('0x66')]({'where':{'id':_0x1f689a['params']['id']}})[_0xb2b3('0x24')](handleEntityNotFound(_0x5e6e0c,null))[_0xb2b3('0x24')](function(_0x3cd3be){if(_0x3cd3be&&_0x3cd3be[_0xb2b3('0x7f')]){throw new db['Sequelize'][(_0xb2b3('0xbf'))](_0xb2b3('0xc0'));}return _0x3cd3be;})[_0xb2b3('0x24')](removeEntity(_0x5e6e0c,null))[_0xb2b3('0x2d')](handleError(_0x5e6e0c,null));};exports[_0xb2b3('0xc1')]=function(_0x5367bc,_0x182264,_0x80ce72){return db[_0xb2b3('0x48')]['find']({'where':{'id':_0x5367bc['params']['id']}})['then'](handleEntityNotFound(_0x182264,null))[_0xb2b3('0x24')](function(_0x3f4726){if(_0x3f4726){return _0x3f4726[_0xb2b3('0xc1')](_0x5367bc[_0xb2b3('0x62')]['ids'],_[_0xb2b3('0x8f')](_0x5367bc[_0xb2b3('0x62')],[_0xb2b3('0x6e'),'id'])||{})['spread'](function(_0xbe2433){for(var _0x48167c=0x0;_0x48167c<_0x5367bc[_0xb2b3('0x62')][_0xb2b3('0x6e')][_0xb2b3('0x52')];_0x48167c+=0x1){socket[_0xb2b3('0xc2')](_0xb2b3('0xc3'),{'UserId':Number(_0x5367bc[_0xb2b3('0x62')][_0xb2b3('0x6e')][_0x48167c]),'MailAccountId':Number(_0x5367bc['params']['id'])});}return _0xbe2433;});}})[_0xb2b3('0x24')](respondWithResult(_0x182264,null))['catch'](handleError(_0x182264,null));};exports[_0xb2b3('0xc4')]=function(_0xc2645,_0x1414a4,_0x5d2ee7){return db['MailAccount'][_0xb2b3('0x66')]({'where':{'id':_0xc2645[_0xb2b3('0x63')]['id']}})['then'](handleEntityNotFound(_0x1414a4,null))['then'](function(_0x553ded){if(_0x553ded){return _0x553ded[_0xb2b3('0xc4')](_0xc2645[_0xb2b3('0x4d')]['ids'])[_0xb2b3('0x24')](function(){if(_[_0xb2b3('0xc5')](_0xc2645[_0xb2b3('0x4d')][_0xb2b3('0x6e')])){for(var _0x564ce0=0x0;_0x564ce0<_0xc2645[_0xb2b3('0x4d')][_0xb2b3('0x6e')][_0xb2b3('0x52')];_0x564ce0+=0x1){socket[_0xb2b3('0xc2')]('userMailAccount:remove',{'UserId':Number(_0xc2645[_0xb2b3('0x4d')][_0xb2b3('0x6e')][_0x564ce0]),'MailAccountId':Number(_0xc2645[_0xb2b3('0x63')]['id'])});}}else{socket[_0xb2b3('0xc2')]('userMailAccount:remove',{'UserId':Number(_0xc2645[_0xb2b3('0x4d')][_0xb2b3('0x6e')]),'MailAccountId':Number(_0xc2645[_0xb2b3('0x63')]['id'])});}});}})[_0xb2b3('0x24')](respondWithStatusCode(_0x1414a4,null))[_0xb2b3('0x2d')](handleError(_0x1414a4,null));};exports[_0xb2b3('0xc6')]=function(_0x8c682e,_0x28e5c4,_0x5d9f37){var _0x547822={};var _0x366e03={};var _0x59cd4a;var _0x1a31cb;return db['MailAccount']['findOne']({'where':{'id':_0x8c682e[_0xb2b3('0x63')]['id']}})[_0xb2b3('0x24')](handleEntityNotFound(_0x28e5c4,null))[_0xb2b3('0x24')](function(_0x1515fa){if(_0x1515fa){_0x59cd4a=_0x1515fa;_0x366e03['model']=_['keys'](db[_0xb2b3('0x94')]['rawAttributes']);_0x366e03[_0xb2b3('0x4d')]=_[_0xb2b3('0x61')](_0x8c682e[_0xb2b3('0x4d')]);_0x366e03[_0xb2b3('0x4e')]=_['intersection'](_0x366e03[_0xb2b3('0x4b')],_0x366e03[_0xb2b3('0x4d')]);_0x547822[_0xb2b3('0x50')]=_[_0xb2b3('0x4f')](_0x366e03[_0xb2b3('0x4b')],qs[_0xb2b3('0x51')](_0x8c682e[_0xb2b3('0x4d')][_0xb2b3('0x51')]));_0x547822[_0xb2b3('0x50')]=_0x547822[_0xb2b3('0x50')][_0xb2b3('0x52')]?_0x547822[_0xb2b3('0x50')]:_0x366e03[_0xb2b3('0x4b')];_0x547822[_0xb2b3('0x6c')]=qs[_0xb2b3('0x54')](_0x8c682e[_0xb2b3('0x4d')][_0xb2b3('0x54')]);_0x547822[_0xb2b3('0x55')]=qs[_0xb2b3('0x4e')](_['pick'](_0x8c682e[_0xb2b3('0x4d')],_0x366e03['filters']));if(_0x8c682e[_0xb2b3('0x4d')]['filter']){_0x547822[_0xb2b3('0x55')]=_[_0xb2b3('0x58')](_0x547822[_0xb2b3('0x55')],{'$or':_['map'](_0x547822['attributes'],function(_0x6ed06){var _0x5e9410={};_0x5e9410[_0x6ed06]={'$like':'%'+_0x8c682e[_0xb2b3('0x4d')][_0xb2b3('0x57')]+'%'};return _0x5e9410;})});}_0x547822=_['merge']({},_0x547822,_0x8c682e[_0xb2b3('0x5b')]);return _0x59cd4a['getAgents'](_0x547822);}})[_0xb2b3('0x24')](function(_0x86b054){if(_0x86b054){_0x1a31cb=_0x86b054[_0xb2b3('0x52')];if(!_0x8c682e[_0xb2b3('0x4d')][_0xb2b3('0x53')]('nolimit')){_0x547822['limit']=qs[_0xb2b3('0x32')](_0x8c682e[_0xb2b3('0x4d')]['limit']);_0x547822[_0xb2b3('0x31')]=qs['offset'](_0x8c682e[_0xb2b3('0x4d')][_0xb2b3('0x31')]);}return _0x59cd4a['getAgents'](_0x547822);}})[_0xb2b3('0x24')](function(_0x5bb516){if(_0x5bb516){return _0x5bb516?{'count':_0x1a31cb,'rows':_0x5bb516}:null;}})[_0xb2b3('0x24')](respondWithResult(_0x28e5c4,null))[_0xb2b3('0x2d')](handleError(_0x28e5c4,null));}; \ No newline at end of file +var _0x7e60=['Smtp','Pause','mandatoryDispositionPause','map','MailAccount','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','hasOwnProperty','nolimit','sort','where','filters','filter','merge','VIRTUAL','options','findAll','rows','show','params','MailServerOut','fields','length','includeAll','find','body','describe','addDisposition','MailAccountId','Disposition','create','getDispositions','findOne','order','pick','removeDispositions','ids','addAnswer','CannedAnswer','include','removeAnswers','key','email','ListId','isNil','active','cservice','cauthentication','user','cuser','password','pass','authentication','host','port','service','cpassword','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','setImap','addSmtp','removeSmtp','addInteraction','MailInteraction','getInteractions','CmContact','Contact','fullname','internal','Tags','color','tag','sequelize','transaction','MailApplication','bulkCreate','getApplications','getMessages','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','CmList','Contacts','updatedAt','DESC','from','%s\x20<%s>','attachments','server/files/attachments','basename','auth','secure','SendMail','List\x20not\x20found','List','messageId','out','Interaction','Messages','verifySmtp','VerifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','omit','spread','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','User','getAgents','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','html-to-text','juice','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','./mailAccount.socket','register','jayson/promise','request','request\x20sent','debug','error','MailAccount,\x20%s,\x20%s','message','info','result','catch','sendStatus','status','end','json','limit','count','offset','set','save','update','then','destroy','MailAccounts','UserProfileResource','name','send','index','MailServerIn','Imap'];(function(_0x30cd7e,_0x4db10a){var _0x462a02=function(_0x157d81){while(--_0x157d81){_0x30cd7e['push'](_0x30cd7e['shift']());}};_0x462a02(++_0x4db10a);}(_0x7e60,0x13e));var _0x07e6=function(_0x33f682,_0x3eb255){_0x33f682=_0x33f682-0x0;var _0x4ee206=_0x7e60[_0x33f682];return _0x4ee206;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x07e6('0x0'));var zipdir=require(_0x07e6('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x07e6('0x2'));var moment=require(_0x07e6('0x3'));var BPromise=require(_0x07e6('0x4'));var Mustache=require(_0x07e6('0x5'));var util=require(_0x07e6('0x6'));var path=require(_0x07e6('0x7'));var sox=require(_0x07e6('0x8'));var csv=require(_0x07e6('0x9'));var ejs=require(_0x07e6('0xa'));var fs=require('fs');var fs_extra=require(_0x07e6('0xb'));var _=require(_0x07e6('0xc'));var squel=require(_0x07e6('0xd'));var crypto=require('crypto');var jsforce=require(_0x07e6('0xe'));var deskjs=require(_0x07e6('0xf'));var toCsv=require(_0x07e6('0x9'));var querystring=require(_0x07e6('0x10'));var Papa=require(_0x07e6('0x11'));var htmlToText=require(_0x07e6('0x12'));var juice=require(_0x07e6('0x13'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x07e6('0x14'));var as=require(_0x07e6('0x15'));var hardwareService=require(_0x07e6('0x16'));var logger=require(_0x07e6('0x17'))(_0x07e6('0x18'));var utils=require('../../config/utils');var config=require(_0x07e6('0x19'));var licenseUtil=require(_0x07e6('0x1a'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x07e6('0x1b')](config[_0x07e6('0x1c')],{'host':_0x07e6('0x1d'),'port':0x18eb});var socket=require(_0x07e6('0x1e'))(new Redis(config[_0x07e6('0x1c')]));require(_0x07e6('0x1f'))[_0x07e6('0x20')](socket);var jayson=require(_0x07e6('0x21'));var client=jayson['client']['http']({'port':0x232b});function respondWithRpcPromise(_0xc3eda5,_0x3242e2,_0x67c9ad,_0x2d843b){return new BPromise(function(_0x42154a,_0x3fa0dd){var _0x14941e=_0x2d843b||client;return _0x14941e[_0x07e6('0x22')](_0xc3eda5,_0x67c9ad)['then'](function(_0x4e6131){logger['info']('MailAccount,\x20%s,\x20%s',_0x3242e2,_0x07e6('0x23'));logger[_0x07e6('0x24')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x3242e2,_0x07e6('0x23'),JSON['stringify'](_0x4e6131));if(_0x4e6131[_0x07e6('0x25')]){if(_0x4e6131[_0x07e6('0x25')]['code']===0x1f4){logger[_0x07e6('0x25')](_0x07e6('0x26'),_0x3242e2,_0x4e6131[_0x07e6('0x25')][_0x07e6('0x27')]);return _0x3fa0dd(_0x4e6131['error'][_0x07e6('0x27')]);}logger['error'](_0x07e6('0x26'),_0x3242e2,_0x4e6131[_0x07e6('0x25')][_0x07e6('0x27')]);return _0x42154a(_0x4e6131[_0x07e6('0x25')]['message']);}else{logger[_0x07e6('0x28')](_0x07e6('0x26'),_0x3242e2,'request\x20sent');_0x42154a(_0x4e6131[_0x07e6('0x29')][_0x07e6('0x27')]);}})[_0x07e6('0x2a')](function(_0x171680){logger[_0x07e6('0x25')](_0x07e6('0x26'),_0x3242e2,_0x171680);_0x3fa0dd(_0x171680);});});}function respondWithStatusCode(_0x4cf874,_0x1f8aab){_0x1f8aab=_0x1f8aab||0xcc;return function(_0x1e3385){if(_0x1e3385){return _0x4cf874[_0x07e6('0x2b')](_0x1f8aab);}return _0x4cf874[_0x07e6('0x2c')](_0x1f8aab)[_0x07e6('0x2d')]();};}function respondWithResult(_0x56bba3,_0x1f53eb){_0x1f53eb=_0x1f53eb||0xc8;return function(_0x17710f){if(_0x17710f){return _0x56bba3[_0x07e6('0x2c')](_0x1f53eb)[_0x07e6('0x2e')](_0x17710f);}};}function respondWithFilteredResult(_0x3ec4dc,_0x3d4c3a){return function(_0x5e6a36){if(_0x5e6a36){var _0x23cf72=typeof _0x3d4c3a['offset']==='undefined'&&typeof _0x3d4c3a[_0x07e6('0x2f')]==='undefined';var _0x37a51d=_0x5e6a36[_0x07e6('0x30')];var _0x4f08d0=_0x23cf72?0x0:_0x3d4c3a['offset'];var _0x160b7c=_0x23cf72?_0x5e6a36[_0x07e6('0x30')]:_0x3d4c3a[_0x07e6('0x31')]+_0x3d4c3a['limit'];var _0x38e4bc;if(_0x160b7c>=_0x37a51d){_0x160b7c=_0x37a51d;_0x38e4bc=0xc8;}else{_0x38e4bc=0xce;}_0x3ec4dc[_0x07e6('0x2c')](_0x38e4bc);return _0x3ec4dc[_0x07e6('0x32')]('Content-Range',_0x4f08d0+'-'+_0x160b7c+'/'+_0x37a51d)[_0x07e6('0x2e')](_0x5e6a36);}return null;};}function patchUpdates(_0x16fa73){return function(_0x1a933c){try{jsonpatch['apply'](_0x1a933c,_0x16fa73,!![]);}catch(_0x51556d){return BPromise['reject'](_0x51556d);}return _0x1a933c[_0x07e6('0x33')]();};}function saveUpdates(_0x90b1a0,_0x44c913){return function(_0x47bf1d){if(_0x47bf1d){return _0x47bf1d[_0x07e6('0x34')](_0x90b1a0)[_0x07e6('0x35')](function(_0x139821){return _0x139821;});}return null;};}function removeEntity(_0x406e7c,_0x17bab4){return function(_0x35199f){if(_0x35199f){return _0x35199f[_0x07e6('0x36')]()[_0x07e6('0x35')](function(){var _0x37aef4=_0x35199f['get']({'plain':!![]});var _0x2ee89f=_0x07e6('0x37');return db[_0x07e6('0x38')][_0x07e6('0x36')]({'where':{'type':_0x2ee89f,'resourceId':_0x37aef4['id']}})[_0x07e6('0x35')](function(){return _0x35199f;});})[_0x07e6('0x35')](function(){_0x406e7c[_0x07e6('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4748bc,_0x39929d){return function(_0x2b2270){if(!_0x2b2270){_0x4748bc[_0x07e6('0x2b')](0x194);}return _0x2b2270;};}function handleError(_0x3037a6,_0x26f557){_0x26f557=_0x26f557||0x1f4;return function(_0x548dc0){logger[_0x07e6('0x25')](_0x548dc0['stack']);if(_0x548dc0[_0x07e6('0x39')]){delete _0x548dc0[_0x07e6('0x39')];}_0x3037a6[_0x07e6('0x2c')](_0x26f557)[_0x07e6('0x3a')](_0x548dc0);};}exports[_0x07e6('0x3b')]=function(_0x4ef7db,_0x3a9e74){var _0x2987b6={'include':[{'model':db[_0x07e6('0x3c')],'as':_0x07e6('0x3d')},{'model':db['MailServerOut'],'as':_0x07e6('0x3e')},{'model':db[_0x07e6('0x3f')],'as':_0x07e6('0x40')}]},_0x65d3f3={},_0x45453e={'count':0x0,'rows':[]};var _0x4d6500=_[_0x07e6('0x41')](db[_0x07e6('0x42')][_0x07e6('0x43')],function(_0x191223){return{'name':_0x191223[_0x07e6('0x44')],'type':_0x191223[_0x07e6('0x45')]['key']};});_0x65d3f3[_0x07e6('0x46')]=_[_0x07e6('0x41')](_0x4d6500,_0x07e6('0x39'));_0x65d3f3[_0x07e6('0x47')]=_[_0x07e6('0x48')](_0x4ef7db[_0x07e6('0x47')]);_0x65d3f3['filters']=_[_0x07e6('0x49')](_0x65d3f3[_0x07e6('0x46')],_0x65d3f3[_0x07e6('0x47')]);_0x2987b6[_0x07e6('0x4a')]=_[_0x07e6('0x49')](_0x65d3f3[_0x07e6('0x46')],qs['fields'](_0x4ef7db[_0x07e6('0x47')]['fields']));_0x2987b6[_0x07e6('0x4a')]=_0x2987b6[_0x07e6('0x4a')]['length']?_0x2987b6[_0x07e6('0x4a')]:_0x65d3f3[_0x07e6('0x46')];if(!_0x4ef7db['query'][_0x07e6('0x4b')](_0x07e6('0x4c'))){_0x2987b6[_0x07e6('0x2f')]=qs[_0x07e6('0x2f')](_0x4ef7db['query'][_0x07e6('0x2f')]);_0x2987b6[_0x07e6('0x31')]=qs[_0x07e6('0x31')](_0x4ef7db['query'][_0x07e6('0x31')]);}_0x2987b6['order']=qs[_0x07e6('0x4d')](_0x4ef7db['query']['sort']);_0x2987b6[_0x07e6('0x4e')]=qs[_0x07e6('0x4f')](_['pick'](_0x4ef7db[_0x07e6('0x47')],_0x65d3f3[_0x07e6('0x4f')]),_0x4d6500);if(_0x4ef7db['query'][_0x07e6('0x50')]){_0x2987b6[_0x07e6('0x4e')]=_[_0x07e6('0x51')](_0x2987b6[_0x07e6('0x4e')],{'$or':_[_0x07e6('0x41')](_0x4d6500,function(_0x359cca){if(_0x359cca[_0x07e6('0x45')]!==_0x07e6('0x52')){var _0x43cebd={};_0x43cebd[_0x359cca[_0x07e6('0x39')]]={'$like':'%'+_0x4ef7db[_0x07e6('0x47')]['filter']+'%'};return _0x43cebd;}})});}_0x2987b6=_[_0x07e6('0x51')]({},_0x2987b6,_0x4ef7db[_0x07e6('0x53')]);var _0x5e3b1c={'where':_0x2987b6[_0x07e6('0x4e')]};return db[_0x07e6('0x42')][_0x07e6('0x30')](_0x5e3b1c)['then'](function(_0x408b42){_0x45453e[_0x07e6('0x30')]=_0x408b42;if(_0x4ef7db['query']['includeAll']){_0x2987b6['include']=[{'all':!![]}];}return db['MailAccount'][_0x07e6('0x54')](_0x2987b6);})['then'](function(_0xae4b0a){_0x45453e[_0x07e6('0x55')]=_0xae4b0a;return _0x45453e;})[_0x07e6('0x35')](respondWithFilteredResult(_0x3a9e74,_0x2987b6))[_0x07e6('0x2a')](handleError(_0x3a9e74,null));};exports[_0x07e6('0x56')]=function(_0x1266a5,_0x3a75b6){var _0x565cf0={'raw':![],'where':{'id':_0x1266a5[_0x07e6('0x57')]['id']},'include':[{'model':db['MailServerIn'],'as':_0x07e6('0x3d')},{'model':db[_0x07e6('0x58')],'as':_0x07e6('0x3e')},{'model':db[_0x07e6('0x3f')],'as':_0x07e6('0x40')}]},_0x5992a0={};_0x5992a0[_0x07e6('0x46')]=_[_0x07e6('0x48')](db[_0x07e6('0x42')][_0x07e6('0x43')]);_0x5992a0[_0x07e6('0x47')]=_[_0x07e6('0x48')](_0x1266a5[_0x07e6('0x47')]);_0x5992a0[_0x07e6('0x4f')]=_['intersection'](_0x5992a0[_0x07e6('0x46')],_0x5992a0[_0x07e6('0x47')]);_0x565cf0[_0x07e6('0x4a')]=_[_0x07e6('0x49')](_0x5992a0[_0x07e6('0x46')],qs[_0x07e6('0x59')](_0x1266a5[_0x07e6('0x47')]['fields']));_0x565cf0[_0x07e6('0x4a')]=_0x565cf0[_0x07e6('0x4a')][_0x07e6('0x5a')]?_0x565cf0['attributes']:_0x5992a0[_0x07e6('0x46')];if(_0x1266a5[_0x07e6('0x47')][_0x07e6('0x5b')]){_0x565cf0['include']=[{'all':!![]}];}_0x565cf0=_[_0x07e6('0x51')]({},_0x565cf0,_0x1266a5[_0x07e6('0x53')]);return db[_0x07e6('0x42')][_0x07e6('0x5c')](_0x565cf0)[_0x07e6('0x35')](handleEntityNotFound(_0x3a75b6,null))[_0x07e6('0x35')](respondWithResult(_0x3a75b6,null))[_0x07e6('0x2a')](handleError(_0x3a75b6,null));};exports[_0x07e6('0x34')]=function(_0x495cdc,_0xba9c55){if(_0x495cdc[_0x07e6('0x5d')]['id']){delete _0x495cdc[_0x07e6('0x5d')]['id'];}return db[_0x07e6('0x42')][_0x07e6('0x5c')]({'where':{'id':_0x495cdc[_0x07e6('0x57')]['id']},'include':[{'model':db[_0x07e6('0x3c')],'as':'Imap'},{'model':db[_0x07e6('0x58')],'as':_0x07e6('0x3e')},{'model':db[_0x07e6('0x3f')],'as':_0x07e6('0x40')}]})[_0x07e6('0x35')](handleEntityNotFound(_0xba9c55,null))[_0x07e6('0x35')](saveUpdates(_0x495cdc[_0x07e6('0x5d')],null))[_0x07e6('0x35')](function(_0x2a42f9){if(_0x2a42f9&&_0x495cdc[_0x07e6('0x5d')][_0x07e6('0x3d')]){return db['MailServerIn']['update'](_0x495cdc['body']['Imap'],{'where':{'MailAccountId':_0x2a42f9['id']}})['then'](function(){return _0x2a42f9;});}return _0x2a42f9;})['then'](function(_0x3ee3bd){if(_0x3ee3bd&&_0x495cdc[_0x07e6('0x5d')][_0x07e6('0x3e')]){return db[_0x07e6('0x58')][_0x07e6('0x34')](_0x495cdc[_0x07e6('0x5d')][_0x07e6('0x3e')],{'where':{'MailAccountId':_0x3ee3bd['id']}})[_0x07e6('0x35')](function(){return _0x3ee3bd;});}return _0x3ee3bd;})[_0x07e6('0x35')](respondWithResult(_0xba9c55,null))[_0x07e6('0x2a')](handleError(_0xba9c55,null));};exports[_0x07e6('0x5e')]=function(_0x4b1726,_0x5de323){return db['MailAccount']['describe']()[_0x07e6('0x35')](respondWithResult(_0x5de323,null))[_0x07e6('0x2a')](handleError(_0x5de323,null));};exports[_0x07e6('0x5f')]=function(_0x15697e,_0xa9e5f4,_0x290baa){if(_0x15697e['body']['id']){delete _0x15697e[_0x07e6('0x5d')]['id'];}return db[_0x07e6('0x42')]['find']({'where':{'id':_0x15697e['params']['id']}})[_0x07e6('0x35')](handleEntityNotFound(_0xa9e5f4,null))[_0x07e6('0x35')](function(_0x429fae){if(_0x429fae){_0x15697e['body'][_0x07e6('0x60')]=_0x429fae['id'];return db[_0x07e6('0x61')][_0x07e6('0x62')](_0x15697e[_0x07e6('0x5d')]);}})[_0x07e6('0x35')](respondWithResult(_0xa9e5f4,null))['catch'](handleError(_0xa9e5f4,null));};exports[_0x07e6('0x63')]=function(_0x27f47a,_0x783f4c,_0x50e99a){var _0x4bb0bf={'raw':![],'where':{}};var _0x940755={};var _0x27c28f={'count':0x0,'rows':[]};return db['MailAccount'][_0x07e6('0x64')]({'where':{'id':_0x27f47a[_0x07e6('0x57')]['id']}})['then'](handleEntityNotFound(_0x783f4c,null))['then'](function(_0x92ff0c){if(_0x92ff0c){_0x940755[_0x07e6('0x46')]=_[_0x07e6('0x48')](db[_0x07e6('0x61')][_0x07e6('0x43')]);_0x940755[_0x07e6('0x47')]=_[_0x07e6('0x48')](_0x27f47a[_0x07e6('0x47')]);_0x940755[_0x07e6('0x4f')]=_[_0x07e6('0x49')](_0x940755[_0x07e6('0x46')],_0x940755[_0x07e6('0x47')]);_0x4bb0bf[_0x07e6('0x4a')]=_['intersection'](_0x940755[_0x07e6('0x46')],qs[_0x07e6('0x59')](_0x27f47a[_0x07e6('0x47')][_0x07e6('0x59')]));_0x4bb0bf[_0x07e6('0x4a')]=_0x4bb0bf[_0x07e6('0x4a')][_0x07e6('0x5a')]?_0x4bb0bf[_0x07e6('0x4a')]:_0x940755['model'];if(!_0x27f47a[_0x07e6('0x47')]['hasOwnProperty']('nolimit')){_0x4bb0bf[_0x07e6('0x2f')]=qs[_0x07e6('0x2f')](_0x27f47a[_0x07e6('0x47')][_0x07e6('0x2f')]);_0x4bb0bf[_0x07e6('0x31')]=qs[_0x07e6('0x31')](_0x27f47a['query'][_0x07e6('0x31')]);}_0x4bb0bf[_0x07e6('0x65')]=qs['sort'](_0x27f47a['query'][_0x07e6('0x4d')]);_0x4bb0bf[_0x07e6('0x4e')]=qs['filters'](_[_0x07e6('0x66')](_0x27f47a[_0x07e6('0x47')],_0x940755['filters']));_0x4bb0bf[_0x07e6('0x4e')]['MailAccountId']=_0x92ff0c['id'];if(_0x27f47a[_0x07e6('0x47')][_0x07e6('0x50')]){_0x4bb0bf[_0x07e6('0x4e')]=_[_0x07e6('0x51')](_0x4bb0bf[_0x07e6('0x4e')],{'$or':_['map'](_0x4bb0bf[_0x07e6('0x4a')],function(_0x4079f8){var _0xde2721={};_0xde2721[_0x4079f8]={'$like':'%'+_0x27f47a[_0x07e6('0x47')][_0x07e6('0x50')]+'%'};return _0xde2721;})});}_0x4bb0bf=_[_0x07e6('0x51')]({},_0x4bb0bf,_0x27f47a[_0x07e6('0x53')]);return db[_0x07e6('0x61')]['count']({'where':_0x4bb0bf['where']})[_0x07e6('0x35')](function(_0x24345d){_0x27c28f[_0x07e6('0x30')]=_0x24345d;if(_0x27f47a[_0x07e6('0x47')][_0x07e6('0x5b')]){_0x4bb0bf['include']=[{'all':!![]}];}return db[_0x07e6('0x61')][_0x07e6('0x54')](_0x4bb0bf);})[_0x07e6('0x35')](function(_0x1e8f56){_0x27c28f[_0x07e6('0x55')]=_0x1e8f56;return _0x27c28f;});}})['then'](respondWithFilteredResult(_0x783f4c,_0x4bb0bf))[_0x07e6('0x2a')](handleError(_0x783f4c,null));};exports[_0x07e6('0x67')]=function(_0x4b96b5,_0x197310,_0x59ed4a){return db[_0x07e6('0x42')][_0x07e6('0x5c')]({'where':{'id':_0x4b96b5[_0x07e6('0x57')]['id']}})[_0x07e6('0x35')](handleEntityNotFound(_0x197310,null))[_0x07e6('0x35')](function(_0x49c220){if(_0x49c220){return _0x49c220[_0x07e6('0x67')](_0x4b96b5[_0x07e6('0x47')][_0x07e6('0x68')]);}})[_0x07e6('0x35')](respondWithStatusCode(_0x197310,null))[_0x07e6('0x2a')](handleError(_0x197310,null));};exports[_0x07e6('0x69')]=function(_0x45e38b,_0x13df5d,_0x11f2bb){if(_0x45e38b[_0x07e6('0x5d')]['id']){delete _0x45e38b[_0x07e6('0x5d')]['id'];}return db[_0x07e6('0x42')][_0x07e6('0x5c')]({'where':{'id':_0x45e38b['params']['id']}})[_0x07e6('0x35')](handleEntityNotFound(_0x13df5d,null))[_0x07e6('0x35')](function(_0x32469e){if(_0x32469e){_0x45e38b['body'][_0x07e6('0x60')]=_0x32469e['id'];return db[_0x07e6('0x6a')][_0x07e6('0x62')](_0x45e38b[_0x07e6('0x5d')]);}})[_0x07e6('0x35')](respondWithResult(_0x13df5d,null))[_0x07e6('0x2a')](handleError(_0x13df5d,null));};exports['getAnswers']=function(_0x95e7b8,_0x1e6ad0,_0x313340){var _0x48745c={'raw':![],'where':{}};var _0x574e50={};var _0x3bae07={'count':0x0,'rows':[]};return db[_0x07e6('0x42')]['findOne']({'where':{'id':_0x95e7b8[_0x07e6('0x57')]['id']}})[_0x07e6('0x35')](handleEntityNotFound(_0x1e6ad0,null))[_0x07e6('0x35')](function(_0x141ca2){if(_0x141ca2){_0x574e50[_0x07e6('0x46')]=_[_0x07e6('0x48')](db[_0x07e6('0x6a')][_0x07e6('0x43')]);_0x574e50[_0x07e6('0x47')]=_[_0x07e6('0x48')](_0x95e7b8[_0x07e6('0x47')]);_0x574e50['filters']=_[_0x07e6('0x49')](_0x574e50[_0x07e6('0x46')],_0x574e50['query']);_0x48745c[_0x07e6('0x4a')]=_[_0x07e6('0x49')](_0x574e50[_0x07e6('0x46')],qs[_0x07e6('0x59')](_0x95e7b8[_0x07e6('0x47')][_0x07e6('0x59')]));_0x48745c['attributes']=_0x48745c['attributes'][_0x07e6('0x5a')]?_0x48745c[_0x07e6('0x4a')]:_0x574e50[_0x07e6('0x46')];if(!_0x95e7b8[_0x07e6('0x47')][_0x07e6('0x4b')]('nolimit')){_0x48745c[_0x07e6('0x2f')]=qs[_0x07e6('0x2f')](_0x95e7b8[_0x07e6('0x47')]['limit']);_0x48745c['offset']=qs[_0x07e6('0x31')](_0x95e7b8['query'][_0x07e6('0x31')]);}_0x48745c['order']=qs[_0x07e6('0x4d')](_0x95e7b8[_0x07e6('0x47')]['sort']);_0x48745c[_0x07e6('0x4e')]=qs[_0x07e6('0x4f')](_[_0x07e6('0x66')](_0x95e7b8['query'],_0x574e50[_0x07e6('0x4f')]));_0x48745c[_0x07e6('0x4e')][_0x07e6('0x60')]=_0x141ca2['id'];if(_0x95e7b8['query'][_0x07e6('0x50')]){_0x48745c[_0x07e6('0x4e')]=_['merge'](_0x48745c[_0x07e6('0x4e')],{'$or':_[_0x07e6('0x41')](_0x48745c['attributes'],function(_0x2fe49c){var _0x199bc4={};_0x199bc4[_0x2fe49c]={'$like':'%'+_0x95e7b8[_0x07e6('0x47')]['filter']+'%'};return _0x199bc4;})});}_0x48745c=_[_0x07e6('0x51')]({},_0x48745c,_0x95e7b8[_0x07e6('0x53')]);return db[_0x07e6('0x6a')][_0x07e6('0x30')]({'where':_0x48745c[_0x07e6('0x4e')]})[_0x07e6('0x35')](function(_0x2196b8){_0x3bae07[_0x07e6('0x30')]=_0x2196b8;if(_0x95e7b8[_0x07e6('0x47')][_0x07e6('0x5b')]){_0x48745c[_0x07e6('0x6b')]=[{'all':!![]}];}return db[_0x07e6('0x6a')][_0x07e6('0x54')](_0x48745c);})[_0x07e6('0x35')](function(_0x4531d6){_0x3bae07[_0x07e6('0x55')]=_0x4531d6;return _0x3bae07;});}})[_0x07e6('0x35')](respondWithFilteredResult(_0x1e6ad0,_0x48745c))[_0x07e6('0x2a')](handleError(_0x1e6ad0,null));};exports[_0x07e6('0x6c')]=function(_0x5b6e25,_0x5b8454,_0x3eb910){return db[_0x07e6('0x42')][_0x07e6('0x5c')]({'where':{'id':_0x5b6e25[_0x07e6('0x57')]['id']}})[_0x07e6('0x35')](handleEntityNotFound(_0x5b8454,null))[_0x07e6('0x35')](function(_0x5c0a10){if(_0x5c0a10){return _0x5c0a10['removeAnswers'](_0x5b6e25['query']['ids']);}})[_0x07e6('0x35')](respondWithStatusCode(_0x5b8454,null))['catch'](handleError(_0x5b8454,null));};exports[_0x07e6('0x62')]=function(_0x36976d,_0x1ca6ea){var _0x104df1={'name':_0x36976d[_0x07e6('0x5d')]['name'],'key':_0x36976d['body'][_0x07e6('0x6d')],'email':_0x36976d[_0x07e6('0x5d')][_0x07e6('0x6e')],'ListId':_0x36976d['body'][_0x07e6('0x6f')],'active':!_[_0x07e6('0x70')](_0x36976d[_0x07e6('0x5d')]['active'])?_0x36976d[_0x07e6('0x5d')][_0x07e6('0x71')]:!![],'description':_0x36976d[_0x07e6('0x5d')]['description']||null,'Imap':{},'Smtp':{}};if(_[_0x07e6('0x70')](_0x36976d[_0x07e6('0x5d')][_0x07e6('0x72')])){if(_0x36976d[_0x07e6('0x5d')][_0x07e6('0x73')]){_0x104df1['Imap']['user']=_0x104df1[_0x07e6('0x3e')][_0x07e6('0x74')]=_0x36976d[_0x07e6('0x5d')][_0x07e6('0x75')];_0x104df1[_0x07e6('0x3d')][_0x07e6('0x76')]=_0x104df1[_0x07e6('0x3e')][_0x07e6('0x77')]=_0x36976d[_0x07e6('0x5d')]['cpassword'];}else{_0x104df1[_0x07e6('0x3d')][_0x07e6('0x78')]=_0x104df1[_0x07e6('0x3e')][_0x07e6('0x78')]=![];}_0x104df1['Imap'][_0x07e6('0x79')]=_0x36976d[_0x07e6('0x5d')][_0x07e6('0x3d')][_0x07e6('0x79')];_0x104df1[_0x07e6('0x3d')][_0x07e6('0x7a')]=_0x36976d[_0x07e6('0x5d')]['Imap']['port'];_0x104df1[_0x07e6('0x3e')][_0x07e6('0x79')]=_0x36976d[_0x07e6('0x5d')][_0x07e6('0x3e')][_0x07e6('0x79')];_0x104df1['Smtp'][_0x07e6('0x7a')]=_0x36976d['body'][_0x07e6('0x3e')][_0x07e6('0x7a')];}else{_0x104df1[_0x07e6('0x3d')][_0x07e6('0x7b')]=_0x104df1['Smtp']['service']=_0x36976d[_0x07e6('0x5d')][_0x07e6('0x72')];_0x104df1['Imap'][_0x07e6('0x74')]=_0x104df1[_0x07e6('0x3e')][_0x07e6('0x74')]=_0x36976d[_0x07e6('0x5d')][_0x07e6('0x75')];_0x104df1[_0x07e6('0x3d')][_0x07e6('0x76')]=_0x104df1['Smtp'][_0x07e6('0x77')]=_0x36976d['body'][_0x07e6('0x7c')];}return db[_0x07e6('0x42')]['create'](_0x104df1,{'include':[{'model':db['MailServerOut'],'as':_0x07e6('0x3e')},{'model':db[_0x07e6('0x3c')],'as':'Imap'}]})[_0x07e6('0x35')](function(_0xd40609){var _0x26fba7=_0x36976d['user'][_0x07e6('0x7d')]({'plain':!![]});if(!_0x26fba7)throw new Error(_0x07e6('0x7e'));if(_0x26fba7[_0x07e6('0x7f')]===_0x07e6('0x74')){var _0x1d06ae=_0xd40609[_0x07e6('0x7d')]({'plain':!![]});return db[_0x07e6('0x80')][_0x07e6('0x5c')]({'where':{'name':_0x07e6('0x37'),'userProfileId':_0x26fba7[_0x07e6('0x81')]},'raw':!![]})['then'](function(_0xd1c51a){if(_0xd1c51a&&_0xd1c51a['autoAssociation']===0x0){return db[_0x07e6('0x38')]['create']({'name':_0x1d06ae[_0x07e6('0x39')],'resourceId':_0x1d06ae['id'],'type':_0xd1c51a[_0x07e6('0x39')],'sectionId':_0xd1c51a['id']},{})['then'](function(){return _0xd40609;});}else{return _0xd40609;}})[_0x07e6('0x2a')](function(_0x3aee75){logger['error'](_0x07e6('0x82'),_0x3aee75);throw _0x3aee75;});}return _0xd40609;})[_0x07e6('0x35')](respondWithResult(_0x1ca6ea,0xc9))[_0x07e6('0x2a')](handleError(_0x1ca6ea,null));};exports[_0x07e6('0x83')]=function(_0x4b6463,_0x4d7c00,_0x1183d1){return db['MailAccount']['findOne']({'where':{'id':_0x4b6463['params']['id']}})[_0x07e6('0x35')](handleEntityNotFound(_0x4d7c00,null))[_0x07e6('0x35')](function(_0x3296a7){if(_0x3296a7){return _0x3296a7[_0x07e6('0x83')]();}return null;})[_0x07e6('0x35')](respondWithResult(_0x4d7c00,null))['catch'](handleError(_0x4d7c00,null));};exports[_0x07e6('0x84')]=function(_0x5eb677,_0x34cd33,_0x459172){if(_0x5eb677[_0x07e6('0x5d')]['id']){delete _0x5eb677[_0x07e6('0x5d')]['id'];}return db[_0x07e6('0x42')][_0x07e6('0x5c')]({'where':{'id':_0x5eb677['params']['id']}})[_0x07e6('0x35')](handleEntityNotFound(_0x34cd33,null))[_0x07e6('0x35')](function(_0x36afe4){if(_0x36afe4){_0x5eb677[_0x07e6('0x5d')][_0x07e6('0x60')]=_0x36afe4['id'];return db['MailServerIn'][_0x07e6('0x62')](_0x5eb677[_0x07e6('0x5d')]);}})[_0x07e6('0x35')](respondWithResult(_0x34cd33,null))[_0x07e6('0x2a')](handleError(_0x34cd33,null));};exports['removeImap']=function(_0x597300,_0x52253d,_0x126701){return db[_0x07e6('0x42')]['findOne']({'where':{'id':_0x597300[_0x07e6('0x57')]['id']}})[_0x07e6('0x35')](handleEntityNotFound(_0x52253d,null))['then'](function(_0x427d4a){if(_0x427d4a){return _0x427d4a[_0x07e6('0x85')](null);}return null;})[_0x07e6('0x35')](respondWithStatusCode(_0x52253d,null))[_0x07e6('0x2a')](handleError(_0x52253d,null));};exports['getSmtp']=function(_0x2dec83,_0x593792,_0xd1fc87){return db[_0x07e6('0x42')][_0x07e6('0x64')]({'where':{'id':_0x2dec83['params']['id']}})['then'](handleEntityNotFound(_0x593792,null))['then'](function(_0x4b1711){if(_0x4b1711){return _0x4b1711['getSmtp']();}return null;})[_0x07e6('0x35')](respondWithResult(_0x593792,null))['catch'](handleError(_0x593792,null));};exports[_0x07e6('0x86')]=function(_0x316846,_0x434a62,_0x556aa8){if(_0x316846[_0x07e6('0x5d')]['id']){delete _0x316846[_0x07e6('0x5d')]['id'];}return db[_0x07e6('0x42')][_0x07e6('0x5c')]({'where':{'id':_0x316846[_0x07e6('0x57')]['id']}})['then'](handleEntityNotFound(_0x434a62,null))[_0x07e6('0x35')](function(_0x4407df){if(_0x4407df){_0x316846[_0x07e6('0x5d')][_0x07e6('0x60')]=_0x4407df['id'];return db[_0x07e6('0x58')]['create'](_0x316846[_0x07e6('0x5d')]);}})[_0x07e6('0x35')](respondWithResult(_0x434a62,null))['catch'](handleError(_0x434a62,null));};exports[_0x07e6('0x87')]=function(_0x2fcc30,_0x3fe51e,_0x582031){return db['MailAccount'][_0x07e6('0x64')]({'where':{'id':_0x2fcc30['params']['id']}})[_0x07e6('0x35')](handleEntityNotFound(_0x3fe51e,null))[_0x07e6('0x35')](function(_0x2cc274){if(_0x2cc274){return _0x2cc274['setSmtp'](null);}return null;})[_0x07e6('0x35')](respondWithStatusCode(_0x3fe51e,null))[_0x07e6('0x2a')](handleError(_0x3fe51e,null));};exports[_0x07e6('0x88')]=function(_0x1ad922,_0x3ca014,_0x3ae590){return db[_0x07e6('0x89')][_0x07e6('0x5c')]({'where':{'id':_0x1ad922['params']['id']}})[_0x07e6('0x35')](handleEntityNotFound(_0x3ca014,null))[_0x07e6('0x35')](function(_0x3a96ad){if(_0x3a96ad){return _0x3a96ad['addInteraction'](_0x1ad922['body'][_0x07e6('0x68')],_['omit'](_0x1ad922[_0x07e6('0x5d')],[_0x07e6('0x68'),'id'])||{});}})[_0x07e6('0x35')](respondWithResult(_0x3ca014,null))[_0x07e6('0x2a')](handleError(_0x3ca014,null));};exports[_0x07e6('0x8a')]=function(_0x1306a5,_0x1a24f1,_0x559190){var _0x3528aa={'raw':![],'where':{}};var _0x383ff1={};var _0x3359f6={'count':0x0,'rows':[]};return db[_0x07e6('0x42')][_0x07e6('0x64')]({'where':{'id':_0x1306a5['params']['id']}})[_0x07e6('0x35')](handleEntityNotFound(_0x1a24f1,null))[_0x07e6('0x35')](function(_0x1d0729){if(_0x1d0729){_0x383ff1['model']=_[_0x07e6('0x48')](db[_0x07e6('0x89')]['rawAttributes']);_0x383ff1[_0x07e6('0x47')]=_[_0x07e6('0x48')](_0x1306a5['query']);_0x383ff1[_0x07e6('0x4f')]=_[_0x07e6('0x49')](_0x383ff1[_0x07e6('0x46')],_0x383ff1['query']);_0x3528aa[_0x07e6('0x4a')]=_[_0x07e6('0x49')](_0x383ff1[_0x07e6('0x46')],qs['fields'](_0x1306a5[_0x07e6('0x47')][_0x07e6('0x59')]));_0x3528aa[_0x07e6('0x4a')]=_0x3528aa[_0x07e6('0x4a')][_0x07e6('0x5a')]?_0x3528aa[_0x07e6('0x4a')]:_0x383ff1[_0x07e6('0x46')];if(!_0x1306a5[_0x07e6('0x47')][_0x07e6('0x4b')](_0x07e6('0x4c'))){_0x3528aa[_0x07e6('0x2f')]=qs[_0x07e6('0x2f')](_0x1306a5[_0x07e6('0x47')]['limit']);_0x3528aa[_0x07e6('0x31')]=qs['offset'](_0x1306a5[_0x07e6('0x47')][_0x07e6('0x31')]);}_0x3528aa['order']=qs[_0x07e6('0x4d')](_0x1306a5['query']['sort']);_0x3528aa['where']=qs[_0x07e6('0x4f')](_[_0x07e6('0x66')](_0x1306a5[_0x07e6('0x47')],_0x383ff1[_0x07e6('0x4f')]));_0x3528aa[_0x07e6('0x4e')]['MailAccountId']=_0x1d0729['id'];if(_0x1306a5['query']['filter']){_0x3528aa[_0x07e6('0x4e')]=_[_0x07e6('0x51')](_0x3528aa['where'],{'$or':_[_0x07e6('0x41')](_0x3528aa[_0x07e6('0x4a')],function(_0xa20c67){var _0xf0c2a={};_0xf0c2a[_0xa20c67]={'$like':'%'+_0x1306a5[_0x07e6('0x47')][_0x07e6('0x50')]+'%'};return _0xf0c2a;})});}_0x3528aa=_[_0x07e6('0x51')]({},_0x3528aa,_0x1306a5[_0x07e6('0x53')]);return db[_0x07e6('0x89')][_0x07e6('0x30')]({'where':_0x3528aa[_0x07e6('0x4e')]})[_0x07e6('0x35')](function(_0x4076ae){_0x3359f6[_0x07e6('0x30')]=_0x4076ae;if(_0x1306a5['query'][_0x07e6('0x5b')]){_0x3528aa['include']=[{'model':db[_0x07e6('0x8b')],'as':_0x07e6('0x8c'),'required':![]},{'model':db['User'],'as':'Owner','attributes':[_0x07e6('0x39'),_0x07e6('0x8d'),_0x07e6('0x8e')],'required':![]},{'model':db['Tag'],'as':_0x07e6('0x8f'),'attributes':['id',_0x07e6('0x39'),_0x07e6('0x90')],'where':_0x1306a5[_0x07e6('0x47')][_0x07e6('0x91')]?{'id':_0x1306a5[_0x07e6('0x47')]['tag']}:undefined,'required':_0x1306a5[_0x07e6('0x47')][_0x07e6('0x91')]?!![]:![]}];}return db['MailInteraction'][_0x07e6('0x54')](_0x3528aa);})[_0x07e6('0x35')](function(_0x3e7fa0){_0x3359f6[_0x07e6('0x55')]=_0x3e7fa0;return _0x3359f6;});}})['then'](respondWithFilteredResult(_0x1a24f1,_0x3528aa))['catch'](handleError(_0x1a24f1,null));};exports['addApplications']=function(_0x33417e,_0x2d692a,_0x3d9714){return db[_0x07e6('0x42')][_0x07e6('0x64')]({'where':{'id':_0x33417e[_0x07e6('0x57')]['id']}})['then'](handleEntityNotFound(_0x2d692a,null))['then'](function(_0x4d6397){if(_0x4d6397){return db[_0x07e6('0x92')][_0x07e6('0x93')](function(_0x38e7c0){return db['MailApplication'][_0x07e6('0x36')]({'where':{'MailAccountId':_0x33417e['params']['id']},'transaction':_0x38e7c0})[_0x07e6('0x35')](function(_0x1bd8ff){var _0x196e3f=_[_0x07e6('0x41')](_0x33417e['body'],function(_0x42a226){_0x42a226['MailAccountId']=_0x33417e['params']['id'];return _0x42a226;});return db[_0x07e6('0x94')][_0x07e6('0x95')](_0x196e3f,{'transaction':_0x38e7c0});});})[_0x07e6('0x35')](function(){return db[_0x07e6('0x94')]['findAndCountAll']({'where':{'MailAccountId':_0x33417e[_0x07e6('0x57')]['id']},'order':'priority'});});}})['then'](respondWithResult(_0x2d692a,null))[_0x07e6('0x2a')](handleError(_0x2d692a,null));};exports['getApplications']=function(_0x38b129,_0x2dd1ef,_0x59d71c){var _0x15aba5={};var _0x2436e0={};var _0xfc9dad;var _0x561461;return db[_0x07e6('0x42')][_0x07e6('0x64')]({'where':{'id':_0x38b129[_0x07e6('0x57')]['id']}})[_0x07e6('0x35')](handleEntityNotFound(_0x2dd1ef,null))[_0x07e6('0x35')](function(_0x23e709){if(_0x23e709){_0xfc9dad=_0x23e709;_0x2436e0[_0x07e6('0x46')]=_[_0x07e6('0x48')](db[_0x07e6('0x94')][_0x07e6('0x43')]);_0x2436e0[_0x07e6('0x47')]=_[_0x07e6('0x48')](_0x38b129[_0x07e6('0x47')]);_0x2436e0[_0x07e6('0x4f')]=_[_0x07e6('0x49')](_0x2436e0['model'],_0x2436e0['query']);_0x15aba5[_0x07e6('0x4a')]=_[_0x07e6('0x49')](_0x2436e0[_0x07e6('0x46')],qs[_0x07e6('0x59')](_0x38b129[_0x07e6('0x47')][_0x07e6('0x59')]));_0x15aba5[_0x07e6('0x4a')]=_0x15aba5[_0x07e6('0x4a')][_0x07e6('0x5a')]?_0x15aba5['attributes']:_0x2436e0[_0x07e6('0x46')];_0x15aba5[_0x07e6('0x65')]=qs[_0x07e6('0x4d')](_0x38b129['query']['sort']);_0x15aba5[_0x07e6('0x4e')]=qs[_0x07e6('0x4f')](_[_0x07e6('0x66')](_0x38b129['query'],_0x2436e0['filters']));if(_0x38b129['query']['filter']){_0x15aba5[_0x07e6('0x4e')]=_[_0x07e6('0x51')](_0x15aba5['where'],{'$or':_[_0x07e6('0x41')](_0x15aba5[_0x07e6('0x4a')],function(_0x39d016){var _0x14c062={};_0x14c062[_0x39d016]={'$like':'%'+_0x38b129[_0x07e6('0x47')][_0x07e6('0x50')]+'%'};return _0x14c062;})});}_0x15aba5=_['merge']({},_0x15aba5,_0x38b129[_0x07e6('0x53')]);return _0xfc9dad[_0x07e6('0x96')](_0x15aba5);}})[_0x07e6('0x35')](function(_0x6617b0){if(_0x6617b0){_0x561461=_0x6617b0['length'];if(!_0x38b129[_0x07e6('0x47')][_0x07e6('0x4b')](_0x07e6('0x4c'))){_0x15aba5[_0x07e6('0x2f')]=qs[_0x07e6('0x2f')](_0x38b129[_0x07e6('0x47')]['limit']);_0x15aba5[_0x07e6('0x31')]=qs[_0x07e6('0x31')](_0x38b129['query'][_0x07e6('0x31')]);}return _0xfc9dad[_0x07e6('0x96')](_0x15aba5);}})[_0x07e6('0x35')](function(_0x36fe37){if(_0x36fe37){return _0x36fe37?{'count':_0x561461,'rows':_0x36fe37}:null;}})[_0x07e6('0x35')](respondWithResult(_0x2dd1ef,null))[_0x07e6('0x2a')](handleError(_0x2dd1ef,null));};exports[_0x07e6('0x97')]=function(_0x115dac,_0x56c28f,_0x580c3f){var _0x233b67={'raw':!![],'where':{}};var _0x5283a0={};var _0x204b77={'count':0x0,'rows':[]};return db['MailAccount']['findOne']({'where':{'id':_0x115dac[_0x07e6('0x57')]['id']}})[_0x07e6('0x35')](handleEntityNotFound(_0x56c28f,null))[_0x07e6('0x35')](function(_0x484b2c){if(_0x484b2c){_0x5283a0['model']=_[_0x07e6('0x48')](db[_0x07e6('0x98')]['rawAttributes']);_0x5283a0[_0x07e6('0x47')]=_[_0x07e6('0x48')](_0x115dac['query']);_0x5283a0[_0x07e6('0x4f')]=_[_0x07e6('0x49')](_0x5283a0[_0x07e6('0x46')],_0x5283a0['query']);_0x233b67['attributes']=_[_0x07e6('0x49')](_0x5283a0[_0x07e6('0x46')],qs[_0x07e6('0x59')](_0x115dac[_0x07e6('0x47')][_0x07e6('0x59')]));_0x233b67[_0x07e6('0x4a')]=_0x233b67[_0x07e6('0x4a')][_0x07e6('0x5a')]?_0x233b67[_0x07e6('0x4a')]:_0x5283a0[_0x07e6('0x46')];if(!_0x115dac[_0x07e6('0x47')]['hasOwnProperty'](_0x07e6('0x4c'))){_0x233b67[_0x07e6('0x2f')]=qs[_0x07e6('0x2f')](_0x115dac[_0x07e6('0x47')]['limit']);_0x233b67[_0x07e6('0x31')]=qs[_0x07e6('0x31')](_0x115dac[_0x07e6('0x47')]['offset']);}_0x233b67[_0x07e6('0x65')]=qs[_0x07e6('0x4d')](_0x115dac[_0x07e6('0x47')][_0x07e6('0x4d')]);_0x233b67[_0x07e6('0x4e')]=qs[_0x07e6('0x4f')](_['pick'](_0x115dac[_0x07e6('0x47')],_0x5283a0[_0x07e6('0x4f')]));_0x233b67[_0x07e6('0x4e')]['MailAccountId']=_0x484b2c['id'];if(_0x115dac['query']['filter']){_0x233b67[_0x07e6('0x4e')]=_[_0x07e6('0x51')](_0x233b67[_0x07e6('0x4e')],{'$or':_['map'](_0x233b67[_0x07e6('0x4a')],function(_0x37cda3){var _0x975ea3={};_0x975ea3[_0x37cda3]={'$like':'%'+_0x115dac[_0x07e6('0x47')]['filter']+'%'};return _0x975ea3;})});}if(_0x115dac[_0x07e6('0x47')][_0x07e6('0x99')]){var _0x122662=_0x115dac['query'][_0x07e6('0x99')][_0x07e6('0x9a')](',');var _0xaebc58={};_0xaebc58[_0x122662[0x0]]={'$gte':moment(_0x122662[0x1])[_0x07e6('0x9b')](_0x07e6('0x9c'))};_0x233b67['where']=_[_0x07e6('0x51')](_0x233b67[_0x07e6('0x4e')],_0xaebc58);}_0x233b67=_[_0x07e6('0x51')]({},_0x233b67,_0x115dac[_0x07e6('0x53')]);return db['MailMessage'][_0x07e6('0x30')]({'where':_0x233b67[_0x07e6('0x4e')]})['then'](function(_0x4f20b3){_0x204b77[_0x07e6('0x30')]=_0x4f20b3;if(_0x115dac['query'][_0x07e6('0x5b')]){_0x233b67[_0x07e6('0x6b')]=[{'all':!![]}];}return db[_0x07e6('0x98')][_0x07e6('0x54')](_0x233b67);})[_0x07e6('0x35')](function(_0x530472){if(_0x115dac[_0x07e6('0x47')][_0x07e6('0x9d')]==='true'){for(var _0x2ed932=0x0;_0x2ed932<_0x530472[_0x07e6('0x5a')];_0x2ed932++){_0x530472[_0x2ed932][_0x07e6('0x5d')]=juice(_0x530472[_0x2ed932][_0x07e6('0x5d')]);}}_0x204b77[_0x07e6('0x55')]=_0x530472;return _0x204b77;});}})[_0x07e6('0x35')](respondWithFilteredResult(_0x56c28f,_0x233b67))[_0x07e6('0x2a')](handleError(_0x56c28f,null));};exports[_0x07e6('0x3a')]=function(_0x1dadde,_0x27121c,_0x2f6e5f){var _0x5ae603,_0x8c4e9e={},_0x579839;if(_0x1dadde['body']['to']){_0x579839=_0x1dadde[_0x07e6('0x5d')]['to']['split'](',')[0x0];}return db[_0x07e6('0x42')][_0x07e6('0x5c')]({'where':{'id':_0x1dadde[_0x07e6('0x57')]['id']},'include':[{'model':db[_0x07e6('0x9e')],'as':'List','include':[{'model':db[_0x07e6('0x8b')],'as':_0x07e6('0x9f'),'where':{'email':_0x579839},'limit':0x1,'order':[[_0x07e6('0xa0'),_0x07e6('0xa1')]]}]},{'model':db[_0x07e6('0x58')],'as':_0x07e6('0x3e'),'raw':!![]}]})[_0x07e6('0x35')](handleEntityNotFound(_0x27121c,null))[_0x07e6('0x35')](function(_0x351acf){if(_0x351acf){_0x5ae603=_0x351acf;if(_0x351acf[_0x07e6('0x3e')]){if(_[_0x07e6('0x70')](_0x1dadde['body'][_0x07e6('0xa2')])){_0x1dadde[_0x07e6('0x5d')][_0x07e6('0xa2')]=util[_0x07e6('0x9b')](_0x07e6('0xa3'),_0x351acf[_0x07e6('0x39')],_0x351acf[_0x07e6('0x6e')]||_0x351acf[_0x07e6('0x3e')]['user']);}if(_0x1dadde[_0x07e6('0x5d')][_0x07e6('0xa4')]&&_0x1dadde[_0x07e6('0x5d')][_0x07e6('0xa4')][_0x07e6('0x5a')]){for(var _0x545dad=0x0;_0x545dad<_0x1dadde[_0x07e6('0x5d')][_0x07e6('0xa4')][_0x07e6('0x5a')];_0x545dad+=0x1){_0x1dadde[_0x07e6('0x5d')]['attachments'][_0x545dad]={'filename':_0x1dadde[_0x07e6('0x5d')]['attachments'][_0x545dad][_0x07e6('0x39')],'path':path['join'](config['root'],_0x07e6('0xa5'),_0x1dadde[_0x07e6('0x5d')][_0x07e6('0xa4')][_0x545dad][_0x07e6('0xa6')])};}}var _0x48db05={'tls':{'rejectUnauthorized':![]}};if(_[_0x07e6('0x70')](_0x351acf[_0x07e6('0x3e')][_0x07e6('0x7b')])){if(_0x351acf[_0x07e6('0x3e')][_0x07e6('0x78')]){_0x48db05[_0x07e6('0xa7')]={'user':_0x351acf['Smtp'][_0x07e6('0x74')],'pass':_0x351acf[_0x07e6('0x3e')][_0x07e6('0x77')]};}_0x48db05[_0x07e6('0x79')]=_0x351acf['Smtp'][_0x07e6('0x79')];_0x48db05[_0x07e6('0x7a')]=_0x351acf[_0x07e6('0x3e')][_0x07e6('0x7a')];_0x48db05[_0x07e6('0xa8')]=_0x351acf['Smtp'][_0x07e6('0xa8')];}else{_0x48db05[_0x07e6('0x7b')]=_0x351acf[_0x07e6('0x3e')][_0x07e6('0x7b')];_0x48db05['auth']={'user':_0x351acf[_0x07e6('0x3e')][_0x07e6('0x74')],'pass':_0x351acf[_0x07e6('0x3e')][_0x07e6('0x77')]};}return respondWithRpcPromise(_0x07e6('0xa9'),'sendMail',{'account':_0x48db05,'message':_0x1dadde[_0x07e6('0x5d')]});}else{throw new Error(_0x07e6('0xaa'));}}})[_0x07e6('0x35')](function(_0x4d9b64){if(_0x4d9b64){_0x8c4e9e=_0x4d9b64;if(_0x5ae603['List']){if(_0x5ae603[_0x07e6('0xab')][_0x07e6('0x9f')][_0x07e6('0x5a')]){return _0x5ae603[_0x07e6('0xab')][_0x07e6('0x9f')][0x0];}else{return db[_0x07e6('0x8b')]['create'](_[_0x07e6('0x1b')](_0x1dadde[_0x07e6('0x5d')],{'firstName':_0x1dadde[_0x07e6('0x5d')]['to'],'email':_0x1dadde[_0x07e6('0x5d')]['to'],'phone':_0x1dadde[_0x07e6('0x5d')]['to'],'ListId':_0x5ae603['ListId']}));}}else{throw new Error('List\x20not\x20found');}}})['then'](function(_0xe9cafb){if(_0xe9cafb){var _0x235f68={'UserId':_0x1dadde[_0x07e6('0x74')]['id'],'ContactId':_0xe9cafb['id'],'MailAccountId':_0x5ae603['id'],'inReplyTo':_0x8c4e9e[_0x07e6('0xac')],'to':_0x1dadde[_0x07e6('0x5d')][_0x07e6('0xa2')],'cc':_0x1dadde[_0x07e6('0x5d')]['cc'],'subject':_0x1dadde['body']['subject'],'attach':_0x1dadde['body']['attach'],'firstMsgDirection':_0x07e6('0xad'),'lastMsgAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':_0x07e6('0xad'),'Messages':[_[_0x07e6('0x51')](_0x1dadde[_0x07e6('0x5d')],{'messageId':_0x8c4e9e[_0x07e6('0xac')],'sentAt':moment()[_0x07e6('0x9b')](_0x07e6('0x9c')),'read':!![],'MailAccountId':_0x5ae603['id'],'UserId':_0x1dadde[_0x07e6('0x74')]['id'],'ContactId':_0xe9cafb['id']})]};if(_0x1dadde[_0x07e6('0x5d')][_0x07e6('0xae')]){_0x235f68=_[_0x07e6('0x51')](_0x235f68,_0x1dadde[_0x07e6('0x5d')][_0x07e6('0xae')]);}return db['MailInteraction'][_0x07e6('0x62')](_0x235f68,{'include':[{'model':db[_0x07e6('0x98')],'as':_0x07e6('0xaf')}]});}})[_0x07e6('0x35')](respondWithResult(_0x27121c,null))[_0x07e6('0x2a')](handleError(_0x27121c,null));};exports[_0x07e6('0xb0')]=function(_0x886ef3,_0x44a8f6,_0x5ae54a){return db[_0x07e6('0x42')]['find']({'where':{'id':_0x886ef3[_0x07e6('0x57')]['id']},'include':[{'model':db[_0x07e6('0x58')],'as':_0x07e6('0x3e'),'raw':!![]}]})[_0x07e6('0x35')](handleEntityNotFound(_0x44a8f6,null))['then'](function(_0x21315e){if(_0x21315e&&_0x21315e[_0x07e6('0x3e')]){var _0x1361dd={'id':_0x21315e['id'],'tls':{'rejectUnauthorized':![]}};if(_0x21315e[_0x07e6('0x3e')][_0x07e6('0x7b')]){_0x1361dd[_0x07e6('0x7b')]=_0x21315e['Smtp']['service'];}else{_0x1361dd['host']=_0x21315e[_0x07e6('0x3e')]['host'];_0x1361dd[_0x07e6('0x7a')]=_0x21315e['Smtp'][_0x07e6('0x7a')];_0x1361dd[_0x07e6('0xa8')]=_0x21315e[_0x07e6('0x3e')][_0x07e6('0xa8')];}if(_0x21315e[_0x07e6('0x3e')]['authentication']){_0x1361dd[_0x07e6('0xa7')]={'user':_0x21315e[_0x07e6('0x3e')]['user'],'pass':_0x21315e[_0x07e6('0x3e')]['pass']};}return respondWithRpcPromise(_0x07e6('0xb1'),_0x07e6('0xb0'),{'account':_0x1361dd});}})[_0x07e6('0x35')](respondWithResult(_0x44a8f6,null))[_0x07e6('0x2a')](handleError(_0x44a8f6,null));};exports[_0x07e6('0x36')]=function(_0x242099,_0x24c11f){return db[_0x07e6('0x42')][_0x07e6('0x5c')]({'where':{'id':_0x242099[_0x07e6('0x57')]['id']}})[_0x07e6('0x35')](handleEntityNotFound(_0x24c11f,null))[_0x07e6('0x35')](function(_0x44c21d){if(_0x44c21d&&_0x44c21d['service']){throw new db[(_0x07e6('0xb2'))][(_0x07e6('0xb3'))](_0x07e6('0xb4'));}return _0x44c21d;})[_0x07e6('0x35')](removeEntity(_0x24c11f,null))['catch'](handleError(_0x24c11f,null));};exports['addAgents']=function(_0x3d858b,_0x13b5d9,_0x58206b){return db[_0x07e6('0x42')]['find']({'where':{'id':_0x3d858b[_0x07e6('0x57')]['id']}})[_0x07e6('0x35')](handleEntityNotFound(_0x13b5d9,null))[_0x07e6('0x35')](function(_0x44f3a4){if(_0x44f3a4){return _0x44f3a4['addAgents'](_0x3d858b[_0x07e6('0x5d')][_0x07e6('0x68')],_[_0x07e6('0xb5')](_0x3d858b[_0x07e6('0x5d')],[_0x07e6('0x68'),'id'])||{})[_0x07e6('0xb6')](function(_0x5ed699){for(var _0x1996fe=0x0;_0x1996fe<_0x3d858b[_0x07e6('0x5d')][_0x07e6('0x68')][_0x07e6('0x5a')];_0x1996fe+=0x1){socket[_0x07e6('0xb7')](_0x07e6('0xb8'),{'UserId':Number(_0x3d858b[_0x07e6('0x5d')][_0x07e6('0x68')][_0x1996fe]),'MailAccountId':Number(_0x3d858b[_0x07e6('0x57')]['id'])});}return _0x5ed699;});}})[_0x07e6('0x35')](respondWithResult(_0x13b5d9,null))[_0x07e6('0x2a')](handleError(_0x13b5d9,null));};exports[_0x07e6('0xb9')]=function(_0x2f7e38,_0x1ac489,_0x2e8c0d){return db[_0x07e6('0x42')][_0x07e6('0x5c')]({'where':{'id':_0x2f7e38['params']['id']}})[_0x07e6('0x35')](handleEntityNotFound(_0x1ac489,null))[_0x07e6('0x35')](function(_0x42a83a){if(_0x42a83a){return _0x42a83a[_0x07e6('0xb9')](_0x2f7e38[_0x07e6('0x47')][_0x07e6('0x68')])[_0x07e6('0x35')](function(){if(_[_0x07e6('0xba')](_0x2f7e38[_0x07e6('0x47')][_0x07e6('0x68')])){for(var _0x567e3d=0x0;_0x567e3d<_0x2f7e38['query']['ids'][_0x07e6('0x5a')];_0x567e3d+=0x1){socket[_0x07e6('0xb7')](_0x07e6('0xbb'),{'UserId':Number(_0x2f7e38[_0x07e6('0x47')][_0x07e6('0x68')][_0x567e3d]),'MailAccountId':Number(_0x2f7e38[_0x07e6('0x57')]['id'])});}}else{socket[_0x07e6('0xb7')](_0x07e6('0xbb'),{'UserId':Number(_0x2f7e38[_0x07e6('0x47')]['ids']),'MailAccountId':Number(_0x2f7e38[_0x07e6('0x57')]['id'])});}});}})[_0x07e6('0x35')](respondWithStatusCode(_0x1ac489,null))[_0x07e6('0x2a')](handleError(_0x1ac489,null));};exports['getAgents']=function(_0x1f5039,_0x139a0e,_0x3c1179){var _0x22256e={};var _0x749e5b={};var _0x3494c2;var _0x4e6eb5;return db[_0x07e6('0x42')][_0x07e6('0x64')]({'where':{'id':_0x1f5039[_0x07e6('0x57')]['id']}})[_0x07e6('0x35')](handleEntityNotFound(_0x139a0e,null))[_0x07e6('0x35')](function(_0x4be3d2){if(_0x4be3d2){_0x3494c2=_0x4be3d2;_0x749e5b[_0x07e6('0x46')]=_[_0x07e6('0x48')](db[_0x07e6('0xbc')]['rawAttributes']);_0x749e5b[_0x07e6('0x47')]=_[_0x07e6('0x48')](_0x1f5039[_0x07e6('0x47')]);_0x749e5b[_0x07e6('0x4f')]=_[_0x07e6('0x49')](_0x749e5b[_0x07e6('0x46')],_0x749e5b['query']);_0x22256e[_0x07e6('0x4a')]=_[_0x07e6('0x49')](_0x749e5b['model'],qs[_0x07e6('0x59')](_0x1f5039[_0x07e6('0x47')][_0x07e6('0x59')]));_0x22256e[_0x07e6('0x4a')]=_0x22256e[_0x07e6('0x4a')]['length']?_0x22256e['attributes']:_0x749e5b[_0x07e6('0x46')];_0x22256e[_0x07e6('0x65')]=qs[_0x07e6('0x4d')](_0x1f5039[_0x07e6('0x47')][_0x07e6('0x4d')]);_0x22256e[_0x07e6('0x4e')]=qs[_0x07e6('0x4f')](_[_0x07e6('0x66')](_0x1f5039['query'],_0x749e5b['filters']));if(_0x1f5039['query']['filter']){_0x22256e[_0x07e6('0x4e')]=_['merge'](_0x22256e[_0x07e6('0x4e')],{'$or':_[_0x07e6('0x41')](_0x22256e[_0x07e6('0x4a')],function(_0xb4cb2b){var _0x12f0ce={};_0x12f0ce[_0xb4cb2b]={'$like':'%'+_0x1f5039[_0x07e6('0x47')][_0x07e6('0x50')]+'%'};return _0x12f0ce;})});}_0x22256e=_[_0x07e6('0x51')]({},_0x22256e,_0x1f5039[_0x07e6('0x53')]);return _0x3494c2['getAgents'](_0x22256e);}})[_0x07e6('0x35')](function(_0x2ba256){if(_0x2ba256){_0x4e6eb5=_0x2ba256[_0x07e6('0x5a')];if(!_0x1f5039[_0x07e6('0x47')][_0x07e6('0x4b')](_0x07e6('0x4c'))){_0x22256e[_0x07e6('0x2f')]=qs[_0x07e6('0x2f')](_0x1f5039['query'][_0x07e6('0x2f')]);_0x22256e['offset']=qs[_0x07e6('0x31')](_0x1f5039[_0x07e6('0x47')]['offset']);}return _0x3494c2[_0x07e6('0xbd')](_0x22256e);}})[_0x07e6('0x35')](function(_0x27307c){if(_0x27307c){return _0x27307c?{'count':_0x4e6eb5,'rows':_0x27307c}:null;}})[_0x07e6('0x35')](respondWithResult(_0x139a0e,null))[_0x07e6('0x2a')](handleError(_0x139a0e,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index c488c83..527b37f 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 _0xb1ad=['MailAccount','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x459423,_0x3416a8){var _0x42ed14=function(_0x1d4f69){while(--_0x1d4f69){_0x459423['push'](_0x459423['shift']());}};_0x42ed14(++_0x3416a8);}(_0xb1ad,0x184));var _0xdb1a=function(_0x1abb09,_0x18ee91){_0x1abb09=_0x1abb09-0x0;var _0xea1c07=_0xb1ad[_0x1abb09];return _0xea1c07;};'use strict';var EventEmitter=require(_0xdb1a('0x0'));var MailAccount=require(_0xdb1a('0x1'))['db'][_0xdb1a('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0xdb1a('0x3')](0x0);var events={'afterCreate':_0xdb1a('0x4'),'afterUpdate':_0xdb1a('0x5'),'afterDestroy':'remove'};function emitEvent(_0x1a0d04){return function(_0x15cb4f,_0x24b01f,_0x10b9c1){MailAccountEvents[_0xdb1a('0x6')](_0x1a0d04+':'+_0x15cb4f['id'],_0x15cb4f);MailAccountEvents[_0xdb1a('0x6')](_0x1a0d04,_0x15cb4f);_0x10b9c1(null);};}for(var e in events){if(events[_0xdb1a('0x7')](e)){var event=events[e];MailAccount[_0xdb1a('0x8')](e,emitEvent(event));}}module[_0xdb1a('0x9')]=MailAccountEvents; \ No newline at end of file +var _0xd634=['emit','hasOwnProperty','hook','exports','../../mysqldb','MailAccount','update','remove'];(function(_0xd6314a,_0x683bf1){var _0xc76b30=function(_0x1149b4){while(--_0x1149b4){_0xd6314a['push'](_0xd6314a['shift']());}};_0xc76b30(++_0x683bf1);}(_0xd634,0xf4));var _0x4d63=function(_0x687ddc,_0x2092fa){_0x687ddc=_0x687ddc-0x0;var _0x441991=_0xd634[_0x687ddc];return _0x441991;};'use strict';var EventEmitter=require('events');var MailAccount=require(_0x4d63('0x0'))['db'][_0x4d63('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x4d63('0x2'),'afterDestroy':_0x4d63('0x3')};function emitEvent(_0x478b56){return function(_0x4f99ac,_0x2b8d62,_0x35ba45){MailAccountEvents[_0x4d63('0x4')](_0x478b56+':'+_0x4f99ac['id'],_0x4f99ac);MailAccountEvents[_0x4d63('0x4')](_0x478b56,_0x4f99ac);_0x35ba45(null);};}for(var e in events){if(events[_0x4d63('0x5')](e)){var event=events[e];MailAccount[_0x4d63('0x6')](e,emitEvent(event));}}module[_0x4d63('0x7')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index 50c2eef..04c9959 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 _0xa0f4=['request-promise','path','rimraf','../../config/environment','./mailAccount.attributes','exports','define','MailAccount','mail_accounts','api'];(function(_0x1b1f88,_0x3fe1cb){var _0x5045b9=function(_0x5c1367){while(--_0x5c1367){_0x1b1f88['push'](_0x1b1f88['shift']());}};_0x5045b9(++_0x3fe1cb);}(_0xa0f4,0x1ad));var _0x4a0f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa0f4[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x4a0f('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x4a0f('0x1'));var fs=require('fs');var path=require(_0x4a0f('0x2'));var rimraf=require(_0x4a0f('0x3'));var config=require(_0x4a0f('0x4'));var attributes=require(_0x4a0f('0x5'));module[_0x4a0f('0x6')]=function(_0x325aa8,_0x305a9c){return _0x325aa8[_0x4a0f('0x7')](_0x4a0f('0x8'),attributes,{'tableName':_0x4a0f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf3c2=['exports','MailAccount','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x3771c2,_0x280bfb){var _0x36ec3d=function(_0x317997){while(--_0x317997){_0x3771c2['push'](_0x3771c2['shift']());}};_0x36ec3d(++_0x280bfb);}(_0xf3c2,0x134));var _0x2f3c=function(_0x438db6,_0x3f57b4){_0x438db6=_0x438db6-0x0;var _0x4b98ac=_0xf3c2[_0x438db6];return _0x4b98ac;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2f3c('0x0'))(_0x2f3c('0x1'));var moment=require(_0x2f3c('0x2'));var BPromise=require(_0x2f3c('0x3'));var rp=require(_0x2f3c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2f3c('0x5'));var config=require(_0x2f3c('0x6'));var attributes=require('./mailAccount.attributes');module[_0x2f3c('0x7')]=function(_0x24abe7,_0x4730cc){return _0x24abe7['define'](_0x2f3c('0x8'),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 fd4148d..7566be1 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 _0xe505=['include','model','map','then','ShowMailAccount','body','mail','rawAttributes','createdAt','updatedAt','ListId','isNil','from','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','account','CmList','List','CmContact','DESC','MailApplication','MailServerOut','Smtp','get','omit','list','applications','priority','asc','autoclose','push','length','close','*,*,*,*','Contacts','create','contact','generate','messageId','subject','attach','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','find','MailMessage','Messages','inReplyTo','Contact\x20not\x20found','spread','update','format','interaction','created','originCc','ChatOfflineMessageId','Attachment','Attachments','UserId','agent','name','Start','startRouting','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','request','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetMailAccount','findAll','options','raw','where','attributes','limit'];(function(_0x238c72,_0x42d60b){var _0x3961f2=function(_0xc40492){while(--_0xc40492){_0x238c72['push'](_0x238c72['shift']());}};_0x3961f2(++_0x42d60b);}(_0xe505,0x105));var _0x5e50=function(_0x98ee7c,_0x499bff){_0x98ee7c=_0x98ee7c-0x0;var _0xe4d709=_0xe505[_0x98ee7c];return _0xe4d709;};'use strict';var _=require('lodash');var util=require(_0x5e50('0x0'));var moment=require('moment');var BPromise=require(_0x5e50('0x1'));var rs=require(_0x5e50('0x2'));var fs=require('fs');var Redis=require(_0x5e50('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5e50('0x4'));var logger=require(_0x5e50('0x5'))(_0x5e50('0x6'));var config=require(_0x5e50('0x7'));var jayson=require(_0x5e50('0x8'));var client=jayson[_0x5e50('0x9')][_0x5e50('0xa')]({'port':0x232c});config[_0x5e50('0xb')]=_[_0x5e50('0xc')](config[_0x5e50('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x5e50('0xd'))(new Redis(config[_0x5e50('0xb')]));require('./mailAccount.socket')[_0x5e50('0xe')](socket);function respondWithRpcPromise(_0xd1bc9e,_0x541621,_0x445b2e){return new BPromise(function(_0x228194,_0x2a832d){return client[_0x5e50('0xf')](_0xd1bc9e,_0x445b2e)['then'](function(_0x3dc1a9){logger[_0x5e50('0x10')](_0x5e50('0x11'),_0x541621,_0x5e50('0x12'));logger[_0x5e50('0x13')](_0x5e50('0x14'),_0x541621,'request\x20sent',JSON[_0x5e50('0x15')](_0x3dc1a9));if(_0x3dc1a9['error']){if(_0x3dc1a9[_0x5e50('0x16')][_0x5e50('0x17')]===0x1f4){logger['error'](_0x5e50('0x11'),_0x541621,_0x3dc1a9[_0x5e50('0x16')][_0x5e50('0x18')]);return _0x2a832d(_0x3dc1a9[_0x5e50('0x16')][_0x5e50('0x18')]);}logger[_0x5e50('0x16')](_0x5e50('0x11'),_0x541621,_0x3dc1a9[_0x5e50('0x16')][_0x5e50('0x18')]);return _0x228194(_0x3dc1a9[_0x5e50('0x16')][_0x5e50('0x18')]);}else{logger[_0x5e50('0x10')](_0x5e50('0x11'),_0x541621,'request\x20sent');_0x228194(_0x3dc1a9['result']['message']);}})[_0x5e50('0x19')](function(_0x56f150){logger[_0x5e50('0x16')]('MailAccount,\x20%s,\x20%s',_0x541621,_0x56f150);_0x2a832d(_0x56f150);});});}exports[_0x5e50('0x1a')]=function(_0x3eb5a2){var _0x33c680=this;return new Promise(function(_0x264494,_0x1c7dee){return db['MailAccount'][_0x5e50('0x1b')]({'raw':_0x3eb5a2[_0x5e50('0x1c')]?_0x3eb5a2['options'][_0x5e50('0x1d')]===undefined?!![]:![]:!![],'where':_0x3eb5a2[_0x5e50('0x1c')]?_0x3eb5a2['options'][_0x5e50('0x1e')]||null:null,'attributes':_0x3eb5a2['options']?_0x3eb5a2['options'][_0x5e50('0x1f')]||null:null,'limit':_0x3eb5a2[_0x5e50('0x1c')]?_0x3eb5a2[_0x5e50('0x1c')][_0x5e50('0x20')]||null:null,'include':_0x3eb5a2[_0x5e50('0x1c')]?_0x3eb5a2[_0x5e50('0x1c')][_0x5e50('0x21')]?_['map'](_0x3eb5a2['options'][_0x5e50('0x21')],function(_0x411a9a){return{'model':db[_0x411a9a[_0x5e50('0x22')]],'as':_0x411a9a['as'],'attributes':_0x411a9a['attributes'],'include':_0x411a9a[_0x5e50('0x21')]?_[_0x5e50('0x23')](_0x411a9a[_0x5e50('0x21')],function(_0x2a5d11){return{'model':db[_0x2a5d11['model']],'as':_0x2a5d11['as'],'attributes':_0x2a5d11[_0x5e50('0x1f')],'include':_0x2a5d11[_0x5e50('0x21')]?_['map'](_0x2a5d11[_0x5e50('0x21')],function(_0xc76277){return{'model':db[_0xc76277['model']],'as':_0xc76277['as'],'attributes':_0xc76277[_0x5e50('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x5e50('0x24')](function(_0x1abf0a){logger[_0x5e50('0x10')](_0x5e50('0x1a'),_0x3eb5a2);logger[_0x5e50('0x13')](_0x5e50('0x1a'),_0x3eb5a2,JSON[_0x5e50('0x15')](_0x1abf0a));_0x264494(_0x1abf0a);})[_0x5e50('0x19')](function(_0x3aefda){logger[_0x5e50('0x16')](_0x5e50('0x1a'),_0x3aefda[_0x5e50('0x18')],_0x3eb5a2);_0x1c7dee(_0x33c680[_0x5e50('0x16')](0x1f4,_0x3aefda[_0x5e50('0x18')]));});});};exports[_0x5e50('0x25')]=function(_0xe65a49){var _0x5bf8d5=this;return new Promise(function(_0x3130a8,_0x5f085c){return db['MailAccount']['find']({'raw':_0xe65a49[_0x5e50('0x1c')]?_0xe65a49[_0x5e50('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0xe65a49['options']?_0xe65a49['options']['where']||null:null,'attributes':_0xe65a49[_0x5e50('0x1c')]?_0xe65a49[_0x5e50('0x1c')]['attributes']||null:null,'include':_0xe65a49[_0x5e50('0x1c')]?_0xe65a49[_0x5e50('0x1c')][_0x5e50('0x21')]?_[_0x5e50('0x23')](_0xe65a49[_0x5e50('0x1c')][_0x5e50('0x21')],function(_0x25ddd7){return{'model':db[_0x25ddd7[_0x5e50('0x22')]],'as':_0x25ddd7['as'],'attributes':_0x25ddd7[_0x5e50('0x1f')],'include':_0x25ddd7[_0x5e50('0x21')]?_[_0x5e50('0x23')](_0x25ddd7['include'],function(_0x14b3d4){return{'model':db[_0x14b3d4['model']],'as':_0x14b3d4['as'],'attributes':_0x14b3d4[_0x5e50('0x1f')],'include':_0x14b3d4[_0x5e50('0x21')]?_[_0x5e50('0x23')](_0x14b3d4[_0x5e50('0x21')],function(_0x4b015a){return{'model':db[_0x4b015a['model']],'as':_0x4b015a['as'],'attributes':_0x4b015a[_0x5e50('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x5e50('0x24')](function(_0x43ed85){logger['info'](_0x5e50('0x25'),_0xe65a49);logger[_0x5e50('0x13')](_0x5e50('0x25'),_0xe65a49,JSON[_0x5e50('0x15')](_0x43ed85));_0x3130a8(_0x43ed85);})[_0x5e50('0x19')](function(_0x51e4fa){logger[_0x5e50('0x16')]('ShowMailAccount',_0x51e4fa[_0x5e50('0x18')],_0xe65a49);_0x5f085c(_0x5bf8d5['error'](0x1f4,_0x51e4fa[_0x5e50('0x18')]));});});};exports['NotifyMailAccount']=function(_0x5b0e76){var _0x257f2c=this;return new Promise(function(_0x3cf304,_0x268fcb){var _0x42cbe7={'body':_0x5b0e76[_0x5e50('0x26')],'channel':_0x5e50('0x27')};var _0x3e00d0=_['difference'](_['keys'](db['CmContact'][_0x5e50('0x28')]),[_0x5e50('0x29'),_0x5e50('0x2a'),'CompanyId',_0x5e50('0x2b')]);var _0x465ffb=![];if(_0x5b0e76[_0x5e50('0x26')]['id']){delete _0x5b0e76['body']['id'];}if(_[_0x5e50('0x2c')](_0x5b0e76[_0x5e50('0x26')][_0x5e50('0x2d')])){return _0x268fcb(_0x257f2c[_0x5e50('0x16')](0x1f4,'from\x20is\x20mandatory'));}if(_[_0x5e50('0x2c')](_0x5b0e76[_0x5e50('0x26')]['body'])||_0x5b0e76[_0x5e50('0x26')][_0x5e50('0x26')]===''){return _0x268fcb(_0x257f2c['error'](0x1f4,'body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x5e50('0x2c')](_0x5b0e76[_0x5e50('0x26')]['mapKey'])){return _0x268fcb(_0x257f2c[_0x5e50('0x16')](0x1f4,_0x5e50('0x2e')+_0x3e00d0));}if(!_[_0x5e50('0x2f')](_0x3e00d0,_0x5b0e76[_0x5e50('0x26')][_0x5e50('0x30')])){return _0x268fcb(_0x257f2c[_0x5e50('0x16')](0x1f4,_0x5e50('0x31')+_0x3e00d0));}var _0x407e2d={};_0x407e2d[_0x5b0e76[_0x5e50('0x26')][_0x5e50('0x30')]]=_0x5b0e76[_0x5e50('0x26')][_0x5e50('0x2d')];return db[_0x5e50('0x32')]['find']({'where':{'id':_0x5b0e76[_0x5e50('0x33')]['id']},'include':[{'model':db[_0x5e50('0x34')],'as':_0x5e50('0x35'),'include':[{'model':db[_0x5e50('0x36')],'as':'Contacts','where':_0x407e2d,'limit':0x1,'order':[[_0x5e50('0x2a'),_0x5e50('0x37')]]}]},{'model':db[_0x5e50('0x38')],'as':'Applications'},{'model':db[_0x5e50('0x39')],'as':_0x5e50('0x3a')}]})[_0x5e50('0x24')](function(_0x584b27){if(_0x584b27&&_0x584b27[_0x5e50('0x35')]){var _0x11b8b4=_0x584b27[_0x5e50('0x3b')]({'plain':!![]});_0x42cbe7[_0x5e50('0x33')]=_[_0x5e50('0x3c')](_0x11b8b4,['Applications',_0x5e50('0x35')]);_0x42cbe7['applications']=_0x11b8b4['Applications'];_0x42cbe7[_0x5e50('0x3d')]=_0x11b8b4[_0x5e50('0x35')];_0x42cbe7[_0x5e50('0x3e')]=_['orderBy'](_0x42cbe7[_0x5e50('0x3e')],[_0x5e50('0x3f')],[_0x5e50('0x40')]);if(_0x42cbe7['account']&&_0x42cbe7[_0x5e50('0x33')][_0x5e50('0x41')]){_0x42cbe7[_0x5e50('0x3e')][_0x5e50('0x42')]({'id':0x0,'priority':_0x42cbe7[_0x5e50('0x3e')][_0x5e50('0x43')]+0x1,'app':_0x5e50('0x44'),'appdata':_0x5e50('0x41'),'interval':_0x5e50('0x45')});}if(_0x42cbe7['account']['Applications']){delete _0x42cbe7['account']['Applications'];}if(_0x42cbe7[_0x5e50('0x33')]['List']){delete _0x42cbe7[_0x5e50('0x33')][_0x5e50('0x35')];}if(_0x11b8b4[_0x5e50('0x35')]['Contacts'][_0x5e50('0x43')]){return _0x11b8b4[_0x5e50('0x35')][_0x5e50('0x46')][0x0];}var _0x58204d=_[_0x5e50('0xc')](_0x5b0e76[_0x5e50('0x26')],{'firstName':_0x5b0e76['body'][_0x5e50('0x2d')],'ListId':_0x11b8b4[_0x5e50('0x2b')]});_0x58204d[_0x5b0e76[_0x5e50('0x26')][_0x5e50('0x30')]]=_0x5b0e76[_0x5e50('0x26')][_0x5e50('0x2d')];return db[_0x5e50('0x36')][_0x5e50('0x47')](_0x58204d);}else{throw new Error('List\x20not\x20found');}})['then'](function(_0x5de77a){_0x42cbe7[_0x5e50('0x48')]=_0x5de77a;if(_0x5de77a){if(!_0x5b0e76['body'][_0x5e50('0x18')]['messageId']){_0x5b0e76['body']['message']['messageId']=rs[_0x5e50('0x49')]()+'\x20'+_0x5b0e76[_0x5e50('0x26')][_0x5e50('0x18')][_0x5e50('0x2d')];}var _0x10f8a2={'ContactId':_0x5de77a['id'],'MailAccountId':_0x5b0e76[_0x5e50('0x33')]['id'],'inReplyTo':_0x5b0e76['body'][_0x5e50('0x18')][_0x5e50('0x4a')],'to':_0x5b0e76[_0x5e50('0x26')][_0x5e50('0x18')][_0x5e50('0x2d')],'cc':_0x5b0e76[_0x5e50('0x26')]['message']['cc'],'subject':_0x5b0e76[_0x5e50('0x26')][_0x5e50('0x18')][_0x5e50('0x4b')],'attach':_0x5b0e76[_0x5e50('0x26')][_0x5e50('0x18')][_0x5e50('0x4c')],'lastMsgAt':moment()['format'](_0x5e50('0x4d')),'lastMsgDirection':'in'};return db[_0x5e50('0x4e')][_0x5e50('0x4f')]({'where':{'closed':![],'MailAccountId':_0x5b0e76[_0x5e50('0x33')]['id']},'include':[{'model':db[_0x5e50('0x50')],'as':_0x5e50('0x51'),'attributes':[_0x5e50('0x4a')],'where':{'messageId':_0x5b0e76['body'][_0x5e50('0x18')][_0x5e50('0x52')]}}]})[_0x5e50('0x24')](function(_0x52c9e4){if(_0x52c9e4){return[_0x52c9e4,![]];}return db[_0x5e50('0x4e')][_0x5e50('0x47')](_0x10f8a2)[_0x5e50('0x24')](function(_0xd701b0){return[_0xd701b0,!![]];});});}else{throw new Error(_0x5e50('0x53'));}})[_0x5e50('0x54')](function(_0x4ef37d,_0x43590d){if(_0x4ef37d){_0x465ffb=_0x43590d;if(!_0x43590d){return _0x4ef37d[_0x5e50('0x55')]({'inReplyTo':_0x5b0e76[_0x5e50('0x26')][_0x5e50('0x18')][_0x5e50('0x4a')],'to':_0x5b0e76[_0x5e50('0x26')][_0x5e50('0x18')][_0x5e50('0x2d')],'cc':_0x5b0e76[_0x5e50('0x26')][_0x5e50('0x18')]['cc'],'subject':_0x5b0e76[_0x5e50('0x26')][_0x5e50('0x18')][_0x5e50('0x4b')],'attach':_0x4ef37d[_0x5e50('0x4c')]?_0x4ef37d[_0x5e50('0x4c')]:_0x5b0e76['body'][_0x5e50('0x18')][_0x5e50('0x4c')],'substatus':null,'substatusAt':moment()[_0x5e50('0x56')](_0x5e50('0x4d')),'lastMsgAt':moment()[_0x5e50('0x56')](_0x5e50('0x4d')),'lastMsgDirection':'in'});}else{return _0x4ef37d;}}})['then'](function(_0x5afe89){_0x42cbe7[_0x5e50('0x57')]=_0x5afe89[_0x5e50('0x3b')]({'plain':!![]});_0x42cbe7['interaction'][_0x5e50('0x58')]=_0x465ffb;return db[_0x5e50('0x50')][_0x5e50('0x47')]({'body':_0x5b0e76[_0x5e50('0x26')][_0x5e50('0x26')],'MailAccountId':_0x5b0e76[_0x5e50('0x33')]['id'],'MailInteractionId':_0x5afe89['id'],'direction':'in','ContactId':_0x42cbe7[_0x5e50('0x48')]['id'],'messageId':_0x5b0e76[_0x5e50('0x26')]['message'][_0x5e50('0x4a')],'from':_0x5b0e76['body'][_0x5e50('0x18')][_0x5e50('0x2d')],'to':_0x5b0e76['body'][_0x5e50('0x18')]['to'],'cc':_0x5b0e76['body'][_0x5e50('0x18')]['cc'],'subject':_0x5b0e76[_0x5e50('0x26')][_0x5e50('0x18')][_0x5e50('0x4b')],'attach':_0x5b0e76[_0x5e50('0x26')]['message'][_0x5e50('0x4c')],'Attachments':_0x5b0e76['body'][_0x5e50('0x18')]['attachments'],'originTo':_0x5b0e76['body'][_0x5e50('0x18')]['originTo'],'originCc':_0x5b0e76[_0x5e50('0x26')][_0x5e50('0x18')][_0x5e50('0x59')],'bcc':_0x5b0e76[_0x5e50('0x26')][_0x5e50('0x18')]['bcc'],'ChatWebsiteId':_0x5b0e76[_0x5e50('0x26')][_0x5e50('0x18')]['ChatWebsiteId']||null,'originChannel':_0x5b0e76['body'][_0x5e50('0x18')]['originChannel']||'Email','ChatOfflineMessageId':_0x5b0e76[_0x5e50('0x26')][_0x5e50('0x18')][_0x5e50('0x5a')]||null},{'include':[{'model':db[_0x5e50('0x5b')],'as':_0x5e50('0x5c')}]});})[_0x5e50('0x24')](function(_0x475b48){_0x42cbe7['message']=_0x475b48;if(_0x42cbe7[_0x5e50('0x57')][_0x5e50('0x5d')]){return db['User'][_0x5e50('0x4f')]({'attributes':['id','name'],'where':{'id':_0x42cbe7[_0x5e50('0x57')]['UserId']}})[_0x5e50('0x24')](function(_0x2a6a78){if(_0x2a6a78){_0x42cbe7[_0x5e50('0x3e')]['unshift']({'id':0x0,'priority':0x0,'app':_0x5e50('0x5e'),'appdata':_0x2a6a78[_0x5e50('0x5f')]+','+(_0x42cbe7[_0x5e50('0x33')]['waitForTheAssignedAgent']||0xa),'interval':_0x5e50('0x45')});}return respondWithRpcPromise(_0x5e50('0x60'),_0x5e50('0x61'),_0x42cbe7);});}return respondWithRpcPromise(_0x5e50('0x60'),_0x5e50('0x61'),_0x42cbe7);})['then'](function(_0x55c7fb){_0x3cf304(_0x55c7fb);})[_0x5e50('0x19')](function(_0x358150){_0x268fcb(_0x257f2c[_0x5e50('0x16')](0x1f4,_0x358150['message']));});});}; \ No newline at end of file +var _0x0507=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','register','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','MailAccount','findAll','options','raw','where','attributes','limit','include','map','model','GetMailAccount','ShowMailAccount','find','stringify','mail','difference','keys','CmContact','rawAttributes','createdAt','body','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','List','Contacts','updatedAt','DESC','MailApplication','Smtp','omit','Applications','list','applications','orderBy','asc','autoclose','length','close','*,*,*,*','ListId','from','create','messageId','generate','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailMessage','Messages','inReplyTo','MailInteraction','Contact\x20not\x20found','subject','get','interaction','created','contact','attachments','originTo','originCc','ChatWebsiteId','originChannel','ChatOfflineMessageId','Attachment','Attachments','UserId','User','unshift','name','waitForTheAssignedAgent','Start','startRouting','util'];(function(_0x37356a,_0x4c542d){var _0x4771ee=function(_0x1a4b22){while(--_0x1a4b22){_0x37356a['push'](_0x37356a['shift']());}};_0x4771ee(++_0x4c542d);}(_0x0507,0x66));var _0x7050=function(_0x351714,_0x4bc362){_0x351714=_0x351714-0x0;var _0x3605f8=_0x0507[_0x351714];return _0x3605f8;};'use strict';var _=require('lodash');var util=require(_0x7050('0x0'));var moment=require(_0x7050('0x1'));var BPromise=require(_0x7050('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7050('0x3'));var db=require(_0x7050('0x4'))['db'];var utils=require(_0x7050('0x5'));var logger=require(_0x7050('0x6'))(_0x7050('0x7'));var config=require(_0x7050('0x8'));var jayson=require(_0x7050('0x9'));var client=jayson['client'][_0x7050('0xa')]({'port':0x232c});config[_0x7050('0xb')]=_[_0x7050('0xc')](config[_0x7050('0xb')],{'host':_0x7050('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./mailAccount.socket')[_0x7050('0xe')](socket);function respondWithRpcPromise(_0x59c0a6,_0x2cc49d,_0x58ea29){return new BPromise(function(_0x3f07ae,_0x52c574){return client[_0x7050('0xf')](_0x59c0a6,_0x58ea29)[_0x7050('0x10')](function(_0x32fa4e){logger[_0x7050('0x11')](_0x7050('0x12'),_0x2cc49d,_0x7050('0x13'));logger[_0x7050('0x14')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x2cc49d,'request\x20sent',JSON['stringify'](_0x32fa4e));if(_0x32fa4e[_0x7050('0x15')]){if(_0x32fa4e[_0x7050('0x15')][_0x7050('0x16')]===0x1f4){logger[_0x7050('0x15')](_0x7050('0x12'),_0x2cc49d,_0x32fa4e[_0x7050('0x15')][_0x7050('0x17')]);return _0x52c574(_0x32fa4e[_0x7050('0x15')]['message']);}logger[_0x7050('0x15')](_0x7050('0x12'),_0x2cc49d,_0x32fa4e['error'][_0x7050('0x17')]);return _0x3f07ae(_0x32fa4e[_0x7050('0x15')][_0x7050('0x17')]);}else{logger['info']('MailAccount,\x20%s,\x20%s',_0x2cc49d,_0x7050('0x13'));_0x3f07ae(_0x32fa4e[_0x7050('0x18')][_0x7050('0x17')]);}})[_0x7050('0x19')](function(_0x29bb6a){logger[_0x7050('0x15')](_0x7050('0x12'),_0x2cc49d,_0x29bb6a);_0x52c574(_0x29bb6a);});});}exports['GetMailAccount']=function(_0x60e18a){var _0x2189f6=this;return new Promise(function(_0xbc65de,_0x4c0035){return db[_0x7050('0x1a')][_0x7050('0x1b')]({'raw':_0x60e18a[_0x7050('0x1c')]?_0x60e18a[_0x7050('0x1c')][_0x7050('0x1d')]===undefined?!![]:![]:!![],'where':_0x60e18a[_0x7050('0x1c')]?_0x60e18a[_0x7050('0x1c')][_0x7050('0x1e')]||null:null,'attributes':_0x60e18a[_0x7050('0x1c')]?_0x60e18a[_0x7050('0x1c')][_0x7050('0x1f')]||null:null,'limit':_0x60e18a['options']?_0x60e18a['options'][_0x7050('0x20')]||null:null,'include':_0x60e18a[_0x7050('0x1c')]?_0x60e18a[_0x7050('0x1c')][_0x7050('0x21')]?_[_0x7050('0x22')](_0x60e18a[_0x7050('0x1c')][_0x7050('0x21')],function(_0x4e67f6){return{'model':db[_0x4e67f6[_0x7050('0x23')]],'as':_0x4e67f6['as'],'attributes':_0x4e67f6[_0x7050('0x1f')],'include':_0x4e67f6[_0x7050('0x21')]?_[_0x7050('0x22')](_0x4e67f6[_0x7050('0x21')],function(_0x5f0e72){return{'model':db[_0x5f0e72[_0x7050('0x23')]],'as':_0x5f0e72['as'],'attributes':_0x5f0e72[_0x7050('0x1f')],'include':_0x5f0e72[_0x7050('0x21')]?_['map'](_0x5f0e72[_0x7050('0x21')],function(_0x1fbfe3){return{'model':db[_0x1fbfe3[_0x7050('0x23')]],'as':_0x1fbfe3['as'],'attributes':_0x1fbfe3[_0x7050('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x7050('0x10')](function(_0x482233){logger[_0x7050('0x11')](_0x7050('0x24'),_0x60e18a);logger[_0x7050('0x14')](_0x7050('0x24'),_0x60e18a,JSON['stringify'](_0x482233));_0xbc65de(_0x482233);})[_0x7050('0x19')](function(_0x3fcb42){logger['error'](_0x7050('0x24'),_0x3fcb42['message'],_0x60e18a);_0x4c0035(_0x2189f6[_0x7050('0x15')](0x1f4,_0x3fcb42[_0x7050('0x17')]));});});};exports[_0x7050('0x25')]=function(_0x21703c){var _0x372f8a=this;return new Promise(function(_0x58e0bd,_0x14181f){return db[_0x7050('0x1a')][_0x7050('0x26')]({'raw':_0x21703c[_0x7050('0x1c')]?_0x21703c[_0x7050('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x21703c[_0x7050('0x1c')]?_0x21703c['options'][_0x7050('0x1e')]||null:null,'attributes':_0x21703c[_0x7050('0x1c')]?_0x21703c['options'][_0x7050('0x1f')]||null:null,'include':_0x21703c['options']?_0x21703c['options'][_0x7050('0x21')]?_['map'](_0x21703c[_0x7050('0x1c')]['include'],function(_0x5a3464){return{'model':db[_0x5a3464['model']],'as':_0x5a3464['as'],'attributes':_0x5a3464['attributes'],'include':_0x5a3464[_0x7050('0x21')]?_[_0x7050('0x22')](_0x5a3464[_0x7050('0x21')],function(_0x16f884){return{'model':db[_0x16f884['model']],'as':_0x16f884['as'],'attributes':_0x16f884[_0x7050('0x1f')],'include':_0x16f884[_0x7050('0x21')]?_[_0x7050('0x22')](_0x16f884['include'],function(_0x2417da){return{'model':db[_0x2417da[_0x7050('0x23')]],'as':_0x2417da['as'],'attributes':_0x2417da[_0x7050('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x7050('0x10')](function(_0x3e75d3){logger['info']('ShowMailAccount',_0x21703c);logger[_0x7050('0x14')]('ShowMailAccount',_0x21703c,JSON[_0x7050('0x27')](_0x3e75d3));_0x58e0bd(_0x3e75d3);})[_0x7050('0x19')](function(_0x437929){logger[_0x7050('0x15')](_0x7050('0x25'),_0x437929[_0x7050('0x17')],_0x21703c);_0x14181f(_0x372f8a[_0x7050('0x15')](0x1f4,_0x437929[_0x7050('0x17')]));});});};exports['NotifyMailAccount']=function(_0x3892b9){var _0x1467d9=this;return new Promise(function(_0xecc182,_0xc61cbe){var _0x28c2de={'body':_0x3892b9['body'],'channel':_0x7050('0x28')};var _0x17aa0c=_[_0x7050('0x29')](_[_0x7050('0x2a')](db[_0x7050('0x2b')][_0x7050('0x2c')]),[_0x7050('0x2d'),'updatedAt','CompanyId','ListId']);var _0x156506=![];if(_0x3892b9['body']['id']){delete _0x3892b9[_0x7050('0x2e')]['id'];}if(_[_0x7050('0x2f')](_0x3892b9[_0x7050('0x2e')]['from'])){return _0xc61cbe(_0x1467d9[_0x7050('0x15')](0x1f4,_0x7050('0x30')));}if(_[_0x7050('0x2f')](_0x3892b9[_0x7050('0x2e')][_0x7050('0x2e')])||_0x3892b9[_0x7050('0x2e')]['body']===''){return _0xc61cbe(_0x1467d9[_0x7050('0x15')](0x1f4,_0x7050('0x31')));}if(_['isNil'](_0x3892b9[_0x7050('0x2e')][_0x7050('0x32')])){return _0xc61cbe(_0x1467d9['error'](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x17aa0c));}if(!_[_0x7050('0x33')](_0x17aa0c,_0x3892b9['body']['mapKey'])){return _0xc61cbe(_0x1467d9[_0x7050('0x15')](0x1f4,_0x7050('0x34')+_0x17aa0c));}var _0x59d00a={};_0x59d00a[_0x3892b9[_0x7050('0x2e')][_0x7050('0x32')]]=_0x3892b9[_0x7050('0x2e')]['from'];return db[_0x7050('0x1a')][_0x7050('0x26')]({'where':{'id':_0x3892b9[_0x7050('0x35')]['id']},'include':[{'model':db['CmList'],'as':_0x7050('0x36'),'include':[{'model':db[_0x7050('0x2b')],'as':_0x7050('0x37'),'where':_0x59d00a,'limit':0x1,'order':[[_0x7050('0x38'),_0x7050('0x39')]]}]},{'model':db[_0x7050('0x3a')],'as':'Applications'},{'model':db['MailServerOut'],'as':_0x7050('0x3b')}]})[_0x7050('0x10')](function(_0x362867){if(_0x362867&&_0x362867[_0x7050('0x36')]){var _0x42956d=_0x362867['get']({'plain':!![]});_0x28c2de['account']=_[_0x7050('0x3c')](_0x42956d,['Applications',_0x7050('0x36')]);_0x28c2de['applications']=_0x42956d[_0x7050('0x3d')];_0x28c2de[_0x7050('0x3e')]=_0x42956d[_0x7050('0x36')];_0x28c2de[_0x7050('0x3f')]=_[_0x7050('0x40')](_0x28c2de['applications'],['priority'],[_0x7050('0x41')]);if(_0x28c2de[_0x7050('0x35')]&&_0x28c2de[_0x7050('0x35')][_0x7050('0x42')]){_0x28c2de[_0x7050('0x3f')]['push']({'id':0x0,'priority':_0x28c2de[_0x7050('0x3f')][_0x7050('0x43')]+0x1,'app':_0x7050('0x44'),'appdata':_0x7050('0x42'),'interval':_0x7050('0x45')});}if(_0x28c2de['account']['Applications']){delete _0x28c2de['account'][_0x7050('0x3d')];}if(_0x28c2de[_0x7050('0x35')][_0x7050('0x36')]){delete _0x28c2de[_0x7050('0x35')]['List'];}if(_0x42956d[_0x7050('0x36')][_0x7050('0x37')][_0x7050('0x43')]){return _0x42956d[_0x7050('0x36')][_0x7050('0x37')][0x0];}var _0x3b1306=_[_0x7050('0xc')](_0x3892b9[_0x7050('0x2e')],{'firstName':_0x3892b9['body']['from'],'ListId':_0x42956d[_0x7050('0x46')]});_0x3b1306[_0x3892b9[_0x7050('0x2e')]['mapKey']]=_0x3892b9['body'][_0x7050('0x47')];return db['CmContact'][_0x7050('0x48')](_0x3b1306);}else{throw new Error('List\x20not\x20found');}})['then'](function(_0x57fb5c){_0x28c2de['contact']=_0x57fb5c;if(_0x57fb5c){if(!_0x3892b9[_0x7050('0x2e')][_0x7050('0x17')][_0x7050('0x49')]){_0x3892b9[_0x7050('0x2e')]['message'][_0x7050('0x49')]=rs[_0x7050('0x4a')]()+'\x20'+_0x3892b9[_0x7050('0x2e')][_0x7050('0x17')]['from'];}var _0xc6a0e9={'ContactId':_0x57fb5c['id'],'MailAccountId':_0x3892b9[_0x7050('0x35')]['id'],'inReplyTo':_0x3892b9[_0x7050('0x2e')][_0x7050('0x17')][_0x7050('0x49')],'to':_0x3892b9[_0x7050('0x2e')][_0x7050('0x17')][_0x7050('0x47')],'cc':_0x3892b9[_0x7050('0x2e')]['message']['cc'],'subject':_0x3892b9[_0x7050('0x2e')][_0x7050('0x17')]['subject'],'attach':_0x3892b9[_0x7050('0x2e')][_0x7050('0x17')][_0x7050('0x4b')],'lastMsgAt':moment()[_0x7050('0x4c')](_0x7050('0x4d')),'lastMsgDirection':'in'};return db['MailInteraction'][_0x7050('0x26')]({'where':{'closed':![],'MailAccountId':_0x3892b9[_0x7050('0x35')]['id']},'include':[{'model':db[_0x7050('0x4e')],'as':_0x7050('0x4f'),'attributes':[_0x7050('0x49')],'where':{'messageId':_0x3892b9['body'][_0x7050('0x17')][_0x7050('0x50')]}}]})[_0x7050('0x10')](function(_0x147e56){if(_0x147e56){return[_0x147e56,![]];}return db[_0x7050('0x51')][_0x7050('0x48')](_0xc6a0e9)[_0x7050('0x10')](function(_0x3857e8){return[_0x3857e8,!![]];});});}else{throw new Error(_0x7050('0x52'));}})['spread'](function(_0x20cbc5,_0x3bf50d){if(_0x20cbc5){_0x156506=_0x3bf50d;if(!_0x3bf50d){return _0x20cbc5['update']({'inReplyTo':_0x3892b9[_0x7050('0x2e')]['message'][_0x7050('0x49')],'to':_0x3892b9[_0x7050('0x2e')]['message']['from'],'cc':_0x3892b9[_0x7050('0x2e')][_0x7050('0x17')]['cc'],'subject':_0x3892b9['body']['message'][_0x7050('0x53')],'attach':_0x20cbc5[_0x7050('0x4b')]?_0x20cbc5['attach']:_0x3892b9[_0x7050('0x2e')][_0x7050('0x17')][_0x7050('0x4b')],'substatus':null,'substatusAt':moment()['format'](_0x7050('0x4d')),'lastMsgAt':moment()[_0x7050('0x4c')](_0x7050('0x4d')),'lastMsgDirection':'in'});}else{return _0x20cbc5;}}})[_0x7050('0x10')](function(_0x57c9df){_0x28c2de['interaction']=_0x57c9df[_0x7050('0x54')]({'plain':!![]});_0x28c2de[_0x7050('0x55')][_0x7050('0x56')]=_0x156506;return db[_0x7050('0x4e')][_0x7050('0x48')]({'body':_0x3892b9[_0x7050('0x2e')][_0x7050('0x2e')],'MailAccountId':_0x3892b9[_0x7050('0x35')]['id'],'MailInteractionId':_0x57c9df['id'],'direction':'in','ContactId':_0x28c2de[_0x7050('0x57')]['id'],'messageId':_0x3892b9[_0x7050('0x2e')][_0x7050('0x17')][_0x7050('0x49')],'from':_0x3892b9[_0x7050('0x2e')][_0x7050('0x17')][_0x7050('0x47')],'to':_0x3892b9['body'][_0x7050('0x17')]['to'],'cc':_0x3892b9[_0x7050('0x2e')][_0x7050('0x17')]['cc'],'subject':_0x3892b9[_0x7050('0x2e')]['message']['subject'],'attach':_0x3892b9[_0x7050('0x2e')][_0x7050('0x17')]['attach'],'Attachments':_0x3892b9['body'][_0x7050('0x17')][_0x7050('0x58')],'originTo':_0x3892b9[_0x7050('0x2e')][_0x7050('0x17')][_0x7050('0x59')],'originCc':_0x3892b9['body']['message'][_0x7050('0x5a')],'bcc':_0x3892b9[_0x7050('0x2e')][_0x7050('0x17')]['bcc'],'ChatWebsiteId':_0x3892b9[_0x7050('0x2e')][_0x7050('0x17')][_0x7050('0x5b')]||null,'originChannel':_0x3892b9[_0x7050('0x2e')][_0x7050('0x17')][_0x7050('0x5c')]||'Email','ChatOfflineMessageId':_0x3892b9[_0x7050('0x2e')][_0x7050('0x17')][_0x7050('0x5d')]||null},{'include':[{'model':db[_0x7050('0x5e')],'as':_0x7050('0x5f')}]});})['then'](function(_0x25ac5a){_0x28c2de[_0x7050('0x17')]=_0x25ac5a;if(_0x28c2de[_0x7050('0x55')][_0x7050('0x60')]){return db[_0x7050('0x61')]['find']({'attributes':['id','name'],'where':{'id':_0x28c2de[_0x7050('0x55')][_0x7050('0x60')]}})['then'](function(_0xe58775){if(_0xe58775){_0x28c2de['applications'][_0x7050('0x62')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0xe58775[_0x7050('0x63')]+','+(_0x28c2de[_0x7050('0x35')][_0x7050('0x64')]||0xa),'interval':_0x7050('0x45')});}return respondWithRpcPromise(_0x7050('0x65'),_0x7050('0x66'),_0x28c2de);});}return respondWithRpcPromise(_0x7050('0x65'),_0x7050('0x66'),_0x28c2de);})[_0x7050('0x10')](function(_0x216bab){_0xecc182(_0x216bab);})[_0x7050('0x19')](function(_0x1a2147){_0xc61cbe(_0x1467d9[_0x7050('0x15')](0x1f4,_0x1a2147[_0x7050('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index 8c22865..8abe9a4 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 _0x4d00=['removeListener','register','length','mailAccount:','./mailAccount.events','save','update','emit'];(function(_0x2c1e7a,_0x155f86){var _0xcacb4f=function(_0x2b2eb3){while(--_0x2b2eb3){_0x2c1e7a['push'](_0x2c1e7a['shift']());}};_0xcacb4f(++_0x155f86);}(_0x4d00,0x7c));var _0x04d0=function(_0x955836,_0x2fc415){_0x955836=_0x955836-0x0;var _0x8de282=_0x4d00[_0x955836];return _0x8de282;};'use strict';var MailAccountEvents=require(_0x04d0('0x0'));var events=[_0x04d0('0x1'),'remove',_0x04d0('0x2')];function createListener(_0x381b73,_0x38c783){return function(_0x3c3f50){_0x38c783[_0x04d0('0x3')](_0x381b73,_0x3c3f50);};}function removeListener(_0x3307ff,_0xe00684){return function(){MailAccountEvents[_0x04d0('0x4')](_0x3307ff,_0xe00684);};}exports[_0x04d0('0x5')]=function(_0x5d6246){for(var _0x11608c=0x0,_0x1b652a=events[_0x04d0('0x6')];_0x11608c<_0x1b652a;_0x11608c++){var _0xbc896=events[_0x11608c];var _0x5c1cdb=createListener(_0x04d0('0x7')+_0xbc896,_0x5d6246);MailAccountEvents['on'](_0xbc896,_0x5c1cdb);}}; \ No newline at end of file +var _0xb886=['update','emit','removeListener','register','length','./mailAccount.events','save','remove'];(function(_0x307e4f,_0x1f649f){var _0x5e8561=function(_0x1beb99){while(--_0x1beb99){_0x307e4f['push'](_0x307e4f['shift']());}};_0x5e8561(++_0x1f649f);}(_0xb886,0xf5));var _0x6b88=function(_0x5e0ceb,_0x2551a8){_0x5e0ceb=_0x5e0ceb-0x0;var _0x57f47d=_0xb886[_0x5e0ceb];return _0x57f47d;};'use strict';var MailAccountEvents=require(_0x6b88('0x0'));var events=[_0x6b88('0x1'),_0x6b88('0x2'),_0x6b88('0x3')];function createListener(_0x1227da,_0x24f91b){return function(_0x15bf58){_0x24f91b[_0x6b88('0x4')](_0x1227da,_0x15bf58);};}function removeListener(_0x5dc17b,_0x5007af){return function(){MailAccountEvents[_0x6b88('0x5')](_0x5dc17b,_0x5007af);};}exports[_0x6b88('0x6')]=function(_0x14acc6){for(var _0x23b99e=0x0,_0x2e0afb=events[_0x6b88('0x7')];_0x23b99e<_0x2e0afb;_0x23b99e++){var _0x4e15f1=events[_0x23b99e];var _0x154466=createListener('mailAccount:'+_0x4e15f1,_0x14acc6);MailAccountEvents['on'](_0x4e15f1,_0x154466);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index 28da13d..7557e5f 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 _0x14ca=['util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./mailApplication.controller','isAuthenticated','show','put','/:id','delete','destroy','exports','multer'];(function(_0x2b5513,_0x3fe5cd){var _0x578fd2=function(_0x7a9106){while(--_0x7a9106){_0x2b5513['push'](_0x2b5513['shift']());}};_0x578fd2(++_0x3fe5cd);}(_0x14ca,0x1cf));var _0xa14c=function(_0x41c78d,_0x4c3628){_0x41c78d=_0x41c78d-0x0;var _0x26d028=_0x14ca[_0x41c78d];return _0x26d028;};'use strict';var multer=require(_0xa14c('0x0'));var util=require(_0xa14c('0x1'));var path=require(_0xa14c('0x2'));var timeout=require(_0xa14c('0x3'));var express=require('express');var router=express[_0xa14c('0x4')]();var fs_extra=require(_0xa14c('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xa14c('0x6'));var config=require(_0xa14c('0x7'));var controller=require(_0xa14c('0x8'));router['get']('/:id',auth[_0xa14c('0x9')](),controller[_0xa14c('0xa')]);router[_0xa14c('0xb')](_0xa14c('0xc'),auth[_0xa14c('0x9')](),controller['update']);router[_0xa14c('0xd')](_0xa14c('0xc'),auth['isAuthenticated'](),controller[_0xa14c('0xe')]);module[_0xa14c('0xf')]=router; \ No newline at end of file +var _0x850c=['update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./mailApplication.controller','get','show','/:id','isAuthenticated'];(function(_0x15e69e,_0x35a42d){var _0x46a804=function(_0x500307){while(--_0x500307){_0x15e69e['push'](_0x15e69e['shift']());}};_0x46a804(++_0x35a42d);}(_0x850c,0xd0));var _0xc850=function(_0x46678a,_0x3915b7){_0x46678a=_0x46678a-0x0;var _0x561981=_0x850c[_0x46678a];return _0x561981;};'use strict';var multer=require(_0xc850('0x0'));var util=require('util');var path=require(_0xc850('0x1'));var timeout=require(_0xc850('0x2'));var express=require(_0xc850('0x3'));var router=express[_0xc850('0x4')]();var fs_extra=require(_0xc850('0x5'));var auth=require(_0xc850('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc850('0x7'));var controller=require(_0xc850('0x8'));router[_0xc850('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xc850('0xa')]);router['put'](_0xc850('0xb'),auth[_0xc850('0xc')](),controller[_0xc850('0xd')]);router[_0xc850('0xe')]('/:id',auth[_0xc850('0xc')](),controller[_0xc850('0xf')]);module[_0xc850('0x10')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index d15e795..da57e15 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 _0xe604=['exports','INTEGER','STRING','noop','sequelize'];(function(_0x59056b,_0x4f5327){var _0x582465=function(_0x30233b){while(--_0x30233b){_0x59056b['push'](_0x59056b['shift']());}};_0x582465(++_0x4f5327);}(_0xe604,0x16c));var _0x4e60=function(_0x383750,_0x57dd10){_0x383750=_0x383750-0x0;var _0xff9d0a=_0xe604[_0x383750];return _0xff9d0a;};'use strict';var Sequelize=require(_0x4e60('0x0'));module[_0x4e60('0x1')]={'priority':{'type':Sequelize[_0x4e60('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x4e60('0x3')],'allowNull':![],'defaultValue':_0x4e60('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x0081=['exports','INTEGER','noop','TEXT','STRING','*,*,*,*'];(function(_0x151bb5,_0x520405){var _0x2f2759=function(_0xdfffa6){while(--_0xdfffa6){_0x151bb5['push'](_0x151bb5['shift']());}};_0x2f2759(++_0x520405);}(_0x0081,0x11a));var _0x1008=function(_0xaa0309,_0x1c8008){_0xaa0309=_0xaa0309-0x0;var _0x5de7ce=_0x0081[_0xaa0309];return _0x5de7ce;};'use strict';var Sequelize=require('sequelize');module[_0x1008('0x0')]={'priority':{'type':Sequelize[_0x1008('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x1008('0x2')},'appdata':{'type':Sequelize[_0x1008('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x1008('0x4')],'defaultValue':_0x1008('0x5')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index 7767e61..c48e677 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 _0xcb91=['send','show','params','keys','rawAttributes','query','intersection','attributes','fields','length','model','includeAll','include','merge','options','MailApplication','find','catch','body','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','error','stack','name'];(function(_0x37522a,_0x303b60){var _0x4dcf7f=function(_0x1f4037){while(--_0x1f4037){_0x37522a['push'](_0x37522a['shift']());}};_0x4dcf7f(++_0x303b60);}(_0xcb91,0x1a9));var _0x1cb9=function(_0xc69f39,_0x2ce0cf){_0xc69f39=_0xc69f39-0x0;var _0x93be41=_0xcb91[_0xc69f39];return _0x93be41;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1cb9('0x0'));var jsonpatch=require(_0x1cb9('0x1'));var rp=require(_0x1cb9('0x2'));var moment=require(_0x1cb9('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x1cb9('0x4'));var util=require(_0x1cb9('0x5'));var path=require('path');var sox=require(_0x1cb9('0x6'));var csv=require(_0x1cb9('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1cb9('0x8'));var _=require(_0x1cb9('0x9'));var squel=require('squel');var crypto=require(_0x1cb9('0xa'));var jsforce=require(_0x1cb9('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x1cb9('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1cb9('0xc'));var authService=require(_0x1cb9('0xd'));var qs=require(_0x1cb9('0xe'));var as=require(_0x1cb9('0xf'));var hardwareService=require(_0x1cb9('0x10'));var logger=require('../../config/logger')(_0x1cb9('0x11'));var utils=require(_0x1cb9('0x12'));var config=require(_0x1cb9('0x13'));var licenseUtil=require(_0x1cb9('0x14'));var db=require(_0x1cb9('0x15'))['db'];function respondWithStatusCode(_0x5445e1,_0x5e3c19){_0x5e3c19=_0x5e3c19||0xcc;return function(_0x59dec3){if(_0x59dec3){return _0x5445e1[_0x1cb9('0x16')](_0x5e3c19);}return _0x5445e1[_0x1cb9('0x17')](_0x5e3c19)[_0x1cb9('0x18')]();};}function respondWithResult(_0x1c714f,_0x56884d){_0x56884d=_0x56884d||0xc8;return function(_0x397727){if(_0x397727){return _0x1c714f[_0x1cb9('0x17')](_0x56884d)[_0x1cb9('0x19')](_0x397727);}};}function respondWithFilteredResult(_0x8dfa55,_0x3e2d11){return function(_0x5806d8){if(_0x5806d8){var _0x5572cb=typeof _0x3e2d11[_0x1cb9('0x1a')]===_0x1cb9('0x1b')&&typeof _0x3e2d11[_0x1cb9('0x1c')]===_0x1cb9('0x1b');var _0x3e21e0=_0x5806d8[_0x1cb9('0x1d')];var _0x23d3a9=_0x5572cb?0x0:_0x3e2d11['offset'];var _0x479d43=_0x5572cb?_0x5806d8[_0x1cb9('0x1d')]:_0x3e2d11[_0x1cb9('0x1a')]+_0x3e2d11[_0x1cb9('0x1c')];var _0x31481a;if(_0x479d43>=_0x3e21e0){_0x479d43=_0x3e21e0;_0x31481a=0xc8;}else{_0x31481a=0xce;}_0x8dfa55[_0x1cb9('0x17')](_0x31481a);return _0x8dfa55[_0x1cb9('0x1e')](_0x1cb9('0x1f'),_0x23d3a9+'-'+_0x479d43+'/'+_0x3e21e0)['json'](_0x5806d8);}return null;};}function patchUpdates(_0x559bcc){return function(_0x1a5a72){try{jsonpatch['apply'](_0x1a5a72,_0x559bcc,!![]);}catch(_0x4750b1){return BPromise[_0x1cb9('0x20')](_0x4750b1);}return _0x1a5a72['save']();};}function saveUpdates(_0x599275,_0x2e3854){return function(_0x325637){if(_0x325637){return _0x325637[_0x1cb9('0x21')](_0x599275)[_0x1cb9('0x22')](function(_0x45b8d3){return _0x45b8d3;});}return null;};}function removeEntity(_0x27db16,_0x59ebea){return function(_0x55b232){if(_0x55b232){return _0x55b232[_0x1cb9('0x23')]()['then'](function(){_0x27db16[_0x1cb9('0x17')](0xcc)[_0x1cb9('0x18')]();});}};}function handleEntityNotFound(_0x69b4c8,_0x44d3c4){return function(_0x43a100){if(!_0x43a100){_0x69b4c8['sendStatus'](0x194);}return _0x43a100;};}function handleError(_0x195f16,_0x9df250){_0x9df250=_0x9df250||0x1f4;return function(_0x4c8d76){logger[_0x1cb9('0x24')](_0x4c8d76[_0x1cb9('0x25')]);if(_0x4c8d76[_0x1cb9('0x26')]){delete _0x4c8d76[_0x1cb9('0x26')];}_0x195f16[_0x1cb9('0x17')](_0x9df250)[_0x1cb9('0x27')](_0x4c8d76);};}exports[_0x1cb9('0x28')]=function(_0xb644b3,_0x41e5c2){var _0x9de64b={'raw':!![],'where':{'id':_0xb644b3[_0x1cb9('0x29')]['id']}},_0x48888d={};_0x48888d['model']=_[_0x1cb9('0x2a')](db['MailApplication'][_0x1cb9('0x2b')]);_0x48888d[_0x1cb9('0x2c')]=_[_0x1cb9('0x2a')](_0xb644b3[_0x1cb9('0x2c')]);_0x48888d['filters']=_[_0x1cb9('0x2d')](_0x48888d['model'],_0x48888d[_0x1cb9('0x2c')]);_0x9de64b[_0x1cb9('0x2e')]=_[_0x1cb9('0x2d')](_0x48888d['model'],qs[_0x1cb9('0x2f')](_0xb644b3['query'][_0x1cb9('0x2f')]));_0x9de64b['attributes']=_0x9de64b[_0x1cb9('0x2e')][_0x1cb9('0x30')]?_0x9de64b[_0x1cb9('0x2e')]:_0x48888d[_0x1cb9('0x31')];if(_0xb644b3['query'][_0x1cb9('0x32')]){_0x9de64b[_0x1cb9('0x33')]=[{'all':!![]}];}_0x9de64b=_[_0x1cb9('0x34')]({},_0x9de64b,_0xb644b3[_0x1cb9('0x35')]);return db[_0x1cb9('0x36')][_0x1cb9('0x37')](_0x9de64b)[_0x1cb9('0x22')](handleEntityNotFound(_0x41e5c2,null))[_0x1cb9('0x22')](respondWithResult(_0x41e5c2,null))[_0x1cb9('0x38')](handleError(_0x41e5c2,null));};exports[_0x1cb9('0x21')]=function(_0x294eec,_0x26b950){if(_0x294eec[_0x1cb9('0x39')]['id']){delete _0x294eec['body']['id'];}return db['MailApplication'][_0x1cb9('0x37')]({'where':{'id':_0x294eec[_0x1cb9('0x29')]['id']}})[_0x1cb9('0x22')](handleEntityNotFound(_0x26b950,null))[_0x1cb9('0x22')](saveUpdates(_0x294eec[_0x1cb9('0x39')],null))[_0x1cb9('0x22')](respondWithResult(_0x26b950,null))[_0x1cb9('0x38')](handleError(_0x26b950,null));};exports[_0x1cb9('0x23')]=function(_0x4d3e39,_0x2aa59b){return db[_0x1cb9('0x36')][_0x1cb9('0x37')]({'where':{'id':_0x4d3e39['params']['id']}})[_0x1cb9('0x22')](handleEntityNotFound(_0x2aa59b,null))['then'](removeEntity(_0x2aa59b,null))[_0x1cb9('0x38')](handleError(_0x2aa59b,null));}; \ No newline at end of file +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(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xaa88[_0x432682];return _0x463d05;};'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 diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index 615dd46..d15fe26 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 _0x1090=['./mailApplication.attributes','exports','MailApplication','mail_applications','utf8mb4','lodash','../../config/logger','api','bluebird','request-promise','rimraf'];(function(_0x9bdad1,_0x1c715b){var _0x5ed47e=function(_0x449ea9){while(--_0x449ea9){_0x9bdad1['push'](_0x9bdad1['shift']());}};_0x5ed47e(++_0x1c715b);}(_0x1090,0x68));var _0x0109=function(_0x3e251f,_0x3347f0){_0x3e251f=_0x3e251f-0x0;var _0x49a26e=_0x1090[_0x3e251f];return _0x49a26e;};'use strict';var _=require(_0x0109('0x0'));var util=require('util');var logger=require(_0x0109('0x1'))(_0x0109('0x2'));var moment=require('moment');var BPromise=require(_0x0109('0x3'));var rp=require(_0x0109('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0109('0x5'));var config=require('../../config/environment');var attributes=require(_0x0109('0x6'));module[_0x0109('0x7')]=function(_0x421c84,_0x3fbad3){return _0x421c84['define'](_0x0109('0x8'),attributes,{'tableName':_0x0109('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0109('0xa'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xc868=['define','mail_applications','utf8mb4','utf8mb4_unicode_ci','lodash','api','bluebird','request-promise','path','rimraf','../../config/environment','./mailApplication.attributes','exports'];(function(_0x4ab7bc,_0x20c151){var _0x209ebd=function(_0x3289af){while(--_0x3289af){_0x4ab7bc['push'](_0x4ab7bc['shift']());}};_0x209ebd(++_0x20c151);}(_0xc868,0x13c));var _0x8c86=function(_0x1f33d1,_0x5b5d30){_0x1f33d1=_0x1f33d1-0x0;var _0x1b2156=_0xc868[_0x1f33d1];return _0x1b2156;};'use strict';var _=require(_0x8c86('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x8c86('0x1'));var moment=require('moment');var BPromise=require(_0x8c86('0x2'));var rp=require(_0x8c86('0x3'));var fs=require('fs');var path=require(_0x8c86('0x4'));var rimraf=require(_0x8c86('0x5'));var config=require(_0x8c86('0x6'));var attributes=require(_0x8c86('0x7'));module[_0x8c86('0x8')]=function(_0x2713ee,_0x5ab955){return _0x2713ee[_0x8c86('0x9')]('MailApplication',attributes,{'tableName':_0x8c86('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8c86('0xb'),'collate':_0x8c86('0xc')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index e1b4458..58048d1 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 _0x8c1d=['code','message','result','catch','UpdateMailApplication','update','options','raw','where','attributes','then','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','MailApplication,\x20%s,\x20%s','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','error'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x8c1d,0x173));var _0xd8c1=function(_0x58a64c,_0x684602){_0x58a64c=_0x58a64c-0x0;var _0x1d419e=_0x8c1d[_0x58a64c];return _0x1d419e;};'use strict';var _=require(_0xd8c1('0x0'));var util=require(_0xd8c1('0x1'));var moment=require(_0xd8c1('0x2'));var BPromise=require(_0xd8c1('0x3'));var rs=require(_0xd8c1('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd8c1('0x5'))['db'];var utils=require(_0xd8c1('0x6'));var logger=require(_0xd8c1('0x7'))(_0xd8c1('0x8'));var config=require('../../config/environment');var jayson=require(_0xd8c1('0x9'));var client=jayson[_0xd8c1('0xa')][_0xd8c1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x57869e,_0x5c224e,_0x5d9c03){return new BPromise(function(_0x238587,_0x576424){return client[_0xd8c1('0xc')](_0x57869e,_0x5d9c03)['then'](function(_0x757611){logger[_0xd8c1('0xd')](_0xd8c1('0xe'),_0x5c224e,_0xd8c1('0xf'));logger[_0xd8c1('0x10')](_0xd8c1('0x11'),_0x5c224e,_0xd8c1('0xf'),JSON['stringify'](_0x757611));if(_0x757611[_0xd8c1('0x12')]){if(_0x757611[_0xd8c1('0x12')][_0xd8c1('0x13')]===0x1f4){logger[_0xd8c1('0x12')](_0xd8c1('0xe'),_0x5c224e,_0x757611[_0xd8c1('0x12')][_0xd8c1('0x14')]);return _0x576424(_0x757611[_0xd8c1('0x12')][_0xd8c1('0x14')]);}logger[_0xd8c1('0x12')](_0xd8c1('0xe'),_0x5c224e,_0x757611[_0xd8c1('0x12')][_0xd8c1('0x14')]);return _0x238587(_0x757611[_0xd8c1('0x12')][_0xd8c1('0x14')]);}else{logger[_0xd8c1('0xd')](_0xd8c1('0xe'),_0x5c224e,_0xd8c1('0xf'));_0x238587(_0x757611[_0xd8c1('0x15')]['message']);}})[_0xd8c1('0x16')](function(_0x3df551){logger['error'](_0xd8c1('0xe'),_0x5c224e,_0x3df551);_0x576424(_0x3df551);});});}exports[_0xd8c1('0x17')]=function(_0x371c25){var _0x213b65=this;return new Promise(function(_0x410906,_0xd88b06){return db['MailApplication'][_0xd8c1('0x18')](_0x371c25['body'],{'raw':_0x371c25[_0xd8c1('0x19')]?_0x371c25[_0xd8c1('0x19')][_0xd8c1('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x371c25[_0xd8c1('0x19')]?_0x371c25[_0xd8c1('0x19')][_0xd8c1('0x1b')]||null:null,'attributes':_0x371c25['options']?_0x371c25[_0xd8c1('0x19')][_0xd8c1('0x1c')]||null:null,'limit':_0x371c25[_0xd8c1('0x19')]?_0x371c25[_0xd8c1('0x19')]['limit']||null:null})[_0xd8c1('0x1d')](function(_0x4b2f73){logger['info']('UpdateMailApplication',_0x371c25);logger['debug']('UpdateMailApplication',_0x371c25,JSON['stringify'](_0x4b2f73));_0x410906(_0x4b2f73);})['catch'](function(_0x37ae37){logger['error'](_0xd8c1('0x17'),_0x37ae37[_0xd8c1('0x14')],_0x371c25);_0xd88b06(_0x213b65[_0xd8c1('0x12')](0x1f4,_0x37ae37[_0xd8c1('0x14')]));});});}; \ No newline at end of file +var _0xfa4d=['where','attributes','stringify','catch','lodash','util','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','error','code','MailApplication,\x20%s,\x20%s','message','info','result','UpdateMailApplication','MailApplication','update','options'];(function(_0x2fab2f,_0x2b7024){var _0x1d6c3e=function(_0x36f89b){while(--_0x36f89b){_0x2fab2f['push'](_0x2fab2f['shift']());}};_0x1d6c3e(++_0x2b7024);}(_0xfa4d,0x90));var _0xdfa4=function(_0x5c2f30,_0x51ef45){_0x5c2f30=_0x5c2f30-0x0;var _0x1ad965=_0xfa4d[_0x5c2f30];return _0x1ad965;};'use strict';var _=require(_0xdfa4('0x0'));var util=require(_0xdfa4('0x1'));var moment=require('moment');var BPromise=require(_0xdfa4('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xdfa4('0x3'));var logger=require(_0xdfa4('0x4'))(_0xdfa4('0x5'));var config=require(_0xdfa4('0x6'));var jayson=require(_0xdfa4('0x7'));var client=jayson[_0xdfa4('0x8')][_0xdfa4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xc2219c,_0x3f80c9,_0x25babc){return new BPromise(function(_0x4513fd,_0x2cf122){return client[_0xdfa4('0xa')](_0xc2219c,_0x25babc)[_0xdfa4('0xb')](function(_0x5fd222){logger['info']('MailApplication,\x20%s,\x20%s',_0x3f80c9,_0xdfa4('0xc'));logger[_0xdfa4('0xd')]('MailApplication,\x20%s,\x20%s,\x20%s',_0x3f80c9,_0xdfa4('0xc'),JSON['stringify'](_0x5fd222));if(_0x5fd222[_0xdfa4('0xe')]){if(_0x5fd222[_0xdfa4('0xe')][_0xdfa4('0xf')]===0x1f4){logger[_0xdfa4('0xe')](_0xdfa4('0x10'),_0x3f80c9,_0x5fd222[_0xdfa4('0xe')][_0xdfa4('0x11')]);return _0x2cf122(_0x5fd222[_0xdfa4('0xe')][_0xdfa4('0x11')]);}logger[_0xdfa4('0xe')](_0xdfa4('0x10'),_0x3f80c9,_0x5fd222[_0xdfa4('0xe')][_0xdfa4('0x11')]);return _0x4513fd(_0x5fd222['error'][_0xdfa4('0x11')]);}else{logger[_0xdfa4('0x12')](_0xdfa4('0x10'),_0x3f80c9,'request\x20sent');_0x4513fd(_0x5fd222[_0xdfa4('0x13')][_0xdfa4('0x11')]);}})['catch'](function(_0x9f8bd6){logger[_0xdfa4('0xe')](_0xdfa4('0x10'),_0x3f80c9,_0x9f8bd6);_0x2cf122(_0x9f8bd6);});});}exports[_0xdfa4('0x14')]=function(_0xed6924){var _0x4d6fe0=this;return new Promise(function(_0x5c2765,_0x280808){return db[_0xdfa4('0x15')][_0xdfa4('0x16')](_0xed6924['body'],{'raw':_0xed6924['options']?_0xed6924[_0xdfa4('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xed6924[_0xdfa4('0x17')]?_0xed6924[_0xdfa4('0x17')][_0xdfa4('0x18')]||null:null,'attributes':_0xed6924[_0xdfa4('0x17')]?_0xed6924[_0xdfa4('0x17')][_0xdfa4('0x19')]||null:null,'limit':_0xed6924[_0xdfa4('0x17')]?_0xed6924[_0xdfa4('0x17')]['limit']||null:null})[_0xdfa4('0xb')](function(_0x204f64){logger['info'](_0xdfa4('0x14'),_0xed6924);logger[_0xdfa4('0xd')]('UpdateMailApplication',_0xed6924,JSON[_0xdfa4('0x1a')](_0x204f64));_0x5c2765(_0x204f64);})[_0xdfa4('0x1b')](function(_0x46301b){logger['error'](_0xdfa4('0x14'),_0x46301b[_0xdfa4('0x11')],_0xed6924);_0x280808(_0x4d6fe0[_0xdfa4('0xe')](0x1f4,_0x46301b['message']));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index 8f60401..b57f0f2 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 _0x4596=['Router','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','isAuthenticated','index','describe','get','/:id','show','/:id/messages','getMessages','download','post','create','addMessage','/:id/tags','mail','mailinteraction:addtags','addTags','tracked','mailinteraction:update','update','delete','mailinteraction:destroy','removeTags','exports','express'];(function(_0x5512e4,_0x34de29){var _0x15d881=function(_0xf80e9c){while(--_0xf80e9c){_0x5512e4['push'](_0x5512e4['shift']());}};_0x15d881(++_0x34de29);}(_0x4596,0xfb));var _0x6459=function(_0x2d5bde,_0x516e42){_0x2d5bde=_0x2d5bde-0x0;var _0x4fc0ce=_0x4596[_0x2d5bde];return _0x4fc0ce;};'use strict';var express=require(_0x6459('0x0'));var router=express[_0x6459('0x1')]();var auth=require(_0x6459('0x2'));var interaction=require(_0x6459('0x3'));var controller=require(_0x6459('0x4'));router['get']('/',auth[_0x6459('0x5')](),controller[_0x6459('0x6')]);router['get']('/describe',auth[_0x6459('0x5')](),controller[_0x6459('0x7')]);router[_0x6459('0x8')](_0x6459('0x9'),auth['isAuthenticated'](),controller[_0x6459('0xa')]);router[_0x6459('0x8')](_0x6459('0xb'),auth[_0x6459('0x5')](),controller[_0x6459('0xc')]);router['get']('/:id/download',auth[_0x6459('0x5')](),controller[_0x6459('0xd')]);router[_0x6459('0xe')]('/',auth[_0x6459('0x5')](),controller[_0x6459('0xf')]);router[_0x6459('0xe')](_0x6459('0xb'),auth[_0x6459('0x5')](),controller[_0x6459('0x10')]);router[_0x6459('0xe')](_0x6459('0x11'),auth['isAuthenticated'](),interaction['tracked'](_0x6459('0x12'),_0x6459('0x13')),controller[_0x6459('0x14')]);router['put'](_0x6459('0x9'),auth[_0x6459('0x5')](),interaction[_0x6459('0x15')]('mail',_0x6459('0x16')),controller[_0x6459('0x17')]);router[_0x6459('0x18')](_0x6459('0x9'),auth[_0x6459('0x5')](),interaction[_0x6459('0x15')](_0x6459('0x12'),_0x6459('0x19')),controller['destroy']);router[_0x6459('0x18')]('/:id/tags',auth['isAuthenticated'](),controller[_0x6459('0x1a')]);module[_0x6459('0x1b')]=router; \ No newline at end of file +var _0xc93f=['Router','./mailInteraction.controller','get','isAuthenticated','describe','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','mailinteraction:addtags','addTags','put','/:id','mail','update','mailinteraction:destroy','destroy','delete','removeTags','exports'];(function(_0x4be503,_0x2f2549){var _0x2cdc68=function(_0xa6221c){while(--_0xa6221c){_0x4be503['push'](_0x4be503['shift']());}};_0x2cdc68(++_0x2f2549);}(_0xc93f,0x104));var _0xfc93=function(_0x123e23,_0x3e9870){_0x123e23=_0x123e23-0x0;var _0x369313=_0xc93f[_0x123e23];return _0x369313;};'use strict';var express=require('express');var router=express[_0xfc93('0x0')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var controller=require(_0xfc93('0x1'));router[_0xfc93('0x2')]('/',auth[_0xfc93('0x3')](),controller['index']);router['get']('/describe',auth[_0xfc93('0x3')](),controller[_0xfc93('0x4')]);router[_0xfc93('0x2')]('/:id',auth['isAuthenticated'](),controller[_0xfc93('0x5')]);router[_0xfc93('0x2')](_0xfc93('0x6'),auth['isAuthenticated'](),controller[_0xfc93('0x7')]);router[_0xfc93('0x2')](_0xfc93('0x8'),auth['isAuthenticated'](),controller[_0xfc93('0x9')]);router[_0xfc93('0xa')]('/',auth['isAuthenticated'](),controller[_0xfc93('0xb')]);router[_0xfc93('0xa')](_0xfc93('0x6'),auth['isAuthenticated'](),controller[_0xfc93('0xc')]);router[_0xfc93('0xa')](_0xfc93('0xd'),auth[_0xfc93('0x3')](),interaction[_0xfc93('0xe')]('mail',_0xfc93('0xf')),controller[_0xfc93('0x10')]);router[_0xfc93('0x11')](_0xfc93('0x12'),auth[_0xfc93('0x3')](),interaction['tracked'](_0xfc93('0x13'),'mailinteraction:update'),controller[_0xfc93('0x14')]);router['delete'](_0xfc93('0x12'),auth[_0xfc93('0x3')](),interaction[_0xfc93('0xe')](_0xfc93('0x13'),_0xfc93('0x15')),controller[_0xfc93('0x16')]);router[_0xfc93('0x17')](_0xfc93('0xd'),auth[_0xfc93('0x3')](),controller[_0xfc93('0x18')]);module[_0xfc93('0x19')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index 4f3d24f..8e2e9b4 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 _0x3e5e=['exports','BOOLEAN','DATE','STRING','TEXT','long','ENUM','out','sequelize'];(function(_0x4883cb,_0x3df63c){var _0x33aad7=function(_0x2e901e){while(--_0x2e901e){_0x4883cb['push'](_0x4883cb['shift']());}};_0x33aad7(++_0x3df63c);}(_0x3e5e,0x14c));var _0xe3e5=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x3e5e[_0x40a045];return _0x1a687c;};'use strict';var Sequelize=require(_0xe3e5('0x0'));var iconv=require('iconv');module[_0xe3e5('0x1')]={'closed':{'type':Sequelize[_0xe3e5('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xe3e5('0x3')]},'disposition':{'type':Sequelize[_0xe3e5('0x4')]},'secondDisposition':{'type':Sequelize[_0xe3e5('0x4')]},'thirdDisposition':{'type':Sequelize[_0xe3e5('0x4')]},'note':{'type':Sequelize[_0xe3e5('0x4')]},'inReplyTo':{'type':Sequelize[_0xe3e5('0x4')](0x1fe)},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0xe3e5('0x5')](_0xe3e5('0x6'))},'subject':{'type':Sequelize[_0xe3e5('0x5')]()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0xe3e5('0x3')]},'substatus':{'type':Sequelize['STRING'](0x3c)},'substatusAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0xe3e5('0x7')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xe3e5('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xe3e5('0x8')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x1d50=['TEXT','long','DATE','ENUM','out','sequelize','exports','BOOLEAN','STRING'];(function(_0x4886f7,_0x1b3735){var _0x2cb63c=function(_0x2b629e){while(--_0x2b629e){_0x4886f7['push'](_0x4886f7['shift']());}};_0x2cb63c(++_0x1b3735);}(_0x1d50,0x125));var _0x01d5=function(_0x573482,_0x19acd5){_0x573482=_0x573482-0x0;var _0x33b996=_0x1d50[_0x573482];return _0x33b996;};'use strict';var Sequelize=require(_0x01d5('0x0'));var iconv=require('iconv');module[_0x01d5('0x1')]={'closed':{'type':Sequelize[_0x01d5('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x01d5('0x3')]},'thirdDisposition':{'type':Sequelize[_0x01d5('0x3')]},'note':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0x01d5('0x3')](0x1fe)},'to':{'type':Sequelize[_0x01d5('0x3')]},'cc':{'type':Sequelize[_0x01d5('0x4')](_0x01d5('0x5'))},'subject':{'type':Sequelize[_0x01d5('0x4')]()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x01d5('0x6')]},'substatus':{'type':Sequelize[_0x01d5('0x3')](0x3c)},'substatusAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x01d5('0x7')]('in',_0x01d5('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x01d5('0x7')]('in',_0x01d5('0x8')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x01d5('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index e1ef0f9..0b73294 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 _0xb10b=['Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','groupBy','MailInteractionId','Setting','findOne','enableEmailPreview','show','params','rawAttributes','includeAll','include','merge','options','create','body','describe','addMessage','ids','omit','getMessages','nolimit','pick','$gte','format','YYYY-MM-DD\x20HH:mm:ss','findAll','inlineCss','rows','spread','emit','mailInteractionTags:save','removeTags','download','unix','join','server','tmp','root','files','attachments','transcript-%d-%s.zip','Attachment','Attachments','Messages','subject','get','each','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','Bcc','basename','existsSync','build','message%d.eml','unlinkSync','eml-format','zip-dir','moment','bluebird','path','lodash','squel','juice','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy','then','error','stack','name','send','fullname','TagIds','Tags','split','forEach','push','MailMessage','out','-id','trimStart','plainBody','catch','index','map','MailInteraction','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','field','color','tools_tags','u.id','ui.MailInteractionId','from','user_has_mail_interactions','left_join','users','u.id\x20=\x20ui.UserId','select','mail_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','mail_messages','me.MailInteractionId\x20=\x20i.id','it.MailInteractionId\x20=\x20i.id','expr','search','parseSearch','conditions','length','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','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','start','some','compact','isEmpty','i.MailAccountId\x20IN\x20?','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','isEmail','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','resolve','MailAccountId','i.MailAccountId\x20IS\x20NOT\x20NULL','role','getMailAccounts','i.MailAccountId\x20IS\x20NULL','agent','toString','sequelize','keyBy','a.key','Account.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','contactName','i.createdAt','i.updatedAt','i.closed','i.attach','i.lastMsgAt','i.subject','i.disposition','i.secondDisposition','i.thirdDisposition','i.ContactId','i.MailAccountId','Contact.firstName','c.email'];(function(_0x47e7cb,_0x4c1b8d){var _0x2a8874=function(_0x36498f){while(--_0x36498f){_0x47e7cb['push'](_0x47e7cb['shift']());}};_0x2a8874(++_0x4c1b8d);}(_0xb10b,0x12a));var _0xbb10=function(_0x5560f6,_0x225f9c){_0x5560f6=_0x5560f6-0x0;var _0x25d4ef=_0xb10b[_0x5560f6];return _0x25d4ef;};'use strict';var emlformat=require(_0xbb10('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var BPromise=require(_0xbb10('0x3'));var util=require('util');var path=require(_0xbb10('0x4'));var fs=require('fs');var _=require(_0xbb10('0x5'));var squel=require(_0xbb10('0x6'));var juice=require(_0xbb10('0x7'));var Redis=require(_0xbb10('0x8'));var qs=require(_0xbb10('0x9'));var as=require('../../components/parsers/advancedSearch');var logger=require(_0xbb10('0xa'))(_0xbb10('0xb'));var config=require('../../config/environment');var db=require(_0xbb10('0xc'))['db'];config[_0xbb10('0xd')]=_[_0xbb10('0xe')](config[_0xbb10('0xd')],{'host':_0xbb10('0xf'),'port':0x18eb});var socket=require(_0xbb10('0x10'))(new Redis(config[_0xbb10('0xd')]));require(_0xbb10('0x11'))['register'](socket);function respondWithStatusCode(_0x4e47f8,_0x20bd61){_0x20bd61=_0x20bd61||0xcc;return function(_0x118a74){if(_0x118a74){return _0x4e47f8[_0xbb10('0x12')](_0x20bd61);}return _0x4e47f8['status'](_0x20bd61)[_0xbb10('0x13')]();};}function respondWithResult(_0x5be7e0,_0x44fb19){_0x44fb19=_0x44fb19||0xc8;return function(_0x916a32){if(_0x916a32){return _0x5be7e0[_0xbb10('0x14')](_0x44fb19)[_0xbb10('0x15')](_0x916a32);}};}function respondWithFilteredResult(_0x442548,_0x147230){return function(_0x58a612){if(_0x58a612){var _0x26e021=typeof _0x147230[_0xbb10('0x16')]===_0xbb10('0x17')&&typeof _0x147230[_0xbb10('0x18')]===_0xbb10('0x17');var _0x2f2ebf=_0x58a612[_0xbb10('0x19')];var _0x36b5e8=_0x26e021?0x0:_0x147230[_0xbb10('0x16')];var _0x2b184e=_0x26e021?_0x58a612['count']:_0x147230[_0xbb10('0x16')]+_0x147230[_0xbb10('0x18')];var _0x133ac2;if(_0x2b184e>=_0x2f2ebf){_0x2b184e=_0x2f2ebf;_0x133ac2=0xc8;}else{_0x133ac2=0xce;}_0x442548[_0xbb10('0x14')](_0x133ac2);return _0x442548[_0xbb10('0x1a')](_0xbb10('0x1b'),_0x36b5e8+'-'+_0x2b184e+'/'+_0x2f2ebf)[_0xbb10('0x15')](_0x58a612);}return null;};}function saveUpdates(_0x30efc6){return function(_0xbf2906){if(_0xbf2906){return _0xbf2906[_0xbb10('0x1c')](_0x30efc6)['then'](function(_0x5ff0cf){return _0x5ff0cf;});}return null;};}function removeEntity(_0x19f48d){return function(_0x388fab){if(_0x388fab){return _0x388fab[_0xbb10('0x1d')]()[_0xbb10('0x1e')](function(){_0x19f48d[_0xbb10('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x12f888){return function(_0x12ef77){if(!_0x12ef77){_0x12f888['sendStatus'](0x194);}return _0x12ef77;};}function handleError(_0x4c4b0d,_0x8e2b97){_0x8e2b97=_0x8e2b97||0x1f4;return function(_0x311abe){logger[_0xbb10('0x1f')](_0x311abe[_0xbb10('0x20')]);if(_0x311abe[_0xbb10('0x21')]){delete _0x311abe[_0xbb10('0x21')];}_0x4c4b0d[_0xbb10('0x14')](_0x8e2b97)[_0xbb10('0x22')](_0x311abe);};}function getInteractionUsers(_0x7f2377,_0x395404){return new BPromise(function(_0x3ba6cd,_0x26ad93){try{if(_0x395404[_0x7f2377['id']]){_0x7f2377['Users']=_['map'](_0x395404[_0x7f2377['id']],function(_0x4fb5e0){return{'id':_0x4fb5e0['id'],'fullname':_0x4fb5e0[_0xbb10('0x23')]};});}}catch(_0x3c5ae7){_0x26ad93(_0x3c5ae7);}_0x3ba6cd(_0x7f2377);});}function getInteractionTags(_0x2c89b9,_0x4e25ff){return new BPromise(function(_0x2fdde9,_0x24d586){try{if(_0x2c89b9[_0xbb10('0x24')]){_0x2c89b9[_0xbb10('0x25')]=[];_0x2c89b9[_0xbb10('0x24')][_0xbb10('0x26')](',')[_0xbb10('0x27')](function(_0x4aabb9){_0x2c89b9[_0xbb10('0x25')][_0xbb10('0x28')](_0x4e25ff[_0x4aabb9]);});}delete _0x2c89b9[_0xbb10('0x24')];}catch(_0x2e0249){_0x24d586(_0x2e0249);}_0x2fdde9(_0x2c89b9);});}function getLastMessageText(_0x1d30aa){return new BPromise(function(_0x2ff4c1,_0x5d5c80){return db[_0xbb10('0x29')]['findOne']({'where':{'$and':[{'MailInteractionId':_0x1d30aa['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0xbb10('0x2a')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':_0xbb10('0x2b'),'raw':!![]})[_0xbb10('0x1e')](function(_0x1b59f9){if(_0x1b59f9&&_0x1b59f9['plainBody']){_0x1d30aa['lastMsgText']=_[_0xbb10('0x2c')](_0x1b59f9[_0xbb10('0x2d')]);}_0x2ff4c1(_0x1d30aa);})['catch'](function(_0x359ad4){_0x5d5c80(_0x359ad4);});});}function updateMailInteraction(_0x37dde7,_0x2f653f,_0x1c0b57,_0x37a83f){return new BPromise(function(_0x138bc6,_0xf85197){return getInteractionUsers(_0x37dde7,_0x1c0b57)['then'](function(_0x25acb3){return getInteractionTags(_0x25acb3,_0x2f653f);})[_0xbb10('0x1e')](function(_0x441d15){if(_0x37a83f){_0x138bc6(getLastMessageText(_0x441d15));}else{_0x138bc6(_0x441d15);}})[_0xbb10('0x2e')](function(_0xfb2c5e){_0xf85197(_0xfb2c5e);});});}exports[_0xbb10('0x2f')]=function(_0x188cbd,_0x10202c){var _0x3c8d7d={},_0x56943c={},_0x2b5352={'count':0x0,'rows':[]};var _0x150107=_[_0xbb10('0x30')](db[_0xbb10('0x31')]['rawAttributes'],function(_0x111762){return{'name':_0x111762['fieldName'],'type':_0x111762['type'][_0xbb10('0x32')]};});_0x56943c[_0xbb10('0x33')]=_[_0xbb10('0x30')](_0x150107,_0xbb10('0x21'));_0x56943c[_0xbb10('0x34')]=_[_0xbb10('0x35')](_0x188cbd['query']);_0x56943c[_0xbb10('0x36')]=_[_0xbb10('0x37')](_0x56943c['model'],_0x56943c['query']);_0x3c8d7d['attributes']=_[_0xbb10('0x37')](_0x56943c[_0xbb10('0x33')],qs[_0xbb10('0x38')](_0x188cbd['query'][_0xbb10('0x38')]));_0x3c8d7d[_0xbb10('0x39')]=_0x3c8d7d[_0xbb10('0x39')]['length']?_0x3c8d7d[_0xbb10('0x39')]:_0x56943c[_0xbb10('0x33')];if(!_0x188cbd[_0xbb10('0x34')][_0xbb10('0x3a')]('nolimit')){_0x3c8d7d[_0xbb10('0x18')]=qs[_0xbb10('0x18')](_0x188cbd['query'][_0xbb10('0x18')]);_0x3c8d7d[_0xbb10('0x16')]=qs[_0xbb10('0x16')](_0x188cbd[_0xbb10('0x34')][_0xbb10('0x16')]);}_0x3c8d7d[_0xbb10('0x3b')]=qs['sort'](_0x188cbd[_0xbb10('0x34')][_0xbb10('0x3c')]);_0x3c8d7d[_0xbb10('0x3d')]=qs[_0xbb10('0x36')](_['pick'](_0x188cbd[_0xbb10('0x34')],_0x56943c[_0xbb10('0x36')]),_0x150107);var _0x23dc18=[];var _0x403beb=squel['select']()[_0xbb10('0x3e')]('id')[_0xbb10('0x3e')]('name')['field'](_0xbb10('0x3f'))['from'](_0xbb10('0x40'));var _0x180933=squel['select']()[_0xbb10('0x3e')](_0xbb10('0x41'))[_0xbb10('0x3e')]('u.fullname')[_0xbb10('0x3e')](_0xbb10('0x42'))[_0xbb10('0x43')](_0xbb10('0x44'),'ui')[_0xbb10('0x45')](_0xbb10('0x46'),'u',_0xbb10('0x47'));var _0x3efa96=squel[_0xbb10('0x48')]()[_0xbb10('0x43')](_0xbb10('0x49'),'i')[_0xbb10('0x45')]('cm_contacts','c',_0xbb10('0x4a'))[_0xbb10('0x45')]('users','o',_0xbb10('0x4b'))[_0xbb10('0x45')](_0xbb10('0x4c'),'a',_0xbb10('0x4d'))[_0xbb10('0x45')](_0xbb10('0x4e'),'me',_0xbb10('0x4f'))['left_join']('mail_interaction_has_tags','it',_0xbb10('0x50'))[_0xbb10('0x45')](_0xbb10('0x40'),'t','t.id\x20=\x20it.TagId');var _0x5f0c12=squel[_0xbb10('0x51')]();var _0x34cf4e=[];var _0x1bd054=squel[_0xbb10('0x51')]();var _0x10159b;if(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x52')]){_0x10159b=as[_0xbb10('0x53')](_0x188cbd[_0xbb10('0x34')][_0xbb10('0x52')]);var _0x550111=_0x10159b['sqlOperator'];for(var _0x412e13=0x0;_0x412e13<_0x10159b[_0xbb10('0x54')][_0xbb10('0x55')];_0x412e13++){var _0xb014b0=_0x10159b[_0xbb10('0x54')][_0x412e13];var _0x440f9e='i';var _0x358e7e=_[_0xbb10('0x56')](_0x150107,[_0xbb10('0x21'),_0xb014b0[_0xbb10('0x3e')]]);if(!_0x358e7e){switch(_0xb014b0[_0xbb10('0x3e')]){case _0xbb10('0x57'):if(_0xb014b0[_0xbb10('0x58')]==0x1){_0x3efa96[_0xbb10('0x59')]('`'+_0xb014b0[_0xbb10('0x3e')]+'`\x20=\x200');}else{_0x3efa96[_0xbb10('0x59')]('`'+_0xb014b0['field']+_0xbb10('0x5a'));}break;case _0xbb10('0x5b'):if(_0xb014b0[_0xbb10('0x5c')]===_0xbb10('0x5d')){if(_0xb014b0[_0xbb10('0x58')][_0xbb10('0x26')]('\x20')[_0xbb10('0x55')]>0x1){_0x5f0c12[_0x550111](_0xbb10('0x5e'),qs[_0xbb10('0x5f')](_0xb014b0[_0xbb10('0x58')]),null);}else{var _0x44a056='%'+_0xb014b0[_0xbb10('0x58')]+'%';_0x5f0c12[_0x550111](_0xbb10('0x60'),_0x44a056,_0x44a056,_0x44a056);}}else{_0x358e7e=_[_0xbb10('0x56')](_0x150107,[_0xbb10('0x21'),'ContactId']);_0xb014b0[_0xbb10('0x3e')]=_0xbb10('0x61');_0x155dc5=as[_0xbb10('0x62')](_0x440f9e,_0x358e7e[_0xbb10('0x63')],_0xb014b0);_0x5f0c12[_0x550111](_0x155dc5[_0xbb10('0x64')],_0x155dc5[_0xbb10('0x58')]['start'],_0x155dc5[_0xbb10('0x58')][_0xbb10('0x13')]);}break;case _0xbb10('0x65'):var _0x14fed3=_0xb014b0[_0xbb10('0x58')][_0xbb10('0x26')](',')[_0xbb10('0x30')](function(_0x12ec18){return Number(_0x12ec18);});_0x14fed3[_0xbb10('0x27')](function(_0x40c4fb){_0x1bd054['or'](_0xbb10('0x66'),'%,'+_0x40c4fb+',%');});_0x34cf4e=_[_0xbb10('0x67')](_0x34cf4e,_0x14fed3);break;case _0xbb10('0x68'):if(_0xb014b0['operator']==='$substring'){_0x5f0c12[_0x550111](_0xbb10('0x69'),'%'+_0xb014b0[_0xbb10('0x58')]+'%',null);}else{_0x358e7e=_[_0xbb10('0x56')](_0x150107,[_0xbb10('0x21'),'UserId']);_0xb014b0['field']=_0xbb10('0x6a');_0x155dc5=as[_0xbb10('0x62')](_0x440f9e,_0x358e7e[_0xbb10('0x63')],_0xb014b0);_0x5f0c12[_0x550111](_0x155dc5[_0xbb10('0x64')],_0x155dc5[_0xbb10('0x58')][_0xbb10('0x6b')],_0x155dc5[_0xbb10('0x58')]['end']);}break;case _0xbb10('0x2d'):_0x155dc5=as[_0xbb10('0x62')]('me',null,_0xb014b0);_0x5f0c12[_0x550111](_0x155dc5['text'],_0x155dc5['value']['start'],_0x155dc5[_0xbb10('0x58')][_0xbb10('0x13')]);break;}}else{var _0x155dc5=as['buildExpression'](_0x440f9e,_0x358e7e['type'],_0xb014b0);_0x5f0c12[_0x550111](_0x155dc5['text'],_0x155dc5[_0xbb10('0x58')][_0xbb10('0x6b')],_0x155dc5[_0xbb10('0x58')]['end']);}}}else{var _0xa1bbd9=_(_0x188cbd[_0xbb10('0x34')])['keys']()['map'](function(_0x27d7b9){return _[_0xbb10('0x6c')](_0x150107,[_0xbb10('0x21'),_0x27d7b9])?_0x27d7b9:undefined;})[_0xbb10('0x6d')]()['value']();if(!_[_0xbb10('0x6e')](_0xa1bbd9)){_0xa1bbd9[_0xbb10('0x27')](function(_0xa7179d){if(_0xa7179d==='MailAccountId'){_0x3efa96[_0xbb10('0x3d')](_0xbb10('0x6f'),[][_0xbb10('0x70')](_0x188cbd['query'][_0xa7179d]));}else if(_0xa7179d===_0xbb10('0x71')){var _0x31e85e=JSON[_0xbb10('0x72')](_0x188cbd[_0xbb10('0x34')][_0xa7179d])['$gte'];var _0x251417=JSON[_0xbb10('0x72')](_0x188cbd[_0xbb10('0x34')][_0xa7179d])[_0xbb10('0x73')];_0x3efa96['where'](_0xbb10('0x74'),_0x31e85e,_0x251417);}else{if(_0x188cbd[_0xbb10('0x34')][_0xa7179d]===_0xbb10('0x75')){_0x3efa96[_0xbb10('0x3d')]('i.'+_0xa7179d+_0xbb10('0x76'));}else{_0x3efa96[_0xbb10('0x3d')]('i.'+_0xa7179d+_0xbb10('0x77'),_0x188cbd['query'][_0xa7179d]);}}});}if(_0x188cbd['query']['read']){if(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x78')]==0x1){_0x3efa96[_0xbb10('0x59')]('`unreadMessages`\x20=\x200');}else{_0x3efa96['having'](_0xbb10('0x79'));}}if(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x7a')]){_0x34cf4e=_[_0xbb10('0x7b')](_0x188cbd[_0xbb10('0x34')][_0xbb10('0x7a')])?_0x188cbd['query'][_0xbb10('0x7a')]:new Array(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x7a')]);_0x34cf4e[_0xbb10('0x27')](function(_0x2aaaa6){_0x1bd054['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2aaaa6+',%');});}if(_0x188cbd['query']['filter']){var _0x329da7=_0x188cbd[_0xbb10('0x34')][_0xbb10('0x7c')][_0xbb10('0x7d')]('\x5c','\x5c\x5c')[_0xbb10('0x7d')](/'/g,'\x27\x27');if(qs[_0xbb10('0x7e')](_0x329da7)){_0x5f0c12['or']('i.id\x20LIKE\x20?',_0x329da7+'%');}else if(qs[_0xbb10('0x7f')](_0x329da7)){_0x5f0c12['or']('c.email\x20LIKE\x20?',_0x329da7+'%');}else{_0x5f0c12['or']('MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x329da7))['or'](_0xbb10('0x80'),qs[_0xbb10('0x5f')](_0x329da7));}}}_0x3efa96[_0xbb10('0x3d')](_0x5f0c12);_0x3efa96[_0xbb10('0x81')]('i.id');var _0x122d38={'type':db['Sequelize']['QueryTypes'][_0xbb10('0x82')],'raw':!![]};var _0xfe3db0=_0x3efa96[_0xbb10('0x83')]();_0xfe3db0[_0xbb10('0x3e')](_0xbb10('0x84'));_0xfe3db0['field'](_0xbb10('0x85'),_0xbb10('0x57'));if(_0x3c8d7d[_0xbb10('0x3b')]){_0x3c8d7d[_0xbb10('0x3b')][_0xbb10('0x27')](function(_0x27f42f){var _0x174395=_0x27f42f[0x0]==='contactName'?_0x27f42f[0x0]:'i.'+_0x27f42f[0x0];_0x3efa96[_0xbb10('0x3b')](_0x174395,_0x27f42f[0x1]===_0xbb10('0x86')?![]:!![]);});}if(!_[_0xbb10('0x6e')](_0x34cf4e)){_0x3efa96[_0xbb10('0x59')](_0x1bd054);_0xfe3db0[_0xbb10('0x3d')](_0xbb10('0x87'),_0x34cf4e);}BPromise[_0xbb10('0x88')]()[_0xbb10('0x1e')](function(){if(!_0x10159b){if(_0x188cbd['query'][_0xbb10('0x89')])return;_0xfe3db0[_0xbb10('0x3d')](_0xbb10('0x8a'));_0x3efa96['where']('i.MailAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x188cbd['user'][_0xbb10('0x8b')]!=='agent')return;return _0x188cbd['user'][_0xbb10('0x8c')]({'attributes':['id'],'raw':!![]})[_0xbb10('0x1e')](function(_0x33ff06){if(_[_0xbb10('0x6e')](_0x33ff06)){_0xfe3db0[_0xbb10('0x3d')](_0xbb10('0x8d'));_0x3efa96[_0xbb10('0x3d')](_0xbb10('0x8d'));}else{_0xfe3db0[_0xbb10('0x3d')]('i.MailAccountId\x20IN\x20?',_[_0xbb10('0x30')](_0x33ff06,'id'));_0x3efa96[_0xbb10('0x3d')](_0xbb10('0x6f'),_[_0xbb10('0x30')](_0x33ff06,'id'));}});})['then'](function(){if(_0x188cbd['user'][_0xbb10('0x8b')]===_0xbb10('0x8e')&&!_0x10159b&&!_0x188cbd[_0xbb10('0x34')][_0xbb10('0x89')])return[];return db['sequelize'][_0xbb10('0x34')](_0xfe3db0[_0xbb10('0x8f')](),_0x122d38);})[_0xbb10('0x1e')](function(_0xf7b3e1){_0x2b5352[_0xbb10('0x19')]=_0xf7b3e1['length'];if(_0x2b5352['count']===0x0)return[];return db[_0xbb10('0x90')][_0xbb10('0x34')](_0x403beb[_0xbb10('0x8f')](),_0x122d38)['then'](function(_0x256b35){_0x23dc18=_[_0xbb10('0x91')](_0x256b35,'id');_0x122d38=_['merge'](_0x122d38,{'model':db['MailInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x38')]){_0x3c8d7d[_0xbb10('0x39')]['forEach'](function(_0x32d5a5){_0x3efa96[_0xbb10('0x3e')]('i.'+_0x32d5a5);});}else{_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x85'),_0xbb10('0x57'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x92'),_0xbb10('0x93'));_0x3efa96[_0xbb10('0x3e')]('a.mandatoryDisposition',_0xbb10('0x94'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x95'),_0xbb10('0x96'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x84'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x97'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x98'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x99'));_0x3efa96['field']('i.closedAt');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9a'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9b'));_0x3efa96[_0xbb10('0x3e')]('i.lastMsgDirection');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9c'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9d'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9e'));_0x3efa96['field'](_0xbb10('0x9f'));_0x3efa96[_0xbb10('0x3e')]('i.substatus');_0x3efa96[_0xbb10('0x3e')]('i.to');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa0'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa1'));_0x3efa96[_0xbb10('0x3e')]('i.UserId');_0x3efa96[_0xbb10('0x3e')]('c.firstName',_0xbb10('0xa2'));_0x3efa96[_0xbb10('0x3e')]('c.lastName','Contact.lastName');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa3'),_0xbb10('0xa4'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa5'),_0xbb10('0xa6'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa7'),_0xbb10('0xa8'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa9'),'Contact.fax');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xaa'),_0xbb10('0xab'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xac'),_0xbb10('0xad'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xae'),_0xbb10('0x24'));}if(_0x3c8d7d[_0xbb10('0x18')])_0x3efa96[_0xbb10('0x18')](_0x3c8d7d[_0xbb10('0x18')]);if(_0x3c8d7d['offset'])_0x3efa96[_0xbb10('0x16')](_0x3c8d7d['offset']);return db[_0xbb10('0x90')][_0xbb10('0x34')](_0x3efa96[_0xbb10('0x8f')](),_0x122d38);})[_0xbb10('0x1e')](function(_0x38d369){if(_0x38d369['length']>0x0)_0x180933[_0xbb10('0x3d')](_0xbb10('0xaf'),_[_0xbb10('0x30')](_0x38d369,'id'));return db[_0xbb10('0x90')][_0xbb10('0x34')](_0x180933[_0xbb10('0x8f')](),_0x122d38)['then'](function(_0x4bd470){var _0x5cc9d7=_[_0xbb10('0xb0')](_0x4bd470,_0xbb10('0xb1'));var _0x57d5a1=[];return db[_0xbb10('0xb2')][_0xbb10('0xb3')]({'attributes':['enableEmailPreview'],'raw':!![]})[_0xbb10('0x1e')](function(_0xaede56){var _0x5642c3=_0xaede56[_0xbb10('0xb4')];_0x38d369['forEach'](function(_0x34cec7){_0x57d5a1[_0xbb10('0x28')](updateMailInteraction(_0x34cec7,_0x23dc18,_0x5cc9d7,_0x5642c3));});return BPromise['all'](_0x57d5a1);});});});})[_0xbb10('0x1e')](function(_0x28cc74){_0x2b5352['rows']=_0x28cc74;return _0x2b5352;})['then'](respondWithFilteredResult(_0x10202c,_0x3c8d7d))[_0xbb10('0x2e')](handleError(_0x10202c,null));};exports[_0xbb10('0xb5')]=function(_0x3e0e34,_0x3299bc){var _0x3ceb77={'raw':![],'where':{'id':_0x3e0e34[_0xbb10('0xb6')]['id']}},_0x4c3bdc={};_0x4c3bdc[_0xbb10('0x33')]=_[_0xbb10('0x35')](db['MailInteraction'][_0xbb10('0xb7')]);_0x4c3bdc[_0xbb10('0x34')]=_[_0xbb10('0x35')](_0x3e0e34[_0xbb10('0x34')]);_0x4c3bdc[_0xbb10('0x36')]=_[_0xbb10('0x37')](_0x4c3bdc[_0xbb10('0x33')],_0x4c3bdc[_0xbb10('0x34')]);_0x3ceb77[_0xbb10('0x39')]=_['intersection'](_0x4c3bdc['model'],qs[_0xbb10('0x38')](_0x3e0e34[_0xbb10('0x34')][_0xbb10('0x38')]));_0x3ceb77[_0xbb10('0x39')]=_0x3ceb77[_0xbb10('0x39')][_0xbb10('0x55')]?_0x3ceb77[_0xbb10('0x39')]:_0x4c3bdc[_0xbb10('0x33')];if(_0x3e0e34[_0xbb10('0x34')][_0xbb10('0xb8')]){_0x3ceb77[_0xbb10('0xb9')]=[{'all':!![]}];}_0x3ceb77=_[_0xbb10('0xba')]({},_0x3ceb77,_0x3e0e34[_0xbb10('0xbb')]);return db['MailInteraction'][_0xbb10('0x56')](_0x3ceb77)[_0xbb10('0x1e')](handleEntityNotFound(_0x3299bc,null))[_0xbb10('0x1e')](respondWithResult(_0x3299bc,null))[_0xbb10('0x2e')](handleError(_0x3299bc,null));};exports[_0xbb10('0xbc')]=function(_0xd9284e,_0x4258fc){return db[_0xbb10('0x31')][_0xbb10('0xbc')](_0xd9284e[_0xbb10('0xbd')],{})[_0xbb10('0x1e')](respondWithResult(_0x4258fc,0xc9))['catch'](handleError(_0x4258fc,null));};exports[_0xbb10('0x1c')]=function(_0x5e1ac5,_0x3faaca){if(_0x5e1ac5[_0xbb10('0xbd')]['id']){delete _0x5e1ac5[_0xbb10('0xbd')]['id'];}return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x5e1ac5[_0xbb10('0xb6')]['id']}})['then'](handleEntityNotFound(_0x3faaca,null))[_0xbb10('0x1e')](saveUpdates(_0x5e1ac5['body'],null))[_0xbb10('0x1e')](respondWithResult(_0x3faaca,null))[_0xbb10('0x2e')](handleError(_0x3faaca,null));};exports[_0xbb10('0x1d')]=function(_0x576bb6,_0x2b652c){return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x576bb6[_0xbb10('0xb6')]['id']}})[_0xbb10('0x1e')](handleEntityNotFound(_0x2b652c,null))[_0xbb10('0x1e')](removeEntity(_0x2b652c,null))[_0xbb10('0x2e')](handleError(_0x2b652c,null));};exports[_0xbb10('0xbe')]=function(_0x589565,_0x3696b3){return db['MailInteraction'][_0xbb10('0xbe')]()[_0xbb10('0x1e')](respondWithResult(_0x3696b3,null))[_0xbb10('0x2e')](handleError(_0x3696b3,null));};exports[_0xbb10('0xbf')]=function(_0x44c229,_0x40271f){return db[_0xbb10('0x29')]['find']({'where':{'id':_0x44c229[_0xbb10('0xb6')]['id']}})['then'](handleEntityNotFound(_0x40271f,null))['then'](function(_0x1513e0){if(_0x1513e0){return _0x1513e0[_0xbb10('0xbf')](_0x44c229[_0xbb10('0xbd')][_0xbb10('0xc0')],_[_0xbb10('0xc1')](_0x44c229[_0xbb10('0xbd')],['ids','id'])||{});}})[_0xbb10('0x1e')](respondWithResult(_0x40271f,null))[_0xbb10('0x2e')](handleError(_0x40271f,null));};exports[_0xbb10('0xc2')]=function(_0xb1b7c8,_0x136520){var _0x28127c={'raw':![],'where':{}};var _0x528aff={};var _0xdfdc42={'count':0x0,'rows':[]};return db[_0xbb10('0x31')][_0xbb10('0xb3')]({'where':{'id':_0xb1b7c8[_0xbb10('0xb6')]['id']}})[_0xbb10('0x1e')](handleEntityNotFound(_0x136520,null))[_0xbb10('0x1e')](function(_0x2764e1){if(_0x2764e1){_0x528aff['model']=_[_0xbb10('0x35')](db['MailMessage'][_0xbb10('0xb7')]);_0x528aff['query']=_['keys'](_0xb1b7c8[_0xbb10('0x34')]);_0x528aff[_0xbb10('0x36')]=_[_0xbb10('0x37')](_0x528aff[_0xbb10('0x33')],_0x528aff[_0xbb10('0x34')]);_0x28127c['attributes']=_[_0xbb10('0x37')](_0x528aff['model'],qs['fields'](_0xb1b7c8['query'][_0xbb10('0x38')]));_0x28127c[_0xbb10('0x39')]=_0x28127c[_0xbb10('0x39')][_0xbb10('0x55')]?_0x28127c[_0xbb10('0x39')]:_0x528aff['model'];if(!_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0x3a')](_0xbb10('0xc3'))){_0x28127c[_0xbb10('0x18')]=qs[_0xbb10('0x18')](_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0x18')]);_0x28127c['offset']=qs['offset'](_0xb1b7c8['query'][_0xbb10('0x16')]);}_0x28127c[_0xbb10('0x3b')]=qs[_0xbb10('0x3c')](_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0x3c')]);_0x28127c[_0xbb10('0x3d')]=qs[_0xbb10('0x36')](_[_0xbb10('0xc4')](_0xb1b7c8[_0xbb10('0x34')],_0x528aff[_0xbb10('0x36')]));_0x28127c['where']['MailInteractionId']=_0x2764e1['id'];if(_0xb1b7c8['query'][_0xbb10('0x7c')]){_0x28127c[_0xbb10('0x3d')]=_[_0xbb10('0xba')](_0x28127c['where'],{'$or':_[_0xbb10('0x30')](_0x28127c[_0xbb10('0x39')],function(_0x2c638d){var _0x290280={};_0x290280[_0x2c638d]={'$like':'%'+_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0x7c')]+'%'};return _0x290280;})});}if(_0xb1b7c8['query']['$gte']){var _0x356660=_0xb1b7c8['query'][_0xbb10('0xc5')][_0xbb10('0x26')](',');var _0x152ca9={};_0x152ca9[_0x356660[0x0]]={'$gte':moment(_0x356660[0x1])[_0xbb10('0xc6')](_0xbb10('0xc7'))};_0x28127c[_0xbb10('0x3d')]=_[_0xbb10('0xba')](_0x28127c[_0xbb10('0x3d')],_0x152ca9);}_0x28127c=_[_0xbb10('0xba')]({},_0x28127c,_0xb1b7c8[_0xbb10('0xbb')]);return db['MailMessage'][_0xbb10('0x19')]({'where':_0x28127c['where']})[_0xbb10('0x1e')](function(_0x5547fa){_0xdfdc42[_0xbb10('0x19')]=_0x5547fa;if(_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0xb8')]){_0x28127c[_0xbb10('0xb9')]=[{'all':!![]}];}return db['MailMessage'][_0xbb10('0xc8')](_0x28127c);})['then'](function(_0xfe1154){if(_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0xc9')]==='true'){for(var _0x298167=0x0;_0x298167<_0xfe1154[_0xbb10('0x55')];_0x298167++){_0xfe1154[_0x298167][_0xbb10('0xbd')]=juice(_0xfe1154[_0x298167][_0xbb10('0xbd')]);}}_0xdfdc42[_0xbb10('0xca')]=_0xfe1154;return _0xdfdc42;});}})[_0xbb10('0x1e')](respondWithFilteredResult(_0x136520,_0x28127c))['catch'](handleError(_0x136520,null));};exports['addTags']=function(_0x522a88,_0x26a752){return db['MailInteraction'][_0xbb10('0x56')]({'where':{'id':_0x522a88['params']['id']}})[_0xbb10('0x1e')](handleEntityNotFound(_0x26a752,null))[_0xbb10('0x1e')](function(_0x385ad3){if(_0x385ad3){return _0x385ad3['setTags'](_0x522a88['body'][_0xbb10('0xc0')],_[_0xbb10('0xc1')](_0x522a88[_0xbb10('0xbd')],['ids','id'])||{})[_0xbb10('0xcb')](function(){return db[_0xbb10('0x65')][_0xbb10('0xc8')]({'attributes':['id','name','color'],'where':{'id':_0x522a88['body'][_0xbb10('0xc0')]}});})['then'](function(_0x3dfbcd){socket[_0xbb10('0xcc')](_0xbb10('0xcd'),{'id':Number(_0x522a88[_0xbb10('0xb6')]['id']),'tags':_0x3dfbcd||[]});return{'id':Number(_0x522a88[_0xbb10('0xb6')]['id']),'tags':_0x3dfbcd||[]};});}})[_0xbb10('0x1e')](respondWithResult(_0x26a752,null))[_0xbb10('0x2e')](handleError(_0x26a752,null));};exports[_0xbb10('0xce')]=function(_0x2746eb,_0x431792){return db[_0xbb10('0x31')]['find']({'where':{'id':_0x2746eb[_0xbb10('0xb6')]['id']}})[_0xbb10('0x1e')](handleEntityNotFound(_0x431792,null))['then'](function(_0x14ef50){if(_0x14ef50){return _0x14ef50['removeTags'](_0x2746eb['query'][_0xbb10('0xc0')]);}})[_0xbb10('0x1e')](respondWithStatusCode(_0x431792,null))[_0xbb10('0x2e')](handleError(_0x431792,null));};exports[_0xbb10('0xcf')]=function(_0x99c4,_0x4ca4ce){var _0x161171=moment()[_0xbb10('0xd0')]()['toString']();var _0xa45726=path[_0xbb10('0xd1')](config['root'],_0xbb10('0xd2'),'files',_0xbb10('0xd3'));var _0x8e8049=path[_0xbb10('0xd1')](config[_0xbb10('0xd4')],_0xbb10('0xd2'),_0xbb10('0xd5'),_0xbb10('0xd6'));var _0x56f902=path[_0xbb10('0xd1')](_0xa45726,_0x161171);var _0x4720a1=util[_0xbb10('0xc6')](_0xbb10('0xd7'),_0x99c4[_0xbb10('0xb6')]['id'],_0x161171);var _0x1301e3=path['join'](_0xa45726,_0x4720a1);var _0x550301=[];if(_0x99c4['query'][_0xbb10('0xd6')]){_0x550301[_0xbb10('0x28')]({'model':db[_0xbb10('0xd8')],'as':_0xbb10('0xd9'),'raw':!![]});}var _0x57700b=[{'model':db[_0xbb10('0x29')],'as':_0xbb10('0xda'),'attributes':['id',_0xbb10('0xbd'),'from','to','cc','bcc',_0xbb10('0xdb'),'createdAt'],'where':{'secret':![]},'order':qs[_0xbb10('0x3c')]('id'),'include':_0x550301}];return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x99c4[_0xbb10('0xb6')]['id']},'include':_0x57700b})[_0xbb10('0x1e')](handleEntityNotFound(_0x4ca4ce,null))[_0xbb10('0x1e')](function(_0x1fe250){if(_0x1fe250&&_0x1fe250['Messages']){var _0x424371=_0x1fe250[_0xbb10('0xdc')]({'plain':!![]});fs['mkdirSync'](_0x56f902);return BPromise[_0xbb10('0xdd')](_0x424371[_0xbb10('0xda')],function(_0x32f261,_0x5b11a2){var _0x4b490a={'from':_0x32f261['from'],'to':_0x32f261['to'],'subject':_0x32f261[_0xbb10('0xdb')],'html':_0x32f261[_0xbb10('0xbd')],'headers':{'Date':moment(_0x32f261['createdAt'])[_0xbb10('0xc6')](_0xbb10('0xde'))},'attachments':[]};if(_0x32f261['cc']){_0x4b490a[_0xbb10('0xdf')]['Cc']=_0x32f261['cc'];}if(_0x32f261[_0xbb10('0xe0')]){_0x4b490a[_0xbb10('0xdf')][_0xbb10('0xe1')]=_0x32f261[_0xbb10('0xe0')];}return new BPromise(function(_0x48f0eb,_0x304603){if(_0x32f261['Attachments']){for(var _0x5a7c4e=0x0;_0x5a7c4e<_0x32f261['Attachments'][_0xbb10('0x55')];_0x5a7c4e++){var _0x572d73=_0x32f261['Attachments'][_0x5a7c4e];var _0x1f09f1=path['join'](_0x8e8049,_0x572d73[_0xbb10('0xe2')]);if(fs[_0xbb10('0xe3')](_0x1f09f1)){_0x4b490a[_0xbb10('0xd6')]['push']({'name':_0x572d73['name'],'contentType':_0x572d73[_0xbb10('0x63')],'data':fs['readFileSync'](_0x1f09f1)});}}}emlformat[_0xbb10('0xe4')](_0x4b490a,function(_0x211172,_0x589ecb){if(_0x211172)return _0x304603(_0x211172);fs['writeFileSync'](path[_0xbb10('0xd1')](_0x56f902,util[_0xbb10('0xc6')](_0xbb10('0xe5'),_0x5b11a2)),_0x589ecb);return _0x48f0eb(_0x589ecb);});});})['then'](function(){return new BPromise(function(_0x4f4aa8,_0x426a4f){zipdir(_0x56f902,{'saveTo':_0x1301e3},function(_0x22f153,_0x4d47cc){if(_0x22f153)return _0x426a4f(_0x22f153);return _0x4f4aa8(_0x4d47cc);});})[_0xbb10('0x1e')](function(){return new BPromise(function(_0x203e5a,_0xe88e90){rimraf(_0x56f902,function(_0x4845b5){if(_0x4845b5)_0xe88e90(_0x4845b5);return _0x203e5a();});});})[_0xbb10('0x1e')](function(){return _0x4ca4ce[_0xbb10('0xcf')](_0x1301e3,_0x4720a1,function(_0x166f4f){if(!_0x166f4f)fs[_0xbb10('0xe6')](_0x1301e3);});});});}else{return _0x4ca4ce[_0xbb10('0x12')](0xc8);}})[_0xbb10('0x2e')](handleError(_0x4ca4ce,null));}; \ No newline at end of file +var _0xb10b=['Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','groupBy','MailInteractionId','Setting','findOne','enableEmailPreview','show','params','rawAttributes','includeAll','include','merge','options','create','body','describe','addMessage','ids','omit','getMessages','nolimit','pick','$gte','format','YYYY-MM-DD\x20HH:mm:ss','findAll','inlineCss','rows','spread','emit','mailInteractionTags:save','removeTags','download','unix','join','server','tmp','root','files','attachments','transcript-%d-%s.zip','Attachment','Attachments','Messages','subject','get','each','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','Bcc','basename','existsSync','build','message%d.eml','unlinkSync','eml-format','zip-dir','moment','bluebird','path','lodash','squel','juice','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy','then','error','stack','name','send','fullname','TagIds','Tags','split','forEach','push','MailMessage','out','-id','trimStart','plainBody','catch','index','map','MailInteraction','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','field','color','tools_tags','u.id','ui.MailInteractionId','from','user_has_mail_interactions','left_join','users','u.id\x20=\x20ui.UserId','select','mail_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','mail_messages','me.MailInteractionId\x20=\x20i.id','it.MailInteractionId\x20=\x20i.id','expr','search','parseSearch','conditions','length','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','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','start','some','compact','isEmpty','i.MailAccountId\x20IN\x20?','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','isEmail','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','resolve','MailAccountId','i.MailAccountId\x20IS\x20NOT\x20NULL','role','getMailAccounts','i.MailAccountId\x20IS\x20NULL','agent','toString','sequelize','keyBy','a.key','Account.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','contactName','i.createdAt','i.updatedAt','i.closed','i.attach','i.lastMsgAt','i.subject','i.disposition','i.secondDisposition','i.thirdDisposition','i.ContactId','i.MailAccountId','Contact.firstName','c.email'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xb10b,0x12a));var _0xbb10=function(_0x32c8c2,_0x5e0ab0){_0x32c8c2=_0x32c8c2-0x0;var _0x16ed42=_0xb10b[_0x32c8c2];return _0x16ed42;};'use strict';var emlformat=require(_0xbb10('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var BPromise=require(_0xbb10('0x3'));var util=require('util');var path=require(_0xbb10('0x4'));var fs=require('fs');var _=require(_0xbb10('0x5'));var squel=require(_0xbb10('0x6'));var juice=require(_0xbb10('0x7'));var Redis=require(_0xbb10('0x8'));var qs=require(_0xbb10('0x9'));var as=require('../../components/parsers/advancedSearch');var logger=require(_0xbb10('0xa'))(_0xbb10('0xb'));var config=require('../../config/environment');var db=require(_0xbb10('0xc'))['db'];config[_0xbb10('0xd')]=_[_0xbb10('0xe')](config[_0xbb10('0xd')],{'host':_0xbb10('0xf'),'port':0x18eb});var socket=require(_0xbb10('0x10'))(new Redis(config[_0xbb10('0xd')]));require(_0xbb10('0x11'))['register'](socket);function respondWithStatusCode(_0x4e47f8,_0x20bd61){_0x20bd61=_0x20bd61||0xcc;return function(_0x118a74){if(_0x118a74){return _0x4e47f8[_0xbb10('0x12')](_0x20bd61);}return _0x4e47f8['status'](_0x20bd61)[_0xbb10('0x13')]();};}function respondWithResult(_0x5be7e0,_0x44fb19){_0x44fb19=_0x44fb19||0xc8;return function(_0x916a32){if(_0x916a32){return _0x5be7e0[_0xbb10('0x14')](_0x44fb19)[_0xbb10('0x15')](_0x916a32);}};}function respondWithFilteredResult(_0x442548,_0x147230){return function(_0x58a612){if(_0x58a612){var _0x26e021=typeof _0x147230[_0xbb10('0x16')]===_0xbb10('0x17')&&typeof _0x147230[_0xbb10('0x18')]===_0xbb10('0x17');var _0x2f2ebf=_0x58a612[_0xbb10('0x19')];var _0x36b5e8=_0x26e021?0x0:_0x147230[_0xbb10('0x16')];var _0x2b184e=_0x26e021?_0x58a612['count']:_0x147230[_0xbb10('0x16')]+_0x147230[_0xbb10('0x18')];var _0x133ac2;if(_0x2b184e>=_0x2f2ebf){_0x2b184e=_0x2f2ebf;_0x133ac2=0xc8;}else{_0x133ac2=0xce;}_0x442548[_0xbb10('0x14')](_0x133ac2);return _0x442548[_0xbb10('0x1a')](_0xbb10('0x1b'),_0x36b5e8+'-'+_0x2b184e+'/'+_0x2f2ebf)[_0xbb10('0x15')](_0x58a612);}return null;};}function saveUpdates(_0x30efc6){return function(_0xbf2906){if(_0xbf2906){return _0xbf2906[_0xbb10('0x1c')](_0x30efc6)['then'](function(_0x5ff0cf){return _0x5ff0cf;});}return null;};}function removeEntity(_0x19f48d){return function(_0x388fab){if(_0x388fab){return _0x388fab[_0xbb10('0x1d')]()[_0xbb10('0x1e')](function(){_0x19f48d[_0xbb10('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x12f888){return function(_0x12ef77){if(!_0x12ef77){_0x12f888['sendStatus'](0x194);}return _0x12ef77;};}function handleError(_0x4c4b0d,_0x8e2b97){_0x8e2b97=_0x8e2b97||0x1f4;return function(_0x311abe){logger[_0xbb10('0x1f')](_0x311abe[_0xbb10('0x20')]);if(_0x311abe[_0xbb10('0x21')]){delete _0x311abe[_0xbb10('0x21')];}_0x4c4b0d[_0xbb10('0x14')](_0x8e2b97)[_0xbb10('0x22')](_0x311abe);};}function getInteractionUsers(_0x7f2377,_0x395404){return new BPromise(function(_0x3ba6cd,_0x26ad93){try{if(_0x395404[_0x7f2377['id']]){_0x7f2377['Users']=_['map'](_0x395404[_0x7f2377['id']],function(_0x4fb5e0){return{'id':_0x4fb5e0['id'],'fullname':_0x4fb5e0[_0xbb10('0x23')]};});}}catch(_0x3c5ae7){_0x26ad93(_0x3c5ae7);}_0x3ba6cd(_0x7f2377);});}function getInteractionTags(_0x2c89b9,_0x4e25ff){return new BPromise(function(_0x2fdde9,_0x24d586){try{if(_0x2c89b9[_0xbb10('0x24')]){_0x2c89b9[_0xbb10('0x25')]=[];_0x2c89b9[_0xbb10('0x24')][_0xbb10('0x26')](',')[_0xbb10('0x27')](function(_0x4aabb9){_0x2c89b9[_0xbb10('0x25')][_0xbb10('0x28')](_0x4e25ff[_0x4aabb9]);});}delete _0x2c89b9[_0xbb10('0x24')];}catch(_0x2e0249){_0x24d586(_0x2e0249);}_0x2fdde9(_0x2c89b9);});}function getLastMessageText(_0x1d30aa){return new BPromise(function(_0x2ff4c1,_0x5d5c80){return db[_0xbb10('0x29')]['findOne']({'where':{'$and':[{'MailInteractionId':_0x1d30aa['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0xbb10('0x2a')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':_0xbb10('0x2b'),'raw':!![]})[_0xbb10('0x1e')](function(_0x1b59f9){if(_0x1b59f9&&_0x1b59f9['plainBody']){_0x1d30aa['lastMsgText']=_[_0xbb10('0x2c')](_0x1b59f9[_0xbb10('0x2d')]);}_0x2ff4c1(_0x1d30aa);})['catch'](function(_0x359ad4){_0x5d5c80(_0x359ad4);});});}function updateMailInteraction(_0x37dde7,_0x2f653f,_0x1c0b57,_0x37a83f){return new BPromise(function(_0x138bc6,_0xf85197){return getInteractionUsers(_0x37dde7,_0x1c0b57)['then'](function(_0x25acb3){return getInteractionTags(_0x25acb3,_0x2f653f);})[_0xbb10('0x1e')](function(_0x441d15){if(_0x37a83f){_0x138bc6(getLastMessageText(_0x441d15));}else{_0x138bc6(_0x441d15);}})[_0xbb10('0x2e')](function(_0xfb2c5e){_0xf85197(_0xfb2c5e);});});}exports[_0xbb10('0x2f')]=function(_0x188cbd,_0x10202c){var _0x3c8d7d={},_0x56943c={},_0x2b5352={'count':0x0,'rows':[]};var _0x150107=_[_0xbb10('0x30')](db[_0xbb10('0x31')]['rawAttributes'],function(_0x111762){return{'name':_0x111762['fieldName'],'type':_0x111762['type'][_0xbb10('0x32')]};});_0x56943c[_0xbb10('0x33')]=_[_0xbb10('0x30')](_0x150107,_0xbb10('0x21'));_0x56943c[_0xbb10('0x34')]=_[_0xbb10('0x35')](_0x188cbd['query']);_0x56943c[_0xbb10('0x36')]=_[_0xbb10('0x37')](_0x56943c['model'],_0x56943c['query']);_0x3c8d7d['attributes']=_[_0xbb10('0x37')](_0x56943c[_0xbb10('0x33')],qs[_0xbb10('0x38')](_0x188cbd['query'][_0xbb10('0x38')]));_0x3c8d7d[_0xbb10('0x39')]=_0x3c8d7d[_0xbb10('0x39')]['length']?_0x3c8d7d[_0xbb10('0x39')]:_0x56943c[_0xbb10('0x33')];if(!_0x188cbd[_0xbb10('0x34')][_0xbb10('0x3a')]('nolimit')){_0x3c8d7d[_0xbb10('0x18')]=qs[_0xbb10('0x18')](_0x188cbd['query'][_0xbb10('0x18')]);_0x3c8d7d[_0xbb10('0x16')]=qs[_0xbb10('0x16')](_0x188cbd[_0xbb10('0x34')][_0xbb10('0x16')]);}_0x3c8d7d[_0xbb10('0x3b')]=qs['sort'](_0x188cbd[_0xbb10('0x34')][_0xbb10('0x3c')]);_0x3c8d7d[_0xbb10('0x3d')]=qs[_0xbb10('0x36')](_['pick'](_0x188cbd[_0xbb10('0x34')],_0x56943c[_0xbb10('0x36')]),_0x150107);var _0x23dc18=[];var _0x403beb=squel['select']()[_0xbb10('0x3e')]('id')[_0xbb10('0x3e')]('name')['field'](_0xbb10('0x3f'))['from'](_0xbb10('0x40'));var _0x180933=squel['select']()[_0xbb10('0x3e')](_0xbb10('0x41'))[_0xbb10('0x3e')]('u.fullname')[_0xbb10('0x3e')](_0xbb10('0x42'))[_0xbb10('0x43')](_0xbb10('0x44'),'ui')[_0xbb10('0x45')](_0xbb10('0x46'),'u',_0xbb10('0x47'));var _0x3efa96=squel[_0xbb10('0x48')]()[_0xbb10('0x43')](_0xbb10('0x49'),'i')[_0xbb10('0x45')]('cm_contacts','c',_0xbb10('0x4a'))[_0xbb10('0x45')]('users','o',_0xbb10('0x4b'))[_0xbb10('0x45')](_0xbb10('0x4c'),'a',_0xbb10('0x4d'))[_0xbb10('0x45')](_0xbb10('0x4e'),'me',_0xbb10('0x4f'))['left_join']('mail_interaction_has_tags','it',_0xbb10('0x50'))[_0xbb10('0x45')](_0xbb10('0x40'),'t','t.id\x20=\x20it.TagId');var _0x5f0c12=squel[_0xbb10('0x51')]();var _0x34cf4e=[];var _0x1bd054=squel[_0xbb10('0x51')]();var _0x10159b;if(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x52')]){_0x10159b=as[_0xbb10('0x53')](_0x188cbd[_0xbb10('0x34')][_0xbb10('0x52')]);var _0x550111=_0x10159b['sqlOperator'];for(var _0x412e13=0x0;_0x412e13<_0x10159b[_0xbb10('0x54')][_0xbb10('0x55')];_0x412e13++){var _0xb014b0=_0x10159b[_0xbb10('0x54')][_0x412e13];var _0x440f9e='i';var _0x358e7e=_[_0xbb10('0x56')](_0x150107,[_0xbb10('0x21'),_0xb014b0[_0xbb10('0x3e')]]);if(!_0x358e7e){switch(_0xb014b0[_0xbb10('0x3e')]){case _0xbb10('0x57'):if(_0xb014b0[_0xbb10('0x58')]==0x1){_0x3efa96[_0xbb10('0x59')]('`'+_0xb014b0[_0xbb10('0x3e')]+'`\x20=\x200');}else{_0x3efa96[_0xbb10('0x59')]('`'+_0xb014b0['field']+_0xbb10('0x5a'));}break;case _0xbb10('0x5b'):if(_0xb014b0[_0xbb10('0x5c')]===_0xbb10('0x5d')){if(_0xb014b0[_0xbb10('0x58')][_0xbb10('0x26')]('\x20')[_0xbb10('0x55')]>0x1){_0x5f0c12[_0x550111](_0xbb10('0x5e'),qs[_0xbb10('0x5f')](_0xb014b0[_0xbb10('0x58')]),null);}else{var _0x44a056='%'+_0xb014b0[_0xbb10('0x58')]+'%';_0x5f0c12[_0x550111](_0xbb10('0x60'),_0x44a056,_0x44a056,_0x44a056);}}else{_0x358e7e=_[_0xbb10('0x56')](_0x150107,[_0xbb10('0x21'),'ContactId']);_0xb014b0[_0xbb10('0x3e')]=_0xbb10('0x61');_0x155dc5=as[_0xbb10('0x62')](_0x440f9e,_0x358e7e[_0xbb10('0x63')],_0xb014b0);_0x5f0c12[_0x550111](_0x155dc5[_0xbb10('0x64')],_0x155dc5[_0xbb10('0x58')]['start'],_0x155dc5[_0xbb10('0x58')][_0xbb10('0x13')]);}break;case _0xbb10('0x65'):var _0x14fed3=_0xb014b0[_0xbb10('0x58')][_0xbb10('0x26')](',')[_0xbb10('0x30')](function(_0x12ec18){return Number(_0x12ec18);});_0x14fed3[_0xbb10('0x27')](function(_0x40c4fb){_0x1bd054['or'](_0xbb10('0x66'),'%,'+_0x40c4fb+',%');});_0x34cf4e=_[_0xbb10('0x67')](_0x34cf4e,_0x14fed3);break;case _0xbb10('0x68'):if(_0xb014b0['operator']==='$substring'){_0x5f0c12[_0x550111](_0xbb10('0x69'),'%'+_0xb014b0[_0xbb10('0x58')]+'%',null);}else{_0x358e7e=_[_0xbb10('0x56')](_0x150107,[_0xbb10('0x21'),'UserId']);_0xb014b0['field']=_0xbb10('0x6a');_0x155dc5=as[_0xbb10('0x62')](_0x440f9e,_0x358e7e[_0xbb10('0x63')],_0xb014b0);_0x5f0c12[_0x550111](_0x155dc5[_0xbb10('0x64')],_0x155dc5[_0xbb10('0x58')][_0xbb10('0x6b')],_0x155dc5[_0xbb10('0x58')]['end']);}break;case _0xbb10('0x2d'):_0x155dc5=as[_0xbb10('0x62')]('me',null,_0xb014b0);_0x5f0c12[_0x550111](_0x155dc5['text'],_0x155dc5['value']['start'],_0x155dc5[_0xbb10('0x58')][_0xbb10('0x13')]);break;}}else{var _0x155dc5=as['buildExpression'](_0x440f9e,_0x358e7e['type'],_0xb014b0);_0x5f0c12[_0x550111](_0x155dc5['text'],_0x155dc5[_0xbb10('0x58')][_0xbb10('0x6b')],_0x155dc5[_0xbb10('0x58')]['end']);}}}else{var _0xa1bbd9=_(_0x188cbd[_0xbb10('0x34')])['keys']()['map'](function(_0x27d7b9){return _[_0xbb10('0x6c')](_0x150107,[_0xbb10('0x21'),_0x27d7b9])?_0x27d7b9:undefined;})[_0xbb10('0x6d')]()['value']();if(!_[_0xbb10('0x6e')](_0xa1bbd9)){_0xa1bbd9[_0xbb10('0x27')](function(_0xa7179d){if(_0xa7179d==='MailAccountId'){_0x3efa96[_0xbb10('0x3d')](_0xbb10('0x6f'),[][_0xbb10('0x70')](_0x188cbd['query'][_0xa7179d]));}else if(_0xa7179d===_0xbb10('0x71')){var _0x31e85e=JSON[_0xbb10('0x72')](_0x188cbd[_0xbb10('0x34')][_0xa7179d])['$gte'];var _0x251417=JSON[_0xbb10('0x72')](_0x188cbd[_0xbb10('0x34')][_0xa7179d])[_0xbb10('0x73')];_0x3efa96['where'](_0xbb10('0x74'),_0x31e85e,_0x251417);}else{if(_0x188cbd[_0xbb10('0x34')][_0xa7179d]===_0xbb10('0x75')){_0x3efa96[_0xbb10('0x3d')]('i.'+_0xa7179d+_0xbb10('0x76'));}else{_0x3efa96[_0xbb10('0x3d')]('i.'+_0xa7179d+_0xbb10('0x77'),_0x188cbd['query'][_0xa7179d]);}}});}if(_0x188cbd['query']['read']){if(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x78')]==0x1){_0x3efa96[_0xbb10('0x59')]('`unreadMessages`\x20=\x200');}else{_0x3efa96['having'](_0xbb10('0x79'));}}if(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x7a')]){_0x34cf4e=_[_0xbb10('0x7b')](_0x188cbd[_0xbb10('0x34')][_0xbb10('0x7a')])?_0x188cbd['query'][_0xbb10('0x7a')]:new Array(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x7a')]);_0x34cf4e[_0xbb10('0x27')](function(_0x2aaaa6){_0x1bd054['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2aaaa6+',%');});}if(_0x188cbd['query']['filter']){var _0x329da7=_0x188cbd[_0xbb10('0x34')][_0xbb10('0x7c')][_0xbb10('0x7d')]('\x5c','\x5c\x5c')[_0xbb10('0x7d')](/'/g,'\x27\x27');if(qs[_0xbb10('0x7e')](_0x329da7)){_0x5f0c12['or']('i.id\x20LIKE\x20?',_0x329da7+'%');}else if(qs[_0xbb10('0x7f')](_0x329da7)){_0x5f0c12['or']('c.email\x20LIKE\x20?',_0x329da7+'%');}else{_0x5f0c12['or']('MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x329da7))['or'](_0xbb10('0x80'),qs[_0xbb10('0x5f')](_0x329da7));}}}_0x3efa96[_0xbb10('0x3d')](_0x5f0c12);_0x3efa96[_0xbb10('0x81')]('i.id');var _0x122d38={'type':db['Sequelize']['QueryTypes'][_0xbb10('0x82')],'raw':!![]};var _0xfe3db0=_0x3efa96[_0xbb10('0x83')]();_0xfe3db0[_0xbb10('0x3e')](_0xbb10('0x84'));_0xfe3db0['field'](_0xbb10('0x85'),_0xbb10('0x57'));if(_0x3c8d7d[_0xbb10('0x3b')]){_0x3c8d7d[_0xbb10('0x3b')][_0xbb10('0x27')](function(_0x27f42f){var _0x174395=_0x27f42f[0x0]==='contactName'?_0x27f42f[0x0]:'i.'+_0x27f42f[0x0];_0x3efa96[_0xbb10('0x3b')](_0x174395,_0x27f42f[0x1]===_0xbb10('0x86')?![]:!![]);});}if(!_[_0xbb10('0x6e')](_0x34cf4e)){_0x3efa96[_0xbb10('0x59')](_0x1bd054);_0xfe3db0[_0xbb10('0x3d')](_0xbb10('0x87'),_0x34cf4e);}BPromise[_0xbb10('0x88')]()[_0xbb10('0x1e')](function(){if(!_0x10159b){if(_0x188cbd['query'][_0xbb10('0x89')])return;_0xfe3db0[_0xbb10('0x3d')](_0xbb10('0x8a'));_0x3efa96['where']('i.MailAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x188cbd['user'][_0xbb10('0x8b')]!=='agent')return;return _0x188cbd['user'][_0xbb10('0x8c')]({'attributes':['id'],'raw':!![]})[_0xbb10('0x1e')](function(_0x33ff06){if(_[_0xbb10('0x6e')](_0x33ff06)){_0xfe3db0[_0xbb10('0x3d')](_0xbb10('0x8d'));_0x3efa96[_0xbb10('0x3d')](_0xbb10('0x8d'));}else{_0xfe3db0[_0xbb10('0x3d')]('i.MailAccountId\x20IN\x20?',_[_0xbb10('0x30')](_0x33ff06,'id'));_0x3efa96[_0xbb10('0x3d')](_0xbb10('0x6f'),_[_0xbb10('0x30')](_0x33ff06,'id'));}});})['then'](function(){if(_0x188cbd['user'][_0xbb10('0x8b')]===_0xbb10('0x8e')&&!_0x10159b&&!_0x188cbd[_0xbb10('0x34')][_0xbb10('0x89')])return[];return db['sequelize'][_0xbb10('0x34')](_0xfe3db0[_0xbb10('0x8f')](),_0x122d38);})[_0xbb10('0x1e')](function(_0xf7b3e1){_0x2b5352[_0xbb10('0x19')]=_0xf7b3e1['length'];if(_0x2b5352['count']===0x0)return[];return db[_0xbb10('0x90')][_0xbb10('0x34')](_0x403beb[_0xbb10('0x8f')](),_0x122d38)['then'](function(_0x256b35){_0x23dc18=_[_0xbb10('0x91')](_0x256b35,'id');_0x122d38=_['merge'](_0x122d38,{'model':db['MailInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x38')]){_0x3c8d7d[_0xbb10('0x39')]['forEach'](function(_0x32d5a5){_0x3efa96[_0xbb10('0x3e')]('i.'+_0x32d5a5);});}else{_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x85'),_0xbb10('0x57'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x92'),_0xbb10('0x93'));_0x3efa96[_0xbb10('0x3e')]('a.mandatoryDisposition',_0xbb10('0x94'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x95'),_0xbb10('0x96'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x84'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x97'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x98'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x99'));_0x3efa96['field']('i.closedAt');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9a'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9b'));_0x3efa96[_0xbb10('0x3e')]('i.lastMsgDirection');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9c'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9d'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9e'));_0x3efa96['field'](_0xbb10('0x9f'));_0x3efa96[_0xbb10('0x3e')]('i.substatus');_0x3efa96[_0xbb10('0x3e')]('i.to');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa0'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa1'));_0x3efa96[_0xbb10('0x3e')]('i.UserId');_0x3efa96[_0xbb10('0x3e')]('c.firstName',_0xbb10('0xa2'));_0x3efa96[_0xbb10('0x3e')]('c.lastName','Contact.lastName');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa3'),_0xbb10('0xa4'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa5'),_0xbb10('0xa6'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa7'),_0xbb10('0xa8'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa9'),'Contact.fax');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xaa'),_0xbb10('0xab'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xac'),_0xbb10('0xad'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xae'),_0xbb10('0x24'));}if(_0x3c8d7d[_0xbb10('0x18')])_0x3efa96[_0xbb10('0x18')](_0x3c8d7d[_0xbb10('0x18')]);if(_0x3c8d7d['offset'])_0x3efa96[_0xbb10('0x16')](_0x3c8d7d['offset']);return db[_0xbb10('0x90')][_0xbb10('0x34')](_0x3efa96[_0xbb10('0x8f')](),_0x122d38);})[_0xbb10('0x1e')](function(_0x38d369){if(_0x38d369['length']>0x0)_0x180933[_0xbb10('0x3d')](_0xbb10('0xaf'),_[_0xbb10('0x30')](_0x38d369,'id'));return db[_0xbb10('0x90')][_0xbb10('0x34')](_0x180933[_0xbb10('0x8f')](),_0x122d38)['then'](function(_0x4bd470){var _0x5cc9d7=_[_0xbb10('0xb0')](_0x4bd470,_0xbb10('0xb1'));var _0x57d5a1=[];return db[_0xbb10('0xb2')][_0xbb10('0xb3')]({'attributes':['enableEmailPreview'],'raw':!![]})[_0xbb10('0x1e')](function(_0xaede56){var _0x5642c3=_0xaede56[_0xbb10('0xb4')];_0x38d369['forEach'](function(_0x34cec7){_0x57d5a1[_0xbb10('0x28')](updateMailInteraction(_0x34cec7,_0x23dc18,_0x5cc9d7,_0x5642c3));});return BPromise['all'](_0x57d5a1);});});});})[_0xbb10('0x1e')](function(_0x28cc74){_0x2b5352['rows']=_0x28cc74;return _0x2b5352;})['then'](respondWithFilteredResult(_0x10202c,_0x3c8d7d))[_0xbb10('0x2e')](handleError(_0x10202c,null));};exports[_0xbb10('0xb5')]=function(_0x3e0e34,_0x3299bc){var _0x3ceb77={'raw':![],'where':{'id':_0x3e0e34[_0xbb10('0xb6')]['id']}},_0x4c3bdc={};_0x4c3bdc[_0xbb10('0x33')]=_[_0xbb10('0x35')](db['MailInteraction'][_0xbb10('0xb7')]);_0x4c3bdc[_0xbb10('0x34')]=_[_0xbb10('0x35')](_0x3e0e34[_0xbb10('0x34')]);_0x4c3bdc[_0xbb10('0x36')]=_[_0xbb10('0x37')](_0x4c3bdc[_0xbb10('0x33')],_0x4c3bdc[_0xbb10('0x34')]);_0x3ceb77[_0xbb10('0x39')]=_['intersection'](_0x4c3bdc['model'],qs[_0xbb10('0x38')](_0x3e0e34[_0xbb10('0x34')][_0xbb10('0x38')]));_0x3ceb77[_0xbb10('0x39')]=_0x3ceb77[_0xbb10('0x39')][_0xbb10('0x55')]?_0x3ceb77[_0xbb10('0x39')]:_0x4c3bdc[_0xbb10('0x33')];if(_0x3e0e34[_0xbb10('0x34')][_0xbb10('0xb8')]){_0x3ceb77[_0xbb10('0xb9')]=[{'all':!![]}];}_0x3ceb77=_[_0xbb10('0xba')]({},_0x3ceb77,_0x3e0e34[_0xbb10('0xbb')]);return db['MailInteraction'][_0xbb10('0x56')](_0x3ceb77)[_0xbb10('0x1e')](handleEntityNotFound(_0x3299bc,null))[_0xbb10('0x1e')](respondWithResult(_0x3299bc,null))[_0xbb10('0x2e')](handleError(_0x3299bc,null));};exports[_0xbb10('0xbc')]=function(_0xd9284e,_0x4258fc){return db[_0xbb10('0x31')][_0xbb10('0xbc')](_0xd9284e[_0xbb10('0xbd')],{})[_0xbb10('0x1e')](respondWithResult(_0x4258fc,0xc9))['catch'](handleError(_0x4258fc,null));};exports[_0xbb10('0x1c')]=function(_0x5e1ac5,_0x3faaca){if(_0x5e1ac5[_0xbb10('0xbd')]['id']){delete _0x5e1ac5[_0xbb10('0xbd')]['id'];}return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x5e1ac5[_0xbb10('0xb6')]['id']}})['then'](handleEntityNotFound(_0x3faaca,null))[_0xbb10('0x1e')](saveUpdates(_0x5e1ac5['body'],null))[_0xbb10('0x1e')](respondWithResult(_0x3faaca,null))[_0xbb10('0x2e')](handleError(_0x3faaca,null));};exports[_0xbb10('0x1d')]=function(_0x576bb6,_0x2b652c){return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x576bb6[_0xbb10('0xb6')]['id']}})[_0xbb10('0x1e')](handleEntityNotFound(_0x2b652c,null))[_0xbb10('0x1e')](removeEntity(_0x2b652c,null))[_0xbb10('0x2e')](handleError(_0x2b652c,null));};exports[_0xbb10('0xbe')]=function(_0x589565,_0x3696b3){return db['MailInteraction'][_0xbb10('0xbe')]()[_0xbb10('0x1e')](respondWithResult(_0x3696b3,null))[_0xbb10('0x2e')](handleError(_0x3696b3,null));};exports[_0xbb10('0xbf')]=function(_0x44c229,_0x40271f){return db[_0xbb10('0x29')]['find']({'where':{'id':_0x44c229[_0xbb10('0xb6')]['id']}})['then'](handleEntityNotFound(_0x40271f,null))['then'](function(_0x1513e0){if(_0x1513e0){return _0x1513e0[_0xbb10('0xbf')](_0x44c229[_0xbb10('0xbd')][_0xbb10('0xc0')],_[_0xbb10('0xc1')](_0x44c229[_0xbb10('0xbd')],['ids','id'])||{});}})[_0xbb10('0x1e')](respondWithResult(_0x40271f,null))[_0xbb10('0x2e')](handleError(_0x40271f,null));};exports[_0xbb10('0xc2')]=function(_0xb1b7c8,_0x136520){var _0x28127c={'raw':![],'where':{}};var _0x528aff={};var _0xdfdc42={'count':0x0,'rows':[]};return db[_0xbb10('0x31')][_0xbb10('0xb3')]({'where':{'id':_0xb1b7c8[_0xbb10('0xb6')]['id']}})[_0xbb10('0x1e')](handleEntityNotFound(_0x136520,null))[_0xbb10('0x1e')](function(_0x2764e1){if(_0x2764e1){_0x528aff['model']=_[_0xbb10('0x35')](db['MailMessage'][_0xbb10('0xb7')]);_0x528aff['query']=_['keys'](_0xb1b7c8[_0xbb10('0x34')]);_0x528aff[_0xbb10('0x36')]=_[_0xbb10('0x37')](_0x528aff[_0xbb10('0x33')],_0x528aff[_0xbb10('0x34')]);_0x28127c['attributes']=_[_0xbb10('0x37')](_0x528aff['model'],qs['fields'](_0xb1b7c8['query'][_0xbb10('0x38')]));_0x28127c[_0xbb10('0x39')]=_0x28127c[_0xbb10('0x39')][_0xbb10('0x55')]?_0x28127c[_0xbb10('0x39')]:_0x528aff['model'];if(!_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0x3a')](_0xbb10('0xc3'))){_0x28127c[_0xbb10('0x18')]=qs[_0xbb10('0x18')](_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0x18')]);_0x28127c['offset']=qs['offset'](_0xb1b7c8['query'][_0xbb10('0x16')]);}_0x28127c[_0xbb10('0x3b')]=qs[_0xbb10('0x3c')](_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0x3c')]);_0x28127c[_0xbb10('0x3d')]=qs[_0xbb10('0x36')](_[_0xbb10('0xc4')](_0xb1b7c8[_0xbb10('0x34')],_0x528aff[_0xbb10('0x36')]));_0x28127c['where']['MailInteractionId']=_0x2764e1['id'];if(_0xb1b7c8['query'][_0xbb10('0x7c')]){_0x28127c[_0xbb10('0x3d')]=_[_0xbb10('0xba')](_0x28127c['where'],{'$or':_[_0xbb10('0x30')](_0x28127c[_0xbb10('0x39')],function(_0x2c638d){var _0x290280={};_0x290280[_0x2c638d]={'$like':'%'+_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0x7c')]+'%'};return _0x290280;})});}if(_0xb1b7c8['query']['$gte']){var _0x356660=_0xb1b7c8['query'][_0xbb10('0xc5')][_0xbb10('0x26')](',');var _0x152ca9={};_0x152ca9[_0x356660[0x0]]={'$gte':moment(_0x356660[0x1])[_0xbb10('0xc6')](_0xbb10('0xc7'))};_0x28127c[_0xbb10('0x3d')]=_[_0xbb10('0xba')](_0x28127c[_0xbb10('0x3d')],_0x152ca9);}_0x28127c=_[_0xbb10('0xba')]({},_0x28127c,_0xb1b7c8[_0xbb10('0xbb')]);return db['MailMessage'][_0xbb10('0x19')]({'where':_0x28127c['where']})[_0xbb10('0x1e')](function(_0x5547fa){_0xdfdc42[_0xbb10('0x19')]=_0x5547fa;if(_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0xb8')]){_0x28127c[_0xbb10('0xb9')]=[{'all':!![]}];}return db['MailMessage'][_0xbb10('0xc8')](_0x28127c);})['then'](function(_0xfe1154){if(_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0xc9')]==='true'){for(var _0x298167=0x0;_0x298167<_0xfe1154[_0xbb10('0x55')];_0x298167++){_0xfe1154[_0x298167][_0xbb10('0xbd')]=juice(_0xfe1154[_0x298167][_0xbb10('0xbd')]);}}_0xdfdc42[_0xbb10('0xca')]=_0xfe1154;return _0xdfdc42;});}})[_0xbb10('0x1e')](respondWithFilteredResult(_0x136520,_0x28127c))['catch'](handleError(_0x136520,null));};exports['addTags']=function(_0x522a88,_0x26a752){return db['MailInteraction'][_0xbb10('0x56')]({'where':{'id':_0x522a88['params']['id']}})[_0xbb10('0x1e')](handleEntityNotFound(_0x26a752,null))[_0xbb10('0x1e')](function(_0x385ad3){if(_0x385ad3){return _0x385ad3['setTags'](_0x522a88['body'][_0xbb10('0xc0')],_[_0xbb10('0xc1')](_0x522a88[_0xbb10('0xbd')],['ids','id'])||{})[_0xbb10('0xcb')](function(){return db[_0xbb10('0x65')][_0xbb10('0xc8')]({'attributes':['id','name','color'],'where':{'id':_0x522a88['body'][_0xbb10('0xc0')]}});})['then'](function(_0x3dfbcd){socket[_0xbb10('0xcc')](_0xbb10('0xcd'),{'id':Number(_0x522a88[_0xbb10('0xb6')]['id']),'tags':_0x3dfbcd||[]});return{'id':Number(_0x522a88[_0xbb10('0xb6')]['id']),'tags':_0x3dfbcd||[]};});}})[_0xbb10('0x1e')](respondWithResult(_0x26a752,null))[_0xbb10('0x2e')](handleError(_0x26a752,null));};exports[_0xbb10('0xce')]=function(_0x2746eb,_0x431792){return db[_0xbb10('0x31')]['find']({'where':{'id':_0x2746eb[_0xbb10('0xb6')]['id']}})[_0xbb10('0x1e')](handleEntityNotFound(_0x431792,null))['then'](function(_0x14ef50){if(_0x14ef50){return _0x14ef50['removeTags'](_0x2746eb['query'][_0xbb10('0xc0')]);}})[_0xbb10('0x1e')](respondWithStatusCode(_0x431792,null))[_0xbb10('0x2e')](handleError(_0x431792,null));};exports[_0xbb10('0xcf')]=function(_0x99c4,_0x4ca4ce){var _0x161171=moment()[_0xbb10('0xd0')]()['toString']();var _0xa45726=path[_0xbb10('0xd1')](config['root'],_0xbb10('0xd2'),'files',_0xbb10('0xd3'));var _0x8e8049=path[_0xbb10('0xd1')](config[_0xbb10('0xd4')],_0xbb10('0xd2'),_0xbb10('0xd5'),_0xbb10('0xd6'));var _0x56f902=path[_0xbb10('0xd1')](_0xa45726,_0x161171);var _0x4720a1=util[_0xbb10('0xc6')](_0xbb10('0xd7'),_0x99c4[_0xbb10('0xb6')]['id'],_0x161171);var _0x1301e3=path['join'](_0xa45726,_0x4720a1);var _0x550301=[];if(_0x99c4['query'][_0xbb10('0xd6')]){_0x550301[_0xbb10('0x28')]({'model':db[_0xbb10('0xd8')],'as':_0xbb10('0xd9'),'raw':!![]});}var _0x57700b=[{'model':db[_0xbb10('0x29')],'as':_0xbb10('0xda'),'attributes':['id',_0xbb10('0xbd'),'from','to','cc','bcc',_0xbb10('0xdb'),'createdAt'],'where':{'secret':![]},'order':qs[_0xbb10('0x3c')]('id'),'include':_0x550301}];return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x99c4[_0xbb10('0xb6')]['id']},'include':_0x57700b})[_0xbb10('0x1e')](handleEntityNotFound(_0x4ca4ce,null))[_0xbb10('0x1e')](function(_0x1fe250){if(_0x1fe250&&_0x1fe250['Messages']){var _0x424371=_0x1fe250[_0xbb10('0xdc')]({'plain':!![]});fs['mkdirSync'](_0x56f902);return BPromise[_0xbb10('0xdd')](_0x424371[_0xbb10('0xda')],function(_0x32f261,_0x5b11a2){var _0x4b490a={'from':_0x32f261['from'],'to':_0x32f261['to'],'subject':_0x32f261[_0xbb10('0xdb')],'html':_0x32f261[_0xbb10('0xbd')],'headers':{'Date':moment(_0x32f261['createdAt'])[_0xbb10('0xc6')](_0xbb10('0xde'))},'attachments':[]};if(_0x32f261['cc']){_0x4b490a[_0xbb10('0xdf')]['Cc']=_0x32f261['cc'];}if(_0x32f261[_0xbb10('0xe0')]){_0x4b490a[_0xbb10('0xdf')][_0xbb10('0xe1')]=_0x32f261[_0xbb10('0xe0')];}return new BPromise(function(_0x48f0eb,_0x304603){if(_0x32f261['Attachments']){for(var _0x5a7c4e=0x0;_0x5a7c4e<_0x32f261['Attachments'][_0xbb10('0x55')];_0x5a7c4e++){var _0x572d73=_0x32f261['Attachments'][_0x5a7c4e];var _0x1f09f1=path['join'](_0x8e8049,_0x572d73[_0xbb10('0xe2')]);if(fs[_0xbb10('0xe3')](_0x1f09f1)){_0x4b490a[_0xbb10('0xd6')]['push']({'name':_0x572d73['name'],'contentType':_0x572d73[_0xbb10('0x63')],'data':fs['readFileSync'](_0x1f09f1)});}}}emlformat[_0xbb10('0xe4')](_0x4b490a,function(_0x211172,_0x589ecb){if(_0x211172)return _0x304603(_0x211172);fs['writeFileSync'](path[_0xbb10('0xd1')](_0x56f902,util[_0xbb10('0xc6')](_0xbb10('0xe5'),_0x5b11a2)),_0x589ecb);return _0x48f0eb(_0x589ecb);});});})['then'](function(){return new BPromise(function(_0x4f4aa8,_0x426a4f){zipdir(_0x56f902,{'saveTo':_0x1301e3},function(_0x22f153,_0x4d47cc){if(_0x22f153)return _0x426a4f(_0x22f153);return _0x4f4aa8(_0x4d47cc);});})[_0xbb10('0x1e')](function(){return new BPromise(function(_0x203e5a,_0xe88e90){rimraf(_0x56f902,function(_0x4845b5){if(_0x4845b5)_0xe88e90(_0x4845b5);return _0x203e5a();});});})[_0xbb10('0x1e')](function(){return _0x4ca4ce[_0xbb10('0xcf')](_0x1301e3,_0x4720a1,function(_0x166f4f){if(!_0x166f4f)fs[_0xbb10('0xe6')](_0x1301e3);});});});}else{return _0x4ca4ce[_0xbb10('0x12')](0xc8);}})[_0xbb10('0x2e')](handleError(_0x4ca4ce,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index 5eeefcd..355b2d5 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 _0x94df=['../../mysqldb','MailInteraction','MailMessage','setMaxListeners','save','update','remove','getUsers','then','Users','map','setDataValue','unreadMessages','length','emit','catch','hook','exports','events'];(function(_0x11ba83,_0xd5611a){var _0x3f3925=function(_0x3d7cb0){while(--_0x3d7cb0){_0x11ba83['push'](_0x11ba83['shift']());}};_0x3f3925(++_0xd5611a);}(_0x94df,0xe3));var _0xf94d=function(_0x39a66e,_0x340bb3){_0x39a66e=_0x39a66e-0x0;var _0x230641=_0x94df[_0x39a66e];return _0x230641;};'use strict';var EventEmitter=require(_0xf94d('0x0'));var MailInteraction=require(_0xf94d('0x1'))['db'][_0xf94d('0x2')];var MailMessage=require('../../mysqldb')['db'][_0xf94d('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xf94d('0x4')](0x0);var events={'afterCreate':_0xf94d('0x5'),'afterUpdate':_0xf94d('0x6'),'afterDestroy':_0xf94d('0x7')};function emitEvent(_0x911bb9){return function(_0x1d8fa8,_0x55d456,_0xb81f4c){_0x1d8fa8[_0xf94d('0x8')]({'attributes':['id'],'raw':!![]})[_0xf94d('0x9')](function(_0x1639cb){_0x1d8fa8['setDataValue'](_0xf94d('0xa'),_0x1639cb[_0xf94d('0xb')](function(_0x28f29c){return{'id':_0x28f29c['id']};}));return MailMessage['findAll']({'where':{'MailInteractionId':_0x1d8fa8['id'],'direction':'in','read':![]},'raw':!![]});})[_0xf94d('0x9')](function(_0x56cc1c){_0x1d8fa8[_0xf94d('0xc')](_0xf94d('0xd'),_0x56cc1c[_0xf94d('0xe')]);MailInteractionEvents[_0xf94d('0xf')](_0x911bb9+':'+_0x1d8fa8['id'],_0x1d8fa8);MailInteractionEvents[_0xf94d('0xf')](_0x911bb9,_0x1d8fa8);_0xb81f4c(null);})[_0xf94d('0x10')](_0xb81f4c(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction[_0xf94d('0x11')](e,emitEvent(event));}}module[_0xf94d('0x12')]=MailInteractionEvents; \ No newline at end of file +var _0x4704=['remove','getUsers','then','setDataValue','Users','map','findAll','length','emit','catch','hook','exports','events','MailInteraction','../../mysqldb','setMaxListeners','save','update'];(function(_0x704ab2,_0x2af0f5){var _0x52cbc2=function(_0x25387e){while(--_0x25387e){_0x704ab2['push'](_0x704ab2['shift']());}};_0x52cbc2(++_0x2af0f5);}(_0x4704,0x8a));var _0x4470=function(_0x9d9f9e,_0x52a029){_0x9d9f9e=_0x9d9f9e-0x0;var _0x48cb13=_0x4704[_0x9d9f9e];return _0x48cb13;};'use strict';var EventEmitter=require(_0x4470('0x0'));var MailInteraction=require('../../mysqldb')['db'][_0x4470('0x1')];var MailMessage=require(_0x4470('0x2'))['db']['MailMessage'];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x4470('0x3')](0x0);var events={'afterCreate':_0x4470('0x4'),'afterUpdate':_0x4470('0x5'),'afterDestroy':_0x4470('0x6')};function emitEvent(_0x1ab609){return function(_0x3197ab,_0x399283,_0x2806f7){_0x3197ab[_0x4470('0x7')]({'attributes':['id'],'raw':!![]})[_0x4470('0x8')](function(_0x51b9cb){_0x3197ab[_0x4470('0x9')](_0x4470('0xa'),_0x51b9cb[_0x4470('0xb')](function(_0x3e8f0f){return{'id':_0x3e8f0f['id']};}));return MailMessage[_0x4470('0xc')]({'where':{'MailInteractionId':_0x3197ab['id'],'direction':'in','read':![]},'raw':!![]});})[_0x4470('0x8')](function(_0x16c4e9){_0x3197ab[_0x4470('0x9')]('unreadMessages',_0x16c4e9[_0x4470('0xd')]);MailInteractionEvents[_0x4470('0xe')](_0x1ab609+':'+_0x3197ab['id'],_0x3197ab);MailInteractionEvents[_0x4470('0xe')](_0x1ab609,_0x3197ab);_0x2806f7(null);})[_0x4470('0xf')](_0x2806f7(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction[_0x4470('0x10')](e,emitEvent(event));}}module[_0x4470('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 71cb216..80c9c4e 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 _0x56ad=['MailMessage','update','then','catch','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./mailInteraction.attributes','exports','define','MailInteraction','mail_interactions','fti_mail_interactions','subject','FULLTEXT','substatus','substatusAt','YYYY-MM-DD\x20HH:mm:ss','closed','format','changed','closedAt','models'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x56ad,0x1a4));var _0xd56a=function(_0x47012a,_0x30352d){_0x47012a=_0x47012a-0x0;var _0x15eb81=_0x56ad[_0x47012a];return _0x15eb81;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd56a('0x0'))(_0xd56a('0x1'));var moment=require('moment');var BPromise=require(_0xd56a('0x2'));var rp=require(_0xd56a('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd56a('0x4'));var config=require(_0xd56a('0x5'));var attributes=require(_0xd56a('0x6'));module[_0xd56a('0x7')]=function(_0x48d380,_0x55d599){return _0x48d380[_0xd56a('0x8')](_0xd56a('0x9'),attributes,{'tableName':_0xd56a('0xa'),'paranoid':![],'indexes':[{'name':_0xd56a('0xb'),'fields':[_0xd56a('0xc'),'to'],'type':_0xd56a('0xd')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x527faf,_0x27eaa7,_0xed3391){if(_0x527faf[_0xd56a('0xe')]){_0x527faf[_0xd56a('0xf')]=moment()['format'](_0xd56a('0x10'));}if(_0x527faf[_0xd56a('0x11')]){_0x527faf['closedAt']=moment()[_0xd56a('0x12')](_0xd56a('0x10'));}_0xed3391(null,_0x27eaa7);},'beforeUpdate':function(_0x5462a4,_0xa0bc7b,_0x4ed9a1){if(_0x5462a4[_0xd56a('0x13')]('substatus')){_0x5462a4[_0xd56a('0xf')]=_0x5462a4[_0xd56a('0xe')]?moment()[_0xd56a('0x12')](_0xd56a('0x10')):null;}if(_0x5462a4[_0xd56a('0x13')](_0xd56a('0x11'))){_0x5462a4[_0xd56a('0x14')]=moment()[_0xd56a('0x12')](_0xd56a('0x10'));_0x5462a4['substatus']=null;_0x5462a4['substatusAt']=null;}_0x4ed9a1(null,_0x5462a4);},'afterUpdate':function(_0x2b17ac,_0x293100,_0x2b18cc){var _0x5cb4e0=_0x48d380[_0xd56a('0x15')];var _0x1d4c93=_0x2b17ac['get']({'plain':!![]});if(_0x1d4c93[_0xd56a('0x11')]){return _0x5cb4e0[_0xd56a('0x16')][_0xd56a('0x17')]({'read':!![]},{'where':{'MailInteractionId':_0x1d4c93['id']}})[_0xd56a('0x18')](function(){_0x2b18cc();})[_0xd56a('0x19')](function(_0x329ef5){_0x2b18cc(_0x329ef5);});}else{_0x2b18cc();}}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xc40d=['mail_interactions','subject','FULLTEXT','substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','changed','closedAt','models','get','closed','MailMessage','update','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailInteraction.attributes','exports','define'];(function(_0x422875,_0x55aeb2){var _0x55fc51=function(_0x5e6daf){while(--_0x5e6daf){_0x422875['push'](_0x422875['shift']());}};_0x55fc51(++_0x55aeb2);}(_0xc40d,0xdb));var _0xdc40=function(_0x5ce20f,_0x426943){_0x5ce20f=_0x5ce20f-0x0;var _0x5d6396=_0xc40d[_0x5ce20f];return _0x5d6396;};'use strict';var _=require(_0xdc40('0x0'));var util=require(_0xdc40('0x1'));var logger=require(_0xdc40('0x2'))(_0xdc40('0x3'));var moment=require(_0xdc40('0x4'));var BPromise=require(_0xdc40('0x5'));var rp=require(_0xdc40('0x6'));var fs=require('fs');var path=require(_0xdc40('0x7'));var rimraf=require(_0xdc40('0x8'));var config=require(_0xdc40('0x9'));var attributes=require(_0xdc40('0xa'));module[_0xdc40('0xb')]=function(_0x26822a,_0x3b2f41){return _0x26822a[_0xdc40('0xc')]('MailInteraction',attributes,{'tableName':_0xdc40('0xd'),'paranoid':![],'indexes':[{'name':'fti_mail_interactions','fields':[_0xdc40('0xe'),'to'],'type':_0xdc40('0xf')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x38296b,_0x12c1f0,_0x512f12){if(_0x38296b[_0xdc40('0x10')]){_0x38296b[_0xdc40('0x11')]=moment()[_0xdc40('0x12')](_0xdc40('0x13'));}if(_0x38296b['closed']){_0x38296b['closedAt']=moment()[_0xdc40('0x12')](_0xdc40('0x13'));}_0x512f12(null,_0x12c1f0);},'beforeUpdate':function(_0x2e0279,_0x517e9a,_0x17369b){if(_0x2e0279[_0xdc40('0x14')](_0xdc40('0x10'))){_0x2e0279['substatusAt']=_0x2e0279[_0xdc40('0x10')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):null;}if(_0x2e0279[_0xdc40('0x14')]('closed')){_0x2e0279[_0xdc40('0x15')]=moment()['format'](_0xdc40('0x13'));_0x2e0279[_0xdc40('0x10')]=null;_0x2e0279[_0xdc40('0x11')]=null;}_0x17369b(null,_0x2e0279);},'afterUpdate':function(_0x14f357,_0x5f441e,_0x1b31f0){var _0x580719=_0x26822a[_0xdc40('0x16')];var _0x3aa15d=_0x14f357[_0xdc40('0x17')]({'plain':!![]});if(_0x3aa15d[_0xdc40('0x18')]){return _0x580719[_0xdc40('0x19')][_0xdc40('0x1a')]({'read':!![]},{'where':{'MailInteractionId':_0x3aa15d['id']}})['then'](function(){_0x1b31f0();})['catch'](function(_0x442295){_0x1b31f0(_0x442295);});}else{_0x1b31f0();}}},'charset':_0xdc40('0x1b'),'collate':_0xdc40('0x1c')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index edda086..55cd9c1 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 _0x13f6=['util','bluebird','randomstring','../../config/utils','../../config/logger','client','http','redis','socket.io-emitter','register','info','MailInteraction,\x20%s,\x20%s','request\x20sent','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateMailInteraction','MailInteraction','update','options','where','attributes','then','debug','find','addTags','body','ids','omit','spread','AddTags'];(function(_0x38146e,_0x3ce0ec){var _0x354052=function(_0x4d7383){while(--_0x4d7383){_0x38146e['push'](_0x38146e['shift']());}};_0x354052(++_0x3ce0ec);}(_0x13f6,0xaf));var _0x613f=function(_0x27f4e9,_0x2f2f75){_0x27f4e9=_0x27f4e9-0x0;var _0x7226e=_0x13f6[_0x27f4e9];return _0x7226e;};'use strict';var _=require('lodash');var util=require(_0x613f('0x0'));var moment=require('moment');var BPromise=require(_0x613f('0x1'));var rs=require(_0x613f('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x613f('0x3'));var logger=require(_0x613f('0x4'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x613f('0x5')][_0x613f('0x6')]({'port':0x232a});config['redis']=_['defaults'](config[_0x613f('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0x613f('0x8'))(new Redis(config[_0x613f('0x7')]));require('./mailInteraction.socket')[_0x613f('0x9')](socket);function respondWithRpcPromise(_0x3395b1,_0x21dc4,_0x186a64){return new BPromise(function(_0x32f260,_0x115352){return client['request'](_0x3395b1,_0x186a64)['then'](function(_0x4070c2){logger[_0x613f('0xa')](_0x613f('0xb'),_0x21dc4,_0x613f('0xc'));logger['debug'](_0x613f('0xd'),_0x21dc4,_0x613f('0xc'),JSON[_0x613f('0xe')](_0x4070c2));if(_0x4070c2[_0x613f('0xf')]){if(_0x4070c2[_0x613f('0xf')][_0x613f('0x10')]===0x1f4){logger[_0x613f('0xf')]('MailInteraction,\x20%s,\x20%s',_0x21dc4,_0x4070c2[_0x613f('0xf')]['message']);return _0x115352(_0x4070c2[_0x613f('0xf')][_0x613f('0x11')]);}logger[_0x613f('0xf')](_0x613f('0xb'),_0x21dc4,_0x4070c2[_0x613f('0xf')]['message']);return _0x32f260(_0x4070c2[_0x613f('0xf')][_0x613f('0x11')]);}else{logger['info'](_0x613f('0xb'),_0x21dc4,_0x613f('0xc'));_0x32f260(_0x4070c2[_0x613f('0x12')][_0x613f('0x11')]);}})[_0x613f('0x13')](function(_0x124417){logger['error'](_0x613f('0xb'),_0x21dc4,_0x124417);_0x115352(_0x124417);});});}exports[_0x613f('0x14')]=function(_0x11dc42){var _0x5462b3=this;return new Promise(function(_0x141c7d,_0x6b4b79){return db[_0x613f('0x15')][_0x613f('0x16')](_0x11dc42['body'],{'raw':_0x11dc42['options']?_0x11dc42[_0x613f('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x11dc42[_0x613f('0x17')]?_0x11dc42['options'][_0x613f('0x18')]||null:null,'attributes':_0x11dc42[_0x613f('0x17')]?_0x11dc42[_0x613f('0x17')][_0x613f('0x19')]||null:null,'limit':_0x11dc42[_0x613f('0x17')]?_0x11dc42[_0x613f('0x17')]['limit']||null:null})[_0x613f('0x1a')](function(_0x38363c){logger[_0x613f('0xa')](_0x613f('0x14'),_0x11dc42);logger[_0x613f('0x1b')](_0x613f('0x14'),_0x11dc42,JSON[_0x613f('0xe')](_0x38363c));_0x141c7d(_0x38363c);})[_0x613f('0x13')](function(_0x5e4ed2){logger[_0x613f('0xf')](_0x613f('0x14'),_0x5e4ed2[_0x613f('0x11')],_0x11dc42);_0x6b4b79(_0x5462b3[_0x613f('0xf')](0x1f4,_0x5e4ed2['message']));});});};exports['AddTagsToMailInteraction']=function(_0x1e5619){return new Promise(function(_0x2902a6,_0x29d575){return db[_0x613f('0x15')][_0x613f('0x1c')]({'where':_0x1e5619['options']?_0x1e5619[_0x613f('0x17')]['where']||null:null})[_0x613f('0x1a')](function(_0x656273){if(_0x656273){return _0x656273[_0x613f('0x1d')](_0x1e5619[_0x613f('0x1e')][_0x613f('0x1f')],_[_0x613f('0x20')](_0x1e5619[_0x613f('0x1e')],[_0x613f('0x1f'),'id'])||{});}})[_0x613f('0x21')](function(_0x19f015){logger[_0x613f('0xa')]('AddTags',_0x1e5619);logger[_0x613f('0x1b')](_0x613f('0x22'),_0x1e5619,JSON[_0x613f('0xe')](_0x19f015));_0x2902a6(_0x19f015);})[_0x613f('0x13')](function(_0x207451){logger['error'](_0x613f('0x22'),_0x207451[_0x613f('0x11')],_0x1e5619);_0x29d575(_this[_0x613f('0xf')](0x1f4,_0x207451[_0x613f('0x11')]));});});}; \ No newline at end of file +var _0x62a7=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','request','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','MailInteraction','update','body','options','raw','attributes','limit','UpdateMailInteraction','debug','where','addTags','ids','omit','spread','AddTags'];(function(_0x3efe4a,_0x22b55c){var _0x11e61e=function(_0x4cd240){while(--_0x4cd240){_0x3efe4a['push'](_0x3efe4a['shift']());}};_0x11e61e(++_0x22b55c);}(_0x62a7,0x84));var _0x762a=function(_0x53f3ad,_0x39163e){_0x53f3ad=_0x53f3ad-0x0;var _0x48b203=_0x62a7[_0x53f3ad];return _0x48b203;};'use strict';var _=require('lodash');var util=require(_0x762a('0x0'));var moment=require(_0x762a('0x1'));var BPromise=require(_0x762a('0x2'));var rs=require(_0x762a('0x3'));var fs=require('fs');var Redis=require(_0x762a('0x4'));var db=require(_0x762a('0x5'))['db'];var utils=require(_0x762a('0x6'));var logger=require(_0x762a('0x7'))(_0x762a('0x8'));var config=require('../../config/environment');var jayson=require(_0x762a('0x9'));var client=jayson[_0x762a('0xa')]['http']({'port':0x232a});config[_0x762a('0xb')]=_[_0x762a('0xc')](config[_0x762a('0xb')],{'host':_0x762a('0xd'),'port':0x18eb});var socket=require(_0x762a('0xe'))(new Redis(config[_0x762a('0xb')]));require(_0x762a('0xf'))[_0x762a('0x10')](socket);function respondWithRpcPromise(_0x4fb239,_0x44ddf8,_0x5c83ee){return new BPromise(function(_0x2c279a,_0x2ce08c){return client[_0x762a('0x11')](_0x4fb239,_0x5c83ee)[_0x762a('0x12')](function(_0x393371){logger[_0x762a('0x13')](_0x762a('0x14'),_0x44ddf8,_0x762a('0x15'));logger['debug'](_0x762a('0x16'),_0x44ddf8,_0x762a('0x15'),JSON[_0x762a('0x17')](_0x393371));if(_0x393371[_0x762a('0x18')]){if(_0x393371[_0x762a('0x18')][_0x762a('0x19')]===0x1f4){logger[_0x762a('0x18')](_0x762a('0x14'),_0x44ddf8,_0x393371[_0x762a('0x18')]['message']);return _0x2ce08c(_0x393371[_0x762a('0x18')]['message']);}logger[_0x762a('0x18')](_0x762a('0x14'),_0x44ddf8,_0x393371[_0x762a('0x18')][_0x762a('0x1a')]);return _0x2c279a(_0x393371[_0x762a('0x18')][_0x762a('0x1a')]);}else{logger[_0x762a('0x13')](_0x762a('0x14'),_0x44ddf8,'request\x20sent');_0x2c279a(_0x393371[_0x762a('0x1b')][_0x762a('0x1a')]);}})[_0x762a('0x1c')](function(_0x37bd4){logger[_0x762a('0x18')](_0x762a('0x14'),_0x44ddf8,_0x37bd4);_0x2ce08c(_0x37bd4);});});}exports['UpdateMailInteraction']=function(_0x117ab9){var _0xcab694=this;return new Promise(function(_0x2be2d7,_0x5f140f){return db[_0x762a('0x1d')][_0x762a('0x1e')](_0x117ab9[_0x762a('0x1f')],{'raw':_0x117ab9[_0x762a('0x20')]?_0x117ab9[_0x762a('0x20')][_0x762a('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x117ab9[_0x762a('0x20')]?_0x117ab9[_0x762a('0x20')]['where']||null:null,'attributes':_0x117ab9[_0x762a('0x20')]?_0x117ab9[_0x762a('0x20')][_0x762a('0x22')]||null:null,'limit':_0x117ab9['options']?_0x117ab9['options'][_0x762a('0x23')]||null:null})['then'](function(_0x38b378){logger[_0x762a('0x13')](_0x762a('0x24'),_0x117ab9);logger[_0x762a('0x25')]('UpdateMailInteraction',_0x117ab9,JSON[_0x762a('0x17')](_0x38b378));_0x2be2d7(_0x38b378);})[_0x762a('0x1c')](function(_0x3141a1){logger[_0x762a('0x18')](_0x762a('0x24'),_0x3141a1['message'],_0x117ab9);_0x5f140f(_0xcab694[_0x762a('0x18')](0x1f4,_0x3141a1[_0x762a('0x1a')]));});});};exports['AddTagsToMailInteraction']=function(_0x266544){return new Promise(function(_0x1bb9c5,_0xaa1ce4){return db[_0x762a('0x1d')]['find']({'where':_0x266544[_0x762a('0x20')]?_0x266544[_0x762a('0x20')][_0x762a('0x26')]||null:null})[_0x762a('0x12')](function(_0x35d1a9){if(_0x35d1a9){return _0x35d1a9[_0x762a('0x27')](_0x266544[_0x762a('0x1f')][_0x762a('0x28')],_[_0x762a('0x29')](_0x266544[_0x762a('0x1f')],[_0x762a('0x28'),'id'])||{});}})[_0x762a('0x2a')](function(_0x12bd7d){logger[_0x762a('0x13')](_0x762a('0x2b'),_0x266544);logger[_0x762a('0x25')](_0x762a('0x2b'),_0x266544,JSON[_0x762a('0x17')](_0x12bd7d));_0x1bb9c5(_0x12bd7d);})[_0x762a('0x1c')](function(_0x525fc9){logger['error']('AddTags',_0x525fc9['message'],_0x266544);_0xaa1ce4(_this[_0x762a('0x18')](0x1f4,_0x525fc9['message']));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index 67beea4..c77deb9 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 _0x0b98=['mailInteraction:','./mailInteraction.events','update','emit','removeListener','register'];(function(_0x3d7a10,_0x21bc7b){var _0x5b0b11=function(_0x366e31){while(--_0x366e31){_0x3d7a10['push'](_0x3d7a10['shift']());}};_0x5b0b11(++_0x21bc7b);}(_0x0b98,0xe5));var _0x80b9=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x0b98[_0x14add3];return _0x4a174f;};'use strict';var MailInteractionEvents=require(_0x80b9('0x0'));var events=['save','remove',_0x80b9('0x1')];function createListener(_0x34efe8,_0x25594c){return function(_0x191f03){_0x25594c[_0x80b9('0x2')](_0x34efe8,_0x191f03);};}function removeListener(_0x45546d,_0x1c8a23){return function(){MailInteractionEvents[_0x80b9('0x3')](_0x45546d,_0x1c8a23);};}exports[_0x80b9('0x4')]=function(_0x53da1c){for(var _0x5416f2=0x0,_0x2da362=events['length'];_0x5416f2<_0x2da362;_0x5416f2++){var _0x41c075=events[_0x5416f2];var _0x12e96b=createListener(_0x80b9('0x5')+_0x41c075,_0x53da1c);MailInteractionEvents['on'](_0x41c075,_0x12e96b);}}; \ No newline at end of file +var _0x9598=['register','update','emit','removeListener'];(function(_0x1074fa,_0x5850ec){var _0x5d0478=function(_0x52b748){while(--_0x52b748){_0x1074fa['push'](_0x1074fa['shift']());}};_0x5d0478(++_0x5850ec);}(_0x9598,0x149));var _0x8959=function(_0x225bbd,_0x378910){_0x225bbd=_0x225bbd-0x0;var _0x44fd36=_0x9598[_0x225bbd];return _0x44fd36;};'use strict';var MailInteractionEvents=require('./mailInteraction.events');var events=['save','remove',_0x8959('0x0')];function createListener(_0x5824e2,_0x155b39){return function(_0x4fe795){_0x155b39[_0x8959('0x1')](_0x5824e2,_0x4fe795);};}function removeListener(_0x51cc98,_0x558e8b){return function(){MailInteractionEvents[_0x8959('0x2')](_0x51cc98,_0x558e8b);};}exports[_0x8959('0x3')]=function(_0x25dd8f){for(var _0x222db5=0x0,_0x33e9fa=events['length'];_0x222db5<_0x33e9fa;_0x222db5++){var _0x66f746=events[_0x222db5];var _0x2b04fc=createListener('mailInteraction:'+_0x66f746,_0x25dd8f);MailInteractionEvents['on'](_0x66f746,_0x2b04fc);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index d224a9c..e4a54fe 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 _0x3360=['../../config/environment','./mailMessage.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/download','download','tracked','mail','mailmessage:create','create','update','put','/:id/accept','accept','/:id/reject','delete','destroy','multer','util','Router','../../components/interaction/service'];(function(_0x1a1795,_0x35958e){var _0x56b714=function(_0x2867f0){while(--_0x2867f0){_0x1a1795['push'](_0x1a1795['shift']());}};_0x56b714(++_0x35958e);}(_0x3360,0x1d7));var _0x0336=function(_0x12983c,_0x3355bc){_0x12983c=_0x12983c-0x0;var _0x45df19=_0x3360[_0x12983c];return _0x45df19;};'use strict';var multer=require(_0x0336('0x0'));var util=require(_0x0336('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0336('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x0336('0x3'));var config=require(_0x0336('0x4'));var controller=require(_0x0336('0x5'));router[_0x0336('0x6')]('/',auth[_0x0336('0x7')](),controller['index']);router['get'](_0x0336('0x8'),auth[_0x0336('0x7')](),controller[_0x0336('0x9')]);router[_0x0336('0x6')](_0x0336('0xa'),auth['isAuthenticated'](),controller[_0x0336('0xb')]);router[_0x0336('0x6')](_0x0336('0xc'),auth['isAuthenticated'](),controller[_0x0336('0xd')]);router['post']('/',auth[_0x0336('0x7')](),interaction[_0x0336('0xe')](_0x0336('0xf'),_0x0336('0x10')),controller[_0x0336('0x11')]);router['put'](_0x0336('0xa'),auth[_0x0336('0x7')](),controller[_0x0336('0x12')]);router[_0x0336('0x13')](_0x0336('0x14'),auth['isAuthenticated'](),controller[_0x0336('0x15')]);router[_0x0336('0x13')](_0x0336('0x16'),auth[_0x0336('0x7')](),controller['reject']);router[_0x0336('0x17')]('/:id',auth[_0x0336('0x7')](),controller[_0x0336('0x18')]);module['exports']=router; \ No newline at end of file +var _0x85cf=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/describe','describe','/:id','show','download','tracked','mail','create','put','/:id/accept','accept','/:id/reject','reject','destroy','util','path'];(function(_0x50b65a,_0x1d594c){var _0x41e568=function(_0x221788){while(--_0x221788){_0x50b65a['push'](_0x50b65a['shift']());}};_0x41e568(++_0x1d594c);}(_0x85cf,0x76));var _0xf85c=function(_0xa91111,_0x22688c){_0xa91111=_0xa91111-0x0;var _0x235b0e=_0x85cf[_0xa91111];return _0x235b0e;};'use strict';var multer=require('multer');var util=require(_0xf85c('0x0'));var path=require(_0xf85c('0x1'));var timeout=require(_0xf85c('0x2'));var express=require(_0xf85c('0x3'));var router=express[_0xf85c('0x4')]();var fs_extra=require(_0xf85c('0x5'));var auth=require(_0xf85c('0x6'));var interaction=require(_0xf85c('0x7'));var config=require('../../config/environment');var controller=require('./mailMessage.controller');router[_0xf85c('0x8')]('/',auth[_0xf85c('0x9')](),controller['index']);router[_0xf85c('0x8')](_0xf85c('0xa'),auth[_0xf85c('0x9')](),controller[_0xf85c('0xb')]);router[_0xf85c('0x8')](_0xf85c('0xc'),auth['isAuthenticated'](),controller[_0xf85c('0xd')]);router[_0xf85c('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0xf85c('0xe')]);router['post']('/',auth[_0xf85c('0x9')](),interaction[_0xf85c('0xf')](_0xf85c('0x10'),'mailmessage:create'),controller[_0xf85c('0x11')]);router[_0xf85c('0x12')](_0xf85c('0xc'),auth[_0xf85c('0x9')](),controller['update']);router[_0xf85c('0x12')](_0xf85c('0x13'),auth[_0xf85c('0x9')](),controller[_0xf85c('0x14')]);router['put'](_0xf85c('0x15'),auth['isAuthenticated'](),controller[_0xf85c('0x16')]);router['delete'](_0xf85c('0xc'),auth['isAuthenticated'](),controller[_0xf85c('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index 068d467..155d57f 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 _0xd1b2=['Chat','exports','TEXT','long','medium','BOOLEAN','ENUM','out','STRING','DATE','INTEGER','Email'];(function(_0x2734f2,_0x4cb5f5){var _0x53e119=function(_0x474dfe){while(--_0x474dfe){_0x2734f2['push'](_0x2734f2['shift']());}};_0x53e119(++_0x4cb5f5);}(_0xd1b2,0xc1));var _0x2d1b=function(_0x10578f,_0x4253c0){_0x10578f=_0x10578f-0x0;var _0x5b103d=_0xd1b2[_0x10578f];return _0x5b103d;};'use strict';var Sequelize=require('sequelize');var _=require('lodash');module[_0x2d1b('0x0')]={'body':{'type':Sequelize[_0x2d1b('0x1')](_0x2d1b('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x2d1b('0x1')](_0x2d1b('0x3'))},'read':{'type':Sequelize[_0x2d1b('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x2d1b('0x5')]('in',_0x2d1b('0x6')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x2d1b('0x7')](0x1fe)},'from':{'type':Sequelize[_0x2d1b('0x7')]},'to':{'type':Sequelize[_0x2d1b('0x1')](_0x2d1b('0x2'))},'cc':{'type':Sequelize['TEXT'](_0x2d1b('0x2'))},'bcc':{'type':Sequelize[_0x2d1b('0x1')](_0x2d1b('0x2'))},'subject':{'type':Sequelize['TEXT']},'sentAt':{'type':Sequelize[_0x2d1b('0x8')]},'attach':{'type':Sequelize[_0x2d1b('0x9')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x2d1b('0x4')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x2d1b('0x8')]},'originTo':{'type':Sequelize[_0x2d1b('0x1')](_0x2d1b('0x2'))},'originCc':{'type':Sequelize[_0x2d1b('0x1')](_0x2d1b('0x2'))},'originChannel':{'type':Sequelize[_0x2d1b('0x5')](_0x2d1b('0xa'),_0x2d1b('0xb')),'defaultValue':_0x2d1b('0xa'),'allowNull':![]}}; \ No newline at end of file +var _0x9238=['exports','TEXT','long','medium','BOOLEAN','ENUM','out','STRING','INTEGER','DATE','Email','Chat','sequelize'];(function(_0x238c64,_0x578b99){var _0x51650b=function(_0x2a0fd9){while(--_0x2a0fd9){_0x238c64['push'](_0x238c64['shift']());}};_0x51650b(++_0x578b99);}(_0x9238,0x1ed));var _0x8923=function(_0x2eee90,_0x27cb14){_0x2eee90=_0x2eee90-0x0;var _0x6e2c21=_0x9238[_0x2eee90];return _0x6e2c21;};'use strict';var Sequelize=require(_0x8923('0x0'));var _=require('lodash');module[_0x8923('0x1')]={'body':{'type':Sequelize[_0x8923('0x2')](_0x8923('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x8923('0x2')](_0x8923('0x4'))},'read':{'type':Sequelize[_0x8923('0x5')],'defaultValue':![]},'direction':{'type':Sequelize[_0x8923('0x6')]('in',_0x8923('0x7')),'defaultValue':_0x8923('0x7'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0x1fe)},'from':{'type':Sequelize[_0x8923('0x8')]},'to':{'type':Sequelize[_0x8923('0x2')](_0x8923('0x3'))},'cc':{'type':Sequelize[_0x8923('0x2')](_0x8923('0x3'))},'bcc':{'type':Sequelize[_0x8923('0x2')](_0x8923('0x3'))},'subject':{'type':Sequelize[_0x8923('0x2')]},'sentAt':{'type':Sequelize['DATE']},'attach':{'type':Sequelize[_0x8923('0x9')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x8923('0x5')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x8923('0xa')]},'originTo':{'type':Sequelize[_0x8923('0x2')](_0x8923('0x3'))},'originCc':{'type':Sequelize['TEXT']('long')},'originChannel':{'type':Sequelize[_0x8923('0x6')](_0x8923('0xb'),_0x8923('0xc')),'defaultValue':_0x8923('0xb'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index a7fb834..95532ae 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 _0xb53b=['role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','contact','User','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','fromString','EventManager','acceptmessage','MailInteractionId','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','sequelize','fullname','reject','rejectmessage','download','unix','toString','root','server','files','message-%s.eml','from','bcc','subject','Attachment','Attachments','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','basename','existsSync','build','writeFileSync','unlinkSync','eml-format','moment','bluebird','util','lodash','ioredis','../../components/parsers/qs','../../config/logger','mail-interactions','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./mailMessage.socket','register','jayson/promise','client','http','request','then','info','debug','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','MailMessage,\x20%s,\x20%s','result','catch','status','offset','undefined','limit','count','set','Content-Range','json','update','destroy','sendStatus','stack','name','send','index','map','MailMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','include','rows','show','params','includeAll','find','body','describe','create','out','split','findOne','MailAccountId','CmList','List','Contacts','DESC','MailServerOut','Smtp','isNil','service','host','port','secure','pass','auth','attachments','join','CmContact','SendMail','sendMail','messageId','YYYY-MM-DD\x20HH:mm:ss','accept','mail','read','readAt','UserId','agent','get','MailInteraction','read1stAt','format','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user'];(function(_0x4c440b,_0x3ea627){var _0x2d48cf=function(_0x56bac7){while(--_0x56bac7){_0x4c440b['push'](_0x4c440b['shift']());}};_0x2d48cf(++_0x3ea627);}(_0xb53b,0xd7));var _0xbb53=function(_0x28669c,_0x1f62c4){_0x28669c=_0x28669c-0x0;var _0x4a3af6=_0xb53b[_0x28669c];return _0x4a3af6;};'use strict';var emlformat=require(_0xbb53('0x0'));var moment=require(_0xbb53('0x1'));var BPromise=require(_0xbb53('0x2'));var util=require(_0xbb53('0x3'));var path=require('path');var fs=require('fs');var _=require(_0xbb53('0x4'));var Redis=require(_0xbb53('0x5'));var htmlToText=require('html-to-text');var qs=require(_0xbb53('0x6'));var logger=require(_0xbb53('0x7'))('api');var interaction_log=require(_0xbb53('0x7'))(_0xbb53('0x8'));var config=require(_0xbb53('0x9'));var db=require(_0xbb53('0xa'))['db'];config[_0xbb53('0xb')]=_[_0xbb53('0xc')](config[_0xbb53('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xbb53('0xd'))(new Redis(config['redis']));require(_0xbb53('0xe'))[_0xbb53('0xf')](socket);var jayson=require(_0xbb53('0x10'));var client=jayson[_0xbb53('0x11')][_0xbb53('0x12')]({'port':0x232c});var client9003=jayson['client'][_0xbb53('0x12')]({'port':0x232b});var client9002=jayson[_0xbb53('0x11')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2469a0,_0x27bbdf,_0x5b79ac,_0x21517c){return new BPromise(function(_0x144f2e,_0x1870d6){var _0xb7da6=_0x21517c||client;return _0xb7da6[_0xbb53('0x13')](_0x2469a0,_0x5b79ac)[_0xbb53('0x14')](function(_0x485207){logger[_0xbb53('0x15')]('MailMessage,\x20%s,\x20%s',_0x27bbdf,'request\x20sent');logger[_0xbb53('0x16')](_0xbb53('0x17'),_0x27bbdf,_0xbb53('0x18'),JSON[_0xbb53('0x19')](_0x485207));if(_0x485207['error']){if(_0x485207[_0xbb53('0x1a')]['code']===0x1f4){logger[_0xbb53('0x1a')]('MailMessage,\x20%s,\x20%s',_0x27bbdf,_0x485207['error'][_0xbb53('0x1b')]);return _0x1870d6(_0x485207[_0xbb53('0x1a')]['message']);}logger[_0xbb53('0x1a')](_0xbb53('0x1c'),_0x27bbdf,_0x485207[_0xbb53('0x1a')][_0xbb53('0x1b')]);return _0x144f2e(_0x485207[_0xbb53('0x1a')]['message']);}else{logger[_0xbb53('0x15')](_0xbb53('0x1c'),_0x27bbdf,_0xbb53('0x18'));_0x144f2e(_0x485207[_0xbb53('0x1d')]['message']);}})[_0xbb53('0x1e')](function(_0x4ae2c4){logger[_0xbb53('0x1a')](_0xbb53('0x1c'),_0x27bbdf,_0x4ae2c4);_0x1870d6(_0x4ae2c4);});});}function respondWithResult(_0x42ee66,_0x629e4c){_0x629e4c=_0x629e4c||0xc8;return function(_0x180aa3){if(_0x180aa3){return _0x42ee66[_0xbb53('0x1f')](_0x629e4c)['json'](_0x180aa3);}};}function respondWithFilteredResult(_0x4484a7,_0x5031a1){return function(_0x58021f){if(_0x58021f){var _0x173141=typeof _0x5031a1[_0xbb53('0x20')]===_0xbb53('0x21')&&typeof _0x5031a1[_0xbb53('0x22')]===_0xbb53('0x21');var _0x30344e=_0x58021f['count'];var _0x1b88c4=_0x173141?0x0:_0x5031a1[_0xbb53('0x20')];var _0x2df845=_0x173141?_0x58021f[_0xbb53('0x23')]:_0x5031a1[_0xbb53('0x20')]+_0x5031a1[_0xbb53('0x22')];var _0x4d3f57;if(_0x2df845>=_0x30344e){_0x2df845=_0x30344e;_0x4d3f57=0xc8;}else{_0x4d3f57=0xce;}_0x4484a7[_0xbb53('0x1f')](_0x4d3f57);return _0x4484a7[_0xbb53('0x24')](_0xbb53('0x25'),_0x1b88c4+'-'+_0x2df845+'/'+_0x30344e)[_0xbb53('0x26')](_0x58021f);}return null;};}function saveUpdates(_0x55407f){return function(_0x2ae982){if(_0x2ae982){return _0x2ae982[_0xbb53('0x27')](_0x55407f)['then'](function(_0x2fe1cb){return _0x2fe1cb;});}return null;};}function removeEntity(_0x25bdfd){return function(_0x5542ef){if(_0x5542ef){return _0x5542ef[_0xbb53('0x28')]()[_0xbb53('0x14')](function(){_0x25bdfd[_0xbb53('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x530dee){return function(_0x49e905){if(!_0x49e905){_0x530dee[_0xbb53('0x29')](0x194);}return _0x49e905;};}function handleError(_0x46fdc2,_0x4f7a18){_0x4f7a18=_0x4f7a18||0x1f4;return function(_0xd3474a){logger[_0xbb53('0x1a')](_0xd3474a[_0xbb53('0x2a')]);if(_0xd3474a[_0xbb53('0x2b')]){delete _0xd3474a['name'];}_0x46fdc2[_0xbb53('0x1f')](_0x4f7a18)[_0xbb53('0x2c')](_0xd3474a);};}exports[_0xbb53('0x2d')]=function(_0x5f8005,_0xddc430){var _0x3ef8c1={},_0x4f65fe={},_0x4dfa8a={'count':0x0,'rows':[]};var _0x32bf6e=_[_0xbb53('0x2e')](db[_0xbb53('0x2f')][_0xbb53('0x30')],function(_0x370e7c){return{'name':_0x370e7c[_0xbb53('0x31')],'type':_0x370e7c[_0xbb53('0x32')][_0xbb53('0x33')]};});_0x4f65fe[_0xbb53('0x34')]=_[_0xbb53('0x2e')](_0x32bf6e,_0xbb53('0x2b'));_0x4f65fe[_0xbb53('0x35')]=_[_0xbb53('0x36')](_0x5f8005[_0xbb53('0x35')]);_0x4f65fe[_0xbb53('0x37')]=_[_0xbb53('0x38')](_0x4f65fe['model'],_0x4f65fe[_0xbb53('0x35')]);_0x3ef8c1[_0xbb53('0x39')]=_[_0xbb53('0x38')](_0x4f65fe['model'],qs[_0xbb53('0x3a')](_0x5f8005[_0xbb53('0x35')][_0xbb53('0x3a')]));_0x3ef8c1[_0xbb53('0x39')]=_0x3ef8c1[_0xbb53('0x39')][_0xbb53('0x3b')]?_0x3ef8c1['attributes']:_0x4f65fe['model'];if(!_0x5f8005['query'][_0xbb53('0x3c')]('nolimit')){_0x3ef8c1[_0xbb53('0x22')]=qs[_0xbb53('0x22')](_0x5f8005[_0xbb53('0x35')][_0xbb53('0x22')]);_0x3ef8c1[_0xbb53('0x20')]=qs[_0xbb53('0x20')](_0x5f8005[_0xbb53('0x35')][_0xbb53('0x20')]);}_0x3ef8c1[_0xbb53('0x3d')]=qs[_0xbb53('0x3e')](_0x5f8005[_0xbb53('0x35')]['sort']);_0x3ef8c1[_0xbb53('0x3f')]=qs[_0xbb53('0x37')](_[_0xbb53('0x40')](_0x5f8005[_0xbb53('0x35')],_0x4f65fe[_0xbb53('0x37')]),_0x32bf6e);if(_0x5f8005['query'][_0xbb53('0x41')]){_0x3ef8c1[_0xbb53('0x3f')]=_['merge'](_0x3ef8c1[_0xbb53('0x3f')],{'$or':_[_0xbb53('0x2e')](_0x32bf6e,function(_0x1a2581){if(_0x1a2581[_0xbb53('0x32')]!==_0xbb53('0x42')){var _0x516191={};_0x516191[_0x1a2581[_0xbb53('0x2b')]]={'$like':'%'+_0x5f8005[_0xbb53('0x35')]['filter']+'%'};return _0x516191;}})});}_0x3ef8c1=_[_0xbb53('0x43')]({},_0x3ef8c1,_0x5f8005[_0xbb53('0x44')]);var _0x5c01ac={'where':_0x3ef8c1[_0xbb53('0x3f')]};return db[_0xbb53('0x2f')][_0xbb53('0x23')](_0x5c01ac)[_0xbb53('0x14')](function(_0x570487){_0x4dfa8a[_0xbb53('0x23')]=_0x570487;if(_0x5f8005[_0xbb53('0x35')]['includeAll']){_0x3ef8c1[_0xbb53('0x45')]=[{'all':!![]}];}return db[_0xbb53('0x2f')]['findAll'](_0x3ef8c1);})[_0xbb53('0x14')](function(_0x3f9b0e){_0x4dfa8a[_0xbb53('0x46')]=_0x3f9b0e;return _0x4dfa8a;})[_0xbb53('0x14')](respondWithFilteredResult(_0xddc430,_0x3ef8c1))['catch'](handleError(_0xddc430,null));};exports[_0xbb53('0x47')]=function(_0x59a030,_0x41036b){var _0x542f95={'raw':!![],'where':{'id':_0x59a030[_0xbb53('0x48')]['id']}},_0x536a79={};_0x536a79[_0xbb53('0x34')]=_[_0xbb53('0x36')](db[_0xbb53('0x2f')][_0xbb53('0x30')]);_0x536a79[_0xbb53('0x35')]=_['keys'](_0x59a030[_0xbb53('0x35')]);_0x536a79[_0xbb53('0x37')]=_[_0xbb53('0x38')](_0x536a79[_0xbb53('0x34')],_0x536a79[_0xbb53('0x35')]);_0x542f95[_0xbb53('0x39')]=_['intersection'](_0x536a79['model'],qs[_0xbb53('0x3a')](_0x59a030[_0xbb53('0x35')][_0xbb53('0x3a')]));_0x542f95[_0xbb53('0x39')]=_0x542f95[_0xbb53('0x39')][_0xbb53('0x3b')]?_0x542f95[_0xbb53('0x39')]:_0x536a79[_0xbb53('0x34')];if(_0x59a030[_0xbb53('0x35')][_0xbb53('0x49')]){_0x542f95[_0xbb53('0x45')]=[{'all':!![]}];}_0x542f95=_[_0xbb53('0x43')]({},_0x542f95,_0x59a030[_0xbb53('0x44')]);return db['MailMessage'][_0xbb53('0x4a')](_0x542f95)[_0xbb53('0x14')](handleEntityNotFound(_0x41036b,null))[_0xbb53('0x14')](respondWithResult(_0x41036b,null))['catch'](handleError(_0x41036b,null));};exports['update']=function(_0x569213,_0x50dc38){if(_0x569213[_0xbb53('0x4b')]['id']){delete _0x569213['body']['id'];}return db[_0xbb53('0x2f')]['find']({'where':{'id':_0x569213[_0xbb53('0x48')]['id']}})[_0xbb53('0x14')](handleEntityNotFound(_0x50dc38,null))[_0xbb53('0x14')](saveUpdates(_0x569213[_0xbb53('0x4b')],null))[_0xbb53('0x14')](respondWithResult(_0x50dc38,null))['catch'](handleError(_0x50dc38,null));};exports[_0xbb53('0x28')]=function(_0x18cd5b,_0x42f28c){return db[_0xbb53('0x2f')][_0xbb53('0x4a')]({'where':{'id':_0x18cd5b[_0xbb53('0x48')]['id']}})[_0xbb53('0x14')](handleEntityNotFound(_0x42f28c,null))[_0xbb53('0x14')](removeEntity(_0x42f28c,null))[_0xbb53('0x1e')](handleError(_0x42f28c,null));};exports[_0xbb53('0x4c')]=function(_0xddfdbc,_0x219c90){return db[_0xbb53('0x2f')][_0xbb53('0x4c')]()[_0xbb53('0x14')](respondWithResult(_0x219c90,null))[_0xbb53('0x1e')](handleError(_0x219c90,null));};exports[_0xbb53('0x4d')]=function(_0x248528,_0x58e5a5){return db['MailMessage'][_0xbb53('0x4d')](_0x248528[_0xbb53('0x4b')])['then'](function(_0x44fd80){if(_0x44fd80){if(_0x44fd80['direction']===_0xbb53('0x4e')&&!_0x44fd80['secret']){var _0x2d91b3,_0x209fc9,_0x59b59d;if(_0x248528[_0xbb53('0x4b')]['to']){_0x209fc9=_0x248528[_0xbb53('0x4b')]['to'][_0xbb53('0x4f')](',')[0x0];}return db['MailAccount'][_0xbb53('0x50')]({'where':{'id':_0x44fd80[_0xbb53('0x51')]},'include':[{'model':db[_0xbb53('0x52')],'as':_0xbb53('0x53'),'include':[{'model':db['CmContact'],'as':_0xbb53('0x54'),'where':{'email':_0x209fc9},'limit':0x1,'order':[['updatedAt',_0xbb53('0x55')]]}]},{'model':db[_0xbb53('0x56')],'as':_0xbb53('0x57'),'raw':!![]}]})[_0xbb53('0x14')](function(_0x3c1168){_0x2d91b3=_0x3c1168;if(_0x2d91b3&&_0x2d91b3[_0xbb53('0x57')]){var _0x21526a={'tls':{'rejectUnauthorized':![]}};if(_[_0xbb53('0x58')](_0x2d91b3[_0xbb53('0x57')][_0xbb53('0x59')])){_0x21526a[_0xbb53('0x5a')]=_0x2d91b3['Smtp']['host'];_0x21526a['port']=_0x2d91b3[_0xbb53('0x57')][_0xbb53('0x5b')];_0x21526a[_0xbb53('0x5c')]=_0x2d91b3['Smtp']['secure'];if(_0x2d91b3[_0xbb53('0x57')]['authentication']){_0x21526a['auth']={'user':_0x2d91b3['Smtp']['user'],'pass':_0x2d91b3[_0xbb53('0x57')][_0xbb53('0x5d')]};}}else{_0x21526a['service']=_0x2d91b3[_0xbb53('0x57')][_0xbb53('0x59')];_0x21526a[_0xbb53('0x5e')]={'user':_0x2d91b3[_0xbb53('0x57')]['user'],'pass':_0x2d91b3[_0xbb53('0x57')][_0xbb53('0x5d')]};_0x21526a[_0xbb53('0x5c')]=_0x2d91b3[_0xbb53('0x57')][_0xbb53('0x5c')];}if(_0x248528[_0xbb53('0x4b')][_0xbb53('0x5f')]&&_0x248528['body'][_0xbb53('0x5f')][_0xbb53('0x3b')]){for(var _0x5d92f4=0x0;_0x5d92f4<_0x248528[_0xbb53('0x4b')]['attachments'][_0xbb53('0x3b')];_0x5d92f4+=0x1){_0x248528[_0xbb53('0x4b')][_0xbb53('0x5f')][_0x5d92f4]={'filename':_0x248528[_0xbb53('0x4b')][_0xbb53('0x5f')][_0x5d92f4][_0xbb53('0x2b')],'path':path[_0xbb53('0x60')](config['root'],'server/files/attachments',_0x248528['body'][_0xbb53('0x5f')][_0x5d92f4]['basename'])};}}_0x59b59d={'account':_0x21526a,'message':_0x248528[_0xbb53('0x4b')]};return;}})[_0xbb53('0x14')](function(){if(_0x2d91b3['List']){if(_0x2d91b3[_0xbb53('0x53')][_0xbb53('0x54')]['length']){return _0x2d91b3[_0xbb53('0x53')]['Contacts'][0x0];}else{return db[_0xbb53('0x61')][_0xbb53('0x4d')](_[_0xbb53('0xc')](_0x248528[_0xbb53('0x4b')],{'firstName':_0x248528[_0xbb53('0x4b')]['to'],'email':_0x248528[_0xbb53('0x4b')]['to'],'phone':_0x248528[_0xbb53('0x4b')]['to'],'ListId':_0x2d91b3['ListId']}));}}else{throw new Error('List\x20not\x20found');}})[_0xbb53('0x14')](function(){if(_0x59b59d){return respondWithRpcPromise(_0xbb53('0x62'),_0xbb53('0x63'),_0x59b59d,client9003)['then'](function(_0x29391b){return _0x44fd80[_0xbb53('0x27')]({'read':!![],'messageId':_0x29391b[_0xbb53('0x64')],'sentAt':moment()['format'](_0xbb53('0x65'))});})[_0xbb53('0x1e')](function(_0x5e139a){logger['error']('%s',JSON['stringify'](_0x5e139a));return _0x44fd80;});}return _0x44fd80;});}return _0x44fd80;}})[_0xbb53('0x14')](respondWithResult(_0x58e5a5,0xc9))['catch'](handleError(_0x58e5a5,null));};exports[_0xbb53('0x66')]=function(_0x58137b,_0xe4ea95){var _0x40ca2e={'agent':{},'channel':_0xbb53('0x67')};if(_0x58137b[_0xbb53('0x4b')]['id']){delete _0x58137b[_0xbb53('0x4b')]['id'];}_0x58137b[_0xbb53('0x4b')][_0xbb53('0x68')]=!![];_0x58137b['body'][_0xbb53('0x69')]=moment()['format'](_0xbb53('0x65'));_0x58137b[_0xbb53('0x4b')][_0xbb53('0x6a')]=_0x58137b['body']['UserId']||_0x58137b['user']['id'];_0x40ca2e[_0xbb53('0x6b')]['id']=_0x58137b[_0xbb53('0x4b')]['UserId'];return db['MailMessage']['find']({'where':{'id':_0x58137b['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0xe4ea95,null))[_0xbb53('0x14')](saveUpdates(_0x58137b[_0xbb53('0x4b')],null))[_0xbb53('0x14')](function(_0x29cd8b){if(_0x29cd8b){_0x40ca2e['message']=_0x29cd8b[_0xbb53('0x6c')]({'plain':!![]});return db[_0xbb53('0x6d')][_0xbb53('0x4a')]({'where':{'id':_0x29cd8b['MailInteractionId']}});}return null;})[_0xbb53('0x14')](handleEntityNotFound(_0xe4ea95,null))['then'](function(_0x199e62){if(_0x199e62){return _0x199e62[_0xbb53('0x27')]({'UserId':_0x58137b[_0xbb53('0x4b')][_0xbb53('0x6a')],'read1stAt':_[_0xbb53('0x58')](_0x199e62[_0xbb53('0x6e')])?moment()[_0xbb53('0x6f')](_0xbb53('0x65')):undefined});}return null;})['then'](function(_0x2d82ad){if(_0x2d82ad){_0x40ca2e[_0xbb53('0x70')]=_0x2d82ad[_0xbb53('0x6c')]({'plain':!![]});interaction_log[_0xbb53('0x15')](_0xbb53('0x71'),_0x58137b[_0xbb53('0x72')]['id'],_0x58137b[_0xbb53('0x72')]['name'],_0x58137b[_0xbb53('0x72')][_0xbb53('0x73')],_0x40ca2e[_0xbb53('0x70')]['id'],_0x58137b['body']?JSON[_0xbb53('0x19')](_0x58137b['body']):_0xbb53('0x74'));return respondWithRpcPromise(_0xbb53('0x75'),_0xbb53('0x76'),_0x40ca2e);}return null;})['then'](function(_0x3eebbc){var _0x326372=_0xbb53('0x77')+_0x3eebbc[_0xbb53('0x1b')][_0xbb53('0x78')];return db['sequelize'][_0xbb53('0x35')](_0x326372,{'type':db[_0xbb53('0x79')][_0xbb53('0x7a')][_0xbb53('0x7b')],'raw':!![]})[_0xbb53('0x14')](function(_0x4a3e6b){return _0x4a3e6b;});})[_0xbb53('0x14')](function(_0x2b56ff){if(_0x2b56ff){_0x40ca2e[_0xbb53('0x1b')][_0xbb53('0x7c')]=_0x2b56ff[0x0];if(!_0x58137b[_0xbb53('0x4b')][_0xbb53('0x6a')])return;return db[_0xbb53('0x7d')]['find']({'where':{'id':_0x58137b[_0xbb53('0x4b')]['UserId'],'role':_0xbb53('0x6b')},'attributes':['id',_0xbb53('0x2b'),'fullname',_0xbb53('0x7e'),_0xbb53('0x7f')],'raw':!![]});}return null;})['then'](function(_0x10b74f){if(!_0x10b74f)return null;_0x40ca2e['message'][_0xbb53('0x6b')]=_0x10b74f;return _0x40ca2e;})[_0xbb53('0x14')](function(_0x2fa7a3){if(_0x2fa7a3){if(_0x58137b['body'][_0xbb53('0x80')]){_0x40ca2e[_0xbb53('0x1b')][_0xbb53('0x81')]=util[_0xbb53('0x6f')](_0xbb53('0x82'),_0x58137b[_0xbb53('0x72')][_0xbb53('0x2b')]);_0x40ca2e[_0xbb53('0x1b')][_0xbb53('0x83')]=_0x40ca2e['channel'];_0x40ca2e['message'][_0xbb53('0x84')]=_0x40ca2e[_0xbb53('0x83')];_0x40ca2e[_0xbb53('0x1b')][_0xbb53('0x85')]='accept';_0x40ca2e[_0xbb53('0x1b')][_0xbb53('0x4b')]=htmlToText[_0xbb53('0x86')](_0x40ca2e[_0xbb53('0x1b')][_0xbb53('0x4b')]);return respondWithRpcPromise(_0xbb53('0x87'),_0xbb53('0x87'),{'event':_0xbb53('0x88'),'message':_0x40ca2e[_0xbb53('0x1b')]},client9002)[_0xbb53('0x14')](function(){return _0x40ca2e;});}return _0x40ca2e;}return null;})[_0xbb53('0x14')](respondWithResult(_0xe4ea95,null))['catch'](handleError(_0xe4ea95,null));};exports['reject']=function(_0x32aa6f,_0x3e0153){var _0x881704={'agent':{},'channel':_0xbb53('0x67')};if(_0x32aa6f['body']['id']){delete _0x32aa6f[_0xbb53('0x4b')]['id'];}_0x32aa6f[_0xbb53('0x4b')][_0xbb53('0x6a')]=_0x32aa6f[_0xbb53('0x4b')]['UserId']||_0x32aa6f[_0xbb53('0x72')]['id'];_0x881704[_0xbb53('0x6b')]['id']=_0x32aa6f[_0xbb53('0x4b')][_0xbb53('0x6a')];return db['MailMessage'][_0xbb53('0x4a')]({'where':{'id':_0x32aa6f[_0xbb53('0x48')]['id'],'UserId':null}})[_0xbb53('0x14')](handleEntityNotFound(_0x3e0153,null))['then'](function(_0x48fcd3){if(_0x48fcd3){_0x881704[_0xbb53('0x1b')]=_0x48fcd3['get']({'plain':!![]});return db[_0xbb53('0x6d')][_0xbb53('0x4a')]({'where':{'id':_0x48fcd3[_0xbb53('0x89')]}});}return null;})['then'](handleEntityNotFound(_0x3e0153,null))[_0xbb53('0x14')](function(_0x2a40dd){if(_0x2a40dd){_0x881704['interaction']=_0x2a40dd[_0xbb53('0x6c')]({'plain':!![]});interaction_log['info'](_0xbb53('0x8a'),_0x32aa6f[_0xbb53('0x72')]['id'],_0x32aa6f[_0xbb53('0x72')]['name'],_0x32aa6f[_0xbb53('0x72')][_0xbb53('0x73')],_0x881704[_0xbb53('0x70')]['id'],_0x32aa6f['body']?JSON[_0xbb53('0x19')](_0x32aa6f[_0xbb53('0x4b')]):'null');return respondWithRpcPromise(_0xbb53('0x8b'),_0xbb53('0x8c'),_0x881704);}return null;})['then'](function(_0x52e3b2){var _0x3d55c4=_0xbb53('0x77')+_0x52e3b2[_0xbb53('0x1b')]['ContactId'];return db[_0xbb53('0x8d')][_0xbb53('0x35')](_0x3d55c4,{'type':db[_0xbb53('0x79')][_0xbb53('0x7a')][_0xbb53('0x7b')],'raw':!![]})[_0xbb53('0x14')](function(_0x20b647){return _0x20b647;});})[_0xbb53('0x14')](function(_0x32d577){if(_0x32d577){_0x881704['message'][_0xbb53('0x7c')]=_0x32d577[0x0];if(!_0x32aa6f[_0xbb53('0x4b')][_0xbb53('0x6a')])return;return db[_0xbb53('0x7d')][_0xbb53('0x4a')]({'where':{'id':_0x32aa6f[_0xbb53('0x4b')][_0xbb53('0x6a')],'role':'agent'},'attributes':['id',_0xbb53('0x2b'),_0xbb53('0x8e'),_0xbb53('0x7e'),_0xbb53('0x7f')],'raw':!![]});}return null;})[_0xbb53('0x14')](function(_0x49f52f){if(!_0x49f52f)return null;_0x881704[_0xbb53('0x1b')][_0xbb53('0x6b')]=_0x49f52f;return _0x881704;})[_0xbb53('0x14')](function(_0x2a7355){if(_0x2a7355){_0x2a7355[_0xbb53('0x1b')]['interface']=util[_0xbb53('0x6f')](_0xbb53('0x82'),_0x32aa6f['user'][_0xbb53('0x2b')]);_0x2a7355['message'][_0xbb53('0x83')]=_0x881704['channel'];_0x2a7355[_0xbb53('0x1b')][_0xbb53('0x84')]=_0x881704[_0xbb53('0x83')];_0x2a7355[_0xbb53('0x1b')][_0xbb53('0x85')]=_0xbb53('0x8f');_0x2a7355['message']['body']=htmlToText[_0xbb53('0x86')](_0x881704['message'][_0xbb53('0x4b')]);respondWithRpcPromise('EventManager',_0xbb53('0x87'),{'event':_0xbb53('0x90'),'message':_0x2a7355[_0xbb53('0x1b')]},client9002);return _0x881704;}return null;})[_0xbb53('0x14')](respondWithResult(_0x3e0153,null))['catch'](handleError(_0x3e0153,null));};exports[_0xbb53('0x91')]=function(_0x497616,_0x920c49){var _0xca2a8e=moment()[_0xbb53('0x92')]()[_0xbb53('0x93')]();var _0x53a3a3=path[_0xbb53('0x60')](config[_0xbb53('0x94')],_0xbb53('0x95'),_0xbb53('0x96'),'tmp');var _0xe0a103=path[_0xbb53('0x60')](config['root'],_0xbb53('0x95'),'files',_0xbb53('0x5f'));var _0x4d0aef=util[_0xbb53('0x6f')](_0xbb53('0x97'),_0xca2a8e);return db[_0xbb53('0x2f')][_0xbb53('0x4a')]({'where':{'id':_0x497616[_0xbb53('0x48')]['id']},'attributes':['id',_0xbb53('0x4b'),_0xbb53('0x98'),'to','cc',_0xbb53('0x99'),_0xbb53('0x9a'),'createdAt'],'include':_0x497616[_0xbb53('0x35')][_0xbb53('0x5f')]?[{'model':db[_0xbb53('0x9b')],'as':_0xbb53('0x9c')}]:undefined})[_0xbb53('0x14')](handleEntityNotFound(_0x920c49,null))[_0xbb53('0x14')](function(_0x394145){if(_0x394145){var _0x5c994d=_0x394145;var _0x50598b={'from':_0x5c994d[_0xbb53('0x98')],'to':_0x5c994d['to'],'subject':_0x5c994d['subject'],'html':_0x5c994d[_0xbb53('0x4b')],'headers':{'Date':moment(_0x5c994d['createdAt'])[_0xbb53('0x6f')](_0xbb53('0x9d'))},'attachments':[]};if(_0x394145['cc']){_0x50598b[_0xbb53('0x9e')]['Cc']=_0x394145['cc'];}if(_0x394145[_0xbb53('0x99')]){_0x50598b['headers'][_0xbb53('0x9f')]=_0x394145['bcc'];}return new BPromise(function(_0x127771,_0x90982f){if(_0x394145[_0xbb53('0x9c')]){for(var _0x2ac484=0x0;_0x2ac484<_0x394145[_0xbb53('0x9c')][_0xbb53('0x3b')];_0x2ac484++){var _0x2d9bd1=_0x394145[_0xbb53('0x9c')][_0x2ac484];var _0x6302b5=path[_0xbb53('0x60')](_0xe0a103,_0x2d9bd1[_0xbb53('0xa0')]);if(fs[_0xbb53('0xa1')](_0x6302b5)){_0x50598b[_0xbb53('0x5f')]['push']({'name':_0x2d9bd1['name'],'contentType':_0x2d9bd1['type'],'data':fs['readFileSync'](_0x6302b5)});}}}emlformat[_0xbb53('0xa2')](_0x50598b,function(_0x1e2126,_0x4481e5){if(_0x1e2126)return _0x90982f(_0x1e2126);fs[_0xbb53('0xa3')](path['join'](_0x53a3a3,_0x4d0aef),_0x4481e5);return _0x127771(_0x4481e5);});});}})[_0xbb53('0x14')](function(_0x1d6e22){if(_0x1d6e22){return _0x920c49['download'](path['join'](_0x53a3a3,_0x4d0aef),_0x4d0aef,function(_0x355e4b){if(!_0x355e4b)fs[_0xbb53('0xa4')](path[_0xbb53('0x60')](_0x53a3a3,_0x4d0aef));});}})[_0xbb53('0x1e')](handleError(_0x920c49,null));}; \ No newline at end of file +var _0x0097=['json','undefined','limit','count','offset','update','end','stack','name','send','index','map','MailMessage','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','VIRTUAL','merge','options','includeAll','findAll','rows','show','length','find','body','params','destroy','describe','create','out','split','MailAccount','List','CmContact','Contacts','updatedAt','DESC','MailServerOut','Smtp','isNil','host','port','secure','authentication','auth','user','pass','service','attachments','basename','ListId','SendMail','messageId','format','mail','read','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','MailInteraction','read1stAt','interaction','[MAILMESSAGE: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','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','channel','motionChannel','event','accept','fromString','EventManager','acceptmessage','reject','MailInteractionId','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','rejectMessage','interface','SIP/%s','rejectmessage','unix','toString','root','server','files','tmp','message-%s.eml','bcc','subject','createdAt','Attachment','Attachments','from','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','join','existsSync','push','readFileSync','build','writeFileSync','download','unlinkSync','eml-format','moment','bluebird','path','lodash','ioredis','html-to-text','../../components/parsers/qs','api','../../config/logger','mail-interactions','../../mysqldb','redis','defaults','localhost','register','jayson/promise','client','http','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','status'];(function(_0x20589d,_0x55d5bf){var _0x422de9=function(_0x44cbbb){while(--_0x44cbbb){_0x20589d['push'](_0x20589d['shift']());}};_0x422de9(++_0x55d5bf);}(_0x0097,0x1c4));var _0x7009=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0097[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x7009('0x0'));var moment=require(_0x7009('0x1'));var BPromise=require(_0x7009('0x2'));var util=require('util');var path=require(_0x7009('0x3'));var fs=require('fs');var _=require(_0x7009('0x4'));var Redis=require(_0x7009('0x5'));var htmlToText=require(_0x7009('0x6'));var qs=require(_0x7009('0x7'));var logger=require('../../config/logger')(_0x7009('0x8'));var interaction_log=require(_0x7009('0x9'))(_0x7009('0xa'));var config=require('../../config/environment');var db=require(_0x7009('0xb'))['db'];config[_0x7009('0xc')]=_[_0x7009('0xd')](config[_0x7009('0xc')],{'host':_0x7009('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7009('0xc')]));require('./mailMessage.socket')[_0x7009('0xf')](socket);var jayson=require(_0x7009('0x10'));var client=jayson[_0x7009('0x11')][_0x7009('0x12')]({'port':0x232c});var client9003=jayson['client'][_0x7009('0x12')]({'port':0x232b});var client9002=jayson[_0x7009('0x11')][_0x7009('0x12')]({'port':0x232a});function respondWithRpcPromise(_0x362cbf,_0x102f19,_0x2c8427,_0x5f3c41){return new BPromise(function(_0x4f16b4,_0x395048){var _0x26ddbf=_0x5f3c41||client;return _0x26ddbf[_0x7009('0x13')](_0x362cbf,_0x2c8427)[_0x7009('0x14')](function(_0x44ffa1){logger[_0x7009('0x15')](_0x7009('0x16'),_0x102f19,_0x7009('0x17'));logger[_0x7009('0x18')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x102f19,_0x7009('0x17'),JSON['stringify'](_0x44ffa1));if(_0x44ffa1[_0x7009('0x19')]){if(_0x44ffa1[_0x7009('0x19')][_0x7009('0x1a')]===0x1f4){logger[_0x7009('0x19')](_0x7009('0x16'),_0x102f19,_0x44ffa1[_0x7009('0x19')][_0x7009('0x1b')]);return _0x395048(_0x44ffa1[_0x7009('0x19')][_0x7009('0x1b')]);}logger[_0x7009('0x19')](_0x7009('0x16'),_0x102f19,_0x44ffa1[_0x7009('0x19')][_0x7009('0x1b')]);return _0x4f16b4(_0x44ffa1[_0x7009('0x19')][_0x7009('0x1b')]);}else{logger[_0x7009('0x15')]('MailMessage,\x20%s,\x20%s',_0x102f19,_0x7009('0x17'));_0x4f16b4(_0x44ffa1[_0x7009('0x1c')][_0x7009('0x1b')]);}})[_0x7009('0x1d')](function(_0x405b71){logger[_0x7009('0x19')](_0x7009('0x16'),_0x102f19,_0x405b71);_0x395048(_0x405b71);});});}function respondWithResult(_0x14fc67,_0x277e6e){_0x277e6e=_0x277e6e||0xc8;return function(_0x1ab40d){if(_0x1ab40d){return _0x14fc67[_0x7009('0x1e')](_0x277e6e)[_0x7009('0x1f')](_0x1ab40d);}};}function respondWithFilteredResult(_0x39a227,_0x244dea){return function(_0x1622b6){if(_0x1622b6){var _0x466d7f=typeof _0x244dea['offset']===_0x7009('0x20')&&typeof _0x244dea[_0x7009('0x21')]===_0x7009('0x20');var _0x2efe95=_0x1622b6[_0x7009('0x22')];var _0x4a8aa1=_0x466d7f?0x0:_0x244dea[_0x7009('0x23')];var _0xa2c73b=_0x466d7f?_0x1622b6['count']:_0x244dea[_0x7009('0x23')]+_0x244dea[_0x7009('0x21')];var _0x4ce027;if(_0xa2c73b>=_0x2efe95){_0xa2c73b=_0x2efe95;_0x4ce027=0xc8;}else{_0x4ce027=0xce;}_0x39a227[_0x7009('0x1e')](_0x4ce027);return _0x39a227['set']('Content-Range',_0x4a8aa1+'-'+_0xa2c73b+'/'+_0x2efe95)[_0x7009('0x1f')](_0x1622b6);}return null;};}function saveUpdates(_0xfaa8b7){return function(_0x14e4a6){if(_0x14e4a6){return _0x14e4a6[_0x7009('0x24')](_0xfaa8b7)['then'](function(_0x31180c){return _0x31180c;});}return null;};}function removeEntity(_0x44aa26){return function(_0x3e0a9f){if(_0x3e0a9f){return _0x3e0a9f['destroy']()[_0x7009('0x14')](function(){_0x44aa26[_0x7009('0x1e')](0xcc)[_0x7009('0x25')]();});}};}function handleEntityNotFound(_0x5e0882){return function(_0x141942){if(!_0x141942){_0x5e0882['sendStatus'](0x194);}return _0x141942;};}function handleError(_0x1126a4,_0x438874){_0x438874=_0x438874||0x1f4;return function(_0x5dba02){logger['error'](_0x5dba02[_0x7009('0x26')]);if(_0x5dba02[_0x7009('0x27')]){delete _0x5dba02[_0x7009('0x27')];}_0x1126a4[_0x7009('0x1e')](_0x438874)[_0x7009('0x28')](_0x5dba02);};}exports[_0x7009('0x29')]=function(_0x48ee73,_0x11d1b6){var _0x229adb={},_0x2367c3={},_0xea37f2={'count':0x0,'rows':[]};var _0x159f08=_[_0x7009('0x2a')](db[_0x7009('0x2b')]['rawAttributes'],function(_0x14b52e){return{'name':_0x14b52e['fieldName'],'type':_0x14b52e[_0x7009('0x2c')]['key']};});_0x2367c3[_0x7009('0x2d')]=_['map'](_0x159f08,_0x7009('0x27'));_0x2367c3[_0x7009('0x2e')]=_[_0x7009('0x2f')](_0x48ee73[_0x7009('0x2e')]);_0x2367c3[_0x7009('0x30')]=_[_0x7009('0x31')](_0x2367c3[_0x7009('0x2d')],_0x2367c3[_0x7009('0x2e')]);_0x229adb[_0x7009('0x32')]=_[_0x7009('0x31')](_0x2367c3[_0x7009('0x2d')],qs[_0x7009('0x33')](_0x48ee73[_0x7009('0x2e')][_0x7009('0x33')]));_0x229adb[_0x7009('0x32')]=_0x229adb[_0x7009('0x32')]['length']?_0x229adb['attributes']:_0x2367c3[_0x7009('0x2d')];if(!_0x48ee73['query'][_0x7009('0x34')](_0x7009('0x35'))){_0x229adb[_0x7009('0x21')]=qs[_0x7009('0x21')](_0x48ee73[_0x7009('0x2e')]['limit']);_0x229adb[_0x7009('0x23')]=qs[_0x7009('0x23')](_0x48ee73['query'][_0x7009('0x23')]);}_0x229adb['order']=qs[_0x7009('0x36')](_0x48ee73[_0x7009('0x2e')][_0x7009('0x36')]);_0x229adb[_0x7009('0x37')]=qs['filters'](_[_0x7009('0x38')](_0x48ee73['query'],_0x2367c3[_0x7009('0x30')]),_0x159f08);if(_0x48ee73['query']['filter']){_0x229adb[_0x7009('0x37')]=_['merge'](_0x229adb[_0x7009('0x37')],{'$or':_[_0x7009('0x2a')](_0x159f08,function(_0x51519b){if(_0x51519b[_0x7009('0x2c')]!==_0x7009('0x39')){var _0x540673={};_0x540673[_0x51519b[_0x7009('0x27')]]={'$like':'%'+_0x48ee73[_0x7009('0x2e')]['filter']+'%'};return _0x540673;}})});}_0x229adb=_[_0x7009('0x3a')]({},_0x229adb,_0x48ee73[_0x7009('0x3b')]);var _0x2c9056={'where':_0x229adb[_0x7009('0x37')]};return db[_0x7009('0x2b')][_0x7009('0x22')](_0x2c9056)[_0x7009('0x14')](function(_0x380d3e){_0xea37f2[_0x7009('0x22')]=_0x380d3e;if(_0x48ee73[_0x7009('0x2e')][_0x7009('0x3c')]){_0x229adb['include']=[{'all':!![]}];}return db[_0x7009('0x2b')][_0x7009('0x3d')](_0x229adb);})['then'](function(_0x262ea4){_0xea37f2[_0x7009('0x3e')]=_0x262ea4;return _0xea37f2;})[_0x7009('0x14')](respondWithFilteredResult(_0x11d1b6,_0x229adb))[_0x7009('0x1d')](handleError(_0x11d1b6,null));};exports[_0x7009('0x3f')]=function(_0x4a0dcc,_0x53df71){var _0x5adfac={'raw':!![],'where':{'id':_0x4a0dcc['params']['id']}},_0x5bb4e5={};_0x5bb4e5[_0x7009('0x2d')]=_[_0x7009('0x2f')](db[_0x7009('0x2b')]['rawAttributes']);_0x5bb4e5['query']=_[_0x7009('0x2f')](_0x4a0dcc[_0x7009('0x2e')]);_0x5bb4e5[_0x7009('0x30')]=_['intersection'](_0x5bb4e5['model'],_0x5bb4e5['query']);_0x5adfac[_0x7009('0x32')]=_[_0x7009('0x31')](_0x5bb4e5['model'],qs[_0x7009('0x33')](_0x4a0dcc[_0x7009('0x2e')][_0x7009('0x33')]));_0x5adfac[_0x7009('0x32')]=_0x5adfac[_0x7009('0x32')][_0x7009('0x40')]?_0x5adfac[_0x7009('0x32')]:_0x5bb4e5[_0x7009('0x2d')];if(_0x4a0dcc['query'][_0x7009('0x3c')]){_0x5adfac['include']=[{'all':!![]}];}_0x5adfac=_[_0x7009('0x3a')]({},_0x5adfac,_0x4a0dcc[_0x7009('0x3b')]);return db['MailMessage'][_0x7009('0x41')](_0x5adfac)[_0x7009('0x14')](handleEntityNotFound(_0x53df71,null))['then'](respondWithResult(_0x53df71,null))[_0x7009('0x1d')](handleError(_0x53df71,null));};exports[_0x7009('0x24')]=function(_0x10647d,_0x49cc2a){if(_0x10647d[_0x7009('0x42')]['id']){delete _0x10647d[_0x7009('0x42')]['id'];}return db['MailMessage'][_0x7009('0x41')]({'where':{'id':_0x10647d[_0x7009('0x43')]['id']}})[_0x7009('0x14')](handleEntityNotFound(_0x49cc2a,null))['then'](saveUpdates(_0x10647d[_0x7009('0x42')],null))[_0x7009('0x14')](respondWithResult(_0x49cc2a,null))[_0x7009('0x1d')](handleError(_0x49cc2a,null));};exports[_0x7009('0x44')]=function(_0x237917,_0x96354c){return db[_0x7009('0x2b')][_0x7009('0x41')]({'where':{'id':_0x237917[_0x7009('0x43')]['id']}})[_0x7009('0x14')](handleEntityNotFound(_0x96354c,null))[_0x7009('0x14')](removeEntity(_0x96354c,null))[_0x7009('0x1d')](handleError(_0x96354c,null));};exports['describe']=function(_0x37048c,_0xb8d3d1){return db[_0x7009('0x2b')][_0x7009('0x45')]()[_0x7009('0x14')](respondWithResult(_0xb8d3d1,null))[_0x7009('0x1d')](handleError(_0xb8d3d1,null));};exports[_0x7009('0x46')]=function(_0x59d31a,_0x40a5a4){return db[_0x7009('0x2b')][_0x7009('0x46')](_0x59d31a[_0x7009('0x42')])[_0x7009('0x14')](function(_0x321ddb){if(_0x321ddb){if(_0x321ddb['direction']===_0x7009('0x47')&&!_0x321ddb['secret']){var _0x15516d,_0x585333,_0x31c222;if(_0x59d31a[_0x7009('0x42')]['to']){_0x585333=_0x59d31a[_0x7009('0x42')]['to'][_0x7009('0x48')](',')[0x0];}return db[_0x7009('0x49')]['findOne']({'where':{'id':_0x321ddb['MailAccountId']},'include':[{'model':db['CmList'],'as':_0x7009('0x4a'),'include':[{'model':db[_0x7009('0x4b')],'as':_0x7009('0x4c'),'where':{'email':_0x585333},'limit':0x1,'order':[[_0x7009('0x4d'),_0x7009('0x4e')]]}]},{'model':db[_0x7009('0x4f')],'as':_0x7009('0x50'),'raw':!![]}]})['then'](function(_0x4fc97d){_0x15516d=_0x4fc97d;if(_0x15516d&&_0x15516d['Smtp']){var _0x58ff5f={'tls':{'rejectUnauthorized':![]}};if(_[_0x7009('0x51')](_0x15516d[_0x7009('0x50')]['service'])){_0x58ff5f['host']=_0x15516d[_0x7009('0x50')][_0x7009('0x52')];_0x58ff5f[_0x7009('0x53')]=_0x15516d[_0x7009('0x50')][_0x7009('0x53')];_0x58ff5f[_0x7009('0x54')]=_0x15516d['Smtp'][_0x7009('0x54')];if(_0x15516d['Smtp'][_0x7009('0x55')]){_0x58ff5f[_0x7009('0x56')]={'user':_0x15516d['Smtp'][_0x7009('0x57')],'pass':_0x15516d[_0x7009('0x50')][_0x7009('0x58')]};}}else{_0x58ff5f[_0x7009('0x59')]=_0x15516d['Smtp'][_0x7009('0x59')];_0x58ff5f[_0x7009('0x56')]={'user':_0x15516d['Smtp'][_0x7009('0x57')],'pass':_0x15516d[_0x7009('0x50')]['pass']};_0x58ff5f[_0x7009('0x54')]=_0x15516d[_0x7009('0x50')][_0x7009('0x54')];}if(_0x59d31a['body'][_0x7009('0x5a')]&&_0x59d31a['body'][_0x7009('0x5a')]['length']){for(var _0x1df9a0=0x0;_0x1df9a0<_0x59d31a[_0x7009('0x42')][_0x7009('0x5a')][_0x7009('0x40')];_0x1df9a0+=0x1){_0x59d31a[_0x7009('0x42')][_0x7009('0x5a')][_0x1df9a0]={'filename':_0x59d31a[_0x7009('0x42')][_0x7009('0x5a')][_0x1df9a0][_0x7009('0x27')],'path':path['join'](config['root'],'server/files/attachments',_0x59d31a[_0x7009('0x42')][_0x7009('0x5a')][_0x1df9a0][_0x7009('0x5b')])};}}_0x31c222={'account':_0x58ff5f,'message':_0x59d31a[_0x7009('0x42')]};return;}})[_0x7009('0x14')](function(){if(_0x15516d[_0x7009('0x4a')]){if(_0x15516d['List'][_0x7009('0x4c')][_0x7009('0x40')]){return _0x15516d[_0x7009('0x4a')]['Contacts'][0x0];}else{return db[_0x7009('0x4b')]['create'](_['defaults'](_0x59d31a[_0x7009('0x42')],{'firstName':_0x59d31a[_0x7009('0x42')]['to'],'email':_0x59d31a[_0x7009('0x42')]['to'],'phone':_0x59d31a[_0x7009('0x42')]['to'],'ListId':_0x15516d[_0x7009('0x5c')]}));}}else{throw new Error('List\x20not\x20found');}})[_0x7009('0x14')](function(){if(_0x31c222){return respondWithRpcPromise(_0x7009('0x5d'),'sendMail',_0x31c222,client9003)[_0x7009('0x14')](function(_0x49cc03){return _0x321ddb[_0x7009('0x24')]({'read':!![],'messageId':_0x49cc03[_0x7009('0x5e')],'sentAt':moment()[_0x7009('0x5f')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0x7009('0x1d')](function(_0x2083ca){logger['error']('%s',JSON['stringify'](_0x2083ca));return _0x321ddb;});}return _0x321ddb;});}return _0x321ddb;}})[_0x7009('0x14')](respondWithResult(_0x40a5a4,0xc9))[_0x7009('0x1d')](handleError(_0x40a5a4,null));};exports['accept']=function(_0x6fdfe0,_0x4eeb7e){var _0x577ff3={'agent':{},'channel':_0x7009('0x60')};if(_0x6fdfe0[_0x7009('0x42')]['id']){delete _0x6fdfe0[_0x7009('0x42')]['id'];}_0x6fdfe0[_0x7009('0x42')][_0x7009('0x61')]=!![];_0x6fdfe0[_0x7009('0x42')]['readAt']=moment()[_0x7009('0x5f')](_0x7009('0x62'));_0x6fdfe0[_0x7009('0x42')][_0x7009('0x63')]=_0x6fdfe0[_0x7009('0x42')][_0x7009('0x63')]||_0x6fdfe0[_0x7009('0x57')]['id'];_0x577ff3[_0x7009('0x64')]['id']=_0x6fdfe0[_0x7009('0x42')][_0x7009('0x63')];return db['MailMessage'][_0x7009('0x41')]({'where':{'id':_0x6fdfe0[_0x7009('0x43')]['id'],'UserId':null}})[_0x7009('0x14')](handleEntityNotFound(_0x4eeb7e,null))[_0x7009('0x14')](saveUpdates(_0x6fdfe0[_0x7009('0x42')],null))[_0x7009('0x14')](function(_0x5349d6){if(_0x5349d6){_0x577ff3[_0x7009('0x1b')]=_0x5349d6[_0x7009('0x65')]({'plain':!![]});return db[_0x7009('0x66')][_0x7009('0x41')]({'where':{'id':_0x5349d6['MailInteractionId']}});}return null;})[_0x7009('0x14')](handleEntityNotFound(_0x4eeb7e,null))[_0x7009('0x14')](function(_0x2834a2){if(_0x2834a2){return _0x2834a2[_0x7009('0x24')]({'UserId':_0x6fdfe0[_0x7009('0x42')][_0x7009('0x63')],'read1stAt':_[_0x7009('0x51')](_0x2834a2[_0x7009('0x67')])?moment()['format'](_0x7009('0x62')):undefined});}return null;})[_0x7009('0x14')](function(_0x1bf408){if(_0x1bf408){_0x577ff3[_0x7009('0x68')]=_0x1bf408['get']({'plain':!![]});interaction_log[_0x7009('0x15')](_0x7009('0x69'),_0x6fdfe0['user']['id'],_0x6fdfe0[_0x7009('0x57')]['name'],_0x6fdfe0['user']['role'],_0x577ff3[_0x7009('0x68')]['id'],_0x6fdfe0[_0x7009('0x42')]?JSON[_0x7009('0x6a')](_0x6fdfe0[_0x7009('0x42')]):_0x7009('0x6b'));return respondWithRpcPromise(_0x7009('0x6c'),_0x7009('0x6d'),_0x577ff3);}return null;})['then'](function(_0x25570e){var _0x217662=_0x7009('0x6e')+_0x25570e[_0x7009('0x1b')][_0x7009('0x6f')];return db[_0x7009('0x70')][_0x7009('0x2e')](_0x217662,{'type':db[_0x7009('0x71')][_0x7009('0x72')][_0x7009('0x73')],'raw':!![]})[_0x7009('0x14')](function(_0x269b45){return _0x269b45;});})[_0x7009('0x14')](function(_0x31882b){if(_0x31882b){_0x577ff3['message'][_0x7009('0x74')]=_0x31882b[0x0];if(!_0x6fdfe0[_0x7009('0x42')][_0x7009('0x63')])return;return db[_0x7009('0x75')][_0x7009('0x41')]({'where':{'id':_0x6fdfe0[_0x7009('0x42')]['UserId'],'role':_0x7009('0x64')},'attributes':['id','name',_0x7009('0x76'),_0x7009('0x77'),_0x7009('0x78')],'raw':!![]});}return null;})[_0x7009('0x14')](function(_0x47e0d1){if(!_0x47e0d1)return null;_0x577ff3['message'][_0x7009('0x64')]=_0x47e0d1;return _0x577ff3;})[_0x7009('0x14')](function(_0x2d3919){if(_0x2d3919){if(_0x6fdfe0[_0x7009('0x42')][_0x7009('0x79')]){_0x577ff3[_0x7009('0x1b')]['interface']=util[_0x7009('0x5f')]('SIP/%s',_0x6fdfe0[_0x7009('0x57')]['name']);_0x577ff3['message']['channel']=_0x577ff3[_0x7009('0x7a')];_0x577ff3['message'][_0x7009('0x7b')]=_0x577ff3[_0x7009('0x7a')];_0x577ff3[_0x7009('0x1b')][_0x7009('0x7c')]=_0x7009('0x7d');_0x577ff3[_0x7009('0x1b')]['body']=htmlToText[_0x7009('0x7e')](_0x577ff3[_0x7009('0x1b')][_0x7009('0x42')]);return respondWithRpcPromise(_0x7009('0x7f'),_0x7009('0x7f'),{'event':_0x7009('0x80'),'message':_0x577ff3['message']},client9002)[_0x7009('0x14')](function(){return _0x577ff3;});}return _0x577ff3;}return null;})[_0x7009('0x14')](respondWithResult(_0x4eeb7e,null))[_0x7009('0x1d')](handleError(_0x4eeb7e,null));};exports[_0x7009('0x81')]=function(_0x28b298,_0x32035b){var _0x26e555={'agent':{},'channel':'mail'};if(_0x28b298[_0x7009('0x42')]['id']){delete _0x28b298[_0x7009('0x42')]['id'];}_0x28b298[_0x7009('0x42')]['UserId']=_0x28b298[_0x7009('0x42')]['UserId']||_0x28b298[_0x7009('0x57')]['id'];_0x26e555[_0x7009('0x64')]['id']=_0x28b298[_0x7009('0x42')]['UserId'];return db[_0x7009('0x2b')][_0x7009('0x41')]({'where':{'id':_0x28b298[_0x7009('0x43')]['id'],'UserId':null}})[_0x7009('0x14')](handleEntityNotFound(_0x32035b,null))[_0x7009('0x14')](function(_0x11e1b3){if(_0x11e1b3){_0x26e555[_0x7009('0x1b')]=_0x11e1b3[_0x7009('0x65')]({'plain':!![]});return db[_0x7009('0x66')][_0x7009('0x41')]({'where':{'id':_0x11e1b3[_0x7009('0x82')]}});}return null;})[_0x7009('0x14')](handleEntityNotFound(_0x32035b,null))[_0x7009('0x14')](function(_0x1c6913){if(_0x1c6913){_0x26e555[_0x7009('0x68')]=_0x1c6913[_0x7009('0x65')]({'plain':!![]});interaction_log['info'](_0x7009('0x83'),_0x28b298['user']['id'],_0x28b298[_0x7009('0x57')]['name'],_0x28b298[_0x7009('0x57')][_0x7009('0x84')],_0x26e555['interaction']['id'],_0x28b298[_0x7009('0x42')]?JSON[_0x7009('0x6a')](_0x28b298[_0x7009('0x42')]):_0x7009('0x6b'));return respondWithRpcPromise('RejectMessage',_0x7009('0x85'),_0x26e555);}return null;})[_0x7009('0x14')](function(_0x2d91bc){var _0x3e1788='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x2d91bc[_0x7009('0x1b')]['ContactId'];return db[_0x7009('0x70')][_0x7009('0x2e')](_0x3e1788,{'type':db[_0x7009('0x71')]['QueryTypes'][_0x7009('0x73')],'raw':!![]})[_0x7009('0x14')](function(_0x4c6c03){return _0x4c6c03;});})['then'](function(_0x4ba68b){if(_0x4ba68b){_0x26e555[_0x7009('0x1b')][_0x7009('0x74')]=_0x4ba68b[0x0];if(!_0x28b298['body'][_0x7009('0x63')])return;return db['User'][_0x7009('0x41')]({'where':{'id':_0x28b298[_0x7009('0x42')][_0x7009('0x63')],'role':_0x7009('0x64')},'attributes':['id','name','fullname','email',_0x7009('0x78')],'raw':!![]});}return null;})['then'](function(_0x105757){if(!_0x105757)return null;_0x26e555[_0x7009('0x1b')][_0x7009('0x64')]=_0x105757;return _0x26e555;})[_0x7009('0x14')](function(_0x4a42ec){if(_0x4a42ec){_0x4a42ec['message'][_0x7009('0x86')]=util[_0x7009('0x5f')](_0x7009('0x87'),_0x28b298['user']['name']);_0x4a42ec['message'][_0x7009('0x7a')]=_0x26e555[_0x7009('0x7a')];_0x4a42ec['message'][_0x7009('0x7b')]=_0x26e555['channel'];_0x4a42ec[_0x7009('0x1b')]['event']=_0x7009('0x81');_0x4a42ec[_0x7009('0x1b')][_0x7009('0x42')]=htmlToText[_0x7009('0x7e')](_0x26e555[_0x7009('0x1b')]['body']);respondWithRpcPromise('EventManager','EventManager',{'event':_0x7009('0x88'),'message':_0x4a42ec['message']},client9002);return _0x26e555;}return null;})['then'](respondWithResult(_0x32035b,null))[_0x7009('0x1d')](handleError(_0x32035b,null));};exports['download']=function(_0x42d686,_0x314a86){var _0x26bd2d=moment()[_0x7009('0x89')]()[_0x7009('0x8a')]();var _0x58013a=path['join'](config[_0x7009('0x8b')],_0x7009('0x8c'),_0x7009('0x8d'),_0x7009('0x8e'));var _0x275c9e=path['join'](config['root'],_0x7009('0x8c'),_0x7009('0x8d'),'attachments');var _0x3f7967=util['format'](_0x7009('0x8f'),_0x26bd2d);return db['MailMessage'][_0x7009('0x41')]({'where':{'id':_0x42d686['params']['id']},'attributes':['id',_0x7009('0x42'),'from','to','cc',_0x7009('0x90'),_0x7009('0x91'),_0x7009('0x92')],'include':_0x42d686[_0x7009('0x2e')][_0x7009('0x5a')]?[{'model':db[_0x7009('0x93')],'as':_0x7009('0x94')}]:undefined})[_0x7009('0x14')](handleEntityNotFound(_0x314a86,null))[_0x7009('0x14')](function(_0x4dc3b9){if(_0x4dc3b9){var _0x31bf42=_0x4dc3b9;var _0xa4a7f2={'from':_0x31bf42[_0x7009('0x95')],'to':_0x31bf42['to'],'subject':_0x31bf42[_0x7009('0x91')],'html':_0x31bf42[_0x7009('0x42')],'headers':{'Date':moment(_0x31bf42[_0x7009('0x92')])['format'](_0x7009('0x96'))},'attachments':[]};if(_0x4dc3b9['cc']){_0xa4a7f2[_0x7009('0x97')]['Cc']=_0x4dc3b9['cc'];}if(_0x4dc3b9[_0x7009('0x90')]){_0xa4a7f2[_0x7009('0x97')][_0x7009('0x98')]=_0x4dc3b9[_0x7009('0x90')];}return new BPromise(function(_0x1cd7d9,_0x33fc8c){if(_0x4dc3b9[_0x7009('0x94')]){for(var _0x20089a=0x0;_0x20089a<_0x4dc3b9[_0x7009('0x94')][_0x7009('0x40')];_0x20089a++){var _0x1ab157=_0x4dc3b9[_0x7009('0x94')][_0x20089a];var _0x53a336=path[_0x7009('0x99')](_0x275c9e,_0x1ab157['basename']);if(fs[_0x7009('0x9a')](_0x53a336)){_0xa4a7f2[_0x7009('0x5a')][_0x7009('0x9b')]({'name':_0x1ab157[_0x7009('0x27')],'contentType':_0x1ab157[_0x7009('0x2c')],'data':fs[_0x7009('0x9c')](_0x53a336)});}}}emlformat[_0x7009('0x9d')](_0xa4a7f2,function(_0x33e45e,_0x2e9014){if(_0x33e45e)return _0x33fc8c(_0x33e45e);fs[_0x7009('0x9e')](path[_0x7009('0x99')](_0x58013a,_0x3f7967),_0x2e9014);return _0x1cd7d9(_0x2e9014);});});}})[_0x7009('0x14')](function(_0x18f1aa){if(_0x18f1aa){return _0x314a86[_0x7009('0x9f')](path['join'](_0x58013a,_0x3f7967),_0x3f7967,function(_0x3330ac){if(!_0x3330ac)fs[_0x7009('0xa0')](path[_0x7009('0x99')](_0x58013a,_0x3f7967));});}})['catch'](handleError(_0x314a86,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index 8af3be2..7cfdf41 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 _0xc003=['emit','hasOwnProperty','hook','exports','../../mysqldb','MailMessage','setMaxListeners','save','update','remove'];(function(_0x498f93,_0x255d50){var _0x4a2395=function(_0x4c3ece){while(--_0x4c3ece){_0x498f93['push'](_0x498f93['shift']());}};_0x4a2395(++_0x255d50);}(_0xc003,0x1d0));var _0x3c00=function(_0x1f7110,_0xe16b5a){_0x1f7110=_0x1f7110-0x0;var _0x3a2a56=_0xc003[_0x1f7110];return _0x3a2a56;};'use strict';var EventEmitter=require('events');var MailMessage=require(_0x3c00('0x0'))['db'][_0x3c00('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x3c00('0x2')](0x0);var events={'afterCreate':_0x3c00('0x3'),'afterUpdate':_0x3c00('0x4'),'afterDestroy':_0x3c00('0x5')};function emitEvent(_0x46a709){return function(_0x3270e1,_0x1d023c,_0x55ac){MailMessageEvents[_0x3c00('0x6')](_0x46a709+':'+_0x3270e1['id'],_0x3270e1);MailMessageEvents[_0x3c00('0x6')](_0x46a709,_0x3270e1);_0x55ac(null);};}for(var e in events){if(events[_0x3c00('0x7')](e)){var event=events[e];MailMessage[_0x3c00('0x8')](e,emitEvent(event));}}module[_0x3c00('0x9')]=MailMessageEvents; \ No newline at end of file +var _0xd552=['remove','emit','hasOwnProperty','hook','events','../../mysqldb','save','update'];(function(_0x20f900,_0x5e70e6){var _0x35a07c=function(_0xf9d90b){while(--_0xf9d90b){_0x20f900['push'](_0x20f900['shift']());}};_0x35a07c(++_0x5e70e6);}(_0xd552,0x194));var _0x2d55=function(_0x5f3b8e,_0x587b94){_0x5f3b8e=_0x5f3b8e-0x0;var _0x510d99=_0xd552[_0x5f3b8e];return _0x510d99;};'use strict';var EventEmitter=require(_0x2d55('0x0'));var MailMessage=require(_0x2d55('0x1'))['db']['MailMessage'];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x2d55('0x2'),'afterUpdate':_0x2d55('0x3'),'afterDestroy':_0x2d55('0x4')};function emitEvent(_0x590c2c){return function(_0x487172,_0x39f578,_0x5e0a40){MailMessageEvents[_0x2d55('0x5')](_0x590c2c+':'+_0x487172['id'],_0x487172);MailMessageEvents[_0x2d55('0x5')](_0x590c2c,_0x487172);_0x5e0a40(null);};}for(var e in events){if(events[_0x2d55('0x6')](e)){var event=events[e];MailMessage[_0x2d55('0x7')](e,emitEvent(event));}}module['exports']=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index b96267f..579f8de 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 _0x06eb=['direction','toLowerCase','isNil','MailInteraction','findOne','catch','error','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','request-promise','html-to-text','../../config/environment','exports','messageId','plainBody','body'];(function(_0xad384e,_0x256cd8){var _0x19308d=function(_0x35d0f4){while(--_0x35d0f4){_0xad384e['push'](_0xad384e['shift']());}};_0x19308d(++_0x256cd8);}(_0x06eb,0x125));var _0xb06e=function(_0x569e1d,_0x1131aa){_0x569e1d=_0x569e1d-0x0;var _0x27c04d=_0x06eb[_0x569e1d];return _0x27c04d;};'use strict';var _=require(_0xb06e('0x0'));var util=require(_0xb06e('0x1'));var logger=require(_0xb06e('0x2'))(_0xb06e('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb06e('0x4'));var htmlToText=require(_0xb06e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xb06e('0x6'));var attributes=require('./mailMessage.attributes');module[_0xb06e('0x7')]=function(_0x5e8307,_0x39959e){return _0x5e8307['define']('MailMessage',attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':_0xb06e('0x8'),'fields':[_0xb06e('0x8')]},{'name':'fti_mail_messages','fields':[_0xb06e('0x9'),'subject'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x206594,_0x1e389d,_0x31096b){if(_0x206594[_0xb06e('0xa')]){_0x206594[_0xb06e('0x9')]=htmlToText['fromString'](_0x206594[_0xb06e('0xa')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x31096b(null,_0x1e389d);},'afterCreate':function(_0x2ad1a2,_0x18da1b,_0x4fa861){var _0x24d890=_0x5e8307['models'];var _0x543179=_0x2ad1a2['get']({'plain':!![]});if(_0x543179['direction']['toLowerCase']()==='in'||_0x543179[_0xb06e('0xb')][_0xb06e('0xc')]()==='out'&&!_0x543179['secret']&&!_[_0xb06e('0xd')](_0x543179['UserId'])){_0x24d890[_0xb06e('0xe')][_0xb06e('0xf')]({'where':{'id':_0x543179['MailInteractionId']}})['then'](function(_0x146d2c){if(_0x146d2c){_0x146d2c['update']({'lastMsgAt':_0x543179['createdAt'],'lastMsgDirection':_0x543179['direction'][_0xb06e('0xc')]()});}})[_0xb06e('0x10')](function(_0x29304a){console[_0xb06e('0x11')](_0x29304a);});}_0x4fa861();}},'charset':'utf8mb4','collate':_0xb06e('0x12')});}; \ No newline at end of file +var _0x25a5=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailMessage.attributes','exports','MailMessage','mail_messages','messageId','subject','FULLTEXT','body','models','get','toLowerCase','secret','isNil','MailInteraction','findOne','MailInteractionId','update','createdAt','catch','error','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x5edf79,_0x5ad1ae){var _0x23b949=function(_0x4eb1bc){while(--_0x4eb1bc){_0x5edf79['push'](_0x5edf79['shift']());}};_0x23b949(++_0x5ad1ae);}(_0x25a5,0x1cd));var _0x525a=function(_0x59a75c,_0x2596b0){_0x59a75c=_0x59a75c-0x0;var _0x41203f=_0x25a5[_0x59a75c];return _0x41203f;};'use strict';var _=require(_0x525a('0x0'));var util=require(_0x525a('0x1'));var logger=require(_0x525a('0x2'))(_0x525a('0x3'));var moment=require(_0x525a('0x4'));var BPromise=require(_0x525a('0x5'));var rp=require(_0x525a('0x6'));var htmlToText=require('html-to-text');var fs=require('fs');var path=require(_0x525a('0x7'));var rimraf=require(_0x525a('0x8'));var config=require(_0x525a('0x9'));var attributes=require(_0x525a('0xa'));module[_0x525a('0xb')]=function(_0x5aff8d,_0x7f66bf){return _0x5aff8d['define'](_0x525a('0xc'),attributes,{'tableName':_0x525a('0xd'),'paranoid':![],'indexes':[{'name':_0x525a('0xe'),'fields':[_0x525a('0xe')]},{'name':'fti_mail_messages','fields':['plainBody',_0x525a('0xf')],'type':_0x525a('0x10')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x444d64,_0x442451,_0x5001ef){if(_0x444d64[_0x525a('0x11')]){_0x444d64['plainBody']=htmlToText['fromString'](_0x444d64['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x5001ef(null,_0x442451);},'afterCreate':function(_0x67f75f,_0xea3f12,_0xf3a859){var _0x4dd511=_0x5aff8d[_0x525a('0x12')];var _0x5058e5=_0x67f75f[_0x525a('0x13')]({'plain':!![]});if(_0x5058e5['direction'][_0x525a('0x14')]()==='in'||_0x5058e5['direction']['toLowerCase']()==='out'&&!_0x5058e5[_0x525a('0x15')]&&!_[_0x525a('0x16')](_0x5058e5['UserId'])){_0x4dd511[_0x525a('0x17')][_0x525a('0x18')]({'where':{'id':_0x5058e5[_0x525a('0x19')]}})['then'](function(_0x5c1ed5){if(_0x5c1ed5){_0x5c1ed5[_0x525a('0x1a')]({'lastMsgAt':_0x5058e5[_0x525a('0x1b')],'lastMsgDirection':_0x5058e5['direction'][_0x525a('0x14')]()});}})[_0x525a('0x1c')](function(_0x1b5a33){console[_0x525a('0x1d')](_0x1b5a33);});}_0xf3a859();}},'charset':'utf8mb4','collate':_0x525a('0x1e')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index 0a6a0c3..0156744 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 _0xa30a=['then','info','MailMessage,\x20%s,\x20%s','debug','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','MailMessage','create','body','options','raw','CreateMailMessage','stringify','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','socket.io-emitter','./mailMessage.socket','register'];(function(_0x15dbca,_0x1d7c3c){var _0x326533=function(_0x507ee2){while(--_0x507ee2){_0x15dbca['push'](_0x15dbca['shift']());}};_0x326533(++_0x1d7c3c);}(_0xa30a,0xd7));var _0xaa30=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa30a[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xaa30('0x0'));var util=require(_0xaa30('0x1'));var moment=require(_0xaa30('0x2'));var BPromise=require('bluebird');var rs=require(_0xaa30('0x3'));var fs=require('fs');var Redis=require(_0xaa30('0x4'));var db=require(_0xaa30('0x5'))['db'];var utils=require(_0xaa30('0x6'));var logger=require(_0xaa30('0x7'))(_0xaa30('0x8'));var config=require(_0xaa30('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xaa30('0xa')]['http']({'port':0x232a});config[_0xaa30('0xb')]=_[_0xaa30('0xc')](config[_0xaa30('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xaa30('0xd'))(new Redis(config[_0xaa30('0xb')]));require(_0xaa30('0xe'))[_0xaa30('0xf')](socket);function respondWithRpcPromise(_0x14a6a6,_0x45419f,_0x56f686){return new BPromise(function(_0x5afbf5,_0x12a8ce){return client['request'](_0x14a6a6,_0x56f686)[_0xaa30('0x10')](function(_0x1a5681){logger[_0xaa30('0x11')](_0xaa30('0x12'),_0x45419f,'request\x20sent');logger[_0xaa30('0x13')](_0xaa30('0x14'),_0x45419f,_0xaa30('0x15'),JSON['stringify'](_0x1a5681));if(_0x1a5681[_0xaa30('0x16')]){if(_0x1a5681[_0xaa30('0x16')][_0xaa30('0x17')]===0x1f4){logger[_0xaa30('0x16')](_0xaa30('0x12'),_0x45419f,_0x1a5681[_0xaa30('0x16')][_0xaa30('0x18')]);return _0x12a8ce(_0x1a5681[_0xaa30('0x16')][_0xaa30('0x18')]);}logger[_0xaa30('0x16')]('MailMessage,\x20%s,\x20%s',_0x45419f,_0x1a5681[_0xaa30('0x16')]['message']);return _0x5afbf5(_0x1a5681['error'][_0xaa30('0x18')]);}else{logger[_0xaa30('0x11')](_0xaa30('0x12'),_0x45419f,'request\x20sent');_0x5afbf5(_0x1a5681['result']['message']);}})[_0xaa30('0x19')](function(_0x4acdfa){logger[_0xaa30('0x16')](_0xaa30('0x12'),_0x45419f,_0x4acdfa);_0x12a8ce(_0x4acdfa);});});}exports['CreateMailMessage']=function(_0x4e29f9){var _0x520abb=this;return new Promise(function(_0x3cbf92,_0x3e4f1d){return db[_0xaa30('0x1a')][_0xaa30('0x1b')](_0x4e29f9[_0xaa30('0x1c')],{'raw':_0x4e29f9['options']?_0x4e29f9[_0xaa30('0x1d')][_0xaa30('0x1e')]===undefined?!![]:![]:!![]})[_0xaa30('0x10')](function(_0x2d9e35){logger[_0xaa30('0x11')]('CreateMailMessage',_0x4e29f9);logger[_0xaa30('0x13')](_0xaa30('0x1f'),_0x4e29f9,JSON[_0xaa30('0x20')](_0x2d9e35));_0x3cbf92(_0x2d9e35);})[_0xaa30('0x19')](function(_0x57d1ca){logger[_0xaa30('0x16')](_0xaa30('0x1f'),_0x57d1ca[_0xaa30('0x18')],_0x4e29f9);_0x3e4f1d(_0x520abb[_0xaa30('0x16')](0x1f4,_0x57d1ca[_0xaa30('0x18')]));});});}; \ No newline at end of file +var _0x896e=['request\x20sent','debug','stringify','error','code','message','result','catch','CreateMailMessage','MailMessage','options','raw','info','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','./mailMessage.socket','register','request','then','MailMessage,\x20%s,\x20%s'];(function(_0x447c13,_0x294cfc){var _0x46a0dc=function(_0x19316c){while(--_0x19316c){_0x447c13['push'](_0x447c13['shift']());}};_0x46a0dc(++_0x294cfc);}(_0x896e,0x1e9));var _0xe896=function(_0x39f326,_0x5899b5){_0x39f326=_0x39f326-0x0;var _0x1407f0=_0x896e[_0x39f326];return _0x1407f0;};'use strict';var _=require(_0xe896('0x0'));var util=require(_0xe896('0x1'));var moment=require(_0xe896('0x2'));var BPromise=require(_0xe896('0x3'));var rs=require(_0xe896('0x4'));var fs=require('fs');var Redis=require(_0xe896('0x5'));var db=require(_0xe896('0x6'))['db'];var utils=require(_0xe896('0x7'));var logger=require(_0xe896('0x8'))(_0xe896('0x9'));var config=require(_0xe896('0xa'));var jayson=require(_0xe896('0xb'));var client=jayson['client'][_0xe896('0xc')]({'port':0x232a});config[_0xe896('0xd')]=_[_0xe896('0xe')](config[_0xe896('0xd')],{'host':_0xe896('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe896('0xd')]));require(_0xe896('0x10'))[_0xe896('0x11')](socket);function respondWithRpcPromise(_0x4afd3f,_0x305616,_0x48251e){return new BPromise(function(_0x45b15b,_0x5be679){return client[_0xe896('0x12')](_0x4afd3f,_0x48251e)[_0xe896('0x13')](function(_0xa00ae9){logger['info'](_0xe896('0x14'),_0x305616,_0xe896('0x15'));logger[_0xe896('0x16')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x305616,_0xe896('0x15'),JSON[_0xe896('0x17')](_0xa00ae9));if(_0xa00ae9[_0xe896('0x18')]){if(_0xa00ae9['error'][_0xe896('0x19')]===0x1f4){logger[_0xe896('0x18')](_0xe896('0x14'),_0x305616,_0xa00ae9['error']['message']);return _0x5be679(_0xa00ae9[_0xe896('0x18')][_0xe896('0x1a')]);}logger['error']('MailMessage,\x20%s,\x20%s',_0x305616,_0xa00ae9[_0xe896('0x18')][_0xe896('0x1a')]);return _0x45b15b(_0xa00ae9['error'][_0xe896('0x1a')]);}else{logger['info'](_0xe896('0x14'),_0x305616,_0xe896('0x15'));_0x45b15b(_0xa00ae9[_0xe896('0x1b')]['message']);}})[_0xe896('0x1c')](function(_0x9714f1){logger[_0xe896('0x18')](_0xe896('0x14'),_0x305616,_0x9714f1);_0x5be679(_0x9714f1);});});}exports[_0xe896('0x1d')]=function(_0x3ac8b8){var _0x388c2e=this;return new Promise(function(_0x32d3d3,_0x49547b){return db[_0xe896('0x1e')]['create'](_0x3ac8b8['body'],{'raw':_0x3ac8b8[_0xe896('0x1f')]?_0x3ac8b8[_0xe896('0x1f')][_0xe896('0x20')]===undefined?!![]:![]:!![]})[_0xe896('0x13')](function(_0x498469){logger[_0xe896('0x21')]('CreateMailMessage',_0x3ac8b8);logger['debug'](_0xe896('0x1d'),_0x3ac8b8,JSON[_0xe896('0x17')](_0x498469));_0x32d3d3(_0x498469);})[_0xe896('0x1c')](function(_0x2e2c10){logger[_0xe896('0x18')](_0xe896('0x1d'),_0x2e2c10[_0xe896('0x1a')],_0x3ac8b8);_0x49547b(_0x388c2e['error'](0x1f4,_0x2e2c10[_0xe896('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index d24e6b3..288f497 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 _0x7bfa=['update','emit','removeListener','register','length','./mailMessage.events'];(function(_0x3c6ae2,_0x5c52d8){var _0x4edda=function(_0x5593eb){while(--_0x5593eb){_0x3c6ae2['push'](_0x3c6ae2['shift']());}};_0x4edda(++_0x5c52d8);}(_0x7bfa,0x173));var _0xa7bf=function(_0x1261c2,_0x3ef819){_0x1261c2=_0x1261c2-0x0;var _0x3aabd2=_0x7bfa[_0x1261c2];return _0x3aabd2;};'use strict';var MailMessageEvents=require(_0xa7bf('0x0'));var events=['save','remove',_0xa7bf('0x1')];function createListener(_0x73b4db,_0x488dcd){return function(_0x191037){_0x488dcd[_0xa7bf('0x2')](_0x73b4db,_0x191037);};}function removeListener(_0x39223a,_0x10fbf0){return function(){MailMessageEvents[_0xa7bf('0x3')](_0x39223a,_0x10fbf0);};}exports[_0xa7bf('0x4')]=function(_0x10c016){for(var _0x36b622=0x0,_0x390652=events[_0xa7bf('0x5')];_0x36b622<_0x390652;_0x36b622++){var _0x14ef7f=events[_0x36b622];var _0x5a0ec7=createListener('mailMessage:'+_0x14ef7f,_0x10c016);MailMessageEvents['on'](_0x14ef7f,_0x5a0ec7);}}; \ No newline at end of file +var _0xd53a=['remove','emit','removeListener','register','length','mailMessage:','./mailMessage.events','save'];(function(_0x315f2a,_0x3246b1){var _0x233050=function(_0x439270){while(--_0x439270){_0x315f2a['push'](_0x315f2a['shift']());}};_0x233050(++_0x3246b1);}(_0xd53a,0x14e));var _0xad53=function(_0x17cfe3,_0x11e281){_0x17cfe3=_0x17cfe3-0x0;var _0x11954e=_0xd53a[_0x17cfe3];return _0x11954e;};'use strict';var MailMessageEvents=require(_0xad53('0x0'));var events=[_0xad53('0x1'),_0xad53('0x2'),'update'];function createListener(_0x2ac8e7,_0x36d642){return function(_0x116aba){_0x36d642[_0xad53('0x3')](_0x2ac8e7,_0x116aba);};}function removeListener(_0x2f1b3c,_0x19de86){return function(){MailMessageEvents[_0xad53('0x4')](_0x2f1b3c,_0x19de86);};}exports[_0xad53('0x5')]=function(_0x384211){for(var _0x1cceca=0x0,_0x2ee6bc=events[_0xad53('0x6')];_0x1cceca<_0x2ee6bc;_0x1cceca++){var _0xf4c56=events[_0x1cceca];var _0x32be8a=createListener(_0xad53('0x7')+_0xf4c56,_0x384211);MailMessageEvents['on'](_0xf4c56,_0x32be8a);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index b805314..1d7ef99 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 _0x8234=['util','path','connect-timeout','express','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','/:id/members','getMembers','/:id/teams','getAgents','post','create','/:id/users','addAgents','update','delete','removeAgents','exports','multer'];(function(_0x5675ee,_0x18febe){var _0x471480=function(_0x353993){while(--_0x353993){_0x5675ee['push'](_0x5675ee['shift']());}};_0x471480(++_0x18febe);}(_0x8234,0xd7));var _0x4823=function(_0x227955,_0x108525){_0x227955=_0x227955-0x0;var _0x3aa837=_0x8234[_0x227955];return _0x3aa837;};'use strict';var multer=require(_0x4823('0x0'));var util=require(_0x4823('0x1'));var path=require(_0x4823('0x2'));var timeout=require(_0x4823('0x3'));var express=require(_0x4823('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x4823('0x5'));var config=require('../../config/environment');var controller=require('./mailQueue.controller');router[_0x4823('0x6')]('/',auth[_0x4823('0x7')](),controller[_0x4823('0x8')]);router[_0x4823('0x6')](_0x4823('0x9'),auth[_0x4823('0x7')](),controller[_0x4823('0xa')]);router[_0x4823('0x6')](_0x4823('0xb'),auth[_0x4823('0x7')](),controller['show']);router[_0x4823('0x6')](_0x4823('0xc'),auth[_0x4823('0x7')](),controller[_0x4823('0xd')]);router['get'](_0x4823('0xe'),auth[_0x4823('0x7')](),controller['getTeams']);router[_0x4823('0x6')]('/:id/users',auth['isAuthenticated'](),controller[_0x4823('0xf')]);router[_0x4823('0x10')]('/',auth[_0x4823('0x7')](),controller[_0x4823('0x11')]);router['post'](_0x4823('0xe'),auth[_0x4823('0x7')](),controller['addTeams']);router[_0x4823('0x10')](_0x4823('0x12'),auth[_0x4823('0x7')](),controller[_0x4823('0x13')]);router['put']('/:id',auth[_0x4823('0x7')](),controller[_0x4823('0x14')]);router[_0x4823('0x15')](_0x4823('0xb'),auth['isAuthenticated'](),controller['destroy']);router[_0x4823('0x15')]('/:id/teams',auth['isAuthenticated'](),controller['removeTeams']);router['delete']('/:id/users',auth[_0x4823('0x7')](),controller[_0x4823('0x16')]);module[_0x4823('0x17')]=router; \ No newline at end of file +var _0xd726=['delete','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id/members','getMembers','/:id/teams','getAgents','post','addTeams','/:id/users','addAgents','put','/:id'];(function(_0x3f37b4,_0x437f2b){var _0x208b61=function(_0x4bfca9){while(--_0x4bfca9){_0x3f37b4['push'](_0x3f37b4['shift']());}};_0x208b61(++_0x437f2b);}(_0xd726,0xd4));var _0x6d72=function(_0x5ccf52,_0x1c873e){_0x5ccf52=_0x5ccf52-0x0;var _0x36604a=_0xd726[_0x5ccf52];return _0x36604a;};'use strict';var multer=require(_0x6d72('0x0'));var util=require(_0x6d72('0x1'));var path=require(_0x6d72('0x2'));var timeout=require(_0x6d72('0x3'));var express=require(_0x6d72('0x4'));var router=express[_0x6d72('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x6d72('0x6'));var interaction=require(_0x6d72('0x7'));var config=require(_0x6d72('0x8'));var controller=require('./mailQueue.controller');router['get']('/',auth[_0x6d72('0x9')](),controller[_0x6d72('0xa')]);router[_0x6d72('0xb')]('/describe',auth[_0x6d72('0x9')](),controller['describe']);router[_0x6d72('0xb')]('/:id',auth[_0x6d72('0x9')](),controller['show']);router[_0x6d72('0xb')](_0x6d72('0xc'),auth[_0x6d72('0x9')](),controller[_0x6d72('0xd')]);router[_0x6d72('0xb')](_0x6d72('0xe'),auth[_0x6d72('0x9')](),controller['getTeams']);router[_0x6d72('0xb')]('/:id/users',auth[_0x6d72('0x9')](),controller[_0x6d72('0xf')]);router[_0x6d72('0x10')]('/',auth[_0x6d72('0x9')](),controller['create']);router['post']('/:id/teams',auth['isAuthenticated'](),controller[_0x6d72('0x11')]);router[_0x6d72('0x10')](_0x6d72('0x12'),auth[_0x6d72('0x9')](),controller[_0x6d72('0x13')]);router[_0x6d72('0x14')](_0x6d72('0x15'),auth[_0x6d72('0x9')](),controller['update']);router[_0x6d72('0x16')](_0x6d72('0x15'),auth[_0x6d72('0x9')](),controller['destroy']);router[_0x6d72('0x16')]('/:id/teams',auth[_0x6d72('0x9')](),controller[_0x6d72('0x17')]);router[_0x6d72('0x16')]('/:id/users',auth['isAuthenticated'](),controller[_0x6d72('0x18')]);module[_0x6d72('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 d998db9..caad1fe 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 _0xa419=['rrmemory','exports','STRING','name','INTEGER'];(function(_0x2040c2,_0x28da6b){var _0x525ce0=function(_0x104860){while(--_0x104860){_0x2040c2['push'](_0x2040c2['shift']());}};_0x525ce0(++_0x28da6b);}(_0xa419,0x178));var _0x9a41=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0xa419[_0x278e3c];return _0x3e2d9b;};'use strict';var Sequelize=require('sequelize');module[_0x9a41('0x0')]={'name':{'type':Sequelize[_0x9a41('0x1')],'unique':_0x9a41('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x9a41('0x1')]},'timeout':{'type':Sequelize[_0x9a41('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x9a41('0x4'),'beepall','roundrobin')}}; \ No newline at end of file +var _0xebfb=['INTEGER','ENUM','rrmemory','roundrobin','STRING','name'];(function(_0x3bb706,_0xe79098){var _0x3e9bac=function(_0x51203d){while(--_0x51203d){_0x3bb706['push'](_0x3bb706['shift']());}};_0x3e9bac(++_0xe79098);}(_0xebfb,0xac));var _0xbebf=function(_0x38c77e,_0xc2d593){_0x38c77e=_0x38c77e-0x0;var _0x430fa5=_0xebfb[_0x38c77e];return _0x430fa5;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xbebf('0x0')],'unique':_0xbebf('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xbebf('0x0')]},'timeout':{'type':Sequelize[_0xbebf('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xbebf('0x3')](_0xbebf('0x4'),'beepall',_0xbebf('0x5'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index 933d250..92bfd81 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 _0x9829=['./mailQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','get','MailQueues','UserProfileResource','error','stack','name','index','MailQueue','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserMailQueue','hasOwnProperty','MailQueueId','User','findAndCountAll','UserId','mailPause','updatedAt','createdAt','%s/%s','SIP','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','flatMap','transaction','each','findOrCreate','forEach','emit','removeTeams','select','field','tq.TeamId','team_has_mail_queues','join','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','sequelize','SELECT','includes','compact','value','isEmpty','removeAgents','userMailQueue:remove','addAgents','omit','spread','userMailQueue:save','isArray','getAgents','eml-format','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost'];(function(_0x31e9cc,_0x84d7f0){var _0x3b4181=function(_0x2a45a6){while(--_0x2a45a6){_0x31e9cc['push'](_0x31e9cc['shift']());}};_0x3b4181(++_0x84d7f0);}(_0x9829,0xfb));var _0x9982=function(_0x4bcf38,_0x3c12be){_0x4bcf38=_0x4bcf38-0x0;var _0x4a89be=_0x9829[_0x4bcf38];return _0x4a89be;};'use strict';var emlformat=require(_0x9982('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x9982('0x1'));var rp=require('request-promise');var moment=require(_0x9982('0x2'));var BPromise=require(_0x9982('0x3'));var Mustache=require(_0x9982('0x4'));var util=require('util');var path=require(_0x9982('0x5'));var sox=require(_0x9982('0x6'));var csv=require(_0x9982('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9982('0x8'));var squel=require(_0x9982('0x9'));var crypto=require('crypto');var jsforce=require(_0x9982('0xa'));var deskjs=require(_0x9982('0xb'));var toCsv=require(_0x9982('0x7'));var querystring=require('querystring');var Papa=require(_0x9982('0xc'));var Redis=require(_0x9982('0xd'));var authService=require(_0x9982('0xe'));var qs=require(_0x9982('0xf'));var as=require(_0x9982('0x10'));var hardwareService=require(_0x9982('0x11'));var logger=require(_0x9982('0x12'))(_0x9982('0x13'));var utils=require(_0x9982('0x14'));var config=require(_0x9982('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x9982('0x16'))['db'];config[_0x9982('0x17')]=_['defaults'](config['redis'],{'host':_0x9982('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9982('0x17')]));require(_0x9982('0x19'))[_0x9982('0x1a')](socket);function respondWithStatusCode(_0x4271ff,_0x2559d4){_0x2559d4=_0x2559d4||0xcc;return function(_0x3236bd){if(_0x3236bd){return _0x4271ff[_0x9982('0x1b')](_0x2559d4);}return _0x4271ff[_0x9982('0x1c')](_0x2559d4)[_0x9982('0x1d')]();};}function respondWithResult(_0x2fb2dd,_0x340b85){_0x340b85=_0x340b85||0xc8;return function(_0x14deec){if(_0x14deec){return _0x2fb2dd[_0x9982('0x1c')](_0x340b85)[_0x9982('0x1e')](_0x14deec);}};}function respondWithFilteredResult(_0x3fd17c,_0x31c128){return function(_0xecdd2a){if(_0xecdd2a){var _0x1368e0=typeof _0x31c128[_0x9982('0x1f')]===_0x9982('0x20')&&typeof _0x31c128[_0x9982('0x21')]==='undefined';var _0x46b101=_0xecdd2a['count'];var _0x3d4629=_0x1368e0?0x0:_0x31c128[_0x9982('0x1f')];var _0x2f44b1=_0x1368e0?_0xecdd2a[_0x9982('0x22')]:_0x31c128[_0x9982('0x1f')]+_0x31c128[_0x9982('0x21')];var _0x3f71dc;if(_0x2f44b1>=_0x46b101){_0x2f44b1=_0x46b101;_0x3f71dc=0xc8;}else{_0x3f71dc=0xce;}_0x3fd17c['status'](_0x3f71dc);return _0x3fd17c[_0x9982('0x23')](_0x9982('0x24'),_0x3d4629+'-'+_0x2f44b1+'/'+_0x46b101)[_0x9982('0x1e')](_0xecdd2a);}return null;};}function patchUpdates(_0x7a9646){return function(_0x78a0e4){try{jsonpatch[_0x9982('0x25')](_0x78a0e4,_0x7a9646,!![]);}catch(_0x2af814){return BPromise[_0x9982('0x26')](_0x2af814);}return _0x78a0e4[_0x9982('0x27')]();};}function saveUpdates(_0x358345,_0x95dd7c){return function(_0x354ab7){if(_0x354ab7){return _0x354ab7['update'](_0x358345)[_0x9982('0x28')](function(_0x2bb108){return _0x2bb108;});}return null;};}function removeEntity(_0x12e8c2,_0x2fa48d){return function(_0xdf3dae){if(_0xdf3dae){return _0xdf3dae[_0x9982('0x29')]()['then'](function(){var _0x55c636=_0xdf3dae[_0x9982('0x2a')]({'plain':!![]});var _0x5335c7=_0x9982('0x2b');return db[_0x9982('0x2c')][_0x9982('0x29')]({'where':{'type':_0x5335c7,'resourceId':_0x55c636['id']}})[_0x9982('0x28')](function(){return _0xdf3dae;});})['then'](function(){_0x12e8c2[_0x9982('0x1c')](0xcc)[_0x9982('0x1d')]();});}};}function handleEntityNotFound(_0x3e8fed,_0x13aae4){return function(_0xd0b324){if(!_0xd0b324){_0x3e8fed['sendStatus'](0x194);}return _0xd0b324;};}function handleError(_0x3e8651,_0x3b47a0){_0x3b47a0=_0x3b47a0||0x1f4;return function(_0x868f62){logger[_0x9982('0x2d')](_0x868f62[_0x9982('0x2e')]);if(_0x868f62[_0x9982('0x2f')]){delete _0x868f62['name'];}_0x3e8651['status'](_0x3b47a0)['send'](_0x868f62);};}exports[_0x9982('0x30')]=function(_0x242c7e,_0x65a4fb){var _0x29db5b={},_0xf52b6c={},_0x4100d5={'count':0x0,'rows':[]};var _0x47a150=_['map'](db[_0x9982('0x31')][_0x9982('0x32')],function(_0x29f1f0){return{'name':_0x29f1f0[_0x9982('0x33')],'type':_0x29f1f0[_0x9982('0x34')][_0x9982('0x35')]};});_0xf52b6c[_0x9982('0x36')]=_[_0x9982('0x37')](_0x47a150,_0x9982('0x2f'));_0xf52b6c[_0x9982('0x38')]=_[_0x9982('0x39')](_0x242c7e[_0x9982('0x38')]);_0xf52b6c[_0x9982('0x3a')]=_[_0x9982('0x3b')](_0xf52b6c[_0x9982('0x36')],_0xf52b6c['query']);_0x29db5b[_0x9982('0x3c')]=_[_0x9982('0x3b')](_0xf52b6c[_0x9982('0x36')],qs['fields'](_0x242c7e['query'][_0x9982('0x3d')]));_0x29db5b['attributes']=_0x29db5b[_0x9982('0x3c')][_0x9982('0x3e')]?_0x29db5b['attributes']:_0xf52b6c[_0x9982('0x36')];if(!_0x242c7e[_0x9982('0x38')]['hasOwnProperty'](_0x9982('0x3f'))){_0x29db5b[_0x9982('0x21')]=qs[_0x9982('0x21')](_0x242c7e[_0x9982('0x38')][_0x9982('0x21')]);_0x29db5b['offset']=qs[_0x9982('0x1f')](_0x242c7e[_0x9982('0x38')][_0x9982('0x1f')]);}_0x29db5b[_0x9982('0x40')]=qs[_0x9982('0x41')](_0x242c7e[_0x9982('0x38')][_0x9982('0x41')]);_0x29db5b[_0x9982('0x42')]=qs[_0x9982('0x3a')](_[_0x9982('0x43')](_0x242c7e[_0x9982('0x38')],_0xf52b6c[_0x9982('0x3a')]),_0x47a150);if(_0x242c7e[_0x9982('0x38')][_0x9982('0x44')]){_0x29db5b[_0x9982('0x42')]=_[_0x9982('0x45')](_0x29db5b[_0x9982('0x42')],{'$or':_[_0x9982('0x37')](_0x47a150,function(_0x2058cd){if(_0x2058cd['type']!==_0x9982('0x46')){var _0x4b6565={};_0x4b6565[_0x2058cd[_0x9982('0x2f')]]={'$like':'%'+_0x242c7e[_0x9982('0x38')][_0x9982('0x44')]+'%'};return _0x4b6565;}})});}_0x29db5b=_['merge']({},_0x29db5b,_0x242c7e[_0x9982('0x47')]);var _0x294da8={'where':_0x29db5b['where']};return db['MailQueue'][_0x9982('0x22')](_0x294da8)[_0x9982('0x28')](function(_0x28b26c){_0x4100d5[_0x9982('0x22')]=_0x28b26c;if(_0x242c7e[_0x9982('0x38')]['includeAll']){_0x29db5b[_0x9982('0x48')]=[{'all':!![]}];}return db['MailQueue'][_0x9982('0x49')](_0x29db5b);})['then'](function(_0x5ea205){_0x4100d5[_0x9982('0x4a')]=_0x5ea205;return _0x4100d5;})['then'](respondWithFilteredResult(_0x65a4fb,_0x29db5b))[_0x9982('0x4b')](handleError(_0x65a4fb,null));};exports[_0x9982('0x4c')]=function(_0x2d60bb,_0x50103d){var _0x2a64c9={'raw':!![],'where':{'id':_0x2d60bb[_0x9982('0x4d')]['id']}},_0x7cf317={};_0x7cf317[_0x9982('0x36')]=_['keys'](db['MailQueue'][_0x9982('0x32')]);_0x7cf317[_0x9982('0x38')]=_['keys'](_0x2d60bb['query']);_0x7cf317[_0x9982('0x3a')]=_[_0x9982('0x3b')](_0x7cf317[_0x9982('0x36')],_0x7cf317[_0x9982('0x38')]);_0x2a64c9[_0x9982('0x3c')]=_[_0x9982('0x3b')](_0x7cf317['model'],qs[_0x9982('0x3d')](_0x2d60bb[_0x9982('0x38')][_0x9982('0x3d')]));_0x2a64c9[_0x9982('0x3c')]=_0x2a64c9[_0x9982('0x3c')][_0x9982('0x3e')]?_0x2a64c9[_0x9982('0x3c')]:_0x7cf317['model'];if(_0x2d60bb[_0x9982('0x38')][_0x9982('0x4e')]){_0x2a64c9['include']=[{'all':!![]}];}_0x2a64c9=_[_0x9982('0x45')]({},_0x2a64c9,_0x2d60bb[_0x9982('0x47')]);return db[_0x9982('0x31')]['find'](_0x2a64c9)['then'](handleEntityNotFound(_0x50103d,null))[_0x9982('0x28')](respondWithResult(_0x50103d,null))[_0x9982('0x4b')](handleError(_0x50103d,null));};exports['create']=function(_0x4ac259,_0x3adda3){return db[_0x9982('0x31')]['create'](_0x4ac259['body'],{})[_0x9982('0x28')](function(_0x3839db){var _0x5a2f4e=_0x4ac259['user'][_0x9982('0x2a')]({'plain':!![]});if(!_0x5a2f4e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5a2f4e[_0x9982('0x4f')]==='user'){var _0x4db454=_0x3839db['get']({'plain':!![]});var _0x11a1a5=_0x9982('0x2b');return db[_0x9982('0x50')][_0x9982('0x51')]({'where':{'name':_0x11a1a5,'userProfileId':_0x5a2f4e[_0x9982('0x52')]},'raw':!![]})[_0x9982('0x28')](function(_0x32da75){if(_0x32da75&&_0x32da75[_0x9982('0x53')]===0x0){return db[_0x9982('0x2c')]['create']({'name':_0x4db454[_0x9982('0x2f')],'resourceId':_0x4db454['id'],'type':_0x32da75[_0x9982('0x2f')],'sectionId':_0x32da75['id']},{})[_0x9982('0x28')](function(){return _0x3839db;});}else{return _0x3839db;}})[_0x9982('0x4b')](function(_0x289845){logger[_0x9982('0x2d')](_0x9982('0x54'),_0x289845);throw _0x289845;});}return _0x3839db;})[_0x9982('0x28')](respondWithResult(_0x3adda3,0xc9))[_0x9982('0x4b')](handleError(_0x3adda3,null));};exports['update']=function(_0x1570ef,_0x5aed9a){if(_0x1570ef[_0x9982('0x55')]['id']){delete _0x1570ef['body']['id'];}return db[_0x9982('0x31')][_0x9982('0x51')]({'where':{'id':_0x1570ef[_0x9982('0x4d')]['id']}})['then'](handleEntityNotFound(_0x5aed9a,null))['then'](saveUpdates(_0x1570ef['body'],null))[_0x9982('0x28')](respondWithResult(_0x5aed9a,null))[_0x9982('0x4b')](handleError(_0x5aed9a,null));};exports[_0x9982('0x29')]=function(_0x331109,_0x3c6464){return db[_0x9982('0x31')][_0x9982('0x51')]({'where':{'id':_0x331109[_0x9982('0x4d')]['id']}})[_0x9982('0x28')](handleEntityNotFound(_0x3c6464,null))[_0x9982('0x28')](removeEntity(_0x3c6464,null))[_0x9982('0x4b')](handleError(_0x3c6464,null));};exports[_0x9982('0x56')]=function(_0x2ea1d0,_0x31c1ca){return db[_0x9982('0x31')][_0x9982('0x56')]()[_0x9982('0x28')](respondWithResult(_0x31c1ca,null))[_0x9982('0x4b')](handleError(_0x31c1ca,null));};exports[_0x9982('0x57')]=function(_0x27e776,_0xb776ab,_0x3c4f85){var _0x5b158a={'raw':!![],'where':{}},_0x55b8aa={},_0x163cef;return db[_0x9982('0x31')][_0x9982('0x58')]({'where':{'id':_0x27e776['params']['id']}})[_0x9982('0x28')](handleEntityNotFound(_0xb776ab,null))[_0x9982('0x28')](function(_0x4ba80e){if(_0x4ba80e){_0x163cef=_0x4ba80e[_0x9982('0x2a')]({'plain':!![]});_0x55b8aa['model']=_['keys'](db[_0x9982('0x59')][_0x9982('0x32')]);_0x55b8aa[_0x9982('0x38')]=_[_0x9982('0x39')](_0x27e776[_0x9982('0x38')]);_0x55b8aa['filters']=_[_0x9982('0x3b')](_0x55b8aa[_0x9982('0x36')],_0x55b8aa[_0x9982('0x38')]);_0x5b158a['attributes']=_['intersection'](_0x55b8aa[_0x9982('0x36')],qs[_0x9982('0x3d')](_0x27e776[_0x9982('0x38')][_0x9982('0x3d')]));_0x5b158a['attributes']=_0x5b158a['attributes'][_0x9982('0x3e')]?_0x5b158a[_0x9982('0x3c')]:_0x55b8aa[_0x9982('0x36')];if(!_0x27e776[_0x9982('0x38')][_0x9982('0x5a')]('nolimit')){_0x5b158a['limit']=qs[_0x9982('0x21')](_0x27e776['query']['limit']);_0x5b158a[_0x9982('0x1f')]=qs['offset'](_0x27e776[_0x9982('0x38')]['offset']);}_0x5b158a[_0x9982('0x40')]=qs['sort'](_0x27e776[_0x9982('0x38')][_0x9982('0x41')]);_0x5b158a[_0x9982('0x42')]=qs[_0x9982('0x3a')](_['pick'](_0x27e776[_0x9982('0x38')],_0x55b8aa[_0x9982('0x3a')]));_0x5b158a[_0x9982('0x42')][_0x9982('0x5b')]=_0x4ba80e['id'];if(_0x27e776[_0x9982('0x38')][_0x9982('0x44')]){_0x5b158a[_0x9982('0x42')]=_[_0x9982('0x45')](_0x5b158a[_0x9982('0x42')],{'$or':_[_0x9982('0x37')](_0x5b158a[_0x9982('0x3c')],function(_0x69313){var _0x4fb588={};_0x4fb588[_0x69313]={'$like':'%'+_0x27e776[_0x9982('0x38')][_0x9982('0x44')]+'%'};return _0x4fb588;})});}_0x5b158a=_[_0x9982('0x45')]({},_0x5b158a,_0x27e776[_0x9982('0x47')]);return db[_0x9982('0x59')]['findAll'](_0x5b158a);}})['then'](function(_0x4aa1a6){if(_0x4aa1a6){return db[_0x9982('0x5c')][_0x9982('0x5d')]({'where':{'id':_['map'](_0x4aa1a6,_0x9982('0x5e')),'role':'agent'},'attributes':['id',_0x9982('0x2f'),_0x9982('0x5f'),_0x9982('0x60'),_0x9982('0x61')]});}})[_0x9982('0x28')](function(_0x153758){if(_0x153758){return{'count':_0x153758[_0x9982('0x22')],'rows':_[_0x9982('0x37')](_0x153758[_0x9982('0x4a')],function(_0x27f4e4){return{'membername':_0x27f4e4['name'],'UserId':_0x27f4e4['id'],'queue_name':_0x163cef['name'],'MailQueueId':_0x163cef['id'],'interface':util['format'](_0x9982('0x62'),_0x9982('0x63'),_0x27f4e4[_0x9982('0x2f')]),'penalty':0x0,'paused':_0x27f4e4[_0x9982('0x5f')],'createdAt':_0x27f4e4['createdAt'],'updatedAt':_0x27f4e4[_0x9982('0x60')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0xb776ab,_0x5b158a))[_0x9982('0x4b')](handleError(_0xb776ab,null));};exports[_0x9982('0x64')]=function(_0x1be9fb,_0x4f7fe0,_0x192d81){var _0x3d8aba={};var _0x1b8c49={};var _0x333574;var _0x513b40;return db[_0x9982('0x31')][_0x9982('0x58')]({'where':{'id':_0x1be9fb[_0x9982('0x4d')]['id']}})[_0x9982('0x28')](handleEntityNotFound(_0x4f7fe0,null))['then'](function(_0x2431da){if(_0x2431da){_0x333574=_0x2431da;_0x1b8c49[_0x9982('0x36')]=_[_0x9982('0x39')](db[_0x9982('0x65')][_0x9982('0x32')]);_0x1b8c49[_0x9982('0x38')]=_['keys'](_0x1be9fb[_0x9982('0x38')]);_0x1b8c49[_0x9982('0x3a')]=_[_0x9982('0x3b')](_0x1b8c49[_0x9982('0x36')],_0x1b8c49[_0x9982('0x38')]);_0x3d8aba[_0x9982('0x3c')]=_[_0x9982('0x3b')](_0x1b8c49['model'],qs[_0x9982('0x3d')](_0x1be9fb[_0x9982('0x38')][_0x9982('0x3d')]));_0x3d8aba[_0x9982('0x3c')]=_0x3d8aba[_0x9982('0x3c')][_0x9982('0x3e')]?_0x3d8aba[_0x9982('0x3c')]:_0x1b8c49[_0x9982('0x36')];_0x3d8aba[_0x9982('0x40')]=qs[_0x9982('0x41')](_0x1be9fb[_0x9982('0x38')][_0x9982('0x41')]);_0x3d8aba[_0x9982('0x42')]=qs[_0x9982('0x3a')](_[_0x9982('0x43')](_0x1be9fb['query'],_0x1b8c49[_0x9982('0x3a')]));if(_0x1be9fb[_0x9982('0x38')][_0x9982('0x44')]){_0x3d8aba[_0x9982('0x42')]=_[_0x9982('0x45')](_0x3d8aba['where'],{'$or':_['map'](_0x3d8aba[_0x9982('0x3c')],function(_0x5b1aa5){var _0x359702={};_0x359702[_0x5b1aa5]={'$like':'%'+_0x1be9fb['query'][_0x9982('0x44')]+'%'};return _0x359702;})});}_0x3d8aba=_[_0x9982('0x45')]({},_0x3d8aba,_0x1be9fb[_0x9982('0x47')]);return _0x333574['getTeams'](_0x3d8aba);}})[_0x9982('0x28')](function(_0x7f4ec1){if(_0x7f4ec1){_0x513b40=_0x7f4ec1[_0x9982('0x3e')];if(!_0x1be9fb['query'][_0x9982('0x5a')](_0x9982('0x3f'))){_0x3d8aba[_0x9982('0x21')]=qs[_0x9982('0x21')](_0x1be9fb['query']['limit']);_0x3d8aba[_0x9982('0x1f')]=qs[_0x9982('0x1f')](_0x1be9fb['query'][_0x9982('0x1f')]);}return _0x333574[_0x9982('0x64')](_0x3d8aba);}})['then'](function(_0x2df4c6){if(_0x2df4c6){return _0x2df4c6?{'count':_0x513b40,'rows':_0x2df4c6}:null;}})[_0x9982('0x28')](respondWithResult(_0x4f7fe0,null))[_0x9982('0x4b')](handleError(_0x4f7fe0,null));};exports[_0x9982('0x66')]=function(_0x463ff7,_0x2b1512,_0x5b6412){var _0x355f9e=_0x463ff7[_0x9982('0x55')][_0x9982('0x67')];return db[_0x9982('0x65')][_0x9982('0x49')]({'where':{'id':_0x355f9e},'attributes':['id'],'include':[{'model':db[_0x9982('0x5c')],'as':_0x9982('0x68'),'attributes':['id',_0x9982('0x2f'),_0x9982('0x69'),_0x9982('0x6a'),_0x9982('0x6b')],'raw':!![]}]})[_0x9982('0x28')](function(_0x4774fb){if(_0x4774fb){var _0x3e754a=_[_0x9982('0x6c')](_0x4774fb,function(_0x1c94db){var _0x396d9d=_0x1c94db[_0x9982('0x2a')]({'plain':!![]});return _0x396d9d[_0x9982('0x68')];});return db[_0x9982('0x31')][_0x9982('0x51')]({'where':{'id':_0x463ff7[_0x9982('0x4d')]['id']}})[_0x9982('0x28')](function(_0x44b83f){return db['sequelize'][_0x9982('0x6d')](function(_0x345ae1){return _0x44b83f[_0x9982('0x66')](_0x355f9e,{'transaction':_0x345ae1})[_0x9982('0x28')](function(){return BPromise[_0x9982('0x6e')](_0x3e754a,function(_0x3cf476){return db[_0x9982('0x59')][_0x9982('0x6f')]({'where':{'UserId':_0x3cf476['id'],'MailQueueId':_0x463ff7[_0x9982('0x4d')]['id']},'transaction':_0x345ae1});});})[_0x9982('0x28')](function(){_0x3e754a[_0x9982('0x70')](function(_0x11e58f){socket[_0x9982('0x71')]('userMailQueue:save',{'UserId':_0x11e58f['id'],'MailQueueId':_0x44b83f['id']});});});});});}})[_0x9982('0x28')](respondWithStatusCode(_0x2b1512,null))[_0x9982('0x4b')](handleError(_0x2b1512,null));};exports[_0x9982('0x72')]=function(_0x376cff,_0x24e826,_0x56b89b){return db['Team'][_0x9982('0x49')]({'where':{'id':_0x376cff[_0x9982('0x38')]['ids']},'attributes':['id'],'include':[{'model':db[_0x9982('0x5c')],'as':_0x9982('0x68'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x24e826,null))[_0x9982('0x28')](function(_0x1d6a8f){var _0x3eaebb=_[_0x9982('0x37')](_0x1d6a8f,'id');var _0x993f30=[];var _0xd4e2cf=[];var _0x123cde=squel[_0x9982('0x73')]();_0x123cde[_0x9982('0x74')](_0x9982('0x75'))['from'](_0x9982('0x76'),'tq')[_0x9982('0x77')]('user_has_teams','ut',_0x9982('0x78'))[_0x9982('0x42')](_0x9982('0x79'),_0x376cff['params']['id']);for(var _0x12c9d3=0x0;_0x12c9d3<_0x1d6a8f[_0x9982('0x3e')];_0x12c9d3+=0x1){let _0x2d2ff4=_0x1d6a8f[_0x12c9d3];for(var _0xa87d0=0x0;_0xa87d0<_0x2d2ff4[_0x9982('0x68')][_0x9982('0x3e')];_0xa87d0+=0x1){let _0x56cfcc=_0x2d2ff4[_0x9982('0x68')][_0xa87d0];var _0x507ee7=_0x123cde[_0x9982('0x7a')]();_0x507ee7[_0x9982('0x42')](_0x9982('0x7b'),_0x56cfcc['id']);_0xd4e2cf['push'](db[_0x9982('0x7c')][_0x9982('0x38')](_0x507ee7['toString'](),{'type':db[_0x9982('0x7c')]['QueryTypes'][_0x9982('0x7d')]})[_0x9982('0x28')](function(_0x41f736){if(_0x41f736[_0x9982('0x3e')]===0x1){return _0x56cfcc['id'];}else{var _0x48aac7=_['every'](_['map'](_0x41f736,'TeamId'),function(_0x28a2c2){return _[_0x9982('0x7e')](_0x3eaebb,_0x28a2c2);});if(_0x48aac7){return _0x56cfcc['id'];}}}));}}return BPromise['all'](_0xd4e2cf)[_0x9982('0x28')](function(_0x242f00){_0x993f30=_(_0x993f30)['union'](_0x242f00)[_0x9982('0x7f')]()[_0x9982('0x80')]();return db[_0x9982('0x31')][_0x9982('0x51')]({'where':{'id':_0x376cff[_0x9982('0x4d')]['id']}})[_0x9982('0x28')](function(_0x33786e){return db[_0x9982('0x7c')][_0x9982('0x6d')](function(_0x1338d8){return _0x33786e[_0x9982('0x72')](_0x376cff[_0x9982('0x38')]['ids'],{'transaction':_0x1338d8})[_0x9982('0x28')](function(){if(!_[_0x9982('0x81')](_0x993f30)){return _0x33786e[_0x9982('0x82')](_0x993f30,{'transaction':_0x1338d8});}})['then'](function(){_0x993f30['forEach'](function(_0x46dc57){socket['emit'](_0x9982('0x83'),{'UserId':_0x46dc57,'MailQueueId':_0x33786e['id']});});});});});});})[_0x9982('0x28')](respondWithStatusCode(_0x24e826,null))['catch'](handleError(_0x24e826,null));};exports['addAgents']=function(_0x18a269,_0xb6396a,_0x10b2fb){return db[_0x9982('0x31')][_0x9982('0x51')]({'where':{'id':_0x18a269[_0x9982('0x4d')]['id']}})[_0x9982('0x28')](handleEntityNotFound(_0xb6396a,null))[_0x9982('0x28')](function(_0x335af6){if(_0x335af6){return _0x335af6[_0x9982('0x84')](_0x18a269[_0x9982('0x55')]['ids'],_[_0x9982('0x85')](_0x18a269[_0x9982('0x55')],[_0x9982('0x67'),'id'])||{})[_0x9982('0x86')](function(_0x297fa8){for(var _0x8733e2=0x0;_0x8733e2<_0x18a269[_0x9982('0x55')][_0x9982('0x67')][_0x9982('0x3e')];_0x8733e2+=0x1){socket[_0x9982('0x71')](_0x9982('0x87'),{'UserId':Number(_0x18a269[_0x9982('0x55')]['ids'][_0x8733e2]),'MailQueueId':Number(_0x18a269[_0x9982('0x4d')]['id'])});}return _0x297fa8;});}})[_0x9982('0x28')](respondWithResult(_0xb6396a,null))[_0x9982('0x4b')](handleError(_0xb6396a,null));};exports[_0x9982('0x82')]=function(_0x210cf7,_0x472ebc,_0xb60092){return db[_0x9982('0x31')]['find']({'where':{'id':_0x210cf7[_0x9982('0x4d')]['id']}})[_0x9982('0x28')](handleEntityNotFound(_0x472ebc,null))['then'](function(_0x5c11a8){if(_0x5c11a8){return _0x5c11a8[_0x9982('0x82')](_0x210cf7[_0x9982('0x38')][_0x9982('0x67')])['then'](function(){if(_[_0x9982('0x88')](_0x210cf7['query']['ids'])){for(var _0x128649=0x0;_0x128649<_0x210cf7['query'][_0x9982('0x67')]['length'];_0x128649+=0x1){socket[_0x9982('0x71')](_0x9982('0x83'),{'UserId':Number(_0x210cf7['query'][_0x9982('0x67')][_0x128649]),'MailQueueId':Number(_0x210cf7[_0x9982('0x4d')]['id'])});}}else{socket[_0x9982('0x71')](_0x9982('0x83'),{'UserId':Number(_0x210cf7[_0x9982('0x38')][_0x9982('0x67')]),'MailQueueId':Number(_0x210cf7[_0x9982('0x4d')]['id'])});}});}})['then'](respondWithStatusCode(_0x472ebc,null))[_0x9982('0x4b')](handleError(_0x472ebc,null));};exports[_0x9982('0x89')]=function(_0x2fe445,_0xda4f7e,_0xf87334){var _0x3fdadf={};var _0x2586f5={};var _0x5aa40a;var _0x5c933e;return db[_0x9982('0x31')][_0x9982('0x58')]({'where':{'id':_0x2fe445[_0x9982('0x4d')]['id']}})['then'](handleEntityNotFound(_0xda4f7e,null))[_0x9982('0x28')](function(_0x8935e3){if(_0x8935e3){_0x5aa40a=_0x8935e3;_0x2586f5['model']=_[_0x9982('0x39')](db[_0x9982('0x5c')]['rawAttributes']);_0x2586f5[_0x9982('0x38')]=_[_0x9982('0x39')](_0x2fe445['query']);_0x2586f5[_0x9982('0x3a')]=_[_0x9982('0x3b')](_0x2586f5[_0x9982('0x36')],_0x2586f5[_0x9982('0x38')]);_0x3fdadf[_0x9982('0x3c')]=_[_0x9982('0x3b')](_0x2586f5[_0x9982('0x36')],qs[_0x9982('0x3d')](_0x2fe445[_0x9982('0x38')][_0x9982('0x3d')]));_0x3fdadf[_0x9982('0x3c')]=_0x3fdadf[_0x9982('0x3c')]['length']?_0x3fdadf[_0x9982('0x3c')]:_0x2586f5[_0x9982('0x36')];_0x3fdadf[_0x9982('0x40')]=qs[_0x9982('0x41')](_0x2fe445[_0x9982('0x38')][_0x9982('0x41')]);_0x3fdadf[_0x9982('0x42')]=qs[_0x9982('0x3a')](_[_0x9982('0x43')](_0x2fe445[_0x9982('0x38')],_0x2586f5[_0x9982('0x3a')]));if(_0x2fe445[_0x9982('0x38')][_0x9982('0x44')]){_0x3fdadf[_0x9982('0x42')]=_['merge'](_0x3fdadf[_0x9982('0x42')],{'$or':_[_0x9982('0x37')](_0x3fdadf[_0x9982('0x3c')],function(_0x29cdf3){var _0x28c91d={};_0x28c91d[_0x29cdf3]={'$like':'%'+_0x2fe445['query'][_0x9982('0x44')]+'%'};return _0x28c91d;})});}_0x3fdadf=_[_0x9982('0x45')]({},_0x3fdadf,_0x2fe445[_0x9982('0x47')]);return _0x5aa40a[_0x9982('0x89')](_0x3fdadf);}})[_0x9982('0x28')](function(_0x186d2a){if(_0x186d2a){_0x5c933e=_0x186d2a[_0x9982('0x3e')];if(!_0x2fe445[_0x9982('0x38')]['hasOwnProperty'](_0x9982('0x3f'))){_0x3fdadf[_0x9982('0x21')]=qs[_0x9982('0x21')](_0x2fe445[_0x9982('0x38')][_0x9982('0x21')]);_0x3fdadf[_0x9982('0x1f')]=qs[_0x9982('0x1f')](_0x2fe445['query'][_0x9982('0x1f')]);}return _0x5aa40a['getAgents'](_0x3fdadf);}})['then'](function(_0x348376){if(_0x348376){return _0x348376?{'count':_0x5c933e,'rows':_0x348376}:null;}})[_0x9982('0x28')](respondWithResult(_0xda4f7e,null))[_0x9982('0x4b')](handleError(_0xda4f7e,null));}; \ No newline at end of file +var _0x593e=['userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','destroy','describe','getMembers','findOne','UserMailQueue','length','nolimit','MailQueueId','findAll','findAndCountAll','UserId','agent','mailPause','updatedAt','createdAt','format','%s/%s','SIP','Team','getTeams','ids','Agents','online','interface','flatMap','sequelize','addTeams','emit','userMailQueue:save','removeTeams','User','from','team_has_mail_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','TeamId','includes','all','transaction','removeAgents','forEach','userMailQueue:remove','addAgents','omit','spread','isArray','getAgents','order','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','end','status','json','offset','undefined','count','Content-Range','reject','save','update','then','get','MailQueues','UserProfileResource','error','stack','name','send','index','map','MailQueue','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','limit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x593e,0xcb));var _0xe593=function(_0x4ce692,_0x2f1a45){_0x4ce692=_0x4ce692-0x0;var _0x4a5ee7=_0x593e[_0x4ce692];return _0x4a5ee7;};'use strict';var emlformat=require(_0xe593('0x0'));var rimraf=require(_0xe593('0x1'));var zipdir=require(_0xe593('0x2'));var jsonpatch=require(_0xe593('0x3'));var rp=require(_0xe593('0x4'));var moment=require(_0xe593('0x5'));var BPromise=require(_0xe593('0x6'));var Mustache=require(_0xe593('0x7'));var util=require('util');var path=require(_0xe593('0x8'));var sox=require(_0xe593('0x9'));var csv=require(_0xe593('0xa'));var ejs=require(_0xe593('0xb'));var fs=require('fs');var fs_extra=require(_0xe593('0xc'));var _=require(_0xe593('0xd'));var squel=require(_0xe593('0xe'));var crypto=require(_0xe593('0xf'));var jsforce=require(_0xe593('0x10'));var deskjs=require(_0xe593('0x11'));var toCsv=require('to-csv');var querystring=require(_0xe593('0x12'));var Papa=require(_0xe593('0x13'));var Redis=require(_0xe593('0x14'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe593('0x15'));var hardwareService=require(_0xe593('0x16'));var logger=require(_0xe593('0x17'))('api');var utils=require(_0xe593('0x18'));var config=require(_0xe593('0x19'));var licenseUtil=require(_0xe593('0x1a'));var db=require(_0xe593('0x1b'))['db'];config[_0xe593('0x1c')]=_[_0xe593('0x1d')](config[_0xe593('0x1c')],{'host':_0xe593('0x1e'),'port':0x18eb});var socket=require(_0xe593('0x1f'))(new Redis(config[_0xe593('0x1c')]));require('./mailQueue.socket')[_0xe593('0x20')](socket);function respondWithStatusCode(_0x1de391,_0x59f7c4){_0x59f7c4=_0x59f7c4||0xcc;return function(_0x38418c){if(_0x38418c){return _0x1de391[_0xe593('0x21')](_0x59f7c4);}return _0x1de391['status'](_0x59f7c4)[_0xe593('0x22')]();};}function respondWithResult(_0x40416c,_0x1c6de3){_0x1c6de3=_0x1c6de3||0xc8;return function(_0x2d525c){if(_0x2d525c){return _0x40416c[_0xe593('0x23')](_0x1c6de3)[_0xe593('0x24')](_0x2d525c);}};}function respondWithFilteredResult(_0x48f3b4,_0xfbc79f){return function(_0x470d07){if(_0x470d07){var _0x5f57ce=typeof _0xfbc79f[_0xe593('0x25')]===_0xe593('0x26')&&typeof _0xfbc79f['limit']===_0xe593('0x26');var _0x3dba1b=_0x470d07[_0xe593('0x27')];var _0x321115=_0x5f57ce?0x0:_0xfbc79f[_0xe593('0x25')];var _0x28ee05=_0x5f57ce?_0x470d07[_0xe593('0x27')]:_0xfbc79f['offset']+_0xfbc79f['limit'];var _0x1634d4;if(_0x28ee05>=_0x3dba1b){_0x28ee05=_0x3dba1b;_0x1634d4=0xc8;}else{_0x1634d4=0xce;}_0x48f3b4['status'](_0x1634d4);return _0x48f3b4['set'](_0xe593('0x28'),_0x321115+'-'+_0x28ee05+'/'+_0x3dba1b)[_0xe593('0x24')](_0x470d07);}return null;};}function patchUpdates(_0x57379d){return function(_0xf57cc4){try{jsonpatch['apply'](_0xf57cc4,_0x57379d,!![]);}catch(_0x1672bf){return BPromise[_0xe593('0x29')](_0x1672bf);}return _0xf57cc4[_0xe593('0x2a')]();};}function saveUpdates(_0x44d997,_0x39103d){return function(_0x1d57ca){if(_0x1d57ca){return _0x1d57ca[_0xe593('0x2b')](_0x44d997)[_0xe593('0x2c')](function(_0x4fc483){return _0x4fc483;});}return null;};}function removeEntity(_0x47aea,_0x347d7d){return function(_0x480218){if(_0x480218){return _0x480218['destroy']()[_0xe593('0x2c')](function(){var _0x25238f=_0x480218[_0xe593('0x2d')]({'plain':!![]});var _0x43699d=_0xe593('0x2e');return db[_0xe593('0x2f')]['destroy']({'where':{'type':_0x43699d,'resourceId':_0x25238f['id']}})[_0xe593('0x2c')](function(){return _0x480218;});})['then'](function(){_0x47aea[_0xe593('0x23')](0xcc)[_0xe593('0x22')]();});}};}function handleEntityNotFound(_0x4a2eaa,_0x337ee0){return function(_0x561a01){if(!_0x561a01){_0x4a2eaa[_0xe593('0x21')](0x194);}return _0x561a01;};}function handleError(_0x1c147b,_0x1618af){_0x1618af=_0x1618af||0x1f4;return function(_0x501e54){logger[_0xe593('0x30')](_0x501e54[_0xe593('0x31')]);if(_0x501e54[_0xe593('0x32')]){delete _0x501e54[_0xe593('0x32')];}_0x1c147b[_0xe593('0x23')](_0x1618af)[_0xe593('0x33')](_0x501e54);};}exports[_0xe593('0x34')]=function(_0x4efc93,_0x4098a9){var _0xc23a2f={},_0x4e8448={},_0xe5e728={'count':0x0,'rows':[]};var _0x571995=_[_0xe593('0x35')](db[_0xe593('0x36')][_0xe593('0x37')],function(_0x3f64d0){return{'name':_0x3f64d0[_0xe593('0x38')],'type':_0x3f64d0[_0xe593('0x39')][_0xe593('0x3a')]};});_0x4e8448[_0xe593('0x3b')]=_[_0xe593('0x35')](_0x571995,_0xe593('0x32'));_0x4e8448['query']=_[_0xe593('0x3c')](_0x4efc93[_0xe593('0x3d')]);_0x4e8448[_0xe593('0x3e')]=_['intersection'](_0x4e8448['model'],_0x4e8448[_0xe593('0x3d')]);_0xc23a2f['attributes']=_[_0xe593('0x3f')](_0x4e8448[_0xe593('0x3b')],qs[_0xe593('0x40')](_0x4efc93[_0xe593('0x3d')][_0xe593('0x40')]));_0xc23a2f[_0xe593('0x41')]=_0xc23a2f[_0xe593('0x41')]['length']?_0xc23a2f['attributes']:_0x4e8448[_0xe593('0x3b')];if(!_0x4efc93['query'][_0xe593('0x42')]('nolimit')){_0xc23a2f[_0xe593('0x43')]=qs['limit'](_0x4efc93['query'][_0xe593('0x43')]);_0xc23a2f[_0xe593('0x25')]=qs[_0xe593('0x25')](_0x4efc93['query']['offset']);}_0xc23a2f['order']=qs[_0xe593('0x44')](_0x4efc93['query'][_0xe593('0x44')]);_0xc23a2f[_0xe593('0x45')]=qs[_0xe593('0x3e')](_[_0xe593('0x46')](_0x4efc93['query'],_0x4e8448[_0xe593('0x3e')]),_0x571995);if(_0x4efc93['query'][_0xe593('0x47')]){_0xc23a2f['where']=_['merge'](_0xc23a2f['where'],{'$or':_[_0xe593('0x35')](_0x571995,function(_0x5c2bd2){if(_0x5c2bd2[_0xe593('0x39')]!==_0xe593('0x48')){var _0x35cfd9={};_0x35cfd9[_0x5c2bd2['name']]={'$like':'%'+_0x4efc93[_0xe593('0x3d')][_0xe593('0x47')]+'%'};return _0x35cfd9;}})});}_0xc23a2f=_[_0xe593('0x49')]({},_0xc23a2f,_0x4efc93[_0xe593('0x4a')]);var _0x26ff41={'where':_0xc23a2f[_0xe593('0x45')]};return db[_0xe593('0x36')][_0xe593('0x27')](_0x26ff41)['then'](function(_0x211065){_0xe5e728[_0xe593('0x27')]=_0x211065;if(_0x4efc93[_0xe593('0x3d')][_0xe593('0x4b')]){_0xc23a2f[_0xe593('0x4c')]=[{'all':!![]}];}return db['MailQueue']['findAll'](_0xc23a2f);})[_0xe593('0x2c')](function(_0x380429){_0xe5e728[_0xe593('0x4d')]=_0x380429;return _0xe5e728;})['then'](respondWithFilteredResult(_0x4098a9,_0xc23a2f))[_0xe593('0x4e')](handleError(_0x4098a9,null));};exports[_0xe593('0x4f')]=function(_0x53431a,_0x5a8055){var _0x122302={'raw':!![],'where':{'id':_0x53431a[_0xe593('0x50')]['id']}},_0x245eea={};_0x245eea['model']=_[_0xe593('0x3c')](db[_0xe593('0x36')][_0xe593('0x37')]);_0x245eea[_0xe593('0x3d')]=_['keys'](_0x53431a['query']);_0x245eea['filters']=_['intersection'](_0x245eea[_0xe593('0x3b')],_0x245eea['query']);_0x122302[_0xe593('0x41')]=_[_0xe593('0x3f')](_0x245eea[_0xe593('0x3b')],qs[_0xe593('0x40')](_0x53431a[_0xe593('0x3d')][_0xe593('0x40')]));_0x122302[_0xe593('0x41')]=_0x122302[_0xe593('0x41')]['length']?_0x122302[_0xe593('0x41')]:_0x245eea[_0xe593('0x3b')];if(_0x53431a[_0xe593('0x3d')]['includeAll']){_0x122302[_0xe593('0x4c')]=[{'all':!![]}];}_0x122302=_['merge']({},_0x122302,_0x53431a[_0xe593('0x4a')]);return db[_0xe593('0x36')][_0xe593('0x51')](_0x122302)['then'](handleEntityNotFound(_0x5a8055,null))['then'](respondWithResult(_0x5a8055,null))[_0xe593('0x4e')](handleError(_0x5a8055,null));};exports[_0xe593('0x52')]=function(_0x53db18,_0x4f6e9c){return db['MailQueue']['create'](_0x53db18['body'],{})[_0xe593('0x2c')](function(_0x1e48d8){var _0x1ed8b5=_0x53db18[_0xe593('0x53')][_0xe593('0x2d')]({'plain':!![]});if(!_0x1ed8b5)throw new Error(_0xe593('0x54'));if(_0x1ed8b5[_0xe593('0x55')]===_0xe593('0x53')){var _0x355ad8=_0x1e48d8[_0xe593('0x2d')]({'plain':!![]});var _0x12e09f=_0xe593('0x2e');return db[_0xe593('0x56')][_0xe593('0x51')]({'where':{'name':_0x12e09f,'userProfileId':_0x1ed8b5[_0xe593('0x57')]},'raw':!![]})[_0xe593('0x2c')](function(_0x5d60c3){if(_0x5d60c3&&_0x5d60c3[_0xe593('0x58')]===0x0){return db[_0xe593('0x2f')][_0xe593('0x52')]({'name':_0x355ad8[_0xe593('0x32')],'resourceId':_0x355ad8['id'],'type':_0x5d60c3[_0xe593('0x32')],'sectionId':_0x5d60c3['id']},{})[_0xe593('0x2c')](function(){return _0x1e48d8;});}else{return _0x1e48d8;}})[_0xe593('0x4e')](function(_0x41c6c1){logger[_0xe593('0x30')](_0xe593('0x59'),_0x41c6c1);throw _0x41c6c1;});}return _0x1e48d8;})[_0xe593('0x2c')](respondWithResult(_0x4f6e9c,0xc9))[_0xe593('0x4e')](handleError(_0x4f6e9c,null));};exports[_0xe593('0x2b')]=function(_0x2dcf22,_0x93ca5e){if(_0x2dcf22['body']['id']){delete _0x2dcf22[_0xe593('0x5a')]['id'];}return db[_0xe593('0x36')][_0xe593('0x51')]({'where':{'id':_0x2dcf22[_0xe593('0x50')]['id']}})[_0xe593('0x2c')](handleEntityNotFound(_0x93ca5e,null))['then'](saveUpdates(_0x2dcf22['body'],null))[_0xe593('0x2c')](respondWithResult(_0x93ca5e,null))[_0xe593('0x4e')](handleError(_0x93ca5e,null));};exports[_0xe593('0x5b')]=function(_0x335f68,_0x1b5643){return db[_0xe593('0x36')][_0xe593('0x51')]({'where':{'id':_0x335f68['params']['id']}})['then'](handleEntityNotFound(_0x1b5643,null))[_0xe593('0x2c')](removeEntity(_0x1b5643,null))[_0xe593('0x4e')](handleError(_0x1b5643,null));};exports['describe']=function(_0x103403,_0xf8ed1d){return db[_0xe593('0x36')][_0xe593('0x5c')]()[_0xe593('0x2c')](respondWithResult(_0xf8ed1d,null))[_0xe593('0x4e')](handleError(_0xf8ed1d,null));};exports[_0xe593('0x5d')]=function(_0x3b8b19,_0x1dc796,_0x3316b8){var _0x5b3fcc={'raw':!![],'where':{}},_0x36f38e={},_0x13e368;return db[_0xe593('0x36')][_0xe593('0x5e')]({'where':{'id':_0x3b8b19[_0xe593('0x50')]['id']}})[_0xe593('0x2c')](handleEntityNotFound(_0x1dc796,null))[_0xe593('0x2c')](function(_0x4cef3e){if(_0x4cef3e){_0x13e368=_0x4cef3e[_0xe593('0x2d')]({'plain':!![]});_0x36f38e[_0xe593('0x3b')]=_[_0xe593('0x3c')](db[_0xe593('0x5f')]['rawAttributes']);_0x36f38e[_0xe593('0x3d')]=_[_0xe593('0x3c')](_0x3b8b19[_0xe593('0x3d')]);_0x36f38e[_0xe593('0x3e')]=_[_0xe593('0x3f')](_0x36f38e['model'],_0x36f38e[_0xe593('0x3d')]);_0x5b3fcc[_0xe593('0x41')]=_[_0xe593('0x3f')](_0x36f38e[_0xe593('0x3b')],qs[_0xe593('0x40')](_0x3b8b19[_0xe593('0x3d')][_0xe593('0x40')]));_0x5b3fcc[_0xe593('0x41')]=_0x5b3fcc['attributes'][_0xe593('0x60')]?_0x5b3fcc[_0xe593('0x41')]:_0x36f38e[_0xe593('0x3b')];if(!_0x3b8b19[_0xe593('0x3d')][_0xe593('0x42')](_0xe593('0x61'))){_0x5b3fcc[_0xe593('0x43')]=qs[_0xe593('0x43')](_0x3b8b19[_0xe593('0x3d')][_0xe593('0x43')]);_0x5b3fcc['offset']=qs[_0xe593('0x25')](_0x3b8b19[_0xe593('0x3d')][_0xe593('0x25')]);}_0x5b3fcc['order']=qs[_0xe593('0x44')](_0x3b8b19[_0xe593('0x3d')][_0xe593('0x44')]);_0x5b3fcc[_0xe593('0x45')]=qs[_0xe593('0x3e')](_['pick'](_0x3b8b19[_0xe593('0x3d')],_0x36f38e[_0xe593('0x3e')]));_0x5b3fcc['where'][_0xe593('0x62')]=_0x4cef3e['id'];if(_0x3b8b19[_0xe593('0x3d')][_0xe593('0x47')]){_0x5b3fcc[_0xe593('0x45')]=_['merge'](_0x5b3fcc[_0xe593('0x45')],{'$or':_[_0xe593('0x35')](_0x5b3fcc[_0xe593('0x41')],function(_0x4dea3a){var _0x43dcb0={};_0x43dcb0[_0x4dea3a]={'$like':'%'+_0x3b8b19[_0xe593('0x3d')][_0xe593('0x47')]+'%'};return _0x43dcb0;})});}_0x5b3fcc=_['merge']({},_0x5b3fcc,_0x3b8b19[_0xe593('0x4a')]);return db[_0xe593('0x5f')][_0xe593('0x63')](_0x5b3fcc);}})[_0xe593('0x2c')](function(_0xe89d7e){if(_0xe89d7e){return db['User'][_0xe593('0x64')]({'where':{'id':_[_0xe593('0x35')](_0xe89d7e,_0xe593('0x65')),'role':_0xe593('0x66')},'attributes':['id',_0xe593('0x32'),_0xe593('0x67'),_0xe593('0x68'),_0xe593('0x69')]});}})[_0xe593('0x2c')](function(_0xb7d821){if(_0xb7d821){return{'count':_0xb7d821[_0xe593('0x27')],'rows':_[_0xe593('0x35')](_0xb7d821[_0xe593('0x4d')],function(_0x22e71a){return{'membername':_0x22e71a['name'],'UserId':_0x22e71a['id'],'queue_name':_0x13e368[_0xe593('0x32')],'MailQueueId':_0x13e368['id'],'interface':util[_0xe593('0x6a')](_0xe593('0x6b'),_0xe593('0x6c'),_0x22e71a[_0xe593('0x32')]),'penalty':0x0,'paused':_0x22e71a[_0xe593('0x67')],'createdAt':_0x22e71a[_0xe593('0x69')],'updatedAt':_0x22e71a[_0xe593('0x68')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x1dc796,_0x5b3fcc))['catch'](handleError(_0x1dc796,null));};exports['getTeams']=function(_0x3baa10,_0x993a93,_0x45f9d5){var _0x48edd1={};var _0x5c3134={};var _0x45a9f5;var _0x4c7972;return db[_0xe593('0x36')][_0xe593('0x5e')]({'where':{'id':_0x3baa10[_0xe593('0x50')]['id']}})['then'](handleEntityNotFound(_0x993a93,null))[_0xe593('0x2c')](function(_0x2fea3f){if(_0x2fea3f){_0x45a9f5=_0x2fea3f;_0x5c3134[_0xe593('0x3b')]=_[_0xe593('0x3c')](db[_0xe593('0x6d')][_0xe593('0x37')]);_0x5c3134[_0xe593('0x3d')]=_['keys'](_0x3baa10[_0xe593('0x3d')]);_0x5c3134[_0xe593('0x3e')]=_['intersection'](_0x5c3134[_0xe593('0x3b')],_0x5c3134[_0xe593('0x3d')]);_0x48edd1[_0xe593('0x41')]=_['intersection'](_0x5c3134[_0xe593('0x3b')],qs[_0xe593('0x40')](_0x3baa10[_0xe593('0x3d')][_0xe593('0x40')]));_0x48edd1[_0xe593('0x41')]=_0x48edd1[_0xe593('0x41')]['length']?_0x48edd1['attributes']:_0x5c3134[_0xe593('0x3b')];_0x48edd1['order']=qs['sort'](_0x3baa10['query'][_0xe593('0x44')]);_0x48edd1[_0xe593('0x45')]=qs[_0xe593('0x3e')](_[_0xe593('0x46')](_0x3baa10[_0xe593('0x3d')],_0x5c3134['filters']));if(_0x3baa10['query'][_0xe593('0x47')]){_0x48edd1[_0xe593('0x45')]=_[_0xe593('0x49')](_0x48edd1[_0xe593('0x45')],{'$or':_['map'](_0x48edd1[_0xe593('0x41')],function(_0x328377){var _0x309b9c={};_0x309b9c[_0x328377]={'$like':'%'+_0x3baa10['query'][_0xe593('0x47')]+'%'};return _0x309b9c;})});}_0x48edd1=_[_0xe593('0x49')]({},_0x48edd1,_0x3baa10['options']);return _0x45a9f5[_0xe593('0x6e')](_0x48edd1);}})[_0xe593('0x2c')](function(_0x5566e0){if(_0x5566e0){_0x4c7972=_0x5566e0['length'];if(!_0x3baa10['query']['hasOwnProperty']('nolimit')){_0x48edd1['limit']=qs[_0xe593('0x43')](_0x3baa10['query'][_0xe593('0x43')]);_0x48edd1[_0xe593('0x25')]=qs[_0xe593('0x25')](_0x3baa10['query']['offset']);}return _0x45a9f5[_0xe593('0x6e')](_0x48edd1);}})[_0xe593('0x2c')](function(_0x3db9f1){if(_0x3db9f1){return _0x3db9f1?{'count':_0x4c7972,'rows':_0x3db9f1}:null;}})[_0xe593('0x2c')](respondWithResult(_0x993a93,null))['catch'](handleError(_0x993a93,null));};exports['addTeams']=function(_0x12f9c4,_0xf272d6,_0x5127da){var _0x2c7c37=_0x12f9c4[_0xe593('0x5a')][_0xe593('0x6f')];return db[_0xe593('0x6d')][_0xe593('0x63')]({'where':{'id':_0x2c7c37},'attributes':['id'],'include':[{'model':db['User'],'as':_0xe593('0x70'),'attributes':['id','name',_0xe593('0x71'),'voicePause',_0xe593('0x72')],'raw':!![]}]})['then'](function(_0x50ab4d){if(_0x50ab4d){var _0x265fee=_[_0xe593('0x73')](_0x50ab4d,function(_0x30c283){var _0x4cabbb=_0x30c283[_0xe593('0x2d')]({'plain':!![]});return _0x4cabbb[_0xe593('0x70')];});return db[_0xe593('0x36')]['find']({'where':{'id':_0x12f9c4[_0xe593('0x50')]['id']}})['then'](function(_0x1d76d5){return db[_0xe593('0x74')]['transaction'](function(_0x4540ca){return _0x1d76d5[_0xe593('0x75')](_0x2c7c37,{'transaction':_0x4540ca})[_0xe593('0x2c')](function(){return BPromise['each'](_0x265fee,function(_0x591d29){return db[_0xe593('0x5f')]['findOrCreate']({'where':{'UserId':_0x591d29['id'],'MailQueueId':_0x12f9c4[_0xe593('0x50')]['id']},'transaction':_0x4540ca});});})[_0xe593('0x2c')](function(){_0x265fee['forEach'](function(_0x5e6456){socket[_0xe593('0x76')](_0xe593('0x77'),{'UserId':_0x5e6456['id'],'MailQueueId':_0x1d76d5['id']});});});});});}})[_0xe593('0x2c')](respondWithStatusCode(_0xf272d6,null))['catch'](handleError(_0xf272d6,null));};exports[_0xe593('0x78')]=function(_0xd79cda,_0x42369d,_0x2abd90){return db[_0xe593('0x6d')][_0xe593('0x63')]({'where':{'id':_0xd79cda['query'][_0xe593('0x6f')]},'attributes':['id'],'include':[{'model':db[_0xe593('0x79')],'as':_0xe593('0x70'),'attributes':['id'],'raw':!![]}]})[_0xe593('0x2c')](handleEntityNotFound(_0x42369d,null))[_0xe593('0x2c')](function(_0x3f8cbf){var _0x7d000e=_['map'](_0x3f8cbf,'id');var _0xa7de6=[];var _0x20dc5f=[];var _0x37c62a=squel['select']();_0x37c62a['field']('tq.TeamId')[_0xe593('0x7a')](_0xe593('0x7b'),'tq')['join'](_0xe593('0x7c'),'ut',_0xe593('0x7d'))['where'](_0xe593('0x7e'),_0xd79cda['params']['id']);for(var _0x51a965=0x0;_0x51a965<_0x3f8cbf[_0xe593('0x60')];_0x51a965+=0x1){let _0x427472=_0x3f8cbf[_0x51a965];for(var _0x1aff4f=0x0;_0x1aff4f<_0x427472[_0xe593('0x70')][_0xe593('0x60')];_0x1aff4f+=0x1){let _0x49b999=_0x427472[_0xe593('0x70')][_0x1aff4f];var _0x42f34d=_0x37c62a['clone']();_0x42f34d[_0xe593('0x45')](_0xe593('0x7f'),_0x49b999['id']);_0x20dc5f[_0xe593('0x80')](db[_0xe593('0x74')][_0xe593('0x3d')](_0x42f34d[_0xe593('0x81')](),{'type':db['sequelize'][_0xe593('0x82')][_0xe593('0x83')]})[_0xe593('0x2c')](function(_0x2f8c46){if(_0x2f8c46[_0xe593('0x60')]===0x1){return _0x49b999['id'];}else{var _0x2de040=_['every'](_[_0xe593('0x35')](_0x2f8c46,_0xe593('0x84')),function(_0x4b31c8){return _[_0xe593('0x85')](_0x7d000e,_0x4b31c8);});if(_0x2de040){return _0x49b999['id'];}}}));}}return BPromise[_0xe593('0x86')](_0x20dc5f)['then'](function(_0x11abea){_0xa7de6=_(_0xa7de6)['union'](_0x11abea)['compact']()['value']();return db[_0xe593('0x36')]['find']({'where':{'id':_0xd79cda[_0xe593('0x50')]['id']}})[_0xe593('0x2c')](function(_0x48e462){return db[_0xe593('0x74')][_0xe593('0x87')](function(_0x3a2a3a){return _0x48e462[_0xe593('0x78')](_0xd79cda['query']['ids'],{'transaction':_0x3a2a3a})[_0xe593('0x2c')](function(){if(!_['isEmpty'](_0xa7de6)){return _0x48e462[_0xe593('0x88')](_0xa7de6,{'transaction':_0x3a2a3a});}})['then'](function(){_0xa7de6[_0xe593('0x89')](function(_0xd9c223){socket[_0xe593('0x76')](_0xe593('0x8a'),{'UserId':_0xd9c223,'MailQueueId':_0x48e462['id']});});});});});});})[_0xe593('0x2c')](respondWithStatusCode(_0x42369d,null))[_0xe593('0x4e')](handleError(_0x42369d,null));};exports['addAgents']=function(_0xb029b1,_0x409172,_0x490967){return db[_0xe593('0x36')]['find']({'where':{'id':_0xb029b1['params']['id']}})[_0xe593('0x2c')](handleEntityNotFound(_0x409172,null))[_0xe593('0x2c')](function(_0x232827){if(_0x232827){return _0x232827[_0xe593('0x8b')](_0xb029b1[_0xe593('0x5a')][_0xe593('0x6f')],_[_0xe593('0x8c')](_0xb029b1[_0xe593('0x5a')],[_0xe593('0x6f'),'id'])||{})[_0xe593('0x8d')](function(_0x2b6602){for(var _0x4dfe26=0x0;_0x4dfe26<_0xb029b1[_0xe593('0x5a')]['ids']['length'];_0x4dfe26+=0x1){socket[_0xe593('0x76')](_0xe593('0x77'),{'UserId':Number(_0xb029b1[_0xe593('0x5a')]['ids'][_0x4dfe26]),'MailQueueId':Number(_0xb029b1['params']['id'])});}return _0x2b6602;});}})[_0xe593('0x2c')](respondWithResult(_0x409172,null))[_0xe593('0x4e')](handleError(_0x409172,null));};exports[_0xe593('0x88')]=function(_0xa51f36,_0x4b1072,_0x287d15){return db[_0xe593('0x36')][_0xe593('0x51')]({'where':{'id':_0xa51f36[_0xe593('0x50')]['id']}})[_0xe593('0x2c')](handleEntityNotFound(_0x4b1072,null))[_0xe593('0x2c')](function(_0x4e69c6){if(_0x4e69c6){return _0x4e69c6['removeAgents'](_0xa51f36[_0xe593('0x3d')][_0xe593('0x6f')])[_0xe593('0x2c')](function(){if(_[_0xe593('0x8e')](_0xa51f36[_0xe593('0x3d')][_0xe593('0x6f')])){for(var _0x38d755=0x0;_0x38d755<_0xa51f36[_0xe593('0x3d')][_0xe593('0x6f')][_0xe593('0x60')];_0x38d755+=0x1){socket[_0xe593('0x76')]('userMailQueue:remove',{'UserId':Number(_0xa51f36['query'][_0xe593('0x6f')][_0x38d755]),'MailQueueId':Number(_0xa51f36[_0xe593('0x50')]['id'])});}}else{socket[_0xe593('0x76')](_0xe593('0x8a'),{'UserId':Number(_0xa51f36[_0xe593('0x3d')][_0xe593('0x6f')]),'MailQueueId':Number(_0xa51f36['params']['id'])});}});}})['then'](respondWithStatusCode(_0x4b1072,null))[_0xe593('0x4e')](handleError(_0x4b1072,null));};exports[_0xe593('0x8f')]=function(_0x1bba7c,_0xf97248,_0x4dcf23){var _0x5207ee={};var _0x373d1e={};var _0xf40888;var _0x12c44b;return db[_0xe593('0x36')]['findOne']({'where':{'id':_0x1bba7c[_0xe593('0x50')]['id']}})[_0xe593('0x2c')](handleEntityNotFound(_0xf97248,null))[_0xe593('0x2c')](function(_0x31d9e6){if(_0x31d9e6){_0xf40888=_0x31d9e6;_0x373d1e[_0xe593('0x3b')]=_['keys'](db[_0xe593('0x79')][_0xe593('0x37')]);_0x373d1e['query']=_[_0xe593('0x3c')](_0x1bba7c[_0xe593('0x3d')]);_0x373d1e['filters']=_[_0xe593('0x3f')](_0x373d1e[_0xe593('0x3b')],_0x373d1e['query']);_0x5207ee[_0xe593('0x41')]=_[_0xe593('0x3f')](_0x373d1e['model'],qs[_0xe593('0x40')](_0x1bba7c[_0xe593('0x3d')][_0xe593('0x40')]));_0x5207ee[_0xe593('0x41')]=_0x5207ee[_0xe593('0x41')][_0xe593('0x60')]?_0x5207ee['attributes']:_0x373d1e[_0xe593('0x3b')];_0x5207ee[_0xe593('0x90')]=qs[_0xe593('0x44')](_0x1bba7c[_0xe593('0x3d')][_0xe593('0x44')]);_0x5207ee[_0xe593('0x45')]=qs[_0xe593('0x3e')](_[_0xe593('0x46')](_0x1bba7c['query'],_0x373d1e['filters']));if(_0x1bba7c['query'][_0xe593('0x47')]){_0x5207ee['where']=_[_0xe593('0x49')](_0x5207ee[_0xe593('0x45')],{'$or':_[_0xe593('0x35')](_0x5207ee[_0xe593('0x41')],function(_0x9f5937){var _0x1d9476={};_0x1d9476[_0x9f5937]={'$like':'%'+_0x1bba7c[_0xe593('0x3d')][_0xe593('0x47')]+'%'};return _0x1d9476;})});}_0x5207ee=_[_0xe593('0x49')]({},_0x5207ee,_0x1bba7c[_0xe593('0x4a')]);return _0xf40888[_0xe593('0x8f')](_0x5207ee);}})[_0xe593('0x2c')](function(_0x53212c){if(_0x53212c){_0x12c44b=_0x53212c[_0xe593('0x60')];if(!_0x1bba7c['query'][_0xe593('0x42')](_0xe593('0x61'))){_0x5207ee[_0xe593('0x43')]=qs['limit'](_0x1bba7c[_0xe593('0x3d')][_0xe593('0x43')]);_0x5207ee[_0xe593('0x25')]=qs[_0xe593('0x25')](_0x1bba7c[_0xe593('0x3d')][_0xe593('0x25')]);}return _0xf40888[_0xe593('0x8f')](_0x5207ee);}})['then'](function(_0x309305){if(_0x309305){return _0x309305?{'count':_0x12c44b,'rows':_0x309305}:null;}})[_0xe593('0x2c')](respondWithResult(_0xf97248,null))[_0xe593('0x4e')](handleError(_0xf97248,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index acdd5fe..6aaa1c8 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 _0xaefb=['emit','hasOwnProperty','exports','events','MailQueue','setMaxListeners','save','remove'];(function(_0xdaf7d4,_0x341fec){var _0x2daecf=function(_0x3a55f5){while(--_0x3a55f5){_0xdaf7d4['push'](_0xdaf7d4['shift']());}};_0x2daecf(++_0x341fec);}(_0xaefb,0x1f3));var _0xbaef=function(_0xb4cc12,_0x41436e){_0xb4cc12=_0xb4cc12-0x0;var _0x8593b5=_0xaefb[_0xb4cc12];return _0x8593b5;};'use strict';var EventEmitter=require(_0xbaef('0x0'));var MailQueue=require('../../mysqldb')['db'][_0xbaef('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xbaef('0x2')](0x0);var events={'afterCreate':_0xbaef('0x3'),'afterUpdate':'update','afterDestroy':_0xbaef('0x4')};function emitEvent(_0x48d639){return function(_0x3916d8,_0x4374b8,_0x53a2a5){MailQueueEvents[_0xbaef('0x5')](_0x48d639+':'+_0x3916d8['id'],_0x3916d8);MailQueueEvents[_0xbaef('0x5')](_0x48d639,_0x3916d8);_0x53a2a5(null);};}for(var e in events){if(events[_0xbaef('0x6')](e)){var event=events[e];MailQueue['hook'](e,emitEvent(event));}}module[_0xbaef('0x7')]=MailQueueEvents; \ No newline at end of file +var _0x7b77=['update','remove','emit','hook','exports','events','../../mysqldb','MailQueue','setMaxListeners'];(function(_0x4dba92,_0x57b559){var _0x5951da=function(_0x304a1a){while(--_0x304a1a){_0x4dba92['push'](_0x4dba92['shift']());}};_0x5951da(++_0x57b559);}(_0x7b77,0x176));var _0x77b7=function(_0x265aa2,_0x220072){_0x265aa2=_0x265aa2-0x0;var _0x447a3a=_0x7b77[_0x265aa2];return _0x447a3a;};'use strict';var EventEmitter=require(_0x77b7('0x0'));var MailQueue=require(_0x77b7('0x1'))['db'][_0x77b7('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x77b7('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x77b7('0x4'),'afterDestroy':_0x77b7('0x5')};function emitEvent(_0x3ac221){return function(_0x2f9ed3,_0x187b49,_0x1e5afb){MailQueueEvents[_0x77b7('0x6')](_0x3ac221+':'+_0x2f9ed3['id'],_0x2f9ed3);MailQueueEvents[_0x77b7('0x6')](_0x3ac221,_0x2f9ed3);_0x1e5afb(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue[_0x77b7('0x7')](e,emitEvent(event));}}module[_0x77b7('0x8')]=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index 3778857..916da02 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 _0x178c=['MailQueue','lodash','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./mailQueue.attributes','exports','define'];(function(_0x145bfb,_0x4f974b){var _0x46af90=function(_0x3a95d7){while(--_0x3a95d7){_0x145bfb['push'](_0x145bfb['shift']());}};_0x46af90(++_0x4f974b);}(_0x178c,0x161));var _0xc178=function(_0x5b8524,_0x45cf3b){_0x5b8524=_0x5b8524-0x0;var _0x54c541=_0x178c[_0x5b8524];return _0x54c541;};'use strict';var _=require(_0xc178('0x0'));var util=require('util');var logger=require(_0xc178('0x1'))(_0xc178('0x2'));var moment=require('moment');var BPromise=require(_0xc178('0x3'));var rp=require(_0xc178('0x4'));var fs=require('fs');var path=require(_0xc178('0x5'));var rimraf=require('rimraf');var config=require(_0xc178('0x6'));var attributes=require(_0xc178('0x7'));module[_0xc178('0x8')]=function(_0x236a26,_0x27345e){return _0x236a26[_0xc178('0x9')](_0xc178('0xa'),attributes,{'tableName':'mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x785d=['exports','MailQueue','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./mailQueue.attributes'];(function(_0x216008,_0x2d1023){var _0x4d384f=function(_0x3fd7e2){while(--_0x3fd7e2){_0x216008['push'](_0x216008['shift']());}};_0x4d384f(++_0x2d1023);}(_0x785d,0x174));var _0xd785=function(_0x282ac4,_0x1b9cc2){_0x282ac4=_0x282ac4-0x0;var _0xe77923=_0x785d[_0x282ac4];return _0xe77923;};'use strict';var _=require('lodash');var util=require(_0xd785('0x0'));var logger=require('../../config/logger')(_0xd785('0x1'));var moment=require(_0xd785('0x2'));var BPromise=require(_0xd785('0x3'));var rp=require(_0xd785('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd785('0x5'));var config=require(_0xd785('0x6'));var attributes=require(_0xd785('0x7'));module[_0xd785('0x8')]=function(_0x17f6e0,_0x45b1d9){return _0x17f6e0['define'](_0xd785('0x9'),attributes,{'tableName':'mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.rpc.js b/server/api/mailQueue/mailQueue.rpc.js index d71a1d8..c1ef4ce 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 _0xff6e=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./mailQueue.socket','register','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','MailQueue','findAll','options','raw','where','attributes','limit','include','model','map','GetMailQueue','find','ShowMailQueue','lodash'];(function(_0x4f3cd1,_0x4b666e){var _0x4f304d=function(_0x5691ad){while(--_0x5691ad){_0x4f3cd1['push'](_0x4f3cd1['shift']());}};_0x4f304d(++_0x4b666e);}(_0xff6e,0x179));var _0xeff6=function(_0x2df724,_0x411382){_0x2df724=_0x2df724-0x0;var _0x1b2504=_0xff6e[_0x2df724];return _0x1b2504;};'use strict';var _=require(_0xeff6('0x0'));var util=require(_0xeff6('0x1'));var moment=require(_0xeff6('0x2'));var BPromise=require(_0xeff6('0x3'));var rs=require(_0xeff6('0x4'));var fs=require('fs');var Redis=require(_0xeff6('0x5'));var db=require(_0xeff6('0x6'))['db'];var utils=require(_0xeff6('0x7'));var logger=require(_0xeff6('0x8'))(_0xeff6('0x9'));var config=require(_0xeff6('0xa'));var jayson=require(_0xeff6('0xb'));var client=jayson['client'][_0xeff6('0xc')]({'port':0x232a});config[_0xeff6('0xd')]=_['defaults'](config[_0xeff6('0xd')],{'host':_0xeff6('0xe'),'port':0x18eb});var socket=require(_0xeff6('0xf'))(new Redis(config['redis']));require(_0xeff6('0x10'))[_0xeff6('0x11')](socket);function respondWithRpcPromise(_0x4d5e2d,_0x44ec5b,_0x3c1da6){return new BPromise(function(_0x5441ba,_0x403c2c){return client['request'](_0x4d5e2d,_0x3c1da6)[_0xeff6('0x12')](function(_0x1de259){logger[_0xeff6('0x13')](_0xeff6('0x14'),_0x44ec5b,_0xeff6('0x15'));logger[_0xeff6('0x16')](_0xeff6('0x17'),_0x44ec5b,_0xeff6('0x15'),JSON[_0xeff6('0x18')](_0x1de259));if(_0x1de259['error']){if(_0x1de259[_0xeff6('0x19')]['code']===0x1f4){logger['error'](_0xeff6('0x14'),_0x44ec5b,_0x1de259['error']['message']);return _0x403c2c(_0x1de259[_0xeff6('0x19')][_0xeff6('0x1a')]);}logger[_0xeff6('0x19')]('MailQueue,\x20%s,\x20%s',_0x44ec5b,_0x1de259[_0xeff6('0x19')][_0xeff6('0x1a')]);return _0x5441ba(_0x1de259['error'][_0xeff6('0x1a')]);}else{logger[_0xeff6('0x13')]('MailQueue,\x20%s,\x20%s',_0x44ec5b,_0xeff6('0x15'));_0x5441ba(_0x1de259[_0xeff6('0x1b')][_0xeff6('0x1a')]);}})[_0xeff6('0x1c')](function(_0x1e791){logger[_0xeff6('0x19')](_0xeff6('0x14'),_0x44ec5b,_0x1e791);_0x403c2c(_0x1e791);});});}exports['GetMailQueue']=function(_0xa7d1a5){var _0x3c78c4=this;return new Promise(function(_0x271ef8,_0x4e4c1c){return db[_0xeff6('0x1d')][_0xeff6('0x1e')]({'raw':_0xa7d1a5[_0xeff6('0x1f')]?_0xa7d1a5[_0xeff6('0x1f')][_0xeff6('0x20')]===undefined?!![]:![]:!![],'where':_0xa7d1a5['options']?_0xa7d1a5[_0xeff6('0x1f')][_0xeff6('0x21')]||null:null,'attributes':_0xa7d1a5[_0xeff6('0x1f')]?_0xa7d1a5['options'][_0xeff6('0x22')]||null:null,'limit':_0xa7d1a5[_0xeff6('0x1f')]?_0xa7d1a5[_0xeff6('0x1f')][_0xeff6('0x23')]||null:null,'include':_0xa7d1a5[_0xeff6('0x1f')]?_0xa7d1a5[_0xeff6('0x1f')][_0xeff6('0x24')]?_['map'](_0xa7d1a5['options'][_0xeff6('0x24')],function(_0x1261ca){return{'model':db[_0x1261ca[_0xeff6('0x25')]],'as':_0x1261ca['as'],'attributes':_0x1261ca['attributes'],'include':_0x1261ca['include']?_[_0xeff6('0x26')](_0x1261ca[_0xeff6('0x24')],function(_0x467505){return{'model':db[_0x467505[_0xeff6('0x25')]],'as':_0x467505['as'],'attributes':_0x467505[_0xeff6('0x22')],'include':_0x467505['include']?_[_0xeff6('0x26')](_0x467505[_0xeff6('0x24')],function(_0x1ebf48){return{'model':db[_0x1ebf48[_0xeff6('0x25')]],'as':_0x1ebf48['as'],'attributes':_0x1ebf48['attributes']};}):[]};}):[]};}):[]:[]})[_0xeff6('0x12')](function(_0x2cf887){logger[_0xeff6('0x13')](_0xeff6('0x27'),_0xa7d1a5);logger[_0xeff6('0x16')](_0xeff6('0x27'),_0xa7d1a5,JSON[_0xeff6('0x18')](_0x2cf887));_0x271ef8(_0x2cf887);})['catch'](function(_0x458a7b){logger[_0xeff6('0x19')](_0xeff6('0x27'),_0x458a7b[_0xeff6('0x1a')],_0xa7d1a5);_0x4e4c1c(_0x3c78c4[_0xeff6('0x19')](0x1f4,_0x458a7b[_0xeff6('0x1a')]));});});};exports['ShowMailQueue']=function(_0x505e36){var _0x43a9e2=this;return new Promise(function(_0x23f4cf,_0xec149c){return db[_0xeff6('0x1d')][_0xeff6('0x28')]({'raw':_0x505e36[_0xeff6('0x1f')]?_0x505e36['options'][_0xeff6('0x20')]===undefined?!![]:![]:!![],'where':_0x505e36['options']?_0x505e36[_0xeff6('0x1f')][_0xeff6('0x21')]||null:null,'attributes':_0x505e36[_0xeff6('0x1f')]?_0x505e36[_0xeff6('0x1f')][_0xeff6('0x22')]||null:null,'include':_0x505e36[_0xeff6('0x1f')]?_0x505e36[_0xeff6('0x1f')][_0xeff6('0x24')]?_[_0xeff6('0x26')](_0x505e36[_0xeff6('0x1f')][_0xeff6('0x24')],function(_0x33389c){return{'model':db[_0x33389c[_0xeff6('0x25')]],'as':_0x33389c['as'],'attributes':_0x33389c[_0xeff6('0x22')],'include':_0x33389c[_0xeff6('0x24')]?_['map'](_0x33389c[_0xeff6('0x24')],function(_0x1a588f){return{'model':db[_0x1a588f[_0xeff6('0x25')]],'as':_0x1a588f['as'],'attributes':_0x1a588f[_0xeff6('0x22')],'include':_0x1a588f['include']?_[_0xeff6('0x26')](_0x1a588f['include'],function(_0x3e5428){return{'model':db[_0x3e5428[_0xeff6('0x25')]],'as':_0x3e5428['as'],'attributes':_0x3e5428[_0xeff6('0x22')]};}):[]};}):[]};}):[]:[]})[_0xeff6('0x12')](function(_0x25f50c){logger[_0xeff6('0x13')]('ShowMailQueue',_0x505e36);logger['debug'](_0xeff6('0x29'),_0x505e36,JSON[_0xeff6('0x18')](_0x25f50c));_0x23f4cf(_0x25f50c);})[_0xeff6('0x1c')](function(_0x5758f1){logger[_0xeff6('0x19')]('ShowMailQueue',_0x5758f1[_0xeff6('0x1a')],_0x505e36);_0xec149c(_0x43a9e2[_0xeff6('0x19')](0x1f4,_0x5758f1['message']));});});}; \ No newline at end of file +var _0xc3e7=['find','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','register','request','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMailQueue','MailQueue','options','raw','where','attributes','limit','include','map','model','then','info'];(function(_0x1bf06f,_0x164732){var _0x5092d5=function(_0x4d71c0){while(--_0x4d71c0){_0x1bf06f['push'](_0x1bf06f['shift']());}};_0x5092d5(++_0x164732);}(_0xc3e7,0xa1));var _0x7c3e=function(_0x243b2f,_0x30aa15){_0x243b2f=_0x243b2f-0x0;var _0xcb3c2d=_0xc3e7[_0x243b2f];return _0xcb3c2d;};'use strict';var _=require(_0x7c3e('0x0'));var util=require(_0x7c3e('0x1'));var moment=require('moment');var BPromise=require(_0x7c3e('0x2'));var rs=require(_0x7c3e('0x3'));var fs=require('fs');var Redis=require(_0x7c3e('0x4'));var db=require(_0x7c3e('0x5'))['db'];var utils=require(_0x7c3e('0x6'));var logger=require(_0x7c3e('0x7'))(_0x7c3e('0x8'));var config=require(_0x7c3e('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7c3e('0xa')][_0x7c3e('0xb')]({'port':0x232a});config[_0x7c3e('0xc')]=_[_0x7c3e('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x7c3e('0xe'))(new Redis(config[_0x7c3e('0xc')]));require('./mailQueue.socket')[_0x7c3e('0xf')](socket);function respondWithRpcPromise(_0x188f80,_0x4f1dd3,_0x3f5b31){return new BPromise(function(_0xb62c8f,_0x27a6d5){return client[_0x7c3e('0x10')](_0x188f80,_0x3f5b31)['then'](function(_0x4ab923){logger['info'](_0x7c3e('0x11'),_0x4f1dd3,_0x7c3e('0x12'));logger[_0x7c3e('0x13')](_0x7c3e('0x14'),_0x4f1dd3,_0x7c3e('0x12'),JSON[_0x7c3e('0x15')](_0x4ab923));if(_0x4ab923[_0x7c3e('0x16')]){if(_0x4ab923['error'][_0x7c3e('0x17')]===0x1f4){logger['error']('MailQueue,\x20%s,\x20%s',_0x4f1dd3,_0x4ab923[_0x7c3e('0x16')][_0x7c3e('0x18')]);return _0x27a6d5(_0x4ab923[_0x7c3e('0x16')][_0x7c3e('0x18')]);}logger[_0x7c3e('0x16')]('MailQueue,\x20%s,\x20%s',_0x4f1dd3,_0x4ab923[_0x7c3e('0x16')]['message']);return _0xb62c8f(_0x4ab923[_0x7c3e('0x16')][_0x7c3e('0x18')]);}else{logger['info'](_0x7c3e('0x11'),_0x4f1dd3,_0x7c3e('0x12'));_0xb62c8f(_0x4ab923[_0x7c3e('0x19')][_0x7c3e('0x18')]);}})[_0x7c3e('0x1a')](function(_0x4db0aa){logger[_0x7c3e('0x16')](_0x7c3e('0x11'),_0x4f1dd3,_0x4db0aa);_0x27a6d5(_0x4db0aa);});});}exports[_0x7c3e('0x1b')]=function(_0x4826fb){var _0x2f7418=this;return new Promise(function(_0x4f32f3,_0xfc1305){return db[_0x7c3e('0x1c')]['findAll']({'raw':_0x4826fb[_0x7c3e('0x1d')]?_0x4826fb[_0x7c3e('0x1d')][_0x7c3e('0x1e')]===undefined?!![]:![]:!![],'where':_0x4826fb['options']?_0x4826fb[_0x7c3e('0x1d')][_0x7c3e('0x1f')]||null:null,'attributes':_0x4826fb[_0x7c3e('0x1d')]?_0x4826fb[_0x7c3e('0x1d')][_0x7c3e('0x20')]||null:null,'limit':_0x4826fb['options']?_0x4826fb['options'][_0x7c3e('0x21')]||null:null,'include':_0x4826fb[_0x7c3e('0x1d')]?_0x4826fb[_0x7c3e('0x1d')][_0x7c3e('0x22')]?_['map'](_0x4826fb[_0x7c3e('0x1d')]['include'],function(_0xf3487a){return{'model':db[_0xf3487a['model']],'as':_0xf3487a['as'],'attributes':_0xf3487a['attributes'],'include':_0xf3487a[_0x7c3e('0x22')]?_[_0x7c3e('0x23')](_0xf3487a[_0x7c3e('0x22')],function(_0x32dd6e){return{'model':db[_0x32dd6e['model']],'as':_0x32dd6e['as'],'attributes':_0x32dd6e['attributes'],'include':_0x32dd6e[_0x7c3e('0x22')]?_[_0x7c3e('0x23')](_0x32dd6e['include'],function(_0x14f1fe){return{'model':db[_0x14f1fe[_0x7c3e('0x24')]],'as':_0x14f1fe['as'],'attributes':_0x14f1fe['attributes']};}):[]};}):[]};}):[]:[]})[_0x7c3e('0x25')](function(_0x2b8250){logger[_0x7c3e('0x26')](_0x7c3e('0x1b'),_0x4826fb);logger['debug'](_0x7c3e('0x1b'),_0x4826fb,JSON[_0x7c3e('0x15')](_0x2b8250));_0x4f32f3(_0x2b8250);})[_0x7c3e('0x1a')](function(_0x243fd9){logger[_0x7c3e('0x16')](_0x7c3e('0x1b'),_0x243fd9[_0x7c3e('0x18')],_0x4826fb);_0xfc1305(_0x2f7418['error'](0x1f4,_0x243fd9[_0x7c3e('0x18')]));});});};exports['ShowMailQueue']=function(_0x57b216){var _0x4fab9e=this;return new Promise(function(_0x3fd342,_0x5b5332){return db[_0x7c3e('0x1c')][_0x7c3e('0x27')]({'raw':_0x57b216['options']?_0x57b216[_0x7c3e('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x57b216[_0x7c3e('0x1d')]?_0x57b216[_0x7c3e('0x1d')]['where']||null:null,'attributes':_0x57b216['options']?_0x57b216[_0x7c3e('0x1d')][_0x7c3e('0x20')]||null:null,'include':_0x57b216[_0x7c3e('0x1d')]?_0x57b216[_0x7c3e('0x1d')][_0x7c3e('0x22')]?_[_0x7c3e('0x23')](_0x57b216[_0x7c3e('0x1d')][_0x7c3e('0x22')],function(_0x3014f3){return{'model':db[_0x3014f3[_0x7c3e('0x24')]],'as':_0x3014f3['as'],'attributes':_0x3014f3['attributes'],'include':_0x3014f3['include']?_[_0x7c3e('0x23')](_0x3014f3[_0x7c3e('0x22')],function(_0x43faf0){return{'model':db[_0x43faf0[_0x7c3e('0x24')]],'as':_0x43faf0['as'],'attributes':_0x43faf0[_0x7c3e('0x20')],'include':_0x43faf0[_0x7c3e('0x22')]?_['map'](_0x43faf0[_0x7c3e('0x22')],function(_0x35a298){return{'model':db[_0x35a298[_0x7c3e('0x24')]],'as':_0x35a298['as'],'attributes':_0x35a298[_0x7c3e('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x489c6f){logger['info']('ShowMailQueue',_0x57b216);logger[_0x7c3e('0x13')]('ShowMailQueue',_0x57b216,JSON[_0x7c3e('0x15')](_0x489c6f));_0x3fd342(_0x489c6f);})[_0x7c3e('0x1a')](function(_0xd92a94){logger[_0x7c3e('0x16')]('ShowMailQueue',_0xd92a94[_0x7c3e('0x18')],_0x57b216);_0x5b5332(_0x4fab9e['error'](0x1f4,_0xd92a94[_0x7c3e('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index 23076b6..d4be372 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 _0x722d=['emit','removeListener','register','mailQueue:','./mailQueue.events','save','update'];(function(_0x4e16e9,_0x1ce58e){var _0x4f9971=function(_0x2b1810){while(--_0x2b1810){_0x4e16e9['push'](_0x4e16e9['shift']());}};_0x4f9971(++_0x1ce58e);}(_0x722d,0x17e));var _0xd722=function(_0x5303a2,_0x49716b){_0x5303a2=_0x5303a2-0x0;var _0x448ac5=_0x722d[_0x5303a2];return _0x448ac5;};'use strict';var MailQueueEvents=require(_0xd722('0x0'));var events=[_0xd722('0x1'),'remove',_0xd722('0x2')];function createListener(_0x186a01,_0x8c9a9f){return function(_0x3dbdbc){_0x8c9a9f[_0xd722('0x3')](_0x186a01,_0x3dbdbc);};}function removeListener(_0x109417,_0x2417ba){return function(){MailQueueEvents[_0xd722('0x4')](_0x109417,_0x2417ba);};}exports[_0xd722('0x5')]=function(_0x588587){for(var _0x188813=0x0,_0x283aef=events['length'];_0x188813<_0x283aef;_0x188813++){var _0x25b63a=events[_0x188813];var _0x4bd156=createListener(_0xd722('0x6')+_0x25b63a,_0x588587);MailQueueEvents['on'](_0x25b63a,_0x4bd156);}}; \ No newline at end of file +var _0x45eb=['remove','update','emit','removeListener','register','length','mailQueue:','./mailQueue.events','save'];(function(_0xcdea3,_0x21cc0b){var _0x4a54be=function(_0x263464){while(--_0x263464){_0xcdea3['push'](_0xcdea3['shift']());}};_0x4a54be(++_0x21cc0b);}(_0x45eb,0xc4));var _0xb45e=function(_0x2de2e3,_0x4c11dc){_0x2de2e3=_0x2de2e3-0x0;var _0x2d632b=_0x45eb[_0x2de2e3];return _0x2d632b;};'use strict';var MailQueueEvents=require(_0xb45e('0x0'));var events=[_0xb45e('0x1'),_0xb45e('0x2'),_0xb45e('0x3')];function createListener(_0x9dd904,_0x536a3d){return function(_0x1afb1a){_0x536a3d[_0xb45e('0x4')](_0x9dd904,_0x1afb1a);};}function removeListener(_0x5e39b,_0x2ae453){return function(){MailQueueEvents[_0xb45e('0x5')](_0x5e39b,_0x2ae453);};}exports[_0xb45e('0x6')]=function(_0x2dfa3e){for(var _0xab2812=0x0,_0x3169fe=events[_0xb45e('0x7')];_0xab2812<_0x3169fe;_0xab2812++){var _0xa12282=events[_0xab2812];var _0x1a6bd8=createListener(_0xb45e('0x8')+_0xa12282,_0x2dfa3e);MailQueueEvents['on'](_0xa12282,_0x1a6bd8);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index 41f53e3..42c8983 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 _0x2664=['get','post','isAuthenticated','create','put','/:id','update','destroy','exports','multer','util','express','Router','../../components/auth/service','../../config/environment','/describe','describe'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x2664,0x13b));var _0x4266=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x2664[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require(_0x4266('0x0'));var util=require(_0x4266('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x4266('0x2'));var router=express[_0x4266('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x4266('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x4266('0x5'));var controller=require('./mailQueueReport.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x4266('0x6'),auth['isAuthenticated'](),controller[_0x4266('0x7')]);router[_0x4266('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x4266('0x9')]('/',auth[_0x4266('0xa')](),controller[_0x4266('0xb')]);router[_0x4266('0xc')](_0x4266('0xd'),auth[_0x4266('0xa')](),controller[_0x4266('0xe')]);router['delete'](_0x4266('0xd'),auth[_0x4266('0xa')](),controller[_0x4266('0xf')]);module[_0x4266('0x10')]=router; \ No newline at end of file +var _0x969f=['/describe','isAuthenticated','describe','show','post','create','put','update','delete','destroy','exports','multer','util','express','../../components/auth/service','./mailQueueReport.controller','get','index'];(function(_0x3198b5,_0x564ac4){var _0x5baf7f=function(_0x5bce27){while(--_0x5bce27){_0x3198b5['push'](_0x3198b5['shift']());}};_0x5baf7f(++_0x564ac4);}(_0x969f,0x197));var _0xf969=function(_0x363319,_0x4fa1a1){_0x363319=_0x363319-0x0;var _0x182a62=_0x969f[_0x363319];return _0x182a62;};'use strict';var multer=require(_0xf969('0x0'));var util=require(_0xf969('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xf969('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xf969('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf969('0x4'));router[_0xf969('0x5')]('/',auth['isAuthenticated'](),controller[_0xf969('0x6')]);router[_0xf969('0x5')](_0xf969('0x7'),auth[_0xf969('0x8')](),controller[_0xf969('0x9')]);router[_0xf969('0x5')]('/:id',auth[_0xf969('0x8')](),controller[_0xf969('0xa')]);router[_0xf969('0xb')]('/',auth['isAuthenticated'](),controller[_0xf969('0xc')]);router[_0xf969('0xd')]('/:id',auth[_0xf969('0x8')](),controller[_0xf969('0xe')]);router[_0xf969('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xf969('0x10')]);module[_0xf969('0x11')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index dbb03ec..529d551 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 _0xd17f=['moment','sequelize','exports','STRING','DATE'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd17f,0x10e));var _0xfd17=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xd17f[_0xbca1b1];return _0x4e1686;};'use strict';var moment=require(_0xfd17('0x0'));var Sequelize=require(_0xfd17('0x1'));module[_0xfd17('0x2')]={'uniqueid':{'type':Sequelize[_0xfd17('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xfd17('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xfd17('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xfd17('0x3')]}}; \ No newline at end of file +var _0xc2a2=['moment','sequelize','STRING','DATE'];(function(_0x33b4f,_0x415988){var _0x1919c6=function(_0x26077f){while(--_0x26077f){_0x33b4f['push'](_0x33b4f['shift']());}};_0x1919c6(++_0x415988);}(_0xc2a2,0x98));var _0x2c2a=function(_0x549b73,_0x4612db){_0x549b73=_0x549b73-0x0;var _0x43684d=_0xc2a2[_0x549b73];return _0x43684d;};'use strict';var moment=require(_0x2c2a('0x0'));var Sequelize=require(_0x2c2a('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x2c2a('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x2c2a('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x2c2a('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index f1ed34f..540ed9c 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 _0x4325=['attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','MailQueueReport','findAll','catch','show','params','include','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','util','path','sox','ejs','fs-extra','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0x4325,0x1da));var _0x5432=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x4325[_0x4b369d];return _0x571a98;};'use strict';var emlformat=require(_0x5432('0x0'));var rimraf=require(_0x5432('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5432('0x2'));var rp=require(_0x5432('0x3'));var moment=require(_0x5432('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5432('0x5'));var path=require(_0x5432('0x6'));var sox=require(_0x5432('0x7'));var csv=require('to-csv');var ejs=require(_0x5432('0x8'));var fs=require('fs');var fs_extra=require(_0x5432('0x9'));var _=require('lodash');var squel=require(_0x5432('0xa'));var crypto=require('crypto');var jsforce=require(_0x5432('0xb'));var deskjs=require(_0x5432('0xc'));var toCsv=require(_0x5432('0xd'));var querystring=require(_0x5432('0xe'));var Papa=require(_0x5432('0xf'));var Redis=require('ioredis');var authService=require(_0x5432('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x5432('0x11'));var hardwareService=require(_0x5432('0x12'));var logger=require(_0x5432('0x13'))(_0x5432('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5432('0x15'));var db=require(_0x5432('0x16'))['db'];function respondWithStatusCode(_0x5366a0,_0x10a289){_0x10a289=_0x10a289||0xcc;return function(_0x111c54){if(_0x111c54){return _0x5366a0[_0x5432('0x17')](_0x10a289);}return _0x5366a0[_0x5432('0x18')](_0x10a289)[_0x5432('0x19')]();};}function respondWithResult(_0x1a084d,_0x54f41a){_0x54f41a=_0x54f41a||0xc8;return function(_0x5617ce){if(_0x5617ce){return _0x1a084d[_0x5432('0x18')](_0x54f41a)[_0x5432('0x1a')](_0x5617ce);}};}function respondWithFilteredResult(_0x3859d1,_0x364152){return function(_0x9d2023){if(_0x9d2023){var _0x11db3c=typeof _0x364152['offset']===_0x5432('0x1b')&&typeof _0x364152['limit']===_0x5432('0x1b');var _0x3de07a=_0x9d2023[_0x5432('0x1c')];var _0x32fe60=_0x11db3c?0x0:_0x364152[_0x5432('0x1d')];var _0x5f011f=_0x11db3c?_0x9d2023[_0x5432('0x1c')]:_0x364152[_0x5432('0x1d')]+_0x364152[_0x5432('0x1e')];var _0x2bfe04;if(_0x5f011f>=_0x3de07a){_0x5f011f=_0x3de07a;_0x2bfe04=0xc8;}else{_0x2bfe04=0xce;}_0x3859d1[_0x5432('0x18')](_0x2bfe04);return _0x3859d1[_0x5432('0x1f')](_0x5432('0x20'),_0x32fe60+'-'+_0x5f011f+'/'+_0x3de07a)['json'](_0x9d2023);}return null;};}function patchUpdates(_0x66911a){return function(_0x29cde7){try{jsonpatch[_0x5432('0x21')](_0x29cde7,_0x66911a,!![]);}catch(_0xa6c864){return BPromise[_0x5432('0x22')](_0xa6c864);}return _0x29cde7['save']();};}function saveUpdates(_0x5901e2,_0x4d09cd){return function(_0x61827e){if(_0x61827e){return _0x61827e[_0x5432('0x23')](_0x5901e2)[_0x5432('0x24')](function(_0x1f4870){return _0x1f4870;});}return null;};}function removeEntity(_0x4af9f6,_0x4af5f4){return function(_0x3e0b66){if(_0x3e0b66){return _0x3e0b66[_0x5432('0x25')]()['then'](function(){_0x4af9f6[_0x5432('0x18')](0xcc)[_0x5432('0x19')]();});}};}function handleEntityNotFound(_0x637582,_0x4b6ea5){return function(_0xd9928a){if(!_0xd9928a){_0x637582[_0x5432('0x17')](0x194);}return _0xd9928a;};}function handleError(_0xe7eda2,_0x520da1){_0x520da1=_0x520da1||0x1f4;return function(_0x4ab09d){logger[_0x5432('0x26')](_0x4ab09d[_0x5432('0x27')]);if(_0x4ab09d['name']){delete _0x4ab09d[_0x5432('0x28')];}_0xe7eda2[_0x5432('0x18')](_0x520da1)[_0x5432('0x29')](_0x4ab09d);};}exports['index']=function(_0x29dc15,_0x5be867){var _0x4821be={},_0x6fc7f5={},_0x4a52ba={'count':0x0,'rows':[]};var _0x428141=_['map'](db['MailQueueReport'][_0x5432('0x2a')],function(_0x21735e){return{'name':_0x21735e[_0x5432('0x2b')],'type':_0x21735e['type'][_0x5432('0x2c')]};});_0x6fc7f5[_0x5432('0x2d')]=_[_0x5432('0x2e')](_0x428141,_0x5432('0x28'));_0x6fc7f5[_0x5432('0x2f')]=_[_0x5432('0x30')](_0x29dc15[_0x5432('0x2f')]);_0x6fc7f5[_0x5432('0x31')]=_[_0x5432('0x32')](_0x6fc7f5['model'],_0x6fc7f5['query']);_0x4821be[_0x5432('0x33')]=_[_0x5432('0x32')](_0x6fc7f5[_0x5432('0x2d')],qs[_0x5432('0x34')](_0x29dc15[_0x5432('0x2f')]['fields']));_0x4821be[_0x5432('0x33')]=_0x4821be['attributes'][_0x5432('0x35')]?_0x4821be[_0x5432('0x33')]:_0x6fc7f5[_0x5432('0x2d')];if(!_0x29dc15[_0x5432('0x2f')][_0x5432('0x36')](_0x5432('0x37'))){_0x4821be['limit']=qs[_0x5432('0x1e')](_0x29dc15[_0x5432('0x2f')][_0x5432('0x1e')]);_0x4821be[_0x5432('0x1d')]=qs['offset'](_0x29dc15[_0x5432('0x2f')][_0x5432('0x1d')]);}_0x4821be[_0x5432('0x38')]=qs[_0x5432('0x39')](_0x29dc15[_0x5432('0x2f')][_0x5432('0x39')]);_0x4821be[_0x5432('0x3a')]=qs[_0x5432('0x31')](_[_0x5432('0x3b')](_0x29dc15[_0x5432('0x2f')],_0x6fc7f5[_0x5432('0x31')]),_0x428141);if(_0x29dc15[_0x5432('0x2f')][_0x5432('0x3c')]){_0x4821be[_0x5432('0x3a')]=_['merge'](_0x4821be[_0x5432('0x3a')],{'$or':_['map'](_0x428141,function(_0x6f5006){if(_0x6f5006[_0x5432('0x3d')]!==_0x5432('0x3e')){var _0x1a5561={};_0x1a5561[_0x6f5006['name']]={'$like':'%'+_0x29dc15['query']['filter']+'%'};return _0x1a5561;}})});}_0x4821be=_[_0x5432('0x3f')]({},_0x4821be,_0x29dc15[_0x5432('0x40')]);var _0x139d0a={'where':_0x4821be[_0x5432('0x3a')]};return db['MailQueueReport'][_0x5432('0x1c')](_0x139d0a)[_0x5432('0x24')](function(_0x3cd343){_0x4a52ba['count']=_0x3cd343;if(_0x29dc15[_0x5432('0x2f')][_0x5432('0x41')]){_0x4821be['include']=[{'all':!![]}];}return db[_0x5432('0x42')][_0x5432('0x43')](_0x4821be);})['then'](function(_0x23f8f4){_0x4a52ba['rows']=_0x23f8f4;return _0x4a52ba;})[_0x5432('0x24')](respondWithFilteredResult(_0x5be867,_0x4821be))[_0x5432('0x44')](handleError(_0x5be867,null));};exports[_0x5432('0x45')]=function(_0x11c7f2,_0x5cf59a){var _0x9cfb8b={'raw':!![],'where':{'id':_0x11c7f2[_0x5432('0x46')]['id']}},_0x4b93b4={};_0x4b93b4[_0x5432('0x2d')]=_[_0x5432('0x30')](db[_0x5432('0x42')][_0x5432('0x2a')]);_0x4b93b4[_0x5432('0x2f')]=_[_0x5432('0x30')](_0x11c7f2['query']);_0x4b93b4[_0x5432('0x31')]=_[_0x5432('0x32')](_0x4b93b4[_0x5432('0x2d')],_0x4b93b4[_0x5432('0x2f')]);_0x9cfb8b[_0x5432('0x33')]=_[_0x5432('0x32')](_0x4b93b4[_0x5432('0x2d')],qs['fields'](_0x11c7f2[_0x5432('0x2f')][_0x5432('0x34')]));_0x9cfb8b[_0x5432('0x33')]=_0x9cfb8b[_0x5432('0x33')][_0x5432('0x35')]?_0x9cfb8b['attributes']:_0x4b93b4[_0x5432('0x2d')];if(_0x11c7f2['query'][_0x5432('0x41')]){_0x9cfb8b[_0x5432('0x47')]=[{'all':!![]}];}_0x9cfb8b=_['merge']({},_0x9cfb8b,_0x11c7f2[_0x5432('0x40')]);return db['MailQueueReport'][_0x5432('0x48')](_0x9cfb8b)[_0x5432('0x24')](handleEntityNotFound(_0x5cf59a,null))['then'](respondWithResult(_0x5cf59a,null))['catch'](handleError(_0x5cf59a,null));};exports[_0x5432('0x49')]=function(_0xa971bd,_0x3718be){return db[_0x5432('0x42')][_0x5432('0x49')](_0xa971bd[_0x5432('0x4a')],{})[_0x5432('0x24')](respondWithResult(_0x3718be,0xc9))['catch'](handleError(_0x3718be,null));};exports[_0x5432('0x23')]=function(_0x14763c,_0x429da8){if(_0x14763c['body']['id']){delete _0x14763c['body']['id'];}return db['MailQueueReport']['find']({'where':{'id':_0x14763c[_0x5432('0x46')]['id']}})[_0x5432('0x24')](handleEntityNotFound(_0x429da8,null))[_0x5432('0x24')](saveUpdates(_0x14763c[_0x5432('0x4a')],null))[_0x5432('0x24')](respondWithResult(_0x429da8,null))['catch'](handleError(_0x429da8,null));};exports[_0x5432('0x25')]=function(_0xce691b,_0x7937f9){return db['MailQueueReport'][_0x5432('0x48')]({'where':{'id':_0xce691b[_0x5432('0x46')]['id']}})[_0x5432('0x24')](handleEntityNotFound(_0x7937f9,null))[_0x5432('0x24')](removeEntity(_0x7937f9,null))[_0x5432('0x44')](handleError(_0x7937f9,null));};exports['describe']=function(_0xbcf523,_0x5bbedb){return db[_0x5432('0x42')]['describe']()[_0x5432('0x24')](respondWithResult(_0x5bbedb,null))[_0x5432('0x44')](handleError(_0x5bbedb,null));}; \ No newline at end of file +var _0x958a=['sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','MailQueueReport','include','findAll','rows','catch','show','params','keys','includeAll','create','body','find','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0x958a,0x128));var _0xa958=function(_0x15df48,_0x2dda25){_0x15df48=_0x15df48-0x0;var _0x4f23df=_0x958a[_0x15df48];return _0x4f23df;};'use strict';var emlformat=require(_0xa958('0x0'));var rimraf=require(_0xa958('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa958('0x2'));var rp=require(_0xa958('0x3'));var moment=require(_0xa958('0x4'));var BPromise=require(_0xa958('0x5'));var Mustache=require(_0xa958('0x6'));var util=require('util');var path=require(_0xa958('0x7'));var sox=require('sox');var csv=require(_0xa958('0x8'));var ejs=require(_0xa958('0x9'));var fs=require('fs');var fs_extra=require(_0xa958('0xa'));var _=require(_0xa958('0xb'));var squel=require(_0xa958('0xc'));var crypto=require(_0xa958('0xd'));var jsforce=require(_0xa958('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xa958('0xf'));var Papa=require(_0xa958('0x10'));var Redis=require(_0xa958('0x11'));var authService=require(_0xa958('0x12'));var qs=require(_0xa958('0x13'));var as=require(_0xa958('0x14'));var hardwareService=require(_0xa958('0x15'));var logger=require(_0xa958('0x16'))(_0xa958('0x17'));var utils=require(_0xa958('0x18'));var config=require(_0xa958('0x19'));var licenseUtil=require(_0xa958('0x1a'));var db=require(_0xa958('0x1b'))['db'];function respondWithStatusCode(_0x53bf27,_0x5063ae){_0x5063ae=_0x5063ae||0xcc;return function(_0x5bcc66){if(_0x5bcc66){return _0x53bf27[_0xa958('0x1c')](_0x5063ae);}return _0x53bf27[_0xa958('0x1d')](_0x5063ae)[_0xa958('0x1e')]();};}function respondWithResult(_0x591d4d,_0x3ebc66){_0x3ebc66=_0x3ebc66||0xc8;return function(_0x54c439){if(_0x54c439){return _0x591d4d['status'](_0x3ebc66)['json'](_0x54c439);}};}function respondWithFilteredResult(_0x1fe41e,_0x15fca8){return function(_0xb90ac6){if(_0xb90ac6){var _0x6a81c7=typeof _0x15fca8[_0xa958('0x1f')]===_0xa958('0x20')&&typeof _0x15fca8[_0xa958('0x21')]===_0xa958('0x20');var _0x4d836f=_0xb90ac6[_0xa958('0x22')];var _0x4eadc9=_0x6a81c7?0x0:_0x15fca8[_0xa958('0x1f')];var _0x70d13e=_0x6a81c7?_0xb90ac6['count']:_0x15fca8[_0xa958('0x1f')]+_0x15fca8[_0xa958('0x21')];var _0x47636f;if(_0x70d13e>=_0x4d836f){_0x70d13e=_0x4d836f;_0x47636f=0xc8;}else{_0x47636f=0xce;}_0x1fe41e[_0xa958('0x1d')](_0x47636f);return _0x1fe41e[_0xa958('0x23')](_0xa958('0x24'),_0x4eadc9+'-'+_0x70d13e+'/'+_0x4d836f)['json'](_0xb90ac6);}return null;};}function patchUpdates(_0x4a90c2){return function(_0x373661){try{jsonpatch[_0xa958('0x25')](_0x373661,_0x4a90c2,!![]);}catch(_0x16c0be){return BPromise['reject'](_0x16c0be);}return _0x373661[_0xa958('0x26')]();};}function saveUpdates(_0x383aa3,_0x5c091a){return function(_0x28cf12){if(_0x28cf12){return _0x28cf12[_0xa958('0x27')](_0x383aa3)['then'](function(_0x5c5a2b){return _0x5c5a2b;});}return null;};}function removeEntity(_0x201ed3,_0x40b51e){return function(_0x50b3c3){if(_0x50b3c3){return _0x50b3c3[_0xa958('0x28')]()[_0xa958('0x29')](function(){_0x201ed3[_0xa958('0x1d')](0xcc)[_0xa958('0x1e')]();});}};}function handleEntityNotFound(_0x16b04a,_0xf1436e){return function(_0x50fdb1){if(!_0x50fdb1){_0x16b04a[_0xa958('0x1c')](0x194);}return _0x50fdb1;};}function handleError(_0x48ef34,_0x43df63){_0x43df63=_0x43df63||0x1f4;return function(_0x3c2ea3){logger[_0xa958('0x2a')](_0x3c2ea3[_0xa958('0x2b')]);if(_0x3c2ea3[_0xa958('0x2c')]){delete _0x3c2ea3[_0xa958('0x2c')];}_0x48ef34[_0xa958('0x1d')](_0x43df63)[_0xa958('0x2d')](_0x3c2ea3);};}exports[_0xa958('0x2e')]=function(_0x404d07,_0x4c4c37){var _0x47895c={},_0xd2fcc9={},_0x4ef4f6={'count':0x0,'rows':[]};var _0x1febd2=_[_0xa958('0x2f')](db['MailQueueReport'][_0xa958('0x30')],function(_0x3d4711){return{'name':_0x3d4711[_0xa958('0x31')],'type':_0x3d4711[_0xa958('0x32')][_0xa958('0x33')]};});_0xd2fcc9['model']=_['map'](_0x1febd2,_0xa958('0x2c'));_0xd2fcc9['query']=_['keys'](_0x404d07[_0xa958('0x34')]);_0xd2fcc9[_0xa958('0x35')]=_[_0xa958('0x36')](_0xd2fcc9[_0xa958('0x37')],_0xd2fcc9[_0xa958('0x34')]);_0x47895c[_0xa958('0x38')]=_['intersection'](_0xd2fcc9[_0xa958('0x37')],qs['fields'](_0x404d07['query'][_0xa958('0x39')]));_0x47895c[_0xa958('0x38')]=_0x47895c[_0xa958('0x38')][_0xa958('0x3a')]?_0x47895c[_0xa958('0x38')]:_0xd2fcc9[_0xa958('0x37')];if(!_0x404d07[_0xa958('0x34')][_0xa958('0x3b')]('nolimit')){_0x47895c['limit']=qs[_0xa958('0x21')](_0x404d07[_0xa958('0x34')][_0xa958('0x21')]);_0x47895c[_0xa958('0x1f')]=qs[_0xa958('0x1f')](_0x404d07['query'][_0xa958('0x1f')]);}_0x47895c[_0xa958('0x3c')]=qs[_0xa958('0x3d')](_0x404d07[_0xa958('0x34')]['sort']);_0x47895c[_0xa958('0x3e')]=qs[_0xa958('0x35')](_[_0xa958('0x3f')](_0x404d07[_0xa958('0x34')],_0xd2fcc9[_0xa958('0x35')]),_0x1febd2);if(_0x404d07['query'][_0xa958('0x40')]){_0x47895c[_0xa958('0x3e')]=_[_0xa958('0x41')](_0x47895c[_0xa958('0x3e')],{'$or':_[_0xa958('0x2f')](_0x1febd2,function(_0x45603f){if(_0x45603f[_0xa958('0x32')]!==_0xa958('0x42')){var _0x2378df={};_0x2378df[_0x45603f[_0xa958('0x2c')]]={'$like':'%'+_0x404d07['query'][_0xa958('0x40')]+'%'};return _0x2378df;}})});}_0x47895c=_[_0xa958('0x41')]({},_0x47895c,_0x404d07[_0xa958('0x43')]);var _0x5d5ae1={'where':_0x47895c[_0xa958('0x3e')]};return db[_0xa958('0x44')]['count'](_0x5d5ae1)['then'](function(_0x53710e){_0x4ef4f6['count']=_0x53710e;if(_0x404d07[_0xa958('0x34')]['includeAll']){_0x47895c[_0xa958('0x45')]=[{'all':!![]}];}return db['MailQueueReport'][_0xa958('0x46')](_0x47895c);})[_0xa958('0x29')](function(_0x44fa44){_0x4ef4f6[_0xa958('0x47')]=_0x44fa44;return _0x4ef4f6;})[_0xa958('0x29')](respondWithFilteredResult(_0x4c4c37,_0x47895c))[_0xa958('0x48')](handleError(_0x4c4c37,null));};exports[_0xa958('0x49')]=function(_0x18f110,_0x517319){var _0x10e4ee={'raw':!![],'where':{'id':_0x18f110[_0xa958('0x4a')]['id']}},_0x38dfb4={};_0x38dfb4['model']=_['keys'](db['MailQueueReport'][_0xa958('0x30')]);_0x38dfb4[_0xa958('0x34')]=_[_0xa958('0x4b')](_0x18f110[_0xa958('0x34')]);_0x38dfb4[_0xa958('0x35')]=_['intersection'](_0x38dfb4[_0xa958('0x37')],_0x38dfb4[_0xa958('0x34')]);_0x10e4ee[_0xa958('0x38')]=_[_0xa958('0x36')](_0x38dfb4[_0xa958('0x37')],qs[_0xa958('0x39')](_0x18f110[_0xa958('0x34')][_0xa958('0x39')]));_0x10e4ee[_0xa958('0x38')]=_0x10e4ee[_0xa958('0x38')][_0xa958('0x3a')]?_0x10e4ee[_0xa958('0x38')]:_0x38dfb4[_0xa958('0x37')];if(_0x18f110[_0xa958('0x34')][_0xa958('0x4c')]){_0x10e4ee[_0xa958('0x45')]=[{'all':!![]}];}_0x10e4ee=_[_0xa958('0x41')]({},_0x10e4ee,_0x18f110['options']);return db['MailQueueReport']['find'](_0x10e4ee)[_0xa958('0x29')](handleEntityNotFound(_0x517319,null))[_0xa958('0x29')](respondWithResult(_0x517319,null))[_0xa958('0x48')](handleError(_0x517319,null));};exports[_0xa958('0x4d')]=function(_0x55ab45,_0x34faa2){return db[_0xa958('0x44')][_0xa958('0x4d')](_0x55ab45[_0xa958('0x4e')],{})[_0xa958('0x29')](respondWithResult(_0x34faa2,0xc9))['catch'](handleError(_0x34faa2,null));};exports[_0xa958('0x27')]=function(_0x2bbb2e,_0x3f8407){if(_0x2bbb2e['body']['id']){delete _0x2bbb2e[_0xa958('0x4e')]['id'];}return db['MailQueueReport'][_0xa958('0x4f')]({'where':{'id':_0x2bbb2e[_0xa958('0x4a')]['id']}})[_0xa958('0x29')](handleEntityNotFound(_0x3f8407,null))['then'](saveUpdates(_0x2bbb2e[_0xa958('0x4e')],null))['then'](respondWithResult(_0x3f8407,null))[_0xa958('0x48')](handleError(_0x3f8407,null));};exports[_0xa958('0x28')]=function(_0x85fc0d,_0x402d0a){return db[_0xa958('0x44')]['find']({'where':{'id':_0x85fc0d[_0xa958('0x4a')]['id']}})['then'](handleEntityNotFound(_0x402d0a,null))[_0xa958('0x29')](removeEntity(_0x402d0a,null))[_0xa958('0x48')](handleError(_0x402d0a,null));};exports['describe']=function(_0x17e4e7,_0x4f0a27){return db[_0xa958('0x44')][_0xa958('0x50')]()[_0xa958('0x29')](respondWithResult(_0x4f0a27,null))[_0xa958('0x48')](handleError(_0x4f0a27,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index f03c5d6..b682ee6 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 _0x0f7b=['exports','define','MailQueueReport','report_mail_queue','uniqueid','lodash','util','moment','bluebird','request-promise','path','../../config/environment','./mailQueueReport.attributes'];(function(_0x48d3fa,_0x3808a6){var _0x4c4995=function(_0x3fab11){while(--_0x3fab11){_0x48d3fa['push'](_0x48d3fa['shift']());}};_0x4c4995(++_0x3808a6);}(_0x0f7b,0x1a5));var _0xb0f7=function(_0x5ddaac,_0x2697a8){_0x5ddaac=_0x5ddaac-0x0;var _0x2a9c58=_0x0f7b[_0x5ddaac];return _0x2a9c58;};'use strict';var _=require(_0xb0f7('0x0'));var util=require(_0xb0f7('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xb0f7('0x2'));var BPromise=require(_0xb0f7('0x3'));var rp=require(_0xb0f7('0x4'));var fs=require('fs');var path=require(_0xb0f7('0x5'));var rimraf=require('rimraf');var config=require(_0xb0f7('0x6'));var attributes=require(_0xb0f7('0x7'));module[_0xb0f7('0x8')]=function(_0x2e3d45,_0x535f37){return _0x2e3d45[_0xb0f7('0x9')](_0xb0f7('0xa'),attributes,{'tableName':_0xb0f7('0xb'),'paranoid':![],'indexes':[{'name':_0xb0f7('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x3360=['rimraf','../../config/environment','./mailQueueReport.attributes','exports','define','MailQueueReport','report_mail_queue','uniqueid','lodash','util','../../config/logger','api','request-promise','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3360,0x1c8));var _0x0336=function(_0x3270f9,_0x407457){_0x3270f9=_0x3270f9-0x0;var _0x26006d=_0x3360[_0x3270f9];return _0x26006d;};'use strict';var _=require(_0x0336('0x0'));var util=require(_0x0336('0x1'));var logger=require(_0x0336('0x2'))(_0x0336('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0336('0x4'));var fs=require('fs');var path=require(_0x0336('0x5'));var rimraf=require(_0x0336('0x6'));var config=require(_0x0336('0x7'));var attributes=require(_0x0336('0x8'));module[_0x0336('0x9')]=function(_0x5b8d5a,_0x224b5a){return _0x5b8d5a[_0x0336('0xa')](_0x0336('0xb'),attributes,{'tableName':_0x0336('0xc'),'paranoid':![],'indexes':[{'name':_0x0336('0xd'),'fields':[_0x0336('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index fedf4c4..56fbe6d 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 _0xadb5=['MailQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateMailQueueReport','create','options','raw','debug','MailQueueReport','body','attributes','limit','UpdateMailQueueReport','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info'];(function(_0x4aa932,_0x251c95){var _0x62b42c=function(_0x53913b){while(--_0x53913b){_0x4aa932['push'](_0x4aa932['shift']());}};_0x62b42c(++_0x251c95);}(_0xadb5,0xad));var _0x5adb=function(_0x43d25c,_0x5b71fd){_0x43d25c=_0x43d25c-0x0;var _0x3d2f7e=_0xadb5[_0x43d25c];return _0x3d2f7e;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('MailQueueReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});}exports[_0x5adb('0x15')]=function(_0x529b65){var _0x3fff62=this;return new Promise(function(_0x5de028,_0x1d9e86){return db['MailQueueReport'][_0x5adb('0x16')](_0x529b65['body'],{'raw':_0x529b65['options']?_0x529b65[_0x5adb('0x17')][_0x5adb('0x18')]===undefined?!![]:![]:!![]})[_0x5adb('0xb')](function(_0x1fd4a7){logger[_0x5adb('0xc')]('CreateMailQueueReport',_0x529b65);logger[_0x5adb('0x19')]('CreateMailQueueReport',_0x529b65,JSON['stringify'](_0x1fd4a7));_0x5de028(_0x1fd4a7);})[_0x5adb('0x14')](function(_0x379b33){logger[_0x5adb('0x10')](_0x5adb('0x15'),_0x379b33[_0x5adb('0x12')],_0x529b65);_0x1d9e86(_0x3fff62[_0x5adb('0x10')](0x1f4,_0x379b33[_0x5adb('0x12')]));});});};exports['UpdateMailQueueReport']=function(_0x4b1957){var _0x373cc3=this;return new Promise(function(_0x3220cd,_0x3839fb){return db[_0x5adb('0x1a')]['update'](_0x4b1957[_0x5adb('0x1b')],{'raw':_0x4b1957[_0x5adb('0x17')]?_0x4b1957['options'][_0x5adb('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4b1957[_0x5adb('0x17')]?_0x4b1957[_0x5adb('0x17')]['where']||null:null,'attributes':_0x4b1957[_0x5adb('0x17')]?_0x4b1957[_0x5adb('0x17')][_0x5adb('0x1c')]||null:null,'limit':_0x4b1957[_0x5adb('0x17')]?_0x4b1957[_0x5adb('0x17')][_0x5adb('0x1d')]||null:null})['then'](function(_0x49992e){logger['info'](_0x5adb('0x1e'),_0x4b1957);logger[_0x5adb('0x19')](_0x5adb('0x1e'),_0x4b1957,JSON[_0x5adb('0xf')](_0x49992e));_0x3220cd(_0x49992e);})[_0x5adb('0x14')](function(_0x4de310){logger[_0x5adb('0x10')](_0x5adb('0x1e'),_0x4de310[_0x5adb('0x12')],_0x4b1957);_0x3839fb(_0x373cc3[_0x5adb('0x10')](0x1f4,_0x4de310[_0x5adb('0x12')]));});});}; \ No newline at end of file +var _0xadb5=['MailQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateMailQueueReport','create','options','raw','debug','MailQueueReport','body','attributes','limit','UpdateMailQueueReport','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info'];(function(_0x342869,_0x49b132){var _0x5ef3b2=function(_0x48b45a){while(--_0x48b45a){_0x342869['push'](_0x342869['shift']());}};_0x5ef3b2(++_0x49b132);}(_0xadb5,0xad));var _0x5adb=function(_0x12dc4d,_0x3ab286){_0x12dc4d=_0x12dc4d-0x0;var _0xb1ef5a=_0xadb5[_0x12dc4d];return _0xb1ef5a;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('MailQueueReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});}exports[_0x5adb('0x15')]=function(_0x529b65){var _0x3fff62=this;return new Promise(function(_0x5de028,_0x1d9e86){return db['MailQueueReport'][_0x5adb('0x16')](_0x529b65['body'],{'raw':_0x529b65['options']?_0x529b65[_0x5adb('0x17')][_0x5adb('0x18')]===undefined?!![]:![]:!![]})[_0x5adb('0xb')](function(_0x1fd4a7){logger[_0x5adb('0xc')]('CreateMailQueueReport',_0x529b65);logger[_0x5adb('0x19')]('CreateMailQueueReport',_0x529b65,JSON['stringify'](_0x1fd4a7));_0x5de028(_0x1fd4a7);})[_0x5adb('0x14')](function(_0x379b33){logger[_0x5adb('0x10')](_0x5adb('0x15'),_0x379b33[_0x5adb('0x12')],_0x529b65);_0x1d9e86(_0x3fff62[_0x5adb('0x10')](0x1f4,_0x379b33[_0x5adb('0x12')]));});});};exports['UpdateMailQueueReport']=function(_0x4b1957){var _0x373cc3=this;return new Promise(function(_0x3220cd,_0x3839fb){return db[_0x5adb('0x1a')]['update'](_0x4b1957[_0x5adb('0x1b')],{'raw':_0x4b1957[_0x5adb('0x17')]?_0x4b1957['options'][_0x5adb('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4b1957[_0x5adb('0x17')]?_0x4b1957[_0x5adb('0x17')]['where']||null:null,'attributes':_0x4b1957[_0x5adb('0x17')]?_0x4b1957[_0x5adb('0x17')][_0x5adb('0x1c')]||null:null,'limit':_0x4b1957[_0x5adb('0x17')]?_0x4b1957[_0x5adb('0x17')][_0x5adb('0x1d')]||null:null})['then'](function(_0x49992e){logger['info'](_0x5adb('0x1e'),_0x4b1957);logger[_0x5adb('0x19')](_0x5adb('0x1e'),_0x4b1957,JSON[_0x5adb('0xf')](_0x49992e));_0x3220cd(_0x49992e);})[_0x5adb('0x14')](function(_0x4de310){logger[_0x5adb('0x10')](_0x5adb('0x1e'),_0x4de310[_0x5adb('0x12')],_0x4b1957);_0x3839fb(_0x373cc3[_0x5adb('0x10')](0x1f4,_0x4de310[_0x5adb('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index 79e9f7f..01da451 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x384a33,_0x5b6ee9){var _0x5ce999=function(_0x7eb9e5){while(--_0x7eb9e5){_0x384a33['push'](_0x384a33['shift']());}};_0x5ce999(++_0x5b6ee9);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x40176b,_0x168e9f){var _0x874f78=function(_0x241b18){while(--_0x241b18){_0x40176b['push'](_0x40176b['shift']());}};_0x874f78(++_0x168e9f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xa9e0[_0x2a6809];return _0x11c371;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index 8f989ce..c734228 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 _0x351d=['sequelize','STRING','BOOLEAN','INTEGER'];(function(_0x529b3a,_0x30bed5){var _0x1a712e=function(_0x52e8ef){while(--_0x52e8ef){_0x529b3a['push'](_0x529b3a['shift']());}};_0x1a712e(++_0x30bed5);}(_0x351d,0x90));var _0xd351=function(_0x3f3614,_0x5c0595){_0x3f3614=_0x3f3614-0x0;var _0x206c8f=_0x351d[_0x3f3614];return _0x206c8f;};'use strict';var Sequelize=require(_0xd351('0x0'));module['exports']={'description':{'type':Sequelize[_0xd351('0x1')]},'host':{'type':Sequelize[_0xd351('0x1')]},'authentication':{'type':Sequelize[_0xd351('0x2')],'defaultValue':!![]},'user':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xd351('0x1')]},'port':{'type':Sequelize['INTEGER']},'tls':{'type':Sequelize[_0xd351('0x2')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0xd351('0x1')],'defaultValue':'INBOX'},'connTimeout':{'type':Sequelize[_0xd351('0x3')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0xd351('0x3')],'defaultValue':0x5},'service':{'type':Sequelize[_0xd351('0x1')]}}; \ No newline at end of file +var _0x9b87=['STRING','BOOLEAN','INTEGER','INBOX','sequelize','exports'];(function(_0xdd82b4,_0x5cd8b8){var _0x549bb2=function(_0x426fd9){while(--_0x426fd9){_0xdd82b4['push'](_0xdd82b4['shift']());}};_0x549bb2(++_0x5cd8b8);}(_0x9b87,0x8e));var _0x79b8=function(_0xdeb8d2,_0x5cbbb3){_0xdeb8d2=_0xdeb8d2-0x0;var _0x19f939=_0x9b87[_0xdeb8d2];return _0x19f939;};'use strict';var Sequelize=require(_0x79b8('0x0'));module[_0x79b8('0x1')]={'description':{'type':Sequelize[_0x79b8('0x2')]},'host':{'type':Sequelize[_0x79b8('0x2')]},'authentication':{'type':Sequelize[_0x79b8('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0x79b8('0x2')]},'password':{'type':Sequelize[_0x79b8('0x2')]},'port':{'type':Sequelize[_0x79b8('0x4')]},'tls':{'type':Sequelize[_0x79b8('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x79b8('0x2')],'defaultValue':_0x79b8('0x5')},'connTimeout':{'type':Sequelize[_0x79b8('0x4')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x79b8('0x4')],'defaultValue':0x5},'service':{'type':Sequelize[_0x79b8('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index 1d619b6..e057006 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 _0x8dd3=['MailServerIn','util','api','bluebird','path','../../config/environment','./mailServerIn.attributes','exports','define'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8dd3,0x133));var _0x38dd=function(_0x5667cd,_0x232918){_0x5667cd=_0x5667cd-0x0;var _0x1b2a2f=_0x8dd3[_0x5667cd];return _0x1b2a2f;};'use strict';var _=require('lodash');var util=require(_0x38dd('0x0'));var logger=require('../../config/logger')(_0x38dd('0x1'));var moment=require('moment');var BPromise=require(_0x38dd('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x38dd('0x3'));var rimraf=require('rimraf');var config=require(_0x38dd('0x4'));var attributes=require(_0x38dd('0x5'));module[_0x38dd('0x6')]=function(_0x40f0b,_0x332b5b){return _0x40f0b[_0x38dd('0x7')](_0x38dd('0x8'),attributes,{'tableName':'mail_servers_in','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x56d7=['./mailServerIn.attributes','exports','define','MailServerIn','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x1b5838,_0x25ec5b){var _0x213065=function(_0xde01bf){while(--_0xde01bf){_0x1b5838['push'](_0x1b5838['shift']());}};_0x213065(++_0x25ec5b);}(_0x56d7,0xe0));var _0x756d=function(_0x12e31d,_0x4b76fb){_0x12e31d=_0x12e31d-0x0;var _0x506d58=_0x56d7[_0x12e31d];return _0x506d58;};'use strict';var _=require('lodash');var util=require(_0x756d('0x0'));var logger=require(_0x756d('0x1'))('api');var moment=require(_0x756d('0x2'));var BPromise=require(_0x756d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x756d('0x4'));var rimraf=require(_0x756d('0x5'));var config=require(_0x756d('0x6'));var attributes=require(_0x756d('0x7'));module[_0x756d('0x8')]=function(_0x21effd,_0x9d291c){return _0x21effd[_0x756d('0x9')](_0x756d('0xa'),attributes,{'tableName':'mail_servers_in','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.rpc.js b/server/api/mailServerIn/mailServerIn.rpc.js index 36b78c0..035566b 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 _0x2ceb=['../../config/logger','../../config/environment','jayson/promise','http','info','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','MailServerIn,\x20%s,\x20%s','message','result','catch','GetMailServerIn','MailServerIn','findAll','options','attributes','limit','include','model','map','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x2bac87,_0x3b314b){var _0x3cc409=function(_0x3612c6){while(--_0x3612c6){_0x2bac87['push'](_0x2bac87['shift']());}};_0x3cc409(++_0x3b314b);}(_0x2ceb,0x110));var _0xb2ce=function(_0x23f85a,_0x379559){_0x23f85a=_0x23f85a-0x0;var _0xb017d=_0x2ceb[_0x23f85a];return _0xb017d;};'use strict';var _=require(_0xb2ce('0x0'));var util=require(_0xb2ce('0x1'));var moment=require('moment');var BPromise=require(_0xb2ce('0x2'));var rs=require(_0xb2ce('0x3'));var fs=require('fs');var Redis=require(_0xb2ce('0x4'));var db=require(_0xb2ce('0x5'))['db'];var utils=require(_0xb2ce('0x6'));var logger=require(_0xb2ce('0x7'))('rpc');var config=require(_0xb2ce('0x8'));var jayson=require(_0xb2ce('0x9'));var client=jayson['client'][_0xb2ce('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3dfaee,_0x51040c,_0x39120a){return new BPromise(function(_0x9fb07c,_0x10c67c){return client['request'](_0x3dfaee,_0x39120a)['then'](function(_0x17f7da){logger[_0xb2ce('0xb')]('MailServerIn,\x20%s,\x20%s',_0x51040c,_0xb2ce('0xc'));logger[_0xb2ce('0xd')](_0xb2ce('0xe'),_0x51040c,_0xb2ce('0xc'),JSON[_0xb2ce('0xf')](_0x17f7da));if(_0x17f7da[_0xb2ce('0x10')]){if(_0x17f7da['error'][_0xb2ce('0x11')]===0x1f4){logger[_0xb2ce('0x10')](_0xb2ce('0x12'),_0x51040c,_0x17f7da[_0xb2ce('0x10')][_0xb2ce('0x13')]);return _0x10c67c(_0x17f7da['error']['message']);}logger[_0xb2ce('0x10')](_0xb2ce('0x12'),_0x51040c,_0x17f7da[_0xb2ce('0x10')][_0xb2ce('0x13')]);return _0x9fb07c(_0x17f7da[_0xb2ce('0x10')][_0xb2ce('0x13')]);}else{logger[_0xb2ce('0xb')](_0xb2ce('0x12'),_0x51040c,_0xb2ce('0xc'));_0x9fb07c(_0x17f7da[_0xb2ce('0x14')][_0xb2ce('0x13')]);}})[_0xb2ce('0x15')](function(_0x13ee00){logger[_0xb2ce('0x10')](_0xb2ce('0x12'),_0x51040c,_0x13ee00);_0x10c67c(_0x13ee00);});});}exports[_0xb2ce('0x16')]=function(_0x2e0336){var _0x3f135e=this;return new Promise(function(_0x2563f6,_0x3715d3){return db[_0xb2ce('0x17')][_0xb2ce('0x18')]({'raw':_0x2e0336[_0xb2ce('0x19')]?_0x2e0336[_0xb2ce('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x2e0336[_0xb2ce('0x19')]?_0x2e0336[_0xb2ce('0x19')]['where']||null:null,'attributes':_0x2e0336[_0xb2ce('0x19')]?_0x2e0336['options'][_0xb2ce('0x1a')]||null:null,'limit':_0x2e0336[_0xb2ce('0x19')]?_0x2e0336[_0xb2ce('0x19')][_0xb2ce('0x1b')]||null:null,'include':_0x2e0336['options']?_0x2e0336['options'][_0xb2ce('0x1c')]?_['map'](_0x2e0336[_0xb2ce('0x19')][_0xb2ce('0x1c')],function(_0x534806){return{'model':db[_0x534806[_0xb2ce('0x1d')]],'as':_0x534806['as'],'attributes':_0x534806[_0xb2ce('0x1a')],'include':_0x534806[_0xb2ce('0x1c')]?_[_0xb2ce('0x1e')](_0x534806[_0xb2ce('0x1c')],function(_0x4f547e){return{'model':db[_0x4f547e[_0xb2ce('0x1d')]],'as':_0x4f547e['as'],'attributes':_0x4f547e['attributes'],'include':_0x4f547e[_0xb2ce('0x1c')]?_['map'](_0x4f547e['include'],function(_0x367e18){return{'model':db[_0x367e18[_0xb2ce('0x1d')]],'as':_0x367e18['as'],'attributes':_0x367e18[_0xb2ce('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2354bf){logger[_0xb2ce('0xb')]('GetMailServerIn',_0x2e0336);logger[_0xb2ce('0xd')](_0xb2ce('0x16'),_0x2e0336,JSON[_0xb2ce('0xf')](_0x2354bf));_0x2563f6(_0x2354bf);})['catch'](function(_0x1add93){logger[_0xb2ce('0x10')](_0xb2ce('0x16'),_0x1add93[_0xb2ce('0x13')],_0x2e0336);_0x3715d3(_0x3f135e[_0xb2ce('0x10')](0x1f4,_0x1add93[_0xb2ce('0x13')]));});});}; \ No newline at end of file +var _0xf2f2=['stringify','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','findAll','options','raw','where','attributes','include','model','map','then','GetMailServerIn'];(function(_0x11c6b8,_0x5b2d7b){var _0x38b38f=function(_0x641ad0){while(--_0x641ad0){_0x11c6b8['push'](_0x11c6b8['shift']());}};_0x38b38f(++_0x5b2d7b);}(_0xf2f2,0x101));var _0x2f2f=function(_0x133e8d,_0x4648f1){_0x133e8d=_0x133e8d-0x0;var _0x10ce55=_0xf2f2[_0x133e8d];return _0x10ce55;};'use strict';var _=require(_0x2f2f('0x0'));var util=require('util');var moment=require(_0x2f2f('0x1'));var BPromise=require(_0x2f2f('0x2'));var rs=require(_0x2f2f('0x3'));var fs=require('fs');var Redis=require(_0x2f2f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2f2f('0x5'));var logger=require('../../config/logger')(_0x2f2f('0x6'));var config=require(_0x2f2f('0x7'));var jayson=require(_0x2f2f('0x8'));var client=jayson[_0x2f2f('0x9')][_0x2f2f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x34540d,_0x5d5438,_0x5a8100){return new BPromise(function(_0xc86ee6,_0x15f60c){return client['request'](_0x34540d,_0x5a8100)['then'](function(_0x4aae7c){logger[_0x2f2f('0xb')](_0x2f2f('0xc'),_0x5d5438,_0x2f2f('0xd'));logger[_0x2f2f('0xe')](_0x2f2f('0xf'),_0x5d5438,_0x2f2f('0xd'),JSON['stringify'](_0x4aae7c));if(_0x4aae7c[_0x2f2f('0x10')]){if(_0x4aae7c['error'][_0x2f2f('0x11')]===0x1f4){logger['error'](_0x2f2f('0xc'),_0x5d5438,_0x4aae7c[_0x2f2f('0x10')][_0x2f2f('0x12')]);return _0x15f60c(_0x4aae7c[_0x2f2f('0x10')][_0x2f2f('0x12')]);}logger['error'](_0x2f2f('0xc'),_0x5d5438,_0x4aae7c[_0x2f2f('0x10')][_0x2f2f('0x12')]);return _0xc86ee6(_0x4aae7c[_0x2f2f('0x10')][_0x2f2f('0x12')]);}else{logger[_0x2f2f('0xb')]('MailServerIn,\x20%s,\x20%s',_0x5d5438,_0x2f2f('0xd'));_0xc86ee6(_0x4aae7c[_0x2f2f('0x13')][_0x2f2f('0x12')]);}})[_0x2f2f('0x14')](function(_0x364336){logger[_0x2f2f('0x10')](_0x2f2f('0xc'),_0x5d5438,_0x364336);_0x15f60c(_0x364336);});});}exports['GetMailServerIn']=function(_0xdab861){var _0xd6b51b=this;return new Promise(function(_0x53a55c,_0x5034f0){return db['MailServerIn'][_0x2f2f('0x15')]({'raw':_0xdab861[_0x2f2f('0x16')]?_0xdab861[_0x2f2f('0x16')][_0x2f2f('0x17')]===undefined?!![]:![]:!![],'where':_0xdab861[_0x2f2f('0x16')]?_0xdab861[_0x2f2f('0x16')][_0x2f2f('0x18')]||null:null,'attributes':_0xdab861[_0x2f2f('0x16')]?_0xdab861['options'][_0x2f2f('0x19')]||null:null,'limit':_0xdab861[_0x2f2f('0x16')]?_0xdab861[_0x2f2f('0x16')]['limit']||null:null,'include':_0xdab861[_0x2f2f('0x16')]?_0xdab861[_0x2f2f('0x16')][_0x2f2f('0x1a')]?_['map'](_0xdab861['options'][_0x2f2f('0x1a')],function(_0x10a7e4){return{'model':db[_0x10a7e4[_0x2f2f('0x1b')]],'as':_0x10a7e4['as'],'attributes':_0x10a7e4[_0x2f2f('0x19')],'include':_0x10a7e4[_0x2f2f('0x1a')]?_[_0x2f2f('0x1c')](_0x10a7e4['include'],function(_0x43bffc){return{'model':db[_0x43bffc[_0x2f2f('0x1b')]],'as':_0x43bffc['as'],'attributes':_0x43bffc['attributes'],'include':_0x43bffc['include']?_[_0x2f2f('0x1c')](_0x43bffc['include'],function(_0x14448a){return{'model':db[_0x14448a[_0x2f2f('0x1b')]],'as':_0x14448a['as'],'attributes':_0x14448a['attributes']};}):[]};}):[]};}):[]:[]})[_0x2f2f('0x1d')](function(_0xe19fb9){logger[_0x2f2f('0xb')]('GetMailServerIn',_0xdab861);logger['debug'](_0x2f2f('0x1e'),_0xdab861,JSON[_0x2f2f('0x1f')](_0xe19fb9));_0x53a55c(_0xe19fb9);})[_0x2f2f('0x14')](function(_0x378dbe){logger[_0x2f2f('0x10')](_0x2f2f('0x1e'),_0x378dbe[_0x2f2f('0x12')],_0xdab861);_0x5034f0(_0xd6b51b['error'](0x1f4,_0x378dbe[_0x2f2f('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index 89eb0fa..5ad3545 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(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0x7a54,0x106));var _0x47a5=function(_0x85c32,_0x241a7d){_0x85c32=_0x85c32-0x0;var _0x5ddfee=_0x7a54[_0x85c32];return _0x5ddfee;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['update']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);module[_0x47a5('0x10')]=router; \ No newline at end of file +var _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailServerOut.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x1c546c,_0x5c57cb){var _0x2cc384=function(_0x4dee11){while(--_0x4dee11){_0x1c546c['push'](_0x1c546c['shift']());}};_0x2cc384(++_0x5c57cb);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.attributes.js b/server/api/mailServerOut/mailServerOut.attributes.js index b472ff9..e8909c4 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 _0x028a=['BOOLEAN','exports','STRING','INTEGER'];(function(_0x34e747,_0x173163){var _0x200a90=function(_0x2cfb42){while(--_0x2cfb42){_0x34e747['push'](_0x34e747['shift']());}};_0x200a90(++_0x173163);}(_0x028a,0x1b5));var _0xa028=function(_0x356c06,_0x18522f){_0x356c06=_0x356c06-0x0;var _0x2e71cf=_0x028a[_0x356c06];return _0x2e71cf;};'use strict';var Sequelize=require('sequelize');module[_0xa028('0x0')]={'description':{'type':Sequelize[_0xa028('0x1')]},'host':{'type':Sequelize[_0xa028('0x1')]},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize[_0xa028('0x1')]},'port':{'type':Sequelize[_0xa028('0x2')]},'secure':{'type':Sequelize[_0xa028('0x3')],'defaultValue':![]},'service':{'type':Sequelize[_0xa028('0x1')]},'authentication':{'type':Sequelize[_0xa028('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0xad0d=['exports','STRING','INTEGER','BOOLEAN','sequelize'];(function(_0x589d0c,_0xaeea04){var _0x1a73c2=function(_0x10da0a){while(--_0x10da0a){_0x589d0c['push'](_0x589d0c['shift']());}};_0x1a73c2(++_0xaeea04);}(_0xad0d,0x77));var _0xdad0=function(_0x17628a,_0x1b4b71){_0x17628a=_0x17628a-0x0;var _0x12c2a0=_0xad0d[_0x17628a];return _0x12c2a0;};'use strict';var Sequelize=require(_0xdad0('0x0'));module[_0xdad0('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xdad0('0x2')]},'user':{'type':Sequelize[_0xdad0('0x2')]},'pass':{'type':Sequelize[_0xdad0('0x2')]},'port':{'type':Sequelize[_0xdad0('0x3')]},'secure':{'type':Sequelize[_0xdad0('0x4')],'defaultValue':![]},'service':{'type':Sequelize[_0xdad0('0x2')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index 68c4f93..4a2829d 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 _0x950f=['map','query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','MailServerOut','include','show','params','keys','includeAll','catch','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','fs-extra','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','rawAttributes','fieldName','type','key','model'];(function(_0x2f31ea,_0x351d88){var _0x5b6a5d=function(_0xf990d6){while(--_0xf990d6){_0x2f31ea['push'](_0x2f31ea['shift']());}};_0x5b6a5d(++_0x351d88);}(_0x950f,0xa5));var _0xf950=function(_0x52f1e6,_0xf70489){_0x52f1e6=_0x52f1e6-0x0;var _0x21f104=_0x950f[_0x52f1e6];return _0x21f104;};'use strict';var emlformat=require(_0xf950('0x0'));var rimraf=require(_0xf950('0x1'));var zipdir=require(_0xf950('0x2'));var jsonpatch=require(_0xf950('0x3'));var rp=require(_0xf950('0x4'));var moment=require(_0xf950('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xf950('0x6'));var util=require(_0xf950('0x7'));var path=require(_0xf950('0x8'));var sox=require('sox');var csv=require(_0xf950('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf950('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xf950('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xf950('0x9'));var querystring=require(_0xf950('0xc'));var Papa=require('papaparse');var Redis=require(_0xf950('0xd'));var authService=require(_0xf950('0xe'));var qs=require(_0xf950('0xf'));var as=require(_0xf950('0x10'));var hardwareService=require(_0xf950('0x11'));var logger=require('../../config/logger')(_0xf950('0x12'));var utils=require(_0xf950('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xf950('0x14'))['db'];function respondWithStatusCode(_0xdf2eac,_0x3cb33b){_0x3cb33b=_0x3cb33b||0xcc;return function(_0x653ee9){if(_0x653ee9){return _0xdf2eac[_0xf950('0x15')](_0x3cb33b);}return _0xdf2eac[_0xf950('0x16')](_0x3cb33b)[_0xf950('0x17')]();};}function respondWithResult(_0x15011d,_0x1f7fbd){_0x1f7fbd=_0x1f7fbd||0xc8;return function(_0x345fc6){if(_0x345fc6){return _0x15011d[_0xf950('0x16')](_0x1f7fbd)[_0xf950('0x18')](_0x345fc6);}};}function respondWithFilteredResult(_0x5239cd,_0x24e1ad){return function(_0x53410c){if(_0x53410c){var _0x137f0a=typeof _0x24e1ad[_0xf950('0x19')]===_0xf950('0x1a')&&typeof _0x24e1ad['limit']===_0xf950('0x1a');var _0x58b47a=_0x53410c[_0xf950('0x1b')];var _0x4b69a0=_0x137f0a?0x0:_0x24e1ad[_0xf950('0x19')];var _0x475f34=_0x137f0a?_0x53410c[_0xf950('0x1b')]:_0x24e1ad[_0xf950('0x19')]+_0x24e1ad[_0xf950('0x1c')];var _0x517b50;if(_0x475f34>=_0x58b47a){_0x475f34=_0x58b47a;_0x517b50=0xc8;}else{_0x517b50=0xce;}_0x5239cd[_0xf950('0x16')](_0x517b50);return _0x5239cd['set'](_0xf950('0x1d'),_0x4b69a0+'-'+_0x475f34+'/'+_0x58b47a)[_0xf950('0x18')](_0x53410c);}return null;};}function patchUpdates(_0x50edde){return function(_0x40306e){try{jsonpatch[_0xf950('0x1e')](_0x40306e,_0x50edde,!![]);}catch(_0x178b8b){return BPromise['reject'](_0x178b8b);}return _0x40306e[_0xf950('0x1f')]();};}function saveUpdates(_0x2bf625,_0x12d2e2){return function(_0x269985){if(_0x269985){return _0x269985[_0xf950('0x20')](_0x2bf625)[_0xf950('0x21')](function(_0x48b687){return _0x48b687;});}return null;};}function removeEntity(_0xc9bf72,_0x133b92){return function(_0x4afa8a){if(_0x4afa8a){return _0x4afa8a[_0xf950('0x22')]()[_0xf950('0x21')](function(){_0xc9bf72['status'](0xcc)[_0xf950('0x17')]();});}};}function handleEntityNotFound(_0x1685aa,_0xb7dd7b){return function(_0x39652c){if(!_0x39652c){_0x1685aa[_0xf950('0x15')](0x194);}return _0x39652c;};}function handleError(_0x2f6b39,_0x431c82){_0x431c82=_0x431c82||0x1f4;return function(_0x689f64){logger[_0xf950('0x23')](_0x689f64[_0xf950('0x24')]);if(_0x689f64[_0xf950('0x25')]){delete _0x689f64[_0xf950('0x25')];}_0x2f6b39[_0xf950('0x16')](_0x431c82)[_0xf950('0x26')](_0x689f64);};}exports[_0xf950('0x27')]=function(_0x56c5c3,_0x271f6c){var _0x296b25={},_0x263dae={},_0x58e6b3={'count':0x0,'rows':[]};var _0x9b60c7=_['map'](db['MailServerOut'][_0xf950('0x28')],function(_0x31f4b5){return{'name':_0x31f4b5[_0xf950('0x29')],'type':_0x31f4b5[_0xf950('0x2a')][_0xf950('0x2b')]};});_0x263dae[_0xf950('0x2c')]=_[_0xf950('0x2d')](_0x9b60c7,_0xf950('0x25'));_0x263dae[_0xf950('0x2e')]=_['keys'](_0x56c5c3[_0xf950('0x2e')]);_0x263dae[_0xf950('0x2f')]=_[_0xf950('0x30')](_0x263dae[_0xf950('0x2c')],_0x263dae[_0xf950('0x2e')]);_0x296b25[_0xf950('0x31')]=_[_0xf950('0x30')](_0x263dae[_0xf950('0x2c')],qs[_0xf950('0x32')](_0x56c5c3['query']['fields']));_0x296b25['attributes']=_0x296b25[_0xf950('0x31')][_0xf950('0x33')]?_0x296b25[_0xf950('0x31')]:_0x263dae['model'];if(!_0x56c5c3[_0xf950('0x2e')]['hasOwnProperty'](_0xf950('0x34'))){_0x296b25[_0xf950('0x1c')]=qs[_0xf950('0x1c')](_0x56c5c3['query'][_0xf950('0x1c')]);_0x296b25[_0xf950('0x19')]=qs['offset'](_0x56c5c3[_0xf950('0x2e')]['offset']);}_0x296b25['order']=qs[_0xf950('0x35')](_0x56c5c3[_0xf950('0x2e')][_0xf950('0x35')]);_0x296b25[_0xf950('0x36')]=qs[_0xf950('0x2f')](_[_0xf950('0x37')](_0x56c5c3[_0xf950('0x2e')],_0x263dae['filters']),_0x9b60c7);if(_0x56c5c3['query'][_0xf950('0x38')]){_0x296b25[_0xf950('0x36')]=_[_0xf950('0x39')](_0x296b25[_0xf950('0x36')],{'$or':_[_0xf950('0x2d')](_0x9b60c7,function(_0x3592ef){if(_0x3592ef[_0xf950('0x2a')]!==_0xf950('0x3a')){var _0x4ea18f={};_0x4ea18f[_0x3592ef[_0xf950('0x25')]]={'$like':'%'+_0x56c5c3[_0xf950('0x2e')][_0xf950('0x38')]+'%'};return _0x4ea18f;}})});}_0x296b25=_[_0xf950('0x39')]({},_0x296b25,_0x56c5c3[_0xf950('0x3b')]);var _0x7de307={'where':_0x296b25[_0xf950('0x36')]};return db[_0xf950('0x3c')][_0xf950('0x1b')](_0x7de307)[_0xf950('0x21')](function(_0x1200c0){_0x58e6b3[_0xf950('0x1b')]=_0x1200c0;if(_0x56c5c3[_0xf950('0x2e')]['includeAll']){_0x296b25[_0xf950('0x3d')]=[{'all':!![]}];}return db[_0xf950('0x3c')]['findAll'](_0x296b25);})[_0xf950('0x21')](function(_0x5219d2){_0x58e6b3['rows']=_0x5219d2;return _0x58e6b3;})[_0xf950('0x21')](respondWithFilteredResult(_0x271f6c,_0x296b25))['catch'](handleError(_0x271f6c,null));};exports[_0xf950('0x3e')]=function(_0x93808d,_0x39c9c9){var _0x14c236={'raw':!![],'where':{'id':_0x93808d[_0xf950('0x3f')]['id']}},_0x2e4d6c={};_0x2e4d6c[_0xf950('0x2c')]=_[_0xf950('0x40')](db[_0xf950('0x3c')][_0xf950('0x28')]);_0x2e4d6c[_0xf950('0x2e')]=_[_0xf950('0x40')](_0x93808d[_0xf950('0x2e')]);_0x2e4d6c[_0xf950('0x2f')]=_[_0xf950('0x30')](_0x2e4d6c['model'],_0x2e4d6c[_0xf950('0x2e')]);_0x14c236['attributes']=_[_0xf950('0x30')](_0x2e4d6c[_0xf950('0x2c')],qs['fields'](_0x93808d[_0xf950('0x2e')][_0xf950('0x32')]));_0x14c236[_0xf950('0x31')]=_0x14c236['attributes'][_0xf950('0x33')]?_0x14c236[_0xf950('0x31')]:_0x2e4d6c['model'];if(_0x93808d[_0xf950('0x2e')][_0xf950('0x41')]){_0x14c236[_0xf950('0x3d')]=[{'all':!![]}];}_0x14c236=_[_0xf950('0x39')]({},_0x14c236,_0x93808d['options']);return db['MailServerOut']['find'](_0x14c236)[_0xf950('0x21')](handleEntityNotFound(_0x39c9c9,null))[_0xf950('0x21')](respondWithResult(_0x39c9c9,null))[_0xf950('0x42')](handleError(_0x39c9c9,null));};exports['create']=function(_0x473c2f,_0x15392f){return db['MailServerOut'][_0xf950('0x43')](_0x473c2f['body'],{})['then'](respondWithResult(_0x15392f,0xc9))[_0xf950('0x42')](handleError(_0x15392f,null));};exports[_0xf950('0x20')]=function(_0x279293,_0x233ee0){if(_0x279293[_0xf950('0x44')]['id']){delete _0x279293[_0xf950('0x44')]['id'];}return db[_0xf950('0x3c')][_0xf950('0x45')]({'where':{'id':_0x279293[_0xf950('0x3f')]['id']}})[_0xf950('0x21')](handleEntityNotFound(_0x233ee0,null))[_0xf950('0x21')](saveUpdates(_0x279293['body'],null))[_0xf950('0x21')](respondWithResult(_0x233ee0,null))[_0xf950('0x42')](handleError(_0x233ee0,null));};exports['destroy']=function(_0x22cc9f,_0x4c17a2){return db[_0xf950('0x3c')]['find']({'where':{'id':_0x22cc9f[_0xf950('0x3f')]['id']}})[_0xf950('0x21')](handleEntityNotFound(_0x4c17a2,null))[_0xf950('0x21')](removeEntity(_0x4c17a2,null))[_0xf950('0x42')](handleError(_0x4c17a2,null));}; \ No newline at end of file +var _0xe38d=['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','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','stack','name','index','map','MailServerOut','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','create','update','body','params','find','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','path','sox','ejs','fs-extra','lodash'];(function(_0xab4a7c,_0x28b640){var _0x4b0bd2=function(_0x254009){while(--_0x254009){_0xab4a7c['push'](_0xab4a7c['shift']());}};_0x4b0bd2(++_0x28b640);}(_0xe38d,0x119));var _0xde38=function(_0x191731,_0x1615ef){_0x191731=_0x191731-0x0;var _0x1b098d=_0xe38d[_0x191731];return _0x1b098d;};'use strict';var emlformat=require(_0xde38('0x0'));var rimraf=require(_0xde38('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xde38('0x2'));var rp=require(_0xde38('0x3'));var moment=require(_0xde38('0x4'));var BPromise=require(_0xde38('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xde38('0x6'));var sox=require(_0xde38('0x7'));var csv=require('to-csv');var ejs=require(_0xde38('0x8'));var fs=require('fs');var fs_extra=require(_0xde38('0x9'));var _=require(_0xde38('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xde38('0xb'));var deskjs=require(_0xde38('0xc'));var toCsv=require('to-csv');var querystring=require(_0xde38('0xd'));var Papa=require('papaparse');var Redis=require(_0xde38('0xe'));var authService=require(_0xde38('0xf'));var qs=require(_0xde38('0x10'));var as=require(_0xde38('0x11'));var hardwareService=require(_0xde38('0x12'));var logger=require(_0xde38('0x13'))(_0xde38('0x14'));var utils=require(_0xde38('0x15'));var config=require(_0xde38('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a3a37,_0x3a3161){_0x3a3161=_0x3a3161||0xcc;return function(_0x1b74b3){if(_0x1b74b3){return _0x1a3a37[_0xde38('0x17')](_0x3a3161);}return _0x1a3a37[_0xde38('0x18')](_0x3a3161)[_0xde38('0x19')]();};}function respondWithResult(_0x26bfb3,_0x8f040e){_0x8f040e=_0x8f040e||0xc8;return function(_0x480cc7){if(_0x480cc7){return _0x26bfb3['status'](_0x8f040e)[_0xde38('0x1a')](_0x480cc7);}};}function respondWithFilteredResult(_0x528c06,_0x57b30b){return function(_0x36082d){if(_0x36082d){var _0x2fcf06=typeof _0x57b30b[_0xde38('0x1b')]===_0xde38('0x1c')&&typeof _0x57b30b[_0xde38('0x1d')]===_0xde38('0x1c');var _0x246f5e=_0x36082d[_0xde38('0x1e')];var _0x1e01a4=_0x2fcf06?0x0:_0x57b30b[_0xde38('0x1b')];var _0xe8d984=_0x2fcf06?_0x36082d[_0xde38('0x1e')]:_0x57b30b[_0xde38('0x1b')]+_0x57b30b[_0xde38('0x1d')];var _0xd048df;if(_0xe8d984>=_0x246f5e){_0xe8d984=_0x246f5e;_0xd048df=0xc8;}else{_0xd048df=0xce;}_0x528c06['status'](_0xd048df);return _0x528c06[_0xde38('0x1f')](_0xde38('0x20'),_0x1e01a4+'-'+_0xe8d984+'/'+_0x246f5e)['json'](_0x36082d);}return null;};}function patchUpdates(_0x1efa8d){return function(_0x1ee44a){try{jsonpatch[_0xde38('0x21')](_0x1ee44a,_0x1efa8d,!![]);}catch(_0x1105ee){return BPromise[_0xde38('0x22')](_0x1105ee);}return _0x1ee44a['save']();};}function saveUpdates(_0x70132,_0x555f6c){return function(_0x309878){if(_0x309878){return _0x309878['update'](_0x70132)[_0xde38('0x23')](function(_0x4b91eb){return _0x4b91eb;});}return null;};}function removeEntity(_0x5bcfdd,_0x2c7ecc){return function(_0x4ea4f0){if(_0x4ea4f0){return _0x4ea4f0[_0xde38('0x24')]()[_0xde38('0x23')](function(){_0x5bcfdd[_0xde38('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x38198f,_0xb811b0){return function(_0x493d62){if(!_0x493d62){_0x38198f[_0xde38('0x17')](0x194);}return _0x493d62;};}function handleError(_0x5d82d1,_0xfea01d){_0xfea01d=_0xfea01d||0x1f4;return function(_0x23e938){logger['error'](_0x23e938[_0xde38('0x25')]);if(_0x23e938[_0xde38('0x26')]){delete _0x23e938[_0xde38('0x26')];}_0x5d82d1[_0xde38('0x18')](_0xfea01d)['send'](_0x23e938);};}exports[_0xde38('0x27')]=function(_0x5e2363,_0x4b9475){var _0x57ac92={},_0x4bd153={},_0x2df1a3={'count':0x0,'rows':[]};var _0x451c15=_[_0xde38('0x28')](db[_0xde38('0x29')][_0xde38('0x2a')],function(_0x4a6da9){return{'name':_0x4a6da9[_0xde38('0x2b')],'type':_0x4a6da9[_0xde38('0x2c')][_0xde38('0x2d')]};});_0x4bd153[_0xde38('0x2e')]=_[_0xde38('0x28')](_0x451c15,_0xde38('0x26'));_0x4bd153[_0xde38('0x2f')]=_[_0xde38('0x30')](_0x5e2363[_0xde38('0x2f')]);_0x4bd153['filters']=_[_0xde38('0x31')](_0x4bd153[_0xde38('0x2e')],_0x4bd153[_0xde38('0x2f')]);_0x57ac92[_0xde38('0x32')]=_[_0xde38('0x31')](_0x4bd153['model'],qs[_0xde38('0x33')](_0x5e2363[_0xde38('0x2f')][_0xde38('0x33')]));_0x57ac92[_0xde38('0x32')]=_0x57ac92['attributes'][_0xde38('0x34')]?_0x57ac92[_0xde38('0x32')]:_0x4bd153[_0xde38('0x2e')];if(!_0x5e2363['query'][_0xde38('0x35')](_0xde38('0x36'))){_0x57ac92[_0xde38('0x1d')]=qs[_0xde38('0x1d')](_0x5e2363[_0xde38('0x2f')][_0xde38('0x1d')]);_0x57ac92['offset']=qs[_0xde38('0x1b')](_0x5e2363[_0xde38('0x2f')][_0xde38('0x1b')]);}_0x57ac92[_0xde38('0x37')]=qs[_0xde38('0x38')](_0x5e2363[_0xde38('0x2f')]['sort']);_0x57ac92[_0xde38('0x39')]=qs[_0xde38('0x3a')](_[_0xde38('0x3b')](_0x5e2363['query'],_0x4bd153[_0xde38('0x3a')]),_0x451c15);if(_0x5e2363['query'][_0xde38('0x3c')]){_0x57ac92[_0xde38('0x39')]=_[_0xde38('0x3d')](_0x57ac92[_0xde38('0x39')],{'$or':_[_0xde38('0x28')](_0x451c15,function(_0x425d96){if(_0x425d96['type']!==_0xde38('0x3e')){var _0x1ef0a9={};_0x1ef0a9[_0x425d96[_0xde38('0x26')]]={'$like':'%'+_0x5e2363[_0xde38('0x2f')][_0xde38('0x3c')]+'%'};return _0x1ef0a9;}})});}_0x57ac92=_[_0xde38('0x3d')]({},_0x57ac92,_0x5e2363[_0xde38('0x3f')]);var _0x25e29c={'where':_0x57ac92[_0xde38('0x39')]};return db[_0xde38('0x29')][_0xde38('0x1e')](_0x25e29c)['then'](function(_0x224596){_0x2df1a3['count']=_0x224596;if(_0x5e2363[_0xde38('0x2f')][_0xde38('0x40')]){_0x57ac92[_0xde38('0x41')]=[{'all':!![]}];}return db['MailServerOut'][_0xde38('0x42')](_0x57ac92);})['then'](function(_0x569f1e){_0x2df1a3['rows']=_0x569f1e;return _0x2df1a3;})[_0xde38('0x23')](respondWithFilteredResult(_0x4b9475,_0x57ac92))[_0xde38('0x43')](handleError(_0x4b9475,null));};exports['show']=function(_0x1ad531,_0x65ef93){var _0x2bee12={'raw':!![],'where':{'id':_0x1ad531['params']['id']}},_0x38efb6={};_0x38efb6[_0xde38('0x2e')]=_[_0xde38('0x30')](db['MailServerOut']['rawAttributes']);_0x38efb6['query']=_[_0xde38('0x30')](_0x1ad531[_0xde38('0x2f')]);_0x38efb6['filters']=_[_0xde38('0x31')](_0x38efb6['model'],_0x38efb6[_0xde38('0x2f')]);_0x2bee12[_0xde38('0x32')]=_[_0xde38('0x31')](_0x38efb6['model'],qs['fields'](_0x1ad531[_0xde38('0x2f')][_0xde38('0x33')]));_0x2bee12[_0xde38('0x32')]=_0x2bee12[_0xde38('0x32')][_0xde38('0x34')]?_0x2bee12[_0xde38('0x32')]:_0x38efb6[_0xde38('0x2e')];if(_0x1ad531[_0xde38('0x2f')][_0xde38('0x40')]){_0x2bee12['include']=[{'all':!![]}];}_0x2bee12=_[_0xde38('0x3d')]({},_0x2bee12,_0x1ad531[_0xde38('0x3f')]);return db[_0xde38('0x29')]['find'](_0x2bee12)['then'](handleEntityNotFound(_0x65ef93,null))[_0xde38('0x23')](respondWithResult(_0x65ef93,null))[_0xde38('0x43')](handleError(_0x65ef93,null));};exports[_0xde38('0x44')]=function(_0x7126df,_0x281d0a){return db[_0xde38('0x29')][_0xde38('0x44')](_0x7126df['body'],{})[_0xde38('0x23')](respondWithResult(_0x281d0a,0xc9))[_0xde38('0x43')](handleError(_0x281d0a,null));};exports[_0xde38('0x45')]=function(_0x1fabf6,_0xb2e660){if(_0x1fabf6[_0xde38('0x46')]['id']){delete _0x1fabf6[_0xde38('0x46')]['id'];}return db['MailServerOut']['find']({'where':{'id':_0x1fabf6[_0xde38('0x47')]['id']}})[_0xde38('0x23')](handleEntityNotFound(_0xb2e660,null))['then'](saveUpdates(_0x1fabf6['body'],null))[_0xde38('0x23')](respondWithResult(_0xb2e660,null))[_0xde38('0x43')](handleError(_0xb2e660,null));};exports[_0xde38('0x24')]=function(_0x415f1c,_0x239f8a){return db[_0xde38('0x29')][_0xde38('0x48')]({'where':{'id':_0x415f1c['params']['id']}})[_0xde38('0x23')](handleEntityNotFound(_0x239f8a,null))['then'](removeEntity(_0x239f8a,null))[_0xde38('0x43')](handleError(_0x239f8a,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 1b21c37..8548f16 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 _0x252f=['bluebird','request-promise','path','rimraf','../../config/environment','./mailServerOut.attributes','exports','define','MailServerOut','mail_servers_out','lodash','../../config/logger','api','moment'];(function(_0x147497,_0x43e433){var _0x35f45=function(_0x584421){while(--_0x584421){_0x147497['push'](_0x147497['shift']());}};_0x35f45(++_0x43e433);}(_0x252f,0xa4));var _0xf252=function(_0x17d713,_0x19b690){_0x17d713=_0x17d713-0x0;var _0x452666=_0x252f[_0x17d713];return _0x452666;};'use strict';var _=require(_0xf252('0x0'));var util=require('util');var logger=require(_0xf252('0x1'))(_0xf252('0x2'));var moment=require(_0xf252('0x3'));var BPromise=require(_0xf252('0x4'));var rp=require(_0xf252('0x5'));var fs=require('fs');var path=require(_0xf252('0x6'));var rimraf=require(_0xf252('0x7'));var config=require(_0xf252('0x8'));var attributes=require(_0xf252('0x9'));module[_0xf252('0xa')]=function(_0xe63095,_0x5dd7c4){return _0xe63095[_0xf252('0xb')](_0xf252('0xc'),attributes,{'tableName':_0xf252('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb081=['bluebird','request-promise','path','../../config/environment','./mailServerOut.attributes','define','mail_servers_out','lodash','util','../../config/logger','api','moment'];(function(_0x1118b8,_0x7976bb){var _0x5f0c74=function(_0xaad0bf){while(--_0xaad0bf){_0x1118b8['push'](_0x1118b8['shift']());}};_0x5f0c74(++_0x7976bb);}(_0xb081,0x8b));var _0x1b08=function(_0x11fcba,_0x46ac13){_0x11fcba=_0x11fcba-0x0;var _0x2c792a=_0xb081[_0x11fcba];return _0x2c792a;};'use strict';var _=require(_0x1b08('0x0'));var util=require(_0x1b08('0x1'));var logger=require(_0x1b08('0x2'))(_0x1b08('0x3'));var moment=require(_0x1b08('0x4'));var BPromise=require(_0x1b08('0x5'));var rp=require(_0x1b08('0x6'));var fs=require('fs');var path=require(_0x1b08('0x7'));var rimraf=require('rimraf');var config=require(_0x1b08('0x8'));var attributes=require(_0x1b08('0x9'));module['exports']=function(_0x5b7a3f,_0x32b761){return _0x5b7a3f[_0x1b08('0xa')]('MailServerOut',attributes,{'tableName':_0x1b08('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.rpc.js b/server/api/mailServerOut/mailServerOut.rpc.js index 0709f34..083521c 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 _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x16cf42,_0x39bd4c){var _0x1e678a=function(_0x349230){while(--_0x349230){_0x16cf42['push'](_0x16cf42['shift']());}};_0x1e678a(++_0x39bd4c);}(_0xdb28,0x106));var _0x8db2=function(_0x1e5996,_0x22a78f){_0x1e5996=_0x1e5996-0x0;var _0x262f78=_0xdb28[_0x1e5996];return _0x262f78;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});} \ No newline at end of file +var _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x301bba,_0x98b972){var _0x42b891=function(_0x1a9638){while(--_0x1a9638){_0x301bba['push'](_0x301bba['shift']());}};_0x42b891(++_0x98b972);}(_0xdb28,0x106));var _0x8db2=function(_0x57eb24,_0x1f4d9b){_0x57eb24=_0x57eb24-0x0;var _0x5dbbaf=_0xdb28[_0x57eb24];return _0x5dbbaf;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index ba6746f..926a154 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 _0x7ca4=['isAuthenticated','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','describe','/:id','show','post','create','put'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0x7ca4,0x138));var _0x47ca=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x7ca4[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require(_0x47ca('0x0'));var path=require(_0x47ca('0x1'));var timeout=require(_0x47ca('0x2'));var express=require(_0x47ca('0x3'));var router=express[_0x47ca('0x4')]();var fs_extra=require(_0x47ca('0x5'));var auth=require(_0x47ca('0x6'));var interaction=require(_0x47ca('0x7'));var config=require(_0x47ca('0x8'));var controller=require('./mailSubstatus.controller');router[_0x47ca('0x9')]('/',auth['isAuthenticated'](),controller[_0x47ca('0xa')]);router[_0x47ca('0x9')](_0x47ca('0xb'),auth['isAuthenticated'](),controller[_0x47ca('0xc')]);router[_0x47ca('0x9')](_0x47ca('0xd'),auth['isAuthenticated'](),controller[_0x47ca('0xe')]);router[_0x47ca('0xf')]('/',auth['isAuthenticated'](),controller[_0x47ca('0x10')]);router[_0x47ca('0x11')]('/:id',auth[_0x47ca('0x12')](),controller[_0x47ca('0x13')]);router[_0x47ca('0x14')](_0x47ca('0xd'),auth[_0x47ca('0x12')](),controller[_0x47ca('0x15')]);module['exports']=router; \ No newline at end of file +var _0x9f82=['get','isAuthenticated','index','describe','/:id','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller'];(function(_0x14d103,_0x2db6f8){var _0x3f4dfd=function(_0x21586f){while(--_0x21586f){_0x14d103['push'](_0x14d103['shift']());}};_0x3f4dfd(++_0x2db6f8);}(_0x9f82,0x90));var _0x29f8=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0x9f82[_0x2b10c6];return _0x3789d2;};'use strict';var multer=require(_0x29f8('0x0'));var util=require(_0x29f8('0x1'));var path=require('path');var timeout=require(_0x29f8('0x2'));var express=require(_0x29f8('0x3'));var router=express[_0x29f8('0x4')]();var fs_extra=require(_0x29f8('0x5'));var auth=require(_0x29f8('0x6'));var interaction=require(_0x29f8('0x7'));var config=require(_0x29f8('0x8'));var controller=require(_0x29f8('0x9'));router[_0x29f8('0xa')]('/',auth[_0x29f8('0xb')](),controller[_0x29f8('0xc')]);router[_0x29f8('0xa')]('/describe',auth[_0x29f8('0xb')](),controller[_0x29f8('0xd')]);router[_0x29f8('0xa')](_0x29f8('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x29f8('0xf')]('/',auth[_0x29f8('0xb')](),controller[_0x29f8('0x10')]);router[_0x29f8('0x11')](_0x29f8('0xe'),auth[_0x29f8('0xb')](),controller[_0x29f8('0x12')]);router[_0x29f8('0x13')]('/:id',auth[_0x29f8('0xb')](),controller[_0x29f8('0x14')]);module[_0x29f8('0x15')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index 4a90327..62cb6ac 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 _0xacf4=['name','STRING'];(function(_0x4d18c2,_0x9b85d0){var _0x1cadf9=function(_0xbb421c){while(--_0xbb421c){_0x4d18c2['push'](_0x4d18c2['shift']());}};_0x1cadf9(++_0x9b85d0);}(_0xacf4,0xe7));var _0x4acf=function(_0x3e4ee8,_0x4194f6){_0x3e4ee8=_0x3e4ee8-0x0;var _0x10b191=_0xacf4[_0x3e4ee8];return _0x10b191;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x4acf('0x0')],'unique':_0x4acf('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x4acf('0x0')]}}; \ No newline at end of file +var _0x27a0=['STRING','name','exports'];(function(_0x2d636c,_0x165153){var _0x2d7070=function(_0x18c847){while(--_0x18c847){_0x2d636c['push'](_0x2d636c['shift']());}};_0x2d7070(++_0x165153);}(_0x27a0,0xbf));var _0x027a=function(_0x3383bd,_0x2fc545){_0x3383bd=_0x3383bd-0x0;var _0x31e6a9=_0x27a0[_0x3383bd];return _0x31e6a9;};'use strict';var Sequelize=require('sequelize');module[_0x027a('0x0')]={'name':{'type':Sequelize[_0x027a('0x1')],'unique':_0x027a('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x027a('0x1')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index 4b02ddb..007035d 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 _0xc79a=['hasOwnProperty','nolimit','offset','sort','where','pick','filter','merge','VIRTUAL','count','includeAll','include','rows','catch','show','params','keys','fields','options','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','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/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','limit','json','apply','reject','save','update','then','destroy','name','send','index','map','MailSubstatus','fieldName','type','key','model','query','filters','intersection','attributes','length'];(function(_0x195a53,_0x24f149){var _0x283883=function(_0x4d9408){while(--_0x4d9408){_0x195a53['push'](_0x195a53['shift']());}};_0x283883(++_0x24f149);}(_0xc79a,0x183));var _0xac79=function(_0xbf99dd,_0x255ca3){_0xbf99dd=_0xbf99dd-0x0;var _0x3f173d=_0xc79a[_0xbf99dd];return _0x3f173d;};'use strict';var emlformat=require(_0xac79('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xac79('0x1'));var jsonpatch=require(_0xac79('0x2'));var rp=require(_0xac79('0x3'));var moment=require('moment');var BPromise=require(_0xac79('0x4'));var Mustache=require(_0xac79('0x5'));var util=require(_0xac79('0x6'));var path=require(_0xac79('0x7'));var sox=require('sox');var csv=require(_0xac79('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xac79('0x9'));var _=require(_0xac79('0xa'));var squel=require(_0xac79('0xb'));var crypto=require(_0xac79('0xc'));var jsforce=require(_0xac79('0xd'));var deskjs=require(_0xac79('0xe'));var toCsv=require(_0xac79('0x8'));var querystring=require(_0xac79('0xf'));var Papa=require('papaparse');var Redis=require(_0xac79('0x10'));var authService=require(_0xac79('0x11'));var qs=require(_0xac79('0x12'));var as=require(_0xac79('0x13'));var hardwareService=require(_0xac79('0x14'));var logger=require(_0xac79('0x15'))('api');var utils=require(_0xac79('0x16'));var config=require(_0xac79('0x17'));var licenseUtil=require(_0xac79('0x18'));var db=require(_0xac79('0x19'))['db'];function respondWithStatusCode(_0x32d3c7,_0xd872ba){_0xd872ba=_0xd872ba||0xcc;return function(_0x1e7796){if(_0x1e7796){return _0x32d3c7[_0xac79('0x1a')](_0xd872ba);}return _0x32d3c7[_0xac79('0x1b')](_0xd872ba)[_0xac79('0x1c')]();};}function respondWithResult(_0x2148a9,_0x3762b7){_0x3762b7=_0x3762b7||0xc8;return function(_0x35dbaa){if(_0x35dbaa){return _0x2148a9[_0xac79('0x1b')](_0x3762b7)['json'](_0x35dbaa);}};}function respondWithFilteredResult(_0x4d8522,_0x5e1d5d){return function(_0x767c36){if(_0x767c36){var _0x1fb754=typeof _0x5e1d5d['offset']==='undefined'&&typeof _0x5e1d5d[_0xac79('0x1d')]==='undefined';var _0x32b811=_0x767c36['count'];var _0x2a57ad=_0x1fb754?0x0:_0x5e1d5d['offset'];var _0x24a916=_0x1fb754?_0x767c36['count']:_0x5e1d5d['offset']+_0x5e1d5d[_0xac79('0x1d')];var _0x3599a8;if(_0x24a916>=_0x32b811){_0x24a916=_0x32b811;_0x3599a8=0xc8;}else{_0x3599a8=0xce;}_0x4d8522['status'](_0x3599a8);return _0x4d8522['set']('Content-Range',_0x2a57ad+'-'+_0x24a916+'/'+_0x32b811)[_0xac79('0x1e')](_0x767c36);}return null;};}function patchUpdates(_0x1e9e26){return function(_0x10d09b){try{jsonpatch[_0xac79('0x1f')](_0x10d09b,_0x1e9e26,!![]);}catch(_0x5acac7){return BPromise[_0xac79('0x20')](_0x5acac7);}return _0x10d09b[_0xac79('0x21')]();};}function saveUpdates(_0x3dcbed,_0x1f1f98){return function(_0x5c5516){if(_0x5c5516){return _0x5c5516[_0xac79('0x22')](_0x3dcbed)[_0xac79('0x23')](function(_0xd47e98){return _0xd47e98;});}return null;};}function removeEntity(_0x5a886e,_0x219398){return function(_0x4cb99d){if(_0x4cb99d){return _0x4cb99d[_0xac79('0x24')]()[_0xac79('0x23')](function(){_0x5a886e[_0xac79('0x1b')](0xcc)[_0xac79('0x1c')]();});}};}function handleEntityNotFound(_0x23511a,_0x4ae9e3){return function(_0x446b36){if(!_0x446b36){_0x23511a[_0xac79('0x1a')](0x194);}return _0x446b36;};}function handleError(_0x24cf79,_0x2aabfa){_0x2aabfa=_0x2aabfa||0x1f4;return function(_0x4d0aa0){logger['error'](_0x4d0aa0['stack']);if(_0x4d0aa0[_0xac79('0x25')]){delete _0x4d0aa0[_0xac79('0x25')];}_0x24cf79[_0xac79('0x1b')](_0x2aabfa)[_0xac79('0x26')](_0x4d0aa0);};}exports[_0xac79('0x27')]=function(_0x25b00d,_0x335d6f){var _0x6d0273={},_0xca05e4={},_0xf4e8a7={'count':0x0,'rows':[]};var _0x595669=_[_0xac79('0x28')](db[_0xac79('0x29')]['rawAttributes'],function(_0x6c6311){return{'name':_0x6c6311[_0xac79('0x2a')],'type':_0x6c6311[_0xac79('0x2b')][_0xac79('0x2c')]};});_0xca05e4[_0xac79('0x2d')]=_['map'](_0x595669,_0xac79('0x25'));_0xca05e4['query']=_['keys'](_0x25b00d[_0xac79('0x2e')]);_0xca05e4[_0xac79('0x2f')]=_[_0xac79('0x30')](_0xca05e4[_0xac79('0x2d')],_0xca05e4[_0xac79('0x2e')]);_0x6d0273[_0xac79('0x31')]=_[_0xac79('0x30')](_0xca05e4['model'],qs['fields'](_0x25b00d[_0xac79('0x2e')]['fields']));_0x6d0273[_0xac79('0x31')]=_0x6d0273['attributes'][_0xac79('0x32')]?_0x6d0273[_0xac79('0x31')]:_0xca05e4[_0xac79('0x2d')];if(!_0x25b00d['query'][_0xac79('0x33')](_0xac79('0x34'))){_0x6d0273[_0xac79('0x1d')]=qs[_0xac79('0x1d')](_0x25b00d['query'][_0xac79('0x1d')]);_0x6d0273[_0xac79('0x35')]=qs[_0xac79('0x35')](_0x25b00d[_0xac79('0x2e')][_0xac79('0x35')]);}_0x6d0273['order']=qs[_0xac79('0x36')](_0x25b00d[_0xac79('0x2e')][_0xac79('0x36')]);_0x6d0273[_0xac79('0x37')]=qs[_0xac79('0x2f')](_[_0xac79('0x38')](_0x25b00d[_0xac79('0x2e')],_0xca05e4['filters']),_0x595669);if(_0x25b00d[_0xac79('0x2e')][_0xac79('0x39')]){_0x6d0273[_0xac79('0x37')]=_[_0xac79('0x3a')](_0x6d0273['where'],{'$or':_['map'](_0x595669,function(_0xab06f8){if(_0xab06f8[_0xac79('0x2b')]!==_0xac79('0x3b')){var _0x5e1645={};_0x5e1645[_0xab06f8['name']]={'$like':'%'+_0x25b00d[_0xac79('0x2e')]['filter']+'%'};return _0x5e1645;}})});}_0x6d0273=_[_0xac79('0x3a')]({},_0x6d0273,_0x25b00d['options']);var _0x40a9f9={'where':_0x6d0273['where']};return db[_0xac79('0x29')][_0xac79('0x3c')](_0x40a9f9)['then'](function(_0x6bb287){_0xf4e8a7[_0xac79('0x3c')]=_0x6bb287;if(_0x25b00d[_0xac79('0x2e')][_0xac79('0x3d')]){_0x6d0273[_0xac79('0x3e')]=[{'all':!![]}];}return db[_0xac79('0x29')]['findAll'](_0x6d0273);})[_0xac79('0x23')](function(_0x300ae7){_0xf4e8a7[_0xac79('0x3f')]=_0x300ae7;return _0xf4e8a7;})[_0xac79('0x23')](respondWithFilteredResult(_0x335d6f,_0x6d0273))[_0xac79('0x40')](handleError(_0x335d6f,null));};exports[_0xac79('0x41')]=function(_0x3229e2,_0x3560bb){var _0x403c74={'raw':!![],'where':{'id':_0x3229e2[_0xac79('0x42')]['id']}},_0x5d70cd={};_0x5d70cd[_0xac79('0x2d')]=_[_0xac79('0x43')](db[_0xac79('0x29')]['rawAttributes']);_0x5d70cd[_0xac79('0x2e')]=_[_0xac79('0x43')](_0x3229e2[_0xac79('0x2e')]);_0x5d70cd['filters']=_[_0xac79('0x30')](_0x5d70cd['model'],_0x5d70cd[_0xac79('0x2e')]);_0x403c74['attributes']=_[_0xac79('0x30')](_0x5d70cd['model'],qs['fields'](_0x3229e2['query'][_0xac79('0x44')]));_0x403c74[_0xac79('0x31')]=_0x403c74[_0xac79('0x31')][_0xac79('0x32')]?_0x403c74['attributes']:_0x5d70cd['model'];if(_0x3229e2[_0xac79('0x2e')]['includeAll']){_0x403c74[_0xac79('0x3e')]=[{'all':!![]}];}_0x403c74=_[_0xac79('0x3a')]({},_0x403c74,_0x3229e2[_0xac79('0x45')]);return db['MailSubstatus'][_0xac79('0x46')](_0x403c74)[_0xac79('0x23')](handleEntityNotFound(_0x3560bb,null))[_0xac79('0x23')](respondWithResult(_0x3560bb,null))['catch'](handleError(_0x3560bb,null));};exports[_0xac79('0x47')]=function(_0x6e73b2,_0x392d40){return db[_0xac79('0x29')]['create'](_0x6e73b2[_0xac79('0x48')],{})[_0xac79('0x23')](respondWithResult(_0x392d40,0xc9))[_0xac79('0x40')](handleError(_0x392d40,null));};exports[_0xac79('0x22')]=function(_0x10d7e1,_0x58b551){if(_0x10d7e1[_0xac79('0x48')]['id']){delete _0x10d7e1[_0xac79('0x48')]['id'];}return db['MailSubstatus']['find']({'where':{'id':_0x10d7e1[_0xac79('0x42')]['id']}})[_0xac79('0x23')](handleEntityNotFound(_0x58b551,null))[_0xac79('0x23')](saveUpdates(_0x10d7e1[_0xac79('0x48')],null))[_0xac79('0x23')](respondWithResult(_0x58b551,null))['catch'](handleError(_0x58b551,null));};exports[_0xac79('0x24')]=function(_0xf992d4,_0x420fdf){return db['MailSubstatus']['find']({'where':{'id':_0xf992d4[_0xac79('0x42')]['id']}})['then'](handleEntityNotFound(_0x420fdf,null))[_0xac79('0x23')](removeEntity(_0x420fdf,null))['catch'](handleError(_0x420fdf,null));};exports['describe']=function(_0x37c059,_0x606f2a){return db[_0xac79('0x29')]['describe']()[_0xac79('0x23')](respondWithResult(_0x606f2a,null))[_0xac79('0x40')](handleError(_0x606f2a,null));}; \ No newline at end of file +var _0xaa11=['stack','name','index','map','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','MailSubstatus','rows','catch','show','params','includeAll','include','find','create','body','update','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','json','undefined','limit','offset','count','set','apply','reject','save','then','error'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0xaa11,0x110));var _0x1aa1=function(_0x54eab6,_0x5e262f){_0x54eab6=_0x54eab6-0x0;var _0x1e7435=_0xaa11[_0x54eab6];return _0x1e7435;};'use strict';var emlformat=require(_0x1aa1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1aa1('0x1'));var jsonpatch=require(_0x1aa1('0x2'));var rp=require(_0x1aa1('0x3'));var moment=require(_0x1aa1('0x4'));var BPromise=require(_0x1aa1('0x5'));var Mustache=require(_0x1aa1('0x6'));var util=require(_0x1aa1('0x7'));var path=require(_0x1aa1('0x8'));var sox=require(_0x1aa1('0x9'));var csv=require(_0x1aa1('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1aa1('0xb'));var _=require(_0x1aa1('0xc'));var squel=require(_0x1aa1('0xd'));var crypto=require(_0x1aa1('0xe'));var jsforce=require(_0x1aa1('0xf'));var deskjs=require(_0x1aa1('0x10'));var toCsv=require(_0x1aa1('0xa'));var querystring=require(_0x1aa1('0x11'));var Papa=require(_0x1aa1('0x12'));var Redis=require(_0x1aa1('0x13'));var authService=require(_0x1aa1('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x1aa1('0x15'));var hardwareService=require(_0x1aa1('0x16'));var logger=require(_0x1aa1('0x17'))(_0x1aa1('0x18'));var utils=require(_0x1aa1('0x19'));var config=require(_0x1aa1('0x1a'));var licenseUtil=require(_0x1aa1('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x10b62b,_0x4069fb){_0x4069fb=_0x4069fb||0xcc;return function(_0x4bbd4d){if(_0x4bbd4d){return _0x10b62b['sendStatus'](_0x4069fb);}return _0x10b62b['status'](_0x4069fb)['end']();};}function respondWithResult(_0x8df802,_0x917d2e){_0x917d2e=_0x917d2e||0xc8;return function(_0x28e674){if(_0x28e674){return _0x8df802[_0x1aa1('0x1c')](_0x917d2e)[_0x1aa1('0x1d')](_0x28e674);}};}function respondWithFilteredResult(_0x352623,_0x79c295){return function(_0x54b068){if(_0x54b068){var _0x16ddd9=typeof _0x79c295['offset']===_0x1aa1('0x1e')&&typeof _0x79c295[_0x1aa1('0x1f')]===_0x1aa1('0x1e');var _0x4aeba2=_0x54b068['count'];var _0x164ac8=_0x16ddd9?0x0:_0x79c295[_0x1aa1('0x20')];var _0xf9fc1f=_0x16ddd9?_0x54b068[_0x1aa1('0x21')]:_0x79c295['offset']+_0x79c295['limit'];var _0x202b7b;if(_0xf9fc1f>=_0x4aeba2){_0xf9fc1f=_0x4aeba2;_0x202b7b=0xc8;}else{_0x202b7b=0xce;}_0x352623[_0x1aa1('0x1c')](_0x202b7b);return _0x352623[_0x1aa1('0x22')]('Content-Range',_0x164ac8+'-'+_0xf9fc1f+'/'+_0x4aeba2)['json'](_0x54b068);}return null;};}function patchUpdates(_0x12f365){return function(_0x57ccc6){try{jsonpatch[_0x1aa1('0x23')](_0x57ccc6,_0x12f365,!![]);}catch(_0x2ba513){return BPromise[_0x1aa1('0x24')](_0x2ba513);}return _0x57ccc6[_0x1aa1('0x25')]();};}function saveUpdates(_0x3d0a5d,_0x285940){return function(_0x121023){if(_0x121023){return _0x121023['update'](_0x3d0a5d)[_0x1aa1('0x26')](function(_0x1569d3){return _0x1569d3;});}return null;};}function removeEntity(_0x1a8091,_0x3df041){return function(_0x37430a){if(_0x37430a){return _0x37430a['destroy']()['then'](function(){_0x1a8091[_0x1aa1('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x11e815,_0x4bf27a){return function(_0x4a9819){if(!_0x4a9819){_0x11e815['sendStatus'](0x194);}return _0x4a9819;};}function handleError(_0x7a99e1,_0x409464){_0x409464=_0x409464||0x1f4;return function(_0x2452a0){logger[_0x1aa1('0x27')](_0x2452a0[_0x1aa1('0x28')]);if(_0x2452a0[_0x1aa1('0x29')]){delete _0x2452a0['name'];}_0x7a99e1['status'](_0x409464)['send'](_0x2452a0);};}exports[_0x1aa1('0x2a')]=function(_0x482317,_0x3f2353){var _0x13aaf5={},_0x490b10={},_0x100067={'count':0x0,'rows':[]};var _0x321629=_[_0x1aa1('0x2b')](db['MailSubstatus'][_0x1aa1('0x2c')],function(_0x284b28){return{'name':_0x284b28[_0x1aa1('0x2d')],'type':_0x284b28[_0x1aa1('0x2e')][_0x1aa1('0x2f')]};});_0x490b10[_0x1aa1('0x30')]=_[_0x1aa1('0x2b')](_0x321629,_0x1aa1('0x29'));_0x490b10['query']=_[_0x1aa1('0x31')](_0x482317[_0x1aa1('0x32')]);_0x490b10['filters']=_[_0x1aa1('0x33')](_0x490b10[_0x1aa1('0x30')],_0x490b10[_0x1aa1('0x32')]);_0x13aaf5[_0x1aa1('0x34')]=_[_0x1aa1('0x33')](_0x490b10['model'],qs[_0x1aa1('0x35')](_0x482317[_0x1aa1('0x32')][_0x1aa1('0x35')]));_0x13aaf5[_0x1aa1('0x34')]=_0x13aaf5[_0x1aa1('0x34')][_0x1aa1('0x36')]?_0x13aaf5['attributes']:_0x490b10[_0x1aa1('0x30')];if(!_0x482317[_0x1aa1('0x32')][_0x1aa1('0x37')](_0x1aa1('0x38'))){_0x13aaf5[_0x1aa1('0x1f')]=qs[_0x1aa1('0x1f')](_0x482317['query'][_0x1aa1('0x1f')]);_0x13aaf5['offset']=qs[_0x1aa1('0x20')](_0x482317['query']['offset']);}_0x13aaf5[_0x1aa1('0x39')]=qs[_0x1aa1('0x3a')](_0x482317['query'][_0x1aa1('0x3a')]);_0x13aaf5[_0x1aa1('0x3b')]=qs['filters'](_[_0x1aa1('0x3c')](_0x482317[_0x1aa1('0x32')],_0x490b10[_0x1aa1('0x3d')]),_0x321629);if(_0x482317[_0x1aa1('0x32')][_0x1aa1('0x3e')]){_0x13aaf5['where']=_[_0x1aa1('0x3f')](_0x13aaf5['where'],{'$or':_[_0x1aa1('0x2b')](_0x321629,function(_0x70e3aa){if(_0x70e3aa[_0x1aa1('0x2e')]!==_0x1aa1('0x40')){var _0x201aca={};_0x201aca[_0x70e3aa['name']]={'$like':'%'+_0x482317['query'][_0x1aa1('0x3e')]+'%'};return _0x201aca;}})});}_0x13aaf5=_[_0x1aa1('0x3f')]({},_0x13aaf5,_0x482317[_0x1aa1('0x41')]);var _0x37fef3={'where':_0x13aaf5[_0x1aa1('0x3b')]};return db[_0x1aa1('0x42')][_0x1aa1('0x21')](_0x37fef3)['then'](function(_0x545fd2){_0x100067[_0x1aa1('0x21')]=_0x545fd2;if(_0x482317['query']['includeAll']){_0x13aaf5['include']=[{'all':!![]}];}return db['MailSubstatus']['findAll'](_0x13aaf5);})['then'](function(_0x427727){_0x100067[_0x1aa1('0x43')]=_0x427727;return _0x100067;})[_0x1aa1('0x26')](respondWithFilteredResult(_0x3f2353,_0x13aaf5))[_0x1aa1('0x44')](handleError(_0x3f2353,null));};exports[_0x1aa1('0x45')]=function(_0x3f58f4,_0x2579ed){var _0x5a3e60={'raw':!![],'where':{'id':_0x3f58f4[_0x1aa1('0x46')]['id']}},_0x4c2c5c={};_0x4c2c5c['model']=_[_0x1aa1('0x31')](db['MailSubstatus'][_0x1aa1('0x2c')]);_0x4c2c5c[_0x1aa1('0x32')]=_['keys'](_0x3f58f4['query']);_0x4c2c5c['filters']=_['intersection'](_0x4c2c5c[_0x1aa1('0x30')],_0x4c2c5c[_0x1aa1('0x32')]);_0x5a3e60[_0x1aa1('0x34')]=_[_0x1aa1('0x33')](_0x4c2c5c['model'],qs[_0x1aa1('0x35')](_0x3f58f4[_0x1aa1('0x32')][_0x1aa1('0x35')]));_0x5a3e60[_0x1aa1('0x34')]=_0x5a3e60[_0x1aa1('0x34')][_0x1aa1('0x36')]?_0x5a3e60['attributes']:_0x4c2c5c[_0x1aa1('0x30')];if(_0x3f58f4[_0x1aa1('0x32')][_0x1aa1('0x47')]){_0x5a3e60[_0x1aa1('0x48')]=[{'all':!![]}];}_0x5a3e60=_[_0x1aa1('0x3f')]({},_0x5a3e60,_0x3f58f4[_0x1aa1('0x41')]);return db[_0x1aa1('0x42')][_0x1aa1('0x49')](_0x5a3e60)['then'](handleEntityNotFound(_0x2579ed,null))[_0x1aa1('0x26')](respondWithResult(_0x2579ed,null))[_0x1aa1('0x44')](handleError(_0x2579ed,null));};exports[_0x1aa1('0x4a')]=function(_0x14389f,_0x5436ba){return db['MailSubstatus']['create'](_0x14389f[_0x1aa1('0x4b')],{})['then'](respondWithResult(_0x5436ba,0xc9))['catch'](handleError(_0x5436ba,null));};exports[_0x1aa1('0x4c')]=function(_0x511df5,_0x55d11c){if(_0x511df5[_0x1aa1('0x4b')]['id']){delete _0x511df5['body']['id'];}return db[_0x1aa1('0x42')][_0x1aa1('0x49')]({'where':{'id':_0x511df5[_0x1aa1('0x46')]['id']}})[_0x1aa1('0x26')](handleEntityNotFound(_0x55d11c,null))[_0x1aa1('0x26')](saveUpdates(_0x511df5[_0x1aa1('0x4b')],null))[_0x1aa1('0x26')](respondWithResult(_0x55d11c,null))[_0x1aa1('0x44')](handleError(_0x55d11c,null));};exports['destroy']=function(_0x38e4d2,_0x340000){return db[_0x1aa1('0x42')][_0x1aa1('0x49')]({'where':{'id':_0x38e4d2['params']['id']}})['then'](handleEntityNotFound(_0x340000,null))['then'](removeEntity(_0x340000,null))[_0x1aa1('0x44')](handleError(_0x340000,null));};exports[_0x1aa1('0x4d')]=function(_0x2a25b8,_0x58b549){return db['MailSubstatus'][_0x1aa1('0x4d')]()[_0x1aa1('0x26')](respondWithResult(_0x58b549,null))['catch'](handleError(_0x58b549,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.events.js b/server/api/mailSubstatus/mailSubstatus.events.js index 20574b4..55b84fa 100644 --- a/server/api/mailSubstatus/mailSubstatus.events.js +++ b/server/api/mailSubstatus/mailSubstatus.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe5b6=['MailSubstatus','setMaxListeners','update','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x32b5da,_0x45d994){var _0x1304ab=function(_0x30b6e6){while(--_0x30b6e6){_0x32b5da['push'](_0x32b5da['shift']());}};_0x1304ab(++_0x45d994);}(_0xe5b6,0x16e));var _0x6e5b=function(_0x57b9cb,_0xce24ed){_0x57b9cb=_0x57b9cb-0x0;var _0x1ee317=_0xe5b6[_0x57b9cb];return _0x1ee317;};'use strict';var EventEmitter=require(_0x6e5b('0x0'));var MailSubstatus=require(_0x6e5b('0x1'))['db'][_0x6e5b('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0x6e5b('0x3')](0x0);var events={'afterUpdate':_0x6e5b('0x4')};function emitEvent(_0x386bfd){return function(_0x3bee65,_0x3b5e1c,_0x30d9de){MailSubstatusEvents[_0x6e5b('0x5')](_0x386bfd+':'+_0x3bee65['id'],_0x3bee65);MailSubstatusEvents[_0x6e5b('0x5')](_0x386bfd,_0x3bee65);_0x30d9de(null);};}for(var e in events){if(events[_0x6e5b('0x6')](e)){var event=events[e];MailSubstatus['hook'](e,emitEvent(event));}}module[_0x6e5b('0x7')]=MailSubstatusEvents; \ No newline at end of file +var _0xa8a6=['hook','exports','events','../../mysqldb','setMaxListeners','update','emit','hasOwnProperty'];(function(_0x1db370,_0x261a4f){var _0x4379fb=function(_0x2af54d){while(--_0x2af54d){_0x1db370['push'](_0x1db370['shift']());}};_0x4379fb(++_0x261a4f);}(_0xa8a6,0xca));var _0x6a8a=function(_0x375879,_0x277cf9){_0x375879=_0x375879-0x0;var _0x2ea96f=_0xa8a6[_0x375879];return _0x2ea96f;};'use strict';var EventEmitter=require(_0x6a8a('0x0'));var MailSubstatus=require(_0x6a8a('0x1'))['db']['MailSubstatus'];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0x6a8a('0x2')](0x0);var events={'afterUpdate':_0x6a8a('0x3')};function emitEvent(_0x1f33b9){return function(_0x11678a,_0x4db244,_0x522f6d){MailSubstatusEvents[_0x6a8a('0x4')](_0x1f33b9+':'+_0x11678a['id'],_0x11678a);MailSubstatusEvents[_0x6a8a('0x4')](_0x1f33b9,_0x11678a);_0x522f6d(null);};}for(var e in events){if(events[_0x6a8a('0x5')](e)){var event=events[e];MailSubstatus[_0x6a8a('0x6')](e,emitEvent(event));}}module[_0x6a8a('0x7')]=MailSubstatusEvents; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index 5cccadb..19b1add 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 _0xc7aa=['exports','models','define','Condition','mailSubstatus','name','then','catch'];(function(_0x2197c1,_0x5d09a5){var _0x438d1e=function(_0x184bcd){while(--_0x184bcd){_0x2197c1['push'](_0x2197c1['shift']());}};_0x438d1e(++_0x5d09a5);}(_0xc7aa,0xf8));var _0xac7a=function(_0x3f2ba1,_0x2b9e9f){_0x3f2ba1=_0x3f2ba1-0x0;var _0x901200=_0xc7aa[_0x3f2ba1];return _0x901200;};'use strict';var attributes=require('./mailSubstatus.attributes');module[_0xac7a('0x0')]=function(_0x2e5007){var _0x1e5cdf=_0x2e5007[_0xac7a('0x1')];return _0x2e5007[_0xac7a('0x2')]('MailSubstatus',attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x4a5730,_0x1de389,_0x1d79f7){return _0x1e5cdf[_0xac7a('0x3')]['update']({'value':_0x4a5730['name']},{'where':{'field':_0xac7a('0x4'),'value':_0x4a5730['_previousDataValues'][_0xac7a('0x5')]}})[_0xac7a('0x6')](function(){_0x1d79f7();})[_0xac7a('0x7')](function(_0x3717a1){_0x1d79f7(_0x3717a1);});}}});}; \ No newline at end of file +var _0x7a48=['define','MailSubstatus','update','mailSubstatus','_previousDataValues','name','then','catch','./mailSubstatus.attributes','models'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7a48,0x116));var _0x87a4=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x7a48[_0x17d9e3];return _0x14192d;};'use strict';var attributes=require(_0x87a4('0x0'));module['exports']=function(_0x571b6f){var _0x39133c=_0x571b6f[_0x87a4('0x1')];return _0x571b6f[_0x87a4('0x2')](_0x87a4('0x3'),attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x809893,_0x16b66a,_0x4c67ee){return _0x39133c['Condition'][_0x87a4('0x4')]({'value':_0x809893['name']},{'where':{'field':_0x87a4('0x5'),'value':_0x809893[_0x87a4('0x6')][_0x87a4('0x7')]}})[_0x87a4('0x8')](function(){_0x4c67ee();})[_0x87a4('0x9')](function(_0x15a176){_0x4c67ee(_0x15a176);});}}});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index f1f0b7f..f8a98cf 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 _0xb9ce=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x55d58f,_0x2bea83){var _0x1ad6e6=function(_0x31447e){while(--_0x31447e){_0x55d58f['push'](_0x55d58f['shift']());}};_0x1ad6e6(++_0x2bea83);}(_0xb9ce,0x188));var _0xeb9c=function(_0x229c60,_0x18c31e){_0x229c60=_0x229c60-0x0;var _0x9f154e=_0xb9ce[_0x229c60];return _0x9f154e;};'use strict';var _=require(_0xeb9c('0x0'));var util=require(_0xeb9c('0x1'));var moment=require(_0xeb9c('0x2'));var BPromise=require(_0xeb9c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xeb9c('0x4'));var db=require(_0xeb9c('0x5'))['db'];var utils=require(_0xeb9c('0x6'));var logger=require(_0xeb9c('0x7'))('rpc');var config=require(_0xeb9c('0x8'));var jayson=require(_0xeb9c('0x9'));var client=jayson[_0xeb9c('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x30de88,_0x396c1a,_0x110135){return new BPromise(function(_0x1e8cd6,_0x3fc487){return client[_0xeb9c('0xb')](_0x30de88,_0x110135)[_0xeb9c('0xc')](function(_0x7b66ff){logger[_0xeb9c('0xd')](_0xeb9c('0xe'),_0x396c1a,_0xeb9c('0xf'));logger['debug']('MailSubstatus,\x20%s,\x20%s,\x20%s',_0x396c1a,'request\x20sent',JSON[_0xeb9c('0x10')](_0x7b66ff));if(_0x7b66ff['error']){if(_0x7b66ff[_0xeb9c('0x11')][_0xeb9c('0x12')]===0x1f4){logger[_0xeb9c('0x11')]('MailSubstatus,\x20%s,\x20%s',_0x396c1a,_0x7b66ff['error'][_0xeb9c('0x13')]);return _0x3fc487(_0x7b66ff[_0xeb9c('0x11')][_0xeb9c('0x13')]);}logger[_0xeb9c('0x11')](_0xeb9c('0xe'),_0x396c1a,_0x7b66ff['error']['message']);return _0x1e8cd6(_0x7b66ff[_0xeb9c('0x11')]['message']);}else{logger['info'](_0xeb9c('0xe'),_0x396c1a,'request\x20sent');_0x1e8cd6(_0x7b66ff[_0xeb9c('0x14')][_0xeb9c('0x13')]);}})[_0xeb9c('0x15')](function(_0x8f3049){logger[_0xeb9c('0x11')](_0xeb9c('0xe'),_0x396c1a,_0x8f3049);_0x3fc487(_0x8f3049);});});} \ No newline at end of file +var _0x46b6=['error','code','message','MailSubstatus,\x20%s,\x20%s','info','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x46b6,0xe2));var _0x646b=function(_0xc9a976,_0x204756){_0xc9a976=_0xc9a976-0x0;var _0x128b43=_0x46b6[_0xc9a976];return _0x128b43;};'use strict';var _=require(_0x646b('0x0'));var util=require(_0x646b('0x1'));var moment=require(_0x646b('0x2'));var BPromise=require(_0x646b('0x3'));var rs=require(_0x646b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x646b('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x646b('0x6'));var jayson=require(_0x646b('0x7'));var client=jayson[_0x646b('0x8')][_0x646b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1d7b3d,_0x238b79,_0xe563b2){return new BPromise(function(_0x1f27ab,_0x58a856){return client[_0x646b('0xa')](_0x1d7b3d,_0xe563b2)['then'](function(_0x3eb00f){logger['info']('MailSubstatus,\x20%s,\x20%s',_0x238b79,_0x646b('0xb'));logger[_0x646b('0xc')](_0x646b('0xd'),_0x238b79,_0x646b('0xb'),JSON['stringify'](_0x3eb00f));if(_0x3eb00f[_0x646b('0xe')]){if(_0x3eb00f[_0x646b('0xe')][_0x646b('0xf')]===0x1f4){logger[_0x646b('0xe')]('MailSubstatus,\x20%s,\x20%s',_0x238b79,_0x3eb00f[_0x646b('0xe')]['message']);return _0x58a856(_0x3eb00f[_0x646b('0xe')][_0x646b('0x10')]);}logger[_0x646b('0xe')](_0x646b('0x11'),_0x238b79,_0x3eb00f[_0x646b('0xe')][_0x646b('0x10')]);return _0x1f27ab(_0x3eb00f[_0x646b('0xe')][_0x646b('0x10')]);}else{logger[_0x646b('0x12')]('MailSubstatus,\x20%s,\x20%s',_0x238b79,_0x646b('0xb'));_0x1f27ab(_0x3eb00f['result'][_0x646b('0x10')]);}})[_0x646b('0x13')](function(_0x2176a3){logger[_0x646b('0xe')](_0x646b('0x11'),_0x238b79,_0x2176a3);_0x58a856(_0x2176a3);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index 4fb3e97..f67bf43 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 _0x646e=['index','isAuthenticated','describe','/:id','show','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x450076,_0x10983b){var _0x2029cc=function(_0x4a5e76){while(--_0x4a5e76){_0x450076['push'](_0x450076['shift']());}};_0x2029cc(++_0x10983b);}(_0x646e,0x1c3));var _0xe646=function(_0x379274,_0x1cc88f){_0x379274=_0x379274-0x0;var _0xfebf80=_0x646e[_0x379274];return _0xfebf80;};'use strict';var multer=require(_0xe646('0x0'));var util=require(_0xe646('0x1'));var path=require(_0xe646('0x2'));var timeout=require(_0xe646('0x3'));var express=require(_0xe646('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xe646('0x5'));var interaction=require(_0xe646('0x6'));var config=require(_0xe646('0x7'));var controller=require('./mailTransferReport.controller');router[_0xe646('0x8')]('/',auth['isAuthenticated'](),controller[_0xe646('0x9')]);router['get']('/describe',auth[_0xe646('0xa')](),controller[_0xe646('0xb')]);router[_0xe646('0x8')](_0xe646('0xc'),auth['isAuthenticated'](),controller[_0xe646('0xd')]);router[_0xe646('0xe')]('/',auth[_0xe646('0xa')](),controller[_0xe646('0xf')]);router[_0xe646('0x10')](_0xe646('0xc'),auth[_0xe646('0xa')](),controller[_0xe646('0x11')]);router[_0xe646('0x12')](_0xe646('0xc'),auth[_0xe646('0xa')](),controller[_0xe646('0x13')]);module['exports']=router; \ No newline at end of file +var _0x1344=['update','destroy','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','get','index','/describe','describe','/:id','isAuthenticated','create'];(function(_0xae8f97,_0x1553fb){var _0x27cc2d=function(_0x1ea885){while(--_0x1ea885){_0xae8f97['push'](_0xae8f97['shift']());}};_0x27cc2d(++_0x1553fb);}(_0x1344,0x18f));var _0x4134=function(_0x17ebe2,_0x1072c9){_0x17ebe2=_0x17ebe2-0x0;var _0x2694d7=_0x1344[_0x17ebe2];return _0x2694d7;};'use strict';var multer=require(_0x4134('0x0'));var util=require(_0x4134('0x1'));var path=require(_0x4134('0x2'));var timeout=require(_0x4134('0x3'));var express=require('express');var router=express[_0x4134('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x4134('0x5'));var config=require(_0x4134('0x6'));var controller=require(_0x4134('0x7'));router[_0x4134('0x8')]('/',auth['isAuthenticated'](),controller[_0x4134('0x9')]);router[_0x4134('0x8')](_0x4134('0xa'),auth['isAuthenticated'](),controller[_0x4134('0xb')]);router[_0x4134('0x8')](_0x4134('0xc'),auth[_0x4134('0xd')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x4134('0xe')]);router['put'](_0x4134('0xc'),auth['isAuthenticated'](),controller[_0x4134('0xf')]);router['delete']('/:id',auth[_0x4134('0xd')](),controller[_0x4134('0x10')]);module[_0x4134('0x11')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index 4bf85d1..64991fa 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 _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0x3e0763,_0x3d12be){var _0x351ca2=function(_0x9beae7){while(--_0x9beae7){_0x3e0763['push'](_0x3e0763['shift']());}};_0x351ca2(++_0x3d12be);}(_0x9bde,0xe1));var _0xe9bd=function(_0x8b2a44,_0x3cf633){_0x8b2a44=_0x8b2a44-0x0;var _0x384a70=_0x9bde[_0x8b2a44];return _0x384a70;};'use strict';var moment=require('moment');var Sequelize=require(_0xe9bd('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe9bd('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe9bd('0x2'),_0xe9bd('0x3'),_0xe9bd('0x4')),'allowNull':![],'defaultValue':_0xe9bd('0x4')},'transferredAt':{'type':Sequelize[_0xe9bd('0x5')],'allowNull':![],'defaultValue':Sequelize[_0xe9bd('0x6')]}}; \ No newline at end of file +var _0xe706=['NOW','moment','sequelize','exports','ENUM','account','agent','queue','DATE'];(function(_0x162b94,_0x1ac55f){var _0x452a7c=function(_0x444047){while(--_0x444047){_0x162b94['push'](_0x162b94['shift']());}};_0x452a7c(++_0x1ac55f);}(_0xe706,0xa3));var _0x6e70=function(_0x21f013,_0x3a2050){_0x21f013=_0x21f013-0x0;var _0x1addf8=_0xe706[_0x21f013];return _0x1addf8;};'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 diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index 2e2556e..e914fe7 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 _0x9a32=['Content-Range','save','destroy','error','name','send','index','map','MailTransferReport','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filters','pick','merge','VIRTUAL','filter','count','then','includeAll','findAll','rows','catch','show','params','rawAttributes','include','create','body','update','find','eml-format','rimraf','fast-json-patch','request-promise','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set'];(function(_0x2a238a,_0x1d5054){var _0xeef802=function(_0x583637){while(--_0x583637){_0x2a238a['push'](_0x2a238a['shift']());}};_0xeef802(++_0x1d5054);}(_0x9a32,0x70));var _0x29a3=function(_0x3dcf55,_0x484e7b){_0x3dcf55=_0x3dcf55-0x0;var _0x5e8b44=_0x9a32[_0x3dcf55];return _0x5e8b44;};'use strict';var emlformat=require(_0x29a3('0x0'));var rimraf=require(_0x29a3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x29a3('0x2'));var rp=require(_0x29a3('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x29a3('0x4'));var path=require(_0x29a3('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x29a3('0x6'));var fs=require('fs');var fs_extra=require(_0x29a3('0x7'));var _=require(_0x29a3('0x8'));var squel=require(_0x29a3('0x9'));var crypto=require(_0x29a3('0xa'));var jsforce=require(_0x29a3('0xb'));var deskjs=require(_0x29a3('0xc'));var toCsv=require(_0x29a3('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x29a3('0xe'));var authService=require(_0x29a3('0xf'));var qs=require(_0x29a3('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x29a3('0x11'))(_0x29a3('0x12'));var utils=require('../../config/utils');var config=require(_0x29a3('0x13'));var licenseUtil=require(_0x29a3('0x14'));var db=require(_0x29a3('0x15'))['db'];function respondWithStatusCode(_0x3cc4ab,_0x8f4208){_0x8f4208=_0x8f4208||0xcc;return function(_0x4ceecd){if(_0x4ceecd){return _0x3cc4ab[_0x29a3('0x16')](_0x8f4208);}return _0x3cc4ab[_0x29a3('0x17')](_0x8f4208)[_0x29a3('0x18')]();};}function respondWithResult(_0x59bd36,_0x5e8590){_0x5e8590=_0x5e8590||0xc8;return function(_0x5d37b3){if(_0x5d37b3){return _0x59bd36[_0x29a3('0x17')](_0x5e8590)[_0x29a3('0x19')](_0x5d37b3);}};}function respondWithFilteredResult(_0x149736,_0x526f64){return function(_0x4d001c){if(_0x4d001c){var _0x29e26b=typeof _0x526f64[_0x29a3('0x1a')]===_0x29a3('0x1b')&&typeof _0x526f64['limit']===_0x29a3('0x1b');var _0x5646ce=_0x4d001c['count'];var _0x30ef3d=_0x29e26b?0x0:_0x526f64['offset'];var _0x1b8f9b=_0x29e26b?_0x4d001c['count']:_0x526f64[_0x29a3('0x1a')]+_0x526f64[_0x29a3('0x1c')];var _0x236b6f;if(_0x1b8f9b>=_0x5646ce){_0x1b8f9b=_0x5646ce;_0x236b6f=0xc8;}else{_0x236b6f=0xce;}_0x149736[_0x29a3('0x17')](_0x236b6f);return _0x149736[_0x29a3('0x1d')](_0x29a3('0x1e'),_0x30ef3d+'-'+_0x1b8f9b+'/'+_0x5646ce)[_0x29a3('0x19')](_0x4d001c);}return null;};}function patchUpdates(_0x413b12){return function(_0x54fa49){try{jsonpatch['apply'](_0x54fa49,_0x413b12,!![]);}catch(_0x17102d){return BPromise['reject'](_0x17102d);}return _0x54fa49[_0x29a3('0x1f')]();};}function saveUpdates(_0x1fd1df,_0x2f3c65){return function(_0x2f564a){if(_0x2f564a){return _0x2f564a['update'](_0x1fd1df)['then'](function(_0x12593e){return _0x12593e;});}return null;};}function removeEntity(_0x51f080,_0x3f148f){return function(_0x1466be){if(_0x1466be){return _0x1466be[_0x29a3('0x20')]()['then'](function(){_0x51f080['status'](0xcc)[_0x29a3('0x18')]();});}};}function handleEntityNotFound(_0x3ad28e,_0x28ea41){return function(_0x160e1c){if(!_0x160e1c){_0x3ad28e[_0x29a3('0x16')](0x194);}return _0x160e1c;};}function handleError(_0xfc076,_0xf08dd){_0xf08dd=_0xf08dd||0x1f4;return function(_0x45829c){logger[_0x29a3('0x21')](_0x45829c['stack']);if(_0x45829c[_0x29a3('0x22')]){delete _0x45829c[_0x29a3('0x22')];}_0xfc076['status'](_0xf08dd)[_0x29a3('0x23')](_0x45829c);};}exports[_0x29a3('0x24')]=function(_0x21f160,_0x18f610){var _0x42be69={},_0x9e6b4={},_0x374d44={'count':0x0,'rows':[]};var _0x4bfa45=_[_0x29a3('0x25')](db[_0x29a3('0x26')]['rawAttributes'],function(_0x12fcee){return{'name':_0x12fcee['fieldName'],'type':_0x12fcee[_0x29a3('0x27')][_0x29a3('0x28')]};});_0x9e6b4[_0x29a3('0x29')]=_[_0x29a3('0x25')](_0x4bfa45,_0x29a3('0x22'));_0x9e6b4[_0x29a3('0x2a')]=_[_0x29a3('0x2b')](_0x21f160[_0x29a3('0x2a')]);_0x9e6b4['filters']=_['intersection'](_0x9e6b4['model'],_0x9e6b4[_0x29a3('0x2a')]);_0x42be69[_0x29a3('0x2c')]=_[_0x29a3('0x2d')](_0x9e6b4[_0x29a3('0x29')],qs[_0x29a3('0x2e')](_0x21f160[_0x29a3('0x2a')][_0x29a3('0x2e')]));_0x42be69['attributes']=_0x42be69[_0x29a3('0x2c')][_0x29a3('0x2f')]?_0x42be69[_0x29a3('0x2c')]:_0x9e6b4[_0x29a3('0x29')];if(!_0x21f160[_0x29a3('0x2a')][_0x29a3('0x30')]('nolimit')){_0x42be69[_0x29a3('0x1c')]=qs[_0x29a3('0x1c')](_0x21f160[_0x29a3('0x2a')]['limit']);_0x42be69[_0x29a3('0x1a')]=qs[_0x29a3('0x1a')](_0x21f160[_0x29a3('0x2a')]['offset']);}_0x42be69[_0x29a3('0x31')]=qs[_0x29a3('0x32')](_0x21f160[_0x29a3('0x2a')][_0x29a3('0x32')]);_0x42be69[_0x29a3('0x33')]=qs[_0x29a3('0x34')](_[_0x29a3('0x35')](_0x21f160[_0x29a3('0x2a')],_0x9e6b4[_0x29a3('0x34')]),_0x4bfa45);if(_0x21f160[_0x29a3('0x2a')]['filter']){_0x42be69['where']=_[_0x29a3('0x36')](_0x42be69[_0x29a3('0x33')],{'$or':_[_0x29a3('0x25')](_0x4bfa45,function(_0x28f263){if(_0x28f263['type']!==_0x29a3('0x37')){var _0x3e6084={};_0x3e6084[_0x28f263[_0x29a3('0x22')]]={'$like':'%'+_0x21f160[_0x29a3('0x2a')][_0x29a3('0x38')]+'%'};return _0x3e6084;}})});}_0x42be69=_['merge']({},_0x42be69,_0x21f160['options']);var _0x296311={'where':_0x42be69[_0x29a3('0x33')]};return db['MailTransferReport'][_0x29a3('0x39')](_0x296311)[_0x29a3('0x3a')](function(_0xe0e808){_0x374d44['count']=_0xe0e808;if(_0x21f160[_0x29a3('0x2a')][_0x29a3('0x3b')]){_0x42be69['include']=[{'all':!![]}];}return db[_0x29a3('0x26')][_0x29a3('0x3c')](_0x42be69);})[_0x29a3('0x3a')](function(_0x279cf){_0x374d44[_0x29a3('0x3d')]=_0x279cf;return _0x374d44;})[_0x29a3('0x3a')](respondWithFilteredResult(_0x18f610,_0x42be69))[_0x29a3('0x3e')](handleError(_0x18f610,null));};exports[_0x29a3('0x3f')]=function(_0x216c2f,_0x33c70e){var _0x1ac943={'raw':!![],'where':{'id':_0x216c2f[_0x29a3('0x40')]['id']}},_0x115425={};_0x115425[_0x29a3('0x29')]=_['keys'](db['MailTransferReport'][_0x29a3('0x41')]);_0x115425[_0x29a3('0x2a')]=_[_0x29a3('0x2b')](_0x216c2f[_0x29a3('0x2a')]);_0x115425[_0x29a3('0x34')]=_['intersection'](_0x115425['model'],_0x115425[_0x29a3('0x2a')]);_0x1ac943[_0x29a3('0x2c')]=_[_0x29a3('0x2d')](_0x115425[_0x29a3('0x29')],qs['fields'](_0x216c2f[_0x29a3('0x2a')][_0x29a3('0x2e')]));_0x1ac943[_0x29a3('0x2c')]=_0x1ac943['attributes'][_0x29a3('0x2f')]?_0x1ac943[_0x29a3('0x2c')]:_0x115425[_0x29a3('0x29')];if(_0x216c2f[_0x29a3('0x2a')][_0x29a3('0x3b')]){_0x1ac943[_0x29a3('0x42')]=[{'all':!![]}];}_0x1ac943=_[_0x29a3('0x36')]({},_0x1ac943,_0x216c2f['options']);return db['MailTransferReport']['find'](_0x1ac943)['then'](handleEntityNotFound(_0x33c70e,null))[_0x29a3('0x3a')](respondWithResult(_0x33c70e,null))[_0x29a3('0x3e')](handleError(_0x33c70e,null));};exports[_0x29a3('0x43')]=function(_0x3d3e5c,_0x3f8fdc){return db[_0x29a3('0x26')][_0x29a3('0x43')](_0x3d3e5c[_0x29a3('0x44')],{})[_0x29a3('0x3a')](respondWithResult(_0x3f8fdc,0xc9))[_0x29a3('0x3e')](handleError(_0x3f8fdc,null));};exports[_0x29a3('0x45')]=function(_0x3cf0a0,_0x2cf19b){if(_0x3cf0a0[_0x29a3('0x44')]['id']){delete _0x3cf0a0[_0x29a3('0x44')]['id'];}return db[_0x29a3('0x26')][_0x29a3('0x46')]({'where':{'id':_0x3cf0a0['params']['id']}})[_0x29a3('0x3a')](handleEntityNotFound(_0x2cf19b,null))['then'](saveUpdates(_0x3cf0a0['body'],null))[_0x29a3('0x3a')](respondWithResult(_0x2cf19b,null))[_0x29a3('0x3e')](handleError(_0x2cf19b,null));};exports[_0x29a3('0x20')]=function(_0x2d4b2a,_0x545c3c){return db[_0x29a3('0x26')][_0x29a3('0x46')]({'where':{'id':_0x2d4b2a[_0x29a3('0x40')]['id']}})[_0x29a3('0x3a')](handleEntityNotFound(_0x545c3c,null))[_0x29a3('0x3a')](removeEntity(_0x545c3c,null))[_0x29a3('0x3e')](handleError(_0x545c3c,null));};exports['describe']=function(_0x2ff029,_0x313f2a){return db['MailTransferReport']['describe']()['then'](respondWithResult(_0x313f2a,null))[_0x29a3('0x3e')](handleError(_0x313f2a,null));}; \ No newline at end of file +var _0x8371=['intersection','create','body','catch','describe','eml-format','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','index','map','MailTransferReport','rawAttributes','fieldName','type','key','keys','query','filters','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','show','params'];(function(_0x525a8e,_0x158506){var _0x4617a8=function(_0x163602){while(--_0x163602){_0x525a8e['push'](_0x525a8e['shift']());}};_0x4617a8(++_0x158506);}(_0x8371,0xce));var _0x1837=function(_0x5eb8b,_0x189af2){_0x5eb8b=_0x5eb8b-0x0;var _0x261b65=_0x8371[_0x5eb8b];return _0x261b65;};'use strict';var emlformat=require(_0x1837('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x1837('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x1837('0x2'));var util=require(_0x1837('0x3'));var path=require(_0x1837('0x4'));var sox=require(_0x1837('0x5'));var csv=require(_0x1837('0x6'));var ejs=require(_0x1837('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1837('0x8'));var squel=require('squel');var crypto=require(_0x1837('0x9'));var jsforce=require(_0x1837('0xa'));var deskjs=require(_0x1837('0xb'));var toCsv=require(_0x1837('0x6'));var querystring=require(_0x1837('0xc'));var Papa=require('papaparse');var Redis=require(_0x1837('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1837('0xe'));var logger=require(_0x1837('0xf'))(_0x1837('0x10'));var utils=require(_0x1837('0x11'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x1837('0x12'))['db'];function respondWithStatusCode(_0x1448da,_0x47430d){_0x47430d=_0x47430d||0xcc;return function(_0x4b0aa5){if(_0x4b0aa5){return _0x1448da[_0x1837('0x13')](_0x47430d);}return _0x1448da[_0x1837('0x14')](_0x47430d)['end']();};}function respondWithResult(_0x514b5f,_0x242af0){_0x242af0=_0x242af0||0xc8;return function(_0x5e4cd7){if(_0x5e4cd7){return _0x514b5f[_0x1837('0x14')](_0x242af0)['json'](_0x5e4cd7);}};}function respondWithFilteredResult(_0x139af5,_0x3dd7d0){return function(_0xac69d9){if(_0xac69d9){var _0x3a0461=typeof _0x3dd7d0[_0x1837('0x15')]===_0x1837('0x16')&&typeof _0x3dd7d0['limit']===_0x1837('0x16');var _0x37abe7=_0xac69d9[_0x1837('0x17')];var _0x46c5b4=_0x3a0461?0x0:_0x3dd7d0[_0x1837('0x15')];var _0x428647=_0x3a0461?_0xac69d9['count']:_0x3dd7d0[_0x1837('0x15')]+_0x3dd7d0[_0x1837('0x18')];var _0x952a11;if(_0x428647>=_0x37abe7){_0x428647=_0x37abe7;_0x952a11=0xc8;}else{_0x952a11=0xce;}_0x139af5[_0x1837('0x14')](_0x952a11);return _0x139af5[_0x1837('0x19')](_0x1837('0x1a'),_0x46c5b4+'-'+_0x428647+'/'+_0x37abe7)['json'](_0xac69d9);}return null;};}function patchUpdates(_0xe037c8){return function(_0x154807){try{jsonpatch[_0x1837('0x1b')](_0x154807,_0xe037c8,!![]);}catch(_0x5a8a4c){return BPromise[_0x1837('0x1c')](_0x5a8a4c);}return _0x154807[_0x1837('0x1d')]();};}function saveUpdates(_0x3d4dc8,_0x2b8e9c){return function(_0xe8cce3){if(_0xe8cce3){return _0xe8cce3['update'](_0x3d4dc8)[_0x1837('0x1e')](function(_0x4c96ba){return _0x4c96ba;});}return null;};}function removeEntity(_0x14e39f,_0x5c4506){return function(_0x755fe8){if(_0x755fe8){return _0x755fe8[_0x1837('0x1f')]()[_0x1837('0x1e')](function(){_0x14e39f[_0x1837('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x18a994,_0x3e9d84){return function(_0x3833b3){if(!_0x3833b3){_0x18a994['sendStatus'](0x194);}return _0x3833b3;};}function handleError(_0x344ac1,_0x3ec9dd){_0x3ec9dd=_0x3ec9dd||0x1f4;return function(_0x4d6670){logger[_0x1837('0x20')](_0x4d6670[_0x1837('0x21')]);if(_0x4d6670[_0x1837('0x22')]){delete _0x4d6670['name'];}_0x344ac1[_0x1837('0x14')](_0x3ec9dd)['send'](_0x4d6670);};}exports[_0x1837('0x23')]=function(_0x30d8f,_0xbb2432){var _0x3ab864={},_0x233e49={},_0x49615f={'count':0x0,'rows':[]};var _0x16afb0=_[_0x1837('0x24')](db[_0x1837('0x25')][_0x1837('0x26')],function(_0x1da2af){return{'name':_0x1da2af[_0x1837('0x27')],'type':_0x1da2af[_0x1837('0x28')][_0x1837('0x29')]};});_0x233e49['model']=_[_0x1837('0x24')](_0x16afb0,_0x1837('0x22'));_0x233e49['query']=_[_0x1837('0x2a')](_0x30d8f[_0x1837('0x2b')]);_0x233e49[_0x1837('0x2c')]=_['intersection'](_0x233e49['model'],_0x233e49[_0x1837('0x2b')]);_0x3ab864[_0x1837('0x2d')]=_['intersection'](_0x233e49[_0x1837('0x2e')],qs[_0x1837('0x2f')](_0x30d8f['query']['fields']));_0x3ab864[_0x1837('0x2d')]=_0x3ab864[_0x1837('0x2d')][_0x1837('0x30')]?_0x3ab864[_0x1837('0x2d')]:_0x233e49['model'];if(!_0x30d8f[_0x1837('0x2b')][_0x1837('0x31')](_0x1837('0x32'))){_0x3ab864[_0x1837('0x18')]=qs[_0x1837('0x18')](_0x30d8f[_0x1837('0x2b')][_0x1837('0x18')]);_0x3ab864[_0x1837('0x15')]=qs[_0x1837('0x15')](_0x30d8f[_0x1837('0x2b')][_0x1837('0x15')]);}_0x3ab864['order']=qs[_0x1837('0x33')](_0x30d8f['query'][_0x1837('0x33')]);_0x3ab864[_0x1837('0x34')]=qs[_0x1837('0x2c')](_[_0x1837('0x35')](_0x30d8f[_0x1837('0x2b')],_0x233e49[_0x1837('0x2c')]),_0x16afb0);if(_0x30d8f[_0x1837('0x2b')]['filter']){_0x3ab864[_0x1837('0x34')]=_[_0x1837('0x36')](_0x3ab864[_0x1837('0x34')],{'$or':_['map'](_0x16afb0,function(_0x193ff2){if(_0x193ff2[_0x1837('0x28')]!==_0x1837('0x37')){var _0x165a0e={};_0x165a0e[_0x193ff2[_0x1837('0x22')]]={'$like':'%'+_0x30d8f[_0x1837('0x2b')][_0x1837('0x38')]+'%'};return _0x165a0e;}})});}_0x3ab864=_['merge']({},_0x3ab864,_0x30d8f[_0x1837('0x39')]);var _0x938bd0={'where':_0x3ab864[_0x1837('0x34')]};return db[_0x1837('0x25')]['count'](_0x938bd0)[_0x1837('0x1e')](function(_0x34e4c2){_0x49615f[_0x1837('0x17')]=_0x34e4c2;if(_0x30d8f[_0x1837('0x2b')][_0x1837('0x3a')]){_0x3ab864[_0x1837('0x3b')]=[{'all':!![]}];}return db[_0x1837('0x25')]['findAll'](_0x3ab864);})[_0x1837('0x1e')](function(_0x146b5d){_0x49615f['rows']=_0x146b5d;return _0x49615f;})['then'](respondWithFilteredResult(_0xbb2432,_0x3ab864))['catch'](handleError(_0xbb2432,null));};exports[_0x1837('0x3c')]=function(_0x364047,_0xbcfbb9){var _0x14ebce={'raw':!![],'where':{'id':_0x364047[_0x1837('0x3d')]['id']}},_0x5cc59d={};_0x5cc59d['model']=_[_0x1837('0x2a')](db[_0x1837('0x25')][_0x1837('0x26')]);_0x5cc59d[_0x1837('0x2b')]=_[_0x1837('0x2a')](_0x364047[_0x1837('0x2b')]);_0x5cc59d[_0x1837('0x2c')]=_[_0x1837('0x3e')](_0x5cc59d['model'],_0x5cc59d[_0x1837('0x2b')]);_0x14ebce[_0x1837('0x2d')]=_[_0x1837('0x3e')](_0x5cc59d[_0x1837('0x2e')],qs['fields'](_0x364047[_0x1837('0x2b')]['fields']));_0x14ebce[_0x1837('0x2d')]=_0x14ebce[_0x1837('0x2d')][_0x1837('0x30')]?_0x14ebce['attributes']:_0x5cc59d[_0x1837('0x2e')];if(_0x364047[_0x1837('0x2b')][_0x1837('0x3a')]){_0x14ebce[_0x1837('0x3b')]=[{'all':!![]}];}_0x14ebce=_[_0x1837('0x36')]({},_0x14ebce,_0x364047['options']);return db[_0x1837('0x25')]['find'](_0x14ebce)[_0x1837('0x1e')](handleEntityNotFound(_0xbcfbb9,null))[_0x1837('0x1e')](respondWithResult(_0xbcfbb9,null))['catch'](handleError(_0xbcfbb9,null));};exports[_0x1837('0x3f')]=function(_0x2122da,_0x7ece84){return db[_0x1837('0x25')][_0x1837('0x3f')](_0x2122da[_0x1837('0x40')],{})['then'](respondWithResult(_0x7ece84,0xc9))[_0x1837('0x41')](handleError(_0x7ece84,null));};exports['update']=function(_0x5eab7d,_0x12ae9e){if(_0x5eab7d[_0x1837('0x40')]['id']){delete _0x5eab7d['body']['id'];}return db[_0x1837('0x25')]['find']({'where':{'id':_0x5eab7d[_0x1837('0x3d')]['id']}})[_0x1837('0x1e')](handleEntityNotFound(_0x12ae9e,null))[_0x1837('0x1e')](saveUpdates(_0x5eab7d[_0x1837('0x40')],null))[_0x1837('0x1e')](respondWithResult(_0x12ae9e,null))[_0x1837('0x41')](handleError(_0x12ae9e,null));};exports[_0x1837('0x1f')]=function(_0x49777e,_0x4dad5c){return db[_0x1837('0x25')]['find']({'where':{'id':_0x49777e['params']['id']}})[_0x1837('0x1e')](handleEntityNotFound(_0x4dad5c,null))[_0x1837('0x1e')](removeEntity(_0x4dad5c,null))[_0x1837('0x41')](handleError(_0x4dad5c,null));};exports['describe']=function(_0x2b101c,_0x9a274e){return db[_0x1837('0x25')][_0x1837('0x42')]()[_0x1837('0x1e')](respondWithResult(_0x9a274e,null))['catch'](handleError(_0x9a274e,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index bb48691..c95b24c 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 _0xa6b3=['exports','MailTransferReport','report_mail_transfer','uniqueid','util','api','bluebird','request-promise','rimraf','../../config/environment','./mailTransferReport.attributes'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xa6b3,0x72));var _0x3a6b=function(_0x244965,_0x4fde7b){_0x244965=_0x244965-0x0;var _0x4cae6d=_0xa6b3[_0x244965];return _0x4cae6d;};'use strict';var _=require('lodash');var util=require(_0x3a6b('0x0'));var logger=require('../../config/logger')(_0x3a6b('0x1'));var moment=require('moment');var BPromise=require(_0x3a6b('0x2'));var rp=require(_0x3a6b('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3a6b('0x4'));var config=require(_0x3a6b('0x5'));var attributes=require(_0x3a6b('0x6'));module[_0x3a6b('0x7')]=function(_0x425173,_0x1aa276){return _0x425173['define'](_0x3a6b('0x8'),attributes,{'tableName':_0x3a6b('0x9'),'paranoid':![],'indexes':[{'name':_0x3a6b('0xa'),'fields':[_0x3a6b('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5da1=['uniqueid','api','moment','bluebird','path','../../config/environment','./mailTransferReport.attributes','define','MailTransferReport','report_mail_transfer'];(function(_0x5249b9,_0x3acf1){var _0x4f4abf=function(_0x5dfeb0){while(--_0x5dfeb0){_0x5249b9['push'](_0x5249b9['shift']());}};_0x4f4abf(++_0x3acf1);}(_0x5da1,0xbf));var _0x15da=function(_0x2aee77,_0x3fefdc){_0x2aee77=_0x2aee77-0x0;var _0xa0a8f3=_0x5da1[_0x2aee77];return _0xa0a8f3;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x15da('0x0'));var moment=require(_0x15da('0x1'));var BPromise=require(_0x15da('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x15da('0x3'));var rimraf=require('rimraf');var config=require(_0x15da('0x4'));var attributes=require(_0x15da('0x5'));module['exports']=function(_0x261900,_0x4054bd){return _0x261900[_0x15da('0x6')](_0x15da('0x7'),attributes,{'tableName':_0x15da('0x8'),'paranoid':![],'indexes':[{'name':_0x15da('0x9'),'fields':[_0x15da('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index de96864..e28831d 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 _0x1773=['MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','info','MailTransferReport,\x20%s,\x20%s','debug'];(function(_0x34bc30,_0x177cb0){var _0x5706de=function(_0x535a8c){while(--_0x535a8c){_0x34bc30['push'](_0x34bc30['shift']());}};_0x5706de(++_0x177cb0);}(_0x1773,0x14a));var _0x3177=function(_0x1f491f,_0xfb5792){_0x1f491f=_0x1f491f-0x0;var _0x2d301c=_0x1773[_0x1f491f];return _0x2d301c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3177('0x0'));var BPromise=require(_0x3177('0x1'));var rs=require(_0x3177('0x2'));var fs=require('fs');var Redis=require(_0x3177('0x3'));var db=require(_0x3177('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3177('0x5'))(_0x3177('0x6'));var config=require(_0x3177('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x3177('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x255967,_0x2de478,_0x2304df){return new BPromise(function(_0x33c5d3,_0x4fcf45){return client['request'](_0x255967,_0x2304df)['then'](function(_0x5c9c9e){logger[_0x3177('0x9')](_0x3177('0xa'),_0x2de478,'request\x20sent');logger[_0x3177('0xb')](_0x3177('0xc'),_0x2de478,'request\x20sent',JSON[_0x3177('0xd')](_0x5c9c9e));if(_0x5c9c9e[_0x3177('0xe')]){if(_0x5c9c9e['error'][_0x3177('0xf')]===0x1f4){logger[_0x3177('0xe')](_0x3177('0xa'),_0x2de478,_0x5c9c9e['error'][_0x3177('0x10')]);return _0x4fcf45(_0x5c9c9e[_0x3177('0xe')][_0x3177('0x10')]);}logger[_0x3177('0xe')]('MailTransferReport,\x20%s,\x20%s',_0x2de478,_0x5c9c9e[_0x3177('0xe')][_0x3177('0x10')]);return _0x33c5d3(_0x5c9c9e[_0x3177('0xe')][_0x3177('0x10')]);}else{logger[_0x3177('0x9')](_0x3177('0xa'),_0x2de478,'request\x20sent');_0x33c5d3(_0x5c9c9e[_0x3177('0x11')]['message']);}})[_0x3177('0x12')](function(_0x3b6b06){logger['error'](_0x3177('0xa'),_0x2de478,_0x3b6b06);_0x4fcf45(_0x3b6b06);});});} \ No newline at end of file +var _0xefbf=['MailTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','then','info','MailTransferReport,\x20%s,\x20%s','debug'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xefbf,0xbc));var _0xfefb=function(_0x3e460f,_0x40264d){_0x3e460f=_0x3e460f-0x0;var _0x1ee41b=_0xefbf[_0x3e460f];return _0x1ee41b;};'use strict';var _=require('lodash');var util=require(_0xfefb('0x0'));var moment=require('moment');var BPromise=require(_0xfefb('0x1'));var rs=require(_0xfefb('0x2'));var fs=require('fs');var Redis=require(_0xfefb('0x3'));var db=require(_0xfefb('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xfefb('0x5'))(_0xfefb('0x6'));var config=require(_0xfefb('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5648db,_0x4595d1,_0x207330){return new BPromise(function(_0x24011e,_0x1da601){return client['request'](_0x5648db,_0x207330)[_0xfefb('0x8')](function(_0x155881){logger[_0xfefb('0x9')](_0xfefb('0xa'),_0x4595d1,'request\x20sent');logger[_0xfefb('0xb')](_0xfefb('0xc'),_0x4595d1,_0xfefb('0xd'),JSON[_0xfefb('0xe')](_0x155881));if(_0x155881[_0xfefb('0xf')]){if(_0x155881[_0xfefb('0xf')][_0xfefb('0x10')]===0x1f4){logger[_0xfefb('0xf')]('MailTransferReport,\x20%s,\x20%s',_0x4595d1,_0x155881[_0xfefb('0xf')]['message']);return _0x1da601(_0x155881['error'][_0xfefb('0x11')]);}logger['error'](_0xfefb('0xa'),_0x4595d1,_0x155881[_0xfefb('0xf')]['message']);return _0x24011e(_0x155881[_0xfefb('0xf')][_0xfefb('0x11')]);}else{logger['info'](_0xfefb('0xa'),_0x4595d1,_0xfefb('0xd'));_0x24011e(_0x155881[_0xfefb('0x12')][_0xfefb('0x11')]);}})[_0xfefb('0x13')](function(_0x54377e){logger['error'](_0xfefb('0xa'),_0x4595d1,_0x54377e);_0x1da601(_0x54377e);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index bfdc440..2d6f69e 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 _0x5c19=['isAuthenticated','index','get','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller'];(function(_0xd35539,_0x3f5457){var _0x249d61=function(_0x186855){while(--_0x186855){_0xd35539['push'](_0xd35539['shift']());}};_0x249d61(++_0x3f5457);}(_0x5c19,0xa1));var _0x95c1=function(_0x34fb46,_0x2c9b1b){_0x34fb46=_0x34fb46-0x0;var _0x56800d=_0x5c19[_0x34fb46];return _0x56800d;};'use strict';var multer=require('multer');var util=require(_0x95c1('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x95c1('0x1')]();var fs_extra=require(_0x95c1('0x2'));var auth=require(_0x95c1('0x3'));var interaction=require(_0x95c1('0x4'));var config=require(_0x95c1('0x5'));var controller=require(_0x95c1('0x6'));router['get']('/',auth[_0x95c1('0x7')](),controller[_0x95c1('0x8')]);router[_0x95c1('0x9')](_0x95c1('0xa'),auth[_0x95c1('0x7')](),controller[_0x95c1('0xb')]);router[_0x95c1('0x9')](_0x95c1('0xc'),auth[_0x95c1('0x7')](),controller[_0x95c1('0xd')]);router[_0x95c1('0xe')]('/',auth[_0x95c1('0x7')](),controller[_0x95c1('0xf')]);router[_0x95c1('0x10')](_0x95c1('0xc'),auth['isAuthenticated'](),controller[_0x95c1('0x11')]);router[_0x95c1('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x95c1('0x13')]);module[_0x95c1('0x14')]=router; \ No newline at end of file +var _0xbb7a=['put','update','destroy','exports','multer','path','express','Router','fs-extra','../../components/interaction/service','./memberReport.controller','get','isAuthenticated','index','/:id','show','create'];(function(_0x2be716,_0x3fd1e4){var _0x287c18=function(_0x3c2d11){while(--_0x3c2d11){_0x2be716['push'](_0x2be716['shift']());}};_0x287c18(++_0x3fd1e4);}(_0xbb7a,0x9d));var _0xabb7=function(_0x5b8d6c,_0x2bfefe){_0x5b8d6c=_0x5b8d6c-0x0;var _0x3ab6d1=_0xbb7a[_0x5b8d6c];return _0x3ab6d1;};'use strict';var multer=require(_0xabb7('0x0'));var util=require('util');var path=require(_0xabb7('0x1'));var timeout=require('connect-timeout');var express=require(_0xabb7('0x2'));var router=express[_0xabb7('0x3')]();var fs_extra=require(_0xabb7('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xabb7('0x5'));var config=require('../../config/environment');var controller=require(_0xabb7('0x6'));router[_0xabb7('0x7')]('/',auth[_0xabb7('0x8')](),controller[_0xabb7('0x9')]);router[_0xabb7('0x7')]('/describe',auth[_0xabb7('0x8')](),controller['describe']);router[_0xabb7('0x7')](_0xabb7('0xa'),auth[_0xabb7('0x8')](),controller[_0xabb7('0xb')]);router['post']('/',auth[_0xabb7('0x8')](),controller[_0xabb7('0xc')]);router[_0xabb7('0xd')]('/:id',auth[_0xabb7('0x8')](),controller[_0xabb7('0xe')]);router['delete'](_0xabb7('0xa'),auth['isAuthenticated'](),controller[_0xabb7('0xf')]);module[_0xabb7('0x10')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index 4002e99..d3bfe9c 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 _0xcfac=['LOGIN,\x20PAUSE,\x20TALKING','DATE','getDataValue','enterAt','diff','seconds','setDataValue','exitAt','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','INTEGER','sequelize','moment','exports','STRING','DEFAULT\x20PAUSE'];(function(_0x5cb714,_0x3a4609){var _0x4b9d36=function(_0x5d2a26){while(--_0x5d2a26){_0x5cb714['push'](_0x5cb714['shift']());}};_0x4b9d36(++_0x3a4609);}(_0xcfac,0x105));var _0xccfa=function(_0x51a010,_0x4b0807){_0x51a010=_0x51a010-0x0;var _0x38b619=_0xcfac[_0x51a010];return _0x38b619;};'use strict';var Sequelize=require(_0xccfa('0x0'));var moment=require(_0xccfa('0x1'));module[_0xccfa('0x2')]={'channel':{'type':Sequelize[_0xccfa('0x3')]},'membername':{'type':Sequelize[_0xccfa('0x3')]},'interface':{'type':Sequelize[_0xccfa('0x3')]},'type':{'type':Sequelize[_0xccfa('0x3')],'defaultValue':_0xccfa('0x4'),'comment':_0xccfa('0x5')},'duration':{'type':Sequelize['INTEGER']},'enterAt':{'type':Sequelize[_0xccfa('0x6')]},'exitAt':{'type':Sequelize[_0xccfa('0x6')],'set':function(_0x2d2ddf){var _0x1ba378=moment(_0x2d2ddf);var _0x1529e7=moment(this[_0xccfa('0x7')](_0xccfa('0x8')));var _0x5c5f2f=_0x1ba378[_0xccfa('0x9')](_0x1529e7,_0xccfa('0xa'));this[_0xccfa('0xb')](_0xccfa('0xc'),_0x2d2ddf);this[_0xccfa('0xb')]('duration',_0x5c5f2f||null);}},'data1':{'type':Sequelize[_0xccfa('0x3')],'comment':_0xccfa('0xd')},'data2':{'type':Sequelize['STRING'],'comment':_0xccfa('0xe')},'data3':{'type':Sequelize[_0xccfa('0x3')],'comment':_0xccfa('0xf')},'data4':{'type':Sequelize[_0xccfa('0x3')],'comment':_0xccfa('0x10')},'data5':{'type':Sequelize['STRING'],'comment':_0xccfa('0x11')},'role':{'type':Sequelize[_0xccfa('0x3')]},'internal':{'type':Sequelize[_0xccfa('0x12')]},'uniqueid':{'type':Sequelize[_0xccfa('0x3')]}}; \ No newline at end of file +var _0x3379=['diff','seconds','setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','INTEGER','sequelize','moment','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','DATE','getDataValue'];(function(_0x3f409b,_0x385e0e){var _0x465dcd=function(_0xd174fe){while(--_0xd174fe){_0x3f409b['push'](_0x3f409b['shift']());}};_0x465dcd(++_0x385e0e);}(_0x3379,0x115));var _0x9337=function(_0x5bb5f1,_0x5d6ddd){_0x5bb5f1=_0x5bb5f1-0x0;var _0x2ef021=_0x3379[_0x5bb5f1];return _0x2ef021;};'use strict';var Sequelize=require(_0x9337('0x0'));var moment=require(_0x9337('0x1'));module[_0x9337('0x2')]={'channel':{'type':Sequelize[_0x9337('0x3')]},'membername':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x9337('0x3')]},'type':{'type':Sequelize[_0x9337('0x3')],'defaultValue':_0x9337('0x4'),'comment':_0x9337('0x5')},'duration':{'type':Sequelize['INTEGER']},'enterAt':{'type':Sequelize[_0x9337('0x6')]},'exitAt':{'type':Sequelize[_0x9337('0x6')],'set':function(_0x390772){var _0x677c38=moment(_0x390772);var _0x5a59ab=moment(this[_0x9337('0x7')]('enterAt'));var _0x268943=_0x677c38[_0x9337('0x8')](_0x5a59ab,_0x9337('0x9'));this[_0x9337('0xa')](_0x9337('0xb'),_0x390772);this['setDataValue'](_0x9337('0xc'),_0x268943||null);}},'data1':{'type':Sequelize[_0x9337('0x3')],'comment':_0x9337('0xd')},'data2':{'type':Sequelize[_0x9337('0x3')],'comment':_0x9337('0xe')},'data3':{'type':Sequelize['STRING'],'comment':_0x9337('0xf')},'data4':{'type':Sequelize[_0x9337('0x3')],'comment':_0x9337('0x10')},'data5':{'type':Sequelize[_0x9337('0x3')],'comment':_0x9337('0x11')},'role':{'type':Sequelize[_0x9337('0x3')]},'internal':{'type':Sequelize[_0x9337('0x12')]},'uniqueid':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index a111b06..58dd7fb 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 _0xedd9=['keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','find','create','body','update','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','then','end','error','stack','send','index','map','MemberReport','rawAttributes','fieldName','type','key','model','name','query'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0xedd9,0xfc));var _0x9edd=function(_0x31a268,_0x4b5616){_0x31a268=_0x31a268-0x0;var _0x2a8b21=_0xedd9[_0x31a268];return _0x2a8b21;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9edd('0x0'));var zipdir=require(_0x9edd('0x1'));var jsonpatch=require(_0x9edd('0x2'));var rp=require(_0x9edd('0x3'));var moment=require(_0x9edd('0x4'));var BPromise=require(_0x9edd('0x5'));var Mustache=require(_0x9edd('0x6'));var util=require(_0x9edd('0x7'));var path=require('path');var sox=require(_0x9edd('0x8'));var csv=require(_0x9edd('0x9'));var ejs=require(_0x9edd('0xa'));var fs=require('fs');var fs_extra=require(_0x9edd('0xb'));var _=require('lodash');var squel=require(_0x9edd('0xc'));var crypto=require('crypto');var jsforce=require(_0x9edd('0xd'));var deskjs=require(_0x9edd('0xe'));var toCsv=require(_0x9edd('0x9'));var querystring=require(_0x9edd('0xf'));var Papa=require('papaparse');var Redis=require(_0x9edd('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9edd('0x11'));var as=require(_0x9edd('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9edd('0x13'))(_0x9edd('0x14'));var utils=require('../../config/utils');var config=require(_0x9edd('0x15'));var licenseUtil=require(_0x9edd('0x16'));var db=require(_0x9edd('0x17'))['db'];function respondWithStatusCode(_0xfd544a,_0x287ddd){_0x287ddd=_0x287ddd||0xcc;return function(_0x3a7b84){if(_0x3a7b84){return _0xfd544a[_0x9edd('0x18')](_0x287ddd);}return _0xfd544a[_0x9edd('0x19')](_0x287ddd)['end']();};}function respondWithResult(_0x176bfa,_0x44fc7c){_0x44fc7c=_0x44fc7c||0xc8;return function(_0x891832){if(_0x891832){return _0x176bfa[_0x9edd('0x19')](_0x44fc7c)[_0x9edd('0x1a')](_0x891832);}};}function respondWithFilteredResult(_0x338f3c,_0x1042aa){return function(_0x75a4ab){if(_0x75a4ab){var _0x4ea60f=typeof _0x1042aa[_0x9edd('0x1b')]===_0x9edd('0x1c')&&typeof _0x1042aa[_0x9edd('0x1d')]==='undefined';var _0x1b54c0=_0x75a4ab[_0x9edd('0x1e')];var _0x40ba32=_0x4ea60f?0x0:_0x1042aa['offset'];var _0x43dc70=_0x4ea60f?_0x75a4ab['count']:_0x1042aa[_0x9edd('0x1b')]+_0x1042aa[_0x9edd('0x1d')];var _0x4bdb88;if(_0x43dc70>=_0x1b54c0){_0x43dc70=_0x1b54c0;_0x4bdb88=0xc8;}else{_0x4bdb88=0xce;}_0x338f3c['status'](_0x4bdb88);return _0x338f3c[_0x9edd('0x1f')]('Content-Range',_0x40ba32+'-'+_0x43dc70+'/'+_0x1b54c0)[_0x9edd('0x1a')](_0x75a4ab);}return null;};}function patchUpdates(_0x54a03f){return function(_0x535f37){try{jsonpatch[_0x9edd('0x20')](_0x535f37,_0x54a03f,!![]);}catch(_0x1c46a8){return BPromise['reject'](_0x1c46a8);}return _0x535f37['save']();};}function saveUpdates(_0x341d67,_0x186186){return function(_0x477878){if(_0x477878){return _0x477878['update'](_0x341d67)[_0x9edd('0x21')](function(_0x1dca43){return _0x1dca43;});}return null;};}function removeEntity(_0x44a6c1,_0x2ca65f){return function(_0x339a0d){if(_0x339a0d){return _0x339a0d['destroy']()[_0x9edd('0x21')](function(){_0x44a6c1[_0x9edd('0x19')](0xcc)[_0x9edd('0x22')]();});}};}function handleEntityNotFound(_0x2f9f86,_0x310a4d){return function(_0x4d507f){if(!_0x4d507f){_0x2f9f86['sendStatus'](0x194);}return _0x4d507f;};}function handleError(_0x3276ee,_0xfeca7b){_0xfeca7b=_0xfeca7b||0x1f4;return function(_0x8d67aa){logger[_0x9edd('0x23')](_0x8d67aa[_0x9edd('0x24')]);if(_0x8d67aa['name']){delete _0x8d67aa['name'];}_0x3276ee[_0x9edd('0x19')](_0xfeca7b)[_0x9edd('0x25')](_0x8d67aa);};}exports[_0x9edd('0x26')]=function(_0x52746a,_0x238b22){var _0x28cfae={},_0x2ae8dd={},_0x41af53={'count':0x0,'rows':[]};var _0x5eccfb=_[_0x9edd('0x27')](db[_0x9edd('0x28')][_0x9edd('0x29')],function(_0x12c1bc){return{'name':_0x12c1bc[_0x9edd('0x2a')],'type':_0x12c1bc[_0x9edd('0x2b')][_0x9edd('0x2c')]};});_0x2ae8dd[_0x9edd('0x2d')]=_[_0x9edd('0x27')](_0x5eccfb,_0x9edd('0x2e'));_0x2ae8dd[_0x9edd('0x2f')]=_[_0x9edd('0x30')](_0x52746a[_0x9edd('0x2f')]);_0x2ae8dd[_0x9edd('0x31')]=_[_0x9edd('0x32')](_0x2ae8dd['model'],_0x2ae8dd[_0x9edd('0x2f')]);_0x28cfae[_0x9edd('0x33')]=_[_0x9edd('0x32')](_0x2ae8dd['model'],qs[_0x9edd('0x34')](_0x52746a[_0x9edd('0x2f')][_0x9edd('0x34')]));_0x28cfae[_0x9edd('0x33')]=_0x28cfae[_0x9edd('0x33')][_0x9edd('0x35')]?_0x28cfae[_0x9edd('0x33')]:_0x2ae8dd[_0x9edd('0x2d')];if(!_0x52746a[_0x9edd('0x2f')][_0x9edd('0x36')](_0x9edd('0x37'))){_0x28cfae[_0x9edd('0x1d')]=qs[_0x9edd('0x1d')](_0x52746a[_0x9edd('0x2f')]['limit']);_0x28cfae[_0x9edd('0x1b')]=qs['offset'](_0x52746a[_0x9edd('0x2f')][_0x9edd('0x1b')]);}_0x28cfae[_0x9edd('0x38')]=qs[_0x9edd('0x39')](_0x52746a[_0x9edd('0x2f')]['sort']);_0x28cfae[_0x9edd('0x3a')]=qs[_0x9edd('0x31')](_[_0x9edd('0x3b')](_0x52746a[_0x9edd('0x2f')],_0x2ae8dd[_0x9edd('0x31')]),_0x5eccfb);if(_0x52746a[_0x9edd('0x2f')][_0x9edd('0x3c')]){_0x28cfae[_0x9edd('0x3a')]=_[_0x9edd('0x3d')](_0x28cfae[_0x9edd('0x3a')],{'$or':_['map'](_0x5eccfb,function(_0x231604){if(_0x231604['type']!==_0x9edd('0x3e')){var _0x5658d6={};_0x5658d6[_0x231604[_0x9edd('0x2e')]]={'$like':'%'+_0x52746a[_0x9edd('0x2f')][_0x9edd('0x3c')]+'%'};return _0x5658d6;}})});}_0x28cfae=_['merge']({},_0x28cfae,_0x52746a[_0x9edd('0x3f')]);var _0xcbd0ef={'where':_0x28cfae[_0x9edd('0x3a')]};return db['MemberReport'][_0x9edd('0x1e')](_0xcbd0ef)['then'](function(_0x1fc4fb){_0x41af53[_0x9edd('0x1e')]=_0x1fc4fb;if(_0x52746a['query'][_0x9edd('0x40')]){_0x28cfae[_0x9edd('0x41')]=[{'all':!![]}];}return db[_0x9edd('0x28')][_0x9edd('0x42')](_0x28cfae);})['then'](function(_0x449f01){_0x41af53['rows']=_0x449f01;return _0x41af53;})[_0x9edd('0x21')](respondWithFilteredResult(_0x238b22,_0x28cfae))[_0x9edd('0x43')](handleError(_0x238b22,null));};exports['show']=function(_0x318757,_0x49a128){var _0x548299={'raw':!![],'where':{'id':_0x318757[_0x9edd('0x44')]['id']}},_0x369b69={};_0x369b69[_0x9edd('0x2d')]=_[_0x9edd('0x30')](db[_0x9edd('0x28')][_0x9edd('0x29')]);_0x369b69[_0x9edd('0x2f')]=_[_0x9edd('0x30')](_0x318757[_0x9edd('0x2f')]);_0x369b69[_0x9edd('0x31')]=_[_0x9edd('0x32')](_0x369b69[_0x9edd('0x2d')],_0x369b69[_0x9edd('0x2f')]);_0x548299[_0x9edd('0x33')]=_[_0x9edd('0x32')](_0x369b69['model'],qs[_0x9edd('0x34')](_0x318757[_0x9edd('0x2f')][_0x9edd('0x34')]));_0x548299[_0x9edd('0x33')]=_0x548299[_0x9edd('0x33')][_0x9edd('0x35')]?_0x548299[_0x9edd('0x33')]:_0x369b69['model'];if(_0x318757['query']['includeAll']){_0x548299[_0x9edd('0x41')]=[{'all':!![]}];}_0x548299=_['merge']({},_0x548299,_0x318757[_0x9edd('0x3f')]);return db[_0x9edd('0x28')][_0x9edd('0x45')](_0x548299)[_0x9edd('0x21')](handleEntityNotFound(_0x49a128,null))[_0x9edd('0x21')](respondWithResult(_0x49a128,null))['catch'](handleError(_0x49a128,null));};exports[_0x9edd('0x46')]=function(_0x35e63c,_0x40e33d){return db['MemberReport'][_0x9edd('0x46')](_0x35e63c[_0x9edd('0x47')],{})[_0x9edd('0x21')](respondWithResult(_0x40e33d,0xc9))[_0x9edd('0x43')](handleError(_0x40e33d,null));};exports[_0x9edd('0x48')]=function(_0x35bdec,_0x4d4f33){if(_0x35bdec[_0x9edd('0x47')]['id']){delete _0x35bdec[_0x9edd('0x47')]['id'];}return db['MemberReport'][_0x9edd('0x45')]({'where':{'id':_0x35bdec[_0x9edd('0x44')]['id']}})['then'](handleEntityNotFound(_0x4d4f33,null))[_0x9edd('0x21')](saveUpdates(_0x35bdec[_0x9edd('0x47')],null))[_0x9edd('0x21')](respondWithResult(_0x4d4f33,null))['catch'](handleError(_0x4d4f33,null));};exports[_0x9edd('0x49')]=function(_0x151157,_0x317a60){return db[_0x9edd('0x28')]['find']({'where':{'id':_0x151157[_0x9edd('0x44')]['id']}})[_0x9edd('0x21')](handleEntityNotFound(_0x317a60,null))[_0x9edd('0x21')](removeEntity(_0x317a60,null))['catch'](handleError(_0x317a60,null));};exports[_0x9edd('0x4a')]=function(_0x21f6ce,_0x57db43){return db[_0x9edd('0x28')]['describe']()[_0x9edd('0x21')](respondWithResult(_0x57db43,null))[_0x9edd('0x43')](handleError(_0x57db43,null));}; \ No newline at end of file +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(_0xb4947e,_0x39de27){var _0x2af6df=function(_0x308271){while(--_0x308271){_0xb4947e['push'](_0xb4947e['shift']());}};_0x2af6df(++_0x39de27);}(_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['MemberReport']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['MemberReport'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['MemberReport'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x4ffc8a['params']['id']}})['then'](handleEntityNotFound(_0x19da63,null))['then'](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x4c')]=function(_0x4cf5db,_0x1cd85){return db[_0x7995('0x40')][_0x7995('0x4c')]()[_0x7995('0x26')](respondWithResult(_0x1cd85,null))[_0x7995('0x49')](handleError(_0x1cd85,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index e0dd924..cb43bd2 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 _0xedbf=['util','../../config/logger','moment','request-promise','path','rimraf','exports','membername','interface','lodash'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0xedbf,0x103));var _0xfedb=function(_0x2bc1fe,_0x45da98){_0x2bc1fe=_0x2bc1fe-0x0;var _0x1a47a5=_0xedbf[_0x2bc1fe];return _0x1a47a5;};'use strict';var _=require(_0xfedb('0x0'));var util=require(_0xfedb('0x1'));var logger=require(_0xfedb('0x2'))('api');var moment=require(_0xfedb('0x3'));var BPromise=require('bluebird');var rp=require(_0xfedb('0x4'));var fs=require('fs');var path=require(_0xfedb('0x5'));var rimraf=require(_0xfedb('0x6'));var config=require('../../config/environment');var attributes=require('./memberReport.attributes');module[_0xfedb('0x7')]=function(_0x4ae9d0,_0x47d3e5){return _0x4ae9d0['define']('MemberReport',attributes,{'tableName':'report_member','paranoid':![],'indexes':[{'name':'membername_interface','fields':[_0xfedb('0x8'),_0xfedb('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4a30=['request-promise','path','../../config/environment','./memberReport.attributes','exports','define','MemberReport','report_member','membername_interface','membername','interface','util','../../config/logger','api','moment','bluebird'];(function(_0x2545b0,_0x3691fb){var _0x19bdbb=function(_0x935340){while(--_0x935340){_0x2545b0['push'](_0x2545b0['shift']());}};_0x19bdbb(++_0x3691fb);}(_0x4a30,0xbb));var _0x04a3=function(_0x4111a5,_0x57cb18){_0x4111a5=_0x4111a5-0x0;var _0x12967a=_0x4a30[_0x4111a5];return _0x12967a;};'use strict';var _=require('lodash');var util=require(_0x04a3('0x0'));var logger=require(_0x04a3('0x1'))(_0x04a3('0x2'));var moment=require(_0x04a3('0x3'));var BPromise=require(_0x04a3('0x4'));var rp=require(_0x04a3('0x5'));var fs=require('fs');var path=require(_0x04a3('0x6'));var rimraf=require('rimraf');var config=require(_0x04a3('0x7'));var attributes=require(_0x04a3('0x8'));module[_0x04a3('0x9')]=function(_0x17c2da,_0x4a0a33){return _0x17c2da[_0x04a3('0xa')](_0x04a3('0xb'),attributes,{'tableName':_0x04a3('0xc'),'paranoid':![],'indexes':[{'name':_0x04a3('0xd'),'fields':[_0x04a3('0xe'),_0x04a3('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 155000d..09b5fcf 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 _0xc962=['body','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','MemberReport,\x20%s,\x20%s','message','catch','GetMemberReport','findAll','options','where','attributes','limit','include','map','model','CreateMemberReport','MemberReport','create','raw','info','UpdateMemberReport'];(function(_0x5e6cb8,_0x16cf56){var _0x3faeb3=function(_0x1a7355){while(--_0x1a7355){_0x5e6cb8['push'](_0x5e6cb8['shift']());}};_0x3faeb3(++_0x16cf56);}(_0xc962,0x6d));var _0x2c96=function(_0x31b37c,_0x5a6ed7){_0x31b37c=_0x31b37c-0x0;var _0x416388=_0xc962[_0x31b37c];return _0x416388;};'use strict';var _=require(_0x2c96('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2c96('0x1'));var fs=require('fs');var Redis=require(_0x2c96('0x2'));var db=require(_0x2c96('0x3'))['db'];var utils=require(_0x2c96('0x4'));var logger=require(_0x2c96('0x5'))(_0x2c96('0x6'));var config=require(_0x2c96('0x7'));var jayson=require(_0x2c96('0x8'));var client=jayson['client'][_0x2c96('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2df446,_0x1f9859,_0x17a493){return new BPromise(function(_0x13aee2,_0x36dd95){return client[_0x2c96('0xa')](_0x2df446,_0x17a493)[_0x2c96('0xb')](function(_0x30ffef){logger['info']('MemberReport,\x20%s,\x20%s',_0x1f9859,_0x2c96('0xc'));logger[_0x2c96('0xd')](_0x2c96('0xe'),_0x1f9859,_0x2c96('0xc'),JSON[_0x2c96('0xf')](_0x30ffef));if(_0x30ffef[_0x2c96('0x10')]){if(_0x30ffef['error']['code']===0x1f4){logger[_0x2c96('0x10')](_0x2c96('0x11'),_0x1f9859,_0x30ffef[_0x2c96('0x10')][_0x2c96('0x12')]);return _0x36dd95(_0x30ffef[_0x2c96('0x10')][_0x2c96('0x12')]);}logger[_0x2c96('0x10')]('MemberReport,\x20%s,\x20%s',_0x1f9859,_0x30ffef['error']['message']);return _0x13aee2(_0x30ffef[_0x2c96('0x10')][_0x2c96('0x12')]);}else{logger['info'](_0x2c96('0x11'),_0x1f9859,_0x2c96('0xc'));_0x13aee2(_0x30ffef['result'][_0x2c96('0x12')]);}})[_0x2c96('0x13')](function(_0x2b26b4){logger[_0x2c96('0x10')](_0x2c96('0x11'),_0x1f9859,_0x2b26b4);_0x36dd95(_0x2b26b4);});});}exports[_0x2c96('0x14')]=function(_0x2ccbed){var _0x2529b0=this;return new Promise(function(_0x3fde3e,_0x48b420){return db['MemberReport'][_0x2c96('0x15')]({'raw':_0x2ccbed[_0x2c96('0x16')]?_0x2ccbed[_0x2c96('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x2ccbed[_0x2c96('0x16')]?_0x2ccbed[_0x2c96('0x16')][_0x2c96('0x17')]||null:null,'attributes':_0x2ccbed['options']?_0x2ccbed[_0x2c96('0x16')][_0x2c96('0x18')]||null:null,'limit':_0x2ccbed['options']?_0x2ccbed[_0x2c96('0x16')][_0x2c96('0x19')]||null:null,'include':_0x2ccbed[_0x2c96('0x16')]?_0x2ccbed[_0x2c96('0x16')][_0x2c96('0x1a')]?_[_0x2c96('0x1b')](_0x2ccbed[_0x2c96('0x16')]['include'],function(_0x3d8b21){return{'model':db[_0x3d8b21['model']],'as':_0x3d8b21['as'],'attributes':_0x3d8b21['attributes'],'include':_0x3d8b21[_0x2c96('0x1a')]?_['map'](_0x3d8b21[_0x2c96('0x1a')],function(_0x66cd41){return{'model':db[_0x66cd41[_0x2c96('0x1c')]],'as':_0x66cd41['as'],'attributes':_0x66cd41[_0x2c96('0x18')],'include':_0x66cd41['include']?_[_0x2c96('0x1b')](_0x66cd41[_0x2c96('0x1a')],function(_0x490f14){return{'model':db[_0x490f14[_0x2c96('0x1c')]],'as':_0x490f14['as'],'attributes':_0x490f14[_0x2c96('0x18')]};}):[]};}):[]};}):[]:[]})[_0x2c96('0xb')](function(_0x1abae0){logger['info'](_0x2c96('0x14'),_0x2ccbed);logger[_0x2c96('0xd')](_0x2c96('0x14'),_0x2ccbed,JSON[_0x2c96('0xf')](_0x1abae0));_0x3fde3e(_0x1abae0);})['catch'](function(_0x19ee5d){logger[_0x2c96('0x10')]('GetMemberReport',_0x19ee5d[_0x2c96('0x12')],_0x2ccbed);_0x48b420(_0x2529b0['error'](0x1f4,_0x19ee5d[_0x2c96('0x12')]));});});};exports[_0x2c96('0x1d')]=function(_0x18df4d){var _0x363da9=this;return new Promise(function(_0x303aa3,_0x30799f){return db[_0x2c96('0x1e')][_0x2c96('0x1f')](_0x18df4d['body'],{'raw':_0x18df4d[_0x2c96('0x16')]?_0x18df4d[_0x2c96('0x16')][_0x2c96('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0xc296ca){logger[_0x2c96('0x21')](_0x2c96('0x1d'),_0x18df4d);logger['debug'](_0x2c96('0x1d'),_0x18df4d,JSON[_0x2c96('0xf')](_0xc296ca));_0x303aa3(_0xc296ca);})[_0x2c96('0x13')](function(_0xe39a58){logger[_0x2c96('0x10')]('CreateMemberReport',_0xe39a58[_0x2c96('0x12')],_0x18df4d);_0x30799f(_0x363da9[_0x2c96('0x10')](0x1f4,_0xe39a58[_0x2c96('0x12')]));});});};exports[_0x2c96('0x22')]=function(_0x3d12cf){var _0x2ed3a1=this;return new Promise(function(_0x2c1fbd,_0x171ad7){return db['MemberReport']['update'](_0x3d12cf[_0x2c96('0x23')],{'raw':_0x3d12cf[_0x2c96('0x16')]?_0x3d12cf[_0x2c96('0x16')][_0x2c96('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3d12cf['options']?_0x3d12cf[_0x2c96('0x16')]['where']||null:null,'attributes':_0x3d12cf[_0x2c96('0x16')]?_0x3d12cf[_0x2c96('0x16')][_0x2c96('0x18')]||null:null,'limit':_0x3d12cf[_0x2c96('0x16')]?_0x3d12cf[_0x2c96('0x16')]['limit']||null:null})[_0x2c96('0xb')](function(_0x498bbd){logger[_0x2c96('0x21')](_0x2c96('0x22'),_0x3d12cf);logger['debug']('UpdateMemberReport',_0x3d12cf,JSON[_0x2c96('0xf')](_0x498bbd));_0x2c1fbd(_0x498bbd);})[_0x2c96('0x13')](function(_0x1622fd){logger[_0x2c96('0x10')](_0x2c96('0x22'),_0x1622fd[_0x2c96('0x12')],_0x3d12cf);_0x171ad7(_0x2ed3a1['error'](0x1f4,_0x1622fd[_0x2c96('0x12')]));});});}; \ No newline at end of file +var _0x58e6=['model','create','body','CreateMemberReport','update','UpdateMemberReport','lodash','util','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetMemberReport','MemberReport','findAll','options','raw','where','attributes','limit','include','map'];(function(_0x544362,_0xc31c04){var _0x5c12f9=function(_0x365c8b){while(--_0x365c8b){_0x544362['push'](_0x544362['shift']());}};_0x5c12f9(++_0xc31c04);}(_0x58e6,0x1c2));var _0x658e=function(_0x45335e,_0x4f15c2){_0x45335e=_0x45335e-0x0;var _0xaf11e0=_0x58e6[_0x45335e];return _0xaf11e0;};'use strict';var _=require(_0x658e('0x0'));var util=require(_0x658e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x658e('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x658e('0x3'));var logger=require(_0x658e('0x4'))(_0x658e('0x5'));var config=require(_0x658e('0x6'));var jayson=require(_0x658e('0x7'));var client=jayson[_0x658e('0x8')][_0x658e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4ea631,_0x5460ae,_0x7a343){return new BPromise(function(_0xa73acf,_0x1e2c26){return client['request'](_0x4ea631,_0x7a343)[_0x658e('0xa')](function(_0x6ea6e){logger[_0x658e('0xb')](_0x658e('0xc'),_0x5460ae,_0x658e('0xd'));logger[_0x658e('0xe')]('MemberReport,\x20%s,\x20%s,\x20%s',_0x5460ae,'request\x20sent',JSON[_0x658e('0xf')](_0x6ea6e));if(_0x6ea6e[_0x658e('0x10')]){if(_0x6ea6e[_0x658e('0x10')][_0x658e('0x11')]===0x1f4){logger[_0x658e('0x10')](_0x658e('0xc'),_0x5460ae,_0x6ea6e[_0x658e('0x10')]['message']);return _0x1e2c26(_0x6ea6e[_0x658e('0x10')][_0x658e('0x12')]);}logger[_0x658e('0x10')](_0x658e('0xc'),_0x5460ae,_0x6ea6e['error'][_0x658e('0x12')]);return _0xa73acf(_0x6ea6e[_0x658e('0x10')]['message']);}else{logger['info'](_0x658e('0xc'),_0x5460ae,_0x658e('0xd'));_0xa73acf(_0x6ea6e[_0x658e('0x13')]['message']);}})[_0x658e('0x14')](function(_0x4f9ccd){logger[_0x658e('0x10')](_0x658e('0xc'),_0x5460ae,_0x4f9ccd);_0x1e2c26(_0x4f9ccd);});});}exports[_0x658e('0x15')]=function(_0x155db8){var _0x23bb10=this;return new Promise(function(_0x2fd15f,_0x508f72){return db[_0x658e('0x16')][_0x658e('0x17')]({'raw':_0x155db8[_0x658e('0x18')]?_0x155db8[_0x658e('0x18')][_0x658e('0x19')]===undefined?!![]:![]:!![],'where':_0x155db8['options']?_0x155db8['options'][_0x658e('0x1a')]||null:null,'attributes':_0x155db8[_0x658e('0x18')]?_0x155db8['options'][_0x658e('0x1b')]||null:null,'limit':_0x155db8[_0x658e('0x18')]?_0x155db8[_0x658e('0x18')][_0x658e('0x1c')]||null:null,'include':_0x155db8['options']?_0x155db8[_0x658e('0x18')][_0x658e('0x1d')]?_[_0x658e('0x1e')](_0x155db8[_0x658e('0x18')][_0x658e('0x1d')],function(_0x431e89){return{'model':db[_0x431e89[_0x658e('0x1f')]],'as':_0x431e89['as'],'attributes':_0x431e89[_0x658e('0x1b')],'include':_0x431e89[_0x658e('0x1d')]?_[_0x658e('0x1e')](_0x431e89[_0x658e('0x1d')],function(_0x4ec2ed){return{'model':db[_0x4ec2ed[_0x658e('0x1f')]],'as':_0x4ec2ed['as'],'attributes':_0x4ec2ed[_0x658e('0x1b')],'include':_0x4ec2ed['include']?_[_0x658e('0x1e')](_0x4ec2ed[_0x658e('0x1d')],function(_0x410642){return{'model':db[_0x410642[_0x658e('0x1f')]],'as':_0x410642['as'],'attributes':_0x410642[_0x658e('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x658e('0xa')](function(_0x5d23dd){logger['info']('GetMemberReport',_0x155db8);logger[_0x658e('0xe')](_0x658e('0x15'),_0x155db8,JSON[_0x658e('0xf')](_0x5d23dd));_0x2fd15f(_0x5d23dd);})['catch'](function(_0x5b6b33){logger[_0x658e('0x10')](_0x658e('0x15'),_0x5b6b33['message'],_0x155db8);_0x508f72(_0x23bb10['error'](0x1f4,_0x5b6b33[_0x658e('0x12')]));});});};exports['CreateMemberReport']=function(_0x2df833){var _0x190d6a=this;return new Promise(function(_0x2411ab,_0x10aabc){return db[_0x658e('0x16')][_0x658e('0x20')](_0x2df833[_0x658e('0x21')],{'raw':_0x2df833['options']?_0x2df833[_0x658e('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x658e('0xa')](function(_0x1dd959){logger['info'](_0x658e('0x22'),_0x2df833);logger[_0x658e('0xe')](_0x658e('0x22'),_0x2df833,JSON[_0x658e('0xf')](_0x1dd959));_0x2411ab(_0x1dd959);})['catch'](function(_0x4d2bd8){logger[_0x658e('0x10')](_0x658e('0x22'),_0x4d2bd8['message'],_0x2df833);_0x10aabc(_0x190d6a['error'](0x1f4,_0x4d2bd8[_0x658e('0x12')]));});});};exports['UpdateMemberReport']=function(_0x1d616a){var _0x3708e3=this;return new Promise(function(_0x3f2fe9,_0x5224d8){return db['MemberReport'][_0x658e('0x23')](_0x1d616a['body'],{'raw':_0x1d616a[_0x658e('0x18')]?_0x1d616a[_0x658e('0x18')][_0x658e('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1d616a[_0x658e('0x18')]?_0x1d616a[_0x658e('0x18')][_0x658e('0x1a')]||null:null,'attributes':_0x1d616a[_0x658e('0x18')]?_0x1d616a[_0x658e('0x18')]['attributes']||null:null,'limit':_0x1d616a['options']?_0x1d616a[_0x658e('0x18')][_0x658e('0x1c')]||null:null})['then'](function(_0x142b22){logger[_0x658e('0xb')](_0x658e('0x24'),_0x1d616a);logger['debug'](_0x658e('0x24'),_0x1d616a,JSON['stringify'](_0x142b22));_0x3f2fe9(_0x142b22);})[_0x658e('0x14')](function(_0x2a6b4d){logger[_0x658e('0x10')](_0x658e('0x24'),_0x2a6b4d[_0x658e('0x12')],_0x1d616a);_0x5224d8(_0x3708e3[_0x658e('0x10')](0x1f4,_0x2a6b4d[_0x658e('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index b2443a6..42daa33 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 _0x91d9=['util','express','fs-extra','../../config/environment','index','exports'];(function(_0x38537f,_0x252124){var _0x141e23=function(_0x2809b5){while(--_0x2809b5){_0x38537f['push'](_0x38537f['shift']());}};_0x141e23(++_0x252124);}(_0x91d9,0x1ec));var _0x991d=function(_0x1ef827,_0x4f002c){_0x1ef827=_0x1ef827-0x0;var _0x574d68=_0x91d9[_0x1ef827];return _0x574d68;};'use strict';var multer=require('multer');var util=require(_0x991d('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x991d('0x1'));var router=express['Router']();var fs_extra=require(_0x991d('0x2'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x991d('0x3'));var controller=require('./migration.controller');router['get']('/',controller[_0x991d('0x4')]);module[_0x991d('0x5')]=router; \ No newline at end of file +var _0xbe52=['../../config/environment','./migration.controller','get','index','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2a5b3b,_0x4ebe31){var _0xae665a=function(_0x59e86a){while(--_0x59e86a){_0x2a5b3b['push'](_0x2a5b3b['shift']());}};_0xae665a(++_0x4ebe31);}(_0xbe52,0x164));var _0x2be5=function(_0x131eea,_0x112132){_0x131eea=_0x131eea-0x0;var _0x49c7c0=_0xbe52[_0x131eea];return _0x49c7c0;};'use strict';var multer=require(_0x2be5('0x0'));var util=require(_0x2be5('0x1'));var path=require(_0x2be5('0x2'));var timeout=require(_0x2be5('0x3'));var express=require(_0x2be5('0x4'));var router=express['Router']();var fs_extra=require(_0x2be5('0x5'));var auth=require(_0x2be5('0x6'));var interaction=require(_0x2be5('0x7'));var config=require(_0x2be5('0x8'));var controller=require(_0x2be5('0x9'));router[_0x2be5('0xa')]('/',controller[_0x2be5('0xb')]);module[_0x2be5('0xc')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index 9d80ea0..be83181 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 _0xabe4=['exports','STRING','version','sequelize'];(function(_0x105ad4,_0x13e888){var _0x5de604=function(_0x4fb3f6){while(--_0x4fb3f6){_0x105ad4['push'](_0x105ad4['shift']());}};_0x5de604(++_0x13e888);}(_0xabe4,0x197));var _0x4abe=function(_0x95411e,_0x38b4c3){_0x95411e=_0x95411e-0x0;var _0x2c8718=_0xabe4[_0x95411e];return _0x2c8718;};'use strict';var Sequelize=require(_0x4abe('0x0'));module[_0x4abe('0x1')]={'version':{'type':Sequelize[_0x4abe('0x2')],'unique':_0x4abe('0x3')}}; \ No newline at end of file +var _0xe529=['STRING','version','sequelize'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0xe529,0x8c));var _0x9e52=function(_0x4871a9,_0x8e0e9e){_0x4871a9=_0x4871a9-0x0;var _0x43279e=_0xe529[_0x4871a9];return _0x43279e;};'use strict';var Sequelize=require(_0x9e52('0x0'));module['exports']={'version':{'type':Sequelize[_0x9e52('0x1')],'unique':_0x9e52('0x2')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index ba0edd3..bf0b479 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 _0x01cf=['merge','VIRTUAL','options','include','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','update','then','destroy','error','name','index','map','Migration','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter'];(function(_0x2c48e4,_0x3b6e4a){var _0x32a4d0=function(_0x1becc7){while(--_0x1becc7){_0x2c48e4['push'](_0x2c48e4['shift']());}};_0x32a4d0(++_0x3b6e4a);}(_0x01cf,0x190));var _0xf01c=function(_0x662865,_0x575515){_0x662865=_0x662865-0x0;var _0x1929c2=_0x01cf[_0x662865];return _0x1929c2;};'use strict';var emlformat=require(_0xf01c('0x0'));var rimraf=require(_0xf01c('0x1'));var zipdir=require(_0xf01c('0x2'));var jsonpatch=require(_0xf01c('0x3'));var rp=require('request-promise');var moment=require(_0xf01c('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf01c('0x5'));var util=require('util');var path=require(_0xf01c('0x6'));var sox=require(_0xf01c('0x7'));var csv=require(_0xf01c('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf01c('0x9'));var _=require(_0xf01c('0xa'));var squel=require(_0xf01c('0xb'));var crypto=require('crypto');var jsforce=require(_0xf01c('0xc'));var deskjs=require(_0xf01c('0xd'));var toCsv=require(_0xf01c('0x8'));var querystring=require('querystring');var Papa=require(_0xf01c('0xe'));var Redis=require(_0xf01c('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xf01c('0x10'));var as=require(_0xf01c('0x11'));var hardwareService=require(_0xf01c('0x12'));var logger=require(_0xf01c('0x13'))(_0xf01c('0x14'));var utils=require(_0xf01c('0x15'));var config=require(_0xf01c('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xf01c('0x17'))['db'];function respondWithStatusCode(_0x1d0349,_0x1527d5){_0x1527d5=_0x1527d5||0xcc;return function(_0x4ac4ae){if(_0x4ac4ae){return _0x1d0349[_0xf01c('0x18')](_0x1527d5);}return _0x1d0349[_0xf01c('0x19')](_0x1527d5)[_0xf01c('0x1a')]();};}function respondWithResult(_0x58b404,_0x25a288){_0x25a288=_0x25a288||0xc8;return function(_0x3525df){if(_0x3525df){return _0x58b404[_0xf01c('0x19')](_0x25a288)[_0xf01c('0x1b')](_0x3525df);}};}function respondWithFilteredResult(_0x241f6d,_0xc88359){return function(_0x109b5b){if(_0x109b5b){var _0x5438ba=typeof _0xc88359[_0xf01c('0x1c')]===_0xf01c('0x1d')&&typeof _0xc88359[_0xf01c('0x1e')]===_0xf01c('0x1d');var _0x35a932=_0x109b5b[_0xf01c('0x1f')];var _0x4cb8a3=_0x5438ba?0x0:_0xc88359[_0xf01c('0x1c')];var _0x9f3f92=_0x5438ba?_0x109b5b['count']:_0xc88359[_0xf01c('0x1c')]+_0xc88359[_0xf01c('0x1e')];var _0x230d91;if(_0x9f3f92>=_0x35a932){_0x9f3f92=_0x35a932;_0x230d91=0xc8;}else{_0x230d91=0xce;}_0x241f6d['status'](_0x230d91);return _0x241f6d[_0xf01c('0x20')]('Content-Range',_0x4cb8a3+'-'+_0x9f3f92+'/'+_0x35a932)['json'](_0x109b5b);}return null;};}function patchUpdates(_0x28a28d){return function(_0x49970b){try{jsonpatch[_0xf01c('0x21')](_0x49970b,_0x28a28d,!![]);}catch(_0xad0031){return BPromise[_0xf01c('0x22')](_0xad0031);}return _0x49970b['save']();};}function saveUpdates(_0x137fc7,_0x2c4635){return function(_0x1108eb){if(_0x1108eb){return _0x1108eb[_0xf01c('0x23')](_0x137fc7)[_0xf01c('0x24')](function(_0x1d532b){return _0x1d532b;});}return null;};}function removeEntity(_0x393b4c,_0x4236b5){return function(_0xb1ad07){if(_0xb1ad07){return _0xb1ad07[_0xf01c('0x25')]()[_0xf01c('0x24')](function(){_0x393b4c[_0xf01c('0x19')](0xcc)[_0xf01c('0x1a')]();});}};}function handleEntityNotFound(_0x182bfa,_0x568c4f){return function(_0x594aa3){if(!_0x594aa3){_0x182bfa[_0xf01c('0x18')](0x194);}return _0x594aa3;};}function handleError(_0x60b4ce,_0x450271){_0x450271=_0x450271||0x1f4;return function(_0x1d7686){logger[_0xf01c('0x26')](_0x1d7686['stack']);if(_0x1d7686[_0xf01c('0x27')]){delete _0x1d7686[_0xf01c('0x27')];}_0x60b4ce[_0xf01c('0x19')](_0x450271)['send'](_0x1d7686);};}exports[_0xf01c('0x28')]=function(_0x1e7ec4,_0x4983ba){var _0x5da6a3={},_0x17d616={},_0x2163c4={'count':0x0,'rows':[]};var _0x30de1c=_[_0xf01c('0x29')](db[_0xf01c('0x2a')][_0xf01c('0x2b')],function(_0x4a635e){return{'name':_0x4a635e[_0xf01c('0x2c')],'type':_0x4a635e[_0xf01c('0x2d')][_0xf01c('0x2e')]};});_0x17d616[_0xf01c('0x2f')]=_[_0xf01c('0x29')](_0x30de1c,_0xf01c('0x27'));_0x17d616['query']=_[_0xf01c('0x30')](_0x1e7ec4['query']);_0x17d616[_0xf01c('0x31')]=_[_0xf01c('0x32')](_0x17d616['model'],_0x17d616[_0xf01c('0x33')]);_0x5da6a3[_0xf01c('0x34')]=_['intersection'](_0x17d616[_0xf01c('0x2f')],qs[_0xf01c('0x35')](_0x1e7ec4[_0xf01c('0x33')][_0xf01c('0x35')]));_0x5da6a3[_0xf01c('0x34')]=_0x5da6a3['attributes'][_0xf01c('0x36')]?_0x5da6a3[_0xf01c('0x34')]:_0x17d616[_0xf01c('0x2f')];if(!_0x1e7ec4[_0xf01c('0x33')][_0xf01c('0x37')](_0xf01c('0x38'))){_0x5da6a3[_0xf01c('0x1e')]=qs[_0xf01c('0x1e')](_0x1e7ec4['query'][_0xf01c('0x1e')]);_0x5da6a3[_0xf01c('0x1c')]=qs[_0xf01c('0x1c')](_0x1e7ec4[_0xf01c('0x33')][_0xf01c('0x1c')]);}_0x5da6a3[_0xf01c('0x39')]=qs[_0xf01c('0x3a')](_0x1e7ec4[_0xf01c('0x33')]['sort']);_0x5da6a3[_0xf01c('0x3b')]=qs['filters'](_[_0xf01c('0x3c')](_0x1e7ec4[_0xf01c('0x33')],_0x17d616[_0xf01c('0x31')]),_0x30de1c);if(_0x1e7ec4[_0xf01c('0x33')][_0xf01c('0x3d')]){_0x5da6a3[_0xf01c('0x3b')]=_[_0xf01c('0x3e')](_0x5da6a3[_0xf01c('0x3b')],{'$or':_[_0xf01c('0x29')](_0x30de1c,function(_0x566d72){if(_0x566d72[_0xf01c('0x2d')]!==_0xf01c('0x3f')){var _0x24adc8={};_0x24adc8[_0x566d72[_0xf01c('0x27')]]={'$like':'%'+_0x1e7ec4[_0xf01c('0x33')]['filter']+'%'};return _0x24adc8;}})});}_0x5da6a3=_[_0xf01c('0x3e')]({},_0x5da6a3,_0x1e7ec4[_0xf01c('0x40')]);var _0x190e5f={'where':_0x5da6a3[_0xf01c('0x3b')]};return db[_0xf01c('0x2a')][_0xf01c('0x1f')](_0x190e5f)[_0xf01c('0x24')](function(_0x36dc7d){_0x2163c4['count']=_0x36dc7d;if(_0x1e7ec4[_0xf01c('0x33')]['includeAll']){_0x5da6a3[_0xf01c('0x41')]=[{'all':!![]}];}return db[_0xf01c('0x2a')]['findAll'](_0x5da6a3);})[_0xf01c('0x24')](function(_0x56727a){_0x2163c4['rows']=_0x56727a;return _0x2163c4;})[_0xf01c('0x24')](respondWithFilteredResult(_0x4983ba,_0x5da6a3))['catch'](handleError(_0x4983ba,null));}; \ No newline at end of file +var _0x1260=['model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','includeAll','findAll','rows','eml-format','rimraf','fast-json-patch','moment','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','Migration','rawAttributes','fieldName','type','key','map','query','filters','intersection'];(function(_0x260d55,_0x25239a){var _0x26c788=function(_0x162323){while(--_0x162323){_0x260d55['push'](_0x260d55['shift']());}};_0x26c788(++_0x25239a);}(_0x1260,0x15d));var _0x0126=function(_0x387a96,_0x9a8506){_0x387a96=_0x387a96-0x0;var _0x1cfdde=_0x1260[_0x387a96];return _0x1cfdde;};'use strict';var emlformat=require(_0x0126('0x0'));var rimraf=require(_0x0126('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0126('0x2'));var rp=require('request-promise');var moment=require(_0x0126('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x0126('0x4'));var path=require(_0x0126('0x5'));var sox=require(_0x0126('0x6'));var csv=require(_0x0126('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0126('0x8'));var _=require(_0x0126('0x9'));var squel=require(_0x0126('0xa'));var crypto=require(_0x0126('0xb'));var jsforce=require(_0x0126('0xc'));var deskjs=require(_0x0126('0xd'));var toCsv=require(_0x0126('0x7'));var querystring=require(_0x0126('0xe'));var Papa=require(_0x0126('0xf'));var Redis=require(_0x0126('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x0126('0x11'));var hardwareService=require(_0x0126('0x12'));var logger=require(_0x0126('0x13'))(_0x0126('0x14'));var utils=require(_0x0126('0x15'));var config=require(_0x0126('0x16'));var licenseUtil=require(_0x0126('0x17'));var db=require(_0x0126('0x18'))['db'];function respondWithStatusCode(_0xfe826d,_0x192e55){_0x192e55=_0x192e55||0xcc;return function(_0x349005){if(_0x349005){return _0xfe826d[_0x0126('0x19')](_0x192e55);}return _0xfe826d['status'](_0x192e55)[_0x0126('0x1a')]();};}function respondWithResult(_0x316d5a,_0x55cfba){_0x55cfba=_0x55cfba||0xc8;return function(_0x45c2e7){if(_0x45c2e7){return _0x316d5a[_0x0126('0x1b')](_0x55cfba)[_0x0126('0x1c')](_0x45c2e7);}};}function respondWithFilteredResult(_0x389a18,_0x12ba75){return function(_0x121003){if(_0x121003){var _0x45556f=typeof _0x12ba75[_0x0126('0x1d')]===_0x0126('0x1e')&&typeof _0x12ba75[_0x0126('0x1f')]===_0x0126('0x1e');var _0x390588=_0x121003[_0x0126('0x20')];var _0x5aba56=_0x45556f?0x0:_0x12ba75[_0x0126('0x1d')];var _0x466bf0=_0x45556f?_0x121003[_0x0126('0x20')]:_0x12ba75[_0x0126('0x1d')]+_0x12ba75[_0x0126('0x1f')];var _0x40360f;if(_0x466bf0>=_0x390588){_0x466bf0=_0x390588;_0x40360f=0xc8;}else{_0x40360f=0xce;}_0x389a18[_0x0126('0x1b')](_0x40360f);return _0x389a18['set'](_0x0126('0x21'),_0x5aba56+'-'+_0x466bf0+'/'+_0x390588)[_0x0126('0x1c')](_0x121003);}return null;};}function patchUpdates(_0x49ad88){return function(_0x4ae1bc){try{jsonpatch[_0x0126('0x22')](_0x4ae1bc,_0x49ad88,!![]);}catch(_0x217a5f){return BPromise[_0x0126('0x23')](_0x217a5f);}return _0x4ae1bc['save']();};}function saveUpdates(_0x5beed7,_0x18df37){return function(_0x464287){if(_0x464287){return _0x464287[_0x0126('0x24')](_0x5beed7)[_0x0126('0x25')](function(_0x31b4ac){return _0x31b4ac;});}return null;};}function removeEntity(_0xde1aa8,_0x16a315){return function(_0x2ba5e5){if(_0x2ba5e5){return _0x2ba5e5[_0x0126('0x26')]()[_0x0126('0x25')](function(){_0xde1aa8[_0x0126('0x1b')](0xcc)[_0x0126('0x1a')]();});}};}function handleEntityNotFound(_0x4aec8f,_0x4426a0){return function(_0x5e3727){if(!_0x5e3727){_0x4aec8f['sendStatus'](0x194);}return _0x5e3727;};}function handleError(_0x54717b,_0x397708){_0x397708=_0x397708||0x1f4;return function(_0x1fe739){logger[_0x0126('0x27')](_0x1fe739[_0x0126('0x28')]);if(_0x1fe739[_0x0126('0x29')]){delete _0x1fe739['name'];}_0x54717b['status'](_0x397708)[_0x0126('0x2a')](_0x1fe739);};}exports[_0x0126('0x2b')]=function(_0x5325e5,_0xd845d1){var _0x292114={},_0x5cb9bf={},_0x16487e={'count':0x0,'rows':[]};var _0x1bb7da=_['map'](db[_0x0126('0x2c')][_0x0126('0x2d')],function(_0xe4a3c6){return{'name':_0xe4a3c6[_0x0126('0x2e')],'type':_0xe4a3c6[_0x0126('0x2f')][_0x0126('0x30')]};});_0x5cb9bf['model']=_[_0x0126('0x31')](_0x1bb7da,_0x0126('0x29'));_0x5cb9bf[_0x0126('0x32')]=_['keys'](_0x5325e5[_0x0126('0x32')]);_0x5cb9bf[_0x0126('0x33')]=_[_0x0126('0x34')](_0x5cb9bf[_0x0126('0x35')],_0x5cb9bf[_0x0126('0x32')]);_0x292114['attributes']=_['intersection'](_0x5cb9bf[_0x0126('0x35')],qs[_0x0126('0x36')](_0x5325e5[_0x0126('0x32')][_0x0126('0x36')]));_0x292114[_0x0126('0x37')]=_0x292114[_0x0126('0x37')]['length']?_0x292114[_0x0126('0x37')]:_0x5cb9bf['model'];if(!_0x5325e5[_0x0126('0x32')][_0x0126('0x38')](_0x0126('0x39'))){_0x292114[_0x0126('0x1f')]=qs['limit'](_0x5325e5[_0x0126('0x32')][_0x0126('0x1f')]);_0x292114[_0x0126('0x1d')]=qs['offset'](_0x5325e5['query'][_0x0126('0x1d')]);}_0x292114[_0x0126('0x3a')]=qs[_0x0126('0x3b')](_0x5325e5[_0x0126('0x32')][_0x0126('0x3b')]);_0x292114[_0x0126('0x3c')]=qs[_0x0126('0x33')](_[_0x0126('0x3d')](_0x5325e5[_0x0126('0x32')],_0x5cb9bf[_0x0126('0x33')]),_0x1bb7da);if(_0x5325e5['query']['filter']){_0x292114[_0x0126('0x3c')]=_[_0x0126('0x3e')](_0x292114['where'],{'$or':_[_0x0126('0x31')](_0x1bb7da,function(_0x23d463){if(_0x23d463[_0x0126('0x2f')]!==_0x0126('0x3f')){var _0x31e610={};_0x31e610[_0x23d463['name']]={'$like':'%'+_0x5325e5[_0x0126('0x32')]['filter']+'%'};return _0x31e610;}})});}_0x292114=_[_0x0126('0x3e')]({},_0x292114,_0x5325e5['options']);var _0x71d226={'where':_0x292114[_0x0126('0x3c')]};return db[_0x0126('0x2c')][_0x0126('0x20')](_0x71d226)[_0x0126('0x25')](function(_0x28ad08){_0x16487e['count']=_0x28ad08;if(_0x5325e5[_0x0126('0x32')][_0x0126('0x40')]){_0x292114['include']=[{'all':!![]}];}return db[_0x0126('0x2c')][_0x0126('0x41')](_0x292114);})[_0x0126('0x25')](function(_0x3c7cf2){_0x16487e[_0x0126('0x42')]=_0x3c7cf2;return _0x16487e;})[_0x0126('0x25')](respondWithFilteredResult(_0xd845d1,_0x292114))['catch'](handleError(_0xd845d1,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index 5018e01..640e530 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 _0x9017=['migrations','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','Migration'];(function(_0x1c6ea2,_0x5d565a){var _0xdb5d78=function(_0x735082){while(--_0x735082){_0x1c6ea2['push'](_0x1c6ea2['shift']());}};_0xdb5d78(++_0x5d565a);}(_0x9017,0xc9));var _0x7901=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9017[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7901('0x0'));var util=require(_0x7901('0x1'));var logger=require(_0x7901('0x2'))('api');var moment=require(_0x7901('0x3'));var BPromise=require(_0x7901('0x4'));var rp=require(_0x7901('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7901('0x6'));var config=require(_0x7901('0x7'));var attributes=require('./migration.attributes');module['exports']=function(_0xa6b6d0,_0x166164){return _0xa6b6d0['define'](_0x7901('0x8'),attributes,{'tableName':_0x7901('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x56cf=['./migration.attributes','exports','define','Migration','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x30c7ca,_0x3c5c3c){var _0x52739b=function(_0x4c7f15){while(--_0x4c7f15){_0x30c7ca['push'](_0x30c7ca['shift']());}};_0x52739b(++_0x3c5c3c);}(_0x56cf,0x170));var _0xf56c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x56cf[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf56c('0x0'));var util=require(_0xf56c('0x1'));var logger=require(_0xf56c('0x2'))(_0xf56c('0x3'));var moment=require(_0xf56c('0x4'));var BPromise=require(_0xf56c('0x5'));var rp=require(_0xf56c('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf56c('0x7'));var config=require(_0xf56c('0x8'));var attributes=require(_0xf56c('0x9'));module[_0xf56c('0xa')]=function(_0x9aced6,_0x5c63ca){return _0x9aced6[_0xf56c('0xb')](_0xf56c('0xc'),attributes,{'tableName':'migrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/migration/migration.rpc.js b/server/api/migration/migration.rpc.js index b02bf99..7af7c7c 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 _0xaaa2=['randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','stringify','error','code','Migration,\x20%s,\x20%s','message','info','result','lodash','util','moment','bluebird'];(function(_0x49a84f,_0x3511e7){var _0xc79bb0=function(_0x67ac31){while(--_0x67ac31){_0x49a84f['push'](_0x49a84f['shift']());}};_0xc79bb0(++_0x3511e7);}(_0xaaa2,0xac));var _0x2aaa=function(_0x18dfc5,_0x11e545){_0x18dfc5=_0x18dfc5-0x0;var _0x51f497=_0xaaa2[_0x18dfc5];return _0x51f497;};'use strict';var _=require(_0x2aaa('0x0'));var util=require(_0x2aaa('0x1'));var moment=require(_0x2aaa('0x2'));var BPromise=require(_0x2aaa('0x3'));var rs=require(_0x2aaa('0x4'));var fs=require('fs');var Redis=require(_0x2aaa('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x2aaa('0x6'));var logger=require('../../config/logger')(_0x2aaa('0x7'));var config=require(_0x2aaa('0x8'));var jayson=require(_0x2aaa('0x9'));var client=jayson[_0x2aaa('0xa')][_0x2aaa('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x106af9,_0x4f51e6,_0x2f16d7){return new BPromise(function(_0x514c32,_0x505fe8){return client[_0x2aaa('0xc')](_0x106af9,_0x2f16d7)['then'](function(_0x1ad6e9){logger['info']('Migration,\x20%s,\x20%s',_0x4f51e6,_0x2aaa('0xd'));logger[_0x2aaa('0xe')]('Migration,\x20%s,\x20%s,\x20%s',_0x4f51e6,_0x2aaa('0xd'),JSON[_0x2aaa('0xf')](_0x1ad6e9));if(_0x1ad6e9[_0x2aaa('0x10')]){if(_0x1ad6e9['error'][_0x2aaa('0x11')]===0x1f4){logger[_0x2aaa('0x10')](_0x2aaa('0x12'),_0x4f51e6,_0x1ad6e9[_0x2aaa('0x10')][_0x2aaa('0x13')]);return _0x505fe8(_0x1ad6e9[_0x2aaa('0x10')][_0x2aaa('0x13')]);}logger[_0x2aaa('0x10')](_0x2aaa('0x12'),_0x4f51e6,_0x1ad6e9[_0x2aaa('0x10')][_0x2aaa('0x13')]);return _0x514c32(_0x1ad6e9[_0x2aaa('0x10')]['message']);}else{logger[_0x2aaa('0x14')]('Migration,\x20%s,\x20%s',_0x4f51e6,_0x2aaa('0xd'));_0x514c32(_0x1ad6e9[_0x2aaa('0x15')]['message']);}})['catch'](function(_0x50a767){logger[_0x2aaa('0x10')](_0x2aaa('0x12'),_0x4f51e6,_0x50a767);_0x505fe8(_0x50a767);});});} \ No newline at end of file +var _0x1120=['stringify','error','code','message','catch','lodash','util','moment','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s'];(function(_0x4203a4,_0x56b4de){var _0x2cc285=function(_0x21318f){while(--_0x21318f){_0x4203a4['push'](_0x4203a4['shift']());}};_0x2cc285(++_0x56b4de);}(_0x1120,0x140));var _0x0112=function(_0x1e6e4e,_0x2b1b09){_0x1e6e4e=_0x1e6e4e-0x0;var _0x3d746b=_0x1120[_0x1e6e4e];return _0x3d746b;};'use strict';var _=require(_0x0112('0x0'));var util=require(_0x0112('0x1'));var moment=require(_0x0112('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x0112('0x3'));var logger=require(_0x0112('0x4'))(_0x0112('0x5'));var config=require(_0x0112('0x6'));var jayson=require(_0x0112('0x7'));var client=jayson[_0x0112('0x8')][_0x0112('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x40ad0d,_0x31d67a,_0x444422){return new BPromise(function(_0x2fd18c,_0x1e87af){return client['request'](_0x40ad0d,_0x444422)[_0x0112('0xa')](function(_0x26fd2e){logger[_0x0112('0xb')](_0x0112('0xc'),_0x31d67a,_0x0112('0xd'));logger[_0x0112('0xe')](_0x0112('0xf'),_0x31d67a,'request\x20sent',JSON[_0x0112('0x10')](_0x26fd2e));if(_0x26fd2e[_0x0112('0x11')]){if(_0x26fd2e[_0x0112('0x11')][_0x0112('0x12')]===0x1f4){logger['error'](_0x0112('0xc'),_0x31d67a,_0x26fd2e[_0x0112('0x11')][_0x0112('0x13')]);return _0x1e87af(_0x26fd2e[_0x0112('0x11')]['message']);}logger['error'](_0x0112('0xc'),_0x31d67a,_0x26fd2e['error'][_0x0112('0x13')]);return _0x2fd18c(_0x26fd2e['error'][_0x0112('0x13')]);}else{logger[_0x0112('0xb')](_0x0112('0xc'),_0x31d67a,_0x0112('0xd'));_0x2fd18c(_0x26fd2e['result'][_0x0112('0x13')]);}})[_0x0112('0x14')](function(_0x5ef9fe){logger['error']('Migration,\x20%s,\x20%s',_0x31d67a,_0x5ef9fe);_0x1e87af(_0x5ef9fe);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index b4cd898..e51a3c7 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 _0x9536=['connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./network.controller','get','index','/:id','isAuthenticated','show','create','put','update','delete','destroy','exports','multer','util','path'];(function(_0x591d02,_0x3ac586){var _0x5958f4=function(_0x3d913a){while(--_0x3d913a){_0x591d02['push'](_0x591d02['shift']());}};_0x5958f4(++_0x3ac586);}(_0x9536,0x179));var _0x6953=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x9536[_0x465a0c];return _0x1e202e;};'use strict';var multer=require(_0x6953('0x0'));var util=require(_0x6953('0x1'));var path=require(_0x6953('0x2'));var timeout=require(_0x6953('0x3'));var express=require('express');var router=express[_0x6953('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6953('0x5'));var interaction=require(_0x6953('0x6'));var config=require(_0x6953('0x7'));var controller=require(_0x6953('0x8'));router[_0x6953('0x9')]('/',auth['isAuthenticated'](),controller[_0x6953('0xa')]);router[_0x6953('0x9')](_0x6953('0xb'),auth[_0x6953('0xc')](),controller[_0x6953('0xd')]);router['post']('/',auth[_0x6953('0xc')](),controller[_0x6953('0xe')]);router[_0x6953('0xf')]('/:id',auth[_0x6953('0xc')](),controller[_0x6953('0x10')]);router[_0x6953('0x11')](_0x6953('0xb'),auth[_0x6953('0xc')](),controller[_0x6953('0x12')]);module[_0x6953('0x13')]=router; \ No newline at end of file +var _0xbf40=['/:id','show','create','put','delete','destroy','exports','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./network.controller','get','isAuthenticated','index'];(function(_0x580647,_0x43d2c3){var _0x5f0792=function(_0x386cef){while(--_0x386cef){_0x580647['push'](_0x580647['shift']());}};_0x5f0792(++_0x43d2c3);}(_0xbf40,0x1f4));var _0x0bf4=function(_0x45783c,_0x49c56d){_0x45783c=_0x45783c-0x0;var _0x1161da=_0xbf40[_0x45783c];return _0x1161da;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x0bf4('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0bf4('0x1')]();var fs_extra=require(_0x0bf4('0x2'));var auth=require(_0x0bf4('0x3'));var interaction=require(_0x0bf4('0x4'));var config=require(_0x0bf4('0x5'));var controller=require(_0x0bf4('0x6'));router[_0x0bf4('0x7')]('/',auth[_0x0bf4('0x8')](),controller[_0x0bf4('0x9')]);router[_0x0bf4('0x7')](_0x0bf4('0xa'),auth['isAuthenticated'](),controller[_0x0bf4('0xb')]);router['post']('/',auth[_0x0bf4('0x8')](),controller[_0x0bf4('0xc')]);router[_0x0bf4('0xd')](_0x0bf4('0xa'),auth[_0x0bf4('0x8')](),controller['update']);router[_0x0bf4('0xe')](_0x0bf4('0xa'),auth[_0x0bf4('0x8')](),controller[_0x0bf4('0xf')]);module[_0x0bf4('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 0006800..f962eee 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 _0xf713=['localnet','externip','stun','STRING','sequelize','exports','ENUM'];(function(_0x107848,_0x1f4f5f){var _0x4da5e1=function(_0x276067){while(--_0x276067){_0x107848['push'](_0x107848['shift']());}};_0x4da5e1(++_0x1f4f5f);}(_0xf713,0xeb));var _0x3f71=function(_0x45adb4,_0x2abb06){_0x45adb4=_0x45adb4-0x0;var _0x137296=_0xf713[_0x45adb4];return _0x137296;};'use strict';var Sequelize=require(_0x3f71('0x0'));module[_0x3f71('0x1')]={'type':{'type':Sequelize[_0x3f71('0x2')](_0x3f71('0x3'),_0x3f71('0x4'),_0x3f71('0x5'),'turn')},'value':{'type':Sequelize[_0x3f71('0x6')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xad25=['localnet','externip','turn','sequelize','exports'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xad25,0xcb));var _0x5ad2=function(_0x599f41,_0x4db732){_0x599f41=_0x599f41-0x0;var _0x2e4d58=_0xad25[_0x599f41];return _0x2e4d58;};'use strict';var Sequelize=require(_0x5ad2('0x0'));module[_0x5ad2('0x1')]={'type':{'type':Sequelize['ENUM'](_0x5ad2('0x2'),_0x5ad2('0x3'),'stun',_0x5ad2('0x4'))},'value':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING']},'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 25ea578..7e4ddfb 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 _0xe1c3=['map','Network','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','rawAttributes','length','find','create','transaction','body','toUpperCase','STUN','readFileSync','join','root','utf8','render','Reload','res_stun_monitor.so','server/files/templates/turn_multiple.ejs','writeFileSync','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','update','sequelize','/etc/asterisk/stun_xcally.conf','TURN','destroy','server/files/templates/stun_multiple.ejs','eml-format','rimraf','zip-dir','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','jayson/promise','client','http','request','then','info','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','error','Network,\x20%s,\x20%s','message','catch','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','save','name','send','index'];(function(_0x1bee7a,_0xacfa2a){var _0x5d69d7=function(_0x3b8891){while(--_0x3b8891){_0x1bee7a['push'](_0x1bee7a['shift']());}};_0x5d69d7(++_0xacfa2a);}(_0xe1c3,0x1de));var _0x3e1c=function(_0x2ef8ac,_0x46d2cd){_0x2ef8ac=_0x2ef8ac-0x0;var _0x2bb01f=_0xe1c3[_0x2ef8ac];return _0x2bb01f;};'use strict';var emlformat=require(_0x3e1c('0x0'));var rimraf=require(_0x3e1c('0x1'));var zipdir=require(_0x3e1c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3e1c('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x3e1c('0x4'));var util=require(_0x3e1c('0x5'));var path=require('path');var sox=require(_0x3e1c('0x6'));var csv=require(_0x3e1c('0x7'));var ejs=require(_0x3e1c('0x8'));var fs=require('fs');var fs_extra=require(_0x3e1c('0x9'));var _=require(_0x3e1c('0xa'));var squel=require(_0x3e1c('0xb'));var crypto=require('crypto');var jsforce=require(_0x3e1c('0xc'));var deskjs=require(_0x3e1c('0xd'));var toCsv=require('to-csv');var querystring=require(_0x3e1c('0xe'));var Papa=require('papaparse');var Redis=require(_0x3e1c('0xf'));var authService=require(_0x3e1c('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x3e1c('0x11'));var hardwareService=require(_0x3e1c('0x12'));var logger=require(_0x3e1c('0x13'))(_0x3e1c('0x14'));var utils=require(_0x3e1c('0x15'));var config=require(_0x3e1c('0x16'));var licenseUtil=require(_0x3e1c('0x17'));var db=require('../../mysqldb')['db'];var jayson=require(_0x3e1c('0x18'));var client=jayson[_0x3e1c('0x19')][_0x3e1c('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x430710,_0x179ea3,_0xebd44,_0x2956e5){return new BPromise(function(_0xcce3c9,_0x158e34){var _0x47620e=_0x2956e5||client;return _0x47620e[_0x3e1c('0x1b')](_0x430710,_0xebd44)[_0x3e1c('0x1c')](function(_0x3e2d90){logger[_0x3e1c('0x1d')]('Network,\x20%s,\x20%s',_0x179ea3,_0x3e1c('0x1e'));logger[_0x3e1c('0x1f')](_0x3e1c('0x20'),_0x179ea3,_0x3e1c('0x1e'),JSON['stringify'](_0x3e2d90));if(_0x3e2d90[_0x3e1c('0x21')]){if(_0x3e2d90['error']['code']===0x1f4){logger[_0x3e1c('0x21')](_0x3e1c('0x22'),_0x179ea3,_0x3e2d90[_0x3e1c('0x21')]['message']);return _0x158e34(_0x3e2d90[_0x3e1c('0x21')][_0x3e1c('0x23')]);}logger[_0x3e1c('0x21')](_0x3e1c('0x22'),_0x179ea3,_0x3e2d90[_0x3e1c('0x21')]['message']);return _0xcce3c9(_0x3e2d90[_0x3e1c('0x21')][_0x3e1c('0x23')]);}else{logger['info']('Network,\x20%s,\x20%s',_0x179ea3,_0x3e1c('0x1e'));_0xcce3c9(_0x3e2d90['result'][_0x3e1c('0x23')]);}})[_0x3e1c('0x24')](function(_0x23dacf){logger[_0x3e1c('0x21')](_0x3e1c('0x22'),_0x179ea3,_0x23dacf);_0x158e34(_0x23dacf);});});}function respondWithStatusCode(_0x22b977,_0x5f08c8){_0x5f08c8=_0x5f08c8||0xcc;return function(_0x4e0fa2){if(_0x4e0fa2){return _0x22b977[_0x3e1c('0x25')](_0x5f08c8);}return _0x22b977[_0x3e1c('0x26')](_0x5f08c8)[_0x3e1c('0x27')]();};}function respondWithResult(_0x575097,_0x394e9f){_0x394e9f=_0x394e9f||0xc8;return function(_0x14541e){if(_0x14541e){return _0x575097['status'](_0x394e9f)[_0x3e1c('0x28')](_0x14541e);}};}function respondWithFilteredResult(_0xef7ac3,_0x4ae385){return function(_0x3959d1){if(_0x3959d1){var _0x54925e=typeof _0x4ae385[_0x3e1c('0x29')]==='undefined'&&typeof _0x4ae385[_0x3e1c('0x2a')]===_0x3e1c('0x2b');var _0xb13ed=_0x3959d1[_0x3e1c('0x2c')];var _0x1d46da=_0x54925e?0x0:_0x4ae385['offset'];var _0x4f5f2e=_0x54925e?_0x3959d1[_0x3e1c('0x2c')]:_0x4ae385[_0x3e1c('0x29')]+_0x4ae385[_0x3e1c('0x2a')];var _0x3c5cfe;if(_0x4f5f2e>=_0xb13ed){_0x4f5f2e=_0xb13ed;_0x3c5cfe=0xc8;}else{_0x3c5cfe=0xce;}_0xef7ac3[_0x3e1c('0x26')](_0x3c5cfe);return _0xef7ac3[_0x3e1c('0x2d')]('Content-Range',_0x1d46da+'-'+_0x4f5f2e+'/'+_0xb13ed)[_0x3e1c('0x28')](_0x3959d1);}return null;};}function patchUpdates(_0x46ae67){return function(_0x40605c){try{jsonpatch[_0x3e1c('0x2e')](_0x40605c,_0x46ae67,!![]);}catch(_0x587520){return BPromise[_0x3e1c('0x2f')](_0x587520);}return _0x40605c[_0x3e1c('0x30')]();};}function saveUpdates(_0x3d4314,_0x978ed1){return function(_0xf293f0){if(_0xf293f0){return _0xf293f0['update'](_0x3d4314)[_0x3e1c('0x1c')](function(_0x59dd35){return _0x59dd35;});}return null;};}function removeEntity(_0xdb3a3b,_0x982a88){return function(_0x2477eb){if(_0x2477eb){return _0x2477eb['destroy']()['then'](function(){_0xdb3a3b[_0x3e1c('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9a42a3,_0x10c462){return function(_0x3bd773){if(!_0x3bd773){_0x9a42a3[_0x3e1c('0x25')](0x194);}return _0x3bd773;};}function handleError(_0x46c47c,_0x4e25eb){_0x4e25eb=_0x4e25eb||0x1f4;return function(_0x15b5cd){logger[_0x3e1c('0x21')](_0x15b5cd['stack']);if(_0x15b5cd['name']){delete _0x15b5cd[_0x3e1c('0x31')];}_0x46c47c[_0x3e1c('0x26')](_0x4e25eb)[_0x3e1c('0x32')](_0x15b5cd);};}exports[_0x3e1c('0x33')]=function(_0xc6857e,_0x49fda0){var _0x54e903={},_0x19baaa={},_0x37e209={'count':0x0,'rows':[]};var _0x5d5221=_[_0x3e1c('0x34')](db[_0x3e1c('0x35')]['rawAttributes'],function(_0x176cec){return{'name':_0x176cec[_0x3e1c('0x36')],'type':_0x176cec[_0x3e1c('0x37')][_0x3e1c('0x38')]};});_0x19baaa['model']=_[_0x3e1c('0x34')](_0x5d5221,_0x3e1c('0x31'));_0x19baaa[_0x3e1c('0x39')]=_[_0x3e1c('0x3a')](_0xc6857e[_0x3e1c('0x39')]);_0x19baaa[_0x3e1c('0x3b')]=_[_0x3e1c('0x3c')](_0x19baaa['model'],_0x19baaa[_0x3e1c('0x39')]);_0x54e903['attributes']=_[_0x3e1c('0x3c')](_0x19baaa[_0x3e1c('0x3d')],qs[_0x3e1c('0x3e')](_0xc6857e[_0x3e1c('0x39')][_0x3e1c('0x3e')]));_0x54e903[_0x3e1c('0x3f')]=_0x54e903[_0x3e1c('0x3f')]['length']?_0x54e903[_0x3e1c('0x3f')]:_0x19baaa['model'];if(!_0xc6857e[_0x3e1c('0x39')][_0x3e1c('0x40')]('nolimit')){_0x54e903[_0x3e1c('0x2a')]=qs[_0x3e1c('0x2a')](_0xc6857e[_0x3e1c('0x39')][_0x3e1c('0x2a')]);_0x54e903[_0x3e1c('0x29')]=qs[_0x3e1c('0x29')](_0xc6857e['query'][_0x3e1c('0x29')]);}_0x54e903['order']=qs['sort'](_0xc6857e[_0x3e1c('0x39')][_0x3e1c('0x41')]);_0x54e903[_0x3e1c('0x42')]=qs[_0x3e1c('0x3b')](_[_0x3e1c('0x43')](_0xc6857e['query'],_0x19baaa['filters']),_0x5d5221);if(_0xc6857e[_0x3e1c('0x39')][_0x3e1c('0x44')]){_0x54e903['where']=_[_0x3e1c('0x45')](_0x54e903[_0x3e1c('0x42')],{'$or':_['map'](_0x5d5221,function(_0x1cdc4b){if(_0x1cdc4b['type']!==_0x3e1c('0x46')){var _0x1bcd72={};_0x1bcd72[_0x1cdc4b[_0x3e1c('0x31')]]={'$like':'%'+_0xc6857e[_0x3e1c('0x39')][_0x3e1c('0x44')]+'%'};return _0x1bcd72;}})});}_0x54e903=_[_0x3e1c('0x45')]({},_0x54e903,_0xc6857e[_0x3e1c('0x47')]);var _0xc44aa={'where':_0x54e903[_0x3e1c('0x42')]};return db[_0x3e1c('0x35')]['count'](_0xc44aa)['then'](function(_0x56c8d1){_0x37e209['count']=_0x56c8d1;if(_0xc6857e[_0x3e1c('0x39')][_0x3e1c('0x48')]){_0x54e903[_0x3e1c('0x49')]=[{'all':!![]}];}return db['Network'][_0x3e1c('0x4a')](_0x54e903);})[_0x3e1c('0x1c')](function(_0x5a7f95){_0x37e209['rows']=_0x5a7f95;return _0x37e209;})['then'](respondWithFilteredResult(_0x49fda0,_0x54e903))[_0x3e1c('0x24')](handleError(_0x49fda0,null));};exports[_0x3e1c('0x4b')]=function(_0x4a6eb4,_0x2b2ae4){var _0x8ce839={'raw':!![],'where':{'id':_0x4a6eb4[_0x3e1c('0x4c')]['id']}},_0x5aca5e={};_0x5aca5e[_0x3e1c('0x3d')]=_[_0x3e1c('0x3a')](db[_0x3e1c('0x35')][_0x3e1c('0x4d')]);_0x5aca5e[_0x3e1c('0x39')]=_[_0x3e1c('0x3a')](_0x4a6eb4[_0x3e1c('0x39')]);_0x5aca5e[_0x3e1c('0x3b')]=_['intersection'](_0x5aca5e[_0x3e1c('0x3d')],_0x5aca5e[_0x3e1c('0x39')]);_0x8ce839[_0x3e1c('0x3f')]=_[_0x3e1c('0x3c')](_0x5aca5e['model'],qs[_0x3e1c('0x3e')](_0x4a6eb4['query'][_0x3e1c('0x3e')]));_0x8ce839[_0x3e1c('0x3f')]=_0x8ce839[_0x3e1c('0x3f')][_0x3e1c('0x4e')]?_0x8ce839[_0x3e1c('0x3f')]:_0x5aca5e[_0x3e1c('0x3d')];if(_0x4a6eb4[_0x3e1c('0x39')][_0x3e1c('0x48')]){_0x8ce839[_0x3e1c('0x49')]=[{'all':!![]}];}_0x8ce839=_[_0x3e1c('0x45')]({},_0x8ce839,_0x4a6eb4[_0x3e1c('0x47')]);return db[_0x3e1c('0x35')][_0x3e1c('0x4f')](_0x8ce839)[_0x3e1c('0x1c')](handleEntityNotFound(_0x2b2ae4,null))[_0x3e1c('0x1c')](respondWithResult(_0x2b2ae4,null))[_0x3e1c('0x24')](handleError(_0x2b2ae4,null));};exports[_0x3e1c('0x50')]=function(_0x5a00d2,_0xac842d,_0x549f26){var _0x2bc181;return db['sequelize'][_0x3e1c('0x51')](function(_0x458772){return db[_0x3e1c('0x35')][_0x3e1c('0x50')](_0x5a00d2[_0x3e1c('0x52')],{'raw':!![]})[_0x3e1c('0x1c')](function(_0x28e898){_0x2bc181=_0x28e898;return db['Network']['findAll']({'where':{'type':_0x5a00d2[_0x3e1c('0x52')][_0x3e1c('0x37')]},'raw':!![]});})[_0x3e1c('0x1c')](function(_0x5da612){if(_0x2bc181[_0x3e1c('0x37')][_0x3e1c('0x53')]()==_0x3e1c('0x54')){var _0x2a02ec=fs[_0x3e1c('0x55')](path[_0x3e1c('0x56')](config[_0x3e1c('0x57')],'server/files/templates/stun_multiple.ejs'),_0x3e1c('0x58'));var _0x71cfe9=ejs[_0x3e1c('0x59')](_0x2a02ec,{'networks':_0x5da612||[]});fs['writeFileSync']('/etc/asterisk/stun_xcally.conf',_0x71cfe9);return respondWithRpcPromise(_0x3e1c('0x5a'),_0x3e1c('0x50'),{'module':_0x3e1c('0x5b')});}else if(_0x2bc181[_0x3e1c('0x37')][_0x3e1c('0x53')]()=='TURN'){var _0x103430=fs[_0x3e1c('0x55')](path['join'](config['root'],_0x3e1c('0x5c')),_0x3e1c('0x58'));var _0x26978f=ejs[_0x3e1c('0x59')](_0x103430,{'networks':_0x5da612||[]});fs[_0x3e1c('0x5d')](_0x3e1c('0x5e'),_0x26978f);return respondWithRpcPromise(_0x3e1c('0x5a'),_0x3e1c('0x50'),{'module':_0x3e1c('0x5b')});}else{var _0x16c01c=fs[_0x3e1c('0x55')](path[_0x3e1c('0x56')](config['root'],_0x3e1c('0x5f')),_0x3e1c('0x58'));var _0x2acf20=ejs['render'](_0x16c01c,{'networks':_0x5da612||[]});fs[_0x3e1c('0x5d')](util[_0x3e1c('0x60')](_0x3e1c('0x61'),_0x5a00d2[_0x3e1c('0x52')][_0x3e1c('0x37')][_0x3e1c('0x62')]()),_0x2acf20);return respondWithRpcPromise('Reload',_0x3e1c('0x50'),{'module':_0x3e1c('0x63')});}return null;})['then'](function(){return _0x2bc181;});})[_0x3e1c('0x1c')](respondWithResult(_0xac842d,0xc9))[_0x3e1c('0x24')](handleError(_0xac842d,null));};exports[_0x3e1c('0x64')]=function(_0x4dd17e,_0x3276ec,_0x4d05de){var _0x60ad0a;return db[_0x3e1c('0x65')]['transaction'](function(_0xd6f304){return db[_0x3e1c('0x35')]['find']({'where':{'id':_0x4dd17e['params']['id']}})[_0x3e1c('0x1c')](handleEntityNotFound(_0x3276ec,null))['then'](saveUpdates(_0x4dd17e[_0x3e1c('0x52')],null))['then'](function(_0x23b596){if(_0x23b596){_0x60ad0a=_0x23b596;return db[_0x3e1c('0x35')]['findAll']({'where':{'type':_0x60ad0a[_0x3e1c('0x37')]},'raw':!![]});}return null;})['then'](function(_0x3408fc){if(_0x60ad0a['type'][_0x3e1c('0x53')]()==_0x3e1c('0x54')){var _0xa3db55=fs[_0x3e1c('0x55')](path['join'](config[_0x3e1c('0x57')],'server/files/templates/stun_multiple.ejs'),'utf8');var _0x46a950=ejs[_0x3e1c('0x59')](_0xa3db55,{'networks':_0x3408fc||[]});fs[_0x3e1c('0x5d')](_0x3e1c('0x66'),_0x46a950);return respondWithRpcPromise(_0x3e1c('0x5a'),'update',{'module':_0x3e1c('0x5b')});}else if(_0x60ad0a[_0x3e1c('0x37')][_0x3e1c('0x53')]()==_0x3e1c('0x67')){var _0x1efaa4=fs[_0x3e1c('0x55')](path[_0x3e1c('0x56')](config['root'],'server/files/templates/turn_multiple.ejs'),'utf8');var _0x50c9af=ejs['render'](_0x1efaa4,{'networks':_0x3408fc||[]});fs[_0x3e1c('0x5d')]('/etc/asterisk/turn_xcally.conf',_0x50c9af);return respondWithRpcPromise(_0x3e1c('0x5a'),_0x3e1c('0x64'),{'module':_0x3e1c('0x5b')});}else{var _0x419b1b=fs[_0x3e1c('0x55')](path[_0x3e1c('0x56')](config[_0x3e1c('0x57')],_0x3e1c('0x5f')),_0x3e1c('0x58'));var _0x1bc0ef=ejs[_0x3e1c('0x59')](_0x419b1b,{'networks':_0x3408fc||[]});fs['writeFileSync'](util[_0x3e1c('0x60')](_0x3e1c('0x61'),_0x4dd17e[_0x3e1c('0x52')][_0x3e1c('0x37')]['toLowerCase']()),_0x1bc0ef);return respondWithRpcPromise(_0x3e1c('0x5a'),_0x3e1c('0x64'),{'module':_0x3e1c('0x63')});}return null;})[_0x3e1c('0x1c')](function(_0xb0c4ee){if(_0xb0c4ee){return _0x60ad0a;}return null;});})[_0x3e1c('0x1c')](respondWithResult(_0x3276ec,null))['catch'](handleError(_0x3276ec,null));};exports[_0x3e1c('0x68')]=function(_0x12238c,_0x23b7e7,_0x3f97b1){var _0x28885c;return db['Network']['find']({'where':{'id':_0x12238c[_0x3e1c('0x4c')]['id']}})['then'](function(_0x10aa21){_0x28885c=_0x10aa21;return _0x10aa21;})[_0x3e1c('0x1c')](handleEntityNotFound(_0x23b7e7,null))[_0x3e1c('0x1c')](removeEntity(_0x23b7e7,null))['then'](function(){if(_0x28885c){return db[_0x3e1c('0x35')]['findAll']({'where':{'type':_0x28885c[_0x3e1c('0x37')]},'raw':!![]});}})[_0x3e1c('0x1c')](function(_0x309ada){if(_0x28885c[_0x3e1c('0x37')][_0x3e1c('0x53')]()=='STUN'){var _0x159635=fs[_0x3e1c('0x55')](path['join'](config['root'],_0x3e1c('0x69')),'utf8');var _0x50e9e8=ejs[_0x3e1c('0x59')](_0x159635,{'networks':_0x309ada||[]});fs[_0x3e1c('0x5d')](_0x3e1c('0x66'),_0x50e9e8);return respondWithRpcPromise(_0x3e1c('0x5a'),'destroy',{'module':_0x3e1c('0x5b')});}else if(_0x28885c[_0x3e1c('0x37')]['toUpperCase']()=='TURN'){var _0x2d12d1=fs[_0x3e1c('0x55')](path['join'](config[_0x3e1c('0x57')],'server/files/templates/turn_multiple.ejs'),'utf8');var _0x2e923f=ejs[_0x3e1c('0x59')](_0x2d12d1,{'networks':_0x309ada||[]});fs[_0x3e1c('0x5d')](_0x3e1c('0x5e'),_0x2e923f);return respondWithRpcPromise('Reload',_0x3e1c('0x68'),{'module':_0x3e1c('0x5b')});}else{var _0x175b58=fs[_0x3e1c('0x55')](path[_0x3e1c('0x56')](config['root'],_0x3e1c('0x5f')),'utf8');var _0x294cf4=ejs[_0x3e1c('0x59')](_0x175b58,{'networks':_0x309ada||[]});fs[_0x3e1c('0x5d')](util[_0x3e1c('0x60')](_0x3e1c('0x61'),_0x12238c['body'][_0x3e1c('0x37')][_0x3e1c('0x62')]()),_0x294cf4);return respondWithRpcPromise(_0x3e1c('0x5a'),_0x3e1c('0x68'),{'module':_0x3e1c('0x63')});}return null;})[_0x3e1c('0x24')](handleError(_0x23b7e7,null));}; \ No newline at end of file +var _0x2029=['filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','params','Network','include','find','catch','create','body','toUpperCase','STUN','readFileSync','root','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','TURN','join','server/files/templates/turn_multiple.ejs','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','update','transaction','/etc/asterisk/turn_xcally.conf','res_stun_monitor.so','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','sendStatus','end','status','json','undefined','count','offset','limit','Content-Range','save','destroy','name','send','map','rawAttributes','fieldName','type','query','keys'];(function(_0x4934aa,_0x55d2a3){var _0x59dd38=function(_0x306717){while(--_0x306717){_0x4934aa['push'](_0x4934aa['shift']());}};_0x59dd38(++_0x55d2a3);}(_0x2029,0x171));var _0x9202=function(_0x174363,_0x9477c){_0x174363=_0x174363-0x0;var _0x329ae3=_0x2029[_0x174363];return _0x329ae3;};'use strict';var emlformat=require(_0x9202('0x0'));var rimraf=require(_0x9202('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9202('0x2'));var rp=require(_0x9202('0x3'));var moment=require(_0x9202('0x4'));var BPromise=require(_0x9202('0x5'));var Mustache=require(_0x9202('0x6'));var util=require(_0x9202('0x7'));var path=require(_0x9202('0x8'));var sox=require(_0x9202('0x9'));var csv=require(_0x9202('0xa'));var ejs=require(_0x9202('0xb'));var fs=require('fs');var fs_extra=require(_0x9202('0xc'));var _=require(_0x9202('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x9202('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x9202('0xa'));var querystring=require(_0x9202('0xf'));var Papa=require('papaparse');var Redis=require(_0x9202('0x10'));var authService=require(_0x9202('0x11'));var qs=require(_0x9202('0x12'));var as=require(_0x9202('0x13'));var hardwareService=require(_0x9202('0x14'));var logger=require(_0x9202('0x15'))(_0x9202('0x16'));var utils=require(_0x9202('0x17'));var config=require(_0x9202('0x18'));var licenseUtil=require(_0x9202('0x19'));var db=require(_0x9202('0x1a'))['db'];var jayson=require(_0x9202('0x1b'));var client=jayson[_0x9202('0x1c')][_0x9202('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x1890ac,_0x4093bc,_0x152ef0,_0x597e0f){return new BPromise(function(_0x45cec7,_0x24e8fe){var _0x22e15d=_0x597e0f||client;return _0x22e15d[_0x9202('0x1e')](_0x1890ac,_0x152ef0)[_0x9202('0x1f')](function(_0x141a17){logger[_0x9202('0x20')](_0x9202('0x21'),_0x4093bc,_0x9202('0x22'));logger[_0x9202('0x23')]('Network,\x20%s,\x20%s,\x20%s',_0x4093bc,_0x9202('0x22'),JSON[_0x9202('0x24')](_0x141a17));if(_0x141a17[_0x9202('0x25')]){if(_0x141a17[_0x9202('0x25')][_0x9202('0x26')]===0x1f4){logger[_0x9202('0x25')](_0x9202('0x21'),_0x4093bc,_0x141a17[_0x9202('0x25')][_0x9202('0x27')]);return _0x24e8fe(_0x141a17['error']['message']);}logger[_0x9202('0x25')](_0x9202('0x21'),_0x4093bc,_0x141a17[_0x9202('0x25')][_0x9202('0x27')]);return _0x45cec7(_0x141a17['error'][_0x9202('0x27')]);}else{logger['info'](_0x9202('0x21'),_0x4093bc,_0x9202('0x22'));_0x45cec7(_0x141a17['result'][_0x9202('0x27')]);}})['catch'](function(_0x2b0ef1){logger[_0x9202('0x25')](_0x9202('0x21'),_0x4093bc,_0x2b0ef1);_0x24e8fe(_0x2b0ef1);});});}function respondWithStatusCode(_0x35fbf8,_0x2cdeb8){_0x2cdeb8=_0x2cdeb8||0xcc;return function(_0xf535c6){if(_0xf535c6){return _0x35fbf8[_0x9202('0x28')](_0x2cdeb8);}return _0x35fbf8['status'](_0x2cdeb8)[_0x9202('0x29')]();};}function respondWithResult(_0x22c330,_0x2dab50){_0x2dab50=_0x2dab50||0xc8;return function(_0x2f4988){if(_0x2f4988){return _0x22c330[_0x9202('0x2a')](_0x2dab50)[_0x9202('0x2b')](_0x2f4988);}};}function respondWithFilteredResult(_0x547328,_0x42756e){return function(_0x2484ef){if(_0x2484ef){var _0x3ecfc6=typeof _0x42756e['offset']==='undefined'&&typeof _0x42756e['limit']===_0x9202('0x2c');var _0x17d7e8=_0x2484ef[_0x9202('0x2d')];var _0x5459a0=_0x3ecfc6?0x0:_0x42756e[_0x9202('0x2e')];var _0x5e9ca2=_0x3ecfc6?_0x2484ef[_0x9202('0x2d')]:_0x42756e[_0x9202('0x2e')]+_0x42756e[_0x9202('0x2f')];var _0x1223a4;if(_0x5e9ca2>=_0x17d7e8){_0x5e9ca2=_0x17d7e8;_0x1223a4=0xc8;}else{_0x1223a4=0xce;}_0x547328[_0x9202('0x2a')](_0x1223a4);return _0x547328['set'](_0x9202('0x30'),_0x5459a0+'-'+_0x5e9ca2+'/'+_0x17d7e8)['json'](_0x2484ef);}return null;};}function patchUpdates(_0x1666ed){return function(_0x390f8f){try{jsonpatch['apply'](_0x390f8f,_0x1666ed,!![]);}catch(_0x5b4170){return BPromise['reject'](_0x5b4170);}return _0x390f8f[_0x9202('0x31')]();};}function saveUpdates(_0xbe9701,_0x251254){return function(_0x3766ce){if(_0x3766ce){return _0x3766ce['update'](_0xbe9701)[_0x9202('0x1f')](function(_0x1c0d75){return _0x1c0d75;});}return null;};}function removeEntity(_0x15591f,_0x4e7c30){return function(_0x2de068){if(_0x2de068){return _0x2de068[_0x9202('0x32')]()[_0x9202('0x1f')](function(){_0x15591f[_0x9202('0x2a')](0xcc)[_0x9202('0x29')]();});}};}function handleEntityNotFound(_0x46519a,_0xa4564a){return function(_0x46d641){if(!_0x46d641){_0x46519a[_0x9202('0x28')](0x194);}return _0x46d641;};}function handleError(_0x2bf740,_0x26697a){_0x26697a=_0x26697a||0x1f4;return function(_0x3f34ca){logger[_0x9202('0x25')](_0x3f34ca['stack']);if(_0x3f34ca[_0x9202('0x33')]){delete _0x3f34ca[_0x9202('0x33')];}_0x2bf740['status'](_0x26697a)[_0x9202('0x34')](_0x3f34ca);};}exports['index']=function(_0x9ce64,_0x265220){var _0x3308e4={},_0x3c4c1f={},_0xd688c6={'count':0x0,'rows':[]};var _0x538109=_[_0x9202('0x35')](db['Network'][_0x9202('0x36')],function(_0xc0da2a){return{'name':_0xc0da2a[_0x9202('0x37')],'type':_0xc0da2a[_0x9202('0x38')]['key']};});_0x3c4c1f['model']=_['map'](_0x538109,_0x9202('0x33'));_0x3c4c1f[_0x9202('0x39')]=_[_0x9202('0x3a')](_0x9ce64[_0x9202('0x39')]);_0x3c4c1f[_0x9202('0x3b')]=_['intersection'](_0x3c4c1f[_0x9202('0x3c')],_0x3c4c1f[_0x9202('0x39')]);_0x3308e4[_0x9202('0x3d')]=_[_0x9202('0x3e')](_0x3c4c1f[_0x9202('0x3c')],qs['fields'](_0x9ce64[_0x9202('0x39')][_0x9202('0x3f')]));_0x3308e4[_0x9202('0x3d')]=_0x3308e4[_0x9202('0x3d')][_0x9202('0x40')]?_0x3308e4[_0x9202('0x3d')]:_0x3c4c1f['model'];if(!_0x9ce64[_0x9202('0x39')][_0x9202('0x41')](_0x9202('0x42'))){_0x3308e4[_0x9202('0x2f')]=qs[_0x9202('0x2f')](_0x9ce64['query'][_0x9202('0x2f')]);_0x3308e4[_0x9202('0x2e')]=qs[_0x9202('0x2e')](_0x9ce64[_0x9202('0x39')]['offset']);}_0x3308e4[_0x9202('0x43')]=qs['sort'](_0x9ce64[_0x9202('0x39')][_0x9202('0x44')]);_0x3308e4['where']=qs['filters'](_[_0x9202('0x45')](_0x9ce64['query'],_0x3c4c1f[_0x9202('0x3b')]),_0x538109);if(_0x9ce64[_0x9202('0x39')][_0x9202('0x46')]){_0x3308e4[_0x9202('0x47')]=_[_0x9202('0x48')](_0x3308e4[_0x9202('0x47')],{'$or':_['map'](_0x538109,function(_0x725c70){if(_0x725c70[_0x9202('0x38')]!==_0x9202('0x49')){var _0x2327b1={};_0x2327b1[_0x725c70['name']]={'$like':'%'+_0x9ce64['query'][_0x9202('0x46')]+'%'};return _0x2327b1;}})});}_0x3308e4=_[_0x9202('0x48')]({},_0x3308e4,_0x9ce64[_0x9202('0x4a')]);var _0x5c1930={'where':_0x3308e4['where']};return db['Network'][_0x9202('0x2d')](_0x5c1930)[_0x9202('0x1f')](function(_0x36b6c9){_0xd688c6[_0x9202('0x2d')]=_0x36b6c9;if(_0x9ce64[_0x9202('0x39')][_0x9202('0x4b')]){_0x3308e4['include']=[{'all':!![]}];}return db['Network'][_0x9202('0x4c')](_0x3308e4);})[_0x9202('0x1f')](function(_0x132b50){_0xd688c6[_0x9202('0x4d')]=_0x132b50;return _0xd688c6;})['then'](respondWithFilteredResult(_0x265220,_0x3308e4))['catch'](handleError(_0x265220,null));};exports['show']=function(_0x448784,_0x411c3a){var _0x4b9d05={'raw':!![],'where':{'id':_0x448784[_0x9202('0x4e')]['id']}},_0x2b12a7={};_0x2b12a7[_0x9202('0x3c')]=_[_0x9202('0x3a')](db[_0x9202('0x4f')][_0x9202('0x36')]);_0x2b12a7[_0x9202('0x39')]=_['keys'](_0x448784[_0x9202('0x39')]);_0x2b12a7[_0x9202('0x3b')]=_[_0x9202('0x3e')](_0x2b12a7['model'],_0x2b12a7[_0x9202('0x39')]);_0x4b9d05[_0x9202('0x3d')]=_[_0x9202('0x3e')](_0x2b12a7[_0x9202('0x3c')],qs['fields'](_0x448784[_0x9202('0x39')]['fields']));_0x4b9d05[_0x9202('0x3d')]=_0x4b9d05[_0x9202('0x3d')][_0x9202('0x40')]?_0x4b9d05[_0x9202('0x3d')]:_0x2b12a7[_0x9202('0x3c')];if(_0x448784[_0x9202('0x39')][_0x9202('0x4b')]){_0x4b9d05[_0x9202('0x50')]=[{'all':!![]}];}_0x4b9d05=_[_0x9202('0x48')]({},_0x4b9d05,_0x448784[_0x9202('0x4a')]);return db[_0x9202('0x4f')][_0x9202('0x51')](_0x4b9d05)[_0x9202('0x1f')](handleEntityNotFound(_0x411c3a,null))[_0x9202('0x1f')](respondWithResult(_0x411c3a,null))[_0x9202('0x52')](handleError(_0x411c3a,null));};exports[_0x9202('0x53')]=function(_0xc366dc,_0x5cbe49,_0x5e072c){var _0xba47e7;return db['sequelize']['transaction'](function(_0xf9757){return db[_0x9202('0x4f')][_0x9202('0x53')](_0xc366dc[_0x9202('0x54')],{'raw':!![]})['then'](function(_0x38f8cf){_0xba47e7=_0x38f8cf;return db[_0x9202('0x4f')][_0x9202('0x4c')]({'where':{'type':_0xc366dc[_0x9202('0x54')][_0x9202('0x38')]},'raw':!![]});})['then'](function(_0x2b2724){if(_0xba47e7[_0x9202('0x38')][_0x9202('0x55')]()==_0x9202('0x56')){var _0x5b0ece=fs[_0x9202('0x57')](path['join'](config[_0x9202('0x58')],_0x9202('0x59')),_0x9202('0x5a'));var _0x556031=ejs[_0x9202('0x5b')](_0x5b0ece,{'networks':_0x2b2724||[]});fs[_0x9202('0x5c')](_0x9202('0x5d'),_0x556031);return respondWithRpcPromise(_0x9202('0x5e'),'create',{'module':'res_stun_monitor.so'});}else if(_0xba47e7[_0x9202('0x38')][_0x9202('0x55')]()==_0x9202('0x5f')){var _0x6e1b88=fs[_0x9202('0x57')](path[_0x9202('0x60')](config['root'],_0x9202('0x61')),_0x9202('0x5a'));var _0x5689cf=ejs[_0x9202('0x5b')](_0x6e1b88,{'networks':_0x2b2724||[]});fs[_0x9202('0x5c')]('/etc/asterisk/turn_xcally.conf',_0x5689cf);return respondWithRpcPromise('Reload',_0x9202('0x53'),{'module':'res_stun_monitor.so'});}else{var _0x590f9f=fs[_0x9202('0x57')](path[_0x9202('0x60')](config[_0x9202('0x58')],_0x9202('0x62')),_0x9202('0x5a'));var _0x1e6be4=ejs[_0x9202('0x5b')](_0x590f9f,{'networks':_0x2b2724||[]});fs[_0x9202('0x5c')](util[_0x9202('0x63')](_0x9202('0x64'),_0xc366dc[_0x9202('0x54')][_0x9202('0x38')][_0x9202('0x65')]()),_0x1e6be4);return respondWithRpcPromise(_0x9202('0x5e'),_0x9202('0x53'),{'module':_0x9202('0x66')});}return null;})[_0x9202('0x1f')](function(){return _0xba47e7;});})[_0x9202('0x1f')](respondWithResult(_0x5cbe49,0xc9))['catch'](handleError(_0x5cbe49,null));};exports[_0x9202('0x67')]=function(_0xdef345,_0x3013bf,_0x28e852){var _0x24d03b;return db['sequelize'][_0x9202('0x68')](function(_0x2e84c9){return db[_0x9202('0x4f')][_0x9202('0x51')]({'where':{'id':_0xdef345['params']['id']}})[_0x9202('0x1f')](handleEntityNotFound(_0x3013bf,null))['then'](saveUpdates(_0xdef345[_0x9202('0x54')],null))[_0x9202('0x1f')](function(_0x5209ba){if(_0x5209ba){_0x24d03b=_0x5209ba;return db[_0x9202('0x4f')][_0x9202('0x4c')]({'where':{'type':_0x24d03b['type']},'raw':!![]});}return null;})[_0x9202('0x1f')](function(_0x12b935){if(_0x24d03b[_0x9202('0x38')][_0x9202('0x55')]()==_0x9202('0x56')){var _0x1a552b=fs[_0x9202('0x57')](path[_0x9202('0x60')](config['root'],'server/files/templates/stun_multiple.ejs'),_0x9202('0x5a'));var _0x409167=ejs[_0x9202('0x5b')](_0x1a552b,{'networks':_0x12b935||[]});fs[_0x9202('0x5c')](_0x9202('0x5d'),_0x409167);return respondWithRpcPromise(_0x9202('0x5e'),_0x9202('0x67'),{'module':'res_stun_monitor.so'});}else if(_0x24d03b[_0x9202('0x38')][_0x9202('0x55')]()==_0x9202('0x5f')){var _0x562719=fs[_0x9202('0x57')](path[_0x9202('0x60')](config[_0x9202('0x58')],'server/files/templates/turn_multiple.ejs'),_0x9202('0x5a'));var _0xc4cdee=ejs[_0x9202('0x5b')](_0x562719,{'networks':_0x12b935||[]});fs['writeFileSync'](_0x9202('0x69'),_0xc4cdee);return respondWithRpcPromise(_0x9202('0x5e'),'update',{'module':_0x9202('0x6a')});}else{var _0x9bdac9=fs[_0x9202('0x57')](path[_0x9202('0x60')](config[_0x9202('0x58')],'server/files/templates/network.ejs'),_0x9202('0x5a'));var _0x13135f=ejs[_0x9202('0x5b')](_0x9bdac9,{'networks':_0x12b935||[]});fs[_0x9202('0x5c')](util[_0x9202('0x63')](_0x9202('0x64'),_0xdef345[_0x9202('0x54')][_0x9202('0x38')][_0x9202('0x65')]()),_0x13135f);return respondWithRpcPromise('Reload','update',{'module':_0x9202('0x66')});}return null;})['then'](function(_0x2e3f76){if(_0x2e3f76){return _0x24d03b;}return null;});})[_0x9202('0x1f')](respondWithResult(_0x3013bf,null))[_0x9202('0x52')](handleError(_0x3013bf,null));};exports['destroy']=function(_0xbc1c7b,_0x1c267e,_0x1563ce){var _0x4794ed;return db[_0x9202('0x4f')][_0x9202('0x51')]({'where':{'id':_0xbc1c7b[_0x9202('0x4e')]['id']}})[_0x9202('0x1f')](function(_0x13b3c8){_0x4794ed=_0x13b3c8;return _0x13b3c8;})['then'](handleEntityNotFound(_0x1c267e,null))[_0x9202('0x1f')](removeEntity(_0x1c267e,null))[_0x9202('0x1f')](function(){if(_0x4794ed){return db[_0x9202('0x4f')][_0x9202('0x4c')]({'where':{'type':_0x4794ed[_0x9202('0x38')]},'raw':!![]});}})['then'](function(_0x151838){if(_0x4794ed[_0x9202('0x38')]['toUpperCase']()==_0x9202('0x56')){var _0x44d1c5=fs[_0x9202('0x57')](path[_0x9202('0x60')](config[_0x9202('0x58')],_0x9202('0x59')),_0x9202('0x5a'));var _0x25c6a4=ejs[_0x9202('0x5b')](_0x44d1c5,{'networks':_0x151838||[]});fs[_0x9202('0x5c')](_0x9202('0x5d'),_0x25c6a4);return respondWithRpcPromise(_0x9202('0x5e'),_0x9202('0x32'),{'module':_0x9202('0x6a')});}else if(_0x4794ed[_0x9202('0x38')]['toUpperCase']()==_0x9202('0x5f')){var _0x349809=fs[_0x9202('0x57')](path[_0x9202('0x60')](config[_0x9202('0x58')],'server/files/templates/turn_multiple.ejs'),_0x9202('0x5a'));var _0x1163ee=ejs[_0x9202('0x5b')](_0x349809,{'networks':_0x151838||[]});fs[_0x9202('0x5c')](_0x9202('0x69'),_0x1163ee);return respondWithRpcPromise('Reload',_0x9202('0x32'),{'module':_0x9202('0x6a')});}else{var _0x3b7e14=fs[_0x9202('0x57')](path[_0x9202('0x60')](config[_0x9202('0x58')],'server/files/templates/network.ejs'),_0x9202('0x5a'));var _0x513a67=ejs['render'](_0x3b7e14,{'networks':_0x151838||[]});fs[_0x9202('0x5c')](util[_0x9202('0x63')]('/etc/asterisk/sip_xcally_%s.conf',_0xbc1c7b[_0x9202('0x54')][_0x9202('0x38')][_0x9202('0x65')]()),_0x513a67);return respondWithRpcPromise('Reload',_0x9202('0x32'),{'module':_0x9202('0x66')});}return null;})['catch'](handleError(_0x1c267e,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index 6f202a3..2400f0c 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 _0x3667=['network','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./network.attributes','exports','Network'];(function(_0x4cf48,_0x32239a){var _0x112a8d=function(_0x50c34a){while(--_0x50c34a){_0x4cf48['push'](_0x4cf48['shift']());}};_0x112a8d(++_0x32239a);}(_0x3667,0xcd));var _0x7366=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3667[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7366('0x0'));var util=require(_0x7366('0x1'));var logger=require(_0x7366('0x2'))(_0x7366('0x3'));var moment=require(_0x7366('0x4'));var BPromise=require('bluebird');var rp=require(_0x7366('0x5'));var fs=require('fs');var path=require(_0x7366('0x6'));var rimraf=require('rimraf');var config=require(_0x7366('0x7'));var attributes=require(_0x7366('0x8'));module[_0x7366('0x9')]=function(_0x1c0cf4,_0x101e3d){return _0x1c0cf4['define'](_0x7366('0xa'),attributes,{'tableName':_0x7366('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd3d1=['../../config/environment','./network.attributes','exports','define','Network','network','lodash','util','moment','bluebird','request-promise','path','rimraf'];(function(_0x323728,_0x2c419b){var _0x4ad0c3=function(_0x475577){while(--_0x475577){_0x323728['push'](_0x323728['shift']());}};_0x4ad0c3(++_0x2c419b);}(_0xd3d1,0x172));var _0x1d3d=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0xd3d1[_0x413feb];return _0x40ee88;};'use strict';var _=require(_0x1d3d('0x0'));var util=require(_0x1d3d('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x1d3d('0x2'));var BPromise=require(_0x1d3d('0x3'));var rp=require(_0x1d3d('0x4'));var fs=require('fs');var path=require(_0x1d3d('0x5'));var rimraf=require(_0x1d3d('0x6'));var config=require(_0x1d3d('0x7'));var attributes=require(_0x1d3d('0x8'));module[_0x1d3d('0x9')]=function(_0x1cbe06,_0x449475){return _0x1cbe06[_0x1d3d('0xa')](_0x1d3d('0xb'),attributes,{'tableName':_0x1d3d('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 1f2e022..b76b87f 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(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x7a54,0x106));var _0x47a5=function(_0x1dfcaa,_0x39635c){_0x1dfcaa=_0x1dfcaa-0x0;var _0x55d4b9=_0x7a54[_0x1dfcaa];return _0x55d4b9;};'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 _0x7a54=['info','Network,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x7a54,0x106));var _0x47a5=function(_0x3ec75d,_0x169449){_0x3ec75d=_0x3ec75d-0x0;var _0x12c33c=_0x7a54[_0x3ec75d];return _0x12c33c;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Network,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index 8212fb4..0be026a 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 _0x7cc0=['/:id/dispositions','removeDispositions','removeAnswers','removeAgents','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','isAuthenticated','show','/:id/canned_answers','getAnswers','getApplications','/:id/interactions','getInteractions','/:id/users','getAgents','create','post','addDisposition','addAnswer','/:id/notify','notify','/:id/applications','addApplications','/:id/send','send','put','/:id','update','delete'];(function(_0x25a4c3,_0x47a662){var _0x3f7c43=function(_0x374f5b){while(--_0x374f5b){_0x25a4c3['push'](_0x25a4c3['shift']());}};_0x3f7c43(++_0x47a662);}(_0x7cc0,0x15b));var _0x07cc=function(_0x6a8397,_0x150428){_0x6a8397=_0x6a8397-0x0;var _0x2d56e6=_0x7cc0[_0x6a8397];return _0x2d56e6;};'use strict';var multer=require(_0x07cc('0x0'));var util=require(_0x07cc('0x1'));var path=require('path');var timeout=require(_0x07cc('0x2'));var express=require('express');var router=express[_0x07cc('0x3')]();var fs_extra=require(_0x07cc('0x4'));var auth=require(_0x07cc('0x5'));var interaction=require(_0x07cc('0x6'));var config=require(_0x07cc('0x7'));var controller=require(_0x07cc('0x8'));router[_0x07cc('0x9')]('/',auth[_0x07cc('0xa')](),controller['index']);router[_0x07cc('0x9')]('/describe',auth[_0x07cc('0xa')](),controller['describe']);router[_0x07cc('0x9')]('/:id',auth[_0x07cc('0xa')](),controller[_0x07cc('0xb')]);router[_0x07cc('0x9')]('/:id/dispositions',auth[_0x07cc('0xa')](),controller['getDispositions']);router[_0x07cc('0x9')](_0x07cc('0xc'),auth['isAuthenticated'](),controller[_0x07cc('0xd')]);router[_0x07cc('0x9')]('/:id/applications',auth[_0x07cc('0xa')](),controller[_0x07cc('0xe')]);router['get'](_0x07cc('0xf'),auth[_0x07cc('0xa')](),controller[_0x07cc('0x10')]);router[_0x07cc('0x9')](_0x07cc('0x11'),auth[_0x07cc('0xa')](),controller[_0x07cc('0x12')]);router['post']('/',auth[_0x07cc('0xa')](),controller[_0x07cc('0x13')]);router[_0x07cc('0x14')]('/:id/dispositions',auth[_0x07cc('0xa')](),controller[_0x07cc('0x15')]);router[_0x07cc('0x14')](_0x07cc('0xc'),auth[_0x07cc('0xa')](),controller[_0x07cc('0x16')]);router[_0x07cc('0x14')](_0x07cc('0x17'),controller[_0x07cc('0x18')]);router[_0x07cc('0x14')](_0x07cc('0x19'),auth[_0x07cc('0xa')](),controller[_0x07cc('0x1a')]);router[_0x07cc('0x14')](_0x07cc('0x11'),auth[_0x07cc('0xa')](),controller['addAgents']);router[_0x07cc('0x14')](_0x07cc('0x1b'),auth[_0x07cc('0xa')](),controller[_0x07cc('0x1c')]);router[_0x07cc('0x1d')](_0x07cc('0x1e'),auth[_0x07cc('0xa')](),controller[_0x07cc('0x1f')]);router[_0x07cc('0x20')](_0x07cc('0x1e'),auth[_0x07cc('0xa')](),controller['destroy']);router[_0x07cc('0x20')](_0x07cc('0x21'),auth[_0x07cc('0xa')](),controller[_0x07cc('0x22')]);router['delete'](_0x07cc('0xc'),auth[_0x07cc('0xa')](),controller[_0x07cc('0x23')]);router[_0x07cc('0x20')](_0x07cc('0x11'),auth[_0x07cc('0xa')](),controller[_0x07cc('0x24')]);module[_0x07cc('0x25')]=router; \ No newline at end of file +var _0x4769=['/describe','describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','getApplications','/:id/interactions','getInteractions','getAgents','create','post','/:id/notify','notify','/:id/applications','addApplications','/:id/users','addAgents','/:id/send','send','update','destroy','delete','removeAnswers','removeAgents','exports','util','Router','fs-extra','../../components/interaction/service','get','isAuthenticated','index'];(function(_0x2b7c7,_0x2635c7){var _0x5a394c=function(_0x17eeea){while(--_0x17eeea){_0x2b7c7['push'](_0x2b7c7['shift']());}};_0x5a394c(++_0x2635c7);}(_0x4769,0x164));var _0x9476=function(_0x1f6224,_0x39ffdc){_0x1f6224=_0x1f6224-0x0;var _0x1ee572=_0x4769[_0x1f6224];return _0x1ee572;};'use strict';var multer=require('multer');var util=require(_0x9476('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9476('0x1')]();var fs_extra=require(_0x9476('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x9476('0x3'));var config=require('../../config/environment');var controller=require('./openchannelAccount.controller');router[_0x9476('0x4')]('/',auth[_0x9476('0x5')](),controller[_0x9476('0x6')]);router[_0x9476('0x4')](_0x9476('0x7'),auth['isAuthenticated'](),controller[_0x9476('0x8')]);router[_0x9476('0x4')](_0x9476('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x9476('0x4')](_0x9476('0xa'),auth[_0x9476('0x5')](),controller[_0x9476('0xb')]);router[_0x9476('0x4')](_0x9476('0xc'),auth[_0x9476('0x5')](),controller['getAnswers']);router[_0x9476('0x4')]('/:id/applications',auth['isAuthenticated'](),controller[_0x9476('0xd')]);router['get'](_0x9476('0xe'),auth['isAuthenticated'](),controller[_0x9476('0xf')]);router[_0x9476('0x4')]('/:id/users',auth['isAuthenticated'](),controller[_0x9476('0x10')]);router['post']('/',auth[_0x9476('0x5')](),controller[_0x9476('0x11')]);router[_0x9476('0x12')](_0x9476('0xa'),auth[_0x9476('0x5')](),controller['addDisposition']);router[_0x9476('0x12')](_0x9476('0xc'),auth[_0x9476('0x5')](),controller['addAnswer']);router[_0x9476('0x12')](_0x9476('0x13'),controller[_0x9476('0x14')]);router['post'](_0x9476('0x15'),auth['isAuthenticated'](),controller[_0x9476('0x16')]);router[_0x9476('0x12')](_0x9476('0x17'),auth[_0x9476('0x5')](),controller[_0x9476('0x18')]);router[_0x9476('0x12')](_0x9476('0x19'),auth['isAuthenticated'](),controller[_0x9476('0x1a')]);router['put']('/:id',auth[_0x9476('0x5')](),controller[_0x9476('0x1b')]);router['delete'](_0x9476('0x9'),auth[_0x9476('0x5')](),controller[_0x9476('0x1c')]);router[_0x9476('0x1d')]('/:id/dispositions',auth[_0x9476('0x5')](),controller['removeDispositions']);router[_0x9476('0x1d')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x9476('0x1e')]);router[_0x9476('0x1d')](_0x9476('0x17'),auth['isAuthenticated'](),controller[_0x9476('0x1f')]);module[_0x9476('0x20')]=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index 3642524..ae7795d 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 _0x828c=['randomstring','exports','STRING','name','generate','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x828c,0x1db));var _0xc828=function(_0x4c463a,_0x4411bb){_0x4c463a=_0x4c463a-0x0;var _0x54f816=_0x828c[_0x4c463a];return _0x54f816;};'use strict';var Sequelize=require(_0xc828('0x0'));var rs=require(_0xc828('0x1'));module[_0xc828('0x2')]={'name':{'type':Sequelize[_0xc828('0x3')],'unique':_0xc828('0x4'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xc828('0x5')]();}},'replyUri':{'type':Sequelize[_0xc828('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xc828('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xc828('0x6');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xc828('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xc828('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xc828('0x3')]},'queueTransfer':{'type':Sequelize[_0xc828('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xc828('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xc828('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xc828('0x8')],'allowNull':!![],'defaultValue':null,'comment':_0xc828('0x9')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xc828('0xa'),'set':function(_0x5ccc03){if(!_0x5ccc03)this[_0xc828('0xb')](_0xc828('0xc'),null);this[_0xc828('0xb')](_0xc828('0xd'),_0x5ccc03);}}}; \ No newline at end of file +var _0xae09=['STRING','name','generate','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','sequelize','exports'];(function(_0x413aac,_0x5e2430){var _0x569b11=function(_0x52e060){while(--_0x52e060){_0x413aac['push'](_0x413aac['shift']());}};_0x569b11(++_0x5e2430);}(_0xae09,0x18a));var _0x9ae0=function(_0x26447e,_0x2e9c94){_0x26447e=_0x26447e-0x0;var _0x38cc1a=_0xae09[_0x26447e];return _0x38cc1a;};'use strict';var Sequelize=require(_0x9ae0('0x0'));var rs=require('randomstring');module[_0x9ae0('0x1')]={'name':{'type':Sequelize[_0x9ae0('0x2')],'unique':_0x9ae0('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x9ae0('0x2')]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x9ae0('0x4')]();}},'replyUri':{'type':Sequelize[_0x9ae0('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x9ae0('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x9ae0('0x5');}},'notificationSound':{'type':Sequelize[_0x9ae0('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x9ae0('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x9ae0('0x2')]},'queueTransfer':{'type':Sequelize[_0x9ae0('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x9ae0('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x9ae0('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x9ae0('0x7')],'allowNull':!![],'defaultValue':null,'comment':_0x9ae0('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x9ae0('0x6')],'defaultValue':![],'comment':_0x9ae0('0x9'),'set':function(_0x3c4e73){if(!_0x3c4e73)this[_0x9ae0('0xa')]('mandatoryDispositionPauseId',null);this[_0x9ae0('0xa')]('mandatoryDisposition',_0x3c4e73);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index 823f4ed..d095f8b 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 _0x8ed3=['externalUrl','ContactId','messageId','interaction','created','OpenchannelMessage','User','UserId','unshift','agent','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','Start','startRouting','EventManager','addApplications','transaction','bulkCreate','findAndCountAll','getApplications','getInteractions','pick','Contact','Owner','fullname','internal','Tag','color','tag','addAgents','omit','spread','emit','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','send','out','Messages','dataValues','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./openchannelAccount.socket','register','jayson/promise','client','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','status','end','json','undefined','limit','offset','set','Content-Range','apply','reject','save','destroy','get','OpenchannelAccounts','name','index','Pause','mandatoryDispositionPause','OpenchannelAccount','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','describe','addDisposition','getDispositions','findOne','Disposition','OpenchannelAccountId','count','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','findAll','notify','openchannel','CmContact','ValidationError','no\x20available\x20attributes','difference','createdAt','CompanyId','ListId','isNil','from','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','updatedAt','DESC','OpenchannelApplication','Applications','applications','list','List','orderBy','priority','asc','account','contact','firstName','lastName','threadId','OpenchannelInteraction'];(function(_0x378952,_0x5bc189){var _0x485956=function(_0x547f29){while(--_0x547f29){_0x378952['push'](_0x378952['shift']());}};_0x485956(++_0x5bc189);}(_0x8ed3,0xe6));var _0x38ed=function(_0x1e2447,_0x5fea89){_0x1e2447=_0x1e2447-0x0;var _0x306f03=_0x8ed3[_0x1e2447];return _0x306f03;};'use strict';var emlformat=require(_0x38ed('0x0'));var rimraf=require(_0x38ed('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x38ed('0x2'));var rp=require(_0x38ed('0x3'));var moment=require('moment');var BPromise=require(_0x38ed('0x4'));var Mustache=require('mustache');var util=require(_0x38ed('0x5'));var path=require(_0x38ed('0x6'));var sox=require(_0x38ed('0x7'));var csv=require(_0x38ed('0x8'));var ejs=require(_0x38ed('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x38ed('0xa'));var squel=require(_0x38ed('0xb'));var crypto=require(_0x38ed('0xc'));var jsforce=require(_0x38ed('0xd'));var deskjs=require(_0x38ed('0xe'));var toCsv=require(_0x38ed('0x8'));var querystring=require('querystring');var Papa=require(_0x38ed('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x38ed('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x38ed('0x11'));var logger=require(_0x38ed('0x12'))(_0x38ed('0x13'));var utils=require('../../config/utils');var config=require(_0x38ed('0x14'));var licenseUtil=require(_0x38ed('0x15'));var db=require(_0x38ed('0x16'))['db'];config[_0x38ed('0x17')]=_[_0x38ed('0x18')](config[_0x38ed('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x38ed('0x19'))(new Redis(config[_0x38ed('0x17')]));require(_0x38ed('0x1a'))[_0x38ed('0x1b')](socket);var jayson=require(_0x38ed('0x1c'));var client=jayson[_0x38ed('0x1d')]['http']({'port':0x232c});var client9002=jayson[_0x38ed('0x1d')]['http']({'port':0x232a});function respondWithRpcPromise(_0x419fed,_0x878487,_0x442cf3,_0x3d49ea){return new BPromise(function(_0x11b107,_0x365a4d){var _0x4f09a5=_0x3d49ea||client;return _0x4f09a5[_0x38ed('0x1e')](_0x419fed,_0x442cf3)[_0x38ed('0x1f')](function(_0x47fbfc){logger[_0x38ed('0x20')](_0x38ed('0x21'),_0x878487,_0x38ed('0x22'));logger[_0x38ed('0x23')](_0x38ed('0x24'),_0x878487,_0x38ed('0x22'),JSON['stringify'](_0x47fbfc));if(_0x47fbfc[_0x38ed('0x25')]){if(_0x47fbfc['error'][_0x38ed('0x26')]===0x1f4){logger[_0x38ed('0x25')](_0x38ed('0x21'),_0x878487,_0x47fbfc[_0x38ed('0x25')][_0x38ed('0x27')]);return _0x365a4d(_0x47fbfc['error'][_0x38ed('0x27')]);}logger[_0x38ed('0x25')](_0x38ed('0x21'),_0x878487,_0x47fbfc[_0x38ed('0x25')][_0x38ed('0x27')]);return _0x11b107(_0x47fbfc['error'][_0x38ed('0x27')]);}else{logger['info'](_0x38ed('0x21'),_0x878487,_0x38ed('0x22'));_0x11b107(_0x47fbfc[_0x38ed('0x28')][_0x38ed('0x27')]);}})['catch'](function(_0x5ea4be){logger[_0x38ed('0x25')](_0x38ed('0x21'),_0x878487,_0x5ea4be);_0x365a4d(_0x5ea4be);});});}function respondWithStatusCode(_0x955ebc,_0x5d724d){_0x5d724d=_0x5d724d||0xcc;return function(_0x38b4d4){if(_0x38b4d4){return _0x955ebc['sendStatus'](_0x5d724d);}return _0x955ebc[_0x38ed('0x29')](_0x5d724d)[_0x38ed('0x2a')]();};}function respondWithResult(_0x295d3f,_0xfcbf14){_0xfcbf14=_0xfcbf14||0xc8;return function(_0x1f079f){if(_0x1f079f){return _0x295d3f[_0x38ed('0x29')](_0xfcbf14)[_0x38ed('0x2b')](_0x1f079f);}};}function respondWithFilteredResult(_0x38daf2,_0x2239c4){return function(_0x12fd73){if(_0x12fd73){var _0x40fb08=typeof _0x2239c4['offset']===_0x38ed('0x2c')&&typeof _0x2239c4[_0x38ed('0x2d')]===_0x38ed('0x2c');var _0x31f82e=_0x12fd73['count'];var _0x4bdf91=_0x40fb08?0x0:_0x2239c4[_0x38ed('0x2e')];var _0x18e8bc=_0x40fb08?_0x12fd73['count']:_0x2239c4[_0x38ed('0x2e')]+_0x2239c4[_0x38ed('0x2d')];var _0x4b1fe4;if(_0x18e8bc>=_0x31f82e){_0x18e8bc=_0x31f82e;_0x4b1fe4=0xc8;}else{_0x4b1fe4=0xce;}_0x38daf2['status'](_0x4b1fe4);return _0x38daf2[_0x38ed('0x2f')](_0x38ed('0x30'),_0x4bdf91+'-'+_0x18e8bc+'/'+_0x31f82e)[_0x38ed('0x2b')](_0x12fd73);}return null;};}function patchUpdates(_0x2db1e9){return function(_0x36a325){try{jsonpatch[_0x38ed('0x31')](_0x36a325,_0x2db1e9,!![]);}catch(_0x42e609){return BPromise[_0x38ed('0x32')](_0x42e609);}return _0x36a325[_0x38ed('0x33')]();};}function saveUpdates(_0x233f59,_0x204fa9){return function(_0x21341c){if(_0x21341c){return _0x21341c['update'](_0x233f59)[_0x38ed('0x1f')](function(_0x3242b1){return _0x3242b1;});}return null;};}function removeEntity(_0x2076f7,_0x226af0){return function(_0x7fb25e){if(_0x7fb25e){return _0x7fb25e[_0x38ed('0x34')]()[_0x38ed('0x1f')](function(){var _0x182d87=_0x7fb25e[_0x38ed('0x35')]({'plain':!![]});var _0x584c80=_0x38ed('0x36');return db['UserProfileResource'][_0x38ed('0x34')]({'where':{'type':_0x584c80,'resourceId':_0x182d87['id']}})['then'](function(){return _0x7fb25e;});})[_0x38ed('0x1f')](function(){_0x2076f7['status'](0xcc)[_0x38ed('0x2a')]();});}};}function handleEntityNotFound(_0x4736a2,_0x506e3b){return function(_0x11054e){if(!_0x11054e){_0x4736a2['sendStatus'](0x194);}return _0x11054e;};}function handleError(_0x1f9ac6,_0x3c7713){_0x3c7713=_0x3c7713||0x1f4;return function(_0xca91bd){logger['error'](_0xca91bd['stack']);if(_0xca91bd['name']){delete _0xca91bd[_0x38ed('0x37')];}_0x1f9ac6[_0x38ed('0x29')](_0x3c7713)['send'](_0xca91bd);};}exports[_0x38ed('0x38')]=function(_0x2445c0,_0x35c03f){var _0x1b0034={'include':[{'model':db[_0x38ed('0x39')],'as':_0x38ed('0x3a')}]},_0x4b9986={},_0x4ca213={'count':0x0,'rows':[]};var _0x5ed791=_['map'](db[_0x38ed('0x3b')][_0x38ed('0x3c')],function(_0x54fc48){return{'name':_0x54fc48['fieldName'],'type':_0x54fc48[_0x38ed('0x3d')][_0x38ed('0x3e')]};});_0x4b9986[_0x38ed('0x3f')]=_[_0x38ed('0x40')](_0x5ed791,'name');_0x4b9986[_0x38ed('0x41')]=_[_0x38ed('0x42')](_0x2445c0[_0x38ed('0x41')]);_0x4b9986[_0x38ed('0x43')]=_[_0x38ed('0x44')](_0x4b9986[_0x38ed('0x3f')],_0x4b9986[_0x38ed('0x41')]);_0x1b0034[_0x38ed('0x45')]=_[_0x38ed('0x44')](_0x4b9986[_0x38ed('0x3f')],qs[_0x38ed('0x46')](_0x2445c0[_0x38ed('0x41')][_0x38ed('0x46')]));_0x1b0034['attributes']=_0x1b0034['attributes'][_0x38ed('0x47')]?_0x1b0034[_0x38ed('0x45')]:_0x4b9986[_0x38ed('0x3f')];if(!_0x2445c0[_0x38ed('0x41')][_0x38ed('0x48')](_0x38ed('0x49'))){_0x1b0034[_0x38ed('0x2d')]=qs['limit'](_0x2445c0[_0x38ed('0x41')][_0x38ed('0x2d')]);_0x1b0034['offset']=qs[_0x38ed('0x2e')](_0x2445c0['query']['offset']);}_0x1b0034[_0x38ed('0x4a')]=qs[_0x38ed('0x4b')](_0x2445c0[_0x38ed('0x41')][_0x38ed('0x4b')]);_0x1b0034[_0x38ed('0x4c')]=qs[_0x38ed('0x43')](_['pick'](_0x2445c0[_0x38ed('0x41')],_0x4b9986['filters']),_0x5ed791);if(_0x2445c0[_0x38ed('0x41')][_0x38ed('0x4d')]){_0x1b0034['where']=_[_0x38ed('0x4e')](_0x1b0034['where'],{'$or':_[_0x38ed('0x40')](_0x5ed791,function(_0xef485e){if(_0xef485e[_0x38ed('0x3d')]!==_0x38ed('0x4f')){var _0x244903={};_0x244903[_0xef485e['name']]={'$like':'%'+_0x2445c0[_0x38ed('0x41')][_0x38ed('0x4d')]+'%'};return _0x244903;}})});}_0x1b0034=_[_0x38ed('0x4e')]({},_0x1b0034,_0x2445c0[_0x38ed('0x50')]);var _0x3ce4f8={'where':_0x1b0034[_0x38ed('0x4c')]};return db[_0x38ed('0x3b')]['count'](_0x3ce4f8)[_0x38ed('0x1f')](function(_0x15f8fa){_0x4ca213['count']=_0x15f8fa;if(_0x2445c0['query'][_0x38ed('0x51')]){_0x1b0034[_0x38ed('0x52')]=[{'all':!![]}];}return db[_0x38ed('0x3b')]['findAll'](_0x1b0034);})[_0x38ed('0x1f')](function(_0xd5946a){_0x4ca213[_0x38ed('0x53')]=_0xd5946a;return _0x4ca213;})[_0x38ed('0x1f')](respondWithFilteredResult(_0x35c03f,_0x1b0034))[_0x38ed('0x54')](handleError(_0x35c03f,null));};exports[_0x38ed('0x55')]=function(_0x25458c,_0x3b3a2b){var _0x17b367={'raw':![],'where':{'id':_0x25458c[_0x38ed('0x56')]['id']},'include':[{'model':db[_0x38ed('0x39')],'as':'mandatoryDispositionPause'}]},_0xd7eff5={};_0xd7eff5['model']=_[_0x38ed('0x42')](db['OpenchannelAccount']['rawAttributes']);_0xd7eff5['query']=_[_0x38ed('0x42')](_0x25458c['query']);_0xd7eff5[_0x38ed('0x43')]=_['intersection'](_0xd7eff5['model'],_0xd7eff5[_0x38ed('0x41')]);_0x17b367[_0x38ed('0x45')]=_[_0x38ed('0x44')](_0xd7eff5[_0x38ed('0x3f')],qs['fields'](_0x25458c['query'][_0x38ed('0x46')]));_0x17b367['attributes']=_0x17b367[_0x38ed('0x45')][_0x38ed('0x47')]?_0x17b367['attributes']:_0xd7eff5[_0x38ed('0x3f')];if(_0x25458c['query'][_0x38ed('0x51')]){_0x17b367[_0x38ed('0x52')]=[{'all':!![]}];}_0x17b367=_[_0x38ed('0x4e')]({},_0x17b367,_0x25458c[_0x38ed('0x50')]);return db['OpenchannelAccount']['find'](_0x17b367)[_0x38ed('0x1f')](handleEntityNotFound(_0x3b3a2b,null))['then'](respondWithResult(_0x3b3a2b,null))[_0x38ed('0x54')](handleError(_0x3b3a2b,null));};exports[_0x38ed('0x57')]=function(_0x521bed,_0x380fe0){return db[_0x38ed('0x3b')]['create'](_0x521bed['body'],{})[_0x38ed('0x1f')](function(_0x34f64c){var _0x585ea7=_0x521bed[_0x38ed('0x58')][_0x38ed('0x35')]({'plain':!![]});if(!_0x585ea7)throw new Error(_0x38ed('0x59'));if(_0x585ea7[_0x38ed('0x5a')]==='user'){var _0x4fe374=_0x34f64c['get']({'plain':!![]});var _0x4d3378=_0x38ed('0x36');return db['UserProfileSection'][_0x38ed('0x5b')]({'where':{'name':_0x4d3378,'userProfileId':_0x585ea7['userProfileId']},'raw':!![]})['then'](function(_0x1d678e){if(_0x1d678e&&_0x1d678e[_0x38ed('0x5c')]===0x0){return db[_0x38ed('0x5d')][_0x38ed('0x57')]({'name':_0x4fe374[_0x38ed('0x37')],'resourceId':_0x4fe374['id'],'type':_0x1d678e[_0x38ed('0x37')],'sectionId':_0x1d678e['id']},{})[_0x38ed('0x1f')](function(){return _0x34f64c;});}else{return _0x34f64c;}})['catch'](function(_0x28076f){logger[_0x38ed('0x25')](_0x38ed('0x5e'),_0x28076f);throw _0x28076f;});}return _0x34f64c;})[_0x38ed('0x1f')](respondWithResult(_0x380fe0,0xc9))[_0x38ed('0x54')](handleError(_0x380fe0,null));};exports[_0x38ed('0x5f')]=function(_0x3b050a,_0x48f4ae){if(_0x3b050a[_0x38ed('0x60')]['id']){delete _0x3b050a['body']['id'];}return db[_0x38ed('0x3b')][_0x38ed('0x5b')]({'where':{'id':_0x3b050a[_0x38ed('0x56')]['id']},'include':[{'model':db[_0x38ed('0x39')],'as':_0x38ed('0x3a')}]})[_0x38ed('0x1f')](handleEntityNotFound(_0x48f4ae,null))['then'](saveUpdates(_0x3b050a['body'],null))[_0x38ed('0x1f')](respondWithResult(_0x48f4ae,null))['catch'](handleError(_0x48f4ae,null));};exports[_0x38ed('0x34')]=function(_0x3ec5f9,_0x19a193){return db['OpenchannelAccount'][_0x38ed('0x5b')]({'where':{'id':_0x3ec5f9[_0x38ed('0x56')]['id']}})['then'](handleEntityNotFound(_0x19a193,null))[_0x38ed('0x1f')](removeEntity(_0x19a193,null))[_0x38ed('0x54')](handleError(_0x19a193,null));};exports['describe']=function(_0x81bad,_0x475cfd){return db[_0x38ed('0x3b')][_0x38ed('0x61')]()[_0x38ed('0x1f')](respondWithResult(_0x475cfd,null))[_0x38ed('0x54')](handleError(_0x475cfd,null));};exports[_0x38ed('0x62')]=function(_0x2f2bf7,_0x151a0f,_0x1bc0fb){if(_0x2f2bf7[_0x38ed('0x60')]['id']){delete _0x2f2bf7[_0x38ed('0x60')]['id'];}return db[_0x38ed('0x3b')]['find']({'where':{'id':_0x2f2bf7[_0x38ed('0x56')]['id']}})['then'](handleEntityNotFound(_0x151a0f,null))[_0x38ed('0x1f')](function(_0x3dafd2){if(_0x3dafd2){_0x2f2bf7['body']['OpenchannelAccountId']=_0x3dafd2['id'];return db['Disposition'][_0x38ed('0x57')](_0x2f2bf7['body']);}})[_0x38ed('0x1f')](respondWithResult(_0x151a0f,null))[_0x38ed('0x54')](handleError(_0x151a0f,null));};exports[_0x38ed('0x63')]=function(_0x18e732,_0x2d108c,_0x3d2da1){var _0x410b95={'raw':![],'where':{}};var _0x27c6ab={};var _0x5392bd={'count':0x0,'rows':[]};return db[_0x38ed('0x3b')][_0x38ed('0x64')]({'where':{'id':_0x18e732['params']['id']}})[_0x38ed('0x1f')](handleEntityNotFound(_0x2d108c,null))[_0x38ed('0x1f')](function(_0x496c06){if(_0x496c06){_0x27c6ab[_0x38ed('0x3f')]=_[_0x38ed('0x42')](db[_0x38ed('0x65')][_0x38ed('0x3c')]);_0x27c6ab[_0x38ed('0x41')]=_[_0x38ed('0x42')](_0x18e732['query']);_0x27c6ab[_0x38ed('0x43')]=_[_0x38ed('0x44')](_0x27c6ab[_0x38ed('0x3f')],_0x27c6ab[_0x38ed('0x41')]);_0x410b95[_0x38ed('0x45')]=_[_0x38ed('0x44')](_0x27c6ab[_0x38ed('0x3f')],qs[_0x38ed('0x46')](_0x18e732[_0x38ed('0x41')][_0x38ed('0x46')]));_0x410b95[_0x38ed('0x45')]=_0x410b95[_0x38ed('0x45')][_0x38ed('0x47')]?_0x410b95[_0x38ed('0x45')]:_0x27c6ab[_0x38ed('0x3f')];if(!_0x18e732[_0x38ed('0x41')]['hasOwnProperty']('nolimit')){_0x410b95[_0x38ed('0x2d')]=qs[_0x38ed('0x2d')](_0x18e732[_0x38ed('0x41')][_0x38ed('0x2d')]);_0x410b95[_0x38ed('0x2e')]=qs['offset'](_0x18e732['query']['offset']);}_0x410b95[_0x38ed('0x4a')]=qs[_0x38ed('0x4b')](_0x18e732[_0x38ed('0x41')]['sort']);_0x410b95[_0x38ed('0x4c')]=qs['filters'](_['pick'](_0x18e732['query'],_0x27c6ab[_0x38ed('0x43')]));_0x410b95['where'][_0x38ed('0x66')]=_0x496c06['id'];if(_0x18e732['query']['filter']){_0x410b95[_0x38ed('0x4c')]=_[_0x38ed('0x4e')](_0x410b95[_0x38ed('0x4c')],{'$or':_[_0x38ed('0x40')](_0x410b95['attributes'],function(_0x3bd476){var _0x4e279e={};_0x4e279e[_0x3bd476]={'$like':'%'+_0x18e732[_0x38ed('0x41')][_0x38ed('0x4d')]+'%'};return _0x4e279e;})});}_0x410b95=_['merge']({},_0x410b95,_0x18e732[_0x38ed('0x50')]);return db[_0x38ed('0x65')]['count']({'where':_0x410b95[_0x38ed('0x4c')]})[_0x38ed('0x1f')](function(_0x4b90ee){_0x5392bd[_0x38ed('0x67')]=_0x4b90ee;if(_0x18e732[_0x38ed('0x41')][_0x38ed('0x51')]){_0x410b95[_0x38ed('0x52')]=[{'all':!![]}];}return db[_0x38ed('0x65')]['findAll'](_0x410b95);})[_0x38ed('0x1f')](function(_0xdd01ab){_0x5392bd[_0x38ed('0x53')]=_0xdd01ab;return _0x5392bd;});}})['then'](respondWithFilteredResult(_0x2d108c,_0x410b95))['catch'](handleError(_0x2d108c,null));};exports[_0x38ed('0x68')]=function(_0x36e1a5,_0x400483,_0x164fec){return db['OpenchannelAccount']['find']({'where':{'id':_0x36e1a5[_0x38ed('0x56')]['id']}})[_0x38ed('0x1f')](handleEntityNotFound(_0x400483,null))['then'](function(_0x35df66){if(_0x35df66){return _0x35df66['removeDispositions'](_0x36e1a5[_0x38ed('0x41')][_0x38ed('0x69')]);}})['then'](respondWithStatusCode(_0x400483,null))[_0x38ed('0x54')](handleError(_0x400483,null));};exports[_0x38ed('0x6a')]=function(_0x258bd9,_0x5cf2f1,_0x225af3){if(_0x258bd9[_0x38ed('0x60')]['id']){delete _0x258bd9['body']['id'];}return db[_0x38ed('0x3b')][_0x38ed('0x5b')]({'where':{'id':_0x258bd9[_0x38ed('0x56')]['id']}})['then'](handleEntityNotFound(_0x5cf2f1,null))[_0x38ed('0x1f')](function(_0x24cfd2){if(_0x24cfd2){_0x258bd9['body']['OpenchannelAccountId']=_0x24cfd2['id'];return db['CannedAnswer'][_0x38ed('0x57')](_0x258bd9[_0x38ed('0x60')]);}})['then'](respondWithResult(_0x5cf2f1,null))[_0x38ed('0x54')](handleError(_0x5cf2f1,null));};exports[_0x38ed('0x6b')]=function(_0x3060d4,_0x542896,_0x2e1875){var _0x5846d7={'raw':![],'where':{}};var _0x4cb121={};var _0x4c7268={'count':0x0,'rows':[]};return db[_0x38ed('0x3b')][_0x38ed('0x64')]({'where':{'id':_0x3060d4[_0x38ed('0x56')]['id']}})['then'](handleEntityNotFound(_0x542896,null))['then'](function(_0x3fa113){if(_0x3fa113){_0x4cb121[_0x38ed('0x3f')]=_[_0x38ed('0x42')](db['CannedAnswer'][_0x38ed('0x3c')]);_0x4cb121[_0x38ed('0x41')]=_['keys'](_0x3060d4[_0x38ed('0x41')]);_0x4cb121['filters']=_[_0x38ed('0x44')](_0x4cb121['model'],_0x4cb121[_0x38ed('0x41')]);_0x5846d7[_0x38ed('0x45')]=_[_0x38ed('0x44')](_0x4cb121[_0x38ed('0x3f')],qs['fields'](_0x3060d4[_0x38ed('0x41')][_0x38ed('0x46')]));_0x5846d7[_0x38ed('0x45')]=_0x5846d7[_0x38ed('0x45')][_0x38ed('0x47')]?_0x5846d7[_0x38ed('0x45')]:_0x4cb121['model'];if(!_0x3060d4[_0x38ed('0x41')]['hasOwnProperty']('nolimit')){_0x5846d7[_0x38ed('0x2d')]=qs[_0x38ed('0x2d')](_0x3060d4[_0x38ed('0x41')]['limit']);_0x5846d7[_0x38ed('0x2e')]=qs[_0x38ed('0x2e')](_0x3060d4['query'][_0x38ed('0x2e')]);}_0x5846d7[_0x38ed('0x4a')]=qs[_0x38ed('0x4b')](_0x3060d4[_0x38ed('0x41')]['sort']);_0x5846d7[_0x38ed('0x4c')]=qs[_0x38ed('0x43')](_['pick'](_0x3060d4[_0x38ed('0x41')],_0x4cb121[_0x38ed('0x43')]));_0x5846d7[_0x38ed('0x4c')][_0x38ed('0x66')]=_0x3fa113['id'];if(_0x3060d4[_0x38ed('0x41')]['filter']){_0x5846d7[_0x38ed('0x4c')]=_[_0x38ed('0x4e')](_0x5846d7[_0x38ed('0x4c')],{'$or':_[_0x38ed('0x40')](_0x5846d7['attributes'],function(_0x29c227){var _0x304c4c={};_0x304c4c[_0x29c227]={'$like':'%'+_0x3060d4['query']['filter']+'%'};return _0x304c4c;})});}_0x5846d7=_[_0x38ed('0x4e')]({},_0x5846d7,_0x3060d4[_0x38ed('0x50')]);return db[_0x38ed('0x6c')][_0x38ed('0x67')]({'where':_0x5846d7[_0x38ed('0x4c')]})[_0x38ed('0x1f')](function(_0x20d820){_0x4c7268[_0x38ed('0x67')]=_0x20d820;if(_0x3060d4[_0x38ed('0x41')][_0x38ed('0x51')]){_0x5846d7[_0x38ed('0x52')]=[{'all':!![]}];}return db[_0x38ed('0x6c')][_0x38ed('0x6d')](_0x5846d7);})[_0x38ed('0x1f')](function(_0x12810c){_0x4c7268['rows']=_0x12810c;return _0x4c7268;});}})[_0x38ed('0x1f')](respondWithFilteredResult(_0x542896,_0x5846d7))[_0x38ed('0x54')](handleError(_0x542896,null));};exports['removeAnswers']=function(_0x6e0670,_0x4452e5,_0x68edeb){return db[_0x38ed('0x3b')][_0x38ed('0x5b')]({'where':{'id':_0x6e0670[_0x38ed('0x56')]['id']}})[_0x38ed('0x1f')](handleEntityNotFound(_0x4452e5,null))['then'](function(_0x1e12e1){if(_0x1e12e1){return _0x1e12e1['removeAnswers'](_0x6e0670[_0x38ed('0x41')][_0x38ed('0x69')]);}})[_0x38ed('0x1f')](respondWithStatusCode(_0x4452e5,null))[_0x38ed('0x54')](handleError(_0x4452e5,null));};exports[_0x38ed('0x6e')]=function(_0x51a569,_0x3df6df,_0x5b48a5){var _0x44b353={'body':_0x51a569[_0x38ed('0x60')],'channel':_0x38ed('0x6f')};var _0x25b793=[];var _0x30aa30=[];var _0xe5f000={};var _0x5783d9=![];return db[_0x38ed('0x70')][_0x38ed('0x61')]()[_0x38ed('0x1f')](function(_0x56bb09){if(!_0x56bb09){throw new db['Sequelize'][(_0x38ed('0x71'))](_0x38ed('0x72'));}_0x25b793=_[_0x38ed('0x73')](_[_0x38ed('0x42')](_0x56bb09),[_0x38ed('0x74'),'updatedAt']);_0x30aa30=_[_0x38ed('0x73')](_[_0x38ed('0x42')](_0x56bb09),[_0x38ed('0x74'),'updatedAt',_0x38ed('0x75'),_0x38ed('0x76')]);if(_0x51a569[_0x38ed('0x60')]['id']){delete _0x51a569['body']['id'];}if(_[_0x38ed('0x77')](_0x51a569['body'][_0x38ed('0x78')])){throw new db[(_0x38ed('0x79'))]['ValidationError'](_0x38ed('0x7a'));}if(_[_0x38ed('0x77')](_0x51a569[_0x38ed('0x60')][_0x38ed('0x60')])||_0x51a569[_0x38ed('0x60')][_0x38ed('0x60')]===''){throw new db['Sequelize'][(_0x38ed('0x71'))](_0x38ed('0x7b'));}if(_[_0x38ed('0x77')](_0x51a569[_0x38ed('0x60')][_0x38ed('0x7c')])){throw new db['Sequelize'][(_0x38ed('0x71'))](_0x38ed('0x7d')+_0x30aa30);}if(!_[_0x38ed('0x7e')](_0x30aa30,_0x51a569[_0x38ed('0x60')][_0x38ed('0x7c')])){throw new db[(_0x38ed('0x79'))][(_0x38ed('0x71'))](_0x38ed('0x7f')+_0x30aa30);}_0xe5f000[_0x51a569[_0x38ed('0x60')][_0x38ed('0x7c')]]=_0x51a569[_0x38ed('0x60')][_0x38ed('0x78')];})['then'](function(){return db[_0x38ed('0x3b')][_0x38ed('0x5b')]({'where':{'id':_0x51a569['params']['id']},'include':[{'model':db[_0x38ed('0x80')],'as':'List','include':[{'model':db[_0x38ed('0x70')],'as':_0x38ed('0x81'),'where':_0xe5f000,'limit':0x1,'order':[[_0x38ed('0x82'),_0x38ed('0x83')]]}]},{'model':db[_0x38ed('0x84')],'as':_0x38ed('0x85')}]});})[_0x38ed('0x1f')](handleEntityNotFound(_0x3df6df,null))[_0x38ed('0x1f')](function(_0x71a905){if(_0x71a905&&_0x71a905['List']){_0x44b353['account']=_0x71a905;_0x44b353[_0x38ed('0x86')]=_0x71a905['Applications'];_0x44b353[_0x38ed('0x87')]=_0x71a905[_0x38ed('0x88')];_0x44b353[_0x38ed('0x86')]=_[_0x38ed('0x89')](_0x44b353[_0x38ed('0x86')],[_0x38ed('0x8a')],[_0x38ed('0x8b')]);if(_0x44b353[_0x38ed('0x8c')][_0x38ed('0x85')]){delete _0x44b353[_0x38ed('0x8c')][_0x38ed('0x85')];}if(_0x44b353[_0x38ed('0x8c')][_0x38ed('0x88')]&&_0x44b353[_0x38ed('0x8c')][_0x38ed('0x88')][_0x38ed('0x81')][_0x38ed('0x47')]){return _0x44b353[_0x38ed('0x8c')][_0x38ed('0x88')][_0x38ed('0x81')][0x0];}var _0x50d5c4=_[_0x38ed('0x18')](_0x51a569[_0x38ed('0x60')],{'firstName':_0x51a569[_0x38ed('0x60')][_0x38ed('0x78')],'ListId':_0x71a905[_0x38ed('0x76')]});_0x50d5c4[_0x51a569['body']['mapKey']]=_0x51a569[_0x38ed('0x60')]['from'];return db['CmContact']['create'](_0x50d5c4,{'fields':_0x25b793,'raw':!![]});}})[_0x38ed('0x1f')](handleEntityNotFound(_0x3df6df,null))[_0x38ed('0x1f')](function(_0x2dcc7c){_0x44b353[_0x38ed('0x8d')]=_0x2dcc7c;if(_0x2dcc7c){var _0x25e3a6={'ContactId':_0x2dcc7c['id'],'OpenchannelAccountId':_0x51a569['params']['id'],'from':(_0x2dcc7c[_0x38ed('0x8e')]||'')+'\x20'+(_0x2dcc7c[_0x38ed('0x8f')]||'')};var _0x371211={'OpenchannelAccountId':_0x51a569['params']['id'],'closed':![]};if(_0x51a569[_0x38ed('0x60')][_0x38ed('0x90')]){_0x371211['threadId']=_0x51a569['body'][_0x38ed('0x90')];return db[_0x38ed('0x91')][_0x38ed('0x5b')]({'where':_0x371211})[_0x38ed('0x1f')](function(_0xe55f3e){if(_0xe55f3e){return[_0xe55f3e,![]];}_0x25e3a6[_0x38ed('0x90')]=_0x51a569[_0x38ed('0x60')][_0x38ed('0x90')];_0x25e3a6[_0x38ed('0x92')]=_0x51a569['body']['externalUrl'];return db[_0x38ed('0x91')][_0x38ed('0x57')](_0x25e3a6)[_0x38ed('0x1f')](function(_0x1eb766){return[_0x1eb766,!![]];});});}else{_0x371211[_0x38ed('0x90')]=null;}_0x371211[_0x38ed('0x93')]=_0x2dcc7c['id'];return db[_0x38ed('0x91')][_0x38ed('0x5b')]({'where':_0x371211})[_0x38ed('0x1f')](function(_0x21fc71){if(_0x21fc71){return[_0x21fc71,![]];}return db['OpenchannelInteraction'][_0x38ed('0x57')](_0x25e3a6)['then'](function(_0x2915d0){return[_0x2915d0,!![]];});});}})['spread'](function(_0x2c59bf,_0x4bdb38){if(_0x2c59bf){_0x5783d9=_0x4bdb38;if(!_0x4bdb38){var _0x280b12={'from':(_0x44b353[_0x38ed('0x8d')][_0x38ed('0x8e')]||'')+'\x20'+(_0x44b353[_0x38ed('0x8d')][_0x38ed('0x8f')]||'')};if(_0x51a569[_0x38ed('0x60')][_0x38ed('0x90')]&&_0x51a569[_0x38ed('0x60')][_0x38ed('0x94')]&&_0x51a569[_0x38ed('0x60')][_0x38ed('0x90')]!=_0x51a569[_0x38ed('0x60')][_0x38ed('0x94')]){_0x280b12[_0x38ed('0x90')]=_0x51a569[_0x38ed('0x60')][_0x38ed('0x94')];}return _0x2c59bf[_0x38ed('0x5f')](_0x280b12);}else{return _0x2c59bf;}}})[_0x38ed('0x1f')](function(_0x21aec6){_0x44b353[_0x38ed('0x95')]=_0x21aec6[_0x38ed('0x35')]({'plain':!![]});_0x44b353[_0x38ed('0x95')]['created']=_0x5783d9;if(_0x44b353[_0x38ed('0x95')][_0x38ed('0x96')]){if(_0x44b353[_0x38ed('0x8c')]['autoclose']){_0x44b353['applications']['push']({'id':0x0,'priority':_0x44b353['applications'][_0x38ed('0x47')]+0x1,'app':'close','appdata':'unmanaged','interval':'*,*,*,*'});}}return db[_0x38ed('0x97')][_0x38ed('0x57')]({'body':_0x51a569[_0x38ed('0x60')][_0x38ed('0x60')],'OpenchannelAccountId':_0x51a569['params']['id'],'OpenchannelInteractionId':_0x21aec6['id'],'direction':'in','ContactId':_0x44b353['contact']['id'],'AttachmentId':_0x51a569['body']['AttachmentId']});})[_0x38ed('0x1f')](function(_0x3aaec9){_0x44b353[_0x38ed('0x27')]=_0x3aaec9;if(_0x44b353[_0x38ed('0x95')]['UserId']){return db[_0x38ed('0x98')][_0x38ed('0x5b')]({'attributes':['id',_0x38ed('0x37')],'where':{'id':_0x44b353[_0x38ed('0x95')][_0x38ed('0x99')]}})['then'](function(_0x5a9661){if(_0x5a9661){_0x44b353[_0x38ed('0x86')][_0x38ed('0x9a')]({'id':0x0,'priority':0x0,'app':_0x38ed('0x9b'),'appdata':_0x5a9661[_0x38ed('0x37')]+','+(_0x44b353[_0x38ed('0x8c')][_0x38ed('0x9c')]||0xa),'interval':_0x38ed('0x9d')});_0x44b353[_0x38ed('0x9e')]=![];}return respondWithRpcPromise(_0x38ed('0x9f'),_0x38ed('0xa0'),_0x44b353);});}return respondWithRpcPromise(_0x38ed('0x9f'),_0x38ed('0xa0'),_0x44b353);})['then'](function(_0x1d973e){respondWithRpcPromise(_0x38ed('0xa1'),'EventManager',{'event':_0x38ed('0x6e'),'message':_0x1d973e},client9002);return _0x1d973e;})[_0x38ed('0x1f')](respondWithResult(_0x3df6df,null))[_0x38ed('0x54')](handleError(_0x3df6df,null));};exports[_0x38ed('0xa2')]=function(_0x38ce36,_0x4a0df8,_0x4fbb88){return db[_0x38ed('0x3b')]['findOne']({'where':{'id':_0x38ce36['params']['id']}})[_0x38ed('0x1f')](handleEntityNotFound(_0x4a0df8,null))[_0x38ed('0x1f')](function(_0x15a2e4){if(_0x15a2e4){return db['sequelize'][_0x38ed('0xa3')](function(_0x2918ad){return db[_0x38ed('0x84')][_0x38ed('0x34')]({'where':{'OpenchannelAccountId':_0x38ce36[_0x38ed('0x56')]['id']},'transaction':_0x2918ad})[_0x38ed('0x1f')](function(_0x2b5167){var _0x296766=_[_0x38ed('0x40')](_0x38ce36[_0x38ed('0x60')],function(_0x33cbd8){_0x33cbd8[_0x38ed('0x66')]=_0x38ce36[_0x38ed('0x56')]['id'];return _0x33cbd8;});return db['OpenchannelApplication'][_0x38ed('0xa4')](_0x296766,{'transaction':_0x2918ad});});})[_0x38ed('0x1f')](function(){return db[_0x38ed('0x84')][_0x38ed('0xa5')]({'where':{'OpenchannelAccountId':_0x38ce36[_0x38ed('0x56')]['id']},'order':'priority'});});}})['then'](respondWithResult(_0x4a0df8,null))['catch'](handleError(_0x4a0df8,null));};exports[_0x38ed('0xa6')]=function(_0x3b4b11,_0x394b9c,_0x548cd3){var _0x5607d1={};var _0x3c4cc8={};var _0x254246;var _0x5e3154;return db[_0x38ed('0x3b')][_0x38ed('0x64')]({'where':{'id':_0x3b4b11[_0x38ed('0x56')]['id']}})[_0x38ed('0x1f')](handleEntityNotFound(_0x394b9c,null))['then'](function(_0x461c35){if(_0x461c35){_0x254246=_0x461c35;_0x3c4cc8[_0x38ed('0x3f')]=_[_0x38ed('0x42')](db[_0x38ed('0x84')][_0x38ed('0x3c')]);_0x3c4cc8[_0x38ed('0x41')]=_[_0x38ed('0x42')](_0x3b4b11[_0x38ed('0x41')]);_0x3c4cc8[_0x38ed('0x43')]=_[_0x38ed('0x44')](_0x3c4cc8['model'],_0x3c4cc8[_0x38ed('0x41')]);_0x5607d1['attributes']=_[_0x38ed('0x44')](_0x3c4cc8[_0x38ed('0x3f')],qs[_0x38ed('0x46')](_0x3b4b11['query'][_0x38ed('0x46')]));_0x5607d1['attributes']=_0x5607d1[_0x38ed('0x45')][_0x38ed('0x47')]?_0x5607d1[_0x38ed('0x45')]:_0x3c4cc8[_0x38ed('0x3f')];_0x5607d1[_0x38ed('0x4a')]=qs[_0x38ed('0x4b')](_0x3b4b11['query'][_0x38ed('0x4b')]);_0x5607d1[_0x38ed('0x4c')]=qs[_0x38ed('0x43')](_['pick'](_0x3b4b11[_0x38ed('0x41')],_0x3c4cc8[_0x38ed('0x43')]));if(_0x3b4b11['query']['filter']){_0x5607d1[_0x38ed('0x4c')]=_[_0x38ed('0x4e')](_0x5607d1['where'],{'$or':_[_0x38ed('0x40')](_0x5607d1['attributes'],function(_0x4da606){var _0x3341f3={};_0x3341f3[_0x4da606]={'$like':'%'+_0x3b4b11[_0x38ed('0x41')][_0x38ed('0x4d')]+'%'};return _0x3341f3;})});}_0x5607d1=_[_0x38ed('0x4e')]({},_0x5607d1,_0x3b4b11['options']);return _0x254246['getApplications'](_0x5607d1);}})['then'](function(_0x4da95b){if(_0x4da95b){_0x5e3154=_0x4da95b[_0x38ed('0x47')];if(!_0x3b4b11[_0x38ed('0x41')][_0x38ed('0x48')]('nolimit')){_0x5607d1[_0x38ed('0x2d')]=qs[_0x38ed('0x2d')](_0x3b4b11[_0x38ed('0x41')][_0x38ed('0x2d')]);_0x5607d1[_0x38ed('0x2e')]=qs[_0x38ed('0x2e')](_0x3b4b11[_0x38ed('0x41')][_0x38ed('0x2e')]);}return _0x254246[_0x38ed('0xa6')](_0x5607d1);}})[_0x38ed('0x1f')](function(_0xb6ab01){if(_0xb6ab01){return _0xb6ab01?{'count':_0x5e3154,'rows':_0xb6ab01}:null;}})[_0x38ed('0x1f')](respondWithResult(_0x394b9c,null))[_0x38ed('0x54')](handleError(_0x394b9c,null));};exports[_0x38ed('0xa7')]=function(_0x3e576c,_0x973889,_0x5e58f1){var _0x316fb4={'raw':![],'where':{}};var _0x1f0c13={};var _0x4837ac={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x38ed('0x64')]({'where':{'id':_0x3e576c['params']['id']}})[_0x38ed('0x1f')](handleEntityNotFound(_0x973889,null))[_0x38ed('0x1f')](function(_0x3f79be){if(_0x3f79be){_0x1f0c13['model']=_['keys'](db[_0x38ed('0x91')]['rawAttributes']);_0x1f0c13[_0x38ed('0x41')]=_[_0x38ed('0x42')](_0x3e576c['query']);_0x1f0c13[_0x38ed('0x43')]=_[_0x38ed('0x44')](_0x1f0c13[_0x38ed('0x3f')],_0x1f0c13['query']);_0x316fb4[_0x38ed('0x45')]=_[_0x38ed('0x44')](_0x1f0c13[_0x38ed('0x3f')],qs[_0x38ed('0x46')](_0x3e576c[_0x38ed('0x41')][_0x38ed('0x46')]));_0x316fb4[_0x38ed('0x45')]=_0x316fb4[_0x38ed('0x45')][_0x38ed('0x47')]?_0x316fb4['attributes']:_0x1f0c13[_0x38ed('0x3f')];if(!_0x3e576c[_0x38ed('0x41')][_0x38ed('0x48')](_0x38ed('0x49'))){_0x316fb4[_0x38ed('0x2d')]=qs[_0x38ed('0x2d')](_0x3e576c[_0x38ed('0x41')]['limit']);_0x316fb4['offset']=qs[_0x38ed('0x2e')](_0x3e576c[_0x38ed('0x41')][_0x38ed('0x2e')]);}_0x316fb4[_0x38ed('0x4a')]=qs[_0x38ed('0x4b')](_0x3e576c['query']['sort']);_0x316fb4[_0x38ed('0x4c')]=qs[_0x38ed('0x43')](_[_0x38ed('0xa8')](_0x3e576c[_0x38ed('0x41')],_0x1f0c13['filters']));_0x316fb4['where']['OpenchannelAccountId']=_0x3f79be['id'];if(_0x3e576c[_0x38ed('0x41')][_0x38ed('0x4d')]){_0x316fb4[_0x38ed('0x4c')]=_[_0x38ed('0x4e')](_0x316fb4[_0x38ed('0x4c')],{'$or':_[_0x38ed('0x40')](_0x316fb4[_0x38ed('0x45')],function(_0x45e783){var _0x1ac284={};_0x1ac284[_0x45e783]={'$like':'%'+_0x3e576c[_0x38ed('0x41')][_0x38ed('0x4d')]+'%'};return _0x1ac284;})});}_0x316fb4=_[_0x38ed('0x4e')]({},_0x316fb4,_0x3e576c[_0x38ed('0x50')]);return db[_0x38ed('0x91')]['count']({'where':_0x316fb4['where']})[_0x38ed('0x1f')](function(_0x1c5b6a){_0x4837ac['count']=_0x1c5b6a;if(_0x3e576c[_0x38ed('0x41')][_0x38ed('0x51')]){_0x316fb4[_0x38ed('0x52')]=[{'model':db[_0x38ed('0x70')],'as':_0x38ed('0xa9'),'required':![]},{'model':db[_0x38ed('0x98')],'as':_0x38ed('0xaa'),'attributes':['name',_0x38ed('0xab'),_0x38ed('0xac')],'required':![]},{'model':db[_0x38ed('0xad')],'as':'Tags','attributes':['id',_0x38ed('0x37'),_0x38ed('0xae')],'where':_0x3e576c['query'][_0x38ed('0xaf')]?{'id':_0x3e576c['query'][_0x38ed('0xaf')]}:undefined,'required':_0x3e576c['query']['tag']?!![]:![]}];}return db[_0x38ed('0x91')]['findAll'](_0x316fb4);})['then'](function(_0x50131d){_0x4837ac[_0x38ed('0x53')]=_0x50131d;return _0x4837ac;});}})[_0x38ed('0x1f')](respondWithFilteredResult(_0x973889,_0x316fb4))[_0x38ed('0x54')](handleError(_0x973889,null));};exports[_0x38ed('0xb0')]=function(_0x3beb99,_0x3c4446,_0x24927d){return db[_0x38ed('0x3b')][_0x38ed('0x5b')]({'where':{'id':_0x3beb99['params']['id']}})[_0x38ed('0x1f')](handleEntityNotFound(_0x3c4446,null))[_0x38ed('0x1f')](function(_0xf8a11c){if(_0xf8a11c){return _0xf8a11c[_0x38ed('0xb0')](_0x3beb99[_0x38ed('0x60')][_0x38ed('0x69')],_[_0x38ed('0xb1')](_0x3beb99['body'],['ids','id'])||{})[_0x38ed('0xb2')](function(_0x4aac53){for(var _0x39e8ae=0x0;_0x39e8ae<_0x3beb99[_0x38ed('0x60')][_0x38ed('0x69')][_0x38ed('0x47')];_0x39e8ae+=0x1){socket[_0x38ed('0xb3')]('userOpenchannelAccount:save',{'UserId':Number(_0x3beb99['body']['ids'][_0x39e8ae]),'OpenchannelAccountId':Number(_0x3beb99[_0x38ed('0x56')]['id'])});}return _0x4aac53;});}})[_0x38ed('0x1f')](respondWithResult(_0x3c4446,null))['catch'](handleError(_0x3c4446,null));};exports[_0x38ed('0xb4')]=function(_0x12b264,_0x4ebbcf,_0x3e73d5){return db[_0x38ed('0x3b')]['find']({'where':{'id':_0x12b264[_0x38ed('0x56')]['id']}})[_0x38ed('0x1f')](handleEntityNotFound(_0x4ebbcf,null))[_0x38ed('0x1f')](function(_0x191f30){if(_0x191f30){return _0x191f30[_0x38ed('0xb4')](_0x12b264[_0x38ed('0x41')]['ids'])['then'](function(){if(_[_0x38ed('0xb5')](_0x12b264['query'][_0x38ed('0x69')])){for(var _0x139a93=0x0;_0x139a93<_0x12b264[_0x38ed('0x41')]['ids']['length'];_0x139a93+=0x1){socket[_0x38ed('0xb3')](_0x38ed('0xb6'),{'UserId':Number(_0x12b264[_0x38ed('0x41')]['ids'][_0x139a93]),'OpenchannelAccountId':Number(_0x12b264['params']['id'])});}}else{socket[_0x38ed('0xb3')](_0x38ed('0xb6'),{'UserId':Number(_0x12b264[_0x38ed('0x41')][_0x38ed('0x69')]),'OpenchannelAccountId':Number(_0x12b264[_0x38ed('0x56')]['id'])});}});}})[_0x38ed('0x1f')](respondWithStatusCode(_0x4ebbcf,null))[_0x38ed('0x54')](handleError(_0x4ebbcf,null));};exports['getAgents']=function(_0x1d5561,_0x2e81c9,_0x2735b4){var _0x55ffaa={};var _0x48002a={};var _0x46bc6a;var _0x29929b;return db[_0x38ed('0x3b')][_0x38ed('0x64')]({'where':{'id':_0x1d5561[_0x38ed('0x56')]['id']}})[_0x38ed('0x1f')](handleEntityNotFound(_0x2e81c9,null))[_0x38ed('0x1f')](function(_0x1ec476){if(_0x1ec476){_0x46bc6a=_0x1ec476;_0x48002a[_0x38ed('0x3f')]=_['keys'](db[_0x38ed('0x98')][_0x38ed('0x3c')]);_0x48002a['query']=_[_0x38ed('0x42')](_0x1d5561[_0x38ed('0x41')]);_0x48002a['filters']=_['intersection'](_0x48002a[_0x38ed('0x3f')],_0x48002a[_0x38ed('0x41')]);_0x55ffaa[_0x38ed('0x45')]=_[_0x38ed('0x44')](_0x48002a['model'],qs[_0x38ed('0x46')](_0x1d5561[_0x38ed('0x41')][_0x38ed('0x46')]));_0x55ffaa['attributes']=_0x55ffaa[_0x38ed('0x45')]['length']?_0x55ffaa[_0x38ed('0x45')]:_0x48002a['model'];_0x55ffaa[_0x38ed('0x4a')]=qs['sort'](_0x1d5561[_0x38ed('0x41')]['sort']);_0x55ffaa[_0x38ed('0x4c')]=qs[_0x38ed('0x43')](_['pick'](_0x1d5561[_0x38ed('0x41')],_0x48002a[_0x38ed('0x43')]));if(_0x1d5561[_0x38ed('0x41')]['filter']){_0x55ffaa['where']=_['merge'](_0x55ffaa[_0x38ed('0x4c')],{'$or':_[_0x38ed('0x40')](_0x55ffaa[_0x38ed('0x45')],function(_0x136954){var _0x3b9e6f={};_0x3b9e6f[_0x136954]={'$like':'%'+_0x1d5561[_0x38ed('0x41')][_0x38ed('0x4d')]+'%'};return _0x3b9e6f;})});}_0x55ffaa=_[_0x38ed('0x4e')]({},_0x55ffaa,_0x1d5561[_0x38ed('0x50')]);return _0x46bc6a[_0x38ed('0xb7')](_0x55ffaa);}})[_0x38ed('0x1f')](function(_0x1e0009){if(_0x1e0009){_0x29929b=_0x1e0009[_0x38ed('0x47')];if(!_0x1d5561[_0x38ed('0x41')][_0x38ed('0x48')]('nolimit')){_0x55ffaa[_0x38ed('0x2d')]=qs['limit'](_0x1d5561[_0x38ed('0x41')][_0x38ed('0x2d')]);_0x55ffaa['offset']=qs[_0x38ed('0x2e')](_0x1d5561[_0x38ed('0x41')][_0x38ed('0x2e')]);}return _0x46bc6a[_0x38ed('0xb7')](_0x55ffaa);}})['then'](function(_0x1118b5){if(_0x1118b5){return _0x1118b5?{'count':_0x29929b,'rows':_0x1118b5}:null;}})['then'](respondWithResult(_0x2e81c9,null))[_0x38ed('0x54')](handleError(_0x2e81c9,null));};exports[_0x38ed('0xb8')]=function(_0x4799df,_0x5bfdc2,_0x5d0f2a){var _0x641d42,_0x39374c,_0x1c15ac;if(_[_0x38ed('0x77')](_0x4799df[_0x38ed('0x60')][_0x38ed('0x60')])||_0x4799df[_0x38ed('0x60')][_0x38ed('0x60')]===''){throw new db[(_0x38ed('0x79'))][(_0x38ed('0x71'))](_0x38ed('0x7b'));}if(_[_0x38ed('0x77')](_0x4799df[_0x38ed('0x60')]['to'])){}_0x641d42=_0x4799df[_0x38ed('0x60')]['to'];return db['OpenchannelAccount'][_0x38ed('0x64')]({'where':{'id':_0x4799df[_0x38ed('0x56')]['id']}})['then'](handleEntityNotFound(_0x5bfdc2,null))[_0x38ed('0x1f')](function(_0x3d2d42){if(_0x3d2d42){return db['OpenchannelAccount'][_0x38ed('0x5b')]({'where':{'id':_0x3d2d42['id']},'include':[{'model':db[_0x38ed('0x80')],'as':'List','include':[{'model':db[_0x38ed('0x70')],'as':_0x38ed('0x81'),'where':{[_0x3d2d42['mapKey']]:_0x641d42},'limit':0x1,'order':[[_0x38ed('0x82'),_0x38ed('0x83')]]}]}]})['then'](handleEntityNotFound(_0x5bfdc2,null))[_0x38ed('0x1f')](function(_0x51a09c){if(_0x51a09c&&_0x51a09c[_0x38ed('0x88')]){_0x39374c=_0x51a09c['get']({'plain':!![]});if(_0x39374c[_0x38ed('0x88')]&&_0x39374c[_0x38ed('0x88')]['Contacts'][_0x38ed('0x47')]){return _0x39374c[_0x38ed('0x88')]['Contacts'][0x0];}return db['CmContact'][_0x38ed('0x57')](_[_0x38ed('0x18')](_0x4799df[_0x38ed('0x60')],{'firstName':_0x641d42,[_0x51a09c[_0x38ed('0x7c')]]:_0x641d42,'phone':_0x641d42,'ListId':_0x39374c[_0x38ed('0x76')]}));}})[_0x38ed('0x1f')](handleEntityNotFound(_0x5bfdc2,null))[_0x38ed('0x1f')](function(_0x5d216a){if(_0x5d216a){_0x1c15ac=_0x5d216a;return db[_0x38ed('0x91')][_0x38ed('0x5b')]({'where':{'ContactId':_0x1c15ac['id'],'closed':![],'OpenchannelAccountId':_0x39374c['id']}})[_0x38ed('0x1f')](function(_0x549edf){if(_0x549edf){return[_0x549edf,![]];}return db[_0x38ed('0x91')][_0x38ed('0x57')]({'UserId':_0x4799df['user']['id'],'ContactId':_0x1c15ac['id'],'OpenchannelAccountId':_0x39374c['id'],'lastMsgDirection':_0x38ed('0xb9'),'Messages':[_[_0x38ed('0x4e')](_0x4799df[_0x38ed('0x60')],{'read':![],'body':_0x4799df[_0x38ed('0x60')]['body'],'OpenchannelAccountId':_0x39374c['id'],'UserId':_0x4799df[_0x38ed('0x58')]['id'],'ContactId':_0x1c15ac['id']})]},{'include':[{'model':db['OpenchannelMessage'],'as':_0x38ed('0xba')}]})[_0x38ed('0x1f')](function(_0x2565b2){return[_0x2565b2,!![]];});});}})['spread'](function(_0x57f74f,_0x4851ea){if(_0x4851ea){return _0x57f74f;}return db[_0x38ed('0x97')][_0x38ed('0x57')](_['merge'](_0x4799df[_0x38ed('0x60')],{'read':![],'body':_0x4799df[_0x38ed('0x60')][_0x38ed('0x60')],'OpenchannelAccountId':_0x39374c['id'],'OpenchannelInteractionId':_0x57f74f['id'],'UserId':_0x4799df[_0x38ed('0x58')]['id'],'ContactId':_0x1c15ac['id']}))[_0x38ed('0x1f')](function(_0xfb0db6){_0x57f74f[_0x38ed('0xbb')][_0x38ed('0xba')]=[];_0x57f74f[_0x38ed('0xbb')][_0x38ed('0xba')]['push'](_0xfb0db6[_0x38ed('0xbb')]);return _0x57f74f;});});}})[_0x38ed('0x1f')](respondWithResult(_0x5bfdc2,null))['catch'](handleError(_0x5bfdc2,null));}; \ No newline at end of file +var _0xa696=['fs-extra','lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','jayson/promise','client','http','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','get','OpenchannelAccounts','UserProfileResource','destroy','sendStatus','stack','name','send','Pause','mandatoryDispositionPause','map','fieldName','type','key','query','keys','filters','model','attributes','length','order','sort','pick','where','merge','filter','options','OpenchannelAccount','includeAll','include','findAll','rows','catch','rawAttributes','intersection','fields','find','create','body','user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','OpenchannelAccountId','Disposition','nolimit','removeDispositions','addAnswer','CannedAnswer','getAnswers','hasOwnProperty','removeAnswers','notify','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','difference','CompanyId','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','DESC','OpenchannelApplication','List','account','Applications','list','applications','orderBy','priority','asc','Contacts','ListId','firstName','lastName','threadId','externalUrl','OpenchannelInteraction','spread','contact','messageId','interaction','created','autoclose','close','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','addApplications','sequelize','bulkCreate','findOne','getApplications','getInteractions','Owner','fullname','internal','Tag','Tags','color','tag','addAgents','ids','emit','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','out','Messages','dataValues','push','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','ejs'];(function(_0x4e0ab8,_0x401afb){var _0x4c1f40=function(_0x7f95ef){while(--_0x7f95ef){_0x4e0ab8['push'](_0x4e0ab8['shift']());}};_0x4c1f40(++_0x401afb);}(_0xa696,0xb0));var _0x6a69=function(_0x1eda20,_0x1149f4){_0x1eda20=_0x1eda20-0x0;var _0x31b953=_0xa696[_0x1eda20];return _0x31b953;};'use strict';var emlformat=require(_0x6a69('0x0'));var rimraf=require(_0x6a69('0x1'));var zipdir=require(_0x6a69('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6a69('0x3'));var moment=require(_0x6a69('0x4'));var BPromise=require(_0x6a69('0x5'));var Mustache=require('mustache');var util=require(_0x6a69('0x6'));var path=require(_0x6a69('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6a69('0x8'));var fs=require('fs');var fs_extra=require(_0x6a69('0x9'));var _=require(_0x6a69('0xa'));var squel=require(_0x6a69('0xb'));var crypto=require('crypto');var jsforce=require(_0x6a69('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6a69('0xd'));var Papa=require('papaparse');var Redis=require(_0x6a69('0xe'));var authService=require(_0x6a69('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x6a69('0x10'));var hardwareService=require(_0x6a69('0x11'));var logger=require(_0x6a69('0x12'))(_0x6a69('0x13'));var utils=require(_0x6a69('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x6a69('0x15')]=_[_0x6a69('0x16')](config['redis'],{'host':_0x6a69('0x17'),'port':0x18eb});var socket=require(_0x6a69('0x18'))(new Redis(config[_0x6a69('0x15')]));require(_0x6a69('0x19'))['register'](socket);var jayson=require(_0x6a69('0x1a'));var client=jayson[_0x6a69('0x1b')][_0x6a69('0x1c')]({'port':0x232c});var client9002=jayson[_0x6a69('0x1b')][_0x6a69('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x5626d8,_0x469791,_0x52b016,_0x40f7ab){return new BPromise(function(_0x2b510f,_0x2b0ec2){var _0x17c882=_0x40f7ab||client;return _0x17c882[_0x6a69('0x1d')](_0x5626d8,_0x52b016)[_0x6a69('0x1e')](function(_0x54fa45){logger[_0x6a69('0x1f')](_0x6a69('0x20'),_0x469791,_0x6a69('0x21'));logger['debug'](_0x6a69('0x22'),_0x469791,_0x6a69('0x21'),JSON[_0x6a69('0x23')](_0x54fa45));if(_0x54fa45['error']){if(_0x54fa45[_0x6a69('0x24')][_0x6a69('0x25')]===0x1f4){logger[_0x6a69('0x24')](_0x6a69('0x20'),_0x469791,_0x54fa45[_0x6a69('0x24')][_0x6a69('0x26')]);return _0x2b0ec2(_0x54fa45[_0x6a69('0x24')][_0x6a69('0x26')]);}logger[_0x6a69('0x24')](_0x6a69('0x20'),_0x469791,_0x54fa45['error']['message']);return _0x2b510f(_0x54fa45['error'][_0x6a69('0x26')]);}else{logger['info'](_0x6a69('0x20'),_0x469791,_0x6a69('0x21'));_0x2b510f(_0x54fa45[_0x6a69('0x27')][_0x6a69('0x26')]);}})['catch'](function(_0x44b096){logger['error'](_0x6a69('0x20'),_0x469791,_0x44b096);_0x2b0ec2(_0x44b096);});});}function respondWithStatusCode(_0x25872a,_0x134dad){_0x134dad=_0x134dad||0xcc;return function(_0x177d46){if(_0x177d46){return _0x25872a['sendStatus'](_0x134dad);}return _0x25872a[_0x6a69('0x28')](_0x134dad)[_0x6a69('0x29')]();};}function respondWithResult(_0x3bcb54,_0x231eb4){_0x231eb4=_0x231eb4||0xc8;return function(_0x1ababd){if(_0x1ababd){return _0x3bcb54[_0x6a69('0x28')](_0x231eb4)[_0x6a69('0x2a')](_0x1ababd);}};}function respondWithFilteredResult(_0x18dcb6,_0xee5c5b){return function(_0x108d42){if(_0x108d42){var _0x4562bf=typeof _0xee5c5b[_0x6a69('0x2b')]===_0x6a69('0x2c')&&typeof _0xee5c5b[_0x6a69('0x2d')]===_0x6a69('0x2c');var _0x215643=_0x108d42[_0x6a69('0x2e')];var _0x399791=_0x4562bf?0x0:_0xee5c5b['offset'];var _0x339920=_0x4562bf?_0x108d42[_0x6a69('0x2e')]:_0xee5c5b[_0x6a69('0x2b')]+_0xee5c5b['limit'];var _0x58a539;if(_0x339920>=_0x215643){_0x339920=_0x215643;_0x58a539=0xc8;}else{_0x58a539=0xce;}_0x18dcb6[_0x6a69('0x28')](_0x58a539);return _0x18dcb6['set'](_0x6a69('0x2f'),_0x399791+'-'+_0x339920+'/'+_0x215643)['json'](_0x108d42);}return null;};}function patchUpdates(_0x5e8b14){return function(_0x2ba9dc){try{jsonpatch['apply'](_0x2ba9dc,_0x5e8b14,!![]);}catch(_0x117135){return BPromise[_0x6a69('0x30')](_0x117135);}return _0x2ba9dc[_0x6a69('0x31')]();};}function saveUpdates(_0x3d1337,_0x32e823){return function(_0xd077d6){if(_0xd077d6){return _0xd077d6[_0x6a69('0x32')](_0x3d1337)[_0x6a69('0x1e')](function(_0xc2a3a8){return _0xc2a3a8;});}return null;};}function removeEntity(_0x167f43,_0x4d6af9){return function(_0xb04eb2){if(_0xb04eb2){return _0xb04eb2['destroy']()[_0x6a69('0x1e')](function(){var _0x4d903e=_0xb04eb2[_0x6a69('0x33')]({'plain':!![]});var _0x564c5f=_0x6a69('0x34');return db[_0x6a69('0x35')][_0x6a69('0x36')]({'where':{'type':_0x564c5f,'resourceId':_0x4d903e['id']}})[_0x6a69('0x1e')](function(){return _0xb04eb2;});})[_0x6a69('0x1e')](function(){_0x167f43[_0x6a69('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0xa998b9,_0x42ad63){return function(_0x527ee9){if(!_0x527ee9){_0xa998b9[_0x6a69('0x37')](0x194);}return _0x527ee9;};}function handleError(_0x2c6ea9,_0x4449a4){_0x4449a4=_0x4449a4||0x1f4;return function(_0x5b6a38){logger[_0x6a69('0x24')](_0x5b6a38[_0x6a69('0x38')]);if(_0x5b6a38['name']){delete _0x5b6a38[_0x6a69('0x39')];}_0x2c6ea9['status'](_0x4449a4)[_0x6a69('0x3a')](_0x5b6a38);};}exports['index']=function(_0x41393f,_0x22e116){var _0x435bb0={'include':[{'model':db[_0x6a69('0x3b')],'as':_0x6a69('0x3c')}]},_0x241ca7={},_0x512e9d={'count':0x0,'rows':[]};var _0x13180c=_[_0x6a69('0x3d')](db['OpenchannelAccount']['rawAttributes'],function(_0x529f8c){return{'name':_0x529f8c[_0x6a69('0x3e')],'type':_0x529f8c[_0x6a69('0x3f')][_0x6a69('0x40')]};});_0x241ca7['model']=_[_0x6a69('0x3d')](_0x13180c,'name');_0x241ca7[_0x6a69('0x41')]=_[_0x6a69('0x42')](_0x41393f[_0x6a69('0x41')]);_0x241ca7[_0x6a69('0x43')]=_['intersection'](_0x241ca7[_0x6a69('0x44')],_0x241ca7[_0x6a69('0x41')]);_0x435bb0[_0x6a69('0x45')]=_['intersection'](_0x241ca7['model'],qs['fields'](_0x41393f['query']['fields']));_0x435bb0[_0x6a69('0x45')]=_0x435bb0['attributes'][_0x6a69('0x46')]?_0x435bb0[_0x6a69('0x45')]:_0x241ca7[_0x6a69('0x44')];if(!_0x41393f[_0x6a69('0x41')]['hasOwnProperty']('nolimit')){_0x435bb0[_0x6a69('0x2d')]=qs['limit'](_0x41393f[_0x6a69('0x41')][_0x6a69('0x2d')]);_0x435bb0[_0x6a69('0x2b')]=qs[_0x6a69('0x2b')](_0x41393f[_0x6a69('0x41')][_0x6a69('0x2b')]);}_0x435bb0[_0x6a69('0x47')]=qs[_0x6a69('0x48')](_0x41393f[_0x6a69('0x41')]['sort']);_0x435bb0['where']=qs[_0x6a69('0x43')](_[_0x6a69('0x49')](_0x41393f[_0x6a69('0x41')],_0x241ca7[_0x6a69('0x43')]),_0x13180c);if(_0x41393f[_0x6a69('0x41')]['filter']){_0x435bb0[_0x6a69('0x4a')]=_[_0x6a69('0x4b')](_0x435bb0['where'],{'$or':_[_0x6a69('0x3d')](_0x13180c,function(_0x162894){if(_0x162894[_0x6a69('0x3f')]!=='VIRTUAL'){var _0x1d53bc={};_0x1d53bc[_0x162894[_0x6a69('0x39')]]={'$like':'%'+_0x41393f[_0x6a69('0x41')][_0x6a69('0x4c')]+'%'};return _0x1d53bc;}})});}_0x435bb0=_[_0x6a69('0x4b')]({},_0x435bb0,_0x41393f[_0x6a69('0x4d')]);var _0x55f482={'where':_0x435bb0[_0x6a69('0x4a')]};return db[_0x6a69('0x4e')][_0x6a69('0x2e')](_0x55f482)['then'](function(_0x2ee30c){_0x512e9d['count']=_0x2ee30c;if(_0x41393f['query'][_0x6a69('0x4f')]){_0x435bb0[_0x6a69('0x50')]=[{'all':!![]}];}return db['OpenchannelAccount'][_0x6a69('0x51')](_0x435bb0);})[_0x6a69('0x1e')](function(_0x1c6021){_0x512e9d[_0x6a69('0x52')]=_0x1c6021;return _0x512e9d;})[_0x6a69('0x1e')](respondWithFilteredResult(_0x22e116,_0x435bb0))[_0x6a69('0x53')](handleError(_0x22e116,null));};exports['show']=function(_0x140f8c,_0x97c380){var _0x4c96c5={'raw':![],'where':{'id':_0x140f8c['params']['id']},'include':[{'model':db[_0x6a69('0x3b')],'as':_0x6a69('0x3c')}]},_0x428634={};_0x428634['model']=_[_0x6a69('0x42')](db[_0x6a69('0x4e')][_0x6a69('0x54')]);_0x428634['query']=_[_0x6a69('0x42')](_0x140f8c['query']);_0x428634['filters']=_[_0x6a69('0x55')](_0x428634['model'],_0x428634[_0x6a69('0x41')]);_0x4c96c5[_0x6a69('0x45')]=_['intersection'](_0x428634[_0x6a69('0x44')],qs[_0x6a69('0x56')](_0x140f8c[_0x6a69('0x41')][_0x6a69('0x56')]));_0x4c96c5[_0x6a69('0x45')]=_0x4c96c5[_0x6a69('0x45')][_0x6a69('0x46')]?_0x4c96c5[_0x6a69('0x45')]:_0x428634[_0x6a69('0x44')];if(_0x140f8c[_0x6a69('0x41')]['includeAll']){_0x4c96c5['include']=[{'all':!![]}];}_0x4c96c5=_['merge']({},_0x4c96c5,_0x140f8c[_0x6a69('0x4d')]);return db[_0x6a69('0x4e')][_0x6a69('0x57')](_0x4c96c5)[_0x6a69('0x1e')](handleEntityNotFound(_0x97c380,null))['then'](respondWithResult(_0x97c380,null))[_0x6a69('0x53')](handleError(_0x97c380,null));};exports[_0x6a69('0x58')]=function(_0x54faa4,_0x332fd1){return db[_0x6a69('0x4e')][_0x6a69('0x58')](_0x54faa4[_0x6a69('0x59')],{})[_0x6a69('0x1e')](function(_0x169098){var _0x21ce38=_0x54faa4[_0x6a69('0x5a')][_0x6a69('0x33')]({'plain':!![]});if(!_0x21ce38)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x21ce38[_0x6a69('0x5b')]===_0x6a69('0x5a')){var _0x1c1eb7=_0x169098['get']({'plain':!![]});var _0x5361c2='OpenchannelAccounts';return db[_0x6a69('0x5c')][_0x6a69('0x57')]({'where':{'name':_0x5361c2,'userProfileId':_0x21ce38[_0x6a69('0x5d')]},'raw':!![]})['then'](function(_0x253718){if(_0x253718&&_0x253718['autoAssociation']===0x0){return db[_0x6a69('0x35')][_0x6a69('0x58')]({'name':_0x1c1eb7[_0x6a69('0x39')],'resourceId':_0x1c1eb7['id'],'type':_0x253718[_0x6a69('0x39')],'sectionId':_0x253718['id']},{})[_0x6a69('0x1e')](function(){return _0x169098;});}else{return _0x169098;}})[_0x6a69('0x53')](function(_0x2745ba){logger[_0x6a69('0x24')](_0x6a69('0x5e'),_0x2745ba);throw _0x2745ba;});}return _0x169098;})[_0x6a69('0x1e')](respondWithResult(_0x332fd1,0xc9))['catch'](handleError(_0x332fd1,null));};exports[_0x6a69('0x32')]=function(_0x360a78,_0x15116b){if(_0x360a78['body']['id']){delete _0x360a78[_0x6a69('0x59')]['id'];}return db[_0x6a69('0x4e')][_0x6a69('0x57')]({'where':{'id':_0x360a78[_0x6a69('0x5f')]['id']},'include':[{'model':db[_0x6a69('0x3b')],'as':'mandatoryDispositionPause'}]})[_0x6a69('0x1e')](handleEntityNotFound(_0x15116b,null))[_0x6a69('0x1e')](saveUpdates(_0x360a78['body'],null))[_0x6a69('0x1e')](respondWithResult(_0x15116b,null))[_0x6a69('0x53')](handleError(_0x15116b,null));};exports[_0x6a69('0x36')]=function(_0x24dec2,_0x4de2e1){return db[_0x6a69('0x4e')]['find']({'where':{'id':_0x24dec2[_0x6a69('0x5f')]['id']}})['then'](handleEntityNotFound(_0x4de2e1,null))['then'](removeEntity(_0x4de2e1,null))[_0x6a69('0x53')](handleError(_0x4de2e1,null));};exports[_0x6a69('0x60')]=function(_0x47eff7,_0xad08fc){return db['OpenchannelAccount'][_0x6a69('0x60')]()['then'](respondWithResult(_0xad08fc,null))[_0x6a69('0x53')](handleError(_0xad08fc,null));};exports[_0x6a69('0x61')]=function(_0x233dd5,_0x4db267,_0x47dcf8){if(_0x233dd5[_0x6a69('0x59')]['id']){delete _0x233dd5[_0x6a69('0x59')]['id'];}return db[_0x6a69('0x4e')][_0x6a69('0x57')]({'where':{'id':_0x233dd5[_0x6a69('0x5f')]['id']}})[_0x6a69('0x1e')](handleEntityNotFound(_0x4db267,null))[_0x6a69('0x1e')](function(_0x1e7c9e){if(_0x1e7c9e){_0x233dd5['body'][_0x6a69('0x62')]=_0x1e7c9e['id'];return db[_0x6a69('0x63')]['create'](_0x233dd5['body']);}})[_0x6a69('0x1e')](respondWithResult(_0x4db267,null))['catch'](handleError(_0x4db267,null));};exports['getDispositions']=function(_0x4858e8,_0x5a8025,_0x3f16ff){var _0x4d2569={'raw':![],'where':{}};var _0x4f7055={};var _0x4f785a={'count':0x0,'rows':[]};return db[_0x6a69('0x4e')]['findOne']({'where':{'id':_0x4858e8[_0x6a69('0x5f')]['id']}})[_0x6a69('0x1e')](handleEntityNotFound(_0x5a8025,null))['then'](function(_0x116c82){if(_0x116c82){_0x4f7055[_0x6a69('0x44')]=_['keys'](db[_0x6a69('0x63')][_0x6a69('0x54')]);_0x4f7055['query']=_[_0x6a69('0x42')](_0x4858e8[_0x6a69('0x41')]);_0x4f7055[_0x6a69('0x43')]=_['intersection'](_0x4f7055[_0x6a69('0x44')],_0x4f7055['query']);_0x4d2569[_0x6a69('0x45')]=_[_0x6a69('0x55')](_0x4f7055[_0x6a69('0x44')],qs[_0x6a69('0x56')](_0x4858e8[_0x6a69('0x41')][_0x6a69('0x56')]));_0x4d2569[_0x6a69('0x45')]=_0x4d2569[_0x6a69('0x45')][_0x6a69('0x46')]?_0x4d2569[_0x6a69('0x45')]:_0x4f7055[_0x6a69('0x44')];if(!_0x4858e8[_0x6a69('0x41')]['hasOwnProperty'](_0x6a69('0x64'))){_0x4d2569[_0x6a69('0x2d')]=qs[_0x6a69('0x2d')](_0x4858e8[_0x6a69('0x41')][_0x6a69('0x2d')]);_0x4d2569['offset']=qs[_0x6a69('0x2b')](_0x4858e8[_0x6a69('0x41')]['offset']);}_0x4d2569[_0x6a69('0x47')]=qs[_0x6a69('0x48')](_0x4858e8[_0x6a69('0x41')]['sort']);_0x4d2569['where']=qs[_0x6a69('0x43')](_[_0x6a69('0x49')](_0x4858e8[_0x6a69('0x41')],_0x4f7055['filters']));_0x4d2569[_0x6a69('0x4a')]['OpenchannelAccountId']=_0x116c82['id'];if(_0x4858e8[_0x6a69('0x41')][_0x6a69('0x4c')]){_0x4d2569[_0x6a69('0x4a')]=_[_0x6a69('0x4b')](_0x4d2569[_0x6a69('0x4a')],{'$or':_[_0x6a69('0x3d')](_0x4d2569[_0x6a69('0x45')],function(_0x4bee4f){var _0x36ae18={};_0x36ae18[_0x4bee4f]={'$like':'%'+_0x4858e8[_0x6a69('0x41')][_0x6a69('0x4c')]+'%'};return _0x36ae18;})});}_0x4d2569=_['merge']({},_0x4d2569,_0x4858e8[_0x6a69('0x4d')]);return db[_0x6a69('0x63')][_0x6a69('0x2e')]({'where':_0x4d2569[_0x6a69('0x4a')]})['then'](function(_0x33260e){_0x4f785a[_0x6a69('0x2e')]=_0x33260e;if(_0x4858e8[_0x6a69('0x41')]['includeAll']){_0x4d2569[_0x6a69('0x50')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x4d2569);})[_0x6a69('0x1e')](function(_0x332ca6){_0x4f785a[_0x6a69('0x52')]=_0x332ca6;return _0x4f785a;});}})[_0x6a69('0x1e')](respondWithFilteredResult(_0x5a8025,_0x4d2569))[_0x6a69('0x53')](handleError(_0x5a8025,null));};exports[_0x6a69('0x65')]=function(_0xdbc6a8,_0x5a48a0,_0x19f972){return db[_0x6a69('0x4e')]['find']({'where':{'id':_0xdbc6a8[_0x6a69('0x5f')]['id']}})[_0x6a69('0x1e')](handleEntityNotFound(_0x5a48a0,null))[_0x6a69('0x1e')](function(_0x5157b8){if(_0x5157b8){return _0x5157b8[_0x6a69('0x65')](_0xdbc6a8['query']['ids']);}})[_0x6a69('0x1e')](respondWithStatusCode(_0x5a48a0,null))[_0x6a69('0x53')](handleError(_0x5a48a0,null));};exports[_0x6a69('0x66')]=function(_0x38b429,_0x17508f,_0x178b06){if(_0x38b429['body']['id']){delete _0x38b429[_0x6a69('0x59')]['id'];}return db['OpenchannelAccount'][_0x6a69('0x57')]({'where':{'id':_0x38b429['params']['id']}})[_0x6a69('0x1e')](handleEntityNotFound(_0x17508f,null))[_0x6a69('0x1e')](function(_0x27ac8e){if(_0x27ac8e){_0x38b429[_0x6a69('0x59')][_0x6a69('0x62')]=_0x27ac8e['id'];return db[_0x6a69('0x67')][_0x6a69('0x58')](_0x38b429['body']);}})[_0x6a69('0x1e')](respondWithResult(_0x17508f,null))[_0x6a69('0x53')](handleError(_0x17508f,null));};exports[_0x6a69('0x68')]=function(_0x4b3bb0,_0x26cba8,_0x6e94d6){var _0x382e6d={'raw':![],'where':{}};var _0x317615={};var _0x208d34={'count':0x0,'rows':[]};return db[_0x6a69('0x4e')]['findOne']({'where':{'id':_0x4b3bb0[_0x6a69('0x5f')]['id']}})[_0x6a69('0x1e')](handleEntityNotFound(_0x26cba8,null))['then'](function(_0x1fe7f7){if(_0x1fe7f7){_0x317615[_0x6a69('0x44')]=_[_0x6a69('0x42')](db[_0x6a69('0x67')][_0x6a69('0x54')]);_0x317615[_0x6a69('0x41')]=_[_0x6a69('0x42')](_0x4b3bb0[_0x6a69('0x41')]);_0x317615['filters']=_[_0x6a69('0x55')](_0x317615[_0x6a69('0x44')],_0x317615[_0x6a69('0x41')]);_0x382e6d['attributes']=_[_0x6a69('0x55')](_0x317615['model'],qs[_0x6a69('0x56')](_0x4b3bb0['query'][_0x6a69('0x56')]));_0x382e6d['attributes']=_0x382e6d[_0x6a69('0x45')][_0x6a69('0x46')]?_0x382e6d['attributes']:_0x317615['model'];if(!_0x4b3bb0[_0x6a69('0x41')][_0x6a69('0x69')](_0x6a69('0x64'))){_0x382e6d['limit']=qs[_0x6a69('0x2d')](_0x4b3bb0[_0x6a69('0x41')][_0x6a69('0x2d')]);_0x382e6d[_0x6a69('0x2b')]=qs[_0x6a69('0x2b')](_0x4b3bb0[_0x6a69('0x41')][_0x6a69('0x2b')]);}_0x382e6d[_0x6a69('0x47')]=qs[_0x6a69('0x48')](_0x4b3bb0[_0x6a69('0x41')]['sort']);_0x382e6d[_0x6a69('0x4a')]=qs[_0x6a69('0x43')](_[_0x6a69('0x49')](_0x4b3bb0[_0x6a69('0x41')],_0x317615[_0x6a69('0x43')]));_0x382e6d['where'][_0x6a69('0x62')]=_0x1fe7f7['id'];if(_0x4b3bb0['query'][_0x6a69('0x4c')]){_0x382e6d[_0x6a69('0x4a')]=_[_0x6a69('0x4b')](_0x382e6d[_0x6a69('0x4a')],{'$or':_[_0x6a69('0x3d')](_0x382e6d[_0x6a69('0x45')],function(_0x1ef9a5){var _0x45467d={};_0x45467d[_0x1ef9a5]={'$like':'%'+_0x4b3bb0[_0x6a69('0x41')][_0x6a69('0x4c')]+'%'};return _0x45467d;})});}_0x382e6d=_['merge']({},_0x382e6d,_0x4b3bb0[_0x6a69('0x4d')]);return db[_0x6a69('0x67')][_0x6a69('0x2e')]({'where':_0x382e6d[_0x6a69('0x4a')]})['then'](function(_0x3495bd){_0x208d34['count']=_0x3495bd;if(_0x4b3bb0['query'][_0x6a69('0x4f')]){_0x382e6d[_0x6a69('0x50')]=[{'all':!![]}];}return db[_0x6a69('0x67')][_0x6a69('0x51')](_0x382e6d);})[_0x6a69('0x1e')](function(_0x252830){_0x208d34[_0x6a69('0x52')]=_0x252830;return _0x208d34;});}})[_0x6a69('0x1e')](respondWithFilteredResult(_0x26cba8,_0x382e6d))[_0x6a69('0x53')](handleError(_0x26cba8,null));};exports['removeAnswers']=function(_0x14e91c,_0x55e509,_0x51fb83){return db[_0x6a69('0x4e')]['find']({'where':{'id':_0x14e91c[_0x6a69('0x5f')]['id']}})['then'](handleEntityNotFound(_0x55e509,null))[_0x6a69('0x1e')](function(_0x5dd1fb){if(_0x5dd1fb){return _0x5dd1fb[_0x6a69('0x6a')](_0x14e91c[_0x6a69('0x41')]['ids']);}})[_0x6a69('0x1e')](respondWithStatusCode(_0x55e509,null))[_0x6a69('0x53')](handleError(_0x55e509,null));};exports[_0x6a69('0x6b')]=function(_0xc5073d,_0x173945,_0x243b0c){var _0x3c049d={'body':_0xc5073d[_0x6a69('0x59')],'channel':'openchannel'};var _0x236f6f=[];var _0x1dd72b=[];var _0x3b515b={};var _0x53de21=![];return db[_0x6a69('0x6c')][_0x6a69('0x60')]()[_0x6a69('0x1e')](function(_0x2543f6){if(!_0x2543f6){throw new db[(_0x6a69('0x6d'))][(_0x6a69('0x6e'))](_0x6a69('0x6f'));}_0x236f6f=_['difference'](_[_0x6a69('0x42')](_0x2543f6),[_0x6a69('0x70'),_0x6a69('0x71')]);_0x1dd72b=_[_0x6a69('0x72')](_[_0x6a69('0x42')](_0x2543f6),[_0x6a69('0x70'),'updatedAt',_0x6a69('0x73'),'ListId']);if(_0xc5073d[_0x6a69('0x59')]['id']){delete _0xc5073d[_0x6a69('0x59')]['id'];}if(_['isNil'](_0xc5073d[_0x6a69('0x59')]['from'])){throw new db[(_0x6a69('0x6d'))]['ValidationError'](_0x6a69('0x74'));}if(_[_0x6a69('0x75')](_0xc5073d[_0x6a69('0x59')][_0x6a69('0x59')])||_0xc5073d['body'][_0x6a69('0x59')]===''){throw new db[(_0x6a69('0x6d'))]['ValidationError'](_0x6a69('0x76'));}if(_[_0x6a69('0x75')](_0xc5073d[_0x6a69('0x59')][_0x6a69('0x77')])){throw new db['Sequelize'][(_0x6a69('0x6e'))](_0x6a69('0x78')+_0x1dd72b);}if(!_[_0x6a69('0x79')](_0x1dd72b,_0xc5073d[_0x6a69('0x59')][_0x6a69('0x77')])){throw new db[(_0x6a69('0x6d'))][(_0x6a69('0x6e'))](_0x6a69('0x7a')+_0x1dd72b);}_0x3b515b[_0xc5073d[_0x6a69('0x59')][_0x6a69('0x77')]]=_0xc5073d[_0x6a69('0x59')][_0x6a69('0x7b')];})['then'](function(){return db['OpenchannelAccount']['find']({'where':{'id':_0xc5073d[_0x6a69('0x5f')]['id']},'include':[{'model':db[_0x6a69('0x7c')],'as':'List','include':[{'model':db[_0x6a69('0x6c')],'as':'Contacts','where':_0x3b515b,'limit':0x1,'order':[[_0x6a69('0x71'),_0x6a69('0x7d')]]}]},{'model':db[_0x6a69('0x7e')],'as':'Applications'}]});})[_0x6a69('0x1e')](handleEntityNotFound(_0x173945,null))[_0x6a69('0x1e')](function(_0x4b088a){if(_0x4b088a&&_0x4b088a[_0x6a69('0x7f')]){_0x3c049d[_0x6a69('0x80')]=_0x4b088a;_0x3c049d['applications']=_0x4b088a[_0x6a69('0x81')];_0x3c049d[_0x6a69('0x82')]=_0x4b088a[_0x6a69('0x7f')];_0x3c049d[_0x6a69('0x83')]=_[_0x6a69('0x84')](_0x3c049d[_0x6a69('0x83')],[_0x6a69('0x85')],[_0x6a69('0x86')]);if(_0x3c049d[_0x6a69('0x80')]['Applications']){delete _0x3c049d[_0x6a69('0x80')][_0x6a69('0x81')];}if(_0x3c049d[_0x6a69('0x80')][_0x6a69('0x7f')]&&_0x3c049d[_0x6a69('0x80')][_0x6a69('0x7f')][_0x6a69('0x87')]['length']){return _0x3c049d[_0x6a69('0x80')][_0x6a69('0x7f')]['Contacts'][0x0];}var _0x3a794c=_['defaults'](_0xc5073d[_0x6a69('0x59')],{'firstName':_0xc5073d[_0x6a69('0x59')][_0x6a69('0x7b')],'ListId':_0x4b088a[_0x6a69('0x88')]});_0x3a794c[_0xc5073d['body'][_0x6a69('0x77')]]=_0xc5073d[_0x6a69('0x59')][_0x6a69('0x7b')];return db[_0x6a69('0x6c')][_0x6a69('0x58')](_0x3a794c,{'fields':_0x236f6f,'raw':!![]});}})[_0x6a69('0x1e')](handleEntityNotFound(_0x173945,null))[_0x6a69('0x1e')](function(_0x249c39){_0x3c049d['contact']=_0x249c39;if(_0x249c39){var _0x30e25c={'ContactId':_0x249c39['id'],'OpenchannelAccountId':_0xc5073d[_0x6a69('0x5f')]['id'],'from':(_0x249c39[_0x6a69('0x89')]||'')+'\x20'+(_0x249c39[_0x6a69('0x8a')]||'')};var _0x2aa218={'OpenchannelAccountId':_0xc5073d[_0x6a69('0x5f')]['id'],'closed':![]};if(_0xc5073d['body'][_0x6a69('0x8b')]){_0x2aa218[_0x6a69('0x8b')]=_0xc5073d['body']['threadId'];return db['OpenchannelInteraction']['find']({'where':_0x2aa218})[_0x6a69('0x1e')](function(_0x595858){if(_0x595858){return[_0x595858,![]];}_0x30e25c[_0x6a69('0x8b')]=_0xc5073d[_0x6a69('0x59')][_0x6a69('0x8b')];_0x30e25c['externalUrl']=_0xc5073d['body'][_0x6a69('0x8c')];return db[_0x6a69('0x8d')][_0x6a69('0x58')](_0x30e25c)[_0x6a69('0x1e')](function(_0x210817){return[_0x210817,!![]];});});}else{_0x2aa218[_0x6a69('0x8b')]=null;}_0x2aa218['ContactId']=_0x249c39['id'];return db['OpenchannelInteraction']['find']({'where':_0x2aa218})[_0x6a69('0x1e')](function(_0x3d9c6b){if(_0x3d9c6b){return[_0x3d9c6b,![]];}return db['OpenchannelInteraction'][_0x6a69('0x58')](_0x30e25c)[_0x6a69('0x1e')](function(_0xcfd715){return[_0xcfd715,!![]];});});}})[_0x6a69('0x8e')](function(_0x1b6fa7,_0xc490bb){if(_0x1b6fa7){_0x53de21=_0xc490bb;if(!_0xc490bb){var _0x233f43={'from':(_0x3c049d[_0x6a69('0x8f')][_0x6a69('0x89')]||'')+'\x20'+(_0x3c049d[_0x6a69('0x8f')][_0x6a69('0x8a')]||'')};if(_0xc5073d[_0x6a69('0x59')][_0x6a69('0x8b')]&&_0xc5073d[_0x6a69('0x59')][_0x6a69('0x90')]&&_0xc5073d[_0x6a69('0x59')][_0x6a69('0x8b')]!=_0xc5073d[_0x6a69('0x59')]['messageId']){_0x233f43['threadId']=_0xc5073d[_0x6a69('0x59')]['messageId'];}return _0x1b6fa7[_0x6a69('0x32')](_0x233f43);}else{return _0x1b6fa7;}}})[_0x6a69('0x1e')](function(_0x525da0){_0x3c049d['interaction']=_0x525da0[_0x6a69('0x33')]({'plain':!![]});_0x3c049d[_0x6a69('0x91')][_0x6a69('0x92')]=_0x53de21;if(_0x3c049d['interaction']['created']){if(_0x3c049d[_0x6a69('0x80')][_0x6a69('0x93')]){_0x3c049d[_0x6a69('0x83')]['push']({'id':0x0,'priority':_0x3c049d[_0x6a69('0x83')][_0x6a69('0x46')]+0x1,'app':_0x6a69('0x94'),'appdata':'unmanaged','interval':_0x6a69('0x95')});}}return db[_0x6a69('0x96')]['create']({'body':_0xc5073d[_0x6a69('0x59')][_0x6a69('0x59')],'OpenchannelAccountId':_0xc5073d['params']['id'],'OpenchannelInteractionId':_0x525da0['id'],'direction':'in','ContactId':_0x3c049d['contact']['id'],'AttachmentId':_0xc5073d[_0x6a69('0x59')][_0x6a69('0x97')]});})[_0x6a69('0x1e')](function(_0x4370f0){_0x3c049d['message']=_0x4370f0;if(_0x3c049d[_0x6a69('0x91')][_0x6a69('0x98')]){return db[_0x6a69('0x99')]['find']({'attributes':['id',_0x6a69('0x39')],'where':{'id':_0x3c049d['interaction'][_0x6a69('0x98')]}})[_0x6a69('0x1e')](function(_0x3f8426){if(_0x3f8426){_0x3c049d['applications'][_0x6a69('0x9a')]({'id':0x0,'priority':0x0,'app':_0x6a69('0x9b'),'appdata':_0x3f8426[_0x6a69('0x39')]+','+(_0x3c049d[_0x6a69('0x80')][_0x6a69('0x9c')]||0xa),'interval':_0x6a69('0x95')});_0x3c049d[_0x6a69('0x9d')]=![];}return respondWithRpcPromise(_0x6a69('0x9e'),_0x6a69('0x9f'),_0x3c049d);});}return respondWithRpcPromise(_0x6a69('0x9e'),'startRouting',_0x3c049d);})[_0x6a69('0x1e')](function(_0x49e6e3){respondWithRpcPromise(_0x6a69('0xa0'),_0x6a69('0xa0'),{'event':_0x6a69('0x6b'),'message':_0x49e6e3},client9002);return _0x49e6e3;})[_0x6a69('0x1e')](respondWithResult(_0x173945,null))[_0x6a69('0x53')](handleError(_0x173945,null));};exports[_0x6a69('0xa1')]=function(_0x2a18a7,_0x246a71,_0xf8d120){return db[_0x6a69('0x4e')]['findOne']({'where':{'id':_0x2a18a7[_0x6a69('0x5f')]['id']}})[_0x6a69('0x1e')](handleEntityNotFound(_0x246a71,null))[_0x6a69('0x1e')](function(_0x32de35){if(_0x32de35){return db[_0x6a69('0xa2')]['transaction'](function(_0x5b880a){return db[_0x6a69('0x7e')]['destroy']({'where':{'OpenchannelAccountId':_0x2a18a7[_0x6a69('0x5f')]['id']},'transaction':_0x5b880a})[_0x6a69('0x1e')](function(_0x5cf37c){var _0x4ca351=_[_0x6a69('0x3d')](_0x2a18a7['body'],function(_0x5575a9){_0x5575a9[_0x6a69('0x62')]=_0x2a18a7[_0x6a69('0x5f')]['id'];return _0x5575a9;});return db[_0x6a69('0x7e')][_0x6a69('0xa3')](_0x4ca351,{'transaction':_0x5b880a});});})['then'](function(){return db['OpenchannelApplication']['findAndCountAll']({'where':{'OpenchannelAccountId':_0x2a18a7['params']['id']},'order':_0x6a69('0x85')});});}})[_0x6a69('0x1e')](respondWithResult(_0x246a71,null))[_0x6a69('0x53')](handleError(_0x246a71,null));};exports['getApplications']=function(_0x39145e,_0x4f8cc5,_0x4eed90){var _0x1922df={};var _0x4bcdcf={};var _0x4e3f2c;var _0x32b66d;return db[_0x6a69('0x4e')][_0x6a69('0xa4')]({'where':{'id':_0x39145e[_0x6a69('0x5f')]['id']}})[_0x6a69('0x1e')](handleEntityNotFound(_0x4f8cc5,null))[_0x6a69('0x1e')](function(_0x382ac4){if(_0x382ac4){_0x4e3f2c=_0x382ac4;_0x4bcdcf['model']=_['keys'](db['OpenchannelApplication'][_0x6a69('0x54')]);_0x4bcdcf['query']=_[_0x6a69('0x42')](_0x39145e[_0x6a69('0x41')]);_0x4bcdcf['filters']=_[_0x6a69('0x55')](_0x4bcdcf[_0x6a69('0x44')],_0x4bcdcf[_0x6a69('0x41')]);_0x1922df['attributes']=_[_0x6a69('0x55')](_0x4bcdcf[_0x6a69('0x44')],qs[_0x6a69('0x56')](_0x39145e[_0x6a69('0x41')][_0x6a69('0x56')]));_0x1922df[_0x6a69('0x45')]=_0x1922df[_0x6a69('0x45')][_0x6a69('0x46')]?_0x1922df[_0x6a69('0x45')]:_0x4bcdcf[_0x6a69('0x44')];_0x1922df[_0x6a69('0x47')]=qs[_0x6a69('0x48')](_0x39145e['query']['sort']);_0x1922df[_0x6a69('0x4a')]=qs[_0x6a69('0x43')](_[_0x6a69('0x49')](_0x39145e['query'],_0x4bcdcf[_0x6a69('0x43')]));if(_0x39145e[_0x6a69('0x41')][_0x6a69('0x4c')]){_0x1922df[_0x6a69('0x4a')]=_[_0x6a69('0x4b')](_0x1922df[_0x6a69('0x4a')],{'$or':_[_0x6a69('0x3d')](_0x1922df[_0x6a69('0x45')],function(_0x584922){var _0xe5cf72={};_0xe5cf72[_0x584922]={'$like':'%'+_0x39145e[_0x6a69('0x41')]['filter']+'%'};return _0xe5cf72;})});}_0x1922df=_[_0x6a69('0x4b')]({},_0x1922df,_0x39145e[_0x6a69('0x4d')]);return _0x4e3f2c['getApplications'](_0x1922df);}})[_0x6a69('0x1e')](function(_0x243b3b){if(_0x243b3b){_0x32b66d=_0x243b3b['length'];if(!_0x39145e[_0x6a69('0x41')][_0x6a69('0x69')](_0x6a69('0x64'))){_0x1922df[_0x6a69('0x2d')]=qs[_0x6a69('0x2d')](_0x39145e[_0x6a69('0x41')][_0x6a69('0x2d')]);_0x1922df[_0x6a69('0x2b')]=qs[_0x6a69('0x2b')](_0x39145e['query']['offset']);}return _0x4e3f2c[_0x6a69('0xa5')](_0x1922df);}})[_0x6a69('0x1e')](function(_0x2319d3){if(_0x2319d3){return _0x2319d3?{'count':_0x32b66d,'rows':_0x2319d3}:null;}})[_0x6a69('0x1e')](respondWithResult(_0x4f8cc5,null))[_0x6a69('0x53')](handleError(_0x4f8cc5,null));};exports[_0x6a69('0xa6')]=function(_0x37ce9f,_0x31a3e5,_0x5a92ce){var _0x2f6585={'raw':![],'where':{}};var _0x1434d7={};var _0x323c6b={'count':0x0,'rows':[]};return db['OpenchannelAccount']['findOne']({'where':{'id':_0x37ce9f[_0x6a69('0x5f')]['id']}})[_0x6a69('0x1e')](handleEntityNotFound(_0x31a3e5,null))[_0x6a69('0x1e')](function(_0x2fc64e){if(_0x2fc64e){_0x1434d7[_0x6a69('0x44')]=_[_0x6a69('0x42')](db[_0x6a69('0x8d')][_0x6a69('0x54')]);_0x1434d7[_0x6a69('0x41')]=_['keys'](_0x37ce9f['query']);_0x1434d7['filters']=_[_0x6a69('0x55')](_0x1434d7[_0x6a69('0x44')],_0x1434d7[_0x6a69('0x41')]);_0x2f6585[_0x6a69('0x45')]=_[_0x6a69('0x55')](_0x1434d7[_0x6a69('0x44')],qs['fields'](_0x37ce9f[_0x6a69('0x41')][_0x6a69('0x56')]));_0x2f6585[_0x6a69('0x45')]=_0x2f6585[_0x6a69('0x45')][_0x6a69('0x46')]?_0x2f6585[_0x6a69('0x45')]:_0x1434d7[_0x6a69('0x44')];if(!_0x37ce9f['query'][_0x6a69('0x69')]('nolimit')){_0x2f6585[_0x6a69('0x2d')]=qs['limit'](_0x37ce9f[_0x6a69('0x41')][_0x6a69('0x2d')]);_0x2f6585[_0x6a69('0x2b')]=qs[_0x6a69('0x2b')](_0x37ce9f[_0x6a69('0x41')][_0x6a69('0x2b')]);}_0x2f6585['order']=qs[_0x6a69('0x48')](_0x37ce9f[_0x6a69('0x41')][_0x6a69('0x48')]);_0x2f6585['where']=qs[_0x6a69('0x43')](_[_0x6a69('0x49')](_0x37ce9f[_0x6a69('0x41')],_0x1434d7[_0x6a69('0x43')]));_0x2f6585['where'][_0x6a69('0x62')]=_0x2fc64e['id'];if(_0x37ce9f[_0x6a69('0x41')][_0x6a69('0x4c')]){_0x2f6585[_0x6a69('0x4a')]=_[_0x6a69('0x4b')](_0x2f6585['where'],{'$or':_[_0x6a69('0x3d')](_0x2f6585['attributes'],function(_0x877017){var _0x332ea2={};_0x332ea2[_0x877017]={'$like':'%'+_0x37ce9f['query'][_0x6a69('0x4c')]+'%'};return _0x332ea2;})});}_0x2f6585=_['merge']({},_0x2f6585,_0x37ce9f[_0x6a69('0x4d')]);return db[_0x6a69('0x8d')]['count']({'where':_0x2f6585[_0x6a69('0x4a')]})[_0x6a69('0x1e')](function(_0x411da1){_0x323c6b[_0x6a69('0x2e')]=_0x411da1;if(_0x37ce9f['query'][_0x6a69('0x4f')]){_0x2f6585['include']=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db['User'],'as':_0x6a69('0xa7'),'attributes':[_0x6a69('0x39'),_0x6a69('0xa8'),_0x6a69('0xa9')],'required':![]},{'model':db[_0x6a69('0xaa')],'as':_0x6a69('0xab'),'attributes':['id',_0x6a69('0x39'),_0x6a69('0xac')],'where':_0x37ce9f[_0x6a69('0x41')]['tag']?{'id':_0x37ce9f[_0x6a69('0x41')][_0x6a69('0xad')]}:undefined,'required':_0x37ce9f[_0x6a69('0x41')]['tag']?!![]:![]}];}return db[_0x6a69('0x8d')][_0x6a69('0x51')](_0x2f6585);})[_0x6a69('0x1e')](function(_0x1663d4){_0x323c6b[_0x6a69('0x52')]=_0x1663d4;return _0x323c6b;});}})[_0x6a69('0x1e')](respondWithFilteredResult(_0x31a3e5,_0x2f6585))[_0x6a69('0x53')](handleError(_0x31a3e5,null));};exports[_0x6a69('0xae')]=function(_0x2a61d2,_0x3b4890,_0x1715f0){return db[_0x6a69('0x4e')]['find']({'where':{'id':_0x2a61d2['params']['id']}})[_0x6a69('0x1e')](handleEntityNotFound(_0x3b4890,null))[_0x6a69('0x1e')](function(_0x28de00){if(_0x28de00){return _0x28de00[_0x6a69('0xae')](_0x2a61d2[_0x6a69('0x59')]['ids'],_['omit'](_0x2a61d2[_0x6a69('0x59')],[_0x6a69('0xaf'),'id'])||{})[_0x6a69('0x8e')](function(_0x153f1a){for(var _0x17b92a=0x0;_0x17b92a<_0x2a61d2[_0x6a69('0x59')][_0x6a69('0xaf')][_0x6a69('0x46')];_0x17b92a+=0x1){socket[_0x6a69('0xb0')]('userOpenchannelAccount:save',{'UserId':Number(_0x2a61d2[_0x6a69('0x59')][_0x6a69('0xaf')][_0x17b92a]),'OpenchannelAccountId':Number(_0x2a61d2[_0x6a69('0x5f')]['id'])});}return _0x153f1a;});}})[_0x6a69('0x1e')](respondWithResult(_0x3b4890,null))['catch'](handleError(_0x3b4890,null));};exports[_0x6a69('0xb1')]=function(_0x2c2d0e,_0x1e2ea7,_0x38ee92){return db[_0x6a69('0x4e')][_0x6a69('0x57')]({'where':{'id':_0x2c2d0e[_0x6a69('0x5f')]['id']}})[_0x6a69('0x1e')](handleEntityNotFound(_0x1e2ea7,null))['then'](function(_0x3e82c5){if(_0x3e82c5){return _0x3e82c5[_0x6a69('0xb1')](_0x2c2d0e[_0x6a69('0x41')][_0x6a69('0xaf')])[_0x6a69('0x1e')](function(){if(_[_0x6a69('0xb2')](_0x2c2d0e['query'][_0x6a69('0xaf')])){for(var _0x484e14=0x0;_0x484e14<_0x2c2d0e['query'][_0x6a69('0xaf')]['length'];_0x484e14+=0x1){socket['emit'](_0x6a69('0xb3'),{'UserId':Number(_0x2c2d0e[_0x6a69('0x41')][_0x6a69('0xaf')][_0x484e14]),'OpenchannelAccountId':Number(_0x2c2d0e[_0x6a69('0x5f')]['id'])});}}else{socket['emit'](_0x6a69('0xb3'),{'UserId':Number(_0x2c2d0e[_0x6a69('0x41')][_0x6a69('0xaf')]),'OpenchannelAccountId':Number(_0x2c2d0e[_0x6a69('0x5f')]['id'])});}});}})[_0x6a69('0x1e')](respondWithStatusCode(_0x1e2ea7,null))['catch'](handleError(_0x1e2ea7,null));};exports[_0x6a69('0xb4')]=function(_0x16774c,_0x106ac3,_0x15be4f){var _0x550259={};var _0x31d634={};var _0x4d72da;var _0x264a41;return db[_0x6a69('0x4e')]['findOne']({'where':{'id':_0x16774c[_0x6a69('0x5f')]['id']}})['then'](handleEntityNotFound(_0x106ac3,null))['then'](function(_0x7ae4af){if(_0x7ae4af){_0x4d72da=_0x7ae4af;_0x31d634['model']=_['keys'](db[_0x6a69('0x99')][_0x6a69('0x54')]);_0x31d634[_0x6a69('0x41')]=_[_0x6a69('0x42')](_0x16774c['query']);_0x31d634[_0x6a69('0x43')]=_[_0x6a69('0x55')](_0x31d634[_0x6a69('0x44')],_0x31d634[_0x6a69('0x41')]);_0x550259[_0x6a69('0x45')]=_[_0x6a69('0x55')](_0x31d634['model'],qs[_0x6a69('0x56')](_0x16774c[_0x6a69('0x41')][_0x6a69('0x56')]));_0x550259[_0x6a69('0x45')]=_0x550259['attributes'][_0x6a69('0x46')]?_0x550259[_0x6a69('0x45')]:_0x31d634[_0x6a69('0x44')];_0x550259[_0x6a69('0x47')]=qs[_0x6a69('0x48')](_0x16774c[_0x6a69('0x41')][_0x6a69('0x48')]);_0x550259[_0x6a69('0x4a')]=qs[_0x6a69('0x43')](_[_0x6a69('0x49')](_0x16774c[_0x6a69('0x41')],_0x31d634['filters']));if(_0x16774c['query']['filter']){_0x550259[_0x6a69('0x4a')]=_['merge'](_0x550259[_0x6a69('0x4a')],{'$or':_[_0x6a69('0x3d')](_0x550259['attributes'],function(_0x1933cf){var _0x2c7522={};_0x2c7522[_0x1933cf]={'$like':'%'+_0x16774c[_0x6a69('0x41')][_0x6a69('0x4c')]+'%'};return _0x2c7522;})});}_0x550259=_['merge']({},_0x550259,_0x16774c[_0x6a69('0x4d')]);return _0x4d72da['getAgents'](_0x550259);}})[_0x6a69('0x1e')](function(_0x3ed4a2){if(_0x3ed4a2){_0x264a41=_0x3ed4a2['length'];if(!_0x16774c[_0x6a69('0x41')][_0x6a69('0x69')](_0x6a69('0x64'))){_0x550259[_0x6a69('0x2d')]=qs[_0x6a69('0x2d')](_0x16774c[_0x6a69('0x41')][_0x6a69('0x2d')]);_0x550259[_0x6a69('0x2b')]=qs[_0x6a69('0x2b')](_0x16774c[_0x6a69('0x41')][_0x6a69('0x2b')]);}return _0x4d72da[_0x6a69('0xb4')](_0x550259);}})[_0x6a69('0x1e')](function(_0x4fbbd4){if(_0x4fbbd4){return _0x4fbbd4?{'count':_0x264a41,'rows':_0x4fbbd4}:null;}})[_0x6a69('0x1e')](respondWithResult(_0x106ac3,null))[_0x6a69('0x53')](handleError(_0x106ac3,null));};exports['send']=function(_0x23db08,_0x5aa969,_0x242386){var _0x536ad9,_0x40a012,_0x29ece2;if(_[_0x6a69('0x75')](_0x23db08['body'][_0x6a69('0x59')])||_0x23db08['body'][_0x6a69('0x59')]===''){throw new db[(_0x6a69('0x6d'))][(_0x6a69('0x6e'))](_0x6a69('0x76'));}if(_[_0x6a69('0x75')](_0x23db08[_0x6a69('0x59')]['to'])){}_0x536ad9=_0x23db08['body']['to'];return db['OpenchannelAccount']['findOne']({'where':{'id':_0x23db08[_0x6a69('0x5f')]['id']}})[_0x6a69('0x1e')](handleEntityNotFound(_0x5aa969,null))[_0x6a69('0x1e')](function(_0x1038b0){if(_0x1038b0){return db[_0x6a69('0x4e')]['find']({'where':{'id':_0x1038b0['id']},'include':[{'model':db[_0x6a69('0x7c')],'as':_0x6a69('0x7f'),'include':[{'model':db['CmContact'],'as':_0x6a69('0x87'),'where':{[_0x1038b0['mapKey']]:_0x536ad9},'limit':0x1,'order':[['updatedAt',_0x6a69('0x7d')]]}]}]})[_0x6a69('0x1e')](handleEntityNotFound(_0x5aa969,null))['then'](function(_0x4af49f){if(_0x4af49f&&_0x4af49f[_0x6a69('0x7f')]){_0x40a012=_0x4af49f[_0x6a69('0x33')]({'plain':!![]});if(_0x40a012[_0x6a69('0x7f')]&&_0x40a012['List'][_0x6a69('0x87')][_0x6a69('0x46')]){return _0x40a012['List']['Contacts'][0x0];}return db[_0x6a69('0x6c')]['create'](_[_0x6a69('0x16')](_0x23db08['body'],{'firstName':_0x536ad9,[_0x4af49f['mapKey']]:_0x536ad9,'phone':_0x536ad9,'ListId':_0x40a012[_0x6a69('0x88')]}));}})[_0x6a69('0x1e')](handleEntityNotFound(_0x5aa969,null))[_0x6a69('0x1e')](function(_0x5ca71a){if(_0x5ca71a){_0x29ece2=_0x5ca71a;return db[_0x6a69('0x8d')][_0x6a69('0x57')]({'where':{'ContactId':_0x29ece2['id'],'closed':![],'OpenchannelAccountId':_0x40a012['id']}})['then'](function(_0x3c980f){if(_0x3c980f){return[_0x3c980f,![]];}return db[_0x6a69('0x8d')]['create']({'UserId':_0x23db08[_0x6a69('0x5a')]['id'],'ContactId':_0x29ece2['id'],'OpenchannelAccountId':_0x40a012['id'],'lastMsgDirection':_0x6a69('0xb5'),'Messages':[_[_0x6a69('0x4b')](_0x23db08[_0x6a69('0x59')],{'read':![],'body':_0x23db08[_0x6a69('0x59')][_0x6a69('0x59')],'OpenchannelAccountId':_0x40a012['id'],'UserId':_0x23db08[_0x6a69('0x5a')]['id'],'ContactId':_0x29ece2['id']})]},{'include':[{'model':db[_0x6a69('0x96')],'as':_0x6a69('0xb6')}]})['then'](function(_0x5d9f47){return[_0x5d9f47,!![]];});});}})[_0x6a69('0x8e')](function(_0x17e37b,_0x124b08){if(_0x124b08){return _0x17e37b;}return db['OpenchannelMessage'][_0x6a69('0x58')](_[_0x6a69('0x4b')](_0x23db08['body'],{'read':![],'body':_0x23db08[_0x6a69('0x59')]['body'],'OpenchannelAccountId':_0x40a012['id'],'OpenchannelInteractionId':_0x17e37b['id'],'UserId':_0x23db08[_0x6a69('0x5a')]['id'],'ContactId':_0x29ece2['id']}))[_0x6a69('0x1e')](function(_0x1a7ce4){_0x17e37b[_0x6a69('0xb7')][_0x6a69('0xb6')]=[];_0x17e37b['dataValues']['Messages'][_0x6a69('0xb8')](_0x1a7ce4[_0x6a69('0xb7')]);return _0x17e37b;});});}})[_0x6a69('0x1e')](respondWithResult(_0x5aa969,null))['catch'](handleError(_0x5aa969,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index 61a623e..1ca2838 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 _0x668b=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0xc5a279,_0x155360){var _0xc755d3=function(_0x15051c){while(--_0x15051c){_0xc5a279['push'](_0xc5a279['shift']());}};_0xc755d3(++_0x155360);}(_0x668b,0x140));var _0xb668=function(_0x57645b,_0x25f73a){_0x57645b=_0x57645b-0x0;var _0xe82f00=_0x668b[_0x57645b];return _0xe82f00;};'use strict';var EventEmitter=require(_0xb668('0x0'));var OpenchannelAccount=require(_0xb668('0x1'))['db']['OpenchannelAccount'];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xb668('0x2')](0x0);var events={'afterCreate':_0xb668('0x3'),'afterUpdate':'update','afterDestroy':_0xb668('0x4')};function emitEvent(_0x5e2e83){return function(_0x2fab11,_0x4092a6,_0x2960f5){OpenchannelAccountEvents['emit'](_0x5e2e83+':'+_0x2fab11['id'],_0x2fab11);OpenchannelAccountEvents[_0xb668('0x5')](_0x5e2e83,_0x2fab11);_0x2960f5(null);};}for(var e in events){if(events[_0xb668('0x6')](e)){var event=events[e];OpenchannelAccount[_0xb668('0x7')](e,emitEvent(event));}}module[_0xb668('0x8')]=OpenchannelAccountEvents; \ No newline at end of file +var _0xec56=['emit','hasOwnProperty','hook','exports','events','setMaxListeners','save','update','remove'];(function(_0x546ab6,_0x357f23){var _0x3952ca=function(_0x29dcfa){while(--_0x29dcfa){_0x546ab6['push'](_0x546ab6['shift']());}};_0x3952ca(++_0x357f23);}(_0xec56,0x1bd));var _0x6ec5=function(_0x3c611c,_0x5b3145){_0x3c611c=_0x3c611c-0x0;var _0x5da866=_0xec56[_0x3c611c];return _0x5da866;};'use strict';var EventEmitter=require(_0x6ec5('0x0'));var OpenchannelAccount=require('../../mysqldb')['db']['OpenchannelAccount'];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x6ec5('0x1')](0x0);var events={'afterCreate':_0x6ec5('0x2'),'afterUpdate':_0x6ec5('0x3'),'afterDestroy':_0x6ec5('0x4')};function emitEvent(_0x43c2cd){return function(_0x399441,_0x469679,_0x173aeb){OpenchannelAccountEvents[_0x6ec5('0x5')](_0x43c2cd+':'+_0x399441['id'],_0x399441);OpenchannelAccountEvents[_0x6ec5('0x5')](_0x43c2cd,_0x399441);_0x173aeb(null);};}for(var e in events){if(events[_0x6ec5('0x6')](e)){var event=events[e];OpenchannelAccount[_0x6ec5('0x7')](e,emitEvent(event));}}module[_0x6ec5('0x8')]=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index 03f2b88..d02d1ba 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(_0x483743,_0x12eb0b){var _0x114f93=function(_0xdf0265){while(--_0xdf0265){_0x483743['push'](_0x483743['shift']());}};_0x114f93(++_0x12eb0b);}(_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(_0x1bbf62,_0x48e738){var _0x18d64a=function(_0x23a36d){while(--_0x23a36d){_0x1bbf62['push'](_0x1bbf62['shift']());}};_0x18d64a(++_0x48e738);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xa9e0[_0x4b7b62];return _0x2280df;};'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 8feb461..5701f18 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 _0x8130=['redis','defaults','localhost','socket.io-emitter','register','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http'];(function(_0x10a3c2,_0x2ed862){var _0x53c749=function(_0x35b96a){while(--_0x35b96a){_0x10a3c2['push'](_0x10a3c2['shift']());}};_0x53c749(++_0x2ed862);}(_0x8130,0x146));var _0x0813=function(_0x1da999,_0x5035f0){_0x1da999=_0x1da999-0x0;var _0x1973be=_0x8130[_0x1da999];return _0x1973be;};'use strict';var _=require(_0x0813('0x0'));var util=require(_0x0813('0x1'));var moment=require('moment');var BPromise=require(_0x0813('0x2'));var rs=require(_0x0813('0x3'));var fs=require('fs');var Redis=require(_0x0813('0x4'));var db=require(_0x0813('0x5'))['db'];var utils=require(_0x0813('0x6'));var logger=require(_0x0813('0x7'))('rpc');var config=require(_0x0813('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x0813('0x9')]({'port':0x232a});config[_0x0813('0xa')]=_[_0x0813('0xb')](config[_0x0813('0xa')],{'host':_0x0813('0xc'),'port':0x18eb});var socket=require(_0x0813('0xd'))(new Redis(config[_0x0813('0xa')]));require('./openchannelAccount.socket')[_0x0813('0xe')](socket);function respondWithRpcPromise(_0x1815be,_0x251ca8,_0x5a9c5e){return new BPromise(function(_0x5550c8,_0x15f8d6){return client['request'](_0x1815be,_0x5a9c5e)[_0x0813('0xf')](function(_0x5b54ec){logger[_0x0813('0x10')](_0x0813('0x11'),_0x251ca8,_0x0813('0x12'));logger[_0x0813('0x13')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x251ca8,'request\x20sent',JSON[_0x0813('0x14')](_0x5b54ec));if(_0x5b54ec[_0x0813('0x15')]){if(_0x5b54ec['error'][_0x0813('0x16')]===0x1f4){logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x251ca8,_0x5b54ec[_0x0813('0x15')][_0x0813('0x17')]);return _0x15f8d6(_0x5b54ec['error'][_0x0813('0x17')]);}logger['error'](_0x0813('0x11'),_0x251ca8,_0x5b54ec[_0x0813('0x15')][_0x0813('0x17')]);return _0x5550c8(_0x5b54ec[_0x0813('0x15')][_0x0813('0x17')]);}else{logger[_0x0813('0x10')](_0x0813('0x11'),_0x251ca8,_0x0813('0x12'));_0x5550c8(_0x5b54ec['result'][_0x0813('0x17')]);}})['catch'](function(_0x112720){logger[_0x0813('0x15')]('OpenchannelAccount,\x20%s,\x20%s',_0x251ca8,_0x112720);_0x15f8d6(_0x112720);});});} \ No newline at end of file +var _0xf7b4=['result','catch','lodash','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','OpenchannelAccount,\x20%s,\x20%s','message'];(function(_0xc6be3a,_0x540e05){var _0x56a310=function(_0x50a144){while(--_0x50a144){_0xc6be3a['push'](_0xc6be3a['shift']());}};_0x56a310(++_0x540e05);}(_0xf7b4,0x152));var _0x4f7b=function(_0x37ca27,_0x14cff9){_0x37ca27=_0x37ca27-0x0;var _0xe53602=_0xf7b4[_0x37ca27];return _0xe53602;};'use strict';var _=require(_0x4f7b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x4f7b('0x1'));var rs=require(_0x4f7b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4f7b('0x3'));var logger=require(_0x4f7b('0x4'))(_0x4f7b('0x5'));var config=require(_0x4f7b('0x6'));var jayson=require(_0x4f7b('0x7'));var client=jayson[_0x4f7b('0x8')][_0x4f7b('0x9')]({'port':0x232a});config[_0x4f7b('0xa')]=_[_0x4f7b('0xb')](config[_0x4f7b('0xa')],{'host':_0x4f7b('0xc'),'port':0x18eb});var socket=require(_0x4f7b('0xd'))(new Redis(config[_0x4f7b('0xa')]));require('./openchannelAccount.socket')[_0x4f7b('0xe')](socket);function respondWithRpcPromise(_0x1016e0,_0x479208,_0xdd1aab){return new BPromise(function(_0x3a3d6c,_0x408e01){return client[_0x4f7b('0xf')](_0x1016e0,_0xdd1aab)[_0x4f7b('0x10')](function(_0x55d69f){logger[_0x4f7b('0x11')]('OpenchannelAccount,\x20%s,\x20%s',_0x479208,'request\x20sent');logger[_0x4f7b('0x12')](_0x4f7b('0x13'),_0x479208,_0x4f7b('0x14'),JSON[_0x4f7b('0x15')](_0x55d69f));if(_0x55d69f['error']){if(_0x55d69f[_0x4f7b('0x16')][_0x4f7b('0x17')]===0x1f4){logger[_0x4f7b('0x16')](_0x4f7b('0x18'),_0x479208,_0x55d69f[_0x4f7b('0x16')][_0x4f7b('0x19')]);return _0x408e01(_0x55d69f[_0x4f7b('0x16')][_0x4f7b('0x19')]);}logger[_0x4f7b('0x16')](_0x4f7b('0x18'),_0x479208,_0x55d69f[_0x4f7b('0x16')][_0x4f7b('0x19')]);return _0x3a3d6c(_0x55d69f['error'][_0x4f7b('0x19')]);}else{logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x479208,_0x4f7b('0x14'));_0x3a3d6c(_0x55d69f[_0x4f7b('0x1a')]['message']);}})[_0x4f7b('0x1b')](function(_0x24c460){logger[_0x4f7b('0x16')](_0x4f7b('0x18'),_0x479208,_0x24c460);_0x408e01(_0x24c460);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 290d65c..9499491 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 _0x3098=['remove','update','emit','removeListener','register','openchannelAccount:','./openchannelAccount.events','save'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3098,0x86));var _0x8309=function(_0x38fb0d,_0x52b5db){_0x38fb0d=_0x38fb0d-0x0;var _0x30a5d6=_0x3098[_0x38fb0d];return _0x30a5d6;};'use strict';var OpenchannelAccountEvents=require(_0x8309('0x0'));var events=[_0x8309('0x1'),_0x8309('0x2'),_0x8309('0x3')];function createListener(_0x4b9381,_0x316d5c){return function(_0x2ebbd9){_0x316d5c[_0x8309('0x4')](_0x4b9381,_0x2ebbd9);};}function removeListener(_0x2e58f5,_0x1e658e){return function(){OpenchannelAccountEvents[_0x8309('0x5')](_0x2e58f5,_0x1e658e);};}exports[_0x8309('0x6')]=function(_0x2ddf0b){for(var _0x2aa50b=0x0,_0x1e9ac6=events['length'];_0x2aa50b<_0x1e9ac6;_0x2aa50b++){var _0x35ca92=events[_0x2aa50b];var _0x5c2cd1=createListener(_0x8309('0x7')+_0x35ca92,_0x2ddf0b);OpenchannelAccountEvents['on'](_0x35ca92,_0x5c2cd1);}}; \ No newline at end of file +var _0x7dc2=['remove','update','emit','removeListener','register','length','openchannelAccount:'];(function(_0x40622e,_0x1d071b){var _0x1a0072=function(_0x15d7e3){while(--_0x15d7e3){_0x40622e['push'](_0x40622e['shift']());}};_0x1a0072(++_0x1d071b);}(_0x7dc2,0x19d));var _0x27dc=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7dc2[_0x20a584];return _0x4b41a8;};'use strict';var OpenchannelAccountEvents=require('./openchannelAccount.events');var events=['save',_0x27dc('0x0'),_0x27dc('0x1')];function createListener(_0x49a9e7,_0x426f56){return function(_0x57d4b4){_0x426f56[_0x27dc('0x2')](_0x49a9e7,_0x57d4b4);};}function removeListener(_0x29ba23,_0x52337b){return function(){OpenchannelAccountEvents[_0x27dc('0x3')](_0x29ba23,_0x52337b);};}exports[_0x27dc('0x4')]=function(_0x5a442a){for(var _0x29eaac=0x0,_0x4d2e10=events[_0x27dc('0x5')];_0x29eaac<_0x4d2e10;_0x29eaac++){var _0x3b3eee=events[_0x29eaac];var _0x5181ab=createListener(_0x27dc('0x6')+_0x3b3eee,_0x5a442a);OpenchannelAccountEvents['on'](_0x3b3eee,_0x5181ab);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index d1a9865..fbc1553 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 _0x1774=['../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','multer','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x5d8018,_0x588592){var _0x151ac4=function(_0x548679){while(--_0x548679){_0x5d8018['push'](_0x5d8018['shift']());}};_0x151ac4(++_0x588592);}(_0x1774,0x105));var _0x4177=function(_0x26392b,_0x19dd91){_0x26392b=_0x26392b-0x0;var _0x3b62db=_0x1774[_0x26392b];return _0x3b62db;};'use strict';var multer=require(_0x4177('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x4177('0x1'));var express=require('express');var router=express[_0x4177('0x2')]();var fs_extra=require(_0x4177('0x3'));var auth=require(_0x4177('0x4'));var interaction=require(_0x4177('0x5'));var config=require(_0x4177('0x6'));var controller=require(_0x4177('0x7'));router[_0x4177('0x8')]('/',auth[_0x4177('0x9')](),controller[_0x4177('0xa')]);router[_0x4177('0x8')](_0x4177('0xb'),auth[_0x4177('0x9')](),controller[_0x4177('0xc')]);router[_0x4177('0xd')]('/',auth[_0x4177('0x9')](),controller[_0x4177('0xe')]);router[_0x4177('0xf')](_0x4177('0xb'),auth[_0x4177('0x9')](),controller[_0x4177('0x10')]);router[_0x4177('0x11')](_0x4177('0xb'),auth[_0x4177('0x9')](),controller[_0x4177('0x12')]);module['exports']=router; \ No newline at end of file +var _0xf148=['/:id','show','post','update','destroy','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x4cde9e,_0x57150a){var _0x38df0c=function(_0x50cdb6){while(--_0x50cdb6){_0x4cde9e['push'](_0x4cde9e['shift']());}};_0x38df0c(++_0x57150a);}(_0xf148,0x86));var _0x8f14=function(_0x143be1,_0x5cf797){_0x143be1=_0x143be1-0x0;var _0x307071=_0xf148[_0x143be1];return _0x307071;};'use strict';var multer=require(_0x8f14('0x0'));var util=require(_0x8f14('0x1'));var path=require(_0x8f14('0x2'));var timeout=require('connect-timeout');var express=require(_0x8f14('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x8f14('0x4'));var interaction=require(_0x8f14('0x5'));var config=require(_0x8f14('0x6'));var controller=require('./openchannelApplication.controller');router[_0x8f14('0x7')]('/',auth[_0x8f14('0x8')](),controller[_0x8f14('0x9')]);router[_0x8f14('0x7')](_0x8f14('0xa'),auth[_0x8f14('0x8')](),controller[_0x8f14('0xb')]);router[_0x8f14('0xc')]('/',auth[_0x8f14('0x8')](),controller['create']);router['put'](_0x8f14('0xa'),auth[_0x8f14('0x8')](),controller[_0x8f14('0xd')]);router['delete'](_0x8f14('0xa'),auth[_0x8f14('0x8')](),controller[_0x8f14('0xe')]);module[_0x8f14('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 f3305ee..b2046ea 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 _0x4361=['exports','INTEGER','noop','STRING','*,*,*,*'];(function(_0x3bb370,_0x3c6548){var _0x3c119=function(_0x130d22){while(--_0x130d22){_0x3bb370['push'](_0x3bb370['shift']());}};_0x3c119(++_0x3c6548);}(_0x4361,0x1ea));var _0x1436=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0x4361[_0x2bf141];return _0x48277b;};'use strict';var Sequelize=require('sequelize');module[_0x1436('0x0')]={'priority':{'type':Sequelize[_0x1436('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x1436('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x1436('0x3')],'defaultValue':_0x1436('0x4')}}; \ No newline at end of file +var _0x44bd=['sequelize','INTEGER','STRING','noop','*,*,*,*'];(function(_0x1d0bf6,_0x960455){var _0x125c60=function(_0x492764){while(--_0x492764){_0x1d0bf6['push'](_0x1d0bf6['shift']());}};_0x125c60(++_0x960455);}(_0x44bd,0x172));var _0xd44b=function(_0xb09a5f,_0x3707b8){_0xb09a5f=_0xb09a5f-0x0;var _0x3de467=_0x44bd[_0xb09a5f];return _0x3de467;};'use strict';var Sequelize=require(_0xd44b('0x0'));module['exports']={'priority':{'type':Sequelize[_0xd44b('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xd44b('0x2')],'allowNull':![],'defaultValue':_0xd44b('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xd44b('0x2')]},'interval':{'type':Sequelize[_0xd44b('0x2')],'defaultValue':_0xd44b('0x4')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index 525c6e3..50ccff0 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 _0x61b8=['model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','length','include','create','body','find','params','destroy','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','name','send','OpenchannelApplication','rawAttributes','fieldName','type','key'];(function(_0x8ff4a4,_0x1748c1){var _0x26d655=function(_0x319941){while(--_0x319941){_0x8ff4a4['push'](_0x8ff4a4['shift']());}};_0x26d655(++_0x1748c1);}(_0x61b8,0xad));var _0x861b=function(_0x4cc47c,_0x18f1e3){_0x4cc47c=_0x4cc47c-0x0;var _0x19ddd0=_0x61b8[_0x4cc47c];return _0x19ddd0;};'use strict';var emlformat=require(_0x861b('0x0'));var rimraf=require(_0x861b('0x1'));var zipdir=require(_0x861b('0x2'));var jsonpatch=require(_0x861b('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x861b('0x4'));var Mustache=require('mustache');var util=require(_0x861b('0x5'));var path=require('path');var sox=require(_0x861b('0x6'));var csv=require('to-csv');var ejs=require(_0x861b('0x7'));var fs=require('fs');var fs_extra=require(_0x861b('0x8'));var _=require(_0x861b('0x9'));var squel=require(_0x861b('0xa'));var crypto=require('crypto');var jsforce=require(_0x861b('0xb'));var deskjs=require(_0x861b('0xc'));var toCsv=require(_0x861b('0xd'));var querystring=require(_0x861b('0xe'));var Papa=require(_0x861b('0xf'));var Redis=require(_0x861b('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x861b('0x11'));var hardwareService=require(_0x861b('0x12'));var logger=require('../../config/logger')(_0x861b('0x13'));var utils=require(_0x861b('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x861b('0x15'));var db=require(_0x861b('0x16'))['db'];function respondWithStatusCode(_0x1d8e57,_0x39e660){_0x39e660=_0x39e660||0xcc;return function(_0x2eb2f8){if(_0x2eb2f8){return _0x1d8e57['sendStatus'](_0x39e660);}return _0x1d8e57[_0x861b('0x17')](_0x39e660)[_0x861b('0x18')]();};}function respondWithResult(_0x290769,_0x3f9c0a){_0x3f9c0a=_0x3f9c0a||0xc8;return function(_0x88e38b){if(_0x88e38b){return _0x290769['status'](_0x3f9c0a)[_0x861b('0x19')](_0x88e38b);}};}function respondWithFilteredResult(_0x308cde,_0x1d39a5){return function(_0x50bca0){if(_0x50bca0){var _0x28cca9=typeof _0x1d39a5[_0x861b('0x1a')]===_0x861b('0x1b')&&typeof _0x1d39a5[_0x861b('0x1c')]===_0x861b('0x1b');var _0x32b606=_0x50bca0[_0x861b('0x1d')];var _0x1d466c=_0x28cca9?0x0:_0x1d39a5['offset'];var _0x2d2bb0=_0x28cca9?_0x50bca0[_0x861b('0x1d')]:_0x1d39a5[_0x861b('0x1a')]+_0x1d39a5['limit'];var _0x148a4d;if(_0x2d2bb0>=_0x32b606){_0x2d2bb0=_0x32b606;_0x148a4d=0xc8;}else{_0x148a4d=0xce;}_0x308cde['status'](_0x148a4d);return _0x308cde[_0x861b('0x1e')](_0x861b('0x1f'),_0x1d466c+'-'+_0x2d2bb0+'/'+_0x32b606)[_0x861b('0x19')](_0x50bca0);}return null;};}function patchUpdates(_0x3cff35){return function(_0x4854be){try{jsonpatch[_0x861b('0x20')](_0x4854be,_0x3cff35,!![]);}catch(_0x2db3c9){return BPromise['reject'](_0x2db3c9);}return _0x4854be[_0x861b('0x21')]();};}function saveUpdates(_0x5d1cdb,_0x3c7435){return function(_0x594e77){if(_0x594e77){return _0x594e77[_0x861b('0x22')](_0x5d1cdb)[_0x861b('0x23')](function(_0x234c39){return _0x234c39;});}return null;};}function removeEntity(_0x1bad5d,_0x51bfc3){return function(_0x4d7b38){if(_0x4d7b38){return _0x4d7b38['destroy']()[_0x861b('0x23')](function(){_0x1bad5d['status'](0xcc)[_0x861b('0x18')]();});}};}function handleEntityNotFound(_0x92508,_0x448829){return function(_0x3a96ca){if(!_0x3a96ca){_0x92508['sendStatus'](0x194);}return _0x3a96ca;};}function handleError(_0x456128,_0x546ede){_0x546ede=_0x546ede||0x1f4;return function(_0x2013cb){logger['error'](_0x2013cb['stack']);if(_0x2013cb[_0x861b('0x24')]){delete _0x2013cb[_0x861b('0x24')];}_0x456128[_0x861b('0x17')](_0x546ede)[_0x861b('0x25')](_0x2013cb);};}exports['index']=function(_0x4cbc71,_0x3db532){var _0x11f8c4={},_0x1df5e1={},_0x549e12={'count':0x0,'rows':[]};var _0x2082d5=_['map'](db[_0x861b('0x26')][_0x861b('0x27')],function(_0x1dfa25){return{'name':_0x1dfa25[_0x861b('0x28')],'type':_0x1dfa25[_0x861b('0x29')][_0x861b('0x2a')]};});_0x1df5e1[_0x861b('0x2b')]=_[_0x861b('0x2c')](_0x2082d5,_0x861b('0x24'));_0x1df5e1[_0x861b('0x2d')]=_[_0x861b('0x2e')](_0x4cbc71['query']);_0x1df5e1[_0x861b('0x2f')]=_[_0x861b('0x30')](_0x1df5e1['model'],_0x1df5e1[_0x861b('0x2d')]);_0x11f8c4[_0x861b('0x31')]=_[_0x861b('0x30')](_0x1df5e1[_0x861b('0x2b')],qs[_0x861b('0x32')](_0x4cbc71[_0x861b('0x2d')][_0x861b('0x32')]));_0x11f8c4[_0x861b('0x31')]=_0x11f8c4[_0x861b('0x31')]['length']?_0x11f8c4[_0x861b('0x31')]:_0x1df5e1[_0x861b('0x2b')];if(!_0x4cbc71['query'][_0x861b('0x33')]('nolimit')){_0x11f8c4[_0x861b('0x1c')]=qs[_0x861b('0x1c')](_0x4cbc71[_0x861b('0x2d')][_0x861b('0x1c')]);_0x11f8c4[_0x861b('0x1a')]=qs[_0x861b('0x1a')](_0x4cbc71[_0x861b('0x2d')]['offset']);}_0x11f8c4[_0x861b('0x34')]=qs[_0x861b('0x35')](_0x4cbc71[_0x861b('0x2d')][_0x861b('0x35')]);_0x11f8c4[_0x861b('0x36')]=qs[_0x861b('0x2f')](_[_0x861b('0x37')](_0x4cbc71[_0x861b('0x2d')],_0x1df5e1[_0x861b('0x2f')]),_0x2082d5);if(_0x4cbc71['query'][_0x861b('0x38')]){_0x11f8c4[_0x861b('0x36')]=_[_0x861b('0x39')](_0x11f8c4[_0x861b('0x36')],{'$or':_[_0x861b('0x2c')](_0x2082d5,function(_0x836b9e){if(_0x836b9e[_0x861b('0x29')]!==_0x861b('0x3a')){var _0x41a665={};_0x41a665[_0x836b9e[_0x861b('0x24')]]={'$like':'%'+_0x4cbc71[_0x861b('0x2d')][_0x861b('0x38')]+'%'};return _0x41a665;}})});}_0x11f8c4=_['merge']({},_0x11f8c4,_0x4cbc71[_0x861b('0x3b')]);var _0x668850={'where':_0x11f8c4[_0x861b('0x36')]};return db[_0x861b('0x26')][_0x861b('0x1d')](_0x668850)[_0x861b('0x23')](function(_0x16dea7){_0x549e12['count']=_0x16dea7;if(_0x4cbc71[_0x861b('0x2d')][_0x861b('0x3c')]){_0x11f8c4['include']=[{'all':!![]}];}return db[_0x861b('0x26')][_0x861b('0x3d')](_0x11f8c4);})[_0x861b('0x23')](function(_0x15ff0a){_0x549e12[_0x861b('0x3e')]=_0x15ff0a;return _0x549e12;})[_0x861b('0x23')](respondWithFilteredResult(_0x3db532,_0x11f8c4))[_0x861b('0x3f')](handleError(_0x3db532,null));};exports[_0x861b('0x40')]=function(_0xf24dcb,_0x5c630e){var _0x4566e2={'raw':!![],'where':{'id':_0xf24dcb['params']['id']}},_0x500064={};_0x500064[_0x861b('0x2b')]=_['keys'](db[_0x861b('0x26')]['rawAttributes']);_0x500064[_0x861b('0x2d')]=_[_0x861b('0x2e')](_0xf24dcb[_0x861b('0x2d')]);_0x500064['filters']=_[_0x861b('0x30')](_0x500064[_0x861b('0x2b')],_0x500064[_0x861b('0x2d')]);_0x4566e2[_0x861b('0x31')]=_['intersection'](_0x500064[_0x861b('0x2b')],qs[_0x861b('0x32')](_0xf24dcb[_0x861b('0x2d')][_0x861b('0x32')]));_0x4566e2['attributes']=_0x4566e2[_0x861b('0x31')][_0x861b('0x41')]?_0x4566e2[_0x861b('0x31')]:_0x500064['model'];if(_0xf24dcb[_0x861b('0x2d')]['includeAll']){_0x4566e2[_0x861b('0x42')]=[{'all':!![]}];}_0x4566e2=_[_0x861b('0x39')]({},_0x4566e2,_0xf24dcb[_0x861b('0x3b')]);return db['OpenchannelApplication']['find'](_0x4566e2)[_0x861b('0x23')](handleEntityNotFound(_0x5c630e,null))[_0x861b('0x23')](respondWithResult(_0x5c630e,null))[_0x861b('0x3f')](handleError(_0x5c630e,null));};exports[_0x861b('0x43')]=function(_0x4ed9ca,_0x26d6db){return db[_0x861b('0x26')][_0x861b('0x43')](_0x4ed9ca[_0x861b('0x44')],{})[_0x861b('0x23')](respondWithResult(_0x26d6db,0xc9))[_0x861b('0x3f')](handleError(_0x26d6db,null));};exports[_0x861b('0x22')]=function(_0x48c5bc,_0x373931){if(_0x48c5bc[_0x861b('0x44')]['id']){delete _0x48c5bc['body']['id'];}return db[_0x861b('0x26')][_0x861b('0x45')]({'where':{'id':_0x48c5bc[_0x861b('0x46')]['id']}})[_0x861b('0x23')](handleEntityNotFound(_0x373931,null))[_0x861b('0x23')](saveUpdates(_0x48c5bc[_0x861b('0x44')],null))[_0x861b('0x23')](respondWithResult(_0x373931,null))['catch'](handleError(_0x373931,null));};exports[_0x861b('0x47')]=function(_0x1fe06f,_0x356ebd){return db[_0x861b('0x26')][_0x861b('0x45')]({'where':{'id':_0x1fe06f['params']['id']}})[_0x861b('0x23')](handleEntityNotFound(_0x356ebd,null))[_0x861b('0x23')](removeEntity(_0x356ebd,null))[_0x861b('0x3f')](handleError(_0x356ebd,null));}; \ No newline at end of file +var _0xa52b=['../../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','count','limit','set','Content-Range','apply','reject','save','then','end','error','name','send','map','OpenchannelApplication','fieldName','type','key','query','keys','model','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','includeAll','include','rows','catch','show','params','rawAttributes','length','options','find','body','update','destroy','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis'];(function(_0x283692,_0x32baab){var _0x28c7c6=function(_0x135c63){while(--_0x135c63){_0x283692['push'](_0x283692['shift']());}};_0x28c7c6(++_0x32baab);}(_0xa52b,0x8a));var _0xba52=function(_0x3b15f7,_0x2b5591){_0x3b15f7=_0x3b15f7-0x0;var _0x5abb2c=_0xa52b[_0x3b15f7];return _0x5abb2c;};'use strict';var emlformat=require(_0xba52('0x0'));var rimraf=require(_0xba52('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xba52('0x2'));var rp=require(_0xba52('0x3'));var moment=require(_0xba52('0x4'));var BPromise=require(_0xba52('0x5'));var Mustache=require('mustache');var util=require(_0xba52('0x6'));var path=require(_0xba52('0x7'));var sox=require(_0xba52('0x8'));var csv=require(_0xba52('0x9'));var ejs=require(_0xba52('0xa'));var fs=require('fs');var fs_extra=require(_0xba52('0xb'));var _=require(_0xba52('0xc'));var squel=require('squel');var crypto=require(_0xba52('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xba52('0xe'));var toCsv=require(_0xba52('0x9'));var querystring=require(_0xba52('0xf'));var Papa=require(_0xba52('0x10'));var Redis=require(_0xba52('0x11'));var authService=require(_0xba52('0x12'));var qs=require(_0xba52('0x13'));var as=require(_0xba52('0x14'));var hardwareService=require(_0xba52('0x15'));var logger=require(_0xba52('0x16'))(_0xba52('0x17'));var utils=require(_0xba52('0x18'));var config=require(_0xba52('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xba52('0x1a'))['db'];function respondWithStatusCode(_0x415c92,_0xd5d3de){_0xd5d3de=_0xd5d3de||0xcc;return function(_0x2b86c7){if(_0x2b86c7){return _0x415c92[_0xba52('0x1b')](_0xd5d3de);}return _0x415c92[_0xba52('0x1c')](_0xd5d3de)['end']();};}function respondWithResult(_0x1b6db4,_0x320666){_0x320666=_0x320666||0xc8;return function(_0x18c9f3){if(_0x18c9f3){return _0x1b6db4['status'](_0x320666)[_0xba52('0x1d')](_0x18c9f3);}};}function respondWithFilteredResult(_0x325d87,_0x23e6e3){return function(_0x4289b4){if(_0x4289b4){var _0x51ba3f=typeof _0x23e6e3[_0xba52('0x1e')]===_0xba52('0x1f')&&typeof _0x23e6e3['limit']===_0xba52('0x1f');var _0x365894=_0x4289b4[_0xba52('0x20')];var _0x3cf90f=_0x51ba3f?0x0:_0x23e6e3[_0xba52('0x1e')];var _0x5c8432=_0x51ba3f?_0x4289b4['count']:_0x23e6e3[_0xba52('0x1e')]+_0x23e6e3[_0xba52('0x21')];var _0x5cab74;if(_0x5c8432>=_0x365894){_0x5c8432=_0x365894;_0x5cab74=0xc8;}else{_0x5cab74=0xce;}_0x325d87['status'](_0x5cab74);return _0x325d87[_0xba52('0x22')](_0xba52('0x23'),_0x3cf90f+'-'+_0x5c8432+'/'+_0x365894)[_0xba52('0x1d')](_0x4289b4);}return null;};}function patchUpdates(_0x9a9fd){return function(_0x57f18b){try{jsonpatch[_0xba52('0x24')](_0x57f18b,_0x9a9fd,!![]);}catch(_0xd3d8c9){return BPromise[_0xba52('0x25')](_0xd3d8c9);}return _0x57f18b[_0xba52('0x26')]();};}function saveUpdates(_0x3c1863,_0x17061c){return function(_0x14da6b){if(_0x14da6b){return _0x14da6b['update'](_0x3c1863)[_0xba52('0x27')](function(_0x3cab8d){return _0x3cab8d;});}return null;};}function removeEntity(_0x3a2c26,_0x409252){return function(_0x4d4fb5){if(_0x4d4fb5){return _0x4d4fb5['destroy']()[_0xba52('0x27')](function(){_0x3a2c26[_0xba52('0x1c')](0xcc)[_0xba52('0x28')]();});}};}function handleEntityNotFound(_0x5eb62c,_0x33a96e){return function(_0x3d2e5d){if(!_0x3d2e5d){_0x5eb62c[_0xba52('0x1b')](0x194);}return _0x3d2e5d;};}function handleError(_0x11e4fd,_0x250542){_0x250542=_0x250542||0x1f4;return function(_0x247ff8){logger[_0xba52('0x29')](_0x247ff8['stack']);if(_0x247ff8[_0xba52('0x2a')]){delete _0x247ff8[_0xba52('0x2a')];}_0x11e4fd['status'](_0x250542)[_0xba52('0x2b')](_0x247ff8);};}exports['index']=function(_0xcb16b4,_0x1dc2ed){var _0xbc949={},_0x51d65b={},_0x4d0b34={'count':0x0,'rows':[]};var _0x475d8f=_[_0xba52('0x2c')](db[_0xba52('0x2d')]['rawAttributes'],function(_0x367618){return{'name':_0x367618[_0xba52('0x2e')],'type':_0x367618[_0xba52('0x2f')][_0xba52('0x30')]};});_0x51d65b['model']=_[_0xba52('0x2c')](_0x475d8f,_0xba52('0x2a'));_0x51d65b[_0xba52('0x31')]=_[_0xba52('0x32')](_0xcb16b4['query']);_0x51d65b['filters']=_['intersection'](_0x51d65b[_0xba52('0x33')],_0x51d65b['query']);_0xbc949['attributes']=_[_0xba52('0x34')](_0x51d65b[_0xba52('0x33')],qs[_0xba52('0x35')](_0xcb16b4[_0xba52('0x31')][_0xba52('0x35')]));_0xbc949[_0xba52('0x36')]=_0xbc949[_0xba52('0x36')]['length']?_0xbc949[_0xba52('0x36')]:_0x51d65b['model'];if(!_0xcb16b4[_0xba52('0x31')][_0xba52('0x37')](_0xba52('0x38'))){_0xbc949[_0xba52('0x21')]=qs[_0xba52('0x21')](_0xcb16b4[_0xba52('0x31')][_0xba52('0x21')]);_0xbc949[_0xba52('0x1e')]=qs['offset'](_0xcb16b4['query'][_0xba52('0x1e')]);}_0xbc949[_0xba52('0x39')]=qs[_0xba52('0x3a')](_0xcb16b4[_0xba52('0x31')][_0xba52('0x3a')]);_0xbc949[_0xba52('0x3b')]=qs[_0xba52('0x3c')](_[_0xba52('0x3d')](_0xcb16b4['query'],_0x51d65b['filters']),_0x475d8f);if(_0xcb16b4[_0xba52('0x31')]['filter']){_0xbc949['where']=_[_0xba52('0x3e')](_0xbc949['where'],{'$or':_[_0xba52('0x2c')](_0x475d8f,function(_0x13927f){if(_0x13927f[_0xba52('0x2f')]!==_0xba52('0x3f')){var _0x2dae61={};_0x2dae61[_0x13927f[_0xba52('0x2a')]]={'$like':'%'+_0xcb16b4[_0xba52('0x31')][_0xba52('0x40')]+'%'};return _0x2dae61;}})});}_0xbc949=_[_0xba52('0x3e')]({},_0xbc949,_0xcb16b4['options']);var _0x2c31b0={'where':_0xbc949[_0xba52('0x3b')]};return db[_0xba52('0x2d')]['count'](_0x2c31b0)['then'](function(_0x315bff){_0x4d0b34[_0xba52('0x20')]=_0x315bff;if(_0xcb16b4[_0xba52('0x31')][_0xba52('0x41')]){_0xbc949[_0xba52('0x42')]=[{'all':!![]}];}return db['OpenchannelApplication']['findAll'](_0xbc949);})[_0xba52('0x27')](function(_0x104293){_0x4d0b34[_0xba52('0x43')]=_0x104293;return _0x4d0b34;})['then'](respondWithFilteredResult(_0x1dc2ed,_0xbc949))[_0xba52('0x44')](handleError(_0x1dc2ed,null));};exports[_0xba52('0x45')]=function(_0x27a78a,_0x3caf50){var _0x244102={'raw':!![],'where':{'id':_0x27a78a[_0xba52('0x46')]['id']}},_0x3f5366={};_0x3f5366['model']=_[_0xba52('0x32')](db[_0xba52('0x2d')][_0xba52('0x47')]);_0x3f5366[_0xba52('0x31')]=_[_0xba52('0x32')](_0x27a78a[_0xba52('0x31')]);_0x3f5366['filters']=_[_0xba52('0x34')](_0x3f5366[_0xba52('0x33')],_0x3f5366['query']);_0x244102[_0xba52('0x36')]=_['intersection'](_0x3f5366['model'],qs[_0xba52('0x35')](_0x27a78a['query'][_0xba52('0x35')]));_0x244102[_0xba52('0x36')]=_0x244102['attributes'][_0xba52('0x48')]?_0x244102['attributes']:_0x3f5366[_0xba52('0x33')];if(_0x27a78a['query'][_0xba52('0x41')]){_0x244102[_0xba52('0x42')]=[{'all':!![]}];}_0x244102=_[_0xba52('0x3e')]({},_0x244102,_0x27a78a[_0xba52('0x49')]);return db['OpenchannelApplication'][_0xba52('0x4a')](_0x244102)[_0xba52('0x27')](handleEntityNotFound(_0x3caf50,null))[_0xba52('0x27')](respondWithResult(_0x3caf50,null))[_0xba52('0x44')](handleError(_0x3caf50,null));};exports['create']=function(_0x681aa8,_0x1fddc8){return db[_0xba52('0x2d')]['create'](_0x681aa8[_0xba52('0x4b')],{})[_0xba52('0x27')](respondWithResult(_0x1fddc8,0xc9))[_0xba52('0x44')](handleError(_0x1fddc8,null));};exports[_0xba52('0x4c')]=function(_0x2419e5,_0x53f5ad){if(_0x2419e5[_0xba52('0x4b')]['id']){delete _0x2419e5[_0xba52('0x4b')]['id'];}return db[_0xba52('0x2d')][_0xba52('0x4a')]({'where':{'id':_0x2419e5['params']['id']}})['then'](handleEntityNotFound(_0x53f5ad,null))[_0xba52('0x27')](saveUpdates(_0x2419e5[_0xba52('0x4b')],null))['then'](respondWithResult(_0x53f5ad,null))[_0xba52('0x44')](handleError(_0x53f5ad,null));};exports[_0xba52('0x4d')]=function(_0x3438bb,_0x1fd8d4){return db['OpenchannelApplication'][_0xba52('0x4a')]({'where':{'id':_0x3438bb[_0xba52('0x46')]['id']}})[_0xba52('0x27')](handleEntityNotFound(_0x1fd8d4,null))[_0xba52('0x27')](removeEntity(_0x1fd8d4,null))[_0xba52('0x44')](handleError(_0x1fd8d4,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index 1f4260d..a18acac 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 _0x76ff=['OpenchannelApplication','openchannel_applications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','exports'];(function(_0x352764,_0x2e0b01){var _0x3c45a8=function(_0x1ce919){while(--_0x1ce919){_0x352764['push'](_0x352764['shift']());}};_0x3c45a8(++_0x2e0b01);}(_0x76ff,0xdc));var _0xf76f=function(_0xe27bd2,_0x605528){_0xe27bd2=_0xe27bd2-0x0;var _0x5b1a64=_0x76ff[_0xe27bd2];return _0x5b1a64;};'use strict';var _=require(_0xf76f('0x0'));var util=require('util');var logger=require(_0xf76f('0x1'))(_0xf76f('0x2'));var moment=require(_0xf76f('0x3'));var BPromise=require(_0xf76f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xf76f('0x5'));var config=require(_0xf76f('0x6'));var attributes=require('./openchannelApplication.attributes');module[_0xf76f('0x7')]=function(_0xa721e9,_0xc25f00){return _0xa721e9['define'](_0xf76f('0x8'),attributes,{'tableName':_0xf76f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf76f('0xa'),'collate':_0xf76f('0xb')});}; \ No newline at end of file +var _0x96b2=['utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','request-promise','./openchannelApplication.attributes','utf8mb4'];(function(_0x543084,_0x4337f5){var _0x306a57=function(_0x2769ed){while(--_0x2769ed){_0x543084['push'](_0x543084['shift']());}};_0x306a57(++_0x4337f5);}(_0x96b2,0x171));var _0x296b=function(_0x3cf5a8,_0x57b46b){_0x3cf5a8=_0x3cf5a8-0x0;var _0x50c206=_0x96b2[_0x3cf5a8];return _0x50c206;};'use strict';var _=require(_0x296b('0x0'));var util=require('util');var logger=require(_0x296b('0x1'))(_0x296b('0x2'));var moment=require(_0x296b('0x3'));var BPromise=require('bluebird');var rp=require(_0x296b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x296b('0x5'));module['exports']=function(_0x4fba01,_0x3db0fd){return _0x4fba01['define']('OpenchannelApplication',attributes,{'tableName':'openchannel_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x296b('0x6'),'collate':_0x296b('0x7')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index df12b60..f19f565 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 _0x50da=['request','then','info','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','OpenchannelApplication,\x20%s,\x20%s','result','catch','UpdateOpenchannelApplication','OpenchannelApplication','update','body','options','where','attributes','limit','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','jayson/promise','client','http'];(function(_0x3a3b9e,_0xc59037){var _0x148103=function(_0x406731){while(--_0x406731){_0x3a3b9e['push'](_0x3a3b9e['shift']());}};_0x148103(++_0xc59037);}(_0x50da,0x105));var _0xa50d=function(_0xd90dd,_0x2d5c82){_0xd90dd=_0xd90dd-0x0;var _0x271492=_0x50da[_0xd90dd];return _0x271492;};'use strict';var _=require('lodash');var util=require(_0xa50d('0x0'));var moment=require(_0xa50d('0x1'));var BPromise=require(_0xa50d('0x2'));var rs=require(_0xa50d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa50d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa50d('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xa50d('0x6'));var client=jayson[_0xa50d('0x7')][_0xa50d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x160974,_0x4b474d,_0x158649){return new BPromise(function(_0x433b56,_0x5337aa){return client[_0xa50d('0x9')](_0x160974,_0x158649)[_0xa50d('0xa')](function(_0xfa8619){logger[_0xa50d('0xb')]('OpenchannelApplication,\x20%s,\x20%s',_0x4b474d,_0xa50d('0xc'));logger[_0xa50d('0xd')](_0xa50d('0xe'),_0x4b474d,'request\x20sent',JSON[_0xa50d('0xf')](_0xfa8619));if(_0xfa8619[_0xa50d('0x10')]){if(_0xfa8619[_0xa50d('0x10')][_0xa50d('0x11')]===0x1f4){logger[_0xa50d('0x10')]('OpenchannelApplication,\x20%s,\x20%s',_0x4b474d,_0xfa8619[_0xa50d('0x10')][_0xa50d('0x12')]);return _0x5337aa(_0xfa8619[_0xa50d('0x10')][_0xa50d('0x12')]);}logger[_0xa50d('0x10')]('OpenchannelApplication,\x20%s,\x20%s',_0x4b474d,_0xfa8619['error']['message']);return _0x433b56(_0xfa8619[_0xa50d('0x10')][_0xa50d('0x12')]);}else{logger[_0xa50d('0xb')](_0xa50d('0x13'),_0x4b474d,_0xa50d('0xc'));_0x433b56(_0xfa8619[_0xa50d('0x14')][_0xa50d('0x12')]);}})[_0xa50d('0x15')](function(_0x4b6468){logger[_0xa50d('0x10')](_0xa50d('0x13'),_0x4b474d,_0x4b6468);_0x5337aa(_0x4b6468);});});}exports[_0xa50d('0x16')]=function(_0x35d1c0){var _0xd545a=this;return new Promise(function(_0x55d737,_0x3bffac){return db[_0xa50d('0x17')][_0xa50d('0x18')](_0x35d1c0[_0xa50d('0x19')],{'raw':_0x35d1c0[_0xa50d('0x1a')]?_0x35d1c0[_0xa50d('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x35d1c0[_0xa50d('0x1a')]?_0x35d1c0[_0xa50d('0x1a')][_0xa50d('0x1b')]||null:null,'attributes':_0x35d1c0[_0xa50d('0x1a')]?_0x35d1c0[_0xa50d('0x1a')][_0xa50d('0x1c')]||null:null,'limit':_0x35d1c0['options']?_0x35d1c0[_0xa50d('0x1a')][_0xa50d('0x1d')]||null:null})[_0xa50d('0xa')](function(_0x50a356){logger[_0xa50d('0xb')](_0xa50d('0x16'),_0x35d1c0);logger[_0xa50d('0xd')]('UpdateOpenchannelApplication',_0x35d1c0,JSON[_0xa50d('0xf')](_0x50a356));_0x55d737(_0x50a356);})[_0xa50d('0x15')](function(_0xad4733){logger['error'](_0xa50d('0x16'),_0xad4733[_0xa50d('0x12')],_0x35d1c0);_0x3bffac(_0xd545a['error'](0x1f4,_0xad4733[_0xa50d('0x12')]));});});}; \ No newline at end of file +var _0x1862=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','info','OpenchannelApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','OpenchannelApplication,\x20%s,\x20%s','catch','UpdateOpenchannelApplication','OpenchannelApplication','update','body','options','raw','where','attributes','then','debug','util'];(function(_0x62317d,_0x3ec508){var _0x590a7a=function(_0x10f95a){while(--_0x10f95a){_0x62317d['push'](_0x62317d['shift']());}};_0x590a7a(++_0x3ec508);}(_0x1862,0xbc));var _0x2186=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1862[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x2186('0x0'));var moment=require('moment');var BPromise=require(_0x2186('0x1'));var rs=require(_0x2186('0x2'));var fs=require('fs');var Redis=require(_0x2186('0x3'));var db=require(_0x2186('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2186('0x5'))(_0x2186('0x6'));var config=require('../../config/environment');var jayson=require(_0x2186('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5bc0fc,_0x28500a,_0x206251){return new BPromise(function(_0x4e2f8a,_0xae2aa7){return client['request'](_0x5bc0fc,_0x206251)['then'](function(_0x24625b){logger[_0x2186('0x8')]('OpenchannelApplication,\x20%s,\x20%s',_0x28500a,'request\x20sent');logger['debug'](_0x2186('0x9'),_0x28500a,_0x2186('0xa'),JSON[_0x2186('0xb')](_0x24625b));if(_0x24625b['error']){if(_0x24625b['error'][_0x2186('0xc')]===0x1f4){logger['error']('OpenchannelApplication,\x20%s,\x20%s',_0x28500a,_0x24625b[_0x2186('0xd')][_0x2186('0xe')]);return _0xae2aa7(_0x24625b[_0x2186('0xd')][_0x2186('0xe')]);}logger[_0x2186('0xd')](_0x2186('0xf'),_0x28500a,_0x24625b['error'][_0x2186('0xe')]);return _0x4e2f8a(_0x24625b[_0x2186('0xd')][_0x2186('0xe')]);}else{logger[_0x2186('0x8')](_0x2186('0xf'),_0x28500a,'request\x20sent');_0x4e2f8a(_0x24625b['result'][_0x2186('0xe')]);}})[_0x2186('0x10')](function(_0x3c3e7e){logger[_0x2186('0xd')](_0x2186('0xf'),_0x28500a,_0x3c3e7e);_0xae2aa7(_0x3c3e7e);});});}exports[_0x2186('0x11')]=function(_0x234770){var _0x3eda76=this;return new Promise(function(_0x11668a,_0x589d19){return db[_0x2186('0x12')][_0x2186('0x13')](_0x234770[_0x2186('0x14')],{'raw':_0x234770[_0x2186('0x15')]?_0x234770['options'][_0x2186('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x234770[_0x2186('0x15')]?_0x234770[_0x2186('0x15')][_0x2186('0x17')]||null:null,'attributes':_0x234770['options']?_0x234770[_0x2186('0x15')][_0x2186('0x18')]||null:null,'limit':_0x234770[_0x2186('0x15')]?_0x234770[_0x2186('0x15')]['limit']||null:null})[_0x2186('0x19')](function(_0x501b64){logger[_0x2186('0x8')](_0x2186('0x11'),_0x234770);logger[_0x2186('0x1a')](_0x2186('0x11'),_0x234770,JSON[_0x2186('0xb')](_0x501b64));_0x11668a(_0x501b64);})['catch'](function(_0x56061a){logger[_0x2186('0xd')](_0x2186('0x11'),_0x56061a['message'],_0x234770);_0x589d19(_0x3eda76[_0x2186('0xd')](0x1f4,_0x56061a[_0x2186('0xe')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index 0c75db8..b080e92 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 _0xbc50=['removeTags','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','/describe','isAuthenticated','describe','get','/:id','/:id/messages','getMessages','/:id/download','post','addMessage','/:id/tags','openchannelinteraction:addtags','put','tracked','openchannel','delete','openchannelinteraction:destroy','destroy'];(function(_0x33444b,_0x7ae2ea){var _0x53ecbb=function(_0x45c637){while(--_0x45c637){_0x33444b['push'](_0x33444b['shift']());}};_0x53ecbb(++_0x7ae2ea);}(_0xbc50,0x93));var _0x0bc5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbc50[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x0bc5('0x0'));var util=require('util');var path=require(_0x0bc5('0x1'));var timeout=require('connect-timeout');var express=require(_0x0bc5('0x2'));var router=express[_0x0bc5('0x3')]();var fs_extra=require(_0x0bc5('0x4'));var auth=require(_0x0bc5('0x5'));var interaction=require(_0x0bc5('0x6'));var config=require(_0x0bc5('0x7'));var controller=require('./openchannelInteraction.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x0bc5('0x8')]);router['get'](_0x0bc5('0x9'),auth[_0x0bc5('0xa')](),controller[_0x0bc5('0xb')]);router[_0x0bc5('0xc')](_0x0bc5('0xd'),auth[_0x0bc5('0xa')](),controller['show']);router[_0x0bc5('0xc')](_0x0bc5('0xe'),auth['isAuthenticated'](),controller[_0x0bc5('0xf')]);router[_0x0bc5('0xc')](_0x0bc5('0x10'),auth[_0x0bc5('0xa')](),controller['download']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x0bc5('0x11')]('/:id/messages',auth[_0x0bc5('0xa')](),controller[_0x0bc5('0x12')]);router[_0x0bc5('0x11')](_0x0bc5('0x13'),auth[_0x0bc5('0xa')](),interaction['tracked']('openchannel',_0x0bc5('0x14')),controller['addTags']);router[_0x0bc5('0x15')](_0x0bc5('0xd'),auth['isAuthenticated'](),interaction[_0x0bc5('0x16')](_0x0bc5('0x17'),'openchannelinteraction:update'),controller['update']);router[_0x0bc5('0x18')](_0x0bc5('0xd'),auth[_0x0bc5('0xa')](),interaction[_0x0bc5('0x16')](_0x0bc5('0x17'),_0x0bc5('0x19')),controller[_0x0bc5('0x1a')]);router['delete'](_0x0bc5('0x13'),auth[_0x0bc5('0xa')](),controller[_0x0bc5('0x1b')]);module[_0x0bc5('0x1c')]=router; \ No newline at end of file +var _0x29a5=['../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','/:id/messages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags','put','openchannelinteraction:update','update','openchannelinteraction:destroy','delete','removeTags','exports','multer','util','path','express','Router','../../components/auth/service'];(function(_0x228e57,_0x333af4){var _0x475abe=function(_0x59f35f){while(--_0x59f35f){_0x228e57['push'](_0x228e57['shift']());}};_0x475abe(++_0x333af4);}(_0x29a5,0x11a));var _0x529a=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0x29a5[_0x5f09c5];return _0x426ad9;};'use strict';var multer=require(_0x529a('0x0'));var util=require(_0x529a('0x1'));var path=require(_0x529a('0x2'));var timeout=require('connect-timeout');var express=require(_0x529a('0x3'));var router=express[_0x529a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x529a('0x5'));var interaction=require(_0x529a('0x6'));var config=require(_0x529a('0x7'));var controller=require('./openchannelInteraction.controller');router['get']('/',auth[_0x529a('0x8')](),controller[_0x529a('0x9')]);router[_0x529a('0xa')]('/describe',auth[_0x529a('0x8')](),controller[_0x529a('0xb')]);router['get'](_0x529a('0xc'),auth[_0x529a('0x8')](),controller[_0x529a('0xd')]);router[_0x529a('0xa')](_0x529a('0xe'),auth['isAuthenticated'](),controller['getMessages']);router[_0x529a('0xa')](_0x529a('0xf'),auth[_0x529a('0x8')](),controller[_0x529a('0x10')]);router[_0x529a('0x11')]('/',auth[_0x529a('0x8')](),controller[_0x529a('0x12')]);router['post'](_0x529a('0xe'),auth[_0x529a('0x8')](),controller[_0x529a('0x13')]);router[_0x529a('0x11')](_0x529a('0x14'),auth[_0x529a('0x8')](),interaction[_0x529a('0x15')](_0x529a('0x16'),_0x529a('0x17')),controller[_0x529a('0x18')]);router[_0x529a('0x19')]('/:id',auth['isAuthenticated'](),interaction[_0x529a('0x15')](_0x529a('0x16'),_0x529a('0x1a')),controller[_0x529a('0x1b')]);router['delete'](_0x529a('0xc'),auth[_0x529a('0x8')](),interaction['tracked'](_0x529a('0x16'),_0x529a('0x1c')),controller['destroy']);router[_0x529a('0x1d')](_0x529a('0x14'),auth['isAuthenticated'](),controller[_0x529a('0x1e')]);module[_0x529a('0x1f')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index b1d55a5..c502ce1 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 _0x863f=['ENUM','out','exports','BOOLEAN','DATE','STRING'];(function(_0x4b309e,_0x311f2c){var _0x4ea7dc=function(_0x5bbb04){while(--_0x5bbb04){_0x4b309e['push'](_0x4b309e['shift']());}};_0x4ea7dc(++_0x311f2c);}(_0x863f,0xda));var _0xf863=function(_0x2e1bf6,_0x41b290){_0x2e1bf6=_0x2e1bf6-0x0;var _0x18cd3a=_0x863f[_0x2e1bf6];return _0x18cd3a;};'use strict';var Sequelize=require('sequelize');module[_0xf863('0x0')]={'closed':{'type':Sequelize[_0xf863('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xf863('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xf863('0x3')]},'thirdDisposition':{'type':Sequelize[_0xf863('0x3')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xf863('0x2')]},'threadId':{'type':Sequelize[_0xf863('0x3')]},'externalUrl':{'type':Sequelize[_0xf863('0x3')]},'lastMsgAt':{'type':Sequelize[_0xf863('0x2')]},'lastMsgDirection':{'type':Sequelize[_0xf863('0x4')]('in',_0xf863('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xf863('0x3')]},'autoreplyExecuted':{'type':Sequelize[_0xf863('0x1')],'defaultValue':![]}}; \ No newline at end of file +var _0x23bb=['ENUM','sequelize','exports','BOOLEAN','DATE','STRING'];(function(_0x29f80e,_0x9027ff){var _0x5c7eaa=function(_0x48ec7c){while(--_0x48ec7c){_0x29f80e['push'](_0x29f80e['shift']());}};_0x5c7eaa(++_0x9027ff);}(_0x23bb,0xc1));var _0xb23b=function(_0x28fde4,_0x4fbc40){_0x28fde4=_0x28fde4-0x0;var _0xdc3f1b=_0x23bb[_0x28fde4];return _0xdc3f1b;};'use strict';var Sequelize=require(_0xb23b('0x0'));module[_0xb23b('0x1')]={'closed':{'type':Sequelize[_0xb23b('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xb23b('0x3')]},'disposition':{'type':Sequelize[_0xb23b('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xb23b('0x4')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xb23b('0x3')]},'threadId':{'type':Sequelize[_0xb23b('0x4')]},'externalUrl':{'type':Sequelize[_0xb23b('0x4')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xb23b('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xb23b('0x4')]},'autoreplyExecuted':{'type':Sequelize[_0xb23b('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 7863204..a3abbfa 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 _0x6859=['sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','update','destroy','then','error','name','send','TagIds','Tags','forEach','catch','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','limit','order','sort','pick','select','field','from','tools_tags','u.id','u.fullname','ui.OpenchannelInteractionId','user_has_openchannel_interactions','left_join','users','u.id\x20=\x20ui.UserId','openchannel_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','length','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','operator','$substring','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','ContactId','buildExpression','type','text','start','Tag','UserId','body','some','compact','isEmpty','where','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','read','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','clone','contactName','DESC','t.id\x20IN\x20?','resolve','OpenchannelAccountId','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','i.OpenchannelAccountId\x20IS\x20NULL','i.OpenchannelAccountId\x20IN\x20?','agent','sequelize','toString','keyBy','merge','OpenchannelInteraction','a.key','Account.key','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','c.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','OpenchannelInteractionId','push','all','rows','show','params','includeAll','options','create','describe','addMessage','ids','omit','getMessages','findOne','nolimit','YYYY-MM-DD\x20HH:mm:ss','OpenchannelMessage','include','findAll','addTags','setTags','spread','color','emit','openchannelInteractionTags:save','removeTags','unix','join','root','files','tmp','attachments','format','transcript-%d-%s.zip','User','fullname','Contact','lastName','Attachment','direction','OpenchannelAccount','Account','Owner','get','mkdirSync','Openchannel','N.A.','closed','closedAt','disposition','Public','Private','createReadStream','createWriteStream','out','System','basename','secret','renderFile','views','downloadInteraction.ejs','transcript-','createPdfFromHTML','err','eml-format','zip-dir','fast-json-patch','moment','mustache','util','path','sox','lodash','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket'];(function(_0x2baeac,_0x5ac1c5){var _0xfaa91f=function(_0x1d5e3f){while(--_0x1d5e3f){_0x2baeac['push'](_0x2baeac['shift']());}};_0xfaa91f(++_0x5ac1c5);}(_0x6859,0x1b8));var _0x9685=function(_0x1cb18a,_0x33167a){_0x1cb18a=_0x1cb18a-0x0;var _0x22442e=_0x6859[_0x1cb18a];return _0x22442e;};'use strict';var emlformat=require(_0x9685('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9685('0x1'));var jsonpatch=require(_0x9685('0x2'));var rp=require('request-promise');var moment=require(_0x9685('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x9685('0x4'));var util=require(_0x9685('0x5'));var path=require(_0x9685('0x6'));var sox=require(_0x9685('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9685('0x8'));var squel=require(_0x9685('0x9'));var crypto=require('crypto');var jsforce=require(_0x9685('0xa'));var deskjs=require(_0x9685('0xb'));var toCsv=require(_0x9685('0xc'));var querystring=require(_0x9685('0xd'));var Papa=require('papaparse');var Redis=require(_0x9685('0xe'));var authService=require(_0x9685('0xf'));var qs=require(_0x9685('0x10'));var as=require(_0x9685('0x11'));var pdf=require(_0x9685('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9685('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x9685('0x14'));var licenseUtil=require(_0x9685('0x15'));var db=require(_0x9685('0x16'))['db'];config[_0x9685('0x17')]=_[_0x9685('0x18')](config['redis'],{'host':_0x9685('0x19'),'port':0x18eb});var socket=require(_0x9685('0x1a'))(new Redis(config[_0x9685('0x17')]));require(_0x9685('0x1b'))['register'](socket);function respondWithStatusCode(_0xa6cf3a,_0x3805b1){_0x3805b1=_0x3805b1||0xcc;return function(_0x3450d8){if(_0x3450d8){return _0xa6cf3a[_0x9685('0x1c')](_0x3805b1);}return _0xa6cf3a[_0x9685('0x1d')](_0x3805b1)[_0x9685('0x1e')]();};}function respondWithResult(_0xe51382,_0x45b6a8){_0x45b6a8=_0x45b6a8||0xc8;return function(_0x4aaacc){if(_0x4aaacc){return _0xe51382[_0x9685('0x1d')](_0x45b6a8)[_0x9685('0x1f')](_0x4aaacc);}};}function respondWithFilteredResult(_0x224325,_0x332ecd){return function(_0x5deefd){if(_0x5deefd){var _0x5bb0ac=typeof _0x332ecd[_0x9685('0x20')]==='undefined'&&typeof _0x332ecd['limit']===_0x9685('0x21');var _0x6ec77d=_0x5deefd[_0x9685('0x22')];var _0x5842f9=_0x5bb0ac?0x0:_0x332ecd[_0x9685('0x20')];var _0x2a55ca=_0x5bb0ac?_0x5deefd[_0x9685('0x22')]:_0x332ecd[_0x9685('0x20')]+_0x332ecd['limit'];var _0x10b5e3;if(_0x2a55ca>=_0x6ec77d){_0x2a55ca=_0x6ec77d;_0x10b5e3=0xc8;}else{_0x10b5e3=0xce;}_0x224325[_0x9685('0x1d')](_0x10b5e3);return _0x224325[_0x9685('0x23')](_0x9685('0x24'),_0x5842f9+'-'+_0x2a55ca+'/'+_0x6ec77d)[_0x9685('0x1f')](_0x5deefd);}return null;};}function patchUpdates(_0x8a1496){return function(_0x4c7922){try{jsonpatch[_0x9685('0x25')](_0x4c7922,_0x8a1496,!![]);}catch(_0x5cf783){return BPromise[_0x9685('0x26')](_0x5cf783);}return _0x4c7922['save']();};}function saveUpdates(_0xae4a25,_0x12e96a){return function(_0x266be5){if(_0x266be5){return _0x266be5[_0x9685('0x27')](_0xae4a25)['then'](function(_0x34cfad){return _0x34cfad;});}return null;};}function removeEntity(_0x23f836,_0x167f9e){return function(_0x2f44ea){if(_0x2f44ea){return _0x2f44ea[_0x9685('0x28')]()[_0x9685('0x29')](function(){_0x23f836[_0x9685('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x160363,_0x5d89e5){return function(_0x475f86){if(!_0x475f86){_0x160363[_0x9685('0x1c')](0x194);}return _0x475f86;};}function handleError(_0x2f4468,_0x5cabaa){_0x5cabaa=_0x5cabaa||0x1f4;return function(_0x2531aa){logger[_0x9685('0x2a')](_0x2531aa['stack']);if(_0x2531aa[_0x9685('0x2b')]){delete _0x2531aa[_0x9685('0x2b')];}_0x2f4468[_0x9685('0x1d')](_0x5cabaa)[_0x9685('0x2c')](_0x2531aa);};}function getInteractionUsers(_0x2b68ce,_0x431231){return new BPromise(function(_0x3fd8df,_0x2e9ea8){try{if(_0x431231[_0x2b68ce['id']]){_0x2b68ce['Users']=_['map'](_0x431231[_0x2b68ce['id']],function(_0xe00029){return{'id':_0xe00029['id'],'fullname':_0xe00029['fullname']};});}}catch(_0x2b0f98){_0x2e9ea8(_0x2b0f98);}_0x3fd8df(_0x2b68ce);});}function getInteractionTags(_0x4a814d,_0x3b6c80){return new BPromise(function(_0x5b5a20,_0x277da5){try{if(_0x4a814d[_0x9685('0x2d')]){_0x4a814d[_0x9685('0x2e')]=[];_0x4a814d[_0x9685('0x2d')]['split'](',')[_0x9685('0x2f')](function(_0x102a3b){_0x4a814d[_0x9685('0x2e')]['push'](_0x3b6c80[_0x102a3b]);});}delete _0x4a814d[_0x9685('0x2d')];}catch(_0x3eaa16){_0x277da5(_0x3eaa16);}_0x5b5a20(_0x4a814d);});}function updateOpenchannelInteraction(_0x2d3394,_0x47b673,_0x15720e){return new BPromise(function(_0x93d3b9,_0x5433fe){return getInteractionUsers(_0x2d3394,_0x15720e)[_0x9685('0x29')](function(_0x9888be){return getInteractionTags(_0x9888be,_0x47b673);})[_0x9685('0x29')](function(_0x1af97a){_0x93d3b9(_0x1af97a);})[_0x9685('0x30')](function(_0x432ab4){_0x5433fe(_0x432ab4);});});}exports['index']=function(_0x3ba8ac,_0x1d74ab){var _0x3a9524={},_0x5c713c={},_0x59f94c={'count':0x0,'rows':[]};var _0x34bbb6=_[_0x9685('0x31')](db['OpenchannelInteraction'][_0x9685('0x32')],function(_0x3cda67){return{'name':_0x3cda67[_0x9685('0x33')],'type':_0x3cda67['type'][_0x9685('0x34')]};});_0x5c713c[_0x9685('0x35')]=_[_0x9685('0x31')](_0x34bbb6,_0x9685('0x2b'));_0x5c713c[_0x9685('0x36')]=_[_0x9685('0x37')](_0x3ba8ac[_0x9685('0x36')]);_0x5c713c[_0x9685('0x38')]=_['intersection'](_0x5c713c['model'],_0x5c713c[_0x9685('0x36')]);_0x3a9524['attributes']=_[_0x9685('0x39')](_0x5c713c[_0x9685('0x35')],qs[_0x9685('0x3a')](_0x3ba8ac[_0x9685('0x36')][_0x9685('0x3a')]));_0x3a9524['attributes']=_0x3a9524[_0x9685('0x3b')]['length']?_0x3a9524['attributes']:_0x5c713c[_0x9685('0x35')];if(!_0x3ba8ac[_0x9685('0x36')][_0x9685('0x3c')]('nolimit')){_0x3a9524['limit']=qs['limit'](_0x3ba8ac[_0x9685('0x36')][_0x9685('0x3d')]);_0x3a9524[_0x9685('0x20')]=qs['offset'](_0x3ba8ac[_0x9685('0x36')][_0x9685('0x20')]);}_0x3a9524[_0x9685('0x3e')]=qs['sort'](_0x3ba8ac[_0x9685('0x36')][_0x9685('0x3f')]);_0x3a9524['where']=qs['filters'](_[_0x9685('0x40')](_0x3ba8ac[_0x9685('0x36')],_0x5c713c[_0x9685('0x38')]),_0x34bbb6);var _0xf3765c=[];var _0x3ac286=squel[_0x9685('0x41')]()[_0x9685('0x42')]('id')[_0x9685('0x42')](_0x9685('0x2b'))['field']('color')[_0x9685('0x43')](_0x9685('0x44'));var _0x4e6c55=squel[_0x9685('0x41')]()[_0x9685('0x42')](_0x9685('0x45'))[_0x9685('0x42')](_0x9685('0x46'))['field'](_0x9685('0x47'))[_0x9685('0x43')](_0x9685('0x48'),'ui')[_0x9685('0x49')](_0x9685('0x4a'),'u',_0x9685('0x4b'));var _0x48b899=squel[_0x9685('0x41')]()[_0x9685('0x43')](_0x9685('0x4c'),'i')[_0x9685('0x49')](_0x9685('0x4d'),'c',_0x9685('0x4e'))['left_join'](_0x9685('0x4a'),'o','o.id\x20=\x20i.UserId')[_0x9685('0x49')](_0x9685('0x4f'),'a',_0x9685('0x50'))[_0x9685('0x49')](_0x9685('0x51'),'me',_0x9685('0x52'))[_0x9685('0x49')](_0x9685('0x53'),'it',_0x9685('0x54'))['left_join']('tools_tags','t',_0x9685('0x55'));var _0x5441a3=squel[_0x9685('0x56')]();var _0x163d46=[];var _0x3f8ed0=squel[_0x9685('0x56')]();var _0x26c0d2;if(_0x3ba8ac[_0x9685('0x36')][_0x9685('0x57')]){_0x26c0d2=as[_0x9685('0x58')](_0x3ba8ac[_0x9685('0x36')][_0x9685('0x57')]);var _0x278060=_0x26c0d2[_0x9685('0x59')];for(var _0x59fd0c=0x0;_0x59fd0c<_0x26c0d2['conditions'][_0x9685('0x5a')];_0x59fd0c++){var _0x19ecc7=_0x26c0d2[_0x9685('0x5b')][_0x59fd0c];var _0x2fcd23='i';var _0x27e563=_[_0x9685('0x5c')](_0x34bbb6,[_0x9685('0x2b'),_0x19ecc7['field']]);if(!_0x27e563){switch(_0x19ecc7[_0x9685('0x42')]){case _0x9685('0x5d'):if(_0x19ecc7[_0x9685('0x5e')]==0x1){_0x48b899[_0x9685('0x5f')]('`'+_0x19ecc7[_0x9685('0x42')]+_0x9685('0x60'));}else{_0x48b899[_0x9685('0x5f')]('`'+_0x19ecc7[_0x9685('0x42')]+_0x9685('0x61'));}break;case'Contact':if(_0x19ecc7[_0x9685('0x62')]===_0x9685('0x63')){if(_0x19ecc7[_0x9685('0x5e')][_0x9685('0x64')]('\x20')[_0x9685('0x5a')]>0x1){_0x5441a3[_0x278060](_0x9685('0x65'),qs[_0x9685('0x66')](_0x19ecc7[_0x9685('0x5e')]),null);}else{var _0x55006a='%'+_0x19ecc7['value']+'%';_0x5441a3[_0x278060]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x55006a,_0x55006a,_0x55006a);}}else{_0x27e563=_[_0x9685('0x5c')](_0x34bbb6,[_0x9685('0x2b'),_0x9685('0x67')]);_0x19ecc7[_0x9685('0x42')]='ContactId';_0xf251f=as[_0x9685('0x68')](_0x2fcd23,_0x27e563[_0x9685('0x69')],_0x19ecc7);_0x5441a3[_0x278060](_0xf251f[_0x9685('0x6a')],_0xf251f[_0x9685('0x5e')][_0x9685('0x6b')],_0xf251f['value'][_0x9685('0x1e')]);}break;case _0x9685('0x6c'):var _0x3b3d5f=_0x19ecc7[_0x9685('0x5e')][_0x9685('0x64')](',')['map'](function(_0x1f77b1){return Number(_0x1f77b1);});_0x3b3d5f[_0x9685('0x2f')](function(_0x49cfeb){_0x3f8ed0['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x49cfeb+',%');});_0x163d46=_['union'](_0x163d46,_0x3b3d5f);break;case'User':if(_0x19ecc7[_0x9685('0x62')]===_0x9685('0x63')){_0x5441a3[_0x278060]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x19ecc7[_0x9685('0x5e')]+'%',null);}else{_0x27e563=_[_0x9685('0x5c')](_0x34bbb6,[_0x9685('0x2b'),_0x9685('0x6d')]);_0x19ecc7[_0x9685('0x42')]=_0x9685('0x6d');_0xf251f=as[_0x9685('0x68')](_0x2fcd23,_0x27e563[_0x9685('0x69')],_0x19ecc7);_0x5441a3[_0x278060](_0xf251f[_0x9685('0x6a')],_0xf251f[_0x9685('0x5e')]['start'],_0xf251f['value']['end']);}break;case _0x9685('0x6e'):_0xf251f=as[_0x9685('0x68')]('me',null,_0x19ecc7);_0x5441a3[_0x278060](_0xf251f[_0x9685('0x6a')],_0xf251f['value'][_0x9685('0x6b')],_0xf251f[_0x9685('0x5e')]['end']);break;}}else{var _0xf251f=as[_0x9685('0x68')](_0x2fcd23,_0x27e563[_0x9685('0x69')],_0x19ecc7);_0x5441a3[_0x278060](_0xf251f['text'],_0xf251f[_0x9685('0x5e')]['start'],_0xf251f['value'][_0x9685('0x1e')]);}}}else{var _0x495fd2=_(_0x3ba8ac[_0x9685('0x36')])[_0x9685('0x37')]()['map'](function(_0x42cbc1){return _[_0x9685('0x6f')](_0x34bbb6,[_0x9685('0x2b'),_0x42cbc1])?_0x42cbc1:undefined;})[_0x9685('0x70')]()['value']();if(!_[_0x9685('0x71')](_0x495fd2)){_0x495fd2[_0x9685('0x2f')](function(_0x25e3fc){if(_0x25e3fc==='OpenchannelAccountId'){_0x48b899[_0x9685('0x72')]('i.OpenchannelAccountId\x20IN\x20?',[][_0x9685('0x73')](_0x3ba8ac['query'][_0x25e3fc]));}else if(_0x25e3fc===_0x9685('0x74')){var _0x2f7233=JSON[_0x9685('0x75')](_0x3ba8ac[_0x9685('0x36')][_0x25e3fc])[_0x9685('0x76')];var _0x48f507=JSON[_0x9685('0x75')](_0x3ba8ac['query'][_0x25e3fc])[_0x9685('0x77')];_0x48b899['where'](_0x9685('0x78'),_0x2f7233,_0x48f507);}else{if(_0x3ba8ac['query'][_0x25e3fc]===_0x9685('0x79')){_0x48b899[_0x9685('0x72')]('i.'+_0x25e3fc+'\x20IS\x20NULL');}else{_0x48b899[_0x9685('0x72')]('i.'+_0x25e3fc+'\x20=\x20?',_0x3ba8ac[_0x9685('0x36')][_0x25e3fc]);}}});}if(_0x3ba8ac[_0x9685('0x36')][_0x9685('0x7a')]){if(_0x3ba8ac[_0x9685('0x36')][_0x9685('0x7a')]==0x1){_0x48b899[_0x9685('0x5f')]('`unreadMessages`\x20=\x200');}else{_0x48b899['having'](_0x9685('0x7b'));}}if(_0x3ba8ac[_0x9685('0x36')][_0x9685('0x7c')]){_0x163d46=_[_0x9685('0x7d')](_0x3ba8ac[_0x9685('0x36')]['tag'])?_0x3ba8ac['query'][_0x9685('0x7c')]:new Array(_0x3ba8ac[_0x9685('0x36')]['tag']);_0x163d46[_0x9685('0x2f')](function(_0x270609){_0x3f8ed0['or'](_0x9685('0x7e'),'%,'+_0x270609+',%');});}if(_0x3ba8ac[_0x9685('0x36')][_0x9685('0x7f')]){var _0x4d2c73=_0x3ba8ac[_0x9685('0x36')]['filter'][_0x9685('0x80')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs['isNumeric'](_0x4d2c73)){_0x5441a3['or'](_0x9685('0x81'),_0x4d2c73+'%');}else{_0x5441a3['or'](_0x9685('0x82'),qs[_0x9685('0x66')](_0x4d2c73))['or'](_0x9685('0x83'),_0x4d2c73+'%')['or'](_0x9685('0x84'),_0x4d2c73+'%');}}}_0x48b899[_0x9685('0x72')](_0x5441a3);_0x48b899[_0x9685('0x85')](_0x9685('0x86'));var _0x10569a={'type':db[_0x9685('0x87')]['QueryTypes']['SELECT'],'raw':!![]};var _0x1216a7=_0x48b899[_0x9685('0x88')]();_0x1216a7[_0x9685('0x42')](_0x9685('0x86'));_0x1216a7['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');if(_0x3a9524[_0x9685('0x3e')]){_0x3a9524[_0x9685('0x3e')][_0x9685('0x2f')](function(_0x35bcca){var _0x125127=_0x35bcca[0x0]===_0x9685('0x89')?_0x35bcca[0x0]:'i.'+_0x35bcca[0x0];_0x48b899[_0x9685('0x3e')](_0x125127,_0x35bcca[0x1]===_0x9685('0x8a')?![]:!![]);});}if(!_['isEmpty'](_0x163d46)){_0x48b899[_0x9685('0x5f')](_0x3f8ed0);_0x1216a7['where'](_0x9685('0x8b'),_0x163d46);}BPromise[_0x9685('0x8c')]()[_0x9685('0x29')](function(){if(!_0x26c0d2){if(_0x3ba8ac['query'][_0x9685('0x8d')])return;_0x1216a7['where'](_0x9685('0x8e'));_0x48b899[_0x9685('0x72')](_0x9685('0x8e'));return;}if(_0x3ba8ac[_0x9685('0x8f')]['role']!=='agent')return;return _0x3ba8ac[_0x9685('0x8f')]['getOpenchannelAccounts']({'attributes':['id'],'raw':!![]})[_0x9685('0x29')](function(_0x8f3a0d){if(_[_0x9685('0x71')](_0x8f3a0d)){_0x1216a7[_0x9685('0x72')](_0x9685('0x90'));_0x48b899[_0x9685('0x72')](_0x9685('0x90'));}else{_0x1216a7[_0x9685('0x72')](_0x9685('0x91'),_[_0x9685('0x31')](_0x8f3a0d,'id'));_0x48b899[_0x9685('0x72')](_0x9685('0x91'),_['map'](_0x8f3a0d,'id'));}});})['then'](function(){if(_0x3ba8ac['user']['role']===_0x9685('0x92')&&!_0x26c0d2&&!_0x3ba8ac['query']['OpenchannelAccountId'])return[];return db[_0x9685('0x93')][_0x9685('0x36')](_0x1216a7[_0x9685('0x94')](),_0x10569a);})['then'](function(_0x458b18){_0x59f94c[_0x9685('0x22')]=_0x458b18[_0x9685('0x5a')];if(_0x59f94c[_0x9685('0x22')]===0x0)return[];return db[_0x9685('0x93')]['query'](_0x3ac286[_0x9685('0x94')](),_0x10569a)[_0x9685('0x29')](function(_0x536d58){_0xf3765c=_[_0x9685('0x95')](_0x536d58,'id');_0x10569a=_[_0x9685('0x96')](_0x10569a,{'model':db[_0x9685('0x97')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3ba8ac['query'][_0x9685('0x3a')]){_0x3a9524['attributes'][_0x9685('0x2f')](function(_0xfcaaf3){_0x48b899['field']('i.'+_0xfcaaf3);});}else{_0x48b899[_0x9685('0x42')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x9685('0x5d'));_0x48b899[_0x9685('0x42')](_0x9685('0x98'),_0x9685('0x99'));_0x48b899[_0x9685('0x42')]('a.mandatoryDisposition','Account.mandatoryDisposition');_0x48b899[_0x9685('0x42')](_0x9685('0x9a'),_0x9685('0x89'));_0x48b899[_0x9685('0x42')](_0x9685('0x9b'));_0x48b899['field'](_0x9685('0x9c'),_0x9685('0x9d'));_0x48b899[_0x9685('0x42')](_0x9685('0x9e'),_0x9685('0x9f'));_0x48b899[_0x9685('0x42')](_0x9685('0xa0'),_0x9685('0xa1'));_0x48b899[_0x9685('0x42')](_0x9685('0xa2'),'Contact.phone');_0x48b899[_0x9685('0x42')]('c.mobile','Contact.mobile');_0x48b899[_0x9685('0x42')](_0x9685('0xa3'),'Contact.fax');_0x48b899[_0x9685('0x42')](_0x9685('0xa4'),_0x9685('0xa5'));_0x48b899['field'](_0x9685('0xa6'),'Owner.internal');_0x48b899['field'](_0x9685('0xa7'),_0x9685('0x2d'));}if(_0x3a9524[_0x9685('0x3d')])_0x48b899[_0x9685('0x3d')](_0x3a9524[_0x9685('0x3d')]);if(_0x3a9524['offset'])_0x48b899[_0x9685('0x20')](_0x3a9524['offset']);return db[_0x9685('0x93')][_0x9685('0x36')](_0x48b899[_0x9685('0x94')](),_0x10569a);})[_0x9685('0x29')](function(_0x345d9a){if(_0x345d9a[_0x9685('0x5a')]>0x0)_0x4e6c55[_0x9685('0x72')]('ui.OpenchannelInteractionId\x20IN\x20?',_[_0x9685('0x31')](_0x345d9a,'id'));return db['sequelize'][_0x9685('0x36')](_0x4e6c55[_0x9685('0x94')](),_0x10569a)['then'](function(_0x75052f){var _0x1b8ace=_[_0x9685('0xa8')](_0x75052f,_0x9685('0xa9'));var _0x23caaa=[];_0x345d9a[_0x9685('0x2f')](function(_0x551da9){_0x23caaa[_0x9685('0xaa')](updateOpenchannelInteraction(_0x551da9,_0xf3765c,_0x1b8ace));});return BPromise[_0x9685('0xab')](_0x23caaa);});});})[_0x9685('0x29')](function(_0x26b4ee){_0x59f94c[_0x9685('0xac')]=_0x26b4ee;return _0x59f94c;})[_0x9685('0x29')](respondWithFilteredResult(_0x1d74ab,_0x3a9524))[_0x9685('0x30')](handleError(_0x1d74ab,null));};exports[_0x9685('0xad')]=function(_0x134278,_0x3b6e21){var _0x3c6dcf={};if(_0x134278[_0x9685('0x36')][_0x9685('0x69')]&&_0x134278[_0x9685('0x36')][_0x9685('0x69')]===_0x9685('0x43')){_0x3c6dcf[_0x9685('0x43')]=_0x134278[_0x9685('0xae')]['id'];}else{_0x3c6dcf['id']=_0x134278[_0x9685('0xae')]['id'];}var _0xc50d0a={'raw':![],'where':_0x3c6dcf},_0x36c628={};_0x36c628['model']=_[_0x9685('0x37')](db[_0x9685('0x97')]['rawAttributes']);_0x36c628[_0x9685('0x36')]=_[_0x9685('0x37')](_0x134278[_0x9685('0x36')]);_0x36c628[_0x9685('0x38')]=_[_0x9685('0x39')](_0x36c628[_0x9685('0x35')],_0x36c628[_0x9685('0x36')]);_0xc50d0a[_0x9685('0x3b')]=_[_0x9685('0x39')](_0x36c628[_0x9685('0x35')],qs[_0x9685('0x3a')](_0x134278[_0x9685('0x36')][_0x9685('0x3a')]));_0xc50d0a[_0x9685('0x3b')]=_0xc50d0a[_0x9685('0x3b')]['length']?_0xc50d0a[_0x9685('0x3b')]:_0x36c628['model'];if(_0x134278['query'][_0x9685('0xaf')]){_0xc50d0a['include']=[{'all':!![]}];}_0xc50d0a=_[_0x9685('0x96')]({},_0xc50d0a,_0x134278[_0x9685('0xb0')]);return db[_0x9685('0x97')]['find'](_0xc50d0a)['then'](handleEntityNotFound(_0x3b6e21,null))['then'](respondWithResult(_0x3b6e21,null))[_0x9685('0x30')](handleError(_0x3b6e21,null));};exports[_0x9685('0xb1')]=function(_0x1dee6e,_0x4cd144){return db[_0x9685('0x97')][_0x9685('0xb1')](_0x1dee6e['body'],{})[_0x9685('0x29')](respondWithResult(_0x4cd144,0xc9))[_0x9685('0x30')](handleError(_0x4cd144,null));};exports[_0x9685('0x27')]=function(_0x50ee2f,_0x5b7e2c){if(_0x50ee2f['body']['id']){delete _0x50ee2f['body']['id'];}return db[_0x9685('0x97')][_0x9685('0x5c')]({'where':{'id':_0x50ee2f[_0x9685('0xae')]['id']}})[_0x9685('0x29')](handleEntityNotFound(_0x5b7e2c,null))[_0x9685('0x29')](saveUpdates(_0x50ee2f[_0x9685('0x6e')],null))['then'](respondWithResult(_0x5b7e2c,null))[_0x9685('0x30')](handleError(_0x5b7e2c,null));};exports[_0x9685('0x28')]=function(_0x4f92c9,_0x59eea6){return db[_0x9685('0x97')][_0x9685('0x5c')]({'where':{'id':_0x4f92c9[_0x9685('0xae')]['id']}})['then'](handleEntityNotFound(_0x59eea6,null))[_0x9685('0x29')](removeEntity(_0x59eea6,null))[_0x9685('0x30')](handleError(_0x59eea6,null));};exports[_0x9685('0xb2')]=function(_0x59812b,_0xeb0ed1){return db[_0x9685('0x97')]['describe']()[_0x9685('0x29')](respondWithResult(_0xeb0ed1,null))[_0x9685('0x30')](handleError(_0xeb0ed1,null));};exports['addMessage']=function(_0x4d026a,_0x29823a,_0x2f0856){return db['OpenchannelMessage'][_0x9685('0x5c')]({'where':{'id':_0x4d026a['params']['id']}})['then'](handleEntityNotFound(_0x29823a,null))[_0x9685('0x29')](function(_0x23fb85){if(_0x23fb85){return _0x23fb85[_0x9685('0xb3')](_0x4d026a[_0x9685('0x6e')][_0x9685('0xb4')],_[_0x9685('0xb5')](_0x4d026a['body'],['ids','id'])||{});}})[_0x9685('0x29')](respondWithResult(_0x29823a,null))[_0x9685('0x30')](handleError(_0x29823a,null));};exports[_0x9685('0xb6')]=function(_0x27b57d,_0x4db05f,_0x307b91){var _0x10b613={'raw':![],'where':{}};var _0xb768f7={};var _0x4eda70={'count':0x0,'rows':[]};return db[_0x9685('0x97')][_0x9685('0xb7')]({'where':{'id':_0x27b57d['params']['id']}})[_0x9685('0x29')](handleEntityNotFound(_0x4db05f,null))[_0x9685('0x29')](function(_0x463d63){if(_0x463d63){_0xb768f7[_0x9685('0x35')]=_['keys'](db['OpenchannelMessage'][_0x9685('0x32')]);_0xb768f7[_0x9685('0x36')]=_[_0x9685('0x37')](_0x27b57d['query']);_0xb768f7[_0x9685('0x38')]=_[_0x9685('0x39')](_0xb768f7[_0x9685('0x35')],_0xb768f7[_0x9685('0x36')]);_0x10b613['attributes']=_[_0x9685('0x39')](_0xb768f7[_0x9685('0x35')],qs[_0x9685('0x3a')](_0x27b57d[_0x9685('0x36')]['fields']));_0x10b613[_0x9685('0x3b')]=_0x10b613[_0x9685('0x3b')][_0x9685('0x5a')]?_0x10b613[_0x9685('0x3b')]:_0xb768f7[_0x9685('0x35')];if(!_0x27b57d[_0x9685('0x36')][_0x9685('0x3c')](_0x9685('0xb8'))){_0x10b613[_0x9685('0x3d')]=qs[_0x9685('0x3d')](_0x27b57d[_0x9685('0x36')][_0x9685('0x3d')]);_0x10b613[_0x9685('0x20')]=qs[_0x9685('0x20')](_0x27b57d['query'][_0x9685('0x20')]);}_0x10b613['order']=qs['sort'](_0x27b57d['query']['sort']);_0x10b613[_0x9685('0x72')]=qs[_0x9685('0x38')](_[_0x9685('0x40')](_0x27b57d[_0x9685('0x36')],_0xb768f7[_0x9685('0x38')]));_0x10b613[_0x9685('0x72')][_0x9685('0xa9')]=_0x463d63['id'];if(_0x27b57d['query'][_0x9685('0x7f')]){_0x10b613[_0x9685('0x72')]=_[_0x9685('0x96')](_0x10b613[_0x9685('0x72')],{'$or':_['map'](_0x10b613['attributes'],function(_0x23e1ea){var _0x1db29f={};_0x1db29f[_0x23e1ea]={'$like':'%'+_0x27b57d['query'][_0x9685('0x7f')]+'%'};return _0x1db29f;})});}if(_0x27b57d['query'][_0x9685('0x76')]){var _0x5b6f49=_0x27b57d[_0x9685('0x36')][_0x9685('0x76')]['split'](',');var _0x192dfa={};_0x192dfa[_0x5b6f49[0x0]]={'$gte':moment(_0x5b6f49[0x1])['format'](_0x9685('0xb9'))};_0x10b613[_0x9685('0x72')]=_[_0x9685('0x96')](_0x10b613[_0x9685('0x72')],_0x192dfa);}_0x10b613=_[_0x9685('0x96')]({},_0x10b613,_0x27b57d['options']);return db[_0x9685('0xba')][_0x9685('0x22')]({'where':_0x10b613[_0x9685('0x72')]})[_0x9685('0x29')](function(_0x28df88){_0x4eda70['count']=_0x28df88;if(_0x27b57d[_0x9685('0x36')][_0x9685('0xaf')]){_0x10b613[_0x9685('0xbb')]=[{'all':!![]}];}return db[_0x9685('0xba')][_0x9685('0xbc')](_0x10b613);})[_0x9685('0x29')](function(_0x7473e9){_0x4eda70[_0x9685('0xac')]=_0x7473e9;return _0x4eda70;});}})[_0x9685('0x29')](respondWithFilteredResult(_0x4db05f,_0x10b613))[_0x9685('0x30')](handleError(_0x4db05f,null));};exports[_0x9685('0xbd')]=function(_0x3b3fc6,_0x3ab35a,_0x1e0192){return db[_0x9685('0x97')][_0x9685('0x5c')]({'where':{'id':_0x3b3fc6[_0x9685('0xae')]['id']}})['then'](handleEntityNotFound(_0x3ab35a,null))[_0x9685('0x29')](function(_0x943163){if(_0x943163){return _0x943163[_0x9685('0xbe')](_0x3b3fc6[_0x9685('0x6e')][_0x9685('0xb4')],_[_0x9685('0xb5')](_0x3b3fc6[_0x9685('0x6e')],['ids','id'])||{})[_0x9685('0xbf')](function(){return db[_0x9685('0x6c')]['findAll']({'attributes':['id',_0x9685('0x2b'),_0x9685('0xc0')],'where':{'id':_0x3b3fc6[_0x9685('0x6e')][_0x9685('0xb4')]}});})[_0x9685('0x29')](function(_0x40cfe2){socket[_0x9685('0xc1')](_0x9685('0xc2'),{'id':Number(_0x3b3fc6[_0x9685('0xae')]['id']),'tags':_0x40cfe2||[]});return{'id':Number(_0x3b3fc6[_0x9685('0xae')]['id']),'tags':_0x40cfe2||[]};});}})[_0x9685('0x29')](respondWithResult(_0x3ab35a,null))[_0x9685('0x30')](handleError(_0x3ab35a,null));};exports[_0x9685('0xc3')]=function(_0x424b61,_0x2ed860,_0x422d24){return db[_0x9685('0x97')][_0x9685('0x5c')]({'where':{'id':_0x424b61[_0x9685('0xae')]['id']}})['then'](handleEntityNotFound(_0x2ed860,null))[_0x9685('0x29')](function(_0x4f9758){if(_0x4f9758){return _0x4f9758[_0x9685('0xc3')](_0x424b61[_0x9685('0x36')]['ids']);}})[_0x9685('0x29')](respondWithStatusCode(_0x2ed860,null))[_0x9685('0x30')](handleError(_0x2ed860,null));};exports['download']=function(_0x4b8b16,_0xb80829){var _0x36a6be=moment()[_0x9685('0xc4')]()[_0x9685('0x94')]();var _0x53ab70=path[_0x9685('0xc5')](config[_0x9685('0xc6')],'server',_0x9685('0xc7'),_0x9685('0xc8'));var _0x3d27ff=path[_0x9685('0xc5')](config[_0x9685('0xc6')],'server','files',_0x9685('0xc9'));var _0x5bde90=path[_0x9685('0xc5')](_0x53ab70,_0x36a6be);var _0xc988f5=util[_0x9685('0xca')](_0x9685('0xcb'),_0x4b8b16['params']['id'],_0x36a6be);var _0x4a8513=path[_0x9685('0xc5')](_0x53ab70,_0xc988f5);var _0x183054=[];_0x183054[_0x9685('0xaa')]({'model':db[_0x9685('0xcc')],'as':_0x9685('0xcc'),'attributes':['id',_0x9685('0xcd')],'raw':!![]});_0x183054['push']({'model':db['CmContact'],'as':_0x9685('0xce'),'attributes':['id','firstName',_0x9685('0xcf')],'raw':!![]});if(_0x4b8b16[_0x9685('0x36')][_0x9685('0xc9')]){_0x183054[_0x9685('0xaa')]({'model':db[_0x9685('0xd0')],'as':_0x9685('0xd0'),'raw':!![]});}var _0x59ffc2=[{'model':db[_0x9685('0xba')],'as':'Messages','attributes':['id',_0x9685('0x6e'),_0x9685('0x74'),_0x9685('0xd1'),'secret',_0x9685('0x7a')],'include':_0x183054}];_0x59ffc2[_0x9685('0xaa')]({'model':db[_0x9685('0xd2')],'as':_0x9685('0xd3'),'attributes':['id',_0x9685('0x2b')]});_0x59ffc2[_0x9685('0xaa')]({'model':db[_0x9685('0xcc')],'as':_0x9685('0xd4'),'attributes':['id',_0x9685('0xcd')]});return db['OpenchannelInteraction'][_0x9685('0x5c')]({'where':{'id':_0x4b8b16[_0x9685('0xae')]['id']},'include':_0x59ffc2})[_0x9685('0x29')](handleEntityNotFound(_0xb80829,null))[_0x9685('0x29')](function(_0x14529c){if(_0x14529c){var _0xb3598a=_0x14529c[_0x9685('0xd5')]({'plain':!![]});fs[_0x9685('0xd6')](_0x5bde90);var _0x3611f7={'channel':_0x9685('0xd7'),'account':_0xb3598a[_0x9685('0xd3')]['name'],'agent':_0xb3598a[_0x9685('0xd4')]?_0xb3598a[_0x9685('0xd4')]['fullname']:_0x9685('0xd8'),'createdAt':moment(_0xb3598a['createdAt'])[_0x9685('0xca')](_0x9685('0xb9'))[_0x9685('0x94')](),'closedAt':_0xb3598a[_0x9685('0xd9')]?moment(_0xb3598a[_0x9685('0xda')])['format'](_0x9685('0xb9'))['toString']():'','disposition':_0xb3598a[_0x9685('0xdb')],'visibility':_0xb3598a['threadId']?_0x9685('0xdc'):_0x9685('0xdd'),'messages':_(_0xb3598a['Messages'])[_0x9685('0x7f')]({'secret':![]})[_0x9685('0x31')](function(_0x34af7e){if(_0x34af7e[_0x9685('0xd0')]){var _0x414d24=path[_0x9685('0xc5')](_0x3d27ff,_0x34af7e[_0x9685('0xd0')]['basename']);if(fs['existsSync'](_0x414d24)){fs[_0x9685('0xde')](_0x414d24)['pipe'](fs[_0x9685('0xdf')](path[_0x9685('0xc5')](_0x5bde90,_0x34af7e[_0x9685('0xd0')]['basename'])));}}return{'date':moment(_0x34af7e[_0x9685('0x74')])['format'](_0x9685('0xb9'))[_0x9685('0x94')](),'sender':_0x34af7e[_0x9685('0xd1')]===_0x9685('0xe0')?_0x34af7e[_0x9685('0xcc')]?_0x34af7e['User'][_0x9685('0xcd')]:_0x9685('0xe1'):_0x34af7e[_0x9685('0xce')]['firstName']+(_0x34af7e[_0x9685('0xce')]['lastName']?'\x20'+_0x34af7e['Contact'][_0x9685('0xcf')]:''),'body':_0x34af7e['Attachment']?_0x34af7e[_0x9685('0xd0')][_0x9685('0xe2')]:_0x34af7e[_0x9685('0x6e')],'direction':_0x34af7e[_0x9685('0xd1')]===_0x9685('0xe0')?'A':'C','secret':_0x34af7e[_0x9685('0xe3')],'read':_0x34af7e[_0x9685('0x7a')],'attachment':_0x34af7e['Attachment']};})['value']()};return ejs[_0x9685('0xe4')](path[_0x9685('0xc5')](config[_0x9685('0xc6')],'server',_0x9685('0xe5'),_0x9685('0xe6')),{'interaction':_0x3611f7})[_0x9685('0x29')](function(_0x895a00){var _0x8f85c1=path['join'](_0x5bde90,_0x9685('0xe7')+_0xb3598a['id']+'-'+_0x36a6be+'.pdf');var _0x1d9514={'path':_0x8f85c1,'channel':_0x9685('0xd7'),'interactionId':_0xb3598a['id']};return pdf[_0x9685('0xe8')](_0x895a00,_0x1d9514);})[_0x9685('0x29')](function(){return new BPromise(function(_0x1a495d,_0x47ea7c){zipdir(_0x5bde90,{'saveTo':_0x4a8513},function(_0x2fc737,_0x2f7333){if(_0x2fc737)return _0x47ea7c(_0x2fc737);return _0x1a495d(_0x2f7333);});})[_0x9685('0x29')](function(){return new BPromise(function(_0x150916,_0x52729d){rimraf(_0x5bde90,function(_0x219b4b){if(_0x219b4b)_0x52729d(_0x219b4b);return _0x150916();});});})[_0x9685('0x29')](function(){return _0xb80829['download'](_0x4a8513,_0xc988f5,function(_0x27529b){if(_0x27529b){console['log'](_0x9685('0xe9'),_0x27529b);}else{fs['unlinkSync'](_0x4a8513);}});});});}else{return _0xb80829[_0x9685('0x1c')](0xc8);}})[_0x9685('0x30')](handleError(_0xb80829,null));}; \ No newline at end of file +var _0xd0d1=['fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','status','offset','undefined','count','limit','set','Content-Range','json','reject','save','then','destroy','end','stack','name','send','Users','map','fullname','TagIds','forEach','Tags','OpenchannelInteraction','rawAttributes','fieldName','type','query','keys','filters','model','fields','attributes','length','hasOwnProperty','order','sort','where','field','from','tools_tags','select','u.id','u.fullname','users','u.id\x20=\x20ui.UserId','openchannel_interactions','left_join','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','t.id\x20=\x20it.TagId','expr','search','conditions','unreadMessages','value','having','operator','$substring','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','body','buildExpression','some','isEmpty','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','getFullTextValue','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','resolve','OpenchannelAccountId','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','agent','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','i.OpenchannelAccountId\x20IN\x20?','role','sequelize','toString','keyBy','a.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','c.lastName','Contact.lastName','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','push','all','rows','catch','show','params','intersection','includeAll','include','merge','options','find','create','describe','OpenchannelMessage','ids','omit','getMessages','findOne','pick','OpenchannelInteractionId','format','findAll','addTags','setTags','spread','color','emit','openchannelInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','CmContact','Contact','firstName','lastName','Attachment','Messages','direction','secret','OpenchannelAccount','Account','mkdirSync','Openchannel','Owner','N.A.','closedAt','disposition','threadId','Private','basename','createReadStream','pipe','createWriteStream','YYYY-MM-DD\x20HH:mm:ss','System','out','downloadInteraction.ejs','log','err','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs'];(function(_0x407399,_0x28a31f){var _0x5e9ae9=function(_0x3cb0a1){while(--_0x3cb0a1){_0x407399['push'](_0x407399['shift']());}};_0x5e9ae9(++_0x28a31f);}(_0xd0d1,0xdd));var _0x1d0d=function(_0x406edb,_0x6f937){_0x406edb=_0x406edb-0x0;var _0x107a20=_0xd0d1[_0x406edb];return _0x107a20;};'use strict';var emlformat=require(_0x1d0d('0x0'));var rimraf=require(_0x1d0d('0x1'));var zipdir=require(_0x1d0d('0x2'));var jsonpatch=require(_0x1d0d('0x3'));var rp=require('request-promise');var moment=require(_0x1d0d('0x4'));var BPromise=require(_0x1d0d('0x5'));var Mustache=require(_0x1d0d('0x6'));var util=require(_0x1d0d('0x7'));var path=require(_0x1d0d('0x8'));var sox=require(_0x1d0d('0x9'));var csv=require(_0x1d0d('0xa'));var ejs=require(_0x1d0d('0xb'));var fs=require('fs');var fs_extra=require(_0x1d0d('0xc'));var _=require('lodash');var squel=require(_0x1d0d('0xd'));var crypto=require(_0x1d0d('0xe'));var jsforce=require(_0x1d0d('0xf'));var deskjs=require(_0x1d0d('0x10'));var toCsv=require(_0x1d0d('0xa'));var querystring=require(_0x1d0d('0x11'));var Papa=require('papaparse');var Redis=require(_0x1d0d('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x1d0d('0x13'));var as=require(_0x1d0d('0x14'));var pdf=require('../../components/export/pdf');var hardwareService=require(_0x1d0d('0x15'));var logger=require('../../config/logger')(_0x1d0d('0x16'));var utils=require(_0x1d0d('0x17'));var config=require(_0x1d0d('0x18'));var licenseUtil=require(_0x1d0d('0x19'));var db=require(_0x1d0d('0x1a'))['db'];config[_0x1d0d('0x1b')]=_[_0x1d0d('0x1c')](config[_0x1d0d('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0x1d0d('0x1d'))(new Redis(config['redis']));require(_0x1d0d('0x1e'))[_0x1d0d('0x1f')](socket);function respondWithStatusCode(_0x11a45a,_0x1b1806){_0x1b1806=_0x1b1806||0xcc;return function(_0x2ec4bd){if(_0x2ec4bd){return _0x11a45a[_0x1d0d('0x20')](_0x1b1806);}return _0x11a45a[_0x1d0d('0x21')](_0x1b1806)['end']();};}function respondWithResult(_0x224ea6,_0x3e7529){_0x3e7529=_0x3e7529||0xc8;return function(_0x4a77b9){if(_0x4a77b9){return _0x224ea6[_0x1d0d('0x21')](_0x3e7529)['json'](_0x4a77b9);}};}function respondWithFilteredResult(_0x3ea721,_0x460c7d){return function(_0x259245){if(_0x259245){var _0x39155a=typeof _0x460c7d[_0x1d0d('0x22')]===_0x1d0d('0x23')&&typeof _0x460c7d['limit']===_0x1d0d('0x23');var _0x13144b=_0x259245[_0x1d0d('0x24')];var _0x31949d=_0x39155a?0x0:_0x460c7d['offset'];var _0xe16cd4=_0x39155a?_0x259245[_0x1d0d('0x24')]:_0x460c7d[_0x1d0d('0x22')]+_0x460c7d[_0x1d0d('0x25')];var _0x483400;if(_0xe16cd4>=_0x13144b){_0xe16cd4=_0x13144b;_0x483400=0xc8;}else{_0x483400=0xce;}_0x3ea721[_0x1d0d('0x21')](_0x483400);return _0x3ea721[_0x1d0d('0x26')](_0x1d0d('0x27'),_0x31949d+'-'+_0xe16cd4+'/'+_0x13144b)[_0x1d0d('0x28')](_0x259245);}return null;};}function patchUpdates(_0x4937bf){return function(_0x141daa){try{jsonpatch['apply'](_0x141daa,_0x4937bf,!![]);}catch(_0x2267b6){return BPromise[_0x1d0d('0x29')](_0x2267b6);}return _0x141daa[_0x1d0d('0x2a')]();};}function saveUpdates(_0x52f73,_0x5d4fd4){return function(_0x165a4b){if(_0x165a4b){return _0x165a4b['update'](_0x52f73)[_0x1d0d('0x2b')](function(_0x2f946b){return _0x2f946b;});}return null;};}function removeEntity(_0x3570bf,_0x3824d3){return function(_0x595b10){if(_0x595b10){return _0x595b10[_0x1d0d('0x2c')]()['then'](function(){_0x3570bf[_0x1d0d('0x21')](0xcc)[_0x1d0d('0x2d')]();});}};}function handleEntityNotFound(_0x1a1095,_0x2aed61){return function(_0x4d1bb0){if(!_0x4d1bb0){_0x1a1095[_0x1d0d('0x20')](0x194);}return _0x4d1bb0;};}function handleError(_0x34b6c4,_0x4a25af){_0x4a25af=_0x4a25af||0x1f4;return function(_0x16ee2f){logger['error'](_0x16ee2f[_0x1d0d('0x2e')]);if(_0x16ee2f[_0x1d0d('0x2f')]){delete _0x16ee2f[_0x1d0d('0x2f')];}_0x34b6c4['status'](_0x4a25af)[_0x1d0d('0x30')](_0x16ee2f);};}function getInteractionUsers(_0x5517d3,_0x5bd665){return new BPromise(function(_0x1a3f49,_0x2a7aea){try{if(_0x5bd665[_0x5517d3['id']]){_0x5517d3[_0x1d0d('0x31')]=_[_0x1d0d('0x32')](_0x5bd665[_0x5517d3['id']],function(_0x19b0b6){return{'id':_0x19b0b6['id'],'fullname':_0x19b0b6[_0x1d0d('0x33')]};});}}catch(_0x1cd41a){_0x2a7aea(_0x1cd41a);}_0x1a3f49(_0x5517d3);});}function getInteractionTags(_0x364ea1,_0x212afe){return new BPromise(function(_0x1197ef,_0x13ffb3){try{if(_0x364ea1[_0x1d0d('0x34')]){_0x364ea1['Tags']=[];_0x364ea1[_0x1d0d('0x34')]['split'](',')[_0x1d0d('0x35')](function(_0x3818e9){_0x364ea1[_0x1d0d('0x36')]['push'](_0x212afe[_0x3818e9]);});}delete _0x364ea1['TagIds'];}catch(_0x2ab2bd){_0x13ffb3(_0x2ab2bd);}_0x1197ef(_0x364ea1);});}function updateOpenchannelInteraction(_0xa96032,_0x5e93d7,_0x4287b9){return new BPromise(function(_0x3d1656,_0x1ee441){return getInteractionUsers(_0xa96032,_0x4287b9)[_0x1d0d('0x2b')](function(_0x2cb444){return getInteractionTags(_0x2cb444,_0x5e93d7);})[_0x1d0d('0x2b')](function(_0x42c95b){_0x3d1656(_0x42c95b);})['catch'](function(_0x5bea09){_0x1ee441(_0x5bea09);});});}exports['index']=function(_0xb0cce0,_0x4e1c9d){var _0x2c6e73={},_0xf8e419={},_0x183e59={'count':0x0,'rows':[]};var _0x3e26a4=_[_0x1d0d('0x32')](db[_0x1d0d('0x37')][_0x1d0d('0x38')],function(_0x5a2a76){return{'name':_0x5a2a76[_0x1d0d('0x39')],'type':_0x5a2a76[_0x1d0d('0x3a')]['key']};});_0xf8e419['model']=_['map'](_0x3e26a4,'name');_0xf8e419[_0x1d0d('0x3b')]=_[_0x1d0d('0x3c')](_0xb0cce0[_0x1d0d('0x3b')]);_0xf8e419[_0x1d0d('0x3d')]=_['intersection'](_0xf8e419[_0x1d0d('0x3e')],_0xf8e419[_0x1d0d('0x3b')]);_0x2c6e73['attributes']=_['intersection'](_0xf8e419[_0x1d0d('0x3e')],qs[_0x1d0d('0x3f')](_0xb0cce0[_0x1d0d('0x3b')][_0x1d0d('0x3f')]));_0x2c6e73[_0x1d0d('0x40')]=_0x2c6e73[_0x1d0d('0x40')][_0x1d0d('0x41')]?_0x2c6e73[_0x1d0d('0x40')]:_0xf8e419[_0x1d0d('0x3e')];if(!_0xb0cce0['query'][_0x1d0d('0x42')]('nolimit')){_0x2c6e73[_0x1d0d('0x25')]=qs[_0x1d0d('0x25')](_0xb0cce0['query'][_0x1d0d('0x25')]);_0x2c6e73[_0x1d0d('0x22')]=qs[_0x1d0d('0x22')](_0xb0cce0[_0x1d0d('0x3b')][_0x1d0d('0x22')]);}_0x2c6e73[_0x1d0d('0x43')]=qs[_0x1d0d('0x44')](_0xb0cce0[_0x1d0d('0x3b')][_0x1d0d('0x44')]);_0x2c6e73[_0x1d0d('0x45')]=qs[_0x1d0d('0x3d')](_['pick'](_0xb0cce0[_0x1d0d('0x3b')],_0xf8e419[_0x1d0d('0x3d')]),_0x3e26a4);var _0x53bd9f=[];var _0x5e2dc4=squel['select']()[_0x1d0d('0x46')]('id')[_0x1d0d('0x46')]('name')[_0x1d0d('0x46')]('color')[_0x1d0d('0x47')](_0x1d0d('0x48'));var _0x5469be=squel[_0x1d0d('0x49')]()[_0x1d0d('0x46')](_0x1d0d('0x4a'))[_0x1d0d('0x46')](_0x1d0d('0x4b'))[_0x1d0d('0x46')]('ui.OpenchannelInteractionId')[_0x1d0d('0x47')]('user_has_openchannel_interactions','ui')['left_join'](_0x1d0d('0x4c'),'u',_0x1d0d('0x4d'));var _0x108937=squel[_0x1d0d('0x49')]()[_0x1d0d('0x47')](_0x1d0d('0x4e'),'i')[_0x1d0d('0x4f')]('cm_contacts','c',_0x1d0d('0x50'))[_0x1d0d('0x4f')]('users','o',_0x1d0d('0x51'))[_0x1d0d('0x4f')](_0x1d0d('0x52'),'a',_0x1d0d('0x53'))['left_join'](_0x1d0d('0x54'),'me',_0x1d0d('0x55'))['left_join'](_0x1d0d('0x56'),'it','it.OpenchannelInteractionId\x20=\x20i.id')['left_join'](_0x1d0d('0x48'),'t',_0x1d0d('0x57'));var _0xbbbfa4=squel[_0x1d0d('0x58')]();var _0x44a003=[];var _0x4d49c2=squel[_0x1d0d('0x58')]();var _0x186b28;if(_0xb0cce0[_0x1d0d('0x3b')][_0x1d0d('0x59')]){_0x186b28=as['parseSearch'](_0xb0cce0[_0x1d0d('0x3b')][_0x1d0d('0x59')]);var _0x28aa62=_0x186b28['sqlOperator'];for(var _0x99a1b5=0x0;_0x99a1b5<_0x186b28['conditions'][_0x1d0d('0x41')];_0x99a1b5++){var _0x18309e=_0x186b28[_0x1d0d('0x5a')][_0x99a1b5];var _0x257445='i';var _0xb7502e=_['find'](_0x3e26a4,[_0x1d0d('0x2f'),_0x18309e[_0x1d0d('0x46')]]);if(!_0xb7502e){switch(_0x18309e[_0x1d0d('0x46')]){case _0x1d0d('0x5b'):if(_0x18309e[_0x1d0d('0x5c')]==0x1){_0x108937['having']('`'+_0x18309e[_0x1d0d('0x46')]+'`\x20=\x200');}else{_0x108937[_0x1d0d('0x5d')]('`'+_0x18309e[_0x1d0d('0x46')]+'`\x20>\x200');}break;case'Contact':if(_0x18309e[_0x1d0d('0x5e')]===_0x1d0d('0x5f')){if(_0x18309e[_0x1d0d('0x5c')][_0x1d0d('0x60')]('\x20')[_0x1d0d('0x41')]>0x1){_0xbbbfa4[_0x28aa62](_0x1d0d('0x61'),qs['getFullTextValue'](_0x18309e[_0x1d0d('0x5c')]),null);}else{var _0x34dcfa='%'+_0x18309e[_0x1d0d('0x5c')]+'%';_0xbbbfa4[_0x28aa62](_0x1d0d('0x62'),_0x34dcfa,_0x34dcfa,_0x34dcfa);}}else{_0xb7502e=_['find'](_0x3e26a4,[_0x1d0d('0x2f'),'ContactId']);_0x18309e[_0x1d0d('0x46')]=_0x1d0d('0x63');_0x35453c=as['buildExpression'](_0x257445,_0xb7502e[_0x1d0d('0x3a')],_0x18309e);_0xbbbfa4[_0x28aa62](_0x35453c[_0x1d0d('0x64')],_0x35453c['value']['start'],_0x35453c['value']['end']);}break;case _0x1d0d('0x65'):var _0x3ef5fe=_0x18309e[_0x1d0d('0x5c')][_0x1d0d('0x60')](',')['map'](function(_0x23fa70){return Number(_0x23fa70);});_0x3ef5fe[_0x1d0d('0x35')](function(_0x35f081){_0x4d49c2['or'](_0x1d0d('0x66'),'%,'+_0x35f081+',%');});_0x44a003=_['union'](_0x44a003,_0x3ef5fe);break;case _0x1d0d('0x67'):if(_0x18309e[_0x1d0d('0x5e')]===_0x1d0d('0x5f')){_0xbbbfa4[_0x28aa62](_0x1d0d('0x68'),'%'+_0x18309e['value']+'%',null);}else{_0xb7502e=_['find'](_0x3e26a4,[_0x1d0d('0x2f'),_0x1d0d('0x69')]);_0x18309e['field']=_0x1d0d('0x69');_0x35453c=as['buildExpression'](_0x257445,_0xb7502e[_0x1d0d('0x3a')],_0x18309e);_0xbbbfa4[_0x28aa62](_0x35453c[_0x1d0d('0x64')],_0x35453c[_0x1d0d('0x5c')][_0x1d0d('0x6a')],_0x35453c[_0x1d0d('0x5c')][_0x1d0d('0x2d')]);}break;case _0x1d0d('0x6b'):_0x35453c=as[_0x1d0d('0x6c')]('me',null,_0x18309e);_0xbbbfa4[_0x28aa62](_0x35453c[_0x1d0d('0x64')],_0x35453c[_0x1d0d('0x5c')][_0x1d0d('0x6a')],_0x35453c['value'][_0x1d0d('0x2d')]);break;}}else{var _0x35453c=as[_0x1d0d('0x6c')](_0x257445,_0xb7502e['type'],_0x18309e);_0xbbbfa4[_0x28aa62](_0x35453c['text'],_0x35453c[_0x1d0d('0x5c')][_0x1d0d('0x6a')],_0x35453c[_0x1d0d('0x5c')]['end']);}}}else{var _0x2663a6=_(_0xb0cce0[_0x1d0d('0x3b')])[_0x1d0d('0x3c')]()[_0x1d0d('0x32')](function(_0x1031b5){return _[_0x1d0d('0x6d')](_0x3e26a4,['name',_0x1031b5])?_0x1031b5:undefined;})['compact']()['value']();if(!_[_0x1d0d('0x6e')](_0x2663a6)){_0x2663a6[_0x1d0d('0x35')](function(_0x215371){if(_0x215371==='OpenchannelAccountId'){_0x108937['where']('i.OpenchannelAccountId\x20IN\x20?',[][_0x1d0d('0x6f')](_0xb0cce0[_0x1d0d('0x3b')][_0x215371]));}else if(_0x215371===_0x1d0d('0x70')){var _0x4b440=JSON[_0x1d0d('0x71')](_0xb0cce0[_0x1d0d('0x3b')][_0x215371])[_0x1d0d('0x72')];var _0x102c78=JSON[_0x1d0d('0x71')](_0xb0cce0[_0x1d0d('0x3b')][_0x215371])[_0x1d0d('0x73')];_0x108937[_0x1d0d('0x45')](_0x1d0d('0x74'),_0x4b440,_0x102c78);}else{if(_0xb0cce0[_0x1d0d('0x3b')][_0x215371]===_0x1d0d('0x75')){_0x108937[_0x1d0d('0x45')]('i.'+_0x215371+_0x1d0d('0x76'));}else{_0x108937[_0x1d0d('0x45')]('i.'+_0x215371+'\x20=\x20?',_0xb0cce0['query'][_0x215371]);}}});}if(_0xb0cce0[_0x1d0d('0x3b')][_0x1d0d('0x77')]){if(_0xb0cce0[_0x1d0d('0x3b')][_0x1d0d('0x77')]==0x1){_0x108937[_0x1d0d('0x5d')]('`unreadMessages`\x20=\x200');}else{_0x108937[_0x1d0d('0x5d')](_0x1d0d('0x78'));}}if(_0xb0cce0[_0x1d0d('0x3b')][_0x1d0d('0x79')]){_0x44a003=_[_0x1d0d('0x7a')](_0xb0cce0[_0x1d0d('0x3b')][_0x1d0d('0x79')])?_0xb0cce0[_0x1d0d('0x3b')]['tag']:new Array(_0xb0cce0['query']['tag']);_0x44a003[_0x1d0d('0x35')](function(_0x3bf367){_0x4d49c2['or'](_0x1d0d('0x66'),'%,'+_0x3bf367+',%');});}if(_0xb0cce0[_0x1d0d('0x3b')]['filter']){var _0x142770=_0xb0cce0['query'][_0x1d0d('0x7b')][_0x1d0d('0x7c')]('\x5c','\x5c\x5c')[_0x1d0d('0x7c')](/'/g,'\x27\x27');if(qs[_0x1d0d('0x7d')](_0x142770)){_0xbbbfa4['or'](_0x1d0d('0x7e'),_0x142770+'%');}else{_0xbbbfa4['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x1d0d('0x7f')](_0x142770))['or'](_0x1d0d('0x80'),_0x142770+'%')['or'](_0x1d0d('0x81'),_0x142770+'%');}}}_0x108937['where'](_0xbbbfa4);_0x108937['group'](_0x1d0d('0x82'));var _0x584e67={'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]};var _0x31fd64=_0x108937[_0x1d0d('0x83')]();_0x31fd64[_0x1d0d('0x46')](_0x1d0d('0x82'));_0x31fd64[_0x1d0d('0x46')](_0x1d0d('0x84'),'unreadMessages');if(_0x2c6e73[_0x1d0d('0x43')]){_0x2c6e73['order'][_0x1d0d('0x35')](function(_0x2cd70c){var _0x1ced87=_0x2cd70c[0x0]===_0x1d0d('0x85')?_0x2cd70c[0x0]:'i.'+_0x2cd70c[0x0];_0x108937[_0x1d0d('0x43')](_0x1ced87,_0x2cd70c[0x1]===_0x1d0d('0x86')?![]:!![]);});}if(!_[_0x1d0d('0x6e')](_0x44a003)){_0x108937['having'](_0x4d49c2);_0x31fd64[_0x1d0d('0x45')]('t.id\x20IN\x20?',_0x44a003);}BPromise[_0x1d0d('0x87')]()[_0x1d0d('0x2b')](function(){if(!_0x186b28){if(_0xb0cce0[_0x1d0d('0x3b')][_0x1d0d('0x88')])return;_0x31fd64['where'](_0x1d0d('0x89'));_0x108937['where'](_0x1d0d('0x89'));return;}if(_0xb0cce0[_0x1d0d('0x8a')]['role']!==_0x1d0d('0x8b'))return;return _0xb0cce0[_0x1d0d('0x8a')][_0x1d0d('0x8c')]({'attributes':['id'],'raw':!![]})['then'](function(_0x562c5e){if(_[_0x1d0d('0x6e')](_0x562c5e)){_0x31fd64[_0x1d0d('0x45')](_0x1d0d('0x8d'));_0x108937[_0x1d0d('0x45')](_0x1d0d('0x8d'));}else{_0x31fd64[_0x1d0d('0x45')](_0x1d0d('0x8e'),_[_0x1d0d('0x32')](_0x562c5e,'id'));_0x108937['where']('i.OpenchannelAccountId\x20IN\x20?',_[_0x1d0d('0x32')](_0x562c5e,'id'));}});})[_0x1d0d('0x2b')](function(){if(_0xb0cce0[_0x1d0d('0x8a')][_0x1d0d('0x8f')]===_0x1d0d('0x8b')&&!_0x186b28&&!_0xb0cce0[_0x1d0d('0x3b')]['OpenchannelAccountId'])return[];return db[_0x1d0d('0x90')][_0x1d0d('0x3b')](_0x31fd64['toString'](),_0x584e67);})[_0x1d0d('0x2b')](function(_0x4041a1){_0x183e59[_0x1d0d('0x24')]=_0x4041a1[_0x1d0d('0x41')];if(_0x183e59[_0x1d0d('0x24')]===0x0)return[];return db[_0x1d0d('0x90')]['query'](_0x5e2dc4[_0x1d0d('0x91')](),_0x584e67)[_0x1d0d('0x2b')](function(_0xef6a30){_0x53bd9f=_[_0x1d0d('0x92')](_0xef6a30,'id');_0x584e67=_['merge'](_0x584e67,{'model':db[_0x1d0d('0x37')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xb0cce0[_0x1d0d('0x3b')][_0x1d0d('0x3f')]){_0x2c6e73[_0x1d0d('0x40')][_0x1d0d('0x35')](function(_0xfde76d){_0x108937[_0x1d0d('0x46')]('i.'+_0xfde76d);});}else{_0x108937['field'](_0x1d0d('0x84'),_0x1d0d('0x5b'));_0x108937[_0x1d0d('0x46')](_0x1d0d('0x93'),'Account.key');_0x108937['field'](_0x1d0d('0x94'),'Account.mandatoryDisposition');_0x108937[_0x1d0d('0x46')](_0x1d0d('0x95'),_0x1d0d('0x85'));_0x108937[_0x1d0d('0x46')](_0x1d0d('0x96'));_0x108937[_0x1d0d('0x46')](_0x1d0d('0x97'),_0x1d0d('0x98'));_0x108937[_0x1d0d('0x46')](_0x1d0d('0x99'),_0x1d0d('0x9a'));_0x108937[_0x1d0d('0x46')]('c.email',_0x1d0d('0x9b'));_0x108937[_0x1d0d('0x46')](_0x1d0d('0x9c'),_0x1d0d('0x9d'));_0x108937[_0x1d0d('0x46')](_0x1d0d('0x9e'),_0x1d0d('0x9f'));_0x108937[_0x1d0d('0x46')]('c.fax',_0x1d0d('0xa0'));_0x108937['field'](_0x1d0d('0xa1'),'Owner.fullname');_0x108937[_0x1d0d('0x46')]('o.internal',_0x1d0d('0xa2'));_0x108937[_0x1d0d('0x46')](_0x1d0d('0xa3'),_0x1d0d('0x34'));}if(_0x2c6e73[_0x1d0d('0x25')])_0x108937[_0x1d0d('0x25')](_0x2c6e73[_0x1d0d('0x25')]);if(_0x2c6e73[_0x1d0d('0x22')])_0x108937[_0x1d0d('0x22')](_0x2c6e73['offset']);return db['sequelize']['query'](_0x108937['toString'](),_0x584e67);})['then'](function(_0x35e8f4){if(_0x35e8f4[_0x1d0d('0x41')]>0x0)_0x5469be[_0x1d0d('0x45')](_0x1d0d('0xa4'),_[_0x1d0d('0x32')](_0x35e8f4,'id'));return db[_0x1d0d('0x90')]['query'](_0x5469be['toString'](),_0x584e67)[_0x1d0d('0x2b')](function(_0xd45ce0){var _0x5514ee=_[_0x1d0d('0xa5')](_0xd45ce0,'OpenchannelInteractionId');var _0xec356=[];_0x35e8f4[_0x1d0d('0x35')](function(_0x551ddd){_0xec356[_0x1d0d('0xa6')](updateOpenchannelInteraction(_0x551ddd,_0x53bd9f,_0x5514ee));});return BPromise[_0x1d0d('0xa7')](_0xec356);});});})[_0x1d0d('0x2b')](function(_0x1e9644){_0x183e59[_0x1d0d('0xa8')]=_0x1e9644;return _0x183e59;})['then'](respondWithFilteredResult(_0x4e1c9d,_0x2c6e73))[_0x1d0d('0xa9')](handleError(_0x4e1c9d,null));};exports[_0x1d0d('0xaa')]=function(_0x57bdac,_0xf7fe9){var _0xc123b0={};if(_0x57bdac['query'][_0x1d0d('0x3a')]&&_0x57bdac['query']['type']===_0x1d0d('0x47')){_0xc123b0[_0x1d0d('0x47')]=_0x57bdac['params']['id'];}else{_0xc123b0['id']=_0x57bdac[_0x1d0d('0xab')]['id'];}var _0x11ac2b={'raw':![],'where':_0xc123b0},_0x51a34f={};_0x51a34f[_0x1d0d('0x3e')]=_[_0x1d0d('0x3c')](db[_0x1d0d('0x37')]['rawAttributes']);_0x51a34f[_0x1d0d('0x3b')]=_[_0x1d0d('0x3c')](_0x57bdac['query']);_0x51a34f[_0x1d0d('0x3d')]=_[_0x1d0d('0xac')](_0x51a34f['model'],_0x51a34f[_0x1d0d('0x3b')]);_0x11ac2b['attributes']=_['intersection'](_0x51a34f['model'],qs[_0x1d0d('0x3f')](_0x57bdac['query']['fields']));_0x11ac2b[_0x1d0d('0x40')]=_0x11ac2b[_0x1d0d('0x40')]['length']?_0x11ac2b[_0x1d0d('0x40')]:_0x51a34f[_0x1d0d('0x3e')];if(_0x57bdac['query'][_0x1d0d('0xad')]){_0x11ac2b[_0x1d0d('0xae')]=[{'all':!![]}];}_0x11ac2b=_[_0x1d0d('0xaf')]({},_0x11ac2b,_0x57bdac[_0x1d0d('0xb0')]);return db[_0x1d0d('0x37')][_0x1d0d('0xb1')](_0x11ac2b)[_0x1d0d('0x2b')](handleEntityNotFound(_0xf7fe9,null))['then'](respondWithResult(_0xf7fe9,null))[_0x1d0d('0xa9')](handleError(_0xf7fe9,null));};exports[_0x1d0d('0xb2')]=function(_0x2c7f0b,_0x37cc5f){return db[_0x1d0d('0x37')][_0x1d0d('0xb2')](_0x2c7f0b[_0x1d0d('0x6b')],{})[_0x1d0d('0x2b')](respondWithResult(_0x37cc5f,0xc9))[_0x1d0d('0xa9')](handleError(_0x37cc5f,null));};exports['update']=function(_0x3fdc17,_0x2a68c3){if(_0x3fdc17[_0x1d0d('0x6b')]['id']){delete _0x3fdc17[_0x1d0d('0x6b')]['id'];}return db[_0x1d0d('0x37')][_0x1d0d('0xb1')]({'where':{'id':_0x3fdc17[_0x1d0d('0xab')]['id']}})['then'](handleEntityNotFound(_0x2a68c3,null))['then'](saveUpdates(_0x3fdc17[_0x1d0d('0x6b')],null))['then'](respondWithResult(_0x2a68c3,null))['catch'](handleError(_0x2a68c3,null));};exports[_0x1d0d('0x2c')]=function(_0x3a6e50,_0x53f7eb){return db[_0x1d0d('0x37')][_0x1d0d('0xb1')]({'where':{'id':_0x3a6e50[_0x1d0d('0xab')]['id']}})[_0x1d0d('0x2b')](handleEntityNotFound(_0x53f7eb,null))[_0x1d0d('0x2b')](removeEntity(_0x53f7eb,null))[_0x1d0d('0xa9')](handleError(_0x53f7eb,null));};exports[_0x1d0d('0xb3')]=function(_0xa8b5ce,_0x35bfb6){return db['OpenchannelInteraction']['describe']()['then'](respondWithResult(_0x35bfb6,null))[_0x1d0d('0xa9')](handleError(_0x35bfb6,null));};exports['addMessage']=function(_0x1fb3d4,_0x58b652,_0x4a9104){return db[_0x1d0d('0xb4')]['find']({'where':{'id':_0x1fb3d4[_0x1d0d('0xab')]['id']}})[_0x1d0d('0x2b')](handleEntityNotFound(_0x58b652,null))['then'](function(_0x4ae597){if(_0x4ae597){return _0x4ae597['addMessage'](_0x1fb3d4[_0x1d0d('0x6b')][_0x1d0d('0xb5')],_[_0x1d0d('0xb6')](_0x1fb3d4['body'],[_0x1d0d('0xb5'),'id'])||{});}})[_0x1d0d('0x2b')](respondWithResult(_0x58b652,null))['catch'](handleError(_0x58b652,null));};exports[_0x1d0d('0xb7')]=function(_0x26d43f,_0x47e31b,_0x339fae){var _0x1dea7a={'raw':![],'where':{}};var _0x2b0b60={};var _0x1de17d={'count':0x0,'rows':[]};return db['OpenchannelInteraction'][_0x1d0d('0xb8')]({'where':{'id':_0x26d43f[_0x1d0d('0xab')]['id']}})['then'](handleEntityNotFound(_0x47e31b,null))[_0x1d0d('0x2b')](function(_0x429efa){if(_0x429efa){_0x2b0b60[_0x1d0d('0x3e')]=_['keys'](db[_0x1d0d('0xb4')][_0x1d0d('0x38')]);_0x2b0b60[_0x1d0d('0x3b')]=_[_0x1d0d('0x3c')](_0x26d43f[_0x1d0d('0x3b')]);_0x2b0b60[_0x1d0d('0x3d')]=_[_0x1d0d('0xac')](_0x2b0b60['model'],_0x2b0b60[_0x1d0d('0x3b')]);_0x1dea7a[_0x1d0d('0x40')]=_['intersection'](_0x2b0b60[_0x1d0d('0x3e')],qs[_0x1d0d('0x3f')](_0x26d43f[_0x1d0d('0x3b')][_0x1d0d('0x3f')]));_0x1dea7a['attributes']=_0x1dea7a[_0x1d0d('0x40')][_0x1d0d('0x41')]?_0x1dea7a[_0x1d0d('0x40')]:_0x2b0b60[_0x1d0d('0x3e')];if(!_0x26d43f[_0x1d0d('0x3b')]['hasOwnProperty']('nolimit')){_0x1dea7a[_0x1d0d('0x25')]=qs[_0x1d0d('0x25')](_0x26d43f['query']['limit']);_0x1dea7a[_0x1d0d('0x22')]=qs[_0x1d0d('0x22')](_0x26d43f['query'][_0x1d0d('0x22')]);}_0x1dea7a[_0x1d0d('0x43')]=qs[_0x1d0d('0x44')](_0x26d43f['query'][_0x1d0d('0x44')]);_0x1dea7a[_0x1d0d('0x45')]=qs[_0x1d0d('0x3d')](_[_0x1d0d('0xb9')](_0x26d43f[_0x1d0d('0x3b')],_0x2b0b60[_0x1d0d('0x3d')]));_0x1dea7a[_0x1d0d('0x45')][_0x1d0d('0xba')]=_0x429efa['id'];if(_0x26d43f['query'][_0x1d0d('0x7b')]){_0x1dea7a[_0x1d0d('0x45')]=_[_0x1d0d('0xaf')](_0x1dea7a[_0x1d0d('0x45')],{'$or':_['map'](_0x1dea7a[_0x1d0d('0x40')],function(_0x3fdb89){var _0x511e17={};_0x511e17[_0x3fdb89]={'$like':'%'+_0x26d43f['query'][_0x1d0d('0x7b')]+'%'};return _0x511e17;})});}if(_0x26d43f[_0x1d0d('0x3b')][_0x1d0d('0x72')]){var _0x39f79f=_0x26d43f[_0x1d0d('0x3b')][_0x1d0d('0x72')]['split'](',');var _0x423ca0={};_0x423ca0[_0x39f79f[0x0]]={'$gte':moment(_0x39f79f[0x1])[_0x1d0d('0xbb')]('YYYY-MM-DD\x20HH:mm:ss')};_0x1dea7a[_0x1d0d('0x45')]=_[_0x1d0d('0xaf')](_0x1dea7a['where'],_0x423ca0);}_0x1dea7a=_['merge']({},_0x1dea7a,_0x26d43f[_0x1d0d('0xb0')]);return db[_0x1d0d('0xb4')]['count']({'where':_0x1dea7a[_0x1d0d('0x45')]})[_0x1d0d('0x2b')](function(_0x137d3d){_0x1de17d['count']=_0x137d3d;if(_0x26d43f[_0x1d0d('0x3b')][_0x1d0d('0xad')]){_0x1dea7a['include']=[{'all':!![]}];}return db['OpenchannelMessage'][_0x1d0d('0xbc')](_0x1dea7a);})[_0x1d0d('0x2b')](function(_0x102f2e){_0x1de17d[_0x1d0d('0xa8')]=_0x102f2e;return _0x1de17d;});}})[_0x1d0d('0x2b')](respondWithFilteredResult(_0x47e31b,_0x1dea7a))[_0x1d0d('0xa9')](handleError(_0x47e31b,null));};exports[_0x1d0d('0xbd')]=function(_0x222585,_0x35fe49,_0xf1354e){return db['OpenchannelInteraction'][_0x1d0d('0xb1')]({'where':{'id':_0x222585[_0x1d0d('0xab')]['id']}})[_0x1d0d('0x2b')](handleEntityNotFound(_0x35fe49,null))[_0x1d0d('0x2b')](function(_0x4e6ec9){if(_0x4e6ec9){return _0x4e6ec9[_0x1d0d('0xbe')](_0x222585[_0x1d0d('0x6b')]['ids'],_['omit'](_0x222585[_0x1d0d('0x6b')],[_0x1d0d('0xb5'),'id'])||{})[_0x1d0d('0xbf')](function(){return db[_0x1d0d('0x65')][_0x1d0d('0xbc')]({'attributes':['id',_0x1d0d('0x2f'),_0x1d0d('0xc0')],'where':{'id':_0x222585[_0x1d0d('0x6b')]['ids']}});})[_0x1d0d('0x2b')](function(_0x294244){socket[_0x1d0d('0xc1')](_0x1d0d('0xc2'),{'id':Number(_0x222585[_0x1d0d('0xab')]['id']),'tags':_0x294244||[]});return{'id':Number(_0x222585[_0x1d0d('0xab')]['id']),'tags':_0x294244||[]};});}})[_0x1d0d('0x2b')](respondWithResult(_0x35fe49,null))[_0x1d0d('0xa9')](handleError(_0x35fe49,null));};exports[_0x1d0d('0xc3')]=function(_0xed11ba,_0x223e3d,_0xd6c165){return db[_0x1d0d('0x37')][_0x1d0d('0xb1')]({'where':{'id':_0xed11ba[_0x1d0d('0xab')]['id']}})['then'](handleEntityNotFound(_0x223e3d,null))[_0x1d0d('0x2b')](function(_0x573358){if(_0x573358){return _0x573358['removeTags'](_0xed11ba[_0x1d0d('0x3b')]['ids']);}})['then'](respondWithStatusCode(_0x223e3d,null))[_0x1d0d('0xa9')](handleError(_0x223e3d,null));};exports[_0x1d0d('0xc4')]=function(_0x508284,_0x5a49b0){var _0x43b2f3=moment()[_0x1d0d('0xc5')]()[_0x1d0d('0x91')]();var _0x1efa41=path[_0x1d0d('0xc6')](config[_0x1d0d('0xc7')],_0x1d0d('0xc8'),_0x1d0d('0xc9'),_0x1d0d('0xca'));var _0x225695=path[_0x1d0d('0xc6')](config[_0x1d0d('0xc7')],_0x1d0d('0xc8'),_0x1d0d('0xc9'),_0x1d0d('0xcb'));var _0x840e9b=path['join'](_0x1efa41,_0x43b2f3);var _0x5dc32f=util[_0x1d0d('0xbb')](_0x1d0d('0xcc'),_0x508284['params']['id'],_0x43b2f3);var _0x3f8c75=path[_0x1d0d('0xc6')](_0x1efa41,_0x5dc32f);var _0x18ca80=[];_0x18ca80['push']({'model':db[_0x1d0d('0x67')],'as':'User','attributes':['id',_0x1d0d('0x33')],'raw':!![]});_0x18ca80[_0x1d0d('0xa6')]({'model':db[_0x1d0d('0xcd')],'as':_0x1d0d('0xce'),'attributes':['id',_0x1d0d('0xcf'),_0x1d0d('0xd0')],'raw':!![]});if(_0x508284[_0x1d0d('0x3b')][_0x1d0d('0xcb')]){_0x18ca80['push']({'model':db[_0x1d0d('0xd1')],'as':_0x1d0d('0xd1'),'raw':!![]});}var _0x4c2d61=[{'model':db[_0x1d0d('0xb4')],'as':_0x1d0d('0xd2'),'attributes':['id',_0x1d0d('0x6b'),_0x1d0d('0x70'),_0x1d0d('0xd3'),_0x1d0d('0xd4'),_0x1d0d('0x77')],'include':_0x18ca80}];_0x4c2d61['push']({'model':db[_0x1d0d('0xd5')],'as':_0x1d0d('0xd6'),'attributes':['id',_0x1d0d('0x2f')]});_0x4c2d61['push']({'model':db['User'],'as':'Owner','attributes':['id',_0x1d0d('0x33')]});return db[_0x1d0d('0x37')]['find']({'where':{'id':_0x508284[_0x1d0d('0xab')]['id']},'include':_0x4c2d61})[_0x1d0d('0x2b')](handleEntityNotFound(_0x5a49b0,null))['then'](function(_0x4cacd6){if(_0x4cacd6){var _0x1fc09d=_0x4cacd6['get']({'plain':!![]});fs[_0x1d0d('0xd7')](_0x840e9b);var _0x3d3628={'channel':_0x1d0d('0xd8'),'account':_0x1fc09d[_0x1d0d('0xd6')]['name'],'agent':_0x1fc09d['Owner']?_0x1fc09d[_0x1d0d('0xd9')][_0x1d0d('0x33')]:_0x1d0d('0xda'),'createdAt':moment(_0x1fc09d['createdAt'])['format']('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x1fc09d['closed']?moment(_0x1fc09d[_0x1d0d('0xdb')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x1d0d('0x91')]():'','disposition':_0x1fc09d[_0x1d0d('0xdc')],'visibility':_0x1fc09d[_0x1d0d('0xdd')]?'Public':_0x1d0d('0xde'),'messages':_(_0x1fc09d[_0x1d0d('0xd2')])[_0x1d0d('0x7b')]({'secret':![]})[_0x1d0d('0x32')](function(_0x5efaa6){if(_0x5efaa6[_0x1d0d('0xd1')]){var _0x339167=path[_0x1d0d('0xc6')](_0x225695,_0x5efaa6['Attachment'][_0x1d0d('0xdf')]);if(fs['existsSync'](_0x339167)){fs[_0x1d0d('0xe0')](_0x339167)[_0x1d0d('0xe1')](fs[_0x1d0d('0xe2')](path[_0x1d0d('0xc6')](_0x840e9b,_0x5efaa6[_0x1d0d('0xd1')][_0x1d0d('0xdf')])));}}return{'date':moment(_0x5efaa6[_0x1d0d('0x70')])['format'](_0x1d0d('0xe3'))[_0x1d0d('0x91')](),'sender':_0x5efaa6[_0x1d0d('0xd3')]==='out'?_0x5efaa6[_0x1d0d('0x67')]?_0x5efaa6['User']['fullname']:_0x1d0d('0xe4'):_0x5efaa6[_0x1d0d('0xce')][_0x1d0d('0xcf')]+(_0x5efaa6[_0x1d0d('0xce')][_0x1d0d('0xd0')]?'\x20'+_0x5efaa6['Contact'][_0x1d0d('0xd0')]:''),'body':_0x5efaa6[_0x1d0d('0xd1')]?_0x5efaa6[_0x1d0d('0xd1')][_0x1d0d('0xdf')]:_0x5efaa6[_0x1d0d('0x6b')],'direction':_0x5efaa6['direction']===_0x1d0d('0xe5')?'A':'C','secret':_0x5efaa6[_0x1d0d('0xd4')],'read':_0x5efaa6[_0x1d0d('0x77')],'attachment':_0x5efaa6[_0x1d0d('0xd1')]};})[_0x1d0d('0x5c')]()};return ejs['renderFile'](path[_0x1d0d('0xc6')](config[_0x1d0d('0xc7')],_0x1d0d('0xc8'),'views',_0x1d0d('0xe6')),{'interaction':_0x3d3628})[_0x1d0d('0x2b')](function(_0x7419d2){var _0x1cf4a1=path[_0x1d0d('0xc6')](_0x840e9b,'transcript-'+_0x1fc09d['id']+'-'+_0x43b2f3+'.pdf');var _0x1956a1={'path':_0x1cf4a1,'channel':_0x1d0d('0xd8'),'interactionId':_0x1fc09d['id']};return pdf['createPdfFromHTML'](_0x7419d2,_0x1956a1);})[_0x1d0d('0x2b')](function(){return new BPromise(function(_0x5f0fba,_0x3670c6){zipdir(_0x840e9b,{'saveTo':_0x3f8c75},function(_0x5b5f51,_0x34aa91){if(_0x5b5f51)return _0x3670c6(_0x5b5f51);return _0x5f0fba(_0x34aa91);});})[_0x1d0d('0x2b')](function(){return new BPromise(function(_0x1cb8fc,_0x3156e5){rimraf(_0x840e9b,function(_0x22b5d1){if(_0x22b5d1)_0x3156e5(_0x22b5d1);return _0x1cb8fc();});});})[_0x1d0d('0x2b')](function(){return _0x5a49b0[_0x1d0d('0xc4')](_0x3f8c75,_0x5dc32f,function(_0x375df5){if(_0x375df5){console[_0x1d0d('0xe7')](_0x1d0d('0xe8'),_0x375df5);}else{fs['unlinkSync'](_0x3f8c75);}});});});}else{return _0x5a49b0[_0x1d0d('0x20')](0xc8);}})['catch'](handleError(_0x5a49b0,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 49ae65f..958a6a0 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 _0x3a5d=['remove','Users','map','findAll','then','unreadMessages','length','emit','hasOwnProperty','hook','exports','events','OpenchannelInteraction','../../mysqldb','save','update'];(function(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0x3a5d,0xab));var _0xd3a5=function(_0x390b0b,_0x52dff6){_0x390b0b=_0x390b0b-0x0;var _0x167608=_0x3a5d[_0x390b0b];return _0x167608;};'use strict';var EventEmitter=require(_0xd3a5('0x0'));var OpenchannelInteraction=require('../../mysqldb')['db'][_0xd3a5('0x1')];var OpenchannelMessage=require(_0xd3a5('0x2'))['db']['OpenchannelMessage'];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd3a5('0x3'),'afterUpdate':_0xd3a5('0x4'),'afterDestroy':_0xd3a5('0x5')};function emitEvent(_0x1f96a7){return function(_0x348813,_0x226930,_0x29ff21){_0x348813['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x260c8e){_0x348813['setDataValue'](_0xd3a5('0x6'),_0x260c8e[_0xd3a5('0x7')](function(_0x4a7243){return{'id':_0x4a7243['id']};}));return OpenchannelMessage[_0xd3a5('0x8')]({'where':{'OpenchannelInteractionId':_0x348813['id'],'direction':'in','read':![]},'raw':!![]});})[_0xd3a5('0x9')](function(_0x4c561b){_0x348813['setDataValue'](_0xd3a5('0xa'),_0x4c561b[_0xd3a5('0xb')]);OpenchannelInteractionEvents[_0xd3a5('0xc')](_0x1f96a7+':'+_0x348813['id'],_0x348813);OpenchannelInteractionEvents[_0xd3a5('0xc')](_0x1f96a7,_0x348813);_0x29ff21(null);})['catch'](_0x29ff21(null));};}for(var e in events){if(events[_0xd3a5('0xd')](e)){var event=events[e];OpenchannelInteraction[_0xd3a5('0xe')](e,emitEvent(event));}}module[_0xd3a5('0xf')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0xece0=['catch','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','save','update','remove','then','setDataValue','findAll','unreadMessages','length','emit'];(function(_0x1342fe,_0x515ab9){var _0x2a7b38=function(_0x49fa8c){while(--_0x49fa8c){_0x1342fe['push'](_0x1342fe['shift']());}};_0x2a7b38(++_0x515ab9);}(_0xece0,0x148));var _0x0ece=function(_0x2bafdc,_0x3e5c3b){_0x2bafdc=_0x2bafdc-0x0;var _0x50ed6b=_0xece0[_0x2bafdc];return _0x50ed6b;};'use strict';var EventEmitter=require(_0x0ece('0x0'));var OpenchannelInteraction=require(_0x0ece('0x1'))['db'][_0x0ece('0x2')];var OpenchannelMessage=require(_0x0ece('0x1'))['db'][_0x0ece('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x0ece('0x4')](0x0);var events={'afterCreate':_0x0ece('0x5'),'afterUpdate':_0x0ece('0x6'),'afterDestroy':_0x0ece('0x7')};function emitEvent(_0x15ef88){return function(_0x200008,_0xf5ffcc,_0x1953b8){_0x200008['getUsers']({'attributes':['id'],'raw':!![]})[_0x0ece('0x8')](function(_0x386b59){_0x200008[_0x0ece('0x9')]('Users',_0x386b59['map'](function(_0x579d69){return{'id':_0x579d69['id']};}));return OpenchannelMessage[_0x0ece('0xa')]({'where':{'OpenchannelInteractionId':_0x200008['id'],'direction':'in','read':![]},'raw':!![]});})[_0x0ece('0x8')](function(_0x4442d7){_0x200008['setDataValue'](_0x0ece('0xb'),_0x4442d7[_0x0ece('0xc')]);OpenchannelInteractionEvents[_0x0ece('0xd')](_0x15ef88+':'+_0x200008['id'],_0x200008);OpenchannelInteractionEvents[_0x0ece('0xd')](_0x15ef88,_0x200008);_0x1953b8(null);})[_0x0ece('0xe')](_0x1953b8(null));};}for(var e in events){if(events[_0x0ece('0xf')](e)){var event=events[e];OpenchannelInteraction[_0x0ece('0x10')](e,emitEvent(event));}}module[_0x0ece('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 695210c..62a1823 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 _0x7f19=['exports','define','OpenchannelInteraction','openchannel_interactions','utf8mb4_unicode_ci','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./openchannelInteraction.attributes'];(function(_0x45a34b,_0x40a5e0){var _0x5b54b4=function(_0x4fdba9){while(--_0x4fdba9){_0x45a34b['push'](_0x45a34b['shift']());}};_0x5b54b4(++_0x40a5e0);}(_0x7f19,0x8e));var _0x97f1=function(_0x2468a7,_0x5e2ab4){_0x2468a7=_0x2468a7-0x0;var _0x42ee58=_0x7f19[_0x2468a7];return _0x42ee58;};'use strict';var _=require(_0x97f1('0x0'));var util=require(_0x97f1('0x1'));var logger=require(_0x97f1('0x2'))(_0x97f1('0x3'));var moment=require(_0x97f1('0x4'));var BPromise=require(_0x97f1('0x5'));var rp=require(_0x97f1('0x6'));var fs=require('fs');var path=require(_0x97f1('0x7'));var rimraf=require(_0x97f1('0x8'));var config=require('../../config/environment');var attributes=require(_0x97f1('0x9'));module[_0x97f1('0xa')]=function(_0x3f0839,_0xa64a6b){return _0x3f0839[_0x97f1('0xb')](_0x97f1('0xc'),attributes,{'tableName':_0x97f1('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x97f1('0xe'),'hooks':{'beforeUpdate':function(_0x5a7908,_0x5ac938,_0x33c46a){if(_0x5a7908[_0x97f1('0xf')](_0x97f1('0x10'))){_0x5a7908['closedAt']=moment()[_0x97f1('0x11')](_0x97f1('0x12'));}_0x33c46a(null,_0x5a7908);}}});}; \ No newline at end of file +var _0xe55d=['openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','changed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','api','moment','bluebird','request-promise','path','rimraf','./openchannelInteraction.attributes','exports','define','OpenchannelInteraction'];(function(_0x277352,_0x665a1a){var _0x32065f=function(_0x566b24){while(--_0x566b24){_0x277352['push'](_0x277352['shift']());}};_0x32065f(++_0x665a1a);}(_0xe55d,0x126));var _0xde55=function(_0x208d4b,_0x29ab0d){_0x208d4b=_0x208d4b-0x0;var _0xee9377=_0xe55d[_0x208d4b];return _0xee9377;};'use strict';var _=require(_0xde55('0x0'));var util=require(_0xde55('0x1'));var logger=require('../../config/logger')(_0xde55('0x2'));var moment=require(_0xde55('0x3'));var BPromise=require(_0xde55('0x4'));var rp=require(_0xde55('0x5'));var fs=require('fs');var path=require(_0xde55('0x6'));var rimraf=require(_0xde55('0x7'));var config=require('../../config/environment');var attributes=require(_0xde55('0x8'));module[_0xde55('0x9')]=function(_0x3b2c0a,_0x55d5fa){return _0x3b2c0a[_0xde55('0xa')](_0xde55('0xb'),attributes,{'tableName':_0xde55('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xde55('0xd'),'collate':_0xde55('0xe'),'hooks':{'beforeUpdate':function(_0x40bad4,_0x51f649,_0x11aa16){if(_0x40bad4[_0xde55('0xf')]('closed')){_0x40bad4['closedAt']=moment()[_0xde55('0x10')](_0xde55('0x11'));}_0x11aa16(null,_0x40bad4);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index 627fb3e..2f90262 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 _0xab61=['AddTags','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./openchannelInteraction.socket','register','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','OpenchannelInteraction','update','body','options','where','attributes','UpdateOpenchannelInteraction','AddTagsToOpenchannelInteraction','find','addTags','ids','omit','spread'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xab61,0x79));var _0x1ab6=function(_0x784768,_0x3d0c75){_0x784768=_0x784768-0x0;var _0x3b76fc=_0xab61[_0x784768];return _0x3b76fc;};'use strict';var _=require(_0x1ab6('0x0'));var util=require('util');var moment=require(_0x1ab6('0x1'));var BPromise=require('bluebird');var rs=require(_0x1ab6('0x2'));var fs=require('fs');var Redis=require(_0x1ab6('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1ab6('0x4'));var logger=require(_0x1ab6('0x5'))(_0x1ab6('0x6'));var config=require(_0x1ab6('0x7'));var jayson=require(_0x1ab6('0x8'));var client=jayson[_0x1ab6('0x9')][_0x1ab6('0xa')]({'port':0x232a});config[_0x1ab6('0xb')]=_['defaults'](config[_0x1ab6('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x1ab6('0xc'))(new Redis(config[_0x1ab6('0xb')]));require(_0x1ab6('0xd'))[_0x1ab6('0xe')](socket);function respondWithRpcPromise(_0x1dbae2,_0x593272,_0x176844){return new BPromise(function(_0xe88306,_0x2e9635){return client['request'](_0x1dbae2,_0x176844)[_0x1ab6('0xf')](function(_0x3cc0bd){logger[_0x1ab6('0x10')](_0x1ab6('0x11'),_0x593272,_0x1ab6('0x12'));logger[_0x1ab6('0x13')](_0x1ab6('0x14'),_0x593272,_0x1ab6('0x12'),JSON[_0x1ab6('0x15')](_0x3cc0bd));if(_0x3cc0bd[_0x1ab6('0x16')]){if(_0x3cc0bd['error'][_0x1ab6('0x17')]===0x1f4){logger['error'](_0x1ab6('0x11'),_0x593272,_0x3cc0bd['error']['message']);return _0x2e9635(_0x3cc0bd[_0x1ab6('0x16')][_0x1ab6('0x18')]);}logger[_0x1ab6('0x16')](_0x1ab6('0x11'),_0x593272,_0x3cc0bd[_0x1ab6('0x16')][_0x1ab6('0x18')]);return _0xe88306(_0x3cc0bd['error'][_0x1ab6('0x18')]);}else{logger[_0x1ab6('0x10')](_0x1ab6('0x11'),_0x593272,'request\x20sent');_0xe88306(_0x3cc0bd['result']['message']);}})[_0x1ab6('0x19')](function(_0x2fb6f7){logger[_0x1ab6('0x16')](_0x1ab6('0x11'),_0x593272,_0x2fb6f7);_0x2e9635(_0x2fb6f7);});});}exports['UpdateOpenchannelInteraction']=function(_0x591048){var _0x446caf=this;return new Promise(function(_0x50d99e,_0x147dbf){return db[_0x1ab6('0x1a')][_0x1ab6('0x1b')](_0x591048[_0x1ab6('0x1c')],{'raw':_0x591048['options']?_0x591048[_0x1ab6('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x591048[_0x1ab6('0x1d')]?_0x591048[_0x1ab6('0x1d')][_0x1ab6('0x1e')]||null:null,'attributes':_0x591048[_0x1ab6('0x1d')]?_0x591048[_0x1ab6('0x1d')][_0x1ab6('0x1f')]||null:null,'limit':_0x591048['options']?_0x591048[_0x1ab6('0x1d')]['limit']||null:null})['then'](function(_0x3e458c){logger[_0x1ab6('0x10')](_0x1ab6('0x20'),_0x591048);logger[_0x1ab6('0x13')]('UpdateOpenchannelInteraction',_0x591048,JSON[_0x1ab6('0x15')](_0x3e458c));_0x50d99e(_0x3e458c);})[_0x1ab6('0x19')](function(_0x53a9c7){logger[_0x1ab6('0x16')](_0x1ab6('0x20'),_0x53a9c7['message'],_0x591048);_0x147dbf(_0x446caf['error'](0x1f4,_0x53a9c7[_0x1ab6('0x18')]));});});};exports[_0x1ab6('0x21')]=function(_0xa0f437){return new Promise(function(_0x27501f,_0x5ceed0){return db['OpenchannelInteraction'][_0x1ab6('0x22')]({'where':_0xa0f437[_0x1ab6('0x1d')]?_0xa0f437[_0x1ab6('0x1d')][_0x1ab6('0x1e')]||null:null})[_0x1ab6('0xf')](function(_0x5d17ce){if(_0x5d17ce){return _0x5d17ce[_0x1ab6('0x23')](_0xa0f437[_0x1ab6('0x1c')][_0x1ab6('0x24')],_[_0x1ab6('0x25')](_0xa0f437[_0x1ab6('0x1c')],[_0x1ab6('0x24'),'id'])||{});}})[_0x1ab6('0x26')](function(_0x552b51){logger[_0x1ab6('0x10')]('AddTags',_0xa0f437);logger[_0x1ab6('0x13')](_0x1ab6('0x27'),_0xa0f437,JSON[_0x1ab6('0x15')](_0x552b51));_0x27501f(_0x552b51);})[_0x1ab6('0x19')](function(_0x538308){logger[_0x1ab6('0x16')](_0x1ab6('0x27'),_0x538308[_0x1ab6('0x18')],_0xa0f437);_0x5ceed0(_this[_0x1ab6('0x16')](0x1f4,_0x538308[_0x1ab6('0x18')]));});});}; \ No newline at end of file +var _0x1c75=['register','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options','raw','where','attributes','limit','AddTagsToOpenchannelInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','defaults','socket.io-emitter'];(function(_0x3b6453,_0xcc7a50){var _0x28879f=function(_0xa30ae7){while(--_0xa30ae7){_0x3b6453['push'](_0x3b6453['shift']());}};_0x28879f(++_0xcc7a50);}(_0x1c75,0x98));var _0x51c7=function(_0x4c0155,_0x5b20db){_0x4c0155=_0x4c0155-0x0;var _0x1276db=_0x1c75[_0x4c0155];return _0x1276db;};'use strict';var _=require(_0x51c7('0x0'));var util=require(_0x51c7('0x1'));var moment=require('moment');var BPromise=require(_0x51c7('0x2'));var rs=require(_0x51c7('0x3'));var fs=require('fs');var Redis=require(_0x51c7('0x4'));var db=require(_0x51c7('0x5'))['db'];var utils=require(_0x51c7('0x6'));var logger=require('../../config/logger')(_0x51c7('0x7'));var config=require(_0x51c7('0x8'));var jayson=require(_0x51c7('0x9'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x51c7('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x51c7('0xb'))(new Redis(config['redis']));require('./openchannelInteraction.socket')[_0x51c7('0xc')](socket);function respondWithRpcPromise(_0x407996,_0x34994a,_0x3546a6){return new BPromise(function(_0x438da7,_0x324562){return client['request'](_0x407996,_0x3546a6)[_0x51c7('0xd')](function(_0x7c33f6){logger[_0x51c7('0xe')](_0x51c7('0xf'),_0x34994a,_0x51c7('0x10'));logger[_0x51c7('0x11')](_0x51c7('0x12'),_0x34994a,_0x51c7('0x10'),JSON[_0x51c7('0x13')](_0x7c33f6));if(_0x7c33f6[_0x51c7('0x14')]){if(_0x7c33f6['error'][_0x51c7('0x15')]===0x1f4){logger[_0x51c7('0x14')](_0x51c7('0xf'),_0x34994a,_0x7c33f6['error']['message']);return _0x324562(_0x7c33f6[_0x51c7('0x14')][_0x51c7('0x16')]);}logger[_0x51c7('0x14')](_0x51c7('0xf'),_0x34994a,_0x7c33f6[_0x51c7('0x14')][_0x51c7('0x16')]);return _0x438da7(_0x7c33f6['error']['message']);}else{logger[_0x51c7('0xe')](_0x51c7('0xf'),_0x34994a,_0x51c7('0x10'));_0x438da7(_0x7c33f6[_0x51c7('0x17')][_0x51c7('0x16')]);}})[_0x51c7('0x18')](function(_0x1cac25){logger[_0x51c7('0x14')](_0x51c7('0xf'),_0x34994a,_0x1cac25);_0x324562(_0x1cac25);});});}exports[_0x51c7('0x19')]=function(_0x17941c){var _0x447804=this;return new Promise(function(_0x340527,_0x5ee0f2){return db[_0x51c7('0x1a')][_0x51c7('0x1b')](_0x17941c[_0x51c7('0x1c')],{'raw':_0x17941c[_0x51c7('0x1d')]?_0x17941c[_0x51c7('0x1d')][_0x51c7('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x17941c[_0x51c7('0x1d')]?_0x17941c[_0x51c7('0x1d')][_0x51c7('0x1f')]||null:null,'attributes':_0x17941c['options']?_0x17941c[_0x51c7('0x1d')][_0x51c7('0x20')]||null:null,'limit':_0x17941c[_0x51c7('0x1d')]?_0x17941c[_0x51c7('0x1d')][_0x51c7('0x21')]||null:null})['then'](function(_0x185b6a){logger[_0x51c7('0xe')]('UpdateOpenchannelInteraction',_0x17941c);logger[_0x51c7('0x11')](_0x51c7('0x19'),_0x17941c,JSON[_0x51c7('0x13')](_0x185b6a));_0x340527(_0x185b6a);})[_0x51c7('0x18')](function(_0x18ebae){logger['error'](_0x51c7('0x19'),_0x18ebae[_0x51c7('0x16')],_0x17941c);_0x5ee0f2(_0x447804[_0x51c7('0x14')](0x1f4,_0x18ebae[_0x51c7('0x16')]));});});};exports[_0x51c7('0x22')]=function(_0x2ea386){return new Promise(function(_0x378469,_0x481461){return db[_0x51c7('0x1a')][_0x51c7('0x23')]({'where':_0x2ea386['options']?_0x2ea386[_0x51c7('0x1d')][_0x51c7('0x1f')]||null:null})[_0x51c7('0xd')](function(_0x3992ba){if(_0x3992ba){return _0x3992ba[_0x51c7('0x24')](_0x2ea386[_0x51c7('0x1c')][_0x51c7('0x25')],_[_0x51c7('0x26')](_0x2ea386[_0x51c7('0x1c')],[_0x51c7('0x25'),'id'])||{});}})[_0x51c7('0x27')](function(_0x4c359e){logger['info'](_0x51c7('0x28'),_0x2ea386);logger[_0x51c7('0x11')]('AddTags',_0x2ea386,JSON['stringify'](_0x4c359e));_0x378469(_0x4c359e);})[_0x51c7('0x18')](function(_0x45ff6f){logger[_0x51c7('0x14')](_0x51c7('0x28'),_0x45ff6f[_0x51c7('0x16')],_0x2ea386);_0x481461(_this[_0x51c7('0x14')](0x1f4,_0x45ff6f[_0x51c7('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index 0e0c757..7d49d51 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 _0x6546=['./openchannelInteraction.events','save','remove','update','emit','removeListener','register','openchannelInteraction:'];(function(_0x38c632,_0x14e8e6){var _0x12737e=function(_0x3e0fe4){while(--_0x3e0fe4){_0x38c632['push'](_0x38c632['shift']());}};_0x12737e(++_0x14e8e6);}(_0x6546,0x118));var _0x6654=function(_0x2abeff,_0x4c3bfb){_0x2abeff=_0x2abeff-0x0;var _0x35bd24=_0x6546[_0x2abeff];return _0x35bd24;};'use strict';var OpenchannelInteractionEvents=require(_0x6654('0x0'));var events=[_0x6654('0x1'),_0x6654('0x2'),_0x6654('0x3')];function createListener(_0x5d45db,_0xe84b18){return function(_0x3405d7){_0xe84b18[_0x6654('0x4')](_0x5d45db,_0x3405d7);};}function removeListener(_0xf4cdb3,_0x42ee90){return function(){OpenchannelInteractionEvents[_0x6654('0x5')](_0xf4cdb3,_0x42ee90);};}exports[_0x6654('0x6')]=function(_0x401567){for(var _0x212d34=0x0,_0x11ff1f=events['length'];_0x212d34<_0x11ff1f;_0x212d34++){var _0x2d03b0=events[_0x212d34];var _0x2e3510=createListener(_0x6654('0x7')+_0x2d03b0,_0x401567);OpenchannelInteractionEvents['on'](_0x2d03b0,_0x2e3510);}}; \ No newline at end of file +var _0x02fb=['length','openchannelInteraction:','./openchannelInteraction.events','remove','emit','removeListener','register'];(function(_0x1e8934,_0x2f41b3){var _0x4bb2c5=function(_0x4e4944){while(--_0x4e4944){_0x1e8934['push'](_0x1e8934['shift']());}};_0x4bb2c5(++_0x2f41b3);}(_0x02fb,0x159));var _0xb02f=function(_0x34e823,_0x517158){_0x34e823=_0x34e823-0x0;var _0x1819b4=_0x02fb[_0x34e823];return _0x1819b4;};'use strict';var OpenchannelInteractionEvents=require(_0xb02f('0x0'));var events=['save',_0xb02f('0x1'),'update'];function createListener(_0x2ef22d,_0x50a057){return function(_0x278e4f){_0x50a057[_0xb02f('0x2')](_0x2ef22d,_0x278e4f);};}function removeListener(_0x5ba26f,_0x337834){return function(){OpenchannelInteractionEvents[_0xb02f('0x3')](_0x5ba26f,_0x337834);};}exports[_0xb02f('0x4')]=function(_0x183f91){for(var _0x3c3e1e=0x0,_0x367647=events[_0xb02f('0x5')];_0x3c3e1e<_0x367647;_0x3c3e1e++){var _0x15e0b9=events[_0x3c3e1e];var _0x305b3e=createListener(_0xb02f('0x6')+_0x15e0b9,_0x183f91);OpenchannelInteractionEvents['on'](_0x15e0b9,_0x305b3e);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index db70530..7feced5 100644 --- a/server/api/openchannelMessage/index.js +++ b/server/api/openchannelMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','tracked','openchannel','openchannelmessage:create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','util'];(function(_0x185d8f,_0x16b7f1){var _0x39072b=function(_0x188220){while(--_0x188220){_0x185d8f['push'](_0x185d8f['shift']());}};_0x39072b(++_0x16b7f1);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./openchannelMessage.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),interaction[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x0d8b('0x10')),controller['create']);router[_0x0d8b('0x11')]('/:id',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x12')]);router[_0x0d8b('0x11')](_0x0d8b('0x13'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x14')]);router[_0x0d8b('0x11')](_0x0d8b('0x15'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x16')]);router[_0x0d8b('0x17')](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x18')]);module['exports']=router; \ No newline at end of file +var _0x70e0=['put','update','/:id/accept','accept','destroy','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelMessage.controller','isAuthenticated','describe','get','/:id','show','post','openchannel','openchannelmessage:create','create'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x70e0,0x17b));var _0x070e=function(_0x241819,_0x156f0d){_0x241819=_0x241819-0x0;var _0x1147e4=_0x70e0[_0x241819];return _0x1147e4;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');var controller=require(_0x070e('0x7'));router['get']('/',auth[_0x070e('0x8')](),controller['index']);router['get']('/describe',auth[_0x070e('0x8')](),controller[_0x070e('0x9')]);router[_0x070e('0xa')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0xc')]);router[_0x070e('0xd')]('/',auth['isAuthenticated'](),interaction['tracked'](_0x070e('0xe'),_0x070e('0xf')),controller[_0x070e('0x10')]);router[_0x070e('0x11')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0x12')]);router[_0x070e('0x11')](_0x070e('0x13'),auth[_0x070e('0x8')](),controller[_0x070e('0x14')]);router['put']('/:id/reject',auth[_0x070e('0x8')](),controller['reject']);router['delete']('/:id',auth[_0x070e('0x8')](),controller[_0x070e('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index eb9d865..e775765 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 _0x0647=['medium','BOOLEAN','ENUM','DATE','STRING','sequelize','TEXT'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x0647,0xd0));var _0x7064=function(_0x35d8af,_0x14fd75){_0x35d8af=_0x35d8af-0x0;var _0x1d08b0=_0x0647[_0x35d8af];return _0x1d08b0;};'use strict';var Sequelize=require(_0x7064('0x0'));module['exports']={'body':{'type':Sequelize[_0x7064('0x1')](_0x7064('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x7064('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x7064('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x7064('0x4')]('in','out'),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x7064('0x5')]},'providerName':{'type':Sequelize[_0x7064('0x6')]},'providerResponse':{'type':Sequelize[_0x7064('0x1')]}}; \ No newline at end of file +var _0x915a=['DATE','STRING','sequelize','exports','TEXT','medium','BOOLEAN','ENUM'];(function(_0x542d43,_0x40b0e2){var _0x930303=function(_0x11cfce){while(--_0x11cfce){_0x542d43['push'](_0x542d43['shift']());}};_0x930303(++_0x40b0e2);}(_0x915a,0x1d2));var _0xa915=function(_0xa0a958,_0x3d3a50){_0xa0a958=_0xa0a958-0x0;var _0x5ccbc1=_0x915a[_0xa0a958];return _0x5ccbc1;};'use strict';var Sequelize=require(_0xa915('0x0'));module[_0xa915('0x1')]={'body':{'type':Sequelize[_0xa915('0x2')](_0xa915('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xa915('0x4')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xa915('0x5')]('in','out'),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0xa915('0x6')]},'providerName':{'type':Sequelize[_0xa915('0x7')]},'providerResponse':{'type':Sequelize[_0xa915('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index 8fca236..6acbef2 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 _0x5309=['UserId','user','agent','find','get','OpenchannelInteraction','read1stAt','format','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','acceptMessage','sequelize','Sequelize','SELECT','contact','User','fullname','interface','channel','acceptmessage','OpenchannelInteractionId','null','RejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','QueryTypes','email','internal','SIP/%s','motionChannel','EventManager','rejectmessage','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','client','http','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','sendStatus','status','offset','undefined','count','limit','set','json','apply','reject','save','destroy','end','stack','name','send','index','map','OpenchannelMessage','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','merge','filter','options','includeAll','findAll','rows','catch','show','params','create','update','body','describe','openchannel-interactions','accept','openchannel','read','readAt','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x3affe2,_0x116968){var _0x4470f6=function(_0x64b626){while(--_0x64b626){_0x3affe2['push'](_0x3affe2['shift']());}};_0x4470f6(++_0x116968);}(_0x5309,0x125));var _0x9530=function(_0xdd827a,_0x482ad2){_0xdd827a=_0xdd827a-0x0;var _0x2f46f1=_0x5309[_0xdd827a];return _0x2f46f1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9530('0x0'));var zipdir=require(_0x9530('0x1'));var jsonpatch=require(_0x9530('0x2'));var rp=require(_0x9530('0x3'));var moment=require(_0x9530('0x4'));var BPromise=require(_0x9530('0x5'));var Mustache=require(_0x9530('0x6'));var util=require('util');var path=require('path');var sox=require(_0x9530('0x7'));var csv=require(_0x9530('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9530('0x9'));var _=require(_0x9530('0xa'));var squel=require(_0x9530('0xb'));var crypto=require(_0x9530('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x9530('0xd'));var toCsv=require('to-csv');var querystring=require(_0x9530('0xe'));var Papa=require(_0x9530('0xf'));var Redis=require(_0x9530('0x10'));var authService=require(_0x9530('0x11'));var qs=require(_0x9530('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9530('0x13'));var logger=require(_0x9530('0x14'))(_0x9530('0x15'));var utils=require('../../config/utils');var config=require(_0x9530('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x9530('0x17'))['db'];config[_0x9530('0x18')]=_[_0x9530('0x19')](config['redis'],{'host':_0x9530('0x1a'),'port':0x18eb});var socket=require(_0x9530('0x1b'))(new Redis(config[_0x9530('0x18')]));require(_0x9530('0x1c'))[_0x9530('0x1d')](socket);var jayson=require(_0x9530('0x1e'));var client=jayson[_0x9530('0x1f')][_0x9530('0x20')]({'port':0x232c});var client9002=jayson['client'][_0x9530('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x2df9a1,_0x3d3906,_0x4fa991,_0x3933b2){return new BPromise(function(_0x29ec4d,_0x23af5e){var _0x58abb8=_0x3933b2||client;return _0x58abb8[_0x9530('0x21')](_0x2df9a1,_0x4fa991)[_0x9530('0x22')](function(_0xee0efb){logger[_0x9530('0x23')](_0x9530('0x24'),_0x3d3906,_0x9530('0x25'));logger[_0x9530('0x26')](_0x9530('0x27'),_0x3d3906,_0x9530('0x25'),JSON[_0x9530('0x28')](_0xee0efb));if(_0xee0efb['error']){if(_0xee0efb['error']['code']===0x1f4){logger[_0x9530('0x29')](_0x9530('0x24'),_0x3d3906,_0xee0efb[_0x9530('0x29')]['message']);return _0x23af5e(_0xee0efb[_0x9530('0x29')][_0x9530('0x2a')]);}logger[_0x9530('0x29')](_0x9530('0x24'),_0x3d3906,_0xee0efb[_0x9530('0x29')]['message']);return _0x29ec4d(_0xee0efb[_0x9530('0x29')][_0x9530('0x2a')]);}else{logger['info'](_0x9530('0x24'),_0x3d3906,'request\x20sent');_0x29ec4d(_0xee0efb[_0x9530('0x2b')][_0x9530('0x2a')]);}})['catch'](function(_0x2121c0){logger['error'](_0x9530('0x24'),_0x3d3906,_0x2121c0);_0x23af5e(_0x2121c0);});});}function respondWithStatusCode(_0x582930,_0x4ff6f5){_0x4ff6f5=_0x4ff6f5||0xcc;return function(_0x592d7b){if(_0x592d7b){return _0x582930[_0x9530('0x2c')](_0x4ff6f5);}return _0x582930[_0x9530('0x2d')](_0x4ff6f5)['end']();};}function respondWithResult(_0xd1caeb,_0x3679e){_0x3679e=_0x3679e||0xc8;return function(_0x1e6b68){if(_0x1e6b68){return _0xd1caeb[_0x9530('0x2d')](_0x3679e)['json'](_0x1e6b68);}};}function respondWithFilteredResult(_0x29489f,_0x13c4b8){return function(_0x3e5e1f){if(_0x3e5e1f){var _0x371d89=typeof _0x13c4b8[_0x9530('0x2e')]===_0x9530('0x2f')&&typeof _0x13c4b8['limit']===_0x9530('0x2f');var _0x21e961=_0x3e5e1f[_0x9530('0x30')];var _0x480e7f=_0x371d89?0x0:_0x13c4b8[_0x9530('0x2e')];var _0x5af477=_0x371d89?_0x3e5e1f[_0x9530('0x30')]:_0x13c4b8[_0x9530('0x2e')]+_0x13c4b8[_0x9530('0x31')];var _0x1868de;if(_0x5af477>=_0x21e961){_0x5af477=_0x21e961;_0x1868de=0xc8;}else{_0x1868de=0xce;}_0x29489f[_0x9530('0x2d')](_0x1868de);return _0x29489f[_0x9530('0x32')]('Content-Range',_0x480e7f+'-'+_0x5af477+'/'+_0x21e961)[_0x9530('0x33')](_0x3e5e1f);}return null;};}function patchUpdates(_0x24fa25){return function(_0x3458aa){try{jsonpatch[_0x9530('0x34')](_0x3458aa,_0x24fa25,!![]);}catch(_0x57e1ae){return BPromise[_0x9530('0x35')](_0x57e1ae);}return _0x3458aa[_0x9530('0x36')]();};}function saveUpdates(_0x487dff,_0x329de1){return function(_0x28db4a){if(_0x28db4a){return _0x28db4a['update'](_0x487dff)[_0x9530('0x22')](function(_0x2b0f49){return _0x2b0f49;});}return null;};}function removeEntity(_0xf7bea3,_0x51826d){return function(_0x582c2d){if(_0x582c2d){return _0x582c2d[_0x9530('0x37')]()[_0x9530('0x22')](function(){_0xf7bea3['status'](0xcc)[_0x9530('0x38')]();});}};}function handleEntityNotFound(_0x1337fc,_0x7e91f8){return function(_0x331301){if(!_0x331301){_0x1337fc[_0x9530('0x2c')](0x194);}return _0x331301;};}function handleError(_0x35725a,_0x1ca932){_0x1ca932=_0x1ca932||0x1f4;return function(_0x2675f6){logger['error'](_0x2675f6[_0x9530('0x39')]);if(_0x2675f6[_0x9530('0x3a')]){delete _0x2675f6[_0x9530('0x3a')];}_0x35725a[_0x9530('0x2d')](_0x1ca932)[_0x9530('0x3b')](_0x2675f6);};}exports[_0x9530('0x3c')]=function(_0x351fad,_0x3f01a7){var _0x3a6b42={},_0x20b865={},_0x53e945={'count':0x0,'rows':[]};var _0x43dd47=_[_0x9530('0x3d')](db[_0x9530('0x3e')][_0x9530('0x3f')],function(_0x44c99c){return{'name':_0x44c99c['fieldName'],'type':_0x44c99c[_0x9530('0x40')][_0x9530('0x41')]};});_0x20b865[_0x9530('0x42')]=_[_0x9530('0x3d')](_0x43dd47,_0x9530('0x3a'));_0x20b865[_0x9530('0x43')]=_[_0x9530('0x44')](_0x351fad['query']);_0x20b865[_0x9530('0x45')]=_[_0x9530('0x46')](_0x20b865['model'],_0x20b865[_0x9530('0x43')]);_0x3a6b42[_0x9530('0x47')]=_['intersection'](_0x20b865['model'],qs[_0x9530('0x48')](_0x351fad[_0x9530('0x43')][_0x9530('0x48')]));_0x3a6b42['attributes']=_0x3a6b42['attributes'][_0x9530('0x49')]?_0x3a6b42[_0x9530('0x47')]:_0x20b865[_0x9530('0x42')];if(!_0x351fad[_0x9530('0x43')]['hasOwnProperty']('nolimit')){_0x3a6b42[_0x9530('0x31')]=qs['limit'](_0x351fad['query'][_0x9530('0x31')]);_0x3a6b42[_0x9530('0x2e')]=qs[_0x9530('0x2e')](_0x351fad[_0x9530('0x43')]['offset']);}_0x3a6b42[_0x9530('0x4a')]=qs['sort'](_0x351fad[_0x9530('0x43')][_0x9530('0x4b')]);_0x3a6b42[_0x9530('0x4c')]=qs[_0x9530('0x45')](_[_0x9530('0x4d')](_0x351fad[_0x9530('0x43')],_0x20b865['filters']),_0x43dd47);if(_0x351fad[_0x9530('0x43')]['filter']){_0x3a6b42['where']=_[_0x9530('0x4e')](_0x3a6b42[_0x9530('0x4c')],{'$or':_[_0x9530('0x3d')](_0x43dd47,function(_0x1966ea){if(_0x1966ea[_0x9530('0x40')]!=='VIRTUAL'){var _0x1b6cda={};_0x1b6cda[_0x1966ea['name']]={'$like':'%'+_0x351fad[_0x9530('0x43')][_0x9530('0x4f')]+'%'};return _0x1b6cda;}})});}_0x3a6b42=_['merge']({},_0x3a6b42,_0x351fad[_0x9530('0x50')]);var _0x4f816b={'where':_0x3a6b42[_0x9530('0x4c')]};return db[_0x9530('0x3e')][_0x9530('0x30')](_0x4f816b)[_0x9530('0x22')](function(_0x42cf41){_0x53e945['count']=_0x42cf41;if(_0x351fad[_0x9530('0x43')][_0x9530('0x51')]){_0x3a6b42['include']=[{'all':!![]}];}return db[_0x9530('0x3e')][_0x9530('0x52')](_0x3a6b42);})[_0x9530('0x22')](function(_0xa4d609){_0x53e945[_0x9530('0x53')]=_0xa4d609;return _0x53e945;})[_0x9530('0x22')](respondWithFilteredResult(_0x3f01a7,_0x3a6b42))[_0x9530('0x54')](handleError(_0x3f01a7,null));};exports[_0x9530('0x55')]=function(_0x55a133,_0x2e05e1){var _0x361425={'raw':!![],'where':{'id':_0x55a133[_0x9530('0x56')]['id']}},_0x1379cf={};_0x1379cf[_0x9530('0x42')]=_['keys'](db[_0x9530('0x3e')][_0x9530('0x3f')]);_0x1379cf[_0x9530('0x43')]=_[_0x9530('0x44')](_0x55a133['query']);_0x1379cf[_0x9530('0x45')]=_[_0x9530('0x46')](_0x1379cf[_0x9530('0x42')],_0x1379cf['query']);_0x361425[_0x9530('0x47')]=_['intersection'](_0x1379cf[_0x9530('0x42')],qs[_0x9530('0x48')](_0x55a133[_0x9530('0x43')]['fields']));_0x361425[_0x9530('0x47')]=_0x361425[_0x9530('0x47')]['length']?_0x361425[_0x9530('0x47')]:_0x1379cf['model'];if(_0x55a133['query']['includeAll']){_0x361425['include']=[{'all':!![]}];}_0x361425=_[_0x9530('0x4e')]({},_0x361425,_0x55a133['options']);return db[_0x9530('0x3e')]['find'](_0x361425)[_0x9530('0x22')](handleEntityNotFound(_0x2e05e1,null))[_0x9530('0x22')](respondWithResult(_0x2e05e1,null))[_0x9530('0x54')](handleError(_0x2e05e1,null));};exports[_0x9530('0x57')]=function(_0xff871a,_0x2a7c17){return db[_0x9530('0x3e')]['create'](_0xff871a['body'],{})['then'](respondWithResult(_0x2a7c17,0xc9))[_0x9530('0x54')](handleError(_0x2a7c17,null));};exports[_0x9530('0x58')]=function(_0x3b7369,_0x414437){if(_0x3b7369[_0x9530('0x59')]['id']){delete _0x3b7369[_0x9530('0x59')]['id'];}return db[_0x9530('0x3e')]['find']({'where':{'id':_0x3b7369[_0x9530('0x56')]['id']}})[_0x9530('0x22')](handleEntityNotFound(_0x414437,null))[_0x9530('0x22')](saveUpdates(_0x3b7369['body'],null))[_0x9530('0x22')](respondWithResult(_0x414437,null))[_0x9530('0x54')](handleError(_0x414437,null));};exports[_0x9530('0x37')]=function(_0x3be263,_0x41d0c6){return db[_0x9530('0x3e')]['find']({'where':{'id':_0x3be263[_0x9530('0x56')]['id']}})[_0x9530('0x22')](handleEntityNotFound(_0x41d0c6,null))[_0x9530('0x22')](removeEntity(_0x41d0c6,null))['catch'](handleError(_0x41d0c6,null));};exports['describe']=function(_0xbfe260,_0xc30f9a){return db[_0x9530('0x3e')][_0x9530('0x5a')]()[_0x9530('0x22')](respondWithResult(_0xc30f9a,null))[_0x9530('0x54')](handleError(_0xc30f9a,null));};var interaction_log=require('../../config/logger')(_0x9530('0x5b'));exports[_0x9530('0x5c')]=function(_0x439b2a,_0x57b8ca,_0x6aee55){var _0x5f4e44={'agent':{},'channel':_0x9530('0x5d')};if(_0x439b2a['body']['id']){delete _0x439b2a[_0x9530('0x59')]['id'];}_0x439b2a[_0x9530('0x59')][_0x9530('0x5e')]=!![];_0x439b2a[_0x9530('0x59')][_0x9530('0x5f')]=moment()['format'](_0x9530('0x60'));_0x439b2a[_0x9530('0x59')][_0x9530('0x61')]=_0x439b2a[_0x9530('0x59')][_0x9530('0x61')]||_0x439b2a[_0x9530('0x62')]['id'];_0x5f4e44[_0x9530('0x63')]['id']=_0x439b2a[_0x9530('0x59')][_0x9530('0x61')];return db[_0x9530('0x3e')][_0x9530('0x64')]({'where':{'id':_0x439b2a['params']['id'],'UserId':null}})[_0x9530('0x22')](handleEntityNotFound(_0x57b8ca,null))[_0x9530('0x22')](saveUpdates(_0x439b2a['body'],null))[_0x9530('0x22')](function(_0x2cdaf2){if(_0x2cdaf2){_0x5f4e44[_0x9530('0x2a')]=_0x2cdaf2[_0x9530('0x65')]({'plain':!![]});return db[_0x9530('0x66')][_0x9530('0x64')]({'where':{'id':_0x2cdaf2['OpenchannelInteractionId']}});}return null;})[_0x9530('0x22')](handleEntityNotFound(_0x57b8ca,null))[_0x9530('0x22')](function(_0x29c548){if(_0x29c548){return _0x29c548[_0x9530('0x58')]({'UserId':_0x439b2a[_0x9530('0x59')][_0x9530('0x61')],'read1stAt':_['isNil'](_0x29c548[_0x9530('0x67')])?moment()[_0x9530('0x68')](_0x9530('0x60')):undefined});}return null;})[_0x9530('0x22')](function(_0x64fe49){if(_0x64fe49){_0x5f4e44[_0x9530('0x69')]=_0x64fe49['get']({'plain':!![]});interaction_log[_0x9530('0x23')](_0x9530('0x6a'),_0x439b2a[_0x9530('0x62')]['id'],_0x439b2a[_0x9530('0x62')][_0x9530('0x3a')],_0x439b2a['user'][_0x9530('0x6b')],_0x5f4e44[_0x9530('0x69')]['id'],_0x439b2a[_0x9530('0x59')]?JSON[_0x9530('0x28')](_0x439b2a[_0x9530('0x59')]):'null');return respondWithRpcPromise('AcceptMessage',_0x9530('0x6c'),_0x5f4e44);}return null;})[_0x9530('0x22')](function(_0x28e30e){var _0x6cbacb='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x28e30e[_0x9530('0x2a')]['ContactId'];return db[_0x9530('0x6d')][_0x9530('0x43')](_0x6cbacb,{'type':db[_0x9530('0x6e')]['QueryTypes'][_0x9530('0x6f')],'raw':!![]})['then'](function(_0x155cf5){return _0x155cf5;});})[_0x9530('0x22')](function(_0x3d8596){if(_0x3d8596){_0x5f4e44[_0x9530('0x2a')][_0x9530('0x70')]=_0x3d8596[0x0];if(!_0x439b2a[_0x9530('0x59')]['UserId'])return;return db[_0x9530('0x71')][_0x9530('0x64')]({'where':{'id':_0x439b2a['body'][_0x9530('0x61')],'role':_0x9530('0x63')},'attributes':['id',_0x9530('0x3a'),_0x9530('0x72'),'email','internal'],'raw':!![]});}return null;})['then'](function(_0x343723){if(!_0x343723)return null;_0x5f4e44[_0x9530('0x2a')][_0x9530('0x63')]=_0x343723;return _0x5f4e44;})[_0x9530('0x22')](function(_0x229922){if(_0x229922){if(_0x439b2a['body']['manual']){_0x5f4e44[_0x9530('0x2a')][_0x9530('0x73')]=util[_0x9530('0x68')]('SIP/%s',_0x439b2a[_0x9530('0x62')][_0x9530('0x3a')]);_0x5f4e44['message'][_0x9530('0x74')]=_0x5f4e44[_0x9530('0x74')];_0x5f4e44[_0x9530('0x2a')]['motionChannel']=_0x5f4e44[_0x9530('0x74')];_0x5f4e44[_0x9530('0x2a')]['event']=_0x9530('0x5c');return respondWithRpcPromise('EventManager','EventManager',{'event':_0x9530('0x75'),'message':_0x5f4e44[_0x9530('0x2a')]},client9002)[_0x9530('0x22')](function(){return _0x5f4e44;});}return _0x5f4e44;}return null;})['then'](respondWithResult(_0x57b8ca,null))[_0x9530('0x54')](handleError(_0x57b8ca,null));};var interaction_log=require(_0x9530('0x14'))('openchannel-interactions');exports[_0x9530('0x35')]=function(_0xe4e54a,_0x18aeeb,_0x1a505b){var _0x49f332={'agent':{},'channel':_0x9530('0x5d')};if(_0xe4e54a[_0x9530('0x59')]['id']){delete _0xe4e54a[_0x9530('0x59')]['id'];}_0xe4e54a[_0x9530('0x59')][_0x9530('0x61')]=_0xe4e54a['body'][_0x9530('0x61')]||_0xe4e54a[_0x9530('0x62')]['id'];_0x49f332[_0x9530('0x63')]['id']=_0xe4e54a['body']['UserId'];return db[_0x9530('0x3e')][_0x9530('0x64')]({'where':{'id':_0xe4e54a[_0x9530('0x56')]['id'],'UserId':null}})[_0x9530('0x22')](handleEntityNotFound(_0x18aeeb,null))[_0x9530('0x22')](function(_0x1369b){if(_0x1369b){_0x49f332[_0x9530('0x2a')]=_0x1369b[_0x9530('0x65')]({'plain':!![]});return db[_0x9530('0x66')][_0x9530('0x64')]({'where':{'id':_0x1369b[_0x9530('0x76')]}});}return null;})['then'](handleEntityNotFound(_0x18aeeb,null))[_0x9530('0x22')](function(_0x59dac3){if(_0x59dac3){_0x49f332[_0x9530('0x69')]=_0x59dac3['get']({'plain':!![]});interaction_log[_0x9530('0x23')]('[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0xe4e54a[_0x9530('0x62')]['id'],_0xe4e54a[_0x9530('0x62')]['name'],_0xe4e54a['user'][_0x9530('0x6b')],_0x49f332['interaction']['id'],_0xe4e54a[_0x9530('0x59')]?JSON['stringify'](_0xe4e54a['body']):_0x9530('0x77'));return respondWithRpcPromise(_0x9530('0x78'),'rejectMessage',_0x49f332);}return null;})[_0x9530('0x22')](function(_0x15d20c){var _0x24c241=_0x9530('0x79')+_0x15d20c['message'][_0x9530('0x7a')];return db[_0x9530('0x6d')]['query'](_0x24c241,{'type':db[_0x9530('0x6e')][_0x9530('0x7b')][_0x9530('0x6f')],'raw':!![]})[_0x9530('0x22')](function(_0x7156a0){return _0x7156a0;});})[_0x9530('0x22')](function(_0x535af5){if(_0x535af5){_0x49f332[_0x9530('0x2a')]['contact']=_0x535af5[0x0];if(!_0xe4e54a[_0x9530('0x59')]['UserId'])return;return db['User']['find']({'where':{'id':_0xe4e54a[_0x9530('0x59')][_0x9530('0x61')],'role':_0x9530('0x63')},'attributes':['id',_0x9530('0x3a'),_0x9530('0x72'),_0x9530('0x7c'),_0x9530('0x7d')],'raw':!![]});}return null;})['then'](function(_0xbe6a0){if(!_0xbe6a0)return null;_0x49f332[_0x9530('0x2a')][_0x9530('0x63')]=_0xbe6a0;return _0x49f332;})[_0x9530('0x22')](function(_0x19ee17){if(_0x19ee17){_0x19ee17[_0x9530('0x2a')]['interface']=util[_0x9530('0x68')](_0x9530('0x7e'),_0xe4e54a['user'][_0x9530('0x3a')]);_0x19ee17['message'][_0x9530('0x74')]=_0x49f332[_0x9530('0x74')];_0x19ee17[_0x9530('0x2a')][_0x9530('0x7f')]=_0x49f332[_0x9530('0x74')];_0x19ee17[_0x9530('0x2a')]['event']=_0x9530('0x35');respondWithRpcPromise(_0x9530('0x80'),_0x9530('0x80'),{'event':_0x9530('0x81'),'message':_0x19ee17[_0x9530('0x2a')]},client9002);return _0x49f332;}return null;})[_0x9530('0x22')](respondWithResult(_0x18aeeb,null))[_0x9530('0x54')](handleError(_0x18aeeb,null));}; \ No newline at end of file +var _0xaa36=['fields','hasOwnProperty','nolimit','sort','pick','where','VIRTUAL','merge','options','includeAll','include','show','params','model','keys','rawAttributes','length','find','create','body','update','describe','openchannel-interactions','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','OpenchannelInteraction','isNil','read1stAt','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','contact','fullname','email','internal','manual','interface','channel','event','acceptmessage','openchannel','get','OpenchannelInteractionId','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','Sequelize','User','SIP/%s','EventManager','rejectmessage','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','client','http','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','destroy','name','send','index','OpenchannelMessage','fieldName','type','key','map','query','filters','attributes','intersection'];(function(_0x138fbf,_0x1068fa){var _0x86e835=function(_0x5d2c80){while(--_0x5d2c80){_0x138fbf['push'](_0x138fbf['shift']());}};_0x86e835(++_0x1068fa);}(_0xaa36,0xc7));var _0x6aa3=function(_0x74d219,_0xc27d5a){_0x74d219=_0x74d219-0x0;var _0x38d652=_0xaa36[_0x74d219];return _0x38d652;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6aa3('0x0'));var zipdir=require(_0x6aa3('0x1'));var jsonpatch=require(_0x6aa3('0x2'));var rp=require(_0x6aa3('0x3'));var moment=require(_0x6aa3('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x6aa3('0x5'));var util=require('util');var path=require(_0x6aa3('0x6'));var sox=require('sox');var csv=require(_0x6aa3('0x7'));var ejs=require(_0x6aa3('0x8'));var fs=require('fs');var fs_extra=require(_0x6aa3('0x9'));var _=require('lodash');var squel=require(_0x6aa3('0xa'));var crypto=require('crypto');var jsforce=require(_0x6aa3('0xb'));var deskjs=require(_0x6aa3('0xc'));var toCsv=require('to-csv');var querystring=require(_0x6aa3('0xd'));var Papa=require(_0x6aa3('0xe'));var Redis=require(_0x6aa3('0xf'));var authService=require(_0x6aa3('0x10'));var qs=require(_0x6aa3('0x11'));var as=require(_0x6aa3('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6aa3('0x13'))(_0x6aa3('0x14'));var utils=require(_0x6aa3('0x15'));var config=require(_0x6aa3('0x16'));var licenseUtil=require(_0x6aa3('0x17'));var db=require(_0x6aa3('0x18'))['db'];config[_0x6aa3('0x19')]=_['defaults'](config[_0x6aa3('0x19')],{'host':_0x6aa3('0x1a'),'port':0x18eb});var socket=require(_0x6aa3('0x1b'))(new Redis(config['redis']));require(_0x6aa3('0x1c'))[_0x6aa3('0x1d')](socket);var jayson=require(_0x6aa3('0x1e'));var client=jayson[_0x6aa3('0x1f')][_0x6aa3('0x20')]({'port':0x232c});var client9002=jayson[_0x6aa3('0x1f')][_0x6aa3('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x2a751f,_0x1aa501,_0x43f59e,_0x2371a0){return new BPromise(function(_0x28a5e2,_0x5abf34){var _0x428804=_0x2371a0||client;return _0x428804['request'](_0x2a751f,_0x43f59e)[_0x6aa3('0x21')](function(_0x4143db){logger[_0x6aa3('0x22')](_0x6aa3('0x23'),_0x1aa501,_0x6aa3('0x24'));logger[_0x6aa3('0x25')](_0x6aa3('0x26'),_0x1aa501,'request\x20sent',JSON['stringify'](_0x4143db));if(_0x4143db[_0x6aa3('0x27')]){if(_0x4143db[_0x6aa3('0x27')][_0x6aa3('0x28')]===0x1f4){logger[_0x6aa3('0x27')](_0x6aa3('0x23'),_0x1aa501,_0x4143db[_0x6aa3('0x27')][_0x6aa3('0x29')]);return _0x5abf34(_0x4143db['error'][_0x6aa3('0x29')]);}logger['error'](_0x6aa3('0x23'),_0x1aa501,_0x4143db[_0x6aa3('0x27')][_0x6aa3('0x29')]);return _0x28a5e2(_0x4143db[_0x6aa3('0x27')]['message']);}else{logger[_0x6aa3('0x22')]('OpenchannelMessage,\x20%s,\x20%s',_0x1aa501,_0x6aa3('0x24'));_0x28a5e2(_0x4143db[_0x6aa3('0x2a')][_0x6aa3('0x29')]);}})[_0x6aa3('0x2b')](function(_0x32df95){logger[_0x6aa3('0x27')](_0x6aa3('0x23'),_0x1aa501,_0x32df95);_0x5abf34(_0x32df95);});});}function respondWithStatusCode(_0x28fd91,_0x84333a){_0x84333a=_0x84333a||0xcc;return function(_0x271f5f){if(_0x271f5f){return _0x28fd91[_0x6aa3('0x2c')](_0x84333a);}return _0x28fd91[_0x6aa3('0x2d')](_0x84333a)['end']();};}function respondWithResult(_0x41e5e2,_0x21d7a7){_0x21d7a7=_0x21d7a7||0xc8;return function(_0x5f5d74){if(_0x5f5d74){return _0x41e5e2[_0x6aa3('0x2d')](_0x21d7a7)['json'](_0x5f5d74);}};}function respondWithFilteredResult(_0x1d175a,_0x548f31){return function(_0x2b13ea){if(_0x2b13ea){var _0x251820=typeof _0x548f31[_0x6aa3('0x2e')]===_0x6aa3('0x2f')&&typeof _0x548f31[_0x6aa3('0x30')]===_0x6aa3('0x2f');var _0x3bd9e1=_0x2b13ea[_0x6aa3('0x31')];var _0x2cefd0=_0x251820?0x0:_0x548f31[_0x6aa3('0x2e')];var _0xa105d5=_0x251820?_0x2b13ea['count']:_0x548f31[_0x6aa3('0x2e')]+_0x548f31[_0x6aa3('0x30')];var _0x5680e8;if(_0xa105d5>=_0x3bd9e1){_0xa105d5=_0x3bd9e1;_0x5680e8=0xc8;}else{_0x5680e8=0xce;}_0x1d175a['status'](_0x5680e8);return _0x1d175a[_0x6aa3('0x32')](_0x6aa3('0x33'),_0x2cefd0+'-'+_0xa105d5+'/'+_0x3bd9e1)[_0x6aa3('0x34')](_0x2b13ea);}return null;};}function patchUpdates(_0x2e9f07){return function(_0x4ae382){try{jsonpatch[_0x6aa3('0x35')](_0x4ae382,_0x2e9f07,!![]);}catch(_0x4755d9){return BPromise[_0x6aa3('0x36')](_0x4755d9);}return _0x4ae382[_0x6aa3('0x37')]();};}function saveUpdates(_0x2c9d15,_0x488191){return function(_0x3b26af){if(_0x3b26af){return _0x3b26af['update'](_0x2c9d15)['then'](function(_0x3a8b8e){return _0x3a8b8e;});}return null;};}function removeEntity(_0x33c3c9,_0x38213c){return function(_0x2a0761){if(_0x2a0761){return _0x2a0761[_0x6aa3('0x38')]()[_0x6aa3('0x21')](function(){_0x33c3c9['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x12fe90,_0x24742f){return function(_0x246a52){if(!_0x246a52){_0x12fe90['sendStatus'](0x194);}return _0x246a52;};}function handleError(_0x14568e,_0x179856){_0x179856=_0x179856||0x1f4;return function(_0x3f141e){logger['error'](_0x3f141e['stack']);if(_0x3f141e['name']){delete _0x3f141e[_0x6aa3('0x39')];}_0x14568e[_0x6aa3('0x2d')](_0x179856)[_0x6aa3('0x3a')](_0x3f141e);};}exports[_0x6aa3('0x3b')]=function(_0x452e0e,_0x5bb500){var _0x7f9c04={},_0x8ccf23={},_0x69c908={'count':0x0,'rows':[]};var _0xd48012=_['map'](db[_0x6aa3('0x3c')]['rawAttributes'],function(_0x3b4e14){return{'name':_0x3b4e14[_0x6aa3('0x3d')],'type':_0x3b4e14[_0x6aa3('0x3e')][_0x6aa3('0x3f')]};});_0x8ccf23['model']=_[_0x6aa3('0x40')](_0xd48012,_0x6aa3('0x39'));_0x8ccf23[_0x6aa3('0x41')]=_['keys'](_0x452e0e[_0x6aa3('0x41')]);_0x8ccf23[_0x6aa3('0x42')]=_['intersection'](_0x8ccf23['model'],_0x8ccf23['query']);_0x7f9c04[_0x6aa3('0x43')]=_[_0x6aa3('0x44')](_0x8ccf23['model'],qs['fields'](_0x452e0e[_0x6aa3('0x41')][_0x6aa3('0x45')]));_0x7f9c04[_0x6aa3('0x43')]=_0x7f9c04[_0x6aa3('0x43')]['length']?_0x7f9c04[_0x6aa3('0x43')]:_0x8ccf23['model'];if(!_0x452e0e['query'][_0x6aa3('0x46')](_0x6aa3('0x47'))){_0x7f9c04[_0x6aa3('0x30')]=qs[_0x6aa3('0x30')](_0x452e0e[_0x6aa3('0x41')][_0x6aa3('0x30')]);_0x7f9c04[_0x6aa3('0x2e')]=qs[_0x6aa3('0x2e')](_0x452e0e[_0x6aa3('0x41')][_0x6aa3('0x2e')]);}_0x7f9c04['order']=qs['sort'](_0x452e0e['query'][_0x6aa3('0x48')]);_0x7f9c04['where']=qs[_0x6aa3('0x42')](_[_0x6aa3('0x49')](_0x452e0e[_0x6aa3('0x41')],_0x8ccf23[_0x6aa3('0x42')]),_0xd48012);if(_0x452e0e[_0x6aa3('0x41')]['filter']){_0x7f9c04[_0x6aa3('0x4a')]=_['merge'](_0x7f9c04[_0x6aa3('0x4a')],{'$or':_[_0x6aa3('0x40')](_0xd48012,function(_0x2cb09c){if(_0x2cb09c[_0x6aa3('0x3e')]!==_0x6aa3('0x4b')){var _0x27e11={};_0x27e11[_0x2cb09c[_0x6aa3('0x39')]]={'$like':'%'+_0x452e0e[_0x6aa3('0x41')]['filter']+'%'};return _0x27e11;}})});}_0x7f9c04=_[_0x6aa3('0x4c')]({},_0x7f9c04,_0x452e0e[_0x6aa3('0x4d')]);var _0x17343f={'where':_0x7f9c04['where']};return db[_0x6aa3('0x3c')][_0x6aa3('0x31')](_0x17343f)[_0x6aa3('0x21')](function(_0x2d868d){_0x69c908[_0x6aa3('0x31')]=_0x2d868d;if(_0x452e0e[_0x6aa3('0x41')][_0x6aa3('0x4e')]){_0x7f9c04[_0x6aa3('0x4f')]=[{'all':!![]}];}return db[_0x6aa3('0x3c')]['findAll'](_0x7f9c04);})[_0x6aa3('0x21')](function(_0x4d52bb){_0x69c908['rows']=_0x4d52bb;return _0x69c908;})[_0x6aa3('0x21')](respondWithFilteredResult(_0x5bb500,_0x7f9c04))['catch'](handleError(_0x5bb500,null));};exports[_0x6aa3('0x50')]=function(_0x42da87,_0x21f785){var _0xc1c6d9={'raw':!![],'where':{'id':_0x42da87[_0x6aa3('0x51')]['id']}},_0x466a06={};_0x466a06[_0x6aa3('0x52')]=_[_0x6aa3('0x53')](db[_0x6aa3('0x3c')][_0x6aa3('0x54')]);_0x466a06['query']=_[_0x6aa3('0x53')](_0x42da87['query']);_0x466a06[_0x6aa3('0x42')]=_[_0x6aa3('0x44')](_0x466a06[_0x6aa3('0x52')],_0x466a06['query']);_0xc1c6d9['attributes']=_[_0x6aa3('0x44')](_0x466a06[_0x6aa3('0x52')],qs['fields'](_0x42da87['query'][_0x6aa3('0x45')]));_0xc1c6d9[_0x6aa3('0x43')]=_0xc1c6d9[_0x6aa3('0x43')][_0x6aa3('0x55')]?_0xc1c6d9[_0x6aa3('0x43')]:_0x466a06[_0x6aa3('0x52')];if(_0x42da87[_0x6aa3('0x41')][_0x6aa3('0x4e')]){_0xc1c6d9['include']=[{'all':!![]}];}_0xc1c6d9=_[_0x6aa3('0x4c')]({},_0xc1c6d9,_0x42da87[_0x6aa3('0x4d')]);return db['OpenchannelMessage'][_0x6aa3('0x56')](_0xc1c6d9)['then'](handleEntityNotFound(_0x21f785,null))[_0x6aa3('0x21')](respondWithResult(_0x21f785,null))[_0x6aa3('0x2b')](handleError(_0x21f785,null));};exports[_0x6aa3('0x57')]=function(_0x1542c5,_0x118473){return db[_0x6aa3('0x3c')]['create'](_0x1542c5[_0x6aa3('0x58')],{})[_0x6aa3('0x21')](respondWithResult(_0x118473,0xc9))[_0x6aa3('0x2b')](handleError(_0x118473,null));};exports[_0x6aa3('0x59')]=function(_0x6eada9,_0x22aa71){if(_0x6eada9[_0x6aa3('0x58')]['id']){delete _0x6eada9[_0x6aa3('0x58')]['id'];}return db[_0x6aa3('0x3c')][_0x6aa3('0x56')]({'where':{'id':_0x6eada9['params']['id']}})[_0x6aa3('0x21')](handleEntityNotFound(_0x22aa71,null))['then'](saveUpdates(_0x6eada9[_0x6aa3('0x58')],null))[_0x6aa3('0x21')](respondWithResult(_0x22aa71,null))[_0x6aa3('0x2b')](handleError(_0x22aa71,null));};exports[_0x6aa3('0x38')]=function(_0x2afbea,_0x1ec751){return db['OpenchannelMessage'][_0x6aa3('0x56')]({'where':{'id':_0x2afbea[_0x6aa3('0x51')]['id']}})[_0x6aa3('0x21')](handleEntityNotFound(_0x1ec751,null))['then'](removeEntity(_0x1ec751,null))['catch'](handleError(_0x1ec751,null));};exports['describe']=function(_0x398059,_0x1d9dbe){return db[_0x6aa3('0x3c')][_0x6aa3('0x5a')]()[_0x6aa3('0x21')](respondWithResult(_0x1d9dbe,null))[_0x6aa3('0x2b')](handleError(_0x1d9dbe,null));};var interaction_log=require(_0x6aa3('0x13'))(_0x6aa3('0x5b'));exports[_0x6aa3('0x5c')]=function(_0x412bac,_0x30c3f8,_0xd2761f){var _0xecd64e={'agent':{},'channel':'openchannel'};if(_0x412bac[_0x6aa3('0x58')]['id']){delete _0x412bac[_0x6aa3('0x58')]['id'];}_0x412bac[_0x6aa3('0x58')][_0x6aa3('0x5d')]=!![];_0x412bac[_0x6aa3('0x58')][_0x6aa3('0x5e')]=moment()[_0x6aa3('0x5f')](_0x6aa3('0x60'));_0x412bac['body'][_0x6aa3('0x61')]=_0x412bac['body']['UserId']||_0x412bac['user']['id'];_0xecd64e[_0x6aa3('0x62')]['id']=_0x412bac[_0x6aa3('0x58')][_0x6aa3('0x61')];return db['OpenchannelMessage'][_0x6aa3('0x56')]({'where':{'id':_0x412bac['params']['id'],'UserId':null}})[_0x6aa3('0x21')](handleEntityNotFound(_0x30c3f8,null))['then'](saveUpdates(_0x412bac[_0x6aa3('0x58')],null))[_0x6aa3('0x21')](function(_0x5cdecc){if(_0x5cdecc){_0xecd64e[_0x6aa3('0x29')]=_0x5cdecc['get']({'plain':!![]});return db[_0x6aa3('0x63')][_0x6aa3('0x56')]({'where':{'id':_0x5cdecc['OpenchannelInteractionId']}});}return null;})[_0x6aa3('0x21')](handleEntityNotFound(_0x30c3f8,null))['then'](function(_0x365b65){if(_0x365b65){return _0x365b65[_0x6aa3('0x59')]({'UserId':_0x412bac[_0x6aa3('0x58')][_0x6aa3('0x61')],'read1stAt':_[_0x6aa3('0x64')](_0x365b65[_0x6aa3('0x65')])?moment()[_0x6aa3('0x5f')](_0x6aa3('0x60')):undefined});}return null;})[_0x6aa3('0x21')](function(_0x537a96){if(_0x537a96){_0xecd64e[_0x6aa3('0x66')]=_0x537a96['get']({'plain':!![]});interaction_log['info'](_0x6aa3('0x67'),_0x412bac[_0x6aa3('0x68')]['id'],_0x412bac[_0x6aa3('0x68')][_0x6aa3('0x39')],_0x412bac[_0x6aa3('0x68')][_0x6aa3('0x69')],_0xecd64e['interaction']['id'],_0x412bac[_0x6aa3('0x58')]?JSON['stringify'](_0x412bac[_0x6aa3('0x58')]):_0x6aa3('0x6a'));return respondWithRpcPromise(_0x6aa3('0x6b'),_0x6aa3('0x6c'),_0xecd64e);}return null;})['then'](function(_0x3d1824){var _0x194c20=_0x6aa3('0x6d')+_0x3d1824[_0x6aa3('0x29')][_0x6aa3('0x6e')];return db[_0x6aa3('0x6f')][_0x6aa3('0x41')](_0x194c20,{'type':db['Sequelize'][_0x6aa3('0x70')][_0x6aa3('0x71')],'raw':!![]})['then'](function(_0x5ee411){return _0x5ee411;});})[_0x6aa3('0x21')](function(_0x2062e5){if(_0x2062e5){_0xecd64e[_0x6aa3('0x29')][_0x6aa3('0x72')]=_0x2062e5[0x0];if(!_0x412bac[_0x6aa3('0x58')][_0x6aa3('0x61')])return;return db['User'][_0x6aa3('0x56')]({'where':{'id':_0x412bac[_0x6aa3('0x58')][_0x6aa3('0x61')],'role':_0x6aa3('0x62')},'attributes':['id','name',_0x6aa3('0x73'),_0x6aa3('0x74'),_0x6aa3('0x75')],'raw':!![]});}return null;})['then'](function(_0x2708db){if(!_0x2708db)return null;_0xecd64e['message'][_0x6aa3('0x62')]=_0x2708db;return _0xecd64e;})[_0x6aa3('0x21')](function(_0x4f1857){if(_0x4f1857){if(_0x412bac[_0x6aa3('0x58')][_0x6aa3('0x76')]){_0xecd64e['message'][_0x6aa3('0x77')]=util[_0x6aa3('0x5f')]('SIP/%s',_0x412bac[_0x6aa3('0x68')][_0x6aa3('0x39')]);_0xecd64e[_0x6aa3('0x29')][_0x6aa3('0x78')]=_0xecd64e[_0x6aa3('0x78')];_0xecd64e['message']['motionChannel']=_0xecd64e[_0x6aa3('0x78')];_0xecd64e[_0x6aa3('0x29')][_0x6aa3('0x79')]='accept';return respondWithRpcPromise('EventManager','EventManager',{'event':_0x6aa3('0x7a'),'message':_0xecd64e[_0x6aa3('0x29')]},client9002)['then'](function(){return _0xecd64e;});}return _0xecd64e;}return null;})[_0x6aa3('0x21')](respondWithResult(_0x30c3f8,null))[_0x6aa3('0x2b')](handleError(_0x30c3f8,null));};var interaction_log=require(_0x6aa3('0x13'))('openchannel-interactions');exports['reject']=function(_0x7a4893,_0x4022fb,_0x52125c){var _0x1336e2={'agent':{},'channel':_0x6aa3('0x7b')};if(_0x7a4893[_0x6aa3('0x58')]['id']){delete _0x7a4893['body']['id'];}_0x7a4893[_0x6aa3('0x58')][_0x6aa3('0x61')]=_0x7a4893['body'][_0x6aa3('0x61')]||_0x7a4893[_0x6aa3('0x68')]['id'];_0x1336e2[_0x6aa3('0x62')]['id']=_0x7a4893[_0x6aa3('0x58')][_0x6aa3('0x61')];return db[_0x6aa3('0x3c')][_0x6aa3('0x56')]({'where':{'id':_0x7a4893[_0x6aa3('0x51')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x4022fb,null))['then'](function(_0x5b693b){if(_0x5b693b){_0x1336e2['message']=_0x5b693b[_0x6aa3('0x7c')]({'plain':!![]});return db[_0x6aa3('0x63')][_0x6aa3('0x56')]({'where':{'id':_0x5b693b[_0x6aa3('0x7d')]}});}return null;})[_0x6aa3('0x21')](handleEntityNotFound(_0x4022fb,null))[_0x6aa3('0x21')](function(_0x124aaf){if(_0x124aaf){_0x1336e2['interaction']=_0x124aaf[_0x6aa3('0x7c')]({'plain':!![]});interaction_log[_0x6aa3('0x22')](_0x6aa3('0x7e'),_0x7a4893[_0x6aa3('0x68')]['id'],_0x7a4893[_0x6aa3('0x68')][_0x6aa3('0x39')],_0x7a4893[_0x6aa3('0x68')][_0x6aa3('0x69')],_0x1336e2[_0x6aa3('0x66')]['id'],_0x7a4893['body']?JSON['stringify'](_0x7a4893[_0x6aa3('0x58')]):_0x6aa3('0x6a'));return respondWithRpcPromise(_0x6aa3('0x7f'),_0x6aa3('0x80'),_0x1336e2);}return null;})[_0x6aa3('0x21')](function(_0x1e4997){var _0x2ef1cf=_0x6aa3('0x6d')+_0x1e4997[_0x6aa3('0x29')]['ContactId'];return db[_0x6aa3('0x6f')]['query'](_0x2ef1cf,{'type':db[_0x6aa3('0x81')][_0x6aa3('0x70')][_0x6aa3('0x71')],'raw':!![]})[_0x6aa3('0x21')](function(_0x5521a3){return _0x5521a3;});})[_0x6aa3('0x21')](function(_0x46daea){if(_0x46daea){_0x1336e2[_0x6aa3('0x29')][_0x6aa3('0x72')]=_0x46daea[0x0];if(!_0x7a4893[_0x6aa3('0x58')][_0x6aa3('0x61')])return;return db[_0x6aa3('0x82')][_0x6aa3('0x56')]({'where':{'id':_0x7a4893[_0x6aa3('0x58')][_0x6aa3('0x61')],'role':_0x6aa3('0x62')},'attributes':['id','name',_0x6aa3('0x73'),_0x6aa3('0x74'),_0x6aa3('0x75')],'raw':!![]});}return null;})[_0x6aa3('0x21')](function(_0x5da712){if(!_0x5da712)return null;_0x1336e2['message'][_0x6aa3('0x62')]=_0x5da712;return _0x1336e2;})[_0x6aa3('0x21')](function(_0x94625d){if(_0x94625d){_0x94625d[_0x6aa3('0x29')][_0x6aa3('0x77')]=util[_0x6aa3('0x5f')](_0x6aa3('0x83'),_0x7a4893[_0x6aa3('0x68')][_0x6aa3('0x39')]);_0x94625d[_0x6aa3('0x29')][_0x6aa3('0x78')]=_0x1336e2['channel'];_0x94625d['message']['motionChannel']=_0x1336e2[_0x6aa3('0x78')];_0x94625d['message'][_0x6aa3('0x79')]=_0x6aa3('0x36');respondWithRpcPromise(_0x6aa3('0x84'),_0x6aa3('0x84'),{'event':_0x6aa3('0x85'),'message':_0x94625d[_0x6aa3('0x29')]},client9002);return _0x1336e2;}return null;})[_0x6aa3('0x21')](respondWithResult(_0x4022fb,null))[_0x6aa3('0x2b')](handleError(_0x4022fb,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index 608e02b..4106b2f 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 _0xf7c1=['../../mysqldb','OpenchannelMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x100682,_0x11afec){var _0xcb6e87=function(_0x3ef421){while(--_0x3ef421){_0x100682['push'](_0x100682['shift']());}};_0xcb6e87(++_0x11afec);}(_0xf7c1,0x149));var _0x1f7c=function(_0x598831,_0x221147){_0x598831=_0x598831-0x0;var _0x571a2d=_0xf7c1[_0x598831];return _0x571a2d;};'use strict';var EventEmitter=require(_0x1f7c('0x0'));var OpenchannelMessage=require(_0x1f7c('0x1'))['db'][_0x1f7c('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x1f7c('0x3')](0x0);var events={'afterCreate':_0x1f7c('0x4'),'afterUpdate':_0x1f7c('0x5'),'afterDestroy':_0x1f7c('0x6')};function emitEvent(_0x27b497){return function(_0x2897fe,_0x10621d,_0x3f984a){OpenchannelMessageEvents[_0x1f7c('0x7')](_0x27b497+':'+_0x2897fe['id'],_0x2897fe);OpenchannelMessageEvents[_0x1f7c('0x7')](_0x27b497,_0x2897fe);_0x3f984a(null);};}for(var e in events){if(events[_0x1f7c('0x8')](e)){var event=events[e];OpenchannelMessage[_0x1f7c('0x9')](e,emitEvent(event));}}module[_0x1f7c('0xa')]=OpenchannelMessageEvents; \ No newline at end of file +var _0x356d=['save','update','remove','emit','hasOwnProperty','../../mysqldb','OpenchannelMessage','setMaxListeners'];(function(_0x26ab3b,_0x1bc9bf){var _0xac513f=function(_0x18851e){while(--_0x18851e){_0x26ab3b['push'](_0x26ab3b['shift']());}};_0xac513f(++_0x1bc9bf);}(_0x356d,0x105));var _0xd356=function(_0x5dee5e,_0x2fd6fb){_0x5dee5e=_0x5dee5e-0x0;var _0x14caf0=_0x356d[_0x5dee5e];return _0x14caf0;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require(_0xd356('0x0'))['db'][_0xd356('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0xd356('0x2')](0x0);var events={'afterCreate':_0xd356('0x3'),'afterUpdate':_0xd356('0x4'),'afterDestroy':_0xd356('0x5')};function emitEvent(_0x3f17c3){return function(_0x2400da,_0x3a1cd6,_0x255332){OpenchannelMessageEvents[_0xd356('0x6')](_0x3f17c3+':'+_0x2400da['id'],_0x2400da);OpenchannelMessageEvents[_0xd356('0x6')](_0x3f17c3,_0x2400da);_0x255332(null);};}for(var e in events){if(events[_0xd356('0x7')](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module['exports']=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index 237ccf7..ae5d580 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 _0x8e3f=['get','direction','toLowerCase','out','isNil','UserId','OpenchannelInteraction','findOne','then','update','catch','error','secret','CmContact','describe','OpenchannelAccount','find','OpenchannelAccountId','OpenchannelInteractionId','Contact','keys','replyUri','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','Interactions','length','Interaction','omit','POST','method','GET','info','Message\x20%d\x20forwarded\x20to\x20%s','threadId','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','models'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8e3f,0xc1));var _0xf8e3=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x8e3f[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0xf8e3('0x0'));var util=require(_0xf8e3('0x1'));var logger=require(_0xf8e3('0x2'))('api');var moment=require(_0xf8e3('0x3'));var BPromise=require(_0xf8e3('0x4'));var rp=require(_0xf8e3('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf8e3('0x6'));var config=require(_0xf8e3('0x7'));var attributes=require('./openchannelMessage.attributes');module[_0xf8e3('0x8')]=function(_0xb21f8d,_0x2621c5){return _0xb21f8d[_0xf8e3('0x9')]('OpenchannelMessage',attributes,{'tableName':_0xf8e3('0xa'),'paranoid':![],'indexes':[{'name':_0xf8e3('0xb'),'fields':[_0xf8e3('0xc')],'type':_0xf8e3('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x38f8e8,_0x4055e2,_0x299a7e){var _0x2a3b59=_0xb21f8d[_0xf8e3('0xe')];var _0x2bc3cd=_0x38f8e8[_0xf8e3('0xf')]({'plain':!![]});if(_0x2bc3cd[_0xf8e3('0x10')]['toLowerCase']()==='in'||_0x2bc3cd[_0xf8e3('0x10')][_0xf8e3('0x11')]()===_0xf8e3('0x12')&&!_0x2bc3cd['secret']&&!_[_0xf8e3('0x13')](_0x2bc3cd[_0xf8e3('0x14')])){_0x2a3b59[_0xf8e3('0x15')][_0xf8e3('0x16')]({'where':{'id':_0x2bc3cd['OpenchannelInteractionId']}})[_0xf8e3('0x17')](function(_0xa856f5){if(_0xa856f5){_0xa856f5[_0xf8e3('0x18')]({'lastMsgAt':_0x2bc3cd['createdAt'],'lastMsgDirection':_0x2bc3cd[_0xf8e3('0x10')]['toLowerCase']()});}})[_0xf8e3('0x19')](function(_0x40c196){console[_0xf8e3('0x1a')](_0x40c196);});}if(_0x2bc3cd['direction']==='out'&&!_0x2bc3cd[_0xf8e3('0x1b')]){var _0x385dde;_0x2a3b59[_0xf8e3('0x1c')][_0xf8e3('0x1d')]()[_0xf8e3('0x17')](function(_0x11d4cc){return _0x2a3b59[_0xf8e3('0x1e')][_0xf8e3('0x1f')]({'where':{'id':_0x2bc3cd[_0xf8e3('0x20')]},'include':[{'model':_0x2a3b59[_0xf8e3('0x15')],'as':'Interactions','where':{'id':_0x2bc3cd[_0xf8e3('0x21')]},'limit':0x1,'include':[{'model':_0x2a3b59[_0xf8e3('0x1c')],'as':_0xf8e3('0x22'),'attributes':_[_0xf8e3('0x23')](_0x11d4cc)}]}]});})[_0xf8e3('0x17')](function(_0x11c58e){_0x385dde=_0x11c58e[_0xf8e3('0xf')]({'plain':!![]});if(_0x385dde&&_0x385dde[_0xf8e3('0x24')]){logger['info'](_0xf8e3('0x25'),_0xf8e3('0x26'),util[_0xf8e3('0x27')](_0xf8e3('0x28'),_0x2bc3cd['id'],_0x385dde['replyUri']));if(_0x385dde[_0xf8e3('0x29')]&&_0x385dde['Interactions'][_0xf8e3('0x2a')]){_0x2bc3cd[_0xf8e3('0x2b')]=_[_0xf8e3('0x2c')](_0x385dde[_0xf8e3('0x29')][0x0],_0xf8e3('0x22'));_0x2bc3cd[_0xf8e3('0x22')]=_0x385dde['Interactions'][0x0][_0xf8e3('0x22')];}var _0x4055e2={'method':_0xf8e3('0x2d'),'uri':encodeURI(_0x385dde[_0xf8e3('0x24')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x4055e2[_0xf8e3('0x2e')]){case _0xf8e3('0x2f'):_0x4055e2['qs']=_0x2bc3cd;break;case _0xf8e3('0x2d'):_0x4055e2[_0xf8e3('0xc')]=_0x2bc3cd;break;}return rp(_0x4055e2)['then'](function(_0x356e0a){logger[_0xf8e3('0x30')](_0xf8e3('0x25'),_0xf8e3('0x26'),util[_0xf8e3('0x27')](_0xf8e3('0x31'),_0x2bc3cd['id'],_0x385dde[_0xf8e3('0x24')]));if(_0x356e0a[_0xf8e3('0xc')]['threadId']&&_0x356e0a[_0xf8e3('0xc')][_0xf8e3('0x32')]!=_0x2bc3cd[_0xf8e3('0x2b')][_0xf8e3('0x32')]){return _0x2a3b59['OpenchannelInteraction'][_0xf8e3('0x18')]({'threadId':_0x356e0a[_0xf8e3('0xc')][_0xf8e3('0x32')]},{'logging':!![],'where':{'id':_0x2bc3cd[_0xf8e3('0x2b')]['id']}});}else{return;}})[_0xf8e3('0x17')](function(){return _0x38f8e8[_0xf8e3('0x18')]({'read':!![]});})[_0xf8e3('0x19')](function(_0x18c8ae){logger['error'](_0xf8e3('0x25'),_0xf8e3('0x26'),util['inspect'](_0x18c8ae,{'showHidden':![],'depth':null}));_0x299a7e();});}else{_0x299a7e();}})['finally'](function(){_0x299a7e();});}else{_0x299a7e();}}},'charset':'utf8mb4','collate':_0xf8e3('0x33')});}; \ No newline at end of file +var _0xb10b=['OpenchannelAccount','find','OpenchannelAccountId','Interactions','Contact','keys','info','OpenchannelMessage,\x20%s,\x20%s','Forwarding\x20message\x20%d\x20to\x20%s','replyUri','length','Interaction','omit','method','GET','POST','afterCreate','format','Message\x20%d\x20forwarded\x20to\x20%s','threadId','finally','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./openchannelMessage.attributes','exports','define','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','get','direction','toLowerCase','secret','isNil','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','update','createdAt','catch','error','out','CmContact','describe','then'];(function(_0xc1f95f,_0x2ccf17){var _0x33c4ac=function(_0x1fb48d){while(--_0x1fb48d){_0xc1f95f['push'](_0xc1f95f['shift']());}};_0x33c4ac(++_0x2ccf17);}(_0xb10b,0x12a));var _0xbb10=function(_0x340da7,_0x13d6fc){_0x340da7=_0x340da7-0x0;var _0x43b466=_0xb10b[_0x340da7];return _0x43b466;};'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')]('OpenchannelMessage',attributes,{'tableName':_0xbb10('0xb'),'paranoid':![],'indexes':[{'name':_0xbb10('0xc'),'fields':[_0xbb10('0xd')],'type':_0xbb10('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2353ef,_0x1ce33e,_0x229887){var _0xa3adc8=_0x481979['models'];var _0x4e47f8=_0x2353ef[_0xbb10('0xf')]({'plain':!![]});if(_0x4e47f8[_0xbb10('0x10')][_0xbb10('0x11')]()==='in'||_0x4e47f8['direction'][_0xbb10('0x11')]()==='out'&&!_0x4e47f8[_0xbb10('0x12')]&&!_[_0xbb10('0x13')](_0x4e47f8[_0xbb10('0x14')])){_0xa3adc8[_0xbb10('0x15')][_0xbb10('0x16')]({'where':{'id':_0x4e47f8[_0xbb10('0x17')]}})['then'](function(_0x26e021){if(_0x26e021){_0x26e021[_0xbb10('0x18')]({'lastMsgAt':_0x4e47f8[_0xbb10('0x19')],'lastMsgDirection':_0x4e47f8[_0xbb10('0x10')][_0xbb10('0x11')]()});}})[_0xbb10('0x1a')](function(_0x24a57b){console[_0xbb10('0x1b')](_0x24a57b);});}if(_0x4e47f8[_0xbb10('0x10')]===_0xbb10('0x1c')&&!_0x4e47f8['secret']){var _0x2eca0f;_0xa3adc8[_0xbb10('0x1d')][_0xbb10('0x1e')]()[_0xbb10('0x1f')](function(_0x378da8){return _0xa3adc8[_0xbb10('0x20')][_0xbb10('0x21')]({'where':{'id':_0x4e47f8[_0xbb10('0x22')]},'include':[{'model':_0xa3adc8[_0xbb10('0x15')],'as':_0xbb10('0x23'),'where':{'id':_0x4e47f8['OpenchannelInteractionId']},'limit':0x1,'include':[{'model':_0xa3adc8[_0xbb10('0x1d')],'as':_0xbb10('0x24'),'attributes':_[_0xbb10('0x25')](_0x378da8)}]}]});})[_0xbb10('0x1f')](function(_0xdf237d){_0x2eca0f=_0xdf237d[_0xbb10('0xf')]({'plain':!![]});if(_0x2eca0f&&_0x2eca0f['replyUri']){logger[_0xbb10('0x26')](_0xbb10('0x27'),'afterCreate',util['format'](_0xbb10('0x28'),_0x4e47f8['id'],_0x2eca0f[_0xbb10('0x29')]));if(_0x2eca0f[_0xbb10('0x23')]&&_0x2eca0f[_0xbb10('0x23')][_0xbb10('0x2a')]){_0x4e47f8[_0xbb10('0x2b')]=_[_0xbb10('0x2c')](_0x2eca0f[_0xbb10('0x23')][0x0],_0xbb10('0x24'));_0x4e47f8[_0xbb10('0x24')]=_0x2eca0f[_0xbb10('0x23')][0x0][_0xbb10('0x24')];}var _0x1ce33e={'method':'POST','uri':encodeURI(_0x2eca0f['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x1ce33e[_0xbb10('0x2d')]){case _0xbb10('0x2e'):_0x1ce33e['qs']=_0x4e47f8;break;case _0xbb10('0x2f'):_0x1ce33e['body']=_0x4e47f8;break;}return rp(_0x1ce33e)[_0xbb10('0x1f')](function(_0x24d586){logger[_0xbb10('0x26')](_0xbb10('0x27'),_0xbb10('0x30'),util[_0xbb10('0x31')](_0xbb10('0x32'),_0x4e47f8['id'],_0x2eca0f['replyUri']));if(_0x24d586[_0xbb10('0xd')][_0xbb10('0x33')]&&_0x24d586[_0xbb10('0xd')][_0xbb10('0x33')]!=_0x4e47f8[_0xbb10('0x2b')][_0xbb10('0x33')]){return _0xa3adc8['OpenchannelInteraction'][_0xbb10('0x18')]({'threadId':_0x24d586['body'][_0xbb10('0x33')]},{'logging':!![],'where':{'id':_0x4e47f8['Interaction']['id']}});}else{return;}})[_0xbb10('0x1f')](function(){return _0x2353ef[_0xbb10('0x18')]({'read':!![]});})[_0xbb10('0x1a')](function(_0x491db4){logger['error'](_0xbb10('0x27'),_0xbb10('0x30'),util['inspect'](_0x491db4,{'showHidden':![],'depth':null}));_0x229887();});}else{_0x229887();}})[_0xbb10('0x34')](function(){_0x229887();});}else{_0x229887();}}},'charset':_0xbb10('0x35'),'collate':_0xbb10('0x36')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index c4d2356..fe14510 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(_0xaed410,_0x3f1770){var _0x2d06e2=function(_0x156189){while(--_0x156189){_0xaed410['push'](_0xaed410['shift']());}};_0x2d06e2(++_0x3f1770);}(_0x2ef3,0xba));var _0x32ef=function(_0x3ee5d1,_0x32a3c6){_0x3ee5d1=_0x3ee5d1-0x0;var _0x1ad473=_0x2ef3[_0x3ee5d1];return _0x1ad473;};'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 _0xdb28=['then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','CreateOpenchannelMessage','OpenchannelMessage','create','body','options','raw','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./openchannelMessage.socket','register','request'];(function(_0x258150,_0x3c6757){var _0x26be3b=function(_0x5caf58){while(--_0x5caf58){_0x258150['push'](_0x258150['shift']());}};_0x26be3b(++_0x3c6757);}(_0xdb28,0x106));var _0x8db2=function(_0x2f6ace,_0x59ac98){_0x2f6ace=_0x2f6ace-0x0;var _0x56d88a=_0xdb28[_0x2f6ace];return _0x56d88a;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});config['redis']=_[_0x8db2('0xb')](config[_0x8db2('0xc')],{'host':_0x8db2('0xd'),'port':0x18eb});var socket=require(_0x8db2('0xe'))(new Redis(config[_0x8db2('0xc')]));require(_0x8db2('0xf'))[_0x8db2('0x10')](socket);function respondWithRpcPromise(_0x4ba340,_0x30dc90,_0x476216){return new BPromise(function(_0x1f62af,_0x57015f){return client[_0x8db2('0x11')](_0x4ba340,_0x476216)[_0x8db2('0x12')](function(_0x576475){logger[_0x8db2('0x13')](_0x8db2('0x14'),_0x30dc90,_0x8db2('0x15'));logger[_0x8db2('0x16')](_0x8db2('0x17'),_0x30dc90,'request\x20sent',JSON['stringify'](_0x576475));if(_0x576475[_0x8db2('0x18')]){if(_0x576475[_0x8db2('0x18')][_0x8db2('0x19')]===0x1f4){logger[_0x8db2('0x18')](_0x8db2('0x14'),_0x30dc90,_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);return _0x57015f(_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);}logger[_0x8db2('0x18')]('OpenchannelMessage,\x20%s,\x20%s',_0x30dc90,_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);return _0x1f62af(_0x576475['error'][_0x8db2('0x1a')]);}else{logger[_0x8db2('0x13')](_0x8db2('0x14'),_0x30dc90,_0x8db2('0x15'));_0x1f62af(_0x576475[_0x8db2('0x1b')][_0x8db2('0x1a')]);}})['catch'](function(_0x5df464){logger[_0x8db2('0x18')](_0x8db2('0x14'),_0x30dc90,_0x5df464);_0x57015f(_0x5df464);});});}exports[_0x8db2('0x1c')]=function(_0x1b64e4){var _0x58562e=this;return new Promise(function(_0x431d60,_0x36a9ff){return db[_0x8db2('0x1d')][_0x8db2('0x1e')](_0x1b64e4[_0x8db2('0x1f')],{'raw':_0x1b64e4['options']?_0x1b64e4[_0x8db2('0x20')][_0x8db2('0x21')]===undefined?!![]:![]:!![]})[_0x8db2('0x12')](function(_0x125be2){logger[_0x8db2('0x13')](_0x8db2('0x1c'),_0x1b64e4);logger[_0x8db2('0x16')]('CreateOpenchannelMessage',_0x1b64e4,JSON[_0x8db2('0x22')](_0x125be2));_0x431d60(_0x125be2);})['catch'](function(_0x5725f0){logger['error']('CreateOpenchannelMessage',_0x5725f0[_0x8db2('0x1a')],_0x1b64e4);_0x36a9ff(_0x58562e[_0x8db2('0x18')](0x1f4,_0x5725f0[_0x8db2('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index 9bd4325..d2b5bac 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 _0x4f96=['openchannelMessage:','./openchannelMessage.events','save','remove','update','emit','removeListener','length'];(function(_0x85d5a8,_0x1977be){var _0x20479b=function(_0x125248){while(--_0x125248){_0x85d5a8['push'](_0x85d5a8['shift']());}};_0x20479b(++_0x1977be);}(_0x4f96,0xb9));var _0x64f9=function(_0x336b65,_0x3f857a){_0x336b65=_0x336b65-0x0;var _0xb8017f=_0x4f96[_0x336b65];return _0xb8017f;};'use strict';var OpenchannelMessageEvents=require(_0x64f9('0x0'));var events=[_0x64f9('0x1'),_0x64f9('0x2'),_0x64f9('0x3')];function createListener(_0x241264,_0x31e759){return function(_0x4a87d5){_0x31e759[_0x64f9('0x4')](_0x241264,_0x4a87d5);};}function removeListener(_0x4c95fa,_0x5c4300){return function(){OpenchannelMessageEvents[_0x64f9('0x5')](_0x4c95fa,_0x5c4300);};}exports['register']=function(_0x727113){for(var _0x307cb5=0x0,_0x3569eb=events[_0x64f9('0x6')];_0x307cb5<_0x3569eb;_0x307cb5++){var _0x1bc33d=events[_0x307cb5];var _0x512be8=createListener(_0x64f9('0x7')+_0x1bc33d,_0x727113);OpenchannelMessageEvents['on'](_0x1bc33d,_0x512be8);}}; \ No newline at end of file +var _0x50d8=['update','removeListener','register','length','openchannelMessage:','./openchannelMessage.events','remove'];(function(_0x1b7bb9,_0x2dc3ac){var _0x4d2ebc=function(_0x2b30a4){while(--_0x2b30a4){_0x1b7bb9['push'](_0x1b7bb9['shift']());}};_0x4d2ebc(++_0x2dc3ac);}(_0x50d8,0x12b));var _0x850d=function(_0x32bd70,_0x5b7f07){_0x32bd70=_0x32bd70-0x0;var _0x1b076a=_0x50d8[_0x32bd70];return _0x1b076a;};'use strict';var OpenchannelMessageEvents=require(_0x850d('0x0'));var events=['save',_0x850d('0x1'),_0x850d('0x2')];function createListener(_0x4b90e2,_0x1bc032){return function(_0x53ea5e){_0x1bc032['emit'](_0x4b90e2,_0x53ea5e);};}function removeListener(_0x3c91c1,_0x10858c){return function(){OpenchannelMessageEvents[_0x850d('0x3')](_0x3c91c1,_0x10858c);};}exports[_0x850d('0x4')]=function(_0x54470c){for(var _0x5e7c62=0x0,_0x9dd636=events[_0x850d('0x5')];_0x5e7c62<_0x9dd636;_0x5e7c62++){var _0x1cce5c=events[_0x5e7c62];var _0x1f443a=createListener(_0x850d('0x6')+_0x1cce5c,_0x54470c);OpenchannelMessageEvents['on'](_0x1cce5c,_0x1f443a);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index 17e60ee..c4285cb 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 _0x4a41=['describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','create','post','addTeams','addAgents','update','delete','destroy','removeAgents','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./openchannelQueue.controller','isAuthenticated','index','get','/describe'];(function(_0x3fdfa0,_0x2b8975){var _0x527193=function(_0xf5cd25){while(--_0xf5cd25){_0x3fdfa0['push'](_0x3fdfa0['shift']());}};_0x527193(++_0x2b8975);}(_0x4a41,0x1d4));var _0x14a4=function(_0x84b7f2,_0x3bbc1d){_0x84b7f2=_0x84b7f2-0x0;var _0x52f617=_0x4a41[_0x84b7f2];return _0x52f617;};'use strict';var multer=require(_0x14a4('0x0'));var util=require('util');var path=require(_0x14a4('0x1'));var timeout=require(_0x14a4('0x2'));var express=require(_0x14a4('0x3'));var router=express['Router']();var fs_extra=require(_0x14a4('0x4'));var auth=require(_0x14a4('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x14a4('0x6'));var controller=require(_0x14a4('0x7'));router['get']('/',auth[_0x14a4('0x8')](),controller[_0x14a4('0x9')]);router[_0x14a4('0xa')](_0x14a4('0xb'),auth[_0x14a4('0x8')](),controller[_0x14a4('0xc')]);router[_0x14a4('0xa')](_0x14a4('0xd'),auth['isAuthenticated'](),controller[_0x14a4('0xe')]);router['get'](_0x14a4('0xf'),auth[_0x14a4('0x8')](),controller[_0x14a4('0x10')]);router[_0x14a4('0xa')](_0x14a4('0x11'),auth[_0x14a4('0x8')](),controller[_0x14a4('0x12')]);router[_0x14a4('0xa')](_0x14a4('0x13'),auth[_0x14a4('0x8')](),controller[_0x14a4('0x14')]);router['post']('/',auth['isAuthenticated'](),controller[_0x14a4('0x15')]);router[_0x14a4('0x16')]('/:id/teams',auth['isAuthenticated'](),controller[_0x14a4('0x17')]);router[_0x14a4('0x16')](_0x14a4('0x13'),auth[_0x14a4('0x8')](),controller[_0x14a4('0x18')]);router['put'](_0x14a4('0xd'),auth[_0x14a4('0x8')](),controller[_0x14a4('0x19')]);router[_0x14a4('0x1a')](_0x14a4('0xd'),auth[_0x14a4('0x8')](),controller[_0x14a4('0x1b')]);router[_0x14a4('0x1a')]('/:id/teams',auth['isAuthenticated'](),controller['removeTeams']);router[_0x14a4('0x1a')](_0x14a4('0x13'),auth['isAuthenticated'](),controller[_0x14a4('0x1c')]);module[_0x14a4('0x1d')]=router; \ No newline at end of file +var _0xd3dc=['update','delete','removeTeams','removeAgents','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./openchannelQueue.controller','isAuthenticated','index','get','/describe','describe','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','put','/:id'];(function(_0x49fb1c,_0x113891){var _0x36cc02=function(_0x308d72){while(--_0x308d72){_0x49fb1c['push'](_0x49fb1c['shift']());}};_0x36cc02(++_0x113891);}(_0xd3dc,0x14e));var _0xcd3d=function(_0x1c056d,_0x5790bc){_0x1c056d=_0x1c056d-0x0;var _0x2f2d8a=_0xd3dc[_0x1c056d];return _0x2f2d8a;};'use strict';var multer=require(_0xcd3d('0x0'));var util=require(_0xcd3d('0x1'));var path=require(_0xcd3d('0x2'));var timeout=require(_0xcd3d('0x3'));var express=require('express');var router=express[_0xcd3d('0x4')]();var fs_extra=require(_0xcd3d('0x5'));var auth=require(_0xcd3d('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xcd3d('0x7'));var controller=require(_0xcd3d('0x8'));router['get']('/',auth[_0xcd3d('0x9')](),controller[_0xcd3d('0xa')]);router[_0xcd3d('0xb')](_0xcd3d('0xc'),auth['isAuthenticated'](),controller[_0xcd3d('0xd')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xcd3d('0xe')]);router['get'](_0xcd3d('0xf'),auth[_0xcd3d('0x9')](),controller[_0xcd3d('0x10')]);router['get'](_0xcd3d('0x11'),auth[_0xcd3d('0x9')](),controller[_0xcd3d('0x12')]);router[_0xcd3d('0xb')](_0xcd3d('0x13'),auth[_0xcd3d('0x9')](),controller[_0xcd3d('0x14')]);router[_0xcd3d('0x15')]('/',auth[_0xcd3d('0x9')](),controller[_0xcd3d('0x16')]);router[_0xcd3d('0x15')](_0xcd3d('0x11'),auth[_0xcd3d('0x9')](),controller[_0xcd3d('0x17')]);router[_0xcd3d('0x15')]('/:id/users',auth[_0xcd3d('0x9')](),controller['addAgents']);router[_0xcd3d('0x18')](_0xcd3d('0x19'),auth[_0xcd3d('0x9')](),controller[_0xcd3d('0x1a')]);router['delete']('/:id',auth[_0xcd3d('0x9')](),controller['destroy']);router[_0xcd3d('0x1b')](_0xcd3d('0x11'),auth[_0xcd3d('0x9')](),controller[_0xcd3d('0x1c')]);router['delete'](_0xcd3d('0x13'),auth[_0xcd3d('0x9')](),controller[_0xcd3d('0x1d')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index b548a48..7965e1a 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 _0xbf19=['exports','STRING','name','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize'];(function(_0x46567a,_0x407004){var _0x837fd2=function(_0x30e27a){while(--_0x30e27a){_0x46567a['push'](_0x46567a['shift']());}};_0x837fd2(++_0x407004);}(_0xbf19,0x6b));var _0x9bf1=function(_0x2b3bbd,_0x2aa8c){_0x2b3bbd=_0x2b3bbd-0x0;var _0x7bf5d7=_0xbf19[_0x2b3bbd];return _0x7bf5d7;};'use strict';var Sequelize=require(_0x9bf1('0x0'));module[_0x9bf1('0x1')]={'name':{'type':Sequelize[_0x9bf1('0x2')],'unique':_0x9bf1('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x9bf1('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x9bf1('0x5')](_0x9bf1('0x6'),_0x9bf1('0x7'),_0x9bf1('0x8'))}}; \ No newline at end of file +var _0x55d1=['ENUM','rrmemory','roundrobin','sequelize','exports','STRING','name','INTEGER'];(function(_0x2a61b4,_0x16df2d){var _0x3191cd=function(_0x3b4c00){while(--_0x3b4c00){_0x2a61b4['push'](_0x2a61b4['shift']());}};_0x3191cd(++_0x16df2d);}(_0x55d1,0x13b));var _0x155d=function(_0x2538cc,_0x19ea15){_0x2538cc=_0x2538cc-0x0;var _0xa8c32e=_0x55d1[_0x2538cc];return _0xa8c32e;};'use strict';var Sequelize=require(_0x155d('0x0'));module[_0x155d('0x1')]={'name':{'type':Sequelize[_0x155d('0x2')],'unique':_0x155d('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x155d('0x2')]},'timeout':{'type':Sequelize[_0x155d('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x155d('0x5')](_0x155d('0x6'),'beepall',_0x155d('0x7'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 62f6685..d8d5e72 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 _0xe8ac=['compact','value','emit','userOpenchannelQueue:remove','spread','removeAgents','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','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/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','get','OpenchannelQueues','UserProfileResource','destroy','error','stack','name','map','OpenchannelQueue','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','update','body','describe','getMembers','UserOpenchannelQueue','length','nolimit','OpenchannelQueueId','User','findAndCountAll','UserId','agent','openchannelPause','updatedAt','format','%s/%s','createdAt','findOne','Team','addTeams','ids','voicePause','interface','Agents','sequelize','transaction','findOrCreate','forEach','userOpenchannelQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_openchannel_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','toString','SELECT','every','TeamId','includes'];(function(_0x3a6b8f,_0x3ee3a1){var _0x4a9573=function(_0x289c51){while(--_0x289c51){_0x3a6b8f['push'](_0x3a6b8f['shift']());}};_0x4a9573(++_0x3ee3a1);}(_0xe8ac,0x91));var _0xce8a=function(_0x23fb65,_0x56a873){_0x23fb65=_0x23fb65-0x0;var _0x42d6bb=_0xe8ac[_0x23fb65];return _0x42d6bb;};'use strict';var emlformat=require(_0xce8a('0x0'));var rimraf=require(_0xce8a('0x1'));var zipdir=require(_0xce8a('0x2'));var jsonpatch=require(_0xce8a('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xce8a('0x4'));var Mustache=require(_0xce8a('0x5'));var util=require('util');var path=require(_0xce8a('0x6'));var sox=require(_0xce8a('0x7'));var csv=require(_0xce8a('0x8'));var ejs=require(_0xce8a('0x9'));var fs=require('fs');var fs_extra=require(_0xce8a('0xa'));var _=require(_0xce8a('0xb'));var squel=require(_0xce8a('0xc'));var crypto=require(_0xce8a('0xd'));var jsforce=require(_0xce8a('0xe'));var deskjs=require(_0xce8a('0xf'));var toCsv=require(_0xce8a('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xce8a('0x10'));var qs=require(_0xce8a('0x11'));var as=require(_0xce8a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xce8a('0x13'))('api');var utils=require(_0xce8a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xce8a('0x15'));var db=require(_0xce8a('0x16'))['db'];config[_0xce8a('0x17')]=_[_0xce8a('0x18')](config[_0xce8a('0x17')],{'host':_0xce8a('0x19'),'port':0x18eb});var socket=require(_0xce8a('0x1a'))(new Redis(config[_0xce8a('0x17')]));require(_0xce8a('0x1b'))[_0xce8a('0x1c')](socket);function respondWithStatusCode(_0x49e720,_0x51f8ed){_0x51f8ed=_0x51f8ed||0xcc;return function(_0x531242){if(_0x531242){return _0x49e720[_0xce8a('0x1d')](_0x51f8ed);}return _0x49e720['status'](_0x51f8ed)[_0xce8a('0x1e')]();};}function respondWithResult(_0x3ad819,_0x26668d){_0x26668d=_0x26668d||0xc8;return function(_0x58c15b){if(_0x58c15b){return _0x3ad819[_0xce8a('0x1f')](_0x26668d)[_0xce8a('0x20')](_0x58c15b);}};}function respondWithFilteredResult(_0x19924b,_0x1a6b6d){return function(_0x66b454){if(_0x66b454){var _0xf49d62=typeof _0x1a6b6d[_0xce8a('0x21')]===_0xce8a('0x22')&&typeof _0x1a6b6d[_0xce8a('0x23')]==='undefined';var _0x56445c=_0x66b454[_0xce8a('0x24')];var _0x373b07=_0xf49d62?0x0:_0x1a6b6d[_0xce8a('0x21')];var _0x1b7fd9=_0xf49d62?_0x66b454[_0xce8a('0x24')]:_0x1a6b6d[_0xce8a('0x21')]+_0x1a6b6d[_0xce8a('0x23')];var _0x33ed30;if(_0x1b7fd9>=_0x56445c){_0x1b7fd9=_0x56445c;_0x33ed30=0xc8;}else{_0x33ed30=0xce;}_0x19924b[_0xce8a('0x1f')](_0x33ed30);return _0x19924b[_0xce8a('0x25')](_0xce8a('0x26'),_0x373b07+'-'+_0x1b7fd9+'/'+_0x56445c)[_0xce8a('0x20')](_0x66b454);}return null;};}function patchUpdates(_0x3f6299){return function(_0x3407c0){try{jsonpatch[_0xce8a('0x27')](_0x3407c0,_0x3f6299,!![]);}catch(_0x3ea32f){return BPromise[_0xce8a('0x28')](_0x3ea32f);}return _0x3407c0['save']();};}function saveUpdates(_0x451516,_0x1b7ede){return function(_0xfb07b){if(_0xfb07b){return _0xfb07b['update'](_0x451516)[_0xce8a('0x29')](function(_0x109b45){return _0x109b45;});}return null;};}function removeEntity(_0x1600c1,_0x2aa959){return function(_0x253601){if(_0x253601){return _0x253601['destroy']()[_0xce8a('0x29')](function(){var _0x59b3da=_0x253601[_0xce8a('0x2a')]({'plain':!![]});var _0x4a4d22=_0xce8a('0x2b');return db[_0xce8a('0x2c')][_0xce8a('0x2d')]({'where':{'type':_0x4a4d22,'resourceId':_0x59b3da['id']}})[_0xce8a('0x29')](function(){return _0x253601;});})[_0xce8a('0x29')](function(){_0x1600c1['status'](0xcc)[_0xce8a('0x1e')]();});}};}function handleEntityNotFound(_0x42083e,_0x5446ef){return function(_0x512387){if(!_0x512387){_0x42083e[_0xce8a('0x1d')](0x194);}return _0x512387;};}function handleError(_0x3a2622,_0x2fe5c0){_0x2fe5c0=_0x2fe5c0||0x1f4;return function(_0x4f2101){logger[_0xce8a('0x2e')](_0x4f2101[_0xce8a('0x2f')]);if(_0x4f2101[_0xce8a('0x30')]){delete _0x4f2101['name'];}_0x3a2622[_0xce8a('0x1f')](_0x2fe5c0)['send'](_0x4f2101);};}exports['index']=function(_0x4bd229,_0x207111){var _0x43debd={},_0x18d5da={},_0x26e74f={'count':0x0,'rows':[]};var _0x2c09fb=_[_0xce8a('0x31')](db[_0xce8a('0x32')][_0xce8a('0x33')],function(_0x4bf8cf){return{'name':_0x4bf8cf[_0xce8a('0x34')],'type':_0x4bf8cf['type'][_0xce8a('0x35')]};});_0x18d5da[_0xce8a('0x36')]=_['map'](_0x2c09fb,_0xce8a('0x30'));_0x18d5da[_0xce8a('0x37')]=_[_0xce8a('0x38')](_0x4bd229[_0xce8a('0x37')]);_0x18d5da[_0xce8a('0x39')]=_[_0xce8a('0x3a')](_0x18d5da[_0xce8a('0x36')],_0x18d5da['query']);_0x43debd[_0xce8a('0x3b')]=_[_0xce8a('0x3a')](_0x18d5da[_0xce8a('0x36')],qs[_0xce8a('0x3c')](_0x4bd229[_0xce8a('0x37')]['fields']));_0x43debd[_0xce8a('0x3b')]=_0x43debd[_0xce8a('0x3b')]['length']?_0x43debd[_0xce8a('0x3b')]:_0x18d5da[_0xce8a('0x36')];if(!_0x4bd229['query'][_0xce8a('0x3d')]('nolimit')){_0x43debd['limit']=qs[_0xce8a('0x23')](_0x4bd229[_0xce8a('0x37')][_0xce8a('0x23')]);_0x43debd[_0xce8a('0x21')]=qs[_0xce8a('0x21')](_0x4bd229[_0xce8a('0x37')]['offset']);}_0x43debd[_0xce8a('0x3e')]=qs['sort'](_0x4bd229[_0xce8a('0x37')][_0xce8a('0x3f')]);_0x43debd[_0xce8a('0x40')]=qs[_0xce8a('0x39')](_[_0xce8a('0x41')](_0x4bd229['query'],_0x18d5da[_0xce8a('0x39')]),_0x2c09fb);if(_0x4bd229['query'][_0xce8a('0x42')]){_0x43debd[_0xce8a('0x40')]=_[_0xce8a('0x43')](_0x43debd[_0xce8a('0x40')],{'$or':_['map'](_0x2c09fb,function(_0x2e0016){if(_0x2e0016[_0xce8a('0x44')]!==_0xce8a('0x45')){var _0x2e9e44={};_0x2e9e44[_0x2e0016[_0xce8a('0x30')]]={'$like':'%'+_0x4bd229[_0xce8a('0x37')][_0xce8a('0x42')]+'%'};return _0x2e9e44;}})});}_0x43debd=_[_0xce8a('0x43')]({},_0x43debd,_0x4bd229[_0xce8a('0x46')]);var _0x2679e7={'where':_0x43debd[_0xce8a('0x40')]};return db['OpenchannelQueue'][_0xce8a('0x24')](_0x2679e7)[_0xce8a('0x29')](function(_0x3af54e){_0x26e74f[_0xce8a('0x24')]=_0x3af54e;if(_0x4bd229[_0xce8a('0x37')]['includeAll']){_0x43debd[_0xce8a('0x47')]=[{'all':!![]}];}return db[_0xce8a('0x32')][_0xce8a('0x48')](_0x43debd);})[_0xce8a('0x29')](function(_0x4a0280){_0x26e74f[_0xce8a('0x49')]=_0x4a0280;return _0x26e74f;})[_0xce8a('0x29')](respondWithFilteredResult(_0x207111,_0x43debd))[_0xce8a('0x4a')](handleError(_0x207111,null));};exports[_0xce8a('0x4b')]=function(_0x2e685c,_0x3aba8b){var _0x45772b={'raw':!![],'where':{'id':_0x2e685c[_0xce8a('0x4c')]['id']}},_0x5ea5c9={};_0x5ea5c9[_0xce8a('0x36')]=_[_0xce8a('0x38')](db[_0xce8a('0x32')][_0xce8a('0x33')]);_0x5ea5c9[_0xce8a('0x37')]=_[_0xce8a('0x38')](_0x2e685c[_0xce8a('0x37')]);_0x5ea5c9['filters']=_['intersection'](_0x5ea5c9[_0xce8a('0x36')],_0x5ea5c9[_0xce8a('0x37')]);_0x45772b[_0xce8a('0x3b')]=_[_0xce8a('0x3a')](_0x5ea5c9[_0xce8a('0x36')],qs[_0xce8a('0x3c')](_0x2e685c['query'][_0xce8a('0x3c')]));_0x45772b[_0xce8a('0x3b')]=_0x45772b[_0xce8a('0x3b')]['length']?_0x45772b['attributes']:_0x5ea5c9[_0xce8a('0x36')];if(_0x2e685c[_0xce8a('0x37')][_0xce8a('0x4d')]){_0x45772b[_0xce8a('0x47')]=[{'all':!![]}];}_0x45772b=_[_0xce8a('0x43')]({},_0x45772b,_0x2e685c[_0xce8a('0x46')]);return db['OpenchannelQueue']['find'](_0x45772b)[_0xce8a('0x29')](handleEntityNotFound(_0x3aba8b,null))[_0xce8a('0x29')](respondWithResult(_0x3aba8b,null))[_0xce8a('0x4a')](handleError(_0x3aba8b,null));};exports[_0xce8a('0x4e')]=function(_0x448659,_0x2d44f9){return db[_0xce8a('0x32')][_0xce8a('0x4e')](_0x448659['body'],{})[_0xce8a('0x29')](function(_0x55cba1){var _0x5163c0=_0x448659[_0xce8a('0x4f')][_0xce8a('0x2a')]({'plain':!![]});if(!_0x5163c0)throw new Error(_0xce8a('0x50'));if(_0x5163c0[_0xce8a('0x51')]===_0xce8a('0x4f')){var _0x2635dd=_0x55cba1[_0xce8a('0x2a')]({'plain':!![]});var _0x2f1b7f=_0xce8a('0x2b');return db[_0xce8a('0x52')][_0xce8a('0x53')]({'where':{'name':_0x2f1b7f,'userProfileId':_0x5163c0[_0xce8a('0x54')]},'raw':!![]})[_0xce8a('0x29')](function(_0x37c85f){if(_0x37c85f&&_0x37c85f[_0xce8a('0x55')]===0x0){return db[_0xce8a('0x2c')][_0xce8a('0x4e')]({'name':_0x2635dd['name'],'resourceId':_0x2635dd['id'],'type':_0x37c85f[_0xce8a('0x30')],'sectionId':_0x37c85f['id']},{})[_0xce8a('0x29')](function(){return _0x55cba1;});}else{return _0x55cba1;}})['catch'](function(_0x85be34){logger[_0xce8a('0x2e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x85be34);throw _0x85be34;});}return _0x55cba1;})['then'](respondWithResult(_0x2d44f9,0xc9))[_0xce8a('0x4a')](handleError(_0x2d44f9,null));};exports[_0xce8a('0x56')]=function(_0x3177df,_0x56df8e){if(_0x3177df['body']['id']){delete _0x3177df[_0xce8a('0x57')]['id'];}return db['OpenchannelQueue'][_0xce8a('0x53')]({'where':{'id':_0x3177df[_0xce8a('0x4c')]['id']}})[_0xce8a('0x29')](handleEntityNotFound(_0x56df8e,null))['then'](saveUpdates(_0x3177df[_0xce8a('0x57')],null))[_0xce8a('0x29')](respondWithResult(_0x56df8e,null))['catch'](handleError(_0x56df8e,null));};exports[_0xce8a('0x2d')]=function(_0x3d81a5,_0x15a2a4){return db[_0xce8a('0x32')]['find']({'where':{'id':_0x3d81a5[_0xce8a('0x4c')]['id']}})[_0xce8a('0x29')](handleEntityNotFound(_0x15a2a4,null))[_0xce8a('0x29')](removeEntity(_0x15a2a4,null))['catch'](handleError(_0x15a2a4,null));};exports['describe']=function(_0x5bfdcc,_0x1f35ed){return db['OpenchannelQueue'][_0xce8a('0x58')]()[_0xce8a('0x29')](respondWithResult(_0x1f35ed,null))[_0xce8a('0x4a')](handleError(_0x1f35ed,null));};exports[_0xce8a('0x59')]=function(_0x35a7aa,_0xffeeba,_0xade6c9){var _0x1275d7={'raw':!![],'where':{}},_0x991e71={},_0x58f8a8;return db[_0xce8a('0x32')]['findOne']({'where':{'id':_0x35a7aa[_0xce8a('0x4c')]['id']}})[_0xce8a('0x29')](handleEntityNotFound(_0xffeeba,null))[_0xce8a('0x29')](function(_0x5da431){if(_0x5da431){_0x58f8a8=_0x5da431[_0xce8a('0x2a')]({'plain':!![]});_0x991e71['model']=_[_0xce8a('0x38')](db[_0xce8a('0x5a')][_0xce8a('0x33')]);_0x991e71[_0xce8a('0x37')]=_['keys'](_0x35a7aa[_0xce8a('0x37')]);_0x991e71[_0xce8a('0x39')]=_[_0xce8a('0x3a')](_0x991e71['model'],_0x991e71[_0xce8a('0x37')]);_0x1275d7[_0xce8a('0x3b')]=_[_0xce8a('0x3a')](_0x991e71[_0xce8a('0x36')],qs['fields'](_0x35a7aa[_0xce8a('0x37')]['fields']));_0x1275d7[_0xce8a('0x3b')]=_0x1275d7[_0xce8a('0x3b')][_0xce8a('0x5b')]?_0x1275d7[_0xce8a('0x3b')]:_0x991e71[_0xce8a('0x36')];if(!_0x35a7aa[_0xce8a('0x37')][_0xce8a('0x3d')](_0xce8a('0x5c'))){_0x1275d7['limit']=qs['limit'](_0x35a7aa[_0xce8a('0x37')]['limit']);_0x1275d7['offset']=qs[_0xce8a('0x21')](_0x35a7aa[_0xce8a('0x37')][_0xce8a('0x21')]);}_0x1275d7[_0xce8a('0x3e')]=qs[_0xce8a('0x3f')](_0x35a7aa[_0xce8a('0x37')][_0xce8a('0x3f')]);_0x1275d7[_0xce8a('0x40')]=qs[_0xce8a('0x39')](_[_0xce8a('0x41')](_0x35a7aa['query'],_0x991e71[_0xce8a('0x39')]));_0x1275d7[_0xce8a('0x40')][_0xce8a('0x5d')]=_0x5da431['id'];if(_0x35a7aa[_0xce8a('0x37')][_0xce8a('0x42')]){_0x1275d7['where']=_[_0xce8a('0x43')](_0x1275d7['where'],{'$or':_[_0xce8a('0x31')](_0x1275d7[_0xce8a('0x3b')],function(_0x198399){var _0x21b1ec={};_0x21b1ec[_0x198399]={'$like':'%'+_0x35a7aa['query'][_0xce8a('0x42')]+'%'};return _0x21b1ec;})});}_0x1275d7=_[_0xce8a('0x43')]({},_0x1275d7,_0x35a7aa[_0xce8a('0x46')]);return db[_0xce8a('0x5a')]['findAll'](_0x1275d7);}})[_0xce8a('0x29')](function(_0x235b53){if(_0x235b53){return db[_0xce8a('0x5e')][_0xce8a('0x5f')]({'where':{'id':_[_0xce8a('0x31')](_0x235b53,_0xce8a('0x60')),'role':_0xce8a('0x61')},'attributes':['id',_0xce8a('0x30'),_0xce8a('0x62'),_0xce8a('0x63'),'createdAt']});}})[_0xce8a('0x29')](function(_0x25775b){if(_0x25775b){return{'count':_0x25775b[_0xce8a('0x24')],'rows':_['map'](_0x25775b[_0xce8a('0x49')],function(_0x572ba6){return{'membername':_0x572ba6[_0xce8a('0x30')],'UserId':_0x572ba6['id'],'queue_name':_0x58f8a8[_0xce8a('0x30')],'OpenchannelQueueId':_0x58f8a8['id'],'interface':util[_0xce8a('0x64')](_0xce8a('0x65'),'SIP',_0x572ba6[_0xce8a('0x30')]),'penalty':0x0,'paused':_0x572ba6['openchannelPause'],'createdAt':_0x572ba6[_0xce8a('0x66')],'updatedAt':_0x572ba6[_0xce8a('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xce8a('0x29')](respondWithFilteredResult(_0xffeeba,_0x1275d7))[_0xce8a('0x4a')](handleError(_0xffeeba,null));};exports['getTeams']=function(_0x3eea77,_0x35713e,_0x404a49){var _0x73c842={};var _0x32eb66={};var _0x319098;var _0x9c0da4;return db[_0xce8a('0x32')][_0xce8a('0x67')]({'where':{'id':_0x3eea77['params']['id']}})[_0xce8a('0x29')](handleEntityNotFound(_0x35713e,null))[_0xce8a('0x29')](function(_0x581f51){if(_0x581f51){_0x319098=_0x581f51;_0x32eb66[_0xce8a('0x36')]=_[_0xce8a('0x38')](db[_0xce8a('0x68')][_0xce8a('0x33')]);_0x32eb66['query']=_['keys'](_0x3eea77['query']);_0x32eb66[_0xce8a('0x39')]=_[_0xce8a('0x3a')](_0x32eb66['model'],_0x32eb66[_0xce8a('0x37')]);_0x73c842[_0xce8a('0x3b')]=_[_0xce8a('0x3a')](_0x32eb66[_0xce8a('0x36')],qs[_0xce8a('0x3c')](_0x3eea77[_0xce8a('0x37')]['fields']));_0x73c842['attributes']=_0x73c842['attributes']['length']?_0x73c842[_0xce8a('0x3b')]:_0x32eb66[_0xce8a('0x36')];_0x73c842[_0xce8a('0x3e')]=qs[_0xce8a('0x3f')](_0x3eea77['query'][_0xce8a('0x3f')]);_0x73c842['where']=qs['filters'](_['pick'](_0x3eea77[_0xce8a('0x37')],_0x32eb66[_0xce8a('0x39')]));if(_0x3eea77[_0xce8a('0x37')][_0xce8a('0x42')]){_0x73c842[_0xce8a('0x40')]=_['merge'](_0x73c842[_0xce8a('0x40')],{'$or':_['map'](_0x73c842[_0xce8a('0x3b')],function(_0x3dda98){var _0x4efbd3={};_0x4efbd3[_0x3dda98]={'$like':'%'+_0x3eea77[_0xce8a('0x37')]['filter']+'%'};return _0x4efbd3;})});}_0x73c842=_[_0xce8a('0x43')]({},_0x73c842,_0x3eea77[_0xce8a('0x46')]);return _0x319098['getTeams'](_0x73c842);}})[_0xce8a('0x29')](function(_0x3346b4){if(_0x3346b4){_0x9c0da4=_0x3346b4[_0xce8a('0x5b')];if(!_0x3eea77[_0xce8a('0x37')]['hasOwnProperty'](_0xce8a('0x5c'))){_0x73c842[_0xce8a('0x23')]=qs[_0xce8a('0x23')](_0x3eea77['query']['limit']);_0x73c842[_0xce8a('0x21')]=qs[_0xce8a('0x21')](_0x3eea77['query'][_0xce8a('0x21')]);}return _0x319098['getTeams'](_0x73c842);}})[_0xce8a('0x29')](function(_0x199cef){if(_0x199cef){return _0x199cef?{'count':_0x9c0da4,'rows':_0x199cef}:null;}})[_0xce8a('0x29')](respondWithResult(_0x35713e,null))[_0xce8a('0x4a')](handleError(_0x35713e,null));};exports[_0xce8a('0x69')]=function(_0x387ef6,_0x38416c,_0x398bd5){var _0x53bf9d=_0x387ef6[_0xce8a('0x57')][_0xce8a('0x6a')];return db[_0xce8a('0x68')][_0xce8a('0x48')]({'where':{'id':_0x53bf9d},'attributes':['id'],'include':[{'model':db[_0xce8a('0x5e')],'as':'Agents','attributes':['id',_0xce8a('0x30'),'online',_0xce8a('0x6b'),_0xce8a('0x6c')],'raw':!![]}]})[_0xce8a('0x29')](function(_0x2881a1){if(_0x2881a1){var _0x39b78=_['flatMap'](_0x2881a1,function(_0x2c5aef){var _0x37e2d6=_0x2c5aef[_0xce8a('0x2a')]({'plain':!![]});return _0x37e2d6[_0xce8a('0x6d')];});return db[_0xce8a('0x32')][_0xce8a('0x53')]({'where':{'id':_0x387ef6[_0xce8a('0x4c')]['id']}})[_0xce8a('0x29')](function(_0x22e026){return db[_0xce8a('0x6e')][_0xce8a('0x6f')](function(_0x517162){return _0x22e026[_0xce8a('0x69')](_0x53bf9d,{'transaction':_0x517162})[_0xce8a('0x29')](function(){return BPromise['each'](_0x39b78,function(_0x395cc6){return db['UserOpenchannelQueue'][_0xce8a('0x70')]({'where':{'UserId':_0x395cc6['id'],'OpenchannelQueueId':_0x387ef6[_0xce8a('0x4c')]['id']},'transaction':_0x517162});});})[_0xce8a('0x29')](function(){_0x39b78[_0xce8a('0x71')](function(_0x588504){socket['emit'](_0xce8a('0x72'),{'UserId':_0x588504['id'],'OpenchannelQueueId':_0x22e026['id']});});});});});}})[_0xce8a('0x29')](respondWithStatusCode(_0x38416c,null))['catch'](handleError(_0x38416c,null));};exports[_0xce8a('0x73')]=function(_0x4038f5,_0x46df6f,_0x2945f5){return db['Team'][_0xce8a('0x48')]({'where':{'id':_0x4038f5['query'][_0xce8a('0x6a')]},'attributes':['id'],'include':[{'model':db[_0xce8a('0x5e')],'as':_0xce8a('0x6d'),'attributes':['id'],'raw':!![]}]})[_0xce8a('0x29')](handleEntityNotFound(_0x46df6f,null))[_0xce8a('0x29')](function(_0x3ec694){var _0x367b1a=_[_0xce8a('0x31')](_0x3ec694,'id');var _0x351334=[];var _0x52f04d=[];var _0x2d4130=squel[_0xce8a('0x74')]();_0x2d4130[_0xce8a('0x75')](_0xce8a('0x76'))[_0xce8a('0x77')](_0xce8a('0x78'),'tq')[_0xce8a('0x79')](_0xce8a('0x7a'),'ut',_0xce8a('0x7b'))[_0xce8a('0x40')]('OpenchannelQueueId\x20=\x20?',_0x4038f5['params']['id']);for(var _0x4e87ab=0x0;_0x4e87ab<_0x3ec694[_0xce8a('0x5b')];_0x4e87ab+=0x1){let _0x16c1d4=_0x3ec694[_0x4e87ab];for(var _0x57fbf0=0x0;_0x57fbf0<_0x16c1d4['Agents'][_0xce8a('0x5b')];_0x57fbf0+=0x1){let _0x5003df=_0x16c1d4[_0xce8a('0x6d')][_0x57fbf0];var _0x1ceee3=_0x2d4130[_0xce8a('0x7c')]();_0x1ceee3[_0xce8a('0x40')](_0xce8a('0x7d'),_0x5003df['id']);_0x52f04d['push'](db[_0xce8a('0x6e')][_0xce8a('0x37')](_0x1ceee3[_0xce8a('0x7e')](),{'type':db[_0xce8a('0x6e')]['QueryTypes'][_0xce8a('0x7f')]})[_0xce8a('0x29')](function(_0xf66e85){if(_0xf66e85[_0xce8a('0x5b')]===0x1){return _0x5003df['id'];}else{var _0x23b5d4=_[_0xce8a('0x80')](_[_0xce8a('0x31')](_0xf66e85,_0xce8a('0x81')),function(_0x233cfc){return _[_0xce8a('0x82')](_0x367b1a,_0x233cfc);});if(_0x23b5d4){return _0x5003df['id'];}}}));}}return BPromise['all'](_0x52f04d)['then'](function(_0x36c3aa){_0x351334=_(_0x351334)['union'](_0x36c3aa)[_0xce8a('0x83')]()[_0xce8a('0x84')]();return db[_0xce8a('0x32')][_0xce8a('0x53')]({'where':{'id':_0x4038f5[_0xce8a('0x4c')]['id']}})[_0xce8a('0x29')](function(_0x58ac36){return db['sequelize'][_0xce8a('0x6f')](function(_0x29c4b4){return _0x58ac36[_0xce8a('0x73')](_0x4038f5[_0xce8a('0x37')]['ids'],{'transaction':_0x29c4b4})[_0xce8a('0x29')](function(){if(!_['isEmpty'](_0x351334)){return _0x58ac36['removeAgents'](_0x351334,{'transaction':_0x29c4b4});}})[_0xce8a('0x29')](function(){_0x351334[_0xce8a('0x71')](function(_0x3ae043){socket[_0xce8a('0x85')](_0xce8a('0x86'),{'UserId':_0x3ae043,'OpenchannelQueueId':_0x58ac36['id']});});});});});});})['then'](respondWithStatusCode(_0x46df6f,null))[_0xce8a('0x4a')](handleError(_0x46df6f,null));};exports['addAgents']=function(_0x3fa1cf,_0x37d7bd,_0x11c25c){return db[_0xce8a('0x32')]['find']({'where':{'id':_0x3fa1cf[_0xce8a('0x4c')]['id']}})[_0xce8a('0x29')](handleEntityNotFound(_0x37d7bd,null))[_0xce8a('0x29')](function(_0x1c5e58){if(_0x1c5e58){return _0x1c5e58['addAgents'](_0x3fa1cf['body'][_0xce8a('0x6a')],_['omit'](_0x3fa1cf[_0xce8a('0x57')],[_0xce8a('0x6a'),'id'])||{})[_0xce8a('0x87')](function(_0x3bb1ed){for(var _0x340cf3=0x0;_0x340cf3<_0x3fa1cf[_0xce8a('0x57')][_0xce8a('0x6a')][_0xce8a('0x5b')];_0x340cf3+=0x1){socket[_0xce8a('0x85')](_0xce8a('0x72'),{'UserId':Number(_0x3fa1cf['body'][_0xce8a('0x6a')][_0x340cf3]),'OpenchannelQueueId':Number(_0x3fa1cf[_0xce8a('0x4c')]['id'])});}return _0x3bb1ed;});}})[_0xce8a('0x29')](respondWithResult(_0x37d7bd,null))[_0xce8a('0x4a')](handleError(_0x37d7bd,null));};exports['removeAgents']=function(_0x4b23b0,_0x5c639d,_0x2493e6){return db[_0xce8a('0x32')][_0xce8a('0x53')]({'where':{'id':_0x4b23b0[_0xce8a('0x4c')]['id']}})[_0xce8a('0x29')](handleEntityNotFound(_0x5c639d,null))[_0xce8a('0x29')](function(_0x2e0bb8){if(_0x2e0bb8){return _0x2e0bb8[_0xce8a('0x88')](_0x4b23b0['query'][_0xce8a('0x6a')])['then'](function(){if(_['isArray'](_0x4b23b0[_0xce8a('0x37')]['ids'])){for(var _0x15f10c=0x0;_0x15f10c<_0x4b23b0['query'][_0xce8a('0x6a')][_0xce8a('0x5b')];_0x15f10c+=0x1){socket[_0xce8a('0x85')](_0xce8a('0x86'),{'UserId':Number(_0x4b23b0[_0xce8a('0x37')][_0xce8a('0x6a')][_0x15f10c]),'OpenchannelQueueId':Number(_0x4b23b0['params']['id'])});}}else{socket[_0xce8a('0x85')](_0xce8a('0x86'),{'UserId':Number(_0x4b23b0[_0xce8a('0x37')][_0xce8a('0x6a')]),'OpenchannelQueueId':Number(_0x4b23b0[_0xce8a('0x4c')]['id'])});}});}})['then'](respondWithStatusCode(_0x5c639d,null))['catch'](handleError(_0x5c639d,null));};exports['getAgents']=function(_0x2969de,_0x45c72d,_0x480ac4){var _0x2af2a9={};var _0x40b94a={};var _0x38dd4d;var _0x60bae9;return db[_0xce8a('0x32')]['findOne']({'where':{'id':_0x2969de[_0xce8a('0x4c')]['id']}})[_0xce8a('0x29')](handleEntityNotFound(_0x45c72d,null))[_0xce8a('0x29')](function(_0x3fec8f){if(_0x3fec8f){_0x38dd4d=_0x3fec8f;_0x40b94a[_0xce8a('0x36')]=_[_0xce8a('0x38')](db[_0xce8a('0x5e')][_0xce8a('0x33')]);_0x40b94a[_0xce8a('0x37')]=_[_0xce8a('0x38')](_0x2969de[_0xce8a('0x37')]);_0x40b94a[_0xce8a('0x39')]=_['intersection'](_0x40b94a['model'],_0x40b94a[_0xce8a('0x37')]);_0x2af2a9[_0xce8a('0x3b')]=_[_0xce8a('0x3a')](_0x40b94a['model'],qs['fields'](_0x2969de[_0xce8a('0x37')][_0xce8a('0x3c')]));_0x2af2a9[_0xce8a('0x3b')]=_0x2af2a9[_0xce8a('0x3b')][_0xce8a('0x5b')]?_0x2af2a9[_0xce8a('0x3b')]:_0x40b94a[_0xce8a('0x36')];_0x2af2a9[_0xce8a('0x3e')]=qs[_0xce8a('0x3f')](_0x2969de[_0xce8a('0x37')][_0xce8a('0x3f')]);_0x2af2a9[_0xce8a('0x40')]=qs[_0xce8a('0x39')](_[_0xce8a('0x41')](_0x2969de[_0xce8a('0x37')],_0x40b94a[_0xce8a('0x39')]));if(_0x2969de[_0xce8a('0x37')][_0xce8a('0x42')]){_0x2af2a9[_0xce8a('0x40')]=_[_0xce8a('0x43')](_0x2af2a9[_0xce8a('0x40')],{'$or':_[_0xce8a('0x31')](_0x2af2a9['attributes'],function(_0x40d07b){var _0x594fec={};_0x594fec[_0x40d07b]={'$like':'%'+_0x2969de[_0xce8a('0x37')]['filter']+'%'};return _0x594fec;})});}_0x2af2a9=_['merge']({},_0x2af2a9,_0x2969de[_0xce8a('0x46')]);return _0x38dd4d[_0xce8a('0x89')](_0x2af2a9);}})[_0xce8a('0x29')](function(_0x48bd81){if(_0x48bd81){_0x60bae9=_0x48bd81['length'];if(!_0x2969de[_0xce8a('0x37')][_0xce8a('0x3d')](_0xce8a('0x5c'))){_0x2af2a9[_0xce8a('0x23')]=qs['limit'](_0x2969de['query'][_0xce8a('0x23')]);_0x2af2a9[_0xce8a('0x21')]=qs[_0xce8a('0x21')](_0x2969de[_0xce8a('0x37')][_0xce8a('0x21')]);}return _0x38dd4d[_0xce8a('0x89')](_0x2af2a9);}})[_0xce8a('0x29')](function(_0x536dbe){if(_0x536dbe){return _0x536dbe?{'count':_0x60bae9,'rows':_0x536dbe}:null;}})['then'](respondWithResult(_0x45c72d,null))[_0xce8a('0x4a')](handleError(_0x45c72d,null));}; \ No newline at end of file +var _0x7e8c=['Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','UserOpenchannelQueue','order','OpenchannelQueueId','User','findAndCountAll','UserId','agent','openchannelPause','updatedAt','createdAt','format','SIP','findOne','Team','getTeams','Agents','voicePause','interface','sequelize','each','findOrCreate','emit','userOpenchannelQueue:save','removeTeams','ids','select','field','tq.TeamId','from','team_has_openchannel_queues','join','user_has_teams','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','SELECT','every','TeamId','includes','value','transaction','isEmpty','removeAgents','forEach','userOpenchannelQueue:remove','addAgents','omit','spread','isArray','getAgents','rimraf','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','status','offset','undefined','limit','count','json','apply','reject','update','then','destroy','get','OpenchannelQueues','end','sendStatus','error','stack','name','send','map','OpenchannelQueue','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','pick','filter','where','VIRTUAL','options','includeAll','include','findAll','rows','params','rawAttributes','merge','catch','create','body','user','role','find','userProfileId','autoAssociation'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0x7e8c,0x1cc));var _0xc7e8=function(_0x112424,_0x2fd141){_0x112424=_0x112424-0x0;var _0x22fc9c=_0x7e8c[_0x112424];return _0x22fc9c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc7e8('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc7e8('0x1'));var rp=require('request-promise');var moment=require(_0xc7e8('0x2'));var BPromise=require(_0xc7e8('0x3'));var Mustache=require('mustache');var util=require(_0xc7e8('0x4'));var path=require(_0xc7e8('0x5'));var sox=require(_0xc7e8('0x6'));var csv=require(_0xc7e8('0x7'));var ejs=require(_0xc7e8('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc7e8('0x9'));var squel=require(_0xc7e8('0xa'));var crypto=require('crypto');var jsforce=require(_0xc7e8('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xc7e8('0x7'));var querystring=require(_0xc7e8('0xc'));var Papa=require('papaparse');var Redis=require(_0xc7e8('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xc7e8('0xe'));var as=require(_0xc7e8('0xf'));var hardwareService=require(_0xc7e8('0x10'));var logger=require(_0xc7e8('0x11'))(_0xc7e8('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc7e8('0x13'));var db=require(_0xc7e8('0x14'))['db'];config[_0xc7e8('0x15')]=_[_0xc7e8('0x16')](config[_0xc7e8('0x15')],{'host':_0xc7e8('0x17'),'port':0x18eb});var socket=require(_0xc7e8('0x18'))(new Redis(config['redis']));require('./openchannelQueue.socket')[_0xc7e8('0x19')](socket);function respondWithStatusCode(_0xaeffb4,_0x170b4a){_0x170b4a=_0x170b4a||0xcc;return function(_0x3b0f2b){if(_0x3b0f2b){return _0xaeffb4['sendStatus'](_0x170b4a);}return _0xaeffb4[_0xc7e8('0x1a')](_0x170b4a)['end']();};}function respondWithResult(_0x322b28,_0x5044df){_0x5044df=_0x5044df||0xc8;return function(_0x1fc44c){if(_0x1fc44c){return _0x322b28[_0xc7e8('0x1a')](_0x5044df)['json'](_0x1fc44c);}};}function respondWithFilteredResult(_0x1b1e70,_0x319124){return function(_0x4c3e02){if(_0x4c3e02){var _0x49aa73=typeof _0x319124[_0xc7e8('0x1b')]===_0xc7e8('0x1c')&&typeof _0x319124[_0xc7e8('0x1d')]===_0xc7e8('0x1c');var _0x172ee5=_0x4c3e02['count'];var _0x337f8b=_0x49aa73?0x0:_0x319124[_0xc7e8('0x1b')];var _0x143023=_0x49aa73?_0x4c3e02[_0xc7e8('0x1e')]:_0x319124[_0xc7e8('0x1b')]+_0x319124[_0xc7e8('0x1d')];var _0x209484;if(_0x143023>=_0x172ee5){_0x143023=_0x172ee5;_0x209484=0xc8;}else{_0x209484=0xce;}_0x1b1e70['status'](_0x209484);return _0x1b1e70['set']('Content-Range',_0x337f8b+'-'+_0x143023+'/'+_0x172ee5)[_0xc7e8('0x1f')](_0x4c3e02);}return null;};}function patchUpdates(_0x5e1dfa){return function(_0x4ba4c7){try{jsonpatch[_0xc7e8('0x20')](_0x4ba4c7,_0x5e1dfa,!![]);}catch(_0x2b1ff4){return BPromise[_0xc7e8('0x21')](_0x2b1ff4);}return _0x4ba4c7['save']();};}function saveUpdates(_0x45d454,_0x44d6d7){return function(_0x2dd31c){if(_0x2dd31c){return _0x2dd31c[_0xc7e8('0x22')](_0x45d454)[_0xc7e8('0x23')](function(_0x5c2aef){return _0x5c2aef;});}return null;};}function removeEntity(_0x5211fa,_0x25e78b){return function(_0x4efb9e){if(_0x4efb9e){return _0x4efb9e[_0xc7e8('0x24')]()[_0xc7e8('0x23')](function(){var _0x4de457=_0x4efb9e[_0xc7e8('0x25')]({'plain':!![]});var _0x4b027e=_0xc7e8('0x26');return db['UserProfileResource'][_0xc7e8('0x24')]({'where':{'type':_0x4b027e,'resourceId':_0x4de457['id']}})[_0xc7e8('0x23')](function(){return _0x4efb9e;});})[_0xc7e8('0x23')](function(){_0x5211fa[_0xc7e8('0x1a')](0xcc)[_0xc7e8('0x27')]();});}};}function handleEntityNotFound(_0x1776d9,_0x26e575){return function(_0x55c0c1){if(!_0x55c0c1){_0x1776d9[_0xc7e8('0x28')](0x194);}return _0x55c0c1;};}function handleError(_0x154e78,_0x291ace){_0x291ace=_0x291ace||0x1f4;return function(_0x20afff){logger[_0xc7e8('0x29')](_0x20afff[_0xc7e8('0x2a')]);if(_0x20afff['name']){delete _0x20afff[_0xc7e8('0x2b')];}_0x154e78[_0xc7e8('0x1a')](_0x291ace)[_0xc7e8('0x2c')](_0x20afff);};}exports['index']=function(_0x3e7b2b,_0x26524c){var _0x5632ea={},_0x139123={},_0x24c4f5={'count':0x0,'rows':[]};var _0x1cc685=_[_0xc7e8('0x2d')](db[_0xc7e8('0x2e')]['rawAttributes'],function(_0x52718e){return{'name':_0x52718e['fieldName'],'type':_0x52718e[_0xc7e8('0x2f')][_0xc7e8('0x30')]};});_0x139123[_0xc7e8('0x31')]=_[_0xc7e8('0x2d')](_0x1cc685,_0xc7e8('0x2b'));_0x139123[_0xc7e8('0x32')]=_[_0xc7e8('0x33')](_0x3e7b2b[_0xc7e8('0x32')]);_0x139123['filters']=_[_0xc7e8('0x34')](_0x139123[_0xc7e8('0x31')],_0x139123[_0xc7e8('0x32')]);_0x5632ea[_0xc7e8('0x35')]=_[_0xc7e8('0x34')](_0x139123[_0xc7e8('0x31')],qs[_0xc7e8('0x36')](_0x3e7b2b['query']['fields']));_0x5632ea[_0xc7e8('0x35')]=_0x5632ea['attributes'][_0xc7e8('0x37')]?_0x5632ea[_0xc7e8('0x35')]:_0x139123['model'];if(!_0x3e7b2b[_0xc7e8('0x32')][_0xc7e8('0x38')](_0xc7e8('0x39'))){_0x5632ea['limit']=qs[_0xc7e8('0x1d')](_0x3e7b2b[_0xc7e8('0x32')][_0xc7e8('0x1d')]);_0x5632ea[_0xc7e8('0x1b')]=qs[_0xc7e8('0x1b')](_0x3e7b2b[_0xc7e8('0x32')][_0xc7e8('0x1b')]);}_0x5632ea['order']=qs[_0xc7e8('0x3a')](_0x3e7b2b[_0xc7e8('0x32')][_0xc7e8('0x3a')]);_0x5632ea['where']=qs[_0xc7e8('0x3b')](_[_0xc7e8('0x3c')](_0x3e7b2b[_0xc7e8('0x32')],_0x139123['filters']),_0x1cc685);if(_0x3e7b2b[_0xc7e8('0x32')][_0xc7e8('0x3d')]){_0x5632ea['where']=_['merge'](_0x5632ea[_0xc7e8('0x3e')],{'$or':_['map'](_0x1cc685,function(_0x5942b8){if(_0x5942b8[_0xc7e8('0x2f')]!==_0xc7e8('0x3f')){var _0x36288c={};_0x36288c[_0x5942b8['name']]={'$like':'%'+_0x3e7b2b[_0xc7e8('0x32')]['filter']+'%'};return _0x36288c;}})});}_0x5632ea=_['merge']({},_0x5632ea,_0x3e7b2b[_0xc7e8('0x40')]);var _0x4085ef={'where':_0x5632ea[_0xc7e8('0x3e')]};return db[_0xc7e8('0x2e')][_0xc7e8('0x1e')](_0x4085ef)[_0xc7e8('0x23')](function(_0x129604){_0x24c4f5[_0xc7e8('0x1e')]=_0x129604;if(_0x3e7b2b[_0xc7e8('0x32')][_0xc7e8('0x41')]){_0x5632ea[_0xc7e8('0x42')]=[{'all':!![]}];}return db[_0xc7e8('0x2e')][_0xc7e8('0x43')](_0x5632ea);})[_0xc7e8('0x23')](function(_0x409376){_0x24c4f5[_0xc7e8('0x44')]=_0x409376;return _0x24c4f5;})[_0xc7e8('0x23')](respondWithFilteredResult(_0x26524c,_0x5632ea))['catch'](handleError(_0x26524c,null));};exports['show']=function(_0x10ee19,_0x357815){var _0x22aa08={'raw':!![],'where':{'id':_0x10ee19[_0xc7e8('0x45')]['id']}},_0x16d3f9={};_0x16d3f9[_0xc7e8('0x31')]=_[_0xc7e8('0x33')](db[_0xc7e8('0x2e')][_0xc7e8('0x46')]);_0x16d3f9['query']=_[_0xc7e8('0x33')](_0x10ee19[_0xc7e8('0x32')]);_0x16d3f9[_0xc7e8('0x3b')]=_[_0xc7e8('0x34')](_0x16d3f9['model'],_0x16d3f9[_0xc7e8('0x32')]);_0x22aa08[_0xc7e8('0x35')]=_[_0xc7e8('0x34')](_0x16d3f9['model'],qs[_0xc7e8('0x36')](_0x10ee19[_0xc7e8('0x32')][_0xc7e8('0x36')]));_0x22aa08[_0xc7e8('0x35')]=_0x22aa08['attributes'][_0xc7e8('0x37')]?_0x22aa08[_0xc7e8('0x35')]:_0x16d3f9[_0xc7e8('0x31')];if(_0x10ee19[_0xc7e8('0x32')]['includeAll']){_0x22aa08[_0xc7e8('0x42')]=[{'all':!![]}];}_0x22aa08=_[_0xc7e8('0x47')]({},_0x22aa08,_0x10ee19[_0xc7e8('0x40')]);return db[_0xc7e8('0x2e')]['find'](_0x22aa08)[_0xc7e8('0x23')](handleEntityNotFound(_0x357815,null))['then'](respondWithResult(_0x357815,null))[_0xc7e8('0x48')](handleError(_0x357815,null));};exports['create']=function(_0x5500ce,_0x240f3d){return db[_0xc7e8('0x2e')][_0xc7e8('0x49')](_0x5500ce[_0xc7e8('0x4a')],{})[_0xc7e8('0x23')](function(_0x437a65){var _0x3b2951=_0x5500ce[_0xc7e8('0x4b')]['get']({'plain':!![]});if(!_0x3b2951)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3b2951[_0xc7e8('0x4c')]===_0xc7e8('0x4b')){var _0x4c893d=_0x437a65[_0xc7e8('0x25')]({'plain':!![]});var _0x120d12=_0xc7e8('0x26');return db['UserProfileSection'][_0xc7e8('0x4d')]({'where':{'name':_0x120d12,'userProfileId':_0x3b2951[_0xc7e8('0x4e')]},'raw':!![]})[_0xc7e8('0x23')](function(_0x41513e){if(_0x41513e&&_0x41513e[_0xc7e8('0x4f')]===0x0){return db['UserProfileResource'][_0xc7e8('0x49')]({'name':_0x4c893d[_0xc7e8('0x2b')],'resourceId':_0x4c893d['id'],'type':_0x41513e[_0xc7e8('0x2b')],'sectionId':_0x41513e['id']},{})[_0xc7e8('0x23')](function(){return _0x437a65;});}else{return _0x437a65;}})['catch'](function(_0x1b6d3d){logger[_0xc7e8('0x29')](_0xc7e8('0x50'),_0x1b6d3d);throw _0x1b6d3d;});}return _0x437a65;})['then'](respondWithResult(_0x240f3d,0xc9))[_0xc7e8('0x48')](handleError(_0x240f3d,null));};exports[_0xc7e8('0x22')]=function(_0x555467,_0x54c1f9){if(_0x555467[_0xc7e8('0x4a')]['id']){delete _0x555467[_0xc7e8('0x4a')]['id'];}return db[_0xc7e8('0x2e')][_0xc7e8('0x4d')]({'where':{'id':_0x555467[_0xc7e8('0x45')]['id']}})[_0xc7e8('0x23')](handleEntityNotFound(_0x54c1f9,null))[_0xc7e8('0x23')](saveUpdates(_0x555467[_0xc7e8('0x4a')],null))[_0xc7e8('0x23')](respondWithResult(_0x54c1f9,null))[_0xc7e8('0x48')](handleError(_0x54c1f9,null));};exports[_0xc7e8('0x24')]=function(_0x10a5a0,_0x24d84b){return db[_0xc7e8('0x2e')][_0xc7e8('0x4d')]({'where':{'id':_0x10a5a0['params']['id']}})['then'](handleEntityNotFound(_0x24d84b,null))[_0xc7e8('0x23')](removeEntity(_0x24d84b,null))['catch'](handleError(_0x24d84b,null));};exports[_0xc7e8('0x51')]=function(_0x48b8f0,_0x252c2f){return db['OpenchannelQueue']['describe']()[_0xc7e8('0x23')](respondWithResult(_0x252c2f,null))['catch'](handleError(_0x252c2f,null));};exports[_0xc7e8('0x52')]=function(_0x458d36,_0x293571,_0x346d08){var _0x9cf427={'raw':!![],'where':{}},_0x3cb2ed={},_0x112e56;return db[_0xc7e8('0x2e')]['findOne']({'where':{'id':_0x458d36['params']['id']}})[_0xc7e8('0x23')](handleEntityNotFound(_0x293571,null))[_0xc7e8('0x23')](function(_0x5087ed){if(_0x5087ed){_0x112e56=_0x5087ed[_0xc7e8('0x25')]({'plain':!![]});_0x3cb2ed['model']=_[_0xc7e8('0x33')](db[_0xc7e8('0x53')][_0xc7e8('0x46')]);_0x3cb2ed[_0xc7e8('0x32')]=_[_0xc7e8('0x33')](_0x458d36[_0xc7e8('0x32')]);_0x3cb2ed[_0xc7e8('0x3b')]=_[_0xc7e8('0x34')](_0x3cb2ed[_0xc7e8('0x31')],_0x3cb2ed['query']);_0x9cf427[_0xc7e8('0x35')]=_[_0xc7e8('0x34')](_0x3cb2ed[_0xc7e8('0x31')],qs[_0xc7e8('0x36')](_0x458d36[_0xc7e8('0x32')]['fields']));_0x9cf427['attributes']=_0x9cf427[_0xc7e8('0x35')][_0xc7e8('0x37')]?_0x9cf427[_0xc7e8('0x35')]:_0x3cb2ed['model'];if(!_0x458d36[_0xc7e8('0x32')]['hasOwnProperty'](_0xc7e8('0x39'))){_0x9cf427[_0xc7e8('0x1d')]=qs[_0xc7e8('0x1d')](_0x458d36[_0xc7e8('0x32')]['limit']);_0x9cf427[_0xc7e8('0x1b')]=qs[_0xc7e8('0x1b')](_0x458d36[_0xc7e8('0x32')][_0xc7e8('0x1b')]);}_0x9cf427[_0xc7e8('0x54')]=qs[_0xc7e8('0x3a')](_0x458d36[_0xc7e8('0x32')]['sort']);_0x9cf427['where']=qs['filters'](_[_0xc7e8('0x3c')](_0x458d36[_0xc7e8('0x32')],_0x3cb2ed[_0xc7e8('0x3b')]));_0x9cf427[_0xc7e8('0x3e')][_0xc7e8('0x55')]=_0x5087ed['id'];if(_0x458d36[_0xc7e8('0x32')][_0xc7e8('0x3d')]){_0x9cf427[_0xc7e8('0x3e')]=_[_0xc7e8('0x47')](_0x9cf427[_0xc7e8('0x3e')],{'$or':_[_0xc7e8('0x2d')](_0x9cf427['attributes'],function(_0x4bcb1a){var _0x463995={};_0x463995[_0x4bcb1a]={'$like':'%'+_0x458d36[_0xc7e8('0x32')]['filter']+'%'};return _0x463995;})});}_0x9cf427=_[_0xc7e8('0x47')]({},_0x9cf427,_0x458d36[_0xc7e8('0x40')]);return db[_0xc7e8('0x53')][_0xc7e8('0x43')](_0x9cf427);}})[_0xc7e8('0x23')](function(_0x37ea31){if(_0x37ea31){return db[_0xc7e8('0x56')][_0xc7e8('0x57')]({'where':{'id':_[_0xc7e8('0x2d')](_0x37ea31,_0xc7e8('0x58')),'role':_0xc7e8('0x59')},'attributes':['id',_0xc7e8('0x2b'),_0xc7e8('0x5a'),_0xc7e8('0x5b'),_0xc7e8('0x5c')]});}})['then'](function(_0x96b14e){if(_0x96b14e){return{'count':_0x96b14e[_0xc7e8('0x1e')],'rows':_['map'](_0x96b14e['rows'],function(_0x5e7ca3){return{'membername':_0x5e7ca3[_0xc7e8('0x2b')],'UserId':_0x5e7ca3['id'],'queue_name':_0x112e56[_0xc7e8('0x2b')],'OpenchannelQueueId':_0x112e56['id'],'interface':util[_0xc7e8('0x5d')]('%s/%s',_0xc7e8('0x5e'),_0x5e7ca3[_0xc7e8('0x2b')]),'penalty':0x0,'paused':_0x5e7ca3[_0xc7e8('0x5a')],'createdAt':_0x5e7ca3['createdAt'],'updatedAt':_0x5e7ca3[_0xc7e8('0x5b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xc7e8('0x23')](respondWithFilteredResult(_0x293571,_0x9cf427))[_0xc7e8('0x48')](handleError(_0x293571,null));};exports['getTeams']=function(_0x534bff,_0x5717be,_0x584d27){var _0x3b7bc8={};var _0x1aa5a6={};var _0x210597;var _0x5ec06d;return db[_0xc7e8('0x2e')][_0xc7e8('0x5f')]({'where':{'id':_0x534bff[_0xc7e8('0x45')]['id']}})[_0xc7e8('0x23')](handleEntityNotFound(_0x5717be,null))[_0xc7e8('0x23')](function(_0x426fe6){if(_0x426fe6){_0x210597=_0x426fe6;_0x1aa5a6['model']=_[_0xc7e8('0x33')](db[_0xc7e8('0x60')]['rawAttributes']);_0x1aa5a6[_0xc7e8('0x32')]=_[_0xc7e8('0x33')](_0x534bff[_0xc7e8('0x32')]);_0x1aa5a6['filters']=_[_0xc7e8('0x34')](_0x1aa5a6['model'],_0x1aa5a6[_0xc7e8('0x32')]);_0x3b7bc8[_0xc7e8('0x35')]=_[_0xc7e8('0x34')](_0x1aa5a6[_0xc7e8('0x31')],qs[_0xc7e8('0x36')](_0x534bff[_0xc7e8('0x32')][_0xc7e8('0x36')]));_0x3b7bc8['attributes']=_0x3b7bc8['attributes'][_0xc7e8('0x37')]?_0x3b7bc8['attributes']:_0x1aa5a6[_0xc7e8('0x31')];_0x3b7bc8[_0xc7e8('0x54')]=qs[_0xc7e8('0x3a')](_0x534bff[_0xc7e8('0x32')]['sort']);_0x3b7bc8[_0xc7e8('0x3e')]=qs[_0xc7e8('0x3b')](_[_0xc7e8('0x3c')](_0x534bff['query'],_0x1aa5a6[_0xc7e8('0x3b')]));if(_0x534bff[_0xc7e8('0x32')][_0xc7e8('0x3d')]){_0x3b7bc8['where']=_[_0xc7e8('0x47')](_0x3b7bc8[_0xc7e8('0x3e')],{'$or':_['map'](_0x3b7bc8[_0xc7e8('0x35')],function(_0x589e8b){var _0x84d89b={};_0x84d89b[_0x589e8b]={'$like':'%'+_0x534bff['query']['filter']+'%'};return _0x84d89b;})});}_0x3b7bc8=_[_0xc7e8('0x47')]({},_0x3b7bc8,_0x534bff[_0xc7e8('0x40')]);return _0x210597[_0xc7e8('0x61')](_0x3b7bc8);}})[_0xc7e8('0x23')](function(_0x18787f){if(_0x18787f){_0x5ec06d=_0x18787f[_0xc7e8('0x37')];if(!_0x534bff[_0xc7e8('0x32')][_0xc7e8('0x38')](_0xc7e8('0x39'))){_0x3b7bc8[_0xc7e8('0x1d')]=qs[_0xc7e8('0x1d')](_0x534bff[_0xc7e8('0x32')][_0xc7e8('0x1d')]);_0x3b7bc8[_0xc7e8('0x1b')]=qs[_0xc7e8('0x1b')](_0x534bff['query'][_0xc7e8('0x1b')]);}return _0x210597[_0xc7e8('0x61')](_0x3b7bc8);}})[_0xc7e8('0x23')](function(_0x5d21f5){if(_0x5d21f5){return _0x5d21f5?{'count':_0x5ec06d,'rows':_0x5d21f5}:null;}})[_0xc7e8('0x23')](respondWithResult(_0x5717be,null))[_0xc7e8('0x48')](handleError(_0x5717be,null));};exports['addTeams']=function(_0x1bd27e,_0xcffbe0,_0x5ba0cd){var _0x10558e=_0x1bd27e[_0xc7e8('0x4a')]['ids'];return db[_0xc7e8('0x60')][_0xc7e8('0x43')]({'where':{'id':_0x10558e},'attributes':['id'],'include':[{'model':db[_0xc7e8('0x56')],'as':_0xc7e8('0x62'),'attributes':['id','name','online',_0xc7e8('0x63'),_0xc7e8('0x64')],'raw':!![]}]})[_0xc7e8('0x23')](function(_0x32b002){if(_0x32b002){var _0x516aa9=_['flatMap'](_0x32b002,function(_0x5a8938){var _0x5b2d9f=_0x5a8938['get']({'plain':!![]});return _0x5b2d9f[_0xc7e8('0x62')];});return db[_0xc7e8('0x2e')][_0xc7e8('0x4d')]({'where':{'id':_0x1bd27e[_0xc7e8('0x45')]['id']}})[_0xc7e8('0x23')](function(_0xb3ff73){return db[_0xc7e8('0x65')]['transaction'](function(_0x59d630){return _0xb3ff73['addTeams'](_0x10558e,{'transaction':_0x59d630})[_0xc7e8('0x23')](function(){return BPromise[_0xc7e8('0x66')](_0x516aa9,function(_0x2b602a){return db[_0xc7e8('0x53')][_0xc7e8('0x67')]({'where':{'UserId':_0x2b602a['id'],'OpenchannelQueueId':_0x1bd27e['params']['id']},'transaction':_0x59d630});});})[_0xc7e8('0x23')](function(){_0x516aa9['forEach'](function(_0x3bf848){socket[_0xc7e8('0x68')](_0xc7e8('0x69'),{'UserId':_0x3bf848['id'],'OpenchannelQueueId':_0xb3ff73['id']});});});});});}})[_0xc7e8('0x23')](respondWithStatusCode(_0xcffbe0,null))[_0xc7e8('0x48')](handleError(_0xcffbe0,null));};exports[_0xc7e8('0x6a')]=function(_0x4d36ac,_0x4d74d0,_0x47983a){return db[_0xc7e8('0x60')][_0xc7e8('0x43')]({'where':{'id':_0x4d36ac['query'][_0xc7e8('0x6b')]},'attributes':['id'],'include':[{'model':db[_0xc7e8('0x56')],'as':_0xc7e8('0x62'),'attributes':['id'],'raw':!![]}]})[_0xc7e8('0x23')](handleEntityNotFound(_0x4d74d0,null))[_0xc7e8('0x23')](function(_0x45c6ec){var _0x576b81=_['map'](_0x45c6ec,'id');var _0x35a75a=[];var _0x41556f=[];var _0x1a1d5d=squel[_0xc7e8('0x6c')]();_0x1a1d5d[_0xc7e8('0x6d')](_0xc7e8('0x6e'))[_0xc7e8('0x6f')](_0xc7e8('0x70'),'tq')[_0xc7e8('0x71')](_0xc7e8('0x72'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xc7e8('0x3e')](_0xc7e8('0x73'),_0x4d36ac[_0xc7e8('0x45')]['id']);for(var _0x3c97ac=0x0;_0x3c97ac<_0x45c6ec['length'];_0x3c97ac+=0x1){let _0xcdffd1=_0x45c6ec[_0x3c97ac];for(var _0x4113cf=0x0;_0x4113cf<_0xcdffd1['Agents']['length'];_0x4113cf+=0x1){let _0x344db1=_0xcdffd1['Agents'][_0x4113cf];var _0x3a2948=_0x1a1d5d[_0xc7e8('0x74')]();_0x3a2948[_0xc7e8('0x3e')](_0xc7e8('0x75'),_0x344db1['id']);_0x41556f[_0xc7e8('0x76')](db[_0xc7e8('0x65')]['query'](_0x3a2948[_0xc7e8('0x77')](),{'type':db[_0xc7e8('0x65')]['QueryTypes'][_0xc7e8('0x78')]})[_0xc7e8('0x23')](function(_0x135b41){if(_0x135b41[_0xc7e8('0x37')]===0x1){return _0x344db1['id'];}else{var _0x109ebf=_[_0xc7e8('0x79')](_[_0xc7e8('0x2d')](_0x135b41,_0xc7e8('0x7a')),function(_0x475c93){return _[_0xc7e8('0x7b')](_0x576b81,_0x475c93);});if(_0x109ebf){return _0x344db1['id'];}}}));}}return BPromise['all'](_0x41556f)[_0xc7e8('0x23')](function(_0x5bdee5){_0x35a75a=_(_0x35a75a)['union'](_0x5bdee5)['compact']()[_0xc7e8('0x7c')]();return db[_0xc7e8('0x2e')]['find']({'where':{'id':_0x4d36ac[_0xc7e8('0x45')]['id']}})[_0xc7e8('0x23')](function(_0x5e3a42){return db['sequelize'][_0xc7e8('0x7d')](function(_0x28e77d){return _0x5e3a42[_0xc7e8('0x6a')](_0x4d36ac[_0xc7e8('0x32')][_0xc7e8('0x6b')],{'transaction':_0x28e77d})[_0xc7e8('0x23')](function(){if(!_[_0xc7e8('0x7e')](_0x35a75a)){return _0x5e3a42[_0xc7e8('0x7f')](_0x35a75a,{'transaction':_0x28e77d});}})['then'](function(){_0x35a75a[_0xc7e8('0x80')](function(_0x1fe96c){socket[_0xc7e8('0x68')](_0xc7e8('0x81'),{'UserId':_0x1fe96c,'OpenchannelQueueId':_0x5e3a42['id']});});});});});});})[_0xc7e8('0x23')](respondWithStatusCode(_0x4d74d0,null))[_0xc7e8('0x48')](handleError(_0x4d74d0,null));};exports['addAgents']=function(_0x36a331,_0x483c2b,_0x305ccb){return db[_0xc7e8('0x2e')][_0xc7e8('0x4d')]({'where':{'id':_0x36a331[_0xc7e8('0x45')]['id']}})[_0xc7e8('0x23')](handleEntityNotFound(_0x483c2b,null))['then'](function(_0xb05b8f){if(_0xb05b8f){return _0xb05b8f[_0xc7e8('0x82')](_0x36a331['body'][_0xc7e8('0x6b')],_[_0xc7e8('0x83')](_0x36a331[_0xc7e8('0x4a')],[_0xc7e8('0x6b'),'id'])||{})[_0xc7e8('0x84')](function(_0x740dc5){for(var _0x19e6bc=0x0;_0x19e6bc<_0x36a331['body'][_0xc7e8('0x6b')]['length'];_0x19e6bc+=0x1){socket[_0xc7e8('0x68')](_0xc7e8('0x69'),{'UserId':Number(_0x36a331[_0xc7e8('0x4a')]['ids'][_0x19e6bc]),'OpenchannelQueueId':Number(_0x36a331[_0xc7e8('0x45')]['id'])});}return _0x740dc5;});}})[_0xc7e8('0x23')](respondWithResult(_0x483c2b,null))['catch'](handleError(_0x483c2b,null));};exports[_0xc7e8('0x7f')]=function(_0x95da0d,_0x82a199,_0x27eb7a){return db[_0xc7e8('0x2e')]['find']({'where':{'id':_0x95da0d[_0xc7e8('0x45')]['id']}})[_0xc7e8('0x23')](handleEntityNotFound(_0x82a199,null))['then'](function(_0x21f145){if(_0x21f145){return _0x21f145['removeAgents'](_0x95da0d[_0xc7e8('0x32')][_0xc7e8('0x6b')])[_0xc7e8('0x23')](function(){if(_[_0xc7e8('0x85')](_0x95da0d[_0xc7e8('0x32')][_0xc7e8('0x6b')])){for(var _0x588bf1=0x0;_0x588bf1<_0x95da0d[_0xc7e8('0x32')][_0xc7e8('0x6b')][_0xc7e8('0x37')];_0x588bf1+=0x1){socket[_0xc7e8('0x68')]('userOpenchannelQueue:remove',{'UserId':Number(_0x95da0d[_0xc7e8('0x32')]['ids'][_0x588bf1]),'OpenchannelQueueId':Number(_0x95da0d[_0xc7e8('0x45')]['id'])});}}else{socket[_0xc7e8('0x68')](_0xc7e8('0x81'),{'UserId':Number(_0x95da0d[_0xc7e8('0x32')][_0xc7e8('0x6b')]),'OpenchannelQueueId':Number(_0x95da0d[_0xc7e8('0x45')]['id'])});}});}})[_0xc7e8('0x23')](respondWithStatusCode(_0x82a199,null))[_0xc7e8('0x48')](handleError(_0x82a199,null));};exports[_0xc7e8('0x86')]=function(_0x4c5456,_0x4440bc,_0x290bb2){var _0xfc110c={};var _0x34df41={};var _0x412ab3;var _0x414d8b;return db[_0xc7e8('0x2e')][_0xc7e8('0x5f')]({'where':{'id':_0x4c5456[_0xc7e8('0x45')]['id']}})[_0xc7e8('0x23')](handleEntityNotFound(_0x4440bc,null))[_0xc7e8('0x23')](function(_0x1208c){if(_0x1208c){_0x412ab3=_0x1208c;_0x34df41[_0xc7e8('0x31')]=_[_0xc7e8('0x33')](db['User'][_0xc7e8('0x46')]);_0x34df41[_0xc7e8('0x32')]=_[_0xc7e8('0x33')](_0x4c5456[_0xc7e8('0x32')]);_0x34df41[_0xc7e8('0x3b')]=_[_0xc7e8('0x34')](_0x34df41[_0xc7e8('0x31')],_0x34df41[_0xc7e8('0x32')]);_0xfc110c['attributes']=_[_0xc7e8('0x34')](_0x34df41[_0xc7e8('0x31')],qs[_0xc7e8('0x36')](_0x4c5456[_0xc7e8('0x32')][_0xc7e8('0x36')]));_0xfc110c[_0xc7e8('0x35')]=_0xfc110c['attributes'][_0xc7e8('0x37')]?_0xfc110c['attributes']:_0x34df41[_0xc7e8('0x31')];_0xfc110c[_0xc7e8('0x54')]=qs[_0xc7e8('0x3a')](_0x4c5456[_0xc7e8('0x32')][_0xc7e8('0x3a')]);_0xfc110c[_0xc7e8('0x3e')]=qs[_0xc7e8('0x3b')](_[_0xc7e8('0x3c')](_0x4c5456['query'],_0x34df41[_0xc7e8('0x3b')]));if(_0x4c5456[_0xc7e8('0x32')][_0xc7e8('0x3d')]){_0xfc110c[_0xc7e8('0x3e')]=_[_0xc7e8('0x47')](_0xfc110c[_0xc7e8('0x3e')],{'$or':_[_0xc7e8('0x2d')](_0xfc110c[_0xc7e8('0x35')],function(_0x989ab0){var _0x2402ab={};_0x2402ab[_0x989ab0]={'$like':'%'+_0x4c5456[_0xc7e8('0x32')][_0xc7e8('0x3d')]+'%'};return _0x2402ab;})});}_0xfc110c=_[_0xc7e8('0x47')]({},_0xfc110c,_0x4c5456[_0xc7e8('0x40')]);return _0x412ab3[_0xc7e8('0x86')](_0xfc110c);}})[_0xc7e8('0x23')](function(_0x88c6a5){if(_0x88c6a5){_0x414d8b=_0x88c6a5[_0xc7e8('0x37')];if(!_0x4c5456[_0xc7e8('0x32')][_0xc7e8('0x38')](_0xc7e8('0x39'))){_0xfc110c[_0xc7e8('0x1d')]=qs['limit'](_0x4c5456['query'][_0xc7e8('0x1d')]);_0xfc110c['offset']=qs[_0xc7e8('0x1b')](_0x4c5456[_0xc7e8('0x32')][_0xc7e8('0x1b')]);}return _0x412ab3[_0xc7e8('0x86')](_0xfc110c);}})[_0xc7e8('0x23')](function(_0x1375bb){if(_0x1375bb){return _0x1375bb?{'count':_0x414d8b,'rows':_0x1375bb}:null;}})[_0xc7e8('0x23')](respondWithResult(_0x4440bc,null))['catch'](handleError(_0x4440bc,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 1fe9272..35592ae 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 _0x7a97=['hook','exports','events','../../mysqldb','OpenchannelQueue','setMaxListeners','save','emit'];(function(_0x2036c1,_0x437f74){var _0x133fab=function(_0x27781d){while(--_0x27781d){_0x2036c1['push'](_0x2036c1['shift']());}};_0x133fab(++_0x437f74);}(_0x7a97,0x1e2));var _0x77a9=function(_0x59200e,_0xdf0984){_0x59200e=_0x59200e-0x0;var _0x13aa0b=_0x7a97[_0x59200e];return _0x13aa0b;};'use strict';var EventEmitter=require(_0x77a9('0x0'));var OpenchannelQueue=require(_0x77a9('0x1'))['db'][_0x77a9('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x77a9('0x3')](0x0);var events={'afterCreate':_0x77a9('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x12876b){return function(_0x53eac6,_0x26829d,_0x108826){OpenchannelQueueEvents[_0x77a9('0x5')](_0x12876b+':'+_0x53eac6['id'],_0x53eac6);OpenchannelQueueEvents['emit'](_0x12876b,_0x53eac6);_0x108826(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelQueue[_0x77a9('0x6')](e,emitEvent(event));}}module[_0x77a9('0x7')]=OpenchannelQueueEvents; \ No newline at end of file +var _0xf4f8=['hook','events','../../mysqldb','OpenchannelQueue','update','remove','emit','hasOwnProperty'];(function(_0x596284,_0x1cd02b){var _0x5313c6=function(_0x77db49){while(--_0x77db49){_0x596284['push'](_0x596284['shift']());}};_0x5313c6(++_0x1cd02b);}(_0xf4f8,0x129));var _0x8f4f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf4f8[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x8f4f('0x0'));var OpenchannelQueue=require(_0x8f4f('0x1'))['db'][_0x8f4f('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x8f4f('0x3'),'afterDestroy':_0x8f4f('0x4')};function emitEvent(_0x41e046){return function(_0x20b0dc,_0x16b9ca,_0x115052){OpenchannelQueueEvents[_0x8f4f('0x5')](_0x41e046+':'+_0x20b0dc['id'],_0x20b0dc);OpenchannelQueueEvents[_0x8f4f('0x5')](_0x41e046,_0x20b0dc);_0x115052(null);};}for(var e in events){if(events[_0x8f4f('0x6')](e)){var event=events[e];OpenchannelQueue[_0x8f4f('0x7')](e,emitEvent(event));}}module['exports']=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index 913d214..7c33206 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 _0x577d=['exports','define','openchannel_queues','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./openchannelQueue.attributes'];(function(_0x2ac437,_0x5bf280){var _0x4f090a=function(_0x1ab5c1){while(--_0x1ab5c1){_0x2ac437['push'](_0x2ac437['shift']());}};_0x4f090a(++_0x5bf280);}(_0x577d,0xb7));var _0xd577=function(_0x435053,_0x19a944){_0x435053=_0x435053-0x0;var _0x18ce2b=_0x577d[_0x435053];return _0x18ce2b;};'use strict';var _=require(_0xd577('0x0'));var util=require(_0xd577('0x1'));var logger=require(_0xd577('0x2'))(_0xd577('0x3'));var moment=require(_0xd577('0x4'));var BPromise=require('bluebird');var rp=require(_0xd577('0x5'));var fs=require('fs');var path=require(_0xd577('0x6'));var rimraf=require('rimraf');var config=require(_0xd577('0x7'));var attributes=require(_0xd577('0x8'));module[_0xd577('0x9')]=function(_0x41be9d,_0x2aafb4){return _0x41be9d[_0xd577('0xa')]('OpenchannelQueue',attributes,{'tableName':_0xd577('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb950=['rimraf','./openchannelQueue.attributes','exports','define','OpenchannelQueue','openchannel_queues','lodash','bluebird','request-promise','path'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0xb950,0xce));var _0x0b95=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xb950[_0x465028];return _0xb783d4;};'use strict';var _=require(_0x0b95('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0b95('0x1'));var rp=require(_0x0b95('0x2'));var fs=require('fs');var path=require(_0x0b95('0x3'));var rimraf=require(_0x0b95('0x4'));var config=require('../../config/environment');var attributes=require(_0x0b95('0x5'));module[_0x0b95('0x6')]=function(_0x35b7ca,_0x2d9df9){return _0x35b7ca[_0x0b95('0x7')](_0x0b95('0x8'),attributes,{'tableName':_0x0b95('0x9'),'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 b610e7a..ad7e772 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 _0x2d16=['GetOpenchannelQueue','ShowOpenchannelQueue','OpenchannelQueue','find','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./openchannelQueue.socket','request','then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','findAll','options','raw','where','limit','include','model','map','attributes'];(function(_0x52a073,_0x225c33){var _0x14c817=function(_0x24c042){while(--_0x24c042){_0x52a073['push'](_0x52a073['shift']());}};_0x14c817(++_0x225c33);}(_0x2d16,0x79));var _0x62d1=function(_0x441c9d,_0x3ad5b2){_0x441c9d=_0x441c9d-0x0;var _0x369587=_0x2d16[_0x441c9d];return _0x369587;};'use strict';var _=require(_0x62d1('0x0'));var util=require('util');var moment=require(_0x62d1('0x1'));var BPromise=require(_0x62d1('0x2'));var rs=require(_0x62d1('0x3'));var fs=require('fs');var Redis=require(_0x62d1('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x62d1('0x5'))(_0x62d1('0x6'));var config=require(_0x62d1('0x7'));var jayson=require(_0x62d1('0x8'));var client=jayson[_0x62d1('0x9')]['http']({'port':0x232a});config[_0x62d1('0xa')]=_['defaults'](config[_0x62d1('0xa')],{'host':_0x62d1('0xb'),'port':0x18eb});var socket=require(_0x62d1('0xc'))(new Redis(config[_0x62d1('0xa')]));require(_0x62d1('0xd'))['register'](socket);function respondWithRpcPromise(_0x5ba5a5,_0x5bc4a5,_0xdeeba9){return new BPromise(function(_0x56d1e4,_0x400740){return client[_0x62d1('0xe')](_0x5ba5a5,_0xdeeba9)[_0x62d1('0xf')](function(_0x2f38ce){logger[_0x62d1('0x10')](_0x62d1('0x11'),_0x5bc4a5,_0x62d1('0x12'));logger[_0x62d1('0x13')](_0x62d1('0x14'),_0x5bc4a5,_0x62d1('0x12'),JSON['stringify'](_0x2f38ce));if(_0x2f38ce[_0x62d1('0x15')]){if(_0x2f38ce[_0x62d1('0x15')][_0x62d1('0x16')]===0x1f4){logger[_0x62d1('0x15')](_0x62d1('0x11'),_0x5bc4a5,_0x2f38ce[_0x62d1('0x15')][_0x62d1('0x17')]);return _0x400740(_0x2f38ce[_0x62d1('0x15')][_0x62d1('0x17')]);}logger['error'](_0x62d1('0x11'),_0x5bc4a5,_0x2f38ce[_0x62d1('0x15')][_0x62d1('0x17')]);return _0x56d1e4(_0x2f38ce[_0x62d1('0x15')][_0x62d1('0x17')]);}else{logger[_0x62d1('0x10')](_0x62d1('0x11'),_0x5bc4a5,_0x62d1('0x12'));_0x56d1e4(_0x2f38ce[_0x62d1('0x18')][_0x62d1('0x17')]);}})[_0x62d1('0x19')](function(_0x339f0a){logger['error'](_0x62d1('0x11'),_0x5bc4a5,_0x339f0a);_0x400740(_0x339f0a);});});}exports['GetOpenchannelQueue']=function(_0x2638c7){var _0x40f532=this;return new Promise(function(_0x7a95b1,_0x1e9480){return db['OpenchannelQueue'][_0x62d1('0x1a')]({'raw':_0x2638c7[_0x62d1('0x1b')]?_0x2638c7[_0x62d1('0x1b')][_0x62d1('0x1c')]===undefined?!![]:![]:!![],'where':_0x2638c7[_0x62d1('0x1b')]?_0x2638c7[_0x62d1('0x1b')][_0x62d1('0x1d')]||null:null,'attributes':_0x2638c7[_0x62d1('0x1b')]?_0x2638c7[_0x62d1('0x1b')]['attributes']||null:null,'limit':_0x2638c7[_0x62d1('0x1b')]?_0x2638c7[_0x62d1('0x1b')][_0x62d1('0x1e')]||null:null,'include':_0x2638c7[_0x62d1('0x1b')]?_0x2638c7[_0x62d1('0x1b')][_0x62d1('0x1f')]?_['map'](_0x2638c7[_0x62d1('0x1b')]['include'],function(_0x24eefc){return{'model':db[_0x24eefc[_0x62d1('0x20')]],'as':_0x24eefc['as'],'attributes':_0x24eefc['attributes'],'include':_0x24eefc[_0x62d1('0x1f')]?_[_0x62d1('0x21')](_0x24eefc[_0x62d1('0x1f')],function(_0x1eb5bc){return{'model':db[_0x1eb5bc[_0x62d1('0x20')]],'as':_0x1eb5bc['as'],'attributes':_0x1eb5bc[_0x62d1('0x22')],'include':_0x1eb5bc['include']?_[_0x62d1('0x21')](_0x1eb5bc[_0x62d1('0x1f')],function(_0x10c4f1){return{'model':db[_0x10c4f1[_0x62d1('0x20')]],'as':_0x10c4f1['as'],'attributes':_0x10c4f1[_0x62d1('0x22')]};}):[]};}):[]};}):[]:[]})[_0x62d1('0xf')](function(_0x34029a){logger[_0x62d1('0x10')](_0x62d1('0x23'),_0x2638c7);logger['debug'](_0x62d1('0x23'),_0x2638c7,JSON['stringify'](_0x34029a));_0x7a95b1(_0x34029a);})[_0x62d1('0x19')](function(_0x2e5003){logger[_0x62d1('0x15')](_0x62d1('0x23'),_0x2e5003[_0x62d1('0x17')],_0x2638c7);_0x1e9480(_0x40f532[_0x62d1('0x15')](0x1f4,_0x2e5003[_0x62d1('0x17')]));});});};exports[_0x62d1('0x24')]=function(_0x3e53b0){var _0x166a8f=this;return new Promise(function(_0x223e5a,_0x79bd35){return db[_0x62d1('0x25')][_0x62d1('0x26')]({'raw':_0x3e53b0[_0x62d1('0x1b')]?_0x3e53b0[_0x62d1('0x1b')][_0x62d1('0x1c')]===undefined?!![]:![]:!![],'where':_0x3e53b0['options']?_0x3e53b0['options'][_0x62d1('0x1d')]||null:null,'attributes':_0x3e53b0['options']?_0x3e53b0[_0x62d1('0x1b')][_0x62d1('0x22')]||null:null,'include':_0x3e53b0[_0x62d1('0x1b')]?_0x3e53b0[_0x62d1('0x1b')][_0x62d1('0x1f')]?_[_0x62d1('0x21')](_0x3e53b0[_0x62d1('0x1b')][_0x62d1('0x1f')],function(_0x10cc91){return{'model':db[_0x10cc91['model']],'as':_0x10cc91['as'],'attributes':_0x10cc91[_0x62d1('0x22')],'include':_0x10cc91['include']?_['map'](_0x10cc91[_0x62d1('0x1f')],function(_0xbaac49){return{'model':db[_0xbaac49[_0x62d1('0x20')]],'as':_0xbaac49['as'],'attributes':_0xbaac49[_0x62d1('0x22')],'include':_0xbaac49[_0x62d1('0x1f')]?_[_0x62d1('0x21')](_0xbaac49[_0x62d1('0x1f')],function(_0x457c54){return{'model':db[_0x457c54[_0x62d1('0x20')]],'as':_0x457c54['as'],'attributes':_0x457c54[_0x62d1('0x22')]};}):[]};}):[]};}):[]:[]})[_0x62d1('0xf')](function(_0x55f831){logger[_0x62d1('0x10')]('ShowOpenchannelQueue',_0x3e53b0);logger[_0x62d1('0x13')]('ShowOpenchannelQueue',_0x3e53b0,JSON['stringify'](_0x55f831));_0x223e5a(_0x55f831);})[_0x62d1('0x19')](function(_0x261b11){logger[_0x62d1('0x15')]('ShowOpenchannelQueue',_0x261b11[_0x62d1('0x17')],_0x3e53b0);_0x79bd35(_0x166a8f[_0x62d1('0x15')](0x1f4,_0x261b11['message']));});});}; \ No newline at end of file +var _0x3c05=['../../config/environment','jayson/promise','client','redis','localhost','./openchannelQueue.socket','request','info','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelQueue,\x20%s,\x20%s','message','catch','GetOpenchannelQueue','findAll','options','raw','where','attributes','limit','model','include','map','then','ShowOpenchannelQueue','OpenchannelQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x278efd,_0x4433a6){var _0x42bb89=function(_0x3b18f0){while(--_0x3b18f0){_0x278efd['push'](_0x278efd['shift']());}};_0x42bb89(++_0x4433a6);}(_0x3c05,0x68));var _0x53c0=function(_0x1debf6,_0x483c69){_0x1debf6=_0x1debf6-0x0;var _0x4846af=_0x3c05[_0x1debf6];return _0x4846af;};'use strict';var _=require(_0x53c0('0x0'));var util=require(_0x53c0('0x1'));var moment=require(_0x53c0('0x2'));var BPromise=require(_0x53c0('0x3'));var rs=require(_0x53c0('0x4'));var fs=require('fs');var Redis=require(_0x53c0('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x53c0('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x53c0('0x7'));var jayson=require(_0x53c0('0x8'));var client=jayson[_0x53c0('0x9')]['http']({'port':0x232a});config[_0x53c0('0xa')]=_['defaults'](config[_0x53c0('0xa')],{'host':_0x53c0('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x53c0('0xc'))['register'](socket);function respondWithRpcPromise(_0x498a81,_0x196646,_0x5e2954){return new BPromise(function(_0x421a9e,_0x38de0f){return client[_0x53c0('0xd')](_0x498a81,_0x5e2954)['then'](function(_0x2915b7){logger[_0x53c0('0xe')]('OpenchannelQueue,\x20%s,\x20%s',_0x196646,_0x53c0('0xf'));logger[_0x53c0('0x10')](_0x53c0('0x11'),_0x196646,'request\x20sent',JSON[_0x53c0('0x12')](_0x2915b7));if(_0x2915b7['error']){if(_0x2915b7[_0x53c0('0x13')][_0x53c0('0x14')]===0x1f4){logger[_0x53c0('0x13')](_0x53c0('0x15'),_0x196646,_0x2915b7['error'][_0x53c0('0x16')]);return _0x38de0f(_0x2915b7['error'][_0x53c0('0x16')]);}logger[_0x53c0('0x13')](_0x53c0('0x15'),_0x196646,_0x2915b7['error'][_0x53c0('0x16')]);return _0x421a9e(_0x2915b7[_0x53c0('0x13')][_0x53c0('0x16')]);}else{logger[_0x53c0('0xe')](_0x53c0('0x15'),_0x196646,_0x53c0('0xf'));_0x421a9e(_0x2915b7['result']['message']);}})[_0x53c0('0x17')](function(_0x23c6fc){logger['error'](_0x53c0('0x15'),_0x196646,_0x23c6fc);_0x38de0f(_0x23c6fc);});});}exports[_0x53c0('0x18')]=function(_0x140d68){var _0x44af0c=this;return new Promise(function(_0x3925e8,_0x3b90d5){return db['OpenchannelQueue'][_0x53c0('0x19')]({'raw':_0x140d68[_0x53c0('0x1a')]?_0x140d68['options'][_0x53c0('0x1b')]===undefined?!![]:![]:!![],'where':_0x140d68[_0x53c0('0x1a')]?_0x140d68[_0x53c0('0x1a')][_0x53c0('0x1c')]||null:null,'attributes':_0x140d68[_0x53c0('0x1a')]?_0x140d68[_0x53c0('0x1a')][_0x53c0('0x1d')]||null:null,'limit':_0x140d68[_0x53c0('0x1a')]?_0x140d68[_0x53c0('0x1a')][_0x53c0('0x1e')]||null:null,'include':_0x140d68[_0x53c0('0x1a')]?_0x140d68[_0x53c0('0x1a')]['include']?_['map'](_0x140d68[_0x53c0('0x1a')]['include'],function(_0x17948b){return{'model':db[_0x17948b[_0x53c0('0x1f')]],'as':_0x17948b['as'],'attributes':_0x17948b[_0x53c0('0x1d')],'include':_0x17948b[_0x53c0('0x20')]?_[_0x53c0('0x21')](_0x17948b['include'],function(_0x261bbe){return{'model':db[_0x261bbe[_0x53c0('0x1f')]],'as':_0x261bbe['as'],'attributes':_0x261bbe[_0x53c0('0x1d')],'include':_0x261bbe[_0x53c0('0x20')]?_['map'](_0x261bbe[_0x53c0('0x20')],function(_0x2754e2){return{'model':db[_0x2754e2[_0x53c0('0x1f')]],'as':_0x2754e2['as'],'attributes':_0x2754e2[_0x53c0('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x53c0('0x22')](function(_0x975f0){logger[_0x53c0('0xe')](_0x53c0('0x18'),_0x140d68);logger[_0x53c0('0x10')](_0x53c0('0x18'),_0x140d68,JSON['stringify'](_0x975f0));_0x3925e8(_0x975f0);})[_0x53c0('0x17')](function(_0x407f6c){logger[_0x53c0('0x13')](_0x53c0('0x18'),_0x407f6c[_0x53c0('0x16')],_0x140d68);_0x3b90d5(_0x44af0c[_0x53c0('0x13')](0x1f4,_0x407f6c[_0x53c0('0x16')]));});});};exports[_0x53c0('0x23')]=function(_0x2b9880){var _0x2316d1=this;return new Promise(function(_0xa4e9cf,_0x455531){return db[_0x53c0('0x24')]['find']({'raw':_0x2b9880['options']?_0x2b9880['options'][_0x53c0('0x1b')]===undefined?!![]:![]:!![],'where':_0x2b9880[_0x53c0('0x1a')]?_0x2b9880[_0x53c0('0x1a')]['where']||null:null,'attributes':_0x2b9880[_0x53c0('0x1a')]?_0x2b9880[_0x53c0('0x1a')]['attributes']||null:null,'include':_0x2b9880[_0x53c0('0x1a')]?_0x2b9880[_0x53c0('0x1a')][_0x53c0('0x20')]?_[_0x53c0('0x21')](_0x2b9880[_0x53c0('0x1a')][_0x53c0('0x20')],function(_0x3b41f3){return{'model':db[_0x3b41f3[_0x53c0('0x1f')]],'as':_0x3b41f3['as'],'attributes':_0x3b41f3['attributes'],'include':_0x3b41f3[_0x53c0('0x20')]?_['map'](_0x3b41f3['include'],function(_0x5b0b5b){return{'model':db[_0x5b0b5b[_0x53c0('0x1f')]],'as':_0x5b0b5b['as'],'attributes':_0x5b0b5b['attributes'],'include':_0x5b0b5b[_0x53c0('0x20')]?_['map'](_0x5b0b5b[_0x53c0('0x20')],function(_0x3c9a6e){return{'model':db[_0x3c9a6e[_0x53c0('0x1f')]],'as':_0x3c9a6e['as'],'attributes':_0x3c9a6e['attributes']};}):[]};}):[]};}):[]:[]})[_0x53c0('0x22')](function(_0x420994){logger[_0x53c0('0xe')]('ShowOpenchannelQueue',_0x2b9880);logger[_0x53c0('0x10')](_0x53c0('0x23'),_0x2b9880,JSON[_0x53c0('0x12')](_0x420994));_0xa4e9cf(_0x420994);})['catch'](function(_0x4bc660){logger[_0x53c0('0x13')](_0x53c0('0x23'),_0x4bc660[_0x53c0('0x16')],_0x2b9880);_0x455531(_0x2316d1[_0x53c0('0x13')](0x1f4,_0x4bc660[_0x53c0('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index d62dc18..a76a74f 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 _0x286c=['removeListener','register','length','save','emit'];(function(_0x6ac137,_0x363ee9){var _0x1da975=function(_0xe1601e){while(--_0xe1601e){_0x6ac137['push'](_0x6ac137['shift']());}};_0x1da975(++_0x363ee9);}(_0x286c,0x116));var _0xc286=function(_0x338653,_0x26ea8b){_0x338653=_0x338653-0x0;var _0xf9e3d8=_0x286c[_0x338653];return _0xf9e3d8;};'use strict';var OpenchannelQueueEvents=require('./openchannelQueue.events');var events=[_0xc286('0x0'),'remove','update'];function createListener(_0x539a2f,_0x2113d3){return function(_0x228391){_0x2113d3[_0xc286('0x1')](_0x539a2f,_0x228391);};}function removeListener(_0x460a94,_0x78c8b7){return function(){OpenchannelQueueEvents[_0xc286('0x2')](_0x460a94,_0x78c8b7);};}exports[_0xc286('0x3')]=function(_0x518b09){for(var _0x34d138=0x0,_0x526e71=events[_0xc286('0x4')];_0x34d138<_0x526e71;_0x34d138++){var _0x1625d2=events[_0x34d138];var _0x981351=createListener('openchannelQueue:'+_0x1625d2,_0x518b09);OpenchannelQueueEvents['on'](_0x1625d2,_0x981351);}}; \ No newline at end of file +var _0x81e6=['update','emit','removeListener','register','openchannelQueue:','./openchannelQueue.events','remove'];(function(_0x1d00c7,_0x9b96b2){var _0x5b4f51=function(_0x15fc7d){while(--_0x15fc7d){_0x1d00c7['push'](_0x1d00c7['shift']());}};_0x5b4f51(++_0x9b96b2);}(_0x81e6,0x1a9));var _0x681e=function(_0x2150b6,_0x111a7a){_0x2150b6=_0x2150b6-0x0;var _0x4f9916=_0x81e6[_0x2150b6];return _0x4f9916;};'use strict';var OpenchannelQueueEvents=require(_0x681e('0x0'));var events=['save',_0x681e('0x1'),_0x681e('0x2')];function createListener(_0x524888,_0x58083e){return function(_0x45c4da){_0x58083e[_0x681e('0x3')](_0x524888,_0x45c4da);};}function removeListener(_0xd5f42e,_0x2835c3){return function(){OpenchannelQueueEvents[_0x681e('0x4')](_0xd5f42e,_0x2835c3);};}exports[_0x681e('0x5')]=function(_0x230fcf){for(var _0x3340a1=0x0,_0x1b89a4=events['length'];_0x3340a1<_0x1b89a4;_0x3340a1++){var _0x1a9628=events[_0x3340a1];var _0x2337b8=createListener(_0x681e('0x6')+_0x1a9628,_0x230fcf);OpenchannelQueueEvents['on'](_0x1a9628,_0x2337b8);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index fae604f..2887c92 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 _0xd664=['./openchannelQueueReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','put','update','delete','destroy','exports','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x3ff851,_0x43191c){var _0x41ed4b=function(_0x1b5793){while(--_0x1b5793){_0x3ff851['push'](_0x3ff851['shift']());}};_0x41ed4b(++_0x43191c);}(_0xd664,0xa5));var _0x4d66=function(_0x3cf13e,_0x47a695){_0x3cf13e=_0x3cf13e-0x0;var _0x77dbde=_0xd664[_0x3cf13e];return _0x77dbde;};'use strict';var multer=require(_0x4d66('0x0'));var util=require(_0x4d66('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4d66('0x2')]();var fs_extra=require(_0x4d66('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x4d66('0x4'));var config=require(_0x4d66('0x5'));var controller=require(_0x4d66('0x6'));router[_0x4d66('0x7')]('/',auth[_0x4d66('0x8')](),controller['index']);router[_0x4d66('0x7')](_0x4d66('0x9'),auth[_0x4d66('0x8')](),controller[_0x4d66('0xa')]);router[_0x4d66('0x7')](_0x4d66('0xb'),auth[_0x4d66('0x8')](),controller[_0x4d66('0xc')]);router[_0x4d66('0xd')]('/',auth[_0x4d66('0x8')](),controller['create']);router[_0x4d66('0xe')](_0x4d66('0xb'),auth[_0x4d66('0x8')](),controller[_0x4d66('0xf')]);router[_0x4d66('0x10')](_0x4d66('0xb'),auth[_0x4d66('0x8')](),controller[_0x4d66('0x11')]);module[_0x4d66('0x12')]=router; \ No newline at end of file +var _0x3a85=['post','create','put','delete','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','index','/describe','isAuthenticated','/:id','show'];(function(_0x15e874,_0x4b2dad){var _0x388440=function(_0x11d310){while(--_0x11d310){_0x15e874['push'](_0x15e874['shift']());}};_0x388440(++_0x4b2dad);}(_0x3a85,0xe1));var _0x53a8=function(_0xcaa3f4,_0x1a38e6){_0xcaa3f4=_0xcaa3f4-0x0;var _0x246970=_0x3a85[_0xcaa3f4];return _0x246970;};'use strict';var multer=require(_0x53a8('0x0'));var util=require(_0x53a8('0x1'));var path=require(_0x53a8('0x2'));var timeout=require(_0x53a8('0x3'));var express=require(_0x53a8('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x53a8('0x5'));var interaction=require(_0x53a8('0x6'));var config=require(_0x53a8('0x7'));var controller=require(_0x53a8('0x8'));router[_0x53a8('0x9')]('/',auth['isAuthenticated'](),controller[_0x53a8('0xa')]);router[_0x53a8('0x9')](_0x53a8('0xb'),auth[_0x53a8('0xc')](),controller['describe']);router[_0x53a8('0x9')](_0x53a8('0xd'),auth[_0x53a8('0xc')](),controller[_0x53a8('0xe')]);router[_0x53a8('0xf')]('/',auth[_0x53a8('0xc')](),controller[_0x53a8('0x10')]);router[_0x53a8('0x11')](_0x53a8('0xd'),auth[_0x53a8('0xc')](),controller['update']);router[_0x53a8('0x12')](_0x53a8('0xd'),auth[_0x53a8('0xc')](),controller['destroy']);module[_0x53a8('0x13')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index 5ea3b89..00ae026 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 _0xe409=['DATE','moment','exports','STRING'];(function(_0xe110eb,_0x3a5532){var _0x195c5c=function(_0x55b079){while(--_0x55b079){_0xe110eb['push'](_0xe110eb['shift']());}};_0x195c5c(++_0x3a5532);}(_0xe409,0x195));var _0x9e40=function(_0x3ae7b9,_0x38b113){_0x3ae7b9=_0x3ae7b9-0x0;var _0x4fd404=_0xe409[_0x3ae7b9];return _0x4fd404;};'use strict';var moment=require(_0x9e40('0x0'));var Sequelize=require('sequelize');module[_0x9e40('0x1')]={'uniqueid':{'type':Sequelize[_0x9e40('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x9e40('0x2')]},'joinAt':{'type':Sequelize[_0x9e40('0x3')]},'leaveAt':{'type':Sequelize[_0x9e40('0x3')]},'acceptAt':{'type':Sequelize[_0x9e40('0x3')]},'exitAt':{'type':Sequelize[_0x9e40('0x3')]},'reason':{'type':Sequelize[_0x9e40('0x2')]}}; \ No newline at end of file +var _0xbdb9=['STRING','DATE','moment','sequelize','exports'];(function(_0x14f21c,_0x315b28){var _0x2b509b=function(_0x19ea1f){while(--_0x19ea1f){_0x14f21c['push'](_0x14f21c['shift']());}};_0x2b509b(++_0x315b28);}(_0xbdb9,0xac));var _0x9bdb=function(_0x1f6bbb,_0xfb84c3){_0x1f6bbb=_0x1f6bbb-0x0;var _0x5bcc93=_0xbdb9[_0x1f6bbb];return _0x5bcc93;};'use strict';var moment=require(_0x9bdb('0x0'));var Sequelize=require(_0x9bdb('0x1'));module[_0x9bdb('0x2')]={'uniqueid':{'type':Sequelize[_0x9bdb('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x9bdb('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x9bdb('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index 3dec4f5..0191806 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 _0xec4b=['query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','update','destroy','describe','rimraf','zip-dir','request-promise','moment','mustache','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','offset','undefined','limit','count','set','Content-Range','json','reject','save','then','stack','name','index','map','OpenchannelQueueReport','rawAttributes','fieldName','type','key'];(function(_0x3d8240,_0x2663d4){var _0x3d0372=function(_0xc47c6b){while(--_0xc47c6b){_0x3d8240['push'](_0x3d8240['shift']());}};_0x3d0372(++_0x2663d4);}(_0xec4b,0xf6));var _0xbec4=function(_0x166984,_0x2195f2){_0x166984=_0x166984-0x0;var _0x3225d6=_0xec4b[_0x166984];return _0x3225d6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbec4('0x0'));var zipdir=require(_0xbec4('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbec4('0x2'));var moment=require(_0xbec4('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xbec4('0x4'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xbec4('0x5'));var ejs=require(_0xbec4('0x6'));var fs=require('fs');var fs_extra=require(_0xbec4('0x7'));var _=require(_0xbec4('0x8'));var squel=require(_0xbec4('0x9'));var crypto=require(_0xbec4('0xa'));var jsforce=require(_0xbec4('0xb'));var deskjs=require(_0xbec4('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xbec4('0xd'));var Redis=require(_0xbec4('0xe'));var authService=require(_0xbec4('0xf'));var qs=require(_0xbec4('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbec4('0x11'));var logger=require(_0xbec4('0x12'))('api');var utils=require(_0xbec4('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xbec4('0x14'));var db=require(_0xbec4('0x15'))['db'];function respondWithStatusCode(_0x2cb892,_0x495fe2){_0x495fe2=_0x495fe2||0xcc;return function(_0x47d28d){if(_0x47d28d){return _0x2cb892['sendStatus'](_0x495fe2);}return _0x2cb892[_0xbec4('0x16')](_0x495fe2)['end']();};}function respondWithResult(_0x58f60b,_0x399851){_0x399851=_0x399851||0xc8;return function(_0x5589cc){if(_0x5589cc){return _0x58f60b[_0xbec4('0x16')](_0x399851)['json'](_0x5589cc);}};}function respondWithFilteredResult(_0x22e07e,_0x24ffcf){return function(_0x594567){if(_0x594567){var _0x2c82d1=typeof _0x24ffcf[_0xbec4('0x17')]===_0xbec4('0x18')&&typeof _0x24ffcf[_0xbec4('0x19')]===_0xbec4('0x18');var _0x4624b2=_0x594567[_0xbec4('0x1a')];var _0x1ac247=_0x2c82d1?0x0:_0x24ffcf[_0xbec4('0x17')];var _0x356ee0=_0x2c82d1?_0x594567[_0xbec4('0x1a')]:_0x24ffcf[_0xbec4('0x17')]+_0x24ffcf['limit'];var _0x25c95d;if(_0x356ee0>=_0x4624b2){_0x356ee0=_0x4624b2;_0x25c95d=0xc8;}else{_0x25c95d=0xce;}_0x22e07e[_0xbec4('0x16')](_0x25c95d);return _0x22e07e[_0xbec4('0x1b')](_0xbec4('0x1c'),_0x1ac247+'-'+_0x356ee0+'/'+_0x4624b2)[_0xbec4('0x1d')](_0x594567);}return null;};}function patchUpdates(_0x2b1751){return function(_0x14722f){try{jsonpatch['apply'](_0x14722f,_0x2b1751,!![]);}catch(_0x39c00b){return BPromise[_0xbec4('0x1e')](_0x39c00b);}return _0x14722f[_0xbec4('0x1f')]();};}function saveUpdates(_0x4649d7,_0x1befd7){return function(_0xb8179d){if(_0xb8179d){return _0xb8179d['update'](_0x4649d7)[_0xbec4('0x20')](function(_0x3828fd){return _0x3828fd;});}return null;};}function removeEntity(_0x4ca51e,_0x203920){return function(_0x1b67be){if(_0x1b67be){return _0x1b67be['destroy']()[_0xbec4('0x20')](function(){_0x4ca51e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x57ee17,_0x166d4e){return function(_0x3a793c){if(!_0x3a793c){_0x57ee17['sendStatus'](0x194);}return _0x3a793c;};}function handleError(_0x208eba,_0x33cb67){_0x33cb67=_0x33cb67||0x1f4;return function(_0x10003f){logger['error'](_0x10003f[_0xbec4('0x21')]);if(_0x10003f[_0xbec4('0x22')]){delete _0x10003f[_0xbec4('0x22')];}_0x208eba[_0xbec4('0x16')](_0x33cb67)['send'](_0x10003f);};}exports[_0xbec4('0x23')]=function(_0x1e744e,_0x4f4bf2){var _0x15561e={},_0x27d486={},_0x2b85a1={'count':0x0,'rows':[]};var _0x1ba557=_[_0xbec4('0x24')](db[_0xbec4('0x25')][_0xbec4('0x26')],function(_0x9bdd3c){return{'name':_0x9bdd3c[_0xbec4('0x27')],'type':_0x9bdd3c[_0xbec4('0x28')][_0xbec4('0x29')]};});_0x27d486['model']=_[_0xbec4('0x24')](_0x1ba557,'name');_0x27d486[_0xbec4('0x2a')]=_[_0xbec4('0x2b')](_0x1e744e['query']);_0x27d486[_0xbec4('0x2c')]=_['intersection'](_0x27d486[_0xbec4('0x2d')],_0x27d486[_0xbec4('0x2a')]);_0x15561e[_0xbec4('0x2e')]=_[_0xbec4('0x2f')](_0x27d486[_0xbec4('0x2d')],qs[_0xbec4('0x30')](_0x1e744e[_0xbec4('0x2a')][_0xbec4('0x30')]));_0x15561e[_0xbec4('0x2e')]=_0x15561e[_0xbec4('0x2e')][_0xbec4('0x31')]?_0x15561e['attributes']:_0x27d486[_0xbec4('0x2d')];if(!_0x1e744e[_0xbec4('0x2a')][_0xbec4('0x32')](_0xbec4('0x33'))){_0x15561e['limit']=qs[_0xbec4('0x19')](_0x1e744e[_0xbec4('0x2a')][_0xbec4('0x19')]);_0x15561e[_0xbec4('0x17')]=qs['offset'](_0x1e744e['query']['offset']);}_0x15561e['order']=qs[_0xbec4('0x34')](_0x1e744e[_0xbec4('0x2a')][_0xbec4('0x34')]);_0x15561e[_0xbec4('0x35')]=qs[_0xbec4('0x2c')](_[_0xbec4('0x36')](_0x1e744e['query'],_0x27d486[_0xbec4('0x2c')]),_0x1ba557);if(_0x1e744e[_0xbec4('0x2a')][_0xbec4('0x37')]){_0x15561e[_0xbec4('0x35')]=_[_0xbec4('0x38')](_0x15561e[_0xbec4('0x35')],{'$or':_[_0xbec4('0x24')](_0x1ba557,function(_0x233a7a){if(_0x233a7a[_0xbec4('0x28')]!==_0xbec4('0x39')){var _0xef0e6d={};_0xef0e6d[_0x233a7a[_0xbec4('0x22')]]={'$like':'%'+_0x1e744e[_0xbec4('0x2a')]['filter']+'%'};return _0xef0e6d;}})});}_0x15561e=_[_0xbec4('0x38')]({},_0x15561e,_0x1e744e[_0xbec4('0x3a')]);var _0x457b14={'where':_0x15561e[_0xbec4('0x35')]};return db['OpenchannelQueueReport'][_0xbec4('0x1a')](_0x457b14)[_0xbec4('0x20')](function(_0x527abb){_0x2b85a1[_0xbec4('0x1a')]=_0x527abb;if(_0x1e744e[_0xbec4('0x2a')][_0xbec4('0x3b')]){_0x15561e[_0xbec4('0x3c')]=[{'all':!![]}];}return db['OpenchannelQueueReport'][_0xbec4('0x3d')](_0x15561e);})[_0xbec4('0x20')](function(_0x3ca317){_0x2b85a1[_0xbec4('0x3e')]=_0x3ca317;return _0x2b85a1;})[_0xbec4('0x20')](respondWithFilteredResult(_0x4f4bf2,_0x15561e))[_0xbec4('0x3f')](handleError(_0x4f4bf2,null));};exports[_0xbec4('0x40')]=function(_0xe16258,_0x1c1696){var _0x31b4f6={'raw':!![],'where':{'id':_0xe16258[_0xbec4('0x41')]['id']}},_0x5bc97c={};_0x5bc97c['model']=_[_0xbec4('0x2b')](db[_0xbec4('0x25')][_0xbec4('0x26')]);_0x5bc97c[_0xbec4('0x2a')]=_[_0xbec4('0x2b')](_0xe16258['query']);_0x5bc97c['filters']=_['intersection'](_0x5bc97c[_0xbec4('0x2d')],_0x5bc97c[_0xbec4('0x2a')]);_0x31b4f6[_0xbec4('0x2e')]=_['intersection'](_0x5bc97c[_0xbec4('0x2d')],qs[_0xbec4('0x30')](_0xe16258[_0xbec4('0x2a')]['fields']));_0x31b4f6[_0xbec4('0x2e')]=_0x31b4f6[_0xbec4('0x2e')][_0xbec4('0x31')]?_0x31b4f6['attributes']:_0x5bc97c[_0xbec4('0x2d')];if(_0xe16258[_0xbec4('0x2a')]['includeAll']){_0x31b4f6[_0xbec4('0x3c')]=[{'all':!![]}];}_0x31b4f6=_[_0xbec4('0x38')]({},_0x31b4f6,_0xe16258[_0xbec4('0x3a')]);return db[_0xbec4('0x25')][_0xbec4('0x42')](_0x31b4f6)[_0xbec4('0x20')](handleEntityNotFound(_0x1c1696,null))[_0xbec4('0x20')](respondWithResult(_0x1c1696,null))[_0xbec4('0x3f')](handleError(_0x1c1696,null));};exports[_0xbec4('0x43')]=function(_0x42518e,_0x265789){return db[_0xbec4('0x25')][_0xbec4('0x43')](_0x42518e[_0xbec4('0x44')],{})[_0xbec4('0x20')](respondWithResult(_0x265789,0xc9))['catch'](handleError(_0x265789,null));};exports[_0xbec4('0x45')]=function(_0x445f82,_0x5e2fd3){if(_0x445f82[_0xbec4('0x44')]['id']){delete _0x445f82[_0xbec4('0x44')]['id'];}return db[_0xbec4('0x25')]['find']({'where':{'id':_0x445f82[_0xbec4('0x41')]['id']}})[_0xbec4('0x20')](handleEntityNotFound(_0x5e2fd3,null))[_0xbec4('0x20')](saveUpdates(_0x445f82[_0xbec4('0x44')],null))[_0xbec4('0x20')](respondWithResult(_0x5e2fd3,null))[_0xbec4('0x3f')](handleError(_0x5e2fd3,null));};exports[_0xbec4('0x46')]=function(_0x436861,_0x103cb5){return db[_0xbec4('0x25')][_0xbec4('0x42')]({'where':{'id':_0x436861[_0xbec4('0x41')]['id']}})['then'](handleEntityNotFound(_0x103cb5,null))[_0xbec4('0x20')](removeEntity(_0x103cb5,null))['catch'](handleError(_0x103cb5,null));};exports[_0xbec4('0x47')]=function(_0x12ca1c,_0x701819){return db[_0xbec4('0x25')][_0xbec4('0x47')]()[_0xbec4('0x20')](respondWithResult(_0x701819,null))['catch'](handleError(_0x701819,null));}; \ No newline at end of file +var _0xfa93=['reject','save','update','then','error','stack','name','send','map','rawAttributes','type','key','model','keys','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','OpenchannelQueueReport','includeAll','rows','catch','show','params','include','find','create','body','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','offset','count','apply'];(function(_0x1082ca,_0xf509b1){var _0x36ecc0=function(_0x532301){while(--_0x532301){_0x1082ca['push'](_0x1082ca['shift']());}};_0x36ecc0(++_0xf509b1);}(_0xfa93,0x1b4));var _0x3fa9=function(_0x5aa8fe,_0x1f3b43){_0x5aa8fe=_0x5aa8fe-0x0;var _0x314b3f=_0xfa93[_0x5aa8fe];return _0x314b3f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3fa9('0x0'));var zipdir=require(_0x3fa9('0x1'));var jsonpatch=require(_0x3fa9('0x2'));var rp=require(_0x3fa9('0x3'));var moment=require(_0x3fa9('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3fa9('0x5'));var util=require(_0x3fa9('0x6'));var path=require(_0x3fa9('0x7'));var sox=require(_0x3fa9('0x8'));var csv=require(_0x3fa9('0x9'));var ejs=require(_0x3fa9('0xa'));var fs=require('fs');var fs_extra=require(_0x3fa9('0xb'));var _=require(_0x3fa9('0xc'));var squel=require(_0x3fa9('0xd'));var crypto=require(_0x3fa9('0xe'));var jsforce=require(_0x3fa9('0xf'));var deskjs=require(_0x3fa9('0x10'));var toCsv=require(_0x3fa9('0x9'));var querystring=require(_0x3fa9('0x11'));var Papa=require(_0x3fa9('0x12'));var Redis=require(_0x3fa9('0x13'));var authService=require(_0x3fa9('0x14'));var qs=require(_0x3fa9('0x15'));var as=require(_0x3fa9('0x16'));var hardwareService=require(_0x3fa9('0x17'));var logger=require('../../config/logger')(_0x3fa9('0x18'));var utils=require(_0x3fa9('0x19'));var config=require(_0x3fa9('0x1a'));var licenseUtil=require(_0x3fa9('0x1b'));var db=require(_0x3fa9('0x1c'))['db'];function respondWithStatusCode(_0x68cbbc,_0x5d3159){_0x5d3159=_0x5d3159||0xcc;return function(_0x1dfa86){if(_0x1dfa86){return _0x68cbbc[_0x3fa9('0x1d')](_0x5d3159);}return _0x68cbbc[_0x3fa9('0x1e')](_0x5d3159)[_0x3fa9('0x1f')]();};}function respondWithResult(_0xa34a54,_0x2eda76){_0x2eda76=_0x2eda76||0xc8;return function(_0x51a1cd){if(_0x51a1cd){return _0xa34a54[_0x3fa9('0x1e')](_0x2eda76)[_0x3fa9('0x20')](_0x51a1cd);}};}function respondWithFilteredResult(_0x21ce14,_0x54aafe){return function(_0x60893c){if(_0x60893c){var _0x5a555f=typeof _0x54aafe['offset']==='undefined'&&typeof _0x54aafe[_0x3fa9('0x21')]===_0x3fa9('0x22');var _0xd22fe3=_0x60893c['count'];var _0x51b5b7=_0x5a555f?0x0:_0x54aafe[_0x3fa9('0x23')];var _0x50dfbd=_0x5a555f?_0x60893c[_0x3fa9('0x24')]:_0x54aafe['offset']+_0x54aafe[_0x3fa9('0x21')];var _0x4c220b;if(_0x50dfbd>=_0xd22fe3){_0x50dfbd=_0xd22fe3;_0x4c220b=0xc8;}else{_0x4c220b=0xce;}_0x21ce14[_0x3fa9('0x1e')](_0x4c220b);return _0x21ce14['set']('Content-Range',_0x51b5b7+'-'+_0x50dfbd+'/'+_0xd22fe3)[_0x3fa9('0x20')](_0x60893c);}return null;};}function patchUpdates(_0x5b96ec){return function(_0x53e2da){try{jsonpatch[_0x3fa9('0x25')](_0x53e2da,_0x5b96ec,!![]);}catch(_0x39d392){return BPromise[_0x3fa9('0x26')](_0x39d392);}return _0x53e2da[_0x3fa9('0x27')]();};}function saveUpdates(_0x5f3edc,_0x4e8cd1){return function(_0x3439f1){if(_0x3439f1){return _0x3439f1[_0x3fa9('0x28')](_0x5f3edc)[_0x3fa9('0x29')](function(_0x78b2bc){return _0x78b2bc;});}return null;};}function removeEntity(_0x41a505,_0x2f5593){return function(_0x3071e3){if(_0x3071e3){return _0x3071e3['destroy']()[_0x3fa9('0x29')](function(){_0x41a505[_0x3fa9('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b8500,_0x305586){return function(_0x277944){if(!_0x277944){_0x3b8500[_0x3fa9('0x1d')](0x194);}return _0x277944;};}function handleError(_0x167c06,_0x29af2a){_0x29af2a=_0x29af2a||0x1f4;return function(_0x333e29){logger[_0x3fa9('0x2a')](_0x333e29[_0x3fa9('0x2b')]);if(_0x333e29[_0x3fa9('0x2c')]){delete _0x333e29[_0x3fa9('0x2c')];}_0x167c06['status'](_0x29af2a)[_0x3fa9('0x2d')](_0x333e29);};}exports['index']=function(_0x20497b,_0x329fd0){var _0x57f830={},_0x3b0d0e={},_0x5b911b={'count':0x0,'rows':[]};var _0x559db1=_[_0x3fa9('0x2e')](db['OpenchannelQueueReport'][_0x3fa9('0x2f')],function(_0x2fd641){return{'name':_0x2fd641['fieldName'],'type':_0x2fd641[_0x3fa9('0x30')][_0x3fa9('0x31')]};});_0x3b0d0e[_0x3fa9('0x32')]=_[_0x3fa9('0x2e')](_0x559db1,_0x3fa9('0x2c'));_0x3b0d0e['query']=_[_0x3fa9('0x33')](_0x20497b['query']);_0x3b0d0e[_0x3fa9('0x34')]=_['intersection'](_0x3b0d0e['model'],_0x3b0d0e[_0x3fa9('0x35')]);_0x57f830[_0x3fa9('0x36')]=_[_0x3fa9('0x37')](_0x3b0d0e['model'],qs['fields'](_0x20497b[_0x3fa9('0x35')][_0x3fa9('0x38')]));_0x57f830['attributes']=_0x57f830[_0x3fa9('0x36')][_0x3fa9('0x39')]?_0x57f830[_0x3fa9('0x36')]:_0x3b0d0e[_0x3fa9('0x32')];if(!_0x20497b[_0x3fa9('0x35')][_0x3fa9('0x3a')](_0x3fa9('0x3b'))){_0x57f830[_0x3fa9('0x21')]=qs['limit'](_0x20497b[_0x3fa9('0x35')][_0x3fa9('0x21')]);_0x57f830[_0x3fa9('0x23')]=qs['offset'](_0x20497b[_0x3fa9('0x35')]['offset']);}_0x57f830[_0x3fa9('0x3c')]=qs[_0x3fa9('0x3d')](_0x20497b['query'][_0x3fa9('0x3d')]);_0x57f830['where']=qs[_0x3fa9('0x34')](_['pick'](_0x20497b['query'],_0x3b0d0e[_0x3fa9('0x34')]),_0x559db1);if(_0x20497b[_0x3fa9('0x35')]['filter']){_0x57f830[_0x3fa9('0x3e')]=_[_0x3fa9('0x3f')](_0x57f830[_0x3fa9('0x3e')],{'$or':_[_0x3fa9('0x2e')](_0x559db1,function(_0x5eb496){if(_0x5eb496['type']!==_0x3fa9('0x40')){var _0x31f909={};_0x31f909[_0x5eb496[_0x3fa9('0x2c')]]={'$like':'%'+_0x20497b[_0x3fa9('0x35')][_0x3fa9('0x41')]+'%'};return _0x31f909;}})});}_0x57f830=_[_0x3fa9('0x3f')]({},_0x57f830,_0x20497b[_0x3fa9('0x42')]);var _0x26cc93={'where':_0x57f830[_0x3fa9('0x3e')]};return db[_0x3fa9('0x43')]['count'](_0x26cc93)[_0x3fa9('0x29')](function(_0x7b5983){_0x5b911b['count']=_0x7b5983;if(_0x20497b[_0x3fa9('0x35')][_0x3fa9('0x44')]){_0x57f830['include']=[{'all':!![]}];}return db[_0x3fa9('0x43')]['findAll'](_0x57f830);})[_0x3fa9('0x29')](function(_0x280379){_0x5b911b[_0x3fa9('0x45')]=_0x280379;return _0x5b911b;})['then'](respondWithFilteredResult(_0x329fd0,_0x57f830))[_0x3fa9('0x46')](handleError(_0x329fd0,null));};exports[_0x3fa9('0x47')]=function(_0x196a53,_0x52c071){var _0xe6ab97={'raw':!![],'where':{'id':_0x196a53[_0x3fa9('0x48')]['id']}},_0x589484={};_0x589484[_0x3fa9('0x32')]=_[_0x3fa9('0x33')](db[_0x3fa9('0x43')]['rawAttributes']);_0x589484[_0x3fa9('0x35')]=_[_0x3fa9('0x33')](_0x196a53['query']);_0x589484[_0x3fa9('0x34')]=_[_0x3fa9('0x37')](_0x589484[_0x3fa9('0x32')],_0x589484['query']);_0xe6ab97[_0x3fa9('0x36')]=_['intersection'](_0x589484[_0x3fa9('0x32')],qs[_0x3fa9('0x38')](_0x196a53[_0x3fa9('0x35')][_0x3fa9('0x38')]));_0xe6ab97['attributes']=_0xe6ab97[_0x3fa9('0x36')][_0x3fa9('0x39')]?_0xe6ab97[_0x3fa9('0x36')]:_0x589484['model'];if(_0x196a53[_0x3fa9('0x35')]['includeAll']){_0xe6ab97[_0x3fa9('0x49')]=[{'all':!![]}];}_0xe6ab97=_[_0x3fa9('0x3f')]({},_0xe6ab97,_0x196a53['options']);return db[_0x3fa9('0x43')][_0x3fa9('0x4a')](_0xe6ab97)[_0x3fa9('0x29')](handleEntityNotFound(_0x52c071,null))[_0x3fa9('0x29')](respondWithResult(_0x52c071,null))[_0x3fa9('0x46')](handleError(_0x52c071,null));};exports[_0x3fa9('0x4b')]=function(_0x20582f,_0x58646e){return db[_0x3fa9('0x43')][_0x3fa9('0x4b')](_0x20582f[_0x3fa9('0x4c')],{})['then'](respondWithResult(_0x58646e,0xc9))[_0x3fa9('0x46')](handleError(_0x58646e,null));};exports[_0x3fa9('0x28')]=function(_0x35ea12,_0x2f5a5c){if(_0x35ea12[_0x3fa9('0x4c')]['id']){delete _0x35ea12[_0x3fa9('0x4c')]['id'];}return db[_0x3fa9('0x43')]['find']({'where':{'id':_0x35ea12['params']['id']}})[_0x3fa9('0x29')](handleEntityNotFound(_0x2f5a5c,null))[_0x3fa9('0x29')](saveUpdates(_0x35ea12[_0x3fa9('0x4c')],null))['then'](respondWithResult(_0x2f5a5c,null))[_0x3fa9('0x46')](handleError(_0x2f5a5c,null));};exports[_0x3fa9('0x4d')]=function(_0x12b429,_0x1d144c){return db[_0x3fa9('0x43')][_0x3fa9('0x4a')]({'where':{'id':_0x12b429[_0x3fa9('0x48')]['id']}})['then'](handleEntityNotFound(_0x1d144c,null))[_0x3fa9('0x29')](removeEntity(_0x1d144c,null))[_0x3fa9('0x46')](handleError(_0x1d144c,null));};exports[_0x3fa9('0x4e')]=function(_0x135726,_0x3a2a10){return db[_0x3fa9('0x43')][_0x3fa9('0x4e')]()[_0x3fa9('0x29')](respondWithResult(_0x3a2a10,null))[_0x3fa9('0x46')](handleError(_0x3a2a10,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index a14975a..ef34f0c 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 _0x1261=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','define','report_openchannel_queue','uniqueid','util'];(function(_0x4d81c4,_0x16bd75){var _0x1c856b=function(_0x22079d){while(--_0x22079d){_0x4d81c4['push'](_0x4d81c4['shift']());}};_0x1c856b(++_0x16bd75);}(_0x1261,0x144));var _0x1126=function(_0x1293fa,_0x446d6b){_0x1293fa=_0x1293fa-0x0;var _0x1dd054=_0x1261[_0x1293fa];return _0x1dd054;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var logger=require(_0x1126('0x1'))(_0x1126('0x2'));var moment=require(_0x1126('0x3'));var BPromise=require(_0x1126('0x4'));var rp=require(_0x1126('0x5'));var fs=require('fs');var path=require(_0x1126('0x6'));var rimraf=require(_0x1126('0x7'));var config=require(_0x1126('0x8'));var attributes=require(_0x1126('0x9'));module['exports']=function(_0x5c68c8,_0x40ba58){return _0x5c68c8[_0x1126('0xa')]('OpenchannelQueueReport',attributes,{'tableName':_0x1126('0xb'),'paranoid':![],'indexes':[{'name':_0x1126('0xc'),'fields':[_0x1126('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5fc3=['util','api','moment','bluebird','request-promise','path','../../config/environment','./openchannelQueueReport.attributes','exports','define','report_openchannel_queue','uniqueid','lodash'];(function(_0x49b38f,_0x1828f1){var _0x3fa66d=function(_0x204d0d){while(--_0x204d0d){_0x49b38f['push'](_0x49b38f['shift']());}};_0x3fa66d(++_0x1828f1);}(_0x5fc3,0xa8));var _0x35fc=function(_0x43a5c7,_0x2286bf){_0x43a5c7=_0x43a5c7-0x0;var _0x3b12a2=_0x5fc3[_0x43a5c7];return _0x3b12a2;};'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 diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index 40f82cc..3351977 100644 --- a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js +++ b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x056b=['CreateOpenchannelQueueReport','OpenchannelQueueReport','create','options','raw','then','debug','update','body','where','attributes','UpdateOpenchannelQueueReport','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x4b0235,_0x25b269){var _0x22d370=function(_0x473c6d){while(--_0x473c6d){_0x4b0235['push'](_0x4b0235['shift']());}};_0x22d370(++_0x25b269);}(_0x056b,0xb6));var _0xb056=function(_0x49d27a,_0x166543){_0x49d27a=_0x49d27a-0x0;var _0x3f0b62=_0x056b[_0x49d27a];return _0x3f0b62;};'use strict';var _=require('lodash');var util=require(_0xb056('0x0'));var moment=require(_0xb056('0x1'));var BPromise=require(_0xb056('0x2'));var rs=require(_0xb056('0x3'));var fs=require('fs');var Redis=require(_0xb056('0x4'));var db=require(_0xb056('0x5'))['db'];var utils=require(_0xb056('0x6'));var logger=require(_0xb056('0x7'))(_0xb056('0x8'));var config=require(_0xb056('0x9'));var jayson=require(_0xb056('0xa'));var client=jayson['client'][_0xb056('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x314637,_0x3eae69,_0x3c9b89){return new BPromise(function(_0x80daf1,_0x6bf4c){return client['request'](_0x314637,_0x3c9b89)['then'](function(_0x37a86d){logger[_0xb056('0xc')](_0xb056('0xd'),_0x3eae69,_0xb056('0xe'));logger['debug'](_0xb056('0xf'),_0x3eae69,'request\x20sent',JSON[_0xb056('0x10')](_0x37a86d));if(_0x37a86d[_0xb056('0x11')]){if(_0x37a86d[_0xb056('0x11')][_0xb056('0x12')]===0x1f4){logger[_0xb056('0x11')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x3eae69,_0x37a86d['error'][_0xb056('0x13')]);return _0x6bf4c(_0x37a86d[_0xb056('0x11')]['message']);}logger[_0xb056('0x11')](_0xb056('0xd'),_0x3eae69,_0x37a86d[_0xb056('0x11')][_0xb056('0x13')]);return _0x80daf1(_0x37a86d[_0xb056('0x11')][_0xb056('0x13')]);}else{logger[_0xb056('0xc')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x3eae69,_0xb056('0xe'));_0x80daf1(_0x37a86d[_0xb056('0x14')][_0xb056('0x13')]);}})[_0xb056('0x15')](function(_0x5a4ef1){logger[_0xb056('0x11')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x3eae69,_0x5a4ef1);_0x6bf4c(_0x5a4ef1);});});}exports[_0xb056('0x16')]=function(_0x311eb9){var _0x48e140=this;return new Promise(function(_0x29c77e,_0x4c57e6){return db[_0xb056('0x17')][_0xb056('0x18')](_0x311eb9['body'],{'raw':_0x311eb9[_0xb056('0x19')]?_0x311eb9['options'][_0xb056('0x1a')]===undefined?!![]:![]:!![]})[_0xb056('0x1b')](function(_0x457b54){logger[_0xb056('0xc')]('CreateOpenchannelQueueReport',_0x311eb9);logger[_0xb056('0x1c')]('CreateOpenchannelQueueReport',_0x311eb9,JSON[_0xb056('0x10')](_0x457b54));_0x29c77e(_0x457b54);})['catch'](function(_0x324ce6){logger[_0xb056('0x11')](_0xb056('0x16'),_0x324ce6[_0xb056('0x13')],_0x311eb9);_0x4c57e6(_0x48e140[_0xb056('0x11')](0x1f4,_0x324ce6[_0xb056('0x13')]));});});};exports['UpdateOpenchannelQueueReport']=function(_0x1016da){var _0x18a3f2=this;return new Promise(function(_0x341544,_0x1bd6ac){return db['OpenchannelQueueReport'][_0xb056('0x1d')](_0x1016da[_0xb056('0x1e')],{'raw':_0x1016da['options']?_0x1016da[_0xb056('0x19')][_0xb056('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1016da[_0xb056('0x19')]?_0x1016da[_0xb056('0x19')][_0xb056('0x1f')]||null:null,'attributes':_0x1016da[_0xb056('0x19')]?_0x1016da[_0xb056('0x19')][_0xb056('0x20')]||null:null,'limit':_0x1016da['options']?_0x1016da[_0xb056('0x19')]['limit']||null:null})[_0xb056('0x1b')](function(_0x9c6f4a){logger[_0xb056('0xc')]('UpdateOpenchannelQueueReport',_0x1016da);logger[_0xb056('0x1c')](_0xb056('0x21'),_0x1016da,JSON['stringify'](_0x9c6f4a));_0x341544(_0x9c6f4a);})[_0xb056('0x15')](function(_0x43aa63){logger[_0xb056('0x11')](_0xb056('0x21'),_0x43aa63[_0xb056('0x13')],_0x1016da);_0x1bd6ac(_0x18a3f2['error'](0x1f4,_0x43aa63[_0xb056('0x13')]));});});}; \ No newline at end of file +var _0x1bc6=['catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','body','options','raw','stringify','UpdateOpenchannelQueueReport','update','where','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','error','message','OpenchannelQueueReport,\x20%s,\x20%s','result'];(function(_0x7dee5a,_0x134236){var _0x43b613=function(_0x8a9e3b){while(--_0x8a9e3b){_0x7dee5a['push'](_0x7dee5a['shift']());}};_0x43b613(++_0x134236);}(_0x1bc6,0x94));var _0x61bc=function(_0x22bc24,_0x248df8){_0x22bc24=_0x22bc24-0x0;var _0x45ceba=_0x1bc6[_0x22bc24];return _0x45ceba;};'use strict';var _=require(_0x61bc('0x0'));var util=require(_0x61bc('0x1'));var moment=require(_0x61bc('0x2'));var BPromise=require(_0x61bc('0x3'));var rs=require(_0x61bc('0x4'));var fs=require('fs');var Redis=require(_0x61bc('0x5'));var db=require(_0x61bc('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x61bc('0x7'))(_0x61bc('0x8'));var config=require(_0x61bc('0x9'));var jayson=require(_0x61bc('0xa'));var client=jayson[_0x61bc('0xb')][_0x61bc('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x410656,_0x1b29e3,_0x151ef4){return new BPromise(function(_0x5ebb87,_0x339305){return client['request'](_0x410656,_0x151ef4)[_0x61bc('0xd')](function(_0x502dc0){logger[_0x61bc('0xe')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x1b29e3,_0x61bc('0xf'));logger[_0x61bc('0x10')](_0x61bc('0x11'),_0x1b29e3,'request\x20sent',JSON['stringify'](_0x502dc0));if(_0x502dc0['error']){if(_0x502dc0['error']['code']===0x1f4){logger[_0x61bc('0x12')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x1b29e3,_0x502dc0[_0x61bc('0x12')][_0x61bc('0x13')]);return _0x339305(_0x502dc0['error']['message']);}logger['error'](_0x61bc('0x14'),_0x1b29e3,_0x502dc0[_0x61bc('0x12')]['message']);return _0x5ebb87(_0x502dc0[_0x61bc('0x12')][_0x61bc('0x13')]);}else{logger[_0x61bc('0xe')](_0x61bc('0x14'),_0x1b29e3,_0x61bc('0xf'));_0x5ebb87(_0x502dc0[_0x61bc('0x15')]['message']);}})[_0x61bc('0x16')](function(_0x21b974){logger['error']('OpenchannelQueueReport,\x20%s,\x20%s',_0x1b29e3,_0x21b974);_0x339305(_0x21b974);});});}exports[_0x61bc('0x17')]=function(_0x2a6f35){var _0x96cd3=this;return new Promise(function(_0x4ca1c3,_0x457702){return db[_0x61bc('0x18')][_0x61bc('0x19')](_0x2a6f35[_0x61bc('0x1a')],{'raw':_0x2a6f35['options']?_0x2a6f35[_0x61bc('0x1b')][_0x61bc('0x1c')]===undefined?!![]:![]:!![]})[_0x61bc('0xd')](function(_0x144b07){logger['info'](_0x61bc('0x17'),_0x2a6f35);logger[_0x61bc('0x10')](_0x61bc('0x17'),_0x2a6f35,JSON[_0x61bc('0x1d')](_0x144b07));_0x4ca1c3(_0x144b07);})[_0x61bc('0x16')](function(_0x141db2){logger[_0x61bc('0x12')]('CreateOpenchannelQueueReport',_0x141db2[_0x61bc('0x13')],_0x2a6f35);_0x457702(_0x96cd3[_0x61bc('0x12')](0x1f4,_0x141db2[_0x61bc('0x13')]));});});};exports[_0x61bc('0x1e')]=function(_0x270f1c){var _0x567632=this;return new Promise(function(_0xc25ed5,_0x40cb55){return db[_0x61bc('0x18')][_0x61bc('0x1f')](_0x270f1c[_0x61bc('0x1a')],{'raw':_0x270f1c['options']?_0x270f1c['options'][_0x61bc('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x270f1c['options']?_0x270f1c[_0x61bc('0x1b')][_0x61bc('0x20')]||null:null,'attributes':_0x270f1c[_0x61bc('0x1b')]?_0x270f1c[_0x61bc('0x1b')]['attributes']||null:null,'limit':_0x270f1c[_0x61bc('0x1b')]?_0x270f1c[_0x61bc('0x1b')][_0x61bc('0x21')]||null:null})[_0x61bc('0xd')](function(_0x364600){logger[_0x61bc('0xe')](_0x61bc('0x1e'),_0x270f1c);logger[_0x61bc('0x10')](_0x61bc('0x1e'),_0x270f1c,JSON[_0x61bc('0x1d')](_0x364600));_0xc25ed5(_0x364600);})['catch'](function(_0x173e7b){logger[_0x61bc('0x12')](_0x61bc('0x1e'),_0x173e7b[_0x61bc('0x13')],_0x270f1c);_0x40cb55(_0x567632[_0x61bc('0x12')](0x1f4,_0x173e7b[_0x61bc('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index eebcd8c..3a2dc87 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 _0xe817=['get','isAuthenticated','/:id','show','post','create','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller'];(function(_0x1d4cac,_0x2145a5){var _0x26ecdb=function(_0x3b32b3){while(--_0x3b32b3){_0x1d4cac['push'](_0x1d4cac['shift']());}};_0x26ecdb(++_0x2145a5);}(_0xe817,0x13a));var _0x7e81=function(_0x258ea7,_0x28ccf6){_0x258ea7=_0x258ea7-0x0;var _0x38840a=_0xe817[_0x258ea7];return _0x38840a;};'use strict';var multer=require(_0x7e81('0x0'));var util=require(_0x7e81('0x1'));var path=require(_0x7e81('0x2'));var timeout=require('connect-timeout');var express=require(_0x7e81('0x3'));var router=express[_0x7e81('0x4')]();var fs_extra=require(_0x7e81('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x7e81('0x6'));var config=require(_0x7e81('0x7'));var controller=require(_0x7e81('0x8'));router[_0x7e81('0x9')]('/',auth[_0x7e81('0xa')](),controller['index']);router[_0x7e81('0x9')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x7e81('0x9')](_0x7e81('0xb'),auth[_0x7e81('0xa')](),controller[_0x7e81('0xc')]);router[_0x7e81('0xd')]('/',auth[_0x7e81('0xa')](),controller[_0x7e81('0xe')]);router['put'](_0x7e81('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x7e81('0xf')](_0x7e81('0xb'),auth[_0x7e81('0xa')](),controller[_0x7e81('0x10')]);module['exports']=router; \ No newline at end of file +var _0xf8d2=['create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','post'];(function(_0x22cd57,_0x16af54){var _0x3e057c=function(_0x2e8afb){while(--_0x2e8afb){_0x22cd57['push'](_0x22cd57['shift']());}};_0x3e057c(++_0x16af54);}(_0xf8d2,0xcc));var _0x2f8d=function(_0x25216e,_0x77c03a){_0x25216e=_0x25216e-0x0;var _0x58cfab=_0xf8d2[_0x25216e];return _0x58cfab;};'use strict';var multer=require(_0x2f8d('0x0'));var util=require(_0x2f8d('0x1'));var path=require(_0x2f8d('0x2'));var timeout=require(_0x2f8d('0x3'));var express=require(_0x2f8d('0x4'));var router=express[_0x2f8d('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x2f8d('0x6'));var interaction=require(_0x2f8d('0x7'));var config=require(_0x2f8d('0x8'));var controller=require('./openchannelTransferReport.controller');router[_0x2f8d('0x9')]('/',auth[_0x2f8d('0xa')](),controller[_0x2f8d('0xb')]);router[_0x2f8d('0x9')](_0x2f8d('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0x2f8d('0x9')](_0x2f8d('0xd'),auth['isAuthenticated'](),controller[_0x2f8d('0xe')]);router[_0x2f8d('0xf')]('/',auth[_0x2f8d('0xa')](),controller[_0x2f8d('0x10')]);router[_0x2f8d('0x11')](_0x2f8d('0xd'),auth[_0x2f8d('0xa')](),controller[_0x2f8d('0x12')]);router[_0x2f8d('0x13')](_0x2f8d('0xd'),auth[_0x2f8d('0xa')](),controller[_0x2f8d('0x14')]);module[_0x2f8d('0x15')]=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index 18b6c90..9d33b07 100644 --- a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js +++ b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x151132,_0x32026a){var _0x13c2ad=function(_0x4dcd81){while(--_0x4dcd81){_0x151132['push'](_0x151132['shift']());}};_0x13c2ad(++_0x32026a);}(_0x54ef,0x112));var _0xf54e=function(_0x38051f,_0x47eb35){_0x38051f=_0x38051f-0x0;var _0x4f4ceb=_0x54ef[_0x38051f];return _0x4f4ceb;};'use strict';var moment=require(_0xf54e('0x0'));var Sequelize=require(_0xf54e('0x1'));module[_0xf54e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf54e('0x3')](_0xf54e('0x4'),_0xf54e('0x5'),_0xf54e('0x6')),'allowNull':![],'defaultValue':_0xf54e('0x6')},'transferredAt':{'type':Sequelize[_0xf54e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xf54e('0x8')]}}; \ No newline at end of file +var _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x2786ea,_0x16c3c3){var _0x5c38e5=function(_0x5a53c5){while(--_0x5a53c5){_0x2786ea['push'](_0x2786ea['shift']());}};_0x5c38e5(++_0x16c3c3);}(_0xb43b,0x1b2));var _0xbb43=function(_0x12531a,_0x270206){_0x12531a=_0x12531a-0x0;var _0x11e648=_0xb43b[_0x12531a];return _0x11e648;};'use strict';var moment=require(_0xbb43('0x0'));var Sequelize=require(_0xbb43('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xbb43('0x3')](_0xbb43('0x4'),'agent',_0xbb43('0x5')),'allowNull':![],'defaultValue':_0xbb43('0x5')},'transferredAt':{'type':Sequelize[_0xbb43('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xbb43('0x7')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index bcfa128..2b1ff31 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 _0x06d3=['../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','index','map','OpenchannelTransferReport','rawAttributes','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x2be310,_0xd52fbe){var _0x5554e7=function(_0x566516){while(--_0x566516){_0x2be310['push'](_0x2be310['shift']());}};_0x5554e7(++_0xd52fbe);}(_0x06d3,0x1b0));var _0x306d=function(_0x5490de,_0x7ddd3f){_0x5490de=_0x5490de-0x0;var _0xaf14ba=_0x06d3[_0x5490de];return _0xaf14ba;};'use strict';var emlformat=require(_0x306d('0x0'));var rimraf=require(_0x306d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x306d('0x2'));var rp=require(_0x306d('0x3'));var moment=require(_0x306d('0x4'));var BPromise=require(_0x306d('0x5'));var Mustache=require(_0x306d('0x6'));var util=require(_0x306d('0x7'));var path=require('path');var sox=require(_0x306d('0x8'));var csv=require(_0x306d('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x306d('0xa'));var _=require(_0x306d('0xb'));var squel=require('squel');var crypto=require(_0x306d('0xc'));var jsforce=require(_0x306d('0xd'));var deskjs=require(_0x306d('0xe'));var toCsv=require(_0x306d('0x9'));var querystring=require('querystring');var Papa=require(_0x306d('0xf'));var Redis=require(_0x306d('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x306d('0x11'));var as=require(_0x306d('0x12'));var hardwareService=require(_0x306d('0x13'));var logger=require(_0x306d('0x14'))('api');var utils=require(_0x306d('0x15'));var config=require(_0x306d('0x16'));var licenseUtil=require(_0x306d('0x17'));var db=require(_0x306d('0x18'))['db'];function respondWithStatusCode(_0x342369,_0x1a10eb){_0x1a10eb=_0x1a10eb||0xcc;return function(_0x126cdf){if(_0x126cdf){return _0x342369[_0x306d('0x19')](_0x1a10eb);}return _0x342369[_0x306d('0x1a')](_0x1a10eb)[_0x306d('0x1b')]();};}function respondWithResult(_0x479dd7,_0x12744e){_0x12744e=_0x12744e||0xc8;return function(_0x21e60f){if(_0x21e60f){return _0x479dd7['status'](_0x12744e)[_0x306d('0x1c')](_0x21e60f);}};}function respondWithFilteredResult(_0x32ab85,_0x158fb5){return function(_0x19bff7){if(_0x19bff7){var _0x567766=typeof _0x158fb5[_0x306d('0x1d')]===_0x306d('0x1e')&&typeof _0x158fb5[_0x306d('0x1f')]==='undefined';var _0x207ba2=_0x19bff7['count'];var _0x2405a3=_0x567766?0x0:_0x158fb5['offset'];var _0x17815e=_0x567766?_0x19bff7[_0x306d('0x20')]:_0x158fb5[_0x306d('0x1d')]+_0x158fb5[_0x306d('0x1f')];var _0x343ea7;if(_0x17815e>=_0x207ba2){_0x17815e=_0x207ba2;_0x343ea7=0xc8;}else{_0x343ea7=0xce;}_0x32ab85[_0x306d('0x1a')](_0x343ea7);return _0x32ab85[_0x306d('0x21')](_0x306d('0x22'),_0x2405a3+'-'+_0x17815e+'/'+_0x207ba2)['json'](_0x19bff7);}return null;};}function patchUpdates(_0x7f7ce1){return function(_0x567375){try{jsonpatch[_0x306d('0x23')](_0x567375,_0x7f7ce1,!![]);}catch(_0x17f358){return BPromise[_0x306d('0x24')](_0x17f358);}return _0x567375[_0x306d('0x25')]();};}function saveUpdates(_0x389978,_0x4f6e51){return function(_0x41981e){if(_0x41981e){return _0x41981e[_0x306d('0x26')](_0x389978)[_0x306d('0x27')](function(_0x1501da){return _0x1501da;});}return null;};}function removeEntity(_0xb59013,_0x5b425f){return function(_0x1d07be){if(_0x1d07be){return _0x1d07be[_0x306d('0x28')]()[_0x306d('0x27')](function(){_0xb59013['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x262462,_0x4b6d64){return function(_0x2b7a72){if(!_0x2b7a72){_0x262462['sendStatus'](0x194);}return _0x2b7a72;};}function handleError(_0x4c592c,_0x92ee20){_0x92ee20=_0x92ee20||0x1f4;return function(_0x3a2bbb){logger['error'](_0x3a2bbb[_0x306d('0x29')]);if(_0x3a2bbb[_0x306d('0x2a')]){delete _0x3a2bbb[_0x306d('0x2a')];}_0x4c592c[_0x306d('0x1a')](_0x92ee20)['send'](_0x3a2bbb);};}exports[_0x306d('0x2b')]=function(_0x341c07,_0x3b80a1){var _0x27439b={},_0x438708={},_0x3bbed4={'count':0x0,'rows':[]};var _0x391cad=_[_0x306d('0x2c')](db[_0x306d('0x2d')][_0x306d('0x2e')],function(_0x3d32bd){return{'name':_0x3d32bd['fieldName'],'type':_0x3d32bd['type'][_0x306d('0x2f')]};});_0x438708[_0x306d('0x30')]=_[_0x306d('0x2c')](_0x391cad,_0x306d('0x2a'));_0x438708['query']=_[_0x306d('0x31')](_0x341c07[_0x306d('0x32')]);_0x438708[_0x306d('0x33')]=_[_0x306d('0x34')](_0x438708['model'],_0x438708[_0x306d('0x32')]);_0x27439b[_0x306d('0x35')]=_[_0x306d('0x34')](_0x438708[_0x306d('0x30')],qs[_0x306d('0x36')](_0x341c07[_0x306d('0x32')]['fields']));_0x27439b[_0x306d('0x35')]=_0x27439b[_0x306d('0x35')][_0x306d('0x37')]?_0x27439b[_0x306d('0x35')]:_0x438708[_0x306d('0x30')];if(!_0x341c07[_0x306d('0x32')][_0x306d('0x38')]('nolimit')){_0x27439b[_0x306d('0x1f')]=qs[_0x306d('0x1f')](_0x341c07['query']['limit']);_0x27439b[_0x306d('0x1d')]=qs[_0x306d('0x1d')](_0x341c07[_0x306d('0x32')][_0x306d('0x1d')]);}_0x27439b[_0x306d('0x39')]=qs[_0x306d('0x3a')](_0x341c07[_0x306d('0x32')][_0x306d('0x3a')]);_0x27439b['where']=qs['filters'](_[_0x306d('0x3b')](_0x341c07[_0x306d('0x32')],_0x438708[_0x306d('0x33')]),_0x391cad);if(_0x341c07[_0x306d('0x32')][_0x306d('0x3c')]){_0x27439b[_0x306d('0x3d')]=_[_0x306d('0x3e')](_0x27439b[_0x306d('0x3d')],{'$or':_['map'](_0x391cad,function(_0x3616a4){if(_0x3616a4['type']!==_0x306d('0x3f')){var _0x406c4b={};_0x406c4b[_0x3616a4['name']]={'$like':'%'+_0x341c07['query'][_0x306d('0x3c')]+'%'};return _0x406c4b;}})});}_0x27439b=_['merge']({},_0x27439b,_0x341c07[_0x306d('0x40')]);var _0x205f8a={'where':_0x27439b[_0x306d('0x3d')]};return db[_0x306d('0x2d')][_0x306d('0x20')](_0x205f8a)[_0x306d('0x27')](function(_0x1b3743){_0x3bbed4[_0x306d('0x20')]=_0x1b3743;if(_0x341c07['query']['includeAll']){_0x27439b[_0x306d('0x41')]=[{'all':!![]}];}return db[_0x306d('0x2d')][_0x306d('0x42')](_0x27439b);})['then'](function(_0x603929){_0x3bbed4[_0x306d('0x43')]=_0x603929;return _0x3bbed4;})[_0x306d('0x27')](respondWithFilteredResult(_0x3b80a1,_0x27439b))[_0x306d('0x44')](handleError(_0x3b80a1,null));};exports[_0x306d('0x45')]=function(_0x41e4b6,_0x54235a){var _0xbec94d={'raw':!![],'where':{'id':_0x41e4b6[_0x306d('0x46')]['id']}},_0x5e3c64={};_0x5e3c64[_0x306d('0x30')]=_[_0x306d('0x31')](db[_0x306d('0x2d')]['rawAttributes']);_0x5e3c64[_0x306d('0x32')]=_[_0x306d('0x31')](_0x41e4b6[_0x306d('0x32')]);_0x5e3c64[_0x306d('0x33')]=_[_0x306d('0x34')](_0x5e3c64['model'],_0x5e3c64[_0x306d('0x32')]);_0xbec94d[_0x306d('0x35')]=_[_0x306d('0x34')](_0x5e3c64[_0x306d('0x30')],qs[_0x306d('0x36')](_0x41e4b6[_0x306d('0x32')][_0x306d('0x36')]));_0xbec94d[_0x306d('0x35')]=_0xbec94d[_0x306d('0x35')][_0x306d('0x37')]?_0xbec94d[_0x306d('0x35')]:_0x5e3c64['model'];if(_0x41e4b6[_0x306d('0x32')][_0x306d('0x47')]){_0xbec94d['include']=[{'all':!![]}];}_0xbec94d=_['merge']({},_0xbec94d,_0x41e4b6['options']);return db[_0x306d('0x2d')][_0x306d('0x48')](_0xbec94d)[_0x306d('0x27')](handleEntityNotFound(_0x54235a,null))[_0x306d('0x27')](respondWithResult(_0x54235a,null))['catch'](handleError(_0x54235a,null));};exports[_0x306d('0x49')]=function(_0x47a59e,_0x32d1b2){return db['OpenchannelTransferReport'][_0x306d('0x49')](_0x47a59e[_0x306d('0x4a')],{})[_0x306d('0x27')](respondWithResult(_0x32d1b2,0xc9))[_0x306d('0x44')](handleError(_0x32d1b2,null));};exports[_0x306d('0x26')]=function(_0x1b9051,_0x3ac8b6){if(_0x1b9051['body']['id']){delete _0x1b9051[_0x306d('0x4a')]['id'];}return db[_0x306d('0x2d')][_0x306d('0x48')]({'where':{'id':_0x1b9051[_0x306d('0x46')]['id']}})[_0x306d('0x27')](handleEntityNotFound(_0x3ac8b6,null))['then'](saveUpdates(_0x1b9051[_0x306d('0x4a')],null))['then'](respondWithResult(_0x3ac8b6,null))[_0x306d('0x44')](handleError(_0x3ac8b6,null));};exports['destroy']=function(_0x209ce4,_0x55640e){return db[_0x306d('0x2d')][_0x306d('0x48')]({'where':{'id':_0x209ce4[_0x306d('0x46')]['id']}})[_0x306d('0x27')](handleEntityNotFound(_0x55640e,null))['then'](removeEntity(_0x55640e,null))[_0x306d('0x44')](handleError(_0x55640e,null));};exports[_0x306d('0x4b')]=function(_0x1e508e,_0x13de47){return db['OpenchannelTransferReport'][_0x306d('0x4b')]()[_0x306d('0x27')](respondWithResult(_0x13de47,null))['catch'](handleError(_0x13de47,null));}; \ No newline at end of file +var _0x7e17=['jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','end','stack','name','fieldName','type','key','model','map','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','OpenchannelTransferReport','include','findAll','rows','params','rawAttributes','length','find','create','body','destroy','catch','describe','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel'];(function(_0xee95aa,_0x56bc39){var _0x301db2=function(_0x1162b1){while(--_0x1162b1){_0xee95aa['push'](_0xee95aa['shift']());}};_0x301db2(++_0x56bc39);}(_0x7e17,0x89));var _0x77e1=function(_0xe5366,_0x32ea05){_0xe5366=_0xe5366-0x0;var _0x3dfd7d=_0x7e17[_0xe5366];return _0x3dfd7d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x77e1('0x0'));var zipdir=require(_0x77e1('0x1'));var jsonpatch=require(_0x77e1('0x2'));var rp=require('request-promise');var moment=require(_0x77e1('0x3'));var BPromise=require(_0x77e1('0x4'));var Mustache=require(_0x77e1('0x5'));var util=require(_0x77e1('0x6'));var path=require(_0x77e1('0x7'));var sox=require('sox');var csv=require(_0x77e1('0x8'));var ejs=require(_0x77e1('0x9'));var fs=require('fs');var fs_extra=require(_0x77e1('0xa'));var _=require(_0x77e1('0xb'));var squel=require(_0x77e1('0xc'));var crypto=require('crypto');var jsforce=require(_0x77e1('0xd'));var deskjs=require(_0x77e1('0xe'));var toCsv=require(_0x77e1('0x8'));var querystring=require(_0x77e1('0xf'));var Papa=require('papaparse');var Redis=require(_0x77e1('0x10'));var authService=require(_0x77e1('0x11'));var qs=require(_0x77e1('0x12'));var as=require(_0x77e1('0x13'));var hardwareService=require(_0x77e1('0x14'));var logger=require(_0x77e1('0x15'))(_0x77e1('0x16'));var utils=require('../../config/utils');var config=require(_0x77e1('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x77e1('0x18'))['db'];function respondWithStatusCode(_0x5d157e,_0x5af085){_0x5af085=_0x5af085||0xcc;return function(_0x69efbb){if(_0x69efbb){return _0x5d157e[_0x77e1('0x19')](_0x5af085);}return _0x5d157e[_0x77e1('0x1a')](_0x5af085)['end']();};}function respondWithResult(_0x4017e6,_0xa915e5){_0xa915e5=_0xa915e5||0xc8;return function(_0x3abc31){if(_0x3abc31){return _0x4017e6[_0x77e1('0x1a')](_0xa915e5)[_0x77e1('0x1b')](_0x3abc31);}};}function respondWithFilteredResult(_0x5259a6,_0xaf2dd1){return function(_0x2aa001){if(_0x2aa001){var _0xc2f6f2=typeof _0xaf2dd1[_0x77e1('0x1c')]===_0x77e1('0x1d')&&typeof _0xaf2dd1[_0x77e1('0x1e')]===_0x77e1('0x1d');var _0x13467f=_0x2aa001['count'];var _0x59b306=_0xc2f6f2?0x0:_0xaf2dd1[_0x77e1('0x1c')];var _0x1ca9a6=_0xc2f6f2?_0x2aa001[_0x77e1('0x1f')]:_0xaf2dd1[_0x77e1('0x1c')]+_0xaf2dd1[_0x77e1('0x1e')];var _0x401a49;if(_0x1ca9a6>=_0x13467f){_0x1ca9a6=_0x13467f;_0x401a49=0xc8;}else{_0x401a49=0xce;}_0x5259a6[_0x77e1('0x1a')](_0x401a49);return _0x5259a6[_0x77e1('0x20')]('Content-Range',_0x59b306+'-'+_0x1ca9a6+'/'+_0x13467f)[_0x77e1('0x1b')](_0x2aa001);}return null;};}function patchUpdates(_0x384513){return function(_0x518e1e){try{jsonpatch[_0x77e1('0x21')](_0x518e1e,_0x384513,!![]);}catch(_0x149987){return BPromise[_0x77e1('0x22')](_0x149987);}return _0x518e1e[_0x77e1('0x23')]();};}function saveUpdates(_0x59741a,_0x48930b){return function(_0x5add5e){if(_0x5add5e){return _0x5add5e[_0x77e1('0x24')](_0x59741a)[_0x77e1('0x25')](function(_0x11e829){return _0x11e829;});}return null;};}function removeEntity(_0x480d3f,_0x1a4b9a){return function(_0x23013e){if(_0x23013e){return _0x23013e['destroy']()[_0x77e1('0x25')](function(){_0x480d3f['status'](0xcc)[_0x77e1('0x26')]();});}};}function handleEntityNotFound(_0x2ae970,_0x1a1658){return function(_0x28c72c){if(!_0x28c72c){_0x2ae970['sendStatus'](0x194);}return _0x28c72c;};}function handleError(_0x508588,_0x278dba){_0x278dba=_0x278dba||0x1f4;return function(_0x23d1e6){logger['error'](_0x23d1e6[_0x77e1('0x27')]);if(_0x23d1e6['name']){delete _0x23d1e6[_0x77e1('0x28')];}_0x508588[_0x77e1('0x1a')](_0x278dba)['send'](_0x23d1e6);};}exports['index']=function(_0x3e9247,_0x36e569){var _0x4b4289={},_0x45736={},_0x977d82={'count':0x0,'rows':[]};var _0x361e25=_['map'](db['OpenchannelTransferReport']['rawAttributes'],function(_0x10a7d8){return{'name':_0x10a7d8[_0x77e1('0x29')],'type':_0x10a7d8[_0x77e1('0x2a')][_0x77e1('0x2b')]};});_0x45736[_0x77e1('0x2c')]=_[_0x77e1('0x2d')](_0x361e25,'name');_0x45736['query']=_[_0x77e1('0x2e')](_0x3e9247[_0x77e1('0x2f')]);_0x45736[_0x77e1('0x30')]=_[_0x77e1('0x31')](_0x45736[_0x77e1('0x2c')],_0x45736['query']);_0x4b4289['attributes']=_[_0x77e1('0x31')](_0x45736['model'],qs[_0x77e1('0x32')](_0x3e9247[_0x77e1('0x2f')][_0x77e1('0x32')]));_0x4b4289[_0x77e1('0x33')]=_0x4b4289[_0x77e1('0x33')]['length']?_0x4b4289[_0x77e1('0x33')]:_0x45736[_0x77e1('0x2c')];if(!_0x3e9247['query'][_0x77e1('0x34')](_0x77e1('0x35'))){_0x4b4289[_0x77e1('0x1e')]=qs[_0x77e1('0x1e')](_0x3e9247[_0x77e1('0x2f')]['limit']);_0x4b4289[_0x77e1('0x1c')]=qs[_0x77e1('0x1c')](_0x3e9247[_0x77e1('0x2f')]['offset']);}_0x4b4289[_0x77e1('0x36')]=qs['sort'](_0x3e9247[_0x77e1('0x2f')][_0x77e1('0x37')]);_0x4b4289['where']=qs[_0x77e1('0x30')](_[_0x77e1('0x38')](_0x3e9247[_0x77e1('0x2f')],_0x45736['filters']),_0x361e25);if(_0x3e9247[_0x77e1('0x2f')]['filter']){_0x4b4289[_0x77e1('0x39')]=_[_0x77e1('0x3a')](_0x4b4289[_0x77e1('0x39')],{'$or':_[_0x77e1('0x2d')](_0x361e25,function(_0x391bd3){if(_0x391bd3[_0x77e1('0x2a')]!==_0x77e1('0x3b')){var _0x56761a={};_0x56761a[_0x391bd3[_0x77e1('0x28')]]={'$like':'%'+_0x3e9247[_0x77e1('0x2f')][_0x77e1('0x3c')]+'%'};return _0x56761a;}})});}_0x4b4289=_[_0x77e1('0x3a')]({},_0x4b4289,_0x3e9247[_0x77e1('0x3d')]);var _0x41d646={'where':_0x4b4289['where']};return db[_0x77e1('0x3e')][_0x77e1('0x1f')](_0x41d646)[_0x77e1('0x25')](function(_0x576b9b){_0x977d82[_0x77e1('0x1f')]=_0x576b9b;if(_0x3e9247[_0x77e1('0x2f')]['includeAll']){_0x4b4289[_0x77e1('0x3f')]=[{'all':!![]}];}return db[_0x77e1('0x3e')][_0x77e1('0x40')](_0x4b4289);})['then'](function(_0x499993){_0x977d82[_0x77e1('0x41')]=_0x499993;return _0x977d82;})[_0x77e1('0x25')](respondWithFilteredResult(_0x36e569,_0x4b4289))['catch'](handleError(_0x36e569,null));};exports['show']=function(_0x1f081b,_0x4252c4){var _0x188823={'raw':!![],'where':{'id':_0x1f081b[_0x77e1('0x42')]['id']}},_0x3b240a={};_0x3b240a[_0x77e1('0x2c')]=_[_0x77e1('0x2e')](db['OpenchannelTransferReport'][_0x77e1('0x43')]);_0x3b240a[_0x77e1('0x2f')]=_[_0x77e1('0x2e')](_0x1f081b[_0x77e1('0x2f')]);_0x3b240a[_0x77e1('0x30')]=_[_0x77e1('0x31')](_0x3b240a[_0x77e1('0x2c')],_0x3b240a[_0x77e1('0x2f')]);_0x188823[_0x77e1('0x33')]=_[_0x77e1('0x31')](_0x3b240a[_0x77e1('0x2c')],qs[_0x77e1('0x32')](_0x1f081b['query']['fields']));_0x188823['attributes']=_0x188823['attributes'][_0x77e1('0x44')]?_0x188823[_0x77e1('0x33')]:_0x3b240a[_0x77e1('0x2c')];if(_0x1f081b[_0x77e1('0x2f')]['includeAll']){_0x188823['include']=[{'all':!![]}];}_0x188823=_[_0x77e1('0x3a')]({},_0x188823,_0x1f081b['options']);return db[_0x77e1('0x3e')][_0x77e1('0x45')](_0x188823)[_0x77e1('0x25')](handleEntityNotFound(_0x4252c4,null))[_0x77e1('0x25')](respondWithResult(_0x4252c4,null))['catch'](handleError(_0x4252c4,null));};exports[_0x77e1('0x46')]=function(_0x4f32f5,_0x49c365){return db[_0x77e1('0x3e')][_0x77e1('0x46')](_0x4f32f5[_0x77e1('0x47')],{})[_0x77e1('0x25')](respondWithResult(_0x49c365,0xc9))['catch'](handleError(_0x49c365,null));};exports[_0x77e1('0x24')]=function(_0x1e129c,_0x352ef5){if(_0x1e129c[_0x77e1('0x47')]['id']){delete _0x1e129c[_0x77e1('0x47')]['id'];}return db['OpenchannelTransferReport'][_0x77e1('0x45')]({'where':{'id':_0x1e129c[_0x77e1('0x42')]['id']}})[_0x77e1('0x25')](handleEntityNotFound(_0x352ef5,null))[_0x77e1('0x25')](saveUpdates(_0x1e129c['body'],null))[_0x77e1('0x25')](respondWithResult(_0x352ef5,null))['catch'](handleError(_0x352ef5,null));};exports[_0x77e1('0x48')]=function(_0x119298,_0x34445d){return db[_0x77e1('0x3e')][_0x77e1('0x45')]({'where':{'id':_0x119298[_0x77e1('0x42')]['id']}})[_0x77e1('0x25')](handleEntityNotFound(_0x34445d,null))[_0x77e1('0x25')](removeEntity(_0x34445d,null))[_0x77e1('0x49')](handleError(_0x34445d,null));};exports['describe']=function(_0x2e0a08,_0x2e404d){return db['OpenchannelTransferReport'][_0x77e1('0x4a')]()[_0x77e1('0x25')](respondWithResult(_0x2e404d,null))[_0x77e1('0x49')](handleError(_0x2e404d,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index 7bd178f..4c48c3f 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 _0xff29=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid'];(function(_0x4d9403,_0x33c5f0){var _0x5eef11=function(_0x50bb5c){while(--_0x50bb5c){_0x4d9403['push'](_0x4d9403['shift']());}};_0x5eef11(++_0x33c5f0);}(_0xff29,0x1c7));var _0x9ff2=function(_0x4aa288,_0x14b86b){_0x4aa288=_0x4aa288-0x0;var _0x5ab027=_0xff29[_0x4aa288];return _0x5ab027;};'use strict';var _=require('lodash');var util=require(_0x9ff2('0x0'));var logger=require(_0x9ff2('0x1'))(_0x9ff2('0x2'));var moment=require('moment');var BPromise=require(_0x9ff2('0x3'));var rp=require(_0x9ff2('0x4'));var fs=require('fs');var path=require(_0x9ff2('0x5'));var rimraf=require(_0x9ff2('0x6'));var config=require(_0x9ff2('0x7'));var attributes=require('./openchannelTransferReport.attributes');module[_0x9ff2('0x8')]=function(_0x40ee3d,_0x2a4a41){return _0x40ee3d[_0x9ff2('0x9')](_0x9ff2('0xa'),attributes,{'tableName':_0x9ff2('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x9ff2('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x55a7=['moment','path','rimraf','../../config/environment','./openchannelTransferReport.attributes','report_openchannel_transfer','uniqueid','lodash','../../config/logger','api'];(function(_0x2eebff,_0x1f4d5b){var _0x21fdb4=function(_0x567356){while(--_0x567356){_0x2eebff['push'](_0x2eebff['shift']());}};_0x21fdb4(++_0x1f4d5b);}(_0x55a7,0x151));var _0x755a=function(_0xf6f5eb,_0x231e80){_0xf6f5eb=_0xf6f5eb-0x0;var _0x5e45a9=_0x55a7[_0xf6f5eb];return _0x5e45a9;};'use strict';var _=require(_0x755a('0x0'));var util=require('util');var logger=require(_0x755a('0x1'))(_0x755a('0x2'));var moment=require(_0x755a('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x755a('0x4'));var rimraf=require(_0x755a('0x5'));var config=require(_0x755a('0x6'));var attributes=require(_0x755a('0x7'));module['exports']=function(_0x2aba76,_0x304e48){return _0x2aba76['define']('OpenchannelTransferReport',attributes,{'tableName':_0x755a('0x8'),'paranoid':![],'indexes':[{'name':_0x755a('0x9'),'fields':[_0x755a('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index 06652d5..5b98778 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 _0x0958=['moment','randomstring','ioredis','../../config/logger','rpc','client','http','request','then','OpenchannelTransferReport,\x20%s,\x20%s','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','lodash','util'];(function(_0x1a073d,_0x4db2d9){var _0x45daab=function(_0xf4cae){while(--_0xf4cae){_0x1a073d['push'](_0x1a073d['shift']());}};_0x45daab(++_0x4db2d9);}(_0x0958,0x7c));var _0x8095=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x0958[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x8095('0x0'));var util=require(_0x8095('0x1'));var moment=require(_0x8095('0x2'));var BPromise=require('bluebird');var rs=require(_0x8095('0x3'));var fs=require('fs');var Redis=require(_0x8095('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8095('0x5'))(_0x8095('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8095('0x7')][_0x8095('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x439ecc,_0x1dac39,_0x1fac84){return new BPromise(function(_0x4d5ee3,_0x5a19ef){return client[_0x8095('0x9')](_0x439ecc,_0x1fac84)[_0x8095('0xa')](function(_0x4967a5){logger['info'](_0x8095('0xb'),_0x1dac39,'request\x20sent');logger[_0x8095('0xc')](_0x8095('0xd'),_0x1dac39,_0x8095('0xe'),JSON[_0x8095('0xf')](_0x4967a5));if(_0x4967a5[_0x8095('0x10')]){if(_0x4967a5['error'][_0x8095('0x11')]===0x1f4){logger['error'](_0x8095('0xb'),_0x1dac39,_0x4967a5[_0x8095('0x10')][_0x8095('0x12')]);return _0x5a19ef(_0x4967a5[_0x8095('0x10')][_0x8095('0x12')]);}logger[_0x8095('0x10')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x1dac39,_0x4967a5[_0x8095('0x10')][_0x8095('0x12')]);return _0x4d5ee3(_0x4967a5[_0x8095('0x10')]['message']);}else{logger[_0x8095('0x13')](_0x8095('0xb'),_0x1dac39,_0x8095('0xe'));_0x4d5ee3(_0x4967a5[_0x8095('0x14')][_0x8095('0x12')]);}})['catch'](function(_0x1b1ca3){logger[_0x8095('0x10')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x1dac39,_0x1b1ca3);_0x5a19ef(_0x1b1ca3);});});} \ No newline at end of file +var _0x2f74=['http','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x12b8d6,_0x1d9ca5){var _0x4b0dfa=function(_0x3597b2){while(--_0x3597b2){_0x12b8d6['push'](_0x12b8d6['shift']());}};_0x4b0dfa(++_0x1d9ca5);}(_0x2f74,0x7b));var _0x42f7=function(_0x218c0c,_0x2b21e3){_0x218c0c=_0x218c0c-0x0;var _0xf0347d=_0x2f74[_0x218c0c];return _0xf0347d;};'use strict';var _=require(_0x42f7('0x0'));var util=require('util');var moment=require(_0x42f7('0x1'));var BPromise=require(_0x42f7('0x2'));var rs=require(_0x42f7('0x3'));var fs=require('fs');var Redis=require(_0x42f7('0x4'));var db=require(_0x42f7('0x5'))['db'];var utils=require(_0x42f7('0x6'));var logger=require(_0x42f7('0x7'))(_0x42f7('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x42f7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1cb6e0,_0x20ff46,_0x36b55e){return new BPromise(function(_0x2c64b2,_0x28fc83){return client[_0x42f7('0xa')](_0x1cb6e0,_0x36b55e)[_0x42f7('0xb')](function(_0x5772a8){logger[_0x42f7('0xc')](_0x42f7('0xd'),_0x20ff46,_0x42f7('0xe'));logger[_0x42f7('0xf')](_0x42f7('0x10'),_0x20ff46,_0x42f7('0xe'),JSON['stringify'](_0x5772a8));if(_0x5772a8[_0x42f7('0x11')]){if(_0x5772a8[_0x42f7('0x11')][_0x42f7('0x12')]===0x1f4){logger[_0x42f7('0x11')](_0x42f7('0xd'),_0x20ff46,_0x5772a8[_0x42f7('0x11')][_0x42f7('0x13')]);return _0x28fc83(_0x5772a8[_0x42f7('0x11')]['message']);}logger['error'](_0x42f7('0xd'),_0x20ff46,_0x5772a8[_0x42f7('0x11')][_0x42f7('0x13')]);return _0x2c64b2(_0x5772a8[_0x42f7('0x11')][_0x42f7('0x13')]);}else{logger['info'](_0x42f7('0xd'),_0x20ff46,'request\x20sent');_0x2c64b2(_0x5772a8[_0x42f7('0x14')][_0x42f7('0x13')]);}})[_0x42f7('0x15')](function(_0x19eff3){logger[_0x42f7('0x11')](_0x42f7('0xd'),_0x20ff46,_0x19eff3);_0x28fc83(_0x19eff3);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index 1da8058..2e549b8 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 _0x8339=['isAuthenticated','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','get'];(function(_0x3f401e,_0x3cc202){var _0x31e23f=function(_0x5caef2){while(--_0x5caef2){_0x3f401e['push'](_0x3f401e['shift']());}};_0x31e23f(++_0x3cc202);}(_0x8339,0x180));var _0x9833=function(_0x27bcb2,_0x412da4){_0x27bcb2=_0x27bcb2-0x0;var _0xef0f33=_0x8339[_0x27bcb2];return _0xef0f33;};'use strict';var multer=require(_0x9833('0x0'));var util=require(_0x9833('0x1'));var path=require(_0x9833('0x2'));var timeout=require(_0x9833('0x3'));var express=require(_0x9833('0x4'));var router=express[_0x9833('0x5')]();var fs_extra=require(_0x9833('0x6'));var auth=require(_0x9833('0x7'));var interaction=require(_0x9833('0x8'));var config=require(_0x9833('0x9'));var controller=require(_0x9833('0xa'));router[_0x9833('0xb')]('/',auth[_0x9833('0xc')](),controller['index']);router[_0x9833('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x9833('0xd')]);router[_0x9833('0xe')]('/',auth[_0x9833('0xc')](),controller[_0x9833('0xf')]);router[_0x9833('0x10')](_0x9833('0x11'),auth[_0x9833('0xc')](),controller[_0x9833('0x12')]);router[_0x9833('0x13')]('/:id',auth[_0x9833('0xc')](),controller[_0x9833('0x14')]);module[_0x9833('0x15')]=router; \ No newline at end of file +var _0xe619=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util'];(function(_0x43116a,_0x29b5c8){var _0x1450dc=function(_0xac4ec7){while(--_0xac4ec7){_0x43116a['push'](_0x43116a['shift']());}};_0x1450dc(++_0x29b5c8);}(_0xe619,0xfa));var _0x9e61=function(_0x4c8232,_0x4e0dea){_0x4c8232=_0x4c8232-0x0;var _0x3cc8e5=_0xe619[_0x4c8232];return _0x3cc8e5;};'use strict';var multer=require(_0x9e61('0x0'));var util=require(_0x9e61('0x1'));var path=require(_0x9e61('0x2'));var timeout=require(_0x9e61('0x3'));var express=require(_0x9e61('0x4'));var router=express[_0x9e61('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x9e61('0x6'));var interaction=require(_0x9e61('0x7'));var config=require(_0x9e61('0x8'));var controller=require(_0x9e61('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x9e61('0xa')]);router['get'](_0x9e61('0xb'),auth[_0x9e61('0xc')](),controller[_0x9e61('0xd')]);router[_0x9e61('0xe')]('/',auth['isAuthenticated'](),controller[_0x9e61('0xf')]);router[_0x9e61('0x10')](_0x9e61('0xb'),auth['isAuthenticated'](),controller[_0x9e61('0x11')]);router[_0x9e61('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x9e61('0x13')]);module[_0x9e61('0x14')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index 0e1b431..33bf215 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 _0xad8d=['STRING','name','sequelize','exports'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xad8d,0x1a2));var _0xdad8=function(_0x290e14,_0x53d210){_0x290e14=_0x290e14-0x0;var _0x2533ec=_0xad8d[_0x290e14];return _0x2533ec;};'use strict';var Sequelize=require(_0xdad8('0x0'));module[_0xdad8('0x1')]={'name':{'type':Sequelize[_0xdad8('0x2')],'unique':_0xdad8('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0xdad8('0x2')]}}; \ No newline at end of file +var _0xf007=['exports','STRING','sequelize'];(function(_0x4892e9,_0x2cdb5c){var _0x180a79=function(_0x1310f2){while(--_0x1310f2){_0x4892e9['push'](_0x4892e9['shift']());}};_0x180a79(++_0x2cdb5c);}(_0xf007,0xce));var _0x7f00=function(_0x1db863,_0x8f181d){_0x1db863=_0x1db863-0x0;var _0x18b578=_0xf007[_0x1db863];return _0x18b578;};'use strict';var Sequelize=require(_0x7f00('0x0'));module[_0x7f00('0x1')]={'name':{'type':Sequelize[_0x7f00('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index 38684b0..0df44bf 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 _0x535a=['json','offset','undefined','count','set','Content-Range','apply','reject','save','then','get','Pauses','UserProfileResource','destroy','error','stack','name','send','index','Pause','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','limit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','findAll','rows','catch','show','params','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','update','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x535a,0xe0));var _0xa535=function(_0x1747e0,_0x42d2fc){_0x1747e0=_0x1747e0-0x0;var _0x4b163c=_0x535a[_0x1747e0];return _0x4b163c;};'use strict';var emlformat=require(_0xa535('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa535('0x1'));var jsonpatch=require(_0xa535('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa535('0x3'));var Mustache=require(_0xa535('0x4'));var util=require(_0xa535('0x5'));var path=require(_0xa535('0x6'));var sox=require(_0xa535('0x7'));var csv=require(_0xa535('0x8'));var ejs=require(_0xa535('0x9'));var fs=require('fs');var fs_extra=require(_0xa535('0xa'));var _=require(_0xa535('0xb'));var squel=require(_0xa535('0xc'));var crypto=require(_0xa535('0xd'));var jsforce=require(_0xa535('0xe'));var deskjs=require(_0xa535('0xf'));var toCsv=require(_0xa535('0x8'));var querystring=require('querystring');var Papa=require(_0xa535('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa535('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa535('0x12'));var utils=require('../../config/utils');var config=require(_0xa535('0x13'));var licenseUtil=require(_0xa535('0x14'));var db=require(_0xa535('0x15'))['db'];function respondWithStatusCode(_0x4c5baf,_0x3e5c36){_0x3e5c36=_0x3e5c36||0xcc;return function(_0x16d34c){if(_0x16d34c){return _0x4c5baf[_0xa535('0x16')](_0x3e5c36);}return _0x4c5baf['status'](_0x3e5c36)[_0xa535('0x17')]();};}function respondWithResult(_0x127201,_0x1d15ca){_0x1d15ca=_0x1d15ca||0xc8;return function(_0x1e3c7f){if(_0x1e3c7f){return _0x127201[_0xa535('0x18')](_0x1d15ca)[_0xa535('0x19')](_0x1e3c7f);}};}function respondWithFilteredResult(_0x2444e8,_0x5596de){return function(_0x38d9ae){if(_0x38d9ae){var _0x447fbf=typeof _0x5596de[_0xa535('0x1a')]===_0xa535('0x1b')&&typeof _0x5596de['limit']===_0xa535('0x1b');var _0xdf3561=_0x38d9ae[_0xa535('0x1c')];var _0x1d18e0=_0x447fbf?0x0:_0x5596de[_0xa535('0x1a')];var _0x301331=_0x447fbf?_0x38d9ae[_0xa535('0x1c')]:_0x5596de[_0xa535('0x1a')]+_0x5596de['limit'];var _0x5a4f3b;if(_0x301331>=_0xdf3561){_0x301331=_0xdf3561;_0x5a4f3b=0xc8;}else{_0x5a4f3b=0xce;}_0x2444e8[_0xa535('0x18')](_0x5a4f3b);return _0x2444e8[_0xa535('0x1d')](_0xa535('0x1e'),_0x1d18e0+'-'+_0x301331+'/'+_0xdf3561)[_0xa535('0x19')](_0x38d9ae);}return null;};}function patchUpdates(_0x538942){return function(_0x58604b){try{jsonpatch[_0xa535('0x1f')](_0x58604b,_0x538942,!![]);}catch(_0x42af20){return BPromise[_0xa535('0x20')](_0x42af20);}return _0x58604b[_0xa535('0x21')]();};}function saveUpdates(_0x244f33,_0x479888){return function(_0x410a90){if(_0x410a90){return _0x410a90['update'](_0x244f33)[_0xa535('0x22')](function(_0x189018){return _0x189018;});}return null;};}function removeEntity(_0x563924,_0x362a53){return function(_0x3556de){if(_0x3556de){return _0x3556de['destroy']()[_0xa535('0x22')](function(){var _0x260263=_0x3556de[_0xa535('0x23')]({'plain':!![]});var _0x3ed505=_0xa535('0x24');return db[_0xa535('0x25')][_0xa535('0x26')]({'where':{'type':_0x3ed505,'resourceId':_0x260263['id']}})['then'](function(){return _0x3556de;});})[_0xa535('0x22')](function(){_0x563924[_0xa535('0x18')](0xcc)[_0xa535('0x17')]();});}};}function handleEntityNotFound(_0x5c419d,_0x4ad530){return function(_0x293c89){if(!_0x293c89){_0x5c419d[_0xa535('0x16')](0x194);}return _0x293c89;};}function handleError(_0x44ca94,_0x2b14cc){_0x2b14cc=_0x2b14cc||0x1f4;return function(_0x17a3cd){logger[_0xa535('0x27')](_0x17a3cd[_0xa535('0x28')]);if(_0x17a3cd[_0xa535('0x29')]){delete _0x17a3cd[_0xa535('0x29')];}_0x44ca94['status'](_0x2b14cc)[_0xa535('0x2a')](_0x17a3cd);};}exports[_0xa535('0x2b')]=function(_0x14bbcc,_0xcb4cc9){var _0x5ca46b={},_0x5ba306={},_0x4f44f2={'count':0x0,'rows':[]};var _0x57f920=_['map'](db[_0xa535('0x2c')][_0xa535('0x2d')],function(_0xe32de4){return{'name':_0xe32de4[_0xa535('0x2e')],'type':_0xe32de4['type'][_0xa535('0x2f')]};});_0x5ba306[_0xa535('0x30')]=_[_0xa535('0x31')](_0x57f920,_0xa535('0x29'));_0x5ba306[_0xa535('0x32')]=_[_0xa535('0x33')](_0x14bbcc[_0xa535('0x32')]);_0x5ba306[_0xa535('0x34')]=_[_0xa535('0x35')](_0x5ba306[_0xa535('0x30')],_0x5ba306[_0xa535('0x32')]);_0x5ca46b['attributes']=_[_0xa535('0x35')](_0x5ba306[_0xa535('0x30')],qs[_0xa535('0x36')](_0x14bbcc['query'][_0xa535('0x36')]));_0x5ca46b['attributes']=_0x5ca46b[_0xa535('0x37')][_0xa535('0x38')]?_0x5ca46b[_0xa535('0x37')]:_0x5ba306['model'];if(!_0x14bbcc[_0xa535('0x32')][_0xa535('0x39')]('nolimit')){_0x5ca46b[_0xa535('0x3a')]=qs[_0xa535('0x3a')](_0x14bbcc['query']['limit']);_0x5ca46b[_0xa535('0x1a')]=qs[_0xa535('0x1a')](_0x14bbcc['query'][_0xa535('0x1a')]);}_0x5ca46b[_0xa535('0x3b')]=qs[_0xa535('0x3c')](_0x14bbcc[_0xa535('0x32')][_0xa535('0x3c')]);_0x5ca46b[_0xa535('0x3d')]=qs[_0xa535('0x34')](_[_0xa535('0x3e')](_0x14bbcc['query'],_0x5ba306[_0xa535('0x34')]),_0x57f920);if(_0x14bbcc['query'][_0xa535('0x3f')]){_0x5ca46b['where']=_['merge'](_0x5ca46b[_0xa535('0x3d')],{'$or':_[_0xa535('0x31')](_0x57f920,function(_0x106894){if(_0x106894['type']!==_0xa535('0x40')){var _0x50ae40={};_0x50ae40[_0x106894[_0xa535('0x29')]]={'$like':'%'+_0x14bbcc[_0xa535('0x32')][_0xa535('0x3f')]+'%'};return _0x50ae40;}})});}_0x5ca46b=_[_0xa535('0x41')]({},_0x5ca46b,_0x14bbcc['options']);var _0x20f841={'where':_0x5ca46b[_0xa535('0x3d')]};return db[_0xa535('0x2c')]['count'](_0x20f841)['then'](function(_0x57045b){_0x4f44f2[_0xa535('0x1c')]=_0x57045b;if(_0x14bbcc[_0xa535('0x32')][_0xa535('0x42')]){_0x5ca46b['include']=[{'all':!![]}];}return db[_0xa535('0x2c')][_0xa535('0x43')](_0x5ca46b);})['then'](function(_0x294c57){_0x4f44f2[_0xa535('0x44')]=_0x294c57;return _0x4f44f2;})[_0xa535('0x22')](respondWithFilteredResult(_0xcb4cc9,_0x5ca46b))[_0xa535('0x45')](handleError(_0xcb4cc9,null));};exports[_0xa535('0x46')]=function(_0x3b7700,_0x5a9594){var _0x446f6f={'raw':!![],'where':{'id':_0x3b7700[_0xa535('0x47')]['id']}},_0x1cf5a9={};_0x1cf5a9['model']=_[_0xa535('0x33')](db[_0xa535('0x2c')][_0xa535('0x2d')]);_0x1cf5a9[_0xa535('0x32')]=_[_0xa535('0x33')](_0x3b7700[_0xa535('0x32')]);_0x1cf5a9[_0xa535('0x34')]=_[_0xa535('0x35')](_0x1cf5a9[_0xa535('0x30')],_0x1cf5a9[_0xa535('0x32')]);_0x446f6f[_0xa535('0x37')]=_['intersection'](_0x1cf5a9['model'],qs['fields'](_0x3b7700[_0xa535('0x32')][_0xa535('0x36')]));_0x446f6f[_0xa535('0x37')]=_0x446f6f[_0xa535('0x37')][_0xa535('0x38')]?_0x446f6f[_0xa535('0x37')]:_0x1cf5a9['model'];if(_0x3b7700['query'][_0xa535('0x42')]){_0x446f6f['include']=[{'all':!![]}];}_0x446f6f=_['merge']({},_0x446f6f,_0x3b7700[_0xa535('0x48')]);return db[_0xa535('0x2c')]['find'](_0x446f6f)[_0xa535('0x22')](handleEntityNotFound(_0x5a9594,null))['then'](respondWithResult(_0x5a9594,null))[_0xa535('0x45')](handleError(_0x5a9594,null));};exports[_0xa535('0x49')]=function(_0x34530b,_0x2a6ac6){return db[_0xa535('0x2c')][_0xa535('0x49')](_0x34530b[_0xa535('0x4a')],{})[_0xa535('0x22')](function(_0x139c86){var _0x4ce2e3=_0x34530b[_0xa535('0x4b')]['get']({'plain':!![]});if(!_0x4ce2e3)throw new Error(_0xa535('0x4c'));if(_0x4ce2e3[_0xa535('0x4d')]===_0xa535('0x4b')){var _0x185a39=_0x139c86['get']({'plain':!![]});var _0x196cf8=_0xa535('0x24');return db[_0xa535('0x4e')][_0xa535('0x4f')]({'where':{'name':_0x196cf8,'userProfileId':_0x4ce2e3[_0xa535('0x50')]},'raw':!![]})[_0xa535('0x22')](function(_0x360226){if(_0x360226&&_0x360226[_0xa535('0x51')]===0x0){return db['UserProfileResource']['create']({'name':_0x185a39[_0xa535('0x29')],'resourceId':_0x185a39['id'],'type':_0x360226[_0xa535('0x29')],'sectionId':_0x360226['id']},{})['then'](function(){return _0x139c86;});}else{return _0x139c86;}})[_0xa535('0x45')](function(_0x28b54f){logger[_0xa535('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x28b54f);throw _0x28b54f;});}return _0x139c86;})[_0xa535('0x22')](respondWithResult(_0x2a6ac6,0xc9))['catch'](handleError(_0x2a6ac6,null));};exports[_0xa535('0x52')]=function(_0x39cc0c,_0x35345c){if(_0x39cc0c['body']['id']){delete _0x39cc0c[_0xa535('0x4a')]['id'];}return db[_0xa535('0x2c')][_0xa535('0x4f')]({'where':{'id':_0x39cc0c['params']['id']}})[_0xa535('0x22')](handleEntityNotFound(_0x35345c,null))['then'](saveUpdates(_0x39cc0c['body'],null))['then'](respondWithResult(_0x35345c,null))[_0xa535('0x45')](handleError(_0x35345c,null));};exports['destroy']=function(_0x1ccf46,_0x4b48d4){return db[_0xa535('0x2c')][_0xa535('0x4f')]({'where':{'id':_0x1ccf46[_0xa535('0x47')]['id']}})[_0xa535('0x22')](handleEntityNotFound(_0x4b48d4,null))[_0xa535('0x22')](removeEntity(_0x4b48d4,null))[_0xa535('0x45')](handleError(_0x4b48d4,null));}; \ No newline at end of file +var _0x1b26=['create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','Pauses','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','Pause','rows','show','params','length','catch'];(function(_0x5a87fb,_0x2c2d6d){var _0x5c1ac5=function(_0x23183c){while(--_0x23183c){_0x5a87fb['push'](_0x5a87fb['shift']());}};_0x5c1ac5(++_0x2c2d6d);}(_0x1b26,0x1c1));var _0x61b2=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x1b26[_0x502c7d];return _0x30b7ed;};'use strict';var emlformat=require(_0x61b2('0x0'));var rimraf=require(_0x61b2('0x1'));var zipdir=require(_0x61b2('0x2'));var jsonpatch=require(_0x61b2('0x3'));var rp=require(_0x61b2('0x4'));var moment=require(_0x61b2('0x5'));var BPromise=require(_0x61b2('0x6'));var Mustache=require(_0x61b2('0x7'));var util=require(_0x61b2('0x8'));var path=require(_0x61b2('0x9'));var sox=require(_0x61b2('0xa'));var csv=require(_0x61b2('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x61b2('0xc'));var squel=require(_0x61b2('0xd'));var crypto=require(_0x61b2('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x61b2('0xf'));var toCsv=require(_0x61b2('0xb'));var querystring=require(_0x61b2('0x10'));var Papa=require(_0x61b2('0x11'));var Redis=require(_0x61b2('0x12'));var authService=require(_0x61b2('0x13'));var qs=require(_0x61b2('0x14'));var as=require(_0x61b2('0x15'));var hardwareService=require(_0x61b2('0x16'));var logger=require(_0x61b2('0x17'))('api');var utils=require(_0x61b2('0x18'));var config=require(_0x61b2('0x19'));var licenseUtil=require(_0x61b2('0x1a'));var db=require(_0x61b2('0x1b'))['db'];function respondWithStatusCode(_0x5942e2,_0x5708a9){_0x5708a9=_0x5708a9||0xcc;return function(_0x388511){if(_0x388511){return _0x5942e2[_0x61b2('0x1c')](_0x5708a9);}return _0x5942e2[_0x61b2('0x1d')](_0x5708a9)[_0x61b2('0x1e')]();};}function respondWithResult(_0x3d6bd8,_0x86394c){_0x86394c=_0x86394c||0xc8;return function(_0x375187){if(_0x375187){return _0x3d6bd8[_0x61b2('0x1d')](_0x86394c)[_0x61b2('0x1f')](_0x375187);}};}function respondWithFilteredResult(_0x5d9846,_0x4ce944){return function(_0x51b232){if(_0x51b232){var _0x3ca434=typeof _0x4ce944[_0x61b2('0x20')]===_0x61b2('0x21')&&typeof _0x4ce944[_0x61b2('0x22')]===_0x61b2('0x21');var _0x42e0a5=_0x51b232[_0x61b2('0x23')];var _0x30205c=_0x3ca434?0x0:_0x4ce944['offset'];var _0x48557f=_0x3ca434?_0x51b232[_0x61b2('0x23')]:_0x4ce944[_0x61b2('0x20')]+_0x4ce944[_0x61b2('0x22')];var _0x3cd2a5;if(_0x48557f>=_0x42e0a5){_0x48557f=_0x42e0a5;_0x3cd2a5=0xc8;}else{_0x3cd2a5=0xce;}_0x5d9846[_0x61b2('0x1d')](_0x3cd2a5);return _0x5d9846['set'](_0x61b2('0x24'),_0x30205c+'-'+_0x48557f+'/'+_0x42e0a5)[_0x61b2('0x1f')](_0x51b232);}return null;};}function patchUpdates(_0x4f4abb){return function(_0x50977b){try{jsonpatch['apply'](_0x50977b,_0x4f4abb,!![]);}catch(_0x3af777){return BPromise[_0x61b2('0x25')](_0x3af777);}return _0x50977b[_0x61b2('0x26')]();};}function saveUpdates(_0x2e94dc,_0x2ace49){return function(_0x129c3e){if(_0x129c3e){return _0x129c3e[_0x61b2('0x27')](_0x2e94dc)[_0x61b2('0x28')](function(_0x350f18){return _0x350f18;});}return null;};}function removeEntity(_0x4f5d0a,_0x59f994){return function(_0x3e423a){if(_0x3e423a){return _0x3e423a[_0x61b2('0x29')]()[_0x61b2('0x28')](function(){var _0x130b03=_0x3e423a['get']({'plain':!![]});var _0x29626c=_0x61b2('0x2a');return db[_0x61b2('0x2b')]['destroy']({'where':{'type':_0x29626c,'resourceId':_0x130b03['id']}})[_0x61b2('0x28')](function(){return _0x3e423a;});})['then'](function(){_0x4f5d0a[_0x61b2('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3f6dfb,_0x50a429){return function(_0x3cfe71){if(!_0x3cfe71){_0x3f6dfb[_0x61b2('0x1c')](0x194);}return _0x3cfe71;};}function handleError(_0x4d8484,_0x399cce){_0x399cce=_0x399cce||0x1f4;return function(_0x2ebbc3){logger[_0x61b2('0x2c')](_0x2ebbc3[_0x61b2('0x2d')]);if(_0x2ebbc3[_0x61b2('0x2e')]){delete _0x2ebbc3[_0x61b2('0x2e')];}_0x4d8484[_0x61b2('0x1d')](_0x399cce)[_0x61b2('0x2f')](_0x2ebbc3);};}exports[_0x61b2('0x30')]=function(_0x27f2fd,_0x372b78){var _0x498af7={},_0x19d166={},_0x32725e={'count':0x0,'rows':[]};var _0xb2e227=_[_0x61b2('0x31')](db['Pause'][_0x61b2('0x32')],function(_0x5c0675){return{'name':_0x5c0675[_0x61b2('0x33')],'type':_0x5c0675['type'][_0x61b2('0x34')]};});_0x19d166[_0x61b2('0x35')]=_['map'](_0xb2e227,_0x61b2('0x2e'));_0x19d166[_0x61b2('0x36')]=_[_0x61b2('0x37')](_0x27f2fd['query']);_0x19d166[_0x61b2('0x38')]=_[_0x61b2('0x39')](_0x19d166['model'],_0x19d166[_0x61b2('0x36')]);_0x498af7['attributes']=_[_0x61b2('0x39')](_0x19d166[_0x61b2('0x35')],qs[_0x61b2('0x3a')](_0x27f2fd['query'][_0x61b2('0x3a')]));_0x498af7[_0x61b2('0x3b')]=_0x498af7['attributes']['length']?_0x498af7[_0x61b2('0x3b')]:_0x19d166[_0x61b2('0x35')];if(!_0x27f2fd[_0x61b2('0x36')][_0x61b2('0x3c')](_0x61b2('0x3d'))){_0x498af7['limit']=qs[_0x61b2('0x22')](_0x27f2fd['query']['limit']);_0x498af7[_0x61b2('0x20')]=qs['offset'](_0x27f2fd['query'][_0x61b2('0x20')]);}_0x498af7[_0x61b2('0x3e')]=qs[_0x61b2('0x3f')](_0x27f2fd[_0x61b2('0x36')]['sort']);_0x498af7[_0x61b2('0x40')]=qs[_0x61b2('0x38')](_[_0x61b2('0x41')](_0x27f2fd[_0x61b2('0x36')],_0x19d166[_0x61b2('0x38')]),_0xb2e227);if(_0x27f2fd[_0x61b2('0x36')][_0x61b2('0x42')]){_0x498af7[_0x61b2('0x40')]=_[_0x61b2('0x43')](_0x498af7['where'],{'$or':_[_0x61b2('0x31')](_0xb2e227,function(_0x4f9793){if(_0x4f9793[_0x61b2('0x44')]!==_0x61b2('0x45')){var _0x33c160={};_0x33c160[_0x4f9793[_0x61b2('0x2e')]]={'$like':'%'+_0x27f2fd[_0x61b2('0x36')][_0x61b2('0x42')]+'%'};return _0x33c160;}})});}_0x498af7=_[_0x61b2('0x43')]({},_0x498af7,_0x27f2fd[_0x61b2('0x46')]);var _0x1870b9={'where':_0x498af7[_0x61b2('0x40')]};return db['Pause'][_0x61b2('0x23')](_0x1870b9)[_0x61b2('0x28')](function(_0x487107){_0x32725e[_0x61b2('0x23')]=_0x487107;if(_0x27f2fd[_0x61b2('0x36')][_0x61b2('0x47')]){_0x498af7[_0x61b2('0x48')]=[{'all':!![]}];}return db[_0x61b2('0x49')]['findAll'](_0x498af7);})[_0x61b2('0x28')](function(_0x4ae493){_0x32725e[_0x61b2('0x4a')]=_0x4ae493;return _0x32725e;})[_0x61b2('0x28')](respondWithFilteredResult(_0x372b78,_0x498af7))['catch'](handleError(_0x372b78,null));};exports[_0x61b2('0x4b')]=function(_0x84728,_0x303b7c){var _0x17437f={'raw':!![],'where':{'id':_0x84728[_0x61b2('0x4c')]['id']}},_0x34ffd9={};_0x34ffd9['model']=_[_0x61b2('0x37')](db[_0x61b2('0x49')][_0x61b2('0x32')]);_0x34ffd9[_0x61b2('0x36')]=_['keys'](_0x84728['query']);_0x34ffd9[_0x61b2('0x38')]=_[_0x61b2('0x39')](_0x34ffd9[_0x61b2('0x35')],_0x34ffd9[_0x61b2('0x36')]);_0x17437f[_0x61b2('0x3b')]=_[_0x61b2('0x39')](_0x34ffd9[_0x61b2('0x35')],qs[_0x61b2('0x3a')](_0x84728[_0x61b2('0x36')]['fields']));_0x17437f[_0x61b2('0x3b')]=_0x17437f[_0x61b2('0x3b')][_0x61b2('0x4d')]?_0x17437f[_0x61b2('0x3b')]:_0x34ffd9[_0x61b2('0x35')];if(_0x84728[_0x61b2('0x36')][_0x61b2('0x47')]){_0x17437f[_0x61b2('0x48')]=[{'all':!![]}];}_0x17437f=_[_0x61b2('0x43')]({},_0x17437f,_0x84728[_0x61b2('0x46')]);return db['Pause']['find'](_0x17437f)[_0x61b2('0x28')](handleEntityNotFound(_0x303b7c,null))[_0x61b2('0x28')](respondWithResult(_0x303b7c,null))[_0x61b2('0x4e')](handleError(_0x303b7c,null));};exports[_0x61b2('0x4f')]=function(_0x34e562,_0xc29036){return db['Pause'][_0x61b2('0x4f')](_0x34e562[_0x61b2('0x50')],{})[_0x61b2('0x28')](function(_0x1d3d39){var _0x33d0d3=_0x34e562[_0x61b2('0x51')]['get']({'plain':!![]});if(!_0x33d0d3)throw new Error(_0x61b2('0x52'));if(_0x33d0d3[_0x61b2('0x53')]==='user'){var _0x45e0a4=_0x1d3d39['get']({'plain':!![]});var _0x13e829=_0x61b2('0x2a');return db[_0x61b2('0x54')][_0x61b2('0x55')]({'where':{'name':_0x13e829,'userProfileId':_0x33d0d3['userProfileId']},'raw':!![]})['then'](function(_0x17b346){if(_0x17b346&&_0x17b346[_0x61b2('0x56')]===0x0){return db[_0x61b2('0x2b')][_0x61b2('0x4f')]({'name':_0x45e0a4[_0x61b2('0x2e')],'resourceId':_0x45e0a4['id'],'type':_0x17b346[_0x61b2('0x2e')],'sectionId':_0x17b346['id']},{})['then'](function(){return _0x1d3d39;});}else{return _0x1d3d39;}})[_0x61b2('0x4e')](function(_0x3fc6b8){logger[_0x61b2('0x2c')](_0x61b2('0x57'),_0x3fc6b8);throw _0x3fc6b8;});}return _0x1d3d39;})[_0x61b2('0x28')](respondWithResult(_0xc29036,0xc9))['catch'](handleError(_0xc29036,null));};exports[_0x61b2('0x27')]=function(_0x3da468,_0x37c2b0){if(_0x3da468[_0x61b2('0x50')]['id']){delete _0x3da468['body']['id'];}return db['Pause']['find']({'where':{'id':_0x3da468[_0x61b2('0x4c')]['id']}})['then'](handleEntityNotFound(_0x37c2b0,null))[_0x61b2('0x28')](saveUpdates(_0x3da468[_0x61b2('0x50')],null))['then'](respondWithResult(_0x37c2b0,null))['catch'](handleError(_0x37c2b0,null));};exports['destroy']=function(_0x3c87ea,_0x5109c7){return db['Pause'][_0x61b2('0x55')]({'where':{'id':_0x3c87ea['params']['id']}})[_0x61b2('0x28')](handleEntityNotFound(_0x5109c7,null))[_0x61b2('0x28')](removeEntity(_0x5109c7,null))[_0x61b2('0x4e')](handleError(_0x5109c7,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index 0b52372..52501d0 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 _0x55ca=['./pause.attributes','exports','define','tools_pauses','lodash','util','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x4a7843,_0x24f6d1){var _0x2c57fe=function(_0x37fbc9){while(--_0x37fbc9){_0x4a7843['push'](_0x4a7843['shift']());}};_0x2c57fe(++_0x24f6d1);}(_0x55ca,0x126));var _0xa55c=function(_0x60878f,_0x1166d3){_0x60878f=_0x60878f-0x0;var _0x1fbefb=_0x55ca[_0x60878f];return _0x1fbefb;};'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')]('Pause',attributes,{'tableName':_0xa55c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7217=['../../config/environment','./pause.attributes','exports','define','Pause','tools_pauses','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x513f27,_0x1cbc87){var _0xa316b7=function(_0x3b592d){while(--_0x3b592d){_0x513f27['push'](_0x513f27['shift']());}};_0xa316b7(++_0x1cbc87);}(_0x7217,0x19e));var _0x7721=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0x7217[_0x12d033];return _0x3b4e80;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var logger=require(_0x7721('0x1'))(_0x7721('0x2'));var moment=require(_0x7721('0x3'));var BPromise=require(_0x7721('0x4'));var rp=require(_0x7721('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7721('0x6'));var attributes=require(_0x7721('0x7'));module[_0x7721('0x8')]=function(_0x3fe47c,_0xb239e0){return _0x3fe47c[_0x7721('0x9')](_0x7721('0xa'),attributes,{'tableName':_0x7721('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/pause/pause.rpc.js b/server/api/pause/pause.rpc.js index e681fda..059e1f1 100644 --- a/server/api/pause/pause.rpc.js +++ b/server/api/pause/pause.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','debug'];(function(_0x3fced0,_0x163a81){var _0x5742e8=function(_0x3ed8e7){while(--_0x3ed8e7){_0x3fced0['push'](_0x3fced0['shift']());}};_0x5742e8(++_0x163a81);}(_0xb10b,0x12a));var _0xbb10=function(_0xffd1b5,_0x1ede18){_0xffd1b5=_0xffd1b5-0x0;var _0x3176d6=_0xb10b[_0xffd1b5];return _0x3176d6;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'raw':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8[_0xbb10('0x18')]?_0x378da8['options'][_0xbb10('0x1b')]||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['include']?_[_0xbb10('0x1c')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1d')],function(_0x317da4){return{'model':db[_0x317da4[_0xbb10('0x1e')]],'as':_0x317da4['as'],'attributes':_0x317da4[_0xbb10('0x1b')],'include':_0x317da4[_0xbb10('0x1d')]?_[_0xbb10('0x1c')](_0x317da4[_0xbb10('0x1d')],function(_0x395404){return{'model':db[_0x395404[_0xbb10('0x1e')]],'as':_0x395404['as'],'attributes':_0x395404[_0xbb10('0x1b')],'include':_0x395404['include']?_['map'](_0x395404['include'],function(_0xc93a04){return{'model':db[_0xc93a04[_0xbb10('0x1e')]],'as':_0xc93a04['as'],'attributes':_0xc93a04[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fdde9){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2fdde9));_0x575cca(_0x2fdde9);})[_0xbb10('0x20')](function(_0x4aabb9){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x4aabb9[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x4aabb9[_0xbb10('0x13')]));});});}; \ No newline at end of file +var _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','debug'];(function(_0xc2eb36,_0x556307){var _0x150821=function(_0x1935be){while(--_0x1935be){_0xc2eb36['push'](_0xc2eb36['shift']());}};_0x150821(++_0x556307);}(_0xb10b,0x12a));var _0xbb10=function(_0x45bf86,_0x75586e){_0x45bf86=_0x45bf86-0x0;var _0x1f02b7=_0xb10b[_0x45bf86];return _0x1f02b7;};'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 e4a9506..22cf9fb 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 _0x5c12=['util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller','isAuthenticated','index','get','/:id','show','download','diskStorage','join','root','originalname','basename','extname','now','upload','post','put','update','delete','exports'];(function(_0x5185b3,_0x4c3c27){var _0xd9c050=function(_0x2a5d54){while(--_0x2a5d54){_0x5185b3['push'](_0x5185b3['shift']());}};_0xd9c050(++_0x4c3c27);}(_0x5c12,0x188));var _0x25c1=function(_0x2e8418,_0x58c529){_0x2e8418=_0x2e8418-0x0;var _0x548fe6=_0x5c12[_0x2e8418];return _0x548fe6;};'use strict';var multer=require('multer');var util=require(_0x25c1('0x0'));var path=require(_0x25c1('0x1'));var timeout=require('connect-timeout');var express=require(_0x25c1('0x2'));var router=express[_0x25c1('0x3')]();var fs_extra=require(_0x25c1('0x4'));var auth=require(_0x25c1('0x5'));var interaction=require(_0x25c1('0x6'));var config=require(_0x25c1('0x7'));var controller=require(_0x25c1('0x8'));router['get']('/',auth[_0x25c1('0x9')](),controller[_0x25c1('0xa')]);router[_0x25c1('0xb')]('/webhook',controller['webhookGet']);router[_0x25c1('0xb')](_0x25c1('0xc'),auth[_0x25c1('0x9')](),controller[_0x25c1('0xd')]);router[_0x25c1('0xb')]('/:id/download',auth[_0x25c1('0x9')](),controller[_0x25c1('0xe')]);var upload=multer({'storage':multer[_0x25c1('0xf')]({'destination':function(_0x81f0f4,_0x2872b2,_0x5e44e2){_0x5e44e2(null,path[_0x25c1('0x10')](config[_0x25c1('0x11')],'server/files/plugins'));},'filename':function(_0x256ecd,_0x209af5,_0x323d3c){_0x209af5[_0x25c1('0x12')]=_0x209af5['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x323d3c(null,util['format']('%s-%s%s',path[_0x25c1('0x13')](_0x209af5[_0x25c1('0x12')],path[_0x25c1('0x14')](_0x209af5[_0x25c1('0x12')])),Date[_0x25c1('0x15')](),path['extname'](_0x209af5[_0x25c1('0x12')])));}})});router['post']('/',upload['single']('file'),controller[_0x25c1('0x16')]);router[_0x25c1('0x17')]('/webhook',controller['webhookPost']);router[_0x25c1('0x18')]('/:id',auth[_0x25c1('0x9')](),controller[_0x25c1('0x19')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x25c1('0x1a')]);module[_0x25c1('0x1b')]=router; \ No newline at end of file +var _0xb903=['replace','basename','originalname','now','extname','post','single','/webhook','put','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller','get','index','webhookGet','/:id','isAuthenticated','join','root'];(function(_0x5618d3,_0x3155d7){var _0x486284=function(_0x269230){while(--_0x269230){_0x5618d3['push'](_0x5618d3['shift']());}};_0x486284(++_0x3155d7);}(_0xb903,0x185));var _0x3b90=function(_0x48e788,_0x58e586){_0x48e788=_0x48e788-0x0;var _0x38c19a=_0xb903[_0x48e788];return _0x38c19a;};'use strict';var multer=require(_0x3b90('0x0'));var util=require(_0x3b90('0x1'));var path=require(_0x3b90('0x2'));var timeout=require(_0x3b90('0x3'));var express=require('express');var router=express[_0x3b90('0x4')]();var fs_extra=require(_0x3b90('0x5'));var auth=require(_0x3b90('0x6'));var interaction=require(_0x3b90('0x7'));var config=require(_0x3b90('0x8'));var controller=require(_0x3b90('0x9'));router[_0x3b90('0xa')]('/',auth['isAuthenticated'](),controller[_0x3b90('0xb')]);router['get']('/webhook',controller[_0x3b90('0xc')]);router[_0x3b90('0xa')](_0x3b90('0xd'),auth[_0x3b90('0xe')](),controller['show']);router['get']('/:id/download',auth['isAuthenticated'](),controller['download']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x336913,_0x5af39c,_0x574955){_0x574955(null,path[_0x3b90('0xf')](config[_0x3b90('0x10')],'server/files/plugins'));},'filename':function(_0x45b75f,_0x174c0d,_0x43c08c){_0x174c0d['originalname']=_0x174c0d['originalname'][_0x3b90('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x43c08c(null,util['format']('%s-%s%s',path[_0x3b90('0x12')](_0x174c0d[_0x3b90('0x13')],path['extname'](_0x174c0d['originalname'])),Date[_0x3b90('0x14')](),path[_0x3b90('0x15')](_0x174c0d[_0x3b90('0x13')])));}})});router[_0x3b90('0x16')]('/',upload[_0x3b90('0x17')]('file'),controller['upload']);router[_0x3b90('0x16')](_0x3b90('0x18'),controller['webhookPost']);router[_0x3b90('0x19')](_0x3b90('0xd'),auth[_0x3b90('0xe')](),controller[_0x3b90('0x1a')]);router['delete'](_0x3b90('0xd'),auth['isAuthenticated'](),controller[_0x3b90('0x1b')]);module[_0x3b90('0x1c')]=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index 49ce08d..4838cca 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 _0x359b=['script','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','never','exports','ENUM'];(function(_0x4f97dd,_0x29fb8e){var _0x26395e=function(_0x567c69){while(--_0x567c69){_0x4f97dd['push'](_0x4f97dd['shift']());}};_0x26395e(++_0x29fb8e);}(_0x359b,0x77));var _0xb359=function(_0x464425,_0x2f7ac2){_0x464425=_0x464425-0x0;var _0x4006c8=_0x359b[_0x464425];return _0x4006c8;};'use strict';var Sequelize=require('sequelize');module[_0xb359('0x0')]={'name':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xb359('0x1')]('html',_0xb359('0x2'))},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize[_0xb359('0x3')]},'path':{'type':Sequelize[_0xb359('0x4')],'comment':_0xb359('0x5')},'active':{'type':Sequelize[_0xb359('0x6')],'defaultValue':0x0,'comment':_0xb359('0x7')},'sidebar':{'type':Sequelize['ENUM'](_0xb359('0x8'),'agentOnly',_0xb359('0x9'),_0xb359('0xa')),'defaultValue':_0xb359('0x9'),'comment':'Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.'},'icon':{'type':Sequelize[_0xb359('0x4')]},'adminUrl':{'type':Sequelize['STRING']},'agentUrl':{'type':Sequelize[_0xb359('0x4')]},'scriptName':{'type':Sequelize[_0xb359('0x4')]},'scriptPath':{'type':Sequelize[_0xb359('0x4')]}}; \ No newline at end of file +var _0xb6d0=['BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly','always','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','ENUM','html','TEXT','STRING','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'];(function(_0x58b3ca,_0x4183bc){var _0x1dfab9=function(_0xa24c69){while(--_0xa24c69){_0x58b3ca['push'](_0x58b3ca['shift']());}};_0x1dfab9(++_0x4183bc);}(_0xb6d0,0x19e));var _0x0b6d=function(_0x3c307c,_0x1b06c4){_0x3c307c=_0x3c307c-0x0;var _0x32cf08=_0xb6d0[_0x3c307c];return _0x32cf08;};'use strict';var Sequelize=require(_0x0b6d('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x0b6d('0x1')](_0x0b6d('0x2'),'script')},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize[_0x0b6d('0x3')]},'path':{'type':Sequelize[_0x0b6d('0x4')],'comment':_0x0b6d('0x5')},'active':{'type':Sequelize[_0x0b6d('0x6')],'defaultValue':0x0,'comment':_0x0b6d('0x7')},'sidebar':{'type':Sequelize['ENUM'](_0x0b6d('0x8'),_0x0b6d('0x9'),'always','never'),'defaultValue':_0x0b6d('0xa'),'comment':_0x0b6d('0xb')},'icon':{'type':Sequelize[_0x0b6d('0x4')]},'adminUrl':{'type':Sequelize[_0x0b6d('0x4')]},'agentUrl':{'type':Sequelize[_0x0b6d('0x4')]},'scriptName':{'type':Sequelize[_0x0b6d('0x4')]},'scriptPath':{'type':Sequelize[_0x0b6d('0x4')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index 295b433..f65cacb 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 _0x2672=['encoding','method','%s%s','headers','content-length','content-type','endsWith','statusCode','\x27PORT\x27\x20parameter\x20not\x20specified','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','rimraf','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','register','sendStatus','status','json','undefined','offset','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','get','Plugins','UserProfileResource','end','error','stack','name','send','index','map','Plugin','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','find','download','join','root','server/files/plugins','%s.zip','basename','createWriteStream','zip','warning','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','Sequelize','pipe','glob','**/*','dirname','node_modules/**/*','attachments/**/*','finalize','close','existsSync','format','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','upload','file','filename','extname','Plugin\x20upload\x20filepath:\x20%s','chmodSync','0777','Invalid\x20plugin\x20structure','lstatSync','isDirectory','readdirSync','some','Plugin\x20manifest\x20missing','readFileSync','manifest.json','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','html','Invalid\x20manifest:\x20views\x20missing','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','sidebar','always','icon','icon-apps','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','Zip\x20archive\x20removed','delete','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','hostname','http://localhost:'];(function(_0xf32f11,_0x4fcbcc){var _0x1601f4=function(_0x5d9a86){while(--_0x5d9a86){_0xf32f11['push'](_0xf32f11['shift']());}};_0x1601f4(++_0x4fcbcc);}(_0x2672,0xbc));var _0x2267=function(_0x474d4,_0xaea238){_0x474d4=_0x474d4-0x0;var _0x43814d=_0x2672[_0x474d4];return _0x43814d;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x2267('0x0'));var jsonpatch=require(_0x2267('0x1'));var rp=require('request-promise');var moment=require(_0x2267('0x2'));var BPromise=require(_0x2267('0x3'));var Mustache=require('mustache');var util=require(_0x2267('0x4'));var path=require(_0x2267('0x5'));var sox=require(_0x2267('0x6'));var csv=require(_0x2267('0x7'));var ejs=require(_0x2267('0x8'));var fs=require('fs');var fs_extra=require(_0x2267('0x9'));var _=require(_0x2267('0xa'));var squel=require(_0x2267('0xb'));var crypto=require(_0x2267('0xc'));var jsforce=require(_0x2267('0xd'));var deskjs=require(_0x2267('0xe'));var toCsv=require(_0x2267('0x7'));var querystring=require(_0x2267('0xf'));var Papa=require(_0x2267('0x10'));var extract=require('extract-zip');var rimraf=require(_0x2267('0x11'));var archiver=require('archiver');var Redis=require(_0x2267('0x12'));var authService=require(_0x2267('0x13'));var qs=require(_0x2267('0x14'));var as=require(_0x2267('0x15'));var hardwareService=require(_0x2267('0x16'));var logger=require(_0x2267('0x17'))(_0x2267('0x18'));var utils=require(_0x2267('0x19'));var config=require(_0x2267('0x1a'));var licenseUtil=require(_0x2267('0x1b'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x2267('0x1c')],{'host':_0x2267('0x1d'),'port':0x18eb});var socket=require(_0x2267('0x1e'))(new Redis(config['redis']));require('./plugin.socket')[_0x2267('0x1f')](socket);function respondWithStatusCode(_0x3e6e42,_0x382b26){_0x382b26=_0x382b26||0xcc;return function(_0x4eee5c){if(_0x4eee5c){return _0x3e6e42[_0x2267('0x20')](_0x382b26);}return _0x3e6e42[_0x2267('0x21')](_0x382b26)['end']();};}function respondWithResult(_0xa17dd3,_0x14b771){_0x14b771=_0x14b771||0xc8;return function(_0xe00867){if(_0xe00867){return _0xa17dd3[_0x2267('0x21')](_0x14b771)[_0x2267('0x22')](_0xe00867);}};}function respondWithFilteredResult(_0x5550e5,_0x39c683){return function(_0x2ed8a0){if(_0x2ed8a0){var _0xf10c68=typeof _0x39c683['offset']===_0x2267('0x23')&&typeof _0x39c683['limit']===_0x2267('0x23');var _0x163da0=_0x2ed8a0['count'];var _0x59c40b=_0xf10c68?0x0:_0x39c683[_0x2267('0x24')];var _0x329682=_0xf10c68?_0x2ed8a0[_0x2267('0x25')]:_0x39c683[_0x2267('0x24')]+_0x39c683[_0x2267('0x26')];var _0xe67001;if(_0x329682>=_0x163da0){_0x329682=_0x163da0;_0xe67001=0xc8;}else{_0xe67001=0xce;}_0x5550e5['status'](_0xe67001);return _0x5550e5[_0x2267('0x27')](_0x2267('0x28'),_0x59c40b+'-'+_0x329682+'/'+_0x163da0)['json'](_0x2ed8a0);}return null;};}function patchUpdates(_0x5aa536){return function(_0x497364){try{jsonpatch[_0x2267('0x29')](_0x497364,_0x5aa536,!![]);}catch(_0x1074dd){return BPromise[_0x2267('0x2a')](_0x1074dd);}return _0x497364[_0x2267('0x2b')]();};}function saveUpdates(_0x436a18,_0x2e6e0e){return function(_0x571fd8){if(_0x571fd8){return _0x571fd8[_0x2267('0x2c')](_0x436a18)['then'](function(_0x598ef1){return _0x598ef1;});}return null;};}function removeEntity(_0x4406f4,_0x56e936){return function(_0x2881fc){if(_0x2881fc){return _0x2881fc[_0x2267('0x2d')]()[_0x2267('0x2e')](function(){var _0x223832=_0x2881fc[_0x2267('0x2f')]({'plain':!![]});var _0x1ca10f=_0x2267('0x30');return db[_0x2267('0x31')][_0x2267('0x2d')]({'where':{'type':_0x1ca10f,'resourceId':_0x223832['id']}})['then'](function(){return _0x2881fc;});})[_0x2267('0x2e')](function(){_0x4406f4[_0x2267('0x21')](0xcc)[_0x2267('0x32')]();});}};}function handleEntityNotFound(_0x3a4d46,_0x39db51){return function(_0x1fee08){if(!_0x1fee08){_0x3a4d46[_0x2267('0x20')](0x194);}return _0x1fee08;};}function handleError(_0x2c394d,_0x1f066){_0x1f066=_0x1f066||0x1f4;return function(_0x1889d2){logger[_0x2267('0x33')](_0x1889d2[_0x2267('0x34')]);if(_0x1889d2[_0x2267('0x35')]){delete _0x1889d2[_0x2267('0x35')];}_0x2c394d[_0x2267('0x21')](_0x1f066)[_0x2267('0x36')](_0x1889d2);};}exports[_0x2267('0x37')]=function(_0x153cb6,_0x511794){var _0x270131={},_0x164e97={},_0x455790={'count':0x0,'rows':[]};var _0x3d9085=_[_0x2267('0x38')](db[_0x2267('0x39')][_0x2267('0x3a')],function(_0x209b4e){return{'name':_0x209b4e[_0x2267('0x3b')],'type':_0x209b4e[_0x2267('0x3c')][_0x2267('0x3d')]};});_0x164e97[_0x2267('0x3e')]=_[_0x2267('0x38')](_0x3d9085,_0x2267('0x35'));_0x164e97[_0x2267('0x3f')]=_[_0x2267('0x40')](_0x153cb6['query']);_0x164e97[_0x2267('0x41')]=_[_0x2267('0x42')](_0x164e97[_0x2267('0x3e')],_0x164e97[_0x2267('0x3f')]);_0x270131['attributes']=_[_0x2267('0x42')](_0x164e97[_0x2267('0x3e')],qs['fields'](_0x153cb6[_0x2267('0x3f')][_0x2267('0x43')]));_0x270131['attributes']=_0x270131[_0x2267('0x44')][_0x2267('0x45')]?_0x270131[_0x2267('0x44')]:_0x164e97[_0x2267('0x3e')];if(!_0x153cb6[_0x2267('0x3f')][_0x2267('0x46')](_0x2267('0x47'))){_0x270131[_0x2267('0x26')]=qs['limit'](_0x153cb6[_0x2267('0x3f')][_0x2267('0x26')]);_0x270131['offset']=qs[_0x2267('0x24')](_0x153cb6[_0x2267('0x3f')]['offset']);}_0x270131[_0x2267('0x48')]=qs[_0x2267('0x49')](_0x153cb6[_0x2267('0x3f')]['sort']);_0x270131[_0x2267('0x4a')]=qs[_0x2267('0x41')](_[_0x2267('0x4b')](_0x153cb6[_0x2267('0x3f')],_0x164e97['filters']),_0x3d9085);if(_0x153cb6['query'][_0x2267('0x4c')]){_0x270131['where']=_['merge'](_0x270131[_0x2267('0x4a')],{'$or':_[_0x2267('0x38')](_0x3d9085,function(_0x44e4de){if(_0x44e4de['type']!==_0x2267('0x4d')){var _0x3261bd={};_0x3261bd[_0x44e4de['name']]={'$like':'%'+_0x153cb6[_0x2267('0x3f')][_0x2267('0x4c')]+'%'};return _0x3261bd;}})});}_0x270131=_[_0x2267('0x4e')]({},_0x270131,_0x153cb6[_0x2267('0x4f')]);var _0x19843a={'where':_0x270131[_0x2267('0x4a')]};return db[_0x2267('0x39')]['count'](_0x19843a)[_0x2267('0x2e')](function(_0x544c5a){_0x455790[_0x2267('0x25')]=_0x544c5a;if(_0x153cb6[_0x2267('0x3f')][_0x2267('0x50')]){_0x270131[_0x2267('0x51')]=[{'all':!![]}];}return db[_0x2267('0x39')][_0x2267('0x52')](_0x270131);})[_0x2267('0x2e')](function(_0x2ce172){_0x455790[_0x2267('0x53')]=_0x2ce172;return _0x455790;})[_0x2267('0x2e')](respondWithFilteredResult(_0x511794,_0x270131))[_0x2267('0x54')](handleError(_0x511794,null));};exports[_0x2267('0x55')]=function(_0x49c19c,_0xe43e01){var _0x499786={'raw':!![],'where':{'id':_0x49c19c[_0x2267('0x56')]['id']}},_0x5d7ded={};_0x5d7ded[_0x2267('0x3e')]=_[_0x2267('0x40')](db[_0x2267('0x39')][_0x2267('0x3a')]);_0x5d7ded[_0x2267('0x3f')]=_[_0x2267('0x40')](_0x49c19c['query']);_0x5d7ded[_0x2267('0x41')]=_[_0x2267('0x42')](_0x5d7ded[_0x2267('0x3e')],_0x5d7ded['query']);_0x499786[_0x2267('0x44')]=_[_0x2267('0x42')](_0x5d7ded[_0x2267('0x3e')],qs[_0x2267('0x43')](_0x49c19c['query'][_0x2267('0x43')]));_0x499786['attributes']=_0x499786[_0x2267('0x44')][_0x2267('0x45')]?_0x499786[_0x2267('0x44')]:_0x5d7ded[_0x2267('0x3e')];if(_0x49c19c[_0x2267('0x3f')]['includeAll']){_0x499786[_0x2267('0x51')]=[{'all':!![]}];}_0x499786=_['merge']({},_0x499786,_0x49c19c[_0x2267('0x4f')]);return db['Plugin'][_0x2267('0x57')](_0x499786)[_0x2267('0x2e')](handleEntityNotFound(_0xe43e01,null))[_0x2267('0x2e')](respondWithResult(_0xe43e01,null))[_0x2267('0x54')](handleError(_0xe43e01,null));};exports[_0x2267('0x58')]=function(_0x38bee4,_0x4680e3,_0xe421c7){return db[_0x2267('0x39')]['find']({'where':{'id':_0x38bee4['params']['id']},'attributes':[_0x2267('0x35'),_0x2267('0x5')],'raw':!![]})[_0x2267('0x2e')](handleEntityNotFound(_0x4680e3,null))['then'](function(_0x694edb){if(_0x694edb){var _0x51cb1e=path[_0x2267('0x59')](config[_0x2267('0x5a')],_0x2267('0x5b'),util['format'](_0x2267('0x5c'),path[_0x2267('0x5d')](_0x694edb['path'])));var _0x2ac103=fs[_0x2267('0x5e')](_0x51cb1e);var _0x2f9932=archiver(_0x2267('0x5f'),{'zlib':{'level':0x9}});_0x2f9932['on'](_0x2267('0x60'),function(_0x1fd4b3){if(_0x1fd4b3['code']==='ENOENT'){logger[_0x2267('0x33')](_0x1fd4b3);}else{throw new db['Sequelize'][(_0x2267('0x61'))](_0x2267('0x62'));}});_0x2f9932['on'](_0x2267('0x33'),function(_0x5f25d1){throw new db[(_0x2267('0x63'))]['Error']('Error\x20while\x20generating\x20the\x20zip\x20archive');});_0x2f9932[_0x2267('0x64')](_0x2ac103);_0x2f9932[_0x2267('0x65')](_0x2267('0x66'),{'cwd':path[_0x2267('0x59')](config[_0x2267('0x5a')],_0x2267('0x5b'),path[_0x2267('0x67')](_0x694edb['path'])),'ignore':[path[_0x2267('0x59')](path[_0x2267('0x5d')](_0x694edb[_0x2267('0x5')]),_0x2267('0x68')),path[_0x2267('0x59')](path[_0x2267('0x5d')](_0x694edb[_0x2267('0x5')]),_0x2267('0x69'))],'nodir':!![]})[_0x2267('0x6a')]();_0x2ac103['on'](_0x2267('0x6b'),function(){if(!fs[_0x2267('0x6c')](_0x51cb1e)){throw new db[(_0x2267('0x63'))][(_0x2267('0x61'))]('Plugin\x20not\x20found');}return _0x4680e3['download'](_0x51cb1e,util[_0x2267('0x6d')]('%s.zip',path[_0x2267('0x5d')](_0x694edb[_0x2267('0x5')])),function(_0x5ca843){if(_0x5ca843){throw new db[(_0x2267('0x63'))][(_0x2267('0x61'))](_0x2267('0x6e'));}fs[_0x2267('0x6f')](_0x51cb1e);logger[_0x2267('0x70')]('Download\x20completed');logger[_0x2267('0x70')]('Temporary\x20file\x20removed');});});}return null;})['catch'](handleError(_0x4680e3,null));};exports[_0x2267('0x71')]=function(_0x2dc296,_0x505824,_0x97a863){var _0x4dd8f3=path[_0x2267('0x5d')](_0x2dc296[_0x2267('0x72')][_0x2267('0x73')],path[_0x2267('0x74')](_0x2dc296[_0x2267('0x72')]['filename']));var _0x3403b6=path[_0x2267('0x59')](config['root'],'server/files/plugins',_0x2dc296['file']['filename']);var _0x50841b=path[_0x2267('0x59')](config[_0x2267('0x5a')],_0x2267('0x5b'),_0x4dd8f3);logger[_0x2267('0x70')](_0x2267('0x75'),_0x3403b6);logger[_0x2267('0x70')]('Plugin\x20upload\x20destination:\x20%s',_0x50841b);try{fs[_0x2267('0x76')](_0x3403b6,parseInt(_0x2267('0x77'),0x8));extract(_0x3403b6,{'dir':_0x50841b},function(_0x18ac98){if(_0x18ac98){logger[_0x2267('0x33')](_0x18ac98);handleError(_0x18ac98,!![]);};var _0x448638=fs['readdirSync'](_0x50841b);if(_0x448638[_0x2267('0x45')]>0x1){removeReferences(_0x3403b6,_0x50841b);logger[_0x2267('0x33')](_0x2267('0x78'));return _0x97a863(new Error('Invalid\x20plugin\x20structure'));}var _0x2e8223=fs[_0x2267('0x79')](path[_0x2267('0x59')](_0x50841b,_0x448638[0x0]));if(_0x2e8223['isFile']()){removeReferences(_0x3403b6,_0x50841b);logger['error']('Invalid\x20plugin\x20structure');return _0x97a863(new Error(_0x2267('0x78')));}if(_0x2e8223[_0x2267('0x7a')]()){var _0x5a1ceb=fs[_0x2267('0x7b')](path[_0x2267('0x59')](_0x50841b,_0x448638[0x0]));if(_0x5a1ceb[_0x2267('0x45')]===0x0){removeReferences(_0x3403b6,_0x50841b);logger[_0x2267('0x33')](_0x2267('0x78'));return _0x97a863(new Error(_0x2267('0x78')));}var _0x5626ae=_0x5a1ceb[_0x2267('0x7c')](function(_0xef39f6){return _0xef39f6==='manifest.json';});if(!_0x5626ae){return _0x97a863(new Error(_0x2267('0x7d')));}var _0x522e4d=fs[_0x2267('0x7e')](path[_0x2267('0x59')](_0x50841b,_0x448638[0x0],_0x2267('0x7f')));var _0x5b6426=JSON[_0x2267('0x80')](_0x522e4d);if('undefined'==typeof _0x5b6426['name']){return _0x97a863(new Error(_0x2267('0x81')));}if(_0x2267('0x23')==typeof _0x5b6426[_0x2267('0x3c')]){return _0x97a863(new Error(_0x2267('0x82')));}if(_0x2267('0x23')==typeof _0x5b6426[_0x2267('0x83')]){return _0x97a863(new Error(_0x2267('0x84')));}if(_0x2267('0x23')==typeof _0x5b6426[_0x2267('0x85')]){return _0x97a863(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0x5b6426['type']===_0x2267('0x86')){if(_0x2267('0x23')==typeof _0x5b6426[_0x2267('0x85')]['views']){return _0x97a863(new Error(_0x2267('0x87')));}if(_0x2267('0x23')==typeof _0x5b6426[_0x2267('0x85')][_0x2267('0x88')][_0x2267('0x89')]&&'undefined'==typeof _0x5b6426['parameters'][_0x2267('0x88')][_0x2267('0x8a')]){return _0x97a863(new Error(_0x2267('0x8b')));}}else if(_0x5b6426[_0x2267('0x3c')]===_0x2267('0x8c')){if(_0x2267('0x23')==typeof _0x5b6426['parameters'][_0x2267('0x8d')]){return _0x97a863(new Error(_0x2267('0x8e')));}if(_0x2267('0x23')==typeof _0x5b6426[_0x2267('0x85')][_0x2267('0x8f')]){return _0x97a863(new Error(_0x2267('0x90')));}}else{return _0x97a863(new Error(_0x2267('0x91')));}var _0xd93a36=_0x5b6426['name'];var _0x4f4d16=_0x5b6426['description'];var _0x4cb1f1=_0x5b6426[_0x2267('0x3c')];var _0x3414bf=_0x5b6426['sidebar']?_0x5b6426[_0x2267('0x92')]:_0x2267('0x93');var _0x535d12=_0x5b6426['icon']?_0x5b6426[_0x2267('0x94')]:_0x2267('0x95');var _0x193add='';var _0x3d0ae9='';var _0x2beb7b='';var _0x3d2dbd='';var _0x30d226=_0x5b6426['version'];if(_0x4cb1f1===_0x2267('0x86')){if(_0x2267('0x23')!=typeof _0x5b6426[_0x2267('0x85')]['views']['admin']){var _0x97e662=_0x5b6426['parameters'][_0x2267('0x88')][_0x2267('0x89')];if(!/^(f|ht)tps?:\/\//i[_0x2267('0x96')](_0x97e662)){_0x193add=path[_0x2267('0x59')](_0x2267('0x97'),_0x4dd8f3,_0x448638[0x0],_0x97e662);}else{_0x193add=_0x97e662;}}else{logger['info'](_0x2267('0x98'));}if(_0x2267('0x23')!=typeof _0x5b6426[_0x2267('0x85')][_0x2267('0x88')]['agent']){var _0x4736ff=_0x5b6426['parameters'][_0x2267('0x88')][_0x2267('0x8a')];if(!/^(f|ht)tps?:\/\//i[_0x2267('0x96')](_0x4736ff)){_0x3d0ae9=path[_0x2267('0x59')](_0x2267('0x97'),_0x4dd8f3,_0x448638[0x0],_0x4736ff);}else{_0x3d0ae9=_0x4736ff;}}else{logger[_0x2267('0x70')](_0x2267('0x99'));}}else if(_0x4cb1f1===_0x2267('0x8c')){_0x2beb7b=_0x5b6426[_0x2267('0x85')][_0x2267('0x8d')];_0x3d2dbd=_0x5b6426[_0x2267('0x85')][_0x2267('0x8f')];if('undefined'!=typeof _0x5b6426['parameters'][_0x2267('0x88')]){if(_0x2267('0x23')!=typeof _0x5b6426[_0x2267('0x85')][_0x2267('0x88')][_0x2267('0x89')]){var _0x97e662=_0x5b6426[_0x2267('0x85')]['views'][_0x2267('0x89')];if(!/^(f|ht)tps?:\/\//i['test'](_0x97e662)){_0x193add=path[_0x2267('0x59')](_0x2267('0x97'),_0x4dd8f3,_0x448638[0x0],_0x97e662);}else{_0x193add=_0x97e662;}}if(_0x2267('0x23')!=typeof _0x5b6426[_0x2267('0x85')][_0x2267('0x88')][_0x2267('0x8a')]){var _0x4736ff=_0x5b6426[_0x2267('0x85')][_0x2267('0x88')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0x2267('0x96')](_0x4736ff)){_0x3d0ae9=path['join'](_0x2267('0x97'),_0x4dd8f3,_0x448638[0x0],_0x4736ff);}else{_0x3d0ae9=_0x4736ff;}}}}var _0x500812={'name':_0xd93a36,'description':_0x4f4d16,'path':path[_0x2267('0x59')](_0x4dd8f3,_0x448638[0x0]),'type':_0x4cb1f1,'sidebar':_0x3414bf,'icon':_0x535d12,'adminUrl':_0x193add,'agentUrl':_0x3d0ae9,'scriptName':_0x2beb7b,'scriptPath':_0x3d2dbd,'version':_0x30d226};removeReferences(_0x3403b6,null);return db['Plugin'][_0x2267('0x9a')](_0x500812)[_0x2267('0x2e')](function(_0x2cba87){var _0x3c55bd={'role':_0x2dc296[_0x2267('0x9b')][_0x2267('0x9c')],'userProfileId':_0x2dc296[_0x2267('0x9b')][_0x2267('0x9d')]};if(!_0x3c55bd)throw new Error(_0x2267('0x9e'));if(_0x3c55bd[_0x2267('0x9c')]===_0x2267('0x9f')){var _0x543584=_0x2cba87['get']({'plain':!![]});return db[_0x2267('0xa0')][_0x2267('0x57')]({'where':{'name':'Plugins','userProfileId':_0x3c55bd[_0x2267('0x9d')]},'raw':!![]})[_0x2267('0x2e')](function(_0x559706){if(_0x559706&&_0x559706[_0x2267('0xa1')]===0x0){return db[_0x2267('0x31')][_0x2267('0x9a')]({'name':_0x543584[_0x2267('0x35')],'resourceId':_0x543584['id'],'type':_0x559706[_0x2267('0x35')],'sectionId':_0x559706['id']},{})[_0x2267('0x2e')](function(){return _0x2cba87;});}else{return _0x2cba87;}})[_0x2267('0x54')](function(_0x5e2c39){logger[_0x2267('0x33')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5e2c39);throw _0x5e2c39;});}return _0x2cba87;})[_0x2267('0x2e')](respondWithResult(_0x505824,null))['catch'](handleError(_0x505824,null));}});}catch(_0x34ce07){_0x505824[_0x2267('0x21')](0x1f4)[_0x2267('0x36')](_0x34ce07);}};function removeReferences(_0x51befa,_0x191886){try{if(_0x51befa){fs['unlinkSync'](_0x51befa);logger[_0x2267('0x70')](_0x2267('0xa2'));}if(_0x191886){rimraf(_0x191886,function(){});logger[_0x2267('0x70')]('Extracted\x20folder\x20removed');}}catch(_0x276d0a){logger[_0x2267('0x33')](_0x276d0a);}}exports['update']=function(_0x7952e7,_0x254e1e,_0xae3e8b){return db[_0x2267('0x39')][_0x2267('0x57')]({'where':{'id':_0x7952e7[_0x2267('0x56')]['id']}})[_0x2267('0x2e')](handleEntityNotFound(_0x254e1e,null))[_0x2267('0x2e')](saveUpdates(_0x7952e7[_0x2267('0x9b')],null))[_0x2267('0x2e')](respondWithResult(_0x254e1e,null))['catch'](handleError(_0x254e1e,null));};exports[_0x2267('0xa3')]=function(_0x33de28,_0x5ce854,_0x1bc757){return db[_0x2267('0x39')][_0x2267('0x57')]({'where':{'id':_0x33de28['params']['id']}})[_0x2267('0x2e')](function(_0x320ab7){if(_0x320ab7){return _0x320ab7[_0x2267('0x2d')]();}})[_0x2267('0x2e')](function(_0x147987){rimraf(path['join'](config[_0x2267('0x5a')],'server/files/plugins',path[_0x2267('0x67')](_0x147987['path'])),function(){});return _0x147987;})[_0x2267('0x2e')](handleEntityNotFound(_0x5ce854,null))[_0x2267('0x2e')](respondWithStatusCode(_0x5ce854,null))[_0x2267('0x54')](handleError(_0x5ce854,null));};exports[_0x2267('0xa4')]=function(_0x5b0d2f,_0xe2327b,_0x19a631){return BPromise[_0x2267('0xa5')]()['then'](function(){if(!_0x5b0d2f['query'][_0x2267('0x5')]){throw new Error(_0x2267('0xa6'));}if(!_0x5b0d2f[_0x2267('0x3f')][_0x2267('0xa7')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x26e47d=_0x5b0d2f['query'][_0x2267('0xa8')]?_0x5b0d2f[_0x2267('0x3f')][_0x2267('0xa8')]+':'+_0x5b0d2f[_0x2267('0x3f')][_0x2267('0xa7')]:_0x2267('0xa9')+_0x5b0d2f['query'][_0x2267('0xa7')];var _0x412aea=_0x5b0d2f['query']['json']?_0x5b0d2f[_0x2267('0x3f')][_0x2267('0x22')]:!![];var _0x4a313d=_0x5b0d2f[_0x2267('0x3f')][_0x2267('0xaa')]?_0x5b0d2f[_0x2267('0x3f')][_0x2267('0xaa')]:null;var _0x4286c4={'method':_0x5b0d2f[_0x2267('0xab')],'uri':util['format'](_0x2267('0xac'),_0x26e47d,_0x5b0d2f[_0x2267('0x3f')][_0x2267('0x5')]),'json':_0x412aea,'resolveWithFullResponse':!![],'encoding':_0x4a313d,'qs':_0x5b0d2f['query']};if(_0x5b0d2f[_0x2267('0xad')]){_0x4286c4[_0x2267('0xad')]=_0x5b0d2f[_0x2267('0xad')];if(_0x4286c4[_0x2267('0xad')][_0x2267('0xae')]){delete _0x4286c4[_0x2267('0xad')][_0x2267('0xae')];}}if(_0x4286c4[_0x2267('0xad')][_0x2267('0xaf')]){delete _0x4286c4[_0x2267('0xad')][_0x2267('0xaf')];}return rp(_0x4286c4);})[_0x2267('0x2e')](function(_0x436f11){if(_0x436f11){_0xe2327b['set'](_0x436f11['headers']);logger['info'](_0x436f11['body']);if(_[_0x2267('0xb0')](_0x5b0d2f[_0x2267('0x3f')][_0x2267('0x5')],_0x2267('0x58'))&&_0x436f11[_0x2267('0xb1')]==0x1f4){return _0xe2327b[_0x2267('0x20')](_0x436f11[_0x2267('0xb1')]);}else{return _0xe2327b['status'](_0x436f11[_0x2267('0xb1')])['send'](_0x436f11[_0x2267('0x9b')]);}}else{return _0xe2327b[_0x2267('0x20')](0xc8);}})[_0x2267('0x54')](handleError(_0xe2327b,null));};exports['webhookPost']=function(_0x3c12b8,_0x2561af,_0x5aaf46){return BPromise['resolve']()[_0x2267('0x2e')](function(){if(!_0x3c12b8[_0x2267('0x3f')][_0x2267('0x5')]){throw new Error(_0x2267('0xa6'));}if(!_0x3c12b8[_0x2267('0x3f')][_0x2267('0xa7')]){throw new Error(_0x2267('0xb2'));}var _0x4557e3=_0x3c12b8['query']['hostname']?_0x3c12b8[_0x2267('0x3f')][_0x2267('0xa8')]+':'+_0x3c12b8['query'][_0x2267('0xa7')]:_0x2267('0xa9')+_0x3c12b8[_0x2267('0x3f')]['port'];var _0x414fdd=_0x3c12b8['query'][_0x2267('0x22')]?_0x3c12b8[_0x2267('0x3f')]['json']:!![];var _0x4a5a99=_0x3c12b8[_0x2267('0x3f')][_0x2267('0xaa')]?_0x3c12b8['query'][_0x2267('0xaa')]:null;var _0x4ea8be={'method':_0x3c12b8[_0x2267('0xab')],'uri':util['format'](_0x2267('0xac'),_0x4557e3,_0x3c12b8[_0x2267('0x3f')][_0x2267('0x5')]),'json':_0x414fdd,'resolveWithFullResponse':!![],'encoding':_0x4a5a99,'body':_0x3c12b8[_0x2267('0x9b')]};if(_0x3c12b8[_0x2267('0xad')]){_0x4ea8be[_0x2267('0xad')]=_0x3c12b8[_0x2267('0xad')];if(_0x4ea8be[_0x2267('0xad')][_0x2267('0xae')]){delete _0x4ea8be[_0x2267('0xad')][_0x2267('0xae')];}}if(_0x4ea8be[_0x2267('0xad')][_0x2267('0xaf')]){delete _0x4ea8be[_0x2267('0xad')][_0x2267('0xaf')];}return rp(_0x4ea8be);})['then'](function(_0x38d6c3){if(_0x38d6c3){_0x2561af[_0x2267('0x27')](_0x38d6c3[_0x2267('0xad')]);logger[_0x2267('0x70')](_0x38d6c3['body']);return _0x2561af[_0x2267('0x21')](_0x38d6c3[_0x2267('0xb1')])[_0x2267('0x36')](_0x38d6c3[_0x2267('0x9b')]);}else{return _0x2561af[_0x2267('0x20')](0xc8);}})[_0x2267('0x54')](handleError(_0x2561af,null));}; \ No newline at end of file +var _0x7746=['Extracted\x20folder\x20removed','delete','webhookGet','\x27PATH\x27\x20parameter\x20not\x20specified','hostname','port','encoding','headers','content-length','content-type','endsWith','statusCode','webhookPost','resolve','\x27PORT\x27\x20parameter\x20not\x20specified','http://localhost:','sendStatus','zip-dir','fast-json-patch','bluebird','mustache','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','papaparse','extract-zip','rimraf','archiver','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./plugin.socket','status','end','json','offset','undefined','count','set','Content-Range','reject','update','destroy','get','Plugins','then','name','send','fieldName','type','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','limit','order','pick','filter','where','merge','VIRTUAL','includeAll','include','Plugin','findAll','rows','catch','show','rawAttributes','length','options','find','download','params','join','root','server/files/plugins','format','%s.zip','basename','createWriteStream','zip','warning','code','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','**/*','dirname','attachments/**/*','finalize','close','existsSync','Plugin\x20not\x20found','unlinkSync','info','Temporary\x20file\x20removed','upload','file','filename','extname','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','error','Invalid\x20plugin\x20structure','isDirectory','some','Plugin\x20manifest\x20missing','manifest.json','Invalid\x20manifest:\x20type\x20missing','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','Invalid\x20manifest:\x20views\x20missing','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','icon','icon-apps','version','plugins','test','Warning:\x20agent\x20view\x20not\x20specified','create','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x3fcbf9,_0x57c9a2){var _0x2b5636=function(_0x236b29){while(--_0x236b29){_0x3fcbf9['push'](_0x3fcbf9['shift']());}};_0x2b5636(++_0x57c9a2);}(_0x7746,0x151));var _0x6774=function(_0x1d3817,_0x2f6516){_0x1d3817=_0x1d3817-0x0;var _0x3aa463=_0x7746[_0x1d3817];return _0x3aa463;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6774('0x0'));var jsonpatch=require(_0x6774('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6774('0x2'));var Mustache=require(_0x6774('0x3'));var util=require('util');var path=require(_0x6774('0x4'));var sox=require(_0x6774('0x5'));var csv=require('to-csv');var ejs=require(_0x6774('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6774('0x7'));var squel=require('squel');var crypto=require(_0x6774('0x8'));var jsforce=require(_0x6774('0x9'));var deskjs=require(_0x6774('0xa'));var toCsv=require(_0x6774('0xb'));var querystring=require('querystring');var Papa=require(_0x6774('0xc'));var extract=require(_0x6774('0xd'));var rimraf=require(_0x6774('0xe'));var archiver=require(_0x6774('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6774('0x10'));var as=require(_0x6774('0x11'));var hardwareService=require(_0x6774('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x6774('0x13'))['db'];config['redis']=_[_0x6774('0x14')](config['redis'],{'host':_0x6774('0x15'),'port':0x18eb});var socket=require(_0x6774('0x16'))(new Redis(config[_0x6774('0x17')]));require(_0x6774('0x18'))['register'](socket);function respondWithStatusCode(_0x340c7e,_0x2afaee){_0x2afaee=_0x2afaee||0xcc;return function(_0x304529){if(_0x304529){return _0x340c7e['sendStatus'](_0x2afaee);}return _0x340c7e[_0x6774('0x19')](_0x2afaee)[_0x6774('0x1a')]();};}function respondWithResult(_0x2d1ace,_0x2bb826){_0x2bb826=_0x2bb826||0xc8;return function(_0x41dc72){if(_0x41dc72){return _0x2d1ace[_0x6774('0x19')](_0x2bb826)[_0x6774('0x1b')](_0x41dc72);}};}function respondWithFilteredResult(_0x5cd27a,_0x6e504b){return function(_0xc4d439){if(_0xc4d439){var _0x24f1ac=typeof _0x6e504b[_0x6774('0x1c')]===_0x6774('0x1d')&&typeof _0x6e504b['limit']===_0x6774('0x1d');var _0x1894c2=_0xc4d439[_0x6774('0x1e')];var _0x47e3f7=_0x24f1ac?0x0:_0x6e504b['offset'];var _0x15df2f=_0x24f1ac?_0xc4d439[_0x6774('0x1e')]:_0x6e504b[_0x6774('0x1c')]+_0x6e504b['limit'];var _0x243253;if(_0x15df2f>=_0x1894c2){_0x15df2f=_0x1894c2;_0x243253=0xc8;}else{_0x243253=0xce;}_0x5cd27a[_0x6774('0x19')](_0x243253);return _0x5cd27a[_0x6774('0x1f')](_0x6774('0x20'),_0x47e3f7+'-'+_0x15df2f+'/'+_0x1894c2)[_0x6774('0x1b')](_0xc4d439);}return null;};}function patchUpdates(_0x53a862){return function(_0x423e31){try{jsonpatch['apply'](_0x423e31,_0x53a862,!![]);}catch(_0x3b1ed3){return BPromise[_0x6774('0x21')](_0x3b1ed3);}return _0x423e31['save']();};}function saveUpdates(_0x4c1af1,_0x2bd50f){return function(_0x5aa7d1){if(_0x5aa7d1){return _0x5aa7d1[_0x6774('0x22')](_0x4c1af1)['then'](function(_0x4771f4){return _0x4771f4;});}return null;};}function removeEntity(_0x168911,_0x1f2e36){return function(_0x196ac4){if(_0x196ac4){return _0x196ac4[_0x6774('0x23')]()['then'](function(){var _0x4813f6=_0x196ac4[_0x6774('0x24')]({'plain':!![]});var _0x5b8625=_0x6774('0x25');return db['UserProfileResource'][_0x6774('0x23')]({'where':{'type':_0x5b8625,'resourceId':_0x4813f6['id']}})[_0x6774('0x26')](function(){return _0x196ac4;});})['then'](function(){_0x168911[_0x6774('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f5486,_0x265b9e){return function(_0x490c8f){if(!_0x490c8f){_0x1f5486['sendStatus'](0x194);}return _0x490c8f;};}function handleError(_0x38f5e7,_0x3adf95){_0x3adf95=_0x3adf95||0x1f4;return function(_0x2b8add){logger['error'](_0x2b8add['stack']);if(_0x2b8add[_0x6774('0x27')]){delete _0x2b8add['name'];}_0x38f5e7['status'](_0x3adf95)[_0x6774('0x28')](_0x2b8add);};}exports['index']=function(_0x35ca52,_0x5afb77){var _0x2602ad={},_0x5dbb03={},_0x2bd7e0={'count':0x0,'rows':[]};var _0x197243=_['map'](db['Plugin']['rawAttributes'],function(_0x28567e){return{'name':_0x28567e[_0x6774('0x29')],'type':_0x28567e[_0x6774('0x2a')]['key']};});_0x5dbb03['model']=_['map'](_0x197243,_0x6774('0x27'));_0x5dbb03[_0x6774('0x2b')]=_[_0x6774('0x2c')](_0x35ca52['query']);_0x5dbb03[_0x6774('0x2d')]=_[_0x6774('0x2e')](_0x5dbb03[_0x6774('0x2f')],_0x5dbb03[_0x6774('0x2b')]);_0x2602ad[_0x6774('0x30')]=_[_0x6774('0x2e')](_0x5dbb03[_0x6774('0x2f')],qs[_0x6774('0x31')](_0x35ca52[_0x6774('0x2b')]['fields']));_0x2602ad[_0x6774('0x30')]=_0x2602ad['attributes']['length']?_0x2602ad['attributes']:_0x5dbb03[_0x6774('0x2f')];if(!_0x35ca52[_0x6774('0x2b')][_0x6774('0x32')](_0x6774('0x33'))){_0x2602ad[_0x6774('0x34')]=qs['limit'](_0x35ca52[_0x6774('0x2b')][_0x6774('0x34')]);_0x2602ad[_0x6774('0x1c')]=qs[_0x6774('0x1c')](_0x35ca52[_0x6774('0x2b')]['offset']);}_0x2602ad[_0x6774('0x35')]=qs['sort'](_0x35ca52[_0x6774('0x2b')]['sort']);_0x2602ad['where']=qs[_0x6774('0x2d')](_[_0x6774('0x36')](_0x35ca52['query'],_0x5dbb03[_0x6774('0x2d')]),_0x197243);if(_0x35ca52[_0x6774('0x2b')][_0x6774('0x37')]){_0x2602ad[_0x6774('0x38')]=_[_0x6774('0x39')](_0x2602ad[_0x6774('0x38')],{'$or':_['map'](_0x197243,function(_0x176a11){if(_0x176a11['type']!==_0x6774('0x3a')){var _0x44e3d4={};_0x44e3d4[_0x176a11[_0x6774('0x27')]]={'$like':'%'+_0x35ca52[_0x6774('0x2b')][_0x6774('0x37')]+'%'};return _0x44e3d4;}})});}_0x2602ad=_[_0x6774('0x39')]({},_0x2602ad,_0x35ca52['options']);var _0x3a1229={'where':_0x2602ad[_0x6774('0x38')]};return db['Plugin'][_0x6774('0x1e')](_0x3a1229)[_0x6774('0x26')](function(_0x291e5b){_0x2bd7e0['count']=_0x291e5b;if(_0x35ca52[_0x6774('0x2b')][_0x6774('0x3b')]){_0x2602ad[_0x6774('0x3c')]=[{'all':!![]}];}return db[_0x6774('0x3d')][_0x6774('0x3e')](_0x2602ad);})[_0x6774('0x26')](function(_0x48f83e){_0x2bd7e0[_0x6774('0x3f')]=_0x48f83e;return _0x2bd7e0;})['then'](respondWithFilteredResult(_0x5afb77,_0x2602ad))[_0x6774('0x40')](handleError(_0x5afb77,null));};exports[_0x6774('0x41')]=function(_0x2a0c38,_0x19fecc){var _0x23b470={'raw':!![],'where':{'id':_0x2a0c38['params']['id']}},_0x4d79e4={};_0x4d79e4[_0x6774('0x2f')]=_[_0x6774('0x2c')](db['Plugin'][_0x6774('0x42')]);_0x4d79e4[_0x6774('0x2b')]=_[_0x6774('0x2c')](_0x2a0c38[_0x6774('0x2b')]);_0x4d79e4[_0x6774('0x2d')]=_['intersection'](_0x4d79e4['model'],_0x4d79e4[_0x6774('0x2b')]);_0x23b470[_0x6774('0x30')]=_[_0x6774('0x2e')](_0x4d79e4[_0x6774('0x2f')],qs[_0x6774('0x31')](_0x2a0c38[_0x6774('0x2b')][_0x6774('0x31')]));_0x23b470[_0x6774('0x30')]=_0x23b470[_0x6774('0x30')][_0x6774('0x43')]?_0x23b470[_0x6774('0x30')]:_0x4d79e4[_0x6774('0x2f')];if(_0x2a0c38[_0x6774('0x2b')][_0x6774('0x3b')]){_0x23b470[_0x6774('0x3c')]=[{'all':!![]}];}_0x23b470=_[_0x6774('0x39')]({},_0x23b470,_0x2a0c38[_0x6774('0x44')]);return db[_0x6774('0x3d')][_0x6774('0x45')](_0x23b470)[_0x6774('0x26')](handleEntityNotFound(_0x19fecc,null))[_0x6774('0x26')](respondWithResult(_0x19fecc,null))[_0x6774('0x40')](handleError(_0x19fecc,null));};exports[_0x6774('0x46')]=function(_0x398b3d,_0x2ffccc,_0x5a7027){return db[_0x6774('0x3d')]['find']({'where':{'id':_0x398b3d[_0x6774('0x47')]['id']},'attributes':[_0x6774('0x27'),_0x6774('0x4')],'raw':!![]})['then'](handleEntityNotFound(_0x2ffccc,null))[_0x6774('0x26')](function(_0x3a3ee6){if(_0x3a3ee6){var _0x5cabb1=path[_0x6774('0x48')](config[_0x6774('0x49')],_0x6774('0x4a'),util[_0x6774('0x4b')](_0x6774('0x4c'),path[_0x6774('0x4d')](_0x3a3ee6[_0x6774('0x4')])));var _0x15558d=fs[_0x6774('0x4e')](_0x5cabb1);var _0x4438b4=archiver(_0x6774('0x4f'),{'zlib':{'level':0x9}});_0x4438b4['on'](_0x6774('0x50'),function(_0x9245ae){if(_0x9245ae[_0x6774('0x51')]===_0x6774('0x52')){logger['error'](_0x9245ae);}else{throw new db[(_0x6774('0x53'))][(_0x6774('0x54'))](_0x6774('0x55'));}});_0x4438b4['on']('error',function(_0x3365b9){throw new db['Sequelize'][(_0x6774('0x54'))](_0x6774('0x55'));});_0x4438b4['pipe'](_0x15558d);_0x4438b4['glob'](_0x6774('0x56'),{'cwd':path[_0x6774('0x48')](config[_0x6774('0x49')],_0x6774('0x4a'),path[_0x6774('0x57')](_0x3a3ee6[_0x6774('0x4')])),'ignore':[path[_0x6774('0x48')](path[_0x6774('0x4d')](_0x3a3ee6['path']),'node_modules/**/*'),path[_0x6774('0x48')](path[_0x6774('0x4d')](_0x3a3ee6[_0x6774('0x4')]),_0x6774('0x58'))],'nodir':!![]})[_0x6774('0x59')]();_0x15558d['on'](_0x6774('0x5a'),function(){if(!fs[_0x6774('0x5b')](_0x5cabb1)){throw new db[(_0x6774('0x53'))][(_0x6774('0x54'))](_0x6774('0x5c'));}return _0x2ffccc[_0x6774('0x46')](_0x5cabb1,util[_0x6774('0x4b')]('%s.zip',path[_0x6774('0x4d')](_0x3a3ee6[_0x6774('0x4')])),function(_0x531433){if(_0x531433){throw new db[(_0x6774('0x53'))]['Error']('Error\x20while\x20downloading\x20the\x20plugin');}fs[_0x6774('0x5d')](_0x5cabb1);logger['info']('Download\x20completed');logger[_0x6774('0x5e')](_0x6774('0x5f'));});});}return null;})[_0x6774('0x40')](handleError(_0x2ffccc,null));};exports[_0x6774('0x60')]=function(_0x50fc15,_0x598b20,_0xca880f){var _0x586b80=path[_0x6774('0x4d')](_0x50fc15[_0x6774('0x61')][_0x6774('0x62')],path[_0x6774('0x63')](_0x50fc15[_0x6774('0x61')]['filename']));var _0x259ed7=path[_0x6774('0x48')](config['root'],_0x6774('0x4a'),_0x50fc15[_0x6774('0x61')][_0x6774('0x62')]);var _0x563c02=path[_0x6774('0x48')](config['root'],_0x6774('0x4a'),_0x586b80);logger[_0x6774('0x5e')](_0x6774('0x64'),_0x259ed7);logger[_0x6774('0x5e')](_0x6774('0x65'),_0x563c02);try{fs[_0x6774('0x66')](_0x259ed7,parseInt(_0x6774('0x67'),0x8));extract(_0x259ed7,{'dir':_0x563c02},function(_0x19af06){if(_0x19af06){logger['error'](_0x19af06);handleError(_0x19af06,!![]);};var _0x78028e=fs[_0x6774('0x68')](_0x563c02);if(_0x78028e[_0x6774('0x43')]>0x1){removeReferences(_0x259ed7,_0x563c02);logger[_0x6774('0x69')]('Invalid\x20plugin\x20structure');return _0xca880f(new Error(_0x6774('0x6a')));}var _0xe407c9=fs['lstatSync'](path[_0x6774('0x48')](_0x563c02,_0x78028e[0x0]));if(_0xe407c9['isFile']()){removeReferences(_0x259ed7,_0x563c02);logger[_0x6774('0x69')](_0x6774('0x6a'));return _0xca880f(new Error(_0x6774('0x6a')));}if(_0xe407c9[_0x6774('0x6b')]()){var _0x53d604=fs[_0x6774('0x68')](path[_0x6774('0x48')](_0x563c02,_0x78028e[0x0]));if(_0x53d604['length']===0x0){removeReferences(_0x259ed7,_0x563c02);logger[_0x6774('0x69')](_0x6774('0x6a'));return _0xca880f(new Error(_0x6774('0x6a')));}var _0x2c64a0=_0x53d604[_0x6774('0x6c')](function(_0x1fc7a5){return _0x1fc7a5==='manifest.json';});if(!_0x2c64a0){return _0xca880f(new Error(_0x6774('0x6d')));}var _0x19308a=fs['readFileSync'](path[_0x6774('0x48')](_0x563c02,_0x78028e[0x0],_0x6774('0x6e')));var _0x40a1cd=JSON['parse'](_0x19308a);if(_0x6774('0x1d')==typeof _0x40a1cd[_0x6774('0x27')]){return _0xca880f(new Error('Invalid\x20manifest:\x20name\x20missing'));}if(_0x6774('0x1d')==typeof _0x40a1cd[_0x6774('0x2a')]){return _0xca880f(new Error(_0x6774('0x6f')));}if(_0x6774('0x1d')==typeof _0x40a1cd['version']){return _0xca880f(new Error('Invalid\x20manifest:\x20version\x20not\x20specified'));}if(_0x6774('0x1d')==typeof _0x40a1cd[_0x6774('0x70')]){return _0xca880f(new Error(_0x6774('0x71')));}if(_0x40a1cd['type']===_0x6774('0x72')){if(_0x6774('0x1d')==typeof _0x40a1cd['parameters'][_0x6774('0x73')]){return _0xca880f(new Error(_0x6774('0x74')));}if(_0x6774('0x1d')==typeof _0x40a1cd[_0x6774('0x70')][_0x6774('0x73')][_0x6774('0x75')]&&_0x6774('0x1d')==typeof _0x40a1cd['parameters']['views'][_0x6774('0x76')]){return _0xca880f(new Error(_0x6774('0x77')));}}else if(_0x40a1cd['type']===_0x6774('0x78')){if(_0x6774('0x1d')==typeof _0x40a1cd['parameters'][_0x6774('0x79')]){return _0xca880f(new Error(_0x6774('0x7a')));}if('undefined'==typeof _0x40a1cd[_0x6774('0x70')][_0x6774('0x7b')]){return _0xca880f(new Error('Invalid\x20manifest:\x20script\x20path\x20missing'));}}else{return _0xca880f(new Error(_0x6774('0x7c')));}var _0x13f605=_0x40a1cd[_0x6774('0x27')];var _0x38007f=_0x40a1cd[_0x6774('0x7d')];var _0x23a63b=_0x40a1cd['type'];var _0x316f9e=_0x40a1cd[_0x6774('0x7e')]?_0x40a1cd['sidebar']:'always';var _0x581442=_0x40a1cd[_0x6774('0x7f')]?_0x40a1cd[_0x6774('0x7f')]:_0x6774('0x80');var _0x4021a2='';var _0x14ff60='';var _0x4d9796='';var _0x1e2ae6='';var _0x3221a9=_0x40a1cd[_0x6774('0x81')];if(_0x23a63b===_0x6774('0x72')){if(_0x6774('0x1d')!=typeof _0x40a1cd['parameters'][_0x6774('0x73')][_0x6774('0x75')]){var _0x4da5ff=_0x40a1cd[_0x6774('0x70')]['views'][_0x6774('0x75')];if(!/^(f|ht)tps?:\/\//i['test'](_0x4da5ff)){_0x4021a2=path[_0x6774('0x48')](_0x6774('0x82'),_0x586b80,_0x78028e[0x0],_0x4da5ff);}else{_0x4021a2=_0x4da5ff;}}else{logger[_0x6774('0x5e')]('Warning:\x20admin\x20view\x20not\x20specified');}if(_0x6774('0x1d')!=typeof _0x40a1cd[_0x6774('0x70')][_0x6774('0x73')]['agent']){var _0x3d6be2=_0x40a1cd[_0x6774('0x70')][_0x6774('0x73')][_0x6774('0x76')];if(!/^(f|ht)tps?:\/\//i[_0x6774('0x83')](_0x3d6be2)){_0x14ff60=path[_0x6774('0x48')](_0x6774('0x82'),_0x586b80,_0x78028e[0x0],_0x3d6be2);}else{_0x14ff60=_0x3d6be2;}}else{logger[_0x6774('0x5e')](_0x6774('0x84'));}}else if(_0x23a63b===_0x6774('0x78')){_0x4d9796=_0x40a1cd[_0x6774('0x70')]['scriptName'];_0x1e2ae6=_0x40a1cd[_0x6774('0x70')]['scriptPath'];if('undefined'!=typeof _0x40a1cd[_0x6774('0x70')][_0x6774('0x73')]){if(_0x6774('0x1d')!=typeof _0x40a1cd[_0x6774('0x70')][_0x6774('0x73')][_0x6774('0x75')]){var _0x4da5ff=_0x40a1cd['parameters'][_0x6774('0x73')][_0x6774('0x75')];if(!/^(f|ht)tps?:\/\//i['test'](_0x4da5ff)){_0x4021a2=path[_0x6774('0x48')](_0x6774('0x82'),_0x586b80,_0x78028e[0x0],_0x4da5ff);}else{_0x4021a2=_0x4da5ff;}}if(_0x6774('0x1d')!=typeof _0x40a1cd[_0x6774('0x70')][_0x6774('0x73')][_0x6774('0x76')]){var _0x3d6be2=_0x40a1cd[_0x6774('0x70')][_0x6774('0x73')][_0x6774('0x76')];if(!/^(f|ht)tps?:\/\//i[_0x6774('0x83')](_0x3d6be2)){_0x14ff60=path['join'](_0x6774('0x82'),_0x586b80,_0x78028e[0x0],_0x3d6be2);}else{_0x14ff60=_0x3d6be2;}}}}var _0x5126f7={'name':_0x13f605,'description':_0x38007f,'path':path['join'](_0x586b80,_0x78028e[0x0]),'type':_0x23a63b,'sidebar':_0x316f9e,'icon':_0x581442,'adminUrl':_0x4021a2,'agentUrl':_0x14ff60,'scriptName':_0x4d9796,'scriptPath':_0x1e2ae6,'version':_0x3221a9};removeReferences(_0x259ed7,null);return db[_0x6774('0x3d')][_0x6774('0x85')](_0x5126f7)['then'](function(_0xa59451){var _0x56b870={'role':_0x50fc15[_0x6774('0x86')]['role'],'userProfileId':_0x50fc15[_0x6774('0x86')][_0x6774('0x87')]};if(!_0x56b870)throw new Error(_0x6774('0x88'));if(_0x56b870[_0x6774('0x89')]===_0x6774('0x8a')){var _0x9c1461=_0xa59451[_0x6774('0x24')]({'plain':!![]});return db[_0x6774('0x8b')][_0x6774('0x45')]({'where':{'name':_0x6774('0x25'),'userProfileId':_0x56b870[_0x6774('0x87')]},'raw':!![]})[_0x6774('0x26')](function(_0x2b26b7){if(_0x2b26b7&&_0x2b26b7[_0x6774('0x8c')]===0x0){return db[_0x6774('0x8d')][_0x6774('0x85')]({'name':_0x9c1461[_0x6774('0x27')],'resourceId':_0x9c1461['id'],'type':_0x2b26b7[_0x6774('0x27')],'sectionId':_0x2b26b7['id']},{})['then'](function(){return _0xa59451;});}else{return _0xa59451;}})['catch'](function(_0x45f5a1){logger[_0x6774('0x69')](_0x6774('0x8e'),_0x45f5a1);throw _0x45f5a1;});}return _0xa59451;})[_0x6774('0x26')](respondWithResult(_0x598b20,null))[_0x6774('0x40')](handleError(_0x598b20,null));}});}catch(_0x5a26b4){_0x598b20[_0x6774('0x19')](0x1f4)[_0x6774('0x28')](_0x5a26b4);}};function removeReferences(_0x393403,_0x2373b9){try{if(_0x393403){fs[_0x6774('0x5d')](_0x393403);logger[_0x6774('0x5e')]('Zip\x20archive\x20removed');}if(_0x2373b9){rimraf(_0x2373b9,function(){});logger[_0x6774('0x5e')](_0x6774('0x8f'));}}catch(_0x113570){logger['error'](_0x113570);}}exports[_0x6774('0x22')]=function(_0x2a6a8c,_0x32bab0,_0x2ed26b){return db[_0x6774('0x3d')][_0x6774('0x45')]({'where':{'id':_0x2a6a8c['params']['id']}})[_0x6774('0x26')](handleEntityNotFound(_0x32bab0,null))[_0x6774('0x26')](saveUpdates(_0x2a6a8c[_0x6774('0x86')],null))['then'](respondWithResult(_0x32bab0,null))[_0x6774('0x40')](handleError(_0x32bab0,null));};exports[_0x6774('0x90')]=function(_0x428d74,_0x5c804c,_0x1d0afc){return db[_0x6774('0x3d')]['find']({'where':{'id':_0x428d74['params']['id']}})[_0x6774('0x26')](function(_0x3375bb){if(_0x3375bb){return _0x3375bb[_0x6774('0x23')]();}})[_0x6774('0x26')](function(_0x44eb73){rimraf(path[_0x6774('0x48')](config['root'],_0x6774('0x4a'),path[_0x6774('0x57')](_0x44eb73[_0x6774('0x4')])),function(){});return _0x44eb73;})['then'](handleEntityNotFound(_0x5c804c,null))['then'](respondWithStatusCode(_0x5c804c,null))[_0x6774('0x40')](handleError(_0x5c804c,null));};exports[_0x6774('0x91')]=function(_0x4bb616,_0x26c42a,_0x15c3e1){return BPromise['resolve']()['then'](function(){if(!_0x4bb616[_0x6774('0x2b')][_0x6774('0x4')]){throw new Error(_0x6774('0x92'));}if(!_0x4bb616[_0x6774('0x2b')]['port']){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x3cb7b1=_0x4bb616[_0x6774('0x2b')][_0x6774('0x93')]?_0x4bb616[_0x6774('0x2b')][_0x6774('0x93')]+':'+_0x4bb616[_0x6774('0x2b')][_0x6774('0x94')]:'http://localhost:'+_0x4bb616[_0x6774('0x2b')][_0x6774('0x94')];var _0x557c50=_0x4bb616[_0x6774('0x2b')][_0x6774('0x1b')]?_0x4bb616[_0x6774('0x2b')][_0x6774('0x1b')]:!![];var _0x4b251b=_0x4bb616[_0x6774('0x2b')][_0x6774('0x95')]?_0x4bb616[_0x6774('0x2b')][_0x6774('0x95')]:null;var _0x51b286={'method':_0x4bb616['method'],'uri':util[_0x6774('0x4b')]('%s%s',_0x3cb7b1,_0x4bb616[_0x6774('0x2b')][_0x6774('0x4')]),'json':_0x557c50,'resolveWithFullResponse':!![],'encoding':_0x4b251b,'qs':_0x4bb616['query']};if(_0x4bb616[_0x6774('0x96')]){_0x51b286[_0x6774('0x96')]=_0x4bb616[_0x6774('0x96')];if(_0x51b286[_0x6774('0x96')][_0x6774('0x97')]){delete _0x51b286[_0x6774('0x96')]['content-length'];}}if(_0x51b286['headers'][_0x6774('0x98')]){delete _0x51b286['headers']['content-type'];}return rp(_0x51b286);})['then'](function(_0x5f38dc){if(_0x5f38dc){_0x26c42a[_0x6774('0x1f')](_0x5f38dc[_0x6774('0x96')]);logger[_0x6774('0x5e')](_0x5f38dc[_0x6774('0x86')]);if(_[_0x6774('0x99')](_0x4bb616[_0x6774('0x2b')][_0x6774('0x4')],_0x6774('0x46'))&&_0x5f38dc[_0x6774('0x9a')]==0x1f4){return _0x26c42a['sendStatus'](_0x5f38dc[_0x6774('0x9a')]);}else{return _0x26c42a[_0x6774('0x19')](_0x5f38dc[_0x6774('0x9a')])[_0x6774('0x28')](_0x5f38dc[_0x6774('0x86')]);}}else{return _0x26c42a['sendStatus'](0xc8);}})['catch'](handleError(_0x26c42a,null));};exports[_0x6774('0x9b')]=function(_0x2605eb,_0x299dbf,_0x42a8a7){return BPromise[_0x6774('0x9c')]()[_0x6774('0x26')](function(){if(!_0x2605eb[_0x6774('0x2b')][_0x6774('0x4')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x2605eb[_0x6774('0x2b')]['port']){throw new Error(_0x6774('0x9d'));}var _0x22d156=_0x2605eb[_0x6774('0x2b')]['hostname']?_0x2605eb[_0x6774('0x2b')][_0x6774('0x93')]+':'+_0x2605eb[_0x6774('0x2b')][_0x6774('0x94')]:_0x6774('0x9e')+_0x2605eb['query'][_0x6774('0x94')];var _0x4ff7b9=_0x2605eb['query'][_0x6774('0x1b')]?_0x2605eb[_0x6774('0x2b')][_0x6774('0x1b')]:!![];var _0x46373b=_0x2605eb[_0x6774('0x2b')]['encoding']?_0x2605eb['query'][_0x6774('0x95')]:null;var _0x787ee1={'method':_0x2605eb['method'],'uri':util[_0x6774('0x4b')]('%s%s',_0x22d156,_0x2605eb[_0x6774('0x2b')][_0x6774('0x4')]),'json':_0x4ff7b9,'resolveWithFullResponse':!![],'encoding':_0x46373b,'body':_0x2605eb['body']};if(_0x2605eb[_0x6774('0x96')]){_0x787ee1[_0x6774('0x96')]=_0x2605eb[_0x6774('0x96')];if(_0x787ee1[_0x6774('0x96')][_0x6774('0x97')]){delete _0x787ee1['headers'][_0x6774('0x97')];}}if(_0x787ee1[_0x6774('0x96')]['content-type']){delete _0x787ee1['headers']['content-type'];}return rp(_0x787ee1);})[_0x6774('0x26')](function(_0x1bce97){if(_0x1bce97){_0x299dbf[_0x6774('0x1f')](_0x1bce97['headers']);logger[_0x6774('0x5e')](_0x1bce97[_0x6774('0x86')]);return _0x299dbf[_0x6774('0x19')](_0x1bce97[_0x6774('0x9a')])[_0x6774('0x28')](_0x1bce97[_0x6774('0x86')]);}else{return _0x299dbf[_0x6774('0x9f')](0xc8);}})[_0x6774('0x40')](handleError(_0x299dbf,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index c8359ca..62159f4 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 _0x06ae=['save','update','remove','hasOwnProperty','hook','exports','../../mysqldb','Plugin','setMaxListeners'];(function(_0xffe019,_0x34b5e0){var _0xf5abad=function(_0x2a2c88){while(--_0x2a2c88){_0xffe019['push'](_0xffe019['shift']());}};_0xf5abad(++_0x34b5e0);}(_0x06ae,0x16e));var _0xe06a=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x06ae[_0xa464c9];return _0x3d73c4;};'use strict';var EventEmitter=require('events');var Plugin=require(_0xe06a('0x0'))['db'][_0xe06a('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0xe06a('0x2')](0x0);var events={'afterCreate':_0xe06a('0x3'),'afterUpdate':_0xe06a('0x4'),'afterDestroy':_0xe06a('0x5')};function emitEvent(_0x2dfe68){return function(_0x1d695f,_0x1e7706,_0x4de363){PluginEvents['emit'](_0x2dfe68+':'+_0x1d695f['id'],_0x1d695f);PluginEvents['emit'](_0x2dfe68,_0x1d695f);_0x4de363(null);};}for(var e in events){if(events[_0xe06a('0x6')](e)){var event=events[e];Plugin[_0xe06a('0x7')](e,emitEvent(event));}}module[_0xe06a('0x8')]=PluginEvents; \ No newline at end of file +var _0x9f7a=['hasOwnProperty','events','../../mysqldb','Plugin','setMaxListeners','update'];(function(_0x1f184a,_0x19ff0c){var _0x5780b1=function(_0x290490){while(--_0x290490){_0x1f184a['push'](_0x1f184a['shift']());}};_0x5780b1(++_0x19ff0c);}(_0x9f7a,0xf1));var _0xa9f7=function(_0x50aa2e,_0xfbd6f0){_0x50aa2e=_0x50aa2e-0x0;var _0x5e07f0=_0x9f7a[_0x50aa2e];return _0x5e07f0;};'use strict';var EventEmitter=require(_0xa9f7('0x0'));var Plugin=require(_0xa9f7('0x1'))['db'][_0xa9f7('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0xa9f7('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xa9f7('0x4'),'afterDestroy':'remove'};function emitEvent(_0x4d188f){return function(_0x59823f,_0x22dbdd,_0x44545d){PluginEvents['emit'](_0x4d188f+':'+_0x59823f['id'],_0x59823f);PluginEvents['emit'](_0x4d188f,_0x59823f);_0x44545d(null);};}for(var e in events){if(events[_0xa9f7('0x5')](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module['exports']=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index 033b6e6..5166013 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 _0x3910=['../../config/environment','./plugin.attributes','define','Plugin','plugins','lodash','../../config/logger','api','moment','bluebird','path'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0x3910,0x102));var _0x0391=function(_0x3091de,_0x105e82){_0x3091de=_0x3091de-0x0;var _0x5d963c=_0x3910[_0x3091de];return _0x5d963c;};'use strict';var _=require(_0x0391('0x0'));var util=require('util');var logger=require(_0x0391('0x1'))(_0x0391('0x2'));var moment=require(_0x0391('0x3'));var BPromise=require(_0x0391('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0391('0x5'));var rimraf=require('rimraf');var config=require(_0x0391('0x6'));var attributes=require(_0x0391('0x7'));module['exports']=function(_0x32a535,_0x3ddb77){return _0x32a535[_0x0391('0x8')](_0x0391('0x9'),attributes,{'tableName':_0x0391('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7fc5=['plugins','lodash','util','../../config/logger','moment','bluebird','rimraf','exports','define'];(function(_0x43c3b9,_0x2fa9c8){var _0x4d26ad=function(_0x566159){while(--_0x566159){_0x43c3b9['push'](_0x43c3b9['shift']());}};_0x4d26ad(++_0x2fa9c8);}(_0x7fc5,0x160));var _0x57fc=function(_0xeb58a3,_0x1739dd){_0xeb58a3=_0xeb58a3-0x0;var _0x286d9e=_0x7fc5[_0xeb58a3];return _0x286d9e;};'use strict';var _=require(_0x57fc('0x0'));var util=require(_0x57fc('0x1'));var logger=require(_0x57fc('0x2'))('api');var moment=require(_0x57fc('0x3'));var BPromise=require(_0x57fc('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x57fc('0x5'));var config=require('../../config/environment');var attributes=require('./plugin.attributes');module[_0x57fc('0x6')]=function(_0x831dc4,_0x922e85){return _0x831dc4[_0x57fc('0x7')]('Plugin',attributes,{'tableName':_0x57fc('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.rpc.js b/server/api/plugin/plugin.rpc.js index 9de9aa8..f0abe6e 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 _0xa32a=['debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreatePlugin','Plugin','create','body','options','raw','then','lodash','moment','bluebird','../../config/logger','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./plugin.socket','info','Plugin,\x20%s,\x20%s','request\x20sent'];(function(_0x22074d,_0x33df85){var _0x3a24ce=function(_0x1dfb83){while(--_0x1dfb83){_0x22074d['push'](_0x22074d['shift']());}};_0x3a24ce(++_0x33df85);}(_0xa32a,0x1a5));var _0xaa32=function(_0x3b1d1e,_0x10d8d9){_0x3b1d1e=_0x3b1d1e-0x0;var _0x5670b7=_0xa32a[_0x3b1d1e];return _0x5670b7;};'use strict';var _=require(_0xaa32('0x0'));var util=require('util');var moment=require(_0xaa32('0x1'));var BPromise=require(_0xaa32('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xaa32('0x3'))('rpc');var config=require(_0xaa32('0x4'));var jayson=require(_0xaa32('0x5'));var client=jayson['client']['http']({'port':0x232a});config[_0xaa32('0x6')]=_[_0xaa32('0x7')](config['redis'],{'host':_0xaa32('0x8'),'port':0x18eb});var socket=require(_0xaa32('0x9'))(new Redis(config[_0xaa32('0x6')]));require(_0xaa32('0xa'))['register'](socket);function respondWithRpcPromise(_0x5c6e54,_0x1d39b,_0x41dafb){return new BPromise(function(_0x351409,_0x505745){return client['request'](_0x5c6e54,_0x41dafb)['then'](function(_0x1a2718){logger[_0xaa32('0xb')](_0xaa32('0xc'),_0x1d39b,_0xaa32('0xd'));logger[_0xaa32('0xe')](_0xaa32('0xf'),_0x1d39b,_0xaa32('0xd'),JSON[_0xaa32('0x10')](_0x1a2718));if(_0x1a2718[_0xaa32('0x11')]){if(_0x1a2718[_0xaa32('0x11')][_0xaa32('0x12')]===0x1f4){logger[_0xaa32('0x11')](_0xaa32('0xc'),_0x1d39b,_0x1a2718[_0xaa32('0x11')][_0xaa32('0x13')]);return _0x505745(_0x1a2718[_0xaa32('0x11')]['message']);}logger[_0xaa32('0x11')](_0xaa32('0xc'),_0x1d39b,_0x1a2718[_0xaa32('0x11')][_0xaa32('0x13')]);return _0x351409(_0x1a2718[_0xaa32('0x11')][_0xaa32('0x13')]);}else{logger['info']('Plugin,\x20%s,\x20%s',_0x1d39b,_0xaa32('0xd'));_0x351409(_0x1a2718[_0xaa32('0x14')]['message']);}})[_0xaa32('0x15')](function(_0x299b11){logger[_0xaa32('0x11')](_0xaa32('0xc'),_0x1d39b,_0x299b11);_0x505745(_0x299b11);});});}exports[_0xaa32('0x16')]=function(_0x57942d){var _0xf08566=this;return new Promise(function(_0x7c56d1,_0x438a0b){return db[_0xaa32('0x17')][_0xaa32('0x18')](_0x57942d[_0xaa32('0x19')],{'raw':_0x57942d[_0xaa32('0x1a')]?_0x57942d[_0xaa32('0x1a')][_0xaa32('0x1b')]===undefined?!![]:![]:!![]})[_0xaa32('0x1c')](function(_0x83bef9){logger[_0xaa32('0xb')](_0xaa32('0x16'),_0x57942d);logger['debug'](_0xaa32('0x16'),_0x57942d,JSON['stringify'](_0x83bef9));_0x7c56d1(_0x83bef9);})['catch'](function(_0xfbf4ea){logger[_0xaa32('0x11')](_0xaa32('0x16'),_0xfbf4ea[_0xaa32('0x13')],_0x57942d);_0x438a0b(_0xf08566['error'](0x1f4,_0xfbf4ea[_0xaa32('0x13')]));});});}; \ No newline at end of file +var _0x5106=['Plugin,\x20%s,\x20%s','message','result','CreatePlugin','create','body','options','catch','lodash','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','localhost','redis','register','request','then','info','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','code','error'];(function(_0x454018,_0x46e33a){var _0x24697d=function(_0x3ec647){while(--_0x3ec647){_0x454018['push'](_0x454018['shift']());}};_0x24697d(++_0x46e33a);}(_0x5106,0x116));var _0x6510=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x5106[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0x6510('0x0'));var util=require('util');var moment=require(_0x6510('0x1'));var BPromise=require('bluebird');var rs=require(_0x6510('0x2'));var fs=require('fs');var Redis=require(_0x6510('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6510('0x4'))(_0x6510('0x5'));var config=require(_0x6510('0x6'));var jayson=require(_0x6510('0x7'));var client=jayson[_0x6510('0x8')][_0x6510('0x9')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0x6510('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6510('0xb')]));require('./plugin.socket')[_0x6510('0xc')](socket);function respondWithRpcPromise(_0x2c4c38,_0x340531,_0x586cea){return new BPromise(function(_0x53a80e,_0x1dcf14){return client[_0x6510('0xd')](_0x2c4c38,_0x586cea)[_0x6510('0xe')](function(_0xb96205){logger[_0x6510('0xf')]('Plugin,\x20%s,\x20%s',_0x340531,_0x6510('0x10'));logger[_0x6510('0x11')](_0x6510('0x12'),_0x340531,_0x6510('0x10'),JSON[_0x6510('0x13')](_0xb96205));if(_0xb96205['error']){if(_0xb96205['error'][_0x6510('0x14')]===0x1f4){logger[_0x6510('0x15')](_0x6510('0x16'),_0x340531,_0xb96205[_0x6510('0x15')][_0x6510('0x17')]);return _0x1dcf14(_0xb96205['error']['message']);}logger[_0x6510('0x15')](_0x6510('0x16'),_0x340531,_0xb96205[_0x6510('0x15')][_0x6510('0x17')]);return _0x53a80e(_0xb96205['error'][_0x6510('0x17')]);}else{logger['info']('Plugin,\x20%s,\x20%s',_0x340531,_0x6510('0x10'));_0x53a80e(_0xb96205[_0x6510('0x18')][_0x6510('0x17')]);}})['catch'](function(_0xf4a3c3){logger[_0x6510('0x15')]('Plugin,\x20%s,\x20%s',_0x340531,_0xf4a3c3);_0x1dcf14(_0xf4a3c3);});});}exports[_0x6510('0x19')]=function(_0x7a9a7c){var _0x13c847=this;return new Promise(function(_0x42f8dc,_0xb5bff){return db['Plugin'][_0x6510('0x1a')](_0x7a9a7c[_0x6510('0x1b')],{'raw':_0x7a9a7c['options']?_0x7a9a7c[_0x6510('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0x6510('0xe')](function(_0x36da2f){logger['info'](_0x6510('0x19'),_0x7a9a7c);logger[_0x6510('0x11')](_0x6510('0x19'),_0x7a9a7c,JSON[_0x6510('0x13')](_0x36da2f));_0x42f8dc(_0x36da2f);})[_0x6510('0x1d')](function(_0x4feb7d){logger[_0x6510('0x15')](_0x6510('0x19'),_0x4feb7d['message'],_0x7a9a7c);_0xb5bff(_0x13c847[_0x6510('0x15')](0x1f4,_0x4feb7d[_0x6510('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index c5fb627..f4c8c1a 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 _0x5838=['./plugin.events','save','remove','update','emit','register','length','plugin:'];(function(_0x254db2,_0x1f6015){var _0x241804=function(_0x4aa6fd){while(--_0x4aa6fd){_0x254db2['push'](_0x254db2['shift']());}};_0x241804(++_0x1f6015);}(_0x5838,0x1c8));var _0x8583=function(_0xdd54de,_0x1b6766){_0xdd54de=_0xdd54de-0x0;var _0x3715a4=_0x5838[_0xdd54de];return _0x3715a4;};'use strict';var PluginEvents=require(_0x8583('0x0'));var events=[_0x8583('0x1'),_0x8583('0x2'),_0x8583('0x3')];function createListener(_0xdd5584,_0x1f6f19){return function(_0x49bf5c){_0x1f6f19[_0x8583('0x4')](_0xdd5584,_0x49bf5c);};}function removeListener(_0x430dc8,_0xaf0112){return function(){PluginEvents['removeListener'](_0x430dc8,_0xaf0112);};}exports[_0x8583('0x5')]=function(_0x5c902e){for(var _0x543b88=0x0,_0x23c662=events[_0x8583('0x6')];_0x543b88<_0x23c662;_0x543b88++){var _0xf6b402=events[_0x543b88];var _0x4ec707=createListener(_0x8583('0x7')+_0xf6b402,_0x5c902e);PluginEvents['on'](_0xf6b402,_0x4ec707);}}; \ No newline at end of file +var _0x3d27=['plugin:','./plugin.events','save','remove','update','emit','removeListener','register','length'];(function(_0x1b540f,_0xbf66e0){var _0x1259f4=function(_0x27faef){while(--_0x27faef){_0x1b540f['push'](_0x1b540f['shift']());}};_0x1259f4(++_0xbf66e0);}(_0x3d27,0xe2));var _0x73d2=function(_0x2718c7,_0x5a1636){_0x2718c7=_0x2718c7-0x0;var _0x59d89c=_0x3d27[_0x2718c7];return _0x59d89c;};'use strict';var PluginEvents=require(_0x73d2('0x0'));var events=[_0x73d2('0x1'),_0x73d2('0x2'),_0x73d2('0x3')];function createListener(_0x23083e,_0x4ca8a9){return function(_0x3af7d1){_0x4ca8a9[_0x73d2('0x4')](_0x23083e,_0x3af7d1);};}function removeListener(_0x915beb,_0x240ef3){return function(){PluginEvents[_0x73d2('0x5')](_0x915beb,_0x240ef3);};}exports[_0x73d2('0x6')]=function(_0x18b0d0){for(var _0x5b97c4=0x0,_0x1f9cb5=events[_0x73d2('0x7')];_0x5b97c4<_0x1f9cb5;_0x5b97c4++){var _0x51df35=events[_0x5b97c4];var _0x5a468d=createListener(_0x73d2('0x8')+_0x51df35,_0x18b0d0);PluginEvents['on'](_0x51df35,_0x5a468d);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index b1a3d12..7f3faa4 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(_0x14d2e1,_0x3c66cb){var _0x3e0edf=function(_0x475424){while(--_0x475424){_0x14d2e1['push'](_0x14d2e1['shift']());}};_0x3e0edf(++_0x3c66cb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xa9e0[_0x2160a9];return _0xa88cf7;};'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(_0x35da96,_0x14f90e){var _0x34c6ed=function(_0x12e038){while(--_0x12e038){_0x35da96['push'](_0x35da96['shift']());}};_0x34c6ed(++_0x14f90e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xa9e0[_0x3054be];return _0x3df150;};'use strict';var express=require(_0x0a9e('0x0'));var router=express[_0x0a9e('0x1')]();var auth=require(_0x0a9e('0x2'));var controller=require('./pm2.controller');router['get']('/',auth[_0x0a9e('0x3')](),controller['index']);router[_0x0a9e('0x4')](_0x0a9e('0x5'),auth[_0x0a9e('0x3')](),controller[_0x0a9e('0x6')]);router[_0x0a9e('0x7')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x8')]);router[_0x0a9e('0x9')](_0x0a9e('0x5'),auth['isAuthenticated'](),controller['update']);router[_0x0a9e('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);module[_0x0a9e('0xc')]=router; \ No newline at end of file diff --git a/server/api/pm2/pm2.controller.js b/server/api/pm2/pm2.controller.js index afadb1d..f871cc6 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 _0xe205=['cwd','chdir','dirname','dump','Missing\x20name\x20and/or\x20path','restart','stop','hasOwnProperty','Unknown\x20status','destroy','delete','lodash','../../config/pm2','../../config/logger','api','path','child_process','exec','bluebird','sendStatus','json','error','name','status','send','npm\x20install','info','index','list','reject','express','length','then','catch','show','describe','params','body','script'];(function(_0x21750a,_0x35ee25){var _0x3c391f=function(_0x16b047){while(--_0x16b047){_0x21750a['push'](_0x21750a['shift']());}};_0x3c391f(++_0x35ee25);}(_0xe205,0xa7));var _0x5e20=function(_0x19e9cc,_0x579907){_0x19e9cc=_0x19e9cc-0x0;var _0x47c240=_0xe205[_0x19e9cc];return _0x47c240;};'use strict';var _=require(_0x5e20('0x0'));var pm2=require(_0x5e20('0x1'));var logger=require(_0x5e20('0x2'))(_0x5e20('0x3'));var path=require(_0x5e20('0x4'));var exec=require(_0x5e20('0x5'))[_0x5e20('0x6')];var BPromise=require(_0x5e20('0x7'));function handleEntityNotFound(_0x37c5e9,_0x4ac934){return function(_0x1a6198){if(!_0x1a6198){_0x37c5e9[_0x5e20('0x8')](0x194);;}return _0x1a6198;};}function respondWithResult(_0x44dbb3,_0x3c4203){_0x3c4203=_0x3c4203||0xc8;return function(_0x5eca5c){if(_0x5eca5c){return _0x44dbb3['status'](_0x3c4203)[_0x5e20('0x9')](_0x5eca5c);}return null;};}function handleError(_0x4c9332,_0x533e18){_0x533e18=_0x533e18||0x1f4;return function(_0x30b757){logger[_0x5e20('0xa')](_0x30b757['stack']);if(_0x30b757[_0x5e20('0xb')]){delete _0x30b757[_0x5e20('0xb')];}_0x4c9332[_0x5e20('0xc')](_0x533e18)[_0x5e20('0xd')](_0x30b757);};}function execChildProcess(){return new BPromise(function(_0x5cb51d,_0x349613){exec(_0x5e20('0xe'),function(_0x270689,_0x27f1f9,_0x165824){logger[_0x5e20('0xf')](_0x27f1f9);logger['info'](_0x165824);if(_0x270689){logger[_0x5e20('0xa')](_0x270689);return _0x349613(_0x270689);}return _0x5cb51d(_0x27f1f9);});});}exports[_0x5e20('0x10')]=function(_0x22540d,_0x5868c0){return pm2[_0x5e20('0x11')]()['then'](function(_0x1f47f3){if(_0x1f47f3){var _0x5ba833=_[_0x5e20('0x12')](_0x1f47f3,function(_0x330cdf){return _0x330cdf[_0x5e20('0xb')]===_0x5e20('0x13')||_0x330cdf[_0x5e20('0xb')]==='motion2';});return{'rows':_0x5ba833,'count':_0x5ba833[_0x5e20('0x14')]};}return null;})[_0x5e20('0x15')](respondWithResult(_0x5868c0,null))[_0x5e20('0x16')](handleError(_0x5868c0,null));};exports[_0x5e20('0x17')]=function(_0x2f194b,_0x3b353f){return pm2[_0x5e20('0x18')](_0x2f194b[_0x5e20('0x19')]['id'])['then'](respondWithResult(_0x3b353f,null))[_0x5e20('0x15')](handleEntityNotFound(_0x3b353f,null))[_0x5e20('0x16')](handleError(_0x3b353f,null));};exports['create']=function(_0x295eb3,_0x1b1457){if(_0x295eb3[_0x5e20('0x1a')][_0x5e20('0xb')]&&_0x295eb3['body'][_0x5e20('0x1b')]){var _0x50f222=path['join'](__dirname,'../../files/plugins',_0x295eb3['body'][_0x5e20('0x1b')]);var _0x5cca90=process[_0x5e20('0x1c')]();process[_0x5e20('0x1d')](path[_0x5e20('0x1e')](_0x50f222));return execChildProcess()[_0x5e20('0x15')](function(_0x3ef7fa){process[_0x5e20('0x1d')](_0x5cca90);return pm2['start']({'name':_0x295eb3[_0x5e20('0x1a')]['name'],'script':_0x50f222});})['then'](function(_0x33993a){pm2[_0x5e20('0x1f')]();return _0x33993a[0x0];})[_0x5e20('0x15')](respondWithResult(_0x1b1457,0xc9))[_0x5e20('0x16')](handleError(_0x1b1457,null));}else{return _0x1b1457[_0x5e20('0xc')](0x1f4)[_0x5e20('0xd')]({'message':_0x5e20('0x20')});}};exports['update']=function(_0x3bf4f4,_0x420f63){if(_0x3bf4f4[_0x5e20('0x1a')]['id']){delete _0x3bf4f4[_0x5e20('0x1a')]['id'];}var _0x4c799d={'online':_0x5e20('0x21'),'stopped':_0x5e20('0x22')};if(_0x4c799d[_0x5e20('0x23')](_0x3bf4f4[_0x5e20('0x1a')][_0x5e20('0xc')])){return pm2[_0x4c799d[_0x3bf4f4[_0x5e20('0x1a')]['status']]](_0x3bf4f4[_0x5e20('0x19')]['id'])[_0x5e20('0x15')](respondWithResult(_0x420f63,0xc8))['catch'](handleError(_0x420f63,null));}else{return _0x420f63[_0x5e20('0xc')](0x1f4)[_0x5e20('0xd')]({'message':_0x5e20('0x24')});}};exports[_0x5e20('0x25')]=function(_0x1548c8,_0x395a27){if(_0x1548c8['body']['id']){delete _0x1548c8[_0x5e20('0x1a')]['id'];}if(_0x1548c8[_0x5e20('0x19')]['id']){return pm2[_0x5e20('0x26')](_0x1548c8[_0x5e20('0x19')]['id'])[_0x5e20('0x15')](function(_0x1ac162){pm2[_0x5e20('0x1f')]();return _0x1ac162[0x0];})[_0x5e20('0x15')](respondWithResult(_0x395a27,null))[_0x5e20('0x16')](handleError(_0x395a27,null));}else{return _0x395a27[_0x5e20('0xc')](0x1f4)[_0x5e20('0xd')]({'message':'Unknown\x20id'});}}; \ No newline at end of file +var _0xc788=['body','script','join','../../files/plugins','chdir','dirname','start','dump','send','update','stop','hasOwnProperty','Unknown\x20status','params','delete','Unknown\x20id','lodash','../../config/pm2','../../config/logger','child_process','exec','bluebird','sendStatus','status','error','stack','name','info','index','list','then','reject','motion2','catch','show','describe'];(function(_0x5a427c,_0x1c7b6f){var _0xc17e0d=function(_0x3b82a7){while(--_0x3b82a7){_0x5a427c['push'](_0x5a427c['shift']());}};_0xc17e0d(++_0x1c7b6f);}(_0xc788,0xc4));var _0x8c78=function(_0x253bd2,_0x4e88ff){_0x253bd2=_0x253bd2-0x0;var _0x457ff9=_0xc788[_0x253bd2];return _0x457ff9;};'use strict';var _=require(_0x8c78('0x0'));var pm2=require(_0x8c78('0x1'));var logger=require(_0x8c78('0x2'))('api');var path=require('path');var exec=require(_0x8c78('0x3'))[_0x8c78('0x4')];var BPromise=require(_0x8c78('0x5'));function handleEntityNotFound(_0x1d0670,_0x386f0a){return function(_0x5498f9){if(!_0x5498f9){_0x1d0670[_0x8c78('0x6')](0x194);;}return _0x5498f9;};}function respondWithResult(_0x4555da,_0x329152){_0x329152=_0x329152||0xc8;return function(_0x1ac27f){if(_0x1ac27f){return _0x4555da[_0x8c78('0x7')](_0x329152)['json'](_0x1ac27f);}return null;};}function handleError(_0x247188,_0x299d9d){_0x299d9d=_0x299d9d||0x1f4;return function(_0x9bc075){logger[_0x8c78('0x8')](_0x9bc075[_0x8c78('0x9')]);if(_0x9bc075[_0x8c78('0xa')]){delete _0x9bc075['name'];}_0x247188[_0x8c78('0x7')](_0x299d9d)['send'](_0x9bc075);};}function execChildProcess(){return new BPromise(function(_0x3d55f0,_0x45935a){exec('npm\x20install',function(_0x1a05a7,_0x95e78e,_0x5ee642){logger[_0x8c78('0xb')](_0x95e78e);logger['info'](_0x5ee642);if(_0x1a05a7){logger['error'](_0x1a05a7);return _0x45935a(_0x1a05a7);}return _0x3d55f0(_0x95e78e);});});}exports[_0x8c78('0xc')]=function(_0x1b1d0e,_0x26178c){return pm2[_0x8c78('0xd')]()[_0x8c78('0xe')](function(_0x3d1306){if(_0x3d1306){var _0xe5f8ae=_[_0x8c78('0xf')](_0x3d1306,function(_0x2f44af){return _0x2f44af[_0x8c78('0xa')]==='express'||_0x2f44af[_0x8c78('0xa')]===_0x8c78('0x10');});return{'rows':_0xe5f8ae,'count':_0xe5f8ae['length']};}return null;})[_0x8c78('0xe')](respondWithResult(_0x26178c,null))[_0x8c78('0x11')](handleError(_0x26178c,null));};exports[_0x8c78('0x12')]=function(_0x23824e,_0x2a982c){return pm2[_0x8c78('0x13')](_0x23824e['params']['id'])['then'](respondWithResult(_0x2a982c,null))[_0x8c78('0xe')](handleEntityNotFound(_0x2a982c,null))['catch'](handleError(_0x2a982c,null));};exports['create']=function(_0xece4f0,_0x56c191){if(_0xece4f0[_0x8c78('0x14')][_0x8c78('0xa')]&&_0xece4f0['body'][_0x8c78('0x15')]){var _0x5b111b=path[_0x8c78('0x16')](__dirname,_0x8c78('0x17'),_0xece4f0['body'][_0x8c78('0x15')]);var _0x188cc3=process['cwd']();process[_0x8c78('0x18')](path[_0x8c78('0x19')](_0x5b111b));return execChildProcess()[_0x8c78('0xe')](function(_0x9581c6){process[_0x8c78('0x18')](_0x188cc3);return pm2[_0x8c78('0x1a')]({'name':_0xece4f0[_0x8c78('0x14')][_0x8c78('0xa')],'script':_0x5b111b});})[_0x8c78('0xe')](function(_0x4a7d20){pm2[_0x8c78('0x1b')]();return _0x4a7d20[0x0];})[_0x8c78('0xe')](respondWithResult(_0x56c191,0xc9))[_0x8c78('0x11')](handleError(_0x56c191,null));}else{return _0x56c191['status'](0x1f4)[_0x8c78('0x1c')]({'message':'Missing\x20name\x20and/or\x20path'});}};exports[_0x8c78('0x1d')]=function(_0x24f9a7,_0x8d9ff9){if(_0x24f9a7['body']['id']){delete _0x24f9a7[_0x8c78('0x14')]['id'];}var _0x2568d5={'online':'restart','stopped':_0x8c78('0x1e')};if(_0x2568d5[_0x8c78('0x1f')](_0x24f9a7[_0x8c78('0x14')][_0x8c78('0x7')])){return pm2[_0x2568d5[_0x24f9a7[_0x8c78('0x14')][_0x8c78('0x7')]]](_0x24f9a7['params']['id'])[_0x8c78('0xe')](respondWithResult(_0x8d9ff9,0xc8))['catch'](handleError(_0x8d9ff9,null));}else{return _0x8d9ff9[_0x8c78('0x7')](0x1f4)[_0x8c78('0x1c')]({'message':_0x8c78('0x20')});}};exports['destroy']=function(_0x1f1a0c,_0x3816d2){if(_0x1f1a0c['body']['id']){delete _0x1f1a0c[_0x8c78('0x14')]['id'];}if(_0x1f1a0c[_0x8c78('0x21')]['id']){return pm2[_0x8c78('0x22')](_0x1f1a0c['params']['id'])[_0x8c78('0xe')](function(_0x63307e){pm2[_0x8c78('0x1b')]();return _0x63307e[0x0];})['then'](respondWithResult(_0x3816d2,null))[_0x8c78('0x11')](handleError(_0x3816d2,null));}else{return _0x3816d2[_0x8c78('0x7')](0x1f4)['send']({'message':_0x8c78('0x23')});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index 0357d27..3bff837 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 _0x18f3=['Router','../../components/auth/service','./realtime.controller','isAuthenticated','exports'];(function(_0x301188,_0x51f6ed){var _0x4f79ad=function(_0x149363){while(--_0x149363){_0x301188['push'](_0x301188['shift']());}};_0x4f79ad(++_0x51f6ed);}(_0x18f3,0x19f));var _0x318f=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0x18f3[_0x580576];return _0x3f55a0;};'use strict';var express=require('express');var router=express[_0x318f('0x0')]();var auth=require(_0x318f('0x1'));var controller=require(_0x318f('0x2'));router['get']('/queues',auth[_0x318f('0x3')](),controller['getQueues']);module[_0x318f('0x4')]=router; \ No newline at end of file +var _0xe230=['express','Router','get','/queues','isAuthenticated','getQueues','exports'];(function(_0x1746f9,_0x291df3){var _0x670782=function(_0x5d99ef){while(--_0x5d99ef){_0x1746f9['push'](_0x1746f9['shift']());}};_0x670782(++_0x291df3);}(_0xe230,0x85));var _0x0e23=function(_0x14f4c0,_0x3bf915){_0x14f4c0=_0x14f4c0-0x0;var _0x2f7bdf=_0xe230[_0x14f4c0];return _0x2f7bdf;};'use strict';var express=require(_0x0e23('0x0'));var router=express[_0x0e23('0x1')]();var auth=require('../../components/auth/service');var controller=require('./realtime.controller');router[_0x0e23('0x2')](_0x0e23('0x3'),auth[_0x0e23('0x4')](),controller[_0x0e23('0x5')]);module[_0x0e23('0x6')]=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index db57d96..40ced49 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 _0x77d4=['lodash','../../components/parsers/qs','api','../../mysqldb','client','http','limit','count','offset','status','set','json','error','stack','name','mail','chat','openchannel','fax','whatsapp','voice','resolve','then','query','channel','includes','toLowerCase','startCase','Queue','map','rawAttributes','fieldName','type','key','getOptions','role','user','userProfileId','outbound','QueueCampaigns','filter','UserProfile','getResources','findAndCountAll','request','Queues','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','loggedIn','available','waiting','talking','paused','push','pTalking','message','dialActive','dialMethod','Trunk','startPredictive','startProgressive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','rows','originated','agents','find','pick','getMembers','length','online','Pause','findAll','User','UserId','agent','loggedInDb','all','catch'];(function(_0x224f65,_0x4750bf){var _0x3f921c=function(_0x1b5f64){while(--_0x1b5f64){_0x224f65['push'](_0x224f65['shift']());}};_0x3f921c(++_0x4750bf);}(_0x77d4,0x108));var _0x477d=function(_0x4883c8,_0x1281a3){_0x4883c8=_0x4883c8-0x0;var _0x3a404b=_0x77d4[_0x4883c8];return _0x3a404b;};'use strict';var util=require('util');var _=require(_0x477d('0x0'));var jayson=require('jayson/promise');var qs=require(_0x477d('0x1'));var logger=require('../../config/logger')(_0x477d('0x2'));var db=require(_0x477d('0x3'))['db'];var client=jayson['client']['http']({'port':0x232a});var routingClient=jayson[_0x477d('0x4')][_0x477d('0x5')]({'port':0x232c});function respondWithFilteredResult(_0x3d2f8d,_0x471fca){return function(_0x2545e5){if(_0x2545e5){var _0x45ca2d=typeof _0x471fca['offset']==='undefined'&&typeof _0x471fca[_0x477d('0x6')]==='undefined';var _0x5da70c=_0x2545e5[_0x477d('0x7')];var _0x29f11b=_0x45ca2d?0x0:_0x471fca[_0x477d('0x8')];var _0x2c326c=_0x45ca2d?_0x2545e5[_0x477d('0x7')]:_0x471fca['offset']+_0x471fca[_0x477d('0x6')];var _0x4f11bc;if(_0x2c326c>=_0x5da70c){_0x2c326c=_0x5da70c;_0x4f11bc=0xc8;}else{_0x4f11bc=0xce;}_0x3d2f8d[_0x477d('0x9')](_0x4f11bc);return _0x3d2f8d[_0x477d('0xa')]('Content-Range',_0x29f11b+'-'+_0x2c326c+'/'+_0x5da70c)[_0x477d('0xb')](_0x2545e5);}return null;};}function handleError(_0x3d362a,_0x5a190c){_0x5a190c=_0x5a190c||0x1f4;return function(_0x5dd33c){logger[_0x477d('0xc')](_0x5dd33c[_0x477d('0xd')]);if(_0x5dd33c['name']){delete _0x5dd33c[_0x477d('0xe')];}_0x3d362a[_0x477d('0x9')](_0x5a190c)['send'](_0x5dd33c);};}exports['getQueues']=function(_0x38a0a8,_0x4bbfef){var _0x30481f=[_0x477d('0xf'),_0x477d('0x10'),'sms',_0x477d('0x11'),_0x477d('0x12'),_0x477d('0x13'),_0x477d('0x14')];var _0x57b38e={'count':0x0,'rows':[]},_0x28f17a={},_0x5d5553;Promise[_0x477d('0x15')]()[_0x477d('0x16')](function(){if(_0x38a0a8[_0x477d('0x17')][_0x477d('0x18')]){if(!_[_0x477d('0x19')](_0x30481f,_0x38a0a8[_0x477d('0x17')]['channel'][_0x477d('0x1a')]()))throw new Error('Invalid\x20channel');_0x5d5553=_0x38a0a8[_0x477d('0x17')][_0x477d('0x18')][_0x477d('0x1a')]();}var _0x14cbd5=_[_0x477d('0x1b')](_0x5d5553)+_0x477d('0x1c');var _0x435a3b=_[_0x477d('0x1d')](db[_0x14cbd5][_0x477d('0x1e')],function(_0x5981a){return{'name':_0x5981a[_0x477d('0x1f')],'type':_0x5981a[_0x477d('0x20')][_0x477d('0x21')]};});_0x28f17a=qs[_0x477d('0x22')](_0x435a3b,_0x38a0a8);if(_0x38a0a8['user'][_0x477d('0x23')]==='user'){var _0x239b56={'params':{'id':_0x38a0a8[_0x477d('0x24')][_0x477d('0x25')]},'query':{'section':_0x5d5553===_0x477d('0x14')&&_0x38a0a8['query'][_0x477d('0x20')]===_0x477d('0x26')?_0x477d('0x27'):_['startCase'](_0x5d5553)+'Queues','type':_0x38a0a8[_0x477d('0x17')][_0x477d('0x20')],'nolimit':!![],'sort':_0x477d('0xe'),'filter':_0x38a0a8['query'][_0x477d('0x28')]}};return db[_0x477d('0x29')][_0x477d('0x2a')](_0x239b56);}return db[_0x14cbd5][_0x477d('0x2b')](_0x28f17a);})[_0x477d('0x16')](function(_0x537fc4){_0x57b38e[_0x477d('0x7')]=_0x537fc4[_0x477d('0x7')];var _0x17dd16=_0x5d5553===_0x477d('0x14')?client:routingClient;return _0x17dd16[_0x477d('0x2c')](_[_0x477d('0x1b')](_0x5d5553)+_0x477d('0x2d'),_0x38a0a8)[_0x477d('0x16')](function(_0x204541){if(_0x204541[_0x477d('0xc')])throw new Error(util[_0x477d('0x2e')](_0x477d('0x2f'),_0x5d5553));var _0x138c6d=_0x204541[_0x477d('0x30')];var _0x16042d=[_0x477d('0x31'),_0x477d('0x32'),_0x477d('0x33'),_0x477d('0x34'),_0x477d('0x35')];if(_0x5d5553==='voice'&&_0x38a0a8[_0x477d('0x17')]['type']===_0x477d('0x26')){_0x16042d[_0x477d('0x36')](_0x477d('0x37'),'originated',_0x477d('0x38'),_0x477d('0x39'),_0x477d('0x3a'),_0x477d('0x3b'),_0x477d('0x3c'),_0x477d('0x3d'),_0x477d('0x3e'),_0x477d('0x3f'),_0x477d('0x40'),_0x477d('0x41'),'dialPredictiveInterval',_0x477d('0x42'),_0x477d('0x43'),_0x477d('0x44'),'predictiveIntervalTotalCalls',_0x477d('0x45'),_0x477d('0x46'),_0x477d('0x47'),'predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime');}var _0x21de5c=_0x537fc4[_0x477d('0x48')][_0x477d('0x1d')](function(_0x13ac50){var _0x1c0d86=_0x13ac50['get']({'plain':!![]});_0x1c0d86[_0x477d('0x35')]=0x0;_0x1c0d86['loggedInDb']=0x0;_0x1c0d86[_0x477d('0x31')]=0x0;_0x1c0d86[_0x477d('0x32')]=0x0;_0x1c0d86[_0x477d('0x35')]=0x0;_0x1c0d86['waiting']=0x0;if(_0x5d5553==='voice'){_0x1c0d86[_0x477d('0x34')]=0x0;if(_0x38a0a8[_0x477d('0x17')][_0x477d('0x20')]===_0x477d('0x26')){_0x1c0d86['pTalking']=0x0;_0x1c0d86[_0x477d('0x49')]=0x0;}}_0x1c0d86[_0x477d('0x4a')]=[];var _0x40fdc0=_[_0x477d('0x4b')](_0x138c6d[_0x477d('0x48')],['id',_0x1c0d86['id']]);if(_0x40fdc0)_['merge'](_0x1c0d86,_[_0x477d('0x4c')](_0x40fdc0,_0x16042d));if(_0x5d5553===_0x477d('0x14')){return _0x13ac50['getAgents']({'attributes':['id',_0x477d('0xe'),'online'],'joinTableAttributes':[],'raw':!![]})[_0x477d('0x16')](function(_0x7a5a47){return _0x13ac50[_0x477d('0x4d')]({'raw':!![]})[_0x477d('0x16')](function(_0x1f9552){for(var _0x10bbed=0x0;_0x10bbed<_0x7a5a47[_0x477d('0x4e')];_0x10bbed++){var _0xb94247=_[_0x477d('0x4b')](_0x1f9552,['UserId',_0x7a5a47[_0x10bbed]['id']]);var _0x5759f={'id':_0x7a5a47[_0x10bbed]['id'],'name':_0x7a5a47[_0x10bbed][_0x477d('0xe')],'online':Boolean(_0x7a5a47[_0x10bbed][_0x477d('0x4f')]),'paused':_0xb94247?Boolean(_0xb94247[_0x477d('0x35')]):![]};if(_0x5759f['online'])_0x1c0d86['loggedInDb']++;if(_0x5759f[_0x477d('0x35')])_0x1c0d86[_0x477d('0x35')]++;_0x1c0d86['agents'][_0x477d('0x36')](_0x5759f);}return _0x1c0d86;});});}else{var _0x4fb6f5='User'+_[_0x477d('0x1b')](_0x5d5553)+_0x477d('0x1c');var _0x133b81=_0x5d5553+_0x477d('0x50');return db[_0x4fb6f5][_0x477d('0x51')]({'where':{[_[_0x477d('0x1b')](_0x5d5553)+'QueueId']:_0x13ac50['id']},'raw':!![]})[_0x477d('0x16')](function(_0xed1fb2){return db[_0x477d('0x52')][_0x477d('0x51')]({'attributes':['id',_0x477d('0xe'),'online',_0x133b81],'where':{'id':_['map'](_0xed1fb2,_0x477d('0x53')),'role':_0x477d('0x54')},'raw':!![]});})[_0x477d('0x16')](function(_0x59dc4c){for(var _0x45a5da=0x0;_0x45a5da<_0x59dc4c[_0x477d('0x4e')];_0x45a5da++){var _0x3154da={'id':_0x59dc4c[_0x45a5da]['id'],'name':_0x59dc4c[_0x45a5da][_0x477d('0xe')],'online':Boolean(_0x59dc4c[_0x45a5da][_0x477d('0x4f')]),'paused':Boolean(_0x59dc4c[_0x45a5da][_0x133b81])};if(_0x3154da[_0x477d('0x4f')])_0x1c0d86[_0x477d('0x55')]++;if(_0x3154da['paused'])_0x1c0d86[_0x477d('0x35')]++;_0x1c0d86[_0x477d('0x4a')][_0x477d('0x36')](_0x3154da);}return _0x1c0d86;});}});return Promise[_0x477d('0x56')](_0x21de5c);});})[_0x477d('0x16')](function(_0x32b430){_0x57b38e[_0x477d('0x48')]=_0x32b430;return _0x57b38e;})[_0x477d('0x16')](respondWithFilteredResult(_0x4bbfef,_0x28f17a))[_0x477d('0x57')](handleError(_0x4bbfef,null));}; \ No newline at end of file +var _0xd8fb=['rawAttributes','fieldName','type','key','getOptions','user','role','userProfileId','outbound','QueueCampaigns','Queues','filter','UserProfile','getResources','findAndCountAll','then','count','request','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','loggedIn','available','waiting','talking','push','originated','message','dialActive','dialMethod','Trunk','startProgressive','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','rows','get','paused','loggedInDb','pTalking','agents','find','merge','getAgents','getMembers','length','online','Pause','findAll','QueueId','User','UserId','agent','all','catch','util','lodash','jayson/promise','../../components/parsers/qs','client','http','offset','limit','undefined','set','Content-Range','json','error','stack','name','status','send','getQueues','mail','chat','openchannel','fax','voice','resolve','channel','Invalid\x20channel','query','toLowerCase','startCase','Queue','map'];(function(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0xd8fb,0x99));var _0xbd8f=function(_0x5d57a4,_0x36f48d){_0x5d57a4=_0x5d57a4-0x0;var _0x1edfb8=_0xd8fb[_0x5d57a4];return _0x1edfb8;};'use strict';var util=require(_0xbd8f('0x0'));var _=require(_0xbd8f('0x1'));var jayson=require(_0xbd8f('0x2'));var qs=require(_0xbd8f('0x3'));var logger=require('../../config/logger')('api');var db=require('../../mysqldb')['db'];var client=jayson[_0xbd8f('0x4')][_0xbd8f('0x5')]({'port':0x232a});var routingClient=jayson['client'][_0xbd8f('0x5')]({'port':0x232c});function respondWithFilteredResult(_0x2343bf,_0x5543b2){return function(_0x33d541){if(_0x33d541){var _0x4e97cf=typeof _0x5543b2[_0xbd8f('0x6')]==='undefined'&&typeof _0x5543b2[_0xbd8f('0x7')]===_0xbd8f('0x8');var _0x493298=_0x33d541['count'];var _0x3caa93=_0x4e97cf?0x0:_0x5543b2[_0xbd8f('0x6')];var _0x2a55b5=_0x4e97cf?_0x33d541['count']:_0x5543b2[_0xbd8f('0x6')]+_0x5543b2[_0xbd8f('0x7')];var _0x5b834b;if(_0x2a55b5>=_0x493298){_0x2a55b5=_0x493298;_0x5b834b=0xc8;}else{_0x5b834b=0xce;}_0x2343bf['status'](_0x5b834b);return _0x2343bf[_0xbd8f('0x9')](_0xbd8f('0xa'),_0x3caa93+'-'+_0x2a55b5+'/'+_0x493298)[_0xbd8f('0xb')](_0x33d541);}return null;};}function handleError(_0x5d5705,_0x230988){_0x230988=_0x230988||0x1f4;return function(_0x159f09){logger[_0xbd8f('0xc')](_0x159f09[_0xbd8f('0xd')]);if(_0x159f09[_0xbd8f('0xe')]){delete _0x159f09[_0xbd8f('0xe')];}_0x5d5705[_0xbd8f('0xf')](_0x230988)[_0xbd8f('0x10')](_0x159f09);};}exports[_0xbd8f('0x11')]=function(_0x5e59ae,_0x31573c){var _0x829fb2=[_0xbd8f('0x12'),_0xbd8f('0x13'),'sms',_0xbd8f('0x14'),_0xbd8f('0x15'),'whatsapp',_0xbd8f('0x16')];var _0xf5e7a={'count':0x0,'rows':[]},_0x504adb={},_0x4435b9;Promise[_0xbd8f('0x17')]()['then'](function(){if(_0x5e59ae['query'][_0xbd8f('0x18')]){if(!_['includes'](_0x829fb2,_0x5e59ae['query'][_0xbd8f('0x18')]['toLowerCase']()))throw new Error(_0xbd8f('0x19'));_0x4435b9=_0x5e59ae[_0xbd8f('0x1a')][_0xbd8f('0x18')][_0xbd8f('0x1b')]();}var _0xdc11cc=_[_0xbd8f('0x1c')](_0x4435b9)+_0xbd8f('0x1d');var _0x90eff8=_[_0xbd8f('0x1e')](db[_0xdc11cc][_0xbd8f('0x1f')],function(_0xfe4048){return{'name':_0xfe4048[_0xbd8f('0x20')],'type':_0xfe4048[_0xbd8f('0x21')][_0xbd8f('0x22')]};});_0x504adb=qs[_0xbd8f('0x23')](_0x90eff8,_0x5e59ae);if(_0x5e59ae[_0xbd8f('0x24')][_0xbd8f('0x25')]==='user'){var _0x359ead={'params':{'id':_0x5e59ae[_0xbd8f('0x24')][_0xbd8f('0x26')]},'query':{'section':_0x4435b9===_0xbd8f('0x16')&&_0x5e59ae[_0xbd8f('0x1a')][_0xbd8f('0x21')]===_0xbd8f('0x27')?_0xbd8f('0x28'):_['startCase'](_0x4435b9)+_0xbd8f('0x29'),'type':_0x5e59ae[_0xbd8f('0x1a')]['type'],'nolimit':!![],'sort':_0xbd8f('0xe'),'filter':_0x5e59ae['query'][_0xbd8f('0x2a')]}};return db[_0xbd8f('0x2b')][_0xbd8f('0x2c')](_0x359ead);}return db[_0xdc11cc][_0xbd8f('0x2d')](_0x504adb);})[_0xbd8f('0x2e')](function(_0x247b07){_0xf5e7a['count']=_0x247b07[_0xbd8f('0x2f')];var _0x14f3cb=_0x4435b9===_0xbd8f('0x16')?client:routingClient;return _0x14f3cb[_0xbd8f('0x30')](_[_0xbd8f('0x1c')](_0x4435b9)+_0xbd8f('0x29'),_0x5e59ae)[_0xbd8f('0x2e')](function(_0x479a0c){if(_0x479a0c[_0xbd8f('0xc')])throw new Error(util[_0xbd8f('0x31')](_0xbd8f('0x32'),_0x4435b9));var _0x7ca145=_0x479a0c['result'];var _0x555f4b=[_0xbd8f('0x33'),_0xbd8f('0x34'),_0xbd8f('0x35'),_0xbd8f('0x36'),'paused'];if(_0x4435b9===_0xbd8f('0x16')&&_0x5e59ae[_0xbd8f('0x1a')][_0xbd8f('0x21')]===_0xbd8f('0x27')){_0x555f4b[_0xbd8f('0x37')]('pTalking',_0xbd8f('0x38'),_0xbd8f('0x39'),_0xbd8f('0x3a'),_0xbd8f('0x3b'),_0xbd8f('0x3c'),'startPredictive',_0xbd8f('0x3d'),'erlangCalls',_0xbd8f('0x3e'),_0xbd8f('0x3f'),_0xbd8f('0x40'),_0xbd8f('0x41'),_0xbd8f('0x42'),_0xbd8f('0x43'),'predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls',_0xbd8f('0x44'),_0xbd8f('0x45'),_0xbd8f('0x46'),_0xbd8f('0x47'));}var _0xc0aaee=_0x247b07[_0xbd8f('0x48')][_0xbd8f('0x1e')](function(_0x30c1c2){var _0x2d4882=_0x30c1c2[_0xbd8f('0x49')]({'plain':!![]});_0x2d4882[_0xbd8f('0x4a')]=0x0;_0x2d4882[_0xbd8f('0x4b')]=0x0;_0x2d4882[_0xbd8f('0x33')]=0x0;_0x2d4882[_0xbd8f('0x34')]=0x0;_0x2d4882[_0xbd8f('0x4a')]=0x0;_0x2d4882['waiting']=0x0;if(_0x4435b9===_0xbd8f('0x16')){_0x2d4882[_0xbd8f('0x36')]=0x0;if(_0x5e59ae['query'][_0xbd8f('0x21')]===_0xbd8f('0x27')){_0x2d4882[_0xbd8f('0x4c')]=0x0;_0x2d4882['originated']=0x0;}}_0x2d4882[_0xbd8f('0x4d')]=[];var _0x5d4151=_[_0xbd8f('0x4e')](_0x7ca145[_0xbd8f('0x48')],['id',_0x2d4882['id']]);if(_0x5d4151)_[_0xbd8f('0x4f')](_0x2d4882,_['pick'](_0x5d4151,_0x555f4b));if(_0x4435b9===_0xbd8f('0x16')){return _0x30c1c2[_0xbd8f('0x50')]({'attributes':['id',_0xbd8f('0xe'),'online'],'joinTableAttributes':[],'raw':!![]})[_0xbd8f('0x2e')](function(_0x3d82ef){return _0x30c1c2[_0xbd8f('0x51')]({'raw':!![]})[_0xbd8f('0x2e')](function(_0x280d95){for(var _0x1db8c7=0x0;_0x1db8c7<_0x3d82ef[_0xbd8f('0x52')];_0x1db8c7++){var _0xb453a8=_[_0xbd8f('0x4e')](_0x280d95,['UserId',_0x3d82ef[_0x1db8c7]['id']]);var _0x52c62b={'id':_0x3d82ef[_0x1db8c7]['id'],'name':_0x3d82ef[_0x1db8c7][_0xbd8f('0xe')],'online':Boolean(_0x3d82ef[_0x1db8c7][_0xbd8f('0x53')]),'paused':_0xb453a8?Boolean(_0xb453a8[_0xbd8f('0x4a')]):![]};if(_0x52c62b[_0xbd8f('0x53')])_0x2d4882['loggedInDb']++;if(_0x52c62b[_0xbd8f('0x4a')])_0x2d4882[_0xbd8f('0x4a')]++;_0x2d4882[_0xbd8f('0x4d')][_0xbd8f('0x37')](_0x52c62b);}return _0x2d4882;});});}else{var _0x753f0='User'+_['startCase'](_0x4435b9)+_0xbd8f('0x1d');var _0x490d15=_0x4435b9+_0xbd8f('0x54');return db[_0x753f0][_0xbd8f('0x55')]({'where':{[_[_0xbd8f('0x1c')](_0x4435b9)+_0xbd8f('0x56')]:_0x30c1c2['id']},'raw':!![]})[_0xbd8f('0x2e')](function(_0x151f82){return db[_0xbd8f('0x57')][_0xbd8f('0x55')]({'attributes':['id','name',_0xbd8f('0x53'),_0x490d15],'where':{'id':_[_0xbd8f('0x1e')](_0x151f82,_0xbd8f('0x58')),'role':_0xbd8f('0x59')},'raw':!![]});})[_0xbd8f('0x2e')](function(_0x43298f){for(var _0x272f70=0x0;_0x272f70<_0x43298f[_0xbd8f('0x52')];_0x272f70++){var _0x5668b6={'id':_0x43298f[_0x272f70]['id'],'name':_0x43298f[_0x272f70][_0xbd8f('0xe')],'online':Boolean(_0x43298f[_0x272f70][_0xbd8f('0x53')]),'paused':Boolean(_0x43298f[_0x272f70][_0x490d15])};if(_0x5668b6[_0xbd8f('0x53')])_0x2d4882[_0xbd8f('0x4b')]++;if(_0x5668b6[_0xbd8f('0x4a')])_0x2d4882[_0xbd8f('0x4a')]++;_0x2d4882[_0xbd8f('0x4d')][_0xbd8f('0x37')](_0x5668b6);}return _0x2d4882;});}});return Promise[_0xbd8f('0x5a')](_0xc0aaee);});})[_0xbd8f('0x2e')](function(_0x406741){_0xf5e7a[_0xbd8f('0x48')]=_0x406741;return _0xf5e7a;})[_0xbd8f('0x2e')](respondWithFilteredResult(_0x31573c,_0x504adb))[_0xbd8f('0x5b')](handleError(_0x31573c,null));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 8e4a70e..7597af7 100644 --- a/server/api/reportAgentPreview/index.js +++ b/server/api/reportAgentPreview/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x597f88,_0x338c40){var _0x1ac48a=function(_0x20b20c){while(--_0x20b20c){_0x597f88['push'](_0x597f88['shift']());}};_0x1ac48a(++_0x338c40);}(_0xe706,0xa3));var _0x6e70=function(_0x5aa3e3,_0x5559be){_0x5aa3e3=_0x5aa3e3-0x0;var _0x31f5b9=_0xe706[_0x5aa3e3];return _0x31f5b9;};'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(_0x3c874e,_0x551f01){var _0x5a647b=function(_0x70c339){while(--_0x70c339){_0x3c874e['push'](_0x3c874e['shift']());}};_0x5a647b(++_0x551f01);}(_0xe706,0xa3));var _0x6e70=function(_0x3e9942,_0x12e0e6){_0x3e9942=_0x3e9942-0x0;var _0x2f7e3f=_0xe706[_0x3e9942];return _0x2f7e3f;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index c5b80ad..a0509ff 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 _0xb2ac=['STRING','DATE','sequelize','exports','INTEGER'];(function(_0x5735c6,_0x3d5b17){var _0x180e61=function(_0x5250fa){while(--_0x5250fa){_0x5735c6['push'](_0x5735c6['shift']());}};_0x180e61(++_0x3d5b17);}(_0xb2ac,0x16a));var _0xcb2a=function(_0x3ee215,_0x3aca45){_0x3ee215=_0x3ee215-0x0;var _0x21a808=_0xb2ac[_0x3ee215];return _0x21a808;};'use strict';var Sequelize=require(_0xcb2a('0x0'));module[_0xcb2a('0x1')]={'state':{'type':Sequelize[_0xcb2a('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xcb2a('0x3')]},'scheduledat':{'type':Sequelize[_0xcb2a('0x4')]},'uniqueid':{'type':Sequelize[_0xcb2a('0x3')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0xcb2a('0x4')]},'ringtime':{'type':Sequelize[_0xcb2a('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xcb2a('0x3')]},'campaigntype':{'type':Sequelize[_0xcb2a('0x3')]},'membername':{'type':Sequelize[_0xcb2a('0x3')]}}; \ No newline at end of file +var _0x103f=['INTEGER','STRING','DATE','sequelize','exports'];(function(_0x6e1239,_0x3562ac){var _0x418150=function(_0x279f06){while(--_0x279f06){_0x6e1239['push'](_0x6e1239['shift']());}};_0x418150(++_0x3562ac);}(_0x103f,0x13e));var _0xf103=function(_0xc8aa9b,_0x122b00){_0xc8aa9b=_0xc8aa9b-0x0;var _0x5cd9b2=_0x103f[_0xc8aa9b];return _0x5cd9b2;};'use strict';var Sequelize=require(_0xf103('0x0'));module[_0xf103('0x1')]={'state':{'type':Sequelize[_0xf103('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xf103('0x3')]},'scheduledat':{'type':Sequelize[_0xf103('0x4')]},'uniqueid':{'type':Sequelize[_0xf103('0x3')]},'starttime':{'type':Sequelize[_0xf103('0x4')]},'responsetime':{'type':Sequelize[_0xf103('0x4')]},'ringtime':{'type':Sequelize[_0xf103('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xf103('0x3')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xf103('0x3')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index 49b478c..9d1c6e2 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 _0xa30c=['api','moment','bluebird','request-promise','path','./reportAgentPreview.attributes','exports','define','ReportAgentPreview','report_agent_preview','lodash','util','../../config/logger'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa30c,0x10e));var _0xca30=function(_0x20d52c,_0x4bf9a7){_0x20d52c=_0x20d52c-0x0;var _0x5f253e=_0xa30c[_0x20d52c];return _0x5f253e;};'use strict';var _=require(_0xca30('0x0'));var util=require(_0xca30('0x1'));var logger=require(_0xca30('0x2'))(_0xca30('0x3'));var moment=require(_0xca30('0x4'));var BPromise=require(_0xca30('0x5'));var rp=require(_0xca30('0x6'));var fs=require('fs');var path=require(_0xca30('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xca30('0x8'));module[_0xca30('0x9')]=function(_0x1f226b,_0x558e9f){return _0x1f226b[_0xca30('0xa')](_0xca30('0xb'),attributes,{'tableName':_0xca30('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4229=['report_agent_preview','util','../../config/logger','api','moment','bluebird','path','exports','define','ReportAgentPreview'];(function(_0x17c542,_0x41a04b){var _0x29e2fc=function(_0x5a9ffa){while(--_0x5a9ffa){_0x17c542['push'](_0x17c542['shift']());}};_0x29e2fc(++_0x41a04b);}(_0x4229,0x83));var _0x9422=function(_0x5d6f87,_0x39026d){_0x5d6f87=_0x5d6f87-0x0;var _0x4b9208=_0x4229[_0x5d6f87];return _0x4b9208;};'use strict';var _=require('lodash');var util=require(_0x9422('0x0'));var logger=require(_0x9422('0x1'))(_0x9422('0x2'));var moment=require(_0x9422('0x3'));var BPromise=require(_0x9422('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9422('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./reportAgentPreview.attributes');module[_0x9422('0x6')]=function(_0x21909f,_0x1af42c){return _0x21909f[_0x9422('0x7')](_0x9422('0x8'),attributes,{'tableName':_0x9422('0x9'),'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 f53d53b..947632f 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 _0x5122=['../../config/utils','rpc','../../config/environment','jayson/promise','client','request','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','CreateReportAgentPreview','ReportAgentPreview','create','body','options','raw','then','lodash','moment','bluebird','ioredis','../../mysqldb'];(function(_0xae3f70,_0x559b2a){var _0x1593e9=function(_0x1fd717){while(--_0x1fd717){_0xae3f70['push'](_0xae3f70['shift']());}};_0x1593e9(++_0x559b2a);}(_0x5122,0x12f));var _0x2512=function(_0x89e913,_0x2273e2){_0x89e913=_0x89e913-0x0;var _0x1e2d4c=_0x5122[_0x89e913];return _0x1e2d4c;};'use strict';var _=require(_0x2512('0x0'));var util=require('util');var moment=require(_0x2512('0x1'));var BPromise=require(_0x2512('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2512('0x3'));var db=require(_0x2512('0x4'))['db'];var utils=require(_0x2512('0x5'));var logger=require('../../config/logger')(_0x2512('0x6'));var config=require(_0x2512('0x7'));var jayson=require(_0x2512('0x8'));var client=jayson[_0x2512('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5c17e6,_0x3a9830,_0x315800){return new BPromise(function(_0x586082,_0x12fef8){return client[_0x2512('0xa')](_0x5c17e6,_0x315800)['then'](function(_0x2ae87b){logger[_0x2512('0xb')](_0x2512('0xc'),_0x3a9830,_0x2512('0xd'));logger[_0x2512('0xe')](_0x2512('0xf'),_0x3a9830,_0x2512('0xd'),JSON['stringify'](_0x2ae87b));if(_0x2ae87b['error']){if(_0x2ae87b['error'][_0x2512('0x10')]===0x1f4){logger[_0x2512('0x11')](_0x2512('0xc'),_0x3a9830,_0x2ae87b[_0x2512('0x11')][_0x2512('0x12')]);return _0x12fef8(_0x2ae87b[_0x2512('0x11')][_0x2512('0x12')]);}logger[_0x2512('0x11')](_0x2512('0xc'),_0x3a9830,_0x2ae87b['error'][_0x2512('0x12')]);return _0x586082(_0x2ae87b['error'][_0x2512('0x12')]);}else{logger[_0x2512('0xb')](_0x2512('0xc'),_0x3a9830,_0x2512('0xd'));_0x586082(_0x2ae87b[_0x2512('0x13')][_0x2512('0x12')]);}})[_0x2512('0x14')](function(_0xa3c987){logger[_0x2512('0x11')]('ReportAgentPreview,\x20%s,\x20%s',_0x3a9830,_0xa3c987);_0x12fef8(_0xa3c987);});});}exports[_0x2512('0x15')]=function(_0x34f2c3){var _0x2ab6b8=this;return new Promise(function(_0x42f36f,_0x56149a){return db[_0x2512('0x16')][_0x2512('0x17')](_0x34f2c3[_0x2512('0x18')],{'raw':_0x34f2c3[_0x2512('0x19')]?_0x34f2c3[_0x2512('0x19')][_0x2512('0x1a')]===undefined?!![]:![]:!![]})[_0x2512('0x1b')](function(_0x27a5d6){logger[_0x2512('0xb')]('CreateReportAgentPreview',_0x34f2c3);logger['debug'](_0x2512('0x15'),_0x34f2c3,JSON['stringify'](_0x27a5d6));_0x42f36f(_0x27a5d6);})[_0x2512('0x14')](function(_0x3e6a9e){logger['error'](_0x2512('0x15'),_0x3e6a9e[_0x2512('0x12')],_0x34f2c3);_0x56149a(_0x2ab6b8[_0x2512('0x11')](0x1f4,_0x3e6a9e[_0x2512('0x12')]));});});}; \ No newline at end of file +var _0xab76=['ReportAgentPreview','body','options','raw','CreateReportAgentPreview','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','ReportAgentPreview,\x20%s,\x20%s','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x11c573,_0x9e7c6e){var _0x6b72de=function(_0x2e8a61){while(--_0x2e8a61){_0x11c573['push'](_0x11c573['shift']());}};_0x6b72de(++_0x9e7c6e);}(_0xab76,0x96));var _0x6ab7=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0xab76[_0x2d7f0e];return _0x110b07;};'use strict';var _=require(_0x6ab7('0x0'));var util=require(_0x6ab7('0x1'));var moment=require(_0x6ab7('0x2'));var BPromise=require(_0x6ab7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6ab7('0x4'));var db=require(_0x6ab7('0x5'))['db'];var utils=require(_0x6ab7('0x6'));var logger=require(_0x6ab7('0x7'))(_0x6ab7('0x8'));var config=require('../../config/environment');var jayson=require(_0x6ab7('0x9'));var client=jayson[_0x6ab7('0xa')][_0x6ab7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1f6e94,_0x1d0066,_0x36ec19){return new BPromise(function(_0x4df11d,_0x2a057a){return client['request'](_0x1f6e94,_0x36ec19)[_0x6ab7('0xc')](function(_0x4c5850){logger[_0x6ab7('0xd')](_0x6ab7('0xe'),_0x1d0066,'request\x20sent');logger[_0x6ab7('0xf')](_0x6ab7('0x10'),_0x1d0066,_0x6ab7('0x11'),JSON[_0x6ab7('0x12')](_0x4c5850));if(_0x4c5850['error']){if(_0x4c5850[_0x6ab7('0x13')][_0x6ab7('0x14')]===0x1f4){logger['error'](_0x6ab7('0xe'),_0x1d0066,_0x4c5850['error'][_0x6ab7('0x15')]);return _0x2a057a(_0x4c5850[_0x6ab7('0x13')][_0x6ab7('0x15')]);}logger['error'](_0x6ab7('0xe'),_0x1d0066,_0x4c5850[_0x6ab7('0x13')][_0x6ab7('0x15')]);return _0x4df11d(_0x4c5850[_0x6ab7('0x13')][_0x6ab7('0x15')]);}else{logger['info'](_0x6ab7('0xe'),_0x1d0066,_0x6ab7('0x11'));_0x4df11d(_0x4c5850[_0x6ab7('0x16')][_0x6ab7('0x15')]);}})[_0x6ab7('0x17')](function(_0x16a18a){logger['error']('ReportAgentPreview,\x20%s,\x20%s',_0x1d0066,_0x16a18a);_0x2a057a(_0x16a18a);});});}exports['CreateReportAgentPreview']=function(_0x21b616){var _0x3830e6=this;return new Promise(function(_0x240d68,_0x13111a){return db[_0x6ab7('0x18')]['create'](_0x21b616[_0x6ab7('0x19')],{'raw':_0x21b616[_0x6ab7('0x1a')]?_0x21b616[_0x6ab7('0x1a')][_0x6ab7('0x1b')]===undefined?!![]:![]:!![]})[_0x6ab7('0xc')](function(_0x1ed7e5){logger[_0x6ab7('0xd')](_0x6ab7('0x1c'),_0x21b616);logger['debug']('CreateReportAgentPreview',_0x21b616,JSON[_0x6ab7('0x12')](_0x1ed7e5));_0x240d68(_0x1ed7e5);})[_0x6ab7('0x17')](function(_0x21ff3c){logger[_0x6ab7('0x13')](_0x6ab7('0x1c'),_0x21ff3c['message'],_0x21b616);_0x13111a(_0x3830e6[_0x6ab7('0x13')](0x1f4,_0x21ff3c['message']));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index fc62061..11649b6 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 _0x16bc=['faxQueues','/voice/queues/preview/:id','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','updateVoiceQueue','outbound','outboundChannels','/agents','agents','/agents/:id/capacity','agentCapacity','telephones','/trunks','trunks','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','/chat/queues/:id/notify','chat','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','/sms/queues/:id/notify','/whatsapp/queues/:id/notify','whatsapp','/whatsapp/queues/:id','/agents/:id/notify','agentNotify','exports','multer','path','../../components/auth/service','./rpc.controller','/voice/channels','isAuthenticated','get','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','/mail/queues','/mail/accounts','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','whatsappQueues','/fax/queues'];(function(_0x62c995,_0x4ffac5){var _0x5e6f75=function(_0xf645b3){while(--_0xf645b3){_0x62c995['push'](_0x62c995['shift']());}};_0x5e6f75(++_0x4ffac5);}(_0x16bc,0x11e));var _0xc16b=function(_0x2330c5,_0x5ddb84){_0x2330c5=_0x2330c5-0x0;var _0x48133d=_0x16bc[_0x2330c5];return _0x48133d;};'use strict';var multer=require(_0xc16b('0x0'));var util=require('util');var path=require(_0xc16b('0x1'));var express=require('express');var router=express['Router']();var auth=require(_0xc16b('0x2'));var controller=require(_0xc16b('0x3'));router['get'](_0xc16b('0x4'),auth[_0xc16b('0x5')](),controller['voiceChannels']);router[_0xc16b('0x6')](_0xc16b('0x7'),auth[_0xc16b('0x5')](),controller[_0xc16b('0x8')]);router[_0xc16b('0x6')](_0xc16b('0x9'),auth[_0xc16b('0x5')](),controller['voiceChannelStopMixMonitor']);router[_0xc16b('0x6')](_0xc16b('0xa'),auth[_0xc16b('0x5')](),controller[_0xc16b('0xb')]);router[_0xc16b('0x6')](_0xc16b('0xc'),auth[_0xc16b('0x5')](),controller[_0xc16b('0xd')]);router[_0xc16b('0x6')](_0xc16b('0xe'),auth[_0xc16b('0x5')](),controller['mailQueues']);router['get'](_0xc16b('0xf'),auth[_0xc16b('0x5')](),controller['mailAccounts']);router[_0xc16b('0x6')](_0xc16b('0x10'),auth[_0xc16b('0x5')](),controller[_0xc16b('0x11')]);router['get'](_0xc16b('0x12'),auth[_0xc16b('0x5')](),controller[_0xc16b('0x13')]);router[_0xc16b('0x6')]('/whatsapp/queues',auth[_0xc16b('0x5')](),controller[_0xc16b('0x14')]);router['get'](_0xc16b('0x15'),auth[_0xc16b('0x5')](),controller[_0xc16b('0x16')]);router[_0xc16b('0x6')](_0xc16b('0x17'),auth['isAuthenticated'](),controller['voiceQueuesPreview']);router[_0xc16b('0x6')](_0xc16b('0x18'),auth[_0xc16b('0x5')](),controller[_0xc16b('0x19')]);router[_0xc16b('0x6')](_0xc16b('0x1a'),auth[_0xc16b('0x5')](),controller[_0xc16b('0x1b')]);router[_0xc16b('0x6')](_0xc16b('0x1c'),auth[_0xc16b('0x5')](),controller['voiceQueuesChannelHangup']);router[_0xc16b('0x6')](_0xc16b('0x1d'),auth[_0xc16b('0x5')](),controller[_0xc16b('0x1e')]);router[_0xc16b('0x6')](_0xc16b('0x1f'),auth[_0xc16b('0x5')](),controller['showVoiceQueues']);router['put'](_0xc16b('0x1f'),auth[_0xc16b('0x5')](),controller[_0xc16b('0x20')]);router[_0xc16b('0x6')]('/outbound',auth[_0xc16b('0x5')](),controller[_0xc16b('0x21')]);router[_0xc16b('0x6')]('/outbound/channels',auth['isAuthenticated'](),controller[_0xc16b('0x22')]);router['get'](_0xc16b('0x23'),auth['isAuthenticated'](),controller[_0xc16b('0x24')]);router['put'](_0xc16b('0x25'),auth[_0xc16b('0x5')](),controller[_0xc16b('0x26')]);router[_0xc16b('0x6')]('/telephones',auth[_0xc16b('0x5')](),controller[_0xc16b('0x27')]);router[_0xc16b('0x6')](_0xc16b('0x28'),auth[_0xc16b('0x5')](),controller[_0xc16b('0x29')]);router[_0xc16b('0x6')]('/campaigns',auth[_0xc16b('0x5')](),controller[_0xc16b('0x2a')]);router['get'](_0xc16b('0x2b'),auth[_0xc16b('0x5')](),controller[_0xc16b('0x2c')]);router[_0xc16b('0x6')](_0xc16b('0x2d'),auth[_0xc16b('0x5')](),controller['chatQueuesWaitingInteractions']);router[_0xc16b('0x6')]('/mail/queues/waitinginteractions',auth[_0xc16b('0x5')](),controller[_0xc16b('0x2e')]);router[_0xc16b('0x6')](_0xc16b('0x2f'),auth[_0xc16b('0x5')](),controller[_0xc16b('0x30')]);router[_0xc16b('0x6')]('/openchannel/queues/:id/waitinginteractions',auth[_0xc16b('0x5')](),controller[_0xc16b('0x31')]);router[_0xc16b('0x6')](_0xc16b('0x32'),auth[_0xc16b('0x5')](),controller['smsQueuesWaitingInteractions']);router['get'](_0xc16b('0x33'),auth[_0xc16b('0x5')](),controller[_0xc16b('0x34')]);router['get'](_0xc16b('0x35'),auth['isAuthenticated'](),controller[_0xc16b('0x36')]);router[_0xc16b('0x37')](_0xc16b('0x38'),auth['isAuthenticated'](),controller[_0xc16b('0x39')](_0xc16b('0x3a')));router[_0xc16b('0x6')](_0xc16b('0x3b'),auth[_0xc16b('0x5')](),controller['showMailQueues']);router['post'](_0xc16b('0x3c'),auth['isAuthenticated'](),controller[_0xc16b('0x39')](_0xc16b('0x3d')));router[_0xc16b('0x6')](_0xc16b('0x3e'),auth['isAuthenticated'](),controller[_0xc16b('0x3f')]);router['post'](_0xc16b('0x40'),auth[_0xc16b('0x5')](),controller['queueNotify'](_0xc16b('0x41')));router['get'](_0xc16b('0x42'),auth['isAuthenticated'](),controller['showFaxQueues']);router['post'](_0xc16b('0x43'),auth[_0xc16b('0x5')](),controller[_0xc16b('0x39')](_0xc16b('0x44')));router[_0xc16b('0x6')](_0xc16b('0x45'),auth['isAuthenticated'](),controller['showOpenchannelQueues']);router[_0xc16b('0x37')](_0xc16b('0x46'),auth['isAuthenticated'](),controller['queueNotify']('sms'));router[_0xc16b('0x37')](_0xc16b('0x47'),auth[_0xc16b('0x5')](),controller[_0xc16b('0x39')](_0xc16b('0x48')));router[_0xc16b('0x6')]('/sms/queues/:id',auth[_0xc16b('0x5')](),controller['showSmsQueues']);router['get'](_0xc16b('0x49'),auth[_0xc16b('0x5')](),controller['showWhatsappQueues']);router[_0xc16b('0x37')](_0xc16b('0x4a'),auth[_0xc16b('0x5')](),controller[_0xc16b('0x4b')]);module[_0xc16b('0x4c')]=router; \ No newline at end of file +var _0x1b72=['/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','queueNotify','mail','/mail/queues/:id','showMailQueues','chat','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','showWhatsappQueues','agentNotify','exports','util','path','Router','../../components/auth/service','get','/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','mailQueues','/mail/accounts','mailAccounts','openchannelQueues','whatsappQueues','/fax/queues','faxQueues','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','/voice/queues/channels/:uniqueid/hangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','/outbound','outbound','outboundChannels','agents','/agents/:id/capacity','/trunks','trunks','/campaigns','campaigns','/fax/accounts','/chat/queues/waitinginteractions','/mail/queues/waitinginteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions'];(function(_0x1b5480,_0x3f117a){var _0x244c85=function(_0x3883b4){while(--_0x3883b4){_0x1b5480['push'](_0x1b5480['shift']());}};_0x244c85(++_0x3f117a);}(_0x1b72,0x67));var _0x21b7=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0x1b72[_0xc4001c];return _0x49f7bc;};'use strict';var multer=require('multer');var util=require(_0x21b7('0x0'));var path=require(_0x21b7('0x1'));var express=require('express');var router=express[_0x21b7('0x2')]();var auth=require(_0x21b7('0x3'));var controller=require('./rpc.controller');router[_0x21b7('0x4')](_0x21b7('0x5'),auth[_0x21b7('0x6')](),controller[_0x21b7('0x7')]);router['get'](_0x21b7('0x8'),auth['isAuthenticated'](),controller[_0x21b7('0x9')]);router[_0x21b7('0x4')]('/voice/channels/:uniqueid/stopmixmonitor',auth[_0x21b7('0x6')](),controller[_0x21b7('0xa')]);router['get'](_0x21b7('0xb'),auth['isAuthenticated'](),controller[_0x21b7('0xc')]);router['get'](_0x21b7('0xd'),auth[_0x21b7('0x6')](),controller[_0x21b7('0xe')]);router['get']('/mail/queues',auth['isAuthenticated'](),controller[_0x21b7('0xf')]);router[_0x21b7('0x4')](_0x21b7('0x10'),auth[_0x21b7('0x6')](),controller[_0x21b7('0x11')]);router[_0x21b7('0x4')]('/openchannel/queues',auth[_0x21b7('0x6')](),controller[_0x21b7('0x12')]);router[_0x21b7('0x4')]('/sms/queues',auth[_0x21b7('0x6')](),controller['smsQueues']);router[_0x21b7('0x4')]('/whatsapp/queues',auth[_0x21b7('0x6')](),controller[_0x21b7('0x13')]);router[_0x21b7('0x4')](_0x21b7('0x14'),auth[_0x21b7('0x6')](),controller[_0x21b7('0x15')]);router[_0x21b7('0x4')]('/voice/queues/preview/:id',auth[_0x21b7('0x6')](),controller['voiceQueuesPreview']);router[_0x21b7('0x4')](_0x21b7('0x16'),auth['isAuthenticated'](),controller[_0x21b7('0x17')]);router[_0x21b7('0x4')](_0x21b7('0x18'),auth['isAuthenticated'](),controller['voiceQueuesChannel']);router[_0x21b7('0x4')](_0x21b7('0x19'),auth['isAuthenticated'](),controller['voiceQueuesChannelHangup']);router[_0x21b7('0x4')](_0x21b7('0x1a'),auth[_0x21b7('0x6')](),controller[_0x21b7('0x1b')]);router[_0x21b7('0x4')](_0x21b7('0x1c'),auth[_0x21b7('0x6')](),controller[_0x21b7('0x1d')]);router['put'](_0x21b7('0x1c'),auth[_0x21b7('0x6')](),controller['updateVoiceQueue']);router[_0x21b7('0x4')](_0x21b7('0x1e'),auth[_0x21b7('0x6')](),controller[_0x21b7('0x1f')]);router[_0x21b7('0x4')]('/outbound/channels',auth[_0x21b7('0x6')](),controller[_0x21b7('0x20')]);router[_0x21b7('0x4')]('/agents',auth[_0x21b7('0x6')](),controller[_0x21b7('0x21')]);router['put'](_0x21b7('0x22'),auth[_0x21b7('0x6')](),controller['agentCapacity']);router[_0x21b7('0x4')]('/telephones',auth[_0x21b7('0x6')](),controller['telephones']);router[_0x21b7('0x4')](_0x21b7('0x23'),auth['isAuthenticated'](),controller[_0x21b7('0x24')]);router[_0x21b7('0x4')](_0x21b7('0x25'),auth[_0x21b7('0x6')](),controller[_0x21b7('0x26')]);router[_0x21b7('0x4')](_0x21b7('0x27'),auth[_0x21b7('0x6')](),controller['faxAccounts']);router[_0x21b7('0x4')](_0x21b7('0x28'),auth[_0x21b7('0x6')](),controller['chatQueuesWaitingInteractions']);router[_0x21b7('0x4')](_0x21b7('0x29'),auth[_0x21b7('0x6')](),controller['mailQueuesWaitingInteractions']);router[_0x21b7('0x4')](_0x21b7('0x2a'),auth['isAuthenticated'](),controller[_0x21b7('0x2b')]);router[_0x21b7('0x4')]('/openchannel/queues/:id/waitinginteractions',auth[_0x21b7('0x6')](),controller[_0x21b7('0x2c')]);router[_0x21b7('0x4')](_0x21b7('0x2d'),auth['isAuthenticated'](),controller[_0x21b7('0x2e')]);router[_0x21b7('0x4')](_0x21b7('0x2f'),auth[_0x21b7('0x6')](),controller[_0x21b7('0x30')]);router[_0x21b7('0x4')](_0x21b7('0x31'),auth[_0x21b7('0x6')](),controller[_0x21b7('0x32')]);router[_0x21b7('0x33')]('/mail/queues/:id/notify',auth[_0x21b7('0x6')](),controller[_0x21b7('0x34')](_0x21b7('0x35')));router[_0x21b7('0x4')](_0x21b7('0x36'),auth[_0x21b7('0x6')](),controller[_0x21b7('0x37')]);router['post']('/chat/queues/:id/notify',auth['isAuthenticated'](),controller[_0x21b7('0x34')](_0x21b7('0x38')));router[_0x21b7('0x4')]('/chat/queues/:id',auth['isAuthenticated'](),controller[_0x21b7('0x39')]);router[_0x21b7('0x33')](_0x21b7('0x3a'),auth['isAuthenticated'](),controller[_0x21b7('0x34')](_0x21b7('0x3b')));router['get'](_0x21b7('0x3c'),auth[_0x21b7('0x6')](),controller[_0x21b7('0x3d')]);router['post'](_0x21b7('0x3e'),auth[_0x21b7('0x6')](),controller[_0x21b7('0x34')](_0x21b7('0x3f')));router[_0x21b7('0x4')](_0x21b7('0x40'),auth[_0x21b7('0x6')](),controller['showOpenchannelQueues']);router['post'](_0x21b7('0x41'),auth['isAuthenticated'](),controller['queueNotify'](_0x21b7('0x42')));router['post'](_0x21b7('0x43'),auth[_0x21b7('0x6')](),controller[_0x21b7('0x34')](_0x21b7('0x44')));router[_0x21b7('0x4')](_0x21b7('0x45'),auth[_0x21b7('0x6')](),controller[_0x21b7('0x46')]);router['get']('/whatsapp/queues/:id',auth[_0x21b7('0x6')](),controller[_0x21b7('0x47')]);router[_0x21b7('0x33')]('/agents/:id/notify',auth[_0x21b7('0x6')](),controller[_0x21b7('0x48')]);module[_0x21b7('0x49')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index 5aa0430..27eb08a 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 _0xabce=['InteractionId','From','QueueId','TransferReport','create','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','Agent\x20not\x20found','update','agentTransferTimeout','bluebird','moment','lodash','util','../../mysqldb','jayson/promise','client','http','request','then','error','code','message','result','catch','json','sendStatus','stack','name','status','send','isNil','rows','find','voiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','VoiceQueues','showVoiceQueues','UpdateVoiceQueue','body','voiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','Outbound','OutboundChannels','Agents','agentCapacity','interaction','MemberReport','findAll','user','INTERACTION','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','findOrCreate','interface','agent','internal','AgentCapacity','telephones','Telephones','trunks','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','whatsappQueues','showWhatsappQueues','FaxAccounts','MailQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','map','value','indexOf','queue_id','filter','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Account','Queue','findOne','\x20Queue\x20not\x20found','Message','messageId','Interaction','queue','MessageId'];(function(_0x2e1b3f,_0x5bbe92){var _0x202a55=function(_0x32c677){while(--_0x32c677){_0x2e1b3f['push'](_0x2e1b3f['shift']());}};_0x202a55(++_0x5bbe92);}(_0xabce,0x103));var _0xeabc=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xabce[_0x5c3c0b];return _0x52ecd2;};'use strict';var BPromise=require(_0xeabc('0x0'));var moment=require(_0xeabc('0x1'));var _=require(_0xeabc('0x2'));var util=require(_0xeabc('0x3'));var db=require(_0xeabc('0x4'))['db'];var logger=require('../../config/logger')('api');var jayson=require(_0xeabc('0x5'));var amiClient=jayson[_0xeabc('0x6')][_0xeabc('0x7')]({'port':0x232a});var mailClient=jayson['client']['http']({'port':0x232b});var routingClient=jayson[_0xeabc('0x6')]['http']({'port':0x232c});function respondWithRpcPromise(_0x229ba4,_0x52ede8,_0x3bdc29){return new BPromise(function(_0x9417af,_0x8434c5){var _0x5d59d5=_0x3bdc29?_0x3bdc29:amiClient;return _0x5d59d5[_0xeabc('0x8')](_0x229ba4,_0x52ede8)[_0xeabc('0x9')](function(_0x2f73e9){if(_0x2f73e9[_0xeabc('0xa')]){if(_0x2f73e9[_0xeabc('0xa')][_0xeabc('0xb')]===0x1f4){return _0x8434c5(_0x2f73e9[_0xeabc('0xa')][_0xeabc('0xc')]);}return _0x9417af(_0x2f73e9[_0xeabc('0xa')][_0xeabc('0xc')]);}else{_0x9417af(_0x2f73e9[_0xeabc('0xd')]);}})[_0xeabc('0xe')](function(_0x435ea7){_0x8434c5(_0x435ea7);});});}function respondWithResult(_0x3fd0b5,_0x36a92e){_0x36a92e=_0x36a92e||0xc8;return function(_0xcfbf06){if(_0xcfbf06){return _0x3fd0b5['status'](_0x36a92e)[_0xeabc('0xf')](_0xcfbf06);}return _0x3fd0b5[_0xeabc('0x10')](0x194);};}function handleError(_0x3251c6,_0x55f0de){_0x55f0de=_0x55f0de||0x1f4;return function(_0x5f4ee8){logger[_0xeabc('0xa')](_0x5f4ee8[_0xeabc('0x11')]);if(_0x5f4ee8[_0xeabc('0x12')]){delete _0x5f4ee8['name'];}_0x3251c6[_0xeabc('0x13')](_0x55f0de)[_0xeabc('0x14')](_0x5f4ee8);};}function findById(_0x49f2d8){return function(_0x53fe28){if(!_[_0xeabc('0x15')](_0x49f2d8)&&!_['isNil'](_0x53fe28)&&!_[_0xeabc('0x15')](_0x53fe28[_0xeabc('0x16')])){return _[_0xeabc('0x17')](_0x53fe28[_0xeabc('0x16')],function(_0x31dd53){return _0x31dd53['id']==_0x49f2d8;});}return null;};}exports[_0xeabc('0x18')]=function(_0x384be5,_0x5e30ee){return respondWithRpcPromise('VoiceChannels',_0x384be5[_0xeabc('0x19')])['then'](respondWithResult(_0x5e30ee,null))[_0xeabc('0xe')](handleError(_0x5e30ee,null));};exports[_0xeabc('0x1a')]=function(_0x502947,_0x28063a){return respondWithRpcPromise(_0xeabc('0x1b'),_[_0xeabc('0x1c')](_0x502947[_0xeabc('0x19')],_0x502947[_0xeabc('0x1d')]))['then'](respondWithResult(_0x28063a,null))[_0xeabc('0xe')](handleError(_0x28063a,null));};exports[_0xeabc('0x1e')]=function(_0x91ab00,_0x5bdd57){return respondWithRpcPromise(_0xeabc('0x1f'),_[_0xeabc('0x1c')](_0x91ab00[_0xeabc('0x19')],_0x91ab00[_0xeabc('0x1d')]))['then'](respondWithResult(_0x5bdd57,null))[_0xeabc('0xe')](handleError(_0x5bdd57,null));};exports['voiceQueues']=function(_0x27dbaf,_0x4d4e29){return respondWithRpcPromise(_0xeabc('0x20'),_0x27dbaf[_0xeabc('0x19')])[_0xeabc('0x9')](respondWithResult(_0x4d4e29,null))[_0xeabc('0xe')](handleError(_0x4d4e29,null));};exports[_0xeabc('0x21')]=function(_0x137293,_0x131722){return respondWithRpcPromise('VoiceQueues',_0x137293['query'])[_0xeabc('0x9')](findById(_0x137293['params']['id']))[_0xeabc('0x9')](respondWithResult(_0x131722,null))[_0xeabc('0xe')](handleError(_0x131722,null));};exports['updateVoiceQueue']=function(_0x2163e6,_0x38572d){return respondWithRpcPromise(_0xeabc('0x22'),_[_0xeabc('0x1c')](_0x2163e6[_0xeabc('0x23')],_0x2163e6[_0xeabc('0x1d')]))[_0xeabc('0x9')](respondWithResult(_0x38572d,null))[_0xeabc('0xe')](handleError(_0x38572d,null));};exports[_0xeabc('0x24')]=function(_0x5ebb86,_0x5b34dd){return respondWithRpcPromise('VoiceQueuesPreview',_[_0xeabc('0x1c')](_0x5ebb86[_0xeabc('0x19')],_0x5ebb86[_0xeabc('0x1d')]))[_0xeabc('0x9')](respondWithResult(_0x5b34dd,null))[_0xeabc('0xe')](handleError(_0x5b34dd,null));};exports[_0xeabc('0x25')]=function(_0x61c0af,_0x545d7f){return respondWithRpcPromise(_0xeabc('0x26'),_0x61c0af[_0xeabc('0x19')])[_0xeabc('0x9')](respondWithResult(_0x545d7f,null))['catch'](handleError(_0x545d7f,null));};exports[_0xeabc('0x27')]=function(_0x3777c1,_0x4492fd){return respondWithRpcPromise('VoiceQueuesChannel',_[_0xeabc('0x1c')](_0x3777c1[_0xeabc('0x19')],_0x3777c1[_0xeabc('0x1d')]))['then'](respondWithResult(_0x4492fd,null))[_0xeabc('0xe')](handleError(_0x4492fd,null));};exports[_0xeabc('0x28')]=function(_0x5d9acf,_0x50cca2){return respondWithRpcPromise(_0xeabc('0x29'),_[_0xeabc('0x1c')](_0x5d9acf['query'],_0x5d9acf[_0xeabc('0x1d')]))[_0xeabc('0x9')](respondWithResult(_0x50cca2,null))[_0xeabc('0xe')](handleError(_0x50cca2,null));};exports[_0xeabc('0x2a')]=function(_0x34057c,_0x4b7923){return respondWithRpcPromise(_0xeabc('0x2b'),_['merge'](_0x34057c[_0xeabc('0x19')],_0x34057c[_0xeabc('0x1d')]))[_0xeabc('0x9')](respondWithResult(_0x4b7923,null))['catch'](handleError(_0x4b7923,null));};exports['outbound']=function(_0x452580,_0x560d4a){return respondWithRpcPromise(_0xeabc('0x2c'),_0x452580['query'])['then'](respondWithResult(_0x560d4a,null))['catch'](handleError(_0x560d4a,null));};exports['outboundChannels']=function(_0x1e222a,_0x593588){return respondWithRpcPromise(_0xeabc('0x2d'),_0x1e222a[_0xeabc('0x19')])['then'](respondWithResult(_0x593588,null))[_0xeabc('0xe')](handleError(_0x593588,null));};exports['agents']=function(_0x3d48f4,_0x58aafe){var _0xbd7f03;return respondWithRpcPromise(_0xeabc('0x2e'),_0x3d48f4[_0xeabc('0x19')])['then'](function(_0x5a00d0){_0xbd7f03=_0x5a00d0;return respondWithRpcPromise('Agents',_0x3d48f4[_0xeabc('0x19')],routingClient);})[_0xeabc('0x9')](function(_0xafa59b){return _['merge']({},_0xafa59b,_0xbd7f03);})['then'](respondWithResult(_0x58aafe,null))[_0xeabc('0xe')](handleError(_0x58aafe,null));};exports[_0xeabc('0x2f')]=function(_0x5e9cb3,_0xc6af4d){if(_0x5e9cb3['body']&&_0x5e9cb3[_0xeabc('0x23')]['interaction']&&_0x5e9cb3['user']&&_0x5e9cb3['user'][_0xeabc('0x12')]){for(var _0x37c926 in _0x5e9cb3[_0xeabc('0x23')][_0xeabc('0x30')]){if(_0x5e9cb3['body'][_0xeabc('0x30')]['hasOwnProperty'](_0x37c926)){db[_0xeabc('0x31')][_0xeabc('0x32')]({'where':{'channel':_0x37c926,'membername':_0x5e9cb3[_0xeabc('0x33')][_0xeabc('0x12')],'type':_0xeabc('0x34'),'exitAt':null,'uniqueid':_0x5e9cb3['body']['interaction'][_0x37c926]&&_0x5e9cb3[_0xeabc('0x23')]['interaction'][_0x37c926][_0xeabc('0x35')]?{'$notIn':_0x5e9cb3[_0xeabc('0x23')]['interaction'][_0x37c926]}:{'$ne':null}}})[_0xeabc('0x9')](function(_0x2b3c28){var _0x459c98=moment()[_0xeabc('0x36')](_0xeabc('0x37'));for(var _0xcaa5b9=0x0,_0x2003a7=_0x2b3c28['length'];_0xcaa5b9<_0x2003a7;_0xcaa5b9+=0x1){_0x2b3c28[_0xcaa5b9][_0xeabc('0x38')]({'exitAt':_0x459c98});}});for(var _0x2c85f0=0x0;_0x2c85f0<_0x5e9cb3[_0xeabc('0x23')][_0xeabc('0x30')][_0x37c926][_0xeabc('0x35')];_0x2c85f0+=0x1){db[_0xeabc('0x31')][_0xeabc('0x39')]({'where':{'channel':_0x37c926,'membername':_0x5e9cb3[_0xeabc('0x33')][_0xeabc('0x12')],'type':_0xeabc('0x34'),'uniqueid':_0x5e9cb3['body'][_0xeabc('0x30')][_0x37c926][_0x2c85f0],'exitAt':null},'defaults':{'channel':_0x37c926,'membername':_0x5e9cb3[_0xeabc('0x33')][_0xeabc('0x12')],'interface':_[_0xeabc('0x15')](_0x5e9cb3[_0xeabc('0x33')][_0xeabc('0x3a')])?util[_0xeabc('0x36')]('SIP/%s',_0x5e9cb3[_0xeabc('0x33')][_0xeabc('0x12')]):_0x5e9cb3[_0xeabc('0x33')][_0xeabc('0x3a')],'type':_0xeabc('0x34'),'enterAt':moment()['format'](_0xeabc('0x37')),'role':_0xeabc('0x3b'),'internal':_0x5e9cb3[_0xeabc('0x33')][_0xeabc('0x3c')],'uniqueid':_0x5e9cb3['body'][_0xeabc('0x30')][_0x37c926][_0x2c85f0]}});}}}}return respondWithRpcPromise(_0xeabc('0x3d'),{'id':_0x5e9cb3['params']['id'],'capacity':_0x5e9cb3[_0xeabc('0x23')]['capacity']},routingClient)[_0xeabc('0x9')](respondWithResult(_0xc6af4d,null))['catch'](handleError(_0xc6af4d,null));};exports[_0xeabc('0x3e')]=function(_0x2ec94c,_0x38f988){return respondWithRpcPromise(_0xeabc('0x3f'),_0x2ec94c[_0xeabc('0x19')])[_0xeabc('0x9')](respondWithResult(_0x38f988,null))[_0xeabc('0xe')](handleError(_0x38f988,null));};exports[_0xeabc('0x40')]=function(_0x31aedf,_0x6423f3){return respondWithRpcPromise('Trunks',_0x31aedf[_0xeabc('0x19')])[_0xeabc('0x9')](respondWithResult(_0x6423f3,null))[_0xeabc('0xe')](handleError(_0x6423f3,null));};exports[_0xeabc('0x41')]=function(_0x555d6b,_0x1cef45){return respondWithRpcPromise(_0xeabc('0x42'),_0x555d6b[_0xeabc('0x19')])[_0xeabc('0x9')](respondWithResult(_0x1cef45,null))['catch'](handleError(_0x1cef45,null));};exports[_0xeabc('0x43')]=function(_0x1c7679,_0x3a1b84){return respondWithRpcPromise(_0xeabc('0x44'),_0x1c7679[_0xeabc('0x19')],routingClient)[_0xeabc('0x9')](respondWithResult(_0x3a1b84,null))[_0xeabc('0xe')](handleError(_0x3a1b84,null));};exports[_0xeabc('0x45')]=function(_0x17acf8,_0x58ab08){return respondWithRpcPromise(_0xeabc('0x44'),_0x17acf8['query'],routingClient)['then'](findById(_0x17acf8['params']['id']))[_0xeabc('0x9')](respondWithResult(_0x58ab08,null))[_0xeabc('0xe')](handleError(_0x58ab08,null));};exports[_0xeabc('0x46')]=function(_0xb35103,_0xe89728){return respondWithRpcPromise(_0xeabc('0x47'),_0xb35103['query'],routingClient)[_0xeabc('0x9')](respondWithResult(_0xe89728,null))[_0xeabc('0xe')](handleError(_0xe89728,null));};exports[_0xeabc('0x48')]=function(_0x104c1e,_0x2ddc53){return respondWithRpcPromise(_0xeabc('0x47'),_0x104c1e[_0xeabc('0x19')],routingClient)[_0xeabc('0x9')](findById(_0x104c1e['params']['id']))['then'](respondWithResult(_0x2ddc53,null))[_0xeabc('0xe')](handleError(_0x2ddc53,null));};exports[_0xeabc('0x49')]=function(_0x2c0894,_0x4b3794){return respondWithRpcPromise(_0xeabc('0x4a'),_0x2c0894['query'],mailClient)['then'](respondWithResult(_0x4b3794,null))[_0xeabc('0xe')](handleError(_0x4b3794,null));};exports[_0xeabc('0x4b')]=function(_0x13f04f,_0x4f5451){return respondWithRpcPromise(_0xeabc('0x4c'),_0x13f04f[_0xeabc('0x19')],routingClient)['then'](respondWithResult(_0x4f5451,null))[_0xeabc('0xe')](handleError(_0x4f5451,null));};exports[_0xeabc('0x4d')]=function(_0x321a90,_0x7697f7){return respondWithRpcPromise(_0xeabc('0x4c'),_0x321a90[_0xeabc('0x19')],routingClient)['then'](findById(_0x321a90[_0xeabc('0x1d')]['id']))[_0xeabc('0x9')](respondWithResult(_0x7697f7,null))[_0xeabc('0xe')](handleError(_0x7697f7,null));};exports[_0xeabc('0x4e')]=function(_0x1b61a8,_0x19faa4){return respondWithRpcPromise(_0xeabc('0x4f'),_0x1b61a8[_0xeabc('0x19')],routingClient)[_0xeabc('0x9')](respondWithResult(_0x19faa4,null))['catch'](handleError(_0x19faa4,null));};exports[_0xeabc('0x50')]=function(_0x590439,_0x404846){return respondWithRpcPromise(_0xeabc('0x4f'),_0x590439[_0xeabc('0x19')],routingClient)[_0xeabc('0x9')](findById(_0x590439[_0xeabc('0x1d')]['id']))[_0xeabc('0x9')](respondWithResult(_0x404846,null))[_0xeabc('0xe')](handleError(_0x404846,null));};exports[_0xeabc('0x51')]=function(_0x5d4bc2,_0x24d0e5){return respondWithRpcPromise('WhatsappQueues',_0x5d4bc2[_0xeabc('0x19')],routingClient)[_0xeabc('0x9')](respondWithResult(_0x24d0e5,null))[_0xeabc('0xe')](handleError(_0x24d0e5,null));};exports[_0xeabc('0x52')]=function(_0x5b4430,_0x12fd48){return respondWithRpcPromise('WhatsappQueues',_0x5b4430['query'],routingClient)[_0xeabc('0x9')](findById(_0x5b4430[_0xeabc('0x1d')]['id']))[_0xeabc('0x9')](respondWithResult(_0x12fd48,null))[_0xeabc('0xe')](handleError(_0x12fd48,null));};exports['faxQueues']=function(_0x51a0c7,_0x2e712e){return respondWithRpcPromise('FaxQueues',_0x51a0c7['query'],routingClient)[_0xeabc('0x9')](respondWithResult(_0x2e712e,null))['catch'](handleError(_0x2e712e,null));};exports['showFaxQueues']=function(_0xa44f2d,_0x1c84b5){return respondWithRpcPromise('FaxQueues',_0xa44f2d['query'],routingClient)[_0xeabc('0x9')](findById(_0xa44f2d['params']['id']))[_0xeabc('0x9')](respondWithResult(_0x1c84b5,null))[_0xeabc('0xe')](handleError(_0x1c84b5,null));};exports['faxAccounts']=function(_0x5d6477,_0x24365a){return respondWithRpcPromise(_0xeabc('0x53'),_0x5d6477[_0xeabc('0x19')])[_0xeabc('0x9')](respondWithResult(_0x24365a,null))[_0xeabc('0xe')](handleError(_0x24365a,null));};exports['chatQueuesWaitingInteractions']=function(_0x53f578,_0x391cae){return respondWithRpcPromise('ChatQueuesWaitingInteractions',_0x53f578[_0xeabc('0x19')],routingClient)['then'](respondWithResult(_0x391cae,null))[_0xeabc('0xe')](handleError(_0x391cae,null));};exports['mailQueuesWaitingInteractions']=function(_0x1fdaba,_0x53ac31){return respondWithRpcPromise(_0xeabc('0x54'),_0x1fdaba[_0xeabc('0x19')],routingClient)[_0xeabc('0x9')](respondWithResult(_0x53ac31,null))[_0xeabc('0xe')](handleError(_0x53ac31,null));};exports['openchannelQueuesWaitingInteractions']=function(_0x6ee7cf,_0x4fa682){return respondWithRpcPromise(_0xeabc('0x55'),_0x6ee7cf[_0xeabc('0x19')],routingClient)[_0xeabc('0x9')](respondWithResult(_0x4fa682,null))[_0xeabc('0xe')](handleError(_0x4fa682,null));};exports[_0xeabc('0x56')]=function(_0x5c1ab2,_0x239350){return respondWithRpcPromise(_0xeabc('0x55'),_0x5c1ab2[_0xeabc('0x19')],routingClient)[_0xeabc('0x9')](function(_0x5427c8){if(_0x5c1ab2[_0xeabc('0x19')][_0xeabc('0x57')]!==undefined){var _0xe60b11=_(_0x5427c8[_0xeabc('0x16')])['filter']([_0x5c1ab2[_0xeabc('0x19')][_0xeabc('0x57')],_0x5c1ab2[_0xeabc('0x1d')]['id']])[_0xeabc('0x58')]('queue_id')['uniq']()[_0xeabc('0x59')]();return _0x5427c8['rows']['filter'](function(_0x3271b6){return _0xe60b11[_0xeabc('0x5a')](_0x3271b6[_0xeabc('0x5b')])>-0x1;});}else{return _0x5427c8['rows'][_0xeabc('0x5c')](function(_0x403b18){return _0x403b18['queue_id']===parseInt(_0x5c1ab2[_0xeabc('0x1d')]['id']);});}})[_0xeabc('0x9')](respondWithResult(_0x239350,null))[_0xeabc('0xe')](handleError(_0x239350,null));};exports[_0xeabc('0x5d')]=function(_0x2ece2c,_0x4bf9d8){return respondWithRpcPromise(_0xeabc('0x5e'),_0x2ece2c['query'],routingClient)['then'](respondWithResult(_0x4bf9d8,null))['catch'](handleError(_0x4bf9d8,null));};exports[_0xeabc('0x5f')]=function(_0x1c8a51,_0x1b6e9e){return respondWithRpcPromise(_0xeabc('0x60'),_0x1c8a51[_0xeabc('0x19')],routingClient)['then'](respondWithResult(_0x1b6e9e,null))[_0xeabc('0xe')](handleError(_0x1b6e9e,null));};exports['faxQueuesWaitingInteractions']=function(_0x1795fe,_0x2f95c7){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x1795fe[_0xeabc('0x19')],routingClient)['then'](respondWithResult(_0x2f95c7,null))['catch'](handleError(_0x2f95c7,null));};exports[_0xeabc('0x61')]=function(_0xa5c4ca){return function(_0x439a48,_0x3acb88){var _0x3c6a49,_0x4dfc4b;var _0x399735=_[_0xeabc('0x62')](_0xa5c4ca);var _0x33e5fb=_0xa5c4ca===_0xeabc('0x63')?_0xeabc('0x64'):_0xeabc('0x65');return db[_0x399735+_0xeabc('0x66')][_0xeabc('0x67')]({'raw':!![],'where':{'id':_0x439a48[_0xeabc('0x1d')]['id']}})[_0xeabc('0x9')](function(_0x522c6e){if(_[_0xeabc('0x15')](_0x522c6e)){throw new Error(_0x399735+_0xeabc('0x68'));}_0x3c6a49=_0x522c6e;return db[_0x399735+_0xeabc('0x69')]['findOne']({'where':{'id':_0x439a48['body'][_0xeabc('0x6a')]},'include':[{'model':db[_0x399735+_0xeabc('0x6b')],'as':_0xeabc('0x6b')},{'model':db[_0x399735+_0x33e5fb],'as':_0xeabc('0x65')}]});})[_0xeabc('0x9')](function(_0x5f5a47){if(_[_0xeabc('0x15')](_0x5f5a47)){throw new Error(_0x399735+'\x20Message\x20not\x20found');}_0x4dfc4b=_0x5f5a47;return _0x5f5a47['update']({'read':0x0,'readAt':null,'UserId':null});})[_0xeabc('0x9')](function(){var _0x302e94={'uniqueid':_0xa5c4ca+'.'+_0x4dfc4b['id']+'.'+_0x4dfc4b['Interaction']['id'],'FromUserId':_0x439a48[_0xeabc('0x33')]['id'],'type':_0xeabc('0x6c')};_0x302e94[_0x399735+_0xeabc('0x6d')]=_0x4dfc4b['id'];_0x302e94[_0x399735+_0xeabc('0x6e')]=_0x4dfc4b[_0xeabc('0x6b')]['id'];_0x302e94[_0xeabc('0x6f')+_0x399735+_0x33e5fb+'Id']=_0x4dfc4b[_0xeabc('0x65')]['id'];_0x302e94['To'+_0x399735+_0xeabc('0x70')]=_0x3c6a49['id'];return db[_0x399735+_0xeabc('0x71')][_0xeabc('0x72')](_0x302e94);})[_0xeabc('0x9')](function(){return respondWithRpcPromise('Start',{'channel':_0xa5c4ca,'interaction':_0x4dfc4b[_0xeabc('0x6b')],'message':_0x4dfc4b,'account':_0x4dfc4b['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0xeabc('0x6c'),'appdata':_0x3c6a49[_0xeabc('0x12')]+','+(_0x4dfc4b[_0xeabc('0x65')][_0xeabc('0x73')]||0x12c),'interval':_0xeabc('0x74')}]},routingClient);})[_0xeabc('0x9')](respondWithResult(_0x3acb88,null))[_0xeabc('0xe')](handleError(_0x3acb88,null));};};exports[_0xeabc('0x75')]=function(_0xb85c3d,_0x156e20){var _0x42e92b,_0x5d471f;if(_[_0xeabc('0x15')](_0xb85c3d[_0xeabc('0x23')][_0xeabc('0x76')])){throw new Error(_0xeabc('0x77'));}var _0x5b00d6=_0xb85c3d[_0xeabc('0x23')][_0xeabc('0x76')];var _0x580661=_[_0xeabc('0x62')](_0x5b00d6);var _0x22ef88=_0x5b00d6==='chat'?'Website':'Account';return db['User'][_0xeabc('0x67')]({'raw':!![],'where':{'id':_0xb85c3d[_0xeabc('0x1d')]['id'],'role':_0xeabc('0x3b')}})[_0xeabc('0x9')](function(_0x1d8dca){if(_[_0xeabc('0x15')](_0x1d8dca)){throw new Error(_0xeabc('0x78'));}_0x42e92b=_0x1d8dca;return db[_0x580661+_0xeabc('0x69')][_0xeabc('0x67')]({'where':{'id':_0xb85c3d[_0xeabc('0x23')]['messageId']},'include':[{'model':db[_0x580661+_0xeabc('0x6b')],'as':_0xeabc('0x6b')},{'model':db[_0x580661+_0x22ef88],'as':'Account'}]});})[_0xeabc('0x9')](function(_0x32063c){if(_[_0xeabc('0x15')](_0x32063c)){throw new Error(_0x580661+'\x20Message\x20not\x20found');}_0x5d471f=_0x32063c;return _0x32063c[_0xeabc('0x79')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x425e5c={'uniqueid':_0x5b00d6+'.'+_0x5d471f['id']+'.'+_0x5d471f[_0xeabc('0x6b')]['id'],'FromUserId':_0xb85c3d[_0xeabc('0x33')]['id'],'type':_0xeabc('0x6c'),'ToUserId':_0x42e92b['id']};_0x425e5c[_0x580661+_0xeabc('0x6d')]=_0x5d471f['id'];_0x425e5c[_0x580661+'InteractionId']=_0x5d471f['Interaction']['id'];_0x425e5c['From'+_0x580661+_0x22ef88+'Id']=_0x5d471f['Account']['id'];return db[_0x580661+_0xeabc('0x71')][_0xeabc('0x72')](_0x425e5c);})[_0xeabc('0x9')](function(){return respondWithRpcPromise('Start',{'channel':_0x5b00d6,'interaction':_0x5d471f[_0xeabc('0x6b')],'message':_0x5d471f,'account':_0x5d471f[_0xeabc('0x65')],'applications':[{'id':0x0,'priority':0x1,'app':_0xeabc('0x3b'),'appdata':_0x42e92b[_0xeabc('0x12')]+','+(_0x5d471f[_0xeabc('0x65')][_0xeabc('0x7a')]||0x12c),'interval':_0xeabc('0x74')}]},routingClient);})[_0xeabc('0x9')](respondWithResult(_0x156e20,null))[_0xeabc('0xe')](handleError(_0x156e20,null));}; \ No newline at end of file +var _0x5fc3=['openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','filter','queue_id','uniq','value','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','queueNotify','capitalize','Website','Account','Queue','\x20Queue\x20not\x20found','Message','findOne','Interaction','update','queue','MessageId','InteractionId','From','QueueId','TransferReport','create','queueTransferTimeout','*,*,*,*','agentNotify','channel','chat','User','\x20Message\x20not\x20found','Start','agentTransferTimeout','bluebird','moment','util','../../mysqldb','../../config/logger','api','jayson/promise','http','client','request','then','error','code','message','result','catch','status','json','sendStatus','name','send','isNil','rows','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','VoiceChannelStopMixMonitor','VoiceQueues','showVoiceQueues','updateVoiceQueue','UpdateVoiceQueue','body','voiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','interaction','user','format','length','updateAttributes','MemberReport','findOrCreate','INTERACTION','interface','SIP/%s','YYYY-MM-DD\x20HH:mm:ss','agent','internal','AgentCapacity','capacity','telephones','trunks','campaigns','Campaigns','chatQueues','ChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions'];(function(_0x18b9d9,_0x461b5a){var _0x4d844c=function(_0x126b0a){while(--_0x126b0a){_0x18b9d9['push'](_0x18b9d9['shift']());}};_0x4d844c(++_0x461b5a);}(_0x5fc3,0xa8));var _0x35fc=function(_0x5756c6,_0x58290a){_0x5756c6=_0x5756c6-0x0;var _0x4b5806=_0x5fc3[_0x5756c6];return _0x4b5806;};'use strict';var BPromise=require(_0x35fc('0x0'));var moment=require(_0x35fc('0x1'));var _=require('lodash');var util=require(_0x35fc('0x2'));var db=require(_0x35fc('0x3'))['db'];var logger=require(_0x35fc('0x4'))(_0x35fc('0x5'));var jayson=require(_0x35fc('0x6'));var amiClient=jayson['client'][_0x35fc('0x7')]({'port':0x232a});var mailClient=jayson[_0x35fc('0x8')][_0x35fc('0x7')]({'port':0x232b});var routingClient=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0x19a0d1,_0x508b32,_0x16e153){return new BPromise(function(_0x27524f,_0xc72d93){var _0x1e5f90=_0x16e153?_0x16e153:amiClient;return _0x1e5f90[_0x35fc('0x9')](_0x19a0d1,_0x508b32)[_0x35fc('0xa')](function(_0x2051ab){if(_0x2051ab['error']){if(_0x2051ab[_0x35fc('0xb')][_0x35fc('0xc')]===0x1f4){return _0xc72d93(_0x2051ab['error'][_0x35fc('0xd')]);}return _0x27524f(_0x2051ab[_0x35fc('0xb')]['message']);}else{_0x27524f(_0x2051ab[_0x35fc('0xe')]);}})[_0x35fc('0xf')](function(_0x5469f5){_0xc72d93(_0x5469f5);});});}function respondWithResult(_0x4cbe74,_0x409357){_0x409357=_0x409357||0xc8;return function(_0x5d462a){if(_0x5d462a){return _0x4cbe74[_0x35fc('0x10')](_0x409357)[_0x35fc('0x11')](_0x5d462a);}return _0x4cbe74[_0x35fc('0x12')](0x194);};}function handleError(_0x29730f,_0x38d9f2){_0x38d9f2=_0x38d9f2||0x1f4;return function(_0x5cfe94){logger['error'](_0x5cfe94['stack']);if(_0x5cfe94['name']){delete _0x5cfe94[_0x35fc('0x13')];}_0x29730f[_0x35fc('0x10')](_0x38d9f2)[_0x35fc('0x14')](_0x5cfe94);};}function findById(_0x154958){return function(_0x227a49){if(!_[_0x35fc('0x15')](_0x154958)&&!_['isNil'](_0x227a49)&&!_[_0x35fc('0x15')](_0x227a49[_0x35fc('0x16')])){return _['find'](_0x227a49[_0x35fc('0x16')],function(_0x363e47){return _0x363e47['id']==_0x154958;});}return null;};}exports[_0x35fc('0x17')]=function(_0x5f56c6,_0x1a86e9){return respondWithRpcPromise(_0x35fc('0x18'),_0x5f56c6[_0x35fc('0x19')])['then'](respondWithResult(_0x1a86e9,null))[_0x35fc('0xf')](handleError(_0x1a86e9,null));};exports[_0x35fc('0x1a')]=function(_0x3229d1,_0x251a1f){return respondWithRpcPromise(_0x35fc('0x1b'),_[_0x35fc('0x1c')](_0x3229d1[_0x35fc('0x19')],_0x3229d1[_0x35fc('0x1d')]))[_0x35fc('0xa')](respondWithResult(_0x251a1f,null))[_0x35fc('0xf')](handleError(_0x251a1f,null));};exports['voiceChannelStopMixMonitor']=function(_0x323aee,_0xd5399f){return respondWithRpcPromise(_0x35fc('0x1e'),_[_0x35fc('0x1c')](_0x323aee[_0x35fc('0x19')],_0x323aee['params']))[_0x35fc('0xa')](respondWithResult(_0xd5399f,null))[_0x35fc('0xf')](handleError(_0xd5399f,null));};exports['voiceQueues']=function(_0x265324,_0x5a93df){return respondWithRpcPromise(_0x35fc('0x1f'),_0x265324['query'])[_0x35fc('0xa')](respondWithResult(_0x5a93df,null))['catch'](handleError(_0x5a93df,null));};exports[_0x35fc('0x20')]=function(_0xdfab9f,_0x5cb986){return respondWithRpcPromise('VoiceQueues',_0xdfab9f[_0x35fc('0x19')])['then'](findById(_0xdfab9f[_0x35fc('0x1d')]['id']))[_0x35fc('0xa')](respondWithResult(_0x5cb986,null))['catch'](handleError(_0x5cb986,null));};exports[_0x35fc('0x21')]=function(_0x645eac,_0x383837){return respondWithRpcPromise(_0x35fc('0x22'),_[_0x35fc('0x1c')](_0x645eac[_0x35fc('0x23')],_0x645eac[_0x35fc('0x1d')]))[_0x35fc('0xa')](respondWithResult(_0x383837,null))['catch'](handleError(_0x383837,null));};exports[_0x35fc('0x24')]=function(_0x220931,_0x22af18){return respondWithRpcPromise('VoiceQueuesPreview',_[_0x35fc('0x1c')](_0x220931[_0x35fc('0x19')],_0x220931[_0x35fc('0x1d')]))[_0x35fc('0xa')](respondWithResult(_0x22af18,null))[_0x35fc('0xf')](handleError(_0x22af18,null));};exports[_0x35fc('0x25')]=function(_0x222ddb,_0x37b435){return respondWithRpcPromise(_0x35fc('0x26'),_0x222ddb[_0x35fc('0x19')])['then'](respondWithResult(_0x37b435,null))['catch'](handleError(_0x37b435,null));};exports[_0x35fc('0x27')]=function(_0x4af5fe,_0x37b394){return respondWithRpcPromise(_0x35fc('0x28'),_[_0x35fc('0x1c')](_0x4af5fe[_0x35fc('0x19')],_0x4af5fe[_0x35fc('0x1d')]))[_0x35fc('0xa')](respondWithResult(_0x37b394,null))['catch'](handleError(_0x37b394,null));};exports[_0x35fc('0x29')]=function(_0x330a14,_0x46b9ef){return respondWithRpcPromise(_0x35fc('0x2a'),_[_0x35fc('0x1c')](_0x330a14[_0x35fc('0x19')],_0x330a14['params']))[_0x35fc('0xa')](respondWithResult(_0x46b9ef,null))[_0x35fc('0xf')](handleError(_0x46b9ef,null));};exports[_0x35fc('0x2b')]=function(_0x52f53d,_0x2c657d){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_[_0x35fc('0x1c')](_0x52f53d[_0x35fc('0x19')],_0x52f53d[_0x35fc('0x1d')]))[_0x35fc('0xa')](respondWithResult(_0x2c657d,null))['catch'](handleError(_0x2c657d,null));};exports['outbound']=function(_0x59e4fb,_0x20f5fe){return respondWithRpcPromise('Outbound',_0x59e4fb[_0x35fc('0x19')])['then'](respondWithResult(_0x20f5fe,null))[_0x35fc('0xf')](handleError(_0x20f5fe,null));};exports[_0x35fc('0x2c')]=function(_0x2ca9ac,_0x22b724){return respondWithRpcPromise(_0x35fc('0x2d'),_0x2ca9ac[_0x35fc('0x19')])[_0x35fc('0xa')](respondWithResult(_0x22b724,null))['catch'](handleError(_0x22b724,null));};exports[_0x35fc('0x2e')]=function(_0x16087d,_0x4e0ce3){var _0x1feda5;return respondWithRpcPromise(_0x35fc('0x2f'),_0x16087d[_0x35fc('0x19')])[_0x35fc('0xa')](function(_0x813866){_0x1feda5=_0x813866;return respondWithRpcPromise(_0x35fc('0x2f'),_0x16087d['query'],routingClient);})[_0x35fc('0xa')](function(_0x267858){return _[_0x35fc('0x1c')]({},_0x267858,_0x1feda5);})['then'](respondWithResult(_0x4e0ce3,null))[_0x35fc('0xf')](handleError(_0x4e0ce3,null));};exports[_0x35fc('0x30')]=function(_0x596919,_0x237548){if(_0x596919[_0x35fc('0x23')]&&_0x596919[_0x35fc('0x23')][_0x35fc('0x31')]&&_0x596919[_0x35fc('0x32')]&&_0x596919[_0x35fc('0x32')][_0x35fc('0x13')]){for(var _0x3ec51f in _0x596919['body']['interaction']){if(_0x596919[_0x35fc('0x23')][_0x35fc('0x31')]['hasOwnProperty'](_0x3ec51f)){db['MemberReport']['findAll']({'where':{'channel':_0x3ec51f,'membername':_0x596919[_0x35fc('0x32')][_0x35fc('0x13')],'type':'INTERACTION','exitAt':null,'uniqueid':_0x596919[_0x35fc('0x23')][_0x35fc('0x31')][_0x3ec51f]&&_0x596919[_0x35fc('0x23')][_0x35fc('0x31')][_0x3ec51f]['length']?{'$notIn':_0x596919['body']['interaction'][_0x3ec51f]}:{'$ne':null}}})['then'](function(_0x56bdb9){var _0xb26e3f=moment()[_0x35fc('0x33')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x119925=0x0,_0x56cf1f=_0x56bdb9[_0x35fc('0x34')];_0x119925<_0x56cf1f;_0x119925+=0x1){_0x56bdb9[_0x119925][_0x35fc('0x35')]({'exitAt':_0xb26e3f});}});for(var _0x350237=0x0;_0x350237<_0x596919[_0x35fc('0x23')][_0x35fc('0x31')][_0x3ec51f]['length'];_0x350237+=0x1){db[_0x35fc('0x36')][_0x35fc('0x37')]({'where':{'channel':_0x3ec51f,'membername':_0x596919['user'][_0x35fc('0x13')],'type':_0x35fc('0x38'),'uniqueid':_0x596919[_0x35fc('0x23')][_0x35fc('0x31')][_0x3ec51f][_0x350237],'exitAt':null},'defaults':{'channel':_0x3ec51f,'membername':_0x596919['user'][_0x35fc('0x13')],'interface':_['isNil'](_0x596919['user'][_0x35fc('0x39')])?util[_0x35fc('0x33')](_0x35fc('0x3a'),_0x596919[_0x35fc('0x32')][_0x35fc('0x13')]):_0x596919[_0x35fc('0x32')][_0x35fc('0x39')],'type':_0x35fc('0x38'),'enterAt':moment()['format'](_0x35fc('0x3b')),'role':_0x35fc('0x3c'),'internal':_0x596919[_0x35fc('0x32')][_0x35fc('0x3d')],'uniqueid':_0x596919[_0x35fc('0x23')][_0x35fc('0x31')][_0x3ec51f][_0x350237]}});}}}}return respondWithRpcPromise(_0x35fc('0x3e'),{'id':_0x596919[_0x35fc('0x1d')]['id'],'capacity':_0x596919[_0x35fc('0x23')][_0x35fc('0x3f')]},routingClient)[_0x35fc('0xa')](respondWithResult(_0x237548,null))[_0x35fc('0xf')](handleError(_0x237548,null));};exports[_0x35fc('0x40')]=function(_0x3146e2,_0x59c666){return respondWithRpcPromise('Telephones',_0x3146e2[_0x35fc('0x19')])[_0x35fc('0xa')](respondWithResult(_0x59c666,null))[_0x35fc('0xf')](handleError(_0x59c666,null));};exports[_0x35fc('0x41')]=function(_0x3ee296,_0x3e6494){return respondWithRpcPromise('Trunks',_0x3ee296['query'])[_0x35fc('0xa')](respondWithResult(_0x3e6494,null))[_0x35fc('0xf')](handleError(_0x3e6494,null));};exports[_0x35fc('0x42')]=function(_0x38bc78,_0x5b2595){return respondWithRpcPromise(_0x35fc('0x43'),_0x38bc78[_0x35fc('0x19')])['then'](respondWithResult(_0x5b2595,null))[_0x35fc('0xf')](handleError(_0x5b2595,null));};exports[_0x35fc('0x44')]=function(_0x590faa,_0x3e12e4){return respondWithRpcPromise(_0x35fc('0x45'),_0x590faa[_0x35fc('0x19')],routingClient)[_0x35fc('0xa')](respondWithResult(_0x3e12e4,null))['catch'](handleError(_0x3e12e4,null));};exports['showChatQueues']=function(_0x502a15,_0x240338){return respondWithRpcPromise(_0x35fc('0x45'),_0x502a15['query'],routingClient)[_0x35fc('0xa')](findById(_0x502a15[_0x35fc('0x1d')]['id']))[_0x35fc('0xa')](respondWithResult(_0x240338,null))[_0x35fc('0xf')](handleError(_0x240338,null));};exports[_0x35fc('0x46')]=function(_0x538be0,_0x2d9d45){return respondWithRpcPromise(_0x35fc('0x47'),_0x538be0[_0x35fc('0x19')],routingClient)['then'](respondWithResult(_0x2d9d45,null))[_0x35fc('0xf')](handleError(_0x2d9d45,null));};exports[_0x35fc('0x48')]=function(_0x47fb1a,_0x35a676){return respondWithRpcPromise(_0x35fc('0x47'),_0x47fb1a[_0x35fc('0x19')],routingClient)[_0x35fc('0xa')](findById(_0x47fb1a[_0x35fc('0x1d')]['id']))[_0x35fc('0xa')](respondWithResult(_0x35a676,null))[_0x35fc('0xf')](handleError(_0x35a676,null));};exports[_0x35fc('0x49')]=function(_0x53a79d,_0x10a5b8){return respondWithRpcPromise(_0x35fc('0x4a'),_0x53a79d[_0x35fc('0x19')],mailClient)['then'](respondWithResult(_0x10a5b8,null))[_0x35fc('0xf')](handleError(_0x10a5b8,null));};exports['openchannelQueues']=function(_0x4ceacc,_0x5d4a39){return respondWithRpcPromise(_0x35fc('0x4b'),_0x4ceacc[_0x35fc('0x19')],routingClient)[_0x35fc('0xa')](respondWithResult(_0x5d4a39,null))[_0x35fc('0xf')](handleError(_0x5d4a39,null));};exports[_0x35fc('0x4c')]=function(_0x4bbea0,_0x579f5a){return respondWithRpcPromise('OpenchannelQueues',_0x4bbea0['query'],routingClient)['then'](findById(_0x4bbea0[_0x35fc('0x1d')]['id']))[_0x35fc('0xa')](respondWithResult(_0x579f5a,null))[_0x35fc('0xf')](handleError(_0x579f5a,null));};exports[_0x35fc('0x4d')]=function(_0x511e8b,_0x458eb8){return respondWithRpcPromise(_0x35fc('0x4e'),_0x511e8b[_0x35fc('0x19')],routingClient)[_0x35fc('0xa')](respondWithResult(_0x458eb8,null))[_0x35fc('0xf')](handleError(_0x458eb8,null));};exports[_0x35fc('0x4f')]=function(_0x27071b,_0x2127e0){return respondWithRpcPromise(_0x35fc('0x4e'),_0x27071b['query'],routingClient)[_0x35fc('0xa')](findById(_0x27071b['params']['id']))[_0x35fc('0xa')](respondWithResult(_0x2127e0,null))[_0x35fc('0xf')](handleError(_0x2127e0,null));};exports[_0x35fc('0x50')]=function(_0x2bc76c,_0x4bdde7){return respondWithRpcPromise(_0x35fc('0x51'),_0x2bc76c['query'],routingClient)['then'](respondWithResult(_0x4bdde7,null))['catch'](handleError(_0x4bdde7,null));};exports[_0x35fc('0x52')]=function(_0x5dfeb7,_0x3c9027){return respondWithRpcPromise('WhatsappQueues',_0x5dfeb7[_0x35fc('0x19')],routingClient)['then'](findById(_0x5dfeb7[_0x35fc('0x1d')]['id']))[_0x35fc('0xa')](respondWithResult(_0x3c9027,null))[_0x35fc('0xf')](handleError(_0x3c9027,null));};exports[_0x35fc('0x53')]=function(_0x5c2ec0,_0x3d0ecc){return respondWithRpcPromise(_0x35fc('0x54'),_0x5c2ec0[_0x35fc('0x19')],routingClient)['then'](respondWithResult(_0x3d0ecc,null))[_0x35fc('0xf')](handleError(_0x3d0ecc,null));};exports[_0x35fc('0x55')]=function(_0x37764b,_0x3c1b56){return respondWithRpcPromise(_0x35fc('0x54'),_0x37764b[_0x35fc('0x19')],routingClient)[_0x35fc('0xa')](findById(_0x37764b[_0x35fc('0x1d')]['id']))['then'](respondWithResult(_0x3c1b56,null))[_0x35fc('0xf')](handleError(_0x3c1b56,null));};exports[_0x35fc('0x56')]=function(_0x2600d2,_0x4a926d){return respondWithRpcPromise(_0x35fc('0x57'),_0x2600d2[_0x35fc('0x19')])['then'](respondWithResult(_0x4a926d,null))['catch'](handleError(_0x4a926d,null));};exports[_0x35fc('0x58')]=function(_0x4835c2,_0x223ad3){return respondWithRpcPromise(_0x35fc('0x59'),_0x4835c2[_0x35fc('0x19')],routingClient)[_0x35fc('0xa')](respondWithResult(_0x223ad3,null))[_0x35fc('0xf')](handleError(_0x223ad3,null));};exports[_0x35fc('0x5a')]=function(_0x13f602,_0x104b1d){return respondWithRpcPromise(_0x35fc('0x5b'),_0x13f602[_0x35fc('0x19')],routingClient)[_0x35fc('0xa')](respondWithResult(_0x104b1d,null))[_0x35fc('0xf')](handleError(_0x104b1d,null));};exports[_0x35fc('0x5c')]=function(_0x9f034e,_0x184f28){return respondWithRpcPromise(_0x35fc('0x5d'),_0x9f034e[_0x35fc('0x19')],routingClient)[_0x35fc('0xa')](respondWithResult(_0x184f28,null))[_0x35fc('0xf')](handleError(_0x184f28,null));};exports[_0x35fc('0x5e')]=function(_0x4ba1b0,_0x1797d0){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x4ba1b0[_0x35fc('0x19')],routingClient)[_0x35fc('0xa')](function(_0x2185ce){if(_0x4ba1b0[_0x35fc('0x19')][_0x35fc('0x5f')]!==undefined){var _0x3f56f4=_(_0x2185ce[_0x35fc('0x16')])[_0x35fc('0x60')]([_0x4ba1b0[_0x35fc('0x19')][_0x35fc('0x5f')],_0x4ba1b0[_0x35fc('0x1d')]['id']])['map'](_0x35fc('0x61'))[_0x35fc('0x62')]()[_0x35fc('0x63')]();return _0x2185ce[_0x35fc('0x16')][_0x35fc('0x60')](function(_0x41a6de){return _0x3f56f4['indexOf'](_0x41a6de[_0x35fc('0x61')])>-0x1;});}else{return _0x2185ce[_0x35fc('0x16')][_0x35fc('0x60')](function(_0x23206d){return _0x23206d[_0x35fc('0x61')]===parseInt(_0x4ba1b0[_0x35fc('0x1d')]['id']);});}})[_0x35fc('0xa')](respondWithResult(_0x1797d0,null))[_0x35fc('0xf')](handleError(_0x1797d0,null));};exports[_0x35fc('0x64')]=function(_0x5f23d8,_0x28f02b){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x5f23d8[_0x35fc('0x19')],routingClient)[_0x35fc('0xa')](respondWithResult(_0x28f02b,null))['catch'](handleError(_0x28f02b,null));};exports[_0x35fc('0x65')]=function(_0x41002a,_0xcaa49){return respondWithRpcPromise(_0x35fc('0x66'),_0x41002a[_0x35fc('0x19')],routingClient)[_0x35fc('0xa')](respondWithResult(_0xcaa49,null))[_0x35fc('0xf')](handleError(_0xcaa49,null));};exports[_0x35fc('0x67')]=function(_0x25ee61,_0x5806bf){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x25ee61['query'],routingClient)['then'](respondWithResult(_0x5806bf,null))[_0x35fc('0xf')](handleError(_0x5806bf,null));};exports[_0x35fc('0x68')]=function(_0x8fc410){return function(_0x1f5cbc,_0x35ef53){var _0x4f535a,_0x226fdf;var _0x19682e=_[_0x35fc('0x69')](_0x8fc410);var _0x169ea2=_0x8fc410==='chat'?_0x35fc('0x6a'):_0x35fc('0x6b');return db[_0x19682e+_0x35fc('0x6c')]['findOne']({'raw':!![],'where':{'id':_0x1f5cbc[_0x35fc('0x1d')]['id']}})[_0x35fc('0xa')](function(_0x319033){if(_[_0x35fc('0x15')](_0x319033)){throw new Error(_0x19682e+_0x35fc('0x6d'));}_0x4f535a=_0x319033;return db[_0x19682e+_0x35fc('0x6e')][_0x35fc('0x6f')]({'where':{'id':_0x1f5cbc[_0x35fc('0x23')]['messageId']},'include':[{'model':db[_0x19682e+_0x35fc('0x70')],'as':_0x35fc('0x70')},{'model':db[_0x19682e+_0x169ea2],'as':_0x35fc('0x6b')}]});})[_0x35fc('0xa')](function(_0x221c5b){if(_[_0x35fc('0x15')](_0x221c5b)){throw new Error(_0x19682e+'\x20Message\x20not\x20found');}_0x226fdf=_0x221c5b;return _0x221c5b[_0x35fc('0x71')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x4855ee={'uniqueid':_0x8fc410+'.'+_0x226fdf['id']+'.'+_0x226fdf[_0x35fc('0x70')]['id'],'FromUserId':_0x1f5cbc['user']['id'],'type':_0x35fc('0x72')};_0x4855ee[_0x19682e+_0x35fc('0x73')]=_0x226fdf['id'];_0x4855ee[_0x19682e+_0x35fc('0x74')]=_0x226fdf['Interaction']['id'];_0x4855ee[_0x35fc('0x75')+_0x19682e+_0x169ea2+'Id']=_0x226fdf[_0x35fc('0x6b')]['id'];_0x4855ee['To'+_0x19682e+_0x35fc('0x76')]=_0x4f535a['id'];return db[_0x19682e+_0x35fc('0x77')][_0x35fc('0x78')](_0x4855ee);})['then'](function(){return respondWithRpcPromise('Start',{'channel':_0x8fc410,'interaction':_0x226fdf['Interaction'],'message':_0x226fdf,'account':_0x226fdf[_0x35fc('0x6b')],'applications':[{'id':0x0,'priority':0x1,'app':'queue','appdata':_0x4f535a[_0x35fc('0x13')]+','+(_0x226fdf[_0x35fc('0x6b')][_0x35fc('0x79')]||0x12c),'interval':_0x35fc('0x7a')}]},routingClient);})['then'](respondWithResult(_0x35ef53,null))[_0x35fc('0xf')](handleError(_0x35ef53,null));};};exports[_0x35fc('0x7b')]=function(_0x312827,_0x47c507){var _0x128286,_0x175cc7;if(_[_0x35fc('0x15')](_0x312827['body']['channel'])){throw new Error('Channel\x20field\x20is\x20mandatory');}var _0x32b9e1=_0x312827[_0x35fc('0x23')][_0x35fc('0x7c')];var _0x3858a9=_['capitalize'](_0x32b9e1);var _0x3ead4e=_0x32b9e1===_0x35fc('0x7d')?'Website':'Account';return db[_0x35fc('0x7e')][_0x35fc('0x6f')]({'raw':!![],'where':{'id':_0x312827[_0x35fc('0x1d')]['id'],'role':'agent'}})['then'](function(_0x134e60){if(_[_0x35fc('0x15')](_0x134e60)){throw new Error('Agent\x20not\x20found');}_0x128286=_0x134e60;return db[_0x3858a9+_0x35fc('0x6e')][_0x35fc('0x6f')]({'where':{'id':_0x312827[_0x35fc('0x23')]['messageId']},'include':[{'model':db[_0x3858a9+_0x35fc('0x70')],'as':_0x35fc('0x70')},{'model':db[_0x3858a9+_0x3ead4e],'as':_0x35fc('0x6b')}]});})[_0x35fc('0xa')](function(_0x4fd676){if(_[_0x35fc('0x15')](_0x4fd676)){throw new Error(_0x3858a9+_0x35fc('0x7f'));}_0x175cc7=_0x4fd676;return _0x4fd676[_0x35fc('0x71')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x96dfc={'uniqueid':_0x32b9e1+'.'+_0x175cc7['id']+'.'+_0x175cc7[_0x35fc('0x70')]['id'],'FromUserId':_0x312827[_0x35fc('0x32')]['id'],'type':'queue','ToUserId':_0x128286['id']};_0x96dfc[_0x3858a9+_0x35fc('0x73')]=_0x175cc7['id'];_0x96dfc[_0x3858a9+_0x35fc('0x74')]=_0x175cc7['Interaction']['id'];_0x96dfc[_0x35fc('0x75')+_0x3858a9+_0x3ead4e+'Id']=_0x175cc7[_0x35fc('0x6b')]['id'];return db[_0x3858a9+_0x35fc('0x77')][_0x35fc('0x78')](_0x96dfc);})[_0x35fc('0xa')](function(){return respondWithRpcPromise(_0x35fc('0x80'),{'channel':_0x32b9e1,'interaction':_0x175cc7[_0x35fc('0x70')],'message':_0x175cc7,'account':_0x175cc7[_0x35fc('0x6b')],'applications':[{'id':0x0,'priority':0x1,'app':_0x35fc('0x3c'),'appdata':_0x128286['name']+','+(_0x175cc7[_0x35fc('0x6b')][_0x35fc('0x81')]||0x12c),'interval':_0x35fc('0x7a')}]},routingClient);})[_0x35fc('0xa')](respondWithResult(_0x47c507,null))['catch'](handleError(_0x47c507,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index f3cc882..a081668 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 _0xdea0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./schedule.controller','isAuthenticated','index','get','/:id','show','/:id/run','put','update','delete','destroy','exports','multer','util','path','express'];(function(_0x25bdaf,_0x21c383){var _0x42696e=function(_0x307ada){while(--_0x307ada){_0x25bdaf['push'](_0x25bdaf['shift']());}};_0x42696e(++_0x21c383);}(_0xdea0,0x88));var _0x0dea=function(_0xb90145,_0x13c2a0){_0xb90145=_0xb90145-0x0;var _0x3bdeba=_0xdea0[_0xb90145];return _0x3bdeba;};'use strict';var multer=require(_0x0dea('0x0'));var util=require(_0x0dea('0x1'));var path=require(_0x0dea('0x2'));var timeout=require('connect-timeout');var express=require(_0x0dea('0x3'));var router=express[_0x0dea('0x4')]();var fs_extra=require(_0x0dea('0x5'));var auth=require(_0x0dea('0x6'));var interaction=require(_0x0dea('0x7'));var config=require('../../config/environment');var controller=require(_0x0dea('0x8'));router['get']('/',auth[_0x0dea('0x9')](),controller[_0x0dea('0xa')]);router[_0x0dea('0xb')](_0x0dea('0xc'),auth[_0x0dea('0x9')](),controller[_0x0dea('0xd')]);router['get'](_0x0dea('0xe'),auth[_0x0dea('0x9')](),controller['run']);router['post']('/',auth[_0x0dea('0x9')](),controller['create']);router[_0x0dea('0xf')](_0x0dea('0xc'),auth['isAuthenticated'](),controller[_0x0dea('0x10')]);router[_0x0dea('0x11')](_0x0dea('0xc'),auth[_0x0dea('0x9')](),controller[_0x0dea('0x12')]);module[_0x0dea('0x13')]=router; \ No newline at end of file +var _0x724c=['isAuthenticated','index','/:id','show','post','put','update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./schedule.controller','get'];(function(_0x49c209,_0x34b181){var _0x35861b=function(_0x4d1067){while(--_0x4d1067){_0x49c209['push'](_0x49c209['shift']());}};_0x35861b(++_0x34b181);}(_0x724c,0x14d));var _0xc724=function(_0x32e699,_0x2001b3){_0x32e699=_0x32e699-0x0;var _0x59121c=_0x724c[_0x32e699];return _0x59121c;};'use strict';var multer=require('multer');var util=require(_0xc724('0x0'));var path=require(_0xc724('0x1'));var timeout=require(_0xc724('0x2'));var express=require(_0xc724('0x3'));var router=express['Router']();var fs_extra=require(_0xc724('0x4'));var auth=require(_0xc724('0x5'));var interaction=require(_0xc724('0x6'));var config=require('../../config/environment');var controller=require(_0xc724('0x7'));router[_0xc724('0x8')]('/',auth[_0xc724('0x9')](),controller[_0xc724('0xa')]);router[_0xc724('0x8')](_0xc724('0xb'),auth[_0xc724('0x9')](),controller[_0xc724('0xc')]);router[_0xc724('0x8')]('/:id/run',auth['isAuthenticated'](),controller['run']);router[_0xc724('0xd')]('/',auth[_0xc724('0x9')](),controller['create']);router[_0xc724('0xe')](_0xc724('0xb'),auth[_0xc724('0x9')](),controller[_0xc724('0xf')]);router[_0xc724('0x10')](_0xc724('0xb'),auth[_0xc724('0x9')](),controller[_0xc724('0x11')]);module[_0xc724('0x12')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index c73f4b9..3764dcf 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 _0xafdf=['INTEGER','ENUM','years','quarters','months','days','hours','minutes','csv','xlsx','custom','default','TEXT','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE'];(function(_0x3e0a8c,_0x1f2bf8){var _0x24e2ef=function(_0x45ff13){while(--_0x45ff13){_0x3e0a8c['push'](_0x3e0a8c['shift']());}};_0x24e2ef(++_0x1f2bf8);}(_0xafdf,0xe5));var _0xfafd=function(_0x9781fb,_0x356c8e){_0x9781fb=_0x9781fb-0x0;var _0x2561b7=_0xafdf[_0x9781fb];return _0x2561b7;};'use strict';var Sequelize=require('sequelize');module[_0xfafd('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xfafd('0x1')]},'active':{'type':Sequelize[_0xfafd('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xfafd('0x1')],'allowNull':![],'defaultValue':_0xfafd('0x3')},'startAt':{'type':Sequelize['DATE'],'allowNull':![]},'endAt':{'type':Sequelize[_0xfafd('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xfafd('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xfafd('0x6')](_0xfafd('0x7'),_0xfafd('0x8'),_0xfafd('0x9'),'weeks',_0xfafd('0xa'),_0xfafd('0xb'),_0xfafd('0xc')),'allowNull':![],'defaultValue':_0xfafd('0xa')},'output':{'type':Sequelize[_0xfafd('0x6')](_0xfafd('0xd'),'pdf',_0xfafd('0xe')),'allowNull':![],'defaultValue':'csv'},'type':{'type':Sequelize[_0xfafd('0x6')](_0xfafd('0xf'),_0xfafd('0x10')),'allowNull':![],'defaultValue':_0xfafd('0xf')},'sendMail':{'type':Sequelize[_0xfafd('0x2')],'defaultValue':![]},'email':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0xfafd('0x11')]},'bcc':{'type':Sequelize['TEXT']},'sendIfEmpty':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x97bb=['quarters','months','weeks','hours','csv','xlsx','custom','STRING','TEXT','sequelize','0\x200\x20*\x20*\x20*','DATE','ENUM','years'];(function(_0x585fce,_0x429688){var _0x1f3d2d=function(_0x50db6b){while(--_0x50db6b){_0x585fce['push'](_0x585fce['shift']());}};_0x1f3d2d(++_0x429688);}(_0x97bb,0xdb));var _0xb97b=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x97bb[_0x432682];return _0x463d05;};'use strict';var Sequelize=require(_0xb97b('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xb97b('0x1')},'startAt':{'type':Sequelize['DATE'],'allowNull':![]},'endAt':{'type':Sequelize[_0xb97b('0x2')],'allowNull':![]},'subtractNumber':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xb97b('0x3')](_0xb97b('0x4'),_0xb97b('0x5'),_0xb97b('0x6'),_0xb97b('0x7'),'days',_0xb97b('0x8'),'minutes'),'allowNull':![],'defaultValue':'days'},'output':{'type':Sequelize[_0xb97b('0x3')](_0xb97b('0x9'),'pdf',_0xb97b('0xa')),'allowNull':![],'defaultValue':_0xb97b('0x9')},'type':{'type':Sequelize[_0xb97b('0x3')](_0xb97b('0xb'),'default'),'allowNull':![],'defaultValue':_0xb97b('0xb')},'sendMail':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0xb97b('0xc')]},'cc':{'type':Sequelize[_0xb97b('0xd')]},'bcc':{'type':Sequelize[_0xb97b('0xd')]},'sendIfEmpty':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index c81b120..d796ed5 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 _0x0788=['index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','nolimit','sort','where','filters','merge','VIRTUAL','options','Schedule','includeAll','rows','catch','show','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','run','../../config/schedule','eml-format','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','apply','reject','update','then','get','Scheduler','UserProfileResource','destroy','error','stack','name'];(function(_0x2fbbd3,_0x4308cc){var _0x43aabc=function(_0x2df53a){while(--_0x2df53a){_0x2fbbd3['push'](_0x2fbbd3['shift']());}};_0x43aabc(++_0x4308cc);}(_0x0788,0x1a6));var _0x8078=function(_0x30b4c8,_0x41d880){_0x30b4c8=_0x30b4c8-0x0;var _0x3f6542=_0x0788[_0x30b4c8];return _0x3f6542;};'use strict';var emlformat=require(_0x8078('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8078('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8078('0x2'));var moment=require(_0x8078('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x8078('0x4'));var util=require(_0x8078('0x5'));var path=require(_0x8078('0x6'));var sox=require(_0x8078('0x7'));var csv=require(_0x8078('0x8'));var ejs=require(_0x8078('0x9'));var fs=require('fs');var fs_extra=require(_0x8078('0xa'));var _=require('lodash');var squel=require(_0x8078('0xb'));var crypto=require(_0x8078('0xc'));var jsforce=require(_0x8078('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x8078('0x8'));var querystring=require(_0x8078('0xe'));var Papa=require('papaparse');var Redis=require(_0x8078('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x8078('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8078('0x11'));var logger=require(_0x8078('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x8078('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x8078('0x14'))['db'];function respondWithStatusCode(_0x21f5a8,_0x4079e1){_0x4079e1=_0x4079e1||0xcc;return function(_0x19765d){if(_0x19765d){return _0x21f5a8[_0x8078('0x15')](_0x4079e1);}return _0x21f5a8[_0x8078('0x16')](_0x4079e1)[_0x8078('0x17')]();};}function respondWithResult(_0x51a2c6,_0x3071ff){_0x3071ff=_0x3071ff||0xc8;return function(_0x22584b){if(_0x22584b){return _0x51a2c6[_0x8078('0x16')](_0x3071ff)[_0x8078('0x18')](_0x22584b);}};}function respondWithFilteredResult(_0x540dd0,_0x1cc2fa){return function(_0x54288e){if(_0x54288e){var _0x5e6db1=typeof _0x1cc2fa['offset']===_0x8078('0x19')&&typeof _0x1cc2fa[_0x8078('0x1a')]===_0x8078('0x19');var _0x6eb65f=_0x54288e[_0x8078('0x1b')];var _0x149019=_0x5e6db1?0x0:_0x1cc2fa[_0x8078('0x1c')];var _0x29a3a2=_0x5e6db1?_0x54288e[_0x8078('0x1b')]:_0x1cc2fa[_0x8078('0x1c')]+_0x1cc2fa[_0x8078('0x1a')];var _0x79ef05;if(_0x29a3a2>=_0x6eb65f){_0x29a3a2=_0x6eb65f;_0x79ef05=0xc8;}else{_0x79ef05=0xce;}_0x540dd0[_0x8078('0x16')](_0x79ef05);return _0x540dd0['set']('Content-Range',_0x149019+'-'+_0x29a3a2+'/'+_0x6eb65f)['json'](_0x54288e);}return null;};}function patchUpdates(_0x4db381){return function(_0xdbe7ce){try{jsonpatch[_0x8078('0x1d')](_0xdbe7ce,_0x4db381,!![]);}catch(_0x552649){return BPromise[_0x8078('0x1e')](_0x552649);}return _0xdbe7ce['save']();};}function saveUpdates(_0x50fd58,_0x2e3650){return function(_0x4bbc51){if(_0x4bbc51){return _0x4bbc51[_0x8078('0x1f')](_0x50fd58)[_0x8078('0x20')](function(_0x48d764){return _0x48d764;});}return null;};}function removeEntity(_0xc50b2f,_0x2f9b16){return function(_0x43e0f9){if(_0x43e0f9){return _0x43e0f9['destroy']()['then'](function(){var _0x3a9adc=_0x43e0f9[_0x8078('0x21')]({'plain':!![]});var _0x34bcb0=_0x8078('0x22');return db[_0x8078('0x23')][_0x8078('0x24')]({'where':{'type':_0x34bcb0,'resourceId':_0x3a9adc['id']}})['then'](function(){return _0x43e0f9;});})[_0x8078('0x20')](function(){_0xc50b2f[_0x8078('0x16')](0xcc)[_0x8078('0x17')]();});}};}function handleEntityNotFound(_0x3a724e,_0x161e3c){return function(_0x2e48e2){if(!_0x2e48e2){_0x3a724e[_0x8078('0x15')](0x194);}return _0x2e48e2;};}function handleError(_0x74cfd3,_0x23b838){_0x23b838=_0x23b838||0x1f4;return function(_0x2a0a90){logger[_0x8078('0x25')](_0x2a0a90[_0x8078('0x26')]);if(_0x2a0a90[_0x8078('0x27')]){delete _0x2a0a90[_0x8078('0x27')];}_0x74cfd3[_0x8078('0x16')](_0x23b838)['send'](_0x2a0a90);};}exports[_0x8078('0x28')]=function(_0x5434c8,_0x3ba231){var _0x4ed4a2={},_0x2e9528={},_0x16813a={'count':0x0,'rows':[]};var _0x20ed7d=_[_0x8078('0x29')](db['Schedule'][_0x8078('0x2a')],function(_0x53eb94){return{'name':_0x53eb94[_0x8078('0x2b')],'type':_0x53eb94[_0x8078('0x2c')][_0x8078('0x2d')]};});_0x2e9528[_0x8078('0x2e')]=_[_0x8078('0x29')](_0x20ed7d,_0x8078('0x27'));_0x2e9528[_0x8078('0x2f')]=_[_0x8078('0x30')](_0x5434c8[_0x8078('0x2f')]);_0x2e9528['filters']=_[_0x8078('0x31')](_0x2e9528[_0x8078('0x2e')],_0x2e9528['query']);_0x4ed4a2['attributes']=_[_0x8078('0x31')](_0x2e9528[_0x8078('0x2e')],qs[_0x8078('0x32')](_0x5434c8['query'][_0x8078('0x32')]));_0x4ed4a2[_0x8078('0x33')]=_0x4ed4a2['attributes'][_0x8078('0x34')]?_0x4ed4a2[_0x8078('0x33')]:_0x2e9528[_0x8078('0x2e')];if(!_0x5434c8['query']['hasOwnProperty'](_0x8078('0x35'))){_0x4ed4a2['limit']=qs[_0x8078('0x1a')](_0x5434c8['query'][_0x8078('0x1a')]);_0x4ed4a2[_0x8078('0x1c')]=qs[_0x8078('0x1c')](_0x5434c8['query'][_0x8078('0x1c')]);}_0x4ed4a2['order']=qs[_0x8078('0x36')](_0x5434c8[_0x8078('0x2f')]['sort']);_0x4ed4a2[_0x8078('0x37')]=qs['filters'](_['pick'](_0x5434c8[_0x8078('0x2f')],_0x2e9528[_0x8078('0x38')]),_0x20ed7d);if(_0x5434c8[_0x8078('0x2f')]['filter']){_0x4ed4a2['where']=_[_0x8078('0x39')](_0x4ed4a2[_0x8078('0x37')],{'$or':_[_0x8078('0x29')](_0x20ed7d,function(_0x5cf35c){if(_0x5cf35c[_0x8078('0x2c')]!==_0x8078('0x3a')){var _0x4631c6={};_0x4631c6[_0x5cf35c['name']]={'$like':'%'+_0x5434c8[_0x8078('0x2f')]['filter']+'%'};return _0x4631c6;}})});}_0x4ed4a2=_[_0x8078('0x39')]({},_0x4ed4a2,_0x5434c8[_0x8078('0x3b')]);var _0x5096b4={'where':_0x4ed4a2[_0x8078('0x37')]};return db[_0x8078('0x3c')][_0x8078('0x1b')](_0x5096b4)[_0x8078('0x20')](function(_0x14bab3){_0x16813a['count']=_0x14bab3;if(_0x5434c8[_0x8078('0x2f')][_0x8078('0x3d')]){_0x4ed4a2['include']=[{'all':!![]}];}return db[_0x8078('0x3c')]['findAll'](_0x4ed4a2);})['then'](function(_0x54ffac){_0x16813a[_0x8078('0x3e')]=_0x54ffac;return _0x16813a;})['then'](respondWithFilteredResult(_0x3ba231,_0x4ed4a2))[_0x8078('0x3f')](handleError(_0x3ba231,null));};exports[_0x8078('0x40')]=function(_0x316a53,_0x3fff66){var _0x312c43={'raw':![],'where':{'id':_0x316a53['params']['id']}},_0x11d576={};_0x11d576['model']=_[_0x8078('0x30')](db[_0x8078('0x3c')][_0x8078('0x2a')]);_0x11d576[_0x8078('0x2f')]=_[_0x8078('0x30')](_0x316a53[_0x8078('0x2f')]);_0x11d576['filters']=_[_0x8078('0x31')](_0x11d576[_0x8078('0x2e')],_0x11d576['query']);_0x312c43[_0x8078('0x33')]=_[_0x8078('0x31')](_0x11d576[_0x8078('0x2e')],qs[_0x8078('0x32')](_0x316a53['query'][_0x8078('0x32')]));_0x312c43[_0x8078('0x33')]=_0x312c43[_0x8078('0x33')][_0x8078('0x34')]?_0x312c43['attributes']:_0x11d576[_0x8078('0x2e')];if(_0x316a53[_0x8078('0x2f')]['includeAll']){_0x312c43[_0x8078('0x41')]=[{'all':!![]}];}_0x312c43=_[_0x8078('0x39')]({},_0x312c43,_0x316a53['options']);return db[_0x8078('0x3c')][_0x8078('0x42')](_0x312c43)['then'](handleEntityNotFound(_0x3fff66,null))[_0x8078('0x20')](respondWithResult(_0x3fff66,null))[_0x8078('0x3f')](handleError(_0x3fff66,null));};exports[_0x8078('0x43')]=function(_0x2bcce9,_0x1cf4d6){return db[_0x8078('0x3c')][_0x8078('0x43')](_0x2bcce9['body'],{})[_0x8078('0x20')](function(_0x205f48){var _0x33c0d1=_0x2bcce9[_0x8078('0x44')]['get']({'plain':!![]});if(!_0x33c0d1)throw new Error(_0x8078('0x45'));if(_0x33c0d1['role']===_0x8078('0x44')){var _0x4681f4=_0x205f48[_0x8078('0x21')]({'plain':!![]});var _0x2a7d29=_0x8078('0x22');return db[_0x8078('0x46')][_0x8078('0x42')]({'where':{'name':_0x2a7d29,'userProfileId':_0x33c0d1['userProfileId']},'raw':!![]})[_0x8078('0x20')](function(_0x2c5aa1){if(_0x2c5aa1&&_0x2c5aa1[_0x8078('0x47')]===0x0){return db['UserProfileResource'][_0x8078('0x43')]({'name':_0x4681f4[_0x8078('0x27')],'resourceId':_0x4681f4['id'],'type':_0x2c5aa1[_0x8078('0x27')],'sectionId':_0x2c5aa1['id']},{})[_0x8078('0x20')](function(){return _0x205f48;});}else{return _0x205f48;}})[_0x8078('0x3f')](function(_0x153e0d){logger[_0x8078('0x25')](_0x8078('0x48'),_0x153e0d);throw _0x153e0d;});}return _0x205f48;})[_0x8078('0x20')](respondWithResult(_0x1cf4d6,0xc9))[_0x8078('0x3f')](handleError(_0x1cf4d6,null));};exports[_0x8078('0x1f')]=function(_0x51f56e,_0x322315){if(_0x51f56e[_0x8078('0x49')]['id']){delete _0x51f56e['body']['id'];}return db[_0x8078('0x3c')][_0x8078('0x42')]({'where':{'id':_0x51f56e[_0x8078('0x4a')]['id']}})['then'](handleEntityNotFound(_0x322315,null))[_0x8078('0x20')](saveUpdates(_0x51f56e[_0x8078('0x49')],null))[_0x8078('0x20')](respondWithResult(_0x322315,null))['catch'](handleError(_0x322315,null));};exports['destroy']=function(_0x1c8829,_0x145095){return db[_0x8078('0x3c')][_0x8078('0x42')]({'where':{'id':_0x1c8829[_0x8078('0x4a')]['id']}})['then'](handleEntityNotFound(_0x145095,null))[_0x8078('0x20')](removeEntity(_0x145095,null))[_0x8078('0x3f')](handleError(_0x145095,null));};exports[_0x8078('0x4b')]=function(_0x23bae1,_0x5a713a,_0x2df614){var _0x51120b=require(_0x8078('0x4c'));return db[_0x8078('0x3c')][_0x8078('0x42')]({'where':{'id':_0x23bae1[_0x8078('0x4a')]['id']},'raw':!![]})[_0x8078('0x20')](handleEntityNotFound(_0x5a713a,null))[_0x8078('0x20')](function(){_0x51120b[_0x8078('0x4b')](_0x23bae1[_0x8078('0x4a')]['id']);})['then'](respondWithStatusCode(_0x5a713a,null))['catch'](handleError(_0x5a713a,null));}; \ No newline at end of file +var _0xdb3b=['nolimit','order','sort','where','pick','merge','VIRTUAL','Schedule','includeAll','include','findAll','rows','catch','show','params','length','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','run','eml-format','rimraf','zip-dir','moment','bluebird','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','destroy','then','Scheduler','UserProfileResource','end','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty'];(function(_0x23f98a,_0x374f32){var _0x36e301=function(_0x4d1509){while(--_0x4d1509){_0x23f98a['push'](_0x23f98a['shift']());}};_0x36e301(++_0x374f32);}(_0xdb3b,0xc5));var _0xbdb3=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xdb3b[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require(_0xbdb3('0x0'));var rimraf=require(_0xbdb3('0x1'));var zipdir=require(_0xbdb3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xbdb3('0x3'));var BPromise=require(_0xbdb3('0x4'));var Mustache=require('mustache');var util=require(_0xbdb3('0x5'));var path=require(_0xbdb3('0x6'));var sox=require(_0xbdb3('0x7'));var csv=require('to-csv');var ejs=require(_0xbdb3('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbdb3('0x9'));var squel=require('squel');var crypto=require(_0xbdb3('0xa'));var jsforce=require(_0xbdb3('0xb'));var deskjs=require(_0xbdb3('0xc'));var toCsv=require(_0xbdb3('0xd'));var querystring=require(_0xbdb3('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xbdb3('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbdb3('0x10'));var logger=require(_0xbdb3('0x11'))('api');var utils=require(_0xbdb3('0x12'));var config=require(_0xbdb3('0x13'));var licenseUtil=require(_0xbdb3('0x14'));var db=require(_0xbdb3('0x15'))['db'];function respondWithStatusCode(_0x3f09c5,_0x511450){_0x511450=_0x511450||0xcc;return function(_0x380f63){if(_0x380f63){return _0x3f09c5[_0xbdb3('0x16')](_0x511450);}return _0x3f09c5[_0xbdb3('0x17')](_0x511450)['end']();};}function respondWithResult(_0x565630,_0x35c7ec){_0x35c7ec=_0x35c7ec||0xc8;return function(_0x413663){if(_0x413663){return _0x565630[_0xbdb3('0x17')](_0x35c7ec)[_0xbdb3('0x18')](_0x413663);}};}function respondWithFilteredResult(_0x5eb59a,_0x1c6a77){return function(_0x567d03){if(_0x567d03){var _0x157290=typeof _0x1c6a77[_0xbdb3('0x19')]===_0xbdb3('0x1a')&&typeof _0x1c6a77[_0xbdb3('0x1b')]===_0xbdb3('0x1a');var _0xd4a33=_0x567d03[_0xbdb3('0x1c')];var _0x3d8bb1=_0x157290?0x0:_0x1c6a77[_0xbdb3('0x19')];var _0x32e72b=_0x157290?_0x567d03[_0xbdb3('0x1c')]:_0x1c6a77[_0xbdb3('0x19')]+_0x1c6a77[_0xbdb3('0x1b')];var _0x52a83f;if(_0x32e72b>=_0xd4a33){_0x32e72b=_0xd4a33;_0x52a83f=0xc8;}else{_0x52a83f=0xce;}_0x5eb59a[_0xbdb3('0x17')](_0x52a83f);return _0x5eb59a['set'](_0xbdb3('0x1d'),_0x3d8bb1+'-'+_0x32e72b+'/'+_0xd4a33)[_0xbdb3('0x18')](_0x567d03);}return null;};}function patchUpdates(_0x19cf63){return function(_0x3053f0){try{jsonpatch[_0xbdb3('0x1e')](_0x3053f0,_0x19cf63,!![]);}catch(_0x42c8d2){return BPromise['reject'](_0x42c8d2);}return _0x3053f0[_0xbdb3('0x1f')]();};}function saveUpdates(_0x48317a,_0x42e027){return function(_0x5de89c){if(_0x5de89c){return _0x5de89c[_0xbdb3('0x20')](_0x48317a)['then'](function(_0x59ff29){return _0x59ff29;});}return null;};}function removeEntity(_0x15c9a8,_0x11e1a1){return function(_0x475ad3){if(_0x475ad3){return _0x475ad3[_0xbdb3('0x21')]()[_0xbdb3('0x22')](function(){var _0xe6580e=_0x475ad3['get']({'plain':!![]});var _0x2b323b=_0xbdb3('0x23');return db[_0xbdb3('0x24')]['destroy']({'where':{'type':_0x2b323b,'resourceId':_0xe6580e['id']}})[_0xbdb3('0x22')](function(){return _0x475ad3;});})[_0xbdb3('0x22')](function(){_0x15c9a8[_0xbdb3('0x17')](0xcc)[_0xbdb3('0x25')]();});}};}function handleEntityNotFound(_0x1c37b6,_0x4d6c74){return function(_0x12d910){if(!_0x12d910){_0x1c37b6[_0xbdb3('0x16')](0x194);}return _0x12d910;};}function handleError(_0x3ccf54,_0x99e143){_0x99e143=_0x99e143||0x1f4;return function(_0x5d587f){logger[_0xbdb3('0x26')](_0x5d587f[_0xbdb3('0x27')]);if(_0x5d587f[_0xbdb3('0x28')]){delete _0x5d587f[_0xbdb3('0x28')];}_0x3ccf54[_0xbdb3('0x17')](_0x99e143)[_0xbdb3('0x29')](_0x5d587f);};}exports[_0xbdb3('0x2a')]=function(_0x52d129,_0x30c939){var _0x597f5b={},_0x37bb3c={},_0x22f5ab={'count':0x0,'rows':[]};var _0x3ab0b4=_[_0xbdb3('0x2b')](db['Schedule'][_0xbdb3('0x2c')],function(_0x8e8574){return{'name':_0x8e8574['fieldName'],'type':_0x8e8574[_0xbdb3('0x2d')][_0xbdb3('0x2e')]};});_0x37bb3c[_0xbdb3('0x2f')]=_[_0xbdb3('0x2b')](_0x3ab0b4,'name');_0x37bb3c[_0xbdb3('0x30')]=_[_0xbdb3('0x31')](_0x52d129['query']);_0x37bb3c[_0xbdb3('0x32')]=_[_0xbdb3('0x33')](_0x37bb3c[_0xbdb3('0x2f')],_0x37bb3c[_0xbdb3('0x30')]);_0x597f5b['attributes']=_['intersection'](_0x37bb3c[_0xbdb3('0x2f')],qs[_0xbdb3('0x34')](_0x52d129[_0xbdb3('0x30')]['fields']));_0x597f5b['attributes']=_0x597f5b['attributes']['length']?_0x597f5b[_0xbdb3('0x35')]:_0x37bb3c[_0xbdb3('0x2f')];if(!_0x52d129[_0xbdb3('0x30')][_0xbdb3('0x36')](_0xbdb3('0x37'))){_0x597f5b[_0xbdb3('0x1b')]=qs['limit'](_0x52d129[_0xbdb3('0x30')][_0xbdb3('0x1b')]);_0x597f5b[_0xbdb3('0x19')]=qs[_0xbdb3('0x19')](_0x52d129[_0xbdb3('0x30')][_0xbdb3('0x19')]);}_0x597f5b[_0xbdb3('0x38')]=qs[_0xbdb3('0x39')](_0x52d129[_0xbdb3('0x30')]['sort']);_0x597f5b[_0xbdb3('0x3a')]=qs['filters'](_[_0xbdb3('0x3b')](_0x52d129[_0xbdb3('0x30')],_0x37bb3c['filters']),_0x3ab0b4);if(_0x52d129[_0xbdb3('0x30')]['filter']){_0x597f5b[_0xbdb3('0x3a')]=_[_0xbdb3('0x3c')](_0x597f5b[_0xbdb3('0x3a')],{'$or':_['map'](_0x3ab0b4,function(_0x555e12){if(_0x555e12[_0xbdb3('0x2d')]!==_0xbdb3('0x3d')){var _0x1a94fb={};_0x1a94fb[_0x555e12[_0xbdb3('0x28')]]={'$like':'%'+_0x52d129[_0xbdb3('0x30')]['filter']+'%'};return _0x1a94fb;}})});}_0x597f5b=_[_0xbdb3('0x3c')]({},_0x597f5b,_0x52d129['options']);var _0x2f24ef={'where':_0x597f5b[_0xbdb3('0x3a')]};return db[_0xbdb3('0x3e')][_0xbdb3('0x1c')](_0x2f24ef)[_0xbdb3('0x22')](function(_0x13ab99){_0x22f5ab[_0xbdb3('0x1c')]=_0x13ab99;if(_0x52d129[_0xbdb3('0x30')][_0xbdb3('0x3f')]){_0x597f5b[_0xbdb3('0x40')]=[{'all':!![]}];}return db['Schedule'][_0xbdb3('0x41')](_0x597f5b);})[_0xbdb3('0x22')](function(_0x57f114){_0x22f5ab[_0xbdb3('0x42')]=_0x57f114;return _0x22f5ab;})[_0xbdb3('0x22')](respondWithFilteredResult(_0x30c939,_0x597f5b))[_0xbdb3('0x43')](handleError(_0x30c939,null));};exports[_0xbdb3('0x44')]=function(_0x39024d,_0x2a2566){var _0x1df700={'raw':![],'where':{'id':_0x39024d[_0xbdb3('0x45')]['id']}},_0x383f44={};_0x383f44[_0xbdb3('0x2f')]=_['keys'](db['Schedule'][_0xbdb3('0x2c')]);_0x383f44['query']=_[_0xbdb3('0x31')](_0x39024d[_0xbdb3('0x30')]);_0x383f44[_0xbdb3('0x32')]=_[_0xbdb3('0x33')](_0x383f44['model'],_0x383f44['query']);_0x1df700[_0xbdb3('0x35')]=_[_0xbdb3('0x33')](_0x383f44[_0xbdb3('0x2f')],qs[_0xbdb3('0x34')](_0x39024d[_0xbdb3('0x30')][_0xbdb3('0x34')]));_0x1df700[_0xbdb3('0x35')]=_0x1df700[_0xbdb3('0x35')][_0xbdb3('0x46')]?_0x1df700[_0xbdb3('0x35')]:_0x383f44[_0xbdb3('0x2f')];if(_0x39024d['query'][_0xbdb3('0x3f')]){_0x1df700['include']=[{'all':!![]}];}_0x1df700=_[_0xbdb3('0x3c')]({},_0x1df700,_0x39024d[_0xbdb3('0x47')]);return db['Schedule'][_0xbdb3('0x48')](_0x1df700)[_0xbdb3('0x22')](handleEntityNotFound(_0x2a2566,null))[_0xbdb3('0x22')](respondWithResult(_0x2a2566,null))['catch'](handleError(_0x2a2566,null));};exports[_0xbdb3('0x49')]=function(_0x17f1ea,_0x21083a){return db[_0xbdb3('0x3e')][_0xbdb3('0x49')](_0x17f1ea[_0xbdb3('0x4a')],{})['then'](function(_0x1448e2){var _0x59a67b=_0x17f1ea[_0xbdb3('0x4b')][_0xbdb3('0x4c')]({'plain':!![]});if(!_0x59a67b)throw new Error(_0xbdb3('0x4d'));if(_0x59a67b[_0xbdb3('0x4e')]===_0xbdb3('0x4b')){var _0x3717e6=_0x1448e2[_0xbdb3('0x4c')]({'plain':!![]});var _0x20e038=_0xbdb3('0x23');return db[_0xbdb3('0x4f')][_0xbdb3('0x48')]({'where':{'name':_0x20e038,'userProfileId':_0x59a67b[_0xbdb3('0x50')]},'raw':!![]})['then'](function(_0x59e2a7){if(_0x59e2a7&&_0x59e2a7[_0xbdb3('0x51')]===0x0){return db['UserProfileResource']['create']({'name':_0x3717e6[_0xbdb3('0x28')],'resourceId':_0x3717e6['id'],'type':_0x59e2a7[_0xbdb3('0x28')],'sectionId':_0x59e2a7['id']},{})[_0xbdb3('0x22')](function(){return _0x1448e2;});}else{return _0x1448e2;}})[_0xbdb3('0x43')](function(_0x1d95e3){logger[_0xbdb3('0x26')](_0xbdb3('0x52'),_0x1d95e3);throw _0x1d95e3;});}return _0x1448e2;})[_0xbdb3('0x22')](respondWithResult(_0x21083a,0xc9))[_0xbdb3('0x43')](handleError(_0x21083a,null));};exports[_0xbdb3('0x20')]=function(_0x1532aa,_0x410064){if(_0x1532aa[_0xbdb3('0x4a')]['id']){delete _0x1532aa[_0xbdb3('0x4a')]['id'];}return db['Schedule'][_0xbdb3('0x48')]({'where':{'id':_0x1532aa[_0xbdb3('0x45')]['id']}})[_0xbdb3('0x22')](handleEntityNotFound(_0x410064,null))[_0xbdb3('0x22')](saveUpdates(_0x1532aa[_0xbdb3('0x4a')],null))[_0xbdb3('0x22')](respondWithResult(_0x410064,null))[_0xbdb3('0x43')](handleError(_0x410064,null));};exports[_0xbdb3('0x21')]=function(_0x3a9009,_0xcd30d9){return db[_0xbdb3('0x3e')]['find']({'where':{'id':_0x3a9009[_0xbdb3('0x45')]['id']}})[_0xbdb3('0x22')](handleEntityNotFound(_0xcd30d9,null))[_0xbdb3('0x22')](removeEntity(_0xcd30d9,null))[_0xbdb3('0x43')](handleError(_0xcd30d9,null));};exports[_0xbdb3('0x53')]=function(_0x472781,_0x5487e0,_0x4af142){var _0x48e8c7=require('../../config/schedule');return db[_0xbdb3('0x3e')][_0xbdb3('0x48')]({'where':{'id':_0x472781['params']['id']},'raw':!![]})[_0xbdb3('0x22')](handleEntityNotFound(_0x5487e0,null))[_0xbdb3('0x22')](function(){_0x48e8c7[_0xbdb3('0x53')](_0x472781[_0xbdb3('0x45')]['id']);})[_0xbdb3('0x22')](respondWithStatusCode(_0x5487e0,null))['catch'](handleError(_0x5487e0,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 1fa8bd1..3d12a92 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 _0x8234=['Schedule','tools_schedules','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./schedule.attributes','define'];(function(_0x455c6c,_0x1e78b7){var _0x488242=function(_0x3e8fb0){while(--_0x3e8fb0){_0x455c6c['push'](_0x455c6c['shift']());}};_0x488242(++_0x1e78b7);}(_0x8234,0x1d6));var _0x4823=function(_0xc8fdda,_0x3c5514){_0xc8fdda=_0xc8fdda-0x0;var _0x3cf95b=_0x8234[_0xc8fdda];return _0x3cf95b;};'use strict';var _=require(_0x4823('0x0'));var util=require(_0x4823('0x1'));var logger=require('../../config/logger')(_0x4823('0x2'));var moment=require(_0x4823('0x3'));var BPromise=require(_0x4823('0x4'));var rp=require(_0x4823('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4823('0x6'));var config=require(_0x4823('0x7'));var attributes=require(_0x4823('0x8'));module['exports']=function(_0x2e61f4,_0x90b4ef){return _0x2e61f4[_0x4823('0x9')](_0x4823('0xa'),attributes,{'tableName':_0x4823('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0ee6=['Schedule','util','../../config/logger','api','bluebird','request-promise','path','./schedule.attributes','define'];(function(_0x3faa55,_0xde3411){var _0x124d89=function(_0x591f91){while(--_0x591f91){_0x3faa55['push'](_0x3faa55['shift']());}};_0x124d89(++_0xde3411);}(_0x0ee6,0x1cc));var _0x60ee=function(_0x3c024b,_0x3d93ec){_0x3c024b=_0x3c024b-0x0;var _0x298183=_0x0ee6[_0x3c024b];return _0x298183;};'use strict';var _=require('lodash');var util=require(_0x60ee('0x0'));var logger=require(_0x60ee('0x1'))(_0x60ee('0x2'));var moment=require('moment');var BPromise=require(_0x60ee('0x3'));var rp=require(_0x60ee('0x4'));var fs=require('fs');var path=require(_0x60ee('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x60ee('0x6'));module['exports']=function(_0x591f8e,_0x2764c2){return _0x591f8e[_0x60ee('0x7')](_0x60ee('0x8'),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 a1e3d63..7c18f22 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 _0x1b42=['then','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','error','code','message','info','Schedule,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x267775,_0x1d38cd){var _0x1e9f21=function(_0x9c2d62){while(--_0x9c2d62){_0x267775['push'](_0x267775['shift']());}};_0x1e9f21(++_0x1d38cd);}(_0x1b42,0x95));var _0x21b4=function(_0x4fab6d,_0x244b72){_0x4fab6d=_0x4fab6d-0x0;var _0x1c454c=_0x1b42[_0x4fab6d];return _0x1c454c;};'use strict';var _=require(_0x21b4('0x0'));var util=require(_0x21b4('0x1'));var moment=require(_0x21b4('0x2'));var BPromise=require(_0x21b4('0x3'));var rs=require(_0x21b4('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x21b4('0x5'));var logger=require(_0x21b4('0x6'))(_0x21b4('0x7'));var config=require(_0x21b4('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x21b4('0x9')][_0x21b4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x331a64,_0xeaad6d,_0xa9d0f0){return new BPromise(function(_0x345976,_0x3be694){return client[_0x21b4('0xb')](_0x331a64,_0xa9d0f0)[_0x21b4('0xc')](function(_0x4c87d1){logger['info']('Schedule,\x20%s,\x20%s',_0xeaad6d,_0x21b4('0xd'));logger[_0x21b4('0xe')](_0x21b4('0xf'),_0xeaad6d,_0x21b4('0xd'),JSON['stringify'](_0x4c87d1));if(_0x4c87d1[_0x21b4('0x10')]){if(_0x4c87d1[_0x21b4('0x10')][_0x21b4('0x11')]===0x1f4){logger[_0x21b4('0x10')]('Schedule,\x20%s,\x20%s',_0xeaad6d,_0x4c87d1['error'][_0x21b4('0x12')]);return _0x3be694(_0x4c87d1['error'][_0x21b4('0x12')]);}logger['error']('Schedule,\x20%s,\x20%s',_0xeaad6d,_0x4c87d1['error'][_0x21b4('0x12')]);return _0x345976(_0x4c87d1[_0x21b4('0x10')][_0x21b4('0x12')]);}else{logger[_0x21b4('0x13')](_0x21b4('0x14'),_0xeaad6d,_0x21b4('0xd'));_0x345976(_0x4c87d1[_0x21b4('0x15')][_0x21b4('0x12')]);}})[_0x21b4('0x16')](function(_0x36743a){logger[_0x21b4('0x10')](_0x21b4('0x14'),_0xeaad6d,_0x36743a);_0x3be694(_0x36743a);});});} \ No newline at end of file +var _0x61dd=['error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','request','info','Schedule,\x20%s,\x20%s','request\x20sent','Schedule,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x52b81c,_0x5490aa){var _0xa843f1=function(_0x4c24c7){while(--_0x4c24c7){_0x52b81c['push'](_0x52b81c['shift']());}};_0xa843f1(++_0x5490aa);}(_0x61dd,0x165));var _0xd61d=function(_0x957193,_0x3fec8b){_0x957193=_0x957193-0x0;var _0x9473f8=_0x61dd[_0x957193];return _0x9473f8;};'use strict';var _=require(_0xd61d('0x0'));var util=require(_0xd61d('0x1'));var moment=require(_0xd61d('0x2'));var BPromise=require(_0xd61d('0x3'));var rs=require(_0xd61d('0x4'));var fs=require('fs');var Redis=require(_0xd61d('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xd61d('0x6'));var logger=require(_0xd61d('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xd61d('0x8'));var client=jayson[_0xd61d('0x9')][_0xd61d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x290b90,_0x2a6d14,_0x25fec9){return new BPromise(function(_0x286d8b,_0x53f8b3){return client[_0xd61d('0xb')](_0x290b90,_0x25fec9)['then'](function(_0x557a52){logger[_0xd61d('0xc')](_0xd61d('0xd'),_0x2a6d14,_0xd61d('0xe'));logger['debug'](_0xd61d('0xf'),_0x2a6d14,_0xd61d('0xe'),JSON[_0xd61d('0x10')](_0x557a52));if(_0x557a52[_0xd61d('0x11')]){if(_0x557a52[_0xd61d('0x11')][_0xd61d('0x12')]===0x1f4){logger['error'](_0xd61d('0xd'),_0x2a6d14,_0x557a52['error']['message']);return _0x53f8b3(_0x557a52[_0xd61d('0x11')]['message']);}logger[_0xd61d('0x11')](_0xd61d('0xd'),_0x2a6d14,_0x557a52[_0xd61d('0x11')][_0xd61d('0x13')]);return _0x286d8b(_0x557a52[_0xd61d('0x11')][_0xd61d('0x13')]);}else{logger[_0xd61d('0xc')]('Schedule,\x20%s,\x20%s',_0x2a6d14,_0xd61d('0xe'));_0x286d8b(_0x557a52[_0xd61d('0x14')][_0xd61d('0x13')]);}})[_0xd61d('0x15')](function(_0x3c865d){logger[_0xd61d('0x11')]('Schedule,\x20%s,\x20%s',_0x2a6d14,_0x3c865d);_0x53f8b3(_0x3c865d);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 0122b66..a743f5f 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 _0xce86=['./screenRecording.controller','get','index','/describe','isAuthenticated','describe','show','download','post','create','put','update','delete','/:id','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment'];(function(_0xacb84e,_0x2c8663){var _0x484514=function(_0x2fb392){while(--_0x2fb392){_0xacb84e['push'](_0xacb84e['shift']());}};_0x484514(++_0x2c8663);}(_0xce86,0x19b));var _0x6ce8=function(_0x383dbb,_0x17d41b){_0x383dbb=_0x383dbb-0x0;var _0x6e8bde=_0xce86[_0x383dbb];return _0x6e8bde;};'use strict';var multer=require(_0x6ce8('0x0'));var util=require(_0x6ce8('0x1'));var path=require(_0x6ce8('0x2'));var timeout=require(_0x6ce8('0x3'));var express=require(_0x6ce8('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x6ce8('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6ce8('0x6'));var controller=require(_0x6ce8('0x7'));router[_0x6ce8('0x8')]('/',auth['isAuthenticated'](),controller[_0x6ce8('0x9')]);router['get'](_0x6ce8('0xa'),auth[_0x6ce8('0xb')](),controller[_0x6ce8('0xc')]);router[_0x6ce8('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x6ce8('0xd')]);router['get']('/:id/download',auth['isAuthenticated'](),controller[_0x6ce8('0xe')]);router[_0x6ce8('0xf')]('/',auth['isAuthenticated'](),controller[_0x6ce8('0x10')]);router[_0x6ce8('0x11')]('/:id',auth[_0x6ce8('0xb')](),controller[_0x6ce8('0x12')]);router[_0x6ce8('0x13')](_0x6ce8('0x14'),auth[_0x6ce8('0xb')](),controller[_0x6ce8('0x15')]);module['exports']=router; \ No newline at end of file +var _0x2ab1=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/download','post'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x2ab1,0x1a3));var _0x12ab=function(_0x59884a,_0x3b50e3){_0x59884a=_0x59884a-0x0;var _0x4cd0b9=_0x2ab1[_0x59884a];return _0x4cd0b9;};'use strict';var multer=require(_0x12ab('0x0'));var util=require(_0x12ab('0x1'));var path=require(_0x12ab('0x2'));var timeout=require(_0x12ab('0x3'));var express=require('express');var router=express[_0x12ab('0x4')]();var fs_extra=require(_0x12ab('0x5'));var auth=require(_0x12ab('0x6'));var interaction=require(_0x12ab('0x7'));var config=require(_0x12ab('0x8'));var controller=require(_0x12ab('0x9'));router[_0x12ab('0xa')]('/',auth[_0x12ab('0xb')](),controller[_0x12ab('0xc')]);router['get'](_0x12ab('0xd'),auth[_0x12ab('0xb')](),controller['describe']);router[_0x12ab('0xa')](_0x12ab('0xe'),auth[_0x12ab('0xb')](),controller[_0x12ab('0xf')]);router[_0x12ab('0xa')](_0x12ab('0x10'),auth[_0x12ab('0xb')](),controller['download']);router[_0x12ab('0x11')]('/',auth[_0x12ab('0xb')](),controller['create']);router[_0x12ab('0x12')](_0x12ab('0xe'),auth[_0x12ab('0xb')](),controller[_0x12ab('0x13')]);router[_0x12ab('0x14')]('/:id',auth[_0x12ab('0xb')](),controller[_0x12ab('0x15')]);module[_0x12ab('0x16')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index 73858b7..776dbe8 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 _0xf5b6=['format','MM-DD-YYYY\x20HH:mm','toString','updatedAt','path','../../config/environment','exports','VIRTUAL','value','extname','getDataValue','STRING','setDataValue','INTEGER','startedAt','closedAt','duration','DATE'];(function(_0x4f2fc1,_0x3e5049){var _0x3944a0=function(_0x3e941b){while(--_0x3e941b){_0x4f2fc1['push'](_0x4f2fc1['shift']());}};_0x3944a0(++_0x3e5049);}(_0xf5b6,0x1b4));var _0x6f5b=function(_0xfefff8,_0x47ab74){_0xfefff8=_0xfefff8-0x0;var _0x22b3b5=_0xf5b6[_0xfefff8];return _0x22b3b5;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');var path=require(_0x6f5b('0x0'));var config=require(_0x6f5b('0x1'));module[_0x6f5b('0x2')]={'format':{'type':Sequelize[_0x6f5b('0x3')],'get':function(){return this['getDataValue'](_0x6f5b('0x4'))?path[_0x6f5b('0x5')](this[_0x6f5b('0x6')](_0x6f5b('0x4'))):undefined;}},'interactionid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize[_0x6f5b('0x7')],'set':function(_0x5cf395){var _0x58899e=_0x5cf395['replace'](/\\/g,'/');this[_0x6f5b('0x8')]('value',_0x58899e);}},'rating':{'type':Sequelize[_0x6f5b('0x9')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x6f5b('0x9')],'set':function(_0x17692b){this['setDataValue'](_0x6f5b('0xa'),moment()['subtract'](_0x17692b,'ms'));this[_0x6f5b('0x8')](_0x6f5b('0xb'),moment());this[_0x6f5b('0x8')](_0x6f5b('0xc'),_0x17692b);}},'startedAt':{'type':Sequelize[_0x6f5b('0xd')],'get':function(){return moment(this['getDataValue'](_0x6f5b('0xa')))[_0x6f5b('0xe')](_0x6f5b('0xf'))['toString']();}},'closedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x6f5b('0x6')](_0x6f5b('0xb')))[_0x6f5b('0xe')](_0x6f5b('0xf'))[_0x6f5b('0x10')]();}},'createdAt':{'type':Sequelize[_0x6f5b('0xd')],'get':function(){return moment(this[_0x6f5b('0x6')]('createdAt'))[_0x6f5b('0xe')](_0x6f5b('0xf'))['toString']();}},'updatedAt':{'type':Sequelize[_0x6f5b('0xd')],'get':function(){return moment(this[_0x6f5b('0x6')](_0x6f5b('0x11')))[_0x6f5b('0xe')](_0x6f5b('0xf'))[_0x6f5b('0x10')]();}}}; \ No newline at end of file +var _0x5386=['path','../../config/environment','VIRTUAL','getDataValue','value','extname','STRING','replace','setDataValue','INTEGER','startedAt','subtract','duration','DATE','MM-DD-YYYY\x20HH:mm','toString','closedAt','createdAt','format','sequelize','moment'];(function(_0x416b67,_0x1b1eec){var _0x5a6cf3=function(_0x43a6e4){while(--_0x43a6e4){_0x416b67['push'](_0x416b67['shift']());}};_0x5a6cf3(++_0x1b1eec);}(_0x5386,0x1e1));var _0x6538=function(_0x1e48d3,_0x5d8c43){_0x1e48d3=_0x1e48d3-0x0;var _0x2852b1=_0x5386[_0x1e48d3];return _0x2852b1;};'use strict';var Sequelize=require(_0x6538('0x0'));var moment=require(_0x6538('0x1'));var path=require(_0x6538('0x2'));var config=require(_0x6538('0x3'));module['exports']={'format':{'type':Sequelize[_0x6538('0x4')],'get':function(){return this[_0x6538('0x5')](_0x6538('0x6'))?path[_0x6538('0x7')](this[_0x6538('0x5')](_0x6538('0x6'))):undefined;}},'interactionid':{'type':Sequelize[_0x6538('0x8')]},'channel':{'type':Sequelize[_0x6538('0x8')]},'value':{'type':Sequelize['STRING'],'set':function(_0x16c291){var _0x4b0e05=_0x16c291[_0x6538('0x9')](/\\/g,'/');this[_0x6538('0xa')](_0x6538('0x6'),_0x4b0e05);}},'rating':{'type':Sequelize[_0x6538('0xb')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x6538('0xb')],'set':function(_0x2bce05){this[_0x6538('0xa')](_0x6538('0xc'),moment()[_0x6538('0xd')](_0x2bce05,'ms'));this[_0x6538('0xa')]('closedAt',moment());this[_0x6538('0xa')](_0x6538('0xe'),_0x2bce05);}},'startedAt':{'type':Sequelize[_0x6538('0xf')],'get':function(){return moment(this['getDataValue'](_0x6538('0xc')))['format'](_0x6538('0x10'))[_0x6538('0x11')]();}},'closedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x6538('0x5')](_0x6538('0x12')))['format'](_0x6538('0x10'))[_0x6538('0x11')]();}},'createdAt':{'type':Sequelize[_0x6538('0xf')],'get':function(){return moment(this['getDataValue'](_0x6538('0x13')))['format'](_0x6538('0x10'))[_0x6538('0x11')]();}},'updatedAt':{'type':Sequelize[_0x6538('0xf')],'get':function(){return moment(this[_0x6538('0x5')]('updatedAt'))[_0x6538('0x14')](_0x6538('0x10'))['toString']();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index 142cdfb..2f642d8 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 _0x9957=['sort','pick','filter','where','merge','map','VIRTUAL','options','ScreenRecording','includeAll','include','catch','show','rawAttributes','find','create','body','duration','closedAt','params','describe','download','uniqueid','value','join','root','server/files/screen_recordings','%s.cypher','existsSync','decryptFile','secrets','Sequelize','filename','extname','unlink','message','ScreenRecording\x20not\x20found','isNil','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','unlinkSync','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','differenceBy','format','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order'];(function(_0x267a12,_0x4dcd65){var _0x3edf10=function(_0x426a14){while(--_0x426a14){_0x267a12['push'](_0x267a12['shift']());}};_0x3edf10(++_0x4dcd65);}(_0x9957,0x93));var _0x7995=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x9957[_0x19e35c];return _0x3e1fe8;};'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['ScreenRecording']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_['map'](_0x4253e5,'name'),[_0x7995('0x31')]);_0x456a28['query']=_[_0x7995('0x32')](_0x4b6f99[_0x7995('0x33')]);_0x456a28[_0x7995('0x34')]=_[_0x7995('0x35')](_0x456a28[_0x7995('0x2f')],_0x456a28['query']);_0x514445[_0x7995('0x36')]=_[_0x7995('0x35')](_0x456a28['model'],qs['fields'](_0x4b6f99['query'][_0x7995('0x37')]));_0x514445[_0x7995('0x36')]=_0x514445['attributes'][_0x7995('0x38')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99[_0x7995('0x33')][_0x7995('0x39')]('nolimit')){_0x514445['limit']=qs[_0x7995('0x21')](_0x4b6f99['query']['limit']);_0x514445[_0x7995('0x20')]=qs[_0x7995('0x20')](_0x4b6f99['query'][_0x7995('0x20')]);}_0x514445[_0x7995('0x3a')]=qs[_0x7995('0x3b')](_0x4b6f99[_0x7995('0x33')][_0x7995('0x3b')]);_0x514445['where']=qs[_0x7995('0x34')](_[_0x7995('0x3c')](_0x4b6f99[_0x7995('0x33')],_0x456a28[_0x7995('0x34')]),_0x4253e5);if(_0x4b6f99['query'][_0x7995('0x3d')]){_0x514445[_0x7995('0x3e')]=_[_0x7995('0x3f')](_0x514445[_0x7995('0x3e')],{'$or':_[_0x7995('0x40')](_0x4253e5,function(_0x1035dc){if(_0x1035dc['type']!==_0x7995('0x41')){var _0x3be298={};_0x3be298[_0x1035dc[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x33')][_0x7995('0x3d')]+'%'};return _0x3be298;}})});}_0x514445=_[_0x7995('0x3f')]({},_0x514445,_0x4b6f99[_0x7995('0x42')]);var _0x270c0e={'where':_0x514445[_0x7995('0x3e')]};return db[_0x7995('0x43')][_0x7995('0x1f')](_0x270c0e)[_0x7995('0x26')](function(_0x7b4e67){_0x3250e0['count']=_0x7b4e67;if(_0x4b6f99['query'][_0x7995('0x44')]){_0x514445[_0x7995('0x45')]=[{'all':!![]}];}return db['ScreenRecording']['findAll'](_0x514445);})[_0x7995('0x26')](function(_0x4a9fef){_0x3250e0['rows']=_0x4a9fef;return _0x3250e0;})[_0x7995('0x26')](respondWithFilteredResult(_0x9b2a15,_0x514445))[_0x7995('0x46')](handleError(_0x9b2a15,null));};exports[_0x7995('0x47')]=function(_0x576b96,_0x46ac4f){var _0x5e85b9={'raw':![],'where':{'id':_0x576b96['params']['id']}},_0x3993b5={};_0x3993b5['model']=_[_0x7995('0x32')](db[_0x7995('0x43')][_0x7995('0x48')]);_0x3993b5[_0x7995('0x33')]=_['keys'](_0x576b96[_0x7995('0x33')]);_0x3993b5[_0x7995('0x34')]=_[_0x7995('0x35')](_0x3993b5[_0x7995('0x2f')],_0x3993b5['query']);_0x5e85b9['attributes']=_[_0x7995('0x35')](_0x3993b5['model'],qs[_0x7995('0x37')](_0x576b96['query'][_0x7995('0x37')]));_0x5e85b9['attributes']=_0x5e85b9[_0x7995('0x36')][_0x7995('0x38')]?_0x5e85b9['attributes']:_0x3993b5[_0x7995('0x2f')];if(_0x576b96[_0x7995('0x33')][_0x7995('0x44')]){_0x5e85b9[_0x7995('0x45')]=[{'all':!![]}];}_0x5e85b9=_['merge']({},_0x5e85b9,_0x576b96[_0x7995('0x42')]);return db[_0x7995('0x43')][_0x7995('0x49')](_0x5e85b9)['then'](handleEntityNotFound(_0x46ac4f,null))[_0x7995('0x26')](respondWithResult(_0x46ac4f,null))[_0x7995('0x46')](handleError(_0x46ac4f,null));};exports[_0x7995('0x4a')]=function(_0x3d8ae3,_0x255313){return db['ScreenRecording'][_0x7995('0x4a')](_0x3d8ae3[_0x7995('0x4b')],{})['then'](respondWithResult(_0x255313,0xc9))[_0x7995('0x46')](handleError(_0x255313,null));};exports['update']=function(_0x1d87f9,_0x187735){if(_0x1d87f9[_0x7995('0x4b')]['id']){delete _0x1d87f9[_0x7995('0x4b')]['id'];}delete _0x1d87f9[_0x7995('0x4b')][_0x7995('0x4c')];delete _0x1d87f9[_0x7995('0x4b')]['createdAt'];delete _0x1d87f9[_0x7995('0x4b')][_0x7995('0x4d')];delete _0x1d87f9[_0x7995('0x4b')]['value'];return db[_0x7995('0x43')][_0x7995('0x49')]({'where':{'id':_0x1d87f9[_0x7995('0x4e')]['id']}})['then'](handleEntityNotFound(_0x187735,null))['then'](saveUpdates(_0x1d87f9['body'],null))[_0x7995('0x26')](respondWithResult(_0x187735,null))[_0x7995('0x46')](handleError(_0x187735,null));};exports['describe']=function(_0x1cd85,_0x29f300){return db[_0x7995('0x43')][_0x7995('0x4f')]()[_0x7995('0x26')](respondWithResult(_0x29f300,null))['catch'](handleError(_0x29f300,null));};exports[_0x7995('0x50')]=function(_0x4ab09f,_0x14fe7f,_0x33c801){var _0x206d2a=require('../../components/encryptor');var _0x5e1f34=![];var _0x54e2b1={};if(_0x4ab09f['query'][_0x7995('0x2d')]&&_0x4ab09f[_0x7995('0x33')][_0x7995('0x2d')]===_0x7995('0x51')){_0x54e2b1[_0x7995('0x51')]=_0x4ab09f[_0x7995('0x4e')]['id'];}else{_0x54e2b1['id']=_0x4ab09f[_0x7995('0x4e')]['id'];}return db[_0x7995('0x43')][_0x7995('0x49')]({'where':_0x54e2b1,'attributes':['id',_0x7995('0x52')],'raw':!![]})[_0x7995('0x26')](handleEntityNotFound(_0x14fe7f,null))[_0x7995('0x26')](function(_0x3da72b){if(_0x3da72b){var _0x35bea3=path[_0x7995('0x53')](config[_0x7995('0x54')],_0x7995('0x55'),_0x3da72b[_0x7995('0x52')]);var _0x45e86e=util['format'](_0x7995('0x56'),_0x35bea3);if(fs[_0x7995('0x57')](_0x45e86e)){_0x5e1f34=!![];return _0x206d2a[_0x7995('0x58')](_0x45e86e,_0x35bea3,config[_0x7995('0x59')]['recording'])['then'](function(){return _0x3da72b;});}return _0x3da72b;}})[_0x7995('0x26')](function(_0x197b52){if(_0x197b52){var _0x5b9467=path[_0x7995('0x53')](config['root'],_0x7995('0x55'),_0x197b52[_0x7995('0x52')]);if(!fs[_0x7995('0x57')](_0x5b9467)){throw new db[(_0x7995('0x5a'))]['ValidationError']('ScreenRecording\x20not\x20found');}if(_0x197b52[_0x7995('0x5b')]){return _0x14fe7f[_0x7995('0x50')](_0x5b9467,_0x197b52[_0x7995('0x5b')]+path[_0x7995('0x5c')](_0x5b9467),function(){if(_0x5e1f34){fs[_0x7995('0x5d')](_0x5b9467);}});}else{return _0x14fe7f[_0x7995('0x50')](_0x5b9467,function(_0x1d4689){if(_0x5e1f34){fs[_0x7995('0x5d')](_0x5b9467);}});}}})[_0x7995('0x46')](function(_0x50caf5){if(_0x50caf5[_0x7995('0x5e')]===_0x7995('0x5f')){_0x14fe7f[_0x7995('0x1c')](0x194)[_0x7995('0x2a')]('Not\x20found');}else{return handleError(_0x14fe7f,null);}});};exports['destroy']=function(_0x3053fd,_0xebb5c8){return db['ScreenRecording'][_0x7995('0x49')]({'where':{'id':_0x3053fd[_0x7995('0x4e')]['id']}})[_0x7995('0x26')](function(_0x57727e){if(_[_0x7995('0x60')](_0x57727e)){throw new ReferenceError('Entity\x20not\x20found');}return _0x57727e;})[_0x7995('0x26')](function(_0x564fca){var _0x3e0a46=path[_0x7995('0x53')](config[_0x7995('0x54')],_0x7995('0x55'),_0x564fca[_0x7995('0x52')]);logger[_0x7995('0x61')](_0x7995('0x62'),_0x3e0a46);if(!_[_0x7995('0x60')](_0x564fca[_0x7995('0x52')])&&fs[_0x7995('0x57')](_0x3e0a46)){logger[_0x7995('0x61')](_0x7995('0x63')+_0x3e0a46+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x7995('0x64')](_0x3e0a46);}_0x3e0a46=_0x3e0a46+_0x7995('0x65');if(!_[_0x7995('0x60')](_0x564fca[_0x7995('0x52')])&&fs[_0x7995('0x57')](_0x3e0a46)){logger['info']('File:\x20\x22'+_0x3e0a46+_0x7995('0x66'));fs[_0x7995('0x64')](_0x3e0a46);}return _0x564fca;})[_0x7995('0x26')](function(_0xae6166){if(!_0xae6166)throw new InternalError();return _0xae6166['destroy']();})[_0x7995('0x26')](function(){_0xebb5c8['status'](0xcc)['end']();})[_0x7995('0x46')](handleError(_0xebb5c8,null));}; \ No newline at end of file +var _0x9a19=['limit','count','set','Content-Range','save','then','destroy','error','stack','name','send','map','ScreenRecording','fieldName','type','key','model','differenceBy','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','update','duration','value','find','describe','download','../../components/encryptor','uniqueid','join','root','format','%s.cypher','existsSync','decryptFile','recording','server/files/screen_recordings','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','isNil','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','info','.cypher','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined'];(function(_0x2ab365,_0xa3812e){var _0x49fef3=function(_0x29b883){while(--_0x29b883){_0x2ab365['push'](_0x2ab365['shift']());}};_0x49fef3(++_0xa3812e);}(_0x9a19,0x114));var _0x99a1=function(_0x235f49,_0x2992b4){_0x235f49=_0x235f49-0x0;var _0x551139=_0x9a19[_0x235f49];return _0x551139;};'use strict';var emlformat=require(_0x99a1('0x0'));var rimraf=require(_0x99a1('0x1'));var zipdir=require(_0x99a1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x99a1('0x3'));var moment=require(_0x99a1('0x4'));var BPromise=require(_0x99a1('0x5'));var Mustache=require(_0x99a1('0x6'));var util=require(_0x99a1('0x7'));var path=require(_0x99a1('0x8'));var sox=require(_0x99a1('0x9'));var csv=require(_0x99a1('0xa'));var ejs=require(_0x99a1('0xb'));var fs=require('fs');var fs_extra=require(_0x99a1('0xc'));var _=require(_0x99a1('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x99a1('0xe'));var toCsv=require(_0x99a1('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x99a1('0xf'));var authService=require(_0x99a1('0x10'));var qs=require(_0x99a1('0x11'));var as=require(_0x99a1('0x12'));var hardwareService=require(_0x99a1('0x13'));var logger=require('../../config/logger')(_0x99a1('0x14'));var utils=require(_0x99a1('0x15'));var config=require(_0x99a1('0x16'));var licenseUtil=require(_0x99a1('0x17'));var db=require(_0x99a1('0x18'))['db'];function respondWithStatusCode(_0x1bc7aa,_0x2ff655){_0x2ff655=_0x2ff655||0xcc;return function(_0x532f56){if(_0x532f56){return _0x1bc7aa[_0x99a1('0x19')](_0x2ff655);}return _0x1bc7aa[_0x99a1('0x1a')](_0x2ff655)[_0x99a1('0x1b')]();};}function respondWithResult(_0x47815e,_0xe1a1f){_0xe1a1f=_0xe1a1f||0xc8;return function(_0x3c9ef4){if(_0x3c9ef4){return _0x47815e[_0x99a1('0x1a')](_0xe1a1f)['json'](_0x3c9ef4);}};}function respondWithFilteredResult(_0x2d81ed,_0x3e45d4){return function(_0x1bb464){if(_0x1bb464){var _0x3d40cc=typeof _0x3e45d4[_0x99a1('0x1c')]===_0x99a1('0x1d')&&typeof _0x3e45d4[_0x99a1('0x1e')]==='undefined';var _0x4f049c=_0x1bb464[_0x99a1('0x1f')];var _0xbf62f1=_0x3d40cc?0x0:_0x3e45d4[_0x99a1('0x1c')];var _0x1fcd00=_0x3d40cc?_0x1bb464[_0x99a1('0x1f')]:_0x3e45d4[_0x99a1('0x1c')]+_0x3e45d4[_0x99a1('0x1e')];var _0x3cd62c;if(_0x1fcd00>=_0x4f049c){_0x1fcd00=_0x4f049c;_0x3cd62c=0xc8;}else{_0x3cd62c=0xce;}_0x2d81ed[_0x99a1('0x1a')](_0x3cd62c);return _0x2d81ed[_0x99a1('0x20')](_0x99a1('0x21'),_0xbf62f1+'-'+_0x1fcd00+'/'+_0x4f049c)['json'](_0x1bb464);}return null;};}function patchUpdates(_0x3023a1){return function(_0x20007e){try{jsonpatch['apply'](_0x20007e,_0x3023a1,!![]);}catch(_0x38435b){return BPromise['reject'](_0x38435b);}return _0x20007e[_0x99a1('0x22')]();};}function saveUpdates(_0x2927b0,_0x2d6f20){return function(_0x2d3b82){if(_0x2d3b82){return _0x2d3b82['update'](_0x2927b0)[_0x99a1('0x23')](function(_0x1268a7){return _0x1268a7;});}return null;};}function removeEntity(_0x483c17,_0x44df2d){return function(_0x5b5dfa){if(_0x5b5dfa){return _0x5b5dfa[_0x99a1('0x24')]()[_0x99a1('0x23')](function(){_0x483c17[_0x99a1('0x1a')](0xcc)[_0x99a1('0x1b')]();});}};}function handleEntityNotFound(_0x3c813,_0x491341){return function(_0x4fe7f7){if(!_0x4fe7f7){_0x3c813[_0x99a1('0x19')](0x194);}return _0x4fe7f7;};}function handleError(_0x5dabd9,_0x5dc733){_0x5dc733=_0x5dc733||0x1f4;return function(_0xafea84){logger[_0x99a1('0x25')](_0xafea84[_0x99a1('0x26')]);if(_0xafea84[_0x99a1('0x27')]){delete _0xafea84[_0x99a1('0x27')];}_0x5dabd9[_0x99a1('0x1a')](_0x5dc733)[_0x99a1('0x28')](_0xafea84);};}exports['index']=function(_0xf41b0d,_0x499eef){var _0x255197={},_0x1137f2={},_0x26fbae={'count':0x0,'rows':[]};var _0x523668=_[_0x99a1('0x29')](db[_0x99a1('0x2a')]['rawAttributes'],function(_0x37514e){return{'name':_0x37514e[_0x99a1('0x2b')],'type':_0x37514e[_0x99a1('0x2c')][_0x99a1('0x2d')]};});_0x1137f2[_0x99a1('0x2e')]=_[_0x99a1('0x2f')](_[_0x99a1('0x29')](_0x523668,_0x99a1('0x27')),['format']);_0x1137f2['query']=_[_0x99a1('0x30')](_0xf41b0d['query']);_0x1137f2[_0x99a1('0x31')]=_[_0x99a1('0x32')](_0x1137f2['model'],_0x1137f2[_0x99a1('0x33')]);_0x255197[_0x99a1('0x34')]=_[_0x99a1('0x32')](_0x1137f2[_0x99a1('0x2e')],qs[_0x99a1('0x35')](_0xf41b0d[_0x99a1('0x33')][_0x99a1('0x35')]));_0x255197[_0x99a1('0x34')]=_0x255197[_0x99a1('0x34')][_0x99a1('0x36')]?_0x255197[_0x99a1('0x34')]:_0x1137f2[_0x99a1('0x2e')];if(!_0xf41b0d[_0x99a1('0x33')][_0x99a1('0x37')]('nolimit')){_0x255197['limit']=qs[_0x99a1('0x1e')](_0xf41b0d[_0x99a1('0x33')][_0x99a1('0x1e')]);_0x255197[_0x99a1('0x1c')]=qs[_0x99a1('0x1c')](_0xf41b0d[_0x99a1('0x33')][_0x99a1('0x1c')]);}_0x255197['order']=qs[_0x99a1('0x38')](_0xf41b0d[_0x99a1('0x33')]['sort']);_0x255197[_0x99a1('0x39')]=qs[_0x99a1('0x31')](_[_0x99a1('0x3a')](_0xf41b0d[_0x99a1('0x33')],_0x1137f2[_0x99a1('0x31')]),_0x523668);if(_0xf41b0d[_0x99a1('0x33')][_0x99a1('0x3b')]){_0x255197[_0x99a1('0x39')]=_[_0x99a1('0x3c')](_0x255197[_0x99a1('0x39')],{'$or':_[_0x99a1('0x29')](_0x523668,function(_0x152969){if(_0x152969[_0x99a1('0x2c')]!=='VIRTUAL'){var _0x5553e4={};_0x5553e4[_0x152969['name']]={'$like':'%'+_0xf41b0d[_0x99a1('0x33')][_0x99a1('0x3b')]+'%'};return _0x5553e4;}})});}_0x255197=_[_0x99a1('0x3c')]({},_0x255197,_0xf41b0d[_0x99a1('0x3d')]);var _0x40613a={'where':_0x255197['where']};return db[_0x99a1('0x2a')][_0x99a1('0x1f')](_0x40613a)[_0x99a1('0x23')](function(_0x51efe5){_0x26fbae['count']=_0x51efe5;if(_0xf41b0d[_0x99a1('0x33')][_0x99a1('0x3e')]){_0x255197[_0x99a1('0x3f')]=[{'all':!![]}];}return db['ScreenRecording'][_0x99a1('0x40')](_0x255197);})[_0x99a1('0x23')](function(_0x1b5d2d){_0x26fbae[_0x99a1('0x41')]=_0x1b5d2d;return _0x26fbae;})[_0x99a1('0x23')](respondWithFilteredResult(_0x499eef,_0x255197))[_0x99a1('0x42')](handleError(_0x499eef,null));};exports[_0x99a1('0x43')]=function(_0x29d0a0,_0x1c4ce4){var _0x2be9e3={'raw':![],'where':{'id':_0x29d0a0[_0x99a1('0x44')]['id']}},_0x4b40e1={};_0x4b40e1[_0x99a1('0x2e')]=_[_0x99a1('0x30')](db['ScreenRecording'][_0x99a1('0x45')]);_0x4b40e1['query']=_[_0x99a1('0x30')](_0x29d0a0[_0x99a1('0x33')]);_0x4b40e1[_0x99a1('0x31')]=_[_0x99a1('0x32')](_0x4b40e1[_0x99a1('0x2e')],_0x4b40e1[_0x99a1('0x33')]);_0x2be9e3['attributes']=_[_0x99a1('0x32')](_0x4b40e1['model'],qs[_0x99a1('0x35')](_0x29d0a0[_0x99a1('0x33')][_0x99a1('0x35')]));_0x2be9e3[_0x99a1('0x34')]=_0x2be9e3[_0x99a1('0x34')][_0x99a1('0x36')]?_0x2be9e3[_0x99a1('0x34')]:_0x4b40e1[_0x99a1('0x2e')];if(_0x29d0a0[_0x99a1('0x33')][_0x99a1('0x3e')]){_0x2be9e3[_0x99a1('0x3f')]=[{'all':!![]}];}_0x2be9e3=_['merge']({},_0x2be9e3,_0x29d0a0[_0x99a1('0x3d')]);return db[_0x99a1('0x2a')]['find'](_0x2be9e3)[_0x99a1('0x23')](handleEntityNotFound(_0x1c4ce4,null))[_0x99a1('0x23')](respondWithResult(_0x1c4ce4,null))[_0x99a1('0x42')](handleError(_0x1c4ce4,null));};exports[_0x99a1('0x46')]=function(_0x113dd9,_0x254c41){return db[_0x99a1('0x2a')]['create'](_0x113dd9[_0x99a1('0x47')],{})['then'](respondWithResult(_0x254c41,0xc9))[_0x99a1('0x42')](handleError(_0x254c41,null));};exports[_0x99a1('0x48')]=function(_0x566442,_0x5433f2){if(_0x566442[_0x99a1('0x47')]['id']){delete _0x566442[_0x99a1('0x47')]['id'];}delete _0x566442[_0x99a1('0x47')][_0x99a1('0x49')];delete _0x566442[_0x99a1('0x47')]['createdAt'];delete _0x566442['body']['closedAt'];delete _0x566442[_0x99a1('0x47')][_0x99a1('0x4a')];return db[_0x99a1('0x2a')][_0x99a1('0x4b')]({'where':{'id':_0x566442[_0x99a1('0x44')]['id']}})[_0x99a1('0x23')](handleEntityNotFound(_0x5433f2,null))[_0x99a1('0x23')](saveUpdates(_0x566442['body'],null))[_0x99a1('0x23')](respondWithResult(_0x5433f2,null))[_0x99a1('0x42')](handleError(_0x5433f2,null));};exports[_0x99a1('0x4c')]=function(_0x5e877f,_0x81e218){return db['ScreenRecording']['describe']()[_0x99a1('0x23')](respondWithResult(_0x81e218,null))[_0x99a1('0x42')](handleError(_0x81e218,null));};exports[_0x99a1('0x4d')]=function(_0x175f6d,_0x11632d,_0xf8208a){var _0x240d2e=require(_0x99a1('0x4e'));var _0x16641e=![];var _0x53e9eb={};if(_0x175f6d[_0x99a1('0x33')]['type']&&_0x175f6d[_0x99a1('0x33')][_0x99a1('0x2c')]==='uniqueid'){_0x53e9eb[_0x99a1('0x4f')]=_0x175f6d[_0x99a1('0x44')]['id'];}else{_0x53e9eb['id']=_0x175f6d[_0x99a1('0x44')]['id'];}return db[_0x99a1('0x2a')][_0x99a1('0x4b')]({'where':_0x53e9eb,'attributes':['id',_0x99a1('0x4a')],'raw':!![]})[_0x99a1('0x23')](handleEntityNotFound(_0x11632d,null))[_0x99a1('0x23')](function(_0x28ba8f){if(_0x28ba8f){var _0x1c2926=path[_0x99a1('0x50')](config[_0x99a1('0x51')],'server/files/screen_recordings',_0x28ba8f['value']);var _0x2e3e08=util[_0x99a1('0x52')](_0x99a1('0x53'),_0x1c2926);if(fs[_0x99a1('0x54')](_0x2e3e08)){_0x16641e=!![];return _0x240d2e[_0x99a1('0x55')](_0x2e3e08,_0x1c2926,config['secrets'][_0x99a1('0x56')])[_0x99a1('0x23')](function(){return _0x28ba8f;});}return _0x28ba8f;}})['then'](function(_0x6107cd){if(_0x6107cd){var _0x95f20a=path[_0x99a1('0x50')](config[_0x99a1('0x51')],_0x99a1('0x57'),_0x6107cd['value']);if(!fs[_0x99a1('0x54')](_0x95f20a)){throw new db[(_0x99a1('0x58'))][(_0x99a1('0x59'))](_0x99a1('0x5a'));}if(_0x6107cd[_0x99a1('0x5b')]){return _0x11632d[_0x99a1('0x4d')](_0x95f20a,_0x6107cd['filename']+path[_0x99a1('0x5c')](_0x95f20a),function(){if(_0x16641e){fs[_0x99a1('0x5d')](_0x95f20a);}});}else{return _0x11632d['download'](_0x95f20a,function(_0x33feb9){if(_0x16641e){fs[_0x99a1('0x5d')](_0x95f20a);}});}}})[_0x99a1('0x42')](function(_0xb126dd){if(_0xb126dd[_0x99a1('0x5e')]==='ScreenRecording\x20not\x20found'){_0x11632d[_0x99a1('0x1a')](0x194)['send']('Not\x20found');}else{return handleError(_0x11632d,null);}});};exports['destroy']=function(_0x38ce3c,_0x3f7c16){return db['ScreenRecording']['find']({'where':{'id':_0x38ce3c[_0x99a1('0x44')]['id']}})['then'](function(_0x21a5f6){if(_[_0x99a1('0x5f')](_0x21a5f6)){throw new ReferenceError(_0x99a1('0x60'));}return _0x21a5f6;})[_0x99a1('0x23')](function(_0x56d6cf){var _0x18f74b=path[_0x99a1('0x50')](config[_0x99a1('0x51')],'server/files/screen_recordings',_0x56d6cf[_0x99a1('0x4a')]);logger['info'](_0x99a1('0x61'),_0x18f74b);if(!_[_0x99a1('0x5f')](_0x56d6cf[_0x99a1('0x4a')])&&fs[_0x99a1('0x54')](_0x18f74b)){logger[_0x99a1('0x62')]('File:\x20\x22'+_0x18f74b+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x18f74b);}_0x18f74b=_0x18f74b+_0x99a1('0x63');if(!_[_0x99a1('0x5f')](_0x56d6cf['value'])&&fs['existsSync'](_0x18f74b)){logger[_0x99a1('0x62')](_0x99a1('0x64')+_0x18f74b+_0x99a1('0x65'));fs['unlinkSync'](_0x18f74b);}return _0x56d6cf;})['then'](function(_0x2b8df8){if(!_0x2b8df8)throw new InternalError();return _0x2b8df8['destroy']();})[_0x99a1('0x23')](function(){_0x3f7c16[_0x99a1('0x1a')](0xcc)[_0x99a1('0x1b')]();})['catch'](handleError(_0x3f7c16,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index 06f6034..ead9eab 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 _0x316c=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./screenRecording.attributes','define','ScreenRecording','screen_recordings','interactionid','lodash','util'];(function(_0x1cb455,_0x183114){var _0x5f1d53=function(_0x5e2c11){while(--_0x5e2c11){_0x1cb455['push'](_0x1cb455['shift']());}};_0x5f1d53(++_0x183114);}(_0x316c,0x14e));var _0xc316=function(_0x1d34ea,_0x45b052){_0x1d34ea=_0x1d34ea-0x0;var _0x5cb60b=_0x316c[_0x1d34ea];return _0x5cb60b;};'use strict';var _=require(_0xc316('0x0'));var util=require(_0xc316('0x1'));var logger=require(_0xc316('0x2'))(_0xc316('0x3'));var moment=require(_0xc316('0x4'));var BPromise=require('bluebird');var rp=require(_0xc316('0x5'));var fs=require('fs');var path=require(_0xc316('0x6'));var rimraf=require(_0xc316('0x7'));var config=require(_0xc316('0x8'));var attributes=require(_0xc316('0x9'));module['exports']=function(_0x3e25cd,_0x154a40){return _0x3e25cd[_0xc316('0xa')](_0xc316('0xb'),attributes,{'tableName':_0xc316('0xc'),'paranoid':![],'indexes':[{'name':_0xc316('0xd'),'fields':[_0xc316('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xfba2=['path','../../config/environment','./screenRecording.attributes','exports','screen_recordings','interactionid','util','../../config/logger','api','moment','request-promise'];(function(_0x1d8199,_0xe98f8c){var _0x2b8e8d=function(_0x44283d){while(--_0x44283d){_0x1d8199['push'](_0x1d8199['shift']());}};_0x2b8e8d(++_0xe98f8c);}(_0xfba2,0x95));var _0x2fba=function(_0xcf7a81,_0x1338b9){_0xcf7a81=_0xcf7a81-0x0;var _0x22dd8a=_0xfba2[_0xcf7a81];return _0x22dd8a;};'use strict';var _=require('lodash');var util=require(_0x2fba('0x0'));var logger=require(_0x2fba('0x1'))(_0x2fba('0x2'));var moment=require(_0x2fba('0x3'));var BPromise=require('bluebird');var rp=require(_0x2fba('0x4'));var fs=require('fs');var path=require(_0x2fba('0x5'));var rimraf=require('rimraf');var config=require(_0x2fba('0x6'));var attributes=require(_0x2fba('0x7'));module[_0x2fba('0x8')]=function(_0x5a834a,_0x517ffc){return _0x5a834a['define']('ScreenRecording',attributes,{'tableName':_0x2fba('0x9'),'paranoid':![],'indexes':[{'name':'interactionid','fields':[_0x2fba('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index adb65b4..1a70eda 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 _0xa40a=['ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','message','ScreenRecording,\x20%s,\x20%s','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent'];(function(_0x265772,_0x47fd5d){var _0x1402ab=function(_0x365648){while(--_0x365648){_0x265772['push'](_0x265772['shift']());}};_0x1402ab(++_0x47fd5d);}(_0xa40a,0x13b));var _0xaa40=function(_0x5923e8,_0xc8d316){_0x5923e8=_0x5923e8-0x0;var _0x7a1148=_0xa40a[_0x5923e8];return _0x7a1148;};'use strict';var _=require(_0xaa40('0x0'));var util=require('util');var moment=require(_0xaa40('0x1'));var BPromise=require('bluebird');var rs=require(_0xaa40('0x2'));var fs=require('fs');var Redis=require(_0xaa40('0x3'));var db=require(_0xaa40('0x4'))['db'];var utils=require(_0xaa40('0x5'));var logger=require(_0xaa40('0x6'))(_0xaa40('0x7'));var config=require(_0xaa40('0x8'));var jayson=require(_0xaa40('0x9'));var client=jayson[_0xaa40('0xa')][_0xaa40('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x42d391,_0x3e8743,_0x480ef0){return new BPromise(function(_0x13723a,_0x27b18a){return client[_0xaa40('0xc')](_0x42d391,_0x480ef0)['then'](function(_0x47d8c3){logger[_0xaa40('0xd')]('ScreenRecording,\x20%s,\x20%s',_0x3e8743,_0xaa40('0xe'));logger['debug'](_0xaa40('0xf'),_0x3e8743,'request\x20sent',JSON[_0xaa40('0x10')](_0x47d8c3));if(_0x47d8c3['error']){if(_0x47d8c3[_0xaa40('0x11')]['code']===0x1f4){logger['error']('ScreenRecording,\x20%s,\x20%s',_0x3e8743,_0x47d8c3[_0xaa40('0x11')][_0xaa40('0x12')]);return _0x27b18a(_0x47d8c3[_0xaa40('0x11')][_0xaa40('0x12')]);}logger[_0xaa40('0x11')](_0xaa40('0x13'),_0x3e8743,_0x47d8c3[_0xaa40('0x11')][_0xaa40('0x12')]);return _0x13723a(_0x47d8c3[_0xaa40('0x11')]['message']);}else{logger['info'](_0xaa40('0x13'),_0x3e8743,_0xaa40('0xe'));_0x13723a(_0x47d8c3[_0xaa40('0x14')][_0xaa40('0x12')]);}})[_0xaa40('0x15')](function(_0x3436dd){logger[_0xaa40('0x11')](_0xaa40('0x13'),_0x3e8743,_0x3436dd);_0x27b18a(_0x3436dd);});});} \ No newline at end of file +var _0x8699=['catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','request','then','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x430205,_0x328c94){var _0x3f5146=function(_0x3cd6bd){while(--_0x3cd6bd){_0x430205['push'](_0x430205['shift']());}};_0x3f5146(++_0x328c94);}(_0x8699,0x109));var _0x9869=function(_0x5541ae,_0x4a902d){_0x5541ae=_0x5541ae-0x0;var _0x42adf6=_0x8699[_0x5541ae];return _0x42adf6;};'use strict';var _=require(_0x9869('0x0'));var util=require('util');var moment=require(_0x9869('0x1'));var BPromise=require(_0x9869('0x2'));var rs=require(_0x9869('0x3'));var fs=require('fs');var Redis=require(_0x9869('0x4'));var db=require(_0x9869('0x5'))['db'];var utils=require(_0x9869('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x9869('0x7'));var client=jayson[_0x9869('0x8')][_0x9869('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x33976a,_0x2376f1,_0x2c30dc){return new BPromise(function(_0x445496,_0x4b34ba){return client[_0x9869('0xa')](_0x33976a,_0x2c30dc)[_0x9869('0xb')](function(_0x587fa5){logger[_0x9869('0xc')](_0x9869('0xd'),_0x2376f1,_0x9869('0xe'));logger[_0x9869('0xf')](_0x9869('0x10'),_0x2376f1,'request\x20sent',JSON[_0x9869('0x11')](_0x587fa5));if(_0x587fa5['error']){if(_0x587fa5[_0x9869('0x12')][_0x9869('0x13')]===0x1f4){logger[_0x9869('0x12')]('ScreenRecording,\x20%s,\x20%s',_0x2376f1,_0x587fa5[_0x9869('0x12')][_0x9869('0x14')]);return _0x4b34ba(_0x587fa5['error'][_0x9869('0x14')]);}logger[_0x9869('0x12')]('ScreenRecording,\x20%s,\x20%s',_0x2376f1,_0x587fa5['error'][_0x9869('0x14')]);return _0x445496(_0x587fa5[_0x9869('0x12')][_0x9869('0x14')]);}else{logger[_0x9869('0xc')](_0x9869('0xd'),_0x2376f1,_0x9869('0xe'));_0x445496(_0x587fa5['result'][_0x9869('0x14')]);}})[_0x9869('0x15')](function(_0x2e8546){logger[_0x9869('0x12')]('ScreenRecording,\x20%s,\x20%s',_0x2376f1,_0x2e8546);_0x4b34ba(_0x2e8546);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index 5475b25..48ca5a2 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 _0x64cf=['isAuthenticated','update','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','get','index','/now','getDate','/:id','show','getLogo','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','getFavicon','diskStorage','join','root','server/files/images/logos/','%s%s','logo','extname','post','/:id/logo','single','file','addLogo','format','logologin','originalname','/:id/logo_login','addLogoLogin','preferred','addPreferred','favicon','/:id/favicon','addFavicon','put'];(function(_0x360041,_0x50b099){var _0x2b80a7=function(_0x5386d8){while(--_0x5386d8){_0x360041['push'](_0x360041['shift']());}};_0x2b80a7(++_0x50b099);}(_0x64cf,0x1ce));var _0xf64c=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x64cf[_0x2be8c2];return _0x97f531;};'use strict';var multer=require(_0xf64c('0x0'));var util=require('util');var path=require(_0xf64c('0x1'));var timeout=require(_0xf64c('0x2'));var express=require('express');var router=express[_0xf64c('0x3')]();var fs_extra=require(_0xf64c('0x4'));var auth=require(_0xf64c('0x5'));var interaction=require(_0xf64c('0x6'));var config=require(_0xf64c('0x7'));var controller=require(_0xf64c('0x8'));router[_0xf64c('0x9')]('/',auth['isAuthenticated'](),controller[_0xf64c('0xa')]);router[_0xf64c('0x9')](_0xf64c('0xb'),controller[_0xf64c('0xc')]);router[_0xf64c('0x9')](_0xf64c('0xd'),controller[_0xf64c('0xe')]);router[_0xf64c('0x9')]('/:id/logo',controller[_0xf64c('0xf')]);router['get']('/:id/logo_login',controller[_0xf64c('0x10')]);router['get'](_0xf64c('0x11'),controller[_0xf64c('0x12')]);router[_0xf64c('0x9')](_0xf64c('0x13'),controller['getPreferred']);router[_0xf64c('0x9')]('/:id/favicon',controller[_0xf64c('0x14')]);var upload=multer({'storage':multer[_0xf64c('0x15')]({'destination':function(_0x11bb7e,_0x255e78,_0x4e8b04){_0x4e8b04(null,path[_0xf64c('0x16')](config[_0xf64c('0x17')],_0xf64c('0x18')));},'filename':function(_0x36c0c5,_0x54d7f7,_0x2906f0){_0x2906f0(null,util['format'](_0xf64c('0x19'),_0xf64c('0x1a'),path[_0xf64c('0x1b')](_0x54d7f7['originalname'])));}})});router[_0xf64c('0x1c')](_0xf64c('0x1d'),upload[_0xf64c('0x1e')](_0xf64c('0x1f')),controller[_0xf64c('0x20')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5e045b,_0x16f4bc,_0x36aa6b){_0x36aa6b(null,path[_0xf64c('0x16')](config[_0xf64c('0x17')],_0xf64c('0x18')));},'filename':function(_0x2a1d47,_0x241162,_0x457bb6){_0x457bb6(null,util[_0xf64c('0x21')]('%s%s',_0xf64c('0x22'),path[_0xf64c('0x1b')](_0x241162[_0xf64c('0x23')])));}})});router[_0xf64c('0x1c')](_0xf64c('0x24'),upload[_0xf64c('0x1e')](_0xf64c('0x1f')),controller[_0xf64c('0x25')]);var upload=multer({'storage':multer[_0xf64c('0x15')]({'destination':function(_0x55951f,_0x2ad2b5,_0x1fa20e){_0x1fa20e(null,path[_0xf64c('0x16')](config[_0xf64c('0x17')],'server/files/images/logos/'));},'filename':function(_0xe3e2df,_0x1d37df,_0x5e69cf){_0x5e69cf(null,util[_0xf64c('0x21')](_0xf64c('0x19'),_0xf64c('0x26'),path[_0xf64c('0x1b')](_0x1d37df['originalname'])));}})});router['post'](_0xf64c('0x13'),upload[_0xf64c('0x1e')](_0xf64c('0x1f')),controller[_0xf64c('0x27')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x15f2d3,_0x1fa783,_0x4a5e06){_0x4a5e06(null,path['join'](config['root'],'server/files/images/logos/'));},'filename':function(_0x293bcc,_0x115385,_0x382bba){_0x382bba(null,util[_0xf64c('0x21')](_0xf64c('0x19'),_0xf64c('0x28'),path[_0xf64c('0x1b')](_0x115385['originalname'])));}})});router['post'](_0xf64c('0x29'),upload[_0xf64c('0x1e')]('file'),controller[_0xf64c('0x2a')]);router[_0xf64c('0x2b')](_0xf64c('0xd'),auth[_0xf64c('0x2c')](),controller[_0xf64c('0x2d')]);module['exports']=router; \ No newline at end of file +var _0x5ea4=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','get','isAuthenticated','index','/now','/:id','/:id/logo','getLogo','/:id/logo_login','/:id/gdpr','gdpr','/:id/preferred','getPreferred','getFavicon','diskStorage','join','root','server/files/images/logos/','%s%s','logo','extname','originalname','file','format','logologin','post','single','addLogoLogin','preferred','favicon','/:id/favicon','put','update','exports','multer','util'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x5ea4,0x181));var _0x45ea=function(_0x4b3d8b,_0xe8da7f){_0x4b3d8b=_0x4b3d8b-0x0;var _0x50878b=_0x5ea4[_0x4b3d8b];return _0x50878b;};'use strict';var multer=require(_0x45ea('0x0'));var util=require(_0x45ea('0x1'));var path=require(_0x45ea('0x2'));var timeout=require(_0x45ea('0x3'));var express=require(_0x45ea('0x4'));var router=express[_0x45ea('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x45ea('0x6'));var interaction=require(_0x45ea('0x7'));var config=require(_0x45ea('0x8'));var controller=require(_0x45ea('0x9'));router[_0x45ea('0xa')]('/',auth[_0x45ea('0xb')](),controller[_0x45ea('0xc')]);router[_0x45ea('0xa')](_0x45ea('0xd'),controller['getDate']);router[_0x45ea('0xa')](_0x45ea('0xe'),controller['show']);router['get'](_0x45ea('0xf'),controller[_0x45ea('0x10')]);router[_0x45ea('0xa')](_0x45ea('0x11'),controller['getLogoLogin']);router[_0x45ea('0xa')](_0x45ea('0x12'),controller[_0x45ea('0x13')]);router[_0x45ea('0xa')](_0x45ea('0x14'),controller[_0x45ea('0x15')]);router[_0x45ea('0xa')]('/:id/favicon',controller[_0x45ea('0x16')]);var upload=multer({'storage':multer[_0x45ea('0x17')]({'destination':function(_0x2078b5,_0x3e7436,_0x3745c2){_0x3745c2(null,path[_0x45ea('0x18')](config[_0x45ea('0x19')],_0x45ea('0x1a')));},'filename':function(_0x5ac8bc,_0x17524c,_0x394f3b){_0x394f3b(null,util['format'](_0x45ea('0x1b'),_0x45ea('0x1c'),path[_0x45ea('0x1d')](_0x17524c[_0x45ea('0x1e')])));}})});router['post'](_0x45ea('0xf'),upload['single'](_0x45ea('0x1f')),controller['addLogo']);var upload=multer({'storage':multer[_0x45ea('0x17')]({'destination':function(_0x53c59f,_0x11669a,_0x589814){_0x589814(null,path['join'](config[_0x45ea('0x19')],_0x45ea('0x1a')));},'filename':function(_0x539689,_0x45e533,_0x4707ad){_0x4707ad(null,util[_0x45ea('0x20')](_0x45ea('0x1b'),_0x45ea('0x21'),path[_0x45ea('0x1d')](_0x45e533[_0x45ea('0x1e')])));}})});router[_0x45ea('0x22')](_0x45ea('0x11'),upload[_0x45ea('0x23')](_0x45ea('0x1f')),controller[_0x45ea('0x24')]);var upload=multer({'storage':multer[_0x45ea('0x17')]({'destination':function(_0x1708c5,_0x1ef917,_0x3f5718){_0x3f5718(null,path['join'](config[_0x45ea('0x19')],_0x45ea('0x1a')));},'filename':function(_0x378279,_0x5e0ef3,_0x478c9c){_0x478c9c(null,util[_0x45ea('0x20')](_0x45ea('0x1b'),_0x45ea('0x25'),path[_0x45ea('0x1d')](_0x5e0ef3['originalname'])));}})});router[_0x45ea('0x22')](_0x45ea('0x14'),upload['single'](_0x45ea('0x1f')),controller['addPreferred']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x54ae1f,_0x32e816,_0x23840b){_0x23840b(null,path[_0x45ea('0x18')](config[_0x45ea('0x19')],'server/files/images/logos/'));},'filename':function(_0x555741,_0x3a282f,_0x22b154){_0x22b154(null,util['format'](_0x45ea('0x1b'),_0x45ea('0x26'),path[_0x45ea('0x1d')](_0x3a282f[_0x45ea('0x1e')])));}})});router[_0x45ea('0x22')](_0x45ea('0x27'),upload[_0x45ea('0x23')](_0x45ea('0x1f')),controller['addFavicon']);router[_0x45ea('0x28')]('/:id',auth[_0x45ea('0xb')](),controller[_0x45ea('0x29')]);module[_0x45ea('0x2a')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index aa2510b..bee6647 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 _0x7a54=['UNSIGNED','sequelize','exports','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','alternate'];(function(_0x4c2234,_0x123640){var _0x14cde8=function(_0x1937c9){while(--_0x1937c9){_0x4c2234['push'](_0x4c2234['shift']());}};_0x14cde8(++_0x123640);}(_0x7a54,0x106));var _0x47a5=function(_0x3e9507,_0x5c7bf7){_0x3e9507=_0x3e9507-0x0;var _0x352415=_0x7a54[_0x3e9507];return _0x352415;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'min_internal':{'type':Sequelize[_0x47a5('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x47a5('0x2')](0xb),'unique':_0x47a5('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x47a5('0x4')],'defaultValue':_0x47a5('0x5')},'logo':{'type':Sequelize[_0x47a5('0x4')]},'defaultLogo':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x47a5('0x4')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x47a5('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x47a5('0x4')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize['STRING']},'defaultPageTitle':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize['STRING'],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':![]},'split':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x47a5('0x4')],'defaultValue':_0x47a5('0x7')},'chatTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x47a5('0x4')]},'defaultPreferred':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x47a5('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x47a5('0x4')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0x47a5('0x2')]},'transcribeRegion':{'type':Sequelize[_0x47a5('0x4')]},'sentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x47a5('0x2')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'bucket':{'type':Sequelize[_0x47a5('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x47a5('0x2')](0x2)[_0x47a5('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x47a5('0x2')](0x2)[_0x47a5('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x47a5('0x2')](0x2)[_0x47a5('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize['INTEGER'](0x2)[_0x47a5('0x8')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':![]}}; \ No newline at end of file +var _0x2ef3=['min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','UNSIGNED','sequelize','exports','INTEGER','min_internal'];(function(_0x209425,_0x40fbba){var _0xd880a8=function(_0x15b320){while(--_0x15b320){_0x209425['push'](_0x209425['shift']());}};_0xd880a8(++_0x40fbba);}(_0x2ef3,0xba));var _0x32ef=function(_0x59f68b,_0x50ba79){_0x59f68b=_0x59f68b-0x0;var _0x32ba9e=_0x2ef3[_0x59f68b];return _0x32ba9e;};'use strict';var Sequelize=require(_0x32ef('0x0'));module[_0x32ef('0x1')]={'min_internal':{'type':Sequelize[_0x32ef('0x2')](0xb),'unique':_0x32ef('0x3'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x32ef('0x2')](0xb),'unique':_0x32ef('0x4'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x32ef('0x5')],'defaultValue':_0x32ef('0x6')},'logo':{'type':Sequelize['STRING']},'defaultLogo':{'type':Sequelize[_0x32ef('0x7')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x32ef('0x5')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize['STRING']},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x32ef('0x7')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x32ef('0x7')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x32ef('0x7')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x32ef('0x5')]},'turnaddr':{'type':Sequelize[_0x32ef('0x5')]},'turnusername':{'type':Sequelize[_0x32ef('0x5')]},'turnpassword':{'type':Sequelize[_0x32ef('0x5')]},'pageTitle':{'type':Sequelize[_0x32ef('0x5')]},'defaultPageTitle':{'type':Sequelize[_0x32ef('0x7')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x32ef('0x7')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x32ef('0x5')],'defaultValue':_0x32ef('0x8')},'enableEmailPreview':{'type':Sequelize[_0x32ef('0x7')],'defaultValue':![]},'split':{'type':Sequelize[_0x32ef('0x7')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x32ef('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x32ef('0x5')],'defaultValue':'alternate'},'chatTimeout':{'type':Sequelize[_0x32ef('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x32ef('0x7')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x32ef('0x7')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize['STRING']},'allowedLoginAttempts':{'type':Sequelize[_0x32ef('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x32ef('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x32ef('0x5')]},'defaultFavicon':{'type':Sequelize[_0x32ef('0x7')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize['INTEGER'],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0x32ef('0x2')]},'transcribeRegion':{'type':Sequelize[_0x32ef('0x5')]},'sentiment':{'type':Sequelize[_0x32ef('0x7')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize['INTEGER']},'sentimentRegion':{'type':Sequelize[_0x32ef('0x5')]},'language':{'type':Sequelize[_0x32ef('0x5')]},'bucket':{'type':Sequelize[_0x32ef('0x5')]},'googleSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x32ef('0x7')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x32ef('0x2')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x32ef('0x2')](0x2)[_0x32ef('0x9')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x32ef('0x2')](0x2)[_0x32ef('0x9')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x32ef('0x2')](0x2)[_0x32ef('0x9')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x32ef('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x32ef('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0x32ef('0x2')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x32ef('0x7')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index e43a5b6..103c171 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 _0x37f8=['error','Setting,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','destroy','stack','name','send','index','rawAttributes','key','model','map','query','keys','filters','intersection','attributes','fields','order','sort','where','pick','filter','type','VIRTUAL','merge','options','Setting','includeAll','include','findAll','rows','show','params','length','body','find','file','filename','logo','addLogoLogin','loginLogo','getLogo','getLicense','preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','existsSync','join','root','toLower','default_logo.svg','Sequelize','ValidationError','upperFirst','download','server/files/images/logos','default_loginLogo.svg','default','custom','\x20not\x20found','gdpr','securePassword','addPreferred','getPreferred','defaultFavicon','default_preferred.png','addFavicon','getFavicon','getDate','utcOffset','now','format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','http','request','then','info','request\x20sent','debug','stringify'];(function(_0x332d0c,_0x59d5dc){var _0x2c7ab5=function(_0x99dd21){while(--_0x99dd21){_0x332d0c['push'](_0x332d0c['shift']());}};_0x2c7ab5(++_0x59d5dc);}(_0x37f8,0xd2));var _0x837f=function(_0x530b03,_0x16c200){_0x530b03=_0x530b03-0x0;var _0x518292=_0x37f8[_0x530b03];return _0x518292;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x837f('0x0'));var zipdir=require(_0x837f('0x1'));var jsonpatch=require(_0x837f('0x2'));var rp=require(_0x837f('0x3'));var moment=require('moment');var BPromise=require(_0x837f('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x837f('0x5'));var fs=require('fs');var fs_extra=require(_0x837f('0x6'));var _=require(_0x837f('0x7'));var squel=require(_0x837f('0x8'));var crypto=require(_0x837f('0x9'));var jsforce=require(_0x837f('0xa'));var deskjs=require(_0x837f('0xb'));var toCsv=require(_0x837f('0xc'));var querystring=require(_0x837f('0xd'));var Papa=require(_0x837f('0xe'));var Redis=require(_0x837f('0xf'));var authService=require(_0x837f('0x10'));var qs=require(_0x837f('0x11'));var as=require(_0x837f('0x12'));var hardwareService=require(_0x837f('0x13'));var logger=require('../../config/logger')(_0x837f('0x14'));var utils=require(_0x837f('0x15'));var config=require(_0x837f('0x16'));var licenseUtil=require(_0x837f('0x17'));var db=require(_0x837f('0x18'))['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0x837f('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x3ccec4,_0x20be3c,_0x3e38ea,_0x2b3cd6){return new BPromise(function(_0x483267,_0x18d8aa){var _0xb5b3f4=_0x2b3cd6||client;return _0xb5b3f4[_0x837f('0x1a')](_0x3ccec4,_0x3e38ea)[_0x837f('0x1b')](function(_0x2e4257){logger[_0x837f('0x1c')]('Setting,\x20%s,\x20%s',_0x20be3c,_0x837f('0x1d'));logger[_0x837f('0x1e')]('Setting,\x20%s,\x20%s,\x20%s',_0x20be3c,_0x837f('0x1d'),JSON[_0x837f('0x1f')](_0x2e4257));if(_0x2e4257[_0x837f('0x20')]){if(_0x2e4257[_0x837f('0x20')]['code']===0x1f4){logger[_0x837f('0x20')](_0x837f('0x21'),_0x20be3c,_0x2e4257[_0x837f('0x20')][_0x837f('0x22')]);return _0x18d8aa(_0x2e4257[_0x837f('0x20')]['message']);}logger[_0x837f('0x20')](_0x837f('0x21'),_0x20be3c,_0x2e4257[_0x837f('0x20')][_0x837f('0x22')]);return _0x483267(_0x2e4257[_0x837f('0x20')]['message']);}else{logger[_0x837f('0x1c')](_0x837f('0x21'),_0x20be3c,_0x837f('0x1d'));_0x483267(_0x2e4257[_0x837f('0x23')][_0x837f('0x22')]);}})[_0x837f('0x24')](function(_0x41d102){logger[_0x837f('0x20')](_0x837f('0x21'),_0x20be3c,_0x41d102);_0x18d8aa(_0x41d102);});});}function respondWithStatusCode(_0x168455,_0x3fa18e){_0x3fa18e=_0x3fa18e||0xcc;return function(_0xfb4df0){if(_0xfb4df0){return _0x168455[_0x837f('0x25')](_0x3fa18e);}return _0x168455[_0x837f('0x26')](_0x3fa18e)[_0x837f('0x27')]();};}function respondWithResult(_0x11eb55,_0x43ca7d){_0x43ca7d=_0x43ca7d||0xc8;return function(_0x38da9f){if(_0x38da9f){return _0x11eb55[_0x837f('0x26')](_0x43ca7d)[_0x837f('0x28')](_0x38da9f);}};}function respondWithFilteredResult(_0x2c6a90,_0x246637){return function(_0x21f826){if(_0x21f826){var _0x4d2c23=typeof _0x246637[_0x837f('0x29')]===_0x837f('0x2a')&&typeof _0x246637[_0x837f('0x2b')]==='undefined';var _0x530f6d=_0x21f826[_0x837f('0x2c')];var _0x1ab2e4=_0x4d2c23?0x0:_0x246637[_0x837f('0x29')];var _0x4072a4=_0x4d2c23?_0x21f826[_0x837f('0x2c')]:_0x246637[_0x837f('0x29')]+_0x246637[_0x837f('0x2b')];var _0x507984;if(_0x4072a4>=_0x530f6d){_0x4072a4=_0x530f6d;_0x507984=0xc8;}else{_0x507984=0xce;}_0x2c6a90[_0x837f('0x26')](_0x507984);return _0x2c6a90[_0x837f('0x2d')](_0x837f('0x2e'),_0x1ab2e4+'-'+_0x4072a4+'/'+_0x530f6d)[_0x837f('0x28')](_0x21f826);}return null;};}function patchUpdates(_0x5d53c6){return function(_0x4e4528){try{jsonpatch['apply'](_0x4e4528,_0x5d53c6,!![]);}catch(_0x282ecb){return BPromise[_0x837f('0x2f')](_0x282ecb);}return _0x4e4528[_0x837f('0x30')]();};}function saveUpdates(_0x422498,_0x5e186e){return function(_0x223bf8){if(_0x223bf8){return _0x223bf8['update'](_0x422498)[_0x837f('0x1b')](function(_0x48f651){return _0x48f651;});}return null;};}function removeEntity(_0x5e98b5,_0x12bcec){return function(_0x252ea2){if(_0x252ea2){return _0x252ea2[_0x837f('0x31')]()[_0x837f('0x1b')](function(){_0x5e98b5[_0x837f('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x56ddfc,_0xb66cab){return function(_0x4c6710){if(!_0x4c6710){_0x56ddfc[_0x837f('0x25')](0x194);}return _0x4c6710;};}function handleError(_0x22a721,_0x59cdc4){_0x59cdc4=_0x59cdc4||0x1f4;return function(_0x245342){logger[_0x837f('0x20')](_0x245342[_0x837f('0x32')]);if(_0x245342[_0x837f('0x33')]){delete _0x245342[_0x837f('0x33')];}_0x22a721['status'](_0x59cdc4)[_0x837f('0x34')](_0x245342);};}exports[_0x837f('0x35')]=function(_0x2a8c50,_0x1cab29){var _0x901cf={},_0x53215a={},_0x562b48={'count':0x0,'rows':[]};var _0x452daa=_['map'](db['Setting'][_0x837f('0x36')],function(_0x1c7352){return{'name':_0x1c7352['fieldName'],'type':_0x1c7352['type'][_0x837f('0x37')]};});_0x53215a[_0x837f('0x38')]=_[_0x837f('0x39')](_0x452daa,'name');_0x53215a[_0x837f('0x3a')]=_[_0x837f('0x3b')](_0x2a8c50[_0x837f('0x3a')]);_0x53215a[_0x837f('0x3c')]=_[_0x837f('0x3d')](_0x53215a['model'],_0x53215a['query']);_0x901cf[_0x837f('0x3e')]=_[_0x837f('0x3d')](_0x53215a[_0x837f('0x38')],qs['fields'](_0x2a8c50['query'][_0x837f('0x3f')]));_0x901cf[_0x837f('0x3e')]=_0x901cf[_0x837f('0x3e')]['length']?_0x901cf[_0x837f('0x3e')]:_0x53215a[_0x837f('0x38')];if(!_0x2a8c50['query']['hasOwnProperty']('nolimit')){_0x901cf[_0x837f('0x2b')]=qs[_0x837f('0x2b')](_0x2a8c50[_0x837f('0x3a')][_0x837f('0x2b')]);_0x901cf[_0x837f('0x29')]=qs[_0x837f('0x29')](_0x2a8c50[_0x837f('0x3a')][_0x837f('0x29')]);}_0x901cf[_0x837f('0x40')]=qs[_0x837f('0x41')](_0x2a8c50['query'][_0x837f('0x41')]);_0x901cf[_0x837f('0x42')]=qs['filters'](_[_0x837f('0x43')](_0x2a8c50[_0x837f('0x3a')],_0x53215a[_0x837f('0x3c')]),_0x452daa);if(_0x2a8c50[_0x837f('0x3a')][_0x837f('0x44')]){_0x901cf[_0x837f('0x42')]=_['merge'](_0x901cf[_0x837f('0x42')],{'$or':_[_0x837f('0x39')](_0x452daa,function(_0x28377a){if(_0x28377a[_0x837f('0x45')]!==_0x837f('0x46')){var _0x4530ac={};_0x4530ac[_0x28377a[_0x837f('0x33')]]={'$like':'%'+_0x2a8c50[_0x837f('0x3a')]['filter']+'%'};return _0x4530ac;}})});}_0x901cf=_[_0x837f('0x47')]({},_0x901cf,_0x2a8c50[_0x837f('0x48')]);var _0x4f9dcf={'where':_0x901cf[_0x837f('0x42')]};return db[_0x837f('0x49')]['count'](_0x4f9dcf)[_0x837f('0x1b')](function(_0x259a70){_0x562b48[_0x837f('0x2c')]=_0x259a70;if(_0x2a8c50[_0x837f('0x3a')][_0x837f('0x4a')]){_0x901cf[_0x837f('0x4b')]=[{'all':!![]}];}return db['Setting'][_0x837f('0x4c')](_0x901cf);})['then'](function(_0x1146ef){_0x562b48[_0x837f('0x4d')]=_0x1146ef;return _0x562b48;})[_0x837f('0x1b')](respondWithFilteredResult(_0x1cab29,_0x901cf))[_0x837f('0x24')](handleError(_0x1cab29,null));};exports[_0x837f('0x4e')]=function(_0x1e82aa,_0x50bd1b){var _0x554f74={'raw':![],'where':{'id':_0x1e82aa[_0x837f('0x4f')]['id']}},_0x5edfcc={};_0x5edfcc[_0x837f('0x38')]=_['keys'](db[_0x837f('0x49')]['rawAttributes']);_0x5edfcc[_0x837f('0x3a')]=_[_0x837f('0x3b')](_0x1e82aa[_0x837f('0x3a')]);_0x5edfcc[_0x837f('0x3c')]=_[_0x837f('0x3d')](_0x5edfcc[_0x837f('0x38')],_0x5edfcc['query']);_0x554f74[_0x837f('0x3e')]=_['intersection'](_0x5edfcc[_0x837f('0x38')],qs[_0x837f('0x3f')](_0x1e82aa[_0x837f('0x3a')]['fields']));_0x554f74[_0x837f('0x3e')]=_0x554f74[_0x837f('0x3e')][_0x837f('0x50')]?_0x554f74[_0x837f('0x3e')]:_0x5edfcc[_0x837f('0x38')];if(_0x1e82aa[_0x837f('0x3a')]['includeAll']){_0x554f74[_0x837f('0x4b')]=[{'all':!![]}];}_0x554f74=_[_0x837f('0x47')]({},_0x554f74,_0x1e82aa[_0x837f('0x48')]);return db[_0x837f('0x49')]['find'](_0x554f74)[_0x837f('0x1b')](handleEntityNotFound(_0x50bd1b,null))['then'](respondWithResult(_0x50bd1b,null))[_0x837f('0x24')](handleError(_0x50bd1b,null));};exports['update']=function(_0x23d555,_0x4655fb){if(_0x23d555[_0x837f('0x51')]['id']){delete _0x23d555[_0x837f('0x51')]['id'];}return db[_0x837f('0x49')][_0x837f('0x52')]({'where':{'id':_0x23d555[_0x837f('0x4f')]['id']}})[_0x837f('0x1b')](handleEntityNotFound(_0x4655fb,null))[_0x837f('0x1b')](saveUpdates(_0x23d555[_0x837f('0x51')],null))[_0x837f('0x1b')](respondWithResult(_0x4655fb,null))[_0x837f('0x24')](handleError(_0x4655fb,null));};exports['addLogo']=function(_0x4ade1b,_0x16cb00,_0x53d46d){if(_0x4ade1b[_0x837f('0x53')]&&_0x4ade1b[_0x837f('0x53')][_0x837f('0x54')]){_0x4ade1b[_0x837f('0x51')][_0x837f('0x55')]=_0x4ade1b[_0x837f('0x53')][_0x837f('0x54')];}return db[_0x837f('0x49')][_0x837f('0x52')]({'where':{'id':_0x4ade1b[_0x837f('0x4f')]['id']}})[_0x837f('0x1b')](handleEntityNotFound(_0x16cb00,null))[_0x837f('0x1b')](saveUpdates(_0x4ade1b[_0x837f('0x51')],null))['then'](respondWithResult(_0x16cb00,null))[_0x837f('0x24')](handleError(_0x16cb00,null));};exports[_0x837f('0x56')]=function(_0xc595c9,_0x5acfab,_0x6db423){if(_0xc595c9[_0x837f('0x53')]&&_0xc595c9[_0x837f('0x53')][_0x837f('0x54')]){_0xc595c9[_0x837f('0x51')][_0x837f('0x57')]=_0xc595c9[_0x837f('0x53')]['filename'];}return db[_0x837f('0x49')][_0x837f('0x52')]({'where':{'id':_0xc595c9[_0x837f('0x4f')]['id']}})['then'](handleEntityNotFound(_0x5acfab,null))[_0x837f('0x1b')](saveUpdates(_0xc595c9[_0x837f('0x51')],null))[_0x837f('0x1b')](respondWithResult(_0x5acfab,null))[_0x837f('0x24')](handleError(_0x5acfab,null));};var utilLicense=require('../../config/license/util');exports[_0x837f('0x58')]=function(_0x19a371,_0x37621e,_0x5df561){var _0x53c966='server/files/images/logos';var _0x323344={'custom':![]};return utilLicense[_0x837f('0x59')]()[_0x837f('0x1b')](function(_0x19cbd4){if(_0x19cbd4){_0x323344=_0x19cbd4;}return db[_0x837f('0x49')][_0x837f('0x52')]({'where':{'id':_0x19a371[_0x837f('0x4f')]['id']},'attributes':[_0x837f('0x55'),_0x837f('0x57'),_0x837f('0x5a'),_0x837f('0x5b'),_0x837f('0x5c'),_0x837f('0x5d'),_0x837f('0x5e'),'defaultFavicon'],'raw':!![]});})['then'](handleEntityNotFound(_0x37621e,null))['then'](function(_0x128011){if(_0x128011){var _0x3b1c64=_0x128011[_0x837f('0x55')]&&fs[_0x837f('0x5f')](path[_0x837f('0x60')](config[_0x837f('0x61')],_0x53c966,_['toLower'](_0x128011[_0x837f('0x55')])))?path[_0x837f('0x60')](config['root'],_0x53c966,_[_0x837f('0x62')](_0x128011[_0x837f('0x55')])):path[_0x837f('0x60')](config['root'],_0x53c966,_[_0x837f('0x62')](_0x837f('0x63')));var _0x3016eb='default'+_['upperFirst'](_0x837f('0x55'));if(_0x128011[_0x3016eb]||!_0x323344['custom']){_0x3b1c64=path[_0x837f('0x60')](config[_0x837f('0x61')],_0x53c966,_[_0x837f('0x62')](_0x837f('0x63')));}if(!fs['existsSync'](_0x3b1c64)){throw new db[(_0x837f('0x64'))][(_0x837f('0x65'))](_[_0x837f('0x66')]('logo')+'\x20not\x20found');}return _0x37621e[_0x837f('0x67')](_0x3b1c64);}})[_0x837f('0x24')](handleError(_0x37621e,null));};var utilLicense=require(_0x837f('0x17'));exports['getLogoLogin']=function(_0x5c9d05,_0x5a78d3,_0x42071d){var _0x306ae2=_0x837f('0x68');var _0xf7a946={'custom':![]};return utilLicense['getLicense']()[_0x837f('0x1b')](function(_0x164ed4){if(_0x164ed4){_0xf7a946=_0x164ed4;}return db['Setting'][_0x837f('0x52')]({'where':{'id':_0x5c9d05['params']['id']},'attributes':[_0x837f('0x55'),_0x837f('0x57'),_0x837f('0x5a'),_0x837f('0x5b'),_0x837f('0x5c'),'defaultLoginLogo',_0x837f('0x5e'),'defaultFavicon'],'raw':!![]});})[_0x837f('0x1b')](handleEntityNotFound(_0x5a78d3,null))[_0x837f('0x1b')](function(_0x882897){if(_0x882897){var _0x166b55=_0x882897['loginLogo']&&fs[_0x837f('0x5f')](path[_0x837f('0x60')](config['root'],_0x306ae2,_[_0x837f('0x62')](_0x882897['loginLogo'])))?path[_0x837f('0x60')](config[_0x837f('0x61')],_0x306ae2,_['toLower'](_0x882897[_0x837f('0x57')])):path[_0x837f('0x60')](config[_0x837f('0x61')],_0x306ae2,_[_0x837f('0x62')](_0x837f('0x69')));var _0x24e5f6=_0x837f('0x6a')+_[_0x837f('0x66')]('loginLogo');if(_0x882897[_0x24e5f6]||!_0xf7a946[_0x837f('0x6b')]){_0x166b55=path[_0x837f('0x60')](config[_0x837f('0x61')],_0x306ae2,_['toLower'](_0x837f('0x69')));}if(!fs[_0x837f('0x5f')](_0x166b55)){throw new db[(_0x837f('0x64'))]['ValidationError'](_[_0x837f('0x66')](_0x837f('0x57'))+_0x837f('0x6c'));}return _0x5a78d3['download'](_0x166b55);}})[_0x837f('0x24')](handleError(_0x5a78d3,null));};exports[_0x837f('0x6d')]=function(_0x2bf07f,_0x3a341a){return db['Setting'][_0x837f('0x52')]({'where':{'id':_0x2bf07f[_0x837f('0x4f')]['id']},'attributes':[_0x837f('0x6e')]})[_0x837f('0x1b')](respondWithResult(_0x3a341a,null))[_0x837f('0x24')](handleError(_0x3a341a,null));};exports[_0x837f('0x6f')]=function(_0x3e20f5,_0xef98af,_0x31f7c0){if(_0x3e20f5[_0x837f('0x53')]&&_0x3e20f5[_0x837f('0x53')][_0x837f('0x54')]){_0x3e20f5['body'][_0x837f('0x5a')]=_0x3e20f5[_0x837f('0x53')][_0x837f('0x54')];}return db[_0x837f('0x49')][_0x837f('0x52')]({'where':{'id':_0x3e20f5[_0x837f('0x4f')]['id']}})[_0x837f('0x1b')](handleEntityNotFound(_0xef98af,null))[_0x837f('0x1b')](saveUpdates(_0x3e20f5['body'],null))['then'](respondWithResult(_0xef98af,null))[_0x837f('0x24')](handleError(_0xef98af,null));};var utilLicense=require(_0x837f('0x17'));exports[_0x837f('0x70')]=function(_0xe7a459,_0x166a50,_0x471633){var _0x552778=_0x837f('0x68');var _0x2cc02a={'custom':![]};return utilLicense[_0x837f('0x59')]()[_0x837f('0x1b')](function(_0x31984f){if(_0x31984f){_0x2cc02a=_0x31984f;}return db[_0x837f('0x49')]['find']({'where':{'id':_0xe7a459[_0x837f('0x4f')]['id']},'attributes':[_0x837f('0x55'),_0x837f('0x57'),'preferred',_0x837f('0x5b'),'defaultLogo',_0x837f('0x5d'),'defaultPreferred',_0x837f('0x71')],'raw':!![]});})[_0x837f('0x1b')](handleEntityNotFound(_0x166a50,null))['then'](function(_0x48ddbf){if(_0x48ddbf){var _0x3289b7=_0x48ddbf[_0x837f('0x5a')]&&fs['existsSync'](path['join'](config[_0x837f('0x61')],_0x552778,_[_0x837f('0x62')](_0x48ddbf[_0x837f('0x5a')])))?path[_0x837f('0x60')](config[_0x837f('0x61')],_0x552778,_[_0x837f('0x62')](_0x48ddbf[_0x837f('0x5a')])):path[_0x837f('0x60')](config[_0x837f('0x61')],_0x552778,_[_0x837f('0x62')](_0x837f('0x72')));var _0x66c876='default'+_[_0x837f('0x66')](_0x837f('0x5a'));if(_0x48ddbf[_0x66c876]||!_0x2cc02a[_0x837f('0x6b')]||!_0x2cc02a[_0x837f('0x5a')]){_0x3289b7=path[_0x837f('0x60')](config[_0x837f('0x61')],_0x552778,_[_0x837f('0x62')]('default_preferred.png'));}if(!fs[_0x837f('0x5f')](_0x3289b7)){throw new db[(_0x837f('0x64'))][(_0x837f('0x65'))](_[_0x837f('0x66')]('preferred')+_0x837f('0x6c'));}return _0x166a50[_0x837f('0x67')](_0x3289b7);}})['catch'](handleError(_0x166a50,null));};exports[_0x837f('0x73')]=function(_0x41fc30,_0xef053c,_0x210ab8){if(_0x41fc30[_0x837f('0x53')]&&_0x41fc30[_0x837f('0x53')][_0x837f('0x54')]){_0x41fc30[_0x837f('0x51')]['favicon']=_0x41fc30[_0x837f('0x53')][_0x837f('0x54')];}return db[_0x837f('0x49')]['find']({'where':{'id':_0x41fc30[_0x837f('0x4f')]['id']}})[_0x837f('0x1b')](handleEntityNotFound(_0xef053c,null))[_0x837f('0x1b')](saveUpdates(_0x41fc30[_0x837f('0x51')],null))[_0x837f('0x1b')](respondWithResult(_0xef053c,null))['catch'](handleError(_0xef053c,null));};var utilLicense=require(_0x837f('0x17'));exports[_0x837f('0x74')]=function(_0x1000c3,_0xa9b002,_0x38e255){var _0x26ea4a='server/files/images/logos';var _0x4e4fb6={'custom':![]};return utilLicense[_0x837f('0x59')]()[_0x837f('0x1b')](function(_0xfc0905){if(_0xfc0905){_0x4e4fb6=_0xfc0905;}return db[_0x837f('0x49')]['find']({'where':{'id':_0x1000c3[_0x837f('0x4f')]['id']},'attributes':[_0x837f('0x55'),'loginLogo',_0x837f('0x5a'),_0x837f('0x5b'),'defaultLogo',_0x837f('0x5d'),'defaultPreferred',_0x837f('0x71')],'raw':!![]});})[_0x837f('0x1b')](handleEntityNotFound(_0xa9b002,null))['then'](function(_0x141aeb){if(_0x141aeb){var _0x585ee8=_0x141aeb[_0x837f('0x5b')]&&fs[_0x837f('0x5f')](path[_0x837f('0x60')](config['root'],_0x26ea4a,_[_0x837f('0x62')](_0x141aeb[_0x837f('0x5b')])))?path[_0x837f('0x60')](config[_0x837f('0x61')],_0x26ea4a,_[_0x837f('0x62')](_0x141aeb[_0x837f('0x5b')])):path[_0x837f('0x60')](config[_0x837f('0x61')],_0x26ea4a,_['toLower']('default_favicon.ico'));var _0x1f6a00=_0x837f('0x6a')+_[_0x837f('0x66')](_0x837f('0x5b'));if(_0x141aeb[_0x1f6a00]||!_0x4e4fb6['custom']){_0x585ee8=path[_0x837f('0x60')](config['root'],_0x26ea4a,_[_0x837f('0x62')]('default_favicon.ico'));}if(!fs['existsSync'](_0x585ee8)){throw new db[(_0x837f('0x64'))][(_0x837f('0x65'))](_[_0x837f('0x66')](_0x837f('0x5b'))+_0x837f('0x6c'));}return _0xa9b002['download'](_0x585ee8);}})[_0x837f('0x24')](handleError(_0xa9b002,null));};exports[_0x837f('0x75')]=function(_0xc92a78,_0x2ff476){var _0x52d3f8={'offset':moment()[_0x837f('0x76')]()};_0x52d3f8[_0x837f('0x77')]=moment()['utcOffset'](_0x52d3f8[_0x837f('0x29')])[_0x837f('0x78')]('YYYY-MM-DD\x20HH:mm:ss:SSS');return _0x2ff476['status'](0xc8)['send'](_0x52d3f8);}; \ No newline at end of file +var _0xb8b7=['order','sort','where','filter','options','includeAll','include','show','params','find','body','addLogo','file','logo','filename','addLogoLogin','loginLogo','getLogo','server/files/images/logos','preferred','favicon','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','join','toLower','root','default_logo.svg','default','upperFirst','custom','ValidationError','\x20not\x20found','download','getLogoLogin','getLicense','default_loginLogo.svg','Sequelize','gdpr','addPreferred','getPreferred','default_preferred.png','getFavicon','default_favicon.ico','utcOffset','now','format','moment','bluebird','mustache','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','jayson/promise','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','update','destroy','name','send','index','map','Setting','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x41a6a2,_0x396ae0){var _0x1f369c=function(_0x2406c4){while(--_0x2406c4){_0x41a6a2['push'](_0x41a6a2['shift']());}};_0x1f369c(++_0x396ae0);}(_0xb8b7,0x114));var _0x7b8b=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0xb8b7[_0x2be8c2];return _0x97f531;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7b8b('0x0'));var BPromise=require(_0x7b8b('0x1'));var Mustache=require(_0x7b8b('0x2'));var util=require('util');var path=require(_0x7b8b('0x3'));var sox=require(_0x7b8b('0x4'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7b8b('0x5'));var _=require(_0x7b8b('0x6'));var squel=require(_0x7b8b('0x7'));var crypto=require(_0x7b8b('0x8'));var jsforce=require(_0x7b8b('0x9'));var deskjs=require(_0x7b8b('0xa'));var toCsv=require(_0x7b8b('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x7b8b('0xc'));var authService=require(_0x7b8b('0xd'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7b8b('0xe'));var logger=require(_0x7b8b('0xf'))(_0x7b8b('0x10'));var utils=require(_0x7b8b('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x7b8b('0x12'));var db=require('../../mysqldb')['db'];var jayson=require(_0x7b8b('0x13'));var client=jayson['client'][_0x7b8b('0x14')]({'port':0x232a});function respondWithRpcPromise(_0x23d19c,_0x213a64,_0x3c5a24,_0x5df638){return new BPromise(function(_0x47791d,_0x3f0cdc){var _0x4616d8=_0x5df638||client;return _0x4616d8[_0x7b8b('0x15')](_0x23d19c,_0x3c5a24)[_0x7b8b('0x16')](function(_0x9a8531){logger[_0x7b8b('0x17')](_0x7b8b('0x18'),_0x213a64,_0x7b8b('0x19'));logger[_0x7b8b('0x1a')](_0x7b8b('0x1b'),_0x213a64,'request\x20sent',JSON['stringify'](_0x9a8531));if(_0x9a8531[_0x7b8b('0x1c')]){if(_0x9a8531[_0x7b8b('0x1c')][_0x7b8b('0x1d')]===0x1f4){logger[_0x7b8b('0x1c')](_0x7b8b('0x18'),_0x213a64,_0x9a8531['error'][_0x7b8b('0x1e')]);return _0x3f0cdc(_0x9a8531[_0x7b8b('0x1c')][_0x7b8b('0x1e')]);}logger[_0x7b8b('0x1c')](_0x7b8b('0x18'),_0x213a64,_0x9a8531[_0x7b8b('0x1c')][_0x7b8b('0x1e')]);return _0x47791d(_0x9a8531[_0x7b8b('0x1c')][_0x7b8b('0x1e')]);}else{logger['info'](_0x7b8b('0x18'),_0x213a64,_0x7b8b('0x19'));_0x47791d(_0x9a8531[_0x7b8b('0x1f')]['message']);}})[_0x7b8b('0x20')](function(_0x1bb0d2){logger[_0x7b8b('0x1c')]('Setting,\x20%s,\x20%s',_0x213a64,_0x1bb0d2);_0x3f0cdc(_0x1bb0d2);});});}function respondWithStatusCode(_0x48db41,_0x173d36){_0x173d36=_0x173d36||0xcc;return function(_0x17d2b6){if(_0x17d2b6){return _0x48db41[_0x7b8b('0x21')](_0x173d36);}return _0x48db41[_0x7b8b('0x22')](_0x173d36)[_0x7b8b('0x23')]();};}function respondWithResult(_0xcca4,_0x106993){_0x106993=_0x106993||0xc8;return function(_0x14c51c){if(_0x14c51c){return _0xcca4['status'](_0x106993)['json'](_0x14c51c);}};}function respondWithFilteredResult(_0x95d76,_0x1a8a03){return function(_0x5a6b8e){if(_0x5a6b8e){var _0x12a015=typeof _0x1a8a03['offset']===_0x7b8b('0x24')&&typeof _0x1a8a03[_0x7b8b('0x25')]===_0x7b8b('0x24');var _0x1fef87=_0x5a6b8e[_0x7b8b('0x26')];var _0x593070=_0x12a015?0x0:_0x1a8a03[_0x7b8b('0x27')];var _0x53c6c4=_0x12a015?_0x5a6b8e[_0x7b8b('0x26')]:_0x1a8a03[_0x7b8b('0x27')]+_0x1a8a03[_0x7b8b('0x25')];var _0x2de27c;if(_0x53c6c4>=_0x1fef87){_0x53c6c4=_0x1fef87;_0x2de27c=0xc8;}else{_0x2de27c=0xce;}_0x95d76[_0x7b8b('0x22')](_0x2de27c);return _0x95d76[_0x7b8b('0x28')](_0x7b8b('0x29'),_0x593070+'-'+_0x53c6c4+'/'+_0x1fef87)[_0x7b8b('0x2a')](_0x5a6b8e);}return null;};}function patchUpdates(_0x26bcdc){return function(_0x564d7e){try{jsonpatch[_0x7b8b('0x2b')](_0x564d7e,_0x26bcdc,!![]);}catch(_0x250074){return BPromise[_0x7b8b('0x2c')](_0x250074);}return _0x564d7e['save']();};}function saveUpdates(_0x3ba29d,_0x57ad8e){return function(_0x5a09d6){if(_0x5a09d6){return _0x5a09d6[_0x7b8b('0x2d')](_0x3ba29d)[_0x7b8b('0x16')](function(_0x2db8b6){return _0x2db8b6;});}return null;};}function removeEntity(_0x25f7c1,_0x269cd6){return function(_0x95a28d){if(_0x95a28d){return _0x95a28d[_0x7b8b('0x2e')]()['then'](function(){_0x25f7c1[_0x7b8b('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x281f36,_0x392625){return function(_0x511539){if(!_0x511539){_0x281f36[_0x7b8b('0x21')](0x194);}return _0x511539;};}function handleError(_0xb44565,_0x2aea40){_0x2aea40=_0x2aea40||0x1f4;return function(_0x3e4704){logger[_0x7b8b('0x1c')](_0x3e4704['stack']);if(_0x3e4704[_0x7b8b('0x2f')]){delete _0x3e4704[_0x7b8b('0x2f')];}_0xb44565[_0x7b8b('0x22')](_0x2aea40)[_0x7b8b('0x30')](_0x3e4704);};}exports[_0x7b8b('0x31')]=function(_0x26ed8d,_0x281854){var _0x417826={},_0x14200a={},_0x4c6242={'count':0x0,'rows':[]};var _0x2e9462=_[_0x7b8b('0x32')](db[_0x7b8b('0x33')][_0x7b8b('0x34')],function(_0x5df136){return{'name':_0x5df136[_0x7b8b('0x35')],'type':_0x5df136[_0x7b8b('0x36')][_0x7b8b('0x37')]};});_0x14200a[_0x7b8b('0x38')]=_[_0x7b8b('0x32')](_0x2e9462,_0x7b8b('0x2f'));_0x14200a[_0x7b8b('0x39')]=_[_0x7b8b('0x3a')](_0x26ed8d['query']);_0x14200a[_0x7b8b('0x3b')]=_[_0x7b8b('0x3c')](_0x14200a['model'],_0x14200a['query']);_0x417826[_0x7b8b('0x3d')]=_[_0x7b8b('0x3c')](_0x14200a['model'],qs['fields'](_0x26ed8d['query'][_0x7b8b('0x3e')]));_0x417826['attributes']=_0x417826[_0x7b8b('0x3d')][_0x7b8b('0x3f')]?_0x417826['attributes']:_0x14200a[_0x7b8b('0x38')];if(!_0x26ed8d[_0x7b8b('0x39')][_0x7b8b('0x40')](_0x7b8b('0x41'))){_0x417826[_0x7b8b('0x25')]=qs[_0x7b8b('0x25')](_0x26ed8d[_0x7b8b('0x39')][_0x7b8b('0x25')]);_0x417826[_0x7b8b('0x27')]=qs[_0x7b8b('0x27')](_0x26ed8d[_0x7b8b('0x39')][_0x7b8b('0x27')]);}_0x417826[_0x7b8b('0x42')]=qs[_0x7b8b('0x43')](_0x26ed8d[_0x7b8b('0x39')][_0x7b8b('0x43')]);_0x417826[_0x7b8b('0x44')]=qs[_0x7b8b('0x3b')](_['pick'](_0x26ed8d[_0x7b8b('0x39')],_0x14200a['filters']),_0x2e9462);if(_0x26ed8d[_0x7b8b('0x39')][_0x7b8b('0x45')]){_0x417826[_0x7b8b('0x44')]=_['merge'](_0x417826['where'],{'$or':_['map'](_0x2e9462,function(_0x2fadbe){if(_0x2fadbe[_0x7b8b('0x36')]!=='VIRTUAL'){var _0x2f5190={};_0x2f5190[_0x2fadbe[_0x7b8b('0x2f')]]={'$like':'%'+_0x26ed8d['query'][_0x7b8b('0x45')]+'%'};return _0x2f5190;}})});}_0x417826=_['merge']({},_0x417826,_0x26ed8d[_0x7b8b('0x46')]);var _0x2c0568={'where':_0x417826[_0x7b8b('0x44')]};return db[_0x7b8b('0x33')]['count'](_0x2c0568)[_0x7b8b('0x16')](function(_0x582793){_0x4c6242[_0x7b8b('0x26')]=_0x582793;if(_0x26ed8d[_0x7b8b('0x39')][_0x7b8b('0x47')]){_0x417826[_0x7b8b('0x48')]=[{'all':!![]}];}return db[_0x7b8b('0x33')]['findAll'](_0x417826);})[_0x7b8b('0x16')](function(_0x1f507d){_0x4c6242['rows']=_0x1f507d;return _0x4c6242;})['then'](respondWithFilteredResult(_0x281854,_0x417826))['catch'](handleError(_0x281854,null));};exports[_0x7b8b('0x49')]=function(_0x161278,_0x3d8355){var _0x51abbb={'raw':![],'where':{'id':_0x161278[_0x7b8b('0x4a')]['id']}},_0x222cb8={};_0x222cb8['model']=_[_0x7b8b('0x3a')](db[_0x7b8b('0x33')][_0x7b8b('0x34')]);_0x222cb8['query']=_[_0x7b8b('0x3a')](_0x161278[_0x7b8b('0x39')]);_0x222cb8['filters']=_['intersection'](_0x222cb8[_0x7b8b('0x38')],_0x222cb8['query']);_0x51abbb['attributes']=_[_0x7b8b('0x3c')](_0x222cb8[_0x7b8b('0x38')],qs[_0x7b8b('0x3e')](_0x161278[_0x7b8b('0x39')][_0x7b8b('0x3e')]));_0x51abbb[_0x7b8b('0x3d')]=_0x51abbb[_0x7b8b('0x3d')][_0x7b8b('0x3f')]?_0x51abbb[_0x7b8b('0x3d')]:_0x222cb8[_0x7b8b('0x38')];if(_0x161278['query'][_0x7b8b('0x47')]){_0x51abbb[_0x7b8b('0x48')]=[{'all':!![]}];}_0x51abbb=_['merge']({},_0x51abbb,_0x161278['options']);return db[_0x7b8b('0x33')][_0x7b8b('0x4b')](_0x51abbb)['then'](handleEntityNotFound(_0x3d8355,null))[_0x7b8b('0x16')](respondWithResult(_0x3d8355,null))[_0x7b8b('0x20')](handleError(_0x3d8355,null));};exports[_0x7b8b('0x2d')]=function(_0x298952,_0x458b05){if(_0x298952[_0x7b8b('0x4c')]['id']){delete _0x298952[_0x7b8b('0x4c')]['id'];}return db['Setting'][_0x7b8b('0x4b')]({'where':{'id':_0x298952[_0x7b8b('0x4a')]['id']}})['then'](handleEntityNotFound(_0x458b05,null))[_0x7b8b('0x16')](saveUpdates(_0x298952['body'],null))[_0x7b8b('0x16')](respondWithResult(_0x458b05,null))[_0x7b8b('0x20')](handleError(_0x458b05,null));};exports[_0x7b8b('0x4d')]=function(_0x3092a5,_0x2ee9d4,_0x3d3780){if(_0x3092a5[_0x7b8b('0x4e')]&&_0x3092a5['file']['filename']){_0x3092a5['body'][_0x7b8b('0x4f')]=_0x3092a5[_0x7b8b('0x4e')][_0x7b8b('0x50')];}return db[_0x7b8b('0x33')][_0x7b8b('0x4b')]({'where':{'id':_0x3092a5['params']['id']}})['then'](handleEntityNotFound(_0x2ee9d4,null))[_0x7b8b('0x16')](saveUpdates(_0x3092a5['body'],null))[_0x7b8b('0x16')](respondWithResult(_0x2ee9d4,null))[_0x7b8b('0x20')](handleError(_0x2ee9d4,null));};exports[_0x7b8b('0x51')]=function(_0x513ef0,_0xa0925c,_0x4e36c5){if(_0x513ef0[_0x7b8b('0x4e')]&&_0x513ef0[_0x7b8b('0x4e')][_0x7b8b('0x50')]){_0x513ef0[_0x7b8b('0x4c')][_0x7b8b('0x52')]=_0x513ef0[_0x7b8b('0x4e')][_0x7b8b('0x50')];}return db['Setting'][_0x7b8b('0x4b')]({'where':{'id':_0x513ef0[_0x7b8b('0x4a')]['id']}})[_0x7b8b('0x16')](handleEntityNotFound(_0xa0925c,null))['then'](saveUpdates(_0x513ef0['body'],null))[_0x7b8b('0x16')](respondWithResult(_0xa0925c,null))[_0x7b8b('0x20')](handleError(_0xa0925c,null));};var utilLicense=require(_0x7b8b('0x12'));exports[_0x7b8b('0x53')]=function(_0x24f596,_0x4eb0c3,_0x3ae166){var _0x4fb094=_0x7b8b('0x54');var _0x1b9c02={'custom':![]};return utilLicense['getLicense']()[_0x7b8b('0x16')](function(_0x374b5a){if(_0x374b5a){_0x1b9c02=_0x374b5a;}return db[_0x7b8b('0x33')][_0x7b8b('0x4b')]({'where':{'id':_0x24f596[_0x7b8b('0x4a')]['id']},'attributes':['logo',_0x7b8b('0x52'),_0x7b8b('0x55'),_0x7b8b('0x56'),'defaultLogo',_0x7b8b('0x57'),_0x7b8b('0x58'),_0x7b8b('0x59')],'raw':!![]});})[_0x7b8b('0x16')](handleEntityNotFound(_0x4eb0c3,null))['then'](function(_0x335116){if(_0x335116){var _0x350242=_0x335116[_0x7b8b('0x4f')]&&fs[_0x7b8b('0x5a')](path[_0x7b8b('0x5b')](config['root'],_0x4fb094,_[_0x7b8b('0x5c')](_0x335116[_0x7b8b('0x4f')])))?path[_0x7b8b('0x5b')](config[_0x7b8b('0x5d')],_0x4fb094,_[_0x7b8b('0x5c')](_0x335116[_0x7b8b('0x4f')])):path[_0x7b8b('0x5b')](config[_0x7b8b('0x5d')],_0x4fb094,_['toLower'](_0x7b8b('0x5e')));var _0x27a146=_0x7b8b('0x5f')+_[_0x7b8b('0x60')](_0x7b8b('0x4f'));if(_0x335116[_0x27a146]||!_0x1b9c02[_0x7b8b('0x61')]){_0x350242=path[_0x7b8b('0x5b')](config[_0x7b8b('0x5d')],_0x4fb094,_['toLower'](_0x7b8b('0x5e')));}if(!fs[_0x7b8b('0x5a')](_0x350242)){throw new db['Sequelize'][(_0x7b8b('0x62'))](_[_0x7b8b('0x60')](_0x7b8b('0x4f'))+_0x7b8b('0x63'));}return _0x4eb0c3[_0x7b8b('0x64')](_0x350242);}})[_0x7b8b('0x20')](handleError(_0x4eb0c3,null));};var utilLicense=require(_0x7b8b('0x12'));exports[_0x7b8b('0x65')]=function(_0x168685,_0x2e335b,_0xc19272){var _0x1c5206=_0x7b8b('0x54');var _0x55f2fb={'custom':![]};return utilLicense[_0x7b8b('0x66')]()[_0x7b8b('0x16')](function(_0x428b5e){if(_0x428b5e){_0x55f2fb=_0x428b5e;}return db[_0x7b8b('0x33')][_0x7b8b('0x4b')]({'where':{'id':_0x168685[_0x7b8b('0x4a')]['id']},'attributes':[_0x7b8b('0x4f'),_0x7b8b('0x52'),_0x7b8b('0x55'),_0x7b8b('0x56'),'defaultLogo',_0x7b8b('0x57'),_0x7b8b('0x58'),'defaultFavicon'],'raw':!![]});})['then'](handleEntityNotFound(_0x2e335b,null))[_0x7b8b('0x16')](function(_0x44bb11){if(_0x44bb11){var _0x2a0826=_0x44bb11[_0x7b8b('0x52')]&&fs['existsSync'](path['join'](config[_0x7b8b('0x5d')],_0x1c5206,_[_0x7b8b('0x5c')](_0x44bb11[_0x7b8b('0x52')])))?path[_0x7b8b('0x5b')](config[_0x7b8b('0x5d')],_0x1c5206,_['toLower'](_0x44bb11['loginLogo'])):path['join'](config[_0x7b8b('0x5d')],_0x1c5206,_[_0x7b8b('0x5c')](_0x7b8b('0x67')));var _0x303863=_0x7b8b('0x5f')+_[_0x7b8b('0x60')](_0x7b8b('0x52'));if(_0x44bb11[_0x303863]||!_0x55f2fb['custom']){_0x2a0826=path[_0x7b8b('0x5b')](config['root'],_0x1c5206,_[_0x7b8b('0x5c')](_0x7b8b('0x67')));}if(!fs[_0x7b8b('0x5a')](_0x2a0826)){throw new db[(_0x7b8b('0x68'))]['ValidationError'](_['upperFirst'](_0x7b8b('0x52'))+'\x20not\x20found');}return _0x2e335b[_0x7b8b('0x64')](_0x2a0826);}})['catch'](handleError(_0x2e335b,null));};exports[_0x7b8b('0x69')]=function(_0x246636,_0x4a15a7){return db[_0x7b8b('0x33')]['find']({'where':{'id':_0x246636['params']['id']},'attributes':['securePassword']})['then'](respondWithResult(_0x4a15a7,null))[_0x7b8b('0x20')](handleError(_0x4a15a7,null));};exports[_0x7b8b('0x6a')]=function(_0x99ff43,_0x2d0f3e,_0x36a0a8){if(_0x99ff43['file']&&_0x99ff43[_0x7b8b('0x4e')][_0x7b8b('0x50')]){_0x99ff43[_0x7b8b('0x4c')][_0x7b8b('0x55')]=_0x99ff43[_0x7b8b('0x4e')][_0x7b8b('0x50')];}return db['Setting']['find']({'where':{'id':_0x99ff43[_0x7b8b('0x4a')]['id']}})[_0x7b8b('0x16')](handleEntityNotFound(_0x2d0f3e,null))['then'](saveUpdates(_0x99ff43[_0x7b8b('0x4c')],null))[_0x7b8b('0x16')](respondWithResult(_0x2d0f3e,null))[_0x7b8b('0x20')](handleError(_0x2d0f3e,null));};var utilLicense=require(_0x7b8b('0x12'));exports[_0x7b8b('0x6b')]=function(_0xc2affc,_0x567b31,_0x3c6a3c){var _0x3a65d1=_0x7b8b('0x54');var _0x1777c7={'custom':![]};return utilLicense['getLicense']()['then'](function(_0x16dedd){if(_0x16dedd){_0x1777c7=_0x16dedd;}return db[_0x7b8b('0x33')][_0x7b8b('0x4b')]({'where':{'id':_0xc2affc[_0x7b8b('0x4a')]['id']},'attributes':[_0x7b8b('0x4f'),_0x7b8b('0x52'),_0x7b8b('0x55'),_0x7b8b('0x56'),'defaultLogo',_0x7b8b('0x57'),_0x7b8b('0x58'),_0x7b8b('0x59')],'raw':!![]});})['then'](handleEntityNotFound(_0x567b31,null))[_0x7b8b('0x16')](function(_0x4c9933){if(_0x4c9933){var _0x12c008=_0x4c9933[_0x7b8b('0x55')]&&fs['existsSync'](path[_0x7b8b('0x5b')](config[_0x7b8b('0x5d')],_0x3a65d1,_[_0x7b8b('0x5c')](_0x4c9933[_0x7b8b('0x55')])))?path[_0x7b8b('0x5b')](config[_0x7b8b('0x5d')],_0x3a65d1,_[_0x7b8b('0x5c')](_0x4c9933[_0x7b8b('0x55')])):path['join'](config['root'],_0x3a65d1,_[_0x7b8b('0x5c')](_0x7b8b('0x6c')));var _0x29691a=_0x7b8b('0x5f')+_['upperFirst']('preferred');if(_0x4c9933[_0x29691a]||!_0x1777c7[_0x7b8b('0x61')]||!_0x1777c7[_0x7b8b('0x55')]){_0x12c008=path[_0x7b8b('0x5b')](config[_0x7b8b('0x5d')],_0x3a65d1,_[_0x7b8b('0x5c')](_0x7b8b('0x6c')));}if(!fs[_0x7b8b('0x5a')](_0x12c008)){throw new db['Sequelize'][(_0x7b8b('0x62'))](_['upperFirst']('preferred')+_0x7b8b('0x63'));}return _0x567b31[_0x7b8b('0x64')](_0x12c008);}})[_0x7b8b('0x20')](handleError(_0x567b31,null));};exports['addFavicon']=function(_0x56ecaf,_0x4f2849,_0x4d560e){if(_0x56ecaf[_0x7b8b('0x4e')]&&_0x56ecaf['file'][_0x7b8b('0x50')]){_0x56ecaf[_0x7b8b('0x4c')][_0x7b8b('0x56')]=_0x56ecaf[_0x7b8b('0x4e')][_0x7b8b('0x50')];}return db[_0x7b8b('0x33')][_0x7b8b('0x4b')]({'where':{'id':_0x56ecaf[_0x7b8b('0x4a')]['id']}})[_0x7b8b('0x16')](handleEntityNotFound(_0x4f2849,null))[_0x7b8b('0x16')](saveUpdates(_0x56ecaf[_0x7b8b('0x4c')],null))[_0x7b8b('0x16')](respondWithResult(_0x4f2849,null))[_0x7b8b('0x20')](handleError(_0x4f2849,null));};var utilLicense=require(_0x7b8b('0x12'));exports[_0x7b8b('0x6d')]=function(_0x33efdc,_0x52bafd,_0x78176b){var _0x293d0b=_0x7b8b('0x54');var _0x5d0bf9={'custom':![]};return utilLicense['getLicense']()[_0x7b8b('0x16')](function(_0x400235){if(_0x400235){_0x5d0bf9=_0x400235;}return db[_0x7b8b('0x33')][_0x7b8b('0x4b')]({'where':{'id':_0x33efdc[_0x7b8b('0x4a')]['id']},'attributes':[_0x7b8b('0x4f'),_0x7b8b('0x52'),_0x7b8b('0x55'),'favicon','defaultLogo','defaultLoginLogo',_0x7b8b('0x58'),'defaultFavicon'],'raw':!![]});})[_0x7b8b('0x16')](handleEntityNotFound(_0x52bafd,null))[_0x7b8b('0x16')](function(_0x31b3e9){if(_0x31b3e9){var _0x2d25e9=_0x31b3e9[_0x7b8b('0x56')]&&fs[_0x7b8b('0x5a')](path[_0x7b8b('0x5b')](config[_0x7b8b('0x5d')],_0x293d0b,_[_0x7b8b('0x5c')](_0x31b3e9[_0x7b8b('0x56')])))?path[_0x7b8b('0x5b')](config['root'],_0x293d0b,_[_0x7b8b('0x5c')](_0x31b3e9['favicon'])):path[_0x7b8b('0x5b')](config[_0x7b8b('0x5d')],_0x293d0b,_[_0x7b8b('0x5c')](_0x7b8b('0x6e')));var _0x457820=_0x7b8b('0x5f')+_[_0x7b8b('0x60')]('favicon');if(_0x31b3e9[_0x457820]||!_0x5d0bf9[_0x7b8b('0x61')]){_0x2d25e9=path[_0x7b8b('0x5b')](config['root'],_0x293d0b,_[_0x7b8b('0x5c')](_0x7b8b('0x6e')));}if(!fs[_0x7b8b('0x5a')](_0x2d25e9)){throw new db[(_0x7b8b('0x68'))][(_0x7b8b('0x62'))](_['upperFirst'](_0x7b8b('0x56'))+_0x7b8b('0x63'));}return _0x52bafd[_0x7b8b('0x64')](_0x2d25e9);}})[_0x7b8b('0x20')](handleError(_0x52bafd,null));};exports['getDate']=function(_0x5eb67b,_0x8bfe82){var _0x15f482={'offset':moment()[_0x7b8b('0x6f')]()};_0x15f482[_0x7b8b('0x70')]=moment()[_0x7b8b('0x6f')](_0x15f482[_0x7b8b('0x27')])[_0x7b8b('0x71')]('YYYY-MM-DD\x20HH:mm:ss:SSS');return _0x8bfe82[_0x7b8b('0x22')](0xc8)[_0x7b8b('0x30')](_0x15f482);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index 13af672..8274585 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 _0x3e74=['exports','Setting','settings','lodash','../../config/logger','api','moment','path','../../config/environment','./setting.attributes'];(function(_0x55fb83,_0x1d3856){var _0x59a87a=function(_0x38bdd1){while(--_0x38bdd1){_0x55fb83['push'](_0x55fb83['shift']());}};_0x59a87a(++_0x1d3856);}(_0x3e74,0x175));var _0x43e7=function(_0x270fbc,_0x43692b){_0x270fbc=_0x270fbc-0x0;var _0x86e04b=_0x3e74[_0x270fbc];return _0x86e04b;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var logger=require(_0x43e7('0x1'))(_0x43e7('0x2'));var moment=require(_0x43e7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x43e7('0x4'));var rimraf=require('rimraf');var config=require(_0x43e7('0x5'));var attributes=require(_0x43e7('0x6'));module[_0x43e7('0x7')]=function(_0x1c503b,_0xc98b9c){return _0x1c503b['define'](_0x43e7('0x8'),attributes,{'tableName':_0x43e7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3e74=['exports','Setting','settings','lodash','../../config/logger','api','moment','path','../../config/environment','./setting.attributes'];(function(_0x170cbb,_0x9093e){var _0x39fae4=function(_0x120b6b){while(--_0x120b6b){_0x170cbb['push'](_0x170cbb['shift']());}};_0x39fae4(++_0x9093e);}(_0x3e74,0x175));var _0x43e7=function(_0x554aa6,_0x2b4f13){_0x554aa6=_0x554aa6-0x0;var _0x2a901a=_0x3e74[_0x554aa6];return _0x2a901a;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var logger=require(_0x43e7('0x1'))(_0x43e7('0x2'));var moment=require(_0x43e7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x43e7('0x4'));var rimraf=require('rimraf');var config=require(_0x43e7('0x5'));var attributes=require(_0x43e7('0x6'));module[_0x43e7('0x7')]=function(_0x1c503b,_0xc98b9c){return _0x1c503b['define'](_0x43e7('0x8'),attributes,{'tableName':_0x43e7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js index 71057c9..9bdf48e 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 _0xbe60=['../../config/environment','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','ShowSetting','Setting','raw','options','where','include','map','model','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0xca1091,_0x539dbf){var _0xd3019c=function(_0xd629e0){while(--_0xd629e0){_0xca1091['push'](_0xca1091['shift']());}};_0xd3019c(++_0x539dbf);}(_0xbe60,0xfe));var _0x0be6=function(_0x4c8a19,_0x19cb81){_0x4c8a19=_0x4c8a19-0x0;var _0x4fbd23=_0xbe60[_0x4c8a19];return _0x4fbd23;};'use strict';var _=require(_0x0be6('0x0'));var util=require(_0x0be6('0x1'));var moment=require(_0x0be6('0x2'));var BPromise=require(_0x0be6('0x3'));var rs=require(_0x0be6('0x4'));var fs=require('fs');var Redis=require(_0x0be6('0x5'));var db=require(_0x0be6('0x6'))['db'];var utils=require(_0x0be6('0x7'));var logger=require(_0x0be6('0x8'))(_0x0be6('0x9'));var config=require(_0x0be6('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0x0be6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5d7282,_0x5ba3c8,_0x6ace0a){return new BPromise(function(_0x7a9f39,_0x4a644e){return client[_0x0be6('0xc')](_0x5d7282,_0x6ace0a)[_0x0be6('0xd')](function(_0x18054e){logger[_0x0be6('0xe')](_0x0be6('0xf'),_0x5ba3c8,_0x0be6('0x10'));logger[_0x0be6('0x11')](_0x0be6('0x12'),_0x5ba3c8,_0x0be6('0x10'),JSON[_0x0be6('0x13')](_0x18054e));if(_0x18054e[_0x0be6('0x14')]){if(_0x18054e[_0x0be6('0x14')]['code']===0x1f4){logger[_0x0be6('0x14')]('Setting,\x20%s,\x20%s',_0x5ba3c8,_0x18054e[_0x0be6('0x14')]['message']);return _0x4a644e(_0x18054e[_0x0be6('0x14')][_0x0be6('0x15')]);}logger['error'](_0x0be6('0xf'),_0x5ba3c8,_0x18054e[_0x0be6('0x14')]['message']);return _0x7a9f39(_0x18054e[_0x0be6('0x14')][_0x0be6('0x15')]);}else{logger[_0x0be6('0xe')](_0x0be6('0xf'),_0x5ba3c8,_0x0be6('0x10'));_0x7a9f39(_0x18054e[_0x0be6('0x16')][_0x0be6('0x15')]);}})[_0x0be6('0x17')](function(_0x5af6ac){logger['error'](_0x0be6('0xf'),_0x5ba3c8,_0x5af6ac);_0x4a644e(_0x5af6ac);});});}exports[_0x0be6('0x18')]=function(_0x4eafa0){var _0x1d904a=this;return new Promise(function(_0x17e874,_0x2e4ea8){return db[_0x0be6('0x19')]['find']({'raw':_0x4eafa0['options']?_0x4eafa0['options'][_0x0be6('0x1a')]===undefined?!![]:![]:!![],'where':_0x4eafa0[_0x0be6('0x1b')]?_0x4eafa0[_0x0be6('0x1b')][_0x0be6('0x1c')]||null:null,'attributes':_0x4eafa0['options']?_0x4eafa0[_0x0be6('0x1b')]['attributes']||null:null,'include':_0x4eafa0[_0x0be6('0x1b')]?_0x4eafa0[_0x0be6('0x1b')][_0x0be6('0x1d')]?_[_0x0be6('0x1e')](_0x4eafa0[_0x0be6('0x1b')][_0x0be6('0x1d')],function(_0x10c848){return{'model':db[_0x10c848[_0x0be6('0x1f')]],'as':_0x10c848['as'],'attributes':_0x10c848[_0x0be6('0x20')],'include':_0x10c848[_0x0be6('0x1d')]?_['map'](_0x10c848[_0x0be6('0x1d')],function(_0x5f0eec){return{'model':db[_0x5f0eec[_0x0be6('0x1f')]],'as':_0x5f0eec['as'],'attributes':_0x5f0eec[_0x0be6('0x20')],'include':_0x5f0eec[_0x0be6('0x1d')]?_[_0x0be6('0x1e')](_0x5f0eec[_0x0be6('0x1d')],function(_0x1d5bba){return{'model':db[_0x1d5bba[_0x0be6('0x1f')]],'as':_0x1d5bba['as'],'attributes':_0x1d5bba[_0x0be6('0x20')]};}):[]};}):[]};}):[]:[]})[_0x0be6('0xd')](function(_0x45b95b){logger['info'](_0x0be6('0x18'),_0x4eafa0);logger['debug'](_0x0be6('0x18'),_0x4eafa0,JSON['stringify'](_0x45b95b));_0x17e874(_0x45b95b);})[_0x0be6('0x17')](function(_0x297b49){logger[_0x0be6('0x14')](_0x0be6('0x18'),_0x297b49[_0x0be6('0x15')],_0x4eafa0);_0x2e4ea8(_0x1d904a['error'](0x1f4,_0x297b49[_0x0be6('0x15')]));});});}; \ No newline at end of file +var _0xf2a2=['stringify','error','message','result','ShowSetting','Setting','find','options','where','attributes','include','map','model','debug','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','then','info','Setting,\x20%s,\x20%s','Setting,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x2aa0ee,_0x21c751){var _0x10d12c=function(_0x5e8a52){while(--_0x5e8a52){_0x2aa0ee['push'](_0x2aa0ee['shift']());}};_0x10d12c(++_0x21c751);}(_0xf2a2,0x177));var _0x2f2a=function(_0x3bc72d,_0x5aaa33){_0x3bc72d=_0x3bc72d-0x0;var _0x3b7fbf=_0xf2a2[_0x3bc72d];return _0x3b7fbf;};'use strict';var _=require('lodash');var util=require(_0x2f2a('0x0'));var moment=require(_0x2f2a('0x1'));var BPromise=require(_0x2f2a('0x2'));var rs=require(_0x2f2a('0x3'));var fs=require('fs');var Redis=require(_0x2f2a('0x4'));var db=require(_0x2f2a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2f2a('0x6'))('rpc');var config=require(_0x2f2a('0x7'));var jayson=require(_0x2f2a('0x8'));var client=jayson[_0x2f2a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x52405d,_0x31e544,_0xa3a1d9){return new BPromise(function(_0x28f40b,_0x33cf08){return client['request'](_0x52405d,_0xa3a1d9)[_0x2f2a('0xa')](function(_0x163bbe){logger[_0x2f2a('0xb')](_0x2f2a('0xc'),_0x31e544,'request\x20sent');logger['debug'](_0x2f2a('0xd'),_0x31e544,_0x2f2a('0xe'),JSON[_0x2f2a('0xf')](_0x163bbe));if(_0x163bbe[_0x2f2a('0x10')]){if(_0x163bbe[_0x2f2a('0x10')]['code']===0x1f4){logger[_0x2f2a('0x10')]('Setting,\x20%s,\x20%s',_0x31e544,_0x163bbe[_0x2f2a('0x10')][_0x2f2a('0x11')]);return _0x33cf08(_0x163bbe[_0x2f2a('0x10')][_0x2f2a('0x11')]);}logger['error'](_0x2f2a('0xc'),_0x31e544,_0x163bbe['error'][_0x2f2a('0x11')]);return _0x28f40b(_0x163bbe['error']['message']);}else{logger[_0x2f2a('0xb')](_0x2f2a('0xc'),_0x31e544,_0x2f2a('0xe'));_0x28f40b(_0x163bbe[_0x2f2a('0x12')][_0x2f2a('0x11')]);}})['catch'](function(_0x22ead0){logger['error'](_0x2f2a('0xc'),_0x31e544,_0x22ead0);_0x33cf08(_0x22ead0);});});}exports[_0x2f2a('0x13')]=function(_0x185fda){var _0x566ba2=this;return new Promise(function(_0x24d9d9,_0x2aa0e4){return db[_0x2f2a('0x14')][_0x2f2a('0x15')]({'raw':_0x185fda[_0x2f2a('0x16')]?_0x185fda['options']['raw']===undefined?!![]:![]:!![],'where':_0x185fda[_0x2f2a('0x16')]?_0x185fda[_0x2f2a('0x16')][_0x2f2a('0x17')]||null:null,'attributes':_0x185fda[_0x2f2a('0x16')]?_0x185fda['options'][_0x2f2a('0x18')]||null:null,'include':_0x185fda[_0x2f2a('0x16')]?_0x185fda[_0x2f2a('0x16')][_0x2f2a('0x19')]?_[_0x2f2a('0x1a')](_0x185fda[_0x2f2a('0x16')][_0x2f2a('0x19')],function(_0x450f34){return{'model':db[_0x450f34[_0x2f2a('0x1b')]],'as':_0x450f34['as'],'attributes':_0x450f34['attributes'],'include':_0x450f34[_0x2f2a('0x19')]?_[_0x2f2a('0x1a')](_0x450f34[_0x2f2a('0x19')],function(_0x4cd68d){return{'model':db[_0x4cd68d[_0x2f2a('0x1b')]],'as':_0x4cd68d['as'],'attributes':_0x4cd68d[_0x2f2a('0x18')],'include':_0x4cd68d[_0x2f2a('0x19')]?_[_0x2f2a('0x1a')](_0x4cd68d[_0x2f2a('0x19')],function(_0x32ac1d){return{'model':db[_0x32ac1d[_0x2f2a('0x1b')]],'as':_0x32ac1d['as'],'attributes':_0x32ac1d[_0x2f2a('0x18')]};}):[]};}):[]};}):[]:[]})[_0x2f2a('0xa')](function(_0x5a172f){logger[_0x2f2a('0xb')](_0x2f2a('0x13'),_0x185fda);logger[_0x2f2a('0x1c')](_0x2f2a('0x13'),_0x185fda,JSON[_0x2f2a('0xf')](_0x5a172f));_0x24d9d9(_0x5a172f);})[_0x2f2a('0x1d')](function(_0x40b2c5){logger[_0x2f2a('0x10')](_0x2f2a('0x13'),_0x40b2c5[_0x2f2a('0x11')],_0x185fda);_0x2aa0e4(_0x566ba2['error'](0x1f4,_0x40b2c5[_0x2f2a('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index bcd342c..8485a9f 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 _0x814b=['/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status','statusGet','/:id/users','getAgents','post','create','addDisposition','addAnswer','/:id/send','status','addAgents','put','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','isAuthenticated'];(function(_0x940009,_0x32b94b){var _0x1529d2=function(_0x20de13){while(--_0x20de13){_0x940009['push'](_0x940009['shift']());}};_0x1529d2(++_0x32b94b);}(_0x814b,0x1a2));var _0xb814=function(_0x1eb585,_0x202476){_0x1eb585=_0x1eb585-0x0;var _0x497ee2=_0x814b[_0x1eb585];return _0x497ee2;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var timeout=require(_0xb814('0x3'));var express=require(_0xb814('0x4'));var router=express[_0xb814('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb814('0x6'));var interaction=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var controller=require(_0xb814('0x9'));router[_0xb814('0xa')]('/',auth[_0xb814('0xb')](),controller['index']);router[_0xb814('0xa')](_0xb814('0xc'),auth['isAuthenticated'](),controller[_0xb814('0xd')]);router[_0xb814('0xa')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0xf')]);router[_0xb814('0xa')](_0xb814('0x10'),auth[_0xb814('0xb')](),controller[_0xb814('0x11')]);router[_0xb814('0xa')](_0xb814('0x12'),auth['isAuthenticated'](),controller[_0xb814('0x13')]);router['get'](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x15')]);router[_0xb814('0xa')](_0xb814('0x16'),auth[_0xb814('0xb')](),controller[_0xb814('0x17')]);router[_0xb814('0xa')](_0xb814('0x18'),controller[_0xb814('0x19')]);router[_0xb814('0xa')](_0xb814('0x1a'),auth[_0xb814('0xb')](),controller[_0xb814('0x1b')]);router[_0xb814('0x1c')]('/',auth[_0xb814('0xb')](),controller[_0xb814('0x1d')]);router[_0xb814('0x1c')](_0xb814('0x10'),auth[_0xb814('0xb')](),controller[_0xb814('0x1e')]);router['post'](_0xb814('0x12'),auth['isAuthenticated'](),controller[_0xb814('0x1f')]);router[_0xb814('0x1c')]('/:id/notify',controller['notify']);router['post'](_0xb814('0x14'),auth['isAuthenticated'](),controller['addApplications']);router[_0xb814('0x1c')](_0xb814('0x20'),auth[_0xb814('0xb')](),controller['send']);router[_0xb814('0x1c')]('/:id/status',controller[_0xb814('0x21')]);router[_0xb814('0x1c')](_0xb814('0x1a'),auth[_0xb814('0xb')](),controller[_0xb814('0x22')]);router[_0xb814('0x23')](_0xb814('0xe'),auth['isAuthenticated'](),controller[_0xb814('0x24')]);router['delete'](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0x25')]);router[_0xb814('0x26')](_0xb814('0x10'),auth[_0xb814('0xb')](),controller[_0xb814('0x27')]);router['delete'](_0xb814('0x12'),auth[_0xb814('0xb')](),controller[_0xb814('0x28')]);router[_0xb814('0x26')](_0xb814('0x1a'),auth[_0xb814('0xb')](),controller[_0xb814('0x29')]);module[_0xb814('0x2a')]=router; \ No newline at end of file +var _0xe14b=['./smsAccount.controller','get','isAuthenticated','index','/describe','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status','statusGet','getAgents','post','create','addDisposition','addAnswer','/:id/notify','notify','addApplications','/:id/send','send','put','update','/:id','destroy','removeDispositions','delete','/:id/users','removeAgents','multer','util','express','Router','../../components/auth/service'];(function(_0x3bff96,_0x5c063b){var _0x3af2e9=function(_0x1c3cd9){while(--_0x1c3cd9){_0x3bff96['push'](_0x3bff96['shift']());}};_0x3af2e9(++_0x5c063b);}(_0xe14b,0x93));var _0xbe14=function(_0x9f50b2,_0x101a14){_0x9f50b2=_0x9f50b2-0x0;var _0x341bb1=_0xe14b[_0x9f50b2];return _0x341bb1;};'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['getDispositions']);router[_0xbe14('0x6')](_0xbe14('0xc'),auth['isAuthenticated'](),controller[_0xbe14('0xd')]);router[_0xbe14('0x6')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xf')]);router[_0xbe14('0x6')](_0xbe14('0x10'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x11')]);router[_0xbe14('0x6')](_0xbe14('0x12'),controller[_0xbe14('0x13')]);router[_0xbe14('0x6')]('/:id/users',auth['isAuthenticated'](),controller[_0xbe14('0x14')]);router[_0xbe14('0x15')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x16')]);router['post'](_0xbe14('0xb'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x17')]);router[_0xbe14('0x15')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x18')]);router['post'](_0xbe14('0x19'),controller[_0xbe14('0x1a')]);router[_0xbe14('0x15')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x1b')]);router['post'](_0xbe14('0x1c'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x1d')]);router[_0xbe14('0x15')](_0xbe14('0x12'),controller['status']);router[_0xbe14('0x15')]('/:id/users',auth[_0xbe14('0x7')](),controller['addAgents']);router[_0xbe14('0x1e')]('/:id',auth[_0xbe14('0x7')](),controller[_0xbe14('0x1f')]);router['delete'](_0xbe14('0x20'),auth['isAuthenticated'](),controller[_0xbe14('0x21')]);router['delete'](_0xbe14('0xb'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x22')]);router[_0xbe14('0x23')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller['removeAnswers']);router[_0xbe14('0x23')](_0xbe14('0x24'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x25')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index c16483e..703718f 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 _0x47e6=['clickatell','csc','intelepeer','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','exports','STRING','name','ENUM','twilio','clicksend','plivo'];(function(_0x128ab2,_0xe48ec3){var _0x4c9d34=function(_0x1478cf){while(--_0x1478cf){_0x128ab2['push'](_0x128ab2['shift']());}};_0x4c9d34(++_0xe48ec3);}(_0x47e6,0x1e6));var _0x647e=function(_0x4f4c0b,_0xce28fe){_0x4f4c0b=_0x4f4c0b-0x0;var _0x1dc865=_0x47e6[_0x4f4c0b];return _0x1dc865;};'use strict';var Sequelize=require(_0x647e('0x0'));var rs=require('randomstring');module[_0x647e('0x1')]={'name':{'type':Sequelize[_0x647e('0x2')],'unique':_0x647e('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x647e('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0x647e('0x2')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x647e('0x4')](_0x647e('0x5'),'skebby','connectel',_0x647e('0x6'),_0x647e('0x7'),_0x647e('0x8'),'bandwidth',_0x647e('0x9'),'infobip',_0x647e('0xa'))},'accountSid':{'type':Sequelize[_0x647e('0x2')]},'authId':{'type':Sequelize[_0x647e('0x2')]},'authToken':{'type':Sequelize[_0x647e('0x2')]},'smsMethod':{'type':Sequelize['ENUM']('SI','TI','GP')},'username':{'type':Sequelize[_0x647e('0x2')]},'password':{'type':Sequelize[_0x647e('0x2')]},'apiKey':{'type':Sequelize[_0x647e('0x2')]},'applicationId':{'type':Sequelize['STRING']},'accountId':{'type':Sequelize['STRING']},'senderString':{'type':Sequelize['STRING']},'deliveryReport':{'type':Sequelize[_0x647e('0xb')],'defaultValue':![]},'description':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x647e('0xc')],'defaultValue':function(){return _0x647e('0xd');}},'notificationSound':{'type':Sequelize[_0x647e('0xb')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x647e('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x647e('0xb')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x647e('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x647e('0xb')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x647e('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x647e('0x2')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x647e('0xe')],'comment':_0x647e('0xf')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x647e('0x10'),'set':function(_0x24406a){if(!_0x24406a)this[_0x647e('0x11')]('mandatoryDispositionPauseId',null);this[_0x647e('0x11')](_0x647e('0x12'),_0x24406a);}}}; \ No newline at end of file +var _0xa04c=['BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','name','STRING','generate','ENUM','twilio','skebby','connectel','clicksend','plivo','clickatell','bandwidth','csc','intelepeer'];(function(_0x4998ec,_0x15af49){var _0x22a4bb=function(_0x6f7001){while(--_0x6f7001){_0x4998ec['push'](_0x4998ec['shift']());}};_0x22a4bb(++_0x15af49);}(_0xa04c,0x6d));var _0xca04=function(_0x229667,_0x13e37e){_0x229667=_0x229667-0x0;var _0xa2abe4=_0xa04c[_0x229667];return _0xa2abe4;};'use strict';var Sequelize=require(_0xca04('0x0'));var rs=require(_0xca04('0x1'));module[_0xca04('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0xca04('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0xca04('0x4')],'allowNull':![]},'remote':{'type':Sequelize[_0xca04('0x4')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xca04('0x5')]();}},'phone':{'type':Sequelize[_0xca04('0x4')]},'type':{'type':Sequelize[_0xca04('0x6')](_0xca04('0x7'),_0xca04('0x8'),_0xca04('0x9'),_0xca04('0xa'),_0xca04('0xb'),_0xca04('0xc'),_0xca04('0xd'),_0xca04('0xe'),'infobip',_0xca04('0xf'))},'accountSid':{'type':Sequelize['STRING']},'authId':{'type':Sequelize[_0xca04('0x4')]},'authToken':{'type':Sequelize[_0xca04('0x4')]},'smsMethod':{'type':Sequelize[_0xca04('0x6')]('SI','TI','GP')},'username':{'type':Sequelize[_0xca04('0x4')]},'password':{'type':Sequelize[_0xca04('0x4')]},'apiKey':{'type':Sequelize[_0xca04('0x4')]},'applicationId':{'type':Sequelize[_0xca04('0x4')]},'accountId':{'type':Sequelize[_0xca04('0x4')]},'senderString':{'type':Sequelize[_0xca04('0x4')]},'deliveryReport':{'type':Sequelize[_0xca04('0x10')],'defaultValue':![]},'description':{'type':Sequelize[_0xca04('0x4')]},'notificationTemplate':{'type':Sequelize[_0xca04('0x11')],'defaultValue':function(){return _0xca04('0x12');}},'notificationSound':{'type':Sequelize[_0xca04('0x10')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xca04('0x10')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xca04('0x13')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xca04('0x10')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xca04('0x13')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xca04('0x10')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize['STRING']},'mandatoryDispositionPauseId':{'type':Sequelize[_0xca04('0x13')],'comment':_0xca04('0x14')},'mandatoryDisposition':{'type':Sequelize[_0xca04('0x10')],'defaultValue':![],'comment':_0xca04('0x15'),'set':function(_0x532434){if(!_0x532434)this[_0xca04('0x16')](_0xca04('0x17'),null);this[_0xca04('0x16')](_0xca04('0x18'),_0x532434);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index c0127f4..e4adeee 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 _0xddbb=['DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','ACCEPTD','received\x20delivery\x20report\x20from','message-id','state','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','jayson/promise','client','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','stringify','error','result','message','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','update','destroy','get','SmsAccounts','stack','name','send','index','Pause','mandatoryDispositionPause','map','SmsAccount','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','where','VIRTUAL','filter','merge','includeAll','include','findAll','rows','show','params','options','find','create','body','user','role','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','SmsAccountId','Disposition','getDispositions','findOne','keys','removeDispositions','addAnswer','CannedAnswer','getAnswers','ids','notify','sms','Applications','account','applications','orderBy','asc','Sequelize','ValidationError','difference','updatedAt','createdAt','CompanyId','ListId','mobile','twilio','from','messageId','MessageSid','sender','text','connectel','clicksend','plivo','From','Text','MessageUUID','infobip','results','csc','originatingAddress','segmentedMessage','clickatell','fromNumber','replyMessageId','bandwidth','intelepeer','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','CmContact','Contacts','DESC','omit','contact','spread','interaction','autoclose','push','*,*,*,*','created','SmsMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','Start','startRouting','SmsAccount,\x20%s,\x20%s,\x20%s','entity\x20found','debug','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','\x0a','addApplications','sequelize','transaction','SmsApplication','findAndCountAll','priority','getApplications','SmsInteraction','Owner','fullname','internal','Tags','color','tag','to\x20is\x20mandatory','List','out','Messages','dataValues','inspect','skebby','skebby_dispatch_id','statusInt','requestid','status_code','groupName','DELIVERED','redif'];(function(_0x42c333,_0x3df5f2){var _0xd47dc4=function(_0x296faf){while(--_0x296faf){_0x42c333['push'](_0x42c333['shift']());}};_0xd47dc4(++_0x3df5f2);}(_0xddbb,0xf1));var _0xbddb=function(_0x329ddd,_0x233b58){_0x329ddd=_0x329ddd-0x0;var _0x2025a1=_0xddbb[_0x329ddd];return _0x2025a1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbddb('0x0'));var zipdir=require(_0xbddb('0x1'));var jsonpatch=require(_0xbddb('0x2'));var rp=require(_0xbddb('0x3'));var moment=require(_0xbddb('0x4'));var BPromise=require(_0xbddb('0x5'));var Mustache=require(_0xbddb('0x6'));var util=require(_0xbddb('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xbddb('0x8'));var fs=require('fs');var fs_extra=require(_0xbddb('0x9'));var _=require('lodash');var squel=require(_0xbddb('0xa'));var crypto=require(_0xbddb('0xb'));var jsforce=require(_0xbddb('0xc'));var deskjs=require(_0xbddb('0xd'));var toCsv=require(_0xbddb('0xe'));var querystring=require(_0xbddb('0xf'));var Papa=require(_0xbddb('0x10'));var Redis=require(_0xbddb('0x11'));var authService=require(_0xbddb('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xbddb('0x13'));var hardwareService=require(_0xbddb('0x14'));var logger=require(_0xbddb('0x15'))(_0xbddb('0x16'));var utils=require(_0xbddb('0x17'));var config=require(_0xbddb('0x18'));var licenseUtil=require(_0xbddb('0x19'));var db=require(_0xbddb('0x1a'))['db'];config[_0xbddb('0x1b')]=_[_0xbddb('0x1c')](config['redis'],{'host':_0xbddb('0x1d'),'port':0x18eb});var socket=require(_0xbddb('0x1e'))(new Redis(config[_0xbddb('0x1b')]));require(_0xbddb('0x1f'))['register'](socket);var jayson=require(_0xbddb('0x20'));var client=jayson[_0xbddb('0x21')]['http']({'port':0x232c});function respondWithRpcPromise(_0x104d07,_0x220d74,_0xdcb1b4,_0x37b73d){return new BPromise(function(_0x4a2b82,_0x37d6bc){var _0x4aa7a1=_0x37b73d||client;return _0x4aa7a1[_0xbddb('0x22')](_0x104d07,_0xdcb1b4)[_0xbddb('0x23')](function(_0x337501){logger[_0xbddb('0x24')](_0xbddb('0x25'),_0x220d74,_0xbddb('0x26'));logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x220d74,'request\x20sent',JSON[_0xbddb('0x27')](_0x337501));if(_0x337501[_0xbddb('0x28')]){if(_0x337501[_0xbddb('0x28')]['code']===0x1f4){logger['error'](_0xbddb('0x25'),_0x220d74,_0x337501[_0xbddb('0x28')]['message']);return _0x37d6bc(_0x337501['error']['message']);}logger[_0xbddb('0x28')](_0xbddb('0x25'),_0x220d74,_0x337501[_0xbddb('0x28')]['message']);return _0x4a2b82(_0x337501[_0xbddb('0x28')]['message']);}else{logger[_0xbddb('0x24')](_0xbddb('0x25'),_0x220d74,_0xbddb('0x26'));_0x4a2b82(_0x337501[_0xbddb('0x29')][_0xbddb('0x2a')]);}})[_0xbddb('0x2b')](function(_0x333f2f){logger['error']('SmsAccount,\x20%s,\x20%s',_0x220d74,_0x333f2f);_0x37d6bc(_0x333f2f);});});}function respondWithStatusCode(_0xb1ebf0,_0x2dacbd){_0x2dacbd=_0x2dacbd||0xcc;return function(_0x10beeb){if(_0x10beeb){return _0xb1ebf0[_0xbddb('0x2c')](_0x2dacbd);}return _0xb1ebf0[_0xbddb('0x2d')](_0x2dacbd)[_0xbddb('0x2e')]();};}function respondWithResult(_0x5c66fc,_0x3b490d){_0x3b490d=_0x3b490d||0xc8;return function(_0x583f1){if(_0x583f1){return _0x5c66fc['status'](_0x3b490d)[_0xbddb('0x2f')](_0x583f1);}};}function respondWithFilteredResult(_0x2f5d39,_0x5978be){return function(_0x58716c){if(_0x58716c){var _0x152436=typeof _0x5978be[_0xbddb('0x30')]===_0xbddb('0x31')&&typeof _0x5978be[_0xbddb('0x32')]===_0xbddb('0x31');var _0x3339a8=_0x58716c[_0xbddb('0x33')];var _0x7d1b2e=_0x152436?0x0:_0x5978be['offset'];var _0x8ea7b=_0x152436?_0x58716c[_0xbddb('0x33')]:_0x5978be[_0xbddb('0x30')]+_0x5978be[_0xbddb('0x32')];var _0x18e700;if(_0x8ea7b>=_0x3339a8){_0x8ea7b=_0x3339a8;_0x18e700=0xc8;}else{_0x18e700=0xce;}_0x2f5d39[_0xbddb('0x2d')](_0x18e700);return _0x2f5d39[_0xbddb('0x34')]('Content-Range',_0x7d1b2e+'-'+_0x8ea7b+'/'+_0x3339a8)['json'](_0x58716c);}return null;};}function patchUpdates(_0x5dfc00){return function(_0x417458){try{jsonpatch[_0xbddb('0x35')](_0x417458,_0x5dfc00,!![]);}catch(_0x36d319){return BPromise[_0xbddb('0x36')](_0x36d319);}return _0x417458['save']();};}function saveUpdates(_0xa155c2,_0x1e26aa){return function(_0x3a5b58){if(_0x3a5b58){return _0x3a5b58[_0xbddb('0x37')](_0xa155c2)['then'](function(_0x8c214){return _0x8c214;});}return null;};}function removeEntity(_0x12c28e,_0x3a10f4){return function(_0xd506d8){if(_0xd506d8){return _0xd506d8[_0xbddb('0x38')]()[_0xbddb('0x23')](function(){var _0x4e5935=_0xd506d8[_0xbddb('0x39')]({'plain':!![]});var _0x1d2714=_0xbddb('0x3a');return db['UserProfileResource']['destroy']({'where':{'type':_0x1d2714,'resourceId':_0x4e5935['id']}})[_0xbddb('0x23')](function(){return _0xd506d8;});})[_0xbddb('0x23')](function(){_0x12c28e[_0xbddb('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2825fc,_0x457894){return function(_0x52ba23){if(!_0x52ba23){_0x2825fc[_0xbddb('0x2c')](0x194);}return _0x52ba23;};}function handleError(_0xb9e372,_0x3905fe){_0x3905fe=_0x3905fe||0x1f4;return function(_0x57a1d1){logger[_0xbddb('0x28')](_0x57a1d1[_0xbddb('0x3b')]);if(_0x57a1d1[_0xbddb('0x3c')]){delete _0x57a1d1['name'];}_0xb9e372[_0xbddb('0x2d')](_0x3905fe)[_0xbddb('0x3d')](_0x57a1d1);};}exports[_0xbddb('0x3e')]=function(_0x156b6d,_0x3f3ac6){var _0x499959={'include':[{'model':db[_0xbddb('0x3f')],'as':_0xbddb('0x40')}]},_0x296501={},_0x1a0642={'count':0x0,'rows':[]};var _0x5f394d=_[_0xbddb('0x41')](db[_0xbddb('0x42')][_0xbddb('0x43')],function(_0x579942){return{'name':_0x579942[_0xbddb('0x44')],'type':_0x579942[_0xbddb('0x45')][_0xbddb('0x46')]};});_0x296501[_0xbddb('0x47')]=_['map'](_0x5f394d,_0xbddb('0x3c'));_0x296501[_0xbddb('0x48')]=_['keys'](_0x156b6d[_0xbddb('0x48')]);_0x296501[_0xbddb('0x49')]=_['intersection'](_0x296501[_0xbddb('0x47')],_0x296501[_0xbddb('0x48')]);_0x499959['attributes']=_[_0xbddb('0x4a')](_0x296501[_0xbddb('0x47')],qs['fields'](_0x156b6d[_0xbddb('0x48')][_0xbddb('0x4b')]));_0x499959[_0xbddb('0x4c')]=_0x499959[_0xbddb('0x4c')][_0xbddb('0x4d')]?_0x499959[_0xbddb('0x4c')]:_0x296501['model'];if(!_0x156b6d[_0xbddb('0x48')][_0xbddb('0x4e')](_0xbddb('0x4f'))){_0x499959[_0xbddb('0x32')]=qs[_0xbddb('0x32')](_0x156b6d[_0xbddb('0x48')][_0xbddb('0x32')]);_0x499959['offset']=qs[_0xbddb('0x30')](_0x156b6d[_0xbddb('0x48')][_0xbddb('0x30')]);}_0x499959[_0xbddb('0x50')]=qs[_0xbddb('0x51')](_0x156b6d['query'][_0xbddb('0x51')]);_0x499959['where']=qs[_0xbddb('0x49')](_[_0xbddb('0x52')](_0x156b6d['query'],_0x296501['filters']),_0x5f394d);if(_0x156b6d['query']['filter']){_0x499959[_0xbddb('0x53')]=_['merge'](_0x499959['where'],{'$or':_[_0xbddb('0x41')](_0x5f394d,function(_0x59081d){if(_0x59081d[_0xbddb('0x45')]!==_0xbddb('0x54')){var _0x16bbf3={};_0x16bbf3[_0x59081d[_0xbddb('0x3c')]]={'$like':'%'+_0x156b6d['query'][_0xbddb('0x55')]+'%'};return _0x16bbf3;}})});}_0x499959=_[_0xbddb('0x56')]({},_0x499959,_0x156b6d['options']);var _0x45b3a4={'where':_0x499959[_0xbddb('0x53')]};return db[_0xbddb('0x42')][_0xbddb('0x33')](_0x45b3a4)['then'](function(_0x495f8d){_0x1a0642['count']=_0x495f8d;if(_0x156b6d[_0xbddb('0x48')][_0xbddb('0x57')]){_0x499959[_0xbddb('0x58')]=[{'all':!![]}];}return db[_0xbddb('0x42')][_0xbddb('0x59')](_0x499959);})[_0xbddb('0x23')](function(_0xc51c83){_0x1a0642[_0xbddb('0x5a')]=_0xc51c83;return _0x1a0642;})[_0xbddb('0x23')](respondWithFilteredResult(_0x3f3ac6,_0x499959))[_0xbddb('0x2b')](handleError(_0x3f3ac6,null));};exports[_0xbddb('0x5b')]=function(_0x359396,_0x6f1a47){var _0x36882b={'raw':![],'where':{'id':_0x359396[_0xbddb('0x5c')]['id']},'include':[{'model':db[_0xbddb('0x3f')],'as':'mandatoryDispositionPause'}]},_0x4bead9={};_0x4bead9[_0xbddb('0x47')]=_['keys'](db[_0xbddb('0x42')][_0xbddb('0x43')]);_0x4bead9[_0xbddb('0x48')]=_['keys'](_0x359396[_0xbddb('0x48')]);_0x4bead9[_0xbddb('0x49')]=_['intersection'](_0x4bead9['model'],_0x4bead9[_0xbddb('0x48')]);_0x36882b[_0xbddb('0x4c')]=_['intersection'](_0x4bead9[_0xbddb('0x47')],qs[_0xbddb('0x4b')](_0x359396[_0xbddb('0x48')][_0xbddb('0x4b')]));_0x36882b[_0xbddb('0x4c')]=_0x36882b[_0xbddb('0x4c')][_0xbddb('0x4d')]?_0x36882b[_0xbddb('0x4c')]:_0x4bead9[_0xbddb('0x47')];if(_0x359396[_0xbddb('0x48')][_0xbddb('0x57')]){_0x36882b[_0xbddb('0x58')]=[{'all':!![]}];}_0x36882b=_[_0xbddb('0x56')]({},_0x36882b,_0x359396[_0xbddb('0x5d')]);return db['SmsAccount'][_0xbddb('0x5e')](_0x36882b)[_0xbddb('0x23')](handleEntityNotFound(_0x6f1a47,null))[_0xbddb('0x23')](respondWithResult(_0x6f1a47,null))[_0xbddb('0x2b')](handleError(_0x6f1a47,null));};exports[_0xbddb('0x5f')]=function(_0x3a1ea9,_0x4740bb){return db[_0xbddb('0x42')]['create'](_0x3a1ea9[_0xbddb('0x60')],{})[_0xbddb('0x23')](function(_0x3a8093){var _0x69057c=_0x3a1ea9[_0xbddb('0x61')][_0xbddb('0x39')]({'plain':!![]});if(!_0x69057c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x69057c[_0xbddb('0x62')]===_0xbddb('0x61')){var _0x734ee9=_0x3a8093['get']({'plain':!![]});var _0x4dcc60='SmsAccounts';return db[_0xbddb('0x63')][_0xbddb('0x5e')]({'where':{'name':_0x4dcc60,'userProfileId':_0x69057c['userProfileId']},'raw':!![]})[_0xbddb('0x23')](function(_0x231aa3){if(_0x231aa3&&_0x231aa3[_0xbddb('0x64')]===0x0){return db[_0xbddb('0x65')][_0xbddb('0x5f')]({'name':_0x734ee9['name'],'resourceId':_0x734ee9['id'],'type':_0x231aa3[_0xbddb('0x3c')],'sectionId':_0x231aa3['id']},{})[_0xbddb('0x23')](function(){return _0x3a8093;});}else{return _0x3a8093;}})[_0xbddb('0x2b')](function(_0x5c42fd){logger[_0xbddb('0x28')](_0xbddb('0x66'),_0x5c42fd);throw _0x5c42fd;});}return _0x3a8093;})[_0xbddb('0x23')](respondWithResult(_0x4740bb,0xc9))[_0xbddb('0x2b')](handleError(_0x4740bb,null));};exports['update']=function(_0x155742,_0x23af6a){if(_0x155742['body']['id']){delete _0x155742['body']['id'];}return db[_0xbddb('0x42')][_0xbddb('0x5e')]({'where':{'id':_0x155742[_0xbddb('0x5c')]['id']},'include':[{'model':db[_0xbddb('0x3f')],'as':_0xbddb('0x40')}]})[_0xbddb('0x23')](handleEntityNotFound(_0x23af6a,null))['then'](saveUpdates(_0x155742[_0xbddb('0x60')],null))[_0xbddb('0x23')](respondWithResult(_0x23af6a,null))[_0xbddb('0x2b')](handleError(_0x23af6a,null));};exports[_0xbddb('0x38')]=function(_0x3bb3bf,_0x3f7317){return db['SmsAccount'][_0xbddb('0x5e')]({'where':{'id':_0x3bb3bf['params']['id']}})[_0xbddb('0x23')](handleEntityNotFound(_0x3f7317,null))[_0xbddb('0x23')](removeEntity(_0x3f7317,null))['catch'](handleError(_0x3f7317,null));};exports[_0xbddb('0x67')]=function(_0x55e81e,_0x3c91c6){return db[_0xbddb('0x42')][_0xbddb('0x67')]()[_0xbddb('0x23')](respondWithResult(_0x3c91c6,null))[_0xbddb('0x2b')](handleError(_0x3c91c6,null));};exports['addDisposition']=function(_0x1911d4,_0x4a2ce0,_0x1e0a90){if(_0x1911d4[_0xbddb('0x60')]['id']){delete _0x1911d4[_0xbddb('0x60')]['id'];}return db[_0xbddb('0x42')][_0xbddb('0x5e')]({'where':{'id':_0x1911d4[_0xbddb('0x5c')]['id']}})[_0xbddb('0x23')](handleEntityNotFound(_0x4a2ce0,null))[_0xbddb('0x23')](function(_0x44279a){if(_0x44279a){_0x1911d4[_0xbddb('0x60')][_0xbddb('0x68')]=_0x44279a['id'];return db[_0xbddb('0x69')][_0xbddb('0x5f')](_0x1911d4[_0xbddb('0x60')]);}})[_0xbddb('0x23')](respondWithResult(_0x4a2ce0,null))[_0xbddb('0x2b')](handleError(_0x4a2ce0,null));};exports[_0xbddb('0x6a')]=function(_0x40af5c,_0x54aeed,_0x1b4059){var _0xfe61a0={'raw':![],'where':{}};var _0x199d34={};var _0x19879d={'count':0x0,'rows':[]};return db[_0xbddb('0x42')][_0xbddb('0x6b')]({'where':{'id':_0x40af5c[_0xbddb('0x5c')]['id']}})['then'](handleEntityNotFound(_0x54aeed,null))['then'](function(_0x107de8){if(_0x107de8){_0x199d34[_0xbddb('0x47')]=_['keys'](db[_0xbddb('0x69')][_0xbddb('0x43')]);_0x199d34[_0xbddb('0x48')]=_[_0xbddb('0x6c')](_0x40af5c[_0xbddb('0x48')]);_0x199d34[_0xbddb('0x49')]=_[_0xbddb('0x4a')](_0x199d34['model'],_0x199d34['query']);_0xfe61a0[_0xbddb('0x4c')]=_['intersection'](_0x199d34[_0xbddb('0x47')],qs[_0xbddb('0x4b')](_0x40af5c[_0xbddb('0x48')][_0xbddb('0x4b')]));_0xfe61a0['attributes']=_0xfe61a0[_0xbddb('0x4c')][_0xbddb('0x4d')]?_0xfe61a0[_0xbddb('0x4c')]:_0x199d34['model'];if(!_0x40af5c[_0xbddb('0x48')][_0xbddb('0x4e')]('nolimit')){_0xfe61a0[_0xbddb('0x32')]=qs[_0xbddb('0x32')](_0x40af5c[_0xbddb('0x48')]['limit']);_0xfe61a0[_0xbddb('0x30')]=qs[_0xbddb('0x30')](_0x40af5c[_0xbddb('0x48')]['offset']);}_0xfe61a0[_0xbddb('0x50')]=qs[_0xbddb('0x51')](_0x40af5c[_0xbddb('0x48')]['sort']);_0xfe61a0['where']=qs['filters'](_[_0xbddb('0x52')](_0x40af5c[_0xbddb('0x48')],_0x199d34['filters']));_0xfe61a0['where']['SmsAccountId']=_0x107de8['id'];if(_0x40af5c[_0xbddb('0x48')][_0xbddb('0x55')]){_0xfe61a0[_0xbddb('0x53')]=_[_0xbddb('0x56')](_0xfe61a0['where'],{'$or':_[_0xbddb('0x41')](_0xfe61a0[_0xbddb('0x4c')],function(_0x55a624){var _0x4e8399={};_0x4e8399[_0x55a624]={'$like':'%'+_0x40af5c['query'][_0xbddb('0x55')]+'%'};return _0x4e8399;})});}_0xfe61a0=_['merge']({},_0xfe61a0,_0x40af5c[_0xbddb('0x5d')]);return db[_0xbddb('0x69')][_0xbddb('0x33')]({'where':_0xfe61a0[_0xbddb('0x53')]})[_0xbddb('0x23')](function(_0x3bfcfe){_0x19879d[_0xbddb('0x33')]=_0x3bfcfe;if(_0x40af5c[_0xbddb('0x48')]['includeAll']){_0xfe61a0[_0xbddb('0x58')]=[{'all':!![]}];}return db['Disposition'][_0xbddb('0x59')](_0xfe61a0);})[_0xbddb('0x23')](function(_0x58717f){_0x19879d['rows']=_0x58717f;return _0x19879d;});}})['then'](respondWithFilteredResult(_0x54aeed,_0xfe61a0))[_0xbddb('0x2b')](handleError(_0x54aeed,null));};exports[_0xbddb('0x6d')]=function(_0x515948,_0x3305da,_0x1a8b65){return db[_0xbddb('0x42')][_0xbddb('0x5e')]({'where':{'id':_0x515948[_0xbddb('0x5c')]['id']}})[_0xbddb('0x23')](handleEntityNotFound(_0x3305da,null))['then'](function(_0x5d6d8c){if(_0x5d6d8c){return _0x5d6d8c[_0xbddb('0x6d')](_0x515948['query']['ids']);}})['then'](respondWithStatusCode(_0x3305da,null))[_0xbddb('0x2b')](handleError(_0x3305da,null));};exports[_0xbddb('0x6e')]=function(_0x27c830,_0x7170b3,_0x190aea){if(_0x27c830[_0xbddb('0x60')]['id']){delete _0x27c830[_0xbddb('0x60')]['id'];}return db[_0xbddb('0x42')][_0xbddb('0x5e')]({'where':{'id':_0x27c830[_0xbddb('0x5c')]['id']}})[_0xbddb('0x23')](handleEntityNotFound(_0x7170b3,null))['then'](function(_0x37dc88){if(_0x37dc88){_0x27c830['body'][_0xbddb('0x68')]=_0x37dc88['id'];return db[_0xbddb('0x6f')][_0xbddb('0x5f')](_0x27c830[_0xbddb('0x60')]);}})['then'](respondWithResult(_0x7170b3,null))[_0xbddb('0x2b')](handleError(_0x7170b3,null));};exports[_0xbddb('0x70')]=function(_0x216da0,_0x249d41,_0x1c6cca){var _0x126bc0={'raw':![],'where':{}};var _0x1f267a={};var _0x3c1a8f={'count':0x0,'rows':[]};return db[_0xbddb('0x42')]['findOne']({'where':{'id':_0x216da0[_0xbddb('0x5c')]['id']}})[_0xbddb('0x23')](handleEntityNotFound(_0x249d41,null))[_0xbddb('0x23')](function(_0x9901f0){if(_0x9901f0){_0x1f267a['model']=_[_0xbddb('0x6c')](db['CannedAnswer']['rawAttributes']);_0x1f267a[_0xbddb('0x48')]=_[_0xbddb('0x6c')](_0x216da0[_0xbddb('0x48')]);_0x1f267a[_0xbddb('0x49')]=_[_0xbddb('0x4a')](_0x1f267a[_0xbddb('0x47')],_0x1f267a[_0xbddb('0x48')]);_0x126bc0['attributes']=_['intersection'](_0x1f267a[_0xbddb('0x47')],qs[_0xbddb('0x4b')](_0x216da0[_0xbddb('0x48')][_0xbddb('0x4b')]));_0x126bc0[_0xbddb('0x4c')]=_0x126bc0[_0xbddb('0x4c')]['length']?_0x126bc0['attributes']:_0x1f267a[_0xbddb('0x47')];if(!_0x216da0['query'][_0xbddb('0x4e')](_0xbddb('0x4f'))){_0x126bc0[_0xbddb('0x32')]=qs[_0xbddb('0x32')](_0x216da0[_0xbddb('0x48')]['limit']);_0x126bc0[_0xbddb('0x30')]=qs[_0xbddb('0x30')](_0x216da0['query'][_0xbddb('0x30')]);}_0x126bc0['order']=qs[_0xbddb('0x51')](_0x216da0[_0xbddb('0x48')][_0xbddb('0x51')]);_0x126bc0[_0xbddb('0x53')]=qs[_0xbddb('0x49')](_[_0xbddb('0x52')](_0x216da0[_0xbddb('0x48')],_0x1f267a[_0xbddb('0x49')]));_0x126bc0[_0xbddb('0x53')][_0xbddb('0x68')]=_0x9901f0['id'];if(_0x216da0['query'][_0xbddb('0x55')]){_0x126bc0[_0xbddb('0x53')]=_[_0xbddb('0x56')](_0x126bc0['where'],{'$or':_[_0xbddb('0x41')](_0x126bc0['attributes'],function(_0x50a121){var _0x87d40f={};_0x87d40f[_0x50a121]={'$like':'%'+_0x216da0[_0xbddb('0x48')][_0xbddb('0x55')]+'%'};return _0x87d40f;})});}_0x126bc0=_[_0xbddb('0x56')]({},_0x126bc0,_0x216da0[_0xbddb('0x5d')]);return db[_0xbddb('0x6f')][_0xbddb('0x33')]({'where':_0x126bc0[_0xbddb('0x53')]})[_0xbddb('0x23')](function(_0x338018){_0x3c1a8f[_0xbddb('0x33')]=_0x338018;if(_0x216da0[_0xbddb('0x48')]['includeAll']){_0x126bc0[_0xbddb('0x58')]=[{'all':!![]}];}return db[_0xbddb('0x6f')][_0xbddb('0x59')](_0x126bc0);})[_0xbddb('0x23')](function(_0x4d0b65){_0x3c1a8f['rows']=_0x4d0b65;return _0x3c1a8f;});}})[_0xbddb('0x23')](respondWithFilteredResult(_0x249d41,_0x126bc0))['catch'](handleError(_0x249d41,null));};exports['removeAnswers']=function(_0x131dc0,_0x16da7f,_0x117147){return db[_0xbddb('0x42')][_0xbddb('0x5e')]({'where':{'id':_0x131dc0[_0xbddb('0x5c')]['id']}})[_0xbddb('0x23')](handleEntityNotFound(_0x16da7f,null))['then'](function(_0x5aec15){if(_0x5aec15){return _0x5aec15['removeAnswers'](_0x131dc0[_0xbddb('0x48')][_0xbddb('0x71')]);}})[_0xbddb('0x23')](respondWithStatusCode(_0x16da7f,null))['catch'](handleError(_0x16da7f,null));};exports[_0xbddb('0x72')]=function(_0x5e80a9,_0x1e1b70,_0x4ee33d){var _0x233c19={'channel':_0xbddb('0x73')};var _0x4e03a8=[];var _0x44eb6c=[];var _0x5d09db={};return db[_0xbddb('0x42')][_0xbddb('0x5e')]({'where':{'id':_0x5e80a9[_0xbddb('0x5c')]['id']},'include':[{'model':db['SmsApplication'],'as':_0xbddb('0x74')}]})[_0xbddb('0x23')](handleEntityNotFound(_0x1e1b70,null))[_0xbddb('0x23')](function(_0x2469b5){_0x233c19[_0xbddb('0x75')]=_0x2469b5;_0x233c19[_0xbddb('0x76')]=_[_0xbddb('0x77')](_0x2469b5[_0xbddb('0x74')],['priority'],[_0xbddb('0x78')]);if(_0x233c19[_0xbddb('0x75')][_0xbddb('0x74')]){delete _0x233c19[_0xbddb('0x75')][_0xbddb('0x74')];}return db['CmContact'][_0xbddb('0x67')]();})[_0xbddb('0x23')](function(_0x3e3efa){if(!_0x3e3efa){throw new db[(_0xbddb('0x79'))][(_0xbddb('0x7a'))]('no\x20available\x20attributes');}_0x4e03a8=_[_0xbddb('0x7b')](_[_0xbddb('0x6c')](_0x3e3efa),['createdAt',_0xbddb('0x7c')]);_0x44eb6c=_[_0xbddb('0x7b')](_['keys'](_0x3e3efa),[_0xbddb('0x7d'),_0xbddb('0x7c'),_0xbddb('0x7e'),_0xbddb('0x7f')]);_0x233c19[_0xbddb('0x60')]={'mapKey':_0xbddb('0x80')};if(_0x233c19[_0xbddb('0x75')][_0xbddb('0x45')]){switch(_0x233c19[_0xbddb('0x75')][_0xbddb('0x45')]){case _0xbddb('0x81'):_0x233c19[_0xbddb('0x60')][_0xbddb('0x82')]=_0x5e80a9[_0xbddb('0x60')]['From'];_0x233c19[_0xbddb('0x60')][_0xbddb('0x60')]=_0x5e80a9[_0xbddb('0x60')]['Body'];_0x233c19[_0xbddb('0x60')][_0xbddb('0x83')]=_0x5e80a9[_0xbddb('0x60')][_0xbddb('0x84')];break;case'skebby':_0x233c19['body']['from']='+'+_0x5e80a9[_0xbddb('0x60')][_0xbddb('0x85')];_0x233c19[_0xbddb('0x60')][_0xbddb('0x60')]=_0x5e80a9['body'][_0xbddb('0x86')];break;case _0xbddb('0x87'):_0x233c19[_0xbddb('0x60')]['from']=_0x5e80a9[_0xbddb('0x60')][_0xbddb('0x82')];_0x233c19[_0xbddb('0x60')]['body']=_0x5e80a9['body'][_0xbddb('0x2a')];break;case _0xbddb('0x88'):_0x233c19['body'][_0xbddb('0x82')]=_0x5e80a9[_0xbddb('0x60')][_0xbddb('0x82')];_0x233c19['body'][_0xbddb('0x60')]=_0x5e80a9[_0xbddb('0x60')][_0xbddb('0x60')];_0x233c19[_0xbddb('0x60')][_0xbddb('0x83')]=_0x5e80a9['body']['message_id'];break;case _0xbddb('0x89'):_0x233c19['body']['from']=_0x5e80a9[_0xbddb('0x60')][_0xbddb('0x8a')];_0x233c19[_0xbddb('0x60')][_0xbddb('0x60')]=_0x5e80a9[_0xbddb('0x60')][_0xbddb('0x8b')];_0x233c19[_0xbddb('0x60')][_0xbddb('0x83')]=_0x5e80a9[_0xbddb('0x60')][_0xbddb('0x8c')];break;case _0xbddb('0x8d'):_0x233c19[_0xbddb('0x60')]['from']='+'+_0x5e80a9['body']['results'][0x0][_0xbddb('0x82')];_0x233c19[_0xbddb('0x60')][_0xbddb('0x60')]=_0x5e80a9[_0xbddb('0x60')][_0xbddb('0x8e')][0x0][_0xbddb('0x86')];_0x233c19['body'][_0xbddb('0x83')]=_0x5e80a9[_0xbddb('0x60')][_0xbddb('0x8e')][0x0]['messageId'];break;case _0xbddb('0x8f'):_0x233c19[_0xbddb('0x60')][_0xbddb('0x82')]=_0x5e80a9['body'][_0xbddb('0x90')];_0x233c19[_0xbddb('0x60')][_0xbddb('0x60')]=_0x5e80a9[_0xbddb('0x60')][_0xbddb('0x91')][_0xbddb('0x2a')];break;case _0xbddb('0x92'):_0x233c19[_0xbddb('0x60')][_0xbddb('0x82')]=_0x5e80a9[_0xbddb('0x60')][_0xbddb('0x93')];_0x233c19['body']['body']=_0x5e80a9[_0xbddb('0x60')][_0xbddb('0x86')];_0x233c19[_0xbddb('0x60')][_0xbddb('0x83')]=_0x5e80a9[_0xbddb('0x60')][_0xbddb('0x94')];break;case _0xbddb('0x95'):_0x233c19[_0xbddb('0x60')][_0xbddb('0x83')]=_0x5e80a9[_0xbddb('0x60')][0x0]['message']['id'];_0x233c19[_0xbddb('0x60')][_0xbddb('0x82')]=_0x5e80a9[_0xbddb('0x60')][0x0]['message'][_0xbddb('0x82')];_0x233c19[_0xbddb('0x60')][_0xbddb('0x60')]=_0x5e80a9[_0xbddb('0x60')][0x0][_0xbddb('0x2a')][_0xbddb('0x86')];break;case _0xbddb('0x96'):_0x233c19[_0xbddb('0x60')]['from']=_0x5e80a9[_0xbddb('0x60')][_0xbddb('0x82')];_0x233c19[_0xbddb('0x60')][_0xbddb('0x60')]=_0x5e80a9[_0xbddb('0x60')][_0xbddb('0x2a')];_0x233c19[_0xbddb('0x60')]['messageId']=_0x5e80a9[_0xbddb('0x60')]['refid'];break;}}if(_0x233c19[_0xbddb('0x60')]['id']){delete _0x233c19[_0xbddb('0x60')]['id'];}if(_['isNil'](_0x233c19[_0xbddb('0x60')][_0xbddb('0x82')])){throw new db[(_0xbddb('0x79'))]['ValidationError'](_0xbddb('0x97'));}if(_[_0xbddb('0x98')](_0x233c19[_0xbddb('0x60')][_0xbddb('0x60')])||_0x233c19[_0xbddb('0x60')][_0xbddb('0x60')]===''){throw new db[(_0xbddb('0x79'))][(_0xbddb('0x7a'))](_0xbddb('0x99'));}if(_[_0xbddb('0x98')](_0x233c19[_0xbddb('0x60')][_0xbddb('0x9a')])){throw new db['Sequelize']['ValidationError'](_0xbddb('0x9b')+_0x44eb6c);}if(!_['includes'](_0x44eb6c,_0x233c19[_0xbddb('0x60')][_0xbddb('0x9a')])){throw new db[(_0xbddb('0x79'))][(_0xbddb('0x7a'))](_0xbddb('0x9c')+_0x44eb6c);}_0x5d09db[_0x233c19['body'][_0xbddb('0x9a')]]=_0x233c19['body'][_0xbddb('0x82')];return db[_0xbddb('0x9d')][_0xbddb('0x5e')]({'where':{'id':_0x233c19[_0xbddb('0x75')][_0xbddb('0x7f')]},'include':[{'model':db[_0xbddb('0x9e')],'as':_0xbddb('0x9f'),'where':_0x5d09db,'limit':0x1,'order':[['updatedAt',_0xbddb('0xa0')]]}]});})[_0xbddb('0x23')](handleEntityNotFound(_0x1e1b70,null))[_0xbddb('0x23')](function(_0x5890c4){if(_0x5890c4){_0x233c19['list']=_[_0xbddb('0xa1')](_0x5890c4,[_0xbddb('0x9f')]);if(_0x5890c4[_0xbddb('0x9f')]['length']){return _0x5890c4[_0xbddb('0x9f')][0x0];}var _0x4c062b=_[_0xbddb('0x1c')](_0x233c19['body'],{'firstName':_0x233c19['body'][_0xbddb('0x82')],'ListId':_0x5890c4['id']});_0x4c062b[_0x233c19['body']['mapKey']]=_0x233c19[_0xbddb('0x60')][_0xbddb('0x82')];return db[_0xbddb('0x9e')][_0xbddb('0x5f')](_0x4c062b,{'fields':_0x4e03a8,'raw':!![]});}})['then'](handleEntityNotFound(_0x1e1b70,null))[_0xbddb('0x23')](function(_0x3f748d){if(_0x3f748d){_0x233c19[_0xbddb('0xa2')]=_0x3f748d;var _0x2b227b={'ContactId':_0x3f748d['id'],'phone':_0x233c19[_0xbddb('0x60')][_0xbddb('0x82')],'SmsAccountId':_0x5e80a9[_0xbddb('0x5c')]['id']};var _0xe86eb9={'ContactId':_0x3f748d['id'],'SmsAccountId':_0x5e80a9['params']['id'],'closed':![]};return db['SmsInteraction'][_0xbddb('0x5e')]({'where':_0xe86eb9})[_0xbddb('0x23')](function(_0xe14fcb){if(_0xe14fcb){return[_0xe14fcb,![]];}return db['SmsInteraction'][_0xbddb('0x5f')](_0x2b227b)[_0xbddb('0x23')](function(_0x3dc0d1){return[_0x3dc0d1,!![]];});});}})[_0xbddb('0xa3')](function(_0x5e313f,_0x47b032){_0x233c19['interaction']=_0x5e313f[_0xbddb('0x39')]({'plain':!![]});_0x233c19[_0xbddb('0xa4')]['created']=![];if(_0x47b032){if(_0x233c19[_0xbddb('0x75')][_0xbddb('0xa5')]){_0x233c19[_0xbddb('0x76')][_0xbddb('0xa6')]({'id':0x0,'priority':_0x233c19[_0xbddb('0x76')][_0xbddb('0x4d')]+0x1,'app':'close','appdata':'unmanaged','interval':_0xbddb('0xa7')});}_0x233c19['interaction'][_0xbddb('0xa8')]=!![];}return db[_0xbddb('0xa9')]['create']({'phone':_0x233c19[_0xbddb('0x60')][_0xbddb('0x82')],'messageId':_0x233c19[_0xbddb('0x60')][_0xbddb('0x83')],'body':_0x233c19[_0xbddb('0x60')]['body'],'SmsAccountId':_0x5e80a9['params']['id'],'SmsInteractionId':_0x5e313f['id'],'direction':'in','ContactId':_0x5e313f['ContactId'],'AttachmentId':_0x233c19['body'][_0xbddb('0xaa')]});})[_0xbddb('0x23')](function(_0x3e8fb3){_0x233c19[_0xbddb('0x2a')]=_0x3e8fb3;if(_0x233c19[_0xbddb('0xa4')][_0xbddb('0xab')]){return db[_0xbddb('0xac')]['find']({'attributes':['id',_0xbddb('0x3c')],'where':{'id':_0x233c19[_0xbddb('0xa4')]['UserId']}})[_0xbddb('0x23')](function(_0x5d6bc6){if(_0x5d6bc6){_0x233c19[_0xbddb('0x76')][_0xbddb('0xad')]({'id':0x0,'priority':0x0,'app':_0xbddb('0xae'),'appdata':_0x5d6bc6[_0xbddb('0x3c')]+','+(_0x233c19[_0xbddb('0x75')][_0xbddb('0xaf')]||0xa),'interval':_0xbddb('0xa7')});}return respondWithRpcPromise(_0xbddb('0xb0'),'startRouting',_0x233c19);});}return respondWithRpcPromise(_0xbddb('0xb0'),_0xbddb('0xb1'),_0x233c19);})['then'](function(_0x29afca){if(_0x29afca){var _0x245504=0xc8;var _0x4dd83f='receiveMessage';logger[_0xbddb('0x24')](_0xbddb('0xb2'),_0x4dd83f,_0x245504,_0xbddb('0xb3'));logger[_0xbddb('0xb4')](_0xbddb('0xb5'),_0x4dd83f,_0x245504,'entity\x20found',JSON[_0xbddb('0x27')](_0x29afca));if(_0x233c19['account'][_0xbddb('0x45')]===_0xbddb('0x81')){return _0x1e1b70[_0xbddb('0x2d')](_0x245504)['set'](_0xbddb('0xb6'),_0xbddb('0xb7'))['send'](_0xbddb('0xb8'));}else{return _0x1e1b70[_0xbddb('0x2d')](_0x245504)[_0xbddb('0x2f')](_0x29afca);}}})[_0xbddb('0x2b')](handleError(_0x1e1b70,null));};exports[_0xbddb('0xb9')]=function(_0x15b0c1,_0x245b8d,_0x440b4b){return db[_0xbddb('0x42')][_0xbddb('0x6b')]({'where':{'id':_0x15b0c1['params']['id']}})['then'](handleEntityNotFound(_0x245b8d,null))[_0xbddb('0x23')](function(_0x5edbdd){if(_0x5edbdd){return db[_0xbddb('0xba')][_0xbddb('0xbb')](function(_0x4f2ecb){return db[_0xbddb('0xbc')][_0xbddb('0x38')]({'where':{'SmsAccountId':_0x15b0c1['params']['id']},'transaction':_0x4f2ecb})[_0xbddb('0x23')](function(_0x50d8e0){var _0x14e74e=_[_0xbddb('0x41')](_0x15b0c1[_0xbddb('0x60')],function(_0xbe950d){_0xbe950d[_0xbddb('0x68')]=_0x15b0c1[_0xbddb('0x5c')]['id'];return _0xbe950d;});return db[_0xbddb('0xbc')]['bulkCreate'](_0x14e74e,{'transaction':_0x4f2ecb});});})[_0xbddb('0x23')](function(){return db[_0xbddb('0xbc')][_0xbddb('0xbd')]({'where':{'SmsAccountId':_0x15b0c1['params']['id']},'order':_0xbddb('0xbe')});});}})[_0xbddb('0x23')](respondWithResult(_0x245b8d,null))[_0xbddb('0x2b')](handleError(_0x245b8d,null));};exports['getApplications']=function(_0x5581b4,_0x24b608,_0x2efea2){var _0x574959={};var _0x357b30={};var _0x30f0f7;var _0x1561a3;return db[_0xbddb('0x42')][_0xbddb('0x6b')]({'where':{'id':_0x5581b4[_0xbddb('0x5c')]['id']}})[_0xbddb('0x23')](handleEntityNotFound(_0x24b608,null))[_0xbddb('0x23')](function(_0x2cfd08){if(_0x2cfd08){_0x30f0f7=_0x2cfd08;_0x357b30[_0xbddb('0x47')]=_[_0xbddb('0x6c')](db['SmsApplication'][_0xbddb('0x43')]);_0x357b30[_0xbddb('0x48')]=_['keys'](_0x5581b4[_0xbddb('0x48')]);_0x357b30['filters']=_[_0xbddb('0x4a')](_0x357b30[_0xbddb('0x47')],_0x357b30[_0xbddb('0x48')]);_0x574959[_0xbddb('0x4c')]=_[_0xbddb('0x4a')](_0x357b30[_0xbddb('0x47')],qs[_0xbddb('0x4b')](_0x5581b4[_0xbddb('0x48')][_0xbddb('0x4b')]));_0x574959[_0xbddb('0x4c')]=_0x574959['attributes'][_0xbddb('0x4d')]?_0x574959['attributes']:_0x357b30[_0xbddb('0x47')];_0x574959['order']=qs['sort'](_0x5581b4[_0xbddb('0x48')][_0xbddb('0x51')]);_0x574959[_0xbddb('0x53')]=qs[_0xbddb('0x49')](_[_0xbddb('0x52')](_0x5581b4[_0xbddb('0x48')],_0x357b30[_0xbddb('0x49')]));if(_0x5581b4[_0xbddb('0x48')]['filter']){_0x574959['where']=_[_0xbddb('0x56')](_0x574959['where'],{'$or':_[_0xbddb('0x41')](_0x574959['attributes'],function(_0x418e4d){var _0x52539a={};_0x52539a[_0x418e4d]={'$like':'%'+_0x5581b4[_0xbddb('0x48')]['filter']+'%'};return _0x52539a;})});}_0x574959=_['merge']({},_0x574959,_0x5581b4[_0xbddb('0x5d')]);return _0x30f0f7[_0xbddb('0xbf')](_0x574959);}})[_0xbddb('0x23')](function(_0x56c180){if(_0x56c180){_0x1561a3=_0x56c180[_0xbddb('0x4d')];if(!_0x5581b4[_0xbddb('0x48')]['hasOwnProperty']('nolimit')){_0x574959[_0xbddb('0x32')]=qs['limit'](_0x5581b4[_0xbddb('0x48')][_0xbddb('0x32')]);_0x574959['offset']=qs[_0xbddb('0x30')](_0x5581b4[_0xbddb('0x48')][_0xbddb('0x30')]);}return _0x30f0f7[_0xbddb('0xbf')](_0x574959);}})[_0xbddb('0x23')](function(_0x8d534c){if(_0x8d534c){return _0x8d534c?{'count':_0x1561a3,'rows':_0x8d534c}:null;}})['then'](respondWithResult(_0x24b608,null))[_0xbddb('0x2b')](handleError(_0x24b608,null));};exports['getInteractions']=function(_0x2906f3,_0x31bd22,_0x4bd426){var _0x3ccd41={'raw':![],'where':{}};var _0x4733ac={};var _0x26bf59={'count':0x0,'rows':[]};return db[_0xbddb('0x42')][_0xbddb('0x6b')]({'where':{'id':_0x2906f3[_0xbddb('0x5c')]['id']}})[_0xbddb('0x23')](handleEntityNotFound(_0x31bd22,null))[_0xbddb('0x23')](function(_0xc6281b){if(_0xc6281b){_0x4733ac['model']=_[_0xbddb('0x6c')](db[_0xbddb('0xc0')][_0xbddb('0x43')]);_0x4733ac[_0xbddb('0x48')]=_[_0xbddb('0x6c')](_0x2906f3['query']);_0x4733ac['filters']=_[_0xbddb('0x4a')](_0x4733ac['model'],_0x4733ac[_0xbddb('0x48')]);_0x3ccd41[_0xbddb('0x4c')]=_[_0xbddb('0x4a')](_0x4733ac[_0xbddb('0x47')],qs[_0xbddb('0x4b')](_0x2906f3[_0xbddb('0x48')][_0xbddb('0x4b')]));_0x3ccd41[_0xbddb('0x4c')]=_0x3ccd41[_0xbddb('0x4c')][_0xbddb('0x4d')]?_0x3ccd41['attributes']:_0x4733ac['model'];if(!_0x2906f3[_0xbddb('0x48')][_0xbddb('0x4e')](_0xbddb('0x4f'))){_0x3ccd41['limit']=qs[_0xbddb('0x32')](_0x2906f3['query']['limit']);_0x3ccd41[_0xbddb('0x30')]=qs['offset'](_0x2906f3[_0xbddb('0x48')]['offset']);}_0x3ccd41[_0xbddb('0x50')]=qs[_0xbddb('0x51')](_0x2906f3[_0xbddb('0x48')][_0xbddb('0x51')]);_0x3ccd41[_0xbddb('0x53')]=qs[_0xbddb('0x49')](_[_0xbddb('0x52')](_0x2906f3[_0xbddb('0x48')],_0x4733ac[_0xbddb('0x49')]));_0x3ccd41['where'][_0xbddb('0x68')]=_0xc6281b['id'];if(_0x2906f3[_0xbddb('0x48')][_0xbddb('0x55')]){_0x3ccd41['where']=_['merge'](_0x3ccd41['where'],{'$or':_[_0xbddb('0x41')](_0x3ccd41[_0xbddb('0x4c')],function(_0x4e29d3){var _0x2e86ed={};_0x2e86ed[_0x4e29d3]={'$like':'%'+_0x2906f3[_0xbddb('0x48')][_0xbddb('0x55')]+'%'};return _0x2e86ed;})});}_0x3ccd41=_[_0xbddb('0x56')]({},_0x3ccd41,_0x2906f3[_0xbddb('0x5d')]);return db[_0xbddb('0xc0')]['count']({'where':_0x3ccd41[_0xbddb('0x53')]})[_0xbddb('0x23')](function(_0x185f83){_0x26bf59[_0xbddb('0x33')]=_0x185f83;if(_0x2906f3[_0xbddb('0x48')][_0xbddb('0x57')]){_0x3ccd41['include']=[{'model':db[_0xbddb('0x9e')],'as':'Contact','required':![]},{'model':db['User'],'as':_0xbddb('0xc1'),'attributes':[_0xbddb('0x3c'),_0xbddb('0xc2'),_0xbddb('0xc3')],'required':![]},{'model':db['Tag'],'as':_0xbddb('0xc4'),'attributes':['id',_0xbddb('0x3c'),_0xbddb('0xc5')],'where':_0x2906f3['query']['tag']?{'id':_0x2906f3['query']['tag']}:undefined,'required':_0x2906f3[_0xbddb('0x48')][_0xbddb('0xc6')]?!![]:![]}];}return db[_0xbddb('0xc0')][_0xbddb('0x59')](_0x3ccd41);})['then'](function(_0x3e1ce3){_0x26bf59[_0xbddb('0x5a')]=_0x3e1ce3;return _0x26bf59;});}})[_0xbddb('0x23')](respondWithFilteredResult(_0x31bd22,_0x3ccd41))['catch'](handleError(_0x31bd22,null));};exports['send']=function(_0x5b2a9a,_0x2d7e9e,_0x30c42a){var _0xdc27f4,_0xa62a05,_0x21eff0;if(_[_0xbddb('0x98')](_0x5b2a9a[_0xbddb('0x60')][_0xbddb('0x60')])||_0x5b2a9a[_0xbddb('0x60')][_0xbddb('0x60')]===''){throw new db[(_0xbddb('0x79'))][(_0xbddb('0x7a'))](_0xbddb('0x99'));}if(_[_0xbddb('0x98')](_0x5b2a9a[_0xbddb('0x60')]['to'])){throw new db['Sequelize']['ValidationError'](_0xbddb('0xc7'));}_0xdc27f4=_0x5b2a9a[_0xbddb('0x60')]['to'];return db[_0xbddb('0x42')][_0xbddb('0x5e')]({'where':{'id':_0x5b2a9a[_0xbddb('0x5c')]['id']},'include':[{'model':db[_0xbddb('0x9d')],'as':_0xbddb('0xc8'),'include':[{'model':db[_0xbddb('0x9e')],'as':_0xbddb('0x9f'),'where':{'mobile':_0xdc27f4},'limit':0x1,'order':[[_0xbddb('0x7c'),_0xbddb('0xa0')]]}]}]})[_0xbddb('0x23')](handleEntityNotFound(_0x2d7e9e,null))[_0xbddb('0x23')](function(_0x40243f){if(_0x40243f&&_0x40243f[_0xbddb('0xc8')]){_0xa62a05=_0x40243f['get']({'plain':!![]});if(_0xa62a05['List']&&_0xa62a05[_0xbddb('0xc8')][_0xbddb('0x9f')][_0xbddb('0x4d')]){return _0xa62a05[_0xbddb('0xc8')][_0xbddb('0x9f')][0x0];}return db[_0xbddb('0x9e')]['create'](_[_0xbddb('0x1c')](_0x5b2a9a[_0xbddb('0x60')],{'firstName':_0xdc27f4,'mobile':_0xdc27f4,'phone':_0xdc27f4,'ListId':_0xa62a05[_0xbddb('0x7f')]}));}})[_0xbddb('0x23')](handleEntityNotFound(_0x2d7e9e,null))['then'](function(_0x1ccc6a){if(_0x1ccc6a){_0x21eff0=_0x1ccc6a;return db['SmsInteraction']['find']({'where':{'ContactId':_0x21eff0['id'],'closed':![],'SmsAccountId':_0xa62a05['id']}})[_0xbddb('0x23')](function(_0x452587){if(_0x452587){return[_0x452587,![]];}return db[_0xbddb('0xc0')][_0xbddb('0x5f')]({'UserId':_0x5b2a9a['user']['id'],'ContactId':_0x21eff0['id'],'SmsAccountId':_0xa62a05['id'],'phone':_0xdc27f4,'firstMsgDirection':_0xbddb('0xc9'),'Messages':[_[_0xbddb('0x56')](_0x5b2a9a[_0xbddb('0x60')],{'read':![],'body':_0x5b2a9a['body'][_0xbddb('0x60')],'phone':_0xdc27f4,'SmsAccountId':_0xa62a05['id'],'UserId':_0x5b2a9a['user']['id'],'ContactId':_0x21eff0['id']})]},{'include':[{'model':db[_0xbddb('0xa9')],'as':_0xbddb('0xca')}]})[_0xbddb('0x23')](function(_0x4a7d71){return[_0x4a7d71,!![]];});});}})[_0xbddb('0xa3')](function(_0x3f2076,_0x3be9d2){if(_0x3be9d2){return _0x3f2076;}return db[_0xbddb('0xa9')][_0xbddb('0x5f')](_['merge'](_0x5b2a9a['body'],{'read':![],'body':_0x5b2a9a['body'][_0xbddb('0x60')],'phone':_0xdc27f4,'SmsAccountId':_0xa62a05['id'],'SmsInteractionId':_0x3f2076['id'],'UserId':_0x5b2a9a['user']['id'],'ContactId':_0x21eff0['id']}))[_0xbddb('0x23')](function(_0xef947d){_0x3f2076[_0xbddb('0xcb')]['Messages']=[];_0x3f2076[_0xbddb('0xcb')][_0xbddb('0xca')][_0xbddb('0xa6')](_0xef947d[_0xbddb('0xcb')]);return _0x3f2076;});})[_0xbddb('0x23')](respondWithResult(_0x2d7e9e,null))[_0xbddb('0x2b')](handleError(_0x2d7e9e,null));};exports[_0xbddb('0x2d')]=function(_0x1ed702,_0x242ddb,_0x11a954){if(_0x1ed702[_0xbddb('0x60')]['id']){delete _0x1ed702[_0xbddb('0x60')]['id'];}var _0x5bef63,_0x3b802b,_0xcbd49;return db[_0xbddb('0x42')][_0xbddb('0x5e')]({'where':{'id':_0x1ed702[_0xbddb('0x5c')]['id']}})[_0xbddb('0x23')](handleEntityNotFound(_0x242ddb,null))[_0xbddb('0x23')](function(_0x2fdd5d){if(_0x2fdd5d){_0xcbd49=_0x2fdd5d;logger[_0xbddb('0xb4')](_0xbddb('0xb2'),_0xbddb('0x2d'),'received\x20delivery\x20report\x20from',_0x2fdd5d[_0xbddb('0x45')],util[_0xbddb('0xcc')](_0x1ed702[_0xbddb('0x60')],{'showHidden':![],'depth':null}));switch(_0x2fdd5d[_0xbddb('0x45')]){case _0xbddb('0xcd'):if(_0x1ed702[_0xbddb('0x60')][_0xbddb('0xce')]&&_0x1ed702[_0xbddb('0x60')]['status']){_0x3b802b=_0x1ed702[_0xbddb('0x60')][_0xbddb('0x2d')];return db[_0xbddb('0xa9')][_0xbddb('0x5e')]({'where':{'messageId':_0x1ed702['body'][_0xbddb('0xce')]}});}break;case _0xbddb('0x87'):if(_0x1ed702['body']['requestid']&&_0x1ed702[_0xbddb('0x60')][_0xbddb('0xcf')]){_0x3b802b=_0x1ed702['body'][_0xbddb('0xcf')];return db['SmsMessage'][_0xbddb('0x5e')]({'where':{'messageId':_0x1ed702[_0xbddb('0x60')][_0xbddb('0xd0')]}});}break;case _0xbddb('0x88'):if(_0x1ed702['body']['message_id']&&_0x1ed702[_0xbddb('0x60')][_0xbddb('0xd1')]){_0x3b802b=_0x1ed702['body'][_0xbddb('0xd1')];return db['SmsMessage'][_0xbddb('0x5e')]({'where':{'messageId':_0x1ed702[_0xbddb('0x60')]['message_id']}});}break;case _0xbddb('0x8d'):var _0x56ac37=_0x1ed702[_0xbddb('0x60')][_0xbddb('0x8e')][0x0];if(_0x56ac37[_0xbddb('0x83')]&&_0x56ac37['status'][_0xbddb('0xd2')]===_0xbddb('0xd3')){_0x3b802b=_0x56ac37[_0xbddb('0x2d')][_0xbddb('0xd2')];return db[_0xbddb('0xa9')][_0xbddb('0x5e')]({'where':{'messageId':_0x56ac37[_0xbddb('0x83')]}});}break;case _0xbddb('0x92'):if(_0x1ed702[_0xbddb('0x60')][_0xbddb('0x83')]&&_0x1ed702[_0xbddb('0x60')]['status']){_0x3b802b=_0x1ed702[_0xbddb('0x60')]['status'];return db[_0xbddb('0xa9')][_0xbddb('0x5e')]({'where':{'messageId':_0x1ed702[_0xbddb('0x60')][_0xbddb('0x83')]}});}break;case _0xbddb('0x95'):if(_0x1ed702[_0xbddb('0x60')][0x0]['message']['id']){_0x3b802b=_0x1ed702[_0xbddb('0x60')][0x0][_0xbddb('0x45')];return db['SmsMessage'][_0xbddb('0x5e')]({'where':{'messageId':_0x1ed702[_0xbddb('0x60')][0x0][_0xbddb('0x2a')]['id']}});}break;case _0xbddb('0x96'):if(_0x1ed702['body'][_0xbddb('0xd4')]&&_0x1ed702['body'][_0xbddb('0x2d')]){_0x3b802b=_0x1ed702['body']['status'];return db['SmsMessage'][_0xbddb('0x5e')]({'where':{'messageId':_0x1ed702[_0xbddb('0x60')]['redif']}});}break;}}})['then'](handleEntityNotFound(_0x242ddb,null))['then'](function(_0x5bc601){if(_0x5bc601){_0x5bef63=_0x5bc601;switch(_0xcbd49['type']){case _0xbddb('0xcd'):if(_0x3b802b===_0xbddb('0xd3')){return _0x5bef63[_0xbddb('0x37')]({'read':!![]});}else{logger[_0xbddb('0x28')](_0xbddb('0xb2'),_0xbddb('0x2d'),_0xbddb('0xcd'),util[_0xbddb('0xcc')](_0x1ed702[_0xbddb('0x60')],{'showHidden':![],'depth':null}));}break;case _0xbddb('0x87'):if(_0x3b802b==='1'){return _0x5bef63[_0xbddb('0x37')]({'read':!![]});}else{logger['error'](_0xbddb('0xb2'),_0xbddb('0x2d'),'skebby',util[_0xbddb('0xcc')](_0x1ed702[_0xbddb('0x60')],{'showHidden':![],'depth':null}));}break;case _0xbddb('0x88'):if(!_0x1ed702[_0xbddb('0x60')]['error_code']&&_0x3b802b>=0xc8&&_0x3b802b<=0xce){return _0x5bef63['update']({'read':!![]});}else{logger['error'](_0xbddb('0xb2'),_0xbddb('0x2d'),'clicksend',util[_0xbddb('0xcc')](_0x1ed702[_0xbddb('0x60')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x1cfbc4=_0x1ed702[_0xbddb('0x60')][_0xbddb('0x8e')][0x0];if(_0x1cfbc4[_0xbddb('0x2d')][_0xbddb('0xd2')]===_0xbddb('0xd3')){return _0x5bef63[_0xbddb('0x37')]({'read':!![]});}else{logger[_0xbddb('0x28')](_0xbddb('0xb2'),_0xbddb('0x2d'),_0xbddb('0x8d'),util['inspect'](_0x1ed702[_0xbddb('0x60')],{'showHidden':![],'depth':null}));}break;case _0xbddb('0x92'):if(_0x3b802b==_0xbddb('0xd5')||_0x3b802b==_0xbddb('0xd6')){return _0x5bef63[_0xbddb('0x37')]({'read':!![]});}else{logger['error'](_0xbddb('0xb2'),_0xbddb('0x2d'),_0xbddb('0x92'),util[_0xbddb('0xcc')](_0x1ed702['body'],{'showHidden':![],'depth':null}));}break;case _0xbddb('0x95'):if(_0x3b802b==_0xbddb('0xd7')){return _0x5bef63['update']({'read':!![]});}else{logger[_0xbddb('0x28')](_0xbddb('0xb2'),_0xbddb('0x2d'),'bandwidth',util[_0xbddb('0xcc')](_0x1ed702[_0xbddb('0x60')],{'showHidden':![],'depth':null}));}break;case _0xbddb('0x96'):if(_0x3b802b==='DELIVRD'||_0x3b802b===_0xbddb('0xd8')){return _0x5bef63[_0xbddb('0x37')]({'read':!![]});}else{logger['error'](_0xbddb('0xb2'),_0xbddb('0x2d'),_0xbddb('0x96'),util['inspect'](_0x1ed702[_0xbddb('0x60')],{'showHidden':![],'depth':null}));}break;}return _0x5bef63;}})[_0xbddb('0x23')](respondWithResult(_0x242ddb,null))['catch'](handleError(_0x242ddb,null));};exports['statusGet']=function(_0x91083,_0x3b56c2,_0x546902){var _0x4b0352,_0x3d9a6d,_0x101f9b;return db[_0xbddb('0x42')]['find']({'where':{'id':_0x91083[_0xbddb('0x5c')]['id']}})['then'](handleEntityNotFound(_0x3b56c2,null))[_0xbddb('0x23')](function(_0x48ea71){if(_0x48ea71){_0x101f9b=_0x48ea71;logger['debug'](_0xbddb('0xb2'),_0xbddb('0x2d'),_0xbddb('0xd9'),_0x48ea71[_0xbddb('0x45')],util[_0xbddb('0xcc')](_0x91083[_0xbddb('0x48')],{'showHidden':![],'depth':null}));switch(_0x48ea71[_0xbddb('0x45')]){case _0xbddb('0x8f'):if(_0x91083[_0xbddb('0x48')][_0xbddb('0xda')]&&_0x91083[_0xbddb('0x48')]['state']){_0x3d9a6d=_0x91083[_0xbddb('0x48')][_0xbddb('0xdb')];return db['SmsMessage'][_0xbddb('0x5e')]({'where':{'messageId':_0x91083[_0xbddb('0x48')][_0xbddb('0xda')]}});}break;}}})[_0xbddb('0x23')](handleEntityNotFound(_0x3b56c2,null))[_0xbddb('0x23')](function(_0x2580b2){if(_0x2580b2){_0x4b0352=_0x2580b2;switch(_0x101f9b[_0xbddb('0x45')]){case'csc':if(_0x3d9a6d==='2'||_0x3d9a6d==='6'){return _0x4b0352[_0xbddb('0x37')]({'read':!![]});}else{logger[_0xbddb('0x28')](_0xbddb('0xb2'),_0xbddb('0x2d'),_0xbddb('0x8f'),util[_0xbddb('0xcc')](_0x91083[_0xbddb('0x48')],{'showHidden':![],'depth':null}));};break;}return _0x4b0352;}})[_0xbddb('0x23')](respondWithResult(_0x3b56c2,null))[_0xbddb('0x2b')](handleError(_0x3b56c2,null));};exports[_0xbddb('0xdc')]=function(_0x325019,_0x50424d,_0x24c29c){return db[_0xbddb('0x42')][_0xbddb('0x5e')]({'where':{'id':_0x325019[_0xbddb('0x5c')]['id']}})[_0xbddb('0x23')](handleEntityNotFound(_0x50424d,null))['then'](function(_0x3fa484){if(_0x3fa484){return _0x3fa484[_0xbddb('0xdc')](_0x325019[_0xbddb('0x60')][_0xbddb('0x71')],_[_0xbddb('0xa1')](_0x325019[_0xbddb('0x60')],[_0xbddb('0x71'),'id'])||{})[_0xbddb('0xa3')](function(_0x3b9306){for(var _0x389ead=0x0;_0x389ead<_0x325019['body'][_0xbddb('0x71')][_0xbddb('0x4d')];_0x389ead+=0x1){socket[_0xbddb('0xdd')](_0xbddb('0xde'),{'UserId':Number(_0x325019[_0xbddb('0x60')][_0xbddb('0x71')][_0x389ead]),'SmsAccountId':Number(_0x325019['params']['id'])});}return _0x3b9306;});}})['then'](respondWithResult(_0x50424d,null))[_0xbddb('0x2b')](handleError(_0x50424d,null));};exports[_0xbddb('0xdf')]=function(_0x3b65ff,_0x432e24,_0x57e36c){return db['SmsAccount'][_0xbddb('0x5e')]({'where':{'id':_0x3b65ff[_0xbddb('0x5c')]['id']}})['then'](handleEntityNotFound(_0x432e24,null))[_0xbddb('0x23')](function(_0x2d1164){if(_0x2d1164){return _0x2d1164[_0xbddb('0xdf')](_0x3b65ff[_0xbddb('0x48')][_0xbddb('0x71')])[_0xbddb('0x23')](function(){if(_[_0xbddb('0xe0')](_0x3b65ff['query'][_0xbddb('0x71')])){for(var _0x1d89a1=0x0;_0x1d89a1<_0x3b65ff[_0xbddb('0x48')][_0xbddb('0x71')]['length'];_0x1d89a1+=0x1){socket['emit'](_0xbddb('0xe1'),{'UserId':Number(_0x3b65ff['query'][_0xbddb('0x71')][_0x1d89a1]),'SmsAccountId':Number(_0x3b65ff[_0xbddb('0x5c')]['id'])});}}else{socket['emit'](_0xbddb('0xe1'),{'UserId':Number(_0x3b65ff['query'][_0xbddb('0x71')]),'SmsAccountId':Number(_0x3b65ff[_0xbddb('0x5c')]['id'])});}});}})[_0xbddb('0x23')](respondWithStatusCode(_0x432e24,null))['catch'](handleError(_0x432e24,null));};exports[_0xbddb('0xe2')]=function(_0x360aa6,_0x17bc83,_0x2f4efd){var _0x27382a={};var _0x113d9d={};var _0xe3f5dc;var _0x348b74;return db[_0xbddb('0x42')][_0xbddb('0x6b')]({'where':{'id':_0x360aa6[_0xbddb('0x5c')]['id']}})[_0xbddb('0x23')](handleEntityNotFound(_0x17bc83,null))[_0xbddb('0x23')](function(_0x37101d){if(_0x37101d){_0xe3f5dc=_0x37101d;_0x113d9d[_0xbddb('0x47')]=_[_0xbddb('0x6c')](db['User']['rawAttributes']);_0x113d9d[_0xbddb('0x48')]=_[_0xbddb('0x6c')](_0x360aa6[_0xbddb('0x48')]);_0x113d9d[_0xbddb('0x49')]=_[_0xbddb('0x4a')](_0x113d9d['model'],_0x113d9d[_0xbddb('0x48')]);_0x27382a[_0xbddb('0x4c')]=_['intersection'](_0x113d9d['model'],qs[_0xbddb('0x4b')](_0x360aa6[_0xbddb('0x48')][_0xbddb('0x4b')]));_0x27382a[_0xbddb('0x4c')]=_0x27382a[_0xbddb('0x4c')]['length']?_0x27382a['attributes']:_0x113d9d[_0xbddb('0x47')];_0x27382a[_0xbddb('0x50')]=qs['sort'](_0x360aa6[_0xbddb('0x48')]['sort']);_0x27382a[_0xbddb('0x53')]=qs[_0xbddb('0x49')](_[_0xbddb('0x52')](_0x360aa6[_0xbddb('0x48')],_0x113d9d[_0xbddb('0x49')]));if(_0x360aa6[_0xbddb('0x48')][_0xbddb('0x55')]){_0x27382a[_0xbddb('0x53')]=_[_0xbddb('0x56')](_0x27382a[_0xbddb('0x53')],{'$or':_['map'](_0x27382a[_0xbddb('0x4c')],function(_0x129302){var _0xdb1944={};_0xdb1944[_0x129302]={'$like':'%'+_0x360aa6[_0xbddb('0x48')][_0xbddb('0x55')]+'%'};return _0xdb1944;})});}_0x27382a=_[_0xbddb('0x56')]({},_0x27382a,_0x360aa6[_0xbddb('0x5d')]);return _0xe3f5dc[_0xbddb('0xe2')](_0x27382a);}})[_0xbddb('0x23')](function(_0x459449){if(_0x459449){_0x348b74=_0x459449[_0xbddb('0x4d')];if(!_0x360aa6[_0xbddb('0x48')][_0xbddb('0x4e')](_0xbddb('0x4f'))){_0x27382a[_0xbddb('0x32')]=qs['limit'](_0x360aa6[_0xbddb('0x48')][_0xbddb('0x32')]);_0x27382a[_0xbddb('0x30')]=qs[_0xbddb('0x30')](_0x360aa6[_0xbddb('0x48')]['offset']);}return _0xe3f5dc[_0xbddb('0xe2')](_0x27382a);}})[_0xbddb('0x23')](function(_0x4411fd){if(_0x4411fd){return _0x4411fd?{'count':_0x348b74,'rows':_0x4411fd}:null;}})['then'](respondWithResult(_0x17bc83,null))[_0xbddb('0x2b')](handleError(_0x17bc83,null));}; \ No newline at end of file +var _0x7e58=['isNil','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','list','Contacts','SmsInteraction','spread','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','SmsMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','startRouting','Start','receiveMessage','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','entity\x20found','\x0a','sequelize','transaction','bulkCreate','findAndCountAll','getApplications','getInteractions','Contact','fullname','internal','Tags','color','tag','rows','to\x20is\x20mandatory','List','DESC','out','Messages','dataValues','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','requestid','statusInt','status_code','DELIVERED','groupName','clickatell','redif','update','error_code','DELIVERED_TO_GATEWAY','message-delivered','DELIVRD','ACCEPTD','statusGet','message-id','state','addAgents','omit','emit','removeAgents','isArray','userSmsAccount:remove','getAgents','zip-dir','fast-json-patch','bluebird','mustache','path','sox','ejs','fs-extra','lodash','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','./smsAccount.socket','register','jayson/promise','client','http','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','save','destroy','get','SmsAccounts','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','SmsAccount','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','show','params','find','create','body','role','user','UserProfileSection','autoAssociation','SmsAccountId','Disposition','getDispositions','findOne','removeDispositions','addAnswer','getAnswers','includeAll','CannedAnswer','removeAnswers','ids','notify','sms','SmsApplication','Applications','applications','orderBy','priority','asc','account','CmContact','describe','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','twilio','from','From','Body','messageId','MessageSid','skebby','sender','text','connectel','clicksend','message_id','Text','MessageUUID','infobip','results','csc','segmentedMessage','fromNumber','replyMessageId','bandwidth','intelepeer'];(function(_0x27ea19,_0x49a3b0){var _0x589a74=function(_0xf93322){while(--_0xf93322){_0x27ea19['push'](_0x27ea19['shift']());}};_0x589a74(++_0x49a3b0);}(_0x7e58,0x12d));var _0x87e5=function(_0x6baa84,_0x48ccd6){_0x6baa84=_0x6baa84-0x0;var _0x49c292=_0x7e58[_0x6baa84];return _0x49c292;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x87e5('0x0'));var jsonpatch=require(_0x87e5('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x87e5('0x2'));var Mustache=require(_0x87e5('0x3'));var util=require('util');var path=require(_0x87e5('0x4'));var sox=require(_0x87e5('0x5'));var csv=require('to-csv');var ejs=require(_0x87e5('0x6'));var fs=require('fs');var fs_extra=require(_0x87e5('0x7'));var _=require(_0x87e5('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x87e5('0x9'));var toCsv=require(_0x87e5('0xa'));var querystring=require(_0x87e5('0xb'));var Papa=require(_0x87e5('0xc'));var Redis=require(_0x87e5('0xd'));var authService=require(_0x87e5('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x87e5('0xf'));var logger=require(_0x87e5('0x10'))(_0x87e5('0x11'));var utils=require('../../config/utils');var config=require(_0x87e5('0x12'));var licenseUtil=require(_0x87e5('0x13'));var db=require(_0x87e5('0x14'))['db'];config['redis']=_[_0x87e5('0x15')](config[_0x87e5('0x16')],{'host':_0x87e5('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x87e5('0x16')]));require(_0x87e5('0x18'))[_0x87e5('0x19')](socket);var jayson=require(_0x87e5('0x1a'));var client=jayson[_0x87e5('0x1b')][_0x87e5('0x1c')]({'port':0x232c});function respondWithRpcPromise(_0x2029bf,_0x3852ee,_0x4aa239,_0x587881){return new BPromise(function(_0x5e5862,_0x7c3600){var _0x3a5fc6=_0x587881||client;return _0x3a5fc6[_0x87e5('0x1d')](_0x2029bf,_0x4aa239)[_0x87e5('0x1e')](function(_0x48276a){logger[_0x87e5('0x1f')](_0x87e5('0x20'),_0x3852ee,_0x87e5('0x21'));logger[_0x87e5('0x22')](_0x87e5('0x23'),_0x3852ee,_0x87e5('0x21'),JSON[_0x87e5('0x24')](_0x48276a));if(_0x48276a[_0x87e5('0x25')]){if(_0x48276a['error'][_0x87e5('0x26')]===0x1f4){logger['error'](_0x87e5('0x20'),_0x3852ee,_0x48276a[_0x87e5('0x25')]['message']);return _0x7c3600(_0x48276a[_0x87e5('0x25')][_0x87e5('0x27')]);}logger[_0x87e5('0x25')]('SmsAccount,\x20%s,\x20%s',_0x3852ee,_0x48276a[_0x87e5('0x25')][_0x87e5('0x27')]);return _0x5e5862(_0x48276a[_0x87e5('0x25')][_0x87e5('0x27')]);}else{logger[_0x87e5('0x1f')](_0x87e5('0x20'),_0x3852ee,'request\x20sent');_0x5e5862(_0x48276a['result'][_0x87e5('0x27')]);}})[_0x87e5('0x28')](function(_0x1efbfc){logger[_0x87e5('0x25')](_0x87e5('0x20'),_0x3852ee,_0x1efbfc);_0x7c3600(_0x1efbfc);});});}function respondWithStatusCode(_0x3ee846,_0x2d449e){_0x2d449e=_0x2d449e||0xcc;return function(_0x37f173){if(_0x37f173){return _0x3ee846[_0x87e5('0x29')](_0x2d449e);}return _0x3ee846[_0x87e5('0x2a')](_0x2d449e)[_0x87e5('0x2b')]();};}function respondWithResult(_0x1ab97d,_0x32ce81){_0x32ce81=_0x32ce81||0xc8;return function(_0xb26e06){if(_0xb26e06){return _0x1ab97d[_0x87e5('0x2a')](_0x32ce81)[_0x87e5('0x2c')](_0xb26e06);}};}function respondWithFilteredResult(_0x553482,_0x531a6f){return function(_0x58a842){if(_0x58a842){var _0x156264=typeof _0x531a6f[_0x87e5('0x2d')]==='undefined'&&typeof _0x531a6f[_0x87e5('0x2e')]===_0x87e5('0x2f');var _0x7d7d9d=_0x58a842[_0x87e5('0x30')];var _0x21e76f=_0x156264?0x0:_0x531a6f[_0x87e5('0x2d')];var _0x5dda07=_0x156264?_0x58a842['count']:_0x531a6f[_0x87e5('0x2d')]+_0x531a6f[_0x87e5('0x2e')];var _0x48c0e6;if(_0x5dda07>=_0x7d7d9d){_0x5dda07=_0x7d7d9d;_0x48c0e6=0xc8;}else{_0x48c0e6=0xce;}_0x553482[_0x87e5('0x2a')](_0x48c0e6);return _0x553482[_0x87e5('0x31')]('Content-Range',_0x21e76f+'-'+_0x5dda07+'/'+_0x7d7d9d)['json'](_0x58a842);}return null;};}function patchUpdates(_0x58dc1e){return function(_0x76f202){try{jsonpatch[_0x87e5('0x32')](_0x76f202,_0x58dc1e,!![]);}catch(_0xc48c67){return BPromise['reject'](_0xc48c67);}return _0x76f202[_0x87e5('0x33')]();};}function saveUpdates(_0x596d95,_0x33114d){return function(_0x469aa0){if(_0x469aa0){return _0x469aa0['update'](_0x596d95)['then'](function(_0x1133c3){return _0x1133c3;});}return null;};}function removeEntity(_0x1d28f6,_0x493e6f){return function(_0x7598e4){if(_0x7598e4){return _0x7598e4[_0x87e5('0x34')]()[_0x87e5('0x1e')](function(){var _0x1a6eb7=_0x7598e4[_0x87e5('0x35')]({'plain':!![]});var _0x32a476=_0x87e5('0x36');return db[_0x87e5('0x37')][_0x87e5('0x34')]({'where':{'type':_0x32a476,'resourceId':_0x1a6eb7['id']}})[_0x87e5('0x1e')](function(){return _0x7598e4;});})[_0x87e5('0x1e')](function(){_0x1d28f6['status'](0xcc)[_0x87e5('0x2b')]();});}};}function handleEntityNotFound(_0x4d95e7,_0x5cf7d3){return function(_0x5a5e74){if(!_0x5a5e74){_0x4d95e7[_0x87e5('0x29')](0x194);}return _0x5a5e74;};}function handleError(_0x1ca1e4,_0x125e16){_0x125e16=_0x125e16||0x1f4;return function(_0x8fa24e){logger['error'](_0x8fa24e[_0x87e5('0x38')]);if(_0x8fa24e[_0x87e5('0x39')]){delete _0x8fa24e[_0x87e5('0x39')];}_0x1ca1e4[_0x87e5('0x2a')](_0x125e16)[_0x87e5('0x3a')](_0x8fa24e);};}exports[_0x87e5('0x3b')]=function(_0x104321,_0x54e9db){var _0x2faa57={'include':[{'model':db[_0x87e5('0x3c')],'as':_0x87e5('0x3d')}]},_0x2e4fbb={},_0x55aaaf={'count':0x0,'rows':[]};var _0x59f9d8=_['map'](db[_0x87e5('0x3e')][_0x87e5('0x3f')],function(_0x457346){return{'name':_0x457346[_0x87e5('0x40')],'type':_0x457346[_0x87e5('0x41')][_0x87e5('0x42')]};});_0x2e4fbb['model']=_[_0x87e5('0x43')](_0x59f9d8,_0x87e5('0x39'));_0x2e4fbb[_0x87e5('0x44')]=_[_0x87e5('0x45')](_0x104321[_0x87e5('0x44')]);_0x2e4fbb[_0x87e5('0x46')]=_[_0x87e5('0x47')](_0x2e4fbb[_0x87e5('0x48')],_0x2e4fbb[_0x87e5('0x44')]);_0x2faa57[_0x87e5('0x49')]=_[_0x87e5('0x47')](_0x2e4fbb[_0x87e5('0x48')],qs[_0x87e5('0x4a')](_0x104321[_0x87e5('0x44')][_0x87e5('0x4a')]));_0x2faa57[_0x87e5('0x49')]=_0x2faa57[_0x87e5('0x49')][_0x87e5('0x4b')]?_0x2faa57[_0x87e5('0x49')]:_0x2e4fbb[_0x87e5('0x48')];if(!_0x104321[_0x87e5('0x44')][_0x87e5('0x4c')](_0x87e5('0x4d'))){_0x2faa57[_0x87e5('0x2e')]=qs[_0x87e5('0x2e')](_0x104321[_0x87e5('0x44')][_0x87e5('0x2e')]);_0x2faa57['offset']=qs[_0x87e5('0x2d')](_0x104321['query'][_0x87e5('0x2d')]);}_0x2faa57[_0x87e5('0x4e')]=qs['sort'](_0x104321[_0x87e5('0x44')][_0x87e5('0x4f')]);_0x2faa57[_0x87e5('0x50')]=qs[_0x87e5('0x46')](_[_0x87e5('0x51')](_0x104321[_0x87e5('0x44')],_0x2e4fbb['filters']),_0x59f9d8);if(_0x104321[_0x87e5('0x44')][_0x87e5('0x52')]){_0x2faa57[_0x87e5('0x50')]=_[_0x87e5('0x53')](_0x2faa57['where'],{'$or':_[_0x87e5('0x43')](_0x59f9d8,function(_0x3f8b21){if(_0x3f8b21['type']!=='VIRTUAL'){var _0x27e9e9={};_0x27e9e9[_0x3f8b21[_0x87e5('0x39')]]={'$like':'%'+_0x104321[_0x87e5('0x44')][_0x87e5('0x52')]+'%'};return _0x27e9e9;}})});}_0x2faa57=_[_0x87e5('0x53')]({},_0x2faa57,_0x104321[_0x87e5('0x54')]);var _0x13c317={'where':_0x2faa57[_0x87e5('0x50')]};return db[_0x87e5('0x3e')]['count'](_0x13c317)[_0x87e5('0x1e')](function(_0x242e91){_0x55aaaf[_0x87e5('0x30')]=_0x242e91;if(_0x104321[_0x87e5('0x44')]['includeAll']){_0x2faa57[_0x87e5('0x55')]=[{'all':!![]}];}return db[_0x87e5('0x3e')][_0x87e5('0x56')](_0x2faa57);})[_0x87e5('0x1e')](function(_0x17103a){_0x55aaaf['rows']=_0x17103a;return _0x55aaaf;})['then'](respondWithFilteredResult(_0x54e9db,_0x2faa57))[_0x87e5('0x28')](handleError(_0x54e9db,null));};exports[_0x87e5('0x57')]=function(_0x27b767,_0x36ad2c){var _0x27a9de={'raw':![],'where':{'id':_0x27b767[_0x87e5('0x58')]['id']},'include':[{'model':db[_0x87e5('0x3c')],'as':_0x87e5('0x3d')}]},_0x5bec8e={};_0x5bec8e[_0x87e5('0x48')]=_['keys'](db[_0x87e5('0x3e')][_0x87e5('0x3f')]);_0x5bec8e[_0x87e5('0x44')]=_[_0x87e5('0x45')](_0x27b767[_0x87e5('0x44')]);_0x5bec8e[_0x87e5('0x46')]=_[_0x87e5('0x47')](_0x5bec8e['model'],_0x5bec8e['query']);_0x27a9de[_0x87e5('0x49')]=_[_0x87e5('0x47')](_0x5bec8e[_0x87e5('0x48')],qs[_0x87e5('0x4a')](_0x27b767[_0x87e5('0x44')][_0x87e5('0x4a')]));_0x27a9de[_0x87e5('0x49')]=_0x27a9de[_0x87e5('0x49')][_0x87e5('0x4b')]?_0x27a9de['attributes']:_0x5bec8e[_0x87e5('0x48')];if(_0x27b767['query']['includeAll']){_0x27a9de[_0x87e5('0x55')]=[{'all':!![]}];}_0x27a9de=_['merge']({},_0x27a9de,_0x27b767[_0x87e5('0x54')]);return db[_0x87e5('0x3e')][_0x87e5('0x59')](_0x27a9de)['then'](handleEntityNotFound(_0x36ad2c,null))[_0x87e5('0x1e')](respondWithResult(_0x36ad2c,null))[_0x87e5('0x28')](handleError(_0x36ad2c,null));};exports[_0x87e5('0x5a')]=function(_0x901cb7,_0x3d4c49){return db[_0x87e5('0x3e')][_0x87e5('0x5a')](_0x901cb7[_0x87e5('0x5b')],{})[_0x87e5('0x1e')](function(_0x4ca94d){var _0x5ecfb5=_0x901cb7['user'][_0x87e5('0x35')]({'plain':!![]});if(!_0x5ecfb5)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5ecfb5[_0x87e5('0x5c')]===_0x87e5('0x5d')){var _0x415bab=_0x4ca94d['get']({'plain':!![]});var _0x50eca0=_0x87e5('0x36');return db[_0x87e5('0x5e')]['find']({'where':{'name':_0x50eca0,'userProfileId':_0x5ecfb5['userProfileId']},'raw':!![]})['then'](function(_0x1ddce0){if(_0x1ddce0&&_0x1ddce0[_0x87e5('0x5f')]===0x0){return db[_0x87e5('0x37')][_0x87e5('0x5a')]({'name':_0x415bab['name'],'resourceId':_0x415bab['id'],'type':_0x1ddce0[_0x87e5('0x39')],'sectionId':_0x1ddce0['id']},{})[_0x87e5('0x1e')](function(){return _0x4ca94d;});}else{return _0x4ca94d;}})[_0x87e5('0x28')](function(_0x5ee170){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5ee170);throw _0x5ee170;});}return _0x4ca94d;})[_0x87e5('0x1e')](respondWithResult(_0x3d4c49,0xc9))[_0x87e5('0x28')](handleError(_0x3d4c49,null));};exports['update']=function(_0x8f0169,_0xcf62a8){if(_0x8f0169[_0x87e5('0x5b')]['id']){delete _0x8f0169[_0x87e5('0x5b')]['id'];}return db[_0x87e5('0x3e')][_0x87e5('0x59')]({'where':{'id':_0x8f0169[_0x87e5('0x58')]['id']},'include':[{'model':db[_0x87e5('0x3c')],'as':_0x87e5('0x3d')}]})[_0x87e5('0x1e')](handleEntityNotFound(_0xcf62a8,null))[_0x87e5('0x1e')](saveUpdates(_0x8f0169['body'],null))[_0x87e5('0x1e')](respondWithResult(_0xcf62a8,null))['catch'](handleError(_0xcf62a8,null));};exports['destroy']=function(_0x63cad0,_0x30692d){return db[_0x87e5('0x3e')][_0x87e5('0x59')]({'where':{'id':_0x63cad0[_0x87e5('0x58')]['id']}})[_0x87e5('0x1e')](handleEntityNotFound(_0x30692d,null))['then'](removeEntity(_0x30692d,null))[_0x87e5('0x28')](handleError(_0x30692d,null));};exports['describe']=function(_0x369b86,_0x153c8c){return db['SmsAccount']['describe']()['then'](respondWithResult(_0x153c8c,null))['catch'](handleError(_0x153c8c,null));};exports['addDisposition']=function(_0x125128,_0x4a406a,_0x1eca66){if(_0x125128[_0x87e5('0x5b')]['id']){delete _0x125128['body']['id'];}return db[_0x87e5('0x3e')][_0x87e5('0x59')]({'where':{'id':_0x125128[_0x87e5('0x58')]['id']}})[_0x87e5('0x1e')](handleEntityNotFound(_0x4a406a,null))[_0x87e5('0x1e')](function(_0x3d1604){if(_0x3d1604){_0x125128['body'][_0x87e5('0x60')]=_0x3d1604['id'];return db[_0x87e5('0x61')][_0x87e5('0x5a')](_0x125128[_0x87e5('0x5b')]);}})['then'](respondWithResult(_0x4a406a,null))[_0x87e5('0x28')](handleError(_0x4a406a,null));};exports[_0x87e5('0x62')]=function(_0xa3c652,_0xc325ed,_0x362ab4){var _0x349bfd={'raw':![],'where':{}};var _0x34b7f4={};var _0x1d31c1={'count':0x0,'rows':[]};return db[_0x87e5('0x3e')][_0x87e5('0x63')]({'where':{'id':_0xa3c652[_0x87e5('0x58')]['id']}})[_0x87e5('0x1e')](handleEntityNotFound(_0xc325ed,null))[_0x87e5('0x1e')](function(_0x2a0c6c){if(_0x2a0c6c){_0x34b7f4[_0x87e5('0x48')]=_['keys'](db[_0x87e5('0x61')]['rawAttributes']);_0x34b7f4[_0x87e5('0x44')]=_[_0x87e5('0x45')](_0xa3c652['query']);_0x34b7f4[_0x87e5('0x46')]=_[_0x87e5('0x47')](_0x34b7f4['model'],_0x34b7f4[_0x87e5('0x44')]);_0x349bfd[_0x87e5('0x49')]=_[_0x87e5('0x47')](_0x34b7f4['model'],qs[_0x87e5('0x4a')](_0xa3c652['query']['fields']));_0x349bfd[_0x87e5('0x49')]=_0x349bfd[_0x87e5('0x49')][_0x87e5('0x4b')]?_0x349bfd[_0x87e5('0x49')]:_0x34b7f4[_0x87e5('0x48')];if(!_0xa3c652[_0x87e5('0x44')][_0x87e5('0x4c')](_0x87e5('0x4d'))){_0x349bfd[_0x87e5('0x2e')]=qs[_0x87e5('0x2e')](_0xa3c652['query'][_0x87e5('0x2e')]);_0x349bfd['offset']=qs[_0x87e5('0x2d')](_0xa3c652['query']['offset']);}_0x349bfd[_0x87e5('0x4e')]=qs['sort'](_0xa3c652[_0x87e5('0x44')]['sort']);_0x349bfd['where']=qs[_0x87e5('0x46')](_[_0x87e5('0x51')](_0xa3c652[_0x87e5('0x44')],_0x34b7f4[_0x87e5('0x46')]));_0x349bfd[_0x87e5('0x50')]['SmsAccountId']=_0x2a0c6c['id'];if(_0xa3c652[_0x87e5('0x44')][_0x87e5('0x52')]){_0x349bfd[_0x87e5('0x50')]=_[_0x87e5('0x53')](_0x349bfd['where'],{'$or':_[_0x87e5('0x43')](_0x349bfd[_0x87e5('0x49')],function(_0xee8d05){var _0x11dc71={};_0x11dc71[_0xee8d05]={'$like':'%'+_0xa3c652['query'][_0x87e5('0x52')]+'%'};return _0x11dc71;})});}_0x349bfd=_['merge']({},_0x349bfd,_0xa3c652[_0x87e5('0x54')]);return db[_0x87e5('0x61')][_0x87e5('0x30')]({'where':_0x349bfd[_0x87e5('0x50')]})[_0x87e5('0x1e')](function(_0x3ff725){_0x1d31c1[_0x87e5('0x30')]=_0x3ff725;if(_0xa3c652[_0x87e5('0x44')]['includeAll']){_0x349bfd['include']=[{'all':!![]}];}return db['Disposition'][_0x87e5('0x56')](_0x349bfd);})['then'](function(_0x5ebee5){_0x1d31c1['rows']=_0x5ebee5;return _0x1d31c1;});}})['then'](respondWithFilteredResult(_0xc325ed,_0x349bfd))[_0x87e5('0x28')](handleError(_0xc325ed,null));};exports[_0x87e5('0x64')]=function(_0x15e00c,_0x2fddff,_0x478ee6){return db['SmsAccount'][_0x87e5('0x59')]({'where':{'id':_0x15e00c[_0x87e5('0x58')]['id']}})[_0x87e5('0x1e')](handleEntityNotFound(_0x2fddff,null))[_0x87e5('0x1e')](function(_0x4575e6){if(_0x4575e6){return _0x4575e6[_0x87e5('0x64')](_0x15e00c[_0x87e5('0x44')]['ids']);}})['then'](respondWithStatusCode(_0x2fddff,null))[_0x87e5('0x28')](handleError(_0x2fddff,null));};exports[_0x87e5('0x65')]=function(_0x3b5829,_0x3d757b,_0x1db51c){if(_0x3b5829[_0x87e5('0x5b')]['id']){delete _0x3b5829[_0x87e5('0x5b')]['id'];}return db[_0x87e5('0x3e')][_0x87e5('0x59')]({'where':{'id':_0x3b5829['params']['id']}})[_0x87e5('0x1e')](handleEntityNotFound(_0x3d757b,null))['then'](function(_0x2fd821){if(_0x2fd821){_0x3b5829['body']['SmsAccountId']=_0x2fd821['id'];return db['CannedAnswer'][_0x87e5('0x5a')](_0x3b5829[_0x87e5('0x5b')]);}})[_0x87e5('0x1e')](respondWithResult(_0x3d757b,null))['catch'](handleError(_0x3d757b,null));};exports[_0x87e5('0x66')]=function(_0x1938d7,_0x3817d5,_0x187bc9){var _0x39cbdf={'raw':![],'where':{}};var _0x1466c7={};var _0x34b9b4={'count':0x0,'rows':[]};return db[_0x87e5('0x3e')][_0x87e5('0x63')]({'where':{'id':_0x1938d7['params']['id']}})[_0x87e5('0x1e')](handleEntityNotFound(_0x3817d5,null))[_0x87e5('0x1e')](function(_0x195ee0){if(_0x195ee0){_0x1466c7['model']=_[_0x87e5('0x45')](db['CannedAnswer'][_0x87e5('0x3f')]);_0x1466c7[_0x87e5('0x44')]=_[_0x87e5('0x45')](_0x1938d7[_0x87e5('0x44')]);_0x1466c7[_0x87e5('0x46')]=_[_0x87e5('0x47')](_0x1466c7[_0x87e5('0x48')],_0x1466c7[_0x87e5('0x44')]);_0x39cbdf[_0x87e5('0x49')]=_[_0x87e5('0x47')](_0x1466c7[_0x87e5('0x48')],qs[_0x87e5('0x4a')](_0x1938d7['query']['fields']));_0x39cbdf['attributes']=_0x39cbdf[_0x87e5('0x49')][_0x87e5('0x4b')]?_0x39cbdf['attributes']:_0x1466c7[_0x87e5('0x48')];if(!_0x1938d7[_0x87e5('0x44')][_0x87e5('0x4c')](_0x87e5('0x4d'))){_0x39cbdf[_0x87e5('0x2e')]=qs[_0x87e5('0x2e')](_0x1938d7['query'][_0x87e5('0x2e')]);_0x39cbdf[_0x87e5('0x2d')]=qs[_0x87e5('0x2d')](_0x1938d7['query'][_0x87e5('0x2d')]);}_0x39cbdf[_0x87e5('0x4e')]=qs['sort'](_0x1938d7[_0x87e5('0x44')][_0x87e5('0x4f')]);_0x39cbdf[_0x87e5('0x50')]=qs['filters'](_[_0x87e5('0x51')](_0x1938d7[_0x87e5('0x44')],_0x1466c7[_0x87e5('0x46')]));_0x39cbdf[_0x87e5('0x50')][_0x87e5('0x60')]=_0x195ee0['id'];if(_0x1938d7['query'][_0x87e5('0x52')]){_0x39cbdf[_0x87e5('0x50')]=_['merge'](_0x39cbdf[_0x87e5('0x50')],{'$or':_[_0x87e5('0x43')](_0x39cbdf[_0x87e5('0x49')],function(_0x6ba753){var _0x5e88c0={};_0x5e88c0[_0x6ba753]={'$like':'%'+_0x1938d7['query']['filter']+'%'};return _0x5e88c0;})});}_0x39cbdf=_[_0x87e5('0x53')]({},_0x39cbdf,_0x1938d7[_0x87e5('0x54')]);return db['CannedAnswer'][_0x87e5('0x30')]({'where':_0x39cbdf[_0x87e5('0x50')]})[_0x87e5('0x1e')](function(_0x300853){_0x34b9b4[_0x87e5('0x30')]=_0x300853;if(_0x1938d7[_0x87e5('0x44')][_0x87e5('0x67')]){_0x39cbdf[_0x87e5('0x55')]=[{'all':!![]}];}return db[_0x87e5('0x68')][_0x87e5('0x56')](_0x39cbdf);})[_0x87e5('0x1e')](function(_0x2dddbe){_0x34b9b4['rows']=_0x2dddbe;return _0x34b9b4;});}})[_0x87e5('0x1e')](respondWithFilteredResult(_0x3817d5,_0x39cbdf))['catch'](handleError(_0x3817d5,null));};exports['removeAnswers']=function(_0x4b88f5,_0x410f04,_0x2e7280){return db[_0x87e5('0x3e')][_0x87e5('0x59')]({'where':{'id':_0x4b88f5[_0x87e5('0x58')]['id']}})[_0x87e5('0x1e')](handleEntityNotFound(_0x410f04,null))[_0x87e5('0x1e')](function(_0x44eb24){if(_0x44eb24){return _0x44eb24[_0x87e5('0x69')](_0x4b88f5['query'][_0x87e5('0x6a')]);}})[_0x87e5('0x1e')](respondWithStatusCode(_0x410f04,null))['catch'](handleError(_0x410f04,null));};exports[_0x87e5('0x6b')]=function(_0x5660ca,_0xac696b,_0x27c7b7){var _0x2f665c={'channel':_0x87e5('0x6c')};var _0x249013=[];var _0x12dd55=[];var _0x14abf6={};return db[_0x87e5('0x3e')][_0x87e5('0x59')]({'where':{'id':_0x5660ca[_0x87e5('0x58')]['id']},'include':[{'model':db[_0x87e5('0x6d')],'as':_0x87e5('0x6e')}]})[_0x87e5('0x1e')](handleEntityNotFound(_0xac696b,null))[_0x87e5('0x1e')](function(_0x11142d){_0x2f665c['account']=_0x11142d;_0x2f665c[_0x87e5('0x6f')]=_[_0x87e5('0x70')](_0x11142d[_0x87e5('0x6e')],[_0x87e5('0x71')],[_0x87e5('0x72')]);if(_0x2f665c['account'][_0x87e5('0x6e')]){delete _0x2f665c[_0x87e5('0x73')][_0x87e5('0x6e')];}return db[_0x87e5('0x74')][_0x87e5('0x75')]();})[_0x87e5('0x1e')](function(_0x14a82b){if(!_0x14a82b){throw new db['Sequelize'][(_0x87e5('0x76'))](_0x87e5('0x77'));}_0x249013=_[_0x87e5('0x78')](_[_0x87e5('0x45')](_0x14a82b),[_0x87e5('0x79'),_0x87e5('0x7a')]);_0x12dd55=_[_0x87e5('0x78')](_[_0x87e5('0x45')](_0x14a82b),[_0x87e5('0x79'),_0x87e5('0x7a'),_0x87e5('0x7b'),_0x87e5('0x7c')]);_0x2f665c['body']={'mapKey':'mobile'};if(_0x2f665c['account'][_0x87e5('0x41')]){switch(_0x2f665c[_0x87e5('0x73')]['type']){case _0x87e5('0x7d'):_0x2f665c[_0x87e5('0x5b')][_0x87e5('0x7e')]=_0x5660ca[_0x87e5('0x5b')][_0x87e5('0x7f')];_0x2f665c[_0x87e5('0x5b')][_0x87e5('0x5b')]=_0x5660ca['body'][_0x87e5('0x80')];_0x2f665c[_0x87e5('0x5b')][_0x87e5('0x81')]=_0x5660ca['body'][_0x87e5('0x82')];break;case _0x87e5('0x83'):_0x2f665c[_0x87e5('0x5b')][_0x87e5('0x7e')]='+'+_0x5660ca['body'][_0x87e5('0x84')];_0x2f665c[_0x87e5('0x5b')][_0x87e5('0x5b')]=_0x5660ca[_0x87e5('0x5b')][_0x87e5('0x85')];break;case _0x87e5('0x86'):_0x2f665c['body'][_0x87e5('0x7e')]=_0x5660ca[_0x87e5('0x5b')][_0x87e5('0x7e')];_0x2f665c['body']['body']=_0x5660ca['body']['message'];break;case _0x87e5('0x87'):_0x2f665c['body'][_0x87e5('0x7e')]=_0x5660ca['body'][_0x87e5('0x7e')];_0x2f665c[_0x87e5('0x5b')][_0x87e5('0x5b')]=_0x5660ca['body'][_0x87e5('0x5b')];_0x2f665c[_0x87e5('0x5b')][_0x87e5('0x81')]=_0x5660ca[_0x87e5('0x5b')][_0x87e5('0x88')];break;case'plivo':_0x2f665c[_0x87e5('0x5b')]['from']=_0x5660ca['body'][_0x87e5('0x7f')];_0x2f665c['body'][_0x87e5('0x5b')]=_0x5660ca[_0x87e5('0x5b')][_0x87e5('0x89')];_0x2f665c[_0x87e5('0x5b')][_0x87e5('0x81')]=_0x5660ca[_0x87e5('0x5b')][_0x87e5('0x8a')];break;case _0x87e5('0x8b'):_0x2f665c[_0x87e5('0x5b')][_0x87e5('0x7e')]='+'+_0x5660ca['body'][_0x87e5('0x8c')][0x0]['from'];_0x2f665c[_0x87e5('0x5b')]['body']=_0x5660ca[_0x87e5('0x5b')][_0x87e5('0x8c')][0x0][_0x87e5('0x85')];_0x2f665c[_0x87e5('0x5b')][_0x87e5('0x81')]=_0x5660ca['body']['results'][0x0][_0x87e5('0x81')];break;case _0x87e5('0x8d'):_0x2f665c[_0x87e5('0x5b')]['from']=_0x5660ca[_0x87e5('0x5b')]['originatingAddress'];_0x2f665c['body']['body']=_0x5660ca[_0x87e5('0x5b')][_0x87e5('0x8e')][_0x87e5('0x27')];break;case'clickatell':_0x2f665c[_0x87e5('0x5b')]['from']=_0x5660ca[_0x87e5('0x5b')][_0x87e5('0x8f')];_0x2f665c[_0x87e5('0x5b')][_0x87e5('0x5b')]=_0x5660ca[_0x87e5('0x5b')][_0x87e5('0x85')];_0x2f665c['body'][_0x87e5('0x81')]=_0x5660ca[_0x87e5('0x5b')][_0x87e5('0x90')];break;case _0x87e5('0x91'):_0x2f665c[_0x87e5('0x5b')][_0x87e5('0x81')]=_0x5660ca[_0x87e5('0x5b')][0x0]['message']['id'];_0x2f665c[_0x87e5('0x5b')][_0x87e5('0x7e')]=_0x5660ca[_0x87e5('0x5b')][0x0][_0x87e5('0x27')][_0x87e5('0x7e')];_0x2f665c[_0x87e5('0x5b')]['body']=_0x5660ca[_0x87e5('0x5b')][0x0]['message'][_0x87e5('0x85')];break;case _0x87e5('0x92'):_0x2f665c[_0x87e5('0x5b')][_0x87e5('0x7e')]=_0x5660ca['body'][_0x87e5('0x7e')];_0x2f665c[_0x87e5('0x5b')][_0x87e5('0x5b')]=_0x5660ca[_0x87e5('0x5b')][_0x87e5('0x27')];_0x2f665c[_0x87e5('0x5b')][_0x87e5('0x81')]=_0x5660ca[_0x87e5('0x5b')]['refid'];break;}}if(_0x2f665c['body']['id']){delete _0x2f665c[_0x87e5('0x5b')]['id'];}if(_[_0x87e5('0x93')](_0x2f665c[_0x87e5('0x5b')][_0x87e5('0x7e')])){throw new db[(_0x87e5('0x94'))]['ValidationError'](_0x87e5('0x95'));}if(_[_0x87e5('0x93')](_0x2f665c[_0x87e5('0x5b')][_0x87e5('0x5b')])||_0x2f665c[_0x87e5('0x5b')][_0x87e5('0x5b')]===''){throw new db[(_0x87e5('0x94'))]['ValidationError'](_0x87e5('0x96'));}if(_['isNil'](_0x2f665c[_0x87e5('0x5b')][_0x87e5('0x97')])){throw new db[(_0x87e5('0x94'))][(_0x87e5('0x76'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x12dd55);}if(!_[_0x87e5('0x98')](_0x12dd55,_0x2f665c['body'][_0x87e5('0x97')])){throw new db[(_0x87e5('0x94'))]['ValidationError'](_0x87e5('0x99')+_0x12dd55);}_0x14abf6[_0x2f665c[_0x87e5('0x5b')]['mapKey']]=_0x2f665c['body'][_0x87e5('0x7e')];return db[_0x87e5('0x9a')][_0x87e5('0x59')]({'where':{'id':_0x2f665c[_0x87e5('0x73')][_0x87e5('0x7c')]},'include':[{'model':db[_0x87e5('0x74')],'as':'Contacts','where':_0x14abf6,'limit':0x1,'order':[[_0x87e5('0x7a'),'DESC']]}]});})[_0x87e5('0x1e')](handleEntityNotFound(_0xac696b,null))['then'](function(_0x11851f){if(_0x11851f){_0x2f665c[_0x87e5('0x9b')]=_['omit'](_0x11851f,['Contacts']);if(_0x11851f[_0x87e5('0x9c')][_0x87e5('0x4b')]){return _0x11851f['Contacts'][0x0];}var _0x504ad9=_[_0x87e5('0x15')](_0x2f665c[_0x87e5('0x5b')],{'firstName':_0x2f665c[_0x87e5('0x5b')][_0x87e5('0x7e')],'ListId':_0x11851f['id']});_0x504ad9[_0x2f665c[_0x87e5('0x5b')][_0x87e5('0x97')]]=_0x2f665c[_0x87e5('0x5b')]['from'];return db[_0x87e5('0x74')][_0x87e5('0x5a')](_0x504ad9,{'fields':_0x249013,'raw':!![]});}})['then'](handleEntityNotFound(_0xac696b,null))[_0x87e5('0x1e')](function(_0x23e571){if(_0x23e571){_0x2f665c['contact']=_0x23e571;var _0x5eed0e={'ContactId':_0x23e571['id'],'phone':_0x2f665c[_0x87e5('0x5b')][_0x87e5('0x7e')],'SmsAccountId':_0x5660ca[_0x87e5('0x58')]['id']};var _0x49bd6a={'ContactId':_0x23e571['id'],'SmsAccountId':_0x5660ca[_0x87e5('0x58')]['id'],'closed':![]};return db[_0x87e5('0x9d')][_0x87e5('0x59')]({'where':_0x49bd6a})[_0x87e5('0x1e')](function(_0x28d15f){if(_0x28d15f){return[_0x28d15f,![]];}return db[_0x87e5('0x9d')][_0x87e5('0x5a')](_0x5eed0e)[_0x87e5('0x1e')](function(_0x59a30c){return[_0x59a30c,!![]];});});}})[_0x87e5('0x9e')](function(_0x1243c4,_0x2adffb){_0x2f665c[_0x87e5('0x9f')]=_0x1243c4[_0x87e5('0x35')]({'plain':!![]});_0x2f665c['interaction'][_0x87e5('0xa0')]=![];if(_0x2adffb){if(_0x2f665c[_0x87e5('0x73')][_0x87e5('0xa1')]){_0x2f665c['applications'][_0x87e5('0xa2')]({'id':0x0,'priority':_0x2f665c[_0x87e5('0x6f')][_0x87e5('0x4b')]+0x1,'app':_0x87e5('0xa3'),'appdata':_0x87e5('0xa4'),'interval':_0x87e5('0xa5')});}_0x2f665c['interaction'][_0x87e5('0xa0')]=!![];}return db[_0x87e5('0xa6')]['create']({'phone':_0x2f665c[_0x87e5('0x5b')][_0x87e5('0x7e')],'messageId':_0x2f665c[_0x87e5('0x5b')][_0x87e5('0x81')],'body':_0x2f665c['body'][_0x87e5('0x5b')],'SmsAccountId':_0x5660ca[_0x87e5('0x58')]['id'],'SmsInteractionId':_0x1243c4['id'],'direction':'in','ContactId':_0x1243c4['ContactId'],'AttachmentId':_0x2f665c[_0x87e5('0x5b')][_0x87e5('0xa7')]});})[_0x87e5('0x1e')](function(_0x494530){_0x2f665c[_0x87e5('0x27')]=_0x494530;if(_0x2f665c[_0x87e5('0x9f')][_0x87e5('0xa8')]){return db[_0x87e5('0xa9')][_0x87e5('0x59')]({'attributes':['id',_0x87e5('0x39')],'where':{'id':_0x2f665c['interaction'][_0x87e5('0xa8')]}})['then'](function(_0x5d8468){if(_0x5d8468){_0x2f665c[_0x87e5('0x6f')][_0x87e5('0xaa')]({'id':0x0,'priority':0x0,'app':_0x87e5('0xab'),'appdata':_0x5d8468['name']+','+(_0x2f665c[_0x87e5('0x73')][_0x87e5('0xac')]||0xa),'interval':_0x87e5('0xa5')});}return respondWithRpcPromise('Start',_0x87e5('0xad'),_0x2f665c);});}return respondWithRpcPromise(_0x87e5('0xae'),_0x87e5('0xad'),_0x2f665c);})[_0x87e5('0x1e')](function(_0x50118a){if(_0x50118a){var _0x4daf11=0xc8;var _0x1242e9=_0x87e5('0xaf');logger[_0x87e5('0x1f')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x1242e9,_0x4daf11,'entity\x20found');logger[_0x87e5('0x22')](_0x87e5('0xb0'),_0x1242e9,_0x4daf11,_0x87e5('0xb1'),JSON[_0x87e5('0x24')](_0x50118a));if(_0x2f665c[_0x87e5('0x73')]['type']===_0x87e5('0x7d')){return _0xac696b['status'](_0x4daf11)[_0x87e5('0x31')]('Content-Type','text/xml')['send'](_0x87e5('0xb2'));}else{return _0xac696b['status'](_0x4daf11)[_0x87e5('0x2c')](_0x50118a);}}})['catch'](handleError(_0xac696b,null));};exports['addApplications']=function(_0xda63fd,_0x42e02c,_0x4cdb0b){return db[_0x87e5('0x3e')][_0x87e5('0x63')]({'where':{'id':_0xda63fd['params']['id']}})['then'](handleEntityNotFound(_0x42e02c,null))[_0x87e5('0x1e')](function(_0x1aa9f4){if(_0x1aa9f4){return db[_0x87e5('0xb3')][_0x87e5('0xb4')](function(_0x5013c4){return db[_0x87e5('0x6d')][_0x87e5('0x34')]({'where':{'SmsAccountId':_0xda63fd[_0x87e5('0x58')]['id']},'transaction':_0x5013c4})[_0x87e5('0x1e')](function(_0x285251){var _0x520fc8=_['map'](_0xda63fd[_0x87e5('0x5b')],function(_0x38ef45){_0x38ef45['SmsAccountId']=_0xda63fd['params']['id'];return _0x38ef45;});return db['SmsApplication'][_0x87e5('0xb5')](_0x520fc8,{'transaction':_0x5013c4});});})['then'](function(){return db[_0x87e5('0x6d')][_0x87e5('0xb6')]({'where':{'SmsAccountId':_0xda63fd['params']['id']},'order':_0x87e5('0x71')});});}})[_0x87e5('0x1e')](respondWithResult(_0x42e02c,null))[_0x87e5('0x28')](handleError(_0x42e02c,null));};exports['getApplications']=function(_0x3189a5,_0xf8ae95,_0x445401){var _0x20af2f={};var _0x4279b1={};var _0x35ee0f;var _0x55606c;return db[_0x87e5('0x3e')][_0x87e5('0x63')]({'where':{'id':_0x3189a5[_0x87e5('0x58')]['id']}})['then'](handleEntityNotFound(_0xf8ae95,null))['then'](function(_0x176fc2){if(_0x176fc2){_0x35ee0f=_0x176fc2;_0x4279b1[_0x87e5('0x48')]=_[_0x87e5('0x45')](db['SmsApplication'][_0x87e5('0x3f')]);_0x4279b1[_0x87e5('0x44')]=_['keys'](_0x3189a5[_0x87e5('0x44')]);_0x4279b1[_0x87e5('0x46')]=_['intersection'](_0x4279b1[_0x87e5('0x48')],_0x4279b1[_0x87e5('0x44')]);_0x20af2f['attributes']=_[_0x87e5('0x47')](_0x4279b1['model'],qs[_0x87e5('0x4a')](_0x3189a5[_0x87e5('0x44')][_0x87e5('0x4a')]));_0x20af2f[_0x87e5('0x49')]=_0x20af2f[_0x87e5('0x49')][_0x87e5('0x4b')]?_0x20af2f[_0x87e5('0x49')]:_0x4279b1[_0x87e5('0x48')];_0x20af2f[_0x87e5('0x4e')]=qs[_0x87e5('0x4f')](_0x3189a5[_0x87e5('0x44')][_0x87e5('0x4f')]);_0x20af2f['where']=qs[_0x87e5('0x46')](_['pick'](_0x3189a5[_0x87e5('0x44')],_0x4279b1[_0x87e5('0x46')]));if(_0x3189a5[_0x87e5('0x44')][_0x87e5('0x52')]){_0x20af2f[_0x87e5('0x50')]=_[_0x87e5('0x53')](_0x20af2f['where'],{'$or':_[_0x87e5('0x43')](_0x20af2f['attributes'],function(_0x46e825){var _0x55f620={};_0x55f620[_0x46e825]={'$like':'%'+_0x3189a5['query'][_0x87e5('0x52')]+'%'};return _0x55f620;})});}_0x20af2f=_[_0x87e5('0x53')]({},_0x20af2f,_0x3189a5['options']);return _0x35ee0f[_0x87e5('0xb7')](_0x20af2f);}})['then'](function(_0x2c017b){if(_0x2c017b){_0x55606c=_0x2c017b[_0x87e5('0x4b')];if(!_0x3189a5[_0x87e5('0x44')][_0x87e5('0x4c')](_0x87e5('0x4d'))){_0x20af2f['limit']=qs[_0x87e5('0x2e')](_0x3189a5[_0x87e5('0x44')][_0x87e5('0x2e')]);_0x20af2f[_0x87e5('0x2d')]=qs['offset'](_0x3189a5[_0x87e5('0x44')]['offset']);}return _0x35ee0f[_0x87e5('0xb7')](_0x20af2f);}})['then'](function(_0x10c35d){if(_0x10c35d){return _0x10c35d?{'count':_0x55606c,'rows':_0x10c35d}:null;}})[_0x87e5('0x1e')](respondWithResult(_0xf8ae95,null))[_0x87e5('0x28')](handleError(_0xf8ae95,null));};exports[_0x87e5('0xb8')]=function(_0x235147,_0x5de6ce,_0x76c5cd){var _0x479f88={'raw':![],'where':{}};var _0x1cb3c1={};var _0x496542={'count':0x0,'rows':[]};return db[_0x87e5('0x3e')][_0x87e5('0x63')]({'where':{'id':_0x235147[_0x87e5('0x58')]['id']}})['then'](handleEntityNotFound(_0x5de6ce,null))[_0x87e5('0x1e')](function(_0x4c92ae){if(_0x4c92ae){_0x1cb3c1['model']=_[_0x87e5('0x45')](db['SmsInteraction'][_0x87e5('0x3f')]);_0x1cb3c1[_0x87e5('0x44')]=_[_0x87e5('0x45')](_0x235147[_0x87e5('0x44')]);_0x1cb3c1[_0x87e5('0x46')]=_[_0x87e5('0x47')](_0x1cb3c1[_0x87e5('0x48')],_0x1cb3c1['query']);_0x479f88[_0x87e5('0x49')]=_[_0x87e5('0x47')](_0x1cb3c1[_0x87e5('0x48')],qs[_0x87e5('0x4a')](_0x235147[_0x87e5('0x44')][_0x87e5('0x4a')]));_0x479f88[_0x87e5('0x49')]=_0x479f88[_0x87e5('0x49')][_0x87e5('0x4b')]?_0x479f88[_0x87e5('0x49')]:_0x1cb3c1[_0x87e5('0x48')];if(!_0x235147['query'][_0x87e5('0x4c')]('nolimit')){_0x479f88[_0x87e5('0x2e')]=qs[_0x87e5('0x2e')](_0x235147[_0x87e5('0x44')][_0x87e5('0x2e')]);_0x479f88[_0x87e5('0x2d')]=qs[_0x87e5('0x2d')](_0x235147[_0x87e5('0x44')][_0x87e5('0x2d')]);}_0x479f88[_0x87e5('0x4e')]=qs['sort'](_0x235147[_0x87e5('0x44')][_0x87e5('0x4f')]);_0x479f88[_0x87e5('0x50')]=qs[_0x87e5('0x46')](_[_0x87e5('0x51')](_0x235147[_0x87e5('0x44')],_0x1cb3c1['filters']));_0x479f88[_0x87e5('0x50')][_0x87e5('0x60')]=_0x4c92ae['id'];if(_0x235147[_0x87e5('0x44')]['filter']){_0x479f88['where']=_[_0x87e5('0x53')](_0x479f88['where'],{'$or':_[_0x87e5('0x43')](_0x479f88['attributes'],function(_0x30f2f3){var _0x4c2720={};_0x4c2720[_0x30f2f3]={'$like':'%'+_0x235147['query'][_0x87e5('0x52')]+'%'};return _0x4c2720;})});}_0x479f88=_[_0x87e5('0x53')]({},_0x479f88,_0x235147[_0x87e5('0x54')]);return db[_0x87e5('0x9d')][_0x87e5('0x30')]({'where':_0x479f88['where']})['then'](function(_0x4ab199){_0x496542[_0x87e5('0x30')]=_0x4ab199;if(_0x235147['query'][_0x87e5('0x67')]){_0x479f88[_0x87e5('0x55')]=[{'model':db['CmContact'],'as':_0x87e5('0xb9'),'required':![]},{'model':db[_0x87e5('0xa9')],'as':'Owner','attributes':[_0x87e5('0x39'),_0x87e5('0xba'),_0x87e5('0xbb')],'required':![]},{'model':db['Tag'],'as':_0x87e5('0xbc'),'attributes':['id',_0x87e5('0x39'),_0x87e5('0xbd')],'where':_0x235147[_0x87e5('0x44')][_0x87e5('0xbe')]?{'id':_0x235147['query'][_0x87e5('0xbe')]}:undefined,'required':_0x235147['query'][_0x87e5('0xbe')]?!![]:![]}];}return db[_0x87e5('0x9d')][_0x87e5('0x56')](_0x479f88);})['then'](function(_0x4d331b){_0x496542[_0x87e5('0xbf')]=_0x4d331b;return _0x496542;});}})[_0x87e5('0x1e')](respondWithFilteredResult(_0x5de6ce,_0x479f88))[_0x87e5('0x28')](handleError(_0x5de6ce,null));};exports[_0x87e5('0x3a')]=function(_0x2bbc91,_0x2c567b,_0x10cc90){var _0x3133a7,_0x381745,_0x89b883;if(_[_0x87e5('0x93')](_0x2bbc91['body'][_0x87e5('0x5b')])||_0x2bbc91[_0x87e5('0x5b')][_0x87e5('0x5b')]===''){throw new db[(_0x87e5('0x94'))][(_0x87e5('0x76'))](_0x87e5('0x96'));}if(_[_0x87e5('0x93')](_0x2bbc91['body']['to'])){throw new db[(_0x87e5('0x94'))][(_0x87e5('0x76'))](_0x87e5('0xc0'));}_0x3133a7=_0x2bbc91['body']['to'];return db[_0x87e5('0x3e')][_0x87e5('0x59')]({'where':{'id':_0x2bbc91[_0x87e5('0x58')]['id']},'include':[{'model':db[_0x87e5('0x9a')],'as':_0x87e5('0xc1'),'include':[{'model':db[_0x87e5('0x74')],'as':_0x87e5('0x9c'),'where':{'mobile':_0x3133a7},'limit':0x1,'order':[[_0x87e5('0x7a'),_0x87e5('0xc2')]]}]}]})[_0x87e5('0x1e')](handleEntityNotFound(_0x2c567b,null))[_0x87e5('0x1e')](function(_0x3b427a){if(_0x3b427a&&_0x3b427a[_0x87e5('0xc1')]){_0x381745=_0x3b427a[_0x87e5('0x35')]({'plain':!![]});if(_0x381745[_0x87e5('0xc1')]&&_0x381745[_0x87e5('0xc1')]['Contacts'][_0x87e5('0x4b')]){return _0x381745['List'][_0x87e5('0x9c')][0x0];}return db[_0x87e5('0x74')]['create'](_[_0x87e5('0x15')](_0x2bbc91[_0x87e5('0x5b')],{'firstName':_0x3133a7,'mobile':_0x3133a7,'phone':_0x3133a7,'ListId':_0x381745[_0x87e5('0x7c')]}));}})[_0x87e5('0x1e')](handleEntityNotFound(_0x2c567b,null))[_0x87e5('0x1e')](function(_0x361d8d){if(_0x361d8d){_0x89b883=_0x361d8d;return db[_0x87e5('0x9d')][_0x87e5('0x59')]({'where':{'ContactId':_0x89b883['id'],'closed':![],'SmsAccountId':_0x381745['id']}})[_0x87e5('0x1e')](function(_0x6db049){if(_0x6db049){return[_0x6db049,![]];}return db['SmsInteraction']['create']({'UserId':_0x2bbc91[_0x87e5('0x5d')]['id'],'ContactId':_0x89b883['id'],'SmsAccountId':_0x381745['id'],'phone':_0x3133a7,'firstMsgDirection':_0x87e5('0xc3'),'Messages':[_['merge'](_0x2bbc91[_0x87e5('0x5b')],{'read':![],'body':_0x2bbc91[_0x87e5('0x5b')][_0x87e5('0x5b')],'phone':_0x3133a7,'SmsAccountId':_0x381745['id'],'UserId':_0x2bbc91['user']['id'],'ContactId':_0x89b883['id']})]},{'include':[{'model':db[_0x87e5('0xa6')],'as':_0x87e5('0xc4')}]})[_0x87e5('0x1e')](function(_0x4ff16d){return[_0x4ff16d,!![]];});});}})[_0x87e5('0x9e')](function(_0x49867f,_0x2073e5){if(_0x2073e5){return _0x49867f;}return db[_0x87e5('0xa6')][_0x87e5('0x5a')](_[_0x87e5('0x53')](_0x2bbc91['body'],{'read':![],'body':_0x2bbc91[_0x87e5('0x5b')]['body'],'phone':_0x3133a7,'SmsAccountId':_0x381745['id'],'SmsInteractionId':_0x49867f['id'],'UserId':_0x2bbc91[_0x87e5('0x5d')]['id'],'ContactId':_0x89b883['id']}))[_0x87e5('0x1e')](function(_0x1deceb){_0x49867f[_0x87e5('0xc5')]['Messages']=[];_0x49867f['dataValues'][_0x87e5('0xc4')]['push'](_0x1deceb[_0x87e5('0xc5')]);return _0x49867f;});})[_0x87e5('0x1e')](respondWithResult(_0x2c567b,null))[_0x87e5('0x28')](handleError(_0x2c567b,null));};exports['status']=function(_0x14c064,_0x36a7b6,_0x23f83e){if(_0x14c064[_0x87e5('0x5b')]['id']){delete _0x14c064[_0x87e5('0x5b')]['id'];}var _0x2e74d3,_0xfe8602,_0x286de2;return db[_0x87e5('0x3e')]['find']({'where':{'id':_0x14c064[_0x87e5('0x58')]['id']}})[_0x87e5('0x1e')](handleEntityNotFound(_0x36a7b6,null))[_0x87e5('0x1e')](function(_0x451df6){if(_0x451df6){_0x286de2=_0x451df6;logger[_0x87e5('0x22')](_0x87e5('0x23'),_0x87e5('0x2a'),_0x87e5('0xc6'),_0x451df6['type'],util[_0x87e5('0xc7')](_0x14c064['body'],{'showHidden':![],'depth':null}));switch(_0x451df6['type']){case _0x87e5('0x83'):if(_0x14c064[_0x87e5('0x5b')]['skebby_dispatch_id']&&_0x14c064['body']['status']){_0xfe8602=_0x14c064['body'][_0x87e5('0x2a')];return db['SmsMessage'][_0x87e5('0x59')]({'where':{'messageId':_0x14c064[_0x87e5('0x5b')][_0x87e5('0xc8')]}});}break;case _0x87e5('0x86'):if(_0x14c064[_0x87e5('0x5b')][_0x87e5('0xc9')]&&_0x14c064[_0x87e5('0x5b')][_0x87e5('0xca')]){_0xfe8602=_0x14c064[_0x87e5('0x5b')]['statusInt'];return db[_0x87e5('0xa6')]['find']({'where':{'messageId':_0x14c064[_0x87e5('0x5b')]['requestid']}});}break;case _0x87e5('0x87'):if(_0x14c064['body'][_0x87e5('0x88')]&&_0x14c064[_0x87e5('0x5b')][_0x87e5('0xcb')]){_0xfe8602=_0x14c064[_0x87e5('0x5b')][_0x87e5('0xcb')];return db['SmsMessage'][_0x87e5('0x59')]({'where':{'messageId':_0x14c064[_0x87e5('0x5b')][_0x87e5('0x88')]}});}break;case'infobip':var _0x183fb3=_0x14c064[_0x87e5('0x5b')]['results'][0x0];if(_0x183fb3[_0x87e5('0x81')]&&_0x183fb3[_0x87e5('0x2a')]['groupName']===_0x87e5('0xcc')){_0xfe8602=_0x183fb3[_0x87e5('0x2a')][_0x87e5('0xcd')];return db['SmsMessage'][_0x87e5('0x59')]({'where':{'messageId':_0x183fb3[_0x87e5('0x81')]}});}break;case _0x87e5('0xce'):if(_0x14c064[_0x87e5('0x5b')][_0x87e5('0x81')]&&_0x14c064[_0x87e5('0x5b')][_0x87e5('0x2a')]){_0xfe8602=_0x14c064[_0x87e5('0x5b')][_0x87e5('0x2a')];return db['SmsMessage'][_0x87e5('0x59')]({'where':{'messageId':_0x14c064['body'][_0x87e5('0x81')]}});}break;case _0x87e5('0x91'):if(_0x14c064[_0x87e5('0x5b')][0x0][_0x87e5('0x27')]['id']){_0xfe8602=_0x14c064[_0x87e5('0x5b')][0x0][_0x87e5('0x41')];return db[_0x87e5('0xa6')][_0x87e5('0x59')]({'where':{'messageId':_0x14c064['body'][0x0]['message']['id']}});}break;case'intelepeer':if(_0x14c064['body'][_0x87e5('0xcf')]&&_0x14c064[_0x87e5('0x5b')]['status']){_0xfe8602=_0x14c064[_0x87e5('0x5b')][_0x87e5('0x2a')];return db[_0x87e5('0xa6')]['find']({'where':{'messageId':_0x14c064[_0x87e5('0x5b')][_0x87e5('0xcf')]}});}break;}}})[_0x87e5('0x1e')](handleEntityNotFound(_0x36a7b6,null))['then'](function(_0x9fa00e){if(_0x9fa00e){_0x2e74d3=_0x9fa00e;switch(_0x286de2[_0x87e5('0x41')]){case _0x87e5('0x83'):if(_0xfe8602==='DELIVERED'){return _0x2e74d3[_0x87e5('0xd0')]({'read':!![]});}else{logger['error'](_0x87e5('0x23'),_0x87e5('0x2a'),'skebby',util[_0x87e5('0xc7')](_0x14c064['body'],{'showHidden':![],'depth':null}));}break;case _0x87e5('0x86'):if(_0xfe8602==='1'){return _0x2e74d3[_0x87e5('0xd0')]({'read':!![]});}else{logger[_0x87e5('0x25')](_0x87e5('0x23'),_0x87e5('0x2a'),_0x87e5('0x83'),util[_0x87e5('0xc7')](_0x14c064[_0x87e5('0x5b')],{'showHidden':![],'depth':null}));}break;case _0x87e5('0x87'):if(!_0x14c064['body'][_0x87e5('0xd1')]&&_0xfe8602>=0xc8&&_0xfe8602<=0xce){return _0x2e74d3[_0x87e5('0xd0')]({'read':!![]});}else{logger[_0x87e5('0x25')](_0x87e5('0x23'),'status',_0x87e5('0x87'),util[_0x87e5('0xc7')](_0x14c064[_0x87e5('0x5b')],{'showHidden':![],'depth':null}));}break;case _0x87e5('0x8b'):var _0x5a7a44=_0x14c064['body'][_0x87e5('0x8c')][0x0];if(_0x5a7a44['status']['groupName']===_0x87e5('0xcc')){return _0x2e74d3[_0x87e5('0xd0')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x87e5('0x2a'),_0x87e5('0x8b'),util[_0x87e5('0xc7')](_0x14c064[_0x87e5('0x5b')],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0xfe8602==_0x87e5('0xd2')||_0xfe8602=='RECEIVED_BY_RECIPIENT'){return _0x2e74d3[_0x87e5('0xd0')]({'read':!![]});}else{logger[_0x87e5('0x25')](_0x87e5('0x23'),_0x87e5('0x2a'),_0x87e5('0xce'),util[_0x87e5('0xc7')](_0x14c064['body'],{'showHidden':![],'depth':null}));}break;case _0x87e5('0x91'):if(_0xfe8602==_0x87e5('0xd3')){return _0x2e74d3[_0x87e5('0xd0')]({'read':!![]});}else{logger[_0x87e5('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x87e5('0x91'),util['inspect'](_0x14c064[_0x87e5('0x5b')],{'showHidden':![],'depth':null}));}break;case _0x87e5('0x92'):if(_0xfe8602===_0x87e5('0xd4')||_0xfe8602===_0x87e5('0xd5')){return _0x2e74d3['update']({'read':!![]});}else{logger['error'](_0x87e5('0x23'),_0x87e5('0x2a'),'intelepeer',util[_0x87e5('0xc7')](_0x14c064[_0x87e5('0x5b')],{'showHidden':![],'depth':null}));}break;}return _0x2e74d3;}})['then'](respondWithResult(_0x36a7b6,null))[_0x87e5('0x28')](handleError(_0x36a7b6,null));};exports[_0x87e5('0xd6')]=function(_0x42b186,_0x87760e,_0x3f1d4d){var _0x5cfffc,_0x23dd2b,_0x194024;return db[_0x87e5('0x3e')]['find']({'where':{'id':_0x42b186[_0x87e5('0x58')]['id']}})['then'](handleEntityNotFound(_0x87760e,null))['then'](function(_0x56d9c8){if(_0x56d9c8){_0x194024=_0x56d9c8;logger[_0x87e5('0x22')](_0x87e5('0x23'),_0x87e5('0x2a'),_0x87e5('0xc6'),_0x56d9c8[_0x87e5('0x41')],util['inspect'](_0x42b186[_0x87e5('0x44')],{'showHidden':![],'depth':null}));switch(_0x56d9c8['type']){case _0x87e5('0x8d'):if(_0x42b186[_0x87e5('0x44')][_0x87e5('0xd7')]&&_0x42b186[_0x87e5('0x44')][_0x87e5('0xd8')]){_0x23dd2b=_0x42b186[_0x87e5('0x44')][_0x87e5('0xd8')];return db[_0x87e5('0xa6')][_0x87e5('0x59')]({'where':{'messageId':_0x42b186['query'][_0x87e5('0xd7')]}});}break;}}})[_0x87e5('0x1e')](handleEntityNotFound(_0x87760e,null))[_0x87e5('0x1e')](function(_0x34fc35){if(_0x34fc35){_0x5cfffc=_0x34fc35;switch(_0x194024[_0x87e5('0x41')]){case _0x87e5('0x8d'):if(_0x23dd2b==='2'||_0x23dd2b==='6'){return _0x5cfffc[_0x87e5('0xd0')]({'read':!![]});}else{logger[_0x87e5('0x25')](_0x87e5('0x23'),_0x87e5('0x2a'),'csc',util['inspect'](_0x42b186['query'],{'showHidden':![],'depth':null}));};break;}return _0x5cfffc;}})[_0x87e5('0x1e')](respondWithResult(_0x87760e,null))[_0x87e5('0x28')](handleError(_0x87760e,null));};exports[_0x87e5('0xd9')]=function(_0x297c54,_0x1e7096,_0x52b219){return db[_0x87e5('0x3e')]['find']({'where':{'id':_0x297c54[_0x87e5('0x58')]['id']}})[_0x87e5('0x1e')](handleEntityNotFound(_0x1e7096,null))[_0x87e5('0x1e')](function(_0x4773de){if(_0x4773de){return _0x4773de[_0x87e5('0xd9')](_0x297c54[_0x87e5('0x5b')][_0x87e5('0x6a')],_[_0x87e5('0xda')](_0x297c54[_0x87e5('0x5b')],[_0x87e5('0x6a'),'id'])||{})[_0x87e5('0x9e')](function(_0xb5d408){for(var _0x53b2ad=0x0;_0x53b2ad<_0x297c54[_0x87e5('0x5b')][_0x87e5('0x6a')]['length'];_0x53b2ad+=0x1){socket[_0x87e5('0xdb')]('userSmsAccount:save',{'UserId':Number(_0x297c54['body']['ids'][_0x53b2ad]),'SmsAccountId':Number(_0x297c54['params']['id'])});}return _0xb5d408;});}})[_0x87e5('0x1e')](respondWithResult(_0x1e7096,null))[_0x87e5('0x28')](handleError(_0x1e7096,null));};exports[_0x87e5('0xdc')]=function(_0x39ce1a,_0x248ad8,_0x40956c){return db[_0x87e5('0x3e')][_0x87e5('0x59')]({'where':{'id':_0x39ce1a[_0x87e5('0x58')]['id']}})[_0x87e5('0x1e')](handleEntityNotFound(_0x248ad8,null))[_0x87e5('0x1e')](function(_0x1dc613){if(_0x1dc613){return _0x1dc613[_0x87e5('0xdc')](_0x39ce1a[_0x87e5('0x44')]['ids'])['then'](function(){if(_[_0x87e5('0xdd')](_0x39ce1a[_0x87e5('0x44')][_0x87e5('0x6a')])){for(var _0x860828=0x0;_0x860828<_0x39ce1a['query']['ids'][_0x87e5('0x4b')];_0x860828+=0x1){socket['emit'](_0x87e5('0xde'),{'UserId':Number(_0x39ce1a[_0x87e5('0x44')][_0x87e5('0x6a')][_0x860828]),'SmsAccountId':Number(_0x39ce1a[_0x87e5('0x58')]['id'])});}}else{socket[_0x87e5('0xdb')]('userSmsAccount:remove',{'UserId':Number(_0x39ce1a[_0x87e5('0x44')][_0x87e5('0x6a')]),'SmsAccountId':Number(_0x39ce1a[_0x87e5('0x58')]['id'])});}});}})[_0x87e5('0x1e')](respondWithStatusCode(_0x248ad8,null))['catch'](handleError(_0x248ad8,null));};exports[_0x87e5('0xdf')]=function(_0x4bf8ae,_0x72f43c,_0x545919){var _0x1ced23={};var _0xfdba32={};var _0x4a4364;var _0x885b72;return db[_0x87e5('0x3e')][_0x87e5('0x63')]({'where':{'id':_0x4bf8ae[_0x87e5('0x58')]['id']}})[_0x87e5('0x1e')](handleEntityNotFound(_0x72f43c,null))[_0x87e5('0x1e')](function(_0x1ad5cd){if(_0x1ad5cd){_0x4a4364=_0x1ad5cd;_0xfdba32['model']=_[_0x87e5('0x45')](db[_0x87e5('0xa9')]['rawAttributes']);_0xfdba32[_0x87e5('0x44')]=_['keys'](_0x4bf8ae[_0x87e5('0x44')]);_0xfdba32[_0x87e5('0x46')]=_[_0x87e5('0x47')](_0xfdba32[_0x87e5('0x48')],_0xfdba32[_0x87e5('0x44')]);_0x1ced23['attributes']=_['intersection'](_0xfdba32['model'],qs['fields'](_0x4bf8ae[_0x87e5('0x44')][_0x87e5('0x4a')]));_0x1ced23[_0x87e5('0x49')]=_0x1ced23[_0x87e5('0x49')][_0x87e5('0x4b')]?_0x1ced23[_0x87e5('0x49')]:_0xfdba32['model'];_0x1ced23[_0x87e5('0x4e')]=qs[_0x87e5('0x4f')](_0x4bf8ae[_0x87e5('0x44')][_0x87e5('0x4f')]);_0x1ced23['where']=qs['filters'](_[_0x87e5('0x51')](_0x4bf8ae[_0x87e5('0x44')],_0xfdba32['filters']));if(_0x4bf8ae[_0x87e5('0x44')]['filter']){_0x1ced23[_0x87e5('0x50')]=_['merge'](_0x1ced23[_0x87e5('0x50')],{'$or':_[_0x87e5('0x43')](_0x1ced23[_0x87e5('0x49')],function(_0x12f310){var _0x3ff4d8={};_0x3ff4d8[_0x12f310]={'$like':'%'+_0x4bf8ae[_0x87e5('0x44')][_0x87e5('0x52')]+'%'};return _0x3ff4d8;})});}_0x1ced23=_[_0x87e5('0x53')]({},_0x1ced23,_0x4bf8ae[_0x87e5('0x54')]);return _0x4a4364[_0x87e5('0xdf')](_0x1ced23);}})[_0x87e5('0x1e')](function(_0x4f0d5c){if(_0x4f0d5c){_0x885b72=_0x4f0d5c[_0x87e5('0x4b')];if(!_0x4bf8ae[_0x87e5('0x44')][_0x87e5('0x4c')](_0x87e5('0x4d'))){_0x1ced23[_0x87e5('0x2e')]=qs[_0x87e5('0x2e')](_0x4bf8ae[_0x87e5('0x44')][_0x87e5('0x2e')]);_0x1ced23[_0x87e5('0x2d')]=qs[_0x87e5('0x2d')](_0x4bf8ae[_0x87e5('0x44')][_0x87e5('0x2d')]);}return _0x4a4364[_0x87e5('0xdf')](_0x1ced23);}})['then'](function(_0x303700){if(_0x303700){return _0x303700?{'count':_0x885b72,'rows':_0x303700}:null;}})[_0x87e5('0x1e')](respondWithResult(_0x72f43c,null))[_0x87e5('0x28')](handleError(_0x72f43c,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index 276d992..4dff986 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 _0x5d2f=['remove','emit','hook','exports','events','../../mysqldb','SmsAccount','setMaxListeners','save','update'];(function(_0x2a98c8,_0x812400){var _0x156121=function(_0x335af7){while(--_0x335af7){_0x2a98c8['push'](_0x2a98c8['shift']());}};_0x156121(++_0x812400);}(_0x5d2f,0x7c));var _0xf5d2=function(_0x135a1c,_0x28b5f6){_0x135a1c=_0x135a1c-0x0;var _0x295c98=_0x5d2f[_0x135a1c];return _0x295c98;};'use strict';var EventEmitter=require(_0xf5d2('0x0'));var SmsAccount=require(_0xf5d2('0x1'))['db'][_0xf5d2('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xf5d2('0x3')](0x0);var events={'afterCreate':_0xf5d2('0x4'),'afterUpdate':_0xf5d2('0x5'),'afterDestroy':_0xf5d2('0x6')};function emitEvent(_0x26237c){return function(_0x4a4869,_0x52ac74,_0x590f8c){SmsAccountEvents['emit'](_0x26237c+':'+_0x4a4869['id'],_0x4a4869);SmsAccountEvents[_0xf5d2('0x7')](_0x26237c,_0x4a4869);_0x590f8c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsAccount[_0xf5d2('0x8')](e,emitEvent(event));}}module[_0xf5d2('0x9')]=SmsAccountEvents; \ No newline at end of file +var _0x10f4=['exports','../../mysqldb','setMaxListeners','save','update','emit','hasOwnProperty','hook'];(function(_0x34cad9,_0xe4d7c5){var _0x421786=function(_0xbb897f){while(--_0xbb897f){_0x34cad9['push'](_0x34cad9['shift']());}};_0x421786(++_0xe4d7c5);}(_0x10f4,0xc1));var _0x410f=function(_0x57966a,_0x477964){_0x57966a=_0x57966a-0x0;var _0x191765=_0x10f4[_0x57966a];return _0x191765;};'use strict';var EventEmitter=require('events');var SmsAccount=require(_0x410f('0x0'))['db']['SmsAccount'];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x410f('0x1')](0x0);var events={'afterCreate':_0x410f('0x2'),'afterUpdate':_0x410f('0x3'),'afterDestroy':'remove'};function emitEvent(_0x4fb4bd){return function(_0xa486bf,_0x459cc8,_0x4deeee){SmsAccountEvents[_0x410f('0x4')](_0x4fb4bd+':'+_0xa486bf['id'],_0xa486bf);SmsAccountEvents[_0x410f('0x4')](_0x4fb4bd,_0xa486bf);_0x4deeee(null);};}for(var e in events){if(events[_0x410f('0x5')](e)){var event=events[e];SmsAccount[_0x410f('0x6')](e,emitEvent(event));}}module[_0x410f('0x7')]=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index 4302cf6..805c16f 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 _0xe5d1=['exports','SmsAccount','sms_accounts','lodash','util','../../config/logger','api','moment','bluebird','path','./smsAccount.attributes'];(function(_0x4ef3ff,_0x4fc675){var _0x420e01=function(_0xff3d7f){while(--_0xff3d7f){_0x4ef3ff['push'](_0x4ef3ff['shift']());}};_0x420e01(++_0x4fc675);}(_0xe5d1,0x1e7));var _0x1e5d=function(_0x3df871,_0xda2e11){_0x3df871=_0x3df871-0x0;var _0x570f7b=_0xe5d1[_0x3df871];return _0x570f7b;};'use strict';var _=require(_0x1e5d('0x0'));var util=require(_0x1e5d('0x1'));var logger=require(_0x1e5d('0x2'))(_0x1e5d('0x3'));var moment=require(_0x1e5d('0x4'));var BPromise=require(_0x1e5d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1e5d('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1e5d('0x7'));module[_0x1e5d('0x8')]=function(_0x486fbe,_0x229d30){return _0x486fbe['define'](_0x1e5d('0x9'),attributes,{'tableName':_0x1e5d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0801=['request-promise','path','rimraf','../../config/environment','./smsAccount.attributes','exports','define','SmsAccount','sms_accounts','lodash','util','../../config/logger'];(function(_0x3e82a0,_0x16e564){var _0x4ea8a7=function(_0x1bc288){while(--_0x1bc288){_0x3e82a0['push'](_0x3e82a0['shift']());}};_0x4ea8a7(++_0x16e564);}(_0x0801,0x1a1));var _0x1080=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0x0801[_0x1694f5];return _0x5b4321;};'use strict';var _=require(_0x1080('0x0'));var util=require(_0x1080('0x1'));var logger=require(_0x1080('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1080('0x3'));var fs=require('fs');var path=require(_0x1080('0x4'));var rimraf=require(_0x1080('0x5'));var config=require(_0x1080('0x6'));var attributes=require(_0x1080('0x7'));module[_0x1080('0x8')]=function(_0x285d80,_0x100cf9){return _0x285d80[_0x1080('0x9')](_0x1080('0xa'),attributes,{'tableName':_0x1080('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.rpc.js b/server/api/smsAccount/smsAccount.rpc.js index fbf98de..f741a84 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 _0x8cf8=['request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','ShowSmsAccount','SmsAccount','find','options','where','attributes','include','map','then','lodash','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','defaults','redis','localhost','register','request','SmsAccount,\x20%s,\x20%s'];(function(_0x39008d,_0x5c672d){var _0x4366fc=function(_0x5c6566){while(--_0x5c6566){_0x39008d['push'](_0x39008d['shift']());}};_0x4366fc(++_0x5c672d);}(_0x8cf8,0x172));var _0x88cf=function(_0x344096,_0x13a350){_0x344096=_0x344096-0x0;var _0x371256=_0x8cf8[_0x344096];return _0x371256;};'use strict';var _=require(_0x88cf('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x88cf('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x88cf('0x2'))['db'];var utils=require(_0x88cf('0x3'));var logger=require(_0x88cf('0x4'))(_0x88cf('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x88cf('0x6')][_0x88cf('0x7')]({'port':0x232a});config['redis']=_[_0x88cf('0x8')](config[_0x88cf('0x9')],{'host':_0x88cf('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x88cf('0x9')]));require('./smsAccount.socket')[_0x88cf('0xb')](socket);function respondWithRpcPromise(_0x22db03,_0x5ea587,_0x5d4f6e){return new BPromise(function(_0x2ef215,_0x30eb4e){return client[_0x88cf('0xc')](_0x22db03,_0x5d4f6e)['then'](function(_0x2a7b65){logger['info'](_0x88cf('0xd'),_0x5ea587,_0x88cf('0xe'));logger[_0x88cf('0xf')](_0x88cf('0x10'),_0x5ea587,_0x88cf('0xe'),JSON[_0x88cf('0x11')](_0x2a7b65));if(_0x2a7b65[_0x88cf('0x12')]){if(_0x2a7b65['error'][_0x88cf('0x13')]===0x1f4){logger[_0x88cf('0x12')](_0x88cf('0xd'),_0x5ea587,_0x2a7b65[_0x88cf('0x12')][_0x88cf('0x14')]);return _0x30eb4e(_0x2a7b65[_0x88cf('0x12')][_0x88cf('0x14')]);}logger[_0x88cf('0x12')](_0x88cf('0xd'),_0x5ea587,_0x2a7b65[_0x88cf('0x12')]['message']);return _0x2ef215(_0x2a7b65[_0x88cf('0x12')][_0x88cf('0x14')]);}else{logger[_0x88cf('0x15')](_0x88cf('0xd'),_0x5ea587,'request\x20sent');_0x2ef215(_0x2a7b65['result'][_0x88cf('0x14')]);}})[_0x88cf('0x16')](function(_0x16eaa1){logger[_0x88cf('0x12')](_0x88cf('0xd'),_0x5ea587,_0x16eaa1);_0x30eb4e(_0x16eaa1);});});}exports[_0x88cf('0x17')]=function(_0x13dac6){var _0x2f372e=this;return new Promise(function(_0x3405c4,_0x27192d){return db[_0x88cf('0x18')][_0x88cf('0x19')]({'raw':_0x13dac6[_0x88cf('0x1a')]?_0x13dac6['options']['raw']===undefined?!![]:![]:!![],'where':_0x13dac6[_0x88cf('0x1a')]?_0x13dac6[_0x88cf('0x1a')][_0x88cf('0x1b')]||null:null,'attributes':_0x13dac6[_0x88cf('0x1a')]?_0x13dac6[_0x88cf('0x1a')][_0x88cf('0x1c')]||null:null,'include':_0x13dac6['options']?_0x13dac6[_0x88cf('0x1a')][_0x88cf('0x1d')]?_[_0x88cf('0x1e')](_0x13dac6[_0x88cf('0x1a')]['include'],function(_0x49cdc6){return{'model':db[_0x49cdc6['model']],'as':_0x49cdc6['as'],'attributes':_0x49cdc6[_0x88cf('0x1c')],'include':_0x49cdc6['include']?_[_0x88cf('0x1e')](_0x49cdc6[_0x88cf('0x1d')],function(_0x7f2b1b){return{'model':db[_0x7f2b1b['model']],'as':_0x7f2b1b['as'],'attributes':_0x7f2b1b[_0x88cf('0x1c')],'include':_0x7f2b1b[_0x88cf('0x1d')]?_[_0x88cf('0x1e')](_0x7f2b1b['include'],function(_0x5b0e90){return{'model':db[_0x5b0e90['model']],'as':_0x5b0e90['as'],'attributes':_0x5b0e90[_0x88cf('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x88cf('0x1f')](function(_0x2168ea){logger['info']('ShowSmsAccount',_0x13dac6);logger[_0x88cf('0xf')](_0x88cf('0x17'),_0x13dac6,JSON['stringify'](_0x2168ea));_0x3405c4(_0x2168ea);})[_0x88cf('0x16')](function(_0x3f4d9e){logger['error'](_0x88cf('0x17'),_0x3f4d9e[_0x88cf('0x14')],_0x13dac6);_0x27192d(_0x2f372e[_0x88cf('0x12')](0x1f4,_0x3f4d9e[_0x88cf('0x14')]));});});}; \ No newline at end of file +var _0x12de=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','ShowSmsAccount','SmsAccount','find','options','raw','where','include','map','attributes','model','lodash','util'];(function(_0x3fb035,_0x34bfb8){var _0xfc03ed=function(_0x599a4b){while(--_0x599a4b){_0x3fb035['push'](_0x3fb035['shift']());}};_0xfc03ed(++_0x34bfb8);}(_0x12de,0x6d));var _0xe12d=function(_0x48b1c1,_0x1951bc){_0x48b1c1=_0x48b1c1-0x0;var _0x4f741e=_0x12de[_0x48b1c1];return _0x4f741e;};'use strict';var _=require(_0xe12d('0x0'));var util=require(_0xe12d('0x1'));var moment=require(_0xe12d('0x2'));var BPromise=require(_0xe12d('0x3'));var rs=require(_0xe12d('0x4'));var fs=require('fs');var Redis=require(_0xe12d('0x5'));var db=require(_0xe12d('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xe12d('0x7'))(_0xe12d('0x8'));var config=require('../../config/environment');var jayson=require(_0xe12d('0x9'));var client=jayson[_0xe12d('0xa')]['http']({'port':0x232a});config[_0xe12d('0xb')]=_[_0xe12d('0xc')](config['redis'],{'host':_0xe12d('0xd'),'port':0x18eb});var socket=require(_0xe12d('0xe'))(new Redis(config[_0xe12d('0xb')]));require(_0xe12d('0xf'))['register'](socket);function respondWithRpcPromise(_0x52920a,_0x139c49,_0x260ce7){return new BPromise(function(_0x3af1d5,_0x35be75){return client[_0xe12d('0x10')](_0x52920a,_0x260ce7)[_0xe12d('0x11')](function(_0x272b0f){logger[_0xe12d('0x12')](_0xe12d('0x13'),_0x139c49,_0xe12d('0x14'));logger[_0xe12d('0x15')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x139c49,_0xe12d('0x14'),JSON[_0xe12d('0x16')](_0x272b0f));if(_0x272b0f['error']){if(_0x272b0f[_0xe12d('0x17')]['code']===0x1f4){logger['error'](_0xe12d('0x13'),_0x139c49,_0x272b0f[_0xe12d('0x17')][_0xe12d('0x18')]);return _0x35be75(_0x272b0f[_0xe12d('0x17')][_0xe12d('0x18')]);}logger[_0xe12d('0x17')]('SmsAccount,\x20%s,\x20%s',_0x139c49,_0x272b0f[_0xe12d('0x17')][_0xe12d('0x18')]);return _0x3af1d5(_0x272b0f[_0xe12d('0x17')][_0xe12d('0x18')]);}else{logger[_0xe12d('0x12')](_0xe12d('0x13'),_0x139c49,'request\x20sent');_0x3af1d5(_0x272b0f[_0xe12d('0x19')][_0xe12d('0x18')]);}})[_0xe12d('0x1a')](function(_0x3f7b5){logger[_0xe12d('0x17')](_0xe12d('0x13'),_0x139c49,_0x3f7b5);_0x35be75(_0x3f7b5);});});}exports[_0xe12d('0x1b')]=function(_0x1c215e){var _0x3af8b0=this;return new Promise(function(_0x40cb18,_0x585587){return db[_0xe12d('0x1c')][_0xe12d('0x1d')]({'raw':_0x1c215e[_0xe12d('0x1e')]?_0x1c215e[_0xe12d('0x1e')][_0xe12d('0x1f')]===undefined?!![]:![]:!![],'where':_0x1c215e[_0xe12d('0x1e')]?_0x1c215e[_0xe12d('0x1e')][_0xe12d('0x20')]||null:null,'attributes':_0x1c215e[_0xe12d('0x1e')]?_0x1c215e['options']['attributes']||null:null,'include':_0x1c215e['options']?_0x1c215e[_0xe12d('0x1e')][_0xe12d('0x21')]?_[_0xe12d('0x22')](_0x1c215e[_0xe12d('0x1e')][_0xe12d('0x21')],function(_0xa62aa2){return{'model':db[_0xa62aa2['model']],'as':_0xa62aa2['as'],'attributes':_0xa62aa2['attributes'],'include':_0xa62aa2['include']?_['map'](_0xa62aa2[_0xe12d('0x21')],function(_0x11568e){return{'model':db[_0x11568e['model']],'as':_0x11568e['as'],'attributes':_0x11568e[_0xe12d('0x23')],'include':_0x11568e[_0xe12d('0x21')]?_[_0xe12d('0x22')](_0x11568e['include'],function(_0x33e8b5){return{'model':db[_0x33e8b5[_0xe12d('0x24')]],'as':_0x33e8b5['as'],'attributes':_0x33e8b5[_0xe12d('0x23')]};}):[]};}):[]};}):[]:[]})[_0xe12d('0x11')](function(_0x4462c5){logger[_0xe12d('0x12')](_0xe12d('0x1b'),_0x1c215e);logger['debug'](_0xe12d('0x1b'),_0x1c215e,JSON['stringify'](_0x4462c5));_0x40cb18(_0x4462c5);})[_0xe12d('0x1a')](function(_0x5e39c4){logger['error'](_0xe12d('0x1b'),_0x5e39c4[_0xe12d('0x18')],_0x1c215e);_0x585587(_0x3af8b0[_0xe12d('0x17')](0x1f4,_0x5e39c4[_0xe12d('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index 44a1668..5d28d8e 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(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xa9e0[_0x4dbaad];return _0x226c72;};'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(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0xa9e0[_0x138f59];return _0x3d114d;};'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 7f9986f..df6328b 100644 --- a/server/api/smsApplication/index.js +++ b/server/api/smsApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x008c=['exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','post','put','/:id'];(function(_0x48bd15,_0x495dbe){var _0x376bcc=function(_0x59f737){while(--_0x59f737){_0x48bd15['push'](_0x48bd15['shift']());}};_0x376bcc(++_0x495dbe);}(_0x008c,0x188));var _0xc008=function(_0x56dc8c,_0x1b15ca){_0x56dc8c=_0x56dc8c-0x0;var _0x166838=_0x008c[_0x56dc8c];return _0x166838;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/:id',auth[_0xc008('0xb')](),controller['show']);router[_0xc008('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xc008('0xe')](_0xc008('0xf'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xc008('0xf'),auth[_0xc008('0xb')](),controller['destroy']);module[_0xc008('0x10')]=router; \ No newline at end of file +var _0xedd9=['post','create','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsApplication.controller','get','isAuthenticated','index','/:id','show'];(function(_0x2a8474,_0x264a6e){var _0x38222c=function(_0x4d29f5){while(--_0x4d29f5){_0x2a8474['push'](_0x2a8474['shift']());}};_0x38222c(++_0x264a6e);}(_0xedd9,0xfc));var _0x9edd=function(_0x1141a2,_0x165358){_0x1141a2=_0x1141a2-0x0;var _0x2098a6=_0xedd9[_0x1141a2];return _0x2098a6;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');var controller=require(_0x9edd('0x8'));router[_0x9edd('0x9')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xb')]);router['get'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0xd')]);router[_0x9edd('0xe')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xf')]);router['put'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0x10')]);router[_0x9edd('0x11')]('/:id',auth[_0x9edd('0xa')](),controller[_0x9edd('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index 33283fe..f6d0d4b 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 _0xf3de=['noop','TEXT','STRING','sequelize','exports','INTEGER'];(function(_0x10df18,_0x13338c){var _0x1f9a1d=function(_0x3157f4){while(--_0x3157f4){_0x10df18['push'](_0x10df18['shift']());}};_0x1f9a1d(++_0x13338c);}(_0xf3de,0x1dd));var _0xef3d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf3de[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xef3d('0x0'));module[_0xef3d('0x1')]={'priority':{'type':Sequelize[_0xef3d('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xef3d('0x3')},'appdata':{'type':Sequelize[_0xef3d('0x4')]()},'description':{'type':Sequelize[_0xef3d('0x5')]},'interval':{'type':Sequelize[_0xef3d('0x5')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x448c=['INTEGER','STRING','exports'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x448c,0x1d9));var _0xc448=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x448c[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0xc448('0x0')]={'priority':{'type':Sequelize[_0xc448('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xc448('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xc448('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index 72d96b9..9e29bd7 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 _0x130d=['filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','body','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','SmsApplication','fieldName','type','query','keys','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where'];(function(_0x3430aa,_0x57cd92){var _0x2ac5c=function(_0x3068dd){while(--_0x3068dd){_0x3430aa['push'](_0x3430aa['shift']());}};_0x2ac5c(++_0x57cd92);}(_0x130d,0x9a));var _0xd130=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x130d[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xd130('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xd130('0x1'));var rp=require('request-promise');var moment=require(_0xd130('0x2'));var BPromise=require(_0xd130('0x3'));var Mustache=require(_0xd130('0x4'));var util=require(_0xd130('0x5'));var path=require(_0xd130('0x6'));var sox=require(_0xd130('0x7'));var csv=require(_0xd130('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd130('0x9'));var _=require(_0xd130('0xa'));var squel=require('squel');var crypto=require(_0xd130('0xb'));var jsforce=require(_0xd130('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd130('0xd'));var authService=require(_0xd130('0xe'));var qs=require(_0xd130('0xf'));var as=require(_0xd130('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd130('0x11'));var utils=require(_0xd130('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xd130('0x13'))['db'];function respondWithStatusCode(_0xc750e,_0x34149d){_0x34149d=_0x34149d||0xcc;return function(_0x4a4f9f){if(_0x4a4f9f){return _0xc750e[_0xd130('0x14')](_0x34149d);}return _0xc750e['status'](_0x34149d)['end']();};}function respondWithResult(_0x5d8756,_0xa334ca){_0xa334ca=_0xa334ca||0xc8;return function(_0x5475f0){if(_0x5475f0){return _0x5d8756[_0xd130('0x15')](_0xa334ca)[_0xd130('0x16')](_0x5475f0);}};}function respondWithFilteredResult(_0x514030,_0x4a64ad){return function(_0x1c45f0){if(_0x1c45f0){var _0x2f181f=typeof _0x4a64ad[_0xd130('0x17')]===_0xd130('0x18')&&typeof _0x4a64ad[_0xd130('0x19')]===_0xd130('0x18');var _0x3da6b3=_0x1c45f0[_0xd130('0x1a')];var _0x154630=_0x2f181f?0x0:_0x4a64ad[_0xd130('0x17')];var _0x2ccec6=_0x2f181f?_0x1c45f0[_0xd130('0x1a')]:_0x4a64ad['offset']+_0x4a64ad[_0xd130('0x19')];var _0xba7c3d;if(_0x2ccec6>=_0x3da6b3){_0x2ccec6=_0x3da6b3;_0xba7c3d=0xc8;}else{_0xba7c3d=0xce;}_0x514030[_0xd130('0x15')](_0xba7c3d);return _0x514030['set'](_0xd130('0x1b'),_0x154630+'-'+_0x2ccec6+'/'+_0x3da6b3)[_0xd130('0x16')](_0x1c45f0);}return null;};}function patchUpdates(_0x4d35ca){return function(_0x358069){try{jsonpatch[_0xd130('0x1c')](_0x358069,_0x4d35ca,!![]);}catch(_0x58928b){return BPromise[_0xd130('0x1d')](_0x58928b);}return _0x358069[_0xd130('0x1e')]();};}function saveUpdates(_0x3ebbf0,_0x552ea8){return function(_0x353b76){if(_0x353b76){return _0x353b76[_0xd130('0x1f')](_0x3ebbf0)[_0xd130('0x20')](function(_0x335f76){return _0x335f76;});}return null;};}function removeEntity(_0x3c7bb7,_0x5c5b85){return function(_0x16ead6){if(_0x16ead6){return _0x16ead6[_0xd130('0x21')]()[_0xd130('0x20')](function(){_0x3c7bb7[_0xd130('0x15')](0xcc)[_0xd130('0x22')]();});}};}function handleEntityNotFound(_0x484a3b,_0x382d15){return function(_0x216758){if(!_0x216758){_0x484a3b[_0xd130('0x14')](0x194);}return _0x216758;};}function handleError(_0x64500f,_0x55e44d){_0x55e44d=_0x55e44d||0x1f4;return function(_0x3b5f13){logger[_0xd130('0x23')](_0x3b5f13[_0xd130('0x24')]);if(_0x3b5f13['name']){delete _0x3b5f13[_0xd130('0x25')];}_0x64500f[_0xd130('0x15')](_0x55e44d)[_0xd130('0x26')](_0x3b5f13);};}exports['index']=function(_0x7c7429,_0x97bab2){var _0x42a508={},_0x353063={},_0x3a6493={'count':0x0,'rows':[]};var _0x28174d=_['map'](db[_0xd130('0x27')]['rawAttributes'],function(_0x4f526f){return{'name':_0x4f526f[_0xd130('0x28')],'type':_0x4f526f[_0xd130('0x29')]['key']};});_0x353063['model']=_['map'](_0x28174d,_0xd130('0x25'));_0x353063[_0xd130('0x2a')]=_[_0xd130('0x2b')](_0x7c7429[_0xd130('0x2a')]);_0x353063['filters']=_[_0xd130('0x2c')](_0x353063['model'],_0x353063['query']);_0x42a508[_0xd130('0x2d')]=_[_0xd130('0x2c')](_0x353063[_0xd130('0x2e')],qs[_0xd130('0x2f')](_0x7c7429['query'][_0xd130('0x2f')]));_0x42a508[_0xd130('0x2d')]=_0x42a508[_0xd130('0x2d')][_0xd130('0x30')]?_0x42a508['attributes']:_0x353063[_0xd130('0x2e')];if(!_0x7c7429[_0xd130('0x2a')][_0xd130('0x31')](_0xd130('0x32'))){_0x42a508[_0xd130('0x19')]=qs[_0xd130('0x19')](_0x7c7429[_0xd130('0x2a')][_0xd130('0x19')]);_0x42a508[_0xd130('0x17')]=qs[_0xd130('0x17')](_0x7c7429[_0xd130('0x2a')][_0xd130('0x17')]);}_0x42a508['order']=qs['sort'](_0x7c7429[_0xd130('0x2a')][_0xd130('0x33')]);_0x42a508[_0xd130('0x34')]=qs[_0xd130('0x35')](_[_0xd130('0x36')](_0x7c7429[_0xd130('0x2a')],_0x353063[_0xd130('0x35')]),_0x28174d);if(_0x7c7429['query'][_0xd130('0x37')]){_0x42a508[_0xd130('0x34')]=_[_0xd130('0x38')](_0x42a508[_0xd130('0x34')],{'$or':_['map'](_0x28174d,function(_0x4a3a36){if(_0x4a3a36[_0xd130('0x29')]!==_0xd130('0x39')){var _0x14fc39={};_0x14fc39[_0x4a3a36[_0xd130('0x25')]]={'$like':'%'+_0x7c7429[_0xd130('0x2a')][_0xd130('0x37')]+'%'};return _0x14fc39;}})});}_0x42a508=_[_0xd130('0x38')]({},_0x42a508,_0x7c7429[_0xd130('0x3a')]);var _0xa973b4={'where':_0x42a508[_0xd130('0x34')]};return db['SmsApplication']['count'](_0xa973b4)[_0xd130('0x20')](function(_0x334db0){_0x3a6493[_0xd130('0x1a')]=_0x334db0;if(_0x7c7429[_0xd130('0x2a')][_0xd130('0x3b')]){_0x42a508[_0xd130('0x3c')]=[{'all':!![]}];}return db[_0xd130('0x27')][_0xd130('0x3d')](_0x42a508);})[_0xd130('0x20')](function(_0x2c1bc6){_0x3a6493[_0xd130('0x3e')]=_0x2c1bc6;return _0x3a6493;})[_0xd130('0x20')](respondWithFilteredResult(_0x97bab2,_0x42a508))[_0xd130('0x3f')](handleError(_0x97bab2,null));};exports[_0xd130('0x40')]=function(_0x4fde17,_0x3a672d){var _0x636065={'raw':!![],'where':{'id':_0x4fde17[_0xd130('0x41')]['id']}},_0x493a0c={};_0x493a0c[_0xd130('0x2e')]=_['keys'](db[_0xd130('0x27')][_0xd130('0x42')]);_0x493a0c[_0xd130('0x2a')]=_['keys'](_0x4fde17['query']);_0x493a0c[_0xd130('0x35')]=_[_0xd130('0x2c')](_0x493a0c['model'],_0x493a0c[_0xd130('0x2a')]);_0x636065[_0xd130('0x2d')]=_['intersection'](_0x493a0c[_0xd130('0x2e')],qs[_0xd130('0x2f')](_0x4fde17['query'][_0xd130('0x2f')]));_0x636065[_0xd130('0x2d')]=_0x636065[_0xd130('0x2d')]['length']?_0x636065[_0xd130('0x2d')]:_0x493a0c[_0xd130('0x2e')];if(_0x4fde17[_0xd130('0x2a')]['includeAll']){_0x636065['include']=[{'all':!![]}];}_0x636065=_[_0xd130('0x38')]({},_0x636065,_0x4fde17[_0xd130('0x3a')]);return db[_0xd130('0x27')][_0xd130('0x43')](_0x636065)[_0xd130('0x20')](handleEntityNotFound(_0x3a672d,null))[_0xd130('0x20')](respondWithResult(_0x3a672d,null))[_0xd130('0x3f')](handleError(_0x3a672d,null));};exports['create']=function(_0x5e4951,_0x3c9950){return db[_0xd130('0x27')]['create'](_0x5e4951[_0xd130('0x44')],{})[_0xd130('0x20')](respondWithResult(_0x3c9950,0xc9))[_0xd130('0x3f')](handleError(_0x3c9950,null));};exports[_0xd130('0x1f')]=function(_0x32ffbb,_0x266440){if(_0x32ffbb['body']['id']){delete _0x32ffbb[_0xd130('0x44')]['id'];}return db[_0xd130('0x27')][_0xd130('0x43')]({'where':{'id':_0x32ffbb[_0xd130('0x41')]['id']}})[_0xd130('0x20')](handleEntityNotFound(_0x266440,null))[_0xd130('0x20')](saveUpdates(_0x32ffbb[_0xd130('0x44')],null))[_0xd130('0x20')](respondWithResult(_0x266440,null))[_0xd130('0x3f')](handleError(_0x266440,null));};exports[_0xd130('0x21')]=function(_0x31b4e7,_0x1a8207){return db[_0xd130('0x27')][_0xd130('0x43')]({'where':{'id':_0x31b4e7['params']['id']}})[_0xd130('0x20')](handleEntityNotFound(_0x1a8207,null))[_0xd130('0x20')](removeEntity(_0x1a8207,null))[_0xd130('0x3f')](handleError(_0x1a8207,null));}; \ No newline at end of file +var _0x1c65=['fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','undefined','count','set','json','apply','reject','save','update','then','destroy','error','stack','name','index','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','order','pick','merge','options','where','SmsApplication','includeAll','include','findAll','rows','catch','length','find','create','body','params','rimraf','zip-dir'];(function(_0x1be2da,_0x27c015){var _0x3550c6=function(_0x5abf24){while(--_0x5abf24){_0x1be2da['push'](_0x1be2da['shift']());}};_0x3550c6(++_0x27c015);}(_0x1c65,0x1ae));var _0x51c6=function(_0x3e95bd,_0x162447){_0x3e95bd=_0x3e95bd-0x0;var _0x3e0ae3=_0x1c65[_0x3e95bd];return _0x3e0ae3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x51c6('0x0'));var zipdir=require(_0x51c6('0x1'));var jsonpatch=require(_0x51c6('0x2'));var rp=require(_0x51c6('0x3'));var moment=require(_0x51c6('0x4'));var BPromise=require(_0x51c6('0x5'));var Mustache=require(_0x51c6('0x6'));var util=require(_0x51c6('0x7'));var path=require(_0x51c6('0x8'));var sox=require(_0x51c6('0x9'));var csv=require(_0x51c6('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x51c6('0xb'));var crypto=require(_0x51c6('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x51c6('0xd'));var toCsv=require(_0x51c6('0xa'));var querystring=require('querystring');var Papa=require(_0x51c6('0xe'));var Redis=require(_0x51c6('0xf'));var authService=require(_0x51c6('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x51c6('0x11'));var hardwareService=require(_0x51c6('0x12'));var logger=require(_0x51c6('0x13'))(_0x51c6('0x14'));var utils=require(_0x51c6('0x15'));var config=require(_0x51c6('0x16'));var licenseUtil=require(_0x51c6('0x17'));var db=require(_0x51c6('0x18'))['db'];function respondWithStatusCode(_0x1335eb,_0x2b4ebc){_0x2b4ebc=_0x2b4ebc||0xcc;return function(_0x4d6a86){if(_0x4d6a86){return _0x1335eb[_0x51c6('0x19')](_0x2b4ebc);}return _0x1335eb[_0x51c6('0x1a')](_0x2b4ebc)['end']();};}function respondWithResult(_0x4d7c36,_0x4ee6c5){_0x4ee6c5=_0x4ee6c5||0xc8;return function(_0x3d1f26){if(_0x3d1f26){return _0x4d7c36[_0x51c6('0x1a')](_0x4ee6c5)['json'](_0x3d1f26);}};}function respondWithFilteredResult(_0x4b7590,_0x210e9b){return function(_0x5bd4f0){if(_0x5bd4f0){var _0x4b88a6=typeof _0x210e9b[_0x51c6('0x1b')]==='undefined'&&typeof _0x210e9b[_0x51c6('0x1c')]===_0x51c6('0x1d');var _0x323990=_0x5bd4f0[_0x51c6('0x1e')];var _0x217c74=_0x4b88a6?0x0:_0x210e9b['offset'];var _0x204461=_0x4b88a6?_0x5bd4f0[_0x51c6('0x1e')]:_0x210e9b[_0x51c6('0x1b')]+_0x210e9b[_0x51c6('0x1c')];var _0x6af083;if(_0x204461>=_0x323990){_0x204461=_0x323990;_0x6af083=0xc8;}else{_0x6af083=0xce;}_0x4b7590[_0x51c6('0x1a')](_0x6af083);return _0x4b7590[_0x51c6('0x1f')]('Content-Range',_0x217c74+'-'+_0x204461+'/'+_0x323990)[_0x51c6('0x20')](_0x5bd4f0);}return null;};}function patchUpdates(_0x4dbd3b){return function(_0x1edd12){try{jsonpatch[_0x51c6('0x21')](_0x1edd12,_0x4dbd3b,!![]);}catch(_0x361543){return BPromise[_0x51c6('0x22')](_0x361543);}return _0x1edd12[_0x51c6('0x23')]();};}function saveUpdates(_0x21d620,_0x2ffa79){return function(_0x4637d9){if(_0x4637d9){return _0x4637d9[_0x51c6('0x24')](_0x21d620)[_0x51c6('0x25')](function(_0x169710){return _0x169710;});}return null;};}function removeEntity(_0x489007,_0x366695){return function(_0x133d5f){if(_0x133d5f){return _0x133d5f[_0x51c6('0x26')]()[_0x51c6('0x25')](function(){_0x489007[_0x51c6('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e7fbb,_0x5d4967){return function(_0x22816d){if(!_0x22816d){_0x1e7fbb[_0x51c6('0x19')](0x194);}return _0x22816d;};}function handleError(_0x48155e,_0x125adc){_0x125adc=_0x125adc||0x1f4;return function(_0x84362a){logger[_0x51c6('0x27')](_0x84362a[_0x51c6('0x28')]);if(_0x84362a['name']){delete _0x84362a[_0x51c6('0x29')];}_0x48155e[_0x51c6('0x1a')](_0x125adc)['send'](_0x84362a);};}exports[_0x51c6('0x2a')]=function(_0x19f5c6,_0x5eb4b2){var _0x29e2b3={},_0x7028e1={},_0x56c93a={'count':0x0,'rows':[]};var _0x5a070f=_['map'](db['SmsApplication'][_0x51c6('0x2b')],function(_0x47510d){return{'name':_0x47510d[_0x51c6('0x2c')],'type':_0x47510d[_0x51c6('0x2d')][_0x51c6('0x2e')]};});_0x7028e1['model']=_[_0x51c6('0x2f')](_0x5a070f,_0x51c6('0x29'));_0x7028e1[_0x51c6('0x30')]=_[_0x51c6('0x31')](_0x19f5c6[_0x51c6('0x30')]);_0x7028e1[_0x51c6('0x32')]=_[_0x51c6('0x33')](_0x7028e1[_0x51c6('0x34')],_0x7028e1[_0x51c6('0x30')]);_0x29e2b3['attributes']=_[_0x51c6('0x33')](_0x7028e1['model'],qs[_0x51c6('0x35')](_0x19f5c6[_0x51c6('0x30')][_0x51c6('0x35')]));_0x29e2b3[_0x51c6('0x36')]=_0x29e2b3[_0x51c6('0x36')]['length']?_0x29e2b3[_0x51c6('0x36')]:_0x7028e1[_0x51c6('0x34')];if(!_0x19f5c6[_0x51c6('0x30')][_0x51c6('0x37')]('nolimit')){_0x29e2b3[_0x51c6('0x1c')]=qs[_0x51c6('0x1c')](_0x19f5c6[_0x51c6('0x30')][_0x51c6('0x1c')]);_0x29e2b3[_0x51c6('0x1b')]=qs[_0x51c6('0x1b')](_0x19f5c6[_0x51c6('0x30')][_0x51c6('0x1b')]);}_0x29e2b3[_0x51c6('0x38')]=qs['sort'](_0x19f5c6['query']['sort']);_0x29e2b3['where']=qs['filters'](_[_0x51c6('0x39')](_0x19f5c6[_0x51c6('0x30')],_0x7028e1[_0x51c6('0x32')]),_0x5a070f);if(_0x19f5c6[_0x51c6('0x30')]['filter']){_0x29e2b3['where']=_[_0x51c6('0x3a')](_0x29e2b3['where'],{'$or':_[_0x51c6('0x2f')](_0x5a070f,function(_0x2f5327){if(_0x2f5327[_0x51c6('0x2d')]!=='VIRTUAL'){var _0x2823f9={};_0x2823f9[_0x2f5327['name']]={'$like':'%'+_0x19f5c6[_0x51c6('0x30')]['filter']+'%'};return _0x2823f9;}})});}_0x29e2b3=_['merge']({},_0x29e2b3,_0x19f5c6[_0x51c6('0x3b')]);var _0x1d7736={'where':_0x29e2b3[_0x51c6('0x3c')]};return db[_0x51c6('0x3d')][_0x51c6('0x1e')](_0x1d7736)[_0x51c6('0x25')](function(_0x3b8da4){_0x56c93a[_0x51c6('0x1e')]=_0x3b8da4;if(_0x19f5c6[_0x51c6('0x30')][_0x51c6('0x3e')]){_0x29e2b3[_0x51c6('0x3f')]=[{'all':!![]}];}return db[_0x51c6('0x3d')][_0x51c6('0x40')](_0x29e2b3);})['then'](function(_0xe838d9){_0x56c93a[_0x51c6('0x41')]=_0xe838d9;return _0x56c93a;})[_0x51c6('0x25')](respondWithFilteredResult(_0x5eb4b2,_0x29e2b3))[_0x51c6('0x42')](handleError(_0x5eb4b2,null));};exports['show']=function(_0x148c6c,_0x4bb6ea){var _0x1f24e5={'raw':!![],'where':{'id':_0x148c6c['params']['id']}},_0x1397b1={};_0x1397b1[_0x51c6('0x34')]=_['keys'](db[_0x51c6('0x3d')]['rawAttributes']);_0x1397b1[_0x51c6('0x30')]=_['keys'](_0x148c6c[_0x51c6('0x30')]);_0x1397b1[_0x51c6('0x32')]=_['intersection'](_0x1397b1[_0x51c6('0x34')],_0x1397b1['query']);_0x1f24e5[_0x51c6('0x36')]=_[_0x51c6('0x33')](_0x1397b1[_0x51c6('0x34')],qs['fields'](_0x148c6c[_0x51c6('0x30')][_0x51c6('0x35')]));_0x1f24e5['attributes']=_0x1f24e5[_0x51c6('0x36')][_0x51c6('0x43')]?_0x1f24e5[_0x51c6('0x36')]:_0x1397b1[_0x51c6('0x34')];if(_0x148c6c[_0x51c6('0x30')][_0x51c6('0x3e')]){_0x1f24e5[_0x51c6('0x3f')]=[{'all':!![]}];}_0x1f24e5=_[_0x51c6('0x3a')]({},_0x1f24e5,_0x148c6c[_0x51c6('0x3b')]);return db[_0x51c6('0x3d')][_0x51c6('0x44')](_0x1f24e5)[_0x51c6('0x25')](handleEntityNotFound(_0x4bb6ea,null))['then'](respondWithResult(_0x4bb6ea,null))['catch'](handleError(_0x4bb6ea,null));};exports[_0x51c6('0x45')]=function(_0x3a568e,_0x500b86){return db[_0x51c6('0x3d')][_0x51c6('0x45')](_0x3a568e[_0x51c6('0x46')],{})[_0x51c6('0x25')](respondWithResult(_0x500b86,0xc9))[_0x51c6('0x42')](handleError(_0x500b86,null));};exports[_0x51c6('0x24')]=function(_0x154a64,_0x5b8b92){if(_0x154a64['body']['id']){delete _0x154a64[_0x51c6('0x46')]['id'];}return db[_0x51c6('0x3d')][_0x51c6('0x44')]({'where':{'id':_0x154a64[_0x51c6('0x47')]['id']}})[_0x51c6('0x25')](handleEntityNotFound(_0x5b8b92,null))[_0x51c6('0x25')](saveUpdates(_0x154a64[_0x51c6('0x46')],null))[_0x51c6('0x25')](respondWithResult(_0x5b8b92,null))[_0x51c6('0x42')](handleError(_0x5b8b92,null));};exports[_0x51c6('0x26')]=function(_0x6c4963,_0x6364bc){return db[_0x51c6('0x3d')][_0x51c6('0x44')]({'where':{'id':_0x6c4963[_0x51c6('0x47')]['id']}})['then'](handleEntityNotFound(_0x6364bc,null))['then'](removeEntity(_0x6364bc,null))[_0x51c6('0x42')](handleError(_0x6364bc,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index b7dbd21..4166f79 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 _0x0c48=['utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./smsApplication.attributes','exports','define','SmsApplication','sms_applications'];(function(_0x4a59d7,_0x33d394){var _0x3248ef=function(_0x2cd1b8){while(--_0x2cd1b8){_0x4a59d7['push'](_0x4a59d7['shift']());}};_0x3248ef(++_0x33d394);}(_0x0c48,0xd3));var _0x80c4=function(_0x20d282,_0x292d4d){_0x20d282=_0x20d282-0x0;var _0x1331aa=_0x0c48[_0x20d282];return _0x1331aa;};'use strict';var _=require(_0x80c4('0x0'));var util=require(_0x80c4('0x1'));var logger=require(_0x80c4('0x2'))(_0x80c4('0x3'));var moment=require(_0x80c4('0x4'));var BPromise=require(_0x80c4('0x5'));var rp=require(_0x80c4('0x6'));var fs=require('fs');var path=require(_0x80c4('0x7'));var rimraf=require(_0x80c4('0x8'));var config=require('../../config/environment');var attributes=require(_0x80c4('0x9'));module[_0x80c4('0xa')]=function(_0x2ab2bc,_0x1c5753){return _0x2ab2bc[_0x80c4('0xb')](_0x80c4('0xc'),attributes,{'tableName':_0x80c4('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x80c4('0xe')});}; \ No newline at end of file +var _0xad01=['define','SmsApplication','sms_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsApplication.attributes','exports'];(function(_0x104f39,_0x387e28){var _0x5a1155=function(_0x530f66){while(--_0x530f66){_0x104f39['push'](_0x104f39['shift']());}};_0x5a1155(++_0x387e28);}(_0xad01,0x1d4));var _0x1ad0=function(_0x76d2ec,_0x45ea7c){_0x76d2ec=_0x76d2ec-0x0;var _0x540bdc=_0xad01[_0x76d2ec];return _0x540bdc;};'use strict';var _=require(_0x1ad0('0x0'));var util=require(_0x1ad0('0x1'));var logger=require(_0x1ad0('0x2'))(_0x1ad0('0x3'));var moment=require(_0x1ad0('0x4'));var BPromise=require(_0x1ad0('0x5'));var rp=require(_0x1ad0('0x6'));var fs=require('fs');var path=require(_0x1ad0('0x7'));var rimraf=require(_0x1ad0('0x8'));var config=require(_0x1ad0('0x9'));var attributes=require(_0x1ad0('0xa'));module[_0x1ad0('0xb')]=function(_0x132409,_0xf8911){return _0x132409[_0x1ad0('0xc')](_0x1ad0('0xd'),attributes,{'tableName':_0x1ad0('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x1ad0('0xf')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index a0e8710..dcf7548 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 _0xf7d9=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','SmsApplication,\x20%s,\x20%s','debug','SmsApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','lodash','util','moment','bluebird'];(function(_0x160a5d,_0x5de817){var _0x471c93=function(_0x54cf74){while(--_0x54cf74){_0x160a5d['push'](_0x160a5d['shift']());}};_0x471c93(++_0x5de817);}(_0xf7d9,0x122));var _0x9f7d=function(_0xe2f6f5,_0x3999bc){_0xe2f6f5=_0xe2f6f5-0x0;var _0x2a2800=_0xf7d9[_0xe2f6f5];return _0x2a2800;};'use strict';var _=require(_0x9f7d('0x0'));var util=require(_0x9f7d('0x1'));var moment=require(_0x9f7d('0x2'));var BPromise=require(_0x9f7d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9f7d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9f7d('0x5'))(_0x9f7d('0x6'));var config=require(_0x9f7d('0x7'));var jayson=require(_0x9f7d('0x8'));var client=jayson[_0x9f7d('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4dc6b9,_0xf09259,_0x2333e8){return new BPromise(function(_0x218628,_0x2893a5){return client[_0x9f7d('0xa')](_0x4dc6b9,_0x2333e8)[_0x9f7d('0xb')](function(_0x5290e2){logger[_0x9f7d('0xc')](_0x9f7d('0xd'),_0xf09259,'request\x20sent');logger[_0x9f7d('0xe')](_0x9f7d('0xf'),_0xf09259,_0x9f7d('0x10'),JSON['stringify'](_0x5290e2));if(_0x5290e2[_0x9f7d('0x11')]){if(_0x5290e2[_0x9f7d('0x11')][_0x9f7d('0x12')]===0x1f4){logger[_0x9f7d('0x11')](_0x9f7d('0xd'),_0xf09259,_0x5290e2[_0x9f7d('0x11')]['message']);return _0x2893a5(_0x5290e2[_0x9f7d('0x11')][_0x9f7d('0x13')]);}logger[_0x9f7d('0x11')](_0x9f7d('0xd'),_0xf09259,_0x5290e2['error'][_0x9f7d('0x13')]);return _0x218628(_0x5290e2[_0x9f7d('0x11')][_0x9f7d('0x13')]);}else{logger[_0x9f7d('0xc')](_0x9f7d('0xd'),_0xf09259,_0x9f7d('0x10'));_0x218628(_0x5290e2[_0x9f7d('0x14')]['message']);}})['catch'](function(_0x402609){logger[_0x9f7d('0x11')](_0x9f7d('0xd'),_0xf09259,_0x402609);_0x2893a5(_0x402609);});});} \ No newline at end of file +var _0xf61e=['info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x40843f,_0x558857){var _0x177176=function(_0x553c9e){while(--_0x553c9e){_0x40843f['push'](_0x40843f['shift']());}};_0x177176(++_0x558857);}(_0xf61e,0x191));var _0xef61=function(_0x4a80b8,_0x553756){_0x4a80b8=_0x4a80b8-0x0;var _0x7e80c3=_0xf61e[_0x4a80b8];return _0x7e80c3;};'use strict';var _=require(_0xef61('0x0'));var util=require(_0xef61('0x1'));var moment=require(_0xef61('0x2'));var BPromise=require(_0xef61('0x3'));var rs=require(_0xef61('0x4'));var fs=require('fs');var Redis=require(_0xef61('0x5'));var db=require(_0xef61('0x6'))['db'];var utils=require(_0xef61('0x7'));var logger=require(_0xef61('0x8'))(_0xef61('0x9'));var config=require(_0xef61('0xa'));var jayson=require(_0xef61('0xb'));var client=jayson['client'][_0xef61('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3e2f79,_0x4f0cc5,_0x2242a7){return new BPromise(function(_0x277fa1,_0x106e7f){return client['request'](_0x3e2f79,_0x2242a7)['then'](function(_0x188894){logger[_0xef61('0xd')](_0xef61('0xe'),_0x4f0cc5,_0xef61('0xf'));logger[_0xef61('0x10')](_0xef61('0x11'),_0x4f0cc5,_0xef61('0xf'),JSON[_0xef61('0x12')](_0x188894));if(_0x188894[_0xef61('0x13')]){if(_0x188894[_0xef61('0x13')][_0xef61('0x14')]===0x1f4){logger[_0xef61('0x13')](_0xef61('0xe'),_0x4f0cc5,_0x188894[_0xef61('0x13')]['message']);return _0x106e7f(_0x188894[_0xef61('0x13')]['message']);}logger[_0xef61('0x13')](_0xef61('0xe'),_0x4f0cc5,_0x188894[_0xef61('0x13')][_0xef61('0x15')]);return _0x277fa1(_0x188894['error'][_0xef61('0x15')]);}else{logger[_0xef61('0xd')](_0xef61('0xe'),_0x4f0cc5,_0xef61('0xf'));_0x277fa1(_0x188894['result'][_0xef61('0x15')]);}})[_0xef61('0x16')](function(_0x4f7a62){logger[_0xef61('0x13')](_0xef61('0xe'),_0x4f0cc5,_0x4f7a62);_0x106e7f(_0x4f7a62);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index ff17765..37e1423 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 _0x2547=['/:id/messages','getMessages','/:id/download','post','create','addMessage','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','put','smsinteraction:update','update','delete','smsinteraction:destroy','destroy','removeTags','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x7da33c,_0xabbc19){var _0x205045=function(_0x182896){while(--_0x182896){_0x7da33c['push'](_0x7da33c['shift']());}};_0x205045(++_0xabbc19);}(_0x2547,0x1cd));var _0x7254=function(_0x405cbd,_0x1db56f){_0x405cbd=_0x405cbd-0x0;var _0x13e338=_0x2547[_0x405cbd];return _0x13e338;};'use strict';var multer=require('multer');var util=require(_0x7254('0x0'));var path=require(_0x7254('0x1'));var timeout=require(_0x7254('0x2'));var express=require(_0x7254('0x3'));var router=express[_0x7254('0x4')]();var fs_extra=require(_0x7254('0x5'));var auth=require(_0x7254('0x6'));var interaction=require(_0x7254('0x7'));var config=require('../../config/environment');var controller=require(_0x7254('0x8'));router[_0x7254('0x9')]('/',auth[_0x7254('0xa')](),controller[_0x7254('0xb')]);router['get'](_0x7254('0xc'),auth[_0x7254('0xa')](),controller[_0x7254('0xd')]);router['get'](_0x7254('0xe'),auth['isAuthenticated'](),controller['show']);router['get'](_0x7254('0xf'),auth[_0x7254('0xa')](),controller[_0x7254('0x10')]);router[_0x7254('0x9')](_0x7254('0x11'),auth[_0x7254('0xa')](),controller['download']);router[_0x7254('0x12')]('/',auth['isAuthenticated'](),controller[_0x7254('0x13')]);router['post'](_0x7254('0xf'),auth[_0x7254('0xa')](),controller[_0x7254('0x14')]);router[_0x7254('0x12')](_0x7254('0x15'),auth[_0x7254('0xa')](),interaction[_0x7254('0x16')](_0x7254('0x17'),_0x7254('0x18')),controller[_0x7254('0x19')]);router[_0x7254('0x1a')](_0x7254('0xe'),auth[_0x7254('0xa')](),interaction['tracked'](_0x7254('0x17'),_0x7254('0x1b')),controller[_0x7254('0x1c')]);router[_0x7254('0x1d')](_0x7254('0xe'),auth[_0x7254('0xa')](),interaction[_0x7254('0x16')]('sms',_0x7254('0x1e')),controller[_0x7254('0x1f')]);router[_0x7254('0x1d')](_0x7254('0x15'),auth[_0x7254('0xa')](),controller[_0x7254('0x20')]);module[_0x7254('0x21')]=router; \ No newline at end of file +var _0xea28=['put','smsinteraction:update','update','delete','smsinteraction:destroy','destroy','/:id/tags','removeTags','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./smsInteraction.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/messages','/:id/download','download','create','post','tracked','sms','smsinteraction:addtags','addTags'];(function(_0x5da953,_0x52de6b){var _0x1c8aee=function(_0x4a14ba){while(--_0x4a14ba){_0x5da953['push'](_0x5da953['shift']());}};_0x1c8aee(++_0x52de6b);}(_0xea28,0x13a));var _0x8ea2=function(_0x11f76e,_0x33569a){_0x11f76e=_0x11f76e-0x0;var _0x152655=_0xea28[_0x11f76e];return _0x152655;};'use strict';var multer=require(_0x8ea2('0x0'));var util=require(_0x8ea2('0x1'));var path=require(_0x8ea2('0x2'));var timeout=require(_0x8ea2('0x3'));var express=require(_0x8ea2('0x4'));var router=express[_0x8ea2('0x5')]();var fs_extra=require(_0x8ea2('0x6'));var auth=require(_0x8ea2('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x8ea2('0x8'));var controller=require(_0x8ea2('0x9'));router[_0x8ea2('0xa')]('/',auth['isAuthenticated'](),controller[_0x8ea2('0xb')]);router[_0x8ea2('0xa')](_0x8ea2('0xc'),auth[_0x8ea2('0xd')](),controller[_0x8ea2('0xe')]);router[_0x8ea2('0xa')](_0x8ea2('0xf'),auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x10')]);router[_0x8ea2('0xa')](_0x8ea2('0x11'),auth[_0x8ea2('0xd')](),controller['getMessages']);router['get'](_0x8ea2('0x12'),auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x13')]);router['post']('/',auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x14')]);router[_0x8ea2('0x15')](_0x8ea2('0x11'),auth[_0x8ea2('0xd')](),controller['addMessage']);router[_0x8ea2('0x15')]('/:id/tags',auth['isAuthenticated'](),interaction[_0x8ea2('0x16')](_0x8ea2('0x17'),_0x8ea2('0x18')),controller[_0x8ea2('0x19')]);router[_0x8ea2('0x1a')](_0x8ea2('0xf'),auth[_0x8ea2('0xd')](),interaction[_0x8ea2('0x16')](_0x8ea2('0x17'),_0x8ea2('0x1b')),controller[_0x8ea2('0x1c')]);router[_0x8ea2('0x1d')](_0x8ea2('0xf'),auth[_0x8ea2('0xd')](),interaction[_0x8ea2('0x16')](_0x8ea2('0x17'),_0x8ea2('0x1e')),controller[_0x8ea2('0x1f')]);router[_0x8ea2('0x1d')](_0x8ea2('0x20'),auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x21')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index 87437f8..2bb6829 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 _0xbf07=['sequelize','moment','exports','BOOLEAN','STRING','DATE','ENUM'];(function(_0x2d4421,_0x15a84f){var _0x2d3b01=function(_0xb9e94c){while(--_0xb9e94c){_0x2d4421['push'](_0x2d4421['shift']());}};_0x2d3b01(++_0x15a84f);}(_0xbf07,0x77));var _0x7bf0=function(_0xd1c39b,_0x16f0c6){_0xd1c39b=_0xd1c39b-0x0;var _0x58f5bc=_0xbf07[_0xd1c39b];return _0x58f5bc;};'use strict';var Sequelize=require(_0x7bf0('0x0'));var moment=require(_0x7bf0('0x1'));module[_0x7bf0('0x2')]={'closed':{'type':Sequelize[_0x7bf0('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x7bf0('0x4')]},'secondDisposition':{'type':Sequelize[_0x7bf0('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x7bf0('0x5')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x7bf0('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x7bf0('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x8832=['ENUM','out','BOOLEAN','sequelize','moment','DATE','STRING'];(function(_0x493150,_0x107958){var _0x3fe8da=function(_0xce7a75){while(--_0xce7a75){_0x493150['push'](_0x493150['shift']());}};_0x3fe8da(++_0x107958);}(_0x8832,0x1f4));var _0x2883=function(_0x28eaaa,_0x633d6){_0x28eaaa=_0x28eaaa-0x0;var _0xca07f=_0x8832[_0x28eaaa];return _0xca07f;};'use strict';var Sequelize=require(_0x2883('0x0'));var moment=require(_0x2883('0x1'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x2883('0x2')]},'disposition':{'type':Sequelize[_0x2883('0x3')]},'secondDisposition':{'type':Sequelize[_0x2883('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x2883('0x3')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x2883('0x2')]},'firstMsgDirection':{'type':Sequelize[_0x2883('0x4')]('in',_0x2883('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x2883('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x2883('0x6')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index 6cadd17..601829a 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 _0x4e48=['u.id','u.fullname','ui.SmsInteractionId','left_join','users','u.id\x20=\x20ui.UserId','sms_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','sms_accounts','a.id\x20=\x20i.SmsAccountId','sms_messages','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','search','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','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','isEmpty','SmsAccountId','where','i.SmsAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','i.id\x20LIKE\x20?','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','Sequelize','QueryTypes','SELECT','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','role','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','agent','sequelize','toString','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','c.fax','Contact.fax','o.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','all','catch','show','params','intersection','includeAll','include','create','describe','addMessage','omit','ids','getMessages','SmsMessage','format','options','rows','addTags','setTags','findAll','removeTags','download','join','root','server','files','tmp','CmContact','firstName','Messages','direction','secret','SmsAccount','mkdirSync','Sms','Account','Owner','N.A.','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','disposition','System','lastName','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./smsInteraction.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','name','send','Users','map','fullname','TagIds','Tags','split','forEach','push','index','SmsInteraction','rawAttributes','fieldName','type','key','model','keys','query','filters','fields','attributes','length','hasOwnProperty','nolimit','order','sort','select','field','color','from','tools_tags'];(function(_0x4e1bdc,_0x58a233){var _0x9bc2fc=function(_0x56a812){while(--_0x56a812){_0x4e1bdc['push'](_0x4e1bdc['shift']());}};_0x9bc2fc(++_0x58a233);}(_0x4e48,0x9c));var _0x84e4=function(_0x13783d,_0x19ebbb){_0x13783d=_0x13783d-0x0;var _0x312525=_0x4e48[_0x13783d];return _0x312525;};'use strict';var emlformat=require(_0x84e4('0x0'));var rimraf=require(_0x84e4('0x1'));var zipdir=require(_0x84e4('0x2'));var jsonpatch=require(_0x84e4('0x3'));var rp=require('request-promise');var moment=require(_0x84e4('0x4'));var BPromise=require(_0x84e4('0x5'));var Mustache=require(_0x84e4('0x6'));var util=require(_0x84e4('0x7'));var path=require(_0x84e4('0x8'));var sox=require(_0x84e4('0x9'));var csv=require(_0x84e4('0xa'));var ejs=require(_0x84e4('0xb'));var fs=require('fs');var fs_extra=require(_0x84e4('0xc'));var _=require(_0x84e4('0xd'));var squel=require(_0x84e4('0xe'));var crypto=require(_0x84e4('0xf'));var jsforce=require(_0x84e4('0x10'));var deskjs=require(_0x84e4('0x11'));var toCsv=require(_0x84e4('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x84e4('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x84e4('0x13'));var as=require(_0x84e4('0x14'));var pdf=require(_0x84e4('0x15'));var hardwareService=require(_0x84e4('0x16'));var logger=require(_0x84e4('0x17'))(_0x84e4('0x18'));var utils=require(_0x84e4('0x19'));var config=require(_0x84e4('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x84e4('0x1b'))['db'];config[_0x84e4('0x1c')]=_['defaults'](config[_0x84e4('0x1c')],{'host':_0x84e4('0x1d'),'port':0x18eb});var socket=require(_0x84e4('0x1e'))(new Redis(config['redis']));require(_0x84e4('0x1f'))[_0x84e4('0x20')](socket);function respondWithStatusCode(_0x42f37f,_0x46be07){_0x46be07=_0x46be07||0xcc;return function(_0x11445e){if(_0x11445e){return _0x42f37f[_0x84e4('0x21')](_0x46be07);}return _0x42f37f[_0x84e4('0x22')](_0x46be07)[_0x84e4('0x23')]();};}function respondWithResult(_0x57715b,_0x2c1e1a){_0x2c1e1a=_0x2c1e1a||0xc8;return function(_0x1ba000){if(_0x1ba000){return _0x57715b['status'](_0x2c1e1a)[_0x84e4('0x24')](_0x1ba000);}};}function respondWithFilteredResult(_0x4a19c4,_0xdad1db){return function(_0x1451e4){if(_0x1451e4){var _0x5568ef=typeof _0xdad1db['offset']===_0x84e4('0x25')&&typeof _0xdad1db[_0x84e4('0x26')]===_0x84e4('0x25');var _0x3ec7a9=_0x1451e4[_0x84e4('0x27')];var _0x36be2b=_0x5568ef?0x0:_0xdad1db[_0x84e4('0x28')];var _0x4fb094=_0x5568ef?_0x1451e4[_0x84e4('0x27')]:_0xdad1db[_0x84e4('0x28')]+_0xdad1db[_0x84e4('0x26')];var _0x5a03f8;if(_0x4fb094>=_0x3ec7a9){_0x4fb094=_0x3ec7a9;_0x5a03f8=0xc8;}else{_0x5a03f8=0xce;}_0x4a19c4['status'](_0x5a03f8);return _0x4a19c4[_0x84e4('0x29')](_0x84e4('0x2a'),_0x36be2b+'-'+_0x4fb094+'/'+_0x3ec7a9)[_0x84e4('0x24')](_0x1451e4);}return null;};}function patchUpdates(_0x398906){return function(_0x2ddb1e){try{jsonpatch['apply'](_0x2ddb1e,_0x398906,!![]);}catch(_0x1a6978){return BPromise[_0x84e4('0x2b')](_0x1a6978);}return _0x2ddb1e[_0x84e4('0x2c')]();};}function saveUpdates(_0xe2099e,_0xfd5cd2){return function(_0x45611c){if(_0x45611c){return _0x45611c[_0x84e4('0x2d')](_0xe2099e)['then'](function(_0x49f386){return _0x49f386;});}return null;};}function removeEntity(_0x9e705b,_0x44be7e){return function(_0x46fdd9){if(_0x46fdd9){return _0x46fdd9['destroy']()[_0x84e4('0x2e')](function(){_0x9e705b[_0x84e4('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x579d49,_0x4d5c5b){return function(_0x36bba8){if(!_0x36bba8){_0x579d49[_0x84e4('0x21')](0x194);}return _0x36bba8;};}function handleError(_0x1c40df,_0xa29a59){_0xa29a59=_0xa29a59||0x1f4;return function(_0x4460ac){logger['error'](_0x4460ac['stack']);if(_0x4460ac[_0x84e4('0x2f')]){delete _0x4460ac[_0x84e4('0x2f')];}_0x1c40df[_0x84e4('0x22')](_0xa29a59)[_0x84e4('0x30')](_0x4460ac);};}function getInteractionUsers(_0x275766,_0x1edbe4){return new BPromise(function(_0x4a917a,_0x4d1335){try{if(_0x1edbe4[_0x275766['id']]){_0x275766[_0x84e4('0x31')]=_[_0x84e4('0x32')](_0x1edbe4[_0x275766['id']],function(_0x1dae9e){return{'id':_0x1dae9e['id'],'fullname':_0x1dae9e[_0x84e4('0x33')]};});}}catch(_0x32f732){_0x4d1335(_0x32f732);}_0x4a917a(_0x275766);});}function getInteractionTags(_0x2e86f1,_0x4c3a92){return new BPromise(function(_0x360d65,_0x8761dd){try{if(_0x2e86f1[_0x84e4('0x34')]){_0x2e86f1[_0x84e4('0x35')]=[];_0x2e86f1[_0x84e4('0x34')][_0x84e4('0x36')](',')[_0x84e4('0x37')](function(_0x2512c4){_0x2e86f1['Tags'][_0x84e4('0x38')](_0x4c3a92[_0x2512c4]);});}delete _0x2e86f1[_0x84e4('0x34')];}catch(_0x568d41){_0x8761dd(_0x568d41);}_0x360d65(_0x2e86f1);});}function updateSmsInteraction(_0x3f8a07,_0x1130b1,_0x3853d3){return new BPromise(function(_0x2fba7f,_0x428823){return getInteractionUsers(_0x3f8a07,_0x3853d3)[_0x84e4('0x2e')](function(_0x1f6f52){return getInteractionTags(_0x1f6f52,_0x1130b1);})['then'](function(_0x2fd9dc){_0x2fba7f(_0x2fd9dc);})['catch'](function(_0x70789a){_0x428823(_0x70789a);});});}exports[_0x84e4('0x39')]=function(_0x4bdf6f,_0x5627a6){var _0x2307ab={},_0x54f640={},_0x30aecd={'count':0x0,'rows':[]};var _0x14bb1e=_[_0x84e4('0x32')](db[_0x84e4('0x3a')][_0x84e4('0x3b')],function(_0x426b39){return{'name':_0x426b39[_0x84e4('0x3c')],'type':_0x426b39[_0x84e4('0x3d')][_0x84e4('0x3e')]};});_0x54f640[_0x84e4('0x3f')]=_[_0x84e4('0x32')](_0x14bb1e,'name');_0x54f640['query']=_[_0x84e4('0x40')](_0x4bdf6f[_0x84e4('0x41')]);_0x54f640[_0x84e4('0x42')]=_['intersection'](_0x54f640[_0x84e4('0x3f')],_0x54f640[_0x84e4('0x41')]);_0x2307ab['attributes']=_['intersection'](_0x54f640[_0x84e4('0x3f')],qs[_0x84e4('0x43')](_0x4bdf6f[_0x84e4('0x41')][_0x84e4('0x43')]));_0x2307ab[_0x84e4('0x44')]=_0x2307ab['attributes'][_0x84e4('0x45')]?_0x2307ab[_0x84e4('0x44')]:_0x54f640[_0x84e4('0x3f')];if(!_0x4bdf6f[_0x84e4('0x41')][_0x84e4('0x46')](_0x84e4('0x47'))){_0x2307ab[_0x84e4('0x26')]=qs['limit'](_0x4bdf6f[_0x84e4('0x41')][_0x84e4('0x26')]);_0x2307ab[_0x84e4('0x28')]=qs[_0x84e4('0x28')](_0x4bdf6f[_0x84e4('0x41')]['offset']);}_0x2307ab[_0x84e4('0x48')]=qs[_0x84e4('0x49')](_0x4bdf6f[_0x84e4('0x41')][_0x84e4('0x49')]);_0x2307ab['where']=qs[_0x84e4('0x42')](_['pick'](_0x4bdf6f[_0x84e4('0x41')],_0x54f640[_0x84e4('0x42')]),_0x14bb1e);var _0x3fc36b=[];var _0x2bcbd9=squel[_0x84e4('0x4a')]()['field']('id')[_0x84e4('0x4b')]('name')[_0x84e4('0x4b')](_0x84e4('0x4c'))[_0x84e4('0x4d')](_0x84e4('0x4e'));var _0x361ac5=squel['select']()[_0x84e4('0x4b')](_0x84e4('0x4f'))[_0x84e4('0x4b')](_0x84e4('0x50'))[_0x84e4('0x4b')](_0x84e4('0x51'))[_0x84e4('0x4d')]('user_has_sms_interactions','ui')[_0x84e4('0x52')](_0x84e4('0x53'),'u',_0x84e4('0x54'));var _0x409bb7=squel[_0x84e4('0x4a')]()[_0x84e4('0x4d')](_0x84e4('0x55'),'i')['left_join'](_0x84e4('0x56'),'c',_0x84e4('0x57'))[_0x84e4('0x52')](_0x84e4('0x53'),'o',_0x84e4('0x58'))[_0x84e4('0x52')](_0x84e4('0x59'),'a',_0x84e4('0x5a'))[_0x84e4('0x52')](_0x84e4('0x5b'),'me','me.SmsInteractionId\x20=\x20i.id')['left_join'](_0x84e4('0x5c'),'it',_0x84e4('0x5d'))[_0x84e4('0x52')](_0x84e4('0x4e'),'t',_0x84e4('0x5e'));var _0x1e0aac=squel[_0x84e4('0x5f')]();var _0x1e378a=[];var _0x3e1892=squel[_0x84e4('0x5f')]();var _0x27b832;if(_0x4bdf6f[_0x84e4('0x41')]['search']){_0x27b832=as[_0x84e4('0x60')](_0x4bdf6f[_0x84e4('0x41')][_0x84e4('0x61')]);var _0x2b7049=_0x27b832[_0x84e4('0x62')];for(var _0x2650a1=0x0;_0x2650a1<_0x27b832[_0x84e4('0x63')][_0x84e4('0x45')];_0x2650a1++){var _0x3504b3=_0x27b832[_0x84e4('0x63')][_0x2650a1];var _0x1db47c='i';var _0x4e768d=_[_0x84e4('0x64')](_0x14bb1e,[_0x84e4('0x2f'),_0x3504b3[_0x84e4('0x4b')]]);if(!_0x4e768d){switch(_0x3504b3[_0x84e4('0x4b')]){case _0x84e4('0x65'):if(_0x3504b3[_0x84e4('0x66')]==0x1){_0x409bb7[_0x84e4('0x67')]('`'+_0x3504b3[_0x84e4('0x4b')]+_0x84e4('0x68'));}else{_0x409bb7[_0x84e4('0x67')]('`'+_0x3504b3[_0x84e4('0x4b')]+_0x84e4('0x69'));}break;case _0x84e4('0x6a'):if(_0x3504b3[_0x84e4('0x6b')]===_0x84e4('0x6c')){if(_0x3504b3[_0x84e4('0x66')][_0x84e4('0x36')]('\x20')['length']>0x1){_0x1e0aac[_0x2b7049]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x84e4('0x6d')](_0x3504b3['value']),null);}else{var _0x59e8c7='%'+_0x3504b3[_0x84e4('0x66')]+'%';_0x1e0aac[_0x2b7049](_0x84e4('0x6e'),_0x59e8c7,_0x59e8c7,_0x59e8c7);}}else{_0x4e768d=_[_0x84e4('0x64')](_0x14bb1e,[_0x84e4('0x2f'),'ContactId']);_0x3504b3[_0x84e4('0x4b')]='ContactId';_0x208e63=as[_0x84e4('0x6f')](_0x1db47c,_0x4e768d['type'],_0x3504b3);_0x1e0aac[_0x2b7049](_0x208e63[_0x84e4('0x70')],_0x208e63[_0x84e4('0x66')][_0x84e4('0x71')],_0x208e63[_0x84e4('0x66')]['end']);}break;case _0x84e4('0x72'):var _0x1be8f8=_0x3504b3['value'][_0x84e4('0x36')](',')['map'](function(_0x318767){return Number(_0x318767);});_0x1be8f8[_0x84e4('0x37')](function(_0x234d63){_0x3e1892['or'](_0x84e4('0x73'),'%,'+_0x234d63+',%');});_0x1e378a=_[_0x84e4('0x74')](_0x1e378a,_0x1be8f8);break;case _0x84e4('0x75'):if(_0x3504b3['operator']==='$substring'){_0x1e0aac[_0x2b7049](_0x84e4('0x76'),'%'+_0x3504b3[_0x84e4('0x66')]+'%',null);}else{_0x4e768d=_[_0x84e4('0x64')](_0x14bb1e,['name','UserId']);_0x3504b3[_0x84e4('0x4b')]='UserId';_0x208e63=as['buildExpression'](_0x1db47c,_0x4e768d[_0x84e4('0x3d')],_0x3504b3);_0x1e0aac[_0x2b7049](_0x208e63[_0x84e4('0x70')],_0x208e63[_0x84e4('0x66')][_0x84e4('0x71')],_0x208e63['value'][_0x84e4('0x23')]);}break;case _0x84e4('0x77'):_0x208e63=as[_0x84e4('0x6f')]('me',null,_0x3504b3);_0x1e0aac[_0x2b7049](_0x208e63['text'],_0x208e63[_0x84e4('0x66')][_0x84e4('0x71')],_0x208e63[_0x84e4('0x66')]['end']);break;}}else{var _0x208e63=as['buildExpression'](_0x1db47c,_0x4e768d[_0x84e4('0x3d')],_0x3504b3);_0x1e0aac[_0x2b7049](_0x208e63[_0x84e4('0x70')],_0x208e63[_0x84e4('0x66')][_0x84e4('0x71')],_0x208e63[_0x84e4('0x66')][_0x84e4('0x23')]);}}}else{var _0x2cf929=_(_0x4bdf6f[_0x84e4('0x41')])['keys']()['map'](function(_0x1c8271){return _[_0x84e4('0x78')](_0x14bb1e,[_0x84e4('0x2f'),_0x1c8271])?_0x1c8271:undefined;})[_0x84e4('0x79')]()[_0x84e4('0x66')]();if(!_[_0x84e4('0x7a')](_0x2cf929)){_0x2cf929[_0x84e4('0x37')](function(_0x4cd278){if(_0x4cd278===_0x84e4('0x7b')){_0x409bb7[_0x84e4('0x7c')](_0x84e4('0x7d'),[][_0x84e4('0x7e')](_0x4bdf6f[_0x84e4('0x41')][_0x4cd278]));}else if(_0x4cd278===_0x84e4('0x7f')){var _0x3b93ec=JSON[_0x84e4('0x80')](_0x4bdf6f[_0x84e4('0x41')][_0x4cd278])[_0x84e4('0x81')];var _0x4f3722=JSON['parse'](_0x4bdf6f[_0x84e4('0x41')][_0x4cd278])[_0x84e4('0x82')];_0x409bb7[_0x84e4('0x7c')](_0x84e4('0x83'),_0x3b93ec,_0x4f3722);}else{if(_0x4bdf6f[_0x84e4('0x41')][_0x4cd278]===_0x84e4('0x84')){_0x409bb7['where']('i.'+_0x4cd278+_0x84e4('0x85'));}else{_0x409bb7[_0x84e4('0x7c')]('i.'+_0x4cd278+_0x84e4('0x86'),_0x4bdf6f[_0x84e4('0x41')][_0x4cd278]);}}});}if(_0x4bdf6f[_0x84e4('0x41')][_0x84e4('0x87')]){if(_0x4bdf6f['query'][_0x84e4('0x87')]==0x1){_0x409bb7[_0x84e4('0x67')]('`unreadMessages`\x20=\x200');}else{_0x409bb7[_0x84e4('0x67')](_0x84e4('0x88'));}}if(_0x4bdf6f[_0x84e4('0x41')][_0x84e4('0x89')]){_0x1e378a=_[_0x84e4('0x8a')](_0x4bdf6f['query'][_0x84e4('0x89')])?_0x4bdf6f[_0x84e4('0x41')][_0x84e4('0x89')]:new Array(_0x4bdf6f[_0x84e4('0x41')]['tag']);_0x1e378a[_0x84e4('0x37')](function(_0x245420){_0x3e1892['or'](_0x84e4('0x73'),'%,'+_0x245420+',%');});}if(_0x4bdf6f[_0x84e4('0x41')][_0x84e4('0x8b')]){var _0x3b8a0d=_0x4bdf6f['query']['filter'][_0x84e4('0x8c')]('\x5c','\x5c\x5c')[_0x84e4('0x8c')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x3b8a0d)){_0x1e0aac['or'](_0x84e4('0x8d'),_0x3b8a0d+'%')['or'](_0x84e4('0x8e'),_0x3b8a0d+'%');}else{_0x1e0aac['or'](_0x84e4('0x8f'),qs['getFullTextValue'](_0x3b8a0d))['or'](_0x84e4('0x90'),_0x3b8a0d+'%');}}}_0x409bb7['where'](_0x1e0aac);_0x409bb7[_0x84e4('0x91')]('i.id');var _0x4eb0d7={'type':db[_0x84e4('0x92')][_0x84e4('0x93')][_0x84e4('0x94')],'raw':!![]};var _0xb13e26=_0x409bb7['clone']();_0xb13e26[_0x84e4('0x4b')](_0x84e4('0x95'));_0xb13e26['field'](_0x84e4('0x96'),_0x84e4('0x65'));if(_0x2307ab[_0x84e4('0x48')]){_0x2307ab['order'][_0x84e4('0x37')](function(_0x2e9aea){var _0x59c953=_0x2e9aea[0x0]===_0x84e4('0x97')?_0x2e9aea[0x0]:'i.'+_0x2e9aea[0x0];_0x409bb7[_0x84e4('0x48')](_0x59c953,_0x2e9aea[0x1]===_0x84e4('0x98')?![]:!![]);});}if(!_['isEmpty'](_0x1e378a)){_0x409bb7[_0x84e4('0x67')](_0x3e1892);_0xb13e26['where'](_0x84e4('0x99'),_0x1e378a);}BPromise[_0x84e4('0x9a')]()[_0x84e4('0x2e')](function(){if(!_0x27b832){if(_0x4bdf6f['query'][_0x84e4('0x7b')])return;_0xb13e26[_0x84e4('0x7c')](_0x84e4('0x9b'));_0x409bb7[_0x84e4('0x7c')](_0x84e4('0x9b'));return;}if(_0x4bdf6f[_0x84e4('0x9c')][_0x84e4('0x9d')]!=='agent')return;return _0x4bdf6f[_0x84e4('0x9c')][_0x84e4('0x9e')]({'attributes':['id'],'raw':!![]})['then'](function(_0x24bacf){if(_[_0x84e4('0x7a')](_0x24bacf)){_0xb13e26[_0x84e4('0x7c')]('i.SmsAccountId\x20IS\x20NULL');_0x409bb7[_0x84e4('0x7c')](_0x84e4('0x9f'));}else{_0xb13e26[_0x84e4('0x7c')](_0x84e4('0x7d'),_[_0x84e4('0x32')](_0x24bacf,'id'));_0x409bb7['where'](_0x84e4('0x7d'),_[_0x84e4('0x32')](_0x24bacf,'id'));}});})[_0x84e4('0x2e')](function(){if(_0x4bdf6f['user'][_0x84e4('0x9d')]===_0x84e4('0xa0')&&!_0x27b832&&!_0x4bdf6f[_0x84e4('0x41')][_0x84e4('0x7b')])return[];return db[_0x84e4('0xa1')][_0x84e4('0x41')](_0xb13e26[_0x84e4('0xa2')](),_0x4eb0d7);})[_0x84e4('0x2e')](function(_0x4efdaf){_0x30aecd[_0x84e4('0x27')]=_0x4efdaf['length'];if(_0x30aecd['count']===0x0)return[];return db[_0x84e4('0xa1')][_0x84e4('0x41')](_0x2bcbd9[_0x84e4('0xa2')](),_0x4eb0d7)[_0x84e4('0x2e')](function(_0x487bd1){_0x3fc36b=_[_0x84e4('0xa3')](_0x487bd1,'id');_0x4eb0d7=_[_0x84e4('0xa4')](_0x4eb0d7,{'model':db['SmsInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4bdf6f['query'][_0x84e4('0x43')]){_0x2307ab[_0x84e4('0x44')][_0x84e4('0x37')](function(_0x47a74f){_0x409bb7['field']('i.'+_0x47a74f);});}else{_0x409bb7['field'](_0x84e4('0x96'),_0x84e4('0x65'));_0x409bb7[_0x84e4('0x4b')](_0x84e4('0xa5'),_0x84e4('0xa6'));_0x409bb7[_0x84e4('0x4b')](_0x84e4('0xa7'),'Account.mandatoryDisposition');_0x409bb7[_0x84e4('0x4b')](_0x84e4('0xa8'),_0x84e4('0x97'));_0x409bb7[_0x84e4('0x4b')](_0x84e4('0xa9'));_0x409bb7[_0x84e4('0x4b')](_0x84e4('0xaa'),_0x84e4('0xab'));_0x409bb7['field'](_0x84e4('0xac'),_0x84e4('0xad'));_0x409bb7['field'](_0x84e4('0xae'),_0x84e4('0xaf'));_0x409bb7[_0x84e4('0x4b')](_0x84e4('0xb0'),_0x84e4('0xb1'));_0x409bb7[_0x84e4('0x4b')](_0x84e4('0xb2'),'Contact.mobile');_0x409bb7[_0x84e4('0x4b')](_0x84e4('0xb3'),_0x84e4('0xb4'));_0x409bb7[_0x84e4('0x4b')](_0x84e4('0xb5'),'Owner.fullname');_0x409bb7[_0x84e4('0x4b')](_0x84e4('0xb6'),'Owner.internal');_0x409bb7[_0x84e4('0x4b')](_0x84e4('0xb7'),_0x84e4('0x34'));}if(_0x2307ab[_0x84e4('0x26')])_0x409bb7[_0x84e4('0x26')](_0x2307ab[_0x84e4('0x26')]);if(_0x2307ab[_0x84e4('0x28')])_0x409bb7[_0x84e4('0x28')](_0x2307ab[_0x84e4('0x28')]);return db[_0x84e4('0xa1')][_0x84e4('0x41')](_0x409bb7[_0x84e4('0xa2')](),_0x4eb0d7);})[_0x84e4('0x2e')](function(_0x17b11c){if(_0x17b11c[_0x84e4('0x45')]>0x0)_0x361ac5['where']('ui.SmsInteractionId\x20IN\x20?',_['map'](_0x17b11c,'id'));return db[_0x84e4('0xa1')]['query'](_0x361ac5[_0x84e4('0xa2')](),_0x4eb0d7)[_0x84e4('0x2e')](function(_0x1b02c2){var _0x5bfa10=_[_0x84e4('0xb8')](_0x1b02c2,'SmsInteractionId');var _0x578b76=[];_0x17b11c[_0x84e4('0x37')](function(_0x436111){_0x578b76[_0x84e4('0x38')](updateSmsInteraction(_0x436111,_0x3fc36b,_0x5bfa10));});return BPromise[_0x84e4('0xb9')](_0x578b76);});});})[_0x84e4('0x2e')](function(_0x2319c8){_0x30aecd['rows']=_0x2319c8;return _0x30aecd;})[_0x84e4('0x2e')](respondWithFilteredResult(_0x5627a6,_0x2307ab))[_0x84e4('0xba')](handleError(_0x5627a6,null));};exports[_0x84e4('0xbb')]=function(_0x2df39e,_0x72e50d){var _0x393641={'raw':![],'where':{'id':_0x2df39e[_0x84e4('0xbc')]['id']}},_0x5d08da={};_0x5d08da['model']=_[_0x84e4('0x40')](db[_0x84e4('0x3a')]['rawAttributes']);_0x5d08da[_0x84e4('0x41')]=_['keys'](_0x2df39e[_0x84e4('0x41')]);_0x5d08da['filters']=_[_0x84e4('0xbd')](_0x5d08da[_0x84e4('0x3f')],_0x5d08da[_0x84e4('0x41')]);_0x393641[_0x84e4('0x44')]=_['intersection'](_0x5d08da[_0x84e4('0x3f')],qs[_0x84e4('0x43')](_0x2df39e[_0x84e4('0x41')]['fields']));_0x393641[_0x84e4('0x44')]=_0x393641[_0x84e4('0x44')][_0x84e4('0x45')]?_0x393641[_0x84e4('0x44')]:_0x5d08da[_0x84e4('0x3f')];if(_0x2df39e['query'][_0x84e4('0xbe')]){_0x393641[_0x84e4('0xbf')]=[{'all':!![]}];}_0x393641=_[_0x84e4('0xa4')]({},_0x393641,_0x2df39e['options']);return db[_0x84e4('0x3a')][_0x84e4('0x64')](_0x393641)[_0x84e4('0x2e')](handleEntityNotFound(_0x72e50d,null))['then'](respondWithResult(_0x72e50d,null))[_0x84e4('0xba')](handleError(_0x72e50d,null));};exports[_0x84e4('0xc0')]=function(_0x456acc,_0x18a4fc){return db[_0x84e4('0x3a')][_0x84e4('0xc0')](_0x456acc[_0x84e4('0x77')],{})[_0x84e4('0x2e')](respondWithResult(_0x18a4fc,0xc9))[_0x84e4('0xba')](handleError(_0x18a4fc,null));};exports['update']=function(_0xfa5625,_0x49506b){if(_0xfa5625['body']['id']){delete _0xfa5625[_0x84e4('0x77')]['id'];}return db[_0x84e4('0x3a')][_0x84e4('0x64')]({'where':{'id':_0xfa5625[_0x84e4('0xbc')]['id']}})[_0x84e4('0x2e')](handleEntityNotFound(_0x49506b,null))[_0x84e4('0x2e')](saveUpdates(_0xfa5625[_0x84e4('0x77')],null))[_0x84e4('0x2e')](respondWithResult(_0x49506b,null))[_0x84e4('0xba')](handleError(_0x49506b,null));};exports['destroy']=function(_0x5a4583,_0x1b248c){return db[_0x84e4('0x3a')][_0x84e4('0x64')]({'where':{'id':_0x5a4583[_0x84e4('0xbc')]['id']}})[_0x84e4('0x2e')](handleEntityNotFound(_0x1b248c,null))[_0x84e4('0x2e')](removeEntity(_0x1b248c,null))[_0x84e4('0xba')](handleError(_0x1b248c,null));};exports['describe']=function(_0x1c3116,_0x2bfb17){return db[_0x84e4('0x3a')][_0x84e4('0xc1')]()[_0x84e4('0x2e')](respondWithResult(_0x2bfb17,null))['catch'](handleError(_0x2bfb17,null));};exports['addMessage']=function(_0x5c4138,_0x4150c9,_0x993de7){return db['SmsMessage'][_0x84e4('0x64')]({'where':{'id':_0x5c4138[_0x84e4('0xbc')]['id']}})[_0x84e4('0x2e')](handleEntityNotFound(_0x4150c9,null))['then'](function(_0x560329){if(_0x560329){return _0x560329[_0x84e4('0xc2')](_0x5c4138[_0x84e4('0x77')]['ids'],_[_0x84e4('0xc3')](_0x5c4138[_0x84e4('0x77')],[_0x84e4('0xc4'),'id'])||{});}})['then'](respondWithResult(_0x4150c9,null))[_0x84e4('0xba')](handleError(_0x4150c9,null));};exports[_0x84e4('0xc5')]=function(_0xec4098,_0x217623,_0x383b1b){var _0xa7bff7={'raw':![],'where':{}};var _0x4c8d6a={};var _0x402e8f={'count':0x0,'rows':[]};return db[_0x84e4('0x3a')]['findOne']({'where':{'id':_0xec4098[_0x84e4('0xbc')]['id']}})[_0x84e4('0x2e')](handleEntityNotFound(_0x217623,null))[_0x84e4('0x2e')](function(_0x1351c8){if(_0x1351c8){_0x4c8d6a[_0x84e4('0x3f')]=_[_0x84e4('0x40')](db[_0x84e4('0xc6')][_0x84e4('0x3b')]);_0x4c8d6a[_0x84e4('0x41')]=_['keys'](_0xec4098['query']);_0x4c8d6a[_0x84e4('0x42')]=_[_0x84e4('0xbd')](_0x4c8d6a[_0x84e4('0x3f')],_0x4c8d6a[_0x84e4('0x41')]);_0xa7bff7['attributes']=_[_0x84e4('0xbd')](_0x4c8d6a['model'],qs[_0x84e4('0x43')](_0xec4098[_0x84e4('0x41')][_0x84e4('0x43')]));_0xa7bff7['attributes']=_0xa7bff7[_0x84e4('0x44')]['length']?_0xa7bff7['attributes']:_0x4c8d6a[_0x84e4('0x3f')];if(!_0xec4098[_0x84e4('0x41')]['hasOwnProperty'](_0x84e4('0x47'))){_0xa7bff7[_0x84e4('0x26')]=qs[_0x84e4('0x26')](_0xec4098['query'][_0x84e4('0x26')]);_0xa7bff7[_0x84e4('0x28')]=qs[_0x84e4('0x28')](_0xec4098['query']['offset']);}_0xa7bff7[_0x84e4('0x48')]=qs[_0x84e4('0x49')](_0xec4098[_0x84e4('0x41')]['sort']);_0xa7bff7[_0x84e4('0x7c')]=qs[_0x84e4('0x42')](_['pick'](_0xec4098[_0x84e4('0x41')],_0x4c8d6a[_0x84e4('0x42')]));_0xa7bff7[_0x84e4('0x7c')]['SmsInteractionId']=_0x1351c8['id'];if(_0xec4098[_0x84e4('0x41')][_0x84e4('0x8b')]){_0xa7bff7['where']=_['merge'](_0xa7bff7['where'],{'$or':_[_0x84e4('0x32')](_0xa7bff7[_0x84e4('0x44')],function(_0x4336c2){var _0x424766={};_0x424766[_0x4336c2]={'$like':'%'+_0xec4098[_0x84e4('0x41')][_0x84e4('0x8b')]+'%'};return _0x424766;})});}if(_0xec4098['query'][_0x84e4('0x81')]){var _0x14e6cf=_0xec4098[_0x84e4('0x41')][_0x84e4('0x81')][_0x84e4('0x36')](',');var _0x3dc951={};_0x3dc951[_0x14e6cf[0x0]]={'$gte':moment(_0x14e6cf[0x1])[_0x84e4('0xc7')]('YYYY-MM-DD\x20HH:mm:ss')};_0xa7bff7[_0x84e4('0x7c')]=_[_0x84e4('0xa4')](_0xa7bff7[_0x84e4('0x7c')],_0x3dc951);}_0xa7bff7=_['merge']({},_0xa7bff7,_0xec4098[_0x84e4('0xc8')]);return db['SmsMessage'][_0x84e4('0x27')]({'where':_0xa7bff7[_0x84e4('0x7c')]})[_0x84e4('0x2e')](function(_0x2d702e){_0x402e8f['count']=_0x2d702e;if(_0xec4098['query'][_0x84e4('0xbe')]){_0xa7bff7[_0x84e4('0xbf')]=[{'all':!![]}];}return db['SmsMessage']['findAll'](_0xa7bff7);})[_0x84e4('0x2e')](function(_0x580327){_0x402e8f[_0x84e4('0xc9')]=_0x580327;return _0x402e8f;});}})['then'](respondWithFilteredResult(_0x217623,_0xa7bff7))[_0x84e4('0xba')](handleError(_0x217623,null));};exports[_0x84e4('0xca')]=function(_0x59d66b,_0x2ae213,_0x2e917d){return db[_0x84e4('0x3a')][_0x84e4('0x64')]({'where':{'id':_0x59d66b[_0x84e4('0xbc')]['id']}})[_0x84e4('0x2e')](handleEntityNotFound(_0x2ae213,null))[_0x84e4('0x2e')](function(_0x4cd4ec){if(_0x4cd4ec){return _0x4cd4ec[_0x84e4('0xcb')](_0x59d66b[_0x84e4('0x77')][_0x84e4('0xc4')],_[_0x84e4('0xc3')](_0x59d66b['body'],[_0x84e4('0xc4'),'id'])||{})['spread'](function(){return db[_0x84e4('0x72')][_0x84e4('0xcc')]({'attributes':['id',_0x84e4('0x2f'),_0x84e4('0x4c')],'where':{'id':_0x59d66b['body'][_0x84e4('0xc4')]}});})[_0x84e4('0x2e')](function(_0x359442){socket['emit']('smsInteractionTags:save',{'id':Number(_0x59d66b[_0x84e4('0xbc')]['id']),'tags':_0x359442||[]});return{'id':Number(_0x59d66b[_0x84e4('0xbc')]['id']),'tags':_0x359442||[]};});}})[_0x84e4('0x2e')](respondWithResult(_0x2ae213,null))[_0x84e4('0xba')](handleError(_0x2ae213,null));};exports['removeTags']=function(_0x59a431,_0x5c2112,_0x49b94d){return db[_0x84e4('0x3a')][_0x84e4('0x64')]({'where':{'id':_0x59a431['params']['id']}})[_0x84e4('0x2e')](handleEntityNotFound(_0x5c2112,null))['then'](function(_0x3d6d61){if(_0x3d6d61){return _0x3d6d61[_0x84e4('0xcd')](_0x59a431[_0x84e4('0x41')][_0x84e4('0xc4')]);}})[_0x84e4('0x2e')](respondWithStatusCode(_0x5c2112,null))[_0x84e4('0xba')](handleError(_0x5c2112,null));};exports[_0x84e4('0xce')]=function(_0x4717bf,_0x1d2a2d){var _0x180b7a=moment()['unix']()[_0x84e4('0xa2')]();var _0x51ba04=path[_0x84e4('0xcf')](config[_0x84e4('0xd0')],_0x84e4('0xd1'),_0x84e4('0xd2'),_0x84e4('0xd3'));var _0x5f420a=path['join'](config[_0x84e4('0xd0')],_0x84e4('0xd1'),_0x84e4('0xd2'),'attachments');var _0x509c1e=path[_0x84e4('0xcf')](_0x51ba04,_0x180b7a);var _0x2e48e3=util['format']('transcript-%d-%s.zip',_0x4717bf[_0x84e4('0xbc')]['id'],_0x180b7a);var _0x507733=path['join'](_0x51ba04,_0x2e48e3);var _0x32943b=[];_0x32943b['push']({'model':db[_0x84e4('0x75')],'as':_0x84e4('0x75'),'attributes':['id',_0x84e4('0x33')],'raw':!![]});_0x32943b[_0x84e4('0x38')]({'model':db[_0x84e4('0xd4')],'as':_0x84e4('0x6a'),'attributes':['id',_0x84e4('0xd5'),'lastName'],'raw':!![]});var _0x477e86=[{'model':db['SmsMessage'],'as':_0x84e4('0xd6'),'attributes':['id','body',_0x84e4('0x7f'),_0x84e4('0xd7'),_0x84e4('0xd8'),_0x84e4('0x87')],'include':_0x32943b}];_0x477e86[_0x84e4('0x38')]({'model':db[_0x84e4('0xd9')],'as':'Account','attributes':['id',_0x84e4('0x2f')]});_0x477e86[_0x84e4('0x38')]({'model':db['User'],'as':'Owner','attributes':['id',_0x84e4('0x33')]});return db['SmsInteraction'][_0x84e4('0x64')]({'where':{'id':_0x4717bf[_0x84e4('0xbc')]['id']},'include':_0x477e86})['then'](handleEntityNotFound(_0x1d2a2d,null))[_0x84e4('0x2e')](function(_0x15e9e8){if(_0x15e9e8){var _0x1a8cef=_0x15e9e8['get']({'plain':!![]});fs[_0x84e4('0xda')](_0x509c1e);var _0x3e7f6b={'channel':_0x84e4('0xdb'),'account':_0x1a8cef[_0x84e4('0xdc')]['name'],'agent':_0x1a8cef['Owner']?_0x1a8cef[_0x84e4('0xdd')][_0x84e4('0x33')]:_0x84e4('0xde'),'createdAt':moment(_0x1a8cef[_0x84e4('0x7f')])[_0x84e4('0xc7')](_0x84e4('0xdf'))[_0x84e4('0xa2')](),'closedAt':_0x1a8cef[_0x84e4('0xe0')]?moment(_0x1a8cef[_0x84e4('0xe1')])[_0x84e4('0xc7')](_0x84e4('0xdf'))['toString']():'','disposition':_0x1a8cef[_0x84e4('0xe2')],'messages':_(_0x1a8cef['Messages'])[_0x84e4('0x8b')]({'secret':![]})[_0x84e4('0x32')](function(_0xa970e8){return{'date':moment(_0xa970e8[_0x84e4('0x7f')])[_0x84e4('0xc7')](_0x84e4('0xdf'))[_0x84e4('0xa2')](),'sender':_0xa970e8['direction']==='out'?_0xa970e8['User']?_0xa970e8['User'][_0x84e4('0x33')]:_0x84e4('0xe3'):_0xa970e8[_0x84e4('0x6a')]['firstName']+(_0xa970e8['Contact'][_0x84e4('0xe4')]?'\x20'+_0xa970e8[_0x84e4('0x6a')]['lastName']:''),'body':_0xa970e8[_0x84e4('0x77')],'direction':_0xa970e8[_0x84e4('0xd7')]==='out'?'A':'C','secret':_0xa970e8['secret'],'read':_0xa970e8['read']};})[_0x84e4('0x66')]()};return ejs['renderFile'](path[_0x84e4('0xcf')](config[_0x84e4('0xd0')],_0x84e4('0xd1'),_0x84e4('0xe5'),_0x84e4('0xe6')),{'interaction':_0x3e7f6b})[_0x84e4('0x2e')](function(_0x3d25e4){var _0x1d5bc5=path['join'](_0x509c1e,_0x84e4('0xe7')+_0x1a8cef['id']+'-'+_0x180b7a+_0x84e4('0xe8'));var _0x13016c={'path':_0x1d5bc5,'channel':_0x84e4('0xdb'),'interactionId':_0x1a8cef['id']};return pdf[_0x84e4('0xe9')](_0x3d25e4,_0x13016c);})[_0x84e4('0x2e')](function(){return new BPromise(function(_0xed4101,_0x50b2c6){zipdir(_0x509c1e,{'saveTo':_0x507733},function(_0x465075,_0x337a1e){if(_0x465075)return _0x50b2c6(_0x465075);return _0xed4101(_0x337a1e);});})[_0x84e4('0x2e')](function(){return new BPromise(function(_0x49ea66,_0x2e0707){rimraf(_0x509c1e,function(_0x80bec0){if(_0x80bec0)_0x2e0707(_0x80bec0);return _0x49ea66();});});})[_0x84e4('0x2e')](function(){return _0x1d2a2d[_0x84e4('0xce')](_0x507733,_0x2e48e3,function(_0x19204a){if(_0x19204a){console['log'](_0x84e4('0xea'),_0x19204a);}else{fs['unlinkSync'](_0x507733);}});});});}else{return _0x1d2a2d['sendStatus'](0xc8);}})[_0x84e4('0xba')](handleError(_0x1d2a2d,null));}; \ No newline at end of file +var _0x9d2e=['a.id\x20=\x20i.SmsAccountId','me.SmsInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','keys','some','compact','isEmpty','SmsAccountId','i.SmsAccountId\x20IN\x20?','concat','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\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)','contactName','DESC','resolve','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','agent','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','sequelize','toString','keyBy','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','Contact.fax','Owner.fullname','o.internal','Owner.internal','ui.SmsInteractionId\x20IN\x20?','groupBy','all','catch','params','rawAttributes','includeAll','include','merge','options','create','update','describe','addMessage','SmsMessage','ids','omit','getMessages','findOne','SmsInteractionId','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','setTags','spread','findAll','smsInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','attachments','format','transcript-%d-%s.zip','CmContact','firstName','lastName','Messages','createdAt','SmsAccount','Account','Owner','get','Sms','N.A.','closed','closedAt','disposition','direction','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/export/pdf','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','then','destroy','error','name','send','fullname','TagIds','split','forEach','Tags','push','index','map','SmsInteraction','fieldName','type','model','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','select','field','color','from','tools_tags','u.id','user_has_sms_interactions','left_join','users','u.id\x20=\x20ui.UserId','sms_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','sms_accounts'];(function(_0x2d6c35,_0x281143){var _0x11a97d=function(_0x5e98a8){while(--_0x5e98a8){_0x2d6c35['push'](_0x2d6c35['shift']());}};_0x11a97d(++_0x281143);}(_0x9d2e,0x97));var _0xe9d2=function(_0x46cfcf,_0x23dfed){_0x46cfcf=_0x46cfcf-0x0;var _0x31cabd=_0x9d2e[_0x46cfcf];return _0x31cabd;};'use strict';var emlformat=require(_0xe9d2('0x0'));var rimraf=require(_0xe9d2('0x1'));var zipdir=require(_0xe9d2('0x2'));var jsonpatch=require(_0xe9d2('0x3'));var rp=require(_0xe9d2('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe9d2('0x5'));var util=require(_0xe9d2('0x6'));var path=require(_0xe9d2('0x7'));var sox=require(_0xe9d2('0x8'));var csv=require('to-csv');var ejs=require(_0xe9d2('0x9'));var fs=require('fs');var fs_extra=require(_0xe9d2('0xa'));var _=require(_0xe9d2('0xb'));var squel=require(_0xe9d2('0xc'));var crypto=require(_0xe9d2('0xd'));var jsforce=require(_0xe9d2('0xe'));var deskjs=require(_0xe9d2('0xf'));var toCsv=require(_0xe9d2('0x10'));var querystring=require(_0xe9d2('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe9d2('0x12'));var qs=require(_0xe9d2('0x13'));var as=require('../../components/parsers/advancedSearch');var pdf=require(_0xe9d2('0x14'));var hardwareService=require(_0xe9d2('0x15'));var logger=require(_0xe9d2('0x16'))('api');var utils=require('../../config/utils');var config=require(_0xe9d2('0x17'));var licenseUtil=require(_0xe9d2('0x18'));var db=require(_0xe9d2('0x19'))['db'];config[_0xe9d2('0x1a')]=_[_0xe9d2('0x1b')](config[_0xe9d2('0x1a')],{'host':_0xe9d2('0x1c'),'port':0x18eb});var socket=require(_0xe9d2('0x1d'))(new Redis(config[_0xe9d2('0x1a')]));require('./smsInteraction.socket')[_0xe9d2('0x1e')](socket);function respondWithStatusCode(_0x384c74,_0x2bfbec){_0x2bfbec=_0x2bfbec||0xcc;return function(_0x3c94db){if(_0x3c94db){return _0x384c74[_0xe9d2('0x1f')](_0x2bfbec);}return _0x384c74[_0xe9d2('0x20')](_0x2bfbec)[_0xe9d2('0x21')]();};}function respondWithResult(_0x50eae8,_0x4ae885){_0x4ae885=_0x4ae885||0xc8;return function(_0x3d4226){if(_0x3d4226){return _0x50eae8[_0xe9d2('0x20')](_0x4ae885)['json'](_0x3d4226);}};}function respondWithFilteredResult(_0x391ddf,_0x232fef){return function(_0x2e17b2){if(_0x2e17b2){var _0x5b5341=typeof _0x232fef[_0xe9d2('0x22')]===_0xe9d2('0x23')&&typeof _0x232fef[_0xe9d2('0x24')]==='undefined';var _0x56db63=_0x2e17b2[_0xe9d2('0x25')];var _0x1a89c5=_0x5b5341?0x0:_0x232fef[_0xe9d2('0x22')];var _0x5d8d41=_0x5b5341?_0x2e17b2[_0xe9d2('0x25')]:_0x232fef[_0xe9d2('0x22')]+_0x232fef['limit'];var _0x1eed75;if(_0x5d8d41>=_0x56db63){_0x5d8d41=_0x56db63;_0x1eed75=0xc8;}else{_0x1eed75=0xce;}_0x391ddf['status'](_0x1eed75);return _0x391ddf[_0xe9d2('0x26')](_0xe9d2('0x27'),_0x1a89c5+'-'+_0x5d8d41+'/'+_0x56db63)[_0xe9d2('0x28')](_0x2e17b2);}return null;};}function patchUpdates(_0x299edb){return function(_0x386db3){try{jsonpatch[_0xe9d2('0x29')](_0x386db3,_0x299edb,!![]);}catch(_0x46709c){return BPromise['reject'](_0x46709c);}return _0x386db3[_0xe9d2('0x2a')]();};}function saveUpdates(_0xa04c67,_0x294fe3){return function(_0x2e4e09){if(_0x2e4e09){return _0x2e4e09['update'](_0xa04c67)[_0xe9d2('0x2b')](function(_0x2c4907){return _0x2c4907;});}return null;};}function removeEntity(_0x685133,_0x53d5de){return function(_0x55b26d){if(_0x55b26d){return _0x55b26d[_0xe9d2('0x2c')]()[_0xe9d2('0x2b')](function(){_0x685133[_0xe9d2('0x20')](0xcc)[_0xe9d2('0x21')]();});}};}function handleEntityNotFound(_0x456412,_0x53387f){return function(_0x211638){if(!_0x211638){_0x456412[_0xe9d2('0x1f')](0x194);}return _0x211638;};}function handleError(_0x4cbb03,_0xdc4f4b){_0xdc4f4b=_0xdc4f4b||0x1f4;return function(_0x4c797c){logger[_0xe9d2('0x2d')](_0x4c797c['stack']);if(_0x4c797c['name']){delete _0x4c797c[_0xe9d2('0x2e')];}_0x4cbb03[_0xe9d2('0x20')](_0xdc4f4b)[_0xe9d2('0x2f')](_0x4c797c);};}function getInteractionUsers(_0x223950,_0x57f8b9){return new BPromise(function(_0xf50f9b,_0x35e919){try{if(_0x57f8b9[_0x223950['id']]){_0x223950['Users']=_['map'](_0x57f8b9[_0x223950['id']],function(_0x4a12bb){return{'id':_0x4a12bb['id'],'fullname':_0x4a12bb[_0xe9d2('0x30')]};});}}catch(_0x155527){_0x35e919(_0x155527);}_0xf50f9b(_0x223950);});}function getInteractionTags(_0x1371cb,_0x2afe59){return new BPromise(function(_0x43311f,_0x3ab2f1){try{if(_0x1371cb['TagIds']){_0x1371cb['Tags']=[];_0x1371cb[_0xe9d2('0x31')][_0xe9d2('0x32')](',')[_0xe9d2('0x33')](function(_0x4be664){_0x1371cb[_0xe9d2('0x34')][_0xe9d2('0x35')](_0x2afe59[_0x4be664]);});}delete _0x1371cb[_0xe9d2('0x31')];}catch(_0xb2b11f){_0x3ab2f1(_0xb2b11f);}_0x43311f(_0x1371cb);});}function updateSmsInteraction(_0x447c74,_0x2a0ef6,_0x1e7c40){return new BPromise(function(_0x4d3bca,_0x205157){return getInteractionUsers(_0x447c74,_0x1e7c40)[_0xe9d2('0x2b')](function(_0x1b8697){return getInteractionTags(_0x1b8697,_0x2a0ef6);})[_0xe9d2('0x2b')](function(_0x3d205a){_0x4d3bca(_0x3d205a);})['catch'](function(_0x5704f5){_0x205157(_0x5704f5);});});}exports[_0xe9d2('0x36')]=function(_0xbb5d98,_0x114fea){var _0xebb6d8={},_0x50a394={},_0x5089c0={'count':0x0,'rows':[]};var _0x529960=_[_0xe9d2('0x37')](db[_0xe9d2('0x38')]['rawAttributes'],function(_0x27ec5a){return{'name':_0x27ec5a[_0xe9d2('0x39')],'type':_0x27ec5a[_0xe9d2('0x3a')]['key']};});_0x50a394[_0xe9d2('0x3b')]=_[_0xe9d2('0x37')](_0x529960,'name');_0x50a394[_0xe9d2('0x3c')]=_['keys'](_0xbb5d98[_0xe9d2('0x3c')]);_0x50a394[_0xe9d2('0x3d')]=_[_0xe9d2('0x3e')](_0x50a394['model'],_0x50a394['query']);_0xebb6d8['attributes']=_[_0xe9d2('0x3e')](_0x50a394[_0xe9d2('0x3b')],qs[_0xe9d2('0x3f')](_0xbb5d98[_0xe9d2('0x3c')][_0xe9d2('0x3f')]));_0xebb6d8['attributes']=_0xebb6d8[_0xe9d2('0x40')][_0xe9d2('0x41')]?_0xebb6d8[_0xe9d2('0x40')]:_0x50a394[_0xe9d2('0x3b')];if(!_0xbb5d98['query']['hasOwnProperty'](_0xe9d2('0x42'))){_0xebb6d8[_0xe9d2('0x24')]=qs[_0xe9d2('0x24')](_0xbb5d98[_0xe9d2('0x3c')][_0xe9d2('0x24')]);_0xebb6d8['offset']=qs[_0xe9d2('0x22')](_0xbb5d98['query'][_0xe9d2('0x22')]);}_0xebb6d8[_0xe9d2('0x43')]=qs[_0xe9d2('0x44')](_0xbb5d98[_0xe9d2('0x3c')][_0xe9d2('0x44')]);_0xebb6d8[_0xe9d2('0x45')]=qs[_0xe9d2('0x3d')](_[_0xe9d2('0x46')](_0xbb5d98[_0xe9d2('0x3c')],_0x50a394[_0xe9d2('0x3d')]),_0x529960);var _0x3ecc56=[];var _0x380c12=squel[_0xe9d2('0x47')]()[_0xe9d2('0x48')]('id')['field'](_0xe9d2('0x2e'))[_0xe9d2('0x48')](_0xe9d2('0x49'))[_0xe9d2('0x4a')](_0xe9d2('0x4b'));var _0x2b8527=squel['select']()[_0xe9d2('0x48')](_0xe9d2('0x4c'))[_0xe9d2('0x48')]('u.fullname')[_0xe9d2('0x48')]('ui.SmsInteractionId')[_0xe9d2('0x4a')](_0xe9d2('0x4d'),'ui')[_0xe9d2('0x4e')](_0xe9d2('0x4f'),'u',_0xe9d2('0x50'));var _0x1e3934=squel[_0xe9d2('0x47')]()[_0xe9d2('0x4a')](_0xe9d2('0x51'),'i')['left_join'](_0xe9d2('0x52'),'c',_0xe9d2('0x53'))[_0xe9d2('0x4e')](_0xe9d2('0x4f'),'o',_0xe9d2('0x54'))[_0xe9d2('0x4e')](_0xe9d2('0x55'),'a',_0xe9d2('0x56'))['left_join']('sms_messages','me',_0xe9d2('0x57'))[_0xe9d2('0x4e')]('sms_interaction_has_tags','it','it.SmsInteractionId\x20=\x20i.id')[_0xe9d2('0x4e')](_0xe9d2('0x4b'),'t',_0xe9d2('0x58'));var _0x34ed8b=squel[_0xe9d2('0x59')]();var _0x3e3a2e=[];var _0xa384ca=squel[_0xe9d2('0x59')]();var _0x1e837d;if(_0xbb5d98['query'][_0xe9d2('0x5a')]){_0x1e837d=as['parseSearch'](_0xbb5d98['query'][_0xe9d2('0x5a')]);var _0x4ed84c=_0x1e837d[_0xe9d2('0x5b')];for(var _0x39f060=0x0;_0x39f060<_0x1e837d[_0xe9d2('0x5c')][_0xe9d2('0x41')];_0x39f060++){var _0x1815ef=_0x1e837d[_0xe9d2('0x5c')][_0x39f060];var _0x21fe11='i';var _0x7f7b76=_[_0xe9d2('0x5d')](_0x529960,[_0xe9d2('0x2e'),_0x1815ef[_0xe9d2('0x48')]]);if(!_0x7f7b76){switch(_0x1815ef[_0xe9d2('0x48')]){case _0xe9d2('0x5e'):if(_0x1815ef[_0xe9d2('0x5f')]==0x1){_0x1e3934[_0xe9d2('0x60')]('`'+_0x1815ef[_0xe9d2('0x48')]+_0xe9d2('0x61'));}else{_0x1e3934[_0xe9d2('0x60')]('`'+_0x1815ef[_0xe9d2('0x48')]+_0xe9d2('0x62'));}break;case _0xe9d2('0x63'):if(_0x1815ef[_0xe9d2('0x64')]===_0xe9d2('0x65')){if(_0x1815ef[_0xe9d2('0x5f')]['split']('\x20')['length']>0x1){_0x34ed8b[_0x4ed84c](_0xe9d2('0x66'),qs[_0xe9d2('0x67')](_0x1815ef[_0xe9d2('0x5f')]),null);}else{var _0x51ff31='%'+_0x1815ef[_0xe9d2('0x5f')]+'%';_0x34ed8b[_0x4ed84c](_0xe9d2('0x68'),_0x51ff31,_0x51ff31,_0x51ff31);}}else{_0x7f7b76=_[_0xe9d2('0x5d')](_0x529960,[_0xe9d2('0x2e'),_0xe9d2('0x69')]);_0x1815ef[_0xe9d2('0x48')]=_0xe9d2('0x69');_0x5874fd=as[_0xe9d2('0x6a')](_0x21fe11,_0x7f7b76[_0xe9d2('0x3a')],_0x1815ef);_0x34ed8b[_0x4ed84c](_0x5874fd[_0xe9d2('0x6b')],_0x5874fd[_0xe9d2('0x5f')][_0xe9d2('0x6c')],_0x5874fd[_0xe9d2('0x5f')][_0xe9d2('0x21')]);}break;case _0xe9d2('0x6d'):var _0x20f725=_0x1815ef[_0xe9d2('0x5f')][_0xe9d2('0x32')](',')['map'](function(_0x1a3499){return Number(_0x1a3499);});_0x20f725['forEach'](function(_0x182abd){_0xa384ca['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x182abd+',%');});_0x3e3a2e=_[_0xe9d2('0x6e')](_0x3e3a2e,_0x20f725);break;case _0xe9d2('0x6f'):if(_0x1815ef[_0xe9d2('0x64')]===_0xe9d2('0x65')){_0x34ed8b[_0x4ed84c](_0xe9d2('0x70'),'%'+_0x1815ef[_0xe9d2('0x5f')]+'%',null);}else{_0x7f7b76=_['find'](_0x529960,[_0xe9d2('0x2e'),_0xe9d2('0x71')]);_0x1815ef[_0xe9d2('0x48')]=_0xe9d2('0x71');_0x5874fd=as[_0xe9d2('0x6a')](_0x21fe11,_0x7f7b76['type'],_0x1815ef);_0x34ed8b[_0x4ed84c](_0x5874fd[_0xe9d2('0x6b')],_0x5874fd[_0xe9d2('0x5f')][_0xe9d2('0x6c')],_0x5874fd['value'][_0xe9d2('0x21')]);}break;case _0xe9d2('0x72'):_0x5874fd=as['buildExpression']('me',null,_0x1815ef);_0x34ed8b[_0x4ed84c](_0x5874fd['text'],_0x5874fd[_0xe9d2('0x5f')][_0xe9d2('0x6c')],_0x5874fd[_0xe9d2('0x5f')][_0xe9d2('0x21')]);break;}}else{var _0x5874fd=as[_0xe9d2('0x6a')](_0x21fe11,_0x7f7b76['type'],_0x1815ef);_0x34ed8b[_0x4ed84c](_0x5874fd[_0xe9d2('0x6b')],_0x5874fd[_0xe9d2('0x5f')][_0xe9d2('0x6c')],_0x5874fd['value']['end']);}}}else{var _0x32d387=_(_0xbb5d98[_0xe9d2('0x3c')])[_0xe9d2('0x73')]()['map'](function(_0x3ae2d7){return _[_0xe9d2('0x74')](_0x529960,[_0xe9d2('0x2e'),_0x3ae2d7])?_0x3ae2d7:undefined;})[_0xe9d2('0x75')]()[_0xe9d2('0x5f')]();if(!_[_0xe9d2('0x76')](_0x32d387)){_0x32d387[_0xe9d2('0x33')](function(_0x2a099b){if(_0x2a099b===_0xe9d2('0x77')){_0x1e3934[_0xe9d2('0x45')](_0xe9d2('0x78'),[][_0xe9d2('0x79')](_0xbb5d98[_0xe9d2('0x3c')][_0x2a099b]));}else if(_0x2a099b==='createdAt'){var _0xc145af=JSON[_0xe9d2('0x7a')](_0xbb5d98[_0xe9d2('0x3c')][_0x2a099b])[_0xe9d2('0x7b')];var _0x265051=JSON[_0xe9d2('0x7a')](_0xbb5d98['query'][_0x2a099b])[_0xe9d2('0x7c')];_0x1e3934['where'](_0xe9d2('0x7d'),_0xc145af,_0x265051);}else{if(_0xbb5d98['query'][_0x2a099b]===_0xe9d2('0x7e')){_0x1e3934[_0xe9d2('0x45')]('i.'+_0x2a099b+_0xe9d2('0x7f'));}else{_0x1e3934['where']('i.'+_0x2a099b+_0xe9d2('0x80'),_0xbb5d98[_0xe9d2('0x3c')][_0x2a099b]);}}});}if(_0xbb5d98['query'][_0xe9d2('0x81')]){if(_0xbb5d98[_0xe9d2('0x3c')]['read']==0x1){_0x1e3934[_0xe9d2('0x60')]('`unreadMessages`\x20=\x200');}else{_0x1e3934[_0xe9d2('0x60')](_0xe9d2('0x82'));}}if(_0xbb5d98[_0xe9d2('0x3c')][_0xe9d2('0x83')]){_0x3e3a2e=_[_0xe9d2('0x84')](_0xbb5d98['query'][_0xe9d2('0x83')])?_0xbb5d98[_0xe9d2('0x3c')][_0xe9d2('0x83')]:new Array(_0xbb5d98['query'][_0xe9d2('0x83')]);_0x3e3a2e[_0xe9d2('0x33')](function(_0x50dbdf){_0xa384ca['or'](_0xe9d2('0x85'),'%,'+_0x50dbdf+',%');});}if(_0xbb5d98[_0xe9d2('0x3c')][_0xe9d2('0x86')]){var _0x382374=_0xbb5d98[_0xe9d2('0x3c')]['filter'][_0xe9d2('0x87')]('\x5c','\x5c\x5c')[_0xe9d2('0x87')](/'/g,'\x27\x27');if(qs[_0xe9d2('0x88')](_0x382374)){_0x34ed8b['or'](_0xe9d2('0x89'),_0x382374+'%')['or'](_0xe9d2('0x8a'),_0x382374+'%');}else{_0x34ed8b['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xe9d2('0x67')](_0x382374))['or'](_0xe9d2('0x8b'),_0x382374+'%');}}}_0x1e3934['where'](_0x34ed8b);_0x1e3934[_0xe9d2('0x8c')]('i.id');var _0x293ab2={'type':db[_0xe9d2('0x8d')][_0xe9d2('0x8e')][_0xe9d2('0x8f')],'raw':!![]};var _0x533ca7=_0x1e3934[_0xe9d2('0x90')]();_0x533ca7['field'](_0xe9d2('0x91'));_0x533ca7[_0xe9d2('0x48')](_0xe9d2('0x92'),_0xe9d2('0x5e'));if(_0xebb6d8[_0xe9d2('0x43')]){_0xebb6d8[_0xe9d2('0x43')][_0xe9d2('0x33')](function(_0x3c68b1){var _0x56c5e7=_0x3c68b1[0x0]===_0xe9d2('0x93')?_0x3c68b1[0x0]:'i.'+_0x3c68b1[0x0];_0x1e3934[_0xe9d2('0x43')](_0x56c5e7,_0x3c68b1[0x1]===_0xe9d2('0x94')?![]:!![]);});}if(!_[_0xe9d2('0x76')](_0x3e3a2e)){_0x1e3934[_0xe9d2('0x60')](_0xa384ca);_0x533ca7[_0xe9d2('0x45')]('t.id\x20IN\x20?',_0x3e3a2e);}BPromise[_0xe9d2('0x95')]()[_0xe9d2('0x2b')](function(){if(!_0x1e837d){if(_0xbb5d98['query']['SmsAccountId'])return;_0x533ca7[_0xe9d2('0x45')](_0xe9d2('0x96'));_0x1e3934[_0xe9d2('0x45')](_0xe9d2('0x96'));return;}if(_0xbb5d98[_0xe9d2('0x97')]['role']!==_0xe9d2('0x98'))return;return _0xbb5d98[_0xe9d2('0x97')][_0xe9d2('0x99')]({'attributes':['id'],'raw':!![]})['then'](function(_0x38f4dd){if(_['isEmpty'](_0x38f4dd)){_0x533ca7[_0xe9d2('0x45')](_0xe9d2('0x9a'));_0x1e3934[_0xe9d2('0x45')](_0xe9d2('0x9a'));}else{_0x533ca7[_0xe9d2('0x45')](_0xe9d2('0x78'),_[_0xe9d2('0x37')](_0x38f4dd,'id'));_0x1e3934['where'](_0xe9d2('0x78'),_[_0xe9d2('0x37')](_0x38f4dd,'id'));}});})[_0xe9d2('0x2b')](function(){if(_0xbb5d98[_0xe9d2('0x97')]['role']===_0xe9d2('0x98')&&!_0x1e837d&&!_0xbb5d98[_0xe9d2('0x3c')][_0xe9d2('0x77')])return[];return db[_0xe9d2('0x9b')][_0xe9d2('0x3c')](_0x533ca7[_0xe9d2('0x9c')](),_0x293ab2);})[_0xe9d2('0x2b')](function(_0x292fa8){_0x5089c0['count']=_0x292fa8[_0xe9d2('0x41')];if(_0x5089c0[_0xe9d2('0x25')]===0x0)return[];return db[_0xe9d2('0x9b')][_0xe9d2('0x3c')](_0x380c12[_0xe9d2('0x9c')](),_0x293ab2)[_0xe9d2('0x2b')](function(_0x5e457b){_0x3ecc56=_[_0xe9d2('0x9d')](_0x5e457b,'id');_0x293ab2=_['merge'](_0x293ab2,{'model':db[_0xe9d2('0x38')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xbb5d98[_0xe9d2('0x3c')][_0xe9d2('0x3f')]){_0xebb6d8[_0xe9d2('0x40')][_0xe9d2('0x33')](function(_0x18a453){_0x1e3934['field']('i.'+_0x18a453);});}else{_0x1e3934['field'](_0xe9d2('0x92'),_0xe9d2('0x5e'));_0x1e3934[_0xe9d2('0x48')](_0xe9d2('0x9e'),_0xe9d2('0x9f'));_0x1e3934[_0xe9d2('0x48')](_0xe9d2('0xa0'),_0xe9d2('0xa1'));_0x1e3934[_0xe9d2('0x48')]('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',_0xe9d2('0x93'));_0x1e3934[_0xe9d2('0x48')](_0xe9d2('0xa2'));_0x1e3934[_0xe9d2('0x48')](_0xe9d2('0xa3'),_0xe9d2('0xa4'));_0x1e3934[_0xe9d2('0x48')](_0xe9d2('0xa5'),_0xe9d2('0xa6'));_0x1e3934[_0xe9d2('0x48')](_0xe9d2('0xa7'),'Contact.email');_0x1e3934[_0xe9d2('0x48')](_0xe9d2('0xa8'),_0xe9d2('0xa9'));_0x1e3934[_0xe9d2('0x48')](_0xe9d2('0xaa'),_0xe9d2('0xab'));_0x1e3934[_0xe9d2('0x48')]('c.fax',_0xe9d2('0xac'));_0x1e3934['field']('o.fullname',_0xe9d2('0xad'));_0x1e3934[_0xe9d2('0x48')](_0xe9d2('0xae'),_0xe9d2('0xaf'));_0x1e3934[_0xe9d2('0x48')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0xe9d2('0x31'));}if(_0xebb6d8[_0xe9d2('0x24')])_0x1e3934[_0xe9d2('0x24')](_0xebb6d8['limit']);if(_0xebb6d8[_0xe9d2('0x22')])_0x1e3934[_0xe9d2('0x22')](_0xebb6d8['offset']);return db[_0xe9d2('0x9b')][_0xe9d2('0x3c')](_0x1e3934['toString'](),_0x293ab2);})[_0xe9d2('0x2b')](function(_0x48a0bc){if(_0x48a0bc['length']>0x0)_0x2b8527['where'](_0xe9d2('0xb0'),_[_0xe9d2('0x37')](_0x48a0bc,'id'));return db[_0xe9d2('0x9b')][_0xe9d2('0x3c')](_0x2b8527[_0xe9d2('0x9c')](),_0x293ab2)['then'](function(_0x2186e8){var _0x2d2c0e=_[_0xe9d2('0xb1')](_0x2186e8,'SmsInteractionId');var _0x3355d3=[];_0x48a0bc[_0xe9d2('0x33')](function(_0x47f0de){_0x3355d3[_0xe9d2('0x35')](updateSmsInteraction(_0x47f0de,_0x3ecc56,_0x2d2c0e));});return BPromise[_0xe9d2('0xb2')](_0x3355d3);});});})['then'](function(_0x7b96ee){_0x5089c0['rows']=_0x7b96ee;return _0x5089c0;})[_0xe9d2('0x2b')](respondWithFilteredResult(_0x114fea,_0xebb6d8))[_0xe9d2('0xb3')](handleError(_0x114fea,null));};exports['show']=function(_0x148302,_0x3b6675){var _0x5d6033={'raw':![],'where':{'id':_0x148302[_0xe9d2('0xb4')]['id']}},_0x35e388={};_0x35e388['model']=_[_0xe9d2('0x73')](db[_0xe9d2('0x38')][_0xe9d2('0xb5')]);_0x35e388['query']=_[_0xe9d2('0x73')](_0x148302[_0xe9d2('0x3c')]);_0x35e388['filters']=_[_0xe9d2('0x3e')](_0x35e388['model'],_0x35e388[_0xe9d2('0x3c')]);_0x5d6033['attributes']=_[_0xe9d2('0x3e')](_0x35e388['model'],qs[_0xe9d2('0x3f')](_0x148302[_0xe9d2('0x3c')][_0xe9d2('0x3f')]));_0x5d6033[_0xe9d2('0x40')]=_0x5d6033['attributes']['length']?_0x5d6033[_0xe9d2('0x40')]:_0x35e388[_0xe9d2('0x3b')];if(_0x148302['query'][_0xe9d2('0xb6')]){_0x5d6033[_0xe9d2('0xb7')]=[{'all':!![]}];}_0x5d6033=_[_0xe9d2('0xb8')]({},_0x5d6033,_0x148302[_0xe9d2('0xb9')]);return db[_0xe9d2('0x38')][_0xe9d2('0x5d')](_0x5d6033)[_0xe9d2('0x2b')](handleEntityNotFound(_0x3b6675,null))[_0xe9d2('0x2b')](respondWithResult(_0x3b6675,null))[_0xe9d2('0xb3')](handleError(_0x3b6675,null));};exports['create']=function(_0xc72c5b,_0x200836){return db[_0xe9d2('0x38')][_0xe9d2('0xba')](_0xc72c5b[_0xe9d2('0x72')],{})['then'](respondWithResult(_0x200836,0xc9))[_0xe9d2('0xb3')](handleError(_0x200836,null));};exports[_0xe9d2('0xbb')]=function(_0xd9ea3,_0x21fd41){if(_0xd9ea3[_0xe9d2('0x72')]['id']){delete _0xd9ea3[_0xe9d2('0x72')]['id'];}return db['SmsInteraction'][_0xe9d2('0x5d')]({'where':{'id':_0xd9ea3['params']['id']}})[_0xe9d2('0x2b')](handleEntityNotFound(_0x21fd41,null))[_0xe9d2('0x2b')](saveUpdates(_0xd9ea3[_0xe9d2('0x72')],null))['then'](respondWithResult(_0x21fd41,null))[_0xe9d2('0xb3')](handleError(_0x21fd41,null));};exports[_0xe9d2('0x2c')]=function(_0x187e5f,_0x46537f){return db[_0xe9d2('0x38')][_0xe9d2('0x5d')]({'where':{'id':_0x187e5f[_0xe9d2('0xb4')]['id']}})['then'](handleEntityNotFound(_0x46537f,null))['then'](removeEntity(_0x46537f,null))[_0xe9d2('0xb3')](handleError(_0x46537f,null));};exports[_0xe9d2('0xbc')]=function(_0x1999e8,_0x2be7f5){return db[_0xe9d2('0x38')][_0xe9d2('0xbc')]()['then'](respondWithResult(_0x2be7f5,null))['catch'](handleError(_0x2be7f5,null));};exports[_0xe9d2('0xbd')]=function(_0x2f9f53,_0x530e92,_0x4a5490){return db[_0xe9d2('0xbe')][_0xe9d2('0x5d')]({'where':{'id':_0x2f9f53[_0xe9d2('0xb4')]['id']}})['then'](handleEntityNotFound(_0x530e92,null))['then'](function(_0x1da96e){if(_0x1da96e){return _0x1da96e[_0xe9d2('0xbd')](_0x2f9f53[_0xe9d2('0x72')][_0xe9d2('0xbf')],_[_0xe9d2('0xc0')](_0x2f9f53[_0xe9d2('0x72')],['ids','id'])||{});}})[_0xe9d2('0x2b')](respondWithResult(_0x530e92,null))[_0xe9d2('0xb3')](handleError(_0x530e92,null));};exports[_0xe9d2('0xc1')]=function(_0x5b186f,_0x587c23,_0x355a24){var _0x34c1dd={'raw':![],'where':{}};var _0x5a6a34={};var _0x5870bd={'count':0x0,'rows':[]};return db[_0xe9d2('0x38')][_0xe9d2('0xc2')]({'where':{'id':_0x5b186f[_0xe9d2('0xb4')]['id']}})['then'](handleEntityNotFound(_0x587c23,null))[_0xe9d2('0x2b')](function(_0x4b1462){if(_0x4b1462){_0x5a6a34[_0xe9d2('0x3b')]=_[_0xe9d2('0x73')](db[_0xe9d2('0xbe')][_0xe9d2('0xb5')]);_0x5a6a34[_0xe9d2('0x3c')]=_[_0xe9d2('0x73')](_0x5b186f[_0xe9d2('0x3c')]);_0x5a6a34[_0xe9d2('0x3d')]=_[_0xe9d2('0x3e')](_0x5a6a34[_0xe9d2('0x3b')],_0x5a6a34[_0xe9d2('0x3c')]);_0x34c1dd['attributes']=_[_0xe9d2('0x3e')](_0x5a6a34[_0xe9d2('0x3b')],qs['fields'](_0x5b186f[_0xe9d2('0x3c')][_0xe9d2('0x3f')]));_0x34c1dd['attributes']=_0x34c1dd[_0xe9d2('0x40')][_0xe9d2('0x41')]?_0x34c1dd[_0xe9d2('0x40')]:_0x5a6a34[_0xe9d2('0x3b')];if(!_0x5b186f[_0xe9d2('0x3c')]['hasOwnProperty'](_0xe9d2('0x42'))){_0x34c1dd[_0xe9d2('0x24')]=qs[_0xe9d2('0x24')](_0x5b186f[_0xe9d2('0x3c')][_0xe9d2('0x24')]);_0x34c1dd[_0xe9d2('0x22')]=qs[_0xe9d2('0x22')](_0x5b186f[_0xe9d2('0x3c')][_0xe9d2('0x22')]);}_0x34c1dd[_0xe9d2('0x43')]=qs['sort'](_0x5b186f[_0xe9d2('0x3c')]['sort']);_0x34c1dd['where']=qs['filters'](_[_0xe9d2('0x46')](_0x5b186f['query'],_0x5a6a34[_0xe9d2('0x3d')]));_0x34c1dd[_0xe9d2('0x45')][_0xe9d2('0xc3')]=_0x4b1462['id'];if(_0x5b186f['query']['filter']){_0x34c1dd[_0xe9d2('0x45')]=_[_0xe9d2('0xb8')](_0x34c1dd[_0xe9d2('0x45')],{'$or':_[_0xe9d2('0x37')](_0x34c1dd[_0xe9d2('0x40')],function(_0x316bc7){var _0x4020d6={};_0x4020d6[_0x316bc7]={'$like':'%'+_0x5b186f[_0xe9d2('0x3c')][_0xe9d2('0x86')]+'%'};return _0x4020d6;})});}if(_0x5b186f[_0xe9d2('0x3c')][_0xe9d2('0x7b')]){var _0x128eca=_0x5b186f[_0xe9d2('0x3c')]['$gte'][_0xe9d2('0x32')](',');var _0x27cf00={};_0x27cf00[_0x128eca[0x0]]={'$gte':moment(_0x128eca[0x1])['format'](_0xe9d2('0xc4'))};_0x34c1dd[_0xe9d2('0x45')]=_[_0xe9d2('0xb8')](_0x34c1dd['where'],_0x27cf00);}_0x34c1dd=_['merge']({},_0x34c1dd,_0x5b186f[_0xe9d2('0xb9')]);return db[_0xe9d2('0xbe')][_0xe9d2('0x25')]({'where':_0x34c1dd[_0xe9d2('0x45')]})[_0xe9d2('0x2b')](function(_0x34638b){_0x5870bd[_0xe9d2('0x25')]=_0x34638b;if(_0x5b186f[_0xe9d2('0x3c')]['includeAll']){_0x34c1dd[_0xe9d2('0xb7')]=[{'all':!![]}];}return db[_0xe9d2('0xbe')]['findAll'](_0x34c1dd);})[_0xe9d2('0x2b')](function(_0x5187df){_0x5870bd[_0xe9d2('0xc5')]=_0x5187df;return _0x5870bd;});}})['then'](respondWithFilteredResult(_0x587c23,_0x34c1dd))[_0xe9d2('0xb3')](handleError(_0x587c23,null));};exports[_0xe9d2('0xc6')]=function(_0x52da40,_0x56587b,_0x4f2adb){return db[_0xe9d2('0x38')][_0xe9d2('0x5d')]({'where':{'id':_0x52da40['params']['id']}})[_0xe9d2('0x2b')](handleEntityNotFound(_0x56587b,null))[_0xe9d2('0x2b')](function(_0x1c9b30){if(_0x1c9b30){return _0x1c9b30[_0xe9d2('0xc7')](_0x52da40[_0xe9d2('0x72')]['ids'],_[_0xe9d2('0xc0')](_0x52da40['body'],[_0xe9d2('0xbf'),'id'])||{})[_0xe9d2('0xc8')](function(){return db[_0xe9d2('0x6d')][_0xe9d2('0xc9')]({'attributes':['id',_0xe9d2('0x2e'),'color'],'where':{'id':_0x52da40[_0xe9d2('0x72')][_0xe9d2('0xbf')]}});})[_0xe9d2('0x2b')](function(_0x1d60f6){socket['emit'](_0xe9d2('0xca'),{'id':Number(_0x52da40[_0xe9d2('0xb4')]['id']),'tags':_0x1d60f6||[]});return{'id':Number(_0x52da40[_0xe9d2('0xb4')]['id']),'tags':_0x1d60f6||[]};});}})[_0xe9d2('0x2b')](respondWithResult(_0x56587b,null))[_0xe9d2('0xb3')](handleError(_0x56587b,null));};exports[_0xe9d2('0xcb')]=function(_0x219df4,_0x587cab,_0x2edba4){return db['SmsInteraction'][_0xe9d2('0x5d')]({'where':{'id':_0x219df4[_0xe9d2('0xb4')]['id']}})['then'](handleEntityNotFound(_0x587cab,null))[_0xe9d2('0x2b')](function(_0x57662b){if(_0x57662b){return _0x57662b[_0xe9d2('0xcb')](_0x219df4[_0xe9d2('0x3c')][_0xe9d2('0xbf')]);}})[_0xe9d2('0x2b')](respondWithStatusCode(_0x587cab,null))[_0xe9d2('0xb3')](handleError(_0x587cab,null));};exports[_0xe9d2('0xcc')]=function(_0x8e3279,_0x2ba0d4){var _0x52ead5=moment()[_0xe9d2('0xcd')]()[_0xe9d2('0x9c')]();var _0x413c87=path[_0xe9d2('0xce')](config[_0xe9d2('0xcf')],_0xe9d2('0xd0'),_0xe9d2('0xd1'),_0xe9d2('0xd2'));var _0x3f23e9=path['join'](config['root'],_0xe9d2('0xd0'),_0xe9d2('0xd1'),_0xe9d2('0xd3'));var _0x38524a=path[_0xe9d2('0xce')](_0x413c87,_0x52ead5);var _0x433ce8=util[_0xe9d2('0xd4')](_0xe9d2('0xd5'),_0x8e3279[_0xe9d2('0xb4')]['id'],_0x52ead5);var _0x208aa6=path[_0xe9d2('0xce')](_0x413c87,_0x433ce8);var _0x213a49=[];_0x213a49[_0xe9d2('0x35')]({'model':db[_0xe9d2('0x6f')],'as':_0xe9d2('0x6f'),'attributes':['id',_0xe9d2('0x30')],'raw':!![]});_0x213a49[_0xe9d2('0x35')]({'model':db[_0xe9d2('0xd6')],'as':_0xe9d2('0x63'),'attributes':['id',_0xe9d2('0xd7'),_0xe9d2('0xd8')],'raw':!![]});var _0x1d6e3f=[{'model':db[_0xe9d2('0xbe')],'as':_0xe9d2('0xd9'),'attributes':['id',_0xe9d2('0x72'),_0xe9d2('0xda'),'direction','secret',_0xe9d2('0x81')],'include':_0x213a49}];_0x1d6e3f['push']({'model':db[_0xe9d2('0xdb')],'as':_0xe9d2('0xdc'),'attributes':['id','name']});_0x1d6e3f['push']({'model':db['User'],'as':_0xe9d2('0xdd'),'attributes':['id','fullname']});return db[_0xe9d2('0x38')]['find']({'where':{'id':_0x8e3279[_0xe9d2('0xb4')]['id']},'include':_0x1d6e3f})[_0xe9d2('0x2b')](handleEntityNotFound(_0x2ba0d4,null))[_0xe9d2('0x2b')](function(_0x19add8){if(_0x19add8){var _0x58e1ad=_0x19add8[_0xe9d2('0xde')]({'plain':!![]});fs['mkdirSync'](_0x38524a);var _0x4fdcb6={'channel':_0xe9d2('0xdf'),'account':_0x58e1ad['Account']['name'],'agent':_0x58e1ad['Owner']?_0x58e1ad['Owner']['fullname']:_0xe9d2('0xe0'),'createdAt':moment(_0x58e1ad['createdAt'])[_0xe9d2('0xd4')]('YYYY-MM-DD\x20HH:mm:ss')[_0xe9d2('0x9c')](),'closedAt':_0x58e1ad[_0xe9d2('0xe1')]?moment(_0x58e1ad[_0xe9d2('0xe2')])[_0xe9d2('0xd4')](_0xe9d2('0xc4'))[_0xe9d2('0x9c')]():'','disposition':_0x58e1ad[_0xe9d2('0xe3')],'messages':_(_0x58e1ad[_0xe9d2('0xd9')])[_0xe9d2('0x86')]({'secret':![]})[_0xe9d2('0x37')](function(_0x3764cb){return{'date':moment(_0x3764cb[_0xe9d2('0xda')])[_0xe9d2('0xd4')](_0xe9d2('0xc4'))['toString'](),'sender':_0x3764cb[_0xe9d2('0xe4')]==='out'?_0x3764cb[_0xe9d2('0x6f')]?_0x3764cb[_0xe9d2('0x6f')][_0xe9d2('0x30')]:'System':_0x3764cb[_0xe9d2('0x63')]['firstName']+(_0x3764cb[_0xe9d2('0x63')][_0xe9d2('0xd8')]?'\x20'+_0x3764cb[_0xe9d2('0x63')][_0xe9d2('0xd8')]:''),'body':_0x3764cb['body'],'direction':_0x3764cb['direction']==='out'?'A':'C','secret':_0x3764cb['secret'],'read':_0x3764cb[_0xe9d2('0x81')]};})[_0xe9d2('0x5f')]()};return ejs[_0xe9d2('0xe5')](path['join'](config[_0xe9d2('0xcf')],_0xe9d2('0xd0'),_0xe9d2('0xe6'),_0xe9d2('0xe7')),{'interaction':_0x4fdcb6})[_0xe9d2('0x2b')](function(_0x1e213b){var _0x47fb02=path['join'](_0x38524a,_0xe9d2('0xe8')+_0x58e1ad['id']+'-'+_0x52ead5+_0xe9d2('0xe9'));var _0x140ae4={'path':_0x47fb02,'channel':_0xe9d2('0xdf'),'interactionId':_0x58e1ad['id']};return pdf[_0xe9d2('0xea')](_0x1e213b,_0x140ae4);})['then'](function(){return new BPromise(function(_0x33535f,_0x3c653d){zipdir(_0x38524a,{'saveTo':_0x208aa6},function(_0x5edbda,_0x3f31ab){if(_0x5edbda)return _0x3c653d(_0x5edbda);return _0x33535f(_0x3f31ab);});})[_0xe9d2('0x2b')](function(){return new BPromise(function(_0x44b09a,_0x24b436){rimraf(_0x38524a,function(_0x49f97c){if(_0x49f97c)_0x24b436(_0x49f97c);return _0x44b09a();});});})[_0xe9d2('0x2b')](function(){return _0x2ba0d4[_0xe9d2('0xcc')](_0x208aa6,_0x433ce8,function(_0x5eb6e5){if(_0x5eb6e5){console['log'](_0xe9d2('0xeb'),_0x5eb6e5);}else{fs[_0xe9d2('0xec')](_0x208aa6);}});});});}else{return _0x2ba0d4[_0xe9d2('0x1f')](0xc8);}})[_0xe9d2('0xb3')](handleError(_0x2ba0d4,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index fb1930a..d105182 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 _0xdb28=['Users','map','findAll','then','unreadMessages','length','emit','catch','hook','exports','events','../../mysqldb','SmsInteraction','setMaxListeners','save','update','remove','setDataValue'];(function(_0x128450,_0x5869ba){var _0x4d80ed=function(_0x4a2da3){while(--_0x4a2da3){_0x128450['push'](_0x128450['shift']());}};_0x4d80ed(++_0x5869ba);}(_0xdb28,0x106));var _0x8db2=function(_0xc56355,_0x9e66fa){_0xc56355=_0xc56355-0x0;var _0x3633b5=_0xdb28[_0xc56355];return _0x3633b5;};'use strict';var EventEmitter=require(_0x8db2('0x0'));var SmsInteraction=require(_0x8db2('0x1'))['db'][_0x8db2('0x2')];var SmsMessage=require(_0x8db2('0x1'))['db']['SmsMessage'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x8db2('0x3')](0x0);var events={'afterCreate':_0x8db2('0x4'),'afterUpdate':_0x8db2('0x5'),'afterDestroy':_0x8db2('0x6')};function emitEvent(_0x11109e){return function(_0x52bf99,_0x21a03e,_0x1d2dd3){_0x52bf99['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x477f50){_0x52bf99[_0x8db2('0x7')](_0x8db2('0x8'),_0x477f50[_0x8db2('0x9')](function(_0x2f3f2f){return{'id':_0x2f3f2f['id']};}));return SmsMessage[_0x8db2('0xa')]({'where':{'SmsInteractionId':_0x52bf99['id'],'direction':'in','read':![]},'raw':!![]});})[_0x8db2('0xb')](function(_0x4ba340){_0x52bf99[_0x8db2('0x7')](_0x8db2('0xc'),_0x4ba340[_0x8db2('0xd')]);SmsInteractionEvents['emit'](_0x11109e+':'+_0x52bf99['id'],_0x52bf99);SmsInteractionEvents[_0x8db2('0xe')](_0x11109e,_0x52bf99);_0x1d2dd3(null);})[_0x8db2('0xf')](_0x1d2dd3(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsInteraction[_0x8db2('0x10')](e,emitEvent(event));}}module[_0x8db2('0x11')]=SmsInteractionEvents; \ No newline at end of file +var _0x25e7=['hasOwnProperty','hook','events','../../mysqldb','SmsInteraction','SmsMessage','setMaxListeners','save','update','remove','setDataValue','Users','map','findAll','then','unreadMessages','length','emit'];(function(_0x35ef7a,_0x2b3df3){var _0x3e1c56=function(_0x38b48f){while(--_0x38b48f){_0x35ef7a['push'](_0x35ef7a['shift']());}};_0x3e1c56(++_0x2b3df3);}(_0x25e7,0x1d6));var _0x725e=function(_0x35b99b,_0x2efd45){_0x35b99b=_0x35b99b-0x0;var _0xc34057=_0x25e7[_0x35b99b];return _0xc34057;};'use strict';var EventEmitter=require(_0x725e('0x0'));var SmsInteraction=require(_0x725e('0x1'))['db'][_0x725e('0x2')];var SmsMessage=require(_0x725e('0x1'))['db'][_0x725e('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x725e('0x4')](0x0);var events={'afterCreate':_0x725e('0x5'),'afterUpdate':_0x725e('0x6'),'afterDestroy':_0x725e('0x7')};function emitEvent(_0x3da706){return function(_0x493364,_0x5e17a9,_0x2497a5){_0x493364['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x111a50){_0x493364[_0x725e('0x8')](_0x725e('0x9'),_0x111a50[_0x725e('0xa')](function(_0x40d238){return{'id':_0x40d238['id']};}));return SmsMessage[_0x725e('0xb')]({'where':{'SmsInteractionId':_0x493364['id'],'direction':'in','read':![]},'raw':!![]});})[_0x725e('0xc')](function(_0x7c40ff){_0x493364[_0x725e('0x8')](_0x725e('0xd'),_0x7c40ff[_0x725e('0xe')]);SmsInteractionEvents[_0x725e('0xf')](_0x3da706+':'+_0x493364['id'],_0x493364);SmsInteractionEvents['emit'](_0x3da706,_0x493364);_0x2497a5(null);})['catch'](_0x2497a5(null));};}for(var e in events){if(events[_0x725e('0x10')](e)){var event=events[e];SmsInteraction[_0x725e('0x11')](e,emitEvent(event));}}module['exports']=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index 86da177..109b488 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 _0xbbba=['../../config/logger','api','request-promise','path','rimraf','../../config/environment','./smsInteraction.attributes','exports','define','SmsInteraction','sms_interactions','changed','closed','closedAt','format','lodash','util'];(function(_0xa5bd84,_0x287943){var _0x22bcca=function(_0x13f6f4){while(--_0x13f6f4){_0xa5bd84['push'](_0xa5bd84['shift']());}};_0x22bcca(++_0x287943);}(_0xbbba,0x86));var _0xabbb=function(_0x1bb812,_0x23eacc){_0x1bb812=_0x1bb812-0x0;var _0x372adb=_0xbbba[_0x1bb812];return _0x372adb;};'use strict';var _=require(_0xabbb('0x0'));var util=require(_0xabbb('0x1'));var logger=require(_0xabbb('0x2'))(_0xabbb('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xabbb('0x4'));var fs=require('fs');var path=require(_0xabbb('0x5'));var rimraf=require(_0xabbb('0x6'));var config=require(_0xabbb('0x7'));var attributes=require(_0xabbb('0x8'));module[_0xabbb('0x9')]=function(_0x36ca1c,_0x364449){return _0x36ca1c[_0xabbb('0xa')](_0xabbb('0xb'),attributes,{'tableName':_0xabbb('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x14680a,_0x2ece14,_0x62728f){if(_0x14680a[_0xabbb('0xd')](_0xabbb('0xe'))){_0x14680a[_0xabbb('0xf')]=moment()[_0xabbb('0x10')]('YYYY-MM-DD\x20HH:mm:ss');}_0x62728f(null,_0x14680a);}}});}; \ No newline at end of file +var _0xbdb8=['YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./smsInteraction.attributes','exports','define','SmsInteraction','sms_interactions','changed','closed','closedAt','format'];(function(_0x4654d4,_0x293a9f){var _0x53a60d=function(_0x3fcd78){while(--_0x3fcd78){_0x4654d4['push'](_0x4654d4['shift']());}};_0x53a60d(++_0x293a9f);}(_0xbdb8,0x17b));var _0x8bdb=function(_0x14e001,_0x569bf){_0x14e001=_0x14e001-0x0;var _0x2c09da=_0xbdb8[_0x14e001];return _0x2c09da;};'use strict';var _=require(_0x8bdb('0x0'));var util=require(_0x8bdb('0x1'));var logger=require(_0x8bdb('0x2'))(_0x8bdb('0x3'));var moment=require('moment');var BPromise=require(_0x8bdb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8bdb('0x5'));var rimraf=require(_0x8bdb('0x6'));var config=require(_0x8bdb('0x7'));var attributes=require(_0x8bdb('0x8'));module[_0x8bdb('0x9')]=function(_0x55c374,_0x329ea9){return _0x55c374[_0x8bdb('0xa')](_0x8bdb('0xb'),attributes,{'tableName':_0x8bdb('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1c85e6,_0x25997c,_0x50a054){if(_0x1c85e6[_0x8bdb('0xd')](_0x8bdb('0xe'))){_0x1c85e6[_0x8bdb('0xf')]=moment()[_0x8bdb('0x10')](_0x8bdb('0x11'));}_0x50a054(null,_0x1c85e6);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index 87d5372..9d4b040 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 _0x6ab4=['ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','request','then','info','request\x20sent','debug','stringify','error','code','SmsInteraction,\x20%s,\x20%s','message','result','catch','UpdateSmsInteraction','SmsInteraction','body','options','raw','where','attributes','limit','find','addTags','omit'];(function(_0x57c2c7,_0x2851b6){var _0x12efc7=function(_0x409905){while(--_0x409905){_0x57c2c7['push'](_0x57c2c7['shift']());}};_0x12efc7(++_0x2851b6);}(_0x6ab4,0x15b));var _0x46ab=function(_0x2b71da,_0x1a6441){_0x2b71da=_0x2b71da-0x0;var _0x314281=_0x6ab4[_0x2b71da];return _0x314281;};'use strict';var _=require(_0x46ab('0x0'));var util=require(_0x46ab('0x1'));var moment=require(_0x46ab('0x2'));var BPromise=require(_0x46ab('0x3'));var rs=require(_0x46ab('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x46ab('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x46ab('0x6'));var config=require(_0x46ab('0x7'));var jayson=require(_0x46ab('0x8'));var client=jayson[_0x46ab('0x9')][_0x46ab('0xa')]({'port':0x232a});config[_0x46ab('0xb')]=_[_0x46ab('0xc')](config[_0x46ab('0xb')],{'host':_0x46ab('0xd'),'port':0x18eb});var socket=require(_0x46ab('0xe'))(new Redis(config[_0x46ab('0xb')]));require(_0x46ab('0xf'))[_0x46ab('0x10')](socket);function respondWithRpcPromise(_0x54d5b3,_0xf7fb28,_0x561595){return new BPromise(function(_0x346d03,_0x54aa85){return client[_0x46ab('0x11')](_0x54d5b3,_0x561595)[_0x46ab('0x12')](function(_0x19e7a6){logger[_0x46ab('0x13')]('SmsInteraction,\x20%s,\x20%s',_0xf7fb28,_0x46ab('0x14'));logger[_0x46ab('0x15')]('SmsInteraction,\x20%s,\x20%s,\x20%s',_0xf7fb28,_0x46ab('0x14'),JSON[_0x46ab('0x16')](_0x19e7a6));if(_0x19e7a6['error']){if(_0x19e7a6[_0x46ab('0x17')][_0x46ab('0x18')]===0x1f4){logger['error'](_0x46ab('0x19'),_0xf7fb28,_0x19e7a6['error'][_0x46ab('0x1a')]);return _0x54aa85(_0x19e7a6['error'][_0x46ab('0x1a')]);}logger[_0x46ab('0x17')](_0x46ab('0x19'),_0xf7fb28,_0x19e7a6[_0x46ab('0x17')][_0x46ab('0x1a')]);return _0x346d03(_0x19e7a6[_0x46ab('0x17')]['message']);}else{logger[_0x46ab('0x13')](_0x46ab('0x19'),_0xf7fb28,_0x46ab('0x14'));_0x346d03(_0x19e7a6[_0x46ab('0x1b')][_0x46ab('0x1a')]);}})[_0x46ab('0x1c')](function(_0x2da9d7){logger[_0x46ab('0x17')](_0x46ab('0x19'),_0xf7fb28,_0x2da9d7);_0x54aa85(_0x2da9d7);});});}exports[_0x46ab('0x1d')]=function(_0x543fde){var _0x1db9d5=this;return new Promise(function(_0x5f57e5,_0x2089cc){return db[_0x46ab('0x1e')]['update'](_0x543fde[_0x46ab('0x1f')],{'raw':_0x543fde[_0x46ab('0x20')]?_0x543fde[_0x46ab('0x20')][_0x46ab('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x543fde['options']?_0x543fde[_0x46ab('0x20')][_0x46ab('0x22')]||null:null,'attributes':_0x543fde[_0x46ab('0x20')]?_0x543fde[_0x46ab('0x20')][_0x46ab('0x23')]||null:null,'limit':_0x543fde[_0x46ab('0x20')]?_0x543fde[_0x46ab('0x20')][_0x46ab('0x24')]||null:null})['then'](function(_0x332ab1){logger[_0x46ab('0x13')](_0x46ab('0x1d'),_0x543fde);logger[_0x46ab('0x15')]('UpdateSmsInteraction',_0x543fde,JSON[_0x46ab('0x16')](_0x332ab1));_0x5f57e5(_0x332ab1);})[_0x46ab('0x1c')](function(_0x499b9a){logger[_0x46ab('0x17')](_0x46ab('0x1d'),_0x499b9a[_0x46ab('0x1a')],_0x543fde);_0x2089cc(_0x1db9d5[_0x46ab('0x17')](0x1f4,_0x499b9a[_0x46ab('0x1a')]));});});};exports['AddTagsToSmsInteraction']=function(_0x38f5e2){return new Promise(function(_0x2aa6cd,_0x322b44){return db['SmsInteraction'][_0x46ab('0x25')]({'where':_0x38f5e2[_0x46ab('0x20')]?_0x38f5e2[_0x46ab('0x20')][_0x46ab('0x22')]||null:null})[_0x46ab('0x12')](function(_0x5857d9){if(_0x5857d9){return _0x5857d9[_0x46ab('0x26')](_0x38f5e2[_0x46ab('0x1f')]['ids'],_[_0x46ab('0x27')](_0x38f5e2[_0x46ab('0x1f')],[_0x46ab('0x28'),'id'])||{});}})[_0x46ab('0x29')](function(_0x518f03){logger[_0x46ab('0x13')](_0x46ab('0x2a'),_0x38f5e2);logger[_0x46ab('0x15')]('AddTags',_0x38f5e2,JSON[_0x46ab('0x16')](_0x518f03));_0x2aa6cd(_0x518f03);})[_0x46ab('0x1c')](function(_0x3ed095){logger[_0x46ab('0x17')](_0x46ab('0x2a'),_0x3ed095[_0x46ab('0x1a')],_0x38f5e2);_0x322b44(_this[_0x46ab('0x17')](0x1f4,_0x3ed095[_0x46ab('0x1a')]));});});}; \ No newline at end of file +var _0x888a=['util','moment','ioredis','../../config/logger','jayson/promise','defaults','redis','localhost','socket.io-emitter','./smsInteraction.socket','register','request','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','error','message','result','UpdateSmsInteraction','SmsInteraction','body','options','raw','attributes','limit','stringify','catch','AddTagsToSmsInteraction','find','where','addTags','omit','ids','spread','AddTags','lodash'];(function(_0x416fc4,_0x5c283e){var _0xcdb058=function(_0x3e012e){while(--_0x3e012e){_0x416fc4['push'](_0x416fc4['shift']());}};_0xcdb058(++_0x5c283e);}(_0x888a,0x1d3));var _0xa888=function(_0x44d9f0,_0x149367){_0x44d9f0=_0x44d9f0-0x0;var _0x4af22d=_0x888a[_0x44d9f0];return _0x4af22d;};'use strict';var _=require(_0xa888('0x0'));var util=require(_0xa888('0x1'));var moment=require(_0xa888('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa888('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xa888('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0xa888('0x5'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0xa888('0x6')](config[_0xa888('0x7')],{'host':_0xa888('0x8'),'port':0x18eb});var socket=require(_0xa888('0x9'))(new Redis(config[_0xa888('0x7')]));require(_0xa888('0xa'))[_0xa888('0xb')](socket);function respondWithRpcPromise(_0x41c8db,_0x517f1b,_0x51663e){return new BPromise(function(_0x3915d1,_0x4b7022){return client[_0xa888('0xc')](_0x41c8db,_0x51663e)[_0xa888('0xd')](function(_0x5b8c5d){logger[_0xa888('0xe')](_0xa888('0xf'),_0x517f1b,_0xa888('0x10'));logger[_0xa888('0x11')](_0xa888('0x12'),_0x517f1b,_0xa888('0x10'),JSON['stringify'](_0x5b8c5d));if(_0x5b8c5d['error']){if(_0x5b8c5d[_0xa888('0x13')]['code']===0x1f4){logger[_0xa888('0x13')]('SmsInteraction,\x20%s,\x20%s',_0x517f1b,_0x5b8c5d[_0xa888('0x13')][_0xa888('0x14')]);return _0x4b7022(_0x5b8c5d['error'][_0xa888('0x14')]);}logger[_0xa888('0x13')]('SmsInteraction,\x20%s,\x20%s',_0x517f1b,_0x5b8c5d[_0xa888('0x13')][_0xa888('0x14')]);return _0x3915d1(_0x5b8c5d[_0xa888('0x13')][_0xa888('0x14')]);}else{logger[_0xa888('0xe')](_0xa888('0xf'),_0x517f1b,_0xa888('0x10'));_0x3915d1(_0x5b8c5d[_0xa888('0x15')][_0xa888('0x14')]);}})['catch'](function(_0x4f57b4){logger[_0xa888('0x13')]('SmsInteraction,\x20%s,\x20%s',_0x517f1b,_0x4f57b4);_0x4b7022(_0x4f57b4);});});}exports[_0xa888('0x16')]=function(_0x27eedf){var _0x2c3b77=this;return new Promise(function(_0x26f7a6,_0x58ea77){return db[_0xa888('0x17')]['update'](_0x27eedf[_0xa888('0x18')],{'raw':_0x27eedf[_0xa888('0x19')]?_0x27eedf[_0xa888('0x19')][_0xa888('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x27eedf[_0xa888('0x19')]?_0x27eedf[_0xa888('0x19')]['where']||null:null,'attributes':_0x27eedf[_0xa888('0x19')]?_0x27eedf['options'][_0xa888('0x1b')]||null:null,'limit':_0x27eedf[_0xa888('0x19')]?_0x27eedf['options'][_0xa888('0x1c')]||null:null})['then'](function(_0x3adfe3){logger[_0xa888('0xe')](_0xa888('0x16'),_0x27eedf);logger[_0xa888('0x11')](_0xa888('0x16'),_0x27eedf,JSON[_0xa888('0x1d')](_0x3adfe3));_0x26f7a6(_0x3adfe3);})[_0xa888('0x1e')](function(_0x12f1de){logger['error']('UpdateSmsInteraction',_0x12f1de[_0xa888('0x14')],_0x27eedf);_0x58ea77(_0x2c3b77[_0xa888('0x13')](0x1f4,_0x12f1de[_0xa888('0x14')]));});});};exports[_0xa888('0x1f')]=function(_0xc5a563){return new Promise(function(_0x22a100,_0x40f8a6){return db[_0xa888('0x17')][_0xa888('0x20')]({'where':_0xc5a563[_0xa888('0x19')]?_0xc5a563[_0xa888('0x19')][_0xa888('0x21')]||null:null})[_0xa888('0xd')](function(_0x44059c){if(_0x44059c){return _0x44059c[_0xa888('0x22')](_0xc5a563[_0xa888('0x18')]['ids'],_[_0xa888('0x23')](_0xc5a563[_0xa888('0x18')],[_0xa888('0x24'),'id'])||{});}})[_0xa888('0x25')](function(_0x302859){logger[_0xa888('0xe')](_0xa888('0x26'),_0xc5a563);logger[_0xa888('0x11')](_0xa888('0x26'),_0xc5a563,JSON[_0xa888('0x1d')](_0x302859));_0x22a100(_0x302859);})[_0xa888('0x1e')](function(_0x5e5f34){logger[_0xa888('0x13')]('AddTags',_0x5e5f34['message'],_0xc5a563);_0x40f8a6(_this[_0xa888('0x13')](0x1f4,_0x5e5f34[_0xa888('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index a1107c6..d759920 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 _0x964e=['save','update','emit','removeListener','register','length','./smsInteraction.events'];(function(_0x86ba8,_0x31c204){var _0x636d08=function(_0x2f9262){while(--_0x2f9262){_0x86ba8['push'](_0x86ba8['shift']());}};_0x636d08(++_0x31c204);}(_0x964e,0x1e2));var _0xe964=function(_0x246e3a,_0x24c566){_0x246e3a=_0x246e3a-0x0;var _0x364850=_0x964e[_0x246e3a];return _0x364850;};'use strict';var SmsInteractionEvents=require(_0xe964('0x0'));var events=[_0xe964('0x1'),'remove',_0xe964('0x2')];function createListener(_0x2a273a,_0x194f39){return function(_0x856665){_0x194f39[_0xe964('0x3')](_0x2a273a,_0x856665);};}function removeListener(_0x261445,_0x15ae84){return function(){SmsInteractionEvents[_0xe964('0x4')](_0x261445,_0x15ae84);};}exports[_0xe964('0x5')]=function(_0x36e8db){for(var _0x4bcc34=0x0,_0x4352cf=events[_0xe964('0x6')];_0x4bcc34<_0x4352cf;_0x4bcc34++){var _0x47a5db=events[_0x4bcc34];var _0x17fd39=createListener('smsInteraction:'+_0x47a5db,_0x36e8db);SmsInteractionEvents['on'](_0x47a5db,_0x17fd39);}}; \ No newline at end of file +var _0x3ce1=['./smsInteraction.events','update','emit','register','length','smsInteraction:'];(function(_0x5b0af8,_0x4724c2){var _0xc8aef=function(_0xeb5a82){while(--_0xeb5a82){_0x5b0af8['push'](_0x5b0af8['shift']());}};_0xc8aef(++_0x4724c2);}(_0x3ce1,0x108));var _0x13ce=function(_0x6b6c52,_0x3ae5c0){_0x6b6c52=_0x6b6c52-0x0;var _0x57d09e=_0x3ce1[_0x6b6c52];return _0x57d09e;};'use strict';var SmsInteractionEvents=require(_0x13ce('0x0'));var events=['save','remove',_0x13ce('0x1')];function createListener(_0x79e5a7,_0x3187d6){return function(_0x4fbe50){_0x3187d6[_0x13ce('0x2')](_0x79e5a7,_0x4fbe50);};}function removeListener(_0x58d0d5,_0x23969e){return function(){SmsInteractionEvents['removeListener'](_0x58d0d5,_0x23969e);};}exports[_0x13ce('0x3')]=function(_0x2dd04e){for(var _0x4158e4=0x0,_0x4d412e=events[_0x13ce('0x4')];_0x4158e4<_0x4d412e;_0x4158e4++){var _0x1d677e=events[_0x4158e4];var _0x197a48=createListener(_0x13ce('0x5')+_0x1d677e,_0x2dd04e);SmsInteractionEvents['on'](_0x1d677e,_0x197a48);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index b327091..a9e87fd 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 _0x0117=['/:id/accept','accept','/:id/reject','reject','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','isAuthenticated','index','/describe','describe','get','/:id','show','post','tracked','smsmessage:create','create','/:id/status','put','update'];(function(_0x247844,_0x3ed02d){var _0x3e4156=function(_0xadbaa5){while(--_0xadbaa5){_0x247844['push'](_0x247844['shift']());}};_0x3e4156(++_0x3ed02d);}(_0x0117,0x114));var _0x7011=function(_0x3fa025,_0x25b949){_0x3fa025=_0x3fa025-0x0;var _0x2d3564=_0x0117[_0x3fa025];return _0x2d3564;};'use strict';var multer=require(_0x7011('0x0'));var util=require(_0x7011('0x1'));var path=require('path');var timeout=require(_0x7011('0x2'));var express=require(_0x7011('0x3'));var router=express[_0x7011('0x4')]();var fs_extra=require(_0x7011('0x5'));var auth=require(_0x7011('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./smsMessage.controller');router['get']('/',auth[_0x7011('0x7')](),controller[_0x7011('0x8')]);router['get'](_0x7011('0x9'),auth['isAuthenticated'](),controller[_0x7011('0xa')]);router[_0x7011('0xb')](_0x7011('0xc'),auth[_0x7011('0x7')](),controller[_0x7011('0xd')]);router[_0x7011('0xe')]('/',auth[_0x7011('0x7')](),interaction[_0x7011('0xf')]('sms',_0x7011('0x10')),controller[_0x7011('0x11')]);router[_0x7011('0xe')](_0x7011('0x12'),controller['status']);router[_0x7011('0x13')](_0x7011('0xc'),auth[_0x7011('0x7')](),controller[_0x7011('0x14')]);router[_0x7011('0x13')](_0x7011('0x15'),auth[_0x7011('0x7')](),controller[_0x7011('0x16')]);router[_0x7011('0x13')](_0x7011('0x17'),auth[_0x7011('0x7')](),controller[_0x7011('0x18')]);router[_0x7011('0x19')](_0x7011('0xc'),auth[_0x7011('0x7')](),controller['destroy']);module[_0x7011('0x1a')]=router; \ No newline at end of file +var _0x920b=['/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./smsMessage.controller','get','isAuthenticated','describe','/:id','show','post','tracked','sms','smsmessage:create','create','/:id/status','status','put'];(function(_0x1a38c4,_0x24f5cd){var _0x448659=function(_0x1f1dcd){while(--_0x1f1dcd){_0x1a38c4['push'](_0x1a38c4['shift']());}};_0x448659(++_0x24f5cd);}(_0x920b,0x11d));var _0xb920=function(_0x6383d9,_0x32a0f9){_0x6383d9=_0x6383d9-0x0;var _0x2a0e66=_0x920b[_0x6383d9];return _0x2a0e66;};'use strict';var multer=require(_0xb920('0x0'));var util=require(_0xb920('0x1'));var path=require(_0xb920('0x2'));var timeout=require(_0xb920('0x3'));var express=require(_0xb920('0x4'));var router=express[_0xb920('0x5')]();var fs_extra=require(_0xb920('0x6'));var auth=require(_0xb920('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xb920('0x8'));var controller=require(_0xb920('0x9'));router[_0xb920('0xa')]('/',auth[_0xb920('0xb')](),controller['index']);router[_0xb920('0xa')]('/describe',auth[_0xb920('0xb')](),controller[_0xb920('0xc')]);router[_0xb920('0xa')](_0xb920('0xd'),auth[_0xb920('0xb')](),controller[_0xb920('0xe')]);router[_0xb920('0xf')]('/',auth['isAuthenticated'](),interaction[_0xb920('0x10')](_0xb920('0x11'),_0xb920('0x12')),controller[_0xb920('0x13')]);router[_0xb920('0xf')](_0xb920('0x14'),controller[_0xb920('0x15')]);router[_0xb920('0x16')](_0xb920('0xd'),auth[_0xb920('0xb')](),controller['update']);router['put']('/:id/accept',auth[_0xb920('0xb')](),controller['accept']);router[_0xb920('0x16')](_0xb920('0x17'),auth['isAuthenticated'](),controller[_0xb920('0x18')]);router[_0xb920('0x19')](_0xb920('0xd'),auth[_0xb920('0xb')](),controller[_0xb920('0x1a')]);module[_0xb920('0x1b')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index cd2e50b..b428ad3 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 _0x6469=['TEXT','medium','BOOLEAN','ENUM','out','STRING','DATE','sequelize','exports'];(function(_0x444d22,_0x2379a3){var _0x37df5d=function(_0x2a05b0){while(--_0x2a05b0){_0x444d22['push'](_0x444d22['shift']());}};_0x37df5d(++_0x2379a3);}(_0x6469,0x142));var _0x9646=function(_0x487b57,_0x4d148a){_0x487b57=_0x487b57-0x0;var _0x175ba5=_0x6469[_0x487b57];return _0x175ba5;};'use strict';var Sequelize=require(_0x9646('0x0'));module[_0x9646('0x1')]={'body':{'type':Sequelize[_0x9646('0x2')](_0x9646('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x9646('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x9646('0x5')]('in',_0x9646('0x6')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x9646('0x7')](0xbe)},'phone':{'type':Sequelize[_0x9646('0x7')]},'readAt':{'type':Sequelize[_0x9646('0x8')]},'secret':{'type':Sequelize[_0x9646('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x9646('0x7')]},'providerResponse':{'type':Sequelize[_0x9646('0x2')]}}; \ No newline at end of file +var _0x14d8=['medium','BOOLEAN','ENUM','out','STRING','DATE','sequelize','exports','TEXT'];(function(_0x4c5936,_0x313184){var _0x7c93fa=function(_0x1146e1){while(--_0x1146e1){_0x4c5936['push'](_0x4c5936['shift']());}};_0x7c93fa(++_0x313184);}(_0x14d8,0x9f));var _0x814d=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x14d8[_0x2be8c2];return _0x97f531;};'use strict';var Sequelize=require(_0x814d('0x0'));module[_0x814d('0x1')]={'body':{'type':Sequelize[_0x814d('0x2')](_0x814d('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x814d('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x814d('0x5')]('in',_0x814d('0x6')),'defaultValue':_0x814d('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0x814d('0x7')](0xbe)},'phone':{'type':Sequelize[_0x814d('0x7')]},'readAt':{'type':Sequelize[_0x814d('0x8')]},'secret':{'type':Sequelize[_0x814d('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x814d('0x7')]},'providerResponse':{'type':Sequelize[_0x814d('0x2')]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index c645cc6..dba8ba7 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 _0x7969=['twilio','plivo','MessageUUID','messageId','indexOf','sent','infobip','groupName','DELIVERED','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./smsMessage.socket','register','jayson/promise','client','http','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','undefined','offset','count','set','Content-Range','json','apply','reject','save','update','destroy','stack','name','send','index','map','SmsMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','limit','order','sort','where','VIRTUAL','filter','merge','options','includeAll','findAll','rows','params','include','create','body','find','describe','sms-interactions','accept','sms','read','readAt','format','UserId','get','SmsInteraction','SmsInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','user','role','null','AcceptMessage','acceptMessage','ContactId','QueryTypes','contact','User','agent','fullname','manual','SIP/%s','channel','motionChannel','event','acceptmessage','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','sequelize','Sequelize','email','internal','interface','EventManager','SmsAccount','inspect','MessageSid','SmsAccount,\x20%s,\x20%s,\x20%s'];(function(_0x26617d,_0x1d0ac0){var _0xcfd674=function(_0x1bc473){while(--_0x1bc473){_0x26617d['push'](_0x26617d['shift']());}};_0xcfd674(++_0x1d0ac0);}(_0x7969,0x1c2));var _0x9796=function(_0x54f6f0,_0x3ab272){_0x54f6f0=_0x54f6f0-0x0;var _0x1987d2=_0x7969[_0x54f6f0];return _0x1987d2;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9796('0x0'));var jsonpatch=require(_0x9796('0x1'));var rp=require(_0x9796('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x9796('0x3'));var util=require(_0x9796('0x4'));var path=require(_0x9796('0x5'));var sox=require(_0x9796('0x6'));var csv=require(_0x9796('0x7'));var ejs=require(_0x9796('0x8'));var fs=require('fs');var fs_extra=require(_0x9796('0x9'));var _=require(_0x9796('0xa'));var squel=require('squel');var crypto=require(_0x9796('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9796('0x7'));var querystring=require('querystring');var Papa=require(_0x9796('0xc'));var Redis=require('ioredis');var authService=require(_0x9796('0xd'));var qs=require(_0x9796('0xe'));var as=require(_0x9796('0xf'));var hardwareService=require(_0x9796('0x10'));var logger=require(_0x9796('0x11'))(_0x9796('0x12'));var utils=require(_0x9796('0x13'));var config=require(_0x9796('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x9796('0x15'))['db'];config['redis']=_[_0x9796('0x16')](config['redis'],{'host':_0x9796('0x17'),'port':0x18eb});var socket=require(_0x9796('0x18'))(new Redis(config[_0x9796('0x19')]));require(_0x9796('0x1a'))[_0x9796('0x1b')](socket);var jayson=require(_0x9796('0x1c'));var client=jayson[_0x9796('0x1d')][_0x9796('0x1e')]({'port':0x232c});var client9002=jayson[_0x9796('0x1d')][_0x9796('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x432a00,_0xf2fd9a,_0x4d894d,_0x49d3b3){return new BPromise(function(_0x4f5a81,_0x312b5f){var _0x146c58=_0x49d3b3||client;return _0x146c58[_0x9796('0x1f')](_0x432a00,_0x4d894d)[_0x9796('0x20')](function(_0x26dd7b){logger[_0x9796('0x21')](_0x9796('0x22'),_0xf2fd9a,_0x9796('0x23'));logger[_0x9796('0x24')](_0x9796('0x25'),_0xf2fd9a,_0x9796('0x23'),JSON[_0x9796('0x26')](_0x26dd7b));if(_0x26dd7b[_0x9796('0x27')]){if(_0x26dd7b[_0x9796('0x27')][_0x9796('0x28')]===0x1f4){logger[_0x9796('0x27')]('SmsMessage,\x20%s,\x20%s',_0xf2fd9a,_0x26dd7b[_0x9796('0x27')][_0x9796('0x29')]);return _0x312b5f(_0x26dd7b[_0x9796('0x27')][_0x9796('0x29')]);}logger['error']('SmsMessage,\x20%s,\x20%s',_0xf2fd9a,_0x26dd7b[_0x9796('0x27')][_0x9796('0x29')]);return _0x4f5a81(_0x26dd7b['error'][_0x9796('0x29')]);}else{logger[_0x9796('0x21')](_0x9796('0x22'),_0xf2fd9a,_0x9796('0x23'));_0x4f5a81(_0x26dd7b[_0x9796('0x2a')][_0x9796('0x29')]);}})[_0x9796('0x2b')](function(_0x5e12ce){logger[_0x9796('0x27')]('SmsMessage,\x20%s,\x20%s',_0xf2fd9a,_0x5e12ce);_0x312b5f(_0x5e12ce);});});}function respondWithStatusCode(_0x272d97,_0x39e162){_0x39e162=_0x39e162||0xcc;return function(_0x358bbe){if(_0x358bbe){return _0x272d97[_0x9796('0x2c')](_0x39e162);}return _0x272d97[_0x9796('0x2d')](_0x39e162)[_0x9796('0x2e')]();};}function respondWithResult(_0x118022,_0x2e98ca){_0x2e98ca=_0x2e98ca||0xc8;return function(_0x587d04){if(_0x587d04){return _0x118022[_0x9796('0x2d')](_0x2e98ca)['json'](_0x587d04);}};}function respondWithFilteredResult(_0x5e268d,_0x2575b7){return function(_0x36cc6f){if(_0x36cc6f){var _0x3e9d62=typeof _0x2575b7['offset']===_0x9796('0x2f')&&typeof _0x2575b7['limit']===_0x9796('0x2f');var _0x156b26=_0x36cc6f['count'];var _0x29b1fe=_0x3e9d62?0x0:_0x2575b7[_0x9796('0x30')];var _0x336e61=_0x3e9d62?_0x36cc6f[_0x9796('0x31')]:_0x2575b7[_0x9796('0x30')]+_0x2575b7['limit'];var _0x5a7507;if(_0x336e61>=_0x156b26){_0x336e61=_0x156b26;_0x5a7507=0xc8;}else{_0x5a7507=0xce;}_0x5e268d[_0x9796('0x2d')](_0x5a7507);return _0x5e268d[_0x9796('0x32')](_0x9796('0x33'),_0x29b1fe+'-'+_0x336e61+'/'+_0x156b26)[_0x9796('0x34')](_0x36cc6f);}return null;};}function patchUpdates(_0x2af039){return function(_0x119f7c){try{jsonpatch[_0x9796('0x35')](_0x119f7c,_0x2af039,!![]);}catch(_0x406e09){return BPromise[_0x9796('0x36')](_0x406e09);}return _0x119f7c[_0x9796('0x37')]();};}function saveUpdates(_0x2ca645,_0x4eb11d){return function(_0x3db26f){if(_0x3db26f){return _0x3db26f[_0x9796('0x38')](_0x2ca645)[_0x9796('0x20')](function(_0x5a5eee){return _0x5a5eee;});}return null;};}function removeEntity(_0x134745,_0x37a2fb){return function(_0x274c79){if(_0x274c79){return _0x274c79[_0x9796('0x39')]()[_0x9796('0x20')](function(){_0x134745['status'](0xcc)[_0x9796('0x2e')]();});}};}function handleEntityNotFound(_0x1677f5,_0x3e1844){return function(_0x4e24b5){if(!_0x4e24b5){_0x1677f5['sendStatus'](0x194);}return _0x4e24b5;};}function handleError(_0x545d41,_0xe9762e){_0xe9762e=_0xe9762e||0x1f4;return function(_0x441de2){logger[_0x9796('0x27')](_0x441de2[_0x9796('0x3a')]);if(_0x441de2[_0x9796('0x3b')]){delete _0x441de2[_0x9796('0x3b')];}_0x545d41[_0x9796('0x2d')](_0xe9762e)[_0x9796('0x3c')](_0x441de2);};}exports[_0x9796('0x3d')]=function(_0x5559d7,_0x18237d){var _0xaf2a74={},_0x3b9f89={},_0x130257={'count':0x0,'rows':[]};var _0x46a155=_[_0x9796('0x3e')](db[_0x9796('0x3f')][_0x9796('0x40')],function(_0x5a2c6c){return{'name':_0x5a2c6c[_0x9796('0x41')],'type':_0x5a2c6c[_0x9796('0x42')][_0x9796('0x43')]};});_0x3b9f89[_0x9796('0x44')]=_[_0x9796('0x3e')](_0x46a155,'name');_0x3b9f89[_0x9796('0x45')]=_[_0x9796('0x46')](_0x5559d7['query']);_0x3b9f89[_0x9796('0x47')]=_[_0x9796('0x48')](_0x3b9f89[_0x9796('0x44')],_0x3b9f89['query']);_0xaf2a74['attributes']=_[_0x9796('0x48')](_0x3b9f89[_0x9796('0x44')],qs[_0x9796('0x49')](_0x5559d7[_0x9796('0x45')][_0x9796('0x49')]));_0xaf2a74[_0x9796('0x4a')]=_0xaf2a74['attributes'][_0x9796('0x4b')]?_0xaf2a74[_0x9796('0x4a')]:_0x3b9f89['model'];if(!_0x5559d7['query'][_0x9796('0x4c')]('nolimit')){_0xaf2a74[_0x9796('0x4d')]=qs[_0x9796('0x4d')](_0x5559d7[_0x9796('0x45')][_0x9796('0x4d')]);_0xaf2a74[_0x9796('0x30')]=qs[_0x9796('0x30')](_0x5559d7[_0x9796('0x45')]['offset']);}_0xaf2a74[_0x9796('0x4e')]=qs[_0x9796('0x4f')](_0x5559d7[_0x9796('0x45')][_0x9796('0x4f')]);_0xaf2a74['where']=qs[_0x9796('0x47')](_['pick'](_0x5559d7[_0x9796('0x45')],_0x3b9f89[_0x9796('0x47')]),_0x46a155);if(_0x5559d7[_0x9796('0x45')]['filter']){_0xaf2a74[_0x9796('0x50')]=_['merge'](_0xaf2a74[_0x9796('0x50')],{'$or':_[_0x9796('0x3e')](_0x46a155,function(_0x5bef68){if(_0x5bef68['type']!==_0x9796('0x51')){var _0x31c022={};_0x31c022[_0x5bef68[_0x9796('0x3b')]]={'$like':'%'+_0x5559d7[_0x9796('0x45')][_0x9796('0x52')]+'%'};return _0x31c022;}})});}_0xaf2a74=_[_0x9796('0x53')]({},_0xaf2a74,_0x5559d7[_0x9796('0x54')]);var _0x5609df={'where':_0xaf2a74[_0x9796('0x50')]};return db[_0x9796('0x3f')][_0x9796('0x31')](_0x5609df)['then'](function(_0x5c6993){_0x130257['count']=_0x5c6993;if(_0x5559d7[_0x9796('0x45')][_0x9796('0x55')]){_0xaf2a74['include']=[{'all':!![]}];}return db[_0x9796('0x3f')][_0x9796('0x56')](_0xaf2a74);})['then'](function(_0x3b0fad){_0x130257[_0x9796('0x57')]=_0x3b0fad;return _0x130257;})[_0x9796('0x20')](respondWithFilteredResult(_0x18237d,_0xaf2a74))[_0x9796('0x2b')](handleError(_0x18237d,null));};exports['show']=function(_0x241555,_0x5018f5){var _0x2d2061={'raw':!![],'where':{'id':_0x241555[_0x9796('0x58')]['id']}},_0x4c40f9={};_0x4c40f9[_0x9796('0x44')]=_[_0x9796('0x46')](db[_0x9796('0x3f')]['rawAttributes']);_0x4c40f9['query']=_[_0x9796('0x46')](_0x241555['query']);_0x4c40f9[_0x9796('0x47')]=_['intersection'](_0x4c40f9[_0x9796('0x44')],_0x4c40f9[_0x9796('0x45')]);_0x2d2061[_0x9796('0x4a')]=_[_0x9796('0x48')](_0x4c40f9[_0x9796('0x44')],qs[_0x9796('0x49')](_0x241555[_0x9796('0x45')]['fields']));_0x2d2061['attributes']=_0x2d2061[_0x9796('0x4a')]['length']?_0x2d2061['attributes']:_0x4c40f9[_0x9796('0x44')];if(_0x241555[_0x9796('0x45')]['includeAll']){_0x2d2061[_0x9796('0x59')]=[{'all':!![]}];}_0x2d2061=_[_0x9796('0x53')]({},_0x2d2061,_0x241555['options']);return db['SmsMessage']['find'](_0x2d2061)[_0x9796('0x20')](handleEntityNotFound(_0x5018f5,null))['then'](respondWithResult(_0x5018f5,null))[_0x9796('0x2b')](handleError(_0x5018f5,null));};exports[_0x9796('0x5a')]=function(_0x53108a,_0x4ab974){return db['SmsMessage'][_0x9796('0x5a')](_0x53108a[_0x9796('0x5b')],{})['then'](respondWithResult(_0x4ab974,0xc9))[_0x9796('0x2b')](handleError(_0x4ab974,null));};exports[_0x9796('0x38')]=function(_0x2178e5,_0x1f3daa){if(_0x2178e5[_0x9796('0x5b')]['id']){delete _0x2178e5[_0x9796('0x5b')]['id'];}return db[_0x9796('0x3f')][_0x9796('0x5c')]({'where':{'id':_0x2178e5['params']['id']}})[_0x9796('0x20')](handleEntityNotFound(_0x1f3daa,null))['then'](saveUpdates(_0x2178e5[_0x9796('0x5b')],null))[_0x9796('0x20')](respondWithResult(_0x1f3daa,null))[_0x9796('0x2b')](handleError(_0x1f3daa,null));};exports[_0x9796('0x39')]=function(_0x528cc7,_0x3100a4){return db[_0x9796('0x3f')][_0x9796('0x5c')]({'where':{'id':_0x528cc7[_0x9796('0x58')]['id']}})[_0x9796('0x20')](handleEntityNotFound(_0x3100a4,null))[_0x9796('0x20')](removeEntity(_0x3100a4,null))[_0x9796('0x2b')](handleError(_0x3100a4,null));};exports['describe']=function(_0x19c422,_0xdeabfd){return db[_0x9796('0x3f')][_0x9796('0x5d')]()[_0x9796('0x20')](respondWithResult(_0xdeabfd,null))[_0x9796('0x2b')](handleError(_0xdeabfd,null));};var interaction_log=require(_0x9796('0x11'))(_0x9796('0x5e'));exports[_0x9796('0x5f')]=function(_0x42c6f7,_0x4bf599,_0x214dda){var _0x11b2b4={'agent':{},'channel':_0x9796('0x60')};if(_0x42c6f7['body']['id']){delete _0x42c6f7['body']['id'];}_0x42c6f7[_0x9796('0x5b')][_0x9796('0x61')]=!![];_0x42c6f7['body'][_0x9796('0x62')]=moment()[_0x9796('0x63')]('YYYY-MM-DD\x20HH:mm:ss');_0x42c6f7[_0x9796('0x5b')][_0x9796('0x64')]=_0x42c6f7[_0x9796('0x5b')]['UserId']||_0x42c6f7['user']['id'];_0x11b2b4['agent']['id']=_0x42c6f7[_0x9796('0x5b')][_0x9796('0x64')];return db[_0x9796('0x3f')][_0x9796('0x5c')]({'where':{'id':_0x42c6f7[_0x9796('0x58')]['id'],'UserId':null}})[_0x9796('0x20')](handleEntityNotFound(_0x4bf599,null))[_0x9796('0x20')](saveUpdates(_0x42c6f7['body'],null))[_0x9796('0x20')](function(_0x49be22){if(_0x49be22){_0x11b2b4[_0x9796('0x29')]=_0x49be22[_0x9796('0x65')]({'plain':!![]});return db[_0x9796('0x66')][_0x9796('0x5c')]({'where':{'id':_0x49be22[_0x9796('0x67')]}});}return null;})[_0x9796('0x20')](handleEntityNotFound(_0x4bf599,null))[_0x9796('0x20')](function(_0xb3fe78){if(_0xb3fe78){return _0xb3fe78['update']({'UserId':_0x42c6f7[_0x9796('0x5b')]['UserId'],'read1stAt':_[_0x9796('0x68')](_0xb3fe78[_0x9796('0x69')])?moment()['format'](_0x9796('0x6a')):undefined});}return null;})[_0x9796('0x20')](function(_0x431670){if(_0x431670){_0x11b2b4[_0x9796('0x6b')]=_0x431670[_0x9796('0x65')]({'plain':!![]});interaction_log[_0x9796('0x21')]('[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x42c6f7[_0x9796('0x6c')]['id'],_0x42c6f7['user'][_0x9796('0x3b')],_0x42c6f7[_0x9796('0x6c')][_0x9796('0x6d')],_0x11b2b4[_0x9796('0x6b')]['id'],_0x42c6f7[_0x9796('0x5b')]?JSON[_0x9796('0x26')](_0x42c6f7[_0x9796('0x5b')]):_0x9796('0x6e'));return respondWithRpcPromise(_0x9796('0x6f'),_0x9796('0x70'),_0x11b2b4);}return null;})[_0x9796('0x20')](function(_0x3a64e){var _0x572e8='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x3a64e[_0x9796('0x29')][_0x9796('0x71')];return db['sequelize'][_0x9796('0x45')](_0x572e8,{'type':db['Sequelize'][_0x9796('0x72')]['SELECT'],'raw':!![]})[_0x9796('0x20')](function(_0x4e7cfd){return _0x4e7cfd;});})['then'](function(_0x5ebeab){if(_0x5ebeab){_0x11b2b4[_0x9796('0x29')][_0x9796('0x73')]=_0x5ebeab[0x0];if(!_0x42c6f7[_0x9796('0x5b')]['UserId'])return;return db[_0x9796('0x74')][_0x9796('0x5c')]({'where':{'id':_0x42c6f7[_0x9796('0x5b')]['UserId'],'role':_0x9796('0x75')},'attributes':['id',_0x9796('0x3b'),_0x9796('0x76'),'email','internal'],'raw':!![]});}return null;})['then'](function(_0xd7606d){if(!_0xd7606d)return null;_0x11b2b4[_0x9796('0x29')][_0x9796('0x75')]=_0xd7606d;return _0x11b2b4;})[_0x9796('0x20')](function(_0x477650){if(_0x477650){if(_0x42c6f7[_0x9796('0x5b')][_0x9796('0x77')]){_0x11b2b4[_0x9796('0x29')]['interface']=util[_0x9796('0x63')](_0x9796('0x78'),_0x42c6f7[_0x9796('0x6c')][_0x9796('0x3b')]);_0x11b2b4[_0x9796('0x29')][_0x9796('0x79')]=_0x11b2b4['channel'];_0x11b2b4['message'][_0x9796('0x7a')]=_0x11b2b4[_0x9796('0x79')];_0x11b2b4['message'][_0x9796('0x7b')]=_0x9796('0x5f');return respondWithRpcPromise('EventManager','EventManager',{'event':_0x9796('0x7c'),'message':_0x11b2b4['message']},client9002)[_0x9796('0x20')](function(){return _0x11b2b4;});}return _0x11b2b4;}return null;})[_0x9796('0x20')](respondWithResult(_0x4bf599,null))['catch'](handleError(_0x4bf599,null));};var interaction_log=require(_0x9796('0x11'))(_0x9796('0x5e'));exports[_0x9796('0x36')]=function(_0x335e86,_0xb1375e,_0x311100){var _0x1f7073={'agent':{},'channel':_0x9796('0x60')};if(_0x335e86[_0x9796('0x5b')]['id']){delete _0x335e86['body']['id'];}_0x335e86['body']['UserId']=_0x335e86[_0x9796('0x5b')][_0x9796('0x64')]||_0x335e86[_0x9796('0x6c')]['id'];_0x1f7073[_0x9796('0x75')]['id']=_0x335e86['body'][_0x9796('0x64')];return db['SmsMessage'][_0x9796('0x5c')]({'where':{'id':_0x335e86[_0x9796('0x58')]['id'],'UserId':null}})[_0x9796('0x20')](handleEntityNotFound(_0xb1375e,null))[_0x9796('0x20')](function(_0x4c7d15){if(_0x4c7d15){_0x1f7073[_0x9796('0x29')]=_0x4c7d15[_0x9796('0x65')]({'plain':!![]});return db[_0x9796('0x66')]['find']({'where':{'id':_0x4c7d15['SmsInteractionId']}});}return null;})['then'](handleEntityNotFound(_0xb1375e,null))[_0x9796('0x20')](function(_0x26383b){if(_0x26383b){_0x1f7073[_0x9796('0x6b')]=_0x26383b[_0x9796('0x65')]({'plain':!![]});interaction_log[_0x9796('0x21')](_0x9796('0x7d'),_0x335e86['user']['id'],_0x335e86[_0x9796('0x6c')]['name'],_0x335e86[_0x9796('0x6c')][_0x9796('0x6d')],_0x1f7073[_0x9796('0x6b')]['id'],_0x335e86[_0x9796('0x5b')]?JSON['stringify'](_0x335e86[_0x9796('0x5b')]):_0x9796('0x6e'));return respondWithRpcPromise(_0x9796('0x7e'),_0x9796('0x7f'),_0x1f7073);}return null;})['then'](function(_0xe66310){var _0x33d8db='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0xe66310[_0x9796('0x29')][_0x9796('0x71')];return db[_0x9796('0x80')][_0x9796('0x45')](_0x33d8db,{'type':db[_0x9796('0x81')][_0x9796('0x72')]['SELECT'],'raw':!![]})[_0x9796('0x20')](function(_0x48eb7b){return _0x48eb7b;});})[_0x9796('0x20')](function(_0x256a2c){if(_0x256a2c){_0x1f7073[_0x9796('0x29')][_0x9796('0x73')]=_0x256a2c[0x0];if(!_0x335e86[_0x9796('0x5b')]['UserId'])return;return db[_0x9796('0x74')][_0x9796('0x5c')]({'where':{'id':_0x335e86[_0x9796('0x5b')][_0x9796('0x64')],'role':'agent'},'attributes':['id',_0x9796('0x3b'),_0x9796('0x76'),_0x9796('0x82'),_0x9796('0x83')],'raw':!![]});}return null;})[_0x9796('0x20')](function(_0x2175a4){if(!_0x2175a4)return null;_0x1f7073[_0x9796('0x29')][_0x9796('0x75')]=_0x2175a4;return _0x1f7073;})[_0x9796('0x20')](function(_0x425bb7){if(_0x425bb7){_0x425bb7[_0x9796('0x29')][_0x9796('0x84')]=util[_0x9796('0x63')](_0x9796('0x78'),_0x335e86[_0x9796('0x6c')]['name']);_0x425bb7[_0x9796('0x29')]['channel']=_0x1f7073['channel'];_0x425bb7['message'][_0x9796('0x7a')]=_0x1f7073[_0x9796('0x79')];_0x425bb7[_0x9796('0x29')]['event']=_0x9796('0x36');respondWithRpcPromise(_0x9796('0x85'),_0x9796('0x85'),{'event':'rejectmessage','message':_0x425bb7[_0x9796('0x29')]},client9002);return _0x1f7073;}return null;})[_0x9796('0x20')](respondWithResult(_0xb1375e,null))[_0x9796('0x2b')](handleError(_0xb1375e,null));};exports[_0x9796('0x2d')]=function(_0x289798,_0x13af18,_0xb36a04){if(_0x289798[_0x9796('0x5b')]['id']){delete _0x289798['body']['id'];}var _0x49adad;return db['SmsMessage'][_0x9796('0x5c')]({'where':{'id':_0x289798['params']['id']}})[_0x9796('0x20')](handleEntityNotFound(_0x13af18,null))[_0x9796('0x20')](function(_0x56c660){if(_0x56c660){_0x49adad=_0x56c660;return db[_0x9796('0x86')][_0x9796('0x5c')]({'where':{'id':_0x56c660['SmsAccountId']}});}})[_0x9796('0x20')](handleEntityNotFound(_0x13af18,null))[_0x9796('0x20')](function(_0x2433b7){if(_0x2433b7){logger[_0x9796('0x24')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x9796('0x2d'),'received\x20delivery\x20report\x20from',_0x2433b7[_0x9796('0x42')],util[_0x9796('0x87')](_0x289798[_0x9796('0x5b')],{'showHidden':![],'depth':null}));switch(_0x2433b7['type']){case'twilio':if(_0x289798[_0x9796('0x5b')][_0x9796('0x88')]&&_0x289798[_0x9796('0x5b')][_0x9796('0x88')]===_0x49adad['messageId']){return _0x49adad[_0x9796('0x38')]({'read':!![]});}else{logger[_0x9796('0x27')](_0x9796('0x89'),'status',_0x9796('0x8a'),util[_0x9796('0x87')](_0x289798[_0x9796('0x5b')],{'showHidden':![],'depth':null}));}break;case _0x9796('0x8b'):if(_0x289798[_0x9796('0x5b')][_0x9796('0x8c')]&&_0x289798[_0x9796('0x5b')][_0x9796('0x8c')]===_0x49adad[_0x9796('0x8d')]&&_[_0x9796('0x8e')]([_0x9796('0x8f'),'delivered'],_0x289798['body']['Status'])>=0x0){return _0x49adad[_0x9796('0x38')]({'read':!![]});}else{logger['error'](_0x9796('0x89'),_0x9796('0x2d'),'plivio',util[_0x9796('0x87')](_0x289798['body'],{'showHidden':![],'depth':null}));}break;case _0x9796('0x90'):var _0x16e109=_0x289798['body']['results'][0x0];if(_0x16e109[_0x9796('0x2d')][_0x9796('0x91')]===_0x9796('0x92')){return _0x49adad[_0x9796('0x38')]({'read':!![]});}else{logger[_0x9796('0x27')](_0x9796('0x89'),_0x9796('0x2d'),_0x9796('0x90'),util[_0x9796('0x87')](_0x289798[_0x9796('0x5b')],{'showHidden':![],'depth':null}));}break;}return _0x49adad;}})[_0x9796('0x20')](respondWithResult(_0x13af18,null))[_0x9796('0x2b')](handleError(_0x13af18,null));}; \ No newline at end of file +var _0x253d=['mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','jayson/promise','client','request','info','debug','stringify','error','code','SmsMessage,\x20%s,\x20%s','message','result','catch','end','status','json','offset','undefined','count','limit','set','Content-Range','reject','update','then','destroy','sendStatus','name','send','index','map','SmsMessage','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','rows','show','params','include','options','find','create','body','describe','accept','sms','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','SmsInteraction','isNil','read1stAt','interaction','get','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','User','fullname','email','SIP/%s','channel','motionChannel','EventManager','acceptmessage','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','Sequelize','SELECT','contact','interface','rejectmessage','SmsAccount','SmsAccountId','SmsMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','indexOf','sent','delivered','Status','plivio','results','groupName','DELIVERED','infobip','eml-format','moment','bluebird'];(function(_0x28294a,_0x542642){var _0x3bef7d=function(_0x2229f4){while(--_0x2229f4){_0x28294a['push'](_0x28294a['shift']());}};_0x3bef7d(++_0x542642);}(_0x253d,0x1b3));var _0xd253=function(_0x5588d7,_0x2d8daf){_0x5588d7=_0x5588d7-0x0;var _0x4dfa03=_0x253d[_0x5588d7];return _0x4dfa03;};'use strict';var emlformat=require(_0xd253('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xd253('0x1'));var BPromise=require(_0xd253('0x2'));var Mustache=require(_0xd253('0x3'));var util=require(_0xd253('0x4'));var path=require(_0xd253('0x5'));var sox=require('sox');var csv=require(_0xd253('0x6'));var ejs=require(_0xd253('0x7'));var fs=require('fs');var fs_extra=require(_0xd253('0x8'));var _=require(_0xd253('0x9'));var squel=require(_0xd253('0xa'));var crypto=require('crypto');var jsforce=require(_0xd253('0xb'));var deskjs=require(_0xd253('0xc'));var toCsv=require(_0xd253('0x6'));var querystring=require(_0xd253('0xd'));var Papa=require(_0xd253('0xe'));var Redis=require(_0xd253('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xd253('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd253('0x11'))(_0xd253('0x12'));var utils=require(_0xd253('0x13'));var config=require(_0xd253('0x14'));var licenseUtil=require(_0xd253('0x15'));var db=require(_0xd253('0x16'))['db'];config['redis']=_['defaults'](config[_0xd253('0x17')],{'host':_0xd253('0x18'),'port':0x18eb});var socket=require(_0xd253('0x19'))(new Redis(config['redis']));require('./smsMessage.socket')[_0xd253('0x1a')](socket);var jayson=require(_0xd253('0x1b'));var client=jayson[_0xd253('0x1c')]['http']({'port':0x232c});var client9002=jayson[_0xd253('0x1c')]['http']({'port':0x232a});function respondWithRpcPromise(_0x8b15a6,_0x435711,_0x24fa24,_0x5196a3){return new BPromise(function(_0x1b7ed1,_0x5bb9c9){var _0x427c6a=_0x5196a3||client;return _0x427c6a[_0xd253('0x1d')](_0x8b15a6,_0x24fa24)['then'](function(_0x2496cb){logger[_0xd253('0x1e')]('SmsMessage,\x20%s,\x20%s',_0x435711,'request\x20sent');logger[_0xd253('0x1f')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x435711,'request\x20sent',JSON[_0xd253('0x20')](_0x2496cb));if(_0x2496cb['error']){if(_0x2496cb[_0xd253('0x21')][_0xd253('0x22')]===0x1f4){logger[_0xd253('0x21')](_0xd253('0x23'),_0x435711,_0x2496cb['error'][_0xd253('0x24')]);return _0x5bb9c9(_0x2496cb['error'][_0xd253('0x24')]);}logger['error'](_0xd253('0x23'),_0x435711,_0x2496cb[_0xd253('0x21')][_0xd253('0x24')]);return _0x1b7ed1(_0x2496cb[_0xd253('0x21')]['message']);}else{logger[_0xd253('0x1e')](_0xd253('0x23'),_0x435711,'request\x20sent');_0x1b7ed1(_0x2496cb[_0xd253('0x25')][_0xd253('0x24')]);}})[_0xd253('0x26')](function(_0x336736){logger[_0xd253('0x21')](_0xd253('0x23'),_0x435711,_0x336736);_0x5bb9c9(_0x336736);});});}function respondWithStatusCode(_0xb9a661,_0x55851f){_0x55851f=_0x55851f||0xcc;return function(_0x10b635){if(_0x10b635){return _0xb9a661['sendStatus'](_0x55851f);}return _0xb9a661['status'](_0x55851f)[_0xd253('0x27')]();};}function respondWithResult(_0x3e36cc,_0x4a4ba1){_0x4a4ba1=_0x4a4ba1||0xc8;return function(_0x542494){if(_0x542494){return _0x3e36cc[_0xd253('0x28')](_0x4a4ba1)[_0xd253('0x29')](_0x542494);}};}function respondWithFilteredResult(_0x566e37,_0x3955a0){return function(_0x382c5f){if(_0x382c5f){var _0x1c6f39=typeof _0x3955a0[_0xd253('0x2a')]===_0xd253('0x2b')&&typeof _0x3955a0['limit']===_0xd253('0x2b');var _0x31a217=_0x382c5f[_0xd253('0x2c')];var _0x5dc9c9=_0x1c6f39?0x0:_0x3955a0[_0xd253('0x2a')];var _0x51b8dd=_0x1c6f39?_0x382c5f[_0xd253('0x2c')]:_0x3955a0[_0xd253('0x2a')]+_0x3955a0[_0xd253('0x2d')];var _0x2934a5;if(_0x51b8dd>=_0x31a217){_0x51b8dd=_0x31a217;_0x2934a5=0xc8;}else{_0x2934a5=0xce;}_0x566e37[_0xd253('0x28')](_0x2934a5);return _0x566e37[_0xd253('0x2e')](_0xd253('0x2f'),_0x5dc9c9+'-'+_0x51b8dd+'/'+_0x31a217)[_0xd253('0x29')](_0x382c5f);}return null;};}function patchUpdates(_0x42eefe){return function(_0x2a730d){try{jsonpatch['apply'](_0x2a730d,_0x42eefe,!![]);}catch(_0x341ae1){return BPromise[_0xd253('0x30')](_0x341ae1);}return _0x2a730d['save']();};}function saveUpdates(_0x4eba8c,_0x15f42b){return function(_0x4f48f7){if(_0x4f48f7){return _0x4f48f7[_0xd253('0x31')](_0x4eba8c)[_0xd253('0x32')](function(_0x44a1a0){return _0x44a1a0;});}return null;};}function removeEntity(_0x13880e,_0x59d326){return function(_0x2677db){if(_0x2677db){return _0x2677db[_0xd253('0x33')]()[_0xd253('0x32')](function(){_0x13880e[_0xd253('0x28')](0xcc)[_0xd253('0x27')]();});}};}function handleEntityNotFound(_0x3142b5,_0x1c328e){return function(_0x5e2be8){if(!_0x5e2be8){_0x3142b5[_0xd253('0x34')](0x194);}return _0x5e2be8;};}function handleError(_0x22f60a,_0x93325c){_0x93325c=_0x93325c||0x1f4;return function(_0x14cb05){logger[_0xd253('0x21')](_0x14cb05['stack']);if(_0x14cb05[_0xd253('0x35')]){delete _0x14cb05['name'];}_0x22f60a[_0xd253('0x28')](_0x93325c)[_0xd253('0x36')](_0x14cb05);};}exports[_0xd253('0x37')]=function(_0x477433,_0x5c388e){var _0x10f132={},_0x2ee9ba={},_0x1425fd={'count':0x0,'rows':[]};var _0x380bd2=_[_0xd253('0x38')](db[_0xd253('0x39')][_0xd253('0x3a')],function(_0x667d6a){return{'name':_0x667d6a[_0xd253('0x3b')],'type':_0x667d6a[_0xd253('0x3c')][_0xd253('0x3d')]};});_0x2ee9ba[_0xd253('0x3e')]=_[_0xd253('0x38')](_0x380bd2,_0xd253('0x35'));_0x2ee9ba['query']=_[_0xd253('0x3f')](_0x477433[_0xd253('0x40')]);_0x2ee9ba[_0xd253('0x41')]=_['intersection'](_0x2ee9ba[_0xd253('0x3e')],_0x2ee9ba[_0xd253('0x40')]);_0x10f132[_0xd253('0x42')]=_[_0xd253('0x43')](_0x2ee9ba['model'],qs[_0xd253('0x44')](_0x477433[_0xd253('0x40')]['fields']));_0x10f132[_0xd253('0x42')]=_0x10f132[_0xd253('0x42')][_0xd253('0x45')]?_0x10f132[_0xd253('0x42')]:_0x2ee9ba[_0xd253('0x3e')];if(!_0x477433[_0xd253('0x40')][_0xd253('0x46')](_0xd253('0x47'))){_0x10f132[_0xd253('0x2d')]=qs[_0xd253('0x2d')](_0x477433['query'][_0xd253('0x2d')]);_0x10f132[_0xd253('0x2a')]=qs[_0xd253('0x2a')](_0x477433[_0xd253('0x40')]['offset']);}_0x10f132['order']=qs[_0xd253('0x48')](_0x477433[_0xd253('0x40')][_0xd253('0x48')]);_0x10f132[_0xd253('0x49')]=qs[_0xd253('0x41')](_[_0xd253('0x4a')](_0x477433[_0xd253('0x40')],_0x2ee9ba['filters']),_0x380bd2);if(_0x477433[_0xd253('0x40')][_0xd253('0x4b')]){_0x10f132['where']=_[_0xd253('0x4c')](_0x10f132[_0xd253('0x49')],{'$or':_[_0xd253('0x38')](_0x380bd2,function(_0x3e914f){if(_0x3e914f['type']!==_0xd253('0x4d')){var _0x585c78={};_0x585c78[_0x3e914f[_0xd253('0x35')]]={'$like':'%'+_0x477433['query'][_0xd253('0x4b')]+'%'};return _0x585c78;}})});}_0x10f132=_[_0xd253('0x4c')]({},_0x10f132,_0x477433['options']);var _0x5964ba={'where':_0x10f132['where']};return db[_0xd253('0x39')]['count'](_0x5964ba)['then'](function(_0x41a68d){_0x1425fd[_0xd253('0x2c')]=_0x41a68d;if(_0x477433[_0xd253('0x40')][_0xd253('0x4e')]){_0x10f132['include']=[{'all':!![]}];}return db[_0xd253('0x39')]['findAll'](_0x10f132);})['then'](function(_0x2a4e0){_0x1425fd[_0xd253('0x4f')]=_0x2a4e0;return _0x1425fd;})[_0xd253('0x32')](respondWithFilteredResult(_0x5c388e,_0x10f132))[_0xd253('0x26')](handleError(_0x5c388e,null));};exports[_0xd253('0x50')]=function(_0x33479c,_0x16ab6b){var _0x2fb051={'raw':!![],'where':{'id':_0x33479c[_0xd253('0x51')]['id']}},_0x2c6af6={};_0x2c6af6[_0xd253('0x3e')]=_[_0xd253('0x3f')](db[_0xd253('0x39')][_0xd253('0x3a')]);_0x2c6af6[_0xd253('0x40')]=_[_0xd253('0x3f')](_0x33479c[_0xd253('0x40')]);_0x2c6af6[_0xd253('0x41')]=_[_0xd253('0x43')](_0x2c6af6[_0xd253('0x3e')],_0x2c6af6[_0xd253('0x40')]);_0x2fb051[_0xd253('0x42')]=_[_0xd253('0x43')](_0x2c6af6[_0xd253('0x3e')],qs[_0xd253('0x44')](_0x33479c[_0xd253('0x40')]['fields']));_0x2fb051[_0xd253('0x42')]=_0x2fb051[_0xd253('0x42')][_0xd253('0x45')]?_0x2fb051['attributes']:_0x2c6af6[_0xd253('0x3e')];if(_0x33479c['query'][_0xd253('0x4e')]){_0x2fb051[_0xd253('0x52')]=[{'all':!![]}];}_0x2fb051=_[_0xd253('0x4c')]({},_0x2fb051,_0x33479c[_0xd253('0x53')]);return db[_0xd253('0x39')][_0xd253('0x54')](_0x2fb051)[_0xd253('0x32')](handleEntityNotFound(_0x16ab6b,null))[_0xd253('0x32')](respondWithResult(_0x16ab6b,null))[_0xd253('0x26')](handleError(_0x16ab6b,null));};exports[_0xd253('0x55')]=function(_0x1efb92,_0x2d6b0d){return db[_0xd253('0x39')][_0xd253('0x55')](_0x1efb92[_0xd253('0x56')],{})[_0xd253('0x32')](respondWithResult(_0x2d6b0d,0xc9))['catch'](handleError(_0x2d6b0d,null));};exports[_0xd253('0x31')]=function(_0x2ac8e2,_0x5505bc){if(_0x2ac8e2[_0xd253('0x56')]['id']){delete _0x2ac8e2['body']['id'];}return db[_0xd253('0x39')]['find']({'where':{'id':_0x2ac8e2[_0xd253('0x51')]['id']}})[_0xd253('0x32')](handleEntityNotFound(_0x5505bc,null))[_0xd253('0x32')](saveUpdates(_0x2ac8e2[_0xd253('0x56')],null))[_0xd253('0x32')](respondWithResult(_0x5505bc,null))[_0xd253('0x26')](handleError(_0x5505bc,null));};exports[_0xd253('0x33')]=function(_0x29b06a,_0xbdbc65){return db['SmsMessage'][_0xd253('0x54')]({'where':{'id':_0x29b06a['params']['id']}})['then'](handleEntityNotFound(_0xbdbc65,null))[_0xd253('0x32')](removeEntity(_0xbdbc65,null))[_0xd253('0x26')](handleError(_0xbdbc65,null));};exports[_0xd253('0x57')]=function(_0x2a24cb,_0x15d966){return db[_0xd253('0x39')][_0xd253('0x57')]()['then'](respondWithResult(_0x15d966,null))['catch'](handleError(_0x15d966,null));};var interaction_log=require('../../config/logger')('sms-interactions');exports[_0xd253('0x58')]=function(_0x264438,_0xf7cadc,_0x55b545){var _0x308557={'agent':{},'channel':_0xd253('0x59')};if(_0x264438[_0xd253('0x56')]['id']){delete _0x264438[_0xd253('0x56')]['id'];}_0x264438[_0xd253('0x56')][_0xd253('0x5a')]=!![];_0x264438['body'][_0xd253('0x5b')]=moment()[_0xd253('0x5c')](_0xd253('0x5d'));_0x264438[_0xd253('0x56')][_0xd253('0x5e')]=_0x264438['body'][_0xd253('0x5e')]||_0x264438[_0xd253('0x5f')]['id'];_0x308557[_0xd253('0x60')]['id']=_0x264438[_0xd253('0x56')][_0xd253('0x5e')];return db[_0xd253('0x39')][_0xd253('0x54')]({'where':{'id':_0x264438['params']['id'],'UserId':null}})[_0xd253('0x32')](handleEntityNotFound(_0xf7cadc,null))[_0xd253('0x32')](saveUpdates(_0x264438[_0xd253('0x56')],null))[_0xd253('0x32')](function(_0x2ec973){if(_0x2ec973){_0x308557[_0xd253('0x24')]=_0x2ec973['get']({'plain':!![]});return db[_0xd253('0x61')][_0xd253('0x54')]({'where':{'id':_0x2ec973['SmsInteractionId']}});}return null;})[_0xd253('0x32')](handleEntityNotFound(_0xf7cadc,null))[_0xd253('0x32')](function(_0x17e13d){if(_0x17e13d){return _0x17e13d[_0xd253('0x31')]({'UserId':_0x264438[_0xd253('0x56')]['UserId'],'read1stAt':_[_0xd253('0x62')](_0x17e13d[_0xd253('0x63')])?moment()['format'](_0xd253('0x5d')):undefined});}return null;})['then'](function(_0x265e9d){if(_0x265e9d){_0x308557[_0xd253('0x64')]=_0x265e9d[_0xd253('0x65')]({'plain':!![]});interaction_log[_0xd253('0x1e')]('[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x264438[_0xd253('0x5f')]['id'],_0x264438[_0xd253('0x5f')][_0xd253('0x35')],_0x264438[_0xd253('0x5f')][_0xd253('0x66')],_0x308557[_0xd253('0x64')]['id'],_0x264438[_0xd253('0x56')]?JSON[_0xd253('0x20')](_0x264438['body']):_0xd253('0x67'));return respondWithRpcPromise(_0xd253('0x68'),_0xd253('0x69'),_0x308557);}return null;})[_0xd253('0x32')](function(_0x216267){var _0x5dc0ee=_0xd253('0x6a')+_0x216267[_0xd253('0x24')][_0xd253('0x6b')];return db[_0xd253('0x6c')][_0xd253('0x40')](_0x5dc0ee,{'type':db['Sequelize'][_0xd253('0x6d')]['SELECT'],'raw':!![]})[_0xd253('0x32')](function(_0x2e5c8a){return _0x2e5c8a;});})[_0xd253('0x32')](function(_0x2448a0){if(_0x2448a0){_0x308557[_0xd253('0x24')]['contact']=_0x2448a0[0x0];if(!_0x264438[_0xd253('0x56')][_0xd253('0x5e')])return;return db[_0xd253('0x6e')][_0xd253('0x54')]({'where':{'id':_0x264438[_0xd253('0x56')][_0xd253('0x5e')],'role':_0xd253('0x60')},'attributes':['id',_0xd253('0x35'),_0xd253('0x6f'),_0xd253('0x70'),'internal'],'raw':!![]});}return null;})[_0xd253('0x32')](function(_0x39f4ab){if(!_0x39f4ab)return null;_0x308557['message'][_0xd253('0x60')]=_0x39f4ab;return _0x308557;})[_0xd253('0x32')](function(_0x428618){if(_0x428618){if(_0x264438[_0xd253('0x56')]['manual']){_0x308557[_0xd253('0x24')]['interface']=util[_0xd253('0x5c')](_0xd253('0x71'),_0x264438[_0xd253('0x5f')][_0xd253('0x35')]);_0x308557[_0xd253('0x24')]['channel']=_0x308557[_0xd253('0x72')];_0x308557[_0xd253('0x24')][_0xd253('0x73')]=_0x308557['channel'];_0x308557['message']['event']=_0xd253('0x58');return respondWithRpcPromise(_0xd253('0x74'),_0xd253('0x74'),{'event':_0xd253('0x75'),'message':_0x308557[_0xd253('0x24')]},client9002)['then'](function(){return _0x308557;});}return _0x308557;}return null;})[_0xd253('0x32')](respondWithResult(_0xf7cadc,null))[_0xd253('0x26')](handleError(_0xf7cadc,null));};var interaction_log=require(_0xd253('0x11'))('sms-interactions');exports[_0xd253('0x30')]=function(_0x5ae835,_0x6cd92d,_0x31db11){var _0x805e05={'agent':{},'channel':_0xd253('0x59')};if(_0x5ae835[_0xd253('0x56')]['id']){delete _0x5ae835['body']['id'];}_0x5ae835['body'][_0xd253('0x5e')]=_0x5ae835[_0xd253('0x56')][_0xd253('0x5e')]||_0x5ae835['user']['id'];_0x805e05[_0xd253('0x60')]['id']=_0x5ae835[_0xd253('0x56')][_0xd253('0x5e')];return db[_0xd253('0x39')][_0xd253('0x54')]({'where':{'id':_0x5ae835[_0xd253('0x51')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x6cd92d,null))[_0xd253('0x32')](function(_0x1f9f34){if(_0x1f9f34){_0x805e05['message']=_0x1f9f34[_0xd253('0x65')]({'plain':!![]});return db[_0xd253('0x61')][_0xd253('0x54')]({'where':{'id':_0x1f9f34['SmsInteractionId']}});}return null;})[_0xd253('0x32')](handleEntityNotFound(_0x6cd92d,null))[_0xd253('0x32')](function(_0xd2089){if(_0xd2089){_0x805e05[_0xd253('0x64')]=_0xd2089[_0xd253('0x65')]({'plain':!![]});interaction_log[_0xd253('0x1e')](_0xd253('0x76'),_0x5ae835['user']['id'],_0x5ae835['user'][_0xd253('0x35')],_0x5ae835[_0xd253('0x5f')][_0xd253('0x66')],_0x805e05['interaction']['id'],_0x5ae835[_0xd253('0x56')]?JSON['stringify'](_0x5ae835[_0xd253('0x56')]):_0xd253('0x67'));return respondWithRpcPromise(_0xd253('0x77'),_0xd253('0x78'),_0x805e05);}return null;})['then'](function(_0x1ad8aa){var _0x484128='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x1ad8aa[_0xd253('0x24')]['ContactId'];return db[_0xd253('0x6c')][_0xd253('0x40')](_0x484128,{'type':db[_0xd253('0x79')]['QueryTypes'][_0xd253('0x7a')],'raw':!![]})['then'](function(_0x4a6e27){return _0x4a6e27;});})[_0xd253('0x32')](function(_0x12e16f){if(_0x12e16f){_0x805e05['message'][_0xd253('0x7b')]=_0x12e16f[0x0];if(!_0x5ae835[_0xd253('0x56')][_0xd253('0x5e')])return;return db[_0xd253('0x6e')][_0xd253('0x54')]({'where':{'id':_0x5ae835[_0xd253('0x56')][_0xd253('0x5e')],'role':'agent'},'attributes':['id','name',_0xd253('0x6f'),_0xd253('0x70'),'internal'],'raw':!![]});}return null;})[_0xd253('0x32')](function(_0x26b00b){if(!_0x26b00b)return null;_0x805e05[_0xd253('0x24')][_0xd253('0x60')]=_0x26b00b;return _0x805e05;})[_0xd253('0x32')](function(_0x2d4251){if(_0x2d4251){_0x2d4251[_0xd253('0x24')][_0xd253('0x7c')]=util[_0xd253('0x5c')](_0xd253('0x71'),_0x5ae835[_0xd253('0x5f')][_0xd253('0x35')]);_0x2d4251[_0xd253('0x24')][_0xd253('0x72')]=_0x805e05['channel'];_0x2d4251[_0xd253('0x24')][_0xd253('0x73')]=_0x805e05[_0xd253('0x72')];_0x2d4251['message']['event']='reject';respondWithRpcPromise(_0xd253('0x74'),_0xd253('0x74'),{'event':_0xd253('0x7d'),'message':_0x2d4251[_0xd253('0x24')]},client9002);return _0x805e05;}return null;})['then'](respondWithResult(_0x6cd92d,null))[_0xd253('0x26')](handleError(_0x6cd92d,null));};exports['status']=function(_0x1f344b,_0x2cbf53,_0xc1f0ca){if(_0x1f344b[_0xd253('0x56')]['id']){delete _0x1f344b['body']['id'];}var _0xc5000;return db[_0xd253('0x39')]['find']({'where':{'id':_0x1f344b['params']['id']}})[_0xd253('0x32')](handleEntityNotFound(_0x2cbf53,null))['then'](function(_0x40b770){if(_0x40b770){_0xc5000=_0x40b770;return db[_0xd253('0x7e')][_0xd253('0x54')]({'where':{'id':_0x40b770[_0xd253('0x7f')]}});}})['then'](handleEntityNotFound(_0x2cbf53,null))['then'](function(_0x4ea468){if(_0x4ea468){logger[_0xd253('0x1f')](_0xd253('0x80'),'status',_0xd253('0x81'),_0x4ea468['type'],util[_0xd253('0x82')](_0x1f344b[_0xd253('0x56')],{'showHidden':![],'depth':null}));switch(_0x4ea468[_0xd253('0x3c')]){case _0xd253('0x83'):if(_0x1f344b[_0xd253('0x56')]['MessageSid']&&_0x1f344b[_0xd253('0x56')][_0xd253('0x84')]===_0xc5000[_0xd253('0x85')]){return _0xc5000[_0xd253('0x31')]({'read':!![]});}else{logger[_0xd253('0x21')](_0xd253('0x86'),'status','twilio',util[_0xd253('0x82')](_0x1f344b[_0xd253('0x56')],{'showHidden':![],'depth':null}));}break;case _0xd253('0x87'):if(_0x1f344b[_0xd253('0x56')][_0xd253('0x88')]&&_0x1f344b[_0xd253('0x56')][_0xd253('0x88')]===_0xc5000[_0xd253('0x85')]&&_[_0xd253('0x89')]([_0xd253('0x8a'),_0xd253('0x8b')],_0x1f344b[_0xd253('0x56')][_0xd253('0x8c')])>=0x0){return _0xc5000[_0xd253('0x31')]({'read':!![]});}else{logger[_0xd253('0x21')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xd253('0x28'),_0xd253('0x8d'),util[_0xd253('0x82')](_0x1f344b[_0xd253('0x56')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x364396=_0x1f344b['body'][_0xd253('0x8e')][0x0];if(_0x364396[_0xd253('0x28')][_0xd253('0x8f')]===_0xd253('0x90')){return _0xc5000['update']({'read':!![]});}else{logger[_0xd253('0x21')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0xd253('0x91'),util['inspect'](_0x1f344b[_0xd253('0x56')],{'showHidden':![],'depth':null}));}break;}return _0xc5000;}})['then'](respondWithResult(_0x2cbf53,null))[_0xd253('0x26')](handleError(_0x2cbf53,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index 95cb1b7..a0539ad 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 _0x64ad=['events','../../mysqldb','setMaxListeners','exports'];(function(_0xbb777d,_0x53746a){var _0x5dde69=function(_0xf1c4b4){while(--_0xf1c4b4){_0xbb777d['push'](_0xbb777d['shift']());}};_0x5dde69(++_0x53746a);}(_0x64ad,0xa8));var _0xd64a=function(_0x1b2255,_0x3de34f){_0x1b2255=_0x1b2255-0x0;var _0x33e57d=_0x64ad[_0x1b2255];return _0x33e57d;};'use strict';var EventEmitter=require(_0xd64a('0x0'));var SmsMessage=require(_0xd64a('0x1'))['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xd64a('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x44b4d6){return function(_0x5760a7,_0x31486b,_0x126845){SmsMessageEvents['emit'](_0x44b4d6+':'+_0x5760a7['id'],_0x5760a7);SmsMessageEvents['emit'](_0x44b4d6,_0x5760a7);_0x126845(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsMessage['hook'](e,emitEvent(event));}}module[_0xd64a('0x3')]=SmsMessageEvents; \ No newline at end of file +var _0xd403=['exports','events','setMaxListeners','save','update','emit','hasOwnProperty','hook'];(function(_0x5bd626,_0xdbf46d){var _0x2661ca=function(_0x421ff4){while(--_0x421ff4){_0x5bd626['push'](_0x5bd626['shift']());}};_0x2661ca(++_0xdbf46d);}(_0xd403,0xf1));var _0x3d40=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0xd403[_0x2dadb9];return _0x2f0097;};'use strict';var EventEmitter=require(_0x3d40('0x0'));var SmsMessage=require('../../mysqldb')['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x3d40('0x1')](0x0);var events={'afterCreate':_0x3d40('0x2'),'afterUpdate':_0x3d40('0x3'),'afterDestroy':'remove'};function emitEvent(_0x2c758d){return function(_0x391adf,_0x42ce54,_0x43de0b){SmsMessageEvents['emit'](_0x2c758d+':'+_0x391adf['id'],_0x391adf);SmsMessageEvents[_0x3d40('0x4')](_0x2c758d,_0x391adf);_0x43de0b(null);};}for(var e in events){if(events[_0x3d40('0x5')](e)){var event=events[e];SmsMessage[_0x3d40('0x6')](e,emitEvent(event));}}module[_0x3d40('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 7fd0026..3e487d8 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 _0x92d7=['UTF-8','apiMessageId','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','applicationId','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsMessage.attributes','exports','define','SmsMessage','sms_messages','messageId','fti_sms_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','UserId','SmsInteraction','findOne','SmsInteractionId','then','update','createdAt','catch','error','SmsAccount','find','SmsAccountId','twilio','accountSid','authToken','phone','messages','create','remote','/api/sms/messages/','/status?token=','token','sid','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','username','password','smsMethod','sender','GET','split','user_key','session_key','total_sent','internal_order_id','deliveryReport','read','SmsMessage,\x20%s,\x20%s,\x20%s','inspect','connectel','senderString','POST','requestid','format','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','base64','http_code','data','message_id','clickSend','Missing\x20parameters:\x20username,\x20password','plivo','https://api.plivo.com/v1/Account/%s/Message/','toString','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/sms/2/text/advanced','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','csc','crypto','login','timestamp','sort','length','apiKey','digest','signature=','/external/get/send.php?','keys','clickatell','uuid'];(function(_0x5d88c0,_0x5d7d83){var _0x1b40f0=function(_0x3fde10){while(--_0x3fde10){_0x5d88c0['push'](_0x5d88c0['shift']());}};_0x1b40f0(++_0x5d7d83);}(_0x92d7,0x17b));var _0x792d=function(_0x1a4e80,_0x58016c){_0x1a4e80=_0x1a4e80-0x0;var _0x5198c3=_0x92d7[_0x1a4e80];return _0x5198c3;};'use strict';var _=require(_0x792d('0x0'));var util=require('util');var logger=require(_0x792d('0x1'))(_0x792d('0x2'));var moment=require(_0x792d('0x3'));var BPromise=require(_0x792d('0x4'));var rp=require(_0x792d('0x5'));var fs=require('fs');var path=require(_0x792d('0x6'));var rimraf=require(_0x792d('0x7'));var config=require(_0x792d('0x8'));var attributes=require(_0x792d('0x9'));module[_0x792d('0xa')]=function(_0x54374f,_0x3e95c4){return _0x54374f[_0x792d('0xb')](_0x792d('0xc'),attributes,{'tableName':_0x792d('0xd'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0x792d('0xe')]},{'name':_0x792d('0xf'),'fields':[_0x792d('0x10')],'type':_0x792d('0x11')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x35bf20,_0x1cef60,_0xf33083){var _0x4be215=_0x54374f[_0x792d('0x12')];var _0x4fb7cb=_0x35bf20[_0x792d('0x13')]({'plain':!![]});if(_0x4fb7cb[_0x792d('0x14')]['toLowerCase']()==='in'||_0x4fb7cb['direction'][_0x792d('0x15')]()===_0x792d('0x16')&&!_0x4fb7cb[_0x792d('0x17')]&&!_['isNil'](_0x4fb7cb[_0x792d('0x18')])){_0x4be215[_0x792d('0x19')][_0x792d('0x1a')]({'where':{'id':_0x4fb7cb[_0x792d('0x1b')]}})[_0x792d('0x1c')](function(_0x3ead79){if(_0x3ead79){_0x3ead79[_0x792d('0x1d')]({'lastMsgAt':_0x4fb7cb[_0x792d('0x1e')],'lastMsgDirection':_0x4fb7cb[_0x792d('0x14')][_0x792d('0x15')]()});}})[_0x792d('0x1f')](function(_0x252b34){console[_0x792d('0x20')](_0x252b34);});}if(_0x4fb7cb[_0x792d('0x14')]===_0x792d('0x16')&&!_0x4fb7cb['secret']){var _0x4069f3;_0x4be215[_0x792d('0x21')][_0x792d('0x22')]({'where':{'id':_0x4fb7cb[_0x792d('0x23')]},'raw':!![]})['then'](function(_0x78ed2c){_0x4069f3=_0x78ed2c;if(_0x4069f3&&_0x4069f3['type']){switch(_0x4069f3['type']){case'twilio':var _0x5764de=require(_0x792d('0x24'));if(_0x4069f3[_0x792d('0x25')]&&_0x4069f3[_0x792d('0x26')]&&_0x4069f3[_0x792d('0x27')]){var _0x5b089a=new _0x5764de(_0x4069f3['accountSid'],_0x4069f3[_0x792d('0x26')]);_0x5b089a[_0x792d('0x28')][_0x792d('0x29')]({'body':_0x4fb7cb[_0x792d('0x10')],'to':_0x4fb7cb[_0x792d('0x27')],'from':_0x4069f3[_0x792d('0x27')],'statusCallback':_0x4069f3[_0x792d('0x2a')]+_0x792d('0x2b')+_0x4fb7cb['id']+_0x792d('0x2c')+_0x4069f3[_0x792d('0x2d')]})[_0x792d('0x1c')](function(_0x101a5c){if(_0x101a5c[_0x792d('0x2e')]){return _0x35bf20[_0x792d('0x1d')]({'messageId':_0x101a5c[_0x792d('0x2e')]});}})[_0x792d('0x1f')](function(_0x49258e){logger[_0x792d('0x20')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x792d('0x2f'),'twilio',util['inspect'](_0x49258e,{'showHidden':![],'depth':null}));});}else{logger[_0x792d('0x20')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x792d('0x2f'),'twilio',_0x792d('0x30'));}break;case _0x792d('0x31'):var _0x3543d4='https://api.skebby.it/API/v1.0/REST/';if(_0x4069f3[_0x792d('0x32')]&&_0x4069f3[_0x792d('0x33')]){var _0x1b4435={'recipient':[_0x4fb7cb[_0x792d('0x27')]],'message':_0x4fb7cb[_0x792d('0x10')],'message_type':_0x4069f3[_0x792d('0x34')]};if(_0x4069f3[_0x792d('0x34')]&&_0x4069f3['smsMethod']!=='SI'){_0x1b4435[_0x792d('0x35')]=_0x4069f3[_0x792d('0x27')];}var _0xa509de={'url':_0x3543d4+'login?username='+_0x4069f3[_0x792d('0x32')]+'&password='+_0x4069f3[_0x792d('0x33')],'method':_0x792d('0x36')};rp(_0xa509de)[_0x792d('0x1c')](function(_0x31ed20){var _0xc2d3f4=_0x31ed20[_0x792d('0x37')](';');var _0x44cd71={'user_key':_0xc2d3f4[0x0],'session_key':_0xc2d3f4[0x1]};_0xa509de={'url':_0x3543d4+'sms','method':'POST','headers':{'user_key':_0x44cd71[_0x792d('0x38')],'Session_key':_0x44cd71[_0x792d('0x39')]},'json':!![],'body':_0x1b4435};return rp(_0xa509de);})['then'](function(_0x76cf6f){if(_0x76cf6f[_0x792d('0x3a')]>=0x1){var _0x3055a0={'messageId':_0x76cf6f[_0x792d('0x3b')]};if(_0x4069f3[_0x792d('0x34')]!=='GP'||!_0x4069f3[_0x792d('0x3c')]){_0x3055a0[_0x792d('0x3d')]=!![];}return _0x35bf20[_0x792d('0x1d')](_0x3055a0);}else{return logger[_0x792d('0x20')](_0x792d('0x3e'),_0x792d('0x2f'),_0x792d('0x31'),util[_0x792d('0x3f')](_0x76cf6f,{'showHidden':![],'depth':null}));}})[_0x792d('0x1f')](function(_0x5915ef){return logger[_0x792d('0x20')](_0x792d('0x3e'),_0x792d('0x2f'),_0x792d('0x31'),util['inspect'](_0x5915ef,{'showHidden':![],'depth':null}));});}else{logger[_0x792d('0x20')](_0x792d('0x3e'),_0x792d('0x2f'),_0x792d('0x31'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x792d('0x40'):if(_0x4069f3[_0x792d('0x26')]){var _0x33526d={'recipient':_0x4fb7cb[_0x792d('0x27')],'message':_0x4fb7cb['body'],'sender':_0x4069f3[_0x792d('0x41')]||_0x4069f3[_0x792d('0x27')],'authorization':_0x4069f3[_0x792d('0x26')]};var _0x1cef60={'method':_0x792d('0x42'),'uri':'https://smsapi.connectel.se/api/v2/send/','body':_0x33526d,'json':!![]};rp(_0x1cef60)[_0x792d('0x1c')](function(_0x30c7bb){var _0x518a4c={'messageId':_0x30c7bb[_0x792d('0x43')]};if(!_0x4069f3['deliveryReport']){_0x518a4c['read']=!![];}return _0x35bf20[_0x792d('0x1d')](_0x518a4c);})[_0x792d('0x1f')](function(_0x48a951){logger['error'](_0x792d('0x3e'),_0x792d('0x2f'),_0x792d('0x40'),util[_0x792d('0x3f')](_0x48a951,{'showHidden':![],'depth':null}));});}else{logger[_0x792d('0x20')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x792d('0x2f'),'connectel','Missing\x20parameters:\x20authToken');}break;case'clicksend':if(_0x4069f3[_0x792d('0x32')]&&_0x4069f3['password']){var _0x33526d={'messages':[{'source':'xCALLY\x20Motion','to':_0x4fb7cb['phone'],'body':_0x4fb7cb[_0x792d('0x10')],'from':_0x4069f3[_0x792d('0x41')]||_0x4069f3[_0x792d('0x27')]}]};var _0x490d0e=util[_0x792d('0x44')](_0x792d('0x45'),_0x4069f3[_0x792d('0x32')],_0x4069f3[_0x792d('0x33')]);var _0x1cef60={'method':_0x792d('0x42'),'uri':_0x792d('0x46'),'body':_0x33526d,'headers':{'Authorization':util[_0x792d('0x44')](_0x792d('0x47'),new Buffer(_0x490d0e)['toString'](_0x792d('0x48')))},'json':!![]};rp(_0x1cef60)['then'](function(_0x19ea13){if(_0x19ea13[_0x792d('0x49')]>=0xc8&&_0x19ea13['http_code']<=0xce){if(_0x19ea13[_0x792d('0x4a')]&&_0x19ea13[_0x792d('0x4a')]['queued_count']>0x0){var _0x8c156c=_['head'](_0x19ea13[_0x792d('0x4a')][_0x792d('0x28')]);var _0x2d6579={'messageId':_0x8c156c[_0x792d('0x4b')]};if(!_0x4069f3[_0x792d('0x3c')]){_0x2d6579['read']=!![];}return _0x35bf20[_0x792d('0x1d')](_0x2d6579);}else{logger[_0x792d('0x20')](_0x792d('0x3e'),_0x792d('0x2f'),_0x792d('0x4c'),util[_0x792d('0x3f')](_0x19ea13,{'showHidden':![],'depth':null}));}}else{logger['error'](_0x792d('0x3e'),_0x792d('0x2f'),_0x792d('0x4c'),util['inspect'](_0x19ea13,{'showHidden':![],'depth':null}));}})['catch'](function(_0x3267e5){logger[_0x792d('0x20')](_0x792d('0x3e'),_0x792d('0x2f'),_0x792d('0x4c'),util[_0x792d('0x3f')](_0x3267e5,{'showHidden':![],'depth':null}));});}else{logger[_0x792d('0x20')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x792d('0x4c'),_0x792d('0x4d'));}break;case _0x792d('0x4e'):if(_0x4069f3['authId']&&_0x4069f3[_0x792d('0x26')]){var _0x33526d={'dst':_0x4fb7cb[_0x792d('0x27')],'text':_0x4fb7cb[_0x792d('0x10')],'src':_0x4069f3['senderString']||_0x4069f3[_0x792d('0x27')],'url':_0x4069f3['remote']+_0x792d('0x2b')+_0x4fb7cb['id']+'/status?token='+_0x4069f3[_0x792d('0x2d')]};var _0x490d0e=util['format'](_0x792d('0x45'),_0x4069f3['authId'],_0x4069f3[_0x792d('0x26')]);var _0x1cef60={'method':_0x792d('0x42'),'uri':util['format'](_0x792d('0x4f'),_0x4069f3['authId']),'body':_0x33526d,'headers':{'Authorization':util[_0x792d('0x44')](_0x792d('0x47'),new Buffer(_0x490d0e)[_0x792d('0x50')](_0x792d('0x48')))},'json':!![]};rp(_0x1cef60)['then'](function(_0x368c16){var _0x399e61={'messageId':_0x368c16['message_uuid'][0x0]};return _0x35bf20['update'](_0x399e61);})[_0x792d('0x1f')](function(_0x1007e5){logger[_0x792d('0x20')](_0x792d('0x3e'),_0x792d('0x2f'),'plivo',util['inspect'](_0x1007e5,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x792d('0x3e'),_0x792d('0x2f'),_0x792d('0x4e'),_0x792d('0x51'));}break;case _0x792d('0x52'):if(_0x4069f3['username']&&_0x4069f3['password']){if(_0x4069f3[_0x792d('0x53')]){var _0x3ec7aa={'method':_0x792d('0x42'),'uri':_0x4069f3[_0x792d('0x53')]+'/auth/1/session','body':{'username':_0x4069f3['username'],'password':_0x4069f3[_0x792d('0x33')]},'json':!![]};return rp(_0x3ec7aa)[_0x792d('0x1c')](function(_0x1391d1){var _0x8786e9={'method':_0x792d('0x42'),'uri':_0x4069f3[_0x792d('0x53')]+_0x792d('0x54'),'body':{'messages':[{'from':_0x4069f3[_0x792d('0x27')],'destinations':[{'to':_0x4fb7cb[_0x792d('0x27')]}],'text':_0x4fb7cb[_0x792d('0x10')],'notifyUrl':_0x4069f3['remote']+_0x792d('0x2b')+_0x4fb7cb['id']+_0x792d('0x2c')+_0x4069f3[_0x792d('0x2d')],'notifyContentType':_0x792d('0x55'),'callbackData':_0x4069f3['phone']+';'+_0x4fb7cb[_0x792d('0x10')]}]},'headers':{'Authorization':_0x792d('0x56')+_0x1391d1[_0x792d('0x2d')]},'json':!![]};return rp(_0x8786e9)[_0x792d('0x1c')](function(_0x1c121e){if(_0x1c121e[_0x792d('0x28')]){var _0x1f9fcb={'messageId':_0x1c121e[_0x792d('0x28')][0x0][_0x792d('0xe')]};if(!_0x4069f3[_0x792d('0x3c')]){_0x1f9fcb[_0x792d('0x3d')]=!![];}return _0x35bf20[_0x792d('0x1d')](_0x1f9fcb);}else{return logger['error'](_0x792d('0x3e'),_0x792d('0x2f'),'infobip',util[_0x792d('0x3f')](_0x1c121e,{'showHidden':![],'depth':null}));}});})[_0x792d('0x1f')](function(_0x4e378d){return logger[_0x792d('0x20')](_0x792d('0x3e'),_0x792d('0x2f'),_0x792d('0x52'),util[_0x792d('0x3f')](_0x4e378d,{'showHidden':![],'depth':null}));});}else{logger[_0x792d('0x20')](_0x792d('0x3e'),_0x792d('0x2f'),_0x792d('0x52'),_0x792d('0x57'));}}else{logger[_0x792d('0x20')](_0x792d('0x3e'),'afterCreate',_0x792d('0x52'),_0x792d('0x4d'));}break;case _0x792d('0x58'):var _0x192b4b=require(_0x792d('0x59'));if(_0x4069f3['apiKey']){var _0x5198ea={};_0x5198ea[_0x792d('0x5a')]=_0x4069f3['username'];_0x5198ea[_0x792d('0x27')]=_0x4fb7cb[_0x792d('0x27')];_0x5198ea[_0x792d('0x35')]=_0x4069f3[_0x792d('0x27')];_0x5198ea['text']=_0x4fb7cb[_0x792d('0x10')];_0x5198ea[_0x792d('0x5b')]=+new Date();var _0x1192be='';var _0x1948f8='';var _0x3e87bb=Object['keys'](_0x5198ea);_0x3e87bb[_0x792d('0x5c')]();for(var _0x5dcb08=0x0;_0x5dcb08<_0x3e87bb[_0x792d('0x5d')];_0x5dcb08++){if(_0x1192be!=''){_0x1192be+='&';}_0x1192be+=_0x3e87bb[_0x5dcb08]+'='+encodeURIComponent(_0x5198ea[_0x3e87bb[_0x5dcb08]]);_0x1948f8+=_0x5198ea[_0x3e87bb[_0x5dcb08]];}_0x1948f8+=_0x4069f3[_0x792d('0x5e')];_0x1948f8=_0x192b4b['createHash']('md5')[_0x792d('0x1d')](_0x1948f8)[_0x792d('0x5f')]('hex');if(_0x1192be!==''){_0x1192be+='&';}_0x1192be+=_0x792d('0x60')+_0x1948f8;var _0xa509de={'method':_0x792d('0x36'),'uri':_0x4069f3['baseUrl']+_0x792d('0x61')+_0x1192be,'json':!![]};return rp(_0xa509de)[_0x792d('0x1c')](function(_0x141ee8){var _0x1cac4a=Object[_0x792d('0x62')](_0x141ee8);if(_0x141ee8[_0x1cac4a[0x0]][_0x792d('0x20')]&&parseInt(_0x141ee8[_0x1cac4a[0x0]][_0x792d('0x20')])===0x0){var _0xc84135={'messageId':_0x141ee8[_0x1cac4a[0x0]]['id_sms']};if(!_0x4069f3[_0x792d('0x3c')]){_0xc84135[_0x792d('0x3d')]=!![];}return _0x35bf20[_0x792d('0x1d')](_0xc84135);}else{return logger[_0x792d('0x20')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x792d('0x58'),util['inspect'](_0x141ee8[_0x792d('0x20')],{'showHidden':![],'depth':null}));}})[_0x792d('0x1f')](function(_0x2e3234){return logger['error'](_0x792d('0x3e'),_0x792d('0x2f'),_0x792d('0x58'),util[_0x792d('0x3f')](_0x2e3234,{'showHidden':![],'depth':null}));});}else{logger[_0x792d('0x20')](_0x792d('0x3e'),_0x792d('0x2f'),_0x792d('0x58'),'Missing\x20parameters:\x20apiKey');}break;case _0x792d('0x63'):if(_0x4069f3[_0x792d('0x5e')]){var _0x139d8e={'method':'POST','uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0x4069f3['apiKey']},'body':{'content':_0x4fb7cb[_0x792d('0x10')],'to':[_0x4fb7cb[_0x792d('0x27')]],'from':_0x4069f3[_0x792d('0x27')],'binary':![],'clientMessageId':_0x792d('0x64'),'charset':_0x792d('0x65')},'json':!![]};rp(_0x139d8e)[_0x792d('0x1c')](function(_0x15ea77){if(!_0x15ea77[_0x792d('0x20')]){var _0xd11a3a={'messageId':_0x15ea77['messages'][0x0][_0x792d('0x66')]};if(!_0x4069f3[_0x792d('0x3c')]){_0xd11a3a[_0x792d('0x3d')]=!![];}return _0x35bf20[_0x792d('0x1d')](_0xd11a3a);}else{return logger[_0x792d('0x20')](_0x792d('0x3e'),_0x792d('0x2f'),_0x792d('0x63'),util[_0x792d('0x3f')](_0x15ea77[_0x792d('0x20')],{'showHidden':![],'depth':null}));}})[_0x792d('0x1f')](function(_0x15d594){return logger[_0x792d('0x20')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x792d('0x2f'),_0x792d('0x63'),util[_0x792d('0x3f')](_0x15d594,{'showHidden':![],'depth':null}));});}else{logger[_0x792d('0x20')](_0x792d('0x3e'),'afterCreate','clickatell','Missing\x20parameters:\x20apiKey');}break;case _0x792d('0x67'):if(_0x4069f3[_0x792d('0x32')]&&_0x4069f3[_0x792d('0x33')]){var _0x490d0e=util[_0x792d('0x44')](_0x792d('0x45'),_0x4069f3[_0x792d('0x32')],_0x4069f3[_0x792d('0x33')]);var _0x1cef60={'method':_0x792d('0x42'),'uri':_0x792d('0x68')+_0x4069f3[_0x792d('0x69')]+_0x792d('0x6a'),'body':{'to':[_0x4fb7cb[_0x792d('0x27')]],'text':_0x4fb7cb[_0x792d('0x10')],'from':_0x4069f3['phone'],'applicationId':_0x4069f3[_0x792d('0x6b')]},'headers':{'Authorization':util[_0x792d('0x44')]('Basic\x20%s',new Buffer(_0x490d0e)['toString']('base64'))},'json':!![]};rp(_0x1cef60)[_0x792d('0x1c')](function(_0x54f14a){if(_0x54f14a['id']){var _0x538353={'messageId':_0x54f14a['id']};return _0x35bf20[_0x792d('0x1d')](_0x538353);}else{logger[_0x792d('0x20')](_0x792d('0x3e'),_0x792d('0x2f'),_0x792d('0x67'),util[_0x792d('0x3f')](_0x54f14a,{'showHidden':![],'depth':null}));}})[_0x792d('0x1f')](function(_0x58c10d){logger[_0x792d('0x20')](_0x792d('0x3e'),_0x792d('0x2f'),_0x792d('0x67'),util['inspect'](_0x58c10d,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x792d('0x3e'),'afterCreate',_0x792d('0x67'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x792d('0x6c'):if(_0x4069f3[_0x792d('0x5e')]){var _0x585ff4={};var _0xa509de={'method':_0x792d('0x42'),'uri':_0x792d('0x6d'),'headers':{'Authorization':_0x792d('0x6e')+_0x4069f3['apiKey'],'Content-Type':_0x792d('0x55')},'body':{'from':_0x4069f3[_0x792d('0x27')],'to':_0x4fb7cb[_0x792d('0x27')],'text':_0x4fb7cb['body']},'json':!![]};return rp(_0xa509de)['then'](function(_0x102ad2){if(_0x102ad2[_0x792d('0x6f')]==0xca){_0x585ff4[_0x792d('0x70')]=_0x102ad2;var _0x3bc10d={'method':'POST','uri':_0x792d('0x71'),'headers':{'Authorization':_0x792d('0x6e')+_0x4069f3[_0x792d('0x5e')],'Content-Type':_0x792d('0x55')},'body':{'refid':_0x585ff4[_0x792d('0x70')][_0x792d('0x72')]},'json':!![]};return rp(_0x3bc10d)[_0x792d('0x1c')](function(_0x4564c2){_0x585ff4[_0x792d('0x73')]=_0x4564c2;var _0x1958b0={'messageId':_0x585ff4[_0x792d('0x70')][_0x792d('0x72')],'read':!![]};return _0x35bf20[_0x792d('0x1d')](_0x1958b0);});}else{return logger[_0x792d('0x20')](_0x792d('0x3e'),_0x792d('0x2f'),_0x792d('0x6c'),util[_0x792d('0x3f')](_0x102ad2,{'showHidden':![],'depth':null}));}})[_0x792d('0x1f')](function(_0x63af22){return logger[_0x792d('0x20')](_0x792d('0x3e'),_0x792d('0x2f'),_0x792d('0x6c'),util[_0x792d('0x3f')](_0x63af22,{'showHidden':![],'depth':null}));});}else{return logger[_0x792d('0x20')](_0x792d('0x3e'),_0x792d('0x2f'),_0x792d('0x6c'),_0x792d('0x74'));}break;}}})[_0x792d('0x75')](function(){_0xf33083();});}else{_0xf33083();}}},'charset':_0x792d('0x76'),'collate':_0x792d('0x77')});}; \ No newline at end of file +var _0x6308=['UTF-8','apiMessageId','clickatell','bandwidth','https://messaging.bandwidth.com/api/v2/users/','/messages','applicationId','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','https://api.intelepeer.com/_rest/v4/app/sms/mdr','message','refid','status','intelepeer','Token\x20not\x20received','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','define','SmsMessage','sms_messages','messageId','fti_sms_messages','FULLTEXT','get','direction','toLowerCase','isNil','UserId','findOne','then','update','catch','secret','SmsAccount','find','SmsAccountId','type','twilio','accountSid','authToken','body','phone','remote','/api/sms/messages/','/status?token=','sid','afterCreate','inspect','error','SmsMessage,\x20%s,\x20%s,\x20%s','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','&password=','GET','split','sms','user_key','session_key','total_sent','deliveryReport','read','senderString','POST','https://smsapi.connectel.se/api/v2/send/','requestid','connectel','Missing\x20parameters:\x20authToken','xCALLY\x20Motion','format','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','http_code','data','head','message_id','clickSend','Missing\x20parameters:\x20username,\x20password','plivo','authId','token','https://api.plivo.com/v1/Account/%s/Message/','base64','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','application/json','IBSSO\x20','messages','csc','crypto','apiKey','login','timestamp','sort','length','createHash','md5','digest','hex','signature=','id_sms','Missing\x20parameters:\x20apiKey','uuid'];(function(_0x53d05e,_0x3ec9c6){var _0x106788=function(_0xe35d14){while(--_0xe35d14){_0x53d05e['push'](_0x53d05e['shift']());}};_0x106788(++_0x3ec9c6);}(_0x6308,0x1f2));var _0x8630=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x6308[_0x422905];return _0x33dc6c;};'use strict';var _=require(_0x8630('0x0'));var util=require('util');var logger=require(_0x8630('0x1'))('api');var moment=require('moment');var BPromise=require(_0x8630('0x2'));var rp=require(_0x8630('0x3'));var fs=require('fs');var path=require(_0x8630('0x4'));var rimraf=require(_0x8630('0x5'));var config=require(_0x8630('0x6'));var attributes=require('./smsMessage.attributes');module['exports']=function(_0x1d62c8,_0x571543){return _0x1d62c8[_0x8630('0x7')](_0x8630('0x8'),attributes,{'tableName':_0x8630('0x9'),'paranoid':![],'indexes':[{'name':_0x8630('0xa'),'fields':[_0x8630('0xa')]},{'name':_0x8630('0xb'),'fields':['body'],'type':_0x8630('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5726fd,_0x3dc3c8,_0x399bb0){var _0x2155fd=_0x1d62c8['models'];var _0x37219b=_0x5726fd[_0x8630('0xd')]({'plain':!![]});if(_0x37219b[_0x8630('0xe')]['toLowerCase']()==='in'||_0x37219b[_0x8630('0xe')][_0x8630('0xf')]()==='out'&&!_0x37219b['secret']&&!_[_0x8630('0x10')](_0x37219b[_0x8630('0x11')])){_0x2155fd['SmsInteraction'][_0x8630('0x12')]({'where':{'id':_0x37219b['SmsInteractionId']}})[_0x8630('0x13')](function(_0x4cc542){if(_0x4cc542){_0x4cc542[_0x8630('0x14')]({'lastMsgAt':_0x37219b['createdAt'],'lastMsgDirection':_0x37219b['direction'][_0x8630('0xf')]()});}})[_0x8630('0x15')](function(_0x49fce1){console['error'](_0x49fce1);});}if(_0x37219b[_0x8630('0xe')]==='out'&&!_0x37219b[_0x8630('0x16')]){var _0x18a874;_0x2155fd[_0x8630('0x17')][_0x8630('0x18')]({'where':{'id':_0x37219b[_0x8630('0x19')]},'raw':!![]})[_0x8630('0x13')](function(_0x4356b9){_0x18a874=_0x4356b9;if(_0x18a874&&_0x18a874[_0x8630('0x1a')]){switch(_0x18a874[_0x8630('0x1a')]){case'twilio':var _0x59bda7=require(_0x8630('0x1b'));if(_0x18a874[_0x8630('0x1c')]&&_0x18a874['authToken']&&_0x18a874['phone']){var _0x1325dc=new _0x59bda7(_0x18a874[_0x8630('0x1c')],_0x18a874[_0x8630('0x1d')]);_0x1325dc['messages']['create']({'body':_0x37219b[_0x8630('0x1e')],'to':_0x37219b['phone'],'from':_0x18a874[_0x8630('0x1f')],'statusCallback':_0x18a874[_0x8630('0x20')]+_0x8630('0x21')+_0x37219b['id']+_0x8630('0x22')+_0x18a874['token']})[_0x8630('0x13')](function(_0xf24c11){if(_0xf24c11[_0x8630('0x23')]){return _0x5726fd[_0x8630('0x14')]({'messageId':_0xf24c11[_0x8630('0x23')]});}})[_0x8630('0x15')](function(_0x37b7aa){logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x8630('0x24'),_0x8630('0x1b'),util[_0x8630('0x25')](_0x37b7aa,{'showHidden':![],'depth':null}));});}else{logger[_0x8630('0x26')](_0x8630('0x27'),_0x8630('0x24'),_0x8630('0x1b'),_0x8630('0x28'));}break;case _0x8630('0x29'):var _0x357c15=_0x8630('0x2a');if(_0x18a874[_0x8630('0x2b')]&&_0x18a874[_0x8630('0x2c')]){var _0x4285ee={'recipient':[_0x37219b[_0x8630('0x1f')]],'message':_0x37219b[_0x8630('0x1e')],'message_type':_0x18a874[_0x8630('0x2d')]};if(_0x18a874['smsMethod']&&_0x18a874[_0x8630('0x2d')]!=='SI'){_0x4285ee[_0x8630('0x2e')]=_0x18a874[_0x8630('0x1f')];}var _0x104491={'url':_0x357c15+'login?username='+_0x18a874[_0x8630('0x2b')]+_0x8630('0x2f')+_0x18a874[_0x8630('0x2c')],'method':_0x8630('0x30')};rp(_0x104491)[_0x8630('0x13')](function(_0x32f4fd){var _0x534401=_0x32f4fd[_0x8630('0x31')](';');var _0x2121bd={'user_key':_0x534401[0x0],'session_key':_0x534401[0x1]};_0x104491={'url':_0x357c15+_0x8630('0x32'),'method':'POST','headers':{'user_key':_0x2121bd[_0x8630('0x33')],'Session_key':_0x2121bd[_0x8630('0x34')]},'json':!![],'body':_0x4285ee};return rp(_0x104491);})[_0x8630('0x13')](function(_0x235407){if(_0x235407[_0x8630('0x35')]>=0x1){var _0x3aae35={'messageId':_0x235407['internal_order_id']};if(_0x18a874[_0x8630('0x2d')]!=='GP'||!_0x18a874[_0x8630('0x36')]){_0x3aae35[_0x8630('0x37')]=!![];}return _0x5726fd[_0x8630('0x14')](_0x3aae35);}else{return logger[_0x8630('0x26')](_0x8630('0x27'),_0x8630('0x24'),_0x8630('0x29'),util[_0x8630('0x25')](_0x235407,{'showHidden':![],'depth':null}));}})[_0x8630('0x15')](function(_0x396b2c){return logger[_0x8630('0x26')](_0x8630('0x27'),_0x8630('0x24'),_0x8630('0x29'),util[_0x8630('0x25')](_0x396b2c,{'showHidden':![],'depth':null}));});}else{logger[_0x8630('0x26')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x8630('0x24'),_0x8630('0x29'),'Missing\x20parameters:\x20username,\x20password');}break;case'connectel':if(_0x18a874[_0x8630('0x1d')]){var _0x1d957c={'recipient':_0x37219b[_0x8630('0x1f')],'message':_0x37219b[_0x8630('0x1e')],'sender':_0x18a874[_0x8630('0x38')]||_0x18a874['phone'],'authorization':_0x18a874[_0x8630('0x1d')]};var _0x3dc3c8={'method':_0x8630('0x39'),'uri':_0x8630('0x3a'),'body':_0x1d957c,'json':!![]};rp(_0x3dc3c8)['then'](function(_0xac2876){var _0x437fde={'messageId':_0xac2876[_0x8630('0x3b')]};if(!_0x18a874[_0x8630('0x36')]){_0x437fde[_0x8630('0x37')]=!![];}return _0x5726fd[_0x8630('0x14')](_0x437fde);})[_0x8630('0x15')](function(_0x58ba3a){logger[_0x8630('0x26')](_0x8630('0x27'),_0x8630('0x24'),_0x8630('0x3c'),util[_0x8630('0x25')](_0x58ba3a,{'showHidden':![],'depth':null}));});}else{logger[_0x8630('0x26')](_0x8630('0x27'),_0x8630('0x24'),_0x8630('0x3c'),_0x8630('0x3d'));}break;case'clicksend':if(_0x18a874[_0x8630('0x2b')]&&_0x18a874['password']){var _0x1d957c={'messages':[{'source':_0x8630('0x3e'),'to':_0x37219b[_0x8630('0x1f')],'body':_0x37219b[_0x8630('0x1e')],'from':_0x18a874[_0x8630('0x38')]||_0x18a874[_0x8630('0x1f')]}]};var _0x3c2db7=util[_0x8630('0x3f')](_0x8630('0x40'),_0x18a874[_0x8630('0x2b')],_0x18a874['password']);var _0x3dc3c8={'method':_0x8630('0x39'),'uri':_0x8630('0x41'),'body':_0x1d957c,'headers':{'Authorization':util[_0x8630('0x3f')](_0x8630('0x42'),new Buffer(_0x3c2db7)[_0x8630('0x43')]('base64'))},'json':!![]};rp(_0x3dc3c8)[_0x8630('0x13')](function(_0x186cc1){if(_0x186cc1[_0x8630('0x44')]>=0xc8&&_0x186cc1['http_code']<=0xce){if(_0x186cc1[_0x8630('0x45')]&&_0x186cc1[_0x8630('0x45')]['queued_count']>0x0){var _0x25d178=_[_0x8630('0x46')](_0x186cc1[_0x8630('0x45')]['messages']);var _0x4e439a={'messageId':_0x25d178[_0x8630('0x47')]};if(!_0x18a874['deliveryReport']){_0x4e439a['read']=!![];}return _0x5726fd[_0x8630('0x14')](_0x4e439a);}else{logger['error'](_0x8630('0x27'),_0x8630('0x24'),'clickSend',util[_0x8630('0x25')](_0x186cc1,{'showHidden':![],'depth':null}));}}else{logger[_0x8630('0x26')](_0x8630('0x27'),_0x8630('0x24'),_0x8630('0x48'),util['inspect'](_0x186cc1,{'showHidden':![],'depth':null}));}})[_0x8630('0x15')](function(_0x231289){logger['error'](_0x8630('0x27'),_0x8630('0x24'),_0x8630('0x48'),util['inspect'](_0x231289,{'showHidden':![],'depth':null}));});}else{logger[_0x8630('0x26')](_0x8630('0x27'),_0x8630('0x24'),_0x8630('0x48'),_0x8630('0x49'));}break;case _0x8630('0x4a'):if(_0x18a874[_0x8630('0x4b')]&&_0x18a874[_0x8630('0x1d')]){var _0x1d957c={'dst':_0x37219b['phone'],'text':_0x37219b['body'],'src':_0x18a874[_0x8630('0x38')]||_0x18a874[_0x8630('0x1f')],'url':_0x18a874[_0x8630('0x20')]+_0x8630('0x21')+_0x37219b['id']+_0x8630('0x22')+_0x18a874[_0x8630('0x4c')]};var _0x3c2db7=util['format'](_0x8630('0x40'),_0x18a874[_0x8630('0x4b')],_0x18a874[_0x8630('0x1d')]);var _0x3dc3c8={'method':_0x8630('0x39'),'uri':util['format'](_0x8630('0x4d'),_0x18a874[_0x8630('0x4b')]),'body':_0x1d957c,'headers':{'Authorization':util[_0x8630('0x3f')](_0x8630('0x42'),new Buffer(_0x3c2db7)['toString'](_0x8630('0x4e')))},'json':!![]};rp(_0x3dc3c8)[_0x8630('0x13')](function(_0x5b7391){var _0x2edc3d={'messageId':_0x5b7391[_0x8630('0x4f')][0x0]};return _0x5726fd[_0x8630('0x14')](_0x2edc3d);})[_0x8630('0x15')](function(_0x536e32){logger[_0x8630('0x26')](_0x8630('0x27'),'afterCreate','plivo',util[_0x8630('0x25')](_0x536e32,{'showHidden':![],'depth':null}));});}else{logger[_0x8630('0x26')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x8630('0x24'),'plivo',_0x8630('0x50'));}break;case _0x8630('0x51'):if(_0x18a874[_0x8630('0x2b')]&&_0x18a874['password']){if(_0x18a874[_0x8630('0x52')]){var _0x16eace={'method':_0x8630('0x39'),'uri':_0x18a874[_0x8630('0x52')]+_0x8630('0x53'),'body':{'username':_0x18a874[_0x8630('0x2b')],'password':_0x18a874[_0x8630('0x2c')]},'json':!![]};return rp(_0x16eace)['then'](function(_0x2d9303){var _0x1162fd={'method':_0x8630('0x39'),'uri':_0x18a874['baseUrl']+'/sms/2/text/advanced','body':{'messages':[{'from':_0x18a874[_0x8630('0x1f')],'destinations':[{'to':_0x37219b['phone']}],'text':_0x37219b[_0x8630('0x1e')],'notifyUrl':_0x18a874[_0x8630('0x20')]+'/api/sms/messages/'+_0x37219b['id']+_0x8630('0x22')+_0x18a874[_0x8630('0x4c')],'notifyContentType':_0x8630('0x54'),'callbackData':_0x18a874[_0x8630('0x1f')]+';'+_0x37219b['body']}]},'headers':{'Authorization':_0x8630('0x55')+_0x2d9303[_0x8630('0x4c')]},'json':!![]};return rp(_0x1162fd)[_0x8630('0x13')](function(_0x540664){if(_0x540664['messages']){var _0x4d32ac={'messageId':_0x540664[_0x8630('0x56')][0x0][_0x8630('0xa')]};if(!_0x18a874[_0x8630('0x36')]){_0x4d32ac[_0x8630('0x37')]=!![];}return _0x5726fd[_0x8630('0x14')](_0x4d32ac);}else{return logger['error'](_0x8630('0x27'),_0x8630('0x24'),_0x8630('0x51'),util['inspect'](_0x540664,{'showHidden':![],'depth':null}));}});})['catch'](function(_0x15b4aa){return logger[_0x8630('0x26')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x8630('0x24'),'infobip',util[_0x8630('0x25')](_0x15b4aa,{'showHidden':![],'depth':null}));});}else{logger[_0x8630('0x26')](_0x8630('0x27'),_0x8630('0x24'),_0x8630('0x51'),'Missing\x20parameters:\x20base_url');}}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x8630('0x24'),_0x8630('0x51'),_0x8630('0x49'));}break;case _0x8630('0x57'):var _0xf8296e=require(_0x8630('0x58'));if(_0x18a874[_0x8630('0x59')]){var _0x2e7d3b={};_0x2e7d3b[_0x8630('0x5a')]=_0x18a874[_0x8630('0x2b')];_0x2e7d3b[_0x8630('0x1f')]=_0x37219b[_0x8630('0x1f')];_0x2e7d3b['sender']=_0x18a874[_0x8630('0x1f')];_0x2e7d3b['text']=_0x37219b[_0x8630('0x1e')];_0x2e7d3b[_0x8630('0x5b')]=+new Date();var _0x446f1a='';var _0x2d924d='';var _0x4beca1=Object['keys'](_0x2e7d3b);_0x4beca1[_0x8630('0x5c')]();for(var _0x1c074f=0x0;_0x1c074f<_0x4beca1[_0x8630('0x5d')];_0x1c074f++){if(_0x446f1a!=''){_0x446f1a+='&';}_0x446f1a+=_0x4beca1[_0x1c074f]+'='+encodeURIComponent(_0x2e7d3b[_0x4beca1[_0x1c074f]]);_0x2d924d+=_0x2e7d3b[_0x4beca1[_0x1c074f]];}_0x2d924d+=_0x18a874['apiKey'];_0x2d924d=_0xf8296e[_0x8630('0x5e')](_0x8630('0x5f'))['update'](_0x2d924d)[_0x8630('0x60')](_0x8630('0x61'));if(_0x446f1a!==''){_0x446f1a+='&';}_0x446f1a+=_0x8630('0x62')+_0x2d924d;var _0x104491={'method':_0x8630('0x30'),'uri':_0x18a874['baseUrl']+'/external/get/send.php?'+_0x446f1a,'json':!![]};return rp(_0x104491)[_0x8630('0x13')](function(_0x2268d7){var _0x2ab2e1=Object['keys'](_0x2268d7);if(_0x2268d7[_0x2ab2e1[0x0]][_0x8630('0x26')]&&parseInt(_0x2268d7[_0x2ab2e1[0x0]][_0x8630('0x26')])===0x0){var _0x5b1e48={'messageId':_0x2268d7[_0x2ab2e1[0x0]][_0x8630('0x63')]};if(!_0x18a874[_0x8630('0x36')]){_0x5b1e48[_0x8630('0x37')]=!![];}return _0x5726fd[_0x8630('0x14')](_0x5b1e48);}else{return logger[_0x8630('0x26')](_0x8630('0x27'),_0x8630('0x24'),_0x8630('0x57'),util[_0x8630('0x25')](_0x2268d7['error'],{'showHidden':![],'depth':null}));}})['catch'](function(_0x118391){return logger[_0x8630('0x26')](_0x8630('0x27'),'afterCreate',_0x8630('0x57'),util['inspect'](_0x118391,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x8630('0x27'),_0x8630('0x24'),_0x8630('0x57'),_0x8630('0x64'));}break;case'clickatell':if(_0x18a874[_0x8630('0x59')]){var _0x1d3ccd={'method':_0x8630('0x39'),'uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0x18a874[_0x8630('0x59')]},'body':{'content':_0x37219b[_0x8630('0x1e')],'to':[_0x37219b[_0x8630('0x1f')]],'from':_0x18a874[_0x8630('0x1f')],'binary':![],'clientMessageId':_0x8630('0x65'),'charset':_0x8630('0x66')},'json':!![]};rp(_0x1d3ccd)[_0x8630('0x13')](function(_0x3edb06){if(!_0x3edb06[_0x8630('0x26')]){var _0x2c14f4={'messageId':_0x3edb06['messages'][0x0][_0x8630('0x67')]};if(!_0x18a874[_0x8630('0x36')]){_0x2c14f4[_0x8630('0x37')]=!![];}return _0x5726fd[_0x8630('0x14')](_0x2c14f4);}else{return logger[_0x8630('0x26')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x8630('0x24'),_0x8630('0x68'),util['inspect'](_0x3edb06[_0x8630('0x26')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x269de1){return logger[_0x8630('0x26')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','clickatell',util['inspect'](_0x269de1,{'showHidden':![],'depth':null}));});}else{logger[_0x8630('0x26')](_0x8630('0x27'),_0x8630('0x24'),'clickatell',_0x8630('0x64'));}break;case _0x8630('0x69'):if(_0x18a874['username']&&_0x18a874['password']){var _0x3c2db7=util[_0x8630('0x3f')](_0x8630('0x40'),_0x18a874['username'],_0x18a874[_0x8630('0x2c')]);var _0x3dc3c8={'method':_0x8630('0x39'),'uri':_0x8630('0x6a')+_0x18a874['accountId']+_0x8630('0x6b'),'body':{'to':[_0x37219b[_0x8630('0x1f')]],'text':_0x37219b['body'],'from':_0x18a874[_0x8630('0x1f')],'applicationId':_0x18a874[_0x8630('0x6c')]},'headers':{'Authorization':util[_0x8630('0x3f')](_0x8630('0x42'),new Buffer(_0x3c2db7)['toString'](_0x8630('0x4e')))},'json':!![]};rp(_0x3dc3c8)[_0x8630('0x13')](function(_0x1d518d){if(_0x1d518d['id']){var _0x52259b={'messageId':_0x1d518d['id']};return _0x5726fd[_0x8630('0x14')](_0x52259b);}else{logger[_0x8630('0x26')](_0x8630('0x27'),_0x8630('0x24'),'bandwidth',util['inspect'](_0x1d518d,{'showHidden':![],'depth':null}));}})[_0x8630('0x15')](function(_0x5e2e27){logger['error'](_0x8630('0x27'),_0x8630('0x24'),'bandwidth',util['inspect'](_0x5e2e27,{'showHidden':![],'depth':null}));});}else{logger[_0x8630('0x26')](_0x8630('0x27'),_0x8630('0x24'),_0x8630('0x69'),_0x8630('0x49'));}break;case'intelepeer':if(_0x18a874['apiKey']){var _0x10b926={};var _0x104491={'method':_0x8630('0x39'),'uri':_0x8630('0x6d'),'headers':{'Authorization':_0x8630('0x6e')+_0x18a874[_0x8630('0x59')],'Content-Type':'application/json'},'body':{'from':_0x18a874[_0x8630('0x1f')],'to':_0x37219b[_0x8630('0x1f')],'text':_0x37219b[_0x8630('0x1e')]},'json':!![]};return rp(_0x104491)[_0x8630('0x13')](function(_0x23d6e4){if(_0x23d6e4[_0x8630('0x6f')]==0xca){_0x10b926['message']=_0x23d6e4;var _0x2ed569={'method':'POST','uri':_0x8630('0x70'),'headers':{'Authorization':_0x8630('0x6e')+_0x18a874[_0x8630('0x59')],'Content-Type':_0x8630('0x54')},'body':{'refid':_0x10b926[_0x8630('0x71')][_0x8630('0x72')]},'json':!![]};return rp(_0x2ed569)[_0x8630('0x13')](function(_0x44e38b){_0x10b926[_0x8630('0x73')]=_0x44e38b;var _0x45813d={'messageId':_0x10b926[_0x8630('0x71')][_0x8630('0x72')],'read':!![]};return _0x5726fd[_0x8630('0x14')](_0x45813d);});}else{return logger[_0x8630('0x26')](_0x8630('0x27'),_0x8630('0x24'),'intelepeer',util['inspect'](_0x23d6e4,{'showHidden':![],'depth':null}));}})[_0x8630('0x15')](function(_0x15ed2a){return logger['error'](_0x8630('0x27'),'afterCreate','intelepeer',util[_0x8630('0x25')](_0x15ed2a,{'showHidden':![],'depth':null}));});}else{return logger[_0x8630('0x26')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x8630('0x74'),_0x8630('0x75'));}break;}}})['finally'](function(){_0x399bb0();});}else{_0x399bb0();}}},'charset':_0x8630('0x76'),'collate':_0x8630('0x77')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index fe02073..0d5ac5d 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 _0x2e7e=['error','message','result','SmsMessage','create','body','options','raw','then','CreateSmsMessage','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','./smsMessage.socket','request','info','SmsMessage,\x20%s,\x20%s','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x1a9204,_0x1c9e00){var _0x17ca68=function(_0x1f4399){while(--_0x1f4399){_0x1a9204['push'](_0x1a9204['shift']());}};_0x17ca68(++_0x1c9e00);}(_0x2e7e,0x65));var _0xe2e7=function(_0x3d2994,_0x10a066){_0x3d2994=_0x3d2994-0x0;var _0xe3bbf6=_0x2e7e[_0x3d2994];return _0xe3bbf6;};'use strict';var _=require(_0xe2e7('0x0'));var util=require('util');var moment=require(_0xe2e7('0x1'));var BPromise=require('bluebird');var rs=require(_0xe2e7('0x2'));var fs=require('fs');var Redis=require(_0xe2e7('0x3'));var db=require(_0xe2e7('0x4'))['db'];var utils=require(_0xe2e7('0x5'));var logger=require(_0xe2e7('0x6'))(_0xe2e7('0x7'));var config=require('../../config/environment');var jayson=require(_0xe2e7('0x8'));var client=jayson[_0xe2e7('0x9')][_0xe2e7('0xa')]({'port':0x232a});config[_0xe2e7('0xb')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xe2e7('0xc'))['register'](socket);function respondWithRpcPromise(_0x40eeb8,_0x164267,_0x2a3b75){return new BPromise(function(_0x2122f9,_0x1566cb){return client[_0xe2e7('0xd')](_0x40eeb8,_0x2a3b75)['then'](function(_0x55eda2){logger[_0xe2e7('0xe')](_0xe2e7('0xf'),_0x164267,'request\x20sent');logger[_0xe2e7('0x10')](_0xe2e7('0x11'),_0x164267,'request\x20sent',JSON[_0xe2e7('0x12')](_0x55eda2));if(_0x55eda2[_0xe2e7('0x13')]){if(_0x55eda2[_0xe2e7('0x13')]['code']===0x1f4){logger['error']('SmsMessage,\x20%s,\x20%s',_0x164267,_0x55eda2[_0xe2e7('0x13')][_0xe2e7('0x14')]);return _0x1566cb(_0x55eda2['error'][_0xe2e7('0x14')]);}logger[_0xe2e7('0x13')](_0xe2e7('0xf'),_0x164267,_0x55eda2[_0xe2e7('0x13')][_0xe2e7('0x14')]);return _0x2122f9(_0x55eda2['error'][_0xe2e7('0x14')]);}else{logger['info'](_0xe2e7('0xf'),_0x164267,'request\x20sent');_0x2122f9(_0x55eda2[_0xe2e7('0x15')][_0xe2e7('0x14')]);}})['catch'](function(_0x1eac89){logger['error']('SmsMessage,\x20%s,\x20%s',_0x164267,_0x1eac89);_0x1566cb(_0x1eac89);});});}exports['CreateSmsMessage']=function(_0x2578e5){var _0x3e5399=this;return new Promise(function(_0x3b5935,_0x461222){return db[_0xe2e7('0x16')][_0xe2e7('0x17')](_0x2578e5[_0xe2e7('0x18')],{'raw':_0x2578e5[_0xe2e7('0x19')]?_0x2578e5[_0xe2e7('0x19')][_0xe2e7('0x1a')]===undefined?!![]:![]:!![]})[_0xe2e7('0x1b')](function(_0x5b2bb6){logger['info']('CreateSmsMessage',_0x2578e5);logger[_0xe2e7('0x10')](_0xe2e7('0x1c'),_0x2578e5,JSON[_0xe2e7('0x12')](_0x5b2bb6));_0x3b5935(_0x5b2bb6);})[_0xe2e7('0x1d')](function(_0x47b40c){logger[_0xe2e7('0x13')](_0xe2e7('0x1c'),_0x47b40c[_0xe2e7('0x14')],_0x2578e5);_0x461222(_0x3e5399[_0xe2e7('0x13')](0x1f4,_0x47b40c[_0xe2e7('0x14')]));});});}; \ No newline at end of file +var _0xfd52=['moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','./smsMessage.socket','register','request','request\x20sent','SmsMessage,\x20%s,\x20%s,\x20%s','error','code','SmsMessage,\x20%s,\x20%s','message','info','result','catch','CreateSmsMessage','SmsMessage','options','raw','debug','stringify','util'];(function(_0xd518ce,_0x5eb808){var _0x5f02f7=function(_0x4355fc){while(--_0x4355fc){_0xd518ce['push'](_0xd518ce['shift']());}};_0x5f02f7(++_0x5eb808);}(_0xfd52,0x117));var _0x2fd5=function(_0x1eda20,_0x1149f4){_0x1eda20=_0x1eda20-0x0;var _0x31b953=_0xfd52[_0x1eda20];return _0x31b953;};'use strict';var _=require('lodash');var util=require(_0x2fd5('0x0'));var moment=require(_0x2fd5('0x1'));var BPromise=require(_0x2fd5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2fd5('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x2fd5('0x4'));var logger=require('../../config/logger')(_0x2fd5('0x5'));var config=require(_0x2fd5('0x6'));var jayson=require(_0x2fd5('0x7'));var client=jayson['client'][_0x2fd5('0x8')]({'port':0x232a});config[_0x2fd5('0x9')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2fd5('0x9')]));require(_0x2fd5('0xa'))[_0x2fd5('0xb')](socket);function respondWithRpcPromise(_0x1ca058,_0x421a9a,_0x29329a){return new BPromise(function(_0x724d0,_0x39f8ee){return client[_0x2fd5('0xc')](_0x1ca058,_0x29329a)['then'](function(_0x3a7bbc){logger['info']('SmsMessage,\x20%s,\x20%s',_0x421a9a,_0x2fd5('0xd'));logger['debug'](_0x2fd5('0xe'),_0x421a9a,'request\x20sent',JSON['stringify'](_0x3a7bbc));if(_0x3a7bbc[_0x2fd5('0xf')]){if(_0x3a7bbc[_0x2fd5('0xf')][_0x2fd5('0x10')]===0x1f4){logger[_0x2fd5('0xf')](_0x2fd5('0x11'),_0x421a9a,_0x3a7bbc[_0x2fd5('0xf')][_0x2fd5('0x12')]);return _0x39f8ee(_0x3a7bbc[_0x2fd5('0xf')][_0x2fd5('0x12')]);}logger[_0x2fd5('0xf')]('SmsMessage,\x20%s,\x20%s',_0x421a9a,_0x3a7bbc[_0x2fd5('0xf')]['message']);return _0x724d0(_0x3a7bbc[_0x2fd5('0xf')][_0x2fd5('0x12')]);}else{logger[_0x2fd5('0x13')](_0x2fd5('0x11'),_0x421a9a,'request\x20sent');_0x724d0(_0x3a7bbc[_0x2fd5('0x14')][_0x2fd5('0x12')]);}})[_0x2fd5('0x15')](function(_0x838052){logger[_0x2fd5('0xf')]('SmsMessage,\x20%s,\x20%s',_0x421a9a,_0x838052);_0x39f8ee(_0x838052);});});}exports[_0x2fd5('0x16')]=function(_0x5345c6){var _0x3f6493=this;return new Promise(function(_0x2b2b6b,_0x21035f){return db[_0x2fd5('0x17')]['create'](_0x5345c6['body'],{'raw':_0x5345c6[_0x2fd5('0x18')]?_0x5345c6[_0x2fd5('0x18')][_0x2fd5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x530cd8){logger[_0x2fd5('0x13')]('CreateSmsMessage',_0x5345c6);logger[_0x2fd5('0x1a')]('CreateSmsMessage',_0x5345c6,JSON[_0x2fd5('0x1b')](_0x530cd8));_0x2b2b6b(_0x530cd8);})['catch'](function(_0x385482){logger[_0x2fd5('0xf')]('CreateSmsMessage',_0x385482[_0x2fd5('0x12')],_0x5345c6);_0x21035f(_0x3f6493['error'](0x1f4,_0x385482[_0x2fd5('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index c0bd1e9..f567429 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 _0x27f8=['length','smsMessage:','./smsMessage.events','save','remove','emit','removeListener','register'];(function(_0xb65e77,_0x238c3d){var _0x38134b=function(_0x39da21){while(--_0x39da21){_0xb65e77['push'](_0xb65e77['shift']());}};_0x38134b(++_0x238c3d);}(_0x27f8,0xa2));var _0x827f=function(_0x461c9e,_0x9a67cd){_0x461c9e=_0x461c9e-0x0;var _0x144e35=_0x27f8[_0x461c9e];return _0x144e35;};'use strict';var SmsMessageEvents=require(_0x827f('0x0'));var events=[_0x827f('0x1'),_0x827f('0x2'),'update'];function createListener(_0x50b1f7,_0x5f4349){return function(_0x29f85c){_0x5f4349[_0x827f('0x3')](_0x50b1f7,_0x29f85c);};}function removeListener(_0x2b08f9,_0x54c1ff){return function(){SmsMessageEvents[_0x827f('0x4')](_0x2b08f9,_0x54c1ff);};}exports[_0x827f('0x5')]=function(_0x5dbf92){for(var _0x202769=0x0,_0x3cd43f=events[_0x827f('0x6')];_0x202769<_0x3cd43f;_0x202769++){var _0x44266e=events[_0x202769];var _0x1133a3=createListener(_0x827f('0x7')+_0x44266e,_0x5dbf92);SmsMessageEvents['on'](_0x44266e,_0x1133a3);}}; \ No newline at end of file +var _0x3f02=['./smsMessage.events','remove','update','emit','register','smsMessage:'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x3f02,0x78));var _0x23f0=function(_0x340756,_0xad31ae){_0x340756=_0x340756-0x0;var _0x2ef745=_0x3f02[_0x340756];return _0x2ef745;};'use strict';var SmsMessageEvents=require(_0x23f0('0x0'));var events=['save',_0x23f0('0x1'),_0x23f0('0x2')];function createListener(_0xc97825,_0x32cc03){return function(_0x2592ce){_0x32cc03[_0x23f0('0x3')](_0xc97825,_0x2592ce);};}function removeListener(_0x55e292,_0x4a9e15){return function(){SmsMessageEvents['removeListener'](_0x55e292,_0x4a9e15);};}exports[_0x23f0('0x4')]=function(_0x5660f8){for(var _0x5d0b77=0x0,_0x51eabc=events['length'];_0x5d0b77<_0x51eabc;_0x5d0b77++){var _0x123452=events[_0x5d0b77];var _0x2cbe1d=createListener(_0x23f0('0x5')+_0x123452,_0x5660f8);SmsMessageEvents['on'](_0x123452,_0x2cbe1d);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index ffeb13f..d6f15d2 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 _0x38f4=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','create','post','addTeams','/:id/users','addAgents','put','update','destroy','delete','removeTeams','removeAgents','exports','multer'];(function(_0x51251a,_0x2bebf2){var _0x5d9d37=function(_0x353793){while(--_0x353793){_0x51251a['push'](_0x51251a['shift']());}};_0x5d9d37(++_0x2bebf2);}(_0x38f4,0x192));var _0x438f=function(_0x1a5ad1,_0x357407){_0x1a5ad1=_0x1a5ad1-0x0;var _0x7b8b22=_0x38f4[_0x1a5ad1];return _0x7b8b22;};'use strict';var multer=require(_0x438f('0x0'));var util=require(_0x438f('0x1'));var path=require('path');var timeout=require(_0x438f('0x2'));var express=require(_0x438f('0x3'));var router=express[_0x438f('0x4')]();var fs_extra=require(_0x438f('0x5'));var auth=require(_0x438f('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x438f('0x7'));var controller=require('./smsQueue.controller');router['get']('/',auth[_0x438f('0x8')](),controller[_0x438f('0x9')]);router[_0x438f('0xa')](_0x438f('0xb'),auth[_0x438f('0x8')](),controller[_0x438f('0xc')]);router[_0x438f('0xa')](_0x438f('0xd'),auth[_0x438f('0x8')](),controller[_0x438f('0xe')]);router[_0x438f('0xa')](_0x438f('0xf'),auth[_0x438f('0x8')](),controller[_0x438f('0x10')]);router[_0x438f('0xa')](_0x438f('0x11'),auth[_0x438f('0x8')](),controller[_0x438f('0x12')]);router[_0x438f('0xa')]('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router['post']('/',auth[_0x438f('0x8')](),controller[_0x438f('0x13')]);router[_0x438f('0x14')](_0x438f('0x11'),auth[_0x438f('0x8')](),controller[_0x438f('0x15')]);router['post'](_0x438f('0x16'),auth[_0x438f('0x8')](),controller[_0x438f('0x17')]);router[_0x438f('0x18')](_0x438f('0xd'),auth[_0x438f('0x8')](),controller[_0x438f('0x19')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x438f('0x1a')]);router[_0x438f('0x1b')]('/:id/teams',auth[_0x438f('0x8')](),controller[_0x438f('0x1c')]);router[_0x438f('0x1b')](_0x438f('0x16'),auth[_0x438f('0x8')](),controller[_0x438f('0x1d')]);module[_0x438f('0x1e')]=router; \ No newline at end of file +var _0x0524=['removeTeams','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./smsQueue.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','getAgents','post','create','addTeams','/:id/users','addAgents','put','delete'];(function(_0x3165af,_0x215128){var _0x49047d=function(_0x27a312){while(--_0x27a312){_0x3165af['push'](_0x3165af['shift']());}};_0x49047d(++_0x215128);}(_0x0524,0x93));var _0x4052=function(_0x587fb5,_0x59cb3b){_0x587fb5=_0x587fb5-0x0;var _0x551105=_0x0524[_0x587fb5];return _0x551105;};'use strict';var multer=require('multer');var util=require(_0x4052('0x0'));var path=require(_0x4052('0x1'));var timeout=require(_0x4052('0x2'));var express=require(_0x4052('0x3'));var router=express[_0x4052('0x4')]();var fs_extra=require(_0x4052('0x5'));var auth=require(_0x4052('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x4052('0x7'));var controller=require(_0x4052('0x8'));router[_0x4052('0x9')]('/',auth[_0x4052('0xa')](),controller['index']);router[_0x4052('0x9')](_0x4052('0xb'),auth['isAuthenticated'](),controller[_0x4052('0xc')]);router['get'](_0x4052('0xd'),auth[_0x4052('0xa')](),controller[_0x4052('0xe')]);router[_0x4052('0x9')](_0x4052('0xf'),auth[_0x4052('0xa')](),controller[_0x4052('0x10')]);router[_0x4052('0x9')](_0x4052('0x11'),auth[_0x4052('0xa')](),controller[_0x4052('0x12')]);router['get']('/:id/users',auth['isAuthenticated'](),controller[_0x4052('0x13')]);router[_0x4052('0x14')]('/',auth[_0x4052('0xa')](),controller[_0x4052('0x15')]);router[_0x4052('0x14')](_0x4052('0x11'),auth[_0x4052('0xa')](),controller[_0x4052('0x16')]);router['post'](_0x4052('0x17'),auth[_0x4052('0xa')](),controller[_0x4052('0x18')]);router[_0x4052('0x19')](_0x4052('0xd'),auth[_0x4052('0xa')](),controller['update']);router[_0x4052('0x1a')](_0x4052('0xd'),auth['isAuthenticated'](),controller['destroy']);router[_0x4052('0x1a')](_0x4052('0x11'),auth[_0x4052('0xa')](),controller[_0x4052('0x1b')]);router[_0x4052('0x1a')](_0x4052('0x17'),auth[_0x4052('0xa')](),controller['removeAgents']);module[_0x4052('0x1c')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index 6873016..08f5fe3 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 _0x9b8b=['name','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','exports','STRING'];(function(_0x9378f1,_0x58e12d){var _0x34458f=function(_0x25920d){while(--_0x25920d){_0x9378f1['push'](_0x9378f1['shift']());}};_0x34458f(++_0x58e12d);}(_0x9b8b,0x7b));var _0xb9b8=function(_0x238ee7,_0x29f9c2){_0x238ee7=_0x238ee7-0x0;var _0x35f5ea=_0x9b8b[_0x238ee7];return _0x35f5ea;};'use strict';var Sequelize=require(_0xb9b8('0x0'));module[_0xb9b8('0x1')]={'name':{'type':Sequelize[_0xb9b8('0x2')],'unique':_0xb9b8('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xb9b8('0x2')]},'timeout':{'type':Sequelize[_0xb9b8('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xb9b8('0x5')](_0xb9b8('0x6'),_0xb9b8('0x7'),_0xb9b8('0x8'))}}; \ No newline at end of file +var _0xbf7a=['roundrobin','sequelize','exports','STRING','name','INTEGER'];(function(_0x5815af,_0x361f0b){var _0x3f14cb=function(_0x422c47){while(--_0x422c47){_0x5815af['push'](_0x5815af['shift']());}};_0x3f14cb(++_0x361f0b);}(_0xbf7a,0xd3));var _0xabf7=function(_0x581fd5,_0x5eb367){_0x581fd5=_0x581fd5-0x0;var _0x301075=_0xbf7a[_0x581fd5];return _0x301075;};'use strict';var Sequelize=require(_0xabf7('0x0'));module[_0xabf7('0x1')]={'name':{'type':Sequelize[_0xabf7('0x2')],'unique':_0xabf7('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xabf7('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory','beepall',_0xabf7('0x5'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index 457cd24..e1a161e 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 _0xb131=['desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','status','end','offset','undefined','count','limit','set','json','reject','then','destroy','SmsQueues','UserProfileResource','stack','name','send','map','rawAttributes','fieldName','key','keys','filters','intersection','model','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','SmsQueue','includeAll','include','catch','show','params','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','error','update','describe','getMembers','findOne','UserSmsQueue','SmsQueueId','findAll','findAndCountAll','UserId','updatedAt','createdAt','rows','format','smsPause','getTeams','Team','User','Agents','online','voicePause','flatMap','transaction','findOrCreate','userSmsQueue:save','removeTeams','ids','select','field','tq.TeamId','from','team_has_sms_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','sequelize','QueryTypes','SELECT','all','union','compact','value','removeAgents','emit','omit','spread','isArray','userSmsQueue:remove','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','jsforce'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0xb131,0x187));var _0x1b13=function(_0x249e96,_0x3ea39d){_0x249e96=_0x249e96-0x0;var _0x17444c=_0xb131[_0x249e96];return _0x17444c;};'use strict';var emlformat=require(_0x1b13('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1b13('0x1'));var jsonpatch=require(_0x1b13('0x2'));var rp=require(_0x1b13('0x3'));var moment=require(_0x1b13('0x4'));var BPromise=require(_0x1b13('0x5'));var Mustache=require(_0x1b13('0x6'));var util=require(_0x1b13('0x7'));var path=require(_0x1b13('0x8'));var sox=require('sox');var csv=require(_0x1b13('0x9'));var ejs=require(_0x1b13('0xa'));var fs=require('fs');var fs_extra=require(_0x1b13('0xb'));var _=require(_0x1b13('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1b13('0xd'));var deskjs=require(_0x1b13('0xe'));var toCsv=require('to-csv');var querystring=require(_0x1b13('0xf'));var Papa=require(_0x1b13('0x10'));var Redis=require('ioredis');var authService=require(_0x1b13('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1b13('0x12'));var logger=require(_0x1b13('0x13'))(_0x1b13('0x14'));var utils=require(_0x1b13('0x15'));var config=require(_0x1b13('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x1b13('0x17'))['db'];config[_0x1b13('0x18')]=_[_0x1b13('0x19')](config['redis'],{'host':_0x1b13('0x1a'),'port':0x18eb});var socket=require(_0x1b13('0x1b'))(new Redis(config[_0x1b13('0x18')]));require('./smsQueue.socket')['register'](socket);function respondWithStatusCode(_0x516476,_0x28b268){_0x28b268=_0x28b268||0xcc;return function(_0x1f4145){if(_0x1f4145){return _0x516476['sendStatus'](_0x28b268);}return _0x516476[_0x1b13('0x1c')](_0x28b268)[_0x1b13('0x1d')]();};}function respondWithResult(_0x3eb07b,_0x442e90){_0x442e90=_0x442e90||0xc8;return function(_0x19fbd4){if(_0x19fbd4){return _0x3eb07b[_0x1b13('0x1c')](_0x442e90)['json'](_0x19fbd4);}};}function respondWithFilteredResult(_0x36a9e4,_0x448dd3){return function(_0x1ae638){if(_0x1ae638){var _0x1d622a=typeof _0x448dd3[_0x1b13('0x1e')]===_0x1b13('0x1f')&&typeof _0x448dd3['limit']===_0x1b13('0x1f');var _0x589e1a=_0x1ae638[_0x1b13('0x20')];var _0x1fb20a=_0x1d622a?0x0:_0x448dd3[_0x1b13('0x1e')];var _0x13d0b4=_0x1d622a?_0x1ae638[_0x1b13('0x20')]:_0x448dd3[_0x1b13('0x1e')]+_0x448dd3[_0x1b13('0x21')];var _0x381a2f;if(_0x13d0b4>=_0x589e1a){_0x13d0b4=_0x589e1a;_0x381a2f=0xc8;}else{_0x381a2f=0xce;}_0x36a9e4[_0x1b13('0x1c')](_0x381a2f);return _0x36a9e4[_0x1b13('0x22')]('Content-Range',_0x1fb20a+'-'+_0x13d0b4+'/'+_0x589e1a)[_0x1b13('0x23')](_0x1ae638);}return null;};}function patchUpdates(_0xa39e5e){return function(_0x93eb08){try{jsonpatch['apply'](_0x93eb08,_0xa39e5e,!![]);}catch(_0x3c5527){return BPromise[_0x1b13('0x24')](_0x3c5527);}return _0x93eb08['save']();};}function saveUpdates(_0x323320,_0x1672d8){return function(_0x3bcfe9){if(_0x3bcfe9){return _0x3bcfe9['update'](_0x323320)[_0x1b13('0x25')](function(_0x5a4dc6){return _0x5a4dc6;});}return null;};}function removeEntity(_0x1b316d,_0x3a42df){return function(_0x5e9516){if(_0x5e9516){return _0x5e9516[_0x1b13('0x26')]()['then'](function(){var _0x1dcf1f=_0x5e9516['get']({'plain':!![]});var _0x52a4a9=_0x1b13('0x27');return db[_0x1b13('0x28')][_0x1b13('0x26')]({'where':{'type':_0x52a4a9,'resourceId':_0x1dcf1f['id']}})['then'](function(){return _0x5e9516;});})[_0x1b13('0x25')](function(){_0x1b316d['status'](0xcc)[_0x1b13('0x1d')]();});}};}function handleEntityNotFound(_0xf714ca,_0x16e94f){return function(_0x5788d3){if(!_0x5788d3){_0xf714ca['sendStatus'](0x194);}return _0x5788d3;};}function handleError(_0x2aedeb,_0x4affe6){_0x4affe6=_0x4affe6||0x1f4;return function(_0x5fdecb){logger['error'](_0x5fdecb[_0x1b13('0x29')]);if(_0x5fdecb[_0x1b13('0x2a')]){delete _0x5fdecb[_0x1b13('0x2a')];}_0x2aedeb[_0x1b13('0x1c')](_0x4affe6)[_0x1b13('0x2b')](_0x5fdecb);};}exports['index']=function(_0x340542,_0x4af549){var _0x38935e={},_0x7e8a95={},_0x209bd1={'count':0x0,'rows':[]};var _0x418518=_[_0x1b13('0x2c')](db['SmsQueue'][_0x1b13('0x2d')],function(_0x5d9ce4){return{'name':_0x5d9ce4[_0x1b13('0x2e')],'type':_0x5d9ce4['type'][_0x1b13('0x2f')]};});_0x7e8a95['model']=_[_0x1b13('0x2c')](_0x418518,'name');_0x7e8a95['query']=_[_0x1b13('0x30')](_0x340542['query']);_0x7e8a95[_0x1b13('0x31')]=_[_0x1b13('0x32')](_0x7e8a95[_0x1b13('0x33')],_0x7e8a95[_0x1b13('0x34')]);_0x38935e[_0x1b13('0x35')]=_['intersection'](_0x7e8a95[_0x1b13('0x33')],qs['fields'](_0x340542[_0x1b13('0x34')][_0x1b13('0x36')]));_0x38935e['attributes']=_0x38935e[_0x1b13('0x35')][_0x1b13('0x37')]?_0x38935e[_0x1b13('0x35')]:_0x7e8a95[_0x1b13('0x33')];if(!_0x340542[_0x1b13('0x34')][_0x1b13('0x38')](_0x1b13('0x39'))){_0x38935e['limit']=qs['limit'](_0x340542[_0x1b13('0x34')][_0x1b13('0x21')]);_0x38935e[_0x1b13('0x1e')]=qs[_0x1b13('0x1e')](_0x340542['query'][_0x1b13('0x1e')]);}_0x38935e[_0x1b13('0x3a')]=qs[_0x1b13('0x3b')](_0x340542[_0x1b13('0x34')][_0x1b13('0x3b')]);_0x38935e[_0x1b13('0x3c')]=qs[_0x1b13('0x31')](_[_0x1b13('0x3d')](_0x340542[_0x1b13('0x34')],_0x7e8a95[_0x1b13('0x31')]),_0x418518);if(_0x340542[_0x1b13('0x34')][_0x1b13('0x3e')]){_0x38935e['where']=_['merge'](_0x38935e[_0x1b13('0x3c')],{'$or':_[_0x1b13('0x2c')](_0x418518,function(_0xa03af7){if(_0xa03af7['type']!==_0x1b13('0x3f')){var _0x2f0979={};_0x2f0979[_0xa03af7['name']]={'$like':'%'+_0x340542[_0x1b13('0x34')]['filter']+'%'};return _0x2f0979;}})});}_0x38935e=_[_0x1b13('0x40')]({},_0x38935e,_0x340542[_0x1b13('0x41')]);var _0x2e5137={'where':_0x38935e['where']};return db[_0x1b13('0x42')][_0x1b13('0x20')](_0x2e5137)[_0x1b13('0x25')](function(_0x499f1c){_0x209bd1[_0x1b13('0x20')]=_0x499f1c;if(_0x340542[_0x1b13('0x34')][_0x1b13('0x43')]){_0x38935e[_0x1b13('0x44')]=[{'all':!![]}];}return db['SmsQueue']['findAll'](_0x38935e);})[_0x1b13('0x25')](function(_0x256486){_0x209bd1['rows']=_0x256486;return _0x209bd1;})['then'](respondWithFilteredResult(_0x4af549,_0x38935e))[_0x1b13('0x45')](handleError(_0x4af549,null));};exports[_0x1b13('0x46')]=function(_0x4b6e7c,_0x5bea5a){var _0x39bfc5={'raw':!![],'where':{'id':_0x4b6e7c[_0x1b13('0x47')]['id']}},_0xd059fb={};_0xd059fb[_0x1b13('0x33')]=_[_0x1b13('0x30')](db[_0x1b13('0x42')]['rawAttributes']);_0xd059fb[_0x1b13('0x34')]=_[_0x1b13('0x30')](_0x4b6e7c['query']);_0xd059fb['filters']=_[_0x1b13('0x32')](_0xd059fb[_0x1b13('0x33')],_0xd059fb['query']);_0x39bfc5[_0x1b13('0x35')]=_['intersection'](_0xd059fb[_0x1b13('0x33')],qs[_0x1b13('0x36')](_0x4b6e7c[_0x1b13('0x34')]['fields']));_0x39bfc5[_0x1b13('0x35')]=_0x39bfc5[_0x1b13('0x35')][_0x1b13('0x37')]?_0x39bfc5[_0x1b13('0x35')]:_0xd059fb[_0x1b13('0x33')];if(_0x4b6e7c[_0x1b13('0x34')][_0x1b13('0x43')]){_0x39bfc5['include']=[{'all':!![]}];}_0x39bfc5=_['merge']({},_0x39bfc5,_0x4b6e7c[_0x1b13('0x41')]);return db['SmsQueue'][_0x1b13('0x48')](_0x39bfc5)[_0x1b13('0x25')](handleEntityNotFound(_0x5bea5a,null))[_0x1b13('0x25')](respondWithResult(_0x5bea5a,null))[_0x1b13('0x45')](handleError(_0x5bea5a,null));};exports[_0x1b13('0x49')]=function(_0x4105b9,_0x85db59){return db[_0x1b13('0x42')][_0x1b13('0x49')](_0x4105b9[_0x1b13('0x4a')],{})[_0x1b13('0x25')](function(_0x44c22c){var _0x763229=_0x4105b9[_0x1b13('0x4b')][_0x1b13('0x4c')]({'plain':!![]});if(!_0x763229)throw new Error(_0x1b13('0x4d'));if(_0x763229[_0x1b13('0x4e')]==='user'){var _0xc4de59=_0x44c22c[_0x1b13('0x4c')]({'plain':!![]});var _0x388838='SmsQueues';return db[_0x1b13('0x4f')][_0x1b13('0x48')]({'where':{'name':_0x388838,'userProfileId':_0x763229['userProfileId']},'raw':!![]})[_0x1b13('0x25')](function(_0xbf05bb){if(_0xbf05bb&&_0xbf05bb[_0x1b13('0x50')]===0x0){return db[_0x1b13('0x28')][_0x1b13('0x49')]({'name':_0xc4de59['name'],'resourceId':_0xc4de59['id'],'type':_0xbf05bb[_0x1b13('0x2a')],'sectionId':_0xbf05bb['id']},{})[_0x1b13('0x25')](function(){return _0x44c22c;});}else{return _0x44c22c;}})[_0x1b13('0x45')](function(_0x163357){logger[_0x1b13('0x51')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x163357);throw _0x163357;});}return _0x44c22c;})[_0x1b13('0x25')](respondWithResult(_0x85db59,0xc9))[_0x1b13('0x45')](handleError(_0x85db59,null));};exports[_0x1b13('0x52')]=function(_0x51b64b,_0x578d64){if(_0x51b64b[_0x1b13('0x4a')]['id']){delete _0x51b64b[_0x1b13('0x4a')]['id'];}return db[_0x1b13('0x42')][_0x1b13('0x48')]({'where':{'id':_0x51b64b['params']['id']}})['then'](handleEntityNotFound(_0x578d64,null))[_0x1b13('0x25')](saveUpdates(_0x51b64b[_0x1b13('0x4a')],null))['then'](respondWithResult(_0x578d64,null))[_0x1b13('0x45')](handleError(_0x578d64,null));};exports[_0x1b13('0x26')]=function(_0x2ed5f7,_0x3b3264){return db[_0x1b13('0x42')]['find']({'where':{'id':_0x2ed5f7[_0x1b13('0x47')]['id']}})[_0x1b13('0x25')](handleEntityNotFound(_0x3b3264,null))[_0x1b13('0x25')](removeEntity(_0x3b3264,null))[_0x1b13('0x45')](handleError(_0x3b3264,null));};exports[_0x1b13('0x53')]=function(_0x43ea95,_0x1dbb5f){return db[_0x1b13('0x42')]['describe']()[_0x1b13('0x25')](respondWithResult(_0x1dbb5f,null))[_0x1b13('0x45')](handleError(_0x1dbb5f,null));};exports[_0x1b13('0x54')]=function(_0x5dad2a,_0x2d56bb,_0x52310d){var _0x5418ab={'raw':!![],'where':{}},_0x4c365f={},_0x99355e;return db[_0x1b13('0x42')][_0x1b13('0x55')]({'where':{'id':_0x5dad2a[_0x1b13('0x47')]['id']}})[_0x1b13('0x25')](handleEntityNotFound(_0x2d56bb,null))[_0x1b13('0x25')](function(_0x1e3c58){if(_0x1e3c58){_0x99355e=_0x1e3c58[_0x1b13('0x4c')]({'plain':!![]});_0x4c365f[_0x1b13('0x33')]=_[_0x1b13('0x30')](db[_0x1b13('0x56')][_0x1b13('0x2d')]);_0x4c365f[_0x1b13('0x34')]=_[_0x1b13('0x30')](_0x5dad2a['query']);_0x4c365f[_0x1b13('0x31')]=_['intersection'](_0x4c365f[_0x1b13('0x33')],_0x4c365f[_0x1b13('0x34')]);_0x5418ab[_0x1b13('0x35')]=_['intersection'](_0x4c365f['model'],qs[_0x1b13('0x36')](_0x5dad2a[_0x1b13('0x34')][_0x1b13('0x36')]));_0x5418ab[_0x1b13('0x35')]=_0x5418ab[_0x1b13('0x35')][_0x1b13('0x37')]?_0x5418ab['attributes']:_0x4c365f['model'];if(!_0x5dad2a[_0x1b13('0x34')][_0x1b13('0x38')](_0x1b13('0x39'))){_0x5418ab[_0x1b13('0x21')]=qs['limit'](_0x5dad2a[_0x1b13('0x34')][_0x1b13('0x21')]);_0x5418ab[_0x1b13('0x1e')]=qs[_0x1b13('0x1e')](_0x5dad2a[_0x1b13('0x34')][_0x1b13('0x1e')]);}_0x5418ab[_0x1b13('0x3a')]=qs['sort'](_0x5dad2a['query'][_0x1b13('0x3b')]);_0x5418ab['where']=qs['filters'](_[_0x1b13('0x3d')](_0x5dad2a[_0x1b13('0x34')],_0x4c365f[_0x1b13('0x31')]));_0x5418ab['where'][_0x1b13('0x57')]=_0x1e3c58['id'];if(_0x5dad2a['query'][_0x1b13('0x3e')]){_0x5418ab[_0x1b13('0x3c')]=_[_0x1b13('0x40')](_0x5418ab[_0x1b13('0x3c')],{'$or':_[_0x1b13('0x2c')](_0x5418ab[_0x1b13('0x35')],function(_0x47914f){var _0x40be73={};_0x40be73[_0x47914f]={'$like':'%'+_0x5dad2a[_0x1b13('0x34')][_0x1b13('0x3e')]+'%'};return _0x40be73;})});}_0x5418ab=_[_0x1b13('0x40')]({},_0x5418ab,_0x5dad2a[_0x1b13('0x41')]);return db[_0x1b13('0x56')][_0x1b13('0x58')](_0x5418ab);}})[_0x1b13('0x25')](function(_0x9f3682){if(_0x9f3682){return db['User'][_0x1b13('0x59')]({'where':{'id':_[_0x1b13('0x2c')](_0x9f3682,_0x1b13('0x5a')),'role':'agent'},'attributes':['id',_0x1b13('0x2a'),'smsPause',_0x1b13('0x5b'),_0x1b13('0x5c')]});}})[_0x1b13('0x25')](function(_0x1e633d){if(_0x1e633d){return{'count':_0x1e633d[_0x1b13('0x20')],'rows':_[_0x1b13('0x2c')](_0x1e633d[_0x1b13('0x5d')],function(_0x3d09b3){return{'membername':_0x3d09b3['name'],'UserId':_0x3d09b3['id'],'queue_name':_0x99355e[_0x1b13('0x2a')],'SmsQueueId':_0x99355e['id'],'interface':util[_0x1b13('0x5e')]('%s/%s','SIP',_0x3d09b3[_0x1b13('0x2a')]),'penalty':0x0,'paused':_0x3d09b3[_0x1b13('0x5f')],'createdAt':_0x3d09b3[_0x1b13('0x5c')],'updatedAt':_0x3d09b3[_0x1b13('0x5b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x1b13('0x25')](respondWithFilteredResult(_0x2d56bb,_0x5418ab))['catch'](handleError(_0x2d56bb,null));};exports[_0x1b13('0x60')]=function(_0x52f913,_0x12c527,_0x57642d){var _0x388e1a={};var _0xa8662a={};var _0x11bec9;var _0xefb663;return db['SmsQueue'][_0x1b13('0x55')]({'where':{'id':_0x52f913[_0x1b13('0x47')]['id']}})['then'](handleEntityNotFound(_0x12c527,null))['then'](function(_0x3b8265){if(_0x3b8265){_0x11bec9=_0x3b8265;_0xa8662a[_0x1b13('0x33')]=_[_0x1b13('0x30')](db[_0x1b13('0x61')][_0x1b13('0x2d')]);_0xa8662a['query']=_[_0x1b13('0x30')](_0x52f913[_0x1b13('0x34')]);_0xa8662a[_0x1b13('0x31')]=_['intersection'](_0xa8662a[_0x1b13('0x33')],_0xa8662a['query']);_0x388e1a['attributes']=_[_0x1b13('0x32')](_0xa8662a[_0x1b13('0x33')],qs[_0x1b13('0x36')](_0x52f913[_0x1b13('0x34')][_0x1b13('0x36')]));_0x388e1a[_0x1b13('0x35')]=_0x388e1a[_0x1b13('0x35')]['length']?_0x388e1a['attributes']:_0xa8662a[_0x1b13('0x33')];_0x388e1a[_0x1b13('0x3a')]=qs[_0x1b13('0x3b')](_0x52f913[_0x1b13('0x34')][_0x1b13('0x3b')]);_0x388e1a[_0x1b13('0x3c')]=qs['filters'](_[_0x1b13('0x3d')](_0x52f913['query'],_0xa8662a[_0x1b13('0x31')]));if(_0x52f913[_0x1b13('0x34')]['filter']){_0x388e1a['where']=_[_0x1b13('0x40')](_0x388e1a['where'],{'$or':_['map'](_0x388e1a[_0x1b13('0x35')],function(_0x1ee2e9){var _0x27f4f9={};_0x27f4f9[_0x1ee2e9]={'$like':'%'+_0x52f913['query'][_0x1b13('0x3e')]+'%'};return _0x27f4f9;})});}_0x388e1a=_[_0x1b13('0x40')]({},_0x388e1a,_0x52f913[_0x1b13('0x41')]);return _0x11bec9[_0x1b13('0x60')](_0x388e1a);}})[_0x1b13('0x25')](function(_0xebed4e){if(_0xebed4e){_0xefb663=_0xebed4e[_0x1b13('0x37')];if(!_0x52f913[_0x1b13('0x34')][_0x1b13('0x38')](_0x1b13('0x39'))){_0x388e1a[_0x1b13('0x21')]=qs[_0x1b13('0x21')](_0x52f913[_0x1b13('0x34')][_0x1b13('0x21')]);_0x388e1a[_0x1b13('0x1e')]=qs[_0x1b13('0x1e')](_0x52f913[_0x1b13('0x34')][_0x1b13('0x1e')]);}return _0x11bec9[_0x1b13('0x60')](_0x388e1a);}})[_0x1b13('0x25')](function(_0x53b66f){if(_0x53b66f){return _0x53b66f?{'count':_0xefb663,'rows':_0x53b66f}:null;}})[_0x1b13('0x25')](respondWithResult(_0x12c527,null))[_0x1b13('0x45')](handleError(_0x12c527,null));};exports['addTeams']=function(_0x52da34,_0x40ad91,_0x1213d4){var _0x176671=_0x52da34['body']['ids'];return db[_0x1b13('0x61')][_0x1b13('0x58')]({'where':{'id':_0x176671},'attributes':['id'],'include':[{'model':db[_0x1b13('0x62')],'as':_0x1b13('0x63'),'attributes':['id',_0x1b13('0x2a'),_0x1b13('0x64'),_0x1b13('0x65'),'interface'],'raw':!![]}]})[_0x1b13('0x25')](function(_0x483bef){if(_0x483bef){var _0x2f7c32=_[_0x1b13('0x66')](_0x483bef,function(_0x99a08){var _0x284729=_0x99a08['get']({'plain':!![]});return _0x284729['Agents'];});return db[_0x1b13('0x42')][_0x1b13('0x48')]({'where':{'id':_0x52da34[_0x1b13('0x47')]['id']}})['then'](function(_0x489bfd){return db['sequelize'][_0x1b13('0x67')](function(_0x64eceb){return _0x489bfd['addTeams'](_0x176671,{'transaction':_0x64eceb})['then'](function(){return BPromise['each'](_0x2f7c32,function(_0x1d06b0){return db['UserSmsQueue'][_0x1b13('0x68')]({'where':{'UserId':_0x1d06b0['id'],'SmsQueueId':_0x52da34[_0x1b13('0x47')]['id']},'transaction':_0x64eceb});});})[_0x1b13('0x25')](function(){_0x2f7c32['forEach'](function(_0x583e7d){socket['emit'](_0x1b13('0x69'),{'UserId':_0x583e7d['id'],'SmsQueueId':_0x489bfd['id']});});});});});}})[_0x1b13('0x25')](respondWithStatusCode(_0x40ad91,null))[_0x1b13('0x45')](handleError(_0x40ad91,null));};exports[_0x1b13('0x6a')]=function(_0x5b3611,_0x17e6bf,_0xb125cc){return db[_0x1b13('0x61')][_0x1b13('0x58')]({'where':{'id':_0x5b3611[_0x1b13('0x34')][_0x1b13('0x6b')]},'attributes':['id'],'include':[{'model':db[_0x1b13('0x62')],'as':_0x1b13('0x63'),'attributes':['id'],'raw':!![]}]})[_0x1b13('0x25')](handleEntityNotFound(_0x17e6bf,null))[_0x1b13('0x25')](function(_0x39a28e){var _0x477ab2=_[_0x1b13('0x2c')](_0x39a28e,'id');var _0x4d2b46=[];var _0x2d0442=[];var _0x1eb486=squel[_0x1b13('0x6c')]();_0x1eb486[_0x1b13('0x6d')](_0x1b13('0x6e'))[_0x1b13('0x6f')](_0x1b13('0x70'),'tq')[_0x1b13('0x71')](_0x1b13('0x72'),'ut',_0x1b13('0x73'))['where'](_0x1b13('0x74'),_0x5b3611[_0x1b13('0x47')]['id']);for(var _0x56ef38=0x0;_0x56ef38<_0x39a28e['length'];_0x56ef38+=0x1){let _0x5f2070=_0x39a28e[_0x56ef38];for(var _0x26633c=0x0;_0x26633c<_0x5f2070[_0x1b13('0x63')][_0x1b13('0x37')];_0x26633c+=0x1){let _0x3f7cba=_0x5f2070[_0x1b13('0x63')][_0x26633c];var _0x466576=_0x1eb486[_0x1b13('0x75')]();_0x466576['where'](_0x1b13('0x76'),_0x3f7cba['id']);_0x2d0442[_0x1b13('0x77')](db['sequelize'][_0x1b13('0x34')](_0x466576[_0x1b13('0x78')](),{'type':db[_0x1b13('0x79')][_0x1b13('0x7a')][_0x1b13('0x7b')]})[_0x1b13('0x25')](function(_0x2cd5fd){if(_0x2cd5fd[_0x1b13('0x37')]===0x1){return _0x3f7cba['id'];}else{var _0x5ad813=_['every'](_['map'](_0x2cd5fd,'TeamId'),function(_0x492629){return _['includes'](_0x477ab2,_0x492629);});if(_0x5ad813){return _0x3f7cba['id'];}}}));}}return BPromise[_0x1b13('0x7c')](_0x2d0442)[_0x1b13('0x25')](function(_0x3f81c7){_0x4d2b46=_(_0x4d2b46)[_0x1b13('0x7d')](_0x3f81c7)[_0x1b13('0x7e')]()[_0x1b13('0x7f')]();return db[_0x1b13('0x42')][_0x1b13('0x48')]({'where':{'id':_0x5b3611[_0x1b13('0x47')]['id']}})[_0x1b13('0x25')](function(_0x5f36ed){return db['sequelize'][_0x1b13('0x67')](function(_0x3ca95e){return _0x5f36ed[_0x1b13('0x6a')](_0x5b3611[_0x1b13('0x34')]['ids'],{'transaction':_0x3ca95e})[_0x1b13('0x25')](function(){if(!_['isEmpty'](_0x4d2b46)){return _0x5f36ed[_0x1b13('0x80')](_0x4d2b46,{'transaction':_0x3ca95e});}})[_0x1b13('0x25')](function(){_0x4d2b46['forEach'](function(_0x347649){socket[_0x1b13('0x81')]('userSmsQueue:remove',{'UserId':_0x347649,'SmsQueueId':_0x5f36ed['id']});});});});});});})['then'](respondWithStatusCode(_0x17e6bf,null))[_0x1b13('0x45')](handleError(_0x17e6bf,null));};exports['addAgents']=function(_0x437663,_0x1aa018,_0x251af6){return db[_0x1b13('0x42')]['find']({'where':{'id':_0x437663[_0x1b13('0x47')]['id']}})[_0x1b13('0x25')](handleEntityNotFound(_0x1aa018,null))[_0x1b13('0x25')](function(_0x136da1){if(_0x136da1){return _0x136da1['addAgents'](_0x437663[_0x1b13('0x4a')][_0x1b13('0x6b')],_[_0x1b13('0x82')](_0x437663[_0x1b13('0x4a')],[_0x1b13('0x6b'),'id'])||{})[_0x1b13('0x83')](function(_0x30d6c4){for(var _0x3bf1ce=0x0;_0x3bf1ce<_0x437663[_0x1b13('0x4a')][_0x1b13('0x6b')][_0x1b13('0x37')];_0x3bf1ce+=0x1){socket[_0x1b13('0x81')](_0x1b13('0x69'),{'UserId':Number(_0x437663['body'][_0x1b13('0x6b')][_0x3bf1ce]),'SmsQueueId':Number(_0x437663[_0x1b13('0x47')]['id'])});}return _0x30d6c4;});}})[_0x1b13('0x25')](respondWithResult(_0x1aa018,null))[_0x1b13('0x45')](handleError(_0x1aa018,null));};exports[_0x1b13('0x80')]=function(_0x4dedc4,_0x2111a3,_0x158115){return db[_0x1b13('0x42')]['find']({'where':{'id':_0x4dedc4['params']['id']}})['then'](handleEntityNotFound(_0x2111a3,null))['then'](function(_0x25d2a1){if(_0x25d2a1){return _0x25d2a1[_0x1b13('0x80')](_0x4dedc4['query']['ids'])[_0x1b13('0x25')](function(){if(_[_0x1b13('0x84')](_0x4dedc4[_0x1b13('0x34')][_0x1b13('0x6b')])){for(var _0x4619f4=0x0;_0x4619f4<_0x4dedc4['query'][_0x1b13('0x6b')][_0x1b13('0x37')];_0x4619f4+=0x1){socket[_0x1b13('0x81')](_0x1b13('0x85'),{'UserId':Number(_0x4dedc4['query'][_0x1b13('0x6b')][_0x4619f4]),'SmsQueueId':Number(_0x4dedc4[_0x1b13('0x47')]['id'])});}}else{socket[_0x1b13('0x81')]('userSmsQueue:remove',{'UserId':Number(_0x4dedc4[_0x1b13('0x34')][_0x1b13('0x6b')]),'SmsQueueId':Number(_0x4dedc4['params']['id'])});}});}})[_0x1b13('0x25')](respondWithStatusCode(_0x2111a3,null))['catch'](handleError(_0x2111a3,null));};exports['getAgents']=function(_0x37e054,_0x12286c,_0x520e3a){var _0x99fed3={};var _0x137a0d={};var _0x51374b;var _0x2a596e;return db[_0x1b13('0x42')][_0x1b13('0x55')]({'where':{'id':_0x37e054[_0x1b13('0x47')]['id']}})[_0x1b13('0x25')](handleEntityNotFound(_0x12286c,null))[_0x1b13('0x25')](function(_0x101c82){if(_0x101c82){_0x51374b=_0x101c82;_0x137a0d['model']=_[_0x1b13('0x30')](db['User'][_0x1b13('0x2d')]);_0x137a0d[_0x1b13('0x34')]=_[_0x1b13('0x30')](_0x37e054[_0x1b13('0x34')]);_0x137a0d['filters']=_[_0x1b13('0x32')](_0x137a0d[_0x1b13('0x33')],_0x137a0d[_0x1b13('0x34')]);_0x99fed3[_0x1b13('0x35')]=_[_0x1b13('0x32')](_0x137a0d[_0x1b13('0x33')],qs[_0x1b13('0x36')](_0x37e054[_0x1b13('0x34')][_0x1b13('0x36')]));_0x99fed3[_0x1b13('0x35')]=_0x99fed3[_0x1b13('0x35')]['length']?_0x99fed3[_0x1b13('0x35')]:_0x137a0d[_0x1b13('0x33')];_0x99fed3['order']=qs[_0x1b13('0x3b')](_0x37e054[_0x1b13('0x34')][_0x1b13('0x3b')]);_0x99fed3[_0x1b13('0x3c')]=qs[_0x1b13('0x31')](_[_0x1b13('0x3d')](_0x37e054[_0x1b13('0x34')],_0x137a0d['filters']));if(_0x37e054[_0x1b13('0x34')][_0x1b13('0x3e')]){_0x99fed3[_0x1b13('0x3c')]=_['merge'](_0x99fed3[_0x1b13('0x3c')],{'$or':_['map'](_0x99fed3['attributes'],function(_0x190061){var _0x1f5e0a={};_0x1f5e0a[_0x190061]={'$like':'%'+_0x37e054[_0x1b13('0x34')]['filter']+'%'};return _0x1f5e0a;})});}_0x99fed3=_[_0x1b13('0x40')]({},_0x99fed3,_0x37e054[_0x1b13('0x41')]);return _0x51374b[_0x1b13('0x86')](_0x99fed3);}})['then'](function(_0x1faf61){if(_0x1faf61){_0x2a596e=_0x1faf61['length'];if(!_0x37e054['query'][_0x1b13('0x38')](_0x1b13('0x39'))){_0x99fed3[_0x1b13('0x21')]=qs[_0x1b13('0x21')](_0x37e054[_0x1b13('0x34')][_0x1b13('0x21')]);_0x99fed3['offset']=qs[_0x1b13('0x1e')](_0x37e054[_0x1b13('0x34')][_0x1b13('0x1e')]);}return _0x51374b[_0x1b13('0x86')](_0x99fed3);}})['then'](function(_0x50dd38){if(_0x50dd38){return _0x50dd38?{'count':_0x2a596e,'rows':_0x50dd38}:null;}})[_0x1b13('0x25')](respondWithResult(_0x12286c,null))[_0x1b13('0x45')](handleError(_0x12286c,null));}; \ No newline at end of file +var _0xf946=['ids','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userSmsQueue:save','removeTeams','Agents','select','tq.TeamId','from','team_has_sms_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','TeamId','includes','all','union','compact','value','isEmpty','userSmsQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','status','end','undefined','limit','count','offset','set','apply','reject','save','update','then','SmsQueues','UserProfileResource','destroy','error','name','send','SmsQueue','fieldName','type','model','map','keys','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','rawAttributes','intersection','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','params','describe','getMembers','findOne','UserSmsQueue','pick','SmsQueueId','User','findAndCountAll','UserId','agent','createdAt','format','smsPause','updatedAt','getTeams','Team','addTeams'];(function(_0x5bfd4a,_0x2b1f9a){var _0xcf41b1=function(_0x4f28f8){while(--_0x4f28f8){_0x5bfd4a['push'](_0x5bfd4a['shift']());}};_0xcf41b1(++_0x2b1f9a);}(_0xf946,0x14f));var _0x6f94=function(_0x53ddcb,_0xc1a547){_0x53ddcb=_0x53ddcb-0x0;var _0x48afdb=_0xf946[_0x53ddcb];return _0x48afdb;};'use strict';var emlformat=require(_0x6f94('0x0'));var rimraf=require(_0x6f94('0x1'));var zipdir=require(_0x6f94('0x2'));var jsonpatch=require(_0x6f94('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6f94('0x4'));var path=require(_0x6f94('0x5'));var sox=require(_0x6f94('0x6'));var csv=require('to-csv');var ejs=require(_0x6f94('0x7'));var fs=require('fs');var fs_extra=require(_0x6f94('0x8'));var _=require(_0x6f94('0x9'));var squel=require(_0x6f94('0xa'));var crypto=require(_0x6f94('0xb'));var jsforce=require(_0x6f94('0xc'));var deskjs=require(_0x6f94('0xd'));var toCsv=require(_0x6f94('0xe'));var querystring=require(_0x6f94('0xf'));var Papa=require(_0x6f94('0x10'));var Redis=require(_0x6f94('0x11'));var authService=require(_0x6f94('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x6f94('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6f94('0x14'))(_0x6f94('0x15'));var utils=require(_0x6f94('0x16'));var config=require(_0x6f94('0x17'));var licenseUtil=require(_0x6f94('0x18'));var db=require(_0x6f94('0x19'))['db'];config[_0x6f94('0x1a')]=_['defaults'](config[_0x6f94('0x1a')],{'host':_0x6f94('0x1b'),'port':0x18eb});var socket=require(_0x6f94('0x1c'))(new Redis(config[_0x6f94('0x1a')]));require('./smsQueue.socket')[_0x6f94('0x1d')](socket);function respondWithStatusCode(_0x21efa5,_0x5b1072){_0x5b1072=_0x5b1072||0xcc;return function(_0x35f995){if(_0x35f995){return _0x21efa5[_0x6f94('0x1e')](_0x5b1072);}return _0x21efa5[_0x6f94('0x1f')](_0x5b1072)[_0x6f94('0x20')]();};}function respondWithResult(_0x16dcdc,_0x21c306){_0x21c306=_0x21c306||0xc8;return function(_0x540f1f){if(_0x540f1f){return _0x16dcdc[_0x6f94('0x1f')](_0x21c306)['json'](_0x540f1f);}};}function respondWithFilteredResult(_0x373b42,_0x12cab3){return function(_0x408f90){if(_0x408f90){var _0x54f67d=typeof _0x12cab3['offset']===_0x6f94('0x21')&&typeof _0x12cab3[_0x6f94('0x22')]==='undefined';var _0x424d3a=_0x408f90[_0x6f94('0x23')];var _0x5ab4d8=_0x54f67d?0x0:_0x12cab3[_0x6f94('0x24')];var _0x5f0ff1=_0x54f67d?_0x408f90[_0x6f94('0x23')]:_0x12cab3[_0x6f94('0x24')]+_0x12cab3[_0x6f94('0x22')];var _0x35f3bc;if(_0x5f0ff1>=_0x424d3a){_0x5f0ff1=_0x424d3a;_0x35f3bc=0xc8;}else{_0x35f3bc=0xce;}_0x373b42[_0x6f94('0x1f')](_0x35f3bc);return _0x373b42[_0x6f94('0x25')]('Content-Range',_0x5ab4d8+'-'+_0x5f0ff1+'/'+_0x424d3a)['json'](_0x408f90);}return null;};}function patchUpdates(_0x59a714){return function(_0x33ad5c){try{jsonpatch[_0x6f94('0x26')](_0x33ad5c,_0x59a714,!![]);}catch(_0x42369f){return BPromise[_0x6f94('0x27')](_0x42369f);}return _0x33ad5c[_0x6f94('0x28')]();};}function saveUpdates(_0x41ecac,_0xe4ff53){return function(_0x1f0bcf){if(_0x1f0bcf){return _0x1f0bcf[_0x6f94('0x29')](_0x41ecac)[_0x6f94('0x2a')](function(_0x1b55a5){return _0x1b55a5;});}return null;};}function removeEntity(_0xc12e7b,_0x1d720c){return function(_0x41fcd3){if(_0x41fcd3){return _0x41fcd3['destroy']()[_0x6f94('0x2a')](function(){var _0x1032a7=_0x41fcd3['get']({'plain':!![]});var _0x48a014=_0x6f94('0x2b');return db[_0x6f94('0x2c')][_0x6f94('0x2d')]({'where':{'type':_0x48a014,'resourceId':_0x1032a7['id']}})['then'](function(){return _0x41fcd3;});})[_0x6f94('0x2a')](function(){_0xc12e7b[_0x6f94('0x1f')](0xcc)[_0x6f94('0x20')]();});}};}function handleEntityNotFound(_0x2d536b,_0x391d9e){return function(_0x4cabf2){if(!_0x4cabf2){_0x2d536b[_0x6f94('0x1e')](0x194);}return _0x4cabf2;};}function handleError(_0x4a9c18,_0x1f4a71){_0x1f4a71=_0x1f4a71||0x1f4;return function(_0x45ec34){logger[_0x6f94('0x2e')](_0x45ec34['stack']);if(_0x45ec34[_0x6f94('0x2f')]){delete _0x45ec34['name'];}_0x4a9c18[_0x6f94('0x1f')](_0x1f4a71)[_0x6f94('0x30')](_0x45ec34);};}exports['index']=function(_0x602dcf,_0x3b2c10){var _0x43a2e6={},_0x561610={},_0x1ff5b7={'count':0x0,'rows':[]};var _0x510854=_['map'](db[_0x6f94('0x31')]['rawAttributes'],function(_0x744c01){return{'name':_0x744c01[_0x6f94('0x32')],'type':_0x744c01[_0x6f94('0x33')]['key']};});_0x561610[_0x6f94('0x34')]=_[_0x6f94('0x35')](_0x510854,_0x6f94('0x2f'));_0x561610['query']=_[_0x6f94('0x36')](_0x602dcf[_0x6f94('0x37')]);_0x561610[_0x6f94('0x38')]=_['intersection'](_0x561610[_0x6f94('0x34')],_0x561610[_0x6f94('0x37')]);_0x43a2e6[_0x6f94('0x39')]=_['intersection'](_0x561610[_0x6f94('0x34')],qs['fields'](_0x602dcf[_0x6f94('0x37')][_0x6f94('0x3a')]));_0x43a2e6[_0x6f94('0x39')]=_0x43a2e6[_0x6f94('0x39')][_0x6f94('0x3b')]?_0x43a2e6['attributes']:_0x561610['model'];if(!_0x602dcf['query'][_0x6f94('0x3c')](_0x6f94('0x3d'))){_0x43a2e6['limit']=qs['limit'](_0x602dcf['query'][_0x6f94('0x22')]);_0x43a2e6[_0x6f94('0x24')]=qs[_0x6f94('0x24')](_0x602dcf[_0x6f94('0x37')]['offset']);}_0x43a2e6[_0x6f94('0x3e')]=qs[_0x6f94('0x3f')](_0x602dcf[_0x6f94('0x37')][_0x6f94('0x3f')]);_0x43a2e6[_0x6f94('0x40')]=qs['filters'](_['pick'](_0x602dcf[_0x6f94('0x37')],_0x561610['filters']),_0x510854);if(_0x602dcf[_0x6f94('0x37')]['filter']){_0x43a2e6['where']=_[_0x6f94('0x41')](_0x43a2e6['where'],{'$or':_[_0x6f94('0x35')](_0x510854,function(_0x1c53b8){if(_0x1c53b8[_0x6f94('0x33')]!==_0x6f94('0x42')){var _0x2fa1b3={};_0x2fa1b3[_0x1c53b8[_0x6f94('0x2f')]]={'$like':'%'+_0x602dcf[_0x6f94('0x37')][_0x6f94('0x43')]+'%'};return _0x2fa1b3;}})});}_0x43a2e6=_['merge']({},_0x43a2e6,_0x602dcf[_0x6f94('0x44')]);var _0x197e0a={'where':_0x43a2e6[_0x6f94('0x40')]};return db['SmsQueue']['count'](_0x197e0a)[_0x6f94('0x2a')](function(_0x4854b6){_0x1ff5b7[_0x6f94('0x23')]=_0x4854b6;if(_0x602dcf[_0x6f94('0x37')][_0x6f94('0x45')]){_0x43a2e6[_0x6f94('0x46')]=[{'all':!![]}];}return db[_0x6f94('0x31')][_0x6f94('0x47')](_0x43a2e6);})[_0x6f94('0x2a')](function(_0xb197a5){_0x1ff5b7[_0x6f94('0x48')]=_0xb197a5;return _0x1ff5b7;})['then'](respondWithFilteredResult(_0x3b2c10,_0x43a2e6))[_0x6f94('0x49')](handleError(_0x3b2c10,null));};exports[_0x6f94('0x4a')]=function(_0x4cce6d,_0x1c2bb9){var _0x44a7d8={'raw':!![],'where':{'id':_0x4cce6d['params']['id']}},_0x2cd378={};_0x2cd378[_0x6f94('0x34')]=_[_0x6f94('0x36')](db['SmsQueue'][_0x6f94('0x4b')]);_0x2cd378[_0x6f94('0x37')]=_[_0x6f94('0x36')](_0x4cce6d['query']);_0x2cd378[_0x6f94('0x38')]=_[_0x6f94('0x4c')](_0x2cd378[_0x6f94('0x34')],_0x2cd378['query']);_0x44a7d8['attributes']=_[_0x6f94('0x4c')](_0x2cd378[_0x6f94('0x34')],qs[_0x6f94('0x3a')](_0x4cce6d[_0x6f94('0x37')][_0x6f94('0x3a')]));_0x44a7d8[_0x6f94('0x39')]=_0x44a7d8[_0x6f94('0x39')][_0x6f94('0x3b')]?_0x44a7d8[_0x6f94('0x39')]:_0x2cd378['model'];if(_0x4cce6d[_0x6f94('0x37')][_0x6f94('0x45')]){_0x44a7d8[_0x6f94('0x46')]=[{'all':!![]}];}_0x44a7d8=_[_0x6f94('0x41')]({},_0x44a7d8,_0x4cce6d[_0x6f94('0x44')]);return db[_0x6f94('0x31')]['find'](_0x44a7d8)[_0x6f94('0x2a')](handleEntityNotFound(_0x1c2bb9,null))['then'](respondWithResult(_0x1c2bb9,null))[_0x6f94('0x49')](handleError(_0x1c2bb9,null));};exports['create']=function(_0x345bbf,_0x2ceab0){return db['SmsQueue'][_0x6f94('0x4d')](_0x345bbf[_0x6f94('0x4e')],{})['then'](function(_0x47dc7b){var _0x4c07c4=_0x345bbf[_0x6f94('0x4f')][_0x6f94('0x50')]({'plain':!![]});if(!_0x4c07c4)throw new Error(_0x6f94('0x51'));if(_0x4c07c4[_0x6f94('0x52')]===_0x6f94('0x4f')){var _0x478385=_0x47dc7b[_0x6f94('0x50')]({'plain':!![]});var _0x5648c9=_0x6f94('0x2b');return db[_0x6f94('0x53')]['find']({'where':{'name':_0x5648c9,'userProfileId':_0x4c07c4[_0x6f94('0x54')]},'raw':!![]})[_0x6f94('0x2a')](function(_0x272e79){if(_0x272e79&&_0x272e79[_0x6f94('0x55')]===0x0){return db[_0x6f94('0x2c')]['create']({'name':_0x478385[_0x6f94('0x2f')],'resourceId':_0x478385['id'],'type':_0x272e79[_0x6f94('0x2f')],'sectionId':_0x272e79['id']},{})[_0x6f94('0x2a')](function(){return _0x47dc7b;});}else{return _0x47dc7b;}})[_0x6f94('0x49')](function(_0x443352){logger[_0x6f94('0x2e')](_0x6f94('0x56'),_0x443352);throw _0x443352;});}return _0x47dc7b;})[_0x6f94('0x2a')](respondWithResult(_0x2ceab0,0xc9))['catch'](handleError(_0x2ceab0,null));};exports[_0x6f94('0x29')]=function(_0x270391,_0x2cdd52){if(_0x270391[_0x6f94('0x4e')]['id']){delete _0x270391['body']['id'];}return db[_0x6f94('0x31')][_0x6f94('0x57')]({'where':{'id':_0x270391[_0x6f94('0x58')]['id']}})['then'](handleEntityNotFound(_0x2cdd52,null))[_0x6f94('0x2a')](saveUpdates(_0x270391[_0x6f94('0x4e')],null))['then'](respondWithResult(_0x2cdd52,null))['catch'](handleError(_0x2cdd52,null));};exports[_0x6f94('0x2d')]=function(_0x4cfd1b,_0x5f50ad){return db[_0x6f94('0x31')][_0x6f94('0x57')]({'where':{'id':_0x4cfd1b[_0x6f94('0x58')]['id']}})[_0x6f94('0x2a')](handleEntityNotFound(_0x5f50ad,null))['then'](removeEntity(_0x5f50ad,null))[_0x6f94('0x49')](handleError(_0x5f50ad,null));};exports['describe']=function(_0x470271,_0xf29b7a){return db[_0x6f94('0x31')][_0x6f94('0x59')]()[_0x6f94('0x2a')](respondWithResult(_0xf29b7a,null))[_0x6f94('0x49')](handleError(_0xf29b7a,null));};exports[_0x6f94('0x5a')]=function(_0x284d84,_0x4ca731,_0x531ab4){var _0x5ca408={'raw':!![],'where':{}},_0x3662ee={},_0x16cd5d;return db[_0x6f94('0x31')][_0x6f94('0x5b')]({'where':{'id':_0x284d84[_0x6f94('0x58')]['id']}})[_0x6f94('0x2a')](handleEntityNotFound(_0x4ca731,null))[_0x6f94('0x2a')](function(_0x1dee21){if(_0x1dee21){_0x16cd5d=_0x1dee21[_0x6f94('0x50')]({'plain':!![]});_0x3662ee[_0x6f94('0x34')]=_[_0x6f94('0x36')](db[_0x6f94('0x5c')][_0x6f94('0x4b')]);_0x3662ee[_0x6f94('0x37')]=_[_0x6f94('0x36')](_0x284d84[_0x6f94('0x37')]);_0x3662ee[_0x6f94('0x38')]=_[_0x6f94('0x4c')](_0x3662ee['model'],_0x3662ee[_0x6f94('0x37')]);_0x5ca408[_0x6f94('0x39')]=_[_0x6f94('0x4c')](_0x3662ee[_0x6f94('0x34')],qs['fields'](_0x284d84['query'][_0x6f94('0x3a')]));_0x5ca408[_0x6f94('0x39')]=_0x5ca408['attributes'][_0x6f94('0x3b')]?_0x5ca408[_0x6f94('0x39')]:_0x3662ee[_0x6f94('0x34')];if(!_0x284d84['query'][_0x6f94('0x3c')](_0x6f94('0x3d'))){_0x5ca408[_0x6f94('0x22')]=qs[_0x6f94('0x22')](_0x284d84[_0x6f94('0x37')][_0x6f94('0x22')]);_0x5ca408['offset']=qs[_0x6f94('0x24')](_0x284d84['query'][_0x6f94('0x24')]);}_0x5ca408[_0x6f94('0x3e')]=qs[_0x6f94('0x3f')](_0x284d84['query'][_0x6f94('0x3f')]);_0x5ca408[_0x6f94('0x40')]=qs[_0x6f94('0x38')](_[_0x6f94('0x5d')](_0x284d84[_0x6f94('0x37')],_0x3662ee[_0x6f94('0x38')]));_0x5ca408['where'][_0x6f94('0x5e')]=_0x1dee21['id'];if(_0x284d84[_0x6f94('0x37')][_0x6f94('0x43')]){_0x5ca408[_0x6f94('0x40')]=_[_0x6f94('0x41')](_0x5ca408[_0x6f94('0x40')],{'$or':_[_0x6f94('0x35')](_0x5ca408['attributes'],function(_0x364667){var _0x74e0f7={};_0x74e0f7[_0x364667]={'$like':'%'+_0x284d84['query'][_0x6f94('0x43')]+'%'};return _0x74e0f7;})});}_0x5ca408=_[_0x6f94('0x41')]({},_0x5ca408,_0x284d84[_0x6f94('0x44')]);return db['UserSmsQueue'][_0x6f94('0x47')](_0x5ca408);}})[_0x6f94('0x2a')](function(_0xeb9435){if(_0xeb9435){return db[_0x6f94('0x5f')][_0x6f94('0x60')]({'where':{'id':_[_0x6f94('0x35')](_0xeb9435,_0x6f94('0x61')),'role':_0x6f94('0x62')},'attributes':['id','name','smsPause','updatedAt',_0x6f94('0x63')]});}})[_0x6f94('0x2a')](function(_0x122979){if(_0x122979){return{'count':_0x122979['count'],'rows':_[_0x6f94('0x35')](_0x122979[_0x6f94('0x48')],function(_0x265bb7){return{'membername':_0x265bb7[_0x6f94('0x2f')],'UserId':_0x265bb7['id'],'queue_name':_0x16cd5d[_0x6f94('0x2f')],'SmsQueueId':_0x16cd5d['id'],'interface':util[_0x6f94('0x64')]('%s/%s','SIP',_0x265bb7[_0x6f94('0x2f')]),'penalty':0x0,'paused':_0x265bb7[_0x6f94('0x65')],'createdAt':_0x265bb7[_0x6f94('0x63')],'updatedAt':_0x265bb7[_0x6f94('0x66')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x6f94('0x2a')](respondWithFilteredResult(_0x4ca731,_0x5ca408))['catch'](handleError(_0x4ca731,null));};exports[_0x6f94('0x67')]=function(_0x56280b,_0x1cb3d1,_0x23f8e6){var _0x391e9c={};var _0x675182={};var _0x46dce9;var _0x150fb5;return db[_0x6f94('0x31')][_0x6f94('0x5b')]({'where':{'id':_0x56280b[_0x6f94('0x58')]['id']}})[_0x6f94('0x2a')](handleEntityNotFound(_0x1cb3d1,null))[_0x6f94('0x2a')](function(_0x225944){if(_0x225944){_0x46dce9=_0x225944;_0x675182[_0x6f94('0x34')]=_[_0x6f94('0x36')](db[_0x6f94('0x68')][_0x6f94('0x4b')]);_0x675182[_0x6f94('0x37')]=_[_0x6f94('0x36')](_0x56280b[_0x6f94('0x37')]);_0x675182['filters']=_[_0x6f94('0x4c')](_0x675182[_0x6f94('0x34')],_0x675182[_0x6f94('0x37')]);_0x391e9c[_0x6f94('0x39')]=_[_0x6f94('0x4c')](_0x675182[_0x6f94('0x34')],qs[_0x6f94('0x3a')](_0x56280b[_0x6f94('0x37')]['fields']));_0x391e9c[_0x6f94('0x39')]=_0x391e9c[_0x6f94('0x39')]['length']?_0x391e9c[_0x6f94('0x39')]:_0x675182[_0x6f94('0x34')];_0x391e9c['order']=qs[_0x6f94('0x3f')](_0x56280b[_0x6f94('0x37')][_0x6f94('0x3f')]);_0x391e9c[_0x6f94('0x40')]=qs[_0x6f94('0x38')](_['pick'](_0x56280b[_0x6f94('0x37')],_0x675182['filters']));if(_0x56280b[_0x6f94('0x37')][_0x6f94('0x43')]){_0x391e9c[_0x6f94('0x40')]=_[_0x6f94('0x41')](_0x391e9c['where'],{'$or':_[_0x6f94('0x35')](_0x391e9c[_0x6f94('0x39')],function(_0x32426b){var _0x43cd21={};_0x43cd21[_0x32426b]={'$like':'%'+_0x56280b[_0x6f94('0x37')]['filter']+'%'};return _0x43cd21;})});}_0x391e9c=_[_0x6f94('0x41')]({},_0x391e9c,_0x56280b[_0x6f94('0x44')]);return _0x46dce9['getTeams'](_0x391e9c);}})[_0x6f94('0x2a')](function(_0xf669){if(_0xf669){_0x150fb5=_0xf669[_0x6f94('0x3b')];if(!_0x56280b['query']['hasOwnProperty']('nolimit')){_0x391e9c[_0x6f94('0x22')]=qs[_0x6f94('0x22')](_0x56280b['query'][_0x6f94('0x22')]);_0x391e9c['offset']=qs[_0x6f94('0x24')](_0x56280b[_0x6f94('0x37')][_0x6f94('0x24')]);}return _0x46dce9[_0x6f94('0x67')](_0x391e9c);}})[_0x6f94('0x2a')](function(_0x151b39){if(_0x151b39){return _0x151b39?{'count':_0x150fb5,'rows':_0x151b39}:null;}})[_0x6f94('0x2a')](respondWithResult(_0x1cb3d1,null))[_0x6f94('0x49')](handleError(_0x1cb3d1,null));};exports[_0x6f94('0x69')]=function(_0x5df339,_0x3e8faf,_0x2f9e6f){var _0x15d5d5=_0x5df339[_0x6f94('0x4e')][_0x6f94('0x6a')];return db['Team'][_0x6f94('0x47')]({'where':{'id':_0x15d5d5},'attributes':['id'],'include':[{'model':db[_0x6f94('0x5f')],'as':'Agents','attributes':['id','name',_0x6f94('0x6b'),_0x6f94('0x6c'),_0x6f94('0x6d')],'raw':!![]}]})[_0x6f94('0x2a')](function(_0x3edb2e){if(_0x3edb2e){var _0x441e88=_[_0x6f94('0x6e')](_0x3edb2e,function(_0x4cd16d){var _0x274440=_0x4cd16d[_0x6f94('0x50')]({'plain':!![]});return _0x274440['Agents'];});return db[_0x6f94('0x31')][_0x6f94('0x57')]({'where':{'id':_0x5df339[_0x6f94('0x58')]['id']}})[_0x6f94('0x2a')](function(_0x54a601){return db[_0x6f94('0x6f')][_0x6f94('0x70')](function(_0x18d591){return _0x54a601[_0x6f94('0x69')](_0x15d5d5,{'transaction':_0x18d591})[_0x6f94('0x2a')](function(){return BPromise[_0x6f94('0x71')](_0x441e88,function(_0x19e1a1){return db[_0x6f94('0x5c')][_0x6f94('0x72')]({'where':{'UserId':_0x19e1a1['id'],'SmsQueueId':_0x5df339[_0x6f94('0x58')]['id']},'transaction':_0x18d591});});})[_0x6f94('0x2a')](function(){_0x441e88[_0x6f94('0x73')](function(_0x3b1402){socket[_0x6f94('0x74')](_0x6f94('0x75'),{'UserId':_0x3b1402['id'],'SmsQueueId':_0x54a601['id']});});});});});}})[_0x6f94('0x2a')](respondWithStatusCode(_0x3e8faf,null))['catch'](handleError(_0x3e8faf,null));};exports[_0x6f94('0x76')]=function(_0x22b062,_0x1d0766,_0x5710d9){return db['Team'][_0x6f94('0x47')]({'where':{'id':_0x22b062[_0x6f94('0x37')]['ids']},'attributes':['id'],'include':[{'model':db[_0x6f94('0x5f')],'as':_0x6f94('0x77'),'attributes':['id'],'raw':!![]}]})[_0x6f94('0x2a')](handleEntityNotFound(_0x1d0766,null))[_0x6f94('0x2a')](function(_0x5c628c){var _0x1e36c=_[_0x6f94('0x35')](_0x5c628c,'id');var _0x2d3a5b=[];var _0x2e5f57=[];var _0x5d58d7=squel[_0x6f94('0x78')]();_0x5d58d7['field'](_0x6f94('0x79'))[_0x6f94('0x7a')](_0x6f94('0x7b'),'tq')['join'](_0x6f94('0x7c'),'ut',_0x6f94('0x7d'))[_0x6f94('0x40')](_0x6f94('0x7e'),_0x22b062[_0x6f94('0x58')]['id']);for(var _0x27dcaa=0x0;_0x27dcaa<_0x5c628c[_0x6f94('0x3b')];_0x27dcaa+=0x1){let _0x570a5b=_0x5c628c[_0x27dcaa];for(var _0x4bcb99=0x0;_0x4bcb99<_0x570a5b[_0x6f94('0x77')][_0x6f94('0x3b')];_0x4bcb99+=0x1){let _0x344e9d=_0x570a5b[_0x6f94('0x77')][_0x4bcb99];var _0x290935=_0x5d58d7[_0x6f94('0x7f')]();_0x290935[_0x6f94('0x40')](_0x6f94('0x80'),_0x344e9d['id']);_0x2e5f57[_0x6f94('0x81')](db[_0x6f94('0x6f')][_0x6f94('0x37')](_0x290935[_0x6f94('0x82')](),{'type':db[_0x6f94('0x6f')][_0x6f94('0x83')]['SELECT']})[_0x6f94('0x2a')](function(_0x274d15){if(_0x274d15['length']===0x1){return _0x344e9d['id'];}else{var _0x36763c=_[_0x6f94('0x84')](_[_0x6f94('0x35')](_0x274d15,_0x6f94('0x85')),function(_0xf9988e){return _[_0x6f94('0x86')](_0x1e36c,_0xf9988e);});if(_0x36763c){return _0x344e9d['id'];}}}));}}return BPromise[_0x6f94('0x87')](_0x2e5f57)['then'](function(_0x2cf359){_0x2d3a5b=_(_0x2d3a5b)[_0x6f94('0x88')](_0x2cf359)[_0x6f94('0x89')]()[_0x6f94('0x8a')]();return db[_0x6f94('0x31')]['find']({'where':{'id':_0x22b062[_0x6f94('0x58')]['id']}})[_0x6f94('0x2a')](function(_0x452b83){return db[_0x6f94('0x6f')][_0x6f94('0x70')](function(_0x4cbc48){return _0x452b83[_0x6f94('0x76')](_0x22b062[_0x6f94('0x37')][_0x6f94('0x6a')],{'transaction':_0x4cbc48})[_0x6f94('0x2a')](function(){if(!_[_0x6f94('0x8b')](_0x2d3a5b)){return _0x452b83['removeAgents'](_0x2d3a5b,{'transaction':_0x4cbc48});}})[_0x6f94('0x2a')](function(){_0x2d3a5b[_0x6f94('0x73')](function(_0xa2f0f6){socket[_0x6f94('0x74')](_0x6f94('0x8c'),{'UserId':_0xa2f0f6,'SmsQueueId':_0x452b83['id']});});});});});});})[_0x6f94('0x2a')](respondWithStatusCode(_0x1d0766,null))[_0x6f94('0x49')](handleError(_0x1d0766,null));};exports[_0x6f94('0x8d')]=function(_0x894f12,_0x1a66fa,_0x1cafeb){return db[_0x6f94('0x31')][_0x6f94('0x57')]({'where':{'id':_0x894f12['params']['id']}})[_0x6f94('0x2a')](handleEntityNotFound(_0x1a66fa,null))[_0x6f94('0x2a')](function(_0x2028ba){if(_0x2028ba){return _0x2028ba[_0x6f94('0x8d')](_0x894f12[_0x6f94('0x4e')][_0x6f94('0x6a')],_[_0x6f94('0x8e')](_0x894f12[_0x6f94('0x4e')],[_0x6f94('0x6a'),'id'])||{})[_0x6f94('0x8f')](function(_0x2cdb85){for(var _0x5020f2=0x0;_0x5020f2<_0x894f12['body'][_0x6f94('0x6a')][_0x6f94('0x3b')];_0x5020f2+=0x1){socket['emit'](_0x6f94('0x75'),{'UserId':Number(_0x894f12[_0x6f94('0x4e')][_0x6f94('0x6a')][_0x5020f2]),'SmsQueueId':Number(_0x894f12[_0x6f94('0x58')]['id'])});}return _0x2cdb85;});}})['then'](respondWithResult(_0x1a66fa,null))[_0x6f94('0x49')](handleError(_0x1a66fa,null));};exports[_0x6f94('0x90')]=function(_0x583371,_0x281f2c,_0x3b934a){return db[_0x6f94('0x31')][_0x6f94('0x57')]({'where':{'id':_0x583371[_0x6f94('0x58')]['id']}})['then'](handleEntityNotFound(_0x281f2c,null))['then'](function(_0x173099){if(_0x173099){return _0x173099[_0x6f94('0x90')](_0x583371[_0x6f94('0x37')]['ids'])[_0x6f94('0x2a')](function(){if(_[_0x6f94('0x91')](_0x583371['query']['ids'])){for(var _0xad46b9=0x0;_0xad46b9<_0x583371['query'][_0x6f94('0x6a')][_0x6f94('0x3b')];_0xad46b9+=0x1){socket[_0x6f94('0x74')]('userSmsQueue:remove',{'UserId':Number(_0x583371['query'][_0x6f94('0x6a')][_0xad46b9]),'SmsQueueId':Number(_0x583371[_0x6f94('0x58')]['id'])});}}else{socket[_0x6f94('0x74')](_0x6f94('0x8c'),{'UserId':Number(_0x583371[_0x6f94('0x37')][_0x6f94('0x6a')]),'SmsQueueId':Number(_0x583371[_0x6f94('0x58')]['id'])});}});}})[_0x6f94('0x2a')](respondWithStatusCode(_0x281f2c,null))['catch'](handleError(_0x281f2c,null));};exports['getAgents']=function(_0x5e1aae,_0x1e0f1c,_0x1b3448){var _0x2c12ae={};var _0x1c9429={};var _0x81032;var _0x2d6244;return db[_0x6f94('0x31')][_0x6f94('0x5b')]({'where':{'id':_0x5e1aae[_0x6f94('0x58')]['id']}})[_0x6f94('0x2a')](handleEntityNotFound(_0x1e0f1c,null))['then'](function(_0x2dc5b3){if(_0x2dc5b3){_0x81032=_0x2dc5b3;_0x1c9429['model']=_[_0x6f94('0x36')](db[_0x6f94('0x5f')][_0x6f94('0x4b')]);_0x1c9429[_0x6f94('0x37')]=_['keys'](_0x5e1aae[_0x6f94('0x37')]);_0x1c9429[_0x6f94('0x38')]=_[_0x6f94('0x4c')](_0x1c9429[_0x6f94('0x34')],_0x1c9429[_0x6f94('0x37')]);_0x2c12ae[_0x6f94('0x39')]=_[_0x6f94('0x4c')](_0x1c9429[_0x6f94('0x34')],qs[_0x6f94('0x3a')](_0x5e1aae[_0x6f94('0x37')][_0x6f94('0x3a')]));_0x2c12ae[_0x6f94('0x39')]=_0x2c12ae['attributes'][_0x6f94('0x3b')]?_0x2c12ae[_0x6f94('0x39')]:_0x1c9429[_0x6f94('0x34')];_0x2c12ae[_0x6f94('0x3e')]=qs[_0x6f94('0x3f')](_0x5e1aae[_0x6f94('0x37')]['sort']);_0x2c12ae[_0x6f94('0x40')]=qs['filters'](_['pick'](_0x5e1aae[_0x6f94('0x37')],_0x1c9429['filters']));if(_0x5e1aae['query'][_0x6f94('0x43')]){_0x2c12ae[_0x6f94('0x40')]=_['merge'](_0x2c12ae[_0x6f94('0x40')],{'$or':_[_0x6f94('0x35')](_0x2c12ae[_0x6f94('0x39')],function(_0x597a30){var _0xeec2a2={};_0xeec2a2[_0x597a30]={'$like':'%'+_0x5e1aae['query'][_0x6f94('0x43')]+'%'};return _0xeec2a2;})});}_0x2c12ae=_['merge']({},_0x2c12ae,_0x5e1aae[_0x6f94('0x44')]);return _0x81032[_0x6f94('0x92')](_0x2c12ae);}})[_0x6f94('0x2a')](function(_0x414710){if(_0x414710){_0x2d6244=_0x414710['length'];if(!_0x5e1aae[_0x6f94('0x37')][_0x6f94('0x3c')](_0x6f94('0x3d'))){_0x2c12ae[_0x6f94('0x22')]=qs[_0x6f94('0x22')](_0x5e1aae[_0x6f94('0x37')][_0x6f94('0x22')]);_0x2c12ae['offset']=qs[_0x6f94('0x24')](_0x5e1aae[_0x6f94('0x37')][_0x6f94('0x24')]);}return _0x81032[_0x6f94('0x92')](_0x2c12ae);}})[_0x6f94('0x2a')](function(_0x1ac483){if(_0x1ac483){return _0x1ac483?{'count':_0x2d6244,'rows':_0x1ac483}:null;}})[_0x6f94('0x2a')](respondWithResult(_0x1e0f1c,null))[_0x6f94('0x49')](handleError(_0x1e0f1c,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index de73e16..34acd90 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 _0x1242=['SmsQueue','setMaxListeners','save','update','remove','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x1ae5ab,_0xc5d441){var _0x1ce001=function(_0x5ef96d){while(--_0x5ef96d){_0x1ae5ab['push'](_0x1ae5ab['shift']());}};_0x1ce001(++_0xc5d441);}(_0x1242,0xcd));var _0x2124=function(_0x59130e,_0x5b4bb0){_0x59130e=_0x59130e-0x0;var _0x1fe51e=_0x1242[_0x59130e];return _0x1fe51e;};'use strict';var EventEmitter=require(_0x2124('0x0'));var SmsQueue=require(_0x2124('0x1'))['db'][_0x2124('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x2124('0x3')](0x0);var events={'afterCreate':_0x2124('0x4'),'afterUpdate':_0x2124('0x5'),'afterDestroy':_0x2124('0x6')};function emitEvent(_0x1fd98f){return function(_0x58f59d,_0x5c9003,_0x120f36){SmsQueueEvents['emit'](_0x1fd98f+':'+_0x58f59d['id'],_0x58f59d);SmsQueueEvents['emit'](_0x1fd98f,_0x58f59d);_0x120f36(null);};}for(var e in events){if(events[_0x2124('0x7')](e)){var event=events[e];SmsQueue[_0x2124('0x8')](e,emitEvent(event));}}module['exports']=SmsQueueEvents; \ No newline at end of file +var _0xd9a8=['hasOwnProperty','hook','exports','events','../../mysqldb','SmsQueue','setMaxListeners','save','update','remove','emit'];(function(_0x523d5b,_0x1808f0){var _0x4d5b4c=function(_0x2e80a6){while(--_0x2e80a6){_0x523d5b['push'](_0x523d5b['shift']());}};_0x4d5b4c(++_0x1808f0);}(_0xd9a8,0x16e));var _0x8d9a=function(_0x3241e0,_0x5f3409){_0x3241e0=_0x3241e0-0x0;var _0x4361f7=_0xd9a8[_0x3241e0];return _0x4361f7;};'use strict';var EventEmitter=require(_0x8d9a('0x0'));var SmsQueue=require(_0x8d9a('0x1'))['db'][_0x8d9a('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x8d9a('0x3')](0x0);var events={'afterCreate':_0x8d9a('0x4'),'afterUpdate':_0x8d9a('0x5'),'afterDestroy':_0x8d9a('0x6')};function emitEvent(_0x124db7){return function(_0x22e422,_0x503cfc,_0x35741f){SmsQueueEvents[_0x8d9a('0x7')](_0x124db7+':'+_0x22e422['id'],_0x22e422);SmsQueueEvents[_0x8d9a('0x7')](_0x124db7,_0x22e422);_0x35741f(null);};}for(var e in events){if(events[_0x8d9a('0x8')](e)){var event=events[e];SmsQueue[_0x8d9a('0x9')](e,emitEvent(event));}}module[_0x8d9a('0xa')]=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index 8601c90..7e39482 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 _0xd8dc=['util','../../config/logger','moment','request-promise','rimraf','define','SmsQueue','sms_queues','lodash'];(function(_0x151721,_0x20d5bc){var _0x2deaa7=function(_0x499812){while(--_0x499812){_0x151721['push'](_0x151721['shift']());}};_0x2deaa7(++_0x20d5bc);}(_0xd8dc,0x1a6));var _0xcd8d=function(_0x5cdae9,_0x5e30a9){_0x5cdae9=_0x5cdae9-0x0;var _0x417701=_0xd8dc[_0x5cdae9];return _0x417701;};'use strict';var _=require(_0xcd8d('0x0'));var util=require(_0xcd8d('0x1'));var logger=require(_0xcd8d('0x2'))('api');var moment=require(_0xcd8d('0x3'));var BPromise=require('bluebird');var rp=require(_0xcd8d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcd8d('0x5'));var config=require('../../config/environment');var attributes=require('./smsQueue.attributes');module['exports']=function(_0x46fdf2,_0x5cce72){return _0x46fdf2[_0xcd8d('0x6')](_0xcd8d('0x7'),attributes,{'tableName':_0xcd8d('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd581=['SmsQueue','sms_queues','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./smsQueue.attributes','define'];(function(_0x254461,_0x45615a){var _0x28ee0e=function(_0x3f9881){while(--_0x3f9881){_0x254461['push'](_0x254461['shift']());}};_0x28ee0e(++_0x45615a);}(_0xd581,0x1a2));var _0x1d58=function(_0x51c819,_0xd812db){_0x51c819=_0x51c819-0x0;var _0x15c5d2=_0xd581[_0x51c819];return _0x15c5d2;};'use strict';var _=require(_0x1d58('0x0'));var util=require(_0x1d58('0x1'));var logger=require(_0x1d58('0x2'))(_0x1d58('0x3'));var moment=require(_0x1d58('0x4'));var BPromise=require(_0x1d58('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1d58('0x6'));var rimraf=require(_0x1d58('0x7'));var config=require(_0x1d58('0x8'));var attributes=require(_0x1d58('0x9'));module['exports']=function(_0x55f3c1,_0x384788){return _0x55f3c1[_0x1d58('0xa')](_0x1d58('0xb'),attributes,{'tableName':_0x1d58('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.rpc.js b/server/api/smsQueue/smsQueue.rpc.js index 03ea4e8..fe345ad 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 _0xbc9e=['options','raw','where','attributes','limit','include','map','model','find','ShowSmsQueue','lodash','util','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','request','then','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetSmsQueue','SmsQueue','findAll'];(function(_0x56a871,_0x18b7fe){var _0x124954=function(_0x39b7a1){while(--_0x39b7a1){_0x56a871['push'](_0x56a871['shift']());}};_0x124954(++_0x18b7fe);}(_0xbc9e,0xaa));var _0xebc9=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0xbc9e[_0x21549c];return _0x426cbd;};'use strict';var _=require(_0xebc9('0x0'));var util=require(_0xebc9('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xebc9('0x2'))['db'];var utils=require(_0xebc9('0x3'));var logger=require(_0xebc9('0x4'))(_0xebc9('0x5'));var config=require('../../config/environment');var jayson=require(_0xebc9('0x6'));var client=jayson[_0xebc9('0x7')]['http']({'port':0x232a});config[_0xebc9('0x8')]=_[_0xebc9('0x9')](config[_0xebc9('0x8')],{'host':_0xebc9('0xa'),'port':0x18eb});var socket=require(_0xebc9('0xb'))(new Redis(config[_0xebc9('0x8')]));require(_0xebc9('0xc'))[_0xebc9('0xd')](socket);function respondWithRpcPromise(_0x5f3fda,_0x508c89,_0x365390){return new BPromise(function(_0x289dd7,_0x2b163d){return client[_0xebc9('0xe')](_0x5f3fda,_0x365390)[_0xebc9('0xf')](function(_0x46f5b0){logger['info'](_0xebc9('0x10'),_0x508c89,_0xebc9('0x11'));logger[_0xebc9('0x12')](_0xebc9('0x13'),_0x508c89,_0xebc9('0x11'),JSON[_0xebc9('0x14')](_0x46f5b0));if(_0x46f5b0['error']){if(_0x46f5b0[_0xebc9('0x15')][_0xebc9('0x16')]===0x1f4){logger[_0xebc9('0x15')](_0xebc9('0x10'),_0x508c89,_0x46f5b0['error']['message']);return _0x2b163d(_0x46f5b0[_0xebc9('0x15')][_0xebc9('0x17')]);}logger['error'](_0xebc9('0x10'),_0x508c89,_0x46f5b0[_0xebc9('0x15')][_0xebc9('0x17')]);return _0x289dd7(_0x46f5b0['error'][_0xebc9('0x17')]);}else{logger[_0xebc9('0x18')](_0xebc9('0x10'),_0x508c89,_0xebc9('0x11'));_0x289dd7(_0x46f5b0[_0xebc9('0x19')][_0xebc9('0x17')]);}})[_0xebc9('0x1a')](function(_0x24d06d){logger[_0xebc9('0x15')]('SmsQueue,\x20%s,\x20%s',_0x508c89,_0x24d06d);_0x2b163d(_0x24d06d);});});}exports[_0xebc9('0x1b')]=function(_0x3e49db){var _0x2b543c=this;return new Promise(function(_0x3c0014,_0x144875){return db[_0xebc9('0x1c')][_0xebc9('0x1d')]({'raw':_0x3e49db['options']?_0x3e49db[_0xebc9('0x1e')][_0xebc9('0x1f')]===undefined?!![]:![]:!![],'where':_0x3e49db[_0xebc9('0x1e')]?_0x3e49db['options'][_0xebc9('0x20')]||null:null,'attributes':_0x3e49db['options']?_0x3e49db[_0xebc9('0x1e')][_0xebc9('0x21')]||null:null,'limit':_0x3e49db[_0xebc9('0x1e')]?_0x3e49db['options'][_0xebc9('0x22')]||null:null,'include':_0x3e49db['options']?_0x3e49db[_0xebc9('0x1e')][_0xebc9('0x23')]?_[_0xebc9('0x24')](_0x3e49db[_0xebc9('0x1e')][_0xebc9('0x23')],function(_0x33856a){return{'model':db[_0x33856a['model']],'as':_0x33856a['as'],'attributes':_0x33856a[_0xebc9('0x21')],'include':_0x33856a[_0xebc9('0x23')]?_[_0xebc9('0x24')](_0x33856a[_0xebc9('0x23')],function(_0x31dd5d){return{'model':db[_0x31dd5d[_0xebc9('0x25')]],'as':_0x31dd5d['as'],'attributes':_0x31dd5d[_0xebc9('0x21')],'include':_0x31dd5d[_0xebc9('0x23')]?_['map'](_0x31dd5d[_0xebc9('0x23')],function(_0x14f25a){return{'model':db[_0x14f25a[_0xebc9('0x25')]],'as':_0x14f25a['as'],'attributes':_0x14f25a['attributes']};}):[]};}):[]};}):[]:[]})[_0xebc9('0xf')](function(_0x39e9d7){logger['info'](_0xebc9('0x1b'),_0x3e49db);logger[_0xebc9('0x12')](_0xebc9('0x1b'),_0x3e49db,JSON['stringify'](_0x39e9d7));_0x3c0014(_0x39e9d7);})['catch'](function(_0x4ed1f0){logger[_0xebc9('0x15')](_0xebc9('0x1b'),_0x4ed1f0[_0xebc9('0x17')],_0x3e49db);_0x144875(_0x2b543c['error'](0x1f4,_0x4ed1f0[_0xebc9('0x17')]));});});};exports['ShowSmsQueue']=function(_0x5aff76){var _0x1f190f=this;return new Promise(function(_0x56051f,_0x4ecd87){return db['SmsQueue'][_0xebc9('0x26')]({'raw':_0x5aff76[_0xebc9('0x1e')]?_0x5aff76[_0xebc9('0x1e')][_0xebc9('0x1f')]===undefined?!![]:![]:!![],'where':_0x5aff76[_0xebc9('0x1e')]?_0x5aff76[_0xebc9('0x1e')][_0xebc9('0x20')]||null:null,'attributes':_0x5aff76[_0xebc9('0x1e')]?_0x5aff76['options'][_0xebc9('0x21')]||null:null,'include':_0x5aff76[_0xebc9('0x1e')]?_0x5aff76[_0xebc9('0x1e')]['include']?_['map'](_0x5aff76[_0xebc9('0x1e')][_0xebc9('0x23')],function(_0xbe50a5){return{'model':db[_0xbe50a5[_0xebc9('0x25')]],'as':_0xbe50a5['as'],'attributes':_0xbe50a5['attributes'],'include':_0xbe50a5['include']?_[_0xebc9('0x24')](_0xbe50a5[_0xebc9('0x23')],function(_0x5d0eed){return{'model':db[_0x5d0eed[_0xebc9('0x25')]],'as':_0x5d0eed['as'],'attributes':_0x5d0eed[_0xebc9('0x21')],'include':_0x5d0eed[_0xebc9('0x23')]?_[_0xebc9('0x24')](_0x5d0eed['include'],function(_0x5b2597){return{'model':db[_0x5b2597[_0xebc9('0x25')]],'as':_0x5b2597['as'],'attributes':_0x5b2597[_0xebc9('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x488537){logger[_0xebc9('0x18')](_0xebc9('0x27'),_0x5aff76);logger['debug'](_0xebc9('0x27'),_0x5aff76,JSON[_0xebc9('0x14')](_0x488537));_0x56051f(_0x488537);})[_0xebc9('0x1a')](function(_0x37b3c9){logger[_0xebc9('0x15')](_0xebc9('0x27'),_0x37b3c9[_0xebc9('0x17')],_0x5aff76);_0x4ecd87(_0x1f190f[_0xebc9('0x15')](0x1f4,_0x37b3c9['message']));});});}; \ No newline at end of file +var _0x1cb2=['jayson/promise','client','http','redis','localhost','./smsQueue.socket','register','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','error','message','catch','GetSmsQueue','SmsQueue','findAll','options','where','attributes','limit','include','map','model','then','stringify','ShowSmsQueue','find','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x1cb2,0x10e));var _0x21cb=function(_0x1df3e5,_0x2d37f1){_0x1df3e5=_0x1df3e5-0x0;var _0x422d0c=_0x1cb2[_0x1df3e5];return _0x422d0c;};'use strict';var _=require(_0x21cb('0x0'));var util=require(_0x21cb('0x1'));var moment=require(_0x21cb('0x2'));var BPromise=require(_0x21cb('0x3'));var rs=require(_0x21cb('0x4'));var fs=require('fs');var Redis=require(_0x21cb('0x5'));var db=require(_0x21cb('0x6'))['db'];var utils=require(_0x21cb('0x7'));var logger=require('../../config/logger')(_0x21cb('0x8'));var config=require(_0x21cb('0x9'));var jayson=require(_0x21cb('0xa'));var client=jayson[_0x21cb('0xb')][_0x21cb('0xc')]({'port':0x232a});config['redis']=_['defaults'](config[_0x21cb('0xd')],{'host':_0x21cb('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x21cb('0xd')]));require(_0x21cb('0xf'))[_0x21cb('0x10')](socket);function respondWithRpcPromise(_0x28b21c,_0x4539d9,_0x22781b){return new BPromise(function(_0x1c2b61,_0x531927){return client['request'](_0x28b21c,_0x22781b)['then'](function(_0x3d4e15){logger[_0x21cb('0x11')](_0x21cb('0x12'),_0x4539d9,_0x21cb('0x13'));logger[_0x21cb('0x14')](_0x21cb('0x15'),_0x4539d9,'request\x20sent',JSON['stringify'](_0x3d4e15));if(_0x3d4e15[_0x21cb('0x16')]){if(_0x3d4e15[_0x21cb('0x16')]['code']===0x1f4){logger[_0x21cb('0x16')](_0x21cb('0x12'),_0x4539d9,_0x3d4e15[_0x21cb('0x16')][_0x21cb('0x17')]);return _0x531927(_0x3d4e15[_0x21cb('0x16')][_0x21cb('0x17')]);}logger[_0x21cb('0x16')](_0x21cb('0x12'),_0x4539d9,_0x3d4e15['error'][_0x21cb('0x17')]);return _0x1c2b61(_0x3d4e15['error'][_0x21cb('0x17')]);}else{logger['info']('SmsQueue,\x20%s,\x20%s',_0x4539d9,_0x21cb('0x13'));_0x1c2b61(_0x3d4e15['result'][_0x21cb('0x17')]);}})[_0x21cb('0x18')](function(_0x3d088b){logger[_0x21cb('0x16')](_0x21cb('0x12'),_0x4539d9,_0x3d088b);_0x531927(_0x3d088b);});});}exports[_0x21cb('0x19')]=function(_0x1390d0){var _0x43f66f=this;return new Promise(function(_0x4e9980,_0x151637){return db[_0x21cb('0x1a')][_0x21cb('0x1b')]({'raw':_0x1390d0[_0x21cb('0x1c')]?_0x1390d0[_0x21cb('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x1390d0[_0x21cb('0x1c')]?_0x1390d0[_0x21cb('0x1c')][_0x21cb('0x1d')]||null:null,'attributes':_0x1390d0[_0x21cb('0x1c')]?_0x1390d0[_0x21cb('0x1c')][_0x21cb('0x1e')]||null:null,'limit':_0x1390d0['options']?_0x1390d0[_0x21cb('0x1c')][_0x21cb('0x1f')]||null:null,'include':_0x1390d0[_0x21cb('0x1c')]?_0x1390d0['options'][_0x21cb('0x20')]?_[_0x21cb('0x21')](_0x1390d0[_0x21cb('0x1c')][_0x21cb('0x20')],function(_0x485e43){return{'model':db[_0x485e43[_0x21cb('0x22')]],'as':_0x485e43['as'],'attributes':_0x485e43[_0x21cb('0x1e')],'include':_0x485e43[_0x21cb('0x20')]?_[_0x21cb('0x21')](_0x485e43['include'],function(_0x16a244){return{'model':db[_0x16a244[_0x21cb('0x22')]],'as':_0x16a244['as'],'attributes':_0x16a244[_0x21cb('0x1e')],'include':_0x16a244[_0x21cb('0x20')]?_[_0x21cb('0x21')](_0x16a244[_0x21cb('0x20')],function(_0x1d7df4){return{'model':db[_0x1d7df4[_0x21cb('0x22')]],'as':_0x1d7df4['as'],'attributes':_0x1d7df4['attributes']};}):[]};}):[]};}):[]:[]})[_0x21cb('0x23')](function(_0x1ad7c5){logger['info'](_0x21cb('0x19'),_0x1390d0);logger['debug'](_0x21cb('0x19'),_0x1390d0,JSON[_0x21cb('0x24')](_0x1ad7c5));_0x4e9980(_0x1ad7c5);})[_0x21cb('0x18')](function(_0x407521){logger[_0x21cb('0x16')](_0x21cb('0x19'),_0x407521[_0x21cb('0x17')],_0x1390d0);_0x151637(_0x43f66f['error'](0x1f4,_0x407521['message']));});});};exports[_0x21cb('0x25')]=function(_0x2923b7){var _0x48c7c8=this;return new Promise(function(_0x46d888,_0x178371){return db[_0x21cb('0x1a')][_0x21cb('0x26')]({'raw':_0x2923b7[_0x21cb('0x1c')]?_0x2923b7[_0x21cb('0x1c')][_0x21cb('0x27')]===undefined?!![]:![]:!![],'where':_0x2923b7[_0x21cb('0x1c')]?_0x2923b7[_0x21cb('0x1c')][_0x21cb('0x1d')]||null:null,'attributes':_0x2923b7[_0x21cb('0x1c')]?_0x2923b7[_0x21cb('0x1c')][_0x21cb('0x1e')]||null:null,'include':_0x2923b7[_0x21cb('0x1c')]?_0x2923b7[_0x21cb('0x1c')][_0x21cb('0x20')]?_[_0x21cb('0x21')](_0x2923b7['options'][_0x21cb('0x20')],function(_0x4e1a3a){return{'model':db[_0x4e1a3a[_0x21cb('0x22')]],'as':_0x4e1a3a['as'],'attributes':_0x4e1a3a[_0x21cb('0x1e')],'include':_0x4e1a3a['include']?_[_0x21cb('0x21')](_0x4e1a3a[_0x21cb('0x20')],function(_0x523542){return{'model':db[_0x523542[_0x21cb('0x22')]],'as':_0x523542['as'],'attributes':_0x523542['attributes'],'include':_0x523542[_0x21cb('0x20')]?_[_0x21cb('0x21')](_0x523542['include'],function(_0x16fc01){return{'model':db[_0x16fc01[_0x21cb('0x22')]],'as':_0x16fc01['as'],'attributes':_0x16fc01[_0x21cb('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x21cb('0x23')](function(_0x7f9d43){logger[_0x21cb('0x11')](_0x21cb('0x25'),_0x2923b7);logger[_0x21cb('0x14')](_0x21cb('0x25'),_0x2923b7,JSON['stringify'](_0x7f9d43));_0x46d888(_0x7f9d43);})[_0x21cb('0x18')](function(_0x25f3ab){logger[_0x21cb('0x16')]('ShowSmsQueue',_0x25f3ab[_0x21cb('0x17')],_0x2923b7);_0x178371(_0x48c7c8[_0x21cb('0x16')](0x1f4,_0x25f3ab[_0x21cb('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index e50296a..1bfdfb2 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 _0x38db=['smsQueue:','./smsQueue.events','save','emit','length'];(function(_0x19146b,_0x5d29ec){var _0x216fdd=function(_0x33a8dc){while(--_0x33a8dc){_0x19146b['push'](_0x19146b['shift']());}};_0x216fdd(++_0x5d29ec);}(_0x38db,0x1b9));var _0xb38d=function(_0x37281e,_0x3c643c){_0x37281e=_0x37281e-0x0;var _0x3a2386=_0x38db[_0x37281e];return _0x3a2386;};'use strict';var SmsQueueEvents=require(_0xb38d('0x0'));var events=[_0xb38d('0x1'),'remove','update'];function createListener(_0x4b6410,_0x495f13){return function(_0x13793f){_0x495f13[_0xb38d('0x2')](_0x4b6410,_0x13793f);};}function removeListener(_0x985214,_0x1ccb0f){return function(){SmsQueueEvents['removeListener'](_0x985214,_0x1ccb0f);};}exports['register']=function(_0x17c857){for(var _0x30540f=0x0,_0x38bbf9=events[_0xb38d('0x3')];_0x30540f<_0x38bbf9;_0x30540f++){var _0x3456c7=events[_0x30540f];var _0x15ec38=createListener(_0xb38d('0x4')+_0x3456c7,_0x17c857);SmsQueueEvents['on'](_0x3456c7,_0x15ec38);}}; \ No newline at end of file +var _0xb1b7=['register','length','smsQueue:','./smsQueue.events','save','remove','update','emit','removeListener'];(function(_0x741cc3,_0xf44e7c){var _0x5e992f=function(_0x2f0214){while(--_0x2f0214){_0x741cc3['push'](_0x741cc3['shift']());}};_0x5e992f(++_0xf44e7c);}(_0xb1b7,0x8a));var _0x7b1b=function(_0x2bf59d,_0x432996){_0x2bf59d=_0x2bf59d-0x0;var _0x2e012d=_0xb1b7[_0x2bf59d];return _0x2e012d;};'use strict';var SmsQueueEvents=require(_0x7b1b('0x0'));var events=[_0x7b1b('0x1'),_0x7b1b('0x2'),_0x7b1b('0x3')];function createListener(_0x3662d4,_0x4f4166){return function(_0x34f6a4){_0x4f4166[_0x7b1b('0x4')](_0x3662d4,_0x34f6a4);};}function removeListener(_0x2eb4be,_0xd91bf1){return function(){SmsQueueEvents[_0x7b1b('0x5')](_0x2eb4be,_0xd91bf1);};}exports[_0x7b1b('0x6')]=function(_0x5c6828){for(var _0x3c1b09=0x0,_0x321df3=events[_0x7b1b('0x7')];_0x3c1b09<_0x321df3;_0x3c1b09++){var _0x4cce68=events[_0x3c1b09];var _0xcbc749=createListener(_0x7b1b('0x8')+_0x4cce68,_0x5c6828);SmsQueueEvents['on'](_0x4cce68,_0xcbc749);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index c1fdfec..62f4043 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 _0x1a96=['destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./smsQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete'];(function(_0x251f2c,_0x28085f){var _0x9f9def=function(_0x42dfc5){while(--_0x42dfc5){_0x251f2c['push'](_0x251f2c['shift']());}};_0x9f9def(++_0x28085f);}(_0x1a96,0x1a3));var _0x61a9=function(_0x14b568,_0x535f78){_0x14b568=_0x14b568-0x0;var _0x4191d9=_0x1a96[_0x14b568];return _0x4191d9;};'use strict';var multer=require(_0x61a9('0x0'));var util=require(_0x61a9('0x1'));var path=require(_0x61a9('0x2'));var timeout=require(_0x61a9('0x3'));var express=require('express');var router=express[_0x61a9('0x4')]();var fs_extra=require(_0x61a9('0x5'));var auth=require(_0x61a9('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x61a9('0x7'));var controller=require(_0x61a9('0x8'));router[_0x61a9('0x9')]('/',auth[_0x61a9('0xa')](),controller[_0x61a9('0xb')]);router['get'](_0x61a9('0xc'),auth[_0x61a9('0xa')](),controller[_0x61a9('0xd')]);router[_0x61a9('0x9')](_0x61a9('0xe'),auth['isAuthenticated'](),controller[_0x61a9('0xf')]);router[_0x61a9('0x10')]('/',auth[_0x61a9('0xa')](),controller[_0x61a9('0x11')]);router[_0x61a9('0x12')](_0x61a9('0xe'),auth[_0x61a9('0xa')](),controller[_0x61a9('0x13')]);router[_0x61a9('0x14')](_0x61a9('0xe'),auth['isAuthenticated'](),controller[_0x61a9('0x15')]);module['exports']=router; \ No newline at end of file +var _0xbc5d=['../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','isAuthenticated','get','/describe','describe','post','create','/:id','update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x16c6c6,_0x35bad8){var _0x2ada32=function(_0x7b3282){while(--_0x7b3282){_0x16c6c6['push'](_0x16c6c6['shift']());}};_0x2ada32(++_0x35bad8);}(_0xbc5d,0x19e));var _0xdbc5=function(_0x491df9,_0x45d7f1){_0x491df9=_0x491df9-0x0;var _0x461a78=_0xbc5d[_0x491df9];return _0x461a78;};'use strict';var multer=require('multer');var util=require(_0xdbc5('0x0'));var path=require(_0xdbc5('0x1'));var timeout=require(_0xdbc5('0x2'));var express=require(_0xdbc5('0x3'));var router=express[_0xdbc5('0x4')]();var fs_extra=require(_0xdbc5('0x5'));var auth=require(_0xdbc5('0x6'));var interaction=require(_0xdbc5('0x7'));var config=require(_0xdbc5('0x8'));var controller=require(_0xdbc5('0x9'));router['get']('/',auth[_0xdbc5('0xa')](),controller['index']);router[_0xdbc5('0xb')](_0xdbc5('0xc'),auth[_0xdbc5('0xa')](),controller[_0xdbc5('0xd')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0xdbc5('0xe')]('/',auth[_0xdbc5('0xa')](),controller[_0xdbc5('0xf')]);router['put'](_0xdbc5('0x10'),auth[_0xdbc5('0xa')](),controller[_0xdbc5('0x11')]);router['delete'](_0xdbc5('0x10'),auth[_0xdbc5('0xa')](),controller[_0xdbc5('0x12')]);module[_0xdbc5('0x13')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index 7cd58bc..56c6a46 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 _0x474f=['moment','exports','STRING','DATE'];(function(_0x33c699,_0x25d26a){var _0x1e9db9=function(_0x59cac0){while(--_0x59cac0){_0x33c699['push'](_0x33c699['shift']());}};_0x1e9db9(++_0x25d26a);}(_0x474f,0xac));var _0xf474=function(_0xf888d4,_0x103b6b){_0xf888d4=_0xf888d4-0x0;var _0x1ccc12=_0x474f[_0xf888d4];return _0x1ccc12;};'use strict';var moment=require(_0xf474('0x0'));var Sequelize=require('sequelize');module[_0xf474('0x1')]={'uniqueid':{'type':Sequelize[_0xf474('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xf474('0x2')]},'joinAt':{'type':Sequelize[_0xf474('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xf474('0x3')]},'reason':{'type':Sequelize[_0xf474('0x2')]}}; \ No newline at end of file +var _0xd7ba=['sequelize','exports','STRING','DATE','moment'];(function(_0x4dfa20,_0x35afb5){var _0x146afc=function(_0x5a4344){while(--_0x5a4344){_0x4dfa20['push'](_0x4dfa20['shift']());}};_0x146afc(++_0x35afb5);}(_0xd7ba,0xef));var _0xad7b=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xd7ba[_0x19e35c];return _0x3e1fe8;};'use strict';var moment=require(_0xad7b('0x0'));var Sequelize=require(_0xad7b('0x1'));module[_0xad7b('0x2')]={'uniqueid':{'type':Sequelize[_0xad7b('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xad7b('0x3')]},'joinAt':{'type':Sequelize[_0xad7b('0x4')]},'leaveAt':{'type':Sequelize[_0xad7b('0x4')]},'acceptAt':{'type':Sequelize[_0xad7b('0x4')]},'exitAt':{'type':Sequelize[_0xad7b('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 93ea10e..292db25 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 _0x3733=['sendStatus','json','offset','undefined','limit','count','status','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','index','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','order','sort','where','pick','filter','VIRTUAL','merge','SmsQueueReport','includeAll','include','findAll','rows','catch','show','rawAttributes','create','body','find','params','describe','eml-format','moment','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0xa6cc5c,_0x239c99){var _0x44803d=function(_0x515b6e){while(--_0x515b6e){_0xa6cc5c['push'](_0xa6cc5c['shift']());}};_0x44803d(++_0x239c99);}(_0x3733,0xc2));var _0x3373=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3733[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x3373('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3373('0x1'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3373('0x2'));var path=require(_0x3373('0x3'));var sox=require(_0x3373('0x4'));var csv=require('to-csv');var ejs=require(_0x3373('0x5'));var fs=require('fs');var fs_extra=require(_0x3373('0x6'));var _=require(_0x3373('0x7'));var squel=require(_0x3373('0x8'));var crypto=require('crypto');var jsforce=require(_0x3373('0x9'));var deskjs=require(_0x3373('0xa'));var toCsv=require('to-csv');var querystring=require(_0x3373('0xb'));var Papa=require(_0x3373('0xc'));var Redis=require(_0x3373('0xd'));var authService=require(_0x3373('0xe'));var qs=require(_0x3373('0xf'));var as=require(_0x3373('0x10'));var hardwareService=require(_0x3373('0x11'));var logger=require(_0x3373('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x3373('0x13'));var licenseUtil=require(_0x3373('0x14'));var db=require(_0x3373('0x15'))['db'];function respondWithStatusCode(_0x1327d3,_0x2bc629){_0x2bc629=_0x2bc629||0xcc;return function(_0xcdd652){if(_0xcdd652){return _0x1327d3[_0x3373('0x16')](_0x2bc629);}return _0x1327d3['status'](_0x2bc629)['end']();};}function respondWithResult(_0x2edc4f,_0xe5e6cf){_0xe5e6cf=_0xe5e6cf||0xc8;return function(_0x201705){if(_0x201705){return _0x2edc4f['status'](_0xe5e6cf)[_0x3373('0x17')](_0x201705);}};}function respondWithFilteredResult(_0x2de965,_0x3c117c){return function(_0x4b229f){if(_0x4b229f){var _0x47c6dc=typeof _0x3c117c[_0x3373('0x18')]===_0x3373('0x19')&&typeof _0x3c117c[_0x3373('0x1a')]===_0x3373('0x19');var _0x210672=_0x4b229f[_0x3373('0x1b')];var _0x37fcd1=_0x47c6dc?0x0:_0x3c117c['offset'];var _0x8b986a=_0x47c6dc?_0x4b229f['count']:_0x3c117c[_0x3373('0x18')]+_0x3c117c[_0x3373('0x1a')];var _0x1ca93d;if(_0x8b986a>=_0x210672){_0x8b986a=_0x210672;_0x1ca93d=0xc8;}else{_0x1ca93d=0xce;}_0x2de965[_0x3373('0x1c')](_0x1ca93d);return _0x2de965['set'](_0x3373('0x1d'),_0x37fcd1+'-'+_0x8b986a+'/'+_0x210672)[_0x3373('0x17')](_0x4b229f);}return null;};}function patchUpdates(_0x4db385){return function(_0x3bc1eb){try{jsonpatch[_0x3373('0x1e')](_0x3bc1eb,_0x4db385,!![]);}catch(_0x57e382){return BPromise[_0x3373('0x1f')](_0x57e382);}return _0x3bc1eb[_0x3373('0x20')]();};}function saveUpdates(_0x5ccabe,_0x4f964c){return function(_0x328e9c){if(_0x328e9c){return _0x328e9c[_0x3373('0x21')](_0x5ccabe)[_0x3373('0x22')](function(_0x5e03b2){return _0x5e03b2;});}return null;};}function removeEntity(_0x7fae72,_0x459116){return function(_0x13cc2d){if(_0x13cc2d){return _0x13cc2d[_0x3373('0x23')]()[_0x3373('0x22')](function(){_0x7fae72[_0x3373('0x1c')](0xcc)[_0x3373('0x24')]();});}};}function handleEntityNotFound(_0x283e21,_0x267670){return function(_0x20dd91){if(!_0x20dd91){_0x283e21[_0x3373('0x16')](0x194);}return _0x20dd91;};}function handleError(_0x24aa4b,_0x31d540){_0x31d540=_0x31d540||0x1f4;return function(_0x543da9){logger[_0x3373('0x25')](_0x543da9['stack']);if(_0x543da9[_0x3373('0x26')]){delete _0x543da9[_0x3373('0x26')];}_0x24aa4b[_0x3373('0x1c')](_0x31d540)[_0x3373('0x27')](_0x543da9);};}exports[_0x3373('0x28')]=function(_0x341705,_0x3bafc){var _0xa21866={},_0x54b4e5={},_0x14aab7={'count':0x0,'rows':[]};var _0x51ef7e=_['map'](db['SmsQueueReport']['rawAttributes'],function(_0x5c1774){return{'name':_0x5c1774[_0x3373('0x29')],'type':_0x5c1774[_0x3373('0x2a')][_0x3373('0x2b')]};});_0x54b4e5[_0x3373('0x2c')]=_['map'](_0x51ef7e,_0x3373('0x26'));_0x54b4e5[_0x3373('0x2d')]=_[_0x3373('0x2e')](_0x341705['query']);_0x54b4e5[_0x3373('0x2f')]=_['intersection'](_0x54b4e5[_0x3373('0x2c')],_0x54b4e5[_0x3373('0x2d')]);_0xa21866[_0x3373('0x30')]=_[_0x3373('0x31')](_0x54b4e5[_0x3373('0x2c')],qs[_0x3373('0x32')](_0x341705['query'][_0x3373('0x32')]));_0xa21866[_0x3373('0x30')]=_0xa21866[_0x3373('0x30')][_0x3373('0x33')]?_0xa21866['attributes']:_0x54b4e5[_0x3373('0x2c')];if(!_0x341705[_0x3373('0x2d')]['hasOwnProperty']('nolimit')){_0xa21866[_0x3373('0x1a')]=qs[_0x3373('0x1a')](_0x341705['query'][_0x3373('0x1a')]);_0xa21866['offset']=qs[_0x3373('0x18')](_0x341705[_0x3373('0x2d')][_0x3373('0x18')]);}_0xa21866[_0x3373('0x34')]=qs[_0x3373('0x35')](_0x341705[_0x3373('0x2d')]['sort']);_0xa21866[_0x3373('0x36')]=qs[_0x3373('0x2f')](_[_0x3373('0x37')](_0x341705[_0x3373('0x2d')],_0x54b4e5[_0x3373('0x2f')]),_0x51ef7e);if(_0x341705[_0x3373('0x2d')][_0x3373('0x38')]){_0xa21866[_0x3373('0x36')]=_['merge'](_0xa21866[_0x3373('0x36')],{'$or':_['map'](_0x51ef7e,function(_0x5d3952){if(_0x5d3952[_0x3373('0x2a')]!==_0x3373('0x39')){var _0x4c6b86={};_0x4c6b86[_0x5d3952[_0x3373('0x26')]]={'$like':'%'+_0x341705[_0x3373('0x2d')][_0x3373('0x38')]+'%'};return _0x4c6b86;}})});}_0xa21866=_[_0x3373('0x3a')]({},_0xa21866,_0x341705['options']);var _0x54782b={'where':_0xa21866[_0x3373('0x36')]};return db[_0x3373('0x3b')][_0x3373('0x1b')](_0x54782b)[_0x3373('0x22')](function(_0x178ea2){_0x14aab7['count']=_0x178ea2;if(_0x341705[_0x3373('0x2d')][_0x3373('0x3c')]){_0xa21866[_0x3373('0x3d')]=[{'all':!![]}];}return db[_0x3373('0x3b')][_0x3373('0x3e')](_0xa21866);})[_0x3373('0x22')](function(_0x24ef48){_0x14aab7[_0x3373('0x3f')]=_0x24ef48;return _0x14aab7;})[_0x3373('0x22')](respondWithFilteredResult(_0x3bafc,_0xa21866))[_0x3373('0x40')](handleError(_0x3bafc,null));};exports[_0x3373('0x41')]=function(_0x43020c,_0x35a833){var _0x596c77={'raw':!![],'where':{'id':_0x43020c['params']['id']}},_0x252a5d={};_0x252a5d[_0x3373('0x2c')]=_[_0x3373('0x2e')](db[_0x3373('0x3b')][_0x3373('0x42')]);_0x252a5d[_0x3373('0x2d')]=_[_0x3373('0x2e')](_0x43020c[_0x3373('0x2d')]);_0x252a5d['filters']=_[_0x3373('0x31')](_0x252a5d[_0x3373('0x2c')],_0x252a5d[_0x3373('0x2d')]);_0x596c77[_0x3373('0x30')]=_['intersection'](_0x252a5d[_0x3373('0x2c')],qs[_0x3373('0x32')](_0x43020c[_0x3373('0x2d')][_0x3373('0x32')]));_0x596c77['attributes']=_0x596c77[_0x3373('0x30')][_0x3373('0x33')]?_0x596c77[_0x3373('0x30')]:_0x252a5d[_0x3373('0x2c')];if(_0x43020c['query']['includeAll']){_0x596c77[_0x3373('0x3d')]=[{'all':!![]}];}_0x596c77=_[_0x3373('0x3a')]({},_0x596c77,_0x43020c['options']);return db[_0x3373('0x3b')]['find'](_0x596c77)[_0x3373('0x22')](handleEntityNotFound(_0x35a833,null))[_0x3373('0x22')](respondWithResult(_0x35a833,null))[_0x3373('0x40')](handleError(_0x35a833,null));};exports[_0x3373('0x43')]=function(_0x5c3af9,_0x1cf396){return db[_0x3373('0x3b')][_0x3373('0x43')](_0x5c3af9[_0x3373('0x44')],{})[_0x3373('0x22')](respondWithResult(_0x1cf396,0xc9))[_0x3373('0x40')](handleError(_0x1cf396,null));};exports[_0x3373('0x21')]=function(_0x10c577,_0x3a3988){if(_0x10c577[_0x3373('0x44')]['id']){delete _0x10c577[_0x3373('0x44')]['id'];}return db[_0x3373('0x3b')][_0x3373('0x45')]({'where':{'id':_0x10c577[_0x3373('0x46')]['id']}})['then'](handleEntityNotFound(_0x3a3988,null))[_0x3373('0x22')](saveUpdates(_0x10c577[_0x3373('0x44')],null))[_0x3373('0x22')](respondWithResult(_0x3a3988,null))[_0x3373('0x40')](handleError(_0x3a3988,null));};exports[_0x3373('0x23')]=function(_0x591b97,_0x5efebc){return db[_0x3373('0x3b')][_0x3373('0x45')]({'where':{'id':_0x591b97[_0x3373('0x46')]['id']}})[_0x3373('0x22')](handleEntityNotFound(_0x5efebc,null))[_0x3373('0x22')](removeEntity(_0x5efebc,null))[_0x3373('0x40')](handleError(_0x5efebc,null));};exports[_0x3373('0x47')]=function(_0x29341c,_0x4687f5){return db['SmsQueueReport'][_0x3373('0x47')]()['then'](respondWithResult(_0x4687f5,null))[_0x3373('0x40')](handleError(_0x4687f5,null));}; \ No newline at end of file +var _0xf7e3=['jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','limit','undefined','offset','count','set','Content-Range','reject','save','update','then','destroy','sendStatus','error','stack','send','map','SmsQueueReport','rawAttributes','fieldName','type','key','model','name','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','VIRTUAL','options','includeAll','include','findAll','show','params','keys','merge','catch','create','body','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x4a6979,_0x5f3d1a){var _0x226f93=function(_0x471572){while(--_0x471572){_0x4a6979['push'](_0x4a6979['shift']());}};_0x226f93(++_0x5f3d1a);}(_0xf7e3,0xdf));var _0x3f7e=function(_0x327fde,_0x5536f3){_0x327fde=_0x327fde-0x0;var _0x2cd41e=_0xf7e3[_0x327fde];return _0x2cd41e;};'use strict';var emlformat=require(_0x3f7e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3f7e('0x1'));var jsonpatch=require(_0x3f7e('0x2'));var rp=require(_0x3f7e('0x3'));var moment=require(_0x3f7e('0x4'));var BPromise=require(_0x3f7e('0x5'));var Mustache=require(_0x3f7e('0x6'));var util=require('util');var path=require(_0x3f7e('0x7'));var sox=require(_0x3f7e('0x8'));var csv=require(_0x3f7e('0x9'));var ejs=require(_0x3f7e('0xa'));var fs=require('fs');var fs_extra=require(_0x3f7e('0xb'));var _=require(_0x3f7e('0xc'));var squel=require(_0x3f7e('0xd'));var crypto=require('crypto');var jsforce=require(_0x3f7e('0xe'));var deskjs=require(_0x3f7e('0xf'));var toCsv=require(_0x3f7e('0x9'));var querystring=require(_0x3f7e('0x10'));var Papa=require(_0x3f7e('0x11'));var Redis=require(_0x3f7e('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x3f7e('0x13'));var as=require(_0x3f7e('0x14'));var hardwareService=require(_0x3f7e('0x15'));var logger=require(_0x3f7e('0x16'))(_0x3f7e('0x17'));var utils=require(_0x3f7e('0x18'));var config=require(_0x3f7e('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x3f7e('0x1a'))['db'];function respondWithStatusCode(_0x51ae98,_0x5c4815){_0x5c4815=_0x5c4815||0xcc;return function(_0x282122){if(_0x282122){return _0x51ae98['sendStatus'](_0x5c4815);}return _0x51ae98[_0x3f7e('0x1b')](_0x5c4815)[_0x3f7e('0x1c')]();};}function respondWithResult(_0x506aed,_0x1707e7){_0x1707e7=_0x1707e7||0xc8;return function(_0x14921b){if(_0x14921b){return _0x506aed[_0x3f7e('0x1b')](_0x1707e7)[_0x3f7e('0x1d')](_0x14921b);}};}function respondWithFilteredResult(_0x1bdf09,_0xbe408e){return function(_0x3ff15d){if(_0x3ff15d){var _0x4d2d75=typeof _0xbe408e['offset']==='undefined'&&typeof _0xbe408e[_0x3f7e('0x1e')]===_0x3f7e('0x1f');var _0x106795=_0x3ff15d['count'];var _0x39845b=_0x4d2d75?0x0:_0xbe408e[_0x3f7e('0x20')];var _0x4cb51c=_0x4d2d75?_0x3ff15d[_0x3f7e('0x21')]:_0xbe408e[_0x3f7e('0x20')]+_0xbe408e['limit'];var _0x372403;if(_0x4cb51c>=_0x106795){_0x4cb51c=_0x106795;_0x372403=0xc8;}else{_0x372403=0xce;}_0x1bdf09[_0x3f7e('0x1b')](_0x372403);return _0x1bdf09[_0x3f7e('0x22')](_0x3f7e('0x23'),_0x39845b+'-'+_0x4cb51c+'/'+_0x106795)[_0x3f7e('0x1d')](_0x3ff15d);}return null;};}function patchUpdates(_0x2784f1){return function(_0x40ac2c){try{jsonpatch['apply'](_0x40ac2c,_0x2784f1,!![]);}catch(_0xcb9cbf){return BPromise[_0x3f7e('0x24')](_0xcb9cbf);}return _0x40ac2c[_0x3f7e('0x25')]();};}function saveUpdates(_0x20b5dd,_0x1ee44a){return function(_0x4e1c48){if(_0x4e1c48){return _0x4e1c48[_0x3f7e('0x26')](_0x20b5dd)[_0x3f7e('0x27')](function(_0x1b82b7){return _0x1b82b7;});}return null;};}function removeEntity(_0x2b965d,_0x445f74){return function(_0x414453){if(_0x414453){return _0x414453[_0x3f7e('0x28')]()[_0x3f7e('0x27')](function(){_0x2b965d[_0x3f7e('0x1b')](0xcc)[_0x3f7e('0x1c')]();});}};}function handleEntityNotFound(_0x3e937c,_0x5edace){return function(_0x1e0f92){if(!_0x1e0f92){_0x3e937c[_0x3f7e('0x29')](0x194);}return _0x1e0f92;};}function handleError(_0x4a15e2,_0x2f0fc2){_0x2f0fc2=_0x2f0fc2||0x1f4;return function(_0xec40ee){logger[_0x3f7e('0x2a')](_0xec40ee[_0x3f7e('0x2b')]);if(_0xec40ee['name']){delete _0xec40ee['name'];}_0x4a15e2[_0x3f7e('0x1b')](_0x2f0fc2)[_0x3f7e('0x2c')](_0xec40ee);};}exports['index']=function(_0x922fed,_0x2dff10){var _0x9ede9={},_0x25cc7a={},_0x50e445={'count':0x0,'rows':[]};var _0x136af0=_[_0x3f7e('0x2d')](db[_0x3f7e('0x2e')][_0x3f7e('0x2f')],function(_0x1ce6df){return{'name':_0x1ce6df[_0x3f7e('0x30')],'type':_0x1ce6df[_0x3f7e('0x31')][_0x3f7e('0x32')]};});_0x25cc7a[_0x3f7e('0x33')]=_['map'](_0x136af0,_0x3f7e('0x34'));_0x25cc7a[_0x3f7e('0x35')]=_['keys'](_0x922fed[_0x3f7e('0x35')]);_0x25cc7a['filters']=_[_0x3f7e('0x36')](_0x25cc7a[_0x3f7e('0x33')],_0x25cc7a[_0x3f7e('0x35')]);_0x9ede9[_0x3f7e('0x37')]=_['intersection'](_0x25cc7a[_0x3f7e('0x33')],qs[_0x3f7e('0x38')](_0x922fed[_0x3f7e('0x35')][_0x3f7e('0x38')]));_0x9ede9[_0x3f7e('0x37')]=_0x9ede9[_0x3f7e('0x37')][_0x3f7e('0x39')]?_0x9ede9[_0x3f7e('0x37')]:_0x25cc7a[_0x3f7e('0x33')];if(!_0x922fed[_0x3f7e('0x35')][_0x3f7e('0x3a')]('nolimit')){_0x9ede9[_0x3f7e('0x1e')]=qs[_0x3f7e('0x1e')](_0x922fed['query']['limit']);_0x9ede9[_0x3f7e('0x20')]=qs['offset'](_0x922fed['query']['offset']);}_0x9ede9[_0x3f7e('0x3b')]=qs[_0x3f7e('0x3c')](_0x922fed['query'][_0x3f7e('0x3c')]);_0x9ede9[_0x3f7e('0x3d')]=qs[_0x3f7e('0x3e')](_[_0x3f7e('0x3f')](_0x922fed[_0x3f7e('0x35')],_0x25cc7a['filters']),_0x136af0);if(_0x922fed[_0x3f7e('0x35')][_0x3f7e('0x40')]){_0x9ede9[_0x3f7e('0x3d')]=_['merge'](_0x9ede9[_0x3f7e('0x3d')],{'$or':_[_0x3f7e('0x2d')](_0x136af0,function(_0x3d784a){if(_0x3d784a[_0x3f7e('0x31')]!==_0x3f7e('0x41')){var _0x2042b7={};_0x2042b7[_0x3d784a[_0x3f7e('0x34')]]={'$like':'%'+_0x922fed[_0x3f7e('0x35')]['filter']+'%'};return _0x2042b7;}})});}_0x9ede9=_['merge']({},_0x9ede9,_0x922fed[_0x3f7e('0x42')]);var _0x2fb078={'where':_0x9ede9[_0x3f7e('0x3d')]};return db['SmsQueueReport'][_0x3f7e('0x21')](_0x2fb078)[_0x3f7e('0x27')](function(_0x399022){_0x50e445[_0x3f7e('0x21')]=_0x399022;if(_0x922fed['query'][_0x3f7e('0x43')]){_0x9ede9[_0x3f7e('0x44')]=[{'all':!![]}];}return db[_0x3f7e('0x2e')][_0x3f7e('0x45')](_0x9ede9);})[_0x3f7e('0x27')](function(_0x4e53f1){_0x50e445['rows']=_0x4e53f1;return _0x50e445;})[_0x3f7e('0x27')](respondWithFilteredResult(_0x2dff10,_0x9ede9))['catch'](handleError(_0x2dff10,null));};exports[_0x3f7e('0x46')]=function(_0x107d53,_0x44b640){var _0x43c9b5={'raw':!![],'where':{'id':_0x107d53[_0x3f7e('0x47')]['id']}},_0x75d7a5={};_0x75d7a5[_0x3f7e('0x33')]=_[_0x3f7e('0x48')](db['SmsQueueReport'][_0x3f7e('0x2f')]);_0x75d7a5[_0x3f7e('0x35')]=_[_0x3f7e('0x48')](_0x107d53['query']);_0x75d7a5[_0x3f7e('0x3e')]=_[_0x3f7e('0x36')](_0x75d7a5[_0x3f7e('0x33')],_0x75d7a5[_0x3f7e('0x35')]);_0x43c9b5[_0x3f7e('0x37')]=_[_0x3f7e('0x36')](_0x75d7a5[_0x3f7e('0x33')],qs[_0x3f7e('0x38')](_0x107d53[_0x3f7e('0x35')][_0x3f7e('0x38')]));_0x43c9b5[_0x3f7e('0x37')]=_0x43c9b5[_0x3f7e('0x37')]['length']?_0x43c9b5['attributes']:_0x75d7a5[_0x3f7e('0x33')];if(_0x107d53[_0x3f7e('0x35')][_0x3f7e('0x43')]){_0x43c9b5['include']=[{'all':!![]}];}_0x43c9b5=_[_0x3f7e('0x49')]({},_0x43c9b5,_0x107d53[_0x3f7e('0x42')]);return db[_0x3f7e('0x2e')]['find'](_0x43c9b5)[_0x3f7e('0x27')](handleEntityNotFound(_0x44b640,null))[_0x3f7e('0x27')](respondWithResult(_0x44b640,null))[_0x3f7e('0x4a')](handleError(_0x44b640,null));};exports['create']=function(_0x3e5290,_0x5c86a2){return db[_0x3f7e('0x2e')][_0x3f7e('0x4b')](_0x3e5290[_0x3f7e('0x4c')],{})[_0x3f7e('0x27')](respondWithResult(_0x5c86a2,0xc9))[_0x3f7e('0x4a')](handleError(_0x5c86a2,null));};exports[_0x3f7e('0x26')]=function(_0x5683ab,_0x3bc02b){if(_0x5683ab['body']['id']){delete _0x5683ab[_0x3f7e('0x4c')]['id'];}return db[_0x3f7e('0x2e')]['find']({'where':{'id':_0x5683ab['params']['id']}})[_0x3f7e('0x27')](handleEntityNotFound(_0x3bc02b,null))['then'](saveUpdates(_0x5683ab[_0x3f7e('0x4c')],null))[_0x3f7e('0x27')](respondWithResult(_0x3bc02b,null))[_0x3f7e('0x4a')](handleError(_0x3bc02b,null));};exports['destroy']=function(_0x244913,_0x472049){return db['SmsQueueReport'][_0x3f7e('0x4d')]({'where':{'id':_0x244913[_0x3f7e('0x47')]['id']}})['then'](handleEntityNotFound(_0x472049,null))[_0x3f7e('0x27')](removeEntity(_0x472049,null))[_0x3f7e('0x4a')](handleError(_0x472049,null));};exports[_0x3f7e('0x4e')]=function(_0x414019,_0x529c13){return db[_0x3f7e('0x2e')][_0x3f7e('0x4e')]()['then'](respondWithResult(_0x529c13,null))['catch'](handleError(_0x529c13,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 5531f44..5d30fd0 100644 --- a/server/api/smsQueueReport/smsQueueReport.model.js +++ b/server/api/smsQueueReport/smsQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','define','SmsQueueReport','uniqueid','lodash'];(function(_0x52193c,_0x16ab99){var _0x293ef1=function(_0x37af70){while(--_0x37af70){_0x52193c['push'](_0x52193c['shift']());}};_0x293ef1(++_0x16ab99);}(_0xb7e7,0x121));var _0x7b7e=function(_0x46d0c9,_0x526bfa){_0x46d0c9=_0x46d0c9-0x0;var _0x174506=_0xb7e7[_0x46d0c9];return _0x174506;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));module['exports']=function(_0x53ed64,_0x333fa4){return _0x53ed64[_0x7b7e('0x7')](_0x7b7e('0x8'),attributes,{'tableName':'report_sms_queue','paranoid':![],'indexes':[{'name':_0x7b7e('0x9'),'fields':[_0x7b7e('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['define','SmsQueueReport','uniqueid','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./smsQueueReport.attributes','exports'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xa9e0[_0x31e29a];return _0x32d892;};'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 7b9c485..a0d53cb 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 _0x801c=['limit','UpdateSmsQueueReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SmsQueueReport,\x20%s,\x20%s','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','CreateSmsQueueReport','SmsQueueReport','body','options','raw','stringify','attributes'];(function(_0xaef3f,_0x1f3c49){var _0x5383c6=function(_0x15bbc8){while(--_0x15bbc8){_0xaef3f['push'](_0xaef3f['shift']());}};_0x5383c6(++_0x1f3c49);}(_0x801c,0x183));var _0xc801=function(_0x116125,_0x5188e0){_0x116125=_0x116125-0x0;var _0x5d6669=_0x801c[_0x116125];return _0x5d6669;};'use strict';var _=require(_0xc801('0x0'));var util=require(_0xc801('0x1'));var moment=require(_0xc801('0x2'));var BPromise=require(_0xc801('0x3'));var rs=require(_0xc801('0x4'));var fs=require('fs');var Redis=require(_0xc801('0x5'));var db=require(_0xc801('0x6'))['db'];var utils=require(_0xc801('0x7'));var logger=require(_0xc801('0x8'))(_0xc801('0x9'));var config=require(_0xc801('0xa'));var jayson=require(_0xc801('0xb'));var client=jayson[_0xc801('0xc')][_0xc801('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x5b30b7,_0x392279,_0x6eb740){return new BPromise(function(_0x19994b,_0x28d29e){return client[_0xc801('0xe')](_0x5b30b7,_0x6eb740)[_0xc801('0xf')](function(_0x2faa0b){logger[_0xc801('0x10')](_0xc801('0x11'),_0x392279,'request\x20sent');logger[_0xc801('0x12')](_0xc801('0x13'),_0x392279,_0xc801('0x14'),JSON['stringify'](_0x2faa0b));if(_0x2faa0b[_0xc801('0x15')]){if(_0x2faa0b[_0xc801('0x15')][_0xc801('0x16')]===0x1f4){logger['error'](_0xc801('0x11'),_0x392279,_0x2faa0b[_0xc801('0x15')][_0xc801('0x17')]);return _0x28d29e(_0x2faa0b[_0xc801('0x15')][_0xc801('0x17')]);}logger[_0xc801('0x15')](_0xc801('0x11'),_0x392279,_0x2faa0b[_0xc801('0x15')][_0xc801('0x17')]);return _0x19994b(_0x2faa0b[_0xc801('0x15')][_0xc801('0x17')]);}else{logger[_0xc801('0x10')](_0xc801('0x11'),_0x392279,'request\x20sent');_0x19994b(_0x2faa0b[_0xc801('0x18')][_0xc801('0x17')]);}})[_0xc801('0x19')](function(_0x1803ec){logger[_0xc801('0x15')]('SmsQueueReport,\x20%s,\x20%s',_0x392279,_0x1803ec);_0x28d29e(_0x1803ec);});});}exports[_0xc801('0x1a')]=function(_0x4934a7){var _0x157034=this;return new Promise(function(_0xd5249b,_0x1b44fe){return db[_0xc801('0x1b')]['create'](_0x4934a7[_0xc801('0x1c')],{'raw':_0x4934a7[_0xc801('0x1d')]?_0x4934a7[_0xc801('0x1d')][_0xc801('0x1e')]===undefined?!![]:![]:!![]})[_0xc801('0xf')](function(_0x5aac0e){logger[_0xc801('0x10')](_0xc801('0x1a'),_0x4934a7);logger['debug'](_0xc801('0x1a'),_0x4934a7,JSON[_0xc801('0x1f')](_0x5aac0e));_0xd5249b(_0x5aac0e);})['catch'](function(_0x52363d){logger['error'](_0xc801('0x1a'),_0x52363d[_0xc801('0x17')],_0x4934a7);_0x1b44fe(_0x157034[_0xc801('0x15')](0x1f4,_0x52363d[_0xc801('0x17')]));});});};exports['UpdateSmsQueueReport']=function(_0x5c17e0){var _0x2f62ea=this;return new Promise(function(_0x2efa1a,_0x4ed7aa){return db[_0xc801('0x1b')]['update'](_0x5c17e0[_0xc801('0x1c')],{'raw':_0x5c17e0[_0xc801('0x1d')]?_0x5c17e0[_0xc801('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5c17e0[_0xc801('0x1d')]?_0x5c17e0[_0xc801('0x1d')]['where']||null:null,'attributes':_0x5c17e0[_0xc801('0x1d')]?_0x5c17e0[_0xc801('0x1d')][_0xc801('0x20')]||null:null,'limit':_0x5c17e0[_0xc801('0x1d')]?_0x5c17e0[_0xc801('0x1d')][_0xc801('0x21')]||null:null})[_0xc801('0xf')](function(_0x2debc0){logger[_0xc801('0x10')](_0xc801('0x22'),_0x5c17e0);logger[_0xc801('0x12')](_0xc801('0x22'),_0x5c17e0,JSON[_0xc801('0x1f')](_0x2debc0));_0x2efa1a(_0x2debc0);})[_0xc801('0x19')](function(_0x1140c3){logger[_0xc801('0x15')](_0xc801('0x22'),_0x1140c3['message'],_0x5c17e0);_0x4ed7aa(_0x2f62ea[_0xc801('0x15')](0x1f4,_0x1140c3['message']));});});}; \ No newline at end of file +var _0xc40e=['limit','UpdateSmsQueueReport','lodash','util','bluebird','randomstring','../../config/utils','jayson/promise','client','http','request','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','SmsQueueReport','create','options','raw','CreateSmsQueueReport','catch','update','body','where','attributes'];(function(_0x57cc22,_0x2d351f){var _0x6f7bdc=function(_0x4935b5){while(--_0x4935b5){_0x57cc22['push'](_0x57cc22['shift']());}};_0x6f7bdc(++_0x2d351f);}(_0xc40e,0xdb));var _0xec40=function(_0x3428e2,_0x262c7c){_0x3428e2=_0x3428e2-0x0;var _0x3b2c8a=_0xc40e[_0x3428e2];return _0x3b2c8a;};'use strict';var _=require(_0xec40('0x0'));var util=require(_0xec40('0x1'));var moment=require('moment');var BPromise=require(_0xec40('0x2'));var rs=require(_0xec40('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xec40('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xec40('0x5'));var client=jayson[_0xec40('0x6')][_0xec40('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x774e90,_0x39f78e,_0xc49cf4){return new BPromise(function(_0x40a2cb,_0x3fa5ca){return client[_0xec40('0x8')](_0x774e90,_0xc49cf4)[_0xec40('0x9')](function(_0x589b5b){logger[_0xec40('0xa')](_0xec40('0xb'),_0x39f78e,_0xec40('0xc'));logger[_0xec40('0xd')]('SmsQueueReport,\x20%s,\x20%s,\x20%s',_0x39f78e,'request\x20sent',JSON[_0xec40('0xe')](_0x589b5b));if(_0x589b5b[_0xec40('0xf')]){if(_0x589b5b[_0xec40('0xf')][_0xec40('0x10')]===0x1f4){logger[_0xec40('0xf')]('SmsQueueReport,\x20%s,\x20%s',_0x39f78e,_0x589b5b[_0xec40('0xf')][_0xec40('0x11')]);return _0x3fa5ca(_0x589b5b[_0xec40('0xf')][_0xec40('0x11')]);}logger['error']('SmsQueueReport,\x20%s,\x20%s',_0x39f78e,_0x589b5b[_0xec40('0xf')][_0xec40('0x11')]);return _0x40a2cb(_0x589b5b['error'][_0xec40('0x11')]);}else{logger[_0xec40('0xa')](_0xec40('0xb'),_0x39f78e,_0xec40('0xc'));_0x40a2cb(_0x589b5b[_0xec40('0x12')][_0xec40('0x11')]);}})['catch'](function(_0x24751f){logger[_0xec40('0xf')](_0xec40('0xb'),_0x39f78e,_0x24751f);_0x3fa5ca(_0x24751f);});});}exports['CreateSmsQueueReport']=function(_0x3f5496){var _0x4397ee=this;return new Promise(function(_0xf259a2,_0x55fa31){return db[_0xec40('0x13')][_0xec40('0x14')](_0x3f5496['body'],{'raw':_0x3f5496[_0xec40('0x15')]?_0x3f5496['options'][_0xec40('0x16')]===undefined?!![]:![]:!![]})[_0xec40('0x9')](function(_0x20870d){logger[_0xec40('0xa')](_0xec40('0x17'),_0x3f5496);logger[_0xec40('0xd')](_0xec40('0x17'),_0x3f5496,JSON[_0xec40('0xe')](_0x20870d));_0xf259a2(_0x20870d);})[_0xec40('0x18')](function(_0x6a6424){logger[_0xec40('0xf')](_0xec40('0x17'),_0x6a6424['message'],_0x3f5496);_0x55fa31(_0x4397ee[_0xec40('0xf')](0x1f4,_0x6a6424['message']));});});};exports['UpdateSmsQueueReport']=function(_0x57db5c){var _0x22cdc2=this;return new Promise(function(_0x54dfa7,_0x1ef0ee){return db[_0xec40('0x13')][_0xec40('0x19')](_0x57db5c[_0xec40('0x1a')],{'raw':_0x57db5c[_0xec40('0x15')]?_0x57db5c['options'][_0xec40('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x57db5c['options']?_0x57db5c[_0xec40('0x15')][_0xec40('0x1b')]||null:null,'attributes':_0x57db5c['options']?_0x57db5c[_0xec40('0x15')][_0xec40('0x1c')]||null:null,'limit':_0x57db5c['options']?_0x57db5c[_0xec40('0x15')][_0xec40('0x1d')]||null:null})[_0xec40('0x9')](function(_0xeba3fb){logger['info'](_0xec40('0x1e'),_0x57db5c);logger[_0xec40('0xd')](_0xec40('0x1e'),_0x57db5c,JSON[_0xec40('0xe')](_0xeba3fb));_0x54dfa7(_0xeba3fb);})[_0xec40('0x18')](function(_0x14c637){logger[_0xec40('0xf')](_0xec40('0x1e'),_0x14c637['message'],_0x57db5c);_0x1ef0ee(_0x22cdc2[_0xec40('0xf')](0x1f4,_0x14c637['message']));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index ec818e3..f439d80 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 _0x2494=['express','Router','fs-extra','../../components/auth/service','./smsTransferReport.controller','isAuthenticated','index','get','describe','show','post','create','put','/:id','destroy','exports','multer','path','connect-timeout'];(function(_0x5a0652,_0x44ae9b){var _0x4be025=function(_0x4ee020){while(--_0x4ee020){_0x5a0652['push'](_0x5a0652['shift']());}};_0x4be025(++_0x44ae9b);}(_0x2494,0x82));var _0x4249=function(_0x4af580,_0x4298c9){_0x4af580=_0x4af580-0x0;var _0x157c65=_0x2494[_0x4af580];return _0x157c65;};'use strict';var multer=require(_0x4249('0x0'));var util=require('util');var path=require(_0x4249('0x1'));var timeout=require(_0x4249('0x2'));var express=require(_0x4249('0x3'));var router=express[_0x4249('0x4')]();var fs_extra=require(_0x4249('0x5'));var auth=require(_0x4249('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4249('0x7'));router['get']('/',auth[_0x4249('0x8')](),controller[_0x4249('0x9')]);router[_0x4249('0xa')]('/describe',auth[_0x4249('0x8')](),controller[_0x4249('0xb')]);router[_0x4249('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x4249('0xc')]);router[_0x4249('0xd')]('/',auth[_0x4249('0x8')](),controller[_0x4249('0xe')]);router[_0x4249('0xf')](_0x4249('0x10'),auth[_0x4249('0x8')](),controller['update']);router['delete'](_0x4249('0x10'),auth['isAuthenticated'](),controller[_0x4249('0x11')]);module[_0x4249('0x12')]=router; \ No newline at end of file +var _0x4ab0=['express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','/:id','show','create','put','update','delete','destroy','exports','util','path','connect-timeout'];(function(_0x35b3ca,_0x37b8ac){var _0x1eec14=function(_0x228f50){while(--_0x228f50){_0x35b3ca['push'](_0x35b3ca['shift']());}};_0x1eec14(++_0x37b8ac);}(_0x4ab0,0xd5));var _0x04ab=function(_0x19769a,_0x5c0121){_0x19769a=_0x19769a-0x0;var _0x41dc2d=_0x4ab0[_0x19769a];return _0x41dc2d;};'use strict';var multer=require('multer');var util=require(_0x04ab('0x0'));var path=require(_0x04ab('0x1'));var timeout=require(_0x04ab('0x2'));var express=require(_0x04ab('0x3'));var router=express[_0x04ab('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x04ab('0x5'));var config=require(_0x04ab('0x6'));var controller=require('./smsTransferReport.controller');router[_0x04ab('0x7')]('/',auth[_0x04ab('0x8')](),controller['index']);router[_0x04ab('0x7')](_0x04ab('0x9'),auth[_0x04ab('0x8')](),controller['describe']);router[_0x04ab('0x7')](_0x04ab('0xa'),auth[_0x04ab('0x8')](),controller[_0x04ab('0xb')]);router['post']('/',auth[_0x04ab('0x8')](),controller[_0x04ab('0xc')]);router[_0x04ab('0xd')](_0x04ab('0xa'),auth['isAuthenticated'](),controller[_0x04ab('0xe')]);router[_0x04ab('0xf')](_0x04ab('0xa'),auth[_0x04ab('0x8')](),controller[_0x04ab('0x10')]);module[_0x04ab('0x11')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index 4885a7c..8e6dac5 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 _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x3242d1,_0x3024fd){var _0x193264=function(_0x279f67){while(--_0x279f67){_0x3242d1['push'](_0x3242d1['shift']());}};_0x193264(++_0x3024fd);}(_0x70e0,0x17b));var _0x070e=function(_0x2d09ab,_0x5454aa){_0x2d09ab=_0x2d09ab-0x0;var _0x301c6e=_0x70e0[_0x2d09ab];return _0x301c6e;};'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 _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x4835ca,_0x391238){var _0x131b60=function(_0x579360){while(--_0x579360){_0x4835ca['push'](_0x4835ca['shift']());}};_0x131b60(++_0x391238);}(_0x008c,0x188));var _0xc008=function(_0x4b4865,_0xb43449){_0x4b4865=_0x4b4865-0x0;var _0x190dc2=_0x008c[_0x4b4865];return _0x190dc2;};'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 7529e4e..5fc6519 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 _0xdbb9=['map','SmsTransferReport','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','options','includeAll','include','findAll','rows','catch','show','rawAttributes','find','create','body','update','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','save','then','destroy','stack','name','index'];(function(_0xd6371d,_0xada508){var _0x101bb4=function(_0xd66131){while(--_0xd66131){_0xd6371d['push'](_0xd6371d['shift']());}};_0x101bb4(++_0xada508);}(_0xdbb9,0xf9));var _0x9dbb=function(_0x42b7be,_0x3e7961){_0x42b7be=_0x42b7be-0x0;var _0x4d6c7b=_0xdbb9[_0x42b7be];return _0x4d6c7b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9dbb('0x0'));var zipdir=require(_0x9dbb('0x1'));var jsonpatch=require(_0x9dbb('0x2'));var rp=require(_0x9dbb('0x3'));var moment=require('moment');var BPromise=require(_0x9dbb('0x4'));var Mustache=require(_0x9dbb('0x5'));var util=require(_0x9dbb('0x6'));var path=require(_0x9dbb('0x7'));var sox=require(_0x9dbb('0x8'));var csv=require(_0x9dbb('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x9dbb('0xa'));var crypto=require(_0x9dbb('0xb'));var jsforce=require(_0x9dbb('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x9dbb('0xd'));var Papa=require(_0x9dbb('0xe'));var Redis=require(_0x9dbb('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x9dbb('0x10'));var as=require(_0x9dbb('0x11'));var hardwareService=require(_0x9dbb('0x12'));var logger=require(_0x9dbb('0x13'))('api');var utils=require(_0x9dbb('0x14'));var config=require(_0x9dbb('0x15'));var licenseUtil=require(_0x9dbb('0x16'));var db=require(_0x9dbb('0x17'))['db'];function respondWithStatusCode(_0x3fe0bd,_0x4468e8){_0x4468e8=_0x4468e8||0xcc;return function(_0x382cc6){if(_0x382cc6){return _0x3fe0bd[_0x9dbb('0x18')](_0x4468e8);}return _0x3fe0bd[_0x9dbb('0x19')](_0x4468e8)[_0x9dbb('0x1a')]();};}function respondWithResult(_0x293028,_0x2c36d3){_0x2c36d3=_0x2c36d3||0xc8;return function(_0x24b20b){if(_0x24b20b){return _0x293028[_0x9dbb('0x19')](_0x2c36d3)[_0x9dbb('0x1b')](_0x24b20b);}};}function respondWithFilteredResult(_0x464df5,_0x528110){return function(_0x1366b2){if(_0x1366b2){var _0x30add1=typeof _0x528110[_0x9dbb('0x1c')]===_0x9dbb('0x1d')&&typeof _0x528110[_0x9dbb('0x1e')]==='undefined';var _0x382d61=_0x1366b2[_0x9dbb('0x1f')];var _0x2383cf=_0x30add1?0x0:_0x528110[_0x9dbb('0x1c')];var _0x45c6f5=_0x30add1?_0x1366b2['count']:_0x528110[_0x9dbb('0x1c')]+_0x528110['limit'];var _0x3de435;if(_0x45c6f5>=_0x382d61){_0x45c6f5=_0x382d61;_0x3de435=0xc8;}else{_0x3de435=0xce;}_0x464df5['status'](_0x3de435);return _0x464df5[_0x9dbb('0x20')]('Content-Range',_0x2383cf+'-'+_0x45c6f5+'/'+_0x382d61)[_0x9dbb('0x1b')](_0x1366b2);}return null;};}function patchUpdates(_0x192eb5){return function(_0x188c75){try{jsonpatch['apply'](_0x188c75,_0x192eb5,!![]);}catch(_0x50e5e3){return BPromise['reject'](_0x50e5e3);}return _0x188c75[_0x9dbb('0x21')]();};}function saveUpdates(_0x35c136,_0x48bb65){return function(_0x4a07ef){if(_0x4a07ef){return _0x4a07ef['update'](_0x35c136)[_0x9dbb('0x22')](function(_0x245d12){return _0x245d12;});}return null;};}function removeEntity(_0x10c06a,_0x55e2ef){return function(_0x1f30ec){if(_0x1f30ec){return _0x1f30ec[_0x9dbb('0x23')]()[_0x9dbb('0x22')](function(){_0x10c06a[_0x9dbb('0x19')](0xcc)[_0x9dbb('0x1a')]();});}};}function handleEntityNotFound(_0x3e51ca,_0x668f7b){return function(_0x187486){if(!_0x187486){_0x3e51ca[_0x9dbb('0x18')](0x194);}return _0x187486;};}function handleError(_0x127742,_0x25614a){_0x25614a=_0x25614a||0x1f4;return function(_0x27a6f6){logger['error'](_0x27a6f6[_0x9dbb('0x24')]);if(_0x27a6f6['name']){delete _0x27a6f6[_0x9dbb('0x25')];}_0x127742[_0x9dbb('0x19')](_0x25614a)['send'](_0x27a6f6);};}exports[_0x9dbb('0x26')]=function(_0x4ebd57,_0x4b5ce1){var _0x589f63={},_0x25555c={},_0x3578b3={'count':0x0,'rows':[]};var _0x491324=_[_0x9dbb('0x27')](db[_0x9dbb('0x28')]['rawAttributes'],function(_0x71692a){return{'name':_0x71692a[_0x9dbb('0x29')],'type':_0x71692a[_0x9dbb('0x2a')]['key']};});_0x25555c[_0x9dbb('0x2b')]=_['map'](_0x491324,_0x9dbb('0x25'));_0x25555c[_0x9dbb('0x2c')]=_[_0x9dbb('0x2d')](_0x4ebd57[_0x9dbb('0x2c')]);_0x25555c[_0x9dbb('0x2e')]=_[_0x9dbb('0x2f')](_0x25555c[_0x9dbb('0x2b')],_0x25555c[_0x9dbb('0x2c')]);_0x589f63[_0x9dbb('0x30')]=_[_0x9dbb('0x2f')](_0x25555c[_0x9dbb('0x2b')],qs['fields'](_0x4ebd57[_0x9dbb('0x2c')][_0x9dbb('0x31')]));_0x589f63[_0x9dbb('0x30')]=_0x589f63[_0x9dbb('0x30')][_0x9dbb('0x32')]?_0x589f63[_0x9dbb('0x30')]:_0x25555c[_0x9dbb('0x2b')];if(!_0x4ebd57[_0x9dbb('0x2c')][_0x9dbb('0x33')](_0x9dbb('0x34'))){_0x589f63[_0x9dbb('0x1e')]=qs[_0x9dbb('0x1e')](_0x4ebd57[_0x9dbb('0x2c')][_0x9dbb('0x1e')]);_0x589f63[_0x9dbb('0x1c')]=qs[_0x9dbb('0x1c')](_0x4ebd57[_0x9dbb('0x2c')]['offset']);}_0x589f63[_0x9dbb('0x35')]=qs[_0x9dbb('0x36')](_0x4ebd57[_0x9dbb('0x2c')]['sort']);_0x589f63[_0x9dbb('0x37')]=qs[_0x9dbb('0x2e')](_[_0x9dbb('0x38')](_0x4ebd57[_0x9dbb('0x2c')],_0x25555c[_0x9dbb('0x2e')]),_0x491324);if(_0x4ebd57[_0x9dbb('0x2c')]['filter']){_0x589f63[_0x9dbb('0x37')]=_['merge'](_0x589f63[_0x9dbb('0x37')],{'$or':_[_0x9dbb('0x27')](_0x491324,function(_0xa3bc3){if(_0xa3bc3[_0x9dbb('0x2a')]!=='VIRTUAL'){var _0x1a5eeb={};_0x1a5eeb[_0xa3bc3['name']]={'$like':'%'+_0x4ebd57[_0x9dbb('0x2c')]['filter']+'%'};return _0x1a5eeb;}})});}_0x589f63=_[_0x9dbb('0x39')]({},_0x589f63,_0x4ebd57[_0x9dbb('0x3a')]);var _0x34524e={'where':_0x589f63[_0x9dbb('0x37')]};return db[_0x9dbb('0x28')]['count'](_0x34524e)[_0x9dbb('0x22')](function(_0x59eea1){_0x3578b3[_0x9dbb('0x1f')]=_0x59eea1;if(_0x4ebd57[_0x9dbb('0x2c')][_0x9dbb('0x3b')]){_0x589f63[_0x9dbb('0x3c')]=[{'all':!![]}];}return db[_0x9dbb('0x28')][_0x9dbb('0x3d')](_0x589f63);})[_0x9dbb('0x22')](function(_0x49e63f){_0x3578b3[_0x9dbb('0x3e')]=_0x49e63f;return _0x3578b3;})['then'](respondWithFilteredResult(_0x4b5ce1,_0x589f63))[_0x9dbb('0x3f')](handleError(_0x4b5ce1,null));};exports[_0x9dbb('0x40')]=function(_0x34c114,_0x104ec5){var _0x490833={'raw':!![],'where':{'id':_0x34c114['params']['id']}},_0x2f99ed={};_0x2f99ed[_0x9dbb('0x2b')]=_['keys'](db[_0x9dbb('0x28')][_0x9dbb('0x41')]);_0x2f99ed['query']=_['keys'](_0x34c114[_0x9dbb('0x2c')]);_0x2f99ed[_0x9dbb('0x2e')]=_[_0x9dbb('0x2f')](_0x2f99ed[_0x9dbb('0x2b')],_0x2f99ed[_0x9dbb('0x2c')]);_0x490833[_0x9dbb('0x30')]=_[_0x9dbb('0x2f')](_0x2f99ed[_0x9dbb('0x2b')],qs[_0x9dbb('0x31')](_0x34c114['query'][_0x9dbb('0x31')]));_0x490833['attributes']=_0x490833[_0x9dbb('0x30')][_0x9dbb('0x32')]?_0x490833[_0x9dbb('0x30')]:_0x2f99ed[_0x9dbb('0x2b')];if(_0x34c114['query'][_0x9dbb('0x3b')]){_0x490833['include']=[{'all':!![]}];}_0x490833=_['merge']({},_0x490833,_0x34c114[_0x9dbb('0x3a')]);return db[_0x9dbb('0x28')][_0x9dbb('0x42')](_0x490833)[_0x9dbb('0x22')](handleEntityNotFound(_0x104ec5,null))[_0x9dbb('0x22')](respondWithResult(_0x104ec5,null))[_0x9dbb('0x3f')](handleError(_0x104ec5,null));};exports['create']=function(_0x202235,_0x56d319){return db[_0x9dbb('0x28')][_0x9dbb('0x43')](_0x202235[_0x9dbb('0x44')],{})[_0x9dbb('0x22')](respondWithResult(_0x56d319,0xc9))[_0x9dbb('0x3f')](handleError(_0x56d319,null));};exports[_0x9dbb('0x45')]=function(_0x34304a,_0x31c532){if(_0x34304a['body']['id']){delete _0x34304a[_0x9dbb('0x44')]['id'];}return db['SmsTransferReport'][_0x9dbb('0x42')]({'where':{'id':_0x34304a[_0x9dbb('0x46')]['id']}})['then'](handleEntityNotFound(_0x31c532,null))[_0x9dbb('0x22')](saveUpdates(_0x34304a['body'],null))['then'](respondWithResult(_0x31c532,null))['catch'](handleError(_0x31c532,null));};exports[_0x9dbb('0x23')]=function(_0x3c19bb,_0x5c398b){return db[_0x9dbb('0x28')]['find']({'where':{'id':_0x3c19bb[_0x9dbb('0x46')]['id']}})[_0x9dbb('0x22')](handleEntityNotFound(_0x5c398b,null))[_0x9dbb('0x22')](removeEntity(_0x5c398b,null))[_0x9dbb('0x3f')](handleError(_0x5c398b,null));};exports[_0x9dbb('0x47')]=function(_0x6a6f55,_0x56ac9a){return db['SmsTransferReport'][_0x9dbb('0x47')]()[_0x9dbb('0x22')](respondWithResult(_0x56ac9a,null))['catch'](handleError(_0x56ac9a,null));}; \ No newline at end of file +var _0x743c=['map','SmsTransferReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','findAll','rows','catch','show','params','fields','includeAll','include','find','create','body','describe','eml-format','rimraf','request-promise','moment','mustache','util','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','update','then','destroy','error','name','send','index'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x743c,0x1d8));var _0xc743=function(_0x4fd9b9,_0x4baad2){_0x4fd9b9=_0x4fd9b9-0x0;var _0x41907a=_0x743c[_0x4fd9b9];return _0x41907a;};'use strict';var emlformat=require(_0xc743('0x0'));var rimraf=require(_0xc743('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xc743('0x2'));var moment=require(_0xc743('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xc743('0x4'));var util=require(_0xc743('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xc743('0x6'));var ejs=require(_0xc743('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc743('0x8'));var squel=require(_0xc743('0x9'));var crypto=require(_0xc743('0xa'));var jsforce=require(_0xc743('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xc743('0xc'));var Papa=require(_0xc743('0xd'));var Redis=require(_0xc743('0xe'));var authService=require(_0xc743('0xf'));var qs=require(_0xc743('0x10'));var as=require(_0xc743('0x11'));var hardwareService=require(_0xc743('0x12'));var logger=require('../../config/logger')(_0xc743('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc743('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x55d0cf,_0x464aee){_0x464aee=_0x464aee||0xcc;return function(_0x13638a){if(_0x13638a){return _0x55d0cf[_0xc743('0x15')](_0x464aee);}return _0x55d0cf[_0xc743('0x16')](_0x464aee)[_0xc743('0x17')]();};}function respondWithResult(_0x2e74f4,_0x137ef6){_0x137ef6=_0x137ef6||0xc8;return function(_0x88ead8){if(_0x88ead8){return _0x2e74f4['status'](_0x137ef6)[_0xc743('0x18')](_0x88ead8);}};}function respondWithFilteredResult(_0xba25c,_0x5a9647){return function(_0x4974bf){if(_0x4974bf){var _0x24fd7a=typeof _0x5a9647['offset']===_0xc743('0x19')&&typeof _0x5a9647[_0xc743('0x1a')]===_0xc743('0x19');var _0x1c74a0=_0x4974bf[_0xc743('0x1b')];var _0xdcc240=_0x24fd7a?0x0:_0x5a9647[_0xc743('0x1c')];var _0x3e1963=_0x24fd7a?_0x4974bf[_0xc743('0x1b')]:_0x5a9647['offset']+_0x5a9647[_0xc743('0x1a')];var _0x110d30;if(_0x3e1963>=_0x1c74a0){_0x3e1963=_0x1c74a0;_0x110d30=0xc8;}else{_0x110d30=0xce;}_0xba25c[_0xc743('0x16')](_0x110d30);return _0xba25c['set'](_0xc743('0x1d'),_0xdcc240+'-'+_0x3e1963+'/'+_0x1c74a0)['json'](_0x4974bf);}return null;};}function patchUpdates(_0x584a85){return function(_0x4b35cd){try{jsonpatch[_0xc743('0x1e')](_0x4b35cd,_0x584a85,!![]);}catch(_0x3fc5c0){return BPromise[_0xc743('0x1f')](_0x3fc5c0);}return _0x4b35cd['save']();};}function saveUpdates(_0x24037c,_0x598b16){return function(_0x74f431){if(_0x74f431){return _0x74f431[_0xc743('0x20')](_0x24037c)[_0xc743('0x21')](function(_0x262c43){return _0x262c43;});}return null;};}function removeEntity(_0x203975,_0x925482){return function(_0x437dcc){if(_0x437dcc){return _0x437dcc[_0xc743('0x22')]()['then'](function(){_0x203975[_0xc743('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x50d209,_0x2fb1e3){return function(_0x4d1689){if(!_0x4d1689){_0x50d209[_0xc743('0x15')](0x194);}return _0x4d1689;};}function handleError(_0x9fd93c,_0x119e03){_0x119e03=_0x119e03||0x1f4;return function(_0x2c0792){logger[_0xc743('0x23')](_0x2c0792['stack']);if(_0x2c0792[_0xc743('0x24')]){delete _0x2c0792['name'];}_0x9fd93c['status'](_0x119e03)[_0xc743('0x25')](_0x2c0792);};}exports[_0xc743('0x26')]=function(_0x5a7114,_0x4ce7dc){var _0xbbd14b={},_0x5f0ac0={},_0x4737b0={'count':0x0,'rows':[]};var _0x284800=_[_0xc743('0x27')](db[_0xc743('0x28')][_0xc743('0x29')],function(_0x3b4549){return{'name':_0x3b4549[_0xc743('0x2a')],'type':_0x3b4549['type'][_0xc743('0x2b')]};});_0x5f0ac0[_0xc743('0x2c')]=_[_0xc743('0x27')](_0x284800,'name');_0x5f0ac0[_0xc743('0x2d')]=_[_0xc743('0x2e')](_0x5a7114[_0xc743('0x2d')]);_0x5f0ac0[_0xc743('0x2f')]=_[_0xc743('0x30')](_0x5f0ac0[_0xc743('0x2c')],_0x5f0ac0['query']);_0xbbd14b[_0xc743('0x31')]=_[_0xc743('0x30')](_0x5f0ac0[_0xc743('0x2c')],qs['fields'](_0x5a7114['query']['fields']));_0xbbd14b['attributes']=_0xbbd14b[_0xc743('0x31')][_0xc743('0x32')]?_0xbbd14b['attributes']:_0x5f0ac0['model'];if(!_0x5a7114['query'][_0xc743('0x33')](_0xc743('0x34'))){_0xbbd14b[_0xc743('0x1a')]=qs[_0xc743('0x1a')](_0x5a7114[_0xc743('0x2d')][_0xc743('0x1a')]);_0xbbd14b['offset']=qs[_0xc743('0x1c')](_0x5a7114[_0xc743('0x2d')][_0xc743('0x1c')]);}_0xbbd14b[_0xc743('0x35')]=qs[_0xc743('0x36')](_0x5a7114[_0xc743('0x2d')]['sort']);_0xbbd14b[_0xc743('0x37')]=qs[_0xc743('0x2f')](_[_0xc743('0x38')](_0x5a7114[_0xc743('0x2d')],_0x5f0ac0[_0xc743('0x2f')]),_0x284800);if(_0x5a7114['query']['filter']){_0xbbd14b[_0xc743('0x37')]=_[_0xc743('0x39')](_0xbbd14b['where'],{'$or':_[_0xc743('0x27')](_0x284800,function(_0x7eb9e2){if(_0x7eb9e2['type']!==_0xc743('0x3a')){var _0x17827a={};_0x17827a[_0x7eb9e2['name']]={'$like':'%'+_0x5a7114['query'][_0xc743('0x3b')]+'%'};return _0x17827a;}})});}_0xbbd14b=_[_0xc743('0x39')]({},_0xbbd14b,_0x5a7114[_0xc743('0x3c')]);var _0x4c244f={'where':_0xbbd14b[_0xc743('0x37')]};return db[_0xc743('0x28')][_0xc743('0x1b')](_0x4c244f)['then'](function(_0x4a588c){_0x4737b0[_0xc743('0x1b')]=_0x4a588c;if(_0x5a7114[_0xc743('0x2d')]['includeAll']){_0xbbd14b['include']=[{'all':!![]}];}return db[_0xc743('0x28')][_0xc743('0x3d')](_0xbbd14b);})[_0xc743('0x21')](function(_0x29eafa){_0x4737b0[_0xc743('0x3e')]=_0x29eafa;return _0x4737b0;})[_0xc743('0x21')](respondWithFilteredResult(_0x4ce7dc,_0xbbd14b))[_0xc743('0x3f')](handleError(_0x4ce7dc,null));};exports[_0xc743('0x40')]=function(_0x29a868,_0x565a6f){var _0x2540e8={'raw':!![],'where':{'id':_0x29a868[_0xc743('0x41')]['id']}},_0x18a149={};_0x18a149['model']=_[_0xc743('0x2e')](db[_0xc743('0x28')]['rawAttributes']);_0x18a149[_0xc743('0x2d')]=_['keys'](_0x29a868['query']);_0x18a149[_0xc743('0x2f')]=_['intersection'](_0x18a149[_0xc743('0x2c')],_0x18a149[_0xc743('0x2d')]);_0x2540e8[_0xc743('0x31')]=_[_0xc743('0x30')](_0x18a149['model'],qs[_0xc743('0x42')](_0x29a868[_0xc743('0x2d')][_0xc743('0x42')]));_0x2540e8[_0xc743('0x31')]=_0x2540e8[_0xc743('0x31')][_0xc743('0x32')]?_0x2540e8[_0xc743('0x31')]:_0x18a149[_0xc743('0x2c')];if(_0x29a868[_0xc743('0x2d')][_0xc743('0x43')]){_0x2540e8[_0xc743('0x44')]=[{'all':!![]}];}_0x2540e8=_[_0xc743('0x39')]({},_0x2540e8,_0x29a868[_0xc743('0x3c')]);return db[_0xc743('0x28')][_0xc743('0x45')](_0x2540e8)[_0xc743('0x21')](handleEntityNotFound(_0x565a6f,null))[_0xc743('0x21')](respondWithResult(_0x565a6f,null))['catch'](handleError(_0x565a6f,null));};exports[_0xc743('0x46')]=function(_0x5df54c,_0xadaa44){return db[_0xc743('0x28')][_0xc743('0x46')](_0x5df54c[_0xc743('0x47')],{})[_0xc743('0x21')](respondWithResult(_0xadaa44,0xc9))[_0xc743('0x3f')](handleError(_0xadaa44,null));};exports[_0xc743('0x20')]=function(_0x39bdb3,_0x3cf36f){if(_0x39bdb3[_0xc743('0x47')]['id']){delete _0x39bdb3[_0xc743('0x47')]['id'];}return db['SmsTransferReport'][_0xc743('0x45')]({'where':{'id':_0x39bdb3[_0xc743('0x41')]['id']}})[_0xc743('0x21')](handleEntityNotFound(_0x3cf36f,null))[_0xc743('0x21')](saveUpdates(_0x39bdb3['body'],null))[_0xc743('0x21')](respondWithResult(_0x3cf36f,null))[_0xc743('0x3f')](handleError(_0x3cf36f,null));};exports['destroy']=function(_0x426131,_0x4ca5c4){return db['SmsTransferReport'][_0xc743('0x45')]({'where':{'id':_0x426131['params']['id']}})[_0xc743('0x21')](handleEntityNotFound(_0x4ca5c4,null))[_0xc743('0x21')](removeEntity(_0x4ca5c4,null))[_0xc743('0x3f')](handleError(_0x4ca5c4,null));};exports[_0xc743('0x48')]=function(_0x503df4,_0x2c1fab){return db[_0xc743('0x28')][_0xc743('0x48')]()[_0xc743('0x21')](respondWithResult(_0x2c1fab,null))['catch'](handleError(_0x2c1fab,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 6bfb591..686a102 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 _0xee14=['report_sms_transfer','uniqueid','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsTransferReport.attributes','define','SmsTransferReport'];(function(_0x510bd8,_0x46c1e6){var _0xcd6e09=function(_0x4adabe){while(--_0x4adabe){_0x510bd8['push'](_0x510bd8['shift']());}};_0xcd6e09(++_0x46c1e6);}(_0xee14,0x13a));var _0x4ee1=function(_0x3b5352,_0x30ec1b){_0x3b5352=_0x3b5352-0x0;var _0x4f9e79=_0xee14[_0x3b5352];return _0x4f9e79;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4ee1('0x0'))(_0x4ee1('0x1'));var moment=require(_0x4ee1('0x2'));var BPromise=require(_0x4ee1('0x3'));var rp=require(_0x4ee1('0x4'));var fs=require('fs');var path=require(_0x4ee1('0x5'));var rimraf=require(_0x4ee1('0x6'));var config=require(_0x4ee1('0x7'));var attributes=require(_0x4ee1('0x8'));module['exports']=function(_0xba6d36,_0x573700){return _0xba6d36[_0x4ee1('0x9')](_0x4ee1('0xa'),attributes,{'tableName':_0x4ee1('0xb'),'paranoid':![],'indexes':[{'name':_0x4ee1('0xc'),'fields':[_0x4ee1('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc997=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./smsTransferReport.attributes','exports','define','report_sms_transfer','uniqueid','util'];(function(_0x50b6f4,_0x2f35dd){var _0x5657fe=function(_0x196fc3){while(--_0x196fc3){_0x50b6f4['push'](_0x50b6f4['shift']());}};_0x5657fe(++_0x2f35dd);}(_0xc997,0x1ac));var _0x7c99=function(_0x7490e9,_0x4015a2){_0x7490e9=_0x7490e9-0x0;var _0x150fc2=_0xc997[_0x7490e9];return _0x150fc2;};'use strict';var _=require('lodash');var util=require(_0x7c99('0x0'));var logger=require(_0x7c99('0x1'))(_0x7c99('0x2'));var moment=require(_0x7c99('0x3'));var BPromise=require(_0x7c99('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7c99('0x5'));var rimraf=require(_0x7c99('0x6'));var config=require(_0x7c99('0x7'));var attributes=require(_0x7c99('0x8'));module[_0x7c99('0x9')]=function(_0x404ffb,_0x1a21e1){return _0x404ffb[_0x7c99('0xa')]('SmsTransferReport',attributes,{'tableName':_0x7c99('0xb'),'paranoid':![],'indexes':[{'name':_0x7c99('0xc'),'fields':[_0x7c99('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 48ad5d9..f49d60b 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 _0xfa2b=['jayson/promise','client','http','request','then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','code','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x1231cf,_0x286f35){var _0x1f3c19=function(_0x2f2725){while(--_0x2f2725){_0x1231cf['push'](_0x1231cf['shift']());}};_0x1f3c19(++_0x286f35);}(_0xfa2b,0x1b7));var _0xbfa2=function(_0x3b1234,_0x3d634c){_0x3b1234=_0x3b1234-0x0;var _0x6e4407=_0xfa2b[_0x3b1234];return _0x6e4407;};'use strict';var _=require(_0xbfa2('0x0'));var util=require(_0xbfa2('0x1'));var moment=require(_0xbfa2('0x2'));var BPromise=require(_0xbfa2('0x3'));var rs=require(_0xbfa2('0x4'));var fs=require('fs');var Redis=require(_0xbfa2('0x5'));var db=require(_0xbfa2('0x6'))['db'];var utils=require(_0xbfa2('0x7'));var logger=require(_0xbfa2('0x8'))(_0xbfa2('0x9'));var config=require(_0xbfa2('0xa'));var jayson=require(_0xbfa2('0xb'));var client=jayson[_0xbfa2('0xc')][_0xbfa2('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x26ed93,_0x26e9bf,_0x4cd9ae){return new BPromise(function(_0x46a151,_0x4f17e6){return client[_0xbfa2('0xe')](_0x26ed93,_0x4cd9ae)[_0xbfa2('0xf')](function(_0x1b1c13){logger[_0xbfa2('0x10')](_0xbfa2('0x11'),_0x26e9bf,_0xbfa2('0x12'));logger[_0xbfa2('0x13')](_0xbfa2('0x14'),_0x26e9bf,_0xbfa2('0x12'),JSON['stringify'](_0x1b1c13));if(_0x1b1c13['error']){if(_0x1b1c13['error'][_0xbfa2('0x15')]===0x1f4){logger[_0xbfa2('0x16')](_0xbfa2('0x11'),_0x26e9bf,_0x1b1c13[_0xbfa2('0x16')][_0xbfa2('0x17')]);return _0x4f17e6(_0x1b1c13[_0xbfa2('0x16')]['message']);}logger[_0xbfa2('0x16')](_0xbfa2('0x11'),_0x26e9bf,_0x1b1c13[_0xbfa2('0x16')][_0xbfa2('0x17')]);return _0x46a151(_0x1b1c13[_0xbfa2('0x16')]['message']);}else{logger[_0xbfa2('0x10')]('SmsTransferReport,\x20%s,\x20%s',_0x26e9bf,'request\x20sent');_0x46a151(_0x1b1c13[_0xbfa2('0x18')]['message']);}})['catch'](function(_0xab2c91){logger[_0xbfa2('0x16')]('SmsTransferReport,\x20%s,\x20%s',_0x26e9bf,_0xab2c91);_0x4f17e6(_0xab2c91);});});} \ No newline at end of file +var _0x38d3=['SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x43e515,_0x7d3d8e){var _0x276517=function(_0x2946b1){while(--_0x2946b1){_0x43e515['push'](_0x43e515['shift']());}};_0x276517(++_0x7d3d8e);}(_0x38d3,0x1a7));var _0x338d=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0x38d3[_0x102e37];return _0x35a07c;};'use strict';var _=require(_0x338d('0x0'));var util=require(_0x338d('0x1'));var moment=require('moment');var BPromise=require(_0x338d('0x2'));var rs=require(_0x338d('0x3'));var fs=require('fs');var Redis=require(_0x338d('0x4'));var db=require(_0x338d('0x5'))['db'];var utils=require(_0x338d('0x6'));var logger=require(_0x338d('0x7'))(_0x338d('0x8'));var config=require(_0x338d('0x9'));var jayson=require(_0x338d('0xa'));var client=jayson['client'][_0x338d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2012c3,_0x439f4b,_0x2b7aab){return new BPromise(function(_0x60eaa1,_0x46b758){return client[_0x338d('0xc')](_0x2012c3,_0x2b7aab)['then'](function(_0x264986){logger[_0x338d('0xd')](_0x338d('0xe'),_0x439f4b,_0x338d('0xf'));logger[_0x338d('0x10')](_0x338d('0x11'),_0x439f4b,'request\x20sent',JSON[_0x338d('0x12')](_0x264986));if(_0x264986[_0x338d('0x13')]){if(_0x264986[_0x338d('0x13')][_0x338d('0x14')]===0x1f4){logger[_0x338d('0x13')](_0x338d('0xe'),_0x439f4b,_0x264986[_0x338d('0x13')][_0x338d('0x15')]);return _0x46b758(_0x264986['error']['message']);}logger['error'](_0x338d('0xe'),_0x439f4b,_0x264986[_0x338d('0x13')]['message']);return _0x60eaa1(_0x264986[_0x338d('0x13')]['message']);}else{logger[_0x338d('0xd')](_0x338d('0xe'),_0x439f4b,_0x338d('0xf'));_0x60eaa1(_0x264986['result']['message']);}})['catch'](function(_0x2b8fd5){logger['error'](_0x338d('0xe'),_0x439f4b,_0x2b8fd5);_0x46b758(_0x2b8fd5);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 424f2db..3591238 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 _0x3a57=['single','file','create','put','delete','exports','util','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','download','diskStorage','join','originalname','replace','format','basename','extname','now'];(function(_0x3e226d,_0x3c23bd){var _0x40892c=function(_0x141162){while(--_0x141162){_0x3e226d['push'](_0x3e226d['shift']());}};_0x40892c(++_0x3c23bd);}(_0x3a57,0x172));var _0x73a5=function(_0x13b0eb,_0x453a07){_0x13b0eb=_0x13b0eb-0x0;var _0x10d0c9=_0x3a57[_0x13b0eb];return _0x10d0c9;};'use strict';var multer=require('multer');var util=require(_0x73a5('0x0'));var path=require(_0x73a5('0x1'));var timeout=require(_0x73a5('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x73a5('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x73a5('0x4'));var config=require(_0x73a5('0x5'));var controller=require('./sound.controller');router[_0x73a5('0x6')]('/',auth[_0x73a5('0x7')](),controller[_0x73a5('0x8')]);router[_0x73a5('0x6')](_0x73a5('0x9'),auth[_0x73a5('0x7')](),controller[_0x73a5('0xa')]);router['get']('/:id/download',auth['isAuthenticated'](),controller[_0x73a5('0xb')]);var upload=multer({'storage':multer[_0x73a5('0xc')]({'destination':function(_0x125309,_0x40427b,_0x23ad86){_0x23ad86(null,path[_0x73a5('0xd')](config['root'],'server/files/sounds/original/'));},'filename':function(_0x5e5cd9,_0x3f46de,_0x1f51f0){_0x3f46de[_0x73a5('0xe')]=_0x3f46de['originalname'][_0x73a5('0xf')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x1f51f0(null,util[_0x73a5('0x10')]('%s-%s%s',path[_0x73a5('0x11')](_0x3f46de[_0x73a5('0xe')],path[_0x73a5('0x12')](_0x3f46de[_0x73a5('0xe')])),Date[_0x73a5('0x13')](),path[_0x73a5('0x12')](_0x3f46de['originalname'])));}})});router['post']('/',upload[_0x73a5('0x14')](_0x73a5('0x15')),controller[_0x73a5('0x16')]);router[_0x73a5('0x17')](_0x73a5('0x9'),auth[_0x73a5('0x7')](),controller['update']);router[_0x73a5('0x18')]('/:id',auth['isAuthenticated'](),controller[_0x73a5('0x18')]);module[_0x73a5('0x19')]=router; \ No newline at end of file +var _0xe874=['put','delete','exports','multer','path','connect-timeout','express','fs-extra','../../components/interaction/service','get','isAuthenticated','index','/:id','/:id/download','join','server/files/sounds/original/','originalname','%s-%s%s','basename','now','extname','post','single','create'];(function(_0x2b91c5,_0x3b6db5){var _0xbd5531=function(_0x54783d){while(--_0x54783d){_0x2b91c5['push'](_0x2b91c5['shift']());}};_0xbd5531(++_0x3b6db5);}(_0xe874,0x13b));var _0x4e87=function(_0x21f98f,_0x3a67da){_0x21f98f=_0x21f98f-0x0;var _0x48fc8d=_0xe874[_0x21f98f];return _0x48fc8d;};'use strict';var multer=require(_0x4e87('0x0'));var util=require('util');var path=require(_0x4e87('0x1'));var timeout=require(_0x4e87('0x2'));var express=require(_0x4e87('0x3'));var router=express['Router']();var fs_extra=require(_0x4e87('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x4e87('0x5'));var config=require('../../config/environment');var controller=require('./sound.controller');router[_0x4e87('0x6')]('/',auth[_0x4e87('0x7')](),controller[_0x4e87('0x8')]);router['get'](_0x4e87('0x9'),auth['isAuthenticated'](),controller['show']);router['get'](_0x4e87('0xa'),auth[_0x4e87('0x7')](),controller['download']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x35369c,_0x417c89,_0x38644c){_0x38644c(null,path[_0x4e87('0xb')](config['root'],_0x4e87('0xc')));},'filename':function(_0x2c3c0f,_0x202a95,_0x70b6bd){_0x202a95[_0x4e87('0xd')]=_0x202a95['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x70b6bd(null,util['format'](_0x4e87('0xe'),path[_0x4e87('0xf')](_0x202a95['originalname'],path['extname'](_0x202a95[_0x4e87('0xd')])),Date[_0x4e87('0x10')](),path[_0x4e87('0x11')](_0x202a95[_0x4e87('0xd')])));}})});router[_0x4e87('0x12')]('/',upload[_0x4e87('0x13')]('file'),controller[_0x4e87('0x14')]);router[_0x4e87('0x15')](_0x4e87('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x4e87('0x16')](_0x4e87('0x9'),auth['isAuthenticated'](),controller[_0x4e87('0x16')]);module[_0x4e87('0x17')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index 7c0203a..eb38ccc 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 _0x2943=['STRING','FLOAT','INTEGER','BIGINT','exports'];(function(_0x324d05,_0x5e2b01){var _0x572121=function(_0x27671a){while(--_0x27671a){_0x324d05['push'](_0x324d05['shift']());}};_0x572121(++_0x5e2b01);}(_0x2943,0x8b));var _0x3294=function(_0x1e7ead,_0x7f6227){_0x1e7ead=_0x1e7ead-0x0;var _0x3912b2=_0x2943[_0x1e7ead];return _0x3912b2;};'use strict';var Sequelize=require('sequelize');module[_0x3294('0x0')]={'name':{'type':Sequelize[_0x3294('0x1')],'unique':'name','allowNull':![]},'save_name':{'type':Sequelize['STRING']},'display_name':{'type':Sequelize[_0x3294('0x1')],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize[_0x3294('0x1')]},'original_duration':{'type':Sequelize[_0x3294('0x2')]},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize[_0x3294('0x3')]},'original_bitRate':{'type':Sequelize[_0x3294('0x4')]},'original_sampleRate':{'type':Sequelize[_0x3294('0x3')]},'converted_format':{'type':Sequelize[_0x3294('0x1')]},'converted_duration':{'type':Sequelize[_0x3294('0x2')]},'converted_sampleCount':{'type':Sequelize['BIGINT']},'converted_channelCount':{'type':Sequelize['INTEGER']},'converted_bitRate':{'type':Sequelize['BIGINT']},'converted_sampleRate':{'type':Sequelize[_0x3294('0x3')]}}; \ No newline at end of file +var _0xfbd6=['INTEGER','exports','name','STRING','FLOAT','BIGINT'];(function(_0x990ae5,_0x5b4c84){var _0x37607e=function(_0x7633dc){while(--_0x7633dc){_0x990ae5['push'](_0x990ae5['shift']());}};_0x37607e(++_0x5b4c84);}(_0xfbd6,0x175));var _0x6fbd=function(_0x5679f4,_0x193f2d){_0x5679f4=_0x5679f4-0x0;var _0x37eaec=_0xfbd6[_0x5679f4];return _0x37eaec;};'use strict';var Sequelize=require('sequelize');module[_0x6fbd('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x6fbd('0x1'),'allowNull':![]},'save_name':{'type':Sequelize[_0x6fbd('0x2')]},'display_name':{'type':Sequelize[_0x6fbd('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0x6fbd('0x2')]},'original_format':{'type':Sequelize[_0x6fbd('0x2')]},'original_duration':{'type':Sequelize[_0x6fbd('0x3')]},'original_sampleCount':{'type':Sequelize[_0x6fbd('0x4')]},'original_channelCount':{'type':Sequelize['INTEGER']},'original_bitRate':{'type':Sequelize[_0x6fbd('0x4')]},'original_sampleRate':{'type':Sequelize[_0x6fbd('0x5')]},'converted_format':{'type':Sequelize[_0x6fbd('0x2')]},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize[_0x6fbd('0x4')]},'converted_channelCount':{'type':Sequelize['INTEGER']},'converted_bitRate':{'type':Sequelize[_0x6fbd('0x4')]},'converted_sampleRate':{'type':Sequelize[_0x6fbd('0x5')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index a9921a3..73a6eca 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 _0xa825=['save','update','then','destroy','get','Sounds','UserProfileResource','error','stack','name','index','map','rawAttributes','fieldName','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','Sound','includeAll','include','rows','params','length','merge','options','find','catch','download','save_name','converted_format','existsSync','join','root','server/files/sounds/converted','Sequelize','ValidationError','format','%s.%s','basename','file','originalname','extname','filename','substring','info','Sound\x20upload\x20destination:\x20%s','0777','transcode','wav','unlinkSync','send','src','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','converted_sampleCount','converted_bitRate','converted_sampleRate','chmodSync','create','body','role','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','description','delete','server/files/sounds/original','original_format','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject'];(function(_0x2d8434,_0x43d781){var _0x26b9e4=function(_0x54f5b8){while(--_0x54f5b8){_0x2d8434['push'](_0x2d8434['shift']());}};_0x26b9e4(++_0x43d781);}(_0xa825,0xdd));var _0x5a82=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa825[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require(_0x5a82('0x0'));var rimraf=require(_0x5a82('0x1'));var zipdir=require(_0x5a82('0x2'));var jsonpatch=require(_0x5a82('0x3'));var rp=require(_0x5a82('0x4'));var moment=require(_0x5a82('0x5'));var BPromise=require(_0x5a82('0x6'));var Mustache=require(_0x5a82('0x7'));var util=require('util');var path=require(_0x5a82('0x8'));var sox=require(_0x5a82('0x9'));var csv=require(_0x5a82('0xa'));var ejs=require(_0x5a82('0xb'));var fs=require('fs');var fs_extra=require(_0x5a82('0xc'));var _=require('lodash');var squel=require(_0x5a82('0xd'));var crypto=require('crypto');var jsforce=require(_0x5a82('0xe'));var deskjs=require(_0x5a82('0xf'));var toCsv=require(_0x5a82('0xa'));var querystring=require(_0x5a82('0x10'));var Papa=require(_0x5a82('0x11'));var Redis=require(_0x5a82('0x12'));var authService=require(_0x5a82('0x13'));var qs=require(_0x5a82('0x14'));var as=require(_0x5a82('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5a82('0x16'));var utils=require(_0x5a82('0x17'));var config=require(_0x5a82('0x18'));var licenseUtil=require(_0x5a82('0x19'));var db=require(_0x5a82('0x1a'))['db'];function respondWithStatusCode(_0xd3a201,_0x397f47){_0x397f47=_0x397f47||0xcc;return function(_0x148a78){if(_0x148a78){return _0xd3a201[_0x5a82('0x1b')](_0x397f47);}return _0xd3a201['status'](_0x397f47)[_0x5a82('0x1c')]();};}function respondWithResult(_0x1b46a2,_0x156f48){_0x156f48=_0x156f48||0xc8;return function(_0x2d905b){if(_0x2d905b){return _0x1b46a2['status'](_0x156f48)[_0x5a82('0x1d')](_0x2d905b);}};}function respondWithFilteredResult(_0x3a9578,_0x3e4af8){return function(_0x1c33df){if(_0x1c33df){var _0x1bac04=typeof _0x3e4af8[_0x5a82('0x1e')]===_0x5a82('0x1f')&&typeof _0x3e4af8[_0x5a82('0x20')]===_0x5a82('0x1f');var _0x53fc7d=_0x1c33df[_0x5a82('0x21')];var _0x4bb6d0=_0x1bac04?0x0:_0x3e4af8[_0x5a82('0x1e')];var _0x1d3489=_0x1bac04?_0x1c33df[_0x5a82('0x21')]:_0x3e4af8['offset']+_0x3e4af8[_0x5a82('0x20')];var _0x579ef5;if(_0x1d3489>=_0x53fc7d){_0x1d3489=_0x53fc7d;_0x579ef5=0xc8;}else{_0x579ef5=0xce;}_0x3a9578[_0x5a82('0x22')](_0x579ef5);return _0x3a9578[_0x5a82('0x23')](_0x5a82('0x24'),_0x4bb6d0+'-'+_0x1d3489+'/'+_0x53fc7d)[_0x5a82('0x1d')](_0x1c33df);}return null;};}function patchUpdates(_0x2164cc){return function(_0x20c527){try{jsonpatch[_0x5a82('0x25')](_0x20c527,_0x2164cc,!![]);}catch(_0x7c5eef){return BPromise[_0x5a82('0x26')](_0x7c5eef);}return _0x20c527[_0x5a82('0x27')]();};}function saveUpdates(_0x267c8b,_0x59997a){return function(_0xcca5e5){if(_0xcca5e5){return _0xcca5e5[_0x5a82('0x28')](_0x267c8b)[_0x5a82('0x29')](function(_0x1b5347){return _0x1b5347;});}return null;};}function removeEntity(_0x5135f0,_0x2e2561){return function(_0x45728a){if(_0x45728a){return _0x45728a[_0x5a82('0x2a')]()[_0x5a82('0x29')](function(){var _0x3131af=_0x45728a[_0x5a82('0x2b')]({'plain':!![]});var _0x208c57=_0x5a82('0x2c');return db[_0x5a82('0x2d')][_0x5a82('0x2a')]({'where':{'type':_0x208c57,'resourceId':_0x3131af['id']}})[_0x5a82('0x29')](function(){return _0x45728a;});})[_0x5a82('0x29')](function(){_0x5135f0[_0x5a82('0x22')](0xcc)[_0x5a82('0x1c')]();});}};}function handleEntityNotFound(_0x51468b,_0x32c79d){return function(_0x199b40){if(!_0x199b40){_0x51468b[_0x5a82('0x1b')](0x194);}return _0x199b40;};}function handleError(_0x2f32bd,_0x56f217){_0x56f217=_0x56f217||0x1f4;return function(_0x15145e){logger[_0x5a82('0x2e')](_0x15145e[_0x5a82('0x2f')]);if(_0x15145e['name']){delete _0x15145e[_0x5a82('0x30')];}_0x2f32bd[_0x5a82('0x22')](_0x56f217)['send'](_0x15145e);};}exports[_0x5a82('0x31')]=function(_0x88a361,_0x3b3c1c){var _0x563cad={},_0x10495f={},_0x3ee8c7={'count':0x0,'rows':[]};var _0x3c0239=_[_0x5a82('0x32')](db['Sound'][_0x5a82('0x33')],function(_0x46411a){return{'name':_0x46411a[_0x5a82('0x34')],'type':_0x46411a['type']['key']};});_0x10495f['model']=_['map'](_0x3c0239,_0x5a82('0x30'));_0x10495f[_0x5a82('0x35')]=_[_0x5a82('0x36')](_0x88a361[_0x5a82('0x35')]);_0x10495f[_0x5a82('0x37')]=_[_0x5a82('0x38')](_0x10495f[_0x5a82('0x39')],_0x10495f[_0x5a82('0x35')]);_0x563cad[_0x5a82('0x3a')]=_[_0x5a82('0x38')](_0x10495f[_0x5a82('0x39')],qs[_0x5a82('0x3b')](_0x88a361[_0x5a82('0x35')][_0x5a82('0x3b')]));_0x563cad['attributes']=_0x563cad[_0x5a82('0x3a')]['length']?_0x563cad[_0x5a82('0x3a')]:_0x10495f[_0x5a82('0x39')];if(!_0x88a361[_0x5a82('0x35')][_0x5a82('0x3c')](_0x5a82('0x3d'))){_0x563cad[_0x5a82('0x20')]=qs[_0x5a82('0x20')](_0x88a361[_0x5a82('0x35')][_0x5a82('0x20')]);_0x563cad[_0x5a82('0x1e')]=qs['offset'](_0x88a361[_0x5a82('0x35')]['offset']);}_0x563cad[_0x5a82('0x3e')]=qs[_0x5a82('0x3f')](_0x88a361[_0x5a82('0x35')]['sort']);_0x563cad[_0x5a82('0x40')]=qs[_0x5a82('0x37')](_[_0x5a82('0x41')](_0x88a361['query'],_0x10495f[_0x5a82('0x37')]),_0x3c0239);if(_0x88a361[_0x5a82('0x35')][_0x5a82('0x42')]){_0x563cad[_0x5a82('0x40')]=_['merge'](_0x563cad[_0x5a82('0x40')],{'$or':_[_0x5a82('0x32')](_0x3c0239,function(_0x39123d){if(_0x39123d[_0x5a82('0x43')]!==_0x5a82('0x44')){var _0x371349={};_0x371349[_0x39123d[_0x5a82('0x30')]]={'$like':'%'+_0x88a361[_0x5a82('0x35')][_0x5a82('0x42')]+'%'};return _0x371349;}})});}_0x563cad=_['merge']({},_0x563cad,_0x88a361['options']);var _0x5f55d1={'where':_0x563cad[_0x5a82('0x40')]};return db[_0x5a82('0x45')][_0x5a82('0x21')](_0x5f55d1)[_0x5a82('0x29')](function(_0x421558){_0x3ee8c7[_0x5a82('0x21')]=_0x421558;if(_0x88a361[_0x5a82('0x35')][_0x5a82('0x46')]){_0x563cad[_0x5a82('0x47')]=[{'all':!![]}];}return db[_0x5a82('0x45')]['findAll'](_0x563cad);})[_0x5a82('0x29')](function(_0x450146){_0x3ee8c7[_0x5a82('0x48')]=_0x450146;return _0x3ee8c7;})[_0x5a82('0x29')](respondWithFilteredResult(_0x3b3c1c,_0x563cad))['catch'](handleError(_0x3b3c1c,null));};exports['show']=function(_0x54682c,_0x540245){var _0xa4aaef={'raw':!![],'where':{'id':_0x54682c[_0x5a82('0x49')]['id']}},_0xb9446d={};_0xb9446d[_0x5a82('0x39')]=_[_0x5a82('0x36')](db[_0x5a82('0x45')][_0x5a82('0x33')]);_0xb9446d[_0x5a82('0x35')]=_['keys'](_0x54682c[_0x5a82('0x35')]);_0xb9446d[_0x5a82('0x37')]=_[_0x5a82('0x38')](_0xb9446d['model'],_0xb9446d[_0x5a82('0x35')]);_0xa4aaef[_0x5a82('0x3a')]=_[_0x5a82('0x38')](_0xb9446d['model'],qs[_0x5a82('0x3b')](_0x54682c[_0x5a82('0x35')][_0x5a82('0x3b')]));_0xa4aaef['attributes']=_0xa4aaef[_0x5a82('0x3a')][_0x5a82('0x4a')]?_0xa4aaef[_0x5a82('0x3a')]:_0xb9446d[_0x5a82('0x39')];if(_0x54682c['query'][_0x5a82('0x46')]){_0xa4aaef[_0x5a82('0x47')]=[{'all':!![]}];}_0xa4aaef=_[_0x5a82('0x4b')]({},_0xa4aaef,_0x54682c[_0x5a82('0x4c')]);return db[_0x5a82('0x45')][_0x5a82('0x4d')](_0xa4aaef)[_0x5a82('0x29')](handleEntityNotFound(_0x540245,null))[_0x5a82('0x29')](respondWithResult(_0x540245,null))[_0x5a82('0x4e')](handleError(_0x540245,null));};exports[_0x5a82('0x4f')]=function(_0x29339a,_0x382c55,_0x50514f){return db[_0x5a82('0x45')]['find']({'where':{'id':_0x29339a[_0x5a82('0x49')]['id']},'attributes':[_0x5a82('0x30'),_0x5a82('0x50'),_0x5a82('0x51')],'raw':!![]})['then'](handleEntityNotFound(_0x382c55,null))['then'](function(_0x2ec568){if(_0x2ec568){if(!fs[_0x5a82('0x52')](path[_0x5a82('0x53')](config[_0x5a82('0x54')],_0x5a82('0x55'),_0x2ec568[_0x5a82('0x50')]+'.'+_0x2ec568[_0x5a82('0x51')]))){throw new db[(_0x5a82('0x56'))][(_0x5a82('0x57'))]('Sound\x20not\x20found');}return _0x382c55[_0x5a82('0x4f')](path[_0x5a82('0x53')](config['root'],_0x5a82('0x55'),util[_0x5a82('0x58')](_0x5a82('0x59'),_0x2ec568[_0x5a82('0x50')],_0x2ec568[_0x5a82('0x51')])),util[_0x5a82('0x58')](_0x5a82('0x59'),_0x2ec568[_0x5a82('0x30')],_0x2ec568[_0x5a82('0x51')]));}return null;})[_0x5a82('0x4e')](handleError(_0x382c55,null));};exports['create']=function(_0x16d770,_0x124b08,_0x3d239b){var _0x242a6e={'name':path[_0x5a82('0x5a')](_0x16d770[_0x5a82('0x5b')][_0x5a82('0x5c')],path[_0x5a82('0x5d')](_0x16d770[_0x5a82('0x5b')][_0x5a82('0x5c')])),'save_name':path[_0x5a82('0x5a')](_0x16d770[_0x5a82('0x5b')][_0x5a82('0x5e')],path[_0x5a82('0x5d')](_0x16d770[_0x5a82('0x5b')][_0x5a82('0x5e')])),'original_format':path['extname'](_0x16d770[_0x5a82('0x5b')]['originalname'])[_0x5a82('0x5f')](0x1),'converted_format':'wav'};var _0x4bd2f3=path[_0x5a82('0x53')](config[_0x5a82('0x54')],'server/files/sounds/original',_0x16d770[_0x5a82('0x5b')][_0x5a82('0x5e')]);var _0x5cd377=path[_0x5a82('0x53')](config['root'],_0x5a82('0x55'),util[_0x5a82('0x58')]('%s.%s',path['basename'](_0x16d770[_0x5a82('0x5b')]['filename'],path[_0x5a82('0x5d')](_0x16d770[_0x5a82('0x5b')][_0x5a82('0x5e')])),_0x242a6e[_0x5a82('0x51')]));logger[_0x5a82('0x60')]('Sound\x20upload\x20filepath:\x20%s',_0x4bd2f3);logger['info'](_0x5a82('0x61'),_0x5cd377);try{fs['chmodSync'](_0x4bd2f3,parseInt(_0x5a82('0x62'),0x8));var _0x35615b=sox[_0x5a82('0x63')](_0x4bd2f3,_0x5cd377,{'sampleRate':0x1f40,'format':_0x5a82('0x64'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x35615b['on'](_0x5a82('0x2e'),function(_0x38bfcc){fs[_0x5a82('0x65')](_0x4bd2f3);_0x124b08[_0x5a82('0x22')](0x1f4)[_0x5a82('0x66')](_0x38bfcc);});_0x35615b['on'](_0x5a82('0x67'),function(_0x46a803){_0x242a6e[_0x5a82('0x68')]=isNaN(_0x46a803[_0x5a82('0x69')])?null:_0x46a803[_0x5a82('0x69')]*0x3e8;_0x242a6e[_0x5a82('0x6a')]=isNaN(_0x46a803[_0x5a82('0x6b')])?null:_0x46a803[_0x5a82('0x6b')];_0x242a6e[_0x5a82('0x6c')]=isNaN(_0x46a803[_0x5a82('0x6d')])?null:_0x46a803[_0x5a82('0x6d')];_0x242a6e[_0x5a82('0x6e')]=isNaN(_0x46a803[_0x5a82('0x6f')])?null:_0x46a803['bitRate'];_0x242a6e[_0x5a82('0x70')]=isNaN(_0x46a803[_0x5a82('0x71')])?null:_0x46a803[_0x5a82('0x71')];});_0x35615b['on']('dest',function(_0x2add73){_0x242a6e['converted_duration']=isNaN(_0x2add73[_0x5a82('0x69')])?null:_0x2add73[_0x5a82('0x69')]*0x3e8;_0x242a6e[_0x5a82('0x72')]=isNaN(_0x2add73[_0x5a82('0x6b')])?null:_0x2add73['sampleCount'];_0x242a6e['converted_channelCount']=isNaN(_0x2add73[_0x5a82('0x6d')])?null:_0x2add73['channelCount'];_0x242a6e[_0x5a82('0x73')]=isNaN(_0x2add73[_0x5a82('0x6f')])?null:_0x2add73[_0x5a82('0x6f')];_0x242a6e[_0x5a82('0x74')]=isNaN(_0x2add73[_0x5a82('0x71')])?null:_0x2add73[_0x5a82('0x71')];});_0x35615b['on'](_0x5a82('0x1c'),function(){fs[_0x5a82('0x75')](_0x5cd377,parseInt(_0x5a82('0x62'),0x8));return db[_0x5a82('0x45')][_0x5a82('0x76')](_0x242a6e)[_0x5a82('0x29')](function(_0x2f122e){var _0x3cdb13={'role':_0x16d770[_0x5a82('0x77')][_0x5a82('0x78')],'userProfileId':_0x16d770[_0x5a82('0x77')]['userProfileId']};if(!_0x3cdb13)throw new Error(_0x5a82('0x79'));if(_0x3cdb13['role']===_0x5a82('0x7a')){var _0x3e8325=_0x2f122e[_0x5a82('0x2b')]({'plain':!![]});return db[_0x5a82('0x7b')][_0x5a82('0x4d')]({'where':{'name':_0x5a82('0x2c'),'userProfileId':_0x3cdb13['userProfileId']},'raw':!![]})[_0x5a82('0x29')](function(_0x3c0319){if(_0x3c0319&&_0x3c0319[_0x5a82('0x7c')]===0x0){return db['UserProfileResource'][_0x5a82('0x76')]({'name':_0x3e8325[_0x5a82('0x30')],'resourceId':_0x3e8325['id'],'type':_0x3c0319[_0x5a82('0x30')],'sectionId':_0x3c0319['id']},{})[_0x5a82('0x29')](function(){return _0x2f122e;});}else{return _0x2f122e;}})[_0x5a82('0x4e')](function(_0x573324){logger[_0x5a82('0x2e')](_0x5a82('0x7d'),_0x573324);throw _0x573324;});}return _0x2f122e;})[_0x5a82('0x29')](respondWithResult(_0x124b08,null))['catch'](handleError(_0x124b08,null));});_0x35615b['start']();}catch(_0x2e2d39){_0x124b08[_0x5a82('0x22')](0x1f4)[_0x5a82('0x66')](_0x2e2d39);}};exports[_0x5a82('0x28')]=function(_0x3018ce,_0x50f075,_0x5f4464){return db[_0x5a82('0x45')]['find']({'where':{'id':_0x3018ce[_0x5a82('0x49')]['id']}})['then'](handleEntityNotFound(_0x50f075,null))[_0x5a82('0x29')](saveUpdates(_[_0x5a82('0x41')](_0x3018ce['body'],[_0x5a82('0x30'),_0x5a82('0x7e')]),null))[_0x5a82('0x29')](respondWithResult(_0x50f075,null))['catch'](handleError(_0x50f075,null));};exports[_0x5a82('0x7f')]=function(_0x3eba9b,_0x439707,_0x199661){return db[_0x5a82('0x45')][_0x5a82('0x4d')]({'where':{'id':_0x3eba9b[_0x5a82('0x49')]['id']}})[_0x5a82('0x29')](function(_0x52ef8b){if(_0x52ef8b){return _0x52ef8b[_0x5a82('0x2a')]();}})['then'](function(_0x1efe47){var _0xa479c=path['join'](config[_0x5a82('0x54')],_0x5a82('0x80'),util[_0x5a82('0x58')](_0x5a82('0x59'),_0x1efe47[_0x5a82('0x50')],_0x1efe47[_0x5a82('0x81')]));var _0x5c72fd=path[_0x5a82('0x53')](config[_0x5a82('0x54')],_0x5a82('0x55'),util[_0x5a82('0x58')](_0x5a82('0x59'),_0x1efe47[_0x5a82('0x50')],_0x1efe47['converted_format']));fs[_0x5a82('0x65')](_0xa479c);fs[_0x5a82('0x65')](_0x5c72fd);return _0x1efe47;})[_0x5a82('0x29')](function(_0x5313c2){if(_0x5313c2){return _0x439707[_0x5a82('0x22')](0xcc)['end']();}})[_0x5a82('0x29')](handleEntityNotFound(_0x439707,null))[_0x5a82('0x4e')](handleError(_0x439707,null));}; \ No newline at end of file +var _0x5800=['query','filters','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','rows','catch','show','params','keys','intersection','find','save_name','converted_format','existsSync','join','root','server/files/sounds/converted','Sequelize','ValidationError','Sound\x20not\x20found','download','format','%s.%s','create','basename','file','originalname','extname','filename','substring','wav','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','0777','transcode','unlinkSync','src','original_duration','duration','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_bitRate','converted_sampleRate','chmodSync','body','role','userProfileId','user','get','UserProfileSection','autoAssociation','start','update','delete','original_format','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','limit','set','Content-Range','save','then','destroy','Sounds','UserProfileResource','end','error','name','send','index','map','Sound','rawAttributes','fieldName','type','key','model'];(function(_0x426442,_0x152382){var _0x37b69a=function(_0x39b306){while(--_0x39b306){_0x426442['push'](_0x426442['shift']());}};_0x37b69a(++_0x152382);}(_0x5800,0xc3));var _0x0580=function(_0x135f39,_0x3623e2){_0x135f39=_0x135f39-0x0;var _0x5e9e09=_0x5800[_0x135f39];return _0x5e9e09;};'use strict';var emlformat=require(_0x0580('0x0'));var rimraf=require(_0x0580('0x1'));var zipdir=require(_0x0580('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0580('0x3'));var moment=require(_0x0580('0x4'));var BPromise=require(_0x0580('0x5'));var Mustache=require(_0x0580('0x6'));var util=require(_0x0580('0x7'));var path=require('path');var sox=require(_0x0580('0x8'));var csv=require('to-csv');var ejs=require(_0x0580('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x0580('0xa'));var crypto=require(_0x0580('0xb'));var jsforce=require(_0x0580('0xc'));var deskjs=require(_0x0580('0xd'));var toCsv=require(_0x0580('0xe'));var querystring=require(_0x0580('0xf'));var Papa=require(_0x0580('0x10'));var Redis=require(_0x0580('0x11'));var authService=require(_0x0580('0x12'));var qs=require(_0x0580('0x13'));var as=require(_0x0580('0x14'));var hardwareService=require(_0x0580('0x15'));var logger=require('../../config/logger')(_0x0580('0x16'));var utils=require(_0x0580('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x0580('0x18'));var db=require(_0x0580('0x19'))['db'];function respondWithStatusCode(_0x3b87d6,_0x31f8d4){_0x31f8d4=_0x31f8d4||0xcc;return function(_0x2c933c){if(_0x2c933c){return _0x3b87d6['sendStatus'](_0x31f8d4);}return _0x3b87d6[_0x0580('0x1a')](_0x31f8d4)['end']();};}function respondWithResult(_0x2507bf,_0x49b2a5){_0x49b2a5=_0x49b2a5||0xc8;return function(_0x573a6a){if(_0x573a6a){return _0x2507bf[_0x0580('0x1a')](_0x49b2a5)[_0x0580('0x1b')](_0x573a6a);}};}function respondWithFilteredResult(_0x43756d,_0x30b1a8){return function(_0x545756){if(_0x545756){var _0x552933=typeof _0x30b1a8[_0x0580('0x1c')]===_0x0580('0x1d')&&typeof _0x30b1a8['limit']===_0x0580('0x1d');var _0x30eed7=_0x545756[_0x0580('0x1e')];var _0x46fecd=_0x552933?0x0:_0x30b1a8[_0x0580('0x1c')];var _0x5c89a2=_0x552933?_0x545756[_0x0580('0x1e')]:_0x30b1a8[_0x0580('0x1c')]+_0x30b1a8[_0x0580('0x1f')];var _0x4197b6;if(_0x5c89a2>=_0x30eed7){_0x5c89a2=_0x30eed7;_0x4197b6=0xc8;}else{_0x4197b6=0xce;}_0x43756d['status'](_0x4197b6);return _0x43756d[_0x0580('0x20')](_0x0580('0x21'),_0x46fecd+'-'+_0x5c89a2+'/'+_0x30eed7)[_0x0580('0x1b')](_0x545756);}return null;};}function patchUpdates(_0x190610){return function(_0x295d24){try{jsonpatch['apply'](_0x295d24,_0x190610,!![]);}catch(_0x3cb506){return BPromise['reject'](_0x3cb506);}return _0x295d24[_0x0580('0x22')]();};}function saveUpdates(_0xe3e4d1,_0x46f03d){return function(_0x375617){if(_0x375617){return _0x375617['update'](_0xe3e4d1)[_0x0580('0x23')](function(_0x34a49d){return _0x34a49d;});}return null;};}function removeEntity(_0x38347c,_0x3be8a9){return function(_0x48d76c){if(_0x48d76c){return _0x48d76c[_0x0580('0x24')]()['then'](function(){var _0x482309=_0x48d76c['get']({'plain':!![]});var _0x3edea9=_0x0580('0x25');return db[_0x0580('0x26')][_0x0580('0x24')]({'where':{'type':_0x3edea9,'resourceId':_0x482309['id']}})[_0x0580('0x23')](function(){return _0x48d76c;});})[_0x0580('0x23')](function(){_0x38347c[_0x0580('0x1a')](0xcc)[_0x0580('0x27')]();});}};}function handleEntityNotFound(_0x1ec07d,_0x1e9ffa){return function(_0x30eae7){if(!_0x30eae7){_0x1ec07d['sendStatus'](0x194);}return _0x30eae7;};}function handleError(_0x520c9e,_0x8cdaca){_0x8cdaca=_0x8cdaca||0x1f4;return function(_0x5eb122){logger[_0x0580('0x28')](_0x5eb122['stack']);if(_0x5eb122[_0x0580('0x29')]){delete _0x5eb122[_0x0580('0x29')];}_0x520c9e[_0x0580('0x1a')](_0x8cdaca)[_0x0580('0x2a')](_0x5eb122);};}exports[_0x0580('0x2b')]=function(_0x118380,_0x4e1653){var _0xa10f6a={},_0xa1eaec={},_0x200be8={'count':0x0,'rows':[]};var _0x55e58b=_[_0x0580('0x2c')](db[_0x0580('0x2d')][_0x0580('0x2e')],function(_0x2b8378){return{'name':_0x2b8378[_0x0580('0x2f')],'type':_0x2b8378[_0x0580('0x30')][_0x0580('0x31')]};});_0xa1eaec[_0x0580('0x32')]=_['map'](_0x55e58b,_0x0580('0x29'));_0xa1eaec[_0x0580('0x33')]=_['keys'](_0x118380[_0x0580('0x33')]);_0xa1eaec[_0x0580('0x34')]=_['intersection'](_0xa1eaec[_0x0580('0x32')],_0xa1eaec['query']);_0xa10f6a[_0x0580('0x35')]=_['intersection'](_0xa1eaec[_0x0580('0x32')],qs['fields'](_0x118380['query'][_0x0580('0x36')]));_0xa10f6a[_0x0580('0x35')]=_0xa10f6a[_0x0580('0x35')][_0x0580('0x37')]?_0xa10f6a[_0x0580('0x35')]:_0xa1eaec['model'];if(!_0x118380[_0x0580('0x33')][_0x0580('0x38')]('nolimit')){_0xa10f6a[_0x0580('0x1f')]=qs[_0x0580('0x1f')](_0x118380[_0x0580('0x33')][_0x0580('0x1f')]);_0xa10f6a['offset']=qs[_0x0580('0x1c')](_0x118380['query']['offset']);}_0xa10f6a[_0x0580('0x39')]=qs[_0x0580('0x3a')](_0x118380[_0x0580('0x33')][_0x0580('0x3a')]);_0xa10f6a[_0x0580('0x3b')]=qs[_0x0580('0x34')](_[_0x0580('0x3c')](_0x118380[_0x0580('0x33')],_0xa1eaec[_0x0580('0x34')]),_0x55e58b);if(_0x118380['query'][_0x0580('0x3d')]){_0xa10f6a[_0x0580('0x3b')]=_[_0x0580('0x3e')](_0xa10f6a['where'],{'$or':_[_0x0580('0x2c')](_0x55e58b,function(_0x4c8749){if(_0x4c8749[_0x0580('0x30')]!=='VIRTUAL'){var _0x49aab3={};_0x49aab3[_0x4c8749['name']]={'$like':'%'+_0x118380[_0x0580('0x33')][_0x0580('0x3d')]+'%'};return _0x49aab3;}})});}_0xa10f6a=_['merge']({},_0xa10f6a,_0x118380[_0x0580('0x3f')]);var _0x5c7e3c={'where':_0xa10f6a['where']};return db['Sound']['count'](_0x5c7e3c)[_0x0580('0x23')](function(_0x231073){_0x200be8[_0x0580('0x1e')]=_0x231073;if(_0x118380['query']['includeAll']){_0xa10f6a['include']=[{'all':!![]}];}return db[_0x0580('0x2d')]['findAll'](_0xa10f6a);})[_0x0580('0x23')](function(_0x369f5d){_0x200be8[_0x0580('0x40')]=_0x369f5d;return _0x200be8;})['then'](respondWithFilteredResult(_0x4e1653,_0xa10f6a))[_0x0580('0x41')](handleError(_0x4e1653,null));};exports[_0x0580('0x42')]=function(_0x3b0b0b,_0x1ddba0){var _0x1bb0a7={'raw':!![],'where':{'id':_0x3b0b0b[_0x0580('0x43')]['id']}},_0x593e03={};_0x593e03[_0x0580('0x32')]=_['keys'](db[_0x0580('0x2d')][_0x0580('0x2e')]);_0x593e03['query']=_[_0x0580('0x44')](_0x3b0b0b['query']);_0x593e03[_0x0580('0x34')]=_['intersection'](_0x593e03[_0x0580('0x32')],_0x593e03[_0x0580('0x33')]);_0x1bb0a7[_0x0580('0x35')]=_[_0x0580('0x45')](_0x593e03['model'],qs['fields'](_0x3b0b0b['query']['fields']));_0x1bb0a7[_0x0580('0x35')]=_0x1bb0a7[_0x0580('0x35')][_0x0580('0x37')]?_0x1bb0a7[_0x0580('0x35')]:_0x593e03['model'];if(_0x3b0b0b[_0x0580('0x33')]['includeAll']){_0x1bb0a7['include']=[{'all':!![]}];}_0x1bb0a7=_[_0x0580('0x3e')]({},_0x1bb0a7,_0x3b0b0b[_0x0580('0x3f')]);return db[_0x0580('0x2d')][_0x0580('0x46')](_0x1bb0a7)[_0x0580('0x23')](handleEntityNotFound(_0x1ddba0,null))['then'](respondWithResult(_0x1ddba0,null))[_0x0580('0x41')](handleError(_0x1ddba0,null));};exports['download']=function(_0x4e472e,_0x7927d3,_0x55ef4d){return db[_0x0580('0x2d')][_0x0580('0x46')]({'where':{'id':_0x4e472e['params']['id']},'attributes':[_0x0580('0x29'),_0x0580('0x47'),_0x0580('0x48')],'raw':!![]})[_0x0580('0x23')](handleEntityNotFound(_0x7927d3,null))[_0x0580('0x23')](function(_0x2567eb){if(_0x2567eb){if(!fs[_0x0580('0x49')](path[_0x0580('0x4a')](config[_0x0580('0x4b')],_0x0580('0x4c'),_0x2567eb[_0x0580('0x47')]+'.'+_0x2567eb['converted_format']))){throw new db[(_0x0580('0x4d'))][(_0x0580('0x4e'))](_0x0580('0x4f'));}return _0x7927d3[_0x0580('0x50')](path[_0x0580('0x4a')](config[_0x0580('0x4b')],'server/files/sounds/converted',util[_0x0580('0x51')](_0x0580('0x52'),_0x2567eb['save_name'],_0x2567eb['converted_format'])),util[_0x0580('0x51')](_0x0580('0x52'),_0x2567eb[_0x0580('0x29')],_0x2567eb['converted_format']));}return null;})[_0x0580('0x41')](handleError(_0x7927d3,null));};exports[_0x0580('0x53')]=function(_0x48a43b,_0x21d91a,_0x102b52){var _0x16ca7b={'name':path[_0x0580('0x54')](_0x48a43b[_0x0580('0x55')][_0x0580('0x56')],path[_0x0580('0x57')](_0x48a43b['file'][_0x0580('0x56')])),'save_name':path[_0x0580('0x54')](_0x48a43b[_0x0580('0x55')][_0x0580('0x58')],path[_0x0580('0x57')](_0x48a43b['file'][_0x0580('0x58')])),'original_format':path[_0x0580('0x57')](_0x48a43b['file'][_0x0580('0x56')])[_0x0580('0x59')](0x1),'converted_format':_0x0580('0x5a')};var _0x244798=path[_0x0580('0x4a')](config[_0x0580('0x4b')],_0x0580('0x5b'),_0x48a43b[_0x0580('0x55')][_0x0580('0x58')]);var _0x53156c=path['join'](config[_0x0580('0x4b')],_0x0580('0x4c'),util[_0x0580('0x51')](_0x0580('0x52'),path['basename'](_0x48a43b[_0x0580('0x55')][_0x0580('0x58')],path['extname'](_0x48a43b[_0x0580('0x55')][_0x0580('0x58')])),_0x16ca7b['converted_format']));logger[_0x0580('0x5c')](_0x0580('0x5d'),_0x244798);logger[_0x0580('0x5c')](_0x0580('0x5e'),_0x53156c);try{fs['chmodSync'](_0x244798,parseInt(_0x0580('0x5f'),0x8));var _0x4749b8=sox[_0x0580('0x60')](_0x244798,_0x53156c,{'sampleRate':0x1f40,'format':_0x0580('0x5a'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x4749b8['on']('error',function(_0xd0a249){fs[_0x0580('0x61')](_0x244798);_0x21d91a[_0x0580('0x1a')](0x1f4)[_0x0580('0x2a')](_0xd0a249);});_0x4749b8['on'](_0x0580('0x62'),function(_0x5235dc){_0x16ca7b[_0x0580('0x63')]=isNaN(_0x5235dc['duration'])?null:_0x5235dc[_0x0580('0x64')]*0x3e8;_0x16ca7b['original_sampleCount']=isNaN(_0x5235dc[_0x0580('0x65')])?null:_0x5235dc[_0x0580('0x65')];_0x16ca7b[_0x0580('0x66')]=isNaN(_0x5235dc[_0x0580('0x67')])?null:_0x5235dc['channelCount'];_0x16ca7b[_0x0580('0x68')]=isNaN(_0x5235dc[_0x0580('0x69')])?null:_0x5235dc[_0x0580('0x69')];_0x16ca7b[_0x0580('0x6a')]=isNaN(_0x5235dc[_0x0580('0x6b')])?null:_0x5235dc['sampleRate'];});_0x4749b8['on'](_0x0580('0x6c'),function(_0x16924e){_0x16ca7b['converted_duration']=isNaN(_0x16924e[_0x0580('0x64')])?null:_0x16924e['duration']*0x3e8;_0x16ca7b['converted_sampleCount']=isNaN(_0x16924e[_0x0580('0x65')])?null:_0x16924e[_0x0580('0x65')];_0x16ca7b['converted_channelCount']=isNaN(_0x16924e[_0x0580('0x67')])?null:_0x16924e[_0x0580('0x67')];_0x16ca7b[_0x0580('0x6d')]=isNaN(_0x16924e[_0x0580('0x69')])?null:_0x16924e[_0x0580('0x69')];_0x16ca7b[_0x0580('0x6e')]=isNaN(_0x16924e[_0x0580('0x6b')])?null:_0x16924e[_0x0580('0x6b')];});_0x4749b8['on'](_0x0580('0x27'),function(){fs[_0x0580('0x6f')](_0x53156c,parseInt(_0x0580('0x5f'),0x8));return db[_0x0580('0x2d')]['create'](_0x16ca7b)['then'](function(_0x5d2569){var _0x19bd91={'role':_0x48a43b[_0x0580('0x70')][_0x0580('0x71')],'userProfileId':_0x48a43b[_0x0580('0x70')][_0x0580('0x72')]};if(!_0x19bd91)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x19bd91[_0x0580('0x71')]===_0x0580('0x73')){var _0x5bdd1d=_0x5d2569[_0x0580('0x74')]({'plain':!![]});return db[_0x0580('0x75')][_0x0580('0x46')]({'where':{'name':_0x0580('0x25'),'userProfileId':_0x19bd91[_0x0580('0x72')]},'raw':!![]})[_0x0580('0x23')](function(_0x38655b){if(_0x38655b&&_0x38655b[_0x0580('0x76')]===0x0){return db[_0x0580('0x26')][_0x0580('0x53')]({'name':_0x5bdd1d[_0x0580('0x29')],'resourceId':_0x5bdd1d['id'],'type':_0x38655b[_0x0580('0x29')],'sectionId':_0x38655b['id']},{})[_0x0580('0x23')](function(){return _0x5d2569;});}else{return _0x5d2569;}})[_0x0580('0x41')](function(_0x57be16){logger[_0x0580('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x57be16);throw _0x57be16;});}return _0x5d2569;})[_0x0580('0x23')](respondWithResult(_0x21d91a,null))['catch'](handleError(_0x21d91a,null));});_0x4749b8[_0x0580('0x77')]();}catch(_0x53007e){_0x21d91a[_0x0580('0x1a')](0x1f4)[_0x0580('0x2a')](_0x53007e);}};exports[_0x0580('0x78')]=function(_0x3e9b8d,_0x1238cf,_0x3fad49){return db[_0x0580('0x2d')][_0x0580('0x46')]({'where':{'id':_0x3e9b8d['params']['id']}})[_0x0580('0x23')](handleEntityNotFound(_0x1238cf,null))[_0x0580('0x23')](saveUpdates(_[_0x0580('0x3c')](_0x3e9b8d['body'],[_0x0580('0x29'),'description']),null))[_0x0580('0x23')](respondWithResult(_0x1238cf,null))[_0x0580('0x41')](handleError(_0x1238cf,null));};exports[_0x0580('0x79')]=function(_0x261402,_0x35f934,_0xf8fa5a){return db['Sound'][_0x0580('0x46')]({'where':{'id':_0x261402['params']['id']}})['then'](function(_0x2a2159){if(_0x2a2159){return _0x2a2159[_0x0580('0x24')]();}})[_0x0580('0x23')](function(_0x3d9227){var _0x32bcc1=path[_0x0580('0x4a')](config[_0x0580('0x4b')],_0x0580('0x5b'),util[_0x0580('0x51')](_0x0580('0x52'),_0x3d9227[_0x0580('0x47')],_0x3d9227[_0x0580('0x7a')]));var _0x2e90a7=path[_0x0580('0x4a')](config[_0x0580('0x4b')],'server/files/sounds/converted',util[_0x0580('0x51')](_0x0580('0x52'),_0x3d9227[_0x0580('0x47')],_0x3d9227[_0x0580('0x48')]));fs[_0x0580('0x61')](_0x32bcc1);fs[_0x0580('0x61')](_0x2e90a7);return _0x3d9227;})[_0x0580('0x23')](function(_0x5da484){if(_0x5da484){return _0x35f934['status'](0xcc)[_0x0580('0x27')]();}})['then'](handleEntityNotFound(_0x35f934,null))[_0x0580('0x41')](handleError(_0x35f934,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index 1567278..dc354a4 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 _0x5767=['bluebird','rimraf','../../config/environment','./sound.attributes','exports','define','Sound','tools_sounds','util','moment'];(function(_0x5e4751,_0x3b65de){var _0x5e4aeb=function(_0x5bf5e0){while(--_0x5bf5e0){_0x5e4751['push'](_0x5e4751['shift']());}};_0x5e4aeb(++_0x3b65de);}(_0x5767,0x120));var _0x7576=function(_0x55b8f5,_0xe5f57c){_0x55b8f5=_0x55b8f5-0x0;var _0x966086=_0x5767[_0x55b8f5];return _0x966086;};'use strict';var _=require('lodash');var util=require(_0x7576('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x7576('0x1'));var BPromise=require(_0x7576('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x7576('0x3'));var config=require(_0x7576('0x4'));var attributes=require(_0x7576('0x5'));module[_0x7576('0x6')]=function(_0x3c63dd,_0x208ad4){return _0x3c63dd[_0x7576('0x7')](_0x7576('0x8'),attributes,{'tableName':_0x7576('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0b6e=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./sound.attributes','define','Sound','tools_sounds','lodash','util','../../config/logger'];(function(_0x26aded,_0x512143){var _0x3f6429=function(_0x1745be){while(--_0x1745be){_0x26aded['push'](_0x26aded['shift']());}};_0x3f6429(++_0x512143);}(_0x0b6e,0xa6));var _0xe0b6=function(_0x1c4651,_0x404598){_0x1c4651=_0x1c4651-0x0;var _0x179f88=_0x0b6e[_0x1c4651];return _0x179f88;};'use strict';var _=require(_0xe0b6('0x0'));var util=require(_0xe0b6('0x1'));var logger=require(_0xe0b6('0x2'))(_0xe0b6('0x3'));var moment=require(_0xe0b6('0x4'));var BPromise=require(_0xe0b6('0x5'));var rp=require(_0xe0b6('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe0b6('0x7'));var config=require(_0xe0b6('0x8'));var attributes=require(_0xe0b6('0x9'));module['exports']=function(_0x41d46d,_0x13f790){return _0x41d46d[_0xe0b6('0xa')](_0xe0b6('0xb'),attributes,{'tableName':_0xe0b6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/sound/sound.rpc.js b/server/api/sound/sound.rpc.js index 062f062..e372b3c 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 _0x0374=['where','attributes','include','map','model','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','ShowSound','find','raw','options'];(function(_0x53a763,_0x32cebe){var _0x1d980c=function(_0x1ebeba){while(--_0x1ebeba){_0x53a763['push'](_0x53a763['shift']());}};_0x1d980c(++_0x32cebe);}(_0x0374,0x92));var _0x4037=function(_0x37e012,_0x5acfff){_0x37e012=_0x37e012-0x0;var _0x25cc83=_0x0374[_0x37e012];return _0x25cc83;};'use strict';var _=require(_0x4037('0x0'));var util=require(_0x4037('0x1'));var moment=require(_0x4037('0x2'));var BPromise=require(_0x4037('0x3'));var rs=require(_0x4037('0x4'));var fs=require('fs');var Redis=require(_0x4037('0x5'));var db=require(_0x4037('0x6'))['db'];var utils=require(_0x4037('0x7'));var logger=require(_0x4037('0x8'))(_0x4037('0x9'));var config=require(_0x4037('0xa'));var jayson=require(_0x4037('0xb'));var client=jayson[_0x4037('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5f369a,_0x7fafa,_0x18cb3f){return new BPromise(function(_0x5b229b,_0x127df7){return client[_0x4037('0xd')](_0x5f369a,_0x18cb3f)[_0x4037('0xe')](function(_0x1f64f9){logger['info'](_0x4037('0xf'),_0x7fafa,_0x4037('0x10'));logger[_0x4037('0x11')](_0x4037('0x12'),_0x7fafa,_0x4037('0x10'),JSON['stringify'](_0x1f64f9));if(_0x1f64f9[_0x4037('0x13')]){if(_0x1f64f9['error'][_0x4037('0x14')]===0x1f4){logger['error'](_0x4037('0xf'),_0x7fafa,_0x1f64f9[_0x4037('0x13')]['message']);return _0x127df7(_0x1f64f9[_0x4037('0x13')]['message']);}logger[_0x4037('0x13')](_0x4037('0xf'),_0x7fafa,_0x1f64f9['error'][_0x4037('0x15')]);return _0x5b229b(_0x1f64f9[_0x4037('0x13')][_0x4037('0x15')]);}else{logger[_0x4037('0x16')](_0x4037('0xf'),_0x7fafa,_0x4037('0x10'));_0x5b229b(_0x1f64f9[_0x4037('0x17')][_0x4037('0x15')]);}})[_0x4037('0x18')](function(_0x3aad72){logger[_0x4037('0x13')]('Sound,\x20%s,\x20%s',_0x7fafa,_0x3aad72);_0x127df7(_0x3aad72);});});}exports[_0x4037('0x19')]=function(_0x2e2ece){var _0x19abb4=this;return new Promise(function(_0x3e6a2b,_0x3fda54){return db['Sound'][_0x4037('0x1a')]({'raw':_0x2e2ece['options']?_0x2e2ece['options'][_0x4037('0x1b')]===undefined?!![]:![]:!![],'where':_0x2e2ece[_0x4037('0x1c')]?_0x2e2ece[_0x4037('0x1c')][_0x4037('0x1d')]||null:null,'attributes':_0x2e2ece[_0x4037('0x1c')]?_0x2e2ece['options'][_0x4037('0x1e')]||null:null,'include':_0x2e2ece['options']?_0x2e2ece[_0x4037('0x1c')][_0x4037('0x1f')]?_[_0x4037('0x20')](_0x2e2ece[_0x4037('0x1c')][_0x4037('0x1f')],function(_0x1ac2c9){return{'model':db[_0x1ac2c9[_0x4037('0x21')]],'as':_0x1ac2c9['as'],'attributes':_0x1ac2c9[_0x4037('0x1e')],'include':_0x1ac2c9[_0x4037('0x1f')]?_[_0x4037('0x20')](_0x1ac2c9[_0x4037('0x1f')],function(_0x44e27a){return{'model':db[_0x44e27a['model']],'as':_0x44e27a['as'],'attributes':_0x44e27a[_0x4037('0x1e')],'include':_0x44e27a[_0x4037('0x1f')]?_[_0x4037('0x20')](_0x44e27a[_0x4037('0x1f')],function(_0x13a772){return{'model':db[_0x13a772[_0x4037('0x21')]],'as':_0x13a772['as'],'attributes':_0x13a772[_0x4037('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x4037('0xe')](function(_0x2393df){logger['info'](_0x4037('0x19'),_0x2e2ece);logger[_0x4037('0x11')]('ShowSound',_0x2e2ece,JSON[_0x4037('0x22')](_0x2393df));_0x3e6a2b(_0x2393df);})[_0x4037('0x18')](function(_0x375e40){logger[_0x4037('0x13')](_0x4037('0x19'),_0x375e40[_0x4037('0x15')],_0x2e2ece);_0x3fda54(_0x19abb4['error'](0x1f4,_0x375e40['message']));});});}; \ No newline at end of file +var _0x3402=['info','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','Sound','find','options','where','attributes','include','map','model','ShowSound','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','then'];(function(_0x40dcbd,_0x1a9fe5){var _0x1ec7d5=function(_0x32db90){while(--_0x32db90){_0x40dcbd['push'](_0x40dcbd['shift']());}};_0x1ec7d5(++_0x1a9fe5);}(_0x3402,0xde));var _0x2340=function(_0x2726c4,_0x1349af){_0x2726c4=_0x2726c4-0x0;var _0x3891d4=_0x3402[_0x2726c4];return _0x3891d4;};'use strict';var _=require(_0x2340('0x0'));var util=require('util');var moment=require(_0x2340('0x1'));var BPromise=require('bluebird');var rs=require(_0x2340('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2340('0x3'))['db'];var utils=require(_0x2340('0x4'));var logger=require(_0x2340('0x5'))(_0x2340('0x6'));var config=require('../../config/environment');var jayson=require(_0x2340('0x7'));var client=jayson['client'][_0x2340('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4459df,_0x776063,_0x1faadb){return new BPromise(function(_0x4efa4a,_0x37c71e){return client['request'](_0x4459df,_0x1faadb)[_0x2340('0x9')](function(_0x32c7d9){logger[_0x2340('0xa')](_0x2340('0xb'),_0x776063,_0x2340('0xc'));logger[_0x2340('0xd')](_0x2340('0xe'),_0x776063,_0x2340('0xc'),JSON[_0x2340('0xf')](_0x32c7d9));if(_0x32c7d9[_0x2340('0x10')]){if(_0x32c7d9[_0x2340('0x10')]['code']===0x1f4){logger[_0x2340('0x10')](_0x2340('0xb'),_0x776063,_0x32c7d9[_0x2340('0x10')][_0x2340('0x11')]);return _0x37c71e(_0x32c7d9['error'][_0x2340('0x11')]);}logger[_0x2340('0x10')](_0x2340('0xb'),_0x776063,_0x32c7d9[_0x2340('0x10')][_0x2340('0x11')]);return _0x4efa4a(_0x32c7d9[_0x2340('0x10')][_0x2340('0x11')]);}else{logger[_0x2340('0xa')](_0x2340('0xb'),_0x776063,_0x2340('0xc'));_0x4efa4a(_0x32c7d9[_0x2340('0x12')]['message']);}})[_0x2340('0x13')](function(_0x432e5e){logger['error']('Sound,\x20%s,\x20%s',_0x776063,_0x432e5e);_0x37c71e(_0x432e5e);});});}exports['ShowSound']=function(_0x1cf83e){var _0x4936fd=this;return new Promise(function(_0x380d66,_0x297439){return db[_0x2340('0x14')][_0x2340('0x15')]({'raw':_0x1cf83e[_0x2340('0x16')]?_0x1cf83e[_0x2340('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x1cf83e[_0x2340('0x16')]?_0x1cf83e[_0x2340('0x16')][_0x2340('0x17')]||null:null,'attributes':_0x1cf83e[_0x2340('0x16')]?_0x1cf83e['options'][_0x2340('0x18')]||null:null,'include':_0x1cf83e['options']?_0x1cf83e[_0x2340('0x16')][_0x2340('0x19')]?_[_0x2340('0x1a')](_0x1cf83e[_0x2340('0x16')]['include'],function(_0x291110){return{'model':db[_0x291110['model']],'as':_0x291110['as'],'attributes':_0x291110['attributes'],'include':_0x291110[_0x2340('0x19')]?_[_0x2340('0x1a')](_0x291110[_0x2340('0x19')],function(_0x2e29c4){return{'model':db[_0x2e29c4[_0x2340('0x1b')]],'as':_0x2e29c4['as'],'attributes':_0x2e29c4[_0x2340('0x18')],'include':_0x2e29c4['include']?_['map'](_0x2e29c4[_0x2340('0x19')],function(_0x342e94){return{'model':db[_0x342e94[_0x2340('0x1b')]],'as':_0x342e94['as'],'attributes':_0x342e94[_0x2340('0x18')]};}):[]};}):[]};}):[]:[]})[_0x2340('0x9')](function(_0x50ba42){logger[_0x2340('0xa')](_0x2340('0x1c'),_0x1cf83e);logger[_0x2340('0xd')](_0x2340('0x1c'),_0x1cf83e,JSON['stringify'](_0x50ba42));_0x380d66(_0x50ba42);})[_0x2340('0x13')](function(_0x29757b){logger[_0x2340('0x10')](_0x2340('0x1c'),_0x29757b['message'],_0x1cf83e);_0x297439(_0x4936fd[_0x2340('0x10')](0x1f4,_0x29757b[_0x2340('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index 665b75d..5816c74 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 _0x8603=['../../components/interaction/service','./squareMessage.controller','isAuthenticated','index','get','/:id','create','put','update','exports','util','path','connect-timeout','fs-extra','../../components/auth/service'];(function(_0xa6cb09,_0x39410f){var _0x12b437=function(_0x1813cc){while(--_0x1813cc){_0xa6cb09['push'](_0xa6cb09['shift']());}};_0x12b437(++_0x39410f);}(_0x8603,0x190));var _0x3860=function(_0xf74ddb,_0x8383bd){_0xf74ddb=_0xf74ddb-0x0;var _0x44e4cd=_0x8603[_0xf74ddb];return _0x44e4cd;};'use strict';var multer=require('multer');var util=require(_0x3860('0x0'));var path=require(_0x3860('0x1'));var timeout=require(_0x3860('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x3860('0x3'));var auth=require(_0x3860('0x4'));var interaction=require(_0x3860('0x5'));var config=require('../../config/environment');var controller=require(_0x3860('0x6'));router['get']('/',auth[_0x3860('0x7')](),controller[_0x3860('0x8')]);router[_0x3860('0x9')](_0x3860('0xa'),auth[_0x3860('0x7')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x3860('0xb')]);router[_0x3860('0xc')]('/:id',auth[_0x3860('0x7')](),controller[_0x3860('0xd')]);router['delete'](_0x3860('0xa'),auth[_0x3860('0x7')](),controller['destroy']);module[_0x3860('0xe')]=router; \ No newline at end of file +var _0xb7e7=['exports','multer','path','express','fs-extra','../../components/interaction/service','../../config/environment','./squareMessage.controller','index','get','/:id','show','post','isAuthenticated','create','put','delete','destroy'];(function(_0x51992c,_0x1cd557){var _0x3c004a=function(_0x1629db){while(--_0x1629db){_0x51992c['push'](_0x51992c['shift']());}};_0x3c004a(++_0x1cd557);}(_0xb7e7,0x121));var _0x7b7e=function(_0x1b7368,_0x3286ed){_0x1b7368=_0x1b7368-0x0;var _0x25d54c=_0xb7e7[_0x1b7368];return _0x25d54c;};'use strict';var multer=require(_0x7b7e('0x0'));var util=require('util');var path=require(_0x7b7e('0x1'));var timeout=require('connect-timeout');var express=require(_0x7b7e('0x2'));var router=express['Router']();var fs_extra=require(_0x7b7e('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var controller=require(_0x7b7e('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x7b7e('0x7')]);router[_0x7b7e('0x8')](_0x7b7e('0x9'),auth['isAuthenticated'](),controller[_0x7b7e('0xa')]);router[_0x7b7e('0xb')]('/',auth[_0x7b7e('0xc')](),controller[_0x7b7e('0xd')]);router[_0x7b7e('0xe')](_0x7b7e('0x9'),auth[_0x7b7e('0xc')](),controller['update']);router[_0x7b7e('0xf')](_0x7b7e('0x9'),auth[_0x7b7e('0xc')](),controller[_0x7b7e('0x10')]);module[_0x7b7e('0x11')]=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index d017bde..2c2f453 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 _0xe2d4=['sequelize','TEXT','medium','ENUM','out','STRING'];(function(_0xd63e3a,_0x1bd6eb){var _0x19c178=function(_0x56be0d){while(--_0x56be0d){_0xd63e3a['push'](_0xd63e3a['shift']());}};_0x19c178(++_0x1bd6eb);}(_0xe2d4,0x1bc));var _0x4e2d=function(_0x1fb25a,_0xdd188c){_0x1fb25a=_0x1fb25a-0x0;var _0x433829=_0xe2d4[_0x1fb25a];return _0x433829;};'use strict';var Sequelize=require(_0x4e2d('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING']},'body':{'type':Sequelize[_0x4e2d('0x1')](_0x4e2d('0x2')),'allowNull':![]},'direction':{'type':Sequelize[_0x4e2d('0x3')]('in',_0x4e2d('0x4')),'defaultValue':'out','allowNull':![]},'providerName':{'type':Sequelize[_0x4e2d('0x5')]},'providerResponse':{'type':Sequelize[_0x4e2d('0x1')]}}; \ No newline at end of file +var _0x6f5b=['medium','ENUM','out','sequelize','exports','STRING','TEXT'];(function(_0x573a42,_0x364e60){var _0x45b48a=function(_0x175aa6){while(--_0x175aa6){_0x573a42['push'](_0x573a42['shift']());}};_0x45b48a(++_0x364e60);}(_0x6f5b,0x6c));var _0xb6f5=function(_0x3dab0f,_0x2e0806){_0x3dab0f=_0x3dab0f-0x0;var _0x135382=_0x6f5b[_0x3dab0f];return _0x135382;};'use strict';var Sequelize=require(_0xb6f5('0x0'));module[_0xb6f5('0x1')]={'uniqueid':{'type':Sequelize[_0xb6f5('0x2')]},'body':{'type':Sequelize[_0xb6f5('0x3')](_0xb6f5('0x4')),'allowNull':![]},'direction':{'type':Sequelize[_0xb6f5('0x5')]('in',_0xb6f5('0x6')),'defaultValue':_0xb6f5('0x6'),'allowNull':![]},'providerName':{'type':Sequelize[_0xb6f5('0x2')]},'providerResponse':{'type':Sequelize[_0xb6f5('0x3')]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index b3e9369..d913ed2 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 _0x556a=['model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','rows','catch','params','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','reject','update','then','destroy','stack','name','send','index','map','SquareMessage','rawAttributes','fieldName','key'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0x556a,0x1dd));var _0xa556=function(_0x392c0d,_0x141ec5){_0x392c0d=_0x392c0d-0x0;var _0x17e69a=_0x556a[_0x392c0d];return _0x17e69a;};'use strict';var emlformat=require(_0xa556('0x0'));var rimraf=require(_0xa556('0x1'));var zipdir=require(_0xa556('0x2'));var jsonpatch=require(_0xa556('0x3'));var rp=require(_0xa556('0x4'));var moment=require(_0xa556('0x5'));var BPromise=require(_0xa556('0x6'));var Mustache=require(_0xa556('0x7'));var util=require(_0xa556('0x8'));var path=require('path');var sox=require(_0xa556('0x9'));var csv=require(_0xa556('0xa'));var ejs=require(_0xa556('0xb'));var fs=require('fs');var fs_extra=require(_0xa556('0xc'));var _=require(_0xa556('0xd'));var squel=require('squel');var crypto=require(_0xa556('0xe'));var jsforce=require(_0xa556('0xf'));var deskjs=require(_0xa556('0x10'));var toCsv=require(_0xa556('0xa'));var querystring=require('querystring');var Papa=require(_0xa556('0x11'));var Redis=require(_0xa556('0x12'));var authService=require(_0xa556('0x13'));var qs=require(_0xa556('0x14'));var as=require(_0xa556('0x15'));var hardwareService=require(_0xa556('0x16'));var logger=require(_0xa556('0x17'))(_0xa556('0x18'));var utils=require('../../config/utils');var config=require(_0xa556('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xa556('0x1a'))['db'];function respondWithStatusCode(_0x552788,_0x562211){_0x562211=_0x562211||0xcc;return function(_0x2de803){if(_0x2de803){return _0x552788[_0xa556('0x1b')](_0x562211);}return _0x552788[_0xa556('0x1c')](_0x562211)[_0xa556('0x1d')]();};}function respondWithResult(_0x59b04e,_0x2f20cb){_0x2f20cb=_0x2f20cb||0xc8;return function(_0x10f9bc){if(_0x10f9bc){return _0x59b04e[_0xa556('0x1c')](_0x2f20cb)[_0xa556('0x1e')](_0x10f9bc);}};}function respondWithFilteredResult(_0x1f8b7c,_0x570ed0){return function(_0x5cee6c){if(_0x5cee6c){var _0xbdb988=typeof _0x570ed0[_0xa556('0x1f')]==='undefined'&&typeof _0x570ed0[_0xa556('0x20')]==='undefined';var _0x47b96a=_0x5cee6c[_0xa556('0x21')];var _0x529879=_0xbdb988?0x0:_0x570ed0[_0xa556('0x1f')];var _0x46b205=_0xbdb988?_0x5cee6c[_0xa556('0x21')]:_0x570ed0[_0xa556('0x1f')]+_0x570ed0['limit'];var _0x452e6f;if(_0x46b205>=_0x47b96a){_0x46b205=_0x47b96a;_0x452e6f=0xc8;}else{_0x452e6f=0xce;}_0x1f8b7c[_0xa556('0x1c')](_0x452e6f);return _0x1f8b7c[_0xa556('0x22')]('Content-Range',_0x529879+'-'+_0x46b205+'/'+_0x47b96a)[_0xa556('0x1e')](_0x5cee6c);}return null;};}function patchUpdates(_0x11ab73){return function(_0x5bfa4d){try{jsonpatch['apply'](_0x5bfa4d,_0x11ab73,!![]);}catch(_0x31c8c6){return BPromise[_0xa556('0x23')](_0x31c8c6);}return _0x5bfa4d['save']();};}function saveUpdates(_0x22e9d0,_0x50bc16){return function(_0x22718a){if(_0x22718a){return _0x22718a[_0xa556('0x24')](_0x22e9d0)[_0xa556('0x25')](function(_0x39cae2){return _0x39cae2;});}return null;};}function removeEntity(_0x3e8628,_0xfb4dda){return function(_0x1bcecb){if(_0x1bcecb){return _0x1bcecb[_0xa556('0x26')]()[_0xa556('0x25')](function(){_0x3e8628[_0xa556('0x1c')](0xcc)[_0xa556('0x1d')]();});}};}function handleEntityNotFound(_0xec6fbb,_0x4bf442){return function(_0x2ca8b6){if(!_0x2ca8b6){_0xec6fbb[_0xa556('0x1b')](0x194);}return _0x2ca8b6;};}function handleError(_0x518557,_0x20ec86){_0x20ec86=_0x20ec86||0x1f4;return function(_0x169d01){logger['error'](_0x169d01[_0xa556('0x27')]);if(_0x169d01[_0xa556('0x28')]){delete _0x169d01[_0xa556('0x28')];}_0x518557['status'](_0x20ec86)[_0xa556('0x29')](_0x169d01);};}exports[_0xa556('0x2a')]=function(_0x19f1b8,_0x57da1a){var _0x25dab6={},_0x1f5ce4={},_0x20accc={'count':0x0,'rows':[]};var _0x385fb1=_[_0xa556('0x2b')](db[_0xa556('0x2c')][_0xa556('0x2d')],function(_0x4d0a30){return{'name':_0x4d0a30[_0xa556('0x2e')],'type':_0x4d0a30['type'][_0xa556('0x2f')]};});_0x1f5ce4[_0xa556('0x30')]=_[_0xa556('0x2b')](_0x385fb1,_0xa556('0x28'));_0x1f5ce4[_0xa556('0x31')]=_[_0xa556('0x32')](_0x19f1b8[_0xa556('0x31')]);_0x1f5ce4['filters']=_[_0xa556('0x33')](_0x1f5ce4[_0xa556('0x30')],_0x1f5ce4[_0xa556('0x31')]);_0x25dab6[_0xa556('0x34')]=_[_0xa556('0x33')](_0x1f5ce4[_0xa556('0x30')],qs[_0xa556('0x35')](_0x19f1b8[_0xa556('0x31')][_0xa556('0x35')]));_0x25dab6['attributes']=_0x25dab6[_0xa556('0x34')][_0xa556('0x36')]?_0x25dab6[_0xa556('0x34')]:_0x1f5ce4['model'];if(!_0x19f1b8[_0xa556('0x31')][_0xa556('0x37')](_0xa556('0x38'))){_0x25dab6[_0xa556('0x20')]=qs['limit'](_0x19f1b8[_0xa556('0x31')]['limit']);_0x25dab6[_0xa556('0x1f')]=qs['offset'](_0x19f1b8[_0xa556('0x31')][_0xa556('0x1f')]);}_0x25dab6[_0xa556('0x39')]=qs[_0xa556('0x3a')](_0x19f1b8[_0xa556('0x31')]['sort']);_0x25dab6['where']=qs[_0xa556('0x3b')](_[_0xa556('0x3c')](_0x19f1b8[_0xa556('0x31')],_0x1f5ce4[_0xa556('0x3b')]),_0x385fb1);if(_0x19f1b8[_0xa556('0x31')][_0xa556('0x3d')]){_0x25dab6[_0xa556('0x3e')]=_[_0xa556('0x3f')](_0x25dab6[_0xa556('0x3e')],{'$or':_[_0xa556('0x2b')](_0x385fb1,function(_0x1cd7e0){if(_0x1cd7e0[_0xa556('0x40')]!==_0xa556('0x41')){var _0x3a4d27={};_0x3a4d27[_0x1cd7e0[_0xa556('0x28')]]={'$like':'%'+_0x19f1b8['query'][_0xa556('0x3d')]+'%'};return _0x3a4d27;}})});}_0x25dab6=_[_0xa556('0x3f')]({},_0x25dab6,_0x19f1b8[_0xa556('0x42')]);var _0x2fc959={'where':_0x25dab6['where']};return db[_0xa556('0x2c')][_0xa556('0x21')](_0x2fc959)[_0xa556('0x25')](function(_0x41bc2e){_0x20accc[_0xa556('0x21')]=_0x41bc2e;if(_0x19f1b8['query'][_0xa556('0x43')]){_0x25dab6[_0xa556('0x44')]=[{'all':!![]}];}return db['SquareMessage']['findAll'](_0x25dab6);})[_0xa556('0x25')](function(_0x544579){_0x20accc[_0xa556('0x45')]=_0x544579;return _0x20accc;})['then'](respondWithFilteredResult(_0x57da1a,_0x25dab6))[_0xa556('0x46')](handleError(_0x57da1a,null));};exports['show']=function(_0x483475,_0x48f2dc){var _0x5b405c={'raw':!![],'where':{'id':_0x483475[_0xa556('0x47')]['id']}},_0x3c700e={};_0x3c700e['model']=_[_0xa556('0x32')](db[_0xa556('0x2c')]['rawAttributes']);_0x3c700e['query']=_[_0xa556('0x32')](_0x483475['query']);_0x3c700e['filters']=_['intersection'](_0x3c700e[_0xa556('0x30')],_0x3c700e[_0xa556('0x31')]);_0x5b405c['attributes']=_[_0xa556('0x33')](_0x3c700e[_0xa556('0x30')],qs[_0xa556('0x35')](_0x483475['query']['fields']));_0x5b405c[_0xa556('0x34')]=_0x5b405c[_0xa556('0x34')][_0xa556('0x36')]?_0x5b405c[_0xa556('0x34')]:_0x3c700e[_0xa556('0x30')];if(_0x483475[_0xa556('0x31')]['includeAll']){_0x5b405c['include']=[{'all':!![]}];}_0x5b405c=_['merge']({},_0x5b405c,_0x483475[_0xa556('0x42')]);return db[_0xa556('0x2c')]['find'](_0x5b405c)[_0xa556('0x25')](handleEntityNotFound(_0x48f2dc,null))['then'](respondWithResult(_0x48f2dc,null))[_0xa556('0x46')](handleError(_0x48f2dc,null));};exports[_0xa556('0x48')]=function(_0x213c4d,_0x3cd157){return db['SquareMessage'][_0xa556('0x48')](_0x213c4d[_0xa556('0x49')],{})[_0xa556('0x25')](respondWithResult(_0x3cd157,0xc9))[_0xa556('0x46')](handleError(_0x3cd157,null));};exports[_0xa556('0x24')]=function(_0x64781a,_0x41171c){if(_0x64781a['body']['id']){delete _0x64781a[_0xa556('0x49')]['id'];}return db[_0xa556('0x2c')]['find']({'where':{'id':_0x64781a[_0xa556('0x47')]['id']}})[_0xa556('0x25')](handleEntityNotFound(_0x41171c,null))[_0xa556('0x25')](saveUpdates(_0x64781a['body'],null))[_0xa556('0x25')](respondWithResult(_0x41171c,null))[_0xa556('0x46')](handleError(_0x41171c,null));};exports[_0xa556('0x26')]=function(_0x1256a6,_0x1536eb){return db[_0xa556('0x2c')][_0xa556('0x4a')]({'where':{'id':_0x1256a6[_0xa556('0x47')]['id']}})[_0xa556('0x25')](handleEntityNotFound(_0x1536eb,null))[_0xa556('0x25')](removeEntity(_0x1536eb,null))['catch'](handleError(_0x1536eb,null));}; \ No newline at end of file +var _0x8c43=['crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','save','update','then','destroy','error','name','send','map','SquareMessage','model','query','keys','intersection','fields','attributes','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','rawAttributes','include','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','ejs','lodash','squel'];(function(_0x360fc0,_0x280ca1){var _0x5417f9=function(_0x88a9ea){while(--_0x88a9ea){_0x360fc0['push'](_0x360fc0['shift']());}};_0x5417f9(++_0x280ca1);}(_0x8c43,0x1e5));var _0x38c4=function(_0x21baeb,_0x5039ce){_0x21baeb=_0x21baeb-0x0;var _0x3b444c=_0x8c43[_0x21baeb];return _0x3b444c;};'use strict';var emlformat=require(_0x38c4('0x0'));var rimraf=require(_0x38c4('0x1'));var zipdir=require(_0x38c4('0x2'));var jsonpatch=require(_0x38c4('0x3'));var rp=require(_0x38c4('0x4'));var moment=require('moment');var BPromise=require(_0x38c4('0x5'));var Mustache=require(_0x38c4('0x6'));var util=require('util');var path=require('path');var sox=require(_0x38c4('0x7'));var csv=require(_0x38c4('0x8'));var ejs=require(_0x38c4('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x38c4('0xa'));var squel=require(_0x38c4('0xb'));var crypto=require(_0x38c4('0xc'));var jsforce=require(_0x38c4('0xd'));var deskjs=require(_0x38c4('0xe'));var toCsv=require(_0x38c4('0x8'));var querystring=require(_0x38c4('0xf'));var Papa=require(_0x38c4('0x10'));var Redis=require('ioredis');var authService=require(_0x38c4('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x38c4('0x12'));var hardwareService=require(_0x38c4('0x13'));var logger=require(_0x38c4('0x14'))(_0x38c4('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x38c4('0x16'));var db=require(_0x38c4('0x17'))['db'];function respondWithStatusCode(_0xcc7576,_0x5bbcac){_0x5bbcac=_0x5bbcac||0xcc;return function(_0x42886b){if(_0x42886b){return _0xcc7576[_0x38c4('0x18')](_0x5bbcac);}return _0xcc7576[_0x38c4('0x19')](_0x5bbcac)[_0x38c4('0x1a')]();};}function respondWithResult(_0x5bd524,_0x4d52d2){_0x4d52d2=_0x4d52d2||0xc8;return function(_0x513ea7){if(_0x513ea7){return _0x5bd524['status'](_0x4d52d2)['json'](_0x513ea7);}};}function respondWithFilteredResult(_0x1f0e59,_0x5513c7){return function(_0x10e7c8){if(_0x10e7c8){var _0x521e56=typeof _0x5513c7[_0x38c4('0x1b')]===_0x38c4('0x1c')&&typeof _0x5513c7[_0x38c4('0x1d')]===_0x38c4('0x1c');var _0x45001e=_0x10e7c8[_0x38c4('0x1e')];var _0x5df375=_0x521e56?0x0:_0x5513c7['offset'];var _0x39d616=_0x521e56?_0x10e7c8[_0x38c4('0x1e')]:_0x5513c7['offset']+_0x5513c7[_0x38c4('0x1d')];var _0x5bbcb1;if(_0x39d616>=_0x45001e){_0x39d616=_0x45001e;_0x5bbcb1=0xc8;}else{_0x5bbcb1=0xce;}_0x1f0e59[_0x38c4('0x19')](_0x5bbcb1);return _0x1f0e59['set'](_0x38c4('0x1f'),_0x5df375+'-'+_0x39d616+'/'+_0x45001e)[_0x38c4('0x20')](_0x10e7c8);}return null;};}function patchUpdates(_0x17663a){return function(_0x4304ca){try{jsonpatch[_0x38c4('0x21')](_0x4304ca,_0x17663a,!![]);}catch(_0x22f7a4){return BPromise['reject'](_0x22f7a4);}return _0x4304ca[_0x38c4('0x22')]();};}function saveUpdates(_0x2360cf,_0xe0dc0f){return function(_0xd1c90e){if(_0xd1c90e){return _0xd1c90e[_0x38c4('0x23')](_0x2360cf)[_0x38c4('0x24')](function(_0x4ab306){return _0x4ab306;});}return null;};}function removeEntity(_0x2cc90b,_0x1d1c08){return function(_0x1495b1){if(_0x1495b1){return _0x1495b1[_0x38c4('0x25')]()[_0x38c4('0x24')](function(){_0x2cc90b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x433fa4,_0x3fe828){return function(_0x4cebce){if(!_0x4cebce){_0x433fa4[_0x38c4('0x18')](0x194);}return _0x4cebce;};}function handleError(_0x42e41c,_0x22e3df){_0x22e3df=_0x22e3df||0x1f4;return function(_0x55bc20){logger[_0x38c4('0x26')](_0x55bc20['stack']);if(_0x55bc20[_0x38c4('0x27')]){delete _0x55bc20['name'];}_0x42e41c[_0x38c4('0x19')](_0x22e3df)[_0x38c4('0x28')](_0x55bc20);};}exports['index']=function(_0xba9861,_0x5c1e56){var _0x126f1a={},_0x6c9d1d={},_0x1db9c9={'count':0x0,'rows':[]};var _0x211f77=_[_0x38c4('0x29')](db[_0x38c4('0x2a')]['rawAttributes'],function(_0x37dd6b){return{'name':_0x37dd6b['fieldName'],'type':_0x37dd6b['type']['key']};});_0x6c9d1d[_0x38c4('0x2b')]=_[_0x38c4('0x29')](_0x211f77,_0x38c4('0x27'));_0x6c9d1d[_0x38c4('0x2c')]=_[_0x38c4('0x2d')](_0xba9861[_0x38c4('0x2c')]);_0x6c9d1d['filters']=_[_0x38c4('0x2e')](_0x6c9d1d[_0x38c4('0x2b')],_0x6c9d1d[_0x38c4('0x2c')]);_0x126f1a['attributes']=_['intersection'](_0x6c9d1d[_0x38c4('0x2b')],qs[_0x38c4('0x2f')](_0xba9861[_0x38c4('0x2c')][_0x38c4('0x2f')]));_0x126f1a['attributes']=_0x126f1a[_0x38c4('0x30')][_0x38c4('0x31')]?_0x126f1a['attributes']:_0x6c9d1d[_0x38c4('0x2b')];if(!_0xba9861[_0x38c4('0x2c')]['hasOwnProperty'](_0x38c4('0x32'))){_0x126f1a[_0x38c4('0x1d')]=qs[_0x38c4('0x1d')](_0xba9861['query'][_0x38c4('0x1d')]);_0x126f1a[_0x38c4('0x1b')]=qs[_0x38c4('0x1b')](_0xba9861['query'][_0x38c4('0x1b')]);}_0x126f1a[_0x38c4('0x33')]=qs[_0x38c4('0x34')](_0xba9861[_0x38c4('0x2c')][_0x38c4('0x34')]);_0x126f1a[_0x38c4('0x35')]=qs[_0x38c4('0x36')](_[_0x38c4('0x37')](_0xba9861[_0x38c4('0x2c')],_0x6c9d1d[_0x38c4('0x36')]),_0x211f77);if(_0xba9861[_0x38c4('0x2c')][_0x38c4('0x38')]){_0x126f1a[_0x38c4('0x35')]=_[_0x38c4('0x39')](_0x126f1a[_0x38c4('0x35')],{'$or':_['map'](_0x211f77,function(_0xa2828d){if(_0xa2828d['type']!==_0x38c4('0x3a')){var _0x41baa5={};_0x41baa5[_0xa2828d[_0x38c4('0x27')]]={'$like':'%'+_0xba9861['query']['filter']+'%'};return _0x41baa5;}})});}_0x126f1a=_[_0x38c4('0x39')]({},_0x126f1a,_0xba9861[_0x38c4('0x3b')]);var _0x421baf={'where':_0x126f1a[_0x38c4('0x35')]};return db[_0x38c4('0x2a')][_0x38c4('0x1e')](_0x421baf)['then'](function(_0x42f587){_0x1db9c9[_0x38c4('0x1e')]=_0x42f587;if(_0xba9861[_0x38c4('0x2c')][_0x38c4('0x3c')]){_0x126f1a['include']=[{'all':!![]}];}return db[_0x38c4('0x2a')][_0x38c4('0x3d')](_0x126f1a);})[_0x38c4('0x24')](function(_0xe419){_0x1db9c9[_0x38c4('0x3e')]=_0xe419;return _0x1db9c9;})[_0x38c4('0x24')](respondWithFilteredResult(_0x5c1e56,_0x126f1a))[_0x38c4('0x3f')](handleError(_0x5c1e56,null));};exports[_0x38c4('0x40')]=function(_0x1a235b,_0x14a66c){var _0x48d860={'raw':!![],'where':{'id':_0x1a235b[_0x38c4('0x41')]['id']}},_0x127fd0={};_0x127fd0[_0x38c4('0x2b')]=_[_0x38c4('0x2d')](db[_0x38c4('0x2a')][_0x38c4('0x42')]);_0x127fd0[_0x38c4('0x2c')]=_[_0x38c4('0x2d')](_0x1a235b[_0x38c4('0x2c')]);_0x127fd0[_0x38c4('0x36')]=_['intersection'](_0x127fd0[_0x38c4('0x2b')],_0x127fd0[_0x38c4('0x2c')]);_0x48d860[_0x38c4('0x30')]=_[_0x38c4('0x2e')](_0x127fd0[_0x38c4('0x2b')],qs[_0x38c4('0x2f')](_0x1a235b[_0x38c4('0x2c')][_0x38c4('0x2f')]));_0x48d860[_0x38c4('0x30')]=_0x48d860[_0x38c4('0x30')][_0x38c4('0x31')]?_0x48d860[_0x38c4('0x30')]:_0x127fd0[_0x38c4('0x2b')];if(_0x1a235b['query']['includeAll']){_0x48d860[_0x38c4('0x43')]=[{'all':!![]}];}_0x48d860=_[_0x38c4('0x39')]({},_0x48d860,_0x1a235b[_0x38c4('0x3b')]);return db[_0x38c4('0x2a')][_0x38c4('0x44')](_0x48d860)['then'](handleEntityNotFound(_0x14a66c,null))[_0x38c4('0x24')](respondWithResult(_0x14a66c,null))[_0x38c4('0x3f')](handleError(_0x14a66c,null));};exports['create']=function(_0xb63477,_0x5349be){return db[_0x38c4('0x2a')][_0x38c4('0x45')](_0xb63477['body'],{})['then'](respondWithResult(_0x5349be,0xc9))[_0x38c4('0x3f')](handleError(_0x5349be,null));};exports[_0x38c4('0x23')]=function(_0x4d1f09,_0x199878){if(_0x4d1f09[_0x38c4('0x46')]['id']){delete _0x4d1f09[_0x38c4('0x46')]['id'];}return db['SquareMessage']['find']({'where':{'id':_0x4d1f09['params']['id']}})[_0x38c4('0x24')](handleEntityNotFound(_0x199878,null))[_0x38c4('0x24')](saveUpdates(_0x4d1f09[_0x38c4('0x46')],null))[_0x38c4('0x24')](respondWithResult(_0x199878,null))[_0x38c4('0x3f')](handleError(_0x199878,null));};exports['destroy']=function(_0x103ee5,_0x59dbb0){return db[_0x38c4('0x2a')][_0x38c4('0x44')]({'where':{'id':_0x103ee5[_0x38c4('0x41')]['id']}})[_0x38c4('0x24')](handleEntityNotFound(_0x59dbb0,null))[_0x38c4('0x24')](removeEntity(_0x59dbb0,null))[_0x38c4('0x3f')](handleError(_0x59dbb0,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index 0b15dff..37329fb 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 _0xde87=['moment','bluebird','request-promise','rimraf','./squareMessage.attributes','exports','define','square_messages','lodash','../../config/logger','api'];(function(_0x455b2a,_0x565935){var _0x2bf6d1=function(_0x1ab5f0){while(--_0x1ab5f0){_0x455b2a['push'](_0x455b2a['shift']());}};_0x2bf6d1(++_0x565935);}(_0xde87,0x147));var _0x7de8=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xde87[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x7de8('0x0'));var util=require('util');var logger=require(_0x7de8('0x1'))(_0x7de8('0x2'));var moment=require(_0x7de8('0x3'));var BPromise=require(_0x7de8('0x4'));var rp=require(_0x7de8('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7de8('0x6'));var config=require('../../config/environment');var attributes=require(_0x7de8('0x7'));module[_0x7de8('0x8')]=function(_0x389b86,_0x521ee8){return _0x389b86[_0x7de8('0x9')]('SquareMessage',attributes,{'tableName':_0x7de8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc9e1=['path','rimraf','define','SquareMessage','lodash','../../config/logger','api','moment','request-promise'];(function(_0x4a58eb,_0x5aac55){var _0x1ce75c=function(_0x3d565c){while(--_0x3d565c){_0x4a58eb['push'](_0x4a58eb['shift']());}};_0x1ce75c(++_0x5aac55);}(_0xc9e1,0x109));var _0x1c9e=function(_0x177ddc,_0x23af36){_0x177ddc=_0x177ddc-0x0;var _0x3767a7=_0xc9e1[_0x177ddc];return _0x3767a7;};'use strict';var _=require(_0x1c9e('0x0'));var util=require('util');var logger=require(_0x1c9e('0x1'))(_0x1c9e('0x2'));var moment=require(_0x1c9e('0x3'));var BPromise=require('bluebird');var rp=require(_0x1c9e('0x4'));var fs=require('fs');var path=require(_0x1c9e('0x5'));var rimraf=require(_0x1c9e('0x6'));var config=require('../../config/environment');var attributes=require('./squareMessage.attributes');module['exports']=function(_0x19e751,_0x3fe68a){return _0x19e751[_0x1c9e('0x7')](_0x1c9e('0x8'),attributes,{'tableName':'square_messages','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.rpc.js b/server/api/squareMessage/squareMessage.rpc.js index ffa9767..16bf4c6 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 _0x2c0f=['CreateSquareMessage','SquareMessage','body','options','raw','info','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x31474d,_0x2ad754){var _0x4fd6c6=function(_0x4dd58d){while(--_0x4dd58d){_0x31474d['push'](_0x31474d['shift']());}};_0x4fd6c6(++_0x2ad754);}(_0x2c0f,0x17f));var _0xf2c0=function(_0x13606d,_0x30f265){_0x13606d=_0x13606d-0x0;var _0x1b85b0=_0x2c0f[_0x13606d];return _0x1b85b0;};'use strict';var _=require(_0xf2c0('0x0'));var util=require(_0xf2c0('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf2c0('0x2'));var fs=require('fs');var Redis=require(_0xf2c0('0x3'));var db=require(_0xf2c0('0x4'))['db'];var utils=require(_0xf2c0('0x5'));var logger=require(_0xf2c0('0x6'))(_0xf2c0('0x7'));var config=require(_0xf2c0('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xf2c0('0x9')][_0xf2c0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x93ff77,_0x27e9f5,_0x5379b8){return new BPromise(function(_0x246b96,_0x3cdaab){return client[_0xf2c0('0xb')](_0x93ff77,_0x5379b8)[_0xf2c0('0xc')](function(_0x2b6214){logger['info'](_0xf2c0('0xd'),_0x27e9f5,_0xf2c0('0xe'));logger[_0xf2c0('0xf')](_0xf2c0('0x10'),_0x27e9f5,_0xf2c0('0xe'),JSON[_0xf2c0('0x11')](_0x2b6214));if(_0x2b6214[_0xf2c0('0x12')]){if(_0x2b6214[_0xf2c0('0x12')][_0xf2c0('0x13')]===0x1f4){logger[_0xf2c0('0x12')](_0xf2c0('0xd'),_0x27e9f5,_0x2b6214[_0xf2c0('0x12')][_0xf2c0('0x14')]);return _0x3cdaab(_0x2b6214[_0xf2c0('0x12')][_0xf2c0('0x14')]);}logger[_0xf2c0('0x12')](_0xf2c0('0xd'),_0x27e9f5,_0x2b6214['error']['message']);return _0x246b96(_0x2b6214[_0xf2c0('0x12')]['message']);}else{logger['info'](_0xf2c0('0xd'),_0x27e9f5,'request\x20sent');_0x246b96(_0x2b6214[_0xf2c0('0x15')]['message']);}})[_0xf2c0('0x16')](function(_0x254362){logger[_0xf2c0('0x12')](_0xf2c0('0xd'),_0x27e9f5,_0x254362);_0x3cdaab(_0x254362);});});}exports[_0xf2c0('0x17')]=function(_0x2e172f){var _0x5d9541=this;return new Promise(function(_0x1896a4,_0x594689){return db[_0xf2c0('0x18')]['create'](_0x2e172f[_0xf2c0('0x19')],{'raw':_0x2e172f[_0xf2c0('0x1a')]?_0x2e172f[_0xf2c0('0x1a')][_0xf2c0('0x1b')]===undefined?!![]:![]:!![]})[_0xf2c0('0xc')](function(_0x606c74){logger[_0xf2c0('0x1c')](_0xf2c0('0x17'),_0x2e172f);logger[_0xf2c0('0xf')](_0xf2c0('0x17'),_0x2e172f,JSON['stringify'](_0x606c74));_0x1896a4(_0x606c74);})['catch'](function(_0x1c53df){logger[_0xf2c0('0x12')]('CreateSquareMessage',_0x1c53df[_0xf2c0('0x14')],_0x2e172f);_0x594689(_0x5d9541[_0xf2c0('0x12')](0x1f4,_0x1c53df[_0xf2c0('0x14')]));});});}; \ No newline at end of file +var _0xcacb=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','request','then','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','error','code','message','catch','CreateSquareMessage','SquareMessage','create','body','options','raw','stringify','lodash','util'];(function(_0x2814a0,_0x3c6ba6){var _0x19aca1=function(_0x12acd8){while(--_0x12acd8){_0x2814a0['push'](_0x2814a0['shift']());}};_0x19aca1(++_0x3c6ba6);}(_0xcacb,0x8f));var _0xbcac=function(_0x55daf2,_0x1b48de){_0x55daf2=_0x55daf2-0x0;var _0x1c8500=_0xcacb[_0x55daf2];return _0x1c8500;};'use strict';var _=require(_0xbcac('0x0'));var util=require(_0xbcac('0x1'));var moment=require(_0xbcac('0x2'));var BPromise=require(_0xbcac('0x3'));var rs=require(_0xbcac('0x4'));var fs=require('fs');var Redis=require(_0xbcac('0x5'));var db=require(_0xbcac('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xbcac('0x7'))(_0xbcac('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xbcac('0x9')][_0xbcac('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2061b1,_0xfeb9bc,_0x3c375d){return new BPromise(function(_0x5c677f,_0x2a4944){return client[_0xbcac('0xb')](_0x2061b1,_0x3c375d)[_0xbcac('0xc')](function(_0x3b525f){logger[_0xbcac('0xd')](_0xbcac('0xe'),_0xfeb9bc,_0xbcac('0xf'));logger[_0xbcac('0x10')](_0xbcac('0x11'),_0xfeb9bc,'request\x20sent',JSON['stringify'](_0x3b525f));if(_0x3b525f[_0xbcac('0x12')]){if(_0x3b525f['error'][_0xbcac('0x13')]===0x1f4){logger[_0xbcac('0x12')](_0xbcac('0xe'),_0xfeb9bc,_0x3b525f[_0xbcac('0x12')][_0xbcac('0x14')]);return _0x2a4944(_0x3b525f[_0xbcac('0x12')][_0xbcac('0x14')]);}logger[_0xbcac('0x12')](_0xbcac('0xe'),_0xfeb9bc,_0x3b525f['error'][_0xbcac('0x14')]);return _0x5c677f(_0x3b525f['error'][_0xbcac('0x14')]);}else{logger[_0xbcac('0xd')](_0xbcac('0xe'),_0xfeb9bc,_0xbcac('0xf'));_0x5c677f(_0x3b525f['result']['message']);}})[_0xbcac('0x15')](function(_0xa2b6b){logger[_0xbcac('0x12')]('SquareMessage,\x20%s,\x20%s',_0xfeb9bc,_0xa2b6b);_0x2a4944(_0xa2b6b);});});}exports[_0xbcac('0x16')]=function(_0x2e27f2){var _0x53500a=this;return new Promise(function(_0x2d2c86,_0x357ead){return db[_0xbcac('0x17')][_0xbcac('0x18')](_0x2e27f2[_0xbcac('0x19')],{'raw':_0x2e27f2[_0xbcac('0x1a')]?_0x2e27f2[_0xbcac('0x1a')][_0xbcac('0x1b')]===undefined?!![]:![]:!![]})[_0xbcac('0xc')](function(_0x377c9a){logger[_0xbcac('0xd')](_0xbcac('0x16'),_0x2e27f2);logger[_0xbcac('0x10')]('CreateSquareMessage',_0x2e27f2,JSON[_0xbcac('0x1c')](_0x377c9a));_0x2d2c86(_0x377c9a);})[_0xbcac('0x15')](function(_0x5749ee){logger[_0xbcac('0x12')]('CreateSquareMessage',_0x5749ee['message'],_0x2e27f2);_0x357ead(_0x53500a[_0xbcac('0x12')](0x1f4,_0x5749ee[_0xbcac('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index a3b2410..aa75073 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 _0x055d=['get','/:id','show','15s','test','put','delete','destroy','exports','path','connect-timeout','express','../../config/environment','isAuthenticated','index'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x055d,0x1bc));var _0xd055=function(_0x33a204,_0x496414){_0x33a204=_0x33a204-0x0;var _0x2d9fd5=_0x055d[_0x33a204];return _0x2d9fd5;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd055('0x0'));var timeout=require(_0xd055('0x1'));var express=require(_0xd055('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(_0xd055('0x3'));var controller=require('./squareOdbc.controller');router['get']('/',auth[_0xd055('0x4')](),controller[_0xd055('0x5')]);router[_0xd055('0x6')](_0xd055('0x7'),auth[_0xd055('0x4')](),controller[_0xd055('0x8')]);router[_0xd055('0x6')]('/:id/test',auth[_0xd055('0x4')](),timeout(_0xd055('0x9')),controller[_0xd055('0xa')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xd055('0xb')](_0xd055('0x7'),auth[_0xd055('0x4')](),controller['update']);router[_0xd055('0xc')](_0xd055('0x7'),auth[_0xd055('0x4')](),controller[_0xd055('0xd')]);module[_0xd055('0xe')]=router; \ No newline at end of file +var _0xb7ef=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','./squareOdbc.controller','get','index','isAuthenticated','show','/:id/test','15s','test','post','create','put','update','delete','/:id','destroy','exports'];(function(_0x77b5d5,_0x336eca){var _0x41493f=function(_0x25990c){while(--_0x25990c){_0x77b5d5['push'](_0x77b5d5['shift']());}};_0x41493f(++_0x336eca);}(_0xb7ef,0x111));var _0xfb7e=function(_0x4bb1b3,_0x446a44){_0x4bb1b3=_0x4bb1b3-0x0;var _0x6b3651=_0xb7ef[_0x4bb1b3];return _0x6b3651;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xfb7e('0x0'));var express=require(_0xfb7e('0x1'));var router=express[_0xfb7e('0x2')]();var fs_extra=require(_0xfb7e('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xfb7e('0x4'));var config=require('../../config/environment');var controller=require(_0xfb7e('0x5'));router[_0xfb7e('0x6')]('/',auth['isAuthenticated'](),controller[_0xfb7e('0x7')]);router[_0xfb7e('0x6')]('/:id',auth[_0xfb7e('0x8')](),controller[_0xfb7e('0x9')]);router[_0xfb7e('0x6')](_0xfb7e('0xa'),auth[_0xfb7e('0x8')](),timeout(_0xfb7e('0xb')),controller[_0xfb7e('0xc')]);router[_0xfb7e('0xd')]('/',auth['isAuthenticated'](),controller[_0xfb7e('0xe')]);router[_0xfb7e('0xf')]('/:id',auth[_0xfb7e('0x8')](),controller[_0xfb7e('0x10')]);router[_0xfb7e('0x11')](_0xfb7e('0x12'),auth[_0xfb7e('0x8')](),controller[_0xfb7e('0x13')]);module[_0xfb7e('0x14')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index 86b74e6..50a5094 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 _0x4004=['name','exports','STRING'];(function(_0x28b9cc,_0x53d4e3){var _0x496e80=function(_0x1bfac0){while(--_0x1bfac0){_0x28b9cc['push'](_0x28b9cc['shift']());}};_0x496e80(++_0x53d4e3);}(_0x4004,0x1db));var _0x4400=function(_0x2e2292,_0x1891b8){_0x2e2292=_0x2e2292-0x0;var _0x4f77ab=_0x4004[_0x2e2292];return _0x4f77ab;};'use strict';var Sequelize=require('sequelize');module[_0x4400('0x0')]={'name':{'type':Sequelize[_0x4400('0x1')],'unique':_0x4400('0x2'),'allowNull':![]},'dsn':{'type':Sequelize[_0x4400('0x1')]},'description':{'type':Sequelize[_0x4400('0x1')]}}; \ No newline at end of file +var _0xd586=['STRING','name','exports'];(function(_0x913b85,_0x213182){var _0x1ce434=function(_0x4c9c8b){while(--_0x4c9c8b){_0x913b85['push'](_0x913b85['shift']());}};_0x1ce434(++_0x213182);}(_0xd586,0x65));var _0x6d58=function(_0x4879e7,_0x5b0bc4){_0x4879e7=_0x4879e7-0x0;var _0x4155cc=_0xd586[_0x4879e7];return _0x4155cc;};'use strict';var Sequelize=require('sequelize');module[_0x6d58('0x0')]={'name':{'type':Sequelize[_0x6d58('0x1')],'unique':_0x6d58('0x2'),'allowNull':![]},'dsn':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index 3468300..bd4261f 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 _0x3881=['rawAttributes','fieldName','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','includeAll','include','findAll','rows','catch','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','test','dsn','odbc','openSync','closeSync','eml-format','rimraf','zip-dir','request-promise','mustache','util','sox','to-csv','fs-extra','lodash','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','apply','reject','save','update','then','destroy','get','ODBC','UserProfileResource','sendStatus','error','stack','name','send','index','SquareOdbc'];(function(_0x514c15,_0x486901){var _0x16283e=function(_0x53b7d0){while(--_0x53b7d0){_0x514c15['push'](_0x514c15['shift']());}};_0x16283e(++_0x486901);}(_0x3881,0x12f));var _0x1388=function(_0x3778bd,_0x3d234a){_0x3778bd=_0x3778bd-0x0;var _0x88824b=_0x3881[_0x3778bd];return _0x88824b;};'use strict';var emlformat=require(_0x1388('0x0'));var rimraf=require(_0x1388('0x1'));var zipdir=require(_0x1388('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1388('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x1388('0x4'));var util=require(_0x1388('0x5'));var path=require('path');var sox=require(_0x1388('0x6'));var csv=require(_0x1388('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1388('0x8'));var _=require(_0x1388('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1388('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x1388('0xb'));var Papa=require(_0x1388('0xc'));var Redis=require('ioredis');var authService=require(_0x1388('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x1388('0xe'));var hardwareService=require(_0x1388('0xf'));var logger=require(_0x1388('0x10'))(_0x1388('0x11'));var utils=require(_0x1388('0x12'));var config=require(_0x1388('0x13'));var licenseUtil=require(_0x1388('0x14'));var db=require(_0x1388('0x15'))['db'];function respondWithStatusCode(_0x3158bd,_0x5e21f7){_0x5e21f7=_0x5e21f7||0xcc;return function(_0x5074e3){if(_0x5074e3){return _0x3158bd['sendStatus'](_0x5e21f7);}return _0x3158bd[_0x1388('0x16')](_0x5e21f7)[_0x1388('0x17')]();};}function respondWithResult(_0x1840cf,_0xcb6707){_0xcb6707=_0xcb6707||0xc8;return function(_0x47a025){if(_0x47a025){return _0x1840cf['status'](_0xcb6707)[_0x1388('0x18')](_0x47a025);}};}function respondWithFilteredResult(_0x22081d,_0x51c5fe){return function(_0x2795da){if(_0x2795da){var _0x284076=typeof _0x51c5fe['offset']===_0x1388('0x19')&&typeof _0x51c5fe[_0x1388('0x1a')]===_0x1388('0x19');var _0x130a4a=_0x2795da[_0x1388('0x1b')];var _0x4795ff=_0x284076?0x0:_0x51c5fe['offset'];var _0x15e11b=_0x284076?_0x2795da[_0x1388('0x1b')]:_0x51c5fe[_0x1388('0x1c')]+_0x51c5fe[_0x1388('0x1a')];var _0x1c8490;if(_0x15e11b>=_0x130a4a){_0x15e11b=_0x130a4a;_0x1c8490=0xc8;}else{_0x1c8490=0xce;}_0x22081d[_0x1388('0x16')](_0x1c8490);return _0x22081d['set']('Content-Range',_0x4795ff+'-'+_0x15e11b+'/'+_0x130a4a)[_0x1388('0x18')](_0x2795da);}return null;};}function patchUpdates(_0xe5b5ad){return function(_0x5dd029){try{jsonpatch[_0x1388('0x1d')](_0x5dd029,_0xe5b5ad,!![]);}catch(_0x544d11){return BPromise[_0x1388('0x1e')](_0x544d11);}return _0x5dd029[_0x1388('0x1f')]();};}function saveUpdates(_0x31142f,_0x30d8f7){return function(_0x1aedd4){if(_0x1aedd4){return _0x1aedd4[_0x1388('0x20')](_0x31142f)[_0x1388('0x21')](function(_0x4fcf5d){return _0x4fcf5d;});}return null;};}function removeEntity(_0x227cbc,_0x9c9386){return function(_0x27b347){if(_0x27b347){return _0x27b347[_0x1388('0x22')]()[_0x1388('0x21')](function(){var _0xa8c334=_0x27b347[_0x1388('0x23')]({'plain':!![]});var _0x275265=_0x1388('0x24');return db[_0x1388('0x25')][_0x1388('0x22')]({'where':{'type':_0x275265,'resourceId':_0xa8c334['id']}})[_0x1388('0x21')](function(){return _0x27b347;});})[_0x1388('0x21')](function(){_0x227cbc[_0x1388('0x16')](0xcc)[_0x1388('0x17')]();});}};}function handleEntityNotFound(_0x185e0a,_0x23d7ce){return function(_0x16d3bb){if(!_0x16d3bb){_0x185e0a[_0x1388('0x26')](0x194);}return _0x16d3bb;};}function handleError(_0x322d41,_0x5d4880){_0x5d4880=_0x5d4880||0x1f4;return function(_0x2fc431){logger[_0x1388('0x27')](_0x2fc431[_0x1388('0x28')]);if(_0x2fc431[_0x1388('0x29')]){delete _0x2fc431[_0x1388('0x29')];}_0x322d41['status'](_0x5d4880)[_0x1388('0x2a')](_0x2fc431);};}exports[_0x1388('0x2b')]=function(_0x3c475e,_0x215a60){var _0x235e0d={},_0x45b381={},_0x17586f={'count':0x0,'rows':[]};var _0x177f44=_['map'](db[_0x1388('0x2c')][_0x1388('0x2d')],function(_0x156935){return{'name':_0x156935[_0x1388('0x2e')],'type':_0x156935['type'][_0x1388('0x2f')]};});_0x45b381['model']=_[_0x1388('0x30')](_0x177f44,_0x1388('0x29'));_0x45b381[_0x1388('0x31')]=_[_0x1388('0x32')](_0x3c475e[_0x1388('0x31')]);_0x45b381[_0x1388('0x33')]=_[_0x1388('0x34')](_0x45b381[_0x1388('0x35')],_0x45b381[_0x1388('0x31')]);_0x235e0d[_0x1388('0x36')]=_['intersection'](_0x45b381['model'],qs[_0x1388('0x37')](_0x3c475e[_0x1388('0x31')][_0x1388('0x37')]));_0x235e0d['attributes']=_0x235e0d[_0x1388('0x36')][_0x1388('0x38')]?_0x235e0d['attributes']:_0x45b381[_0x1388('0x35')];if(!_0x3c475e[_0x1388('0x31')][_0x1388('0x39')](_0x1388('0x3a'))){_0x235e0d[_0x1388('0x1a')]=qs[_0x1388('0x1a')](_0x3c475e['query'][_0x1388('0x1a')]);_0x235e0d[_0x1388('0x1c')]=qs[_0x1388('0x1c')](_0x3c475e[_0x1388('0x31')][_0x1388('0x1c')]);}_0x235e0d[_0x1388('0x3b')]=qs['sort'](_0x3c475e[_0x1388('0x31')][_0x1388('0x3c')]);_0x235e0d[_0x1388('0x3d')]=qs[_0x1388('0x33')](_[_0x1388('0x3e')](_0x3c475e[_0x1388('0x31')],_0x45b381['filters']),_0x177f44);if(_0x3c475e[_0x1388('0x31')][_0x1388('0x3f')]){_0x235e0d['where']=_[_0x1388('0x40')](_0x235e0d['where'],{'$or':_[_0x1388('0x30')](_0x177f44,function(_0x4dd86e){if(_0x4dd86e[_0x1388('0x41')]!=='VIRTUAL'){var _0x48423c={};_0x48423c[_0x4dd86e[_0x1388('0x29')]]={'$like':'%'+_0x3c475e[_0x1388('0x31')][_0x1388('0x3f')]+'%'};return _0x48423c;}})});}_0x235e0d=_['merge']({},_0x235e0d,_0x3c475e['options']);var _0x6a5ac5={'where':_0x235e0d[_0x1388('0x3d')]};return db[_0x1388('0x2c')][_0x1388('0x1b')](_0x6a5ac5)['then'](function(_0x5e2127){_0x17586f[_0x1388('0x1b')]=_0x5e2127;if(_0x3c475e[_0x1388('0x31')][_0x1388('0x42')]){_0x235e0d[_0x1388('0x43')]=[{'all':!![]}];}return db[_0x1388('0x2c')][_0x1388('0x44')](_0x235e0d);})[_0x1388('0x21')](function(_0x437e8f){_0x17586f[_0x1388('0x45')]=_0x437e8f;return _0x17586f;})['then'](respondWithFilteredResult(_0x215a60,_0x235e0d))[_0x1388('0x46')](handleError(_0x215a60,null));};exports['show']=function(_0x115008,_0x95f204){var _0x3e9bac={'raw':!![],'where':{'id':_0x115008['params']['id']}},_0x4a4030={};_0x4a4030[_0x1388('0x35')]=_[_0x1388('0x32')](db[_0x1388('0x2c')]['rawAttributes']);_0x4a4030[_0x1388('0x31')]=_['keys'](_0x115008['query']);_0x4a4030[_0x1388('0x33')]=_['intersection'](_0x4a4030[_0x1388('0x35')],_0x4a4030[_0x1388('0x31')]);_0x3e9bac['attributes']=_[_0x1388('0x34')](_0x4a4030[_0x1388('0x35')],qs[_0x1388('0x37')](_0x115008[_0x1388('0x31')]['fields']));_0x3e9bac[_0x1388('0x36')]=_0x3e9bac['attributes'][_0x1388('0x38')]?_0x3e9bac['attributes']:_0x4a4030[_0x1388('0x35')];if(_0x115008[_0x1388('0x31')][_0x1388('0x42')]){_0x3e9bac['include']=[{'all':!![]}];}_0x3e9bac=_[_0x1388('0x40')]({},_0x3e9bac,_0x115008[_0x1388('0x47')]);return db['SquareOdbc'][_0x1388('0x48')](_0x3e9bac)[_0x1388('0x21')](handleEntityNotFound(_0x95f204,null))['then'](respondWithResult(_0x95f204,null))[_0x1388('0x46')](handleError(_0x95f204,null));};exports[_0x1388('0x49')]=function(_0x353ed0,_0x51cbb9){return db['SquareOdbc']['create'](_0x353ed0[_0x1388('0x4a')],{})[_0x1388('0x21')](function(_0x1c7700){var _0x4e6fab=_0x353ed0['user'][_0x1388('0x23')]({'plain':!![]});if(!_0x4e6fab)throw new Error(_0x1388('0x4b'));if(_0x4e6fab[_0x1388('0x4c')]===_0x1388('0x4d')){var _0x4ee5fb=_0x1c7700[_0x1388('0x23')]({'plain':!![]});var _0x1e6a09=_0x1388('0x24');return db['UserProfileSection']['find']({'where':{'name':_0x1e6a09,'userProfileId':_0x4e6fab[_0x1388('0x4e')]},'raw':!![]})['then'](function(_0x5c7016){if(_0x5c7016&&_0x5c7016[_0x1388('0x4f')]===0x0){return db[_0x1388('0x25')][_0x1388('0x49')]({'name':_0x4ee5fb[_0x1388('0x29')],'resourceId':_0x4ee5fb['id'],'type':_0x5c7016[_0x1388('0x29')],'sectionId':_0x5c7016['id']},{})[_0x1388('0x21')](function(){return _0x1c7700;});}else{return _0x1c7700;}})[_0x1388('0x46')](function(_0x1a58e5){logger[_0x1388('0x27')](_0x1388('0x50'),_0x1a58e5);throw _0x1a58e5;});}return _0x1c7700;})[_0x1388('0x21')](respondWithResult(_0x51cbb9,0xc9))[_0x1388('0x46')](handleError(_0x51cbb9,null));};exports[_0x1388('0x20')]=function(_0x3961e9,_0x55a350){if(_0x3961e9['body']['id']){delete _0x3961e9[_0x1388('0x4a')]['id'];}return db[_0x1388('0x2c')]['find']({'where':{'id':_0x3961e9[_0x1388('0x51')]['id']}})['then'](handleEntityNotFound(_0x55a350,null))[_0x1388('0x21')](saveUpdates(_0x3961e9[_0x1388('0x4a')],null))['then'](respondWithResult(_0x55a350,null))[_0x1388('0x46')](handleError(_0x55a350,null));};exports['destroy']=function(_0x20743c,_0x32510e){return db[_0x1388('0x2c')][_0x1388('0x48')]({'where':{'id':_0x20743c[_0x1388('0x51')]['id']}})[_0x1388('0x21')](handleEntityNotFound(_0x32510e,null))['then'](removeEntity(_0x32510e,null))[_0x1388('0x46')](handleError(_0x32510e,null));};exports[_0x1388('0x52')]=function(_0x19e578,_0x53ef25,_0xf09338){var _0x1e05ce;return db[_0x1388('0x2c')][_0x1388('0x48')]({'where':{'id':_0x19e578[_0x1388('0x51')]['id']},'attributes':['id',_0x1388('0x53')]})[_0x1388('0x21')](handleEntityNotFound(_0x53ef25,null))['then'](function(_0xbe3941){if(_0xbe3941){var _0x169b1d=require(_0x1388('0x54'))();_0x169b1d[_0x1388('0x55')](_0xbe3941[_0x1388('0x53')]);_0x169b1d[_0x1388('0x56')]();return _0xbe3941;}})[_0x1388('0x21')](respondWithResult(_0x53ef25,null))[_0x1388('0x46')](handleError(_0x53ef25,null));}; \ No newline at end of file +var _0x8498=['map','SquareOdbc','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','filter','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','merge','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','ODBC','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','test','dsn','odbc','openSync','closeSync','eml-format','rimraf','fast-json-patch','request-promise','mustache','path','sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','save','update','then','destroy','get','UserProfileResource','error','stack','name','send'];(function(_0xdad6d6,_0x2d2fde){var _0x57f076=function(_0x1d3d22){while(--_0x1d3d22){_0xdad6d6['push'](_0xdad6d6['shift']());}};_0x57f076(++_0x2d2fde);}(_0x8498,0x131));var _0x8849=function(_0x343c7c,_0x2fb412){_0x343c7c=_0x343c7c-0x0;var _0x16cadb=_0x8498[_0x343c7c];return _0x16cadb;};'use strict';var emlformat=require(_0x8849('0x0'));var rimraf=require(_0x8849('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8849('0x2'));var rp=require(_0x8849('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8849('0x4'));var util=require('util');var path=require(_0x8849('0x5'));var sox=require(_0x8849('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8849('0x7'));var _=require(_0x8849('0x8'));var squel=require(_0x8849('0x9'));var crypto=require(_0x8849('0xa'));var jsforce=require(_0x8849('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x8849('0xc'));var querystring=require(_0x8849('0xd'));var Papa=require(_0x8849('0xe'));var Redis=require(_0x8849('0xf'));var authService=require(_0x8849('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x8849('0x11'));var hardwareService=require(_0x8849('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x8849('0x13'));var config=require(_0x8849('0x14'));var licenseUtil=require(_0x8849('0x15'));var db=require(_0x8849('0x16'))['db'];function respondWithStatusCode(_0xd7b452,_0x599005){_0x599005=_0x599005||0xcc;return function(_0x3b5d3e){if(_0x3b5d3e){return _0xd7b452[_0x8849('0x17')](_0x599005);}return _0xd7b452[_0x8849('0x18')](_0x599005)[_0x8849('0x19')]();};}function respondWithResult(_0x2b3db4,_0x4ee6ba){_0x4ee6ba=_0x4ee6ba||0xc8;return function(_0x2aaf0f){if(_0x2aaf0f){return _0x2b3db4[_0x8849('0x18')](_0x4ee6ba)[_0x8849('0x1a')](_0x2aaf0f);}};}function respondWithFilteredResult(_0x155de8,_0x4f7e2d){return function(_0x467afa){if(_0x467afa){var _0x54533b=typeof _0x4f7e2d[_0x8849('0x1b')]==='undefined'&&typeof _0x4f7e2d['limit']===_0x8849('0x1c');var _0x520a47=_0x467afa[_0x8849('0x1d')];var _0x1b0957=_0x54533b?0x0:_0x4f7e2d['offset'];var _0x5a5ba1=_0x54533b?_0x467afa[_0x8849('0x1d')]:_0x4f7e2d[_0x8849('0x1b')]+_0x4f7e2d['limit'];var _0x47ca6e;if(_0x5a5ba1>=_0x520a47){_0x5a5ba1=_0x520a47;_0x47ca6e=0xc8;}else{_0x47ca6e=0xce;}_0x155de8[_0x8849('0x18')](_0x47ca6e);return _0x155de8[_0x8849('0x1e')](_0x8849('0x1f'),_0x1b0957+'-'+_0x5a5ba1+'/'+_0x520a47)[_0x8849('0x1a')](_0x467afa);}return null;};}function patchUpdates(_0x259e5d){return function(_0x4b1bae){try{jsonpatch[_0x8849('0x20')](_0x4b1bae,_0x259e5d,!![]);}catch(_0x3f67f3){return BPromise['reject'](_0x3f67f3);}return _0x4b1bae[_0x8849('0x21')]();};}function saveUpdates(_0x1d6c9c,_0x407672){return function(_0x7bc97f){if(_0x7bc97f){return _0x7bc97f[_0x8849('0x22')](_0x1d6c9c)[_0x8849('0x23')](function(_0x11cba2){return _0x11cba2;});}return null;};}function removeEntity(_0x52812a,_0x9eb5c9){return function(_0x2404c9){if(_0x2404c9){return _0x2404c9[_0x8849('0x24')]()['then'](function(){var _0x8d9aae=_0x2404c9[_0x8849('0x25')]({'plain':!![]});var _0x2365f8='ODBC';return db[_0x8849('0x26')][_0x8849('0x24')]({'where':{'type':_0x2365f8,'resourceId':_0x8d9aae['id']}})[_0x8849('0x23')](function(){return _0x2404c9;});})['then'](function(){_0x52812a[_0x8849('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0xaa1e52,_0x478df9){return function(_0x2d62a4){if(!_0x2d62a4){_0xaa1e52[_0x8849('0x17')](0x194);}return _0x2d62a4;};}function handleError(_0x5a07fc,_0x327130){_0x327130=_0x327130||0x1f4;return function(_0x52736e){logger[_0x8849('0x27')](_0x52736e[_0x8849('0x28')]);if(_0x52736e['name']){delete _0x52736e[_0x8849('0x29')];}_0x5a07fc[_0x8849('0x18')](_0x327130)[_0x8849('0x2a')](_0x52736e);};}exports['index']=function(_0x27c2b6,_0x59152e){var _0x363878={},_0xe5ada3={},_0x26460b={'count':0x0,'rows':[]};var _0x2c69e9=_[_0x8849('0x2b')](db[_0x8849('0x2c')][_0x8849('0x2d')],function(_0x5a66a1){return{'name':_0x5a66a1[_0x8849('0x2e')],'type':_0x5a66a1[_0x8849('0x2f')]['key']};});_0xe5ada3[_0x8849('0x30')]=_[_0x8849('0x2b')](_0x2c69e9,'name');_0xe5ada3[_0x8849('0x31')]=_[_0x8849('0x32')](_0x27c2b6[_0x8849('0x31')]);_0xe5ada3[_0x8849('0x33')]=_[_0x8849('0x34')](_0xe5ada3['model'],_0xe5ada3['query']);_0x363878[_0x8849('0x35')]=_[_0x8849('0x34')](_0xe5ada3[_0x8849('0x30')],qs[_0x8849('0x36')](_0x27c2b6[_0x8849('0x31')][_0x8849('0x36')]));_0x363878[_0x8849('0x35')]=_0x363878[_0x8849('0x35')][_0x8849('0x37')]?_0x363878[_0x8849('0x35')]:_0xe5ada3['model'];if(!_0x27c2b6[_0x8849('0x31')]['hasOwnProperty'](_0x8849('0x38'))){_0x363878[_0x8849('0x39')]=qs[_0x8849('0x39')](_0x27c2b6[_0x8849('0x31')][_0x8849('0x39')]);_0x363878[_0x8849('0x1b')]=qs[_0x8849('0x1b')](_0x27c2b6[_0x8849('0x31')][_0x8849('0x1b')]);}_0x363878[_0x8849('0x3a')]=qs[_0x8849('0x3b')](_0x27c2b6['query'][_0x8849('0x3b')]);_0x363878[_0x8849('0x3c')]=qs['filters'](_[_0x8849('0x3d')](_0x27c2b6[_0x8849('0x31')],_0xe5ada3['filters']),_0x2c69e9);if(_0x27c2b6[_0x8849('0x31')][_0x8849('0x3e')]){_0x363878[_0x8849('0x3c')]=_['merge'](_0x363878[_0x8849('0x3c')],{'$or':_[_0x8849('0x2b')](_0x2c69e9,function(_0x482ef5){if(_0x482ef5[_0x8849('0x2f')]!==_0x8849('0x3f')){var _0x1f5f6b={};_0x1f5f6b[_0x482ef5[_0x8849('0x29')]]={'$like':'%'+_0x27c2b6[_0x8849('0x31')][_0x8849('0x3e')]+'%'};return _0x1f5f6b;}})});}_0x363878=_['merge']({},_0x363878,_0x27c2b6[_0x8849('0x40')]);var _0x11944f={'where':_0x363878[_0x8849('0x3c')]};return db['SquareOdbc'][_0x8849('0x1d')](_0x11944f)[_0x8849('0x23')](function(_0x25f693){_0x26460b[_0x8849('0x1d')]=_0x25f693;if(_0x27c2b6[_0x8849('0x31')]['includeAll']){_0x363878[_0x8849('0x41')]=[{'all':!![]}];}return db[_0x8849('0x2c')][_0x8849('0x42')](_0x363878);})[_0x8849('0x23')](function(_0x162528){_0x26460b[_0x8849('0x43')]=_0x162528;return _0x26460b;})[_0x8849('0x23')](respondWithFilteredResult(_0x59152e,_0x363878))[_0x8849('0x44')](handleError(_0x59152e,null));};exports[_0x8849('0x45')]=function(_0x28d0e8,_0x150bb8){var _0x425da0={'raw':!![],'where':{'id':_0x28d0e8[_0x8849('0x46')]['id']}},_0x1b9c25={};_0x1b9c25[_0x8849('0x30')]=_[_0x8849('0x32')](db[_0x8849('0x2c')][_0x8849('0x2d')]);_0x1b9c25[_0x8849('0x31')]=_[_0x8849('0x32')](_0x28d0e8['query']);_0x1b9c25[_0x8849('0x33')]=_[_0x8849('0x34')](_0x1b9c25[_0x8849('0x30')],_0x1b9c25['query']);_0x425da0[_0x8849('0x35')]=_[_0x8849('0x34')](_0x1b9c25['model'],qs[_0x8849('0x36')](_0x28d0e8[_0x8849('0x31')][_0x8849('0x36')]));_0x425da0[_0x8849('0x35')]=_0x425da0[_0x8849('0x35')][_0x8849('0x37')]?_0x425da0[_0x8849('0x35')]:_0x1b9c25['model'];if(_0x28d0e8[_0x8849('0x31')][_0x8849('0x47')]){_0x425da0[_0x8849('0x41')]=[{'all':!![]}];}_0x425da0=_[_0x8849('0x48')]({},_0x425da0,_0x28d0e8['options']);return db[_0x8849('0x2c')]['find'](_0x425da0)['then'](handleEntityNotFound(_0x150bb8,null))['then'](respondWithResult(_0x150bb8,null))[_0x8849('0x44')](handleError(_0x150bb8,null));};exports[_0x8849('0x49')]=function(_0x31913a,_0x307ec8){return db[_0x8849('0x2c')][_0x8849('0x49')](_0x31913a[_0x8849('0x4a')],{})['then'](function(_0xc668f){var _0x546b79=_0x31913a['user'][_0x8849('0x25')]({'plain':!![]});if(!_0x546b79)throw new Error(_0x8849('0x4b'));if(_0x546b79['role']===_0x8849('0x4c')){var _0x2c2016=_0xc668f[_0x8849('0x25')]({'plain':!![]});var _0x49708e=_0x8849('0x4d');return db[_0x8849('0x4e')][_0x8849('0x4f')]({'where':{'name':_0x49708e,'userProfileId':_0x546b79['userProfileId']},'raw':!![]})['then'](function(_0x29eae8){if(_0x29eae8&&_0x29eae8[_0x8849('0x50')]===0x0){return db[_0x8849('0x26')][_0x8849('0x49')]({'name':_0x2c2016[_0x8849('0x29')],'resourceId':_0x2c2016['id'],'type':_0x29eae8[_0x8849('0x29')],'sectionId':_0x29eae8['id']},{})['then'](function(){return _0xc668f;});}else{return _0xc668f;}})[_0x8849('0x44')](function(_0x3bde61){logger[_0x8849('0x27')](_0x8849('0x51'),_0x3bde61);throw _0x3bde61;});}return _0xc668f;})[_0x8849('0x23')](respondWithResult(_0x307ec8,0xc9))[_0x8849('0x44')](handleError(_0x307ec8,null));};exports['update']=function(_0x572c8b,_0x1bad4d){if(_0x572c8b[_0x8849('0x4a')]['id']){delete _0x572c8b[_0x8849('0x4a')]['id'];}return db[_0x8849('0x2c')][_0x8849('0x4f')]({'where':{'id':_0x572c8b[_0x8849('0x46')]['id']}})['then'](handleEntityNotFound(_0x1bad4d,null))[_0x8849('0x23')](saveUpdates(_0x572c8b[_0x8849('0x4a')],null))[_0x8849('0x23')](respondWithResult(_0x1bad4d,null))[_0x8849('0x44')](handleError(_0x1bad4d,null));};exports[_0x8849('0x24')]=function(_0xa30ebd,_0x4c476a){return db[_0x8849('0x2c')][_0x8849('0x4f')]({'where':{'id':_0xa30ebd[_0x8849('0x46')]['id']}})[_0x8849('0x23')](handleEntityNotFound(_0x4c476a,null))['then'](removeEntity(_0x4c476a,null))[_0x8849('0x44')](handleError(_0x4c476a,null));};exports[_0x8849('0x52')]=function(_0x40a566,_0x3e3440,_0x373bd9){var _0x4c8925;return db[_0x8849('0x2c')][_0x8849('0x4f')]({'where':{'id':_0x40a566[_0x8849('0x46')]['id']},'attributes':['id',_0x8849('0x53')]})[_0x8849('0x23')](handleEntityNotFound(_0x3e3440,null))['then'](function(_0x1a1277){if(_0x1a1277){var _0x1980e1=require(_0x8849('0x54'))();_0x1980e1[_0x8849('0x55')](_0x1a1277[_0x8849('0x53')]);_0x1980e1[_0x8849('0x56')]();return _0x1a1277;}})[_0x8849('0x23')](respondWithResult(_0x3e3440,null))[_0x8849('0x44')](handleError(_0x3e3440,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index da8882e..1d7e73a 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 _0xaa33=['exports','define','square_odbc','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./squareOdbc.attributes'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0xaa33,0xff));var _0x3aa3=function(_0x32ff35,_0x4af5dc){_0x32ff35=_0x32ff35-0x0;var _0x5939fd=_0xaa33[_0x32ff35];return _0x5939fd;};'use strict';var _=require(_0x3aa3('0x0'));var util=require(_0x3aa3('0x1'));var logger=require(_0x3aa3('0x2'))('api');var moment=require(_0x3aa3('0x3'));var BPromise=require(_0x3aa3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3aa3('0x5'));var rimraf=require(_0x3aa3('0x6'));var config=require(_0x3aa3('0x7'));var attributes=require(_0x3aa3('0x8'));module[_0x3aa3('0x9')]=function(_0x33be0a,_0x2eef3e){return _0x33be0a[_0x3aa3('0xa')]('SquareOdbc',attributes,{'tableName':_0x3aa3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe5f6=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./squareOdbc.attributes','SquareOdbc','square_odbc','lodash','util'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xe5f6,0x8e));var _0x6e5f=function(_0x217acd,_0x3ddf49){_0x217acd=_0x217acd-0x0;var _0x3850f8=_0xe5f6[_0x217acd];return _0x3850f8;};'use strict';var _=require(_0x6e5f('0x0'));var util=require(_0x6e5f('0x1'));var logger=require(_0x6e5f('0x2'))(_0x6e5f('0x3'));var moment=require('moment');var BPromise=require(_0x6e5f('0x4'));var rp=require(_0x6e5f('0x5'));var fs=require('fs');var path=require(_0x6e5f('0x6'));var rimraf=require(_0x6e5f('0x7'));var config=require(_0x6e5f('0x8'));var attributes=require(_0x6e5f('0x9'));module['exports']=function(_0x50e7a5,_0x515112){return _0x50e7a5['define'](_0x6e5f('0xa'),attributes,{'tableName':_0x6e5f('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 de5b913..9ea8c7e 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 _0x91f1=['http','request','then','info','SquareOdbc,\x20%s,\x20%s','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowSquareOdbc','SquareOdbc','find','options','raw','where','attributes','include','map','model','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client'];(function(_0x549928,_0x363b7a){var _0x941e27=function(_0x280fe6){while(--_0x280fe6){_0x549928['push'](_0x549928['shift']());}};_0x941e27(++_0x363b7a);}(_0x91f1,0x160));var _0x191f=function(_0x563bfc,_0x147c8a){_0x563bfc=_0x563bfc-0x0;var _0x3d5fe2=_0x91f1[_0x563bfc];return _0x3d5fe2;};'use strict';var _=require(_0x191f('0x0'));var util=require(_0x191f('0x1'));var moment=require(_0x191f('0x2'));var BPromise=require(_0x191f('0x3'));var rs=require(_0x191f('0x4'));var fs=require('fs');var Redis=require(_0x191f('0x5'));var db=require(_0x191f('0x6'))['db'];var utils=require(_0x191f('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x191f('0x8'));var jayson=require(_0x191f('0x9'));var client=jayson[_0x191f('0xa')][_0x191f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x16eda4,_0x58a2f0,_0x43433e){return new BPromise(function(_0x5d55a2,_0x2ede85){return client[_0x191f('0xc')](_0x16eda4,_0x43433e)[_0x191f('0xd')](function(_0x180ffa){logger[_0x191f('0xe')](_0x191f('0xf'),_0x58a2f0,'request\x20sent');logger[_0x191f('0x10')](_0x191f('0x11'),_0x58a2f0,_0x191f('0x12'),JSON[_0x191f('0x13')](_0x180ffa));if(_0x180ffa[_0x191f('0x14')]){if(_0x180ffa[_0x191f('0x14')]['code']===0x1f4){logger[_0x191f('0x14')](_0x191f('0xf'),_0x58a2f0,_0x180ffa[_0x191f('0x14')][_0x191f('0x15')]);return _0x2ede85(_0x180ffa[_0x191f('0x14')][_0x191f('0x15')]);}logger[_0x191f('0x14')](_0x191f('0xf'),_0x58a2f0,_0x180ffa[_0x191f('0x14')][_0x191f('0x15')]);return _0x5d55a2(_0x180ffa[_0x191f('0x14')][_0x191f('0x15')]);}else{logger[_0x191f('0xe')]('SquareOdbc,\x20%s,\x20%s',_0x58a2f0,_0x191f('0x12'));_0x5d55a2(_0x180ffa[_0x191f('0x16')]['message']);}})['catch'](function(_0x126f7d){logger[_0x191f('0x14')]('SquareOdbc,\x20%s,\x20%s',_0x58a2f0,_0x126f7d);_0x2ede85(_0x126f7d);});});}exports[_0x191f('0x17')]=function(_0x4c6845){var _0x318119=this;return new Promise(function(_0xe5b390,_0x5e8ca8){return db[_0x191f('0x18')][_0x191f('0x19')]({'raw':_0x4c6845[_0x191f('0x1a')]?_0x4c6845[_0x191f('0x1a')][_0x191f('0x1b')]===undefined?!![]:![]:!![],'where':_0x4c6845['options']?_0x4c6845[_0x191f('0x1a')][_0x191f('0x1c')]||null:null,'attributes':_0x4c6845[_0x191f('0x1a')]?_0x4c6845[_0x191f('0x1a')][_0x191f('0x1d')]||null:null,'include':_0x4c6845[_0x191f('0x1a')]?_0x4c6845[_0x191f('0x1a')][_0x191f('0x1e')]?_[_0x191f('0x1f')](_0x4c6845[_0x191f('0x1a')][_0x191f('0x1e')],function(_0x16539a){return{'model':db[_0x16539a[_0x191f('0x20')]],'as':_0x16539a['as'],'attributes':_0x16539a[_0x191f('0x1d')],'include':_0x16539a[_0x191f('0x1e')]?_[_0x191f('0x1f')](_0x16539a[_0x191f('0x1e')],function(_0x3bb244){return{'model':db[_0x3bb244['model']],'as':_0x3bb244['as'],'attributes':_0x3bb244[_0x191f('0x1d')],'include':_0x3bb244[_0x191f('0x1e')]?_[_0x191f('0x1f')](_0x3bb244[_0x191f('0x1e')],function(_0x2cf12d){return{'model':db[_0x2cf12d[_0x191f('0x20')]],'as':_0x2cf12d['as'],'attributes':_0x2cf12d[_0x191f('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xa08e9e){logger[_0x191f('0xe')](_0x191f('0x17'),_0x4c6845);logger[_0x191f('0x10')](_0x191f('0x17'),_0x4c6845,JSON[_0x191f('0x13')](_0xa08e9e));_0xe5b390(_0xa08e9e);})['catch'](function(_0x1d71a9){logger[_0x191f('0x14')](_0x191f('0x17'),_0x1d71a9['message'],_0x4c6845);_0x5e8ca8(_0x318119['error'](0x1f4,_0x1d71a9[_0x191f('0x15')]));});});}; \ No newline at end of file +var _0x1053=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SquareOdbc,\x20%s,\x20%s','result','catch','SquareOdbc','find','options','raw','where','attributes','include','map','model','ShowSquareOdbc','lodash','moment','bluebird','randomstring'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0x1053,0xea));var _0x3105=function(_0xca1f0e,_0x2713d5){_0xca1f0e=_0xca1f0e-0x0;var _0x35e4ef=_0x1053[_0xca1f0e];return _0x35e4ef;};'use strict';var _=require(_0x3105('0x0'));var util=require('util');var moment=require(_0x3105('0x1'));var BPromise=require(_0x3105('0x2'));var rs=require(_0x3105('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3105('0x4'))['db'];var utils=require(_0x3105('0x5'));var logger=require(_0x3105('0x6'))(_0x3105('0x7'));var config=require(_0x3105('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x3105('0x9')][_0x3105('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4796af,_0x20c643,_0x4d5f97){return new BPromise(function(_0x28c551,_0x2f76a1){return client[_0x3105('0xb')](_0x4796af,_0x4d5f97)[_0x3105('0xc')](function(_0x34658a){logger[_0x3105('0xd')]('SquareOdbc,\x20%s,\x20%s',_0x20c643,_0x3105('0xe'));logger[_0x3105('0xf')](_0x3105('0x10'),_0x20c643,_0x3105('0xe'),JSON[_0x3105('0x11')](_0x34658a));if(_0x34658a[_0x3105('0x12')]){if(_0x34658a[_0x3105('0x12')][_0x3105('0x13')]===0x1f4){logger['error']('SquareOdbc,\x20%s,\x20%s',_0x20c643,_0x34658a['error'][_0x3105('0x14')]);return _0x2f76a1(_0x34658a[_0x3105('0x12')][_0x3105('0x14')]);}logger[_0x3105('0x12')](_0x3105('0x15'),_0x20c643,_0x34658a[_0x3105('0x12')][_0x3105('0x14')]);return _0x28c551(_0x34658a[_0x3105('0x12')]['message']);}else{logger[_0x3105('0xd')](_0x3105('0x15'),_0x20c643,_0x3105('0xe'));_0x28c551(_0x34658a[_0x3105('0x16')][_0x3105('0x14')]);}})[_0x3105('0x17')](function(_0x5c3f0d){logger[_0x3105('0x12')](_0x3105('0x15'),_0x20c643,_0x5c3f0d);_0x2f76a1(_0x5c3f0d);});});}exports['ShowSquareOdbc']=function(_0x2580dd){var _0x9ec8c6=this;return new Promise(function(_0xcbb60d,_0x2b245a){return db[_0x3105('0x18')][_0x3105('0x19')]({'raw':_0x2580dd[_0x3105('0x1a')]?_0x2580dd['options'][_0x3105('0x1b')]===undefined?!![]:![]:!![],'where':_0x2580dd[_0x3105('0x1a')]?_0x2580dd['options'][_0x3105('0x1c')]||null:null,'attributes':_0x2580dd[_0x3105('0x1a')]?_0x2580dd[_0x3105('0x1a')][_0x3105('0x1d')]||null:null,'include':_0x2580dd[_0x3105('0x1a')]?_0x2580dd[_0x3105('0x1a')][_0x3105('0x1e')]?_[_0x3105('0x1f')](_0x2580dd[_0x3105('0x1a')][_0x3105('0x1e')],function(_0x6d358f){return{'model':db[_0x6d358f[_0x3105('0x20')]],'as':_0x6d358f['as'],'attributes':_0x6d358f[_0x3105('0x1d')],'include':_0x6d358f[_0x3105('0x1e')]?_[_0x3105('0x1f')](_0x6d358f['include'],function(_0x4ede23){return{'model':db[_0x4ede23[_0x3105('0x20')]],'as':_0x4ede23['as'],'attributes':_0x4ede23[_0x3105('0x1d')],'include':_0x4ede23[_0x3105('0x1e')]?_[_0x3105('0x1f')](_0x4ede23[_0x3105('0x1e')],function(_0x13be30){return{'model':db[_0x13be30['model']],'as':_0x13be30['as'],'attributes':_0x13be30['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x35d3c8){logger[_0x3105('0xd')](_0x3105('0x21'),_0x2580dd);logger['debug'](_0x3105('0x21'),_0x2580dd,JSON[_0x3105('0x11')](_0x35d3c8));_0xcbb60d(_0x35d3c8);})['catch'](function(_0xd53888){logger[_0x3105('0x12')](_0x3105('0x21'),_0xd53888[_0x3105('0x14')],_0x2580dd);_0x2b245a(_0x9ec8c6[_0x3105('0x12')](0x1f4,_0xd53888[_0x3105('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 1ab0542..917b683 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 _0xb4e5=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','show','/:id/users','isAuthenticated','getUsers','post','create','put','update','delete','destroy','removeUsers','multer','path','connect-timeout','express'];(function(_0x25c846,_0x1582a4){var _0x358256=function(_0x5a9d29){while(--_0x5a9d29){_0x25c846['push'](_0x25c846['shift']());}};_0x358256(++_0x1582a4);}(_0xb4e5,0x104));var _0x5b4e=function(_0x5353d0,_0x55cb83){_0x5353d0=_0x5353d0-0x0;var _0x37b55b=_0xb4e5[_0x5353d0];return _0x37b55b;};'use strict';var multer=require(_0x5b4e('0x0'));var util=require('util');var path=require(_0x5b4e('0x1'));var timeout=require(_0x5b4e('0x2'));var express=require(_0x5b4e('0x3'));var router=express[_0x5b4e('0x4')]();var fs_extra=require(_0x5b4e('0x5'));var auth=require(_0x5b4e('0x6'));var interaction=require(_0x5b4e('0x7'));var config=require(_0x5b4e('0x8'));var controller=require('./squareProject.controller');router[_0x5b4e('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x5b4e('0x9')](_0x5b4e('0xa'),auth['isAuthenticated'](),controller[_0x5b4e('0xb')]);router[_0x5b4e('0x9')](_0x5b4e('0xc'),auth[_0x5b4e('0xd')](),controller[_0x5b4e('0xe')]);router[_0x5b4e('0xf')]('/',auth[_0x5b4e('0xd')](),controller[_0x5b4e('0x10')]);router[_0x5b4e('0xf')](_0x5b4e('0xc'),auth[_0x5b4e('0xd')](),controller['addUsers']);router[_0x5b4e('0x11')](_0x5b4e('0xa'),auth[_0x5b4e('0xd')](),controller[_0x5b4e('0x12')]);router[_0x5b4e('0x13')](_0x5b4e('0xa'),auth[_0x5b4e('0xd')](),controller[_0x5b4e('0x14')]);router['delete'](_0x5b4e('0xc'),auth['isAuthenticated'](),controller[_0x5b4e('0x15')]);module['exports']=router; \ No newline at end of file +var _0xc23d=['put','update','delete','/:id','destroy','removeUsers','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','get','isAuthenticated','/:id/users','getUsers','post','create','addUsers'];(function(_0x86938f,_0x5801d2){var _0x37db36=function(_0x22a9c2){while(--_0x22a9c2){_0x86938f['push'](_0x86938f['shift']());}};_0x37db36(++_0x5801d2);}(_0xc23d,0x7f));var _0xdc23=function(_0xa46b86,_0x5c1465){_0xa46b86=_0xa46b86-0x0;var _0x417360=_0xc23d[_0xa46b86];return _0x417360;};'use strict';var multer=require(_0xdc23('0x0'));var util=require(_0xdc23('0x1'));var path=require(_0xdc23('0x2'));var timeout=require(_0xdc23('0x3'));var express=require(_0xdc23('0x4'));var router=express[_0xdc23('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xdc23('0x6'));var interaction=require(_0xdc23('0x7'));var config=require(_0xdc23('0x8'));var controller=require(_0xdc23('0x9'));router[_0xdc23('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0xdc23('0xa')]('/:id',auth[_0xdc23('0xb')](),controller['show']);router[_0xdc23('0xa')](_0xdc23('0xc'),auth[_0xdc23('0xb')](),controller[_0xdc23('0xd')]);router[_0xdc23('0xe')]('/',auth['isAuthenticated'](),controller[_0xdc23('0xf')]);router[_0xdc23('0xe')](_0xdc23('0xc'),auth[_0xdc23('0xb')](),controller[_0xdc23('0x10')]);router[_0xdc23('0x11')]('/:id',auth[_0xdc23('0xb')](),controller[_0xdc23('0x12')]);router[_0xdc23('0x13')](_0xdc23('0x14'),auth['isAuthenticated'](),controller[_0xdc23('0x15')]);router[_0xdc23('0x13')](_0xdc23('0xc'),auth[_0xdc23('0xb')](),controller[_0xdc23('0x16')]);module[_0xdc23('0x17')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index eabfc27..41c6e9a 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 _0x8555=['toString','utf8','production','DATE','sequelize','STRING','name','TEXT','BLOB','long','preproduction','getDataValue'];(function(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0x8555,0x13c));var _0x5855=function(_0x580ab8,_0x352316){_0x580ab8=_0x580ab8-0x0;var _0x434b28=_0x8555[_0x580ab8];return _0x434b28;};'use strict';var Sequelize=require(_0x5855('0x0'));module['exports']={'name':{'type':Sequelize[_0x5855('0x1')],'unique':_0x5855('0x2'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'notes':{'type':Sequelize[_0x5855('0x3')]},'preproduction':{'type':Sequelize[_0x5855('0x4')](_0x5855('0x5')),'get':function(){if(this['getDataValue'](_0x5855('0x6'))){return this[_0x5855('0x7')](_0x5855('0x6'))[_0x5855('0x8')](_0x5855('0x9'));}}},'production':{'type':Sequelize[_0x5855('0x4')](_0x5855('0x5')),'get':function(){if(this[_0x5855('0x7')](_0x5855('0xa'))){return this[_0x5855('0x7')](_0x5855('0xa'))[_0x5855('0x8')](_0x5855('0x9'));}}},'savedAt':{'type':Sequelize[_0x5855('0xb')]},'publishedAt':{'type':Sequelize[_0x5855('0xb')]}}; \ No newline at end of file +var _0x9592=['name','TEXT','long','getDataValue','preproduction','toString','utf8','BLOB','production','DATE','sequelize','exports','STRING'];(function(_0x4a2193,_0x312076){var _0x634e78=function(_0x35b0b7){while(--_0x35b0b7){_0x4a2193['push'](_0x4a2193['shift']());}};_0x634e78(++_0x312076);}(_0x9592,0x8c));var _0x2959=function(_0x9d9dba,_0x39b98f){_0x9d9dba=_0x9d9dba-0x0;var _0x530ead=_0x9592[_0x9d9dba];return _0x530ead;};'use strict';var Sequelize=require(_0x2959('0x0'));module[_0x2959('0x1')]={'name':{'type':Sequelize[_0x2959('0x2')],'unique':_0x2959('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x2959('0x2')]},'notes':{'type':Sequelize[_0x2959('0x4')]},'preproduction':{'type':Sequelize['BLOB'](_0x2959('0x5')),'get':function(){if(this[_0x2959('0x6')](_0x2959('0x7'))){return this['getDataValue'](_0x2959('0x7'))[_0x2959('0x8')](_0x2959('0x9'));}}},'production':{'type':Sequelize[_0x2959('0xa')]('long'),'get':function(){if(this['getDataValue'](_0x2959('0xb'))){return this[_0x2959('0x6')](_0x2959('0xb'))['toString'](_0x2959('0x9'));}}},'savedAt':{'type':Sequelize['DATE']},'publishedAt':{'type':Sequelize[_0x2959('0xc')]}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index a6e38ce..b01b29c 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 _0xdce7=['map','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','length','sort','pick','merge','where','VIRTUAL','filter','SquareProject','includeAll','include','rows','catch','show','params','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','find','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addUsers','ids','omit','removeUsers','emit','userSquareProject:remove','getUsers','rawAttributes','hasOwnProperty','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./squareProject.socket','register','sendStatus','status','undefined','count','offset','limit','set','Content-Range','json','reject','save','update','then','destroy','get','SquareProjects','error','stack','name','index'];(function(_0xb0d8b8,_0x219459){var _0x53eaf4=function(_0x4e8106){while(--_0x4e8106){_0xb0d8b8['push'](_0xb0d8b8['shift']());}};_0x53eaf4(++_0x219459);}(_0xdce7,0xe9));var _0x7dce=function(_0x11314c,_0x2ca8d7){_0x11314c=_0x11314c-0x0;var _0x12cb4a=_0xdce7[_0x11314c];return _0x12cb4a;};'use strict';var emlformat=require(_0x7dce('0x0'));var rimraf=require(_0x7dce('0x1'));var zipdir=require(_0x7dce('0x2'));var jsonpatch=require(_0x7dce('0x3'));var rp=require('request-promise');var moment=require(_0x7dce('0x4'));var BPromise=require(_0x7dce('0x5'));var Mustache=require(_0x7dce('0x6'));var util=require(_0x7dce('0x7'));var path=require(_0x7dce('0x8'));var sox=require(_0x7dce('0x9'));var csv=require(_0x7dce('0xa'));var ejs=require(_0x7dce('0xb'));var fs=require('fs');var fs_extra=require(_0x7dce('0xc'));var _=require(_0x7dce('0xd'));var squel=require('squel');var crypto=require(_0x7dce('0xe'));var jsforce=require(_0x7dce('0xf'));var deskjs=require(_0x7dce('0x10'));var toCsv=require(_0x7dce('0xa'));var querystring=require(_0x7dce('0x11'));var Papa=require(_0x7dce('0x12'));var Redis=require(_0x7dce('0x13'));var authService=require(_0x7dce('0x14'));var qs=require(_0x7dce('0x15'));var as=require(_0x7dce('0x16'));var hardwareService=require(_0x7dce('0x17'));var logger=require(_0x7dce('0x18'))('api');var utils=require('../../config/utils');var config=require(_0x7dce('0x19'));var licenseUtil=require(_0x7dce('0x1a'));var db=require(_0x7dce('0x1b'))['db'];config[_0x7dce('0x1c')]=_['defaults'](config[_0x7dce('0x1c')],{'host':_0x7dce('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7dce('0x1c')]));require(_0x7dce('0x1e'))[_0x7dce('0x1f')](socket);function respondWithStatusCode(_0xf7757d,_0x5a6801){_0x5a6801=_0x5a6801||0xcc;return function(_0x5cdb47){if(_0x5cdb47){return _0xf7757d[_0x7dce('0x20')](_0x5a6801);}return _0xf7757d[_0x7dce('0x21')](_0x5a6801)['end']();};}function respondWithResult(_0x4b58bb,_0x28eb29){_0x28eb29=_0x28eb29||0xc8;return function(_0x4a33d9){if(_0x4a33d9){return _0x4b58bb[_0x7dce('0x21')](_0x28eb29)['json'](_0x4a33d9);}};}function respondWithFilteredResult(_0x4ece6b,_0xd96643){return function(_0x116042){if(_0x116042){var _0x26f5a9=typeof _0xd96643['offset']==='undefined'&&typeof _0xd96643['limit']===_0x7dce('0x22');var _0x48cec3=_0x116042[_0x7dce('0x23')];var _0x583184=_0x26f5a9?0x0:_0xd96643['offset'];var _0x4c9c89=_0x26f5a9?_0x116042[_0x7dce('0x23')]:_0xd96643[_0x7dce('0x24')]+_0xd96643[_0x7dce('0x25')];var _0x21753f;if(_0x4c9c89>=_0x48cec3){_0x4c9c89=_0x48cec3;_0x21753f=0xc8;}else{_0x21753f=0xce;}_0x4ece6b[_0x7dce('0x21')](_0x21753f);return _0x4ece6b[_0x7dce('0x26')](_0x7dce('0x27'),_0x583184+'-'+_0x4c9c89+'/'+_0x48cec3)[_0x7dce('0x28')](_0x116042);}return null;};}function patchUpdates(_0x202778){return function(_0x535157){try{jsonpatch['apply'](_0x535157,_0x202778,!![]);}catch(_0x25ade7){return BPromise[_0x7dce('0x29')](_0x25ade7);}return _0x535157[_0x7dce('0x2a')]();};}function saveUpdates(_0x57290a,_0x5d4d6b){return function(_0x213cad){if(_0x213cad){return _0x213cad[_0x7dce('0x2b')](_0x57290a)[_0x7dce('0x2c')](function(_0x7a4abe){return _0x7a4abe;});}return null;};}function removeEntity(_0x3c78b3,_0x1587a8){return function(_0xc317ef){if(_0xc317ef){return _0xc317ef[_0x7dce('0x2d')]()[_0x7dce('0x2c')](function(){var _0x3267d4=_0xc317ef[_0x7dce('0x2e')]({'plain':!![]});var _0x10aceb=_0x7dce('0x2f');return db['UserProfileResource']['destroy']({'where':{'type':_0x10aceb,'resourceId':_0x3267d4['id']}})[_0x7dce('0x2c')](function(){return _0xc317ef;});})[_0x7dce('0x2c')](function(){_0x3c78b3[_0x7dce('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x412a47,_0x5256d3){return function(_0x176324){if(!_0x176324){_0x412a47[_0x7dce('0x20')](0x194);}return _0x176324;};}function handleError(_0x4b96bc,_0x17fd9d){_0x17fd9d=_0x17fd9d||0x1f4;return function(_0x2cbfa2){logger[_0x7dce('0x30')](_0x2cbfa2[_0x7dce('0x31')]);if(_0x2cbfa2[_0x7dce('0x32')]){delete _0x2cbfa2[_0x7dce('0x32')];}_0x4b96bc[_0x7dce('0x21')](_0x17fd9d)['send'](_0x2cbfa2);};}exports[_0x7dce('0x33')]=function(_0x14be45,_0x3b4713){var _0x1b385f={},_0x3aa2ef={},_0x2b8646={'count':0x0,'rows':[]};var _0x183652=_[_0x7dce('0x34')](db['SquareProject']['rawAttributes'],function(_0x4afa99){return{'name':_0x4afa99[_0x7dce('0x35')],'type':_0x4afa99[_0x7dce('0x36')][_0x7dce('0x37')]};});_0x3aa2ef[_0x7dce('0x38')]=_[_0x7dce('0x34')](_0x183652,'name');_0x3aa2ef['query']=_[_0x7dce('0x39')](_0x14be45[_0x7dce('0x3a')]);_0x3aa2ef[_0x7dce('0x3b')]=_['intersection'](_0x3aa2ef[_0x7dce('0x38')],_0x3aa2ef[_0x7dce('0x3a')]);_0x1b385f[_0x7dce('0x3c')]=_[_0x7dce('0x3d')](_0x3aa2ef[_0x7dce('0x38')],qs[_0x7dce('0x3e')](_0x14be45['query'][_0x7dce('0x3e')]));_0x1b385f[_0x7dce('0x3c')]=_0x1b385f[_0x7dce('0x3c')][_0x7dce('0x3f')]?_0x1b385f[_0x7dce('0x3c')]:_0x3aa2ef[_0x7dce('0x38')];if(!_0x14be45['query']['hasOwnProperty']('nolimit')){_0x1b385f['limit']=qs[_0x7dce('0x25')](_0x14be45[_0x7dce('0x3a')][_0x7dce('0x25')]);_0x1b385f[_0x7dce('0x24')]=qs[_0x7dce('0x24')](_0x14be45[_0x7dce('0x3a')][_0x7dce('0x24')]);}_0x1b385f['order']=qs[_0x7dce('0x40')](_0x14be45[_0x7dce('0x3a')][_0x7dce('0x40')]);_0x1b385f['where']=qs['filters'](_[_0x7dce('0x41')](_0x14be45['query'],_0x3aa2ef[_0x7dce('0x3b')]),_0x183652);if(_0x14be45[_0x7dce('0x3a')]['filter']){_0x1b385f['where']=_[_0x7dce('0x42')](_0x1b385f[_0x7dce('0x43')],{'$or':_[_0x7dce('0x34')](_0x183652,function(_0x16bc57){if(_0x16bc57[_0x7dce('0x36')]!==_0x7dce('0x44')){var _0x5ed4a7={};_0x5ed4a7[_0x16bc57[_0x7dce('0x32')]]={'$like':'%'+_0x14be45[_0x7dce('0x3a')][_0x7dce('0x45')]+'%'};return _0x5ed4a7;}})});}_0x1b385f=_[_0x7dce('0x42')]({},_0x1b385f,_0x14be45['options']);var _0x1a6a30={'where':_0x1b385f[_0x7dce('0x43')]};return db[_0x7dce('0x46')][_0x7dce('0x23')](_0x1a6a30)[_0x7dce('0x2c')](function(_0x598615){_0x2b8646[_0x7dce('0x23')]=_0x598615;if(_0x14be45[_0x7dce('0x3a')][_0x7dce('0x47')]){_0x1b385f[_0x7dce('0x48')]=[{'all':!![]}];}return db[_0x7dce('0x46')]['findAll'](_0x1b385f);})['then'](function(_0x43b706){_0x2b8646[_0x7dce('0x49')]=_0x43b706;return _0x2b8646;})['then'](respondWithFilteredResult(_0x3b4713,_0x1b385f))[_0x7dce('0x4a')](handleError(_0x3b4713,null));};exports[_0x7dce('0x4b')]=function(_0x19dc09,_0x721fe9){var _0x434445={'raw':![],'where':{'id':_0x19dc09[_0x7dce('0x4c')]['id']}},_0x1885f9={};_0x1885f9[_0x7dce('0x38')]=_['keys'](db[_0x7dce('0x46')]['rawAttributes']);_0x1885f9[_0x7dce('0x3a')]=_['keys'](_0x19dc09['query']);_0x1885f9['filters']=_[_0x7dce('0x3d')](_0x1885f9[_0x7dce('0x38')],_0x1885f9[_0x7dce('0x3a')]);_0x434445[_0x7dce('0x3c')]=_[_0x7dce('0x3d')](_0x1885f9['model'],qs[_0x7dce('0x3e')](_0x19dc09[_0x7dce('0x3a')]['fields']));_0x434445[_0x7dce('0x3c')]=_0x434445['attributes'][_0x7dce('0x3f')]?_0x434445[_0x7dce('0x3c')]:_0x1885f9[_0x7dce('0x38')];if(_0x19dc09[_0x7dce('0x3a')][_0x7dce('0x47')]){_0x434445[_0x7dce('0x48')]=[{'all':!![]}];}_0x434445=_[_0x7dce('0x42')]({},_0x434445,_0x19dc09['options']);return db[_0x7dce('0x46')]['find'](_0x434445)['then'](handleEntityNotFound(_0x721fe9,null))[_0x7dce('0x2c')](respondWithResult(_0x721fe9,null))[_0x7dce('0x4a')](handleError(_0x721fe9,null));};exports[_0x7dce('0x4d')]=function(_0x1e043c,_0x24fff7){return db[_0x7dce('0x46')][_0x7dce('0x4d')](_0x1e043c['body'],{})[_0x7dce('0x2c')](function(_0x3ef54a){var _0x2774bb=_0x1e043c[_0x7dce('0x4e')]['get']({'plain':!![]});if(!_0x2774bb)throw new Error(_0x7dce('0x4f'));if(_0x2774bb['role']===_0x7dce('0x4e')){var _0x377a52=_0x3ef54a[_0x7dce('0x2e')]({'plain':!![]});var _0x3d23bb='SquareProjects';return db['UserProfileSection'][_0x7dce('0x50')]({'where':{'name':_0x3d23bb,'userProfileId':_0x2774bb['userProfileId']},'raw':!![]})[_0x7dce('0x2c')](function(_0x5f3f86){if(_0x5f3f86&&_0x5f3f86[_0x7dce('0x51')]===0x0){return db[_0x7dce('0x52')][_0x7dce('0x4d')]({'name':_0x377a52['name'],'resourceId':_0x377a52['id'],'type':_0x5f3f86['name'],'sectionId':_0x5f3f86['id']},{})[_0x7dce('0x2c')](function(){return _0x3ef54a;});}else{return _0x3ef54a;}})[_0x7dce('0x4a')](function(_0x12f84d){logger['error'](_0x7dce('0x53'),_0x12f84d);throw _0x12f84d;});}return _0x3ef54a;})[_0x7dce('0x2c')](respondWithResult(_0x24fff7,0xc9))[_0x7dce('0x4a')](handleError(_0x24fff7,null));};exports[_0x7dce('0x2b')]=function(_0x58ebae,_0x346bed){if(_0x58ebae[_0x7dce('0x54')]['id']){delete _0x58ebae[_0x7dce('0x54')]['id'];}return db[_0x7dce('0x46')][_0x7dce('0x50')]({'where':{'id':_0x58ebae['params']['id']}})[_0x7dce('0x2c')](handleEntityNotFound(_0x346bed,null))[_0x7dce('0x2c')](saveUpdates(_0x58ebae[_0x7dce('0x54')],null))[_0x7dce('0x2c')](respondWithResult(_0x346bed,null))['catch'](handleError(_0x346bed,null));};exports[_0x7dce('0x2d')]=function(_0x518a2d,_0x353cc2){return db[_0x7dce('0x46')][_0x7dce('0x50')]({'where':{'id':_0x518a2d[_0x7dce('0x4c')]['id']}})[_0x7dce('0x2c')](handleEntityNotFound(_0x353cc2,null))[_0x7dce('0x2c')](removeEntity(_0x353cc2,null))[_0x7dce('0x4a')](handleError(_0x353cc2,null));};exports['addUsers']=function(_0x1d84cb,_0x65dc15,_0x580b5b){return db[_0x7dce('0x46')][_0x7dce('0x50')]({'where':{'id':_0x1d84cb[_0x7dce('0x4c')]['id']}})['then'](handleEntityNotFound(_0x65dc15,null))[_0x7dce('0x2c')](function(_0x256004){if(_0x256004){return _0x256004[_0x7dce('0x55')](_0x1d84cb[_0x7dce('0x54')][_0x7dce('0x56')],_[_0x7dce('0x57')](_0x1d84cb[_0x7dce('0x54')],[_0x7dce('0x56'),'id'])||{});}})['then'](respondWithResult(_0x65dc15,null))['catch'](handleError(_0x65dc15,null));};exports[_0x7dce('0x58')]=function(_0x215df4,_0x57914e,_0x33d7c5){return db['SquareProject'][_0x7dce('0x50')]({'where':{'id':_0x215df4[_0x7dce('0x4c')]['id']}})[_0x7dce('0x2c')](handleEntityNotFound(_0x57914e,null))[_0x7dce('0x2c')](function(_0x154c87){if(_0x154c87){return _0x154c87[_0x7dce('0x58')](_0x215df4[_0x7dce('0x3a')][_0x7dce('0x56')])[_0x7dce('0x2c')](function(){if(_['isArray'](_0x215df4[_0x7dce('0x3a')][_0x7dce('0x56')])){for(var _0x2653b9=0x0;_0x2653b9<_0x215df4['query'][_0x7dce('0x56')][_0x7dce('0x3f')];_0x2653b9+=0x1){socket[_0x7dce('0x59')](_0x7dce('0x5a'),{'UserId':Number(_0x215df4[_0x7dce('0x3a')][_0x7dce('0x56')][_0x2653b9]),'SquareProjectId':Number(_0x215df4['params']['id'])});}}else{socket[_0x7dce('0x59')]('userSquareProject:remove',{'UserId':Number(_0x215df4[_0x7dce('0x3a')][_0x7dce('0x56')]),'SquareProjectId':Number(_0x215df4[_0x7dce('0x4c')]['id'])});}});}})[_0x7dce('0x2c')](respondWithStatusCode(_0x57914e,null))[_0x7dce('0x4a')](handleError(_0x57914e,null));};exports[_0x7dce('0x5b')]=function(_0x3e5747,_0x45d944,_0x3077cd){var _0x52cfe3={};var _0x4d911c={};var _0x3b359e;var _0x26a71f;return db[_0x7dce('0x46')]['findOne']({'where':{'id':_0x3e5747['params']['id']}})[_0x7dce('0x2c')](handleEntityNotFound(_0x45d944,null))['then'](function(_0x40392b){if(_0x40392b){_0x3b359e=_0x40392b;_0x4d911c[_0x7dce('0x38')]=_[_0x7dce('0x39')](db['User'][_0x7dce('0x5c')]);_0x4d911c['query']=_[_0x7dce('0x39')](_0x3e5747[_0x7dce('0x3a')]);_0x4d911c[_0x7dce('0x3b')]=_[_0x7dce('0x3d')](_0x4d911c['model'],_0x4d911c['query']);_0x52cfe3[_0x7dce('0x3c')]=_[_0x7dce('0x3d')](_0x4d911c[_0x7dce('0x38')],qs[_0x7dce('0x3e')](_0x3e5747[_0x7dce('0x3a')][_0x7dce('0x3e')]));_0x52cfe3[_0x7dce('0x3c')]=_0x52cfe3[_0x7dce('0x3c')]['length']?_0x52cfe3[_0x7dce('0x3c')]:_0x4d911c[_0x7dce('0x38')];_0x52cfe3['order']=qs['sort'](_0x3e5747[_0x7dce('0x3a')][_0x7dce('0x40')]);_0x52cfe3[_0x7dce('0x43')]=qs[_0x7dce('0x3b')](_[_0x7dce('0x41')](_0x3e5747[_0x7dce('0x3a')],_0x4d911c[_0x7dce('0x3b')]));if(_0x3e5747[_0x7dce('0x3a')][_0x7dce('0x45')]){_0x52cfe3[_0x7dce('0x43')]=_['merge'](_0x52cfe3[_0x7dce('0x43')],{'$or':_[_0x7dce('0x34')](_0x52cfe3['attributes'],function(_0x1433d9){var _0x2d54e2={};_0x2d54e2[_0x1433d9]={'$like':'%'+_0x3e5747[_0x7dce('0x3a')][_0x7dce('0x45')]+'%'};return _0x2d54e2;})});}_0x52cfe3=_[_0x7dce('0x42')]({},_0x52cfe3,_0x3e5747['options']);return _0x3b359e[_0x7dce('0x5b')](_0x52cfe3);}})[_0x7dce('0x2c')](function(_0x74a9f3){if(_0x74a9f3){_0x26a71f=_0x74a9f3[_0x7dce('0x3f')];if(!_0x3e5747[_0x7dce('0x3a')][_0x7dce('0x5d')](_0x7dce('0x5e'))){_0x52cfe3[_0x7dce('0x25')]=qs[_0x7dce('0x25')](_0x3e5747[_0x7dce('0x3a')][_0x7dce('0x25')]);_0x52cfe3[_0x7dce('0x24')]=qs[_0x7dce('0x24')](_0x3e5747[_0x7dce('0x3a')][_0x7dce('0x24')]);}return _0x3b359e[_0x7dce('0x5b')](_0x52cfe3);}})[_0x7dce('0x2c')](function(_0x58ad23){if(_0x58ad23){return _0x58ad23?{'count':_0x26a71f,'rows':_0x58ad23}:null;}})[_0x7dce('0x2c')](respondWithResult(_0x45d944,null))[_0x7dce('0x4a')](handleError(_0x45d944,null));}; \ No newline at end of file +var _0x99cd=['lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','./squareProject.socket','register','sendStatus','status','end','json','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','get','SquareProjects','UserProfileResource','destroy','error','stack','name','send','index','map','SquareProject','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','limit','order','sort','pick','where','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','params','create','body','user','role','UserProfileSection','find','userProfileId','autoAssociation','addUsers','ids','omit','removeUsers','emit','getUsers','length','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra'];(function(_0x1d4bf4,_0x341a91){var _0x2d9639=function(_0x187880){while(--_0x187880){_0x1d4bf4['push'](_0x1d4bf4['shift']());}};_0x2d9639(++_0x341a91);}(_0x99cd,0x1d4));var _0xd99c=function(_0x47df56,_0x14356a){_0x47df56=_0x47df56-0x0;var _0xed4913=_0x99cd[_0x47df56];return _0xed4913;};'use strict';var emlformat=require(_0xd99c('0x0'));var rimraf=require(_0xd99c('0x1'));var zipdir=require(_0xd99c('0x2'));var jsonpatch=require(_0xd99c('0x3'));var rp=require(_0xd99c('0x4'));var moment=require(_0xd99c('0x5'));var BPromise=require(_0xd99c('0x6'));var Mustache=require(_0xd99c('0x7'));var util=require('util');var path=require(_0xd99c('0x8'));var sox=require('sox');var csv=require(_0xd99c('0x9'));var ejs=require(_0xd99c('0xa'));var fs=require('fs');var fs_extra=require(_0xd99c('0xb'));var _=require(_0xd99c('0xc'));var squel=require(_0xd99c('0xd'));var crypto=require(_0xd99c('0xe'));var jsforce=require(_0xd99c('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xd99c('0x10'));var Papa=require(_0xd99c('0x11'));var Redis=require(_0xd99c('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xd99c('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd99c('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xd99c('0x15'));var config=require(_0xd99c('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xd99c('0x17'))['db'];config[_0xd99c('0x18')]=_[_0xd99c('0x19')](config[_0xd99c('0x18')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd99c('0x18')]));require(_0xd99c('0x1a'))[_0xd99c('0x1b')](socket);function respondWithStatusCode(_0x319ac4,_0x239bba){_0x239bba=_0x239bba||0xcc;return function(_0x27fcd6){if(_0x27fcd6){return _0x319ac4[_0xd99c('0x1c')](_0x239bba);}return _0x319ac4[_0xd99c('0x1d')](_0x239bba)[_0xd99c('0x1e')]();};}function respondWithResult(_0x4f099f,_0x1910e5){_0x1910e5=_0x1910e5||0xc8;return function(_0xaff3aa){if(_0xaff3aa){return _0x4f099f[_0xd99c('0x1d')](_0x1910e5)[_0xd99c('0x1f')](_0xaff3aa);}};}function respondWithFilteredResult(_0x54ec49,_0x2ede98){return function(_0x59c8ff){if(_0x59c8ff){var _0x41a901=typeof _0x2ede98['offset']==='undefined'&&typeof _0x2ede98['limit']===_0xd99c('0x20');var _0x5d017c=_0x59c8ff[_0xd99c('0x21')];var _0x43b4ae=_0x41a901?0x0:_0x2ede98[_0xd99c('0x22')];var _0x5c9159=_0x41a901?_0x59c8ff[_0xd99c('0x21')]:_0x2ede98[_0xd99c('0x22')]+_0x2ede98['limit'];var _0x460a03;if(_0x5c9159>=_0x5d017c){_0x5c9159=_0x5d017c;_0x460a03=0xc8;}else{_0x460a03=0xce;}_0x54ec49[_0xd99c('0x1d')](_0x460a03);return _0x54ec49[_0xd99c('0x23')](_0xd99c('0x24'),_0x43b4ae+'-'+_0x5c9159+'/'+_0x5d017c)[_0xd99c('0x1f')](_0x59c8ff);}return null;};}function patchUpdates(_0x3f4435){return function(_0x341cf2){try{jsonpatch[_0xd99c('0x25')](_0x341cf2,_0x3f4435,!![]);}catch(_0x36dff6){return BPromise[_0xd99c('0x26')](_0x36dff6);}return _0x341cf2[_0xd99c('0x27')]();};}function saveUpdates(_0x4be5ec,_0x26a2cf){return function(_0x5869d1){if(_0x5869d1){return _0x5869d1[_0xd99c('0x28')](_0x4be5ec)[_0xd99c('0x29')](function(_0x298146){return _0x298146;});}return null;};}function removeEntity(_0x372c37,_0x437dcd){return function(_0x2003ab){if(_0x2003ab){return _0x2003ab['destroy']()[_0xd99c('0x29')](function(){var _0x5d3af5=_0x2003ab[_0xd99c('0x2a')]({'plain':!![]});var _0xb15f3=_0xd99c('0x2b');return db[_0xd99c('0x2c')][_0xd99c('0x2d')]({'where':{'type':_0xb15f3,'resourceId':_0x5d3af5['id']}})['then'](function(){return _0x2003ab;});})[_0xd99c('0x29')](function(){_0x372c37[_0xd99c('0x1d')](0xcc)[_0xd99c('0x1e')]();});}};}function handleEntityNotFound(_0x2277fb,_0x58fad0){return function(_0x1a7bb2){if(!_0x1a7bb2){_0x2277fb[_0xd99c('0x1c')](0x194);}return _0x1a7bb2;};}function handleError(_0x24d6ad,_0x4150dc){_0x4150dc=_0x4150dc||0x1f4;return function(_0x28b54d){logger[_0xd99c('0x2e')](_0x28b54d[_0xd99c('0x2f')]);if(_0x28b54d[_0xd99c('0x30')]){delete _0x28b54d[_0xd99c('0x30')];}_0x24d6ad['status'](_0x4150dc)[_0xd99c('0x31')](_0x28b54d);};}exports[_0xd99c('0x32')]=function(_0x17f36a,_0x3b51c1){var _0x58d414={},_0xeb8d32={},_0x459e0c={'count':0x0,'rows':[]};var _0x2a5cb5=_[_0xd99c('0x33')](db[_0xd99c('0x34')][_0xd99c('0x35')],function(_0x3e36c1){return{'name':_0x3e36c1[_0xd99c('0x36')],'type':_0x3e36c1[_0xd99c('0x37')][_0xd99c('0x38')]};});_0xeb8d32[_0xd99c('0x39')]=_[_0xd99c('0x33')](_0x2a5cb5,_0xd99c('0x30'));_0xeb8d32[_0xd99c('0x3a')]=_[_0xd99c('0x3b')](_0x17f36a[_0xd99c('0x3a')]);_0xeb8d32[_0xd99c('0x3c')]=_[_0xd99c('0x3d')](_0xeb8d32[_0xd99c('0x39')],_0xeb8d32['query']);_0x58d414[_0xd99c('0x3e')]=_[_0xd99c('0x3d')](_0xeb8d32['model'],qs[_0xd99c('0x3f')](_0x17f36a[_0xd99c('0x3a')]['fields']));_0x58d414[_0xd99c('0x3e')]=_0x58d414[_0xd99c('0x3e')]['length']?_0x58d414[_0xd99c('0x3e')]:_0xeb8d32[_0xd99c('0x39')];if(!_0x17f36a['query'][_0xd99c('0x40')]('nolimit')){_0x58d414[_0xd99c('0x41')]=qs[_0xd99c('0x41')](_0x17f36a['query'][_0xd99c('0x41')]);_0x58d414[_0xd99c('0x22')]=qs['offset'](_0x17f36a['query'][_0xd99c('0x22')]);}_0x58d414[_0xd99c('0x42')]=qs['sort'](_0x17f36a[_0xd99c('0x3a')][_0xd99c('0x43')]);_0x58d414['where']=qs[_0xd99c('0x3c')](_[_0xd99c('0x44')](_0x17f36a['query'],_0xeb8d32[_0xd99c('0x3c')]),_0x2a5cb5);if(_0x17f36a[_0xd99c('0x3a')]['filter']){_0x58d414['where']=_['merge'](_0x58d414[_0xd99c('0x45')],{'$or':_[_0xd99c('0x33')](_0x2a5cb5,function(_0x4c70ce){if(_0x4c70ce[_0xd99c('0x37')]!==_0xd99c('0x46')){var _0x25cc22={};_0x25cc22[_0x4c70ce[_0xd99c('0x30')]]={'$like':'%'+_0x17f36a[_0xd99c('0x3a')][_0xd99c('0x47')]+'%'};return _0x25cc22;}})});}_0x58d414=_[_0xd99c('0x48')]({},_0x58d414,_0x17f36a[_0xd99c('0x49')]);var _0x3cc558={'where':_0x58d414[_0xd99c('0x45')]};return db[_0xd99c('0x34')][_0xd99c('0x21')](_0x3cc558)['then'](function(_0xa25781){_0x459e0c[_0xd99c('0x21')]=_0xa25781;if(_0x17f36a[_0xd99c('0x3a')][_0xd99c('0x4a')]){_0x58d414[_0xd99c('0x4b')]=[{'all':!![]}];}return db[_0xd99c('0x34')][_0xd99c('0x4c')](_0x58d414);})[_0xd99c('0x29')](function(_0x3d2093){_0x459e0c[_0xd99c('0x4d')]=_0x3d2093;return _0x459e0c;})['then'](respondWithFilteredResult(_0x3b51c1,_0x58d414))[_0xd99c('0x4e')](handleError(_0x3b51c1,null));};exports['show']=function(_0x301ad4,_0x3acc32){var _0x2a4281={'raw':![],'where':{'id':_0x301ad4[_0xd99c('0x4f')]['id']}},_0x3c96ca={};_0x3c96ca[_0xd99c('0x39')]=_[_0xd99c('0x3b')](db['SquareProject']['rawAttributes']);_0x3c96ca[_0xd99c('0x3a')]=_['keys'](_0x301ad4[_0xd99c('0x3a')]);_0x3c96ca[_0xd99c('0x3c')]=_[_0xd99c('0x3d')](_0x3c96ca[_0xd99c('0x39')],_0x3c96ca[_0xd99c('0x3a')]);_0x2a4281[_0xd99c('0x3e')]=_[_0xd99c('0x3d')](_0x3c96ca[_0xd99c('0x39')],qs['fields'](_0x301ad4[_0xd99c('0x3a')][_0xd99c('0x3f')]));_0x2a4281[_0xd99c('0x3e')]=_0x2a4281[_0xd99c('0x3e')]['length']?_0x2a4281[_0xd99c('0x3e')]:_0x3c96ca[_0xd99c('0x39')];if(_0x301ad4[_0xd99c('0x3a')][_0xd99c('0x4a')]){_0x2a4281[_0xd99c('0x4b')]=[{'all':!![]}];}_0x2a4281=_['merge']({},_0x2a4281,_0x301ad4[_0xd99c('0x49')]);return db[_0xd99c('0x34')]['find'](_0x2a4281)[_0xd99c('0x29')](handleEntityNotFound(_0x3acc32,null))[_0xd99c('0x29')](respondWithResult(_0x3acc32,null))[_0xd99c('0x4e')](handleError(_0x3acc32,null));};exports[_0xd99c('0x50')]=function(_0x5d9f27,_0x33df5e){return db[_0xd99c('0x34')][_0xd99c('0x50')](_0x5d9f27[_0xd99c('0x51')],{})[_0xd99c('0x29')](function(_0x1f7b12){var _0xa0d445=_0x5d9f27[_0xd99c('0x52')][_0xd99c('0x2a')]({'plain':!![]});if(!_0xa0d445)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xa0d445[_0xd99c('0x53')]===_0xd99c('0x52')){var _0x33a423=_0x1f7b12[_0xd99c('0x2a')]({'plain':!![]});var _0x152171=_0xd99c('0x2b');return db[_0xd99c('0x54')][_0xd99c('0x55')]({'where':{'name':_0x152171,'userProfileId':_0xa0d445[_0xd99c('0x56')]},'raw':!![]})[_0xd99c('0x29')](function(_0x288cd4){if(_0x288cd4&&_0x288cd4[_0xd99c('0x57')]===0x0){return db['UserProfileResource']['create']({'name':_0x33a423[_0xd99c('0x30')],'resourceId':_0x33a423['id'],'type':_0x288cd4[_0xd99c('0x30')],'sectionId':_0x288cd4['id']},{})['then'](function(){return _0x1f7b12;});}else{return _0x1f7b12;}})[_0xd99c('0x4e')](function(_0x1a127d){logger[_0xd99c('0x2e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1a127d);throw _0x1a127d;});}return _0x1f7b12;})[_0xd99c('0x29')](respondWithResult(_0x33df5e,0xc9))[_0xd99c('0x4e')](handleError(_0x33df5e,null));};exports[_0xd99c('0x28')]=function(_0x546ed1,_0x27bd08){if(_0x546ed1[_0xd99c('0x51')]['id']){delete _0x546ed1[_0xd99c('0x51')]['id'];}return db[_0xd99c('0x34')][_0xd99c('0x55')]({'where':{'id':_0x546ed1[_0xd99c('0x4f')]['id']}})[_0xd99c('0x29')](handleEntityNotFound(_0x27bd08,null))[_0xd99c('0x29')](saveUpdates(_0x546ed1['body'],null))['then'](respondWithResult(_0x27bd08,null))['catch'](handleError(_0x27bd08,null));};exports[_0xd99c('0x2d')]=function(_0x447fcc,_0x57456f){return db[_0xd99c('0x34')][_0xd99c('0x55')]({'where':{'id':_0x447fcc[_0xd99c('0x4f')]['id']}})[_0xd99c('0x29')](handleEntityNotFound(_0x57456f,null))[_0xd99c('0x29')](removeEntity(_0x57456f,null))['catch'](handleError(_0x57456f,null));};exports[_0xd99c('0x58')]=function(_0x32fa10,_0x3d58b1,_0x215e82){return db[_0xd99c('0x34')][_0xd99c('0x55')]({'where':{'id':_0x32fa10[_0xd99c('0x4f')]['id']}})[_0xd99c('0x29')](handleEntityNotFound(_0x3d58b1,null))['then'](function(_0x1fc8d2){if(_0x1fc8d2){return _0x1fc8d2[_0xd99c('0x58')](_0x32fa10['body'][_0xd99c('0x59')],_[_0xd99c('0x5a')](_0x32fa10['body'],['ids','id'])||{});}})[_0xd99c('0x29')](respondWithResult(_0x3d58b1,null))[_0xd99c('0x4e')](handleError(_0x3d58b1,null));};exports[_0xd99c('0x5b')]=function(_0xaecb65,_0x30917f,_0x1bd9ef){return db['SquareProject']['find']({'where':{'id':_0xaecb65[_0xd99c('0x4f')]['id']}})[_0xd99c('0x29')](handleEntityNotFound(_0x30917f,null))[_0xd99c('0x29')](function(_0x58b2c1){if(_0x58b2c1){return _0x58b2c1['removeUsers'](_0xaecb65[_0xd99c('0x3a')][_0xd99c('0x59')])[_0xd99c('0x29')](function(){if(_['isArray'](_0xaecb65['query'][_0xd99c('0x59')])){for(var _0x12ce6f=0x0;_0x12ce6f<_0xaecb65[_0xd99c('0x3a')]['ids']['length'];_0x12ce6f+=0x1){socket[_0xd99c('0x5c')]('userSquareProject:remove',{'UserId':Number(_0xaecb65[_0xd99c('0x3a')][_0xd99c('0x59')][_0x12ce6f]),'SquareProjectId':Number(_0xaecb65[_0xd99c('0x4f')]['id'])});}}else{socket[_0xd99c('0x5c')]('userSquareProject:remove',{'UserId':Number(_0xaecb65[_0xd99c('0x3a')][_0xd99c('0x59')]),'SquareProjectId':Number(_0xaecb65[_0xd99c('0x4f')]['id'])});}});}})[_0xd99c('0x29')](respondWithStatusCode(_0x30917f,null))['catch'](handleError(_0x30917f,null));};exports[_0xd99c('0x5d')]=function(_0x41f687,_0x3076a7,_0x4ea21d){var _0x53d1ee={};var _0x2735b7={};var _0x158041;var _0x245920;return db[_0xd99c('0x34')]['findOne']({'where':{'id':_0x41f687[_0xd99c('0x4f')]['id']}})['then'](handleEntityNotFound(_0x3076a7,null))[_0xd99c('0x29')](function(_0x5dcae6){if(_0x5dcae6){_0x158041=_0x5dcae6;_0x2735b7[_0xd99c('0x39')]=_[_0xd99c('0x3b')](db['User']['rawAttributes']);_0x2735b7[_0xd99c('0x3a')]=_[_0xd99c('0x3b')](_0x41f687[_0xd99c('0x3a')]);_0x2735b7[_0xd99c('0x3c')]=_[_0xd99c('0x3d')](_0x2735b7[_0xd99c('0x39')],_0x2735b7[_0xd99c('0x3a')]);_0x53d1ee[_0xd99c('0x3e')]=_[_0xd99c('0x3d')](_0x2735b7['model'],qs['fields'](_0x41f687[_0xd99c('0x3a')][_0xd99c('0x3f')]));_0x53d1ee[_0xd99c('0x3e')]=_0x53d1ee[_0xd99c('0x3e')][_0xd99c('0x5e')]?_0x53d1ee[_0xd99c('0x3e')]:_0x2735b7[_0xd99c('0x39')];_0x53d1ee[_0xd99c('0x42')]=qs[_0xd99c('0x43')](_0x41f687['query'][_0xd99c('0x43')]);_0x53d1ee[_0xd99c('0x45')]=qs[_0xd99c('0x3c')](_['pick'](_0x41f687['query'],_0x2735b7[_0xd99c('0x3c')]));if(_0x41f687['query']['filter']){_0x53d1ee[_0xd99c('0x45')]=_[_0xd99c('0x48')](_0x53d1ee[_0xd99c('0x45')],{'$or':_[_0xd99c('0x33')](_0x53d1ee[_0xd99c('0x3e')],function(_0x26561d){var _0x578658={};_0x578658[_0x26561d]={'$like':'%'+_0x41f687[_0xd99c('0x3a')][_0xd99c('0x47')]+'%'};return _0x578658;})});}_0x53d1ee=_['merge']({},_0x53d1ee,_0x41f687['options']);return _0x158041[_0xd99c('0x5d')](_0x53d1ee);}})[_0xd99c('0x29')](function(_0xdc961){if(_0xdc961){_0x245920=_0xdc961['length'];if(!_0x41f687[_0xd99c('0x3a')][_0xd99c('0x40')](_0xd99c('0x5f'))){_0x53d1ee[_0xd99c('0x41')]=qs[_0xd99c('0x41')](_0x41f687['query'][_0xd99c('0x41')]);_0x53d1ee[_0xd99c('0x22')]=qs['offset'](_0x41f687[_0xd99c('0x3a')]['offset']);}return _0x158041['getUsers'](_0x53d1ee);}})[_0xd99c('0x29')](function(_0x5edf37){if(_0x5edf37){return _0x5edf37?{'count':_0x245920,'rows':_0x5edf37}:null;}})[_0xd99c('0x29')](respondWithResult(_0x3076a7,null))[_0xd99c('0x4e')](handleError(_0x3076a7,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index 1b7fbbe..358f1d3 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 _0x631d=['emit','hasOwnProperty','exports','../../mysqldb','SquareProject','save','update','remove'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x631d,0x6b));var _0xd631=function(_0x1b5f0b,_0x498dca){_0x1b5f0b=_0x1b5f0b-0x0;var _0x55f5c1=_0x631d[_0x1b5f0b];return _0x55f5c1;};'use strict';var EventEmitter=require('events');var SquareProject=require(_0xd631('0x0'))['db'][_0xd631('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd631('0x2'),'afterUpdate':_0xd631('0x3'),'afterDestroy':_0xd631('0x4')};function emitEvent(_0x4bde9a){return function(_0x92246c,_0x3e5d8b,_0x39865b){SquareProjectEvents[_0xd631('0x5')](_0x4bde9a+':'+_0x92246c['id'],_0x92246c);SquareProjectEvents[_0xd631('0x5')](_0x4bde9a,_0x92246c);_0x39865b(null);};}for(var e in events){if(events[_0xd631('0x6')](e)){var event=events[e];SquareProject['hook'](e,emitEvent(event));}}module[_0xd631('0x7')]=SquareProjectEvents; \ No newline at end of file +var _0xdd48=['emit','hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0x51b690,_0x380f88){var _0x15e2c3=function(_0x5577c8){while(--_0x5577c8){_0x51b690['push'](_0x51b690['shift']());}};_0x15e2c3(++_0x380f88);}(_0xdd48,0x81));var _0x8dd4=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xdd48[_0x17d9e3];return _0x14192d;};'use strict';var EventEmitter=require(_0x8dd4('0x0'));var SquareProject=require(_0x8dd4('0x1'))['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x8dd4('0x2')](0x0);var events={'afterCreate':_0x8dd4('0x3'),'afterUpdate':_0x8dd4('0x4'),'afterDestroy':_0x8dd4('0x5')};function emitEvent(_0x20985c){return function(_0x5eac4b,_0x246d05,_0x386f91){SquareProjectEvents[_0x8dd4('0x6')](_0x20985c+':'+_0x5eac4b['id'],_0x5eac4b);SquareProjectEvents[_0x8dd4('0x6')](_0x20985c,_0x5eac4b);_0x386f91(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject[_0x8dd4('0x7')](e,emitEvent(event));}}module[_0x8dd4('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 dafb13d..c74624d 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 _0x75f9=['publishedAt','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./squareProject.attributes','exports','define','SquareProject','square_projects','changed','preproduction','format','YYYY-MM-DD\x20HH:mm:ss','production'];(function(_0x46a635,_0x3cf6f0){var _0xff72f1=function(_0x3ac57b){while(--_0x3ac57b){_0x46a635['push'](_0x46a635['shift']());}};_0xff72f1(++_0x3cf6f0);}(_0x75f9,0xbf));var _0x975f=function(_0x17928f,_0x4ad33f){_0x17928f=_0x17928f-0x0;var _0x500b63=_0x75f9[_0x17928f];return _0x500b63;};'use strict';var _=require(_0x975f('0x0'));var util=require(_0x975f('0x1'));var logger=require('../../config/logger')(_0x975f('0x2'));var moment=require('moment');var BPromise=require(_0x975f('0x3'));var rp=require(_0x975f('0x4'));var fs=require('fs');var path=require(_0x975f('0x5'));var rimraf=require(_0x975f('0x6'));var config=require(_0x975f('0x7'));var attributes=require(_0x975f('0x8'));module[_0x975f('0x9')]=function(_0x24f399,_0x39f437){return _0x24f399[_0x975f('0xa')](_0x975f('0xb'),attributes,{'tableName':_0x975f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x416ea5,_0x2f2a5b,_0x3556d8){if(_0x416ea5[_0x975f('0xd')](_0x975f('0xe'))){_0x416ea5['savedAt']=moment()[_0x975f('0xf')](_0x975f('0x10'));}if(_0x416ea5[_0x975f('0xd')](_0x975f('0x11'))){_0x416ea5[_0x975f('0x12')]=moment()[_0x975f('0xf')](_0x975f('0x10'));}_0x3556d8(null,_0x416ea5);}}});}; \ No newline at end of file +var _0x8ee9=['changed','preproduction','YYYY-MM-DD\x20HH:mm:ss','publishedAt','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareProject.attributes','exports','define','SquareProject','square_projects'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x8ee9,0x190));var _0x98ee=function(_0x180a9c,_0x330b9b){_0x180a9c=_0x180a9c-0x0;var _0x3acfcd=_0x8ee9[_0x180a9c];return _0x3acfcd;};'use strict';var _=require(_0x98ee('0x0'));var util=require(_0x98ee('0x1'));var logger=require('../../config/logger')(_0x98ee('0x2'));var moment=require(_0x98ee('0x3'));var BPromise=require(_0x98ee('0x4'));var rp=require(_0x98ee('0x5'));var fs=require('fs');var path=require(_0x98ee('0x6'));var rimraf=require(_0x98ee('0x7'));var config=require(_0x98ee('0x8'));var attributes=require(_0x98ee('0x9'));module[_0x98ee('0xa')]=function(_0x53af0b,_0x1be989){return _0x53af0b[_0x98ee('0xb')](_0x98ee('0xc'),attributes,{'tableName':_0x98ee('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1516e0,_0x51c133,_0x2a13c1){if(_0x1516e0[_0x98ee('0xe')](_0x98ee('0xf'))){_0x1516e0['savedAt']=moment()['format'](_0x98ee('0x10'));}if(_0x1516e0[_0x98ee('0xe')]('production')){_0x1516e0[_0x98ee('0x11')]=moment()['format'](_0x98ee('0x10'));}_0x2a13c1(null,_0x1516e0);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index 6263b7b..66c42c6 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 _0xc52f=['socket.io-emitter','redis','./squareProject.socket','request','info','SquareProject,\x20%s,\x20%s','request\x20sent','debug','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','find','options','raw','where','attributes','map','include','model','then','ShowSquareProject','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','localhost'];(function(_0x2266da,_0x1b7d01){var _0x467539=function(_0x30e766){while(--_0x30e766){_0x2266da['push'](_0x2266da['shift']());}};_0x467539(++_0x1b7d01);}(_0xc52f,0x69));var _0xfc52=function(_0xaedd4c,_0x1e47e0){_0xaedd4c=_0xaedd4c-0x0;var _0x4702fd=_0xc52f[_0xaedd4c];return _0x4702fd;};'use strict';var _=require(_0xfc52('0x0'));var util=require(_0xfc52('0x1'));var moment=require(_0xfc52('0x2'));var BPromise=require(_0xfc52('0x3'));var rs=require(_0xfc52('0x4'));var fs=require('fs');var Redis=require(_0xfc52('0x5'));var db=require(_0xfc52('0x6'))['db'];var utils=require(_0xfc52('0x7'));var logger=require(_0xfc52('0x8'))(_0xfc52('0x9'));var config=require(_0xfc52('0xa'));var jayson=require(_0xfc52('0xb'));var client=jayson['client'][_0xfc52('0xc')]({'port':0x232a});config['redis']=_[_0xfc52('0xd')](config['redis'],{'host':_0xfc52('0xe'),'port':0x18eb});var socket=require(_0xfc52('0xf'))(new Redis(config[_0xfc52('0x10')]));require(_0xfc52('0x11'))['register'](socket);function respondWithRpcPromise(_0x5e20be,_0xa3e2dc,_0x59ed21){return new BPromise(function(_0x128df7,_0x32125d){return client[_0xfc52('0x12')](_0x5e20be,_0x59ed21)['then'](function(_0x22cc7b){logger[_0xfc52('0x13')](_0xfc52('0x14'),_0xa3e2dc,_0xfc52('0x15'));logger[_0xfc52('0x16')](_0xfc52('0x17'),_0xa3e2dc,_0xfc52('0x15'),JSON[_0xfc52('0x18')](_0x22cc7b));if(_0x22cc7b[_0xfc52('0x19')]){if(_0x22cc7b[_0xfc52('0x19')][_0xfc52('0x1a')]===0x1f4){logger[_0xfc52('0x19')]('SquareProject,\x20%s,\x20%s',_0xa3e2dc,_0x22cc7b[_0xfc52('0x19')]['message']);return _0x32125d(_0x22cc7b[_0xfc52('0x19')]['message']);}logger[_0xfc52('0x19')]('SquareProject,\x20%s,\x20%s',_0xa3e2dc,_0x22cc7b['error'][_0xfc52('0x1b')]);return _0x128df7(_0x22cc7b[_0xfc52('0x19')][_0xfc52('0x1b')]);}else{logger[_0xfc52('0x13')](_0xfc52('0x14'),_0xa3e2dc,_0xfc52('0x15'));_0x128df7(_0x22cc7b[_0xfc52('0x1c')][_0xfc52('0x1b')]);}})[_0xfc52('0x1d')](function(_0x1b5fd1){logger[_0xfc52('0x19')](_0xfc52('0x14'),_0xa3e2dc,_0x1b5fd1);_0x32125d(_0x1b5fd1);});});}exports['ShowSquareProject']=function(_0x5ba635){var _0x58e7a7=this;return new Promise(function(_0x2d683c,_0x348f0){return db['SquareProject'][_0xfc52('0x1e')]({'raw':_0x5ba635['options']?_0x5ba635[_0xfc52('0x1f')][_0xfc52('0x20')]===undefined?!![]:![]:!![],'where':_0x5ba635[_0xfc52('0x1f')]?_0x5ba635[_0xfc52('0x1f')][_0xfc52('0x21')]||null:null,'attributes':_0x5ba635['options']?_0x5ba635[_0xfc52('0x1f')][_0xfc52('0x22')]||null:null,'include':_0x5ba635['options']?_0x5ba635[_0xfc52('0x1f')]['include']?_[_0xfc52('0x23')](_0x5ba635[_0xfc52('0x1f')][_0xfc52('0x24')],function(_0x5f5b3f){return{'model':db[_0x5f5b3f[_0xfc52('0x25')]],'as':_0x5f5b3f['as'],'attributes':_0x5f5b3f['attributes'],'include':_0x5f5b3f[_0xfc52('0x24')]?_['map'](_0x5f5b3f[_0xfc52('0x24')],function(_0x460c38){return{'model':db[_0x460c38[_0xfc52('0x25')]],'as':_0x460c38['as'],'attributes':_0x460c38[_0xfc52('0x22')],'include':_0x460c38[_0xfc52('0x24')]?_[_0xfc52('0x23')](_0x460c38[_0xfc52('0x24')],function(_0x182170){return{'model':db[_0x182170[_0xfc52('0x25')]],'as':_0x182170['as'],'attributes':_0x182170['attributes']};}):[]};}):[]};}):[]:[]})[_0xfc52('0x26')](function(_0x2c795f){logger[_0xfc52('0x13')](_0xfc52('0x27'),_0x5ba635);logger[_0xfc52('0x16')](_0xfc52('0x27'),_0x5ba635,JSON[_0xfc52('0x18')](_0x2c795f));_0x2d683c(_0x2c795f);})[_0xfc52('0x1d')](function(_0x2fe3e3){logger[_0xfc52('0x19')](_0xfc52('0x27'),_0x2fe3e3['message'],_0x5ba635);_0x348f0(_0x58e7a7[_0xfc52('0x19')](0x1f4,_0x2fe3e3[_0xfc52('0x1b')]));});});}; \ No newline at end of file +var _0xed2b=['randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./squareProject.socket','register','request','then','info','request\x20sent','SquareProject,\x20%s,\x20%s,\x20%s','error','code','message','SquareProject,\x20%s,\x20%s','result','catch','find','options','raw','include','map','model','attributes','ShowSquareProject','debug','stringify','lodash','util','bluebird'];(function(_0x119be0,_0x30f510){var _0x2c5aa2=function(_0x284174){while(--_0x284174){_0x119be0['push'](_0x119be0['shift']());}};_0x2c5aa2(++_0x30f510);}(_0xed2b,0xbb));var _0xbed2=function(_0x588cbd,_0x43b872){_0x588cbd=_0x588cbd-0x0;var _0x571e75=_0xed2b[_0x588cbd];return _0x571e75;};'use strict';var _=require(_0xbed2('0x0'));var util=require(_0xbed2('0x1'));var moment=require('moment');var BPromise=require(_0xbed2('0x2'));var rs=require(_0xbed2('0x3'));var fs=require('fs');var Redis=require(_0xbed2('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbed2('0x5'));var logger=require(_0xbed2('0x6'))('rpc');var config=require(_0xbed2('0x7'));var jayson=require(_0xbed2('0x8'));var client=jayson[_0xbed2('0x9')][_0xbed2('0xa')]({'port':0x232a});config['redis']=_[_0xbed2('0xb')](config[_0xbed2('0xc')],{'host':_0xbed2('0xd'),'port':0x18eb});var socket=require(_0xbed2('0xe'))(new Redis(config['redis']));require(_0xbed2('0xf'))[_0xbed2('0x10')](socket);function respondWithRpcPromise(_0x588596,_0x170137,_0x4cf29f){return new BPromise(function(_0x39527b,_0x464a1c){return client[_0xbed2('0x11')](_0x588596,_0x4cf29f)[_0xbed2('0x12')](function(_0x3f96b9){logger[_0xbed2('0x13')]('SquareProject,\x20%s,\x20%s',_0x170137,_0xbed2('0x14'));logger['debug'](_0xbed2('0x15'),_0x170137,_0xbed2('0x14'),JSON['stringify'](_0x3f96b9));if(_0x3f96b9[_0xbed2('0x16')]){if(_0x3f96b9[_0xbed2('0x16')][_0xbed2('0x17')]===0x1f4){logger[_0xbed2('0x16')]('SquareProject,\x20%s,\x20%s',_0x170137,_0x3f96b9[_0xbed2('0x16')]['message']);return _0x464a1c(_0x3f96b9[_0xbed2('0x16')][_0xbed2('0x18')]);}logger[_0xbed2('0x16')](_0xbed2('0x19'),_0x170137,_0x3f96b9[_0xbed2('0x16')]['message']);return _0x39527b(_0x3f96b9['error'][_0xbed2('0x18')]);}else{logger[_0xbed2('0x13')](_0xbed2('0x19'),_0x170137,_0xbed2('0x14'));_0x39527b(_0x3f96b9[_0xbed2('0x1a')][_0xbed2('0x18')]);}})[_0xbed2('0x1b')](function(_0x1691b1){logger[_0xbed2('0x16')](_0xbed2('0x19'),_0x170137,_0x1691b1);_0x464a1c(_0x1691b1);});});}exports['ShowSquareProject']=function(_0xbaeff0){var _0x8c5e1f=this;return new Promise(function(_0x18525f,_0x11b444){return db['SquareProject'][_0xbed2('0x1c')]({'raw':_0xbaeff0[_0xbed2('0x1d')]?_0xbaeff0[_0xbed2('0x1d')][_0xbed2('0x1e')]===undefined?!![]:![]:!![],'where':_0xbaeff0[_0xbed2('0x1d')]?_0xbaeff0['options']['where']||null:null,'attributes':_0xbaeff0[_0xbed2('0x1d')]?_0xbaeff0[_0xbed2('0x1d')]['attributes']||null:null,'include':_0xbaeff0[_0xbed2('0x1d')]?_0xbaeff0[_0xbed2('0x1d')][_0xbed2('0x1f')]?_[_0xbed2('0x20')](_0xbaeff0['options']['include'],function(_0x55ae07){return{'model':db[_0x55ae07[_0xbed2('0x21')]],'as':_0x55ae07['as'],'attributes':_0x55ae07['attributes'],'include':_0x55ae07[_0xbed2('0x1f')]?_['map'](_0x55ae07[_0xbed2('0x1f')],function(_0x3eb881){return{'model':db[_0x3eb881['model']],'as':_0x3eb881['as'],'attributes':_0x3eb881[_0xbed2('0x22')],'include':_0x3eb881[_0xbed2('0x1f')]?_[_0xbed2('0x20')](_0x3eb881['include'],function(_0x5e5d96){return{'model':db[_0x5e5d96['model']],'as':_0x5e5d96['as'],'attributes':_0x5e5d96[_0xbed2('0x22')]};}):[]};}):[]};}):[]:[]})[_0xbed2('0x12')](function(_0x5e12a8){logger[_0xbed2('0x13')](_0xbed2('0x23'),_0xbaeff0);logger[_0xbed2('0x24')]('ShowSquareProject',_0xbaeff0,JSON[_0xbed2('0x25')](_0x5e12a8));_0x18525f(_0x5e12a8);})[_0xbed2('0x1b')](function(_0x59888e){logger[_0xbed2('0x16')](_0xbed2('0x23'),_0x59888e[_0xbed2('0x18')],_0xbaeff0);_0x11b444(_0x8c5e1f[_0xbed2('0x16')](0x1f4,_0x59888e[_0xbed2('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index c9243b5..bd4729d 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 _0x9fb8=['save','remove','update','length','squareProject:','./squareProject.events'];(function(_0x47d6b2,_0x35b42d){var _0x395b74=function(_0x118ba4){while(--_0x118ba4){_0x47d6b2['push'](_0x47d6b2['shift']());}};_0x395b74(++_0x35b42d);}(_0x9fb8,0x1a3));var _0x89fb=function(_0x8a2dae,_0x2a21a7){_0x8a2dae=_0x8a2dae-0x0;var _0x308f20=_0x9fb8[_0x8a2dae];return _0x308f20;};'use strict';var SquareProjectEvents=require(_0x89fb('0x0'));var events=[_0x89fb('0x1'),_0x89fb('0x2'),_0x89fb('0x3')];function createListener(_0x103028,_0x613576){return function(_0x47a494){_0x613576['emit'](_0x103028,_0x47a494);};}function removeListener(_0x531640,_0x554fa0){return function(){SquareProjectEvents['removeListener'](_0x531640,_0x554fa0);};}exports['register']=function(_0x3f3138){for(var _0x5d940d=0x0,_0x2b5a36=events[_0x89fb('0x4')];_0x5d940d<_0x2b5a36;_0x5d940d++){var _0x598e52=events[_0x5d940d];var _0x5dabe1=createListener(_0x89fb('0x5')+_0x598e52,_0x3f3138);SquareProjectEvents['on'](_0x598e52,_0x5dabe1);}}; \ No newline at end of file +var _0xfc75=['emit','removeListener','register','squareProject:','./squareProject.events','save','remove','update'];(function(_0xe3a39a,_0x34a536){var _0x432501=function(_0x164844){while(--_0x164844){_0xe3a39a['push'](_0xe3a39a['shift']());}};_0x432501(++_0x34a536);}(_0xfc75,0x19c));var _0x5fc7=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xfc75[_0x502c7d];return _0x30b7ed;};'use strict';var SquareProjectEvents=require(_0x5fc7('0x0'));var events=[_0x5fc7('0x1'),_0x5fc7('0x2'),_0x5fc7('0x3')];function createListener(_0x51b514,_0x91081c){return function(_0x23639a){_0x91081c[_0x5fc7('0x4')](_0x51b514,_0x23639a);};}function removeListener(_0x80e365,_0x25da93){return function(){SquareProjectEvents[_0x5fc7('0x5')](_0x80e365,_0x25da93);};}exports[_0x5fc7('0x6')]=function(_0x15d3c4){for(var _0x5e9c3a=0x0,_0x5b4253=events['length'];_0x5e9c3a<_0x5b4253;_0x5e9c3a++){var _0x10c9bf=events[_0x5e9c3a];var _0x11b7ab=createListener(_0x5fc7('0x7')+_0x10c9bf,_0x15d3c4);SquareProjectEvents['on'](_0x10c9bf,_0x11b7ab);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index 5f557de..083db32 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(_0x1797f7,_0x3960f8){var _0x72f34=function(_0x1bf81f){while(--_0x1bf81f){_0x1797f7['push'](_0x1797f7['shift']());}};_0x72f34(++_0x3960f8);}(_0x4975,0x86));var _0x5497=function(_0x27d175,_0x41ef6c){_0x27d175=_0x27d175-0x0;var _0xca6bcc=_0x4975[_0x27d175];return _0xca6bcc;};'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 _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(_0x2cabc7,_0x4378ca){var _0x4aed93=function(_0xeb8f07){while(--_0xeb8f07){_0x2cabc7['push'](_0x2cabc7['shift']());}};_0x4aed93(++_0x4378ca);}(_0x4975,0x86));var _0x5497=function(_0x574491,_0x36459e){_0x574491=_0x574491-0x0;var _0x49e592=_0x4975[_0x574491];return _0x49e592;};'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 diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index be01ee7..7440475 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 _0x032e=['VIRTUAL','getDataValue','savePath','substring','lastIndexOf','sequelize','STRING'];(function(_0x37ea1e,_0x5b7201){var _0x128c04=function(_0x2aa0c6){while(--_0x2aa0c6){_0x37ea1e['push'](_0x37ea1e['shift']());}};_0x128c04(++_0x5b7201);}(_0x032e,0x124));var _0xe032=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0x032e[_0x110c3d];return _0x226d67;};'use strict';var Sequelize=require(_0xe032('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe032('0x1')]},'callerid':{'type':Sequelize[_0xe032('0x1')]},'calleridname':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0xe032('0x1')]},'priority':{'type':Sequelize[_0xe032('0x1')]},'accountcode':{'type':Sequelize[_0xe032('0x1')]},'dnid':{'type':Sequelize[_0xe032('0x1')]},'projectName':{'type':Sequelize[_0xe032('0x1')]},'saveName':{'type':Sequelize[_0xe032('0x1')]},'filename':{'type':Sequelize[_0xe032('0x1')]},'savePath':{'type':Sequelize[_0xe032('0x1')]},'format':{'type':Sequelize[_0xe032('0x2')],'get':function(){var _0x1576c8='';var _0x3289b0=this[_0xe032('0x3')](_0xe032('0x4'));if(_0x3289b0){_0x1576c8=_0x3289b0[_0xe032('0x5')](_0x3289b0[_0xe032('0x6')]('.'));}return _0x1576c8;}}}; \ No newline at end of file +var _0x207c=['savePath','substring','exports','STRING','VIRTUAL','getDataValue'];(function(_0x2d94a5,_0x4af2a5){var _0x16cc8e=function(_0x2b0bee){while(--_0x2b0bee){_0x2d94a5['push'](_0x2d94a5['shift']());}};_0x16cc8e(++_0x4af2a5);}(_0x207c,0x1e8));var _0xc207=function(_0x1f184a,_0x19ff0c){_0x1f184a=_0x1f184a-0x0;var _0x5780b1=_0x207c[_0x1f184a];return _0x5780b1;};'use strict';var Sequelize=require('sequelize');module[_0xc207('0x0')]={'uniqueid':{'type':Sequelize[_0xc207('0x1')]},'callerid':{'type':Sequelize[_0xc207('0x1')]},'calleridname':{'type':Sequelize[_0xc207('0x1')]},'context':{'type':Sequelize[_0xc207('0x1')]},'extension':{'type':Sequelize[_0xc207('0x1')]},'priority':{'type':Sequelize[_0xc207('0x1')]},'accountcode':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0xc207('0x1')]},'projectName':{'type':Sequelize['STRING']},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize['STRING']},'savePath':{'type':Sequelize[_0xc207('0x1')]},'format':{'type':Sequelize[_0xc207('0x2')],'get':function(){var _0x3395e4='';var _0x59ff6f=this[_0xc207('0x3')](_0xc207('0x4'));if(_0x59ff6f){_0x3395e4=_0x59ff6f[_0xc207('0x5')](_0x59ff6f['lastIndexOf']('.'));}return _0x3395e4;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index 19e626a..a40af4c 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 _0x1d90=['../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','destroy','end','error','name','send','index','map','fieldName','type','model','keys','filters','query','attributes','intersection','fields','length','order','where','pick','filter','merge','VIRTUAL','options','SquareRecording','includeAll','findAll','catch','show','params','include','find','create','body','../../components/encryptor','uniqueid','filename','format','%s.cypher','existsSync','decryptFile','savePath','Sequelize','download','unlink','SquareRecording\x20not\x20found','Not\x20found','isNil','Entity\x20not\x20found','info','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','unlinkSync','rimraf','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x5dec53,_0x5e3fce){var _0x44fceb=function(_0x2ce4fd){while(--_0x2ce4fd){_0x5dec53['push'](_0x5dec53['shift']());}};_0x44fceb(++_0x5e3fce);}(_0x1d90,0x157));var _0x01d9=function(_0xa388a2,_0x40bde6){_0xa388a2=_0xa388a2-0x0;var _0x7ce7f6=_0x1d90[_0xa388a2];return _0x7ce7f6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x01d9('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x01d9('0x1'));var BPromise=require(_0x01d9('0x2'));var Mustache=require(_0x01d9('0x3'));var util=require('util');var path=require(_0x01d9('0x4'));var sox=require(_0x01d9('0x5'));var csv=require(_0x01d9('0x6'));var ejs=require(_0x01d9('0x7'));var fs=require('fs');var fs_extra=require(_0x01d9('0x8'));var _=require(_0x01d9('0x9'));var squel=require(_0x01d9('0xa'));var crypto=require(_0x01d9('0xb'));var jsforce=require(_0x01d9('0xc'));var deskjs=require(_0x01d9('0xd'));var toCsv=require(_0x01d9('0x6'));var querystring=require(_0x01d9('0xe'));var Papa=require(_0x01d9('0xf'));var Redis=require(_0x01d9('0x10'));var authService=require(_0x01d9('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x01d9('0x12'));var logger=require(_0x01d9('0x13'))(_0x01d9('0x14'));var utils=require(_0x01d9('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x01d9('0x16'));var db=require(_0x01d9('0x17'))['db'];function respondWithStatusCode(_0x58faf1,_0x4d526e){_0x4d526e=_0x4d526e||0xcc;return function(_0x17b0f8){if(_0x17b0f8){return _0x58faf1[_0x01d9('0x18')](_0x4d526e);}return _0x58faf1[_0x01d9('0x19')](_0x4d526e)['end']();};}function respondWithResult(_0x41744f,_0x485c5b){_0x485c5b=_0x485c5b||0xc8;return function(_0x5a8c43){if(_0x5a8c43){return _0x41744f['status'](_0x485c5b)[_0x01d9('0x1a')](_0x5a8c43);}};}function respondWithFilteredResult(_0x4341dc,_0x4622a0){return function(_0xc6c061){if(_0xc6c061){var _0x47d6b3=typeof _0x4622a0['offset']===_0x01d9('0x1b')&&typeof _0x4622a0[_0x01d9('0x1c')]==='undefined';var _0x105877=_0xc6c061['count'];var _0x8e22ee=_0x47d6b3?0x0:_0x4622a0['offset'];var _0x8f5e60=_0x47d6b3?_0xc6c061[_0x01d9('0x1d')]:_0x4622a0[_0x01d9('0x1e')]+_0x4622a0[_0x01d9('0x1c')];var _0x4c44e9;if(_0x8f5e60>=_0x105877){_0x8f5e60=_0x105877;_0x4c44e9=0xc8;}else{_0x4c44e9=0xce;}_0x4341dc[_0x01d9('0x19')](_0x4c44e9);return _0x4341dc[_0x01d9('0x1f')](_0x01d9('0x20'),_0x8e22ee+'-'+_0x8f5e60+'/'+_0x105877)['json'](_0xc6c061);}return null;};}function patchUpdates(_0x5e1520){return function(_0x406436){try{jsonpatch['apply'](_0x406436,_0x5e1520,!![]);}catch(_0x3bee78){return BPromise[_0x01d9('0x21')](_0x3bee78);}return _0x406436[_0x01d9('0x22')]();};}function saveUpdates(_0x42f7e0,_0x44dbc8){return function(_0x1309b7){if(_0x1309b7){return _0x1309b7[_0x01d9('0x23')](_0x42f7e0)[_0x01d9('0x24')](function(_0x1e971d){return _0x1e971d;});}return null;};}function removeEntity(_0x226a3a,_0x1f462f){return function(_0x321d62){if(_0x321d62){return _0x321d62[_0x01d9('0x25')]()[_0x01d9('0x24')](function(){_0x226a3a['status'](0xcc)[_0x01d9('0x26')]();});}};}function handleEntityNotFound(_0x59e9a1,_0x331336){return function(_0x59ca03){if(!_0x59ca03){_0x59e9a1[_0x01d9('0x18')](0x194);}return _0x59ca03;};}function handleError(_0x75f4b9,_0x465ace){_0x465ace=_0x465ace||0x1f4;return function(_0x5b0463){logger[_0x01d9('0x27')](_0x5b0463['stack']);if(_0x5b0463[_0x01d9('0x28')]){delete _0x5b0463[_0x01d9('0x28')];}_0x75f4b9[_0x01d9('0x19')](_0x465ace)[_0x01d9('0x29')](_0x5b0463);};}exports[_0x01d9('0x2a')]=function(_0x2bbeb9,_0x2ed9ec){var _0xcad8d6={},_0x3de29e={},_0x343f97={'count':0x0,'rows':[]};var _0xa077c5=_[_0x01d9('0x2b')](db['SquareRecording']['rawAttributes'],function(_0x5c7b5b){return{'name':_0x5c7b5b[_0x01d9('0x2c')],'type':_0x5c7b5b[_0x01d9('0x2d')]['key']};});_0x3de29e[_0x01d9('0x2e')]=_[_0x01d9('0x2b')](_0xa077c5,'name');_0x3de29e['query']=_[_0x01d9('0x2f')](_0x2bbeb9['query']);_0x3de29e[_0x01d9('0x30')]=_['intersection'](_0x3de29e[_0x01d9('0x2e')],_0x3de29e[_0x01d9('0x31')]);_0xcad8d6[_0x01d9('0x32')]=_[_0x01d9('0x33')](_0x3de29e[_0x01d9('0x2e')],qs[_0x01d9('0x34')](_0x2bbeb9[_0x01d9('0x31')][_0x01d9('0x34')]));_0xcad8d6[_0x01d9('0x32')]=_0xcad8d6['attributes'][_0x01d9('0x35')]?_0xcad8d6[_0x01d9('0x32')]:_0x3de29e[_0x01d9('0x2e')];if(!_0x2bbeb9[_0x01d9('0x31')]['hasOwnProperty']('nolimit')){_0xcad8d6[_0x01d9('0x1c')]=qs[_0x01d9('0x1c')](_0x2bbeb9[_0x01d9('0x31')]['limit']);_0xcad8d6['offset']=qs[_0x01d9('0x1e')](_0x2bbeb9[_0x01d9('0x31')][_0x01d9('0x1e')]);}_0xcad8d6[_0x01d9('0x36')]=qs['sort'](_0x2bbeb9['query']['sort']);_0xcad8d6[_0x01d9('0x37')]=qs[_0x01d9('0x30')](_[_0x01d9('0x38')](_0x2bbeb9[_0x01d9('0x31')],_0x3de29e[_0x01d9('0x30')]),_0xa077c5);if(_0x2bbeb9['query'][_0x01d9('0x39')]){_0xcad8d6[_0x01d9('0x37')]=_[_0x01d9('0x3a')](_0xcad8d6[_0x01d9('0x37')],{'$or':_[_0x01d9('0x2b')](_0xa077c5,function(_0x28a89a){if(_0x28a89a[_0x01d9('0x2d')]!==_0x01d9('0x3b')){var _0x781b73={};_0x781b73[_0x28a89a[_0x01d9('0x28')]]={'$like':'%'+_0x2bbeb9[_0x01d9('0x31')][_0x01d9('0x39')]+'%'};return _0x781b73;}})});}_0xcad8d6=_[_0x01d9('0x3a')]({},_0xcad8d6,_0x2bbeb9[_0x01d9('0x3c')]);var _0x371197={'where':_0xcad8d6[_0x01d9('0x37')]};return db[_0x01d9('0x3d')][_0x01d9('0x1d')](_0x371197)[_0x01d9('0x24')](function(_0x37eefa){_0x343f97[_0x01d9('0x1d')]=_0x37eefa;if(_0x2bbeb9[_0x01d9('0x31')][_0x01d9('0x3e')]){_0xcad8d6['include']=[{'all':!![]}];}return db['SquareRecording'][_0x01d9('0x3f')](_0xcad8d6);})[_0x01d9('0x24')](function(_0x3f0ec6){_0x343f97['rows']=_0x3f0ec6;return _0x343f97;})[_0x01d9('0x24')](respondWithFilteredResult(_0x2ed9ec,_0xcad8d6))[_0x01d9('0x40')](handleError(_0x2ed9ec,null));};exports[_0x01d9('0x41')]=function(_0x395c70,_0xeae29e){var _0x27ad75={'raw':!![],'where':{'id':_0x395c70[_0x01d9('0x42')]['id']}},_0x3a1b3b={};_0x3a1b3b[_0x01d9('0x2e')]=_[_0x01d9('0x2f')](db[_0x01d9('0x3d')]['rawAttributes']);_0x3a1b3b[_0x01d9('0x31')]=_[_0x01d9('0x2f')](_0x395c70[_0x01d9('0x31')]);_0x3a1b3b[_0x01d9('0x30')]=_[_0x01d9('0x33')](_0x3a1b3b[_0x01d9('0x2e')],_0x3a1b3b[_0x01d9('0x31')]);_0x27ad75[_0x01d9('0x32')]=_['intersection'](_0x3a1b3b[_0x01d9('0x2e')],qs[_0x01d9('0x34')](_0x395c70[_0x01d9('0x31')][_0x01d9('0x34')]));_0x27ad75['attributes']=_0x27ad75[_0x01d9('0x32')]['length']?_0x27ad75[_0x01d9('0x32')]:_0x3a1b3b[_0x01d9('0x2e')];if(_0x395c70[_0x01d9('0x31')][_0x01d9('0x3e')]){_0x27ad75[_0x01d9('0x43')]=[{'all':!![]}];}_0x27ad75=_[_0x01d9('0x3a')]({},_0x27ad75,_0x395c70['options']);return db['SquareRecording'][_0x01d9('0x44')](_0x27ad75)[_0x01d9('0x24')](handleEntityNotFound(_0xeae29e,null))[_0x01d9('0x24')](respondWithResult(_0xeae29e,null))['catch'](handleError(_0xeae29e,null));};exports[_0x01d9('0x45')]=function(_0x4f1892,_0x1f9944){return db[_0x01d9('0x3d')]['create'](_0x4f1892[_0x01d9('0x46')],{})[_0x01d9('0x24')](respondWithResult(_0x1f9944,0xc9))[_0x01d9('0x40')](handleError(_0x1f9944,null));};exports[_0x01d9('0x23')]=function(_0x4afaaa,_0x5539d2){if(_0x4afaaa[_0x01d9('0x46')]['id']){delete _0x4afaaa[_0x01d9('0x46')]['id'];}return db['SquareRecording'][_0x01d9('0x44')]({'where':{'id':_0x4afaaa[_0x01d9('0x42')]['id']}})[_0x01d9('0x24')](handleEntityNotFound(_0x5539d2,null))[_0x01d9('0x24')](saveUpdates(_0x4afaaa[_0x01d9('0x46')],null))[_0x01d9('0x24')](respondWithResult(_0x5539d2,null))['catch'](handleError(_0x5539d2,null));};exports['download']=function(_0x2f19ad,_0x230987,_0x10dab4){var _0x121ec4=require(_0x01d9('0x47'));var _0x290573=![];var _0x3beeda={};if(_0x2f19ad[_0x01d9('0x31')][_0x01d9('0x2d')]&&_0x2f19ad[_0x01d9('0x31')]['type']===_0x01d9('0x48')){_0x3beeda['uniqueid']=_0x2f19ad[_0x01d9('0x42')]['id'];}else{_0x3beeda['id']=_0x2f19ad[_0x01d9('0x42')]['id'];}return db[_0x01d9('0x3d')]['find']({'where':_0x3beeda,'attributes':['id','savePath',_0x01d9('0x49')],'raw':!![]})['then'](handleEntityNotFound(_0x230987,null))['then'](function(_0x4c1cf2){if(_0x4c1cf2){var _0x5620b3=_0x4c1cf2['savePath'];var _0x3cee42=util[_0x01d9('0x4a')](_0x01d9('0x4b'),_0x5620b3);if(fs[_0x01d9('0x4c')](_0x3cee42)){_0x290573=!![];return _0x121ec4[_0x01d9('0x4d')](_0x3cee42,_0x5620b3,config['secrets']['recording'])[_0x01d9('0x24')](function(){return _0x4c1cf2;});}return _0x4c1cf2;}})[_0x01d9('0x24')](function(_0x10f8a7){if(_0x10f8a7){var _0x835f69=_0x10f8a7[_0x01d9('0x4e')];if(!fs[_0x01d9('0x4c')](_0x835f69)){throw new db[(_0x01d9('0x4f'))]['ValidationError']('SquareRecording\x20not\x20found');}if(_0x10f8a7['filename']){return _0x230987[_0x01d9('0x50')](_0x835f69,_0x10f8a7['filename']+path['extname'](_0x835f69),function(){if(_0x290573){fs[_0x01d9('0x51')](_0x835f69);}});}else{return _0x230987[_0x01d9('0x50')](_0x835f69,function(_0x1f74b5){if(_0x290573){fs[_0x01d9('0x51')](_0x835f69);}});}}})[_0x01d9('0x40')](function(_0x190ef4){if(_0x190ef4['message']===_0x01d9('0x52')){_0x230987[_0x01d9('0x19')](0x194)[_0x01d9('0x29')](_0x01d9('0x53'));}else{return handleError(_0x230987,null);}});};exports[_0x01d9('0x25')]=function(_0x3f3894,_0x207325){return db[_0x01d9('0x3d')][_0x01d9('0x44')]({'where':{'id':_0x3f3894[_0x01d9('0x42')]['id']}})[_0x01d9('0x24')](function(_0x2ec6ee){if(_[_0x01d9('0x54')](_0x2ec6ee)){throw new ReferenceError(_0x01d9('0x55'));}return _0x2ec6ee;})[_0x01d9('0x24')](function(_0x56d308){var _0x525271=_0x56d308[_0x01d9('0x4e')];logger[_0x01d9('0x56')]('cancellazione\x20fisica\x20documento\x20%s',_0x525271);if(!_[_0x01d9('0x54')](_0x56d308['savePath'])&&fs[_0x01d9('0x4c')](_0x525271)){logger['info']('File:\x20\x22'+_0x525271+_0x01d9('0x57'));fs['unlinkSync'](_0x525271);}_0x525271=_0x525271+_0x01d9('0x58');if(!_['isNil'](_0x56d308[_0x01d9('0x4e')])&&fs[_0x01d9('0x4c')](_0x525271)){logger['info']('File:\x20\x22'+_0x525271+_0x01d9('0x57'));fs[_0x01d9('0x59')](_0x525271);}return _0x56d308;})['then'](function(_0x3c8d0b){if(!_0x3c8d0b)throw new InternalError();return _0x3c8d0b['destroy']();})[_0x01d9('0x24')](function(){_0x207325[_0x01d9('0x19')](0xcc)[_0x01d9('0x26')]();})[_0x01d9('0x40')](handleError(_0x207325,null));}; \ No newline at end of file +var _0xd588=['model','attributes','fields','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','options','SquareRecording','includeAll','findAll','rows','show','params','keys','rawAttributes','length','include','find','catch','create','body','update','../../components/encryptor','uniqueid','savePath','filename','format','%s.cypher','existsSync','secrets','recording','ValidationError','SquareRecording\x20not\x20found','download','extname','unlink','Not\x20found','isNil','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','reject','then','destroy','end','error','stack','name','send','index','map','fieldName','type','key','query','filters','intersection'];(function(_0x53f122,_0x2cdeca){var _0x59a134=function(_0x41468d){while(--_0x41468d){_0x53f122['push'](_0x53f122['shift']());}};_0x59a134(++_0x2cdeca);}(_0xd588,0x90));var _0x8d58=function(_0x56442c,_0x46f7cd){_0x56442c=_0x56442c-0x0;var _0x5ed5dc=_0xd588[_0x56442c];return _0x5ed5dc;};'use strict';var emlformat=require(_0x8d58('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8d58('0x1'));var jsonpatch=require(_0x8d58('0x2'));var rp=require(_0x8d58('0x3'));var moment=require('moment');var BPromise=require(_0x8d58('0x4'));var Mustache=require(_0x8d58('0x5'));var util=require('util');var path=require(_0x8d58('0x6'));var sox=require(_0x8d58('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8d58('0x8'));var _=require(_0x8d58('0x9'));var squel=require(_0x8d58('0xa'));var crypto=require(_0x8d58('0xb'));var jsforce=require(_0x8d58('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x8d58('0xd'));var Papa=require(_0x8d58('0xe'));var Redis=require(_0x8d58('0xf'));var authService=require(_0x8d58('0x10'));var qs=require(_0x8d58('0x11'));var as=require(_0x8d58('0x12'));var hardwareService=require(_0x8d58('0x13'));var logger=require(_0x8d58('0x14'))(_0x8d58('0x15'));var utils=require(_0x8d58('0x16'));var config=require(_0x8d58('0x17'));var licenseUtil=require(_0x8d58('0x18'));var db=require(_0x8d58('0x19'))['db'];function respondWithStatusCode(_0x38a7c8,_0x2abc35){_0x2abc35=_0x2abc35||0xcc;return function(_0x3d57b7){if(_0x3d57b7){return _0x38a7c8[_0x8d58('0x1a')](_0x2abc35);}return _0x38a7c8[_0x8d58('0x1b')](_0x2abc35)['end']();};}function respondWithResult(_0x190e28,_0x37b7fd){_0x37b7fd=_0x37b7fd||0xc8;return function(_0x5c54d8){if(_0x5c54d8){return _0x190e28[_0x8d58('0x1b')](_0x37b7fd)[_0x8d58('0x1c')](_0x5c54d8);}};}function respondWithFilteredResult(_0x3a0eb2,_0x4b1d6c){return function(_0x1f6245){if(_0x1f6245){var _0x4fc422=typeof _0x4b1d6c[_0x8d58('0x1d')]===_0x8d58('0x1e')&&typeof _0x4b1d6c[_0x8d58('0x1f')]==='undefined';var _0x2e21b6=_0x1f6245['count'];var _0x517bad=_0x4fc422?0x0:_0x4b1d6c[_0x8d58('0x1d')];var _0xc6bd9c=_0x4fc422?_0x1f6245[_0x8d58('0x20')]:_0x4b1d6c[_0x8d58('0x1d')]+_0x4b1d6c[_0x8d58('0x1f')];var _0x1b39ca;if(_0xc6bd9c>=_0x2e21b6){_0xc6bd9c=_0x2e21b6;_0x1b39ca=0xc8;}else{_0x1b39ca=0xce;}_0x3a0eb2[_0x8d58('0x1b')](_0x1b39ca);return _0x3a0eb2[_0x8d58('0x21')]('Content-Range',_0x517bad+'-'+_0xc6bd9c+'/'+_0x2e21b6)[_0x8d58('0x1c')](_0x1f6245);}return null;};}function patchUpdates(_0x3e6ef0){return function(_0x246e36){try{jsonpatch['apply'](_0x246e36,_0x3e6ef0,!![]);}catch(_0x4566e2){return BPromise[_0x8d58('0x22')](_0x4566e2);}return _0x246e36['save']();};}function saveUpdates(_0x3a47aa,_0x45e4a9){return function(_0x390f16){if(_0x390f16){return _0x390f16['update'](_0x3a47aa)[_0x8d58('0x23')](function(_0x357dac){return _0x357dac;});}return null;};}function removeEntity(_0x40fff2,_0x4f2989){return function(_0x54afdc){if(_0x54afdc){return _0x54afdc[_0x8d58('0x24')]()[_0x8d58('0x23')](function(){_0x40fff2['status'](0xcc)[_0x8d58('0x25')]();});}};}function handleEntityNotFound(_0x4d94ee,_0x51488c){return function(_0x1ca8ec){if(!_0x1ca8ec){_0x4d94ee[_0x8d58('0x1a')](0x194);}return _0x1ca8ec;};}function handleError(_0x1f2ce9,_0x545764){_0x545764=_0x545764||0x1f4;return function(_0x5ba7dd){logger[_0x8d58('0x26')](_0x5ba7dd[_0x8d58('0x27')]);if(_0x5ba7dd[_0x8d58('0x28')]){delete _0x5ba7dd[_0x8d58('0x28')];}_0x1f2ce9[_0x8d58('0x1b')](_0x545764)[_0x8d58('0x29')](_0x5ba7dd);};}exports[_0x8d58('0x2a')]=function(_0x1d4eb5,_0x48cb62){var _0x1446aa={},_0x1f3920={},_0x32e267={'count':0x0,'rows':[]};var _0x5430fd=_[_0x8d58('0x2b')](db['SquareRecording']['rawAttributes'],function(_0x5d3886){return{'name':_0x5d3886[_0x8d58('0x2c')],'type':_0x5d3886[_0x8d58('0x2d')][_0x8d58('0x2e')]};});_0x1f3920['model']=_[_0x8d58('0x2b')](_0x5430fd,_0x8d58('0x28'));_0x1f3920[_0x8d58('0x2f')]=_['keys'](_0x1d4eb5[_0x8d58('0x2f')]);_0x1f3920[_0x8d58('0x30')]=_[_0x8d58('0x31')](_0x1f3920[_0x8d58('0x32')],_0x1f3920[_0x8d58('0x2f')]);_0x1446aa[_0x8d58('0x33')]=_[_0x8d58('0x31')](_0x1f3920[_0x8d58('0x32')],qs[_0x8d58('0x34')](_0x1d4eb5[_0x8d58('0x2f')][_0x8d58('0x34')]));_0x1446aa[_0x8d58('0x33')]=_0x1446aa[_0x8d58('0x33')]['length']?_0x1446aa['attributes']:_0x1f3920['model'];if(!_0x1d4eb5['query'][_0x8d58('0x35')](_0x8d58('0x36'))){_0x1446aa[_0x8d58('0x1f')]=qs[_0x8d58('0x1f')](_0x1d4eb5['query'][_0x8d58('0x1f')]);_0x1446aa['offset']=qs[_0x8d58('0x1d')](_0x1d4eb5[_0x8d58('0x2f')][_0x8d58('0x1d')]);}_0x1446aa['order']=qs[_0x8d58('0x37')](_0x1d4eb5[_0x8d58('0x2f')][_0x8d58('0x37')]);_0x1446aa[_0x8d58('0x38')]=qs[_0x8d58('0x30')](_['pick'](_0x1d4eb5[_0x8d58('0x2f')],_0x1f3920[_0x8d58('0x30')]),_0x5430fd);if(_0x1d4eb5[_0x8d58('0x2f')][_0x8d58('0x39')]){_0x1446aa[_0x8d58('0x38')]=_['merge'](_0x1446aa[_0x8d58('0x38')],{'$or':_['map'](_0x5430fd,function(_0x339653){if(_0x339653[_0x8d58('0x2d')]!==_0x8d58('0x3a')){var _0x3a1a12={};_0x3a1a12[_0x339653[_0x8d58('0x28')]]={'$like':'%'+_0x1d4eb5[_0x8d58('0x2f')][_0x8d58('0x39')]+'%'};return _0x3a1a12;}})});}_0x1446aa=_[_0x8d58('0x3b')]({},_0x1446aa,_0x1d4eb5[_0x8d58('0x3c')]);var _0x1718bd={'where':_0x1446aa[_0x8d58('0x38')]};return db[_0x8d58('0x3d')][_0x8d58('0x20')](_0x1718bd)[_0x8d58('0x23')](function(_0x312214){_0x32e267['count']=_0x312214;if(_0x1d4eb5[_0x8d58('0x2f')][_0x8d58('0x3e')]){_0x1446aa['include']=[{'all':!![]}];}return db['SquareRecording'][_0x8d58('0x3f')](_0x1446aa);})[_0x8d58('0x23')](function(_0x1a4ab6){_0x32e267[_0x8d58('0x40')]=_0x1a4ab6;return _0x32e267;})['then'](respondWithFilteredResult(_0x48cb62,_0x1446aa))['catch'](handleError(_0x48cb62,null));};exports[_0x8d58('0x41')]=function(_0x42f4f1,_0x4453a6){var _0x1cc66b={'raw':!![],'where':{'id':_0x42f4f1[_0x8d58('0x42')]['id']}},_0x4782dd={};_0x4782dd[_0x8d58('0x32')]=_[_0x8d58('0x43')](db[_0x8d58('0x3d')][_0x8d58('0x44')]);_0x4782dd[_0x8d58('0x2f')]=_[_0x8d58('0x43')](_0x42f4f1[_0x8d58('0x2f')]);_0x4782dd[_0x8d58('0x30')]=_[_0x8d58('0x31')](_0x4782dd[_0x8d58('0x32')],_0x4782dd[_0x8d58('0x2f')]);_0x1cc66b[_0x8d58('0x33')]=_[_0x8d58('0x31')](_0x4782dd['model'],qs['fields'](_0x42f4f1[_0x8d58('0x2f')][_0x8d58('0x34')]));_0x1cc66b['attributes']=_0x1cc66b['attributes'][_0x8d58('0x45')]?_0x1cc66b[_0x8d58('0x33')]:_0x4782dd['model'];if(_0x42f4f1[_0x8d58('0x2f')][_0x8d58('0x3e')]){_0x1cc66b[_0x8d58('0x46')]=[{'all':!![]}];}_0x1cc66b=_[_0x8d58('0x3b')]({},_0x1cc66b,_0x42f4f1['options']);return db[_0x8d58('0x3d')][_0x8d58('0x47')](_0x1cc66b)[_0x8d58('0x23')](handleEntityNotFound(_0x4453a6,null))['then'](respondWithResult(_0x4453a6,null))[_0x8d58('0x48')](handleError(_0x4453a6,null));};exports[_0x8d58('0x49')]=function(_0x3e357c,_0x462eb1){return db[_0x8d58('0x3d')][_0x8d58('0x49')](_0x3e357c[_0x8d58('0x4a')],{})[_0x8d58('0x23')](respondWithResult(_0x462eb1,0xc9))[_0x8d58('0x48')](handleError(_0x462eb1,null));};exports[_0x8d58('0x4b')]=function(_0x107eea,_0x2d13ac){if(_0x107eea[_0x8d58('0x4a')]['id']){delete _0x107eea['body']['id'];}return db[_0x8d58('0x3d')][_0x8d58('0x47')]({'where':{'id':_0x107eea['params']['id']}})['then'](handleEntityNotFound(_0x2d13ac,null))[_0x8d58('0x23')](saveUpdates(_0x107eea[_0x8d58('0x4a')],null))[_0x8d58('0x23')](respondWithResult(_0x2d13ac,null))[_0x8d58('0x48')](handleError(_0x2d13ac,null));};exports['download']=function(_0x5d9e79,_0x205010,_0x15f0e6){var _0x2b3820=require(_0x8d58('0x4c'));var _0x55b192=![];var _0x59c767={};if(_0x5d9e79[_0x8d58('0x2f')][_0x8d58('0x2d')]&&_0x5d9e79[_0x8d58('0x2f')][_0x8d58('0x2d')]===_0x8d58('0x4d')){_0x59c767[_0x8d58('0x4d')]=_0x5d9e79[_0x8d58('0x42')]['id'];}else{_0x59c767['id']=_0x5d9e79[_0x8d58('0x42')]['id'];}return db['SquareRecording'][_0x8d58('0x47')]({'where':_0x59c767,'attributes':['id',_0x8d58('0x4e'),_0x8d58('0x4f')],'raw':!![]})['then'](handleEntityNotFound(_0x205010,null))[_0x8d58('0x23')](function(_0x1d1e12){if(_0x1d1e12){var _0x571e51=_0x1d1e12[_0x8d58('0x4e')];var _0x173e2b=util[_0x8d58('0x50')](_0x8d58('0x51'),_0x571e51);if(fs[_0x8d58('0x52')](_0x173e2b)){_0x55b192=!![];return _0x2b3820['decryptFile'](_0x173e2b,_0x571e51,config[_0x8d58('0x53')][_0x8d58('0x54')])[_0x8d58('0x23')](function(){return _0x1d1e12;});}return _0x1d1e12;}})[_0x8d58('0x23')](function(_0x3cfac2){if(_0x3cfac2){var _0x4636fb=_0x3cfac2[_0x8d58('0x4e')];if(!fs[_0x8d58('0x52')](_0x4636fb)){throw new db['Sequelize'][(_0x8d58('0x55'))](_0x8d58('0x56'));}if(_0x3cfac2['filename']){return _0x205010[_0x8d58('0x57')](_0x4636fb,_0x3cfac2[_0x8d58('0x4f')]+path[_0x8d58('0x58')](_0x4636fb),function(){if(_0x55b192){fs['unlink'](_0x4636fb);}});}else{return _0x205010[_0x8d58('0x57')](_0x4636fb,function(_0x24a37c){if(_0x55b192){fs[_0x8d58('0x59')](_0x4636fb);}});}}})['catch'](function(_0x37db03){if(_0x37db03['message']===_0x8d58('0x56')){_0x205010[_0x8d58('0x1b')](0x194)['send'](_0x8d58('0x5a'));}else{return handleError(_0x205010,null);}});};exports[_0x8d58('0x24')]=function(_0x401d02,_0x496a1e){return db[_0x8d58('0x3d')][_0x8d58('0x47')]({'where':{'id':_0x401d02[_0x8d58('0x42')]['id']}})[_0x8d58('0x23')](function(_0x3fe5d7){if(_[_0x8d58('0x5b')](_0x3fe5d7)){throw new ReferenceError('Entity\x20not\x20found');}return _0x3fe5d7;})[_0x8d58('0x23')](function(_0x321d4b){var _0x37ad59=_0x321d4b['savePath'];logger[_0x8d58('0x5c')](_0x8d58('0x5d'),_0x37ad59);if(!_['isNil'](_0x321d4b[_0x8d58('0x4e')])&&fs['existsSync'](_0x37ad59)){logger[_0x8d58('0x5c')](_0x8d58('0x5e')+_0x37ad59+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x37ad59);}_0x37ad59=_0x37ad59+'.cypher';if(!_['isNil'](_0x321d4b[_0x8d58('0x4e')])&&fs['existsSync'](_0x37ad59)){logger[_0x8d58('0x5c')]('File:\x20\x22'+_0x37ad59+_0x8d58('0x5f'));fs[_0x8d58('0x60')](_0x37ad59);}return _0x321d4b;})[_0x8d58('0x23')](function(_0x9fe9ae){if(!_0x9fe9ae)throw new InternalError();return _0x9fe9ae[_0x8d58('0x24')]();})[_0x8d58('0x23')](function(){_0x496a1e[_0x8d58('0x1b')](0xcc)[_0x8d58('0x25')]();})[_0x8d58('0x48')](handleError(_0x496a1e,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index c37a1c2..6263631 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 _0xe3b3=['path','rimraf','../../config/environment','exports','SquareRecording','square_recordings','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0xe3b3,0x1b3));var _0x3e3b=function(_0x34d660,_0x166eb7){_0x34d660=_0x34d660-0x0;var _0x3723cf=_0xe3b3[_0x34d660];return _0x3723cf;};'use strict';var _=require(_0x3e3b('0x0'));var util=require(_0x3e3b('0x1'));var logger=require(_0x3e3b('0x2'))(_0x3e3b('0x3'));var moment=require(_0x3e3b('0x4'));var BPromise=require(_0x3e3b('0x5'));var rp=require(_0x3e3b('0x6'));var fs=require('fs');var path=require(_0x3e3b('0x7'));var rimraf=require(_0x3e3b('0x8'));var config=require(_0x3e3b('0x9'));var attributes=require('./squareRecording.attributes');module[_0x3e3b('0xa')]=function(_0x3fd79a,_0x410458){return _0x3fd79a['define'](_0x3e3b('0xb'),attributes,{'tableName':_0x3e3b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2087=['square_recordings','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','exports','SquareRecording'];(function(_0x1452af,_0x21d2e1){var _0xdd46f4=function(_0x7bc5e6){while(--_0x7bc5e6){_0x1452af['push'](_0x1452af['shift']());}};_0xdd46f4(++_0x21d2e1);}(_0x2087,0xf3));var _0x7208=function(_0x3b44b3,_0x3f62a0){_0x3b44b3=_0x3b44b3-0x0;var _0x952c11=_0x2087[_0x3b44b3];return _0x952c11;};'use strict';var _=require(_0x7208('0x0'));var util=require(_0x7208('0x1'));var logger=require(_0x7208('0x2'))(_0x7208('0x3'));var moment=require('moment');var BPromise=require(_0x7208('0x4'));var rp=require(_0x7208('0x5'));var fs=require('fs');var path=require(_0x7208('0x6'));var rimraf=require(_0x7208('0x7'));var config=require('../../config/environment');var attributes=require('./squareRecording.attributes');module[_0x7208('0x8')]=function(_0x5cc93f,_0x3c7d9d){return _0x5cc93f['define'](_0x7208('0x9'),attributes,{'tableName':_0x7208('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.rpc.js b/server/api/squareRecording/squareRecording.rpc.js index 9e1205f..23fbaf6 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 _0x191c=['../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','error','code','SquareRecording,\x20%s,\x20%s','message','catch','SquareRecording','create','body','options','raw','stringify','lodash','util','ioredis','../../mysqldb','../../config/logger'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x191c,0xb1));var _0xc191=function(_0x293f74,_0x5aa955){_0x293f74=_0x293f74-0x0;var _0x1c84eb=_0x191c[_0x293f74];return _0x1c84eb;};'use strict';var _=require(_0xc191('0x0'));var util=require(_0xc191('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc191('0x2'));var db=require(_0xc191('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xc191('0x4'))('rpc');var config=require(_0xc191('0x5'));var jayson=require(_0xc191('0x6'));var client=jayson[_0xc191('0x7')][_0xc191('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4f69ff,_0x824fc8,_0x317208){return new BPromise(function(_0x59cb62,_0x2ea617){return client[_0xc191('0x9')](_0x4f69ff,_0x317208)[_0xc191('0xa')](function(_0x50e8ce){logger[_0xc191('0xb')]('SquareRecording,\x20%s,\x20%s',_0x824fc8,_0xc191('0xc'));logger[_0xc191('0xd')](_0xc191('0xe'),_0x824fc8,_0xc191('0xc'),JSON['stringify'](_0x50e8ce));if(_0x50e8ce[_0xc191('0xf')]){if(_0x50e8ce[_0xc191('0xf')][_0xc191('0x10')]===0x1f4){logger['error'](_0xc191('0x11'),_0x824fc8,_0x50e8ce[_0xc191('0xf')][_0xc191('0x12')]);return _0x2ea617(_0x50e8ce['error'][_0xc191('0x12')]);}logger[_0xc191('0xf')]('SquareRecording,\x20%s,\x20%s',_0x824fc8,_0x50e8ce[_0xc191('0xf')][_0xc191('0x12')]);return _0x59cb62(_0x50e8ce[_0xc191('0xf')][_0xc191('0x12')]);}else{logger['info'](_0xc191('0x11'),_0x824fc8,_0xc191('0xc'));_0x59cb62(_0x50e8ce['result'][_0xc191('0x12')]);}})[_0xc191('0x13')](function(_0x3e6f7f){logger[_0xc191('0xf')](_0xc191('0x11'),_0x824fc8,_0x3e6f7f);_0x2ea617(_0x3e6f7f);});});}exports['CreateSquareRecording']=function(_0x4b6d49){var _0x50f75e=this;return new Promise(function(_0x3e904d,_0x37ac31){return db[_0xc191('0x14')][_0xc191('0x15')](_0x4b6d49[_0xc191('0x16')],{'raw':_0x4b6d49['options']?_0x4b6d49[_0xc191('0x17')][_0xc191('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x4c7bb4){logger[_0xc191('0xb')]('CreateSquareRecording',_0x4b6d49);logger[_0xc191('0xd')]('CreateSquareRecording',_0x4b6d49,JSON[_0xc191('0x19')](_0x4c7bb4));_0x3e904d(_0x4c7bb4);})['catch'](function(_0x1a4d74){logger[_0xc191('0xf')]('CreateSquareRecording',_0x1a4d74[_0xc191('0x12')],_0x4b6d49);_0x37ac31(_0x50f75e['error'](0x1f4,_0x1a4d74[_0xc191('0x12')]));});});}; \ No newline at end of file +var _0x3cc6=['raw','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','error','message','result','CreateSquareRecording','SquareRecording','create','body','options'];(function(_0x3b0a54,_0xbe0c37){var _0x5fffbf=function(_0x111940){while(--_0x111940){_0x3b0a54['push'](_0x3b0a54['shift']());}};_0x5fffbf(++_0xbe0c37);}(_0x3cc6,0x191));var _0x63cc=function(_0x3063e,_0x3a3ca2){_0x3063e=_0x3063e-0x0;var _0x2ae708=_0x3cc6[_0x3063e];return _0x2ae708;};'use strict';var _=require(_0x63cc('0x0'));var util=require(_0x63cc('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x63cc('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x63cc('0x3'))['db'];var utils=require(_0x63cc('0x4'));var logger=require(_0x63cc('0x5'))(_0x63cc('0x6'));var config=require('../../config/environment');var jayson=require(_0x63cc('0x7'));var client=jayson[_0x63cc('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x29cd06,_0x1eea87,_0x17f138){return new BPromise(function(_0xf7927a,_0xd7bbd1){return client[_0x63cc('0x9')](_0x29cd06,_0x17f138)[_0x63cc('0xa')](function(_0x2c5aad){logger[_0x63cc('0xb')](_0x63cc('0xc'),_0x1eea87,_0x63cc('0xd'));logger[_0x63cc('0xe')](_0x63cc('0xf'),_0x1eea87,_0x63cc('0xd'),JSON['stringify'](_0x2c5aad));if(_0x2c5aad['error']){if(_0x2c5aad[_0x63cc('0x10')]['code']===0x1f4){logger[_0x63cc('0x10')]('SquareRecording,\x20%s,\x20%s',_0x1eea87,_0x2c5aad[_0x63cc('0x10')][_0x63cc('0x11')]);return _0xd7bbd1(_0x2c5aad['error']['message']);}logger[_0x63cc('0x10')](_0x63cc('0xc'),_0x1eea87,_0x2c5aad['error'][_0x63cc('0x11')]);return _0xf7927a(_0x2c5aad[_0x63cc('0x10')]['message']);}else{logger[_0x63cc('0xb')]('SquareRecording,\x20%s,\x20%s',_0x1eea87,_0x63cc('0xd'));_0xf7927a(_0x2c5aad[_0x63cc('0x12')][_0x63cc('0x11')]);}})['catch'](function(_0x2bcbd9){logger[_0x63cc('0x10')](_0x63cc('0xc'),_0x1eea87,_0x2bcbd9);_0xd7bbd1(_0x2bcbd9);});});}exports[_0x63cc('0x13')]=function(_0x31b167){var _0x526495=this;return new Promise(function(_0x842db6,_0x5934a2){return db[_0x63cc('0x14')][_0x63cc('0x15')](_0x31b167[_0x63cc('0x16')],{'raw':_0x31b167[_0x63cc('0x17')]?_0x31b167[_0x63cc('0x17')][_0x63cc('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0xacb99f){logger['info'](_0x63cc('0x13'),_0x31b167);logger[_0x63cc('0xe')]('CreateSquareRecording',_0x31b167,JSON['stringify'](_0xacb99f));_0x842db6(_0xacb99f);})['catch'](function(_0x4e35e1){logger[_0x63cc('0x10')]('CreateSquareRecording',_0x4e35e1[_0x63cc('0x11')],_0x31b167);_0x5934a2(_0x526495[_0x63cc('0x10')](0x1f4,_0x4e35e1[_0x63cc('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index eebdbaa..e3f3dd7 100644 --- a/server/api/squareReport/index.js +++ b/server/api/squareReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x5bbae4,_0x2a4a4e){var _0x338a50=function(_0x478845){while(--_0x478845){_0x5bbae4['push'](_0x5bbae4['shift']());}};_0x338a50(++_0x2a4a4e);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./squareReport.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file +var _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(_0x15c5ff,_0x501524){var _0x395d33=function(_0x4e80c8){while(--_0x4e80c8){_0x15c5ff['push'](_0x15c5ff['shift']());}};_0x395d33(++_0x501524);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xbaf0[_0x2b4411];return _0x8e41ef;};'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 diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index 1c7c2cb..6a2c38e 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 _0x7472=['BOOLEAN','sequelize','exports','STRING','DATE'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x7472,0x128));var _0x2747=function(_0x2c4ab1,_0x4f38e2){_0x2c4ab1=_0x2c4ab1-0x0;var _0x5e68df=_0x7472[_0x2c4ab1];return _0x5e68df;};'use strict';var Sequelize=require(_0x2747('0x0'));module[_0x2747('0x1')]={'network':{'type':Sequelize[_0x2747('0x2')]},'network_script':{'type':Sequelize[_0x2747('0x2')]},'request':{'type':Sequelize[_0x2747('0x2')]},'channel':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x2747('0x2')]},'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x2747('0x2')]},'version':{'type':Sequelize[_0x2747('0x2')]},'callerid':{'type':Sequelize[_0x2747('0x2')]},'calleridname':{'type':Sequelize[_0x2747('0x2')]},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize[_0x2747('0x2')]},'callington':{'type':Sequelize[_0x2747('0x2')]},'callingtns':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize['STRING']},'rdnis':{'type':Sequelize[_0x2747('0x2')]},'context':{'type':Sequelize[_0x2747('0x2')]},'extension':{'type':Sequelize[_0x2747('0x2')]},'priority':{'type':Sequelize[_0x2747('0x2')]},'enhanced':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize['STRING']},'project_name':{'type':Sequelize[_0x2747('0x2')]},'joinAt':{'type':Sequelize[_0x2747('0x3')]},'leaveAt':{'type':Sequelize[_0x2747('0x3')]},'bot':{'type':Sequelize[_0x2747('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x4222=['BOOLEAN','sequelize','STRING','DATE'];(function(_0x2ddce7,_0x5e5d9f){var _0x454a43=function(_0x425834){while(--_0x425834){_0x2ddce7['push'](_0x2ddce7['shift']());}};_0x454a43(++_0x5e5d9f);}(_0x4222,0x105));var _0x2422=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0x4222[_0x255d5b];return _0x3e141a;};'use strict';var Sequelize=require(_0x2422('0x0'));module['exports']={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize[_0x2422('0x1')]},'request':{'type':Sequelize[_0x2422('0x1')]},'channel':{'type':Sequelize[_0x2422('0x1')]},'language':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x2422('0x1')]},'uniqueid':{'type':Sequelize[_0x2422('0x1')]},'version':{'type':Sequelize[_0x2422('0x1')]},'callerid':{'type':Sequelize[_0x2422('0x1')]},'calleridname':{'type':Sequelize['STRING']},'callingpres':{'type':Sequelize[_0x2422('0x1')]},'callingani2':{'type':Sequelize[_0x2422('0x1')]},'callington':{'type':Sequelize['STRING']},'callingtns':{'type':Sequelize[_0x2422('0x1')]},'dnid':{'type':Sequelize[_0x2422('0x1')]},'rdnis':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x2422('0x1')]},'extension':{'type':Sequelize[_0x2422('0x1')]},'priority':{'type':Sequelize[_0x2422('0x1')]},'enhanced':{'type':Sequelize[_0x2422('0x1')]},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize[_0x2422('0x1')]},'project_name':{'type':Sequelize[_0x2422('0x1')]},'joinAt':{'type':Sequelize[_0x2422('0x2')]},'leaveAt':{'type':Sequelize[_0x2422('0x2')]},'bot':{'type':Sequelize[_0x2422('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index 07bff86..9fa7029 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 _0xfb54=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','Content-Range','save','update','then','end','stack','name','map','SquareReport','fieldName','type','key','query','filters','intersection','model','fields','attributes','length','order','sort','where','pick','VIRTUAL','merge','options','includeAll','include','rows','catch','params','keys','rawAttributes','find','create','body','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x8b95b2,_0x8b2e05){var _0x494fec=function(_0x3965bb){while(--_0x3965bb){_0x8b95b2['push'](_0x8b95b2['shift']());}};_0x494fec(++_0x8b2e05);}(_0xfb54,0x78));var _0x4fb5=function(_0x32a4fc,_0x481874){_0x32a4fc=_0x32a4fc-0x0;var _0x37e31e=_0xfb54[_0x32a4fc];return _0x37e31e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4fb5('0x0'));var zipdir=require(_0x4fb5('0x1'));var jsonpatch=require(_0x4fb5('0x2'));var rp=require(_0x4fb5('0x3'));var moment=require(_0x4fb5('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4fb5('0x5'));var path=require('path');var sox=require(_0x4fb5('0x6'));var csv=require(_0x4fb5('0x7'));var ejs=require(_0x4fb5('0x8'));var fs=require('fs');var fs_extra=require(_0x4fb5('0x9'));var _=require(_0x4fb5('0xa'));var squel=require(_0x4fb5('0xb'));var crypto=require(_0x4fb5('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4fb5('0xd'));var Redis=require(_0x4fb5('0xe'));var authService=require(_0x4fb5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x4fb5('0x10'));var hardwareService=require(_0x4fb5('0x11'));var logger=require(_0x4fb5('0x12'))(_0x4fb5('0x13'));var utils=require(_0x4fb5('0x14'));var config=require(_0x4fb5('0x15'));var licenseUtil=require(_0x4fb5('0x16'));var db=require(_0x4fb5('0x17'))['db'];function respondWithStatusCode(_0x1b8a30,_0x4d6082){_0x4d6082=_0x4d6082||0xcc;return function(_0x4c9953){if(_0x4c9953){return _0x1b8a30[_0x4fb5('0x18')](_0x4d6082);}return _0x1b8a30[_0x4fb5('0x19')](_0x4d6082)['end']();};}function respondWithResult(_0x39495f,_0x11d125){_0x11d125=_0x11d125||0xc8;return function(_0x479784){if(_0x479784){return _0x39495f[_0x4fb5('0x19')](_0x11d125)[_0x4fb5('0x1a')](_0x479784);}};}function respondWithFilteredResult(_0x1bc83b,_0x1250c6){return function(_0x94e9b2){if(_0x94e9b2){var _0x4c5a80=typeof _0x1250c6[_0x4fb5('0x1b')]==='undefined'&&typeof _0x1250c6[_0x4fb5('0x1c')]===_0x4fb5('0x1d');var _0xeaeba9=_0x94e9b2[_0x4fb5('0x1e')];var _0x3a96af=_0x4c5a80?0x0:_0x1250c6['offset'];var _0x23af7b=_0x4c5a80?_0x94e9b2[_0x4fb5('0x1e')]:_0x1250c6[_0x4fb5('0x1b')]+_0x1250c6['limit'];var _0x3c5820;if(_0x23af7b>=_0xeaeba9){_0x23af7b=_0xeaeba9;_0x3c5820=0xc8;}else{_0x3c5820=0xce;}_0x1bc83b[_0x4fb5('0x19')](_0x3c5820);return _0x1bc83b['set'](_0x4fb5('0x1f'),_0x3a96af+'-'+_0x23af7b+'/'+_0xeaeba9)[_0x4fb5('0x1a')](_0x94e9b2);}return null;};}function patchUpdates(_0x8665ea){return function(_0xea1f36){try{jsonpatch['apply'](_0xea1f36,_0x8665ea,!![]);}catch(_0x437cb1){return BPromise['reject'](_0x437cb1);}return _0xea1f36[_0x4fb5('0x20')]();};}function saveUpdates(_0x1936f3,_0x73b19f){return function(_0x25ba56){if(_0x25ba56){return _0x25ba56[_0x4fb5('0x21')](_0x1936f3)[_0x4fb5('0x22')](function(_0x417da7){return _0x417da7;});}return null;};}function removeEntity(_0x13d1bd,_0x200cb0){return function(_0x4ab861){if(_0x4ab861){return _0x4ab861['destroy']()[_0x4fb5('0x22')](function(){_0x13d1bd[_0x4fb5('0x19')](0xcc)[_0x4fb5('0x23')]();});}};}function handleEntityNotFound(_0x31e474,_0xfcc84d){return function(_0x3a21f9){if(!_0x3a21f9){_0x31e474['sendStatus'](0x194);}return _0x3a21f9;};}function handleError(_0xeb68e0,_0x550ae2){_0x550ae2=_0x550ae2||0x1f4;return function(_0x5d3921){logger['error'](_0x5d3921[_0x4fb5('0x24')]);if(_0x5d3921['name']){delete _0x5d3921[_0x4fb5('0x25')];}_0xeb68e0['status'](_0x550ae2)['send'](_0x5d3921);};}exports['index']=function(_0x5c569c,_0x81725a){var _0x2e8cca={},_0x4f1e41={},_0x34eaf3={'count':0x0,'rows':[]};var _0x5a1d65=_[_0x4fb5('0x26')](db[_0x4fb5('0x27')]['rawAttributes'],function(_0x36af1d){return{'name':_0x36af1d[_0x4fb5('0x28')],'type':_0x36af1d[_0x4fb5('0x29')][_0x4fb5('0x2a')]};});_0x4f1e41['model']=_[_0x4fb5('0x26')](_0x5a1d65,_0x4fb5('0x25'));_0x4f1e41[_0x4fb5('0x2b')]=_['keys'](_0x5c569c[_0x4fb5('0x2b')]);_0x4f1e41[_0x4fb5('0x2c')]=_[_0x4fb5('0x2d')](_0x4f1e41['model'],_0x4f1e41[_0x4fb5('0x2b')]);_0x2e8cca['attributes']=_['intersection'](_0x4f1e41[_0x4fb5('0x2e')],qs[_0x4fb5('0x2f')](_0x5c569c[_0x4fb5('0x2b')][_0x4fb5('0x2f')]));_0x2e8cca[_0x4fb5('0x30')]=_0x2e8cca[_0x4fb5('0x30')][_0x4fb5('0x31')]?_0x2e8cca['attributes']:_0x4f1e41[_0x4fb5('0x2e')];if(!_0x5c569c[_0x4fb5('0x2b')]['hasOwnProperty']('nolimit')){_0x2e8cca[_0x4fb5('0x1c')]=qs[_0x4fb5('0x1c')](_0x5c569c[_0x4fb5('0x2b')][_0x4fb5('0x1c')]);_0x2e8cca['offset']=qs['offset'](_0x5c569c['query'][_0x4fb5('0x1b')]);}_0x2e8cca[_0x4fb5('0x32')]=qs[_0x4fb5('0x33')](_0x5c569c[_0x4fb5('0x2b')][_0x4fb5('0x33')]);_0x2e8cca[_0x4fb5('0x34')]=qs[_0x4fb5('0x2c')](_[_0x4fb5('0x35')](_0x5c569c['query'],_0x4f1e41['filters']),_0x5a1d65);if(_0x5c569c['query']['filter']){_0x2e8cca[_0x4fb5('0x34')]=_['merge'](_0x2e8cca['where'],{'$or':_['map'](_0x5a1d65,function(_0x4ba481){if(_0x4ba481[_0x4fb5('0x29')]!==_0x4fb5('0x36')){var _0x3f2fd7={};_0x3f2fd7[_0x4ba481['name']]={'$like':'%'+_0x5c569c[_0x4fb5('0x2b')]['filter']+'%'};return _0x3f2fd7;}})});}_0x2e8cca=_[_0x4fb5('0x37')]({},_0x2e8cca,_0x5c569c[_0x4fb5('0x38')]);var _0x509462={'where':_0x2e8cca[_0x4fb5('0x34')]};return db[_0x4fb5('0x27')]['count'](_0x509462)['then'](function(_0x273fc1){_0x34eaf3[_0x4fb5('0x1e')]=_0x273fc1;if(_0x5c569c[_0x4fb5('0x2b')][_0x4fb5('0x39')]){_0x2e8cca[_0x4fb5('0x3a')]=[{'all':!![]}];}return db['SquareReport']['findAll'](_0x2e8cca);})['then'](function(_0x10afbc){_0x34eaf3[_0x4fb5('0x3b')]=_0x10afbc;return _0x34eaf3;})[_0x4fb5('0x22')](respondWithFilteredResult(_0x81725a,_0x2e8cca))[_0x4fb5('0x3c')](handleError(_0x81725a,null));};exports['show']=function(_0x53d705,_0x10e086){var _0xa38daa={'raw':!![],'where':{'id':_0x53d705[_0x4fb5('0x3d')]['id']}},_0x533116={};_0x533116[_0x4fb5('0x2e')]=_[_0x4fb5('0x3e')](db['SquareReport'][_0x4fb5('0x3f')]);_0x533116[_0x4fb5('0x2b')]=_['keys'](_0x53d705[_0x4fb5('0x2b')]);_0x533116[_0x4fb5('0x2c')]=_[_0x4fb5('0x2d')](_0x533116['model'],_0x533116[_0x4fb5('0x2b')]);_0xa38daa[_0x4fb5('0x30')]=_[_0x4fb5('0x2d')](_0x533116[_0x4fb5('0x2e')],qs[_0x4fb5('0x2f')](_0x53d705[_0x4fb5('0x2b')][_0x4fb5('0x2f')]));_0xa38daa[_0x4fb5('0x30')]=_0xa38daa[_0x4fb5('0x30')][_0x4fb5('0x31')]?_0xa38daa[_0x4fb5('0x30')]:_0x533116[_0x4fb5('0x2e')];if(_0x53d705[_0x4fb5('0x2b')]['includeAll']){_0xa38daa[_0x4fb5('0x3a')]=[{'all':!![]}];}_0xa38daa=_[_0x4fb5('0x37')]({},_0xa38daa,_0x53d705[_0x4fb5('0x38')]);return db[_0x4fb5('0x27')][_0x4fb5('0x40')](_0xa38daa)[_0x4fb5('0x22')](handleEntityNotFound(_0x10e086,null))[_0x4fb5('0x22')](respondWithResult(_0x10e086,null))[_0x4fb5('0x3c')](handleError(_0x10e086,null));};exports[_0x4fb5('0x41')]=function(_0x23c6cf,_0x34c971){return db[_0x4fb5('0x27')][_0x4fb5('0x41')](_0x23c6cf[_0x4fb5('0x42')],{})[_0x4fb5('0x22')](respondWithResult(_0x34c971,0xc9))[_0x4fb5('0x3c')](handleError(_0x34c971,null));};exports[_0x4fb5('0x21')]=function(_0x4885b6,_0x1a585b){if(_0x4885b6[_0x4fb5('0x42')]['id']){delete _0x4885b6[_0x4fb5('0x42')]['id'];}return db[_0x4fb5('0x27')][_0x4fb5('0x40')]({'where':{'id':_0x4885b6[_0x4fb5('0x3d')]['id']}})[_0x4fb5('0x22')](handleEntityNotFound(_0x1a585b,null))[_0x4fb5('0x22')](saveUpdates(_0x4885b6[_0x4fb5('0x42')],null))[_0x4fb5('0x22')](respondWithResult(_0x1a585b,null))[_0x4fb5('0x3c')](handleError(_0x1a585b,null));};exports[_0x4fb5('0x43')]=function(_0x541b5b,_0x383e6c){return db[_0x4fb5('0x27')][_0x4fb5('0x40')]({'where':{'id':_0x541b5b['params']['id']}})['then'](handleEntityNotFound(_0x383e6c,null))['then'](removeEntity(_0x383e6c,null))['catch'](handleError(_0x383e6c,null));};exports[_0x4fb5('0x44')]=function(_0x58447f,_0x38c9c8){return db[_0x4fb5('0x27')]['describe']()['then'](respondWithResult(_0x38c9c8,null))['catch'](handleError(_0x38c9c8,null));}; \ No newline at end of file +var _0x0609=['includeAll','find','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','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/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','Content-Range','reject','save','then','error','name','send','map','SquareReport','rawAttributes','key','query','keys','filters','intersection','model','attributes','fields','order','sort','where','pick','filter','merge','type','VIRTUAL','options','count','include','findAll','rows','catch','show','params','length'];(function(_0x2d2201,_0x3cfe3d){var _0x12e6cd=function(_0x5e4cf6){while(--_0x5e4cf6){_0x2d2201['push'](_0x2d2201['shift']());}};_0x12e6cd(++_0x3cfe3d);}(_0x0609,0xde));var _0x9060=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x0609[_0x422905];return _0x33dc6c;};'use strict';var emlformat=require(_0x9060('0x0'));var rimraf=require(_0x9060('0x1'));var zipdir=require(_0x9060('0x2'));var jsonpatch=require(_0x9060('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x9060('0x4'));var Mustache=require(_0x9060('0x5'));var util=require(_0x9060('0x6'));var path=require(_0x9060('0x7'));var sox=require(_0x9060('0x8'));var csv=require(_0x9060('0x9'));var ejs=require(_0x9060('0xa'));var fs=require('fs');var fs_extra=require(_0x9060('0xb'));var _=require(_0x9060('0xc'));var squel=require(_0x9060('0xd'));var crypto=require(_0x9060('0xe'));var jsforce=require(_0x9060('0xf'));var deskjs=require(_0x9060('0x10'));var toCsv=require(_0x9060('0x9'));var querystring=require(_0x9060('0x11'));var Papa=require(_0x9060('0x12'));var Redis=require(_0x9060('0x13'));var authService=require(_0x9060('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x9060('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x9060('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x9060('0x17'));var db=require(_0x9060('0x18'))['db'];function respondWithStatusCode(_0x43b659,_0x25b143){_0x25b143=_0x25b143||0xcc;return function(_0x1e82fc){if(_0x1e82fc){return _0x43b659[_0x9060('0x19')](_0x25b143);}return _0x43b659['status'](_0x25b143)[_0x9060('0x1a')]();};}function respondWithResult(_0x3968b8,_0x3c666c){_0x3c666c=_0x3c666c||0xc8;return function(_0x4889e0){if(_0x4889e0){return _0x3968b8[_0x9060('0x1b')](_0x3c666c)[_0x9060('0x1c')](_0x4889e0);}};}function respondWithFilteredResult(_0x48fef8,_0x57da9b){return function(_0x5574f9){if(_0x5574f9){var _0x35f2d7=typeof _0x57da9b[_0x9060('0x1d')]==='undefined'&&typeof _0x57da9b[_0x9060('0x1e')]==='undefined';var _0x1539cd=_0x5574f9['count'];var _0x2df5ab=_0x35f2d7?0x0:_0x57da9b[_0x9060('0x1d')];var _0x4c28ab=_0x35f2d7?_0x5574f9['count']:_0x57da9b[_0x9060('0x1d')]+_0x57da9b[_0x9060('0x1e')];var _0x3bd1db;if(_0x4c28ab>=_0x1539cd){_0x4c28ab=_0x1539cd;_0x3bd1db=0xc8;}else{_0x3bd1db=0xce;}_0x48fef8['status'](_0x3bd1db);return _0x48fef8['set'](_0x9060('0x1f'),_0x2df5ab+'-'+_0x4c28ab+'/'+_0x1539cd)[_0x9060('0x1c')](_0x5574f9);}return null;};}function patchUpdates(_0x4aee89){return function(_0x35fe4b){try{jsonpatch['apply'](_0x35fe4b,_0x4aee89,!![]);}catch(_0x399751){return BPromise[_0x9060('0x20')](_0x399751);}return _0x35fe4b[_0x9060('0x21')]();};}function saveUpdates(_0x49e7c3,_0x1f41e4){return function(_0x13c262){if(_0x13c262){return _0x13c262['update'](_0x49e7c3)[_0x9060('0x22')](function(_0x43ada2){return _0x43ada2;});}return null;};}function removeEntity(_0xe73f36,_0x2fbbe1){return function(_0x309c01){if(_0x309c01){return _0x309c01['destroy']()[_0x9060('0x22')](function(){_0xe73f36[_0x9060('0x1b')](0xcc)[_0x9060('0x1a')]();});}};}function handleEntityNotFound(_0x407804,_0x52394a){return function(_0x124c8b){if(!_0x124c8b){_0x407804['sendStatus'](0x194);}return _0x124c8b;};}function handleError(_0x998c47,_0x5b1005){_0x5b1005=_0x5b1005||0x1f4;return function(_0x106573){logger[_0x9060('0x23')](_0x106573['stack']);if(_0x106573[_0x9060('0x24')]){delete _0x106573[_0x9060('0x24')];}_0x998c47[_0x9060('0x1b')](_0x5b1005)[_0x9060('0x25')](_0x106573);};}exports['index']=function(_0x3957d2,_0x41ed91){var _0x57b7ad={},_0xa5bff3={},_0x4b5625={'count':0x0,'rows':[]};var _0x417708=_[_0x9060('0x26')](db[_0x9060('0x27')][_0x9060('0x28')],function(_0xdeb88){return{'name':_0xdeb88['fieldName'],'type':_0xdeb88['type'][_0x9060('0x29')]};});_0xa5bff3['model']=_[_0x9060('0x26')](_0x417708,'name');_0xa5bff3[_0x9060('0x2a')]=_[_0x9060('0x2b')](_0x3957d2[_0x9060('0x2a')]);_0xa5bff3[_0x9060('0x2c')]=_[_0x9060('0x2d')](_0xa5bff3[_0x9060('0x2e')],_0xa5bff3[_0x9060('0x2a')]);_0x57b7ad[_0x9060('0x2f')]=_[_0x9060('0x2d')](_0xa5bff3[_0x9060('0x2e')],qs['fields'](_0x3957d2[_0x9060('0x2a')][_0x9060('0x30')]));_0x57b7ad[_0x9060('0x2f')]=_0x57b7ad[_0x9060('0x2f')]['length']?_0x57b7ad[_0x9060('0x2f')]:_0xa5bff3[_0x9060('0x2e')];if(!_0x3957d2[_0x9060('0x2a')]['hasOwnProperty']('nolimit')){_0x57b7ad['limit']=qs['limit'](_0x3957d2[_0x9060('0x2a')][_0x9060('0x1e')]);_0x57b7ad[_0x9060('0x1d')]=qs[_0x9060('0x1d')](_0x3957d2[_0x9060('0x2a')]['offset']);}_0x57b7ad[_0x9060('0x31')]=qs[_0x9060('0x32')](_0x3957d2[_0x9060('0x2a')]['sort']);_0x57b7ad[_0x9060('0x33')]=qs[_0x9060('0x2c')](_[_0x9060('0x34')](_0x3957d2[_0x9060('0x2a')],_0xa5bff3[_0x9060('0x2c')]),_0x417708);if(_0x3957d2[_0x9060('0x2a')][_0x9060('0x35')]){_0x57b7ad[_0x9060('0x33')]=_[_0x9060('0x36')](_0x57b7ad['where'],{'$or':_[_0x9060('0x26')](_0x417708,function(_0x749e40){if(_0x749e40[_0x9060('0x37')]!==_0x9060('0x38')){var _0x5b22ac={};_0x5b22ac[_0x749e40[_0x9060('0x24')]]={'$like':'%'+_0x3957d2[_0x9060('0x2a')]['filter']+'%'};return _0x5b22ac;}})});}_0x57b7ad=_['merge']({},_0x57b7ad,_0x3957d2[_0x9060('0x39')]);var _0x2a0abf={'where':_0x57b7ad[_0x9060('0x33')]};return db['SquareReport'][_0x9060('0x3a')](_0x2a0abf)[_0x9060('0x22')](function(_0x1420e4){_0x4b5625[_0x9060('0x3a')]=_0x1420e4;if(_0x3957d2[_0x9060('0x2a')]['includeAll']){_0x57b7ad[_0x9060('0x3b')]=[{'all':!![]}];}return db[_0x9060('0x27')][_0x9060('0x3c')](_0x57b7ad);})['then'](function(_0x1066d1){_0x4b5625[_0x9060('0x3d')]=_0x1066d1;return _0x4b5625;})[_0x9060('0x22')](respondWithFilteredResult(_0x41ed91,_0x57b7ad))[_0x9060('0x3e')](handleError(_0x41ed91,null));};exports[_0x9060('0x3f')]=function(_0x1c40ca,_0x49c6be){var _0x4bdda0={'raw':!![],'where':{'id':_0x1c40ca[_0x9060('0x40')]['id']}},_0x2b9ad1={};_0x2b9ad1[_0x9060('0x2e')]=_['keys'](db[_0x9060('0x27')][_0x9060('0x28')]);_0x2b9ad1[_0x9060('0x2a')]=_[_0x9060('0x2b')](_0x1c40ca[_0x9060('0x2a')]);_0x2b9ad1[_0x9060('0x2c')]=_[_0x9060('0x2d')](_0x2b9ad1[_0x9060('0x2e')],_0x2b9ad1[_0x9060('0x2a')]);_0x4bdda0[_0x9060('0x2f')]=_[_0x9060('0x2d')](_0x2b9ad1[_0x9060('0x2e')],qs[_0x9060('0x30')](_0x1c40ca['query'][_0x9060('0x30')]));_0x4bdda0[_0x9060('0x2f')]=_0x4bdda0[_0x9060('0x2f')][_0x9060('0x41')]?_0x4bdda0['attributes']:_0x2b9ad1[_0x9060('0x2e')];if(_0x1c40ca[_0x9060('0x2a')][_0x9060('0x42')]){_0x4bdda0[_0x9060('0x3b')]=[{'all':!![]}];}_0x4bdda0=_[_0x9060('0x36')]({},_0x4bdda0,_0x1c40ca[_0x9060('0x39')]);return db['SquareReport'][_0x9060('0x43')](_0x4bdda0)[_0x9060('0x22')](handleEntityNotFound(_0x49c6be,null))[_0x9060('0x22')](respondWithResult(_0x49c6be,null))[_0x9060('0x3e')](handleError(_0x49c6be,null));};exports[_0x9060('0x44')]=function(_0x1b3803,_0x3a8b9b){return db[_0x9060('0x27')][_0x9060('0x44')](_0x1b3803[_0x9060('0x45')],{})[_0x9060('0x22')](respondWithResult(_0x3a8b9b,0xc9))[_0x9060('0x3e')](handleError(_0x3a8b9b,null));};exports[_0x9060('0x46')]=function(_0x68c5cb,_0x2e1fec){if(_0x68c5cb[_0x9060('0x45')]['id']){delete _0x68c5cb[_0x9060('0x45')]['id'];}return db[_0x9060('0x27')]['find']({'where':{'id':_0x68c5cb[_0x9060('0x40')]['id']}})['then'](handleEntityNotFound(_0x2e1fec,null))[_0x9060('0x22')](saveUpdates(_0x68c5cb[_0x9060('0x45')],null))['then'](respondWithResult(_0x2e1fec,null))[_0x9060('0x3e')](handleError(_0x2e1fec,null));};exports['destroy']=function(_0x243f4b,_0x1e9a46){return db[_0x9060('0x27')]['find']({'where':{'id':_0x243f4b[_0x9060('0x40')]['id']}})['then'](handleEntityNotFound(_0x1e9a46,null))[_0x9060('0x22')](removeEntity(_0x1e9a46,null))[_0x9060('0x3e')](handleError(_0x1e9a46,null));};exports[_0x9060('0x47')]=function(_0xda4a17,_0x4cd1d5){return db[_0x9060('0x27')][_0x9060('0x47')]()[_0x9060('0x22')](respondWithResult(_0x4cd1d5,null))[_0x9060('0x3e')](handleError(_0x4cd1d5,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index c9c3404..e531d6a 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 _0x406e=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./squareReport.attributes','exports','define','report_square','uid_pname','uniqueid','project_name','leaveAt'];(function(_0x319e3a,_0x3101b1){var _0x1b0a60=function(_0x13c20f){while(--_0x13c20f){_0x319e3a['push'](_0x319e3a['shift']());}};_0x1b0a60(++_0x3101b1);}(_0x406e,0x1ba));var _0xe406=function(_0x344860,_0x3e5932){_0x344860=_0x344860-0x0;var _0xfb2fe9=_0x406e[_0x344860];return _0xfb2fe9;};'use strict';var _=require(_0xe406('0x0'));var util=require(_0xe406('0x1'));var logger=require(_0xe406('0x2'))(_0xe406('0x3'));var moment=require('moment');var BPromise=require(_0xe406('0x4'));var rp=require(_0xe406('0x5'));var fs=require('fs');var path=require(_0xe406('0x6'));var rimraf=require(_0xe406('0x7'));var config=require(_0xe406('0x8'));var attributes=require(_0xe406('0x9'));module[_0xe406('0xa')]=function(_0x1708da,_0x53e28e){return _0x1708da[_0xe406('0xb')]('SquareReport',attributes,{'tableName':_0xe406('0xc'),'paranoid':![],'indexes':[{'name':_0xe406('0xd'),'fields':[_0xe406('0xe'),_0xe406('0xf')]},{'name':_0xe406('0x10'),'fields':[_0xe406('0x10')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd082=['SquareReport','report_square','uid_pname','leaveAt','lodash','util','bluebird','request-promise','path','../../config/environment','define'];(function(_0xa554a7,_0x14d2ee){var _0x427726=function(_0x28d262){while(--_0x28d262){_0xa554a7['push'](_0xa554a7['shift']());}};_0x427726(++_0x14d2ee);}(_0xd082,0x10c));var _0x2d08=function(_0x4fb858,_0x99042d){_0x4fb858=_0x4fb858-0x0;var _0x1bbc57=_0xd082[_0x4fb858];return _0x1bbc57;};'use strict';var _=require(_0x2d08('0x0'));var util=require(_0x2d08('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x2d08('0x2'));var rp=require(_0x2d08('0x3'));var fs=require('fs');var path=require(_0x2d08('0x4'));var rimraf=require('rimraf');var config=require(_0x2d08('0x5'));var attributes=require('./squareReport.attributes');module['exports']=function(_0x583010,_0x438343){return _0x583010[_0x2d08('0x6')](_0x2d08('0x7'),attributes,{'tableName':_0x2d08('0x8'),'paranoid':![],'indexes':[{'name':_0x2d08('0x9'),'fields':['uniqueid','project_name']},{'name':_0x2d08('0xa'),'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 e9d964a..c2fa7eb 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 _0x5459=['util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','SquareReport,\x20%s,\x20%s','debug','SquareReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','CreateSquareReport','create','body','raw','then','stringify','UpdateSquareReport','SquareReport','update','options','where','limit','lodash'];(function(_0x424bd3,_0x8760d8){var _0x1fdade=function(_0x510862){while(--_0x510862){_0x424bd3['push'](_0x424bd3['shift']());}};_0x1fdade(++_0x8760d8);}(_0x5459,0x18b));var _0x9545=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x5459[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x9545('0x0'));var util=require(_0x9545('0x1'));var moment=require(_0x9545('0x2'));var BPromise=require(_0x9545('0x3'));var rs=require(_0x9545('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x9545('0x5'));var logger=require(_0x9545('0x6'))('rpc');var config=require(_0x9545('0x7'));var jayson=require(_0x9545('0x8'));var client=jayson[_0x9545('0x9')][_0x9545('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x434056,_0x5e1ec3,_0x3bccf2){return new BPromise(function(_0x2a27c7,_0x341d95){return client[_0x9545('0xb')](_0x434056,_0x3bccf2)['then'](function(_0x1ec78f){logger[_0x9545('0xc')](_0x9545('0xd'),_0x5e1ec3,'request\x20sent');logger[_0x9545('0xe')](_0x9545('0xf'),_0x5e1ec3,_0x9545('0x10'),JSON['stringify'](_0x1ec78f));if(_0x1ec78f[_0x9545('0x11')]){if(_0x1ec78f['error']['code']===0x1f4){logger[_0x9545('0x11')](_0x9545('0xd'),_0x5e1ec3,_0x1ec78f[_0x9545('0x11')][_0x9545('0x12')]);return _0x341d95(_0x1ec78f[_0x9545('0x11')][_0x9545('0x12')]);}logger[_0x9545('0x11')](_0x9545('0xd'),_0x5e1ec3,_0x1ec78f[_0x9545('0x11')][_0x9545('0x12')]);return _0x2a27c7(_0x1ec78f['error'][_0x9545('0x12')]);}else{logger[_0x9545('0xc')](_0x9545('0xd'),_0x5e1ec3,_0x9545('0x10'));_0x2a27c7(_0x1ec78f[_0x9545('0x13')][_0x9545('0x12')]);}})[_0x9545('0x14')](function(_0x1dea69){logger[_0x9545('0x11')](_0x9545('0xd'),_0x5e1ec3,_0x1dea69);_0x341d95(_0x1dea69);});});}exports[_0x9545('0x15')]=function(_0x476aff){var _0x334e81=this;return new Promise(function(_0xac3d49,_0x5534cb){return db['SquareReport'][_0x9545('0x16')](_0x476aff[_0x9545('0x17')],{'raw':_0x476aff['options']?_0x476aff['options'][_0x9545('0x18')]===undefined?!![]:![]:!![]})[_0x9545('0x19')](function(_0x44f6a1){logger[_0x9545('0xc')](_0x9545('0x15'),_0x476aff);logger[_0x9545('0xe')](_0x9545('0x15'),_0x476aff,JSON[_0x9545('0x1a')](_0x44f6a1));_0xac3d49(_0x44f6a1);})[_0x9545('0x14')](function(_0x37a5e8){logger[_0x9545('0x11')]('CreateSquareReport',_0x37a5e8['message'],_0x476aff);_0x5534cb(_0x334e81['error'](0x1f4,_0x37a5e8['message']));});});};exports[_0x9545('0x1b')]=function(_0x3482b0){var _0xe0e38b=this;return new Promise(function(_0x832e9f,_0xf0df1e){return db[_0x9545('0x1c')][_0x9545('0x1d')](_0x3482b0[_0x9545('0x17')],{'raw':_0x3482b0[_0x9545('0x1e')]?_0x3482b0[_0x9545('0x1e')][_0x9545('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3482b0[_0x9545('0x1e')]?_0x3482b0[_0x9545('0x1e')][_0x9545('0x1f')]||null:null,'attributes':_0x3482b0[_0x9545('0x1e')]?_0x3482b0[_0x9545('0x1e')]['attributes']||null:null,'limit':_0x3482b0['options']?_0x3482b0['options'][_0x9545('0x20')]||null:null})['then'](function(_0x55afd7){logger[_0x9545('0xc')](_0x9545('0x1b'),_0x3482b0);logger[_0x9545('0xe')](_0x9545('0x1b'),_0x3482b0,JSON['stringify'](_0x55afd7));_0x832e9f(_0x55afd7);})[_0x9545('0x14')](function(_0x24ddae){logger[_0x9545('0x11')](_0x9545('0x1b'),_0x24ddae[_0x9545('0x12')],_0x3482b0);_0xf0df1e(_0xe0e38b['error'](0x1f4,_0x24ddae[_0x9545('0x12')]));});});}; \ No newline at end of file +var _0xcaa8=['SquareReport','create','options','raw','debug','CreateSquareReport','UpdateSquareReport','update','where','attributes','limit','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','then','info','SquareReport,\x20%s,\x20%s','request\x20sent','code','error','message','catch'];(function(_0x1e0139,_0x4970a3){var _0xbfc2ba=function(_0x20ee9e){while(--_0x20ee9e){_0x1e0139['push'](_0x1e0139['shift']());}};_0xbfc2ba(++_0x4970a3);}(_0xcaa8,0x8c));var _0x8caa=function(_0xe9693c,_0x24a041){_0xe9693c=_0xe9693c-0x0;var _0x275c7d=_0xcaa8[_0xe9693c];return _0x275c7d;};'use strict';var _=require(_0x8caa('0x0'));var util=require(_0x8caa('0x1'));var moment=require(_0x8caa('0x2'));var BPromise=require(_0x8caa('0x3'));var rs=require(_0x8caa('0x4'));var fs=require('fs');var Redis=require(_0x8caa('0x5'));var db=require(_0x8caa('0x6'))['db'];var utils=require(_0x8caa('0x7'));var logger=require(_0x8caa('0x8'))(_0x8caa('0x9'));var config=require(_0x8caa('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x8caa('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3ade4f,_0x44fc47,_0x44a9a6){return new BPromise(function(_0xc091d4,_0x66553d){return client['request'](_0x3ade4f,_0x44a9a6)[_0x8caa('0xc')](function(_0x2ebc28){logger[_0x8caa('0xd')](_0x8caa('0xe'),_0x44fc47,_0x8caa('0xf'));logger['debug']('SquareReport,\x20%s,\x20%s,\x20%s',_0x44fc47,_0x8caa('0xf'),JSON['stringify'](_0x2ebc28));if(_0x2ebc28['error']){if(_0x2ebc28['error'][_0x8caa('0x10')]===0x1f4){logger[_0x8caa('0x11')](_0x8caa('0xe'),_0x44fc47,_0x2ebc28[_0x8caa('0x11')][_0x8caa('0x12')]);return _0x66553d(_0x2ebc28[_0x8caa('0x11')]['message']);}logger['error'](_0x8caa('0xe'),_0x44fc47,_0x2ebc28['error']['message']);return _0xc091d4(_0x2ebc28['error'][_0x8caa('0x12')]);}else{logger[_0x8caa('0xd')](_0x8caa('0xe'),_0x44fc47,_0x8caa('0xf'));_0xc091d4(_0x2ebc28['result'][_0x8caa('0x12')]);}})[_0x8caa('0x13')](function(_0x835ad2){logger['error']('SquareReport,\x20%s,\x20%s',_0x44fc47,_0x835ad2);_0x66553d(_0x835ad2);});});}exports['CreateSquareReport']=function(_0x41f366){var _0xb0c1d5=this;return new Promise(function(_0x5e2fc6,_0x5b0d3d){return db[_0x8caa('0x14')][_0x8caa('0x15')](_0x41f366['body'],{'raw':_0x41f366[_0x8caa('0x16')]?_0x41f366['options'][_0x8caa('0x17')]===undefined?!![]:![]:!![]})[_0x8caa('0xc')](function(_0x4ce26f){logger['info']('CreateSquareReport',_0x41f366);logger[_0x8caa('0x18')]('CreateSquareReport',_0x41f366,JSON['stringify'](_0x4ce26f));_0x5e2fc6(_0x4ce26f);})[_0x8caa('0x13')](function(_0x40882f){logger[_0x8caa('0x11')](_0x8caa('0x19'),_0x40882f[_0x8caa('0x12')],_0x41f366);_0x5b0d3d(_0xb0c1d5['error'](0x1f4,_0x40882f[_0x8caa('0x12')]));});});};exports[_0x8caa('0x1a')]=function(_0x143c04){var _0x29911b=this;return new Promise(function(_0x192fce,_0x6681e7){return db[_0x8caa('0x14')][_0x8caa('0x1b')](_0x143c04['body'],{'raw':_0x143c04[_0x8caa('0x16')]?_0x143c04[_0x8caa('0x16')][_0x8caa('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x143c04[_0x8caa('0x16')]?_0x143c04[_0x8caa('0x16')][_0x8caa('0x1c')]||null:null,'attributes':_0x143c04[_0x8caa('0x16')]?_0x143c04[_0x8caa('0x16')][_0x8caa('0x1d')]||null:null,'limit':_0x143c04[_0x8caa('0x16')]?_0x143c04[_0x8caa('0x16')][_0x8caa('0x1e')]||null:null})[_0x8caa('0xc')](function(_0x361041){logger[_0x8caa('0xd')](_0x8caa('0x1a'),_0x143c04);logger[_0x8caa('0x18')](_0x8caa('0x1a'),_0x143c04,JSON[_0x8caa('0x1f')](_0x361041));_0x192fce(_0x361041);})['catch'](function(_0x51df43){logger[_0x8caa('0x11')]('UpdateSquareReport',_0x51df43[_0x8caa('0x12')],_0x143c04);_0x6681e7(_0x29911b['error'](0x1f4,_0x51df43[_0x8caa('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index 1e72006..9810d3f 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 _0xdc5a=['show','update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated','describe','/:id'];(function(_0x28f443,_0x12e122){var _0x372d3c=function(_0x5d070a){while(--_0x5d070a){_0x28f443['push'](_0x28f443['shift']());}};_0x372d3c(++_0x12e122);}(_0xdc5a,0x8c));var _0xadc5=function(_0x2c684e,_0x5d9c74){_0x2c684e=_0x2c684e-0x0;var _0xb40e3c=_0xdc5a[_0x2c684e];return _0xb40e3c;};'use strict';var multer=require(_0xadc5('0x0'));var util=require('util');var path=require(_0xadc5('0x1'));var timeout=require(_0xadc5('0x2'));var express=require(_0xadc5('0x3'));var router=express[_0xadc5('0x4')]();var fs_extra=require(_0xadc5('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xadc5('0x6'));var config=require(_0xadc5('0x7'));var controller=require(_0xadc5('0x8'));router[_0xadc5('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xadc5('0x9')]('/describe',auth[_0xadc5('0xa')](),controller[_0xadc5('0xb')]);router[_0xadc5('0x9')](_0xadc5('0xc'),auth['isAuthenticated'](),controller[_0xadc5('0xd')]);router['post']('/',auth[_0xadc5('0xa')](),controller['create']);router['put']('/:id',auth[_0xadc5('0xa')](),controller[_0xadc5('0xe')]);router[_0xadc5('0xf')]('/:id',auth[_0xadc5('0xa')](),controller[_0xadc5('0x10')]);module['exports']=router; \ No newline at end of file +var _0x3471=['../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated','index','describe','/:id','show','post','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x8b95cc,_0x4b3d4d){var _0x17483c=function(_0x55f214){while(--_0x55f214){_0x8b95cc['push'](_0x8b95cc['shift']());}};_0x17483c(++_0x4b3d4d);}(_0x3471,0x19e));var _0x1347=function(_0x969146,_0x4c519c){_0x969146=_0x969146-0x0;var _0x17db3e=_0x3471[_0x969146];return _0x17db3e;};'use strict';var multer=require('multer');var util=require(_0x1347('0x0'));var path=require(_0x1347('0x1'));var timeout=require(_0x1347('0x2'));var express=require(_0x1347('0x3'));var router=express[_0x1347('0x4')]();var fs_extra=require(_0x1347('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x1347('0x6'));var config=require(_0x1347('0x7'));var controller=require(_0x1347('0x8'));router[_0x1347('0x9')]('/',auth[_0x1347('0xa')](),controller[_0x1347('0xb')]);router[_0x1347('0x9')]('/describe',auth[_0x1347('0xa')](),controller[_0x1347('0xc')]);router[_0x1347('0x9')](_0x1347('0xd'),auth[_0x1347('0xa')](),controller[_0x1347('0xe')]);router[_0x1347('0xf')]('/',auth[_0x1347('0xa')](),controller['create']);router['put'](_0x1347('0xd'),auth['isAuthenticated'](),controller[_0x1347('0x10')]);router[_0x1347('0x11')](_0x1347('0xd'),auth['isAuthenticated'](),controller[_0x1347('0x12')]);module[_0x1347('0x13')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index 6444006..3d98dd0 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 _0x9704=['STRING','sequelize','exports'];(function(_0x41b51f,_0x5242e){var _0x32d5d4=function(_0x46ca06){while(--_0x46ca06){_0x41b51f['push'](_0x41b51f['shift']());}};_0x32d5d4(++_0x5242e);}(_0x9704,0x6d));var _0x4970=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9704[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x4970('0x0'));module[_0x4970('0x1')]={'uniqueid':{'type':Sequelize[_0x4970('0x2')]},'node':{'type':Sequelize['STRING']},'application':{'type':Sequelize[_0x4970('0x2')]},'data':{'type':Sequelize['TEXT']},'project_name':{'type':Sequelize[_0x4970('0x2')]},'callerid':{'type':Sequelize[_0x4970('0x2')]}}; \ No newline at end of file +var _0x07ec=['exports','STRING','TEXT','sequelize'];(function(_0x5dc80c,_0x301bdf){var _0x32cbbd=function(_0x3313b8){while(--_0x3313b8){_0x5dc80c['push'](_0x5dc80c['shift']());}};_0x32cbbd(++_0x301bdf);}(_0x07ec,0x19f));var _0xc07e=function(_0x3b3210,_0x25e8ed){_0x3b3210=_0x3b3210-0x0;var _0x5b5484=_0x07ec[_0x3b3210];return _0x5b5484;};'use strict';var Sequelize=require(_0xc07e('0x0'));module[_0xc07e('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'node':{'type':Sequelize[_0xc07e('0x2')]},'application':{'type':Sequelize[_0xc07e('0x2')]},'data':{'type':Sequelize[_0xc07e('0x3')]},'project_name':{'type':Sequelize[_0xc07e('0x2')]},'callerid':{'type':Sequelize[_0xc07e('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index 25beaad..a6c1b0c 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 _0xd666=['keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','options','SquareDetailsReport','includeAll','include','findAll','rows','catch','show','params','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','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','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','send','index','map','rawAttributes','fieldName','type','model','name','query'];(function(_0xf168d3,_0x43dcfc){var _0x17fb54=function(_0x3d9674){while(--_0x3d9674){_0xf168d3['push'](_0xf168d3['shift']());}};_0x17fb54(++_0x43dcfc);}(_0xd666,0xae));var _0x6d66=function(_0x8eb9d,_0x320ee6){_0x8eb9d=_0x8eb9d-0x0;var _0x28c28=_0xd666[_0x8eb9d];return _0x28c28;};'use strict';var emlformat=require(_0x6d66('0x0'));var rimraf=require(_0x6d66('0x1'));var zipdir=require(_0x6d66('0x2'));var jsonpatch=require(_0x6d66('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6d66('0x4'));var Mustache=require('mustache');var util=require(_0x6d66('0x5'));var path=require(_0x6d66('0x6'));var sox=require('sox');var csv=require(_0x6d66('0x7'));var ejs=require(_0x6d66('0x8'));var fs=require('fs');var fs_extra=require(_0x6d66('0x9'));var _=require(_0x6d66('0xa'));var squel=require(_0x6d66('0xb'));var crypto=require(_0x6d66('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x6d66('0xd'));var toCsv=require(_0x6d66('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x6d66('0xe'));var qs=require(_0x6d66('0xf'));var as=require(_0x6d66('0x10'));var hardwareService=require(_0x6d66('0x11'));var logger=require('../../config/logger')(_0x6d66('0x12'));var utils=require(_0x6d66('0x13'));var config=require(_0x6d66('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x6d66('0x15'))['db'];function respondWithStatusCode(_0x2a804e,_0x31f134){_0x31f134=_0x31f134||0xcc;return function(_0x386f1c){if(_0x386f1c){return _0x2a804e[_0x6d66('0x16')](_0x31f134);}return _0x2a804e[_0x6d66('0x17')](_0x31f134)[_0x6d66('0x18')]();};}function respondWithResult(_0x5ceffe,_0x271869){_0x271869=_0x271869||0xc8;return function(_0xfa4088){if(_0xfa4088){return _0x5ceffe['status'](_0x271869)[_0x6d66('0x19')](_0xfa4088);}};}function respondWithFilteredResult(_0x5269ac,_0x58ab30){return function(_0x25333f){if(_0x25333f){var _0x2b0c98=typeof _0x58ab30[_0x6d66('0x1a')]===_0x6d66('0x1b')&&typeof _0x58ab30[_0x6d66('0x1c')]==='undefined';var _0xd6e8ef=_0x25333f[_0x6d66('0x1d')];var _0x4bcd49=_0x2b0c98?0x0:_0x58ab30['offset'];var _0x577b2=_0x2b0c98?_0x25333f[_0x6d66('0x1d')]:_0x58ab30[_0x6d66('0x1a')]+_0x58ab30[_0x6d66('0x1c')];var _0xba8e3e;if(_0x577b2>=_0xd6e8ef){_0x577b2=_0xd6e8ef;_0xba8e3e=0xc8;}else{_0xba8e3e=0xce;}_0x5269ac[_0x6d66('0x17')](_0xba8e3e);return _0x5269ac[_0x6d66('0x1e')](_0x6d66('0x1f'),_0x4bcd49+'-'+_0x577b2+'/'+_0xd6e8ef)['json'](_0x25333f);}return null;};}function patchUpdates(_0x1cc0fb){return function(_0x12f69c){try{jsonpatch[_0x6d66('0x20')](_0x12f69c,_0x1cc0fb,!![]);}catch(_0x35ddbf){return BPromise[_0x6d66('0x21')](_0x35ddbf);}return _0x12f69c[_0x6d66('0x22')]();};}function saveUpdates(_0x449d37,_0x28c1eb){return function(_0x2ad411){if(_0x2ad411){return _0x2ad411[_0x6d66('0x23')](_0x449d37)['then'](function(_0x54b16e){return _0x54b16e;});}return null;};}function removeEntity(_0x56d885,_0x1a5d19){return function(_0x34d6ac){if(_0x34d6ac){return _0x34d6ac[_0x6d66('0x24')]()[_0x6d66('0x25')](function(){_0x56d885['status'](0xcc)[_0x6d66('0x18')]();});}};}function handleEntityNotFound(_0x547bb8,_0x4769f0){return function(_0x36b75c){if(!_0x36b75c){_0x547bb8[_0x6d66('0x16')](0x194);}return _0x36b75c;};}function handleError(_0x201aa,_0x55e3a8){_0x55e3a8=_0x55e3a8||0x1f4;return function(_0x143ba1){logger[_0x6d66('0x26')](_0x143ba1['stack']);if(_0x143ba1['name']){delete _0x143ba1['name'];}_0x201aa[_0x6d66('0x17')](_0x55e3a8)[_0x6d66('0x27')](_0x143ba1);};}exports[_0x6d66('0x28')]=function(_0x46333e,_0x5f392f){var _0xbeada={},_0xdc6a65={},_0x542645={'count':0x0,'rows':[]};var _0x4cee0c=_[_0x6d66('0x29')](db['SquareDetailsReport'][_0x6d66('0x2a')],function(_0x5e6f47){return{'name':_0x5e6f47[_0x6d66('0x2b')],'type':_0x5e6f47[_0x6d66('0x2c')]['key']};});_0xdc6a65[_0x6d66('0x2d')]=_[_0x6d66('0x29')](_0x4cee0c,_0x6d66('0x2e'));_0xdc6a65[_0x6d66('0x2f')]=_[_0x6d66('0x30')](_0x46333e[_0x6d66('0x2f')]);_0xdc6a65[_0x6d66('0x31')]=_[_0x6d66('0x32')](_0xdc6a65[_0x6d66('0x2d')],_0xdc6a65[_0x6d66('0x2f')]);_0xbeada['attributes']=_['intersection'](_0xdc6a65['model'],qs[_0x6d66('0x33')](_0x46333e['query'][_0x6d66('0x33')]));_0xbeada['attributes']=_0xbeada[_0x6d66('0x34')][_0x6d66('0x35')]?_0xbeada[_0x6d66('0x34')]:_0xdc6a65[_0x6d66('0x2d')];if(!_0x46333e[_0x6d66('0x2f')][_0x6d66('0x36')](_0x6d66('0x37'))){_0xbeada[_0x6d66('0x1c')]=qs[_0x6d66('0x1c')](_0x46333e[_0x6d66('0x2f')]['limit']);_0xbeada[_0x6d66('0x1a')]=qs[_0x6d66('0x1a')](_0x46333e[_0x6d66('0x2f')][_0x6d66('0x1a')]);}_0xbeada[_0x6d66('0x38')]=qs[_0x6d66('0x39')](_0x46333e[_0x6d66('0x2f')][_0x6d66('0x39')]);_0xbeada['where']=qs['filters'](_[_0x6d66('0x3a')](_0x46333e[_0x6d66('0x2f')],_0xdc6a65[_0x6d66('0x31')]),_0x4cee0c);if(_0x46333e[_0x6d66('0x2f')]['filter']){_0xbeada[_0x6d66('0x3b')]=_[_0x6d66('0x3c')](_0xbeada[_0x6d66('0x3b')],{'$or':_[_0x6d66('0x29')](_0x4cee0c,function(_0x43f660){if(_0x43f660[_0x6d66('0x2c')]!==_0x6d66('0x3d')){var _0x36120a={};_0x36120a[_0x43f660['name']]={'$like':'%'+_0x46333e[_0x6d66('0x2f')]['filter']+'%'};return _0x36120a;}})});}_0xbeada=_['merge']({},_0xbeada,_0x46333e[_0x6d66('0x3e')]);var _0x3b033d={'where':_0xbeada[_0x6d66('0x3b')]};return db[_0x6d66('0x3f')][_0x6d66('0x1d')](_0x3b033d)[_0x6d66('0x25')](function(_0x55ccea){_0x542645[_0x6d66('0x1d')]=_0x55ccea;if(_0x46333e[_0x6d66('0x2f')][_0x6d66('0x40')]){_0xbeada[_0x6d66('0x41')]=[{'all':!![]}];}return db[_0x6d66('0x3f')][_0x6d66('0x42')](_0xbeada);})[_0x6d66('0x25')](function(_0x1c0314){_0x542645[_0x6d66('0x43')]=_0x1c0314;return _0x542645;})[_0x6d66('0x25')](respondWithFilteredResult(_0x5f392f,_0xbeada))[_0x6d66('0x44')](handleError(_0x5f392f,null));};exports[_0x6d66('0x45')]=function(_0x87a53b,_0x38ab4a){var _0x611577={'raw':!![],'where':{'id':_0x87a53b[_0x6d66('0x46')]['id']}},_0x87cbf1={};_0x87cbf1[_0x6d66('0x2d')]=_[_0x6d66('0x30')](db[_0x6d66('0x3f')]['rawAttributes']);_0x87cbf1['query']=_[_0x6d66('0x30')](_0x87a53b['query']);_0x87cbf1[_0x6d66('0x31')]=_[_0x6d66('0x32')](_0x87cbf1[_0x6d66('0x2d')],_0x87cbf1[_0x6d66('0x2f')]);_0x611577['attributes']=_[_0x6d66('0x32')](_0x87cbf1[_0x6d66('0x2d')],qs[_0x6d66('0x33')](_0x87a53b[_0x6d66('0x2f')]['fields']));_0x611577[_0x6d66('0x34')]=_0x611577[_0x6d66('0x34')][_0x6d66('0x35')]?_0x611577['attributes']:_0x87cbf1['model'];if(_0x87a53b[_0x6d66('0x2f')][_0x6d66('0x40')]){_0x611577[_0x6d66('0x41')]=[{'all':!![]}];}_0x611577=_[_0x6d66('0x3c')]({},_0x611577,_0x87a53b[_0x6d66('0x3e')]);return db['SquareDetailsReport']['find'](_0x611577)[_0x6d66('0x25')](handleEntityNotFound(_0x38ab4a,null))['then'](respondWithResult(_0x38ab4a,null))[_0x6d66('0x44')](handleError(_0x38ab4a,null));};exports[_0x6d66('0x47')]=function(_0x21c0e1,_0x2e6604){return db[_0x6d66('0x3f')][_0x6d66('0x47')](_0x21c0e1[_0x6d66('0x48')],{})['then'](respondWithResult(_0x2e6604,0xc9))[_0x6d66('0x44')](handleError(_0x2e6604,null));};exports[_0x6d66('0x23')]=function(_0x57edc2,_0x406b32){if(_0x57edc2[_0x6d66('0x48')]['id']){delete _0x57edc2[_0x6d66('0x48')]['id'];}return db[_0x6d66('0x3f')]['find']({'where':{'id':_0x57edc2['params']['id']}})[_0x6d66('0x25')](handleEntityNotFound(_0x406b32,null))[_0x6d66('0x25')](saveUpdates(_0x57edc2[_0x6d66('0x48')],null))[_0x6d66('0x25')](respondWithResult(_0x406b32,null))[_0x6d66('0x44')](handleError(_0x406b32,null));};exports[_0x6d66('0x24')]=function(_0x14df56,_0x20a789){return db[_0x6d66('0x3f')]['find']({'where':{'id':_0x14df56[_0x6d66('0x46')]['id']}})[_0x6d66('0x25')](handleEntityNotFound(_0x20a789,null))[_0x6d66('0x25')](removeEntity(_0x20a789,null))[_0x6d66('0x44')](handleError(_0x20a789,null));};exports[_0x6d66('0x49')]=function(_0x384bcf,_0x308cbd){return db[_0x6d66('0x3f')][_0x6d66('0x49')]()['then'](respondWithResult(_0x308cbd,null))['catch'](handleError(_0x308cbd,null));}; \ No newline at end of file +var _0xee2d=['order','sort','where','filter','merge','VIRTUAL','options','SquareDetailsReport','includeAll','findAll','catch','show','params','include','find','body','destroy','describe','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','crypto','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','rawAttributes','fieldName','type','key','map','keys','filters','intersection','model','query','attributes','fields','length','nolimit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xee2d,0x132));var _0xdee2=function(_0x102cce,_0x1f2f45){_0x102cce=_0x102cce-0x0;var _0x189976=_0xee2d[_0x102cce];return _0x189976;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdee2('0x0'));var zipdir=require(_0xdee2('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdee2('0x2'));var moment=require(_0xdee2('0x3'));var BPromise=require(_0xdee2('0x4'));var Mustache=require(_0xdee2('0x5'));var util=require('util');var path=require(_0xdee2('0x6'));var sox=require(_0xdee2('0x7'));var csv=require('to-csv');var ejs=require(_0xdee2('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdee2('0x9'));var squel=require('squel');var crypto=require(_0xdee2('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xdee2('0xb'));var querystring=require(_0xdee2('0xc'));var Papa=require('papaparse');var Redis=require(_0xdee2('0xd'));var authService=require(_0xdee2('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xdee2('0xf'));var hardwareService=require(_0xdee2('0x10'));var logger=require(_0xdee2('0x11'))(_0xdee2('0x12'));var utils=require('../../config/utils');var config=require(_0xdee2('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xdee2('0x14'))['db'];function respondWithStatusCode(_0x4e4b54,_0x466631){_0x466631=_0x466631||0xcc;return function(_0x187cb8){if(_0x187cb8){return _0x4e4b54[_0xdee2('0x15')](_0x466631);}return _0x4e4b54['status'](_0x466631)[_0xdee2('0x16')]();};}function respondWithResult(_0x169207,_0x23563e){_0x23563e=_0x23563e||0xc8;return function(_0x428d6f){if(_0x428d6f){return _0x169207[_0xdee2('0x17')](_0x23563e)[_0xdee2('0x18')](_0x428d6f);}};}function respondWithFilteredResult(_0x4eafd9,_0x537bae){return function(_0x2d641a){if(_0x2d641a){var _0x34343e=typeof _0x537bae[_0xdee2('0x19')]===_0xdee2('0x1a')&&typeof _0x537bae['limit']==='undefined';var _0x1216f2=_0x2d641a[_0xdee2('0x1b')];var _0x5d6747=_0x34343e?0x0:_0x537bae[_0xdee2('0x19')];var _0x2218d=_0x34343e?_0x2d641a[_0xdee2('0x1b')]:_0x537bae[_0xdee2('0x19')]+_0x537bae[_0xdee2('0x1c')];var _0x493a39;if(_0x2218d>=_0x1216f2){_0x2218d=_0x1216f2;_0x493a39=0xc8;}else{_0x493a39=0xce;}_0x4eafd9[_0xdee2('0x17')](_0x493a39);return _0x4eafd9[_0xdee2('0x1d')](_0xdee2('0x1e'),_0x5d6747+'-'+_0x2218d+'/'+_0x1216f2)['json'](_0x2d641a);}return null;};}function patchUpdates(_0x4be664){return function(_0x20002b){try{jsonpatch[_0xdee2('0x1f')](_0x20002b,_0x4be664,!![]);}catch(_0x5bd162){return BPromise[_0xdee2('0x20')](_0x5bd162);}return _0x20002b[_0xdee2('0x21')]();};}function saveUpdates(_0x1f5cc1,_0x568578){return function(_0x1bb7ac){if(_0x1bb7ac){return _0x1bb7ac[_0xdee2('0x22')](_0x1f5cc1)[_0xdee2('0x23')](function(_0xcfe27c){return _0xcfe27c;});}return null;};}function removeEntity(_0x1888b8,_0x1eac0c){return function(_0x5ca631){if(_0x5ca631){return _0x5ca631['destroy']()[_0xdee2('0x23')](function(){_0x1888b8[_0xdee2('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e009,_0x5858e9){return function(_0x317ebd){if(!_0x317ebd){_0x5e009[_0xdee2('0x15')](0x194);}return _0x317ebd;};}function handleError(_0xb96093,_0x16c8d5){_0x16c8d5=_0x16c8d5||0x1f4;return function(_0x4a745a){logger[_0xdee2('0x24')](_0x4a745a[_0xdee2('0x25')]);if(_0x4a745a[_0xdee2('0x26')]){delete _0x4a745a[_0xdee2('0x26')];}_0xb96093['status'](_0x16c8d5)[_0xdee2('0x27')](_0x4a745a);};}exports['index']=function(_0xee2df5,_0x43027f){var _0x1c0b1e={},_0x10967a={},_0xfce182={'count':0x0,'rows':[]};var _0x225ce3=_['map'](db['SquareDetailsReport'][_0xdee2('0x28')],function(_0x360ea0){return{'name':_0x360ea0[_0xdee2('0x29')],'type':_0x360ea0[_0xdee2('0x2a')][_0xdee2('0x2b')]};});_0x10967a['model']=_[_0xdee2('0x2c')](_0x225ce3,_0xdee2('0x26'));_0x10967a['query']=_[_0xdee2('0x2d')](_0xee2df5['query']);_0x10967a[_0xdee2('0x2e')]=_[_0xdee2('0x2f')](_0x10967a[_0xdee2('0x30')],_0x10967a[_0xdee2('0x31')]);_0x1c0b1e[_0xdee2('0x32')]=_[_0xdee2('0x2f')](_0x10967a[_0xdee2('0x30')],qs['fields'](_0xee2df5[_0xdee2('0x31')][_0xdee2('0x33')]));_0x1c0b1e['attributes']=_0x1c0b1e[_0xdee2('0x32')][_0xdee2('0x34')]?_0x1c0b1e[_0xdee2('0x32')]:_0x10967a[_0xdee2('0x30')];if(!_0xee2df5[_0xdee2('0x31')]['hasOwnProperty'](_0xdee2('0x35'))){_0x1c0b1e[_0xdee2('0x1c')]=qs[_0xdee2('0x1c')](_0xee2df5['query'][_0xdee2('0x1c')]);_0x1c0b1e[_0xdee2('0x19')]=qs[_0xdee2('0x19')](_0xee2df5['query'][_0xdee2('0x19')]);}_0x1c0b1e[_0xdee2('0x36')]=qs['sort'](_0xee2df5['query'][_0xdee2('0x37')]);_0x1c0b1e[_0xdee2('0x38')]=qs[_0xdee2('0x2e')](_['pick'](_0xee2df5[_0xdee2('0x31')],_0x10967a[_0xdee2('0x2e')]),_0x225ce3);if(_0xee2df5[_0xdee2('0x31')][_0xdee2('0x39')]){_0x1c0b1e['where']=_[_0xdee2('0x3a')](_0x1c0b1e[_0xdee2('0x38')],{'$or':_['map'](_0x225ce3,function(_0x42722c){if(_0x42722c[_0xdee2('0x2a')]!==_0xdee2('0x3b')){var _0x5a4024={};_0x5a4024[_0x42722c[_0xdee2('0x26')]]={'$like':'%'+_0xee2df5[_0xdee2('0x31')][_0xdee2('0x39')]+'%'};return _0x5a4024;}})});}_0x1c0b1e=_['merge']({},_0x1c0b1e,_0xee2df5[_0xdee2('0x3c')]);var _0x1647e8={'where':_0x1c0b1e[_0xdee2('0x38')]};return db[_0xdee2('0x3d')][_0xdee2('0x1b')](_0x1647e8)[_0xdee2('0x23')](function(_0x28ef52){_0xfce182['count']=_0x28ef52;if(_0xee2df5[_0xdee2('0x31')][_0xdee2('0x3e')]){_0x1c0b1e['include']=[{'all':!![]}];}return db[_0xdee2('0x3d')][_0xdee2('0x3f')](_0x1c0b1e);})[_0xdee2('0x23')](function(_0x39fd8d){_0xfce182['rows']=_0x39fd8d;return _0xfce182;})['then'](respondWithFilteredResult(_0x43027f,_0x1c0b1e))[_0xdee2('0x40')](handleError(_0x43027f,null));};exports[_0xdee2('0x41')]=function(_0x18df45,_0x29ac74){var _0x62f310={'raw':!![],'where':{'id':_0x18df45[_0xdee2('0x42')]['id']}},_0x2d5440={};_0x2d5440[_0xdee2('0x30')]=_[_0xdee2('0x2d')](db['SquareDetailsReport'][_0xdee2('0x28')]);_0x2d5440['query']=_[_0xdee2('0x2d')](_0x18df45[_0xdee2('0x31')]);_0x2d5440[_0xdee2('0x2e')]=_[_0xdee2('0x2f')](_0x2d5440[_0xdee2('0x30')],_0x2d5440[_0xdee2('0x31')]);_0x62f310[_0xdee2('0x32')]=_['intersection'](_0x2d5440['model'],qs[_0xdee2('0x33')](_0x18df45['query'][_0xdee2('0x33')]));_0x62f310[_0xdee2('0x32')]=_0x62f310[_0xdee2('0x32')][_0xdee2('0x34')]?_0x62f310[_0xdee2('0x32')]:_0x2d5440['model'];if(_0x18df45[_0xdee2('0x31')][_0xdee2('0x3e')]){_0x62f310[_0xdee2('0x43')]=[{'all':!![]}];}_0x62f310=_[_0xdee2('0x3a')]({},_0x62f310,_0x18df45['options']);return db['SquareDetailsReport'][_0xdee2('0x44')](_0x62f310)[_0xdee2('0x23')](handleEntityNotFound(_0x29ac74,null))[_0xdee2('0x23')](respondWithResult(_0x29ac74,null))[_0xdee2('0x40')](handleError(_0x29ac74,null));};exports['create']=function(_0x1de5b8,_0x19fc00){return db[_0xdee2('0x3d')]['create'](_0x1de5b8[_0xdee2('0x45')],{})['then'](respondWithResult(_0x19fc00,0xc9))['catch'](handleError(_0x19fc00,null));};exports['update']=function(_0x4e1668,_0x201132){if(_0x4e1668[_0xdee2('0x45')]['id']){delete _0x4e1668[_0xdee2('0x45')]['id'];}return db[_0xdee2('0x3d')][_0xdee2('0x44')]({'where':{'id':_0x4e1668[_0xdee2('0x42')]['id']}})[_0xdee2('0x23')](handleEntityNotFound(_0x201132,null))[_0xdee2('0x23')](saveUpdates(_0x4e1668[_0xdee2('0x45')],null))[_0xdee2('0x23')](respondWithResult(_0x201132,null))[_0xdee2('0x40')](handleError(_0x201132,null));};exports[_0xdee2('0x46')]=function(_0x57fee1,_0x398085){return db[_0xdee2('0x3d')][_0xdee2('0x44')]({'where':{'id':_0x57fee1[_0xdee2('0x42')]['id']}})[_0xdee2('0x23')](handleEntityNotFound(_0x398085,null))['then'](removeEntity(_0x398085,null))[_0xdee2('0x40')](handleError(_0x398085,null));};exports[_0xdee2('0x47')]=function(_0x403ce5,_0x11f075){return db[_0xdee2('0x3d')][_0xdee2('0x47')]()[_0xdee2('0x23')](respondWithResult(_0x11f075,null))[_0xdee2('0x40')](handleError(_0x11f075,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index b684dea..c0437c9 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 _0x1d9a=['path','rimraf','./squareReportDetail.attributes','exports','define','SquareDetailsReport','report_square_details','lodash','../../config/logger','moment','bluebird'];(function(_0x2bd3ca,_0x15c0a3){var _0x4ac154=function(_0xbe3ba8){while(--_0xbe3ba8){_0x2bd3ca['push'](_0x2bd3ca['shift']());}};_0x4ac154(++_0x15c0a3);}(_0x1d9a,0x146));var _0xa1d9=function(_0x2ac98a,_0x4e9576){_0x2ac98a=_0x2ac98a-0x0;var _0x30d2ab=_0x1d9a[_0x2ac98a];return _0x30d2ab;};'use strict';var _=require(_0xa1d9('0x0'));var util=require('util');var logger=require(_0xa1d9('0x1'))('api');var moment=require(_0xa1d9('0x2'));var BPromise=require(_0xa1d9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa1d9('0x4'));var rimraf=require(_0xa1d9('0x5'));var config=require('../../config/environment');var attributes=require(_0xa1d9('0x6'));module[_0xa1d9('0x7')]=function(_0x49a549,_0xcab85f){return _0x49a549[_0xa1d9('0x8')](_0xa1d9('0x9'),attributes,{'tableName':_0xa1d9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2264=['SquareDetailsReport','report_square_details','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./squareReportDetail.attributes'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0x2264,0x7b));var _0x4226=function(_0x46a95e,_0x2dcf26){_0x46a95e=_0x46a95e-0x0;var _0x4e536e=_0x2264[_0x46a95e];return _0x4e536e;};'use strict';var _=require(_0x4226('0x0'));var util=require(_0x4226('0x1'));var logger=require('../../config/logger')(_0x4226('0x2'));var moment=require(_0x4226('0x3'));var BPromise=require(_0x4226('0x4'));var rp=require(_0x4226('0x5'));var fs=require('fs');var path=require(_0x4226('0x6'));var rimraf=require('rimraf');var config=require(_0x4226('0x7'));var attributes=require(_0x4226('0x8'));module['exports']=function(_0x19a323,_0x51cab0){return _0x19a323['define'](_0x4226('0x9'),attributes,{'tableName':_0x4226('0xa'),'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 19dce61..7ae6b11 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 _0xa478=['rpc','../../config/environment','jayson/promise','http','then','info','request\x20sent','debug','error','code','message','SquareDetailsReport,\x20%s,\x20%s','result','catch','CreateSquareDetailsReport','create','body','options','raw','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x54dee9,_0x19d570){var _0x53282f=function(_0x38dc45){while(--_0x38dc45){_0x54dee9['push'](_0x54dee9['shift']());}};_0x53282f(++_0x19d570);}(_0xa478,0x136));var _0x8a47=function(_0x3a16d4,_0x23ecda){_0x3a16d4=_0x3a16d4-0x0;var _0x31ea9c=_0xa478[_0x3a16d4];return _0x31ea9c;};'use strict';var _=require(_0x8a47('0x0'));var util=require(_0x8a47('0x1'));var moment=require(_0x8a47('0x2'));var BPromise=require(_0x8a47('0x3'));var rs=require(_0x8a47('0x4'));var fs=require('fs');var Redis=require(_0x8a47('0x5'));var db=require(_0x8a47('0x6'))['db'];var utils=require(_0x8a47('0x7'));var logger=require(_0x8a47('0x8'))(_0x8a47('0x9'));var config=require(_0x8a47('0xa'));var jayson=require(_0x8a47('0xb'));var client=jayson['client'][_0x8a47('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2d62a6,_0x3de815,_0x3cb340){return new BPromise(function(_0x56884b,_0x384886){return client['request'](_0x2d62a6,_0x3cb340)[_0x8a47('0xd')](function(_0x369fc9){logger[_0x8a47('0xe')]('SquareDetailsReport,\x20%s,\x20%s',_0x3de815,_0x8a47('0xf'));logger[_0x8a47('0x10')]('SquareDetailsReport,\x20%s,\x20%s,\x20%s',_0x3de815,_0x8a47('0xf'),JSON['stringify'](_0x369fc9));if(_0x369fc9[_0x8a47('0x11')]){if(_0x369fc9[_0x8a47('0x11')][_0x8a47('0x12')]===0x1f4){logger['error']('SquareDetailsReport,\x20%s,\x20%s',_0x3de815,_0x369fc9['error'][_0x8a47('0x13')]);return _0x384886(_0x369fc9[_0x8a47('0x11')]['message']);}logger[_0x8a47('0x11')](_0x8a47('0x14'),_0x3de815,_0x369fc9[_0x8a47('0x11')][_0x8a47('0x13')]);return _0x56884b(_0x369fc9[_0x8a47('0x11')][_0x8a47('0x13')]);}else{logger[_0x8a47('0xe')](_0x8a47('0x14'),_0x3de815,_0x8a47('0xf'));_0x56884b(_0x369fc9[_0x8a47('0x15')][_0x8a47('0x13')]);}})[_0x8a47('0x16')](function(_0x2917d9){logger['error'](_0x8a47('0x14'),_0x3de815,_0x2917d9);_0x384886(_0x2917d9);});});}exports[_0x8a47('0x17')]=function(_0x3f9093){var _0x5f5884=this;return new Promise(function(_0x341089,_0x5c62eb){return db['SquareDetailsReport'][_0x8a47('0x18')](_0x3f9093[_0x8a47('0x19')],{'raw':_0x3f9093[_0x8a47('0x1a')]?_0x3f9093[_0x8a47('0x1a')][_0x8a47('0x1b')]===undefined?!![]:![]:!![]})[_0x8a47('0xd')](function(_0x44e119){logger[_0x8a47('0xe')](_0x8a47('0x17'),_0x3f9093);logger[_0x8a47('0x10')]('CreateSquareDetailsReport',_0x3f9093,JSON[_0x8a47('0x1c')](_0x44e119));_0x341089(_0x44e119);})['catch'](function(_0x289f28){logger[_0x8a47('0x11')](_0x8a47('0x17'),_0x289f28[_0x8a47('0x13')],_0x3f9093);_0x5c62eb(_0x5f5884['error'](0x1f4,_0x289f28[_0x8a47('0x13')]));});});}; \ No newline at end of file +var _0x7be1=['SquareDetailsReport','create','body','options','raw','CreateSquareDetailsReport','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','request','then','info','request\x20sent','debug','stringify','error','message','SquareDetailsReport,\x20%s,\x20%s','result','catch'];(function(_0x4c2efa,_0x4c5b65){var _0x6f79bc=function(_0x5c461d){while(--_0x5c461d){_0x4c2efa['push'](_0x4c2efa['shift']());}};_0x6f79bc(++_0x4c5b65);}(_0x7be1,0x165));var _0x17be=function(_0x166d93,_0x301f09){_0x166d93=_0x166d93-0x0;var _0xba708=_0x7be1[_0x166d93];return _0xba708;};'use strict';var _=require(_0x17be('0x0'));var util=require(_0x17be('0x1'));var moment=require(_0x17be('0x2'));var BPromise=require('bluebird');var rs=require(_0x17be('0x3'));var fs=require('fs');var Redis=require(_0x17be('0x4'));var db=require(_0x17be('0x5'))['db'];var utils=require(_0x17be('0x6'));var logger=require(_0x17be('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x17be('0x8')][_0x17be('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4f5b0c,_0x326f4d,_0x23f19f){return new BPromise(function(_0x2c74b2,_0xfd9c5){return client[_0x17be('0xa')](_0x4f5b0c,_0x23f19f)[_0x17be('0xb')](function(_0x582848){logger[_0x17be('0xc')]('SquareDetailsReport,\x20%s,\x20%s',_0x326f4d,_0x17be('0xd'));logger[_0x17be('0xe')]('SquareDetailsReport,\x20%s,\x20%s,\x20%s',_0x326f4d,_0x17be('0xd'),JSON[_0x17be('0xf')](_0x582848));if(_0x582848[_0x17be('0x10')]){if(_0x582848[_0x17be('0x10')]['code']===0x1f4){logger[_0x17be('0x10')]('SquareDetailsReport,\x20%s,\x20%s',_0x326f4d,_0x582848[_0x17be('0x10')]['message']);return _0xfd9c5(_0x582848[_0x17be('0x10')][_0x17be('0x11')]);}logger[_0x17be('0x10')](_0x17be('0x12'),_0x326f4d,_0x582848[_0x17be('0x10')]['message']);return _0x2c74b2(_0x582848[_0x17be('0x10')]['message']);}else{logger['info'](_0x17be('0x12'),_0x326f4d,'request\x20sent');_0x2c74b2(_0x582848[_0x17be('0x13')]['message']);}})[_0x17be('0x14')](function(_0x312b2e){logger['error'](_0x17be('0x12'),_0x326f4d,_0x312b2e);_0xfd9c5(_0x312b2e);});});}exports['CreateSquareDetailsReport']=function(_0x222009){var _0x4cff4b=this;return new Promise(function(_0x328e3,_0x165dfb){return db[_0x17be('0x15')][_0x17be('0x16')](_0x222009[_0x17be('0x17')],{'raw':_0x222009['options']?_0x222009[_0x17be('0x18')][_0x17be('0x19')]===undefined?!![]:![]:!![]})[_0x17be('0xb')](function(_0x19678b){logger['info'](_0x17be('0x1a'),_0x222009);logger['debug']('CreateSquareDetailsReport',_0x222009,JSON[_0x17be('0xf')](_0x19678b));_0x328e3(_0x19678b);})[_0x17be('0x14')](function(_0x19fbdb){logger[_0x17be('0x10')]('CreateSquareDetailsReport',_0x19fbdb[_0x17be('0x11')],_0x222009);_0x165dfb(_0x4cff4b[_0x17be('0x10')](0x1f4,_0x19fbdb['message']));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index bf6790a..19a84a3 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 _0xd854=['killProcess','express','Router','../../components/auth/service','get','/process/:pid/kill'];(function(_0x3d6e0f,_0x2a4345){var _0x344849=function(_0x517bc3){while(--_0x517bc3){_0x3d6e0f['push'](_0x3d6e0f['shift']());}};_0x344849(++_0x2a4345);}(_0xd854,0xcd));var _0x4d85=function(_0x338b49,_0x2270b0){_0x338b49=_0x338b49-0x0;var _0x3ad341=_0xd854[_0x338b49];return _0x3ad341;};'use strict';var express=require(_0x4d85('0x0'));var router=express[_0x4d85('0x1')]();var auth=require(_0x4d85('0x2'));var controller=require('./system.controller');router[_0x4d85('0x3')]('/',auth['isAuthenticated'](),controller['index']);router[_0x4d85('0x3')](_0x4d85('0x4'),auth['isAuthenticated'](),controller[_0x4d85('0x5')]);module['exports']=router; \ No newline at end of file +var _0xa2ef=['Router','../../components/auth/service','get','isAuthenticated','/process/:pid/kill','killProcess'];(function(_0x580521,_0x1537ee){var _0x4ef71c=function(_0x3a75a0){while(--_0x3a75a0){_0x580521['push'](_0x580521['shift']());}};_0x4ef71c(++_0x1537ee);}(_0xa2ef,0x1f2));var _0xfa2e=function(_0x4697f2,_0x1de28e){_0x4697f2=_0x4697f2-0x0;var _0x147729=_0xa2ef[_0x4697f2];return _0x147729;};'use strict';var express=require('express');var router=express[_0xfa2e('0x0')]();var auth=require(_0xfa2e('0x1'));var controller=require('./system.controller');router[_0xfa2e('0x2')]('/',auth[_0xfa2e('0x3')](),controller['index']);router[_0xfa2e('0x2')](_0xfa2e('0x4'),auth['isAuthenticated'](),controller[_0xfa2e('0x5')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index ad6ba50..882b566 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 _0xef2e=['length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','child_process','../../config/logger','util','bluebird','lodash','error','inspect','name','status','index','getAllData','then','json','catch','killProcess','components/import/cm','format','params','pid','split'];(function(_0x1e835a,_0xe7dcb5){var _0x3cc332=function(_0x91e217){while(--_0x91e217){_0x1e835a['push'](_0x1e835a['shift']());}};_0x3cc332(++_0xe7dcb5);}(_0xef2e,0x87));var _0xeef2=function(_0x247b0b,_0x3df01f){_0x247b0b=_0x247b0b-0x0;var _0x44dfde=_0xef2e[_0x247b0b];return _0x44dfde;};'use strict';var info=require(_0xeef2('0x0'));var exec=require(_0xeef2('0x1'))['exec'];var logger=require(_0xeef2('0x2'))('api');var util=require(_0xeef2('0x3'));var BPromise=require(_0xeef2('0x4'));var _=require(_0xeef2('0x5'));function handleError(_0x3d055f,_0x3dc6a6,_0x5b81b5){_0x3dc6a6=_0x3dc6a6||0x1f4;return function(_0x2a6aa8){logger[_0xeef2('0x6')]('<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s',_0x5b81b5,_0x3dc6a6,util[_0xeef2('0x7')](_0x2a6aa8,{'showHidden':![],'depth':null}));delete _0x2a6aa8[_0xeef2('0x8')];_0x3d055f[_0xeef2('0x9')](_0x3dc6a6)['send'](_0x2a6aa8);};}exports[_0xeef2('0xa')]=function(_0x138958,_0x1bc00c){return info[_0xeef2('0xb')]()[_0xeef2('0xc')](function(_0x19ef84){return _0x1bc00c[_0xeef2('0x9')](0xc8)[_0xeef2('0xd')](_0x19ef84);})[_0xeef2('0xe')](function(_0x6a048){return _0x1bc00c[_0xeef2('0x9')](0x1f4)['json'](_0x6a048);});};exports[_0xeef2('0xf')]=function(_0x1136fb,_0x48ee6a){var _0x5ef5c6=[_0xeef2('0x10')];return new BPromise(function(_0x115b1e,_0x57cadb){return exec(util[_0xeef2('0x11')]('ps\x20-p\x20%s\x20-ww\x20-o\x20args',_0x1136fb[_0xeef2('0x12')][_0xeef2('0x13')]),function(_0x80729b,_0x37df17,_0x3457f2){if(_0x80729b){return _0x57cadb(_0x80729b);}return _0x115b1e(_0x37df17);});})[_0xeef2('0xc')](function(_0x2f8dfa){var _0x14cf9a=![];var _0x5ab3f1=_0x2f8dfa[_0xeef2('0x14')](/\n/);for(var _0x27d05d=0x0,_0x3b1d52=_0x5ef5c6[_0xeef2('0x15')];_0x27d05d<_0x3b1d52,_0x14cf9a===![];_0x27d05d+=0x1){if(_0x2f8dfa[_0xeef2('0x16')](_0x5ef5c6[_0x27d05d])>=0x0){_0x14cf9a=!![];}}if(!_0x14cf9a){throw new Error(util[_0xeef2('0x11')](_0xeef2('0x17'),_0x1136fb[_0xeef2('0x12')][_0xeef2('0x13')]));}process[_0xeef2('0x18')](_0x1136fb[_0xeef2('0x12')][_0xeef2('0x13')],'SIGINT');return _0x48ee6a[_0xeef2('0x9')](0xc8)[_0xeef2('0xd')]({'message':util['format'](_0xeef2('0x19'),_0x1136fb[_0xeef2('0x12')]['pid'])});})[_0xeef2('0xe')](handleError(_0x48ee6a,null,_0xeef2('0xf')));}; \ No newline at end of file +var _0xe567=['index','json','catch','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','then','split','length','Process\x20with\x20pid\x20%s\x20not\x20found!','pid','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','child_process','exec','bluebird','error','inspect','name','status','send'];(function(_0x386cef,_0x112e10){var _0x2f866f=function(_0xcc8a40){while(--_0xcc8a40){_0x386cef['push'](_0x386cef['shift']());}};_0x2f866f(++_0x112e10);}(_0xe567,0xa6));var _0x7e56=function(_0x21b744,_0x36e84c){_0x21b744=_0x21b744-0x0;var _0x6690=_0xe567[_0x21b744];return _0x6690;};'use strict';var info=require(_0x7e56('0x0'));var exec=require(_0x7e56('0x1'))[_0x7e56('0x2')];var logger=require('../../config/logger')('api');var util=require('util');var BPromise=require(_0x7e56('0x3'));var _=require('lodash');function handleError(_0x27ebcc,_0x5d0ca0,_0x1fb3e5){_0x5d0ca0=_0x5d0ca0||0x1f4;return function(_0x2ef49c){logger[_0x7e56('0x4')]('<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s',_0x1fb3e5,_0x5d0ca0,util[_0x7e56('0x5')](_0x2ef49c,{'showHidden':![],'depth':null}));delete _0x2ef49c[_0x7e56('0x6')];_0x27ebcc[_0x7e56('0x7')](_0x5d0ca0)[_0x7e56('0x8')](_0x2ef49c);};}exports[_0x7e56('0x9')]=function(_0x22a615,_0x52c9a0){return info['getAllData']()['then'](function(_0x531175){return _0x52c9a0['status'](0xc8)[_0x7e56('0xa')](_0x531175);})[_0x7e56('0xb')](function(_0x1c817c){return _0x52c9a0['status'](0x1f4)[_0x7e56('0xa')](_0x1c817c);});};exports[_0x7e56('0xc')]=function(_0x47c6aa,_0x1be805){var _0x1e77b5=[_0x7e56('0xd')];return new BPromise(function(_0x3295c2,_0x1b227c){return exec(util[_0x7e56('0xe')](_0x7e56('0xf'),_0x47c6aa[_0x7e56('0x10')]['pid']),function(_0x3dfe3a,_0x3e82c2,_0x23c047){if(_0x3dfe3a){return _0x1b227c(_0x3dfe3a);}return _0x3295c2(_0x3e82c2);});})[_0x7e56('0x11')](function(_0x435217){var _0x135dae=![];var _0xcb286f=_0x435217[_0x7e56('0x12')](/\n/);for(var _0x3e8fc2=0x0,_0xf8db10=_0x1e77b5[_0x7e56('0x13')];_0x3e8fc2<_0xf8db10,_0x135dae===![];_0x3e8fc2+=0x1){if(_0x435217['indexOf'](_0x1e77b5[_0x3e8fc2])>=0x0){_0x135dae=!![];}}if(!_0x135dae){throw new Error(util['format'](_0x7e56('0x14'),_0x47c6aa[_0x7e56('0x10')][_0x7e56('0x15')]));}process[_0x7e56('0x16')](_0x47c6aa[_0x7e56('0x10')][_0x7e56('0x15')],_0x7e56('0x17'));return _0x1be805[_0x7e56('0x7')](0xc8)['json']({'message':util[_0x7e56('0xe')](_0x7e56('0x18'),_0x47c6aa[_0x7e56('0x10')][_0x7e56('0x15')])});})['catch'](handleError(_0x1be805,null,_0x7e56('0xc')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index 65d6f3c..0102a0b 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 _0x7c10=['util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./tag.controller','isAuthenticated','index','get','/:id','show','create','update','delete','destroy','exports','multer'];(function(_0x3f39ab,_0x16c981){var _0x170952=function(_0x45e049){while(--_0x45e049){_0x3f39ab['push'](_0x3f39ab['shift']());}};_0x170952(++_0x16c981);}(_0x7c10,0x142));var _0x07c1=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x7c10[_0x8c43de];return _0xa6591b;};'use strict';var multer=require(_0x07c1('0x0'));var util=require(_0x07c1('0x1'));var path=require(_0x07c1('0x2'));var timeout=require('connect-timeout');var express=require(_0x07c1('0x3'));var router=express[_0x07c1('0x4')]();var fs_extra=require(_0x07c1('0x5'));var auth=require(_0x07c1('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x07c1('0x7'));var controller=require(_0x07c1('0x8'));router['get']('/',auth[_0x07c1('0x9')](),controller[_0x07c1('0xa')]);router[_0x07c1('0xb')](_0x07c1('0xc'),auth[_0x07c1('0x9')](),controller[_0x07c1('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x07c1('0xe')]);router['put'](_0x07c1('0xc'),auth[_0x07c1('0x9')](),controller[_0x07c1('0xf')]);router[_0x07c1('0x10')](_0x07c1('0xc'),auth[_0x07c1('0x9')](),controller[_0x07c1('0x11')]);module[_0x07c1('0x12')]=router; \ No newline at end of file +var _0xa134=['../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','get','isAuthenticated','/:id','show','create','put','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x3f6c29,_0x370d86){var _0x4af959=function(_0x263612){while(--_0x263612){_0x3f6c29['push'](_0x3f6c29['shift']());}};_0x4af959(++_0x370d86);}(_0xa134,0xf0));var _0x4a13=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa134[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x4a13('0x0'));var util=require(_0x4a13('0x1'));var path=require(_0x4a13('0x2'));var timeout=require(_0x4a13('0x3'));var express=require(_0x4a13('0x4'));var router=express[_0x4a13('0x5')]();var fs_extra=require(_0x4a13('0x6'));var auth=require(_0x4a13('0x7'));var interaction=require(_0x4a13('0x8'));var config=require(_0x4a13('0x9'));var controller=require(_0x4a13('0xa'));router[_0x4a13('0xb')]('/',auth[_0x4a13('0xc')](),controller['index']);router['get'](_0x4a13('0xd'),auth[_0x4a13('0xc')](),controller[_0x4a13('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x4a13('0xf')]);router[_0x4a13('0x10')](_0x4a13('0xd'),auth[_0x4a13('0xc')](),controller['update']);router[_0x4a13('0x11')](_0x4a13('0xd'),auth[_0x4a13('0xc')](),controller['destroy']);module[_0x4a13('0x12')]=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index 778b505..a5592b5 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 _0x3d45=['STRING','name','sequelize','exports'];(function(_0x2909b1,_0x424d46){var _0x554957=function(_0x1ecb40){while(--_0x1ecb40){_0x2909b1['push'](_0x2909b1['shift']());}};_0x554957(++_0x424d46);}(_0x3d45,0x1d2));var _0x53d4=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x3d45[_0x2f5ac5];return _0x37c9a8;};'use strict';var Sequelize=require(_0x53d4('0x0'));module[_0x53d4('0x1')]={'name':{'type':Sequelize[_0x53d4('0x2')],'unique':_0x53d4('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x53d4('0x2')],'defaultValue':'#0091EA'},'description':{'type':Sequelize[_0x53d4('0x2')]}}; \ No newline at end of file +var _0x8769=['#0091EA','STRING','sequelize','exports','name'];(function(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0x8769,0x110));var _0x9876=function(_0x17406a,_0x1e2320){_0x17406a=_0x17406a-0x0;var _0x1501ff=_0x8769[_0x17406a];return _0x1501ff;};'use strict';var Sequelize=require(_0x9876('0x0'));module[_0x9876('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x9876('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize['STRING'],'defaultValue':_0x9876('0x3')},'description':{'type':Sequelize[_0x9876('0x4')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index 679750a..b5af0e5 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 _0xb43b=['rawAttributes','include','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','undefined','count','offset','limit','set','Content-Range','json','apply','reject','update','destroy','Tags','then','status','sendStatus','error','stack','name','send','index','Tag','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','includeAll','rows','catch','show','params'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0xb43b,0x1b2));var _0xbb43=function(_0xc9a47d,_0x361e23){_0xc9a47d=_0xc9a47d-0x0;var _0x5e15bc=_0xb43b[_0xc9a47d];return _0x5e15bc;};'use strict';var emlformat=require(_0xbb43('0x0'));var rimraf=require(_0xbb43('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbb43('0x2'));var rp=require(_0xbb43('0x3'));var moment=require(_0xbb43('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xbb43('0x5'));var util=require(_0xbb43('0x6'));var path=require(_0xbb43('0x7'));var sox=require(_0xbb43('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbb43('0x9'));var _=require('lodash');var squel=require(_0xbb43('0xa'));var crypto=require(_0xbb43('0xb'));var jsforce=require(_0xbb43('0xc'));var deskjs=require(_0xbb43('0xd'));var toCsv=require(_0xbb43('0xe'));var querystring=require('querystring');var Papa=require(_0xbb43('0xf'));var Redis=require(_0xbb43('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xbb43('0x11'));var as=require(_0xbb43('0x12'));var hardwareService=require(_0xbb43('0x13'));var logger=require(_0xbb43('0x14'))(_0xbb43('0x15'));var utils=require(_0xbb43('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xbb43('0x17'));var db=require(_0xbb43('0x18'))['db'];function respondWithStatusCode(_0x50e2c0,_0x578392){_0x578392=_0x578392||0xcc;return function(_0x41e7e5){if(_0x41e7e5){return _0x50e2c0['sendStatus'](_0x578392);}return _0x50e2c0['status'](_0x578392)[_0xbb43('0x19')]();};}function respondWithResult(_0x5a509f,_0x68d45d){_0x68d45d=_0x68d45d||0xc8;return function(_0x43021d){if(_0x43021d){return _0x5a509f['status'](_0x68d45d)['json'](_0x43021d);}};}function respondWithFilteredResult(_0x4d5bcf,_0x338120){return function(_0x2abce0){if(_0x2abce0){var _0x57bd1d=typeof _0x338120['offset']===_0xbb43('0x1a')&&typeof _0x338120['limit']==='undefined';var _0x2b0797=_0x2abce0[_0xbb43('0x1b')];var _0x2e3b43=_0x57bd1d?0x0:_0x338120['offset'];var _0x1c16d7=_0x57bd1d?_0x2abce0['count']:_0x338120[_0xbb43('0x1c')]+_0x338120[_0xbb43('0x1d')];var _0x4dfc54;if(_0x1c16d7>=_0x2b0797){_0x1c16d7=_0x2b0797;_0x4dfc54=0xc8;}else{_0x4dfc54=0xce;}_0x4d5bcf['status'](_0x4dfc54);return _0x4d5bcf[_0xbb43('0x1e')](_0xbb43('0x1f'),_0x2e3b43+'-'+_0x1c16d7+'/'+_0x2b0797)[_0xbb43('0x20')](_0x2abce0);}return null;};}function patchUpdates(_0x2bf2d4){return function(_0x5bcce7){try{jsonpatch[_0xbb43('0x21')](_0x5bcce7,_0x2bf2d4,!![]);}catch(_0x5f4416){return BPromise[_0xbb43('0x22')](_0x5f4416);}return _0x5bcce7['save']();};}function saveUpdates(_0x2f5e31,_0x565256){return function(_0x3f323e){if(_0x3f323e){return _0x3f323e[_0xbb43('0x23')](_0x2f5e31)['then'](function(_0x1d0768){return _0x1d0768;});}return null;};}function removeEntity(_0x4dfb7f,_0xf24e60){return function(_0x298ce2){if(_0x298ce2){return _0x298ce2[_0xbb43('0x24')]()['then'](function(){var _0x53f0d5=_0x298ce2['get']({'plain':!![]});var _0x269ca5=_0xbb43('0x25');return db['UserProfileResource'][_0xbb43('0x24')]({'where':{'type':_0x269ca5,'resourceId':_0x53f0d5['id']}})[_0xbb43('0x26')](function(){return _0x298ce2;});})[_0xbb43('0x26')](function(){_0x4dfb7f[_0xbb43('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b5342,_0x27fd7a){return function(_0x42800f){if(!_0x42800f){_0x4b5342[_0xbb43('0x28')](0x194);}return _0x42800f;};}function handleError(_0x8b3205,_0x510b05){_0x510b05=_0x510b05||0x1f4;return function(_0x40b04b){logger[_0xbb43('0x29')](_0x40b04b[_0xbb43('0x2a')]);if(_0x40b04b['name']){delete _0x40b04b[_0xbb43('0x2b')];}_0x8b3205['status'](_0x510b05)[_0xbb43('0x2c')](_0x40b04b);};}exports[_0xbb43('0x2d')]=function(_0x34f5b2,_0x1880cd){var _0x555b99={},_0x157d62={},_0x547a6f={'count':0x0,'rows':[]};var _0x5566cf=_['map'](db[_0xbb43('0x2e')]['rawAttributes'],function(_0xa7e144){return{'name':_0xa7e144[_0xbb43('0x2f')],'type':_0xa7e144[_0xbb43('0x30')]['key']};});_0x157d62[_0xbb43('0x31')]=_[_0xbb43('0x32')](_0x5566cf,_0xbb43('0x2b'));_0x157d62[_0xbb43('0x33')]=_[_0xbb43('0x34')](_0x34f5b2[_0xbb43('0x33')]);_0x157d62[_0xbb43('0x35')]=_[_0xbb43('0x36')](_0x157d62['model'],_0x157d62[_0xbb43('0x33')]);_0x555b99[_0xbb43('0x37')]=_[_0xbb43('0x36')](_0x157d62[_0xbb43('0x31')],qs[_0xbb43('0x38')](_0x34f5b2[_0xbb43('0x33')][_0xbb43('0x38')]));_0x555b99[_0xbb43('0x37')]=_0x555b99[_0xbb43('0x37')][_0xbb43('0x39')]?_0x555b99[_0xbb43('0x37')]:_0x157d62[_0xbb43('0x31')];if(!_0x34f5b2[_0xbb43('0x33')][_0xbb43('0x3a')](_0xbb43('0x3b'))){_0x555b99[_0xbb43('0x1d')]=qs['limit'](_0x34f5b2[_0xbb43('0x33')][_0xbb43('0x1d')]);_0x555b99['offset']=qs[_0xbb43('0x1c')](_0x34f5b2[_0xbb43('0x33')][_0xbb43('0x1c')]);}_0x555b99['order']=qs['sort'](_0x34f5b2['query'][_0xbb43('0x3c')]);_0x555b99[_0xbb43('0x3d')]=qs['filters'](_['pick'](_0x34f5b2[_0xbb43('0x33')],_0x157d62[_0xbb43('0x35')]),_0x5566cf);if(_0x34f5b2[_0xbb43('0x33')][_0xbb43('0x3e')]){_0x555b99[_0xbb43('0x3d')]=_['merge'](_0x555b99[_0xbb43('0x3d')],{'$or':_[_0xbb43('0x32')](_0x5566cf,function(_0x2cd8b8){if(_0x2cd8b8[_0xbb43('0x30')]!==_0xbb43('0x3f')){var _0x531d96={};_0x531d96[_0x2cd8b8[_0xbb43('0x2b')]]={'$like':'%'+_0x34f5b2['query'][_0xbb43('0x3e')]+'%'};return _0x531d96;}})});}_0x555b99=_[_0xbb43('0x40')]({},_0x555b99,_0x34f5b2['options']);var _0x4783fe={'where':_0x555b99['where']};return db[_0xbb43('0x2e')][_0xbb43('0x1b')](_0x4783fe)[_0xbb43('0x26')](function(_0xb84ece){_0x547a6f['count']=_0xb84ece;if(_0x34f5b2[_0xbb43('0x33')][_0xbb43('0x41')]){_0x555b99['include']=[{'all':!![]}];}return db[_0xbb43('0x2e')]['findAll'](_0x555b99);})[_0xbb43('0x26')](function(_0x14285d){_0x547a6f[_0xbb43('0x42')]=_0x14285d;return _0x547a6f;})[_0xbb43('0x26')](respondWithFilteredResult(_0x1880cd,_0x555b99))[_0xbb43('0x43')](handleError(_0x1880cd,null));};exports[_0xbb43('0x44')]=function(_0x4bf8ed,_0x1beb2a){var _0x5686ee={'raw':!![],'where':{'id':_0x4bf8ed[_0xbb43('0x45')]['id']}},_0x307f1e={};_0x307f1e[_0xbb43('0x31')]=_[_0xbb43('0x34')](db['Tag'][_0xbb43('0x46')]);_0x307f1e[_0xbb43('0x33')]=_[_0xbb43('0x34')](_0x4bf8ed[_0xbb43('0x33')]);_0x307f1e[_0xbb43('0x35')]=_[_0xbb43('0x36')](_0x307f1e[_0xbb43('0x31')],_0x307f1e[_0xbb43('0x33')]);_0x5686ee['attributes']=_[_0xbb43('0x36')](_0x307f1e[_0xbb43('0x31')],qs['fields'](_0x4bf8ed[_0xbb43('0x33')]['fields']));_0x5686ee['attributes']=_0x5686ee['attributes']['length']?_0x5686ee[_0xbb43('0x37')]:_0x307f1e['model'];if(_0x4bf8ed[_0xbb43('0x33')]['includeAll']){_0x5686ee[_0xbb43('0x47')]=[{'all':!![]}];}_0x5686ee=_[_0xbb43('0x40')]({},_0x5686ee,_0x4bf8ed[_0xbb43('0x48')]);return db['Tag'][_0xbb43('0x49')](_0x5686ee)['then'](handleEntityNotFound(_0x1beb2a,null))[_0xbb43('0x26')](respondWithResult(_0x1beb2a,null))[_0xbb43('0x43')](handleError(_0x1beb2a,null));};exports[_0xbb43('0x4a')]=function(_0x29840e,_0x417ad9){return db[_0xbb43('0x2e')][_0xbb43('0x4a')](_0x29840e['body'],{})[_0xbb43('0x26')](function(_0x26ea59){var _0x202059=_0x29840e[_0xbb43('0x4b')]['get']({'plain':!![]});if(!_0x202059)throw new Error(_0xbb43('0x4c'));if(_0x202059[_0xbb43('0x4d')]===_0xbb43('0x4b')){var _0xb1883e=_0x26ea59['get']({'plain':!![]});var _0x3206c0=_0xbb43('0x25');return db[_0xbb43('0x4e')]['find']({'where':{'name':_0x3206c0,'userProfileId':_0x202059[_0xbb43('0x4f')]},'raw':!![]})[_0xbb43('0x26')](function(_0x73d4ce){if(_0x73d4ce&&_0x73d4ce[_0xbb43('0x50')]===0x0){return db[_0xbb43('0x51')]['create']({'name':_0xb1883e['name'],'resourceId':_0xb1883e['id'],'type':_0x73d4ce[_0xbb43('0x2b')],'sectionId':_0x73d4ce['id']},{})['then'](function(){return _0x26ea59;});}else{return _0x26ea59;}})[_0xbb43('0x43')](function(_0xe0cdba){logger['error'](_0xbb43('0x52'),_0xe0cdba);throw _0xe0cdba;});}return _0x26ea59;})[_0xbb43('0x26')](respondWithResult(_0x417ad9,0xc9))[_0xbb43('0x43')](handleError(_0x417ad9,null));};exports[_0xbb43('0x23')]=function(_0x1dfbb9,_0x5cb3c6){if(_0x1dfbb9[_0xbb43('0x53')]['id']){delete _0x1dfbb9['body']['id'];}return db['Tag'][_0xbb43('0x49')]({'where':{'id':_0x1dfbb9[_0xbb43('0x45')]['id']}})[_0xbb43('0x26')](handleEntityNotFound(_0x5cb3c6,null))[_0xbb43('0x26')](saveUpdates(_0x1dfbb9[_0xbb43('0x53')],null))['then'](respondWithResult(_0x5cb3c6,null))['catch'](handleError(_0x5cb3c6,null));};exports[_0xbb43('0x24')]=function(_0x157824,_0x3a84ad){return db[_0xbb43('0x2e')][_0xbb43('0x49')]({'where':{'id':_0x157824[_0xbb43('0x45')]['id']}})[_0xbb43('0x26')](handleEntityNotFound(_0x3a84ad,null))[_0xbb43('0x26')](removeEntity(_0x3a84ad,null))[_0xbb43('0x43')](handleError(_0x3a84ad,null));}; \ No newline at end of file +var _0x4b1f=['userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','offset','count','limit','set','apply','reject','save','update','then','destroy','Tags','UserProfileResource','error','stack','name','send','Tag','rawAttributes','fieldName','type','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','options','findAll','catch','show','includeAll','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection'];(function(_0x5a9c0c,_0x4ec485){var _0x53c77d=function(_0x1cf384){while(--_0x1cf384){_0x5a9c0c['push'](_0x5a9c0c['shift']());}};_0x53c77d(++_0x4ec485);}(_0x4b1f,0x195));var _0xf4b1=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0x4b1f[_0x5c2e3e];return _0x53f64a;};'use strict';var emlformat=require(_0xf4b1('0x0'));var rimraf=require(_0xf4b1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf4b1('0x2'));var rp=require(_0xf4b1('0x3'));var moment=require(_0xf4b1('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf4b1('0x5'));var util=require(_0xf4b1('0x6'));var path=require(_0xf4b1('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf4b1('0x8'));var fs=require('fs');var fs_extra=require(_0xf4b1('0x9'));var _=require(_0xf4b1('0xa'));var squel=require(_0xf4b1('0xb'));var crypto=require(_0xf4b1('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xf4b1('0xd'));var Papa=require('papaparse');var Redis=require(_0xf4b1('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xf4b1('0xf'));var hardwareService=require(_0xf4b1('0x10'));var logger=require(_0xf4b1('0x11'))(_0xf4b1('0x12'));var utils=require(_0xf4b1('0x13'));var config=require(_0xf4b1('0x14'));var licenseUtil=require(_0xf4b1('0x15'));var db=require(_0xf4b1('0x16'))['db'];function respondWithStatusCode(_0x38afbb,_0xf66b4c){_0xf66b4c=_0xf66b4c||0xcc;return function(_0x2c4eb9){if(_0x2c4eb9){return _0x38afbb[_0xf4b1('0x17')](_0xf66b4c);}return _0x38afbb[_0xf4b1('0x18')](_0xf66b4c)['end']();};}function respondWithResult(_0x591476,_0x3ea6f3){_0x3ea6f3=_0x3ea6f3||0xc8;return function(_0x5cbc25){if(_0x5cbc25){return _0x591476['status'](_0x3ea6f3)[_0xf4b1('0x19')](_0x5cbc25);}};}function respondWithFilteredResult(_0x51c39f,_0x5764b1){return function(_0x293f59){if(_0x293f59){var _0x4968f4=typeof _0x5764b1['offset']==='undefined'&&typeof _0x5764b1['limit']===_0xf4b1('0x1a');var _0x3ee70a=_0x293f59['count'];var _0x3b378e=_0x4968f4?0x0:_0x5764b1[_0xf4b1('0x1b')];var _0x322b38=_0x4968f4?_0x293f59[_0xf4b1('0x1c')]:_0x5764b1[_0xf4b1('0x1b')]+_0x5764b1[_0xf4b1('0x1d')];var _0x5b0214;if(_0x322b38>=_0x3ee70a){_0x322b38=_0x3ee70a;_0x5b0214=0xc8;}else{_0x5b0214=0xce;}_0x51c39f[_0xf4b1('0x18')](_0x5b0214);return _0x51c39f[_0xf4b1('0x1e')]('Content-Range',_0x3b378e+'-'+_0x322b38+'/'+_0x3ee70a)[_0xf4b1('0x19')](_0x293f59);}return null;};}function patchUpdates(_0x30c239){return function(_0x56ef48){try{jsonpatch[_0xf4b1('0x1f')](_0x56ef48,_0x30c239,!![]);}catch(_0x559a64){return BPromise[_0xf4b1('0x20')](_0x559a64);}return _0x56ef48[_0xf4b1('0x21')]();};}function saveUpdates(_0x5c50e8,_0x20013c){return function(_0x29b8c1){if(_0x29b8c1){return _0x29b8c1[_0xf4b1('0x22')](_0x5c50e8)[_0xf4b1('0x23')](function(_0x58376d){return _0x58376d;});}return null;};}function removeEntity(_0x92b390,_0x474212){return function(_0x4b6c08){if(_0x4b6c08){return _0x4b6c08[_0xf4b1('0x24')]()['then'](function(){var _0x15cfc4=_0x4b6c08['get']({'plain':!![]});var _0x238fbe=_0xf4b1('0x25');return db[_0xf4b1('0x26')]['destroy']({'where':{'type':_0x238fbe,'resourceId':_0x15cfc4['id']}})[_0xf4b1('0x23')](function(){return _0x4b6c08;});})['then'](function(){_0x92b390[_0xf4b1('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x29493b,_0x447ae7){return function(_0x5d28af){if(!_0x5d28af){_0x29493b[_0xf4b1('0x17')](0x194);}return _0x5d28af;};}function handleError(_0x23693b,_0x5bd8ee){_0x5bd8ee=_0x5bd8ee||0x1f4;return function(_0x125bf4){logger[_0xf4b1('0x27')](_0x125bf4[_0xf4b1('0x28')]);if(_0x125bf4[_0xf4b1('0x29')]){delete _0x125bf4[_0xf4b1('0x29')];}_0x23693b[_0xf4b1('0x18')](_0x5bd8ee)[_0xf4b1('0x2a')](_0x125bf4);};}exports['index']=function(_0x56ee5e,_0x31c13c){var _0xff9a65={},_0x1cbcff={},_0x29b9f9={'count':0x0,'rows':[]};var _0x35d81b=_['map'](db[_0xf4b1('0x2b')][_0xf4b1('0x2c')],function(_0xa6bdd7){return{'name':_0xa6bdd7[_0xf4b1('0x2d')],'type':_0xa6bdd7[_0xf4b1('0x2e')][_0xf4b1('0x2f')]};});_0x1cbcff[_0xf4b1('0x30')]=_[_0xf4b1('0x31')](_0x35d81b,'name');_0x1cbcff[_0xf4b1('0x32')]=_['keys'](_0x56ee5e['query']);_0x1cbcff['filters']=_[_0xf4b1('0x33')](_0x1cbcff[_0xf4b1('0x30')],_0x1cbcff[_0xf4b1('0x32')]);_0xff9a65[_0xf4b1('0x34')]=_[_0xf4b1('0x33')](_0x1cbcff[_0xf4b1('0x30')],qs[_0xf4b1('0x35')](_0x56ee5e[_0xf4b1('0x32')]['fields']));_0xff9a65[_0xf4b1('0x34')]=_0xff9a65['attributes'][_0xf4b1('0x36')]?_0xff9a65[_0xf4b1('0x34')]:_0x1cbcff['model'];if(!_0x56ee5e[_0xf4b1('0x32')][_0xf4b1('0x37')](_0xf4b1('0x38'))){_0xff9a65[_0xf4b1('0x1d')]=qs[_0xf4b1('0x1d')](_0x56ee5e['query'][_0xf4b1('0x1d')]);_0xff9a65['offset']=qs[_0xf4b1('0x1b')](_0x56ee5e['query'][_0xf4b1('0x1b')]);}_0xff9a65[_0xf4b1('0x39')]=qs[_0xf4b1('0x3a')](_0x56ee5e['query'][_0xf4b1('0x3a')]);_0xff9a65[_0xf4b1('0x3b')]=qs[_0xf4b1('0x3c')](_[_0xf4b1('0x3d')](_0x56ee5e[_0xf4b1('0x32')],_0x1cbcff[_0xf4b1('0x3c')]),_0x35d81b);if(_0x56ee5e[_0xf4b1('0x32')]['filter']){_0xff9a65[_0xf4b1('0x3b')]=_[_0xf4b1('0x3e')](_0xff9a65[_0xf4b1('0x3b')],{'$or':_[_0xf4b1('0x31')](_0x35d81b,function(_0x39de7f){if(_0x39de7f[_0xf4b1('0x2e')]!=='VIRTUAL'){var _0x33879b={};_0x33879b[_0x39de7f[_0xf4b1('0x29')]]={'$like':'%'+_0x56ee5e['query']['filter']+'%'};return _0x33879b;}})});}_0xff9a65=_[_0xf4b1('0x3e')]({},_0xff9a65,_0x56ee5e[_0xf4b1('0x3f')]);var _0x439c9d={'where':_0xff9a65[_0xf4b1('0x3b')]};return db[_0xf4b1('0x2b')][_0xf4b1('0x1c')](_0x439c9d)[_0xf4b1('0x23')](function(_0x1600b6){_0x29b9f9['count']=_0x1600b6;if(_0x56ee5e[_0xf4b1('0x32')]['includeAll']){_0xff9a65['include']=[{'all':!![]}];}return db['Tag'][_0xf4b1('0x40')](_0xff9a65);})[_0xf4b1('0x23')](function(_0x28b9f2){_0x29b9f9['rows']=_0x28b9f2;return _0x29b9f9;})[_0xf4b1('0x23')](respondWithFilteredResult(_0x31c13c,_0xff9a65))[_0xf4b1('0x41')](handleError(_0x31c13c,null));};exports[_0xf4b1('0x42')]=function(_0x5597d5,_0x13c130){var _0x15845a={'raw':!![],'where':{'id':_0x5597d5['params']['id']}},_0x1f856c={};_0x1f856c[_0xf4b1('0x30')]=_['keys'](db[_0xf4b1('0x2b')][_0xf4b1('0x2c')]);_0x1f856c[_0xf4b1('0x32')]=_['keys'](_0x5597d5[_0xf4b1('0x32')]);_0x1f856c[_0xf4b1('0x3c')]=_['intersection'](_0x1f856c[_0xf4b1('0x30')],_0x1f856c[_0xf4b1('0x32')]);_0x15845a[_0xf4b1('0x34')]=_[_0xf4b1('0x33')](_0x1f856c['model'],qs['fields'](_0x5597d5[_0xf4b1('0x32')][_0xf4b1('0x35')]));_0x15845a['attributes']=_0x15845a[_0xf4b1('0x34')]['length']?_0x15845a[_0xf4b1('0x34')]:_0x1f856c['model'];if(_0x5597d5[_0xf4b1('0x32')][_0xf4b1('0x43')]){_0x15845a['include']=[{'all':!![]}];}_0x15845a=_[_0xf4b1('0x3e')]({},_0x15845a,_0x5597d5[_0xf4b1('0x3f')]);return db[_0xf4b1('0x2b')][_0xf4b1('0x44')](_0x15845a)[_0xf4b1('0x23')](handleEntityNotFound(_0x13c130,null))[_0xf4b1('0x23')](respondWithResult(_0x13c130,null))[_0xf4b1('0x41')](handleError(_0x13c130,null));};exports[_0xf4b1('0x45')]=function(_0x4e6e04,_0x4a9761){return db[_0xf4b1('0x2b')][_0xf4b1('0x45')](_0x4e6e04['body'],{})[_0xf4b1('0x23')](function(_0x3476b3){var _0x21dc3b=_0x4e6e04[_0xf4b1('0x46')][_0xf4b1('0x47')]({'plain':!![]});if(!_0x21dc3b)throw new Error(_0xf4b1('0x48'));if(_0x21dc3b[_0xf4b1('0x49')]===_0xf4b1('0x46')){var _0x29c3c1=_0x3476b3[_0xf4b1('0x47')]({'plain':!![]});var _0x407ecf=_0xf4b1('0x25');return db[_0xf4b1('0x4a')][_0xf4b1('0x44')]({'where':{'name':_0x407ecf,'userProfileId':_0x21dc3b[_0xf4b1('0x4b')]},'raw':!![]})[_0xf4b1('0x23')](function(_0xacaa0e){if(_0xacaa0e&&_0xacaa0e[_0xf4b1('0x4c')]===0x0){return db[_0xf4b1('0x26')][_0xf4b1('0x45')]({'name':_0x29c3c1[_0xf4b1('0x29')],'resourceId':_0x29c3c1['id'],'type':_0xacaa0e[_0xf4b1('0x29')],'sectionId':_0xacaa0e['id']},{})[_0xf4b1('0x23')](function(){return _0x3476b3;});}else{return _0x3476b3;}})[_0xf4b1('0x41')](function(_0x389ad7){logger[_0xf4b1('0x27')](_0xf4b1('0x4d'),_0x389ad7);throw _0x389ad7;});}return _0x3476b3;})[_0xf4b1('0x23')](respondWithResult(_0x4a9761,0xc9))['catch'](handleError(_0x4a9761,null));};exports[_0xf4b1('0x22')]=function(_0x479e71,_0x5bdd65){if(_0x479e71[_0xf4b1('0x4e')]['id']){delete _0x479e71[_0xf4b1('0x4e')]['id'];}return db['Tag'][_0xf4b1('0x44')]({'where':{'id':_0x479e71[_0xf4b1('0x4f')]['id']}})[_0xf4b1('0x23')](handleEntityNotFound(_0x5bdd65,null))['then'](saveUpdates(_0x479e71['body'],null))[_0xf4b1('0x23')](respondWithResult(_0x5bdd65,null))[_0xf4b1('0x41')](handleError(_0x5bdd65,null));};exports[_0xf4b1('0x24')]=function(_0x38938f,_0x402e6c){return db[_0xf4b1('0x2b')][_0xf4b1('0x44')]({'where':{'id':_0x38938f[_0xf4b1('0x4f')]['id']}})[_0xf4b1('0x23')](handleEntityNotFound(_0x402e6c,null))[_0xf4b1('0x23')](removeEntity(_0x402e6c,null))[_0xf4b1('0x41')](handleError(_0x402e6c,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index f23ad9d..fc90126 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 _0x5094=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./tag.attributes','Tag','tools_tags','lodash','util'];(function(_0x507abf,_0x102de1){var _0x93bddf=function(_0x1230d8){while(--_0x1230d8){_0x507abf['push'](_0x507abf['shift']());}};_0x93bddf(++_0x102de1);}(_0x5094,0x6a));var _0x4509=function(_0x485034,_0x43f507){_0x485034=_0x485034-0x0;var _0x34e386=_0x5094[_0x485034];return _0x34e386;};'use strict';var _=require(_0x4509('0x0'));var util=require(_0x4509('0x1'));var logger=require(_0x4509('0x2'))(_0x4509('0x3'));var moment=require(_0x4509('0x4'));var BPromise=require(_0x4509('0x5'));var rp=require(_0x4509('0x6'));var fs=require('fs');var path=require(_0x4509('0x7'));var rimraf=require(_0x4509('0x8'));var config=require('../../config/environment');var attributes=require(_0x4509('0x9'));module['exports']=function(_0x48d28e,_0x144208){return _0x48d28e['define'](_0x4509('0xa'),attributes,{'tableName':_0x4509('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9541=['Tag','tools_tags','lodash','util','api','bluebird','request-promise','path','../../config/environment','./tag.attributes','exports','define'];(function(_0x23bc0b,_0x5369a1){var _0x3b57a6=function(_0x4a14aa){while(--_0x4a14aa){_0x23bc0b['push'](_0x23bc0b['shift']());}};_0x3b57a6(++_0x5369a1);}(_0x9541,0xc2));var _0x1954=function(_0x374f8e,_0x1a5402){_0x374f8e=_0x374f8e-0x0;var _0x3bc591=_0x9541[_0x374f8e];return _0x3bc591;};'use strict';var _=require(_0x1954('0x0'));var util=require(_0x1954('0x1'));var logger=require('../../config/logger')(_0x1954('0x2'));var moment=require('moment');var BPromise=require(_0x1954('0x3'));var rp=require(_0x1954('0x4'));var fs=require('fs');var path=require(_0x1954('0x5'));var rimraf=require('rimraf');var config=require(_0x1954('0x6'));var attributes=require(_0x1954('0x7'));module[_0x1954('0x8')]=function(_0x8cfd61,_0x3b1dc3){return _0x8cfd61[_0x1954('0x9')](_0x1954('0xa'),attributes,{'tableName':_0x1954('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/tag/tag.rpc.js b/server/api/tag/tag.rpc.js index c05f7d1..350f660 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 _0xe107=['then','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','error','code','message','info','lodash','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise'];(function(_0x2c9fea,_0x13e47c){var _0x3e7cd3=function(_0xaaf41e){while(--_0xaaf41e){_0x2c9fea['push'](_0x2c9fea['shift']());}};_0x3e7cd3(++_0x13e47c);}(_0xe107,0xb3));var _0x7e10=function(_0x97e6ec,_0x2e8806){_0x97e6ec=_0x97e6ec-0x0;var _0x4e3ba3=_0xe107[_0x97e6ec];return _0x4e3ba3;};'use strict';var _=require(_0x7e10('0x0'));var util=require('util');var moment=require(_0x7e10('0x1'));var BPromise=require(_0x7e10('0x2'));var rs=require(_0x7e10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7e10('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7e10('0x5'));var config=require(_0x7e10('0x6'));var jayson=require(_0x7e10('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1dd3de,_0x7378b3,_0x156c56){return new BPromise(function(_0x3413f7,_0x493958){return client['request'](_0x1dd3de,_0x156c56)[_0x7e10('0x8')](function(_0x490a7a){logger['info'](_0x7e10('0x9'),_0x7378b3,_0x7e10('0xa'));logger[_0x7e10('0xb')](_0x7e10('0xc'),_0x7378b3,_0x7e10('0xa'),JSON['stringify'](_0x490a7a));if(_0x490a7a[_0x7e10('0xd')]){if(_0x490a7a['error'][_0x7e10('0xe')]===0x1f4){logger[_0x7e10('0xd')](_0x7e10('0x9'),_0x7378b3,_0x490a7a['error'][_0x7e10('0xf')]);return _0x493958(_0x490a7a[_0x7e10('0xd')][_0x7e10('0xf')]);}logger[_0x7e10('0xd')](_0x7e10('0x9'),_0x7378b3,_0x490a7a[_0x7e10('0xd')][_0x7e10('0xf')]);return _0x3413f7(_0x490a7a[_0x7e10('0xd')]['message']);}else{logger[_0x7e10('0x10')](_0x7e10('0x9'),_0x7378b3,'request\x20sent');_0x3413f7(_0x490a7a['result'][_0x7e10('0xf')]);}})['catch'](function(_0xe1abd2){logger[_0x7e10('0xd')](_0x7e10('0x9'),_0x7378b3,_0xe1abd2);_0x493958(_0xe1abd2);});});} \ No newline at end of file +var _0x5089=['result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x59a591,_0xc9132b){var _0x325ff9=function(_0x1e06f5){while(--_0x1e06f5){_0x59a591['push'](_0x59a591['shift']());}};_0x325ff9(++_0xc9132b);}(_0x5089,0x1bb));var _0x9508=function(_0x423097,_0x8a09f4){_0x423097=_0x423097-0x0;var _0x3a73f1=_0x5089[_0x423097];return _0x3a73f1;};'use strict';var _=require(_0x9508('0x0'));var util=require(_0x9508('0x1'));var moment=require('moment');var BPromise=require(_0x9508('0x2'));var rs=require(_0x9508('0x3'));var fs=require('fs');var Redis=require(_0x9508('0x4'));var db=require(_0x9508('0x5'))['db'];var utils=require(_0x9508('0x6'));var logger=require('../../config/logger')(_0x9508('0x7'));var config=require('../../config/environment');var jayson=require(_0x9508('0x8'));var client=jayson[_0x9508('0x9')][_0x9508('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4ab3c6,_0x1dc04c,_0x42d13a){return new BPromise(function(_0x55a5de,_0x14dae7){return client[_0x9508('0xb')](_0x4ab3c6,_0x42d13a)['then'](function(_0x342ddd){logger['info'](_0x9508('0xc'),_0x1dc04c,_0x9508('0xd'));logger[_0x9508('0xe')](_0x9508('0xf'),_0x1dc04c,_0x9508('0xd'),JSON[_0x9508('0x10')](_0x342ddd));if(_0x342ddd['error']){if(_0x342ddd[_0x9508('0x11')]['code']===0x1f4){logger[_0x9508('0x11')](_0x9508('0xc'),_0x1dc04c,_0x342ddd['error'][_0x9508('0x12')]);return _0x14dae7(_0x342ddd[_0x9508('0x11')][_0x9508('0x12')]);}logger[_0x9508('0x11')]('Tag,\x20%s,\x20%s',_0x1dc04c,_0x342ddd[_0x9508('0x11')][_0x9508('0x12')]);return _0x55a5de(_0x342ddd['error'][_0x9508('0x12')]);}else{logger['info'](_0x9508('0xc'),_0x1dc04c,_0x9508('0xd'));_0x55a5de(_0x342ddd[_0x9508('0x13')][_0x9508('0x12')]);}})[_0x9508('0x14')](function(_0x343802){logger[_0x9508('0x11')](_0x9508('0xc'),_0x1dc04c,_0x343802);_0x14dae7(_0x343802);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index 281827d..7f0667c 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(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_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'));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(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0xa9e0[_0x1b828b];return _0x98da1a;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/queues',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/queues',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x13')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller['destroy']);router[_0x0a9e('0x13')]('/:id/queues',auth[_0x0a9e('0xd')](),controller['removeQueues']);router[_0x0a9e('0x13')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/team/team.attributes.js b/server/api/team/team.attributes.js index 6c668a2..d97914b 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 _0xbaf0=['name','exports','STRING'];(function(_0x23b655,_0x4feb2b){var _0x364b32=function(_0x4e41ac){while(--_0x4e41ac){_0x23b655['push'](_0x23b655['shift']());}};_0x364b32(++_0x4feb2b);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xbaf0[_0x2b4411];return _0x8e41ef;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'name':{'type':Sequelize[_0x0baf('0x1')],'allowNull':![],'unique':_0x0baf('0x2')},'description':{'type':Sequelize[_0x0baf('0x1')]}}; \ No newline at end of file +var _0xb10b=['name','sequelize','STRING'];(function(_0x22732f,_0x2dff55){var _0x8062a7=function(_0x3d04d1){while(--_0x3d04d1){_0x22732f['push'](_0x22732f['shift']());}};_0x8062a7(++_0x2dff55);}(_0xb10b,0x12a));var _0xbb10=function(_0x34f545,_0x2bd2ee){_0x34f545=_0x34f545-0x0;var _0x1ff6b8=_0xb10b[_0x34f545];return _0x1ff6b8;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'name':{'type':Sequelize[_0xbb10('0x1')],'allowNull':![],'unique':_0xbb10('0x2')},'description':{'type':Sequelize[_0xbb10('0x1')]}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index 46e51d5..6de8308 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 _0x008c=['request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','register','sendStatus','status','json','offset','undefined','set','Content-Range','apply','reject','update','then','destroy','name','send','index','map','Team','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','count','includeAll','include','rows','catch','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Teams','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','params','getQueues','findOne','channel','isValidChannel','Sequelize','ValidationError','capitalize','toLowerCase','Queue','rawAttributes','Queues','add','ids','removeQueues','Unknown\x20channel','remove','addAgents','isArray','Mail','Sms','Fax','Openchannel','Whatsapp','sequelize','transaction','Voice','through','penalty','findOrCreate','Queue:save','User','interface','upsert','isNil','format','voicePause','all','UserVoicePrefix','spread','removeAgents','emit','user','Queue:remove','QueueId','UserVoiceQueueRt','TeamVoicePrefix','VoicePrefixId','getAgents','hasOwnProperty','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x34cbda,_0x269ce1){var _0x1213d8=function(_0xcb2a8a){while(--_0xcb2a8a){_0x34cbda['push'](_0x34cbda['shift']());}};_0x1213d8(++_0x269ce1);}(_0x008c,0x188));var _0xc008=function(_0x128239,_0x30a688){_0x128239=_0x128239-0x0;var _0x5543df=_0x008c[_0x128239];return _0x5543df;};'use strict';var emlformat=require(_0xc008('0x0'));var rimraf=require(_0xc008('0x1'));var zipdir=require(_0xc008('0x2'));var jsonpatch=require(_0xc008('0x3'));var rp=require(_0xc008('0x4'));var moment=require('moment');var BPromise=require(_0xc008('0x5'));var Mustache=require(_0xc008('0x6'));var util=require(_0xc008('0x7'));var path=require(_0xc008('0x8'));var sox=require(_0xc008('0x9'));var csv=require(_0xc008('0xa'));var ejs=require(_0xc008('0xb'));var fs=require('fs');var fs_extra=require(_0xc008('0xc'));var _=require(_0xc008('0xd'));var squel=require('squel');var crypto=require(_0xc008('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc008('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc008('0x10'));var Redis=require(_0xc008('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc008('0x12'));var logger=require(_0xc008('0x13'))('api');var utils=require(_0xc008('0x14'));var config=require(_0xc008('0x15'));var licenseUtil=require(_0xc008('0x16'));var db=require(_0xc008('0x17'))['db'];config[_0xc008('0x18')]=_[_0xc008('0x19')](config[_0xc008('0x18')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc008('0x18')]));require('./team.socket')[_0xc008('0x1a')](socket);function respondWithStatusCode(_0x4584e1,_0x2073ef){_0x2073ef=_0x2073ef||0xcc;return function(_0x339ffc){if(_0x339ffc){return _0x4584e1[_0xc008('0x1b')](_0x2073ef);}return _0x4584e1['status'](_0x2073ef)['end']();};}function respondWithResult(_0x4bd0f4,_0x11ef38){_0x11ef38=_0x11ef38||0xc8;return function(_0x15a6ad){if(_0x15a6ad){return _0x4bd0f4[_0xc008('0x1c')](_0x11ef38)[_0xc008('0x1d')](_0x15a6ad);}};}function respondWithFilteredResult(_0x4fe771,_0x53b06e){return function(_0x540e45){if(_0x540e45){var _0x5c2668=typeof _0x53b06e[_0xc008('0x1e')]===_0xc008('0x1f')&&typeof _0x53b06e['limit']===_0xc008('0x1f');var _0x5906e6=_0x540e45['count'];var _0x543e5d=_0x5c2668?0x0:_0x53b06e['offset'];var _0x5754a0=_0x5c2668?_0x540e45['count']:_0x53b06e['offset']+_0x53b06e['limit'];var _0x4a582d;if(_0x5754a0>=_0x5906e6){_0x5754a0=_0x5906e6;_0x4a582d=0xc8;}else{_0x4a582d=0xce;}_0x4fe771['status'](_0x4a582d);return _0x4fe771[_0xc008('0x20')](_0xc008('0x21'),_0x543e5d+'-'+_0x5754a0+'/'+_0x5906e6)[_0xc008('0x1d')](_0x540e45);}return null;};}function patchUpdates(_0x415af3){return function(_0x11cc75){try{jsonpatch[_0xc008('0x22')](_0x11cc75,_0x415af3,!![]);}catch(_0x4f43e2){return BPromise[_0xc008('0x23')](_0x4f43e2);}return _0x11cc75['save']();};}function saveUpdates(_0x58a6ea,_0x218599){return function(_0x36f358){if(_0x36f358){return _0x36f358[_0xc008('0x24')](_0x58a6ea)[_0xc008('0x25')](function(_0x5410f5){return _0x5410f5;});}return null;};}function removeEntity(_0x48582b,_0x5de1e9){return function(_0x3f7b07){if(_0x3f7b07){return _0x3f7b07[_0xc008('0x26')]()[_0xc008('0x25')](function(){var _0x2e31c2=_0x3f7b07['get']({'plain':!![]});var _0x5e2aca='Teams';return db['UserProfileResource']['destroy']({'where':{'type':_0x5e2aca,'resourceId':_0x2e31c2['id']}})[_0xc008('0x25')](function(){return _0x3f7b07;});})[_0xc008('0x25')](function(){_0x48582b[_0xc008('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24c14c,_0x32390d){return function(_0x209591){if(!_0x209591){_0x24c14c[_0xc008('0x1b')](0x194);}return _0x209591;};}function handleError(_0x4c5dec,_0xcdb32b){_0xcdb32b=_0xcdb32b||0x1f4;return function(_0x2e0b4e){logger['error'](_0x2e0b4e['stack']);if(_0x2e0b4e['name']){delete _0x2e0b4e[_0xc008('0x27')];}_0x4c5dec[_0xc008('0x1c')](_0xcdb32b)[_0xc008('0x28')](_0x2e0b4e);};}exports[_0xc008('0x29')]=function(_0x1de04b,_0xceebc3){var _0x294f97={},_0x22d8e8={},_0x1fe1e1={'count':0x0,'rows':[]};var _0x2b862d=_[_0xc008('0x2a')](db[_0xc008('0x2b')]['rawAttributes'],function(_0x334a09){return{'name':_0x334a09[_0xc008('0x2c')],'type':_0x334a09['type'][_0xc008('0x2d')]};});_0x22d8e8[_0xc008('0x2e')]=_[_0xc008('0x2a')](_0x2b862d,_0xc008('0x27'));_0x22d8e8[_0xc008('0x2f')]=_[_0xc008('0x30')](_0x1de04b[_0xc008('0x2f')]);_0x22d8e8[_0xc008('0x31')]=_[_0xc008('0x32')](_0x22d8e8['model'],_0x22d8e8[_0xc008('0x2f')]);_0x294f97[_0xc008('0x33')]=_[_0xc008('0x32')](_0x22d8e8[_0xc008('0x2e')],qs[_0xc008('0x34')](_0x1de04b[_0xc008('0x2f')][_0xc008('0x34')]));_0x294f97['attributes']=_0x294f97[_0xc008('0x33')][_0xc008('0x35')]?_0x294f97['attributes']:_0x22d8e8[_0xc008('0x2e')];if(!_0x1de04b[_0xc008('0x2f')]['hasOwnProperty'](_0xc008('0x36'))){_0x294f97[_0xc008('0x37')]=qs[_0xc008('0x37')](_0x1de04b['query']['limit']);_0x294f97['offset']=qs[_0xc008('0x1e')](_0x1de04b['query'][_0xc008('0x1e')]);}_0x294f97[_0xc008('0x38')]=qs[_0xc008('0x39')](_0x1de04b[_0xc008('0x2f')][_0xc008('0x39')]);_0x294f97[_0xc008('0x3a')]=qs[_0xc008('0x31')](_[_0xc008('0x3b')](_0x1de04b[_0xc008('0x2f')],_0x22d8e8[_0xc008('0x31')]),_0x2b862d);if(_0x1de04b[_0xc008('0x2f')][_0xc008('0x3c')]){_0x294f97[_0xc008('0x3a')]=_[_0xc008('0x3d')](_0x294f97['where'],{'$or':_[_0xc008('0x2a')](_0x2b862d,function(_0x23c4db){if(_0x23c4db[_0xc008('0x3e')]!==_0xc008('0x3f')){var _0x49a16d={};_0x49a16d[_0x23c4db[_0xc008('0x27')]]={'$like':'%'+_0x1de04b[_0xc008('0x2f')][_0xc008('0x3c')]+'%'};return _0x49a16d;}})});}_0x294f97=_[_0xc008('0x3d')]({},_0x294f97,_0x1de04b[_0xc008('0x40')]);var _0x5706bb={'where':_0x294f97[_0xc008('0x3a')]};return db[_0xc008('0x2b')][_0xc008('0x41')](_0x5706bb)[_0xc008('0x25')](function(_0x7279e8){_0x1fe1e1['count']=_0x7279e8;if(_0x1de04b[_0xc008('0x2f')][_0xc008('0x42')]){_0x294f97[_0xc008('0x43')]=[{'all':!![]}];}return db[_0xc008('0x2b')]['findAll'](_0x294f97);})[_0xc008('0x25')](function(_0xe37446){_0x1fe1e1[_0xc008('0x44')]=_0xe37446;return _0x1fe1e1;})['then'](respondWithFilteredResult(_0xceebc3,_0x294f97))[_0xc008('0x45')](handleError(_0xceebc3,null));};exports['show']=function(_0x3dd097,_0x5d3a72){var _0x46fa8f={'raw':![],'where':{'id':_0x3dd097['params']['id']}},_0x213014={};_0x213014[_0xc008('0x2e')]=_[_0xc008('0x30')](db[_0xc008('0x2b')]['rawAttributes']);_0x213014[_0xc008('0x2f')]=_[_0xc008('0x30')](_0x3dd097[_0xc008('0x2f')]);_0x213014[_0xc008('0x31')]=_[_0xc008('0x32')](_0x213014[_0xc008('0x2e')],_0x213014['query']);_0x46fa8f['attributes']=_['intersection'](_0x213014[_0xc008('0x2e')],qs[_0xc008('0x34')](_0x3dd097[_0xc008('0x2f')][_0xc008('0x34')]));_0x46fa8f[_0xc008('0x33')]=_0x46fa8f[_0xc008('0x33')][_0xc008('0x35')]?_0x46fa8f[_0xc008('0x33')]:_0x213014['model'];if(_0x3dd097['query']['includeAll']){_0x46fa8f[_0xc008('0x43')]=[{'all':!![]}];}_0x46fa8f=_[_0xc008('0x3d')]({},_0x46fa8f,_0x3dd097[_0xc008('0x40')]);return db['Team'][_0xc008('0x46')](_0x46fa8f)[_0xc008('0x25')](handleEntityNotFound(_0x5d3a72,null))[_0xc008('0x25')](respondWithResult(_0x5d3a72,null))[_0xc008('0x45')](handleError(_0x5d3a72,null));};exports[_0xc008('0x47')]=function(_0x56e4ac,_0x17ec90){return db[_0xc008('0x2b')][_0xc008('0x47')](_0x56e4ac[_0xc008('0x48')],{})['then'](function(_0x4c63d4){var _0x223056=_0x56e4ac['user'][_0xc008('0x49')]({'plain':!![]});if(!_0x223056)throw new Error(_0xc008('0x4a'));if(_0x223056[_0xc008('0x4b')]==='user'){var _0x144ab2=_0x4c63d4[_0xc008('0x49')]({'plain':!![]});var _0xee64=_0xc008('0x4c');return db[_0xc008('0x4d')]['find']({'where':{'name':_0xee64,'userProfileId':_0x223056[_0xc008('0x4e')]},'raw':!![]})[_0xc008('0x25')](function(_0x4b4c6d){if(_0x4b4c6d&&_0x4b4c6d[_0xc008('0x4f')]===0x0){return db[_0xc008('0x50')]['create']({'name':_0x144ab2['name'],'resourceId':_0x144ab2['id'],'type':_0x4b4c6d[_0xc008('0x27')],'sectionId':_0x4b4c6d['id']},{})[_0xc008('0x25')](function(){return _0x4c63d4;});}else{return _0x4c63d4;}})[_0xc008('0x45')](function(_0x30d0aa){logger[_0xc008('0x51')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x30d0aa);throw _0x30d0aa;});}return _0x4c63d4;})['then'](respondWithResult(_0x17ec90,0xc9))[_0xc008('0x45')](handleError(_0x17ec90,null));};exports['update']=function(_0x3d7cce,_0x25d351){if(_0x3d7cce[_0xc008('0x48')]['id']){delete _0x3d7cce[_0xc008('0x48')]['id'];}return db[_0xc008('0x2b')][_0xc008('0x46')]({'where':{'id':_0x3d7cce['params']['id']}})[_0xc008('0x25')](handleEntityNotFound(_0x25d351,null))[_0xc008('0x25')](saveUpdates(_0x3d7cce[_0xc008('0x48')],null))[_0xc008('0x25')](respondWithResult(_0x25d351,null))[_0xc008('0x45')](handleError(_0x25d351,null));};exports['destroy']=function(_0x41fae3,_0x4fdab4){return db['Team']['find']({'where':{'id':_0x41fae3[_0xc008('0x52')]['id']}})[_0xc008('0x25')](handleEntityNotFound(_0x4fdab4,null))[_0xc008('0x25')](removeEntity(_0x4fdab4,null))['catch'](handleError(_0x4fdab4,null));};exports[_0xc008('0x53')]=function(_0x2d8361,_0x3dda82,_0x47a58b){return db[_0xc008('0x2b')][_0xc008('0x54')]({'where':{'id':_0x2d8361[_0xc008('0x52')]['id']}})[_0xc008('0x25')](handleEntityNotFound(_0x3dda82,null))['then'](function(_0x4022dd){if(!_0x2d8361['query'][_0xc008('0x55')]||!utils[_0xc008('0x56')](_0x2d8361[_0xc008('0x2f')][_0xc008('0x55')])){throw new db[(_0xc008('0x57'))][(_0xc008('0x58'))]('Unknown\x20channel');}var _0x375e71={};var _0x570001={};_0x570001['model']=_[_0xc008('0x30')](db[_[_0xc008('0x59')](_0x2d8361['query'][_0xc008('0x55')][_0xc008('0x5a')]())+_0xc008('0x5b')][_0xc008('0x5c')]);_0x570001[_0xc008('0x2f')]=_[_0xc008('0x30')](_0x2d8361[_0xc008('0x2f')]);_0x570001['filters']=_[_0xc008('0x32')](_0x570001[_0xc008('0x2e')],_0x570001[_0xc008('0x2f')]);_0x375e71[_0xc008('0x33')]=_[_0xc008('0x32')](_0x570001[_0xc008('0x2e')],qs[_0xc008('0x34')](_0x2d8361[_0xc008('0x2f')][_0xc008('0x34')]));_0x375e71[_0xc008('0x33')]=_0x375e71[_0xc008('0x33')][_0xc008('0x35')]?_0x375e71[_0xc008('0x33')]:_0x570001[_0xc008('0x2e')];_0x375e71['limit']=qs[_0xc008('0x37')](_0x2d8361[_0xc008('0x2f')][_0xc008('0x37')]);_0x375e71['offset']=qs[_0xc008('0x1e')](_0x2d8361[_0xc008('0x2f')]['offset']);_0x375e71['order']=qs[_0xc008('0x39')](_0x2d8361[_0xc008('0x2f')][_0xc008('0x39')]);_0x375e71[_0xc008('0x3a')]=qs[_0xc008('0x31')](_[_0xc008('0x3b')](_0x2d8361[_0xc008('0x2f')],_0x570001[_0xc008('0x31')]));_0x375e71=_[_0xc008('0x3d')]({},_0x375e71,_0x2d8361[_0xc008('0x40')]);return _0x4022dd[_0xc008('0x49')+_['capitalize'](_0x2d8361[_0xc008('0x2f')][_0xc008('0x55')][_0xc008('0x5a')]())+_0xc008('0x5d')](_0x375e71);})['then'](respondWithResult(_0x3dda82,null))[_0xc008('0x45')](handleError(_0x3dda82,null));};exports['addQueues']=function(_0x3a1de5,_0x46fa7b,_0x419257){return db['Team'][_0xc008('0x54')]({'where':{'id':_0x3a1de5[_0xc008('0x52')]['id']}})[_0xc008('0x25')](function(_0x553f5c){if(_0x553f5c){if(!_0x3a1de5[_0xc008('0x48')]['channel']||!utils[_0xc008('0x56')](_0x3a1de5[_0xc008('0x48')][_0xc008('0x55')])){throw new db[(_0xc008('0x57'))][(_0xc008('0x58'))]('Unknown\x20channel');}return _0x553f5c[_0xc008('0x5e')+_[_0xc008('0x59')](_0x3a1de5['body'][_0xc008('0x55')]['toLowerCase']())+_0xc008('0x5d')](_0x3a1de5['body'][_0xc008('0x5f')]);}return null;})['then'](handleEntityNotFound(_0x46fa7b,null))[_0xc008('0x25')](respondWithStatusCode(_0x46fa7b,null))[_0xc008('0x45')](handleError(_0x46fa7b,null));};exports[_0xc008('0x60')]=function(_0x47337b,_0x5a94ff,_0x57752c){return db[_0xc008('0x2b')][_0xc008('0x54')]({'where':{'id':_0x47337b[_0xc008('0x52')]['id']}})[_0xc008('0x25')](function(_0x13ef78){if(_0x13ef78){if(!_0x47337b[_0xc008('0x2f')][_0xc008('0x55')]||!utils['isValidChannel'](_0x47337b[_0xc008('0x2f')]['channel'])){throw new db['Sequelize']['ValidationError'](_0xc008('0x61'));}return _0x13ef78[_0xc008('0x62')+_[_0xc008('0x59')](_0x47337b[_0xc008('0x2f')][_0xc008('0x55')][_0xc008('0x5a')]())+_0xc008('0x5d')](_0x47337b[_0xc008('0x2f')][_0xc008('0x5f')]);}return null;})['then'](handleEntityNotFound(_0x5a94ff,null))[_0xc008('0x25')](respondWithStatusCode(_0x5a94ff,null))[_0xc008('0x45')](handleError(_0x5a94ff,null));};exports[_0xc008('0x63')]=function(_0x15fe9b,_0xc9f3f4){var _0x3b2669=_[_0xc008('0x64')](_0x15fe9b[_0xc008('0x48')][_0xc008('0x5f')])?_0x15fe9b[_0xc008('0x48')][_0xc008('0x5f')]:[_0x15fe9b[_0xc008('0x48')]['ids']];var _0x4e7af3=_0x15fe9b[_0xc008('0x52')]['id'];return db[_0xc008('0x2b')][_0xc008('0x46')]({'where':{'id':_0x4e7af3}})['then'](handleEntityNotFound(_0xc9f3f4,null))[_0xc008('0x25')](function(_0x312fa9){if(_0x312fa9){var _0x4ed54b=['Voice','Chat',_0xc008('0x65'),_0xc008('0x66'),_0xc008('0x67'),_0xc008('0x68'),_0xc008('0x69')];return db[_0xc008('0x6a')][_0xc008('0x6b')](function(_0x43ba59){var _0x1161e6=_[_0xc008('0x2a')](_0x4ed54b,function(_0x52091b){var _0x57b8ad={'attributes':['id',_0xc008('0x27')]};if(_0x52091b===_0xc008('0x6c')){_0x57b8ad[_0xc008('0x6d')]={'attributes':[_0xc008('0x6e')]};}return _0x312fa9[_0xc008('0x49')+_0x52091b+_0xc008('0x5d')](_0x57b8ad)['then'](function(_0x5794fe){var _0x68372f=_[_0xc008('0x2a')](_0x5794fe,function(_0x33e130){var _0x558105=_['map'](_0x3b2669,function(_0x5df713){var _0x505061={'where':{'UserId':_0x5df713,[_0x52091b+'QueueId']:_0x33e130['id']},'transaction':_0x43ba59};if(_0x52091b==='Voice'){_0x505061[_0xc008('0x19')]={'penalty':_0x33e130['TeamVoiceQueue'][_0xc008('0x6e')]};}return db['User'+_0x52091b+_0xc008('0x5b')][_0xc008('0x6f')](_0x505061)[_0xc008('0x25')](function(){socket['emit']('user'+_0x52091b+_0xc008('0x70'),{'UserId':_0x5df713,[_0x52091b+'QueueId']:_0x33e130['id']});if(_0x52091b!==_0xc008('0x6c')){return;}return db[_0xc008('0x71')]['findAll']({'where':{'id':_0x3b2669,'online':0x1},'attributes':['id',_0xc008('0x27'),'online','voicePause',_0xc008('0x72')],'raw':!![]})[_0xc008('0x25')](function(_0x48de26){var _0x37d382=_[_0xc008('0x2a')](_0x48de26,function(_0x39ccf2){return db['UserVoiceQueueRt'][_0xc008('0x73')]({'membername':_0x39ccf2[_0xc008('0x27')],'UserId':_0x39ccf2['id'],'queue_name':_0x33e130[_0xc008('0x27')],'VoiceQueueId':_0x33e130['id'],'interface':_[_0xc008('0x74')](_0x39ccf2[_0xc008('0x72')])?util[_0xc008('0x75')]('SIP/%s',_0x39ccf2[_0xc008('0x27')]):_0x39ccf2[_0xc008('0x72')],'paused':_0x39ccf2[_0xc008('0x76')]||![],'penalty':_0x33e130['TeamVoiceQueue'][_0xc008('0x6e')]},{'transaction':_0x43ba59});});return Promise[_0xc008('0x77')](_0x37d382);});});});return Promise[_0xc008('0x77')](_0x558105);});return Promise['all'](_0x68372f);})['then'](function(){return db['TeamVoicePrefix'][_0xc008('0x54')]({'where':{'teamId':_0x4e7af3}})[_0xc008('0x25')](function(_0x91ecdf){if(_0x91ecdf){var _0x3c5da1=_[_0xc008('0x2a')](_0x3b2669,function(_0xac0fc7){db[_0xc008('0x78')][_0xc008('0x73')]({'UserId':_0xac0fc7,'VoicePrefixId':_0x91ecdf['VoicePrefixId']});});return Promise[_0xc008('0x77')](_0x3c5da1);}});});});return Promise[_0xc008('0x77')](_0x1161e6)['then'](function(){return _0x312fa9['addAgents'](_0x3b2669,{'transaction':_0x43ba59})[_0xc008('0x79')](function(_0x128123){return _0x128123;});});});}})[_0xc008('0x25')](respondWithResult(_0xc9f3f4,null))[_0xc008('0x45')](handleError(_0xc9f3f4,null));};exports[_0xc008('0x7a')]=function(_0x49e822,_0xe988da){var _0x1515bb=_['isArray'](_0x49e822[_0xc008('0x2f')][_0xc008('0x5f')])?_0x49e822[_0xc008('0x2f')][_0xc008('0x5f')]:[_0x49e822['query'][_0xc008('0x5f')]];var _0x2d42e0=_0x49e822[_0xc008('0x52')]['id'];return db[_0xc008('0x2b')]['find']({'where':{'id':_0x2d42e0}})[_0xc008('0x25')](handleEntityNotFound(_0xe988da,null))[_0xc008('0x25')](function(_0x57cf19){if(_0x57cf19){var _0x555e8a=[_0xc008('0x6c'),'Chat',_0xc008('0x65'),_0xc008('0x66'),'Fax',_0xc008('0x68'),_0xc008('0x69')];return db[_0xc008('0x6a')][_0xc008('0x6b')](function(_0x3c335f){var _0x1cbd0c=_[_0xc008('0x2a')](_0x555e8a,function(_0x2b2bfb){var _0x357043={'attributes':['id',_0xc008('0x27')]};return _0x57cf19['get'+_0x2b2bfb+'Queues'](_0x357043)[_0xc008('0x25')](function(_0x3d6f70){var _0x4d07d2=_[_0xc008('0x2a')](_0x3d6f70,function(_0x1bdaa9){return _0x1bdaa9[_0xc008('0x7a')](_0x1515bb,{'transaction':_0x3c335f})['then'](function(){var _0x303cdd=_[_0xc008('0x2a')](_0x1515bb,function(_0x399661){socket[_0xc008('0x7b')](_0xc008('0x7c')+_0x2b2bfb+_0xc008('0x7d'),{'UserId':Number(_0x399661),[_0x2b2bfb+_0xc008('0x7e')]:_0x1bdaa9['id']});if(_0x2b2bfb!=='Voice'){return;}return db[_0xc008('0x7f')]['destroy']({'where':{'VoiceQueueId':_0x1bdaa9['id'],'UserId':_0x399661},'transaction':_0x3c335f});});return Promise[_0xc008('0x77')](_0x303cdd);});});return Promise[_0xc008('0x77')](_0x4d07d2);});});return Promise[_0xc008('0x77')](_0x1cbd0c)['then'](function(){return _0x57cf19[_0xc008('0x7a')](_0x1515bb,{'transaction':_0x3c335f});})[_0xc008('0x25')](function(){return db[_0xc008('0x80')][_0xc008('0x54')]({'where':{'teamId':_0x2d42e0}})[_0xc008('0x25')](function(_0x729d48){if(_0x729d48){var _0x872247=_[_0xc008('0x2a')](_0x1515bb,function(_0x475678){db[_0xc008('0x78')]['destroy']({'where':{'UserId':_0x475678,'VoicePrefixId':_0x729d48[_0xc008('0x81')]}});});return Promise[_0xc008('0x77')](_0x872247);}});});});}})[_0xc008('0x25')](respondWithStatusCode(_0xe988da,null))[_0xc008('0x45')](handleError(_0xe988da,null));};exports[_0xc008('0x82')]=function(_0x5d7db6,_0x37da13,_0x3dd13f){var _0x36a581={};var _0x2e5494={};var _0x204692;var _0x2503d2;return db[_0xc008('0x2b')][_0xc008('0x54')]({'where':{'id':_0x5d7db6[_0xc008('0x52')]['id']}})[_0xc008('0x25')](handleEntityNotFound(_0x37da13,null))[_0xc008('0x25')](function(_0x27e3fc){if(_0x27e3fc){_0x204692=_0x27e3fc;_0x2e5494[_0xc008('0x2e')]=_[_0xc008('0x30')](db[_0xc008('0x71')]['rawAttributes']);_0x2e5494['query']=_[_0xc008('0x30')](_0x5d7db6[_0xc008('0x2f')]);_0x2e5494[_0xc008('0x31')]=_[_0xc008('0x32')](_0x2e5494[_0xc008('0x2e')],_0x2e5494[_0xc008('0x2f')]);_0x36a581[_0xc008('0x33')]=_[_0xc008('0x32')](_0x2e5494[_0xc008('0x2e')],qs['fields'](_0x5d7db6[_0xc008('0x2f')][_0xc008('0x34')]));_0x36a581['attributes']=_0x36a581[_0xc008('0x33')][_0xc008('0x35')]?_0x36a581[_0xc008('0x33')]:_0x2e5494[_0xc008('0x2e')];_0x36a581[_0xc008('0x38')]=qs[_0xc008('0x39')](_0x5d7db6['query'][_0xc008('0x39')]);_0x36a581[_0xc008('0x3a')]=qs[_0xc008('0x31')](_[_0xc008('0x3b')](_0x5d7db6['query'],_0x2e5494[_0xc008('0x31')]));if(_0x5d7db6['query'][_0xc008('0x3c')]){_0x36a581[_0xc008('0x3a')]=_['merge'](_0x36a581[_0xc008('0x3a')],{'$or':_['map'](_0x36a581[_0xc008('0x33')],function(_0x4cb7d7){var _0x5b387d={};_0x5b387d[_0x4cb7d7]={'$like':'%'+_0x5d7db6['query'][_0xc008('0x3c')]+'%'};return _0x5b387d;})});}_0x36a581=_[_0xc008('0x3d')]({},_0x36a581,_0x5d7db6['options']);return _0x204692[_0xc008('0x82')](_0x36a581);}})[_0xc008('0x25')](function(_0x4a7692){if(_0x4a7692){_0x2503d2=_0x4a7692[_0xc008('0x35')];if(!_0x5d7db6[_0xc008('0x2f')][_0xc008('0x83')]('nolimit')){_0x36a581[_0xc008('0x37')]=qs[_0xc008('0x37')](_0x5d7db6[_0xc008('0x2f')][_0xc008('0x37')]);_0x36a581[_0xc008('0x1e')]=qs[_0xc008('0x1e')](_0x5d7db6[_0xc008('0x2f')][_0xc008('0x1e')]);}return _0x204692[_0xc008('0x82')](_0x36a581);}})[_0xc008('0x25')](function(_0x427fd2){if(_0x427fd2){return _0x427fd2?{'count':_0x2503d2,'rows':_0x427fd2}:null;}})['then'](respondWithResult(_0x37da13,null))[_0xc008('0x45')](handleError(_0x37da13,null));}; \ No newline at end of file +var _0x34e8=['QueueId','online','interface','UserVoiceQueueRt','upsert','format','SIP/%s','voicePause','all','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','spread','removeAgents','Mail','transaction','Queue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./team.socket','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','get','Teams','UserProfileResource','error','stack','name','send','map','Team','rawAttributes','fieldName','type','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','pick','where','merge','filter','then','includeAll','rows','show','params','keys','length','include','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getQueues','findOne','channel','isValidChannel','Sequelize','ValidationError','Unknown\x20channel','capitalize','toLowerCase','Queue','addQueues','add','remove','Queues','ids','addAgents','isArray','Chat','Sms','Fax','Openchannel','sequelize','Voice','through','penalty','TeamVoiceQueue','User','findOrCreate','emit','Queue:save'];(function(_0x56d78c,_0x2b65d6){var _0x9a8155=function(_0x3cb3ad){while(--_0x3cb3ad){_0x56d78c['push'](_0x56d78c['shift']());}};_0x9a8155(++_0x2b65d6);}(_0x34e8,0x12c));var _0x834e=function(_0x172d7b,_0x222a05){_0x172d7b=_0x172d7b-0x0;var _0x30ee7e=_0x34e8[_0x172d7b];return _0x30ee7e;};'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'];config[_0x834e('0x1c')]=_[_0x834e('0x1d')](config['redis'],{'host':_0x834e('0x1e'),'port':0x18eb});var socket=require(_0x834e('0x1f'))(new Redis(config[_0x834e('0x1c')]));require(_0x834e('0x20'))['register'](socket);function respondWithStatusCode(_0x43156c,_0x302cbd){_0x302cbd=_0x302cbd||0xcc;return function(_0x57274a){if(_0x57274a){return _0x43156c[_0x834e('0x21')](_0x302cbd);}return _0x43156c['status'](_0x302cbd)[_0x834e('0x22')]();};}function respondWithResult(_0x36d443,_0x478afe){_0x478afe=_0x478afe||0xc8;return function(_0x43ac41){if(_0x43ac41){return _0x36d443[_0x834e('0x23')](_0x478afe)[_0x834e('0x24')](_0x43ac41);}};}function respondWithFilteredResult(_0x50b3f6,_0x283e56){return function(_0x211e9a){if(_0x211e9a){var _0x34e41a=typeof _0x283e56[_0x834e('0x25')]===_0x834e('0x26')&&typeof _0x283e56[_0x834e('0x27')]===_0x834e('0x26');var _0x595515=_0x211e9a[_0x834e('0x28')];var _0x1fd2c6=_0x34e41a?0x0:_0x283e56[_0x834e('0x25')];var _0x325a99=_0x34e41a?_0x211e9a['count']:_0x283e56[_0x834e('0x25')]+_0x283e56[_0x834e('0x27')];var _0x5a05c0;if(_0x325a99>=_0x595515){_0x325a99=_0x595515;_0x5a05c0=0xc8;}else{_0x5a05c0=0xce;}_0x50b3f6[_0x834e('0x23')](_0x5a05c0);return _0x50b3f6[_0x834e('0x29')](_0x834e('0x2a'),_0x1fd2c6+'-'+_0x325a99+'/'+_0x595515)['json'](_0x211e9a);}return null;};}function patchUpdates(_0x4e3f48){return function(_0x231619){try{jsonpatch[_0x834e('0x2b')](_0x231619,_0x4e3f48,!![]);}catch(_0x589dde){return BPromise[_0x834e('0x2c')](_0x589dde);}return _0x231619[_0x834e('0x2d')]();};}function saveUpdates(_0x58f4fd,_0x3bc4f7){return function(_0x2e1983){if(_0x2e1983){return _0x2e1983[_0x834e('0x2e')](_0x58f4fd)['then'](function(_0x24fcf7){return _0x24fcf7;});}return null;};}function removeEntity(_0x3e310f,_0x5e1cc5){return function(_0x5bef62){if(_0x5bef62){return _0x5bef62[_0x834e('0x2f')]()['then'](function(){var _0x2826ec=_0x5bef62[_0x834e('0x30')]({'plain':!![]});var _0x3db026=_0x834e('0x31');return db[_0x834e('0x32')][_0x834e('0x2f')]({'where':{'type':_0x3db026,'resourceId':_0x2826ec['id']}})['then'](function(){return _0x5bef62;});})['then'](function(){_0x3e310f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c7a8d,_0x567cea){return function(_0x106d6a){if(!_0x106d6a){_0x2c7a8d['sendStatus'](0x194);}return _0x106d6a;};}function handleError(_0xb5bc06,_0x11f1ce){_0x11f1ce=_0x11f1ce||0x1f4;return function(_0x1f3671){logger[_0x834e('0x33')](_0x1f3671[_0x834e('0x34')]);if(_0x1f3671[_0x834e('0x35')]){delete _0x1f3671[_0x834e('0x35')];}_0xb5bc06[_0x834e('0x23')](_0x11f1ce)[_0x834e('0x36')](_0x1f3671);};}exports['index']=function(_0xef9ec2,_0x5cad11){var _0x2c75c2={},_0x3787b0={},_0x9ab921={'count':0x0,'rows':[]};var _0x2b3418=_[_0x834e('0x37')](db[_0x834e('0x38')][_0x834e('0x39')],function(_0x38cd29){return{'name':_0x38cd29[_0x834e('0x3a')],'type':_0x38cd29[_0x834e('0x3b')]['key']};});_0x3787b0[_0x834e('0x3c')]=_[_0x834e('0x37')](_0x2b3418,_0x834e('0x35'));_0x3787b0[_0x834e('0x3d')]=_['keys'](_0xef9ec2[_0x834e('0x3d')]);_0x3787b0[_0x834e('0x3e')]=_['intersection'](_0x3787b0['model'],_0x3787b0['query']);_0x2c75c2[_0x834e('0x3f')]=_[_0x834e('0x40')](_0x3787b0[_0x834e('0x3c')],qs[_0x834e('0x41')](_0xef9ec2[_0x834e('0x3d')][_0x834e('0x41')]));_0x2c75c2['attributes']=_0x2c75c2[_0x834e('0x3f')]['length']?_0x2c75c2[_0x834e('0x3f')]:_0x3787b0[_0x834e('0x3c')];if(!_0xef9ec2['query'][_0x834e('0x42')](_0x834e('0x43'))){_0x2c75c2['limit']=qs['limit'](_0xef9ec2[_0x834e('0x3d')][_0x834e('0x27')]);_0x2c75c2[_0x834e('0x25')]=qs[_0x834e('0x25')](_0xef9ec2[_0x834e('0x3d')]['offset']);}_0x2c75c2[_0x834e('0x44')]=qs['sort'](_0xef9ec2['query'][_0x834e('0x45')]);_0x2c75c2['where']=qs[_0x834e('0x3e')](_[_0x834e('0x46')](_0xef9ec2[_0x834e('0x3d')],_0x3787b0[_0x834e('0x3e')]),_0x2b3418);if(_0xef9ec2[_0x834e('0x3d')]['filter']){_0x2c75c2[_0x834e('0x47')]=_[_0x834e('0x48')](_0x2c75c2[_0x834e('0x47')],{'$or':_['map'](_0x2b3418,function(_0x35380e){if(_0x35380e[_0x834e('0x3b')]!=='VIRTUAL'){var _0x1e3e71={};_0x1e3e71[_0x35380e['name']]={'$like':'%'+_0xef9ec2[_0x834e('0x3d')][_0x834e('0x49')]+'%'};return _0x1e3e71;}})});}_0x2c75c2=_['merge']({},_0x2c75c2,_0xef9ec2['options']);var _0x22ea21={'where':_0x2c75c2[_0x834e('0x47')]};return db[_0x834e('0x38')][_0x834e('0x28')](_0x22ea21)[_0x834e('0x4a')](function(_0x23feea){_0x9ab921[_0x834e('0x28')]=_0x23feea;if(_0xef9ec2['query'][_0x834e('0x4b')]){_0x2c75c2['include']=[{'all':!![]}];}return db[_0x834e('0x38')]['findAll'](_0x2c75c2);})[_0x834e('0x4a')](function(_0x5a5807){_0x9ab921[_0x834e('0x4c')]=_0x5a5807;return _0x9ab921;})[_0x834e('0x4a')](respondWithFilteredResult(_0x5cad11,_0x2c75c2))['catch'](handleError(_0x5cad11,null));};exports[_0x834e('0x4d')]=function(_0x3f2321,_0xa880cb){var _0xd55cc3={'raw':![],'where':{'id':_0x3f2321[_0x834e('0x4e')]['id']}},_0x252ea0={};_0x252ea0[_0x834e('0x3c')]=_[_0x834e('0x4f')](db[_0x834e('0x38')][_0x834e('0x39')]);_0x252ea0['query']=_[_0x834e('0x4f')](_0x3f2321[_0x834e('0x3d')]);_0x252ea0['filters']=_[_0x834e('0x40')](_0x252ea0[_0x834e('0x3c')],_0x252ea0[_0x834e('0x3d')]);_0xd55cc3[_0x834e('0x3f')]=_[_0x834e('0x40')](_0x252ea0[_0x834e('0x3c')],qs['fields'](_0x3f2321['query'][_0x834e('0x41')]));_0xd55cc3[_0x834e('0x3f')]=_0xd55cc3[_0x834e('0x3f')][_0x834e('0x50')]?_0xd55cc3[_0x834e('0x3f')]:_0x252ea0[_0x834e('0x3c')];if(_0x3f2321[_0x834e('0x3d')][_0x834e('0x4b')]){_0xd55cc3[_0x834e('0x51')]=[{'all':!![]}];}_0xd55cc3=_[_0x834e('0x48')]({},_0xd55cc3,_0x3f2321[_0x834e('0x52')]);return db[_0x834e('0x38')][_0x834e('0x53')](_0xd55cc3)[_0x834e('0x4a')](handleEntityNotFound(_0xa880cb,null))[_0x834e('0x4a')](respondWithResult(_0xa880cb,null))[_0x834e('0x54')](handleError(_0xa880cb,null));};exports[_0x834e('0x55')]=function(_0x32b8f7,_0x420841){return db[_0x834e('0x38')]['create'](_0x32b8f7[_0x834e('0x56')],{})[_0x834e('0x4a')](function(_0x4e73e0){var _0x3c00a3=_0x32b8f7[_0x834e('0x57')]['get']({'plain':!![]});if(!_0x3c00a3)throw new Error(_0x834e('0x58'));if(_0x3c00a3[_0x834e('0x59')]===_0x834e('0x57')){var _0x35636e=_0x4e73e0[_0x834e('0x30')]({'plain':!![]});var _0xb77aab=_0x834e('0x31');return db['UserProfileSection'][_0x834e('0x53')]({'where':{'name':_0xb77aab,'userProfileId':_0x3c00a3[_0x834e('0x5a')]},'raw':!![]})[_0x834e('0x4a')](function(_0x363675){if(_0x363675&&_0x363675[_0x834e('0x5b')]===0x0){return db[_0x834e('0x32')][_0x834e('0x55')]({'name':_0x35636e[_0x834e('0x35')],'resourceId':_0x35636e['id'],'type':_0x363675['name'],'sectionId':_0x363675['id']},{})[_0x834e('0x4a')](function(){return _0x4e73e0;});}else{return _0x4e73e0;}})['catch'](function(_0x2f4bde){logger['error'](_0x834e('0x5c'),_0x2f4bde);throw _0x2f4bde;});}return _0x4e73e0;})['then'](respondWithResult(_0x420841,0xc9))['catch'](handleError(_0x420841,null));};exports[_0x834e('0x2e')]=function(_0x3e1bee,_0x5291ae){if(_0x3e1bee['body']['id']){delete _0x3e1bee[_0x834e('0x56')]['id'];}return db[_0x834e('0x38')][_0x834e('0x53')]({'where':{'id':_0x3e1bee[_0x834e('0x4e')]['id']}})[_0x834e('0x4a')](handleEntityNotFound(_0x5291ae,null))[_0x834e('0x4a')](saveUpdates(_0x3e1bee[_0x834e('0x56')],null))[_0x834e('0x4a')](respondWithResult(_0x5291ae,null))['catch'](handleError(_0x5291ae,null));};exports[_0x834e('0x2f')]=function(_0x3c70bf,_0x5d5ac2){return db[_0x834e('0x38')]['find']({'where':{'id':_0x3c70bf[_0x834e('0x4e')]['id']}})[_0x834e('0x4a')](handleEntityNotFound(_0x5d5ac2,null))['then'](removeEntity(_0x5d5ac2,null))[_0x834e('0x54')](handleError(_0x5d5ac2,null));};exports[_0x834e('0x5d')]=function(_0x2de29a,_0x25f720,_0x5a2924){return db[_0x834e('0x38')][_0x834e('0x5e')]({'where':{'id':_0x2de29a[_0x834e('0x4e')]['id']}})['then'](handleEntityNotFound(_0x25f720,null))[_0x834e('0x4a')](function(_0x1fcae9){if(!_0x2de29a[_0x834e('0x3d')][_0x834e('0x5f')]||!utils[_0x834e('0x60')](_0x2de29a[_0x834e('0x3d')][_0x834e('0x5f')])){throw new db[(_0x834e('0x61'))][(_0x834e('0x62'))](_0x834e('0x63'));}var _0x1e4310={};var _0x1dfa95={};_0x1dfa95[_0x834e('0x3c')]=_[_0x834e('0x4f')](db[_[_0x834e('0x64')](_0x2de29a[_0x834e('0x3d')][_0x834e('0x5f')][_0x834e('0x65')]())+_0x834e('0x66')][_0x834e('0x39')]);_0x1dfa95[_0x834e('0x3d')]=_[_0x834e('0x4f')](_0x2de29a['query']);_0x1dfa95[_0x834e('0x3e')]=_[_0x834e('0x40')](_0x1dfa95[_0x834e('0x3c')],_0x1dfa95[_0x834e('0x3d')]);_0x1e4310['attributes']=_[_0x834e('0x40')](_0x1dfa95['model'],qs['fields'](_0x2de29a[_0x834e('0x3d')][_0x834e('0x41')]));_0x1e4310[_0x834e('0x3f')]=_0x1e4310[_0x834e('0x3f')][_0x834e('0x50')]?_0x1e4310[_0x834e('0x3f')]:_0x1dfa95[_0x834e('0x3c')];_0x1e4310[_0x834e('0x27')]=qs['limit'](_0x2de29a[_0x834e('0x3d')]['limit']);_0x1e4310[_0x834e('0x25')]=qs[_0x834e('0x25')](_0x2de29a['query']['offset']);_0x1e4310[_0x834e('0x44')]=qs[_0x834e('0x45')](_0x2de29a[_0x834e('0x3d')][_0x834e('0x45')]);_0x1e4310[_0x834e('0x47')]=qs['filters'](_[_0x834e('0x46')](_0x2de29a[_0x834e('0x3d')],_0x1dfa95[_0x834e('0x3e')]));_0x1e4310=_[_0x834e('0x48')]({},_0x1e4310,_0x2de29a[_0x834e('0x52')]);return _0x1fcae9[_0x834e('0x30')+_[_0x834e('0x64')](_0x2de29a[_0x834e('0x3d')][_0x834e('0x5f')][_0x834e('0x65')]())+'Queues'](_0x1e4310);})[_0x834e('0x4a')](respondWithResult(_0x25f720,null))[_0x834e('0x54')](handleError(_0x25f720,null));};exports[_0x834e('0x67')]=function(_0x5b5d6f,_0x51cfab,_0x46fa0d){return db['Team']['findOne']({'where':{'id':_0x5b5d6f['params']['id']}})[_0x834e('0x4a')](function(_0x332d8f){if(_0x332d8f){if(!_0x5b5d6f['body'][_0x834e('0x5f')]||!utils[_0x834e('0x60')](_0x5b5d6f['body'][_0x834e('0x5f')])){throw new db[(_0x834e('0x61'))]['ValidationError']('Unknown\x20channel');}return _0x332d8f[_0x834e('0x68')+_[_0x834e('0x64')](_0x5b5d6f[_0x834e('0x56')][_0x834e('0x5f')][_0x834e('0x65')]())+'Queues'](_0x5b5d6f[_0x834e('0x56')]['ids']);}return null;})[_0x834e('0x4a')](handleEntityNotFound(_0x51cfab,null))[_0x834e('0x4a')](respondWithStatusCode(_0x51cfab,null))[_0x834e('0x54')](handleError(_0x51cfab,null));};exports['removeQueues']=function(_0x33a3cd,_0x11f6f0,_0x48521f){return db[_0x834e('0x38')][_0x834e('0x5e')]({'where':{'id':_0x33a3cd[_0x834e('0x4e')]['id']}})['then'](function(_0x214014){if(_0x214014){if(!_0x33a3cd[_0x834e('0x3d')][_0x834e('0x5f')]||!utils[_0x834e('0x60')](_0x33a3cd[_0x834e('0x3d')][_0x834e('0x5f')])){throw new db[(_0x834e('0x61'))][(_0x834e('0x62'))](_0x834e('0x63'));}return _0x214014[_0x834e('0x69')+_['capitalize'](_0x33a3cd['query']['channel'][_0x834e('0x65')]())+_0x834e('0x6a')](_0x33a3cd[_0x834e('0x3d')][_0x834e('0x6b')]);}return null;})[_0x834e('0x4a')](handleEntityNotFound(_0x11f6f0,null))['then'](respondWithStatusCode(_0x11f6f0,null))['catch'](handleError(_0x11f6f0,null));};exports[_0x834e('0x6c')]=function(_0x1ad428,_0x23ad7c){var _0x18ddac=_[_0x834e('0x6d')](_0x1ad428['body'][_0x834e('0x6b')])?_0x1ad428[_0x834e('0x56')][_0x834e('0x6b')]:[_0x1ad428['body'][_0x834e('0x6b')]];var _0x18fde1=_0x1ad428[_0x834e('0x4e')]['id'];return db[_0x834e('0x38')][_0x834e('0x53')]({'where':{'id':_0x18fde1}})['then'](handleEntityNotFound(_0x23ad7c,null))['then'](function(_0x227797){if(_0x227797){var _0x40a872=['Voice',_0x834e('0x6e'),'Mail',_0x834e('0x6f'),_0x834e('0x70'),_0x834e('0x71'),'Whatsapp'];return db[_0x834e('0x72')]['transaction'](function(_0x5b2621){var _0x4d599d=_[_0x834e('0x37')](_0x40a872,function(_0x4627ac){var _0x1d7bab={'attributes':['id',_0x834e('0x35')]};if(_0x4627ac===_0x834e('0x73')){_0x1d7bab[_0x834e('0x74')]={'attributes':[_0x834e('0x75')]};}return _0x227797[_0x834e('0x30')+_0x4627ac+_0x834e('0x6a')](_0x1d7bab)['then'](function(_0x2f775a){var _0x54e70d=_[_0x834e('0x37')](_0x2f775a,function(_0x97c1a6){var _0x38bfa4=_[_0x834e('0x37')](_0x18ddac,function(_0x1d1877){var _0x116830={'where':{'UserId':_0x1d1877,[_0x4627ac+'QueueId']:_0x97c1a6['id']},'transaction':_0x5b2621};if(_0x4627ac==='Voice'){_0x116830[_0x834e('0x1d')]={'penalty':_0x97c1a6[_0x834e('0x76')]['penalty']};}return db[_0x834e('0x77')+_0x4627ac+_0x834e('0x66')][_0x834e('0x78')](_0x116830)[_0x834e('0x4a')](function(){socket[_0x834e('0x79')]('user'+_0x4627ac+_0x834e('0x7a'),{'UserId':_0x1d1877,[_0x4627ac+_0x834e('0x7b')]:_0x97c1a6['id']});if(_0x4627ac!=='Voice'){return;}return db['User']['findAll']({'where':{'id':_0x18ddac,'online':0x1},'attributes':['id',_0x834e('0x35'),_0x834e('0x7c'),'voicePause',_0x834e('0x7d')],'raw':!![]})[_0x834e('0x4a')](function(_0x49b480){var _0xfb93b1=_['map'](_0x49b480,function(_0x4813a8){return db[_0x834e('0x7e')][_0x834e('0x7f')]({'membername':_0x4813a8[_0x834e('0x35')],'UserId':_0x4813a8['id'],'queue_name':_0x97c1a6[_0x834e('0x35')],'VoiceQueueId':_0x97c1a6['id'],'interface':_['isNil'](_0x4813a8[_0x834e('0x7d')])?util[_0x834e('0x80')](_0x834e('0x81'),_0x4813a8[_0x834e('0x35')]):_0x4813a8[_0x834e('0x7d')],'paused':_0x4813a8[_0x834e('0x82')]||![],'penalty':_0x97c1a6[_0x834e('0x76')][_0x834e('0x75')]},{'transaction':_0x5b2621});});return Promise[_0x834e('0x83')](_0xfb93b1);});});});return Promise[_0x834e('0x83')](_0x38bfa4);});return Promise[_0x834e('0x83')](_0x54e70d);})[_0x834e('0x4a')](function(){return db[_0x834e('0x84')][_0x834e('0x5e')]({'where':{'teamId':_0x18fde1}})[_0x834e('0x4a')](function(_0x35bb19){if(_0x35bb19){var _0x3453c7=_[_0x834e('0x37')](_0x18ddac,function(_0x2db7b7){db[_0x834e('0x85')][_0x834e('0x7f')]({'UserId':_0x2db7b7,'VoicePrefixId':_0x35bb19[_0x834e('0x86')]});});return Promise['all'](_0x3453c7);}});});});return Promise[_0x834e('0x83')](_0x4d599d)[_0x834e('0x4a')](function(){return _0x227797[_0x834e('0x6c')](_0x18ddac,{'transaction':_0x5b2621})[_0x834e('0x87')](function(_0x14b603){return _0x14b603;});});});}})[_0x834e('0x4a')](respondWithResult(_0x23ad7c,null))[_0x834e('0x54')](handleError(_0x23ad7c,null));};exports[_0x834e('0x88')]=function(_0x11ca03,_0x4d226b){var _0x5ce790=_['isArray'](_0x11ca03[_0x834e('0x3d')]['ids'])?_0x11ca03[_0x834e('0x3d')][_0x834e('0x6b')]:[_0x11ca03[_0x834e('0x3d')]['ids']];var _0xae00f=_0x11ca03[_0x834e('0x4e')]['id'];return db[_0x834e('0x38')][_0x834e('0x53')]({'where':{'id':_0xae00f}})[_0x834e('0x4a')](handleEntityNotFound(_0x4d226b,null))[_0x834e('0x4a')](function(_0x528052){if(_0x528052){var _0x10dd7b=[_0x834e('0x73'),_0x834e('0x6e'),_0x834e('0x89'),_0x834e('0x6f'),'Fax','Openchannel','Whatsapp'];return db['sequelize'][_0x834e('0x8a')](function(_0x2ccdde){var _0x56fc05=_[_0x834e('0x37')](_0x10dd7b,function(_0xf9fec9){var _0x4fb709={'attributes':['id',_0x834e('0x35')]};return _0x528052[_0x834e('0x30')+_0xf9fec9+_0x834e('0x6a')](_0x4fb709)[_0x834e('0x4a')](function(_0x1d1075){var _0x404bab=_['map'](_0x1d1075,function(_0x5a49fc){return _0x5a49fc[_0x834e('0x88')](_0x5ce790,{'transaction':_0x2ccdde})[_0x834e('0x4a')](function(){var _0x1d2e12=_['map'](_0x5ce790,function(_0x34fb30){socket[_0x834e('0x79')]('user'+_0xf9fec9+_0x834e('0x8b'),{'UserId':Number(_0x34fb30),[_0xf9fec9+_0x834e('0x7b')]:_0x5a49fc['id']});if(_0xf9fec9!==_0x834e('0x73')){return;}return db[_0x834e('0x7e')]['destroy']({'where':{'VoiceQueueId':_0x5a49fc['id'],'UserId':_0x34fb30},'transaction':_0x2ccdde});});return Promise[_0x834e('0x83')](_0x1d2e12);});});return Promise['all'](_0x404bab);});});return Promise['all'](_0x56fc05)[_0x834e('0x4a')](function(){return _0x528052[_0x834e('0x88')](_0x5ce790,{'transaction':_0x2ccdde});})[_0x834e('0x4a')](function(){return db[_0x834e('0x84')][_0x834e('0x5e')]({'where':{'teamId':_0xae00f}})[_0x834e('0x4a')](function(_0x5bceba){if(_0x5bceba){var _0x591fab=_[_0x834e('0x37')](_0x5ce790,function(_0x2e040e){db[_0x834e('0x85')][_0x834e('0x2f')]({'where':{'UserId':_0x2e040e,'VoicePrefixId':_0x5bceba[_0x834e('0x86')]}});});return Promise[_0x834e('0x83')](_0x591fab);}});});});}})[_0x834e('0x4a')](respondWithStatusCode(_0x4d226b,null))['catch'](handleError(_0x4d226b,null));};exports[_0x834e('0x8c')]=function(_0xf25875,_0x56f28b,_0x4278ab){var _0x6a507a={};var _0xa0af07={};var _0x2a3ca4;var _0x284a75;return db[_0x834e('0x38')][_0x834e('0x5e')]({'where':{'id':_0xf25875[_0x834e('0x4e')]['id']}})[_0x834e('0x4a')](handleEntityNotFound(_0x56f28b,null))[_0x834e('0x4a')](function(_0x496709){if(_0x496709){_0x2a3ca4=_0x496709;_0xa0af07[_0x834e('0x3c')]=_[_0x834e('0x4f')](db[_0x834e('0x77')]['rawAttributes']);_0xa0af07[_0x834e('0x3d')]=_[_0x834e('0x4f')](_0xf25875['query']);_0xa0af07[_0x834e('0x3e')]=_['intersection'](_0xa0af07[_0x834e('0x3c')],_0xa0af07['query']);_0x6a507a[_0x834e('0x3f')]=_['intersection'](_0xa0af07[_0x834e('0x3c')],qs[_0x834e('0x41')](_0xf25875[_0x834e('0x3d')][_0x834e('0x41')]));_0x6a507a['attributes']=_0x6a507a[_0x834e('0x3f')][_0x834e('0x50')]?_0x6a507a[_0x834e('0x3f')]:_0xa0af07[_0x834e('0x3c')];_0x6a507a[_0x834e('0x44')]=qs[_0x834e('0x45')](_0xf25875[_0x834e('0x3d')][_0x834e('0x45')]);_0x6a507a[_0x834e('0x47')]=qs[_0x834e('0x3e')](_[_0x834e('0x46')](_0xf25875[_0x834e('0x3d')],_0xa0af07[_0x834e('0x3e')]));if(_0xf25875[_0x834e('0x3d')][_0x834e('0x49')]){_0x6a507a[_0x834e('0x47')]=_[_0x834e('0x48')](_0x6a507a['where'],{'$or':_['map'](_0x6a507a[_0x834e('0x3f')],function(_0x349685){var _0x3f52b9={};_0x3f52b9[_0x349685]={'$like':'%'+_0xf25875[_0x834e('0x3d')][_0x834e('0x49')]+'%'};return _0x3f52b9;})});}_0x6a507a=_[_0x834e('0x48')]({},_0x6a507a,_0xf25875[_0x834e('0x52')]);return _0x2a3ca4[_0x834e('0x8c')](_0x6a507a);}})[_0x834e('0x4a')](function(_0x58cd3b){if(_0x58cd3b){_0x284a75=_0x58cd3b[_0x834e('0x50')];if(!_0xf25875[_0x834e('0x3d')]['hasOwnProperty'](_0x834e('0x43'))){_0x6a507a['limit']=qs[_0x834e('0x27')](_0xf25875[_0x834e('0x3d')][_0x834e('0x27')]);_0x6a507a['offset']=qs[_0x834e('0x25')](_0xf25875[_0x834e('0x3d')]['offset']);}return _0x2a3ca4['getAgents'](_0x6a507a);}})[_0x834e('0x4a')](function(_0x3b7b1a){if(_0x3b7b1a){return _0x3b7b1a?{'count':_0x284a75,'rows':_0x3b7b1a}:null;}})['then'](respondWithResult(_0x56f28b,null))[_0x834e('0x54')](handleError(_0x56f28b,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index 0187768..fd670d2 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 _0x1063=['hasOwnProperty','events','../../mysqldb','setMaxListeners','update','emit'];(function(_0x2a54fc,_0x5efd08){var _0x39b838=function(_0x28714f){while(--_0x28714f){_0x2a54fc['push'](_0x2a54fc['shift']());}};_0x39b838(++_0x5efd08);}(_0x1063,0x151));var _0x3106=function(_0x3decb1,_0x42b930){_0x3decb1=_0x3decb1-0x0;var _0x11a70b=_0x1063[_0x3decb1];return _0x11a70b;};'use strict';var EventEmitter=require(_0x3106('0x0'));var Team=require(_0x3106('0x1'))['db']['Team'];var TeamEvents=new EventEmitter();TeamEvents[_0x3106('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x3106('0x3'),'afterDestroy':'remove'};function emitEvent(_0x4b13d6){return function(_0x471218,_0x14c42b,_0x263163){TeamEvents[_0x3106('0x4')](_0x4b13d6+':'+_0x471218['id'],_0x471218);TeamEvents[_0x3106('0x4')](_0x4b13d6,_0x471218);_0x263163(null);};}for(var e in events){if(events[_0x3106('0x5')](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module['exports']=TeamEvents; \ No newline at end of file +var _0x87c4=['Team','remove','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x2f15ff,_0x5df964){var _0x51f125=function(_0x40dc3c){while(--_0x40dc3c){_0x2f15ff['push'](_0x2f15ff['shift']());}};_0x51f125(++_0x5df964);}(_0x87c4,0x1e2));var _0x487c=function(_0x44ec34,_0xe74c8a){_0x44ec34=_0x44ec34-0x0;var _0x377873=_0x87c4[_0x44ec34];return _0x377873;};'use strict';var EventEmitter=require('events');var Team=require(_0x487c('0x0'))['db'][_0x487c('0x1')];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x487c('0x2')};function emitEvent(_0x201d1e){return function(_0x5492ee,_0xea6fee,_0x13973a){TeamEvents[_0x487c('0x3')](_0x201d1e+':'+_0x5492ee['id'],_0x5492ee);TeamEvents[_0x487c('0x3')](_0x201d1e,_0x5492ee);_0x13973a(null);};}for(var e in events){if(events[_0x487c('0x4')](e)){var event=events[e];Team[_0x487c('0x5')](e,emitEvent(event));}}module[_0x487c('0x6')]=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index b8d272b..45d2cc6 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 _0xad57=['../../config/logger','moment','request-promise','rimraf','../../config/environment','exports','define','teams','util'];(function(_0x369bf2,_0x357db8){var _0x2a79f9=function(_0x328c54){while(--_0x328c54){_0x369bf2['push'](_0x369bf2['shift']());}};_0x2a79f9(++_0x357db8);}(_0xad57,0xe9));var _0x7ad5=function(_0x32ad39,_0x397d2d){_0x32ad39=_0x32ad39-0x0;var _0x4d4db2=_0xad57[_0x32ad39];return _0x4d4db2;};'use strict';var _=require('lodash');var util=require(_0x7ad5('0x0'));var logger=require(_0x7ad5('0x1'))('api');var moment=require(_0x7ad5('0x2'));var BPromise=require('bluebird');var rp=require(_0x7ad5('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7ad5('0x4'));var config=require(_0x7ad5('0x5'));var attributes=require('./team.attributes');module[_0x7ad5('0x6')]=function(_0x3b201c,_0x83b6c9){return _0x3b201c[_0x7ad5('0x7')]('Team',attributes,{'tableName':_0x7ad5('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x91ef=['path','rimraf','../../config/environment','./team.attributes','exports','Team','teams','lodash','../../config/logger','api','moment','bluebird'];(function(_0xa7cc78,_0x55853d){var _0x405bd6=function(_0x42952d){while(--_0x42952d){_0xa7cc78['push'](_0xa7cc78['shift']());}};_0x405bd6(++_0x55853d);}(_0x91ef,0xa3));var _0xf91e=function(_0x2642cb,_0x4b917f){_0x2642cb=_0x2642cb-0x0;var _0xe6e41=_0x91ef[_0x2642cb];return _0xe6e41;};'use strict';var _=require(_0xf91e('0x0'));var util=require('util');var logger=require(_0xf91e('0x1'))(_0xf91e('0x2'));var moment=require(_0xf91e('0x3'));var BPromise=require(_0xf91e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf91e('0x5'));var rimraf=require(_0xf91e('0x6'));var config=require(_0xf91e('0x7'));var attributes=require(_0xf91e('0x8'));module[_0xf91e('0x9')]=function(_0x36daf9,_0x3bbbd6){return _0x36daf9['define'](_0xf91e('0xa'),attributes,{'tableName':_0xf91e('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 da6e6b4..5169232 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 _0x9ccf=['rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','register','then','info','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x5e4b11,_0xf40479){var _0x43cead=function(_0x60ff65){while(--_0x60ff65){_0x5e4b11['push'](_0x5e4b11['shift']());}};_0x43cead(++_0xf40479);}(_0x9ccf,0x19a));var _0xf9cc=function(_0x53c18b,_0x5dd493){_0x53c18b=_0x53c18b-0x0;var _0x59b54e=_0x9ccf[_0x53c18b];return _0x59b54e;};'use strict';var _=require(_0xf9cc('0x0'));var util=require(_0xf9cc('0x1'));var moment=require('moment');var BPromise=require(_0xf9cc('0x2'));var rs=require(_0xf9cc('0x3'));var fs=require('fs');var Redis=require(_0xf9cc('0x4'));var db=require(_0xf9cc('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf9cc('0x6'));var config=require('../../config/environment');var jayson=require(_0xf9cc('0x7'));var client=jayson[_0xf9cc('0x8')]['http']({'port':0x232a});config['redis']=_[_0xf9cc('0x9')](config[_0xf9cc('0xa')],{'host':_0xf9cc('0xb'),'port':0x18eb});var socket=require(_0xf9cc('0xc'))(new Redis(config['redis']));require('./team.socket')[_0xf9cc('0xd')](socket);function respondWithRpcPromise(_0x4daa96,_0x2f863f,_0x324962){return new BPromise(function(_0x42964b,_0xce2a67){return client['request'](_0x4daa96,_0x324962)[_0xf9cc('0xe')](function(_0x183c84){logger[_0xf9cc('0xf')](_0xf9cc('0x10'),_0x2f863f,_0xf9cc('0x11'));logger[_0xf9cc('0x12')](_0xf9cc('0x13'),_0x2f863f,'request\x20sent',JSON[_0xf9cc('0x14')](_0x183c84));if(_0x183c84[_0xf9cc('0x15')]){if(_0x183c84[_0xf9cc('0x15')][_0xf9cc('0x16')]===0x1f4){logger['error']('Team,\x20%s,\x20%s',_0x2f863f,_0x183c84[_0xf9cc('0x15')]['message']);return _0xce2a67(_0x183c84[_0xf9cc('0x15')][_0xf9cc('0x17')]);}logger[_0xf9cc('0x15')]('Team,\x20%s,\x20%s',_0x2f863f,_0x183c84['error'][_0xf9cc('0x17')]);return _0x42964b(_0x183c84[_0xf9cc('0x15')][_0xf9cc('0x17')]);}else{logger['info']('Team,\x20%s,\x20%s',_0x2f863f,_0xf9cc('0x11'));_0x42964b(_0x183c84[_0xf9cc('0x18')]['message']);}})[_0xf9cc('0x19')](function(_0x21b6ee){logger[_0xf9cc('0x15')]('Team,\x20%s,\x20%s',_0x2f863f,_0x21b6ee);_0xce2a67(_0x21b6ee);});});} \ No newline at end of file +var _0x0a91=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./team.socket','register','request','then','info','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','code','error','Team,\x20%s,\x20%s','message','result','lodash','util','bluebird','randomstring'];(function(_0x185deb,_0x20e36f){var _0x37436e=function(_0x541270){while(--_0x541270){_0x185deb['push'](_0x185deb['shift']());}};_0x37436e(++_0x20e36f);}(_0x0a91,0x140));var _0x10a9=function(_0x45b034,_0x3a57dd){_0x45b034=_0x45b034-0x0;var _0x509cb0=_0x0a91[_0x45b034];return _0x509cb0;};'use strict';var _=require(_0x10a9('0x0'));var util=require(_0x10a9('0x1'));var moment=require('moment');var BPromise=require(_0x10a9('0x2'));var rs=require(_0x10a9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x10a9('0x4'))['db'];var utils=require(_0x10a9('0x5'));var logger=require(_0x10a9('0x6'))('rpc');var config=require(_0x10a9('0x7'));var jayson=require(_0x10a9('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0x10a9('0x9')]=_[_0x10a9('0xa')](config['redis'],{'host':_0x10a9('0xb'),'port':0x18eb});var socket=require(_0x10a9('0xc'))(new Redis(config['redis']));require(_0x10a9('0xd'))[_0x10a9('0xe')](socket);function respondWithRpcPromise(_0x1df8d9,_0x398acb,_0x515acc){return new BPromise(function(_0x42889a,_0x1e8aa1){return client[_0x10a9('0xf')](_0x1df8d9,_0x515acc)[_0x10a9('0x10')](function(_0x1a6a23){logger[_0x10a9('0x11')]('Team,\x20%s,\x20%s',_0x398acb,_0x10a9('0x12'));logger[_0x10a9('0x13')](_0x10a9('0x14'),_0x398acb,'request\x20sent',JSON[_0x10a9('0x15')](_0x1a6a23));if(_0x1a6a23['error']){if(_0x1a6a23['error'][_0x10a9('0x16')]===0x1f4){logger[_0x10a9('0x17')](_0x10a9('0x18'),_0x398acb,_0x1a6a23[_0x10a9('0x17')][_0x10a9('0x19')]);return _0x1e8aa1(_0x1a6a23['error'][_0x10a9('0x19')]);}logger[_0x10a9('0x17')]('Team,\x20%s,\x20%s',_0x398acb,_0x1a6a23['error'][_0x10a9('0x19')]);return _0x42889a(_0x1a6a23[_0x10a9('0x17')][_0x10a9('0x19')]);}else{logger[_0x10a9('0x11')](_0x10a9('0x18'),_0x398acb,_0x10a9('0x12'));_0x42889a(_0x1a6a23[_0x10a9('0x1a')][_0x10a9('0x19')]);}})['catch'](function(_0x246292){logger[_0x10a9('0x17')]('Team,\x20%s,\x20%s',_0x398acb,_0x246292);_0x1e8aa1(_0x246292);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index 22c145c..21b6432 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 _0xcd54=['team:','./team.events','save','remove','removeListener','length'];(function(_0x4b8b7e,_0x29560e){var _0x442ef8=function(_0xdb5024){while(--_0xdb5024){_0x4b8b7e['push'](_0x4b8b7e['shift']());}};_0x442ef8(++_0x29560e);}(_0xcd54,0xaf));var _0x4cd5=function(_0x514f6d,_0x440554){_0x514f6d=_0x514f6d-0x0;var _0x1166cd=_0xcd54[_0x514f6d];return _0x1166cd;};'use strict';var TeamEvents=require(_0x4cd5('0x0'));var events=[_0x4cd5('0x1'),_0x4cd5('0x2'),'update'];function createListener(_0x51e2ed,_0x5d99f5){return function(_0x300739){_0x5d99f5['emit'](_0x51e2ed,_0x300739);};}function removeListener(_0x44bb25,_0xa7e4f4){return function(){TeamEvents[_0x4cd5('0x3')](_0x44bb25,_0xa7e4f4);};}exports['register']=function(_0x200f6d){for(var _0x2b8b4e=0x0,_0x9ad1a5=events[_0x4cd5('0x4')];_0x2b8b4e<_0x9ad1a5;_0x2b8b4e++){var _0x2e216a=events[_0x2b8b4e];var _0x5a9277=createListener(_0x4cd5('0x5')+_0x2e216a,_0x200f6d);TeamEvents['on'](_0x2e216a,_0x5a9277);}}; \ No newline at end of file +var _0x7085=['team:','./team.events','save','remove','update'];(function(_0x17128d,_0x4e06ba){var _0xf83f4d=function(_0x443e72){while(--_0x443e72){_0x17128d['push'](_0x17128d['shift']());}};_0xf83f4d(++_0x4e06ba);}(_0x7085,0x7e));var _0x5708=function(_0x47899b,_0x3a9171){_0x47899b=_0x47899b-0x0;var _0x3cf890=_0x7085[_0x47899b];return _0x3cf890;};'use strict';var TeamEvents=require(_0x5708('0x0'));var events=[_0x5708('0x1'),_0x5708('0x2'),_0x5708('0x3')];function createListener(_0x2f2d2b,_0x1aec1e){return function(_0x351869){_0x1aec1e['emit'](_0x2f2d2b,_0x351869);};}function removeListener(_0x39a3c6,_0x3b41e9){return function(){TeamEvents['removeListener'](_0x39a3c6,_0x3b41e9);};}exports['register']=function(_0x7d7fbf){for(var _0x245a90=0x0,_0x552605=events['length'];_0x245a90<_0x552605;_0x245a90++){var _0x3858af=events[_0x245a90];var _0x435c22=createListener(_0x5708('0x4')+_0x3858af,_0x7d7fbf);TeamEvents['on'](_0x3858af,_0x435c22);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index 5670d97..d842d6e 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 _0x9bb4=['sequelize','exports','INTEGER'];(function(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0x9bb4,0xd5));var _0x49bb=function(_0x3aded,_0x1665bf){_0x3aded=_0x3aded-0x0;var _0x249a68=_0x9bb4[_0x3aded];return _0x249a68;};'use strict';var Sequelize=require(_0x49bb('0x0'));module[_0x49bb('0x1')]={'TeamId':{'type':Sequelize[_0x49bb('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x49bb('0x2')]}}; \ No newline at end of file +var _0x99e8=['INTEGER','sequelize','exports'];(function(_0x488616,_0x516a25){var _0x217fb3=function(_0x43bd59){while(--_0x43bd59){_0x488616['push'](_0x488616['shift']());}};_0x217fb3(++_0x516a25);}(_0x99e8,0x11b));var _0x899e=function(_0x511d31,_0x42e4c7){_0x511d31=_0x511d31-0x0;var _0x588986=_0x99e8[_0x511d31];return _0x588986;};'use strict';var Sequelize=require(_0x899e('0x0'));module[_0x899e('0x1')]={'TeamId':{'type':Sequelize[_0x899e('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x899e('0x2')]}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index 270500a..b1a096d 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 _0x85de=['team_has_voice_prefixes','lodash','util','../../config/logger','api','moment','request-promise','../../config/environment','./teamVoicePrefix.attributes','define','TeamVoicePrefix'];(function(_0x25f451,_0x5d3667){var _0xf614d4=function(_0x5cca65){while(--_0x5cca65){_0x25f451['push'](_0x25f451['shift']());}};_0xf614d4(++_0x5d3667);}(_0x85de,0x1f0));var _0xe85d=function(_0x350bd9,_0x7ee684){_0x350bd9=_0x350bd9-0x0;var _0x460756=_0x85de[_0x350bd9];return _0x460756;};'use strict';var _=require(_0xe85d('0x0'));var util=require(_0xe85d('0x1'));var logger=require(_0xe85d('0x2'))(_0xe85d('0x3'));var moment=require(_0xe85d('0x4'));var BPromise=require('bluebird');var rp=require(_0xe85d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xe85d('0x6'));var attributes=require(_0xe85d('0x7'));module['exports']=function(_0x1e9dea,_0xb70e1d){return _0x1e9dea[_0xe85d('0x8')](_0xe85d('0x9'),attributes,{'tableName':_0xe85d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8caf=['request-promise','rimraf','../../config/environment','./teamVoicePrefix.attributes','exports','TeamVoicePrefix','team_has_voice_prefixes','util','../../config/logger','api','moment','bluebird'];(function(_0x16319f,_0x51a862){var _0x3bdfc3=function(_0x21632a){while(--_0x21632a){_0x16319f['push'](_0x16319f['shift']());}};_0x3bdfc3(++_0x51a862);}(_0x8caf,0x1ab));var _0xf8ca=function(_0x4eb6ec,_0x7f2520){_0x4eb6ec=_0x4eb6ec-0x0;var _0x58881b=_0x8caf[_0x4eb6ec];return _0x58881b;};'use strict';var _=require('lodash');var util=require(_0xf8ca('0x0'));var logger=require(_0xf8ca('0x1'))(_0xf8ca('0x2'));var moment=require(_0xf8ca('0x3'));var BPromise=require(_0xf8ca('0x4'));var rp=require(_0xf8ca('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf8ca('0x6'));var config=require(_0xf8ca('0x7'));var attributes=require(_0xf8ca('0x8'));module[_0xf8ca('0x9')]=function(_0x1e2888,_0x20c10a){return _0x1e2888['define'](_0xf8ca('0xa'),attributes,{'tableName':_0xf8ca('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index e6971da..4c5279d 100644 --- a/server/api/teamVoiceQueue/index.js +++ b/server/api/teamVoiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x3b5a94,_0x1ea788){var _0x5b5c19=function(_0x243fd8){while(--_0x243fd8){_0x3b5a94['push'](_0x3b5a94['shift']());}};_0x5b5c19(++_0x1ea788);}(_0xe706,0xa3));var _0x6e70=function(_0x2f831f,_0x412036){_0x2f831f=_0x2f831f-0x0;var _0x245a02=_0xe706[_0x2f831f];return _0x245a02;};'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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x2c440e,_0x2a2052){var _0x4ce361=function(_0x2ece3a){while(--_0x2ece3a){_0x2c440e['push'](_0x2c440e['shift']());}};_0x4ce361(++_0x2a2052);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index 73f0a71..b30ec14 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 _0x1224=['INTEGER','exports'];(function(_0x5aab5b,_0x531c7a){var _0x211ac9=function(_0x521006){while(--_0x521006){_0x5aab5b['push'](_0x5aab5b['shift']());}};_0x211ac9(++_0x531c7a);}(_0x1224,0x197));var _0x4122=function(_0x247ca4,_0x1e7ec5){_0x247ca4=_0x247ca4-0x0;var _0x432c92=_0x1224[_0x247ca4];return _0x432c92;};'use strict';var Sequelize=require('sequelize');module[_0x4122('0x0')]={'penalty':{'type':Sequelize[_0x4122('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xef9b=['INTEGER','sequelize','exports'];(function(_0x43fbe7,_0x36f1d4){var _0x4a6d00=function(_0x20419d){while(--_0x20419d){_0x43fbe7['push'](_0x43fbe7['shift']());}};_0x4a6d00(++_0x36f1d4);}(_0xef9b,0x1b7));var _0xbef9=function(_0x566e7a,_0x3ce19f){_0x566e7a=_0x566e7a-0x0;var _0x27629d=_0xef9b[_0x566e7a];return _0x27629d;};'use strict';var Sequelize=require(_0xbef9('0x0'));module[_0xbef9('0x1')]={'penalty':{'type':Sequelize[_0xbef9('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.model.js b/server/api/teamVoiceQueue/teamVoiceQueue.model.js index ece25df..6762bf2 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 _0x7333=['define','TeamVoiceQueue','lodash','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./teamVoiceQueue.attributes'];(function(_0x5b64dd,_0xe99940){var _0x135c17=function(_0xfaded1){while(--_0xfaded1){_0x5b64dd['push'](_0x5b64dd['shift']());}};_0x135c17(++_0xe99940);}(_0x7333,0xfc));var _0x3733=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x7333[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0x3733('0x0'));var util=require('util');var logger=require(_0x3733('0x1'))('api');var moment=require(_0x3733('0x2'));var BPromise=require(_0x3733('0x3'));var rp=require(_0x3733('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3733('0x5'));var config=require(_0x3733('0x6'));var attributes=require(_0x3733('0x7'));module['exports']=function(_0xa51fdb,_0x27c9b7){return _0xa51fdb[_0x3733('0x8')](_0x3733('0x9'),attributes,{'tableName':'team_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x758e=['TeamVoiceQueue','lodash','api','moment','bluebird','rimraf','../../config/environment','./teamVoiceQueue.attributes','exports','define'];(function(_0x3f7955,_0x316a4f){var _0x4e7d0a=function(_0x20c5c6){while(--_0x20c5c6){_0x3f7955['push'](_0x3f7955['shift']());}};_0x4e7d0a(++_0x316a4f);}(_0x758e,0x1af));var _0xe758=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x758e[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0xe758('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xe758('0x1'));var moment=require(_0xe758('0x2'));var BPromise=require(_0xe758('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xe758('0x4'));var config=require(_0xe758('0x5'));var attributes=require(_0xe758('0x6'));module[_0xe758('0x7')]=function(_0x5a2226,_0x2cdf89){return _0x5a2226[_0xe758('0x8')](_0xe758('0x9'),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 03bfb43..d1ad316 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 _0xf6c6=['../../config/logger','rpc','jayson/promise','client','http','request','then','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xf6c6,0x154));var _0x6f6c=function(_0x87b0ff,_0x314389){_0x87b0ff=_0x87b0ff-0x0;var _0x3bc0b2=_0xf6c6[_0x87b0ff];return _0x3bc0b2;};'use strict';var _=require('lodash');var util=require(_0x6f6c('0x0'));var moment=require('moment');var BPromise=require(_0x6f6c('0x1'));var rs=require(_0x6f6c('0x2'));var fs=require('fs');var Redis=require(_0x6f6c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x6f6c('0x4'));var logger=require(_0x6f6c('0x5'))(_0x6f6c('0x6'));var config=require('../../config/environment');var jayson=require(_0x6f6c('0x7'));var client=jayson[_0x6f6c('0x8')][_0x6f6c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x40a1c0,_0x3feb60,_0x1999c6){return new BPromise(function(_0x3cb15a,_0x2ef627){return client[_0x6f6c('0xa')](_0x40a1c0,_0x1999c6)[_0x6f6c('0xb')](function(_0x44bb26){logger[_0x6f6c('0xc')](_0x6f6c('0xd'),_0x3feb60,_0x6f6c('0xe'));logger[_0x6f6c('0xf')](_0x6f6c('0x10'),_0x3feb60,_0x6f6c('0xe'),JSON[_0x6f6c('0x11')](_0x44bb26));if(_0x44bb26['error']){if(_0x44bb26[_0x6f6c('0x12')][_0x6f6c('0x13')]===0x1f4){logger['error'](_0x6f6c('0xd'),_0x3feb60,_0x44bb26[_0x6f6c('0x12')]['message']);return _0x2ef627(_0x44bb26['error'][_0x6f6c('0x14')]);}logger[_0x6f6c('0x12')](_0x6f6c('0xd'),_0x3feb60,_0x44bb26[_0x6f6c('0x12')]['message']);return _0x3cb15a(_0x44bb26['error'][_0x6f6c('0x14')]);}else{logger[_0x6f6c('0xc')](_0x6f6c('0xd'),_0x3feb60,_0x6f6c('0xe'));_0x3cb15a(_0x44bb26[_0x6f6c('0x15')][_0x6f6c('0x14')]);}})[_0x6f6c('0x16')](function(_0x282b7f){logger[_0x6f6c('0x12')](_0x6f6c('0xd'),_0x3feb60,_0x282b7f);_0x2ef627(_0x282b7f);});});} \ No newline at end of file +var _0x94b1=['rpc','../../config/environment','client','http','request','then','info','TeamVoiceQueue,\x20%s,\x20%s','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x1a2cdb,_0x125fb7){var _0x13223b=function(_0x45c90e){while(--_0x45c90e){_0x1a2cdb['push'](_0x1a2cdb['shift']());}};_0x13223b(++_0x125fb7);}(_0x94b1,0x102));var _0x194b=function(_0x4baccc,_0x2da866){_0x4baccc=_0x4baccc-0x0;var _0xdbb65b=_0x94b1[_0x4baccc];return _0xdbb65b;};'use strict';var _=require('lodash');var util=require(_0x194b('0x0'));var moment=require('moment');var BPromise=require(_0x194b('0x1'));var rs=require(_0x194b('0x2'));var fs=require('fs');var Redis=require(_0x194b('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x194b('0x4'));var logger=require(_0x194b('0x5'))(_0x194b('0x6'));var config=require(_0x194b('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x194b('0x8')][_0x194b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5213ad,_0x3ec8c2,_0x4e82ac){return new BPromise(function(_0x24b450,_0x4759c0){return client[_0x194b('0xa')](_0x5213ad,_0x4e82ac)[_0x194b('0xb')](function(_0x2f5bb3){logger[_0x194b('0xc')](_0x194b('0xd'),_0x3ec8c2,'request\x20sent');logger[_0x194b('0xe')](_0x194b('0xf'),_0x3ec8c2,_0x194b('0x10'),JSON['stringify'](_0x2f5bb3));if(_0x2f5bb3[_0x194b('0x11')]){if(_0x2f5bb3[_0x194b('0x11')][_0x194b('0x12')]===0x1f4){logger[_0x194b('0x11')](_0x194b('0xd'),_0x3ec8c2,_0x2f5bb3[_0x194b('0x11')][_0x194b('0x13')]);return _0x4759c0(_0x2f5bb3[_0x194b('0x11')][_0x194b('0x13')]);}logger[_0x194b('0x11')](_0x194b('0xd'),_0x3ec8c2,_0x2f5bb3[_0x194b('0x11')][_0x194b('0x13')]);return _0x24b450(_0x2f5bb3[_0x194b('0x11')][_0x194b('0x13')]);}else{logger[_0x194b('0xc')](_0x194b('0xd'),_0x3ec8c2,_0x194b('0x10'));_0x24b450(_0x2f5bb3[_0x194b('0x14')][_0x194b('0x13')]);}})[_0x194b('0x15')](function(_0x4a115a){logger['error'](_0x194b('0xd'),_0x3ec8c2,_0x4a115a);_0x4759c0(_0x4a115a);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index 9b58e1f..9ca3a0a 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 _0x937d=['/:id','post','create','put','update','destroy','exports','multer','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x4822f1,_0x432a6d){var _0x14245e=function(_0x5c4e4c){while(--_0x5c4e4c){_0x4822f1['push'](_0x4822f1['shift']());}};_0x14245e(++_0x432a6d);}(_0x937d,0x1f4));var _0xd937=function(_0x19d815,_0x53768a){_0x19d815=_0x19d815-0x0;var _0x49208b=_0x937d[_0x19d815];return _0x49208b;};'use strict';var multer=require(_0xd937('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xd937('0x1'));var router=express[_0xd937('0x2')]();var fs_extra=require(_0xd937('0x3'));var auth=require(_0xd937('0x4'));var interaction=require(_0xd937('0x5'));var config=require(_0xd937('0x6'));var controller=require('./template.controller');router[_0xd937('0x7')]('/',auth[_0xd937('0x8')](),controller[_0xd937('0x9')]);router['get'](_0xd937('0xa'),auth[_0xd937('0x8')](),controller['show']);router[_0xd937('0xb')]('/',auth[_0xd937('0x8')](),controller[_0xd937('0xc')]);router[_0xd937('0xd')](_0xd937('0xa'),auth['isAuthenticated'](),controller[_0xd937('0xe')]);router['delete'](_0xd937('0xa'),auth['isAuthenticated'](),controller[_0xd937('0xf')]);module[_0xd937('0x10')]=router; \ No newline at end of file +var _0x5a43=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','get','isAuthenticated','index','/:id','post','create','put'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x5a43,0xf1));var _0x35a4=function(_0x41cb7f,_0x1d2358){_0x41cb7f=_0x41cb7f-0x0;var _0x5b1484=_0x5a43[_0x41cb7f];return _0x5b1484;};'use strict';var multer=require(_0x35a4('0x0'));var util=require(_0x35a4('0x1'));var path=require(_0x35a4('0x2'));var timeout=require(_0x35a4('0x3'));var express=require(_0x35a4('0x4'));var router=express[_0x35a4('0x5')]();var fs_extra=require(_0x35a4('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./template.controller');router[_0x35a4('0x7')]('/',auth[_0x35a4('0x8')](),controller[_0x35a4('0x9')]);router[_0x35a4('0x7')](_0x35a4('0xa'),auth[_0x35a4('0x8')](),controller['show']);router[_0x35a4('0xb')]('/',auth[_0x35a4('0x8')](),controller[_0x35a4('0xc')]);router[_0x35a4('0xd')](_0x35a4('0xa'),auth[_0x35a4('0x8')](),controller['update']);router['delete']('/:id',auth[_0x35a4('0x8')](),controller['destroy']);module[_0x35a4('0xe')]=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index 2d455c7..318459f 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 _0x34e9=['exports','STRING','sequelize'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0x34e9,0x1b8));var _0x934e=function(_0x1a91ca,_0x235a89){_0x1a91ca=_0x1a91ca-0x0;var _0x2b61b3=_0x34e9[_0x1a91ca];return _0x2b61b3;};'use strict';var Sequelize=require(_0x934e('0x0'));module[_0x934e('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x934e('0x2')]},'html':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xd18b=['STRING','sequelize','exports'];(function(_0x28a066,_0x5a2bae){var _0x1771ea=function(_0x242b4c){while(--_0x242b4c){_0x28a066['push'](_0x28a066['shift']());}};_0x1771ea(++_0x5a2bae);}(_0xd18b,0x124));var _0xbd18=function(_0x39c90,_0x3bbfae){_0x39c90=_0x39c90-0x0;var _0x169969=_0xd18b[_0x39c90];return _0x169969;};'use strict';var Sequelize=require(_0xbd18('0x0'));module[_0xbd18('0x1')]={'name':{'type':Sequelize[_0xbd18('0x2')]},'description':{'type':Sequelize[_0xbd18('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 e0a5269..30a72c3 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 _0x0076=['eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','get','UserProfileResource','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','merge','where','options','Template','includeAll','include','findAll','rows','show','params','keys','length','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Templates','UserProfileSection','userProfileId','error'];(function(_0x321546,_0x41b964){var _0xfea202=function(_0x54594d){while(--_0x54594d){_0x321546['push'](_0x321546['shift']());}};_0xfea202(++_0x41b964);}(_0x0076,0x1a9));var _0x6007=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x0076[_0x8c43de];return _0xa6591b;};'use strict';var emlformat=require(_0x6007('0x0'));var rimraf=require(_0x6007('0x1'));var zipdir=require(_0x6007('0x2'));var jsonpatch=require(_0x6007('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6007('0x4'));var Mustache=require('mustache');var util=require(_0x6007('0x5'));var path=require(_0x6007('0x6'));var sox=require(_0x6007('0x7'));var csv=require(_0x6007('0x8'));var ejs=require(_0x6007('0x9'));var fs=require('fs');var fs_extra=require(_0x6007('0xa'));var _=require(_0x6007('0xb'));var squel=require(_0x6007('0xc'));var crypto=require(_0x6007('0xd'));var jsforce=require(_0x6007('0xe'));var deskjs=require(_0x6007('0xf'));var toCsv=require(_0x6007('0x8'));var querystring=require('querystring');var Papa=require(_0x6007('0x10'));var Redis=require(_0x6007('0x11'));var authService=require(_0x6007('0x12'));var qs=require(_0x6007('0x13'));var as=require(_0x6007('0x14'));var hardwareService=require(_0x6007('0x15'));var logger=require(_0x6007('0x16'))('api');var utils=require(_0x6007('0x17'));var config=require(_0x6007('0x18'));var licenseUtil=require(_0x6007('0x19'));var db=require(_0x6007('0x1a'))['db'];function respondWithStatusCode(_0x2f0c9e,_0x5dff68){_0x5dff68=_0x5dff68||0xcc;return function(_0x565805){if(_0x565805){return _0x2f0c9e[_0x6007('0x1b')](_0x5dff68);}return _0x2f0c9e[_0x6007('0x1c')](_0x5dff68)[_0x6007('0x1d')]();};}function respondWithResult(_0x37d262,_0xb18932){_0xb18932=_0xb18932||0xc8;return function(_0x8da4f3){if(_0x8da4f3){return _0x37d262[_0x6007('0x1c')](_0xb18932)[_0x6007('0x1e')](_0x8da4f3);}};}function respondWithFilteredResult(_0x157ff7,_0x5170b1){return function(_0x31e16d){if(_0x31e16d){var _0x2b3341=typeof _0x5170b1[_0x6007('0x1f')]===_0x6007('0x20')&&typeof _0x5170b1['limit']===_0x6007('0x20');var _0x54009d=_0x31e16d[_0x6007('0x21')];var _0x1cc087=_0x2b3341?0x0:_0x5170b1[_0x6007('0x1f')];var _0x430da8=_0x2b3341?_0x31e16d[_0x6007('0x21')]:_0x5170b1['offset']+_0x5170b1[_0x6007('0x22')];var _0x353be9;if(_0x430da8>=_0x54009d){_0x430da8=_0x54009d;_0x353be9=0xc8;}else{_0x353be9=0xce;}_0x157ff7['status'](_0x353be9);return _0x157ff7[_0x6007('0x23')](_0x6007('0x24'),_0x1cc087+'-'+_0x430da8+'/'+_0x54009d)[_0x6007('0x1e')](_0x31e16d);}return null;};}function patchUpdates(_0x587831){return function(_0x120fbe){try{jsonpatch[_0x6007('0x25')](_0x120fbe,_0x587831,!![]);}catch(_0x2cd3fa){return BPromise[_0x6007('0x26')](_0x2cd3fa);}return _0x120fbe['save']();};}function saveUpdates(_0x4d5dce,_0x1fcbec){return function(_0x4ec8a1){if(_0x4ec8a1){return _0x4ec8a1[_0x6007('0x27')](_0x4d5dce)[_0x6007('0x28')](function(_0x2a67b3){return _0x2a67b3;});}return null;};}function removeEntity(_0x50682e,_0x5861be){return function(_0x2c05ba){if(_0x2c05ba){return _0x2c05ba[_0x6007('0x29')]()[_0x6007('0x28')](function(){var _0x36c929=_0x2c05ba[_0x6007('0x2a')]({'plain':!![]});var _0x44f747='Templates';return db[_0x6007('0x2b')][_0x6007('0x29')]({'where':{'type':_0x44f747,'resourceId':_0x36c929['id']}})[_0x6007('0x28')](function(){return _0x2c05ba;});})[_0x6007('0x28')](function(){_0x50682e[_0x6007('0x1c')](0xcc)[_0x6007('0x1d')]();});}};}function handleEntityNotFound(_0x421d3a,_0xe5ec97){return function(_0x2651af){if(!_0x2651af){_0x421d3a[_0x6007('0x1b')](0x194);}return _0x2651af;};}function handleError(_0x1e5226,_0x415c0a){_0x415c0a=_0x415c0a||0x1f4;return function(_0xba6150){logger['error'](_0xba6150[_0x6007('0x2c')]);if(_0xba6150[_0x6007('0x2d')]){delete _0xba6150['name'];}_0x1e5226[_0x6007('0x1c')](_0x415c0a)[_0x6007('0x2e')](_0xba6150);};}exports[_0x6007('0x2f')]=function(_0x28047d,_0xec0635){var _0x4bee1a={},_0x273343={},_0x30e101={'count':0x0,'rows':[]};var _0x215ae7=_[_0x6007('0x30')](db['Template'][_0x6007('0x31')],function(_0x284523){return{'name':_0x284523[_0x6007('0x32')],'type':_0x284523[_0x6007('0x33')]['key']};});_0x273343[_0x6007('0x34')]=_[_0x6007('0x30')](_0x215ae7,_0x6007('0x2d'));_0x273343[_0x6007('0x35')]=_['keys'](_0x28047d[_0x6007('0x35')]);_0x273343['filters']=_[_0x6007('0x36')](_0x273343[_0x6007('0x34')],_0x273343[_0x6007('0x35')]);_0x4bee1a[_0x6007('0x37')]=_[_0x6007('0x36')](_0x273343['model'],qs[_0x6007('0x38')](_0x28047d[_0x6007('0x35')][_0x6007('0x38')]));_0x4bee1a[_0x6007('0x37')]=_0x4bee1a[_0x6007('0x37')]['length']?_0x4bee1a['attributes']:_0x273343[_0x6007('0x34')];if(!_0x28047d[_0x6007('0x35')][_0x6007('0x39')](_0x6007('0x3a'))){_0x4bee1a[_0x6007('0x22')]=qs[_0x6007('0x22')](_0x28047d[_0x6007('0x35')][_0x6007('0x22')]);_0x4bee1a[_0x6007('0x1f')]=qs[_0x6007('0x1f')](_0x28047d['query'][_0x6007('0x1f')]);}_0x4bee1a[_0x6007('0x3b')]=qs[_0x6007('0x3c')](_0x28047d[_0x6007('0x35')][_0x6007('0x3c')]);_0x4bee1a['where']=qs['filters'](_['pick'](_0x28047d['query'],_0x273343[_0x6007('0x3d')]),_0x215ae7);if(_0x28047d[_0x6007('0x35')]['filter']){_0x4bee1a['where']=_[_0x6007('0x3e')](_0x4bee1a[_0x6007('0x3f')],{'$or':_[_0x6007('0x30')](_0x215ae7,function(_0x16fcc5){if(_0x16fcc5[_0x6007('0x33')]!=='VIRTUAL'){var _0x1ace4b={};_0x1ace4b[_0x16fcc5[_0x6007('0x2d')]]={'$like':'%'+_0x28047d[_0x6007('0x35')]['filter']+'%'};return _0x1ace4b;}})});}_0x4bee1a=_[_0x6007('0x3e')]({},_0x4bee1a,_0x28047d[_0x6007('0x40')]);var _0x29b5bd={'where':_0x4bee1a[_0x6007('0x3f')]};return db[_0x6007('0x41')][_0x6007('0x21')](_0x29b5bd)[_0x6007('0x28')](function(_0x4107d7){_0x30e101[_0x6007('0x21')]=_0x4107d7;if(_0x28047d[_0x6007('0x35')][_0x6007('0x42')]){_0x4bee1a[_0x6007('0x43')]=[{'all':!![]}];}return db['Template'][_0x6007('0x44')](_0x4bee1a);})[_0x6007('0x28')](function(_0x4b3b93){_0x30e101[_0x6007('0x45')]=_0x4b3b93;return _0x30e101;})[_0x6007('0x28')](respondWithFilteredResult(_0xec0635,_0x4bee1a))['catch'](handleError(_0xec0635,null));};exports[_0x6007('0x46')]=function(_0x32ed5e,_0x2fbaa5){var _0x15eed3={'raw':!![],'where':{'id':_0x32ed5e[_0x6007('0x47')]['id']}},_0x4aa020={};_0x4aa020[_0x6007('0x34')]=_[_0x6007('0x48')](db[_0x6007('0x41')][_0x6007('0x31')]);_0x4aa020['query']=_[_0x6007('0x48')](_0x32ed5e['query']);_0x4aa020[_0x6007('0x3d')]=_[_0x6007('0x36')](_0x4aa020['model'],_0x4aa020[_0x6007('0x35')]);_0x15eed3['attributes']=_[_0x6007('0x36')](_0x4aa020[_0x6007('0x34')],qs['fields'](_0x32ed5e[_0x6007('0x35')][_0x6007('0x38')]));_0x15eed3['attributes']=_0x15eed3['attributes'][_0x6007('0x49')]?_0x15eed3[_0x6007('0x37')]:_0x4aa020[_0x6007('0x34')];if(_0x32ed5e[_0x6007('0x35')]['includeAll']){_0x15eed3[_0x6007('0x43')]=[{'all':!![]}];}_0x15eed3=_[_0x6007('0x3e')]({},_0x15eed3,_0x32ed5e[_0x6007('0x40')]);return db[_0x6007('0x41')][_0x6007('0x4a')](_0x15eed3)[_0x6007('0x28')](handleEntityNotFound(_0x2fbaa5,null))[_0x6007('0x28')](respondWithResult(_0x2fbaa5,null))[_0x6007('0x4b')](handleError(_0x2fbaa5,null));};exports[_0x6007('0x4c')]=function(_0x27f639,_0x116925){return db[_0x6007('0x41')][_0x6007('0x4c')](_0x27f639[_0x6007('0x4d')],{})[_0x6007('0x28')](function(_0x5c6ba9){var _0x42a50a=_0x27f639['user'][_0x6007('0x2a')]({'plain':!![]});if(!_0x42a50a)throw new Error(_0x6007('0x4e'));if(_0x42a50a[_0x6007('0x4f')]===_0x6007('0x50')){var _0x3eff54=_0x5c6ba9[_0x6007('0x2a')]({'plain':!![]});var _0x171aff=_0x6007('0x51');return db[_0x6007('0x52')][_0x6007('0x4a')]({'where':{'name':_0x171aff,'userProfileId':_0x42a50a[_0x6007('0x53')]},'raw':!![]})['then'](function(_0x109323){if(_0x109323&&_0x109323['autoAssociation']===0x0){return db[_0x6007('0x2b')][_0x6007('0x4c')]({'name':_0x3eff54[_0x6007('0x2d')],'resourceId':_0x3eff54['id'],'type':_0x109323[_0x6007('0x2d')],'sectionId':_0x109323['id']},{})[_0x6007('0x28')](function(){return _0x5c6ba9;});}else{return _0x5c6ba9;}})[_0x6007('0x4b')](function(_0x2d3a27){logger[_0x6007('0x54')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2d3a27);throw _0x2d3a27;});}return _0x5c6ba9;})['then'](respondWithResult(_0x116925,0xc9))[_0x6007('0x4b')](handleError(_0x116925,null));};exports['update']=function(_0x114f54,_0x5cbfa4){if(_0x114f54[_0x6007('0x4d')]['id']){delete _0x114f54['body']['id'];}return db[_0x6007('0x41')][_0x6007('0x4a')]({'where':{'id':_0x114f54[_0x6007('0x47')]['id']}})[_0x6007('0x28')](handleEntityNotFound(_0x5cbfa4,null))[_0x6007('0x28')](saveUpdates(_0x114f54[_0x6007('0x4d')],null))[_0x6007('0x28')](respondWithResult(_0x5cbfa4,null))['catch'](handleError(_0x5cbfa4,null));};exports[_0x6007('0x29')]=function(_0x9cfc39,_0x241b54){return db[_0x6007('0x41')][_0x6007('0x4a')]({'where':{'id':_0x9cfc39[_0x6007('0x47')]['id']}})[_0x6007('0x28')](handleEntityNotFound(_0x241b54,null))[_0x6007('0x28')](removeEntity(_0x241b54,null))[_0x6007('0x4b')](handleError(_0x241b54,null));}; \ No newline at end of file +var _0x0a4e=['body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','apply','reject','save','then','destroy','get','Templates','UserProfileResource','error','stack','name','send','index','Template','rawAttributes','fieldName','type','key','map','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','params','user','role','find','userProfileId','autoAssociation','create','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update'];(function(_0x51f357,_0x58d147){var _0x186473=function(_0x217b6b){while(--_0x217b6b){_0x51f357['push'](_0x51f357['shift']());}};_0x186473(++_0x58d147);}(_0x0a4e,0x1aa));var _0xe0a4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0a4e[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xe0a4('0x0'));var rimraf=require(_0xe0a4('0x1'));var zipdir=require(_0xe0a4('0x2'));var jsonpatch=require(_0xe0a4('0x3'));var rp=require('request-promise');var moment=require(_0xe0a4('0x4'));var BPromise=require(_0xe0a4('0x5'));var Mustache=require(_0xe0a4('0x6'));var util=require(_0xe0a4('0x7'));var path=require(_0xe0a4('0x8'));var sox=require(_0xe0a4('0x9'));var csv=require(_0xe0a4('0xa'));var ejs=require(_0xe0a4('0xb'));var fs=require('fs');var fs_extra=require(_0xe0a4('0xc'));var _=require(_0xe0a4('0xd'));var squel=require(_0xe0a4('0xe'));var crypto=require(_0xe0a4('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xe0a4('0x10'));var toCsv=require(_0xe0a4('0xa'));var querystring=require(_0xe0a4('0x11'));var Papa=require(_0xe0a4('0x12'));var Redis=require(_0xe0a4('0x13'));var authService=require(_0xe0a4('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe0a4('0x15'));var logger=require(_0xe0a4('0x16'))(_0xe0a4('0x17'));var utils=require(_0xe0a4('0x18'));var config=require(_0xe0a4('0x19'));var licenseUtil=require(_0xe0a4('0x1a'));var db=require(_0xe0a4('0x1b'))['db'];function respondWithStatusCode(_0x2374e9,_0x4ee9d6){_0x4ee9d6=_0x4ee9d6||0xcc;return function(_0x2550c8){if(_0x2550c8){return _0x2374e9[_0xe0a4('0x1c')](_0x4ee9d6);}return _0x2374e9[_0xe0a4('0x1d')](_0x4ee9d6)['end']();};}function respondWithResult(_0x18c8dc,_0x43fd7b){_0x43fd7b=_0x43fd7b||0xc8;return function(_0x292664){if(_0x292664){return _0x18c8dc[_0xe0a4('0x1d')](_0x43fd7b)[_0xe0a4('0x1e')](_0x292664);}};}function respondWithFilteredResult(_0x18cca0,_0x343fa9){return function(_0x141c1d){if(_0x141c1d){var _0x54f672=typeof _0x343fa9[_0xe0a4('0x1f')]==='undefined'&&typeof _0x343fa9[_0xe0a4('0x20')]===_0xe0a4('0x21');var _0x37475c=_0x141c1d[_0xe0a4('0x22')];var _0x31370e=_0x54f672?0x0:_0x343fa9['offset'];var _0x1e41f2=_0x54f672?_0x141c1d['count']:_0x343fa9['offset']+_0x343fa9[_0xe0a4('0x20')];var _0x4d1215;if(_0x1e41f2>=_0x37475c){_0x1e41f2=_0x37475c;_0x4d1215=0xc8;}else{_0x4d1215=0xce;}_0x18cca0[_0xe0a4('0x1d')](_0x4d1215);return _0x18cca0[_0xe0a4('0x23')]('Content-Range',_0x31370e+'-'+_0x1e41f2+'/'+_0x37475c)[_0xe0a4('0x1e')](_0x141c1d);}return null;};}function patchUpdates(_0x5e7ce6){return function(_0x5173a2){try{jsonpatch[_0xe0a4('0x24')](_0x5173a2,_0x5e7ce6,!![]);}catch(_0x5bf178){return BPromise[_0xe0a4('0x25')](_0x5bf178);}return _0x5173a2[_0xe0a4('0x26')]();};}function saveUpdates(_0x4edd21,_0x4a5cfe){return function(_0x1e5308){if(_0x1e5308){return _0x1e5308['update'](_0x4edd21)[_0xe0a4('0x27')](function(_0x168f28){return _0x168f28;});}return null;};}function removeEntity(_0x22e14a,_0x4d1faa){return function(_0x1b6d71){if(_0x1b6d71){return _0x1b6d71[_0xe0a4('0x28')]()[_0xe0a4('0x27')](function(){var _0x5e52bf=_0x1b6d71[_0xe0a4('0x29')]({'plain':!![]});var _0x40d8bf=_0xe0a4('0x2a');return db[_0xe0a4('0x2b')][_0xe0a4('0x28')]({'where':{'type':_0x40d8bf,'resourceId':_0x5e52bf['id']}})[_0xe0a4('0x27')](function(){return _0x1b6d71;});})[_0xe0a4('0x27')](function(){_0x22e14a[_0xe0a4('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x40f566,_0x212da9){return function(_0xd10693){if(!_0xd10693){_0x40f566[_0xe0a4('0x1c')](0x194);}return _0xd10693;};}function handleError(_0x3a5f8b,_0x320028){_0x320028=_0x320028||0x1f4;return function(_0x3903ad){logger[_0xe0a4('0x2c')](_0x3903ad[_0xe0a4('0x2d')]);if(_0x3903ad[_0xe0a4('0x2e')]){delete _0x3903ad[_0xe0a4('0x2e')];}_0x3a5f8b[_0xe0a4('0x1d')](_0x320028)[_0xe0a4('0x2f')](_0x3903ad);};}exports[_0xe0a4('0x30')]=function(_0x564c54,_0x17b921){var _0x34fa13={},_0xef0b64={},_0x160643={'count':0x0,'rows':[]};var _0x184912=_['map'](db[_0xe0a4('0x31')][_0xe0a4('0x32')],function(_0x3ee7ae){return{'name':_0x3ee7ae[_0xe0a4('0x33')],'type':_0x3ee7ae[_0xe0a4('0x34')][_0xe0a4('0x35')]};});_0xef0b64['model']=_[_0xe0a4('0x36')](_0x184912,_0xe0a4('0x2e'));_0xef0b64['query']=_[_0xe0a4('0x37')](_0x564c54[_0xe0a4('0x38')]);_0xef0b64[_0xe0a4('0x39')]=_[_0xe0a4('0x3a')](_0xef0b64[_0xe0a4('0x3b')],_0xef0b64[_0xe0a4('0x38')]);_0x34fa13[_0xe0a4('0x3c')]=_[_0xe0a4('0x3a')](_0xef0b64[_0xe0a4('0x3b')],qs[_0xe0a4('0x3d')](_0x564c54[_0xe0a4('0x38')]['fields']));_0x34fa13[_0xe0a4('0x3c')]=_0x34fa13['attributes'][_0xe0a4('0x3e')]?_0x34fa13[_0xe0a4('0x3c')]:_0xef0b64[_0xe0a4('0x3b')];if(!_0x564c54[_0xe0a4('0x38')][_0xe0a4('0x3f')]('nolimit')){_0x34fa13['limit']=qs['limit'](_0x564c54['query']['limit']);_0x34fa13['offset']=qs[_0xe0a4('0x1f')](_0x564c54['query'][_0xe0a4('0x1f')]);}_0x34fa13[_0xe0a4('0x40')]=qs[_0xe0a4('0x41')](_0x564c54[_0xe0a4('0x38')][_0xe0a4('0x41')]);_0x34fa13[_0xe0a4('0x42')]=qs[_0xe0a4('0x39')](_[_0xe0a4('0x43')](_0x564c54[_0xe0a4('0x38')],_0xef0b64['filters']),_0x184912);if(_0x564c54[_0xe0a4('0x38')][_0xe0a4('0x44')]){_0x34fa13[_0xe0a4('0x42')]=_[_0xe0a4('0x45')](_0x34fa13[_0xe0a4('0x42')],{'$or':_[_0xe0a4('0x36')](_0x184912,function(_0x51699d){if(_0x51699d[_0xe0a4('0x34')]!==_0xe0a4('0x46')){var _0x5ac090={};_0x5ac090[_0x51699d[_0xe0a4('0x2e')]]={'$like':'%'+_0x564c54[_0xe0a4('0x38')][_0xe0a4('0x44')]+'%'};return _0x5ac090;}})});}_0x34fa13=_['merge']({},_0x34fa13,_0x564c54[_0xe0a4('0x47')]);var _0x2bb0fb={'where':_0x34fa13['where']};return db[_0xe0a4('0x31')][_0xe0a4('0x22')](_0x2bb0fb)[_0xe0a4('0x27')](function(_0x578003){_0x160643['count']=_0x578003;if(_0x564c54[_0xe0a4('0x38')][_0xe0a4('0x48')]){_0x34fa13['include']=[{'all':!![]}];}return db['Template']['findAll'](_0x34fa13);})[_0xe0a4('0x27')](function(_0xcfe7e){_0x160643[_0xe0a4('0x49')]=_0xcfe7e;return _0x160643;})[_0xe0a4('0x27')](respondWithFilteredResult(_0x17b921,_0x34fa13))['catch'](handleError(_0x17b921,null));};exports['show']=function(_0x33c13b,_0x310b9f){var _0x46723e={'raw':!![],'where':{'id':_0x33c13b[_0xe0a4('0x4a')]['id']}},_0x25755a={};_0x25755a[_0xe0a4('0x3b')]=_[_0xe0a4('0x37')](db[_0xe0a4('0x31')]['rawAttributes']);_0x25755a[_0xe0a4('0x38')]=_[_0xe0a4('0x37')](_0x33c13b[_0xe0a4('0x38')]);_0x25755a['filters']=_[_0xe0a4('0x3a')](_0x25755a[_0xe0a4('0x3b')],_0x25755a['query']);_0x46723e[_0xe0a4('0x3c')]=_['intersection'](_0x25755a['model'],qs[_0xe0a4('0x3d')](_0x33c13b[_0xe0a4('0x38')][_0xe0a4('0x3d')]));_0x46723e[_0xe0a4('0x3c')]=_0x46723e[_0xe0a4('0x3c')]['length']?_0x46723e[_0xe0a4('0x3c')]:_0x25755a['model'];if(_0x33c13b[_0xe0a4('0x38')][_0xe0a4('0x48')]){_0x46723e['include']=[{'all':!![]}];}_0x46723e=_[_0xe0a4('0x45')]({},_0x46723e,_0x33c13b[_0xe0a4('0x47')]);return db[_0xe0a4('0x31')]['find'](_0x46723e)[_0xe0a4('0x27')](handleEntityNotFound(_0x310b9f,null))[_0xe0a4('0x27')](respondWithResult(_0x310b9f,null))['catch'](handleError(_0x310b9f,null));};exports['create']=function(_0x1c20b9,_0x26eda3){return db[_0xe0a4('0x31')]['create'](_0x1c20b9['body'],{})[_0xe0a4('0x27')](function(_0x4bbeff){var _0x4a54a0=_0x1c20b9[_0xe0a4('0x4b')][_0xe0a4('0x29')]({'plain':!![]});if(!_0x4a54a0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4a54a0[_0xe0a4('0x4c')]===_0xe0a4('0x4b')){var _0x3af188=_0x4bbeff[_0xe0a4('0x29')]({'plain':!![]});var _0x55d2db=_0xe0a4('0x2a');return db['UserProfileSection'][_0xe0a4('0x4d')]({'where':{'name':_0x55d2db,'userProfileId':_0x4a54a0[_0xe0a4('0x4e')]},'raw':!![]})[_0xe0a4('0x27')](function(_0x20d874){if(_0x20d874&&_0x20d874[_0xe0a4('0x4f')]===0x0){return db[_0xe0a4('0x2b')][_0xe0a4('0x50')]({'name':_0x3af188[_0xe0a4('0x2e')],'resourceId':_0x3af188['id'],'type':_0x20d874['name'],'sectionId':_0x20d874['id']},{})[_0xe0a4('0x27')](function(){return _0x4bbeff;});}else{return _0x4bbeff;}})[_0xe0a4('0x51')](function(_0x49353c){logger[_0xe0a4('0x2c')](_0xe0a4('0x52'),_0x49353c);throw _0x49353c;});}return _0x4bbeff;})[_0xe0a4('0x27')](respondWithResult(_0x26eda3,0xc9))[_0xe0a4('0x51')](handleError(_0x26eda3,null));};exports[_0xe0a4('0x53')]=function(_0x47744f,_0x47418c){if(_0x47744f[_0xe0a4('0x54')]['id']){delete _0x47744f[_0xe0a4('0x54')]['id'];}return db[_0xe0a4('0x31')]['find']({'where':{'id':_0x47744f[_0xe0a4('0x4a')]['id']}})[_0xe0a4('0x27')](handleEntityNotFound(_0x47418c,null))[_0xe0a4('0x27')](saveUpdates(_0x47744f[_0xe0a4('0x54')],null))['then'](respondWithResult(_0x47418c,null))[_0xe0a4('0x51')](handleError(_0x47418c,null));};exports[_0xe0a4('0x28')]=function(_0x255b1b,_0x2a0028){return db[_0xe0a4('0x31')][_0xe0a4('0x4d')]({'where':{'id':_0x255b1b[_0xe0a4('0x4a')]['id']}})[_0xe0a4('0x27')](handleEntityNotFound(_0x2a0028,null))[_0xe0a4('0x27')](removeEntity(_0x2a0028,null))[_0xe0a4('0x51')](handleError(_0x2a0028,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 084867b..381ada8 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 _0xa80b=['bluebird','request-promise','path','rimraf','./template.attributes','define','Template','tools_templates','../../config/logger','moment'];(function(_0x4e5a2b,_0x40a16c){var _0x46b9b1=function(_0x1f681f){while(--_0x1f681f){_0x4e5a2b['push'](_0x4e5a2b['shift']());}};_0x46b9b1(++_0x40a16c);}(_0xa80b,0x80));var _0xba80=function(_0x45be52,_0x46d496){_0x45be52=_0x45be52-0x0;var _0x15294f=_0xa80b[_0x45be52];return _0x15294f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xba80('0x0'))('api');var moment=require(_0xba80('0x1'));var BPromise=require(_0xba80('0x2'));var rp=require(_0xba80('0x3'));var fs=require('fs');var path=require(_0xba80('0x4'));var rimraf=require(_0xba80('0x5'));var config=require('../../config/environment');var attributes=require(_0xba80('0x6'));module['exports']=function(_0x539caf,_0x36f98f){return _0x539caf[_0xba80('0x7')](_0xba80('0x8'),attributes,{'tableName':_0xba80('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8437=['Template','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment'];(function(_0x18f538,_0x2d23fd){var _0x249882=function(_0x555e84){while(--_0x555e84){_0x18f538['push'](_0x18f538['shift']());}};_0x249882(++_0x2d23fd);}(_0x8437,0x172));var _0x7843=function(_0x3e5028,_0x22baf6){_0x3e5028=_0x3e5028-0x0;var _0x348b43=_0x8437[_0x3e5028];return _0x348b43;};'use strict';var _=require(_0x7843('0x0'));var util=require(_0x7843('0x1'));var logger=require(_0x7843('0x2'))(_0x7843('0x3'));var moment=require(_0x7843('0x4'));var BPromise=require('bluebird');var rp=require(_0x7843('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7843('0x6'));var config=require(_0x7843('0x7'));var attributes=require('./template.attributes');module['exports']=function(_0x1d18be,_0x1cbb6d){return _0x1d18be['define'](_0x7843('0x8'),attributes,{'tableName':'tools_templates','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/template/template.rpc.js b/server/api/template/template.rpc.js index 3e01654..4be5051 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 _0x34cf=['http','request','then','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetTemplate','Template','findAll','options','raw','where','limit','map','include','model','attributes','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client'];(function(_0x2e6c75,_0x1bdbb7){var _0x13a9ea=function(_0x6ad297){while(--_0x6ad297){_0x2e6c75['push'](_0x2e6c75['shift']());}};_0x13a9ea(++_0x1bdbb7);}(_0x34cf,0xd8));var _0xf34c=function(_0x3e4a59,_0x2a566e){_0x3e4a59=_0x3e4a59-0x0;var _0x41acbb=_0x34cf[_0x3e4a59];return _0x41acbb;};'use strict';var _=require('lodash');var util=require(_0xf34c('0x0'));var moment=require(_0xf34c('0x1'));var BPromise=require('bluebird');var rs=require(_0xf34c('0x2'));var fs=require('fs');var Redis=require(_0xf34c('0x3'));var db=require(_0xf34c('0x4'))['db'];var utils=require(_0xf34c('0x5'));var logger=require(_0xf34c('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf34c('0x7')][_0xf34c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x321a92,_0x42001b,_0x22f0d7){return new BPromise(function(_0x158169,_0x3ea6a9){return client[_0xf34c('0x9')](_0x321a92,_0x22f0d7)[_0xf34c('0xa')](function(_0x514cf5){logger['info'](_0xf34c('0xb'),_0x42001b,_0xf34c('0xc'));logger[_0xf34c('0xd')](_0xf34c('0xe'),_0x42001b,'request\x20sent',JSON[_0xf34c('0xf')](_0x514cf5));if(_0x514cf5[_0xf34c('0x10')]){if(_0x514cf5[_0xf34c('0x10')][_0xf34c('0x11')]===0x1f4){logger['error'](_0xf34c('0xb'),_0x42001b,_0x514cf5['error']['message']);return _0x3ea6a9(_0x514cf5[_0xf34c('0x10')][_0xf34c('0x12')]);}logger[_0xf34c('0x10')](_0xf34c('0xb'),_0x42001b,_0x514cf5[_0xf34c('0x10')]['message']);return _0x158169(_0x514cf5[_0xf34c('0x10')]['message']);}else{logger['info'](_0xf34c('0xb'),_0x42001b,_0xf34c('0xc'));_0x158169(_0x514cf5[_0xf34c('0x13')]['message']);}})['catch'](function(_0x5a2510){logger[_0xf34c('0x10')]('Template,\x20%s,\x20%s',_0x42001b,_0x5a2510);_0x3ea6a9(_0x5a2510);});});}exports[_0xf34c('0x14')]=function(_0x377f28){var _0x217521=this;return new Promise(function(_0x15c4a4,_0xbdff5c){return db[_0xf34c('0x15')][_0xf34c('0x16')]({'raw':_0x377f28['options']?_0x377f28[_0xf34c('0x17')][_0xf34c('0x18')]===undefined?!![]:![]:!![],'where':_0x377f28[_0xf34c('0x17')]?_0x377f28[_0xf34c('0x17')][_0xf34c('0x19')]||null:null,'attributes':_0x377f28[_0xf34c('0x17')]?_0x377f28['options']['attributes']||null:null,'limit':_0x377f28[_0xf34c('0x17')]?_0x377f28[_0xf34c('0x17')][_0xf34c('0x1a')]||null:null,'include':_0x377f28['options']?_0x377f28[_0xf34c('0x17')]['include']?_[_0xf34c('0x1b')](_0x377f28[_0xf34c('0x17')][_0xf34c('0x1c')],function(_0x5f2f2a){return{'model':db[_0x5f2f2a[_0xf34c('0x1d')]],'as':_0x5f2f2a['as'],'attributes':_0x5f2f2a['attributes'],'include':_0x5f2f2a[_0xf34c('0x1c')]?_[_0xf34c('0x1b')](_0x5f2f2a[_0xf34c('0x1c')],function(_0x26383d){return{'model':db[_0x26383d[_0xf34c('0x1d')]],'as':_0x26383d['as'],'attributes':_0x26383d[_0xf34c('0x1e')],'include':_0x26383d[_0xf34c('0x1c')]?_[_0xf34c('0x1b')](_0x26383d[_0xf34c('0x1c')],function(_0x104bc7){return{'model':db[_0x104bc7[_0xf34c('0x1d')]],'as':_0x104bc7['as'],'attributes':_0x104bc7[_0xf34c('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xf34c('0xa')](function(_0x26ed7e){logger['info'](_0xf34c('0x14'),_0x377f28);logger[_0xf34c('0xd')](_0xf34c('0x14'),_0x377f28,JSON[_0xf34c('0xf')](_0x26ed7e));_0x15c4a4(_0x26ed7e);})[_0xf34c('0x1f')](function(_0xfea401){logger[_0xf34c('0x10')](_0xf34c('0x14'),_0xfea401['message'],_0x377f28);_0xbdff5c(_0x217521[_0xf34c('0x10')](0x1f4,_0xfea401[_0xf34c('0x12')]));});});}; \ No newline at end of file +var _0x3bf3=['info','Template,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','GetTemplate','Template','options','raw','where','attributes','limit','include','map','model','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','then'];(function(_0x34e529,_0x49ded4){var _0x2c0195=function(_0x2d8405){while(--_0x2d8405){_0x34e529['push'](_0x34e529['shift']());}};_0x2c0195(++_0x49ded4);}(_0x3bf3,0x168));var _0x33bf=function(_0x3a8dc1,_0x2f03b8){_0x3a8dc1=_0x3a8dc1-0x0;var _0x4b3595=_0x3bf3[_0x3a8dc1];return _0x4b3595;};'use strict';var _=require('lodash');var util=require(_0x33bf('0x0'));var moment=require(_0x33bf('0x1'));var BPromise=require(_0x33bf('0x2'));var rs=require(_0x33bf('0x3'));var fs=require('fs');var Redis=require(_0x33bf('0x4'));var db=require(_0x33bf('0x5'))['db'];var utils=require(_0x33bf('0x6'));var logger=require(_0x33bf('0x7'))(_0x33bf('0x8'));var config=require('../../config/environment');var jayson=require(_0x33bf('0x9'));var client=jayson['client'][_0x33bf('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d4fc4,_0x49a9f2,_0x54d2e5){return new BPromise(function(_0x86a69f,_0x340c65){return client['request'](_0x1d4fc4,_0x54d2e5)[_0x33bf('0xb')](function(_0xa3db37){logger[_0x33bf('0xc')](_0x33bf('0xd'),_0x49a9f2,_0x33bf('0xe'));logger[_0x33bf('0xf')]('Template,\x20%s,\x20%s,\x20%s',_0x49a9f2,_0x33bf('0xe'),JSON[_0x33bf('0x10')](_0xa3db37));if(_0xa3db37[_0x33bf('0x11')]){if(_0xa3db37[_0x33bf('0x11')][_0x33bf('0x12')]===0x1f4){logger[_0x33bf('0x11')](_0x33bf('0xd'),_0x49a9f2,_0xa3db37['error'][_0x33bf('0x13')]);return _0x340c65(_0xa3db37['error']['message']);}logger[_0x33bf('0x11')]('Template,\x20%s,\x20%s',_0x49a9f2,_0xa3db37[_0x33bf('0x11')][_0x33bf('0x13')]);return _0x86a69f(_0xa3db37[_0x33bf('0x11')][_0x33bf('0x13')]);}else{logger['info'](_0x33bf('0xd'),_0x49a9f2,'request\x20sent');_0x86a69f(_0xa3db37['result']['message']);}})[_0x33bf('0x14')](function(_0x39ad7d){logger[_0x33bf('0x11')](_0x33bf('0xd'),_0x49a9f2,_0x39ad7d);_0x340c65(_0x39ad7d);});});}exports[_0x33bf('0x15')]=function(_0x1f3b89){var _0x2b8358=this;return new Promise(function(_0x1a0ea8,_0x4502a8){return db[_0x33bf('0x16')]['findAll']({'raw':_0x1f3b89['options']?_0x1f3b89[_0x33bf('0x17')][_0x33bf('0x18')]===undefined?!![]:![]:!![],'where':_0x1f3b89['options']?_0x1f3b89[_0x33bf('0x17')][_0x33bf('0x19')]||null:null,'attributes':_0x1f3b89['options']?_0x1f3b89['options'][_0x33bf('0x1a')]||null:null,'limit':_0x1f3b89['options']?_0x1f3b89[_0x33bf('0x17')][_0x33bf('0x1b')]||null:null,'include':_0x1f3b89[_0x33bf('0x17')]?_0x1f3b89['options'][_0x33bf('0x1c')]?_[_0x33bf('0x1d')](_0x1f3b89[_0x33bf('0x17')][_0x33bf('0x1c')],function(_0x39a190){return{'model':db[_0x39a190[_0x33bf('0x1e')]],'as':_0x39a190['as'],'attributes':_0x39a190[_0x33bf('0x1a')],'include':_0x39a190[_0x33bf('0x1c')]?_[_0x33bf('0x1d')](_0x39a190['include'],function(_0x355a19){return{'model':db[_0x355a19[_0x33bf('0x1e')]],'as':_0x355a19['as'],'attributes':_0x355a19['attributes'],'include':_0x355a19[_0x33bf('0x1c')]?_[_0x33bf('0x1d')](_0x355a19[_0x33bf('0x1c')],function(_0x4556e9){return{'model':db[_0x4556e9[_0x33bf('0x1e')]],'as':_0x4556e9['as'],'attributes':_0x4556e9['attributes']};}):[]};}):[]};}):[]:[]})[_0x33bf('0xb')](function(_0x34529a){logger[_0x33bf('0xc')](_0x33bf('0x15'),_0x1f3b89);logger[_0x33bf('0xf')](_0x33bf('0x15'),_0x1f3b89,JSON[_0x33bf('0x10')](_0x34529a));_0x1a0ea8(_0x34529a);})[_0x33bf('0x14')](function(_0x57cf82){logger[_0x33bf('0x11')]('GetTemplate',_0x57cf82[_0x33bf('0x13')],_0x1f3b89);_0x4502a8(_0x2b8358[_0x33bf('0x11')](0x1f4,_0x57cf82[_0x33bf('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index bb4ce7a..b5a7165 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 _0xaed4=['update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./trigger.controller','get','index','/:id','isAuthenticated','show','/:id/all_conditions','getAllConditions','/:id/any_conditions','getAnyConditions','getActions','post','create','addAllCondition','addAnyCondition','/:id/actions','addAction','put'];(function(_0x22b5df,_0x4f90ec){var _0x343351=function(_0x3972cd){while(--_0x3972cd){_0x22b5df['push'](_0x22b5df['shift']());}};_0x343351(++_0x4f90ec);}(_0xaed4,0xf4));var _0x4aed=function(_0x11aa01,_0x3a3fba){_0x11aa01=_0x11aa01-0x0;var _0x459dfd=_0xaed4[_0x11aa01];return _0x459dfd;};'use strict';var multer=require(_0x4aed('0x0'));var util=require('util');var path=require(_0x4aed('0x1'));var timeout=require(_0x4aed('0x2'));var express=require(_0x4aed('0x3'));var router=express[_0x4aed('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4aed('0x5'));var interaction=require(_0x4aed('0x6'));var config=require(_0x4aed('0x7'));var controller=require(_0x4aed('0x8'));router[_0x4aed('0x9')]('/',auth['isAuthenticated'](),controller[_0x4aed('0xa')]);router[_0x4aed('0x9')](_0x4aed('0xb'),auth[_0x4aed('0xc')](),controller[_0x4aed('0xd')]);router['get'](_0x4aed('0xe'),auth['isAuthenticated'](),controller[_0x4aed('0xf')]);router[_0x4aed('0x9')](_0x4aed('0x10'),auth[_0x4aed('0xc')](),controller[_0x4aed('0x11')]);router[_0x4aed('0x9')]('/:id/actions',auth['isAuthenticated'](),controller[_0x4aed('0x12')]);router[_0x4aed('0x13')]('/',auth[_0x4aed('0xc')](),controller[_0x4aed('0x14')]);router['post'](_0x4aed('0xe'),auth['isAuthenticated'](),controller[_0x4aed('0x15')]);router[_0x4aed('0x13')](_0x4aed('0x10'),auth[_0x4aed('0xc')](),controller[_0x4aed('0x16')]);router['post'](_0x4aed('0x17'),auth[_0x4aed('0xc')](),controller[_0x4aed('0x18')]);router[_0x4aed('0x19')]('/:id',auth['isAuthenticated'](),controller[_0x4aed('0x1a')]);router[_0x4aed('0x1b')](_0x4aed('0xb'),auth[_0x4aed('0xc')](),controller[_0x4aed('0x1c')]);module[_0x4aed('0x1d')]=router; \ No newline at end of file +var _0x1939=['/:id','show','/:id/all_conditions','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions','getActions','post','addAllCondition','addAnyCondition','addAction','put','update','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trigger.controller','get','isAuthenticated','index'];(function(_0x391a2b,_0x4943c7){var _0x5a9cc3=function(_0x4fc012){while(--_0x4fc012){_0x391a2b['push'](_0x391a2b['shift']());}};_0x5a9cc3(++_0x4943c7);}(_0x1939,0xbf));var _0x9193=function(_0x260478,_0x2040a1){_0x260478=_0x260478-0x0;var _0x4048fb=_0x1939[_0x260478];return _0x4048fb;};'use strict';var multer=require(_0x9193('0x0'));var util=require(_0x9193('0x1'));var path=require(_0x9193('0x2'));var timeout=require('connect-timeout');var express=require(_0x9193('0x3'));var router=express['Router']();var fs_extra=require(_0x9193('0x4'));var auth=require(_0x9193('0x5'));var interaction=require(_0x9193('0x6'));var config=require(_0x9193('0x7'));var controller=require(_0x9193('0x8'));router[_0x9193('0x9')]('/',auth[_0x9193('0xa')](),controller[_0x9193('0xb')]);router['get'](_0x9193('0xc'),auth[_0x9193('0xa')](),controller[_0x9193('0xd')]);router['get'](_0x9193('0xe'),auth[_0x9193('0xa')](),controller[_0x9193('0xf')]);router[_0x9193('0x9')](_0x9193('0x10'),auth['isAuthenticated'](),controller[_0x9193('0x11')]);router[_0x9193('0x9')](_0x9193('0x12'),auth[_0x9193('0xa')](),controller[_0x9193('0x13')]);router[_0x9193('0x14')]('/',auth['isAuthenticated'](),controller['create']);router[_0x9193('0x14')](_0x9193('0xe'),auth[_0x9193('0xa')](),controller[_0x9193('0x15')]);router[_0x9193('0x14')](_0x9193('0x10'),auth[_0x9193('0xa')](),controller[_0x9193('0x16')]);router[_0x9193('0x14')](_0x9193('0x12'),auth[_0x9193('0xa')](),controller[_0x9193('0x17')]);router[_0x9193('0x18')](_0x9193('0xc'),auth[_0x9193('0xa')](),controller[_0x9193('0x19')]);router[_0x9193('0x1a')](_0x9193('0xc'),auth[_0x9193('0xa')](),controller[_0x9193('0x1b')]);module[_0x9193('0x1c')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index 113c268..cef4e7e 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 _0x4389=['BOOLEAN','sequelize','exports','STRING'];(function(_0xbe200f,_0x4b50eb){var _0x192597=function(_0x106cfd){while(--_0x106cfd){_0xbe200f['push'](_0xbe200f['shift']());}};_0x192597(++_0x4b50eb);}(_0x4389,0xfd));var _0x9438=function(_0x24fc8b,_0x120357){_0x24fc8b=_0x24fc8b-0x0;var _0x10b899=_0x4389[_0x24fc8b];return _0x10b899;};'use strict';var Sequelize=require(_0x9438('0x0'));module[_0x9438('0x1')]={'name':{'type':Sequelize[_0x9438('0x2')]},'channel':{'type':Sequelize[_0x9438('0x2')]},'description':{'type':Sequelize[_0x9438('0x2')]},'status':{'type':Sequelize[_0x9438('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x610f=['sequelize','STRING','BOOLEAN'];(function(_0x166bc4,_0xb45bc){var _0x96630f=function(_0x57ca6f){while(--_0x57ca6f){_0x166bc4['push'](_0x166bc4['shift']());}};_0x96630f(++_0xb45bc);}(_0x610f,0xe4));var _0xf610=function(_0x25e1a2,_0x8d3307){_0x25e1a2=_0x25e1a2-0x0;var _0x40a473=_0x610f[_0x25e1a2];return _0x40a473;};'use strict';var Sequelize=require(_0xf610('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xf610('0x1')]},'description':{'type':Sequelize[_0xf610('0x1')]},'status':{'type':Sequelize[_0xf610('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index 918afec..114aa90 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 _0xf09e=['getAnyConditions','addAction','Action','getActions','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','destroy','get','error','stack','name','map','Trigger','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','rows','catch','show','params','includeAll','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addAllCondition','Condition','addAnyCondition','TriggerAnyId','getAllConditions','findOne'];(function(_0x4de586,_0x183427){var _0x46baf5=function(_0x1157f0){while(--_0x1157f0){_0x4de586['push'](_0x4de586['shift']());}};_0x46baf5(++_0x183427);}(_0xf09e,0x112));var _0xef09=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xf09e[_0x21a9d9];return _0x46adce;};'use strict';var emlformat=require(_0xef09('0x0'));var rimraf=require(_0xef09('0x1'));var zipdir=require(_0xef09('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xef09('0x3'));var BPromise=require(_0xef09('0x4'));var Mustache=require(_0xef09('0x5'));var util=require(_0xef09('0x6'));var path=require('path');var sox=require(_0xef09('0x7'));var csv=require(_0xef09('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xef09('0x9'));var squel=require(_0xef09('0xa'));var crypto=require(_0xef09('0xb'));var jsforce=require(_0xef09('0xc'));var deskjs=require(_0xef09('0xd'));var toCsv=require('to-csv');var querystring=require(_0xef09('0xe'));var Papa=require('papaparse');var Redis=require(_0xef09('0xf'));var authService=require(_0xef09('0x10'));var qs=require(_0xef09('0x11'));var as=require(_0xef09('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xef09('0x13'));var utils=require(_0xef09('0x14'));var config=require(_0xef09('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xef09('0x16'))['db'];function respondWithStatusCode(_0x5759da,_0x4146c2){_0x4146c2=_0x4146c2||0xcc;return function(_0xf33d58){if(_0xf33d58){return _0x5759da[_0xef09('0x17')](_0x4146c2);}return _0x5759da[_0xef09('0x18')](_0x4146c2)[_0xef09('0x19')]();};}function respondWithResult(_0x488df1,_0x28712c){_0x28712c=_0x28712c||0xc8;return function(_0x2b8cde){if(_0x2b8cde){return _0x488df1[_0xef09('0x18')](_0x28712c)['json'](_0x2b8cde);}};}function respondWithFilteredResult(_0x1dc49b,_0x288961){return function(_0x42716a){if(_0x42716a){var _0x45e4fd=typeof _0x288961[_0xef09('0x1a')]===_0xef09('0x1b')&&typeof _0x288961[_0xef09('0x1c')]===_0xef09('0x1b');var _0x35ac75=_0x42716a['count'];var _0x4fd03e=_0x45e4fd?0x0:_0x288961[_0xef09('0x1a')];var _0x6a4abd=_0x45e4fd?_0x42716a[_0xef09('0x1d')]:_0x288961[_0xef09('0x1a')]+_0x288961['limit'];var _0x476c56;if(_0x6a4abd>=_0x35ac75){_0x6a4abd=_0x35ac75;_0x476c56=0xc8;}else{_0x476c56=0xce;}_0x1dc49b[_0xef09('0x18')](_0x476c56);return _0x1dc49b[_0xef09('0x1e')](_0xef09('0x1f'),_0x4fd03e+'-'+_0x6a4abd+'/'+_0x35ac75)[_0xef09('0x20')](_0x42716a);}return null;};}function patchUpdates(_0x34be3a){return function(_0x81ae12){try{jsonpatch[_0xef09('0x21')](_0x81ae12,_0x34be3a,!![]);}catch(_0x298c28){return BPromise['reject'](_0x298c28);}return _0x81ae12[_0xef09('0x22')]();};}function saveUpdates(_0x3551bc,_0x362185){return function(_0x1d9107){if(_0x1d9107){return _0x1d9107[_0xef09('0x23')](_0x3551bc)[_0xef09('0x24')](function(_0x5334ca){return _0x5334ca;});}return null;};}function removeEntity(_0x593afe,_0x4e788d){return function(_0x13c3dd){if(_0x13c3dd){return _0x13c3dd[_0xef09('0x25')]()[_0xef09('0x24')](function(){var _0x3a6aa3=_0x13c3dd[_0xef09('0x26')]({'plain':!![]});var _0x4b02cd='Triggers';return db['UserProfileResource'][_0xef09('0x25')]({'where':{'type':_0x4b02cd,'resourceId':_0x3a6aa3['id']}})[_0xef09('0x24')](function(){return _0x13c3dd;});})[_0xef09('0x24')](function(){_0x593afe['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2dda75,_0x32a005){return function(_0x1617af){if(!_0x1617af){_0x2dda75[_0xef09('0x17')](0x194);}return _0x1617af;};}function handleError(_0x38e52b,_0x14c80f){_0x14c80f=_0x14c80f||0x1f4;return function(_0x190c58){logger[_0xef09('0x27')](_0x190c58[_0xef09('0x28')]);if(_0x190c58[_0xef09('0x29')]){delete _0x190c58[_0xef09('0x29')];}_0x38e52b[_0xef09('0x18')](_0x14c80f)['send'](_0x190c58);};}exports['index']=function(_0x1e21ba,_0x4baf57){var _0x28aad={},_0x22a6c9={},_0x2fb8b5={'count':0x0,'rows':[]};var _0x7ec1c7=_[_0xef09('0x2a')](db[_0xef09('0x2b')][_0xef09('0x2c')],function(_0x4f3c1b){return{'name':_0x4f3c1b[_0xef09('0x2d')],'type':_0x4f3c1b[_0xef09('0x2e')][_0xef09('0x2f')]};});_0x22a6c9[_0xef09('0x30')]=_[_0xef09('0x2a')](_0x7ec1c7,_0xef09('0x29'));_0x22a6c9['query']=_[_0xef09('0x31')](_0x1e21ba[_0xef09('0x32')]);_0x22a6c9[_0xef09('0x33')]=_[_0xef09('0x34')](_0x22a6c9['model'],_0x22a6c9[_0xef09('0x32')]);_0x28aad[_0xef09('0x35')]=_[_0xef09('0x34')](_0x22a6c9[_0xef09('0x30')],qs['fields'](_0x1e21ba[_0xef09('0x32')][_0xef09('0x36')]));_0x28aad[_0xef09('0x35')]=_0x28aad[_0xef09('0x35')][_0xef09('0x37')]?_0x28aad['attributes']:_0x22a6c9['model'];if(!_0x1e21ba[_0xef09('0x32')][_0xef09('0x38')](_0xef09('0x39'))){_0x28aad[_0xef09('0x1c')]=qs[_0xef09('0x1c')](_0x1e21ba[_0xef09('0x32')][_0xef09('0x1c')]);_0x28aad[_0xef09('0x1a')]=qs[_0xef09('0x1a')](_0x1e21ba[_0xef09('0x32')][_0xef09('0x1a')]);}_0x28aad[_0xef09('0x3a')]=qs[_0xef09('0x3b')](_0x1e21ba[_0xef09('0x32')][_0xef09('0x3b')]);_0x28aad[_0xef09('0x3c')]=qs[_0xef09('0x33')](_[_0xef09('0x3d')](_0x1e21ba['query'],_0x22a6c9[_0xef09('0x33')]),_0x7ec1c7);if(_0x1e21ba[_0xef09('0x32')][_0xef09('0x3e')]){_0x28aad[_0xef09('0x3c')]=_[_0xef09('0x3f')](_0x28aad['where'],{'$or':_[_0xef09('0x2a')](_0x7ec1c7,function(_0x55215d){if(_0x55215d[_0xef09('0x2e')]!==_0xef09('0x40')){var _0x18ddcc={};_0x18ddcc[_0x55215d[_0xef09('0x29')]]={'$like':'%'+_0x1e21ba[_0xef09('0x32')][_0xef09('0x3e')]+'%'};return _0x18ddcc;}})});}_0x28aad=_[_0xef09('0x3f')]({},_0x28aad,_0x1e21ba[_0xef09('0x41')]);var _0x3b4ff4={'where':_0x28aad[_0xef09('0x3c')]};return db[_0xef09('0x2b')]['count'](_0x3b4ff4)[_0xef09('0x24')](function(_0x4642ee){_0x2fb8b5[_0xef09('0x1d')]=_0x4642ee;if(_0x1e21ba[_0xef09('0x32')]['includeAll']){_0x28aad['include']=[{'all':!![]}];}return db[_0xef09('0x2b')]['findAll'](_0x28aad);})[_0xef09('0x24')](function(_0x1829f4){_0x2fb8b5[_0xef09('0x42')]=_0x1829f4;return _0x2fb8b5;})[_0xef09('0x24')](respondWithFilteredResult(_0x4baf57,_0x28aad))[_0xef09('0x43')](handleError(_0x4baf57,null));};exports[_0xef09('0x44')]=function(_0x4a8324,_0x34ea07){var _0x1a5ba9={'raw':![],'where':{'id':_0x4a8324[_0xef09('0x45')]['id']}},_0x5af931={};_0x5af931['model']=_[_0xef09('0x31')](db[_0xef09('0x2b')][_0xef09('0x2c')]);_0x5af931['query']=_['keys'](_0x4a8324['query']);_0x5af931[_0xef09('0x33')]=_[_0xef09('0x34')](_0x5af931[_0xef09('0x30')],_0x5af931['query']);_0x1a5ba9[_0xef09('0x35')]=_[_0xef09('0x34')](_0x5af931[_0xef09('0x30')],qs[_0xef09('0x36')](_0x4a8324[_0xef09('0x32')]['fields']));_0x1a5ba9[_0xef09('0x35')]=_0x1a5ba9['attributes'][_0xef09('0x37')]?_0x1a5ba9['attributes']:_0x5af931[_0xef09('0x30')];if(_0x4a8324[_0xef09('0x32')][_0xef09('0x46')]){_0x1a5ba9[_0xef09('0x47')]=[{'all':!![]}];}_0x1a5ba9=_[_0xef09('0x3f')]({},_0x1a5ba9,_0x4a8324[_0xef09('0x41')]);return db[_0xef09('0x2b')][_0xef09('0x48')](_0x1a5ba9)[_0xef09('0x24')](handleEntityNotFound(_0x34ea07,null))[_0xef09('0x24')](respondWithResult(_0x34ea07,null))[_0xef09('0x43')](handleError(_0x34ea07,null));};exports[_0xef09('0x49')]=function(_0x1becf9,_0x3823df){return db[_0xef09('0x2b')][_0xef09('0x49')](_0x1becf9[_0xef09('0x4a')],{})['then'](function(_0xbfa2bb){var _0xa7b74f=_0x1becf9[_0xef09('0x4b')][_0xef09('0x26')]({'plain':!![]});if(!_0xa7b74f)throw new Error(_0xef09('0x4c'));if(_0xa7b74f['role']==='user'){var _0x51c22d=_0xbfa2bb['get']({'plain':!![]});var _0x56da5d='Triggers';return db['UserProfileSection']['find']({'where':{'name':_0x56da5d,'userProfileId':_0xa7b74f['userProfileId']},'raw':!![]})['then'](function(_0x49fa9a){if(_0x49fa9a&&_0x49fa9a[_0xef09('0x4d')]===0x0){return db[_0xef09('0x4e')][_0xef09('0x49')]({'name':_0x51c22d[_0xef09('0x29')],'resourceId':_0x51c22d['id'],'type':_0x49fa9a[_0xef09('0x29')],'sectionId':_0x49fa9a['id']},{})[_0xef09('0x24')](function(){return _0xbfa2bb;});}else{return _0xbfa2bb;}})[_0xef09('0x43')](function(_0x2dc79a){logger[_0xef09('0x27')](_0xef09('0x4f'),_0x2dc79a);throw _0x2dc79a;});}return _0xbfa2bb;})[_0xef09('0x24')](respondWithResult(_0x3823df,0xc9))[_0xef09('0x43')](handleError(_0x3823df,null));};exports[_0xef09('0x23')]=function(_0x128ef7,_0x13a548){if(_0x128ef7['body']['id']){delete _0x128ef7[_0xef09('0x4a')]['id'];}return db[_0xef09('0x2b')]['find']({'where':{'id':_0x128ef7[_0xef09('0x45')]['id']}})[_0xef09('0x24')](handleEntityNotFound(_0x13a548,null))[_0xef09('0x24')](saveUpdates(_0x128ef7[_0xef09('0x4a')],null))[_0xef09('0x24')](respondWithResult(_0x13a548,null))[_0xef09('0x43')](handleError(_0x13a548,null));};exports[_0xef09('0x25')]=function(_0x387b95,_0xe23a90){return db[_0xef09('0x2b')]['find']({'where':{'id':_0x387b95['params']['id']}})[_0xef09('0x24')](handleEntityNotFound(_0xe23a90,null))[_0xef09('0x24')](removeEntity(_0xe23a90,null))[_0xef09('0x43')](handleError(_0xe23a90,null));};exports[_0xef09('0x50')]=function(_0x31da5c,_0x517b3a,_0x2acaca){if(_0x31da5c[_0xef09('0x4a')]['id']){delete _0x31da5c[_0xef09('0x4a')]['id'];}return db[_0xef09('0x2b')][_0xef09('0x48')]({'where':{'id':_0x31da5c[_0xef09('0x45')]['id']}})[_0xef09('0x24')](handleEntityNotFound(_0x517b3a,null))[_0xef09('0x24')](function(_0x34f89f){if(_0x34f89f){_0x31da5c[_0xef09('0x4a')]['TriggerAllId']=_0x34f89f['id'];return db[_0xef09('0x51')][_0xef09('0x49')](_0x31da5c[_0xef09('0x4a')]);}})[_0xef09('0x24')](respondWithResult(_0x517b3a,null))[_0xef09('0x43')](handleError(_0x517b3a,null));};exports[_0xef09('0x52')]=function(_0x14899b,_0x4bda28,_0x49a728){if(_0x14899b[_0xef09('0x4a')]['id']){delete _0x14899b[_0xef09('0x4a')]['id'];}return db[_0xef09('0x2b')]['find']({'where':{'id':_0x14899b[_0xef09('0x45')]['id']}})[_0xef09('0x24')](handleEntityNotFound(_0x4bda28,null))[_0xef09('0x24')](function(_0x2b6da0){if(_0x2b6da0){_0x14899b[_0xef09('0x4a')][_0xef09('0x53')]=_0x2b6da0['id'];return db[_0xef09('0x51')][_0xef09('0x49')](_0x14899b[_0xef09('0x4a')]);}})['then'](respondWithResult(_0x4bda28,null))[_0xef09('0x43')](handleError(_0x4bda28,null));};exports[_0xef09('0x54')]=function(_0x180527,_0x1d2085,_0x40428c){var _0x4f8b1c={};var _0x4e28bd={};var _0x7177d9;var _0x3846c8;return db[_0xef09('0x2b')][_0xef09('0x55')]({'where':{'id':_0x180527[_0xef09('0x45')]['id']}})[_0xef09('0x24')](handleEntityNotFound(_0x1d2085,null))[_0xef09('0x24')](function(_0x4ce993){if(_0x4ce993){_0x7177d9=_0x4ce993;_0x4e28bd[_0xef09('0x30')]=_[_0xef09('0x31')](db[_0xef09('0x51')][_0xef09('0x2c')]);_0x4e28bd[_0xef09('0x32')]=_[_0xef09('0x31')](_0x180527[_0xef09('0x32')]);_0x4e28bd['filters']=_['intersection'](_0x4e28bd[_0xef09('0x30')],_0x4e28bd['query']);_0x4f8b1c['attributes']=_['intersection'](_0x4e28bd['model'],qs[_0xef09('0x36')](_0x180527[_0xef09('0x32')][_0xef09('0x36')]));_0x4f8b1c[_0xef09('0x35')]=_0x4f8b1c['attributes'][_0xef09('0x37')]?_0x4f8b1c[_0xef09('0x35')]:_0x4e28bd[_0xef09('0x30')];_0x4f8b1c[_0xef09('0x3a')]=qs[_0xef09('0x3b')](_0x180527[_0xef09('0x32')][_0xef09('0x3b')]);_0x4f8b1c[_0xef09('0x3c')]=qs[_0xef09('0x33')](_[_0xef09('0x3d')](_0x180527[_0xef09('0x32')],_0x4e28bd[_0xef09('0x33')]));if(_0x180527[_0xef09('0x32')][_0xef09('0x3e')]){_0x4f8b1c[_0xef09('0x3c')]=_['merge'](_0x4f8b1c[_0xef09('0x3c')],{'$or':_[_0xef09('0x2a')](_0x4f8b1c[_0xef09('0x35')],function(_0x5ce4cb){var _0xc38db0={};_0xc38db0[_0x5ce4cb]={'$like':'%'+_0x180527[_0xef09('0x32')]['filter']+'%'};return _0xc38db0;})});}_0x4f8b1c=_[_0xef09('0x3f')]({},_0x4f8b1c,_0x180527[_0xef09('0x41')]);return _0x7177d9[_0xef09('0x54')](_0x4f8b1c);}})[_0xef09('0x24')](function(_0x3dc5d9){if(_0x3dc5d9){_0x3846c8=_0x3dc5d9[_0xef09('0x37')];if(!_0x180527[_0xef09('0x32')][_0xef09('0x38')](_0xef09('0x39'))){_0x4f8b1c[_0xef09('0x1c')]=qs[_0xef09('0x1c')](_0x180527[_0xef09('0x32')][_0xef09('0x1c')]);_0x4f8b1c[_0xef09('0x1a')]=qs[_0xef09('0x1a')](_0x180527[_0xef09('0x32')][_0xef09('0x1a')]);}return _0x7177d9[_0xef09('0x54')](_0x4f8b1c);}})['then'](function(_0x4f75ef){if(_0x4f75ef){return _0x4f75ef?{'count':_0x3846c8,'rows':_0x4f75ef}:null;}})[_0xef09('0x24')](respondWithResult(_0x1d2085,null))[_0xef09('0x43')](handleError(_0x1d2085,null));};exports[_0xef09('0x56')]=function(_0x1bb157,_0x5bc248,_0x5cc86f){var _0x3bc0aa={};var _0x169e95={};var _0xdadcf8;var _0x3cef36;return db['Trigger'][_0xef09('0x55')]({'where':{'id':_0x1bb157[_0xef09('0x45')]['id']}})['then'](handleEntityNotFound(_0x5bc248,null))[_0xef09('0x24')](function(_0x4965a0){if(_0x4965a0){_0xdadcf8=_0x4965a0;_0x169e95[_0xef09('0x30')]=_[_0xef09('0x31')](db[_0xef09('0x51')]['rawAttributes']);_0x169e95['query']=_[_0xef09('0x31')](_0x1bb157[_0xef09('0x32')]);_0x169e95[_0xef09('0x33')]=_[_0xef09('0x34')](_0x169e95[_0xef09('0x30')],_0x169e95['query']);_0x3bc0aa[_0xef09('0x35')]=_[_0xef09('0x34')](_0x169e95[_0xef09('0x30')],qs[_0xef09('0x36')](_0x1bb157[_0xef09('0x32')][_0xef09('0x36')]));_0x3bc0aa[_0xef09('0x35')]=_0x3bc0aa[_0xef09('0x35')][_0xef09('0x37')]?_0x3bc0aa[_0xef09('0x35')]:_0x169e95['model'];_0x3bc0aa['order']=qs[_0xef09('0x3b')](_0x1bb157[_0xef09('0x32')][_0xef09('0x3b')]);_0x3bc0aa[_0xef09('0x3c')]=qs[_0xef09('0x33')](_[_0xef09('0x3d')](_0x1bb157[_0xef09('0x32')],_0x169e95[_0xef09('0x33')]));if(_0x1bb157[_0xef09('0x32')][_0xef09('0x3e')]){_0x3bc0aa[_0xef09('0x3c')]=_[_0xef09('0x3f')](_0x3bc0aa['where'],{'$or':_[_0xef09('0x2a')](_0x3bc0aa[_0xef09('0x35')],function(_0x55d919){var _0x4e1edc={};_0x4e1edc[_0x55d919]={'$like':'%'+_0x1bb157[_0xef09('0x32')][_0xef09('0x3e')]+'%'};return _0x4e1edc;})});}_0x3bc0aa=_['merge']({},_0x3bc0aa,_0x1bb157['options']);return _0xdadcf8[_0xef09('0x56')](_0x3bc0aa);}})[_0xef09('0x24')](function(_0x1e90e0){if(_0x1e90e0){_0x3cef36=_0x1e90e0[_0xef09('0x37')];if(!_0x1bb157['query'][_0xef09('0x38')]('nolimit')){_0x3bc0aa['limit']=qs[_0xef09('0x1c')](_0x1bb157[_0xef09('0x32')][_0xef09('0x1c')]);_0x3bc0aa[_0xef09('0x1a')]=qs['offset'](_0x1bb157['query']['offset']);}return _0xdadcf8[_0xef09('0x56')](_0x3bc0aa);}})[_0xef09('0x24')](function(_0x215164){if(_0x215164){return _0x215164?{'count':_0x3cef36,'rows':_0x215164}:null;}})[_0xef09('0x24')](respondWithResult(_0x5bc248,null))[_0xef09('0x43')](handleError(_0x5bc248,null));};exports[_0xef09('0x57')]=function(_0x4dae2d,_0x23400e,_0x445d2b){if(_0x4dae2d[_0xef09('0x4a')]['id']){delete _0x4dae2d['body']['id'];}return db[_0xef09('0x2b')][_0xef09('0x48')]({'where':{'id':_0x4dae2d[_0xef09('0x45')]['id']}})['then'](handleEntityNotFound(_0x23400e,null))['then'](function(_0x30531f){if(_0x30531f){_0x4dae2d[_0xef09('0x4a')]['TriggerId']=_0x30531f['id'];return db[_0xef09('0x58')][_0xef09('0x49')](_0x4dae2d[_0xef09('0x4a')]);}})[_0xef09('0x24')](respondWithResult(_0x23400e,null))['catch'](handleError(_0x23400e,null));};exports[_0xef09('0x59')]=function(_0x558ca7,_0x1c502a,_0x23ff74){var _0x3d1e9d={};var _0x2eec3a={};var _0x35655f;var _0x456786;return db[_0xef09('0x2b')][_0xef09('0x55')]({'where':{'id':_0x558ca7[_0xef09('0x45')]['id']}})['then'](handleEntityNotFound(_0x1c502a,null))[_0xef09('0x24')](function(_0x15d435){if(_0x15d435){_0x35655f=_0x15d435;_0x2eec3a[_0xef09('0x30')]=_[_0xef09('0x31')](db['Action'][_0xef09('0x2c')]);_0x2eec3a['query']=_[_0xef09('0x31')](_0x558ca7['query']);_0x2eec3a[_0xef09('0x33')]=_[_0xef09('0x34')](_0x2eec3a[_0xef09('0x30')],_0x2eec3a[_0xef09('0x32')]);_0x3d1e9d[_0xef09('0x35')]=_[_0xef09('0x34')](_0x2eec3a[_0xef09('0x30')],qs[_0xef09('0x36')](_0x558ca7[_0xef09('0x32')][_0xef09('0x36')]));_0x3d1e9d[_0xef09('0x35')]=_0x3d1e9d[_0xef09('0x35')]['length']?_0x3d1e9d[_0xef09('0x35')]:_0x2eec3a[_0xef09('0x30')];_0x3d1e9d[_0xef09('0x3a')]=qs[_0xef09('0x3b')](_0x558ca7[_0xef09('0x32')]['sort']);_0x3d1e9d[_0xef09('0x3c')]=qs[_0xef09('0x33')](_['pick'](_0x558ca7[_0xef09('0x32')],_0x2eec3a[_0xef09('0x33')]));if(_0x558ca7[_0xef09('0x32')][_0xef09('0x3e')]){_0x3d1e9d[_0xef09('0x3c')]=_[_0xef09('0x3f')](_0x3d1e9d[_0xef09('0x3c')],{'$or':_[_0xef09('0x2a')](_0x3d1e9d[_0xef09('0x35')],function(_0x1f8f5b){var _0x5a1bb5={};_0x5a1bb5[_0x1f8f5b]={'$like':'%'+_0x558ca7[_0xef09('0x32')][_0xef09('0x3e')]+'%'};return _0x5a1bb5;})});}_0x3d1e9d=_[_0xef09('0x3f')]({},_0x3d1e9d,_0x558ca7[_0xef09('0x41')]);return _0x35655f[_0xef09('0x59')](_0x3d1e9d);}})['then'](function(_0x31616d){if(_0x31616d){_0x456786=_0x31616d[_0xef09('0x37')];if(!_0x558ca7[_0xef09('0x32')][_0xef09('0x38')](_0xef09('0x39'))){_0x3d1e9d[_0xef09('0x1c')]=qs[_0xef09('0x1c')](_0x558ca7[_0xef09('0x32')][_0xef09('0x1c')]);_0x3d1e9d[_0xef09('0x1a')]=qs['offset'](_0x558ca7[_0xef09('0x32')]['offset']);}return _0x35655f[_0xef09('0x59')](_0x3d1e9d);}})[_0xef09('0x24')](function(_0x18e094){if(_0x18e094){return _0x18e094?{'count':_0x456786,'rows':_0x18e094}:null;}})[_0xef09('0x24')](respondWithResult(_0x1c502a,null))[_0xef09('0x43')](handleError(_0x1c502a,null));}; \ No newline at end of file +var _0x2e65=['TriggerId','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','apply','reject','update','then','destroy','get','Triggers','UserProfileResource','error','stack','send','index','Trigger','type','key','model','map','name','query','keys','filters','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','rows','catch','params','rawAttributes','attributes','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','body','addAllCondition','Condition','TriggerAnyId','getAllConditions','findOne','order','length','getAnyConditions','addAction'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2e65,0x120));var _0x52e6=function(_0x3a2a3c,_0x37bd31){_0x3a2a3c=_0x3a2a3c-0x0;var _0x50ac9a=_0x2e65[_0x3a2a3c];return _0x50ac9a;};'use strict';var emlformat=require(_0x52e6('0x0'));var rimraf=require(_0x52e6('0x1'));var zipdir=require(_0x52e6('0x2'));var jsonpatch=require(_0x52e6('0x3'));var rp=require(_0x52e6('0x4'));var moment=require('moment');var BPromise=require(_0x52e6('0x5'));var Mustache=require(_0x52e6('0x6'));var util=require('util');var path=require(_0x52e6('0x7'));var sox=require(_0x52e6('0x8'));var csv=require(_0x52e6('0x9'));var ejs=require(_0x52e6('0xa'));var fs=require('fs');var fs_extra=require(_0x52e6('0xb'));var _=require('lodash');var squel=require(_0x52e6('0xc'));var crypto=require(_0x52e6('0xd'));var jsforce=require(_0x52e6('0xe'));var deskjs=require(_0x52e6('0xf'));var toCsv=require('to-csv');var querystring=require(_0x52e6('0x10'));var Papa=require(_0x52e6('0x11'));var Redis=require(_0x52e6('0x12'));var authService=require(_0x52e6('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x52e6('0x14'));var logger=require(_0x52e6('0x15'))(_0x52e6('0x16'));var utils=require('../../config/utils');var config=require(_0x52e6('0x17'));var licenseUtil=require(_0x52e6('0x18'));var db=require(_0x52e6('0x19'))['db'];function respondWithStatusCode(_0x559847,_0x17908c){_0x17908c=_0x17908c||0xcc;return function(_0x29da87){if(_0x29da87){return _0x559847[_0x52e6('0x1a')](_0x17908c);}return _0x559847[_0x52e6('0x1b')](_0x17908c)[_0x52e6('0x1c')]();};}function respondWithResult(_0x516bd2,_0x19ee67){_0x19ee67=_0x19ee67||0xc8;return function(_0x126c26){if(_0x126c26){return _0x516bd2[_0x52e6('0x1b')](_0x19ee67)[_0x52e6('0x1d')](_0x126c26);}};}function respondWithFilteredResult(_0x1b955d,_0x1a6e6b){return function(_0x451c02){if(_0x451c02){var _0x27a329=typeof _0x1a6e6b[_0x52e6('0x1e')]===_0x52e6('0x1f')&&typeof _0x1a6e6b[_0x52e6('0x20')]===_0x52e6('0x1f');var _0x54431c=_0x451c02['count'];var _0x4026c4=_0x27a329?0x0:_0x1a6e6b['offset'];var _0x27af5b=_0x27a329?_0x451c02['count']:_0x1a6e6b[_0x52e6('0x1e')]+_0x1a6e6b['limit'];var _0x5693d0;if(_0x27af5b>=_0x54431c){_0x27af5b=_0x54431c;_0x5693d0=0xc8;}else{_0x5693d0=0xce;}_0x1b955d[_0x52e6('0x1b')](_0x5693d0);return _0x1b955d[_0x52e6('0x21')]('Content-Range',_0x4026c4+'-'+_0x27af5b+'/'+_0x54431c)[_0x52e6('0x1d')](_0x451c02);}return null;};}function patchUpdates(_0x116ef2){return function(_0xa19a38){try{jsonpatch[_0x52e6('0x22')](_0xa19a38,_0x116ef2,!![]);}catch(_0x278f7c){return BPromise[_0x52e6('0x23')](_0x278f7c);}return _0xa19a38['save']();};}function saveUpdates(_0x4f5a50,_0x114ef7){return function(_0x3e7480){if(_0x3e7480){return _0x3e7480[_0x52e6('0x24')](_0x4f5a50)[_0x52e6('0x25')](function(_0x207853){return _0x207853;});}return null;};}function removeEntity(_0x54c5a6,_0x178fda){return function(_0x133137){if(_0x133137){return _0x133137[_0x52e6('0x26')]()[_0x52e6('0x25')](function(){var _0x4778f8=_0x133137[_0x52e6('0x27')]({'plain':!![]});var _0x214b1d=_0x52e6('0x28');return db[_0x52e6('0x29')][_0x52e6('0x26')]({'where':{'type':_0x214b1d,'resourceId':_0x4778f8['id']}})['then'](function(){return _0x133137;});})[_0x52e6('0x25')](function(){_0x54c5a6[_0x52e6('0x1b')](0xcc)[_0x52e6('0x1c')]();});}};}function handleEntityNotFound(_0xfd2d3,_0x3180da){return function(_0x487022){if(!_0x487022){_0xfd2d3[_0x52e6('0x1a')](0x194);}return _0x487022;};}function handleError(_0x141767,_0x1fa97c){_0x1fa97c=_0x1fa97c||0x1f4;return function(_0x507950){logger[_0x52e6('0x2a')](_0x507950[_0x52e6('0x2b')]);if(_0x507950['name']){delete _0x507950['name'];}_0x141767[_0x52e6('0x1b')](_0x1fa97c)[_0x52e6('0x2c')](_0x507950);};}exports[_0x52e6('0x2d')]=function(_0x1113d2,_0x5b703a){var _0x290fa0={},_0xe23c41={},_0xdd12a1={'count':0x0,'rows':[]};var _0x254f32=_['map'](db[_0x52e6('0x2e')]['rawAttributes'],function(_0x120c52){return{'name':_0x120c52['fieldName'],'type':_0x120c52[_0x52e6('0x2f')][_0x52e6('0x30')]};});_0xe23c41[_0x52e6('0x31')]=_[_0x52e6('0x32')](_0x254f32,_0x52e6('0x33'));_0xe23c41[_0x52e6('0x34')]=_[_0x52e6('0x35')](_0x1113d2['query']);_0xe23c41[_0x52e6('0x36')]=_['intersection'](_0xe23c41[_0x52e6('0x31')],_0xe23c41['query']);_0x290fa0['attributes']=_[_0x52e6('0x37')](_0xe23c41['model'],qs['fields'](_0x1113d2[_0x52e6('0x34')][_0x52e6('0x38')]));_0x290fa0['attributes']=_0x290fa0['attributes']['length']?_0x290fa0['attributes']:_0xe23c41['model'];if(!_0x1113d2[_0x52e6('0x34')][_0x52e6('0x39')](_0x52e6('0x3a'))){_0x290fa0[_0x52e6('0x20')]=qs[_0x52e6('0x20')](_0x1113d2[_0x52e6('0x34')][_0x52e6('0x20')]);_0x290fa0[_0x52e6('0x1e')]=qs['offset'](_0x1113d2['query'][_0x52e6('0x1e')]);}_0x290fa0['order']=qs[_0x52e6('0x3b')](_0x1113d2['query'][_0x52e6('0x3b')]);_0x290fa0[_0x52e6('0x3c')]=qs[_0x52e6('0x36')](_[_0x52e6('0x3d')](_0x1113d2[_0x52e6('0x34')],_0xe23c41[_0x52e6('0x36')]),_0x254f32);if(_0x1113d2[_0x52e6('0x34')][_0x52e6('0x3e')]){_0x290fa0[_0x52e6('0x3c')]=_[_0x52e6('0x3f')](_0x290fa0[_0x52e6('0x3c')],{'$or':_[_0x52e6('0x32')](_0x254f32,function(_0x45c809){if(_0x45c809[_0x52e6('0x2f')]!==_0x52e6('0x40')){var _0x60ff88={};_0x60ff88[_0x45c809['name']]={'$like':'%'+_0x1113d2[_0x52e6('0x34')][_0x52e6('0x3e')]+'%'};return _0x60ff88;}})});}_0x290fa0=_[_0x52e6('0x3f')]({},_0x290fa0,_0x1113d2[_0x52e6('0x41')]);var _0x22e47a={'where':_0x290fa0['where']};return db[_0x52e6('0x2e')]['count'](_0x22e47a)['then'](function(_0xcfd42c){_0xdd12a1[_0x52e6('0x42')]=_0xcfd42c;if(_0x1113d2[_0x52e6('0x34')][_0x52e6('0x43')]){_0x290fa0['include']=[{'all':!![]}];}return db[_0x52e6('0x2e')]['findAll'](_0x290fa0);})[_0x52e6('0x25')](function(_0x841db7){_0xdd12a1[_0x52e6('0x44')]=_0x841db7;return _0xdd12a1;})[_0x52e6('0x25')](respondWithFilteredResult(_0x5b703a,_0x290fa0))[_0x52e6('0x45')](handleError(_0x5b703a,null));};exports['show']=function(_0x46ec4b,_0x30dc7e){var _0xb92690={'raw':![],'where':{'id':_0x46ec4b[_0x52e6('0x46')]['id']}},_0x5ce764={};_0x5ce764[_0x52e6('0x31')]=_['keys'](db[_0x52e6('0x2e')][_0x52e6('0x47')]);_0x5ce764[_0x52e6('0x34')]=_[_0x52e6('0x35')](_0x46ec4b[_0x52e6('0x34')]);_0x5ce764[_0x52e6('0x36')]=_[_0x52e6('0x37')](_0x5ce764[_0x52e6('0x31')],_0x5ce764['query']);_0xb92690['attributes']=_[_0x52e6('0x37')](_0x5ce764['model'],qs[_0x52e6('0x38')](_0x46ec4b[_0x52e6('0x34')][_0x52e6('0x38')]));_0xb92690[_0x52e6('0x48')]=_0xb92690[_0x52e6('0x48')]['length']?_0xb92690[_0x52e6('0x48')]:_0x5ce764[_0x52e6('0x31')];if(_0x46ec4b[_0x52e6('0x34')][_0x52e6('0x43')]){_0xb92690[_0x52e6('0x49')]=[{'all':!![]}];}_0xb92690=_[_0x52e6('0x3f')]({},_0xb92690,_0x46ec4b[_0x52e6('0x41')]);return db['Trigger'][_0x52e6('0x4a')](_0xb92690)['then'](handleEntityNotFound(_0x30dc7e,null))[_0x52e6('0x25')](respondWithResult(_0x30dc7e,null))['catch'](handleError(_0x30dc7e,null));};exports[_0x52e6('0x4b')]=function(_0xd517d9,_0x42ed45){return db[_0x52e6('0x2e')][_0x52e6('0x4b')](_0xd517d9['body'],{})[_0x52e6('0x25')](function(_0x419072){var _0x19ad9e=_0xd517d9[_0x52e6('0x4c')][_0x52e6('0x27')]({'plain':!![]});if(!_0x19ad9e)throw new Error(_0x52e6('0x4d'));if(_0x19ad9e[_0x52e6('0x4e')]===_0x52e6('0x4c')){var _0x2d6811=_0x419072[_0x52e6('0x27')]({'plain':!![]});var _0x2a1bbb=_0x52e6('0x28');return db[_0x52e6('0x4f')]['find']({'where':{'name':_0x2a1bbb,'userProfileId':_0x19ad9e[_0x52e6('0x50')]},'raw':!![]})[_0x52e6('0x25')](function(_0x4309b5){if(_0x4309b5&&_0x4309b5[_0x52e6('0x51')]===0x0){return db[_0x52e6('0x29')]['create']({'name':_0x2d6811[_0x52e6('0x33')],'resourceId':_0x2d6811['id'],'type':_0x4309b5[_0x52e6('0x33')],'sectionId':_0x4309b5['id']},{})[_0x52e6('0x25')](function(){return _0x419072;});}else{return _0x419072;}})['catch'](function(_0x19e9a9){logger[_0x52e6('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x19e9a9);throw _0x19e9a9;});}return _0x419072;})['then'](respondWithResult(_0x42ed45,0xc9))[_0x52e6('0x45')](handleError(_0x42ed45,null));};exports[_0x52e6('0x24')]=function(_0x571633,_0x139f36){if(_0x571633[_0x52e6('0x52')]['id']){delete _0x571633[_0x52e6('0x52')]['id'];}return db[_0x52e6('0x2e')][_0x52e6('0x4a')]({'where':{'id':_0x571633[_0x52e6('0x46')]['id']}})[_0x52e6('0x25')](handleEntityNotFound(_0x139f36,null))[_0x52e6('0x25')](saveUpdates(_0x571633['body'],null))[_0x52e6('0x25')](respondWithResult(_0x139f36,null))[_0x52e6('0x45')](handleError(_0x139f36,null));};exports[_0x52e6('0x26')]=function(_0xd6466d,_0x4e3f44){return db['Trigger'][_0x52e6('0x4a')]({'where':{'id':_0xd6466d[_0x52e6('0x46')]['id']}})[_0x52e6('0x25')](handleEntityNotFound(_0x4e3f44,null))['then'](removeEntity(_0x4e3f44,null))[_0x52e6('0x45')](handleError(_0x4e3f44,null));};exports[_0x52e6('0x53')]=function(_0x4f9efd,_0xa9f1b8,_0x2a65bf){if(_0x4f9efd[_0x52e6('0x52')]['id']){delete _0x4f9efd[_0x52e6('0x52')]['id'];}return db[_0x52e6('0x2e')][_0x52e6('0x4a')]({'where':{'id':_0x4f9efd[_0x52e6('0x46')]['id']}})[_0x52e6('0x25')](handleEntityNotFound(_0xa9f1b8,null))[_0x52e6('0x25')](function(_0x16e7f1){if(_0x16e7f1){_0x4f9efd[_0x52e6('0x52')]['TriggerAllId']=_0x16e7f1['id'];return db[_0x52e6('0x54')][_0x52e6('0x4b')](_0x4f9efd[_0x52e6('0x52')]);}})[_0x52e6('0x25')](respondWithResult(_0xa9f1b8,null))[_0x52e6('0x45')](handleError(_0xa9f1b8,null));};exports['addAnyCondition']=function(_0x5c8cde,_0x106344,_0x43245b){if(_0x5c8cde[_0x52e6('0x52')]['id']){delete _0x5c8cde[_0x52e6('0x52')]['id'];}return db[_0x52e6('0x2e')][_0x52e6('0x4a')]({'where':{'id':_0x5c8cde[_0x52e6('0x46')]['id']}})[_0x52e6('0x25')](handleEntityNotFound(_0x106344,null))[_0x52e6('0x25')](function(_0x105eb7){if(_0x105eb7){_0x5c8cde[_0x52e6('0x52')][_0x52e6('0x55')]=_0x105eb7['id'];return db[_0x52e6('0x54')][_0x52e6('0x4b')](_0x5c8cde['body']);}})[_0x52e6('0x25')](respondWithResult(_0x106344,null))['catch'](handleError(_0x106344,null));};exports[_0x52e6('0x56')]=function(_0x3fd492,_0x69979a,_0x261d98){var _0x546c22={};var _0xf8b794={};var _0xe24ffc;var _0x2c4cfb;return db[_0x52e6('0x2e')][_0x52e6('0x57')]({'where':{'id':_0x3fd492[_0x52e6('0x46')]['id']}})['then'](handleEntityNotFound(_0x69979a,null))['then'](function(_0x77fe00){if(_0x77fe00){_0xe24ffc=_0x77fe00;_0xf8b794[_0x52e6('0x31')]=_[_0x52e6('0x35')](db[_0x52e6('0x54')][_0x52e6('0x47')]);_0xf8b794['query']=_[_0x52e6('0x35')](_0x3fd492['query']);_0xf8b794[_0x52e6('0x36')]=_['intersection'](_0xf8b794[_0x52e6('0x31')],_0xf8b794[_0x52e6('0x34')]);_0x546c22[_0x52e6('0x48')]=_['intersection'](_0xf8b794[_0x52e6('0x31')],qs[_0x52e6('0x38')](_0x3fd492[_0x52e6('0x34')][_0x52e6('0x38')]));_0x546c22[_0x52e6('0x48')]=_0x546c22[_0x52e6('0x48')]['length']?_0x546c22[_0x52e6('0x48')]:_0xf8b794[_0x52e6('0x31')];_0x546c22[_0x52e6('0x58')]=qs[_0x52e6('0x3b')](_0x3fd492['query'][_0x52e6('0x3b')]);_0x546c22[_0x52e6('0x3c')]=qs['filters'](_['pick'](_0x3fd492[_0x52e6('0x34')],_0xf8b794[_0x52e6('0x36')]));if(_0x3fd492[_0x52e6('0x34')][_0x52e6('0x3e')]){_0x546c22[_0x52e6('0x3c')]=_[_0x52e6('0x3f')](_0x546c22[_0x52e6('0x3c')],{'$or':_[_0x52e6('0x32')](_0x546c22[_0x52e6('0x48')],function(_0x41499b){var _0x43f31c={};_0x43f31c[_0x41499b]={'$like':'%'+_0x3fd492[_0x52e6('0x34')][_0x52e6('0x3e')]+'%'};return _0x43f31c;})});}_0x546c22=_[_0x52e6('0x3f')]({},_0x546c22,_0x3fd492['options']);return _0xe24ffc[_0x52e6('0x56')](_0x546c22);}})[_0x52e6('0x25')](function(_0x426711){if(_0x426711){_0x2c4cfb=_0x426711[_0x52e6('0x59')];if(!_0x3fd492[_0x52e6('0x34')]['hasOwnProperty']('nolimit')){_0x546c22['limit']=qs[_0x52e6('0x20')](_0x3fd492[_0x52e6('0x34')][_0x52e6('0x20')]);_0x546c22['offset']=qs[_0x52e6('0x1e')](_0x3fd492[_0x52e6('0x34')][_0x52e6('0x1e')]);}return _0xe24ffc[_0x52e6('0x56')](_0x546c22);}})[_0x52e6('0x25')](function(_0x1a185b){if(_0x1a185b){return _0x1a185b?{'count':_0x2c4cfb,'rows':_0x1a185b}:null;}})[_0x52e6('0x25')](respondWithResult(_0x69979a,null))[_0x52e6('0x45')](handleError(_0x69979a,null));};exports[_0x52e6('0x5a')]=function(_0x276cec,_0x234f23,_0x4a2da6){var _0x3cde38={};var _0x15a828={};var _0x2861af;var _0x4cf6c6;return db['Trigger'][_0x52e6('0x57')]({'where':{'id':_0x276cec[_0x52e6('0x46')]['id']}})[_0x52e6('0x25')](handleEntityNotFound(_0x234f23,null))['then'](function(_0x1cbc7d){if(_0x1cbc7d){_0x2861af=_0x1cbc7d;_0x15a828[_0x52e6('0x31')]=_[_0x52e6('0x35')](db[_0x52e6('0x54')][_0x52e6('0x47')]);_0x15a828[_0x52e6('0x34')]=_['keys'](_0x276cec['query']);_0x15a828['filters']=_['intersection'](_0x15a828['model'],_0x15a828[_0x52e6('0x34')]);_0x3cde38[_0x52e6('0x48')]=_[_0x52e6('0x37')](_0x15a828[_0x52e6('0x31')],qs[_0x52e6('0x38')](_0x276cec['query'][_0x52e6('0x38')]));_0x3cde38[_0x52e6('0x48')]=_0x3cde38[_0x52e6('0x48')][_0x52e6('0x59')]?_0x3cde38['attributes']:_0x15a828[_0x52e6('0x31')];_0x3cde38[_0x52e6('0x58')]=qs[_0x52e6('0x3b')](_0x276cec[_0x52e6('0x34')][_0x52e6('0x3b')]);_0x3cde38[_0x52e6('0x3c')]=qs[_0x52e6('0x36')](_['pick'](_0x276cec['query'],_0x15a828['filters']));if(_0x276cec[_0x52e6('0x34')][_0x52e6('0x3e')]){_0x3cde38[_0x52e6('0x3c')]=_[_0x52e6('0x3f')](_0x3cde38[_0x52e6('0x3c')],{'$or':_[_0x52e6('0x32')](_0x3cde38['attributes'],function(_0x579ee8){var _0x529500={};_0x529500[_0x579ee8]={'$like':'%'+_0x276cec[_0x52e6('0x34')]['filter']+'%'};return _0x529500;})});}_0x3cde38=_[_0x52e6('0x3f')]({},_0x3cde38,_0x276cec[_0x52e6('0x41')]);return _0x2861af[_0x52e6('0x5a')](_0x3cde38);}})[_0x52e6('0x25')](function(_0xeb569d){if(_0xeb569d){_0x4cf6c6=_0xeb569d[_0x52e6('0x59')];if(!_0x276cec[_0x52e6('0x34')][_0x52e6('0x39')]('nolimit')){_0x3cde38[_0x52e6('0x20')]=qs['limit'](_0x276cec['query'][_0x52e6('0x20')]);_0x3cde38[_0x52e6('0x1e')]=qs[_0x52e6('0x1e')](_0x276cec[_0x52e6('0x34')][_0x52e6('0x1e')]);}return _0x2861af[_0x52e6('0x5a')](_0x3cde38);}})[_0x52e6('0x25')](function(_0x2795c0){if(_0x2795c0){return _0x2795c0?{'count':_0x4cf6c6,'rows':_0x2795c0}:null;}})[_0x52e6('0x25')](respondWithResult(_0x234f23,null))['catch'](handleError(_0x234f23,null));};exports[_0x52e6('0x5b')]=function(_0x1660b9,_0x13f090,_0x970b07){if(_0x1660b9[_0x52e6('0x52')]['id']){delete _0x1660b9['body']['id'];}return db[_0x52e6('0x2e')][_0x52e6('0x4a')]({'where':{'id':_0x1660b9[_0x52e6('0x46')]['id']}})[_0x52e6('0x25')](handleEntityNotFound(_0x13f090,null))['then'](function(_0x40429b){if(_0x40429b){_0x1660b9['body'][_0x52e6('0x5c')]=_0x40429b['id'];return db[_0x52e6('0x5d')][_0x52e6('0x4b')](_0x1660b9[_0x52e6('0x52')]);}})[_0x52e6('0x25')](respondWithResult(_0x13f090,null))[_0x52e6('0x45')](handleError(_0x13f090,null));};exports[_0x52e6('0x5e')]=function(_0x2ab2a9,_0x350f68,_0x636254){var _0x581b1a={};var _0x18a0ba={};var _0x335669;var _0x3789bd;return db[_0x52e6('0x2e')]['findOne']({'where':{'id':_0x2ab2a9[_0x52e6('0x46')]['id']}})[_0x52e6('0x25')](handleEntityNotFound(_0x350f68,null))[_0x52e6('0x25')](function(_0x45a7d2){if(_0x45a7d2){_0x335669=_0x45a7d2;_0x18a0ba[_0x52e6('0x31')]=_['keys'](db['Action'][_0x52e6('0x47')]);_0x18a0ba['query']=_[_0x52e6('0x35')](_0x2ab2a9[_0x52e6('0x34')]);_0x18a0ba[_0x52e6('0x36')]=_[_0x52e6('0x37')](_0x18a0ba[_0x52e6('0x31')],_0x18a0ba[_0x52e6('0x34')]);_0x581b1a[_0x52e6('0x48')]=_[_0x52e6('0x37')](_0x18a0ba[_0x52e6('0x31')],qs['fields'](_0x2ab2a9['query'][_0x52e6('0x38')]));_0x581b1a['attributes']=_0x581b1a[_0x52e6('0x48')][_0x52e6('0x59')]?_0x581b1a[_0x52e6('0x48')]:_0x18a0ba[_0x52e6('0x31')];_0x581b1a[_0x52e6('0x58')]=qs['sort'](_0x2ab2a9['query'][_0x52e6('0x3b')]);_0x581b1a[_0x52e6('0x3c')]=qs[_0x52e6('0x36')](_[_0x52e6('0x3d')](_0x2ab2a9['query'],_0x18a0ba[_0x52e6('0x36')]));if(_0x2ab2a9['query'][_0x52e6('0x3e')]){_0x581b1a[_0x52e6('0x3c')]=_[_0x52e6('0x3f')](_0x581b1a[_0x52e6('0x3c')],{'$or':_[_0x52e6('0x32')](_0x581b1a[_0x52e6('0x48')],function(_0x5dedc3){var _0x4be619={};_0x4be619[_0x5dedc3]={'$like':'%'+_0x2ab2a9[_0x52e6('0x34')][_0x52e6('0x3e')]+'%'};return _0x4be619;})});}_0x581b1a=_['merge']({},_0x581b1a,_0x2ab2a9['options']);return _0x335669[_0x52e6('0x5e')](_0x581b1a);}})[_0x52e6('0x25')](function(_0x6b41e5){if(_0x6b41e5){_0x3789bd=_0x6b41e5[_0x52e6('0x59')];if(!_0x2ab2a9[_0x52e6('0x34')][_0x52e6('0x39')](_0x52e6('0x3a'))){_0x581b1a[_0x52e6('0x20')]=qs[_0x52e6('0x20')](_0x2ab2a9[_0x52e6('0x34')]['limit']);_0x581b1a[_0x52e6('0x1e')]=qs[_0x52e6('0x1e')](_0x2ab2a9['query'][_0x52e6('0x1e')]);}return _0x335669[_0x52e6('0x5e')](_0x581b1a);}})[_0x52e6('0x25')](function(_0x403af0){if(_0x403af0){return _0x403af0?{'count':_0x3789bd,'rows':_0x403af0}:null;}})[_0x52e6('0x25')](respondWithResult(_0x350f68,null))['catch'](handleError(_0x350f68,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index 3a416ce..23190f6 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 _0x093a=['Trigger','tools_triggers','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./trigger.attributes','exports','define'];(function(_0x2d344f,_0x25fa84){var _0x2e796b=function(_0x10466a){while(--_0x10466a){_0x2d344f['push'](_0x2d344f['shift']());}};_0x2e796b(++_0x25fa84);}(_0x093a,0x16a));var _0xa093=function(_0x5575cd,_0x73ab7a){_0x5575cd=_0x5575cd-0x0;var _0x4979a0=_0x093a[_0x5575cd];return _0x4979a0;};'use strict';var _=require('lodash');var util=require(_0xa093('0x0'));var logger=require(_0xa093('0x1'))(_0xa093('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa093('0x3'));var fs=require('fs');var path=require(_0xa093('0x4'));var rimraf=require(_0xa093('0x5'));var config=require(_0xa093('0x6'));var attributes=require(_0xa093('0x7'));module[_0xa093('0x8')]=function(_0x2346f1,_0x145f58){return _0x2346f1[_0xa093('0x9')](_0xa093('0xa'),attributes,{'tableName':_0xa093('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaefc=['lodash','util','../../config/logger','moment','bluebird','rimraf','../../config/environment','Trigger'];(function(_0x4e531e,_0x3ade5a){var _0x504ff9=function(_0x4dcac9){while(--_0x4dcac9){_0x4e531e['push'](_0x4e531e['shift']());}};_0x504ff9(++_0x3ade5a);}(_0xaefc,0xc8));var _0xcaef=function(_0x240aaf,_0x2b8d86){_0x240aaf=_0x240aaf-0x0;var _0x280f83=_0xaefc[_0x240aaf];return _0x280f83;};'use strict';var _=require(_0xcaef('0x0'));var util=require(_0xcaef('0x1'));var logger=require(_0xcaef('0x2'))('api');var moment=require(_0xcaef('0x3'));var BPromise=require(_0xcaef('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xcaef('0x5'));var config=require(_0xcaef('0x6'));var attributes=require('./trigger.attributes');module['exports']=function(_0x47457d,_0x4471a1){return _0x47457d['define'](_0xcaef('0x7'),attributes,{'tableName':'tools_triggers','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 442d295..b22c809 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 _0xb898=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','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','map','include','model','ShowTrigger','find','lodash','util','moment','bluebird','randomstring'];(function(_0x4c76ce,_0x404fc7){var _0x5ca070=function(_0x28534f){while(--_0x28534f){_0x4c76ce['push'](_0x4c76ce['shift']());}};_0x5ca070(++_0x404fc7);}(_0xb898,0x8b));var _0x8b89=function(_0x4394b6,_0x12357f){_0x4394b6=_0x4394b6-0x0;var _0x360244=_0xb898[_0x4394b6];return _0x360244;};'use strict';var _=require(_0x8b89('0x0'));var util=require(_0x8b89('0x1'));var moment=require(_0x8b89('0x2'));var BPromise=require(_0x8b89('0x3'));var rs=require(_0x8b89('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8b89('0x5'))['db'];var utils=require(_0x8b89('0x6'));var logger=require(_0x8b89('0x7'))('rpc');var config=require(_0x8b89('0x8'));var jayson=require(_0x8b89('0x9'));var client=jayson[_0x8b89('0xa')][_0x8b89('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5d915a,_0x3065f3,_0x28664d){return new BPromise(function(_0x36a0fe,_0x1c6e76){return client[_0x8b89('0xc')](_0x5d915a,_0x28664d)[_0x8b89('0xd')](function(_0x4f55aa){logger[_0x8b89('0xe')](_0x8b89('0xf'),_0x3065f3,_0x8b89('0x10'));logger[_0x8b89('0x11')](_0x8b89('0x12'),_0x3065f3,_0x8b89('0x10'),JSON[_0x8b89('0x13')](_0x4f55aa));if(_0x4f55aa[_0x8b89('0x14')]){if(_0x4f55aa['error'][_0x8b89('0x15')]===0x1f4){logger[_0x8b89('0x14')](_0x8b89('0xf'),_0x3065f3,_0x4f55aa['error'][_0x8b89('0x16')]);return _0x1c6e76(_0x4f55aa[_0x8b89('0x14')]['message']);}logger['error']('Trigger,\x20%s,\x20%s',_0x3065f3,_0x4f55aa[_0x8b89('0x14')][_0x8b89('0x16')]);return _0x36a0fe(_0x4f55aa[_0x8b89('0x14')][_0x8b89('0x16')]);}else{logger[_0x8b89('0xe')](_0x8b89('0xf'),_0x3065f3,_0x8b89('0x10'));_0x36a0fe(_0x4f55aa['result'][_0x8b89('0x16')]);}})[_0x8b89('0x17')](function(_0x3d2572){logger['error'](_0x8b89('0xf'),_0x3065f3,_0x3d2572);_0x1c6e76(_0x3d2572);});});}exports[_0x8b89('0x18')]=function(_0x212e0b){var _0x101ae8=this;return new Promise(function(_0x481ca0,_0x474cae){return db[_0x8b89('0x19')][_0x8b89('0x1a')]({'raw':_0x212e0b[_0x8b89('0x1b')]?_0x212e0b[_0x8b89('0x1b')][_0x8b89('0x1c')]===undefined?!![]:![]:!![],'where':_0x212e0b[_0x8b89('0x1b')]?_0x212e0b[_0x8b89('0x1b')][_0x8b89('0x1d')]||null:null,'attributes':_0x212e0b[_0x8b89('0x1b')]?_0x212e0b[_0x8b89('0x1b')][_0x8b89('0x1e')]||null:null,'limit':_0x212e0b[_0x8b89('0x1b')]?_0x212e0b['options']['limit']||null:null,'include':_0x212e0b[_0x8b89('0x1b')]?_0x212e0b[_0x8b89('0x1b')]['include']?_[_0x8b89('0x1f')](_0x212e0b[_0x8b89('0x1b')][_0x8b89('0x20')],function(_0x43aa9d){return{'model':db[_0x43aa9d[_0x8b89('0x21')]],'as':_0x43aa9d['as'],'attributes':_0x43aa9d['attributes'],'include':_0x43aa9d[_0x8b89('0x20')]?_['map'](_0x43aa9d[_0x8b89('0x20')],function(_0xd9dde3){return{'model':db[_0xd9dde3['model']],'as':_0xd9dde3['as'],'attributes':_0xd9dde3[_0x8b89('0x1e')],'include':_0xd9dde3[_0x8b89('0x20')]?_[_0x8b89('0x1f')](_0xd9dde3['include'],function(_0x1903f1){return{'model':db[_0x1903f1[_0x8b89('0x21')]],'as':_0x1903f1['as'],'attributes':_0x1903f1[_0x8b89('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x400266){logger[_0x8b89('0xe')](_0x8b89('0x18'),_0x212e0b);logger[_0x8b89('0x11')](_0x8b89('0x18'),_0x212e0b,JSON[_0x8b89('0x13')](_0x400266));_0x481ca0(_0x400266);})[_0x8b89('0x17')](function(_0x213299){logger[_0x8b89('0x14')](_0x8b89('0x18'),_0x213299[_0x8b89('0x16')],_0x212e0b);_0x474cae(_0x101ae8[_0x8b89('0x14')](0x1f4,_0x213299['message']));});});};exports[_0x8b89('0x22')]=function(_0x35c52c){var _0x14e224=this;return new Promise(function(_0x113753,_0x230f7b){return db[_0x8b89('0x19')][_0x8b89('0x23')]({'raw':_0x35c52c['options']?_0x35c52c[_0x8b89('0x1b')][_0x8b89('0x1c')]===undefined?!![]:![]:!![],'where':_0x35c52c['options']?_0x35c52c[_0x8b89('0x1b')][_0x8b89('0x1d')]||null:null,'attributes':_0x35c52c[_0x8b89('0x1b')]?_0x35c52c[_0x8b89('0x1b')][_0x8b89('0x1e')]||null:null,'include':_0x35c52c[_0x8b89('0x1b')]?_0x35c52c[_0x8b89('0x1b')][_0x8b89('0x20')]?_[_0x8b89('0x1f')](_0x35c52c[_0x8b89('0x1b')][_0x8b89('0x20')],function(_0x514992){return{'model':db[_0x514992['model']],'as':_0x514992['as'],'attributes':_0x514992['attributes'],'include':_0x514992[_0x8b89('0x20')]?_[_0x8b89('0x1f')](_0x514992['include'],function(_0x2ce503){return{'model':db[_0x2ce503[_0x8b89('0x21')]],'as':_0x2ce503['as'],'attributes':_0x2ce503[_0x8b89('0x1e')],'include':_0x2ce503[_0x8b89('0x20')]?_[_0x8b89('0x1f')](_0x2ce503[_0x8b89('0x20')],function(_0x156cad){return{'model':db[_0x156cad[_0x8b89('0x21')]],'as':_0x156cad['as'],'attributes':_0x156cad['attributes']};}):[]};}):[]};}):[]:[]})[_0x8b89('0xd')](function(_0x3e1140){logger[_0x8b89('0xe')](_0x8b89('0x22'),_0x35c52c);logger[_0x8b89('0x11')]('ShowTrigger',_0x35c52c,JSON[_0x8b89('0x13')](_0x3e1140));_0x113753(_0x3e1140);})['catch'](function(_0x404ef8){logger[_0x8b89('0x14')](_0x8b89('0x22'),_0x404ef8[_0x8b89('0x16')],_0x35c52c);_0x230f7b(_0x14e224[_0x8b89('0x14')](0x1f4,_0x404ef8[_0x8b89('0x16')]));});});}; \ No newline at end of file +var _0xab22=['request','then','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetTrigger','findAll','options','raw','where','attributes','include','map','model','info','ShowTrigger','Trigger','find','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x55394d,_0x257093){var _0x436ebd=function(_0x34add6){while(--_0x34add6){_0x55394d['push'](_0x55394d['shift']());}};_0x436ebd(++_0x257093);}(_0xab22,0x1c9));var _0x2ab2=function(_0x43bdd5,_0x433cf9){_0x43bdd5=_0x43bdd5-0x0;var _0x17e811=_0xab22[_0x43bdd5];return _0x17e811;};'use strict';var _=require(_0x2ab2('0x0'));var util=require(_0x2ab2('0x1'));var moment=require('moment');var BPromise=require(_0x2ab2('0x2'));var rs=require(_0x2ab2('0x3'));var fs=require('fs');var Redis=require(_0x2ab2('0x4'));var db=require(_0x2ab2('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2ab2('0x6'));var config=require(_0x2ab2('0x7'));var jayson=require(_0x2ab2('0x8'));var client=jayson[_0x2ab2('0x9')][_0x2ab2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15d5c9,_0x536467,_0x41e2e0){return new BPromise(function(_0x39f3c8,_0x43be9f){return client[_0x2ab2('0xb')](_0x15d5c9,_0x41e2e0)[_0x2ab2('0xc')](function(_0x1c322c){logger['info'](_0x2ab2('0xd'),_0x536467,_0x2ab2('0xe'));logger[_0x2ab2('0xf')](_0x2ab2('0x10'),_0x536467,_0x2ab2('0xe'),JSON[_0x2ab2('0x11')](_0x1c322c));if(_0x1c322c[_0x2ab2('0x12')]){if(_0x1c322c[_0x2ab2('0x12')][_0x2ab2('0x13')]===0x1f4){logger[_0x2ab2('0x12')]('Trigger,\x20%s,\x20%s',_0x536467,_0x1c322c['error'][_0x2ab2('0x14')]);return _0x43be9f(_0x1c322c[_0x2ab2('0x12')][_0x2ab2('0x14')]);}logger[_0x2ab2('0x12')](_0x2ab2('0xd'),_0x536467,_0x1c322c[_0x2ab2('0x12')]['message']);return _0x39f3c8(_0x1c322c['error']['message']);}else{logger['info'](_0x2ab2('0xd'),_0x536467,_0x2ab2('0xe'));_0x39f3c8(_0x1c322c[_0x2ab2('0x15')][_0x2ab2('0x14')]);}})[_0x2ab2('0x16')](function(_0x344e51){logger[_0x2ab2('0x12')](_0x2ab2('0xd'),_0x536467,_0x344e51);_0x43be9f(_0x344e51);});});}exports[_0x2ab2('0x17')]=function(_0x206916){var _0x439b47=this;return new Promise(function(_0x12af8f,_0x526149){return db['Trigger'][_0x2ab2('0x18')]({'raw':_0x206916[_0x2ab2('0x19')]?_0x206916[_0x2ab2('0x19')][_0x2ab2('0x1a')]===undefined?!![]:![]:!![],'where':_0x206916[_0x2ab2('0x19')]?_0x206916[_0x2ab2('0x19')][_0x2ab2('0x1b')]||null:null,'attributes':_0x206916[_0x2ab2('0x19')]?_0x206916['options'][_0x2ab2('0x1c')]||null:null,'limit':_0x206916[_0x2ab2('0x19')]?_0x206916[_0x2ab2('0x19')]['limit']||null:null,'include':_0x206916['options']?_0x206916[_0x2ab2('0x19')][_0x2ab2('0x1d')]?_[_0x2ab2('0x1e')](_0x206916[_0x2ab2('0x19')]['include'],function(_0x41e34f){return{'model':db[_0x41e34f[_0x2ab2('0x1f')]],'as':_0x41e34f['as'],'attributes':_0x41e34f['attributes'],'include':_0x41e34f[_0x2ab2('0x1d')]?_[_0x2ab2('0x1e')](_0x41e34f[_0x2ab2('0x1d')],function(_0x573a8d){return{'model':db[_0x573a8d[_0x2ab2('0x1f')]],'as':_0x573a8d['as'],'attributes':_0x573a8d['attributes'],'include':_0x573a8d[_0x2ab2('0x1d')]?_[_0x2ab2('0x1e')](_0x573a8d[_0x2ab2('0x1d')],function(_0x488227){return{'model':db[_0x488227[_0x2ab2('0x1f')]],'as':_0x488227['as'],'attributes':_0x488227[_0x2ab2('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x2ab2('0xc')](function(_0x384240){logger[_0x2ab2('0x20')](_0x2ab2('0x17'),_0x206916);logger[_0x2ab2('0xf')]('GetTrigger',_0x206916,JSON['stringify'](_0x384240));_0x12af8f(_0x384240);})[_0x2ab2('0x16')](function(_0x50fd9c){logger[_0x2ab2('0x12')](_0x2ab2('0x17'),_0x50fd9c[_0x2ab2('0x14')],_0x206916);_0x526149(_0x439b47['error'](0x1f4,_0x50fd9c[_0x2ab2('0x14')]));});});};exports[_0x2ab2('0x21')]=function(_0x2854ca){var _0x257dbf=this;return new Promise(function(_0xb86ab0,_0x14a899){return db[_0x2ab2('0x22')][_0x2ab2('0x23')]({'raw':_0x2854ca['options']?_0x2854ca['options'][_0x2ab2('0x1a')]===undefined?!![]:![]:!![],'where':_0x2854ca[_0x2ab2('0x19')]?_0x2854ca[_0x2ab2('0x19')]['where']||null:null,'attributes':_0x2854ca[_0x2ab2('0x19')]?_0x2854ca[_0x2ab2('0x19')]['attributes']||null:null,'include':_0x2854ca[_0x2ab2('0x19')]?_0x2854ca[_0x2ab2('0x19')][_0x2ab2('0x1d')]?_[_0x2ab2('0x1e')](_0x2854ca[_0x2ab2('0x19')][_0x2ab2('0x1d')],function(_0x411bc2){return{'model':db[_0x411bc2[_0x2ab2('0x1f')]],'as':_0x411bc2['as'],'attributes':_0x411bc2[_0x2ab2('0x1c')],'include':_0x411bc2[_0x2ab2('0x1d')]?_[_0x2ab2('0x1e')](_0x411bc2[_0x2ab2('0x1d')],function(_0x392cd1){return{'model':db[_0x392cd1[_0x2ab2('0x1f')]],'as':_0x392cd1['as'],'attributes':_0x392cd1[_0x2ab2('0x1c')],'include':_0x392cd1[_0x2ab2('0x1d')]?_[_0x2ab2('0x1e')](_0x392cd1[_0x2ab2('0x1d')],function(_0x1b10ce){return{'model':db[_0x1b10ce[_0x2ab2('0x1f')]],'as':_0x1b10ce['as'],'attributes':_0x1b10ce[_0x2ab2('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x2ab2('0xc')](function(_0x59f8aa){logger[_0x2ab2('0x20')](_0x2ab2('0x21'),_0x2854ca);logger['debug'](_0x2ab2('0x21'),_0x2854ca,JSON['stringify'](_0x59f8aa));_0xb86ab0(_0x59f8aa);})['catch'](function(_0x1bd690){logger[_0x2ab2('0x12')](_0x2ab2('0x21'),_0x1bd690[_0x2ab2('0x14')],_0x2854ca);_0x14a899(_0x257dbf[_0x2ab2('0x12')](0x1f4,_0x1bd690[_0x2ab2('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index f4412c7..45e0e78 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 _0x79ca=['../../components/auth/service','../../components/interaction/service','../../config/environment','./trunk.controller','isAuthenticated','index','get','/:id','/:id/clone','clone','create','put','update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x4eb4ad,_0x183488){var _0x1312b2=function(_0x19aabe){while(--_0x19aabe){_0x4eb4ad['push'](_0x4eb4ad['shift']());}};_0x1312b2(++_0x183488);}(_0x79ca,0xb7));var _0xa79c=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x79ca[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0xa79c('0x0'));var util=require('util');var path=require(_0xa79c('0x1'));var timeout=require(_0xa79c('0x2'));var express=require(_0xa79c('0x3'));var router=express[_0xa79c('0x4')]();var fs_extra=require(_0xa79c('0x5'));var auth=require(_0xa79c('0x6'));var interaction=require(_0xa79c('0x7'));var config=require(_0xa79c('0x8'));var controller=require(_0xa79c('0x9'));router['get']('/',auth[_0xa79c('0xa')](),controller[_0xa79c('0xb')]);router[_0xa79c('0xc')](_0xa79c('0xd'),auth[_0xa79c('0xa')](),controller['show']);router['post'](_0xa79c('0xe'),auth[_0xa79c('0xa')](),controller[_0xa79c('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0xa79c('0x10')]);router[_0xa79c('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xa79c('0x12')]);router[_0xa79c('0x13')](_0xa79c('0xd'),auth[_0xa79c('0xa')](),controller['destroy']);module[_0xa79c('0x14')]=router; \ No newline at end of file +var _0x76b5=['/:id','show','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./trunk.controller','get','isAuthenticated','index'];(function(_0x2c6ff0,_0x2b1d1d){var _0x1d5d47=function(_0x1a153c){while(--_0x1a153c){_0x2c6ff0['push'](_0x2c6ff0['shift']());}};_0x1d5d47(++_0x2b1d1d);}(_0x76b5,0x1a8));var _0x576b=function(_0x5b3a35,_0x312e9b){_0x5b3a35=_0x5b3a35-0x0;var _0x4383df=_0x76b5[_0x5b3a35];return _0x4383df;};'use strict';var multer=require(_0x576b('0x0'));var util=require(_0x576b('0x1'));var path=require(_0x576b('0x2'));var timeout=require(_0x576b('0x3'));var express=require(_0x576b('0x4'));var router=express[_0x576b('0x5')]();var fs_extra=require(_0x576b('0x6'));var auth=require(_0x576b('0x7'));var interaction=require(_0x576b('0x8'));var config=require('../../config/environment');var controller=require(_0x576b('0x9'));router[_0x576b('0xa')]('/',auth[_0x576b('0xb')](),controller[_0x576b('0xc')]);router[_0x576b('0xa')](_0x576b('0xd'),auth['isAuthenticated'](),controller[_0x576b('0xe')]);router['post']('/:id/clone',auth['isAuthenticated'](),controller['clone']);router['post']('/',auth[_0x576b('0xb')](),controller['create']);router['put']('/:id',auth[_0x576b('0xb')](),controller[_0x576b('0xf')]);router[_0x576b('0x10')](_0x576b('0xd'),auth[_0x576b('0xb')](),controller[_0x576b('0x11')]);module[_0x576b('0x12')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index 8db372b..f39661d 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 _0x3d5e=['udp','setDataValue','transport','join','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','ENUM','rfc2833','info','shortinfo','inband','nonat','update','yes','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','\x22\x22\x20<>','always','accept','refuse','originate','uas','fingerprint','active','passive','actpass','dynamic','update,nonat','exports','STRING','name','friend','user','peer','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN'];(function(_0x146a97,_0x2d8483){var _0x259d5c=function(_0x3ca436){while(--_0x3ca436){_0x146a97['push'](_0x146a97['shift']());}};_0x259d5c(++_0x2d8483);}(_0x3d5e,0x1ae));var _0xe3d5=function(_0x9331b4,_0x471f0a){_0x9331b4=_0x9331b4-0x0;var _0x5b6266=_0x3d5e[_0x9331b4];return _0x5b6266;};'use strict';var Sequelize=require('sequelize');module[_0xe3d5('0x0')]={'name':{'type':Sequelize[_0xe3d5('0x1')],'allowNull':![],'unique':_0xe3d5('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0xe3d5('0x3'),_0xe3d5('0x4'),_0xe3d5('0x5')),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize[_0xe3d5('0x1')],'allowNull':![],'defaultValue':'from-voip-provider'},'callingpres':{'type':Sequelize['ENUM'](_0xe3d5('0x6'),_0xe3d5('0x7'),_0xe3d5('0x8'),'ALLOWED','PROHIB_NOT_SCREENED',_0xe3d5('0x9'),_0xe3d5('0xa'),'PROHIB')},'deny':{'type':Sequelize['STRING']},'permit':{'type':Sequelize[_0xe3d5('0x1')]},'secret':{'type':Sequelize[_0xe3d5('0x1')]},'md5secret':{'type':Sequelize[_0xe3d5('0x1')]},'remotesecret':{'type':Sequelize[_0xe3d5('0x1')]},'transport':{'type':Sequelize[_0xe3d5('0x1')],'defaultValue':_0xe3d5('0xb'),'set':function(_0x455b62){this[_0xe3d5('0xc')](_0xe3d5('0xd'),_0x455b62?_0x455b62[_0xe3d5('0xe')](','):null);},'get':function(){return this[_0xe3d5('0xf')]('transport')?this['getDataValue'](_0xe3d5('0xd'))[_0xe3d5('0x10')](','):null;},'comment':_0xe3d5('0x11')},'dtmfmode':{'type':Sequelize[_0xe3d5('0x12')](_0xe3d5('0x13'),_0xe3d5('0x14'),_0xe3d5('0x15'),_0xe3d5('0x16'),'auto'),'defaultValue':_0xe3d5('0x13')},'directmedia':{'type':Sequelize['ENUM']('yes','no',_0xe3d5('0x17'),_0xe3d5('0x18'),'outgoing'),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xe3d5('0x12')](_0xe3d5('0x19'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xe3d5('0x1')]},'directmediadeny':{'type':Sequelize[_0xe3d5('0x1')]},'nat':{'type':Sequelize[_0xe3d5('0x1')],'defaultValue':_0xe3d5('0x1a'),'set':function(_0x57696b){this['setDataValue'](_0xe3d5('0x1b'),_0x57696b?_0x57696b['join'](','):null);},'get':function(){return this[_0xe3d5('0xf')]('nat')?this['getDataValue'](_0xe3d5('0x1b'))[_0xe3d5('0x10')](','):null;},'comment':_0xe3d5('0x1c')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0xe3d5('0x1')]},'pickupgroup':{'type':Sequelize[_0xe3d5('0x1')]},'namedpickupgroup':{'type':Sequelize[_0xe3d5('0x1')]},'language':{'type':Sequelize[_0xe3d5('0x1')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xe3d5('0x1')],'allowNull':!![]},'disallow':{'type':Sequelize['STRING'],'defaultValue':_0xe3d5('0x1d')},'allow':{'type':Sequelize[_0xe3d5('0x1')],'allowNull':![],'defaultValue':_0xe3d5('0x1e'),'set':function(_0x49d791){this[_0xe3d5('0xc')](_0xe3d5('0x1f'),_0x49d791?_0x49d791[_0xe3d5('0xe')](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0xe3d5('0xf')](_0xe3d5('0x1f'))?this['getDataValue'](_0xe3d5('0x1f'))[_0xe3d5('0x10')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'},'autoframing':{'type':Sequelize[_0xe3d5('0x12')](_0xe3d5('0x19'),'no')},'insecure':{'type':Sequelize['STRING'],'defaultValue':_0xe3d5('0x20'),'set':function(_0x3eed15){this[_0xe3d5('0xc')](_0xe3d5('0x21'),_0x3eed15?_0x3eed15[_0xe3d5('0xe')](','):null);},'get':function(){return this['getDataValue'](_0xe3d5('0x21'))?this[_0xe3d5('0xf')]('insecure')[_0xe3d5('0x10')](','):null;},'comment':_0xe3d5('0x22')},'trustrpid':{'type':Sequelize[_0xe3d5('0x12')](_0xe3d5('0x19'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xe3d5('0x12')](_0xe3d5('0x19'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xe3d5('0x12')](_0xe3d5('0x19'),'no',_0xe3d5('0x23'))},'promiscredir':{'type':Sequelize[_0xe3d5('0x12')]('yes','no')},'useclientcode':{'type':Sequelize[_0xe3d5('0x12')](_0xe3d5('0x19'),'no')},'accountcode':{'type':Sequelize[_0xe3d5('0x24')](0xb)},'setvar':{'type':Sequelize[_0xe3d5('0x1')]},'callerid':{'type':Sequelize[_0xe3d5('0x1')],'defaultValue':_0xe3d5('0x25')},'amaflags':{'type':Sequelize[_0xe3d5('0x1')]},'callcounter':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0xe3d5('0x24')](0xb)},'allowoverlap':{'type':Sequelize[_0xe3d5('0x12')](_0xe3d5('0x19'),'no')},'allowsubscribe':{'type':Sequelize[_0xe3d5('0x12')](_0xe3d5('0x19'),'no')},'allowtransfer':{'type':Sequelize[_0xe3d5('0x12')](_0xe3d5('0x19'),'no')},'ignoresdpversion':{'type':Sequelize[_0xe3d5('0x12')](_0xe3d5('0x19'),'no')},'subscribecontext':{'type':Sequelize['STRING']},'template':{'type':Sequelize['STRING']},'videosupport':{'type':Sequelize[_0xe3d5('0x12')](_0xe3d5('0x19'),'no',_0xe3d5('0x26')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xe3d5('0x24')](0xb)},'rfc2833compensate':{'type':Sequelize[_0xe3d5('0x12')]('yes','no')},'mailbox':{'type':Sequelize[_0xe3d5('0x1')]},'session_timers':{'type':Sequelize[_0xe3d5('0x12')](_0xe3d5('0x27'),_0xe3d5('0x28'),_0xe3d5('0x29'))},'session_expires':{'type':Sequelize['INTEGER'](0xb)},'session_minse':{'type':Sequelize['INTEGER'](0xb)},'session_refresher':{'type':Sequelize['ENUM']('uac',_0xe3d5('0x2a')),'defaultValue':_0xe3d5('0x2a')},'t38pt_usertpsource':{'type':Sequelize['STRING']},'regexten':{'type':Sequelize[_0xe3d5('0x1')]},'fromdomain':{'type':Sequelize['STRING']},'fromuser':{'type':Sequelize[_0xe3d5('0x1')]},'port':{'type':Sequelize[_0xe3d5('0x24')](0x5)},'qualify':{'type':Sequelize[_0xe3d5('0x12')]('yes','no'),'defaultValue':_0xe3d5('0x19')},'keepalive':{'type':Sequelize[_0xe3d5('0x24')](0xb)},'defaultip':{'type':Sequelize[_0xe3d5('0x1')]},'defaultuser':{'type':Sequelize[_0xe3d5('0x1')]},'rtptimeout':{'type':Sequelize[_0xe3d5('0x24')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0xe3d5('0x24')](0xb)},'rtpkeepalive':{'type':Sequelize[_0xe3d5('0x24')](0xb)},'sendrpid':{'type':Sequelize['ENUM']('yes','no','pai'),'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING']},'callbackextension':{'type':Sequelize[_0xe3d5('0x1')]},'timert1':{'type':Sequelize[_0xe3d5('0x24')](0xb)},'timerb':{'type':Sequelize[_0xe3d5('0x24')](0xb)},'qualifyfreq':{'type':Sequelize[_0xe3d5('0x24')](0xb)},'contactpermit':{'type':Sequelize[_0xe3d5('0x1')]},'contactdeny':{'type':Sequelize['STRING']},'contactacl':{'type':Sequelize[_0xe3d5('0x1')]},'unsolicited_mailbox':{'type':Sequelize[_0xe3d5('0x1')]},'use_q850_reason':{'type':Sequelize[_0xe3d5('0x1')]},'maxforwards':{'type':Sequelize[_0xe3d5('0x24')](0xb)},'encryption':{'type':Sequelize[_0xe3d5('0x12')](_0xe3d5('0x19'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xe3d5('0x12')](_0xe3d5('0x19'),'no')},'force_avp':{'type':Sequelize[_0xe3d5('0x12')](_0xe3d5('0x19'),'no')},'icesupport':{'type':Sequelize[_0xe3d5('0x12')](_0xe3d5('0x19'),'no')},'dtlsenable':{'type':Sequelize[_0xe3d5('0x12')](_0xe3d5('0x19'),'no')},'dtlsverify':{'type':Sequelize[_0xe3d5('0x12')]('yes','no',_0xe3d5('0x2b'),'certificate')},'dtlsrekey':{'type':Sequelize[_0xe3d5('0x24')](0xb)},'dtlscertfile':{'type':Sequelize['STRING']},'dtlsprivatekey':{'type':Sequelize[_0xe3d5('0x1')]},'dtlscipher':{'type':Sequelize[_0xe3d5('0x1')]},'dtlscafile':{'type':Sequelize[_0xe3d5('0x1')]},'dtlscapath':{'type':Sequelize[_0xe3d5('0x1')]},'dtlssetup':{'type':Sequelize[_0xe3d5('0x12')](_0xe3d5('0x2c'),_0xe3d5('0x2d'),_0xe3d5('0x2e')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xe3d5('0x1')]},'usereqphone':{'type':Sequelize[_0xe3d5('0x12')](_0xe3d5('0x19'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xe3d5('0x1')]},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xe3d5('0x12')](_0xe3d5('0x19'),'no')},'subscribemwi':{'type':Sequelize[_0xe3d5('0x12')](_0xe3d5('0x19'),'no')},'vmexten':{'type':Sequelize[_0xe3d5('0x1')]},'mohinterpret':{'type':Sequelize[_0xe3d5('0x1')]},'mohsuggest':{'type':Sequelize[_0xe3d5('0x1')]},'parkinglot':{'type':Sequelize[_0xe3d5('0x1')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xe3d5('0x1')],'defaultValue':_0xe3d5('0x2f')},'canreinvite':{'type':Sequelize[_0xe3d5('0x12')](_0xe3d5('0x19'),'no',_0xe3d5('0x17'),_0xe3d5('0x18'),_0xe3d5('0x30')),'defaultValue':'no'},'registry':{'type':Sequelize[_0xe3d5('0x1')]},'otherFields':{'type':Sequelize[_0xe3d5('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xe3d5('0x1')],'defaultValue':'no'}}; \ No newline at end of file +var _0x4d64=['rfc2833','yes','nonat','update','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','allow','ulaw;alaw;gsm','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','accept','refuse','originate','uas','pai','certificate','active','passive','actpass','dynamic','BOOLEAN','sequelize','STRING','name','ENUM','friend','peer','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','udp','setDataValue','transport','join','getDataValue','split','info','shortinfo','auto'];(function(_0x2cd1d4,_0x4b2755){var _0x1a480e=function(_0x53cb7e){while(--_0x53cb7e){_0x2cd1d4['push'](_0x2cd1d4['shift']());}};_0x1a480e(++_0x4b2755);}(_0x4d64,0x10b));var _0x44d6=function(_0x35fcc3,_0x4bfe42){_0x35fcc3=_0x35fcc3-0x0;var _0x4d9a31=_0x4d64[_0x35fcc3];return _0x4d9a31;};'use strict';var Sequelize=require(_0x44d6('0x0'));module['exports']={'name':{'type':Sequelize[_0x44d6('0x1')],'allowNull':![],'unique':_0x44d6('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x44d6('0x3')](_0x44d6('0x4'),'user',_0x44d6('0x5')),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize[_0x44d6('0x1')],'allowNull':![],'defaultValue':_0x44d6('0x6')},'callingpres':{'type':Sequelize[_0x44d6('0x3')](_0x44d6('0x7'),_0x44d6('0x8'),'ALLOWED_FAILED_SCREEN',_0x44d6('0x9'),_0x44d6('0xa'),'PROHIB_PASSED_SCREEN',_0x44d6('0xb'),'PROHIB')},'deny':{'type':Sequelize['STRING']},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize['STRING']},'md5secret':{'type':Sequelize[_0x44d6('0x1')]},'remotesecret':{'type':Sequelize[_0x44d6('0x1')]},'transport':{'type':Sequelize[_0x44d6('0x1')],'defaultValue':_0x44d6('0xc'),'set':function(_0x3fd0df){this[_0x44d6('0xd')](_0x44d6('0xe'),_0x3fd0df?_0x3fd0df[_0x44d6('0xf')](','):null);},'get':function(){return this[_0x44d6('0x10')]('transport')?this[_0x44d6('0x10')](_0x44d6('0xe'))[_0x44d6('0x11')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0x44d6('0x3')]('rfc2833',_0x44d6('0x12'),_0x44d6('0x13'),'inband',_0x44d6('0x14')),'defaultValue':_0x44d6('0x15')},'directmedia':{'type':Sequelize['ENUM'](_0x44d6('0x16'),'no',_0x44d6('0x17'),_0x44d6('0x18'),_0x44d6('0x19')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x44d6('0x3')](_0x44d6('0x16'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x44d6('0x1')]},'directmediadeny':{'type':Sequelize[_0x44d6('0x1')]},'nat':{'type':Sequelize[_0x44d6('0x1')],'defaultValue':_0x44d6('0x1a'),'set':function(_0x18a078){this['setDataValue']('nat',_0x18a078?_0x18a078[_0x44d6('0xf')](','):null);},'get':function(){return this[_0x44d6('0x10')](_0x44d6('0x1b'))?this[_0x44d6('0x10')]('nat')[_0x44d6('0x11')](','):null;},'comment':_0x44d6('0x1c')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x44d6('0x1')]},'namedpickupgroup':{'type':Sequelize[_0x44d6('0x1')]},'language':{'type':Sequelize[_0x44d6('0x1')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x44d6('0x1')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x44d6('0x1')],'defaultValue':_0x44d6('0x1d')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x1c6a9a){this[_0x44d6('0xd')](_0x44d6('0x1e'),_0x1c6a9a?_0x1c6a9a[_0x44d6('0xf')](';'):_0x44d6('0x1f'));},'get':function(){return this[_0x44d6('0x10')]('allow')?this['getDataValue'](_0x44d6('0x1e'))[_0x44d6('0x11')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'},'autoframing':{'type':Sequelize['ENUM'](_0x44d6('0x16'),'no')},'insecure':{'type':Sequelize[_0x44d6('0x1')],'defaultValue':_0x44d6('0x20'),'set':function(_0x3431fd){this['setDataValue'](_0x44d6('0x21'),_0x3431fd?_0x3431fd['join'](','):null);},'get':function(){return this[_0x44d6('0x10')](_0x44d6('0x21'))?this[_0x44d6('0x10')](_0x44d6('0x21'))[_0x44d6('0x11')](','):null;},'comment':_0x44d6('0x22')},'trustrpid':{'type':Sequelize[_0x44d6('0x3')](_0x44d6('0x16'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x44d6('0x3')](_0x44d6('0x16'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM']('yes','no',_0x44d6('0x23'))},'promiscredir':{'type':Sequelize[_0x44d6('0x3')](_0x44d6('0x16'),'no')},'useclientcode':{'type':Sequelize[_0x44d6('0x3')](_0x44d6('0x16'),'no')},'accountcode':{'type':Sequelize[_0x44d6('0x24')](0xb)},'setvar':{'type':Sequelize[_0x44d6('0x1')]},'callerid':{'type':Sequelize[_0x44d6('0x1')],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize['STRING']},'callcounter':{'type':Sequelize[_0x44d6('0x3')]('yes','no'),'defaultValue':'yes'},'busylevel':{'type':Sequelize['INTEGER'](0xb)},'allowoverlap':{'type':Sequelize[_0x44d6('0x3')](_0x44d6('0x16'),'no')},'allowsubscribe':{'type':Sequelize['ENUM']('yes','no')},'allowtransfer':{'type':Sequelize[_0x44d6('0x3')](_0x44d6('0x16'),'no')},'ignoresdpversion':{'type':Sequelize['ENUM'](_0x44d6('0x16'),'no')},'subscribecontext':{'type':Sequelize['STRING']},'template':{'type':Sequelize[_0x44d6('0x1')]},'videosupport':{'type':Sequelize[_0x44d6('0x3')](_0x44d6('0x16'),'no','always'),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x44d6('0x24')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x44d6('0x3')](_0x44d6('0x16'),'no')},'mailbox':{'type':Sequelize[_0x44d6('0x1')]},'session_timers':{'type':Sequelize[_0x44d6('0x3')](_0x44d6('0x25'),_0x44d6('0x26'),_0x44d6('0x27'))},'session_expires':{'type':Sequelize[_0x44d6('0x24')](0xb)},'session_minse':{'type':Sequelize[_0x44d6('0x24')](0xb)},'session_refresher':{'type':Sequelize['ENUM']('uac',_0x44d6('0x28')),'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize['STRING']},'regexten':{'type':Sequelize[_0x44d6('0x1')]},'fromdomain':{'type':Sequelize['STRING']},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x44d6('0x24')](0x5)},'qualify':{'type':Sequelize[_0x44d6('0x3')]('yes','no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x44d6('0x24')](0xb)},'defaultip':{'type':Sequelize['STRING']},'defaultuser':{'type':Sequelize[_0x44d6('0x1')]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x44d6('0x24')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x44d6('0x24')](0xb)},'sendrpid':{'type':Sequelize[_0x44d6('0x3')](_0x44d6('0x16'),'no',_0x44d6('0x29')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x44d6('0x1')]},'callbackextension':{'type':Sequelize[_0x44d6('0x1')]},'timert1':{'type':Sequelize[_0x44d6('0x24')](0xb)},'timerb':{'type':Sequelize[_0x44d6('0x24')](0xb)},'qualifyfreq':{'type':Sequelize[_0x44d6('0x24')](0xb)},'contactpermit':{'type':Sequelize[_0x44d6('0x1')]},'contactdeny':{'type':Sequelize['STRING']},'contactacl':{'type':Sequelize['STRING']},'unsolicited_mailbox':{'type':Sequelize[_0x44d6('0x1')]},'use_q850_reason':{'type':Sequelize[_0x44d6('0x1')]},'maxforwards':{'type':Sequelize[_0x44d6('0x24')](0xb)},'encryption':{'type':Sequelize[_0x44d6('0x3')]('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM']('yes','no')},'force_avp':{'type':Sequelize[_0x44d6('0x3')](_0x44d6('0x16'),'no')},'icesupport':{'type':Sequelize[_0x44d6('0x3')](_0x44d6('0x16'),'no')},'dtlsenable':{'type':Sequelize['ENUM']('yes','no')},'dtlsverify':{'type':Sequelize['ENUM']('yes','no','fingerprint',_0x44d6('0x2a'))},'dtlsrekey':{'type':Sequelize[_0x44d6('0x24')](0xb)},'dtlscertfile':{'type':Sequelize['STRING']},'dtlsprivatekey':{'type':Sequelize[_0x44d6('0x1')]},'dtlscipher':{'type':Sequelize[_0x44d6('0x1')]},'dtlscafile':{'type':Sequelize[_0x44d6('0x1')]},'dtlscapath':{'type':Sequelize[_0x44d6('0x1')]},'dtlssetup':{'type':Sequelize[_0x44d6('0x3')](_0x44d6('0x2b'),_0x44d6('0x2c'),_0x44d6('0x2d')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x44d6('0x1')]},'usereqphone':{'type':Sequelize[_0x44d6('0x3')](_0x44d6('0x16'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x44d6('0x1')]},'recordofffeature':{'type':Sequelize[_0x44d6('0x1')]},'call_limit':{'type':Sequelize[_0x44d6('0x24')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x44d6('0x3')](_0x44d6('0x16'),'no')},'subscribemwi':{'type':Sequelize['ENUM']('yes','no')},'vmexten':{'type':Sequelize[_0x44d6('0x1')]},'mohinterpret':{'type':Sequelize[_0x44d6('0x1')]},'mohsuggest':{'type':Sequelize[_0x44d6('0x1')]},'parkinglot':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x44d6('0x1')]},'host':{'type':Sequelize['STRING'],'defaultValue':_0x44d6('0x2e')},'canreinvite':{'type':Sequelize[_0x44d6('0x3')]('yes','no',_0x44d6('0x17'),_0x44d6('0x18'),'update,nonat'),'defaultValue':'no'},'registry':{'type':Sequelize[_0x44d6('0x1')]},'otherFields':{'type':Sequelize[_0x44d6('0x1')]},'active':{'type':Sequelize[_0x44d6('0x2f')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x44d6('0x1')],'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 6368150..b7ab371 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 _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(_0x5e5d54,_0x319933){var _0x3607d6=function(_0x5e4ef2){while(--_0x5e4ef2){_0x5e5d54['push'](_0x5e5d54['shift']());}};_0x3607d6(++_0x319933);}(_0x425d,0x1e0));var _0xd425=function(_0x586642,_0x3b2e5d){_0x586642=_0x586642-0x0;var _0xef997a=_0x425d[_0x586642];return _0xef997a;};'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 +var _0x81bd=['/etc/asterisk/sip_xcally_trunks.conf','registry','render','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','update','server/files/templates/trunk.ejs','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','jayson/promise','http','request','then','info','Trunk,\x20%s,\x20%s','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','destroy','UserProfileResource','name','index','Trunk','rawAttributes','fieldName','key','model','map','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','clone','find','get','omit','createdAt','updatedAt','body','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Trunks','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','root','server/files/templates/registry.ejs','utf8','writeFileSync'];(function(_0x819464,_0x46fc91){var _0x49dcc0=function(_0x36b2b2){while(--_0x36b2b2){_0x819464['push'](_0x819464['shift']());}};_0x49dcc0(++_0x46fc91);}(_0x81bd,0x7c));var _0xd81b=function(_0x34967e,_0x11f483){_0x34967e=_0x34967e-0x0;var _0x406971=_0x81bd[_0x34967e];return _0x406971;};'use strict';var emlformat=require(_0xd81b('0x0'));var rimraf=require(_0xd81b('0x1'));var zipdir=require(_0xd81b('0x2'));var jsonpatch=require(_0xd81b('0x3'));var rp=require(_0xd81b('0x4'));var moment=require(_0xd81b('0x5'));var BPromise=require(_0xd81b('0x6'));var Mustache=require('mustache');var util=require(_0xd81b('0x7'));var path=require(_0xd81b('0x8'));var sox=require(_0xd81b('0x9'));var csv=require('to-csv');var ejs=require(_0xd81b('0xa'));var fs=require('fs');var fs_extra=require(_0xd81b('0xb'));var _=require(_0xd81b('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd81b('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd81b('0xe'));var querystring=require(_0xd81b('0xf'));var Papa=require(_0xd81b('0x10'));var Redis=require(_0xd81b('0x11'));var authService=require(_0xd81b('0x12'));var qs=require(_0xd81b('0x13'));var as=require(_0xd81b('0x14'));var hardwareService=require(_0xd81b('0x15'));var logger=require(_0xd81b('0x16'))(_0xd81b('0x17'));var utils=require(_0xd81b('0x18'));var config=require(_0xd81b('0x19'));var licenseUtil=require(_0xd81b('0x1a'));var db=require('../../mysqldb')['db'];var jayson=require(_0xd81b('0x1b'));var client=jayson['client'][_0xd81b('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0xe75568,_0x5f0b6b,_0x35a053,_0x47dd04){return new BPromise(function(_0x13dd00,_0x41bf7a){var _0x6c6041=_0x47dd04||client;return _0x6c6041[_0xd81b('0x1d')](_0xe75568,_0x35a053)[_0xd81b('0x1e')](function(_0x552215){logger[_0xd81b('0x1f')](_0xd81b('0x20'),_0x5f0b6b,'request\x20sent');logger[_0xd81b('0x21')](_0xd81b('0x22'),_0x5f0b6b,_0xd81b('0x23'),JSON[_0xd81b('0x24')](_0x552215));if(_0x552215[_0xd81b('0x25')]){if(_0x552215[_0xd81b('0x25')][_0xd81b('0x26')]===0x1f4){logger[_0xd81b('0x25')](_0xd81b('0x20'),_0x5f0b6b,_0x552215[_0xd81b('0x25')][_0xd81b('0x27')]);return _0x41bf7a(_0x552215[_0xd81b('0x25')][_0xd81b('0x27')]);}logger[_0xd81b('0x25')](_0xd81b('0x20'),_0x5f0b6b,_0x552215[_0xd81b('0x25')]['message']);return _0x13dd00(_0x552215['error'][_0xd81b('0x27')]);}else{logger[_0xd81b('0x1f')](_0xd81b('0x20'),_0x5f0b6b,'request\x20sent');_0x13dd00(_0x552215[_0xd81b('0x28')][_0xd81b('0x27')]);}})['catch'](function(_0xcd6474){logger[_0xd81b('0x25')](_0xd81b('0x20'),_0x5f0b6b,_0xcd6474);_0x41bf7a(_0xcd6474);});});}function respondWithStatusCode(_0x1ad65c,_0x279176){_0x279176=_0x279176||0xcc;return function(_0xcb4f91){if(_0xcb4f91){return _0x1ad65c[_0xd81b('0x29')](_0x279176);}return _0x1ad65c[_0xd81b('0x2a')](_0x279176)[_0xd81b('0x2b')]();};}function respondWithResult(_0x212c4e,_0x2ccedf){_0x2ccedf=_0x2ccedf||0xc8;return function(_0x1bf351){if(_0x1bf351){return _0x212c4e['status'](_0x2ccedf)[_0xd81b('0x2c')](_0x1bf351);}};}function respondWithFilteredResult(_0x99dbc9,_0xe3637a){return function(_0x31b9fd){if(_0x31b9fd){var _0x3266c2=typeof _0xe3637a[_0xd81b('0x2d')]===_0xd81b('0x2e')&&typeof _0xe3637a[_0xd81b('0x2f')]===_0xd81b('0x2e');var _0x483a3d=_0x31b9fd[_0xd81b('0x30')];var _0x4e2eff=_0x3266c2?0x0:_0xe3637a['offset'];var _0xb9ff9f=_0x3266c2?_0x31b9fd[_0xd81b('0x30')]:_0xe3637a['offset']+_0xe3637a['limit'];var _0x4093c8;if(_0xb9ff9f>=_0x483a3d){_0xb9ff9f=_0x483a3d;_0x4093c8=0xc8;}else{_0x4093c8=0xce;}_0x99dbc9[_0xd81b('0x2a')](_0x4093c8);return _0x99dbc9[_0xd81b('0x31')](_0xd81b('0x32'),_0x4e2eff+'-'+_0xb9ff9f+'/'+_0x483a3d)[_0xd81b('0x2c')](_0x31b9fd);}return null;};}function patchUpdates(_0x4654ba){return function(_0x5527ed){try{jsonpatch[_0xd81b('0x33')](_0x5527ed,_0x4654ba,!![]);}catch(_0x26f629){return BPromise['reject'](_0x26f629);}return _0x5527ed['save']();};}function saveUpdates(_0x165892,_0x1966b1){return function(_0x50472a){if(_0x50472a){return _0x50472a['update'](_0x165892)['then'](function(_0x322991){return _0x322991;});}return null;};}function removeEntity(_0x3ead68,_0x1d2f46){return function(_0x1c4cf7){if(_0x1c4cf7){return _0x1c4cf7[_0xd81b('0x34')]()[_0xd81b('0x1e')](function(){var _0x29aabf=_0x1c4cf7['get']({'plain':!![]});var _0x28782f='Trunks';return db[_0xd81b('0x35')][_0xd81b('0x34')]({'where':{'type':_0x28782f,'resourceId':_0x29aabf['id']}})[_0xd81b('0x1e')](function(){return _0x1c4cf7;});})[_0xd81b('0x1e')](function(){_0x3ead68[_0xd81b('0x2a')](0xcc)[_0xd81b('0x2b')]();});}};}function handleEntityNotFound(_0x1c20d3,_0x2d23b9){return function(_0xf9d1a5){if(!_0xf9d1a5){_0x1c20d3[_0xd81b('0x29')](0x194);}return _0xf9d1a5;};}function handleError(_0x1be4e2,_0x3c8371){_0x3c8371=_0x3c8371||0x1f4;return function(_0x346038){logger['error'](_0x346038['stack']);if(_0x346038[_0xd81b('0x36')]){delete _0x346038[_0xd81b('0x36')];}_0x1be4e2[_0xd81b('0x2a')](_0x3c8371)['send'](_0x346038);};}exports[_0xd81b('0x37')]=function(_0x37ba34,_0x5a236a){var _0x46f058={},_0xaa9e97={},_0x512e39={'count':0x0,'rows':[]};var _0xed5272=_['map'](db[_0xd81b('0x38')][_0xd81b('0x39')],function(_0x203365){return{'name':_0x203365[_0xd81b('0x3a')],'type':_0x203365['type'][_0xd81b('0x3b')]};});_0xaa9e97[_0xd81b('0x3c')]=_[_0xd81b('0x3d')](_0xed5272,_0xd81b('0x36'));_0xaa9e97[_0xd81b('0x3e')]=_[_0xd81b('0x3f')](_0x37ba34[_0xd81b('0x3e')]);_0xaa9e97['filters']=_[_0xd81b('0x40')](_0xaa9e97[_0xd81b('0x3c')],_0xaa9e97[_0xd81b('0x3e')]);_0x46f058['attributes']=_[_0xd81b('0x40')](_0xaa9e97[_0xd81b('0x3c')],qs[_0xd81b('0x41')](_0x37ba34[_0xd81b('0x3e')][_0xd81b('0x41')]));_0x46f058['attributes']=_0x46f058[_0xd81b('0x42')][_0xd81b('0x43')]?_0x46f058[_0xd81b('0x42')]:_0xaa9e97[_0xd81b('0x3c')];if(!_0x37ba34[_0xd81b('0x3e')][_0xd81b('0x44')](_0xd81b('0x45'))){_0x46f058[_0xd81b('0x2f')]=qs[_0xd81b('0x2f')](_0x37ba34[_0xd81b('0x3e')][_0xd81b('0x2f')]);_0x46f058['offset']=qs[_0xd81b('0x2d')](_0x37ba34[_0xd81b('0x3e')][_0xd81b('0x2d')]);}_0x46f058[_0xd81b('0x46')]=qs[_0xd81b('0x47')](_0x37ba34[_0xd81b('0x3e')][_0xd81b('0x47')]);_0x46f058[_0xd81b('0x48')]=qs['filters'](_['pick'](_0x37ba34[_0xd81b('0x3e')],_0xaa9e97[_0xd81b('0x49')]),_0xed5272);if(_0x37ba34[_0xd81b('0x3e')][_0xd81b('0x4a')]){_0x46f058[_0xd81b('0x48')]=_[_0xd81b('0x4b')](_0x46f058[_0xd81b('0x48')],{'$or':_[_0xd81b('0x3d')](_0xed5272,function(_0x2fa588){if(_0x2fa588[_0xd81b('0x4c')]!==_0xd81b('0x4d')){var _0x38e436={};_0x38e436[_0x2fa588['name']]={'$like':'%'+_0x37ba34[_0xd81b('0x3e')][_0xd81b('0x4a')]+'%'};return _0x38e436;}})});}_0x46f058=_[_0xd81b('0x4b')]({},_0x46f058,_0x37ba34[_0xd81b('0x4e')]);var _0x105a48={'where':_0x46f058[_0xd81b('0x48')]};return db[_0xd81b('0x38')][_0xd81b('0x30')](_0x105a48)[_0xd81b('0x1e')](function(_0x53ea36){_0x512e39[_0xd81b('0x30')]=_0x53ea36;if(_0x37ba34[_0xd81b('0x3e')][_0xd81b('0x4f')]){_0x46f058[_0xd81b('0x50')]=[{'all':!![]}];}return db['Trunk'][_0xd81b('0x51')](_0x46f058);})[_0xd81b('0x1e')](function(_0x15030b){_0x512e39[_0xd81b('0x52')]=_0x15030b;return _0x512e39;})[_0xd81b('0x1e')](respondWithFilteredResult(_0x5a236a,_0x46f058))[_0xd81b('0x53')](handleError(_0x5a236a,null));};exports[_0xd81b('0x54')]=function(_0x43d7ce,_0x133a76){var _0x49cba6={'raw':![],'where':{'id':_0x43d7ce[_0xd81b('0x55')]['id']}},_0x534d10={};_0x534d10[_0xd81b('0x3c')]=_[_0xd81b('0x3f')](db[_0xd81b('0x38')][_0xd81b('0x39')]);_0x534d10[_0xd81b('0x3e')]=_[_0xd81b('0x3f')](_0x43d7ce[_0xd81b('0x3e')]);_0x534d10['filters']=_[_0xd81b('0x40')](_0x534d10[_0xd81b('0x3c')],_0x534d10[_0xd81b('0x3e')]);_0x49cba6[_0xd81b('0x42')]=_[_0xd81b('0x40')](_0x534d10['model'],qs[_0xd81b('0x41')](_0x43d7ce[_0xd81b('0x3e')]['fields']));_0x49cba6[_0xd81b('0x42')]=_0x49cba6[_0xd81b('0x42')][_0xd81b('0x43')]?_0x49cba6[_0xd81b('0x42')]:_0x534d10[_0xd81b('0x3c')];if(_0x43d7ce[_0xd81b('0x3e')][_0xd81b('0x4f')]){_0x49cba6[_0xd81b('0x50')]=[{'all':!![]}];}_0x49cba6=_[_0xd81b('0x4b')]({},_0x49cba6,_0x43d7ce[_0xd81b('0x4e')]);return db[_0xd81b('0x38')]['find'](_0x49cba6)[_0xd81b('0x1e')](handleEntityNotFound(_0x133a76,null))['then'](respondWithResult(_0x133a76,null))[_0xd81b('0x53')](handleError(_0x133a76,null));};exports[_0xd81b('0x56')]=function(_0x390db6,_0x3c2a9f){var _0x34d2a2={'where':{'id':_0x390db6['params']['id']}},_0x1e9f73={};_0x1e9f73[_0xd81b('0x3c')]=_[_0xd81b('0x3f')](db['Trunk']['rawAttributes']);_0x34d2a2[_0xd81b('0x42')]=_['intersection'](_0x1e9f73[_0xd81b('0x3c')],qs['fields'](_0x390db6[_0xd81b('0x3e')][_0xd81b('0x41')]));_0x34d2a2[_0xd81b('0x42')]=_0x34d2a2['attributes'][_0xd81b('0x43')]?_0x34d2a2[_0xd81b('0x42')]:_0x1e9f73['model'];if(_0x390db6[_0xd81b('0x3e')][_0xd81b('0x4f')]){_0x34d2a2['include']=[{'all':!![]}];}_0x34d2a2=_[_0xd81b('0x4b')]({},_0x34d2a2,_0x390db6['options']);return db[_0xd81b('0x38')][_0xd81b('0x57')](_0x34d2a2)[_0xd81b('0x1e')](handleEntityNotFound(_0x3c2a9f,null))[_0xd81b('0x1e')](function(_0x4add79){if(_0x4add79){var _0x32eab4=_0x4add79[_0xd81b('0x58')]({'plain':!![]});_0x32eab4=qs[_0xd81b('0x59')](_0x32eab4,['id',_0xd81b('0x5a'),_0xd81b('0x5b')]);_0x390db6['body']=_[_0xd81b('0x59')](_0x390db6[_0xd81b('0x5c')],['id',_0xd81b('0x5a'),_0xd81b('0x5b')]);return db[_0xd81b('0x38')][_0xd81b('0x5d')](_[_0xd81b('0x4b')](_0x32eab4,_0x390db6['body']),{'include':_0x390db6['query']['includeAll']?[{'all':!![]}]:undefined})[_0xd81b('0x1e')](function(_0x12b0bf){var _0x37507e=_0x390db6[_0xd81b('0x5e')][_0xd81b('0x58')]({'plain':!![]});if(!_0x37507e)throw new Error(_0xd81b('0x5f'));if(_0x37507e[_0xd81b('0x60')]==='user'){var _0x3fcd8c=_0x12b0bf[_0xd81b('0x58')]({'plain':!![]});var _0x35c9cf=_0xd81b('0x61');return db[_0xd81b('0x62')][_0xd81b('0x57')]({'where':{'name':_0x35c9cf,'userProfileId':_0x37507e[_0xd81b('0x63')]},'raw':!![]})['then'](function(_0x14b187){if(_0x14b187&&_0x14b187[_0xd81b('0x64')]===0x0){return db[_0xd81b('0x35')][_0xd81b('0x5d')]({'name':_0x3fcd8c[_0xd81b('0x36')],'resourceId':_0x3fcd8c['id'],'type':_0x14b187[_0xd81b('0x36')],'sectionId':_0x14b187['id']},{})[_0xd81b('0x1e')](function(){return _0x12b0bf;});}else{return _0x12b0bf;}})[_0xd81b('0x53')](function(_0x8fa8cd){logger[_0xd81b('0x25')](_0xd81b('0x65'),_0x8fa8cd);throw _0x8fa8cd;});}return _0x12b0bf;});}})[_0xd81b('0x1e')](respondWithResult(_0x3c2a9f,0xc9))['catch'](handleError(_0x3c2a9f,null));};exports[_0xd81b('0x5d')]=function(_0x5358a6,_0x2e7141,_0x6fa974){var _0x414f40;return db[_0xd81b('0x38')][_0xd81b('0x5d')](_0x5358a6[_0xd81b('0x5c')],{'raw':!![]})[_0xd81b('0x1e')](function(_0x18f2ac){_0x414f40=_0x18f2ac;return db[_0xd81b('0x38')][_0xd81b('0x51')]({'raw':!![]});})['then'](function(_0xfa2a13){var _0x344c32=fs[_0xd81b('0x66')](path[_0xd81b('0x67')](config[_0xd81b('0x68')],'server/files/templates/trunk.ejs'),'utf8');var _0x3274d2=fs[_0xd81b('0x66')](path[_0xd81b('0x67')](config[_0xd81b('0x68')],_0xd81b('0x69')),_0xd81b('0x6a'));var _0xaee7e3=ejs['render'](_0x344c32,{'trunks':_0xfa2a13||[]});fs[_0xd81b('0x6b')](_0xd81b('0x6c'),_0xaee7e3);if(_0x414f40[_0xd81b('0x6d')]){var _0x1c6ec8=ejs[_0xd81b('0x6e')](_0x3274d2,{'trunks':_0xfa2a13||[]});fs[_0xd81b('0x6b')](_0xd81b('0x6f'),_0x1c6ec8);}})[_0xd81b('0x1e')](function(){return respondWithRpcPromise(_0xd81b('0x70'),'create',{'module':_0xd81b('0x71')});})[_0xd81b('0x1e')](function(){var _0x3858eb=_0x5358a6[_0xd81b('0x5e')][_0xd81b('0x58')]({'plain':!![]});if(!_0x3858eb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3858eb[_0xd81b('0x60')]===_0xd81b('0x5e')){var _0x4cc440=_0x414f40[_0xd81b('0x58')]({'plain':!![]});return db[_0xd81b('0x62')]['find']({'where':{'name':_0xd81b('0x61'),'userProfileId':_0x3858eb[_0xd81b('0x63')]},'raw':!![]})[_0xd81b('0x1e')](function(_0x483026){if(_0x483026&&_0x483026[_0xd81b('0x64')]===0x0){return db[_0xd81b('0x35')][_0xd81b('0x5d')]({'name':_0x4cc440['name'],'resourceId':_0x4cc440['id'],'type':_0x483026['name'],'sectionId':_0x483026['id']},{})[_0xd81b('0x1e')](function(){return _0x414f40;});}else{return _0x414f40;}})[_0xd81b('0x53')](function(_0x36c694){logger['error'](_0xd81b('0x65'),_0x36c694);throw _0x36c694;});}return _0x414f40;})[_0xd81b('0x1e')](respondWithResult(_0x2e7141,0xc9))[_0xd81b('0x53')](handleError(_0x2e7141,null));};exports[_0xd81b('0x72')]=function(_0x524196,_0x4f69a7,_0x42ae01){var _0x256696;return db[_0xd81b('0x38')][_0xd81b('0x57')]({'where':{'id':_0x524196['params']['id']}})[_0xd81b('0x1e')](handleEntityNotFound(_0x4f69a7,null))[_0xd81b('0x1e')](saveUpdates(_0x524196['body'],null))[_0xd81b('0x1e')](function(_0x4e5bf4){if(_0x4e5bf4){_0x256696=_0x4e5bf4;return db[_0xd81b('0x38')][_0xd81b('0x51')]({'raw':!![]});}})['then'](function(_0x1be0e6){if(_0x1be0e6){var _0x9a9634=fs[_0xd81b('0x66')](path[_0xd81b('0x67')](config[_0xd81b('0x68')],'server/files/templates/trunk.ejs'),_0xd81b('0x6a'));var _0xc0e137=fs[_0xd81b('0x66')](path[_0xd81b('0x67')](config[_0xd81b('0x68')],_0xd81b('0x69')),'utf8');var _0x5c8ea0=ejs[_0xd81b('0x6e')](_0x9a9634,{'trunks':_0x1be0e6||[]});fs[_0xd81b('0x6b')](_0xd81b('0x6c'),_0x5c8ea0);var _0x15aed5=ejs['render'](_0xc0e137,{'trunks':_0x1be0e6||[]});fs[_0xd81b('0x6b')](_0xd81b('0x6f'),_0x15aed5);return respondWithRpcPromise(_0xd81b('0x70'),_0xd81b('0x72'),{'module':_0xd81b('0x71')});}return null;})['then'](function(_0x3744bf){if(_0x3744bf){return _0x256696;}})[_0xd81b('0x1e')](respondWithResult(_0x4f69a7,null))[_0xd81b('0x53')](handleError(_0x4f69a7,null));};exports[_0xd81b('0x34')]=function(_0x1d596c,_0x288124,_0x402eb9){var _0x57179a;return db[_0xd81b('0x38')][_0xd81b('0x57')]({'where':{'id':_0x1d596c[_0xd81b('0x55')]['id']}})[_0xd81b('0x1e')](handleEntityNotFound(_0x288124,null))[_0xd81b('0x1e')](removeEntity(_0x288124,null))[_0xd81b('0x1e')](function(){return db['Trunk'][_0xd81b('0x51')]({'raw':!![]});})['then'](function(_0x11e590){var _0x9e6e05=fs[_0xd81b('0x66')](path['join'](config[_0xd81b('0x68')],_0xd81b('0x73')),_0xd81b('0x6a'));var _0x5060dc=fs[_0xd81b('0x66')](path[_0xd81b('0x67')](config['root'],_0xd81b('0x69')),'utf8');var _0x5f5514=ejs[_0xd81b('0x6e')](_0x9e6e05,{'trunks':_0x11e590});var _0x428317=ejs[_0xd81b('0x6e')](_0x5060dc,{'trunks':_0x11e590});fs['writeFileSync'](_0xd81b('0x6c'),_0x5f5514);fs[_0xd81b('0x6b')](_0xd81b('0x6f'),_0x428317);return respondWithRpcPromise(_0xd81b('0x70'),_0xd81b('0x34'),{'module':_0xd81b('0x71')});})['catch'](handleError(_0x288124,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index fbec1de..7837425 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 _0x3ef9=['../../config/logger','api','request-promise','path','rimraf','../../config/environment','./trunk.attributes','exports','define','Trunk','tools_trunks','util'];(function(_0x469ee1,_0x4bc97d){var _0x543b21=function(_0x3a8571){while(--_0x3a8571){_0x469ee1['push'](_0x469ee1['shift']());}};_0x543b21(++_0x4bc97d);}(_0x3ef9,0xe3));var _0x93ef=function(_0x6b2d97,_0x5b202b){_0x6b2d97=_0x6b2d97-0x0;var _0x1fce73=_0x3ef9[_0x6b2d97];return _0x1fce73;};'use strict';var _=require('lodash');var util=require(_0x93ef('0x0'));var logger=require(_0x93ef('0x1'))(_0x93ef('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x93ef('0x3'));var fs=require('fs');var path=require(_0x93ef('0x4'));var rimraf=require(_0x93ef('0x5'));var config=require(_0x93ef('0x6'));var attributes=require(_0x93ef('0x7'));module[_0x93ef('0x8')]=function(_0x5d9b4b,_0x2d0d47){return _0x5d9b4b[_0x93ef('0x9')](_0x93ef('0xa'),attributes,{'tableName':_0x93ef('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf7cc=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./trunk.attributes','exports','define','Trunk','tools_trunks','lodash'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf7cc,0x1bf));var _0xcf7c=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xf7cc[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0xcf7c('0x0'));var util=require(_0xcf7c('0x1'));var logger=require('../../config/logger')(_0xcf7c('0x2'));var moment=require(_0xcf7c('0x3'));var BPromise=require(_0xcf7c('0x4'));var rp=require(_0xcf7c('0x5'));var fs=require('fs');var path=require(_0xcf7c('0x6'));var rimraf=require(_0xcf7c('0x7'));var config=require(_0xcf7c('0x8'));var attributes=require(_0xcf7c('0x9'));module[_0xcf7c('0xa')]=function(_0x2e6fa3,_0x2cc7d5){return _0x2e6fa3[_0xcf7c('0xb')](_0xcf7c('0xc'),attributes,{'tableName':_0xcf7c('0xd'),'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 f5122ac..d905d14 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 _0xc411=['../../config/logger','rpc','../../config/environment','client','http','then','Trunk,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','findAll','options','raw','attributes','limit','include','map','model','GetTrunk','ShowTrunk','Trunk','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0xc411,0xca));var _0x1c41=function(_0x469a3c,_0x5ebc10){_0x469a3c=_0x469a3c-0x0;var _0x968f4=_0xc411[_0x469a3c];return _0x968f4;};'use strict';var _=require(_0x1c41('0x0'));var util=require(_0x1c41('0x1'));var moment=require(_0x1c41('0x2'));var BPromise=require(_0x1c41('0x3'));var rs=require(_0x1c41('0x4'));var fs=require('fs');var Redis=require(_0x1c41('0x5'));var db=require(_0x1c41('0x6'))['db'];var utils=require(_0x1c41('0x7'));var logger=require(_0x1c41('0x8'))(_0x1c41('0x9'));var config=require(_0x1c41('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x1c41('0xb')][_0x1c41('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x18628d,_0x5aa75f,_0x136297){return new BPromise(function(_0x31c860,_0x48e96f){return client['request'](_0x18628d,_0x136297)[_0x1c41('0xd')](function(_0xe54a5d){logger['info'](_0x1c41('0xe'),_0x5aa75f,_0x1c41('0xf'));logger[_0x1c41('0x10')]('Trunk,\x20%s,\x20%s,\x20%s',_0x5aa75f,_0x1c41('0xf'),JSON[_0x1c41('0x11')](_0xe54a5d));if(_0xe54a5d['error']){if(_0xe54a5d[_0x1c41('0x12')][_0x1c41('0x13')]===0x1f4){logger[_0x1c41('0x12')]('Trunk,\x20%s,\x20%s',_0x5aa75f,_0xe54a5d[_0x1c41('0x12')][_0x1c41('0x14')]);return _0x48e96f(_0xe54a5d[_0x1c41('0x12')][_0x1c41('0x14')]);}logger['error'](_0x1c41('0xe'),_0x5aa75f,_0xe54a5d[_0x1c41('0x12')][_0x1c41('0x14')]);return _0x31c860(_0xe54a5d['error'][_0x1c41('0x14')]);}else{logger[_0x1c41('0x15')](_0x1c41('0xe'),_0x5aa75f,_0x1c41('0xf'));_0x31c860(_0xe54a5d[_0x1c41('0x16')][_0x1c41('0x14')]);}})[_0x1c41('0x17')](function(_0x3fb839){logger['error'](_0x1c41('0xe'),_0x5aa75f,_0x3fb839);_0x48e96f(_0x3fb839);});});}exports['GetTrunk']=function(_0x22f166){var _0x3e2d6b=this;return new Promise(function(_0x402863,_0x374c7c){return db['Trunk'][_0x1c41('0x18')]({'raw':_0x22f166[_0x1c41('0x19')]?_0x22f166[_0x1c41('0x19')][_0x1c41('0x1a')]===undefined?!![]:![]:!![],'where':_0x22f166[_0x1c41('0x19')]?_0x22f166[_0x1c41('0x19')]['where']||null:null,'attributes':_0x22f166[_0x1c41('0x19')]?_0x22f166[_0x1c41('0x19')][_0x1c41('0x1b')]||null:null,'limit':_0x22f166['options']?_0x22f166[_0x1c41('0x19')][_0x1c41('0x1c')]||null:null,'include':_0x22f166[_0x1c41('0x19')]?_0x22f166[_0x1c41('0x19')][_0x1c41('0x1d')]?_[_0x1c41('0x1e')](_0x22f166[_0x1c41('0x19')][_0x1c41('0x1d')],function(_0x35cfdd){return{'model':db[_0x35cfdd[_0x1c41('0x1f')]],'as':_0x35cfdd['as'],'attributes':_0x35cfdd[_0x1c41('0x1b')],'include':_0x35cfdd[_0x1c41('0x1d')]?_[_0x1c41('0x1e')](_0x35cfdd['include'],function(_0x38f1d0){return{'model':db[_0x38f1d0[_0x1c41('0x1f')]],'as':_0x38f1d0['as'],'attributes':_0x38f1d0[_0x1c41('0x1b')],'include':_0x38f1d0[_0x1c41('0x1d')]?_['map'](_0x38f1d0[_0x1c41('0x1d')],function(_0x640bda){return{'model':db[_0x640bda[_0x1c41('0x1f')]],'as':_0x640bda['as'],'attributes':_0x640bda[_0x1c41('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x53d02f){logger['info'](_0x1c41('0x20'),_0x22f166);logger['debug'](_0x1c41('0x20'),_0x22f166,JSON[_0x1c41('0x11')](_0x53d02f));_0x402863(_0x53d02f);})[_0x1c41('0x17')](function(_0x41d3c1){logger[_0x1c41('0x12')](_0x1c41('0x20'),_0x41d3c1[_0x1c41('0x14')],_0x22f166);_0x374c7c(_0x3e2d6b[_0x1c41('0x12')](0x1f4,_0x41d3c1[_0x1c41('0x14')]));});});};exports[_0x1c41('0x21')]=function(_0xb96f5c){var _0x501749=this;return new Promise(function(_0x55dce6,_0x177c5e){return db[_0x1c41('0x22')]['find']({'raw':_0xb96f5c['options']?_0xb96f5c[_0x1c41('0x19')][_0x1c41('0x1a')]===undefined?!![]:![]:!![],'where':_0xb96f5c[_0x1c41('0x19')]?_0xb96f5c[_0x1c41('0x19')]['where']||null:null,'attributes':_0xb96f5c[_0x1c41('0x19')]?_0xb96f5c[_0x1c41('0x19')]['attributes']||null:null,'include':_0xb96f5c['options']?_0xb96f5c[_0x1c41('0x19')][_0x1c41('0x1d')]?_[_0x1c41('0x1e')](_0xb96f5c[_0x1c41('0x19')][_0x1c41('0x1d')],function(_0x2c2086){return{'model':db[_0x2c2086[_0x1c41('0x1f')]],'as':_0x2c2086['as'],'attributes':_0x2c2086[_0x1c41('0x1b')],'include':_0x2c2086[_0x1c41('0x1d')]?_[_0x1c41('0x1e')](_0x2c2086[_0x1c41('0x1d')],function(_0x474184){return{'model':db[_0x474184[_0x1c41('0x1f')]],'as':_0x474184['as'],'attributes':_0x474184[_0x1c41('0x1b')],'include':_0x474184[_0x1c41('0x1d')]?_['map'](_0x474184['include'],function(_0x27e634){return{'model':db[_0x27e634[_0x1c41('0x1f')]],'as':_0x27e634['as'],'attributes':_0x27e634['attributes']};}):[]};}):[]};}):[]:[]})[_0x1c41('0xd')](function(_0x4f5fa1){logger['info'](_0x1c41('0x21'),_0xb96f5c);logger[_0x1c41('0x10')]('ShowTrunk',_0xb96f5c,JSON[_0x1c41('0x11')](_0x4f5fa1));_0x55dce6(_0x4f5fa1);})[_0x1c41('0x17')](function(_0x5e4398){logger['error'](_0x1c41('0x21'),_0x5e4398[_0x1c41('0x14')],_0xb96f5c);_0x177c5e(_0x501749[_0x1c41('0x12')](0x1f4,_0x5e4398[_0x1c41('0x14')]));});});}; \ No newline at end of file +var _0xb77e=['Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetTrunk','Trunk','findAll','options','raw','where','attributes','limit','include','map','model','ShowTrunk','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','client','http','request','then','info'];(function(_0x4c2534,_0x77b28a){var _0x5e729f=function(_0x44d295){while(--_0x44d295){_0x4c2534['push'](_0x4c2534['shift']());}};_0x5e729f(++_0x77b28a);}(_0xb77e,0xef));var _0xeb77=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0xb77e[_0x5bd426];return _0x23a7eb;};'use strict';var _=require(_0xeb77('0x0'));var util=require(_0xeb77('0x1'));var moment=require(_0xeb77('0x2'));var BPromise=require(_0xeb77('0x3'));var rs=require(_0xeb77('0x4'));var fs=require('fs');var Redis=require(_0xeb77('0x5'));var db=require(_0xeb77('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xeb77('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xeb77('0x8')][_0xeb77('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x15d9ce,_0x59bfc4,_0x1ef8e8){return new BPromise(function(_0x2a949f,_0x36861f){return client[_0xeb77('0xa')](_0x15d9ce,_0x1ef8e8)[_0xeb77('0xb')](function(_0x52ef45){logger[_0xeb77('0xc')](_0xeb77('0xd'),_0x59bfc4,_0xeb77('0xe'));logger[_0xeb77('0xf')](_0xeb77('0x10'),_0x59bfc4,_0xeb77('0xe'),JSON[_0xeb77('0x11')](_0x52ef45));if(_0x52ef45[_0xeb77('0x12')]){if(_0x52ef45[_0xeb77('0x12')][_0xeb77('0x13')]===0x1f4){logger[_0xeb77('0x12')]('Trunk,\x20%s,\x20%s',_0x59bfc4,_0x52ef45['error'][_0xeb77('0x14')]);return _0x36861f(_0x52ef45['error']['message']);}logger['error'](_0xeb77('0xd'),_0x59bfc4,_0x52ef45[_0xeb77('0x12')][_0xeb77('0x14')]);return _0x2a949f(_0x52ef45[_0xeb77('0x12')][_0xeb77('0x14')]);}else{logger['info'](_0xeb77('0xd'),_0x59bfc4,_0xeb77('0xe'));_0x2a949f(_0x52ef45[_0xeb77('0x15')][_0xeb77('0x14')]);}})[_0xeb77('0x16')](function(_0x5e4c72){logger[_0xeb77('0x12')]('Trunk,\x20%s,\x20%s',_0x59bfc4,_0x5e4c72);_0x36861f(_0x5e4c72);});});}exports[_0xeb77('0x17')]=function(_0x493b0d){var _0x11c1f4=this;return new Promise(function(_0x1d6785,_0x5be825){return db[_0xeb77('0x18')][_0xeb77('0x19')]({'raw':_0x493b0d[_0xeb77('0x1a')]?_0x493b0d[_0xeb77('0x1a')][_0xeb77('0x1b')]===undefined?!![]:![]:!![],'where':_0x493b0d[_0xeb77('0x1a')]?_0x493b0d['options'][_0xeb77('0x1c')]||null:null,'attributes':_0x493b0d[_0xeb77('0x1a')]?_0x493b0d['options'][_0xeb77('0x1d')]||null:null,'limit':_0x493b0d[_0xeb77('0x1a')]?_0x493b0d['options'][_0xeb77('0x1e')]||null:null,'include':_0x493b0d[_0xeb77('0x1a')]?_0x493b0d[_0xeb77('0x1a')][_0xeb77('0x1f')]?_[_0xeb77('0x20')](_0x493b0d[_0xeb77('0x1a')][_0xeb77('0x1f')],function(_0x4f91a8){return{'model':db[_0x4f91a8['model']],'as':_0x4f91a8['as'],'attributes':_0x4f91a8[_0xeb77('0x1d')],'include':_0x4f91a8[_0xeb77('0x1f')]?_[_0xeb77('0x20')](_0x4f91a8[_0xeb77('0x1f')],function(_0x1fb951){return{'model':db[_0x1fb951[_0xeb77('0x21')]],'as':_0x1fb951['as'],'attributes':_0x1fb951['attributes'],'include':_0x1fb951[_0xeb77('0x1f')]?_[_0xeb77('0x20')](_0x1fb951[_0xeb77('0x1f')],function(_0x337a76){return{'model':db[_0x337a76[_0xeb77('0x21')]],'as':_0x337a76['as'],'attributes':_0x337a76[_0xeb77('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2c6fa7){logger['info'](_0xeb77('0x17'),_0x493b0d);logger['debug'](_0xeb77('0x17'),_0x493b0d,JSON['stringify'](_0x2c6fa7));_0x1d6785(_0x2c6fa7);})[_0xeb77('0x16')](function(_0x28f982){logger['error'](_0xeb77('0x17'),_0x28f982[_0xeb77('0x14')],_0x493b0d);_0x5be825(_0x11c1f4[_0xeb77('0x12')](0x1f4,_0x28f982['message']));});});};exports[_0xeb77('0x22')]=function(_0x8a20ac){var _0x34dd8a=this;return new Promise(function(_0x130ccf,_0x2a4a3a){return db[_0xeb77('0x18')][_0xeb77('0x23')]({'raw':_0x8a20ac[_0xeb77('0x1a')]?_0x8a20ac[_0xeb77('0x1a')][_0xeb77('0x1b')]===undefined?!![]:![]:!![],'where':_0x8a20ac['options']?_0x8a20ac[_0xeb77('0x1a')][_0xeb77('0x1c')]||null:null,'attributes':_0x8a20ac[_0xeb77('0x1a')]?_0x8a20ac[_0xeb77('0x1a')][_0xeb77('0x1d')]||null:null,'include':_0x8a20ac[_0xeb77('0x1a')]?_0x8a20ac[_0xeb77('0x1a')][_0xeb77('0x1f')]?_[_0xeb77('0x20')](_0x8a20ac[_0xeb77('0x1a')]['include'],function(_0x1db050){return{'model':db[_0x1db050[_0xeb77('0x21')]],'as':_0x1db050['as'],'attributes':_0x1db050['attributes'],'include':_0x1db050[_0xeb77('0x1f')]?_[_0xeb77('0x20')](_0x1db050[_0xeb77('0x1f')],function(_0x40b062){return{'model':db[_0x40b062['model']],'as':_0x40b062['as'],'attributes':_0x40b062[_0xeb77('0x1d')],'include':_0x40b062[_0xeb77('0x1f')]?_[_0xeb77('0x20')](_0x40b062['include'],function(_0xded810){return{'model':db[_0xded810[_0xeb77('0x21')]],'as':_0xded810['as'],'attributes':_0xded810[_0xeb77('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xeb77('0xb')](function(_0x49edd8){logger[_0xeb77('0xc')](_0xeb77('0x22'),_0x8a20ac);logger[_0xeb77('0xf')]('ShowTrunk',_0x8a20ac,JSON[_0xeb77('0x11')](_0x49edd8));_0x130ccf(_0x49edd8);})[_0xeb77('0x16')](function(_0x563104){logger[_0xeb77('0x12')](_0xeb77('0x22'),_0x563104[_0xeb77('0x14')],_0x8a20ac);_0x2a4a3a(_0x34dd8a[_0xeb77('0x12')](0x1f4,_0x563104[_0xeb77('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index 19f1822..78f5363 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 _0x98a1=['getApiKey','addContacts','post','/create_many','bulkCreate','addQueues','diskStorage','join','root','server/files/images/','format','%s-%s','now','originalname','single','file','addAvatar','login','/:id/logout','logout','/:id/pause','pause','/:id/unpause','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','/:id/whatsapp_interactions','addWhatsappInteractions','addFaxAccounts','/:id/mail_accounts','addMailAccounts','addOpenchannelAccounts','addSmsAccounts','/:id/chat_websites','addWhatsappAccounts','createApiKey','put','update','/:id/password','delete','removeTeams','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','/:id/fax_accounts','removeMailAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','removeSquareProjects','removeApiKey','exports','multer','util','path','express','fs-extra','../../config/environment','./user.controller','/describe','isAuthenticated','/whoami','whoami','get','/presence','/:id','show','/:id/avatar','getAvatar','/:id/open_tabs','getOpenTabs','/:id/contacts','getContacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','/:id/whatsapp/interactions','/:id/teams','getTeams','getLists','/:id/agents','getAgents','/:id/prefixes','getVoicePrefixes','getFaxAccounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/whatsapp_accounts','/:id/square_projects','/:id/scheduled_calls','getScheduledCalls','/:id/api_key'];(function(_0x163f77,_0x72fcf4){var _0x24b1ff=function(_0x71654d){while(--_0x71654d){_0x163f77['push'](_0x163f77['shift']());}};_0x24b1ff(++_0x72fcf4);}(_0x98a1,0xaf));var _0x198a=function(_0x4eceb5,_0x42b285){_0x4eceb5=_0x4eceb5-0x0;var _0x470a68=_0x98a1[_0x4eceb5];return _0x470a68;};'use strict';var multer=require(_0x198a('0x0'));var util=require(_0x198a('0x1'));var path=require(_0x198a('0x2'));var timeout=require('connect-timeout');var express=require(_0x198a('0x3'));var router=express['Router']();var fs_extra=require(_0x198a('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x198a('0x5'));var controller=require(_0x198a('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x198a('0x7'),auth[_0x198a('0x8')](),controller['describe']);router['get'](_0x198a('0x9'),auth[_0x198a('0x8')](),controller[_0x198a('0xa')]);router[_0x198a('0xb')](_0x198a('0xc'),auth[_0x198a('0x8')](),controller['getPresence']);router[_0x198a('0xb')](_0x198a('0xd'),auth[_0x198a('0x8')](),controller[_0x198a('0xe')]);router[_0x198a('0xb')](_0x198a('0xf'),controller[_0x198a('0x10')]);router[_0x198a('0xb')](_0x198a('0x11'),auth[_0x198a('0x8')](),controller[_0x198a('0x12')]);router[_0x198a('0xb')](_0x198a('0x13'),auth[_0x198a('0x8')](),controller[_0x198a('0x14')]);router['get'](_0x198a('0x15'),auth[_0x198a('0x8')](),controller[_0x198a('0x16')]);router[_0x198a('0xb')](_0x198a('0x17'),auth[_0x198a('0x8')](),controller[_0x198a('0x18')]);router[_0x198a('0xb')](_0x198a('0x19'),auth[_0x198a('0x8')](),controller[_0x198a('0x1a')]);router[_0x198a('0xb')](_0x198a('0x1b'),auth[_0x198a('0x8')](),controller[_0x198a('0x1c')]);router[_0x198a('0xb')](_0x198a('0x1d'),auth[_0x198a('0x8')](),controller['getScreenRecordings']);router[_0x198a('0xb')](_0x198a('0x1e'),auth[_0x198a('0x8')](),controller[_0x198a('0x1f')]);router[_0x198a('0xb')](_0x198a('0x20'),auth['isAuthenticated'](),controller['getOpenchannelInteractions']);router[_0x198a('0xb')]('/:id/mail/interactions',auth[_0x198a('0x8')](),controller['getMailInteractions']);router[_0x198a('0xb')](_0x198a('0x21'),auth[_0x198a('0x8')](),controller[_0x198a('0x22')]);router[_0x198a('0xb')](_0x198a('0x23'),auth[_0x198a('0x8')](),controller['getFaxInteractions']);router['get'](_0x198a('0x24'),auth[_0x198a('0x8')](),controller['getWhatsappInteractions']);router[_0x198a('0xb')](_0x198a('0x25'),auth[_0x198a('0x8')](),controller[_0x198a('0x26')]);router[_0x198a('0xb')]('/:id/lists',auth['isAuthenticated'](),controller[_0x198a('0x27')]);router[_0x198a('0xb')](_0x198a('0x28'),auth['isAuthenticated'](),controller[_0x198a('0x29')]);router[_0x198a('0xb')](_0x198a('0x2a'),auth[_0x198a('0x8')](),controller[_0x198a('0x2b')]);router['get']('/:id/fax_accounts',auth[_0x198a('0x8')](),controller[_0x198a('0x2c')]);router[_0x198a('0xb')]('/:id/mail_accounts',auth['isAuthenticated'](),controller[_0x198a('0x2d')]);router['get'](_0x198a('0x2e'),auth[_0x198a('0x8')](),controller[_0x198a('0x2f')]);router['get'](_0x198a('0x30'),auth[_0x198a('0x8')](),controller[_0x198a('0x31')]);router[_0x198a('0xb')]('/:id/chat_websites',auth[_0x198a('0x8')](),controller['getChatWebsites']);router[_0x198a('0xb')](_0x198a('0x32'),auth[_0x198a('0x8')](),controller['getWhatsappAccounts']);router[_0x198a('0xb')](_0x198a('0x33'),auth['isAuthenticated'](),controller['getSquareProjects']);router[_0x198a('0xb')](_0x198a('0x34'),auth[_0x198a('0x8')](),controller[_0x198a('0x35')]);router[_0x198a('0xb')](_0x198a('0x36'),auth[_0x198a('0x8')](),controller[_0x198a('0x37')]);router['post'](_0x198a('0x13'),auth['isAuthenticated'](),controller[_0x198a('0x38')]);router[_0x198a('0x39')]('/',auth[_0x198a('0x8')](),controller['create']);router[_0x198a('0x39')](_0x198a('0x3a'),auth[_0x198a('0x8')](),controller[_0x198a('0x3b')]);router[_0x198a('0x39')](_0x198a('0x15'),auth['isAuthenticated'](),controller[_0x198a('0x3c')]);var upload=multer({'storage':multer[_0x198a('0x3d')]({'destination':function(_0x527b6f,_0x3aee56,_0x29cbc2){_0x29cbc2(null,path[_0x198a('0x3e')](config[_0x198a('0x3f')],_0x198a('0x40')));},'filename':function(_0x48eeb6,_0x4262f4,_0x53dc37){_0x53dc37(null,util[_0x198a('0x41')](_0x198a('0x42'),Date[_0x198a('0x43')](),_0x4262f4[_0x198a('0x44')]));}})});router[_0x198a('0x39')]('/:id/avatar',upload[_0x198a('0x45')](_0x198a('0x46')),controller[_0x198a('0x47')]);router['post']('/:id/login',auth[_0x198a('0x8')](),controller[_0x198a('0x48')]);router[_0x198a('0x39')](_0x198a('0x49'),auth[_0x198a('0x8')](),controller[_0x198a('0x4a')]);router[_0x198a('0x39')](_0x198a('0x4b'),auth['isAuthenticated'](),controller[_0x198a('0x4c')]);router[_0x198a('0x39')](_0x198a('0x4d'),auth[_0x198a('0x8')](),controller['unpause']);router[_0x198a('0x39')](_0x198a('0x25'),auth['isAuthenticated'](),controller[_0x198a('0x4e')]);router['post'](_0x198a('0x4f'),auth[_0x198a('0x8')](),controller[_0x198a('0x50')]);router[_0x198a('0x39')](_0x198a('0x51'),auth[_0x198a('0x8')](),controller['addMailInteractions']);router[_0x198a('0x39')](_0x198a('0x52'),auth['isAuthenticated'](),controller[_0x198a('0x53')]);router['post'](_0x198a('0x54'),auth[_0x198a('0x8')](),controller[_0x198a('0x55')]);router[_0x198a('0x39')](_0x198a('0x56'),auth['isAuthenticated'](),controller['addOpenchannelInteractions']);router[_0x198a('0x39')](_0x198a('0x57'),auth[_0x198a('0x8')](),controller[_0x198a('0x58')]);router[_0x198a('0x39')]('/:id/fax_accounts',auth[_0x198a('0x8')](),controller[_0x198a('0x59')]);router[_0x198a('0x39')](_0x198a('0x5a'),auth[_0x198a('0x8')](),controller[_0x198a('0x5b')]);router['post'](_0x198a('0x2e'),auth[_0x198a('0x8')](),controller[_0x198a('0x5c')]);router[_0x198a('0x39')]('/:id/sms_accounts',auth[_0x198a('0x8')](),controller[_0x198a('0x5d')]);router[_0x198a('0x39')](_0x198a('0x5e'),auth[_0x198a('0x8')](),controller['addChatWebsites']);router[_0x198a('0x39')]('/:id/whatsapp_accounts',auth[_0x198a('0x8')](),controller[_0x198a('0x5f')]);router[_0x198a('0x39')](_0x198a('0x33'),auth[_0x198a('0x8')](),controller['addSquareProjects']);router[_0x198a('0x39')](_0x198a('0x36'),auth[_0x198a('0x8')](),controller[_0x198a('0x60')]);router[_0x198a('0x61')](_0x198a('0xd'),auth[_0x198a('0x8')](),controller[_0x198a('0x62')]);router[_0x198a('0x61')](_0x198a('0x63'),auth[_0x198a('0x8')](),controller['changePassword']);router[_0x198a('0x64')](_0x198a('0x15'),auth[_0x198a('0x8')](),controller['removeQueues']);router[_0x198a('0x64')](_0x198a('0x25'),auth[_0x198a('0x8')](),controller[_0x198a('0x65')]);router[_0x198a('0x64')](_0x198a('0xd'),auth[_0x198a('0x8')](),controller['destroy']);router[_0x198a('0x64')](_0x198a('0x4f'),auth[_0x198a('0x8')](),controller['removeChatInteractions']);router[_0x198a('0x64')](_0x198a('0x51'),auth[_0x198a('0x8')](),controller[_0x198a('0x66')]);router[_0x198a('0x64')](_0x198a('0x52'),auth[_0x198a('0x8')](),controller[_0x198a('0x67')]);router[_0x198a('0x64')](_0x198a('0x54'),auth['isAuthenticated'](),controller[_0x198a('0x68')]);router[_0x198a('0x64')](_0x198a('0x56'),auth[_0x198a('0x8')](),controller[_0x198a('0x69')]);router[_0x198a('0x64')](_0x198a('0x57'),auth[_0x198a('0x8')](),controller[_0x198a('0x6a')]);router[_0x198a('0x64')](_0x198a('0x6b'),auth['isAuthenticated'](),controller['removeFaxAccounts']);router[_0x198a('0x64')]('/:id/mail_accounts',auth[_0x198a('0x8')](),controller[_0x198a('0x6c')]);router['delete'](_0x198a('0x2e'),auth['isAuthenticated'](),controller['removeOpenchannelAccounts']);router[_0x198a('0x64')]('/:id/sms_accounts',auth['isAuthenticated'](),controller[_0x198a('0x6d')]);router[_0x198a('0x64')](_0x198a('0x5e'),auth['isAuthenticated'](),controller[_0x198a('0x6e')]);router[_0x198a('0x64')](_0x198a('0x32'),auth[_0x198a('0x8')](),controller[_0x198a('0x6f')]);router[_0x198a('0x64')](_0x198a('0x33'),auth[_0x198a('0x8')](),controller[_0x198a('0x70')]);router[_0x198a('0x64')](_0x198a('0x36'),auth[_0x198a('0x8')](),controller[_0x198a('0x71')]);module[_0x198a('0x72')]=router; \ No newline at end of file +var _0xed3a=['addFaxInteractions','/:id/sms_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addFaxAccounts','addChatWebsites','/:id/whatsapp_accounts','addWhatsappAccounts','addSquareProjects','createApiKey','put','update','/:id/password','changePassword','delete','removeQueues','removeTeams','/:id','destroy','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeSmsAccounts','/:id/chat_websites','removeChatWebsites','removeWhatsappAccounts','removeSquareProjects','removeApiKey','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','get','isAuthenticated','index','/describe','describe','whoami','getPresence','show','/:id/avatar','getAvatar','/:id/open_tabs','getOpenTabs','getContacts','/:id/queues','/:id/queues_rt','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','getWhatsappInteractions','/:id/teams','getTeams','/:id/lists','getLists','/:id/agents','getAgents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','getChatWebsites','getWhatsappAccounts','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','getApiKey','post','/:id/contacts','addContacts','/create_many','bulkCreate','join','root','server/files/images/','format','%s-%s','now','originalname','single','file','addAvatar','/:id/login','login','logout','/:id/pause','pause','/:id/unpause','unpause','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','/:id/fax_interactions'];(function(_0x5ad7ab,_0x49de88){var _0x16b1cc=function(_0x415a01){while(--_0x415a01){_0x5ad7ab['push'](_0x5ad7ab['shift']());}};_0x16b1cc(++_0x49de88);}(_0xed3a,0x190));var _0xaed3=function(_0x52fe8e,_0x263e4f){_0x52fe8e=_0x52fe8e-0x0;var _0x24c7e4=_0xed3a[_0x52fe8e];return _0x24c7e4;};'use strict';var multer=require(_0xaed3('0x0'));var util=require('util');var path=require(_0xaed3('0x1'));var timeout=require(_0xaed3('0x2'));var express=require(_0xaed3('0x3'));var router=express[_0xaed3('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xaed3('0x5'));var interaction=require(_0xaed3('0x6'));var config=require(_0xaed3('0x7'));var controller=require(_0xaed3('0x8'));router[_0xaed3('0x9')]('/',auth[_0xaed3('0xa')](),controller[_0xaed3('0xb')]);router[_0xaed3('0x9')](_0xaed3('0xc'),auth[_0xaed3('0xa')](),controller[_0xaed3('0xd')]);router[_0xaed3('0x9')]('/whoami',auth[_0xaed3('0xa')](),controller[_0xaed3('0xe')]);router[_0xaed3('0x9')]('/presence',auth[_0xaed3('0xa')](),controller[_0xaed3('0xf')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xaed3('0x10')]);router[_0xaed3('0x9')](_0xaed3('0x11'),controller[_0xaed3('0x12')]);router['get'](_0xaed3('0x13'),auth[_0xaed3('0xa')](),controller[_0xaed3('0x14')]);router[_0xaed3('0x9')]('/:id/contacts',auth[_0xaed3('0xa')](),controller[_0xaed3('0x15')]);router[_0xaed3('0x9')](_0xaed3('0x16'),auth[_0xaed3('0xa')](),controller['getQueues']);router[_0xaed3('0x9')](_0xaed3('0x17'),auth[_0xaed3('0xa')](),controller['getVoiceQueuesRt']);router[_0xaed3('0x9')]('/:id/groups',auth[_0xaed3('0xa')](),controller['getGroups']);router[_0xaed3('0x9')](_0xaed3('0x18'),auth[_0xaed3('0xa')](),controller[_0xaed3('0x19')]);router[_0xaed3('0x9')](_0xaed3('0x1a'),auth[_0xaed3('0xa')](),controller[_0xaed3('0x1b')]);router[_0xaed3('0x9')](_0xaed3('0x1c'),auth['isAuthenticated'](),controller['getChatInteractions']);router['get'](_0xaed3('0x1d'),auth[_0xaed3('0xa')](),controller[_0xaed3('0x1e')]);router[_0xaed3('0x9')](_0xaed3('0x1f'),auth[_0xaed3('0xa')](),controller['getMailInteractions']);router[_0xaed3('0x9')](_0xaed3('0x20'),auth['isAuthenticated'](),controller[_0xaed3('0x21')]);router[_0xaed3('0x9')](_0xaed3('0x22'),auth[_0xaed3('0xa')](),controller[_0xaed3('0x23')]);router['get']('/:id/whatsapp/interactions',auth[_0xaed3('0xa')](),controller[_0xaed3('0x24')]);router['get'](_0xaed3('0x25'),auth['isAuthenticated'](),controller[_0xaed3('0x26')]);router[_0xaed3('0x9')](_0xaed3('0x27'),auth[_0xaed3('0xa')](),controller[_0xaed3('0x28')]);router[_0xaed3('0x9')](_0xaed3('0x29'),auth[_0xaed3('0xa')](),controller[_0xaed3('0x2a')]);router[_0xaed3('0x9')](_0xaed3('0x2b'),auth['isAuthenticated'](),controller[_0xaed3('0x2c')]);router[_0xaed3('0x9')](_0xaed3('0x2d'),auth[_0xaed3('0xa')](),controller[_0xaed3('0x2e')]);router[_0xaed3('0x9')](_0xaed3('0x2f'),auth['isAuthenticated'](),controller[_0xaed3('0x30')]);router[_0xaed3('0x9')](_0xaed3('0x31'),auth[_0xaed3('0xa')](),controller[_0xaed3('0x32')]);router['get'](_0xaed3('0x33'),auth['isAuthenticated'](),controller[_0xaed3('0x34')]);router[_0xaed3('0x9')]('/:id/chat_websites',auth['isAuthenticated'](),controller[_0xaed3('0x35')]);router[_0xaed3('0x9')]('/:id/whatsapp_accounts',auth[_0xaed3('0xa')](),controller[_0xaed3('0x36')]);router[_0xaed3('0x9')](_0xaed3('0x37'),auth['isAuthenticated'](),controller[_0xaed3('0x38')]);router['get'](_0xaed3('0x39'),auth[_0xaed3('0xa')](),controller[_0xaed3('0x3a')]);router[_0xaed3('0x9')](_0xaed3('0x3b'),auth[_0xaed3('0xa')](),controller[_0xaed3('0x3c')]);router[_0xaed3('0x3d')](_0xaed3('0x3e'),auth[_0xaed3('0xa')](),controller[_0xaed3('0x3f')]);router[_0xaed3('0x3d')]('/',auth[_0xaed3('0xa')](),controller['create']);router[_0xaed3('0x3d')](_0xaed3('0x40'),auth[_0xaed3('0xa')](),controller[_0xaed3('0x41')]);router['post'](_0xaed3('0x16'),auth[_0xaed3('0xa')](),controller['addQueues']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3f6dee,_0x2b626e,_0x2f4f1d){_0x2f4f1d(null,path[_0xaed3('0x42')](config[_0xaed3('0x43')],_0xaed3('0x44')));},'filename':function(_0x16a8f1,_0x5a7a7f,_0x35248f){_0x35248f(null,util[_0xaed3('0x45')](_0xaed3('0x46'),Date[_0xaed3('0x47')](),_0x5a7a7f[_0xaed3('0x48')]));}})});router[_0xaed3('0x3d')]('/:id/avatar',upload[_0xaed3('0x49')](_0xaed3('0x4a')),controller[_0xaed3('0x4b')]);router['post'](_0xaed3('0x4c'),auth['isAuthenticated'](),controller[_0xaed3('0x4d')]);router[_0xaed3('0x3d')]('/:id/logout',auth[_0xaed3('0xa')](),controller[_0xaed3('0x4e')]);router[_0xaed3('0x3d')](_0xaed3('0x4f'),auth[_0xaed3('0xa')](),controller[_0xaed3('0x50')]);router[_0xaed3('0x3d')](_0xaed3('0x51'),auth[_0xaed3('0xa')](),controller[_0xaed3('0x52')]);router[_0xaed3('0x3d')](_0xaed3('0x25'),auth[_0xaed3('0xa')](),controller[_0xaed3('0x53')]);router['post'](_0xaed3('0x54'),auth[_0xaed3('0xa')](),controller[_0xaed3('0x55')]);router[_0xaed3('0x3d')](_0xaed3('0x56'),auth[_0xaed3('0xa')](),controller['addMailInteractions']);router[_0xaed3('0x3d')](_0xaed3('0x57'),auth[_0xaed3('0xa')](),controller[_0xaed3('0x58')]);router[_0xaed3('0x3d')](_0xaed3('0x59'),auth[_0xaed3('0xa')](),controller['addSmsInteractions']);router[_0xaed3('0x3d')]('/:id/openchannel_interactions',auth[_0xaed3('0xa')](),controller[_0xaed3('0x5a')]);router['post'](_0xaed3('0x5b'),auth[_0xaed3('0xa')](),controller[_0xaed3('0x5c')]);router[_0xaed3('0x3d')](_0xaed3('0x2d'),auth[_0xaed3('0xa')](),controller[_0xaed3('0x5d')]);router[_0xaed3('0x3d')](_0xaed3('0x2f'),auth[_0xaed3('0xa')](),controller['addMailAccounts']);router['post'](_0xaed3('0x31'),auth['isAuthenticated'](),controller['addOpenchannelAccounts']);router[_0xaed3('0x3d')](_0xaed3('0x33'),auth[_0xaed3('0xa')](),controller['addSmsAccounts']);router[_0xaed3('0x3d')]('/:id/chat_websites',auth[_0xaed3('0xa')](),controller[_0xaed3('0x5e')]);router[_0xaed3('0x3d')](_0xaed3('0x5f'),auth[_0xaed3('0xa')](),controller[_0xaed3('0x60')]);router[_0xaed3('0x3d')](_0xaed3('0x37'),auth[_0xaed3('0xa')](),controller[_0xaed3('0x61')]);router[_0xaed3('0x3d')](_0xaed3('0x3b'),auth[_0xaed3('0xa')](),controller[_0xaed3('0x62')]);router[_0xaed3('0x63')]('/:id',auth[_0xaed3('0xa')](),controller[_0xaed3('0x64')]);router[_0xaed3('0x63')](_0xaed3('0x65'),auth[_0xaed3('0xa')](),controller[_0xaed3('0x66')]);router[_0xaed3('0x67')](_0xaed3('0x16'),auth[_0xaed3('0xa')](),controller[_0xaed3('0x68')]);router[_0xaed3('0x67')]('/:id/teams',auth[_0xaed3('0xa')](),controller[_0xaed3('0x69')]);router[_0xaed3('0x67')](_0xaed3('0x6a'),auth[_0xaed3('0xa')](),controller[_0xaed3('0x6b')]);router['delete'](_0xaed3('0x54'),auth[_0xaed3('0xa')](),controller['removeChatInteractions']);router[_0xaed3('0x67')](_0xaed3('0x56'),auth[_0xaed3('0xa')](),controller[_0xaed3('0x6c')]);router[_0xaed3('0x67')](_0xaed3('0x57'),auth[_0xaed3('0xa')](),controller[_0xaed3('0x6d')]);router[_0xaed3('0x67')](_0xaed3('0x59'),auth[_0xaed3('0xa')](),controller[_0xaed3('0x6e')]);router['delete']('/:id/openchannel_interactions',auth[_0xaed3('0xa')](),controller[_0xaed3('0x6f')]);router['delete']('/:id/whatsapp_interactions',auth[_0xaed3('0xa')](),controller[_0xaed3('0x70')]);router[_0xaed3('0x67')]('/:id/fax_accounts',auth['isAuthenticated'](),controller[_0xaed3('0x71')]);router[_0xaed3('0x67')](_0xaed3('0x2f'),auth[_0xaed3('0xa')](),controller[_0xaed3('0x72')]);router['delete'](_0xaed3('0x31'),auth[_0xaed3('0xa')](),controller['removeOpenchannelAccounts']);router[_0xaed3('0x67')]('/:id/sms_accounts',auth[_0xaed3('0xa')](),controller[_0xaed3('0x73')]);router[_0xaed3('0x67')](_0xaed3('0x74'),auth[_0xaed3('0xa')](),controller[_0xaed3('0x75')]);router['delete'](_0xaed3('0x5f'),auth['isAuthenticated'](),controller[_0xaed3('0x76')]);router[_0xaed3('0x67')](_0xaed3('0x37'),auth[_0xaed3('0xa')](),controller[_0xaed3('0x77')]);router[_0xaed3('0x67')]('/:id/api_key',auth[_0xaed3('0xa')](),controller[_0xaed3('0x78')]);module[_0xaed3('0x79')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index 8ae4fbd..63cbf34 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 _0xbecd=['icesupport','dtlsenable','dtlsverify','dtlsprivatekey','rtcp_mux','wss','avpf','dtlssetup','dtlscertfile','/etc/pki/tls/certs/motion.crt','permissions','map','phoneBarEnableScreenRecordingByAgent','true','false','screenrecording','blockedAt','loginAttempts','UNSIGNED','sequelize','util','lodash','STRING','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','fullname','callerid','format','getDataValue','toLowerCase','ENUM','admin','user','agent','telephone','local','internal','accountcode','BOOLEAN','DATE','DEFAULT\x20PAUSE','INTEGER','dynamic','friend','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_FAILED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','shortinfo','inband','auto','yes','update','force_rport,comedia','nat','join','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','allow','ulaw;alaw;gsm','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','always','accept','originate','uac','uas','certificate','passive','actpass','nonat','update,nonat','TEXT','get','isArray','encryption','force_avp'];(function(_0x398e12,_0xd5d86d){var _0x216143=function(_0xffa489){while(--_0xffa489){_0x398e12['push'](_0x398e12['shift']());}};_0x216143(++_0xd5d86d);}(_0xbecd,0x6a));var _0xdbec=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xbecd[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xdbec('0x0'));var moment=require('moment');var util=require(_0xdbec('0x1'));var _=require(_0xdbec('0x2'));module['exports']={'name':{'type':Sequelize[_0xdbec('0x3')],'allowNull':![],'unique':_0xdbec('0x4'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x343f68){this[_0xdbec('0x5')](_0xdbec('0x4'),_0x343f68);this[_0xdbec('0x5')](_0xdbec('0x6'),_0x343f68);},'comment':_0xdbec('0x7')},'fullname':{'type':Sequelize[_0xdbec('0x3')],'allowNull':![],'set':function(_0x38cac4){this[_0xdbec('0x5')](_0xdbec('0x8'),_0x38cac4);this[_0xdbec('0x5')](_0xdbec('0x9'),util[_0xdbec('0xa')]('\x22%s\x22\x20<%s>',_0x38cac4,this[_0xdbec('0xb')]('internal')));}},'alias':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING'],'allowNull':![],'unique':'email','validate':{'isEmail':!![]},'set':function(_0x19c62a){if(_0x19c62a){this[_0xdbec('0x5')]('email',_0x19c62a[_0xdbec('0xc')]());}}},'role':{'type':Sequelize[_0xdbec('0xd')](_0xdbec('0xe'),_0xdbec('0xf'),_0xdbec('0x10'),_0xdbec('0x11')),'allowNull':![]},'password':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0xdbec('0x3')],'defaultValue':_0xdbec('0x12')},'internal':{'type':Sequelize['INTEGER'](0xb),'allowNull':![],'unique':_0xdbec('0x13'),'set':function(_0x109dd7){this['setDataValue'](_0xdbec('0x13'),_0x109dd7);this['setDataValue'](_0xdbec('0x14'),_0x109dd7);this['setDataValue'](_0xdbec('0x9'),util['format']('\x22%s\x22\x20<%s>',this[_0xdbec('0xb')](_0xdbec('0x8')),_0x109dd7));}},'salt':{'type':Sequelize[_0xdbec('0x3')]},'phone':{'type':Sequelize[_0xdbec('0x3')]},'mobile':{'type':Sequelize[_0xdbec('0x3')]},'address':{'type':Sequelize[_0xdbec('0x3')]},'zipcode':{'type':Sequelize[_0xdbec('0x3')]},'userpic':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xdbec('0x3')]},'country':{'type':Sequelize[_0xdbec('0x3')]},'online':{'type':Sequelize[_0xdbec('0x15')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0xdbec('0x16')]},'voicePause':{'type':Sequelize[_0xdbec('0x15')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0xdbec('0x15')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0xdbec('0x15')],'defaultValue':![]},'faxPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsPause':{'type':Sequelize[_0xdbec('0x15')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0xdbec('0x15')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0xdbec('0x15')],'defaultValue':![]},'pauseType':{'type':Sequelize['STRING'],'defaultValue':_0xdbec('0x17')},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize[_0xdbec('0x18')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0xdbec('0x18')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0xdbec('0x18')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0xdbec('0x18')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0xdbec('0x18')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0xdbec('0x18')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0xdbec('0x15')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0xdbec('0x15')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0xdbec('0x18')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0xdbec('0x18')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0xdbec('0x15')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0xdbec('0x18')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0xdbec('0x15')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0xdbec('0x15')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0xdbec('0x15')],'defaultValue':![]},'description':{'type':Sequelize[_0xdbec('0x3')],'allowNull':!![]},'host':{'type':Sequelize[_0xdbec('0x3')],'allowNull':!![],'defaultValue':_0xdbec('0x19')},'ipaddr':{'type':Sequelize[_0xdbec('0x3')],'allowNull':!![]},'port':{'type':Sequelize[_0xdbec('0x18')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0xdbec('0x18')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize['STRING'],'allowNull':!![]},'regserver':{'type':Sequelize[_0xdbec('0x3')],'allowNull':!![]},'useragent':{'type':Sequelize[_0xdbec('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize[_0xdbec('0x18')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0xdbec('0xd')](_0xdbec('0x1a'),_0xdbec('0xf'),'peer'),'allowNull':!![],'defaultValue':_0xdbec('0x1a')},'context':{'type':Sequelize[_0xdbec('0x3')],'allowNull':!![],'defaultValue':_0xdbec('0x1b')},'callingpres':{'type':Sequelize['ENUM'](_0xdbec('0x1c'),'ALLOWED_PASSED_SCREEN',_0xdbec('0x1d'),'ALLOWED',_0xdbec('0x1e'),'PROHIB_PASSED_SCREEN',_0xdbec('0x1f'),_0xdbec('0x20')),'allowNull':!![]},'deny':{'type':Sequelize[_0xdbec('0x3')],'allowNull':!![]},'permit':{'type':Sequelize['STRING'],'allowNull':!![]},'secret':{'type':Sequelize['STRING'],'allowNull':!![]},'md5secret':{'type':Sequelize[_0xdbec('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0xdbec('0x3')],'allowNull':!![]},'transport':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xdbec('0x21'),'set':function(_0x40c6d9){this[_0xdbec('0x5')](_0xdbec('0x22'),_0x40c6d9?_0x40c6d9['join'](','):null);},'get':function(){return this[_0xdbec('0xb')]('transport')?this[_0xdbec('0xb')](_0xdbec('0x22'))[_0xdbec('0x23')](','):null;},'comment':_0xdbec('0x24')},'dtmfmode':{'type':Sequelize[_0xdbec('0xd')](_0xdbec('0x25'),'info',_0xdbec('0x26'),_0xdbec('0x27'),_0xdbec('0x28')),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0xdbec('0xd')](_0xdbec('0x29'),'no','nonat',_0xdbec('0x2a'),'outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xdbec('0xd')](_0xdbec('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xdbec('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0xdbec('0x3')],'allowNull':!![]},'nat':{'type':Sequelize[_0xdbec('0x3')],'allowNull':!![],'defaultValue':_0xdbec('0x2b'),'set':function(_0x4e0f96){this['setDataValue'](_0xdbec('0x2c'),_0x4e0f96?_0x4e0f96[_0xdbec('0x2d')](','):null);},'get':function(){return this['getDataValue'](_0xdbec('0x2c'))?this['getDataValue']('nat')[_0xdbec('0x23')](','):null;},'comment':_0xdbec('0x2e')},'callgroup':{'type':Sequelize[_0xdbec('0x3')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0xdbec('0x3')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xdbec('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xdbec('0x3')]},'disallow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'all'},'allow':{'type':Sequelize[_0xdbec('0x3')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x429a53){this[_0xdbec('0x5')](_0xdbec('0x2f'),_0x429a53?_0x429a53[_0xdbec('0x2d')](';'):_0xdbec('0x30'));},'get':function(){return this[_0xdbec('0xb')](_0xdbec('0x2f'))?this[_0xdbec('0xb')](_0xdbec('0x2f'))[_0xdbec('0x23')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize['ENUM'](_0xdbec('0x29'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize['STRING'],'allowNull':!![],'set':function(_0x48a477){this['setDataValue']('insecure',_0x48a477?_0x48a477['join'](','):null);},'get':function(){return this[_0xdbec('0xb')](_0xdbec('0x31'))?this['getDataValue'](_0xdbec('0x31'))['split'](','):null;},'comment':_0xdbec('0x32')},'trustrpid':{'type':Sequelize['ENUM'](_0xdbec('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0xdbec('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0xdbec('0x29'),'no',_0xdbec('0x33')),'allowNull':!![]},'promiscredir':{'type':Sequelize['ENUM'](_0xdbec('0x29'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0xdbec('0xd')](_0xdbec('0x29'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0xdbec('0x18')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0xdbec('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xdbec('0x34')},'amaflags':{'type':Sequelize['STRING'],'allowNull':!![]},'callcounter':{'type':Sequelize[_0xdbec('0xd')]('yes','no'),'allowNull':!![],'defaultValue':_0xdbec('0x29')},'busylevel':{'type':Sequelize[_0xdbec('0x18')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0xdbec('0xd')]('yes','no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0xdbec('0xd')](_0xdbec('0x29'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0xdbec('0xd')](_0xdbec('0x29'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize['STRING'],'allowNull':!![]},'template':{'type':Sequelize[_0xdbec('0x3')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0xdbec('0xd')](_0xdbec('0x29'),'no',_0xdbec('0x35')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xdbec('0x18')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize['ENUM'](_0xdbec('0x29'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0xdbec('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0xdbec('0xd')](_0xdbec('0x36'),'refuse',_0xdbec('0x37')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0xdbec('0x18')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0xdbec('0x18')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0xdbec('0xd')](_0xdbec('0x38'),'uas'),'allowNull':!![],'defaultValue':_0xdbec('0x39')},'t38pt_usertpsource':{'type':Sequelize[_0xdbec('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize[_0xdbec('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize['STRING'],'allowNull':!![]},'fromuser':{'type':Sequelize[_0xdbec('0x3')],'allowNull':!![]},'qualify':{'type':Sequelize['ENUM'](_0xdbec('0x29'),'no'),'allowNull':!![],'defaultValue':_0xdbec('0x29')},'keepalive':{'type':Sequelize[_0xdbec('0x18')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0xdbec('0x3')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0xdbec('0x3')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0xdbec('0x18')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0xdbec('0x18')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0xdbec('0x18')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0xdbec('0xd')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xdbec('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0xdbec('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize[_0xdbec('0x18')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0xdbec('0x18')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0xdbec('0x18')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize['STRING'],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0xdbec('0x3')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0xdbec('0x3')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0xdbec('0x3')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0xdbec('0x3')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0xdbec('0x18')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0xdbec('0xd')](_0xdbec('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0xdbec('0xd')](_0xdbec('0x29'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0xdbec('0xd')](_0xdbec('0x29'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM'](_0xdbec('0x29'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM'](_0xdbec('0x29'),'no','fingerprint',_0xdbec('0x3a')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0xdbec('0x18')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0xdbec('0x3')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0xdbec('0x3')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0xdbec('0x3')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0xdbec('0x3')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0xdbec('0xd')]('active',_0xdbec('0x3b'),_0xdbec('0x3c')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING'],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0xdbec('0xd')](_0xdbec('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xdbec('0x3')],'allowNull':!![]},'recordofffeature':{'type':Sequelize['STRING'],'allowNull':!![]},'call_limit':{'type':Sequelize[_0xdbec('0x18')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0xdbec('0xd')]('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize['ENUM'](_0xdbec('0x29'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0xdbec('0x3')],'allowNull':!![]},'mohinterpret':{'type':Sequelize['STRING'],'allowNull':!![]},'mohsuggest':{'type':Sequelize['STRING'],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0xdbec('0x3')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0xdbec('0xd')](_0xdbec('0x29'),'no',_0xdbec('0x3d'),_0xdbec('0x2a'),_0xdbec('0x3e')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0xdbec('0x15')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0xdbec('0x3')]},'resetPasswordExpires':{'type':Sequelize[_0xdbec('0x16')]},'passwordResetAt':{'type':Sequelize['DATE'],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0xdbec('0x3f')]},'showWebBar':{'type':Sequelize[_0xdbec('0x18')],'defaultValue':0x0,'set':function(_0x43d839){this[_0xdbec('0x5')]('showWebBar',_0x43d839);var _0xaea659=this[_0xdbec('0x40')]({'plain':!![]});switch(_0x43d839){case 0x0:case 0x1:var _0x2ff4b3=_0xaea659[_0xdbec('0x22')]?_[_0xdbec('0x41')](_0xaea659[_0xdbec('0x22')])?_0xaea659[_0xdbec('0x22')]['join']():_0xaea659['transport']:'udp';if(_0x2ff4b3==='wss'){_0x2ff4b3=_0xdbec('0x21');}this['setDataValue']('transport',_0x2ff4b3);this[_0xdbec('0x5')](_0xdbec('0x42'),'no');this[_0xdbec('0x5')]('avpf',null);this[_0xdbec('0x5')](_0xdbec('0x43'),null);this[_0xdbec('0x5')](_0xdbec('0x44'),null);this[_0xdbec('0x5')](_0xdbec('0x45'),null);this['setDataValue'](_0xdbec('0x46'),null);this[_0xdbec('0x5')]('dtlssetup',null);this[_0xdbec('0x5')]('dtlscertfile',null);this[_0xdbec('0x5')](_0xdbec('0x47'),null);this[_0xdbec('0x5')](_0xdbec('0x48'),'no');break;case 0x2:this[_0xdbec('0x5')](_0xdbec('0x22'),_0xdbec('0x49'));this[_0xdbec('0x5')](_0xdbec('0x42'),_0xdbec('0x29'));this['setDataValue'](_0xdbec('0x4a'),_0xdbec('0x29'));this[_0xdbec('0x5')](_0xdbec('0x43'),_0xdbec('0x29'));this[_0xdbec('0x5')](_0xdbec('0x44'),'yes');this[_0xdbec('0x5')](_0xdbec('0x45'),_0xdbec('0x29'));this[_0xdbec('0x5')](_0xdbec('0x46'),'no');this[_0xdbec('0x5')](_0xdbec('0x4b'),_0xdbec('0x3c'));this['setDataValue'](_0xdbec('0x4c'),_0xaea659[_0xdbec('0x4c')]||_0xdbec('0x4d'));this['setDataValue'](_0xdbec('0x47'),_0xaea659['dtlsprivatekey']||'/etc/pki/tls/private/motion.key');this['setDataValue'](_0xdbec('0x48'),_0xdbec('0x29'));break;default:}}},'permissions':{'type':Sequelize[_0xdbec('0x3f')],'set':function(_0x59d797){this[_0xdbec('0x5')](_0xdbec('0x4e'),_0x59d797?_0x59d797[_0xdbec('0x2d')](','):[]);},'get':function(){return this[_0xdbec('0xb')](_0xdbec('0x4e'))?_[_0xdbec('0x4f')](this[_0xdbec('0xb')](_0xdbec('0x4e'))[_0xdbec('0x23')](','),function(_0x22fef7){return parseInt(_0x22fef7,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0xdbec('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0xdbec('0x3')]},'phoneBarBusyNumber':{'type':Sequelize[_0xdbec('0x3')]},'phoneBarUnconditional':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0xdbec('0x15')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0xdbec('0x15')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0xdbec('0x15')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0xdbec('0x15')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0xdbec('0x18')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0xdbec('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0xdbec('0x18')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0xdbec('0xd')](_0xdbec('0x29'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0xdbec('0x15')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0xdbec('0x3')]},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xdbec('0xb')](_0xdbec('0x50'))?this['getDataValue']('phoneBarEnableScreenRecordingByAgent'):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0xdbec('0x15')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0xdbec('0x15')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0xdbec('0x15')],'defaultValue':![]},'interface':{'type':Sequelize['STRING'],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0xdbec('0x3')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0xdbec('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0xdbec('0x15')],'defaultValue':![],'set':function(_0x14d56b){if(typeof _0x14d56b==='string'){var _0x2554e2=_0x14d56b==='1'?!![]:_0x14d56b==='0'?![]:_0x14d56b===_0xdbec('0x51')?!![]:_0x14d56b===_0xdbec('0x52')?![]:![];this[_0xdbec('0x5')](_0xdbec('0x53'),_0x2554e2);}else{this[_0xdbec('0x5')](_0xdbec('0x53'),_0x14d56b);}}},'blocked':{'type':Sequelize[_0xdbec('0x15')],'defaultValue':![],'set':function(_0x234346){this[_0xdbec('0x5')]('blocked',_0x234346);if(_0x234346===!![]){this['setDataValue'](_0xdbec('0x54'),moment());this['setDataValue'](_0xdbec('0x55'),0x0);}else{this[_0xdbec('0x5')]('blockedAt',null);}}},'blockedAt':{'type':Sequelize[_0xdbec('0x16')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0xdbec('0x18')],'defaultValue':0x0},'disabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'settingsEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0xdbec('0x18')](0x5)[_0xdbec('0x56')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0xdbec('0x15')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xdbec('0x15')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xdbec('0x15')],'defaultValue':!![]}}; \ No newline at end of file +var _0xbb61=['nonat','update','outgoing','force_rport,comedia','nat','split','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','never','\x22\x22\x20<>','always','accept','originate','uac','uas','fingerprint','certificate','active','passive','actpass','update,nonat','TEXT','showWebBar','get','isArray','encryption','force_avp','icesupport','dtlsverify','dtlssetup','dtlscertfile','dtlsprivatekey','rtcp_mux','wss','avpf','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','permissions','map','true','false','screenrecording','blockedAt','UNSIGNED','sequelize','util','lodash','exports','STRING','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','internal','email','agent','telephone','local','INTEGER','accountcode','DATE','BOOLEAN','dynamic','friend','from-sip','ENUM','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','udp','transport','join','rfc2833','shortinfo','auto','yes'];(function(_0x4a3dc5,_0xa878cd){var _0x27ff50=function(_0x5a4bc8){while(--_0x5a4bc8){_0x4a3dc5['push'](_0x4a3dc5['shift']());}};_0x27ff50(++_0xa878cd);}(_0xbb61,0x131));var _0x1bb6=function(_0x1e4360,_0x930b9b){_0x1e4360=_0x1e4360-0x0;var _0x31e6b4=_0xbb61[_0x1e4360];return _0x31e6b4;};'use strict';var Sequelize=require(_0x1bb6('0x0'));var moment=require('moment');var util=require(_0x1bb6('0x1'));var _=require(_0x1bb6('0x2'));module[_0x1bb6('0x3')]={'name':{'type':Sequelize[_0x1bb6('0x4')],'allowNull':![],'unique':_0x1bb6('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0xb6f0ac){this[_0x1bb6('0x6')]('name',_0xb6f0ac);this[_0x1bb6('0x6')](_0x1bb6('0x7'),_0xb6f0ac);},'comment':_0x1bb6('0x8')},'fullname':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x362383){this[_0x1bb6('0x6')](_0x1bb6('0x9'),_0x362383);this['setDataValue'](_0x1bb6('0xa'),util[_0x1bb6('0xb')](_0x1bb6('0xc'),_0x362383,this[_0x1bb6('0xd')](_0x1bb6('0xe'))));}},'alias':{'type':Sequelize[_0x1bb6('0x4')]},'email':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x1bb6('0xf'),'validate':{'isEmail':!![]},'set':function(_0x29ee41){if(_0x29ee41){this['setDataValue'](_0x1bb6('0xf'),_0x29ee41['toLowerCase']());}}},'role':{'type':Sequelize['ENUM']('admin','user',_0x1bb6('0x10'),_0x1bb6('0x11')),'allowNull':![]},'password':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':_0x1bb6('0x12')},'internal':{'type':Sequelize[_0x1bb6('0x13')](0xb),'allowNull':![],'unique':_0x1bb6('0xe'),'set':function(_0x93768a){this[_0x1bb6('0x6')](_0x1bb6('0xe'),_0x93768a);this[_0x1bb6('0x6')](_0x1bb6('0x14'),_0x93768a);this['setDataValue'](_0x1bb6('0xa'),util[_0x1bb6('0xb')](_0x1bb6('0xc'),this[_0x1bb6('0xd')](_0x1bb6('0x9')),_0x93768a));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x1bb6('0x4')]},'mobile':{'type':Sequelize[_0x1bb6('0x4')]},'address':{'type':Sequelize[_0x1bb6('0x4')]},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize[_0x1bb6('0x4')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x1bb6('0x4')]},'online':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x1bb6('0x15')]},'voicePause':{'type':Sequelize[_0x1bb6('0x16')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x1bb6('0x16')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x1bb6('0x16')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x1bb6('0x16')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x1bb6('0x16')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x1bb6('0x16')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x1bb6('0x16')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x1bb6('0x4')],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize[_0x1bb6('0x15')]},'chatCapacity':{'type':Sequelize[_0x1bb6('0x13')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x1bb6('0x13')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x1bb6('0x13')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x1bb6('0x13')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x1bb6('0x13')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x1bb6('0x13')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x1bb6('0x16')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x1bb6('0x16')],'defaultValue':![]},'chanspy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0x1bb6('0x4')],'allowNull':!![]},'host':{'type':Sequelize[_0x1bb6('0x4')],'allowNull':!![],'defaultValue':_0x1bb6('0x17')},'ipaddr':{'type':Sequelize[_0x1bb6('0x4')],'allowNull':!![]},'port':{'type':Sequelize[_0x1bb6('0x13')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize['STRING'],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0x1bb6('0x4')],'allowNull':!![]},'lastms':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'type':{'type':Sequelize['ENUM'](_0x1bb6('0x18'),'user','peer'),'allowNull':!![],'defaultValue':_0x1bb6('0x18')},'context':{'type':Sequelize[_0x1bb6('0x4')],'allowNull':!![],'defaultValue':_0x1bb6('0x19')},'callingpres':{'type':Sequelize[_0x1bb6('0x1a')]('ALLOWED_NOT_SCREENED',_0x1bb6('0x1b'),_0x1bb6('0x1c'),'ALLOWED',_0x1bb6('0x1d'),_0x1bb6('0x1e'),_0x1bb6('0x1f'),'PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize[_0x1bb6('0x4')],'allowNull':!![]},'permit':{'type':Sequelize[_0x1bb6('0x4')],'allowNull':!![]},'secret':{'type':Sequelize[_0x1bb6('0x4')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x1bb6('0x4')],'allowNull':!![]},'remotesecret':{'type':Sequelize['STRING'],'allowNull':!![]},'transport':{'type':Sequelize[_0x1bb6('0x4')],'allowNull':!![],'defaultValue':_0x1bb6('0x20'),'set':function(_0x4f8565){this[_0x1bb6('0x6')](_0x1bb6('0x21'),_0x4f8565?_0x4f8565[_0x1bb6('0x22')](','):null);},'get':function(){return this['getDataValue'](_0x1bb6('0x21'))?this[_0x1bb6('0xd')](_0x1bb6('0x21'))['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0x1bb6('0x1a')](_0x1bb6('0x23'),'info',_0x1bb6('0x24'),'inband',_0x1bb6('0x25')),'allowNull':!![],'defaultValue':_0x1bb6('0x23')},'directmedia':{'type':Sequelize[_0x1bb6('0x1a')](_0x1bb6('0x26'),'no',_0x1bb6('0x27'),_0x1bb6('0x28'),_0x1bb6('0x29')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0x1bb6('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x1bb6('0x4')],'allowNull':!![]},'directmediadeny':{'type':Sequelize['STRING'],'allowNull':!![]},'nat':{'type':Sequelize[_0x1bb6('0x4')],'allowNull':!![],'defaultValue':_0x1bb6('0x2a'),'set':function(_0x41363f){this[_0x1bb6('0x6')](_0x1bb6('0x2b'),_0x41363f?_0x41363f[_0x1bb6('0x22')](','):null);},'get':function(){return this[_0x1bb6('0xd')](_0x1bb6('0x2b'))?this['getDataValue'](_0x1bb6('0x2b'))[_0x1bb6('0x2c')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x1bb6('0x4')]},'namedcallgroup':{'type':Sequelize[_0x1bb6('0x4')]},'pickupgroup':{'type':Sequelize[_0x1bb6('0x4')]},'namedpickupgroup':{'type':Sequelize[_0x1bb6('0x4')]},'language':{'type':Sequelize[_0x1bb6('0x4')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x1bb6('0x4')]},'disallow':{'type':Sequelize[_0x1bb6('0x4')],'allowNull':![],'defaultValue':_0x1bb6('0x2d')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x1bb6('0x2e'),'set':function(_0x4a2a62){this[_0x1bb6('0x6')](_0x1bb6('0x2f'),_0x4a2a62?_0x4a2a62[_0x1bb6('0x22')](';'):_0x1bb6('0x2e'));},'get':function(){return this[_0x1bb6('0xd')](_0x1bb6('0x2f'))?this[_0x1bb6('0xd')](_0x1bb6('0x2f'))['split'](';'):null;},'comment':_0x1bb6('0x30')},'autoframing':{'type':Sequelize['ENUM'](_0x1bb6('0x26'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x1bb6('0x4')],'allowNull':!![],'set':function(_0x720fa5){this[_0x1bb6('0x6')](_0x1bb6('0x31'),_0x720fa5?_0x720fa5[_0x1bb6('0x22')](','):null);},'get':function(){return this[_0x1bb6('0xd')]('insecure')?this['getDataValue'](_0x1bb6('0x31'))['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x1bb6('0x1a')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x1bb6('0x1a')](_0x1bb6('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x1bb6('0x1a')]('yes','no',_0x1bb6('0x32')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x1bb6('0x1a')]('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize['ENUM'](_0x1bb6('0x26'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x1bb6('0x13')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x1bb6('0x4')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x1bb6('0x4')],'allowNull':!![],'defaultValue':_0x1bb6('0x33')},'amaflags':{'type':Sequelize[_0x1bb6('0x4')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x1bb6('0x1a')]('yes','no'),'allowNull':!![],'defaultValue':'yes'},'busylevel':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x1bb6('0x1a')](_0x1bb6('0x26'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x1bb6('0x1a')](_0x1bb6('0x26'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize['ENUM'](_0x1bb6('0x26'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x1bb6('0x4')],'allowNull':!![]},'template':{'type':Sequelize[_0x1bb6('0x4')],'allowNull':!![]},'videosupport':{'type':Sequelize['ENUM'](_0x1bb6('0x26'),'no',_0x1bb6('0x34')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x1bb6('0x1a')](_0x1bb6('0x26'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x1bb6('0x4')],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM'](_0x1bb6('0x35'),'refuse',_0x1bb6('0x36')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x1bb6('0x13')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x1bb6('0x1a')](_0x1bb6('0x37'),'uas'),'allowNull':!![],'defaultValue':_0x1bb6('0x38')},'t38pt_usertpsource':{'type':Sequelize['STRING'],'allowNull':!![]},'regexten':{'type':Sequelize['STRING'],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x1bb6('0x4')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x1bb6('0x4')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x1bb6('0x1a')](_0x1bb6('0x26'),'no'),'allowNull':!![],'defaultValue':_0x1bb6('0x26')},'keepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x1bb6('0x4')],'allowNull':!![]},'defaultuser':{'type':Sequelize['STRING'],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x1bb6('0x13')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x1bb6('0x13')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x1bb6('0x13')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x1bb6('0x1a')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING'],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x1bb6('0x4')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x1bb6('0x13')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x1bb6('0x13')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x1bb6('0x13')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x1bb6('0x4')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x1bb6('0x4')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x1bb6('0x4')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x1bb6('0x4')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x1bb6('0x4')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x1bb6('0x13')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x1bb6('0x1a')](_0x1bb6('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x1bb6('0x26'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x1bb6('0x1a')](_0x1bb6('0x26'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x1bb6('0x1a')](_0x1bb6('0x26'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x1bb6('0x1a')]('yes','no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x1bb6('0x1a')]('yes','no',_0x1bb6('0x39'),_0x1bb6('0x3a')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x1bb6('0x13')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x1bb6('0x4')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x1bb6('0x4')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x1bb6('0x4')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x1bb6('0x4')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x1bb6('0x4')],'allowNull':!![]},'dtlssetup':{'type':Sequelize['ENUM'](_0x1bb6('0x3b'),_0x1bb6('0x3c'),_0x1bb6('0x3d')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x1bb6('0x4')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x1bb6('0x1a')](_0x1bb6('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x1bb6('0x4')],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x1bb6('0x1a')](_0x1bb6('0x26'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x1bb6('0x1a')](_0x1bb6('0x26'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x1bb6('0x4')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x1bb6('0x4')],'allowNull':!![]},'mohsuggest':{'type':Sequelize['STRING'],'allowNull':!![]},'parkinglot':{'type':Sequelize['STRING'],'allowNull':!![]},'canreinvite':{'type':Sequelize['ENUM']('yes','no',_0x1bb6('0x27'),_0x1bb6('0x28'),_0x1bb6('0x3e')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x1bb6('0x16')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x1bb6('0x4')]},'resetPasswordExpires':{'type':Sequelize[_0x1bb6('0x15')]},'passwordResetAt':{'type':Sequelize['DATE'],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x1bb6('0x3f')]},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x2e33aa){this['setDataValue'](_0x1bb6('0x40'),_0x2e33aa);var _0x3f358c=this[_0x1bb6('0x41')]({'plain':!![]});switch(_0x2e33aa){case 0x0:case 0x1:var _0x1a3a84=_0x3f358c[_0x1bb6('0x21')]?_[_0x1bb6('0x42')](_0x3f358c['transport'])?_0x3f358c[_0x1bb6('0x21')][_0x1bb6('0x22')]():_0x3f358c['transport']:_0x1bb6('0x20');if(_0x1a3a84==='wss'){_0x1a3a84=_0x1bb6('0x20');}this['setDataValue'](_0x1bb6('0x21'),_0x1a3a84);this[_0x1bb6('0x6')](_0x1bb6('0x43'),'no');this[_0x1bb6('0x6')]('avpf',null);this[_0x1bb6('0x6')](_0x1bb6('0x44'),null);this[_0x1bb6('0x6')](_0x1bb6('0x45'),null);this[_0x1bb6('0x6')]('dtlsenable',null);this['setDataValue'](_0x1bb6('0x46'),null);this[_0x1bb6('0x6')](_0x1bb6('0x47'),null);this[_0x1bb6('0x6')](_0x1bb6('0x48'),null);this[_0x1bb6('0x6')](_0x1bb6('0x49'),null);this[_0x1bb6('0x6')](_0x1bb6('0x4a'),'no');break;case 0x2:this[_0x1bb6('0x6')](_0x1bb6('0x21'),_0x1bb6('0x4b'));this[_0x1bb6('0x6')]('encryption',_0x1bb6('0x26'));this[_0x1bb6('0x6')](_0x1bb6('0x4c'),_0x1bb6('0x26'));this['setDataValue']('force_avp','yes');this[_0x1bb6('0x6')](_0x1bb6('0x45'),_0x1bb6('0x26'));this[_0x1bb6('0x6')]('dtlsenable',_0x1bb6('0x26'));this[_0x1bb6('0x6')](_0x1bb6('0x46'),'no');this[_0x1bb6('0x6')](_0x1bb6('0x47'),_0x1bb6('0x3d'));this[_0x1bb6('0x6')](_0x1bb6('0x48'),_0x3f358c[_0x1bb6('0x48')]||_0x1bb6('0x4d'));this[_0x1bb6('0x6')](_0x1bb6('0x49'),_0x3f358c[_0x1bb6('0x49')]||_0x1bb6('0x4e'));this[_0x1bb6('0x6')]('rtcp_mux','yes');break;default:}}},'permissions':{'type':Sequelize[_0x1bb6('0x3f')],'set':function(_0x163711){this['setDataValue'](_0x1bb6('0x4f'),_0x163711?_0x163711[_0x1bb6('0x22')](','):[]);},'get':function(){return this['getDataValue'](_0x1bb6('0x4f'))?_[_0x1bb6('0x50')](this[_0x1bb6('0xd')](_0x1bb6('0x4f'))[_0x1bb6('0x2c')](','),function(_0x1bae9e){return parseInt(_0x1bae9e,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x1bb6('0x4')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x1bb6('0x4')]},'phoneBarBusyNumber':{'type':Sequelize['STRING']},'phoneBarUnconditional':{'type':Sequelize[_0x1bb6('0x16')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x1bb6('0x16')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x1bb6('0x16')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x1bb6('0x13')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize['STRING'],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x1bb6('0x13')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x1bb6('0x1a')](_0x1bb6('0x26'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x1bb6('0x16')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x1bb6('0x4')]},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x1bb6('0x16')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x1bb6('0xd')]('phoneBarEnableScreenRecordingByAgent')?this[_0x1bb6('0xd')]('phoneBarEnableScreenRecordingByAgent'):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x1bb6('0x16')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x1bb6('0x16')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x1bb6('0x16')],'defaultValue':![]},'interface':{'type':Sequelize[_0x1bb6('0x4')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x1bb6('0x16')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x1bb6('0x4')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x1bb6('0x4')],'allowNull':!![]},'screenrecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x4e3011){if(typeof _0x4e3011==='string'){var _0x30ef4c=_0x4e3011==='1'?!![]:_0x4e3011==='0'?![]:_0x4e3011===_0x1bb6('0x51')?!![]:_0x4e3011===_0x1bb6('0x52')?![]:![];this[_0x1bb6('0x6')](_0x1bb6('0x53'),_0x30ef4c);}else{this[_0x1bb6('0x6')]('screenrecording',_0x4e3011);}}},'blocked':{'type':Sequelize[_0x1bb6('0x16')],'defaultValue':![],'set':function(_0x71a4d9){this[_0x1bb6('0x6')]('blocked',_0x71a4d9);if(_0x71a4d9===!![]){this['setDataValue'](_0x1bb6('0x54'),moment());this[_0x1bb6('0x6')]('loginAttempts',0x0);}else{this[_0x1bb6('0x6')]('blockedAt',null);}}},'blockedAt':{'type':Sequelize['DATE'],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x1bb6('0x13')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x1bb6('0x16')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'wssPort':{'type':Sequelize['INTEGER'](0x5)[_0x1bb6('0x55')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x1bb6('0x16')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x1bb6('0x16')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index f02fff2..a32e51b 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 _0xafcd=['sms','fax','openchannel','whatsapp','all','catch','show','model','differenceBy','keys','intersection','fields','merge','options','mail','update','body','params','describe','addContacts','ids','omit','findById','securePassword','validatePasswordPattern','max','internal','min_internal','isNil','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)','from','voicemail','fullname','email','agent','permissions','101','102','103','113','110','104','105','107','108','109','100','111','114','create','Unauthorized','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','settingsEnabled','userProfileId','VoiceMail','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','bulkCreate','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','checkUserLimits','findAll','Telephones','compact','newPassword','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','oldPassword','Sequelize','ValidationError','Invalid\x20body\x20format.\x20Use\x20newPassword','Setting','enforcePasswordHistory','passwordHistoryLimit','validatePasswordHistory','updatePasswordsHistory','loginInPause','interface','isValidChannel','Unknown\x20channel','add','capitalize','toLowerCase','Queues','spread','QueueId','emit','Queue:save','voice','VoiceQueue','online','format','SIP/%s','voicePause','penalty','UserVoiceQueueRt','upsert','channel','remove','isArray','Queue:remove','userpic','getAvatar','join','server/files/images/logos/default_profile.png','download','root','server/files/images/','getOpenTabs','ChatOpenTabs','CHAT','FaxOpenTabs','FAX','createdAt','OpenchannelOpenTabs','OPENCHANNEL','MailOpenTabs','MAIL','SMS','WhatsappOpenTabs','WHATSAPP','getContacts','findOne','rawAttributes','filters','order','sort','pick','filter','hasOwnProperty','include','CmList','Tag','Tags','color','tag','getQueues','Queue','Unknown\x20role','nolimit','getVoiceQueuesRt','getGroups','getRecordings','VoiceRecording','UserId','getScreenRecordings','ScreenRecording','ChatInteraction','getChatInteractions','getOpenchannelInteractions','OpenchannelInteraction','getMailInteractions','MailInteraction','SmsInteraction','getSmsInteractions','getFaxInteractions','getWhatsappInteractions','login','mobile','LOCAL/%s@from-sip/n','intrf','user:%s','user:forcelogout','x-forwarded-for','connection','remoteAddress','socket','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','UserVoiceQueue.penalty','each','forEach','YYYY-MM-DD\x20HH:mm:ss','getChannels','LOGIN','device','MemberReport','concat','isMiddleware','resolve','logout','pause','QueuePause','PAUSE','updateAttributes','DEFAULT\x20PAUSE','chatPause','faxPause','openchannelPause','smsPause','whatsapppause','pauseType','lastPauseAt','manual','set','Pause','unpause','getTeams','Team','addTeams','setDataValue','Voice','getChatQueues','getMailQueues','Mail','Sms','getWhatsappQueues','Whatsapp','getFaxQueues','Fax','getOpenchannelQueues','Openchannel','flatten','transaction','addAgent','getDataValue','TeamVoicePrefix','UserVoicePrefix','removeTeams','Chat','getSmsQueues','VoicePrefixId','getLists','getAgents','values','send','addChatInteractions','user_has_chat_interactions:save','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','getVoicePrefixes','VoicePrefix','FaxAccount','getFaxAccounts','addFaxAccounts','removeFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','addSmsAccounts','removeSmsAccounts','ChatWebsite','getChatWebsites','addChatWebsites','removeChatWebsites','getWhatsappAccounts','WhatsappAccount','addWhatsappAccounts','removeWhatsappAccounts','getSquareProjects','addSquareProjects','removeSquareProjects','getScheduledCalls','CmHopper','$and','$or','$gte','$lte','$ne','$eq','$not','$between','$notBetween','$in','$notIn','$like','$notLike','$iLike','$notILike','$overlap','$contains','$any','firstName','lastName','phone','dialActive','getApiKey','retrieveApiKey','token','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','generateApiKey','nonce','apiKeyNonce','apiKeyIat','API\x20key\x20not\x20available','teams','queues','isEmpty','inbound','lower','col','asc','desc','substring','uniqBy','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','offline','idle','unknown','unavailable','voiceStatus','busy','slice','charAt','QueryTypes','SELECT','select','field','ui.','InteractionId','ui.createdAt','user_has_','_interactions','toString','OpenTabs','moment','bluebird','util','path','lodash','squel','jayson/promise','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','socket.io-emitter','redis','./user.socket','register','defaults','localhost','client','http','request','User,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','info','result','status','json','undefined','limit','count','offset','Content-Range','then','destroy','get','role','admin','user','Agents','telephone','map','value','find','name','UserProfileResource','end','sendStatus','index','User','fieldName','type','key','includes','password','getOptions','where','query','includeAll','attributes','push','rows','openTabs','true','length','chat','dataValues'];(function(_0x562c57,_0x288593){var _0x374e32=function(_0x25da25){while(--_0x25da25){_0x562c57['push'](_0x562c57['shift']());}};_0x374e32(++_0x288593);}(_0xafcd,0x157));var _0xdafc=function(_0x36782c,_0x38c321){_0x36782c=_0x36782c-0x0;var _0xd4e417=_0xafcd[_0x36782c];return _0xd4e417;};'use strict';var moment=require(_0xdafc('0x0'));var BPromise=require(_0xdafc('0x1'));var util=require(_0xdafc('0x2'));var path=require(_0xdafc('0x3'));var fs=require('fs');var _=require(_0xdafc('0x4'));var squel=require(_0xdafc('0x5'));var jayson=require(_0xdafc('0x6'));var Redis=require('ioredis');var authService=require(_0xdafc('0x7'));var qs=require(_0xdafc('0x8'));var logger=require(_0xdafc('0x9'))('api');var utils=require(_0xdafc('0xa'));var config=require(_0xdafc('0xb'));var licenseUtil=require(_0xdafc('0xc'));var db=require('../../mysqldb')['db'];var socket=require(_0xdafc('0xd'))(new Redis(config[_0xdafc('0xe')]));require(_0xdafc('0xf'))[_0xdafc('0x10')](socket);config[_0xdafc('0xe')]=_[_0xdafc('0x11')](config[_0xdafc('0xe')],{'host':_0xdafc('0x12'),'port':0x18eb});var client=jayson[_0xdafc('0x13')][_0xdafc('0x14')]({'port':0x232a});var values;function respondWithRpcPromise(_0x39561b,_0x5c6c14,_0x5b06a0,_0x2a1a6b){return new BPromise(function(_0x28f756,_0x19f461){var _0xafac3e=_0x2a1a6b||client;return _0xafac3e[_0xdafc('0x15')](_0x39561b,_0x5b06a0)['then'](function(_0x4b7efe){logger['info'](_0xdafc('0x16'),_0x5c6c14,'request\x20sent');logger[_0xdafc('0x17')]('User,\x20%s,\x20%s,\x20%s',_0x5c6c14,_0xdafc('0x18'),JSON[_0xdafc('0x19')](_0x4b7efe));if(_0x4b7efe[_0xdafc('0x1a')]){if(_0x4b7efe[_0xdafc('0x1a')]['code']===0x1f4){logger['error'](_0xdafc('0x16'),_0x5c6c14,_0x4b7efe[_0xdafc('0x1a')][_0xdafc('0x1b')]);return _0x19f461(_0x4b7efe['error']['message']);}logger[_0xdafc('0x1a')](_0xdafc('0x16'),_0x5c6c14,_0x4b7efe[_0xdafc('0x1a')][_0xdafc('0x1b')]);return _0x28f756(_0x4b7efe[_0xdafc('0x1a')][_0xdafc('0x1b')]);}else{logger[_0xdafc('0x1c')](_0xdafc('0x16'),_0x5c6c14,'request\x20sent');_0x28f756(_0x4b7efe[_0xdafc('0x1d')][_0xdafc('0x1b')]);}})['catch'](function(_0x239908){logger[_0xdafc('0x1a')](_0xdafc('0x16'),_0x5c6c14,_0x239908);_0x19f461(_0x239908);});});}function respondWithStatusCode(_0xd70f29,_0x44f8f8){_0x44f8f8=_0x44f8f8||0xcc;return function(_0xbb92d5){if(_0xbb92d5){return _0xd70f29['sendStatus'](_0x44f8f8);}return _0xd70f29['status'](_0x44f8f8)['end']();};}function respondWithResult(_0x467f8b,_0x489890){_0x489890=_0x489890||0xc8;return function(_0x159d51){if(_0x159d51){return _0x467f8b[_0xdafc('0x1e')](_0x489890)[_0xdafc('0x1f')](_0x159d51);}};}function respondWithFilteredResult(_0x17c2f6,_0x5be20a){return function(_0x41ff90){if(_0x41ff90){var _0x4fd6ff=typeof _0x5be20a['offset']===_0xdafc('0x20')&&typeof _0x5be20a[_0xdafc('0x21')]===_0xdafc('0x20');var _0x3d3f06=_0x41ff90[_0xdafc('0x22')];var _0x181418=_0x4fd6ff?0x0:_0x5be20a[_0xdafc('0x23')];var _0x4a98c5=_0x4fd6ff?_0x41ff90[_0xdafc('0x22')]:_0x5be20a[_0xdafc('0x23')]+_0x5be20a['limit'];var _0x29b376;if(_0x4a98c5>=_0x3d3f06){_0x4a98c5=_0x3d3f06;_0x29b376=0xc8;}else{_0x29b376=0xce;}_0x17c2f6['status'](_0x29b376);return _0x17c2f6['set'](_0xdafc('0x24'),_0x181418+'-'+_0x4a98c5+'/'+_0x3d3f06)['json'](_0x41ff90);}return null;};}function saveUpdates(_0x2fbc2b){return function(_0xf9803e){if(_0xf9803e){return _0xf9803e['update'](_0x2fbc2b)[_0xdafc('0x25')](function(_0x56e096){return _0x56e096;});}return null;};}function removeEntity(_0x59425c){return function(_0x4ff3d9){if(_0x4ff3d9){return _0x4ff3d9[_0xdafc('0x26')]()[_0xdafc('0x25')](function(){var _0x1fe569=_0x4ff3d9[_0xdafc('0x27')]({'plain':!![]});if(_0x1fe569[_0xdafc('0x28')]===_0xdafc('0x29'))return;var _0x6ba16e=[{'name':'Users','value':_0xdafc('0x2a'),'ignore':!![]},{'name':_0xdafc('0x2b'),'value':'agent','ignore':![]},{'name':'Telephones','value':_0xdafc('0x2c'),'ignore':![]}];var _0x727050=_(_0x6ba16e)['filter']('ignore')[_0xdafc('0x2d')](_0xdafc('0x2e'))['value']();if(_['includes'](_0x727050,_0x1fe569['role'])){return;}var _0x54a291=_[_0xdafc('0x2f')](_0x6ba16e,['value',_0x1fe569[_0xdafc('0x28')]])[_0xdafc('0x30')];return db[_0xdafc('0x31')][_0xdafc('0x26')]({'where':{'type':_0x54a291,'resourceId':_0x1fe569['id']}})['then'](function(){return _0x4ff3d9;});})[_0xdafc('0x25')](function(){_0x59425c[_0xdafc('0x1e')](0xcc)[_0xdafc('0x32')]();});}};}function handleEntityNotFound(_0x15b9bf){return function(_0x28c94b){if(!_0x28c94b){_0x15b9bf[_0xdafc('0x33')](0x194);}return _0x28c94b;};}function handleError(_0x56c87c,_0xb7561b){_0xb7561b=_0xb7561b||0x1f4;return function(_0x413862){logger[_0xdafc('0x1a')](_0x413862['stack']);if(_0x413862[_0xdafc('0x30')]){delete _0x413862['name'];}_0x56c87c[_0xdafc('0x1e')](_0xb7561b)['send'](_0x413862);};}exports[_0xdafc('0x34')]=function(_0x2429b2,_0x1e5ab1){var _0x52ff5b={},_0x28c803={'count':0x0,'rows':[]};var _0x1a2b2d=_(db[_0xdafc('0x35')]['rawAttributes'])[_0xdafc('0x2d')](function(_0x49ae9e){return{'name':_0x49ae9e[_0xdafc('0x36')],'type':_0x49ae9e[_0xdafc('0x37')][_0xdafc('0x38')]};})['filter'](function(_0x4918bd){return!_[_0xdafc('0x39')]([_0xdafc('0x3a'),'salt'],_0x4918bd[_0xdafc('0x30')]);})['value']();_0x52ff5b=qs[_0xdafc('0x3b')](_0x1a2b2d,_0x2429b2);var _0x2320d3={'where':_0x52ff5b[_0xdafc('0x3c')]};return db['User']['count'](_0x2320d3)['then'](function(_0x14042b){_0x28c803[_0xdafc('0x22')]=_0x14042b;if(_0x2429b2[_0xdafc('0x3d')][_0xdafc('0x3e')]){_0x52ff5b['include']=[{'all':!![]}];}if(!_[_0xdafc('0x39')](_0x52ff5b[_0xdafc('0x3f')],'id')){_0x52ff5b['attributes'][_0xdafc('0x40')]('id');}return db['User']['findAll'](_0x52ff5b);})[_0xdafc('0x25')](function(_0x3d0f00){_0x28c803[_0xdafc('0x41')]=_0x3d0f00;if(_0x2429b2['query'][_0xdafc('0x42')]===_0xdafc('0x43')){var _0x515c5b=[];for(var _0x12cd1d=0x0;_0x12cd1d<_0x28c803[_0xdafc('0x41')][_0xdafc('0x44')];_0x12cd1d++){_0x515c5b[_0xdafc('0x40')](get_open_tabs(_0xdafc('0x45'),_0x28c803[_0xdafc('0x41')][_0x12cd1d][_0xdafc('0x46')]));_0x515c5b[_0xdafc('0x40')](get_open_tabs(_0xdafc('0x47'),_0x28c803[_0xdafc('0x41')][_0x12cd1d]['dataValues']));_0x515c5b[_0xdafc('0x40')](get_open_tabs(_0xdafc('0x48'),_0x28c803[_0xdafc('0x41')][_0x12cd1d][_0xdafc('0x46')]));_0x515c5b[_0xdafc('0x40')](get_open_tabs('mail',_0x28c803[_0xdafc('0x41')][_0x12cd1d][_0xdafc('0x46')]));_0x515c5b['push'](get_open_tabs(_0xdafc('0x49'),_0x28c803['rows'][_0x12cd1d][_0xdafc('0x46')]));_0x515c5b['push'](get_open_tabs(_0xdafc('0x4a'),_0x28c803[_0xdafc('0x41')][_0x12cd1d][_0xdafc('0x46')]));}return BPromise[_0xdafc('0x4b')](_0x515c5b)['then'](function(_0x3a2360){return _0x28c803;});}else{return _0x28c803;}})[_0xdafc('0x25')](respondWithFilteredResult(_0x1e5ab1,_0x52ff5b))[_0xdafc('0x4c')](handleError(_0x1e5ab1,null));};exports[_0xdafc('0x4d')]=function(_0x5b8659,_0x294f62){var _0x3aa4ab={'raw':![],'where':{'id':_0x5b8659['params']['id']}},_0x4dbff3={};_0x4dbff3[_0xdafc('0x4e')]=_[_0xdafc('0x4f')](_[_0xdafc('0x50')](db[_0xdafc('0x35')]['rawAttributes']),[_0xdafc('0x3a'),'salt']);_0x4dbff3[_0xdafc('0x3d')]=_['keys'](_0x5b8659[_0xdafc('0x3d')]);_0x4dbff3['filters']=_[_0xdafc('0x51')](_0x4dbff3['model'],_0x4dbff3['query']);_0x3aa4ab[_0xdafc('0x3f')]=_[_0xdafc('0x51')](_0x4dbff3[_0xdafc('0x4e')],qs[_0xdafc('0x52')](_0x5b8659[_0xdafc('0x3d')][_0xdafc('0x52')]));_0x3aa4ab[_0xdafc('0x3f')]=_0x3aa4ab[_0xdafc('0x3f')][_0xdafc('0x44')]?_0x3aa4ab['attributes']:_0x4dbff3['model'];if(_0x5b8659['query']['includeAll']){_0x3aa4ab['include']=[{'all':!![]}];}_0x3aa4ab=_[_0xdafc('0x53')]({},_0x3aa4ab,_0x5b8659[_0xdafc('0x54')]);if(!_[_0xdafc('0x39')](_0x3aa4ab[_0xdafc('0x3f')],'id')){_0x3aa4ab[_0xdafc('0x3f')][_0xdafc('0x40')]('id');}return db[_0xdafc('0x35')][_0xdafc('0x2f')](_0x3aa4ab)[_0xdafc('0x25')](handleEntityNotFound(_0x294f62,null))[_0xdafc('0x25')](function(_0xccbbb4){var _0x5ecf9e=[];values=_0xccbbb4;if(_0x5b8659['query']['openTabs']===_0xdafc('0x43')){_0x5ecf9e[_0xdafc('0x40')](get_open_tabs(_0xdafc('0x45'),_0xccbbb4['dataValues']));_0x5ecf9e[_0xdafc('0x40')](get_open_tabs('sms',_0xccbbb4[_0xdafc('0x46')]));_0x5ecf9e['push'](get_open_tabs('openchannel',_0xccbbb4[_0xdafc('0x46')]));_0x5ecf9e[_0xdafc('0x40')](get_open_tabs(_0xdafc('0x4a'),_0xccbbb4['dataValues']));_0x5ecf9e[_0xdafc('0x40')](get_open_tabs(_0xdafc('0x48'),_0xccbbb4[_0xdafc('0x46')]));_0x5ecf9e[_0xdafc('0x40')](get_open_tabs(_0xdafc('0x55'),_0xccbbb4[_0xdafc('0x46')]));return BPromise[_0xdafc('0x4b')](_0x5ecf9e);}else{return values;}})[_0xdafc('0x25')](function(_0x264817){return values;})[_0xdafc('0x25')](respondWithResult(_0x294f62,null))[_0xdafc('0x4c')](handleError(_0x294f62,null));};exports[_0xdafc('0x56')]=function(_0x722176,_0x490cba){if(_0x722176[_0xdafc('0x57')]['id']){delete _0x722176[_0xdafc('0x57')]['id'];}delete _0x722176[_0xdafc('0x57')][_0xdafc('0x28')];return db[_0xdafc('0x35')]['find']({'where':{'id':_0x722176[_0xdafc('0x58')]['id']}})[_0xdafc('0x25')](handleEntityNotFound(_0x490cba,null))[_0xdafc('0x25')](saveUpdates(_0x722176[_0xdafc('0x57')],null))[_0xdafc('0x25')](respondWithResult(_0x490cba,null))[_0xdafc('0x4c')](handleError(_0x490cba,null));};exports[_0xdafc('0x59')]=function(_0x5abd77,_0x1e4afe){return db[_0xdafc('0x35')][_0xdafc('0x59')]()[_0xdafc('0x25')](respondWithResult(_0x1e4afe,null))[_0xdafc('0x4c')](handleError(_0x1e4afe,null));};exports['addContacts']=function(_0x3cef6d,_0x5b5c5a){return db[_0xdafc('0x35')]['find']({'where':{'id':_0x3cef6d[_0xdafc('0x58')]['id']}})[_0xdafc('0x25')](handleEntityNotFound(_0x5b5c5a,null))[_0xdafc('0x25')](function(_0xe9f511){if(_0xe9f511){return _0xe9f511[_0xdafc('0x5a')](_0x3cef6d[_0xdafc('0x57')][_0xdafc('0x5b')],_[_0xdafc('0x5c')](_0x3cef6d[_0xdafc('0x57')],['ids','id'])||{});}})['then'](respondWithResult(_0x5b5c5a,null))[_0xdafc('0x4c')](handleError(_0x5b5c5a,null));};function validateUser(_0x2c0e37){return new BPromise(function(_0x48a855,_0x4f9f39){if(_0x2c0e37['internal'])return _0x48a855(_0x2c0e37);return db['Setting'][_0xdafc('0x5d')](0x1)[_0xdafc('0x25')](function(_0x12b12e){if(_0x12b12e[_0xdafc('0x5e')])authService[_0xdafc('0x5f')](_0x2c0e37[_0xdafc('0x3a')]);db['User'][_0xdafc('0x60')](_0xdafc('0x61'))[_0xdafc('0x25')](function(_0x1c8aad){if(_['isNil'](_0x1c8aad)){_0x2c0e37[_0xdafc('0x61')]=_0x12b12e[_0xdafc('0x62')]||0x1;return;}if(_[_0xdafc('0x63')](_0x12b12e['min_internal'])||_0x12b12e[_0xdafc('0x62')]===_0x1c8aad){_0x2c0e37[_0xdafc('0x61')]=_0x1c8aad+0x1;return;}if(_0x12b12e[_0xdafc('0x62')]>_0x1c8aad){_0x2c0e37[_0xdafc('0x61')]=_0x12b12e[_0xdafc('0x62')];return;}return db[_0xdafc('0x64')][_0xdafc('0x3d')](_0xdafc('0x65'),{'type':db[_0xdafc('0x64')]['QueryTypes']['SELECT']})['then'](function(_0x140db1){if(_0x140db1&&_0x140db1['length']){for(var _0x4dc894=0x0,_0x5ef545=_0x140db1['length'];_0x4dc894<_0x5ef545&&_[_0xdafc('0x63')](_0x2c0e37[_0xdafc('0x61')]);_0x4dc894++){if(_0x12b12e[_0xdafc('0x62')]<=_0x140db1[_0x4dc894][_0xdafc('0x66')]){_0x2c0e37[_0xdafc('0x61')]=_0x140db1[_0x4dc894][_0xdafc('0x66')];}else if(_0x12b12e['min_internal']>_0x140db1[_0x4dc894][_0xdafc('0x66')]&&_0x12b12e['min_internal']<=_0x140db1[_0x4dc894]['to']){_0x2c0e37[_0xdafc('0x61')]=_0x12b12e[_0xdafc('0x62')];}}}if(_[_0xdafc('0x63')](_0x2c0e37[_0xdafc('0x61')])){_0x2c0e37[_0xdafc('0x61')]=_0x1c8aad+0x1;}return _0x48a855(_0x2c0e37);});});})[_0xdafc('0x4c')](function(_0x3c5a14){_0x4f9f39(_0x3c5a14);});});}function updateUser(_0x1ab70e){return new BPromise(function(_0x4b9056,_0x327018){try{if(_0x1ab70e[_0xdafc('0x67')]){_0x1ab70e['mailbox']=_0x1ab70e['internal'];_0x1ab70e['VoiceMail']={'mailbox':_0x1ab70e['internal'],'password':_0x1ab70e[_0xdafc('0x3a')],'fullname':_0x1ab70e[_0xdafc('0x68')],'email':_0x1ab70e[_0xdafc('0x69')]};}if(_0x1ab70e[_0xdafc('0x28')]===_0xdafc('0x6a')){if(!_0x1ab70e[_0xdafc('0x6b')])_0x1ab70e[_0xdafc('0x6b')]=[_0xdafc('0x6c'),_0xdafc('0x6d'),_0xdafc('0x6e'),_0xdafc('0x6f'),_0xdafc('0x70'),_0xdafc('0x71'),_0xdafc('0x72'),'106',_0xdafc('0x73'),_0xdafc('0x74'),_0xdafc('0x75'),_0xdafc('0x76'),_0xdafc('0x77'),_0xdafc('0x78'),'115'];}_0x4b9056(_0x1ab70e);}catch(_0x58cef3){_0x327018(_0x58cef3);}});}exports[_0xdafc('0x79')]=function(_0x9b3178,_0x950b7f){if(_0x9b3178[_0xdafc('0x2a')][_0xdafc('0x28')]===_0xdafc('0x6a'))throw new Error(_0xdafc('0x7a'));if(_0x9b3178[_0xdafc('0x57')][_0xdafc('0x28')]==='user'&&_0x9b3178[_0xdafc('0x2a')]['role']!==_0xdafc('0x29')){throw new Error(_0xdafc('0x7b'));}if(_0x9b3178[_0xdafc('0x57')][_0xdafc('0x28')]===_0xdafc('0x29')&&_0x9b3178[_0xdafc('0x2a')][_0xdafc('0x28')]!==_0xdafc('0x29')){throw new Error(_0xdafc('0x7c'));}return licenseUtil['checkUserLimits']([_0x9b3178[_0xdafc('0x57')]])[_0xdafc('0x25')](function(){return validateUser(_0x9b3178[_0xdafc('0x57')]);})[_0xdafc('0x25')](function(_0x5e38e8){return updateUser(_0x5e38e8)['then'](function(_0x32c048){if(_0x32c048['role']==='admin'){_0x32c048['settingsEnabled']=_0x9b3178[_0xdafc('0x2a')][_0xdafc('0x7d')];delete _0x32c048[_0xdafc('0x7e')];}return _0x32c048;});})['then'](function(_0x284cfa){return db['User']['create'](_0x284cfa,{'include':[{'model':db[_0xdafc('0x7f')],'as':_0xdafc('0x7f')}]});})[_0xdafc('0x25')](function(_0x384c7b){if(_0x9b3178[_0xdafc('0x57')][_0xdafc('0x28')]===_0xdafc('0x2a'))return _0x384c7b;if(_0x9b3178['user'][_0xdafc('0x28')]!==_0xdafc('0x2a'))return _0x384c7b;return db[_0xdafc('0x80')][_0xdafc('0x2f')]({'where':{'name':_0x384c7b[_0xdafc('0x28')]==='agent'?_0xdafc('0x2b'):'Telephones','userProfileId':_0x9b3178['user'][_0xdafc('0x7e')]},'raw':!![]})[_0xdafc('0x25')](function(_0x3cc492){if(!_0x3cc492||_0x3cc492[_0xdafc('0x81')]!=0x0)return _0x384c7b;return db[_0xdafc('0x31')][_0xdafc('0x79')]({'name':_0x384c7b[_0xdafc('0x30')],'resourceId':_0x384c7b['id'],'type':_0x3cc492[_0xdafc('0x30')],'sectionId':_0x3cc492['id']},{})[_0xdafc('0x25')](function(){return _0x384c7b;});})['catch'](function(_0x1681c2){logger[_0xdafc('0x1a')](_0xdafc('0x82'),_0x1681c2);throw _0x1681c2;});})['then'](respondWithResult(_0x950b7f,0xc9))['catch'](handleError(_0x950b7f,null));};exports[_0xdafc('0x83')]=function(_0x1eb7b3,_0x5271e9){var _0x344860=_0x1eb7b3['body'];var _0x1ffe04=[];if(_0x1eb7b3[_0xdafc('0x2a')][_0xdafc('0x28')]===_0xdafc('0x6a'))throw new Error(_0xdafc('0x7a'));if(_['some'](_0x344860,[_0xdafc('0x28'),'user'])&&_0x1eb7b3[_0xdafc('0x2a')][_0xdafc('0x28')]!==_0xdafc('0x29')){throw new Error(_0xdafc('0x7b'));}if(_[_0xdafc('0x84')](_0x344860,[_0xdafc('0x28'),'admin'])&&_0x1eb7b3[_0xdafc('0x2a')][_0xdafc('0x28')]!==_0xdafc('0x29')){throw new Error(_0xdafc('0x85'));}return licenseUtil[_0xdafc('0x86')](_0x344860)[_0xdafc('0x25')](function(){return validateUser(_0x344860[0x0]);})[_0xdafc('0x25')](function(){for(var _0x40f7aa=0x1;_0x40f7aa<_0x344860[_0xdafc('0x44')];_0x40f7aa++){var _0xabc5f5=_0x344860[_0x40f7aa-0x1][_0xdafc('0x61')];if(!_0x344860[_0x40f7aa]['internal'])_0x344860[_0x40f7aa][_0xdafc('0x61')]=_0xabc5f5+0x1;_0x1ffe04[_0xdafc('0x40')](validateUser(_0x344860[_0x40f7aa]));}return BPromise['all'](_0x1ffe04);})[_0xdafc('0x25')](function(){_0x1ffe04=[];for(var _0xf269e5=0x0;_0xf269e5<_0x344860['length'];_0xf269e5++){_0x1ffe04[_0xdafc('0x40')](updateUser(_0x344860[_0xf269e5]));}return BPromise['all'](_0x1ffe04);})[_0xdafc('0x25')](function(){return BPromise['each'](_0x344860,function(_0xf0ba66){return db[_0xdafc('0x35')][_0xdafc('0x79')](_0xf0ba66,{'include':[{'model':db[_0xdafc('0x7f')],'as':'VoiceMail'}]})[_0xdafc('0x25')](function(_0xfd4d81){_0xf0ba66['id']=_0xfd4d81['id'];return _0xf0ba66;});});})[_0xdafc('0x25')](function(_0x233e2a){if(_0x1eb7b3[_0xdafc('0x57')][_0xdafc('0x28')]===_0xdafc('0x2a'))return _0x233e2a;if(_0x1eb7b3[_0xdafc('0x2a')][_0xdafc('0x28')]!=='user')return _0x233e2a;var _0x3a86b9=_[_0xdafc('0x84')](_0x233e2a,function(_0x4b4d60){return _0x4b4d60[_0xdafc('0x28')]==='agent'||_0x4b4d60['role']===_0xdafc('0x2c');});if(!_0x3a86b9)return _0x233e2a;return db['UserProfileSection'][_0xdafc('0x87')]({'where':{'name':{'$or':[_0xdafc('0x2b'),_0xdafc('0x88')]},'userProfileId':_0x1eb7b3[_0xdafc('0x2a')][_0xdafc('0x7e')]},'raw':!![]})[_0xdafc('0x25')](function(_0x37d67f){if(_['isEmpty'](_0x37d67f)||!_['some'](_0x37d67f,[_0xdafc('0x81'),0x0]))return _0x233e2a;_0x1ffe04=[];var _0x2adf04=_(_0x37d67f)[_0xdafc('0x2d')](function(_0x53fb07){if(_0x53fb07[_0xdafc('0x81')]===0x1)return;return _0x53fb07[_0xdafc('0x30')]===_0xdafc('0x2b')?_0xdafc('0x6a'):_0xdafc('0x2c');})[_0xdafc('0x89')]()['value']();for(var _0x11cabe=0x0;_0x11cabe<_0x233e2a[_0xdafc('0x44')];_0x11cabe++){if(!_['includes'](_0x2adf04,_0x233e2a[_0x11cabe][_0xdafc('0x28')]))return;var _0x17ef4f=_0x233e2a[_0x11cabe]['role']===_0xdafc('0x6a')?_0xdafc('0x2b'):_0xdafc('0x88');_0x1ffe04[_0xdafc('0x40')](db[_0xdafc('0x31')]['create']({'name':_0x233e2a[_0x11cabe][_0xdafc('0x30')],'resourceId':_0x233e2a[_0x11cabe]['id'],'type':_0x17ef4f,'sectionId':_[_0xdafc('0x2f')](_0x37d67f,['name',_0x17ef4f])['id']},{}));}return BPromise[_0xdafc('0x4b')](_0x1ffe04);});})[_0xdafc('0x25')](respondWithResult(_0x5271e9,0xc9))[_0xdafc('0x4c')](handleError(_0x5271e9,null));};exports['changePassword']=function(_0x2167fc,_0x552362){if(_0x2167fc[_0xdafc('0x57')]['id']){delete _0x2167fc['body']['id'];}return db[_0xdafc('0x35')]['find']({'where':{'id':_0x2167fc['params']['id']}})[_0xdafc('0x25')](function(_0x340c19){if(!_0x340c19)return null;if(_0x340c19['id']===_0x2167fc['user']['id']){if(!_0x2167fc[_0xdafc('0x57')]['oldPassword']||!_0x2167fc['body'][_0xdafc('0x8a')]){throw new db['Sequelize']['ValidationError'](_0xdafc('0x8b'));}if(!_0x340c19['authenticate'](_0x2167fc['body'][_0xdafc('0x8c')])){throw new db[(_0xdafc('0x8d'))]['ValidationError']('Wrong\x20credentials');}if(_0x2167fc['body'][_0xdafc('0x8c')]===_0x2167fc[_0xdafc('0x57')][_0xdafc('0x8a')]){throw new db[(_0xdafc('0x8d'))][(_0xdafc('0x8e'))]('New\x20password\x20must\x20be\x20different\x20from\x20old\x20password');}}else if(_0x2167fc[_0xdafc('0x2a')][_0xdafc('0x28')]==='admin'){if(!_0x2167fc['body'][_0xdafc('0x8a')]){throw new db[(_0xdafc('0x8d'))][(_0xdafc('0x8e'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}}else if(_0x2167fc[_0xdafc('0x2a')][_0xdafc('0x28')]===_0xdafc('0x2a')){if(!_0x2167fc[_0xdafc('0x57')]['newPassword']){throw new db[(_0xdafc('0x8d'))][(_0xdafc('0x8e'))](_0xdafc('0x8f'));}if(_0x340c19[_0xdafc('0x28')]!==_0xdafc('0x6a')){throw new db['Sequelize'][(_0xdafc('0x8e'))](_0xdafc('0x7a'));}}else{throw new db[(_0xdafc('0x8d'))][(_0xdafc('0x8e'))](_0xdafc('0x7a'));}return _0x340c19;})[_0xdafc('0x25')](handleEntityNotFound(_0x552362,null))[_0xdafc('0x25')](function(_0x28ae06){return db[_0xdafc('0x90')]['findOne']({'attributes':['id',_0xdafc('0x5e'),_0xdafc('0x91'),_0xdafc('0x92')]})[_0xdafc('0x25')](function(_0x1d22f4){if(_0x1d22f4['securePassword'])authService[_0xdafc('0x5f')](_0x2167fc[_0xdafc('0x57')][_0xdafc('0x8a')]);if(!_0x1d22f4[_0xdafc('0x91')]||!_0x28ae06['previousPasswords'])return _0x28ae06;authService[_0xdafc('0x93')](_0x2167fc['body'][_0xdafc('0x8a')],_0x28ae06['previousPasswords'],_0x1d22f4[_0xdafc('0x92')]);return _0x28ae06;})['then'](saveUpdates({'password':_0x2167fc[_0xdafc('0x57')][_0xdafc('0x8a')],'passwordResetAt':_0x2167fc[_0xdafc('0x2a')]['id']==_0x2167fc[_0xdafc('0x58')]['id']?moment():null,'previousPasswords':authService[_0xdafc('0x94')](_0x2167fc[_0xdafc('0x57')][_0xdafc('0x8a')],_0x28ae06['previousPasswords'])},null));})['then'](respondWithResult(_0x552362,null))[_0xdafc('0x4c')](handleError(_0x552362,null));};exports['addQueues']=function(_0x4ddb76,_0x46a521){var _0x12dc7f=_0x4ddb76['body']['channel'];return db[_0xdafc('0x35')]['find']({'where':{'id':_0x4ddb76[_0xdafc('0x58')]['id']},'attributes':['id',_0xdafc('0x30'),_0xdafc('0x28'),'online',_0xdafc('0x95'),'voicePause',_0xdafc('0x96')]})[_0xdafc('0x25')](handleEntityNotFound(_0x46a521,null))[_0xdafc('0x25')](function(_0x5b4fa1){if(_0x5b4fa1){if(!utils[_0xdafc('0x97')](_0x12dc7f)){throw new db[(_0xdafc('0x8d'))][(_0xdafc('0x8e'))](_0xdafc('0x98'));}return _0x5b4fa1[_0xdafc('0x99')+_[_0xdafc('0x9a')](_0x12dc7f[_0xdafc('0x9b')]())+_0xdafc('0x9c')](_0x4ddb76[_0xdafc('0x57')][_0xdafc('0x5b')],{'penalty':_0x4ddb76[_0xdafc('0x57')]['penalty']||0x0})[_0xdafc('0x9d')](function(_0x20f2e3){for(var _0xd372a9=0x0;_0xd372a9<_0x4ddb76[_0xdafc('0x57')][_0xdafc('0x5b')]['length'];_0xd372a9+=0x1){var _0x4d832e={'UserId':Number(_0x4ddb76[_0xdafc('0x58')]['id'])};_0x4d832e[_[_0xdafc('0x9a')](_0x12dc7f[_0xdafc('0x9b')]())+_0xdafc('0x9e')]=Number(_0x4ddb76[_0xdafc('0x57')][_0xdafc('0x5b')][_0xd372a9]);socket[_0xdafc('0x9f')](_0xdafc('0x2a')+_['capitalize'](_0x12dc7f[_0xdafc('0x9b')]())+_0xdafc('0xa0'),_0x4d832e);}return _0x20f2e3;})[_0xdafc('0x25')](function(){if(_0x12dc7f===_0xdafc('0xa1')){return db[_0xdafc('0xa2')][_0xdafc('0x87')]({'where':{'id':_0x4ddb76['body'][_0xdafc('0x5b')]||[]},'raw':!![],'attributes':['id',_0xdafc('0x30')]});}})['then'](function(_0x9dde0f){var _0x53c3d5=_0x5b4fa1['get']({'plain':!![]});var _0x5993a8=[];if(_0x12dc7f===_0xdafc('0xa1')&&_0x53c3d5[_0xdafc('0x28')]===_0xdafc('0x6a')&&_0x53c3d5[_0xdafc('0xa3')]){for(var _0x522550=0x0;_0x522550<_0x9dde0f[_0xdafc('0x44')];_0x522550+=0x1){_0x5993a8['push']({'membername':_0x53c3d5[_0xdafc('0x30')],'UserId':_0x53c3d5['id'],'queue_name':_0x9dde0f[_0x522550][_0xdafc('0x30')],'VoiceQueueId':_0x9dde0f[_0x522550]['id'],'interface':_[_0xdafc('0x63')](_0x53c3d5['interface'])?util[_0xdafc('0xa4')](_0xdafc('0xa5'),_0x53c3d5['name']):_0x53c3d5[_0xdafc('0x96')],'paused':_0x53c3d5[_0xdafc('0xa6')]||![],'penalty':_0x4ddb76[_0xdafc('0x57')][_0xdafc('0xa7')]||0x0});}return BPromise['each'](_0x5993a8,function(_0x2a1852){return db[_0xdafc('0xa8')][_0xdafc('0xa9')](_0x2a1852);});}return _0x5b4fa1;});}})[_0xdafc('0x25')](respondWithStatusCode(_0x46a521,null))['catch'](handleError(_0x46a521,null));};exports['removeQueues']=function(_0x53fd50,_0x43c1b3){var _0x3cc216;return db['User'][_0xdafc('0x2f')]({'where':{'id':_0x53fd50[_0xdafc('0x58')]['id']},'attributes':['id',_0xdafc('0x30'),_0xdafc('0x28')]})[_0xdafc('0x25')](handleEntityNotFound(_0x43c1b3,null))[_0xdafc('0x25')](function(_0x34b2af){if(_0x34b2af){_0x3cc216=_0x34b2af;if(!_0x53fd50['query'][_0xdafc('0xaa')]||!utils[_0xdafc('0x97')](_0x53fd50[_0xdafc('0x3d')][_0xdafc('0xaa')])){throw new db[(_0xdafc('0x8d'))][(_0xdafc('0x8e'))]('Unknown\x20channel');}return _0x34b2af[_0xdafc('0xab')+_['capitalize'](_0x53fd50['query'][_0xdafc('0xaa')][_0xdafc('0x9b')]())+'Queues'](_0x53fd50[_0xdafc('0x3d')][_0xdafc('0x5b')]);}})[_0xdafc('0x25')](function(_0x2d947a){if(_[_0xdafc('0xac')](_0x53fd50[_0xdafc('0x3d')][_0xdafc('0x5b')])){for(var _0x55c0ff=0x0;_0x55c0ff<_0x53fd50[_0xdafc('0x3d')][_0xdafc('0x5b')][_0xdafc('0x44')];_0x55c0ff+=0x1){var _0x3ec516={'UserId':Number(_0x53fd50[_0xdafc('0x58')]['id'])};_0x3ec516[_[_0xdafc('0x9a')](_0x53fd50['query'][_0xdafc('0xaa')]['toLowerCase']())+'QueueId']=Number(_0x53fd50[_0xdafc('0x3d')]['ids'][_0x55c0ff]);socket[_0xdafc('0x9f')](_0xdafc('0x2a')+_[_0xdafc('0x9a')](_0x53fd50[_0xdafc('0x3d')][_0xdafc('0xaa')]['toLowerCase']())+_0xdafc('0xad'),_0x3ec516);}}else{var _0x3ec516={'UserId':Number(_0x53fd50[_0xdafc('0x58')]['id'])};_0x3ec516[_[_0xdafc('0x9a')](_0x53fd50[_0xdafc('0x3d')][_0xdafc('0xaa')]['toLowerCase']())+_0xdafc('0x9e')]=Number(_0x53fd50['query'][_0xdafc('0x5b')]);socket['emit'](_0xdafc('0x2a')+_[_0xdafc('0x9a')](_0x53fd50[_0xdafc('0x3d')][_0xdafc('0xaa')][_0xdafc('0x9b')]())+_0xdafc('0xad'),_0x3ec516);}return _0x2d947a;})[_0xdafc('0x25')](function(){if(_0x53fd50[_0xdafc('0x3d')]['channel']===_0xdafc('0xa1')){return db['UserVoiceQueueRt'][_0xdafc('0x26')]({'where':{'UserId':_0x53fd50[_0xdafc('0x58')]['id'],'VoiceQueueId':_0x53fd50[_0xdafc('0x3d')]['ids']},'individualHooks':!![]})[_0xdafc('0x25')](function(){return _0x3cc216;});}return _0x3cc216;})[_0xdafc('0x25')](respondWithStatusCode(_0x43c1b3,null))['catch'](handleError(_0x43c1b3,null));};exports['addAvatar']=function(_0x55f1e2,_0x3f6db1){_0x55f1e2[_0xdafc('0x57')][_0xdafc('0xae')]=_0x55f1e2['file']['filename'];return db[_0xdafc('0x35')]['find']({'where':{'id':_0x55f1e2['params']['id']}})[_0xdafc('0x25')](handleEntityNotFound(_0x3f6db1,null))[_0xdafc('0x25')](saveUpdates(_0x55f1e2['body'],null))[_0xdafc('0x25')](respondWithResult(_0x3f6db1,null))[_0xdafc('0x4c')](handleError(_0x3f6db1,null));};exports[_0xdafc('0xaf')]=function(_0x1bcf6d,_0xbb419d){var _0x4ad3db=path[_0xdafc('0xb0')](config['root'],_0xdafc('0xb1'));return db[_0xdafc('0x35')]['find']({'where':{'id':_0x1bcf6d[_0xdafc('0x58')]['id']},'attributes':['id','userpic'],'raw':!![]})[_0xdafc('0x25')](handleEntityNotFound(_0xbb419d,null))[_0xdafc('0x25')](function(_0x1caaf8){if(_0x1caaf8){if(_[_0xdafc('0x63')](_0x1caaf8[_0xdafc('0xae')])){return _0xbb419d[_0xdafc('0xb2')](_0x4ad3db);}else{if(!fs['existsSync'](path[_0xdafc('0xb0')](config[_0xdafc('0xb3')],'server/files/images/',_0x1caaf8[_0xdafc('0xae')]))){return _0xbb419d[_0xdafc('0xb2')](_0x4ad3db);}return _0xbb419d[_0xdafc('0xb2')](path[_0xdafc('0xb0')](config[_0xdafc('0xb3')],_0xdafc('0xb4'),_0x1caaf8[_0xdafc('0xae')]));}}})[_0xdafc('0x4c')](handleError(_0xbb419d,null));};exports[_0xdafc('0xb5')]=function(_0x7ed3d7,_0x4a2282){return db['User'][_0xdafc('0x2f')]({'where':{'id':_0x7ed3d7[_0xdafc('0x58')]['id']},'attributes':['id']})[_0xdafc('0x25')](handleEntityNotFound(_0x4a2282,null))[_0xdafc('0x25')](function(_0x2d977f){var _0x2a3077=[];values=_0x2d977f['dataValues'];_0x2a3077['push'](get_open_tabs('chat',_0x2d977f[_0xdafc('0x46')]));_0x2a3077[_0xdafc('0x40')](get_open_tabs('sms',_0x2d977f[_0xdafc('0x46')]));_0x2a3077[_0xdafc('0x40')](get_open_tabs(_0xdafc('0x49'),_0x2d977f[_0xdafc('0x46')]));_0x2a3077[_0xdafc('0x40')](get_open_tabs(_0xdafc('0x4a'),_0x2d977f[_0xdafc('0x46')]));_0x2a3077[_0xdafc('0x40')](get_open_tabs(_0xdafc('0x48'),_0x2d977f['dataValues']));_0x2a3077[_0xdafc('0x40')](get_open_tabs(_0xdafc('0x55'),_0x2d977f[_0xdafc('0x46')]));return BPromise['all'](_0x2a3077);})[_0xdafc('0x25')](function(_0x4d4d10){var _0x4a10ac=[];if(_0x4d4d10){for(var _0x15a7f4=0x0;_0x15a7f4=_0x5d37d1){_0x578464=_0x5d37d1;_0x3ec248=0xc8;}else{_0x3ec248=0xce;}_0x2cef74['status'](_0x3ec248);return _0x2cef74[_0xe110('0x23')](_0xe110('0x24'),_0x5be7a7+'-'+_0x578464+'/'+_0x5d37d1)['json'](_0x17ba7c);}return null;};}function saveUpdates(_0x545380){return function(_0x58d08d){if(_0x58d08d){return _0x58d08d['update'](_0x545380)['then'](function(_0x3e5603){return _0x3e5603;});}return null;};}function removeEntity(_0x2de4cd){return function(_0x1a2d75){if(_0x1a2d75){return _0x1a2d75[_0xe110('0x25')]()[_0xe110('0x11')](function(){var _0x480eb6=_0x1a2d75[_0xe110('0x26')]({'plain':!![]});if(_0x480eb6['role']===_0xe110('0x27'))return;var _0x127b28=[{'name':_0xe110('0x28'),'value':'user','ignore':!![]},{'name':_0xe110('0x29'),'value':_0xe110('0x2a'),'ignore':![]},{'name':_0xe110('0x2b'),'value':'telephone','ignore':![]}];var _0x5368da=_(_0x127b28)['filter'](_0xe110('0x2c'))[_0xe110('0x2d')](_0xe110('0x2e'))[_0xe110('0x2e')]();if(_[_0xe110('0x2f')](_0x5368da,_0x480eb6[_0xe110('0x30')])){return;}var _0x27554a=_[_0xe110('0x31')](_0x127b28,[_0xe110('0x2e'),_0x480eb6['role']])[_0xe110('0x32')];return db['UserProfileResource'][_0xe110('0x25')]({'where':{'type':_0x27554a,'resourceId':_0x480eb6['id']}})['then'](function(){return _0x1a2d75;});})[_0xe110('0x11')](function(){_0x2de4cd['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x370c38){return function(_0xc45e0d){if(!_0xc45e0d){_0x370c38[_0xe110('0x1b')](0x194);}return _0xc45e0d;};}function handleError(_0x57c8b3,_0x59dcd5){_0x59dcd5=_0x59dcd5||0x1f4;return function(_0x436212){logger[_0xe110('0x14')](_0x436212['stack']);if(_0x436212[_0xe110('0x32')]){delete _0x436212[_0xe110('0x32')];}_0x57c8b3[_0xe110('0x1c')](_0x59dcd5)[_0xe110('0x33')](_0x436212);};}exports[_0xe110('0x34')]=function(_0x1f90e2,_0x295ecf){var _0x2f9976={},_0x40fe9c={'count':0x0,'rows':[]};var _0x455634=_(db['User'][_0xe110('0x35')])[_0xe110('0x2d')](function(_0x44543b){return{'name':_0x44543b[_0xe110('0x36')],'type':_0x44543b[_0xe110('0x37')][_0xe110('0x38')]};})[_0xe110('0x39')](function(_0x2d2e53){return!_[_0xe110('0x2f')]([_0xe110('0x3a'),_0xe110('0x3b')],_0x2d2e53[_0xe110('0x32')]);})[_0xe110('0x2e')]();_0x2f9976=qs['getOptions'](_0x455634,_0x1f90e2);var _0x16e62e={'where':_0x2f9976[_0xe110('0x3c')]};return db[_0xe110('0x3d')][_0xe110('0x22')](_0x16e62e)['then'](function(_0xd737b0){_0x40fe9c[_0xe110('0x22')]=_0xd737b0;if(_0x1f90e2['query']['includeAll']){_0x2f9976[_0xe110('0x3e')]=[{'all':!![]}];}if(!_['includes'](_0x2f9976[_0xe110('0x3f')],'id')){_0x2f9976[_0xe110('0x3f')][_0xe110('0x40')]('id');}return db[_0xe110('0x3d')][_0xe110('0x41')](_0x2f9976);})['then'](function(_0xbd7471){_0x40fe9c[_0xe110('0x42')]=_0xbd7471;if(_0x1f90e2[_0xe110('0x43')]['openTabs']===_0xe110('0x44')){var _0x45aa54=[];for(var _0x4b24cb=0x0;_0x4b24cb<_0x40fe9c[_0xe110('0x42')][_0xe110('0x45')];_0x4b24cb++){_0x45aa54[_0xe110('0x40')](get_open_tabs('chat',_0x40fe9c[_0xe110('0x42')][_0x4b24cb][_0xe110('0x46')]));_0x45aa54['push'](get_open_tabs(_0xe110('0x47'),_0x40fe9c['rows'][_0x4b24cb]['dataValues']));_0x45aa54[_0xe110('0x40')](get_open_tabs('fax',_0x40fe9c[_0xe110('0x42')][_0x4b24cb]['dataValues']));_0x45aa54['push'](get_open_tabs(_0xe110('0x48'),_0x40fe9c['rows'][_0x4b24cb]['dataValues']));_0x45aa54['push'](get_open_tabs(_0xe110('0x49'),_0x40fe9c[_0xe110('0x42')][_0x4b24cb][_0xe110('0x46')]));_0x45aa54[_0xe110('0x40')](get_open_tabs(_0xe110('0x4a'),_0x40fe9c['rows'][_0x4b24cb][_0xe110('0x46')]));}return BPromise[_0xe110('0x4b')](_0x45aa54)['then'](function(_0xd9f3f7){return _0x40fe9c;});}else{return _0x40fe9c;}})['then'](respondWithFilteredResult(_0x295ecf,_0x2f9976))[_0xe110('0x1a')](handleError(_0x295ecf,null));};exports[_0xe110('0x4c')]=function(_0x4716ec,_0x34f0b2){var _0x13414a={'raw':![],'where':{'id':_0x4716ec[_0xe110('0x4d')]['id']}},_0x1f4658={};_0x1f4658[_0xe110('0x4e')]=_[_0xe110('0x4f')](_[_0xe110('0x50')](db['User']['rawAttributes']),['password',_0xe110('0x3b')]);_0x1f4658[_0xe110('0x43')]=_['keys'](_0x4716ec['query']);_0x1f4658[_0xe110('0x51')]=_['intersection'](_0x1f4658[_0xe110('0x4e')],_0x1f4658[_0xe110('0x43')]);_0x13414a[_0xe110('0x3f')]=_['intersection'](_0x1f4658[_0xe110('0x4e')],qs['fields'](_0x4716ec['query'][_0xe110('0x52')]));_0x13414a[_0xe110('0x3f')]=_0x13414a[_0xe110('0x3f')]['length']?_0x13414a[_0xe110('0x3f')]:_0x1f4658[_0xe110('0x4e')];if(_0x4716ec[_0xe110('0x43')][_0xe110('0x53')]){_0x13414a['include']=[{'all':!![]}];}_0x13414a=_[_0xe110('0x54')]({},_0x13414a,_0x4716ec['options']);if(!_[_0xe110('0x2f')](_0x13414a[_0xe110('0x3f')],'id')){_0x13414a[_0xe110('0x3f')][_0xe110('0x40')]('id');}return db[_0xe110('0x3d')][_0xe110('0x31')](_0x13414a)[_0xe110('0x11')](handleEntityNotFound(_0x34f0b2,null))['then'](function(_0x5288ce){var _0x4b7119=[];values=_0x5288ce;if(_0x4716ec['query'][_0xe110('0x55')]===_0xe110('0x44')){_0x4b7119['push'](get_open_tabs('chat',_0x5288ce[_0xe110('0x46')]));_0x4b7119[_0xe110('0x40')](get_open_tabs(_0xe110('0x47'),_0x5288ce[_0xe110('0x46')]));_0x4b7119[_0xe110('0x40')](get_open_tabs(_0xe110('0x49'),_0x5288ce[_0xe110('0x46')]));_0x4b7119[_0xe110('0x40')](get_open_tabs(_0xe110('0x4a'),_0x5288ce[_0xe110('0x46')]));_0x4b7119[_0xe110('0x40')](get_open_tabs(_0xe110('0x56'),_0x5288ce[_0xe110('0x46')]));_0x4b7119['push'](get_open_tabs(_0xe110('0x48'),_0x5288ce['dataValues']));return BPromise[_0xe110('0x4b')](_0x4b7119);}else{return values;}})[_0xe110('0x11')](function(_0x594772){return values;})['then'](respondWithResult(_0x34f0b2,null))[_0xe110('0x1a')](handleError(_0x34f0b2,null));};exports['update']=function(_0x17059a,_0x11347e){if(_0x17059a['body']['id']){delete _0x17059a['body']['id'];}delete _0x17059a[_0xe110('0x57')]['role'];return db[_0xe110('0x3d')][_0xe110('0x31')]({'where':{'id':_0x17059a[_0xe110('0x4d')]['id']}})[_0xe110('0x11')](handleEntityNotFound(_0x11347e,null))[_0xe110('0x11')](saveUpdates(_0x17059a[_0xe110('0x57')],null))[_0xe110('0x11')](respondWithResult(_0x11347e,null))[_0xe110('0x1a')](handleError(_0x11347e,null));};exports[_0xe110('0x58')]=function(_0x4dc308,_0x13bf0a){return db[_0xe110('0x3d')][_0xe110('0x58')]()[_0xe110('0x11')](respondWithResult(_0x13bf0a,null))['catch'](handleError(_0x13bf0a,null));};exports['addContacts']=function(_0x2b068,_0x182f17){return db[_0xe110('0x3d')]['find']({'where':{'id':_0x2b068[_0xe110('0x4d')]['id']}})[_0xe110('0x11')](handleEntityNotFound(_0x182f17,null))['then'](function(_0x3c8981){if(_0x3c8981){return _0x3c8981[_0xe110('0x59')](_0x2b068['body']['ids'],_[_0xe110('0x5a')](_0x2b068['body'],[_0xe110('0x5b'),'id'])||{});}})[_0xe110('0x11')](respondWithResult(_0x182f17,null))[_0xe110('0x1a')](handleError(_0x182f17,null));};function validateUser(_0x33d32c){return new BPromise(function(_0x434523,_0x47534a){if(_0x33d32c[_0xe110('0x5c')])return _0x434523(_0x33d32c);return db[_0xe110('0x5d')]['findById'](0x1)[_0xe110('0x11')](function(_0x4c7dc9){if(_0x4c7dc9[_0xe110('0x5e')])authService['validatePasswordPattern'](_0x33d32c[_0xe110('0x3a')]);db['User']['max'](_0xe110('0x5c'))[_0xe110('0x11')](function(_0x13ea84){if(_[_0xe110('0x5f')](_0x13ea84)){_0x33d32c[_0xe110('0x5c')]=_0x4c7dc9['min_internal']||0x1;return;}if(_[_0xe110('0x5f')](_0x4c7dc9[_0xe110('0x60')])||_0x4c7dc9[_0xe110('0x60')]===_0x13ea84){_0x33d32c['internal']=_0x13ea84+0x1;return;}if(_0x4c7dc9[_0xe110('0x60')]>_0x13ea84){_0x33d32c[_0xe110('0x5c')]=_0x4c7dc9[_0xe110('0x60')];return;}return db[_0xe110('0x61')][_0xe110('0x43')]('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[_0xe110('0x61')][_0xe110('0x62')][_0xe110('0x63')]})[_0xe110('0x11')](function(_0x2962eb){if(_0x2962eb&&_0x2962eb['length']){for(var _0x53d5e3=0x0,_0x166074=_0x2962eb[_0xe110('0x45')];_0x53d5e3<_0x166074&&_['isNil'](_0x33d32c['internal']);_0x53d5e3++){if(_0x4c7dc9['min_internal']<=_0x2962eb[_0x53d5e3][_0xe110('0x64')]){_0x33d32c[_0xe110('0x5c')]=_0x2962eb[_0x53d5e3][_0xe110('0x64')];}else if(_0x4c7dc9[_0xe110('0x60')]>_0x2962eb[_0x53d5e3][_0xe110('0x64')]&&_0x4c7dc9[_0xe110('0x60')]<=_0x2962eb[_0x53d5e3]['to']){_0x33d32c['internal']=_0x4c7dc9['min_internal'];}}}if(_[_0xe110('0x5f')](_0x33d32c[_0xe110('0x5c')])){_0x33d32c[_0xe110('0x5c')]=_0x13ea84+0x1;}return _0x434523(_0x33d32c);});});})[_0xe110('0x1a')](function(_0x2c339c){_0x47534a(_0x2c339c);});});}function updateUser(_0x1fdca4){return new BPromise(function(_0x581cca,_0x153f13){try{if(_0x1fdca4[_0xe110('0x65')]){_0x1fdca4['mailbox']=_0x1fdca4[_0xe110('0x5c')];_0x1fdca4['VoiceMail']={'mailbox':_0x1fdca4[_0xe110('0x5c')],'password':_0x1fdca4[_0xe110('0x3a')],'fullname':_0x1fdca4['fullname'],'email':_0x1fdca4[_0xe110('0x66')]};}if(_0x1fdca4['role']===_0xe110('0x2a')){if(!_0x1fdca4[_0xe110('0x67')])_0x1fdca4[_0xe110('0x67')]=[_0xe110('0x68'),_0xe110('0x69'),_0xe110('0x6a'),'113',_0xe110('0x6b'),_0xe110('0x6c'),'105',_0xe110('0x6d'),_0xe110('0x6e'),_0xe110('0x6f'),'109',_0xe110('0x70'),'111',_0xe110('0x71'),_0xe110('0x72')];}_0x581cca(_0x1fdca4);}catch(_0x37616d){_0x153f13(_0x37616d);}});}exports[_0xe110('0x73')]=function(_0x17fee0,_0x4e7762){if(_0x17fee0['user'][_0xe110('0x30')]===_0xe110('0x2a'))throw new Error(_0xe110('0x74'));if(_0x17fee0[_0xe110('0x57')][_0xe110('0x30')]==='user'&&_0x17fee0[_0xe110('0x75')]['role']!==_0xe110('0x27')){throw new Error(_0xe110('0x76'));}if(_0x17fee0[_0xe110('0x57')][_0xe110('0x30')]===_0xe110('0x27')&&_0x17fee0[_0xe110('0x75')][_0xe110('0x30')]!=='admin'){throw new Error(_0xe110('0x77'));}return licenseUtil[_0xe110('0x78')]([_0x17fee0[_0xe110('0x57')]])['then'](function(){return validateUser(_0x17fee0[_0xe110('0x57')]);})[_0xe110('0x11')](function(_0x440dfe){return updateUser(_0x440dfe)[_0xe110('0x11')](function(_0x3704ff){if(_0x3704ff[_0xe110('0x30')]===_0xe110('0x27')){_0x3704ff[_0xe110('0x79')]=_0x17fee0[_0xe110('0x75')]['settingsEnabled'];delete _0x3704ff[_0xe110('0x7a')];}return _0x3704ff;});})[_0xe110('0x11')](function(_0x1ba508){return db[_0xe110('0x3d')][_0xe110('0x73')](_0x1ba508,{'include':[{'model':db[_0xe110('0x7b')],'as':_0xe110('0x7b')}]});})[_0xe110('0x11')](function(_0x5d32d6){if(_0x17fee0['body'][_0xe110('0x30')]==='user')return _0x5d32d6;if(_0x17fee0[_0xe110('0x75')][_0xe110('0x30')]!=='user')return _0x5d32d6;return db[_0xe110('0x7c')][_0xe110('0x31')]({'where':{'name':_0x5d32d6['role']===_0xe110('0x2a')?_0xe110('0x29'):_0xe110('0x2b'),'userProfileId':_0x17fee0['user'][_0xe110('0x7a')]},'raw':!![]})[_0xe110('0x11')](function(_0x9c02d4){if(!_0x9c02d4||_0x9c02d4['autoAssociation']!=0x0)return _0x5d32d6;return db[_0xe110('0x7d')][_0xe110('0x73')]({'name':_0x5d32d6['name'],'resourceId':_0x5d32d6['id'],'type':_0x9c02d4[_0xe110('0x32')],'sectionId':_0x9c02d4['id']},{})[_0xe110('0x11')](function(){return _0x5d32d6;});})[_0xe110('0x1a')](function(_0x3270dd){logger['error'](_0xe110('0x7e'),_0x3270dd);throw _0x3270dd;});})['then'](respondWithResult(_0x4e7762,0xc9))['catch'](handleError(_0x4e7762,null));};exports['bulkCreate']=function(_0x1176f2,_0x393671){var _0xde155e=_0x1176f2['body'];var _0x49a429=[];if(_0x1176f2[_0xe110('0x75')][_0xe110('0x30')]===_0xe110('0x2a'))throw new Error('Unauthorized');if(_[_0xe110('0x7f')](_0xde155e,[_0xe110('0x30'),_0xe110('0x75')])&&_0x1176f2[_0xe110('0x75')]['role']!==_0xe110('0x27')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_['some'](_0xde155e,[_0xe110('0x30'),_0xe110('0x27')])&&_0x1176f2[_0xe110('0x75')][_0xe110('0x30')]!==_0xe110('0x27')){throw new Error(_0xe110('0x80'));}return licenseUtil[_0xe110('0x78')](_0xde155e)[_0xe110('0x11')](function(){return validateUser(_0xde155e[0x0]);})[_0xe110('0x11')](function(){for(var _0x2abf29=0x1;_0x2abf29<_0xde155e[_0xe110('0x45')];_0x2abf29++){var _0x46c475=_0xde155e[_0x2abf29-0x1][_0xe110('0x5c')];if(!_0xde155e[_0x2abf29]['internal'])_0xde155e[_0x2abf29][_0xe110('0x5c')]=_0x46c475+0x1;_0x49a429['push'](validateUser(_0xde155e[_0x2abf29]));}return BPromise[_0xe110('0x4b')](_0x49a429);})[_0xe110('0x11')](function(){_0x49a429=[];for(var _0x29f3f8=0x0;_0x29f3f8<_0xde155e['length'];_0x29f3f8++){_0x49a429['push'](updateUser(_0xde155e[_0x29f3f8]));}return BPromise['all'](_0x49a429);})[_0xe110('0x11')](function(){return BPromise[_0xe110('0x81')](_0xde155e,function(_0x5c31de){return db[_0xe110('0x3d')][_0xe110('0x73')](_0x5c31de,{'include':[{'model':db[_0xe110('0x7b')],'as':_0xe110('0x7b')}]})['then'](function(_0x553289){_0x5c31de['id']=_0x553289['id'];return _0x5c31de;});});})['then'](function(_0x85d383){if(_0x1176f2[_0xe110('0x57')][_0xe110('0x30')]==='user')return _0x85d383;if(_0x1176f2[_0xe110('0x75')][_0xe110('0x30')]!==_0xe110('0x75'))return _0x85d383;var _0x33892c=_[_0xe110('0x7f')](_0x85d383,function(_0x3c7917){return _0x3c7917[_0xe110('0x30')]==='agent'||_0x3c7917[_0xe110('0x30')]===_0xe110('0x82');});if(!_0x33892c)return _0x85d383;return db['UserProfileSection']['findAll']({'where':{'name':{'$or':[_0xe110('0x29'),_0xe110('0x2b')]},'userProfileId':_0x1176f2[_0xe110('0x75')][_0xe110('0x7a')]},'raw':!![]})[_0xe110('0x11')](function(_0x8e1add){if(_[_0xe110('0x83')](_0x8e1add)||!_[_0xe110('0x7f')](_0x8e1add,[_0xe110('0x84'),0x0]))return _0x85d383;_0x49a429=[];var _0x6bf794=_(_0x8e1add)[_0xe110('0x2d')](function(_0x5c3459){if(_0x5c3459[_0xe110('0x84')]===0x1)return;return _0x5c3459[_0xe110('0x32')]===_0xe110('0x29')?_0xe110('0x2a'):_0xe110('0x82');})[_0xe110('0x85')]()['value']();for(var _0x11f740=0x0;_0x11f740<_0x85d383[_0xe110('0x45')];_0x11f740++){if(!_[_0xe110('0x2f')](_0x6bf794,_0x85d383[_0x11f740]['role']))return;var _0x305d91=_0x85d383[_0x11f740][_0xe110('0x30')]===_0xe110('0x2a')?'Agents':'Telephones';_0x49a429['push'](db[_0xe110('0x7d')][_0xe110('0x73')]({'name':_0x85d383[_0x11f740][_0xe110('0x32')],'resourceId':_0x85d383[_0x11f740]['id'],'type':_0x305d91,'sectionId':_['find'](_0x8e1add,['name',_0x305d91])['id']},{}));}return BPromise['all'](_0x49a429);});})[_0xe110('0x11')](respondWithResult(_0x393671,0xc9))[_0xe110('0x1a')](handleError(_0x393671,null));};exports[_0xe110('0x86')]=function(_0x4bf9da,_0x5be5dd){if(_0x4bf9da[_0xe110('0x57')]['id']){delete _0x4bf9da[_0xe110('0x57')]['id'];}return db['User']['find']({'where':{'id':_0x4bf9da[_0xe110('0x4d')]['id']}})[_0xe110('0x11')](function(_0x5262c6){if(!_0x5262c6)return null;if(_0x5262c6['id']===_0x4bf9da[_0xe110('0x75')]['id']){if(!_0x4bf9da[_0xe110('0x57')][_0xe110('0x87')]||!_0x4bf9da[_0xe110('0x57')][_0xe110('0x88')]){throw new db['Sequelize'][(_0xe110('0x89'))](_0xe110('0x8a'));}if(!_0x5262c6[_0xe110('0x8b')](_0x4bf9da[_0xe110('0x57')][_0xe110('0x87')])){throw new db['Sequelize']['ValidationError'](_0xe110('0x8c'));}if(_0x4bf9da[_0xe110('0x57')][_0xe110('0x87')]===_0x4bf9da[_0xe110('0x57')][_0xe110('0x88')]){throw new db[(_0xe110('0x8d'))][(_0xe110('0x89'))](_0xe110('0x8e'));}}else if(_0x4bf9da[_0xe110('0x75')][_0xe110('0x30')]===_0xe110('0x27')){if(!_0x4bf9da[_0xe110('0x57')][_0xe110('0x88')]){throw new db[(_0xe110('0x8d'))][(_0xe110('0x89'))](_0xe110('0x8f'));}}else if(_0x4bf9da[_0xe110('0x75')][_0xe110('0x30')]===_0xe110('0x75')){if(!_0x4bf9da['body'][_0xe110('0x88')]){throw new db[(_0xe110('0x8d'))]['ValidationError'](_0xe110('0x8f'));}if(_0x5262c6['role']!=='agent'){throw new db[(_0xe110('0x8d'))][(_0xe110('0x89'))](_0xe110('0x74'));}}else{throw new db[(_0xe110('0x8d'))][(_0xe110('0x89'))](_0xe110('0x74'));}return _0x5262c6;})[_0xe110('0x11')](handleEntityNotFound(_0x5be5dd,null))['then'](function(_0x50c40f){return db[_0xe110('0x5d')][_0xe110('0x90')]({'attributes':['id','securePassword',_0xe110('0x91'),_0xe110('0x92')]})[_0xe110('0x11')](function(_0x26d3d6){if(_0x26d3d6[_0xe110('0x5e')])authService[_0xe110('0x93')](_0x4bf9da['body']['newPassword']);if(!_0x26d3d6['enforcePasswordHistory']||!_0x50c40f[_0xe110('0x94')])return _0x50c40f;authService['validatePasswordHistory'](_0x4bf9da[_0xe110('0x57')]['newPassword'],_0x50c40f['previousPasswords'],_0x26d3d6[_0xe110('0x92')]);return _0x50c40f;})[_0xe110('0x11')](saveUpdates({'password':_0x4bf9da[_0xe110('0x57')]['newPassword'],'passwordResetAt':_0x4bf9da['user']['id']==_0x4bf9da[_0xe110('0x4d')]['id']?moment():null,'previousPasswords':authService[_0xe110('0x95')](_0x4bf9da['body'][_0xe110('0x88')],_0x50c40f[_0xe110('0x94')])},null));})[_0xe110('0x11')](respondWithResult(_0x5be5dd,null))[_0xe110('0x1a')](handleError(_0x5be5dd,null));};exports[_0xe110('0x96')]=function(_0x28d3a7,_0x14c0d2){var _0x2ac319=_0x28d3a7['body']['channel'];return db[_0xe110('0x3d')][_0xe110('0x31')]({'where':{'id':_0x28d3a7[_0xe110('0x4d')]['id']},'attributes':['id',_0xe110('0x32'),'role',_0xe110('0x97'),_0xe110('0x98'),'voicePause',_0xe110('0x99')]})[_0xe110('0x11')](handleEntityNotFound(_0x14c0d2,null))[_0xe110('0x11')](function(_0x33010b){if(_0x33010b){if(!utils[_0xe110('0x9a')](_0x2ac319)){throw new db[(_0xe110('0x8d'))][(_0xe110('0x89'))](_0xe110('0x9b'));}return _0x33010b[_0xe110('0x9c')+_[_0xe110('0x9d')](_0x2ac319[_0xe110('0x9e')]())+'Queues'](_0x28d3a7[_0xe110('0x57')][_0xe110('0x5b')],{'penalty':_0x28d3a7[_0xe110('0x57')]['penalty']||0x0})[_0xe110('0x9f')](function(_0x3f587e){for(var _0x33c4fa=0x0;_0x33c4fa<_0x28d3a7[_0xe110('0x57')][_0xe110('0x5b')][_0xe110('0x45')];_0x33c4fa+=0x1){var _0x3e23d8={'UserId':Number(_0x28d3a7[_0xe110('0x4d')]['id'])};_0x3e23d8[_['capitalize'](_0x2ac319[_0xe110('0x9e')]())+_0xe110('0xa0')]=Number(_0x28d3a7[_0xe110('0x57')]['ids'][_0x33c4fa]);socket[_0xe110('0xa1')](_0xe110('0x75')+_[_0xe110('0x9d')](_0x2ac319[_0xe110('0x9e')]())+_0xe110('0xa2'),_0x3e23d8);}return _0x3f587e;})[_0xe110('0x11')](function(){if(_0x2ac319===_0xe110('0xa3')){return db[_0xe110('0xa4')][_0xe110('0x41')]({'where':{'id':_0x28d3a7[_0xe110('0x57')][_0xe110('0x5b')]||[]},'raw':!![],'attributes':['id',_0xe110('0x32')]});}})[_0xe110('0x11')](function(_0x2da2e2){var _0x3cc323=_0x33010b[_0xe110('0x26')]({'plain':!![]});var _0x320575=[];if(_0x2ac319==='voice'&&_0x3cc323['role']===_0xe110('0x2a')&&_0x3cc323[_0xe110('0x97')]){for(var _0x133d4f=0x0;_0x133d4f<_0x2da2e2['length'];_0x133d4f+=0x1){_0x320575[_0xe110('0x40')]({'membername':_0x3cc323[_0xe110('0x32')],'UserId':_0x3cc323['id'],'queue_name':_0x2da2e2[_0x133d4f][_0xe110('0x32')],'VoiceQueueId':_0x2da2e2[_0x133d4f]['id'],'interface':_[_0xe110('0x5f')](_0x3cc323[_0xe110('0x99')])?util[_0xe110('0xa5')](_0xe110('0xa6'),_0x3cc323[_0xe110('0x32')]):_0x3cc323[_0xe110('0x99')],'paused':_0x3cc323['voicePause']||![],'penalty':_0x28d3a7[_0xe110('0x57')][_0xe110('0xa7')]||0x0});}return BPromise[_0xe110('0x81')](_0x320575,function(_0x44e8b4){return db[_0xe110('0xa8')][_0xe110('0xa9')](_0x44e8b4);});}return _0x33010b;});}})[_0xe110('0x11')](respondWithStatusCode(_0x14c0d2,null))[_0xe110('0x1a')](handleError(_0x14c0d2,null));};exports[_0xe110('0xaa')]=function(_0x313eb5,_0x3bb611){var _0x1aec7f;return db[_0xe110('0x3d')][_0xe110('0x31')]({'where':{'id':_0x313eb5[_0xe110('0x4d')]['id']},'attributes':['id',_0xe110('0x32'),_0xe110('0x30')]})[_0xe110('0x11')](handleEntityNotFound(_0x3bb611,null))['then'](function(_0x1285ed){if(_0x1285ed){_0x1aec7f=_0x1285ed;if(!_0x313eb5[_0xe110('0x43')][_0xe110('0xab')]||!utils[_0xe110('0x9a')](_0x313eb5[_0xe110('0x43')][_0xe110('0xab')])){throw new db[(_0xe110('0x8d'))]['ValidationError'](_0xe110('0x9b'));}return _0x1285ed['remove'+_[_0xe110('0x9d')](_0x313eb5['query'][_0xe110('0xab')][_0xe110('0x9e')]())+_0xe110('0xac')](_0x313eb5[_0xe110('0x43')][_0xe110('0x5b')]);}})['then'](function(_0x5c7d3f){if(_[_0xe110('0xad')](_0x313eb5[_0xe110('0x43')][_0xe110('0x5b')])){for(var _0x31b665=0x0;_0x31b665<_0x313eb5[_0xe110('0x43')]['ids']['length'];_0x31b665+=0x1){var _0x48dc4a={'UserId':Number(_0x313eb5[_0xe110('0x4d')]['id'])};_0x48dc4a[_[_0xe110('0x9d')](_0x313eb5[_0xe110('0x43')][_0xe110('0xab')][_0xe110('0x9e')]())+_0xe110('0xa0')]=Number(_0x313eb5[_0xe110('0x43')][_0xe110('0x5b')][_0x31b665]);socket[_0xe110('0xa1')](_0xe110('0x75')+_[_0xe110('0x9d')](_0x313eb5[_0xe110('0x43')]['channel'][_0xe110('0x9e')]())+_0xe110('0xae'),_0x48dc4a);}}else{var _0x48dc4a={'UserId':Number(_0x313eb5['params']['id'])};_0x48dc4a[_[_0xe110('0x9d')](_0x313eb5['query']['channel']['toLowerCase']())+'QueueId']=Number(_0x313eb5[_0xe110('0x43')][_0xe110('0x5b')]);socket[_0xe110('0xa1')](_0xe110('0x75')+_[_0xe110('0x9d')](_0x313eb5[_0xe110('0x43')][_0xe110('0xab')][_0xe110('0x9e')]())+_0xe110('0xae'),_0x48dc4a);}return _0x5c7d3f;})[_0xe110('0x11')](function(){if(_0x313eb5[_0xe110('0x43')]['channel']==='voice'){return db['UserVoiceQueueRt'][_0xe110('0x25')]({'where':{'UserId':_0x313eb5['params']['id'],'VoiceQueueId':_0x313eb5[_0xe110('0x43')][_0xe110('0x5b')]},'individualHooks':!![]})[_0xe110('0x11')](function(){return _0x1aec7f;});}return _0x1aec7f;})[_0xe110('0x11')](respondWithStatusCode(_0x3bb611,null))[_0xe110('0x1a')](handleError(_0x3bb611,null));};exports['addAvatar']=function(_0x22816c,_0x56bdd1){_0x22816c[_0xe110('0x57')]['userpic']=_0x22816c[_0xe110('0xaf')][_0xe110('0xb0')];return db[_0xe110('0x3d')][_0xe110('0x31')]({'where':{'id':_0x22816c[_0xe110('0x4d')]['id']}})[_0xe110('0x11')](handleEntityNotFound(_0x56bdd1,null))[_0xe110('0x11')](saveUpdates(_0x22816c[_0xe110('0x57')],null))[_0xe110('0x11')](respondWithResult(_0x56bdd1,null))[_0xe110('0x1a')](handleError(_0x56bdd1,null));};exports[_0xe110('0xb1')]=function(_0x131699,_0x5642b6){var _0x533bcf=path[_0xe110('0xb2')](config['root'],_0xe110('0xb3'));return db[_0xe110('0x3d')]['find']({'where':{'id':_0x131699['params']['id']},'attributes':['id','userpic'],'raw':!![]})['then'](handleEntityNotFound(_0x5642b6,null))[_0xe110('0x11')](function(_0x2633a5){if(_0x2633a5){if(_[_0xe110('0x5f')](_0x2633a5[_0xe110('0xb4')])){return _0x5642b6[_0xe110('0xb5')](_0x533bcf);}else{if(!fs[_0xe110('0xb6')](path[_0xe110('0xb2')](config[_0xe110('0xb7')],_0xe110('0xb8'),_0x2633a5[_0xe110('0xb4')]))){return _0x5642b6['download'](_0x533bcf);}return _0x5642b6[_0xe110('0xb5')](path[_0xe110('0xb2')](config[_0xe110('0xb7')],'server/files/images/',_0x2633a5[_0xe110('0xb4')]));}}})[_0xe110('0x1a')](handleError(_0x5642b6,null));};exports[_0xe110('0xb9')]=function(_0x5a5aca,_0x459bcb){return db['User'][_0xe110('0x31')]({'where':{'id':_0x5a5aca['params']['id']},'attributes':['id']})[_0xe110('0x11')](handleEntityNotFound(_0x459bcb,null))[_0xe110('0x11')](function(_0x5786c4){var _0x4eaca1=[];values=_0x5786c4[_0xe110('0x46')];_0x4eaca1[_0xe110('0x40')](get_open_tabs(_0xe110('0xba'),_0x5786c4[_0xe110('0x46')]));_0x4eaca1[_0xe110('0x40')](get_open_tabs(_0xe110('0x47'),_0x5786c4[_0xe110('0x46')]));_0x4eaca1[_0xe110('0x40')](get_open_tabs(_0xe110('0x49'),_0x5786c4[_0xe110('0x46')]));_0x4eaca1[_0xe110('0x40')](get_open_tabs(_0xe110('0x4a'),_0x5786c4[_0xe110('0x46')]));_0x4eaca1['push'](get_open_tabs(_0xe110('0x56'),_0x5786c4[_0xe110('0x46')]));_0x4eaca1[_0xe110('0x40')](get_open_tabs('mail',_0x5786c4[_0xe110('0x46')]));return BPromise['all'](_0x4eaca1);})[_0xe110('0x11')](function(_0x3b83b1){var _0x2f044e=[];if(_0x3b83b1){for(var _0x1fc646=0x0;_0x1fc646=_0x2bb9c1[_0x38ee('0x53')]){throw new Error(_0x38ee('0x54'));}})[_0x38ee('0x24')](function(){if(_0x151857){return db[_0x38ee('0x3f')][_0x38ee('0x4b')]({'where':{'membername':_0x151857['name']},'individualHooks':!![]});}})[_0x38ee('0x24')](function(){if(_0x151857){return _0x151857[_0x38ee('0x55')]({'raw':!![]});}})[_0x38ee('0x24')](function(_0x42f9aa){if(_0x151857){if(_0x42f9aa){var _0x3cc31f=[];_0x2ce79c=_0x42f9aa;if(_0x2ce79c[_0x38ee('0x30')]){for(var _0x1df255=0x0;_0x1df255<_0x2ce79c[_0x38ee('0x30')];_0x1df255++){_0x3cc31f[_0x38ee('0x33')](db['UserVoiceQueueRt']['upsert']({'membername':_0x151857[_0x38ee('0x29')],'UserId':_0x151857['id'],'queue_name':_0x2ce79c[_0x1df255][_0x38ee('0x29')],'VoiceQueueId':_0x2ce79c[_0x1df255]['id'],'interface':_0x5eeab8,'paused':_0x151857[_0x38ee('0x4f')]||![],'penalty':_0x2ce79c[_0x1df255][_0x38ee('0x56')]||0x0}));}return BPromise[_0x38ee('0x49')](_0x3cc31f);}}}})['then'](function(){if(_0x151857){return db[_0x38ee('0x39')][_0x38ee('0x2c')]({'where':{'membername':_0x151857[_0x38ee('0x29')],'exitAt':null}});}})[_0x38ee('0x24')](function(_0x5adc88){if(_0x151857){if(_0x5adc88&&_0x5adc88[_0x38ee('0x30')]){var _0x57317c=[];_0x5adc88[_0x38ee('0x4c')](function(_0x5ccf45){_0x57317c[_0x38ee('0x33')](_0x5ccf45[_0x38ee('0x2b')]({'exitAt':moment()[_0x38ee('0x2e')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x38ee('0x49')](_0x57317c);}}})[_0x38ee('0x24')](function(_0x285873){if(_0x151857){var _0x257832=[];var _0x4539b8=[];var _0x213bed=utils[_0x38ee('0x32')]();var _0xaf1b48={'membername':_0x151857[_0x38ee('0x29')],'interface':_0x5eeab8,'enterAt':moment()['format'](_0x38ee('0x2f')),'role':_0x151857['role'],'internal':_0x151857[_0x38ee('0x4e')]};_0x213bed[_0x38ee('0x4c')](function(_0xfdf8f6){_0x257832[_0x38ee('0x33')](_[_0x38ee('0x57')]({'channel':_0xfdf8f6,'type':_0x38ee('0x58'),'data1':_0x38ee('0x59'),'data2':_0x5eeab8},_0xaf1b48));if(_0x151857[_0x38ee('0x4f')]){_0x4539b8[_0x38ee('0x33')](_[_0x38ee('0x57')]({'channel':_0xfdf8f6,'type':'PAUSE','data1':_0x38ee('0x5a')},_0xaf1b48));}});return db[_0x38ee('0x39')][_0x38ee('0x3a')](_0x257832[_0x38ee('0x5b')](_0x4539b8),{'individualHooks':!![]});}})[_0x38ee('0x24')](function(){if(_0x151857){return _0x151857[_0x38ee('0x2b')]({'online':!![],'lastLoginAt':moment()[_0x38ee('0x2e')](_0x38ee('0x2f')),'voicePause':_0x151857[_0x38ee('0x4f')]||![],'mailPause':_0x151857[_0x38ee('0x4f')]||![],'chatPause':_0x151857['loginInPause']||![],'faxPause':_0x151857['loginInPause']||![],'smsPause':_0x151857[_0x38ee('0x4f')]||![],'openchannelPause':_0x151857[_0x38ee('0x4f')]||![],'pauseType':_0x151857[_0x38ee('0x4f')]?_0x38ee('0x5a'):null,'lastPauseAt':moment()[_0x38ee('0x2e')](_0x38ee('0x2f')),'interface':_0x5eeab8});}})[_0x38ee('0x24')](function(_0x57ea01){_0x584363(_0x57ea01);})[_0x38ee('0x1a')](function(_0x1169dc){_0x5b40bf(_0x283f54[_0x38ee('0x16')](0x1f4,_0x1169dc[_0x38ee('0x18')]));});});}; \ No newline at end of file +var _0x44bd=['defaults','localhost','socket.io-emitter','register','then','info','User,\x20%s,\x20%s','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetUser','User','findAll','options','raw','where','attributes','limit','include','map','model','ShowUser','find','stringify','name','role','internal','interface','UserVoiceQueueRt','update','MemberReport','PAUSE','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','getChannels','forEach','push','isNil','SIP/%s','type','DEFAULT\x20PAUSE','body','uniqueid','bulkCreate','UnpauseUser','findOne','channel','isValidChannel','voice','system','mail','chat','fax','sms','openchannel','whatsapp','all','LogoutUser','LoginUser','mobile','phone','agent','../../config/license/util','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','upsert','loginInPause','UserVoiceQueue.penalty','merge','LOGIN','callysquare','LOGININPAUSE','concat','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x44bd,0xb0));var _0xd44b=function(_0x316cfd,_0x1dfe9d){_0x316cfd=_0x316cfd-0x0;var _0x50d52d=_0x44bd[_0x316cfd];return _0x50d52d;};'use strict';var _=require(_0xd44b('0x0'));var util=require(_0xd44b('0x1'));var moment=require(_0xd44b('0x2'));var BPromise=require('bluebird');var rs=require(_0xd44b('0x3'));var fs=require('fs');var Redis=require(_0xd44b('0x4'));var db=require(_0xd44b('0x5'))['db'];var utils=require(_0xd44b('0x6'));var logger=require(_0xd44b('0x7'))(_0xd44b('0x8'));var config=require(_0xd44b('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xd44b('0xa')]['http']({'port':0x232a});config[_0xd44b('0xb')]=_[_0xd44b('0xc')](config[_0xd44b('0xb')],{'host':_0xd44b('0xd'),'port':0x18eb});var socket=require(_0xd44b('0xe'))(new Redis(config[_0xd44b('0xb')]));require('./user.socket')[_0xd44b('0xf')](socket);function respondWithRpcPromise(_0x41be86,_0x235164,_0x41cb14){return new BPromise(function(_0x2d21dc,_0x52f742){return client['request'](_0x41be86,_0x41cb14)[_0xd44b('0x10')](function(_0x9b9564){logger[_0xd44b('0x11')](_0xd44b('0x12'),_0x235164,_0xd44b('0x13'));logger[_0xd44b('0x14')](_0xd44b('0x15'),_0x235164,_0xd44b('0x13'),JSON['stringify'](_0x9b9564));if(_0x9b9564[_0xd44b('0x16')]){if(_0x9b9564[_0xd44b('0x16')][_0xd44b('0x17')]===0x1f4){logger['error'](_0xd44b('0x12'),_0x235164,_0x9b9564[_0xd44b('0x16')]['message']);return _0x52f742(_0x9b9564[_0xd44b('0x16')]['message']);}logger[_0xd44b('0x16')](_0xd44b('0x12'),_0x235164,_0x9b9564[_0xd44b('0x16')][_0xd44b('0x18')]);return _0x2d21dc(_0x9b9564[_0xd44b('0x16')][_0xd44b('0x18')]);}else{logger[_0xd44b('0x11')](_0xd44b('0x12'),_0x235164,'request\x20sent');_0x2d21dc(_0x9b9564[_0xd44b('0x19')][_0xd44b('0x18')]);}})[_0xd44b('0x1a')](function(_0x4521e7){logger[_0xd44b('0x16')](_0xd44b('0x12'),_0x235164,_0x4521e7);_0x52f742(_0x4521e7);});});}exports[_0xd44b('0x1b')]=function(_0x1d8571){var _0x119c03=this;return new Promise(function(_0x5c7699,_0x356030){return db[_0xd44b('0x1c')][_0xd44b('0x1d')]({'raw':_0x1d8571[_0xd44b('0x1e')]?_0x1d8571[_0xd44b('0x1e')][_0xd44b('0x1f')]===undefined?!![]:![]:!![],'where':_0x1d8571[_0xd44b('0x1e')]?_0x1d8571[_0xd44b('0x1e')][_0xd44b('0x20')]||null:null,'attributes':_0x1d8571[_0xd44b('0x1e')]?_0x1d8571[_0xd44b('0x1e')][_0xd44b('0x21')]||null:null,'limit':_0x1d8571['options']?_0x1d8571[_0xd44b('0x1e')][_0xd44b('0x22')]||null:null,'include':_0x1d8571['options']?_0x1d8571[_0xd44b('0x1e')][_0xd44b('0x23')]?_[_0xd44b('0x24')](_0x1d8571[_0xd44b('0x1e')][_0xd44b('0x23')],function(_0x21eca3){return{'model':db[_0x21eca3['model']],'as':_0x21eca3['as'],'attributes':_0x21eca3[_0xd44b('0x21')],'include':_0x21eca3['include']?_[_0xd44b('0x24')](_0x21eca3['include'],function(_0x575cf7){return{'model':db[_0x575cf7[_0xd44b('0x25')]],'as':_0x575cf7['as'],'attributes':_0x575cf7[_0xd44b('0x21')],'include':_0x575cf7['include']?_[_0xd44b('0x24')](_0x575cf7[_0xd44b('0x23')],function(_0x369edc){return{'model':db[_0x369edc[_0xd44b('0x25')]],'as':_0x369edc['as'],'attributes':_0x369edc[_0xd44b('0x21')]};}):[]};}):[]};}):[]:[]})[_0xd44b('0x10')](function(_0x4579e1){logger[_0xd44b('0x11')]('GetUser',_0x1d8571);logger['debug'](_0xd44b('0x1b'),_0x1d8571,JSON['stringify'](_0x4579e1));_0x5c7699(_0x4579e1);})[_0xd44b('0x1a')](function(_0x4e338f){logger[_0xd44b('0x16')](_0xd44b('0x1b'),_0x4e338f['message'],_0x1d8571);_0x356030(_0x119c03[_0xd44b('0x16')](0x1f4,_0x4e338f[_0xd44b('0x18')]));});});};exports[_0xd44b('0x26')]=function(_0x50ecef){var _0x704746=this;return new Promise(function(_0x20df0d,_0x466621){return db[_0xd44b('0x1c')][_0xd44b('0x27')]({'raw':_0x50ecef[_0xd44b('0x1e')]?_0x50ecef[_0xd44b('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x50ecef[_0xd44b('0x1e')]?_0x50ecef[_0xd44b('0x1e')]['where']||null:null,'attributes':_0x50ecef['options']?_0x50ecef['options'][_0xd44b('0x21')]||null:null,'include':_0x50ecef[_0xd44b('0x1e')]?_0x50ecef['options']['include']?_['map'](_0x50ecef[_0xd44b('0x1e')][_0xd44b('0x23')],function(_0x5c2e7b){return{'model':db[_0x5c2e7b['model']],'as':_0x5c2e7b['as'],'attributes':_0x5c2e7b[_0xd44b('0x21')],'include':_0x5c2e7b[_0xd44b('0x23')]?_[_0xd44b('0x24')](_0x5c2e7b[_0xd44b('0x23')],function(_0x2419e2){return{'model':db[_0x2419e2[_0xd44b('0x25')]],'as':_0x2419e2['as'],'attributes':_0x2419e2[_0xd44b('0x21')],'include':_0x2419e2[_0xd44b('0x23')]?_[_0xd44b('0x24')](_0x2419e2[_0xd44b('0x23')],function(_0x46270c){return{'model':db[_0x46270c[_0xd44b('0x25')]],'as':_0x46270c['as'],'attributes':_0x46270c[_0xd44b('0x21')]};}):[]};}):[]};}):[]:[]})[_0xd44b('0x10')](function(_0x1deba6){logger[_0xd44b('0x11')](_0xd44b('0x26'),_0x50ecef);logger[_0xd44b('0x14')](_0xd44b('0x26'),_0x50ecef,JSON[_0xd44b('0x28')](_0x1deba6));_0x20df0d(_0x1deba6);})[_0xd44b('0x1a')](function(_0x28edc2){logger[_0xd44b('0x16')]('ShowUser',_0x28edc2[_0xd44b('0x18')],_0x50ecef);_0x466621(_0x704746['error'](0x1f4,_0x28edc2[_0xd44b('0x18')]));});});};exports['PauseUser']=function(_0x2c8a08){var _0x44cb97=this;return new Promise(function(_0x1f30d6,_0x34ca71){var _0x9e9ddc;return db['User'][_0xd44b('0x27')]({'where':_0x2c8a08[_0xd44b('0x1e')][_0xd44b('0x20')]||{},'attributes':['id',_0xd44b('0x29'),_0xd44b('0x2a'),_0xd44b('0x2b'),_0xd44b('0x2c')]})[_0xd44b('0x10')](function(_0x38d317){if(_0x38d317){_0x9e9ddc=_0x38d317;return db[_0xd44b('0x2d')][_0xd44b('0x2e')]({'paused':0x1},{'where':{'UserId':_0x9e9ddc['id']},'individualHooks':!![]});}})[_0xd44b('0x10')](function(){if(_0x9e9ddc){return db[_0xd44b('0x2f')][_0xd44b('0x1d')]({'where':{'membername':_0x9e9ddc[_0xd44b('0x29')],'type':_0xd44b('0x30'),'exitAt':null}});}})[_0xd44b('0x10')](function(_0x4ed601){if(_0x9e9ddc){if(_0x4ed601&&_0x4ed601[_0xd44b('0x31')]){var _0x3ad66d=moment()[_0xd44b('0x32')](_0xd44b('0x33'));for(var _0x46e5cf=0x0,_0x5eaadd=_0x4ed601['length'];_0x46e5cf<_0x5eaadd;_0x46e5cf++){_0x4ed601[_0x46e5cf][_0xd44b('0x34')]({'exitAt':_0x3ad66d});}}}})['then'](function(){if(_0x9e9ddc){var _0x46a06e=[];var _0x3e0862=utils[_0xd44b('0x35')]();_0x3e0862[_0xd44b('0x36')](function(_0xf220b5){_0x46a06e[_0xd44b('0x37')]({'channel':_0xf220b5,'membername':_0x9e9ddc[_0xd44b('0x29')],'interface':_[_0xd44b('0x38')](_0x9e9ddc[_0xd44b('0x2c')])?util[_0xd44b('0x32')](_0xd44b('0x39'),_0x9e9ddc[_0xd44b('0x29')]):_0x9e9ddc[_0xd44b('0x2c')],'type':'PAUSE','enterAt':moment()['format'](_0xd44b('0x33')),'data1':_0x2c8a08['body'][_0xd44b('0x3a')]||_0xd44b('0x3b'),'role':_0x9e9ddc[_0xd44b('0x2a')],'internal':_0x9e9ddc['internal'],'uniqueid':_0x2c8a08[_0xd44b('0x3c')][_0xd44b('0x3d')]||null});});return db[_0xd44b('0x2f')][_0xd44b('0x3e')](_0x46a06e,{'individualHooks':!![]});}})[_0xd44b('0x10')](function(){if(_0x9e9ddc){return _0x9e9ddc[_0xd44b('0x2e')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x2c8a08['body'][_0xd44b('0x3a')]||'DEFAULT\x20PAUSE','lastPauseAt':moment()['format'](_0xd44b('0x33'))});}})['then'](function(_0x181b78){_0x1f30d6(_0x181b78);})[_0xd44b('0x1a')](function(_0x3ffaee){_0x34ca71(_0x44cb97[_0xd44b('0x16')](0x1f4,_0x3ffaee[_0xd44b('0x18')]));});});};exports[_0xd44b('0x3f')]=function(_0x5a67e5){var _0x5aa82b=this;return new Promise(function(_0x359363,_0x5730fe){var _0x4f707f;return db[_0xd44b('0x1c')][_0xd44b('0x40')]({'where':_0x5a67e5['options']['where']||{},'attributes':['id',_0xd44b('0x29')]})[_0xd44b('0x10')](function(_0x3201d6){if(_0x3201d6){_0x4f707f=_0x3201d6;if(_0x5a67e5[_0xd44b('0x3c')][_0xd44b('0x41')]&&!utils[_0xd44b('0x42')](_0x5a67e5[_0xd44b('0x3c')][_0xd44b('0x41')])){throw new Error('Unknown\x20channel');}switch(_0x5a67e5[_0xd44b('0x3c')]['channel']){case _0xd44b('0x43'):return db[_0xd44b('0x2d')][_0xd44b('0x2e')]({'paused':0x0},{'where':{'UserId':_0x4f707f['id']}})['then'](function(){return db[_0xd44b('0x2f')][_0xd44b('0x27')]({'where':{'channel':_0x5a67e5[_0xd44b('0x3c')][_0xd44b('0x41')],'membername':_0x4f707f[_0xd44b('0x29')],'type':'PAUSE','exitAt':null}});})[_0xd44b('0x10')](function(_0x14df8a){if(_0x14df8a){return _0x14df8a[_0xd44b('0x2e')]({'exitAt':moment()[_0xd44b('0x32')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0xd44b('0x44')},{'individualHooks':!![]});}return null;})['then'](function(){return _0x4f707f[_0xd44b('0x2e')]({'voicePause':![]});});case _0xd44b('0x45'):case _0xd44b('0x46'):case _0xd44b('0x47'):case _0xd44b('0x48'):case _0xd44b('0x49'):case _0xd44b('0x4a'):return db['MemberReport'][_0xd44b('0x27')]({'where':{'channel':_0x5a67e5[_0xd44b('0x3c')][_0xd44b('0x41')],'membername':_0x4f707f[_0xd44b('0x29')],'type':'PAUSE','exitAt':null}})[_0xd44b('0x10')](function(_0x57f184){return _0x57f184[_0xd44b('0x2e')]({'exitAt':moment()[_0xd44b('0x32')](_0xd44b('0x33')),'data2':_0xd44b('0x44')},{'individualHooks':!![]});})[_0xd44b('0x10')](function(){var _0x340e55={};_['set'](_0x340e55,util[_0xd44b('0x32')]('%s%s',_0x5a67e5[_0xd44b('0x3c')][_0xd44b('0x41')],'Pause'),![]);return _0x4f707f['update'](_0x340e55);});default:return db['UserVoiceQueueRt'][_0xd44b('0x2e')]({'paused':0x0},{'where':{'UserId':_0x4f707f['id']}})['then'](function(){return db['MemberReport'][_0xd44b('0x1d')]({'where':{'membername':_0x4f707f[_0xd44b('0x29')],'type':_0xd44b('0x30'),'exitAt':null}});})[_0xd44b('0x10')](function(_0x1aaa6c){var _0xfdbf5c=[];_0x1aaa6c[_0xd44b('0x36')](function(_0x2ca943){_0xfdbf5c[_0xd44b('0x37')](_0x2ca943[_0xd44b('0x2e')]({'exitAt':moment()[_0xd44b('0x32')](_0xd44b('0x33')),'data2':_0xd44b('0x44')}));});return BPromise[_0xd44b('0x4b')](_0xfdbf5c);})[_0xd44b('0x10')](function(){return _0x4f707f[_0xd44b('0x2e')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![]});});}}})[_0xd44b('0x10')](function(_0x21c48d){_0x359363(_0x21c48d);})[_0xd44b('0x1a')](function(_0x2546d0){_0x5730fe(_0x5aa82b[_0xd44b('0x16')](0x1f4,_0x2546d0[_0xd44b('0x18')]));});});};exports[_0xd44b('0x4c')]=function(_0xa2362c){var _0x110f8f=this;return new Promise(function(_0x391290,_0x417260){var _0x1b874f;return db[_0xd44b('0x1c')][_0xd44b('0x40')]({'where':_0xa2362c[_0xd44b('0x1e')][_0xd44b('0x20')]||{},'attributes':['id',_0xd44b('0x29')]})[_0xd44b('0x10')](function(_0x2030cd){if(_0x2030cd){_0x1b874f=_0x2030cd;return db[_0xd44b('0x2d')]['destroy']({'where':{'membername':_0x1b874f[_0xd44b('0x29')]},'individualHooks':!![]});}})[_0xd44b('0x10')](function(){if(_0x1b874f){return db[_0xd44b('0x2f')]['findAll']({'where':{'membername':_0x1b874f['name'],'exitAt':null}});}})[_0xd44b('0x10')](function(_0x3fa647){if(_0x1b874f){if(_0x3fa647&&_0x3fa647[_0xd44b('0x31')]){var _0x463a1a=[];_0x3fa647[_0xd44b('0x36')](function(_0x45c971){_0x463a1a['push'](_0x45c971[_0xd44b('0x2e')]({'exitAt':moment()[_0xd44b('0x32')](_0xd44b('0x33'))}));});return BPromise[_0xd44b('0x4b')](_0x463a1a);}}})[_0xd44b('0x10')](function(){if(_0x1b874f){return _0x1b874f[_0xd44b('0x2e')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0xd44b('0x10')](function(_0x23cb64){_0x391290(_0x23cb64);})[_0xd44b('0x1a')](function(_0x35d967){_0x417260(_0x110f8f['error'](0x1f4,_0x35d967[_0xd44b('0x18')]));});});};exports[_0xd44b('0x4d')]=function(_0x497d58){var _0x4e0aae=this;return new Promise(function(_0x495228,_0x3b7bc9){var _0xb6e880;var _0x49fbf9;var _0x3c422d;var _0x5eb40a;return db[_0xd44b('0x1c')]['findOne']({'where':_0x497d58[_0xd44b('0x1e')][_0xd44b('0x20')]||{},'attributes':['id',_0xd44b('0x29'),_0xd44b('0x2a'),_0xd44b('0x4e'),_0xd44b('0x4f'),_0xd44b('0x2b'),'loginInPause','interface']})[_0xd44b('0x10')](function(_0x585aad){if(_0x585aad){_0xb6e880=_0x585aad;_0x5eb40a=_0x497d58[_0xd44b('0x3c')][_0xd44b('0x2c')]?_0x497d58[_0xd44b('0x3c')][_0xd44b('0x2c')]:util[_0xd44b('0x32')]('SIP/%s',_0xb6e880[_0xd44b('0x29')]);return db[_0xd44b('0x1c')]['count']({'where':{'role':_0xd44b('0x50'),'online':!![],'id':{'$ne':_0xb6e880['id']}}});}})[_0xd44b('0x10')](function(_0xb3f5aa){if(_0xb3f5aa){_0x3c422d=_0xb3f5aa;return require(_0xd44b('0x51'))[_0xd44b('0x52')]();}})[_0xd44b('0x10')](function(_0x2b0417){if(_0x2b0417&&_0x2b0417[_0xd44b('0x53')]&&_0x3c422d>=_0x2b0417[_0xd44b('0x53')]){throw new Error(_0xd44b('0x54'));}})[_0xd44b('0x10')](function(){if(_0xb6e880){return db[_0xd44b('0x2d')]['destroy']({'where':{'membername':_0xb6e880[_0xd44b('0x29')]},'individualHooks':!![]});}})[_0xd44b('0x10')](function(){if(_0xb6e880){return _0xb6e880[_0xd44b('0x55')]({'raw':!![]});}})[_0xd44b('0x10')](function(_0x57dc30){if(_0xb6e880){if(_0x57dc30){var _0x51dac5=[];_0x49fbf9=_0x57dc30;if(_0x49fbf9[_0xd44b('0x31')]){for(var _0x50be73=0x0;_0x50be73<_0x49fbf9[_0xd44b('0x31')];_0x50be73++){_0x51dac5[_0xd44b('0x37')](db['UserVoiceQueueRt'][_0xd44b('0x56')]({'membername':_0xb6e880[_0xd44b('0x29')],'UserId':_0xb6e880['id'],'queue_name':_0x49fbf9[_0x50be73]['name'],'VoiceQueueId':_0x49fbf9[_0x50be73]['id'],'interface':_0x5eb40a,'paused':_0xb6e880[_0xd44b('0x57')]||![],'penalty':_0x49fbf9[_0x50be73][_0xd44b('0x58')]||0x0}));}return BPromise['all'](_0x51dac5);}}}})[_0xd44b('0x10')](function(){if(_0xb6e880){return db[_0xd44b('0x2f')][_0xd44b('0x1d')]({'where':{'membername':_0xb6e880[_0xd44b('0x29')],'exitAt':null}});}})[_0xd44b('0x10')](function(_0x3dea41){if(_0xb6e880){if(_0x3dea41&&_0x3dea41['length']){var _0x3b738e=[];_0x3dea41['forEach'](function(_0x5e6024){_0x3b738e[_0xd44b('0x37')](_0x5e6024[_0xd44b('0x2e')]({'exitAt':moment()[_0xd44b('0x32')](_0xd44b('0x33'))}));});return BPromise[_0xd44b('0x4b')](_0x3b738e);}}})[_0xd44b('0x10')](function(_0x397afa){if(_0xb6e880){var _0x3bc48a=[];var _0x2b0d39=[];var _0x514941=utils[_0xd44b('0x35')]();var _0x5ccd40={'membername':_0xb6e880[_0xd44b('0x29')],'interface':_0x5eb40a,'enterAt':moment()[_0xd44b('0x32')](_0xd44b('0x33')),'role':_0xb6e880[_0xd44b('0x2a')],'internal':_0xb6e880[_0xd44b('0x2b')]};_0x514941[_0xd44b('0x36')](function(_0x6d53d3){_0x3bc48a[_0xd44b('0x37')](_[_0xd44b('0x59')]({'channel':_0x6d53d3,'type':_0xd44b('0x5a'),'data1':_0xd44b('0x5b'),'data2':_0x5eb40a},_0x5ccd40));if(_0xb6e880[_0xd44b('0x57')]){_0x2b0d39[_0xd44b('0x37')](_['merge']({'channel':_0x6d53d3,'type':_0xd44b('0x30'),'data1':_0xd44b('0x5c')},_0x5ccd40));}});return db[_0xd44b('0x2f')][_0xd44b('0x3e')](_0x3bc48a[_0xd44b('0x5d')](_0x2b0d39),{'individualHooks':!![]});}})['then'](function(){if(_0xb6e880){return _0xb6e880[_0xd44b('0x2e')]({'online':!![],'lastLoginAt':moment()['format'](_0xd44b('0x33')),'voicePause':_0xb6e880[_0xd44b('0x57')]||![],'mailPause':_0xb6e880[_0xd44b('0x57')]||![],'chatPause':_0xb6e880[_0xd44b('0x57')]||![],'faxPause':_0xb6e880['loginInPause']||![],'smsPause':_0xb6e880[_0xd44b('0x57')]||![],'openchannelPause':_0xb6e880['loginInPause']||![],'pauseType':_0xb6e880[_0xd44b('0x57')]?'LOGININPAUSE':null,'lastPauseAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'interface':_0x5eb40a});}})['then'](function(_0x30792f){_0x495228(_0x30792f);})[_0xd44b('0x1a')](function(_0x5b2603){_0x3b7bc9(_0x4e0aae['error'](0x1f4,_0x5b2603[_0xd44b('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index dddce9a..00847bb 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 _0xc194=['emit','removeListener','register','length','user:','./user.events','save','remove','update'];(function(_0x5a976d,_0x52c9c6){var _0x3cfa03=function(_0x218a44){while(--_0x218a44){_0x5a976d['push'](_0x5a976d['shift']());}};_0x3cfa03(++_0x52c9c6);}(_0xc194,0x164));var _0x4c19=function(_0x509b7c,_0x988148){_0x509b7c=_0x509b7c-0x0;var _0x110cc1=_0xc194[_0x509b7c];return _0x110cc1;};'use strict';var UserEvents=require(_0x4c19('0x0'));var events=[_0x4c19('0x1'),_0x4c19('0x2'),_0x4c19('0x3')];function createListener(_0x10b7d2,_0x170000){return function(_0xd382b6){_0x170000[_0x4c19('0x4')](_0x10b7d2,_0xd382b6);};}function removeListener(_0xb23b51,_0x1b7bde){return function(){UserEvents[_0x4c19('0x5')](_0xb23b51,_0x1b7bde);};}exports[_0x4c19('0x6')]=function(_0x39cfda){for(var _0x5df2d3=0x0,_0x3c6076=events[_0x4c19('0x7')];_0x5df2d3<_0x3c6076;_0x5df2d3++){var _0x439a5d=events[_0x5df2d3];var _0x4989d1=createListener(_0x4c19('0x8')+_0x439a5d,_0x39cfda);UserEvents['on'](_0x439a5d,_0x4989d1);}}; \ No newline at end of file +var _0x8fae=['register','length','./user.events','save','remove','update','emit','removeListener'];(function(_0x1ee5e6,_0x43a622){var _0x40af44=function(_0x47beeb){while(--_0x47beeb){_0x1ee5e6['push'](_0x1ee5e6['shift']());}};_0x40af44(++_0x43a622);}(_0x8fae,0x11a));var _0xe8fa=function(_0x229f4,_0x2ae27f){_0x229f4=_0x229f4-0x0;var _0x32f980=_0x8fae[_0x229f4];return _0x32f980;};'use strict';var UserEvents=require(_0xe8fa('0x0'));var events=[_0xe8fa('0x1'),_0xe8fa('0x2'),_0xe8fa('0x3')];function createListener(_0x5cd6f2,_0x86855a){return function(_0x331a6c){_0x86855a[_0xe8fa('0x4')](_0x5cd6f2,_0x331a6c);};}function removeListener(_0x310d25,_0x16e5bc){return function(){UserEvents[_0xe8fa('0x5')](_0x310d25,_0x16e5bc);};}exports[_0xe8fa('0x6')]=function(_0x286c09){for(var _0x54860d=0x0,_0x14e8c8=events[_0xe8fa('0x7')];_0x54860d<_0x14e8c8;_0x54860d++){var _0x490236=events[_0x54860d];var _0x4b1fbb=createListener('user:'+_0x490236,_0x286c09);UserEvents['on'](_0x490236,_0x4b1fbb);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index 9218dff..93f21da 100644 --- a/server/api/userChatQueue/index.js +++ b/server/api/userChatQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x2b9e33,_0x266ac7){var _0x3062a6=function(_0x452db6){while(--_0x452db6){_0x2b9e33['push'](_0x2b9e33['shift']());}};_0x3062a6(++_0x266ac7);}(_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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x539610,_0xe3f8e3){var _0x1b1ca2=function(_0x1a664b){while(--_0x1a664b){_0x539610['push'](_0x539610['shift']());}};_0x1b1ca2(++_0xe3f8e3);}(_0xedd9,0xfc));var _0x9edd=function(_0x55c102,_0x4121d0){_0x55c102=_0x55c102-0x0;var _0x7665dd=_0xedd9[_0x55c102];return _0x7665dd;};'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 diff --git a/server/api/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index 3c20b82..a6f3091 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 _0xf9f9=['sequelize','exports','INTEGER'];(function(_0x3787eb,_0x4963bd){var _0x4d8866=function(_0x1c36bc){while(--_0x1c36bc){_0x3787eb['push'](_0x3787eb['shift']());}};_0x4d8866(++_0x4963bd);}(_0xf9f9,0x90));var _0x9f9f=function(_0x23c83f,_0x48decb){_0x23c83f=_0x23c83f-0x0;var _0x44ba81=_0xf9f9[_0x23c83f];return _0x44ba81;};'use strict';var Sequelize=require(_0x9f9f('0x0'));module[_0x9f9f('0x1')]={'penalty':{'type':Sequelize[_0x9f9f('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x70d1=['INTEGER','exports'];(function(_0x20db6c,_0x4ff24a){var _0x30b5d3=function(_0x1ba9f0){while(--_0x1ba9f0){_0x20db6c['push'](_0x20db6c['shift']());}};_0x30b5d3(++_0x4ff24a);}(_0x70d1,0xbd));var _0x170d=function(_0x485cd4,_0x506e1b){_0x485cd4=_0x485cd4-0x0;var _0x528199=_0x70d1[_0x485cd4];return _0x528199;};'use strict';var Sequelize=require('sequelize');module[_0x170d('0x0')]={'penalty':{'type':Sequelize[_0x170d('0x1')],'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 b713e9a..f90da5c 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 _0xc489=['user_has_chat_queues','lodash','util','api','bluebird','request-promise','path','./userChatQueue.attributes','exports','UserChatQueue'];(function(_0x1c4b46,_0x26ba44){var _0x32f50c=function(_0x4593f0){while(--_0x4593f0){_0x1c4b46['push'](_0x1c4b46['shift']());}};_0x32f50c(++_0x26ba44);}(_0xc489,0x137));var _0x9c48=function(_0x16b55f,_0x301c6c){_0x16b55f=_0x16b55f-0x0;var _0x391c2f=_0xc489[_0x16b55f];return _0x391c2f;};'use strict';var _=require(_0x9c48('0x0'));var util=require(_0x9c48('0x1'));var logger=require('../../config/logger')(_0x9c48('0x2'));var moment=require('moment');var BPromise=require(_0x9c48('0x3'));var rp=require(_0x9c48('0x4'));var fs=require('fs');var path=require(_0x9c48('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x9c48('0x6'));module[_0x9c48('0x7')]=function(_0x24853f,_0x3492f1){return _0x24853f['define'](_0x9c48('0x8'),attributes,{'tableName':_0x9c48('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4d7f=['UserChatQueue','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x587fb5,_0x59cb3b){var _0x551105=function(_0x5bbef4){while(--_0x5bbef4){_0x587fb5['push'](_0x587fb5['shift']());}};_0x551105(++_0x59cb3b);}(_0x4d7f,0x1e7));var _0xf4d7=function(_0x4f43d5,_0x3d777b){_0x4f43d5=_0x4f43d5-0x0;var _0x4af9cd=_0x4d7f[_0x4f43d5];return _0x4af9cd;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xf4d7('0x0'));var moment=require(_0xf4d7('0x1'));var BPromise=require(_0xf4d7('0x2'));var rp=require(_0xf4d7('0x3'));var fs=require('fs');var path=require(_0xf4d7('0x4'));var rimraf=require(_0xf4d7('0x5'));var config=require(_0xf4d7('0x6'));var attributes=require('./userChatQueue.attributes');module[_0xf4d7('0x7')]=function(_0x50ea5c,_0x466765){return _0x50ea5c['define'](_0xf4d7('0x8'),attributes,{'tableName':'user_has_chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.rpc.js b/server/api/userChatQueue/userChatQueue.rpc.js index 9037953..8cffedc 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 _0x9c4f=['UserChatQueue,\x20%s,\x20%s','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then'];(function(_0x54945e,_0x42f71a){var _0x36eabd=function(_0x178ecf){while(--_0x178ecf){_0x54945e['push'](_0x54945e['shift']());}};_0x36eabd(++_0x42f71a);}(_0x9c4f,0x1d8));var _0xf9c4=function(_0x34bba3,_0x515d98){_0x34bba3=_0x34bba3-0x0;var _0x40b8b8=_0x9c4f[_0x34bba3];return _0x40b8b8;};'use strict';var _=require(_0xf9c4('0x0'));var util=require('util');var moment=require(_0xf9c4('0x1'));var BPromise=require(_0xf9c4('0x2'));var rs=require(_0xf9c4('0x3'));var fs=require('fs');var Redis=require(_0xf9c4('0x4'));var db=require(_0xf9c4('0x5'))['db'];var utils=require(_0xf9c4('0x6'));var logger=require(_0xf9c4('0x7'))(_0xf9c4('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf9c4('0x9')][_0xf9c4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5383fc,_0x3dd83e,_0x24b624){return new BPromise(function(_0xd9696a,_0x2bcd61){return client['request'](_0x5383fc,_0x24b624)[_0xf9c4('0xb')](function(_0x756452){logger['info'](_0xf9c4('0xc'),_0x3dd83e,'request\x20sent');logger[_0xf9c4('0xd')](_0xf9c4('0xe'),_0x3dd83e,_0xf9c4('0xf'),JSON[_0xf9c4('0x10')](_0x756452));if(_0x756452[_0xf9c4('0x11')]){if(_0x756452[_0xf9c4('0x11')][_0xf9c4('0x12')]===0x1f4){logger['error'](_0xf9c4('0xc'),_0x3dd83e,_0x756452['error'][_0xf9c4('0x13')]);return _0x2bcd61(_0x756452[_0xf9c4('0x11')][_0xf9c4('0x13')]);}logger[_0xf9c4('0x11')]('UserChatQueue,\x20%s,\x20%s',_0x3dd83e,_0x756452[_0xf9c4('0x11')][_0xf9c4('0x13')]);return _0xd9696a(_0x756452[_0xf9c4('0x11')][_0xf9c4('0x13')]);}else{logger[_0xf9c4('0x14')]('UserChatQueue,\x20%s,\x20%s',_0x3dd83e,_0xf9c4('0xf'));_0xd9696a(_0x756452[_0xf9c4('0x15')][_0xf9c4('0x13')]);}})['catch'](function(_0x4e07f7){logger[_0xf9c4('0x11')](_0xf9c4('0xc'),_0x3dd83e,_0x4e07f7);_0x2bcd61(_0x4e07f7);});});} \ No newline at end of file +var _0x370e=['then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request'];(function(_0x493a51,_0x45128c){var _0xc85756=function(_0x2c39a8){while(--_0x2c39a8){_0x493a51['push'](_0x493a51['shift']());}};_0xc85756(++_0x45128c);}(_0x370e,0xbb));var _0xe370=function(_0x1bb613,_0x89b101){_0x1bb613=_0x1bb613-0x0;var _0x14de71=_0x370e[_0x1bb613];return _0x14de71;};'use strict';var _=require(_0xe370('0x0'));var util=require(_0xe370('0x1'));var moment=require('moment');var BPromise=require(_0xe370('0x2'));var rs=require(_0xe370('0x3'));var fs=require('fs');var Redis=require(_0xe370('0x4'));var db=require(_0xe370('0x5'))['db'];var utils=require(_0xe370('0x6'));var logger=require(_0xe370('0x7'))(_0xe370('0x8'));var config=require(_0xe370('0x9'));var jayson=require(_0xe370('0xa'));var client=jayson[_0xe370('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x53e07b,_0x54bef9,_0x2a6022){return new BPromise(function(_0x21b58d,_0x248bbb){return client[_0xe370('0xc')](_0x53e07b,_0x2a6022)[_0xe370('0xd')](function(_0x820bbd){logger[_0xe370('0xe')](_0xe370('0xf'),_0x54bef9,_0xe370('0x10'));logger[_0xe370('0x11')](_0xe370('0x12'),_0x54bef9,_0xe370('0x10'),JSON[_0xe370('0x13')](_0x820bbd));if(_0x820bbd[_0xe370('0x14')]){if(_0x820bbd['error'][_0xe370('0x15')]===0x1f4){logger[_0xe370('0x14')]('UserChatQueue,\x20%s,\x20%s',_0x54bef9,_0x820bbd[_0xe370('0x14')][_0xe370('0x16')]);return _0x248bbb(_0x820bbd['error'][_0xe370('0x16')]);}logger[_0xe370('0x14')](_0xe370('0xf'),_0x54bef9,_0x820bbd['error'][_0xe370('0x16')]);return _0x21b58d(_0x820bbd['error'][_0xe370('0x16')]);}else{logger[_0xe370('0xe')](_0xe370('0xf'),_0x54bef9,_0xe370('0x10'));_0x21b58d(_0x820bbd[_0xe370('0x17')][_0xe370('0x16')]);}})[_0xe370('0x18')](function(_0x56929f){logger[_0xe370('0x14')](_0xe370('0xf'),_0x54bef9,_0x56929f);_0x248bbb(_0x56929f);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index 1342965..67ad8db 100644 --- a/server/api/userFaxQueue/index.js +++ b/server/api/userFaxQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x1e1af0,_0x5abc3c){var _0x3d161d=function(_0x2c2df0){while(--_0x2c2df0){_0x1e1af0['push'](_0x1e1af0['shift']());}};_0x3d161d(++_0x5abc3c);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x4f7588,_0x399e6b){var _0x535c70=function(_0x5c2bbb){while(--_0x5c2bbb){_0x4f7588['push'](_0x4f7588['shift']());}};_0x535c70(++_0x399e6b);}(_0x9c44,0x178));var _0x49c4=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0x9c44[_0x32f7d7];return _0x133d09;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index 977923a..c2c831b 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 _0x89b1=['exports','INTEGER','sequelize'];(function(_0x2ee749,_0x46af19){var _0x3eec63=function(_0x51fd0d){while(--_0x51fd0d){_0x2ee749['push'](_0x2ee749['shift']());}};_0x3eec63(++_0x46af19);}(_0x89b1,0x10d));var _0x189b=function(_0x48951a,_0x23dd81){_0x48951a=_0x48951a-0x0;var _0x2c0b5=_0x89b1[_0x48951a];return _0x2c0b5;};'use strict';var Sequelize=require(_0x189b('0x0'));module[_0x189b('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x189b('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x5e43=['INTEGER','STRING','sequelize','exports'];(function(_0x3e2c1e,_0x1e8d40){var _0x1c6666=function(_0x190b73){while(--_0x190b73){_0x3e2c1e['push'](_0x3e2c1e['shift']());}};_0x1c6666(++_0x1e8d40);}(_0x5e43,0x102));var _0x35e4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5e43[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x35e4('0x0'));module[_0x35e4('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x35e4('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x35e4('0x3')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 086c8a5..06891c7 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 _0x6536=['../../config/environment','./userFaxQueue.attributes','exports','define','UserFaxQueue','user_has_fax_queues','lodash','util','../../config/logger','api','request-promise','rimraf'];(function(_0x526298,_0x2ec3ba){var _0x467835=function(_0x32d027){while(--_0x32d027){_0x526298['push'](_0x526298['shift']());}};_0x467835(++_0x2ec3ba);}(_0x6536,0x1b6));var _0x6653=function(_0x481704,_0x2c8229){_0x481704=_0x481704-0x0;var _0x1e95a3=_0x6536[_0x481704];return _0x1e95a3;};'use strict';var _=require(_0x6653('0x0'));var util=require(_0x6653('0x1'));var logger=require(_0x6653('0x2'))(_0x6653('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6653('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6653('0x5'));var config=require(_0x6653('0x6'));var attributes=require(_0x6653('0x7'));module[_0x6653('0x8')]=function(_0x13c3c1,_0x2ff95d){return _0x13c3c1[_0x6653('0x9')](_0x6653('0xa'),attributes,{'tableName':_0x6653('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4f98=['../../config/environment','./userFaxQueue.attributes','exports','define','UserFaxQueue','user_has_fax_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x4f98,0x172));var _0x84f9=function(_0x330723,_0x8de382){_0x330723=_0x330723-0x0;var _0x60c546=_0x4f98[_0x330723];return _0x60c546;};'use strict';var _=require(_0x84f9('0x0'));var util=require(_0x84f9('0x1'));var logger=require(_0x84f9('0x2'))(_0x84f9('0x3'));var moment=require(_0x84f9('0x4'));var BPromise=require(_0x84f9('0x5'));var rp=require(_0x84f9('0x6'));var fs=require('fs');var path=require(_0x84f9('0x7'));var rimraf=require('rimraf');var config=require(_0x84f9('0x8'));var attributes=require(_0x84f9('0x9'));module[_0x84f9('0xa')]=function(_0x587d6e,_0xdefa57){return _0x587d6e[_0x84f9('0xb')](_0x84f9('0xc'),attributes,{'tableName':_0x84f9('0xd'),'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 dd1c391..2abf99e 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 _0x42b1=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x149083,_0x4047b6){var _0x4dc74e=function(_0x1211f9){while(--_0x1211f9){_0x149083['push'](_0x149083['shift']());}};_0x4dc74e(++_0x4047b6);}(_0x42b1,0x146));var _0x142b=function(_0x47c6b9,_0x210b3c){_0x47c6b9=_0x47c6b9-0x0;var _0x34f34d=_0x42b1[_0x47c6b9];return _0x34f34d;};'use strict';var _=require(_0x142b('0x0'));var util=require(_0x142b('0x1'));var moment=require(_0x142b('0x2'));var BPromise=require(_0x142b('0x3'));var rs=require(_0x142b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x142b('0x5'))['db'];var utils=require(_0x142b('0x6'));var logger=require(_0x142b('0x7'))(_0x142b('0x8'));var config=require(_0x142b('0x9'));var jayson=require(_0x142b('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x590a84,_0x341b7c,_0x1c23a2){return new BPromise(function(_0x250dbb,_0xf33e4f){return client[_0x142b('0xb')](_0x590a84,_0x1c23a2)[_0x142b('0xc')](function(_0x24ef0c){logger[_0x142b('0xd')](_0x142b('0xe'),_0x341b7c,_0x142b('0xf'));logger[_0x142b('0x10')]('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0x341b7c,_0x142b('0xf'),JSON['stringify'](_0x24ef0c));if(_0x24ef0c[_0x142b('0x11')]){if(_0x24ef0c['error'][_0x142b('0x12')]===0x1f4){logger[_0x142b('0x11')]('UserFaxQueue,\x20%s,\x20%s',_0x341b7c,_0x24ef0c[_0x142b('0x11')][_0x142b('0x13')]);return _0xf33e4f(_0x24ef0c[_0x142b('0x11')]['message']);}logger[_0x142b('0x11')](_0x142b('0xe'),_0x341b7c,_0x24ef0c['error']['message']);return _0x250dbb(_0x24ef0c['error'][_0x142b('0x13')]);}else{logger[_0x142b('0xd')](_0x142b('0xe'),_0x341b7c,_0x142b('0xf'));_0x250dbb(_0x24ef0c[_0x142b('0x14')][_0x142b('0x13')]);}})[_0x142b('0x15')](function(_0x3dad62){logger['error']('UserFaxQueue,\x20%s,\x20%s',_0x341b7c,_0x3dad62);_0xf33e4f(_0x3dad62);});});} \ No newline at end of file +var _0x7c50=['../../config/environment','jayson/promise','http','request','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7c50,0x142));var _0x07c5=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0x7c50[_0x1c546c];return _0x2cc384;};'use strict';var _=require(_0x07c5('0x0'));var util=require(_0x07c5('0x1'));var moment=require(_0x07c5('0x2'));var BPromise=require(_0x07c5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x07c5('0x4'))['db'];var utils=require(_0x07c5('0x5'));var logger=require(_0x07c5('0x6'))(_0x07c5('0x7'));var config=require(_0x07c5('0x8'));var jayson=require(_0x07c5('0x9'));var client=jayson['client'][_0x07c5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x365c19,_0x531e89,_0x156321){return new BPromise(function(_0x2f67d2,_0x28ff68){return client[_0x07c5('0xb')](_0x365c19,_0x156321)[_0x07c5('0xc')](function(_0x1d1ede){logger[_0x07c5('0xd')](_0x07c5('0xe'),_0x531e89,_0x07c5('0xf'));logger[_0x07c5('0x10')]('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0x531e89,_0x07c5('0xf'),JSON[_0x07c5('0x11')](_0x1d1ede));if(_0x1d1ede['error']){if(_0x1d1ede[_0x07c5('0x12')][_0x07c5('0x13')]===0x1f4){logger[_0x07c5('0x12')](_0x07c5('0xe'),_0x531e89,_0x1d1ede[_0x07c5('0x12')]['message']);return _0x28ff68(_0x1d1ede['error'][_0x07c5('0x14')]);}logger['error']('UserFaxQueue,\x20%s,\x20%s',_0x531e89,_0x1d1ede[_0x07c5('0x12')][_0x07c5('0x14')]);return _0x2f67d2(_0x1d1ede['error']['message']);}else{logger[_0x07c5('0xd')](_0x07c5('0xe'),_0x531e89,_0x07c5('0xf'));_0x2f67d2(_0x1d1ede['result'][_0x07c5('0x14')]);}})[_0x07c5('0x15')](function(_0x3896f4){logger[_0x07c5('0x12')](_0x07c5('0xe'),_0x531e89,_0x3896f4);_0x28ff68(_0x3896f4);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index f1d2ab6..b828b8f 100644 --- a/server/api/userMailQueue/index.js +++ b/server/api/userMailQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x1c7f87,_0x62999e){var _0x43f712=function(_0x2ceea0){while(--_0x2ceea0){_0x1c7f87['push'](_0x1c7f87['shift']());}};_0x43f712(++_0x62999e);}(_0x70e0,0x17b));var _0x070e=function(_0x273c52,_0x59207c){_0x273c52=_0x273c52-0x0;var _0x2bb160=_0x70e0[_0x273c52];return _0x2bb160;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x509f32,_0x1ddd4f){var _0x48be5c=function(_0x249e1c){while(--_0x249e1c){_0x509f32['push'](_0x509f32['shift']());}};_0x48be5c(++_0x1ddd4f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0xa9e0[_0x3635ce];return _0x97ecd0;};'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 545c67f..829a81a 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 _0x87ca=['exports','INTEGER'];(function(_0x26efac,_0x21ab8a){var _0x8482e4=function(_0x14db32){while(--_0x14db32){_0x26efac['push'](_0x26efac['shift']());}};_0x8482e4(++_0x21ab8a);}(_0x87ca,0x134));var _0xa87c=function(_0x1e7bf6,_0x1ea7da){_0x1e7bf6=_0x1e7bf6-0x0;var _0x1121f5=_0x87ca[_0x1e7bf6];return _0x1121f5;};'use strict';var Sequelize=require('sequelize');module[_0xa87c('0x0')]={'penalty':{'type':Sequelize[_0xa87c('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xff00=['exports','sequelize'];(function(_0x27433f,_0x77c15f){var _0xf0668f=function(_0x3001c8){while(--_0x3001c8){_0x27433f['push'](_0x27433f['shift']());}};_0xf0668f(++_0x77c15f);}(_0xff00,0x1e9));var _0x0ff0=function(_0x375be8,_0x4ab8a7){_0x375be8=_0x375be8-0x0;var _0x87cf61=_0xff00[_0x375be8];return _0x87cf61;};'use strict';var Sequelize=require(_0x0ff0('0x0'));module[_0x0ff0('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.model.js b/server/api/userMailQueue/userMailQueue.model.js index 86a4b1e..bbe390b 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 _0xf167=['lodash','util','../../config/logger','moment','request-promise','path','rimraf','exports','define','UserMailQueue','user_has_mail_queues'];(function(_0x58a3da,_0x4bb384){var _0x2612a2=function(_0x2178ab){while(--_0x2178ab){_0x58a3da['push'](_0x58a3da['shift']());}};_0x2612a2(++_0x4bb384);}(_0xf167,0x160));var _0x7f16=function(_0x581d17,_0x951b0a){_0x581d17=_0x581d17-0x0;var _0x2014bb=_0xf167[_0x581d17];return _0x2014bb;};'use strict';var _=require(_0x7f16('0x0'));var util=require(_0x7f16('0x1'));var logger=require(_0x7f16('0x2'))('api');var moment=require(_0x7f16('0x3'));var BPromise=require('bluebird');var rp=require(_0x7f16('0x4'));var fs=require('fs');var path=require(_0x7f16('0x5'));var rimraf=require(_0x7f16('0x6'));var config=require('../../config/environment');var attributes=require('./userMailQueue.attributes');module[_0x7f16('0x7')]=function(_0x4125cb,_0xc3e177){return _0x4125cb[_0x7f16('0x8')](_0x7f16('0x9'),attributes,{'tableName':_0x7f16('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb84c=['request-promise','path','../../config/environment','./userMailQueue.attributes','UserMailQueue','user_has_mail_queues','util','../../config/logger','api','moment','bluebird'];(function(_0x21ae3a,_0x330ac6){var _0x20af7a=function(_0x14480b){while(--_0x14480b){_0x21ae3a['push'](_0x21ae3a['shift']());}};_0x20af7a(++_0x330ac6);}(_0xb84c,0x1df));var _0xcb84=function(_0x3c76e9,_0x40e3e3){_0x3c76e9=_0x3c76e9-0x0;var _0x3cec83=_0xb84c[_0x3c76e9];return _0x3cec83;};'use strict';var _=require('lodash');var util=require(_0xcb84('0x0'));var logger=require(_0xcb84('0x1'))(_0xcb84('0x2'));var moment=require(_0xcb84('0x3'));var BPromise=require(_0xcb84('0x4'));var rp=require(_0xcb84('0x5'));var fs=require('fs');var path=require(_0xcb84('0x6'));var rimraf=require('rimraf');var config=require(_0xcb84('0x7'));var attributes=require(_0xcb84('0x8'));module['exports']=function(_0x30c052,_0x1d3248){return _0x30c052['define'](_0xcb84('0x9'),attributes,{'tableName':_0xcb84('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.rpc.js b/server/api/userMailQueue/userMailQueue.rpc.js index d07de8e..7c369c2 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 _0x55ca=['rpc','../../config/environment','jayson/promise','client','http','request','then','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','ioredis','../../mysqldb','../../config/logger'];(function(_0x1144c8,_0xc31d74){var _0x394b76=function(_0x347a76){while(--_0x347a76){_0x1144c8['push'](_0x1144c8['shift']());}};_0x394b76(++_0xc31d74);}(_0x55ca,0x126));var _0xa55c=function(_0xa08526,_0xd2a376){_0xa08526=_0xa08526-0x0;var _0x2684eb=_0x55ca[_0xa08526];return _0x2684eb;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa55c('0x2'));var db=require(_0xa55c('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xa55c('0x4'))(_0xa55c('0x5'));var config=require(_0xa55c('0x6'));var jayson=require(_0xa55c('0x7'));var client=jayson[_0xa55c('0x8')][_0xa55c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x36b623,_0x4d0624,_0x2121fd){return new BPromise(function(_0x2537f0,_0x57e069){return client[_0xa55c('0xa')](_0x36b623,_0x2121fd)[_0xa55c('0xb')](function(_0x52a3bc){logger['info'](_0xa55c('0xc'),_0x4d0624,_0xa55c('0xd'));logger[_0xa55c('0xe')](_0xa55c('0xf'),_0x4d0624,_0xa55c('0xd'),JSON[_0xa55c('0x10')](_0x52a3bc));if(_0x52a3bc[_0xa55c('0x11')]){if(_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x12')]===0x1f4){logger[_0xa55c('0x11')]('UserMailQueue,\x20%s,\x20%s',_0x4d0624,_0x52a3bc['error'][_0xa55c('0x13')]);return _0x57e069(_0x52a3bc['error']['message']);}logger['error'](_0xa55c('0xc'),_0x4d0624,_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x13')]);return _0x2537f0(_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x13')]);}else{logger[_0xa55c('0x14')]('UserMailQueue,\x20%s,\x20%s',_0x4d0624,_0xa55c('0xd'));_0x2537f0(_0x52a3bc[_0xa55c('0x15')][_0xa55c('0x13')]);}})[_0xa55c('0x16')](function(_0x1c4cfd){logger[_0xa55c('0x11')](_0xa55c('0xc'),_0x4d0624,_0x1c4cfd);_0x57e069(_0x1c4cfd);});});} \ No newline at end of file +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(_0x1e25e9,_0x4ac131){var _0x4d659f=function(_0x1fc3bd){while(--_0x1fc3bd){_0x1e25e9['push'](_0x1e25e9['shift']());}};_0x4d659f(++_0x4ac131);}(_0xa41a,0x6b));var _0xaa41=function(_0x5e4e6a,_0x5801cf){_0x5e4e6a=_0x5e4e6a-0x0;var _0x15850f=_0xa41a[_0x5e4e6a];return _0x15850f;};'use strict';var _=require(_0xaa41('0x0'));var util=require(_0xaa41('0x1'));var moment=require('moment');var BPromise=require(_0xaa41('0x2'));var rs=require(_0xaa41('0x3'));var fs=require('fs');var Redis=require(_0xaa41('0x4'));var db=require(_0xaa41('0x5'))['db'];var utils=require(_0xaa41('0x6'));var logger=require(_0xaa41('0x7'))(_0xaa41('0x8'));var config=require(_0xaa41('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xaa41('0xa')][_0xaa41('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x54bc5a,_0x5b1fff,_0x179545){return new BPromise(function(_0x202cce,_0x588ab4){return client[_0xaa41('0xc')](_0x54bc5a,_0x179545)[_0xaa41('0xd')](function(_0x409dab){logger[_0xaa41('0xe')](_0xaa41('0xf'),_0x5b1fff,_0xaa41('0x10'));logger[_0xaa41('0x11')](_0xaa41('0x12'),_0x5b1fff,_0xaa41('0x10'),JSON['stringify'](_0x409dab));if(_0x409dab[_0xaa41('0x13')]){if(_0x409dab[_0xaa41('0x13')]['code']===0x1f4){logger['error'](_0xaa41('0xf'),_0x5b1fff,_0x409dab['error'][_0xaa41('0x14')]);return _0x588ab4(_0x409dab[_0xaa41('0x13')][_0xaa41('0x14')]);}logger[_0xaa41('0x13')](_0xaa41('0xf'),_0x5b1fff,_0x409dab['error'][_0xaa41('0x14')]);return _0x202cce(_0x409dab[_0xaa41('0x13')][_0xaa41('0x14')]);}else{logger[_0xaa41('0xe')](_0xaa41('0xf'),_0x5b1fff,_0xaa41('0x10'));_0x202cce(_0x409dab[_0xaa41('0x15')]['message']);}})[_0xaa41('0x16')](function(_0x16b930){logger[_0xaa41('0x13')](_0xaa41('0xf'),_0x5b1fff,_0x16b930);_0x588ab4(_0x16b930);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index 10ce5b3..97468e2 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 _0xc48a=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./userNotification.controller','post','isAuthenticated','exports'];(function(_0x115488,_0x270be3){var _0xff2c73=function(_0x34f865){while(--_0x34f865){_0x115488['push'](_0x115488['shift']());}};_0xff2c73(++_0x270be3);}(_0xc48a,0x9c));var _0xac48=function(_0x36f528,_0x2144b3){_0x36f528=_0x36f528-0x0;var _0x2628d7=_0xc48a[_0x36f528];return _0x2628d7;};'use strict';var multer=require(_0xac48('0x0'));var util=require(_0xac48('0x1'));var path=require(_0xac48('0x2'));var timeout=require(_0xac48('0x3'));var express=require(_0xac48('0x4'));var router=express[_0xac48('0x5')]();var fs_extra=require(_0xac48('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xac48('0x7'));var config=require(_0xac48('0x8'));var controller=require(_0xac48('0x9'));router[_0xac48('0xa')]('/',auth[_0xac48('0xb')](),controller['sendUserNotification']);module[_0xac48('0xc')]=router; \ No newline at end of file +var _0x91fe=['../../components/auth/service','./userNotification.controller','post','sendUserNotification','multer','util','express','Router'];(function(_0x2aff6d,_0xde50ce){var _0x5b78f9=function(_0x105d55){while(--_0x105d55){_0x2aff6d['push'](_0x2aff6d['shift']());}};_0x5b78f9(++_0xde50ce);}(_0x91fe,0xa4));var _0xe91f=function(_0xe4cb09,_0x542e5a){_0xe4cb09=_0xe4cb09-0x0;var _0x17234a=_0x91fe[_0xe4cb09];return _0x17234a;};'use strict';var multer=require(_0xe91f('0x0'));var util=require(_0xe91f('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe91f('0x2'));var router=express[_0xe91f('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xe91f('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xe91f('0x5'));router[_0xe91f('0x6')]('/',auth['isAuthenticated'](),controller[_0xe91f('0x7')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index 83741b0..36eb110 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 _0x0848=['STRING','BOOLEAN','sequelize','exports','TEXT'];(function(_0x5bbfa6,_0x67b964){var _0x23f87b=function(_0x3d6126){while(--_0x3d6126){_0x5bbfa6['push'](_0x5bbfa6['shift']());}};_0x23f87b(++_0x67b964);}(_0x0848,0x1c4));var _0x8084=function(_0x125243,_0x119e35){_0x125243=_0x125243-0x0;var _0x1e1a69=_0x0848[_0x125243];return _0x1e1a69;};'use strict';var Sequelize=require(_0x8084('0x0'));module[_0x8084('0x1')]={'body':{'type':Sequelize[_0x8084('0x2')]},'senderName':{'type':Sequelize[_0x8084('0x3')]},'recipientsId':{'type':Sequelize['TEXT']},'recipientsDescription':{'type':Sequelize[_0x8084('0x3')]},'beep':{'type':Sequelize[_0x8084('0x4')]}}; \ No newline at end of file +var _0x6eab=['exports','TEXT','STRING','BOOLEAN'];(function(_0x1a7846,_0x59723e){var _0x48049=function(_0x203ff6){while(--_0x203ff6){_0x1a7846['push'](_0x1a7846['shift']());}};_0x48049(++_0x59723e);}(_0x6eab,0x164));var _0xb6ea=function(_0x1f7af5,_0x5902ba){_0x1f7af5=_0x1f7af5-0x0;var _0x576a87=_0x6eab[_0x1f7af5];return _0x576a87;};'use strict';var Sequelize=require('sequelize');module[_0xb6ea('0x0')]={'body':{'type':Sequelize[_0xb6ea('0x1')]},'senderName':{'type':Sequelize['STRING']},'recipientsId':{'type':Sequelize['TEXT']},'recipientsDescription':{'type':Sequelize[_0xb6ea('0x2')]},'beep':{'type':Sequelize[_0xb6ea('0x3')]}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index 2718f95..6252f6c 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 _0x30ed=['ValidationError','hasOwnProperty','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','mailqueue','openchannelqueue','voicequeue','whatsappqueue','user','some','includes','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','beep','SenderId','recipientsId','sortBy','join','sequelize','transaction','UserNotification','create','recipient','emit','userNotification:send','catch','findOne','html','render','view','forEach','startCase','model','User','union','ids','queue','replace','Queue','push','all','flatten','getAgents','map','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','register','status','json','offset','undefined','limit','count','set','apply','reject','update','destroy','then','end','error','stack','name','sendUserNotification','text','body','TemplateId','Sequelize'];(function(_0x57d963,_0x35edf0){var _0x4bac76=function(_0x525ef8){while(--_0x525ef8){_0x57d963['push'](_0x57d963['shift']());}};_0x4bac76(++_0x35edf0);}(_0x30ed,0x15d));var _0xd30e=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x30ed[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd30e('0x0'));var zipdir=require(_0xd30e('0x1'));var jsonpatch=require(_0xd30e('0x2'));var rp=require(_0xd30e('0x3'));var moment=require(_0xd30e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd30e('0x5'));var util=require('util');var path=require('path');var sox=require(_0xd30e('0x6'));var csv=require(_0xd30e('0x7'));var ejs=require(_0xd30e('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd30e('0x9'));var squel=require(_0xd30e('0xa'));var crypto=require(_0xd30e('0xb'));var jsforce=require(_0xd30e('0xc'));var deskjs=require(_0xd30e('0xd'));var toCsv=require(_0xd30e('0x7'));var querystring=require(_0xd30e('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xd30e('0xf'));var as=require(_0xd30e('0x10'));var hardwareService=require(_0xd30e('0x11'));var logger=require(_0xd30e('0x12'))('api');var utils=require(_0xd30e('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xd30e('0x14'));var db=require(_0xd30e('0x15'))['db'];config[_0xd30e('0x16')]=_[_0xd30e('0x17')](config[_0xd30e('0x16')],{'host':_0xd30e('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./userNotification.socket')[_0xd30e('0x19')](socket);function respondWithStatusCode(_0x4a256c,_0x16c517){_0x16c517=_0x16c517||0xcc;return function(_0x46b227){if(_0x46b227){return _0x4a256c['sendStatus'](_0x16c517);}return _0x4a256c[_0xd30e('0x1a')](_0x16c517)['end']();};}function respondWithResult(_0x26ab65,_0x4e6439){_0x4e6439=_0x4e6439||0xc8;return function(_0x25904f){if(_0x25904f){return _0x26ab65['status'](_0x4e6439)[_0xd30e('0x1b')](_0x25904f);}};}function respondWithFilteredResult(_0xbd36a6,_0x19cb21){return function(_0x408daa){if(_0x408daa){var _0x681abf=typeof _0x19cb21[_0xd30e('0x1c')]===_0xd30e('0x1d')&&typeof _0x19cb21[_0xd30e('0x1e')]===_0xd30e('0x1d');var _0x115d3c=_0x408daa['count'];var _0x29200b=_0x681abf?0x0:_0x19cb21[_0xd30e('0x1c')];var _0x2ffdd9=_0x681abf?_0x408daa[_0xd30e('0x1f')]:_0x19cb21[_0xd30e('0x1c')]+_0x19cb21[_0xd30e('0x1e')];var _0x295e3a;if(_0x2ffdd9>=_0x115d3c){_0x2ffdd9=_0x115d3c;_0x295e3a=0xc8;}else{_0x295e3a=0xce;}_0xbd36a6[_0xd30e('0x1a')](_0x295e3a);return _0xbd36a6[_0xd30e('0x20')]('Content-Range',_0x29200b+'-'+_0x2ffdd9+'/'+_0x115d3c)[_0xd30e('0x1b')](_0x408daa);}return null;};}function patchUpdates(_0x1c7537){return function(_0x43017b){try{jsonpatch[_0xd30e('0x21')](_0x43017b,_0x1c7537,!![]);}catch(_0x55559f){return BPromise[_0xd30e('0x22')](_0x55559f);}return _0x43017b['save']();};}function saveUpdates(_0x36cf98,_0x4eea19){return function(_0x2a28f2){if(_0x2a28f2){return _0x2a28f2[_0xd30e('0x23')](_0x36cf98)['then'](function(_0x4e5244){return _0x4e5244;});}return null;};}function removeEntity(_0x136e4a,_0x275929){return function(_0x4be7cf){if(_0x4be7cf){return _0x4be7cf[_0xd30e('0x24')]()[_0xd30e('0x25')](function(){_0x136e4a[_0xd30e('0x1a')](0xcc)[_0xd30e('0x26')]();});}};}function handleEntityNotFound(_0x18e196,_0x43be41){return function(_0x56ade3){if(!_0x56ade3){_0x18e196['sendStatus'](0x194);}return _0x56ade3;};}function handleError(_0x423b76,_0x48a224){_0x48a224=_0x48a224||0x1f4;return function(_0x305392){logger[_0xd30e('0x27')](_0x305392[_0xd30e('0x28')]);if(_0x305392[_0xd30e('0x29')]){delete _0x305392['name'];}_0x423b76[_0xd30e('0x1a')](_0x48a224)['send'](_0x305392);};}exports[_0xd30e('0x2a')]=function(_0x56dfe7,_0x5baf59,_0x3ee151){if(!_0x56dfe7['body']['hasOwnProperty'](_0xd30e('0x2b'))&&!_0x56dfe7[_0xd30e('0x2c')]['hasOwnProperty'](_0xd30e('0x2d'))){throw new db[(_0xd30e('0x2e'))][(_0xd30e('0x2f'))]('Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27');}else{if(_0x56dfe7[_0xd30e('0x2c')][_0xd30e('0x30')](_0xd30e('0x2d'))&&!_0x56dfe7['body'][_0xd30e('0x30')]('view')){throw new db['Sequelize'][(_0xd30e('0x2f'))](_0xd30e('0x31'));}if(!_0x56dfe7[_0xd30e('0x2c')][_0xd30e('0x30')](_0xd30e('0x32'))){throw new db[(_0xd30e('0x2e'))]['ValidationError'](_0xd30e('0x33'));}else{try{var _0x725f2a=JSON[_0xd30e('0x34')](_0x56dfe7[_0xd30e('0x2c')][_0xd30e('0x32')]);}catch(_0x2f985b){logger[_0xd30e('0x27')](_0x2f985b);throw new db[(_0xd30e('0x2e'))][(_0xd30e('0x2f'))](_0xd30e('0x35'));}var _0xc72334=[_0xd30e('0x36'),_0xd30e('0x37'),_0xd30e('0x38'),_0xd30e('0x39'),'smsqueue',_0xd30e('0x3a'),_0xd30e('0x3b'),'team',_0xd30e('0x3c')];if(_[_0xd30e('0x3d')](_0x725f2a,function(_0x3a869a){return!_[_0xd30e('0x3e')](_0xc72334,_0x3a869a['model'][_0xd30e('0x3f')]());})){throw new db[(_0xd30e('0x2e'))]['ValidationError'](_0xd30e('0x40'));}}}var _0xafd79f={};_0xafd79f['senderName']=_0x56dfe7['body'][_0xd30e('0x30')](_0xd30e('0x41'))?_0x56dfe7[_0xd30e('0x2c')][_0xd30e('0x41')]:_0x56dfe7[_0xd30e('0x3c')][_0xd30e('0x42')];_0xafd79f[_0xd30e('0x43')]=_['isEmpty'](_0x56dfe7['body']['recipientsDescription'])?null:_0x56dfe7[_0xd30e('0x2c')][_0xd30e('0x43')];_0xafd79f[_0xd30e('0x44')]=_0x56dfe7['body']['beep']||![];_0xafd79f[_0xd30e('0x45')]=_0x56dfe7[_0xd30e('0x3c')]['id'];return getContent(_0x56dfe7[_0xd30e('0x2c')])['then'](function(_0x4264ed){_0xafd79f[_0xd30e('0x2c')]=_0x4264ed;return getRecipients(_0x725f2a);})[_0xd30e('0x25')](function(_0x5e9a76){_0xafd79f[_0xd30e('0x46')]=_[_0xd30e('0x47')](_0x5e9a76)[_0xd30e('0x48')](',');return db[_0xd30e('0x49')][_0xd30e('0x4a')](function(_0x164e30){return db[_0xd30e('0x4b')][_0xd30e('0x4c')](_0xafd79f,{'raw':!![],'transaction':_0x164e30})[_0xd30e('0x25')](function(_0x44f448){var _0x48868b={'sender':_0xafd79f[_0xd30e('0x41')],'description':_0xafd79f[_0xd30e('0x43')],'content':_0xafd79f[_0xd30e('0x2c')],'beep':_0xafd79f[_0xd30e('0x44')]};_0x5e9a76['forEach'](function(_0x418fe9){_0x48868b[_0xd30e('0x4d')]=_0x418fe9;socket[_0xd30e('0x4e')](_0xd30e('0x4f'),_0x48868b);});return _0x44f448;});});})[_0xd30e('0x25')](respondWithResult(_0x5baf59,0xc9))[_0xd30e('0x50')](handleError(_0x5baf59,null));};function getContent(_0x344da9){return new BPromise(function(_0x4d34bb,_0x12e1a8){if(_0x344da9['text']){_0x4d34bb(_0x344da9[_0xd30e('0x2b')]);return;}return db['Template'][_0xd30e('0x51')]({'attributes':[_0xd30e('0x52')],'where':{'id':_0x344da9['TemplateId']},'raw':!![]})[_0xd30e('0x25')](function(_0x20ce1b){if(!_0x20ce1b)throw new db[(_0xd30e('0x2e'))]['ValidationError']('Invalid\x20\x27TemplateId\x27\x20parameter');var _0x2b15bd=Mustache[_0xd30e('0x53')](_0x20ce1b[_0xd30e('0x52')],_0x344da9[_0xd30e('0x54')]);_0x4d34bb(_0x2b15bd);})[_0xd30e('0x50')](function(_0x24c05d){_0x12e1a8(_0x24c05d);});});}function getRecipients(_0x795bf){return new BPromise(function(_0x11e4f6,_0x29ce33){var _0x150b84=[];var _0x5647c8=[];_0x795bf[_0xd30e('0x55')](function(_0x371910){var _0x31e246=_[_0xd30e('0x56')](_0x371910[_0xd30e('0x57')]['toLowerCase']());if(_0x31e246===_0xd30e('0x58')){_0x150b84=_[_0xd30e('0x59')](_0x150b84,_0x371910[_0xd30e('0x5a')]);}else{if(_['includes'](_0x31e246,_0xd30e('0x5b')))_0x31e246=_0x31e246[_0xd30e('0x5c')]('queue',_0xd30e('0x5d'));_0x371910[_0xd30e('0x5a')]['forEach'](function(_0x793156){_0x5647c8[_0xd30e('0x5e')](getAgents(_0x31e246,_0x793156));});}});return BPromise[_0xd30e('0x5f')](_0x5647c8)[_0xd30e('0x25')](function(_0x5da492){_0x150b84=_[_0xd30e('0x59')](_0x150b84,_[_0xd30e('0x60')](_0x5da492));_0x11e4f6(_0x150b84);})[_0xd30e('0x50')](function(_0x18d550){_0x29ce33(_0x18d550);});});}function getAgents(_0x3475aa,_0x1a6f5e){return new BPromise(function(_0x23797f,_0x2c54ac){return db[_0x3475aa][_0xd30e('0x51')]({'where':{'id':_0x1a6f5e}})[_0xd30e('0x25')](function(_0x49d83c){return _0x49d83c[_0xd30e('0x61')]({'attributes':['id'],'raw':!![]})[_0xd30e('0x25')](function(_0xc7c0b5){var _0x113f8f=_[_0xd30e('0x62')](_0xc7c0b5,'id');_0x23797f(_0x113f8f);});})[_0xd30e('0x50')](function(_0x6958ac){_0x2c54ac(_0x6958ac);});});} \ No newline at end of file +var _0x814a=['redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','update','then','destroy','stack','name','sendUserNotification','body','text','hasOwnProperty','Sequelize','ValidationError','view','Missing\x20\x27view\x27\x20parameter','Missing\x20\x27recipients\x27\x20parameter','recipients','error','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','openchannelqueue','smsqueue','voicequeue','team','user','includes','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','isEmpty','beep','SenderId','recipientsId','sortBy','join','transaction','UserNotification','create','recipient','userNotification:send','catch','Template','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','forEach','startCase','User','union','ids','queue','replace','push','flatten','getAgents','map','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','fs-extra','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x41c0a9,_0x341a87){var _0x4ae82c=function(_0xd9eccf){while(--_0xd9eccf){_0x41c0a9['push'](_0x41c0a9['shift']());}};_0x4ae82c(++_0x341a87);}(_0x814a,0xad));var _0xa814=function(_0x41a7c2,_0x555b5a){_0x41a7c2=_0x41a7c2-0x0;var _0x4b693f=_0x814a[_0x41a7c2];return _0x4b693f;};'use strict';var emlformat=require(_0xa814('0x0'));var rimraf=require(_0xa814('0x1'));var zipdir=require(_0xa814('0x2'));var jsonpatch=require(_0xa814('0x3'));var rp=require(_0xa814('0x4'));var moment=require('moment');var BPromise=require(_0xa814('0x5'));var Mustache=require(_0xa814('0x6'));var util=require(_0xa814('0x7'));var path=require(_0xa814('0x8'));var sox=require(_0xa814('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa814('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xa814('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xa814('0xc'));var toCsv=require('to-csv');var querystring=require(_0xa814('0xd'));var Papa=require(_0xa814('0xe'));var Redis=require(_0xa814('0xf'));var authService=require(_0xa814('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xa814('0x11'));var hardwareService=require(_0xa814('0x12'));var logger=require(_0xa814('0x13'))(_0xa814('0x14'));var utils=require(_0xa814('0x15'));var config=require(_0xa814('0x16'));var licenseUtil=require(_0xa814('0x17'));var db=require(_0xa814('0x18'))['db'];config[_0xa814('0x19')]=_[_0xa814('0x1a')](config[_0xa814('0x19')],{'host':_0xa814('0x1b'),'port':0x18eb});var socket=require(_0xa814('0x1c'))(new Redis(config[_0xa814('0x19')]));require('./userNotification.socket')['register'](socket);function respondWithStatusCode(_0x4d1f72,_0x3ddf2c){_0x3ddf2c=_0x3ddf2c||0xcc;return function(_0x49fbda){if(_0x49fbda){return _0x4d1f72[_0xa814('0x1d')](_0x3ddf2c);}return _0x4d1f72[_0xa814('0x1e')](_0x3ddf2c)[_0xa814('0x1f')]();};}function respondWithResult(_0xebcbe1,_0xb96fb6){_0xb96fb6=_0xb96fb6||0xc8;return function(_0x84a993){if(_0x84a993){return _0xebcbe1[_0xa814('0x1e')](_0xb96fb6)[_0xa814('0x20')](_0x84a993);}};}function respondWithFilteredResult(_0x49a5cc,_0x3dbc45){return function(_0x1989f2){if(_0x1989f2){var _0xb7e428=typeof _0x3dbc45[_0xa814('0x21')]==='undefined'&&typeof _0x3dbc45[_0xa814('0x22')]==='undefined';var _0x11ab9a=_0x1989f2[_0xa814('0x23')];var _0x25a2da=_0xb7e428?0x0:_0x3dbc45[_0xa814('0x21')];var _0x4137c8=_0xb7e428?_0x1989f2[_0xa814('0x23')]:_0x3dbc45['offset']+_0x3dbc45[_0xa814('0x22')];var _0xd3cec3;if(_0x4137c8>=_0x11ab9a){_0x4137c8=_0x11ab9a;_0xd3cec3=0xc8;}else{_0xd3cec3=0xce;}_0x49a5cc[_0xa814('0x1e')](_0xd3cec3);return _0x49a5cc[_0xa814('0x24')](_0xa814('0x25'),_0x25a2da+'-'+_0x4137c8+'/'+_0x11ab9a)['json'](_0x1989f2);}return null;};}function patchUpdates(_0x5f6db6){return function(_0x52e480){try{jsonpatch[_0xa814('0x26')](_0x52e480,_0x5f6db6,!![]);}catch(_0x343550){return BPromise[_0xa814('0x27')](_0x343550);}return _0x52e480['save']();};}function saveUpdates(_0x268050,_0x2d2bd5){return function(_0x29e8e6){if(_0x29e8e6){return _0x29e8e6[_0xa814('0x28')](_0x268050)[_0xa814('0x29')](function(_0x4eae3e){return _0x4eae3e;});}return null;};}function removeEntity(_0x40d795,_0x24e282){return function(_0x541dd3){if(_0x541dd3){return _0x541dd3[_0xa814('0x2a')]()[_0xa814('0x29')](function(){_0x40d795[_0xa814('0x1e')](0xcc)[_0xa814('0x1f')]();});}};}function handleEntityNotFound(_0x43698c,_0x5a36f8){return function(_0x358968){if(!_0x358968){_0x43698c['sendStatus'](0x194);}return _0x358968;};}function handleError(_0x20cec1,_0x3d724d){_0x3d724d=_0x3d724d||0x1f4;return function(_0x1251df){logger['error'](_0x1251df[_0xa814('0x2b')]);if(_0x1251df[_0xa814('0x2c')]){delete _0x1251df[_0xa814('0x2c')];}_0x20cec1[_0xa814('0x1e')](_0x3d724d)['send'](_0x1251df);};}exports[_0xa814('0x2d')]=function(_0x531caf,_0x5e63c3,_0x1c383c){if(!_0x531caf[_0xa814('0x2e')]['hasOwnProperty'](_0xa814('0x2f'))&&!_0x531caf[_0xa814('0x2e')][_0xa814('0x30')]('TemplateId')){throw new db[(_0xa814('0x31'))][(_0xa814('0x32'))]('Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27');}else{if(_0x531caf[_0xa814('0x2e')][_0xa814('0x30')]('TemplateId')&&!_0x531caf[_0xa814('0x2e')][_0xa814('0x30')](_0xa814('0x33'))){throw new db[(_0xa814('0x31'))][(_0xa814('0x32'))](_0xa814('0x34'));}if(!_0x531caf[_0xa814('0x2e')][_0xa814('0x30')]('recipients')){throw new db['Sequelize'][(_0xa814('0x32'))](_0xa814('0x35'));}else{try{var _0x239fc3=JSON['parse'](_0x531caf[_0xa814('0x2e')][_0xa814('0x36')]);}catch(_0x1a8e1c){logger[_0xa814('0x37')](_0x1a8e1c);throw new db['Sequelize']['ValidationError'](_0xa814('0x38'));}var _0x516f87=[_0xa814('0x39'),_0xa814('0x3a'),'mailqueue',_0xa814('0x3b'),_0xa814('0x3c'),_0xa814('0x3d'),'whatsappqueue',_0xa814('0x3e'),_0xa814('0x3f')];if(_['some'](_0x239fc3,function(_0x48bb8b){return!_[_0xa814('0x40')](_0x516f87,_0x48bb8b[_0xa814('0x41')][_0xa814('0x42')]());})){throw new db[(_0xa814('0x31'))][(_0xa814('0x32'))](_0xa814('0x43'));}}}var _0x14da0e={};_0x14da0e[_0xa814('0x44')]=_0x531caf[_0xa814('0x2e')][_0xa814('0x30')](_0xa814('0x44'))?_0x531caf[_0xa814('0x2e')][_0xa814('0x44')]:_0x531caf[_0xa814('0x3f')][_0xa814('0x45')];_0x14da0e[_0xa814('0x46')]=_[_0xa814('0x47')](_0x531caf[_0xa814('0x2e')][_0xa814('0x46')])?null:_0x531caf[_0xa814('0x2e')][_0xa814('0x46')];_0x14da0e[_0xa814('0x48')]=_0x531caf[_0xa814('0x2e')][_0xa814('0x48')]||![];_0x14da0e[_0xa814('0x49')]=_0x531caf[_0xa814('0x3f')]['id'];return getContent(_0x531caf['body'])[_0xa814('0x29')](function(_0x253af4){_0x14da0e[_0xa814('0x2e')]=_0x253af4;return getRecipients(_0x239fc3);})[_0xa814('0x29')](function(_0x169a3c){_0x14da0e[_0xa814('0x4a')]=_[_0xa814('0x4b')](_0x169a3c)[_0xa814('0x4c')](',');return db['sequelize'][_0xa814('0x4d')](function(_0x58f457){return db[_0xa814('0x4e')][_0xa814('0x4f')](_0x14da0e,{'raw':!![],'transaction':_0x58f457})[_0xa814('0x29')](function(_0x59fc0b){var _0x5b6f9a={'sender':_0x14da0e[_0xa814('0x44')],'description':_0x14da0e[_0xa814('0x46')],'content':_0x14da0e[_0xa814('0x2e')],'beep':_0x14da0e['beep']};_0x169a3c['forEach'](function(_0x1566a4){_0x5b6f9a[_0xa814('0x50')]=_0x1566a4;socket['emit'](_0xa814('0x51'),_0x5b6f9a);});return _0x59fc0b;});});})[_0xa814('0x29')](respondWithResult(_0x5e63c3,0xc9))[_0xa814('0x52')](handleError(_0x5e63c3,null));};function getContent(_0x125420){return new BPromise(function(_0x5ab583,_0x24761e){if(_0x125420[_0xa814('0x2f')]){_0x5ab583(_0x125420[_0xa814('0x2f')]);return;}return db[_0xa814('0x53')][_0xa814('0x54')]({'attributes':[_0xa814('0x55')],'where':{'id':_0x125420['TemplateId']},'raw':!![]})[_0xa814('0x29')](function(_0x52ba91){if(!_0x52ba91)throw new db['Sequelize']['ValidationError'](_0xa814('0x56'));var _0x35ee11=Mustache[_0xa814('0x57')](_0x52ba91['html'],_0x125420[_0xa814('0x33')]);_0x5ab583(_0x35ee11);})['catch'](function(_0x1e72f5){_0x24761e(_0x1e72f5);});});}function getRecipients(_0x12c020){return new BPromise(function(_0x16f80a,_0x1f215f){var _0x55c6bf=[];var _0x17faf8=[];_0x12c020[_0xa814('0x58')](function(_0x393434){var _0x39b4e0=_[_0xa814('0x59')](_0x393434['model'][_0xa814('0x42')]());if(_0x39b4e0===_0xa814('0x5a')){_0x55c6bf=_[_0xa814('0x5b')](_0x55c6bf,_0x393434[_0xa814('0x5c')]);}else{if(_['includes'](_0x39b4e0,_0xa814('0x5d')))_0x39b4e0=_0x39b4e0[_0xa814('0x5e')](_0xa814('0x5d'),'Queue');_0x393434[_0xa814('0x5c')][_0xa814('0x58')](function(_0x538e57){_0x17faf8[_0xa814('0x5f')](getAgents(_0x39b4e0,_0x538e57));});}});return BPromise['all'](_0x17faf8)[_0xa814('0x29')](function(_0xc2beaf){_0x55c6bf=_['union'](_0x55c6bf,_[_0xa814('0x60')](_0xc2beaf));_0x16f80a(_0x55c6bf);})[_0xa814('0x52')](function(_0x29212d){_0x1f215f(_0x29212d);});});}function getAgents(_0x328490,_0x58a17f){return new BPromise(function(_0x537e8d,_0x571699){return db[_0x328490][_0xa814('0x54')]({'where':{'id':_0x58a17f}})[_0xa814('0x29')](function(_0x22d9a3){return _0x22d9a3[_0xa814('0x61')]({'attributes':['id'],'raw':!![]})['then'](function(_0x28d103){var _0x208a78=_[_0xa814('0x62')](_0x28d103,'id');_0x537e8d(_0x208a78);});})[_0xa814('0x52')](function(_0x1d1591){_0x571699(_0x1d1591);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index fa83eb9..1af2396 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 _0xe855=['update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners','save'];(function(_0x108277,_0x5cb662){var _0xf71a38=function(_0x110b76){while(--_0x110b76){_0x108277['push'](_0x108277['shift']());}};_0xf71a38(++_0x5cb662);}(_0xe855,0x1d1));var _0x5e85=function(_0x4903c0,_0x799d24){_0x4903c0=_0x4903c0-0x0;var _0x33cbf2=_0xe855[_0x4903c0];return _0x33cbf2;};'use strict';var EventEmitter=require('events');var UserNotification=require(_0x5e85('0x0'))['db']['UserNotification'];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x5e85('0x1')](0x0);var events={'afterCreate':_0x5e85('0x2'),'afterUpdate':_0x5e85('0x3'),'afterDestroy':_0x5e85('0x4')};function emitEvent(_0x19335a){return function(_0x21ecad,_0x8be7e3,_0x4cb7ce){UserNotificationEvents[_0x5e85('0x5')](_0x19335a+':'+_0x21ecad['id'],_0x21ecad);UserNotificationEvents[_0x5e85('0x5')](_0x19335a,_0x21ecad);_0x4cb7ce(null);};}for(var e in events){if(events[_0x5e85('0x6')](e)){var event=events[e];UserNotification[_0x5e85('0x7')](e,emitEvent(event));}}module[_0x5e85('0x8')]=UserNotificationEvents; \ No newline at end of file +var _0x0c50=['UserNotification','setMaxListeners','save','update','emit','hook','events','../../mysqldb'];(function(_0x10803a,_0x37fe04){var _0xc616b1=function(_0x59b824){while(--_0x59b824){_0x10803a['push'](_0x10803a['shift']());}};_0xc616b1(++_0x37fe04);}(_0x0c50,0x116));var _0x00c5=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0x0c50[_0x376b45];return _0x2341b3;};'use strict';var EventEmitter=require(_0x00c5('0x0'));var UserNotification=require(_0x00c5('0x1'))['db'][_0x00c5('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x00c5('0x3')](0x0);var events={'afterCreate':_0x00c5('0x4'),'afterUpdate':_0x00c5('0x5'),'afterDestroy':'remove'};function emitEvent(_0x5cb8e0){return function(_0x1ad7c1,_0x3eb926,_0xc2c138){UserNotificationEvents[_0x00c5('0x6')](_0x5cb8e0+':'+_0x1ad7c1['id'],_0x1ad7c1);UserNotificationEvents[_0x00c5('0x6')](_0x5cb8e0,_0x1ad7c1);_0xc2c138(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserNotification[_0x00c5('0x7')](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 353c3b3..bb2732d 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 _0xc03e=['util','../../config/logger','api','bluebird','rimraf','../../config/environment','./userNotification.attributes','exports','UserNotification','userNotifications','utf8mb4_unicode_ci'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xc03e,0xdc));var _0xec03=function(_0x38b14f,_0xd08fa8){_0x38b14f=_0x38b14f-0x0;var _0x22a324=_0xc03e[_0x38b14f];return _0x22a324;};'use strict';var _=require('lodash');var util=require(_0xec03('0x0'));var logger=require(_0xec03('0x1'))(_0xec03('0x2'));var moment=require('moment');var BPromise=require(_0xec03('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xec03('0x4'));var config=require(_0xec03('0x5'));var attributes=require(_0xec03('0x6'));module[_0xec03('0x7')]=function(_0x1c2393,_0x1b91a8){return _0x1c2393['define'](_0xec03('0x8'),attributes,{'tableName':_0xec03('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xec03('0xa')});}; \ No newline at end of file +var _0x4818=['moment','bluebird','request-promise','path','rimraf','./userNotification.attributes','exports','define','UserNotification','userNotifications','utf8mb4','../../config/logger','api'];(function(_0x389447,_0x51dfd1){var _0x278be8=function(_0x4942a7){while(--_0x4942a7){_0x389447['push'](_0x389447['shift']());}};_0x278be8(++_0x51dfd1);}(_0x4818,0x1b8));var _0x8481=function(_0x4efce3,_0x3d3e3a){_0x4efce3=_0x4efce3-0x0;var _0x11254b=_0x4818[_0x4efce3];return _0x11254b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8481('0x0'))(_0x8481('0x1'));var moment=require(_0x8481('0x2'));var BPromise=require(_0x8481('0x3'));var rp=require(_0x8481('0x4'));var fs=require('fs');var path=require(_0x8481('0x5'));var rimraf=require(_0x8481('0x6'));var config=require('../../config/environment');var attributes=require(_0x8481('0x7'));module[_0x8481('0x8')]=function(_0x51cf6c,_0x11d910){return _0x51cf6c[_0x8481('0x9')](_0x8481('0xa'),attributes,{'tableName':_0x8481('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8481('0xc'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index b60e384..d45a28b 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 _0x6901=['client','http','redis','request','info','UserNotification,\x20%s,\x20%s','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x92713a,_0x68f8b0){var _0x1893e1=function(_0xe49768){while(--_0xe49768){_0x92713a['push'](_0x92713a['shift']());}};_0x1893e1(++_0x68f8b0);}(_0x6901,0x9e));var _0x1690=function(_0x2a1c35,_0x252c87){_0x2a1c35=_0x2a1c35-0x0;var _0x496fa3=_0x6901[_0x2a1c35];return _0x496fa3;};'use strict';var _=require(_0x1690('0x0'));var util=require(_0x1690('0x1'));var moment=require(_0x1690('0x2'));var BPromise=require(_0x1690('0x3'));var rs=require(_0x1690('0x4'));var fs=require('fs');var Redis=require(_0x1690('0x5'));var db=require(_0x1690('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x1690('0x7'))(_0x1690('0x8'));var config=require(_0x1690('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x1690('0xa')][_0x1690('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0x1690('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./userNotification.socket')['register'](socket);function respondWithRpcPromise(_0x7e2f03,_0x740aa4,_0x25f4eb){return new BPromise(function(_0x490e39,_0x463e24){return client[_0x1690('0xd')](_0x7e2f03,_0x25f4eb)['then'](function(_0x26ee12){logger[_0x1690('0xe')](_0x1690('0xf'),_0x740aa4,_0x1690('0x10'));logger[_0x1690('0x11')](_0x1690('0x12'),_0x740aa4,_0x1690('0x10'),JSON[_0x1690('0x13')](_0x26ee12));if(_0x26ee12[_0x1690('0x14')]){if(_0x26ee12[_0x1690('0x14')][_0x1690('0x15')]===0x1f4){logger[_0x1690('0x14')](_0x1690('0xf'),_0x740aa4,_0x26ee12[_0x1690('0x14')]['message']);return _0x463e24(_0x26ee12[_0x1690('0x14')][_0x1690('0x16')]);}logger[_0x1690('0x14')]('UserNotification,\x20%s,\x20%s',_0x740aa4,_0x26ee12[_0x1690('0x14')][_0x1690('0x16')]);return _0x490e39(_0x26ee12[_0x1690('0x14')][_0x1690('0x16')]);}else{logger[_0x1690('0xe')](_0x1690('0xf'),_0x740aa4,_0x1690('0x10'));_0x490e39(_0x26ee12[_0x1690('0x17')][_0x1690('0x16')]);}})['catch'](function(_0x2b0e57){logger[_0x1690('0x14')]('UserNotification,\x20%s,\x20%s',_0x740aa4,_0x2b0e57);_0x463e24(_0x2b0e57);});});} \ No newline at end of file +var _0x370f=['util','moment','bluebird','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','request','info','UserNotification,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','UserNotification,\x20%s,\x20%s','message','catch','lodash'];(function(_0x5c9307,_0x5b97e4){var _0x373e29=function(_0xefebbd){while(--_0xefebbd){_0x5c9307['push'](_0x5c9307['shift']());}};_0x373e29(++_0x5b97e4);}(_0x370f,0x1cd));var _0xf370=function(_0x4f096e,_0x30d3c3){_0x4f096e=_0x4f096e-0x0;var _0x4a33ce=_0x370f[_0x4f096e];return _0x4a33ce;};'use strict';var _=require(_0xf370('0x0'));var util=require(_0xf370('0x1'));var moment=require(_0xf370('0x2'));var BPromise=require(_0xf370('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf370('0x4'))(_0xf370('0x5'));var config=require(_0xf370('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xf370('0x7')][_0xf370('0x8')]({'port':0x232a});config[_0xf370('0x9')]=_[_0xf370('0xa')](config[_0xf370('0x9')],{'host':_0xf370('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf370('0x9')]));require('./userNotification.socket')['register'](socket);function respondWithRpcPromise(_0x32dde8,_0x679e34,_0x49b7ee){return new BPromise(function(_0x10fd1b,_0x13d390){return client[_0xf370('0xc')](_0x32dde8,_0x49b7ee)['then'](function(_0x1f4365){logger[_0xf370('0xd')]('UserNotification,\x20%s,\x20%s',_0x679e34,'request\x20sent');logger['debug'](_0xf370('0xe'),_0x679e34,_0xf370('0xf'),JSON['stringify'](_0x1f4365));if(_0x1f4365[_0xf370('0x10')]){if(_0x1f4365['error'][_0xf370('0x11')]===0x1f4){logger[_0xf370('0x10')](_0xf370('0x12'),_0x679e34,_0x1f4365['error'][_0xf370('0x13')]);return _0x13d390(_0x1f4365['error']['message']);}logger[_0xf370('0x10')](_0xf370('0x12'),_0x679e34,_0x1f4365[_0xf370('0x10')][_0xf370('0x13')]);return _0x10fd1b(_0x1f4365[_0xf370('0x10')]['message']);}else{logger[_0xf370('0xd')]('UserNotification,\x20%s,\x20%s',_0x679e34,_0xf370('0xf'));_0x10fd1b(_0x1f4365['result'][_0xf370('0x13')]);}})[_0xf370('0x14')](function(_0x3f3a6f){logger['error'](_0xf370('0x12'),_0x679e34,_0x3f3a6f);_0x13d390(_0x3f3a6f);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index 131fc7f..c8ee6eb 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 _0x48f9=['userNotification:','./userNotification.events','save','emit','removeListener','register'];(function(_0x97c6ea,_0x4cffce){var _0x2d7f50=function(_0x54010e){while(--_0x54010e){_0x97c6ea['push'](_0x97c6ea['shift']());}};_0x2d7f50(++_0x4cffce);}(_0x48f9,0x157));var _0x948f=function(_0x3d7731,_0x53637f){_0x3d7731=_0x3d7731-0x0;var _0x5da7aa=_0x48f9[_0x3d7731];return _0x5da7aa;};'use strict';var UserNotificationEvents=require(_0x948f('0x0'));var events=[_0x948f('0x1'),'remove','update'];function createListener(_0x5a2287,_0x1aff70){return function(_0x3cb842){_0x1aff70[_0x948f('0x2')](_0x5a2287,_0x3cb842);};}function removeListener(_0x13a850,_0x1c7a0d){return function(){UserNotificationEvents[_0x948f('0x3')](_0x13a850,_0x1c7a0d);};}exports[_0x948f('0x4')]=function(_0x317eba){for(var _0x32ccd4=0x0,_0x269495=events['length'];_0x32ccd4<_0x269495;_0x32ccd4++){var _0x43e407=events[_0x32ccd4];var _0x1c7377=createListener(_0x948f('0x5')+_0x43e407,_0x317eba);UserNotificationEvents['on'](_0x43e407,_0x1c7377);}}; \ No newline at end of file +var _0xfbf3=['update','removeListener','register','userNotification:','remove'];(function(_0x4aebd2,_0x56146a){var _0xfb742=function(_0x3762e6){while(--_0x3762e6){_0x4aebd2['push'](_0x4aebd2['shift']());}};_0xfb742(++_0x56146a);}(_0xfbf3,0x199));var _0x3fbf=function(_0x41a175,_0x4a0b8c){_0x41a175=_0x41a175-0x0;var _0x376694=_0xfbf3[_0x41a175];return _0x376694;};'use strict';var UserNotificationEvents=require('./userNotification.events');var events=['save',_0x3fbf('0x0'),_0x3fbf('0x1')];function createListener(_0x350beb,_0x590fef){return function(_0x45e2cb){_0x590fef['emit'](_0x350beb,_0x45e2cb);};}function removeListener(_0x28ae59,_0x5e0661){return function(){UserNotificationEvents[_0x3fbf('0x2')](_0x28ae59,_0x5e0661);};}exports[_0x3fbf('0x3')]=function(_0x4658e3){for(var _0x2cbaf3=0x0,_0x38e2fd=events['length'];_0x2cbaf3<_0x38e2fd;_0x2cbaf3++){var _0x1e79d7=events[_0x2cbaf3];var _0x24f53b=createListener(_0x3fbf('0x4')+_0x1e79d7,_0x4658e3);UserNotificationEvents['on'](_0x1e79d7,_0x24f53b);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index bdbc78b..46c32be 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x534dd3,_0x1e2ade){var _0x48d5b2=function(_0x2f834e){while(--_0x2f834e){_0x534dd3['push'](_0x534dd3['shift']());}};_0x48d5b2(++_0x1e2ade);}(_0x70e0,0x17b));var _0x070e=function(_0x36f34b,_0x472ab5){_0x36f34b=_0x36f34b-0x0;var _0x4c7ba3=_0x70e0[_0x36f34b];return _0x4c7ba3;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x22dd85,_0x460250){var _0xb510b4=function(_0x414d8a){while(--_0x414d8a){_0x22dd85['push'](_0x22dd85['shift']());}};_0xb510b4(++_0x460250);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x5678b5,_0x1c4aa8){_0x5678b5=_0x5678b5-0x0;var _0x4c09a5=_0xcb91[_0x5678b5];return _0x4c09a5;};'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/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index cae1568..28ece92 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 _0x032b=['exports'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0x032b,0x183));var _0xb032=function(_0xeb67cb,_0x3facda){_0xeb67cb=_0xeb67cb-0x0;var _0xc8fe96=_0x032b[_0xeb67cb];return _0xc8fe96;};'use strict';var Sequelize=require('sequelize');module[_0xb032('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xeef0=['exports','INTEGER','sequelize'];(function(_0x32bb06,_0x46b9c3){var _0x38fc21=function(_0x195f0d){while(--_0x195f0d){_0x32bb06['push'](_0x32bb06['shift']());}};_0x38fc21(++_0x46b9c3);}(_0xeef0,0x1c4));var _0x0eef=function(_0x22b68a,_0x2bffc3){_0x22b68a=_0x22b68a-0x0;var _0x1ac67a=_0xeef0[_0x22b68a];return _0x1ac67a;};'use strict';var Sequelize=require(_0x0eef('0x0'));module[_0x0eef('0x1')]={'penalty':{'type':Sequelize[_0x0eef('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js index 39a6608..eb56b5e 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 _0xebe1=['define','UserOpenchannelQueue','lodash','../../config/logger','api','bluebird','request-promise','./userOpenchannelQueue.attributes','exports'];(function(_0x541a67,_0x50728d){var _0x45da2a=function(_0x158929){while(--_0x158929){_0x541a67['push'](_0x541a67['shift']());}};_0x45da2a(++_0x50728d);}(_0xebe1,0xfe));var _0x1ebe=function(_0x5d2d9c,_0x56b942){_0x5d2d9c=_0x5d2d9c-0x0;var _0x25b6b8=_0xebe1[_0x5d2d9c];return _0x25b6b8;};'use strict';var _=require(_0x1ebe('0x0'));var util=require('util');var logger=require(_0x1ebe('0x1'))(_0x1ebe('0x2'));var moment=require('moment');var BPromise=require(_0x1ebe('0x3'));var rp=require(_0x1ebe('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1ebe('0x5'));module[_0x1ebe('0x6')]=function(_0x52360e,_0x32e830){return _0x52360e[_0x1ebe('0x7')](_0x1ebe('0x8'),attributes,{'tableName':'user_has_openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf7f2=['user_has_openchannel_queues','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','UserOpenchannelQueue'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xf7f2,0xfd));var _0x2f7f=function(_0x331e28,_0x163e3c){_0x331e28=_0x331e28-0x0;var _0x42abb8=_0xf7f2[_0x331e28];return _0x42abb8;};'use strict';var _=require(_0x2f7f('0x0'));var util=require('util');var logger=require(_0x2f7f('0x1'))('api');var moment=require(_0x2f7f('0x2'));var BPromise=require(_0x2f7f('0x3'));var rp=require(_0x2f7f('0x4'));var fs=require('fs');var path=require(_0x2f7f('0x5'));var rimraf=require(_0x2f7f('0x6'));var config=require(_0x2f7f('0x7'));var attributes=require('./userOpenchannelQueue.attributes');module[_0x2f7f('0x8')]=function(_0x2ff098,_0x1e1bb8){return _0x2ff098[_0x2f7f('0x9')](_0x2f7f('0xa'),attributes,{'tableName':_0x2f7f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js index 4ccfeac..5e8c148 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 _0xd35c=['request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x5ef9a6,_0x3f0c41){var _0x52161d=function(_0x18504f){while(--_0x18504f){_0x5ef9a6['push'](_0x5ef9a6['shift']());}};_0x52161d(++_0x3f0c41);}(_0xd35c,0x1c4));var _0xcd35=function(_0x3f0ead,_0x449285){_0x3f0ead=_0x3f0ead-0x0;var _0x598263=_0xd35c[_0x3f0ead];return _0x598263;};'use strict';var _=require(_0xcd35('0x0'));var util=require('util');var moment=require(_0xcd35('0x1'));var BPromise=require(_0xcd35('0x2'));var rs=require(_0xcd35('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcd35('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xcd35('0x5'))(_0xcd35('0x6'));var config=require(_0xcd35('0x7'));var jayson=require(_0xcd35('0x8'));var client=jayson['client'][_0xcd35('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5bd9f1,_0xd3769e,_0x4ef307){return new BPromise(function(_0x1f9180,_0xe37147){return client[_0xcd35('0xa')](_0x5bd9f1,_0x4ef307)[_0xcd35('0xb')](function(_0x316a30){logger[_0xcd35('0xc')](_0xcd35('0xd'),_0xd3769e,_0xcd35('0xe'));logger[_0xcd35('0xf')](_0xcd35('0x10'),_0xd3769e,_0xcd35('0xe'),JSON['stringify'](_0x316a30));if(_0x316a30[_0xcd35('0x11')]){if(_0x316a30[_0xcd35('0x11')][_0xcd35('0x12')]===0x1f4){logger[_0xcd35('0x11')](_0xcd35('0xd'),_0xd3769e,_0x316a30[_0xcd35('0x11')][_0xcd35('0x13')]);return _0xe37147(_0x316a30[_0xcd35('0x11')][_0xcd35('0x13')]);}logger[_0xcd35('0x11')](_0xcd35('0xd'),_0xd3769e,_0x316a30[_0xcd35('0x11')][_0xcd35('0x13')]);return _0x1f9180(_0x316a30[_0xcd35('0x11')][_0xcd35('0x13')]);}else{logger[_0xcd35('0xc')](_0xcd35('0xd'),_0xd3769e,_0xcd35('0xe'));_0x1f9180(_0x316a30['result'][_0xcd35('0x13')]);}})[_0xcd35('0x14')](function(_0x291073){logger[_0xcd35('0x11')](_0xcd35('0xd'),_0xd3769e,_0x291073);_0xe37147(_0x291073);});});} \ No newline at end of file +var _0x8160=['../../config/utils','rpc','../../config/environment','jayson/promise','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','util','moment','bluebird','ioredis'];(function(_0x342387,_0x2dee91){var _0x108f72=function(_0xe31d57){while(--_0xe31d57){_0x342387['push'](_0x342387['shift']());}};_0x108f72(++_0x2dee91);}(_0x8160,0x106));var _0x0816=function(_0x5d86bb,_0x1cc911){_0x5d86bb=_0x5d86bb-0x0;var _0x87abc6=_0x8160[_0x5d86bb];return _0x87abc6;};'use strict';var _=require('lodash');var util=require(_0x0816('0x0'));var moment=require(_0x0816('0x1'));var BPromise=require(_0x0816('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0816('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0816('0x4'));var logger=require('../../config/logger')(_0x0816('0x5'));var config=require(_0x0816('0x6'));var jayson=require(_0x0816('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x57ba13,_0x1c2291,_0x1cda84){return new BPromise(function(_0x25c4dc,_0x1cdd66){return client[_0x0816('0x8')](_0x57ba13,_0x1cda84)[_0x0816('0x9')](function(_0x34e815){logger[_0x0816('0xa')](_0x0816('0xb'),_0x1c2291,'request\x20sent');logger[_0x0816('0xc')]('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x1c2291,_0x0816('0xd'),JSON[_0x0816('0xe')](_0x34e815));if(_0x34e815[_0x0816('0xf')]){if(_0x34e815['error'][_0x0816('0x10')]===0x1f4){logger[_0x0816('0xf')](_0x0816('0xb'),_0x1c2291,_0x34e815['error'][_0x0816('0x11')]);return _0x1cdd66(_0x34e815[_0x0816('0xf')][_0x0816('0x11')]);}logger['error']('UserOpenchannelQueue,\x20%s,\x20%s',_0x1c2291,_0x34e815[_0x0816('0xf')][_0x0816('0x11')]);return _0x25c4dc(_0x34e815[_0x0816('0xf')][_0x0816('0x11')]);}else{logger['info'](_0x0816('0xb'),_0x1c2291,_0x0816('0xd'));_0x25c4dc(_0x34e815['result'][_0x0816('0x11')]);}})[_0x0816('0x12')](function(_0x3e9047){logger[_0x0816('0xf')](_0x0816('0xb'),_0x1c2291,_0x3e9047);_0x1cdd66(_0x3e9047);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index ed4a5b5..3fca601 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 _0xc125=['get','/:id/sections','post','create','/:id/clone','clone','addSections','put','update','delete','/:id/resources','exports','path','Router','fs-extra','../../components/auth/service','../../config/environment','./userProfile.controller','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x5b0f29,_0x3d6f36){var _0x27a26a=function(_0x4d44b3){while(--_0x4d44b3){_0x5b0f29['push'](_0x5b0f29['shift']());}};_0x27a26a(++_0x3d6f36);}(_0xc125,0x6c));var _0x5c12=function(_0x3bc57a,_0x1eabdd){_0x3bc57a=_0x3bc57a-0x0;var _0x3d915c=_0xc125[_0x3bc57a];return _0x3d915c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5c12('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5c12('0x1')]();var fs_extra=require(_0x5c12('0x2'));var auth=require(_0x5c12('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x5c12('0x4'));var controller=require(_0x5c12('0x5'));router['get']('/',auth[_0x5c12('0x6')](),controller[_0x5c12('0x7')]);router['get'](_0x5c12('0x8'),auth[_0x5c12('0x6')](),controller[_0x5c12('0x9')]);router['get'](_0x5c12('0xa'),auth['isAuthenticated'](),controller[_0x5c12('0xb')]);router[_0x5c12('0xc')](_0x5c12('0xd'),auth[_0x5c12('0x6')](),controller['getSections']);router[_0x5c12('0xc')]('/:id/resources',auth[_0x5c12('0x6')](),controller['getResources']);router[_0x5c12('0xe')]('/',auth[_0x5c12('0x6')](),controller[_0x5c12('0xf')]);router[_0x5c12('0xe')](_0x5c12('0x10'),auth[_0x5c12('0x6')](),controller[_0x5c12('0x11')]);router[_0x5c12('0xe')]('/:id/sections',auth[_0x5c12('0x6')](),controller[_0x5c12('0x12')]);router[_0x5c12('0xe')]('/:id/resources',auth[_0x5c12('0x6')](),controller['addResources']);router[_0x5c12('0x13')]('/:id',auth[_0x5c12('0x6')](),controller[_0x5c12('0x14')]);router[_0x5c12('0x15')](_0x5c12('0xa'),auth[_0x5c12('0x6')](),controller['destroy']);router[_0x5c12('0x15')](_0x5c12('0xd'),auth[_0x5c12('0x6')](),controller['removeSections']);router[_0x5c12('0x15')](_0x5c12('0x16'),auth[_0x5c12('0x6')](),controller['removeResources']);module[_0x5c12('0x17')]=router; \ No newline at end of file +var _0x9b1c=['/:id/resources','getResources','post','clone','addSections','addResources','put','update','delete','removeSections','removeResources','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./userProfile.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/sections'];(function(_0xf4499c,_0x5f0b98){var _0x50eb5e=function(_0x122dd7){while(--_0x122dd7){_0xf4499c['push'](_0xf4499c['shift']());}};_0x50eb5e(++_0x5f0b98);}(_0x9b1c,0x1dc));var _0xc9b1=function(_0x4eb77c,_0x256d5a){_0x4eb77c=_0x4eb77c-0x0;var _0x73bc32=_0x9b1c[_0x4eb77c];return _0x73bc32;};'use strict';var multer=require(_0xc9b1('0x0'));var util=require(_0xc9b1('0x1'));var path=require(_0xc9b1('0x2'));var timeout=require(_0xc9b1('0x3'));var express=require(_0xc9b1('0x4'));var router=express[_0xc9b1('0x5')]();var fs_extra=require(_0xc9b1('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xc9b1('0x7'));var config=require(_0xc9b1('0x8'));var controller=require(_0xc9b1('0x9'));router[_0xc9b1('0xa')]('/',auth[_0xc9b1('0xb')](),controller['index']);router[_0xc9b1('0xa')](_0xc9b1('0xc'),auth[_0xc9b1('0xb')](),controller[_0xc9b1('0xd')]);router[_0xc9b1('0xa')](_0xc9b1('0xe'),auth['isAuthenticated'](),controller[_0xc9b1('0xf')]);router['get'](_0xc9b1('0x10'),auth[_0xc9b1('0xb')](),controller['getSections']);router[_0xc9b1('0xa')](_0xc9b1('0x11'),auth[_0xc9b1('0xb')](),controller[_0xc9b1('0x12')]);router[_0xc9b1('0x13')]('/',auth[_0xc9b1('0xb')](),controller['create']);router[_0xc9b1('0x13')]('/:id/clone',auth['isAuthenticated'](),controller[_0xc9b1('0x14')]);router['post']('/:id/sections',auth['isAuthenticated'](),controller[_0xc9b1('0x15')]);router[_0xc9b1('0x13')](_0xc9b1('0x11'),auth['isAuthenticated'](),controller[_0xc9b1('0x16')]);router[_0xc9b1('0x17')](_0xc9b1('0xe'),auth[_0xc9b1('0xb')](),controller[_0xc9b1('0x18')]);router[_0xc9b1('0x19')](_0xc9b1('0xe'),auth[_0xc9b1('0xb')](),controller['destroy']);router['delete']('/:id/sections',auth[_0xc9b1('0xb')](),controller[_0xc9b1('0x1a')]);router['delete'](_0xc9b1('0x11'),auth['isAuthenticated'](),controller[_0xc9b1('0x1b')]);module[_0xc9b1('0x1c')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index 9097349..fdff199 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 _0x1ddd=['name','setDataValue','crudPermissions','join','getDataValue','split','BOOLEAN','sequelize','STRING'];(function(_0x3c7f95,_0x15e573){var _0x5184b5=function(_0x33627f){while(--_0x33627f){_0x3c7f95['push'](_0x3c7f95['shift']());}};_0x5184b5(++_0x15e573);}(_0x1ddd,0x19c));var _0xd1dd=function(_0x101500,_0x5a1040){_0x101500=_0x101500-0x0;var _0x26311f=_0x1ddd[_0x101500];return _0x26311f;};'use strict';var Sequelize=require(_0xd1dd('0x0'));module['exports']={'name':{'type':Sequelize[_0xd1dd('0x1')],'allowNull':![],'unique':_0xd1dd('0x2')},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x467fe3){this[_0xd1dd('0x3')](_0xd1dd('0x4'),_0x467fe3?_0x467fe3[_0xd1dd('0x5')](''):[]);},'get':function(){return this[_0xd1dd('0x6')](_0xd1dd('0x4'))?this[_0xd1dd('0x6')](_0xd1dd('0x4'))[_0xd1dd('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0xd1dd('0x8')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0xd1dd('0x8')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0xd1dd('0x8')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xd1dd('0x8')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0xd1dd('0x8')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xd1dd('0x8')],'defaultValue':!![]}}; \ No newline at end of file +var _0x1c18=['join','getDataValue','crudPermissions','STRING','BOOLEAN','sequelize','exports'];(function(_0x2d460c,_0x4f08c0){var _0xf6fc4c=function(_0x4fb81c){while(--_0x4fb81c){_0x2d460c['push'](_0x2d460c['shift']());}};_0xf6fc4c(++_0x4f08c0);}(_0x1c18,0x7c));var _0x81c1=function(_0x5375fd,_0x50887f){_0x5375fd=_0x5375fd-0x0;var _0x142671=_0x1c18[_0x5375fd];return _0x142671;};'use strict';var Sequelize=require(_0x81c1('0x0'));module[_0x81c1('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x114068){this['setDataValue']('crudPermissions',_0x114068?_0x114068[_0x81c1('0x2')](''):[]);},'get':function(){return this[_0x81c1('0x3')]('crudPermissions')?this[_0x81c1('0x3')](_0x81c1('0x4'))['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x81c1('0x5')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x81c1('0x6')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x81c1('0x6')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x81c1('0x6')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x81c1('0x6')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x81c1('0x6')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x81c1('0x6')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index 33679a9..77686ed 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 _0xfb0b=['options','find','create','body','clone','get','createdAt','updatedAt','crudPermissions','UserProfileSection','autoAssociation','UserProfileResource','omit','sectionId','Resources','destroy','describe','transaction','userProfileId','each','removeSections','ids','getSections','enabled','includes','isEmpty','subsections','findOne','Dashboard','forEach','push','resourceId','Plugin','addResources','sequelize','removeResources','getResources','Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','rimraf','zip-dir','request-promise','moment','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','sendStatus','status','end','json','offset','limit','undefined','count','set','reject','save','update','then','error','stack','name','send','index','map','UserProfile','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','includeAll','include','findAll','rows','catch','show','params'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0xfb0b,0x94));var _0xbfb0=function(_0x3446e8,_0x59d7d3){_0x3446e8=_0x3446e8-0x0;var _0x5751a4=_0xfb0b[_0x3446e8];return _0x5751a4;};'use strict';var emlformat=require(_0xbfb0('0x0'));var rimraf=require(_0xbfb0('0x1'));var zipdir=require(_0xbfb0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbfb0('0x3'));var moment=require(_0xbfb0('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xbfb0('0x5'));var path=require('path');var sox=require(_0xbfb0('0x6'));var csv=require(_0xbfb0('0x7'));var ejs=require(_0xbfb0('0x8'));var fs=require('fs');var fs_extra=require(_0xbfb0('0x9'));var _=require(_0xbfb0('0xa'));var squel=require(_0xbfb0('0xb'));var crypto=require('crypto');var jsforce=require(_0xbfb0('0xc'));var deskjs=require(_0xbfb0('0xd'));var toCsv=require(_0xbfb0('0x7'));var querystring=require(_0xbfb0('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xbfb0('0xf'));var hardwareService=require(_0xbfb0('0x10'));var logger=require(_0xbfb0('0x11'))('api');var utils=require(_0xbfb0('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xbfb0('0x13'));var db=require(_0xbfb0('0x14'))['db'];config[_0xbfb0('0x15')]=_[_0xbfb0('0x16')](config[_0xbfb0('0x15')],{'host':_0xbfb0('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbfb0('0x15')]));require('./userProfile.socket')['register'](socket);function respondWithStatusCode(_0x47e716,_0x141e62){_0x141e62=_0x141e62||0xcc;return function(_0x2c9768){if(_0x2c9768){return _0x47e716[_0xbfb0('0x18')](_0x141e62);}return _0x47e716[_0xbfb0('0x19')](_0x141e62)[_0xbfb0('0x1a')]();};}function respondWithResult(_0x213994,_0x2470cf){_0x2470cf=_0x2470cf||0xc8;return function(_0x2d8773){if(_0x2d8773){return _0x213994[_0xbfb0('0x19')](_0x2470cf)[_0xbfb0('0x1b')](_0x2d8773);}};}function respondWithFilteredResult(_0x2496b8,_0x4e48b1){return function(_0x5c8a1e){if(_0x5c8a1e){var _0x3319a1=typeof _0x4e48b1[_0xbfb0('0x1c')]==='undefined'&&typeof _0x4e48b1[_0xbfb0('0x1d')]===_0xbfb0('0x1e');var _0x4a6a88=_0x5c8a1e[_0xbfb0('0x1f')];var _0x4b4878=_0x3319a1?0x0:_0x4e48b1[_0xbfb0('0x1c')];var _0x4350fe=_0x3319a1?_0x5c8a1e[_0xbfb0('0x1f')]:_0x4e48b1[_0xbfb0('0x1c')]+_0x4e48b1['limit'];var _0x31c2eb;if(_0x4350fe>=_0x4a6a88){_0x4350fe=_0x4a6a88;_0x31c2eb=0xc8;}else{_0x31c2eb=0xce;}_0x2496b8['status'](_0x31c2eb);return _0x2496b8[_0xbfb0('0x20')]('Content-Range',_0x4b4878+'-'+_0x4350fe+'/'+_0x4a6a88)[_0xbfb0('0x1b')](_0x5c8a1e);}return null;};}function patchUpdates(_0x4cae5a){return function(_0x2fe191){try{jsonpatch['apply'](_0x2fe191,_0x4cae5a,!![]);}catch(_0x278b3d){return BPromise[_0xbfb0('0x21')](_0x278b3d);}return _0x2fe191[_0xbfb0('0x22')]();};}function saveUpdates(_0x3ab347,_0x515d0f){return function(_0x2efb2a){if(_0x2efb2a){return _0x2efb2a[_0xbfb0('0x23')](_0x3ab347)['then'](function(_0x4e86c8){return _0x4e86c8;});}return null;};}function removeEntity(_0x1625e3,_0x1e4a2e){return function(_0x39c5f8){if(_0x39c5f8){return _0x39c5f8['destroy']()[_0xbfb0('0x24')](function(){_0x1625e3['status'](0xcc)[_0xbfb0('0x1a')]();});}};}function handleEntityNotFound(_0x46dac3,_0x250ce8){return function(_0x402db3){if(!_0x402db3){_0x46dac3[_0xbfb0('0x18')](0x194);}return _0x402db3;};}function handleError(_0x1d0e8d,_0xb41263){_0xb41263=_0xb41263||0x1f4;return function(_0x57ab45){logger[_0xbfb0('0x25')](_0x57ab45[_0xbfb0('0x26')]);if(_0x57ab45[_0xbfb0('0x27')]){delete _0x57ab45[_0xbfb0('0x27')];}_0x1d0e8d['status'](_0xb41263)[_0xbfb0('0x28')](_0x57ab45);};}exports[_0xbfb0('0x29')]=function(_0x4e511c,_0x188c90){var _0x6ba12c={},_0x41ad24={},_0x1a5623={'count':0x0,'rows':[]};var _0x4a720c=_[_0xbfb0('0x2a')](db[_0xbfb0('0x2b')][_0xbfb0('0x2c')],function(_0x3f7353){return{'name':_0x3f7353[_0xbfb0('0x2d')],'type':_0x3f7353[_0xbfb0('0x2e')][_0xbfb0('0x2f')]};});_0x41ad24['model']=_['map'](_0x4a720c,'name');_0x41ad24[_0xbfb0('0x30')]=_[_0xbfb0('0x31')](_0x4e511c[_0xbfb0('0x30')]);_0x41ad24[_0xbfb0('0x32')]=_[_0xbfb0('0x33')](_0x41ad24[_0xbfb0('0x34')],_0x41ad24[_0xbfb0('0x30')]);_0x6ba12c[_0xbfb0('0x35')]=_['intersection'](_0x41ad24['model'],qs['fields'](_0x4e511c[_0xbfb0('0x30')][_0xbfb0('0x36')]));_0x6ba12c[_0xbfb0('0x35')]=_0x6ba12c[_0xbfb0('0x35')][_0xbfb0('0x37')]?_0x6ba12c['attributes']:_0x41ad24['model'];if(!_0x4e511c[_0xbfb0('0x30')][_0xbfb0('0x38')](_0xbfb0('0x39'))){_0x6ba12c[_0xbfb0('0x1d')]=qs[_0xbfb0('0x1d')](_0x4e511c[_0xbfb0('0x30')][_0xbfb0('0x1d')]);_0x6ba12c[_0xbfb0('0x1c')]=qs[_0xbfb0('0x1c')](_0x4e511c[_0xbfb0('0x30')]['offset']);}_0x6ba12c['order']=qs[_0xbfb0('0x3a')](_0x4e511c[_0xbfb0('0x30')]['sort']);_0x6ba12c[_0xbfb0('0x3b')]=qs['filters'](_[_0xbfb0('0x3c')](_0x4e511c[_0xbfb0('0x30')],_0x41ad24['filters']),_0x4a720c);if(_0x4e511c['query'][_0xbfb0('0x3d')]){_0x6ba12c[_0xbfb0('0x3b')]=_['merge'](_0x6ba12c[_0xbfb0('0x3b')],{'$or':_['map'](_0x4a720c,function(_0x21da9c){if(_0x21da9c['type']!=='VIRTUAL'){var _0x1af0a0={};_0x1af0a0[_0x21da9c[_0xbfb0('0x27')]]={'$like':'%'+_0x4e511c[_0xbfb0('0x30')][_0xbfb0('0x3d')]+'%'};return _0x1af0a0;}})});}_0x6ba12c=_[_0xbfb0('0x3e')]({},_0x6ba12c,_0x4e511c['options']);var _0x4240a={'where':_0x6ba12c[_0xbfb0('0x3b')]};return db[_0xbfb0('0x2b')][_0xbfb0('0x1f')](_0x4240a)[_0xbfb0('0x24')](function(_0x90da0c){_0x1a5623[_0xbfb0('0x1f')]=_0x90da0c;if(_0x4e511c[_0xbfb0('0x30')][_0xbfb0('0x3f')]){_0x6ba12c[_0xbfb0('0x40')]=[{'all':!![]}];}return db[_0xbfb0('0x2b')][_0xbfb0('0x41')](_0x6ba12c);})[_0xbfb0('0x24')](function(_0x3caaf3){_0x1a5623[_0xbfb0('0x42')]=_0x3caaf3;return _0x1a5623;})[_0xbfb0('0x24')](respondWithFilteredResult(_0x188c90,_0x6ba12c))[_0xbfb0('0x43')](handleError(_0x188c90,null));};exports[_0xbfb0('0x44')]=function(_0x5af02d,_0xa7f6c3){var _0x1401bb={'raw':![],'where':{'id':_0x5af02d[_0xbfb0('0x45')]['id']}},_0x2769d3={};_0x2769d3[_0xbfb0('0x34')]=_[_0xbfb0('0x31')](db[_0xbfb0('0x2b')][_0xbfb0('0x2c')]);_0x2769d3[_0xbfb0('0x30')]=_[_0xbfb0('0x31')](_0x5af02d['query']);_0x2769d3['filters']=_[_0xbfb0('0x33')](_0x2769d3[_0xbfb0('0x34')],_0x2769d3['query']);_0x1401bb['attributes']=_[_0xbfb0('0x33')](_0x2769d3[_0xbfb0('0x34')],qs[_0xbfb0('0x36')](_0x5af02d[_0xbfb0('0x30')][_0xbfb0('0x36')]));_0x1401bb[_0xbfb0('0x35')]=_0x1401bb['attributes'][_0xbfb0('0x37')]?_0x1401bb[_0xbfb0('0x35')]:_0x2769d3[_0xbfb0('0x34')];if(_0x5af02d[_0xbfb0('0x30')][_0xbfb0('0x3f')]){_0x1401bb[_0xbfb0('0x40')]=[{'all':!![]}];}_0x1401bb=_[_0xbfb0('0x3e')]({},_0x1401bb,_0x5af02d[_0xbfb0('0x46')]);return db[_0xbfb0('0x2b')][_0xbfb0('0x47')](_0x1401bb)[_0xbfb0('0x24')](handleEntityNotFound(_0xa7f6c3,null))[_0xbfb0('0x24')](respondWithResult(_0xa7f6c3,null))[_0xbfb0('0x43')](handleError(_0xa7f6c3,null));};exports[_0xbfb0('0x48')]=function(_0x2845da,_0xf085ab){return db[_0xbfb0('0x2b')][_0xbfb0('0x48')](_0x2845da[_0xbfb0('0x49')],{})[_0xbfb0('0x24')](respondWithResult(_0xf085ab,0xc9))[_0xbfb0('0x43')](handleError(_0xf085ab,null));};exports[_0xbfb0('0x4a')]=function(_0x3f1972,_0x35b22e){var _0x59dd29={'where':{'id':_0x3f1972[_0xbfb0('0x45')]['id']}},_0x41c1d4={};_0x41c1d4[_0xbfb0('0x34')]=_[_0xbfb0('0x31')](db[_0xbfb0('0x2b')][_0xbfb0('0x2c')]);_0x59dd29[_0xbfb0('0x35')]=_['intersection'](_0x41c1d4[_0xbfb0('0x34')],qs[_0xbfb0('0x36')](_0x3f1972[_0xbfb0('0x30')]['fields']));_0x59dd29[_0xbfb0('0x35')]=_0x59dd29['attributes'][_0xbfb0('0x37')]?_0x59dd29[_0xbfb0('0x35')]:_0x41c1d4[_0xbfb0('0x34')];if(_0x3f1972[_0xbfb0('0x30')]['includeAll']){_0x59dd29[_0xbfb0('0x40')]=[{'all':!![]}];}_0x59dd29=_[_0xbfb0('0x3e')]({},_0x59dd29,_0x3f1972['options']);return db[_0xbfb0('0x2b')][_0xbfb0('0x47')](_0x59dd29)['then'](handleEntityNotFound(_0x35b22e,null))['then'](function(_0x531726){if(_0x531726){var _0x14bb38=_0x531726[_0xbfb0('0x4b')]({'plain':!![]});_0x14bb38=qs['omit'](_0x14bb38,['id',_0xbfb0('0x4c'),_0xbfb0('0x4d'),_0xbfb0('0x4e')]);_0x3f1972[_0xbfb0('0x49')]=_['omit'](_0x3f1972[_0xbfb0('0x49')],['id',_0xbfb0('0x4c'),_0xbfb0('0x4d')]);return db['sequelize']['transaction'](function(_0x5d3fac){return db['UserProfile'][_0xbfb0('0x48')](_[_0xbfb0('0x3e')](_0x14bb38,_0x3f1972[_0xbfb0('0x49')]),{'include':_0x3f1972[_0xbfb0('0x30')][_0xbfb0('0x3f')]?[{'all':!![]}]:undefined,'transaction':_0x5d3fac})[_0xbfb0('0x24')](function(_0x228e38){var _0x4f1b7d=_0x228e38[_0xbfb0('0x4b')]({'plain':!![]});return db[_0xbfb0('0x4f')][_0xbfb0('0x41')]({'where':{'userProfileId':_0x3f1972[_0xbfb0('0x45')]['id']},'raw':!![]})[_0xbfb0('0x24')](function(_0xbf35e0){if(_0xbf35e0){return BPromise['each'](_0xbf35e0,function(_0x22eb16){return new BPromise(function(_0x459f45,_0x5dbdb0){if(_0x22eb16[_0xbfb0('0x50')]===null||_0x22eb16[_0xbfb0('0x50')]===0x1)_0x459f45(null);return db[_0xbfb0('0x51')][_0xbfb0('0x41')]({'where':{'sectionId':_0x22eb16['id']},'raw':!![]})['then'](function(_0x15815d){var _0x1dda6d=_[_0xbfb0('0x2a')](_0x15815d,function(_0x16c8aa){return qs[_0xbfb0('0x52')](_0x16c8aa,['id',_0xbfb0('0x4c'),'updatedAt',_0xbfb0('0x53')]);});_0x459f45(_0x1dda6d);})[_0xbfb0('0x43')](function(_0x2d1084){_0x5dbdb0(_0x2d1084);});})[_0xbfb0('0x24')](function(_0xd15af3){var _0x51a1dc=qs[_0xbfb0('0x52')](_0x22eb16,['id',_0xbfb0('0x4c'),_0xbfb0('0x4d')]);_0x51a1dc['userProfileId']=_0x4f1b7d['id'];if(_0xd15af3)_0x51a1dc[_0xbfb0('0x54')]=_0xd15af3;return _0x51a1dc;})['then'](function(_0x215558){return db[_0xbfb0('0x4f')]['create'](_0x215558,{'include':[{'model':db[_0xbfb0('0x51')],'as':_0xbfb0('0x54')}],'raw':!![],'transaction':_0x5d3fac});});})['then'](function(){return _0x4f1b7d;});}});});});}})['then'](respondWithResult(_0x35b22e,0xc9))[_0xbfb0('0x43')](handleError(_0x35b22e,null));};exports['update']=function(_0x50b071,_0x21ebc0){if(_0x50b071[_0xbfb0('0x49')]['id']){delete _0x50b071[_0xbfb0('0x49')]['id'];}return db[_0xbfb0('0x2b')]['find']({'where':{'id':_0x50b071['params']['id']}})[_0xbfb0('0x24')](handleEntityNotFound(_0x21ebc0,null))['then'](saveUpdates(_0x50b071['body'],null))[_0xbfb0('0x24')](respondWithResult(_0x21ebc0,null))[_0xbfb0('0x43')](handleError(_0x21ebc0,null));};exports[_0xbfb0('0x55')]=function(_0x13ded2,_0x43febb){return db[_0xbfb0('0x2b')]['find']({'where':{'id':_0x13ded2[_0xbfb0('0x45')]['id']}})[_0xbfb0('0x24')](handleEntityNotFound(_0x43febb,null))[_0xbfb0('0x24')](removeEntity(_0x43febb,null))[_0xbfb0('0x43')](handleError(_0x43febb,null));};exports[_0xbfb0('0x56')]=function(_0x462929,_0x29e1d6){return db['UserProfile'][_0xbfb0('0x56')]()[_0xbfb0('0x24')](respondWithResult(_0x29e1d6,null))[_0xbfb0('0x43')](handleError(_0x29e1d6,null));};exports['addSections']=function(_0x477a2e,_0x32c4e1){var _0x39405f=_0x477a2e[_0xbfb0('0x49')];return db[_0xbfb0('0x2b')]['find']({'where':{'id':_0x477a2e[_0xbfb0('0x45')]['id']}})[_0xbfb0('0x24')](handleEntityNotFound(_0x32c4e1,null))['then'](function(_0x4998c5){if(_0x4998c5){return db['sequelize'][_0xbfb0('0x57')](function(_0x196d99){return db[_0xbfb0('0x4f')][_0xbfb0('0x55')]({'where':{'userProfileId':_0x477a2e['params']['id'],'sectionId':_[_0xbfb0('0x2a')](_0x39405f,function(_0x184c36){return _0x184c36[_0xbfb0('0x53')];})},'transaction':_0x196d99})[_0xbfb0('0x24')](function(){var _0x324584=_[_0xbfb0('0x2a')](_0x39405f,function(_0x398e76){_0x398e76[_0xbfb0('0x58')]=_0x477a2e[_0xbfb0('0x45')]['id'];return _0x398e76;});var _0x233106=[];return BPromise[_0xbfb0('0x59')](_0x324584,function(_0x2e8566){return db[_0xbfb0('0x4f')]['create'](_0x2e8566,{'include':[{'model':db[_0xbfb0('0x51')],'as':_0xbfb0('0x54')}],'raw':!![],'transaction':_0x196d99})[_0xbfb0('0x24')](function(_0xd15cc1){_0x233106['push'](_0xd15cc1[_0xbfb0('0x4b')]({'plain':!![]}));});})['then'](function(){return _0x233106;});});});}})[_0xbfb0('0x24')](function(_0x281b9a){return _0x281b9a;})[_0xbfb0('0x24')](respondWithResult(_0x32c4e1,null))['catch'](handleError(_0x32c4e1,null));};exports[_0xbfb0('0x5a')]=function(_0x39b74d,_0x14aef5){var _0x1e21ce;return db['UserProfile'][_0xbfb0('0x47')]({'where':{'id':_0x39b74d[_0xbfb0('0x45')]['id']},'attributes':['id','name']})[_0xbfb0('0x24')](handleEntityNotFound(_0x14aef5,null))[_0xbfb0('0x24')](function(_0x1fb32c){if(_0x1fb32c){_0x1e21ce=_0x1fb32c;return db[_0xbfb0('0x4f')]['destroy']({'where':{'userProfileId':_0x39b74d['params']['id'],'sectionId':_0x39b74d[_0xbfb0('0x30')][_0xbfb0('0x5b')]}});}})[_0xbfb0('0x24')](function(){return _0x1e21ce;})['then'](respondWithStatusCode(_0x14aef5,null))[_0xbfb0('0x43')](handleError(_0x14aef5,null));};exports[_0xbfb0('0x5c')]=function(_0x5356c2,_0x349ec0){var _0x457823=[];var _0x26082d=[];return db[_0xbfb0('0x4f')][_0xbfb0('0x41')]({'where':{'userProfileId':_0x5356c2[_0xbfb0('0x45')]['id']},'raw':!![]})[_0xbfb0('0x24')](function(_0x298306){_0x457823=_['filter'](_0x298306,function(_0x3ad529){return _0x3ad529[_0xbfb0('0x5d')]===0x1||_[_0xbfb0('0x5e')]([0x3eb,0x709],_0x3ad529[_0xbfb0('0x53')]);});if(!_[_0xbfb0('0x5f')](_0x457823)){return _['map'](_0x457823,function(_0x35f9ac){return _0x35f9ac[_0xbfb0('0x53')];});}else{return;}})[_0xbfb0('0x24')](function(_0x1124ce){if(_0x1124ce)_0x26082d=_0x1124ce;if(_[_0xbfb0('0x5e')](_0x26082d,0x64)){var _0xf9fed8=_[_0xbfb0('0x47')](_0x457823,{'sectionId':0x64});return hasDefaultDashboard(_0xf9fed8)['then'](function(_0x8db0a8){return _[_0xbfb0('0x2a')](_0x457823,function(_0x34ffa3){if(_0x34ffa3[_0xbfb0('0x53')]===0x64){_0x34ffa3['subsections']=_0x8db0a8;}return _0x34ffa3;});});}else{return;}})[_0xbfb0('0x24')](function(_0x7ca2e6){if(_0x7ca2e6)_0x457823=_0x7ca2e6;if(_['includes'](_0x26082d,0x3eb)){var _0x5bf319=_['find'](_0x457823,{'sectionId':0x3eb});return getCustomDashboards(_0x5bf319)['then'](function(_0x1e2e67){return _['map'](_0x457823,function(_0x5ee0cd){if(_0x5bf319[_0xbfb0('0x5d')]){if(_0x5ee0cd['sectionId']===0x3eb){_0x5ee0cd['subsections']=_0x1e2e67;}}else{if(_0x5ee0cd[_0xbfb0('0x53')]===0x64){_0x5ee0cd[_0xbfb0('0x60')]=_0x1e2e67;}}return _0x5ee0cd;});});}else{return;}})['then'](function(_0x1f892f){if(_0x1f892f)_0x457823=_0x1f892f;if(_[_0xbfb0('0x5e')](_0x26082d,0x709)){var _0x5c0ada=_[_0xbfb0('0x47')](_0x457823,{'sectionId':0x709});return getPlugins(_0x5c0ada)[_0xbfb0('0x24')](function(_0x59f1f2){if(_0x5c0ada[_0xbfb0('0x5d')]){return _[_0xbfb0('0x2a')](_0x457823,function(_0x2efed0){if(_0x2efed0[_0xbfb0('0x53')]===0x709){_0x2efed0[_0xbfb0('0x60')]=_0x59f1f2;}return _0x2efed0;});}else{var _0x55d480={'sectionId':0x76c,'enabled':0x1,'subsections':_0x59f1f2};var _0x4188b5=_[_0xbfb0('0x2a')](_0x457823);_0x4188b5['push'](_0x55d480);return _0x4188b5;}});}else{return;}})[_0xbfb0('0x24')](function(_0x308f7b){if(_0x308f7b)_0x457823=_0x308f7b;return _[_0xbfb0('0x3d')](_0x457823,[_0xbfb0('0x5d'),0x1]);})[_0xbfb0('0x24')](respondWithResult(_0x349ec0,null))[_0xbfb0('0x43')](handleError(_0x349ec0,null));};function hasDefaultDashboard(_0x123f24){var _0x53c883=[0x65];return new BPromise(function(_0x5b0df5,_0x3444c1){try{if(_0x123f24[_0xbfb0('0x50')]){_0x5b0df5(_0x53c883);}else{return db['UserProfileResource'][_0xbfb0('0x61')]({'where':{'sectionId':_0x123f24['id']},'raw':!![]})['then'](function(_0x589e74){_0x589e74?_0x5b0df5(_0x53c883):_0x5b0df5();});}}catch(_0xce6ca8){_0x3444c1(_0xce6ca8);}});}function getCustomDashboards(_0x3a3d6c){var _0x201d4a=[];return new BPromise(function(_0x219768,_0x1f4572){try{if(_0x3a3d6c[_0xbfb0('0x50')]){return db[_0xbfb0('0x62')][_0xbfb0('0x41')]({'raw':!![]})[_0xbfb0('0x24')](function(_0xeaa6ff){_0xeaa6ff[_0xbfb0('0x63')](function(_0x2dfa11){_0x201d4a[_0xbfb0('0x64')](_0x2dfa11['id']+0x1869f);});_0x219768(_0x201d4a);});}else{return db['UserProfileResource'][_0xbfb0('0x41')]({'where':{'sectionId':_0x3a3d6c['id']},'raw':!![]})[_0xbfb0('0x24')](function(_0x5f2ad7){_0x5f2ad7[_0xbfb0('0x63')](function(_0x1cc637){_0x201d4a[_0xbfb0('0x64')](_0x1cc637[_0xbfb0('0x65')]+0x1869f);});_0x219768(_0x201d4a);});}}catch(_0x440324){_0x1f4572(_0x440324);}});}function getPlugins(_0x4bcd2f){var _0x3e711c=[];return new BPromise(function(_0x51115b,_0x396d19){try{if(_0x4bcd2f[_0xbfb0('0x50')]){return db[_0xbfb0('0x66')][_0xbfb0('0x41')]({'raw':!![]})[_0xbfb0('0x24')](function(_0xf1773a){_0xf1773a[_0xbfb0('0x63')](function(_0x2095b3){_0x3e711c[_0xbfb0('0x64')](_0x2095b3['id']+0x15b38);});_0x51115b(_0x3e711c);});}else{return db['UserProfileResource'][_0xbfb0('0x41')]({'where':{'sectionId':_0x4bcd2f['id']},'raw':!![]})['then'](function(_0x278410){_0x278410[_0xbfb0('0x63')](function(_0x450656){_0x3e711c['push'](_0x450656['resourceId']+0x15b38);});_0x51115b(_0x3e711c);});}}catch(_0x37d1b4){_0x396d19(_0x37d1b4);}});}exports[_0xbfb0('0x67')]=function(_0x29efef,_0x5ed8bc){return db[_0xbfb0('0x2b')][_0xbfb0('0x47')]({'where':{'id':_0x29efef['params']['id']}})[_0xbfb0('0x24')](handleEntityNotFound(_0x5ed8bc,null))['then'](function(_0x5d4dd3){if(_0x5d4dd3){return db[_0xbfb0('0x68')]['transaction'](function(_0x1cb991){return db[_0xbfb0('0x4f')][_0xbfb0('0x41')]({'where':{'userProfileId':_0x29efef[_0xbfb0('0x45')]['id']},'attributes':['id'],'raw':!![]})[_0xbfb0('0x24')](function(_0x22d09f){if(_0x22d09f){return db['UserProfileSection'][_0xbfb0('0x55')]({'where':{'userProfileId':_0x29efef[_0xbfb0('0x45')]['id'],'id':_['map'](_0x22d09f,function(_0x1817b0){return _0x1817b0['id'];})},'transaction':_0x1cb991});}})['then'](function(_0x17e22a){var _0x144bc9=_[_0xbfb0('0x2a')](_0x29efef[_0xbfb0('0x49')],function(_0x1b1252){_0x1b1252[_0xbfb0('0x58')]=_0x29efef[_0xbfb0('0x45')]['id'];return _0x1b1252;});return db[_0xbfb0('0x4f')]['bulkCreate'](_0x144bc9,{'raw':!![],'transaction':_0x1cb991});})['then'](function(_0x5cf9d4){var _0x4c02d9=_[_0xbfb0('0x3d')](_['map'](_0x5cf9d4,function(_0x355aba){return _0x355aba[_0xbfb0('0x4b')]({'plain':!![]});}),{'includeAll':![]});if(_0x4c02d9){return db[_0xbfb0('0x4f')][_0xbfb0('0x41')]({'where':{'userProfileId':_0x29efef['params']['id'],'sectionId':_[_0xbfb0('0x2a')](_0x4c02d9,function(_0x124b22){return _0x124b22[_0xbfb0('0x53')];})},'attributes':['id',_0xbfb0('0x53')],'raw':!![]})['then'](function(_0x324443){var _0x4cd4d6=_[_0xbfb0('0x2a')](_0x29efef[_0xbfb0('0x49')],function(_0x21f491){_0x21f491['userProfileId']=_0x29efef[_0xbfb0('0x45')]['id'];return _0x21f491;});return db[_0xbfb0('0x51')]['bulkCreate'](_0x4cd4d6,{'raw':!![],'transaction':_0x1cb991});});}})[_0xbfb0('0x43')](handleError(_0x5ed8bc,null));});}})['then'](function(_0x7cc924){var _0x2e38fc=_[_0xbfb0('0x2a')](_0x7cc924,function(_0x388742){return _0x388742['get']({'plain':!![]});});})[_0xbfb0('0x24')](respondWithResult(_0x5ed8bc,null))[_0xbfb0('0x43')](handleError(_0x5ed8bc,null));};exports[_0xbfb0('0x69')]=function(_0x52d7f6,_0x56a2f1,_0x465dc7){return db[_0xbfb0('0x2b')][_0xbfb0('0x47')]({'where':{'id':_0x52d7f6[_0xbfb0('0x45')]['id']}})['then'](handleEntityNotFound(_0x56a2f1,null))[_0xbfb0('0x24')](function(_0x2a4145){if(_0x2a4145){return _0x2a4145[_0xbfb0('0x69')](_0x52d7f6[_0xbfb0('0x30')][_0xbfb0('0x5b')]);}})[_0xbfb0('0x24')](respondWithStatusCode(_0x56a2f1,null))[_0xbfb0('0x43')](handleError(_0x56a2f1,null));};exports[_0xbfb0('0x6a')]=function(_0x5fc2de,_0x5e35b7){var _0x37bf3e={};if(!_0x5fc2de[_0xbfb0('0x30')]['section'])throw new Error(_0xbfb0('0x6b'));if(!_0x5fc2de[_0xbfb0('0x30')][_0xbfb0('0x38')](_0xbfb0('0x39'))){_0x37bf3e[_0xbfb0('0x1d')]=qs[_0xbfb0('0x1d')](_0x5fc2de[_0xbfb0('0x30')][_0xbfb0('0x1d')]);_0x37bf3e['offset']=qs['offset'](_0x5fc2de[_0xbfb0('0x30')]['offset']);}return db[_0xbfb0('0x2b')]['find']({'where':{'id':_0x5fc2de['params']['id']}})[_0xbfb0('0x24')](function(_0x24ae1c){if(!_0x24ae1c)throw new Error(_0xbfb0('0x6c')+_0x5fc2de[_0xbfb0('0x45')]['id']);return db['UserProfile'][_0xbfb0('0x6a')](_0x5fc2de);})['then'](respondWithFilteredResult(_0x5e35b7,_0x37bf3e))['catch'](handleError(_0x5e35b7,null));}; \ No newline at end of file +var _0xc373=['getSections','includes','isEmpty','subsections','enabled','findOne','Dashboard','forEach','resourceId','userProfileId','bulkCreate','removeResources','getResources','section','Missing\x20section\x20parameter','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','then','error','stack','name','index','UserProfile','fieldName','type','key','model','map','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','rawAttributes','include','find','create','body','omit','createdAt','updatedAt','crudPermissions','sequelize','transaction','UserProfileSection','each','autoAssociation','UserProfileResource','sectionId','Resources','update','destroy','describe','addSections','push','get','ids'];(function(_0x525e50,_0xdf83f2){var _0x2303a3=function(_0x122549){while(--_0x122549){_0x525e50['push'](_0x525e50['shift']());}};_0x2303a3(++_0xdf83f2);}(_0xc373,0x1c7));var _0x3c37=function(_0x561771,_0x554760){_0x561771=_0x561771-0x0;var _0x54d16e=_0xc373[_0x561771];return _0x54d16e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3c37('0x0'));var zipdir=require(_0x3c37('0x1'));var jsonpatch=require(_0x3c37('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3c37('0x3'));var Mustache=require(_0x3c37('0x4'));var util=require(_0x3c37('0x5'));var path=require(_0x3c37('0x6'));var sox=require(_0x3c37('0x7'));var csv=require(_0x3c37('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3c37('0x9'));var squel=require(_0x3c37('0xa'));var crypto=require(_0x3c37('0xb'));var jsforce=require(_0x3c37('0xc'));var deskjs=require(_0x3c37('0xd'));var toCsv=require(_0x3c37('0x8'));var querystring=require(_0x3c37('0xe'));var Papa=require(_0x3c37('0xf'));var Redis=require(_0x3c37('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x3c37('0x11'));var hardwareService=require(_0x3c37('0x12'));var logger=require(_0x3c37('0x13'))(_0x3c37('0x14'));var utils=require(_0x3c37('0x15'));var config=require(_0x3c37('0x16'));var licenseUtil=require(_0x3c37('0x17'));var db=require('../../mysqldb')['db'];config[_0x3c37('0x18')]=_[_0x3c37('0x19')](config[_0x3c37('0x18')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3c37('0x18')]));require('./userProfile.socket')['register'](socket);function respondWithStatusCode(_0x37904b,_0x3be8b3){_0x3be8b3=_0x3be8b3||0xcc;return function(_0x2eca76){if(_0x2eca76){return _0x37904b[_0x3c37('0x1a')](_0x3be8b3);}return _0x37904b[_0x3c37('0x1b')](_0x3be8b3)[_0x3c37('0x1c')]();};}function respondWithResult(_0x25d36e,_0x40d3ee){_0x40d3ee=_0x40d3ee||0xc8;return function(_0x294ea3){if(_0x294ea3){return _0x25d36e['status'](_0x40d3ee)[_0x3c37('0x1d')](_0x294ea3);}};}function respondWithFilteredResult(_0x214a0b,_0x5201bb){return function(_0x55761e){if(_0x55761e){var _0x3ae991=typeof _0x5201bb[_0x3c37('0x1e')]===_0x3c37('0x1f')&&typeof _0x5201bb[_0x3c37('0x20')]===_0x3c37('0x1f');var _0x2b0f25=_0x55761e['count'];var _0x97c790=_0x3ae991?0x0:_0x5201bb['offset'];var _0x4c8932=_0x3ae991?_0x55761e[_0x3c37('0x21')]:_0x5201bb[_0x3c37('0x1e')]+_0x5201bb[_0x3c37('0x20')];var _0x7fe4f0;if(_0x4c8932>=_0x2b0f25){_0x4c8932=_0x2b0f25;_0x7fe4f0=0xc8;}else{_0x7fe4f0=0xce;}_0x214a0b[_0x3c37('0x1b')](_0x7fe4f0);return _0x214a0b['set'](_0x3c37('0x22'),_0x97c790+'-'+_0x4c8932+'/'+_0x2b0f25)['json'](_0x55761e);}return null;};}function patchUpdates(_0x3399a7){return function(_0x510baf){try{jsonpatch[_0x3c37('0x23')](_0x510baf,_0x3399a7,!![]);}catch(_0x2e4226){return BPromise[_0x3c37('0x24')](_0x2e4226);}return _0x510baf['save']();};}function saveUpdates(_0x51d25d,_0x5e004e){return function(_0x573e24){if(_0x573e24){return _0x573e24['update'](_0x51d25d)[_0x3c37('0x25')](function(_0xb334d0){return _0xb334d0;});}return null;};}function removeEntity(_0x1655c1,_0x3ab6bd){return function(_0x5dc9af){if(_0x5dc9af){return _0x5dc9af['destroy']()['then'](function(){_0x1655c1[_0x3c37('0x1b')](0xcc)[_0x3c37('0x1c')]();});}};}function handleEntityNotFound(_0x5e1df2,_0x4a9091){return function(_0x1ba7e0){if(!_0x1ba7e0){_0x5e1df2[_0x3c37('0x1a')](0x194);}return _0x1ba7e0;};}function handleError(_0x118269,_0xf98a18){_0xf98a18=_0xf98a18||0x1f4;return function(_0x64474f){logger[_0x3c37('0x26')](_0x64474f[_0x3c37('0x27')]);if(_0x64474f[_0x3c37('0x28')]){delete _0x64474f[_0x3c37('0x28')];}_0x118269[_0x3c37('0x1b')](_0xf98a18)['send'](_0x64474f);};}exports[_0x3c37('0x29')]=function(_0x2f7f87,_0x531931){var _0x579142={},_0x14936d={},_0x3bc99a={'count':0x0,'rows':[]};var _0x35590b=_['map'](db[_0x3c37('0x2a')]['rawAttributes'],function(_0x4548d3){return{'name':_0x4548d3[_0x3c37('0x2b')],'type':_0x4548d3[_0x3c37('0x2c')][_0x3c37('0x2d')]};});_0x14936d[_0x3c37('0x2e')]=_[_0x3c37('0x2f')](_0x35590b,_0x3c37('0x28'));_0x14936d[_0x3c37('0x30')]=_[_0x3c37('0x31')](_0x2f7f87[_0x3c37('0x30')]);_0x14936d['filters']=_['intersection'](_0x14936d['model'],_0x14936d[_0x3c37('0x30')]);_0x579142[_0x3c37('0x32')]=_[_0x3c37('0x33')](_0x14936d[_0x3c37('0x2e')],qs[_0x3c37('0x34')](_0x2f7f87[_0x3c37('0x30')][_0x3c37('0x34')]));_0x579142[_0x3c37('0x32')]=_0x579142[_0x3c37('0x32')][_0x3c37('0x35')]?_0x579142[_0x3c37('0x32')]:_0x14936d[_0x3c37('0x2e')];if(!_0x2f7f87['query'][_0x3c37('0x36')](_0x3c37('0x37'))){_0x579142['limit']=qs['limit'](_0x2f7f87[_0x3c37('0x30')][_0x3c37('0x20')]);_0x579142[_0x3c37('0x1e')]=qs[_0x3c37('0x1e')](_0x2f7f87[_0x3c37('0x30')][_0x3c37('0x1e')]);}_0x579142[_0x3c37('0x38')]=qs[_0x3c37('0x39')](_0x2f7f87[_0x3c37('0x30')]['sort']);_0x579142[_0x3c37('0x3a')]=qs[_0x3c37('0x3b')](_[_0x3c37('0x3c')](_0x2f7f87[_0x3c37('0x30')],_0x14936d[_0x3c37('0x3b')]),_0x35590b);if(_0x2f7f87[_0x3c37('0x30')][_0x3c37('0x3d')]){_0x579142[_0x3c37('0x3a')]=_[_0x3c37('0x3e')](_0x579142[_0x3c37('0x3a')],{'$or':_['map'](_0x35590b,function(_0x3b73be){if(_0x3b73be[_0x3c37('0x2c')]!==_0x3c37('0x3f')){var _0xab1900={};_0xab1900[_0x3b73be[_0x3c37('0x28')]]={'$like':'%'+_0x2f7f87['query'][_0x3c37('0x3d')]+'%'};return _0xab1900;}})});}_0x579142=_[_0x3c37('0x3e')]({},_0x579142,_0x2f7f87[_0x3c37('0x40')]);var _0x21576e={'where':_0x579142['where']};return db[_0x3c37('0x2a')]['count'](_0x21576e)[_0x3c37('0x25')](function(_0x51687d){_0x3bc99a[_0x3c37('0x21')]=_0x51687d;if(_0x2f7f87[_0x3c37('0x30')][_0x3c37('0x41')]){_0x579142['include']=[{'all':!![]}];}return db[_0x3c37('0x2a')][_0x3c37('0x42')](_0x579142);})[_0x3c37('0x25')](function(_0x2a4300){_0x3bc99a[_0x3c37('0x43')]=_0x2a4300;return _0x3bc99a;})['then'](respondWithFilteredResult(_0x531931,_0x579142))[_0x3c37('0x44')](handleError(_0x531931,null));};exports[_0x3c37('0x45')]=function(_0x2a2ad9,_0x420196){var _0x1f1632={'raw':![],'where':{'id':_0x2a2ad9[_0x3c37('0x46')]['id']}},_0x30ddbe={};_0x30ddbe['model']=_[_0x3c37('0x31')](db[_0x3c37('0x2a')][_0x3c37('0x47')]);_0x30ddbe['query']=_[_0x3c37('0x31')](_0x2a2ad9['query']);_0x30ddbe[_0x3c37('0x3b')]=_[_0x3c37('0x33')](_0x30ddbe[_0x3c37('0x2e')],_0x30ddbe[_0x3c37('0x30')]);_0x1f1632['attributes']=_['intersection'](_0x30ddbe['model'],qs[_0x3c37('0x34')](_0x2a2ad9[_0x3c37('0x30')]['fields']));_0x1f1632['attributes']=_0x1f1632[_0x3c37('0x32')]['length']?_0x1f1632[_0x3c37('0x32')]:_0x30ddbe[_0x3c37('0x2e')];if(_0x2a2ad9[_0x3c37('0x30')][_0x3c37('0x41')]){_0x1f1632[_0x3c37('0x48')]=[{'all':!![]}];}_0x1f1632=_[_0x3c37('0x3e')]({},_0x1f1632,_0x2a2ad9[_0x3c37('0x40')]);return db[_0x3c37('0x2a')][_0x3c37('0x49')](_0x1f1632)[_0x3c37('0x25')](handleEntityNotFound(_0x420196,null))[_0x3c37('0x25')](respondWithResult(_0x420196,null))['catch'](handleError(_0x420196,null));};exports[_0x3c37('0x4a')]=function(_0x1869ad,_0x4b8351){return db[_0x3c37('0x2a')][_0x3c37('0x4a')](_0x1869ad[_0x3c37('0x4b')],{})['then'](respondWithResult(_0x4b8351,0xc9))[_0x3c37('0x44')](handleError(_0x4b8351,null));};exports['clone']=function(_0x32f2f8,_0xaa6056){var _0x317851={'where':{'id':_0x32f2f8[_0x3c37('0x46')]['id']}},_0x5343e3={};_0x5343e3[_0x3c37('0x2e')]=_[_0x3c37('0x31')](db[_0x3c37('0x2a')][_0x3c37('0x47')]);_0x317851[_0x3c37('0x32')]=_[_0x3c37('0x33')](_0x5343e3[_0x3c37('0x2e')],qs[_0x3c37('0x34')](_0x32f2f8[_0x3c37('0x30')][_0x3c37('0x34')]));_0x317851[_0x3c37('0x32')]=_0x317851[_0x3c37('0x32')]['length']?_0x317851[_0x3c37('0x32')]:_0x5343e3[_0x3c37('0x2e')];if(_0x32f2f8[_0x3c37('0x30')]['includeAll']){_0x317851[_0x3c37('0x48')]=[{'all':!![]}];}_0x317851=_[_0x3c37('0x3e')]({},_0x317851,_0x32f2f8[_0x3c37('0x40')]);return db['UserProfile'][_0x3c37('0x49')](_0x317851)[_0x3c37('0x25')](handleEntityNotFound(_0xaa6056,null))[_0x3c37('0x25')](function(_0x183b19){if(_0x183b19){var _0x3a67e3=_0x183b19['get']({'plain':!![]});_0x3a67e3=qs[_0x3c37('0x4c')](_0x3a67e3,['id',_0x3c37('0x4d'),_0x3c37('0x4e'),_0x3c37('0x4f')]);_0x32f2f8['body']=_['omit'](_0x32f2f8[_0x3c37('0x4b')],['id','createdAt',_0x3c37('0x4e')]);return db[_0x3c37('0x50')][_0x3c37('0x51')](function(_0x5c8757){return db['UserProfile'][_0x3c37('0x4a')](_[_0x3c37('0x3e')](_0x3a67e3,_0x32f2f8[_0x3c37('0x4b')]),{'include':_0x32f2f8[_0x3c37('0x30')]['includeAll']?[{'all':!![]}]:undefined,'transaction':_0x5c8757})[_0x3c37('0x25')](function(_0x1858bf){var _0x56d3d2=_0x1858bf['get']({'plain':!![]});return db[_0x3c37('0x52')]['findAll']({'where':{'userProfileId':_0x32f2f8[_0x3c37('0x46')]['id']},'raw':!![]})[_0x3c37('0x25')](function(_0xe0d4d){if(_0xe0d4d){return BPromise[_0x3c37('0x53')](_0xe0d4d,function(_0x4c589b){return new BPromise(function(_0xfb69a6,_0x5a0d96){if(_0x4c589b[_0x3c37('0x54')]===null||_0x4c589b[_0x3c37('0x54')]===0x1)_0xfb69a6(null);return db[_0x3c37('0x55')][_0x3c37('0x42')]({'where':{'sectionId':_0x4c589b['id']},'raw':!![]})['then'](function(_0x338098){var _0x57c209=_[_0x3c37('0x2f')](_0x338098,function(_0x6e6cfe){return qs[_0x3c37('0x4c')](_0x6e6cfe,['id','createdAt',_0x3c37('0x4e'),_0x3c37('0x56')]);});_0xfb69a6(_0x57c209);})['catch'](function(_0x415627){_0x5a0d96(_0x415627);});})[_0x3c37('0x25')](function(_0x1d5c6f){var _0x5964d4=qs[_0x3c37('0x4c')](_0x4c589b,['id',_0x3c37('0x4d'),'updatedAt']);_0x5964d4['userProfileId']=_0x56d3d2['id'];if(_0x1d5c6f)_0x5964d4['Resources']=_0x1d5c6f;return _0x5964d4;})[_0x3c37('0x25')](function(_0x1c02aa){return db[_0x3c37('0x52')][_0x3c37('0x4a')](_0x1c02aa,{'include':[{'model':db[_0x3c37('0x55')],'as':_0x3c37('0x57')}],'raw':!![],'transaction':_0x5c8757});});})[_0x3c37('0x25')](function(){return _0x56d3d2;});}});});});}})[_0x3c37('0x25')](respondWithResult(_0xaa6056,0xc9))[_0x3c37('0x44')](handleError(_0xaa6056,null));};exports[_0x3c37('0x58')]=function(_0x10a4de,_0x4511be){if(_0x10a4de[_0x3c37('0x4b')]['id']){delete _0x10a4de['body']['id'];}return db[_0x3c37('0x2a')][_0x3c37('0x49')]({'where':{'id':_0x10a4de[_0x3c37('0x46')]['id']}})[_0x3c37('0x25')](handleEntityNotFound(_0x4511be,null))[_0x3c37('0x25')](saveUpdates(_0x10a4de['body'],null))[_0x3c37('0x25')](respondWithResult(_0x4511be,null))[_0x3c37('0x44')](handleError(_0x4511be,null));};exports[_0x3c37('0x59')]=function(_0x3e6fa4,_0x309131){return db['UserProfile']['find']({'where':{'id':_0x3e6fa4['params']['id']}})[_0x3c37('0x25')](handleEntityNotFound(_0x309131,null))[_0x3c37('0x25')](removeEntity(_0x309131,null))[_0x3c37('0x44')](handleError(_0x309131,null));};exports['describe']=function(_0x471046,_0x497e52){return db[_0x3c37('0x2a')][_0x3c37('0x5a')]()[_0x3c37('0x25')](respondWithResult(_0x497e52,null))['catch'](handleError(_0x497e52,null));};exports[_0x3c37('0x5b')]=function(_0xc2f37e,_0x440271){var _0xc30769=_0xc2f37e[_0x3c37('0x4b')];return db['UserProfile'][_0x3c37('0x49')]({'where':{'id':_0xc2f37e[_0x3c37('0x46')]['id']}})[_0x3c37('0x25')](handleEntityNotFound(_0x440271,null))[_0x3c37('0x25')](function(_0x1cf913){if(_0x1cf913){return db[_0x3c37('0x50')][_0x3c37('0x51')](function(_0x4c2c60){return db[_0x3c37('0x52')]['destroy']({'where':{'userProfileId':_0xc2f37e[_0x3c37('0x46')]['id'],'sectionId':_[_0x3c37('0x2f')](_0xc30769,function(_0x207d15){return _0x207d15['sectionId'];})},'transaction':_0x4c2c60})[_0x3c37('0x25')](function(){var _0x3ef528=_[_0x3c37('0x2f')](_0xc30769,function(_0x4cc1bd){_0x4cc1bd['userProfileId']=_0xc2f37e[_0x3c37('0x46')]['id'];return _0x4cc1bd;});var _0x567d38=[];return BPromise[_0x3c37('0x53')](_0x3ef528,function(_0x5c0878){return db[_0x3c37('0x52')]['create'](_0x5c0878,{'include':[{'model':db['UserProfileResource'],'as':'Resources'}],'raw':!![],'transaction':_0x4c2c60})['then'](function(_0x56c31b){_0x567d38[_0x3c37('0x5c')](_0x56c31b[_0x3c37('0x5d')]({'plain':!![]}));});})[_0x3c37('0x25')](function(){return _0x567d38;});});});}})[_0x3c37('0x25')](function(_0x2175db){return _0x2175db;})[_0x3c37('0x25')](respondWithResult(_0x440271,null))['catch'](handleError(_0x440271,null));};exports['removeSections']=function(_0x5c9b10,_0x8cb9d7){var _0x1dbfde;return db['UserProfile'][_0x3c37('0x49')]({'where':{'id':_0x5c9b10[_0x3c37('0x46')]['id']},'attributes':['id',_0x3c37('0x28')]})[_0x3c37('0x25')](handleEntityNotFound(_0x8cb9d7,null))[_0x3c37('0x25')](function(_0x1ac66c){if(_0x1ac66c){_0x1dbfde=_0x1ac66c;return db['UserProfileSection']['destroy']({'where':{'userProfileId':_0x5c9b10['params']['id'],'sectionId':_0x5c9b10[_0x3c37('0x30')][_0x3c37('0x5e')]}});}})[_0x3c37('0x25')](function(){return _0x1dbfde;})[_0x3c37('0x25')](respondWithStatusCode(_0x8cb9d7,null))[_0x3c37('0x44')](handleError(_0x8cb9d7,null));};exports[_0x3c37('0x5f')]=function(_0x3e7003,_0x181133){var _0x1f1be3=[];var _0x23be20=[];return db[_0x3c37('0x52')][_0x3c37('0x42')]({'where':{'userProfileId':_0x3e7003[_0x3c37('0x46')]['id']},'raw':!![]})[_0x3c37('0x25')](function(_0x1efa11){_0x1f1be3=_['filter'](_0x1efa11,function(_0x599ccf){return _0x599ccf['enabled']===0x1||_[_0x3c37('0x60')]([0x3eb,0x709],_0x599ccf[_0x3c37('0x56')]);});if(!_[_0x3c37('0x61')](_0x1f1be3)){return _[_0x3c37('0x2f')](_0x1f1be3,function(_0x470019){return _0x470019['sectionId'];});}else{return;}})['then'](function(_0x18785e){if(_0x18785e)_0x23be20=_0x18785e;if(_['includes'](_0x23be20,0x64)){var _0x5617b2=_[_0x3c37('0x49')](_0x1f1be3,{'sectionId':0x64});return hasDefaultDashboard(_0x5617b2)[_0x3c37('0x25')](function(_0x699ac8){return _[_0x3c37('0x2f')](_0x1f1be3,function(_0xebe5df){if(_0xebe5df['sectionId']===0x64){_0xebe5df[_0x3c37('0x62')]=_0x699ac8;}return _0xebe5df;});});}else{return;}})['then'](function(_0x32cc9a){if(_0x32cc9a)_0x1f1be3=_0x32cc9a;if(_[_0x3c37('0x60')](_0x23be20,0x3eb)){var _0x28c743=_[_0x3c37('0x49')](_0x1f1be3,{'sectionId':0x3eb});return getCustomDashboards(_0x28c743)[_0x3c37('0x25')](function(_0x4e189d){return _[_0x3c37('0x2f')](_0x1f1be3,function(_0x36acc2){if(_0x28c743[_0x3c37('0x63')]){if(_0x36acc2['sectionId']===0x3eb){_0x36acc2[_0x3c37('0x62')]=_0x4e189d;}}else{if(_0x36acc2[_0x3c37('0x56')]===0x64){_0x36acc2[_0x3c37('0x62')]=_0x4e189d;}}return _0x36acc2;});});}else{return;}})[_0x3c37('0x25')](function(_0x482036){if(_0x482036)_0x1f1be3=_0x482036;if(_[_0x3c37('0x60')](_0x23be20,0x709)){var _0x2864ec=_[_0x3c37('0x49')](_0x1f1be3,{'sectionId':0x709});return getPlugins(_0x2864ec)[_0x3c37('0x25')](function(_0x3a0f7e){if(_0x2864ec[_0x3c37('0x63')]){return _[_0x3c37('0x2f')](_0x1f1be3,function(_0x1334a9){if(_0x1334a9['sectionId']===0x709){_0x1334a9[_0x3c37('0x62')]=_0x3a0f7e;}return _0x1334a9;});}else{var _0x3cda5c={'sectionId':0x76c,'enabled':0x1,'subsections':_0x3a0f7e};var _0x151c92=_[_0x3c37('0x2f')](_0x1f1be3);_0x151c92[_0x3c37('0x5c')](_0x3cda5c);return _0x151c92;}});}else{return;}})['then'](function(_0xf62d66){if(_0xf62d66)_0x1f1be3=_0xf62d66;return _[_0x3c37('0x3d')](_0x1f1be3,[_0x3c37('0x63'),0x1]);})['then'](respondWithResult(_0x181133,null))[_0x3c37('0x44')](handleError(_0x181133,null));};function hasDefaultDashboard(_0x447523){var _0x1bee7a=[0x65];return new BPromise(function(_0x4232d8,_0x2372b3){try{if(_0x447523[_0x3c37('0x54')]){_0x4232d8(_0x1bee7a);}else{return db['UserProfileResource'][_0x3c37('0x64')]({'where':{'sectionId':_0x447523['id']},'raw':!![]})[_0x3c37('0x25')](function(_0x2ed337){_0x2ed337?_0x4232d8(_0x1bee7a):_0x4232d8();});}}catch(_0x16bb10){_0x2372b3(_0x16bb10);}});}function getCustomDashboards(_0x44584f){var _0x4f09a3=[];return new BPromise(function(_0x3fdda9,_0xd296e3){try{if(_0x44584f[_0x3c37('0x54')]){return db[_0x3c37('0x65')]['findAll']({'raw':!![]})[_0x3c37('0x25')](function(_0x303d33){_0x303d33[_0x3c37('0x66')](function(_0x4cf765){_0x4f09a3[_0x3c37('0x5c')](_0x4cf765['id']+0x1869f);});_0x3fdda9(_0x4f09a3);});}else{return db[_0x3c37('0x55')][_0x3c37('0x42')]({'where':{'sectionId':_0x44584f['id']},'raw':!![]})[_0x3c37('0x25')](function(_0x20be64){_0x20be64[_0x3c37('0x66')](function(_0x51ec5a){_0x4f09a3['push'](_0x51ec5a[_0x3c37('0x67')]+0x1869f);});_0x3fdda9(_0x4f09a3);});}}catch(_0x47b705){_0xd296e3(_0x47b705);}});}function getPlugins(_0x4213eb){var _0x1f466b=[];return new BPromise(function(_0x2bb8f0,_0x784318){try{if(_0x4213eb['autoAssociation']){return db['Plugin'][_0x3c37('0x42')]({'raw':!![]})[_0x3c37('0x25')](function(_0x5e1c21){_0x5e1c21[_0x3c37('0x66')](function(_0x20846f){_0x1f466b['push'](_0x20846f['id']+0x15b38);});_0x2bb8f0(_0x1f466b);});}else{return db[_0x3c37('0x55')][_0x3c37('0x42')]({'where':{'sectionId':_0x4213eb['id']},'raw':!![]})[_0x3c37('0x25')](function(_0x1e312f){_0x1e312f[_0x3c37('0x66')](function(_0x2747e0){_0x1f466b['push'](_0x2747e0[_0x3c37('0x67')]+0x15b38);});_0x2bb8f0(_0x1f466b);});}}catch(_0x1b2057){_0x784318(_0x1b2057);}});}exports['addResources']=function(_0x28e4f6,_0x15b54f){return db[_0x3c37('0x2a')][_0x3c37('0x49')]({'where':{'id':_0x28e4f6['params']['id']}})[_0x3c37('0x25')](handleEntityNotFound(_0x15b54f,null))[_0x3c37('0x25')](function(_0x4483ec){if(_0x4483ec){return db[_0x3c37('0x50')]['transaction'](function(_0x1b71e8){return db['UserProfileSection'][_0x3c37('0x42')]({'where':{'userProfileId':_0x28e4f6[_0x3c37('0x46')]['id']},'attributes':['id'],'raw':!![]})[_0x3c37('0x25')](function(_0x32fba7){if(_0x32fba7){return db[_0x3c37('0x52')][_0x3c37('0x59')]({'where':{'userProfileId':_0x28e4f6['params']['id'],'id':_['map'](_0x32fba7,function(_0x2d650c){return _0x2d650c['id'];})},'transaction':_0x1b71e8});}})[_0x3c37('0x25')](function(_0x84429f){var _0x452bf4=_[_0x3c37('0x2f')](_0x28e4f6[_0x3c37('0x4b')],function(_0x16d7b6){_0x16d7b6[_0x3c37('0x68')]=_0x28e4f6['params']['id'];return _0x16d7b6;});return db['UserProfileSection'][_0x3c37('0x69')](_0x452bf4,{'raw':!![],'transaction':_0x1b71e8});})[_0x3c37('0x25')](function(_0x29b8f8){var _0x194d4f=_[_0x3c37('0x3d')](_[_0x3c37('0x2f')](_0x29b8f8,function(_0x4b5272){return _0x4b5272['get']({'plain':!![]});}),{'includeAll':![]});if(_0x194d4f){return db['UserProfileSection'][_0x3c37('0x42')]({'where':{'userProfileId':_0x28e4f6[_0x3c37('0x46')]['id'],'sectionId':_[_0x3c37('0x2f')](_0x194d4f,function(_0x3ae623){return _0x3ae623[_0x3c37('0x56')];})},'attributes':['id','sectionId'],'raw':!![]})[_0x3c37('0x25')](function(_0x30d74f){var _0x3c9016=_[_0x3c37('0x2f')](_0x28e4f6['body'],function(_0x5589d2){_0x5589d2['userProfileId']=_0x28e4f6[_0x3c37('0x46')]['id'];return _0x5589d2;});return db['UserProfileResource']['bulkCreate'](_0x3c9016,{'raw':!![],'transaction':_0x1b71e8});});}})['catch'](handleError(_0x15b54f,null));});}})[_0x3c37('0x25')](function(_0x3c0712){var _0x10c679=_['map'](_0x3c0712,function(_0x4d8c95){return _0x4d8c95[_0x3c37('0x5d')]({'plain':!![]});});})[_0x3c37('0x25')](respondWithResult(_0x15b54f,null))[_0x3c37('0x44')](handleError(_0x15b54f,null));};exports[_0x3c37('0x6a')]=function(_0x341bfd,_0x461b3e,_0x2c97eb){return db[_0x3c37('0x2a')][_0x3c37('0x49')]({'where':{'id':_0x341bfd[_0x3c37('0x46')]['id']}})[_0x3c37('0x25')](handleEntityNotFound(_0x461b3e,null))[_0x3c37('0x25')](function(_0x27c1d4){if(_0x27c1d4){return _0x27c1d4[_0x3c37('0x6a')](_0x341bfd[_0x3c37('0x30')]['ids']);}})[_0x3c37('0x25')](respondWithStatusCode(_0x461b3e,null))[_0x3c37('0x44')](handleError(_0x461b3e,null));};exports[_0x3c37('0x6b')]=function(_0x2300aa,_0x5e7807){var _0x3f1280={};if(!_0x2300aa[_0x3c37('0x30')][_0x3c37('0x6c')])throw new Error(_0x3c37('0x6d'));if(!_0x2300aa[_0x3c37('0x30')][_0x3c37('0x36')]('nolimit')){_0x3f1280['limit']=qs[_0x3c37('0x20')](_0x2300aa[_0x3c37('0x30')][_0x3c37('0x20')]);_0x3f1280[_0x3c37('0x1e')]=qs[_0x3c37('0x1e')](_0x2300aa['query'][_0x3c37('0x1e')]);}return db[_0x3c37('0x2a')]['find']({'where':{'id':_0x2300aa[_0x3c37('0x46')]['id']}})['then'](function(_0x439ae5){if(!_0x439ae5)throw new Error('No\x20User\x20Profile\x20found\x20for\x20id\x20'+_0x2300aa[_0x3c37('0x46')]['id']);return db['UserProfile'][_0x3c37('0x6b')](_0x2300aa);})[_0x3c37('0x25')](respondWithFilteredResult(_0x5e7807,_0x3f1280))[_0x3c37('0x44')](handleError(_0x5e7807,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index 30eb78b..a442501 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 _0x1410=['UserProfile','setMaxListeners','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x4fdcc0,_0x560a01){var _0xc0ce94=function(_0x36ea12){while(--_0x36ea12){_0x4fdcc0['push'](_0x4fdcc0['shift']());}};_0xc0ce94(++_0x560a01);}(_0x1410,0x130));var _0x0141=function(_0x1b4c4e,_0x3c0ad5){_0x1b4c4e=_0x1b4c4e-0x0;var _0x489261=_0x1410[_0x1b4c4e];return _0x489261;};'use strict';var EventEmitter=require(_0x0141('0x0'));var UserProfile=require(_0x0141('0x1'))['db'][_0x0141('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x0141('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x0141('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3c3422){return function(_0x5d2855,_0x194c72,_0x454af1){UserProfileEvents[_0x0141('0x5')](_0x3c3422+':'+_0x5d2855['id'],_0x5d2855);UserProfileEvents[_0x0141('0x5')](_0x3c3422,_0x5d2855);_0x454af1(null);};}for(var e in events){if(events[_0x0141('0x6')](e)){var event=events[e];UserProfile[_0x0141('0x7')](e,emitEvent(event));}}module[_0x0141('0x8')]=UserProfileEvents; \ No newline at end of file +var _0x2542=['exports','events','../../mysqldb','UserProfile','setMaxListeners','update','emit','hasOwnProperty','hook'];(function(_0x8e2a09,_0x30f53d){var _0x269f32=function(_0x3fe34d){while(--_0x3fe34d){_0x8e2a09['push'](_0x8e2a09['shift']());}};_0x269f32(++_0x30f53d);}(_0x2542,0x169));var _0x2254=function(_0x7bd534,_0x3b00ea){_0x7bd534=_0x7bd534-0x0;var _0x564630=_0x2542[_0x7bd534];return _0x564630;};'use strict';var EventEmitter=require(_0x2254('0x0'));var UserProfile=require(_0x2254('0x1'))['db'][_0x2254('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x2254('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2254('0x4'),'afterDestroy':'remove'};function emitEvent(_0x4059d1){return function(_0x3b3dcb,_0x27f5c9,_0x456612){UserProfileEvents[_0x2254('0x5')](_0x4059d1+':'+_0x3b3dcb['id'],_0x3b3dcb);UserProfileEvents['emit'](_0x4059d1,_0x3b3dcb);_0x456612(null);};}for(var e in events){if(events[_0x2254('0x6')](e)){var event=events[e];UserProfile[_0x2254('0x7')](e,emitEvent(event));}}module[_0x2254('0x8')]=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index 894188e..9e71b93 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 _0x6a55=['model','keys','intersection','attributes','fields','hasOwnProperty','nolimit','limit','offset','sort','filters','pick','merge','VIRTUAL','foreignKey','forEach','include','reportType','default','DefaultReports','custom','count','rows','Tags','color','tag','openTabs','true','chat','dataValues','sms','fax','openchannel','whatsapp','lodash','exports','models','filter','field','value','then','associatedResources','map','catch','name','resolve','UserProfileResource','findAll','AnalyticExtractedReport','resourceId','toLowerCase','squareprojects','childModel','SquareProject','odbc','SquareOdbc','SquareRecording','parentSections','SquareProjects','projects','JscriptyProject','contacts','CmContact','Lists','ListId','lists','CmList','companies','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites','faxqueues','FaxQueue','FaxAccount','VoiceExtension','contexts','voicemails','VoiceMail','voicerecordings','VoiceRecording','Agents','membername','role','agent','Telephones','User','telephone','VoiceQueues','VoiceQueue','type','inbound','QueueCampaigns','queue','outbound','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','mailqueues','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','SmsAccount','whatsappqueues','WhatsappQueue','whatsappaccounts','WhatsappAccount','voicequeues','queuecampaigns','agents','admin','user','zendeskaccounts','SalesforceAccount','freshdeskaccounts','sugarcrmaccounts','SugarcrmAccount','DeskAccount','ZohoAccount','vtigeraccounts','CannedAnswer','dispositions','Disposition','Dashboard','Interval','pauses','Pause','sounds','Sound','tags','Tag','Template','triggers','Trigger','trunks','Trunk','variables','plugins','extractedreports','Reports','reportId','metrics','AnalyticMetric','toUpperCase','slice','Sequelize','QueryTypes','SELECT','select','ui.createdAt','from','user_has_','_interactions','where','ui.UserId\x20=\x20?','query','toString','OpenTabs','define','UserProfile','user_profiles','section','mergeResources','Invalid\x20section\x20\x27','isEmpty','length','push','UserProfileSection','find','params','all','autoAssociation'];(function(_0x17a464,_0x4084f4){var _0x343d5a=function(_0xfeb9ea){while(--_0xfeb9ea){_0x17a464['push'](_0x17a464['shift']());}};_0x343d5a(++_0x4084f4);}(_0x6a55,0xdb));var _0x56a5=function(_0x386b69,_0x5d9360){_0x386b69=_0x386b69-0x0;var _0x476415=_0x6a55[_0x386b69];return _0x476415;};'use strict';var _=require(_0x56a5('0x0'));var attributes=require('./userProfile.attributes');var qs=require('../../components/parsers/qs');var squel=require('squel');module[_0x56a5('0x1')]=function(_0x47b337){var _0x561353=_0x47b337[_0x56a5('0x2')];function _0x5e5a32(_0x3ff76a,_0x5171fa){return new Promise(function(_0x28bb2b,_0x380b1b){if(!_0x5171fa)return _0x28bb2b(null);var _0x42d164=_0x5171fa[_0x56a5('0x3')]?{[_0x5171fa[_0x56a5('0x3')][_0x56a5('0x4')]]:_0x5171fa[_0x56a5('0x3')][_0x56a5('0x5')]}:undefined;return _0x561353[_0x3ff76a]['findAll']({'where':_0x42d164,'raw':!![]})[_0x56a5('0x6')](function(_0xf15490){_0x5171fa[_0x56a5('0x7')]=_[_0x56a5('0x8')](_0xf15490,'id');_0x28bb2b(_0x5171fa);})[_0x56a5('0x9')](function(_0x3a721d){_0x380b1b(_0x3a721d);});});}function _0x2ad997(_0x258c20,_0x1f5a47){return new Promise(function(_0x4cd7c4,_0x49711d){var _0x2110a9=_0x258c20[_0x56a5('0x3')]?{[_0x258c20[_0x56a5('0x3')][_0x56a5('0x4')]]:_0x258c20[_0x56a5('0x3')][_0x56a5('0x5')]}:undefined;return _0x561353[_0x258c20['model']]['findAll']({'where':_0x2110a9,'raw':!![]})[_0x56a5('0x6')](function(_0x1e416f){_0x1f5a47[_0x56a5('0x7')]=_[_0x56a5('0x8')](_0x1e416f,function(_0x310c32){return _0x310c32[_0x56a5('0xa')];});_0x4cd7c4(_0x1f5a47);})[_0x56a5('0x9')](function(_0x5c4028){_0x49711d(_0x5c4028);});});}function _0x360297(_0x5488c6,_0x41e8b6,_0x51d031){if(!_0x41e8b6)return Promise[_0x56a5('0xb')](null);return new Promise(function(_0x3f3e5b,_0x173c65){return _0x561353[_0x56a5('0xc')][_0x56a5('0xd')]({'where':{'sectionId':_0x41e8b6['id']},'raw':!![]})[_0x56a5('0x6')](function(_0x1dddec){if(_0x5488c6['field']&&_0x5488c6[_0x56a5('0x4')]!=='id'){_0x41e8b6[_0x56a5('0x7')]=_[_0x56a5('0x8')](_0x1dddec,function(_0x127d73){return _0x127d73[_0x5488c6['field']];});}else{if(_0x51d031===_0x56a5('0xe')){_0x41e8b6[_0x56a5('0x7')]=_[_0x56a5('0x8')](_0x1dddec,function(_0x15e469){return{'id':_0x15e469[_0x56a5('0xf')],'type':_0x15e469['type']};});}else{_0x41e8b6['associatedResources']=_[_0x56a5('0x8')](_0x1dddec,function(_0x1c4ab8){return _0x1c4ab8['resourceId'];});}}_0x3f3e5b(_0x41e8b6);})[_0x56a5('0x9')](function(_0x309fa5){_0x173c65(_0x309fa5);});});}function _0x615d49(_0x15d9f8,_0xe1ded0){var _0x616922={'parentSections':[]};switch(_0x15d9f8[_0x56a5('0x10')]()){case _0x56a5('0x11'):_0x616922[_0x56a5('0x12')]=_0x56a5('0x13');break;case _0x56a5('0x14'):_0x616922[_0x56a5('0x12')]=_0x56a5('0x15');break;case'squarerecordings':_0x616922[_0x56a5('0x12')]=_0x56a5('0x16');_0x616922[_0x56a5('0x17')]=[{'name':_0x56a5('0x18'),'field':_0x56a5('0xa'),'foreignKey':'projectName'}];break;case _0x56a5('0x19'):_0x616922['childModel']=_0x56a5('0x1a');break;case _0x56a5('0x1b'):_0x616922[_0x56a5('0x12')]=_0x56a5('0x1c');_0x616922['parentSections']=[{'name':_0x56a5('0x1d'),'field':'id','foreignKey':_0x56a5('0x1e')}];break;case _0x56a5('0x1f'):_0x616922['childModel']=_0x56a5('0x20');break;case _0x56a5('0x21'):_0x616922[_0x56a5('0x12')]=_0x56a5('0x22');break;case _0x56a5('0x23'):_0x616922['childModel']=_0x56a5('0x24');break;case _0x56a5('0x25'):_0x616922[_0x56a5('0x12')]=_0x56a5('0x26');break;case _0x56a5('0x27'):_0x616922['childModel']='ChatWebsite';break;case _0x56a5('0x28'):_0x616922[_0x56a5('0x12')]=_0x56a5('0x29');break;case'faxaccounts':_0x616922[_0x56a5('0x12')]=_0x56a5('0x2a');break;case'inboundroutes':case'internalroutes':case'outboundroutes':_0x616922['childModel']=_0x56a5('0x2b');break;case _0x56a5('0x2c'):_0x616922[_0x56a5('0x12')]='VoiceContext';break;case _0x56a5('0x2d'):_0x616922['childModel']=_0x56a5('0x2e');break;case _0x56a5('0x2f'):_0x616922['childModel']=_0x56a5('0x30');_0x616922['parentSections']=[{'name':_0x56a5('0x31'),'field':_0x56a5('0xa'),'foreignKey':_0x56a5('0x32'),'model':'User','filter':{'field':_0x56a5('0x33'),'value':[_0x56a5('0x34')]}},{'name':_0x56a5('0x35'),'field':'name','foreignKey':_0x56a5('0x32'),'model':_0x56a5('0x36'),'filter':{'field':_0x56a5('0x33'),'value':[_0x56a5('0x37')]}},{'name':_0x56a5('0x38'),'field':'name','foreignKey':'queue','model':_0x56a5('0x39'),'filter':{'field':_0x56a5('0x3a'),'value':[_0x56a5('0x3b')]}},{'name':_0x56a5('0x3c'),'field':_0x56a5('0xa'),'foreignKey':_0x56a5('0x3d'),'model':_0x56a5('0x39'),'filter':{'field':_0x56a5('0x3a'),'value':[_0x56a5('0x3e')]}}];break;case _0x56a5('0x3f'):_0x616922[_0x56a5('0x12')]=_0x56a5('0x40');break;case _0x56a5('0x41'):_0x616922[_0x56a5('0x12')]=_0x56a5('0x42');break;case _0x56a5('0x43'):_0x616922[_0x56a5('0x12')]=_0x56a5('0x44');break;case _0x56a5('0x45'):_0x616922[_0x56a5('0x12')]=_0x56a5('0x46');break;case _0x56a5('0x47'):_0x616922['childModel']='MailQueue';break;case _0x56a5('0x48'):_0x616922['childModel']=_0x56a5('0x49');break;case _0x56a5('0x4a'):_0x616922[_0x56a5('0x12')]=_0x56a5('0x4b');break;case _0x56a5('0x4c'):_0x616922[_0x56a5('0x12')]='OpenchannelQueue';break;case'openchannelaccounts':_0x616922[_0x56a5('0x12')]=_0x56a5('0x4d');break;case _0x56a5('0x4e'):_0x616922[_0x56a5('0x12')]=_0x56a5('0x4f');break;case _0x56a5('0x50'):_0x616922['childModel']=_0x56a5('0x51');break;case _0x56a5('0x52'):_0x616922['childModel']=_0x56a5('0x53');break;case _0x56a5('0x54'):_0x616922[_0x56a5('0x12')]=_0x56a5('0x55');break;case'teams':_0x616922[_0x56a5('0x12')]='Team';break;case _0x56a5('0x56'):case _0x56a5('0x57'):_0x616922['childModel']=_0x56a5('0x39');if(_0xe1ded0){_0x616922['parentSections']=[{'name':_0x56a5('0x38')},{'name':_0x56a5('0x3c')}];}break;case'users':case _0x56a5('0x58'):case'telephones':_0x616922[_0x56a5('0x12')]='User';if(_0xe1ded0){_0x616922[_0x56a5('0x17')]=[{'name':'Users','filter':{'field':_0x56a5('0x33'),'value':[_0x56a5('0x59'),_0x56a5('0x5a')]},'ignore':!![]},{'name':_0x56a5('0x31')},{'name':_0x56a5('0x35')}];}break;case _0x56a5('0x5b'):_0x616922[_0x56a5('0x12')]='ZendeskAccount';break;case'salesforceaccounts':_0x616922['childModel']=_0x56a5('0x5c');break;case _0x56a5('0x5d'):_0x616922[_0x56a5('0x12')]='FreshdeskAccount';break;case _0x56a5('0x5e'):_0x616922[_0x56a5('0x12')]=_0x56a5('0x5f');break;case'deskaccounts':_0x616922[_0x56a5('0x12')]=_0x56a5('0x60');break;case'zohoaccounts':_0x616922[_0x56a5('0x12')]=_0x56a5('0x61');break;case _0x56a5('0x62'):_0x616922[_0x56a5('0x12')]=_0x56a5('0x36');break;case'cannedanswers':_0x616922[_0x56a5('0x12')]=_0x56a5('0x63');break;case _0x56a5('0x64'):_0x616922[_0x56a5('0x12')]=_0x56a5('0x65');break;case'customdashboards':_0x616922[_0x56a5('0x12')]=_0x56a5('0x66');break;case'intervals':_0x616922[_0x56a5('0x12')]=_0x56a5('0x67');break;case _0x56a5('0x68'):_0x616922['childModel']=_0x56a5('0x69');break;case'scheduler':_0x616922[_0x56a5('0x12')]='Schedule';break;case _0x56a5('0x6a'):_0x616922[_0x56a5('0x12')]=_0x56a5('0x6b');break;case _0x56a5('0x6c'):_0x616922['childModel']=_0x56a5('0x6d');break;case'templates':_0x616922[_0x56a5('0x12')]=_0x56a5('0x6e');break;case _0x56a5('0x6f'):_0x616922[_0x56a5('0x12')]=_0x56a5('0x70');break;case _0x56a5('0x71'):_0x616922[_0x56a5('0x12')]=_0x56a5('0x72');break;case _0x56a5('0x73'):_0x616922[_0x56a5('0x12')]='Variable';break;case _0x56a5('0x74'):_0x616922[_0x56a5('0x12')]='Plugin';break;case _0x56a5('0x75'):_0x616922['childModel']=_0x56a5('0xe');_0x616922[_0x56a5('0x17')]=[{'name':_0x56a5('0x76'),'field':'id','foreignKey':_0x56a5('0x77')}];break;case _0x56a5('0x78'):_0x616922['childModel']=_0x56a5('0x79');break;}return _0x616922;}function _0x3cd325(_0x97b0ed,_0x1a5689){var _0x580f08=_0x97b0ed['charAt'](0x0)[_0x56a5('0x7a')]()+_0x97b0ed[_0x56a5('0x7b')](0x1);var _0x3a3d72={'type':_0x561353[_0x56a5('0x7c')][_0x56a5('0x7d')][_0x56a5('0x7e')],'raw':!![]};return new Promise(function(_0x27ce71,_0x5770eb){var _0x105fcc=squel[_0x56a5('0x7f')]()[_0x56a5('0x4')]('ui.'+_0x580f08+'InteractionId','id')[_0x56a5('0x4')](_0x56a5('0x80'))[_0x56a5('0x81')](_0x56a5('0x82')+_0x97b0ed+_0x56a5('0x83'),'ui')[_0x56a5('0x84')](_0x56a5('0x85'),_0x1a5689['id']);return _0x561353['sequelize'][_0x56a5('0x86')](_0x105fcc[_0x56a5('0x87')](),_0x3a3d72)[_0x56a5('0x6')](function(_0x4240e3){_0x1a5689[_0x580f08+_0x56a5('0x88')]=_0x4240e3;_0x27ce71(_0x4240e3);})[_0x56a5('0x9')](function(_0x50b7d0){_0x5770eb(_0x50b7d0);});});}return _0x47b337[_0x56a5('0x89')](_0x56a5('0x8a'),attributes,{'tableName':_0x56a5('0x8b'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x42db28){var _0x180d29={'raw':![],'where':{}};var _0x263c59={};var _0x4b6906={'count':0x0,'rows':[]};var _0x5ed269=_0x42db28[_0x56a5('0x86')][_0x56a5('0x8c')];var _0x3f7ed3=_0x42db28['query'][_0x56a5('0x8d')]||![];var _0x189bf0=_0x615d49(_0x5ed269,_0x3f7ed3);if(!_0x189bf0[_0x56a5('0x12')])throw new Error(_0x56a5('0x8e')+_0x5ed269+'\x27');var _0x81a6ef=[{'name':_0x5ed269}];if(!_[_0x56a5('0x8f')](_0x189bf0[_0x56a5('0x17')]))_0x81a6ef=_0x189bf0[_0x56a5('0x17')];var _0x58f245=[];for(var _0x96093a=0x0;_0x96093a<_0x81a6ef[_0x56a5('0x90')];_0x96093a++){_0x58f245[_0x56a5('0x91')](_0x561353[_0x56a5('0x92')][_0x56a5('0x93')]({'where':{'userProfileId':_0x42db28[_0x56a5('0x94')]['id'],'name':_0x81a6ef[_0x96093a][_0x56a5('0xa')]},'raw':!![]}));}return Promise[_0x56a5('0x95')](_0x58f245)[_0x56a5('0x6')](function(_0x6f470b){var _0xc65be8=_[_0x56a5('0x3')](_0x6f470b,function(_0xcb9103){return _0xcb9103?_0xcb9103:undefined;});var _0x1f602f=_[_0x56a5('0x3')](_0x81a6ef,['ignore',!![]]);var _0x1242d6=_[_0x56a5('0x8f')](_0xc65be8)&&_[_0x56a5('0x8f')](_0x1f602f)?null:_['union'](_0x1f602f,_0xc65be8);if(!_0x1242d6)return null;var _0x38c24d=[];for(var _0x58b0fc=0x0;_0x58b0fc<_0x1242d6[_0x56a5('0x90')];_0x58b0fc++){var _0x463196=_[_0x56a5('0x93')](_0x81a6ef,function(_0x51981a){return _0x1242d6[_0x58b0fc]?_0x51981a[_0x56a5('0xa')]===_0x1242d6[_0x58b0fc][_0x56a5('0xa')]:null;});if(_0x463196){if(_0x1242d6[_0x58b0fc]['ignore']){_0x38c24d[_0x56a5('0x91')](_0x5e5a32(_0x189bf0[_0x56a5('0x12')],_0x1242d6[_0x58b0fc]));}else{if(!_0x1242d6[_0x58b0fc][_0x56a5('0x96')]){_0x38c24d[_0x56a5('0x91')](_0x360297(_0x463196,_0x1242d6[_0x58b0fc],_0x189bf0[_0x56a5('0x12')]));}else{if(_0x463196[_0x56a5('0x97')]){_0x38c24d[_0x56a5('0x91')](_0x2ad997(_0x463196,_0x1242d6[_0x58b0fc]));}}}}}return Promise['all'](_0x38c24d);})[_0x56a5('0x6')](function(_0x56318b){var _0x5160c0=_0x56318b;var _0x3b4acf=null;if(_0x5160c0){_0x3b4acf=_0x5160c0[_0x56a5('0x90')]===0x1?_0x5160c0[0x0]:null;}if(!_0x3b4acf&&!_0x5160c0)return _0x4b6906;var _0x2586d5=_0x561353[_0x189bf0[_0x56a5('0x12')]]['rawAttributes'];_0x263c59[_0x56a5('0x97')]=_[_0x56a5('0x98')](_0x2586d5);_0x263c59[_0x56a5('0x86')]=_['keys'](_0x42db28[_0x56a5('0x86')]);_0x263c59['filters']=_[_0x56a5('0x99')](_0x263c59[_0x56a5('0x97')],_0x263c59[_0x56a5('0x86')]);_0x180d29[_0x56a5('0x9a')]=_[_0x56a5('0x99')](_0x263c59['model'],qs[_0x56a5('0x9b')](_0x42db28[_0x56a5('0x86')]['fields']));_0x180d29[_0x56a5('0x9a')]=_0x180d29[_0x56a5('0x9a')][_0x56a5('0x90')]?_0x180d29['attributes']:_0x263c59[_0x56a5('0x97')];if(!_0x42db28[_0x56a5('0x86')][_0x56a5('0x9c')](_0x56a5('0x9d'))){_0x180d29[_0x56a5('0x9e')]=qs[_0x56a5('0x9e')](_0x42db28[_0x56a5('0x86')][_0x56a5('0x9e')]);_0x180d29[_0x56a5('0x9f')]=qs[_0x56a5('0x9f')](_0x42db28[_0x56a5('0x86')][_0x56a5('0x9f')]);}_0x180d29['order']=qs['sort'](_0x42db28[_0x56a5('0x86')][_0x56a5('0xa0')]);_0x180d29[_0x56a5('0x84')]=qs[_0x56a5('0xa1')](_[_0x56a5('0xa2')](_0x42db28[_0x56a5('0x86')],_0x263c59[_0x56a5('0xa1')]));if(_0x42db28[_0x56a5('0x86')][_0x56a5('0x3')]){_0x180d29[_0x56a5('0x84')]=_[_0x56a5('0xa3')](_0x180d29[_0x56a5('0x84')],{'$or':_[_0x56a5('0x8')](_0x2586d5,function(_0x278940){if(_0x278940[_0x56a5('0x3a')]['key']!==_0x56a5('0xa4')){var _0x537cd4={};_0x537cd4[_0x278940[_0x56a5('0x4')]]={'$like':'%'+_0x42db28[_0x56a5('0x86')][_0x56a5('0x3')]+'%'};return _0x537cd4;}})});}var _0x474c42=[];var _0x1937ec=null;var _0x5a4de5={};if(_0x3b4acf){_0x1937ec=_[_0x56a5('0x93')](_0x81a6ef,[_0x56a5('0xa'),_0x3b4acf[_0x56a5('0xa')]]);if(_0x1937ec['field']){_0x5a4de5={};if(_0x189bf0[_0x56a5('0x12')]===_0x56a5('0xe')){_0x5a4de5[_0x1937ec[_0x56a5('0xa5')]]=_[_0x56a5('0x8')](_0x3b4acf[_0x56a5('0x7')],'id');}else{_0x5a4de5[_0x1937ec[_0x56a5('0xa5')]]=_0x3b4acf['associatedResources'];}_0x474c42['push'](_0x5a4de5);}else{_0x180d29[_0x56a5('0x84')]['id']=_0x3b4acf[_0x56a5('0x7')];}}else{for(var _0x544671=0x0;_0x544671<_0x5160c0['length'];_0x544671++){_0x1937ec=_['find'](_0x81a6ef,[_0x56a5('0xa'),_0x5160c0[_0x544671]['name']]);if(_0x1937ec[_0x56a5('0x4')]){_0x5a4de5={};_0x5a4de5[_0x1937ec[_0x56a5('0xa5')]]=_0x5160c0[_0x544671][_0x56a5('0x7')];_0x474c42['push'](_0x5a4de5);}else{if(!_0x180d29[_0x56a5('0x84')]['id'])_0x180d29[_0x56a5('0x84')]['id']=[];_0x5160c0[_0x544671][_0x56a5('0x7')][_0x56a5('0xa6')](function(_0x28f16d){_0x180d29['where']['id']['push'](_0x28f16d);});}}}if(!_[_0x56a5('0x8f')](_0x474c42)){_0x180d29[_0x56a5('0x84')]=_[_0x56a5('0xa3')](_0x180d29[_0x56a5('0x84')],{'$and':{'$or':_0x474c42}});}_0x180d29=_[_0x56a5('0xa3')]({},_0x180d29,_0x42db28['options']);if(_0x3b4acf&&!_0x3b4acf['autoAssociation']&&_0x189bf0[_0x56a5('0x12')]==='AnalyticExtractedReport'){if(_0x42db28[_0x56a5('0x86')]['includeAll']){_0x180d29[_0x56a5('0xa7')]=[{'all':!![]}];}return _0x561353[_0x189bf0[_0x56a5('0x12')]][_0x56a5('0xd')](_0x180d29)['then'](function(_0x1ef44d){var _0x2470ce=[];_0x1ef44d[_0x56a5('0xa6')](function(_0x9bb895){var _0x441668;switch(_0x9bb895[_0x56a5('0xa8')]){case _0x56a5('0xa9'):_0x441668=_[_0x56a5('0x93')](_0x3b4acf['associatedResources'],function(_0x1ff016){return _0x1ff016['id']===_0x9bb895[_0x56a5('0x77')]&&_0x1ff016['type']===_0x56a5('0xaa');});break;case _0x56a5('0xab'):_0x441668=_['find'](_0x3b4acf[_0x56a5('0x7')],function(_0x24e467){return _0x24e467['id']===_0x9bb895[_0x56a5('0x77')]&&_0x24e467[_0x56a5('0x3a')]==='CustomReports';});break;}if(_0x441668)_0x2470ce['push'](_0x9bb895);});_0x4b6906[_0x56a5('0xac')]=_0x2470ce[_0x56a5('0x90')];_0x4b6906[_0x56a5('0xad')]=_0x2470ce;return _0x4b6906;});}else{return _0x561353[_0x189bf0['childModel']][_0x56a5('0xac')]({'where':_0x180d29[_0x56a5('0x84')]})[_0x56a5('0x6')](function(_0x4d4cae){_0x4b6906[_0x56a5('0xac')]=_0x4d4cae;if(_0x42db28[_0x56a5('0x86')]['includeAll']){if(_0x189bf0[_0x56a5('0x12')]==='CmContact'){_0x180d29[_0x56a5('0xa7')]=[{'model':_0x561353[_0x56a5('0x6d')],'as':_0x56a5('0xae'),'attributes':['id',_0x56a5('0xa'),_0x56a5('0xaf')],'required':_0x42db28[_0x56a5('0x86')][_0x56a5('0xb0')]?!![]:![]},{'model':_0x561353[_0x56a5('0x6d')],'as':'ThroughTags','attributes':['id',_0x56a5('0xa'),_0x56a5('0xaf')],'through':_0x42db28[_0x56a5('0x86')]['tag']?{'attributes':[],'where':{'TagId':_0x42db28[_0x56a5('0x86')][_0x56a5('0xb0')]||undefined}}:{},'required':_0x42db28[_0x56a5('0x86')][_0x56a5('0xb0')]?!![]:![]}];}else{_0x180d29[_0x56a5('0xa7')]=[{'all':!![]}];}}return _0x561353[_0x189bf0[_0x56a5('0x12')]]['findAll'](_0x180d29);})[_0x56a5('0x6')](function(_0x597926){_0x4b6906['rows']=_0x597926;if(_0x5ed269===_0x56a5('0x31')&&_0x42db28[_0x56a5('0x86')][_0x56a5('0xb1')]===_0x56a5('0xb2')){var _0x5964e8=[];for(var _0x4a87a3=0x0;_0x4a87a3<_0x4b6906['rows'][_0x56a5('0x90')];_0x4a87a3++){_0x5964e8[_0x56a5('0x91')](_0x3cd325(_0x56a5('0xb3'),_0x4b6906[_0x56a5('0xad')][_0x4a87a3][_0x56a5('0xb4')]));_0x5964e8['push'](_0x3cd325(_0x56a5('0xb5'),_0x4b6906[_0x56a5('0xad')][_0x4a87a3][_0x56a5('0xb4')]));_0x5964e8[_0x56a5('0x91')](_0x3cd325(_0x56a5('0xb6'),_0x4b6906[_0x56a5('0xad')][_0x4a87a3][_0x56a5('0xb4')]));_0x5964e8[_0x56a5('0x91')](_0x3cd325('mail',_0x4b6906['rows'][_0x4a87a3][_0x56a5('0xb4')]));_0x5964e8[_0x56a5('0x91')](_0x3cd325(_0x56a5('0xb7'),_0x4b6906[_0x56a5('0xad')][_0x4a87a3]['dataValues']));_0x5964e8[_0x56a5('0x91')](_0x3cd325(_0x56a5('0xb8'),_0x4b6906[_0x56a5('0xad')][_0x4a87a3][_0x56a5('0xb4')]));}return Promise[_0x56a5('0x95')](_0x5964e8)[_0x56a5('0x6')](function(){return _0x4b6906;});}return _0x4b6906;});}});}}});}; \ No newline at end of file +var _0xfcf0=['VoiceQueues','inbound','QueueCampaigns','queue','VoiceQueue','outbound','musiconholds','VoiceChanSpy','voiceprefixes','VoicePrefix','Campaign','mailqueues','MailAccount','MailSubstatus','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','SmsQueue','SmsAccount','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','Team','voicequeues','queuecampaigns','telephones','admin','user','Agents','Telephones','zendeskaccounts','ZendeskAccount','salesforceaccounts','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','DeskAccount','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','Disposition','customdashboards','Dashboard','intervals','Interval','pauses','scheduler','Schedule','sounds','Sound','tags','Tag','Template','Trigger','Trunk','variables','Variable','Plugin','reportId','metrics','charAt','slice','Sequelize','QueryTypes','SELECT','select','ui.','ui.createdAt','from','user_has_','_interactions','where','ui.UserId\x20=\x20?','toString','OpenTabs','define','user_profiles','section','query','mergeResources','isEmpty','length','push','UserProfileSection','find','all','union','rawAttributes','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','offset','sort','pick','merge','key','VIRTUAL','foreignKey','forEach','autoAssociation','include','reportType','default','DefaultReports','custom','count','rows','includeAll','Tags','color','tag','openTabs','chat','dataValues','sms','mail','openchannel','whatsapp','lodash','./userProfile.attributes','squel','exports','filter','value','findAll','associatedResources','map','model','then','catch','resolve','UserProfileResource','field','AnalyticExtractedReport','resourceId','type','toLowerCase','squareprojects','childModel','SquareProject','odbc','SquareOdbc','SquareRecording','parentSections','SquareProjects','name','projectName','projects','JscriptyProject','contacts','CmContact','lists','CmList','companies','CmCompany','globalcustomfields','CmCustomField','chatqueues','chatwebsites','ChatWebsite','faxqueues','FaxQueue','FaxAccount','inboundroutes','internalroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','voicemails','VoiceMail','voicerecordings','membername','User','role','telephone'];(function(_0x38add1,_0x44b935){var _0x234c6f=function(_0x150c98){while(--_0x150c98){_0x38add1['push'](_0x38add1['shift']());}};_0x234c6f(++_0x44b935);}(_0xfcf0,0x138));var _0x0fcf=function(_0x4a6cf8,_0x5534ef){_0x4a6cf8=_0x4a6cf8-0x0;var _0x22205e=_0xfcf0[_0x4a6cf8];return _0x22205e;};'use strict';var _=require(_0x0fcf('0x0'));var attributes=require(_0x0fcf('0x1'));var qs=require('../../components/parsers/qs');var squel=require(_0x0fcf('0x2'));module[_0x0fcf('0x3')]=function(_0x366cfa){var _0xd744d1=_0x366cfa['models'];function _0x2fe6d8(_0x265968,_0x3bd34d){return new Promise(function(_0x3af316,_0x1bace8){if(!_0x3bd34d)return _0x3af316(null);var _0x1a7b03=_0x3bd34d[_0x0fcf('0x4')]?{[_0x3bd34d[_0x0fcf('0x4')]['field']]:_0x3bd34d[_0x0fcf('0x4')][_0x0fcf('0x5')]}:undefined;return _0xd744d1[_0x265968][_0x0fcf('0x6')]({'where':_0x1a7b03,'raw':!![]})['then'](function(_0x69a840){_0x3bd34d[_0x0fcf('0x7')]=_[_0x0fcf('0x8')](_0x69a840,'id');_0x3af316(_0x3bd34d);})['catch'](function(_0x369959){_0x1bace8(_0x369959);});});}function _0x5c29ed(_0x1be284,_0x2317cf){return new Promise(function(_0x201a58,_0x48619c){var _0x5f40fb=_0x1be284[_0x0fcf('0x4')]?{[_0x1be284[_0x0fcf('0x4')]['field']]:_0x1be284[_0x0fcf('0x4')][_0x0fcf('0x5')]}:undefined;return _0xd744d1[_0x1be284[_0x0fcf('0x9')]][_0x0fcf('0x6')]({'where':_0x5f40fb,'raw':!![]})[_0x0fcf('0xa')](function(_0x48bba6){_0x2317cf[_0x0fcf('0x7')]=_[_0x0fcf('0x8')](_0x48bba6,function(_0x1fcb47){return _0x1fcb47['name'];});_0x201a58(_0x2317cf);})[_0x0fcf('0xb')](function(_0x610106){_0x48619c(_0x610106);});});}function _0x445207(_0x177c8f,_0x48dd53,_0x3e78d0){if(!_0x48dd53)return Promise[_0x0fcf('0xc')](null);return new Promise(function(_0x1a8477,_0x8581bd){return _0xd744d1[_0x0fcf('0xd')]['findAll']({'where':{'sectionId':_0x48dd53['id']},'raw':!![]})[_0x0fcf('0xa')](function(_0x1a8f58){if(_0x177c8f['field']&&_0x177c8f[_0x0fcf('0xe')]!=='id'){_0x48dd53[_0x0fcf('0x7')]=_['map'](_0x1a8f58,function(_0x2022e1){return _0x2022e1[_0x177c8f['field']];});}else{if(_0x3e78d0===_0x0fcf('0xf')){_0x48dd53[_0x0fcf('0x7')]=_['map'](_0x1a8f58,function(_0x457880){return{'id':_0x457880[_0x0fcf('0x10')],'type':_0x457880[_0x0fcf('0x11')]};});}else{_0x48dd53['associatedResources']=_[_0x0fcf('0x8')](_0x1a8f58,function(_0x1dafc8){return _0x1dafc8[_0x0fcf('0x10')];});}}_0x1a8477(_0x48dd53);})[_0x0fcf('0xb')](function(_0x18af5c){_0x8581bd(_0x18af5c);});});}function _0x30e1b0(_0x5841a9,_0x2eef74){var _0x253641={'parentSections':[]};switch(_0x5841a9[_0x0fcf('0x12')]()){case _0x0fcf('0x13'):_0x253641[_0x0fcf('0x14')]=_0x0fcf('0x15');break;case _0x0fcf('0x16'):_0x253641[_0x0fcf('0x14')]=_0x0fcf('0x17');break;case'squarerecordings':_0x253641[_0x0fcf('0x14')]=_0x0fcf('0x18');_0x253641[_0x0fcf('0x19')]=[{'name':_0x0fcf('0x1a'),'field':_0x0fcf('0x1b'),'foreignKey':_0x0fcf('0x1c')}];break;case _0x0fcf('0x1d'):_0x253641['childModel']=_0x0fcf('0x1e');break;case _0x0fcf('0x1f'):_0x253641[_0x0fcf('0x14')]=_0x0fcf('0x20');_0x253641['parentSections']=[{'name':'Lists','field':'id','foreignKey':'ListId'}];break;case _0x0fcf('0x21'):_0x253641['childModel']=_0x0fcf('0x22');break;case _0x0fcf('0x23'):_0x253641['childModel']=_0x0fcf('0x24');break;case _0x0fcf('0x25'):_0x253641[_0x0fcf('0x14')]=_0x0fcf('0x26');break;case _0x0fcf('0x27'):_0x253641[_0x0fcf('0x14')]='ChatQueue';break;case _0x0fcf('0x28'):_0x253641[_0x0fcf('0x14')]=_0x0fcf('0x29');break;case _0x0fcf('0x2a'):_0x253641[_0x0fcf('0x14')]=_0x0fcf('0x2b');break;case'faxaccounts':_0x253641[_0x0fcf('0x14')]=_0x0fcf('0x2c');break;case _0x0fcf('0x2d'):case _0x0fcf('0x2e'):case _0x0fcf('0x2f'):_0x253641[_0x0fcf('0x14')]=_0x0fcf('0x30');break;case _0x0fcf('0x31'):_0x253641[_0x0fcf('0x14')]=_0x0fcf('0x32');break;case _0x0fcf('0x33'):_0x253641[_0x0fcf('0x14')]=_0x0fcf('0x34');break;case _0x0fcf('0x35'):_0x253641['childModel']='VoiceRecording';_0x253641[_0x0fcf('0x19')]=[{'name':'Agents','field':'name','foreignKey':_0x0fcf('0x36'),'model':_0x0fcf('0x37'),'filter':{'field':_0x0fcf('0x38'),'value':['agent']}},{'name':'Telephones','field':_0x0fcf('0x1b'),'foreignKey':_0x0fcf('0x36'),'model':_0x0fcf('0x37'),'filter':{'field':'role','value':[_0x0fcf('0x39')]}},{'name':_0x0fcf('0x3a'),'field':_0x0fcf('0x1b'),'foreignKey':'queue','model':'VoiceQueue','filter':{'field':'type','value':[_0x0fcf('0x3b')]}},{'name':_0x0fcf('0x3c'),'field':_0x0fcf('0x1b'),'foreignKey':_0x0fcf('0x3d'),'model':_0x0fcf('0x3e'),'filter':{'field':'type','value':[_0x0fcf('0x3f')]}}];break;case _0x0fcf('0x40'):_0x253641[_0x0fcf('0x14')]='VoiceMusicOnHold';break;case'chanspies':_0x253641[_0x0fcf('0x14')]=_0x0fcf('0x41');break;case _0x0fcf('0x42'):_0x253641[_0x0fcf('0x14')]=_0x0fcf('0x43');break;case'ivrcampaigns':_0x253641[_0x0fcf('0x14')]=_0x0fcf('0x44');break;case _0x0fcf('0x45'):_0x253641[_0x0fcf('0x14')]='MailQueue';break;case'mailaccounts':_0x253641[_0x0fcf('0x14')]=_0x0fcf('0x46');break;case'mailsubstatuses':_0x253641[_0x0fcf('0x14')]=_0x0fcf('0x47');break;case'openchannelqueues':_0x253641[_0x0fcf('0x14')]=_0x0fcf('0x48');break;case _0x0fcf('0x49'):_0x253641[_0x0fcf('0x14')]=_0x0fcf('0x4a');break;case'smsqueues':_0x253641[_0x0fcf('0x14')]=_0x0fcf('0x4b');break;case'smsaccounts':_0x253641['childModel']=_0x0fcf('0x4c');break;case'whatsappqueues':_0x253641['childModel']=_0x0fcf('0x4d');break;case _0x0fcf('0x4e'):_0x253641[_0x0fcf('0x14')]=_0x0fcf('0x4f');break;case _0x0fcf('0x50'):_0x253641[_0x0fcf('0x14')]=_0x0fcf('0x51');break;case _0x0fcf('0x52'):case _0x0fcf('0x53'):_0x253641[_0x0fcf('0x14')]='VoiceQueue';if(_0x2eef74){_0x253641[_0x0fcf('0x19')]=[{'name':_0x0fcf('0x3a')},{'name':_0x0fcf('0x3c')}];}break;case'users':case'agents':case _0x0fcf('0x54'):_0x253641[_0x0fcf('0x14')]=_0x0fcf('0x37');if(_0x2eef74){_0x253641[_0x0fcf('0x19')]=[{'name':'Users','filter':{'field':'role','value':[_0x0fcf('0x55'),_0x0fcf('0x56')]},'ignore':!![]},{'name':_0x0fcf('0x57')},{'name':_0x0fcf('0x58')}];}break;case _0x0fcf('0x59'):_0x253641[_0x0fcf('0x14')]=_0x0fcf('0x5a');break;case _0x0fcf('0x5b'):_0x253641['childModel']='SalesforceAccount';break;case _0x0fcf('0x5c'):_0x253641[_0x0fcf('0x14')]=_0x0fcf('0x5d');break;case _0x0fcf('0x5e'):_0x253641[_0x0fcf('0x14')]=_0x0fcf('0x5f');break;case'deskaccounts':_0x253641[_0x0fcf('0x14')]=_0x0fcf('0x60');break;case'zohoaccounts':_0x253641[_0x0fcf('0x14')]=_0x0fcf('0x61');break;case _0x0fcf('0x62'):_0x253641[_0x0fcf('0x14')]='User';break;case _0x0fcf('0x63'):_0x253641[_0x0fcf('0x14')]=_0x0fcf('0x64');break;case _0x0fcf('0x65'):_0x253641[_0x0fcf('0x14')]=_0x0fcf('0x66');break;case _0x0fcf('0x67'):_0x253641[_0x0fcf('0x14')]=_0x0fcf('0x68');break;case _0x0fcf('0x69'):_0x253641[_0x0fcf('0x14')]=_0x0fcf('0x6a');break;case _0x0fcf('0x6b'):_0x253641[_0x0fcf('0x14')]='Pause';break;case _0x0fcf('0x6c'):_0x253641['childModel']=_0x0fcf('0x6d');break;case _0x0fcf('0x6e'):_0x253641[_0x0fcf('0x14')]=_0x0fcf('0x6f');break;case _0x0fcf('0x70'):_0x253641['childModel']=_0x0fcf('0x71');break;case'templates':_0x253641[_0x0fcf('0x14')]=_0x0fcf('0x72');break;case'triggers':_0x253641[_0x0fcf('0x14')]=_0x0fcf('0x73');break;case'trunks':_0x253641[_0x0fcf('0x14')]=_0x0fcf('0x74');break;case _0x0fcf('0x75'):_0x253641[_0x0fcf('0x14')]=_0x0fcf('0x76');break;case'plugins':_0x253641['childModel']=_0x0fcf('0x77');break;case'extractedreports':_0x253641[_0x0fcf('0x14')]=_0x0fcf('0xf');_0x253641['parentSections']=[{'name':'Reports','field':'id','foreignKey':_0x0fcf('0x78')}];break;case _0x0fcf('0x79'):_0x253641[_0x0fcf('0x14')]='AnalyticMetric';break;}return _0x253641;}function _0xbb8286(_0x4a5da0,_0x2ed8d8){var _0x386101=_0x4a5da0[_0x0fcf('0x7a')](0x0)['toUpperCase']()+_0x4a5da0[_0x0fcf('0x7b')](0x1);var _0x29c0b8={'type':_0xd744d1[_0x0fcf('0x7c')][_0x0fcf('0x7d')][_0x0fcf('0x7e')],'raw':!![]};return new Promise(function(_0x381884,_0x4a20a1){var _0x1f04d1=squel[_0x0fcf('0x7f')]()[_0x0fcf('0xe')](_0x0fcf('0x80')+_0x386101+'InteractionId','id')[_0x0fcf('0xe')](_0x0fcf('0x81'))[_0x0fcf('0x82')](_0x0fcf('0x83')+_0x4a5da0+_0x0fcf('0x84'),'ui')[_0x0fcf('0x85')](_0x0fcf('0x86'),_0x2ed8d8['id']);return _0xd744d1['sequelize']['query'](_0x1f04d1[_0x0fcf('0x87')](),_0x29c0b8)[_0x0fcf('0xa')](function(_0x58607c){_0x2ed8d8[_0x386101+_0x0fcf('0x88')]=_0x58607c;_0x381884(_0x58607c);})[_0x0fcf('0xb')](function(_0x447c25){_0x4a20a1(_0x447c25);});});}return _0x366cfa[_0x0fcf('0x89')]('UserProfile',attributes,{'tableName':_0x0fcf('0x8a'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x9c32ad){var _0x6eaf86={'raw':![],'where':{}};var _0x1e2dd7={};var _0x1f38b8={'count':0x0,'rows':[]};var _0x1abf75=_0x9c32ad['query'][_0x0fcf('0x8b')];var _0x255743=_0x9c32ad[_0x0fcf('0x8c')][_0x0fcf('0x8d')]||![];var _0x1974e2=_0x30e1b0(_0x1abf75,_0x255743);if(!_0x1974e2['childModel'])throw new Error('Invalid\x20section\x20\x27'+_0x1abf75+'\x27');var _0x3a8704=[{'name':_0x1abf75}];if(!_[_0x0fcf('0x8e')](_0x1974e2[_0x0fcf('0x19')]))_0x3a8704=_0x1974e2[_0x0fcf('0x19')];var _0x2066f6=[];for(var _0x2aa73a=0x0;_0x2aa73a<_0x3a8704[_0x0fcf('0x8f')];_0x2aa73a++){_0x2066f6[_0x0fcf('0x90')](_0xd744d1[_0x0fcf('0x91')][_0x0fcf('0x92')]({'where':{'userProfileId':_0x9c32ad['params']['id'],'name':_0x3a8704[_0x2aa73a][_0x0fcf('0x1b')]},'raw':!![]}));}return Promise[_0x0fcf('0x93')](_0x2066f6)[_0x0fcf('0xa')](function(_0x22b5f7){var _0x21b655=_[_0x0fcf('0x4')](_0x22b5f7,function(_0x21d767){return _0x21d767?_0x21d767:undefined;});var _0x2772dd=_[_0x0fcf('0x4')](_0x3a8704,['ignore',!![]]);var _0x4e76dd=_['isEmpty'](_0x21b655)&&_['isEmpty'](_0x2772dd)?null:_[_0x0fcf('0x94')](_0x2772dd,_0x21b655);if(!_0x4e76dd)return null;var _0x57c221=[];for(var _0x31e763=0x0;_0x31e763<_0x4e76dd[_0x0fcf('0x8f')];_0x31e763++){var _0x3da414=_['find'](_0x3a8704,function(_0x5ab5c6){return _0x4e76dd[_0x31e763]?_0x5ab5c6[_0x0fcf('0x1b')]===_0x4e76dd[_0x31e763][_0x0fcf('0x1b')]:null;});if(_0x3da414){if(_0x4e76dd[_0x31e763]['ignore']){_0x57c221[_0x0fcf('0x90')](_0x2fe6d8(_0x1974e2[_0x0fcf('0x14')],_0x4e76dd[_0x31e763]));}else{if(!_0x4e76dd[_0x31e763]['autoAssociation']){_0x57c221[_0x0fcf('0x90')](_0x445207(_0x3da414,_0x4e76dd[_0x31e763],_0x1974e2[_0x0fcf('0x14')]));}else{if(_0x3da414[_0x0fcf('0x9')]){_0x57c221[_0x0fcf('0x90')](_0x5c29ed(_0x3da414,_0x4e76dd[_0x31e763]));}}}}}return Promise[_0x0fcf('0x93')](_0x57c221);})[_0x0fcf('0xa')](function(_0x4704c9){var _0x4b1f10=_0x4704c9;var _0x3edb41=null;if(_0x4b1f10){_0x3edb41=_0x4b1f10[_0x0fcf('0x8f')]===0x1?_0x4b1f10[0x0]:null;}if(!_0x3edb41&&!_0x4b1f10)return _0x1f38b8;var _0xb8a206=_0xd744d1[_0x1974e2[_0x0fcf('0x14')]][_0x0fcf('0x95')];_0x1e2dd7[_0x0fcf('0x9')]=_['keys'](_0xb8a206);_0x1e2dd7['query']=_[_0x0fcf('0x96')](_0x9c32ad[_0x0fcf('0x8c')]);_0x1e2dd7[_0x0fcf('0x97')]=_[_0x0fcf('0x98')](_0x1e2dd7['model'],_0x1e2dd7[_0x0fcf('0x8c')]);_0x6eaf86[_0x0fcf('0x99')]=_[_0x0fcf('0x98')](_0x1e2dd7[_0x0fcf('0x9')],qs[_0x0fcf('0x9a')](_0x9c32ad['query']['fields']));_0x6eaf86[_0x0fcf('0x99')]=_0x6eaf86['attributes'][_0x0fcf('0x8f')]?_0x6eaf86['attributes']:_0x1e2dd7[_0x0fcf('0x9')];if(!_0x9c32ad[_0x0fcf('0x8c')][_0x0fcf('0x9b')](_0x0fcf('0x9c'))){_0x6eaf86[_0x0fcf('0x9d')]=qs['limit'](_0x9c32ad[_0x0fcf('0x8c')][_0x0fcf('0x9d')]);_0x6eaf86[_0x0fcf('0x9e')]=qs[_0x0fcf('0x9e')](_0x9c32ad['query'][_0x0fcf('0x9e')]);}_0x6eaf86['order']=qs[_0x0fcf('0x9f')](_0x9c32ad['query'][_0x0fcf('0x9f')]);_0x6eaf86[_0x0fcf('0x85')]=qs['filters'](_[_0x0fcf('0xa0')](_0x9c32ad[_0x0fcf('0x8c')],_0x1e2dd7[_0x0fcf('0x97')]));if(_0x9c32ad['query']['filter']){_0x6eaf86['where']=_[_0x0fcf('0xa1')](_0x6eaf86['where'],{'$or':_[_0x0fcf('0x8')](_0xb8a206,function(_0x21c27b){if(_0x21c27b[_0x0fcf('0x11')][_0x0fcf('0xa2')]!==_0x0fcf('0xa3')){var _0x17662e={};_0x17662e[_0x21c27b[_0x0fcf('0xe')]]={'$like':'%'+_0x9c32ad[_0x0fcf('0x8c')][_0x0fcf('0x4')]+'%'};return _0x17662e;}})});}var _0x59e61c=[];var _0x27d46a=null;var _0x231563={};if(_0x3edb41){_0x27d46a=_[_0x0fcf('0x92')](_0x3a8704,[_0x0fcf('0x1b'),_0x3edb41[_0x0fcf('0x1b')]]);if(_0x27d46a[_0x0fcf('0xe')]){_0x231563={};if(_0x1974e2[_0x0fcf('0x14')]===_0x0fcf('0xf')){_0x231563[_0x27d46a['foreignKey']]=_[_0x0fcf('0x8')](_0x3edb41[_0x0fcf('0x7')],'id');}else{_0x231563[_0x27d46a[_0x0fcf('0xa4')]]=_0x3edb41[_0x0fcf('0x7')];}_0x59e61c[_0x0fcf('0x90')](_0x231563);}else{_0x6eaf86[_0x0fcf('0x85')]['id']=_0x3edb41[_0x0fcf('0x7')];}}else{for(var _0x5d63f5=0x0;_0x5d63f5<_0x4b1f10[_0x0fcf('0x8f')];_0x5d63f5++){_0x27d46a=_['find'](_0x3a8704,[_0x0fcf('0x1b'),_0x4b1f10[_0x5d63f5][_0x0fcf('0x1b')]]);if(_0x27d46a[_0x0fcf('0xe')]){_0x231563={};_0x231563[_0x27d46a['foreignKey']]=_0x4b1f10[_0x5d63f5]['associatedResources'];_0x59e61c['push'](_0x231563);}else{if(!_0x6eaf86['where']['id'])_0x6eaf86[_0x0fcf('0x85')]['id']=[];_0x4b1f10[_0x5d63f5][_0x0fcf('0x7')][_0x0fcf('0xa5')](function(_0x3147f3){_0x6eaf86[_0x0fcf('0x85')]['id'][_0x0fcf('0x90')](_0x3147f3);});}}}if(!_[_0x0fcf('0x8e')](_0x59e61c)){_0x6eaf86[_0x0fcf('0x85')]=_[_0x0fcf('0xa1')](_0x6eaf86[_0x0fcf('0x85')],{'$and':{'$or':_0x59e61c}});}_0x6eaf86=_[_0x0fcf('0xa1')]({},_0x6eaf86,_0x9c32ad['options']);if(_0x3edb41&&!_0x3edb41[_0x0fcf('0xa6')]&&_0x1974e2[_0x0fcf('0x14')]==='AnalyticExtractedReport'){if(_0x9c32ad[_0x0fcf('0x8c')]['includeAll']){_0x6eaf86[_0x0fcf('0xa7')]=[{'all':!![]}];}return _0xd744d1[_0x1974e2[_0x0fcf('0x14')]]['findAll'](_0x6eaf86)['then'](function(_0x36d4e5){var _0x3785b4=[];_0x36d4e5['forEach'](function(_0x3085b1){var _0x3cf7b7;switch(_0x3085b1[_0x0fcf('0xa8')]){case _0x0fcf('0xa9'):_0x3cf7b7=_[_0x0fcf('0x92')](_0x3edb41[_0x0fcf('0x7')],function(_0x332407){return _0x332407['id']===_0x3085b1[_0x0fcf('0x78')]&&_0x332407['type']===_0x0fcf('0xaa');});break;case _0x0fcf('0xab'):_0x3cf7b7=_[_0x0fcf('0x92')](_0x3edb41[_0x0fcf('0x7')],function(_0x58ba03){return _0x58ba03['id']===_0x3085b1[_0x0fcf('0x78')]&&_0x58ba03['type']==='CustomReports';});break;}if(_0x3cf7b7)_0x3785b4['push'](_0x3085b1);});_0x1f38b8[_0x0fcf('0xac')]=_0x3785b4[_0x0fcf('0x8f')];_0x1f38b8[_0x0fcf('0xad')]=_0x3785b4;return _0x1f38b8;});}else{return _0xd744d1[_0x1974e2[_0x0fcf('0x14')]][_0x0fcf('0xac')]({'where':_0x6eaf86[_0x0fcf('0x85')]})[_0x0fcf('0xa')](function(_0x31b008){_0x1f38b8[_0x0fcf('0xac')]=_0x31b008;if(_0x9c32ad['query'][_0x0fcf('0xae')]){if(_0x1974e2[_0x0fcf('0x14')]===_0x0fcf('0x20')){_0x6eaf86[_0x0fcf('0xa7')]=[{'model':_0xd744d1[_0x0fcf('0x71')],'as':_0x0fcf('0xaf'),'attributes':['id',_0x0fcf('0x1b'),_0x0fcf('0xb0')],'required':_0x9c32ad[_0x0fcf('0x8c')]['tag']?!![]:![]},{'model':_0xd744d1['Tag'],'as':'ThroughTags','attributes':['id',_0x0fcf('0x1b'),_0x0fcf('0xb0')],'through':_0x9c32ad[_0x0fcf('0x8c')][_0x0fcf('0xb1')]?{'attributes':[],'where':{'TagId':_0x9c32ad['query']['tag']||undefined}}:{},'required':_0x9c32ad['query'][_0x0fcf('0xb1')]?!![]:![]}];}else{_0x6eaf86['include']=[{'all':!![]}];}}return _0xd744d1[_0x1974e2[_0x0fcf('0x14')]]['findAll'](_0x6eaf86);})[_0x0fcf('0xa')](function(_0x573123){_0x1f38b8[_0x0fcf('0xad')]=_0x573123;if(_0x1abf75==='Agents'&&_0x9c32ad['query'][_0x0fcf('0xb2')]==='true'){var _0x2905fa=[];for(var _0x276e9f=0x0;_0x276e9f<_0x1f38b8[_0x0fcf('0xad')][_0x0fcf('0x8f')];_0x276e9f++){_0x2905fa[_0x0fcf('0x90')](_0xbb8286(_0x0fcf('0xb3'),_0x1f38b8[_0x0fcf('0xad')][_0x276e9f][_0x0fcf('0xb4')]));_0x2905fa[_0x0fcf('0x90')](_0xbb8286(_0x0fcf('0xb5'),_0x1f38b8[_0x0fcf('0xad')][_0x276e9f][_0x0fcf('0xb4')]));_0x2905fa[_0x0fcf('0x90')](_0xbb8286('fax',_0x1f38b8[_0x0fcf('0xad')][_0x276e9f][_0x0fcf('0xb4')]));_0x2905fa[_0x0fcf('0x90')](_0xbb8286(_0x0fcf('0xb6'),_0x1f38b8[_0x0fcf('0xad')][_0x276e9f][_0x0fcf('0xb4')]));_0x2905fa[_0x0fcf('0x90')](_0xbb8286(_0x0fcf('0xb7'),_0x1f38b8[_0x0fcf('0xad')][_0x276e9f]['dataValues']));_0x2905fa[_0x0fcf('0x90')](_0xbb8286(_0x0fcf('0xb8'),_0x1f38b8[_0x0fcf('0xad')][_0x276e9f][_0x0fcf('0xb4')]));}return Promise[_0x0fcf('0x93')](_0x2905fa)[_0x0fcf('0xa')](function(){return _0x1f38b8;});}return _0x1f38b8;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index 0462a64..e5b7548 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 _0x7ea9=['request','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','register'];(function(_0x1ba516,_0x53adb2){var _0x5e31c7=function(_0x513ffc){while(--_0x513ffc){_0x1ba516['push'](_0x1ba516['shift']());}};_0x5e31c7(++_0x53adb2);}(_0x7ea9,0xec));var _0x97ea=function(_0xe33241,_0x3ac5bc){_0xe33241=_0xe33241-0x0;var _0x403a3a=_0x7ea9[_0xe33241];return _0x403a3a;};'use strict';var _=require('lodash');var util=require(_0x97ea('0x0'));var moment=require(_0x97ea('0x1'));var BPromise=require(_0x97ea('0x2'));var rs=require(_0x97ea('0x3'));var fs=require('fs');var Redis=require(_0x97ea('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x97ea('0x5'));var logger=require(_0x97ea('0x6'))(_0x97ea('0x7'));var config=require('../../config/environment');var jayson=require(_0x97ea('0x8'));var client=jayson[_0x97ea('0x9')][_0x97ea('0xa')]({'port':0x232a});config[_0x97ea('0xb')]=_['defaults'](config[_0x97ea('0xb')],{'host':_0x97ea('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x97ea('0xb')]));require('./userProfile.socket')[_0x97ea('0xd')](socket);function respondWithRpcPromise(_0x5ae2dc,_0x396e19,_0x340bbc){return new BPromise(function(_0x5a071f,_0x2c03a3){return client[_0x97ea('0xe')](_0x5ae2dc,_0x340bbc)[_0x97ea('0xf')](function(_0x80abd1){logger[_0x97ea('0x10')](_0x97ea('0x11'),_0x396e19,_0x97ea('0x12'));logger[_0x97ea('0x13')](_0x97ea('0x14'),_0x396e19,_0x97ea('0x12'),JSON['stringify'](_0x80abd1));if(_0x80abd1[_0x97ea('0x15')]){if(_0x80abd1[_0x97ea('0x15')]['code']===0x1f4){logger[_0x97ea('0x15')](_0x97ea('0x11'),_0x396e19,_0x80abd1[_0x97ea('0x15')]['message']);return _0x2c03a3(_0x80abd1[_0x97ea('0x15')][_0x97ea('0x16')]);}logger['error'](_0x97ea('0x11'),_0x396e19,_0x80abd1['error'][_0x97ea('0x16')]);return _0x5a071f(_0x80abd1[_0x97ea('0x15')][_0x97ea('0x16')]);}else{logger[_0x97ea('0x10')](_0x97ea('0x11'),_0x396e19,_0x97ea('0x12'));_0x5a071f(_0x80abd1[_0x97ea('0x17')]['message']);}})[_0x97ea('0x18')](function(_0x12499b){logger[_0x97ea('0x15')](_0x97ea('0x11'),_0x396e19,_0x12499b);_0x2c03a3(_0x12499b);});});} \ No newline at end of file +var _0xd08d=['error','code','message','result','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','./userProfile.socket','request','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x44f707,_0x149c85){var _0x263497=function(_0x1ff275){while(--_0x1ff275){_0x44f707['push'](_0x44f707['shift']());}};_0x263497(++_0x149c85);}(_0xd08d,0x81));var _0xdd08=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0xd08d[_0x1a36a5];return _0x746243;};'use strict';var _=require('lodash');var util=require(_0xdd08('0x0'));var moment=require(_0xdd08('0x1'));var BPromise=require('bluebird');var rs=require(_0xdd08('0x2'));var fs=require('fs');var Redis=require(_0xdd08('0x3'));var db=require(_0xdd08('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xdd08('0x5'))(_0xdd08('0x6'));var config=require(_0xdd08('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xdd08('0x8')][_0xdd08('0x9')]({'port':0x232a});config[_0xdd08('0xa')]=_[_0xdd08('0xb')](config[_0xdd08('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xdd08('0xc'))(new Redis(config[_0xdd08('0xa')]));require(_0xdd08('0xd'))['register'](socket);function respondWithRpcPromise(_0x2d4433,_0x2e9c8d,_0x2ca1cc){return new BPromise(function(_0x19b253,_0xe0a892){return client[_0xdd08('0xe')](_0x2d4433,_0x2ca1cc)[_0xdd08('0xf')](function(_0x43a927){logger[_0xdd08('0x10')](_0xdd08('0x11'),_0x2e9c8d,_0xdd08('0x12'));logger[_0xdd08('0x13')]('UserProfile,\x20%s,\x20%s,\x20%s',_0x2e9c8d,_0xdd08('0x12'),JSON[_0xdd08('0x14')](_0x43a927));if(_0x43a927[_0xdd08('0x15')]){if(_0x43a927[_0xdd08('0x15')][_0xdd08('0x16')]===0x1f4){logger[_0xdd08('0x15')](_0xdd08('0x11'),_0x2e9c8d,_0x43a927[_0xdd08('0x15')][_0xdd08('0x17')]);return _0xe0a892(_0x43a927[_0xdd08('0x15')][_0xdd08('0x17')]);}logger[_0xdd08('0x15')](_0xdd08('0x11'),_0x2e9c8d,_0x43a927[_0xdd08('0x15')][_0xdd08('0x17')]);return _0x19b253(_0x43a927[_0xdd08('0x15')][_0xdd08('0x17')]);}else{logger[_0xdd08('0x10')](_0xdd08('0x11'),_0x2e9c8d,_0xdd08('0x12'));_0x19b253(_0x43a927[_0xdd08('0x18')]['message']);}})['catch'](function(_0x435dc4){logger[_0xdd08('0x15')](_0xdd08('0x11'),_0x2e9c8d,_0x435dc4);_0xe0a892(_0x435dc4);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index daf9c53..343c731 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 _0x8cd7=['length','./userProfile.events','save','remove','update','removeListener','register'];(function(_0x4fb5db,_0x549dbb){var _0x1ec86a=function(_0x4d9529){while(--_0x4d9529){_0x4fb5db['push'](_0x4fb5db['shift']());}};_0x1ec86a(++_0x549dbb);}(_0x8cd7,0xa2));var _0x78cd=function(_0x227b91,_0x3d6b8a){_0x227b91=_0x227b91-0x0;var _0x7b65e8=_0x8cd7[_0x227b91];return _0x7b65e8;};'use strict';var UserProfileEvents=require(_0x78cd('0x0'));var events=[_0x78cd('0x1'),_0x78cd('0x2'),_0x78cd('0x3')];function createListener(_0x5701d3,_0x31bc63){return function(_0x3512fa){_0x31bc63['emit'](_0x5701d3,_0x3512fa);};}function removeListener(_0x5c50ea,_0x19681f){return function(){UserProfileEvents[_0x78cd('0x4')](_0x5c50ea,_0x19681f);};}exports[_0x78cd('0x5')]=function(_0x51c46d){for(var _0x4e766c=0x0,_0x118068=events[_0x78cd('0x6')];_0x4e766c<_0x118068;_0x4e766c++){var _0x98e6dc=events[_0x4e766c];var _0x5dd687=createListener('userProfile:'+_0x98e6dc,_0x51c46d);UserProfileEvents['on'](_0x98e6dc,_0x5dd687);}}; \ No newline at end of file +var _0xcca5=['remove','emit','removeListener','register','length','./userProfile.events','save'];(function(_0x3cbcd7,_0x56faef){var _0x5af328=function(_0x2d694b){while(--_0x2d694b){_0x3cbcd7['push'](_0x3cbcd7['shift']());}};_0x5af328(++_0x56faef);}(_0xcca5,0xad));var _0x5cca=function(_0x32b30c,_0x2d5ec8){_0x32b30c=_0x32b30c-0x0;var _0xcfc212=_0xcca5[_0x32b30c];return _0xcfc212;};'use strict';var UserProfileEvents=require(_0x5cca('0x0'));var events=[_0x5cca('0x1'),_0x5cca('0x2'),'update'];function createListener(_0x8e68c3,_0xd41659){return function(_0x1afacb){_0xd41659[_0x5cca('0x3')](_0x8e68c3,_0x1afacb);};}function removeListener(_0x45fa02,_0x1e1ec4){return function(){UserProfileEvents[_0x5cca('0x4')](_0x45fa02,_0x1e1ec4);};}exports[_0x5cca('0x5')]=function(_0xb9012e){for(var _0x1ada68=0x0,_0x59a3e9=events[_0x5cca('0x6')];_0x1ada68<_0x59a3e9;_0x1ada68++){var _0x52a094=events[_0x1ada68];var _0x36cf50=createListener('userProfile:'+_0x52a094,_0xb9012e);UserProfileEvents['on'](_0x52a094,_0x36cf50);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 168b77a..2645129 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 _0x4f7f=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','create','put','update','delete','destroy','exports','multer','util','express','Router'];(function(_0x45fc8c,_0x14393f){var _0x1868ba=function(_0x29ea4c){while(--_0x29ea4c){_0x45fc8c['push'](_0x45fc8c['shift']());}};_0x1868ba(++_0x14393f);}(_0x4f7f,0x1be));var _0xf4f7=function(_0x328d3c,_0x1b9512){_0x328d3c=_0x328d3c-0x0;var _0x5bb3ed=_0x4f7f[_0x328d3c];return _0x5bb3ed;};'use strict';var multer=require(_0xf4f7('0x0'));var util=require(_0xf4f7('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xf4f7('0x2'));var router=express[_0xf4f7('0x3')]();var fs_extra=require(_0xf4f7('0x4'));var auth=require(_0xf4f7('0x5'));var interaction=require(_0xf4f7('0x6'));var config=require(_0xf4f7('0x7'));var controller=require('./userProfileResource.controller');router['get']('/',auth[_0xf4f7('0x8')](),controller[_0xf4f7('0x9')]);router[_0xf4f7('0xa')]('/describe',auth[_0xf4f7('0x8')](),controller['describe']);router[_0xf4f7('0xa')](_0xf4f7('0xb'),auth[_0xf4f7('0x8')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xf4f7('0xc')]);router[_0xf4f7('0xd')](_0xf4f7('0xb'),auth[_0xf4f7('0x8')](),controller[_0xf4f7('0xe')]);router[_0xf4f7('0xf')](_0xf4f7('0xb'),auth[_0xf4f7('0x8')](),controller[_0xf4f7('0x10')]);module[_0xf4f7('0x11')]=router; \ No newline at end of file +var _0x0c1e=['get','index','/describe','isAuthenticated','describe','/:id','show','delete','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x44575e,_0x2ccff3){var _0x1a04c8=function(_0x27f632){while(--_0x27f632){_0x44575e['push'](_0x44575e['shift']());}};_0x1a04c8(++_0x2ccff3);}(_0x0c1e,0x88));var _0xe0c1=function(_0x7cbee3,_0xad9631){_0x7cbee3=_0x7cbee3-0x0;var _0x328b84=_0x0c1e[_0x7cbee3];return _0x328b84;};'use strict';var multer=require(_0xe0c1('0x0'));var util=require('util');var path=require(_0xe0c1('0x1'));var timeout=require(_0xe0c1('0x2'));var express=require('express');var router=express[_0xe0c1('0x3')]();var fs_extra=require(_0xe0c1('0x4'));var auth=require(_0xe0c1('0x5'));var interaction=require(_0xe0c1('0x6'));var config=require(_0xe0c1('0x7'));var controller=require('./userProfileResource.controller');router[_0xe0c1('0x8')]('/',auth['isAuthenticated'](),controller[_0xe0c1('0x9')]);router[_0xe0c1('0x8')](_0xe0c1('0xa'),auth[_0xe0c1('0xb')](),controller[_0xe0c1('0xc')]);router[_0xe0c1('0x8')](_0xe0c1('0xd'),auth[_0xe0c1('0xb')](),controller[_0xe0c1('0xe')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xe0c1('0xd'),auth['isAuthenticated'](),controller['update']);router[_0xe0c1('0xf')]('/:id',auth[_0xe0c1('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index 8aa8d1c..74886d0 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 _0xc98f=['INTEGER','sequelize','STRING'];(function(_0x315cc5,_0x3833ff){var _0x5e2c1e=function(_0x6a040f){while(--_0x6a040f){_0x315cc5['push'](_0x315cc5['shift']());}};_0x5e2c1e(++_0x3833ff);}(_0xc98f,0x91));var _0xfc98=function(_0x35f9cf,_0x40fa9a){_0x35f9cf=_0x35f9cf-0x0;var _0x34b2c7=_0xc98f[_0x35f9cf];return _0x34b2c7;};'use strict';var Sequelize=require(_0xfc98('0x0'));module['exports']={'name':{'type':Sequelize[_0xfc98('0x1')],'allowNull':![]},'resourceId':{'type':Sequelize[_0xfc98('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xfc98('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x97d9=['INTEGER','STRING'];(function(_0x1526e1,_0x5ed5a5){var _0x249a1e=function(_0x4a7c12){while(--_0x4a7c12){_0x1526e1['push'](_0x1526e1['shift']());}};_0x249a1e(++_0x5ed5a5);}(_0x97d9,0x1d3));var _0x997d=function(_0x4c0b3a,_0x41c310){_0x4c0b3a=_0x4c0b3a-0x0;var _0x12bbe8=_0x97d9[_0x4c0b3a];return _0x12bbe8;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x997d('0x0')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x997d('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x997d('0x0')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index 893e315..96fd825 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 _0x7880=['destroy','error','stack','name','send','index','UserProfileResource','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','merge','VIRTUAL','include','findAll','rows','catch','show','params','keys','options','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','count','limit','set','json','apply','reject','save','update','then'];(function(_0x4920f2,_0xa4bfbf){var _0x1f27cf=function(_0x4d94ad){while(--_0x4d94ad){_0x4920f2['push'](_0x4920f2['shift']());}};_0x1f27cf(++_0xa4bfbf);}(_0x7880,0x1f4));var _0x0788=function(_0x621bee,_0x58f8c0){_0x621bee=_0x621bee-0x0;var _0x3076c8=_0x7880[_0x621bee];return _0x3076c8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0788('0x0'));var zipdir=require(_0x0788('0x1'));var jsonpatch=require(_0x0788('0x2'));var rp=require(_0x0788('0x3'));var moment=require(_0x0788('0x4'));var BPromise=require(_0x0788('0x5'));var Mustache=require('mustache');var util=require(_0x0788('0x6'));var path=require(_0x0788('0x7'));var sox=require(_0x0788('0x8'));var csv=require(_0x0788('0x9'));var ejs=require(_0x0788('0xa'));var fs=require('fs');var fs_extra=require(_0x0788('0xb'));var _=require(_0x0788('0xc'));var squel=require(_0x0788('0xd'));var crypto=require(_0x0788('0xe'));var jsforce=require(_0x0788('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x0788('0x9'));var querystring=require('querystring');var Papa=require(_0x0788('0x10'));var Redis=require('ioredis');var authService=require(_0x0788('0x11'));var qs=require(_0x0788('0x12'));var as=require(_0x0788('0x13'));var hardwareService=require(_0x0788('0x14'));var logger=require(_0x0788('0x15'))('api');var utils=require(_0x0788('0x16'));var config=require(_0x0788('0x17'));var licenseUtil=require(_0x0788('0x18'));var db=require(_0x0788('0x19'))['db'];function respondWithStatusCode(_0x311729,_0xce4342){_0xce4342=_0xce4342||0xcc;return function(_0x261ebc){if(_0x261ebc){return _0x311729['sendStatus'](_0xce4342);}return _0x311729[_0x0788('0x1a')](_0xce4342)[_0x0788('0x1b')]();};}function respondWithResult(_0x3bdcdf,_0x13cf07){_0x13cf07=_0x13cf07||0xc8;return function(_0x51e5d3){if(_0x51e5d3){return _0x3bdcdf[_0x0788('0x1a')](_0x13cf07)['json'](_0x51e5d3);}};}function respondWithFilteredResult(_0x195f14,_0x170d56){return function(_0x3fd1e4){if(_0x3fd1e4){var _0xb406fb=typeof _0x170d56[_0x0788('0x1c')]===_0x0788('0x1d')&&typeof _0x170d56['limit']==='undefined';var _0x17d805=_0x3fd1e4[_0x0788('0x1e')];var _0x5b2bdc=_0xb406fb?0x0:_0x170d56[_0x0788('0x1c')];var _0x415f19=_0xb406fb?_0x3fd1e4[_0x0788('0x1e')]:_0x170d56['offset']+_0x170d56[_0x0788('0x1f')];var _0x3fb723;if(_0x415f19>=_0x17d805){_0x415f19=_0x17d805;_0x3fb723=0xc8;}else{_0x3fb723=0xce;}_0x195f14['status'](_0x3fb723);return _0x195f14[_0x0788('0x20')]('Content-Range',_0x5b2bdc+'-'+_0x415f19+'/'+_0x17d805)[_0x0788('0x21')](_0x3fd1e4);}return null;};}function patchUpdates(_0x48bc5f){return function(_0x17cca3){try{jsonpatch[_0x0788('0x22')](_0x17cca3,_0x48bc5f,!![]);}catch(_0x18ff22){return BPromise[_0x0788('0x23')](_0x18ff22);}return _0x17cca3[_0x0788('0x24')]();};}function saveUpdates(_0x4f0005,_0x48ec43){return function(_0x2270d4){if(_0x2270d4){return _0x2270d4[_0x0788('0x25')](_0x4f0005)[_0x0788('0x26')](function(_0x7a99a1){return _0x7a99a1;});}return null;};}function removeEntity(_0x5ba1da,_0x4d5c93){return function(_0x79204e){if(_0x79204e){return _0x79204e[_0x0788('0x27')]()[_0x0788('0x26')](function(){_0x5ba1da['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x240459,_0xa1f7dc){return function(_0x5f2dda){if(!_0x5f2dda){_0x240459['sendStatus'](0x194);}return _0x5f2dda;};}function handleError(_0x5a54a5,_0x44798c){_0x44798c=_0x44798c||0x1f4;return function(_0x57fda1){logger[_0x0788('0x28')](_0x57fda1[_0x0788('0x29')]);if(_0x57fda1[_0x0788('0x2a')]){delete _0x57fda1[_0x0788('0x2a')];}_0x5a54a5[_0x0788('0x1a')](_0x44798c)[_0x0788('0x2b')](_0x57fda1);};}exports[_0x0788('0x2c')]=function(_0x3ffe4f,_0x5b7594){var _0x5a5178={},_0x3c5246={},_0x40d345={'count':0x0,'rows':[]};var _0x54979a=_['map'](db[_0x0788('0x2d')][_0x0788('0x2e')],function(_0x20fcd8){return{'name':_0x20fcd8[_0x0788('0x2f')],'type':_0x20fcd8[_0x0788('0x30')][_0x0788('0x31')]};});_0x3c5246[_0x0788('0x32')]=_[_0x0788('0x33')](_0x54979a,_0x0788('0x2a'));_0x3c5246[_0x0788('0x34')]=_['keys'](_0x3ffe4f[_0x0788('0x34')]);_0x3c5246[_0x0788('0x35')]=_[_0x0788('0x36')](_0x3c5246[_0x0788('0x32')],_0x3c5246[_0x0788('0x34')]);_0x5a5178[_0x0788('0x37')]=_[_0x0788('0x36')](_0x3c5246[_0x0788('0x32')],qs[_0x0788('0x38')](_0x3ffe4f[_0x0788('0x34')]['fields']));_0x5a5178['attributes']=_0x5a5178['attributes']['length']?_0x5a5178['attributes']:_0x3c5246['model'];if(!_0x3ffe4f[_0x0788('0x34')][_0x0788('0x39')](_0x0788('0x3a'))){_0x5a5178['limit']=qs[_0x0788('0x1f')](_0x3ffe4f[_0x0788('0x34')][_0x0788('0x1f')]);_0x5a5178[_0x0788('0x1c')]=qs['offset'](_0x3ffe4f[_0x0788('0x34')]['offset']);}_0x5a5178[_0x0788('0x3b')]=qs['sort'](_0x3ffe4f[_0x0788('0x34')][_0x0788('0x3c')]);_0x5a5178['where']=qs[_0x0788('0x35')](_[_0x0788('0x3d')](_0x3ffe4f['query'],_0x3c5246[_0x0788('0x35')]),_0x54979a);if(_0x3ffe4f['query'][_0x0788('0x3e')]){_0x5a5178['where']=_[_0x0788('0x3f')](_0x5a5178['where'],{'$or':_[_0x0788('0x33')](_0x54979a,function(_0x57fec9){if(_0x57fec9['type']!==_0x0788('0x40')){var _0x68d9d4={};_0x68d9d4[_0x57fec9[_0x0788('0x2a')]]={'$like':'%'+_0x3ffe4f[_0x0788('0x34')][_0x0788('0x3e')]+'%'};return _0x68d9d4;}})});}_0x5a5178=_['merge']({},_0x5a5178,_0x3ffe4f['options']);var _0x530d83={'where':_0x5a5178['where']};return db[_0x0788('0x2d')][_0x0788('0x1e')](_0x530d83)[_0x0788('0x26')](function(_0x358a22){_0x40d345[_0x0788('0x1e')]=_0x358a22;if(_0x3ffe4f['query']['includeAll']){_0x5a5178[_0x0788('0x41')]=[{'all':!![]}];}return db[_0x0788('0x2d')][_0x0788('0x42')](_0x5a5178);})[_0x0788('0x26')](function(_0x236b63){_0x40d345[_0x0788('0x43')]=_0x236b63;return _0x40d345;})[_0x0788('0x26')](respondWithFilteredResult(_0x5b7594,_0x5a5178))[_0x0788('0x44')](handleError(_0x5b7594,null));};exports[_0x0788('0x45')]=function(_0x50e8f5,_0x5581e6){var _0x441aec={'raw':![],'where':{'id':_0x50e8f5[_0x0788('0x46')]['id']}},_0x1d579d={};_0x1d579d['model']=_['keys'](db['UserProfileResource'][_0x0788('0x2e')]);_0x1d579d[_0x0788('0x34')]=_[_0x0788('0x47')](_0x50e8f5[_0x0788('0x34')]);_0x1d579d[_0x0788('0x35')]=_[_0x0788('0x36')](_0x1d579d[_0x0788('0x32')],_0x1d579d[_0x0788('0x34')]);_0x441aec['attributes']=_[_0x0788('0x36')](_0x1d579d[_0x0788('0x32')],qs[_0x0788('0x38')](_0x50e8f5[_0x0788('0x34')]['fields']));_0x441aec[_0x0788('0x37')]=_0x441aec[_0x0788('0x37')]['length']?_0x441aec['attributes']:_0x1d579d['model'];if(_0x50e8f5[_0x0788('0x34')]['includeAll']){_0x441aec[_0x0788('0x41')]=[{'all':!![]}];}_0x441aec=_[_0x0788('0x3f')]({},_0x441aec,_0x50e8f5[_0x0788('0x48')]);return db[_0x0788('0x2d')][_0x0788('0x49')](_0x441aec)[_0x0788('0x26')](handleEntityNotFound(_0x5581e6,null))[_0x0788('0x26')](respondWithResult(_0x5581e6,null))[_0x0788('0x44')](handleError(_0x5581e6,null));};exports['create']=function(_0x4c6366,_0x39c3cc){return db[_0x0788('0x2d')][_0x0788('0x4a')](_0x4c6366['body'],{})[_0x0788('0x26')](respondWithResult(_0x39c3cc,0xc9))[_0x0788('0x44')](handleError(_0x39c3cc,null));};exports[_0x0788('0x25')]=function(_0x4563cd,_0x2395ad){if(_0x4563cd['body']['id']){delete _0x4563cd['body']['id'];}return db[_0x0788('0x2d')][_0x0788('0x49')]({'where':{'id':_0x4563cd['params']['id']}})[_0x0788('0x26')](handleEntityNotFound(_0x2395ad,null))['then'](saveUpdates(_0x4563cd[_0x0788('0x4b')],null))[_0x0788('0x26')](respondWithResult(_0x2395ad,null))[_0x0788('0x44')](handleError(_0x2395ad,null));};exports[_0x0788('0x27')]=function(_0x3c757a,_0x379928){return db[_0x0788('0x2d')][_0x0788('0x49')]({'where':{'id':_0x3c757a['params']['id']}})[_0x0788('0x26')](handleEntityNotFound(_0x379928,null))[_0x0788('0x26')](removeEntity(_0x379928,null))[_0x0788('0x44')](handleError(_0x379928,null));};exports['describe']=function(_0x1693d0,_0x5d32ae){return db['UserProfileResource'][_0x0788('0x4c')]()[_0x0788('0x26')](respondWithResult(_0x5d32ae,null))[_0x0788('0x44')](handleError(_0x5d32ae,null));}; \ No newline at end of file +var _0x896e=['hasOwnProperty','nolimit','order','sort','where','merge','filter','UserProfileResource','includeAll','include','findAll','rows','catch','keys','length','options','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','limit','set','Content-Range','json','reject','save','update','destroy','then','end','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0x896e,0x1e9));var _0xe896=function(_0x2a4ed5,_0x36f257){_0x2a4ed5=_0x2a4ed5-0x0;var _0xfcdd36=_0x896e[_0x2a4ed5];return _0xfcdd36;};'use strict';var emlformat=require(_0xe896('0x0'));var rimraf=require(_0xe896('0x1'));var zipdir=require(_0xe896('0x2'));var jsonpatch=require(_0xe896('0x3'));var rp=require(_0xe896('0x4'));var moment=require(_0xe896('0x5'));var BPromise=require(_0xe896('0x6'));var Mustache=require(_0xe896('0x7'));var util=require(_0xe896('0x8'));var path=require(_0xe896('0x9'));var sox=require(_0xe896('0xa'));var csv=require(_0xe896('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe896('0xc'));var _=require(_0xe896('0xd'));var squel=require(_0xe896('0xe'));var crypto=require(_0xe896('0xf'));var jsforce=require(_0xe896('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xe896('0xb'));var querystring=require(_0xe896('0x11'));var Papa=require(_0xe896('0x12'));var Redis=require('ioredis');var authService=require(_0xe896('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xe896('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe896('0x15'))(_0xe896('0x16'));var utils=require(_0xe896('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xe896('0x18'));var db=require(_0xe896('0x19'))['db'];function respondWithStatusCode(_0x3e8ac9,_0x580aac){_0x580aac=_0x580aac||0xcc;return function(_0x2aa522){if(_0x2aa522){return _0x3e8ac9[_0xe896('0x1a')](_0x580aac);}return _0x3e8ac9[_0xe896('0x1b')](_0x580aac)['end']();};}function respondWithResult(_0x2d0e46,_0x7dcf8a){_0x7dcf8a=_0x7dcf8a||0xc8;return function(_0x1e7ef8){if(_0x1e7ef8){return _0x2d0e46['status'](_0x7dcf8a)['json'](_0x1e7ef8);}};}function respondWithFilteredResult(_0x446ce2,_0x25606b){return function(_0x51e7b7){if(_0x51e7b7){var _0x5e78d6=typeof _0x25606b[_0xe896('0x1c')]===_0xe896('0x1d')&&typeof _0x25606b['limit']===_0xe896('0x1d');var _0x4e062a=_0x51e7b7[_0xe896('0x1e')];var _0x32f86d=_0x5e78d6?0x0:_0x25606b[_0xe896('0x1c')];var _0x5dc89d=_0x5e78d6?_0x51e7b7[_0xe896('0x1e')]:_0x25606b[_0xe896('0x1c')]+_0x25606b[_0xe896('0x1f')];var _0xbebbe1;if(_0x5dc89d>=_0x4e062a){_0x5dc89d=_0x4e062a;_0xbebbe1=0xc8;}else{_0xbebbe1=0xce;}_0x446ce2[_0xe896('0x1b')](_0xbebbe1);return _0x446ce2[_0xe896('0x20')](_0xe896('0x21'),_0x32f86d+'-'+_0x5dc89d+'/'+_0x4e062a)[_0xe896('0x22')](_0x51e7b7);}return null;};}function patchUpdates(_0x49547b){return function(_0x180d46){try{jsonpatch['apply'](_0x180d46,_0x49547b,!![]);}catch(_0x5d2c8d){return BPromise[_0xe896('0x23')](_0x5d2c8d);}return _0x180d46[_0xe896('0x24')]();};}function saveUpdates(_0x40502b,_0xeeec7c){return function(_0x498469){if(_0x498469){return _0x498469[_0xe896('0x25')](_0x40502b)['then'](function(_0x5001f7){return _0x5001f7;});}return null;};}function removeEntity(_0x45dd49,_0x41e689){return function(_0x1e952a){if(_0x1e952a){return _0x1e952a[_0xe896('0x26')]()[_0xe896('0x27')](function(){_0x45dd49[_0xe896('0x1b')](0xcc)[_0xe896('0x28')]();});}};}function handleEntityNotFound(_0x4b71cc,_0x390128){return function(_0x163a75){if(!_0x163a75){_0x4b71cc[_0xe896('0x1a')](0x194);}return _0x163a75;};}function handleError(_0x569d5f,_0x26635e){_0x26635e=_0x26635e||0x1f4;return function(_0xd50fe2){logger[_0xe896('0x29')](_0xd50fe2[_0xe896('0x2a')]);if(_0xd50fe2[_0xe896('0x2b')]){delete _0xd50fe2[_0xe896('0x2b')];}_0x569d5f['status'](_0x26635e)[_0xe896('0x2c')](_0xd50fe2);};}exports[_0xe896('0x2d')]=function(_0x201653,_0xbfb15b){var _0xace03f={},_0x5e0d9b={},_0x47c268={'count':0x0,'rows':[]};var _0x5c7dae=_['map'](db['UserProfileResource'][_0xe896('0x2e')],function(_0x29a18e){return{'name':_0x29a18e[_0xe896('0x2f')],'type':_0x29a18e[_0xe896('0x30')][_0xe896('0x31')]};});_0x5e0d9b[_0xe896('0x32')]=_[_0xe896('0x33')](_0x5c7dae,_0xe896('0x2b'));_0x5e0d9b['query']=_['keys'](_0x201653[_0xe896('0x34')]);_0x5e0d9b[_0xe896('0x35')]=_[_0xe896('0x36')](_0x5e0d9b[_0xe896('0x32')],_0x5e0d9b['query']);_0xace03f[_0xe896('0x37')]=_['intersection'](_0x5e0d9b['model'],qs[_0xe896('0x38')](_0x201653[_0xe896('0x34')][_0xe896('0x38')]));_0xace03f['attributes']=_0xace03f['attributes']['length']?_0xace03f[_0xe896('0x37')]:_0x5e0d9b[_0xe896('0x32')];if(!_0x201653[_0xe896('0x34')][_0xe896('0x39')](_0xe896('0x3a'))){_0xace03f['limit']=qs[_0xe896('0x1f')](_0x201653[_0xe896('0x34')][_0xe896('0x1f')]);_0xace03f[_0xe896('0x1c')]=qs[_0xe896('0x1c')](_0x201653[_0xe896('0x34')][_0xe896('0x1c')]);}_0xace03f[_0xe896('0x3b')]=qs['sort'](_0x201653[_0xe896('0x34')][_0xe896('0x3c')]);_0xace03f['where']=qs[_0xe896('0x35')](_['pick'](_0x201653[_0xe896('0x34')],_0x5e0d9b['filters']),_0x5c7dae);if(_0x201653[_0xe896('0x34')]['filter']){_0xace03f[_0xe896('0x3d')]=_[_0xe896('0x3e')](_0xace03f[_0xe896('0x3d')],{'$or':_[_0xe896('0x33')](_0x5c7dae,function(_0xeb9bbf){if(_0xeb9bbf['type']!=='VIRTUAL'){var _0x203aea={};_0x203aea[_0xeb9bbf[_0xe896('0x2b')]]={'$like':'%'+_0x201653[_0xe896('0x34')][_0xe896('0x3f')]+'%'};return _0x203aea;}})});}_0xace03f=_[_0xe896('0x3e')]({},_0xace03f,_0x201653['options']);var _0x5b8131={'where':_0xace03f[_0xe896('0x3d')]};return db[_0xe896('0x40')]['count'](_0x5b8131)['then'](function(_0x19d2fd){_0x47c268[_0xe896('0x1e')]=_0x19d2fd;if(_0x201653[_0xe896('0x34')][_0xe896('0x41')]){_0xace03f[_0xe896('0x42')]=[{'all':!![]}];}return db[_0xe896('0x40')][_0xe896('0x43')](_0xace03f);})[_0xe896('0x27')](function(_0x372c71){_0x47c268[_0xe896('0x44')]=_0x372c71;return _0x47c268;})[_0xe896('0x27')](respondWithFilteredResult(_0xbfb15b,_0xace03f))[_0xe896('0x45')](handleError(_0xbfb15b,null));};exports['show']=function(_0x1e5434,_0x143ad4){var _0x59b97f={'raw':![],'where':{'id':_0x1e5434['params']['id']}},_0x57366b={};_0x57366b[_0xe896('0x32')]=_[_0xe896('0x46')](db[_0xe896('0x40')]['rawAttributes']);_0x57366b[_0xe896('0x34')]=_[_0xe896('0x46')](_0x1e5434['query']);_0x57366b['filters']=_['intersection'](_0x57366b[_0xe896('0x32')],_0x57366b[_0xe896('0x34')]);_0x59b97f[_0xe896('0x37')]=_[_0xe896('0x36')](_0x57366b[_0xe896('0x32')],qs[_0xe896('0x38')](_0x1e5434['query'][_0xe896('0x38')]));_0x59b97f[_0xe896('0x37')]=_0x59b97f['attributes'][_0xe896('0x47')]?_0x59b97f[_0xe896('0x37')]:_0x57366b[_0xe896('0x32')];if(_0x1e5434[_0xe896('0x34')]['includeAll']){_0x59b97f[_0xe896('0x42')]=[{'all':!![]}];}_0x59b97f=_[_0xe896('0x3e')]({},_0x59b97f,_0x1e5434[_0xe896('0x48')]);return db[_0xe896('0x40')][_0xe896('0x49')](_0x59b97f)[_0xe896('0x27')](handleEntityNotFound(_0x143ad4,null))['then'](respondWithResult(_0x143ad4,null))[_0xe896('0x45')](handleError(_0x143ad4,null));};exports['create']=function(_0x234a22,_0x1c6ae1){return db[_0xe896('0x40')][_0xe896('0x4a')](_0x234a22[_0xe896('0x4b')],{})[_0xe896('0x27')](respondWithResult(_0x1c6ae1,0xc9))['catch'](handleError(_0x1c6ae1,null));};exports[_0xe896('0x25')]=function(_0x206ad3,_0x4818cd){if(_0x206ad3[_0xe896('0x4b')]['id']){delete _0x206ad3[_0xe896('0x4b')]['id'];}return db['UserProfileResource'][_0xe896('0x49')]({'where':{'id':_0x206ad3['params']['id']}})[_0xe896('0x27')](handleEntityNotFound(_0x4818cd,null))[_0xe896('0x27')](saveUpdates(_0x206ad3[_0xe896('0x4b')],null))[_0xe896('0x27')](respondWithResult(_0x4818cd,null))[_0xe896('0x45')](handleError(_0x4818cd,null));};exports['destroy']=function(_0x1fa3fd,_0x819c8a){return db[_0xe896('0x40')]['find']({'where':{'id':_0x1fa3fd[_0xe896('0x4c')]['id']}})['then'](handleEntityNotFound(_0x819c8a,null))['then'](removeEntity(_0x819c8a,null))[_0xe896('0x45')](handleError(_0x819c8a,null));};exports[_0xe896('0x4d')]=function(_0x57aed3,_0x343adb){return db[_0xe896('0x40')]['describe']()['then'](respondWithResult(_0x343adb,null))[_0xe896('0x45')](handleError(_0x343adb,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index dadebb1..3912573 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 _0x125c=['./userProfileResource.attributes','exports','define','user_profile_has_resources','compositeIndex','resourceId','lodash','../../config/logger','api','moment','path','../../config/environment'];(function(_0x368c07,_0x56ff70){var _0x46faf5=function(_0x471a49){while(--_0x471a49){_0x368c07['push'](_0x368c07['shift']());}};_0x46faf5(++_0x56ff70);}(_0x125c,0xde));var _0xc125=function(_0x17f712,_0x2abdcc){_0x17f712=_0x17f712-0x0;var _0x4dc149=_0x125c[_0x17f712];return _0x4dc149;};'use strict';var _=require(_0xc125('0x0'));var util=require('util');var logger=require(_0xc125('0x1'))(_0xc125('0x2'));var moment=require(_0xc125('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xc125('0x4'));var rimraf=require('rimraf');var config=require(_0xc125('0x5'));var attributes=require(_0xc125('0x6'));module[_0xc125('0x7')]=function(_0x26eac9,_0x3f233b){return _0x26eac9[_0xc125('0x8')]('UserProfileResource',attributes,{'tableName':_0xc125('0x9'),'paranoid':![],'indexes':[{'name':_0xc125('0xa'),'fields':[_0xc125('0xb'),'sectionId']}],'timestamps':!![]});}; \ No newline at end of file +var _0x5624=['../../config/environment','./userProfileResource.attributes','define','UserProfileResource','user_profile_has_resources','resourceId','sectionId','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x1110bb,_0x22e4c3){var _0x259864=function(_0x387305){while(--_0x387305){_0x1110bb['push'](_0x1110bb['shift']());}};_0x259864(++_0x22e4c3);}(_0x5624,0x106));var _0x4562=function(_0x121689,_0xfc6372){_0x121689=_0x121689-0x0;var _0x4ad7a5=_0x5624[_0x121689];return _0x4ad7a5;};'use strict';var _=require('lodash');var util=require(_0x4562('0x0'));var logger=require(_0x4562('0x1'))(_0x4562('0x2'));var moment=require(_0x4562('0x3'));var BPromise=require(_0x4562('0x4'));var rp=require(_0x4562('0x5'));var fs=require('fs');var path=require(_0x4562('0x6'));var rimraf=require(_0x4562('0x7'));var config=require(_0x4562('0x8'));var attributes=require(_0x4562('0x9'));module['exports']=function(_0x3de329,_0x1f3124){return _0x3de329[_0x4562('0xa')](_0x4562('0xb'),attributes,{'tableName':_0x4562('0xc'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0x4562('0xd'),_0x4562('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index 72b16b6..f3f56bc 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 _0x9c61=['../../config/environment','jayson/promise','client','http','then','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','error','code','UserProfileResource,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x635f3,_0x548483){var _0x1ecfc4=function(_0x47ea22){while(--_0x47ea22){_0x635f3['push'](_0x635f3['shift']());}};_0x1ecfc4(++_0x548483);}(_0x9c61,0x1d7));var _0x19c6=function(_0x1d2b66,_0x256c6e){_0x1d2b66=_0x1d2b66-0x0;var _0x445a66=_0x9c61[_0x1d2b66];return _0x445a66;};'use strict';var _=require(_0x19c6('0x0'));var util=require(_0x19c6('0x1'));var moment=require(_0x19c6('0x2'));var BPromise=require(_0x19c6('0x3'));var rs=require(_0x19c6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x19c6('0x5'))['db'];var utils=require(_0x19c6('0x6'));var logger=require(_0x19c6('0x7'))(_0x19c6('0x8'));var config=require(_0x19c6('0x9'));var jayson=require(_0x19c6('0xa'));var client=jayson[_0x19c6('0xb')][_0x19c6('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1eca92,_0x1c74d1,_0x597448){return new BPromise(function(_0x527192,_0x461cf8){return client['request'](_0x1eca92,_0x597448)[_0x19c6('0xd')](function(_0xd2af4e){logger['info']('UserProfileResource,\x20%s,\x20%s',_0x1c74d1,_0x19c6('0xe'));logger[_0x19c6('0xf')](_0x19c6('0x10'),_0x1c74d1,_0x19c6('0xe'),JSON['stringify'](_0xd2af4e));if(_0xd2af4e[_0x19c6('0x11')]){if(_0xd2af4e[_0x19c6('0x11')][_0x19c6('0x12')]===0x1f4){logger[_0x19c6('0x11')](_0x19c6('0x13'),_0x1c74d1,_0xd2af4e[_0x19c6('0x11')][_0x19c6('0x14')]);return _0x461cf8(_0xd2af4e[_0x19c6('0x11')][_0x19c6('0x14')]);}logger[_0x19c6('0x11')](_0x19c6('0x13'),_0x1c74d1,_0xd2af4e[_0x19c6('0x11')][_0x19c6('0x14')]);return _0x527192(_0xd2af4e['error'][_0x19c6('0x14')]);}else{logger[_0x19c6('0x15')]('UserProfileResource,\x20%s,\x20%s',_0x1c74d1,_0x19c6('0xe'));_0x527192(_0xd2af4e[_0x19c6('0x16')][_0x19c6('0x14')]);}})[_0x19c6('0x17')](function(_0x29d5ca){logger['error']('UserProfileResource,\x20%s,\x20%s',_0x1c74d1,_0x29d5ca);_0x461cf8(_0x29d5ca);});});} \ No newline at end of file +var _0x10c5=['then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request'];(function(_0x2d3ab3,_0x47d90b){var _0x321f9e=function(_0x50a53d){while(--_0x50a53d){_0x2d3ab3['push'](_0x2d3ab3['shift']());}};_0x321f9e(++_0x47d90b);}(_0x10c5,0xfd));var _0x510c=function(_0x5793c6,_0x56464a){_0x5793c6=_0x5793c6-0x0;var _0x37f876=_0x10c5[_0x5793c6];return _0x37f876;};'use strict';var _=require(_0x510c('0x0'));var util=require(_0x510c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x510c('0x2'));var fs=require('fs');var Redis=require(_0x510c('0x3'));var db=require(_0x510c('0x4'))['db'];var utils=require(_0x510c('0x5'));var logger=require('../../config/logger')(_0x510c('0x6'));var config=require(_0x510c('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x510c('0x8')][_0x510c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5afe28,_0x2025bd,_0x261c10){return new BPromise(function(_0x1e3827,_0xc8a520){return client[_0x510c('0xa')](_0x5afe28,_0x261c10)[_0x510c('0xb')](function(_0x48e99a){logger[_0x510c('0xc')](_0x510c('0xd'),_0x2025bd,_0x510c('0xe'));logger[_0x510c('0xf')](_0x510c('0x10'),_0x2025bd,_0x510c('0xe'),JSON[_0x510c('0x11')](_0x48e99a));if(_0x48e99a[_0x510c('0x12')]){if(_0x48e99a[_0x510c('0x12')]['code']===0x1f4){logger[_0x510c('0x12')](_0x510c('0xd'),_0x2025bd,_0x48e99a['error'][_0x510c('0x13')]);return _0xc8a520(_0x48e99a[_0x510c('0x12')]['message']);}logger[_0x510c('0x12')]('UserProfileResource,\x20%s,\x20%s',_0x2025bd,_0x48e99a[_0x510c('0x12')][_0x510c('0x13')]);return _0x1e3827(_0x48e99a[_0x510c('0x12')][_0x510c('0x13')]);}else{logger[_0x510c('0xc')]('UserProfileResource,\x20%s,\x20%s',_0x2025bd,_0x510c('0xe'));_0x1e3827(_0x48e99a[_0x510c('0x14')][_0x510c('0x13')]);}})[_0x510c('0x15')](function(_0x5954bf){logger[_0x510c('0x12')](_0x510c('0xd'),_0x2025bd,_0x5954bf);_0xc8a520(_0x5954bf);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index 781d3c6..e46ac6a 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 _0x1a6d=['exports','util','path','express','../../components/auth/service','../../config/environment','./userProfileSection.controller','isAuthenticated','index','get','/describe','describe','show','post','create','update','delete','/:id','destroy'];(function(_0xd09668,_0x1435b2){var _0x68726=function(_0x54a030){while(--_0x54a030){_0xd09668['push'](_0xd09668['shift']());}};_0x68726(++_0x1435b2);}(_0x1a6d,0x16a));var _0xd1a6=function(_0x48c10a,_0x49348e){_0x48c10a=_0x48c10a-0x0;var _0x269fe0=_0x1a6d[_0x48c10a];return _0x269fe0;};'use strict';var multer=require('multer');var util=require(_0xd1a6('0x0'));var path=require(_0xd1a6('0x1'));var timeout=require('connect-timeout');var express=require(_0xd1a6('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xd1a6('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xd1a6('0x4'));var controller=require(_0xd1a6('0x5'));router['get']('/',auth[_0xd1a6('0x6')](),controller[_0xd1a6('0x7')]);router[_0xd1a6('0x8')](_0xd1a6('0x9'),auth[_0xd1a6('0x6')](),controller[_0xd1a6('0xa')]);router[_0xd1a6('0x8')]('/:id',auth[_0xd1a6('0x6')](),controller[_0xd1a6('0xb')]);router[_0xd1a6('0xc')]('/',auth[_0xd1a6('0x6')](),controller[_0xd1a6('0xd')]);router['put']('/:id',auth[_0xd1a6('0x6')](),controller[_0xd1a6('0xe')]);router[_0xd1a6('0xf')](_0xd1a6('0x10'),auth[_0xd1a6('0x6')](),controller[_0xd1a6('0x11')]);module[_0xd1a6('0x12')]=router; \ No newline at end of file +var _0xe709=['/describe','isAuthenticated','show','create','put','/:id','destroy','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./userProfileSection.controller','get','index'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe709,0x1ca));var _0x9e70=function(_0x16b0e4,_0x3c1f0c){_0x16b0e4=_0x16b0e4-0x0;var _0x1949f3=_0xe709[_0x16b0e4];return _0x1949f3;};'use strict';var multer=require(_0x9e70('0x0'));var util=require('util');var path=require(_0x9e70('0x1'));var timeout=require(_0x9e70('0x2'));var express=require(_0x9e70('0x3'));var router=express[_0x9e70('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x9e70('0x5'));var config=require(_0x9e70('0x6'));var controller=require(_0x9e70('0x7'));router[_0x9e70('0x8')]('/',auth['isAuthenticated'](),controller[_0x9e70('0x9')]);router[_0x9e70('0x8')](_0x9e70('0xa'),auth[_0x9e70('0xb')](),controller['describe']);router['get']('/:id',auth[_0x9e70('0xb')](),controller[_0x9e70('0xc')]);router['post']('/',auth[_0x9e70('0xb')](),controller[_0x9e70('0xd')]);router[_0x9e70('0xe')](_0x9e70('0xf'),auth[_0x9e70('0xb')](),controller['update']);router['delete'](_0x9e70('0xf'),auth[_0x9e70('0xb')](),controller[_0x9e70('0x10')]);module[_0x9e70('0x11')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index 973a2c6..c6f3040 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 _0xc900=['join','getDataValue','split','STRING','INTEGER','BOOLEAN','setDataValue','crudPermissions'];(function(_0x3de8a4,_0x289a5c){var _0x4635cf=function(_0x2bddb8){while(--_0x2bddb8){_0x3de8a4['push'](_0x3de8a4['shift']());}};_0x4635cf(++_0x289a5c);}(_0xc900,0xb3));var _0x0c90=function(_0x2c196c,_0x15eda6){_0x2c196c=_0x2c196c-0x0;var _0x276760=_0xc900[_0x2c196c];return _0x276760;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x0c90('0x0')],'allowNull':![]},'category':{'type':Sequelize[_0x0c90('0x0')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x0c90('0x1')],'allowNull':![]},'enabled':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x0c90('0x2')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x0c90('0x0')],'set':function(_0x492f22){this[_0x0c90('0x3')](_0x0c90('0x4'),_0x492f22?_0x492f22[_0x0c90('0x5')](''):[]);},'get':function(){return this[_0x0c90('0x6')](_0x0c90('0x4'))?this[_0x0c90('0x6')]('crudPermissions')[_0x0c90('0x7')](''):[];}}}; \ No newline at end of file +var _0x373d=['STRING','INTEGER','BOOLEAN','setDataValue','getDataValue','crudPermissions','sequelize'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0x373d,0x1e2));var _0xd373=function(_0x55b3b5,_0x254983){_0x55b3b5=_0x55b3b5-0x0;var _0x5297a9=_0x373d[_0x55b3b5];return _0x5297a9;};'use strict';var Sequelize=require(_0xd373('0x0'));module['exports']={'name':{'type':Sequelize[_0xd373('0x1')],'allowNull':![]},'category':{'type':Sequelize[_0xd373('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize[_0xd373('0x2')],'allowNull':![]},'enabled':{'type':Sequelize[_0xd373('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0xd373('0x1')],'set':function(_0x547fca){this[_0xd373('0x4')]('crudPermissions',_0x547fca?_0x547fca['join'](''):[]);},'get':function(){return this[_0xd373('0x5')](_0xd373('0x6'))?this[_0xd373('0x5')](_0xd373('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 55e71ac..07a1e0f 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 _0x1250=['to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','then','sendStatus','error','stack','name','index','map','UserProfileSection','fieldName','key','model','keys','query','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','type','VIRTUAL','merge','options','include','findAll','rows','catch','params','rawAttributes','intersection','find','create','body','describe','rimraf','request-promise','mustache','util'];(function(_0x317943,_0x1a4079){var _0x5a578e=function(_0x38e9a6){while(--_0x38e9a6){_0x317943['push'](_0x317943['shift']());}};_0x5a578e(++_0x1a4079);}(_0x1250,0x8a));var _0x0125=function(_0x1185fe,_0x4fc0b4){_0x1185fe=_0x1185fe-0x0;var _0xcecc1e=_0x1250[_0x1185fe];return _0xcecc1e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0125('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0125('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x0125('0x2'));var util=require(_0x0125('0x3'));var path=require('path');var sox=require('sox');var csv=require(_0x0125('0x4'));var ejs=require(_0x0125('0x5'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0125('0x6'));var squel=require(_0x0125('0x7'));var crypto=require(_0x0125('0x8'));var jsforce=require(_0x0125('0x9'));var deskjs=require(_0x0125('0xa'));var toCsv=require(_0x0125('0x4'));var querystring=require('querystring');var Papa=require(_0x0125('0xb'));var Redis=require(_0x0125('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x0125('0xd'));var as=require(_0x0125('0xe'));var hardwareService=require(_0x0125('0xf'));var logger=require(_0x0125('0x10'))(_0x0125('0x11'));var utils=require(_0x0125('0x12'));var config=require(_0x0125('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x0125('0x14'))['db'];function respondWithStatusCode(_0x206ba2,_0x288740){_0x288740=_0x288740||0xcc;return function(_0xa4e09b){if(_0xa4e09b){return _0x206ba2['sendStatus'](_0x288740);}return _0x206ba2[_0x0125('0x15')](_0x288740)[_0x0125('0x16')]();};}function respondWithResult(_0x566445,_0x49bfa){_0x49bfa=_0x49bfa||0xc8;return function(_0x1693a4){if(_0x1693a4){return _0x566445[_0x0125('0x15')](_0x49bfa)['json'](_0x1693a4);}};}function respondWithFilteredResult(_0x5ad75e,_0x54e0cd){return function(_0x3061a0){if(_0x3061a0){var _0x29c1f8=typeof _0x54e0cd[_0x0125('0x17')]==='undefined'&&typeof _0x54e0cd[_0x0125('0x18')]===_0x0125('0x19');var _0x4794ff=_0x3061a0[_0x0125('0x1a')];var _0x5b5fcd=_0x29c1f8?0x0:_0x54e0cd[_0x0125('0x17')];var _0x3340b1=_0x29c1f8?_0x3061a0['count']:_0x54e0cd[_0x0125('0x17')]+_0x54e0cd[_0x0125('0x18')];var _0x5339d1;if(_0x3340b1>=_0x4794ff){_0x3340b1=_0x4794ff;_0x5339d1=0xc8;}else{_0x5339d1=0xce;}_0x5ad75e[_0x0125('0x15')](_0x5339d1);return _0x5ad75e[_0x0125('0x1b')](_0x0125('0x1c'),_0x5b5fcd+'-'+_0x3340b1+'/'+_0x4794ff)[_0x0125('0x1d')](_0x3061a0);}return null;};}function patchUpdates(_0xcc92aa){return function(_0x3c98eb){try{jsonpatch[_0x0125('0x1e')](_0x3c98eb,_0xcc92aa,!![]);}catch(_0xeb29ab){return BPromise[_0x0125('0x1f')](_0xeb29ab);}return _0x3c98eb[_0x0125('0x20')]();};}function saveUpdates(_0x2b70c1,_0x3e3273){return function(_0x766ecc){if(_0x766ecc){return _0x766ecc['update'](_0x2b70c1)[_0x0125('0x21')](function(_0x14d9db){return _0x14d9db;});}return null;};}function removeEntity(_0x23967b,_0x35a21c){return function(_0x51d07d){if(_0x51d07d){return _0x51d07d['destroy']()[_0x0125('0x21')](function(){_0x23967b[_0x0125('0x15')](0xcc)[_0x0125('0x16')]();});}};}function handleEntityNotFound(_0xa2f0c6,_0x517793){return function(_0x2aa0da){if(!_0x2aa0da){_0xa2f0c6[_0x0125('0x22')](0x194);}return _0x2aa0da;};}function handleError(_0x414f07,_0x472fd4){_0x472fd4=_0x472fd4||0x1f4;return function(_0x4a48d8){logger[_0x0125('0x23')](_0x4a48d8[_0x0125('0x24')]);if(_0x4a48d8[_0x0125('0x25')]){delete _0x4a48d8[_0x0125('0x25')];}_0x414f07[_0x0125('0x15')](_0x472fd4)['send'](_0x4a48d8);};}exports[_0x0125('0x26')]=function(_0x15de5c,_0x29cf84){var _0x4cc5ee={},_0x39024c={},_0x218a0f={'count':0x0,'rows':[]};var _0x26d614=_[_0x0125('0x27')](db[_0x0125('0x28')]['rawAttributes'],function(_0x5445e7){return{'name':_0x5445e7[_0x0125('0x29')],'type':_0x5445e7['type'][_0x0125('0x2a')]};});_0x39024c[_0x0125('0x2b')]=_[_0x0125('0x27')](_0x26d614,_0x0125('0x25'));_0x39024c['query']=_[_0x0125('0x2c')](_0x15de5c[_0x0125('0x2d')]);_0x39024c[_0x0125('0x2e')]=_['intersection'](_0x39024c[_0x0125('0x2b')],_0x39024c['query']);_0x4cc5ee[_0x0125('0x2f')]=_['intersection'](_0x39024c[_0x0125('0x2b')],qs[_0x0125('0x30')](_0x15de5c[_0x0125('0x2d')]['fields']));_0x4cc5ee[_0x0125('0x2f')]=_0x4cc5ee[_0x0125('0x2f')][_0x0125('0x31')]?_0x4cc5ee['attributes']:_0x39024c['model'];if(!_0x15de5c[_0x0125('0x2d')][_0x0125('0x32')](_0x0125('0x33'))){_0x4cc5ee[_0x0125('0x18')]=qs[_0x0125('0x18')](_0x15de5c['query']['limit']);_0x4cc5ee[_0x0125('0x17')]=qs[_0x0125('0x17')](_0x15de5c[_0x0125('0x2d')][_0x0125('0x17')]);}_0x4cc5ee['order']=qs[_0x0125('0x34')](_0x15de5c[_0x0125('0x2d')][_0x0125('0x34')]);_0x4cc5ee['where']=qs['filters'](_[_0x0125('0x35')](_0x15de5c['query'],_0x39024c[_0x0125('0x2e')]),_0x26d614);if(_0x15de5c[_0x0125('0x2d')][_0x0125('0x36')]){_0x4cc5ee[_0x0125('0x37')]=_['merge'](_0x4cc5ee['where'],{'$or':_[_0x0125('0x27')](_0x26d614,function(_0x4e607b){if(_0x4e607b[_0x0125('0x38')]!==_0x0125('0x39')){var _0x147b85={};_0x147b85[_0x4e607b[_0x0125('0x25')]]={'$like':'%'+_0x15de5c[_0x0125('0x2d')][_0x0125('0x36')]+'%'};return _0x147b85;}})});}_0x4cc5ee=_[_0x0125('0x3a')]({},_0x4cc5ee,_0x15de5c[_0x0125('0x3b')]);var _0x3f34e5={'where':_0x4cc5ee[_0x0125('0x37')]};return db[_0x0125('0x28')][_0x0125('0x1a')](_0x3f34e5)[_0x0125('0x21')](function(_0x303db0){_0x218a0f[_0x0125('0x1a')]=_0x303db0;if(_0x15de5c[_0x0125('0x2d')]['includeAll']){_0x4cc5ee[_0x0125('0x3c')]=[{'all':!![]}];}return db[_0x0125('0x28')][_0x0125('0x3d')](_0x4cc5ee);})[_0x0125('0x21')](function(_0x4b13e7){_0x218a0f[_0x0125('0x3e')]=_0x4b13e7;return _0x218a0f;})[_0x0125('0x21')](respondWithFilteredResult(_0x29cf84,_0x4cc5ee))[_0x0125('0x3f')](handleError(_0x29cf84,null));};exports['show']=function(_0x2c202d,_0x474edb){var _0x4fff77={'raw':![],'where':{'id':_0x2c202d[_0x0125('0x40')]['id']}},_0x4c3894={};_0x4c3894[_0x0125('0x2b')]=_[_0x0125('0x2c')](db[_0x0125('0x28')][_0x0125('0x41')]);_0x4c3894[_0x0125('0x2d')]=_[_0x0125('0x2c')](_0x2c202d[_0x0125('0x2d')]);_0x4c3894[_0x0125('0x2e')]=_[_0x0125('0x42')](_0x4c3894[_0x0125('0x2b')],_0x4c3894[_0x0125('0x2d')]);_0x4fff77[_0x0125('0x2f')]=_[_0x0125('0x42')](_0x4c3894[_0x0125('0x2b')],qs[_0x0125('0x30')](_0x2c202d[_0x0125('0x2d')][_0x0125('0x30')]));_0x4fff77[_0x0125('0x2f')]=_0x4fff77[_0x0125('0x2f')][_0x0125('0x31')]?_0x4fff77['attributes']:_0x4c3894[_0x0125('0x2b')];if(_0x2c202d[_0x0125('0x2d')]['includeAll']){_0x4fff77[_0x0125('0x3c')]=[{'all':!![]}];}_0x4fff77=_[_0x0125('0x3a')]({},_0x4fff77,_0x2c202d['options']);return db[_0x0125('0x28')][_0x0125('0x43')](_0x4fff77)['then'](handleEntityNotFound(_0x474edb,null))['then'](respondWithResult(_0x474edb,null))[_0x0125('0x3f')](handleError(_0x474edb,null));};exports['create']=function(_0xe5e97e,_0xca2ec6){return db['UserProfileSection'][_0x0125('0x44')](_0xe5e97e['body'],{})['then'](respondWithResult(_0xca2ec6,0xc9))[_0x0125('0x3f')](handleError(_0xca2ec6,null));};exports['update']=function(_0x41f50f,_0x2cef54){if(_0x41f50f[_0x0125('0x45')]['id']){delete _0x41f50f[_0x0125('0x45')]['id'];}return db[_0x0125('0x28')][_0x0125('0x43')]({'where':{'id':_0x41f50f[_0x0125('0x40')]['id']}})[_0x0125('0x21')](handleEntityNotFound(_0x2cef54,null))['then'](saveUpdates(_0x41f50f[_0x0125('0x45')],null))['then'](respondWithResult(_0x2cef54,null))[_0x0125('0x3f')](handleError(_0x2cef54,null));};exports['destroy']=function(_0x5d6185,_0x41915a){return db[_0x0125('0x28')][_0x0125('0x43')]({'where':{'id':_0x5d6185[_0x0125('0x40')]['id']}})[_0x0125('0x21')](handleEntityNotFound(_0x41915a,null))[_0x0125('0x21')](removeEntity(_0x41915a,null))[_0x0125('0x3f')](handleError(_0x41915a,null));};exports[_0x0125('0x46')]=function(_0x3581fb,_0x4ffc68){return db['UserProfileSection']['describe']()[_0x0125('0x21')](respondWithResult(_0x4ffc68,null))['catch'](handleError(_0x4ffc68,null));}; \ No newline at end of file +var _0xe85f=['name','index','UserProfileSection','fieldName','type','model','query','keys','filters','intersection','attributes','nolimit','sort','where','pick','map','VIRTUAL','filter','merge','options','includeAll','findAll','show','fields','include','catch','create','body','params','destroy','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','update','then','end','stack'];(function(_0x259b36,_0x444eeb){var _0x5ef06b=function(_0x1d7028){while(--_0x1d7028){_0x259b36['push'](_0x259b36['shift']());}};_0x5ef06b(++_0x444eeb);}(_0xe85f,0x138));var _0xfe85=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0xe85f[_0x25e7cb];return _0x375d92;};'use strict';var emlformat=require(_0xfe85('0x0'));var rimraf=require(_0xfe85('0x1'));var zipdir=require(_0xfe85('0x2'));var jsonpatch=require(_0xfe85('0x3'));var rp=require(_0xfe85('0x4'));var moment=require(_0xfe85('0x5'));var BPromise=require(_0xfe85('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xfe85('0x7'));var sox=require(_0xfe85('0x8'));var csv=require(_0xfe85('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfe85('0xa'));var squel=require('squel');var crypto=require(_0xfe85('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xfe85('0xc'));var toCsv=require(_0xfe85('0x9'));var querystring=require(_0xfe85('0xd'));var Papa=require(_0xfe85('0xe'));var Redis=require('ioredis');var authService=require(_0xfe85('0xf'));var qs=require(_0xfe85('0x10'));var as=require(_0xfe85('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfe85('0x12'))(_0xfe85('0x13'));var utils=require(_0xfe85('0x14'));var config=require(_0xfe85('0x15'));var licenseUtil=require(_0xfe85('0x16'));var db=require(_0xfe85('0x17'))['db'];function respondWithStatusCode(_0x56e7f6,_0x5a1ab9){_0x5a1ab9=_0x5a1ab9||0xcc;return function(_0x76b55f){if(_0x76b55f){return _0x56e7f6['sendStatus'](_0x5a1ab9);}return _0x56e7f6[_0xfe85('0x18')](_0x5a1ab9)['end']();};}function respondWithResult(_0x55bff7,_0x191464){_0x191464=_0x191464||0xc8;return function(_0x4c5495){if(_0x4c5495){return _0x55bff7['status'](_0x191464)['json'](_0x4c5495);}};}function respondWithFilteredResult(_0x4950b5,_0x2e4743){return function(_0xaa576c){if(_0xaa576c){var _0x2147be=typeof _0x2e4743[_0xfe85('0x19')]==='undefined'&&typeof _0x2e4743[_0xfe85('0x1a')]===_0xfe85('0x1b');var _0x803381=_0xaa576c[_0xfe85('0x1c')];var _0x4c7d29=_0x2147be?0x0:_0x2e4743[_0xfe85('0x19')];var _0x406464=_0x2147be?_0xaa576c[_0xfe85('0x1c')]:_0x2e4743['offset']+_0x2e4743['limit'];var _0x219585;if(_0x406464>=_0x803381){_0x406464=_0x803381;_0x219585=0xc8;}else{_0x219585=0xce;}_0x4950b5[_0xfe85('0x18')](_0x219585);return _0x4950b5[_0xfe85('0x1d')](_0xfe85('0x1e'),_0x4c7d29+'-'+_0x406464+'/'+_0x803381)[_0xfe85('0x1f')](_0xaa576c);}return null;};}function patchUpdates(_0x272aba){return function(_0x5be03f){try{jsonpatch[_0xfe85('0x20')](_0x5be03f,_0x272aba,!![]);}catch(_0x299123){return BPromise[_0xfe85('0x21')](_0x299123);}return _0x5be03f['save']();};}function saveUpdates(_0x323785,_0x51a1a1){return function(_0x32e4ee){if(_0x32e4ee){return _0x32e4ee[_0xfe85('0x22')](_0x323785)['then'](function(_0x299212){return _0x299212;});}return null;};}function removeEntity(_0xd52e52,_0x4249c9){return function(_0x545da3){if(_0x545da3){return _0x545da3['destroy']()[_0xfe85('0x23')](function(){_0xd52e52[_0xfe85('0x18')](0xcc)[_0xfe85('0x24')]();});}};}function handleEntityNotFound(_0x26a880,_0x2a7eb8){return function(_0x49e462){if(!_0x49e462){_0x26a880['sendStatus'](0x194);}return _0x49e462;};}function handleError(_0x267880,_0x16af7d){_0x16af7d=_0x16af7d||0x1f4;return function(_0x167b8c){logger['error'](_0x167b8c[_0xfe85('0x25')]);if(_0x167b8c['name']){delete _0x167b8c[_0xfe85('0x26')];}_0x267880[_0xfe85('0x18')](_0x16af7d)['send'](_0x167b8c);};}exports[_0xfe85('0x27')]=function(_0x40b5b8,_0x4f570a){var _0x1adde7={},_0x3683f2={},_0x5e8ee3={'count':0x0,'rows':[]};var _0x3dae6d=_['map'](db[_0xfe85('0x28')]['rawAttributes'],function(_0x50add4){return{'name':_0x50add4[_0xfe85('0x29')],'type':_0x50add4[_0xfe85('0x2a')]['key']};});_0x3683f2[_0xfe85('0x2b')]=_['map'](_0x3dae6d,_0xfe85('0x26'));_0x3683f2[_0xfe85('0x2c')]=_[_0xfe85('0x2d')](_0x40b5b8[_0xfe85('0x2c')]);_0x3683f2[_0xfe85('0x2e')]=_[_0xfe85('0x2f')](_0x3683f2[_0xfe85('0x2b')],_0x3683f2[_0xfe85('0x2c')]);_0x1adde7[_0xfe85('0x30')]=_['intersection'](_0x3683f2[_0xfe85('0x2b')],qs['fields'](_0x40b5b8[_0xfe85('0x2c')]['fields']));_0x1adde7['attributes']=_0x1adde7['attributes']['length']?_0x1adde7[_0xfe85('0x30')]:_0x3683f2[_0xfe85('0x2b')];if(!_0x40b5b8[_0xfe85('0x2c')]['hasOwnProperty'](_0xfe85('0x31'))){_0x1adde7[_0xfe85('0x1a')]=qs[_0xfe85('0x1a')](_0x40b5b8[_0xfe85('0x2c')][_0xfe85('0x1a')]);_0x1adde7['offset']=qs[_0xfe85('0x19')](_0x40b5b8[_0xfe85('0x2c')][_0xfe85('0x19')]);}_0x1adde7['order']=qs[_0xfe85('0x32')](_0x40b5b8[_0xfe85('0x2c')][_0xfe85('0x32')]);_0x1adde7[_0xfe85('0x33')]=qs[_0xfe85('0x2e')](_[_0xfe85('0x34')](_0x40b5b8['query'],_0x3683f2[_0xfe85('0x2e')]),_0x3dae6d);if(_0x40b5b8[_0xfe85('0x2c')]['filter']){_0x1adde7['where']=_['merge'](_0x1adde7[_0xfe85('0x33')],{'$or':_[_0xfe85('0x35')](_0x3dae6d,function(_0x276942){if(_0x276942[_0xfe85('0x2a')]!==_0xfe85('0x36')){var _0x1852ef={};_0x1852ef[_0x276942[_0xfe85('0x26')]]={'$like':'%'+_0x40b5b8[_0xfe85('0x2c')][_0xfe85('0x37')]+'%'};return _0x1852ef;}})});}_0x1adde7=_[_0xfe85('0x38')]({},_0x1adde7,_0x40b5b8[_0xfe85('0x39')]);var _0x28b0e0={'where':_0x1adde7[_0xfe85('0x33')]};return db[_0xfe85('0x28')][_0xfe85('0x1c')](_0x28b0e0)[_0xfe85('0x23')](function(_0x3c224c){_0x5e8ee3[_0xfe85('0x1c')]=_0x3c224c;if(_0x40b5b8[_0xfe85('0x2c')][_0xfe85('0x3a')]){_0x1adde7['include']=[{'all':!![]}];}return db[_0xfe85('0x28')][_0xfe85('0x3b')](_0x1adde7);})[_0xfe85('0x23')](function(_0x19715f){_0x5e8ee3['rows']=_0x19715f;return _0x5e8ee3;})[_0xfe85('0x23')](respondWithFilteredResult(_0x4f570a,_0x1adde7))['catch'](handleError(_0x4f570a,null));};exports[_0xfe85('0x3c')]=function(_0x1bd356,_0x2707d1){var _0x15dfb4={'raw':![],'where':{'id':_0x1bd356['params']['id']}},_0x2d6721={};_0x2d6721['model']=_[_0xfe85('0x2d')](db[_0xfe85('0x28')]['rawAttributes']);_0x2d6721[_0xfe85('0x2c')]=_[_0xfe85('0x2d')](_0x1bd356[_0xfe85('0x2c')]);_0x2d6721['filters']=_[_0xfe85('0x2f')](_0x2d6721[_0xfe85('0x2b')],_0x2d6721[_0xfe85('0x2c')]);_0x15dfb4[_0xfe85('0x30')]=_[_0xfe85('0x2f')](_0x2d6721['model'],qs['fields'](_0x1bd356[_0xfe85('0x2c')][_0xfe85('0x3d')]));_0x15dfb4['attributes']=_0x15dfb4[_0xfe85('0x30')]['length']?_0x15dfb4[_0xfe85('0x30')]:_0x2d6721[_0xfe85('0x2b')];if(_0x1bd356[_0xfe85('0x2c')]['includeAll']){_0x15dfb4[_0xfe85('0x3e')]=[{'all':!![]}];}_0x15dfb4=_[_0xfe85('0x38')]({},_0x15dfb4,_0x1bd356[_0xfe85('0x39')]);return db[_0xfe85('0x28')]['find'](_0x15dfb4)[_0xfe85('0x23')](handleEntityNotFound(_0x2707d1,null))[_0xfe85('0x23')](respondWithResult(_0x2707d1,null))[_0xfe85('0x3f')](handleError(_0x2707d1,null));};exports[_0xfe85('0x40')]=function(_0x34754a,_0x4fe85a){return db[_0xfe85('0x28')][_0xfe85('0x40')](_0x34754a[_0xfe85('0x41')],{})['then'](respondWithResult(_0x4fe85a,0xc9))[_0xfe85('0x3f')](handleError(_0x4fe85a,null));};exports[_0xfe85('0x22')]=function(_0x22f4ce,_0x2b6b9b){if(_0x22f4ce[_0xfe85('0x41')]['id']){delete _0x22f4ce['body']['id'];}return db['UserProfileSection']['find']({'where':{'id':_0x22f4ce[_0xfe85('0x42')]['id']}})['then'](handleEntityNotFound(_0x2b6b9b,null))[_0xfe85('0x23')](saveUpdates(_0x22f4ce['body'],null))[_0xfe85('0x23')](respondWithResult(_0x2b6b9b,null))[_0xfe85('0x3f')](handleError(_0x2b6b9b,null));};exports[_0xfe85('0x43')]=function(_0x555608,_0x39b782){return db['UserProfileSection'][_0xfe85('0x44')]({'where':{'id':_0x555608[_0xfe85('0x42')]['id']}})[_0xfe85('0x23')](handleEntityNotFound(_0x39b782,null))[_0xfe85('0x23')](removeEntity(_0x39b782,null))[_0xfe85('0x3f')](handleError(_0x39b782,null));};exports[_0xfe85('0x45')]=function(_0x39cf18,_0x50c1c0){return db[_0xfe85('0x28')][_0xfe85('0x45')]()[_0xfe85('0x23')](respondWithResult(_0x50c1c0,null))[_0xfe85('0x3f')](handleError(_0x50c1c0,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index d5a7691..a861cf6 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 _0xb722=['bluebird','path','rimraf','./userProfileSection.attributes','exports','define','UserProfileSection','compositeIndex','sectionId','userProfileId','lodash','util','moment'];(function(_0xe4c512,_0xa1072c){var _0xb8183c=function(_0x4b43cb){while(--_0x4b43cb){_0xe4c512['push'](_0xe4c512['shift']());}};_0xb8183c(++_0xa1072c);}(_0xb722,0xda));var _0x2b72=function(_0x28a23c,_0x3d4901){_0x28a23c=_0x28a23c-0x0;var _0x489a5b=_0xb722[_0x28a23c];return _0x489a5b;};'use strict';var _=require(_0x2b72('0x0'));var util=require(_0x2b72('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x2b72('0x2'));var BPromise=require(_0x2b72('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2b72('0x4'));var rimraf=require(_0x2b72('0x5'));var config=require('../../config/environment');var attributes=require(_0x2b72('0x6'));module[_0x2b72('0x7')]=function(_0x55c7ec,_0x113c87){return _0x55c7ec[_0x2b72('0x8')](_0x2b72('0x9'),attributes,{'tableName':'user_profile_has_sections','paranoid':![],'indexes':[{'name':_0x2b72('0xa'),'fields':[_0x2b72('0xb'),_0x2b72('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xaa2c=['compositeIndex','sectionId','userProfileId','lodash','util','../../config/logger','bluebird','request-promise','rimraf','./userProfileSection.attributes','exports','define','UserProfileSection','user_profile_has_sections'];(function(_0x2e2681,_0x4089c1){var _0x368a64=function(_0x267262){while(--_0x267262){_0x2e2681['push'](_0x2e2681['shift']());}};_0x368a64(++_0x4089c1);}(_0xaa2c,0x1d1));var _0xcaa2=function(_0x8c3a3d,_0x5b2d9b){_0x8c3a3d=_0x8c3a3d-0x0;var _0x5b50b9=_0xaa2c[_0x8c3a3d];return _0x5b50b9;};'use strict';var _=require(_0xcaa2('0x0'));var util=require(_0xcaa2('0x1'));var logger=require(_0xcaa2('0x2'))('api');var moment=require('moment');var BPromise=require(_0xcaa2('0x3'));var rp=require(_0xcaa2('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcaa2('0x5'));var config=require('../../config/environment');var attributes=require(_0xcaa2('0x6'));module[_0xcaa2('0x7')]=function(_0x37afcf,_0x5ab9ec){return _0x37afcf[_0xcaa2('0x8')](_0xcaa2('0x9'),attributes,{'tableName':_0xcaa2('0xa'),'paranoid':![],'indexes':[{'name':_0xcaa2('0xb'),'fields':[_0xcaa2('0xc'),_0xcaa2('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index 2542d25..74b2546 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 _0xe3d7=['catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0xe3d7,0x109));var _0x7e3d=function(_0xff7090,_0x298d0c){_0xff7090=_0xff7090-0x0;var _0x225b6e=_0xe3d7[_0xff7090];return _0x225b6e;};'use strict';var _=require('lodash');var util=require(_0x7e3d('0x0'));var moment=require(_0x7e3d('0x1'));var BPromise=require(_0x7e3d('0x2'));var rs=require(_0x7e3d('0x3'));var fs=require('fs');var Redis=require(_0x7e3d('0x4'));var db=require(_0x7e3d('0x5'))['db'];var utils=require(_0x7e3d('0x6'));var logger=require('../../config/logger')(_0x7e3d('0x7'));var config=require(_0x7e3d('0x8'));var jayson=require(_0x7e3d('0x9'));var client=jayson[_0x7e3d('0xa')][_0x7e3d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x351a6c,_0x3d1cc9,_0x688b93){return new BPromise(function(_0x200ce0,_0x3917bd){return client['request'](_0x351a6c,_0x688b93)[_0x7e3d('0xc')](function(_0x55701f){logger[_0x7e3d('0xd')](_0x7e3d('0xe'),_0x3d1cc9,_0x7e3d('0xf'));logger[_0x7e3d('0x10')](_0x7e3d('0x11'),_0x3d1cc9,_0x7e3d('0xf'),JSON[_0x7e3d('0x12')](_0x55701f));if(_0x55701f[_0x7e3d('0x13')]){if(_0x55701f[_0x7e3d('0x13')][_0x7e3d('0x14')]===0x1f4){logger['error'](_0x7e3d('0xe'),_0x3d1cc9,_0x55701f[_0x7e3d('0x13')][_0x7e3d('0x15')]);return _0x3917bd(_0x55701f[_0x7e3d('0x13')]['message']);}logger['error']('UserProfileSection,\x20%s,\x20%s',_0x3d1cc9,_0x55701f[_0x7e3d('0x13')]['message']);return _0x200ce0(_0x55701f[_0x7e3d('0x13')]['message']);}else{logger[_0x7e3d('0xd')](_0x7e3d('0xe'),_0x3d1cc9,_0x7e3d('0xf'));_0x200ce0(_0x55701f[_0x7e3d('0x16')]['message']);}})[_0x7e3d('0x17')](function(_0x48d9ee){logger[_0x7e3d('0x13')](_0x7e3d('0xe'),_0x3d1cc9,_0x48d9ee);_0x3917bd(_0x48d9ee);});});} \ No newline at end of file +var _0xd072=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0xf43cb,_0x465374){var _0x14e869=function(_0x454719){while(--_0x454719){_0xf43cb['push'](_0xf43cb['shift']());}};_0x14e869(++_0x465374);}(_0xd072,0x132));var _0x2d07=function(_0x533f8e,_0x439bb3){_0x533f8e=_0x533f8e-0x0;var _0x3386ad=_0xd072[_0x533f8e];return _0x3386ad;};'use strict';var _=require(_0x2d07('0x0'));var util=require(_0x2d07('0x1'));var moment=require(_0x2d07('0x2'));var BPromise=require(_0x2d07('0x3'));var rs=require(_0x2d07('0x4'));var fs=require('fs');var Redis=require(_0x2d07('0x5'));var db=require(_0x2d07('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x2d07('0x7'))(_0x2d07('0x8'));var config=require(_0x2d07('0x9'));var jayson=require(_0x2d07('0xa'));var client=jayson[_0x2d07('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1a992a,_0x429d2c,_0x367834){return new BPromise(function(_0x19d04c,_0x167c61){return client[_0x2d07('0xc')](_0x1a992a,_0x367834)[_0x2d07('0xd')](function(_0x4bcba8){logger[_0x2d07('0xe')](_0x2d07('0xf'),_0x429d2c,_0x2d07('0x10'));logger[_0x2d07('0x11')](_0x2d07('0x12'),_0x429d2c,_0x2d07('0x10'),JSON[_0x2d07('0x13')](_0x4bcba8));if(_0x4bcba8[_0x2d07('0x14')]){if(_0x4bcba8[_0x2d07('0x14')][_0x2d07('0x15')]===0x1f4){logger[_0x2d07('0x14')](_0x2d07('0xf'),_0x429d2c,_0x4bcba8[_0x2d07('0x14')][_0x2d07('0x16')]);return _0x167c61(_0x4bcba8[_0x2d07('0x14')][_0x2d07('0x16')]);}logger[_0x2d07('0x14')](_0x2d07('0xf'),_0x429d2c,_0x4bcba8[_0x2d07('0x14')][_0x2d07('0x16')]);return _0x19d04c(_0x4bcba8[_0x2d07('0x14')][_0x2d07('0x16')]);}else{logger[_0x2d07('0xe')](_0x2d07('0xf'),_0x429d2c,_0x2d07('0x10'));_0x19d04c(_0x4bcba8['result'][_0x2d07('0x16')]);}})[_0x2d07('0x17')](function(_0x3d47e5){logger[_0x2d07('0x14')](_0x2d07('0xf'),_0x429d2c,_0x3d47e5);_0x167c61(_0x3d47e5);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index 88a9e79..ac1f783 100644 --- a/server/api/userSmsQueue/index.js +++ b/server/api/userSmsQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x135c64,_0x230f7b){var _0xf01125=function(_0x52ad91){while(--_0x52ad91){_0x135c64['push'](_0x135c64['shift']());}};_0xf01125(++_0x230f7b);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x8af54b,_0x280be5){_0x8af54b=_0x8af54b-0x0;var _0x27d8f0=_0xcb91[_0x8af54b];return _0x27d8f0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x13054a,_0x5560bb){var _0x4b80f6=function(_0x2c5131){while(--_0x2c5131){_0x13054a['push'](_0x13054a['shift']());}};_0x4b80f6(++_0x5560bb);}(_0xe706,0xa3));var _0x6e70=function(_0x3fc31d,_0x432bc9){_0x3fc31d=_0x3fc31d-0x0;var _0x31bb91=_0xe706[_0x3fc31d];return _0x31bb91;};'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/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index 79ea838..8146c9e 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 _0x42d4=['exports','INTEGER','sequelize'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x42d4,0xe6));var _0x442d=function(_0x58e796,_0x4090c3){_0x58e796=_0x58e796-0x0;var _0x22fba0=_0x42d4[_0x58e796];return _0x22fba0;};'use strict';var Sequelize=require(_0x442d('0x0'));module[_0x442d('0x1')]={'penalty':{'type':Sequelize[_0x442d('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x4ff6=['INTEGER','exports'];(function(_0x281e5e,_0xf320e2){var _0x5a22d2=function(_0x405ff9){while(--_0x405ff9){_0x281e5e['push'](_0x281e5e['shift']());}};_0x5a22d2(++_0xf320e2);}(_0x4ff6,0xd5));var _0x64ff=function(_0x229a47,_0x251b9e){_0x229a47=_0x229a47-0x0;var _0x366740=_0x4ff6[_0x229a47];return _0x366740;};'use strict';var Sequelize=require('sequelize');module[_0x64ff('0x0')]={'penalty':{'type':Sequelize[_0x64ff('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.model.js b/server/api/userSmsQueue/userSmsQueue.model.js index 242e291..843a43d 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 _0xba18=['moment','bluebird','request-promise','path','../../config/environment','./userSmsQueue.attributes','exports','define','user_has_sms_queues','lodash','util','../../config/logger','api'];(function(_0x54735a,_0x1f4716){var _0x543be6=function(_0x583339){while(--_0x583339){_0x54735a['push'](_0x54735a['shift']());}};_0x543be6(++_0x1f4716);}(_0xba18,0x1ea));var _0x8ba1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xba18[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x8ba1('0x0'));var util=require(_0x8ba1('0x1'));var logger=require(_0x8ba1('0x2'))(_0x8ba1('0x3'));var moment=require(_0x8ba1('0x4'));var BPromise=require(_0x8ba1('0x5'));var rp=require(_0x8ba1('0x6'));var fs=require('fs');var path=require(_0x8ba1('0x7'));var rimraf=require('rimraf');var config=require(_0x8ba1('0x8'));var attributes=require(_0x8ba1('0x9'));module[_0x8ba1('0xa')]=function(_0x2a9dab,_0x3b107c){return _0x2a9dab[_0x8ba1('0xb')]('UserSmsQueue',attributes,{'tableName':_0x8ba1('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf562=['moment','bluebird','request-promise','path','rimraf','./userSmsQueue.attributes','define','UserSmsQueue','user_has_sms_queues','lodash','util','../../config/logger','api'];(function(_0x1a25bc,_0x1a009e){var _0x57a898=function(_0x5a4ca7){while(--_0x5a4ca7){_0x1a25bc['push'](_0x1a25bc['shift']());}};_0x57a898(++_0x1a009e);}(_0xf562,0x100));var _0x2f56=function(_0x185277,_0x5be2f0){_0x185277=_0x185277-0x0;var _0x344b15=_0xf562[_0x185277];return _0x344b15;};'use strict';var _=require(_0x2f56('0x0'));var util=require(_0x2f56('0x1'));var logger=require(_0x2f56('0x2'))(_0x2f56('0x3'));var moment=require(_0x2f56('0x4'));var BPromise=require(_0x2f56('0x5'));var rp=require(_0x2f56('0x6'));var fs=require('fs');var path=require(_0x2f56('0x7'));var rimraf=require(_0x2f56('0x8'));var config=require('../../config/environment');var attributes=require(_0x2f56('0x9'));module['exports']=function(_0x14436b,_0x5b3784){return _0x14436b[_0x2f56('0xa')](_0x2f56('0xb'),attributes,{'tableName':_0x2f56('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 6cf311c..440e3c7 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 _0xb703=['code','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','UserSmsQueue,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0xbb091,_0x3fe7ee){var _0x467a04=function(_0x3a978d){while(--_0x3a978d){_0xbb091['push'](_0xbb091['shift']());}};_0x467a04(++_0x3fe7ee);}(_0xb703,0xdf));var _0x3b70=function(_0x3762b6,_0x374200){_0x3762b6=_0x3762b6-0x0;var _0x1a72ab=_0xb703[_0x3762b6];return _0x1a72ab;};'use strict';var _=require(_0x3b70('0x0'));var util=require('util');var moment=require(_0x3b70('0x1'));var BPromise=require(_0x3b70('0x2'));var rs=require(_0x3b70('0x3'));var fs=require('fs');var Redis=require(_0x3b70('0x4'));var db=require(_0x3b70('0x5'))['db'];var utils=require(_0x3b70('0x6'));var logger=require(_0x3b70('0x7'))('rpc');var config=require(_0x3b70('0x8'));var jayson=require(_0x3b70('0x9'));var client=jayson[_0x3b70('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x207d9c,_0x5bc8be,_0x5d1f50){return new BPromise(function(_0x66969c,_0x42c662){return client[_0x3b70('0xb')](_0x207d9c,_0x5d1f50)[_0x3b70('0xc')](function(_0x125c6e){logger['info'](_0x3b70('0xd'),_0x5bc8be,'request\x20sent');logger['debug']('UserSmsQueue,\x20%s,\x20%s,\x20%s',_0x5bc8be,_0x3b70('0xe'),JSON[_0x3b70('0xf')](_0x125c6e));if(_0x125c6e[_0x3b70('0x10')]){if(_0x125c6e[_0x3b70('0x10')][_0x3b70('0x11')]===0x1f4){logger[_0x3b70('0x10')](_0x3b70('0xd'),_0x5bc8be,_0x125c6e[_0x3b70('0x10')][_0x3b70('0x12')]);return _0x42c662(_0x125c6e['error'][_0x3b70('0x12')]);}logger[_0x3b70('0x10')]('UserSmsQueue,\x20%s,\x20%s',_0x5bc8be,_0x125c6e[_0x3b70('0x10')][_0x3b70('0x12')]);return _0x66969c(_0x125c6e[_0x3b70('0x10')][_0x3b70('0x12')]);}else{logger['info'](_0x3b70('0xd'),_0x5bc8be,_0x3b70('0xe'));_0x66969c(_0x125c6e[_0x3b70('0x13')]['message']);}})['catch'](function(_0x756a36){logger[_0x3b70('0x10')](_0x3b70('0xd'),_0x5bc8be,_0x756a36);_0x42c662(_0x756a36);});});} \ No newline at end of file +var _0xcbdf=['catch','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x530060,_0x695958){var _0x3f33f4=function(_0x221600){while(--_0x221600){_0x530060['push'](_0x530060['shift']());}};_0x3f33f4(++_0x695958);}(_0xcbdf,0xb5));var _0xfcbd=function(_0x20151f,_0x49cd18){_0x20151f=_0x20151f-0x0;var _0x139ccd=_0xcbdf[_0x20151f];return _0x139ccd;};'use strict';var _=require('lodash');var util=require(_0xfcbd('0x0'));var moment=require(_0xfcbd('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfcbd('0x2'));var db=require(_0xfcbd('0x3'))['db'];var utils=require(_0xfcbd('0x4'));var logger=require(_0xfcbd('0x5'))(_0xfcbd('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xfcbd('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3d2106,_0x4278f4,_0x3fcf41){return new BPromise(function(_0x351260,_0x368499){return client[_0xfcbd('0x8')](_0x3d2106,_0x3fcf41)[_0xfcbd('0x9')](function(_0x2056ea){logger[_0xfcbd('0xa')](_0xfcbd('0xb'),_0x4278f4,_0xfcbd('0xc'));logger['debug'](_0xfcbd('0xd'),_0x4278f4,_0xfcbd('0xc'),JSON[_0xfcbd('0xe')](_0x2056ea));if(_0x2056ea['error']){if(_0x2056ea['error']['code']===0x1f4){logger[_0xfcbd('0xf')](_0xfcbd('0xb'),_0x4278f4,_0x2056ea[_0xfcbd('0xf')][_0xfcbd('0x10')]);return _0x368499(_0x2056ea[_0xfcbd('0xf')][_0xfcbd('0x10')]);}logger[_0xfcbd('0xf')](_0xfcbd('0xb'),_0x4278f4,_0x2056ea[_0xfcbd('0xf')][_0xfcbd('0x10')]);return _0x351260(_0x2056ea[_0xfcbd('0xf')][_0xfcbd('0x10')]);}else{logger[_0xfcbd('0xa')](_0xfcbd('0xb'),_0x4278f4,_0xfcbd('0xc'));_0x351260(_0x2056ea['result']['message']);}})[_0xfcbd('0x11')](function(_0x227716){logger[_0xfcbd('0xf')]('UserSmsQueue,\x20%s,\x20%s',_0x4278f4,_0x227716);_0x368499(_0x227716);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index 87e69ed..40a8ed5 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 _0x7826=['sequelize','exports','INTEGER'];(function(_0x3e0f23,_0x4e71fc){var _0x29799c=function(_0x3acee4){while(--_0x3acee4){_0x3e0f23['push'](_0x3e0f23['shift']());}};_0x29799c(++_0x4e71fc);}(_0x7826,0x162));var _0x6782=function(_0x5b2865,_0x3b814b){_0x5b2865=_0x5b2865-0x0;var _0x3cb4c6=_0x7826[_0x5b2865];return _0x3cb4c6;};'use strict';var Sequelize=require(_0x6782('0x0'));module[_0x6782('0x1')]={'UserId':{'type':Sequelize[_0x6782('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x6782('0x2')]}}; \ No newline at end of file +var _0x0a88=['exports','INTEGER','sequelize'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0x0a88,0x7a));var _0x80a8=function(_0x86b219,_0x43038f){_0x86b219=_0x86b219-0x0;var _0x1f320c=_0x0a88[_0x86b219];return _0x1f320c;};'use strict';var Sequelize=require(_0x80a8('0x0'));module[_0x80a8('0x1')]={'UserId':{'type':Sequelize[_0x80a8('0x2')]},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index 11f64e3..32aabd3 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(_0x46beb1,_0x1a6d81){var _0x5ee4df=function(_0x4c3f4f){while(--_0x4c3f4f){_0x46beb1['push'](_0x46beb1['shift']());}};_0x5ee4df(++_0x1a6d81);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0xa9e0[_0xf71120];return _0xbe2fd3;};'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(_0x447a2b,_0x34b9b4){var _0x37fbe3=function(_0x5e3733){while(--_0x5e3733){_0x447a2b['push'](_0x447a2b['shift']());}};_0x37fbe3(++_0x34b9b4);}(_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 9834bc7..1d21913 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(_0x4ecbaf,_0x2e50a9){var _0x213f3a=function(_0x553867){while(--_0x553867){_0x4ecbaf['push'](_0x4ecbaf['shift']());}};_0x213f3a(++_0x2e50a9);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x2a1f5c,_0x49b13f){var _0x43ce3d=function(_0x66f0bd){while(--_0x66f0bd){_0x2a1f5c['push'](_0x2a1f5c['shift']());}};_0x43ce3d(++_0x49b13f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xa9e0[_0x481bf7];return _0x461787;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index a388ccf..b2dba2e 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 _0x5aee=['exports','sequelize'];(function(_0x48d0bc,_0x3df4c5){var _0x4e9bbc=function(_0x2cd986){while(--_0x2cd986){_0x48d0bc['push'](_0x48d0bc['shift']());}};_0x4e9bbc(++_0x3df4c5);}(_0x5aee,0x111));var _0xe5ae=function(_0x2c6237,_0x17bcde){_0x2c6237=_0x2c6237-0x0;var _0x31d8ed=_0x5aee[_0x2c6237];return _0x31d8ed;};'use strict';var Sequelize=require(_0xe5ae('0x0'));module[_0xe5ae('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x6ec7=['INTEGER','sequelize'];(function(_0x2442aa,_0x42f8a4){var _0x5a6e7d=function(_0x4a54c7){while(--_0x4a54c7){_0x2442aa['push'](_0x2442aa['shift']());}};_0x5a6e7d(++_0x42f8a4);}(_0x6ec7,0x159));var _0x76ec=function(_0x29fc1f,_0x19b693){_0x29fc1f=_0x29fc1f-0x0;var _0x53b39e=_0x6ec7[_0x29fc1f];return _0x53b39e;};'use strict';var Sequelize=require(_0x76ec('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x76ec('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 d95d5cf..165fcca 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 _0xf0f0=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./userVoiceQueue.attributes','exports','define','UserVoiceQueue','user_has_voice_queues'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xf0f0,0xc0));var _0x0f0f=function(_0x374c9b,_0x2c190c){_0x374c9b=_0x374c9b-0x0;var _0x199327=_0xf0f0[_0x374c9b];return _0x199327;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0f0f('0x0'))(_0x0f0f('0x1'));var moment=require(_0x0f0f('0x2'));var BPromise=require(_0x0f0f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0f0f('0x4'));var rimraf=require(_0x0f0f('0x5'));var config=require(_0x0f0f('0x6'));var attributes=require(_0x0f0f('0x7'));module[_0x0f0f('0x8')]=function(_0x2bfc23,_0x5db600){return _0x2bfc23[_0x0f0f('0x9')](_0x0f0f('0xa'),attributes,{'tableName':_0x0f0f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5274=['../../config/logger','api','moment','bluebird','path','rimraf','exports','define','user_has_voice_queues','lodash','util'];(function(_0x21e49c,_0xa4d646){var _0x56a630=function(_0x2d81ba){while(--_0x2d81ba){_0x21e49c['push'](_0x21e49c['shift']());}};_0x56a630(++_0xa4d646);}(_0x5274,0xae));var _0x4527=function(_0x4ad364,_0x34d600){_0x4ad364=_0x4ad364-0x0;var _0x1ace8f=_0x5274[_0x4ad364];return _0x1ace8f;};'use strict';var _=require(_0x4527('0x0'));var util=require(_0x4527('0x1'));var logger=require(_0x4527('0x2'))(_0x4527('0x3'));var moment=require(_0x4527('0x4'));var BPromise=require(_0x4527('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4527('0x6'));var rimraf=require(_0x4527('0x7'));var config=require('../../config/environment');var attributes=require('./userVoiceQueue.attributes');module[_0x4527('0x8')]=function(_0x4117c7,_0x935a81){return _0x4117c7[_0x4527('0x9')]('UserVoiceQueue',attributes,{'tableName':_0x4527('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.rpc.js b/server/api/userVoiceQueue/userVoiceQueue.rpc.js index ccb6cd3..55092da 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 _0xfb1d=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','request','then','info','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','error','code','UserVoiceQueue,\x20%s,\x20%s','message'];(function(_0x66e219,_0x56960f){var _0x94dc01=function(_0x20f07a){while(--_0x20f07a){_0x66e219['push'](_0x66e219['shift']());}};_0x94dc01(++_0x56960f);}(_0xfb1d,0x1ba));var _0xdfb1=function(_0x4269c3,_0x597468){_0x4269c3=_0x4269c3-0x0;var _0x139c5b=_0xfb1d[_0x4269c3];return _0x139c5b;};'use strict';var _=require(_0xdfb1('0x0'));var util=require(_0xdfb1('0x1'));var moment=require(_0xdfb1('0x2'));var BPromise=require(_0xdfb1('0x3'));var rs=require(_0xdfb1('0x4'));var fs=require('fs');var Redis=require(_0xdfb1('0x5'));var db=require(_0xdfb1('0x6'))['db'];var utils=require(_0xdfb1('0x7'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xdfb1('0x8'));var client=jayson[_0xdfb1('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x14969a,_0x36c96f,_0x5a1116){return new BPromise(function(_0x3b3cae,_0xa03801){return client[_0xdfb1('0xa')](_0x14969a,_0x5a1116)[_0xdfb1('0xb')](function(_0x3ebe64){logger[_0xdfb1('0xc')]('UserVoiceQueue,\x20%s,\x20%s',_0x36c96f,_0xdfb1('0xd'));logger[_0xdfb1('0xe')](_0xdfb1('0xf'),_0x36c96f,'request\x20sent',JSON['stringify'](_0x3ebe64));if(_0x3ebe64[_0xdfb1('0x10')]){if(_0x3ebe64[_0xdfb1('0x10')][_0xdfb1('0x11')]===0x1f4){logger[_0xdfb1('0x10')](_0xdfb1('0x12'),_0x36c96f,_0x3ebe64['error']['message']);return _0xa03801(_0x3ebe64['error'][_0xdfb1('0x13')]);}logger[_0xdfb1('0x10')](_0xdfb1('0x12'),_0x36c96f,_0x3ebe64[_0xdfb1('0x10')][_0xdfb1('0x13')]);return _0x3b3cae(_0x3ebe64[_0xdfb1('0x10')][_0xdfb1('0x13')]);}else{logger[_0xdfb1('0xc')](_0xdfb1('0x12'),_0x36c96f,_0xdfb1('0xd'));_0x3b3cae(_0x3ebe64[_0xdfb1('0x14')][_0xdfb1('0x13')]);}})[_0xdfb1('0x15')](function(_0x3b5017){logger[_0xdfb1('0x10')](_0xdfb1('0x12'),_0x36c96f,_0x3b5017);_0xa03801(_0x3b5017);});});} \ No newline at end of file +var _0x8f62=['client','http','request','then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x322010,_0x23087b){var _0x34a3a9=function(_0x528b60){while(--_0x528b60){_0x322010['push'](_0x322010['shift']());}};_0x34a3a9(++_0x23087b);}(_0x8f62,0x194));var _0x28f6=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8f62[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x28f6('0x0'));var util=require(_0x28f6('0x1'));var moment=require(_0x28f6('0x2'));var BPromise=require(_0x28f6('0x3'));var rs=require(_0x28f6('0x4'));var fs=require('fs');var Redis=require(_0x28f6('0x5'));var db=require(_0x28f6('0x6'))['db'];var utils=require(_0x28f6('0x7'));var logger=require(_0x28f6('0x8'))(_0x28f6('0x9'));var config=require(_0x28f6('0xa'));var jayson=require(_0x28f6('0xb'));var client=jayson[_0x28f6('0xc')][_0x28f6('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x51c44f,_0x151cd9,_0x28eac1){return new BPromise(function(_0x179eee,_0x278374){return client[_0x28f6('0xe')](_0x51c44f,_0x28eac1)[_0x28f6('0xf')](function(_0x37a3dc){logger[_0x28f6('0x10')](_0x28f6('0x11'),_0x151cd9,_0x28f6('0x12'));logger[_0x28f6('0x13')](_0x28f6('0x14'),_0x151cd9,_0x28f6('0x12'),JSON[_0x28f6('0x15')](_0x37a3dc));if(_0x37a3dc[_0x28f6('0x16')]){if(_0x37a3dc['error'][_0x28f6('0x17')]===0x1f4){logger[_0x28f6('0x16')](_0x28f6('0x11'),_0x151cd9,_0x37a3dc[_0x28f6('0x16')][_0x28f6('0x18')]);return _0x278374(_0x37a3dc[_0x28f6('0x16')][_0x28f6('0x18')]);}logger[_0x28f6('0x16')](_0x28f6('0x11'),_0x151cd9,_0x37a3dc[_0x28f6('0x16')][_0x28f6('0x18')]);return _0x179eee(_0x37a3dc[_0x28f6('0x16')][_0x28f6('0x18')]);}else{logger[_0x28f6('0x10')](_0x28f6('0x11'),_0x151cd9,_0x28f6('0x12'));_0x179eee(_0x37a3dc[_0x28f6('0x19')][_0x28f6('0x18')]);}})['catch'](function(_0x13e948){logger[_0x28f6('0x16')](_0x28f6('0x11'),_0x151cd9,_0x13e948);_0x278374(_0x13e948);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index ea19b2f..79d5aed 100644 --- a/server/api/userVoiceQueueRt/index.js +++ b/server/api/userVoiceQueueRt/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x4c7feb,_0x4e0ead){var _0x5be7a6=function(_0x216f67){while(--_0x216f67){_0x4c7feb['push'](_0x4c7feb['shift']());}};_0x5be7a6(++_0x4e0ead);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4d7379,_0x4b4e63){_0x4d7379=_0x4d7379-0x0;var _0x46d7cf=_0xcb91[_0x4d7379];return _0x46d7cf;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x338e58,_0x383afd){var _0x347ecf=function(_0x21a0f6){while(--_0x21a0f6){_0x338e58['push'](_0x338e58['shift']());}};_0x347ecf(++_0x383afd);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index b9e871a..b70b4f8 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 _0x31b9=['Required\x20by\x20Asterisk','STRING','INTEGER','queue_interface','sequelize','exports'];(function(_0x162221,_0x3951a8){var _0x5d792a=function(_0x594588){while(--_0x594588){_0x162221['push'](_0x162221['shift']());}};_0x5d792a(++_0x3951a8);}(_0x31b9,0x7c));var _0x931b=function(_0x2e804a,_0x23a954){_0x2e804a=_0x2e804a-0x0;var _0x48026f=_0x31b9[_0x2e804a];return _0x48026f;};'use strict';var Sequelize=require(_0x931b('0x0'));module[_0x931b('0x1')]={'uniqueid':{'type':Sequelize['INTEGER'],'primaryKey':!![],'autoIncrement':!![],'comment':_0x931b('0x2')},'membername':{'type':Sequelize[_0x931b('0x3')],'allowNull':![],'comment':_0x931b('0x2')},'UserId':{'type':Sequelize[_0x931b('0x4')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x931b('0x3')],'allowNull':![],'unique':_0x931b('0x5'),'comment':'Required\x20by\x20Asterisk'},'VoiceQueueId':{'type':Sequelize[_0x931b('0x4')],'allowNull':![]},'interface':{'type':Sequelize[_0x931b('0x3')],'allowNull':![],'unique':_0x931b('0x5'),'comment':_0x931b('0x2')},'penalty':{'type':Sequelize[_0x931b('0x4')](0xb),'defaultValue':0x0,'comment':_0x931b('0x2')},'paused':{'type':Sequelize[_0x931b('0x4')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'}}; \ No newline at end of file +var _0xb0ea=['queue_interface','sequelize','exports','INTEGER','STRING','Required\x20by\x20Asterisk'];(function(_0x5dee2a,_0x47d02a){var _0x31e98e=function(_0x48b1e9){while(--_0x48b1e9){_0x5dee2a['push'](_0x5dee2a['shift']());}};_0x31e98e(++_0x47d02a);}(_0xb0ea,0x1ab));var _0xab0e=function(_0x414cbe,_0x16a463){_0x414cbe=_0x414cbe-0x0;var _0x2793fe=_0xb0ea[_0x414cbe];return _0x2793fe;};'use strict';var Sequelize=require(_0xab0e('0x0'));module[_0xab0e('0x1')]={'uniqueid':{'type':Sequelize[_0xab0e('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':'Required\x20by\x20Asterisk'},'membername':{'type':Sequelize[_0xab0e('0x3')],'allowNull':![],'comment':_0xab0e('0x4')},'UserId':{'type':Sequelize[_0xab0e('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize[_0xab0e('0x3')],'allowNull':![],'unique':_0xab0e('0x5'),'comment':_0xab0e('0x4')},'VoiceQueueId':{'type':Sequelize[_0xab0e('0x2')],'allowNull':![]},'interface':{'type':Sequelize[_0xab0e('0x3')],'allowNull':![],'unique':_0xab0e('0x5'),'comment':_0xab0e('0x4')},'penalty':{'type':Sequelize[_0xab0e('0x2')](0xb),'defaultValue':0x0,'comment':_0xab0e('0x4')},'paused':{'type':Sequelize[_0xab0e('0x2')](0xb),'defaultValue':0x0,'comment':_0xab0e('0x4')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 4b3b561..21a6f82 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 _0x4a1d=['setMaxListeners','save','remove','emit','hook','exports','events','../../mysqldb'];(function(_0x216428,_0x5d20ea){var _0x313dd4=function(_0x447e0d){while(--_0x447e0d){_0x216428['push'](_0x216428['shift']());}};_0x313dd4(++_0x5d20ea);}(_0x4a1d,0x1ce));var _0xd4a1=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0x4a1d[_0x49ca18];return _0x145d54;};'use strict';var EventEmitter=require(_0xd4a1('0x0'));var UserVoiceQueueRt=require(_0xd4a1('0x1'))['db']['UserVoiceQueueRt'];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xd4a1('0x2')](0x0);var events={'afterCreate':_0xd4a1('0x3'),'afterUpdate':'update','afterDestroy':_0xd4a1('0x4')};function emitEvent(_0x22b63b){return function(_0x5aaa23,_0x3c5700,_0x283c9c){UserVoiceQueueRtEvents[_0xd4a1('0x5')](_0x22b63b+':'+_0x5aaa23['id'],_0x5aaa23);UserVoiceQueueRtEvents['emit'](_0x22b63b,_0x5aaa23);_0x283c9c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt[_0xd4a1('0x6')](e,emitEvent(event));}}module[_0xd4a1('0x7')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0xd019=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','UserVoiceQueueRt','setMaxListeners'];(function(_0x157334,_0x45d57e){var _0x363277=function(_0x257be7){while(--_0x257be7){_0x157334['push'](_0x157334['shift']());}};_0x363277(++_0x45d57e);}(_0xd019,0x146));var _0x9d01=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0xd019[_0x565c49];return _0x20ca34;};'use strict';var EventEmitter=require(_0x9d01('0x0'));var UserVoiceQueueRt=require(_0x9d01('0x1'))['db'][_0x9d01('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x9d01('0x3')](0x0);var events={'afterCreate':_0x9d01('0x4'),'afterUpdate':_0x9d01('0x5'),'afterDestroy':_0x9d01('0x6')};function emitEvent(_0x19fb28){return function(_0x1ea8b6,_0x548305,_0x6ad782){UserVoiceQueueRtEvents[_0x9d01('0x7')](_0x19fb28+':'+_0x1ea8b6['id'],_0x1ea8b6);UserVoiceQueueRtEvents[_0x9d01('0x7')](_0x19fb28,_0x1ea8b6);_0x6ad782(null);};}for(var e in events){if(events[_0x9d01('0x8')](e)){var event=events[e];UserVoiceQueueRt[_0x9d01('0x9')](e,emitEvent(event));}}module[_0x9d01('0xa')]=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index c108bcd..3d3a157 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 _0x6a84=['exports','define','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','util','api','moment','bluebird','path','rimraf','./userVoiceQueueRt.attributes'];(function(_0x45f111,_0x3a1a4a){var _0x483508=function(_0x3131ab){while(--_0x3131ab){_0x45f111['push'](_0x45f111['shift']());}};_0x483508(++_0x3a1a4a);}(_0x6a84,0x1c0));var _0x46a8=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0x6a84[_0xb0f7c3];return _0x28ea68;};'use strict';var _=require(_0x46a8('0x0'));var util=require(_0x46a8('0x1'));var logger=require('../../config/logger')(_0x46a8('0x2'));var moment=require(_0x46a8('0x3'));var BPromise=require(_0x46a8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x46a8('0x5'));var rimraf=require(_0x46a8('0x6'));var config=require('../../config/environment');var attributes=require(_0x46a8('0x7'));module[_0x46a8('0x8')]=function(_0x426b4c,_0x5c859d){return _0x426b4c[_0x46a8('0x9')](_0x46a8('0xa'),attributes,{'tableName':_0x46a8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7d10=['rimraf','../../config/environment','./userVoiceQueueRt.attributes','exports','define','UserVoiceQueueRt','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4026b9,_0x4a1429){var _0x5b1ff2=function(_0x4c158b){while(--_0x4c158b){_0x4026b9['push'](_0x4026b9['shift']());}};_0x5b1ff2(++_0x4a1429);}(_0x7d10,0x17f));var _0x07d1=function(_0x5584e0,_0x55943e){_0x5584e0=_0x5584e0-0x0;var _0x1c8cdb=_0x7d10[_0x5584e0];return _0x1c8cdb;};'use strict';var _=require(_0x07d1('0x0'));var util=require(_0x07d1('0x1'));var logger=require(_0x07d1('0x2'))(_0x07d1('0x3'));var moment=require(_0x07d1('0x4'));var BPromise=require(_0x07d1('0x5'));var rp=require(_0x07d1('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x07d1('0x7'));var config=require(_0x07d1('0x8'));var attributes=require(_0x07d1('0x9'));module[_0x07d1('0xa')]=function(_0x1319e7,_0x5f513d){return _0x1319e7[_0x07d1('0xb')](_0x07d1('0xc'),attributes,{'tableName':'user_has_voice_queues_rt','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 9fc42e8..8c3a048 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 _0x39c6=['`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','./userVoiceQueueRt.socket','register','request','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','where','sequelize','literal'];(function(_0x5c0979,_0x287854){var _0x309972=function(_0x17defd){while(--_0x17defd){_0x5c0979['push'](_0x5c0979['shift']());}};_0x309972(++_0x287854);}(_0x39c6,0x18f));var _0x639c=function(_0x3e57cd,_0x1a5e5c){_0x3e57cd=_0x3e57cd-0x0;var _0x6758c4=_0x39c6[_0x3e57cd];return _0x6758c4;};'use strict';var _=require(_0x639c('0x0'));var util=require(_0x639c('0x1'));var moment=require(_0x639c('0x2'));var BPromise=require(_0x639c('0x3'));var rs=require(_0x639c('0x4'));var fs=require('fs');var Redis=require(_0x639c('0x5'));var db=require(_0x639c('0x6'))['db'];var utils=require(_0x639c('0x7'));var logger=require(_0x639c('0x8'))(_0x639c('0x9'));var config=require(_0x639c('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x639c('0xb')][_0x639c('0xc')]({'port':0x232a});config[_0x639c('0xd')]=_['defaults'](config['redis'],{'host':_0x639c('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x639c('0xd')]));require(_0x639c('0xf'))[_0x639c('0x10')](socket);function respondWithRpcPromise(_0x14909a,_0x5321c1,_0x4f1627){return new BPromise(function(_0x2d70ec,_0x5795ba){return client[_0x639c('0x11')](_0x14909a,_0x4f1627)['then'](function(_0x41d848){logger['info'](_0x639c('0x12'),_0x5321c1,'request\x20sent');logger['debug']('UserVoiceQueueRt,\x20%s,\x20%s,\x20%s',_0x5321c1,_0x639c('0x13'),JSON[_0x639c('0x14')](_0x41d848));if(_0x41d848[_0x639c('0x15')]){if(_0x41d848[_0x639c('0x15')]['code']===0x1f4){logger[_0x639c('0x15')](_0x639c('0x12'),_0x5321c1,_0x41d848[_0x639c('0x15')]['message']);return _0x5795ba(_0x41d848[_0x639c('0x15')][_0x639c('0x16')]);}logger[_0x639c('0x15')](_0x639c('0x12'),_0x5321c1,_0x41d848[_0x639c('0x15')][_0x639c('0x16')]);return _0x2d70ec(_0x41d848[_0x639c('0x15')][_0x639c('0x16')]);}else{logger[_0x639c('0x17')](_0x639c('0x12'),_0x5321c1,_0x639c('0x13'));_0x2d70ec(_0x41d848[_0x639c('0x18')][_0x639c('0x16')]);}})[_0x639c('0x19')](function(_0x5f523a){logger['error'](_0x639c('0x12'),_0x5321c1,_0x5f523a);_0x5795ba(_0x5f523a);});});}exports[_0x639c('0x1a')]=function(_0x4f1ce0){var _0x466129=this;return new Promise(function(_0x4b567f,_0x30505a){return db[_0x639c('0x1b')][_0x639c('0x1c')]({'raw':_0x4f1ce0[_0x639c('0x1d')]?_0x4f1ce0[_0x639c('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x4f1ce0[_0x639c('0x1d')]?_0x4f1ce0[_0x639c('0x1d')][_0x639c('0x1e')]||null:null,'attributes':[[db[_0x639c('0x1f')]['fn']('COUNT',db[_0x639c('0x1f')]['fn']('IF',db[_0x639c('0x1f')][_0x639c('0x20')](_0x639c('0x21')))),_0x639c('0x22')]]})['then'](function(_0x12c74c){logger['info'](_0x639c('0x1a'),_0x4f1ce0);logger[_0x639c('0x23')](_0x639c('0x1a'),_0x4f1ce0,JSON[_0x639c('0x14')](_0x12c74c));_0x4b567f(_0x12c74c);})[_0x639c('0x19')](function(_0x43b8f9){logger[_0x639c('0x15')](_0x639c('0x1a'),_0x43b8f9[_0x639c('0x16')],_0x4f1ce0);_0x30505a(_0x466129[_0x639c('0x15')](0x1f4,_0x43b8f9[_0x639c('0x16')]));});});}; \ No newline at end of file +var _0xf819=['socket.io-emitter','register','request','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','options','raw','where','COUNT','sequelize','literal','`paused`\x20=\x201,\x201,\x20null','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','defaults','redis','localhost'];(function(_0x56d0b2,_0x2f7c9e){var _0x37e421=function(_0x23b3a9){while(--_0x23b3a9){_0x56d0b2['push'](_0x56d0b2['shift']());}};_0x37e421(++_0x2f7c9e);}(_0xf819,0x82));var _0x9f81=function(_0xfe328a,_0x40602a){_0xfe328a=_0xfe328a-0x0;var _0x54d9a4=_0xf819[_0xfe328a];return _0x54d9a4;};'use strict';var _=require(_0x9f81('0x0'));var util=require(_0x9f81('0x1'));var moment=require(_0x9f81('0x2'));var BPromise=require(_0x9f81('0x3'));var rs=require(_0x9f81('0x4'));var fs=require('fs');var Redis=require(_0x9f81('0x5'));var db=require(_0x9f81('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x9f81('0x7'))('rpc');var config=require(_0x9f81('0x8'));var jayson=require(_0x9f81('0x9'));var client=jayson[_0x9f81('0xa')]['http']({'port':0x232a});config['redis']=_[_0x9f81('0xb')](config[_0x9f81('0xc')],{'host':_0x9f81('0xd'),'port':0x18eb});var socket=require(_0x9f81('0xe'))(new Redis(config[_0x9f81('0xc')]));require('./userVoiceQueueRt.socket')[_0x9f81('0xf')](socket);function respondWithRpcPromise(_0x1ccaff,_0x51fd35,_0x267fee){return new BPromise(function(_0x289541,_0xe794b9){return client[_0x9f81('0x10')](_0x1ccaff,_0x267fee)[_0x9f81('0x11')](function(_0x1a60c6){logger[_0x9f81('0x12')](_0x9f81('0x13'),_0x51fd35,_0x9f81('0x14'));logger['debug'](_0x9f81('0x15'),_0x51fd35,_0x9f81('0x14'),JSON['stringify'](_0x1a60c6));if(_0x1a60c6['error']){if(_0x1a60c6[_0x9f81('0x16')][_0x9f81('0x17')]===0x1f4){logger[_0x9f81('0x16')](_0x9f81('0x13'),_0x51fd35,_0x1a60c6[_0x9f81('0x16')][_0x9f81('0x18')]);return _0xe794b9(_0x1a60c6['error'][_0x9f81('0x18')]);}logger[_0x9f81('0x16')](_0x9f81('0x13'),_0x51fd35,_0x1a60c6[_0x9f81('0x16')][_0x9f81('0x18')]);return _0x289541(_0x1a60c6['error'][_0x9f81('0x18')]);}else{logger[_0x9f81('0x12')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x51fd35,_0x9f81('0x14'));_0x289541(_0x1a60c6[_0x9f81('0x19')][_0x9f81('0x18')]);}})[_0x9f81('0x1a')](function(_0x210f07){logger[_0x9f81('0x16')](_0x9f81('0x13'),_0x51fd35,_0x210f07);_0xe794b9(_0x210f07);});});}exports[_0x9f81('0x1b')]=function(_0x1cb30c){var _0x3ab38a=this;return new Promise(function(_0x603c8,_0x3da206){return db[_0x9f81('0x1c')]['findAll']({'raw':_0x1cb30c['options']?_0x1cb30c[_0x9f81('0x1d')][_0x9f81('0x1e')]===undefined?!![]:![]:!![],'where':_0x1cb30c[_0x9f81('0x1d')]?_0x1cb30c[_0x9f81('0x1d')][_0x9f81('0x1f')]||null:null,'attributes':[[db['sequelize']['fn'](_0x9f81('0x20'),db[_0x9f81('0x21')]['fn']('IF',db[_0x9f81('0x21')][_0x9f81('0x22')](_0x9f81('0x23')))),'outboundQueuePauses']]})[_0x9f81('0x11')](function(_0x548508){logger[_0x9f81('0x12')]('GetVoiceQueueRtPauses',_0x1cb30c);logger['debug'](_0x9f81('0x1b'),_0x1cb30c,JSON['stringify'](_0x548508));_0x603c8(_0x548508);})[_0x9f81('0x1a')](function(_0x2e4312){logger[_0x9f81('0x16')]('GetVoiceQueueRtPauses',_0x2e4312[_0x9f81('0x18')],_0x1cb30c);_0x3da206(_0x3ab38a[_0x9f81('0x16')](0x1f4,_0x2e4312[_0x9f81('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index e487320..d5940f9 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 _0x46cb=['removeListener','register','length','userVoiceQueueRt:','update','emit'];(function(_0x502e1a,_0x23e7a6){var _0x5bbbcf=function(_0x5a1407){while(--_0x5a1407){_0x502e1a['push'](_0x502e1a['shift']());}};_0x5bbbcf(++_0x23e7a6);}(_0x46cb,0xd6));var _0xb46c=function(_0x36f3df,_0x2b1621){_0x36f3df=_0x36f3df-0x0;var _0xcfb7b7=_0x46cb[_0x36f3df];return _0xcfb7b7;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=['save','remove',_0xb46c('0x0')];function createListener(_0x2a55a0,_0x4395ee){return function(_0x33aaa0){_0x4395ee[_0xb46c('0x1')](_0x2a55a0,_0x33aaa0);};}function removeListener(_0x2aab0a,_0x2a6e97){return function(){UserVoiceQueueRtEvents[_0xb46c('0x2')](_0x2aab0a,_0x2a6e97);};}exports[_0xb46c('0x3')]=function(_0xf4f306){for(var _0x2e3704=0x0,_0x4603b8=events[_0xb46c('0x4')];_0x2e3704<_0x4603b8;_0x2e3704++){var _0x2771fe=events[_0x2e3704];var _0x5dfe97=createListener(_0xb46c('0x5')+_0x2771fe,_0xf4f306);UserVoiceQueueRtEvents['on'](_0x2771fe,_0x5dfe97);}}; \ No newline at end of file +var _0x9829=['remove','update','emit','removeListener','register','length','userVoiceQueueRt:','./userVoiceQueueRt.events','save'];(function(_0x43cdc5,_0x2f19ba){var _0x2da6c5=function(_0x1bf4f7){while(--_0x1bf4f7){_0x43cdc5['push'](_0x43cdc5['shift']());}};_0x2da6c5(++_0x2f19ba);}(_0x9829,0xc4));var _0x9982=function(_0x231e16,_0x67347b){_0x231e16=_0x231e16-0x0;var _0x570a7c=_0x9829[_0x231e16];return _0x570a7c;};'use strict';var UserVoiceQueueRtEvents=require(_0x9982('0x0'));var events=[_0x9982('0x1'),_0x9982('0x2'),_0x9982('0x3')];function createListener(_0x338564,_0x4c01a9){return function(_0x399b6c){_0x4c01a9[_0x9982('0x4')](_0x338564,_0x399b6c);};}function removeListener(_0x2f782a,_0x4bee19){return function(){UserVoiceQueueRtEvents[_0x9982('0x5')](_0x2f782a,_0x4bee19);};}exports[_0x9982('0x6')]=function(_0x58f8fe){for(var _0x500dfd=0x0,_0x340d62=events[_0x9982('0x7')];_0x500dfd<_0x340d62;_0x500dfd++){var _0x5d0824=events[_0x500dfd];var _0x25f30a=createListener(_0x9982('0x8')+_0x5d0824,_0x58f8fe);UserVoiceQueueRtEvents['on'](_0x5d0824,_0x25f30a);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index 748701c..d7e0366 100644 --- a/server/api/userWhatsappQueue/index.js +++ b/server/api/userWhatsappQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x1bc635,_0x4a1b08){var _0x1179e0=function(_0x48b2ed){while(--_0x48b2ed){_0x1bc635['push'](_0x1bc635['shift']());}};_0x1179e0(++_0x4a1b08);}(_0x9c44,0x178));var _0x49c4=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0x9c44[_0x1caf6a];return _0x1bf493;};'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(_0x19cd03,_0x33168c){var _0x3b0e48=function(_0x5e989d){while(--_0x5e989d){_0x19cd03['push'](_0x19cd03['shift']());}};_0x3b0e48(++_0x33168c);}(_0xe706,0xa3));var _0x6e70=function(_0x4e6eb2,_0x16a451){_0x4e6eb2=_0x4e6eb2-0x0;var _0x4e0c1c=_0xe706[_0x4e6eb2];return _0x4e0c1c;};'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/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index 194ec3f..402288a 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 _0xe3ad=['exports','INTEGER','sequelize'];(function(_0x5d6c3e,_0x409a3e){var _0x44ecb7=function(_0x936b6a){while(--_0x936b6a){_0x5d6c3e['push'](_0x5d6c3e['shift']());}};_0x44ecb7(++_0x409a3e);}(_0xe3ad,0x77));var _0xde3a=function(_0x4f0b07,_0x7cfb26){_0x4f0b07=_0x4f0b07-0x0;var _0x21e8bf=_0xe3ad[_0x4f0b07];return _0x21e8bf;};'use strict';var Sequelize=require(_0xde3a('0x0'));module[_0xde3a('0x1')]={'penalty':{'type':Sequelize[_0xde3a('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x840f=['sequelize','exports'];(function(_0x4b418f,_0x3b6a96){var _0x2ed208=function(_0x5bb29b){while(--_0x5bb29b){_0x4b418f['push'](_0x4b418f['shift']());}};_0x2ed208(++_0x3b6a96);}(_0x840f,0x8a));var _0xf840=function(_0x480c13,_0xe67fac){_0x480c13=_0x480c13-0x0;var _0x53ee47=_0x840f[_0x480c13];return _0x53ee47;};'use strict';var Sequelize=require(_0xf840('0x0'));module[_0xf840('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.model.js b/server/api/userWhatsappQueue/userWhatsappQueue.model.js index d89da53..7cf355c 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 _0xa6f8=['path','rimraf','../../config/environment','./userWhatsappQueue.attributes','define','user_has_whatsapp_queues','lodash','util','moment','bluebird','request-promise'];(function(_0x2769d2,_0x25f8f2){var _0x4396bc=function(_0x337c78){while(--_0x337c78){_0x2769d2['push'](_0x2769d2['shift']());}};_0x4396bc(++_0x25f8f2);}(_0xa6f8,0x95));var _0x8a6f=function(_0x2706db,_0x2c03f6){_0x2706db=_0x2706db-0x0;var _0x19939b=_0xa6f8[_0x2706db];return _0x19939b;};'use strict';var _=require(_0x8a6f('0x0'));var util=require(_0x8a6f('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x8a6f('0x2'));var BPromise=require(_0x8a6f('0x3'));var rp=require(_0x8a6f('0x4'));var fs=require('fs');var path=require(_0x8a6f('0x5'));var rimraf=require(_0x8a6f('0x6'));var config=require(_0x8a6f('0x7'));var attributes=require(_0x8a6f('0x8'));module['exports']=function(_0x1ae375,_0x1dbb51){return _0x1ae375[_0x8a6f('0x9')]('UserWhatsappQueue',attributes,{'tableName':_0x8a6f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4955=['user_has_whatsapp_queues','lodash','util','api','bluebird','path','../../config/environment','exports','define','UserWhatsappQueue'];(function(_0x130719,_0x2a7018){var _0x159865=function(_0x3a4d06){while(--_0x3a4d06){_0x130719['push'](_0x130719['shift']());}};_0x159865(++_0x2a7018);}(_0x4955,0x65));var _0x5495=function(_0x1f7a6e,_0x7fd4e8){_0x1f7a6e=_0x1f7a6e-0x0;var _0x4eb751=_0x4955[_0x1f7a6e];return _0x4eb751;};'use strict';var _=require(_0x5495('0x0'));var util=require(_0x5495('0x1'));var logger=require('../../config/logger')(_0x5495('0x2'));var moment=require('moment');var BPromise=require(_0x5495('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5495('0x4'));var rimraf=require('rimraf');var config=require(_0x5495('0x5'));var attributes=require('./userWhatsappQueue.attributes');module[_0x5495('0x6')]=function(_0x32f8ec,_0x4c7fea){return _0x32f8ec[_0x5495('0x7')](_0x5495('0x8'),attributes,{'tableName':_0x5495('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js b/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js index c8f7280..f98c9a0 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 _0x17bb=['debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','request','then','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x459ad9,_0x4c80ed){var _0x466e64=function(_0x39f227){while(--_0x39f227){_0x459ad9['push'](_0x459ad9['shift']());}};_0x466e64(++_0x4c80ed);}(_0x17bb,0x15c));var _0xb17b=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x17bb[_0xfae23b];return _0x200640;};'use strict';var _=require(_0xb17b('0x0'));var util=require(_0xb17b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb17b('0x2'));var fs=require('fs');var Redis=require(_0xb17b('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb17b('0x4'));var logger=require('../../config/logger')(_0xb17b('0x5'));var config=require('../../config/environment');var jayson=require(_0xb17b('0x6'));var client=jayson[_0xb17b('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41ceac,_0x25fa72,_0x535c8d){return new BPromise(function(_0x4ed788,_0x4cc6e4){return client[_0xb17b('0x8')](_0x41ceac,_0x535c8d)[_0xb17b('0x9')](function(_0x279b6e){logger['info'](_0xb17b('0xa'),_0x25fa72,_0xb17b('0xb'));logger[_0xb17b('0xc')](_0xb17b('0xd'),_0x25fa72,_0xb17b('0xb'),JSON[_0xb17b('0xe')](_0x279b6e));if(_0x279b6e['error']){if(_0x279b6e[_0xb17b('0xf')][_0xb17b('0x10')]===0x1f4){logger['error'](_0xb17b('0xa'),_0x25fa72,_0x279b6e[_0xb17b('0xf')][_0xb17b('0x11')]);return _0x4cc6e4(_0x279b6e[_0xb17b('0xf')]['message']);}logger[_0xb17b('0xf')](_0xb17b('0xa'),_0x25fa72,_0x279b6e[_0xb17b('0xf')][_0xb17b('0x11')]);return _0x4ed788(_0x279b6e[_0xb17b('0xf')][_0xb17b('0x11')]);}else{logger[_0xb17b('0x12')](_0xb17b('0xa'),_0x25fa72,'request\x20sent');_0x4ed788(_0x279b6e['result'][_0xb17b('0x11')]);}})[_0xb17b('0x13')](function(_0x5d6e8b){logger[_0xb17b('0xf')](_0xb17b('0xa'),_0x25fa72,_0x5d6e8b);_0x4cc6e4(_0x5d6e8b);});});} \ No newline at end of file +var _0x229f=['request','then','info','UserWhatsappQueue,\x20%s,\x20%s','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x29f0df,_0x4d1c63){var _0x56bb8e=function(_0x3fefb4){while(--_0x3fefb4){_0x29f0df['push'](_0x29f0df['shift']());}};_0x56bb8e(++_0x4d1c63);}(_0x229f,0x144));var _0xf229=function(_0x1edba7,_0x53799f){_0x1edba7=_0x1edba7-0x0;var _0x4de9b7=_0x229f[_0x1edba7];return _0x4de9b7;};'use strict';var _=require(_0xf229('0x0'));var util=require(_0xf229('0x1'));var moment=require(_0xf229('0x2'));var BPromise=require('bluebird');var rs=require(_0xf229('0x3'));var fs=require('fs');var Redis=require(_0xf229('0x4'));var db=require(_0xf229('0x5'))['db'];var utils=require(_0xf229('0x6'));var logger=require(_0xf229('0x7'))(_0xf229('0x8'));var config=require(_0xf229('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xf229('0xa')][_0xf229('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3c5d5c,_0x3e6b96,_0x3b769f){return new BPromise(function(_0x39c180,_0xdd576b){return client[_0xf229('0xc')](_0x3c5d5c,_0x3b769f)[_0xf229('0xd')](function(_0x1989ef){logger[_0xf229('0xe')](_0xf229('0xf'),_0x3e6b96,'request\x20sent');logger[_0xf229('0x10')](_0xf229('0x11'),_0x3e6b96,'request\x20sent',JSON['stringify'](_0x1989ef));if(_0x1989ef[_0xf229('0x12')]){if(_0x1989ef[_0xf229('0x12')][_0xf229('0x13')]===0x1f4){logger[_0xf229('0x12')]('UserWhatsappQueue,\x20%s,\x20%s',_0x3e6b96,_0x1989ef[_0xf229('0x12')][_0xf229('0x14')]);return _0xdd576b(_0x1989ef[_0xf229('0x12')][_0xf229('0x14')]);}logger[_0xf229('0x12')](_0xf229('0xf'),_0x3e6b96,_0x1989ef[_0xf229('0x12')]['message']);return _0x39c180(_0x1989ef[_0xf229('0x12')]['message']);}else{logger['info'](_0xf229('0xf'),_0x3e6b96,_0xf229('0x15'));_0x39c180(_0x1989ef[_0xf229('0x16')][_0xf229('0x14')]);}})[_0xf229('0x17')](function(_0x34563a){logger[_0xf229('0x12')](_0xf229('0xf'),_0x3e6b96,_0x34563a);_0xdd576b(_0x34563a);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index c92d86a..b7ec1ca 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 _0xa8eb=['get','index','/:id','isAuthenticated','create','put','update','delete','exports','multer','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x4eebcb,_0x242ec7){var _0x4da276=function(_0x3cddfc){while(--_0x3cddfc){_0x4eebcb['push'](_0x4eebcb['shift']());}};_0x4da276(++_0x242ec7);}(_0xa8eb,0x179));var _0xba8e=function(_0x54808c,_0x36e290){_0x54808c=_0x54808c-0x0;var _0xe9459=_0xa8eb[_0x54808c];return _0xe9459;};'use strict';var multer=require(_0xba8e('0x0'));var util=require('util');var path=require(_0xba8e('0x1'));var timeout=require('connect-timeout');var express=require(_0xba8e('0x2'));var router=express[_0xba8e('0x3')]();var fs_extra=require(_0xba8e('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xba8e('0x5'));var config=require(_0xba8e('0x6'));var controller=require('./variable.controller');router[_0xba8e('0x7')]('/',auth['isAuthenticated'](),controller[_0xba8e('0x8')]);router['get'](_0xba8e('0x9'),auth[_0xba8e('0xa')](),controller['show']);router['post']('/',auth[_0xba8e('0xa')](),controller[_0xba8e('0xb')]);router[_0xba8e('0xc')](_0xba8e('0x9'),auth[_0xba8e('0xa')](),controller[_0xba8e('0xd')]);router[_0xba8e('0xe')](_0xba8e('0x9'),auth[_0xba8e('0xa')](),controller['destroy']);module[_0xba8e('0xf')]=router; \ No newline at end of file +var _0xd2ce=['get','index','/:id','show','isAuthenticated','create','update','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x347d57,_0x5caad5){var _0x32b958=function(_0x13c6db){while(--_0x13c6db){_0x347d57['push'](_0x347d57['shift']());}};_0x32b958(++_0x5caad5);}(_0xd2ce,0x13c));var _0xed2c=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0xd2ce[_0x1e7b16];return _0x37fadc;};'use strict';var multer=require('multer');var util=require(_0xed2c('0x0'));var path=require('path');var timeout=require(_0xed2c('0x1'));var express=require(_0xed2c('0x2'));var router=express[_0xed2c('0x3')]();var fs_extra=require(_0xed2c('0x4'));var auth=require(_0xed2c('0x5'));var interaction=require(_0xed2c('0x6'));var config=require(_0xed2c('0x7'));var controller=require('./variable.controller');router[_0xed2c('0x8')]('/',auth['isAuthenticated'](),controller[_0xed2c('0x9')]);router[_0xed2c('0x8')](_0xed2c('0xa'),auth['isAuthenticated'](),controller[_0xed2c('0xb')]);router['post']('/',auth[_0xed2c('0xc')](),controller[_0xed2c('0xd')]);router['put']('/:id',auth[_0xed2c('0xc')](),controller[_0xed2c('0xe')]);router[_0xed2c('0xf')](_0xed2c('0xa'),auth['isAuthenticated'](),controller[_0xed2c('0x10')]);module[_0xed2c('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 c2ad356..356b165 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 _0x8375=['exports','STRING','name'];(function(_0x50b3a7,_0xf122c7){var _0x2c4f0b=function(_0x13a056){while(--_0x13a056){_0x50b3a7['push'](_0x50b3a7['shift']());}};_0x2c4f0b(++_0xf122c7);}(_0x8375,0x132));var _0x5837=function(_0x43b365,_0x2afa92){_0x43b365=_0x43b365-0x0;var _0x1a57b4=_0x8375[_0x43b365];return _0x1a57b4;};'use strict';var Sequelize=require('sequelize');module[_0x5837('0x0')]={'name':{'type':Sequelize[_0x5837('0x1')],'unique':_0x5837('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x5837('0x1')]}}; \ No newline at end of file +var _0xb4e6=['sequelize','exports','STRING','name'];(function(_0x1e4f2f,_0x35edfa){var _0xccea89=function(_0x164386){while(--_0x164386){_0x1e4f2f['push'](_0x1e4f2f['shift']());}};_0xccea89(++_0x35edfa);}(_0xb4e6,0xd8));var _0x6b4e=function(_0x5948dd,_0x1f6ac8){_0x5948dd=_0x5948dd-0x0;var _0xb1f8be=_0xb4e6[_0x5948dd];return _0xb1f8be;};'use strict';var Sequelize=require(_0x6b4e('0x0'));module[_0x6b4e('0x1')]={'name':{'type':Sequelize[_0x6b4e('0x2')],'unique':_0x6b4e('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x6b4e('0x2')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index 6c2ce3d..079aeb3 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 _0xfa62=['keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','findAll','rows','show','include','find','catch','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','Variables','UserProfileResource','then','error','stack','name','send','index','map','Variable','fieldName','type','key','model','query'];(function(_0xedd921,_0x1c9b59){var _0x34fc72=function(_0x442f8a){while(--_0x442f8a){_0xedd921['push'](_0xedd921['shift']());}};_0x34fc72(++_0x1c9b59);}(_0xfa62,0x74));var _0x2fa6=function(_0x70dca8,_0x27c0e9){_0x70dca8=_0x70dca8-0x0;var _0x3201ff=_0xfa62[_0x70dca8];return _0x3201ff;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x2fa6('0x0'));var rp=require(_0x2fa6('0x1'));var moment=require(_0x2fa6('0x2'));var BPromise=require(_0x2fa6('0x3'));var Mustache=require(_0x2fa6('0x4'));var util=require(_0x2fa6('0x5'));var path=require(_0x2fa6('0x6'));var sox=require(_0x2fa6('0x7'));var csv=require('to-csv');var ejs=require(_0x2fa6('0x8'));var fs=require('fs');var fs_extra=require(_0x2fa6('0x9'));var _=require(_0x2fa6('0xa'));var squel=require(_0x2fa6('0xb'));var crypto=require(_0x2fa6('0xc'));var jsforce=require(_0x2fa6('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x2fa6('0xe'));var querystring=require(_0x2fa6('0xf'));var Papa=require(_0x2fa6('0x10'));var Redis=require(_0x2fa6('0x11'));var authService=require(_0x2fa6('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x2fa6('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x2fa6('0x14'));var utils=require('../../config/utils');var config=require(_0x2fa6('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3d2aeb,_0x7bea16){_0x7bea16=_0x7bea16||0xcc;return function(_0x25ad65){if(_0x25ad65){return _0x3d2aeb[_0x2fa6('0x16')](_0x7bea16);}return _0x3d2aeb[_0x2fa6('0x17')](_0x7bea16)[_0x2fa6('0x18')]();};}function respondWithResult(_0x4db105,_0x4d811c){_0x4d811c=_0x4d811c||0xc8;return function(_0x1e6347){if(_0x1e6347){return _0x4db105[_0x2fa6('0x17')](_0x4d811c)[_0x2fa6('0x19')](_0x1e6347);}};}function respondWithFilteredResult(_0x20c1fc,_0x370134){return function(_0xcdd17f){if(_0xcdd17f){var _0x26d3dd=typeof _0x370134[_0x2fa6('0x1a')]===_0x2fa6('0x1b')&&typeof _0x370134[_0x2fa6('0x1c')]===_0x2fa6('0x1b');var _0x4ecf4e=_0xcdd17f[_0x2fa6('0x1d')];var _0x207025=_0x26d3dd?0x0:_0x370134[_0x2fa6('0x1a')];var _0x28e630=_0x26d3dd?_0xcdd17f[_0x2fa6('0x1d')]:_0x370134[_0x2fa6('0x1a')]+_0x370134[_0x2fa6('0x1c')];var _0x4cdc1d;if(_0x28e630>=_0x4ecf4e){_0x28e630=_0x4ecf4e;_0x4cdc1d=0xc8;}else{_0x4cdc1d=0xce;}_0x20c1fc[_0x2fa6('0x17')](_0x4cdc1d);return _0x20c1fc[_0x2fa6('0x1e')](_0x2fa6('0x1f'),_0x207025+'-'+_0x28e630+'/'+_0x4ecf4e)['json'](_0xcdd17f);}return null;};}function patchUpdates(_0x2071cf){return function(_0x5298da){try{jsonpatch[_0x2fa6('0x20')](_0x5298da,_0x2071cf,!![]);}catch(_0x107b09){return BPromise[_0x2fa6('0x21')](_0x107b09);}return _0x5298da[_0x2fa6('0x22')]();};}function saveUpdates(_0x1d4031,_0x1f4bc6){return function(_0x2219a6){if(_0x2219a6){return _0x2219a6[_0x2fa6('0x23')](_0x1d4031)['then'](function(_0x53e51b){return _0x53e51b;});}return null;};}function removeEntity(_0x364f73,_0x4e2aad){return function(_0x2309bf){if(_0x2309bf){return _0x2309bf[_0x2fa6('0x24')]()['then'](function(){var _0x1d2127=_0x2309bf['get']({'plain':!![]});var _0x3edc0d=_0x2fa6('0x25');return db[_0x2fa6('0x26')][_0x2fa6('0x24')]({'where':{'type':_0x3edc0d,'resourceId':_0x1d2127['id']}})[_0x2fa6('0x27')](function(){return _0x2309bf;});})[_0x2fa6('0x27')](function(){_0x364f73[_0x2fa6('0x17')](0xcc)[_0x2fa6('0x18')]();});}};}function handleEntityNotFound(_0x46655a,_0x1fcecb){return function(_0x1c6eee){if(!_0x1c6eee){_0x46655a['sendStatus'](0x194);}return _0x1c6eee;};}function handleError(_0x522638,_0x262920){_0x262920=_0x262920||0x1f4;return function(_0x35a68d){logger[_0x2fa6('0x28')](_0x35a68d[_0x2fa6('0x29')]);if(_0x35a68d[_0x2fa6('0x2a')]){delete _0x35a68d[_0x2fa6('0x2a')];}_0x522638[_0x2fa6('0x17')](_0x262920)[_0x2fa6('0x2b')](_0x35a68d);};}exports[_0x2fa6('0x2c')]=function(_0x48503e,_0x5a0486){var _0x99b2ce={},_0x46dabc={},_0x2352aa={'count':0x0,'rows':[]};var _0x17f433=_[_0x2fa6('0x2d')](db[_0x2fa6('0x2e')]['rawAttributes'],function(_0x4fa032){return{'name':_0x4fa032[_0x2fa6('0x2f')],'type':_0x4fa032[_0x2fa6('0x30')][_0x2fa6('0x31')]};});_0x46dabc[_0x2fa6('0x32')]=_['map'](_0x17f433,'name');_0x46dabc[_0x2fa6('0x33')]=_[_0x2fa6('0x34')](_0x48503e[_0x2fa6('0x33')]);_0x46dabc['filters']=_['intersection'](_0x46dabc['model'],_0x46dabc['query']);_0x99b2ce[_0x2fa6('0x35')]=_[_0x2fa6('0x36')](_0x46dabc[_0x2fa6('0x32')],qs[_0x2fa6('0x37')](_0x48503e[_0x2fa6('0x33')][_0x2fa6('0x37')]));_0x99b2ce[_0x2fa6('0x35')]=_0x99b2ce['attributes'][_0x2fa6('0x38')]?_0x99b2ce['attributes']:_0x46dabc['model'];if(!_0x48503e['query'][_0x2fa6('0x39')](_0x2fa6('0x3a'))){_0x99b2ce[_0x2fa6('0x1c')]=qs[_0x2fa6('0x1c')](_0x48503e[_0x2fa6('0x33')][_0x2fa6('0x1c')]);_0x99b2ce['offset']=qs[_0x2fa6('0x1a')](_0x48503e[_0x2fa6('0x33')][_0x2fa6('0x1a')]);}_0x99b2ce[_0x2fa6('0x3b')]=qs[_0x2fa6('0x3c')](_0x48503e[_0x2fa6('0x33')][_0x2fa6('0x3c')]);_0x99b2ce[_0x2fa6('0x3d')]=qs[_0x2fa6('0x3e')](_[_0x2fa6('0x3f')](_0x48503e[_0x2fa6('0x33')],_0x46dabc[_0x2fa6('0x3e')]),_0x17f433);if(_0x48503e[_0x2fa6('0x33')][_0x2fa6('0x40')]){_0x99b2ce['where']=_['merge'](_0x99b2ce['where'],{'$or':_['map'](_0x17f433,function(_0x41043a){if(_0x41043a[_0x2fa6('0x30')]!==_0x2fa6('0x41')){var _0x2572b5={};_0x2572b5[_0x41043a[_0x2fa6('0x2a')]]={'$like':'%'+_0x48503e['query'][_0x2fa6('0x40')]+'%'};return _0x2572b5;}})});}_0x99b2ce=_[_0x2fa6('0x42')]({},_0x99b2ce,_0x48503e[_0x2fa6('0x43')]);var _0x4ad4f8={'where':_0x99b2ce['where']};return db[_0x2fa6('0x2e')][_0x2fa6('0x1d')](_0x4ad4f8)['then'](function(_0x4b09f6){_0x2352aa[_0x2fa6('0x1d')]=_0x4b09f6;if(_0x48503e['query'][_0x2fa6('0x44')]){_0x99b2ce['include']=[{'all':!![]}];}return db[_0x2fa6('0x2e')][_0x2fa6('0x45')](_0x99b2ce);})[_0x2fa6('0x27')](function(_0x142dd7){_0x2352aa[_0x2fa6('0x46')]=_0x142dd7;return _0x2352aa;})[_0x2fa6('0x27')](respondWithFilteredResult(_0x5a0486,_0x99b2ce))['catch'](handleError(_0x5a0486,null));};exports[_0x2fa6('0x47')]=function(_0x2a2711,_0xb16b2a){var _0x1910c2={'raw':!![],'where':{'id':_0x2a2711['params']['id']}},_0xc6dae9={};_0xc6dae9[_0x2fa6('0x32')]=_['keys'](db['Variable']['rawAttributes']);_0xc6dae9[_0x2fa6('0x33')]=_[_0x2fa6('0x34')](_0x2a2711[_0x2fa6('0x33')]);_0xc6dae9[_0x2fa6('0x3e')]=_['intersection'](_0xc6dae9['model'],_0xc6dae9[_0x2fa6('0x33')]);_0x1910c2['attributes']=_['intersection'](_0xc6dae9[_0x2fa6('0x32')],qs[_0x2fa6('0x37')](_0x2a2711[_0x2fa6('0x33')]['fields']));_0x1910c2[_0x2fa6('0x35')]=_0x1910c2[_0x2fa6('0x35')][_0x2fa6('0x38')]?_0x1910c2[_0x2fa6('0x35')]:_0xc6dae9[_0x2fa6('0x32')];if(_0x2a2711[_0x2fa6('0x33')][_0x2fa6('0x44')]){_0x1910c2[_0x2fa6('0x48')]=[{'all':!![]}];}_0x1910c2=_[_0x2fa6('0x42')]({},_0x1910c2,_0x2a2711[_0x2fa6('0x43')]);return db[_0x2fa6('0x2e')][_0x2fa6('0x49')](_0x1910c2)[_0x2fa6('0x27')](handleEntityNotFound(_0xb16b2a,null))[_0x2fa6('0x27')](respondWithResult(_0xb16b2a,null))[_0x2fa6('0x4a')](handleError(_0xb16b2a,null));};exports[_0x2fa6('0x4b')]=function(_0x40222c,_0xe460fd){return db[_0x2fa6('0x2e')][_0x2fa6('0x4b')](_0x40222c['body'],{})[_0x2fa6('0x27')](function(_0x19c532){var _0x105a5b=_0x40222c['user'][_0x2fa6('0x4c')]({'plain':!![]});if(!_0x105a5b)throw new Error(_0x2fa6('0x4d'));if(_0x105a5b[_0x2fa6('0x4e')]===_0x2fa6('0x4f')){var _0x5f1538=_0x19c532[_0x2fa6('0x4c')]({'plain':!![]});var _0x2267b8=_0x2fa6('0x25');return db[_0x2fa6('0x50')]['find']({'where':{'name':_0x2267b8,'userProfileId':_0x105a5b['userProfileId']},'raw':!![]})[_0x2fa6('0x27')](function(_0x2cfcd8){if(_0x2cfcd8&&_0x2cfcd8['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x5f1538[_0x2fa6('0x2a')],'resourceId':_0x5f1538['id'],'type':_0x2cfcd8[_0x2fa6('0x2a')],'sectionId':_0x2cfcd8['id']},{})[_0x2fa6('0x27')](function(){return _0x19c532;});}else{return _0x19c532;}})['catch'](function(_0x43539f){logger[_0x2fa6('0x28')](_0x2fa6('0x51'),_0x43539f);throw _0x43539f;});}return _0x19c532;})['then'](respondWithResult(_0xe460fd,0xc9))[_0x2fa6('0x4a')](handleError(_0xe460fd,null));};exports[_0x2fa6('0x23')]=function(_0x24abad,_0x8b72c2){if(_0x24abad[_0x2fa6('0x52')]['id']){delete _0x24abad['body']['id'];}return db[_0x2fa6('0x2e')][_0x2fa6('0x49')]({'where':{'id':_0x24abad[_0x2fa6('0x53')]['id']}})[_0x2fa6('0x27')](handleEntityNotFound(_0x8b72c2,null))['then'](saveUpdates(_0x24abad[_0x2fa6('0x52')],null))['then'](respondWithResult(_0x8b72c2,null))[_0x2fa6('0x4a')](handleError(_0x8b72c2,null));};exports[_0x2fa6('0x24')]=function(_0x9bf3d3,_0x10b407){return db[_0x2fa6('0x2e')][_0x2fa6('0x49')]({'where':{'id':_0x9bf3d3[_0x2fa6('0x53')]['id']}})['then'](handleEntityNotFound(_0x10b407,null))['then'](removeEntity(_0x10b407,null))[_0x2fa6('0x4a')](handleError(_0x10b407,null));}; \ No newline at end of file +var _0xacee=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','Variables','UserProfileResource','error','stack','name','index','map','rawAttributes','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','Variable','includeAll','rows','show','keys','include','options','find','catch','create','body','user','get','role','userProfileId','autoAssociation','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x21d0e6,_0x5a7aa6){var _0x1cc2d1=function(_0x25ded8){while(--_0x25ded8){_0x21d0e6['push'](_0x21d0e6['shift']());}};_0x1cc2d1(++_0x5a7aa6);}(_0xacee,0x141));var _0xeace=function(_0x41d8e4,_0x1090cd){_0x41d8e4=_0x41d8e4-0x0;var _0x5d91c6=_0xacee[_0x41d8e4];return _0x5d91c6;};'use strict';var emlformat=require(_0xeace('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xeace('0x1'));var jsonpatch=require(_0xeace('0x2'));var rp=require(_0xeace('0x3'));var moment=require(_0xeace('0x4'));var BPromise=require(_0xeace('0x5'));var Mustache=require(_0xeace('0x6'));var util=require(_0xeace('0x7'));var path=require(_0xeace('0x8'));var sox=require(_0xeace('0x9'));var csv=require(_0xeace('0xa'));var ejs=require(_0xeace('0xb'));var fs=require('fs');var fs_extra=require(_0xeace('0xc'));var _=require(_0xeace('0xd'));var squel=require(_0xeace('0xe'));var crypto=require(_0xeace('0xf'));var jsforce=require(_0xeace('0x10'));var deskjs=require(_0xeace('0x11'));var toCsv=require(_0xeace('0xa'));var querystring=require(_0xeace('0x12'));var Papa=require(_0xeace('0x13'));var Redis=require(_0xeace('0x14'));var authService=require(_0xeace('0x15'));var qs=require(_0xeace('0x16'));var as=require(_0xeace('0x17'));var hardwareService=require(_0xeace('0x18'));var logger=require(_0xeace('0x19'))('api');var utils=require(_0xeace('0x1a'));var config=require('../../config/environment');var licenseUtil=require(_0xeace('0x1b'));var db=require(_0xeace('0x1c'))['db'];function respondWithStatusCode(_0x2d814b,_0x406d18){_0x406d18=_0x406d18||0xcc;return function(_0xe05a21){if(_0xe05a21){return _0x2d814b[_0xeace('0x1d')](_0x406d18);}return _0x2d814b[_0xeace('0x1e')](_0x406d18)[_0xeace('0x1f')]();};}function respondWithResult(_0x75e134,_0x461e81){_0x461e81=_0x461e81||0xc8;return function(_0x214652){if(_0x214652){return _0x75e134['status'](_0x461e81)[_0xeace('0x20')](_0x214652);}};}function respondWithFilteredResult(_0x21e6b1,_0x318f7e){return function(_0x45aabd){if(_0x45aabd){var _0x4c9fc8=typeof _0x318f7e['offset']==='undefined'&&typeof _0x318f7e['limit']===_0xeace('0x21');var _0x3c141f=_0x45aabd[_0xeace('0x22')];var _0x40cf11=_0x4c9fc8?0x0:_0x318f7e[_0xeace('0x23')];var _0x289e1f=_0x4c9fc8?_0x45aabd['count']:_0x318f7e[_0xeace('0x23')]+_0x318f7e[_0xeace('0x24')];var _0x74989e;if(_0x289e1f>=_0x3c141f){_0x289e1f=_0x3c141f;_0x74989e=0xc8;}else{_0x74989e=0xce;}_0x21e6b1['status'](_0x74989e);return _0x21e6b1[_0xeace('0x25')](_0xeace('0x26'),_0x40cf11+'-'+_0x289e1f+'/'+_0x3c141f)['json'](_0x45aabd);}return null;};}function patchUpdates(_0x331ee2){return function(_0x443a39){try{jsonpatch[_0xeace('0x27')](_0x443a39,_0x331ee2,!![]);}catch(_0x1581fc){return BPromise[_0xeace('0x28')](_0x1581fc);}return _0x443a39[_0xeace('0x29')]();};}function saveUpdates(_0xe32ea2,_0x1c8757){return function(_0x5adc20){if(_0x5adc20){return _0x5adc20[_0xeace('0x2a')](_0xe32ea2)['then'](function(_0x4bb6ac){return _0x4bb6ac;});}return null;};}function removeEntity(_0x57a813,_0x2630f5){return function(_0x706f7d){if(_0x706f7d){return _0x706f7d[_0xeace('0x2b')]()[_0xeace('0x2c')](function(){var _0x1488fa=_0x706f7d['get']({'plain':!![]});var _0x541b0d=_0xeace('0x2d');return db[_0xeace('0x2e')][_0xeace('0x2b')]({'where':{'type':_0x541b0d,'resourceId':_0x1488fa['id']}})[_0xeace('0x2c')](function(){return _0x706f7d;});})[_0xeace('0x2c')](function(){_0x57a813[_0xeace('0x1e')](0xcc)[_0xeace('0x1f')]();});}};}function handleEntityNotFound(_0x2df3bb,_0x4a9437){return function(_0x508086){if(!_0x508086){_0x2df3bb[_0xeace('0x1d')](0x194);}return _0x508086;};}function handleError(_0x59a31d,_0xf258b2){_0xf258b2=_0xf258b2||0x1f4;return function(_0x1a0735){logger[_0xeace('0x2f')](_0x1a0735[_0xeace('0x30')]);if(_0x1a0735[_0xeace('0x31')]){delete _0x1a0735['name'];}_0x59a31d['status'](_0xf258b2)['send'](_0x1a0735);};}exports[_0xeace('0x32')]=function(_0x17a5b0,_0x5199d0){var _0x430a88={},_0x52c713={},_0x4d2306={'count':0x0,'rows':[]};var _0x5e73dd=_[_0xeace('0x33')](db['Variable'][_0xeace('0x34')],function(_0x52a4aa){return{'name':_0x52a4aa['fieldName'],'type':_0x52a4aa['type'][_0xeace('0x35')]};});_0x52c713[_0xeace('0x36')]=_['map'](_0x5e73dd,_0xeace('0x31'));_0x52c713[_0xeace('0x37')]=_['keys'](_0x17a5b0[_0xeace('0x37')]);_0x52c713['filters']=_[_0xeace('0x38')](_0x52c713[_0xeace('0x36')],_0x52c713['query']);_0x430a88[_0xeace('0x39')]=_[_0xeace('0x38')](_0x52c713[_0xeace('0x36')],qs['fields'](_0x17a5b0[_0xeace('0x37')][_0xeace('0x3a')]));_0x430a88[_0xeace('0x39')]=_0x430a88[_0xeace('0x39')][_0xeace('0x3b')]?_0x430a88[_0xeace('0x39')]:_0x52c713[_0xeace('0x36')];if(!_0x17a5b0[_0xeace('0x37')][_0xeace('0x3c')](_0xeace('0x3d'))){_0x430a88[_0xeace('0x24')]=qs[_0xeace('0x24')](_0x17a5b0[_0xeace('0x37')]['limit']);_0x430a88[_0xeace('0x23')]=qs[_0xeace('0x23')](_0x17a5b0[_0xeace('0x37')]['offset']);}_0x430a88[_0xeace('0x3e')]=qs[_0xeace('0x3f')](_0x17a5b0[_0xeace('0x37')][_0xeace('0x3f')]);_0x430a88[_0xeace('0x40')]=qs['filters'](_[_0xeace('0x41')](_0x17a5b0[_0xeace('0x37')],_0x52c713['filters']),_0x5e73dd);if(_0x17a5b0[_0xeace('0x37')][_0xeace('0x42')]){_0x430a88[_0xeace('0x40')]=_[_0xeace('0x43')](_0x430a88[_0xeace('0x40')],{'$or':_[_0xeace('0x33')](_0x5e73dd,function(_0x90bb08){if(_0x90bb08[_0xeace('0x44')]!=='VIRTUAL'){var _0xf3dd3d={};_0xf3dd3d[_0x90bb08['name']]={'$like':'%'+_0x17a5b0[_0xeace('0x37')][_0xeace('0x42')]+'%'};return _0xf3dd3d;}})});}_0x430a88=_[_0xeace('0x43')]({},_0x430a88,_0x17a5b0['options']);var _0x2d368d={'where':_0x430a88[_0xeace('0x40')]};return db[_0xeace('0x45')]['count'](_0x2d368d)[_0xeace('0x2c')](function(_0x23072c){_0x4d2306[_0xeace('0x22')]=_0x23072c;if(_0x17a5b0['query'][_0xeace('0x46')]){_0x430a88['include']=[{'all':!![]}];}return db[_0xeace('0x45')]['findAll'](_0x430a88);})[_0xeace('0x2c')](function(_0x3092d1){_0x4d2306[_0xeace('0x47')]=_0x3092d1;return _0x4d2306;})[_0xeace('0x2c')](respondWithFilteredResult(_0x5199d0,_0x430a88))['catch'](handleError(_0x5199d0,null));};exports[_0xeace('0x48')]=function(_0x1568a3,_0x3915f0){var _0x15f1d8={'raw':!![],'where':{'id':_0x1568a3['params']['id']}},_0x372a47={};_0x372a47[_0xeace('0x36')]=_[_0xeace('0x49')](db[_0xeace('0x45')][_0xeace('0x34')]);_0x372a47[_0xeace('0x37')]=_[_0xeace('0x49')](_0x1568a3[_0xeace('0x37')]);_0x372a47['filters']=_[_0xeace('0x38')](_0x372a47['model'],_0x372a47[_0xeace('0x37')]);_0x15f1d8[_0xeace('0x39')]=_[_0xeace('0x38')](_0x372a47['model'],qs[_0xeace('0x3a')](_0x1568a3[_0xeace('0x37')][_0xeace('0x3a')]));_0x15f1d8['attributes']=_0x15f1d8[_0xeace('0x39')]['length']?_0x15f1d8[_0xeace('0x39')]:_0x372a47[_0xeace('0x36')];if(_0x1568a3[_0xeace('0x37')]['includeAll']){_0x15f1d8[_0xeace('0x4a')]=[{'all':!![]}];}_0x15f1d8=_[_0xeace('0x43')]({},_0x15f1d8,_0x1568a3[_0xeace('0x4b')]);return db[_0xeace('0x45')][_0xeace('0x4c')](_0x15f1d8)[_0xeace('0x2c')](handleEntityNotFound(_0x3915f0,null))[_0xeace('0x2c')](respondWithResult(_0x3915f0,null))[_0xeace('0x4d')](handleError(_0x3915f0,null));};exports[_0xeace('0x4e')]=function(_0x13ea79,_0x2d61d9){return db['Variable']['create'](_0x13ea79[_0xeace('0x4f')],{})['then'](function(_0x5505f2){var _0x15a362=_0x13ea79[_0xeace('0x50')][_0xeace('0x51')]({'plain':!![]});if(!_0x15a362)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x15a362[_0xeace('0x52')]===_0xeace('0x50')){var _0x519308=_0x5505f2[_0xeace('0x51')]({'plain':!![]});var _0x5f261d=_0xeace('0x2d');return db['UserProfileSection'][_0xeace('0x4c')]({'where':{'name':_0x5f261d,'userProfileId':_0x15a362[_0xeace('0x53')]},'raw':!![]})[_0xeace('0x2c')](function(_0x277dd9){if(_0x277dd9&&_0x277dd9[_0xeace('0x54')]===0x0){return db[_0xeace('0x2e')][_0xeace('0x4e')]({'name':_0x519308[_0xeace('0x31')],'resourceId':_0x519308['id'],'type':_0x277dd9['name'],'sectionId':_0x277dd9['id']},{})[_0xeace('0x2c')](function(){return _0x5505f2;});}else{return _0x5505f2;}})[_0xeace('0x4d')](function(_0x3862d5){logger[_0xeace('0x2f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3862d5);throw _0x3862d5;});}return _0x5505f2;})[_0xeace('0x2c')](respondWithResult(_0x2d61d9,0xc9))[_0xeace('0x4d')](handleError(_0x2d61d9,null));};exports[_0xeace('0x2a')]=function(_0x570176,_0x472be8){if(_0x570176[_0xeace('0x4f')]['id']){delete _0x570176[_0xeace('0x4f')]['id'];}return db[_0xeace('0x45')][_0xeace('0x4c')]({'where':{'id':_0x570176[_0xeace('0x55')]['id']}})['then'](handleEntityNotFound(_0x472be8,null))['then'](saveUpdates(_0x570176[_0xeace('0x4f')],null))[_0xeace('0x2c')](respondWithResult(_0x472be8,null))[_0xeace('0x4d')](handleError(_0x472be8,null));};exports[_0xeace('0x2b')]=function(_0x488ba4,_0x986fdf){return db[_0xeace('0x45')][_0xeace('0x4c')]({'where':{'id':_0x488ba4[_0xeace('0x55')]['id']}})[_0xeace('0x2c')](handleEntityNotFound(_0x986fdf,null))[_0xeace('0x2c')](removeEntity(_0x986fdf,null))['catch'](handleError(_0x986fdf,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index ec3a80a..f36c6ad 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 _0xff1e=['Variable','tools_variables','util','api','bluebird','request-promise','./variable.attributes','exports','define'];(function(_0x123251,_0x12da20){var _0x27deb3=function(_0x2b6a1f){while(--_0x2b6a1f){_0x123251['push'](_0x123251['shift']());}};_0x27deb3(++_0x12da20);}(_0xff1e,0x146));var _0xeff1=function(_0x1347f8,_0x233feb){_0x1347f8=_0x1347f8-0x0;var _0x218368=_0xff1e[_0x1347f8];return _0x218368;};'use strict';var _=require('lodash');var util=require(_0xeff1('0x0'));var logger=require('../../config/logger')(_0xeff1('0x1'));var moment=require('moment');var BPromise=require(_0xeff1('0x2'));var rp=require(_0xeff1('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xeff1('0x4'));module[_0xeff1('0x5')]=function(_0x1ed4cc,_0x7fa0fc){return _0x1ed4cc[_0xeff1('0x6')](_0xeff1('0x7'),attributes,{'tableName':_0xeff1('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x005f=['moment','request-promise','path','../../config/environment','./variable.attributes','exports','Variable','tools_variables','lodash','util','../../config/logger','api'];(function(_0x5cbae8,_0x1d935a){var _0xab26fd=function(_0x43b046){while(--_0x43b046){_0x5cbae8['push'](_0x5cbae8['shift']());}};_0xab26fd(++_0x1d935a);}(_0x005f,0xe0));var _0xf005=function(_0x323406,_0x3561d7){_0x323406=_0x323406-0x0;var _0x2cf53c=_0x005f[_0x323406];return _0x2cf53c;};'use strict';var _=require(_0xf005('0x0'));var util=require(_0xf005('0x1'));var logger=require(_0xf005('0x2'))(_0xf005('0x3'));var moment=require(_0xf005('0x4'));var BPromise=require('bluebird');var rp=require(_0xf005('0x5'));var fs=require('fs');var path=require(_0xf005('0x6'));var rimraf=require('rimraf');var config=require(_0xf005('0x7'));var attributes=require(_0xf005('0x8'));module[_0xf005('0x9')]=function(_0x3ddb76,_0xe6db33){return _0x3ddb76['define'](_0xf005('0xa'),attributes,{'tableName':_0xf005('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 1c8bda5..ec00e55 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 _0x9957=['stringify','error','code','message','result','catch','ShowVariable','find','raw','options','where','attributes','include','map','model','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s'];(function(_0x458abd,_0x4898e8){var _0x354a3e=function(_0x3890d9){while(--_0x3890d9){_0x458abd['push'](_0x458abd['shift']());}};_0x354a3e(++_0x4898e8);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Variable,\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);});});}exports[_0x7995('0x18')]=function(_0x291317){var _0x1e1415=this;return new Promise(function(_0x37a7d4,_0x4faa60){return db['Variable'][_0x7995('0x19')]({'raw':_0x291317['options']?_0x291317['options'][_0x7995('0x1a')]===undefined?!![]:![]:!![],'where':_0x291317[_0x7995('0x1b')]?_0x291317['options'][_0x7995('0x1c')]||null:null,'attributes':_0x291317['options']?_0x291317['options'][_0x7995('0x1d')]||null:null,'include':_0x291317[_0x7995('0x1b')]?_0x291317[_0x7995('0x1b')][_0x7995('0x1e')]?_[_0x7995('0x1f')](_0x291317[_0x7995('0x1b')]['include'],function(_0x32a09a){return{'model':db[_0x32a09a[_0x7995('0x20')]],'as':_0x32a09a['as'],'attributes':_0x32a09a[_0x7995('0x1d')],'include':_0x32a09a[_0x7995('0x1e')]?_[_0x7995('0x1f')](_0x32a09a[_0x7995('0x1e')],function(_0x475351){return{'model':db[_0x475351[_0x7995('0x20')]],'as':_0x475351['as'],'attributes':_0x475351['attributes'],'include':_0x475351[_0x7995('0x1e')]?_[_0x7995('0x1f')](_0x475351[_0x7995('0x1e')],function(_0x268ce7){return{'model':db[_0x268ce7[_0x7995('0x20')]],'as':_0x268ce7['as'],'attributes':_0x268ce7[_0x7995('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x47625f){logger['info'](_0x7995('0x18'),_0x291317);logger[_0x7995('0x10')](_0x7995('0x18'),_0x291317,JSON[_0x7995('0x12')](_0x47625f));_0x37a7d4(_0x47625f);})[_0x7995('0x17')](function(_0x4b6f99){logger[_0x7995('0x13')]('ShowVariable',_0x4b6f99[_0x7995('0x15')],_0x291317);_0x4faa60(_0x1e1415[_0x7995('0x13')](0x1f4,_0x4b6f99[_0x7995('0x15')]));});});}; \ No newline at end of file +var _0x7217=['where','attributes','map','include','model','ShowVariable','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Variable,\x20%s,\x20%s','debug','Variable,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','Variable','find','options','raw'];(function(_0x1d99d9,_0x17ba33){var _0x5afbe7=function(_0x26dcf8){while(--_0x26dcf8){_0x1d99d9['push'](_0x1d99d9['shift']());}};_0x5afbe7(++_0x17ba33);}(_0x7217,0x19e));var _0x7721=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0x7217[_0x34bc30];return _0x5706de;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var moment=require(_0x7721('0x1'));var BPromise=require(_0x7721('0x2'));var rs=require(_0x7721('0x3'));var fs=require('fs');var Redis=require(_0x7721('0x4'));var db=require(_0x7721('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7721('0x6'));var config=require(_0x7721('0x7'));var jayson=require(_0x7721('0x8'));var client=jayson[_0x7721('0x9')][_0x7721('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf7ff37,_0x18ab6b,_0x21f680){return new BPromise(function(_0x225610,_0x2f99ed){return client[_0x7721('0xb')](_0xf7ff37,_0x21f680)[_0x7721('0xc')](function(_0xfa8835){logger[_0x7721('0xd')](_0x7721('0xe'),_0x18ab6b,'request\x20sent');logger[_0x7721('0xf')](_0x7721('0x10'),_0x18ab6b,_0x7721('0x11'),JSON[_0x7721('0x12')](_0xfa8835));if(_0xfa8835[_0x7721('0x13')]){if(_0xfa8835[_0x7721('0x13')][_0x7721('0x14')]===0x1f4){logger[_0x7721('0x13')]('Variable,\x20%s,\x20%s',_0x18ab6b,_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);return _0x2f99ed(_0xfa8835['error'][_0x7721('0x15')]);}logger[_0x7721('0x13')](_0x7721('0xe'),_0x18ab6b,_0xfa8835[_0x7721('0x13')]['message']);return _0x225610(_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);}else{logger['info']('Variable,\x20%s,\x20%s',_0x18ab6b,'request\x20sent');_0x225610(_0xfa8835[_0x7721('0x16')][_0x7721('0x15')]);}})[_0x7721('0x17')](function(_0x32550d){logger['error'](_0x7721('0xe'),_0x18ab6b,_0x32550d);_0x2f99ed(_0x32550d);});});}exports['ShowVariable']=function(_0x3fc09e){var _0x5cb0e6=this;return new Promise(function(_0xfec626,_0x4e96fb){return db[_0x7721('0x18')][_0x7721('0x19')]({'raw':_0x3fc09e[_0x7721('0x1a')]?_0x3fc09e[_0x7721('0x1a')][_0x7721('0x1b')]===undefined?!![]:![]:!![],'where':_0x3fc09e[_0x7721('0x1a')]?_0x3fc09e[_0x7721('0x1a')][_0x7721('0x1c')]||null:null,'attributes':_0x3fc09e['options']?_0x3fc09e[_0x7721('0x1a')][_0x7721('0x1d')]||null:null,'include':_0x3fc09e[_0x7721('0x1a')]?_0x3fc09e[_0x7721('0x1a')]['include']?_[_0x7721('0x1e')](_0x3fc09e['options'][_0x7721('0x1f')],function(_0x288e3a){return{'model':db[_0x288e3a[_0x7721('0x20')]],'as':_0x288e3a['as'],'attributes':_0x288e3a[_0x7721('0x1d')],'include':_0x288e3a[_0x7721('0x1f')]?_[_0x7721('0x1e')](_0x288e3a[_0x7721('0x1f')],function(_0x5b4d74){return{'model':db[_0x5b4d74[_0x7721('0x20')]],'as':_0x5b4d74['as'],'attributes':_0x5b4d74[_0x7721('0x1d')],'include':_0x5b4d74[_0x7721('0x1f')]?_[_0x7721('0x1e')](_0x5b4d74[_0x7721('0x1f')],function(_0x16355a){return{'model':db[_0x16355a[_0x7721('0x20')]],'as':_0x16355a['as'],'attributes':_0x16355a[_0x7721('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x7721('0xc')](function(_0x52316e){logger[_0x7721('0xd')]('ShowVariable',_0x3fc09e);logger['debug'](_0x7721('0x21'),_0x3fc09e,JSON[_0x7721('0x12')](_0x52316e));_0xfec626(_0x52316e);})[_0x7721('0x17')](function(_0x158d98){logger[_0x7721('0x13')](_0x7721('0x21'),_0x158d98[_0x7721('0x15')],_0x3fc09e);_0x4e96fb(_0x5cb0e6[_0x7721('0x13')](0x1f4,_0x158d98['message']));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index ae0a9a1..d41abb6 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 _0xa29c=['restart','/migrations','migrations','exports','express','../../components/auth/service','./version.controller','get','index','isAuthenticated','canUpdate','fetch','reset','/pull','pull','/restart'];(function(_0x1dddb3,_0xc4c737){var _0x2faaf4=function(_0x290f7a){while(--_0x290f7a){_0x1dddb3['push'](_0x1dddb3['shift']());}};_0x2faaf4(++_0xc4c737);}(_0xa29c,0x104));var _0xca29=function(_0x3e67a9,_0x38cee2){_0x3e67a9=_0x3e67a9-0x0;var _0x339c99=_0xa29c[_0x3e67a9];return _0x339c99;};'use strict';var express=require(_0xca29('0x0'));var router=express['Router']();var auth=require(_0xca29('0x1'));var controller=require(_0xca29('0x2'));router[_0xca29('0x3')]('/',controller[_0xca29('0x4')]);router['get']('/fetch',auth[_0xca29('0x5')](),auth[_0xca29('0x6')](),controller[_0xca29('0x7')]);router[_0xca29('0x3')]('/reset',auth[_0xca29('0x5')](),auth[_0xca29('0x6')](),controller[_0xca29('0x8')]);router[_0xca29('0x3')](_0xca29('0x9'),auth[_0xca29('0x5')](),auth['canUpdate'](),controller[_0xca29('0xa')]);router[_0xca29('0x3')](_0xca29('0xb'),auth['isAuthenticated'](),controller[_0xca29('0xc')]);router[_0xca29('0x3')](_0xca29('0xd'),controller[_0xca29('0xe')]);module[_0xca29('0xf')]=router; \ No newline at end of file +var _0xacae=['exports','express','get','isAuthenticated','canUpdate','fetch','reset','pull','/restart','restart'];(function(_0x3ed86b,_0x1c8052){var _0x45c942=function(_0x3f4569){while(--_0x3f4569){_0x3ed86b['push'](_0x3ed86b['shift']());}};_0x45c942(++_0x1c8052);}(_0xacae,0x191));var _0xeaca=function(_0x2637a9,_0xcd459c){_0x2637a9=_0x2637a9-0x0;var _0x300c35=_0xacae[_0x2637a9];return _0x300c35;};'use strict';var express=require(_0xeaca('0x0'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require('./version.controller');router[_0xeaca('0x1')]('/',controller['index']);router[_0xeaca('0x1')]('/fetch',auth[_0xeaca('0x2')](),auth[_0xeaca('0x3')](),controller[_0xeaca('0x4')]);router[_0xeaca('0x1')]('/reset',auth[_0xeaca('0x2')](),auth[_0xeaca('0x3')](),controller[_0xeaca('0x5')]);router[_0xeaca('0x1')]('/pull',auth[_0xeaca('0x2')](),auth[_0xeaca('0x3')](),controller[_0xeaca('0x6')]);router['get'](_0xeaca('0x7'),auth['isAuthenticated'](),controller[_0xeaca('0x8')]);router['get']('/migrations',controller['migrations']);module[_0xeaca('0x9')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index 98bc091..b63f16d 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 _0x9ef5=['child_process','exec','../../mysqldb','../../config/environment','../../config/pm2','update','root','index','exports','version','query','latest','tags','json','status','fetch','origin','error','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','restart','motion2','then','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','join','server','.js','push','length','sort','sequelize','Migration','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','map','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','compare-versions'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9ef5,0x139));var _0x59ef=function(_0xdd82b4,_0x5cd8b8){_0xdd82b4=_0xdd82b4-0x0;var _0x549bb2=_0x9ef5[_0xdd82b4];return _0x549bb2;};'use strict';var Umzug=require(_0x59ef('0x0'));var path=require(_0x59ef('0x1'));var fs=require('fs');var _=require(_0x59ef('0x2'));var pkginfo=require(_0x59ef('0x3'))(module,'version');var compareVersions=require(_0x59ef('0x4'));var exec=require(_0x59ef('0x5'))[_0x59ef('0x6')];var db=require(_0x59ef('0x7'))['db'];var config=require(_0x59ef('0x8'));var pm2=require(_0x59ef('0x9'));var logger=require('../../config/logger')(_0x59ef('0xa'));var git=require('simple-git')(config[_0x59ef('0xb')]);exports[_0x59ef('0xc')]=function(_0x55c716,_0x2cde43){var _0x2e8f91={'current':module[_0x59ef('0xd')][_0x59ef('0xe')],'phonebar':0x2};if(_0x55c716[_0x59ef('0xf')]&&_0x55c716[_0x59ef('0xf')][_0x59ef('0x10')]){return git['fetch']()[_0x59ef('0x11')](function(_0x14bb5b,_0x2d4fb2){_0x2e8f91['latest']=(_0x14bb5b?module[_0x59ef('0xd')][_0x59ef('0xe')]:_0x2d4fb2['latest'])||'2.0.0';return _0x2cde43['status'](0xc8)[_0x59ef('0x12')](_0x2e8f91);});}else{return _0x2cde43[_0x59ef('0x13')](0xc8)[_0x59ef('0x12')](_0x2e8f91);}};exports[_0x59ef('0x14')]=function(_0x1609eb,_0x6e13a8){return git[_0x59ef('0x14')]([_0x59ef('0x15'),'master'],function(_0x172cb2){if(_0x172cb2){logger[_0x59ef('0x16')](_0x172cb2);return _0x6e13a8[_0x59ef('0x13')](0x1f4)[_0x59ef('0x12')](_0x172cb2);}logger[_0x59ef('0x17')](_0x59ef('0x18'));return _0x6e13a8['status'](0xc8)[_0x59ef('0x12')]({'output':_0x59ef('0x19')});});};exports[_0x59ef('0x1a')]=function(_0x33ef34,_0x26eaee){return git[_0x59ef('0x1a')]([_0x59ef('0x1b'),'FETCH_HEAD'],function(_0x1e96ca){if(_0x1e96ca){logger[_0x59ef('0x16')](_0x1e96ca);return _0x26eaee[_0x59ef('0x13')](0x1f4)[_0x59ef('0x12')](_0x1e96ca);}logger[_0x59ef('0x17')](_0x59ef('0x1c'));return _0x26eaee[_0x59ef('0x13')](0xc8)[_0x59ef('0x12')]({'output':_0x59ef('0x1d')});});};exports[_0x59ef('0x1e')]=function(_0xad2d43,_0x319741){exec('npm\x20install\x20--production',function(_0x381b1a,_0x735ed1,_0x10f269){logger[_0x59ef('0x17')](_0x735ed1);logger[_0x59ef('0x17')](_0x10f269);if(_0x381b1a){logger[_0x59ef('0x16')](_0x381b1a);return _0x319741[_0x59ef('0x13')](0x1f4)[_0x59ef('0x12')](_0x381b1a);}return _0x319741[_0x59ef('0x13')](0xc8)[_0x59ef('0x12')]({'output':_0x735ed1});});};exports[_0x59ef('0x1f')]=function(_0x964540,_0x51cc2f){return pm2['restart'](_0x59ef('0x20'))[_0x59ef('0x21')](function(_0xe39bc){logger[_0x59ef('0x17')]('pm2\x20restart\x20motion\x20%s',_0xe39bc);return _0x51cc2f[_0x59ef('0x13')](0xc8)[_0x59ef('0x12')]({'output':_0x59ef('0x22')});})[_0x59ef('0x23')](function(_0x138a1e){logger[_0x59ef('0x16')](_0x138a1e);return _0x51cc2f['status'](0x1f4)['json'](_0x138a1e);});};exports['migrations']=function(_0x921c7e,_0x1e3757){var _0x1ac90d=fs['readdirSync'](path[_0x59ef('0x24')](config[_0x59ef('0xb')],_0x59ef('0x25'),'migrations'));var _0x48d64b=[];for(var _0x493581=0x0;_0x493581<_0x1ac90d['length'];_0x493581++){var _0x5ae7df=_0x1ac90d[_0x493581]['replace'](_0x59ef('0x26'),'');if(compareVersions(module[_0x59ef('0xd')][_0x59ef('0xe')],_0x5ae7df)===-0x1){_0x48d64b[_0x59ef('0x27')](_0x5ae7df);}}if(_0x48d64b[_0x59ef('0x28')]){var _0x52a244=_0x48d64b[_0x59ef('0x29')](compareVersions);var _0x2abb3d=new Umzug({'storage':_0x59ef('0x2a'),'storageOptions':{'model':db[_0x59ef('0x2b')],'modelName':_0x59ef('0x2b'),'columnName':_0x59ef('0xe')},'migrations':{'params':[db[_0x59ef('0x2a')][_0x59ef('0x2c')](),db['sequelize'][_0x59ef('0x2d')],function(){throw new Error(_0x59ef('0x2e'));}],'path':path['join'](config[_0x59ef('0xb')],_0x59ef('0x25'),'migrations'),'pattern':/\.js$/}});_0x2abb3d['up']({'migrations':_[_0x59ef('0x2f')](_0x52a244,function(_0x5412f7){return _0x5412f7+'.js';})})[_0x59ef('0x21')](function(){return _0x1e3757[_0x59ef('0x13')](0xc8)[_0x59ef('0x12')]({'output':_0x59ef('0x30')+module[_0x59ef('0xd')][_0x59ef('0xe')]+_0x59ef('0x31')+_[_0x59ef('0x32')](_0x52a244),'migrations':_['join'](_0x52a244)});})[_0x59ef('0x23')](function(_0x4eec1b){if(_0x4eec1b instanceof db[_0x59ef('0x2a')][_0x59ef('0x33')]){return _0x1e3757['status'](0xc8)[_0x59ef('0x12')]({'output':_0x59ef('0x34')});}else{return _0x1e3757[_0x59ef('0x13')](0x1f4)['json'](_0x4eec1b);}});}else{return _0x1e3757[_0x59ef('0x13')](0xc8)['json']({'output':_0x59ef('0x34')});}}; \ No newline at end of file +var _0xacb9=['length','replace','.js','push','sequelize','Migration','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','map','\x20to\x20','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','version','compare-versions','child_process','exec','../../config/environment','../../config/logger','update','index','query','latest','tags','exports','2.0.0','status','json','origin','master','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','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','join','root','server'];(function(_0x255640,_0x212ebc){var _0x23e3b4=function(_0x31cc65){while(--_0x31cc65){_0x255640['push'](_0x255640['shift']());}};_0x23e3b4(++_0x212ebc);}(_0xacb9,0x79));var _0x9acb=function(_0x20a558,_0x160e0e){_0x20a558=_0x20a558-0x0;var _0x53d3f7=_0xacb9[_0x20a558];return _0x53d3f7;};'use strict';var Umzug=require(_0x9acb('0x0'));var path=require(_0x9acb('0x1'));var fs=require('fs');var _=require(_0x9acb('0x2'));var pkginfo=require(_0x9acb('0x3'))(module,_0x9acb('0x4'));var compareVersions=require(_0x9acb('0x5'));var exec=require(_0x9acb('0x6'))[_0x9acb('0x7')];var db=require('../../mysqldb')['db'];var config=require(_0x9acb('0x8'));var pm2=require('../../config/pm2');var logger=require(_0x9acb('0x9'))(_0x9acb('0xa'));var git=require('simple-git')(config['root']);exports[_0x9acb('0xb')]=function(_0x1f99cb,_0x2feccf){var _0x4cff76={'current':module['exports'][_0x9acb('0x4')],'phonebar':0x2};if(_0x1f99cb[_0x9acb('0xc')]&&_0x1f99cb[_0x9acb('0xc')][_0x9acb('0xd')]){return git['fetch']()[_0x9acb('0xe')](function(_0x2bdc9d,_0xdc8903){_0x4cff76[_0x9acb('0xd')]=(_0x2bdc9d?module[_0x9acb('0xf')]['version']:_0xdc8903[_0x9acb('0xd')])||_0x9acb('0x10');return _0x2feccf[_0x9acb('0x11')](0xc8)[_0x9acb('0x12')](_0x4cff76);});}else{return _0x2feccf['status'](0xc8)[_0x9acb('0x12')](_0x4cff76);}};exports['fetch']=function(_0x31e020,_0x2b8fda){return git['fetch']([_0x9acb('0x13'),_0x9acb('0x14')],function(_0x46cdec){if(_0x46cdec){logger[_0x9acb('0x15')](_0x46cdec);return _0x2b8fda[_0x9acb('0x11')](0x1f4)[_0x9acb('0x12')](_0x46cdec);}logger[_0x9acb('0x16')](_0x9acb('0x17'));return _0x2b8fda['status'](0xc8)[_0x9acb('0x12')]({'output':_0x9acb('0x18')});});};exports[_0x9acb('0x19')]=function(_0x59b620,_0xec0e14){return git[_0x9acb('0x19')]([_0x9acb('0x1a'),'FETCH_HEAD'],function(_0x269e5a){if(_0x269e5a){logger['error'](_0x269e5a);return _0xec0e14[_0x9acb('0x11')](0x1f4)[_0x9acb('0x12')](_0x269e5a);}logger['info'](_0x9acb('0x1b'));return _0xec0e14['status'](0xc8)[_0x9acb('0x12')]({'output':_0x9acb('0x1c')});});};exports[_0x9acb('0x1d')]=function(_0x4c69ad,_0x1f3e39){exec(_0x9acb('0x1e'),function(_0x2e82d5,_0x290c46,_0x3e2768){logger['info'](_0x290c46);logger['info'](_0x3e2768);if(_0x2e82d5){logger[_0x9acb('0x15')](_0x2e82d5);return _0x1f3e39['status'](0x1f4)[_0x9acb('0x12')](_0x2e82d5);}return _0x1f3e39[_0x9acb('0x11')](0xc8)[_0x9acb('0x12')]({'output':_0x290c46});});};exports[_0x9acb('0x1f')]=function(_0x2682e7,_0x36578a){return pm2['restart']('motion2')[_0x9acb('0x20')](function(_0x10292b){logger[_0x9acb('0x16')](_0x9acb('0x21'),_0x10292b);return _0x36578a[_0x9acb('0x11')](0xc8)['json']({'output':_0x9acb('0x22')});})[_0x9acb('0x23')](function(_0x2cfb40){logger['error'](_0x2cfb40);return _0x36578a[_0x9acb('0x11')](0x1f4)[_0x9acb('0x12')](_0x2cfb40);});};exports[_0x9acb('0x24')]=function(_0x40fc85,_0x399c6d){var _0x3453e4=fs[_0x9acb('0x25')](path[_0x9acb('0x26')](config[_0x9acb('0x27')],_0x9acb('0x28'),_0x9acb('0x24')));var _0x253e32=[];for(var _0xa435c5=0x0;_0xa435c5<_0x3453e4[_0x9acb('0x29')];_0xa435c5++){var _0x51d421=_0x3453e4[_0xa435c5][_0x9acb('0x2a')](_0x9acb('0x2b'),'');if(compareVersions(module['exports'][_0x9acb('0x4')],_0x51d421)===-0x1){_0x253e32[_0x9acb('0x2c')](_0x51d421);}}if(_0x253e32[_0x9acb('0x29')]){var _0x33839a=_0x253e32['sort'](compareVersions);var _0x363acd=new Umzug({'storage':_0x9acb('0x2d'),'storageOptions':{'model':db[_0x9acb('0x2e')],'modelName':_0x9acb('0x2e'),'columnName':_0x9acb('0x4')},'migrations':{'params':[db['sequelize'][_0x9acb('0x2f')](),db['sequelize'][_0x9acb('0x30')],function(){throw new Error(_0x9acb('0x31'));}],'path':path[_0x9acb('0x26')](config[_0x9acb('0x27')],_0x9acb('0x28'),_0x9acb('0x24')),'pattern':/\.js$/}});_0x363acd['up']({'migrations':_[_0x9acb('0x32')](_0x33839a,function(_0x1a672d){return _0x1a672d+'.js';})})[_0x9acb('0x20')](function(){return _0x399c6d[_0x9acb('0x11')](0xc8)[_0x9acb('0x12')]({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module[_0x9acb('0xf')][_0x9acb('0x4')]+_0x9acb('0x33')+_['last'](_0x33839a),'migrations':_[_0x9acb('0x26')](_0x33839a)});})['catch'](function(_0x2c2ee2){if(_0x2c2ee2 instanceof db[_0x9acb('0x2d')][_0x9acb('0x34')]){return _0x399c6d['status'](0xc8)[_0x9acb('0x12')]({'output':'Database\x20already\x20up-to-date'});}else{return _0x399c6d[_0x9acb('0x11')](0x1f4)[_0x9acb('0x12')](_0x2c2ee2);}});}else{return _0x399c6d[_0x9acb('0x11')](0xc8)[_0x9acb('0x12')]({'output':_0x9acb('0x35')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index 2f830a8..fb69d7d 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 _0x8fbb=['put','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceAgentReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create'];(function(_0x920930,_0x1a7331){var _0x4df989=function(_0x3962b2){while(--_0x3962b2){_0x920930['push'](_0x920930['shift']());}};_0x4df989(++_0x1a7331);}(_0x8fbb,0x1bc));var _0xb8fb=function(_0x5a9447,_0x218ec8){_0x5a9447=_0x5a9447-0x0;var _0x1902c9=_0x8fbb[_0x5a9447];return _0x1902c9;};'use strict';var multer=require('multer');var util=require(_0xb8fb('0x0'));var path=require(_0xb8fb('0x1'));var timeout=require('connect-timeout');var express=require(_0xb8fb('0x2'));var router=express[_0xb8fb('0x3')]();var fs_extra=require(_0xb8fb('0x4'));var auth=require(_0xb8fb('0x5'));var interaction=require(_0xb8fb('0x6'));var config=require('../../config/environment');var controller=require(_0xb8fb('0x7'));router[_0xb8fb('0x8')]('/',auth[_0xb8fb('0x9')](),controller['index']);router['get'](_0xb8fb('0xa'),auth['isAuthenticated'](),controller[_0xb8fb('0xb')]);router[_0xb8fb('0x8')](_0xb8fb('0xc'),auth[_0xb8fb('0x9')](),controller[_0xb8fb('0xd')]);router[_0xb8fb('0xe')]('/',auth['isAuthenticated'](),controller[_0xb8fb('0xf')]);router[_0xb8fb('0x10')](_0xb8fb('0xc'),auth[_0xb8fb('0x9')](),controller['update']);router[_0xb8fb('0x11')]('/:id',auth[_0xb8fb('0x9')](),controller[_0xb8fb('0x12')]);module[_0xb8fb('0x13')]=router; \ No newline at end of file +var _0xe429=['get','isAuthenticated','index','show','post','create','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller'];(function(_0x43841f,_0x4df0c4){var _0x417f61=function(_0x4a354e){while(--_0x4a354e){_0x43841f['push'](_0x43841f['shift']());}};_0x417f61(++_0x4df0c4);}(_0xe429,0x13f));var _0x9e42=function(_0x53f174,_0x52d33c){_0x53f174=_0x53f174-0x0;var _0x18dd8c=_0xe429[_0x53f174];return _0x18dd8c;};'use strict';var multer=require(_0x9e42('0x0'));var util=require(_0x9e42('0x1'));var path=require(_0x9e42('0x2'));var timeout=require(_0x9e42('0x3'));var express=require(_0x9e42('0x4'));var router=express[_0x9e42('0x5')]();var fs_extra=require(_0x9e42('0x6'));var auth=require(_0x9e42('0x7'));var interaction=require(_0x9e42('0x8'));var config=require(_0x9e42('0x9'));var controller=require(_0x9e42('0xa'));router[_0x9e42('0xb')]('/',auth[_0x9e42('0xc')](),controller[_0x9e42('0xd')]);router[_0x9e42('0xb')]('/describe',auth[_0x9e42('0xc')](),controller['describe']);router[_0x9e42('0xb')]('/:id',auth[_0x9e42('0xc')](),controller[_0x9e42('0xe')]);router[_0x9e42('0xf')]('/',auth['isAuthenticated'](),controller[_0x9e42('0x10')]);router[_0x9e42('0x11')](_0x9e42('0x12'),auth['isAuthenticated'](),controller[_0x9e42('0x13')]);router['delete'](_0x9e42('0x12'),auth[_0x9e42('0xc')](),controller[_0x9e42('0x14')]);module[_0x9e42('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index 0a5901a..1c9038c 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 _0xd5c8=['BOOLEAN','INTEGER','STRING','DATE'];(function(_0x33448a,_0x184f78){var _0x4ece1d=function(_0x4d7a0c){while(--_0x4d7a0c){_0x33448a['push'](_0x33448a['shift']());}};_0x4ece1d(++_0x184f78);}(_0xd5c8,0x166));var _0x8d5c=function(_0x1b68ba,_0x23687a){_0x1b68ba=_0x1b68ba-0x0;var _0xf49b11=_0xd5c8[_0x1b68ba];return _0xf49b11;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x8d5c('0x0')]},'uniqueid':{'type':Sequelize[_0x8d5c('0x0')]},'calleridnum':{'type':Sequelize[_0x8d5c('0x0')]},'calleridname':{'type':Sequelize[_0x8d5c('0x0')]},'queue':{'type':Sequelize[_0x8d5c('0x0')]},'interface':{'type':Sequelize[_0x8d5c('0x0')]},'membername':{'type':Sequelize[_0x8d5c('0x0')]},'agentcalledAt':{'type':Sequelize[_0x8d5c('0x1')]},'agentconnectAt':{'type':Sequelize[_0x8d5c('0x1')]},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize[_0x8d5c('0x1')]},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x8d5c('0x2')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x8d5c('0x2')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x8d5c('0x2')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x8d5c('0x3')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0x8d5c('0x0')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x8d5c('0x0')]},'channelstate':{'type':Sequelize[_0x8d5c('0x3')]},'channelstatedesc':{'type':Sequelize[_0x8d5c('0x0')]},'connectedlinenum':{'type':Sequelize[_0x8d5c('0x0')]},'connectedlinename':{'type':Sequelize[_0x8d5c('0x0')]},'language':{'type':Sequelize[_0x8d5c('0x0')]},'accountcode':{'type':Sequelize[_0x8d5c('0x0')]},'context':{'type':Sequelize[_0x8d5c('0x0')]},'exten':{'type':Sequelize[_0x8d5c('0x0')]},'priority':{'type':Sequelize[_0x8d5c('0x0')]},'destchannel':{'type':Sequelize[_0x8d5c('0x0')]},'destchannelstate':{'type':Sequelize[_0x8d5c('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0x8d5c('0x0')]},'destcalleridname':{'type':Sequelize[_0x8d5c('0x0')]},'destconnectedlinenum':{'type':Sequelize[_0x8d5c('0x0')]},'destconnectedlinename':{'type':Sequelize[_0x8d5c('0x0')]},'destlanguage':{'type':Sequelize[_0x8d5c('0x0')]},'destaccountcode':{'type':Sequelize[_0x8d5c('0x0')]},'destcontext':{'type':Sequelize[_0x8d5c('0x0')]},'destexten':{'type':Sequelize[_0x8d5c('0x0')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0x8d5c('0x0')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x8d5c('0x0')]},'answeredelsewheremembername':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x8d5c('0x0')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize[_0x8d5c('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0xe2cf=['INTEGER','BOOLEAN','exports','STRING','DATE'];(function(_0x18dbeb,_0x6868a6){var _0x7151b0=function(_0x583965){while(--_0x583965){_0x18dbeb['push'](_0x18dbeb['shift']());}};_0x7151b0(++_0x6868a6);}(_0xe2cf,0x1a1));var _0xfe2c=function(_0x32e2f3,_0x5c9fe7){_0x32e2f3=_0x32e2f3-0x0;var _0xcc7735=_0xe2cf[_0x32e2f3];return _0xcc7735;};'use strict';var Sequelize=require('sequelize');module[_0xfe2c('0x0')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xfe2c('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xfe2c('0x1')]},'queue':{'type':Sequelize[_0xfe2c('0x1')]},'interface':{'type':Sequelize[_0xfe2c('0x1')]},'membername':{'type':Sequelize[_0xfe2c('0x1')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0xfe2c('0x2')]},'agentcompleteAt':{'type':Sequelize[_0xfe2c('0x2')]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0xfe2c('0x3')]},'agentcomplete':{'type':Sequelize[_0xfe2c('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'talktime':{'type':Sequelize[_0xfe2c('0x3')]},'agentacw':{'type':Sequelize[_0xfe2c('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xfe2c('0x3')]},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xfe2c('0x1')]},'channelstate':{'type':Sequelize[_0xfe2c('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xfe2c('0x1')]},'connectedlinename':{'type':Sequelize[_0xfe2c('0x1')]},'language':{'type':Sequelize[_0xfe2c('0x1')]},'accountcode':{'type':Sequelize[_0xfe2c('0x1')]},'context':{'type':Sequelize[_0xfe2c('0x1')]},'exten':{'type':Sequelize[_0xfe2c('0x1')]},'priority':{'type':Sequelize[_0xfe2c('0x1')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0xfe2c('0x1')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0xfe2c('0x1')]},'destaccountcode':{'type':Sequelize[_0xfe2c('0x1')]},'destcontext':{'type':Sequelize[_0xfe2c('0x1')]},'destexten':{'type':Sequelize[_0xfe2c('0x1')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize['STRING']},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xfe2c('0x1')]},'answeredelsewheremembername':{'type':Sequelize[_0xfe2c('0x1')]},'transfer':{'type':Sequelize[_0xfe2c('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xfe2c('0x1')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0xfe2c('0x1')]},'transferuniqueid':{'type':Sequelize[_0xfe2c('0x1')]},'agententerreason':{'type':Sequelize[_0xfe2c('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.controller.js b/server/api/voiceAgentReport/voiceAgentReport.controller.js index 77dcfbb..63a85ff 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(_0x4fbfd9,_0x3ab91a){var _0x31dc94=function(_0x11e53b){while(--_0x11e53b){_0x4fbfd9['push'](_0x4fbfd9['shift']());}};_0x31dc94(++_0x3ab91a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0xa9e0[_0x3635ce];return _0x97ecd0;};'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(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_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 72716de..7af1285 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 _0x1b20=['bluebird','request-promise','path','rimraf','../../config/environment','./voiceAgentReport.attributes','exports','define','VoiceAgentReport','report_agent','destuniqueid','util','../../config/logger'];(function(_0x32a73d,_0x5cdbc9){var _0x4d4942=function(_0x1a68c7){while(--_0x1a68c7){_0x32a73d['push'](_0x32a73d['shift']());}};_0x4d4942(++_0x5cdbc9);}(_0x1b20,0x66));var _0x01b2=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x1b20[_0x502c7d];return _0x30b7ed;};'use strict';var _=require('lodash');var util=require(_0x01b2('0x0'));var logger=require(_0x01b2('0x1'))('api');var moment=require('moment');var BPromise=require(_0x01b2('0x2'));var rp=require(_0x01b2('0x3'));var fs=require('fs');var path=require(_0x01b2('0x4'));var rimraf=require(_0x01b2('0x5'));var config=require(_0x01b2('0x6'));var attributes=require(_0x01b2('0x7'));module[_0x01b2('0x8')]=function(_0x28de4a,_0x46e745){return _0x28de4a[_0x01b2('0x9')](_0x01b2('0xa'),attributes,{'tableName':_0x01b2('0xb'),'paranoid':![],'indexes':[{'fields':['uniqueid',_0x01b2('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5a93=['exports','define','VoiceAgentReport','report_agent','uniqueid','destuniqueid','util','api','moment','path','rimraf','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5a93,0xf6));var _0x35a9=function(_0x2f448f,_0x392ab7){_0x2f448f=_0x2f448f-0x0;var _0x5205f2=_0x5a93[_0x2f448f];return _0x5205f2;};'use strict';var _=require('lodash');var util=require(_0x35a9('0x0'));var logger=require('../../config/logger')(_0x35a9('0x1'));var moment=require(_0x35a9('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x35a9('0x3'));var rimraf=require(_0x35a9('0x4'));var config=require(_0x35a9('0x5'));var attributes=require('./voiceAgentReport.attributes');module[_0x35a9('0x6')]=function(_0x27ed9f,_0x2e8a14){return _0x27ed9f[_0x35a9('0x7')](_0x35a9('0x8'),attributes,{'tableName':_0x35a9('0x9'),'paranoid':![],'indexes':[{'fields':[_0x35a9('0xa'),_0x35a9('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index 7df916e..3261fe4 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 _0x1170=['options','raw','debug','catch','UpdateVoiceAgentReport','update','where','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateVoiceAgentReport','VoiceAgentReport','create'];(function(_0x5dc6e8,_0x1ed7cc){var _0x2cb306=function(_0xae157e){while(--_0xae157e){_0x5dc6e8['push'](_0x5dc6e8['shift']());}};_0x2cb306(++_0x1ed7cc);}(_0x1170,0x1d5));var _0x0117=function(_0x10fa63,_0x2095a2){_0x10fa63=_0x10fa63-0x0;var _0x4f1463=_0x1170[_0x10fa63];return _0x4f1463;};'use strict';var _=require(_0x0117('0x0'));var util=require(_0x0117('0x1'));var moment=require(_0x0117('0x2'));var BPromise=require(_0x0117('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0117('0x4'));var db=require(_0x0117('0x5'))['db'];var utils=require(_0x0117('0x6'));var logger=require(_0x0117('0x7'))(_0x0117('0x8'));var config=require(_0x0117('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x0117('0xa')][_0x0117('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4c5061,_0x362d29,_0x18b51a){return new BPromise(function(_0x486ae1,_0x7d2425){return client[_0x0117('0xc')](_0x4c5061,_0x18b51a)[_0x0117('0xd')](function(_0x88892c){logger[_0x0117('0xe')](_0x0117('0xf'),_0x362d29,_0x0117('0x10'));logger['debug'](_0x0117('0x11'),_0x362d29,'request\x20sent',JSON[_0x0117('0x12')](_0x88892c));if(_0x88892c[_0x0117('0x13')]){if(_0x88892c[_0x0117('0x13')][_0x0117('0x14')]===0x1f4){logger[_0x0117('0x13')](_0x0117('0xf'),_0x362d29,_0x88892c[_0x0117('0x13')][_0x0117('0x15')]);return _0x7d2425(_0x88892c[_0x0117('0x13')][_0x0117('0x15')]);}logger[_0x0117('0x13')](_0x0117('0xf'),_0x362d29,_0x88892c[_0x0117('0x13')][_0x0117('0x15')]);return _0x486ae1(_0x88892c['error']['message']);}else{logger[_0x0117('0xe')](_0x0117('0xf'),_0x362d29,_0x0117('0x10'));_0x486ae1(_0x88892c[_0x0117('0x16')][_0x0117('0x15')]);}})['catch'](function(_0x195417){logger[_0x0117('0x13')](_0x0117('0xf'),_0x362d29,_0x195417);_0x7d2425(_0x195417);});});}exports[_0x0117('0x17')]=function(_0x35cbec){var _0x209e70=this;return new Promise(function(_0x205b9c,_0xad6ecd){return db[_0x0117('0x18')][_0x0117('0x19')](_0x35cbec['body'],{'raw':_0x35cbec[_0x0117('0x1a')]?_0x35cbec[_0x0117('0x1a')][_0x0117('0x1b')]===undefined?!![]:![]:!![]})[_0x0117('0xd')](function(_0x493b20){logger[_0x0117('0xe')](_0x0117('0x17'),_0x35cbec);logger[_0x0117('0x1c')]('CreateVoiceAgentReport',_0x35cbec,JSON['stringify'](_0x493b20));_0x205b9c(_0x493b20);})[_0x0117('0x1d')](function(_0x2d617e){logger[_0x0117('0x13')](_0x0117('0x17'),_0x2d617e[_0x0117('0x15')],_0x35cbec);_0xad6ecd(_0x209e70['error'](0x1f4,_0x2d617e[_0x0117('0x15')]));});});};exports[_0x0117('0x1e')]=function(_0x66e40e){var _0x874e9e=this;return new Promise(function(_0x5043fc,_0x1313b){return db[_0x0117('0x18')][_0x0117('0x1f')](_0x66e40e['body'],{'raw':_0x66e40e[_0x0117('0x1a')]?_0x66e40e[_0x0117('0x1a')][_0x0117('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x66e40e[_0x0117('0x1a')]?_0x66e40e['options'][_0x0117('0x20')]||null:null,'attributes':_0x66e40e[_0x0117('0x1a')]?_0x66e40e[_0x0117('0x1a')]['attributes']||null:null,'limit':_0x66e40e[_0x0117('0x1a')]?_0x66e40e[_0x0117('0x1a')]['limit']||null:null})[_0x0117('0xd')](function(_0x2b3c8d){logger['info']('UpdateVoiceAgentReport',_0x66e40e);logger[_0x0117('0x1c')]('UpdateVoiceAgentReport',_0x66e40e,JSON[_0x0117('0x12')](_0x2b3c8d));_0x5043fc(_0x2b3c8d);})[_0x0117('0x1d')](function(_0x177771){logger[_0x0117('0x13')](_0x0117('0x1e'),_0x177771[_0x0117('0x15')],_0x66e40e);_0x1313b(_0x874e9e['error'](0x1f4,_0x177771[_0x0117('0x15')]));});});}; \ No newline at end of file +var _0x3171=['../../config/environment','jayson/promise','client','http','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','VoiceAgentReport','create','options','raw','then','CreateVoiceAgentReport','UpdateVoiceAgentReport','update','where','attributes','limit','util','moment','randomstring','../../mysqldb'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x3171,0x70));var _0x1317=function(_0x390733,_0x1e3d32){_0x390733=_0x390733-0x0;var _0x33beb9=_0x3171[_0x390733];return _0x33beb9;};'use strict';var _=require('lodash');var util=require(_0x1317('0x0'));var moment=require(_0x1317('0x1'));var BPromise=require('bluebird');var rs=require(_0x1317('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1317('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x1317('0x4'));var jayson=require(_0x1317('0x5'));var client=jayson[_0x1317('0x6')][_0x1317('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x6c75ef,_0x2d6c8e,_0x2c9b54){return new BPromise(function(_0x23c24d,_0x2fdbca){return client['request'](_0x6c75ef,_0x2c9b54)['then'](function(_0x41777b){logger['info'](_0x1317('0x8'),_0x2d6c8e,_0x1317('0x9'));logger[_0x1317('0xa')](_0x1317('0xb'),_0x2d6c8e,_0x1317('0x9'),JSON[_0x1317('0xc')](_0x41777b));if(_0x41777b[_0x1317('0xd')]){if(_0x41777b[_0x1317('0xd')][_0x1317('0xe')]===0x1f4){logger[_0x1317('0xd')](_0x1317('0x8'),_0x2d6c8e,_0x41777b['error'][_0x1317('0xf')]);return _0x2fdbca(_0x41777b[_0x1317('0xd')][_0x1317('0xf')]);}logger['error'](_0x1317('0x8'),_0x2d6c8e,_0x41777b[_0x1317('0xd')]['message']);return _0x23c24d(_0x41777b['error'][_0x1317('0xf')]);}else{logger[_0x1317('0x10')](_0x1317('0x8'),_0x2d6c8e,_0x1317('0x9'));_0x23c24d(_0x41777b['result'][_0x1317('0xf')]);}})[_0x1317('0x11')](function(_0x32fa75){logger['error'](_0x1317('0x8'),_0x2d6c8e,_0x32fa75);_0x2fdbca(_0x32fa75);});});}exports['CreateVoiceAgentReport']=function(_0x282d83){var _0x24607c=this;return new Promise(function(_0x654a41,_0x2c711a){return db[_0x1317('0x12')][_0x1317('0x13')](_0x282d83['body'],{'raw':_0x282d83[_0x1317('0x14')]?_0x282d83[_0x1317('0x14')][_0x1317('0x15')]===undefined?!![]:![]:!![]})[_0x1317('0x16')](function(_0x556276){logger[_0x1317('0x10')](_0x1317('0x17'),_0x282d83);logger['debug'](_0x1317('0x17'),_0x282d83,JSON['stringify'](_0x556276));_0x654a41(_0x556276);})[_0x1317('0x11')](function(_0x141e35){logger['error'](_0x1317('0x17'),_0x141e35[_0x1317('0xf')],_0x282d83);_0x2c711a(_0x24607c[_0x1317('0xd')](0x1f4,_0x141e35[_0x1317('0xf')]));});});};exports[_0x1317('0x18')]=function(_0x420561){var _0x1b7ba5=this;return new Promise(function(_0x591486,_0x469a8a){return db['VoiceAgentReport'][_0x1317('0x19')](_0x420561['body'],{'raw':_0x420561[_0x1317('0x14')]?_0x420561['options'][_0x1317('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x420561[_0x1317('0x14')]?_0x420561['options'][_0x1317('0x1a')]||null:null,'attributes':_0x420561[_0x1317('0x14')]?_0x420561[_0x1317('0x14')][_0x1317('0x1b')]||null:null,'limit':_0x420561[_0x1317('0x14')]?_0x420561[_0x1317('0x14')][_0x1317('0x1c')]||null:null})[_0x1317('0x16')](function(_0x25569a){logger[_0x1317('0x10')](_0x1317('0x18'),_0x420561);logger[_0x1317('0xa')](_0x1317('0x18'),_0x420561,JSON['stringify'](_0x25569a));_0x591486(_0x25569a);})[_0x1317('0x11')](function(_0x581fae){logger[_0x1317('0xd')](_0x1317('0x18'),_0x581fae[_0x1317('0xf')],_0x420561);_0x469a8a(_0x1b7ba5['error'](0x1f4,_0x581fae[_0x1317('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index bb2f93d..2321eb2 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 _0x6b8f=['destroy','exports','util','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./voiceCallReport.controller','get','index','/describe','isAuthenticated','/:id','show','post','create','put'];(function(_0x370284,_0x3348d5){var _0x1445c8=function(_0x573a25){while(--_0x573a25){_0x370284['push'](_0x370284['shift']());}};_0x1445c8(++_0x3348d5);}(_0x6b8f,0x1bc));var _0xf6b8=function(_0x27a02d,_0x22b09d){_0x27a02d=_0x27a02d-0x0;var _0x41edd4=_0x6b8f[_0x27a02d];return _0x41edd4;};'use strict';var multer=require('multer');var util=require(_0xf6b8('0x0'));var path=require('path');var timeout=require(_0xf6b8('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xf6b8('0x2'));var auth=require(_0xf6b8('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xf6b8('0x4'));var controller=require(_0xf6b8('0x5'));router[_0xf6b8('0x6')]('/',auth['isAuthenticated'](),controller[_0xf6b8('0x7')]);router[_0xf6b8('0x6')](_0xf6b8('0x8'),auth[_0xf6b8('0x9')](),controller['describe']);router['get'](_0xf6b8('0xa'),auth['isAuthenticated'](),controller[_0xf6b8('0xb')]);router[_0xf6b8('0xc')]('/',auth[_0xf6b8('0x9')](),controller[_0xf6b8('0xd')]);router[_0xf6b8('0xe')](_0xf6b8('0xa'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xf6b8('0xa'),auth[_0xf6b8('0x9')](),controller[_0xf6b8('0xf')]);module[_0xf6b8('0x10')]=router; \ No newline at end of file +var _0x9b67=['../../components/auth/service','./voiceCallReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','put','destroy','multer','util','path','connect-timeout','express','fs-extra'];(function(_0x59e9e0,_0x34128f){var _0x32446c=function(_0x17f492){while(--_0x17f492){_0x59e9e0['push'](_0x59e9e0['shift']());}};_0x32446c(++_0x34128f);}(_0x9b67,0xf6));var _0x79b6=function(_0x243e2e,_0xdfc79e){_0x243e2e=_0x243e2e-0x0;var _0x4f0650=_0x9b67[_0x243e2e];return _0x4f0650;};'use strict';var multer=require(_0x79b6('0x0'));var util=require(_0x79b6('0x1'));var path=require(_0x79b6('0x2'));var timeout=require(_0x79b6('0x3'));var express=require(_0x79b6('0x4'));var router=express['Router']();var fs_extra=require(_0x79b6('0x5'));var auth=require(_0x79b6('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x79b6('0x7'));router[_0x79b6('0x8')]('/',auth[_0x79b6('0x9')](),controller[_0x79b6('0xa')]);router[_0x79b6('0x8')](_0x79b6('0xb'),auth[_0x79b6('0x9')](),controller['describe']);router[_0x79b6('0x8')](_0x79b6('0xc'),auth[_0x79b6('0x9')](),controller[_0x79b6('0xd')]);router[_0x79b6('0xe')]('/',auth['isAuthenticated'](),controller[_0x79b6('0xf')]);router[_0x79b6('0x10')](_0x79b6('0xc'),auth[_0x79b6('0x9')](),controller['update']);router['delete'](_0x79b6('0xc'),auth[_0x79b6('0x9')](),controller[_0x79b6('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index 71160fc..82c5fcb 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 _0xa149=['sequelize','exports','STRING','ENUM','inbound','internal','outbound','inbound-fax','outbound-fax','DATE','INTEGER'];(function(_0x51fa36,_0x569b13){var _0x33ed7a=function(_0x179202){while(--_0x179202){_0x51fa36['push'](_0x51fa36['shift']());}};_0x33ed7a(++_0x569b13);}(_0xa149,0x18c));var _0x9a14=function(_0x48c8b1,_0x392d97){_0x48c8b1=_0x48c8b1-0x0;var _0x1c4d61=_0xa149[_0x48c8b1];return _0x1c4d61;};'use strict';var Sequelize=require(_0x9a14('0x0'));module[_0x9a14('0x1')]={'uniqueid':{'type':Sequelize[_0x9a14('0x2')]},'type':{'type':Sequelize[_0x9a14('0x3')](_0x9a14('0x4'),_0x9a14('0x5'),_0x9a14('0x6'),_0x9a14('0x7'),_0x9a14('0x8'),'dialer')},'tag':{'type':Sequelize[_0x9a14('0x2')]},'accountcode':{'type':Sequelize[_0x9a14('0x2')]},'source':{'type':Sequelize['STRING']},'destination':{'type':Sequelize[_0x9a14('0x2')]},'destinationcontext':{'type':Sequelize[_0x9a14('0x2')]},'callerid':{'type':Sequelize[_0x9a14('0x2')]},'channel':{'type':Sequelize[_0x9a14('0x2')]},'destinationchannel':{'type':Sequelize[_0x9a14('0x2')]},'lastapplication':{'type':Sequelize[_0x9a14('0x2')]},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize[_0x9a14('0x9')]},'systemanswertime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x9a14('0x9')]},'endtime':{'type':Sequelize[_0x9a14('0x9')]},'duration':{'type':Sequelize[_0x9a14('0xa')]},'billableseconds':{'type':Sequelize[_0x9a14('0xa')]},'mohtime':{'type':Sequelize[_0x9a14('0xa')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x9a14('0x2')]},'amaflags':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize['STRING']},'userThirdDisposition':{'type':Sequelize[_0x9a14('0x2')]},'note':{'type':Sequelize[_0x9a14('0x2')]},'prefix':{'type':Sequelize['STRING']},'routeid':{'type':Sequelize[_0x9a14('0xa')]},'sipcallid':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x25e7=['DATE','INTEGER','sequelize','exports','STRING','ENUM','inbound','internal','outbound','inbound-fax','outbound-fax','dialer','TEXT'];(function(_0x13ea00,_0x12f610){var _0x1f7347=function(_0x34ae63){while(--_0x34ae63){_0x13ea00['push'](_0x13ea00['shift']());}};_0x1f7347(++_0x12f610);}(_0x25e7,0x1d6));var _0x725e=function(_0x445101,_0x2414bf){_0x445101=_0x445101-0x0;var _0x3c3d04=_0x25e7[_0x445101];return _0x3c3d04;};'use strict';var Sequelize=require(_0x725e('0x0'));module[_0x725e('0x1')]={'uniqueid':{'type':Sequelize[_0x725e('0x2')]},'type':{'type':Sequelize[_0x725e('0x3')](_0x725e('0x4'),_0x725e('0x5'),_0x725e('0x6'),_0x725e('0x7'),_0x725e('0x8'),_0x725e('0x9'))},'tag':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'source':{'type':Sequelize[_0x725e('0x2')]},'destination':{'type':Sequelize['STRING']},'destinationcontext':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x725e('0x2')]},'channel':{'type':Sequelize[_0x725e('0x2')]},'destinationchannel':{'type':Sequelize[_0x725e('0x2')]},'lastapplication':{'type':Sequelize[_0x725e('0x2')]},'lastdata':{'type':Sequelize[_0x725e('0xa')]},'starttime':{'type':Sequelize[_0x725e('0xb')]},'systemanswertime':{'type':Sequelize[_0x725e('0xb')]},'answertime':{'type':Sequelize[_0x725e('0xb')]},'endtime':{'type':Sequelize[_0x725e('0xb')]},'duration':{'type':Sequelize[_0x725e('0xc')]},'billableseconds':{'type':Sequelize[_0x725e('0xc')]},'mohtime':{'type':Sequelize[_0x725e('0xc')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x725e('0x2')]},'userDisposition':{'type':Sequelize[_0x725e('0x2')]},'userSecondDisposition':{'type':Sequelize['STRING']},'userThirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x725e('0x2')]},'prefix':{'type':Sequelize[_0x725e('0x2')]},'routeid':{'type':Sequelize['INTEGER']},'sipcallid':{'type':Sequelize[_0x725e('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index 2ebae00..bdfb498 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 _0xdb28=['options','includeAll','fullname','User','findAll','rows','catch','show','params','rawAttributes','intersection','include','find','create','destroy','describe','body','uniqueid','user','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','apply','save','update','then','sendStatus','error','stack','name','send','index','VoiceCallReport','fieldName','type','key','map','query','keys','model','fields','attributes','length','nolimit','order','sort','filters','filter','where','VIRTUAL','merge'];(function(_0x64c978,_0x16f14e){var _0x4629d9=function(_0x5a8595){while(--_0x5a8595){_0x64c978['push'](_0x64c978['shift']());}};_0x4629d9(++_0x16f14e);}(_0xdb28,0x106));var _0x8db2=function(_0x29b5aa,_0x303d65){_0x29b5aa=_0x29b5aa-0x0;var _0x13f847=_0xdb28[_0x29b5aa];return _0x13f847;};'use strict';var emlformat=require(_0x8db2('0x0'));var rimraf=require(_0x8db2('0x1'));var zipdir=require(_0x8db2('0x2'));var jsonpatch=require(_0x8db2('0x3'));var rp=require('request-promise');var moment=require(_0x8db2('0x4'));var BPromise=require(_0x8db2('0x5'));var Mustache=require(_0x8db2('0x6'));var util=require(_0x8db2('0x7'));var path=require(_0x8db2('0x8'));var sox=require('sox');var csv=require(_0x8db2('0x9'));var ejs=require(_0x8db2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8db2('0xb'));var crypto=require(_0x8db2('0xc'));var jsforce=require(_0x8db2('0xd'));var deskjs=require(_0x8db2('0xe'));var toCsv=require(_0x8db2('0x9'));var querystring=require(_0x8db2('0xf'));var Papa=require(_0x8db2('0x10'));var Redis=require('ioredis');var authService=require(_0x8db2('0x11'));var qs=require(_0x8db2('0x12'));var as=require(_0x8db2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8db2('0x14'))(_0x8db2('0x15'));var utils=require('../../config/utils');var config=require(_0x8db2('0x16'));var licenseUtil=require(_0x8db2('0x17'));var db=require(_0x8db2('0x18'))['db'];function respondWithStatusCode(_0x204f49,_0x37d017){_0x37d017=_0x37d017||0xcc;return function(_0x559fb1){if(_0x559fb1){return _0x204f49['sendStatus'](_0x37d017);}return _0x204f49[_0x8db2('0x19')](_0x37d017)[_0x8db2('0x1a')]();};}function respondWithResult(_0x350d61,_0x1d6a15){_0x1d6a15=_0x1d6a15||0xc8;return function(_0x227355){if(_0x227355){return _0x350d61[_0x8db2('0x19')](_0x1d6a15)[_0x8db2('0x1b')](_0x227355);}};}function respondWithFilteredResult(_0x3c96a7,_0x131252){return function(_0x16c8c2){if(_0x16c8c2){var _0x5489a9=typeof _0x131252[_0x8db2('0x1c')]===_0x8db2('0x1d')&&typeof _0x131252['limit']===_0x8db2('0x1d');var _0x44957d=_0x16c8c2[_0x8db2('0x1e')];var _0x3fddc2=_0x5489a9?0x0:_0x131252[_0x8db2('0x1c')];var _0x46ce14=_0x5489a9?_0x16c8c2['count']:_0x131252['offset']+_0x131252[_0x8db2('0x1f')];var _0x104e33;if(_0x46ce14>=_0x44957d){_0x46ce14=_0x44957d;_0x104e33=0xc8;}else{_0x104e33=0xce;}_0x3c96a7[_0x8db2('0x19')](_0x104e33);return _0x3c96a7[_0x8db2('0x20')]('Content-Range',_0x3fddc2+'-'+_0x46ce14+'/'+_0x44957d)[_0x8db2('0x1b')](_0x16c8c2);}return null;};}function patchUpdates(_0x36a9ff){return function(_0x260940){try{jsonpatch[_0x8db2('0x21')](_0x260940,_0x36a9ff,!![]);}catch(_0x3dbe8e){return BPromise['reject'](_0x3dbe8e);}return _0x260940[_0x8db2('0x22')]();};}function saveUpdates(_0x3e30e6,_0x18f69c){return function(_0x125be2){if(_0x125be2){return _0x125be2[_0x8db2('0x23')](_0x3e30e6)[_0x8db2('0x24')](function(_0x796ec1){return _0x796ec1;});}return null;};}function removeEntity(_0x5c6614,_0x256202){return function(_0x4f6516){if(_0x4f6516){return _0x4f6516['destroy']()['then'](function(){_0x5c6614['status'](0xcc)[_0x8db2('0x1a')]();});}};}function handleEntityNotFound(_0x29b5cd,_0x3be281){return function(_0x2baed0){if(!_0x2baed0){_0x29b5cd[_0x8db2('0x25')](0x194);}return _0x2baed0;};}function handleError(_0x8d4f54,_0x58cd9d){_0x58cd9d=_0x58cd9d||0x1f4;return function(_0x3544ba){logger[_0x8db2('0x26')](_0x3544ba[_0x8db2('0x27')]);if(_0x3544ba[_0x8db2('0x28')]){delete _0x3544ba['name'];}_0x8d4f54[_0x8db2('0x19')](_0x58cd9d)[_0x8db2('0x29')](_0x3544ba);};}exports[_0x8db2('0x2a')]=function(_0x1687ed,_0xbe5ece){var _0x21bae5={},_0xa54ea3={},_0x3124d5={'count':0x0,'rows':[]};var _0xbc5366=_['map'](db[_0x8db2('0x2b')]['rawAttributes'],function(_0x59cb77){return{'name':_0x59cb77[_0x8db2('0x2c')],'type':_0x59cb77[_0x8db2('0x2d')][_0x8db2('0x2e')]};});_0xa54ea3['model']=_[_0x8db2('0x2f')](_0xbc5366,'name');_0xa54ea3[_0x8db2('0x30')]=_[_0x8db2('0x31')](_0x1687ed[_0x8db2('0x30')]);_0xa54ea3['filters']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],_0xa54ea3[_0x8db2('0x30')]);_0x21bae5['attributes']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],qs[_0x8db2('0x33')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x33')]));_0x21bae5[_0x8db2('0x34')]=_0x21bae5[_0x8db2('0x34')][_0x8db2('0x35')]?_0x21bae5[_0x8db2('0x34')]:_0xa54ea3[_0x8db2('0x32')];if(!_0x1687ed[_0x8db2('0x30')]['hasOwnProperty'](_0x8db2('0x36'))){_0x21bae5[_0x8db2('0x1f')]=qs['limit'](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x1f')]);_0x21bae5['offset']=qs['offset'](_0x1687ed[_0x8db2('0x30')]['offset']);}_0x21bae5[_0x8db2('0x37')]=qs[_0x8db2('0x38')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x38')]);_0x21bae5['where']=qs[_0x8db2('0x39')](_['pick'](_0x1687ed[_0x8db2('0x30')],_0xa54ea3[_0x8db2('0x39')]),_0xbc5366);if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]){_0x21bae5['where']=_['merge'](_0x21bae5[_0x8db2('0x3b')],{'$or':_[_0x8db2('0x2f')](_0xbc5366,function(_0x5dc2b4){if(_0x5dc2b4[_0x8db2('0x2d')]!==_0x8db2('0x3c')){var _0x656dd2={};_0x656dd2[_0x5dc2b4['name']]={'$like':'%'+_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]+'%'};return _0x656dd2;}})});}_0x21bae5=_[_0x8db2('0x3d')]({},_0x21bae5,_0x1687ed[_0x8db2('0x3e')]);var _0x2e6f0c={'where':_0x21bae5[_0x8db2('0x3b')]};return db[_0x8db2('0x2b')][_0x8db2('0x1e')](_0x2e6f0c)[_0x8db2('0x24')](function(_0x63c561){_0x3124d5[_0x8db2('0x1e')]=_0x63c561;if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3f')]){_0x21bae5['include']=[{'attributes':['id',_0x8db2('0x28'),_0x8db2('0x40'),'alias'],'model':db['User'],'as':_0x8db2('0x41')}];}return db['VoiceCallReport'][_0x8db2('0x42')](_0x21bae5);})[_0x8db2('0x24')](function(_0x313130){_0x3124d5[_0x8db2('0x43')]=_0x313130;return _0x3124d5;})[_0x8db2('0x24')](respondWithFilteredResult(_0xbe5ece,_0x21bae5))[_0x8db2('0x44')](handleError(_0xbe5ece,null));};exports[_0x8db2('0x45')]=function(_0x5c97ef,_0x2f86b1){var _0x3d44de={'raw':!![],'where':{'id':_0x5c97ef[_0x8db2('0x46')]['id']}},_0x40c69e={};_0x40c69e['model']=_[_0x8db2('0x31')](db[_0x8db2('0x2b')][_0x8db2('0x47')]);_0x40c69e[_0x8db2('0x30')]=_['keys'](_0x5c97ef[_0x8db2('0x30')]);_0x40c69e['filters']=_[_0x8db2('0x48')](_0x40c69e[_0x8db2('0x32')],_0x40c69e[_0x8db2('0x30')]);_0x3d44de['attributes']=_['intersection'](_0x40c69e[_0x8db2('0x32')],qs['fields'](_0x5c97ef[_0x8db2('0x30')][_0x8db2('0x33')]));_0x3d44de[_0x8db2('0x34')]=_0x3d44de[_0x8db2('0x34')][_0x8db2('0x35')]?_0x3d44de[_0x8db2('0x34')]:_0x40c69e[_0x8db2('0x32')];if(_0x5c97ef[_0x8db2('0x30')][_0x8db2('0x3f')]){_0x3d44de[_0x8db2('0x49')]=[{'all':!![]}];}_0x3d44de=_[_0x8db2('0x3d')]({},_0x3d44de,_0x5c97ef[_0x8db2('0x3e')]);return db['VoiceCallReport'][_0x8db2('0x4a')](_0x3d44de)[_0x8db2('0x24')](handleEntityNotFound(_0x2f86b1,null))[_0x8db2('0x24')](respondWithResult(_0x2f86b1,null))[_0x8db2('0x44')](handleError(_0x2f86b1,null));};exports['create']=function(_0x4ffd9d,_0x11c224){return db[_0x8db2('0x2b')][_0x8db2('0x4b')](_0x4ffd9d['body'],{})['then'](respondWithResult(_0x11c224,0xc9))['catch'](handleError(_0x11c224,null));};exports[_0x8db2('0x4c')]=function(_0x368c37,_0x55c7dd){return db[_0x8db2('0x2b')][_0x8db2('0x4a')]({'where':{'id':_0x368c37[_0x8db2('0x46')]['id']}})[_0x8db2('0x24')](handleEntityNotFound(_0x55c7dd,null))['then'](removeEntity(_0x55c7dd,null))['catch'](handleError(_0x55c7dd,null));};exports[_0x8db2('0x4d')]=function(_0x18c6ef,_0x2908e4){return db[_0x8db2('0x2b')][_0x8db2('0x4d')]()[_0x8db2('0x24')](respondWithResult(_0x2908e4,null))[_0x8db2('0x44')](handleError(_0x2908e4,null));};exports[_0x8db2('0x23')]=function(_0x4187d6,_0x426ae0){if(_0x4187d6[_0x8db2('0x4e')][_0x8db2('0x4f')]){delete _0x4187d6[_0x8db2('0x4e')][_0x8db2('0x4f')];}return db[_0x8db2('0x2b')]['find']({'where':{'uniqueid':_0x4187d6[_0x8db2('0x46')]['id'],'UserId':{'$or':[null,_0x4187d6[_0x8db2('0x50')]['id']]}}})['then'](handleEntityNotFound(_0x426ae0,null))[_0x8db2('0x24')](saveUpdates(_0x4187d6[_0x8db2('0x4e')],null))[_0x8db2('0x24')](respondWithResult(_0x426ae0,null))['catch'](handleError(_0x426ae0,null));}; \ No newline at end of file +var _0x2ef3=['pick','filter','merge','options','VoiceCallReport','then','includeAll','include','fullname','alias','User','findAll','rows','catch','show','params','keys','find','create','destroy','describe','body','uniqueid','user','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','update','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where'];(function(_0x41c381,_0x1176bd){var _0x427981=function(_0x508843){while(--_0x508843){_0x41c381['push'](_0x41c381['shift']());}};_0x427981(++_0x1176bd);}(_0x2ef3,0xba));var _0x32ef=function(_0x5431bd,_0x19d955){_0x5431bd=_0x5431bd-0x0;var _0x54c402=_0x2ef3[_0x5431bd];return _0x54c402;};'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['VoiceCallReport'][_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')]=[{'attributes':['id',_0x32ef('0x27'),_0x32ef('0x41'),_0x32ef('0x42')],'model':db[_0x32ef('0x43')],'as':'User'}];}return db['VoiceCallReport'][_0x32ef('0x44')](_0x5a04cd);})[_0x32ef('0x3e')](function(_0x2a33dd){_0x3c569d[_0x32ef('0x45')]=_0x2a33dd;return _0x3c569d;})['then'](respondWithFilteredResult(_0x2f5d06,_0x5a04cd))[_0x32ef('0x46')](handleError(_0x2f5d06,null));};exports[_0x32ef('0x47')]=function(_0x5d2f06,_0x4744ba){var _0x4bc5bc={'raw':!![],'where':{'id':_0x5d2f06[_0x32ef('0x48')]['id']}},_0xcb3c08={};_0xcb3c08[_0x32ef('0x2e')]=_[_0x32ef('0x49')](db[_0x32ef('0x3d')][_0x32ef('0x2a')]);_0xcb3c08[_0x32ef('0x2f')]=_[_0x32ef('0x49')](_0x5d2f06[_0x32ef('0x2f')]);_0xcb3c08[_0x32ef('0x30')]=_['intersection'](_0xcb3c08[_0x32ef('0x2e')],_0xcb3c08['query']);_0x4bc5bc[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0xcb3c08[_0x32ef('0x2e')],qs['fields'](_0x5d2f06[_0x32ef('0x2f')][_0x32ef('0x33')]));_0x4bc5bc[_0x32ef('0x31')]=_0x4bc5bc[_0x32ef('0x31')][_0x32ef('0x34')]?_0x4bc5bc[_0x32ef('0x31')]:_0xcb3c08[_0x32ef('0x2e')];if(_0x5d2f06['query']['includeAll']){_0x4bc5bc[_0x32ef('0x40')]=[{'all':!![]}];}_0x4bc5bc=_[_0x32ef('0x3b')]({},_0x4bc5bc,_0x5d2f06[_0x32ef('0x3c')]);return db[_0x32ef('0x3d')][_0x32ef('0x4a')](_0x4bc5bc)[_0x32ef('0x3e')](handleEntityNotFound(_0x4744ba,null))[_0x32ef('0x3e')](respondWithResult(_0x4744ba,null))[_0x32ef('0x46')](handleError(_0x4744ba,null));};exports[_0x32ef('0x4b')]=function(_0x1ebedf,_0x35a294){return db[_0x32ef('0x3d')][_0x32ef('0x4b')](_0x1ebedf['body'],{})[_0x32ef('0x3e')](respondWithResult(_0x35a294,0xc9))[_0x32ef('0x46')](handleError(_0x35a294,null));};exports[_0x32ef('0x4c')]=function(_0xd42609,_0x1cc9f3){return db[_0x32ef('0x3d')][_0x32ef('0x4a')]({'where':{'id':_0xd42609[_0x32ef('0x48')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x1cc9f3,null))[_0x32ef('0x3e')](removeEntity(_0x1cc9f3,null))[_0x32ef('0x46')](handleError(_0x1cc9f3,null));};exports[_0x32ef('0x4d')]=function(_0x272377,_0x326445){return db[_0x32ef('0x3d')][_0x32ef('0x4d')]()[_0x32ef('0x3e')](respondWithResult(_0x326445,null))[_0x32ef('0x46')](handleError(_0x326445,null));};exports['update']=function(_0x515ac9,_0x179c2f){if(_0x515ac9[_0x32ef('0x4e')][_0x32ef('0x4f')]){delete _0x515ac9[_0x32ef('0x4e')][_0x32ef('0x4f')];}return db[_0x32ef('0x3d')][_0x32ef('0x4a')]({'where':{'uniqueid':_0x515ac9[_0x32ef('0x48')]['id'],'UserId':{'$or':[null,_0x515ac9[_0x32ef('0x50')]['id']]}}})[_0x32ef('0x3e')](handleEntityNotFound(_0x179c2f,null))[_0x32ef('0x3e')](saveUpdates(_0x515ac9['body'],null))[_0x32ef('0x3e')](respondWithResult(_0x179c2f,null))[_0x32ef('0x46')](handleError(_0x179c2f,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index e454f02..f932685 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 _0x3877=['rimraf','./voiceCallReport.attributes','exports','define','VoiceCallReport','report_call','uniqueid','util','api','moment','bluebird','request-promise','path'];(function(_0x19a49f,_0x444d74){var _0x5351ae=function(_0x58b1ed){while(--_0x58b1ed){_0x19a49f['push'](_0x19a49f['shift']());}};_0x5351ae(++_0x444d74);}(_0x3877,0x1c1));var _0x7387=function(_0x176149,_0x44ce6d){_0x176149=_0x176149-0x0;var _0x47441b=_0x3877[_0x176149];return _0x47441b;};'use strict';var _=require('lodash');var util=require(_0x7387('0x0'));var logger=require('../../config/logger')(_0x7387('0x1'));var moment=require(_0x7387('0x2'));var BPromise=require(_0x7387('0x3'));var rp=require(_0x7387('0x4'));var fs=require('fs');var path=require(_0x7387('0x5'));var rimraf=require(_0x7387('0x6'));var config=require('../../config/environment');var attributes=require(_0x7387('0x7'));module[_0x7387('0x8')]=function(_0x40fd0a,_0x979116){return _0x40fd0a[_0x7387('0x9')](_0x7387('0xa'),attributes,{'tableName':_0x7387('0xb'),'paranoid':![],'indexes':[{'fields':[_0x7387('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1c32=['define','VoiceCallReport','report_call','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceCallReport.attributes','exports'];(function(_0x33fa54,_0x749f02){var _0x4f517a=function(_0xc622ec){while(--_0xc622ec){_0x33fa54['push'](_0x33fa54['shift']());}};_0x4f517a(++_0x749f02);}(_0x1c32,0xb8));var _0x21c3=function(_0x280ae7,_0x456fb1){_0x280ae7=_0x280ae7-0x0;var _0x418b9e=_0x1c32[_0x280ae7];return _0x418b9e;};'use strict';var _=require(_0x21c3('0x0'));var util=require(_0x21c3('0x1'));var logger=require(_0x21c3('0x2'))('api');var moment=require(_0x21c3('0x3'));var BPromise=require(_0x21c3('0x4'));var rp=require(_0x21c3('0x5'));var fs=require('fs');var path=require(_0x21c3('0x6'));var rimraf=require(_0x21c3('0x7'));var config=require(_0x21c3('0x8'));var attributes=require(_0x21c3('0x9'));module[_0x21c3('0xa')]=function(_0x1d3732,_0xcb9b35){return _0x1d3732[_0x21c3('0xb')](_0x21c3('0xc'),attributes,{'tableName':_0x21c3('0xd'),'paranoid':![],'indexes':[{'fields':[_0x21c3('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index f7021c8..89a7cf6 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 _0x8e48=['message','info','catch','VoiceCallReport','findAll','options','raw','attributes','limit','include','map','model','GetVoiceCallReport','CreateVoiceCallReport','create','body','UpdateVoiceCallReport','update','where','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x119d5a,_0x19b457){var _0x15bff4=function(_0x1b7c78){while(--_0x1b7c78){_0x119d5a['push'](_0x119d5a['shift']());}};_0x15bff4(++_0x19b457);}(_0x8e48,0x1e7));var _0x88e4=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x8e48[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x88e4('0x0'));var util=require('util');var moment=require(_0x88e4('0x1'));var BPromise=require(_0x88e4('0x2'));var rs=require(_0x88e4('0x3'));var fs=require('fs');var Redis=require(_0x88e4('0x4'));var db=require(_0x88e4('0x5'))['db'];var utils=require(_0x88e4('0x6'));var logger=require(_0x88e4('0x7'))(_0x88e4('0x8'));var config=require(_0x88e4('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x88e4('0xa')][_0x88e4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x43a09b,_0x24e289,_0x1ab82f){return new BPromise(function(_0x3cf0b6,_0x404700){return client['request'](_0x43a09b,_0x1ab82f)[_0x88e4('0xc')](function(_0x4f9de1){logger['info'](_0x88e4('0xd'),_0x24e289,_0x88e4('0xe'));logger[_0x88e4('0xf')](_0x88e4('0x10'),_0x24e289,_0x88e4('0xe'),JSON[_0x88e4('0x11')](_0x4f9de1));if(_0x4f9de1[_0x88e4('0x12')]){if(_0x4f9de1[_0x88e4('0x12')][_0x88e4('0x13')]===0x1f4){logger[_0x88e4('0x12')]('VoiceCallReport,\x20%s,\x20%s',_0x24e289,_0x4f9de1[_0x88e4('0x12')][_0x88e4('0x14')]);return _0x404700(_0x4f9de1['error'][_0x88e4('0x14')]);}logger[_0x88e4('0x12')](_0x88e4('0xd'),_0x24e289,_0x4f9de1[_0x88e4('0x12')]['message']);return _0x3cf0b6(_0x4f9de1[_0x88e4('0x12')][_0x88e4('0x14')]);}else{logger[_0x88e4('0x15')](_0x88e4('0xd'),_0x24e289,_0x88e4('0xe'));_0x3cf0b6(_0x4f9de1['result'][_0x88e4('0x14')]);}})[_0x88e4('0x16')](function(_0x35f1c1){logger[_0x88e4('0x12')]('VoiceCallReport,\x20%s,\x20%s',_0x24e289,_0x35f1c1);_0x404700(_0x35f1c1);});});}exports['GetVoiceCallReport']=function(_0x588da2){var _0x5b66e4=this;return new Promise(function(_0x1e3a2c,_0x16d573){return db[_0x88e4('0x17')][_0x88e4('0x18')]({'raw':_0x588da2[_0x88e4('0x19')]?_0x588da2[_0x88e4('0x19')][_0x88e4('0x1a')]===undefined?!![]:![]:!![],'where':_0x588da2[_0x88e4('0x19')]?_0x588da2[_0x88e4('0x19')]['where']||null:null,'attributes':_0x588da2[_0x88e4('0x19')]?_0x588da2[_0x88e4('0x19')][_0x88e4('0x1b')]||null:null,'limit':_0x588da2[_0x88e4('0x19')]?_0x588da2[_0x88e4('0x19')][_0x88e4('0x1c')]||null:null,'include':_0x588da2[_0x88e4('0x19')]?_0x588da2['options'][_0x88e4('0x1d')]?_[_0x88e4('0x1e')](_0x588da2[_0x88e4('0x19')][_0x88e4('0x1d')],function(_0x18b33e){return{'model':db[_0x18b33e['model']],'as':_0x18b33e['as'],'attributes':_0x18b33e[_0x88e4('0x1b')],'include':_0x18b33e[_0x88e4('0x1d')]?_[_0x88e4('0x1e')](_0x18b33e[_0x88e4('0x1d')],function(_0x5ba731){return{'model':db[_0x5ba731[_0x88e4('0x1f')]],'as':_0x5ba731['as'],'attributes':_0x5ba731[_0x88e4('0x1b')],'include':_0x5ba731[_0x88e4('0x1d')]?_[_0x88e4('0x1e')](_0x5ba731[_0x88e4('0x1d')],function(_0x1e60b6){return{'model':db[_0x1e60b6[_0x88e4('0x1f')]],'as':_0x1e60b6['as'],'attributes':_0x1e60b6[_0x88e4('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x48509d){logger['info'](_0x88e4('0x20'),_0x588da2);logger[_0x88e4('0xf')](_0x88e4('0x20'),_0x588da2,JSON[_0x88e4('0x11')](_0x48509d));_0x1e3a2c(_0x48509d);})[_0x88e4('0x16')](function(_0x343594){logger[_0x88e4('0x12')]('GetVoiceCallReport',_0x343594['message'],_0x588da2);_0x16d573(_0x5b66e4['error'](0x1f4,_0x343594[_0x88e4('0x14')]));});});};exports[_0x88e4('0x21')]=function(_0x192bb9){var _0x1e9b4c=this;return new Promise(function(_0xe3065e,_0x2cecef){return db[_0x88e4('0x17')][_0x88e4('0x22')](_0x192bb9[_0x88e4('0x23')],{'raw':_0x192bb9[_0x88e4('0x19')]?_0x192bb9[_0x88e4('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x88e4('0xc')](function(_0x27f9aa){logger[_0x88e4('0x15')](_0x88e4('0x21'),_0x192bb9);logger[_0x88e4('0xf')]('CreateVoiceCallReport',_0x192bb9,JSON[_0x88e4('0x11')](_0x27f9aa));_0xe3065e(_0x27f9aa);})['catch'](function(_0x1970ed){logger[_0x88e4('0x12')](_0x88e4('0x21'),_0x1970ed[_0x88e4('0x14')],_0x192bb9);_0x2cecef(_0x1e9b4c[_0x88e4('0x12')](0x1f4,_0x1970ed[_0x88e4('0x14')]));});});};exports[_0x88e4('0x24')]=function(_0x5bf52b){var _0x268768=this;return new Promise(function(_0x577b66,_0x1c7f53){return db[_0x88e4('0x17')][_0x88e4('0x25')](_0x5bf52b['body'],{'raw':_0x5bf52b[_0x88e4('0x19')]?_0x5bf52b[_0x88e4('0x19')][_0x88e4('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5bf52b[_0x88e4('0x19')]?_0x5bf52b['options'][_0x88e4('0x26')]||null:null,'attributes':_0x5bf52b[_0x88e4('0x19')]?_0x5bf52b['options']['attributes']||null:null,'limit':_0x5bf52b[_0x88e4('0x19')]?_0x5bf52b[_0x88e4('0x19')][_0x88e4('0x1c')]||null:null})[_0x88e4('0xc')](function(_0x96a701){logger[_0x88e4('0x15')](_0x88e4('0x24'),_0x5bf52b);logger[_0x88e4('0xf')]('UpdateVoiceCallReport',_0x5bf52b,JSON['stringify'](_0x96a701));_0x577b66(_0x96a701);})[_0x88e4('0x16')](function(_0x1da642){logger[_0x88e4('0x12')]('UpdateVoiceCallReport',_0x1da642[_0x88e4('0x14')],_0x5bf52b);_0x1c7f53(_0x268768[_0x88e4('0x12')](0x1f4,_0x1da642[_0x88e4('0x14')]));});});}; \ No newline at end of file +var _0xd342=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','GetVoiceCallReport','VoiceCallReport','options','raw','where','include','map','attributes','model','stringify','CreateVoiceCallReport','create','body','UpdateVoiceCallReport','lodash','util','moment','ioredis'];(function(_0x6cd6e6,_0x4cc4e4){var _0x3cac7f=function(_0x48b5c6){while(--_0x48b5c6){_0x6cd6e6['push'](_0x6cd6e6['shift']());}};_0x3cac7f(++_0x4cc4e4);}(_0xd342,0x188));var _0x2d34=function(_0x449fac,_0x4a6578){_0x449fac=_0x449fac-0x0;var _0x5c1fbb=_0xd342[_0x449fac];return _0x5c1fbb;};'use strict';var _=require(_0x2d34('0x0'));var util=require(_0x2d34('0x1'));var moment=require(_0x2d34('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2d34('0x3'));var db=require(_0x2d34('0x4'))['db'];var utils=require(_0x2d34('0x5'));var logger=require(_0x2d34('0x6'))(_0x2d34('0x7'));var config=require(_0x2d34('0x8'));var jayson=require(_0x2d34('0x9'));var client=jayson[_0x2d34('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x22fce5,_0x431742,_0x40b244){return new BPromise(function(_0x53cd0c,_0x4a014e){return client[_0x2d34('0xb')](_0x22fce5,_0x40b244)[_0x2d34('0xc')](function(_0x11b0fb){logger[_0x2d34('0xd')](_0x2d34('0xe'),_0x431742,_0x2d34('0xf'));logger[_0x2d34('0x10')](_0x2d34('0x11'),_0x431742,_0x2d34('0xf'),JSON['stringify'](_0x11b0fb));if(_0x11b0fb['error']){if(_0x11b0fb['error']['code']===0x1f4){logger[_0x2d34('0x12')]('VoiceCallReport,\x20%s,\x20%s',_0x431742,_0x11b0fb[_0x2d34('0x12')]['message']);return _0x4a014e(_0x11b0fb[_0x2d34('0x12')]['message']);}logger['error']('VoiceCallReport,\x20%s,\x20%s',_0x431742,_0x11b0fb['error'][_0x2d34('0x13')]);return _0x53cd0c(_0x11b0fb['error'][_0x2d34('0x13')]);}else{logger[_0x2d34('0xd')](_0x2d34('0xe'),_0x431742,_0x2d34('0xf'));_0x53cd0c(_0x11b0fb[_0x2d34('0x14')][_0x2d34('0x13')]);}})[_0x2d34('0x15')](function(_0x168214){logger[_0x2d34('0x12')](_0x2d34('0xe'),_0x431742,_0x168214);_0x4a014e(_0x168214);});});}exports[_0x2d34('0x16')]=function(_0x3c98e0){var _0x516f6c=this;return new Promise(function(_0xdaea,_0x97c253){return db[_0x2d34('0x17')]['findAll']({'raw':_0x3c98e0[_0x2d34('0x18')]?_0x3c98e0[_0x2d34('0x18')][_0x2d34('0x19')]===undefined?!![]:![]:!![],'where':_0x3c98e0[_0x2d34('0x18')]?_0x3c98e0['options'][_0x2d34('0x1a')]||null:null,'attributes':_0x3c98e0['options']?_0x3c98e0['options']['attributes']||null:null,'limit':_0x3c98e0[_0x2d34('0x18')]?_0x3c98e0[_0x2d34('0x18')]['limit']||null:null,'include':_0x3c98e0[_0x2d34('0x18')]?_0x3c98e0[_0x2d34('0x18')][_0x2d34('0x1b')]?_[_0x2d34('0x1c')](_0x3c98e0[_0x2d34('0x18')][_0x2d34('0x1b')],function(_0x5d970d){return{'model':db[_0x5d970d['model']],'as':_0x5d970d['as'],'attributes':_0x5d970d[_0x2d34('0x1d')],'include':_0x5d970d[_0x2d34('0x1b')]?_[_0x2d34('0x1c')](_0x5d970d[_0x2d34('0x1b')],function(_0x5cb962){return{'model':db[_0x5cb962[_0x2d34('0x1e')]],'as':_0x5cb962['as'],'attributes':_0x5cb962[_0x2d34('0x1d')],'include':_0x5cb962[_0x2d34('0x1b')]?_['map'](_0x5cb962[_0x2d34('0x1b')],function(_0x347fbd){return{'model':db[_0x347fbd[_0x2d34('0x1e')]],'as':_0x347fbd['as'],'attributes':_0x347fbd['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x13d2e2){logger[_0x2d34('0xd')](_0x2d34('0x16'),_0x3c98e0);logger['debug'](_0x2d34('0x16'),_0x3c98e0,JSON[_0x2d34('0x1f')](_0x13d2e2));_0xdaea(_0x13d2e2);})[_0x2d34('0x15')](function(_0x442667){logger['error'](_0x2d34('0x16'),_0x442667[_0x2d34('0x13')],_0x3c98e0);_0x97c253(_0x516f6c[_0x2d34('0x12')](0x1f4,_0x442667[_0x2d34('0x13')]));});});};exports[_0x2d34('0x20')]=function(_0x5067dd){var _0x5adf12=this;return new Promise(function(_0x2aa581,_0x5d8095){return db['VoiceCallReport'][_0x2d34('0x21')](_0x5067dd[_0x2d34('0x22')],{'raw':_0x5067dd[_0x2d34('0x18')]?_0x5067dd['options'][_0x2d34('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x297af3){logger['info'](_0x2d34('0x20'),_0x5067dd);logger[_0x2d34('0x10')](_0x2d34('0x20'),_0x5067dd,JSON[_0x2d34('0x1f')](_0x297af3));_0x2aa581(_0x297af3);})[_0x2d34('0x15')](function(_0x1d4f03){logger[_0x2d34('0x12')](_0x2d34('0x20'),_0x1d4f03[_0x2d34('0x13')],_0x5067dd);_0x5d8095(_0x5adf12[_0x2d34('0x12')](0x1f4,_0x1d4f03['message']));});});};exports[_0x2d34('0x23')]=function(_0x435057){var _0x56dca6=this;return new Promise(function(_0x57e1b3,_0x1278fa){return db[_0x2d34('0x17')]['update'](_0x435057[_0x2d34('0x22')],{'raw':_0x435057['options']?_0x435057[_0x2d34('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x435057[_0x2d34('0x18')]?_0x435057[_0x2d34('0x18')][_0x2d34('0x1a')]||null:null,'attributes':_0x435057['options']?_0x435057[_0x2d34('0x18')][_0x2d34('0x1d')]||null:null,'limit':_0x435057[_0x2d34('0x18')]?_0x435057[_0x2d34('0x18')]['limit']||null:null})[_0x2d34('0xc')](function(_0x1af51c){logger['info'](_0x2d34('0x23'),_0x435057);logger[_0x2d34('0x10')](_0x2d34('0x23'),_0x435057,JSON[_0x2d34('0x1f')](_0x1af51c));_0x57e1b3(_0x1af51c);})[_0x2d34('0x15')](function(_0x3f044f){logger['error'](_0x2d34('0x23'),_0x3f044f[_0x2d34('0x13')],_0x435057);_0x1278fa(_0x56dca6[_0x2d34('0x12')](0x1f4,_0x3f044f[_0x2d34('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 01fd3cb..ad619c4 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 _0x48ef=['create','put','update','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post'];(function(_0x4b5de5,_0x1169f7){var _0xc200db=function(_0x59649e){while(--_0x59649e){_0x4b5de5['push'](_0x4b5de5['shift']());}};_0xc200db(++_0x1169f7);}(_0x48ef,0x9d));var _0xf48e=function(_0x241b27,_0x755b3b){_0x241b27=_0x241b27-0x0;var _0x17e5de=_0x48ef[_0x241b27];return _0x17e5de;};'use strict';var multer=require(_0xf48e('0x0'));var util=require(_0xf48e('0x1'));var path=require('path');var timeout=require(_0xf48e('0x2'));var express=require(_0xf48e('0x3'));var router=express['Router']();var fs_extra=require(_0xf48e('0x4'));var auth=require(_0xf48e('0x5'));var interaction=require(_0xf48e('0x6'));var config=require(_0xf48e('0x7'));var controller=require('./voiceChanSpy.controller');router[_0xf48e('0x8')]('/',auth[_0xf48e('0x9')](),controller[_0xf48e('0xa')]);router[_0xf48e('0x8')](_0xf48e('0xb'),auth['isAuthenticated'](),controller[_0xf48e('0xc')]);router[_0xf48e('0xd')]('/',auth[_0xf48e('0x9')](),controller[_0xf48e('0xe')]);router[_0xf48e('0xf')](_0xf48e('0xb'),auth[_0xf48e('0x9')](),controller[_0xf48e('0x10')]);router['delete'](_0xf48e('0xb'),auth['isAuthenticated'](),controller[_0xf48e('0x11')]);module[_0xf48e('0x12')]=router; \ No newline at end of file +var _0x1fac=['delete','exports','multer','util','path','express','fs-extra','../../config/environment','get','index','/:id','isAuthenticated','post','create','put','update'];(function(_0x52b9ee,_0x5706b5){var _0x562516=function(_0x4c9b94){while(--_0x4c9b94){_0x52b9ee['push'](_0x52b9ee['shift']());}};_0x562516(++_0x5706b5);}(_0x1fac,0xb2));var _0xc1fa=function(_0x36cf3f,_0x2e5cb2){_0x36cf3f=_0x36cf3f-0x0;var _0x53d738=_0x1fac[_0x36cf3f];return _0x53d738;};'use strict';var multer=require(_0xc1fa('0x0'));var util=require(_0xc1fa('0x1'));var path=require(_0xc1fa('0x2'));var timeout=require('connect-timeout');var express=require(_0xc1fa('0x3'));var router=express['Router']();var fs_extra=require(_0xc1fa('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xc1fa('0x5'));var controller=require('./voiceChanSpy.controller');router[_0xc1fa('0x6')]('/',auth['isAuthenticated'](),controller[_0xc1fa('0x7')]);router[_0xc1fa('0x6')](_0xc1fa('0x8'),auth[_0xc1fa('0x9')](),controller['show']);router[_0xc1fa('0xa')]('/',auth[_0xc1fa('0x9')](),controller[_0xc1fa('0xb')]);router[_0xc1fa('0xc')](_0xc1fa('0x8'),auth[_0xc1fa('0x9')](),controller[_0xc1fa('0xd')]);router[_0xc1fa('0xe')](_0xc1fa('0x8'),auth[_0xc1fa('0x9')](),controller['destroy']);module[_0xc1fa('0xf')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index ede2c50..3ef8289 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 _0x13ac=['exports','STRING','name','setDataValue','options','getDataValue'];(function(_0x4678b6,_0x2a9aa8){var _0x23747d=function(_0x21dded){while(--_0x21dded){_0x4678b6['push'](_0x4678b6['shift']());}};_0x23747d(++_0x2a9aa8);}(_0x13ac,0x144));var _0xc13a=function(_0xcc32b6,_0x4c6d79){_0xcc32b6=_0xcc32b6-0x0;var _0x553abb=_0x13ac[_0xcc32b6];return _0x553abb;};'use strict';var Sequelize=require('sequelize');module[_0xc13a('0x0')]={'name':{'type':Sequelize[_0xc13a('0x1')]},'prefix':{'type':Sequelize[_0xc13a('0x1')],'unique':_0xc13a('0x2'),'allowNull':![]},'options':{'type':Sequelize['STRING'],'set':function(_0x2810b9){this[_0xc13a('0x3')](_0xc13a('0x4'),_0x2810b9?_0x2810b9['join'](''):[]);},'get':function(){return this[_0xc13a('0x5')](_0xc13a('0x4'))?this[_0xc13a('0x5')](_0xc13a('0x4'))['split'](''):[];}},'auth':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'password':{'type':Sequelize[_0xc13a('0x1')]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xc13a('0x1')]},'description':{'type':Sequelize[_0xc13a('0x1')]}}; \ No newline at end of file +var _0x26b9=['getDataValue','split','BOOLEAN','sequelize','exports','STRING','name','setDataValue','options'];(function(_0x49524b,_0xb01084){var _0x5ca08d=function(_0xfcced6){while(--_0xfcced6){_0x49524b['push'](_0x49524b['shift']());}};_0x5ca08d(++_0xb01084);}(_0x26b9,0x162));var _0x926b=function(_0x5509a8,_0x1a8b93){_0x5509a8=_0x5509a8-0x0;var _0x5383b1=_0x26b9[_0x5509a8];return _0x5383b1;};'use strict';var Sequelize=require(_0x926b('0x0'));module[_0x926b('0x1')]={'name':{'type':Sequelize[_0x926b('0x2')]},'prefix':{'type':Sequelize[_0x926b('0x2')],'unique':_0x926b('0x3'),'allowNull':![]},'options':{'type':Sequelize[_0x926b('0x2')],'set':function(_0x20961d){this[_0x926b('0x4')](_0x926b('0x5'),_0x20961d?_0x20961d['join'](''):[]);},'get':function(){return this[_0x926b('0x6')]('options')?this['getDataValue'](_0x926b('0x5'))[_0x926b('0x7')](''):[];}},'auth':{'type':Sequelize[_0x926b('0x8')],'defaultValue':![]},'password':{'type':Sequelize['STRING']},'record':{'type':Sequelize[_0x926b('0x8')],'defaultValue':![]},'recordingFormat':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x926b('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 69309c2..020e15d 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 _0xeddd=['merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','fields','options','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','get','ChanSpies','UserProfileResource','error','send','index','VoiceChanSpy','rawAttributes','key','model','map','name','query','filters','intersection','attributes','length','hasOwnProperty','sort','where','filter'];(function(_0xae0f6b,_0x29e7a0){var _0x233721=function(_0x399d86){while(--_0x399d86){_0xae0f6b['push'](_0xae0f6b['shift']());}};_0x233721(++_0x29e7a0);}(_0xeddd,0x69));var _0xdedd=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0xeddd[_0x32f7d7];return _0x133d09;};'use strict';var emlformat=require(_0xdedd('0x0'));var rimraf=require(_0xdedd('0x1'));var zipdir=require(_0xdedd('0x2'));var jsonpatch=require(_0xdedd('0x3'));var rp=require('request-promise');var moment=require(_0xdedd('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xdedd('0x5'));var util=require(_0xdedd('0x6'));var path=require('path');var sox=require(_0xdedd('0x7'));var csv=require(_0xdedd('0x8'));var ejs=require(_0xdedd('0x9'));var fs=require('fs');var fs_extra=require(_0xdedd('0xa'));var _=require(_0xdedd('0xb'));var squel=require(_0xdedd('0xc'));var crypto=require(_0xdedd('0xd'));var jsforce=require(_0xdedd('0xe'));var deskjs=require(_0xdedd('0xf'));var toCsv=require(_0xdedd('0x8'));var querystring=require(_0xdedd('0x10'));var Papa=require(_0xdedd('0x11'));var Redis=require('ioredis');var authService=require(_0xdedd('0x12'));var qs=require(_0xdedd('0x13'));var as=require(_0xdedd('0x14'));var hardwareService=require(_0xdedd('0x15'));var logger=require('../../config/logger')(_0xdedd('0x16'));var utils=require(_0xdedd('0x17'));var config=require(_0xdedd('0x18'));var licenseUtil=require(_0xdedd('0x19'));var db=require(_0xdedd('0x1a'))['db'];function respondWithStatusCode(_0x214644,_0x83ada3){_0x83ada3=_0x83ada3||0xcc;return function(_0x42ad06){if(_0x42ad06){return _0x214644[_0xdedd('0x1b')](_0x83ada3);}return _0x214644[_0xdedd('0x1c')](_0x83ada3)[_0xdedd('0x1d')]();};}function respondWithResult(_0x2ca711,_0x3b098a){_0x3b098a=_0x3b098a||0xc8;return function(_0x27b609){if(_0x27b609){return _0x2ca711[_0xdedd('0x1c')](_0x3b098a)[_0xdedd('0x1e')](_0x27b609);}};}function respondWithFilteredResult(_0x2de906,_0x39e41b){return function(_0x4436b5){if(_0x4436b5){var _0x487a8a=typeof _0x39e41b[_0xdedd('0x1f')]===_0xdedd('0x20')&&typeof _0x39e41b['limit']===_0xdedd('0x20');var _0x114694=_0x4436b5[_0xdedd('0x21')];var _0x4b16bb=_0x487a8a?0x0:_0x39e41b[_0xdedd('0x1f')];var _0x24e331=_0x487a8a?_0x4436b5[_0xdedd('0x21')]:_0x39e41b[_0xdedd('0x1f')]+_0x39e41b[_0xdedd('0x22')];var _0x530faf;if(_0x24e331>=_0x114694){_0x24e331=_0x114694;_0x530faf=0xc8;}else{_0x530faf=0xce;}_0x2de906[_0xdedd('0x1c')](_0x530faf);return _0x2de906[_0xdedd('0x23')](_0xdedd('0x24'),_0x4b16bb+'-'+_0x24e331+'/'+_0x114694)[_0xdedd('0x1e')](_0x4436b5);}return null;};}function patchUpdates(_0x1213d6){return function(_0x1d7807){try{jsonpatch[_0xdedd('0x25')](_0x1d7807,_0x1213d6,!![]);}catch(_0x187487){return BPromise[_0xdedd('0x26')](_0x187487);}return _0x1d7807['save']();};}function saveUpdates(_0x527a5b,_0x538dc1){return function(_0x53b2b2){if(_0x53b2b2){return _0x53b2b2[_0xdedd('0x27')](_0x527a5b)[_0xdedd('0x28')](function(_0x23c7e6){return _0x23c7e6;});}return null;};}function removeEntity(_0x31b14f,_0x84639d){return function(_0x4e0483){if(_0x4e0483){return _0x4e0483[_0xdedd('0x29')]()[_0xdedd('0x28')](function(){var _0x1a5788=_0x4e0483[_0xdedd('0x2a')]({'plain':!![]});var _0x4e8396=_0xdedd('0x2b');return db[_0xdedd('0x2c')][_0xdedd('0x29')]({'where':{'type':_0x4e8396,'resourceId':_0x1a5788['id']}})[_0xdedd('0x28')](function(){return _0x4e0483;});})[_0xdedd('0x28')](function(){_0x31b14f[_0xdedd('0x1c')](0xcc)[_0xdedd('0x1d')]();});}};}function handleEntityNotFound(_0x29efe0,_0x406133){return function(_0x32d3eb){if(!_0x32d3eb){_0x29efe0[_0xdedd('0x1b')](0x194);}return _0x32d3eb;};}function handleError(_0x10b7d3,_0x1dc1d1){_0x1dc1d1=_0x1dc1d1||0x1f4;return function(_0xa9b7ea){logger[_0xdedd('0x2d')](_0xa9b7ea['stack']);if(_0xa9b7ea['name']){delete _0xa9b7ea['name'];}_0x10b7d3[_0xdedd('0x1c')](_0x1dc1d1)[_0xdedd('0x2e')](_0xa9b7ea);};}exports[_0xdedd('0x2f')]=function(_0x2b3094,_0x52289f){var _0x228594={},_0x228307={},_0x1419b5={'count':0x0,'rows':[]};var _0x2ddda6=_['map'](db[_0xdedd('0x30')][_0xdedd('0x31')],function(_0x55a70c){return{'name':_0x55a70c['fieldName'],'type':_0x55a70c['type'][_0xdedd('0x32')]};});_0x228307[_0xdedd('0x33')]=_[_0xdedd('0x34')](_0x2ddda6,_0xdedd('0x35'));_0x228307[_0xdedd('0x36')]=_['keys'](_0x2b3094[_0xdedd('0x36')]);_0x228307[_0xdedd('0x37')]=_[_0xdedd('0x38')](_0x228307[_0xdedd('0x33')],_0x228307[_0xdedd('0x36')]);_0x228594[_0xdedd('0x39')]=_[_0xdedd('0x38')](_0x228307['model'],qs['fields'](_0x2b3094[_0xdedd('0x36')]['fields']));_0x228594[_0xdedd('0x39')]=_0x228594[_0xdedd('0x39')][_0xdedd('0x3a')]?_0x228594[_0xdedd('0x39')]:_0x228307['model'];if(!_0x2b3094['query'][_0xdedd('0x3b')]('nolimit')){_0x228594['limit']=qs[_0xdedd('0x22')](_0x2b3094[_0xdedd('0x36')][_0xdedd('0x22')]);_0x228594[_0xdedd('0x1f')]=qs[_0xdedd('0x1f')](_0x2b3094[_0xdedd('0x36')][_0xdedd('0x1f')]);}_0x228594['order']=qs[_0xdedd('0x3c')](_0x2b3094[_0xdedd('0x36')][_0xdedd('0x3c')]);_0x228594[_0xdedd('0x3d')]=qs[_0xdedd('0x37')](_['pick'](_0x2b3094[_0xdedd('0x36')],_0x228307[_0xdedd('0x37')]),_0x2ddda6);if(_0x2b3094[_0xdedd('0x36')][_0xdedd('0x3e')]){_0x228594[_0xdedd('0x3d')]=_[_0xdedd('0x3f')](_0x228594[_0xdedd('0x3d')],{'$or':_[_0xdedd('0x34')](_0x2ddda6,function(_0x3d22c6){if(_0x3d22c6[_0xdedd('0x40')]!==_0xdedd('0x41')){var _0x35d38a={};_0x35d38a[_0x3d22c6['name']]={'$like':'%'+_0x2b3094[_0xdedd('0x36')][_0xdedd('0x3e')]+'%'};return _0x35d38a;}})});}_0x228594=_[_0xdedd('0x3f')]({},_0x228594,_0x2b3094['options']);var _0x40faf4={'where':_0x228594[_0xdedd('0x3d')]};return db[_0xdedd('0x30')][_0xdedd('0x21')](_0x40faf4)[_0xdedd('0x28')](function(_0x5e10ee){_0x1419b5[_0xdedd('0x21')]=_0x5e10ee;if(_0x2b3094['query'][_0xdedd('0x42')]){_0x228594[_0xdedd('0x43')]=[{'all':!![]}];}return db[_0xdedd('0x30')][_0xdedd('0x44')](_0x228594);})['then'](function(_0x4961e7){_0x1419b5[_0xdedd('0x45')]=_0x4961e7;return _0x1419b5;})['then'](respondWithFilteredResult(_0x52289f,_0x228594))[_0xdedd('0x46')](handleError(_0x52289f,null));};exports[_0xdedd('0x47')]=function(_0x2e6e8d,_0x18f276){var _0x192973={'raw':![],'where':{'id':_0x2e6e8d[_0xdedd('0x48')]['id']}},_0xcd0208={};_0xcd0208[_0xdedd('0x33')]=_['keys'](db[_0xdedd('0x30')][_0xdedd('0x31')]);_0xcd0208[_0xdedd('0x36')]=_['keys'](_0x2e6e8d['query']);_0xcd0208[_0xdedd('0x37')]=_['intersection'](_0xcd0208[_0xdedd('0x33')],_0xcd0208[_0xdedd('0x36')]);_0x192973[_0xdedd('0x39')]=_[_0xdedd('0x38')](_0xcd0208[_0xdedd('0x33')],qs[_0xdedd('0x49')](_0x2e6e8d[_0xdedd('0x36')][_0xdedd('0x49')]));_0x192973[_0xdedd('0x39')]=_0x192973[_0xdedd('0x39')]['length']?_0x192973['attributes']:_0xcd0208['model'];if(_0x2e6e8d[_0xdedd('0x36')][_0xdedd('0x42')]){_0x192973[_0xdedd('0x43')]=[{'all':!![]}];}_0x192973=_[_0xdedd('0x3f')]({},_0x192973,_0x2e6e8d[_0xdedd('0x4a')]);return db[_0xdedd('0x30')][_0xdedd('0x4b')](_0x192973)[_0xdedd('0x28')](handleEntityNotFound(_0x18f276,null))[_0xdedd('0x28')](respondWithResult(_0x18f276,null))[_0xdedd('0x46')](handleError(_0x18f276,null));};exports[_0xdedd('0x4c')]=function(_0x3c3901,_0x4e2811){return db[_0xdedd('0x30')][_0xdedd('0x4c')](_0x3c3901['body'],{})[_0xdedd('0x28')](function(_0xee6e27){var _0x29278d=_0x3c3901['user']['get']({'plain':!![]});if(!_0x29278d)throw new Error(_0xdedd('0x4d'));if(_0x29278d[_0xdedd('0x4e')]===_0xdedd('0x4f')){var _0x495030=_0xee6e27[_0xdedd('0x2a')]({'plain':!![]});var _0x25dbd8='ChanSpies';return db[_0xdedd('0x50')][_0xdedd('0x4b')]({'where':{'name':_0x25dbd8,'userProfileId':_0x29278d[_0xdedd('0x51')]},'raw':!![]})[_0xdedd('0x28')](function(_0x3b48be){if(_0x3b48be&&_0x3b48be['autoAssociation']===0x0){return db[_0xdedd('0x2c')][_0xdedd('0x4c')]({'name':_0x495030[_0xdedd('0x35')],'resourceId':_0x495030['id'],'type':_0x3b48be[_0xdedd('0x35')],'sectionId':_0x3b48be['id']},{})['then'](function(){return _0xee6e27;});}else{return _0xee6e27;}})[_0xdedd('0x46')](function(_0x1a41e3){logger['error'](_0xdedd('0x52'),_0x1a41e3);throw _0x1a41e3;});}return _0xee6e27;})[_0xdedd('0x28')](respondWithResult(_0x4e2811,0xc9))[_0xdedd('0x46')](handleError(_0x4e2811,null));};exports[_0xdedd('0x27')]=function(_0x1b0604,_0x101533){if(_0x1b0604[_0xdedd('0x53')]['id']){delete _0x1b0604[_0xdedd('0x53')]['id'];}return db[_0xdedd('0x30')]['find']({'where':{'id':_0x1b0604[_0xdedd('0x48')]['id']}})[_0xdedd('0x28')](handleEntityNotFound(_0x101533,null))['then'](saveUpdates(_0x1b0604[_0xdedd('0x53')],null))[_0xdedd('0x28')](respondWithResult(_0x101533,null))[_0xdedd('0x46')](handleError(_0x101533,null));};exports[_0xdedd('0x29')]=function(_0x8b86b7,_0x4dd01b){return db['VoiceChanSpy'][_0xdedd('0x4b')]({'where':{'id':_0x8b86b7[_0xdedd('0x48')]['id']}})[_0xdedd('0x28')](handleEntityNotFound(_0x4dd01b,null))[_0xdedd('0x28')](removeEntity(_0x4dd01b,null))[_0xdedd('0x46')](handleError(_0x4dd01b,null));}; \ No newline at end of file +var _0x1542=['pick','filter','merge','includeAll','include','VoiceChanSpy','findAll','rows','show','params','rawAttributes','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','ChanSpies','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','then','get','UserProfileResource','destroy','error','name','send','index','map','fieldName','type','model','query','keys','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where'];(function(_0x490be3,_0xf0fca3){var _0x3f5140=function(_0x15fa80){while(--_0x15fa80){_0x490be3['push'](_0x490be3['shift']());}};_0x3f5140(++_0xf0fca3);}(_0x1542,0x116));var _0x2154=function(_0x1ff820,_0x54e982){_0x1ff820=_0x1ff820-0x0;var _0xcddfff=_0x1542[_0x1ff820];return _0xcddfff;};'use strict';var emlformat=require(_0x2154('0x0'));var rimraf=require(_0x2154('0x1'));var zipdir=require(_0x2154('0x2'));var jsonpatch=require(_0x2154('0x3'));var rp=require(_0x2154('0x4'));var moment=require('moment');var BPromise=require(_0x2154('0x5'));var Mustache=require(_0x2154('0x6'));var util=require(_0x2154('0x7'));var path=require('path');var sox=require(_0x2154('0x8'));var csv=require(_0x2154('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2154('0xa'));var _=require(_0x2154('0xb'));var squel=require(_0x2154('0xc'));var crypto=require(_0x2154('0xd'));var jsforce=require(_0x2154('0xe'));var deskjs=require(_0x2154('0xf'));var toCsv=require(_0x2154('0x9'));var querystring=require(_0x2154('0x10'));var Papa=require(_0x2154('0x11'));var Redis=require(_0x2154('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x2154('0x13'));var as=require(_0x2154('0x14'));var hardwareService=require(_0x2154('0x15'));var logger=require(_0x2154('0x16'))('api');var utils=require(_0x2154('0x17'));var config=require(_0x2154('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x2154('0x19'))['db'];function respondWithStatusCode(_0x44c713,_0x3daa7d){_0x3daa7d=_0x3daa7d||0xcc;return function(_0x2a79eb){if(_0x2a79eb){return _0x44c713[_0x2154('0x1a')](_0x3daa7d);}return _0x44c713[_0x2154('0x1b')](_0x3daa7d)[_0x2154('0x1c')]();};}function respondWithResult(_0x587627,_0x5363f6){_0x5363f6=_0x5363f6||0xc8;return function(_0x160517){if(_0x160517){return _0x587627['status'](_0x5363f6)[_0x2154('0x1d')](_0x160517);}};}function respondWithFilteredResult(_0x59a389,_0x48f188){return function(_0x5b34b9){if(_0x5b34b9){var _0x46c995=typeof _0x48f188['offset']===_0x2154('0x1e')&&typeof _0x48f188['limit']===_0x2154('0x1e');var _0x369ab6=_0x5b34b9[_0x2154('0x1f')];var _0x35b468=_0x46c995?0x0:_0x48f188[_0x2154('0x20')];var _0x46b72c=_0x46c995?_0x5b34b9[_0x2154('0x1f')]:_0x48f188[_0x2154('0x20')]+_0x48f188[_0x2154('0x21')];var _0x286dc8;if(_0x46b72c>=_0x369ab6){_0x46b72c=_0x369ab6;_0x286dc8=0xc8;}else{_0x286dc8=0xce;}_0x59a389['status'](_0x286dc8);return _0x59a389[_0x2154('0x22')](_0x2154('0x23'),_0x35b468+'-'+_0x46b72c+'/'+_0x369ab6)[_0x2154('0x1d')](_0x5b34b9);}return null;};}function patchUpdates(_0x57bc6a){return function(_0x2af3dd){try{jsonpatch[_0x2154('0x24')](_0x2af3dd,_0x57bc6a,!![]);}catch(_0x3b71){return BPromise[_0x2154('0x25')](_0x3b71);}return _0x2af3dd['save']();};}function saveUpdates(_0x338185,_0xb10044){return function(_0x3f4387){if(_0x3f4387){return _0x3f4387['update'](_0x338185)['then'](function(_0x3e85c0){return _0x3e85c0;});}return null;};}function removeEntity(_0xa40b17,_0x166b0d){return function(_0x4ef4f7){if(_0x4ef4f7){return _0x4ef4f7['destroy']()[_0x2154('0x26')](function(){var _0x33f1a0=_0x4ef4f7[_0x2154('0x27')]({'plain':!![]});var _0x3b4fa8='ChanSpies';return db[_0x2154('0x28')][_0x2154('0x29')]({'where':{'type':_0x3b4fa8,'resourceId':_0x33f1a0['id']}})[_0x2154('0x26')](function(){return _0x4ef4f7;});})['then'](function(){_0xa40b17['status'](0xcc)[_0x2154('0x1c')]();});}};}function handleEntityNotFound(_0x27d28a,_0x2466eb){return function(_0x5317b5){if(!_0x5317b5){_0x27d28a[_0x2154('0x1a')](0x194);}return _0x5317b5;};}function handleError(_0xd780d,_0x45da10){_0x45da10=_0x45da10||0x1f4;return function(_0x83263d){logger[_0x2154('0x2a')](_0x83263d['stack']);if(_0x83263d[_0x2154('0x2b')]){delete _0x83263d[_0x2154('0x2b')];}_0xd780d[_0x2154('0x1b')](_0x45da10)[_0x2154('0x2c')](_0x83263d);};}exports[_0x2154('0x2d')]=function(_0x2dee3e,_0xe5c717){var _0x5661d9={},_0x327d1f={},_0x100f64={'count':0x0,'rows':[]};var _0x4cb415=_[_0x2154('0x2e')](db['VoiceChanSpy']['rawAttributes'],function(_0x883503){return{'name':_0x883503[_0x2154('0x2f')],'type':_0x883503[_0x2154('0x30')]['key']};});_0x327d1f[_0x2154('0x31')]=_[_0x2154('0x2e')](_0x4cb415,_0x2154('0x2b'));_0x327d1f[_0x2154('0x32')]=_[_0x2154('0x33')](_0x2dee3e[_0x2154('0x32')]);_0x327d1f[_0x2154('0x34')]=_[_0x2154('0x35')](_0x327d1f['model'],_0x327d1f[_0x2154('0x32')]);_0x5661d9['attributes']=_[_0x2154('0x35')](_0x327d1f[_0x2154('0x31')],qs[_0x2154('0x36')](_0x2dee3e[_0x2154('0x32')][_0x2154('0x36')]));_0x5661d9['attributes']=_0x5661d9['attributes'][_0x2154('0x37')]?_0x5661d9[_0x2154('0x38')]:_0x327d1f[_0x2154('0x31')];if(!_0x2dee3e[_0x2154('0x32')][_0x2154('0x39')](_0x2154('0x3a'))){_0x5661d9[_0x2154('0x21')]=qs[_0x2154('0x21')](_0x2dee3e[_0x2154('0x32')][_0x2154('0x21')]);_0x5661d9['offset']=qs[_0x2154('0x20')](_0x2dee3e['query'][_0x2154('0x20')]);}_0x5661d9[_0x2154('0x3b')]=qs[_0x2154('0x3c')](_0x2dee3e[_0x2154('0x32')][_0x2154('0x3c')]);_0x5661d9[_0x2154('0x3d')]=qs['filters'](_[_0x2154('0x3e')](_0x2dee3e[_0x2154('0x32')],_0x327d1f[_0x2154('0x34')]),_0x4cb415);if(_0x2dee3e[_0x2154('0x32')][_0x2154('0x3f')]){_0x5661d9[_0x2154('0x3d')]=_[_0x2154('0x40')](_0x5661d9[_0x2154('0x3d')],{'$or':_[_0x2154('0x2e')](_0x4cb415,function(_0x3887f1){if(_0x3887f1['type']!=='VIRTUAL'){var _0x472194={};_0x472194[_0x3887f1[_0x2154('0x2b')]]={'$like':'%'+_0x2dee3e['query'][_0x2154('0x3f')]+'%'};return _0x472194;}})});}_0x5661d9=_[_0x2154('0x40')]({},_0x5661d9,_0x2dee3e['options']);var _0x105903={'where':_0x5661d9[_0x2154('0x3d')]};return db['VoiceChanSpy']['count'](_0x105903)[_0x2154('0x26')](function(_0x3f0098){_0x100f64[_0x2154('0x1f')]=_0x3f0098;if(_0x2dee3e[_0x2154('0x32')][_0x2154('0x41')]){_0x5661d9[_0x2154('0x42')]=[{'all':!![]}];}return db[_0x2154('0x43')][_0x2154('0x44')](_0x5661d9);})[_0x2154('0x26')](function(_0x417663){_0x100f64[_0x2154('0x45')]=_0x417663;return _0x100f64;})['then'](respondWithFilteredResult(_0xe5c717,_0x5661d9))['catch'](handleError(_0xe5c717,null));};exports[_0x2154('0x46')]=function(_0x55caa3,_0x23f407){var _0x370143={'raw':![],'where':{'id':_0x55caa3[_0x2154('0x47')]['id']}},_0xff86df={};_0xff86df['model']=_[_0x2154('0x33')](db[_0x2154('0x43')][_0x2154('0x48')]);_0xff86df[_0x2154('0x32')]=_[_0x2154('0x33')](_0x55caa3[_0x2154('0x32')]);_0xff86df['filters']=_['intersection'](_0xff86df['model'],_0xff86df[_0x2154('0x32')]);_0x370143['attributes']=_['intersection'](_0xff86df[_0x2154('0x31')],qs[_0x2154('0x36')](_0x55caa3[_0x2154('0x32')][_0x2154('0x36')]));_0x370143[_0x2154('0x38')]=_0x370143[_0x2154('0x38')][_0x2154('0x37')]?_0x370143[_0x2154('0x38')]:_0xff86df['model'];if(_0x55caa3[_0x2154('0x32')][_0x2154('0x41')]){_0x370143[_0x2154('0x42')]=[{'all':!![]}];}_0x370143=_['merge']({},_0x370143,_0x55caa3['options']);return db[_0x2154('0x43')][_0x2154('0x49')](_0x370143)[_0x2154('0x26')](handleEntityNotFound(_0x23f407,null))['then'](respondWithResult(_0x23f407,null))[_0x2154('0x4a')](handleError(_0x23f407,null));};exports[_0x2154('0x4b')]=function(_0x24f13b,_0x7027c1){return db[_0x2154('0x43')][_0x2154('0x4b')](_0x24f13b[_0x2154('0x4c')],{})[_0x2154('0x26')](function(_0x4b3128){var _0x10f05a=_0x24f13b[_0x2154('0x4d')][_0x2154('0x27')]({'plain':!![]});if(!_0x10f05a)throw new Error(_0x2154('0x4e'));if(_0x10f05a['role']===_0x2154('0x4d')){var _0x557f56=_0x4b3128['get']({'plain':!![]});var _0xd745bf=_0x2154('0x4f');return db[_0x2154('0x50')][_0x2154('0x49')]({'where':{'name':_0xd745bf,'userProfileId':_0x10f05a[_0x2154('0x51')]},'raw':!![]})[_0x2154('0x26')](function(_0x1026d9){if(_0x1026d9&&_0x1026d9[_0x2154('0x52')]===0x0){return db[_0x2154('0x28')][_0x2154('0x4b')]({'name':_0x557f56['name'],'resourceId':_0x557f56['id'],'type':_0x1026d9['name'],'sectionId':_0x1026d9['id']},{})[_0x2154('0x26')](function(){return _0x4b3128;});}else{return _0x4b3128;}})['catch'](function(_0x336f8b){logger['error'](_0x2154('0x53'),_0x336f8b);throw _0x336f8b;});}return _0x4b3128;})[_0x2154('0x26')](respondWithResult(_0x7027c1,0xc9))[_0x2154('0x4a')](handleError(_0x7027c1,null));};exports[_0x2154('0x54')]=function(_0xfa774b,_0x3829bd){if(_0xfa774b[_0x2154('0x4c')]['id']){delete _0xfa774b[_0x2154('0x4c')]['id'];}return db[_0x2154('0x43')][_0x2154('0x49')]({'where':{'id':_0xfa774b[_0x2154('0x47')]['id']}})[_0x2154('0x26')](handleEntityNotFound(_0x3829bd,null))[_0x2154('0x26')](saveUpdates(_0xfa774b[_0x2154('0x4c')],null))['then'](respondWithResult(_0x3829bd,null))['catch'](handleError(_0x3829bd,null));};exports[_0x2154('0x29')]=function(_0x2d607a,_0x2afcca){return db[_0x2154('0x43')][_0x2154('0x49')]({'where':{'id':_0x2d607a['params']['id']}})['then'](handleEntityNotFound(_0x2afcca,null))[_0x2154('0x26')](removeEntity(_0x2afcca,null))[_0x2154('0x4a')](handleError(_0x2afcca,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index 689c7e6..08383ef 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 _0xff84=['User','findAll','agent','then','catch','exports','models','define','VoiceChanSpy','voice_chanspy','bulkCreate','VoiceExtension','destroy','lodash','util','bluebird','./voiceChanSpy.attributes','context','from-sip','format','%s%s','prefix','system','push','merge','Set','CDR(type)=%s','chanspy','record','MixMonitor','recordingFormat','auth','Authenticate','password','ChanSpy','SIP/%s,%s','name','options','join','StopMixMonitor','length','concat','internal'];(function(_0x435972,_0x2c86e4){var _0x6abd63=function(_0x45dc69){while(--_0x45dc69){_0x435972['push'](_0x435972['shift']());}};_0x6abd63(++_0x2c86e4);}(_0xff84,0x1bb));var _0x4ff8=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xff84[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0x4ff8('0x0'));var util=require(_0x4ff8('0x1'));var BPromise=require(_0x4ff8('0x2'));var attributes=require(_0x4ff8('0x3'));var getUserApplications=function(_0x1fbcce,_0xdfe58,_0x4bfca1){var _0x171def=0x1;var _0x19f8c2=[];var _0x4c6cf6={'context':_0xdfe58[_0x4ff8('0x4')]||_0x4ff8('0x5'),'exten':util[_0x4ff8('0x6')](_0x4ff8('0x7'),_0x1fbcce[_0x4ff8('0x8')],_0x4bfca1),'type':_0x4ff8('0x9'),'isApp':![],'ChanSpyId':_0x1fbcce['id'],'UserId':_0xdfe58['id']};_0x19f8c2[_0x4ff8('0xa')](_[_0x4ff8('0xb')]({'app':_0x4ff8('0xc'),'appdata':util[_0x4ff8('0x6')](_0x4ff8('0xd'),_0x4ff8('0xe')),'priority':_0x171def++},_0x4c6cf6));if(_0x1fbcce[_0x4ff8('0xf')]){_0x19f8c2['push'](_[_0x4ff8('0xb')]({'app':_0x4ff8('0x10'),'appdata':util[_0x4ff8('0x6')]('${UNIQUEID}.%s,a',_0x1fbcce[_0x4ff8('0x11')]),'priority':_0x171def++},_0x4c6cf6));}if(_0x1fbcce[_0x4ff8('0x12')]){_0x19f8c2[_0x4ff8('0xa')](_[_0x4ff8('0xb')]({'app':_0x4ff8('0x13'),'appdata':_0x1fbcce[_0x4ff8('0x14')],'priority':_0x171def++},_0x4c6cf6));}_0x19f8c2[_0x4ff8('0xa')](_[_0x4ff8('0xb')]({'app':_0x4ff8('0x15'),'appdata':util[_0x4ff8('0x6')](_0x4ff8('0x16'),_0xdfe58[_0x4ff8('0x17')],_0x1fbcce[_0x4ff8('0x18')]?_0x1fbcce[_0x4ff8('0x18')][_0x4ff8('0x19')](''):''),'priority':_0x171def++},_0x4c6cf6));if(_0x1fbcce['record']){_0x19f8c2[_0x4ff8('0xa')](_[_0x4ff8('0xb')]({'app':_0x4ff8('0x1a'),'priority':_0x171def++},_0x4c6cf6));}return _0x19f8c2;};var getChanSpyApplications=function(_0x277f1c,_0x47ec33){var _0x1c7047=[];for(var _0x5536ab=0x0,_0x140093=0x1;_0x5536ab<_0x47ec33[_0x4ff8('0x1b')];_0x5536ab++,_0x140093=0x1){_0x1c7047=_0x1c7047[_0x4ff8('0x1c')](getUserApplications(_0x277f1c,_0x47ec33[_0x5536ab],_0x47ec33[_0x5536ab][_0x4ff8('0x1d')]));if(_0x47ec33[_0x5536ab][_0x4ff8('0x1d')]!=_0x47ec33[_0x5536ab]['name']){_0x1c7047=_0x1c7047['concat'](getUserApplications(_0x277f1c,_0x47ec33[_0x5536ab],_0x47ec33[_0x5536ab][_0x4ff8('0x17')]));}}return _0x1c7047;};var getChanSpyPromise=function(_0x92d3d0,_0x134d00){return new BPromise(function(_0x80145e,_0x4332f8){return _0x92d3d0[_0x4ff8('0x1e')][_0x4ff8('0x1f')]({'attributes':['id',_0x4ff8('0x17'),'internal'],'where':{'role':_0x4ff8('0x20'),'chanspy':!![]},'raw':!![]})[_0x4ff8('0x21')](function(_0x4cd86c){if(_0x4cd86c){return _0x80145e(getChanSpyApplications(_0x134d00,_0x4cd86c));}return _0x80145e([]);})[_0x4ff8('0x22')](function(_0xf94a13){_0x4332f8(_0xf94a13);});});};module[_0x4ff8('0x23')]=function(_0x5664a6,_0x5249b9){var _0xa3c172=_0x5664a6[_0x4ff8('0x24')];return _0x5664a6[_0x4ff8('0x25')](_0x4ff8('0x26'),attributes,{'tableName':_0x4ff8('0x27'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x1b7934,_0x13d905,_0x2be8c7){return getChanSpyPromise(_0xa3c172,_0x1b7934)['then'](function(_0x3a7634){if(_0x3a7634&&_0x3a7634[_0x4ff8('0x1b')]){return _0xa3c172['VoiceExtension'][_0x4ff8('0x28')](_0x3a7634);}})[_0x4ff8('0x21')](function(){_0x2be8c7();})[_0x4ff8('0x22')](function(_0x206452){_0x2be8c7(_0x206452);});},'afterUpdate':function(_0x5945d4,_0x5d41d9,_0x4205b3){return _0xa3c172[_0x4ff8('0x29')][_0x4ff8('0x2a')]({'where':{'ChanSpyId':_0x5945d4['id']}})[_0x4ff8('0x21')](function(){return getChanSpyPromise(_0xa3c172,_0x5945d4);})[_0x4ff8('0x21')](function(_0x5fbcaa){if(_0x5fbcaa&&_0x5fbcaa[_0x4ff8('0x1b')]){return _0xa3c172[_0x4ff8('0x29')][_0x4ff8('0x28')](_0x5fbcaa);}})[_0x4ff8('0x21')](function(){_0x4205b3();})[_0x4ff8('0x22')](function(_0x9fe508){_0x4205b3(_0x9fe508);});},'afterDestroy':function(_0x4a2ac5,_0x13b900,_0x5a4808){return _0xa3c172['VoiceExtension'][_0x4ff8('0x2a')]({'where':{'ChanSpyId':_0x4a2ac5['id']}})[_0x4ff8('0x21')](function(){_0x5a4808();})[_0x4ff8('0x22')](function(_0x256a6c){_0x5a4808(_0x256a6c);});}}});}; \ No newline at end of file +var _0xd509=['util','bluebird','./voiceChanSpy.attributes','context','from-sip','format','%s%s','prefix','system','merge','CDR(type)=%s','record','push','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','password','ChanSpy','SIP/%s,%s','name','options','join','StopMixMonitor','concat','internal','User','agent','then','catch','exports','define','VoiceChanSpy','voice_chanspy','length','VoiceExtension','bulkCreate','destroy','lodash'];(function(_0x5c3c0b,_0x4ee35e){var _0x52ecd2=function(_0x3cf575){while(--_0x3cf575){_0x5c3c0b['push'](_0x5c3c0b['shift']());}};_0x52ecd2(++_0x4ee35e);}(_0xd509,0x97));var _0x9d50=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd509[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x9d50('0x0'));var util=require(_0x9d50('0x1'));var BPromise=require(_0x9d50('0x2'));var attributes=require(_0x9d50('0x3'));var getUserApplications=function(_0x52c494,_0x3bc65e,_0xc07dee){var _0xc093c5=0x1;var _0x510c8b=[];var _0x44bab4={'context':_0x3bc65e[_0x9d50('0x4')]||_0x9d50('0x5'),'exten':util[_0x9d50('0x6')](_0x9d50('0x7'),_0x52c494[_0x9d50('0x8')],_0xc07dee),'type':_0x9d50('0x9'),'isApp':![],'ChanSpyId':_0x52c494['id'],'UserId':_0x3bc65e['id']};_0x510c8b['push'](_[_0x9d50('0xa')]({'app':'Set','appdata':util[_0x9d50('0x6')](_0x9d50('0xb'),'chanspy'),'priority':_0xc093c5++},_0x44bab4));if(_0x52c494[_0x9d50('0xc')]){_0x510c8b[_0x9d50('0xd')](_['merge']({'app':_0x9d50('0xe'),'appdata':util['format'](_0x9d50('0xf'),_0x52c494[_0x9d50('0x10')]),'priority':_0xc093c5++},_0x44bab4));}if(_0x52c494['auth']){_0x510c8b[_0x9d50('0xd')](_['merge']({'app':'Authenticate','appdata':_0x52c494[_0x9d50('0x11')],'priority':_0xc093c5++},_0x44bab4));}_0x510c8b[_0x9d50('0xd')](_[_0x9d50('0xa')]({'app':_0x9d50('0x12'),'appdata':util[_0x9d50('0x6')](_0x9d50('0x13'),_0x3bc65e[_0x9d50('0x14')],_0x52c494[_0x9d50('0x15')]?_0x52c494['options'][_0x9d50('0x16')](''):''),'priority':_0xc093c5++},_0x44bab4));if(_0x52c494[_0x9d50('0xc')]){_0x510c8b['push'](_[_0x9d50('0xa')]({'app':_0x9d50('0x17'),'priority':_0xc093c5++},_0x44bab4));}return _0x510c8b;};var getChanSpyApplications=function(_0x4b9044,_0x87262a){var _0x42f25d=[];for(var _0x3388d8=0x0,_0x2b375d=0x1;_0x3388d8<_0x87262a['length'];_0x3388d8++,_0x2b375d=0x1){_0x42f25d=_0x42f25d[_0x9d50('0x18')](getUserApplications(_0x4b9044,_0x87262a[_0x3388d8],_0x87262a[_0x3388d8]['internal']));if(_0x87262a[_0x3388d8][_0x9d50('0x19')]!=_0x87262a[_0x3388d8][_0x9d50('0x14')]){_0x42f25d=_0x42f25d[_0x9d50('0x18')](getUserApplications(_0x4b9044,_0x87262a[_0x3388d8],_0x87262a[_0x3388d8][_0x9d50('0x14')]));}}return _0x42f25d;};var getChanSpyPromise=function(_0x362a2d,_0x598848){return new BPromise(function(_0x386372,_0x3c4105){return _0x362a2d[_0x9d50('0x1a')]['findAll']({'attributes':['id',_0x9d50('0x14'),_0x9d50('0x19')],'where':{'role':_0x9d50('0x1b'),'chanspy':!![]},'raw':!![]})[_0x9d50('0x1c')](function(_0x394fbe){if(_0x394fbe){return _0x386372(getChanSpyApplications(_0x598848,_0x394fbe));}return _0x386372([]);})[_0x9d50('0x1d')](function(_0xfe6530){_0x3c4105(_0xfe6530);});});};module[_0x9d50('0x1e')]=function(_0x2be64b,_0x5cff0d){var _0x5524d5=_0x2be64b['models'];return _0x2be64b[_0x9d50('0x1f')](_0x9d50('0x20'),attributes,{'tableName':_0x9d50('0x21'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x3add6d,_0x29a92e,_0x553e38){return getChanSpyPromise(_0x5524d5,_0x3add6d)['then'](function(_0x1e382f){if(_0x1e382f&&_0x1e382f[_0x9d50('0x22')]){return _0x5524d5[_0x9d50('0x23')][_0x9d50('0x24')](_0x1e382f);}})['then'](function(){_0x553e38();})[_0x9d50('0x1d')](function(_0x4c9bca){_0x553e38(_0x4c9bca);});},'afterUpdate':function(_0x4e0d98,_0x398872,_0x11bb92){return _0x5524d5[_0x9d50('0x23')][_0x9d50('0x25')]({'where':{'ChanSpyId':_0x4e0d98['id']}})[_0x9d50('0x1c')](function(){return getChanSpyPromise(_0x5524d5,_0x4e0d98);})[_0x9d50('0x1c')](function(_0x469b5e){if(_0x469b5e&&_0x469b5e[_0x9d50('0x22')]){return _0x5524d5['VoiceExtension'][_0x9d50('0x24')](_0x469b5e);}})[_0x9d50('0x1c')](function(){_0x11bb92();})[_0x9d50('0x1d')](function(_0x23ee33){_0x11bb92(_0x23ee33);});},'afterDestroy':function(_0x486a12,_0x10a063,_0x1ee701){return _0x5524d5['VoiceExtension'][_0x9d50('0x25')]({'where':{'ChanSpyId':_0x486a12['id']}})['then'](function(){_0x1ee701();})[_0x9d50('0x1d')](function(_0x3fbaa3){_0x1ee701(_0x3fbaa3);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index a7a75cc..a90a062 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 _0xbb53=['http','then','info','request\x20sent','stringify','error','message','VoiceChanSpy,\x20%s,\x20%s','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0xbb53,0x121));var _0x3bb5=function(_0x1d2302,_0xab1d9b){_0x1d2302=_0x1d2302-0x0;var _0xb02a65=_0xbb53[_0x1d2302];return _0xb02a65;};'use strict';var _=require(_0x3bb5('0x0'));var util=require(_0x3bb5('0x1'));var moment=require(_0x3bb5('0x2'));var BPromise=require(_0x3bb5('0x3'));var rs=require(_0x3bb5('0x4'));var fs=require('fs');var Redis=require(_0x3bb5('0x5'));var db=require(_0x3bb5('0x6'))['db'];var utils=require(_0x3bb5('0x7'));var logger=require(_0x3bb5('0x8'))(_0x3bb5('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3bb5('0xa')][_0x3bb5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x28aa7d,_0x157e04,_0x22f92f){return new BPromise(function(_0x480f9c,_0x5a4ae3){return client['request'](_0x28aa7d,_0x22f92f)[_0x3bb5('0xc')](function(_0x2e0cfa){logger[_0x3bb5('0xd')]('VoiceChanSpy,\x20%s,\x20%s',_0x157e04,_0x3bb5('0xe'));logger['debug']('VoiceChanSpy,\x20%s,\x20%s,\x20%s',_0x157e04,_0x3bb5('0xe'),JSON[_0x3bb5('0xf')](_0x2e0cfa));if(_0x2e0cfa['error']){if(_0x2e0cfa[_0x3bb5('0x10')]['code']===0x1f4){logger[_0x3bb5('0x10')]('VoiceChanSpy,\x20%s,\x20%s',_0x157e04,_0x2e0cfa['error'][_0x3bb5('0x11')]);return _0x5a4ae3(_0x2e0cfa[_0x3bb5('0x10')][_0x3bb5('0x11')]);}logger['error'](_0x3bb5('0x12'),_0x157e04,_0x2e0cfa[_0x3bb5('0x10')]['message']);return _0x480f9c(_0x2e0cfa[_0x3bb5('0x10')][_0x3bb5('0x11')]);}else{logger['info']('VoiceChanSpy,\x20%s,\x20%s',_0x157e04,'request\x20sent');_0x480f9c(_0x2e0cfa[_0x3bb5('0x13')][_0x3bb5('0x11')]);}})['catch'](function(_0x25d774){logger[_0x3bb5('0x10')](_0x3bb5('0x12'),_0x157e04,_0x25d774);_0x5a4ae3(_0x25d774);});});} \ No newline at end of file +var _0xda65=['message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x4f8381,_0x3d93ef){var _0x26d6f6=function(_0x4d5303){while(--_0x4d5303){_0x4f8381['push'](_0x4f8381['shift']());}};_0x26d6f6(++_0x3d93ef);}(_0xda65,0x1d0));var _0x5da6=function(_0x418789,_0x273130){_0x418789=_0x418789-0x0;var _0x516365=_0xda65[_0x418789];return _0x516365;};'use strict';var _=require(_0x5da6('0x0'));var util=require(_0x5da6('0x1'));var moment=require(_0x5da6('0x2'));var BPromise=require('bluebird');var rs=require(_0x5da6('0x3'));var fs=require('fs');var Redis=require(_0x5da6('0x4'));var db=require(_0x5da6('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5da6('0x6'));var config=require(_0x5da6('0x7'));var jayson=require(_0x5da6('0x8'));var client=jayson[_0x5da6('0x9')][_0x5da6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x51924c,_0x35aff9,_0x4a7040){return new BPromise(function(_0x55108e,_0x40722c){return client['request'](_0x51924c,_0x4a7040)[_0x5da6('0xb')](function(_0x20cb14){logger[_0x5da6('0xc')](_0x5da6('0xd'),_0x35aff9,_0x5da6('0xe'));logger[_0x5da6('0xf')](_0x5da6('0x10'),_0x35aff9,_0x5da6('0xe'),JSON['stringify'](_0x20cb14));if(_0x20cb14[_0x5da6('0x11')]){if(_0x20cb14[_0x5da6('0x11')][_0x5da6('0x12')]===0x1f4){logger[_0x5da6('0x11')](_0x5da6('0xd'),_0x35aff9,_0x20cb14[_0x5da6('0x11')][_0x5da6('0x13')]);return _0x40722c(_0x20cb14[_0x5da6('0x11')][_0x5da6('0x13')]);}logger['error'](_0x5da6('0xd'),_0x35aff9,_0x20cb14[_0x5da6('0x11')][_0x5da6('0x13')]);return _0x55108e(_0x20cb14[_0x5da6('0x11')][_0x5da6('0x13')]);}else{logger[_0x5da6('0xc')](_0x5da6('0xd'),_0x35aff9,_0x5da6('0xe'));_0x55108e(_0x20cb14[_0x5da6('0x14')][_0x5da6('0x13')]);}})['catch'](function(_0x5207e5){logger[_0x5da6('0x11')](_0x5da6('0xd'),_0x35aff9,_0x5207e5);_0x40722c(_0x5207e5);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index 8409a72..83c8ae1 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 _0x07d6=['path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./voiceContext.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','exports','multer','util'];(function(_0x26eafb,_0x10945c){var _0x5c35c0=function(_0x4df871){while(--_0x4df871){_0x26eafb['push'](_0x26eafb['shift']());}};_0x5c35c0(++_0x10945c);}(_0x07d6,0xa9));var _0x607d=function(_0x51816f,_0x11677e){_0x51816f=_0x51816f-0x0;var _0x41b781=_0x07d6[_0x51816f];return _0x41b781;};'use strict';var multer=require(_0x607d('0x0'));var util=require(_0x607d('0x1'));var path=require(_0x607d('0x2'));var timeout=require(_0x607d('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x607d('0x4'));var auth=require(_0x607d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x607d('0x6'));var controller=require(_0x607d('0x7'));router[_0x607d('0x8')]('/',auth[_0x607d('0x9')](),controller[_0x607d('0xa')]);router[_0x607d('0x8')](_0x607d('0xb'),auth[_0x607d('0x9')](),controller[_0x607d('0xc')]);router[_0x607d('0xd')]('/',auth['isAuthenticated'](),controller[_0x607d('0xe')]);router['put'](_0x607d('0xb'),auth[_0x607d('0x9')](),controller[_0x607d('0xf')]);router[_0x607d('0x10')](_0x607d('0xb'),auth[_0x607d('0x9')](),controller[_0x607d('0x11')]);module[_0x607d('0x12')]=router; \ No newline at end of file +var _0xd513=['../../components/auth/service','../../config/environment','./voiceContext.controller','get','isAuthenticated','show','post','put','/:id','delete','destroy','multer','path','Router','fs-extra'];(function(_0x2fac1c,_0x3adafc){var _0x3f05b0=function(_0x2b87e0){while(--_0x2b87e0){_0x2fac1c['push'](_0x2fac1c['shift']());}};_0x3f05b0(++_0x3adafc);}(_0xd513,0x1a0));var _0x3d51=function(_0x143b72,_0x596187){_0x143b72=_0x143b72-0x0;var _0x1a2077=_0xd513[_0x143b72];return _0x1a2077;};'use strict';var multer=require(_0x3d51('0x0'));var util=require('util');var path=require(_0x3d51('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x3d51('0x2')]();var fs_extra=require(_0x3d51('0x3'));var auth=require(_0x3d51('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x3d51('0x5'));var controller=require(_0x3d51('0x6'));router[_0x3d51('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x3d51('0x7')]('/:id',auth[_0x3d51('0x8')](),controller[_0x3d51('0x9')]);router[_0x3d51('0xa')]('/',auth[_0x3d51('0x8')](),controller['create']);router[_0x3d51('0xb')](_0x3d51('0xc'),auth[_0x3d51('0x8')](),controller['update']);router[_0x3d51('0xd')](_0x3d51('0xc'),auth[_0x3d51('0x8')](),controller[_0x3d51('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index 9d5be55..3cbd155 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 _0x32df=['name','BOOLEAN','sequelize','exports'];(function(_0x3872f3,_0x3471f3){var _0x22de38=function(_0x5dc034){while(--_0x5dc034){_0x3872f3['push'](_0x3872f3['shift']());}};_0x22de38(++_0x3471f3);}(_0x32df,0x13a));var _0xf32d=function(_0x1e8a37,_0x1a7cd9){_0x1e8a37=_0x1e8a37-0x0;var _0x40b851=_0x32df[_0x1e8a37];return _0x40b851;};'use strict';var Sequelize=require(_0xf32d('0x0'));module[_0xf32d('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xf32d('0x2')},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xf32d('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x5527=['BOOLEAN','exports','STRING'];(function(_0x3ea389,_0x13353e){var _0x3229c5=function(_0x486f7c){while(--_0x486f7c){_0x3ea389['push'](_0x3ea389['shift']());}};_0x3229c5(++_0x13353e);}(_0x5527,0x1c6));var _0x7552=function(_0x161cc5,_0x82e7b5){_0x161cc5=_0x161cc5-0x0;var _0x307366=_0x5527[_0x161cc5];return _0x307366;};'use strict';var Sequelize=require('sequelize');module[_0x7552('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name'},'description':{'type':Sequelize[_0x7552('0x1')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x7552('0x2')],'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 fa41748..49e470c 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 _0x2222=['create','join','root','server/files/templates/context.ejs','utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','Reload','readFileSync','chan_sip.so','eml-format','zip-dir','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','client','http','request','then','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','status','offset','undefined','limit','count','set','Content-Range','json','apply','save','destroy','get','Contexts','end','sendStatus','stack','name','send','index','map','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','sort','pick','filter','merge','where','VIRTUAL','options','VoiceContext','includeAll','include','findAll','rows','show','params'];(function(_0x427c3f,_0x3d0ef7){var _0x2409b8=function(_0x122ec6){while(--_0x122ec6){_0x427c3f['push'](_0x427c3f['shift']());}};_0x2409b8(++_0x3d0ef7);}(_0x2222,0xe3));var _0x2222=function(_0x4bdfb7,_0x1639a6){_0x4bdfb7=_0x4bdfb7-0x0;var _0x175d1c=_0x2222[_0x4bdfb7];return _0x175d1c;};'use strict';var emlformat=require(_0x2222('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2222('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2222('0x2'));var moment=require(_0x2222('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x2222('0x4'));var util=require(_0x2222('0x5'));var path=require('path');var sox=require(_0x2222('0x6'));var csv=require(_0x2222('0x7'));var ejs=require(_0x2222('0x8'));var fs=require('fs');var fs_extra=require(_0x2222('0x9'));var _=require('lodash');var squel=require(_0x2222('0xa'));var crypto=require(_0x2222('0xb'));var jsforce=require(_0x2222('0xc'));var deskjs=require(_0x2222('0xd'));var toCsv=require(_0x2222('0x7'));var querystring=require(_0x2222('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x2222('0xf'));var qs=require(_0x2222('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2222('0x11'))(_0x2222('0x12'));var utils=require(_0x2222('0x13'));var config=require(_0x2222('0x14'));var licenseUtil=require(_0x2222('0x15'));var db=require(_0x2222('0x16'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x2222('0x17')][_0x2222('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x748871,_0x4b7041,_0x399784,_0x5c9d0a){return new BPromise(function(_0x577b39,_0x3485c9){var _0x493aa8=_0x5c9d0a||client;return _0x493aa8[_0x2222('0x19')](_0x748871,_0x399784)[_0x2222('0x1a')](function(_0x537126){logger['info'](_0x2222('0x1b'),_0x4b7041,_0x2222('0x1c'));logger[_0x2222('0x1d')](_0x2222('0x1e'),_0x4b7041,'request\x20sent',JSON[_0x2222('0x1f')](_0x537126));if(_0x537126[_0x2222('0x20')]){if(_0x537126['error'][_0x2222('0x21')]===0x1f4){logger[_0x2222('0x20')]('VoiceContext,\x20%s,\x20%s',_0x4b7041,_0x537126['error'][_0x2222('0x22')]);return _0x3485c9(_0x537126[_0x2222('0x20')][_0x2222('0x22')]);}logger['error'](_0x2222('0x1b'),_0x4b7041,_0x537126[_0x2222('0x20')][_0x2222('0x22')]);return _0x577b39(_0x537126[_0x2222('0x20')][_0x2222('0x22')]);}else{logger[_0x2222('0x23')](_0x2222('0x1b'),_0x4b7041,'request\x20sent');_0x577b39(_0x537126[_0x2222('0x24')][_0x2222('0x22')]);}})[_0x2222('0x25')](function(_0xe2880d){logger[_0x2222('0x20')]('VoiceContext,\x20%s,\x20%s',_0x4b7041,_0xe2880d);_0x3485c9(_0xe2880d);});});}function respondWithStatusCode(_0x46d996,_0x49042b){_0x49042b=_0x49042b||0xcc;return function(_0x55924b){if(_0x55924b){return _0x46d996['sendStatus'](_0x49042b);}return _0x46d996[_0x2222('0x26')](_0x49042b)['end']();};}function respondWithResult(_0x41b24f,_0x651a29){_0x651a29=_0x651a29||0xc8;return function(_0x43b68d){if(_0x43b68d){return _0x41b24f['status'](_0x651a29)['json'](_0x43b68d);}};}function respondWithFilteredResult(_0x4c2c7b,_0x22f07e){return function(_0x341e49){if(_0x341e49){var _0x1f4e71=typeof _0x22f07e[_0x2222('0x27')]===_0x2222('0x28')&&typeof _0x22f07e[_0x2222('0x29')]==='undefined';var _0x4831ba=_0x341e49[_0x2222('0x2a')];var _0x4bfcbd=_0x1f4e71?0x0:_0x22f07e[_0x2222('0x27')];var _0x3f0442=_0x1f4e71?_0x341e49[_0x2222('0x2a')]:_0x22f07e[_0x2222('0x27')]+_0x22f07e[_0x2222('0x29')];var _0x455f3b;if(_0x3f0442>=_0x4831ba){_0x3f0442=_0x4831ba;_0x455f3b=0xc8;}else{_0x455f3b=0xce;}_0x4c2c7b[_0x2222('0x26')](_0x455f3b);return _0x4c2c7b[_0x2222('0x2b')](_0x2222('0x2c'),_0x4bfcbd+'-'+_0x3f0442+'/'+_0x4831ba)[_0x2222('0x2d')](_0x341e49);}return null;};}function patchUpdates(_0x2b9f03){return function(_0xa678a9){try{jsonpatch[_0x2222('0x2e')](_0xa678a9,_0x2b9f03,!![]);}catch(_0x467dec){return BPromise['reject'](_0x467dec);}return _0xa678a9[_0x2222('0x2f')]();};}function saveUpdates(_0x2112d7,_0x141103){return function(_0x3d55e0){if(_0x3d55e0){return _0x3d55e0['update'](_0x2112d7)['then'](function(_0x358e41){return _0x358e41;});}return null;};}function removeEntity(_0x5af71c,_0x153835){return function(_0x26c859){if(_0x26c859){return _0x26c859[_0x2222('0x30')]()[_0x2222('0x1a')](function(){var _0x345c49=_0x26c859[_0x2222('0x31')]({'plain':!![]});var _0xd0875a=_0x2222('0x32');return db['UserProfileResource'][_0x2222('0x30')]({'where':{'type':_0xd0875a,'resourceId':_0x345c49['id']}})[_0x2222('0x1a')](function(){return _0x26c859;});})['then'](function(){_0x5af71c[_0x2222('0x26')](0xcc)[_0x2222('0x33')]();});}};}function handleEntityNotFound(_0xb9eda9,_0x47c115){return function(_0x426074){if(!_0x426074){_0xb9eda9[_0x2222('0x34')](0x194);}return _0x426074;};}function handleError(_0x17278f,_0xbcf973){_0xbcf973=_0xbcf973||0x1f4;return function(_0xefabbc){logger['error'](_0xefabbc[_0x2222('0x35')]);if(_0xefabbc[_0x2222('0x36')]){delete _0xefabbc[_0x2222('0x36')];}_0x17278f[_0x2222('0x26')](_0xbcf973)[_0x2222('0x37')](_0xefabbc);};}exports[_0x2222('0x38')]=function(_0x3b446a,_0x379cc2){var _0x52790d={},_0x4aef86={},_0x3ee5d2={'count':0x0,'rows':[]};var _0x536b71=_[_0x2222('0x39')](db['VoiceContext']['rawAttributes'],function(_0x1685f9){return{'name':_0x1685f9[_0x2222('0x3a')],'type':_0x1685f9[_0x2222('0x3b')]['key']};});_0x4aef86[_0x2222('0x3c')]=_[_0x2222('0x39')](_0x536b71,_0x2222('0x36'));_0x4aef86[_0x2222('0x3d')]=_[_0x2222('0x3e')](_0x3b446a['query']);_0x4aef86[_0x2222('0x3f')]=_[_0x2222('0x40')](_0x4aef86[_0x2222('0x3c')],_0x4aef86[_0x2222('0x3d')]);_0x52790d[_0x2222('0x41')]=_[_0x2222('0x40')](_0x4aef86[_0x2222('0x3c')],qs[_0x2222('0x42')](_0x3b446a['query'][_0x2222('0x42')]));_0x52790d[_0x2222('0x41')]=_0x52790d[_0x2222('0x41')][_0x2222('0x43')]?_0x52790d['attributes']:_0x4aef86[_0x2222('0x3c')];if(!_0x3b446a[_0x2222('0x3d')]['hasOwnProperty']('nolimit')){_0x52790d['limit']=qs[_0x2222('0x29')](_0x3b446a[_0x2222('0x3d')]['limit']);_0x52790d['offset']=qs['offset'](_0x3b446a['query'][_0x2222('0x27')]);}_0x52790d['order']=qs[_0x2222('0x44')](_0x3b446a['query'][_0x2222('0x44')]);_0x52790d['where']=qs['filters'](_[_0x2222('0x45')](_0x3b446a[_0x2222('0x3d')],_0x4aef86['filters']),_0x536b71);if(_0x3b446a[_0x2222('0x3d')][_0x2222('0x46')]){_0x52790d['where']=_[_0x2222('0x47')](_0x52790d[_0x2222('0x48')],{'$or':_['map'](_0x536b71,function(_0x4be6cb){if(_0x4be6cb['type']!==_0x2222('0x49')){var _0x509541={};_0x509541[_0x4be6cb[_0x2222('0x36')]]={'$like':'%'+_0x3b446a[_0x2222('0x3d')][_0x2222('0x46')]+'%'};return _0x509541;}})});}_0x52790d=_[_0x2222('0x47')]({},_0x52790d,_0x3b446a[_0x2222('0x4a')]);var _0x2e57be={'where':_0x52790d['where']};return db[_0x2222('0x4b')][_0x2222('0x2a')](_0x2e57be)[_0x2222('0x1a')](function(_0x1f3c07){_0x3ee5d2['count']=_0x1f3c07;if(_0x3b446a[_0x2222('0x3d')][_0x2222('0x4c')]){_0x52790d[_0x2222('0x4d')]=[{'all':!![]}];}return db['VoiceContext'][_0x2222('0x4e')](_0x52790d);})[_0x2222('0x1a')](function(_0x9794b0){_0x3ee5d2[_0x2222('0x4f')]=_0x9794b0;return _0x3ee5d2;})[_0x2222('0x1a')](respondWithFilteredResult(_0x379cc2,_0x52790d))[_0x2222('0x25')](handleError(_0x379cc2,null));};exports[_0x2222('0x50')]=function(_0xddfd85,_0xb6a21d){var _0x4a6af6={'raw':![],'where':{'id':_0xddfd85[_0x2222('0x51')]['id']}},_0x1bad07={};_0x1bad07[_0x2222('0x3c')]=_[_0x2222('0x3e')](db[_0x2222('0x4b')]['rawAttributes']);_0x1bad07[_0x2222('0x3d')]=_[_0x2222('0x3e')](_0xddfd85[_0x2222('0x3d')]);_0x1bad07[_0x2222('0x3f')]=_[_0x2222('0x40')](_0x1bad07[_0x2222('0x3c')],_0x1bad07[_0x2222('0x3d')]);_0x4a6af6[_0x2222('0x41')]=_[_0x2222('0x40')](_0x1bad07[_0x2222('0x3c')],qs[_0x2222('0x42')](_0xddfd85[_0x2222('0x3d')][_0x2222('0x42')]));_0x4a6af6[_0x2222('0x41')]=_0x4a6af6['attributes'][_0x2222('0x43')]?_0x4a6af6[_0x2222('0x41')]:_0x1bad07[_0x2222('0x3c')];if(_0xddfd85[_0x2222('0x3d')][_0x2222('0x4c')]){_0x4a6af6[_0x2222('0x4d')]=[{'all':!![]}];}_0x4a6af6=_[_0x2222('0x47')]({},_0x4a6af6,_0xddfd85[_0x2222('0x4a')]);return db[_0x2222('0x4b')]['find'](_0x4a6af6)[_0x2222('0x1a')](handleEntityNotFound(_0xb6a21d,null))[_0x2222('0x1a')](respondWithResult(_0xb6a21d,null))[_0x2222('0x25')](handleError(_0xb6a21d,null));};exports[_0x2222('0x52')]=function(_0x2130c1,_0x2294a8,_0x269fed){var _0x332781;return db[_0x2222('0x4b')]['create'](_0x2130c1['body'],{'raw':!![]})[_0x2222('0x1a')](function(_0x445061){_0x332781=_0x445061;return db[_0x2222('0x4b')][_0x2222('0x4e')]({'raw':!![]});})[_0x2222('0x1a')](function(_0x2228c6){var _0xf93529=fs['readFileSync'](path[_0x2222('0x53')](config[_0x2222('0x54')],_0x2222('0x55')),_0x2222('0x56'));var _0x226077=ejs[_0x2222('0x57')](_0xf93529,{'contexts':_0x2228c6||[]});fs[_0x2222('0x58')](_0x2222('0x59'),_0x226077);})[_0x2222('0x1a')](function(){return respondWithRpcPromise('Reload',_0x2222('0x52'),{'module':'chan_sip.so'});})[_0x2222('0x1a')](function(){var _0x42db59=_0x2130c1[_0x2222('0x5a')][_0x2222('0x31')]({'plain':!![]});if(!_0x42db59)throw new Error(_0x2222('0x5b'));if(_0x42db59[_0x2222('0x5c')]===_0x2222('0x5a')){var _0x37d9fe=_0x332781[_0x2222('0x31')]({'plain':!![]});return db[_0x2222('0x5d')][_0x2222('0x5e')]({'where':{'name':'Contexts','userProfileId':_0x42db59[_0x2222('0x5f')]},'raw':!![]})[_0x2222('0x1a')](function(_0x34e2e0){if(_0x34e2e0&&_0x34e2e0['autoAssociation']===0x0){return db[_0x2222('0x60')][_0x2222('0x52')]({'name':_0x37d9fe[_0x2222('0x36')],'resourceId':_0x37d9fe['id'],'type':_0x34e2e0[_0x2222('0x36')],'sectionId':_0x34e2e0['id']},{})[_0x2222('0x1a')](function(){return _0x332781;});}else{return _0x332781;}})[_0x2222('0x25')](function(_0x247092){logger['error'](_0x2222('0x61'),_0x247092);throw _0x247092;});}return _0x332781;})[_0x2222('0x1a')](respondWithResult(_0x2294a8,0xc9))[_0x2222('0x25')](handleError(_0x2294a8,null));};exports[_0x2222('0x62')]=function(_0x276b14,_0x43fa08,_0x3459ad){var _0x4880b8;return db[_0x2222('0x4b')]['find']({'where':{'id':_0x276b14[_0x2222('0x51')]['id']}})[_0x2222('0x1a')](handleEntityNotFound(_0x43fa08,null))[_0x2222('0x1a')](saveUpdates(_0x276b14[_0x2222('0x63')],null))['then'](function(_0x38be92){if(_0x38be92){_0x4880b8=_0x38be92;return db['VoiceContext'][_0x2222('0x4e')]({'raw':!![]});}})[_0x2222('0x1a')](function(_0xe0d4df){var _0x1b2759=fs['readFileSync'](path['join'](config[_0x2222('0x54')],_0x2222('0x55')),_0x2222('0x56'));var _0x2c242b=ejs[_0x2222('0x57')](_0x1b2759,{'contexts':_0xe0d4df||[]});fs[_0x2222('0x58')](_0x2222('0x59'),_0x2c242b);})[_0x2222('0x1a')](function(){return respondWithRpcPromise(_0x2222('0x64'),_0x2222('0x62'),{'module':'chan_sip.so'});})[_0x2222('0x1a')](function(){return _0x4880b8;})[_0x2222('0x1a')](respondWithResult(_0x43fa08,null))[_0x2222('0x25')](handleError(_0x43fa08,null));};exports[_0x2222('0x30')]=function(_0x247c9c,_0x2787c6,_0x3fbc15){var _0x11a582;return db[_0x2222('0x4b')]['find']({'where':{'id':_0x247c9c[_0x2222('0x51')]['id']}})['then'](handleEntityNotFound(_0x2787c6,null))[_0x2222('0x1a')](removeEntity(_0x2787c6,null))['then'](function(){return db[_0x2222('0x4b')][_0x2222('0x4e')]({'raw':!![]});})[_0x2222('0x1a')](function(_0x605693){var _0x20ef18=fs[_0x2222('0x65')](path['join'](config[_0x2222('0x54')],'server/files/templates/context.ejs'),_0x2222('0x56'));var _0x5425dd=ejs['render'](_0x20ef18,{'contexts':_0x605693});fs[_0x2222('0x58')](_0x2222('0x59'),_0x5425dd);return respondWithRpcPromise(_0x2222('0x64'),_0x2222('0x30'),{'module':_0x2222('0x66')});})[_0x2222('0x25')](handleError(_0x2787c6,null));}; \ No newline at end of file +var _0x12cc=['nolimit','sort','where','filter','VIRTUAL','merge','includeAll','findAll','rows','params','keys','include','options','find','catch','create','body','readFileSync','join','server/files/templates/context.ejs','utf8','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','render','Reload','chan_sip.so','root','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','ejs','fs-extra','lodash','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','client','http','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','error','code','message','result','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','get','Contexts','UserProfileResource','destroy','stack','name','send','index','map','VoiceContext','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x294a2c,_0x4b6f00){var _0x2705a8=function(_0x47f91b){while(--_0x47f91b){_0x294a2c['push'](_0x294a2c['shift']());}};_0x2705a8(++_0x4b6f00);}(_0x12cc,0xf2));var _0xc12c=function(_0x3c66d2,_0x411cb1){_0x3c66d2=_0x3c66d2-0x0;var _0x4400fb=_0x12cc[_0x3c66d2];return _0x4400fb;};'use strict';var emlformat=require(_0xc12c('0x0'));var rimraf=require(_0xc12c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc12c('0x2'));var rp=require(_0xc12c('0x3'));var moment=require(_0xc12c('0x4'));var BPromise=require(_0xc12c('0x5'));var Mustache=require(_0xc12c('0x6'));var util=require(_0xc12c('0x7'));var path=require('path');var sox=require('sox');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('squel');var crypto=require('crypto');var jsforce=require(_0xc12c('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xc12c('0xc'));var querystring=require(_0xc12c('0xd'));var Papa=require(_0xc12c('0xe'));var Redis=require(_0xc12c('0xf'));var authService=require(_0xc12c('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc12c('0x11'));var logger=require(_0xc12c('0x12'))(_0xc12c('0x13'));var utils=require(_0xc12c('0x14'));var config=require(_0xc12c('0x15'));var licenseUtil=require(_0xc12c('0x16'));var db=require(_0xc12c('0x17'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xc12c('0x18')][_0xc12c('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x304914,_0x46ed96,_0x3a7c96,_0x2d0a28){return new BPromise(function(_0xe37271,_0x4bdadb){var _0x1e98a6=_0x2d0a28||client;return _0x1e98a6[_0xc12c('0x1a')](_0x304914,_0x3a7c96)[_0xc12c('0x1b')](function(_0x2854a8){logger[_0xc12c('0x1c')](_0xc12c('0x1d'),_0x46ed96,_0xc12c('0x1e'));logger[_0xc12c('0x1f')](_0xc12c('0x20'),_0x46ed96,_0xc12c('0x1e'),JSON['stringify'](_0x2854a8));if(_0x2854a8[_0xc12c('0x21')]){if(_0x2854a8[_0xc12c('0x21')][_0xc12c('0x22')]===0x1f4){logger[_0xc12c('0x21')]('VoiceContext,\x20%s,\x20%s',_0x46ed96,_0x2854a8['error'][_0xc12c('0x23')]);return _0x4bdadb(_0x2854a8[_0xc12c('0x21')]['message']);}logger[_0xc12c('0x21')]('VoiceContext,\x20%s,\x20%s',_0x46ed96,_0x2854a8[_0xc12c('0x21')]['message']);return _0xe37271(_0x2854a8['error']['message']);}else{logger[_0xc12c('0x1c')]('VoiceContext,\x20%s,\x20%s',_0x46ed96,_0xc12c('0x1e'));_0xe37271(_0x2854a8[_0xc12c('0x24')][_0xc12c('0x23')]);}})['catch'](function(_0x1f887c){logger[_0xc12c('0x21')](_0xc12c('0x1d'),_0x46ed96,_0x1f887c);_0x4bdadb(_0x1f887c);});});}function respondWithStatusCode(_0x57c7c8,_0x52ac51){_0x52ac51=_0x52ac51||0xcc;return function(_0x4fa3f7){if(_0x4fa3f7){return _0x57c7c8[_0xc12c('0x25')](_0x52ac51);}return _0x57c7c8[_0xc12c('0x26')](_0x52ac51)[_0xc12c('0x27')]();};}function respondWithResult(_0x333142,_0x29c709){_0x29c709=_0x29c709||0xc8;return function(_0x149eac){if(_0x149eac){return _0x333142['status'](_0x29c709)[_0xc12c('0x28')](_0x149eac);}};}function respondWithFilteredResult(_0x10f73,_0x157ecb){return function(_0x138337){if(_0x138337){var _0x12597d=typeof _0x157ecb[_0xc12c('0x29')]===_0xc12c('0x2a')&&typeof _0x157ecb[_0xc12c('0x2b')]===_0xc12c('0x2a');var _0x2e63e3=_0x138337[_0xc12c('0x2c')];var _0x396478=_0x12597d?0x0:_0x157ecb[_0xc12c('0x29')];var _0x4f6aeb=_0x12597d?_0x138337['count']:_0x157ecb[_0xc12c('0x29')]+_0x157ecb['limit'];var _0x2eb46f;if(_0x4f6aeb>=_0x2e63e3){_0x4f6aeb=_0x2e63e3;_0x2eb46f=0xc8;}else{_0x2eb46f=0xce;}_0x10f73['status'](_0x2eb46f);return _0x10f73[_0xc12c('0x2d')](_0xc12c('0x2e'),_0x396478+'-'+_0x4f6aeb+'/'+_0x2e63e3)['json'](_0x138337);}return null;};}function patchUpdates(_0x11a4e4){return function(_0x299589){try{jsonpatch[_0xc12c('0x2f')](_0x299589,_0x11a4e4,!![]);}catch(_0x24f0b8){return BPromise[_0xc12c('0x30')](_0x24f0b8);}return _0x299589[_0xc12c('0x31')]();};}function saveUpdates(_0x19d62b,_0x56058e){return function(_0x4b9caf){if(_0x4b9caf){return _0x4b9caf[_0xc12c('0x32')](_0x19d62b)[_0xc12c('0x1b')](function(_0x4ca0ca){return _0x4ca0ca;});}return null;};}function removeEntity(_0x272b2f,_0x333448){return function(_0x14c8a9){if(_0x14c8a9){return _0x14c8a9['destroy']()[_0xc12c('0x1b')](function(){var _0x1aede5=_0x14c8a9[_0xc12c('0x33')]({'plain':!![]});var _0x2081d8=_0xc12c('0x34');return db[_0xc12c('0x35')][_0xc12c('0x36')]({'where':{'type':_0x2081d8,'resourceId':_0x1aede5['id']}})[_0xc12c('0x1b')](function(){return _0x14c8a9;});})[_0xc12c('0x1b')](function(){_0x272b2f[_0xc12c('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3adf55,_0x307e88){return function(_0x5e9e6d){if(!_0x5e9e6d){_0x3adf55['sendStatus'](0x194);}return _0x5e9e6d;};}function handleError(_0x3c549d,_0x4f7c2a){_0x4f7c2a=_0x4f7c2a||0x1f4;return function(_0x387e40){logger['error'](_0x387e40[_0xc12c('0x37')]);if(_0x387e40[_0xc12c('0x38')]){delete _0x387e40['name'];}_0x3c549d[_0xc12c('0x26')](_0x4f7c2a)[_0xc12c('0x39')](_0x387e40);};}exports[_0xc12c('0x3a')]=function(_0x3cac94,_0x4d2e0c){var _0x2ea4a1={},_0x1a841e={},_0x17f0c6={'count':0x0,'rows':[]};var _0x37e61a=_[_0xc12c('0x3b')](db[_0xc12c('0x3c')][_0xc12c('0x3d')],function(_0x489c36){return{'name':_0x489c36[_0xc12c('0x3e')],'type':_0x489c36[_0xc12c('0x3f')][_0xc12c('0x40')]};});_0x1a841e[_0xc12c('0x41')]=_['map'](_0x37e61a,_0xc12c('0x38'));_0x1a841e[_0xc12c('0x42')]=_['keys'](_0x3cac94[_0xc12c('0x42')]);_0x1a841e[_0xc12c('0x43')]=_[_0xc12c('0x44')](_0x1a841e[_0xc12c('0x41')],_0x1a841e[_0xc12c('0x42')]);_0x2ea4a1[_0xc12c('0x45')]=_['intersection'](_0x1a841e[_0xc12c('0x41')],qs[_0xc12c('0x46')](_0x3cac94[_0xc12c('0x42')][_0xc12c('0x46')]));_0x2ea4a1[_0xc12c('0x45')]=_0x2ea4a1['attributes'][_0xc12c('0x47')]?_0x2ea4a1['attributes']:_0x1a841e[_0xc12c('0x41')];if(!_0x3cac94[_0xc12c('0x42')][_0xc12c('0x48')](_0xc12c('0x49'))){_0x2ea4a1[_0xc12c('0x2b')]=qs[_0xc12c('0x2b')](_0x3cac94[_0xc12c('0x42')][_0xc12c('0x2b')]);_0x2ea4a1[_0xc12c('0x29')]=qs[_0xc12c('0x29')](_0x3cac94[_0xc12c('0x42')][_0xc12c('0x29')]);}_0x2ea4a1['order']=qs[_0xc12c('0x4a')](_0x3cac94['query'][_0xc12c('0x4a')]);_0x2ea4a1[_0xc12c('0x4b')]=qs[_0xc12c('0x43')](_['pick'](_0x3cac94[_0xc12c('0x42')],_0x1a841e['filters']),_0x37e61a);if(_0x3cac94[_0xc12c('0x42')][_0xc12c('0x4c')]){_0x2ea4a1[_0xc12c('0x4b')]=_['merge'](_0x2ea4a1['where'],{'$or':_[_0xc12c('0x3b')](_0x37e61a,function(_0x3ecf09){if(_0x3ecf09[_0xc12c('0x3f')]!==_0xc12c('0x4d')){var _0x5de382={};_0x5de382[_0x3ecf09[_0xc12c('0x38')]]={'$like':'%'+_0x3cac94[_0xc12c('0x42')][_0xc12c('0x4c')]+'%'};return _0x5de382;}})});}_0x2ea4a1=_[_0xc12c('0x4e')]({},_0x2ea4a1,_0x3cac94['options']);var _0x2fa7c2={'where':_0x2ea4a1[_0xc12c('0x4b')]};return db[_0xc12c('0x3c')]['count'](_0x2fa7c2)['then'](function(_0x19b219){_0x17f0c6[_0xc12c('0x2c')]=_0x19b219;if(_0x3cac94[_0xc12c('0x42')][_0xc12c('0x4f')]){_0x2ea4a1['include']=[{'all':!![]}];}return db[_0xc12c('0x3c')][_0xc12c('0x50')](_0x2ea4a1);})[_0xc12c('0x1b')](function(_0xa8149e){_0x17f0c6[_0xc12c('0x51')]=_0xa8149e;return _0x17f0c6;})[_0xc12c('0x1b')](respondWithFilteredResult(_0x4d2e0c,_0x2ea4a1))['catch'](handleError(_0x4d2e0c,null));};exports['show']=function(_0x8e58aa,_0x7927ac){var _0x28af3d={'raw':![],'where':{'id':_0x8e58aa[_0xc12c('0x52')]['id']}},_0x2aa5f1={};_0x2aa5f1['model']=_[_0xc12c('0x53')](db[_0xc12c('0x3c')][_0xc12c('0x3d')]);_0x2aa5f1[_0xc12c('0x42')]=_['keys'](_0x8e58aa[_0xc12c('0x42')]);_0x2aa5f1[_0xc12c('0x43')]=_['intersection'](_0x2aa5f1[_0xc12c('0x41')],_0x2aa5f1[_0xc12c('0x42')]);_0x28af3d[_0xc12c('0x45')]=_[_0xc12c('0x44')](_0x2aa5f1[_0xc12c('0x41')],qs[_0xc12c('0x46')](_0x8e58aa['query'][_0xc12c('0x46')]));_0x28af3d['attributes']=_0x28af3d[_0xc12c('0x45')]['length']?_0x28af3d[_0xc12c('0x45')]:_0x2aa5f1[_0xc12c('0x41')];if(_0x8e58aa[_0xc12c('0x42')][_0xc12c('0x4f')]){_0x28af3d[_0xc12c('0x54')]=[{'all':!![]}];}_0x28af3d=_[_0xc12c('0x4e')]({},_0x28af3d,_0x8e58aa[_0xc12c('0x55')]);return db[_0xc12c('0x3c')][_0xc12c('0x56')](_0x28af3d)['then'](handleEntityNotFound(_0x7927ac,null))[_0xc12c('0x1b')](respondWithResult(_0x7927ac,null))[_0xc12c('0x57')](handleError(_0x7927ac,null));};exports[_0xc12c('0x58')]=function(_0x4cbfe4,_0x55c1ae,_0x368a5e){var _0x56bbe5;return db['VoiceContext'][_0xc12c('0x58')](_0x4cbfe4[_0xc12c('0x59')],{'raw':!![]})['then'](function(_0x2576e2){_0x56bbe5=_0x2576e2;return db[_0xc12c('0x3c')][_0xc12c('0x50')]({'raw':!![]});})[_0xc12c('0x1b')](function(_0x480dbb){var _0x11c31e=fs[_0xc12c('0x5a')](path[_0xc12c('0x5b')](config['root'],_0xc12c('0x5c')),_0xc12c('0x5d'));var _0xf6f99f=ejs['render'](_0x11c31e,{'contexts':_0x480dbb||[]});fs[_0xc12c('0x5e')](_0xc12c('0x5f'),_0xf6f99f);})[_0xc12c('0x1b')](function(){return respondWithRpcPromise('Reload',_0xc12c('0x58'),{'module':'chan_sip.so'});})[_0xc12c('0x1b')](function(){var _0xefdcf8=_0x4cbfe4[_0xc12c('0x60')][_0xc12c('0x33')]({'plain':!![]});if(!_0xefdcf8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xefdcf8[_0xc12c('0x61')]===_0xc12c('0x60')){var _0x57322c=_0x56bbe5[_0xc12c('0x33')]({'plain':!![]});return db['UserProfileSection'][_0xc12c('0x56')]({'where':{'name':'Contexts','userProfileId':_0xefdcf8[_0xc12c('0x62')]},'raw':!![]})[_0xc12c('0x1b')](function(_0x133cfe){if(_0x133cfe&&_0x133cfe[_0xc12c('0x63')]===0x0){return db[_0xc12c('0x35')]['create']({'name':_0x57322c[_0xc12c('0x38')],'resourceId':_0x57322c['id'],'type':_0x133cfe['name'],'sectionId':_0x133cfe['id']},{})['then'](function(){return _0x56bbe5;});}else{return _0x56bbe5;}})[_0xc12c('0x57')](function(_0x48bc3c){logger[_0xc12c('0x21')](_0xc12c('0x64'),_0x48bc3c);throw _0x48bc3c;});}return _0x56bbe5;})[_0xc12c('0x1b')](respondWithResult(_0x55c1ae,0xc9))[_0xc12c('0x57')](handleError(_0x55c1ae,null));};exports[_0xc12c('0x32')]=function(_0x5bbec5,_0x22e580,_0x369b41){var _0x29b4c4;return db['VoiceContext'][_0xc12c('0x56')]({'where':{'id':_0x5bbec5[_0xc12c('0x52')]['id']}})['then'](handleEntityNotFound(_0x22e580,null))[_0xc12c('0x1b')](saveUpdates(_0x5bbec5[_0xc12c('0x59')],null))['then'](function(_0x3e4df3){if(_0x3e4df3){_0x29b4c4=_0x3e4df3;return db[_0xc12c('0x3c')][_0xc12c('0x50')]({'raw':!![]});}})[_0xc12c('0x1b')](function(_0x59348b){var _0x528e72=fs[_0xc12c('0x5a')](path[_0xc12c('0x5b')](config['root'],_0xc12c('0x5c')),'utf8');var _0x5490d1=ejs[_0xc12c('0x65')](_0x528e72,{'contexts':_0x59348b||[]});fs['writeFileSync'](_0xc12c('0x5f'),_0x5490d1);})[_0xc12c('0x1b')](function(){return respondWithRpcPromise(_0xc12c('0x66'),_0xc12c('0x32'),{'module':_0xc12c('0x67')});})['then'](function(){return _0x29b4c4;})['then'](respondWithResult(_0x22e580,null))[_0xc12c('0x57')](handleError(_0x22e580,null));};exports['destroy']=function(_0x5aa878,_0x371e38,_0xb562ee){var _0x28366e;return db[_0xc12c('0x3c')][_0xc12c('0x56')]({'where':{'id':_0x5aa878['params']['id']}})[_0xc12c('0x1b')](handleEntityNotFound(_0x371e38,null))['then'](removeEntity(_0x371e38,null))[_0xc12c('0x1b')](function(){return db[_0xc12c('0x3c')][_0xc12c('0x50')]({'raw':!![]});})['then'](function(_0x31f00a){var _0x598fce=fs[_0xc12c('0x5a')](path[_0xc12c('0x5b')](config[_0xc12c('0x68')],_0xc12c('0x5c')),'utf8');var _0x5d561c=ejs['render'](_0x598fce,{'contexts':_0x31f00a});fs['writeFileSync'](_0xc12c('0x5f'),_0x5d561c);return respondWithRpcPromise(_0xc12c('0x66'),'destroy',{'module':_0xc12c('0x67')});})['catch'](handleError(_0x371e38,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 723666c..80156c8 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 _0x48e4=['bluebird','request-promise','rimraf','../../config/environment','exports','define','VoiceContext','voice_contexts','lodash','util','../../config/logger','api','moment'];(function(_0x503264,_0x23c97d){var _0x24465e=function(_0x3a7e10){while(--_0x3a7e10){_0x503264['push'](_0x503264['shift']());}};_0x24465e(++_0x23c97d);}(_0x48e4,0x126));var _0x448e=function(_0x2f41fa,_0x5ac0bd){_0x2f41fa=_0x2f41fa-0x0;var _0x425ecb=_0x48e4[_0x2f41fa];return _0x425ecb;};'use strict';var _=require(_0x448e('0x0'));var util=require(_0x448e('0x1'));var logger=require(_0x448e('0x2'))(_0x448e('0x3'));var moment=require(_0x448e('0x4'));var BPromise=require(_0x448e('0x5'));var rp=require(_0x448e('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x448e('0x7'));var config=require(_0x448e('0x8'));var attributes=require('./voiceContext.attributes');module[_0x448e('0x9')]=function(_0x20a235,_0xbd24d4){return _0x20a235[_0x448e('0xa')](_0x448e('0xb'),attributes,{'tableName':_0x448e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa840=['bluebird','path','rimraf','../../config/environment','define','VoiceContext','voice_contexts','util'];(function(_0x7d8211,_0xa0cf7d){var _0x1fcde6=function(_0x4ed435){while(--_0x4ed435){_0x7d8211['push'](_0x7d8211['shift']());}};_0x1fcde6(++_0xa0cf7d);}(_0xa840,0x17f));var _0x0a84=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa840[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x0a84('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0a84('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a84('0x2'));var rimraf=require(_0x0a84('0x3'));var config=require(_0x0a84('0x4'));var attributes=require('./voiceContext.attributes');module['exports']=function(_0x63187b,_0x2b386b){return _0x63187b[_0x0a84('0x5')](_0x0a84('0x6'),attributes,{'tableName':_0x0a84('0x7'),'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 beff57a..bb82a43 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 _0x5a1c=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','catch','lodash','util','randomstring','../../mysqldb'];(function(_0x247fa1,_0x4ec37c){var _0x244f35=function(_0xfb98be){while(--_0xfb98be){_0x247fa1['push'](_0x247fa1['shift']());}};_0x244f35(++_0x4ec37c);}(_0x5a1c,0x1b5));var _0xc5a1=function(_0x16cfae,_0x3c3596){_0x16cfae=_0x16cfae-0x0;var _0x5a04cf=_0x5a1c[_0x16cfae];return _0x5a04cf;};'use strict';var _=require(_0xc5a1('0x0'));var util=require(_0xc5a1('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xc5a1('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc5a1('0x3'))['db'];var utils=require(_0xc5a1('0x4'));var logger=require(_0xc5a1('0x5'))(_0xc5a1('0x6'));var config=require('../../config/environment');var jayson=require(_0xc5a1('0x7'));var client=jayson[_0xc5a1('0x8')][_0xc5a1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5782b9,_0x46fd25,_0x159ed5){return new BPromise(function(_0x1ce1df,_0x111921){return client[_0xc5a1('0xa')](_0x5782b9,_0x159ed5)[_0xc5a1('0xb')](function(_0x28234b){logger[_0xc5a1('0xc')](_0xc5a1('0xd'),_0x46fd25,_0xc5a1('0xe'));logger[_0xc5a1('0xf')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x46fd25,_0xc5a1('0xe'),JSON[_0xc5a1('0x10')](_0x28234b));if(_0x28234b['error']){if(_0x28234b['error'][_0xc5a1('0x11')]===0x1f4){logger['error'](_0xc5a1('0xd'),_0x46fd25,_0x28234b[_0xc5a1('0x12')][_0xc5a1('0x13')]);return _0x111921(_0x28234b[_0xc5a1('0x12')]['message']);}logger[_0xc5a1('0x12')]('VoiceContext,\x20%s,\x20%s',_0x46fd25,_0x28234b[_0xc5a1('0x12')]['message']);return _0x1ce1df(_0x28234b[_0xc5a1('0x12')][_0xc5a1('0x13')]);}else{logger[_0xc5a1('0xc')](_0xc5a1('0xd'),_0x46fd25,_0xc5a1('0xe'));_0x1ce1df(_0x28234b['result'][_0xc5a1('0x13')]);}})[_0xc5a1('0x14')](function(_0x1a8e41){logger[_0xc5a1('0x12')](_0xc5a1('0xd'),_0x46fd25,_0x1a8e41);_0x111921(_0x1a8e41);});});} \ No newline at end of file +var _0x8164=['debug','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','rpc','client','request','then','info','VoiceContext,\x20%s,\x20%s'];(function(_0x3852f3,_0x454a50){var _0x213c77=function(_0xcea39c){while(--_0xcea39c){_0x3852f3['push'](_0x3852f3['shift']());}};_0x213c77(++_0x454a50);}(_0x8164,0x170));var _0x4816=function(_0x2f1ab5,_0x2966be){_0x2f1ab5=_0x2f1ab5-0x0;var _0x5c7e72=_0x8164[_0x2f1ab5];return _0x5c7e72;};'use strict';var _=require(_0x4816('0x0'));var util=require(_0x4816('0x1'));var moment=require(_0x4816('0x2'));var BPromise=require('bluebird');var rs=require(_0x4816('0x3'));var fs=require('fs');var Redis=require(_0x4816('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4816('0x5'));var logger=require('../../config/logger')(_0x4816('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4816('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x51ab08,_0x2ddb3b,_0x437b8b){return new BPromise(function(_0x170e7a,_0x383974){return client[_0x4816('0x8')](_0x51ab08,_0x437b8b)[_0x4816('0x9')](function(_0x285cab){logger[_0x4816('0xa')](_0x4816('0xb'),_0x2ddb3b,'request\x20sent');logger[_0x4816('0xc')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x2ddb3b,_0x4816('0xd'),JSON[_0x4816('0xe')](_0x285cab));if(_0x285cab['error']){if(_0x285cab[_0x4816('0xf')]['code']===0x1f4){logger['error'](_0x4816('0xb'),_0x2ddb3b,_0x285cab['error']['message']);return _0x383974(_0x285cab[_0x4816('0xf')]['message']);}logger[_0x4816('0xf')](_0x4816('0xb'),_0x2ddb3b,_0x285cab[_0x4816('0xf')][_0x4816('0x10')]);return _0x170e7a(_0x285cab[_0x4816('0xf')][_0x4816('0x10')]);}else{logger[_0x4816('0xa')](_0x4816('0xb'),_0x2ddb3b,_0x4816('0xd'));_0x170e7a(_0x285cab[_0x4816('0x11')][_0x4816('0x10')]);}})[_0x4816('0x12')](function(_0x6119f){logger[_0x4816('0xf')](_0x4816('0xb'),_0x2ddb3b,_0x6119f);_0x383974(_0x6119f);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index 4f19663..43f439a 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 _0xb9ca=['isAuthenticated','index','/describe','/:id','show','post','create','put','update','delete','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get'];(function(_0x13439e,_0x39fb41){var _0x2a04cd=function(_0x156fd5){while(--_0x156fd5){_0x13439e['push'](_0x13439e['shift']());}};_0x2a04cd(++_0x39fb41);}(_0xb9ca,0xfb));var _0xab9c=function(_0x114e6a,_0x3dc9d2){_0x114e6a=_0x114e6a-0x0;var _0x423189=_0xb9ca[_0x114e6a];return _0x423189;};'use strict';var multer=require(_0xab9c('0x0'));var util=require(_0xab9c('0x1'));var path=require('path');var timeout=require(_0xab9c('0x2'));var express=require('express');var router=express[_0xab9c('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xab9c('0x4'));var interaction=require(_0xab9c('0x5'));var config=require(_0xab9c('0x6'));var controller=require(_0xab9c('0x7'));router[_0xab9c('0x8')]('/',auth[_0xab9c('0x9')](),controller[_0xab9c('0xa')]);router['get'](_0xab9c('0xb'),auth[_0xab9c('0x9')](),controller['describe']);router[_0xab9c('0x8')](_0xab9c('0xc'),auth[_0xab9c('0x9')](),controller[_0xab9c('0xd')]);router[_0xab9c('0xe')]('/',auth[_0xab9c('0x9')](),controller[_0xab9c('0xf')]);router[_0xab9c('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xab9c('0x11')]);router[_0xab9c('0x12')]('/:id',auth[_0xab9c('0x9')](),controller['destroy']);module[_0xab9c('0x13')]=router; \ No newline at end of file +var _0x4c63=['put','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create'];(function(_0x53bbe7,_0x3fce94){var _0x11ff14=function(_0x18ed89){while(--_0x18ed89){_0x53bbe7['push'](_0x53bbe7['shift']());}};_0x11ff14(++_0x3fce94);}(_0x4c63,0xf2));var _0x34c6=function(_0x57f764,_0x572608){_0x57f764=_0x57f764-0x0;var _0x36a227=_0x4c63[_0x57f764];return _0x36a227;};'use strict';var multer=require(_0x34c6('0x0'));var util=require('util');var path=require(_0x34c6('0x1'));var timeout=require(_0x34c6('0x2'));var express=require(_0x34c6('0x3'));var router=express[_0x34c6('0x4')]();var fs_extra=require(_0x34c6('0x5'));var auth=require(_0x34c6('0x6'));var interaction=require(_0x34c6('0x7'));var config=require(_0x34c6('0x8'));var controller=require(_0x34c6('0x9'));router[_0x34c6('0xa')]('/',auth[_0x34c6('0xb')](),controller[_0x34c6('0xc')]);router[_0x34c6('0xa')](_0x34c6('0xd'),auth['isAuthenticated'](),controller[_0x34c6('0xe')]);router['get'](_0x34c6('0xf'),auth['isAuthenticated'](),controller[_0x34c6('0x10')]);router['post']('/',auth[_0x34c6('0xb')](),controller[_0x34c6('0x11')]);router[_0x34c6('0x12')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0x34c6('0xf'),auth[_0x34c6('0xb')](),controller['destroy']);module[_0x34c6('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index 7aecbcd..02a6de0 100644 --- a/server/api/voiceDialReport/voiceDialReport.attributes.js +++ b/server/api/voiceDialReport/voiceDialReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8d0e=['INTEGER','DATE','called,connect,complete','sequelize','exports','STRING'];(function(_0x5d81cc,_0xedaa67){var _0x3e3574=function(_0x7eeb81){while(--_0x7eeb81){_0x5d81cc['push'](_0x5d81cc['shift']());}};_0x3e3574(++_0xedaa67);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x3c9d53,_0x517d19){_0x3c9d53=_0x3c9d53-0x0;var _0x17e174=_0x8d0e[_0x3c9d53];return _0x17e174;};'use strict';var Sequelize=require(_0xe8d0('0x0'));module[_0xe8d0('0x1')]={'privilege':{'type':Sequelize[_0xe8d0('0x2')]},'channel':{'type':Sequelize[_0xe8d0('0x2')]},'channelstate':{'type':Sequelize[_0xe8d0('0x3')]},'channelstatedesc':{'type':Sequelize[_0xe8d0('0x2')]},'calleridnum':{'type':Sequelize[_0xe8d0('0x2')]},'calleridname':{'type':Sequelize[_0xe8d0('0x2')]},'connectedlinenum':{'type':Sequelize[_0xe8d0('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xe8d0('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xe8d0('0x2')]},'priority':{'type':Sequelize[_0xe8d0('0x3')]},'uniqueid':{'type':Sequelize[_0xe8d0('0x2')]},'linkedid':{'type':Sequelize[_0xe8d0('0x2')]},'destchannel':{'type':Sequelize[_0xe8d0('0x2')]},'destchannelstate':{'type':Sequelize[_0xe8d0('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0xe8d0('0x2')]},'destcalleridnum':{'type':Sequelize[_0xe8d0('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0xe8d0('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xe8d0('0x2')]},'destlanguage':{'type':Sequelize[_0xe8d0('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0xe8d0('0x2')]},'destpriority':{'type':Sequelize[_0xe8d0('0x3')]},'destuniqueid':{'type':Sequelize[_0xe8d0('0x2')]},'destlinkedid':{'type':Sequelize[_0xe8d0('0x2')]},'dialstring':{'type':Sequelize[_0xe8d0('0x2')]},'dialstatus':{'type':Sequelize[_0xe8d0('0x2')]},'starttime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xe8d0('0x4')]},'endtime':{'type':Sequelize[_0xe8d0('0x4')]},'lastevent':{'type':Sequelize['STRING'],'comment':_0xe8d0('0x5')},'routeId':{'type':Sequelize['INTEGER']},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize[_0xe8d0('0x3')]},'billableseconds':{'type':Sequelize[_0xe8d0('0x3')]}}; \ No newline at end of file +var _0x9bde=['exports','STRING','INTEGER','DATE','called,connect,complete'];(function(_0x69d4dc,_0x541beb){var _0xd89223=function(_0x4b1d6b){while(--_0x4b1d6b){_0x69d4dc['push'](_0x69d4dc['shift']());}};_0xd89223(++_0x541beb);}(_0x9bde,0xe1));var _0xe9bd=function(_0x17f4e4,_0x5b3b6f){_0x17f4e4=_0x17f4e4-0x0;var _0x368524=_0x9bde[_0x17f4e4];return _0x368524;};'use strict';var Sequelize=require('sequelize');module[_0xe9bd('0x0')]={'privilege':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xe9bd('0x1')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0xe9bd('0x1')]},'calleridnum':{'type':Sequelize[_0xe9bd('0x1')]},'calleridname':{'type':Sequelize[_0xe9bd('0x1')]},'connectedlinenum':{'type':Sequelize[_0xe9bd('0x1')]},'connectedlinename':{'type':Sequelize[_0xe9bd('0x1')]},'language':{'type':Sequelize[_0xe9bd('0x1')]},'accountcode':{'type':Sequelize[_0xe9bd('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xe9bd('0x1')]},'priority':{'type':Sequelize[_0xe9bd('0x2')]},'uniqueid':{'type':Sequelize[_0xe9bd('0x1')]},'linkedid':{'type':Sequelize[_0xe9bd('0x1')]},'destchannel':{'type':Sequelize[_0xe9bd('0x1')]},'destchannelstate':{'type':Sequelize[_0xe9bd('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0xe9bd('0x1')]},'destcalleridnum':{'type':Sequelize[_0xe9bd('0x1')]},'destcalleridname':{'type':Sequelize[_0xe9bd('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0xe9bd('0x1')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0xe9bd('0x1')]},'destcontext':{'type':Sequelize[_0xe9bd('0x1')]},'destexten':{'type':Sequelize[_0xe9bd('0x1')]},'destpriority':{'type':Sequelize['INTEGER']},'destuniqueid':{'type':Sequelize[_0xe9bd('0x1')]},'destlinkedid':{'type':Sequelize[_0xe9bd('0x1')]},'dialstring':{'type':Sequelize[_0xe9bd('0x1')]},'dialstatus':{'type':Sequelize[_0xe9bd('0x1')]},'starttime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xe9bd('0x3')]},'endtime':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0xe9bd('0x1')],'comment':_0xe9bd('0x4')},'routeId':{'type':Sequelize[_0xe9bd('0x2')]},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0xe9bd('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index 65cc514..8b54434 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 _0x8eb4=['model','map','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','catch','show','params','rawAttributes','include','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','VoiceDialReport','type','key'];(function(_0x44e62d,_0x5a127a){var _0xbe9a06=function(_0xcf8263){while(--_0xcf8263){_0x44e62d['push'](_0x44e62d['shift']());}};_0xbe9a06(++_0x5a127a);}(_0x8eb4,0xf7));var _0x48eb=function(_0x4ed32d,_0x327695){_0x4ed32d=_0x4ed32d-0x0;var _0xf624df=_0x8eb4[_0x4ed32d];return _0xf624df;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x48eb('0x0'));var zipdir=require(_0x48eb('0x1'));var jsonpatch=require(_0x48eb('0x2'));var rp=require(_0x48eb('0x3'));var moment=require(_0x48eb('0x4'));var BPromise=require(_0x48eb('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x48eb('0x6'));var sox=require('sox');var csv=require(_0x48eb('0x7'));var ejs=require(_0x48eb('0x8'));var fs=require('fs');var fs_extra=require(_0x48eb('0x9'));var _=require(_0x48eb('0xa'));var squel=require(_0x48eb('0xb'));var crypto=require(_0x48eb('0xc'));var jsforce=require(_0x48eb('0xd'));var deskjs=require(_0x48eb('0xe'));var toCsv=require(_0x48eb('0x7'));var querystring=require(_0x48eb('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x48eb('0x10'));var as=require(_0x48eb('0x11'));var hardwareService=require(_0x48eb('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x48eb('0x13'));var licenseUtil=require(_0x48eb('0x14'));var db=require(_0x48eb('0x15'))['db'];function respondWithStatusCode(_0x39e644,_0x1b1a1d){_0x1b1a1d=_0x1b1a1d||0xcc;return function(_0x4f2649){if(_0x4f2649){return _0x39e644['sendStatus'](_0x1b1a1d);}return _0x39e644[_0x48eb('0x16')](_0x1b1a1d)[_0x48eb('0x17')]();};}function respondWithResult(_0x46fa0f,_0x52ecf0){_0x52ecf0=_0x52ecf0||0xc8;return function(_0x54e7de){if(_0x54e7de){return _0x46fa0f['status'](_0x52ecf0)[_0x48eb('0x18')](_0x54e7de);}};}function respondWithFilteredResult(_0x231261,_0xe63a5){return function(_0x1b7bfe){if(_0x1b7bfe){var _0x319090=typeof _0xe63a5[_0x48eb('0x19')]===_0x48eb('0x1a')&&typeof _0xe63a5[_0x48eb('0x1b')]===_0x48eb('0x1a');var _0x3d5e62=_0x1b7bfe[_0x48eb('0x1c')];var _0x143916=_0x319090?0x0:_0xe63a5['offset'];var _0x3b9b70=_0x319090?_0x1b7bfe[_0x48eb('0x1c')]:_0xe63a5[_0x48eb('0x19')]+_0xe63a5['limit'];var _0x3d27e9;if(_0x3b9b70>=_0x3d5e62){_0x3b9b70=_0x3d5e62;_0x3d27e9=0xc8;}else{_0x3d27e9=0xce;}_0x231261[_0x48eb('0x16')](_0x3d27e9);return _0x231261['set'](_0x48eb('0x1d'),_0x143916+'-'+_0x3b9b70+'/'+_0x3d5e62)[_0x48eb('0x18')](_0x1b7bfe);}return null;};}function patchUpdates(_0x302971){return function(_0x15b647){try{jsonpatch[_0x48eb('0x1e')](_0x15b647,_0x302971,!![]);}catch(_0x352138){return BPromise[_0x48eb('0x1f')](_0x352138);}return _0x15b647[_0x48eb('0x20')]();};}function saveUpdates(_0x12df5a,_0xdec654){return function(_0x50983f){if(_0x50983f){return _0x50983f[_0x48eb('0x21')](_0x12df5a)[_0x48eb('0x22')](function(_0x2c0480){return _0x2c0480;});}return null;};}function removeEntity(_0x397158,_0x257cf5){return function(_0x38e0e1){if(_0x38e0e1){return _0x38e0e1[_0x48eb('0x23')]()[_0x48eb('0x22')](function(){_0x397158['status'](0xcc)[_0x48eb('0x17')]();});}};}function handleEntityNotFound(_0x43f064,_0x3f9ede){return function(_0x4047c9){if(!_0x4047c9){_0x43f064[_0x48eb('0x24')](0x194);}return _0x4047c9;};}function handleError(_0x72a495,_0x2bec98){_0x2bec98=_0x2bec98||0x1f4;return function(_0x5647f1){logger[_0x48eb('0x25')](_0x5647f1[_0x48eb('0x26')]);if(_0x5647f1[_0x48eb('0x27')]){delete _0x5647f1[_0x48eb('0x27')];}_0x72a495[_0x48eb('0x16')](_0x2bec98)[_0x48eb('0x28')](_0x5647f1);};}exports[_0x48eb('0x29')]=function(_0x147905,_0x54d279){var _0x1078a8={},_0x50d5b8={},_0x2baa12={'count':0x0,'rows':[]};var _0x79d25b=_['map'](db[_0x48eb('0x2a')]['rawAttributes'],function(_0x311109){return{'name':_0x311109['fieldName'],'type':_0x311109[_0x48eb('0x2b')][_0x48eb('0x2c')]};});_0x50d5b8[_0x48eb('0x2d')]=_[_0x48eb('0x2e')](_0x79d25b,_0x48eb('0x27'));_0x50d5b8['query']=_['keys'](_0x147905['query']);_0x50d5b8[_0x48eb('0x2f')]=_[_0x48eb('0x30')](_0x50d5b8['model'],_0x50d5b8[_0x48eb('0x31')]);_0x1078a8[_0x48eb('0x32')]=_[_0x48eb('0x30')](_0x50d5b8[_0x48eb('0x2d')],qs[_0x48eb('0x33')](_0x147905[_0x48eb('0x31')][_0x48eb('0x33')]));_0x1078a8[_0x48eb('0x32')]=_0x1078a8['attributes'][_0x48eb('0x34')]?_0x1078a8[_0x48eb('0x32')]:_0x50d5b8['model'];if(!_0x147905[_0x48eb('0x31')][_0x48eb('0x35')](_0x48eb('0x36'))){_0x1078a8[_0x48eb('0x1b')]=qs[_0x48eb('0x1b')](_0x147905[_0x48eb('0x31')][_0x48eb('0x1b')]);_0x1078a8[_0x48eb('0x19')]=qs[_0x48eb('0x19')](_0x147905[_0x48eb('0x31')][_0x48eb('0x19')]);}_0x1078a8['order']=qs['sort'](_0x147905[_0x48eb('0x31')][_0x48eb('0x37')]);_0x1078a8['where']=qs[_0x48eb('0x2f')](_[_0x48eb('0x38')](_0x147905[_0x48eb('0x31')],_0x50d5b8['filters']),_0x79d25b);if(_0x147905[_0x48eb('0x31')][_0x48eb('0x39')]){_0x1078a8[_0x48eb('0x3a')]=_[_0x48eb('0x3b')](_0x1078a8['where'],{'$or':_[_0x48eb('0x2e')](_0x79d25b,function(_0x47224f){if(_0x47224f[_0x48eb('0x2b')]!==_0x48eb('0x3c')){var _0x10a5a1={};_0x10a5a1[_0x47224f[_0x48eb('0x27')]]={'$like':'%'+_0x147905[_0x48eb('0x31')]['filter']+'%'};return _0x10a5a1;}})});}_0x1078a8=_[_0x48eb('0x3b')]({},_0x1078a8,_0x147905[_0x48eb('0x3d')]);var _0x11c1e0={'where':_0x1078a8[_0x48eb('0x3a')]};return db['VoiceDialReport'][_0x48eb('0x1c')](_0x11c1e0)[_0x48eb('0x22')](function(_0x4f19c1){_0x2baa12[_0x48eb('0x1c')]=_0x4f19c1;if(_0x147905[_0x48eb('0x31')][_0x48eb('0x3e')]){_0x1078a8['include']=[{'all':!![]}];}return db[_0x48eb('0x2a')][_0x48eb('0x3f')](_0x1078a8);})[_0x48eb('0x22')](function(_0x3b6ec1){_0x2baa12['rows']=_0x3b6ec1;return _0x2baa12;})[_0x48eb('0x22')](respondWithFilteredResult(_0x54d279,_0x1078a8))[_0x48eb('0x40')](handleError(_0x54d279,null));};exports[_0x48eb('0x41')]=function(_0x2c7962,_0x24b550){var _0x807f27={'raw':!![],'where':{'id':_0x2c7962[_0x48eb('0x42')]['id']}},_0x3e7104={};_0x3e7104['model']=_['keys'](db[_0x48eb('0x2a')][_0x48eb('0x43')]);_0x3e7104[_0x48eb('0x31')]=_['keys'](_0x2c7962[_0x48eb('0x31')]);_0x3e7104[_0x48eb('0x2f')]=_['intersection'](_0x3e7104[_0x48eb('0x2d')],_0x3e7104[_0x48eb('0x31')]);_0x807f27[_0x48eb('0x32')]=_[_0x48eb('0x30')](_0x3e7104['model'],qs['fields'](_0x2c7962['query']['fields']));_0x807f27[_0x48eb('0x32')]=_0x807f27[_0x48eb('0x32')]['length']?_0x807f27[_0x48eb('0x32')]:_0x3e7104[_0x48eb('0x2d')];if(_0x2c7962[_0x48eb('0x31')][_0x48eb('0x3e')]){_0x807f27[_0x48eb('0x44')]=[{'all':!![]}];}_0x807f27=_[_0x48eb('0x3b')]({},_0x807f27,_0x2c7962['options']);return db['VoiceDialReport'][_0x48eb('0x45')](_0x807f27)[_0x48eb('0x22')](handleEntityNotFound(_0x24b550,null))['then'](respondWithResult(_0x24b550,null))[_0x48eb('0x40')](handleError(_0x24b550,null));};exports[_0x48eb('0x46')]=function(_0x2cf8aa,_0xc2e2c8){return db[_0x48eb('0x2a')][_0x48eb('0x46')](_0x2cf8aa['body'],{})[_0x48eb('0x22')](respondWithResult(_0xc2e2c8,0xc9))[_0x48eb('0x40')](handleError(_0xc2e2c8,null));};exports[_0x48eb('0x21')]=function(_0x3df0d5,_0x35ff91){if(_0x3df0d5['body']['id']){delete _0x3df0d5[_0x48eb('0x47')]['id'];}return db[_0x48eb('0x2a')][_0x48eb('0x45')]({'where':{'id':_0x3df0d5[_0x48eb('0x42')]['id']}})[_0x48eb('0x22')](handleEntityNotFound(_0x35ff91,null))[_0x48eb('0x22')](saveUpdates(_0x3df0d5[_0x48eb('0x47')],null))[_0x48eb('0x22')](respondWithResult(_0x35ff91,null))[_0x48eb('0x40')](handleError(_0x35ff91,null));};exports[_0x48eb('0x23')]=function(_0x5625d8,_0x3a3bae){return db[_0x48eb('0x2a')][_0x48eb('0x45')]({'where':{'id':_0x5625d8[_0x48eb('0x42')]['id']}})[_0x48eb('0x22')](handleEntityNotFound(_0x3a3bae,null))[_0x48eb('0x22')](removeEntity(_0x3a3bae,null))[_0x48eb('0x40')](handleError(_0x3a3bae,null));};exports[_0x48eb('0x48')]=function(_0x5de903,_0x4e44d8){return db[_0x48eb('0x2a')][_0x48eb('0x48')]()[_0x48eb('0x22')](respondWithResult(_0x4e44d8,null))[_0x48eb('0x40')](handleError(_0x4e44d8,null));}; \ No newline at end of file +var _0x38e5=['limit','count','set','Content-Range','apply','update','destroy','sendStatus','error','stack','name','send','index','map','VoiceDialReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','sort','filter','merge','VIRTUAL','options','where','then','include','findAll','rows','catch','show','params','includeAll','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','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','../../mysqldb','status','end','json','offset','undefined'];(function(_0xe9f40f,_0x336b47){var _0xeaff12=function(_0x2c6527){while(--_0x2c6527){_0xe9f40f['push'](_0xe9f40f['shift']());}};_0xeaff12(++_0x336b47);}(_0x38e5,0x110));var _0x538e=function(_0x252960,_0xccc97){_0x252960=_0x252960-0x0;var _0x20cdad=_0x38e5[_0x252960];return _0x20cdad;};'use strict';var emlformat=require(_0x538e('0x0'));var rimraf=require(_0x538e('0x1'));var zipdir=require(_0x538e('0x2'));var jsonpatch=require(_0x538e('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x538e('0x4'));var Mustache=require(_0x538e('0x5'));var util=require(_0x538e('0x6'));var path=require(_0x538e('0x7'));var sox=require(_0x538e('0x8'));var csv=require(_0x538e('0x9'));var ejs=require(_0x538e('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x538e('0xb'));var squel=require('squel');var crypto=require(_0x538e('0xc'));var jsforce=require(_0x538e('0xd'));var deskjs=require(_0x538e('0xe'));var toCsv=require(_0x538e('0x9'));var querystring=require(_0x538e('0xf'));var Papa=require(_0x538e('0x10'));var Redis=require(_0x538e('0x11'));var authService=require(_0x538e('0x12'));var qs=require(_0x538e('0x13'));var as=require(_0x538e('0x14'));var hardwareService=require(_0x538e('0x15'));var logger=require(_0x538e('0x16'))(_0x538e('0x17'));var utils=require(_0x538e('0x18'));var config=require(_0x538e('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x538e('0x1a'))['db'];function respondWithStatusCode(_0x56a0b2,_0x2fb56c){_0x2fb56c=_0x2fb56c||0xcc;return function(_0x41ee42){if(_0x41ee42){return _0x56a0b2['sendStatus'](_0x2fb56c);}return _0x56a0b2[_0x538e('0x1b')](_0x2fb56c)[_0x538e('0x1c')]();};}function respondWithResult(_0x33a44c,_0x56097c){_0x56097c=_0x56097c||0xc8;return function(_0xa41a0d){if(_0xa41a0d){return _0x33a44c[_0x538e('0x1b')](_0x56097c)[_0x538e('0x1d')](_0xa41a0d);}};}function respondWithFilteredResult(_0x1c204d,_0x1cd45b){return function(_0x5865da){if(_0x5865da){var _0x437073=typeof _0x1cd45b[_0x538e('0x1e')]===_0x538e('0x1f')&&typeof _0x1cd45b[_0x538e('0x20')]==='undefined';var _0x2bd6e6=_0x5865da[_0x538e('0x21')];var _0x38d66d=_0x437073?0x0:_0x1cd45b[_0x538e('0x1e')];var _0xb99b2c=_0x437073?_0x5865da[_0x538e('0x21')]:_0x1cd45b[_0x538e('0x1e')]+_0x1cd45b[_0x538e('0x20')];var _0x5299c8;if(_0xb99b2c>=_0x2bd6e6){_0xb99b2c=_0x2bd6e6;_0x5299c8=0xc8;}else{_0x5299c8=0xce;}_0x1c204d['status'](_0x5299c8);return _0x1c204d[_0x538e('0x22')](_0x538e('0x23'),_0x38d66d+'-'+_0xb99b2c+'/'+_0x2bd6e6)[_0x538e('0x1d')](_0x5865da);}return null;};}function patchUpdates(_0x1c42fc){return function(_0x22ba27){try{jsonpatch[_0x538e('0x24')](_0x22ba27,_0x1c42fc,!![]);}catch(_0x550992){return BPromise['reject'](_0x550992);}return _0x22ba27['save']();};}function saveUpdates(_0xaf928a,_0x5692b2){return function(_0x43741e){if(_0x43741e){return _0x43741e[_0x538e('0x25')](_0xaf928a)['then'](function(_0x48fe29){return _0x48fe29;});}return null;};}function removeEntity(_0x3f76dc,_0x5cbe3a){return function(_0x32e23d){if(_0x32e23d){return _0x32e23d[_0x538e('0x26')]()['then'](function(){_0x3f76dc[_0x538e('0x1b')](0xcc)[_0x538e('0x1c')]();});}};}function handleEntityNotFound(_0x1620a7,_0xa39868){return function(_0x37a52c){if(!_0x37a52c){_0x1620a7[_0x538e('0x27')](0x194);}return _0x37a52c;};}function handleError(_0x2304a1,_0xb3ee9d){_0xb3ee9d=_0xb3ee9d||0x1f4;return function(_0x35db17){logger[_0x538e('0x28')](_0x35db17[_0x538e('0x29')]);if(_0x35db17[_0x538e('0x2a')]){delete _0x35db17[_0x538e('0x2a')];}_0x2304a1[_0x538e('0x1b')](_0xb3ee9d)[_0x538e('0x2b')](_0x35db17);};}exports[_0x538e('0x2c')]=function(_0x39df22,_0xd769f1){var _0x79d949={},_0x37a443={},_0x3682d1={'count':0x0,'rows':[]};var _0x6fce32=_[_0x538e('0x2d')](db[_0x538e('0x2e')][_0x538e('0x2f')],function(_0x1763f4){return{'name':_0x1763f4[_0x538e('0x30')],'type':_0x1763f4[_0x538e('0x31')]['key']};});_0x37a443[_0x538e('0x32')]=_['map'](_0x6fce32,'name');_0x37a443[_0x538e('0x33')]=_[_0x538e('0x34')](_0x39df22[_0x538e('0x33')]);_0x37a443[_0x538e('0x35')]=_[_0x538e('0x36')](_0x37a443['model'],_0x37a443[_0x538e('0x33')]);_0x79d949[_0x538e('0x37')]=_[_0x538e('0x36')](_0x37a443[_0x538e('0x32')],qs[_0x538e('0x38')](_0x39df22['query']['fields']));_0x79d949[_0x538e('0x37')]=_0x79d949[_0x538e('0x37')][_0x538e('0x39')]?_0x79d949['attributes']:_0x37a443[_0x538e('0x32')];if(!_0x39df22[_0x538e('0x33')]['hasOwnProperty']('nolimit')){_0x79d949[_0x538e('0x20')]=qs[_0x538e('0x20')](_0x39df22[_0x538e('0x33')]['limit']);_0x79d949[_0x538e('0x1e')]=qs[_0x538e('0x1e')](_0x39df22[_0x538e('0x33')][_0x538e('0x1e')]);}_0x79d949['order']=qs[_0x538e('0x3a')](_0x39df22['query'][_0x538e('0x3a')]);_0x79d949['where']=qs[_0x538e('0x35')](_['pick'](_0x39df22[_0x538e('0x33')],_0x37a443[_0x538e('0x35')]),_0x6fce32);if(_0x39df22[_0x538e('0x33')][_0x538e('0x3b')]){_0x79d949['where']=_[_0x538e('0x3c')](_0x79d949['where'],{'$or':_[_0x538e('0x2d')](_0x6fce32,function(_0x234225){if(_0x234225[_0x538e('0x31')]!==_0x538e('0x3d')){var _0x31a0f6={};_0x31a0f6[_0x234225[_0x538e('0x2a')]]={'$like':'%'+_0x39df22['query'][_0x538e('0x3b')]+'%'};return _0x31a0f6;}})});}_0x79d949=_[_0x538e('0x3c')]({},_0x79d949,_0x39df22[_0x538e('0x3e')]);var _0x1367e3={'where':_0x79d949[_0x538e('0x3f')]};return db['VoiceDialReport'][_0x538e('0x21')](_0x1367e3)[_0x538e('0x40')](function(_0x14fd71){_0x3682d1['count']=_0x14fd71;if(_0x39df22[_0x538e('0x33')]['includeAll']){_0x79d949[_0x538e('0x41')]=[{'all':!![]}];}return db[_0x538e('0x2e')][_0x538e('0x42')](_0x79d949);})['then'](function(_0x4eaf36){_0x3682d1[_0x538e('0x43')]=_0x4eaf36;return _0x3682d1;})[_0x538e('0x40')](respondWithFilteredResult(_0xd769f1,_0x79d949))[_0x538e('0x44')](handleError(_0xd769f1,null));};exports[_0x538e('0x45')]=function(_0x3c2e0a,_0x2f2c6e){var _0x6ed80c={'raw':!![],'where':{'id':_0x3c2e0a[_0x538e('0x46')]['id']}},_0x580d98={};_0x580d98['model']=_[_0x538e('0x34')](db[_0x538e('0x2e')][_0x538e('0x2f')]);_0x580d98['query']=_[_0x538e('0x34')](_0x3c2e0a[_0x538e('0x33')]);_0x580d98[_0x538e('0x35')]=_['intersection'](_0x580d98[_0x538e('0x32')],_0x580d98[_0x538e('0x33')]);_0x6ed80c['attributes']=_[_0x538e('0x36')](_0x580d98[_0x538e('0x32')],qs[_0x538e('0x38')](_0x3c2e0a[_0x538e('0x33')]['fields']));_0x6ed80c[_0x538e('0x37')]=_0x6ed80c[_0x538e('0x37')][_0x538e('0x39')]?_0x6ed80c[_0x538e('0x37')]:_0x580d98['model'];if(_0x3c2e0a[_0x538e('0x33')][_0x538e('0x47')]){_0x6ed80c['include']=[{'all':!![]}];}_0x6ed80c=_[_0x538e('0x3c')]({},_0x6ed80c,_0x3c2e0a[_0x538e('0x3e')]);return db[_0x538e('0x2e')][_0x538e('0x48')](_0x6ed80c)['then'](handleEntityNotFound(_0x2f2c6e,null))[_0x538e('0x40')](respondWithResult(_0x2f2c6e,null))[_0x538e('0x44')](handleError(_0x2f2c6e,null));};exports[_0x538e('0x49')]=function(_0x518734,_0x45ef0d){return db['VoiceDialReport'][_0x538e('0x49')](_0x518734['body'],{})[_0x538e('0x40')](respondWithResult(_0x45ef0d,0xc9))[_0x538e('0x44')](handleError(_0x45ef0d,null));};exports[_0x538e('0x25')]=function(_0x4e2192,_0x291e3f){if(_0x4e2192[_0x538e('0x4a')]['id']){delete _0x4e2192[_0x538e('0x4a')]['id'];}return db[_0x538e('0x2e')]['find']({'where':{'id':_0x4e2192[_0x538e('0x46')]['id']}})['then'](handleEntityNotFound(_0x291e3f,null))[_0x538e('0x40')](saveUpdates(_0x4e2192[_0x538e('0x4a')],null))['then'](respondWithResult(_0x291e3f,null))['catch'](handleError(_0x291e3f,null));};exports[_0x538e('0x26')]=function(_0x1271f5,_0x1cf1f6){return db['VoiceDialReport'][_0x538e('0x48')]({'where':{'id':_0x1271f5[_0x538e('0x46')]['id']}})['then'](handleEntityNotFound(_0x1cf1f6,null))[_0x538e('0x40')](removeEntity(_0x1cf1f6,null))[_0x538e('0x44')](handleError(_0x1cf1f6,null));};exports[_0x538e('0x4b')]=function(_0x1d54b9,_0x25d8f6){return db[_0x538e('0x2e')][_0x538e('0x4b')]()[_0x538e('0x40')](respondWithResult(_0x25d8f6,null))[_0x538e('0x44')](handleError(_0x25d8f6,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index 887f379..5514602 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 _0x8c46=['exports','VoiceDialReport','report_dial','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceDialReport.attributes'];(function(_0x2ca794,_0x3e0030){var _0x27b67b=function(_0x40f96b){while(--_0x40f96b){_0x2ca794['push'](_0x2ca794['shift']());}};_0x27b67b(++_0x3e0030);}(_0x8c46,0x14e));var _0x68c4=function(_0x25f1ea,_0x5cd295){_0x25f1ea=_0x25f1ea-0x0;var _0x217e85=_0x8c46[_0x25f1ea];return _0x217e85;};'use strict';var _=require(_0x68c4('0x0'));var util=require(_0x68c4('0x1'));var logger=require(_0x68c4('0x2'))(_0x68c4('0x3'));var moment=require(_0x68c4('0x4'));var BPromise=require(_0x68c4('0x5'));var rp=require(_0x68c4('0x6'));var fs=require('fs');var path=require(_0x68c4('0x7'));var rimraf=require(_0x68c4('0x8'));var config=require(_0x68c4('0x9'));var attributes=require(_0x68c4('0xa'));module[_0x68c4('0xb')]=function(_0x163f94,_0xf87767){return _0x163f94['define'](_0x68c4('0xc'),attributes,{'tableName':_0x68c4('0xd'),'paranoid':![],'indexes':[{'fields':[_0x68c4('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xad47=['path','rimraf','../../config/environment','./voiceDialReport.attributes','exports','VoiceDialReport','report_dial','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xad47,0xad));var _0x7ad4=function(_0x341e0f,_0x4a09d0){_0x341e0f=_0x341e0f-0x0;var _0x59555a=_0xad47[_0x341e0f];return _0x59555a;};'use strict';var _=require(_0x7ad4('0x0'));var util=require(_0x7ad4('0x1'));var logger=require(_0x7ad4('0x2'))(_0x7ad4('0x3'));var moment=require(_0x7ad4('0x4'));var BPromise=require(_0x7ad4('0x5'));var rp=require(_0x7ad4('0x6'));var fs=require('fs');var path=require(_0x7ad4('0x7'));var rimraf=require(_0x7ad4('0x8'));var config=require(_0x7ad4('0x9'));var attributes=require(_0x7ad4('0xa'));module[_0x7ad4('0xb')]=function(_0x1eb29b,_0x1f969d){return _0x1eb29b['define'](_0x7ad4('0xc'),attributes,{'tableName':_0x7ad4('0xd'),'paranoid':![],'indexes':[{'fields':[_0x7ad4('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 eca1bcb..0256d39 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 _0x39cf=['rpc','../../config/environment','client','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateVoiceDialReport','VoiceDialReport','options','then','update','body','raw','where','UpdateVoiceDialReport','debug','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger'];(function(_0x81f66f,_0x43dd4f){var _0x1be119=function(_0x3864c7){while(--_0x3864c7){_0x81f66f['push'](_0x81f66f['shift']());}};_0x1be119(++_0x43dd4f);}(_0x39cf,0x8b));var _0xf39c=function(_0x36940e,_0x11f338){_0x36940e=_0x36940e-0x0;var _0x3283f2=_0x39cf[_0x36940e];return _0x3283f2;};'use strict';var _=require(_0xf39c('0x0'));var util=require(_0xf39c('0x1'));var moment=require('moment');var BPromise=require(_0xf39c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf39c('0x3'));var db=require(_0xf39c('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf39c('0x5'))(_0xf39c('0x6'));var config=require(_0xf39c('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xf39c('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x521f6d,_0x1fb96b,_0x4f04aa){return new BPromise(function(_0x4c0647,_0x1b6669){return client['request'](_0x521f6d,_0x4f04aa)['then'](function(_0x64273c){logger[_0xf39c('0x9')](_0xf39c('0xa'),_0x1fb96b,_0xf39c('0xb'));logger['debug'](_0xf39c('0xc'),_0x1fb96b,_0xf39c('0xb'),JSON[_0xf39c('0xd')](_0x64273c));if(_0x64273c[_0xf39c('0xe')]){if(_0x64273c['error'][_0xf39c('0xf')]===0x1f4){logger[_0xf39c('0xe')](_0xf39c('0xa'),_0x1fb96b,_0x64273c[_0xf39c('0xe')][_0xf39c('0x10')]);return _0x1b6669(_0x64273c[_0xf39c('0xe')][_0xf39c('0x10')]);}logger[_0xf39c('0xe')](_0xf39c('0xa'),_0x1fb96b,_0x64273c['error']['message']);return _0x4c0647(_0x64273c[_0xf39c('0xe')]['message']);}else{logger[_0xf39c('0x9')]('VoiceDialReport,\x20%s,\x20%s',_0x1fb96b,_0xf39c('0xb'));_0x4c0647(_0x64273c[_0xf39c('0x11')][_0xf39c('0x10')]);}})[_0xf39c('0x12')](function(_0xd7011f){logger[_0xf39c('0xe')](_0xf39c('0xa'),_0x1fb96b,_0xd7011f);_0x1b6669(_0xd7011f);});});}exports[_0xf39c('0x13')]=function(_0x3e99ea){var _0x56eed2=this;return new Promise(function(_0x25113f,_0x159e6c){return db[_0xf39c('0x14')]['create'](_0x3e99ea['body'],{'raw':_0x3e99ea['options']?_0x3e99ea[_0xf39c('0x15')]['raw']===undefined?!![]:![]:!![]})[_0xf39c('0x16')](function(_0x2c0cac){logger[_0xf39c('0x9')](_0xf39c('0x13'),_0x3e99ea);logger['debug'](_0xf39c('0x13'),_0x3e99ea,JSON[_0xf39c('0xd')](_0x2c0cac));_0x25113f(_0x2c0cac);})[_0xf39c('0x12')](function(_0x355c63){logger[_0xf39c('0xe')](_0xf39c('0x13'),_0x355c63[_0xf39c('0x10')],_0x3e99ea);_0x159e6c(_0x56eed2['error'](0x1f4,_0x355c63[_0xf39c('0x10')]));});});};exports['UpdateVoiceDialReport']=function(_0x2f15c1){var _0x212013=this;return new Promise(function(_0x10b098,_0x11565d){return db[_0xf39c('0x14')][_0xf39c('0x17')](_0x2f15c1[_0xf39c('0x18')],{'raw':_0x2f15c1['options']?_0x2f15c1[_0xf39c('0x15')][_0xf39c('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2f15c1[_0xf39c('0x15')]?_0x2f15c1['options'][_0xf39c('0x1a')]||null:null,'attributes':_0x2f15c1['options']?_0x2f15c1[_0xf39c('0x15')]['attributes']||null:null,'limit':_0x2f15c1[_0xf39c('0x15')]?_0x2f15c1[_0xf39c('0x15')]['limit']||null:null})[_0xf39c('0x16')](function(_0x3aea6a){logger[_0xf39c('0x9')](_0xf39c('0x1b'),_0x2f15c1);logger[_0xf39c('0x1c')](_0xf39c('0x1b'),_0x2f15c1,JSON[_0xf39c('0xd')](_0x3aea6a));_0x10b098(_0x3aea6a);})[_0xf39c('0x12')](function(_0x155247){logger[_0xf39c('0xe')](_0xf39c('0x1b'),_0x155247[_0xf39c('0x10')],_0x2f15c1);_0x11565d(_0x212013[_0xf39c('0xe')](0x1f4,_0x155247[_0xf39c('0x10')]));});});}; \ No newline at end of file +var _0x53c5=['VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','error','code','message','CreateVoiceDialReport','VoiceDialReport','create','body','options','raw','info','stringify','catch','UpdateVoiceDialReport','update','where','attributes','limit','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x36f5b7,_0x1514ca){var _0x495dfb=function(_0xace77){while(--_0xace77){_0x36f5b7['push'](_0x36f5b7['shift']());}};_0x495dfb(++_0x1514ca);}(_0x53c5,0xfc));var _0x553c=function(_0x35c22f,_0x31d91a){_0x35c22f=_0x35c22f-0x0;var _0x1c9b81=_0x53c5[_0x35c22f];return _0x1c9b81;};'use strict';var _=require(_0x553c('0x0'));var util=require(_0x553c('0x1'));var moment=require(_0x553c('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x553c('0x3'));var db=require(_0x553c('0x4'))['db'];var utils=require(_0x553c('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x553c('0x6'));var jayson=require(_0x553c('0x7'));var client=jayson[_0x553c('0x8')][_0x553c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x88d317,_0x48cdc1,_0x4481ac){return new BPromise(function(_0x2e0636,_0x10b0d9){return client[_0x553c('0xa')](_0x88d317,_0x4481ac)[_0x553c('0xb')](function(_0xb7f6f5){logger['info'](_0x553c('0xc'),_0x48cdc1,_0x553c('0xd'));logger[_0x553c('0xe')](_0x553c('0xf'),_0x48cdc1,_0x553c('0xd'),JSON['stringify'](_0xb7f6f5));if(_0xb7f6f5[_0x553c('0x10')]){if(_0xb7f6f5[_0x553c('0x10')][_0x553c('0x11')]===0x1f4){logger[_0x553c('0x10')]('VoiceDialReport,\x20%s,\x20%s',_0x48cdc1,_0xb7f6f5['error'][_0x553c('0x12')]);return _0x10b0d9(_0xb7f6f5[_0x553c('0x10')][_0x553c('0x12')]);}logger['error']('VoiceDialReport,\x20%s,\x20%s',_0x48cdc1,_0xb7f6f5[_0x553c('0x10')][_0x553c('0x12')]);return _0x2e0636(_0xb7f6f5['error'][_0x553c('0x12')]);}else{logger['info'](_0x553c('0xc'),_0x48cdc1,_0x553c('0xd'));_0x2e0636(_0xb7f6f5['result'][_0x553c('0x12')]);}})['catch'](function(_0x467ade){logger[_0x553c('0x10')](_0x553c('0xc'),_0x48cdc1,_0x467ade);_0x10b0d9(_0x467ade);});});}exports[_0x553c('0x13')]=function(_0x62c689){var _0x382c4c=this;return new Promise(function(_0x671c7c,_0x587a01){return db[_0x553c('0x14')][_0x553c('0x15')](_0x62c689[_0x553c('0x16')],{'raw':_0x62c689[_0x553c('0x17')]?_0x62c689['options'][_0x553c('0x18')]===undefined?!![]:![]:!![]})[_0x553c('0xb')](function(_0x37e7d8){logger[_0x553c('0x19')](_0x553c('0x13'),_0x62c689);logger[_0x553c('0xe')](_0x553c('0x13'),_0x62c689,JSON[_0x553c('0x1a')](_0x37e7d8));_0x671c7c(_0x37e7d8);})[_0x553c('0x1b')](function(_0x155897){logger['error'](_0x553c('0x13'),_0x155897[_0x553c('0x12')],_0x62c689);_0x587a01(_0x382c4c['error'](0x1f4,_0x155897[_0x553c('0x12')]));});});};exports[_0x553c('0x1c')]=function(_0x1f3727){var _0x3963a7=this;return new Promise(function(_0x3109f1,_0x5d6568){return db[_0x553c('0x14')][_0x553c('0x1d')](_0x1f3727[_0x553c('0x16')],{'raw':_0x1f3727[_0x553c('0x17')]?_0x1f3727[_0x553c('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1f3727['options']?_0x1f3727['options'][_0x553c('0x1e')]||null:null,'attributes':_0x1f3727[_0x553c('0x17')]?_0x1f3727[_0x553c('0x17')][_0x553c('0x1f')]||null:null,'limit':_0x1f3727[_0x553c('0x17')]?_0x1f3727['options'][_0x553c('0x20')]||null:null})[_0x553c('0xb')](function(_0x559072){logger[_0x553c('0x19')](_0x553c('0x1c'),_0x1f3727);logger[_0x553c('0xe')](_0x553c('0x1c'),_0x1f3727,JSON[_0x553c('0x1a')](_0x559072));_0x3109f1(_0x559072);})[_0x553c('0x1b')](function(_0x3a37b7){logger[_0x553c('0x10')](_0x553c('0x1c'),_0x3a37b7[_0x553c('0x12')],_0x1f3727);_0x5d6568(_0x3963a7[_0x553c('0x10')](0x1f4,_0x3a37b7[_0x553c('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index de15023..520ea4f 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 _0xd8be=['post','create','/:id/applications','addApplications','put','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceExtension.controller','get','isAuthenticated','/:id','show'];(function(_0x2b1012,_0x2d01f8){var _0x1a944f=function(_0x8845de){while(--_0x8845de){_0x2b1012['push'](_0x2b1012['shift']());}};_0x1a944f(++_0x2d01f8);}(_0xd8be,0x158));var _0xed8b=function(_0x47a349,_0x4699d9){_0x47a349=_0x47a349-0x0;var _0x18ab75=_0xd8be[_0x47a349];return _0x18ab75;};'use strict';var multer=require('multer');var util=require(_0xed8b('0x0'));var path=require('path');var timeout=require(_0xed8b('0x1'));var express=require(_0xed8b('0x2'));var router=express[_0xed8b('0x3')]();var fs_extra=require(_0xed8b('0x4'));var auth=require(_0xed8b('0x5'));var interaction=require(_0xed8b('0x6'));var config=require(_0xed8b('0x7'));var controller=require(_0xed8b('0x8'));router[_0xed8b('0x9')]('/',auth[_0xed8b('0xa')](),controller['index']);router[_0xed8b('0x9')](_0xed8b('0xb'),auth[_0xed8b('0xa')](),controller[_0xed8b('0xc')]);router[_0xed8b('0xd')]('/',auth[_0xed8b('0xa')](),controller[_0xed8b('0xe')]);router[_0xed8b('0xd')](_0xed8b('0xf'),auth[_0xed8b('0xa')](),controller[_0xed8b('0x10')]);router[_0xed8b('0x11')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xed8b('0x12')](_0xed8b('0xb'),auth[_0xed8b('0xa')](),controller[_0xed8b('0x13')]);module[_0xed8b('0x14')]=router; \ No newline at end of file +var _0x43a9=['post','/:id/applications','addApplications','put','update','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../config/environment','./voiceExtension.controller','get','isAuthenticated','index','/:id','show'];(function(_0x4eb8ac,_0x29d9a3){var _0x19eeb0=function(_0xf17b9c){while(--_0xf17b9c){_0x4eb8ac['push'](_0x4eb8ac['shift']());}};_0x19eeb0(++_0x29d9a3);}(_0x43a9,0x94));var _0x943a=function(_0x226576,_0x14fa3a){_0x226576=_0x226576-0x0;var _0x4c15d4=_0x43a9[_0x226576];return _0x4c15d4;};'use strict';var multer=require(_0x943a('0x0'));var util=require('util');var path=require(_0x943a('0x1'));var timeout=require(_0x943a('0x2'));var express=require('express');var router=express[_0x943a('0x3')]();var fs_extra=require(_0x943a('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x943a('0x5'));var controller=require(_0x943a('0x6'));router[_0x943a('0x7')]('/',auth[_0x943a('0x8')](),controller[_0x943a('0x9')]);router['get'](_0x943a('0xa'),auth['isAuthenticated'](),controller[_0x943a('0xb')]);router[_0x943a('0xc')]('/',auth[_0x943a('0x8')](),controller['create']);router['post'](_0x943a('0xd'),auth[_0x943a('0x8')](),controller[_0x943a('0xe')]);router[_0x943a('0xf')](_0x943a('0xa'),auth[_0x943a('0x8')](),controller[_0x943a('0x10')]);router[_0x943a('0x11')](_0x943a('0xa'),auth[_0x943a('0x8')](),controller[_0x943a('0x12')]);module[_0x943a('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index c7a38c8..b5eccdf 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 _0x6a5b=['any','*,*,*,*','INTEGER','BOOLEAN','wav','VIRTUAL','getDataValue','exports','compositeIndex','STRING','NoOp','ENUM','inbound','outbound','internal','outbound-fax'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x6a5b,0x1a7));var _0xb6a5=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x6a5b[_0x3bf83f];return _0x22c4a9;};'use strict';var Sequelize=require('sequelize');module[_0xb6a5('0x0')]={'context':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xb6a5('0x1'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0xb6a5('0x2')],'allowNull':![],'unique':_0xb6a5('0x1')},'priority':{'type':Sequelize[_0xb6a5('0x2')],'allowNull':![],'defaultValue':'1','unique':'compositeIndex'},'tag':{'type':Sequelize[_0xb6a5('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0xb6a5('0x2')],'allowNull':![],'defaultValue':_0xb6a5('0x3')},'appdata':{'type':Sequelize[_0xb6a5('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0xb6a5('0x4')](_0xb6a5('0x5'),_0xb6a5('0x6'),_0xb6a5('0x7'),'inbound-fax',_0xb6a5('0x8'),'system',_0xb6a5('0x9')),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xb6a5('0x2')],'allowNull':![],'defaultValue':_0xb6a5('0xa')},'IntervalId':{'type':Sequelize[_0xb6a5('0xb')]},'isApp':{'type':Sequelize[_0xb6a5('0xc')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0xb6a5('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0xb6a5('0x2')],'allowNull':!![]},'record':{'type':Sequelize[_0xb6a5('0xc')],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':_0xb6a5('0xd')},'answer':{'type':Sequelize[_0xb6a5('0xc')],'defaultValue':!![]},'name':{'type':Sequelize[_0xb6a5('0xe')],'get':function(_0x1a9884){return this[_0xb6a5('0xf')]('exten');}},'alias':{'type':Sequelize[_0xb6a5('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0x7d2e=['*,*,*,*','INTEGER','BOOLEAN','wav','VIRTUAL','getDataValue','exten','sequelize','exports','STRING','compositeIndex','NoOp','ENUM','outbound','inbound-fax'];(function(_0x2610db,_0x454344){var _0x5d4d96=function(_0x3794de){while(--_0x3794de){_0x2610db['push'](_0x2610db['shift']());}};_0x5d4d96(++_0x454344);}(_0x7d2e,0xf7));var _0xe7d2=function(_0x214d8c,_0x242dc3){_0x214d8c=_0x214d8c-0x0;var _0x5a5060=_0x7d2e[_0x214d8c];return _0x5a5060;};'use strict';var Sequelize=require(_0xe7d2('0x0'));module[_0xe7d2('0x1')]={'context':{'type':Sequelize[_0xe7d2('0x2')],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xe7d2('0x3')},'priority':{'type':Sequelize[_0xe7d2('0x2')],'allowNull':![],'defaultValue':'1','unique':'compositeIndex'},'tag':{'type':Sequelize[_0xe7d2('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0xe7d2('0x2')],'allowNull':![],'defaultValue':_0xe7d2('0x4')},'appdata':{'type':Sequelize[_0xe7d2('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0xe7d2('0x5')]('inbound',_0xe7d2('0x6'),'internal',_0xe7d2('0x7'),'outbound-fax','system','any'),'allowNull':![]},'description':{'type':Sequelize[_0xe7d2('0x2')]},'interval':{'type':Sequelize[_0xe7d2('0x2')],'allowNull':![],'defaultValue':_0xe7d2('0x8')},'IntervalId':{'type':Sequelize[_0xe7d2('0x9')]},'isApp':{'type':Sequelize[_0xe7d2('0xa')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize['STRING'],'defaultValue':null},'callerID':{'type':Sequelize[_0xe7d2('0x2')],'allowNull':!![]},'record':{'type':Sequelize[_0xe7d2('0xa')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0xe7d2('0x9')]},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':_0xe7d2('0xb')},'answer':{'type':Sequelize[_0xe7d2('0xa')],'defaultValue':!![]},'name':{'type':Sequelize[_0xe7d2('0xc')],'get':function(_0x548684){return this[_0xe7d2('0xd')](_0xe7d2('0xe'));}},'alias':{'type':Sequelize[_0xe7d2('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 757dfcf..4e1bd99 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 _0xd562=['true','createRouting','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','redis','defaults','localhost','./voiceExtension.socket','register','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','save','then','destroy','get','inbound','OutboundRoutes','outbound','InternalRoutes','internal','filter','ignore','includes','find','value','type','name','UserProfileResource','error','stack','send','index','map','VoiceExtension','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','create','body','startsWith','concat','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','pick','exten','description','recordingFormat','cutdigits','alias','context','addApplications','sequelize','transaction','VoiceExtensionId','rewriteDial'];(function(_0xd66253,_0x28277b){var _0x6cc65f=function(_0x1b6ec4){while(--_0x1b6ec4){_0xd66253['push'](_0xd66253['shift']());}};_0x6cc65f(++_0x28277b);}(_0xd562,0x77));var _0x2d56=function(_0x4028fb,_0x35d195){_0x4028fb=_0x4028fb-0x0;var _0x5984a8=_0xd562[_0x4028fb];return _0x5984a8;};'use strict';var emlformat=require(_0x2d56('0x0'));var rimraf=require(_0x2d56('0x1'));var zipdir=require(_0x2d56('0x2'));var jsonpatch=require(_0x2d56('0x3'));var rp=require(_0x2d56('0x4'));var moment=require(_0x2d56('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x2d56('0x6'));var util=require('util');var path=require(_0x2d56('0x7'));var sox=require(_0x2d56('0x8'));var csv=require(_0x2d56('0x9'));var ejs=require(_0x2d56('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2d56('0xb'));var squel=require(_0x2d56('0xc'));var crypto=require(_0x2d56('0xd'));var jsforce=require(_0x2d56('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x2d56('0x9'));var querystring=require(_0x2d56('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x2d56('0x10'));var qs=require(_0x2d56('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2d56('0x12'));var logger=require(_0x2d56('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x2d56('0x14'));var db=require(_0x2d56('0x15'))['db'];config[_0x2d56('0x16')]=_[_0x2d56('0x17')](config[_0x2d56('0x16')],{'host':_0x2d56('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x2d56('0x19'))[_0x2d56('0x1a')](socket);function respondWithStatusCode(_0x26cbc9,_0x36c19f){_0x36c19f=_0x36c19f||0xcc;return function(_0x424dc9){if(_0x424dc9){return _0x26cbc9[_0x2d56('0x1b')](_0x36c19f);}return _0x26cbc9[_0x2d56('0x1c')](_0x36c19f)[_0x2d56('0x1d')]();};}function respondWithResult(_0x20f5c4,_0x5127ff){_0x5127ff=_0x5127ff||0xc8;return function(_0x290728){if(_0x290728){return _0x20f5c4[_0x2d56('0x1c')](_0x5127ff)['json'](_0x290728);}};}function respondWithFilteredResult(_0x4b771a,_0x3a00dc){return function(_0x3b7a4d){if(_0x3b7a4d){var _0x14c5df=typeof _0x3a00dc['offset']===_0x2d56('0x1e')&&typeof _0x3a00dc[_0x2d56('0x1f')]===_0x2d56('0x1e');var _0x183c54=_0x3b7a4d[_0x2d56('0x20')];var _0x1fed02=_0x14c5df?0x0:_0x3a00dc[_0x2d56('0x21')];var _0x3f0607=_0x14c5df?_0x3b7a4d[_0x2d56('0x20')]:_0x3a00dc[_0x2d56('0x21')]+_0x3a00dc['limit'];var _0x25b833;if(_0x3f0607>=_0x183c54){_0x3f0607=_0x183c54;_0x25b833=0xc8;}else{_0x25b833=0xce;}_0x4b771a[_0x2d56('0x1c')](_0x25b833);return _0x4b771a[_0x2d56('0x22')](_0x2d56('0x23'),_0x1fed02+'-'+_0x3f0607+'/'+_0x183c54)[_0x2d56('0x24')](_0x3b7a4d);}return null;};}function patchUpdates(_0x73ec6b){return function(_0x4adb7d){try{jsonpatch[_0x2d56('0x25')](_0x4adb7d,_0x73ec6b,!![]);}catch(_0x1c0e2f){return BPromise['reject'](_0x1c0e2f);}return _0x4adb7d[_0x2d56('0x26')]();};}function saveUpdates(_0x1fa97d,_0x4c1517){return function(_0xb59722){if(_0xb59722){return _0xb59722['update'](_0x1fa97d)[_0x2d56('0x27')](function(_0xa64c37){return _0xa64c37;});}return null;};}function removeEntity(_0x340636,_0xb5d22d){return function(_0x5b459b){if(_0x5b459b){return _0x5b459b[_0x2d56('0x28')]()[_0x2d56('0x27')](function(){var _0x2b2c79=_0x5b459b[_0x2d56('0x29')]({'plain':!![]});var _0x329468=[{'name':'InboundRoutes','value':_0x2d56('0x2a'),'ignore':![]},{'name':_0x2d56('0x2b'),'value':_0x2d56('0x2c'),'ignore':![]},{'name':_0x2d56('0x2d'),'value':_0x2d56('0x2e'),'ignore':![]}];var _0x49cc98=_(_0x329468)[_0x2d56('0x2f')](_0x2d56('0x30'))['map']('value')['value']();if(_[_0x2d56('0x31')](_0x49cc98,_0x2b2c79['type'])){return;}var _0x5626dd=_[_0x2d56('0x32')](_0x329468,[_0x2d56('0x33'),_0x2b2c79[_0x2d56('0x34')]])[_0x2d56('0x35')];return db[_0x2d56('0x36')]['destroy']({'where':{'type':_0x5626dd,'resourceId':_0x2b2c79['id']}})[_0x2d56('0x27')](function(){return _0x5b459b;});})[_0x2d56('0x27')](function(){_0x340636[_0x2d56('0x1c')](0xcc)[_0x2d56('0x1d')]();});}};}function handleEntityNotFound(_0x542148,_0x44ab0f){return function(_0x2a224b){if(!_0x2a224b){_0x542148[_0x2d56('0x1b')](0x194);}return _0x2a224b;};}function handleError(_0x167274,_0x183590){_0x183590=_0x183590||0x1f4;return function(_0x8e5f26){logger[_0x2d56('0x37')](_0x8e5f26[_0x2d56('0x38')]);if(_0x8e5f26[_0x2d56('0x35')]){delete _0x8e5f26['name'];}_0x167274['status'](_0x183590)[_0x2d56('0x39')](_0x8e5f26);};}exports[_0x2d56('0x3a')]=function(_0x3c02f6,_0x5969b2){var _0x3f2120={},_0x214798={},_0x4c4718={'count':0x0,'rows':[]};var _0x5739cf=_[_0x2d56('0x3b')](db[_0x2d56('0x3c')][_0x2d56('0x3d')],function(_0x273577){return{'name':_0x273577[_0x2d56('0x3e')],'type':_0x273577[_0x2d56('0x34')][_0x2d56('0x3f')]};});_0x214798[_0x2d56('0x40')]=_[_0x2d56('0x3b')](_0x5739cf,_0x2d56('0x35'));_0x214798[_0x2d56('0x41')]=_[_0x2d56('0x42')](_0x3c02f6[_0x2d56('0x41')]);_0x214798[_0x2d56('0x43')]=_[_0x2d56('0x44')](_0x214798['model'],_0x214798['query']);_0x3f2120['attributes']=_['intersection'](_0x214798[_0x2d56('0x40')],qs[_0x2d56('0x45')](_0x3c02f6[_0x2d56('0x41')][_0x2d56('0x45')]));_0x3f2120[_0x2d56('0x46')]=_0x3f2120['attributes'][_0x2d56('0x47')]?_0x3f2120[_0x2d56('0x46')]:_0x214798[_0x2d56('0x40')];if(!_0x3c02f6[_0x2d56('0x41')][_0x2d56('0x48')]('nolimit')){_0x3f2120[_0x2d56('0x1f')]=qs[_0x2d56('0x1f')](_0x3c02f6[_0x2d56('0x41')]['limit']);_0x3f2120[_0x2d56('0x21')]=qs[_0x2d56('0x21')](_0x3c02f6[_0x2d56('0x41')][_0x2d56('0x21')]);}_0x3f2120[_0x2d56('0x49')]=qs[_0x2d56('0x4a')](_0x3c02f6[_0x2d56('0x41')][_0x2d56('0x4a')]);_0x3f2120[_0x2d56('0x4b')]=qs[_0x2d56('0x43')](_['pick'](_0x3c02f6[_0x2d56('0x41')],_0x214798[_0x2d56('0x43')]),_0x5739cf);if(_0x3c02f6[_0x2d56('0x41')][_0x2d56('0x2f')]){_0x3f2120[_0x2d56('0x4b')]=_[_0x2d56('0x4c')](_0x3f2120[_0x2d56('0x4b')],{'$or':_[_0x2d56('0x3b')](_0x5739cf,function(_0x22f283){if(_0x22f283[_0x2d56('0x34')]!==_0x2d56('0x4d')){var _0x38d27d={};_0x38d27d[_0x22f283[_0x2d56('0x35')]]={'$like':'%'+_0x3c02f6[_0x2d56('0x41')][_0x2d56('0x2f')]+'%'};return _0x38d27d;}})});}_0x3f2120=_[_0x2d56('0x4c')]({},_0x3f2120,_0x3c02f6[_0x2d56('0x4e')]);var _0x4038a8={'where':_0x3f2120[_0x2d56('0x4b')]};return db[_0x2d56('0x3c')][_0x2d56('0x20')](_0x4038a8)[_0x2d56('0x27')](function(_0x4b8d08){_0x4c4718['count']=_0x4b8d08;if(_0x3c02f6[_0x2d56('0x41')][_0x2d56('0x4f')]){_0x3f2120[_0x2d56('0x50')]=[{'all':!![]}];}return db[_0x2d56('0x3c')]['findAll'](_0x3f2120);})[_0x2d56('0x27')](function(_0x4f1b7b){_0x4c4718[_0x2d56('0x51')]=_0x4f1b7b;return _0x4c4718;})['then'](respondWithFilteredResult(_0x5969b2,_0x3f2120))[_0x2d56('0x52')](handleError(_0x5969b2,null));};exports[_0x2d56('0x53')]=function(_0x10213e,_0x640a85){var _0x5a277b={'raw':![],'where':{'id':_0x10213e[_0x2d56('0x54')]['id']}},_0x542c9a={};_0x542c9a['model']=_['keys'](db[_0x2d56('0x3c')][_0x2d56('0x3d')]);_0x542c9a[_0x2d56('0x41')]=_[_0x2d56('0x42')](_0x10213e['query']);_0x542c9a[_0x2d56('0x43')]=_[_0x2d56('0x44')](_0x542c9a[_0x2d56('0x40')],_0x542c9a[_0x2d56('0x41')]);_0x5a277b[_0x2d56('0x46')]=_['intersection'](_0x542c9a['model'],qs[_0x2d56('0x45')](_0x10213e[_0x2d56('0x41')][_0x2d56('0x45')]));_0x5a277b['attributes']=_0x5a277b[_0x2d56('0x46')][_0x2d56('0x47')]?_0x5a277b[_0x2d56('0x46')]:_0x542c9a[_0x2d56('0x40')];if(_0x10213e[_0x2d56('0x41')][_0x2d56('0x4f')]){_0x5a277b[_0x2d56('0x50')]=[{'all':!![]}];}_0x5a277b=_[_0x2d56('0x4c')]({},_0x5a277b,_0x10213e['options']);return db[_0x2d56('0x3c')][_0x2d56('0x32')](_0x5a277b)[_0x2d56('0x27')](handleEntityNotFound(_0x640a85,null))[_0x2d56('0x27')](respondWithResult(_0x640a85,null))[_0x2d56('0x52')](handleError(_0x640a85,null));};exports[_0x2d56('0x28')]=function(_0x1060fa,_0x304c18){return db[_0x2d56('0x3c')][_0x2d56('0x32')]({'where':{'id':_0x1060fa[_0x2d56('0x54')]['id']}})[_0x2d56('0x27')](handleEntityNotFound(_0x304c18,null))[_0x2d56('0x27')](removeEntity(_0x304c18,null))[_0x2d56('0x52')](handleError(_0x304c18,null));};exports[_0x2d56('0x55')]=function(_0x17c131,_0x4aae09){if(_0x17c131[_0x2d56('0x56')][_0x2d56('0x34')]===_0x2d56('0x2c')&&!_[_0x2d56('0x57')](_0x17c131['body']['exten'],'_')){_0x17c131[_0x2d56('0x56')]['exten']='_'[_0x2d56('0x58')](_0x17c131['body']['exten']);}return db[_0x2d56('0x3c')][_0x2d56('0x55')](_0x17c131[_0x2d56('0x56')],{'raw':![]})[_0x2d56('0x27')](function(_0x478035){var _0x15d728=_0x17c131[_0x2d56('0x59')][_0x2d56('0x29')]({'plain':!![]});if(!_0x15d728)throw new Error(_0x2d56('0x5a'));if(_0x15d728[_0x2d56('0x5b')]===_0x2d56('0x59')){var _0x46e5ca=_0x478035[_0x2d56('0x29')]({'plain':!![]});var _0x33512b=[{'name':'InboundRoutes','value':_0x2d56('0x2a')},{'name':_0x2d56('0x2b'),'value':_0x2d56('0x2c')},{'name':_0x2d56('0x2d'),'value':_0x2d56('0x2e')}];var _0x2719d6=_[_0x2d56('0x32')](_0x33512b,['value',_0x46e5ca[_0x2d56('0x34')]])['name'];return db[_0x2d56('0x5c')][_0x2d56('0x32')]({'where':{'name':_0x2719d6,'userProfileId':_0x15d728[_0x2d56('0x5d')]},'raw':!![]})[_0x2d56('0x27')](function(_0x2f8da0){if(_0x2f8da0&&_0x2f8da0[_0x2d56('0x5e')]===0x0){return db[_0x2d56('0x36')]['create']({'name':_0x46e5ca[_0x2d56('0x35')],'resourceId':_0x46e5ca['id'],'type':_0x2f8da0[_0x2d56('0x35')],'sectionId':_0x2f8da0['id']},{})['then'](function(){return _0x478035;});}else{return _0x478035;}})[_0x2d56('0x52')](function(_0xfa318d){logger[_0x2d56('0x37')](_0x2d56('0x5f'),_0xfa318d);throw _0xfa318d;});}return _0x478035;})['then'](respondWithResult(_0x4aae09,0xc9))['catch'](handleError(_0x4aae09,null));};exports[_0x2d56('0x60')]=function(_0xf6386b,_0x3e9013){if(_0xf6386b['body']['id']){delete _0xf6386b['body']['id'];}return db[_0x2d56('0x3c')][_0x2d56('0x32')]({'where':{'id':_0xf6386b[_0x2d56('0x54')]['id']}})[_0x2d56('0x27')](handleEntityNotFound(_0x3e9013,null))['then'](function(_0x15caa6){if(_0x15caa6){return db[_0x2d56('0x3c')][_0x2d56('0x60')](_[_0x2d56('0x61')](_0xf6386b[_0x2d56('0x56')],[_0x2d56('0x62'),'context',_0x2d56('0x63'),_0x2d56('0x64'),_0x2d56('0x65'),'mandatoryDisposition',_0x2d56('0x66')]),{'where':{'context':_0x15caa6[_0x2d56('0x67')],'exten':_0x15caa6[_0x2d56('0x62')]},'individualHooks':!![]})[_0x2d56('0x27')](function(_0x5e30db){return _0x5e30db;});}return null;})[_0x2d56('0x27')](respondWithStatusCode(_0x3e9013,null))[_0x2d56('0x52')](handleError(_0x3e9013,null));};exports[_0x2d56('0x68')]=function(_0x18480e,_0x1a3a83){return db[_0x2d56('0x3c')]['findOne']({'where':{'id':_0x18480e[_0x2d56('0x54')]['id']}})[_0x2d56('0x27')](function(_0x26cf4a){if(_0x26cf4a){return db[_0x2d56('0x69')][_0x2d56('0x6a')](function(_0x49139d){return db[_0x2d56('0x3c')][_0x2d56('0x28')]({'where':{'VoiceExtensionId':_0x18480e[_0x2d56('0x54')]['id']},'transaction':_0x49139d})[_0x2d56('0x27')](function(){var _0x33c081=_[_0x2d56('0x3b')](_0x18480e['body'],function(_0x33456f){_0x33456f[_0x2d56('0x6b')]=_0x18480e[_0x2d56('0x54')]['id'];_0x33456f['isApp']=!![];return _0x33456f;});var _0x57a810=_0x18480e[_0x2d56('0x41')]['rewriteDial']&&_0x18480e[_0x2d56('0x41')][_0x2d56('0x6c')]['toLowerCase']()===_0x2d56('0x6d')?!![]:![];return _0x26cf4a[_0x2d56('0x6e')](_0x33c081,_0x57a810);})[_0x2d56('0x27')](function(_0x217b3c){return db[_0x2d56('0x3c')][_0x2d56('0x6f')](_0x217b3c,{'transaction':_0x49139d});});})['then'](function(){return db[_0x2d56('0x3c')][_0x2d56('0x70')]({'where':{'isApp':!![],'VoiceExtensionId':_0x18480e[_0x2d56('0x54')]['id']},'order':_0x2d56('0x71')});});}})[_0x2d56('0x27')](respondWithResult(_0x1a3a83,null))[_0x2d56('0x52')](handleError(_0x1a3a83,null));}; \ No newline at end of file +var _0x35c1=['../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','get','inbound','OutboundRoutes','outbound','InternalRoutes','internal','map','value','includes','type','name','UserProfileResource','error','stack','send','index','VoiceExtension','rawAttributes','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','filters','filter','merge','where','findAll','rows','catch','show','params','includeAll','include','options','find','create','body','startsWith','exten','concat','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','InboundRoutes','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','description','recordingFormat','cutdigits','mandatoryDisposition','context','addApplications','findOne','sequelize','transaction','VoiceExtensionId','isApp','rewriteDial','toLowerCase','true','findAndCountAll','cast(priority\x20as\x20unsigned)','eml-format','zip-dir','request-promise','moment','path','sox','ejs','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils'];(function(_0xbc2037,_0x6483ab){var _0x36f877=function(_0x25e88d){while(--_0x25e88d){_0xbc2037['push'](_0xbc2037['shift']());}};_0x36f877(++_0x6483ab);}(_0x35c1,0xcc));var _0x135c=function(_0x46496c,_0x289e70){_0x46496c=_0x46496c-0x0;var _0x4f77c8=_0x35c1[_0x46496c];return _0x4f77c8;};'use strict';var emlformat=require(_0x135c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x135c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x135c('0x2'));var moment=require(_0x135c('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x135c('0x4'));var sox=require(_0x135c('0x5'));var csv=require('to-csv');var ejs=require(_0x135c('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x135c('0x7'));var squel=require(_0x135c('0x8'));var crypto=require(_0x135c('0x9'));var jsforce=require(_0x135c('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x135c('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x135c('0xc'));var qs=require(_0x135c('0xd'));var as=require(_0x135c('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x135c('0xf'))(_0x135c('0x10'));var utils=require(_0x135c('0x11'));var config=require(_0x135c('0x12'));var licenseUtil=require(_0x135c('0x13'));var db=require(_0x135c('0x14'))['db'];config[_0x135c('0x15')]=_['defaults'](config[_0x135c('0x15')],{'host':_0x135c('0x16'),'port':0x18eb});var socket=require(_0x135c('0x17'))(new Redis(config[_0x135c('0x15')]));require('./voiceExtension.socket')[_0x135c('0x18')](socket);function respondWithStatusCode(_0x4c2765,_0x574c6a){_0x574c6a=_0x574c6a||0xcc;return function(_0x1037ef){if(_0x1037ef){return _0x4c2765[_0x135c('0x19')](_0x574c6a);}return _0x4c2765[_0x135c('0x1a')](_0x574c6a)[_0x135c('0x1b')]();};}function respondWithResult(_0x446224,_0x5c504c){_0x5c504c=_0x5c504c||0xc8;return function(_0x30d6c3){if(_0x30d6c3){return _0x446224[_0x135c('0x1a')](_0x5c504c)[_0x135c('0x1c')](_0x30d6c3);}};}function respondWithFilteredResult(_0x5ff385,_0x439933){return function(_0xb4eb32){if(_0xb4eb32){var _0x5e6369=typeof _0x439933[_0x135c('0x1d')]===_0x135c('0x1e')&&typeof _0x439933['limit']==='undefined';var _0xaa1b40=_0xb4eb32[_0x135c('0x1f')];var _0x1d1b75=_0x5e6369?0x0:_0x439933[_0x135c('0x1d')];var _0x3b37aa=_0x5e6369?_0xb4eb32[_0x135c('0x1f')]:_0x439933[_0x135c('0x1d')]+_0x439933['limit'];var _0x4dafce;if(_0x3b37aa>=_0xaa1b40){_0x3b37aa=_0xaa1b40;_0x4dafce=0xc8;}else{_0x4dafce=0xce;}_0x5ff385[_0x135c('0x1a')](_0x4dafce);return _0x5ff385[_0x135c('0x20')](_0x135c('0x21'),_0x1d1b75+'-'+_0x3b37aa+'/'+_0xaa1b40)['json'](_0xb4eb32);}return null;};}function patchUpdates(_0x207281){return function(_0x38258f){try{jsonpatch[_0x135c('0x22')](_0x38258f,_0x207281,!![]);}catch(_0x2b9ef6){return BPromise[_0x135c('0x23')](_0x2b9ef6);}return _0x38258f[_0x135c('0x24')]();};}function saveUpdates(_0x2f5e2c,_0x1b45ab){return function(_0x200329){if(_0x200329){return _0x200329[_0x135c('0x25')](_0x2f5e2c)[_0x135c('0x26')](function(_0x55d8f0){return _0x55d8f0;});}return null;};}function removeEntity(_0x3ff3be,_0x46979c){return function(_0x252b21){if(_0x252b21){return _0x252b21[_0x135c('0x27')]()[_0x135c('0x26')](function(){var _0x1eb808=_0x252b21[_0x135c('0x28')]({'plain':!![]});var _0x143dfe=[{'name':'InboundRoutes','value':_0x135c('0x29'),'ignore':![]},{'name':_0x135c('0x2a'),'value':_0x135c('0x2b'),'ignore':![]},{'name':_0x135c('0x2c'),'value':_0x135c('0x2d'),'ignore':![]}];var _0x97ab6a=_(_0x143dfe)['filter']('ignore')[_0x135c('0x2e')](_0x135c('0x2f'))['value']();if(_[_0x135c('0x30')](_0x97ab6a,_0x1eb808['type'])){return;}var _0x31ddaa=_['find'](_0x143dfe,[_0x135c('0x2f'),_0x1eb808[_0x135c('0x31')]])[_0x135c('0x32')];return db[_0x135c('0x33')][_0x135c('0x27')]({'where':{'type':_0x31ddaa,'resourceId':_0x1eb808['id']}})[_0x135c('0x26')](function(){return _0x252b21;});})[_0x135c('0x26')](function(){_0x3ff3be[_0x135c('0x1a')](0xcc)[_0x135c('0x1b')]();});}};}function handleEntityNotFound(_0x280ff3,_0x3b77b7){return function(_0x5db384){if(!_0x5db384){_0x280ff3[_0x135c('0x19')](0x194);}return _0x5db384;};}function handleError(_0x35ff47,_0x13fc65){_0x13fc65=_0x13fc65||0x1f4;return function(_0x5c43ac){logger[_0x135c('0x34')](_0x5c43ac[_0x135c('0x35')]);if(_0x5c43ac[_0x135c('0x32')]){delete _0x5c43ac[_0x135c('0x32')];}_0x35ff47['status'](_0x13fc65)[_0x135c('0x36')](_0x5c43ac);};}exports[_0x135c('0x37')]=function(_0x47aeff,_0x4d1480){var _0x4a0ca4={},_0x2754d8={},_0x52f80a={'count':0x0,'rows':[]};var _0x42618f=_[_0x135c('0x2e')](db[_0x135c('0x38')][_0x135c('0x39')],function(_0x1f2a06){return{'name':_0x1f2a06['fieldName'],'type':_0x1f2a06[_0x135c('0x31')]['key']};});_0x2754d8[_0x135c('0x3a')]=_[_0x135c('0x2e')](_0x42618f,_0x135c('0x32'));_0x2754d8[_0x135c('0x3b')]=_[_0x135c('0x3c')](_0x47aeff[_0x135c('0x3b')]);_0x2754d8['filters']=_[_0x135c('0x3d')](_0x2754d8[_0x135c('0x3a')],_0x2754d8['query']);_0x4a0ca4[_0x135c('0x3e')]=_[_0x135c('0x3d')](_0x2754d8[_0x135c('0x3a')],qs[_0x135c('0x3f')](_0x47aeff[_0x135c('0x3b')]['fields']));_0x4a0ca4[_0x135c('0x3e')]=_0x4a0ca4[_0x135c('0x3e')][_0x135c('0x40')]?_0x4a0ca4['attributes']:_0x2754d8[_0x135c('0x3a')];if(!_0x47aeff[_0x135c('0x3b')][_0x135c('0x41')](_0x135c('0x42'))){_0x4a0ca4[_0x135c('0x43')]=qs[_0x135c('0x43')](_0x47aeff[_0x135c('0x3b')][_0x135c('0x43')]);_0x4a0ca4[_0x135c('0x1d')]=qs['offset'](_0x47aeff[_0x135c('0x3b')][_0x135c('0x1d')]);}_0x4a0ca4['order']=qs[_0x135c('0x44')](_0x47aeff[_0x135c('0x3b')][_0x135c('0x44')]);_0x4a0ca4['where']=qs[_0x135c('0x45')](_['pick'](_0x47aeff[_0x135c('0x3b')],_0x2754d8['filters']),_0x42618f);if(_0x47aeff[_0x135c('0x3b')][_0x135c('0x46')]){_0x4a0ca4['where']=_[_0x135c('0x47')](_0x4a0ca4[_0x135c('0x48')],{'$or':_[_0x135c('0x2e')](_0x42618f,function(_0x47f15b){if(_0x47f15b[_0x135c('0x31')]!=='VIRTUAL'){var _0xd49a8c={};_0xd49a8c[_0x47f15b['name']]={'$like':'%'+_0x47aeff[_0x135c('0x3b')][_0x135c('0x46')]+'%'};return _0xd49a8c;}})});}_0x4a0ca4=_[_0x135c('0x47')]({},_0x4a0ca4,_0x47aeff['options']);var _0x409d2c={'where':_0x4a0ca4[_0x135c('0x48')]};return db[_0x135c('0x38')][_0x135c('0x1f')](_0x409d2c)[_0x135c('0x26')](function(_0x5273ac){_0x52f80a[_0x135c('0x1f')]=_0x5273ac;if(_0x47aeff[_0x135c('0x3b')]['includeAll']){_0x4a0ca4['include']=[{'all':!![]}];}return db[_0x135c('0x38')][_0x135c('0x49')](_0x4a0ca4);})[_0x135c('0x26')](function(_0xe79a0b){_0x52f80a[_0x135c('0x4a')]=_0xe79a0b;return _0x52f80a;})['then'](respondWithFilteredResult(_0x4d1480,_0x4a0ca4))[_0x135c('0x4b')](handleError(_0x4d1480,null));};exports[_0x135c('0x4c')]=function(_0x4f96c1,_0x19bea8){var _0x58ceba={'raw':![],'where':{'id':_0x4f96c1[_0x135c('0x4d')]['id']}},_0x5c0fed={};_0x5c0fed[_0x135c('0x3a')]=_[_0x135c('0x3c')](db[_0x135c('0x38')][_0x135c('0x39')]);_0x5c0fed['query']=_[_0x135c('0x3c')](_0x4f96c1[_0x135c('0x3b')]);_0x5c0fed['filters']=_[_0x135c('0x3d')](_0x5c0fed[_0x135c('0x3a')],_0x5c0fed['query']);_0x58ceba[_0x135c('0x3e')]=_['intersection'](_0x5c0fed[_0x135c('0x3a')],qs[_0x135c('0x3f')](_0x4f96c1['query'][_0x135c('0x3f')]));_0x58ceba['attributes']=_0x58ceba['attributes'][_0x135c('0x40')]?_0x58ceba[_0x135c('0x3e')]:_0x5c0fed[_0x135c('0x3a')];if(_0x4f96c1[_0x135c('0x3b')][_0x135c('0x4e')]){_0x58ceba[_0x135c('0x4f')]=[{'all':!![]}];}_0x58ceba=_[_0x135c('0x47')]({},_0x58ceba,_0x4f96c1[_0x135c('0x50')]);return db['VoiceExtension'][_0x135c('0x51')](_0x58ceba)[_0x135c('0x26')](handleEntityNotFound(_0x19bea8,null))[_0x135c('0x26')](respondWithResult(_0x19bea8,null))[_0x135c('0x4b')](handleError(_0x19bea8,null));};exports[_0x135c('0x27')]=function(_0x1c3e16,_0x2ae353){return db['VoiceExtension'][_0x135c('0x51')]({'where':{'id':_0x1c3e16[_0x135c('0x4d')]['id']}})[_0x135c('0x26')](handleEntityNotFound(_0x2ae353,null))[_0x135c('0x26')](removeEntity(_0x2ae353,null))['catch'](handleError(_0x2ae353,null));};exports[_0x135c('0x52')]=function(_0xcb9027,_0x314c0c){if(_0xcb9027[_0x135c('0x53')][_0x135c('0x31')]==='outbound'&&!_[_0x135c('0x54')](_0xcb9027[_0x135c('0x53')][_0x135c('0x55')],'_')){_0xcb9027['body'][_0x135c('0x55')]='_'[_0x135c('0x56')](_0xcb9027['body'][_0x135c('0x55')]);}return db[_0x135c('0x38')]['create'](_0xcb9027['body'],{'raw':![]})[_0x135c('0x26')](function(_0x26489e){var _0x567e2f=_0xcb9027['user']['get']({'plain':!![]});if(!_0x567e2f)throw new Error(_0x135c('0x57'));if(_0x567e2f[_0x135c('0x58')]===_0x135c('0x59')){var _0x482661=_0x26489e[_0x135c('0x28')]({'plain':!![]});var _0x17079f=[{'name':_0x135c('0x5a'),'value':_0x135c('0x29')},{'name':'OutboundRoutes','value':'outbound'},{'name':_0x135c('0x2c'),'value':_0x135c('0x2d')}];var _0x1559e0=_[_0x135c('0x51')](_0x17079f,[_0x135c('0x2f'),_0x482661[_0x135c('0x31')]])[_0x135c('0x32')];return db[_0x135c('0x5b')]['find']({'where':{'name':_0x1559e0,'userProfileId':_0x567e2f[_0x135c('0x5c')]},'raw':!![]})[_0x135c('0x26')](function(_0x410dd2){if(_0x410dd2&&_0x410dd2[_0x135c('0x5d')]===0x0){return db[_0x135c('0x33')][_0x135c('0x52')]({'name':_0x482661[_0x135c('0x32')],'resourceId':_0x482661['id'],'type':_0x410dd2[_0x135c('0x32')],'sectionId':_0x410dd2['id']},{})[_0x135c('0x26')](function(){return _0x26489e;});}else{return _0x26489e;}})['catch'](function(_0x17dbd0){logger[_0x135c('0x34')](_0x135c('0x5e'),_0x17dbd0);throw _0x17dbd0;});}return _0x26489e;})[_0x135c('0x26')](respondWithResult(_0x314c0c,0xc9))[_0x135c('0x4b')](handleError(_0x314c0c,null));};exports[_0x135c('0x25')]=function(_0x13048e,_0x359b20){if(_0x13048e[_0x135c('0x53')]['id']){delete _0x13048e[_0x135c('0x53')]['id'];}return db[_0x135c('0x38')]['find']({'where':{'id':_0x13048e[_0x135c('0x4d')]['id']}})[_0x135c('0x26')](handleEntityNotFound(_0x359b20,null))[_0x135c('0x26')](function(_0x51fdb5){if(_0x51fdb5){return db[_0x135c('0x38')]['update'](_['pick'](_0x13048e[_0x135c('0x53')],[_0x135c('0x55'),'context',_0x135c('0x5f'),_0x135c('0x60'),_0x135c('0x61'),_0x135c('0x62'),'alias']),{'where':{'context':_0x51fdb5[_0x135c('0x63')],'exten':_0x51fdb5[_0x135c('0x55')]},'individualHooks':!![]})[_0x135c('0x26')](function(_0x2c1414){return _0x2c1414;});}return null;})[_0x135c('0x26')](respondWithStatusCode(_0x359b20,null))['catch'](handleError(_0x359b20,null));};exports[_0x135c('0x64')]=function(_0x2717e8,_0x5b0cab){return db[_0x135c('0x38')][_0x135c('0x65')]({'where':{'id':_0x2717e8['params']['id']}})[_0x135c('0x26')](function(_0x3911cb){if(_0x3911cb){return db[_0x135c('0x66')][_0x135c('0x67')](function(_0x56d94f){return db['VoiceExtension'][_0x135c('0x27')]({'where':{'VoiceExtensionId':_0x2717e8[_0x135c('0x4d')]['id']},'transaction':_0x56d94f})['then'](function(){var _0x1745d5=_[_0x135c('0x2e')](_0x2717e8['body'],function(_0x2fc344){_0x2fc344[_0x135c('0x68')]=_0x2717e8[_0x135c('0x4d')]['id'];_0x2fc344[_0x135c('0x69')]=!![];return _0x2fc344;});var _0x58d9f7=_0x2717e8[_0x135c('0x3b')][_0x135c('0x6a')]&&_0x2717e8[_0x135c('0x3b')][_0x135c('0x6a')][_0x135c('0x6b')]()===_0x135c('0x6c')?!![]:![];return _0x3911cb['createRouting'](_0x1745d5,_0x58d9f7);})[_0x135c('0x26')](function(_0x2137b1){return db[_0x135c('0x38')]['bulkCreate'](_0x2137b1,{'transaction':_0x56d94f});});})[_0x135c('0x26')](function(){return db[_0x135c('0x38')][_0x135c('0x6d')]({'where':{'isApp':!![],'VoiceExtensionId':_0x2717e8['params']['id']},'order':_0x135c('0x6e')});});}})['then'](respondWithResult(_0x5b0cab,null))[_0x135c('0x4b')](handleError(_0x5b0cab,null));}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index 943ae84..7695304 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 _0xe87d=['setMaxListeners','save','update','emit','hasOwnProperty','exports','events','../../mysqldb','VoiceExtension'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xe87d,0x189));var _0xde87=function(_0x4fc904,_0x3a5094){_0x4fc904=_0x4fc904-0x0;var _0xe63df=_0xe87d[_0x4fc904];return _0xe63df;};'use strict';var EventEmitter=require(_0xde87('0x0'));var VoiceExtension=require(_0xde87('0x1'))['db'][_0xde87('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xde87('0x3')](0x0);var events={'afterCreate':_0xde87('0x4'),'afterUpdate':_0xde87('0x5'),'afterDestroy':'remove'};function emitEvent(_0x4a8893){return function(_0x57789f,_0x53cdae,_0xad53b6){VoiceExtensionEvents[_0xde87('0x6')](_0x4a8893+':'+_0x57789f['id'],_0x57789f);VoiceExtensionEvents[_0xde87('0x6')](_0x4a8893,_0x57789f);_0xad53b6(null);};}for(var e in events){if(events[_0xde87('0x7')](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module[_0xde87('0x8')]=VoiceExtensionEvents; \ No newline at end of file +var _0x4e27=['../../mysqldb','VoiceExtension','setMaxListeners','update','emit','hasOwnProperty','hook','events'];(function(_0x2de620,_0x52dadb){var _0x5b076d=function(_0x4a9e75){while(--_0x4a9e75){_0x2de620['push'](_0x2de620['shift']());}};_0x5b076d(++_0x52dadb);}(_0x4e27,0x8f));var _0x74e2=function(_0x3f35c3,_0x6c0782){_0x3f35c3=_0x3f35c3-0x0;var _0x4f7752=_0x4e27[_0x3f35c3];return _0x4f7752;};'use strict';var EventEmitter=require(_0x74e2('0x0'));var VoiceExtension=require(_0x74e2('0x1'))['db'][_0x74e2('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x74e2('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x74e2('0x4'),'afterDestroy':'remove'};function emitEvent(_0x534a52){return function(_0x33b9e6,_0x1c1401,_0x230bb7){VoiceExtensionEvents[_0x74e2('0x5')](_0x534a52+':'+_0x33b9e6['id'],_0x33b9e6);VoiceExtensionEvents[_0x74e2('0x5')](_0x534a52,_0x33b9e6);_0x230bb7(null);};}for(var e in events){if(events[_0x74e2('0x6')](e)){var event=events[e];VoiceExtension[_0x74e2('0x7')](e,emitEvent(event));}}module['exports']=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index 0f511e2..7919d51 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 _0xb257=['appdata','last','concat','priority','catch','define','VoiceExtension','voice_extensions','then','Hangup','util','lodash','./voiceExtension.attributes','type','Set','context','alias','NoOp','CDR(routeAlias)=','No\x20alias\x20set','exten','inbound','push','CDR(routeid)=','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','CDR(destination)=','cutdigits','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','trunk','timeout','url','length','name','param','split','phone','prefix','${EXTEN:','SIP','join','options','U(xcally-mixmonitor-context)','replace','isEmpty','Interval','findAll','IntervalId','interval','map','filter','toLowerCase','tag','CDR(tag)=','intervals','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','Set(CALLERID(all)=','callerID','answer','playback','includes','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','outboundDial'];(function(_0x29e69d,_0x58f663){var _0x42d037=function(_0x33dc1f){while(--_0x33dc1f){_0x29e69d['push'](_0x29e69d['shift']());}};_0x42d037(++_0x58f663);}(_0xb257,0x152));var _0x7b25=function(_0x3936a6,_0x3f33ca){_0x3936a6=_0x3936a6-0x0;var _0x26f784=_0xb257[_0x3936a6];return _0x26f784;};'use strict';var util=require(_0x7b25('0x0'));var _=require(_0x7b25('0x1'));var attributes=require(_0x7b25('0x2'));module['exports']=function(_0x543333){var _0x27ba50=_0x543333['models'];function _0x8dc77c(_0x2fceb1){var _0x5da866=0x2;var _0x10b352=[{'type':_0x2fceb1[_0x7b25('0x3')],'app':_0x7b25('0x4'),'appdata':'CDR(type)='+_0x2fceb1['type'],'context':_0x2fceb1[_0x7b25('0x5')],'exten':_0x2fceb1['exten'],'priority':_0x5da866++,'VoiceExtensionId':_0x2fceb1['id']},{'type':_0x2fceb1[_0x7b25('0x3')],'app':_0x2fceb1[_0x7b25('0x6')]?_0x7b25('0x4'):_0x7b25('0x7'),'appdata':_0x2fceb1['alias']?_0x7b25('0x8')+_0x2fceb1[_0x7b25('0x6')]:_0x7b25('0x9'),'context':_0x2fceb1[_0x7b25('0x5')],'exten':_0x2fceb1[_0x7b25('0xa')],'priority':_0x5da866++,'VoiceExtensionId':_0x2fceb1['id']}];if(_0x2fceb1[_0x7b25('0x3')]===_0x7b25('0xb')){_0x10b352[_0x7b25('0xc')]({'type':_0x7b25('0xb'),'app':_0x7b25('0x4'),'appdata':_0x7b25('0xd')+_0x2fceb1['id'],'context':_0x2fceb1[_0x7b25('0x5')],'exten':_0x2fceb1[_0x7b25('0xa')],'priority':_0x5da866++,'VoiceExtensionId':_0x2fceb1['id']});}_0x10b352[_0x7b25('0xc')]({'type':_0x2fceb1[_0x7b25('0x3')],'app':_0x7b25('0x4'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x2fceb1['context'],'exten':_0x2fceb1[_0x7b25('0xa')],'priority':_0x5da866++,'VoiceExtensionId':_0x2fceb1['id']},{'type':_0x2fceb1[_0x7b25('0x3')],'app':_0x7b25('0x4'),'appdata':_0x7b25('0xe'),'context':_0x2fceb1['context'],'exten':_0x2fceb1[_0x7b25('0xa')],'priority':_0x5da866++,'VoiceExtensionId':_0x2fceb1['id']},{'type':_0x2fceb1['type'],'app':_0x7b25('0x4'),'appdata':_0x7b25('0xf'),'context':_0x2fceb1[_0x7b25('0x5')],'exten':_0x2fceb1['exten'],'priority':_0x5da866++,'VoiceExtensionId':_0x2fceb1['id']});return _0x10b352;}function _0x19808a(_0x1f7e74){var _0x284e91=0x2;var _0x5e54ee=[{'type':_0x7b25('0x10'),'app':_0x7b25('0x4'),'appdata':_0x7b25('0x11'),'context':_0x1f7e74[_0x7b25('0x5')],'exten':_0x1f7e74[_0x7b25('0xa')],'priority':_0x284e91++,'VoiceExtensionId':_0x1f7e74['id']},{'type':'outbound','app':_0x1f7e74[_0x7b25('0x6')]?_0x7b25('0x4'):'NoOp','appdata':_0x1f7e74['alias']?_0x7b25('0x8')+_0x1f7e74[_0x7b25('0x6')]:_0x7b25('0x9'),'context':_0x1f7e74[_0x7b25('0x5')],'exten':_0x1f7e74['exten'],'priority':_0x284e91++,'VoiceExtensionId':_0x1f7e74['id']},{'type':_0x7b25('0x10'),'app':'Set','appdata':_0x7b25('0x12')+(_0x1f7e74['cutdigits']?'${EXTEN:'+_0x1f7e74[_0x7b25('0x13')]+'}':_0x7b25('0x14')),'context':_0x1f7e74[_0x7b25('0x5')],'exten':_0x1f7e74[_0x7b25('0xa')],'priority':_0x284e91++,'VoiceExtensionId':_0x1f7e74['id']},{'type':_0x7b25('0x10'),'app':'Set','appdata':_0x7b25('0xd')+_0x1f7e74['id'],'context':_0x1f7e74[_0x7b25('0x5')],'exten':_0x1f7e74['exten'],'priority':_0x284e91++,'VoiceExtensionId':_0x1f7e74['id']},{'type':_0x7b25('0x10'),'app':_0x7b25('0x15'),'appdata':_0x7b25('0x16')+(_0x284e91+0x2)+_0x7b25('0x17')+(_0x284e91+0x1)+')','context':_0x1f7e74[_0x7b25('0x5')],'exten':_0x1f7e74[_0x7b25('0xa')],'priority':_0x284e91++,'VoiceExtensionId':_0x1f7e74['id']},{'type':_0x7b25('0x10'),'app':'Set','appdata':_0x1f7e74[_0x7b25('0x13')]?'CDR(prefix)=${EXTEN:0:'+_0x1f7e74['cutdigits']+'}':'CDR(prefix)=noprefix','context':_0x1f7e74[_0x7b25('0x5')],'exten':_0x1f7e74['exten'],'priority':_0x284e91++,'VoiceExtensionId':_0x1f7e74['id']},{'type':_0x7b25('0x10'),'app':_0x7b25('0x4'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x1f7e74[_0x7b25('0x5')],'exten':_0x1f7e74[_0x7b25('0xa')],'priority':_0x284e91++,'VoiceExtensionId':_0x1f7e74['id']},{'type':_0x7b25('0x10'),'app':_0x7b25('0x4'),'appdata':_0x7b25('0xe'),'context':_0x1f7e74[_0x7b25('0x5')],'exten':_0x1f7e74['exten'],'priority':_0x284e91++,'VoiceExtensionId':_0x1f7e74['id']},{'type':'outbound','app':'Set','appdata':_0x7b25('0xf'),'context':_0x1f7e74[_0x7b25('0x5')],'exten':_0x1f7e74['exten'],'priority':_0x284e91++,'VoiceExtensionId':_0x1f7e74['id']},{'type':_0x7b25('0x10'),'app':'Set','appdata':_0x7b25('0x18')+_0x1f7e74['id'],'context':_0x1f7e74[_0x7b25('0x5')],'exten':_0x1f7e74['exten'],'priority':_0x284e91++,'VoiceExtensionId':_0x1f7e74['id']}];if(_0x1f7e74[_0x7b25('0x19')](_0x7b25('0x1a'))&&_0x1f7e74[_0x7b25('0x1a')]!==_0x7b25('0x1b')){_0x5e54ee[_0x7b25('0xc')]({'type':_0x7b25('0x10'),'app':_0x7b25('0x4'),'appdata':_0x7b25('0x1c'),'context':_0x1f7e74[_0x7b25('0x5')],'exten':_0x1f7e74[_0x7b25('0xa')],'priority':_0x284e91++,'VoiceExtensionId':_0x1f7e74['id']},{'type':_0x7b25('0x10'),'app':_0x7b25('0x4'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x1f7e74[_0x7b25('0x1a')]||'wav','context':_0x1f7e74[_0x7b25('0x5')],'exten':_0x1f7e74[_0x7b25('0xa')],'priority':_0x284e91++,'VoiceExtensionId':_0x1f7e74['id']});}return _0x5e54ee;}function _0x15b2a8(_0xd42562){var _0x3f2013=[{'name':_0x7b25('0x1d'),'param':0x0},{'name':_0x7b25('0x1e'),'param':0x1},{'name':'options','param':0x2},{'name':_0x7b25('0x1f'),'param':0x3}];var _0x39d2ff={};var _0x470018=_0xd42562['split'](',');var _0x1a2cb0=[];for(var _0x3313c6=0x0;_0x3313c6<_0x3f2013[_0x7b25('0x20')];_0x3313c6++){switch(_0x3f2013[_0x3313c6][_0x7b25('0x21')]){case _0x7b25('0x1d'):_0x39d2ff['trunk']=_0x470018[_0x3f2013[_0x3313c6][_0x7b25('0x22')]][_0x7b25('0x23')]('/')[0x1];_0x39d2ff[_0x7b25('0x24')]=_0x470018[_0x3f2013[_0x3313c6]['param']][_0x7b25('0x23')]('/')[0x2];_0x39d2ff[_0x7b25('0x25')]=_0x39d2ff[_0x7b25('0x24')]?_0x39d2ff[_0x7b25('0x24')][_0x7b25('0x23')]('$')[0x0]:undefined;_0x39d2ff[_0x7b25('0x24')]=route[_0x7b25('0x13')]?(_0x39d2ff[_0x7b25('0x25')]||'')+_0x7b25('0x26')+route[_0x7b25('0x13')]+'}':(_0x39d2ff[_0x7b25('0x25')]||'')+_0x7b25('0x14');_0x1a2cb0[_0x3f2013[_0x3313c6][_0x7b25('0x22')]]=[_0x7b25('0x27'),_0x39d2ff[_0x7b25('0x1d')],_0x39d2ff[_0x7b25('0x24')]][_0x7b25('0x28')]('/');break;case _0x7b25('0x29'):_0x39d2ff[_0x7b25('0x29')]=_0x470018[_0x3f2013[_0x3313c6][_0x7b25('0x22')]];if(route[_0x7b25('0x1a')]!==_0x7b25('0x1b')){if(_0x39d2ff[_0x7b25('0x29')]['indexOf'](_0x7b25('0x2a'))<0x0){_0x39d2ff[_0x7b25('0x29')]+=_0x7b25('0x2a');}}else{_0x39d2ff[_0x7b25('0x29')]=_0x39d2ff['options'][_0x7b25('0x2b')](_0x7b25('0x2a'),'');}_0x1a2cb0[_0x3f2013[_0x3313c6][_0x7b25('0x22')]]=_0x39d2ff['options'];break;default:_0x1a2cb0[_0x3f2013[_0x3313c6][_0x7b25('0x22')]]=_0x470018[_0x3f2013[_0x3313c6]['param']];}}return _0x1a2cb0[_0x7b25('0x28')](',');}function _0x4ef618(_0x2aef73,_0x2c9cd2,_0x40708c,_0x220780){return new Promise(function(_0x4b1d6e,_0xf5edec){var _0x46c6cd=[];if(_[_0x7b25('0x2c')](_0x2c9cd2))return _0x4b1d6e(_0x46c6cd);_0x27ba50[_0x7b25('0x2d')][_0x7b25('0x2e')]({'attributes':['id','interval',_0x7b25('0x2f')],'raw':!![]})['then'](function(_0x31209c){for(var _0x45d705=0x0,_0x35ad4a=0x0;_0x45d705<_0x2c9cd2[_0x7b25('0x20')];_0x45d705++,_0x35ad4a=0x0){var _0x12c1eb=_0x2c9cd2[_0x45d705];var _0x1137e1=[];var _0x217c4c=[];if(_0x12c1eb[_0x7b25('0x30')]!=='*,*,*,*'){_0x12c1eb['intervals']=[_0x12c1eb[_0x7b25('0x30')]];}else{_0x12c1eb['intervals']=_0x12c1eb[_0x7b25('0x2f')]?_[_0x7b25('0x31')](_[_0x7b25('0x32')](_0x31209c,{'IntervalId':_0x12c1eb[_0x7b25('0x2f')]}),'interval'):[];}_0x12c1eb[_0x7b25('0x5')]=_0x2aef73['context'];_0x12c1eb[_0x7b25('0xa')]=_0x2aef73[_0x7b25('0xa')];if(_0x12c1eb['type'])_0x12c1eb[_0x7b25('0x3')]=_0x12c1eb[_0x7b25('0x3')][_0x7b25('0x33')]();if(_0x2aef73[_0x7b25('0x3')]==='outbound'){if(_0x12c1eb[_0x7b25('0x19')](_0x7b25('0x34'))&&_0x12c1eb[_0x7b25('0x34')]&&_0x12c1eb['tag']!=='--'){_0x1137e1['push']({'type':_0x12c1eb[_0x7b25('0x3')][_0x7b25('0x33')](),'app':_0x7b25('0x4'),'appdata':_0x7b25('0x35')+_0x12c1eb[_0x7b25('0x34')],'context':_0x2aef73['context'],'exten':_0x2aef73[_0x7b25('0xa')],'priority':_0x12c1eb[_0x7b25('0x36')][_0x7b25('0x20')]+_0x40708c+_0x35ad4a++,'VoiceExtensionId':_0x2aef73['id']});}_0x1137e1[_0x7b25('0xc')]({'type':_0x12c1eb[_0x7b25('0x3')][_0x7b25('0x33')](),'app':_0x7b25('0x15'),'appdata':_0x7b25('0x37')+(_0x12c1eb['callerID']?_0x7b25('0x38')+_0x12c1eb[_0x7b25('0x39')]+')':'NoOp(No\x20number\x20available)'),'context':_0x2aef73[_0x7b25('0x5')],'exten':_0x2aef73[_0x7b25('0xa')],'priority':_0x12c1eb['intervals'][_0x7b25('0x20')]+_0x40708c+_0x35ad4a++,'VoiceExtensionId':_0x2aef73['id']});}else{if(_0x12c1eb['hasOwnProperty'](_0x7b25('0x3a'))){if(['queue',_0x7b25('0x3b')][_0x7b25('0x3c')](_0x12c1eb[_0x7b25('0x3d')][_0x7b25('0x33')]())&&_0x12c1eb[_0x7b25('0x3e')]!==_0x7b25('0x3f')){if(_0x12c1eb['answer']){_0x1137e1['push']({'type':_0x12c1eb[_0x7b25('0x3')][_0x7b25('0x33')](),'app':_0x7b25('0x15'),'appdata':_0x7b25('0x40'),'context':_0x2aef73[_0x7b25('0x5')],'exten':_0x2aef73[_0x7b25('0xa')],'priority':_0x12c1eb['intervals']['length']+_0x40708c+_0x35ad4a++,'VoiceExtensionId':_0x2aef73['id']});_0x1137e1[_0x7b25('0xc')]({'type':_0x12c1eb['type']['toLowerCase'](),'app':'Set','appdata':_0x7b25('0x41'),'context':_0x2aef73[_0x7b25('0x5')],'exten':_0x2aef73[_0x7b25('0xa')],'priority':_0x12c1eb[_0x7b25('0x36')][_0x7b25('0x20')]+_0x40708c+_0x35ad4a++,'VoiceExtensionId':_0x2aef73['id']});}else{_0x1137e1[_0x7b25('0xc')]({'type':_0x12c1eb[_0x7b25('0x3')]['toLowerCase'](),'app':_0x7b25('0x15'),'appdata':_0x7b25('0x42'),'context':_0x2aef73['context'],'exten':_0x2aef73['exten'],'priority':_0x12c1eb[_0x7b25('0x36')]['length']+_0x40708c+_0x35ad4a++,'VoiceExtensionId':_0x2aef73['id']});_0x1137e1['push']({'type':_0x12c1eb[_0x7b25('0x3')][_0x7b25('0x33')](),'app':_0x7b25('0x4'),'appdata':_0x7b25('0x43'),'context':_0x2aef73[_0x7b25('0x5')],'exten':_0x2aef73[_0x7b25('0xa')],'priority':_0x12c1eb[_0x7b25('0x36')]['length']+_0x40708c+_0x35ad4a++,'VoiceExtensionId':_0x2aef73['id']});}}}}for(var _0x2f6368=0x0;_0x2f6368<_0x12c1eb[_0x7b25('0x36')]['length'];_0x2f6368++){var _0x459610=_0x40708c+_0x12c1eb[_0x7b25('0x36')][_0x7b25('0x20')];var _0x54cff7=_0x2f6368===_0x12c1eb[_0x7b25('0x36')]['length']-0x1?_0x40708c+_0x1137e1[_0x7b25('0x20')]+_0x217c4c[_0x7b25('0x20')]+0x2:_0x40708c+_0x2f6368+0x1;_0x1137e1[_0x7b25('0x44')](_0x2f6368,0x0,{'type':_0x2aef73[_0x7b25('0x3')],'app':_0x7b25('0x45'),'appdata':_0x12c1eb['intervals'][_0x2f6368]+'?'+_0x2aef73[_0x7b25('0x5')]+_0x7b25('0x46')+_0x459610+':'+_0x2aef73[_0x7b25('0x5')]+_0x7b25('0x46')+_0x54cff7,'exten':_0x2aef73[_0x7b25('0xa')],'context':_0x2aef73[_0x7b25('0x5')],'priority':_0x40708c+_0x2f6368,'VoiceExtensionId':_0x2aef73['id']});}if(_0x220780&&_0x12c1eb[_0x7b25('0x3e')]===_0x7b25('0x47'))_0x12c1eb['appdata']=_0x15b2a8(_0x12c1eb[_0x7b25('0x48')]);_0x12c1eb['priority']=_0x1137e1[_0x7b25('0x20')]?_[_0x7b25('0x49')](_0x1137e1)['priority']+0x1:_0x40708c;_0x46c6cd=_[_0x7b25('0x4a')](_0x46c6cd,_0x1137e1,[_0x12c1eb],_0x217c4c);_0x40708c=_[_0x7b25('0x49')](_0x46c6cd)[_0x7b25('0x4b')]+0x1;}return _0x4b1d6e(_0x46c6cd);})[_0x7b25('0x4c')](function(_0xf6bb0f){_0xf5edec(_0xf6bb0f);});});}return _0x543333[_0x7b25('0x4d')](_0x7b25('0x4e'),attributes,{'tableName':_0x7b25('0x4f'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x56ee78,_0x20123d){var _0x2962eb=this;var _0x16ee91=_0x2962eb['type']===_0x7b25('0x10')?_0x19808a(_0x2962eb):_0x8dc77c(_0x2962eb);return _0x4ef618(_0x2962eb,_0x56ee78,_[_0x7b25('0x49')](_0x16ee91)[_0x7b25('0x4b')]+0x1,_0x20123d)[_0x7b25('0x50')](function(_0x3b39fb){var _0x1eac2f=_[_0x7b25('0x4a')](_0x16ee91,_0x3b39fb);_0x1eac2f[_0x7b25('0xc')]({'type':_0x2962eb[_0x7b25('0x3')],'app':_0x7b25('0x51'),'exten':_0x2962eb[_0x7b25('0xa')],'context':_0x2962eb[_0x7b25('0x5')],'priority':_[_0x7b25('0x49')](_0x1eac2f)['priority']+0x1,'VoiceExtensionId':_0x2962eb['id']});return _0x1eac2f;});}}});}; \ No newline at end of file +var _0xaf95=['length','name','param','split','phone','prefix','SIP','join','options','indexOf','U(xcally-mixmonitor-context)','isEmpty','Interval','findAll','interval','IntervalId','then','*,*,*,*','intervals','map','filter','toLowerCase','tag','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','answer','queue','playback','includes','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice',',${EXTEN},','outboundDial','appdata','priority','last','concat','catch','define','Hangup','util','lodash','exports','models','type','Set','context','exten','alias','NoOp','CDR(routeAlias)=','No\x20alias\x20set','inbound','push','XCALLY-MOTION-ANSWER=0','outbound','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','trunk','timeout','url'];(function(_0x1d80be,_0x3a60ff){var _0xf9a4f3=function(_0x5b8a08){while(--_0x5b8a08){_0x1d80be['push'](_0x1d80be['shift']());}};_0xf9a4f3(++_0x3a60ff);}(_0xaf95,0x17c));var _0x5af9=function(_0xb433ae,_0x1dbc0f){_0xb433ae=_0xb433ae-0x0;var _0x3e11f9=_0xaf95[_0xb433ae];return _0x3e11f9;};'use strict';var util=require(_0x5af9('0x0'));var _=require(_0x5af9('0x1'));var attributes=require('./voiceExtension.attributes');module[_0x5af9('0x2')]=function(_0x3582b1){var _0x28ff98=_0x3582b1[_0x5af9('0x3')];function _0x1d57da(_0x1a2712){var _0x189c75=0x2;var _0x388d5b=[{'type':_0x1a2712[_0x5af9('0x4')],'app':_0x5af9('0x5'),'appdata':'CDR(type)='+_0x1a2712[_0x5af9('0x4')],'context':_0x1a2712[_0x5af9('0x6')],'exten':_0x1a2712[_0x5af9('0x7')],'priority':_0x189c75++,'VoiceExtensionId':_0x1a2712['id']},{'type':_0x1a2712[_0x5af9('0x4')],'app':_0x1a2712[_0x5af9('0x8')]?_0x5af9('0x5'):_0x5af9('0x9'),'appdata':_0x1a2712[_0x5af9('0x8')]?_0x5af9('0xa')+_0x1a2712[_0x5af9('0x8')]:_0x5af9('0xb'),'context':_0x1a2712[_0x5af9('0x6')],'exten':_0x1a2712[_0x5af9('0x7')],'priority':_0x189c75++,'VoiceExtensionId':_0x1a2712['id']}];if(_0x1a2712['type']===_0x5af9('0xc')){_0x388d5b[_0x5af9('0xd')]({'type':_0x5af9('0xc'),'app':_0x5af9('0x5'),'appdata':'CDR(routeid)='+_0x1a2712['id'],'context':_0x1a2712[_0x5af9('0x6')],'exten':_0x1a2712[_0x5af9('0x7')],'priority':_0x189c75++,'VoiceExtensionId':_0x1a2712['id']});}_0x388d5b[_0x5af9('0xd')]({'type':_0x1a2712[_0x5af9('0x4')],'app':_0x5af9('0x5'),'appdata':_0x5af9('0xe'),'context':_0x1a2712['context'],'exten':_0x1a2712[_0x5af9('0x7')],'priority':_0x189c75++,'VoiceExtensionId':_0x1a2712['id']},{'type':_0x1a2712['type'],'app':_0x5af9('0x5'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x1a2712[_0x5af9('0x6')],'exten':_0x1a2712[_0x5af9('0x7')],'priority':_0x189c75++,'VoiceExtensionId':_0x1a2712['id']},{'type':_0x1a2712[_0x5af9('0x4')],'app':'Set','appdata':'MONITOR_OPTIONS=ab','context':_0x1a2712[_0x5af9('0x6')],'exten':_0x1a2712['exten'],'priority':_0x189c75++,'VoiceExtensionId':_0x1a2712['id']});return _0x388d5b;}function _0x2e53ff(_0x2cdb86){var _0x2ae4b3=0x2;var _0x330ce0=[{'type':_0x5af9('0xf'),'app':_0x5af9('0x5'),'appdata':'CDR(type)=outbound','context':_0x2cdb86['context'],'exten':_0x2cdb86[_0x5af9('0x7')],'priority':_0x2ae4b3++,'VoiceExtensionId':_0x2cdb86['id']},{'type':'outbound','app':_0x2cdb86[_0x5af9('0x8')]?_0x5af9('0x5'):_0x5af9('0x9'),'appdata':_0x2cdb86[_0x5af9('0x8')]?_0x5af9('0xa')+_0x2cdb86['alias']:_0x5af9('0xb'),'context':_0x2cdb86[_0x5af9('0x6')],'exten':_0x2cdb86[_0x5af9('0x7')],'priority':_0x2ae4b3++,'VoiceExtensionId':_0x2cdb86['id']},{'type':_0x5af9('0xf'),'app':'Set','appdata':_0x5af9('0x10')+(_0x2cdb86[_0x5af9('0x11')]?_0x5af9('0x12')+_0x2cdb86['cutdigits']+'}':_0x5af9('0x13')),'context':_0x2cdb86[_0x5af9('0x6')],'exten':_0x2cdb86['exten'],'priority':_0x2ae4b3++,'VoiceExtensionId':_0x2cdb86['id']},{'type':_0x5af9('0xf'),'app':_0x5af9('0x5'),'appdata':'CDR(routeid)='+_0x2cdb86['id'],'context':_0x2cdb86['context'],'exten':_0x2cdb86[_0x5af9('0x7')],'priority':_0x2ae4b3++,'VoiceExtensionId':_0x2cdb86['id']},{'type':_0x5af9('0xf'),'app':_0x5af9('0x14'),'appdata':_0x5af9('0x15')+(_0x2ae4b3+0x2)+'):Goto('+(_0x2ae4b3+0x1)+')','context':_0x2cdb86[_0x5af9('0x6')],'exten':_0x2cdb86[_0x5af9('0x7')],'priority':_0x2ae4b3++,'VoiceExtensionId':_0x2cdb86['id']},{'type':_0x5af9('0xf'),'app':_0x5af9('0x5'),'appdata':_0x2cdb86['cutdigits']?_0x5af9('0x16')+_0x2cdb86['cutdigits']+'}':_0x5af9('0x17'),'context':_0x2cdb86[_0x5af9('0x6')],'exten':_0x2cdb86[_0x5af9('0x7')],'priority':_0x2ae4b3++,'VoiceExtensionId':_0x2cdb86['id']},{'type':_0x5af9('0xf'),'app':'Set','appdata':_0x5af9('0xe'),'context':_0x2cdb86[_0x5af9('0x6')],'exten':_0x2cdb86['exten'],'priority':_0x2ae4b3++,'VoiceExtensionId':_0x2cdb86['id']},{'type':_0x5af9('0xf'),'app':_0x5af9('0x5'),'appdata':_0x5af9('0x18'),'context':_0x2cdb86[_0x5af9('0x6')],'exten':_0x2cdb86['exten'],'priority':_0x2ae4b3++,'VoiceExtensionId':_0x2cdb86['id']},{'type':'outbound','app':_0x5af9('0x5'),'appdata':_0x5af9('0x19'),'context':_0x2cdb86[_0x5af9('0x6')],'exten':_0x2cdb86['exten'],'priority':_0x2ae4b3++,'VoiceExtensionId':_0x2cdb86['id']},{'type':_0x5af9('0xf'),'app':_0x5af9('0x5'),'appdata':_0x5af9('0x1a')+_0x2cdb86['id'],'context':_0x2cdb86[_0x5af9('0x6')],'exten':_0x2cdb86['exten'],'priority':_0x2ae4b3++,'VoiceExtensionId':_0x2cdb86['id']}];if(_0x2cdb86[_0x5af9('0x1b')](_0x5af9('0x1c'))&&_0x2cdb86[_0x5af9('0x1c')]!==_0x5af9('0x1d')){_0x330ce0[_0x5af9('0xd')]({'type':_0x5af9('0xf'),'app':_0x5af9('0x5'),'appdata':_0x5af9('0x1e'),'context':_0x2cdb86[_0x5af9('0x6')],'exten':_0x2cdb86[_0x5af9('0x7')],'priority':_0x2ae4b3++,'VoiceExtensionId':_0x2cdb86['id']},{'type':'outbound','app':_0x5af9('0x5'),'appdata':_0x5af9('0x1f')+_0x2cdb86[_0x5af9('0x1c')]||'wav','context':_0x2cdb86[_0x5af9('0x6')],'exten':_0x2cdb86[_0x5af9('0x7')],'priority':_0x2ae4b3++,'VoiceExtensionId':_0x2cdb86['id']});}return _0x330ce0;}function _0x5b7b97(_0x2f28f8){var _0x4ce2ac=[{'name':_0x5af9('0x20'),'param':0x0},{'name':_0x5af9('0x21'),'param':0x1},{'name':'options','param':0x2},{'name':_0x5af9('0x22'),'param':0x3}];var _0xec0e8c={};var _0x14f196=_0x2f28f8['split'](',');var _0x36b49b=[];for(var _0x37f01d=0x0;_0x37f01d<_0x4ce2ac[_0x5af9('0x23')];_0x37f01d++){switch(_0x4ce2ac[_0x37f01d][_0x5af9('0x24')]){case'trunk':_0xec0e8c[_0x5af9('0x20')]=_0x14f196[_0x4ce2ac[_0x37f01d][_0x5af9('0x25')]][_0x5af9('0x26')]('/')[0x1];_0xec0e8c[_0x5af9('0x27')]=_0x14f196[_0x4ce2ac[_0x37f01d][_0x5af9('0x25')]][_0x5af9('0x26')]('/')[0x2];_0xec0e8c[_0x5af9('0x28')]=_0xec0e8c[_0x5af9('0x27')]?_0xec0e8c[_0x5af9('0x27')]['split']('$')[0x0]:undefined;_0xec0e8c[_0x5af9('0x27')]=route[_0x5af9('0x11')]?(_0xec0e8c[_0x5af9('0x28')]||'')+_0x5af9('0x12')+route['cutdigits']+'}':(_0xec0e8c[_0x5af9('0x28')]||'')+_0x5af9('0x13');_0x36b49b[_0x4ce2ac[_0x37f01d][_0x5af9('0x25')]]=[_0x5af9('0x29'),_0xec0e8c[_0x5af9('0x20')],_0xec0e8c[_0x5af9('0x27')]][_0x5af9('0x2a')]('/');break;case _0x5af9('0x2b'):_0xec0e8c[_0x5af9('0x2b')]=_0x14f196[_0x4ce2ac[_0x37f01d][_0x5af9('0x25')]];if(route[_0x5af9('0x1c')]!==_0x5af9('0x1d')){if(_0xec0e8c['options'][_0x5af9('0x2c')]('U(xcally-mixmonitor-context)')<0x0){_0xec0e8c[_0x5af9('0x2b')]+=_0x5af9('0x2d');}}else{_0xec0e8c[_0x5af9('0x2b')]=_0xec0e8c[_0x5af9('0x2b')]['replace']('U(xcally-mixmonitor-context)','');}_0x36b49b[_0x4ce2ac[_0x37f01d][_0x5af9('0x25')]]=_0xec0e8c[_0x5af9('0x2b')];break;default:_0x36b49b[_0x4ce2ac[_0x37f01d][_0x5af9('0x25')]]=_0x14f196[_0x4ce2ac[_0x37f01d][_0x5af9('0x25')]];}}return _0x36b49b[_0x5af9('0x2a')](',');}function _0x10717d(_0x120a6c,_0x321ef8,_0x24812c,_0x2e1296){return new Promise(function(_0x58f275,_0x33a9ce){var _0x62af83=[];if(_[_0x5af9('0x2e')](_0x321ef8))return _0x58f275(_0x62af83);_0x28ff98[_0x5af9('0x2f')][_0x5af9('0x30')]({'attributes':['id',_0x5af9('0x31'),_0x5af9('0x32')],'raw':!![]})[_0x5af9('0x33')](function(_0x5ac855){for(var _0x1b157e=0x0,_0x1c6aba=0x0;_0x1b157e<_0x321ef8['length'];_0x1b157e++,_0x1c6aba=0x0){var _0x4c87d7=_0x321ef8[_0x1b157e];var _0x353f99=[];var _0x497e5f=[];if(_0x4c87d7[_0x5af9('0x31')]!==_0x5af9('0x34')){_0x4c87d7[_0x5af9('0x35')]=[_0x4c87d7[_0x5af9('0x31')]];}else{_0x4c87d7[_0x5af9('0x35')]=_0x4c87d7[_0x5af9('0x32')]?_[_0x5af9('0x36')](_[_0x5af9('0x37')](_0x5ac855,{'IntervalId':_0x4c87d7[_0x5af9('0x32')]}),_0x5af9('0x31')):[];}_0x4c87d7[_0x5af9('0x6')]=_0x120a6c['context'];_0x4c87d7[_0x5af9('0x7')]=_0x120a6c[_0x5af9('0x7')];if(_0x4c87d7['type'])_0x4c87d7['type']=_0x4c87d7[_0x5af9('0x4')][_0x5af9('0x38')]();if(_0x120a6c[_0x5af9('0x4')]===_0x5af9('0xf')){if(_0x4c87d7['hasOwnProperty'](_0x5af9('0x39'))&&_0x4c87d7[_0x5af9('0x39')]&&_0x4c87d7[_0x5af9('0x39')]!=='--'){_0x353f99[_0x5af9('0xd')]({'type':_0x4c87d7[_0x5af9('0x4')][_0x5af9('0x38')](),'app':_0x5af9('0x5'),'appdata':_0x5af9('0x3a')+_0x4c87d7[_0x5af9('0x39')],'context':_0x120a6c[_0x5af9('0x6')],'exten':_0x120a6c['exten'],'priority':_0x4c87d7['intervals']['length']+_0x24812c+_0x1c6aba++,'VoiceExtensionId':_0x120a6c['id']});}_0x353f99[_0x5af9('0xd')]({'type':_0x4c87d7[_0x5af9('0x4')][_0x5af9('0x38')](),'app':_0x5af9('0x14'),'appdata':_0x5af9('0x3b')+(_0x4c87d7['callerID']?_0x5af9('0x3c')+_0x4c87d7['callerID']+')':_0x5af9('0x3d')),'context':_0x120a6c[_0x5af9('0x6')],'exten':_0x120a6c[_0x5af9('0x7')],'priority':_0x4c87d7[_0x5af9('0x35')][_0x5af9('0x23')]+_0x24812c+_0x1c6aba++,'VoiceExtensionId':_0x120a6c['id']});}else{if(_0x4c87d7[_0x5af9('0x1b')](_0x5af9('0x3e'))){if([_0x5af9('0x3f'),_0x5af9('0x40')][_0x5af9('0x41')](_0x4c87d7[_0x5af9('0x42')][_0x5af9('0x38')]())&&_0x4c87d7[_0x5af9('0x43')]!==_0x5af9('0x44')){if(_0x4c87d7[_0x5af9('0x3e')]){_0x353f99['push']({'type':_0x4c87d7[_0x5af9('0x4')][_0x5af9('0x38')](),'app':_0x5af9('0x14'),'appdata':_0x5af9('0x45'),'context':_0x120a6c[_0x5af9('0x6')],'exten':_0x120a6c['exten'],'priority':_0x4c87d7[_0x5af9('0x35')][_0x5af9('0x23')]+_0x24812c+_0x1c6aba++,'VoiceExtensionId':_0x120a6c['id']});_0x353f99['push']({'type':_0x4c87d7[_0x5af9('0x4')][_0x5af9('0x38')](),'app':_0x5af9('0x5'),'appdata':_0x5af9('0x46'),'context':_0x120a6c[_0x5af9('0x6')],'exten':_0x120a6c['exten'],'priority':_0x4c87d7[_0x5af9('0x35')][_0x5af9('0x23')]+_0x24812c+_0x1c6aba++,'VoiceExtensionId':_0x120a6c['id']});}else{_0x353f99[_0x5af9('0xd')]({'type':_0x4c87d7[_0x5af9('0x4')][_0x5af9('0x38')](),'app':'ExecIf','appdata':_0x5af9('0x47'),'context':_0x120a6c[_0x5af9('0x6')],'exten':_0x120a6c[_0x5af9('0x7')],'priority':_0x4c87d7[_0x5af9('0x35')][_0x5af9('0x23')]+_0x24812c+_0x1c6aba++,'VoiceExtensionId':_0x120a6c['id']});_0x353f99[_0x5af9('0xd')]({'type':_0x4c87d7[_0x5af9('0x4')]['toLowerCase'](),'app':_0x5af9('0x5'),'appdata':_0x5af9('0x48'),'context':_0x120a6c[_0x5af9('0x6')],'exten':_0x120a6c['exten'],'priority':_0x4c87d7[_0x5af9('0x35')][_0x5af9('0x23')]+_0x24812c+_0x1c6aba++,'VoiceExtensionId':_0x120a6c['id']});}}}}for(var _0x244148=0x0;_0x244148<_0x4c87d7[_0x5af9('0x35')]['length'];_0x244148++){var _0x30f440=_0x24812c+_0x4c87d7[_0x5af9('0x35')][_0x5af9('0x23')];var _0x4134f0=_0x244148===_0x4c87d7[_0x5af9('0x35')][_0x5af9('0x23')]-0x1?_0x24812c+_0x353f99['length']+_0x497e5f[_0x5af9('0x23')]+0x2:_0x24812c+_0x244148+0x1;_0x353f99[_0x5af9('0x49')](_0x244148,0x0,{'type':_0x120a6c[_0x5af9('0x4')],'app':'GotoIfTime','appdata':_0x4c87d7['intervals'][_0x244148]+'?'+_0x120a6c[_0x5af9('0x6')]+_0x5af9('0x4a')+_0x30f440+':'+_0x120a6c[_0x5af9('0x6')]+_0x5af9('0x4a')+_0x4134f0,'exten':_0x120a6c[_0x5af9('0x7')],'context':_0x120a6c[_0x5af9('0x6')],'priority':_0x24812c+_0x244148,'VoiceExtensionId':_0x120a6c['id']});}if(_0x2e1296&&_0x4c87d7['appType']===_0x5af9('0x4b'))_0x4c87d7[_0x5af9('0x4c')]=_0x5b7b97(_0x4c87d7[_0x5af9('0x4c')]);_0x4c87d7[_0x5af9('0x4d')]=_0x353f99['length']?_[_0x5af9('0x4e')](_0x353f99)[_0x5af9('0x4d')]+0x1:_0x24812c;_0x62af83=_[_0x5af9('0x4f')](_0x62af83,_0x353f99,[_0x4c87d7],_0x497e5f);_0x24812c=_[_0x5af9('0x4e')](_0x62af83)[_0x5af9('0x4d')]+0x1;}return _0x58f275(_0x62af83);})[_0x5af9('0x50')](function(_0x3d895d){_0x33a9ce(_0x3d895d);});});}return _0x3582b1[_0x5af9('0x51')]('VoiceExtension',attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x205d75,_0x25ab48){var _0x135a6f=this;var _0x22917e=_0x135a6f['type']===_0x5af9('0xf')?_0x2e53ff(_0x135a6f):_0x1d57da(_0x135a6f);return _0x10717d(_0x135a6f,_0x205d75,_[_0x5af9('0x4e')](_0x22917e)['priority']+0x1,_0x25ab48)[_0x5af9('0x33')](function(_0x1b13ba){var _0x4de6f6=_[_0x5af9('0x4f')](_0x22917e,_0x1b13ba);_0x4de6f6[_0x5af9('0xd')]({'type':_0x135a6f['type'],'app':_0x5af9('0x52'),'exten':_0x135a6f[_0x5af9('0x7')],'context':_0x135a6f[_0x5af9('0x6')],'priority':_['last'](_0x4de6f6)[_0x5af9('0x4d')]+0x1,'VoiceExtensionId':_0x135a6f['id']});return _0x4de6f6;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index e450608..1b0fdd2 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 _0xa990=['result','GetVoiceExtension','VoiceExtension','options','raw','where','attributes','include','map','model','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','request','then','info','request\x20sent','debug','stringify','error','code','VoiceExtension,\x20%s,\x20%s','message'];(function(_0x4f90af,_0x14b70c){var _0x5e62c0=function(_0x4aa5b6){while(--_0x4aa5b6){_0x4f90af['push'](_0x4f90af['shift']());}};_0x5e62c0(++_0x14b70c);}(_0xa990,0xc9));var _0x0a99=function(_0xbd6b25,_0xee64f8){_0xbd6b25=_0xbd6b25-0x0;var _0x1fce11=_0xa990[_0xbd6b25];return _0x1fce11;};'use strict';var _=require(_0x0a99('0x0'));var util=require(_0x0a99('0x1'));var moment=require(_0x0a99('0x2'));var BPromise=require(_0x0a99('0x3'));var rs=require(_0x0a99('0x4'));var fs=require('fs');var Redis=require(_0x0a99('0x5'));var db=require(_0x0a99('0x6'))['db'];var utils=require(_0x0a99('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x0a99('0x8'));var jayson=require(_0x0a99('0x9'));var client=jayson[_0x0a99('0xa')][_0x0a99('0xb')]({'port':0x232a});config[_0x0a99('0xc')]=_[_0x0a99('0xd')](config[_0x0a99('0xc')],{'host':_0x0a99('0xe'),'port':0x18eb});var socket=require(_0x0a99('0xf'))(new Redis(config[_0x0a99('0xc')]));require(_0x0a99('0x10'))['register'](socket);function respondWithRpcPromise(_0x813e91,_0x38e89b,_0x5b5ec3){return new BPromise(function(_0x506582,_0x3561f2){return client[_0x0a99('0x11')](_0x813e91,_0x5b5ec3)[_0x0a99('0x12')](function(_0x30f427){logger[_0x0a99('0x13')]('VoiceExtension,\x20%s,\x20%s',_0x38e89b,_0x0a99('0x14'));logger[_0x0a99('0x15')]('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x38e89b,_0x0a99('0x14'),JSON[_0x0a99('0x16')](_0x30f427));if(_0x30f427[_0x0a99('0x17')]){if(_0x30f427[_0x0a99('0x17')][_0x0a99('0x18')]===0x1f4){logger[_0x0a99('0x17')](_0x0a99('0x19'),_0x38e89b,_0x30f427[_0x0a99('0x17')]['message']);return _0x3561f2(_0x30f427['error'][_0x0a99('0x1a')]);}logger[_0x0a99('0x17')](_0x0a99('0x19'),_0x38e89b,_0x30f427['error'][_0x0a99('0x1a')]);return _0x506582(_0x30f427['error']['message']);}else{logger[_0x0a99('0x13')](_0x0a99('0x19'),_0x38e89b,_0x0a99('0x14'));_0x506582(_0x30f427[_0x0a99('0x1b')]['message']);}})['catch'](function(_0x27a14f){logger[_0x0a99('0x17')](_0x0a99('0x19'),_0x38e89b,_0x27a14f);_0x3561f2(_0x27a14f);});});}exports[_0x0a99('0x1c')]=function(_0x5e6c7e){var _0x58c86d=this;return new Promise(function(_0x1b0279,_0x4d0c78){return db[_0x0a99('0x1d')]['findAll']({'raw':_0x5e6c7e[_0x0a99('0x1e')]?_0x5e6c7e['options'][_0x0a99('0x1f')]===undefined?!![]:![]:!![],'where':_0x5e6c7e[_0x0a99('0x1e')]?_0x5e6c7e[_0x0a99('0x1e')][_0x0a99('0x20')]||null:null,'attributes':_0x5e6c7e[_0x0a99('0x1e')]?_0x5e6c7e[_0x0a99('0x1e')][_0x0a99('0x21')]||null:null,'limit':_0x5e6c7e[_0x0a99('0x1e')]?_0x5e6c7e[_0x0a99('0x1e')]['limit']||null:null,'include':_0x5e6c7e['options']?_0x5e6c7e[_0x0a99('0x1e')][_0x0a99('0x22')]?_[_0x0a99('0x23')](_0x5e6c7e['options']['include'],function(_0x371b31){return{'model':db[_0x371b31[_0x0a99('0x24')]],'as':_0x371b31['as'],'attributes':_0x371b31[_0x0a99('0x21')],'include':_0x371b31[_0x0a99('0x22')]?_[_0x0a99('0x23')](_0x371b31[_0x0a99('0x22')],function(_0x25b4c0){return{'model':db[_0x25b4c0[_0x0a99('0x24')]],'as':_0x25b4c0['as'],'attributes':_0x25b4c0[_0x0a99('0x21')],'include':_0x25b4c0['include']?_[_0x0a99('0x23')](_0x25b4c0['include'],function(_0x47bc34){return{'model':db[_0x47bc34['model']],'as':_0x47bc34['as'],'attributes':_0x47bc34[_0x0a99('0x21')]};}):[]};}):[]};}):[]:[]})[_0x0a99('0x12')](function(_0x13d26a){logger[_0x0a99('0x13')](_0x0a99('0x1c'),_0x5e6c7e);logger[_0x0a99('0x15')](_0x0a99('0x1c'),_0x5e6c7e,JSON['stringify'](_0x13d26a));_0x1b0279(_0x13d26a);})[_0x0a99('0x25')](function(_0x10e146){logger[_0x0a99('0x17')](_0x0a99('0x1c'),_0x10e146['message'],_0x5e6c7e);_0x4d0c78(_0x58c86d['error'](0x1f4,_0x10e146['message']));});});}; \ No newline at end of file +var _0x770d=['error','code','message','result','catch','VoiceExtension','findAll','options','raw','where','attributes','limit','map','model','include','GetVoiceExtension','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s'];(function(_0x20ef64,_0x4a8fe9){var _0x3707d8=function(_0x5b9a88){while(--_0x5b9a88){_0x20ef64['push'](_0x20ef64['shift']());}};_0x3707d8(++_0x4a8fe9);}(_0x770d,0x122));var _0xd770=function(_0x262cc2,_0x1d1c6c){_0x262cc2=_0x262cc2-0x0;var _0x395c55=_0x770d[_0x262cc2];return _0x395c55;};'use strict';var _=require(_0xd770('0x0'));var util=require(_0xd770('0x1'));var moment=require(_0xd770('0x2'));var BPromise=require(_0xd770('0x3'));var rs=require(_0xd770('0x4'));var fs=require('fs');var Redis=require(_0xd770('0x5'));var db=require(_0xd770('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xd770('0x7'))(_0xd770('0x8'));var config=require(_0xd770('0x9'));var jayson=require(_0xd770('0xa'));var client=jayson['client']['http']({'port':0x232a});config[_0xd770('0xb')]=_[_0xd770('0xc')](config[_0xd770('0xb')],{'host':_0xd770('0xd'),'port':0x18eb});var socket=require(_0xd770('0xe'))(new Redis(config[_0xd770('0xb')]));require(_0xd770('0xf'))['register'](socket);function respondWithRpcPromise(_0x3ab81f,_0x36f62b,_0x38da18){return new BPromise(function(_0x46775b,_0x32a6cf){return client['request'](_0x3ab81f,_0x38da18)[_0xd770('0x10')](function(_0x1a1c5b){logger[_0xd770('0x11')](_0xd770('0x12'),_0x36f62b,_0xd770('0x13'));logger[_0xd770('0x14')](_0xd770('0x15'),_0x36f62b,_0xd770('0x13'),JSON['stringify'](_0x1a1c5b));if(_0x1a1c5b['error']){if(_0x1a1c5b[_0xd770('0x16')][_0xd770('0x17')]===0x1f4){logger[_0xd770('0x16')](_0xd770('0x12'),_0x36f62b,_0x1a1c5b['error'][_0xd770('0x18')]);return _0x32a6cf(_0x1a1c5b[_0xd770('0x16')][_0xd770('0x18')]);}logger[_0xd770('0x16')]('VoiceExtension,\x20%s,\x20%s',_0x36f62b,_0x1a1c5b[_0xd770('0x16')]['message']);return _0x46775b(_0x1a1c5b[_0xd770('0x16')][_0xd770('0x18')]);}else{logger[_0xd770('0x11')](_0xd770('0x12'),_0x36f62b,_0xd770('0x13'));_0x46775b(_0x1a1c5b[_0xd770('0x19')][_0xd770('0x18')]);}})[_0xd770('0x1a')](function(_0x42964b){logger['error'](_0xd770('0x12'),_0x36f62b,_0x42964b);_0x32a6cf(_0x42964b);});});}exports['GetVoiceExtension']=function(_0x143ee1){var _0x5d802e=this;return new Promise(function(_0x28ac07,_0x25e076){return db[_0xd770('0x1b')][_0xd770('0x1c')]({'raw':_0x143ee1[_0xd770('0x1d')]?_0x143ee1['options'][_0xd770('0x1e')]===undefined?!![]:![]:!![],'where':_0x143ee1[_0xd770('0x1d')]?_0x143ee1['options'][_0xd770('0x1f')]||null:null,'attributes':_0x143ee1[_0xd770('0x1d')]?_0x143ee1[_0xd770('0x1d')][_0xd770('0x20')]||null:null,'limit':_0x143ee1['options']?_0x143ee1[_0xd770('0x1d')][_0xd770('0x21')]||null:null,'include':_0x143ee1[_0xd770('0x1d')]?_0x143ee1[_0xd770('0x1d')]['include']?_[_0xd770('0x22')](_0x143ee1[_0xd770('0x1d')]['include'],function(_0x4cc1e3){return{'model':db[_0x4cc1e3[_0xd770('0x23')]],'as':_0x4cc1e3['as'],'attributes':_0x4cc1e3[_0xd770('0x20')],'include':_0x4cc1e3[_0xd770('0x24')]?_[_0xd770('0x22')](_0x4cc1e3[_0xd770('0x24')],function(_0x112aaf){return{'model':db[_0x112aaf[_0xd770('0x23')]],'as':_0x112aaf['as'],'attributes':_0x112aaf['attributes'],'include':_0x112aaf[_0xd770('0x24')]?_[_0xd770('0x22')](_0x112aaf['include'],function(_0x56f299){return{'model':db[_0x56f299[_0xd770('0x23')]],'as':_0x56f299['as'],'attributes':_0x56f299[_0xd770('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3d9b42){logger[_0xd770('0x11')](_0xd770('0x25'),_0x143ee1);logger[_0xd770('0x14')]('GetVoiceExtension',_0x143ee1,JSON[_0xd770('0x26')](_0x3d9b42));_0x28ac07(_0x3d9b42);})['catch'](function(_0x4c6c2d){logger[_0xd770('0x16')](_0xd770('0x25'),_0x4c6c2d['message'],_0x143ee1);_0x25e076(_0x5d802e['error'](0x1f4,_0x4c6c2d[_0xd770('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index 86afdcc..4d5904c 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 _0x53ec=['length','voiceExtension:','./voiceExtension.events','save','remove','update','emit','removeListener'];(function(_0x39dcd2,_0xd41366){var _0x4cb37c=function(_0x4cc2b0){while(--_0x4cc2b0){_0x39dcd2['push'](_0x39dcd2['shift']());}};_0x4cb37c(++_0xd41366);}(_0x53ec,0x192));var _0xc53e=function(_0x44db8e,_0x143b54){_0x44db8e=_0x44db8e-0x0;var _0x40667a=_0x53ec[_0x44db8e];return _0x40667a;};'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 +var _0xf494=['save','remove','emit','removeListener','register','voiceExtension:','./voiceExtension.events'];(function(_0x42aa9c,_0x3b9d6e){var _0x5872dd=function(_0x30af7a){while(--_0x30af7a){_0x42aa9c['push'](_0x42aa9c['shift']());}};_0x5872dd(++_0x3b9d6e);}(_0xf494,0x1c6));var _0x4f49=function(_0x3bf31f,_0x189039){_0x3bf31f=_0x3bf31f-0x0;var _0x4eeca6=_0xf494[_0x3bf31f];return _0x4eeca6;};'use strict';var VoiceExtensionEvents=require(_0x4f49('0x0'));var events=[_0x4f49('0x1'),_0x4f49('0x2'),'update'];function createListener(_0x3aeeb8,_0x1d54cc){return function(_0x423b25){_0x1d54cc[_0x4f49('0x3')](_0x3aeeb8,_0x423b25);};}function removeListener(_0x20c0d7,_0x2a15fb){return function(){VoiceExtensionEvents[_0x4f49('0x4')](_0x20c0d7,_0x2a15fb);};}exports[_0x4f49('0x5')]=function(_0xc5e778){for(var _0x413530=0x0,_0x42b0e8=events['length'];_0x413530<_0x42b0e8;_0x413530++){var _0x58e9a0=events[_0x413530];var _0x169c95=createListener(_0x4f49('0x6')+_0x58e9a0,_0xc5e778);VoiceExtensionEvents['on'](_0x58e9a0,_0x169c95);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index 0c320aa..b3d5d35 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 _0xe2fe=['show','/:id/messages','post','update','destroy','exports','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id'];(function(_0x2637ac,_0x377857){var _0x4a5758=function(_0x5d5043){while(--_0x5d5043){_0x2637ac['push'](_0x2637ac['shift']());}};_0x4a5758(++_0x377857);}(_0xe2fe,0x86));var _0xee2f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe2fe[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xee2f('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xee2f('0x1'));var express=require('express');var router=express[_0xee2f('0x2')]();var fs_extra=require(_0xee2f('0x3'));var auth=require(_0xee2f('0x4'));var interaction=require(_0xee2f('0x5'));var config=require(_0xee2f('0x6'));var controller=require('./voiceMail.controller');router[_0xee2f('0x7')]('/',auth[_0xee2f('0x8')](),controller['index']);router[_0xee2f('0x7')](_0xee2f('0x9'),auth['isAuthenticated'](),controller[_0xee2f('0xa')]);router['get'](_0xee2f('0xb'),auth[_0xee2f('0x8')](),controller['getMessages']);router[_0xee2f('0xc')]('/',auth[_0xee2f('0x8')](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0xee2f('0xd')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xee2f('0xe')]);module[_0xee2f('0xf')]=router; \ No newline at end of file +var _0x77d4=['index','show','getMessages','post','create','/:id','update','delete','destroy','util','connect-timeout','Router','fs-extra','../../config/environment','./voiceMail.controller','get','isAuthenticated'];(function(_0x3c3eda,_0x3e788f){var _0x28aca3=function(_0x265b06){while(--_0x265b06){_0x3c3eda['push'](_0x3c3eda['shift']());}};_0x28aca3(++_0x3e788f);}(_0x77d4,0x108));var _0x477d=function(_0x521884,_0x430df3){_0x521884=_0x521884-0x0;var _0x5ceb0e=_0x77d4[_0x521884];return _0x5ceb0e;};'use strict';var multer=require('multer');var util=require(_0x477d('0x0'));var path=require('path');var timeout=require(_0x477d('0x1'));var express=require('express');var router=express[_0x477d('0x2')]();var fs_extra=require(_0x477d('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x477d('0x4'));var controller=require(_0x477d('0x5'));router[_0x477d('0x6')]('/',auth[_0x477d('0x7')](),controller[_0x477d('0x8')]);router[_0x477d('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x477d('0x9')]);router['get']('/:id/messages',auth[_0x477d('0x7')](),controller[_0x477d('0xa')]);router[_0x477d('0xb')]('/',auth[_0x477d('0x7')](),controller[_0x477d('0xc')]);router['put'](_0x477d('0xd'),auth['isAuthenticated'](),controller[_0x477d('0xe')]);router[_0x477d('0xf')]('/:id',auth[_0x477d('0x7')](),controller[_0x477d('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index bcf8a11..53669f7 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 _0x53fe=['INTEGER','VIRTUAL','getDataValue','fullname','\x20-\x20','sequelize','exports','STRING','from-voicemail','contest_mailbox','setDataValue','email','string','trim','central','ENUM','yes','TINYINT(4)'];(function(_0x59c9a4,_0x3a1bba){var _0x59fe05=function(_0x443a0a){while(--_0x443a0a){_0x59c9a4['push'](_0x59c9a4['shift']());}};_0x59fe05(++_0x3a1bba);}(_0x53fe,0xef));var _0xe53f=function(_0x29ad3e,_0x3598c8){_0x29ad3e=_0x29ad3e-0x0;var _0x276b1c=_0x53fe[_0x29ad3e];return _0x276b1c;};'use strict';var Sequelize=require(_0xe53f('0x0'));module[_0xe53f('0x1')]={'customer_id':{'type':Sequelize[_0xe53f('0x2')]},'context':{'type':Sequelize['STRING'],'defaultValue':_0xe53f('0x3'),'unique':_0xe53f('0x4')},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'','allowNull':![],'unique':_0xe53f('0x4')},'password':{'type':Sequelize[_0xe53f('0x2')]},'fullname':{'type':Sequelize[_0xe53f('0x2')]},'email':{'type':Sequelize[_0xe53f('0x2')],'validate':{'isEmail':!![]},'set':function(_0x5529b3){this[_0xe53f('0x5')](_0xe53f('0x6'),typeof _0x5529b3===_0xe53f('0x7')&&_0x5529b3['trim']()?_0x5529b3[_0xe53f('0x8')]():null);}},'pager':{'type':Sequelize['STRING']},'tz':{'type':Sequelize[_0xe53f('0x2')],'defaultValue':_0xe53f('0x9')},'attach':{'type':Sequelize[_0xe53f('0xa')](_0xe53f('0xb'),'no'),'defaultValue':_0xe53f('0xb'),'allowNull':![]},'saycid':{'type':Sequelize['ENUM'](_0xe53f('0xb'),'no'),'defaultValue':_0xe53f('0xb'),'allowNull':![]},'dialout':{'type':Sequelize[_0xe53f('0x2')]},'callback':{'type':Sequelize[_0xe53f('0x2')]},'review':{'type':Sequelize['ENUM'](_0xe53f('0xb'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0xe53f('0xa')](_0xe53f('0xb'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize['ENUM'](_0xe53f('0xb'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0xe53f('0xc'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0xe53f('0xa')](_0xe53f('0xb'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize['ENUM'](_0xe53f('0xb'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0xe53f('0xa')]('yes','no'),'defaultValue':'yes','allowNull':![]},'forcename':{'type':Sequelize[_0xe53f('0xa')](_0xe53f('0xb'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0xe53f('0xa')](_0xe53f('0xb'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0xe53f('0xb'),'allowNull':![]},'stamp':{'type':'TIMESTAMP'},'emailsubject':{'type':Sequelize[_0xe53f('0x2')]},'emailbody':{'type':Sequelize[_0xe53f('0x2')]},'maxsecs':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0xe53f('0xd')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0xe53f('0xe')],'get':function(){return this[_0xe53f('0xf')](_0xe53f('0x10'))+_0xe53f('0x11')+this[_0xe53f('0xf')]('mailbox');}}}; \ No newline at end of file +var _0x1e5e=['VIRTUAL','getDataValue','fullname','\x20-\x20','mailbox','sequelize','exports','STRING','from-voicemail','contest_mailbox','setDataValue','email','string','trim','central','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER'];(function(_0x524ce0,_0x3670b2){var _0x38299f=function(_0x513ef4){while(--_0x513ef4){_0x524ce0['push'](_0x524ce0['shift']());}};_0x38299f(++_0x3670b2);}(_0x1e5e,0x181));var _0xe1e5=function(_0x43a14f,_0x1c7d05){_0x43a14f=_0x43a14f-0x0;var _0x1f96ef=_0x1e5e[_0x43a14f];return _0x1f96ef;};'use strict';var Sequelize=require(_0xe1e5('0x0'));module[_0xe1e5('0x1')]={'customer_id':{'type':Sequelize[_0xe1e5('0x2')]},'context':{'type':Sequelize[_0xe1e5('0x2')],'defaultValue':_0xe1e5('0x3'),'unique':_0xe1e5('0x4')},'mailbox':{'type':Sequelize[_0xe1e5('0x2')],'defaultValue':'','allowNull':![],'unique':_0xe1e5('0x4')},'password':{'type':Sequelize['STRING']},'fullname':{'type':Sequelize[_0xe1e5('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]},'set':function(_0x485eab){this[_0xe1e5('0x5')](_0xe1e5('0x6'),typeof _0x485eab===_0xe1e5('0x7')&&_0x485eab[_0xe1e5('0x8')]()?_0x485eab[_0xe1e5('0x8')]():null);}},'pager':{'type':Sequelize[_0xe1e5('0x2')]},'tz':{'type':Sequelize['STRING'],'defaultValue':_0xe1e5('0x9')},'attach':{'type':Sequelize[_0xe1e5('0xa')](_0xe1e5('0xb'),'no'),'defaultValue':_0xe1e5('0xb'),'allowNull':![]},'saycid':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0xe1e5('0xb'),'allowNull':![]},'dialout':{'type':Sequelize[_0xe1e5('0x2')]},'callback':{'type':Sequelize[_0xe1e5('0x2')]},'review':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize['ENUM'](_0xe1e5('0xb'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0xe1e5('0xa')](_0xe1e5('0xb'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize['ENUM'](_0xe1e5('0xb'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0xe1e5('0xc'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize['ENUM'](_0xe1e5('0xb'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize['ENUM'](_0xe1e5('0xb'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0xe1e5('0xa')]('yes','no'),'defaultValue':'yes','allowNull':![]},'forcename':{'type':Sequelize[_0xe1e5('0xa')](_0xe1e5('0xb'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0xe1e5('0xa')]('yes','no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM'](_0xe1e5('0xb'),'no'),'defaultValue':_0xe1e5('0xb'),'allowNull':![]},'stamp':{'type':_0xe1e5('0xd')},'emailsubject':{'type':Sequelize[_0xe1e5('0x2')]},'emailbody':{'type':Sequelize[_0xe1e5('0x2')]},'maxsecs':{'type':Sequelize[_0xe1e5('0xe')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0xe1e5('0xe')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0xe1e5('0xf')],'get':function(){return this[_0xe1e5('0x10')](_0xe1e5('0x11'))+_0xe1e5('0x12')+this[_0xe1e5('0x10')](_0xe1e5('0x13'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index a21eff7..2156c66 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 _0x63a5=['index','map','VoiceMail','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','filter','merge','options','includeAll','rows','catch','show','params','keys','rawAttributes','include','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','getMessages','VoiceMailMessage','sort','pick','mailbox','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','ejs','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','../../config/license/util','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','reject','save','update','then','destroy','get','Voicemails','UserProfileResource','error','stack','name','send'];(function(_0x39f845,_0x1f0097){var _0x323202=function(_0x3f5695){while(--_0x3f5695){_0x39f845['push'](_0x39f845['shift']());}};_0x323202(++_0x1f0097);}(_0x63a5,0x18e));var _0x563a=function(_0x29d94e,_0xf386d6){_0x29d94e=_0x29d94e-0x0;var _0x106237=_0x63a5[_0x29d94e];return _0x106237;};'use strict';var emlformat=require(_0x563a('0x0'));var rimraf=require(_0x563a('0x1'));var zipdir=require(_0x563a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x563a('0x3'));var moment=require('moment');var BPromise=require(_0x563a('0x4'));var Mustache=require(_0x563a('0x5'));var util=require(_0x563a('0x6'));var path=require(_0x563a('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x563a('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x563a('0x9'));var squel=require(_0x563a('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x563a('0xb'));var toCsv=require(_0x563a('0xc'));var querystring=require(_0x563a('0xd'));var Papa=require(_0x563a('0xe'));var Redis=require(_0x563a('0xf'));var authService=require(_0x563a('0x10'));var qs=require(_0x563a('0x11'));var as=require(_0x563a('0x12'));var hardwareService=require(_0x563a('0x13'));var logger=require(_0x563a('0x14'))(_0x563a('0x15'));var utils=require(_0x563a('0x16'));var config=require(_0x563a('0x17'));var licenseUtil=require(_0x563a('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x61d5b2,_0x214f42){_0x214f42=_0x214f42||0xcc;return function(_0x10de2e){if(_0x10de2e){return _0x61d5b2[_0x563a('0x19')](_0x214f42);}return _0x61d5b2[_0x563a('0x1a')](_0x214f42)[_0x563a('0x1b')]();};}function respondWithResult(_0x50396b,_0x2cf052){_0x2cf052=_0x2cf052||0xc8;return function(_0x3045ac){if(_0x3045ac){return _0x50396b[_0x563a('0x1a')](_0x2cf052)[_0x563a('0x1c')](_0x3045ac);}};}function respondWithFilteredResult(_0x5a2980,_0x504cb7){return function(_0x414535){if(_0x414535){var _0x2ad667=typeof _0x504cb7['offset']===_0x563a('0x1d')&&typeof _0x504cb7[_0x563a('0x1e')]===_0x563a('0x1d');var _0x9c2f77=_0x414535['count'];var _0x598693=_0x2ad667?0x0:_0x504cb7[_0x563a('0x1f')];var _0x422aaf=_0x2ad667?_0x414535[_0x563a('0x20')]:_0x504cb7['offset']+_0x504cb7['limit'];var _0x52b99a;if(_0x422aaf>=_0x9c2f77){_0x422aaf=_0x9c2f77;_0x52b99a=0xc8;}else{_0x52b99a=0xce;}_0x5a2980['status'](_0x52b99a);return _0x5a2980[_0x563a('0x21')](_0x563a('0x22'),_0x598693+'-'+_0x422aaf+'/'+_0x9c2f77)[_0x563a('0x1c')](_0x414535);}return null;};}function patchUpdates(_0x43b7a8){return function(_0x562fce){try{jsonpatch['apply'](_0x562fce,_0x43b7a8,!![]);}catch(_0x3930f0){return BPromise[_0x563a('0x23')](_0x3930f0);}return _0x562fce[_0x563a('0x24')]();};}function saveUpdates(_0x2beccb,_0x1bf502){return function(_0x2dc7e2){if(_0x2dc7e2){return _0x2dc7e2[_0x563a('0x25')](_0x2beccb)[_0x563a('0x26')](function(_0x506491){return _0x506491;});}return null;};}function removeEntity(_0xd59ba8,_0x5422f6){return function(_0x44e2c1){if(_0x44e2c1){return _0x44e2c1[_0x563a('0x27')]()[_0x563a('0x26')](function(){var _0x1250e6=_0x44e2c1[_0x563a('0x28')]({'plain':!![]});var _0x1682ee=_0x563a('0x29');return db[_0x563a('0x2a')]['destroy']({'where':{'type':_0x1682ee,'resourceId':_0x1250e6['id']}})[_0x563a('0x26')](function(){return _0x44e2c1;});})[_0x563a('0x26')](function(){_0xd59ba8[_0x563a('0x1a')](0xcc)[_0x563a('0x1b')]();});}};}function handleEntityNotFound(_0xce8165,_0x1898f9){return function(_0x1afdff){if(!_0x1afdff){_0xce8165[_0x563a('0x19')](0x194);}return _0x1afdff;};}function handleError(_0x249db8,_0x8f3429){_0x8f3429=_0x8f3429||0x1f4;return function(_0x1a69d5){logger[_0x563a('0x2b')](_0x1a69d5[_0x563a('0x2c')]);if(_0x1a69d5[_0x563a('0x2d')]){delete _0x1a69d5['name'];}_0x249db8[_0x563a('0x1a')](_0x8f3429)[_0x563a('0x2e')](_0x1a69d5);};}exports[_0x563a('0x2f')]=function(_0x4aaa3d,_0x1e8d43){var _0x2e5c4b={},_0x3a59cb={},_0x28a8f6={'count':0x0,'rows':[]};var _0x166f89=_[_0x563a('0x30')](db[_0x563a('0x31')]['rawAttributes'],function(_0x2418ae){return{'name':_0x2418ae[_0x563a('0x32')],'type':_0x2418ae[_0x563a('0x33')][_0x563a('0x34')]};});_0x3a59cb[_0x563a('0x35')]=_['map'](_0x166f89,'name');_0x3a59cb['query']=_['keys'](_0x4aaa3d[_0x563a('0x36')]);_0x3a59cb[_0x563a('0x37')]=_[_0x563a('0x38')](_0x3a59cb[_0x563a('0x35')],_0x3a59cb[_0x563a('0x36')]);_0x2e5c4b[_0x563a('0x39')]=_['intersection'](_0x3a59cb['model'],qs[_0x563a('0x3a')](_0x4aaa3d[_0x563a('0x36')][_0x563a('0x3a')]));_0x2e5c4b[_0x563a('0x39')]=_0x2e5c4b[_0x563a('0x39')][_0x563a('0x3b')]?_0x2e5c4b[_0x563a('0x39')]:_0x3a59cb[_0x563a('0x35')];if(!_0x4aaa3d[_0x563a('0x36')][_0x563a('0x3c')](_0x563a('0x3d'))){_0x2e5c4b[_0x563a('0x1e')]=qs[_0x563a('0x1e')](_0x4aaa3d[_0x563a('0x36')][_0x563a('0x1e')]);_0x2e5c4b[_0x563a('0x1f')]=qs['offset'](_0x4aaa3d[_0x563a('0x36')][_0x563a('0x1f')]);}_0x2e5c4b[_0x563a('0x3e')]=qs['sort'](_0x4aaa3d[_0x563a('0x36')]['sort']);_0x2e5c4b[_0x563a('0x3f')]=qs[_0x563a('0x37')](_['pick'](_0x4aaa3d['query'],_0x3a59cb[_0x563a('0x37')]),_0x166f89);if(_0x4aaa3d['query'][_0x563a('0x40')]){_0x2e5c4b[_0x563a('0x3f')]=_[_0x563a('0x41')](_0x2e5c4b[_0x563a('0x3f')],{'$or':_['map'](_0x166f89,function(_0x47d37a){if(_0x47d37a[_0x563a('0x33')]!=='VIRTUAL'){var _0x46d471={};_0x46d471[_0x47d37a[_0x563a('0x2d')]]={'$like':'%'+_0x4aaa3d[_0x563a('0x36')][_0x563a('0x40')]+'%'};return _0x46d471;}})});}_0x2e5c4b=_[_0x563a('0x41')]({},_0x2e5c4b,_0x4aaa3d[_0x563a('0x42')]);var _0x4bf555={'where':_0x2e5c4b[_0x563a('0x3f')]};return db['VoiceMail'][_0x563a('0x20')](_0x4bf555)['then'](function(_0x20c142){_0x28a8f6[_0x563a('0x20')]=_0x20c142;if(_0x4aaa3d[_0x563a('0x36')][_0x563a('0x43')]){_0x2e5c4b['include']=[{'all':!![]}];}return db['VoiceMail']['findAll'](_0x2e5c4b);})[_0x563a('0x26')](function(_0x1255da){_0x28a8f6[_0x563a('0x44')]=_0x1255da;return _0x28a8f6;})[_0x563a('0x26')](respondWithFilteredResult(_0x1e8d43,_0x2e5c4b))[_0x563a('0x45')](handleError(_0x1e8d43,null));};exports[_0x563a('0x46')]=function(_0x29a1c0,_0x2ca0f4){var _0x19c2cc={'raw':!![],'where':{'id':_0x29a1c0[_0x563a('0x47')]['id']}},_0x433353={};_0x433353[_0x563a('0x35')]=_[_0x563a('0x48')](db[_0x563a('0x31')][_0x563a('0x49')]);_0x433353[_0x563a('0x36')]=_[_0x563a('0x48')](_0x29a1c0[_0x563a('0x36')]);_0x433353[_0x563a('0x37')]=_['intersection'](_0x433353['model'],_0x433353[_0x563a('0x36')]);_0x19c2cc[_0x563a('0x39')]=_[_0x563a('0x38')](_0x433353[_0x563a('0x35')],qs[_0x563a('0x3a')](_0x29a1c0[_0x563a('0x36')][_0x563a('0x3a')]));_0x19c2cc[_0x563a('0x39')]=_0x19c2cc['attributes']['length']?_0x19c2cc[_0x563a('0x39')]:_0x433353[_0x563a('0x35')];if(_0x29a1c0[_0x563a('0x36')][_0x563a('0x43')]){_0x19c2cc[_0x563a('0x4a')]=[{'all':!![]}];}_0x19c2cc=_[_0x563a('0x41')]({},_0x19c2cc,_0x29a1c0[_0x563a('0x42')]);return db[_0x563a('0x31')]['find'](_0x19c2cc)[_0x563a('0x26')](handleEntityNotFound(_0x2ca0f4,null))[_0x563a('0x26')](respondWithResult(_0x2ca0f4,null))['catch'](handleError(_0x2ca0f4,null));};exports[_0x563a('0x4b')]=function(_0x5a063a,_0x3ea787){return db[_0x563a('0x31')][_0x563a('0x4b')](_0x5a063a['body'],{})[_0x563a('0x26')](function(_0x23efcf){var _0xb1dbc8=_0x5a063a[_0x563a('0x4c')][_0x563a('0x28')]({'plain':!![]});if(!_0xb1dbc8)throw new Error(_0x563a('0x4d'));if(_0xb1dbc8[_0x563a('0x4e')]===_0x563a('0x4c')){var _0x277d54=_0x23efcf[_0x563a('0x28')]({'plain':!![]});var _0x3c98d5=_0x563a('0x29');return db[_0x563a('0x4f')]['find']({'where':{'name':_0x3c98d5,'userProfileId':_0xb1dbc8['userProfileId']},'raw':!![]})[_0x563a('0x26')](function(_0xaae9fd){if(_0xaae9fd&&_0xaae9fd[_0x563a('0x50')]===0x0){return db['UserProfileResource']['create']({'name':_0x277d54[_0x563a('0x2d')],'resourceId':_0x277d54['id'],'type':_0xaae9fd[_0x563a('0x2d')],'sectionId':_0xaae9fd['id']},{})['then'](function(){return _0x23efcf;});}else{return _0x23efcf;}})['catch'](function(_0x51e142){logger[_0x563a('0x2b')](_0x563a('0x51'),_0x51e142);throw _0x51e142;});}return _0x23efcf;})[_0x563a('0x26')](respondWithResult(_0x3ea787,0xc9))[_0x563a('0x45')](handleError(_0x3ea787,null));};exports[_0x563a('0x25')]=function(_0x2805eb,_0x4dd257){if(_0x2805eb['body']['id']){delete _0x2805eb[_0x563a('0x52')]['id'];}return db['VoiceMail'][_0x563a('0x53')]({'where':{'id':_0x2805eb[_0x563a('0x47')]['id']}})[_0x563a('0x26')](handleEntityNotFound(_0x4dd257,null))[_0x563a('0x26')](saveUpdates(_0x2805eb[_0x563a('0x52')],null))[_0x563a('0x26')](respondWithResult(_0x4dd257,null))[_0x563a('0x45')](handleError(_0x4dd257,null));};exports['destroy']=function(_0x22cc91,_0x227372){return db['VoiceMail'][_0x563a('0x53')]({'where':{'id':_0x22cc91[_0x563a('0x47')]['id']}})[_0x563a('0x26')](handleEntityNotFound(_0x227372,null))[_0x563a('0x26')](removeEntity(_0x227372,null))[_0x563a('0x45')](handleError(_0x227372,null));};exports[_0x563a('0x54')]=function(_0x16aa03,_0x3919a3,_0x1e275c){return db[_0x563a('0x31')]['findOne']({'where':{'id':_0x16aa03[_0x563a('0x47')]['id']}})[_0x563a('0x26')](handleEntityNotFound(_0x3919a3,null))['then'](function(_0x503896){var _0x402bdd;var _0x709bfd={},_0x579d61={};_0x579d61[_0x563a('0x35')]=_['keys'](db[_0x563a('0x55')][_0x563a('0x49')]);_0x579d61[_0x563a('0x36')]=_[_0x563a('0x48')](_0x16aa03[_0x563a('0x36')]);_0x579d61['filters']=_['intersection'](_0x579d61['model'],_0x579d61['query']);_0x709bfd[_0x563a('0x39')]=_['intersection'](_0x579d61[_0x563a('0x35')],qs['fields'](_0x16aa03[_0x563a('0x36')][_0x563a('0x3a')]));_0x709bfd[_0x563a('0x39')]=_0x709bfd[_0x563a('0x39')][_0x563a('0x3b')]?_0x709bfd['attributes']:_0x579d61[_0x563a('0x35')];if(!_0x16aa03['query']['hasOwnProperty'](_0x563a('0x3d'))){_0x709bfd[_0x563a('0x1e')]=qs[_0x563a('0x1e')](_0x16aa03[_0x563a('0x36')][_0x563a('0x1e')]);_0x709bfd['offset']=qs[_0x563a('0x1f')](_0x16aa03[_0x563a('0x36')][_0x563a('0x1f')]);}_0x709bfd[_0x563a('0x3e')]=qs[_0x563a('0x56')](_0x16aa03['query'][_0x563a('0x56')]);_0x709bfd['where']=qs[_0x563a('0x37')](_[_0x563a('0x57')](_0x16aa03['query'],_0x579d61[_0x563a('0x37')]));if(_0x16aa03[_0x563a('0x36')][_0x563a('0x40')]){_0x709bfd[_0x563a('0x3f')]=_[_0x563a('0x41')](_0x709bfd[_0x563a('0x3f')],{'$or':_[_0x563a('0x30')](_0x709bfd[_0x563a('0x39')],function(_0x4cfa73){var _0x103c59={};_0x103c59[_0x4cfa73]={'$like':'%'+_0x16aa03[_0x563a('0x36')][_0x563a('0x40')]+'%'};return _0x103c59;})});}_0x709bfd[_0x563a('0x3f')]=_[_0x563a('0x41')](_0x709bfd[_0x563a('0x3f')],{'mailboxuser':_0x503896[_0x563a('0x58')]});_0x709bfd=_['merge']({},_0x709bfd,_0x16aa03[_0x563a('0x42')]);return db['VoiceMailMessage']['findAndCountAll'](_0x709bfd)['then'](respondWithFilteredResult(_0x3919a3,_0x709bfd));})[_0x563a('0x45')](handleError(_0x3919a3,null));}; \ No newline at end of file +var _0xb58b=['destroy','then','get','Voicemails','error','stack','name','send','index','VoiceMail','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','findAll','catch','show','params','length','include','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','body','getMessages','findOne','VoiceMailMessage','nolimit','mailbox','findAndCountAll','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','count','limit','set','Content-Range','apply','reject','save','update'];(function(_0x1db481,_0x1627b2){var _0x3db95b=function(_0x2d54e4){while(--_0x2d54e4){_0x1db481['push'](_0x1db481['shift']());}};_0x3db95b(++_0x1627b2);}(_0xb58b,0x1f1));var _0xbb58=function(_0x895219,_0x654a80){_0x895219=_0x895219-0x0;var _0x1bb732=_0xb58b[_0x895219];return _0x1bb732;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbb58('0x0'));var zipdir=require(_0xbb58('0x1'));var jsonpatch=require(_0xbb58('0x2'));var rp=require('request-promise');var moment=require(_0xbb58('0x3'));var BPromise=require(_0xbb58('0x4'));var Mustache=require('mustache');var util=require(_0xbb58('0x5'));var path=require('path');var sox=require(_0xbb58('0x6'));var csv=require(_0xbb58('0x7'));var ejs=require(_0xbb58('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbb58('0x9'));var squel=require(_0xbb58('0xa'));var crypto=require(_0xbb58('0xb'));var jsforce=require(_0xbb58('0xc'));var deskjs=require(_0xbb58('0xd'));var toCsv=require(_0xbb58('0x7'));var querystring=require(_0xbb58('0xe'));var Papa=require(_0xbb58('0xf'));var Redis=require(_0xbb58('0x10'));var authService=require(_0xbb58('0x11'));var qs=require(_0xbb58('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb58('0x13'));var logger=require('../../config/logger')(_0xbb58('0x14'));var utils=require(_0xbb58('0x15'));var config=require(_0xbb58('0x16'));var licenseUtil=require(_0xbb58('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xe88799,_0x18810f){_0x18810f=_0x18810f||0xcc;return function(_0x4cda21){if(_0x4cda21){return _0xe88799[_0xbb58('0x18')](_0x18810f);}return _0xe88799[_0xbb58('0x19')](_0x18810f)[_0xbb58('0x1a')]();};}function respondWithResult(_0x3b9406,_0x19ceda){_0x19ceda=_0x19ceda||0xc8;return function(_0x58245f){if(_0x58245f){return _0x3b9406[_0xbb58('0x19')](_0x19ceda)[_0xbb58('0x1b')](_0x58245f);}};}function respondWithFilteredResult(_0x5f4751,_0x4ba30e){return function(_0x33c20f){if(_0x33c20f){var _0x445b1f=typeof _0x4ba30e[_0xbb58('0x1c')]==='undefined'&&typeof _0x4ba30e['limit']==='undefined';var _0x55156e=_0x33c20f[_0xbb58('0x1d')];var _0x3134ea=_0x445b1f?0x0:_0x4ba30e['offset'];var _0xbee66=_0x445b1f?_0x33c20f['count']:_0x4ba30e[_0xbb58('0x1c')]+_0x4ba30e[_0xbb58('0x1e')];var _0x3c33d9;if(_0xbee66>=_0x55156e){_0xbee66=_0x55156e;_0x3c33d9=0xc8;}else{_0x3c33d9=0xce;}_0x5f4751[_0xbb58('0x19')](_0x3c33d9);return _0x5f4751[_0xbb58('0x1f')](_0xbb58('0x20'),_0x3134ea+'-'+_0xbee66+'/'+_0x55156e)[_0xbb58('0x1b')](_0x33c20f);}return null;};}function patchUpdates(_0x497fd0){return function(_0x84f34){try{jsonpatch[_0xbb58('0x21')](_0x84f34,_0x497fd0,!![]);}catch(_0x3e64fe){return BPromise[_0xbb58('0x22')](_0x3e64fe);}return _0x84f34[_0xbb58('0x23')]();};}function saveUpdates(_0x5d4a91,_0x49453a){return function(_0x350be7){if(_0x350be7){return _0x350be7[_0xbb58('0x24')](_0x5d4a91)['then'](function(_0x27806d){return _0x27806d;});}return null;};}function removeEntity(_0x53b693,_0x21964d){return function(_0x287822){if(_0x287822){return _0x287822[_0xbb58('0x25')]()[_0xbb58('0x26')](function(){var _0x2d111c=_0x287822[_0xbb58('0x27')]({'plain':!![]});var _0x2d556a=_0xbb58('0x28');return db['UserProfileResource'][_0xbb58('0x25')]({'where':{'type':_0x2d556a,'resourceId':_0x2d111c['id']}})[_0xbb58('0x26')](function(){return _0x287822;});})[_0xbb58('0x26')](function(){_0x53b693[_0xbb58('0x19')](0xcc)[_0xbb58('0x1a')]();});}};}function handleEntityNotFound(_0x521d0c,_0x3608dc){return function(_0x2ce7c3){if(!_0x2ce7c3){_0x521d0c[_0xbb58('0x18')](0x194);}return _0x2ce7c3;};}function handleError(_0x2d5b39,_0xf6687e){_0xf6687e=_0xf6687e||0x1f4;return function(_0x28b3a3){logger[_0xbb58('0x29')](_0x28b3a3[_0xbb58('0x2a')]);if(_0x28b3a3[_0xbb58('0x2b')]){delete _0x28b3a3['name'];}_0x2d5b39[_0xbb58('0x19')](_0xf6687e)[_0xbb58('0x2c')](_0x28b3a3);};}exports[_0xbb58('0x2d')]=function(_0x3c9cee,_0x3304b9){var _0x9d379f={},_0x1ba526={},_0x643e0e={'count':0x0,'rows':[]};var _0x3f8db3=_['map'](db[_0xbb58('0x2e')][_0xbb58('0x2f')],function(_0x3edc34){return{'name':_0x3edc34[_0xbb58('0x30')],'type':_0x3edc34[_0xbb58('0x31')][_0xbb58('0x32')]};});_0x1ba526[_0xbb58('0x33')]=_[_0xbb58('0x34')](_0x3f8db3,_0xbb58('0x2b'));_0x1ba526[_0xbb58('0x35')]=_[_0xbb58('0x36')](_0x3c9cee[_0xbb58('0x35')]);_0x1ba526[_0xbb58('0x37')]=_['intersection'](_0x1ba526['model'],_0x1ba526['query']);_0x9d379f[_0xbb58('0x38')]=_[_0xbb58('0x39')](_0x1ba526[_0xbb58('0x33')],qs[_0xbb58('0x3a')](_0x3c9cee[_0xbb58('0x35')][_0xbb58('0x3a')]));_0x9d379f[_0xbb58('0x38')]=_0x9d379f[_0xbb58('0x38')]['length']?_0x9d379f[_0xbb58('0x38')]:_0x1ba526[_0xbb58('0x33')];if(!_0x3c9cee['query'][_0xbb58('0x3b')]('nolimit')){_0x9d379f[_0xbb58('0x1e')]=qs['limit'](_0x3c9cee[_0xbb58('0x35')][_0xbb58('0x1e')]);_0x9d379f['offset']=qs[_0xbb58('0x1c')](_0x3c9cee[_0xbb58('0x35')][_0xbb58('0x1c')]);}_0x9d379f[_0xbb58('0x3c')]=qs[_0xbb58('0x3d')](_0x3c9cee[_0xbb58('0x35')][_0xbb58('0x3d')]);_0x9d379f[_0xbb58('0x3e')]=qs['filters'](_[_0xbb58('0x3f')](_0x3c9cee[_0xbb58('0x35')],_0x1ba526[_0xbb58('0x37')]),_0x3f8db3);if(_0x3c9cee['query']['filter']){_0x9d379f[_0xbb58('0x3e')]=_['merge'](_0x9d379f[_0xbb58('0x3e')],{'$or':_[_0xbb58('0x34')](_0x3f8db3,function(_0x2ab2d8){if(_0x2ab2d8['type']!=='VIRTUAL'){var _0xc29171={};_0xc29171[_0x2ab2d8[_0xbb58('0x2b')]]={'$like':'%'+_0x3c9cee[_0xbb58('0x35')][_0xbb58('0x40')]+'%'};return _0xc29171;}})});}_0x9d379f=_[_0xbb58('0x41')]({},_0x9d379f,_0x3c9cee[_0xbb58('0x42')]);var _0x5797e7={'where':_0x9d379f[_0xbb58('0x3e')]};return db[_0xbb58('0x2e')][_0xbb58('0x1d')](_0x5797e7)[_0xbb58('0x26')](function(_0x1185b3){_0x643e0e[_0xbb58('0x1d')]=_0x1185b3;if(_0x3c9cee['query'][_0xbb58('0x43')]){_0x9d379f['include']=[{'all':!![]}];}return db[_0xbb58('0x2e')][_0xbb58('0x44')](_0x9d379f);})[_0xbb58('0x26')](function(_0x45817f){_0x643e0e['rows']=_0x45817f;return _0x643e0e;})[_0xbb58('0x26')](respondWithFilteredResult(_0x3304b9,_0x9d379f))[_0xbb58('0x45')](handleError(_0x3304b9,null));};exports[_0xbb58('0x46')]=function(_0x3a732c,_0x5b95f7){var _0x2ecc1b={'raw':!![],'where':{'id':_0x3a732c[_0xbb58('0x47')]['id']}},_0x5250e0={};_0x5250e0[_0xbb58('0x33')]=_[_0xbb58('0x36')](db[_0xbb58('0x2e')][_0xbb58('0x2f')]);_0x5250e0[_0xbb58('0x35')]=_[_0xbb58('0x36')](_0x3a732c[_0xbb58('0x35')]);_0x5250e0[_0xbb58('0x37')]=_[_0xbb58('0x39')](_0x5250e0[_0xbb58('0x33')],_0x5250e0[_0xbb58('0x35')]);_0x2ecc1b[_0xbb58('0x38')]=_['intersection'](_0x5250e0[_0xbb58('0x33')],qs['fields'](_0x3a732c['query'][_0xbb58('0x3a')]));_0x2ecc1b[_0xbb58('0x38')]=_0x2ecc1b[_0xbb58('0x38')][_0xbb58('0x48')]?_0x2ecc1b[_0xbb58('0x38')]:_0x5250e0[_0xbb58('0x33')];if(_0x3a732c[_0xbb58('0x35')][_0xbb58('0x43')]){_0x2ecc1b[_0xbb58('0x49')]=[{'all':!![]}];}_0x2ecc1b=_[_0xbb58('0x41')]({},_0x2ecc1b,_0x3a732c[_0xbb58('0x42')]);return db['VoiceMail'][_0xbb58('0x4a')](_0x2ecc1b)[_0xbb58('0x26')](handleEntityNotFound(_0x5b95f7,null))['then'](respondWithResult(_0x5b95f7,null))[_0xbb58('0x45')](handleError(_0x5b95f7,null));};exports[_0xbb58('0x4b')]=function(_0xf94897,_0xdb0ff7){return db['VoiceMail'][_0xbb58('0x4b')](_0xf94897['body'],{})[_0xbb58('0x26')](function(_0x336598){var _0x471917=_0xf94897['user'][_0xbb58('0x27')]({'plain':!![]});if(!_0x471917)throw new Error(_0xbb58('0x4c'));if(_0x471917['role']===_0xbb58('0x4d')){var _0x4ca201=_0x336598[_0xbb58('0x27')]({'plain':!![]});var _0x2d81e0=_0xbb58('0x28');return db[_0xbb58('0x4e')][_0xbb58('0x4a')]({'where':{'name':_0x2d81e0,'userProfileId':_0x471917[_0xbb58('0x4f')]},'raw':!![]})[_0xbb58('0x26')](function(_0x4cb975){if(_0x4cb975&&_0x4cb975[_0xbb58('0x50')]===0x0){return db[_0xbb58('0x51')]['create']({'name':_0x4ca201[_0xbb58('0x2b')],'resourceId':_0x4ca201['id'],'type':_0x4cb975[_0xbb58('0x2b')],'sectionId':_0x4cb975['id']},{})['then'](function(){return _0x336598;});}else{return _0x336598;}})[_0xbb58('0x45')](function(_0x44636b){logger[_0xbb58('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x44636b);throw _0x44636b;});}return _0x336598;})[_0xbb58('0x26')](respondWithResult(_0xdb0ff7,0xc9))[_0xbb58('0x45')](handleError(_0xdb0ff7,null));};exports[_0xbb58('0x24')]=function(_0x592879,_0x537ed5){if(_0x592879['body']['id']){delete _0x592879[_0xbb58('0x52')]['id'];}return db[_0xbb58('0x2e')][_0xbb58('0x4a')]({'where':{'id':_0x592879['params']['id']}})['then'](handleEntityNotFound(_0x537ed5,null))[_0xbb58('0x26')](saveUpdates(_0x592879[_0xbb58('0x52')],null))[_0xbb58('0x26')](respondWithResult(_0x537ed5,null))[_0xbb58('0x45')](handleError(_0x537ed5,null));};exports[_0xbb58('0x25')]=function(_0x5290be,_0x362b91){return db[_0xbb58('0x2e')][_0xbb58('0x4a')]({'where':{'id':_0x5290be['params']['id']}})[_0xbb58('0x26')](handleEntityNotFound(_0x362b91,null))[_0xbb58('0x26')](removeEntity(_0x362b91,null))[_0xbb58('0x45')](handleError(_0x362b91,null));};exports[_0xbb58('0x53')]=function(_0x3f5add,_0x5e7ae0,_0x1174b1){return db[_0xbb58('0x2e')][_0xbb58('0x54')]({'where':{'id':_0x3f5add[_0xbb58('0x47')]['id']}})[_0xbb58('0x26')](handleEntityNotFound(_0x5e7ae0,null))[_0xbb58('0x26')](function(_0x85278c){var _0x58ced2;var _0x55d5be={},_0x344b0d={};_0x344b0d['model']=_[_0xbb58('0x36')](db[_0xbb58('0x55')][_0xbb58('0x2f')]);_0x344b0d[_0xbb58('0x35')]=_[_0xbb58('0x36')](_0x3f5add[_0xbb58('0x35')]);_0x344b0d[_0xbb58('0x37')]=_[_0xbb58('0x39')](_0x344b0d[_0xbb58('0x33')],_0x344b0d[_0xbb58('0x35')]);_0x55d5be[_0xbb58('0x38')]=_['intersection'](_0x344b0d[_0xbb58('0x33')],qs[_0xbb58('0x3a')](_0x3f5add[_0xbb58('0x35')]['fields']));_0x55d5be[_0xbb58('0x38')]=_0x55d5be['attributes'][_0xbb58('0x48')]?_0x55d5be[_0xbb58('0x38')]:_0x344b0d['model'];if(!_0x3f5add[_0xbb58('0x35')][_0xbb58('0x3b')](_0xbb58('0x56'))){_0x55d5be[_0xbb58('0x1e')]=qs[_0xbb58('0x1e')](_0x3f5add['query']['limit']);_0x55d5be[_0xbb58('0x1c')]=qs[_0xbb58('0x1c')](_0x3f5add[_0xbb58('0x35')]['offset']);}_0x55d5be[_0xbb58('0x3c')]=qs[_0xbb58('0x3d')](_0x3f5add['query'][_0xbb58('0x3d')]);_0x55d5be[_0xbb58('0x3e')]=qs['filters'](_[_0xbb58('0x3f')](_0x3f5add[_0xbb58('0x35')],_0x344b0d[_0xbb58('0x37')]));if(_0x3f5add[_0xbb58('0x35')][_0xbb58('0x40')]){_0x55d5be['where']=_[_0xbb58('0x41')](_0x55d5be[_0xbb58('0x3e')],{'$or':_[_0xbb58('0x34')](_0x55d5be[_0xbb58('0x38')],function(_0x2c9093){var _0x5e17fc={};_0x5e17fc[_0x2c9093]={'$like':'%'+_0x3f5add['query'][_0xbb58('0x40')]+'%'};return _0x5e17fc;})});}_0x55d5be['where']=_[_0xbb58('0x41')](_0x55d5be[_0xbb58('0x3e')],{'mailboxuser':_0x85278c[_0xbb58('0x57')]});_0x55d5be=_[_0xbb58('0x41')]({},_0x55d5be,_0x3f5add[_0xbb58('0x42')]);return db[_0xbb58('0x55')][_0xbb58('0x58')](_0x55d5be)[_0xbb58('0x26')](respondWithFilteredResult(_0x5e7ae0,_0x55d5be));})[_0xbb58('0x45')](handleError(_0x5e7ae0,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index 3b3c0af..b5b8968 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 _0x3335=['context','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMail.attributes','exports','define','voice_voicemail','mailbox_context','mailbox'];(function(_0x1d1c24,_0x26bb97){var _0x23617a=function(_0x9acd97){while(--_0x9acd97){_0x1d1c24['push'](_0x1d1c24['shift']());}};_0x23617a(++_0x26bb97);}(_0x3335,0x17b));var _0x5333=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0x3335[_0x28947d];return _0x12d2ee;};'use strict';var _=require(_0x5333('0x0'));var util=require(_0x5333('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x5333('0x2'));var rp=require(_0x5333('0x3'));var fs=require('fs');var path=require(_0x5333('0x4'));var rimraf=require(_0x5333('0x5'));var config=require(_0x5333('0x6'));var attributes=require(_0x5333('0x7'));module[_0x5333('0x8')]=function(_0x2d6f2a,_0x56b8f){return _0x2d6f2a[_0x5333('0x9')]('VoiceMail',attributes,{'tableName':_0x5333('0xa'),'paranoid':![],'indexes':[{'name':_0x5333('0xb'),'fields':[_0x5333('0xc'),_0x5333('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x304d=['util','api','moment','rimraf','../../config/environment','define','VoiceMail','mailbox_context','mailbox','context'];(function(_0x38998b,_0x3405e5){var _0x4bc71b=function(_0x354fb2){while(--_0x354fb2){_0x38998b['push'](_0x38998b['shift']());}};_0x4bc71b(++_0x3405e5);}(_0x304d,0xaa));var _0xd304=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x304d[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0xd304('0x0'));var logger=require('../../config/logger')(_0xd304('0x1'));var moment=require(_0xd304('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xd304('0x3'));var config=require(_0xd304('0x4'));var attributes=require('./voiceMail.attributes');module['exports']=function(_0xf0d4d0,_0x3ae682){return _0xf0d4d0[_0xd304('0x5')](_0xd304('0x6'),attributes,{'tableName':'voice_voicemail','paranoid':![],'indexes':[{'name':_0xd304('0x7'),'fields':[_0xd304('0x8'),_0xd304('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index 3feff15..0d7a0f0 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 _0xb559=['ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x5c8982,_0x5983d8){var _0x2f23f4=function(_0x244ba4){while(--_0x244ba4){_0x5c8982['push'](_0x5c8982['shift']());}};_0x2f23f4(++_0x5983d8);}(_0xb559,0x145));var _0x9b55=function(_0x487cbd,_0x342d12){_0x487cbd=_0x487cbd-0x0;var _0x5021f6=_0xb559[_0x487cbd];return _0x5021f6;};'use strict';var _=require(_0x9b55('0x0'));var util=require(_0x9b55('0x1'));var moment=require(_0x9b55('0x2'));var BPromise=require(_0x9b55('0x3'));var rs=require(_0x9b55('0x4'));var fs=require('fs');var Redis=require(_0x9b55('0x5'));var db=require(_0x9b55('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x9b55('0x7'))(_0x9b55('0x8'));var config=require('../../config/environment');var jayson=require(_0x9b55('0x9'));var client=jayson[_0x9b55('0xa')][_0x9b55('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1bed06,_0x3f8dfa,_0x140f98){return new BPromise(function(_0x590f64,_0x23328c){return client[_0x9b55('0xc')](_0x1bed06,_0x140f98)['then'](function(_0x6857e7){logger[_0x9b55('0xd')](_0x9b55('0xe'),_0x3f8dfa,_0x9b55('0xf'));logger[_0x9b55('0x10')](_0x9b55('0x11'),_0x3f8dfa,'request\x20sent',JSON['stringify'](_0x6857e7));if(_0x6857e7[_0x9b55('0x12')]){if(_0x6857e7['error'][_0x9b55('0x13')]===0x1f4){logger[_0x9b55('0x12')](_0x9b55('0xe'),_0x3f8dfa,_0x6857e7['error'][_0x9b55('0x14')]);return _0x23328c(_0x6857e7[_0x9b55('0x12')][_0x9b55('0x14')]);}logger[_0x9b55('0x12')](_0x9b55('0xe'),_0x3f8dfa,_0x6857e7[_0x9b55('0x12')]['message']);return _0x590f64(_0x6857e7['error'][_0x9b55('0x14')]);}else{logger[_0x9b55('0xd')]('VoiceMail,\x20%s,\x20%s',_0x3f8dfa,_0x9b55('0xf'));_0x590f64(_0x6857e7['result'][_0x9b55('0x14')]);}})[_0x9b55('0x15')](function(_0x13bb1d){logger[_0x9b55('0x12')](_0x9b55('0xe'),_0x3f8dfa,_0x13bb1d);_0x23328c(_0x13bb1d);});});} \ No newline at end of file +var _0xa9c8=['../../config/logger','rpc','../../config/environment','jayson/promise','http','debug','VoiceMail,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','VoiceMail,\x20%s,\x20%s','error','message','info','result','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9c8,0x78));var _0x8a9c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa9c8[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x8a9c('0x0'));var util=require(_0x8a9c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8a9c('0x2'));var fs=require('fs');var Redis=require(_0x8a9c('0x3'));var db=require(_0x8a9c('0x4'))['db'];var utils=require(_0x8a9c('0x5'));var logger=require(_0x8a9c('0x6'))(_0x8a9c('0x7'));var config=require(_0x8a9c('0x8'));var jayson=require(_0x8a9c('0x9'));var client=jayson['client'][_0x8a9c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x38df7a,_0x56900f,_0x4b43e6){return new BPromise(function(_0x5bf7c9,_0x218811){return client['request'](_0x38df7a,_0x4b43e6)['then'](function(_0xcc55fd){logger['info']('VoiceMail,\x20%s,\x20%s',_0x56900f,'request\x20sent');logger[_0x8a9c('0xb')](_0x8a9c('0xc'),_0x56900f,_0x8a9c('0xd'),JSON[_0x8a9c('0xe')](_0xcc55fd));if(_0xcc55fd['error']){if(_0xcc55fd['error'][_0x8a9c('0xf')]===0x1f4){logger['error'](_0x8a9c('0x10'),_0x56900f,_0xcc55fd[_0x8a9c('0x11')]['message']);return _0x218811(_0xcc55fd[_0x8a9c('0x11')]['message']);}logger[_0x8a9c('0x11')]('VoiceMail,\x20%s,\x20%s',_0x56900f,_0xcc55fd[_0x8a9c('0x11')]['message']);return _0x5bf7c9(_0xcc55fd[_0x8a9c('0x11')][_0x8a9c('0x12')]);}else{logger[_0x8a9c('0x13')]('VoiceMail,\x20%s,\x20%s',_0x56900f,_0x8a9c('0xd'));_0x5bf7c9(_0xcc55fd[_0x8a9c('0x14')]['message']);}})['catch'](function(_0x21da4f){logger[_0x8a9c('0x11')](_0x8a9c('0x10'),_0x56900f,_0x21da4f);_0x218811(_0x21da4f);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index ea0c3f3..db5ac73 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 _0xa603=['../../components/interaction/service','./voiceMailMessage.controller','get','isAuthenticated','/:id','show','/:id/download','create','put','update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x58fa60,_0x7ca599){var _0x38dbe3=function(_0x3315ea){while(--_0x3315ea){_0x58fa60['push'](_0x58fa60['shift']());}};_0x38dbe3(++_0x7ca599);}(_0xa603,0x13c));var _0x3a60=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xa603[_0x57b54c];return _0x59cc19;};'use strict';var multer=require('multer');var util=require(_0x3a60('0x0'));var path=require(_0x3a60('0x1'));var timeout=require(_0x3a60('0x2'));var express=require(_0x3a60('0x3'));var router=express[_0x3a60('0x4')]();var fs_extra=require(_0x3a60('0x5'));var auth=require(_0x3a60('0x6'));var interaction=require(_0x3a60('0x7'));var config=require('../../config/environment');var controller=require(_0x3a60('0x8'));router[_0x3a60('0x9')]('/',auth[_0x3a60('0xa')](),controller['index']);router[_0x3a60('0x9')](_0x3a60('0xb'),auth['isAuthenticated'](),controller[_0x3a60('0xc')]);router[_0x3a60('0x9')](_0x3a60('0xd'),auth['isAuthenticated'](),controller['download']);router['post']('/',auth[_0x3a60('0xa')](),controller[_0x3a60('0xe')]);router[_0x3a60('0xf')](_0x3a60('0xb'),auth[_0x3a60('0xa')](),controller[_0x3a60('0x10')]);router['delete'](_0x3a60('0xb'),auth[_0x3a60('0xa')](),controller[_0x3a60('0x11')]);module[_0x3a60('0x12')]=router; \ No newline at end of file +var _0x9bd2=['get','/:id','show','/:id/download','download','post','update','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','isAuthenticated','index'];(function(_0x79ec09,_0x460e17){var _0xf424=function(_0x5b0127){while(--_0x5b0127){_0x79ec09['push'](_0x79ec09['shift']());}};_0xf424(++_0x460e17);}(_0x9bd2,0x10e));var _0x29bd=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9bd2[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x29bd('0x0'));var util=require(_0x29bd('0x1'));var path=require(_0x29bd('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x29bd('0x3')]();var fs_extra=require(_0x29bd('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x29bd('0x5'));var config=require(_0x29bd('0x6'));var controller=require(_0x29bd('0x7'));router['get']('/',auth[_0x29bd('0x8')](),controller[_0x29bd('0x9')]);router[_0x29bd('0xa')](_0x29bd('0xb'),auth[_0x29bd('0x8')](),controller[_0x29bd('0xc')]);router['get'](_0x29bd('0xd'),auth[_0x29bd('0x8')](),controller[_0x29bd('0xe')]);router[_0x29bd('0xf')]('/',auth[_0x29bd('0x8')](),controller['create']);router['put'](_0x29bd('0xb'),auth['isAuthenticated'](),controller[_0x29bd('0x10')]);router[_0x29bd('0x11')](_0x29bd('0xb'),auth['isAuthenticated'](),controller[_0x29bd('0x12')]);module[_0x29bd('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index 047ce3f..be5f720 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 _0x5eb3=['INTEGER','STRING','BLOB','long','TIMESTAMP','sequelize','VIRTUAL'];(function(_0x20b276,_0x5a78f5){var _0x2d719d=function(_0x193ac2){while(--_0x193ac2){_0x20b276['push'](_0x20b276['shift']());}};_0x2d719d(++_0x5a78f5);}(_0x5eb3,0xc9));var _0x35eb=function(_0xaa1b3e,_0x47d976){_0xaa1b3e=_0xaa1b3e-0x0;var _0x454d7d=_0x5eb3[_0xaa1b3e];return _0x454d7d;};'use strict';var Sequelize=require(_0x35eb('0x0'));module['exports']={'name':{'type':Sequelize[_0x35eb('0x1')],'get':function(_0x4a723d){return this['getDataValue']('id');}},'msgnum':{'type':Sequelize[_0x35eb('0x2')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x35eb('0x3')],'defaultValue':''},'context':{'type':Sequelize[_0x35eb('0x3')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x35eb('0x3')],'defaultValue':''},'callerid':{'type':Sequelize[_0x35eb('0x3')],'defaultValue':''},'origtime':{'type':Sequelize[_0x35eb('0x3')],'defaultValue':''},'duration':{'type':Sequelize[_0x35eb('0x3')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x35eb('0x3')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x35eb('0x3')],'defaultValue':''},'recording':{'type':Sequelize[_0x35eb('0x4')](_0x35eb('0x5')),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize[_0x35eb('0x3')],'defaultValue':''},'stamp':{'type':_0x35eb('0x6'),'defaultValue':Sequelize['literal']('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}}; \ No newline at end of file +var _0xe146=['STRING','long','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','VIRTUAL','getDataValue'];(function(_0x2df507,_0x553862){var _0x1f7167=function(_0x11319e){while(--_0x11319e){_0x2df507['push'](_0x2df507['shift']());}};_0x1f7167(++_0x553862);}(_0xe146,0x1cb));var _0x6e14=function(_0x47aa64,_0xfb8a07){_0x47aa64=_0x47aa64-0x0;var _0x549c7a=_0xe146[_0x47aa64];return _0x549c7a;};'use strict';var Sequelize=require(_0x6e14('0x0'));module['exports']={'name':{'type':Sequelize[_0x6e14('0x1')],'get':function(_0x592773){return this[_0x6e14('0x2')]('id');}},'msgnum':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x6e14('0x3')],'defaultValue':''},'context':{'type':Sequelize[_0x6e14('0x3')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x6e14('0x3')],'defaultValue':''},'callerid':{'type':Sequelize[_0x6e14('0x3')],'defaultValue':''},'origtime':{'type':Sequelize['STRING'],'defaultValue':''},'duration':{'type':Sequelize[_0x6e14('0x3')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x6e14('0x3')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x6e14('0x3')],'defaultValue':''},'recording':{'type':Sequelize['BLOB'](_0x6e14('0x4')),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize['STRING'],'defaultValue':''},'stamp':{'type':'TIMESTAMP','defaultValue':Sequelize[_0x6e14('0x5')](_0x6e14('0x6'))}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index 9b768c1..8040023 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 _0x3061=['recording','Sequelize','ValidationError','audio/wav','attachment','msg_id','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','send','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','name','index','map','VoiceMailMessage','rawAttributes','key','differenceBy','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','type','VIRTUAL','merge','options','include','findAll','rows','catch','show','params','includeAll','create','body','find','download'];(function(_0xa4f752,_0x28ee8d){var _0x280567=function(_0xef3db7){while(--_0xef3db7){_0xa4f752['push'](_0xa4f752['shift']());}};_0x280567(++_0x28ee8d);}(_0x3061,0x162));var _0x1306=function(_0x1af05b,_0x5134b5){_0x1af05b=_0x1af05b-0x0;var _0x5be7cc=_0x3061[_0x1af05b];return _0x5be7cc;};'use strict';var emlformat=require(_0x1306('0x0'));var rimraf=require(_0x1306('0x1'));var zipdir=require(_0x1306('0x2'));var jsonpatch=require(_0x1306('0x3'));var rp=require('request-promise');var moment=require(_0x1306('0x4'));var BPromise=require(_0x1306('0x5'));var Mustache=require(_0x1306('0x6'));var util=require('util');var path=require(_0x1306('0x7'));var sox=require(_0x1306('0x8'));var csv=require(_0x1306('0x9'));var ejs=require(_0x1306('0xa'));var fs=require('fs');var fs_extra=require(_0x1306('0xb'));var _=require(_0x1306('0xc'));var squel=require(_0x1306('0xd'));var crypto=require(_0x1306('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x1306('0xf'));var toCsv=require('to-csv');var querystring=require(_0x1306('0x10'));var Papa=require(_0x1306('0x11'));var Redis=require(_0x1306('0x12'));var authService=require(_0x1306('0x13'));var qs=require(_0x1306('0x14'));var as=require(_0x1306('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x1306('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x1306('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xf7f7e1,_0xa5ff8b){_0xa5ff8b=_0xa5ff8b||0xcc;return function(_0x8dab31){if(_0x8dab31){return _0xf7f7e1[_0x1306('0x18')](_0xa5ff8b);}return _0xf7f7e1[_0x1306('0x19')](_0xa5ff8b)[_0x1306('0x1a')]();};}function respondWithResult(_0x3ec293,_0x3afca2){_0x3afca2=_0x3afca2||0xc8;return function(_0x22c1ec){if(_0x22c1ec){return _0x3ec293[_0x1306('0x19')](_0x3afca2)[_0x1306('0x1b')](_0x22c1ec);}};}function respondWithFilteredResult(_0x5ae1e8,_0x730a52){return function(_0x4b5b3a){if(_0x4b5b3a){var _0x4a0d86=typeof _0x730a52[_0x1306('0x1c')]===_0x1306('0x1d')&&typeof _0x730a52[_0x1306('0x1e')]===_0x1306('0x1d');var _0x3dfd26=_0x4b5b3a[_0x1306('0x1f')];var _0x29dbd3=_0x4a0d86?0x0:_0x730a52[_0x1306('0x1c')];var _0x28aef7=_0x4a0d86?_0x4b5b3a['count']:_0x730a52[_0x1306('0x1c')]+_0x730a52[_0x1306('0x1e')];var _0x436bb6;if(_0x28aef7>=_0x3dfd26){_0x28aef7=_0x3dfd26;_0x436bb6=0xc8;}else{_0x436bb6=0xce;}_0x5ae1e8[_0x1306('0x19')](_0x436bb6);return _0x5ae1e8[_0x1306('0x20')](_0x1306('0x21'),_0x29dbd3+'-'+_0x28aef7+'/'+_0x3dfd26)[_0x1306('0x1b')](_0x4b5b3a);}return null;};}function patchUpdates(_0x3fb7cf){return function(_0x25db0c){try{jsonpatch[_0x1306('0x22')](_0x25db0c,_0x3fb7cf,!![]);}catch(_0x293e44){return BPromise[_0x1306('0x23')](_0x293e44);}return _0x25db0c['save']();};}function saveUpdates(_0x29a0c1,_0x365a97){return function(_0x53f4a9){if(_0x53f4a9){return _0x53f4a9[_0x1306('0x24')](_0x29a0c1)[_0x1306('0x25')](function(_0x34e627){return _0x34e627;});}return null;};}function removeEntity(_0x4727a1,_0x561fd5){return function(_0x17b997){if(_0x17b997){return _0x17b997[_0x1306('0x26')]()[_0x1306('0x25')](function(){_0x4727a1['status'](0xcc)[_0x1306('0x1a')]();});}};}function handleEntityNotFound(_0x3cb3be,_0x375db2){return function(_0x1ff5cc){if(!_0x1ff5cc){_0x3cb3be['sendStatus'](0x194);}return _0x1ff5cc;};}function handleError(_0x2d3774,_0x2b0157){_0x2b0157=_0x2b0157||0x1f4;return function(_0x26b1d2){logger[_0x1306('0x27')](_0x26b1d2['stack']);if(_0x26b1d2[_0x1306('0x28')]){delete _0x26b1d2[_0x1306('0x28')];}_0x2d3774[_0x1306('0x19')](_0x2b0157)['send'](_0x26b1d2);};}exports[_0x1306('0x29')]=function(_0x148c47,_0x395ec1){var _0x28b6cd={},_0x4c640c={},_0x2126ec={'count':0x0,'rows':[]};var _0x3ccbd4=_[_0x1306('0x2a')](db[_0x1306('0x2b')][_0x1306('0x2c')],function(_0x3ac167){return{'name':_0x3ac167['fieldName'],'type':_0x3ac167['type'][_0x1306('0x2d')]};});_0x4c640c['model']=_[_0x1306('0x2e')](_['map'](_0x3ccbd4,_0x1306('0x28')),[_0x1306('0x28')]);_0x4c640c[_0x1306('0x2f')]=_[_0x1306('0x30')](_0x148c47[_0x1306('0x2f')]);_0x4c640c[_0x1306('0x31')]=_[_0x1306('0x32')](_0x4c640c[_0x1306('0x33')],_0x4c640c[_0x1306('0x2f')]);_0x28b6cd[_0x1306('0x34')]=_[_0x1306('0x32')](_0x4c640c[_0x1306('0x33')],qs[_0x1306('0x35')](_0x148c47[_0x1306('0x2f')][_0x1306('0x35')]));_0x28b6cd[_0x1306('0x34')]=_0x28b6cd[_0x1306('0x34')][_0x1306('0x36')]?_0x28b6cd[_0x1306('0x34')]:_0x4c640c[_0x1306('0x33')];if(!_0x148c47[_0x1306('0x2f')][_0x1306('0x37')](_0x1306('0x38'))){_0x28b6cd[_0x1306('0x1e')]=qs[_0x1306('0x1e')](_0x148c47['query'][_0x1306('0x1e')]);_0x28b6cd[_0x1306('0x1c')]=qs[_0x1306('0x1c')](_0x148c47[_0x1306('0x2f')][_0x1306('0x1c')]);}_0x28b6cd[_0x1306('0x39')]=qs['sort'](_0x148c47[_0x1306('0x2f')][_0x1306('0x3a')]);_0x28b6cd[_0x1306('0x3b')]=qs[_0x1306('0x31')](_['pick'](_0x148c47[_0x1306('0x2f')],_0x4c640c['filters']),_0x3ccbd4);if(_0x148c47['query'][_0x1306('0x3c')]){_0x28b6cd[_0x1306('0x3b')]=_['merge'](_0x28b6cd[_0x1306('0x3b')],{'$or':_[_0x1306('0x2a')](_0x3ccbd4,function(_0xfa35a0){if(_0xfa35a0[_0x1306('0x3d')]!==_0x1306('0x3e')){var _0x47d7c5={};_0x47d7c5[_0xfa35a0[_0x1306('0x28')]]={'$like':'%'+_0x148c47['query'][_0x1306('0x3c')]+'%'};return _0x47d7c5;}})});}_0x28b6cd=_[_0x1306('0x3f')]({},_0x28b6cd,_0x148c47[_0x1306('0x40')]);var _0x4eb3d1={'where':_0x28b6cd[_0x1306('0x3b')]};return db['VoiceMailMessage']['count'](_0x4eb3d1)[_0x1306('0x25')](function(_0x2ce985){_0x2126ec[_0x1306('0x1f')]=_0x2ce985;if(_0x148c47[_0x1306('0x2f')]['includeAll']){_0x28b6cd[_0x1306('0x41')]=[{'all':!![]}];}return db['VoiceMailMessage'][_0x1306('0x42')](_0x28b6cd);})[_0x1306('0x25')](function(_0x866cd5){_0x2126ec[_0x1306('0x43')]=_0x866cd5;return _0x2126ec;})[_0x1306('0x25')](respondWithFilteredResult(_0x395ec1,_0x28b6cd))[_0x1306('0x44')](handleError(_0x395ec1,null));};exports[_0x1306('0x45')]=function(_0x48601d,_0x52e97e){var _0x381c12={'raw':!![],'where':{'id':_0x48601d[_0x1306('0x46')]['id']}},_0x1d62d5={};_0x1d62d5[_0x1306('0x33')]=_['keys'](db[_0x1306('0x2b')][_0x1306('0x2c')]);_0x1d62d5[_0x1306('0x2f')]=_[_0x1306('0x30')](_0x48601d['query']);_0x1d62d5[_0x1306('0x31')]=_[_0x1306('0x32')](_0x1d62d5[_0x1306('0x33')],_0x1d62d5[_0x1306('0x2f')]);_0x381c12[_0x1306('0x34')]=_[_0x1306('0x32')](_0x1d62d5[_0x1306('0x33')],qs[_0x1306('0x35')](_0x48601d['query'][_0x1306('0x35')]));_0x381c12[_0x1306('0x34')]=_0x381c12['attributes'][_0x1306('0x36')]?_0x381c12[_0x1306('0x34')]:_0x1d62d5[_0x1306('0x33')];if(_0x48601d[_0x1306('0x2f')][_0x1306('0x47')]){_0x381c12[_0x1306('0x41')]=[{'all':!![]}];}_0x381c12=_['merge']({},_0x381c12,_0x48601d[_0x1306('0x40')]);return db[_0x1306('0x2b')]['find'](_0x381c12)[_0x1306('0x25')](handleEntityNotFound(_0x52e97e,null))[_0x1306('0x25')](respondWithResult(_0x52e97e,null))[_0x1306('0x44')](handleError(_0x52e97e,null));};exports[_0x1306('0x48')]=function(_0x39d9ed,_0x113937){return db['VoiceMailMessage'][_0x1306('0x48')](_0x39d9ed[_0x1306('0x49')],{})[_0x1306('0x25')](respondWithResult(_0x113937,0xc9))[_0x1306('0x44')](handleError(_0x113937,null));};exports[_0x1306('0x24')]=function(_0x225bc9,_0x53ac8d){if(_0x225bc9[_0x1306('0x49')]['id']){delete _0x225bc9[_0x1306('0x49')]['id'];}return db['VoiceMailMessage'][_0x1306('0x4a')]({'where':{'id':_0x225bc9[_0x1306('0x46')]['id']}})['then'](handleEntityNotFound(_0x53ac8d,null))['then'](saveUpdates(_0x225bc9[_0x1306('0x49')],null))[_0x1306('0x25')](respondWithResult(_0x53ac8d,null))[_0x1306('0x44')](handleError(_0x53ac8d,null));};exports[_0x1306('0x26')]=function(_0x305b94,_0x38b6f4){return db['VoiceMailMessage']['find']({'where':{'id':_0x305b94[_0x1306('0x46')]['id']}})['then'](handleEntityNotFound(_0x38b6f4,null))[_0x1306('0x25')](removeEntity(_0x38b6f4,null))[_0x1306('0x44')](handleError(_0x38b6f4,null));};exports[_0x1306('0x4b')]=function(_0x839b72,_0x1e2ab9,_0x116a3f){return db[_0x1306('0x2b')]['find']({'where':{'id':_0x839b72[_0x1306('0x46')]['id']},'attributes':['id',_0x1306('0x4c'),'msg_id']})[_0x1306('0x25')](handleEntityNotFound(_0x1e2ab9,null))[_0x1306('0x25')](function(_0x3a15cb){if(_0x3a15cb){if(!_0x3a15cb[_0x1306('0x4c')]){throw new db[(_0x1306('0x4d'))][(_0x1306('0x4e'))]('VoiceMailMessage\x20not\x20found');}var _0x3fa456={'Content-Type':_0x1306('0x4f'),'Content-Disposition':_0x1306('0x50')};if(_0x3a15cb[_0x1306('0x51')]){_0x3fa456[_0x1306('0x52')]=_0x1306('0x53')+_0x3a15cb[_0x1306('0x51')]+_0x1306('0x54');}_0x1e2ab9['set'](_0x3fa456);return _0x1e2ab9[_0x1306('0x55')](new Buffer(_0x3a15cb[_0x1306('0x4c')]));}})[_0x1306('0x44')](handleError(_0x1e2ab9,null));}; \ No newline at end of file +var _0x62eb=['papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','status','offset','undefined','limit','count','Content-Range','json','apply','reject','save','then','destroy','end','stack','name','send','index','map','rawAttributes','fieldName','key','model','differenceBy','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','VoiceMailMessage','includeAll','include','findAll','rows','params','keys','fields','find','catch','create','update','body','download','recording','Sequelize','VoiceMailMessage\x20not\x20found','audio/wav','attachment','msg_id','attachment;\x20filename=\x22','set','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js'];(function(_0x27657c,_0x36813e){var _0x12324a=function(_0x3f6eea){while(--_0x3f6eea){_0x27657c['push'](_0x27657c['shift']());}};_0x12324a(++_0x36813e);}(_0x62eb,0x144));var _0xb62e=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x62eb[_0x5d6456];return _0x4d66c1;};'use strict';var emlformat=require(_0xb62e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb62e('0x1'));var jsonpatch=require(_0xb62e('0x2'));var rp=require('request-promise');var moment=require(_0xb62e('0x3'));var BPromise=require(_0xb62e('0x4'));var Mustache=require('mustache');var util=require(_0xb62e('0x5'));var path=require(_0xb62e('0x6'));var sox=require(_0xb62e('0x7'));var csv=require(_0xb62e('0x8'));var ejs=require(_0xb62e('0x9'));var fs=require('fs');var fs_extra=require(_0xb62e('0xa'));var _=require(_0xb62e('0xb'));var squel=require(_0xb62e('0xc'));var crypto=require(_0xb62e('0xd'));var jsforce=require(_0xb62e('0xe'));var deskjs=require(_0xb62e('0xf'));var toCsv=require(_0xb62e('0x8'));var querystring=require('querystring');var Papa=require(_0xb62e('0x10'));var Redis=require('ioredis');var authService=require(_0xb62e('0x11'));var qs=require(_0xb62e('0x12'));var as=require(_0xb62e('0x13'));var hardwareService=require(_0xb62e('0x14'));var logger=require('../../config/logger')(_0xb62e('0x15'));var utils=require(_0xb62e('0x16'));var config=require(_0xb62e('0x17'));var licenseUtil=require(_0xb62e('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x438587,_0x477800){_0x477800=_0x477800||0xcc;return function(_0x5362af){if(_0x5362af){return _0x438587['sendStatus'](_0x477800);}return _0x438587[_0xb62e('0x19')](_0x477800)['end']();};}function respondWithResult(_0xd8cc34,_0x532d5f){_0x532d5f=_0x532d5f||0xc8;return function(_0x3bcbb7){if(_0x3bcbb7){return _0xd8cc34[_0xb62e('0x19')](_0x532d5f)['json'](_0x3bcbb7);}};}function respondWithFilteredResult(_0x46199f,_0x5d7c31){return function(_0x3add01){if(_0x3add01){var _0x1f916a=typeof _0x5d7c31[_0xb62e('0x1a')]===_0xb62e('0x1b')&&typeof _0x5d7c31[_0xb62e('0x1c')]===_0xb62e('0x1b');var _0x516395=_0x3add01[_0xb62e('0x1d')];var _0x2a047b=_0x1f916a?0x0:_0x5d7c31['offset'];var _0x5f3101=_0x1f916a?_0x3add01[_0xb62e('0x1d')]:_0x5d7c31['offset']+_0x5d7c31['limit'];var _0x241e71;if(_0x5f3101>=_0x516395){_0x5f3101=_0x516395;_0x241e71=0xc8;}else{_0x241e71=0xce;}_0x46199f[_0xb62e('0x19')](_0x241e71);return _0x46199f['set'](_0xb62e('0x1e'),_0x2a047b+'-'+_0x5f3101+'/'+_0x516395)[_0xb62e('0x1f')](_0x3add01);}return null;};}function patchUpdates(_0x59c120){return function(_0x4fa87b){try{jsonpatch[_0xb62e('0x20')](_0x4fa87b,_0x59c120,!![]);}catch(_0x475bd6){return BPromise[_0xb62e('0x21')](_0x475bd6);}return _0x4fa87b[_0xb62e('0x22')]();};}function saveUpdates(_0x4faf6c,_0xa7db51){return function(_0x44b374){if(_0x44b374){return _0x44b374['update'](_0x4faf6c)[_0xb62e('0x23')](function(_0x1a0c34){return _0x1a0c34;});}return null;};}function removeEntity(_0x2e7a67,_0x1da9b5){return function(_0xb78729){if(_0xb78729){return _0xb78729[_0xb62e('0x24')]()[_0xb62e('0x23')](function(){_0x2e7a67[_0xb62e('0x19')](0xcc)[_0xb62e('0x25')]();});}};}function handleEntityNotFound(_0x332ba4,_0x55fb53){return function(_0x2dfbed){if(!_0x2dfbed){_0x332ba4['sendStatus'](0x194);}return _0x2dfbed;};}function handleError(_0x2c92cc,_0x5502c2){_0x5502c2=_0x5502c2||0x1f4;return function(_0x43ab9b){logger['error'](_0x43ab9b[_0xb62e('0x26')]);if(_0x43ab9b[_0xb62e('0x27')]){delete _0x43ab9b[_0xb62e('0x27')];}_0x2c92cc[_0xb62e('0x19')](_0x5502c2)[_0xb62e('0x28')](_0x43ab9b);};}exports[_0xb62e('0x29')]=function(_0x4b92f5,_0x346924){var _0x9029ec={},_0x2299fd={},_0x451a11={'count':0x0,'rows':[]};var _0x430f48=_[_0xb62e('0x2a')](db['VoiceMailMessage'][_0xb62e('0x2b')],function(_0x679470){return{'name':_0x679470[_0xb62e('0x2c')],'type':_0x679470['type'][_0xb62e('0x2d')]};});_0x2299fd[_0xb62e('0x2e')]=_[_0xb62e('0x2f')](_[_0xb62e('0x2a')](_0x430f48,'name'),[_0xb62e('0x27')]);_0x2299fd[_0xb62e('0x30')]=_['keys'](_0x4b92f5[_0xb62e('0x30')]);_0x2299fd[_0xb62e('0x31')]=_[_0xb62e('0x32')](_0x2299fd[_0xb62e('0x2e')],_0x2299fd[_0xb62e('0x30')]);_0x9029ec[_0xb62e('0x33')]=_[_0xb62e('0x32')](_0x2299fd['model'],qs['fields'](_0x4b92f5[_0xb62e('0x30')]['fields']));_0x9029ec[_0xb62e('0x33')]=_0x9029ec[_0xb62e('0x33')][_0xb62e('0x34')]?_0x9029ec[_0xb62e('0x33')]:_0x2299fd[_0xb62e('0x2e')];if(!_0x4b92f5[_0xb62e('0x30')][_0xb62e('0x35')](_0xb62e('0x36'))){_0x9029ec[_0xb62e('0x1c')]=qs['limit'](_0x4b92f5[_0xb62e('0x30')][_0xb62e('0x1c')]);_0x9029ec[_0xb62e('0x1a')]=qs[_0xb62e('0x1a')](_0x4b92f5['query'][_0xb62e('0x1a')]);}_0x9029ec['order']=qs[_0xb62e('0x37')](_0x4b92f5[_0xb62e('0x30')][_0xb62e('0x37')]);_0x9029ec[_0xb62e('0x38')]=qs[_0xb62e('0x31')](_[_0xb62e('0x39')](_0x4b92f5[_0xb62e('0x30')],_0x2299fd[_0xb62e('0x31')]),_0x430f48);if(_0x4b92f5[_0xb62e('0x30')][_0xb62e('0x3a')]){_0x9029ec[_0xb62e('0x38')]=_[_0xb62e('0x3b')](_0x9029ec[_0xb62e('0x38')],{'$or':_[_0xb62e('0x2a')](_0x430f48,function(_0x1e757c){if(_0x1e757c[_0xb62e('0x3c')]!==_0xb62e('0x3d')){var _0x301233={};_0x301233[_0x1e757c[_0xb62e('0x27')]]={'$like':'%'+_0x4b92f5[_0xb62e('0x30')]['filter']+'%'};return _0x301233;}})});}_0x9029ec=_[_0xb62e('0x3b')]({},_0x9029ec,_0x4b92f5[_0xb62e('0x3e')]);var _0x27e68b={'where':_0x9029ec[_0xb62e('0x38')]};return db[_0xb62e('0x3f')][_0xb62e('0x1d')](_0x27e68b)[_0xb62e('0x23')](function(_0x348d00){_0x451a11[_0xb62e('0x1d')]=_0x348d00;if(_0x4b92f5[_0xb62e('0x30')][_0xb62e('0x40')]){_0x9029ec[_0xb62e('0x41')]=[{'all':!![]}];}return db['VoiceMailMessage'][_0xb62e('0x42')](_0x9029ec);})[_0xb62e('0x23')](function(_0x39061c){_0x451a11[_0xb62e('0x43')]=_0x39061c;return _0x451a11;})[_0xb62e('0x23')](respondWithFilteredResult(_0x346924,_0x9029ec))['catch'](handleError(_0x346924,null));};exports['show']=function(_0x591cfb,_0x5b47c6){var _0xe463e7={'raw':!![],'where':{'id':_0x591cfb[_0xb62e('0x44')]['id']}},_0x3e8fb5={};_0x3e8fb5[_0xb62e('0x2e')]=_[_0xb62e('0x45')](db[_0xb62e('0x3f')][_0xb62e('0x2b')]);_0x3e8fb5[_0xb62e('0x30')]=_[_0xb62e('0x45')](_0x591cfb[_0xb62e('0x30')]);_0x3e8fb5[_0xb62e('0x31')]=_[_0xb62e('0x32')](_0x3e8fb5['model'],_0x3e8fb5[_0xb62e('0x30')]);_0xe463e7['attributes']=_[_0xb62e('0x32')](_0x3e8fb5[_0xb62e('0x2e')],qs['fields'](_0x591cfb[_0xb62e('0x30')][_0xb62e('0x46')]));_0xe463e7['attributes']=_0xe463e7['attributes'][_0xb62e('0x34')]?_0xe463e7['attributes']:_0x3e8fb5[_0xb62e('0x2e')];if(_0x591cfb[_0xb62e('0x30')]['includeAll']){_0xe463e7[_0xb62e('0x41')]=[{'all':!![]}];}_0xe463e7=_['merge']({},_0xe463e7,_0x591cfb[_0xb62e('0x3e')]);return db['VoiceMailMessage'][_0xb62e('0x47')](_0xe463e7)[_0xb62e('0x23')](handleEntityNotFound(_0x5b47c6,null))[_0xb62e('0x23')](respondWithResult(_0x5b47c6,null))[_0xb62e('0x48')](handleError(_0x5b47c6,null));};exports[_0xb62e('0x49')]=function(_0x1a2d5d,_0x4df894){return db[_0xb62e('0x3f')][_0xb62e('0x49')](_0x1a2d5d['body'],{})['then'](respondWithResult(_0x4df894,0xc9))['catch'](handleError(_0x4df894,null));};exports[_0xb62e('0x4a')]=function(_0x459c62,_0x2800dd){if(_0x459c62[_0xb62e('0x4b')]['id']){delete _0x459c62['body']['id'];}return db[_0xb62e('0x3f')][_0xb62e('0x47')]({'where':{'id':_0x459c62[_0xb62e('0x44')]['id']}})[_0xb62e('0x23')](handleEntityNotFound(_0x2800dd,null))[_0xb62e('0x23')](saveUpdates(_0x459c62['body'],null))[_0xb62e('0x23')](respondWithResult(_0x2800dd,null))[_0xb62e('0x48')](handleError(_0x2800dd,null));};exports[_0xb62e('0x24')]=function(_0x1cb17b,_0x187ca4){return db['VoiceMailMessage']['find']({'where':{'id':_0x1cb17b['params']['id']}})[_0xb62e('0x23')](handleEntityNotFound(_0x187ca4,null))['then'](removeEntity(_0x187ca4,null))[_0xb62e('0x48')](handleError(_0x187ca4,null));};exports[_0xb62e('0x4c')]=function(_0x1c8aab,_0x3971ea,_0x2f013a){return db[_0xb62e('0x3f')]['find']({'where':{'id':_0x1c8aab[_0xb62e('0x44')]['id']},'attributes':['id',_0xb62e('0x4d'),'msg_id']})['then'](handleEntityNotFound(_0x3971ea,null))[_0xb62e('0x23')](function(_0xd0d9c9){if(_0xd0d9c9){if(!_0xd0d9c9['recording']){throw new db[(_0xb62e('0x4e'))]['ValidationError'](_0xb62e('0x4f'));}var _0x3477d9={'Content-Type':_0xb62e('0x50'),'Content-Disposition':_0xb62e('0x51')};if(_0xd0d9c9[_0xb62e('0x52')]){_0x3477d9['Content-Disposition']=_0xb62e('0x53')+_0xd0d9c9['msg_id']+'.wav\x22';}_0x3971ea[_0xb62e('0x54')](_0x3477d9);return _0x3971ea['send'](new Buffer(_0xd0d9c9[_0xb62e('0x4d')]));}})['catch'](handleError(_0x3971ea,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index 08e39c3..3bcf29e 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 _0x7b9c=['path','rimraf','./voiceMailMessage.attributes','exports','define','VoiceMailMessage','voice_voicemail_messages','dir','api','bluebird','request-promise'];(function(_0x1591d4,_0x4ea3bd){var _0x4c46bb=function(_0x13b7e7){while(--_0x13b7e7){_0x1591d4['push'](_0x1591d4['shift']());}};_0x4c46bb(++_0x4ea3bd);}(_0x7b9c,0x1ec));var _0xc7b9=function(_0x314997,_0x234a37){_0x314997=_0x314997-0x0;var _0x46e9ca=_0x7b9c[_0x314997];return _0x46e9ca;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xc7b9('0x0'));var moment=require('moment');var BPromise=require(_0xc7b9('0x1'));var rp=require(_0xc7b9('0x2'));var fs=require('fs');var path=require(_0xc7b9('0x3'));var rimraf=require(_0xc7b9('0x4'));var config=require('../../config/environment');var attributes=require(_0xc7b9('0x5'));module[_0xc7b9('0x6')]=function(_0x1e3fef,_0x3e11f6){return _0x1e3fef[_0xc7b9('0x7')](_0xc7b9('0x8'),attributes,{'tableName':_0xc7b9('0x9'),'paranoid':![],'indexes':[{'name':_0xc7b9('0xa'),'fields':[_0xc7b9('0xa')]}],'timestamps':![]});}; \ No newline at end of file +var _0xc00c=['VoiceMailMessage','voice_voicemail_messages','dir','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','define'];(function(_0x1a72f3,_0x217011){var _0x57ef47=function(_0x20123d){while(--_0x20123d){_0x1a72f3['push'](_0x1a72f3['shift']());}};_0x57ef47(++_0x217011);}(_0xc00c,0x1b5));var _0xcc00=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0xc00c[_0x138adb];return _0x1b27f2;};'use strict';var _=require(_0xcc00('0x0'));var util=require(_0xcc00('0x1'));var logger=require(_0xcc00('0x2'))(_0xcc00('0x3'));var moment=require(_0xcc00('0x4'));var BPromise=require(_0xcc00('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcc00('0x6'));var rimraf=require(_0xcc00('0x7'));var config=require(_0xcc00('0x8'));var attributes=require('./voiceMailMessage.attributes');module[_0xcc00('0x9')]=function(_0x3e3456,_0x13684d){return _0x3e3456[_0xcc00('0xa')](_0xcc00('0xb'),attributes,{'tableName':_0xcc00('0xc'),'paranoid':![],'indexes':[{'name':_0xcc00('0xd'),'fields':['dir']}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index bf0312f..695bea5 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 _0x74c3=['debug','request\x20sent','stringify','error','code','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','VoiceMailMessage,\x20%s,\x20%s'];(function(_0x117c95,_0x372c77){var _0xb15f29=function(_0x17fe20){while(--_0x17fe20){_0x117c95['push'](_0x117c95['shift']());}};_0xb15f29(++_0x372c77);}(_0x74c3,0x98));var _0x374c=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0x74c3[_0x55e08b];return _0xd1a7ff;};'use strict';var _=require(_0x374c('0x0'));var util=require(_0x374c('0x1'));var moment=require(_0x374c('0x2'));var BPromise=require(_0x374c('0x3'));var rs=require(_0x374c('0x4'));var fs=require('fs');var Redis=require(_0x374c('0x5'));var db=require(_0x374c('0x6'))['db'];var utils=require(_0x374c('0x7'));var logger=require(_0x374c('0x8'))(_0x374c('0x9'));var config=require(_0x374c('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x374c('0xb')][_0x374c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x54d556,_0x480ba2,_0x3c4ca7){return new BPromise(function(_0x243811,_0x3b191c){return client[_0x374c('0xd')](_0x54d556,_0x3c4ca7)[_0x374c('0xe')](function(_0x55c38e){logger['info'](_0x374c('0xf'),_0x480ba2,'request\x20sent');logger[_0x374c('0x10')]('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x480ba2,_0x374c('0x11'),JSON[_0x374c('0x12')](_0x55c38e));if(_0x55c38e['error']){if(_0x55c38e[_0x374c('0x13')][_0x374c('0x14')]===0x1f4){logger[_0x374c('0x13')](_0x374c('0xf'),_0x480ba2,_0x55c38e[_0x374c('0x13')][_0x374c('0x15')]);return _0x3b191c(_0x55c38e[_0x374c('0x13')][_0x374c('0x15')]);}logger[_0x374c('0x13')](_0x374c('0xf'),_0x480ba2,_0x55c38e[_0x374c('0x13')][_0x374c('0x15')]);return _0x243811(_0x55c38e[_0x374c('0x13')][_0x374c('0x15')]);}else{logger[_0x374c('0x16')](_0x374c('0xf'),_0x480ba2,_0x374c('0x11'));_0x243811(_0x55c38e[_0x374c('0x17')][_0x374c('0x15')]);}})['catch'](function(_0x210deb){logger[_0x374c('0x13')]('VoiceMailMessage,\x20%s,\x20%s',_0x480ba2,_0x210deb);_0x3b191c(_0x210deb);});});} \ No newline at end of file +var _0xf2ac=['../../config/logger','../../config/environment','client','http','request','then','info','VoiceMailMessage,\x20%s,\x20%s','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x155376,_0x157794){var _0x30d5ff=function(_0x3d4837){while(--_0x3d4837){_0x155376['push'](_0x155376['shift']());}};_0x30d5ff(++_0x157794);}(_0xf2ac,0xa3));var _0xcf2a=function(_0x47b56b,_0x5450be){_0x47b56b=_0x47b56b-0x0;var _0x45501f=_0xf2ac[_0x47b56b];return _0x45501f;};'use strict';var _=require('lodash');var util=require(_0xcf2a('0x0'));var moment=require('moment');var BPromise=require(_0xcf2a('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcf2a('0x2'));var db=require(_0xcf2a('0x3'))['db'];var utils=require(_0xcf2a('0x4'));var logger=require(_0xcf2a('0x5'))('rpc');var config=require(_0xcf2a('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xcf2a('0x7')][_0xcf2a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x233999,_0x30a4c7,_0xea018){return new BPromise(function(_0x143fbc,_0x5087b2){return client[_0xcf2a('0x9')](_0x233999,_0xea018)[_0xcf2a('0xa')](function(_0x210ebc){logger[_0xcf2a('0xb')](_0xcf2a('0xc'),_0x30a4c7,'request\x20sent');logger[_0xcf2a('0xd')](_0xcf2a('0xe'),_0x30a4c7,_0xcf2a('0xf'),JSON[_0xcf2a('0x10')](_0x210ebc));if(_0x210ebc['error']){if(_0x210ebc[_0xcf2a('0x11')]['code']===0x1f4){logger[_0xcf2a('0x11')](_0xcf2a('0xc'),_0x30a4c7,_0x210ebc['error'][_0xcf2a('0x12')]);return _0x5087b2(_0x210ebc[_0xcf2a('0x11')][_0xcf2a('0x12')]);}logger['error'](_0xcf2a('0xc'),_0x30a4c7,_0x210ebc[_0xcf2a('0x11')][_0xcf2a('0x12')]);return _0x143fbc(_0x210ebc[_0xcf2a('0x11')][_0xcf2a('0x12')]);}else{logger['info'](_0xcf2a('0xc'),_0x30a4c7,_0xcf2a('0xf'));_0x143fbc(_0x210ebc[_0xcf2a('0x13')][_0xcf2a('0x12')]);}})[_0xcf2a('0x14')](function(_0x48057a){logger['error'](_0xcf2a('0xc'),_0x30a4c7,_0x48057a);_0x5087b2(_0x48057a);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index 0b9ee3e..c310e27 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 _0x467c=['addSound','put','/:id','destroy','delete','/:id/sounds/:id2','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id/sounds','getSounds','post','create'];(function(_0x1a1b6e,_0x3a07a9){var _0x571e2c=function(_0x6cea62){while(--_0x6cea62){_0x1a1b6e['push'](_0x1a1b6e['shift']());}};_0x571e2c(++_0x3a07a9);}(_0x467c,0x10b));var _0xc467=function(_0x230bb9,_0x1ce784){_0x230bb9=_0x230bb9-0x0;var _0x245e5f=_0x467c[_0x230bb9];return _0x245e5f;};'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(_0xc467('0x4'));var auth=require(_0xc467('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xc467('0x6'));var controller=require('./voiceMusicOnHold.controller');router[_0xc467('0x7')]('/',auth[_0xc467('0x8')](),controller['index']);router[_0xc467('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router['get'](_0xc467('0x9'),auth[_0xc467('0x8')](),controller[_0xc467('0xa')]);router[_0xc467('0xb')]('/',auth[_0xc467('0x8')](),controller[_0xc467('0xc')]);router[_0xc467('0xb')](_0xc467('0x9'),auth['isAuthenticated'](),controller[_0xc467('0xd')]);router[_0xc467('0xe')](_0xc467('0xf'),auth[_0xc467('0x8')](),controller['update']);router['delete'](_0xc467('0xf'),auth[_0xc467('0x8')](),controller[_0xc467('0x10')]);router[_0xc467('0x11')](_0xc467('0x12'),auth[_0xc467('0x8')](),controller['removeSound']);module[_0xc467('0x13')]=router; \ No newline at end of file +var _0x6cae=['index','/:id','show','/:id/sounds','getSounds','post','create','addSound','update','destroy','/:id/sounds/:id2','removeSound','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x23516c,_0x16ea34){var _0x591310=function(_0x428292){while(--_0x428292){_0x23516c['push'](_0x23516c['shift']());}};_0x591310(++_0x16ea34);}(_0x6cae,0x145));var _0xe6ca=function(_0x1e1a5d,_0x5a63ee){_0x1e1a5d=_0x1e1a5d-0x0;var _0x5d5306=_0x6cae[_0x1e1a5d];return _0x5d5306;};'use strict';var multer=require('multer');var util=require(_0xe6ca('0x0'));var path=require(_0xe6ca('0x1'));var timeout=require(_0xe6ca('0x2'));var express=require(_0xe6ca('0x3'));var router=express[_0xe6ca('0x4')]();var fs_extra=require(_0xe6ca('0x5'));var auth=require(_0xe6ca('0x6'));var interaction=require(_0xe6ca('0x7'));var config=require(_0xe6ca('0x8'));var controller=require('./voiceMusicOnHold.controller');router[_0xe6ca('0x9')]('/',auth[_0xe6ca('0xa')](),controller[_0xe6ca('0xb')]);router[_0xe6ca('0x9')](_0xe6ca('0xc'),auth[_0xe6ca('0xa')](),controller[_0xe6ca('0xd')]);router[_0xe6ca('0x9')](_0xe6ca('0xe'),auth['isAuthenticated'](),controller[_0xe6ca('0xf')]);router[_0xe6ca('0x10')]('/',auth['isAuthenticated'](),controller[_0xe6ca('0x11')]);router['post'](_0xe6ca('0xe'),auth[_0xe6ca('0xa')](),controller[_0xe6ca('0x12')]);router['put'](_0xe6ca('0xc'),auth[_0xe6ca('0xa')](),controller[_0xe6ca('0x13')]);router['delete'](_0xe6ca('0xc'),auth[_0xe6ca('0xa')](),controller[_0xe6ca('0x14')]);router['delete'](_0xe6ca('0x15'),auth[_0xe6ca('0xa')](),controller[_0xe6ca('0x16')]);module[_0xe6ca('0x17')]=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index b3689f1..e8c1d26 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 _0x30bd=['sequelize','exports','STRING','name','custom','mp3nb','quietmp3','mp3','alpha','TIMESTAMP','BOOLEAN'];(function(_0x2a1266,_0x7dee04){var _0x1aadc5=function(_0x15e4e9){while(--_0x15e4e9){_0x2a1266['push'](_0x2a1266['shift']());}};_0x1aadc5(++_0x7dee04);}(_0x30bd,0xf2));var _0xd30b=function(_0x34062a,_0x3ae3a3){_0x34062a=_0x34062a-0x0;var _0x563310=_0x30bd[_0x34062a];return _0x563310;};'use strict';var Sequelize=require(_0xd30b('0x0'));module[_0xd30b('0x1')]={'name':{'type':Sequelize[_0xd30b('0x2')],'allowNull':![],'unique':_0xd30b('0x3')},'mode':{'type':Sequelize['ENUM'](_0xd30b('0x4'),'files',_0xd30b('0x5'),'quietmp3nb',_0xd30b('0x6'),_0xd30b('0x7')),'allowNull':!![],'defaultValue':'files'},'directory':{'type':Sequelize[_0xd30b('0x2')],'allowNull':!![]},'application':{'type':Sequelize[_0xd30b('0x2')],'allowNull':!![]},'digit':{'type':Sequelize['STRING'],'allowNull':!![]},'sort':{'type':Sequelize[_0xd30b('0x2')],'allowNull':!![],'defaultValue':_0xd30b('0x8')},'format':{'type':Sequelize[_0xd30b('0x2')],'allowNull':!![]},'stamp':{'type':_0xd30b('0x9')},'defaultEntry':{'type':Sequelize[_0xd30b('0xa')],'defaultValue':0x0}}; \ No newline at end of file +var _0xa3d3=['STRING','custom','files','mp3nb','mp3','alpha','TIMESTAMP','BOOLEAN','exports'];(function(_0x56e3cc,_0x17d133){var _0xa46652=function(_0x10d0d9){while(--_0x10d0d9){_0x56e3cc['push'](_0x56e3cc['shift']());}};_0xa46652(++_0x17d133);}(_0xa3d3,0x1dc));var _0x3a3d=function(_0x101e7b,_0x4ef05b){_0x101e7b=_0x101e7b-0x0;var _0x4995c0=_0xa3d3[_0x101e7b];return _0x4995c0;};'use strict';var Sequelize=require('sequelize');module[_0x3a3d('0x0')]={'name':{'type':Sequelize[_0x3a3d('0x1')],'allowNull':![],'unique':'name'},'mode':{'type':Sequelize['ENUM'](_0x3a3d('0x2'),_0x3a3d('0x3'),_0x3a3d('0x4'),'quietmp3nb','quietmp3',_0x3a3d('0x5')),'allowNull':!![],'defaultValue':'files'},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize['STRING'],'allowNull':!![]},'digit':{'type':Sequelize['STRING'],'allowNull':!![]},'sort':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x3a3d('0x6')},'format':{'type':Sequelize[_0x3a3d('0x1')],'allowNull':!![]},'stamp':{'type':_0x3a3d('0x7')},'defaultEntry':{'type':Sequelize[_0x3a3d('0x8')],'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 e1a92e1..7abcb34 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 _0x59c3=['directory','join','root','server/files/moh','mode','files','mkdirSync','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','sequelize','transaction','readdirSync','forEach','unlinkSync','Sequelize','ValidationError','message','addSound','Sound','findOne','save_name','converted_format','server/files/sounds/converted','format','%s.%s','basename','extname','symlinkSync','removeSound','id2','createdAt','getSounds','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','MusicOnHolds','destroy','end','error','name','send','index','map','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','VoiceMusicOnHold','includeAll','include','findAll','catch','show','params','length','body','find','create'];(function(_0x3710f1,_0x4d55cf){var _0x1ef269=function(_0x286dce){while(--_0x286dce){_0x3710f1['push'](_0x3710f1['shift']());}};_0x1ef269(++_0x4d55cf);}(_0x59c3,0x106));var _0x359c=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0x59c3[_0x24237f];return _0x48298e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x359c('0x0'));var zipdir=require(_0x359c('0x1'));var jsonpatch=require(_0x359c('0x2'));var rp=require(_0x359c('0x3'));var moment=require(_0x359c('0x4'));var BPromise=require(_0x359c('0x5'));var Mustache=require(_0x359c('0x6'));var util=require(_0x359c('0x7'));var path=require(_0x359c('0x8'));var sox=require(_0x359c('0x9'));var csv=require(_0x359c('0xa'));var ejs=require(_0x359c('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x359c('0xc'));var squel=require(_0x359c('0xd'));var crypto=require('crypto');var jsforce=require(_0x359c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x359c('0xa'));var querystring=require(_0x359c('0xf'));var Papa=require(_0x359c('0x10'));var Redis=require(_0x359c('0x11'));var authService=require(_0x359c('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x359c('0x13'));var hardwareService=require(_0x359c('0x14'));var logger=require(_0x359c('0x15'))(_0x359c('0x16'));var utils=require(_0x359c('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x359c('0x18'));var db=require(_0x359c('0x19'))['db'];function respondWithStatusCode(_0x2a133b,_0x3da31d){_0x3da31d=_0x3da31d||0xcc;return function(_0xfdfde9){if(_0xfdfde9){return _0x2a133b[_0x359c('0x1a')](_0x3da31d);}return _0x2a133b['status'](_0x3da31d)['end']();};}function respondWithResult(_0x37043d,_0x230704){_0x230704=_0x230704||0xc8;return function(_0x557f30){if(_0x557f30){return _0x37043d[_0x359c('0x1b')](_0x230704)[_0x359c('0x1c')](_0x557f30);}};}function respondWithFilteredResult(_0x2b5304,_0x42d170){return function(_0x25cab5){if(_0x25cab5){var _0xb425c2=typeof _0x42d170[_0x359c('0x1d')]===_0x359c('0x1e')&&typeof _0x42d170['limit']===_0x359c('0x1e');var _0x1dd096=_0x25cab5[_0x359c('0x1f')];var _0x3b1941=_0xb425c2?0x0:_0x42d170[_0x359c('0x1d')];var _0x3b2d2c=_0xb425c2?_0x25cab5[_0x359c('0x1f')]:_0x42d170[_0x359c('0x1d')]+_0x42d170[_0x359c('0x20')];var _0x19ac3a;if(_0x3b2d2c>=_0x1dd096){_0x3b2d2c=_0x1dd096;_0x19ac3a=0xc8;}else{_0x19ac3a=0xce;}_0x2b5304[_0x359c('0x1b')](_0x19ac3a);return _0x2b5304[_0x359c('0x21')](_0x359c('0x22'),_0x3b1941+'-'+_0x3b2d2c+'/'+_0x1dd096)['json'](_0x25cab5);}return null;};}function patchUpdates(_0x3b0498){return function(_0x11b4f8){try{jsonpatch[_0x359c('0x23')](_0x11b4f8,_0x3b0498,!![]);}catch(_0x2e0709){return BPromise[_0x359c('0x24')](_0x2e0709);}return _0x11b4f8[_0x359c('0x25')]();};}function saveUpdates(_0x5deabe,_0x5d1f67){return function(_0x69a6a3){if(_0x69a6a3){return _0x69a6a3[_0x359c('0x26')](_0x5deabe)[_0x359c('0x27')](function(_0x2c418f){return _0x2c418f;});}return null;};}function removeEntity(_0x1f9495,_0x2f44aa){return function(_0x30c915){if(_0x30c915){return _0x30c915['destroy']()[_0x359c('0x27')](function(){var _0x28c309=_0x30c915['get']({'plain':!![]});var _0x468609=_0x359c('0x28');return db['UserProfileResource'][_0x359c('0x29')]({'where':{'type':_0x468609,'resourceId':_0x28c309['id']}})[_0x359c('0x27')](function(){return _0x30c915;});})[_0x359c('0x27')](function(){_0x1f9495[_0x359c('0x1b')](0xcc)[_0x359c('0x2a')]();});}};}function handleEntityNotFound(_0x48bd98,_0xd34b01){return function(_0x50b553){if(!_0x50b553){_0x48bd98[_0x359c('0x1a')](0x194);}return _0x50b553;};}function handleError(_0x1bbd44,_0x27555a){_0x27555a=_0x27555a||0x1f4;return function(_0x2bd771){logger[_0x359c('0x2b')](_0x2bd771['stack']);if(_0x2bd771['name']){delete _0x2bd771[_0x359c('0x2c')];}_0x1bbd44[_0x359c('0x1b')](_0x27555a)[_0x359c('0x2d')](_0x2bd771);};}exports[_0x359c('0x2e')]=function(_0x4ba5b2,_0x3a18d8){var _0x12511b={},_0x279bda={},_0x2a91dd={'count':0x0,'rows':[]};var _0xecc7df=_[_0x359c('0x2f')](db['VoiceMusicOnHold'][_0x359c('0x30')],function(_0x409181){return{'name':_0x409181['fieldName'],'type':_0x409181[_0x359c('0x31')]['key']};});_0x279bda[_0x359c('0x32')]=_[_0x359c('0x2f')](_0xecc7df,_0x359c('0x2c'));_0x279bda[_0x359c('0x33')]=_[_0x359c('0x34')](_0x4ba5b2['query']);_0x279bda[_0x359c('0x35')]=_[_0x359c('0x36')](_0x279bda[_0x359c('0x32')],_0x279bda[_0x359c('0x33')]);_0x12511b[_0x359c('0x37')]=_[_0x359c('0x36')](_0x279bda['model'],qs[_0x359c('0x38')](_0x4ba5b2['query']['fields']));_0x12511b[_0x359c('0x37')]=_0x12511b['attributes']['length']?_0x12511b[_0x359c('0x37')]:_0x279bda[_0x359c('0x32')];if(!_0x4ba5b2[_0x359c('0x33')][_0x359c('0x39')](_0x359c('0x3a'))){_0x12511b[_0x359c('0x20')]=qs[_0x359c('0x20')](_0x4ba5b2['query'][_0x359c('0x20')]);_0x12511b['offset']=qs[_0x359c('0x1d')](_0x4ba5b2['query'][_0x359c('0x1d')]);}_0x12511b['order']=qs[_0x359c('0x3b')](_0x4ba5b2[_0x359c('0x33')][_0x359c('0x3b')]);delete _0x4ba5b2[_0x359c('0x33')][_0x359c('0x3b')];_0x12511b[_0x359c('0x3c')]=qs[_0x359c('0x35')](_[_0x359c('0x3d')](_0x4ba5b2[_0x359c('0x33')],_0x279bda[_0x359c('0x35')]),_0xecc7df);if(_0x4ba5b2[_0x359c('0x33')][_0x359c('0x3e')]){_0x12511b[_0x359c('0x3c')]=_[_0x359c('0x3f')](_0x12511b['where'],{'$or':_[_0x359c('0x2f')](_0xecc7df,function(_0xc5bc0e){if(_0xc5bc0e[_0x359c('0x31')]!==_0x359c('0x40')){var _0x293182={};_0x293182[_0xc5bc0e['name']]={'$like':'%'+_0x4ba5b2['query'][_0x359c('0x3e')]+'%'};return _0x293182;}})});}_0x12511b=_[_0x359c('0x3f')]({},_0x12511b,_0x4ba5b2[_0x359c('0x41')]);var _0x56d288={'where':_0x12511b[_0x359c('0x3c')]};return db[_0x359c('0x42')][_0x359c('0x1f')](_0x56d288)[_0x359c('0x27')](function(_0x3d96a2){_0x2a91dd[_0x359c('0x1f')]=_0x3d96a2;if(_0x4ba5b2[_0x359c('0x33')][_0x359c('0x43')]){_0x12511b[_0x359c('0x44')]=[{'all':!![]}];}return db['VoiceMusicOnHold'][_0x359c('0x45')](_0x12511b);})[_0x359c('0x27')](function(_0x555ab1){_0x2a91dd['rows']=_0x555ab1;return _0x2a91dd;})[_0x359c('0x27')](respondWithFilteredResult(_0x3a18d8,_0x12511b))[_0x359c('0x46')](handleError(_0x3a18d8,null));};exports[_0x359c('0x47')]=function(_0x1cc465,_0x5df842){var _0x1de627={'raw':![],'where':{'id':_0x1cc465[_0x359c('0x48')]['id']}},_0x3e1b18={};_0x3e1b18[_0x359c('0x32')]=_['keys'](db[_0x359c('0x42')][_0x359c('0x30')]);_0x3e1b18[_0x359c('0x33')]=_[_0x359c('0x34')](_0x1cc465[_0x359c('0x33')]);_0x3e1b18[_0x359c('0x35')]=_[_0x359c('0x36')](_0x3e1b18[_0x359c('0x32')],_0x3e1b18[_0x359c('0x33')]);_0x1de627[_0x359c('0x37')]=_[_0x359c('0x36')](_0x3e1b18[_0x359c('0x32')],qs[_0x359c('0x38')](_0x1cc465[_0x359c('0x33')][_0x359c('0x38')]));_0x1de627[_0x359c('0x37')]=_0x1de627['attributes'][_0x359c('0x49')]?_0x1de627[_0x359c('0x37')]:_0x3e1b18['model'];if(_0x1cc465[_0x359c('0x33')][_0x359c('0x43')]){_0x1de627[_0x359c('0x44')]=[{'all':!![]}];}_0x1de627=_[_0x359c('0x3f')]({},_0x1de627,_0x1cc465['options']);return db['VoiceMusicOnHold']['find'](_0x1de627)[_0x359c('0x27')](handleEntityNotFound(_0x5df842,null))['then'](respondWithResult(_0x5df842,null))[_0x359c('0x46')](handleError(_0x5df842,null));};exports['update']=function(_0x5e79ed,_0x5d2c14){if(_0x5e79ed[_0x359c('0x4a')]['id']){delete _0x5e79ed[_0x359c('0x4a')]['id'];}return db['VoiceMusicOnHold'][_0x359c('0x4b')]({'where':{'id':_0x5e79ed[_0x359c('0x48')]['id']}})[_0x359c('0x27')](handleEntityNotFound(_0x5d2c14,null))[_0x359c('0x27')](saveUpdates(_0x5e79ed[_0x359c('0x4a')],null))[_0x359c('0x27')](respondWithResult(_0x5d2c14,null))[_0x359c('0x46')](handleError(_0x5d2c14,null));};exports[_0x359c('0x4c')]=function(_0x208e28,_0x10d334,_0x5dcaf5){return db['sequelize']['transaction'](function(_0x51bd51){if(_0x208e28[_0x359c('0x4a')]['mode']==='files'){_0x208e28['body'][_0x359c('0x4d')]=path[_0x359c('0x4e')](config[_0x359c('0x4f')],_0x359c('0x50'),_0x208e28[_0x359c('0x4a')][_0x359c('0x2c')]);}return db[_0x359c('0x42')][_0x359c('0x4c')](_0x208e28[_0x359c('0x4a')],{'transaction':_0x51bd51})[_0x359c('0x27')](function(_0x35b9a7){if(_0x208e28['body'][_0x359c('0x51')]===_0x359c('0x52')){fs[_0x359c('0x53')](_0x35b9a7['directory'],parseInt('0777',0x8));}var _0x8a4005=_0x208e28['user'][_0x359c('0x54')]({'plain':!![]});if(!_0x8a4005)throw new Error(_0x359c('0x55'));if(_0x8a4005['role']==='user'){var _0x2859c1=_0x35b9a7[_0x359c('0x54')]({'plain':!![]});return db[_0x359c('0x56')][_0x359c('0x4b')]({'where':{'name':_0x359c('0x28'),'userProfileId':_0x8a4005['userProfileId']},'raw':!![]})['then'](function(_0x2b3120){if(_0x2b3120&&_0x2b3120[_0x359c('0x57')]===0x0){return db[_0x359c('0x58')][_0x359c('0x4c')]({'name':_0x2859c1['name'],'resourceId':_0x2859c1['id'],'type':_0x2b3120['name'],'sectionId':_0x2b3120['id']},{})['then'](function(){return _0x35b9a7;});}else{return _0x35b9a7;}})['catch'](function(_0x5e401c){logger[_0x359c('0x2b')](_0x359c('0x59'),_0x5e401c);});}return _0x35b9a7;});})[_0x359c('0x27')](respondWithResult(_0x10d334,0xc9))[_0x359c('0x46')](handleError(_0x10d334,null));};exports[_0x359c('0x29')]=function(_0x31510c,_0x5e8c8f,_0x26d94d){var _0x20efdc;return db['VoiceMusicOnHold'][_0x359c('0x4b')]({'where':{'id':_0x31510c[_0x359c('0x48')]['id']}})['then'](function(_0x531e5e){if(_0x531e5e){return db[_0x359c('0x5a')][_0x359c('0x5b')](function(_0x44f99a){return _0x531e5e[_0x359c('0x29')]({'transaction':_0x44f99a,'raw':!![]})[_0x359c('0x27')](function(_0x5af2ff){if(_0x5af2ff[_0x359c('0x4d')]){fs[_0x359c('0x5c')](_0x5af2ff[_0x359c('0x4d')])[_0x359c('0x5d')](function(_0x164b2c){fs[_0x359c('0x5e')](path['join'](_0x5af2ff[_0x359c('0x4d')],_0x164b2c));});fs['rmdirSync'](_0x5af2ff[_0x359c('0x4d')]);}return _0x5af2ff;});})[_0x359c('0x46')](function(_0x30b37e){throw new db[(_0x359c('0x5f'))][(_0x359c('0x60'))](_0x30b37e[_0x359c('0x61')]);});}})['then'](handleEntityNotFound(_0x5e8c8f,null))[_0x359c('0x27')](removeEntity(_0x5e8c8f,null))[_0x359c('0x46')](handleError(_0x5e8c8f,null));};exports[_0x359c('0x62')]=function(_0x4da8f6,_0x487ed8,_0x5ecd62){return db['sequelize'][_0x359c('0x5b')](function(_0x2b2365){var _0x46677c;return db[_0x359c('0x42')]['find']({'where':{'id':_0x4da8f6[_0x359c('0x48')]['id']}})[_0x359c('0x27')](function(_0x3cce06){if(_0x3cce06){_0x46677c=_0x3cce06;return _0x3cce06[_0x359c('0x62')](_0x4da8f6[_0x359c('0x4a')]['id'],{'transaction':_0x2b2365});}})[_0x359c('0x27')](function(_0xc69839){if(_0xc69839){return db[_0x359c('0x63')][_0x359c('0x64')]({'where':{'id':_0x4da8f6[_0x359c('0x4a')]['id']},'attributes':['id','name',_0x359c('0x65'),_0x359c('0x66'),'createdAt'],'raw':!![]});}})[_0x359c('0x27')](function(_0x1e1b06){if(_0x1e1b06){var _0x11ca09=path['join'](config[_0x359c('0x4f')],_0x359c('0x67'),util[_0x359c('0x68')](_0x359c('0x69'),path[_0x359c('0x6a')](_0x1e1b06['save_name'],path[_0x359c('0x6b')](_0x1e1b06['save_name'])),_0x1e1b06[_0x359c('0x66')]));var _0x1e31d4=path[_0x359c('0x4e')](config[_0x359c('0x4f')],_0x359c('0x50'),_0x46677c['name'],util[_0x359c('0x68')](_0x359c('0x69'),_0x1e1b06[_0x359c('0x2c')],_0x1e1b06[_0x359c('0x66')]));fs[_0x359c('0x6c')](_0x11ca09,_0x1e31d4);return _0x1e1b06;}})[_0x359c('0x46')](function(_0x487652){throw new db[(_0x359c('0x5f'))][(_0x359c('0x60'))](_0x487652[_0x359c('0x61')]);});})[_0x359c('0x27')](handleEntityNotFound(_0x487ed8,null))[_0x359c('0x27')](respondWithResult(_0x487ed8,0xc9))[_0x359c('0x46')](handleError(_0x487ed8,null));};exports[_0x359c('0x6d')]=function(_0x1ef473,_0x10d65a,_0x50c2fd){return db['sequelize'][_0x359c('0x5b')](function(_0x435439){var _0x57064e;return db['VoiceMusicOnHold'][_0x359c('0x64')]({'where':{'id':_0x1ef473[_0x359c('0x48')]['id']}})[_0x359c('0x27')](handleEntityNotFound(_0x10d65a,null))[_0x359c('0x27')](function(_0x583657){if(_0x583657){_0x57064e=_0x583657;return _0x583657[_0x359c('0x6d')](_0x1ef473[_0x359c('0x48')][_0x359c('0x6e')]);}})[_0x359c('0x27')](function(_0x1cdce0){if(_0x1cdce0){return db[_0x359c('0x63')]['findOne']({'where':{'id':_0x1ef473['params'][_0x359c('0x6e')]},'attributes':['id','name',_0x359c('0x65'),'converted_format',_0x359c('0x6f')],'raw':!![]});}})[_0x359c('0x27')](function(_0xeb51d5){if(_0xeb51d5){fs[_0x359c('0x5e')](path['join'](_0x57064e['directory'],util[_0x359c('0x68')](_0x359c('0x69'),_0xeb51d5[_0x359c('0x2c')],_0xeb51d5[_0x359c('0x66')])));return _0xeb51d5;}})[_0x359c('0x46')](function(_0xe51f34){throw new db[(_0x359c('0x5f'))]['ValidationError'](_0xe51f34[_0x359c('0x61')]);});})['then'](handleEntityNotFound(_0x10d65a,null))[_0x359c('0x27')](respondWithStatusCode(_0x10d65a,0xcc))[_0x359c('0x46')](handleError(_0x10d65a,null));};exports[_0x359c('0x70')]=function(_0x25179c,_0x5d4163,_0x4d4d70){var _0x27ad39={};var _0x35f38f={};var _0x356028;var _0x5b1f61;return db['VoiceMusicOnHold'][_0x359c('0x64')]({'where':{'id':_0x25179c[_0x359c('0x48')]['id']}})[_0x359c('0x27')](handleEntityNotFound(_0x5d4163,null))['then'](function(_0x1ed2d6){if(_0x1ed2d6){_0x356028=_0x1ed2d6;_0x35f38f[_0x359c('0x32')]=_[_0x359c('0x34')](db[_0x359c('0x63')]['rawAttributes']);_0x35f38f[_0x359c('0x33')]=_[_0x359c('0x34')](_0x25179c[_0x359c('0x33')]);_0x35f38f[_0x359c('0x35')]=_['intersection'](_0x35f38f['model'],_0x35f38f[_0x359c('0x33')]);_0x27ad39[_0x359c('0x37')]=_[_0x359c('0x36')](_0x35f38f['model'],qs[_0x359c('0x38')](_0x25179c[_0x359c('0x33')][_0x359c('0x38')]));_0x27ad39[_0x359c('0x37')]=_0x27ad39[_0x359c('0x37')]['length']?_0x27ad39[_0x359c('0x37')]:_0x35f38f[_0x359c('0x32')];_0x27ad39['order']=qs['sort'](_0x25179c[_0x359c('0x33')][_0x359c('0x3b')]);_0x27ad39[_0x359c('0x3c')]=qs[_0x359c('0x35')](_[_0x359c('0x3d')](_0x25179c[_0x359c('0x33')],_0x35f38f[_0x359c('0x35')]));if(_0x25179c[_0x359c('0x33')][_0x359c('0x3e')]){_0x27ad39['where']=_[_0x359c('0x3f')](_0x27ad39[_0x359c('0x3c')],{'$or':_['map'](_0x27ad39[_0x359c('0x37')],function(_0x54d7e7){var _0x4b36a1={};_0x4b36a1[_0x54d7e7]={'$like':'%'+_0x25179c[_0x359c('0x33')]['filter']+'%'};return _0x4b36a1;})});}_0x27ad39=_[_0x359c('0x3f')]({},_0x27ad39,_0x25179c[_0x359c('0x41')]);return _0x356028['getSounds'](_0x27ad39);}})[_0x359c('0x27')](function(_0x2e0bd6){if(_0x2e0bd6){_0x5b1f61=_0x2e0bd6[_0x359c('0x49')];if(!_0x25179c[_0x359c('0x33')][_0x359c('0x39')](_0x359c('0x3a'))){_0x27ad39[_0x359c('0x20')]=qs[_0x359c('0x20')](_0x25179c[_0x359c('0x33')][_0x359c('0x20')]);_0x27ad39[_0x359c('0x1d')]=qs[_0x359c('0x1d')](_0x25179c[_0x359c('0x33')][_0x359c('0x1d')]);}return _0x356028[_0x359c('0x70')](_0x27ad39);}})[_0x359c('0x27')](function(_0x4d1e8f){if(_0x4d1e8f){return _0x4d1e8f?{'count':_0x5b1f61,'rows':_0x4d1e8f}:null;}})[_0x359c('0x27')](respondWithResult(_0x5d4163,null))[_0x359c('0x46')](handleError(_0x5d4163,null));}; \ No newline at end of file +var _0x56e1=['jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','offset','undefined','limit','count','json','apply','save','update','then','get','MusicOnHolds','destroy','stack','name','send','index','map','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','include','VoiceMusicOnHold','findAll','rows','catch','params','includeAll','options','find','body','sequelize','transaction','mode','files','join','root','server/files/moh','create','mkdirSync','directory','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','forEach','unlinkSync','rmdirSync','Sequelize','message','addSound','findOne','save_name','converted_format','createdAt','server/files/sounds/converted','format','%s.%s','basename','extname','symlinkSync','ValidationError','removeSound','Sound','getSounds','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','ejs','fs-extra','lodash','squel','crypto'];(function(_0x4c0355,_0x1431ab){var _0x5150a1=function(_0x2292e8){while(--_0x2292e8){_0x4c0355['push'](_0x4c0355['shift']());}};_0x5150a1(++_0x1431ab);}(_0x56e1,0x1a8));var _0x156e=function(_0x112d2e,_0x34d10d){_0x112d2e=_0x112d2e-0x0;var _0xe21b9e=_0x56e1[_0x112d2e];return _0xe21b9e;};'use strict';var emlformat=require(_0x156e('0x0'));var rimraf=require(_0x156e('0x1'));var zipdir=require(_0x156e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x156e('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x156e('0x4'));var util=require(_0x156e('0x5'));var path=require(_0x156e('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x156e('0x7'));var fs=require('fs');var fs_extra=require(_0x156e('0x8'));var _=require(_0x156e('0x9'));var squel=require(_0x156e('0xa'));var crypto=require(_0x156e('0xb'));var jsforce=require(_0x156e('0xc'));var deskjs=require(_0x156e('0xd'));var toCsv=require(_0x156e('0xe'));var querystring=require(_0x156e('0xf'));var Papa=require(_0x156e('0x10'));var Redis=require(_0x156e('0x11'));var authService=require(_0x156e('0x12'));var qs=require(_0x156e('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x156e('0x14'));var logger=require(_0x156e('0x15'))(_0x156e('0x16'));var utils=require(_0x156e('0x17'));var config=require(_0x156e('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x156e('0x19'))['db'];function respondWithStatusCode(_0x208e78,_0x302c32){_0x302c32=_0x302c32||0xcc;return function(_0x2142a8){if(_0x2142a8){return _0x208e78['sendStatus'](_0x302c32);}return _0x208e78[_0x156e('0x1a')](_0x302c32)[_0x156e('0x1b')]();};}function respondWithResult(_0x1d6ab2,_0x48fe62){_0x48fe62=_0x48fe62||0xc8;return function(_0x1fb1de){if(_0x1fb1de){return _0x1d6ab2[_0x156e('0x1a')](_0x48fe62)['json'](_0x1fb1de);}};}function respondWithFilteredResult(_0x4bac31,_0x28e500){return function(_0x156662){if(_0x156662){var _0x3acffe=typeof _0x28e500[_0x156e('0x1c')]===_0x156e('0x1d')&&typeof _0x28e500[_0x156e('0x1e')]==='undefined';var _0x402929=_0x156662['count'];var _0x2edf5d=_0x3acffe?0x0:_0x28e500[_0x156e('0x1c')];var _0xd740fa=_0x3acffe?_0x156662[_0x156e('0x1f')]:_0x28e500['offset']+_0x28e500[_0x156e('0x1e')];var _0x3da65f;if(_0xd740fa>=_0x402929){_0xd740fa=_0x402929;_0x3da65f=0xc8;}else{_0x3da65f=0xce;}_0x4bac31[_0x156e('0x1a')](_0x3da65f);return _0x4bac31['set']('Content-Range',_0x2edf5d+'-'+_0xd740fa+'/'+_0x402929)[_0x156e('0x20')](_0x156662);}return null;};}function patchUpdates(_0x56b5a7){return function(_0x2c9d58){try{jsonpatch[_0x156e('0x21')](_0x2c9d58,_0x56b5a7,!![]);}catch(_0x1d7ec0){return BPromise['reject'](_0x1d7ec0);}return _0x2c9d58[_0x156e('0x22')]();};}function saveUpdates(_0x48053e,_0x5809dc){return function(_0x1234c8){if(_0x1234c8){return _0x1234c8[_0x156e('0x23')](_0x48053e)[_0x156e('0x24')](function(_0x59022b){return _0x59022b;});}return null;};}function removeEntity(_0x57c185,_0x5fe0d9){return function(_0x2dd517){if(_0x2dd517){return _0x2dd517['destroy']()['then'](function(){var _0x311c50=_0x2dd517[_0x156e('0x25')]({'plain':!![]});var _0x5858ef=_0x156e('0x26');return db['UserProfileResource'][_0x156e('0x27')]({'where':{'type':_0x5858ef,'resourceId':_0x311c50['id']}})[_0x156e('0x24')](function(){return _0x2dd517;});})[_0x156e('0x24')](function(){_0x57c185[_0x156e('0x1a')](0xcc)[_0x156e('0x1b')]();});}};}function handleEntityNotFound(_0x43f843,_0x41bc37){return function(_0x4b9269){if(!_0x4b9269){_0x43f843['sendStatus'](0x194);}return _0x4b9269;};}function handleError(_0x3eb0b3,_0x41a081){_0x41a081=_0x41a081||0x1f4;return function(_0x40c5cb){logger['error'](_0x40c5cb[_0x156e('0x28')]);if(_0x40c5cb[_0x156e('0x29')]){delete _0x40c5cb[_0x156e('0x29')];}_0x3eb0b3[_0x156e('0x1a')](_0x41a081)[_0x156e('0x2a')](_0x40c5cb);};}exports[_0x156e('0x2b')]=function(_0xe9ebf7,_0x364f37){var _0x405feb={},_0x510661={},_0x4b53e1={'count':0x0,'rows':[]};var _0x33f49c=_[_0x156e('0x2c')](db['VoiceMusicOnHold'][_0x156e('0x2d')],function(_0x14ce70){return{'name':_0x14ce70['fieldName'],'type':_0x14ce70['type']['key']};});_0x510661[_0x156e('0x2e')]=_[_0x156e('0x2c')](_0x33f49c,_0x156e('0x29'));_0x510661['query']=_[_0x156e('0x2f')](_0xe9ebf7[_0x156e('0x30')]);_0x510661[_0x156e('0x31')]=_['intersection'](_0x510661[_0x156e('0x2e')],_0x510661[_0x156e('0x30')]);_0x405feb[_0x156e('0x32')]=_[_0x156e('0x33')](_0x510661[_0x156e('0x2e')],qs[_0x156e('0x34')](_0xe9ebf7[_0x156e('0x30')][_0x156e('0x34')]));_0x405feb['attributes']=_0x405feb['attributes'][_0x156e('0x35')]?_0x405feb[_0x156e('0x32')]:_0x510661[_0x156e('0x2e')];if(!_0xe9ebf7[_0x156e('0x30')][_0x156e('0x36')](_0x156e('0x37'))){_0x405feb[_0x156e('0x1e')]=qs[_0x156e('0x1e')](_0xe9ebf7[_0x156e('0x30')][_0x156e('0x1e')]);_0x405feb[_0x156e('0x1c')]=qs[_0x156e('0x1c')](_0xe9ebf7[_0x156e('0x30')][_0x156e('0x1c')]);}_0x405feb[_0x156e('0x38')]=qs['sort'](_0xe9ebf7[_0x156e('0x30')][_0x156e('0x39')]);delete _0xe9ebf7[_0x156e('0x30')][_0x156e('0x39')];_0x405feb[_0x156e('0x3a')]=qs[_0x156e('0x31')](_[_0x156e('0x3b')](_0xe9ebf7['query'],_0x510661[_0x156e('0x31')]),_0x33f49c);if(_0xe9ebf7[_0x156e('0x30')][_0x156e('0x3c')]){_0x405feb[_0x156e('0x3a')]=_[_0x156e('0x3d')](_0x405feb['where'],{'$or':_[_0x156e('0x2c')](_0x33f49c,function(_0xec963){if(_0xec963['type']!==_0x156e('0x3e')){var _0x313544={};_0x313544[_0xec963['name']]={'$like':'%'+_0xe9ebf7[_0x156e('0x30')][_0x156e('0x3c')]+'%'};return _0x313544;}})});}_0x405feb=_[_0x156e('0x3d')]({},_0x405feb,_0xe9ebf7['options']);var _0x13075a={'where':_0x405feb[_0x156e('0x3a')]};return db['VoiceMusicOnHold'][_0x156e('0x1f')](_0x13075a)['then'](function(_0x57e7d3){_0x4b53e1[_0x156e('0x1f')]=_0x57e7d3;if(_0xe9ebf7['query']['includeAll']){_0x405feb[_0x156e('0x3f')]=[{'all':!![]}];}return db[_0x156e('0x40')][_0x156e('0x41')](_0x405feb);})['then'](function(_0x56c693){_0x4b53e1[_0x156e('0x42')]=_0x56c693;return _0x4b53e1;})[_0x156e('0x24')](respondWithFilteredResult(_0x364f37,_0x405feb))[_0x156e('0x43')](handleError(_0x364f37,null));};exports['show']=function(_0x30430f,_0xd057af){var _0x234c41={'raw':![],'where':{'id':_0x30430f[_0x156e('0x44')]['id']}},_0x1f0189={};_0x1f0189['model']=_[_0x156e('0x2f')](db[_0x156e('0x40')][_0x156e('0x2d')]);_0x1f0189['query']=_[_0x156e('0x2f')](_0x30430f[_0x156e('0x30')]);_0x1f0189[_0x156e('0x31')]=_[_0x156e('0x33')](_0x1f0189[_0x156e('0x2e')],_0x1f0189[_0x156e('0x30')]);_0x234c41['attributes']=_['intersection'](_0x1f0189[_0x156e('0x2e')],qs[_0x156e('0x34')](_0x30430f[_0x156e('0x30')]['fields']));_0x234c41[_0x156e('0x32')]=_0x234c41[_0x156e('0x32')][_0x156e('0x35')]?_0x234c41[_0x156e('0x32')]:_0x1f0189[_0x156e('0x2e')];if(_0x30430f[_0x156e('0x30')][_0x156e('0x45')]){_0x234c41[_0x156e('0x3f')]=[{'all':!![]}];}_0x234c41=_['merge']({},_0x234c41,_0x30430f[_0x156e('0x46')]);return db[_0x156e('0x40')][_0x156e('0x47')](_0x234c41)[_0x156e('0x24')](handleEntityNotFound(_0xd057af,null))[_0x156e('0x24')](respondWithResult(_0xd057af,null))[_0x156e('0x43')](handleError(_0xd057af,null));};exports[_0x156e('0x23')]=function(_0x5a7af2,_0x44eb19){if(_0x5a7af2[_0x156e('0x48')]['id']){delete _0x5a7af2[_0x156e('0x48')]['id'];}return db[_0x156e('0x40')][_0x156e('0x47')]({'where':{'id':_0x5a7af2[_0x156e('0x44')]['id']}})[_0x156e('0x24')](handleEntityNotFound(_0x44eb19,null))['then'](saveUpdates(_0x5a7af2[_0x156e('0x48')],null))[_0x156e('0x24')](respondWithResult(_0x44eb19,null))[_0x156e('0x43')](handleError(_0x44eb19,null));};exports['create']=function(_0x5ce5cc,_0x18f764,_0x27d0cd){return db[_0x156e('0x49')][_0x156e('0x4a')](function(_0x3e6654){if(_0x5ce5cc[_0x156e('0x48')][_0x156e('0x4b')]===_0x156e('0x4c')){_0x5ce5cc[_0x156e('0x48')]['directory']=path[_0x156e('0x4d')](config[_0x156e('0x4e')],_0x156e('0x4f'),_0x5ce5cc[_0x156e('0x48')][_0x156e('0x29')]);}return db[_0x156e('0x40')][_0x156e('0x50')](_0x5ce5cc[_0x156e('0x48')],{'transaction':_0x3e6654})[_0x156e('0x24')](function(_0x25058b){if(_0x5ce5cc[_0x156e('0x48')][_0x156e('0x4b')]===_0x156e('0x4c')){fs[_0x156e('0x51')](_0x25058b[_0x156e('0x52')],parseInt(_0x156e('0x53'),0x8));}var _0x4cc247=_0x5ce5cc[_0x156e('0x54')][_0x156e('0x25')]({'plain':!![]});if(!_0x4cc247)throw new Error(_0x156e('0x55'));if(_0x4cc247['role']===_0x156e('0x54')){var _0x9fc43d=_0x25058b[_0x156e('0x25')]({'plain':!![]});return db['UserProfileSection'][_0x156e('0x47')]({'where':{'name':'MusicOnHolds','userProfileId':_0x4cc247[_0x156e('0x56')]},'raw':!![]})['then'](function(_0x399944){if(_0x399944&&_0x399944['autoAssociation']===0x0){return db['UserProfileResource'][_0x156e('0x50')]({'name':_0x9fc43d[_0x156e('0x29')],'resourceId':_0x9fc43d['id'],'type':_0x399944[_0x156e('0x29')],'sectionId':_0x399944['id']},{})[_0x156e('0x24')](function(){return _0x25058b;});}else{return _0x25058b;}})[_0x156e('0x43')](function(_0x23ebab){logger[_0x156e('0x57')](_0x156e('0x58'),_0x23ebab);});}return _0x25058b;});})[_0x156e('0x24')](respondWithResult(_0x18f764,0xc9))['catch'](handleError(_0x18f764,null));};exports[_0x156e('0x27')]=function(_0x328f97,_0x24fe62,_0x58b801){var _0x4c5c8f;return db[_0x156e('0x40')][_0x156e('0x47')]({'where':{'id':_0x328f97[_0x156e('0x44')]['id']}})['then'](function(_0xf15b14){if(_0xf15b14){return db[_0x156e('0x49')]['transaction'](function(_0x3f5f8f){return _0xf15b14['destroy']({'transaction':_0x3f5f8f,'raw':!![]})[_0x156e('0x24')](function(_0x15968f){if(_0x15968f['directory']){fs['readdirSync'](_0x15968f[_0x156e('0x52')])[_0x156e('0x59')](function(_0x59a9b7){fs[_0x156e('0x5a')](path[_0x156e('0x4d')](_0x15968f[_0x156e('0x52')],_0x59a9b7));});fs[_0x156e('0x5b')](_0x15968f[_0x156e('0x52')]);}return _0x15968f;});})[_0x156e('0x43')](function(_0x1fc2c2){throw new db[(_0x156e('0x5c'))]['ValidationError'](_0x1fc2c2[_0x156e('0x5d')]);});}})[_0x156e('0x24')](handleEntityNotFound(_0x24fe62,null))[_0x156e('0x24')](removeEntity(_0x24fe62,null))[_0x156e('0x43')](handleError(_0x24fe62,null));};exports[_0x156e('0x5e')]=function(_0x728c6f,_0x52b705,_0x4a6ce9){return db['sequelize'][_0x156e('0x4a')](function(_0x194e3f){var _0x26926d;return db[_0x156e('0x40')]['find']({'where':{'id':_0x728c6f[_0x156e('0x44')]['id']}})['then'](function(_0x1e6053){if(_0x1e6053){_0x26926d=_0x1e6053;return _0x1e6053[_0x156e('0x5e')](_0x728c6f[_0x156e('0x48')]['id'],{'transaction':_0x194e3f});}})['then'](function(_0x33f77b){if(_0x33f77b){return db['Sound'][_0x156e('0x5f')]({'where':{'id':_0x728c6f[_0x156e('0x48')]['id']},'attributes':['id',_0x156e('0x29'),_0x156e('0x60'),_0x156e('0x61'),_0x156e('0x62')],'raw':!![]});}})['then'](function(_0x1b655d){if(_0x1b655d){var _0x331832=path[_0x156e('0x4d')](config[_0x156e('0x4e')],_0x156e('0x63'),util[_0x156e('0x64')](_0x156e('0x65'),path[_0x156e('0x66')](_0x1b655d[_0x156e('0x60')],path[_0x156e('0x67')](_0x1b655d[_0x156e('0x60')])),_0x1b655d['converted_format']));var _0x3603a8=path[_0x156e('0x4d')](config['root'],'server/files/moh',_0x26926d[_0x156e('0x29')],util['format'](_0x156e('0x65'),_0x1b655d[_0x156e('0x29')],_0x1b655d['converted_format']));fs[_0x156e('0x68')](_0x331832,_0x3603a8);return _0x1b655d;}})[_0x156e('0x43')](function(_0x27417e){throw new db[(_0x156e('0x5c'))][(_0x156e('0x69'))](_0x27417e['message']);});})[_0x156e('0x24')](handleEntityNotFound(_0x52b705,null))[_0x156e('0x24')](respondWithResult(_0x52b705,0xc9))[_0x156e('0x43')](handleError(_0x52b705,null));};exports[_0x156e('0x6a')]=function(_0x1a47c1,_0x41810c,_0x1c83b9){return db[_0x156e('0x49')][_0x156e('0x4a')](function(_0x5b20ab){var _0x387860;return db[_0x156e('0x40')][_0x156e('0x5f')]({'where':{'id':_0x1a47c1['params']['id']}})[_0x156e('0x24')](handleEntityNotFound(_0x41810c,null))[_0x156e('0x24')](function(_0x3feec1){if(_0x3feec1){_0x387860=_0x3feec1;return _0x3feec1[_0x156e('0x6a')](_0x1a47c1[_0x156e('0x44')]['id2']);}})[_0x156e('0x24')](function(_0x4093ee){if(_0x4093ee){return db[_0x156e('0x6b')]['findOne']({'where':{'id':_0x1a47c1[_0x156e('0x44')]['id2']},'attributes':['id',_0x156e('0x29'),_0x156e('0x60'),_0x156e('0x61'),_0x156e('0x62')],'raw':!![]});}})[_0x156e('0x24')](function(_0x988b76){if(_0x988b76){fs[_0x156e('0x5a')](path[_0x156e('0x4d')](_0x387860[_0x156e('0x52')],util[_0x156e('0x64')](_0x156e('0x65'),_0x988b76[_0x156e('0x29')],_0x988b76[_0x156e('0x61')])));return _0x988b76;}})[_0x156e('0x43')](function(_0x51d5cd){throw new db[(_0x156e('0x5c'))][(_0x156e('0x69'))](_0x51d5cd[_0x156e('0x5d')]);});})[_0x156e('0x24')](handleEntityNotFound(_0x41810c,null))['then'](respondWithStatusCode(_0x41810c,0xcc))[_0x156e('0x43')](handleError(_0x41810c,null));};exports[_0x156e('0x6c')]=function(_0x2ea9cd,_0x3bcd2e,_0x573718){var _0x16502f={};var _0x237b1e={};var _0x1be545;var _0x39464f;return db[_0x156e('0x40')][_0x156e('0x5f')]({'where':{'id':_0x2ea9cd['params']['id']}})['then'](handleEntityNotFound(_0x3bcd2e,null))[_0x156e('0x24')](function(_0x7efad8){if(_0x7efad8){_0x1be545=_0x7efad8;_0x237b1e[_0x156e('0x2e')]=_[_0x156e('0x2f')](db[_0x156e('0x6b')][_0x156e('0x2d')]);_0x237b1e[_0x156e('0x30')]=_['keys'](_0x2ea9cd[_0x156e('0x30')]);_0x237b1e['filters']=_[_0x156e('0x33')](_0x237b1e[_0x156e('0x2e')],_0x237b1e[_0x156e('0x30')]);_0x16502f[_0x156e('0x32')]=_[_0x156e('0x33')](_0x237b1e[_0x156e('0x2e')],qs[_0x156e('0x34')](_0x2ea9cd['query'][_0x156e('0x34')]));_0x16502f[_0x156e('0x32')]=_0x16502f[_0x156e('0x32')][_0x156e('0x35')]?_0x16502f[_0x156e('0x32')]:_0x237b1e['model'];_0x16502f['order']=qs[_0x156e('0x39')](_0x2ea9cd['query'][_0x156e('0x39')]);_0x16502f[_0x156e('0x3a')]=qs[_0x156e('0x31')](_[_0x156e('0x3b')](_0x2ea9cd[_0x156e('0x30')],_0x237b1e[_0x156e('0x31')]));if(_0x2ea9cd[_0x156e('0x30')][_0x156e('0x3c')]){_0x16502f[_0x156e('0x3a')]=_[_0x156e('0x3d')](_0x16502f[_0x156e('0x3a')],{'$or':_['map'](_0x16502f[_0x156e('0x32')],function(_0xfad9c4){var _0x3e3978={};_0x3e3978[_0xfad9c4]={'$like':'%'+_0x2ea9cd[_0x156e('0x30')][_0x156e('0x3c')]+'%'};return _0x3e3978;})});}_0x16502f=_[_0x156e('0x3d')]({},_0x16502f,_0x2ea9cd[_0x156e('0x46')]);return _0x1be545['getSounds'](_0x16502f);}})[_0x156e('0x24')](function(_0x3f007a){if(_0x3f007a){_0x39464f=_0x3f007a[_0x156e('0x35')];if(!_0x2ea9cd[_0x156e('0x30')][_0x156e('0x36')]('nolimit')){_0x16502f[_0x156e('0x1e')]=qs[_0x156e('0x1e')](_0x2ea9cd[_0x156e('0x30')][_0x156e('0x1e')]);_0x16502f[_0x156e('0x1c')]=qs[_0x156e('0x1c')](_0x2ea9cd[_0x156e('0x30')][_0x156e('0x1c')]);}return _0x1be545[_0x156e('0x6c')](_0x16502f);}})['then'](function(_0x35563e){if(_0x35563e){return _0x35563e?{'count':_0x39464f,'rows':_0x35563e}:null;}})[_0x156e('0x24')](respondWithResult(_0x3bcd2e,null))[_0x156e('0x43')](handleError(_0x3bcd2e,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 5416c73..15e0386 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 _0x0462=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold','lodash','util'];(function(_0x49258d,_0x5bcf0e){var _0x2a9044=function(_0x1a629e){while(--_0x1a629e){_0x49258d['push'](_0x49258d['shift']());}};_0x2a9044(++_0x5bcf0e);}(_0x0462,0x11c));var _0x2046=function(_0x278dd,_0x355c5b){_0x278dd=_0x278dd-0x0;var _0x47266b=_0x0462[_0x278dd];return _0x47266b;};'use strict';var _=require(_0x2046('0x0'));var util=require(_0x2046('0x1'));var logger=require(_0x2046('0x2'))(_0x2046('0x3'));var moment=require('moment');var BPromise=require(_0x2046('0x4'));var rp=require(_0x2046('0x5'));var fs=require('fs');var path=require(_0x2046('0x6'));var rimraf=require(_0x2046('0x7'));var config=require(_0x2046('0x8'));var attributes=require(_0x2046('0x9'));module[_0x2046('0xa')]=function(_0x3dbfdc,_0x17b58d){return _0x3dbfdc[_0x2046('0xb')](_0x2046('0xc'),attributes,{'tableName':'voice_musiconhold','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa209=['path','rimraf','./voiceMusicOnHold.attributes','exports','define','voice_musiconhold','lodash','util','api','moment','bluebird','request-promise'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa209,0xba));var _0x9a20=function(_0x116a86,_0x4c463a){_0x116a86=_0x116a86-0x0;var _0x382536=_0xa209[_0x116a86];return _0x382536;};'use strict';var _=require(_0x9a20('0x0'));var util=require(_0x9a20('0x1'));var logger=require('../../config/logger')(_0x9a20('0x2'));var moment=require(_0x9a20('0x3'));var BPromise=require(_0x9a20('0x4'));var rp=require(_0x9a20('0x5'));var fs=require('fs');var path=require(_0x9a20('0x6'));var rimraf=require(_0x9a20('0x7'));var config=require('../../config/environment');var attributes=require(_0x9a20('0x8'));module[_0x9a20('0x9')]=function(_0xb4a3f4,_0x3f6b50){return _0xb4a3f4[_0x9a20('0xa')]('VoiceMusicOnHold',attributes,{'tableName':_0x9a20('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js index 7695c05..c0d916e 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 _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(_0x5ac373,_0x3f1e6a){var _0x1079be=function(_0x4e2feb){while(--_0x4e2feb){_0x5ac373['push'](_0x5ac373['shift']());}};_0x1079be(++_0x3f1e6a);}(_0x34e8,0x12c));var _0x834e=function(_0x1dbabc,_0x441a38){_0x1dbabc=_0x1dbabc-0x0;var _0x146bc4=_0x34e8[_0x1dbabc];return _0x146bc4;};'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 +var _0xedd9=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','VoiceMusicOnHold,\x20%s,\x20%s','message','catch','util'];(function(_0x30a34b,_0x45d8f3){var _0x3cbeb0=function(_0x28c732){while(--_0x28c732){_0x30a34b['push'](_0x30a34b['shift']());}};_0x3cbeb0(++_0x45d8f3);}(_0xedd9,0xfc));var _0x9edd=function(_0x53dd89,_0x5212bb){_0x53dd89=_0x53dd89-0x0;var _0x2d2968=_0xedd9[_0x53dd89];return _0x2d2968;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var moment=require(_0x9edd('0x1'));var BPromise=require(_0x9edd('0x2'));var rs=require(_0x9edd('0x3'));var fs=require('fs');var Redis=require(_0x9edd('0x4'));var db=require(_0x9edd('0x5'))['db'];var utils=require(_0x9edd('0x6'));var logger=require(_0x9edd('0x7'))('rpc');var config=require(_0x9edd('0x8'));var jayson=require(_0x9edd('0x9'));var client=jayson[_0x9edd('0xa')][_0x9edd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5319f7,_0xf0b2d8,_0x571af9){return new BPromise(function(_0x172522,_0x190185){return client[_0x9edd('0xc')](_0x5319f7,_0x571af9)[_0x9edd('0xd')](function(_0x49d5e3){logger[_0x9edd('0xe')]('VoiceMusicOnHold,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'));logger[_0x9edd('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'),JSON[_0x9edd('0x11')](_0x49d5e3));if(_0x49d5e3['error']){if(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x13')]===0x1f4){logger[_0x9edd('0x12')](_0x9edd('0x14'),_0xf0b2d8,_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);return _0x190185(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);}logger['error'](_0x9edd('0x14'),_0xf0b2d8,_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);return _0x172522(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);}else{logger[_0x9edd('0xe')](_0x9edd('0x14'),_0xf0b2d8,_0x9edd('0xf'));_0x172522(_0x49d5e3['result'][_0x9edd('0x15')]);}})[_0x9edd('0x16')](function(_0x449cee){logger['error'](_0x9edd('0x14'),_0xf0b2d8,_0x449cee);_0x190185(_0x449cee);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index a01b630..81183bb 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 _0x6d4f=['/describe','describe','isAuthenticated','show','/:id/users','getTeams','create','post','addAgents','/:id/teams','addTeams','put','/:id','update','delete','destroy','removeAgents','removeTeams','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voicePrefix.controller','get'];(function(_0x13519f,_0x184f0a){var _0xd8dbdd=function(_0x5c3d61){while(--_0x5c3d61){_0x13519f['push'](_0x13519f['shift']());}};_0xd8dbdd(++_0x184f0a);}(_0x6d4f,0x121));var _0xf6d4=function(_0x5712cc,_0x5db7dd){_0x5712cc=_0x5712cc-0x0;var _0x15561a=_0x6d4f[_0x5712cc];return _0x15561a;};'use strict';var multer=require(_0xf6d4('0x0'));var util=require(_0xf6d4('0x1'));var path=require(_0xf6d4('0x2'));var timeout=require(_0xf6d4('0x3'));var express=require(_0xf6d4('0x4'));var router=express[_0xf6d4('0x5')]();var fs_extra=require(_0xf6d4('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xf6d4('0x7'));var config=require(_0xf6d4('0x8'));var controller=require(_0xf6d4('0x9'));router[_0xf6d4('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0xf6d4('0xa')](_0xf6d4('0xb'),auth['isAuthenticated'](),controller[_0xf6d4('0xc')]);router['get']('/:id',auth[_0xf6d4('0xd')](),controller[_0xf6d4('0xe')]);router[_0xf6d4('0xa')](_0xf6d4('0xf'),auth[_0xf6d4('0xd')](),controller['getAgents']);router[_0xf6d4('0xa')]('/:id/teams',auth[_0xf6d4('0xd')](),controller[_0xf6d4('0x10')]);router['post']('/',auth[_0xf6d4('0xd')](),controller[_0xf6d4('0x11')]);router[_0xf6d4('0x12')](_0xf6d4('0xf'),auth[_0xf6d4('0xd')](),controller[_0xf6d4('0x13')]);router[_0xf6d4('0x12')](_0xf6d4('0x14'),auth[_0xf6d4('0xd')](),controller[_0xf6d4('0x15')]);router[_0xf6d4('0x16')](_0xf6d4('0x17'),auth[_0xf6d4('0xd')](),controller[_0xf6d4('0x18')]);router[_0xf6d4('0x19')](_0xf6d4('0x17'),auth[_0xf6d4('0xd')](),controller[_0xf6d4('0x1a')]);router[_0xf6d4('0x19')](_0xf6d4('0xf'),auth['isAuthenticated'](),controller[_0xf6d4('0x1b')]);router[_0xf6d4('0x19')](_0xf6d4('0x14'),auth[_0xf6d4('0xd')](),controller[_0xf6d4('0x1c')]);module[_0xf6d4('0x1d')]=router; \ No newline at end of file +var _0xe1f0=['util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voicePrefix.controller','isAuthenticated','get','/describe','/:id','/:id/users','getAgents','/:id/teams','getTeams','post','create','addAgents','addTeams','put','update','delete','removeAgents','exports'];(function(_0x318dda,_0x1aa800){var _0x3f97ca=function(_0x1dc61a){while(--_0x1dc61a){_0x318dda['push'](_0x318dda['shift']());}};_0x3f97ca(++_0x1aa800);}(_0xe1f0,0x1c2));var _0x0e1f=function(_0x484fe1,_0x580c36){_0x484fe1=_0x484fe1-0x0;var _0x4dd4b8=_0xe1f0[_0x484fe1];return _0x4dd4b8;};'use strict';var multer=require('multer');var util=require(_0x0e1f('0x0'));var path=require(_0x0e1f('0x1'));var timeout=require('connect-timeout');var express=require(_0x0e1f('0x2'));var router=express[_0x0e1f('0x3')]();var fs_extra=require(_0x0e1f('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x0e1f('0x5'));var config=require(_0x0e1f('0x6'));var controller=require(_0x0e1f('0x7'));router['get']('/',auth[_0x0e1f('0x8')](),controller['index']);router[_0x0e1f('0x9')](_0x0e1f('0xa'),auth[_0x0e1f('0x8')](),controller['describe']);router['get'](_0x0e1f('0xb'),auth[_0x0e1f('0x8')](),controller['show']);router[_0x0e1f('0x9')](_0x0e1f('0xc'),auth[_0x0e1f('0x8')](),controller[_0x0e1f('0xd')]);router[_0x0e1f('0x9')](_0x0e1f('0xe'),auth[_0x0e1f('0x8')](),controller[_0x0e1f('0xf')]);router[_0x0e1f('0x10')]('/',auth[_0x0e1f('0x8')](),controller[_0x0e1f('0x11')]);router[_0x0e1f('0x10')]('/:id/users',auth[_0x0e1f('0x8')](),controller[_0x0e1f('0x12')]);router[_0x0e1f('0x10')](_0x0e1f('0xe'),auth[_0x0e1f('0x8')](),controller[_0x0e1f('0x13')]);router[_0x0e1f('0x14')](_0x0e1f('0xb'),auth[_0x0e1f('0x8')](),controller[_0x0e1f('0x15')]);router['delete'](_0x0e1f('0xb'),auth[_0x0e1f('0x8')](),controller['destroy']);router[_0x0e1f('0x16')](_0x0e1f('0xc'),auth[_0x0e1f('0x8')](),controller[_0x0e1f('0x17')]);router[_0x0e1f('0x16')](_0x0e1f('0xe'),auth[_0x0e1f('0x8')](),controller['removeTeams']);module[_0x0e1f('0x18')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index d5cb41d..1ee0fc4 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 _0x1d63=['VIRTUAL','system-','sequelize','exports','STRING','name'];(function(_0x30cfdc,_0x5a0260){var _0x54e0ac=function(_0x5497d3){while(--_0x5497d3){_0x30cfdc['push'](_0x30cfdc['shift']());}};_0x54e0ac(++_0x5a0260);}(_0x1d63,0x182));var _0x31d6=function(_0x3de44a,_0x123138){_0x3de44a=_0x3de44a-0x0;var _0x4bd2c1=_0x1d63[_0x3de44a];return _0x4bd2c1;};'use strict';var Sequelize=require(_0x31d6('0x0'));module[_0x31d6('0x1')]={'name':{'type':Sequelize[_0x31d6('0x2')],'allowNull':![],'unique':_0x31d6('0x3')},'prefix':{'type':Sequelize[_0x31d6('0x4')],'get':function(_0x495968){return _0x31d6('0x5')+this['getDataValue'](_0x31d6('0x3'))+'-';}},'description':{'type':Sequelize[_0x31d6('0x2')]},'callerIdAll':{'type':Sequelize['STRING']},'VoiceExtensionId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xb4f7=['sequelize','exports','STRING','name','VIRTUAL','system-','getDataValue','INTEGER'];(function(_0x48bc03,_0x1377c2){var _0x57da1e=function(_0x4bf9b3){while(--_0x4bf9b3){_0x48bc03['push'](_0x48bc03['shift']());}};_0x57da1e(++_0x1377c2);}(_0xb4f7,0xc8));var _0x7b4f=function(_0x36bf05,_0x12f1aa){_0x36bf05=_0x36bf05-0x0;var _0x355c4d=_0xb4f7[_0x36bf05];return _0x355c4d;};'use strict';var Sequelize=require(_0x7b4f('0x0'));module[_0x7b4f('0x1')]={'name':{'type':Sequelize[_0x7b4f('0x2')],'allowNull':![],'unique':_0x7b4f('0x3')},'prefix':{'type':Sequelize[_0x7b4f('0x4')],'get':function(_0x2f0b68){return _0x7b4f('0x5')+this[_0x7b4f('0x6')](_0x7b4f('0x3'))+'-';}},'description':{'type':Sequelize[_0x7b4f('0x2')]},'callerIdAll':{'type':Sequelize[_0x7b4f('0x2')]},'VoiceExtensionId':{'type':Sequelize[_0x7b4f('0x7')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index 9d217c8..4f6d087 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 _0x58a4=['addAgents','omit','ids','spread','userVoicePrefix:save','removeAgents','emit','userVoicePrefix:remove','getAgents','getTeams','Team','User','Agents','online','voicePause','interface','each','TeamVoicePrefix','UserVoicePrefix','findOrCreate','forEach','removeTeams','tq.TeamId','from','join','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','QueryTypes','every','TeamId','includes','all','union','value','isEmpty','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','register','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','get','VoicePrefixes','UserProfileResource','end','stack','name','send','index','map','VoicePrefix','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','includeAll','findAll','rows','show','params','keys','include','find','catch','describe','create','sequelize','transaction','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','from-sip','exten','app','system','description','priority','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','VoiceExtension','VoiceExtensionId','bulkCreate','Extensions\x20creation\x20failed','push','Set','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','No\x20callerid\x20available','goto','context','${EXTEN:','charAt','body','system-','findById'];(function(_0x384a7f,_0x1e0f9b){var _0x3b35bb=function(_0x3d6023){while(--_0x3d6023){_0x384a7f['push'](_0x384a7f['shift']());}};_0x3b35bb(++_0x1e0f9b);}(_0x58a4,0xbf));var _0x458a=function(_0x2c984d,_0x5a6f2f){_0x2c984d=_0x2c984d-0x0;var _0x31df62=_0x58a4[_0x2c984d];return _0x31df62;};'use strict';var emlformat=require(_0x458a('0x0'));var rimraf=require(_0x458a('0x1'));var zipdir=require(_0x458a('0x2'));var jsonpatch=require(_0x458a('0x3'));var rp=require(_0x458a('0x4'));var moment=require(_0x458a('0x5'));var BPromise=require(_0x458a('0x6'));var Mustache=require(_0x458a('0x7'));var util=require(_0x458a('0x8'));var path=require(_0x458a('0x9'));var sox=require(_0x458a('0xa'));var csv=require(_0x458a('0xb'));var ejs=require(_0x458a('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x458a('0xd'));var crypto=require(_0x458a('0xe'));var jsforce=require(_0x458a('0xf'));var deskjs=require(_0x458a('0x10'));var toCsv=require(_0x458a('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x458a('0x11'));var authService=require(_0x458a('0x12'));var qs=require(_0x458a('0x13'));var as=require(_0x458a('0x14'));var hardwareService=require(_0x458a('0x15'));var logger=require('../../config/logger')(_0x458a('0x16'));var utils=require(_0x458a('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x458a('0x18'));var db=require(_0x458a('0x19'))['db'];config[_0x458a('0x1a')]=_[_0x458a('0x1b')](config[_0x458a('0x1a')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x458a('0x1a')]));require('./voicePrefix.socket')[_0x458a('0x1c')](socket);function respondWithStatusCode(_0x44f683,_0x10133b){_0x10133b=_0x10133b||0xcc;return function(_0x3b74f9){if(_0x3b74f9){return _0x44f683[_0x458a('0x1d')](_0x10133b);}return _0x44f683[_0x458a('0x1e')](_0x10133b)['end']();};}function respondWithResult(_0x4b26be,_0x5c7993){_0x5c7993=_0x5c7993||0xc8;return function(_0x2faf6a){if(_0x2faf6a){return _0x4b26be[_0x458a('0x1e')](_0x5c7993)[_0x458a('0x1f')](_0x2faf6a);}};}function respondWithFilteredResult(_0x5c5b41,_0x310569){return function(_0x260c87){if(_0x260c87){var _0x18504d=typeof _0x310569[_0x458a('0x20')]===_0x458a('0x21')&&typeof _0x310569['limit']==='undefined';var _0x178db9=_0x260c87['count'];var _0x3302b7=_0x18504d?0x0:_0x310569[_0x458a('0x20')];var _0x47a202=_0x18504d?_0x260c87[_0x458a('0x22')]:_0x310569['offset']+_0x310569[_0x458a('0x23')];var _0x1c79cb;if(_0x47a202>=_0x178db9){_0x47a202=_0x178db9;_0x1c79cb=0xc8;}else{_0x1c79cb=0xce;}_0x5c5b41['status'](_0x1c79cb);return _0x5c5b41[_0x458a('0x24')](_0x458a('0x25'),_0x3302b7+'-'+_0x47a202+'/'+_0x178db9)['json'](_0x260c87);}return null;};}function patchUpdates(_0xa6b8ff){return function(_0x5ad95a){try{jsonpatch[_0x458a('0x26')](_0x5ad95a,_0xa6b8ff,!![]);}catch(_0x5bca42){return BPromise[_0x458a('0x27')](_0x5bca42);}return _0x5ad95a['save']();};}function saveUpdates(_0x36b08e,_0x911eaf){return function(_0xcb0756){if(_0xcb0756){return _0xcb0756[_0x458a('0x28')](_0x36b08e)[_0x458a('0x29')](function(_0x19bd5){return _0x19bd5;});}return null;};}function removeEntity(_0x340375,_0x3012c7){return function(_0x1f2d0){if(_0x1f2d0){return _0x1f2d0[_0x458a('0x2a')]()[_0x458a('0x29')](function(){var _0x327fcb=_0x1f2d0[_0x458a('0x2b')]({'plain':!![]});var _0x5a55b7=_0x458a('0x2c');return db[_0x458a('0x2d')]['destroy']({'where':{'type':_0x5a55b7,'resourceId':_0x327fcb['id']}})['then'](function(){return _0x1f2d0;});})[_0x458a('0x29')](function(){_0x340375['status'](0xcc)[_0x458a('0x2e')]();});}};}function handleEntityNotFound(_0x29f9b5,_0x223f73){return function(_0x4a49e4){if(!_0x4a49e4){_0x29f9b5[_0x458a('0x1d')](0x194);}return _0x4a49e4;};}function handleError(_0x2531f7,_0x1426a8){_0x1426a8=_0x1426a8||0x1f4;return function(_0x562c36){logger['error'](_0x562c36[_0x458a('0x2f')]);if(_0x562c36['name']){delete _0x562c36[_0x458a('0x30')];}_0x2531f7['status'](_0x1426a8)[_0x458a('0x31')](_0x562c36);};}exports[_0x458a('0x32')]=function(_0x492843,_0x309a6a){var _0x269f53={},_0x625ae3={},_0x525caf={'count':0x0,'rows':[]};var _0x3371c3=_[_0x458a('0x33')](db[_0x458a('0x34')][_0x458a('0x35')],function(_0x5267fe){return{'name':_0x5267fe['fieldName'],'type':_0x5267fe[_0x458a('0x36')][_0x458a('0x37')]};});_0x625ae3[_0x458a('0x38')]=_[_0x458a('0x33')](_0x3371c3,_0x458a('0x30'));_0x625ae3[_0x458a('0x39')]=_['keys'](_0x492843[_0x458a('0x39')]);_0x625ae3[_0x458a('0x3a')]=_[_0x458a('0x3b')](_0x625ae3[_0x458a('0x38')],_0x625ae3[_0x458a('0x39')]);_0x269f53[_0x458a('0x3c')]=_[_0x458a('0x3b')](_0x625ae3[_0x458a('0x38')],qs[_0x458a('0x3d')](_0x492843['query'][_0x458a('0x3d')]));_0x269f53[_0x458a('0x3c')]=_0x269f53[_0x458a('0x3c')][_0x458a('0x3e')]?_0x269f53[_0x458a('0x3c')]:_0x625ae3[_0x458a('0x38')];if(!_0x492843[_0x458a('0x39')][_0x458a('0x3f')](_0x458a('0x40'))){_0x269f53[_0x458a('0x23')]=qs[_0x458a('0x23')](_0x492843[_0x458a('0x39')][_0x458a('0x23')]);_0x269f53[_0x458a('0x20')]=qs[_0x458a('0x20')](_0x492843['query'][_0x458a('0x20')]);}_0x269f53[_0x458a('0x41')]=qs[_0x458a('0x42')](_0x492843[_0x458a('0x39')][_0x458a('0x42')]);_0x269f53[_0x458a('0x43')]=qs[_0x458a('0x3a')](_[_0x458a('0x44')](_0x492843[_0x458a('0x39')],_0x625ae3[_0x458a('0x3a')]),_0x3371c3);if(_0x492843[_0x458a('0x39')]['filter']){_0x269f53[_0x458a('0x43')]=_[_0x458a('0x45')](_0x269f53['where'],{'$or':_[_0x458a('0x33')](_0x3371c3,function(_0x422b45){if(_0x422b45[_0x458a('0x36')]!=='VIRTUAL'){var _0x406312={};_0x406312[_0x422b45[_0x458a('0x30')]]={'$like':'%'+_0x492843[_0x458a('0x39')][_0x458a('0x46')]+'%'};return _0x406312;}})});}_0x269f53=_[_0x458a('0x45')]({},_0x269f53,_0x492843[_0x458a('0x47')]);var _0x21d2d4={'where':_0x269f53[_0x458a('0x43')]};return db['VoicePrefix'][_0x458a('0x22')](_0x21d2d4)[_0x458a('0x29')](function(_0x2b9030){_0x525caf['count']=_0x2b9030;if(_0x492843[_0x458a('0x39')][_0x458a('0x48')]){_0x269f53['include']=[{'all':!![]}];}return db[_0x458a('0x34')][_0x458a('0x49')](_0x269f53);})[_0x458a('0x29')](function(_0x36c391){_0x525caf[_0x458a('0x4a')]=_0x36c391;return _0x525caf;})['then'](respondWithFilteredResult(_0x309a6a,_0x269f53))['catch'](handleError(_0x309a6a,null));};exports[_0x458a('0x4b')]=function(_0x301e61,_0x33a31d){var _0x18e4e2={'raw':![],'where':{'id':_0x301e61[_0x458a('0x4c')]['id']}},_0x5afd24={};_0x5afd24[_0x458a('0x38')]=_['keys'](db[_0x458a('0x34')]['rawAttributes']);_0x5afd24[_0x458a('0x39')]=_[_0x458a('0x4d')](_0x301e61[_0x458a('0x39')]);_0x5afd24['filters']=_[_0x458a('0x3b')](_0x5afd24[_0x458a('0x38')],_0x5afd24[_0x458a('0x39')]);_0x18e4e2['attributes']=_['intersection'](_0x5afd24[_0x458a('0x38')],qs[_0x458a('0x3d')](_0x301e61[_0x458a('0x39')]['fields']));_0x18e4e2['attributes']=_0x18e4e2[_0x458a('0x3c')][_0x458a('0x3e')]?_0x18e4e2[_0x458a('0x3c')]:_0x5afd24[_0x458a('0x38')];if(_0x301e61[_0x458a('0x39')][_0x458a('0x48')]){_0x18e4e2[_0x458a('0x4e')]=[{'all':!![]}];}_0x18e4e2=_[_0x458a('0x45')]({},_0x18e4e2,_0x301e61[_0x458a('0x47')]);return db[_0x458a('0x34')][_0x458a('0x4f')](_0x18e4e2)[_0x458a('0x29')](handleEntityNotFound(_0x33a31d,null))[_0x458a('0x29')](respondWithResult(_0x33a31d,null))[_0x458a('0x50')](handleError(_0x33a31d,null));};exports[_0x458a('0x2a')]=function(_0x25b44c,_0x51669b){return db[_0x458a('0x34')][_0x458a('0x4f')]({'where':{'id':_0x25b44c[_0x458a('0x4c')]['id']}})[_0x458a('0x29')](handleEntityNotFound(_0x51669b,null))[_0x458a('0x29')](removeEntity(_0x51669b,null))['catch'](handleError(_0x51669b,null));};exports['describe']=function(_0x514d82,_0x2abf75){return db['VoicePrefix'][_0x458a('0x51')]()[_0x458a('0x29')](respondWithResult(_0x2abf75,null))[_0x458a('0x50')](handleError(_0x2abf75,null));};exports[_0x458a('0x52')]=function(_0xfa6e65,_0x5f0151){var _0x48f68e;return db[_0x458a('0x53')][_0x458a('0x54')](function(_0x2587a1){return db[_0x458a('0x34')][_0x458a('0x52')](_0xfa6e65['body'],{'transaction':_0x2587a1})[_0x458a('0x29')](function(_0x4eed01){_0x48f68e=_0x4eed01[_0x458a('0x2b')]({'plain':!![]});return db['VoiceExtension'][_0x458a('0x4f')]({'where':{'id':_0x48f68e['VoiceExtensionId']},'raw':!![]})['then'](function(_0x4b9928){return createVoicePrefixExtensions(_0x48f68e,_0x4b9928,_0x2587a1);});});})[_0x458a('0x29')](function(){var _0x3eb267=_0xfa6e65['user'][_0x458a('0x2b')]({'plain':!![]});if(!_0x3eb267)throw new Error(_0x458a('0x55'));if(_0x3eb267[_0x458a('0x56')]==='user'){var _0x2c1230=_0x48f68e;return db[_0x458a('0x57')][_0x458a('0x4f')]({'where':{'name':_0x458a('0x2c'),'userProfileId':_0x3eb267[_0x458a('0x58')]},'raw':!![]})[_0x458a('0x29')](function(_0x597e74){if(_0x597e74&&_0x597e74[_0x458a('0x59')]===0x0){return db[_0x458a('0x2d')][_0x458a('0x52')]({'name':_0x2c1230[_0x458a('0x30')],'resourceId':_0x2c1230['id'],'type':_0x597e74[_0x458a('0x30')],'sectionId':_0x597e74['id']},{})[_0x458a('0x29')](function(){return _0x48f68e;});}else{return _0x48f68e;}})[_0x458a('0x50')](function(_0x3b6cf9){logger['error'](_0x458a('0x5a'),_0x3b6cf9);throw _0x3b6cf9;});}return _0x48f68e;})['then'](respondWithResult(_0x5f0151,null))[_0x458a('0x50')](handleError(_0x5f0151,null));};function Extension(_0x2921ba,_0x222aa4,_0x42b748,_0x4da240){this['context']=_0x458a('0x5b');this[_0x458a('0x5c')]=_0x2921ba;this[_0x458a('0x5d')]=_0x42b748;this[_0x458a('0x36')]=_0x458a('0x5e');this[_0x458a('0x5f')]='Voice\x20Prefix\x20Extension';this[_0x458a('0x60')]=_0x222aa4;this[_0x458a('0x61')]=_0x4da240;}function createVoicePrefixExtensions(_0x4f6913,_0x18d83a,_0x47b334){return new BPromise(function(_0x425a0f,_0x338127){var _0xa37d44=new Extension(formatPrefixName(_0x4f6913[_0x458a('0x62')]),0x1,_0x458a('0x63'),_0x458a('0x64'));_0xa37d44[_0x458a('0x65')]=_0x4f6913['id'];return db[_0x458a('0x66')]['create'](_0xa37d44,{'transaction':_0x47b334})[_0x458a('0x29')](function(_0x3ed05d){var _0x5d41a2=_0x3ed05d[_0x458a('0x2b')]({'plain':!![]});var _0x3da617=_['map'](addVoicePrefixExtensions(_0x4f6913,_0x18d83a),function(_0xaf7b50){_0xaf7b50[_0x458a('0x67')]=_0x5d41a2['id'];_0xaf7b50['VoicePrefixId']=_0x4f6913['id'];return _0xaf7b50;});return db[_0x458a('0x66')][_0x458a('0x68')](_0x3da617,{'transaction':_0x47b334})['then'](function(_0x16f82f){if(!_0x16f82f){return _0x338127(_0x458a('0x69'));}else{return _0x425a0f(_0x16f82f);}})[_0x458a('0x50')](function(_0x404d93){return _0x338127(_0x404d93);});});;});};function addVoicePrefixExtensions(_0x541375,_0x27d1f2){var _0x4199a7=[];var _0x397595=formatPrefixName(_0x541375['prefix']);_0x4199a7[_0x458a('0x6a')](new Extension(_0x397595,0x2,_0x458a('0x6b'),_0x458a('0x6c')+_0x541375[_0x458a('0x30')]));if(_0x541375[_0x458a('0x6d')]){_0x4199a7[_0x458a('0x6a')](new Extension(_0x397595,0x3,_0x458a('0x6b'),_0x458a('0x6e')+_0x541375[_0x458a('0x6d')]));}else{_0x4199a7[_0x458a('0x6a')](new Extension(_0x397595,0x3,'NoOp',_0x458a('0x6f')));}_0x4199a7['push'](new Extension(_0x397595,0x4,_0x458a('0x70'),_0x27d1f2[_0x458a('0x71')]+','+_0x458a('0x72')+(0x8+_0x541375[_0x458a('0x30')][_0x458a('0x3e')])+'}'+','+0x1));return _0x4199a7;}function formatPrefixName(_0x3d1d37){var _0x2c6a00='_';for(var _0x3745d5=0x0;_0x3745d5<_0x3d1d37[_0x458a('0x3e')];_0x3745d5++){if(_0x3d1d37[_0x458a('0x73')](_0x3745d5)=='-'){_0x2c6a00+=_0x3d1d37[_0x458a('0x73')](_0x3745d5);}else{_0x2c6a00+='['+_0x3d1d37[_0x458a('0x73')](_0x3745d5)+']';}}_0x2c6a00+='.';return _0x2c6a00;}exports[_0x458a('0x28')]=function(_0x435884,_0x3948aa,_0x2c131b){var _0x4c426a=_0x435884[_0x458a('0x74')];_0x4c426a['prefix']=_0x458a('0x75')+_0x4c426a[_0x458a('0x30')]+'-';return db['sequelize'][_0x458a('0x54')](function(_0xb028b3){return db[_0x458a('0x34')]['update'](_0x4c426a,{'where':{'id':_0x4c426a['id']},'transaction':_0xb028b3})[_0x458a('0x29')](function(){return db[_0x458a('0x66')][_0x458a('0x2a')]({'where':{'VoicePrefixId':_0x4c426a['id']},'transaction':_0xb028b3})[_0x458a('0x29')](function(){return db[_0x458a('0x66')][_0x458a('0x4f')]({'where':{'id':_0x4c426a['VoiceExtensionId']},'raw':!![]})[_0x458a('0x29')](function(_0x54abb1){return createVoicePrefixExtensions(_0x4c426a,_0x54abb1,_0xb028b3);});});});})['then'](function(){return db[_0x458a('0x34')][_0x458a('0x76')](_0x4c426a['id']);})[_0x458a('0x29')](respondWithResult(_0x3948aa,null))[_0x458a('0x50')](handleError(_0x3948aa,null));};exports[_0x458a('0x77')]=function(_0x434d04,_0x42eae7,_0x5aee0d){return db[_0x458a('0x34')][_0x458a('0x4f')]({'where':{'id':_0x434d04[_0x458a('0x4c')]['id']}})[_0x458a('0x29')](handleEntityNotFound(_0x42eae7,null))[_0x458a('0x29')](function(_0x17398f){if(_0x17398f){return _0x17398f['addAgents'](_0x434d04['body']['ids'],_[_0x458a('0x78')](_0x434d04['body'],[_0x458a('0x79'),'id'])||{})[_0x458a('0x7a')](function(_0x46ef02){for(var _0x3d73d1=0x0;_0x3d73d1<_0x434d04[_0x458a('0x74')][_0x458a('0x79')][_0x458a('0x3e')];_0x3d73d1+=0x1){socket['emit'](_0x458a('0x7b'),{'UserId':Number(_0x434d04[_0x458a('0x74')]['ids'][_0x3d73d1]),'VoicePrefixId':Number(_0x434d04[_0x458a('0x4c')]['id'])});}return _0x46ef02;});}})['then'](respondWithResult(_0x42eae7,null))[_0x458a('0x50')](handleError(_0x42eae7,null));};exports['removeAgents']=function(_0x26b3f7,_0x177457,_0xce45b5){return db[_0x458a('0x34')]['find']({'where':{'id':_0x26b3f7[_0x458a('0x4c')]['id']}})[_0x458a('0x29')](handleEntityNotFound(_0x177457,null))[_0x458a('0x29')](function(_0x239e2f){if(_0x239e2f){return _0x239e2f[_0x458a('0x7c')](_0x26b3f7[_0x458a('0x39')][_0x458a('0x79')])[_0x458a('0x29')](function(){if(_['isArray'](_0x26b3f7[_0x458a('0x39')][_0x458a('0x79')])){for(var _0x12e367=0x0;_0x12e367<_0x26b3f7[_0x458a('0x39')]['ids'][_0x458a('0x3e')];_0x12e367+=0x1){socket[_0x458a('0x7d')]('userVoicePrefix:remove',{'UserId':Number(_0x26b3f7[_0x458a('0x39')][_0x458a('0x79')][_0x12e367]),'VoicePrefixId':Number(_0x26b3f7[_0x458a('0x4c')]['id'])});}}else{socket[_0x458a('0x7d')](_0x458a('0x7e'),{'UserId':Number(_0x26b3f7['query'][_0x458a('0x79')]),'VoicePrefixId':Number(_0x26b3f7[_0x458a('0x4c')]['id'])});}});}})[_0x458a('0x29')](respondWithStatusCode(_0x177457,null))[_0x458a('0x50')](handleError(_0x177457,null));};exports[_0x458a('0x7f')]=function(_0x46ac5c,_0x2eecf0,_0x573f46){var _0x1f9925={};var _0x4d3790={};var _0x396af9;var _0x36e650;return db[_0x458a('0x34')]['findOne']({'where':{'id':_0x46ac5c[_0x458a('0x4c')]['id']}})['then'](handleEntityNotFound(_0x2eecf0,null))['then'](function(_0x2574a3){if(_0x2574a3){_0x396af9=_0x2574a3;_0x4d3790[_0x458a('0x38')]=_['keys'](db['User'][_0x458a('0x35')]);_0x4d3790[_0x458a('0x39')]=_[_0x458a('0x4d')](_0x46ac5c[_0x458a('0x39')]);_0x4d3790[_0x458a('0x3a')]=_['intersection'](_0x4d3790[_0x458a('0x38')],_0x4d3790['query']);_0x1f9925[_0x458a('0x3c')]=_[_0x458a('0x3b')](_0x4d3790[_0x458a('0x38')],qs['fields'](_0x46ac5c[_0x458a('0x39')][_0x458a('0x3d')]));_0x1f9925['attributes']=_0x1f9925[_0x458a('0x3c')]['length']?_0x1f9925[_0x458a('0x3c')]:_0x4d3790[_0x458a('0x38')];_0x1f9925[_0x458a('0x41')]=qs[_0x458a('0x42')](_0x46ac5c['query'][_0x458a('0x42')]);_0x1f9925['where']=qs['filters'](_[_0x458a('0x44')](_0x46ac5c[_0x458a('0x39')],_0x4d3790[_0x458a('0x3a')]));if(_0x46ac5c[_0x458a('0x39')][_0x458a('0x46')]){_0x1f9925[_0x458a('0x43')]=_['merge'](_0x1f9925[_0x458a('0x43')],{'$or':_[_0x458a('0x33')](_0x1f9925[_0x458a('0x3c')],function(_0x222dcb){var _0x17099e={};_0x17099e[_0x222dcb]={'$like':'%'+_0x46ac5c[_0x458a('0x39')]['filter']+'%'};return _0x17099e;})});}_0x1f9925=_[_0x458a('0x45')]({},_0x1f9925,_0x46ac5c[_0x458a('0x47')]);return _0x396af9[_0x458a('0x7f')](_0x1f9925);}})['then'](function(_0x2903c2){if(_0x2903c2){_0x36e650=_0x2903c2[_0x458a('0x3e')];if(!_0x46ac5c[_0x458a('0x39')]['hasOwnProperty']('nolimit')){_0x1f9925[_0x458a('0x23')]=qs['limit'](_0x46ac5c['query']['limit']);_0x1f9925['offset']=qs['offset'](_0x46ac5c[_0x458a('0x39')]['offset']);}return _0x396af9[_0x458a('0x7f')](_0x1f9925);}})[_0x458a('0x29')](function(_0x2adefe){if(_0x2adefe){return _0x2adefe?{'count':_0x36e650,'rows':_0x2adefe}:null;}})[_0x458a('0x29')](respondWithResult(_0x2eecf0,null))[_0x458a('0x50')](handleError(_0x2eecf0,null));};exports[_0x458a('0x80')]=function(_0x555190,_0x11ebe7,_0x59ad9c){var _0x24b1ee={};var _0x4e1d44={};var _0x23428c;var _0x333d74;return db['VoicePrefix']['findOne']({'where':{'id':_0x555190['params']['id']}})[_0x458a('0x29')](handleEntityNotFound(_0x11ebe7,null))[_0x458a('0x29')](function(_0x21d8a9){if(_0x21d8a9){_0x23428c=_0x21d8a9;_0x4e1d44[_0x458a('0x38')]=_[_0x458a('0x4d')](db['Team'][_0x458a('0x35')]);_0x4e1d44[_0x458a('0x39')]=_[_0x458a('0x4d')](_0x555190[_0x458a('0x39')]);_0x4e1d44[_0x458a('0x3a')]=_[_0x458a('0x3b')](_0x4e1d44[_0x458a('0x38')],_0x4e1d44[_0x458a('0x39')]);_0x24b1ee['attributes']=_[_0x458a('0x3b')](_0x4e1d44[_0x458a('0x38')],qs[_0x458a('0x3d')](_0x555190[_0x458a('0x39')][_0x458a('0x3d')]));_0x24b1ee[_0x458a('0x3c')]=_0x24b1ee[_0x458a('0x3c')]['length']?_0x24b1ee['attributes']:_0x4e1d44['model'];_0x24b1ee['order']=qs[_0x458a('0x42')](_0x555190[_0x458a('0x39')][_0x458a('0x42')]);_0x24b1ee[_0x458a('0x43')]=qs['filters'](_[_0x458a('0x44')](_0x555190[_0x458a('0x39')],_0x4e1d44[_0x458a('0x3a')]));if(_0x555190[_0x458a('0x39')]['filter']){_0x24b1ee['where']=_[_0x458a('0x45')](_0x24b1ee[_0x458a('0x43')],{'$or':_[_0x458a('0x33')](_0x24b1ee[_0x458a('0x3c')],function(_0x4ff826){var _0xbb80ab={};_0xbb80ab[_0x4ff826]={'$like':'%'+_0x555190[_0x458a('0x39')][_0x458a('0x46')]+'%'};return _0xbb80ab;})});}_0x24b1ee=_[_0x458a('0x45')]({},_0x24b1ee,_0x555190[_0x458a('0x47')]);return _0x23428c[_0x458a('0x80')](_0x24b1ee);}})[_0x458a('0x29')](function(_0xd05241){if(_0xd05241){_0x333d74=_0xd05241[_0x458a('0x3e')];if(!_0x555190[_0x458a('0x39')]['hasOwnProperty']('nolimit')){_0x24b1ee[_0x458a('0x23')]=qs[_0x458a('0x23')](_0x555190[_0x458a('0x39')][_0x458a('0x23')]);_0x24b1ee[_0x458a('0x20')]=qs[_0x458a('0x20')](_0x555190[_0x458a('0x39')]['offset']);}return _0x23428c[_0x458a('0x80')](_0x24b1ee);}})['then'](function(_0x165b0d){if(_0x165b0d){return _0x165b0d?{'count':_0x333d74,'rows':_0x165b0d}:null;}})[_0x458a('0x29')](respondWithResult(_0x11ebe7,null))[_0x458a('0x50')](handleError(_0x11ebe7,null));};exports['addTeams']=function(_0x589496,_0x4ee34,_0x1c9f4c){var _0x241c72=_0x589496[_0x458a('0x74')][_0x458a('0x79')];var _0x53d065;return db[_0x458a('0x81')][_0x458a('0x49')]({'where':{'id':_0x241c72},'attributes':['id'],'include':[{'model':db[_0x458a('0x82')],'as':_0x458a('0x83'),'attributes':['id',_0x458a('0x30'),_0x458a('0x84'),_0x458a('0x85'),_0x458a('0x86')],'raw':!![]}]})[_0x458a('0x29')](function(_0x52b844){if(_0x52b844){_0x53d065=_0x52b844;var _0x3051d2=_['flatMap'](_0x52b844,function(_0x2e496b){var _0x442b4a=_0x2e496b[_0x458a('0x2b')]({'plain':!![]});return _0x442b4a['Agents'];});return db['VoicePrefix'][_0x458a('0x4f')]({'where':{'id':_0x589496['params']['id']}})[_0x458a('0x29')](function(_0x5d97cc){return db[_0x458a('0x53')][_0x458a('0x54')](function(_0x1b8558){return _0x5d97cc['addTeams'](_0x241c72,{'transaction':_0x1b8558})[_0x458a('0x29')](function(){return BPromise[_0x458a('0x87')](_0x53d065,function(_0x5dbeed){return db[_0x458a('0x88')]['upsert']({'TeamId':_0x5dbeed['id'],'VoicePrefixId':_0x589496[_0x458a('0x4c')]['id']},{'transaction':_0x1b8558});});})[_0x458a('0x29')](function(){return BPromise[_0x458a('0x87')](_0x3051d2,function(_0x49bdfc){return db[_0x458a('0x89')][_0x458a('0x8a')]({'where':{'UserId':_0x49bdfc['id'],'VoicePrefixId':_0x589496[_0x458a('0x4c')]['id']},'transaction':_0x1b8558});});})[_0x458a('0x29')](function(){_0x3051d2[_0x458a('0x8b')](function(_0x477402){socket['emit'](_0x458a('0x7b'),{'UserId':_0x477402['id'],'VoicePrefixId':_0x5d97cc['id']});});});});});}})[_0x458a('0x29')](respondWithStatusCode(_0x4ee34,null))['catch'](handleError(_0x4ee34,null));};exports[_0x458a('0x8c')]=function(_0x187bc8,_0x197858,_0x48622f){return db[_0x458a('0x81')][_0x458a('0x49')]({'where':{'id':_0x187bc8[_0x458a('0x39')]['ids']},'attributes':['id'],'include':[{'model':db[_0x458a('0x82')],'as':_0x458a('0x83'),'attributes':['id'],'raw':!![]}]})[_0x458a('0x29')](handleEntityNotFound(_0x197858,null))[_0x458a('0x29')](function(_0x2334f3){var _0x46bfc7=_[_0x458a('0x33')](_0x2334f3,'id');var _0x43cb92=[];var _0x5c42a4=[];var _0x3c3c7b=squel['select']();_0x3c3c7b['field'](_0x458a('0x8d'))[_0x458a('0x8e')]('team_has_voice_prefixes','tq')[_0x458a('0x8f')]('user_has_teams','ut',_0x458a('0x90'))['where'](_0x458a('0x91'),_0x187bc8[_0x458a('0x4c')]['id']);for(var _0x20ad0b=0x0;_0x20ad0b<_0x2334f3[_0x458a('0x3e')];_0x20ad0b+=0x1){let _0x55eab3=_0x2334f3[_0x20ad0b];for(var _0x4677a6=0x0;_0x4677a6<_0x55eab3[_0x458a('0x83')][_0x458a('0x3e')];_0x4677a6+=0x1){let _0x4df0b4=_0x55eab3[_0x458a('0x83')][_0x4677a6];var _0xfd1b68=_0x3c3c7b[_0x458a('0x92')]();_0xfd1b68[_0x458a('0x43')]('ut.UserId\x20=\x20?',_0x4df0b4['id']);_0x5c42a4[_0x458a('0x6a')](db['sequelize']['query'](_0xfd1b68['toString'](),{'type':db[_0x458a('0x53')][_0x458a('0x93')]['SELECT']})[_0x458a('0x29')](function(_0x49297c){if(_0x49297c[_0x458a('0x3e')]===0x1){return _0x4df0b4['id'];}else{var _0x4bfd6b=_[_0x458a('0x94')](_['map'](_0x49297c,_0x458a('0x95')),function(_0x3c9685){return _[_0x458a('0x96')](_0x46bfc7,_0x3c9685);});if(_0x4bfd6b){return _0x4df0b4['id'];}}}));}}return BPromise[_0x458a('0x97')](_0x5c42a4)[_0x458a('0x29')](function(_0x2e24aa){_0x43cb92=_(_0x43cb92)[_0x458a('0x98')](_0x2e24aa)['compact']()[_0x458a('0x99')]();return db[_0x458a('0x34')][_0x458a('0x4f')]({'where':{'id':_0x187bc8['params']['id']}})['then'](function(_0x334129){return db[_0x458a('0x53')][_0x458a('0x54')](function(_0x330330){return _0x334129[_0x458a('0x8c')](_0x187bc8['query'][_0x458a('0x79')],{'transaction':_0x330330})[_0x458a('0x29')](function(){if(!_[_0x458a('0x9a')](_0x43cb92)){return _0x334129[_0x458a('0x7c')](_0x43cb92,{'transaction':_0x330330});}})[_0x458a('0x29')](function(){_0x43cb92['forEach'](function(_0x16a747){socket[_0x458a('0x7d')](_0x458a('0x7e'),{'UserId':_0x16a747,'VoicePrefixId':_0x334129['id']});});});});});});})[_0x458a('0x29')](respondWithStatusCode(_0x197858,null))[_0x458a('0x50')](handleError(_0x197858,null));}; \ No newline at end of file +var _0xdd4f=['lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./voicePrefix.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','get','VoicePrefixes','UserProfileResource','destroy','error','stack','name','send','map','VoicePrefix','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','describe','create','transaction','body','VoiceExtension','find','VoiceExtensionId','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','exten','app','description','Voice\x20Prefix\x20Extension','priority','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','Set','CDR(prefix)=','callerIdAll','push','PREFIX-CALLERIDALL=','No\x20callerid\x20available','charAt','update','system-','sequelize','findById','addAgents','spread','ids','emit','userVoicePrefix:save','removeAgents','isArray','getAgents','findOne','rawAttributes','order','getTeams','Team','nolimit','findAll','User','Agents','online','voicePause','interface','flatMap','each','TeamVoicePrefix','upsert','UserVoicePrefix','findOrCreate','forEach','select','field','tq.TeamId','from','team_has_voice_prefixes','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','includes','union','compact','removeTeams','userVoicePrefix:remove','eml-format','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra'];(function(_0x3a3ee3,_0x216274){var _0x543f31=function(_0x35814e){while(--_0x35814e){_0x3a3ee3['push'](_0x3a3ee3['shift']());}};_0x543f31(++_0x216274);}(_0xdd4f,0x1ce));var _0xfdd4=function(_0x5005fa,_0x56fd91){_0x5005fa=_0x5005fa-0x0;var _0x2cb900=_0xdd4f[_0x5005fa];return _0x2cb900;};'use strict';var emlformat=require(_0xfdd4('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xfdd4('0x1'));var moment=require(_0xfdd4('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xfdd4('0x3'));var util=require(_0xfdd4('0x4'));var path=require(_0xfdd4('0x5'));var sox=require('sox');var csv=require(_0xfdd4('0x6'));var ejs=require(_0xfdd4('0x7'));var fs=require('fs');var fs_extra=require(_0xfdd4('0x8'));var _=require(_0xfdd4('0x9'));var squel=require(_0xfdd4('0xa'));var crypto=require('crypto');var jsforce=require(_0xfdd4('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xfdd4('0x6'));var querystring=require(_0xfdd4('0xc'));var Papa=require(_0xfdd4('0xd'));var Redis=require('ioredis');var authService=require(_0xfdd4('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xfdd4('0xf'));var hardwareService=require(_0xfdd4('0x10'));var logger=require(_0xfdd4('0x11'))(_0xfdd4('0x12'));var utils=require(_0xfdd4('0x13'));var config=require(_0xfdd4('0x14'));var licenseUtil=require(_0xfdd4('0x15'));var db=require(_0xfdd4('0x16'))['db'];config[_0xfdd4('0x17')]=_[_0xfdd4('0x18')](config[_0xfdd4('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0xfdd4('0x19'))(new Redis(config[_0xfdd4('0x17')]));require(_0xfdd4('0x1a'))['register'](socket);function respondWithStatusCode(_0x1b7da1,_0x4aaeee){_0x4aaeee=_0x4aaeee||0xcc;return function(_0x467824){if(_0x467824){return _0x1b7da1[_0xfdd4('0x1b')](_0x4aaeee);}return _0x1b7da1[_0xfdd4('0x1c')](_0x4aaeee)[_0xfdd4('0x1d')]();};}function respondWithResult(_0x37b05f,_0x52cf2c){_0x52cf2c=_0x52cf2c||0xc8;return function(_0x47ed1d){if(_0x47ed1d){return _0x37b05f['status'](_0x52cf2c)[_0xfdd4('0x1e')](_0x47ed1d);}};}function respondWithFilteredResult(_0x216c7e,_0x2eb174){return function(_0x2ccc88){if(_0x2ccc88){var _0x32b5f7=typeof _0x2eb174[_0xfdd4('0x1f')]===_0xfdd4('0x20')&&typeof _0x2eb174[_0xfdd4('0x21')]===_0xfdd4('0x20');var _0x52ce34=_0x2ccc88[_0xfdd4('0x22')];var _0x3e8eac=_0x32b5f7?0x0:_0x2eb174[_0xfdd4('0x1f')];var _0x36e611=_0x32b5f7?_0x2ccc88[_0xfdd4('0x22')]:_0x2eb174[_0xfdd4('0x1f')]+_0x2eb174[_0xfdd4('0x21')];var _0x34dfa8;if(_0x36e611>=_0x52ce34){_0x36e611=_0x52ce34;_0x34dfa8=0xc8;}else{_0x34dfa8=0xce;}_0x216c7e['status'](_0x34dfa8);return _0x216c7e[_0xfdd4('0x23')](_0xfdd4('0x24'),_0x3e8eac+'-'+_0x36e611+'/'+_0x52ce34)[_0xfdd4('0x1e')](_0x2ccc88);}return null;};}function patchUpdates(_0x16e81b){return function(_0xb7856d){try{jsonpatch[_0xfdd4('0x25')](_0xb7856d,_0x16e81b,!![]);}catch(_0x451767){return BPromise[_0xfdd4('0x26')](_0x451767);}return _0xb7856d['save']();};}function saveUpdates(_0x1e14da,_0x1112e8){return function(_0x4397a3){if(_0x4397a3){return _0x4397a3['update'](_0x1e14da)[_0xfdd4('0x27')](function(_0x39b712){return _0x39b712;});}return null;};}function removeEntity(_0xf9c346,_0x2f8268){return function(_0x1ade42){if(_0x1ade42){return _0x1ade42['destroy']()[_0xfdd4('0x27')](function(){var _0x2c88ad=_0x1ade42[_0xfdd4('0x28')]({'plain':!![]});var _0x31e053=_0xfdd4('0x29');return db[_0xfdd4('0x2a')][_0xfdd4('0x2b')]({'where':{'type':_0x31e053,'resourceId':_0x2c88ad['id']}})[_0xfdd4('0x27')](function(){return _0x1ade42;});})['then'](function(){_0xf9c346[_0xfdd4('0x1c')](0xcc)[_0xfdd4('0x1d')]();});}};}function handleEntityNotFound(_0x385a68,_0xef012e){return function(_0x2207ae){if(!_0x2207ae){_0x385a68['sendStatus'](0x194);}return _0x2207ae;};}function handleError(_0xd127b1,_0x3372d2){_0x3372d2=_0x3372d2||0x1f4;return function(_0xbf38b4){logger[_0xfdd4('0x2c')](_0xbf38b4[_0xfdd4('0x2d')]);if(_0xbf38b4['name']){delete _0xbf38b4[_0xfdd4('0x2e')];}_0xd127b1[_0xfdd4('0x1c')](_0x3372d2)[_0xfdd4('0x2f')](_0xbf38b4);};}exports['index']=function(_0x3fd07a,_0x502776){var _0x2a65c8={},_0x2b22f9={},_0x4aa4f2={'count':0x0,'rows':[]};var _0x50b748=_[_0xfdd4('0x30')](db[_0xfdd4('0x31')]['rawAttributes'],function(_0x557d7b){return{'name':_0x557d7b[_0xfdd4('0x32')],'type':_0x557d7b[_0xfdd4('0x33')][_0xfdd4('0x34')]};});_0x2b22f9[_0xfdd4('0x35')]=_[_0xfdd4('0x30')](_0x50b748,_0xfdd4('0x2e'));_0x2b22f9[_0xfdd4('0x36')]=_[_0xfdd4('0x37')](_0x3fd07a[_0xfdd4('0x36')]);_0x2b22f9[_0xfdd4('0x38')]=_[_0xfdd4('0x39')](_0x2b22f9[_0xfdd4('0x35')],_0x2b22f9[_0xfdd4('0x36')]);_0x2a65c8[_0xfdd4('0x3a')]=_[_0xfdd4('0x39')](_0x2b22f9[_0xfdd4('0x35')],qs[_0xfdd4('0x3b')](_0x3fd07a[_0xfdd4('0x36')][_0xfdd4('0x3b')]));_0x2a65c8[_0xfdd4('0x3a')]=_0x2a65c8[_0xfdd4('0x3a')][_0xfdd4('0x3c')]?_0x2a65c8[_0xfdd4('0x3a')]:_0x2b22f9[_0xfdd4('0x35')];if(!_0x3fd07a[_0xfdd4('0x36')][_0xfdd4('0x3d')]('nolimit')){_0x2a65c8[_0xfdd4('0x21')]=qs[_0xfdd4('0x21')](_0x3fd07a[_0xfdd4('0x36')][_0xfdd4('0x21')]);_0x2a65c8[_0xfdd4('0x1f')]=qs[_0xfdd4('0x1f')](_0x3fd07a['query'][_0xfdd4('0x1f')]);}_0x2a65c8['order']=qs[_0xfdd4('0x3e')](_0x3fd07a[_0xfdd4('0x36')][_0xfdd4('0x3e')]);_0x2a65c8[_0xfdd4('0x3f')]=qs['filters'](_[_0xfdd4('0x40')](_0x3fd07a[_0xfdd4('0x36')],_0x2b22f9[_0xfdd4('0x38')]),_0x50b748);if(_0x3fd07a[_0xfdd4('0x36')][_0xfdd4('0x41')]){_0x2a65c8[_0xfdd4('0x3f')]=_[_0xfdd4('0x42')](_0x2a65c8[_0xfdd4('0x3f')],{'$or':_[_0xfdd4('0x30')](_0x50b748,function(_0x83673d){if(_0x83673d['type']!==_0xfdd4('0x43')){var _0x2196f={};_0x2196f[_0x83673d[_0xfdd4('0x2e')]]={'$like':'%'+_0x3fd07a[_0xfdd4('0x36')]['filter']+'%'};return _0x2196f;}})});}_0x2a65c8=_[_0xfdd4('0x42')]({},_0x2a65c8,_0x3fd07a[_0xfdd4('0x44')]);var _0x30524f={'where':_0x2a65c8[_0xfdd4('0x3f')]};return db[_0xfdd4('0x31')]['count'](_0x30524f)[_0xfdd4('0x27')](function(_0x23af2a){_0x4aa4f2[_0xfdd4('0x22')]=_0x23af2a;if(_0x3fd07a[_0xfdd4('0x36')][_0xfdd4('0x45')]){_0x2a65c8[_0xfdd4('0x46')]=[{'all':!![]}];}return db[_0xfdd4('0x31')]['findAll'](_0x2a65c8);})[_0xfdd4('0x27')](function(_0x586713){_0x4aa4f2[_0xfdd4('0x47')]=_0x586713;return _0x4aa4f2;})[_0xfdd4('0x27')](respondWithFilteredResult(_0x502776,_0x2a65c8))[_0xfdd4('0x48')](handleError(_0x502776,null));};exports[_0xfdd4('0x49')]=function(_0x5367aa,_0x419578){var _0x11e90a={'raw':![],'where':{'id':_0x5367aa[_0xfdd4('0x4a')]['id']}},_0x4d1dfe={};_0x4d1dfe[_0xfdd4('0x35')]=_['keys'](db[_0xfdd4('0x31')]['rawAttributes']);_0x4d1dfe['query']=_['keys'](_0x5367aa[_0xfdd4('0x36')]);_0x4d1dfe[_0xfdd4('0x38')]=_[_0xfdd4('0x39')](_0x4d1dfe['model'],_0x4d1dfe[_0xfdd4('0x36')]);_0x11e90a[_0xfdd4('0x3a')]=_['intersection'](_0x4d1dfe[_0xfdd4('0x35')],qs[_0xfdd4('0x3b')](_0x5367aa[_0xfdd4('0x36')][_0xfdd4('0x3b')]));_0x11e90a[_0xfdd4('0x3a')]=_0x11e90a[_0xfdd4('0x3a')][_0xfdd4('0x3c')]?_0x11e90a[_0xfdd4('0x3a')]:_0x4d1dfe[_0xfdd4('0x35')];if(_0x5367aa[_0xfdd4('0x36')][_0xfdd4('0x45')]){_0x11e90a[_0xfdd4('0x46')]=[{'all':!![]}];}_0x11e90a=_[_0xfdd4('0x42')]({},_0x11e90a,_0x5367aa[_0xfdd4('0x44')]);return db['VoicePrefix']['find'](_0x11e90a)[_0xfdd4('0x27')](handleEntityNotFound(_0x419578,null))[_0xfdd4('0x27')](respondWithResult(_0x419578,null))[_0xfdd4('0x48')](handleError(_0x419578,null));};exports[_0xfdd4('0x2b')]=function(_0x507bf5,_0x3c6828){return db[_0xfdd4('0x31')]['find']({'where':{'id':_0x507bf5['params']['id']}})['then'](handleEntityNotFound(_0x3c6828,null))['then'](removeEntity(_0x3c6828,null))['catch'](handleError(_0x3c6828,null));};exports[_0xfdd4('0x4b')]=function(_0x88e9ef,_0x3a4202){return db[_0xfdd4('0x31')][_0xfdd4('0x4b')]()[_0xfdd4('0x27')](respondWithResult(_0x3a4202,null))['catch'](handleError(_0x3a4202,null));};exports[_0xfdd4('0x4c')]=function(_0x1f521a,_0x1dd417){var _0x2355b5;return db['sequelize'][_0xfdd4('0x4d')](function(_0x8aa0ea){return db['VoicePrefix'][_0xfdd4('0x4c')](_0x1f521a[_0xfdd4('0x4e')],{'transaction':_0x8aa0ea})['then'](function(_0x5467d1){_0x2355b5=_0x5467d1[_0xfdd4('0x28')]({'plain':!![]});return db[_0xfdd4('0x4f')][_0xfdd4('0x50')]({'where':{'id':_0x2355b5[_0xfdd4('0x51')]},'raw':!![]})[_0xfdd4('0x27')](function(_0x1b9979){return createVoicePrefixExtensions(_0x2355b5,_0x1b9979,_0x8aa0ea);});});})[_0xfdd4('0x27')](function(){var _0x3de4fd=_0x1f521a['user'][_0xfdd4('0x28')]({'plain':!![]});if(!_0x3de4fd)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3de4fd['role']===_0xfdd4('0x52')){var _0x1d9a8d=_0x2355b5;return db['UserProfileSection']['find']({'where':{'name':'VoicePrefixes','userProfileId':_0x3de4fd[_0xfdd4('0x53')]},'raw':!![]})[_0xfdd4('0x27')](function(_0x4dc113){if(_0x4dc113&&_0x4dc113[_0xfdd4('0x54')]===0x0){return db[_0xfdd4('0x2a')][_0xfdd4('0x4c')]({'name':_0x1d9a8d[_0xfdd4('0x2e')],'resourceId':_0x1d9a8d['id'],'type':_0x4dc113[_0xfdd4('0x2e')],'sectionId':_0x4dc113['id']},{})['then'](function(){return _0x2355b5;});}else{return _0x2355b5;}})['catch'](function(_0x483942){logger['error'](_0xfdd4('0x55'),_0x483942);throw _0x483942;});}return _0x2355b5;})[_0xfdd4('0x27')](respondWithResult(_0x1dd417,null))['catch'](handleError(_0x1dd417,null));};function Extension(_0x1eee3d,_0x2abe50,_0x4d4304,_0x45dcc8){this[_0xfdd4('0x56')]='from-sip';this[_0xfdd4('0x57')]=_0x1eee3d;this[_0xfdd4('0x58')]=_0x4d4304;this[_0xfdd4('0x33')]='system';this[_0xfdd4('0x59')]=_0xfdd4('0x5a');this[_0xfdd4('0x5b')]=_0x2abe50;this[_0xfdd4('0x5c')]=_0x45dcc8;}function createVoicePrefixExtensions(_0x5c7be,_0x562417,_0x2cc3e2){return new BPromise(function(_0x2ee4b6,_0x3be4d5){var _0x202124=new Extension(formatPrefixName(_0x5c7be[_0xfdd4('0x5d')]),0x1,_0xfdd4('0x5e'),_0xfdd4('0x5f'));_0x202124[_0xfdd4('0x60')]=_0x5c7be['id'];return db[_0xfdd4('0x4f')]['create'](_0x202124,{'transaction':_0x2cc3e2})[_0xfdd4('0x27')](function(_0x2799b2){var _0x4483e1=_0x2799b2[_0xfdd4('0x28')]({'plain':!![]});var _0x3096fa=_['map'](addVoicePrefixExtensions(_0x5c7be,_0x562417),function(_0x46e7eb){_0x46e7eb[_0xfdd4('0x51')]=_0x4483e1['id'];_0x46e7eb[_0xfdd4('0x60')]=_0x5c7be['id'];return _0x46e7eb;});return db[_0xfdd4('0x4f')][_0xfdd4('0x61')](_0x3096fa,{'transaction':_0x2cc3e2})[_0xfdd4('0x27')](function(_0x180ad9){if(!_0x180ad9){return _0x3be4d5(_0xfdd4('0x62'));}else{return _0x2ee4b6(_0x180ad9);}})[_0xfdd4('0x48')](function(_0x2a0dd8){return _0x3be4d5(_0x2a0dd8);});});;});};function addVoicePrefixExtensions(_0x2fff30,_0x2792c4){var _0x1205b8=[];var _0x527068=formatPrefixName(_0x2fff30[_0xfdd4('0x5d')]);_0x1205b8['push'](new Extension(_0x527068,0x2,_0xfdd4('0x63'),_0xfdd4('0x64')+_0x2fff30[_0xfdd4('0x2e')]));if(_0x2fff30[_0xfdd4('0x65')]){_0x1205b8[_0xfdd4('0x66')](new Extension(_0x527068,0x3,_0xfdd4('0x63'),_0xfdd4('0x67')+_0x2fff30[_0xfdd4('0x65')]));}else{_0x1205b8[_0xfdd4('0x66')](new Extension(_0x527068,0x3,_0xfdd4('0x5e'),_0xfdd4('0x68')));}_0x1205b8[_0xfdd4('0x66')](new Extension(_0x527068,0x4,'goto',_0x2792c4['context']+','+'${EXTEN:'+(0x8+_0x2fff30[_0xfdd4('0x2e')][_0xfdd4('0x3c')])+'}'+','+0x1));return _0x1205b8;}function formatPrefixName(_0x4bb18b){var _0x3a367c='_';for(var _0x3f027b=0x0;_0x3f027b<_0x4bb18b[_0xfdd4('0x3c')];_0x3f027b++){if(_0x4bb18b[_0xfdd4('0x69')](_0x3f027b)=='-'){_0x3a367c+=_0x4bb18b[_0xfdd4('0x69')](_0x3f027b);}else{_0x3a367c+='['+_0x4bb18b['charAt'](_0x3f027b)+']';}}_0x3a367c+='.';return _0x3a367c;}exports[_0xfdd4('0x6a')]=function(_0x297432,_0x3958cd,_0x523085){var _0x366f1c=_0x297432['body'];_0x366f1c[_0xfdd4('0x5d')]=_0xfdd4('0x6b')+_0x366f1c[_0xfdd4('0x2e')]+'-';return db[_0xfdd4('0x6c')]['transaction'](function(_0x2351b6){return db[_0xfdd4('0x31')]['update'](_0x366f1c,{'where':{'id':_0x366f1c['id']},'transaction':_0x2351b6})[_0xfdd4('0x27')](function(){return db[_0xfdd4('0x4f')][_0xfdd4('0x2b')]({'where':{'VoicePrefixId':_0x366f1c['id']},'transaction':_0x2351b6})['then'](function(){return db[_0xfdd4('0x4f')][_0xfdd4('0x50')]({'where':{'id':_0x366f1c[_0xfdd4('0x51')]},'raw':!![]})['then'](function(_0x3f4337){return createVoicePrefixExtensions(_0x366f1c,_0x3f4337,_0x2351b6);});});});})[_0xfdd4('0x27')](function(){return db[_0xfdd4('0x31')][_0xfdd4('0x6d')](_0x366f1c['id']);})[_0xfdd4('0x27')](respondWithResult(_0x3958cd,null))[_0xfdd4('0x48')](handleError(_0x3958cd,null));};exports[_0xfdd4('0x6e')]=function(_0x539d3b,_0x147d54,_0x36b615){return db[_0xfdd4('0x31')][_0xfdd4('0x50')]({'where':{'id':_0x539d3b[_0xfdd4('0x4a')]['id']}})[_0xfdd4('0x27')](handleEntityNotFound(_0x147d54,null))[_0xfdd4('0x27')](function(_0x4987d6){if(_0x4987d6){return _0x4987d6['addAgents'](_0x539d3b[_0xfdd4('0x4e')]['ids'],_['omit'](_0x539d3b[_0xfdd4('0x4e')],['ids','id'])||{})[_0xfdd4('0x6f')](function(_0x51711a){for(var _0x4576ce=0x0;_0x4576ce<_0x539d3b[_0xfdd4('0x4e')][_0xfdd4('0x70')][_0xfdd4('0x3c')];_0x4576ce+=0x1){socket[_0xfdd4('0x71')](_0xfdd4('0x72'),{'UserId':Number(_0x539d3b[_0xfdd4('0x4e')]['ids'][_0x4576ce]),'VoicePrefixId':Number(_0x539d3b['params']['id'])});}return _0x51711a;});}})[_0xfdd4('0x27')](respondWithResult(_0x147d54,null))['catch'](handleError(_0x147d54,null));};exports[_0xfdd4('0x73')]=function(_0x1a82ee,_0x3b205f,_0x1d57f8){return db[_0xfdd4('0x31')][_0xfdd4('0x50')]({'where':{'id':_0x1a82ee[_0xfdd4('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3b205f,null))['then'](function(_0x37a342){if(_0x37a342){return _0x37a342[_0xfdd4('0x73')](_0x1a82ee[_0xfdd4('0x36')][_0xfdd4('0x70')])[_0xfdd4('0x27')](function(){if(_[_0xfdd4('0x74')](_0x1a82ee[_0xfdd4('0x36')][_0xfdd4('0x70')])){for(var _0xf78c69=0x0;_0xf78c69<_0x1a82ee[_0xfdd4('0x36')][_0xfdd4('0x70')][_0xfdd4('0x3c')];_0xf78c69+=0x1){socket[_0xfdd4('0x71')]('userVoicePrefix:remove',{'UserId':Number(_0x1a82ee['query'][_0xfdd4('0x70')][_0xf78c69]),'VoicePrefixId':Number(_0x1a82ee[_0xfdd4('0x4a')]['id'])});}}else{socket['emit']('userVoicePrefix:remove',{'UserId':Number(_0x1a82ee[_0xfdd4('0x36')][_0xfdd4('0x70')]),'VoicePrefixId':Number(_0x1a82ee['params']['id'])});}});}})[_0xfdd4('0x27')](respondWithStatusCode(_0x3b205f,null))[_0xfdd4('0x48')](handleError(_0x3b205f,null));};exports[_0xfdd4('0x75')]=function(_0x11db43,_0x5ec62b,_0x25c078){var _0x5d356c={};var _0x3924c7={};var _0x2f65d7;var _0x4783b9;return db[_0xfdd4('0x31')][_0xfdd4('0x76')]({'where':{'id':_0x11db43[_0xfdd4('0x4a')]['id']}})[_0xfdd4('0x27')](handleEntityNotFound(_0x5ec62b,null))[_0xfdd4('0x27')](function(_0x575bc2){if(_0x575bc2){_0x2f65d7=_0x575bc2;_0x3924c7['model']=_[_0xfdd4('0x37')](db['User'][_0xfdd4('0x77')]);_0x3924c7[_0xfdd4('0x36')]=_[_0xfdd4('0x37')](_0x11db43[_0xfdd4('0x36')]);_0x3924c7[_0xfdd4('0x38')]=_['intersection'](_0x3924c7['model'],_0x3924c7[_0xfdd4('0x36')]);_0x5d356c['attributes']=_[_0xfdd4('0x39')](_0x3924c7['model'],qs[_0xfdd4('0x3b')](_0x11db43[_0xfdd4('0x36')][_0xfdd4('0x3b')]));_0x5d356c[_0xfdd4('0x3a')]=_0x5d356c[_0xfdd4('0x3a')][_0xfdd4('0x3c')]?_0x5d356c[_0xfdd4('0x3a')]:_0x3924c7[_0xfdd4('0x35')];_0x5d356c[_0xfdd4('0x78')]=qs[_0xfdd4('0x3e')](_0x11db43[_0xfdd4('0x36')]['sort']);_0x5d356c[_0xfdd4('0x3f')]=qs[_0xfdd4('0x38')](_[_0xfdd4('0x40')](_0x11db43[_0xfdd4('0x36')],_0x3924c7[_0xfdd4('0x38')]));if(_0x11db43[_0xfdd4('0x36')][_0xfdd4('0x41')]){_0x5d356c[_0xfdd4('0x3f')]=_[_0xfdd4('0x42')](_0x5d356c['where'],{'$or':_['map'](_0x5d356c[_0xfdd4('0x3a')],function(_0x244d6d){var _0x30bd32={};_0x30bd32[_0x244d6d]={'$like':'%'+_0x11db43['query'][_0xfdd4('0x41')]+'%'};return _0x30bd32;})});}_0x5d356c=_[_0xfdd4('0x42')]({},_0x5d356c,_0x11db43[_0xfdd4('0x44')]);return _0x2f65d7[_0xfdd4('0x75')](_0x5d356c);}})['then'](function(_0x5868e6){if(_0x5868e6){_0x4783b9=_0x5868e6[_0xfdd4('0x3c')];if(!_0x11db43[_0xfdd4('0x36')][_0xfdd4('0x3d')]('nolimit')){_0x5d356c[_0xfdd4('0x21')]=qs[_0xfdd4('0x21')](_0x11db43[_0xfdd4('0x36')][_0xfdd4('0x21')]);_0x5d356c[_0xfdd4('0x1f')]=qs[_0xfdd4('0x1f')](_0x11db43['query']['offset']);}return _0x2f65d7[_0xfdd4('0x75')](_0x5d356c);}})[_0xfdd4('0x27')](function(_0x6a1410){if(_0x6a1410){return _0x6a1410?{'count':_0x4783b9,'rows':_0x6a1410}:null;}})[_0xfdd4('0x27')](respondWithResult(_0x5ec62b,null))[_0xfdd4('0x48')](handleError(_0x5ec62b,null));};exports[_0xfdd4('0x79')]=function(_0x46edc9,_0x2a4366,_0x5d1a3f){var _0x218d83={};var _0x547c4c={};var _0x464eb0;var _0x1871d6;return db['VoicePrefix'][_0xfdd4('0x76')]({'where':{'id':_0x46edc9[_0xfdd4('0x4a')]['id']}})[_0xfdd4('0x27')](handleEntityNotFound(_0x2a4366,null))[_0xfdd4('0x27')](function(_0x3cd7ae){if(_0x3cd7ae){_0x464eb0=_0x3cd7ae;_0x547c4c[_0xfdd4('0x35')]=_[_0xfdd4('0x37')](db[_0xfdd4('0x7a')][_0xfdd4('0x77')]);_0x547c4c['query']=_[_0xfdd4('0x37')](_0x46edc9['query']);_0x547c4c[_0xfdd4('0x38')]=_['intersection'](_0x547c4c['model'],_0x547c4c[_0xfdd4('0x36')]);_0x218d83[_0xfdd4('0x3a')]=_[_0xfdd4('0x39')](_0x547c4c[_0xfdd4('0x35')],qs[_0xfdd4('0x3b')](_0x46edc9['query'][_0xfdd4('0x3b')]));_0x218d83[_0xfdd4('0x3a')]=_0x218d83[_0xfdd4('0x3a')][_0xfdd4('0x3c')]?_0x218d83[_0xfdd4('0x3a')]:_0x547c4c[_0xfdd4('0x35')];_0x218d83['order']=qs[_0xfdd4('0x3e')](_0x46edc9[_0xfdd4('0x36')]['sort']);_0x218d83['where']=qs[_0xfdd4('0x38')](_[_0xfdd4('0x40')](_0x46edc9[_0xfdd4('0x36')],_0x547c4c['filters']));if(_0x46edc9['query'][_0xfdd4('0x41')]){_0x218d83[_0xfdd4('0x3f')]=_[_0xfdd4('0x42')](_0x218d83['where'],{'$or':_['map'](_0x218d83[_0xfdd4('0x3a')],function(_0xd6eb47){var _0x1927ed={};_0x1927ed[_0xd6eb47]={'$like':'%'+_0x46edc9['query'][_0xfdd4('0x41')]+'%'};return _0x1927ed;})});}_0x218d83=_['merge']({},_0x218d83,_0x46edc9[_0xfdd4('0x44')]);return _0x464eb0[_0xfdd4('0x79')](_0x218d83);}})[_0xfdd4('0x27')](function(_0x4e1dbc){if(_0x4e1dbc){_0x1871d6=_0x4e1dbc[_0xfdd4('0x3c')];if(!_0x46edc9[_0xfdd4('0x36')][_0xfdd4('0x3d')](_0xfdd4('0x7b'))){_0x218d83[_0xfdd4('0x21')]=qs['limit'](_0x46edc9[_0xfdd4('0x36')][_0xfdd4('0x21')]);_0x218d83[_0xfdd4('0x1f')]=qs['offset'](_0x46edc9[_0xfdd4('0x36')][_0xfdd4('0x1f')]);}return _0x464eb0[_0xfdd4('0x79')](_0x218d83);}})[_0xfdd4('0x27')](function(_0x56e5d3){if(_0x56e5d3){return _0x56e5d3?{'count':_0x1871d6,'rows':_0x56e5d3}:null;}})[_0xfdd4('0x27')](respondWithResult(_0x2a4366,null))['catch'](handleError(_0x2a4366,null));};exports['addTeams']=function(_0x528004,_0x206a59,_0x545475){var _0x5e5362=_0x528004['body'][_0xfdd4('0x70')];var _0x728e25;return db[_0xfdd4('0x7a')][_0xfdd4('0x7c')]({'where':{'id':_0x5e5362},'attributes':['id'],'include':[{'model':db[_0xfdd4('0x7d')],'as':_0xfdd4('0x7e'),'attributes':['id',_0xfdd4('0x2e'),_0xfdd4('0x7f'),_0xfdd4('0x80'),_0xfdd4('0x81')],'raw':!![]}]})[_0xfdd4('0x27')](function(_0x2911ca){if(_0x2911ca){_0x728e25=_0x2911ca;var _0x31303f=_[_0xfdd4('0x82')](_0x2911ca,function(_0x46b927){var _0x450c67=_0x46b927[_0xfdd4('0x28')]({'plain':!![]});return _0x450c67[_0xfdd4('0x7e')];});return db[_0xfdd4('0x31')][_0xfdd4('0x50')]({'where':{'id':_0x528004[_0xfdd4('0x4a')]['id']}})[_0xfdd4('0x27')](function(_0x189baf){return db[_0xfdd4('0x6c')][_0xfdd4('0x4d')](function(_0x22f93b){return _0x189baf['addTeams'](_0x5e5362,{'transaction':_0x22f93b})[_0xfdd4('0x27')](function(){return BPromise[_0xfdd4('0x83')](_0x728e25,function(_0xaef5e2){return db[_0xfdd4('0x84')][_0xfdd4('0x85')]({'TeamId':_0xaef5e2['id'],'VoicePrefixId':_0x528004['params']['id']},{'transaction':_0x22f93b});});})[_0xfdd4('0x27')](function(){return BPromise[_0xfdd4('0x83')](_0x31303f,function(_0x19b679){return db[_0xfdd4('0x86')][_0xfdd4('0x87')]({'where':{'UserId':_0x19b679['id'],'VoicePrefixId':_0x528004[_0xfdd4('0x4a')]['id']},'transaction':_0x22f93b});});})['then'](function(){_0x31303f[_0xfdd4('0x88')](function(_0x1a9e62){socket[_0xfdd4('0x71')](_0xfdd4('0x72'),{'UserId':_0x1a9e62['id'],'VoicePrefixId':_0x189baf['id']});});});});});}})[_0xfdd4('0x27')](respondWithStatusCode(_0x206a59,null))[_0xfdd4('0x48')](handleError(_0x206a59,null));};exports['removeTeams']=function(_0x2a6a0d,_0x3d82d1,_0x17d272){return db['Team'][_0xfdd4('0x7c')]({'where':{'id':_0x2a6a0d[_0xfdd4('0x36')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0xfdd4('0x7e'),'attributes':['id'],'raw':!![]}]})[_0xfdd4('0x27')](handleEntityNotFound(_0x3d82d1,null))[_0xfdd4('0x27')](function(_0xd07645){var _0x5a3249=_[_0xfdd4('0x30')](_0xd07645,'id');var _0x5b22b1=[];var _0xc9955e=[];var _0x42204a=squel[_0xfdd4('0x89')]();_0x42204a[_0xfdd4('0x8a')](_0xfdd4('0x8b'))[_0xfdd4('0x8c')](_0xfdd4('0x8d'),'tq')[_0xfdd4('0x8e')](_0xfdd4('0x8f'),'ut',_0xfdd4('0x90'))[_0xfdd4('0x3f')]('VoicePrefixId\x20=\x20?',_0x2a6a0d[_0xfdd4('0x4a')]['id']);for(var _0x42a3dc=0x0;_0x42a3dc<_0xd07645[_0xfdd4('0x3c')];_0x42a3dc+=0x1){let _0x26316c=_0xd07645[_0x42a3dc];for(var _0x1e7bbb=0x0;_0x1e7bbb<_0x26316c[_0xfdd4('0x7e')]['length'];_0x1e7bbb+=0x1){let _0xfd0c1=_0x26316c[_0xfdd4('0x7e')][_0x1e7bbb];var _0x2ae92=_0x42204a[_0xfdd4('0x91')]();_0x2ae92['where'](_0xfdd4('0x92'),_0xfd0c1['id']);_0xc9955e[_0xfdd4('0x66')](db['sequelize'][_0xfdd4('0x36')](_0x2ae92[_0xfdd4('0x93')](),{'type':db[_0xfdd4('0x6c')][_0xfdd4('0x94')][_0xfdd4('0x95')]})[_0xfdd4('0x27')](function(_0x191ab6){if(_0x191ab6[_0xfdd4('0x3c')]===0x1){return _0xfd0c1['id'];}else{var _0x1d460f=_[_0xfdd4('0x96')](_[_0xfdd4('0x30')](_0x191ab6,_0xfdd4('0x97')),function(_0x25c508){return _[_0xfdd4('0x98')](_0x5a3249,_0x25c508);});if(_0x1d460f){return _0xfd0c1['id'];}}}));}}return BPromise['all'](_0xc9955e)[_0xfdd4('0x27')](function(_0x349fc6){_0x5b22b1=_(_0x5b22b1)[_0xfdd4('0x99')](_0x349fc6)[_0xfdd4('0x9a')]()['value']();return db[_0xfdd4('0x31')][_0xfdd4('0x50')]({'where':{'id':_0x2a6a0d['params']['id']}})[_0xfdd4('0x27')](function(_0x401681){return db[_0xfdd4('0x6c')][_0xfdd4('0x4d')](function(_0x5a7c85){return _0x401681[_0xfdd4('0x9b')](_0x2a6a0d['query'][_0xfdd4('0x70')],{'transaction':_0x5a7c85})[_0xfdd4('0x27')](function(){if(!_['isEmpty'](_0x5b22b1)){return _0x401681[_0xfdd4('0x73')](_0x5b22b1,{'transaction':_0x5a7c85});}})['then'](function(){_0x5b22b1['forEach'](function(_0x10a396){socket[_0xfdd4('0x71')](_0xfdd4('0x9c'),{'UserId':_0x10a396,'VoicePrefixId':_0x401681['id']});});});});});});})[_0xfdd4('0x27')](respondWithStatusCode(_0x3d82d1,null))['catch'](handleError(_0x3d82d1,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index c730579..ab877f9 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 _0x3045=['hook','events','../../mysqldb','VoicePrefix','update','emit'];(function(_0x540178,_0x1feb3d){var _0x58a85c=function(_0x1c4861){while(--_0x1c4861){_0x540178['push'](_0x540178['shift']());}};_0x58a85c(++_0x1feb3d);}(_0x3045,0x13f));var _0x5304=function(_0x50c36b,_0xa6a857){_0x50c36b=_0x50c36b-0x0;var _0x3a5f8f=_0x3045[_0x50c36b];return _0x3a5f8f;};'use strict';var EventEmitter=require(_0x5304('0x0'));var VoicePrefix=require(_0x5304('0x1'))['db'][_0x5304('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x5304('0x3'),'afterDestroy':'remove'};function emitEvent(_0x54b4b9){return function(_0x2c6ec5,_0x345d95,_0x5c8db9){VoicePrefixEvents[_0x5304('0x4')](_0x54b4b9+':'+_0x2c6ec5['id'],_0x2c6ec5);VoicePrefixEvents[_0x5304('0x4')](_0x54b4b9,_0x2c6ec5);_0x5c8db9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix[_0x5304('0x5')](e,emitEvent(event));}}module['exports']=VoicePrefixEvents; \ No newline at end of file +var _0x9af8=['update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0xcdcf3b,_0x3fc1dc){var _0xaa0e09=function(_0x3d8f53){while(--_0x3d8f53){_0xcdcf3b['push'](_0xcdcf3b['shift']());}};_0xaa0e09(++_0x3fc1dc);}(_0x9af8,0xdd));var _0x89af=function(_0x2d455a,_0x51c15b){_0x2d455a=_0x2d455a-0x0;var _0x269254=_0x9af8[_0x2d455a];return _0x269254;};'use strict';var EventEmitter=require(_0x89af('0x0'));var VoicePrefix=require(_0x89af('0x1'))['db']['VoicePrefix'];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x89af('0x2')](0x0);var events={'afterCreate':_0x89af('0x3'),'afterUpdate':_0x89af('0x4'),'afterDestroy':'remove'};function emitEvent(_0x59f634){return function(_0x468a0e,_0x277957,_0x46fecc){VoicePrefixEvents[_0x89af('0x5')](_0x59f634+':'+_0x468a0e['id'],_0x468a0e);VoicePrefixEvents[_0x89af('0x5')](_0x59f634,_0x468a0e);_0x46fecc(null);};}for(var e in events){if(events[_0x89af('0x6')](e)){var event=events[e];VoicePrefix[_0x89af('0x7')](e,emitEvent(event));}}module[_0x89af('0x8')]=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index 6e40449..68acede 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 _0xdd9b=['VoicePrefix','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./voicePrefix.attributes','exports','define'];(function(_0x20629d,_0x1a6757){var _0x4ca950=function(_0x2c806c){while(--_0x2c806c){_0x20629d['push'](_0x20629d['shift']());}};_0x4ca950(++_0x1a6757);}(_0xdd9b,0x16d));var _0xbdd9=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0xdd9b[_0x5f0089];return _0x193892;};'use strict';var _=require(_0xbdd9('0x0'));var util=require(_0xbdd9('0x1'));var logger=require(_0xbdd9('0x2'))(_0xbdd9('0x3'));var moment=require(_0xbdd9('0x4'));var BPromise=require(_0xbdd9('0x5'));var rp=require(_0xbdd9('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbdd9('0x7'));var config=require(_0xbdd9('0x8'));var attributes=require(_0xbdd9('0x9'));module[_0xbdd9('0xa')]=function(_0x2b9c07,_0x360e3c){return _0x2b9c07[_0xbdd9('0xb')](_0xbdd9('0xc'),attributes,{'tableName':'voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc6fd=['exports','VoicePrefix','voice_prefixes','lodash','util','../../config/logger','api','moment','path','rimraf','./voicePrefix.attributes'];(function(_0x275010,_0x4739b2){var _0x57c423=function(_0x38109d){while(--_0x38109d){_0x275010['push'](_0x275010['shift']());}};_0x57c423(++_0x4739b2);}(_0xc6fd,0x10b));var _0xdc6f=function(_0xf668ff,_0x3e81d0){_0xf668ff=_0xf668ff-0x0;var _0x323c18=_0xc6fd[_0xf668ff];return _0x323c18;};'use strict';var _=require(_0xdc6f('0x0'));var util=require(_0xdc6f('0x1'));var logger=require(_0xdc6f('0x2'))(_0xdc6f('0x3'));var moment=require(_0xdc6f('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xdc6f('0x5'));var rimraf=require(_0xdc6f('0x6'));var config=require('../../config/environment');var attributes=require(_0xdc6f('0x7'));module[_0xdc6f('0x8')]=function(_0xa3022e,_0x23f6a6){return _0xa3022e['define'](_0xdc6f('0x9'),attributes,{'tableName':_0xdc6f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.rpc.js b/server/api/voicePrefix/voicePrefix.rpc.js index 6376810..48e161c 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 _0xbe2c=['util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','request','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','VoicePrefix,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xbe2c,0x18f));var _0xcbe2=function(_0x1b5100,_0xaa7d32){_0x1b5100=_0x1b5100-0x0;var _0x2e3200=_0xbe2c[_0x1b5100];return _0x2e3200;};'use strict';var _=require(_0xcbe2('0x0'));var util=require(_0xcbe2('0x1'));var moment=require('moment');var BPromise=require(_0xcbe2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcbe2('0x3'));var db=require(_0xcbe2('0x4'))['db'];var utils=require(_0xcbe2('0x5'));var logger=require(_0xcbe2('0x6'))(_0xcbe2('0x7'));var config=require('../../config/environment');var jayson=require(_0xcbe2('0x8'));var client=jayson[_0xcbe2('0x9')]['http']({'port':0x232a});config[_0xcbe2('0xa')]=_[_0xcbe2('0xb')](config[_0xcbe2('0xa')],{'host':_0xcbe2('0xc'),'port':0x18eb});var socket=require(_0xcbe2('0xd'))(new Redis(config['redis']));require('./voicePrefix.socket')[_0xcbe2('0xe')](socket);function respondWithRpcPromise(_0x335234,_0x675278,_0x1b67af){return new BPromise(function(_0x4af901,_0x5d2a45){return client[_0xcbe2('0xf')](_0x335234,_0x1b67af)[_0xcbe2('0x10')](function(_0x3b050b){logger[_0xcbe2('0x11')](_0xcbe2('0x12'),_0x675278,_0xcbe2('0x13'));logger['debug'](_0xcbe2('0x14'),_0x675278,_0xcbe2('0x13'),JSON['stringify'](_0x3b050b));if(_0x3b050b[_0xcbe2('0x15')]){if(_0x3b050b['error'][_0xcbe2('0x16')]===0x1f4){logger['error'](_0xcbe2('0x12'),_0x675278,_0x3b050b['error']['message']);return _0x5d2a45(_0x3b050b[_0xcbe2('0x15')]['message']);}logger[_0xcbe2('0x15')](_0xcbe2('0x12'),_0x675278,_0x3b050b[_0xcbe2('0x15')][_0xcbe2('0x17')]);return _0x4af901(_0x3b050b[_0xcbe2('0x15')][_0xcbe2('0x17')]);}else{logger[_0xcbe2('0x11')]('VoicePrefix,\x20%s,\x20%s',_0x675278,_0xcbe2('0x13'));_0x4af901(_0x3b050b['result'][_0xcbe2('0x17')]);}})[_0xcbe2('0x18')](function(_0x31b49c){logger[_0xcbe2('0x15')]('VoicePrefix,\x20%s,\x20%s',_0x675278,_0x31b49c);_0x5d2a45(_0x31b49c);});});} \ No newline at end of file +var _0xe2fe=['../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','./voicePrefix.socket','then','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','VoicePrefix,\x20%s,\x20%s','message','info','lodash','bluebird','ioredis','../../mysqldb'];(function(_0x276517,_0x4d19e6){var _0x75ec0c=function(_0x4049bf){while(--_0x4049bf){_0x276517['push'](_0x276517['shift']());}};_0x75ec0c(++_0x4d19e6);}(_0xe2fe,0x86));var _0xee2f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe2fe[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xee2f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xee2f('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xee2f('0x2'));var db=require(_0xee2f('0x3'))['db'];var utils=require(_0xee2f('0x4'));var logger=require(_0xee2f('0x5'))(_0xee2f('0x6'));var config=require('../../config/environment');var jayson=require(_0xee2f('0x7'));var client=jayson[_0xee2f('0x8')]['http']({'port':0x232a});config[_0xee2f('0x9')]=_[_0xee2f('0xa')](config['redis'],{'host':_0xee2f('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xee2f('0x9')]));require(_0xee2f('0xc'))['register'](socket);function respondWithRpcPromise(_0x3a49bb,_0x43f451,_0x4bf3c3){return new BPromise(function(_0x5597ea,_0x4818df){return client['request'](_0x3a49bb,_0x4bf3c3)[_0xee2f('0xd')](function(_0x4cb4bf){logger['info']('VoicePrefix,\x20%s,\x20%s',_0x43f451,_0xee2f('0xe'));logger[_0xee2f('0xf')](_0xee2f('0x10'),_0x43f451,_0xee2f('0xe'),JSON[_0xee2f('0x11')](_0x4cb4bf));if(_0x4cb4bf[_0xee2f('0x12')]){if(_0x4cb4bf['error'][_0xee2f('0x13')]===0x1f4){logger['error'](_0xee2f('0x14'),_0x43f451,_0x4cb4bf[_0xee2f('0x12')]['message']);return _0x4818df(_0x4cb4bf[_0xee2f('0x12')][_0xee2f('0x15')]);}logger[_0xee2f('0x12')](_0xee2f('0x14'),_0x43f451,_0x4cb4bf[_0xee2f('0x12')]['message']);return _0x5597ea(_0x4cb4bf[_0xee2f('0x12')]['message']);}else{logger[_0xee2f('0x16')](_0xee2f('0x14'),_0x43f451,'request\x20sent');_0x5597ea(_0x4cb4bf['result'][_0xee2f('0x15')]);}})['catch'](function(_0x69db88){logger[_0xee2f('0x12')](_0xee2f('0x14'),_0x43f451,_0x69db88);_0x4818df(_0x69db88);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index 5a7575b..7ce0905 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 _0xee4f=['length','./voicePrefix.events','update','emit'];(function(_0x59a9cf,_0x48878b){var _0x25f1f3=function(_0x556319){while(--_0x556319){_0x59a9cf['push'](_0x59a9cf['shift']());}};_0x25f1f3(++_0x48878b);}(_0xee4f,0xad));var _0xfee4=function(_0x4425c3,_0x55b0c2){_0x4425c3=_0x4425c3-0x0;var _0x1f2459=_0xee4f[_0x4425c3];return _0x1f2459;};'use strict';var VoicePrefixEvents=require(_0xfee4('0x0'));var events=['save','remove',_0xfee4('0x1')];function createListener(_0x41b170,_0xf1acd6){return function(_0x5a03c9){_0xf1acd6[_0xfee4('0x2')](_0x41b170,_0x5a03c9);};}function removeListener(_0x5b9149,_0x27874a){return function(){VoicePrefixEvents['removeListener'](_0x5b9149,_0x27874a);};}exports['register']=function(_0x1c39b1){for(var _0x498647=0x0,_0x52fb6b=events[_0xfee4('0x3')];_0x498647<_0x52fb6b;_0x498647++){var _0x16cc9a=events[_0x498647];var _0x34908a=createListener('voicePrefix:'+_0x16cc9a,_0x1c39b1);VoicePrefixEvents['on'](_0x16cc9a,_0x34908a);}}; \ No newline at end of file +var _0xd403=['voicePrefix:','./voicePrefix.events','save','remove','update','emit','removeListener','register','length'];(function(_0x5d9be4,_0x5df4b6){var _0x44650b=function(_0x105191){while(--_0x105191){_0x5d9be4['push'](_0x5d9be4['shift']());}};_0x44650b(++_0x5df4b6);}(_0xd403,0x1d5));var _0x3d40=function(_0x4b7895,_0x3c4f5d){_0x4b7895=_0x4b7895-0x0;var _0x264180=_0xd403[_0x4b7895];return _0x264180;};'use strict';var VoicePrefixEvents=require(_0x3d40('0x0'));var events=[_0x3d40('0x1'),_0x3d40('0x2'),_0x3d40('0x3')];function createListener(_0x53d711,_0x381c5a){return function(_0x572b70){_0x381c5a[_0x3d40('0x4')](_0x53d711,_0x572b70);};}function removeListener(_0x6ee99,_0x1d860a){return function(){VoicePrefixEvents[_0x3d40('0x5')](_0x6ee99,_0x1d860a);};}exports[_0x3d40('0x6')]=function(_0xcb5864){for(var _0x113817=0x0,_0xfd5569=events[_0x3d40('0x7')];_0x113817<_0xfd5569;_0x113817++){var _0x1f488d=events[_0x113817];var _0x210104=createListener(_0x3d40('0x8')+_0x1f488d,_0xcb5864);VoicePrefixEvents['on'](_0x1f488d,_0x210104);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index 4480202..5e5b899 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 _0x3727=['/:id/members','getMembers','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','addTeams','addLists','addBlackLists','put','destroy','delete','removeTeams','removeLists','removeBlackLists','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceQueue.controller','get','isAuthenticated','index','/:id','/:id/hoppers','getHoppers','getHopperHistories','/:id/hopper_finals','/:id/hopper_black','getHopperBlacks','/:id/users'];(function(_0x30cd2f,_0x2f5842){var _0x1abe44=function(_0x19713e){while(--_0x19713e){_0x30cd2f['push'](_0x30cd2f['shift']());}};_0x1abe44(++_0x2f5842);}(_0x3727,0x1b4));var _0x7372=function(_0x1a5b93,_0x1b86bf){_0x1a5b93=_0x1a5b93-0x0;var _0x3b9587=_0x3727[_0x1a5b93];return _0x3b9587;};'use strict';var multer=require(_0x7372('0x0'));var util=require('util');var path=require(_0x7372('0x1'));var timeout=require(_0x7372('0x2'));var express=require(_0x7372('0x3'));var router=express[_0x7372('0x4')]();var fs_extra=require(_0x7372('0x5'));var auth=require(_0x7372('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x7372('0x7'));var controller=require(_0x7372('0x8'));router[_0x7372('0x9')]('/',auth[_0x7372('0xa')](),controller[_0x7372('0xb')]);router[_0x7372('0x9')](_0x7372('0xc'),auth[_0x7372('0xa')](),controller['show']);router['get'](_0x7372('0xd'),auth[_0x7372('0xa')](),controller[_0x7372('0xe')]);router[_0x7372('0x9')]('/:id/hopper_histories',auth[_0x7372('0xa')](),controller[_0x7372('0xf')]);router[_0x7372('0x9')](_0x7372('0x10'),auth[_0x7372('0xa')](),controller['getHopperFinals']);router[_0x7372('0x9')](_0x7372('0x11'),auth[_0x7372('0xa')](),controller[_0x7372('0x12')]);router[_0x7372('0x9')]('/:id/teams',auth['isAuthenticated'](),controller['getTeams']);router[_0x7372('0x9')](_0x7372('0x13'),auth['isAuthenticated'](),controller['getAgents']);router[_0x7372('0x9')](_0x7372('0x14'),auth[_0x7372('0xa')](),controller[_0x7372('0x15')]);router[_0x7372('0x9')]('/:id/lists',auth[_0x7372('0xa')](),controller[_0x7372('0x16')]);router[_0x7372('0x9')](_0x7372('0x17'),auth['isAuthenticated'](),controller[_0x7372('0x18')]);router[_0x7372('0x19')]('/',auth[_0x7372('0xa')](),controller[_0x7372('0x1a')]);router[_0x7372('0x19')](_0x7372('0x1b'),auth[_0x7372('0xa')](),controller['clone']);router['post']('/:id/teams',auth['isAuthenticated'](),controller[_0x7372('0x1c')]);router['post'](_0x7372('0x13'),auth[_0x7372('0xa')](),controller['addAgents']);router[_0x7372('0x19')]('/:id/lists',auth['isAuthenticated'](),controller[_0x7372('0x1d')]);router[_0x7372('0x19')]('/:id/blacklists',auth['isAuthenticated'](),controller[_0x7372('0x1e')]);router[_0x7372('0x1f')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x7372('0x20')]);router[_0x7372('0x21')]('/:id/teams',auth[_0x7372('0xa')](),controller[_0x7372('0x22')]);router[_0x7372('0x21')](_0x7372('0x13'),auth[_0x7372('0xa')](),controller['removeAgents']);router[_0x7372('0x21')]('/:id/lists',auth[_0x7372('0xa')](),controller[_0x7372('0x23')]);router[_0x7372('0x21')]('/:id/blacklists',auth['isAuthenticated'](),controller[_0x7372('0x24')]);module[_0x7372('0x25')]=router; \ No newline at end of file +var _0x8784=['getHopperFinals','getHopperBlacks','/:id/teams','getTeams','/:id/users','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addTeams','put','delete','destroy','removeTeams','removeAgents','removeLists','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./voiceQueue.controller','get','index','/:id','isAuthenticated','/:id/hoppers','/:id/hopper_histories','getHopperHistories'];(function(_0x37ced3,_0x58d45a){var _0x34d7bc=function(_0x7e48f2){while(--_0x7e48f2){_0x37ced3['push'](_0x37ced3['shift']());}};_0x34d7bc(++_0x58d45a);}(_0x8784,0x81));var _0x4878=function(_0x1e3c16,_0x372caa){_0x1e3c16=_0x1e3c16-0x0;var _0x47a0c9=_0x8784[_0x1e3c16];return _0x47a0c9;};'use strict';var multer=require('multer');var util=require(_0x4878('0x0'));var path=require(_0x4878('0x1'));var timeout=require(_0x4878('0x2'));var express=require(_0x4878('0x3'));var router=express['Router']();var fs_extra=require(_0x4878('0x4'));var auth=require(_0x4878('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4878('0x6'));var controller=require(_0x4878('0x7'));router[_0x4878('0x8')]('/',auth['isAuthenticated'](),controller[_0x4878('0x9')]);router['get'](_0x4878('0xa'),auth[_0x4878('0xb')](),controller['show']);router[_0x4878('0x8')](_0x4878('0xc'),auth['isAuthenticated'](),controller['getHoppers']);router['get'](_0x4878('0xd'),auth['isAuthenticated'](),controller[_0x4878('0xe')]);router[_0x4878('0x8')]('/:id/hopper_finals',auth[_0x4878('0xb')](),controller[_0x4878('0xf')]);router['get']('/:id/hopper_black',auth['isAuthenticated'](),controller[_0x4878('0x10')]);router[_0x4878('0x8')](_0x4878('0x11'),auth['isAuthenticated'](),controller[_0x4878('0x12')]);router[_0x4878('0x8')](_0x4878('0x13'),auth[_0x4878('0xb')](),controller['getAgents']);router[_0x4878('0x8')]('/:id/members',auth[_0x4878('0xb')](),controller['getMembers']);router['get'](_0x4878('0x14'),auth['isAuthenticated'](),controller[_0x4878('0x15')]);router[_0x4878('0x8')](_0x4878('0x16'),auth[_0x4878('0xb')](),controller[_0x4878('0x17')]);router[_0x4878('0x18')]('/',auth[_0x4878('0xb')](),controller[_0x4878('0x19')]);router['post'](_0x4878('0x1a'),auth[_0x4878('0xb')](),controller[_0x4878('0x1b')]);router[_0x4878('0x18')]('/:id/teams',auth[_0x4878('0xb')](),controller[_0x4878('0x1c')]);router[_0x4878('0x18')](_0x4878('0x13'),auth[_0x4878('0xb')](),controller['addAgents']);router[_0x4878('0x18')]('/:id/lists',auth[_0x4878('0xb')](),controller['addLists']);router[_0x4878('0x18')](_0x4878('0x16'),auth[_0x4878('0xb')](),controller['addBlackLists']);router[_0x4878('0x1d')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x4878('0x1e')](_0x4878('0xa'),auth[_0x4878('0xb')](),controller[_0x4878('0x1f')]);router['delete'](_0x4878('0x11'),auth[_0x4878('0xb')](),controller[_0x4878('0x20')]);router[_0x4878('0x1e')](_0x4878('0x13'),auth[_0x4878('0xb')](),controller[_0x4878('0x21')]);router[_0x4878('0x1e')]('/:id/lists',auth[_0x4878('0xb')](),controller[_0x4878('0x22')]);router['delete'](_0x4878('0x16'),auth[_0x4878('0xb')](),controller['removeBlackLists']);module[_0x4878('0x23')]=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index c434653..29e92f2 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 _0x8403=['Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','sequelize','exports','STRING','name','ENUM','inbound','outbound','ringall','leastrecent','fewestcalls','random','wrandom','rrordered','strategy','rrmemory','getDataValue','type','dialMethod','booked','roundrobin','progressive','power','INTEGER','yes','once','TEXT','setDataValue','periodic_announce','join','split','joinempty','leavewhenempty','BOOLEAN','wrapuptime','Active/Disactive\x20Campaign','preview','predictive','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','FLOAT','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)'];(function(_0x3a17ae,_0x4d8ccd){var _0x356279=function(_0x33a7f9){while(--_0x33a7f9){_0x3a17ae['push'](_0x3a17ae['shift']());}};_0x356279(++_0x4d8ccd);}(_0x8403,0x1a5));var _0x3840=function(_0x34070a,_0x11e6d7){_0x34070a=_0x34070a-0x0;var _0x550208=_0x8403[_0x34070a];return _0x550208;};'use strict';var Sequelize=require(_0x3840('0x0'));module[_0x3840('0x1')]={'name':{'type':Sequelize[_0x3840('0x2')],'allowNull':![],'unique':_0x3840('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x3840('0x4')](_0x3840('0x5'),_0x3840('0x6')),'allowNull':![],'defaultValue':_0x3840('0x5')},'musiconhold':{'type':Sequelize[_0x3840('0x2')],'defaultValue':'default'},'announce':{'type':Sequelize[_0x3840('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0x3840('0x4')]('rr',_0x3840('0x7'),_0x3840('0x8'),_0x3840('0x9'),_0x3840('0xa'),'rrmemory','linear',_0x3840('0xb'),_0x3840('0xc')),'allowNull':![],'defaultValue':_0x3840('0x7'),'set':function(_0x5351e8){this['setDataValue'](_0x3840('0xd'),_0x5351e8?_0x5351e8:_0x3840('0xe'));},'get':function(){var _0x24da73=this[_0x3840('0xf')](_0x3840('0x10'));var _0x320260=this[_0x3840('0xf')](_0x3840('0x11'));var _0x8ca446=this[_0x3840('0xf')]('strategy');if(_0x24da73===_0x3840('0x5')){return _0x8ca446;}if(_0x320260===_0x3840('0x12')&&_0x8ca446===_0x3840('0xe')||_0x320260==='booked'&&_0x8ca446===_0x3840('0x13')){return _0x8ca446;}if(_0x320260===_0x3840('0x14')||_0x320260==='predictive'||_0x320260===_0x3840('0x15')){return _0x8ca446;}return null;}},'servicelevel':{'type':Sequelize[_0x3840('0x16')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x3840('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x3840('0x16')](0xb)},'timeout':{'type':Sequelize[_0x3840('0x16')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x3840('0x16')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x3840('0x2')]},'weight':{'type':Sequelize[_0x3840('0x16')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x3840('0x16')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x3840('0x4')](_0x3840('0x17'),'no'),'defaultValue':'yes'},'autopause':{'type':Sequelize['ENUM'](_0x3840('0x17'),'no','all'),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x3840('0x16')](0xb)},'autopausebusy':{'type':Sequelize[_0x3840('0x4')]('yes','no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize['ENUM'](_0x3840('0x17'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x3840('0x16')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x3840('0x4')]('yes','no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x3840('0x4')](_0x3840('0x17'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x3840('0x4')](_0x3840('0x17'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x3840('0x4')]('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x3840('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x3840('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x3840('0x16')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x3840('0x16')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x3840('0x4')](_0x3840('0x17'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x3840('0x4')](_0x3840('0x17'),'no'),'defaultValue':_0x3840('0x17')},'announce_holdtime':{'type':Sequelize['ENUM'](_0x3840('0x17'),'no',_0x3840('0x18')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x3840('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x3840('0x4')]('yes','no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize['ENUM']('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x3840('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize['STRING']},'queue_youarenext':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x3840('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x3840('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x3840('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x3840('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x3840('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x3840('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x3840('0x2')]},'queue_quantity1':{'type':Sequelize[_0x3840('0x2')]},'queue_quantity2':{'type':Sequelize[_0x3840('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0x3840('0x2')]},'queue_less_than':{'type':Sequelize[_0x3840('0x2')]},'periodic_announce':{'type':Sequelize[_0x3840('0x19')],'set':function(_0x4ff0db){this[_0x3840('0x1a')](_0x3840('0x1b'),_0x4ff0db?_0x4ff0db[_0x3840('0x1c')](','):[]);},'get':function(){return this[_0x3840('0xf')]('periodic_announce')?this['getDataValue'](_0x3840('0x1b'))[_0x3840('0x1d')](','):[];}},'joinempty':{'type':Sequelize[_0x3840('0x2')],'defaultValue':_0x3840('0x17'),'set':function(_0x571907){this[_0x3840('0x1a')]('joinempty',_0x571907?_0x571907[_0x3840('0x1c')](','):undefined);},'get':function(){return this['getDataValue'](_0x3840('0x1e'))?this[_0x3840('0xf')](_0x3840('0x1e'))[_0x3840('0x1d')](','):undefined;}},'leavewhenempty':{'type':Sequelize['STRING'],'defaultValue':'no','set':function(_0x24b72){this[_0x3840('0x1a')](_0x3840('0x1f'),_0x24b72?_0x24b72['join'](','):undefined);},'get':function(){return this[_0x3840('0xf')](_0x3840('0x1f'))?this['getDataValue']('leavewhenempty')[_0x3840('0x1d')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x3840('0x4')](_0x3840('0x17'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x3840('0x16')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x3840('0x4')](_0x3840('0x17'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'acw':{'type':Sequelize[_0x3840('0x20')],'defaultValue':0x0,'set':function(_0x8e705b){this[_0x3840('0x1a')]('acw',_0x8e705b);if(_0x8e705b){if(this[_0x3840('0xf')](_0x3840('0x21'))<0x2){this[_0x3840('0x1a')](_0x3840('0x21'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x3840('0x16')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x3840('0x20')],'defaultValue':0x0,'comment':_0x3840('0x22')},'dialMethod':{'type':Sequelize[_0x3840('0x4')](_0x3840('0x23'),'progressive','power',_0x3840('0x24'),_0x3840('0x12')),'defaultValue':'progressive','comment':_0x3840('0x25')},'dialLimitChannel':{'type':Sequelize[_0x3840('0x16')](0x4)[_0x3840('0x26')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x3840('0x27')},'dialLimitQueue':{'type':Sequelize[_0x3840('0x16')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x3840('0x28')},'dialPowerLevel':{'type':Sequelize['FLOAT'](0x2)[_0x3840('0x26')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x3840('0x29')},'dialPredictiveOptimization':{'type':Sequelize[_0x3840('0x4')](_0x3840('0x2a'),_0x3840('0x2b')),'defaultValue':'dropRate','comment':_0x3840('0x2c')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x3840('0x2d')](0x2)[_0x3840('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x3840('0x2e')},'dialPredictiveInterval':{'type':Sequelize[_0x3840('0x16')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':'Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)'},'dialOriginateCallerIdName':{'type':Sequelize[_0x3840('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x3840('0x2')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x3840('0x26')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3840('0x2f')},'dialQueueOptions':{'type':Sequelize['STRING'],'defaultValue':'tTxX','comment':_0x3840('0x30')},'dialQueueTimeout':{'type':Sequelize[_0x3840('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueProject':{'type':Sequelize[_0x3840('0x2')],'comment':_0x3840('0x31')},'dialCongestionMaxRetry':{'type':Sequelize[_0x3840('0x16')](0x3)[_0x3840('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3840('0x32')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x3840('0x16')](0x5)[_0x3840('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3840('0x33')},'dialBusyMaxRetry':{'type':Sequelize[_0x3840('0x16')](0x3)[_0x3840('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3840('0x34')},'dialBusyRetryFrequency':{'type':Sequelize[_0x3840('0x16')](0x5)[_0x3840('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3840('0x35')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x3840('0x16')](0x3)[_0x3840('0x26')],'defaultValue':0x3,'comment':_0x3840('0x36')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x3840('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3840('0x37')},'dialGlobalMaxRetry':{'type':Sequelize[_0x3840('0x16')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x3840('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x3840('0x2')],'defaultValue':_0x3840('0x38')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x3840('0x4')](_0x3840('0x39'),_0x3840('0x3a'),_0x3840('0x3b')),'defaultValue':_0x3840('0x39')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x3840('0x3c')},'dialAMDInitialSilence':{'type':Sequelize[_0x3840('0x16')](0x9)[_0x3840('0x26')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x3840('0x3d')},'dialAMDGreeting':{'type':Sequelize[_0x3840('0x16')](0x9)[_0x3840('0x26')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x3840('0x26')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x3840('0x3e')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x3840('0x16')](0x9)[_0x3840('0x26')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x3840('0x3f')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x3840('0x26')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x3840('0x16')](0x9)[_0x3840('0x26')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x3840('0x40')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x3840('0x16')](0x9)[_0x3840('0x26')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x3840('0x41')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x3840('0x16')](0x5)[_0x3840('0x26')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x3840('0x42')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x3840('0x16')](0x9)[_0x3840('0x26')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialRecallMeTimeout':{'type':Sequelize[_0x3840('0x16')](0x5)[_0x3840('0x26')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x3840('0x43')},'dialRecallInQueue':{'type':Sequelize[_0x3840('0x20')],'defaultValue':0x0,'comment':_0x3840('0x44')},'dialOrderByScheduledAt':{'type':Sequelize[_0x3840('0x4')](_0x3840('0x45'),_0x3840('0x46')),'defaultValue':_0x3840('0x45')},'dialQueueProject2':{'type':Sequelize[_0x3840('0x2')],'comment':_0x3840('0x31')},'dialAgiAfterHangupClient':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x3840('0x20')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x3840('0x26')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x3840('0x16')](0x3)[_0x3840('0x26')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x3840('0x47')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x3840('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3840('0x48')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x3840('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3840('0x49')},'dialDropMaxRetry':{'type':Sequelize[_0x3840('0x16')](0x3)[_0x3840('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3840('0x4a')},'dialDropRetryFrequency':{'type':Sequelize[_0x3840('0x16')](0x5)[_0x3840('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x3840('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3840('0x4b')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x3840('0x16')](0x5)[_0x3840('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0x3840('0x16')](0x3)[_0x3840('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x3840('0x16')](0x5)[_0x3840('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x3840('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3840('0x4c')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x3840('0x16')](0x5)[_0x3840('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'mandatoryDispositionPauseId':{'type':Sequelize[_0x3840('0x16')],'allowNull':!![],'comment':_0x3840('0x4d')},'mandatoryDisposition':{'type':Sequelize[_0x3840('0x20')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x26383d){if(!_0x26383d)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0x3840('0x1a')]('mandatoryDisposition',_0x26383d);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x3840('0x26')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x3840('0x26')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}}; \ No newline at end of file +var _0x8802=['wrapuptime','Active/Disactive\x20Campaign','preview','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','FLOAT','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','tTxX','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','AgentReject\x20Retry\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','STRING','ENUM','inbound','outbound','default','ringall','leastrecent','fewestcalls','random','rrmemory','linear','rrordered','strategy','getDataValue','type','booked','roundrobin','progressive','predictive','power','INTEGER','yes','all','once','TEXT','setDataValue','join','periodic_announce','split','joinempty','leavewhenempty','BOOLEAN','acw'];(function(_0x10004e,_0xd701e6){var _0x5af990=function(_0x4bab6a){while(--_0x4bab6a){_0x10004e['push'](_0x10004e['shift']());}};_0x5af990(++_0xd701e6);}(_0x8802,0x7e));var _0x2880=function(_0x50cc54,_0x54c15f){_0x50cc54=_0x50cc54-0x0;var _0x28ecca=_0x8802[_0x50cc54];return _0x28ecca;};'use strict';var Sequelize=require(_0x2880('0x0'));module['exports']={'name':{'type':Sequelize[_0x2880('0x1')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x2880('0x2')](_0x2880('0x3'),_0x2880('0x4')),'allowNull':![],'defaultValue':_0x2880('0x3')},'musiconhold':{'type':Sequelize[_0x2880('0x1')],'defaultValue':_0x2880('0x5')},'announce':{'type':Sequelize[_0x2880('0x1')],'defaultValue':''},'strategy':{'type':Sequelize[_0x2880('0x2')]('rr',_0x2880('0x6'),_0x2880('0x7'),_0x2880('0x8'),_0x2880('0x9'),_0x2880('0xa'),_0x2880('0xb'),'wrandom',_0x2880('0xc')),'allowNull':![],'defaultValue':_0x2880('0x6'),'set':function(_0x4982be){this['setDataValue'](_0x2880('0xd'),_0x4982be?_0x4982be:'rrmemory');},'get':function(){var _0x459068=this[_0x2880('0xe')](_0x2880('0xf'));var _0x4368a1=this[_0x2880('0xe')]('dialMethod');var _0x28b720=this[_0x2880('0xe')](_0x2880('0xd'));if(_0x459068==='inbound'){return _0x28b720;}if(_0x4368a1===_0x2880('0x10')&&_0x28b720==='rrmemory'||_0x4368a1===_0x2880('0x10')&&_0x28b720===_0x2880('0x11')){return _0x28b720;}if(_0x4368a1===_0x2880('0x12')||_0x4368a1===_0x2880('0x13')||_0x4368a1===_0x2880('0x14')){return _0x28b720;}return null;}},'servicelevel':{'type':Sequelize[_0x2880('0x15')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x2880('0x1')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize['INTEGER'](0xb)},'timeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x2880('0x15')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x2880('0x1')]},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x2880('0x15')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x2880('0x2')]('yes','no'),'defaultValue':_0x2880('0x16')},'autopause':{'type':Sequelize[_0x2880('0x2')](_0x2880('0x16'),'no',_0x2880('0x17')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize['INTEGER'](0xb)},'autopausebusy':{'type':Sequelize['ENUM'](_0x2880('0x16'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize['ENUM'](_0x2880('0x16'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x2880('0x15')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize['ENUM'](_0x2880('0x16'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize['ENUM'](_0x2880('0x16'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM'](_0x2880('0x16'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x2880('0x2')](_0x2880('0x16'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x2880('0x1')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x2880('0x1')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x2880('0x15')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x2880('0x15')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x2880('0x15')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x2880('0x2')](_0x2880('0x16'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x2880('0x2')](_0x2880('0x16'),'no'),'defaultValue':_0x2880('0x16')},'announce_holdtime':{'type':Sequelize[_0x2880('0x2')](_0x2880('0x16'),'no',_0x2880('0x18')),'defaultValue':'no'},'announce_position':{'type':Sequelize['STRING'],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize['ENUM'](_0x2880('0x16'),'no')},'announce_position_limit':{'type':Sequelize[_0x2880('0x15')](0xb)},'announce_round_seconds':{'type':Sequelize['ENUM']('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x2880('0x1')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x2880('0x1')]},'queue_youarenext':{'type':Sequelize[_0x2880('0x1')],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x2880('0x1')],'defaultValue':null},'queue_holdtime':{'type':Sequelize['STRING'],'defaultValue':null},'queue_minute':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x2880('0x1')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x2880('0x1')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x2880('0x1')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x2880('0x1')]},'queue_quantity1':{'type':Sequelize['STRING']},'queue_quantity2':{'type':Sequelize[_0x2880('0x1')]},'queue_periodic_announce':{'type':Sequelize[_0x2880('0x1')]},'queue_less_than':{'type':Sequelize[_0x2880('0x1')]},'periodic_announce':{'type':Sequelize[_0x2880('0x19')],'set':function(_0x454427){this[_0x2880('0x1a')]('periodic_announce',_0x454427?_0x454427[_0x2880('0x1b')](','):[]);},'get':function(){return this[_0x2880('0xe')]('periodic_announce')?this[_0x2880('0xe')](_0x2880('0x1c'))[_0x2880('0x1d')](','):[];}},'joinempty':{'type':Sequelize[_0x2880('0x1')],'defaultValue':'yes','set':function(_0x3c9a3c){this['setDataValue'](_0x2880('0x1e'),_0x3c9a3c?_0x3c9a3c[_0x2880('0x1b')](','):undefined);},'get':function(){return this['getDataValue'](_0x2880('0x1e'))?this[_0x2880('0xe')](_0x2880('0x1e'))['split'](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x2880('0x1')],'defaultValue':'no','set':function(_0x342916){this[_0x2880('0x1a')](_0x2880('0x1f'),_0x342916?_0x342916[_0x2880('0x1b')](','):undefined);},'get':function(){return this[_0x2880('0xe')](_0x2880('0x1f'))?this[_0x2880('0xe')](_0x2880('0x1f'))[_0x2880('0x1d')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x2880('0x2')](_0x2880('0x16'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x2880('0x2')](_0x2880('0x16'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x2880('0x15')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize['ENUM'](_0x2880('0x16'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x2880('0x1')]},'description':{'type':Sequelize[_0x2880('0x1')]},'acw':{'type':Sequelize[_0x2880('0x20')],'defaultValue':0x0,'set':function(_0x353c42){this['setDataValue'](_0x2880('0x21'),_0x353c42);if(_0x353c42){if(this[_0x2880('0xe')](_0x2880('0x22'))<0x2){this[_0x2880('0x1a')](_0x2880('0x22'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x2880('0x15')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x2880('0x23')},'dialMethod':{'type':Sequelize[_0x2880('0x2')](_0x2880('0x24'),_0x2880('0x12'),_0x2880('0x14'),_0x2880('0x13'),'booked'),'defaultValue':'progressive','comment':_0x2880('0x25')},'dialLimitChannel':{'type':Sequelize[_0x2880('0x15')](0x4)[_0x2880('0x26')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x2880('0x27')},'dialLimitQueue':{'type':Sequelize[_0x2880('0x15')](0x4)[_0x2880('0x26')],'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)[_0x2880('0x26')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x2880('0x28')},'dialPredictiveOptimization':{'type':Sequelize[_0x2880('0x2')](_0x2880('0x29'),_0x2880('0x2a')),'defaultValue':_0x2880('0x2a'),'comment':_0x2880('0x2b')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x2880('0x2c')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':'Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)'},'dialPredictiveInterval':{'type':Sequelize[_0x2880('0x15')](0x3)[_0x2880('0x26')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x2880('0x2d')},'dialOriginateCallerIdName':{'type':Sequelize[_0x2880('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x2880('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0x2880('0x15')](0x3)[_0x2880('0x26')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueOptions':{'type':Sequelize['STRING'],'defaultValue':_0x2880('0x2e'),'comment':'https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue'},'dialQueueTimeout':{'type':Sequelize[_0x2880('0x15')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueProject':{'type':Sequelize[_0x2880('0x1')],'comment':_0x2880('0x2f')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x2880('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2880('0x30')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x2880('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2880('0x31')},'dialBusyMaxRetry':{'type':Sequelize[_0x2880('0x15')](0x3)[_0x2880('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2880('0x32')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x2880('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x2880('0x15')](0x3)[_0x2880('0x26')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x2880('0x15')](0x5)[_0x2880('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2880('0x33')},'dialGlobalMaxRetry':{'type':Sequelize[_0x2880('0x15')](0x3)[_0x2880('0x26')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x2880('0x34')},'dialTimezone':{'type':Sequelize[_0x2880('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x2880('0x35')},'dialPrefix':{'type':Sequelize[_0x2880('0x1')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x2880('0x2')](_0x2880('0x36'),'never',_0x2880('0x37')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x2880('0x20')],'defaultValue':0x0,'comment':_0x2880('0x38')},'dialAMDInitialSilence':{'type':Sequelize[_0x2880('0x15')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x2880('0x39')},'dialAMDGreeting':{'type':Sequelize[_0x2880('0x15')](0x9)[_0x2880('0x26')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x2880('0x15')](0x9)[_0x2880('0x26')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x2880('0x15')](0x9)[_0x2880('0x26')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x2880('0x3a')},'dialAMDMinWordLength':{'type':Sequelize[_0x2880('0x15')](0x9)[_0x2880('0x26')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x2880('0x3b')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x2880('0x15')](0x9)[_0x2880('0x26')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x2880('0x3c')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x2880('0x15')](0x5)[_0x2880('0x26')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x2880('0x3d')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x2880('0x15')](0x9)[_0x2880('0x26')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x2880('0x3e')},'dialRecallMeTimeout':{'type':Sequelize['INTEGER'](0x5)[_0x2880('0x26')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x2880('0x3f')},'dialRecallInQueue':{'type':Sequelize[_0x2880('0x20')],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize[_0x2880('0x2')](_0x2880('0x40'),'ASC'),'defaultValue':'DESC'},'dialQueueProject2':{'type':Sequelize[_0x2880('0x1')],'comment':_0x2880('0x2f')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x2880('0x20')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x2880('0x20')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x2880('0x15')](0x3)[_0x2880('0x26')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x2880('0x41')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x2880('0x26')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x2880('0x42')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x2880('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2880('0x43')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x2880('0x15')](0x5)[_0x2880('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2880('0x44')},'dialDropMaxRetry':{'type':Sequelize[_0x2880('0x15')](0x3)[_0x2880('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2880('0x45')},'dialDropRetryFrequency':{'type':Sequelize[_0x2880('0x15')](0x5)[_0x2880('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2880('0x46')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2880('0x47')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x2880('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2880('0x48')},'dialMachineMaxRetry':{'type':Sequelize[_0x2880('0x15')](0x3)[_0x2880('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2880('0x49')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x2880('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2880('0x4a')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x2880('0x15')](0x3)[_0x2880('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x2880('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2880('0x4b')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x2880('0x15')],'allowNull':!![],'comment':_0x2880('0x4c')},'mandatoryDisposition':{'type':Sequelize[_0x2880('0x20')],'defaultValue':![],'comment':_0x2880('0x4d'),'set':function(_0x154c73){if(!_0x154c73)this[_0x2880('0x1a')](_0x2880('0x4e'),null);this['setDataValue'](_0x2880('0x4f'),_0x154c73);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x2880('0x15')](0x3)[_0x2880('0x26')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x2880('0x15')](0x3)[_0x2880('0x26')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index 0838be8..1aedf41 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 _0x95c5=['stack','send','index','VoiceQueue','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','options','count','includeAll','include','findAll','rows','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','VoiceQueues','inbound','outbound','UserProfileSection','userProfileId','clone','params','omit','createdAt','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findOne','CmHopper','VoiceQueueId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','CmHopperBlack','getTeams','Team','addTeams','online','voicePause','interface','flatMap','penalty','Agents','sequelize','TeamVoiceQueue','upsert','each','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','isNil','format','SIP/%s','forEach','emit','removeTeams','ids','User','select','field','from','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','includes','all','union','compact','transaction','isEmpty','removeAgents','addAgents','spread','userVoiceQueue:save','push','isArray','userVoiceQueue:remove','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','insert','into','cm_hopper','fromQuery','phone','ContactId','ListId','scheduledAt','CmListId','NOW()','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','VoiceQueueId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','updatedAt','removeLists','getBlackLists','addBlackLists','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./voiceQueue.socket','register','sendStatus','end','status','json','offset','undefined','limit','set','save','update','destroy','then','QueueCampaigns','filter','ignore','value','type','find','name','UserProfileResource','error'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x95c5,0x85));var _0x595c=function(_0x152121,_0x120c53){_0x152121=_0x152121-0x0;var _0x592a85=_0x95c5[_0x152121];return _0x592a85;};'use strict';var emlformat=require(_0x595c('0x0'));var rimraf=require(_0x595c('0x1'));var zipdir=require(_0x595c('0x2'));var jsonpatch=require(_0x595c('0x3'));var rp=require(_0x595c('0x4'));var moment=require('moment');var BPromise=require(_0x595c('0x5'));var Mustache=require(_0x595c('0x6'));var util=require('util');var path=require('path');var sox=require(_0x595c('0x7'));var csv=require(_0x595c('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x595c('0x9'));var crypto=require(_0x595c('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x595c('0xb'));var toCsv=require(_0x595c('0x8'));var querystring=require(_0x595c('0xc'));var Papa=require(_0x595c('0xd'));var Redis=require(_0x595c('0xe'));var authService=require(_0x595c('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x595c('0x10'));var hardwareService=require(_0x595c('0x11'));var logger=require(_0x595c('0x12'))(_0x595c('0x13'));var utils=require(_0x595c('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x595c('0x15'));var db=require(_0x595c('0x16'))['db'];config[_0x595c('0x17')]=_['defaults'](config[_0x595c('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x595c('0x18'))(new Redis(config[_0x595c('0x17')]));require(_0x595c('0x19'))[_0x595c('0x1a')](socket);function respondWithStatusCode(_0x2df63a,_0x53eefd){_0x53eefd=_0x53eefd||0xcc;return function(_0xd7eae3){if(_0xd7eae3){return _0x2df63a[_0x595c('0x1b')](_0x53eefd);}return _0x2df63a['status'](_0x53eefd)[_0x595c('0x1c')]();};}function respondWithResult(_0x463aa6,_0x3263dc){_0x3263dc=_0x3263dc||0xc8;return function(_0xdd8c7f){if(_0xdd8c7f){return _0x463aa6[_0x595c('0x1d')](_0x3263dc)[_0x595c('0x1e')](_0xdd8c7f);}};}function respondWithFilteredResult(_0x493888,_0xb255fe){return function(_0xf2161f){if(_0xf2161f){var _0x547f9d=typeof _0xb255fe[_0x595c('0x1f')]===_0x595c('0x20')&&typeof _0xb255fe[_0x595c('0x21')]===_0x595c('0x20');var _0x4e5ead=_0xf2161f['count'];var _0x3c2920=_0x547f9d?0x0:_0xb255fe[_0x595c('0x1f')];var _0x370ba9=_0x547f9d?_0xf2161f['count']:_0xb255fe[_0x595c('0x1f')]+_0xb255fe[_0x595c('0x21')];var _0x1ed6d5;if(_0x370ba9>=_0x4e5ead){_0x370ba9=_0x4e5ead;_0x1ed6d5=0xc8;}else{_0x1ed6d5=0xce;}_0x493888[_0x595c('0x1d')](_0x1ed6d5);return _0x493888[_0x595c('0x22')]('Content-Range',_0x3c2920+'-'+_0x370ba9+'/'+_0x4e5ead)[_0x595c('0x1e')](_0xf2161f);}return null;};}function patchUpdates(_0x4b5318){return function(_0x4d3d8d){try{jsonpatch['apply'](_0x4d3d8d,_0x4b5318,!![]);}catch(_0x639f07){return BPromise['reject'](_0x639f07);}return _0x4d3d8d[_0x595c('0x23')]();};}function saveUpdates(_0x59e3d5,_0x260bc0){return function(_0x514197){if(_0x514197){return _0x514197[_0x595c('0x24')](_0x59e3d5)['then'](function(_0x3db56c){return _0x3db56c;});}return null;};}function removeEntity(_0xe58f29,_0x256ec5){return function(_0x489dbf){if(_0x489dbf){return _0x489dbf[_0x595c('0x25')]()[_0x595c('0x26')](function(){var _0x5a9873=_0x489dbf['get']({'plain':!![]});var _0xaeb538=[{'name':'VoiceQueues','value':'inbound','ignore':![]},{'name':_0x595c('0x27'),'value':'outbound','ignore':![]}];var _0x537240=_(_0xaeb538)[_0x595c('0x28')](_0x595c('0x29'))['map'](_0x595c('0x2a'))[_0x595c('0x2a')]();if(_['includes'](_0x537240,_0x5a9873[_0x595c('0x2b')])){return;}var _0x2d27c5=_[_0x595c('0x2c')](_0xaeb538,[_0x595c('0x2a'),_0x5a9873['type']])[_0x595c('0x2d')];return db[_0x595c('0x2e')][_0x595c('0x25')]({'where':{'type':_0x2d27c5,'resourceId':_0x5a9873['id']}})[_0x595c('0x26')](function(){return _0x489dbf;});})['then'](function(){_0xe58f29[_0x595c('0x1d')](0xcc)[_0x595c('0x1c')]();});}};}function handleEntityNotFound(_0x121e6a,_0x1bbc32){return function(_0x1ec063){if(!_0x1ec063){_0x121e6a[_0x595c('0x1b')](0x194);}return _0x1ec063;};}function handleError(_0x3364de,_0x56ba81){_0x56ba81=_0x56ba81||0x1f4;return function(_0x223ece){logger[_0x595c('0x2f')](_0x223ece[_0x595c('0x30')]);if(_0x223ece['name']){delete _0x223ece[_0x595c('0x2d')];}_0x3364de[_0x595c('0x1d')](_0x56ba81)[_0x595c('0x31')](_0x223ece);};}exports[_0x595c('0x32')]=function(_0x417288,_0x6a8fe3){var _0x23a04f={},_0x430295={},_0x5c00eb={'count':0x0,'rows':[]};var _0x53fa04=_['map'](db[_0x595c('0x33')][_0x595c('0x34')],function(_0x27d127){return{'name':_0x27d127[_0x595c('0x35')],'type':_0x27d127['type'][_0x595c('0x36')]};});_0x430295[_0x595c('0x37')]=_[_0x595c('0x38')](_0x53fa04,_0x595c('0x2d'));_0x430295[_0x595c('0x39')]=_[_0x595c('0x3a')](_0x417288[_0x595c('0x39')]);_0x430295[_0x595c('0x3b')]=_[_0x595c('0x3c')](_0x430295['model'],_0x430295[_0x595c('0x39')]);_0x23a04f['attributes']=_[_0x595c('0x3c')](_0x430295['model'],qs[_0x595c('0x3d')](_0x417288[_0x595c('0x39')][_0x595c('0x3d')]));_0x23a04f['attributes']=_0x23a04f[_0x595c('0x3e')][_0x595c('0x3f')]?_0x23a04f[_0x595c('0x3e')]:_0x430295[_0x595c('0x37')];if(!_0x417288[_0x595c('0x39')][_0x595c('0x40')](_0x595c('0x41'))){_0x23a04f[_0x595c('0x21')]=qs['limit'](_0x417288[_0x595c('0x39')][_0x595c('0x21')]);_0x23a04f[_0x595c('0x1f')]=qs['offset'](_0x417288['query'][_0x595c('0x1f')]);}_0x23a04f[_0x595c('0x42')]=qs[_0x595c('0x43')](_0x417288[_0x595c('0x39')][_0x595c('0x43')]);_0x23a04f[_0x595c('0x44')]=qs['filters'](_[_0x595c('0x45')](_0x417288['query'],_0x430295[_0x595c('0x3b')]),_0x53fa04);if(_0x417288[_0x595c('0x39')][_0x595c('0x28')]){_0x23a04f[_0x595c('0x44')]=_[_0x595c('0x46')](_0x23a04f[_0x595c('0x44')],{'$or':_[_0x595c('0x38')](_0x53fa04,function(_0x44539e){if(_0x44539e['type']!=='VIRTUAL'){var _0x537578={};_0x537578[_0x44539e[_0x595c('0x2d')]]={'$like':'%'+_0x417288[_0x595c('0x39')]['filter']+'%'};return _0x537578;}})});}_0x23a04f=_[_0x595c('0x46')]({},_0x23a04f,_0x417288[_0x595c('0x47')]);var _0x58759d={'where':_0x23a04f['where']};return db[_0x595c('0x33')][_0x595c('0x48')](_0x58759d)[_0x595c('0x26')](function(_0x2b4a36){_0x5c00eb[_0x595c('0x48')]=_0x2b4a36;if(_0x417288[_0x595c('0x39')][_0x595c('0x49')]){_0x23a04f[_0x595c('0x4a')]=[{'all':!![]}];}return db['VoiceQueue'][_0x595c('0x4b')](_0x23a04f);})['then'](function(_0x4f1422){_0x5c00eb[_0x595c('0x4c')]=_0x4f1422;return _0x5c00eb;})[_0x595c('0x26')](respondWithFilteredResult(_0x6a8fe3,_0x23a04f))['catch'](handleError(_0x6a8fe3,null));};exports['show']=function(_0xa3dda7,_0x122495){var _0x31e396={'raw':![],'where':{'id':_0xa3dda7['params']['id']}},_0x3e6c81={};_0x3e6c81['model']=_[_0x595c('0x3a')](db['VoiceQueue'][_0x595c('0x34')]);_0x3e6c81['query']=_[_0x595c('0x3a')](_0xa3dda7[_0x595c('0x39')]);_0x3e6c81[_0x595c('0x3b')]=_[_0x595c('0x3c')](_0x3e6c81['model'],_0x3e6c81[_0x595c('0x39')]);_0x31e396['attributes']=_['intersection'](_0x3e6c81[_0x595c('0x37')],qs[_0x595c('0x3d')](_0xa3dda7['query'][_0x595c('0x3d')]));_0x31e396[_0x595c('0x3e')]=_0x31e396[_0x595c('0x3e')][_0x595c('0x3f')]?_0x31e396[_0x595c('0x3e')]:_0x3e6c81[_0x595c('0x37')];if(_0xa3dda7[_0x595c('0x39')][_0x595c('0x49')]){_0x31e396[_0x595c('0x4a')]=[{'all':!![]}];}_0x31e396=_[_0x595c('0x46')]({},_0x31e396,_0xa3dda7[_0x595c('0x47')]);return db[_0x595c('0x33')][_0x595c('0x2c')](_0x31e396)['then'](handleEntityNotFound(_0x122495,null))[_0x595c('0x26')](respondWithResult(_0x122495,null))[_0x595c('0x4d')](handleError(_0x122495,null));};exports[_0x595c('0x4e')]=function(_0x5d3f7c,_0x33e769){return db[_0x595c('0x33')][_0x595c('0x4e')](_0x5d3f7c[_0x595c('0x4f')],{})[_0x595c('0x26')](function(_0x56d6a7){var _0x5f1822=_0x5d3f7c[_0x595c('0x50')]['get']({'plain':!![]});if(!_0x5f1822)throw new Error(_0x595c('0x51'));if(_0x5f1822[_0x595c('0x52')]===_0x595c('0x50')){var _0x3199a1=_0x56d6a7[_0x595c('0x53')]({'plain':!![]});var _0xca18b5=[{'name':_0x595c('0x54'),'value':_0x595c('0x55')},{'name':'QueueCampaigns','value':_0x595c('0x56')}];var _0x30eb9d=_['find'](_0xca18b5,[_0x595c('0x2a'),_0x3199a1[_0x595c('0x2b')]])[_0x595c('0x2d')];return db[_0x595c('0x57')][_0x595c('0x2c')]({'where':{'name':_0x30eb9d,'userProfileId':_0x5f1822[_0x595c('0x58')]},'raw':!![]})[_0x595c('0x26')](function(_0xe51fd1){if(_0xe51fd1&&_0xe51fd1['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x3199a1[_0x595c('0x2d')],'resourceId':_0x3199a1['id'],'type':_0xe51fd1[_0x595c('0x2d')],'sectionId':_0xe51fd1['id']},{})[_0x595c('0x26')](function(){return _0x56d6a7;});}else{return _0x56d6a7;}})[_0x595c('0x4d')](function(_0x3ae739){logger[_0x595c('0x2f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3ae739);throw _0x3ae739;});}return _0x56d6a7;})['then'](respondWithResult(_0x33e769,0xc9))[_0x595c('0x4d')](handleError(_0x33e769,null));};exports[_0x595c('0x59')]=function(_0x2c5627,_0x197a45){var _0x3f1563={'where':{'id':_0x2c5627[_0x595c('0x5a')]['id']}},_0x1d8387={};_0x1d8387[_0x595c('0x37')]=_['keys'](db[_0x595c('0x33')][_0x595c('0x34')]);_0x3f1563[_0x595c('0x3e')]=_[_0x595c('0x3c')](_0x1d8387[_0x595c('0x37')],qs[_0x595c('0x3d')](_0x2c5627[_0x595c('0x39')][_0x595c('0x3d')]));_0x3f1563['attributes']=_0x3f1563['attributes'][_0x595c('0x3f')]?_0x3f1563[_0x595c('0x3e')]:_0x1d8387[_0x595c('0x37')];if(_0x2c5627[_0x595c('0x39')][_0x595c('0x49')]){_0x3f1563[_0x595c('0x4a')]=[{'all':!![]}];}_0x3f1563=_['merge']({},_0x3f1563,_0x2c5627[_0x595c('0x47')]);return db[_0x595c('0x33')]['find'](_0x3f1563)[_0x595c('0x26')](handleEntityNotFound(_0x197a45,null))[_0x595c('0x26')](function(_0x5a52cc){if(_0x5a52cc){var _0x393042=_0x5a52cc[_0x595c('0x53')]({'plain':!![]});_0x393042=qs['omit'](_0x393042,['id','createdAt','updatedAt']);_0x2c5627[_0x595c('0x4f')]=_[_0x595c('0x5b')](_0x2c5627['body'],['id',_0x595c('0x5c'),'updatedAt']);return db['VoiceQueue'][_0x595c('0x4e')](_[_0x595c('0x46')](_0x393042,_0x2c5627['body']),{'include':_0x2c5627[_0x595c('0x39')][_0x595c('0x49')]?[{'all':!![]}]:undefined})[_0x595c('0x26')](function(_0x3ea471){var _0x182a2b=_0x2c5627[_0x595c('0x50')]['get']({'plain':!![]});if(!_0x182a2b)throw new Error(_0x595c('0x51'));if(_0x182a2b['role']===_0x595c('0x50')){var _0x3cc218=_0x3ea471['get']({'plain':!![]});var _0x5c1aa8=[{'name':_0x595c('0x54'),'value':_0x595c('0x55')},{'name':'QueueCampaigns','value':_0x595c('0x56')}];var _0x43c745=_[_0x595c('0x2c')](_0x5c1aa8,['value',_0x3cc218[_0x595c('0x2b')]])[_0x595c('0x2d')];return db['UserProfileSection'][_0x595c('0x2c')]({'where':{'name':_0x43c745,'userProfileId':_0x182a2b[_0x595c('0x58')]},'raw':!![]})[_0x595c('0x26')](function(_0x466880){if(_0x466880&&_0x466880['autoAssociation']===0x0){return db[_0x595c('0x2e')][_0x595c('0x4e')]({'name':_0x3cc218['name'],'resourceId':_0x3cc218['id'],'type':_0x466880[_0x595c('0x2d')],'sectionId':_0x466880['id']},{})[_0x595c('0x26')](function(){return _0x3ea471;});}else{return _0x3ea471;}})[_0x595c('0x4d')](function(_0x43f7f9){logger['error'](_0x595c('0x5d'),_0x43f7f9);throw _0x43f7f9;});}return _0x3ea471;});}})['then'](respondWithResult(_0x197a45,0xc9))[_0x595c('0x4d')](handleError(_0x197a45,null));};exports[_0x595c('0x24')]=function(_0x5e0bb3,_0x279cf8){if(_0x5e0bb3[_0x595c('0x4f')]['id']){delete _0x5e0bb3[_0x595c('0x4f')]['id'];}return db[_0x595c('0x33')]['find']({'where':{'id':_0x5e0bb3[_0x595c('0x5a')]['id']}})[_0x595c('0x26')](handleEntityNotFound(_0x279cf8,null))[_0x595c('0x26')](saveUpdates(_0x5e0bb3[_0x595c('0x4f')],null))[_0x595c('0x26')](respondWithResult(_0x279cf8,null))['catch'](handleError(_0x279cf8,null));};exports[_0x595c('0x25')]=function(_0xc1c0a6,_0xada163){return db[_0x595c('0x33')][_0x595c('0x2c')]({'where':{'id':_0xc1c0a6[_0x595c('0x5a')]['id']}})[_0x595c('0x26')](handleEntityNotFound(_0xada163,null))[_0x595c('0x26')](removeEntity(_0xada163,null))[_0x595c('0x4d')](handleError(_0xada163,null));};exports['getHoppers']=function(_0x54076b,_0x3ed55d,_0x49e099){var _0x4a6ce2={'raw':![],'where':{}};var _0x194b4f={};var _0x4f042b={'count':0x0,'rows':[]};return db[_0x595c('0x33')][_0x595c('0x5e')]({'where':{'id':_0x54076b[_0x595c('0x5a')]['id']}})['then'](handleEntityNotFound(_0x3ed55d,null))[_0x595c('0x26')](function(_0x2fc870){if(_0x2fc870){_0x194b4f[_0x595c('0x37')]=_[_0x595c('0x3a')](db[_0x595c('0x5f')][_0x595c('0x34')]);_0x194b4f[_0x595c('0x39')]=_['keys'](_0x54076b[_0x595c('0x39')]);_0x194b4f[_0x595c('0x3b')]=_['intersection'](_0x194b4f[_0x595c('0x37')],_0x194b4f[_0x595c('0x39')]);_0x4a6ce2[_0x595c('0x3e')]=_[_0x595c('0x3c')](_0x194b4f[_0x595c('0x37')],qs[_0x595c('0x3d')](_0x54076b[_0x595c('0x39')][_0x595c('0x3d')]));_0x4a6ce2[_0x595c('0x3e')]=_0x4a6ce2['attributes'][_0x595c('0x3f')]?_0x4a6ce2[_0x595c('0x3e')]:_0x194b4f[_0x595c('0x37')];if(!_0x54076b[_0x595c('0x39')]['hasOwnProperty'](_0x595c('0x41'))){_0x4a6ce2[_0x595c('0x21')]=qs[_0x595c('0x21')](_0x54076b[_0x595c('0x39')][_0x595c('0x21')]);_0x4a6ce2[_0x595c('0x1f')]=qs[_0x595c('0x1f')](_0x54076b[_0x595c('0x39')][_0x595c('0x1f')]);}_0x4a6ce2[_0x595c('0x42')]=qs[_0x595c('0x43')](_0x54076b[_0x595c('0x39')]['sort']);_0x4a6ce2[_0x595c('0x44')]=qs[_0x595c('0x3b')](_[_0x595c('0x45')](_0x54076b[_0x595c('0x39')],_0x194b4f[_0x595c('0x3b')]));_0x4a6ce2['where'][_0x595c('0x60')]=_0x2fc870['id'];if(_0x54076b[_0x595c('0x39')][_0x595c('0x28')]){_0x4a6ce2[_0x595c('0x44')]=_[_0x595c('0x46')](_0x4a6ce2[_0x595c('0x44')],{'$or':_[_0x595c('0x38')](_0x4a6ce2[_0x595c('0x3e')],function(_0x5787ce){var _0x228325={};_0x228325[_0x5787ce]={'$like':'%'+_0x54076b[_0x595c('0x39')][_0x595c('0x28')]+'%'};return _0x228325;})});}_0x4a6ce2=_[_0x595c('0x46')]({},_0x4a6ce2,_0x54076b[_0x595c('0x47')]);return db[_0x595c('0x5f')][_0x595c('0x48')]({'where':_0x4a6ce2[_0x595c('0x44')]})[_0x595c('0x26')](function(_0x5e1370){_0x4f042b[_0x595c('0x48')]=_0x5e1370;if(_0x54076b[_0x595c('0x39')][_0x595c('0x49')]){_0x4a6ce2[_0x595c('0x4a')]=[{'all':!![]}];}return db['CmHopper'][_0x595c('0x4b')](_0x4a6ce2);})[_0x595c('0x26')](function(_0x335a52){_0x4f042b[_0x595c('0x4c')]=_0x335a52;return _0x4f042b;});}})[_0x595c('0x26')](respondWithFilteredResult(_0x3ed55d,_0x4a6ce2))[_0x595c('0x4d')](handleError(_0x3ed55d,null));};exports[_0x595c('0x61')]=function(_0x1b5ae4,_0xc1e7f,_0x1519c4){var _0xa4271e={'raw':!![],'where':{}};var _0x16a221={};var _0x25e969={'count':0x0,'rows':[]};return db[_0x595c('0x33')][_0x595c('0x5e')]({'where':{'id':_0x1b5ae4[_0x595c('0x5a')]['id']}})[_0x595c('0x26')](handleEntityNotFound(_0xc1e7f,null))[_0x595c('0x26')](function(_0xf191fc){if(_0xf191fc){_0x16a221['model']=_['keys'](db[_0x595c('0x62')][_0x595c('0x34')]);_0x16a221[_0x595c('0x39')]=_['keys'](_0x1b5ae4[_0x595c('0x39')]);_0x16a221[_0x595c('0x3b')]=_[_0x595c('0x3c')](_0x16a221[_0x595c('0x37')],_0x16a221['query']);_0xa4271e[_0x595c('0x3e')]=_[_0x595c('0x3c')](_0x16a221[_0x595c('0x37')],qs[_0x595c('0x3d')](_0x1b5ae4['query'][_0x595c('0x3d')]));_0xa4271e['attributes']=_0xa4271e[_0x595c('0x3e')][_0x595c('0x3f')]?_0xa4271e[_0x595c('0x3e')]:_0x16a221[_0x595c('0x37')];if(!_0x1b5ae4[_0x595c('0x39')]['hasOwnProperty'](_0x595c('0x41'))){_0xa4271e['limit']=qs[_0x595c('0x21')](_0x1b5ae4[_0x595c('0x39')]['limit']);_0xa4271e[_0x595c('0x1f')]=qs[_0x595c('0x1f')](_0x1b5ae4[_0x595c('0x39')][_0x595c('0x1f')]);}_0xa4271e[_0x595c('0x42')]=qs[_0x595c('0x43')](_0x1b5ae4['query']['sort']);_0xa4271e[_0x595c('0x44')]=qs['filters'](_[_0x595c('0x45')](_0x1b5ae4[_0x595c('0x39')],_0x16a221[_0x595c('0x3b')]));_0xa4271e[_0x595c('0x44')][_0x595c('0x60')]=_0xf191fc['id'];if(_0x1b5ae4['query'][_0x595c('0x28')]){_0xa4271e[_0x595c('0x44')]=_[_0x595c('0x46')](_0xa4271e[_0x595c('0x44')],{'$or':_['map'](_0xa4271e[_0x595c('0x3e')],function(_0x3de874){var _0x5665e3={};_0x5665e3[_0x3de874]={'$like':'%'+_0x1b5ae4[_0x595c('0x39')][_0x595c('0x28')]+'%'};return _0x5665e3;})});}_0xa4271e=_[_0x595c('0x46')]({},_0xa4271e,_0x1b5ae4[_0x595c('0x47')]);return db['CmHopperHistory'][_0x595c('0x48')]({'where':_0xa4271e['where']})[_0x595c('0x26')](function(_0x405e80){_0x25e969[_0x595c('0x48')]=_0x405e80;if(_0x1b5ae4[_0x595c('0x39')]['includeAll']){_0xa4271e[_0x595c('0x4a')]=[{'all':!![]}];}return db[_0x595c('0x62')]['findAll'](_0xa4271e);})['then'](function(_0x3f317b){_0x25e969[_0x595c('0x4c')]=_0x3f317b;return _0x25e969;});}})[_0x595c('0x26')](respondWithFilteredResult(_0xc1e7f,_0xa4271e))[_0x595c('0x4d')](handleError(_0xc1e7f,null));};exports[_0x595c('0x63')]=function(_0x22adc9,_0x141ab4,_0x565466){var _0x2060c3={'raw':!![],'where':{}};var _0x14cf40={};var _0x57bba7={'count':0x0,'rows':[]};return db[_0x595c('0x33')][_0x595c('0x5e')]({'where':{'id':_0x22adc9[_0x595c('0x5a')]['id']}})['then'](handleEntityNotFound(_0x141ab4,null))[_0x595c('0x26')](function(_0x4dce82){if(_0x4dce82){_0x14cf40[_0x595c('0x37')]=_[_0x595c('0x3a')](db[_0x595c('0x64')]['rawAttributes']);_0x14cf40[_0x595c('0x39')]=_[_0x595c('0x3a')](_0x22adc9[_0x595c('0x39')]);_0x14cf40['filters']=_[_0x595c('0x3c')](_0x14cf40[_0x595c('0x37')],_0x14cf40[_0x595c('0x39')]);_0x2060c3[_0x595c('0x3e')]=_[_0x595c('0x3c')](_0x14cf40[_0x595c('0x37')],qs[_0x595c('0x3d')](_0x22adc9[_0x595c('0x39')][_0x595c('0x3d')]));_0x2060c3[_0x595c('0x3e')]=_0x2060c3[_0x595c('0x3e')][_0x595c('0x3f')]?_0x2060c3[_0x595c('0x3e')]:_0x14cf40['model'];if(!_0x22adc9[_0x595c('0x39')]['hasOwnProperty'](_0x595c('0x41'))){_0x2060c3[_0x595c('0x21')]=qs['limit'](_0x22adc9[_0x595c('0x39')]['limit']);_0x2060c3[_0x595c('0x1f')]=qs[_0x595c('0x1f')](_0x22adc9['query'][_0x595c('0x1f')]);}_0x2060c3[_0x595c('0x42')]=qs[_0x595c('0x43')](_0x22adc9[_0x595c('0x39')][_0x595c('0x43')]);_0x2060c3[_0x595c('0x44')]=qs[_0x595c('0x3b')](_[_0x595c('0x45')](_0x22adc9[_0x595c('0x39')],_0x14cf40[_0x595c('0x3b')]));_0x2060c3[_0x595c('0x44')][_0x595c('0x60')]=_0x4dce82['id'];if(_0x22adc9[_0x595c('0x39')][_0x595c('0x28')]){_0x2060c3['where']=_['merge'](_0x2060c3[_0x595c('0x44')],{'$or':_[_0x595c('0x38')](_0x2060c3[_0x595c('0x3e')],function(_0x3182ce){var _0x448761={};_0x448761[_0x3182ce]={'$like':'%'+_0x22adc9['query'][_0x595c('0x28')]+'%'};return _0x448761;})});}_0x2060c3=_['merge']({},_0x2060c3,_0x22adc9[_0x595c('0x47')]);return db[_0x595c('0x64')][_0x595c('0x48')]({'where':_0x2060c3['where']})[_0x595c('0x26')](function(_0xdaf916){_0x57bba7[_0x595c('0x48')]=_0xdaf916;if(_0x22adc9['query'][_0x595c('0x49')]){_0x2060c3[_0x595c('0x4a')]=[{'all':!![]}];}return db[_0x595c('0x64')][_0x595c('0x4b')](_0x2060c3);})[_0x595c('0x26')](function(_0x41b14f){_0x57bba7['rows']=_0x41b14f;return _0x57bba7;});}})['then'](respondWithFilteredResult(_0x141ab4,_0x2060c3))[_0x595c('0x4d')](handleError(_0x141ab4,null));};exports['getHopperBlacks']=function(_0x5ef424,_0x33e6fa,_0x1682ae){var _0x5f3d52={'raw':!![],'where':{}};var _0x498649={};var _0x58fc22={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x595c('0x5e')]({'where':{'id':_0x5ef424[_0x595c('0x5a')]['id']}})[_0x595c('0x26')](handleEntityNotFound(_0x33e6fa,null))[_0x595c('0x26')](function(_0x2d0da2){if(_0x2d0da2){_0x498649['model']=_['keys'](db[_0x595c('0x65')]['rawAttributes']);_0x498649[_0x595c('0x39')]=_['keys'](_0x5ef424[_0x595c('0x39')]);_0x498649['filters']=_[_0x595c('0x3c')](_0x498649['model'],_0x498649[_0x595c('0x39')]);_0x5f3d52['attributes']=_[_0x595c('0x3c')](_0x498649[_0x595c('0x37')],qs[_0x595c('0x3d')](_0x5ef424['query'][_0x595c('0x3d')]));_0x5f3d52[_0x595c('0x3e')]=_0x5f3d52['attributes'][_0x595c('0x3f')]?_0x5f3d52[_0x595c('0x3e')]:_0x498649[_0x595c('0x37')];if(!_0x5ef424[_0x595c('0x39')][_0x595c('0x40')]('nolimit')){_0x5f3d52['limit']=qs[_0x595c('0x21')](_0x5ef424[_0x595c('0x39')][_0x595c('0x21')]);_0x5f3d52[_0x595c('0x1f')]=qs[_0x595c('0x1f')](_0x5ef424[_0x595c('0x39')][_0x595c('0x1f')]);}_0x5f3d52[_0x595c('0x42')]=qs[_0x595c('0x43')](_0x5ef424[_0x595c('0x39')][_0x595c('0x43')]);_0x5f3d52['where']=qs[_0x595c('0x3b')](_[_0x595c('0x45')](_0x5ef424['query'],_0x498649[_0x595c('0x3b')]));_0x5f3d52[_0x595c('0x44')][_0x595c('0x60')]=_0x2d0da2['id'];if(_0x5ef424[_0x595c('0x39')][_0x595c('0x28')]){_0x5f3d52[_0x595c('0x44')]=_[_0x595c('0x46')](_0x5f3d52[_0x595c('0x44')],{'$or':_[_0x595c('0x38')](_0x5f3d52[_0x595c('0x3e')],function(_0x4422b7){var _0x5322a5={};_0x5322a5[_0x4422b7]={'$like':'%'+_0x5ef424[_0x595c('0x39')][_0x595c('0x28')]+'%'};return _0x5322a5;})});}_0x5f3d52=_[_0x595c('0x46')]({},_0x5f3d52,_0x5ef424[_0x595c('0x47')]);return db[_0x595c('0x65')]['count']({'where':_0x5f3d52['where']})[_0x595c('0x26')](function(_0x45aafa){_0x58fc22[_0x595c('0x48')]=_0x45aafa;if(_0x5ef424['query']['includeAll']){_0x5f3d52['include']=[{'all':!![]}];}return db[_0x595c('0x65')]['findAll'](_0x5f3d52);})[_0x595c('0x26')](function(_0x206454){_0x58fc22[_0x595c('0x4c')]=_0x206454;return _0x58fc22;});}})[_0x595c('0x26')](respondWithFilteredResult(_0x33e6fa,_0x5f3d52))[_0x595c('0x4d')](handleError(_0x33e6fa,null));};exports[_0x595c('0x66')]=function(_0x2c4fe0,_0x183e6d,_0x87667){var _0x4bd61d={};var _0xe9a27b={};var _0x24aede;var _0x553292;return db['VoiceQueue'][_0x595c('0x5e')]({'where':{'id':_0x2c4fe0[_0x595c('0x5a')]['id']}})[_0x595c('0x26')](handleEntityNotFound(_0x183e6d,null))[_0x595c('0x26')](function(_0x1a8757){if(_0x1a8757){_0x24aede=_0x1a8757;_0xe9a27b[_0x595c('0x37')]=_[_0x595c('0x3a')](db[_0x595c('0x67')][_0x595c('0x34')]);_0xe9a27b[_0x595c('0x39')]=_[_0x595c('0x3a')](_0x2c4fe0[_0x595c('0x39')]);_0xe9a27b['filters']=_['intersection'](_0xe9a27b[_0x595c('0x37')],_0xe9a27b['query']);_0x4bd61d[_0x595c('0x3e')]=_[_0x595c('0x3c')](_0xe9a27b[_0x595c('0x37')],qs[_0x595c('0x3d')](_0x2c4fe0['query'][_0x595c('0x3d')]));_0x4bd61d[_0x595c('0x3e')]=_0x4bd61d[_0x595c('0x3e')][_0x595c('0x3f')]?_0x4bd61d['attributes']:_0xe9a27b[_0x595c('0x37')];_0x4bd61d[_0x595c('0x42')]=qs['sort'](_0x2c4fe0[_0x595c('0x39')][_0x595c('0x43')]);_0x4bd61d['where']=qs[_0x595c('0x3b')](_[_0x595c('0x45')](_0x2c4fe0[_0x595c('0x39')],_0xe9a27b['filters']));if(_0x2c4fe0[_0x595c('0x39')][_0x595c('0x28')]){_0x4bd61d['where']=_[_0x595c('0x46')](_0x4bd61d[_0x595c('0x44')],{'$or':_['map'](_0x4bd61d['attributes'],function(_0x43e7ba){var _0x2c513f={};_0x2c513f[_0x43e7ba]={'$like':'%'+_0x2c4fe0[_0x595c('0x39')]['filter']+'%'};return _0x2c513f;})});}_0x4bd61d=_[_0x595c('0x46')]({},_0x4bd61d,_0x2c4fe0[_0x595c('0x47')]);return _0x24aede[_0x595c('0x66')](_0x4bd61d);}})[_0x595c('0x26')](function(_0x319e5e){if(_0x319e5e){_0x553292=_0x319e5e[_0x595c('0x3f')];if(!_0x2c4fe0[_0x595c('0x39')][_0x595c('0x40')](_0x595c('0x41'))){_0x4bd61d['limit']=qs['limit'](_0x2c4fe0[_0x595c('0x39')]['limit']);_0x4bd61d[_0x595c('0x1f')]=qs[_0x595c('0x1f')](_0x2c4fe0['query']['offset']);}return _0x24aede[_0x595c('0x66')](_0x4bd61d);}})['then'](function(_0x1cdeec){if(_0x1cdeec){return _0x1cdeec?{'count':_0x553292,'rows':_0x1cdeec}:null;}})[_0x595c('0x26')](respondWithResult(_0x183e6d,null))[_0x595c('0x4d')](handleError(_0x183e6d,null));};exports[_0x595c('0x68')]=function(_0x450736,_0x47749e,_0xa8ae81){var _0x43fa37=_0x450736['body']['teams'];var _0x2e5b78=_[_0x595c('0x38')](_0x43fa37,'id');return db[_0x595c('0x67')][_0x595c('0x4b')]({'where':{'id':_0x2e5b78},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0x595c('0x2d'),_0x595c('0x69'),_0x595c('0x6a'),_0x595c('0x6b')],'raw':!![]}]})[_0x595c('0x26')](function(_0x1bd5d8){if(_0x1bd5d8){var _0x262f02=_[_0x595c('0x6c')](_0x1bd5d8,function(_0xaf275d){var _0x5f26bf=_0xaf275d[_0x595c('0x53')]({'plain':!![]});_0x5f26bf['Agents']['forEach'](function(_0x5bcb1c){_0x5bcb1c['penalty']=_['find'](_0x43fa37,{'id':_0x5f26bf['id']})[_0x595c('0x6d')];});return _0x5f26bf[_0x595c('0x6e')];});return db['VoiceQueue'][_0x595c('0x2c')]({'where':{'id':_0x450736[_0x595c('0x5a')]['id']}})[_0x595c('0x26')](function(_0x58628f){return db[_0x595c('0x6f')]['transaction'](function(_0x4d6180){return _0x58628f[_0x595c('0x68')](_0x2e5b78,{'transaction':_0x4d6180})[_0x595c('0x26')](function(){return BPromise['each'](_0x43fa37,function(_0x3a2910){return db[_0x595c('0x70')][_0x595c('0x71')]({'TeamId':_0x3a2910['id'],'VoiceQueueId':_0x450736[_0x595c('0x5a')]['id'],'penalty':_0x3a2910['penalty']},{'transaction':_0x4d6180});});})[_0x595c('0x26')](function(){return BPromise[_0x595c('0x72')](_0x262f02,function(_0xe04c0e){return db[_0x595c('0x73')][_0x595c('0x74')]({'where':{'UserId':_0xe04c0e['id'],'VoiceQueueId':_0x450736[_0x595c('0x5a')]['id']},'defaults':{'penalty':_0xe04c0e[_0x595c('0x6d')]},'transaction':_0x4d6180});});})['then'](function(){return BPromise[_0x595c('0x72')](_[_0x595c('0x28')](_0x262f02,{'online':!![]}),function(_0x3feb75){return db[_0x595c('0x75')][_0x595c('0x71')]({'membername':_0x3feb75[_0x595c('0x2d')],'UserId':_0x3feb75['id'],'queue_name':_0x58628f[_0x595c('0x2d')],'VoiceQueueId':_0x58628f['id'],'interface':_[_0x595c('0x76')](_0x3feb75[_0x595c('0x6b')])?util[_0x595c('0x77')](_0x595c('0x78'),_0x3feb75[_0x595c('0x2d')]):_0x3feb75['interface'],'paused':_0x3feb75[_0x595c('0x6a')]||![],'penalty':_0x3feb75[_0x595c('0x6d')]},{'transaction':_0x4d6180});});})[_0x595c('0x26')](function(){_0x262f02[_0x595c('0x79')](function(_0x1635b9){socket[_0x595c('0x7a')]('userVoiceQueue:save',{'UserId':_0x1635b9['id'],'VoiceQueueId':_0x58628f['id']});});});});});}})[_0x595c('0x26')](respondWithStatusCode(_0x47749e,null))[_0x595c('0x4d')](handleError(_0x47749e,null));};exports[_0x595c('0x7b')]=function(_0x5386e8,_0x5e15be,_0x1ff359){return db[_0x595c('0x67')][_0x595c('0x4b')]({'where':{'id':_0x5386e8['query'][_0x595c('0x7c')]},'attributes':['id'],'include':[{'model':db[_0x595c('0x7d')],'as':_0x595c('0x6e'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x5e15be,null))[_0x595c('0x26')](function(_0x1491ea){var _0x7e1735=_[_0x595c('0x38')](_0x1491ea,'id');var _0x7f815=[];var _0x3c30cc=[];var _0x12b70c=squel[_0x595c('0x7e')]();_0x12b70c[_0x595c('0x7f')]('tq.TeamId')[_0x595c('0x80')](_0x595c('0x81'),'tq')[_0x595c('0x82')](_0x595c('0x83'),'ut',_0x595c('0x84'))[_0x595c('0x44')]('VoiceQueueId\x20=\x20?',_0x5386e8[_0x595c('0x5a')]['id']);for(var _0x551279=0x0;_0x551279<_0x1491ea[_0x595c('0x3f')];_0x551279+=0x1){let _0x2c0f32=_0x1491ea[_0x551279];for(var _0x5a262a=0x0;_0x5a262a<_0x2c0f32[_0x595c('0x6e')]['length'];_0x5a262a+=0x1){let _0x987d6c=_0x2c0f32[_0x595c('0x6e')][_0x5a262a];var _0x5650f4=_0x12b70c[_0x595c('0x59')]();_0x5650f4['where'](_0x595c('0x85'),_0x987d6c['id']);_0x3c30cc['push'](db[_0x595c('0x6f')]['query'](_0x5650f4[_0x595c('0x86')](),{'type':db[_0x595c('0x6f')][_0x595c('0x87')][_0x595c('0x88')]})[_0x595c('0x26')](function(_0x1f44f1){if(_0x1f44f1['length']===0x1){return _0x987d6c['id'];}else{var _0xf8fd39=_['every'](_[_0x595c('0x38')](_0x1f44f1,'TeamId'),function(_0xd5d22f){return _[_0x595c('0x89')](_0x7e1735,_0xd5d22f);});if(_0xf8fd39){return _0x987d6c['id'];}}}));}}return BPromise[_0x595c('0x8a')](_0x3c30cc)['then'](function(_0x39a293){_0x7f815=_(_0x7f815)[_0x595c('0x8b')](_0x39a293)[_0x595c('0x8c')]()[_0x595c('0x2a')]();return db[_0x595c('0x33')]['find']({'where':{'id':_0x5386e8[_0x595c('0x5a')]['id']}})[_0x595c('0x26')](function(_0x38e083){return db[_0x595c('0x6f')][_0x595c('0x8d')](function(_0x13d3c9){return _0x38e083['removeTeams'](_0x5386e8[_0x595c('0x39')][_0x595c('0x7c')],{'transaction':_0x13d3c9})[_0x595c('0x26')](function(){if(!_[_0x595c('0x8e')](_0x7f815)){return _0x38e083[_0x595c('0x8f')](_0x7f815,{'transaction':_0x13d3c9})[_0x595c('0x26')](function(){return db[_0x595c('0x75')]['destroy']({'where':{'VoiceQueueId':_0x5386e8[_0x595c('0x5a')]['id'],'UserId':_0x7f815},'transaction':_0x13d3c9});});}})['then'](function(){_0x7f815[_0x595c('0x79')](function(_0x43635c){socket['emit']('userVoiceQueue:remove',{'UserId':_0x43635c,'VoiceQueueId':_0x38e083['id']});});});});});});})[_0x595c('0x26')](respondWithStatusCode(_0x5e15be,null))['catch'](handleError(_0x5e15be,null));};exports['addAgents']=function(_0x561e32,_0x30cd98,_0x2c78a6){var _0x83ee4f,_0x27ec9c;return db['VoiceQueue'][_0x595c('0x2c')]({'where':{'id':_0x561e32['params']['id']}})[_0x595c('0x26')](handleEntityNotFound(_0x30cd98,null))[_0x595c('0x26')](function(_0x12a303){if(_0x12a303){_0x27ec9c=_0x12a303;return _0x12a303[_0x595c('0x90')](_0x561e32[_0x595c('0x4f')][_0x595c('0x7c')],_[_0x595c('0x5b')](_0x561e32['body'],['ids','id'])||{})[_0x595c('0x91')](function(_0x4a9656){for(var _0x4c0a18=0x0;_0x4c0a18<_0x561e32[_0x595c('0x4f')][_0x595c('0x7c')][_0x595c('0x3f')];_0x4c0a18+=0x1){socket['emit'](_0x595c('0x92'),{'UserId':Number(_0x561e32[_0x595c('0x4f')][_0x595c('0x7c')][_0x4c0a18]),'VoiceQueueId':Number(_0x561e32[_0x595c('0x5a')]['id'])});}return _0x4a9656;});}})[_0x595c('0x26')](function(_0x511397){_0x83ee4f=_0x511397||[];if(_0x27ec9c){return db[_0x595c('0x7d')][_0x595c('0x4b')]({'where':{'id':_0x561e32['body'][_0x595c('0x7c')]},'attributes':['id','name',_0x595c('0x69'),_0x595c('0x6a'),'interface'],'raw':!![]});}})[_0x595c('0x26')](function(_0x41cf44){if(!_[_0x595c('0x8e')](_0x41cf44)){var _0x30c8a3=[];for(var _0x48329f=0x0;_0x48329f<_0x41cf44['length'];_0x48329f++){if(_0x41cf44[_0x48329f][_0x595c('0x69')]){_0x30c8a3[_0x595c('0x93')](db[_0x595c('0x75')]['upsert']({'membername':_0x41cf44[_0x48329f]['name'],'UserId':_0x41cf44[_0x48329f]['id'],'queue_name':_0x27ec9c[_0x595c('0x2d')],'VoiceQueueId':_0x27ec9c['id'],'interface':_[_0x595c('0x76')](_0x41cf44[_0x48329f][_0x595c('0x6b')])?util[_0x595c('0x77')](_0x595c('0x78'),_0x41cf44[_0x48329f][_0x595c('0x2d')]):_0x41cf44[_0x48329f]['interface'],'paused':_0x41cf44[_0x48329f][_0x595c('0x6a')]||![],'penalty':_0x561e32[_0x595c('0x4f')][_0x595c('0x6d')]||0x0}));}}return BPromise[_0x595c('0x8a')](_0x30c8a3);}})['then'](function(){return _0x83ee4f;})[_0x595c('0x26')](respondWithResult(_0x30cd98,null))[_0x595c('0x4d')](handleError(_0x30cd98,null));};exports['removeAgents']=function(_0x375ef1,_0x11f928,_0x418c3b){return db[_0x595c('0x33')]['find']({'where':{'id':_0x375ef1[_0x595c('0x5a')]['id']}})[_0x595c('0x26')](handleEntityNotFound(_0x11f928,null))[_0x595c('0x26')](function(_0xb7c70){if(_0xb7c70){return _0xb7c70[_0x595c('0x8f')](_0x375ef1[_0x595c('0x39')][_0x595c('0x7c')])[_0x595c('0x26')](function(){if(_[_0x595c('0x94')](_0x375ef1[_0x595c('0x39')][_0x595c('0x7c')])){for(var _0x1efc9f=0x0;_0x1efc9f<_0x375ef1['query'][_0x595c('0x7c')][_0x595c('0x3f')];_0x1efc9f+=0x1){socket[_0x595c('0x7a')](_0x595c('0x95'),{'UserId':Number(_0x375ef1['query']['ids'][_0x1efc9f]),'VoiceQueueId':Number(_0x375ef1['params']['id'])});}}else{socket[_0x595c('0x7a')](_0x595c('0x95'),{'UserId':Number(_0x375ef1['query'][_0x595c('0x7c')]),'VoiceQueueId':Number(_0x375ef1[_0x595c('0x5a')]['id'])});}});}})[_0x595c('0x26')](function(_0x372192){return db['UserVoiceQueueRt'][_0x595c('0x25')]({'where':{'VoiceQueueId':_0x375ef1[_0x595c('0x5a')]['id'],'UserId':_0x375ef1[_0x595c('0x39')][_0x595c('0x7c')]}})[_0x595c('0x26')](function(){return _0x372192;});})[_0x595c('0x26')](respondWithStatusCode(_0x11f928,null))['catch'](handleError(_0x11f928,null));};exports[_0x595c('0x96')]=function(_0x51b236,_0x161663,_0xe74253){var _0x5f43ed={};var _0x409d20={};var _0x194ab7;var _0x4d68ad;return db[_0x595c('0x33')][_0x595c('0x5e')]({'where':{'id':_0x51b236['params']['id']}})[_0x595c('0x26')](handleEntityNotFound(_0x161663,null))['then'](function(_0x3b2eea){if(_0x3b2eea){_0x194ab7=_0x3b2eea;_0x409d20[_0x595c('0x37')]=_[_0x595c('0x3a')](db[_0x595c('0x7d')][_0x595c('0x34')]);_0x409d20[_0x595c('0x39')]=_[_0x595c('0x3a')](_0x51b236['query']);_0x409d20['filters']=_[_0x595c('0x3c')](_0x409d20[_0x595c('0x37')],_0x409d20[_0x595c('0x39')]);_0x5f43ed[_0x595c('0x3e')]=_[_0x595c('0x3c')](_0x409d20[_0x595c('0x37')],qs['fields'](_0x51b236[_0x595c('0x39')][_0x595c('0x3d')]));_0x5f43ed[_0x595c('0x3e')]=_0x5f43ed['attributes'][_0x595c('0x3f')]?_0x5f43ed['attributes']:_0x409d20['model'];_0x5f43ed[_0x595c('0x42')]=qs[_0x595c('0x43')](_0x51b236[_0x595c('0x39')]['sort']);_0x5f43ed['where']=qs[_0x595c('0x3b')](_[_0x595c('0x45')](_0x51b236[_0x595c('0x39')],_0x409d20['filters']));if(_0x51b236[_0x595c('0x39')][_0x595c('0x28')]){_0x5f43ed[_0x595c('0x44')]=_[_0x595c('0x46')](_0x5f43ed[_0x595c('0x44')],{'$or':_[_0x595c('0x38')](_0x5f43ed[_0x595c('0x3e')],function(_0x153baa){var _0x2ea025={};_0x2ea025[_0x153baa]={'$like':'%'+_0x51b236['query'][_0x595c('0x28')]+'%'};return _0x2ea025;})});}_0x5f43ed=_['merge']({},_0x5f43ed,_0x51b236[_0x595c('0x47')]);return _0x194ab7[_0x595c('0x96')](_0x5f43ed);}})[_0x595c('0x26')](function(_0x395fa6){if(_0x395fa6){_0x4d68ad=_0x395fa6['length'];if(!_0x51b236[_0x595c('0x39')][_0x595c('0x40')]('nolimit')){_0x5f43ed[_0x595c('0x21')]=qs[_0x595c('0x21')](_0x51b236['query']['limit']);_0x5f43ed[_0x595c('0x1f')]=qs[_0x595c('0x1f')](_0x51b236['query'][_0x595c('0x1f')]);}return _0x194ab7['getAgents'](_0x5f43ed);}})['then'](function(_0x524bfe){if(_0x524bfe){return _0x524bfe?{'count':_0x4d68ad,'rows':_0x524bfe}:null;}})[_0x595c('0x26')](respondWithResult(_0x161663,null))['catch'](handleError(_0x161663,null));};exports['getMembers']=function(_0x4c7584,_0x2197ce,_0x261d84){var _0x53dd1d={};var _0x30a6ed={};var _0x2a556b;var _0x5bbf29;return db[_0x595c('0x33')]['findOne']({'where':{'id':_0x4c7584[_0x595c('0x5a')]['id']}})[_0x595c('0x26')](handleEntityNotFound(_0x2197ce,null))[_0x595c('0x26')](function(_0x246d24){if(_0x246d24){_0x2a556b=_0x246d24;_0x30a6ed['model']=_[_0x595c('0x3a')](db['UserVoiceQueueRt']['rawAttributes']);_0x30a6ed[_0x595c('0x39')]=_[_0x595c('0x3a')](_0x4c7584[_0x595c('0x39')]);_0x30a6ed[_0x595c('0x3b')]=_['intersection'](_0x30a6ed[_0x595c('0x37')],_0x30a6ed[_0x595c('0x39')]);_0x53dd1d[_0x595c('0x3e')]=_['intersection'](_0x30a6ed[_0x595c('0x37')],qs[_0x595c('0x3d')](_0x4c7584[_0x595c('0x39')][_0x595c('0x3d')]));_0x53dd1d[_0x595c('0x3e')]=_0x53dd1d[_0x595c('0x3e')]['length']?_0x53dd1d['attributes']:_0x30a6ed['model'];_0x53dd1d[_0x595c('0x42')]=qs[_0x595c('0x43')](_0x4c7584[_0x595c('0x39')][_0x595c('0x43')]);_0x53dd1d[_0x595c('0x44')]=qs[_0x595c('0x3b')](_[_0x595c('0x45')](_0x4c7584[_0x595c('0x39')],_0x30a6ed[_0x595c('0x3b')]));if(_0x4c7584[_0x595c('0x39')][_0x595c('0x28')]){_0x53dd1d[_0x595c('0x44')]=_['merge'](_0x53dd1d['where'],{'$or':_['map'](_0x53dd1d[_0x595c('0x3e')],function(_0x5948fc){var _0x51b1d7={};_0x51b1d7[_0x5948fc]={'$like':'%'+_0x4c7584[_0x595c('0x39')][_0x595c('0x28')]+'%'};return _0x51b1d7;})});}_0x53dd1d=_['merge']({},_0x53dd1d,_0x4c7584[_0x595c('0x47')]);return _0x2a556b[_0x595c('0x97')](_0x53dd1d);}})['then'](function(_0xb68ba7){if(_0xb68ba7){_0x5bbf29=_0xb68ba7['length'];if(!_0x4c7584[_0x595c('0x39')][_0x595c('0x40')](_0x595c('0x41'))){_0x53dd1d['limit']=qs[_0x595c('0x21')](_0x4c7584[_0x595c('0x39')][_0x595c('0x21')]);_0x53dd1d[_0x595c('0x1f')]=qs[_0x595c('0x1f')](_0x4c7584[_0x595c('0x39')][_0x595c('0x1f')]);}return _0x2a556b[_0x595c('0x97')](_0x53dd1d);}})['then'](function(_0x322958){return _0x322958?{'count':_0x5bbf29,'rows':_0x322958}:null;})['then'](respondWithResult(_0x2197ce,null))[_0x595c('0x4d')](handleError(_0x2197ce,null));};exports[_0x595c('0x98')]=function(_0x4cdb72,_0x16e3ca,_0x7fdc3c){var _0x12ef3c={};var _0x21544e={};var _0x360546;var _0x83c7c0;return db[_0x595c('0x33')][_0x595c('0x5e')]({'where':{'id':_0x4cdb72['params']['id']}})[_0x595c('0x26')](handleEntityNotFound(_0x16e3ca,null))['then'](function(_0x3de070){if(_0x3de070){_0x360546=_0x3de070;_0x21544e[_0x595c('0x37')]=_[_0x595c('0x3a')](db[_0x595c('0x99')]['rawAttributes']);_0x21544e[_0x595c('0x39')]=_[_0x595c('0x3a')](_0x4cdb72[_0x595c('0x39')]);_0x21544e[_0x595c('0x3b')]=_[_0x595c('0x3c')](_0x21544e[_0x595c('0x37')],_0x21544e[_0x595c('0x39')]);_0x12ef3c[_0x595c('0x3e')]=_[_0x595c('0x3c')](_0x21544e[_0x595c('0x37')],qs[_0x595c('0x3d')](_0x4cdb72[_0x595c('0x39')][_0x595c('0x3d')]));_0x12ef3c[_0x595c('0x3e')]=_0x12ef3c[_0x595c('0x3e')]['length']?_0x12ef3c['attributes']:_0x21544e[_0x595c('0x37')];_0x12ef3c[_0x595c('0x42')]=qs[_0x595c('0x43')](_0x4cdb72[_0x595c('0x39')]['sort']);_0x12ef3c['where']=qs['filters'](_[_0x595c('0x45')](_0x4cdb72['query'],_0x21544e[_0x595c('0x3b')]));if(_0x4cdb72[_0x595c('0x39')][_0x595c('0x28')]){_0x12ef3c[_0x595c('0x44')]=_[_0x595c('0x46')](_0x12ef3c[_0x595c('0x44')],{'$or':_[_0x595c('0x38')](_0x12ef3c['attributes'],function(_0x452c65){var _0x288363={};_0x288363[_0x452c65]={'$like':'%'+_0x4cdb72[_0x595c('0x39')][_0x595c('0x28')]+'%'};return _0x288363;})});}_0x12ef3c=_[_0x595c('0x46')]({},_0x12ef3c,_0x4cdb72[_0x595c('0x47')]);return _0x360546[_0x595c('0x98')](_0x12ef3c);}})['then'](function(_0x4b5fd5){if(_0x4b5fd5){_0x83c7c0=_0x4b5fd5['length'];if(!_0x4cdb72[_0x595c('0x39')]['hasOwnProperty']('nolimit')){_0x12ef3c[_0x595c('0x21')]=qs[_0x595c('0x21')](_0x4cdb72[_0x595c('0x39')][_0x595c('0x21')]);_0x12ef3c[_0x595c('0x1f')]=qs[_0x595c('0x1f')](_0x4cdb72[_0x595c('0x39')]['offset']);}return _0x360546[_0x595c('0x98')](_0x12ef3c);}})[_0x595c('0x26')](function(_0x33305a){if(_0x33305a){return _0x33305a?{'count':_0x83c7c0,'rows':_0x33305a}:null;}})[_0x595c('0x26')](respondWithResult(_0x16e3ca,null))[_0x595c('0x4d')](handleError(_0x16e3ca,null));};exports[_0x595c('0x9a')]=function(_0x30c0b7,_0x4c6165,_0xd65e4f){var _0x665459,_0x1dcc41;return db[_0x595c('0x33')][_0x595c('0x2c')]({'where':{'id':_0x30c0b7[_0x595c('0x5a')]['id']}})[_0x595c('0x26')](handleEntityNotFound(_0x4c6165,null))[_0x595c('0x26')](function(_0x1f097c){if(_0x1f097c){_0x1dcc41=_0x1f097c;return _0x1f097c[_0x595c('0x9a')](_0x30c0b7['body'][_0x595c('0x7c')],_['omit'](_0x30c0b7[_0x595c('0x4f')],['ids','id'])||{});}return null;})[_0x595c('0x91')](function(_0xab33ed){var _0x311c0a;_0x665459=_0xab33ed||[];var _0x5867f4=[];if(_0xab33ed){for(var _0xcb6423=0x0;_0xcb6423<_0xab33ed[_0x595c('0x3f')];_0xcb6423+=0x1){var _0x39e295=_0xab33ed[_0xcb6423]['get']({'plain':!![]});_0x1dcc41[_0x595c('0x9b')]=_0x30c0b7[_0x595c('0x4f')][_0x595c('0x9b')]?_0x30c0b7[_0x595c('0x4f')][_0x595c('0x9b')]:_0x1dcc41['dialCheckDuplicateType'];switch(_0x1dcc41[_0x595c('0x9b')]){case'always':_0x311c0a=squel[_0x595c('0x9c')]()[_0x595c('0x9d')](_0x595c('0x9e'))[_0x595c('0x9f')]([_0x595c('0xa0'),'scheduledAt',_0x595c('0xa1'),_0x595c('0xa2'),_0x595c('0x60'),_0x595c('0x5c'),'updatedAt'],squel[_0x595c('0x7e')]()[_0x595c('0x7f')](_0x595c('0xa0'),_0x595c('0xa0'))[_0x595c('0x7f')]('NOW()',_0x595c('0xa3'))['field']('id',_0x595c('0xa1'))['field'](_0x39e295[_0x595c('0xa4')][_0x595c('0x86')](),'ListId')['field'](_0x30c0b7[_0x595c('0x5a')]['id'][_0x595c('0x86')](),_0x595c('0x60'))[_0x595c('0x7f')](_0x595c('0xa5'),'createdAt')[_0x595c('0x7f')](_0x595c('0xa5'),'updatedAt')[_0x595c('0x80')](_0x595c('0xa6'))[_0x595c('0x44')](_0x595c('0xa7'))['where'](_0x595c('0xa8'),_0x39e295[_0x595c('0xa4')][_0x595c('0x86')]())[_0x595c('0x44')](_0x595c('0xa9'))[_0x595c('0x44')](_0x595c('0xaa'),squel['select']()[_0x595c('0x7f')](_0x595c('0xab'))[_0x595c('0x80')](_0x595c('0xac'))[_0x595c('0x44')](_0x595c('0xad'),_0x30c0b7[_0x595c('0x5a')]['id'][_0x595c('0x86')]()))[_0x595c('0x44')](_0x595c('0xaa'),squel[_0x595c('0x7e')]()[_0x595c('0x7f')](_0x595c('0xae'))['from']('cm_hopper')[_0x595c('0x44')](_0x595c('0xad'),_0x30c0b7['params']['id'][_0x595c('0x86')]())))['toString']();break;case _0x595c('0xaf'):_0x311c0a=squel['insert']()[_0x595c('0x9d')](_0x595c('0x9e'))['fromQuery']([_0x595c('0xa0'),_0x595c('0xa3'),_0x595c('0xa1'),'ListId',_0x595c('0x60'),'createdAt',_0x595c('0xb0')],squel[_0x595c('0x7e')]()[_0x595c('0x7f')]('phone',_0x595c('0xa0'))[_0x595c('0x7f')](_0x595c('0xa5'),'scheduledAt')[_0x595c('0x7f')]('id','ContactId')[_0x595c('0x7f')](_0x39e295[_0x595c('0xa4')][_0x595c('0x86')](),_0x595c('0xa2'))['field'](_0x30c0b7[_0x595c('0x5a')]['id'][_0x595c('0x86')](),_0x595c('0x60'))[_0x595c('0x7f')](_0x595c('0xa5'),_0x595c('0x5c'))[_0x595c('0x7f')](_0x595c('0xa5'),_0x595c('0xb0'))[_0x595c('0x80')](_0x595c('0xa6'))['where'](_0x595c('0xa7'))[_0x595c('0x44')](_0x595c('0xa8'),_0x39e295['CmListId']['toString']())['where'](_0x595c('0xa9'))['where'](_0x595c('0xaa'),squel[_0x595c('0x7e')]()['field'](_0x595c('0xae'))[_0x595c('0x80')](_0x595c('0x9e'))[_0x595c('0x44')](_0x595c('0xad'),_0x30c0b7['params']['id'][_0x595c('0x86')]())))[_0x595c('0x86')]();break;default:_0x311c0a=squel['insert']()[_0x595c('0x9d')](_0x595c('0x9e'))[_0x595c('0x9f')](['phone',_0x595c('0xa3'),_0x595c('0xa1'),_0x595c('0xa2'),'VoiceQueueId','createdAt',_0x595c('0xb0')],squel['select']()[_0x595c('0x7f')](_0x595c('0xa0'),_0x595c('0xa0'))['field'](_0x595c('0xa5'),_0x595c('0xa3'))[_0x595c('0x7f')]('id',_0x595c('0xa1'))[_0x595c('0x7f')](_0x39e295[_0x595c('0xa4')]['toString'](),_0x595c('0xa2'))[_0x595c('0x7f')](_0x30c0b7['params']['id'][_0x595c('0x86')](),_0x595c('0x60'))['field'](_0x595c('0xa5'),'createdAt')[_0x595c('0x7f')](_0x595c('0xa5'),'updatedAt')[_0x595c('0x80')](_0x595c('0xa6'))[_0x595c('0x44')]('deletedAt\x20IS\x20NULL')[_0x595c('0x44')](_0x595c('0xa8'),_0x39e295[_0x595c('0xa4')][_0x595c('0x86')]())['where'](_0x595c('0xa9')))[_0x595c('0x86')]();}_0x5867f4['push'](db['sequelize'][_0x595c('0x39')](_0x311c0a));}return BPromise['all'](_0x5867f4);}})[_0x595c('0x26')](function(){return _0x665459;})['then'](respondWithResult(_0x4c6165,null))['catch'](handleError(_0x4c6165,null));};exports[_0x595c('0xb1')]=function(_0x52eaff,_0x17a500,_0x10c321){return db[_0x595c('0x33')][_0x595c('0x2c')]({'where':{'id':_0x52eaff[_0x595c('0x5a')]['id']}})['then'](handleEntityNotFound(_0x17a500,null))['then'](function(_0x829fbc){if(_0x829fbc){return _0x829fbc[_0x595c('0xb1')](_0x52eaff[_0x595c('0x39')][_0x595c('0x7c')]);}})['then'](function(_0x18387d){if(_0x18387d){return db[_0x595c('0x5f')][_0x595c('0x25')]({'where':{'ListId':_0x52eaff['query'][_0x595c('0x7c')],'VoiceQueueId':_0x52eaff['params']['id']}})[_0x595c('0x26')](function(){return _0x18387d;});}})[_0x595c('0x26')](respondWithStatusCode(_0x17a500,null))[_0x595c('0x4d')](handleError(_0x17a500,null));};exports[_0x595c('0xb2')]=function(_0x285b5c,_0xcc5c43,_0x1cc4bf){var _0x41d783={};var _0x10f38e={};var _0x35b341;var _0x2fc3dd;return db['VoiceQueue']['findOne']({'where':{'id':_0x285b5c[_0x595c('0x5a')]['id']}})['then'](handleEntityNotFound(_0xcc5c43,null))['then'](function(_0x17d243){if(_0x17d243){_0x35b341=_0x17d243;_0x10f38e[_0x595c('0x37')]=_[_0x595c('0x3a')](db[_0x595c('0x99')][_0x595c('0x34')]);_0x10f38e['query']=_['keys'](_0x285b5c[_0x595c('0x39')]);_0x10f38e[_0x595c('0x3b')]=_[_0x595c('0x3c')](_0x10f38e[_0x595c('0x37')],_0x10f38e[_0x595c('0x39')]);_0x41d783[_0x595c('0x3e')]=_[_0x595c('0x3c')](_0x10f38e[_0x595c('0x37')],qs[_0x595c('0x3d')](_0x285b5c[_0x595c('0x39')][_0x595c('0x3d')]));_0x41d783['attributes']=_0x41d783['attributes']['length']?_0x41d783[_0x595c('0x3e')]:_0x10f38e['model'];_0x41d783[_0x595c('0x42')]=qs[_0x595c('0x43')](_0x285b5c['query'][_0x595c('0x43')]);_0x41d783[_0x595c('0x44')]=qs[_0x595c('0x3b')](_[_0x595c('0x45')](_0x285b5c[_0x595c('0x39')],_0x10f38e['filters']));if(_0x285b5c[_0x595c('0x39')]['filter']){_0x41d783[_0x595c('0x44')]=_[_0x595c('0x46')](_0x41d783[_0x595c('0x44')],{'$or':_[_0x595c('0x38')](_0x41d783[_0x595c('0x3e')],function(_0x883b84){var _0x10ae6a={};_0x10ae6a[_0x883b84]={'$like':'%'+_0x285b5c[_0x595c('0x39')][_0x595c('0x28')]+'%'};return _0x10ae6a;})});}_0x41d783=_[_0x595c('0x46')]({},_0x41d783,_0x285b5c[_0x595c('0x47')]);return _0x35b341['getBlackLists'](_0x41d783);}})[_0x595c('0x26')](function(_0x18da25){if(_0x18da25){_0x2fc3dd=_0x18da25[_0x595c('0x3f')];if(!_0x285b5c[_0x595c('0x39')][_0x595c('0x40')](_0x595c('0x41'))){_0x41d783[_0x595c('0x21')]=qs[_0x595c('0x21')](_0x285b5c['query'][_0x595c('0x21')]);_0x41d783['offset']=qs[_0x595c('0x1f')](_0x285b5c[_0x595c('0x39')]['offset']);}return _0x35b341[_0x595c('0xb2')](_0x41d783);}})['then'](function(_0x12b14f){if(_0x12b14f){return _0x12b14f?{'count':_0x2fc3dd,'rows':_0x12b14f}:null;}})['then'](respondWithResult(_0xcc5c43,null))['catch'](handleError(_0xcc5c43,null));};exports['addBlackLists']=function(_0x3d7bab,_0x1c758b,_0x465554){var _0xbfe2c9,_0x1006a4;return db[_0x595c('0x33')][_0x595c('0x2c')]({'where':{'id':_0x3d7bab[_0x595c('0x5a')]['id']}})[_0x595c('0x26')](handleEntityNotFound(_0x1c758b,null))[_0x595c('0x26')](function(_0x146414){if(_0x146414){_0x1006a4=_0x146414;return _0x146414[_0x595c('0xb3')](_0x3d7bab['body'][_0x595c('0x7c')],_[_0x595c('0x5b')](_0x3d7bab[_0x595c('0x4f')],[_0x595c('0x7c'),'id'])||{});}return null;})[_0x595c('0x91')](function(_0x42396a){var _0x16312f;_0xbfe2c9=_0x42396a||[];var _0x2faf8f=[];if(_0x42396a){for(var _0x308b67=0x0;_0x308b67<_0x42396a[_0x595c('0x3f')];_0x308b67+=0x1){var _0xd11fe1=_0x42396a[_0x308b67][_0x595c('0x53')]({'plain':!![]});_0x16312f=squel['insert']()[_0x595c('0x9d')]('cm_hopper_black')['fromQuery']([_0x595c('0xa0'),'ContactId',_0x595c('0xa2'),_0x595c('0x60'),_0x595c('0x5c'),'updatedAt'],squel[_0x595c('0x7e')]()[_0x595c('0x7f')](_0x595c('0xa0'),_0x595c('0xa0'))[_0x595c('0x7f')]('id','ContactId')[_0x595c('0x7f')](_0xd11fe1[_0x595c('0xa4')][_0x595c('0x86')](),_0x595c('0xa2'))[_0x595c('0x7f')](_0x3d7bab[_0x595c('0x5a')]['id'][_0x595c('0x86')](),_0x595c('0x60'))[_0x595c('0x7f')](_0x595c('0xa5'),_0x595c('0x5c'))[_0x595c('0x7f')](_0x595c('0xa5'),_0x595c('0xb0'))[_0x595c('0x80')](_0x595c('0xa6'))['where']('deletedAt\x20IS\x20NULL')[_0x595c('0x44')](_0x595c('0xa8'),_0xd11fe1[_0x595c('0xa4')]['toString']())[_0x595c('0x44')](_0x595c('0xa9')))[_0x595c('0x86')]();_0x2faf8f[_0x595c('0x93')](db[_0x595c('0x6f')][_0x595c('0x39')](_0x16312f));}return BPromise[_0x595c('0x8a')](_0x2faf8f);}})[_0x595c('0x26')](function(){return _0xbfe2c9;})['then'](respondWithResult(_0x1c758b,null))[_0x595c('0x4d')](handleError(_0x1c758b,null));};exports[_0x595c('0xb4')]=function(_0x5e3d5d,_0x4c11da,_0x48aff4){return db['VoiceQueue']['find']({'where':{'id':_0x5e3d5d[_0x595c('0x5a')]['id']}})[_0x595c('0x26')](handleEntityNotFound(_0x4c11da,null))[_0x595c('0x26')](function(_0x408a2b){if(_0x408a2b){return _0x408a2b[_0x595c('0xb4')](_0x5e3d5d[_0x595c('0x39')][_0x595c('0x7c')]);}})[_0x595c('0x26')](function(_0x459fa7){if(_0x459fa7){return db[_0x595c('0x65')][_0x595c('0x25')]({'where':{'ListId':_0x5e3d5d[_0x595c('0x39')][_0x595c('0x7c')],'VoiceQueueId':_0x5e3d5d[_0x595c('0x5a')]['id']}})[_0x595c('0x26')](function(){return _0x459fa7;});}})[_0x595c('0x26')](respondWithStatusCode(_0x4c11da,null))['catch'](handleError(_0x4c11da,null));}; \ No newline at end of file +var _0x5653=['hasOwnProperty','VoiceQueueId','CmHopper','getHopperHistories','CmHopperHistory','CmHopperFinal','pick','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','User','Agents','online','voicePause','interface','flatMap','forEach','penalty','sequelize','each','UserVoiceQueue','UserVoiceQueueRt','format','SIP/%s','emit','userVoiceQueue:save','tq.TeamId','from','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','TeamId','all','compact','transaction','removeTeams','isEmpty','removeAgents','addAgents','ids','upsert','isArray','userVoiceQueue:remove','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','always','into','fromQuery','phone','scheduledAt','ContactId','select','field','NOW()','CmListId','toString','ListId','cm_contacts','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','COALESCE(phone,\x27\x27)','cm_hopper','onlyIfOpen','insert','deletedAt\x20IS\x20NULL','removeLists','getBlackLists','addBlackLists','spread','cm_hopper_black','removeBlackLists','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./voiceQueue.socket','register','sendStatus','status','end','json','undefined','count','offset','Content-Range','reject','save','update','then','destroy','get','VoiceQueues','inbound','QueueCampaigns','filter','ignore','map','value','includes','find','type','name','UserProfileResource','stack','send','index','VoiceQueue','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','limit','order','sort','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','body','user','role','outbound','UserProfileSection','autoAssociation','error','clone','createdAt','omit','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','getHoppers','findOne'];(function(_0x5caedb,_0x42fb48){var _0x38d90f=function(_0x1a7eae){while(--_0x1a7eae){_0x5caedb['push'](_0x5caedb['shift']());}};_0x38d90f(++_0x42fb48);}(_0x5653,0x110));var _0x3565=function(_0x535dee,_0x2d90f9){_0x535dee=_0x535dee-0x0;var _0x5e6f24=_0x5653[_0x535dee];return _0x5e6f24;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3565('0x0'));var zipdir=require(_0x3565('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3565('0x2'));var moment=require(_0x3565('0x3'));var BPromise=require(_0x3565('0x4'));var Mustache=require(_0x3565('0x5'));var util=require(_0x3565('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3565('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3565('0x8'));var squel=require(_0x3565('0x9'));var crypto=require(_0x3565('0xa'));var jsforce=require(_0x3565('0xb'));var deskjs=require(_0x3565('0xc'));var toCsv=require(_0x3565('0xd'));var querystring=require(_0x3565('0xe'));var Papa=require(_0x3565('0xf'));var Redis=require('ioredis');var authService=require(_0x3565('0x10'));var qs=require(_0x3565('0x11'));var as=require(_0x3565('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3565('0x13'))('api');var utils=require(_0x3565('0x14'));var config=require(_0x3565('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x3565('0x16'))['db'];config[_0x3565('0x17')]=_['defaults'](config[_0x3565('0x17')],{'host':_0x3565('0x18'),'port':0x18eb});var socket=require(_0x3565('0x19'))(new Redis(config['redis']));require(_0x3565('0x1a'))[_0x3565('0x1b')](socket);function respondWithStatusCode(_0x18071c,_0x313469){_0x313469=_0x313469||0xcc;return function(_0x57e9df){if(_0x57e9df){return _0x18071c[_0x3565('0x1c')](_0x313469);}return _0x18071c[_0x3565('0x1d')](_0x313469)[_0x3565('0x1e')]();};}function respondWithResult(_0x2defdf,_0x13525){_0x13525=_0x13525||0xc8;return function(_0x15b918){if(_0x15b918){return _0x2defdf[_0x3565('0x1d')](_0x13525)[_0x3565('0x1f')](_0x15b918);}};}function respondWithFilteredResult(_0x391691,_0x3e7e61){return function(_0x58833d){if(_0x58833d){var _0x243c76=typeof _0x3e7e61['offset']==='undefined'&&typeof _0x3e7e61['limit']===_0x3565('0x20');var _0x52b6c5=_0x58833d[_0x3565('0x21')];var _0x4d646a=_0x243c76?0x0:_0x3e7e61[_0x3565('0x22')];var _0x3e916b=_0x243c76?_0x58833d[_0x3565('0x21')]:_0x3e7e61[_0x3565('0x22')]+_0x3e7e61['limit'];var _0x40e83b;if(_0x3e916b>=_0x52b6c5){_0x3e916b=_0x52b6c5;_0x40e83b=0xc8;}else{_0x40e83b=0xce;}_0x391691['status'](_0x40e83b);return _0x391691['set'](_0x3565('0x23'),_0x4d646a+'-'+_0x3e916b+'/'+_0x52b6c5)[_0x3565('0x1f')](_0x58833d);}return null;};}function patchUpdates(_0x560acd){return function(_0xaa90b2){try{jsonpatch['apply'](_0xaa90b2,_0x560acd,!![]);}catch(_0x4eb915){return BPromise[_0x3565('0x24')](_0x4eb915);}return _0xaa90b2[_0x3565('0x25')]();};}function saveUpdates(_0x24f995,_0x524512){return function(_0x232f8f){if(_0x232f8f){return _0x232f8f[_0x3565('0x26')](_0x24f995)[_0x3565('0x27')](function(_0x7d0df7){return _0x7d0df7;});}return null;};}function removeEntity(_0x4f859c,_0xf2e1c7){return function(_0x417898){if(_0x417898){return _0x417898[_0x3565('0x28')]()['then'](function(){var _0x54b076=_0x417898[_0x3565('0x29')]({'plain':!![]});var _0x5efc74=[{'name':_0x3565('0x2a'),'value':_0x3565('0x2b'),'ignore':![]},{'name':_0x3565('0x2c'),'value':'outbound','ignore':![]}];var _0x5e36e6=_(_0x5efc74)[_0x3565('0x2d')](_0x3565('0x2e'))[_0x3565('0x2f')](_0x3565('0x30'))['value']();if(_[_0x3565('0x31')](_0x5e36e6,_0x54b076['type'])){return;}var _0x26115d=_[_0x3565('0x32')](_0x5efc74,[_0x3565('0x30'),_0x54b076[_0x3565('0x33')]])[_0x3565('0x34')];return db[_0x3565('0x35')][_0x3565('0x28')]({'where':{'type':_0x26115d,'resourceId':_0x54b076['id']}})[_0x3565('0x27')](function(){return _0x417898;});})[_0x3565('0x27')](function(){_0x4f859c[_0x3565('0x1d')](0xcc)[_0x3565('0x1e')]();});}};}function handleEntityNotFound(_0x5a6d59,_0x458fff){return function(_0x4be281){if(!_0x4be281){_0x5a6d59['sendStatus'](0x194);}return _0x4be281;};}function handleError(_0x47fb2c,_0x1b3aa5){_0x1b3aa5=_0x1b3aa5||0x1f4;return function(_0x5be014){logger['error'](_0x5be014[_0x3565('0x36')]);if(_0x5be014[_0x3565('0x34')]){delete _0x5be014[_0x3565('0x34')];}_0x47fb2c[_0x3565('0x1d')](_0x1b3aa5)[_0x3565('0x37')](_0x5be014);};}exports[_0x3565('0x38')]=function(_0x19e32c,_0x30a3c1){var _0x51d66b={},_0x5a7d93={},_0x162966={'count':0x0,'rows':[]};var _0x1c1767=_[_0x3565('0x2f')](db[_0x3565('0x39')][_0x3565('0x3a')],function(_0xa4cda){return{'name':_0xa4cda[_0x3565('0x3b')],'type':_0xa4cda[_0x3565('0x33')][_0x3565('0x3c')]};});_0x5a7d93['model']=_[_0x3565('0x2f')](_0x1c1767,_0x3565('0x34'));_0x5a7d93[_0x3565('0x3d')]=_[_0x3565('0x3e')](_0x19e32c['query']);_0x5a7d93[_0x3565('0x3f')]=_[_0x3565('0x40')](_0x5a7d93[_0x3565('0x41')],_0x5a7d93[_0x3565('0x3d')]);_0x51d66b[_0x3565('0x42')]=_[_0x3565('0x40')](_0x5a7d93[_0x3565('0x41')],qs[_0x3565('0x43')](_0x19e32c[_0x3565('0x3d')][_0x3565('0x43')]));_0x51d66b[_0x3565('0x42')]=_0x51d66b['attributes'][_0x3565('0x44')]?_0x51d66b[_0x3565('0x42')]:_0x5a7d93[_0x3565('0x41')];if(!_0x19e32c[_0x3565('0x3d')]['hasOwnProperty'](_0x3565('0x45'))){_0x51d66b[_0x3565('0x46')]=qs[_0x3565('0x46')](_0x19e32c['query'][_0x3565('0x46')]);_0x51d66b[_0x3565('0x22')]=qs[_0x3565('0x22')](_0x19e32c['query'][_0x3565('0x22')]);}_0x51d66b[_0x3565('0x47')]=qs[_0x3565('0x48')](_0x19e32c['query'][_0x3565('0x48')]);_0x51d66b['where']=qs['filters'](_['pick'](_0x19e32c[_0x3565('0x3d')],_0x5a7d93[_0x3565('0x3f')]),_0x1c1767);if(_0x19e32c[_0x3565('0x3d')][_0x3565('0x2d')]){_0x51d66b[_0x3565('0x49')]=_[_0x3565('0x4a')](_0x51d66b[_0x3565('0x49')],{'$or':_[_0x3565('0x2f')](_0x1c1767,function(_0x2141c2){if(_0x2141c2['type']!==_0x3565('0x4b')){var _0x237225={};_0x237225[_0x2141c2[_0x3565('0x34')]]={'$like':'%'+_0x19e32c['query']['filter']+'%'};return _0x237225;}})});}_0x51d66b=_[_0x3565('0x4a')]({},_0x51d66b,_0x19e32c[_0x3565('0x4c')]);var _0x150917={'where':_0x51d66b[_0x3565('0x49')]};return db['VoiceQueue'][_0x3565('0x21')](_0x150917)[_0x3565('0x27')](function(_0x360017){_0x162966[_0x3565('0x21')]=_0x360017;if(_0x19e32c['query'][_0x3565('0x4d')]){_0x51d66b[_0x3565('0x4e')]=[{'all':!![]}];}return db[_0x3565('0x39')][_0x3565('0x4f')](_0x51d66b);})[_0x3565('0x27')](function(_0x56e93a){_0x162966[_0x3565('0x50')]=_0x56e93a;return _0x162966;})['then'](respondWithFilteredResult(_0x30a3c1,_0x51d66b))[_0x3565('0x51')](handleError(_0x30a3c1,null));};exports[_0x3565('0x52')]=function(_0x36c7b9,_0xf79b99){var _0x27286c={'raw':![],'where':{'id':_0x36c7b9[_0x3565('0x53')]['id']}},_0x1d5616={};_0x1d5616[_0x3565('0x41')]=_['keys'](db[_0x3565('0x39')][_0x3565('0x3a')]);_0x1d5616['query']=_[_0x3565('0x3e')](_0x36c7b9[_0x3565('0x3d')]);_0x1d5616[_0x3565('0x3f')]=_[_0x3565('0x40')](_0x1d5616[_0x3565('0x41')],_0x1d5616[_0x3565('0x3d')]);_0x27286c['attributes']=_[_0x3565('0x40')](_0x1d5616[_0x3565('0x41')],qs[_0x3565('0x43')](_0x36c7b9[_0x3565('0x3d')][_0x3565('0x43')]));_0x27286c[_0x3565('0x42')]=_0x27286c[_0x3565('0x42')][_0x3565('0x44')]?_0x27286c[_0x3565('0x42')]:_0x1d5616[_0x3565('0x41')];if(_0x36c7b9[_0x3565('0x3d')]['includeAll']){_0x27286c[_0x3565('0x4e')]=[{'all':!![]}];}_0x27286c=_[_0x3565('0x4a')]({},_0x27286c,_0x36c7b9[_0x3565('0x4c')]);return db[_0x3565('0x39')][_0x3565('0x32')](_0x27286c)[_0x3565('0x27')](handleEntityNotFound(_0xf79b99,null))[_0x3565('0x27')](respondWithResult(_0xf79b99,null))[_0x3565('0x51')](handleError(_0xf79b99,null));};exports[_0x3565('0x54')]=function(_0x2f8349,_0x3a25b6){return db['VoiceQueue'][_0x3565('0x54')](_0x2f8349[_0x3565('0x55')],{})[_0x3565('0x27')](function(_0x159921){var _0x1d6584=_0x2f8349[_0x3565('0x56')][_0x3565('0x29')]({'plain':!![]});if(!_0x1d6584)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1d6584[_0x3565('0x57')]===_0x3565('0x56')){var _0x3f9ac0=_0x159921[_0x3565('0x29')]({'plain':!![]});var _0x29944b=[{'name':_0x3565('0x2a'),'value':_0x3565('0x2b')},{'name':'QueueCampaigns','value':_0x3565('0x58')}];var _0x5c9876=_[_0x3565('0x32')](_0x29944b,[_0x3565('0x30'),_0x3f9ac0[_0x3565('0x33')]])[_0x3565('0x34')];return db[_0x3565('0x59')]['find']({'where':{'name':_0x5c9876,'userProfileId':_0x1d6584['userProfileId']},'raw':!![]})[_0x3565('0x27')](function(_0x368f73){if(_0x368f73&&_0x368f73[_0x3565('0x5a')]===0x0){return db[_0x3565('0x35')][_0x3565('0x54')]({'name':_0x3f9ac0['name'],'resourceId':_0x3f9ac0['id'],'type':_0x368f73[_0x3565('0x34')],'sectionId':_0x368f73['id']},{})[_0x3565('0x27')](function(){return _0x159921;});}else{return _0x159921;}})[_0x3565('0x51')](function(_0x1f45f3){logger[_0x3565('0x5b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1f45f3);throw _0x1f45f3;});}return _0x159921;})[_0x3565('0x27')](respondWithResult(_0x3a25b6,0xc9))[_0x3565('0x51')](handleError(_0x3a25b6,null));};exports[_0x3565('0x5c')]=function(_0x4e13f5,_0x258b5b){var _0x8ba989={'where':{'id':_0x4e13f5[_0x3565('0x53')]['id']}},_0x27bf83={};_0x27bf83[_0x3565('0x41')]=_[_0x3565('0x3e')](db[_0x3565('0x39')]['rawAttributes']);_0x8ba989['attributes']=_[_0x3565('0x40')](_0x27bf83[_0x3565('0x41')],qs[_0x3565('0x43')](_0x4e13f5['query'][_0x3565('0x43')]));_0x8ba989[_0x3565('0x42')]=_0x8ba989[_0x3565('0x42')][_0x3565('0x44')]?_0x8ba989['attributes']:_0x27bf83[_0x3565('0x41')];if(_0x4e13f5[_0x3565('0x3d')][_0x3565('0x4d')]){_0x8ba989[_0x3565('0x4e')]=[{'all':!![]}];}_0x8ba989=_[_0x3565('0x4a')]({},_0x8ba989,_0x4e13f5['options']);return db[_0x3565('0x39')][_0x3565('0x32')](_0x8ba989)['then'](handleEntityNotFound(_0x258b5b,null))[_0x3565('0x27')](function(_0x3b4327){if(_0x3b4327){var _0x402f02=_0x3b4327[_0x3565('0x29')]({'plain':!![]});_0x402f02=qs['omit'](_0x402f02,['id',_0x3565('0x5d'),'updatedAt']);_0x4e13f5[_0x3565('0x55')]=_[_0x3565('0x5e')](_0x4e13f5[_0x3565('0x55')],['id',_0x3565('0x5d'),_0x3565('0x5f')]);return db[_0x3565('0x39')][_0x3565('0x54')](_['merge'](_0x402f02,_0x4e13f5[_0x3565('0x55')]),{'include':_0x4e13f5[_0x3565('0x3d')][_0x3565('0x4d')]?[{'all':!![]}]:undefined})[_0x3565('0x27')](function(_0x1f1f22){var _0x1065a3=_0x4e13f5[_0x3565('0x56')][_0x3565('0x29')]({'plain':!![]});if(!_0x1065a3)throw new Error(_0x3565('0x60'));if(_0x1065a3['role']===_0x3565('0x56')){var _0x5f55bd=_0x1f1f22[_0x3565('0x29')]({'plain':!![]});var _0x3d55c8=[{'name':_0x3565('0x2a'),'value':'inbound'},{'name':_0x3565('0x2c'),'value':_0x3565('0x58')}];var _0x20bc28=_[_0x3565('0x32')](_0x3d55c8,[_0x3565('0x30'),_0x5f55bd[_0x3565('0x33')]])['name'];return db[_0x3565('0x59')][_0x3565('0x32')]({'where':{'name':_0x20bc28,'userProfileId':_0x1065a3[_0x3565('0x61')]},'raw':!![]})[_0x3565('0x27')](function(_0x515948){if(_0x515948&&_0x515948['autoAssociation']===0x0){return db[_0x3565('0x35')][_0x3565('0x54')]({'name':_0x5f55bd[_0x3565('0x34')],'resourceId':_0x5f55bd['id'],'type':_0x515948[_0x3565('0x34')],'sectionId':_0x515948['id']},{})[_0x3565('0x27')](function(){return _0x1f1f22;});}else{return _0x1f1f22;}})[_0x3565('0x51')](function(_0x1571ae){logger[_0x3565('0x5b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1571ae);throw _0x1571ae;});}return _0x1f1f22;});}})['then'](respondWithResult(_0x258b5b,0xc9))[_0x3565('0x51')](handleError(_0x258b5b,null));};exports[_0x3565('0x26')]=function(_0x4f53ac,_0x1bdcdb){if(_0x4f53ac['body']['id']){delete _0x4f53ac['body']['id'];}return db['VoiceQueue'][_0x3565('0x32')]({'where':{'id':_0x4f53ac[_0x3565('0x53')]['id']}})['then'](handleEntityNotFound(_0x1bdcdb,null))['then'](saveUpdates(_0x4f53ac[_0x3565('0x55')],null))[_0x3565('0x27')](respondWithResult(_0x1bdcdb,null))[_0x3565('0x51')](handleError(_0x1bdcdb,null));};exports['destroy']=function(_0x3b267a,_0x5692ab){return db[_0x3565('0x39')]['find']({'where':{'id':_0x3b267a['params']['id']}})[_0x3565('0x27')](handleEntityNotFound(_0x5692ab,null))[_0x3565('0x27')](removeEntity(_0x5692ab,null))['catch'](handleError(_0x5692ab,null));};exports[_0x3565('0x62')]=function(_0x3a5529,_0x362ad3,_0x28d569){var _0x343e56={'raw':![],'where':{}};var _0x3fa001={};var _0x4da183={'count':0x0,'rows':[]};return db[_0x3565('0x39')][_0x3565('0x63')]({'where':{'id':_0x3a5529[_0x3565('0x53')]['id']}})[_0x3565('0x27')](handleEntityNotFound(_0x362ad3,null))[_0x3565('0x27')](function(_0x21b2ad){if(_0x21b2ad){_0x3fa001[_0x3565('0x41')]=_['keys'](db['CmHopper']['rawAttributes']);_0x3fa001['query']=_[_0x3565('0x3e')](_0x3a5529['query']);_0x3fa001[_0x3565('0x3f')]=_[_0x3565('0x40')](_0x3fa001[_0x3565('0x41')],_0x3fa001[_0x3565('0x3d')]);_0x343e56[_0x3565('0x42')]=_[_0x3565('0x40')](_0x3fa001['model'],qs[_0x3565('0x43')](_0x3a5529[_0x3565('0x3d')]['fields']));_0x343e56['attributes']=_0x343e56[_0x3565('0x42')][_0x3565('0x44')]?_0x343e56[_0x3565('0x42')]:_0x3fa001[_0x3565('0x41')];if(!_0x3a5529['query'][_0x3565('0x64')](_0x3565('0x45'))){_0x343e56[_0x3565('0x46')]=qs['limit'](_0x3a5529[_0x3565('0x3d')]['limit']);_0x343e56[_0x3565('0x22')]=qs[_0x3565('0x22')](_0x3a5529['query'][_0x3565('0x22')]);}_0x343e56[_0x3565('0x47')]=qs[_0x3565('0x48')](_0x3a5529[_0x3565('0x3d')][_0x3565('0x48')]);_0x343e56[_0x3565('0x49')]=qs[_0x3565('0x3f')](_['pick'](_0x3a5529[_0x3565('0x3d')],_0x3fa001[_0x3565('0x3f')]));_0x343e56['where'][_0x3565('0x65')]=_0x21b2ad['id'];if(_0x3a5529[_0x3565('0x3d')]['filter']){_0x343e56['where']=_[_0x3565('0x4a')](_0x343e56[_0x3565('0x49')],{'$or':_[_0x3565('0x2f')](_0x343e56[_0x3565('0x42')],function(_0x3ca822){var _0x1c0434={};_0x1c0434[_0x3ca822]={'$like':'%'+_0x3a5529['query'][_0x3565('0x2d')]+'%'};return _0x1c0434;})});}_0x343e56=_['merge']({},_0x343e56,_0x3a5529[_0x3565('0x4c')]);return db[_0x3565('0x66')]['count']({'where':_0x343e56[_0x3565('0x49')]})[_0x3565('0x27')](function(_0x15013d){_0x4da183[_0x3565('0x21')]=_0x15013d;if(_0x3a5529[_0x3565('0x3d')]['includeAll']){_0x343e56[_0x3565('0x4e')]=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x343e56);})[_0x3565('0x27')](function(_0x4d9ca3){_0x4da183[_0x3565('0x50')]=_0x4d9ca3;return _0x4da183;});}})[_0x3565('0x27')](respondWithFilteredResult(_0x362ad3,_0x343e56))['catch'](handleError(_0x362ad3,null));};exports[_0x3565('0x67')]=function(_0x5a4706,_0x3287e0,_0x30a2c6){var _0x3915ad={'raw':!![],'where':{}};var _0x50a86d={};var _0x234c7a={'count':0x0,'rows':[]};return db[_0x3565('0x39')][_0x3565('0x63')]({'where':{'id':_0x5a4706[_0x3565('0x53')]['id']}})[_0x3565('0x27')](handleEntityNotFound(_0x3287e0,null))[_0x3565('0x27')](function(_0x3857e0){if(_0x3857e0){_0x50a86d[_0x3565('0x41')]=_[_0x3565('0x3e')](db['CmHopperHistory']['rawAttributes']);_0x50a86d['query']=_[_0x3565('0x3e')](_0x5a4706[_0x3565('0x3d')]);_0x50a86d['filters']=_[_0x3565('0x40')](_0x50a86d[_0x3565('0x41')],_0x50a86d['query']);_0x3915ad[_0x3565('0x42')]=_[_0x3565('0x40')](_0x50a86d[_0x3565('0x41')],qs['fields'](_0x5a4706[_0x3565('0x3d')][_0x3565('0x43')]));_0x3915ad[_0x3565('0x42')]=_0x3915ad[_0x3565('0x42')][_0x3565('0x44')]?_0x3915ad['attributes']:_0x50a86d[_0x3565('0x41')];if(!_0x5a4706[_0x3565('0x3d')]['hasOwnProperty'](_0x3565('0x45'))){_0x3915ad[_0x3565('0x46')]=qs[_0x3565('0x46')](_0x5a4706[_0x3565('0x3d')]['limit']);_0x3915ad[_0x3565('0x22')]=qs[_0x3565('0x22')](_0x5a4706[_0x3565('0x3d')][_0x3565('0x22')]);}_0x3915ad[_0x3565('0x47')]=qs[_0x3565('0x48')](_0x5a4706[_0x3565('0x3d')][_0x3565('0x48')]);_0x3915ad['where']=qs[_0x3565('0x3f')](_['pick'](_0x5a4706[_0x3565('0x3d')],_0x50a86d[_0x3565('0x3f')]));_0x3915ad[_0x3565('0x49')][_0x3565('0x65')]=_0x3857e0['id'];if(_0x5a4706['query'][_0x3565('0x2d')]){_0x3915ad[_0x3565('0x49')]=_[_0x3565('0x4a')](_0x3915ad[_0x3565('0x49')],{'$or':_[_0x3565('0x2f')](_0x3915ad['attributes'],function(_0x382d76){var _0x2c2b9f={};_0x2c2b9f[_0x382d76]={'$like':'%'+_0x5a4706[_0x3565('0x3d')][_0x3565('0x2d')]+'%'};return _0x2c2b9f;})});}_0x3915ad=_[_0x3565('0x4a')]({},_0x3915ad,_0x5a4706[_0x3565('0x4c')]);return db['CmHopperHistory']['count']({'where':_0x3915ad[_0x3565('0x49')]})[_0x3565('0x27')](function(_0x4eb65f){_0x234c7a[_0x3565('0x21')]=_0x4eb65f;if(_0x5a4706[_0x3565('0x3d')][_0x3565('0x4d')]){_0x3915ad[_0x3565('0x4e')]=[{'all':!![]}];}return db[_0x3565('0x68')][_0x3565('0x4f')](_0x3915ad);})['then'](function(_0x57501f){_0x234c7a[_0x3565('0x50')]=_0x57501f;return _0x234c7a;});}})['then'](respondWithFilteredResult(_0x3287e0,_0x3915ad))[_0x3565('0x51')](handleError(_0x3287e0,null));};exports['getHopperFinals']=function(_0x37f10c,_0x2186ce,_0x4ae00c){var _0x3f71a2={'raw':!![],'where':{}};var _0x5a312e={};var _0x20b79b={'count':0x0,'rows':[]};return db[_0x3565('0x39')][_0x3565('0x63')]({'where':{'id':_0x37f10c[_0x3565('0x53')]['id']}})[_0x3565('0x27')](handleEntityNotFound(_0x2186ce,null))['then'](function(_0x492d6d){if(_0x492d6d){_0x5a312e[_0x3565('0x41')]=_[_0x3565('0x3e')](db[_0x3565('0x69')][_0x3565('0x3a')]);_0x5a312e[_0x3565('0x3d')]=_['keys'](_0x37f10c['query']);_0x5a312e['filters']=_[_0x3565('0x40')](_0x5a312e[_0x3565('0x41')],_0x5a312e[_0x3565('0x3d')]);_0x3f71a2['attributes']=_[_0x3565('0x40')](_0x5a312e[_0x3565('0x41')],qs[_0x3565('0x43')](_0x37f10c[_0x3565('0x3d')][_0x3565('0x43')]));_0x3f71a2[_0x3565('0x42')]=_0x3f71a2['attributes']['length']?_0x3f71a2[_0x3565('0x42')]:_0x5a312e[_0x3565('0x41')];if(!_0x37f10c[_0x3565('0x3d')][_0x3565('0x64')]('nolimit')){_0x3f71a2[_0x3565('0x46')]=qs[_0x3565('0x46')](_0x37f10c[_0x3565('0x3d')][_0x3565('0x46')]);_0x3f71a2[_0x3565('0x22')]=qs['offset'](_0x37f10c[_0x3565('0x3d')][_0x3565('0x22')]);}_0x3f71a2[_0x3565('0x47')]=qs[_0x3565('0x48')](_0x37f10c['query'][_0x3565('0x48')]);_0x3f71a2[_0x3565('0x49')]=qs[_0x3565('0x3f')](_[_0x3565('0x6a')](_0x37f10c[_0x3565('0x3d')],_0x5a312e[_0x3565('0x3f')]));_0x3f71a2['where'][_0x3565('0x65')]=_0x492d6d['id'];if(_0x37f10c[_0x3565('0x3d')][_0x3565('0x2d')]){_0x3f71a2['where']=_['merge'](_0x3f71a2[_0x3565('0x49')],{'$or':_[_0x3565('0x2f')](_0x3f71a2[_0x3565('0x42')],function(_0x30899b){var _0x4e7597={};_0x4e7597[_0x30899b]={'$like':'%'+_0x37f10c[_0x3565('0x3d')]['filter']+'%'};return _0x4e7597;})});}_0x3f71a2=_[_0x3565('0x4a')]({},_0x3f71a2,_0x37f10c[_0x3565('0x4c')]);return db[_0x3565('0x69')][_0x3565('0x21')]({'where':_0x3f71a2[_0x3565('0x49')]})[_0x3565('0x27')](function(_0x323272){_0x20b79b[_0x3565('0x21')]=_0x323272;if(_0x37f10c[_0x3565('0x3d')][_0x3565('0x4d')]){_0x3f71a2[_0x3565('0x4e')]=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x3f71a2);})[_0x3565('0x27')](function(_0x4b26dd){_0x20b79b[_0x3565('0x50')]=_0x4b26dd;return _0x20b79b;});}})['then'](respondWithFilteredResult(_0x2186ce,_0x3f71a2))[_0x3565('0x51')](handleError(_0x2186ce,null));};exports[_0x3565('0x6b')]=function(_0x48a0e0,_0x4fcc4c,_0x16c61e){var _0x3998e5={'raw':!![],'where':{}};var _0x21587b={};var _0x2623f3={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x3565('0x63')]({'where':{'id':_0x48a0e0['params']['id']}})[_0x3565('0x27')](handleEntityNotFound(_0x4fcc4c,null))['then'](function(_0xff3262){if(_0xff3262){_0x21587b[_0x3565('0x41')]=_[_0x3565('0x3e')](db[_0x3565('0x6c')][_0x3565('0x3a')]);_0x21587b['query']=_['keys'](_0x48a0e0['query']);_0x21587b['filters']=_[_0x3565('0x40')](_0x21587b[_0x3565('0x41')],_0x21587b[_0x3565('0x3d')]);_0x3998e5[_0x3565('0x42')]=_['intersection'](_0x21587b[_0x3565('0x41')],qs['fields'](_0x48a0e0[_0x3565('0x3d')][_0x3565('0x43')]));_0x3998e5[_0x3565('0x42')]=_0x3998e5[_0x3565('0x42')][_0x3565('0x44')]?_0x3998e5[_0x3565('0x42')]:_0x21587b[_0x3565('0x41')];if(!_0x48a0e0[_0x3565('0x3d')]['hasOwnProperty'](_0x3565('0x45'))){_0x3998e5[_0x3565('0x46')]=qs[_0x3565('0x46')](_0x48a0e0['query'][_0x3565('0x46')]);_0x3998e5[_0x3565('0x22')]=qs[_0x3565('0x22')](_0x48a0e0[_0x3565('0x3d')][_0x3565('0x22')]);}_0x3998e5['order']=qs['sort'](_0x48a0e0[_0x3565('0x3d')][_0x3565('0x48')]);_0x3998e5[_0x3565('0x49')]=qs[_0x3565('0x3f')](_['pick'](_0x48a0e0[_0x3565('0x3d')],_0x21587b['filters']));_0x3998e5[_0x3565('0x49')][_0x3565('0x65')]=_0xff3262['id'];if(_0x48a0e0['query']['filter']){_0x3998e5[_0x3565('0x49')]=_[_0x3565('0x4a')](_0x3998e5[_0x3565('0x49')],{'$or':_[_0x3565('0x2f')](_0x3998e5[_0x3565('0x42')],function(_0xac38cb){var _0x5c330f={};_0x5c330f[_0xac38cb]={'$like':'%'+_0x48a0e0[_0x3565('0x3d')][_0x3565('0x2d')]+'%'};return _0x5c330f;})});}_0x3998e5=_[_0x3565('0x4a')]({},_0x3998e5,_0x48a0e0[_0x3565('0x4c')]);return db[_0x3565('0x6c')]['count']({'where':_0x3998e5[_0x3565('0x49')]})['then'](function(_0x22e450){_0x2623f3[_0x3565('0x21')]=_0x22e450;if(_0x48a0e0[_0x3565('0x3d')][_0x3565('0x4d')]){_0x3998e5[_0x3565('0x4e')]=[{'all':!![]}];}return db[_0x3565('0x6c')][_0x3565('0x4f')](_0x3998e5);})['then'](function(_0x4d5639){_0x2623f3[_0x3565('0x50')]=_0x4d5639;return _0x2623f3;});}})[_0x3565('0x27')](respondWithFilteredResult(_0x4fcc4c,_0x3998e5))[_0x3565('0x51')](handleError(_0x4fcc4c,null));};exports[_0x3565('0x6d')]=function(_0x3d79d1,_0x29ed71,_0x26013a){var _0x1c561d={};var _0x392661={};var _0x15448a;var _0x4d4493;return db[_0x3565('0x39')][_0x3565('0x63')]({'where':{'id':_0x3d79d1['params']['id']}})[_0x3565('0x27')](handleEntityNotFound(_0x29ed71,null))[_0x3565('0x27')](function(_0x2319ed){if(_0x2319ed){_0x15448a=_0x2319ed;_0x392661[_0x3565('0x41')]=_['keys'](db[_0x3565('0x6e')]['rawAttributes']);_0x392661[_0x3565('0x3d')]=_['keys'](_0x3d79d1[_0x3565('0x3d')]);_0x392661[_0x3565('0x3f')]=_['intersection'](_0x392661[_0x3565('0x41')],_0x392661[_0x3565('0x3d')]);_0x1c561d['attributes']=_[_0x3565('0x40')](_0x392661[_0x3565('0x41')],qs[_0x3565('0x43')](_0x3d79d1[_0x3565('0x3d')][_0x3565('0x43')]));_0x1c561d['attributes']=_0x1c561d[_0x3565('0x42')][_0x3565('0x44')]?_0x1c561d[_0x3565('0x42')]:_0x392661[_0x3565('0x41')];_0x1c561d[_0x3565('0x47')]=qs[_0x3565('0x48')](_0x3d79d1[_0x3565('0x3d')][_0x3565('0x48')]);_0x1c561d['where']=qs[_0x3565('0x3f')](_[_0x3565('0x6a')](_0x3d79d1[_0x3565('0x3d')],_0x392661[_0x3565('0x3f')]));if(_0x3d79d1[_0x3565('0x3d')][_0x3565('0x2d')]){_0x1c561d[_0x3565('0x49')]=_['merge'](_0x1c561d[_0x3565('0x49')],{'$or':_[_0x3565('0x2f')](_0x1c561d[_0x3565('0x42')],function(_0x10dd51){var _0x598604={};_0x598604[_0x10dd51]={'$like':'%'+_0x3d79d1[_0x3565('0x3d')][_0x3565('0x2d')]+'%'};return _0x598604;})});}_0x1c561d=_[_0x3565('0x4a')]({},_0x1c561d,_0x3d79d1['options']);return _0x15448a[_0x3565('0x6d')](_0x1c561d);}})['then'](function(_0x427279){if(_0x427279){_0x4d4493=_0x427279[_0x3565('0x44')];if(!_0x3d79d1[_0x3565('0x3d')][_0x3565('0x64')](_0x3565('0x45'))){_0x1c561d['limit']=qs[_0x3565('0x46')](_0x3d79d1['query'][_0x3565('0x46')]);_0x1c561d[_0x3565('0x22')]=qs[_0x3565('0x22')](_0x3d79d1[_0x3565('0x3d')][_0x3565('0x22')]);}return _0x15448a[_0x3565('0x6d')](_0x1c561d);}})[_0x3565('0x27')](function(_0x3059e8){if(_0x3059e8){return _0x3059e8?{'count':_0x4d4493,'rows':_0x3059e8}:null;}})[_0x3565('0x27')](respondWithResult(_0x29ed71,null))[_0x3565('0x51')](handleError(_0x29ed71,null));};exports[_0x3565('0x6f')]=function(_0x369c6d,_0x3d6060,_0x3bbc55){var _0x4d40af=_0x369c6d[_0x3565('0x55')]['teams'];var _0x146356=_[_0x3565('0x2f')](_0x4d40af,'id');return db['Team'][_0x3565('0x4f')]({'where':{'id':_0x146356},'attributes':['id'],'include':[{'model':db[_0x3565('0x70')],'as':_0x3565('0x71'),'attributes':['id',_0x3565('0x34'),_0x3565('0x72'),_0x3565('0x73'),_0x3565('0x74')],'raw':!![]}]})['then'](function(_0x20406b){if(_0x20406b){var _0x45fb0e=_[_0x3565('0x75')](_0x20406b,function(_0x3a5af0){var _0x7d822a=_0x3a5af0[_0x3565('0x29')]({'plain':!![]});_0x7d822a[_0x3565('0x71')][_0x3565('0x76')](function(_0x460318){_0x460318['penalty']=_[_0x3565('0x32')](_0x4d40af,{'id':_0x7d822a['id']})[_0x3565('0x77')];});return _0x7d822a[_0x3565('0x71')];});return db[_0x3565('0x39')][_0x3565('0x32')]({'where':{'id':_0x369c6d[_0x3565('0x53')]['id']}})[_0x3565('0x27')](function(_0x3b7ed8){return db[_0x3565('0x78')]['transaction'](function(_0x2fc2a9){return _0x3b7ed8['addTeams'](_0x146356,{'transaction':_0x2fc2a9})[_0x3565('0x27')](function(){return BPromise[_0x3565('0x79')](_0x4d40af,function(_0xd506cd){return db['TeamVoiceQueue']['upsert']({'TeamId':_0xd506cd['id'],'VoiceQueueId':_0x369c6d[_0x3565('0x53')]['id'],'penalty':_0xd506cd[_0x3565('0x77')]},{'transaction':_0x2fc2a9});});})[_0x3565('0x27')](function(){return BPromise[_0x3565('0x79')](_0x45fb0e,function(_0xc80023){return db[_0x3565('0x7a')]['findOrCreate']({'where':{'UserId':_0xc80023['id'],'VoiceQueueId':_0x369c6d[_0x3565('0x53')]['id']},'defaults':{'penalty':_0xc80023[_0x3565('0x77')]},'transaction':_0x2fc2a9});});})[_0x3565('0x27')](function(){return BPromise['each'](_[_0x3565('0x2d')](_0x45fb0e,{'online':!![]}),function(_0x8f39ea){return db[_0x3565('0x7b')]['upsert']({'membername':_0x8f39ea['name'],'UserId':_0x8f39ea['id'],'queue_name':_0x3b7ed8[_0x3565('0x34')],'VoiceQueueId':_0x3b7ed8['id'],'interface':_['isNil'](_0x8f39ea[_0x3565('0x74')])?util[_0x3565('0x7c')](_0x3565('0x7d'),_0x8f39ea['name']):_0x8f39ea['interface'],'paused':_0x8f39ea[_0x3565('0x73')]||![],'penalty':_0x8f39ea[_0x3565('0x77')]},{'transaction':_0x2fc2a9});});})[_0x3565('0x27')](function(){_0x45fb0e['forEach'](function(_0xaef0d5){socket[_0x3565('0x7e')](_0x3565('0x7f'),{'UserId':_0xaef0d5['id'],'VoiceQueueId':_0x3b7ed8['id']});});});});});}})['then'](respondWithStatusCode(_0x3d6060,null))[_0x3565('0x51')](handleError(_0x3d6060,null));};exports['removeTeams']=function(_0x34e7cb,_0x4da9a6,_0x5a8ac0){return db[_0x3565('0x6e')]['findAll']({'where':{'id':_0x34e7cb[_0x3565('0x3d')]['ids']},'attributes':['id'],'include':[{'model':db[_0x3565('0x70')],'as':_0x3565('0x71'),'attributes':['id'],'raw':!![]}]})[_0x3565('0x27')](handleEntityNotFound(_0x4da9a6,null))[_0x3565('0x27')](function(_0x4dda61){var _0x4100af=_[_0x3565('0x2f')](_0x4dda61,'id');var _0x51b316=[];var _0x43b11f=[];var _0x4769bb=squel['select']();_0x4769bb['field'](_0x3565('0x80'))[_0x3565('0x81')](_0x3565('0x82'),'tq')[_0x3565('0x83')](_0x3565('0x84'),'ut',_0x3565('0x85'))['where'](_0x3565('0x86'),_0x34e7cb['params']['id']);for(var _0x253df1=0x0;_0x253df1<_0x4dda61[_0x3565('0x44')];_0x253df1+=0x1){let _0x14fa8f=_0x4dda61[_0x253df1];for(var _0x43f9d6=0x0;_0x43f9d6<_0x14fa8f[_0x3565('0x71')][_0x3565('0x44')];_0x43f9d6+=0x1){let _0x12b10f=_0x14fa8f[_0x3565('0x71')][_0x43f9d6];var _0x3da783=_0x4769bb[_0x3565('0x5c')]();_0x3da783['where'](_0x3565('0x87'),_0x12b10f['id']);_0x43b11f[_0x3565('0x88')](db[_0x3565('0x78')][_0x3565('0x3d')](_0x3da783['toString'](),{'type':db[_0x3565('0x78')][_0x3565('0x89')][_0x3565('0x8a')]})[_0x3565('0x27')](function(_0x14e9ff){if(_0x14e9ff[_0x3565('0x44')]===0x1){return _0x12b10f['id'];}else{var _0xf1ce20=_[_0x3565('0x8b')](_[_0x3565('0x2f')](_0x14e9ff,_0x3565('0x8c')),function(_0x810b14){return _['includes'](_0x4100af,_0x810b14);});if(_0xf1ce20){return _0x12b10f['id'];}}}));}}return BPromise[_0x3565('0x8d')](_0x43b11f)[_0x3565('0x27')](function(_0x451190){_0x51b316=_(_0x51b316)['union'](_0x451190)[_0x3565('0x8e')]()['value']();return db['VoiceQueue'][_0x3565('0x32')]({'where':{'id':_0x34e7cb[_0x3565('0x53')]['id']}})[_0x3565('0x27')](function(_0x1ca727){return db[_0x3565('0x78')][_0x3565('0x8f')](function(_0x53c554){return _0x1ca727[_0x3565('0x90')](_0x34e7cb[_0x3565('0x3d')]['ids'],{'transaction':_0x53c554})['then'](function(){if(!_[_0x3565('0x91')](_0x51b316)){return _0x1ca727[_0x3565('0x92')](_0x51b316,{'transaction':_0x53c554})[_0x3565('0x27')](function(){return db[_0x3565('0x7b')][_0x3565('0x28')]({'where':{'VoiceQueueId':_0x34e7cb[_0x3565('0x53')]['id'],'UserId':_0x51b316},'transaction':_0x53c554});});}})[_0x3565('0x27')](function(){_0x51b316[_0x3565('0x76')](function(_0x254a09){socket[_0x3565('0x7e')]('userVoiceQueue:remove',{'UserId':_0x254a09,'VoiceQueueId':_0x1ca727['id']});});});});});});})[_0x3565('0x27')](respondWithStatusCode(_0x4da9a6,null))[_0x3565('0x51')](handleError(_0x4da9a6,null));};exports[_0x3565('0x93')]=function(_0x112121,_0x36da0f,_0x54bcd2){var _0x1cf473,_0x5b2f86;return db[_0x3565('0x39')][_0x3565('0x32')]({'where':{'id':_0x112121['params']['id']}})[_0x3565('0x27')](handleEntityNotFound(_0x36da0f,null))[_0x3565('0x27')](function(_0xb9b96){if(_0xb9b96){_0x5b2f86=_0xb9b96;return _0xb9b96['addAgents'](_0x112121[_0x3565('0x55')][_0x3565('0x94')],_['omit'](_0x112121['body'],[_0x3565('0x94'),'id'])||{})['spread'](function(_0x566363){for(var _0x3ccd71=0x0;_0x3ccd71<_0x112121['body'][_0x3565('0x94')][_0x3565('0x44')];_0x3ccd71+=0x1){socket['emit'](_0x3565('0x7f'),{'UserId':Number(_0x112121[_0x3565('0x55')][_0x3565('0x94')][_0x3ccd71]),'VoiceQueueId':Number(_0x112121[_0x3565('0x53')]['id'])});}return _0x566363;});}})[_0x3565('0x27')](function(_0x337124){_0x1cf473=_0x337124||[];if(_0x5b2f86){return db[_0x3565('0x70')][_0x3565('0x4f')]({'where':{'id':_0x112121[_0x3565('0x55')][_0x3565('0x94')]},'attributes':['id',_0x3565('0x34'),'online',_0x3565('0x73'),'interface'],'raw':!![]});}})[_0x3565('0x27')](function(_0x494217){if(!_[_0x3565('0x91')](_0x494217)){var _0x10e62a=[];for(var _0x33f1de=0x0;_0x33f1de<_0x494217['length'];_0x33f1de++){if(_0x494217[_0x33f1de]['online']){_0x10e62a['push'](db[_0x3565('0x7b')][_0x3565('0x95')]({'membername':_0x494217[_0x33f1de][_0x3565('0x34')],'UserId':_0x494217[_0x33f1de]['id'],'queue_name':_0x5b2f86['name'],'VoiceQueueId':_0x5b2f86['id'],'interface':_['isNil'](_0x494217[_0x33f1de]['interface'])?util[_0x3565('0x7c')](_0x3565('0x7d'),_0x494217[_0x33f1de]['name']):_0x494217[_0x33f1de][_0x3565('0x74')],'paused':_0x494217[_0x33f1de]['voicePause']||![],'penalty':_0x112121[_0x3565('0x55')]['penalty']||0x0}));}}return BPromise[_0x3565('0x8d')](_0x10e62a);}})[_0x3565('0x27')](function(){return _0x1cf473;})[_0x3565('0x27')](respondWithResult(_0x36da0f,null))['catch'](handleError(_0x36da0f,null));};exports[_0x3565('0x92')]=function(_0x44fde2,_0x41df43,_0xfc38e0){return db[_0x3565('0x39')]['find']({'where':{'id':_0x44fde2[_0x3565('0x53')]['id']}})['then'](handleEntityNotFound(_0x41df43,null))[_0x3565('0x27')](function(_0x5372e5){if(_0x5372e5){return _0x5372e5[_0x3565('0x92')](_0x44fde2['query'][_0x3565('0x94')])[_0x3565('0x27')](function(){if(_[_0x3565('0x96')](_0x44fde2['query']['ids'])){for(var _0x1e3f82=0x0;_0x1e3f82<_0x44fde2[_0x3565('0x3d')]['ids']['length'];_0x1e3f82+=0x1){socket[_0x3565('0x7e')](_0x3565('0x97'),{'UserId':Number(_0x44fde2[_0x3565('0x3d')]['ids'][_0x1e3f82]),'VoiceQueueId':Number(_0x44fde2[_0x3565('0x53')]['id'])});}}else{socket['emit'](_0x3565('0x97'),{'UserId':Number(_0x44fde2[_0x3565('0x3d')][_0x3565('0x94')]),'VoiceQueueId':Number(_0x44fde2['params']['id'])});}});}})[_0x3565('0x27')](function(_0x1d22b3){return db[_0x3565('0x7b')][_0x3565('0x28')]({'where':{'VoiceQueueId':_0x44fde2[_0x3565('0x53')]['id'],'UserId':_0x44fde2[_0x3565('0x3d')][_0x3565('0x94')]}})['then'](function(){return _0x1d22b3;});})['then'](respondWithStatusCode(_0x41df43,null))['catch'](handleError(_0x41df43,null));};exports['getAgents']=function(_0x2d3de2,_0x1f6faf,_0x2cff18){var _0x2b4f36={};var _0x97e9dd={};var _0xb893de;var _0xf352b1;return db[_0x3565('0x39')][_0x3565('0x63')]({'where':{'id':_0x2d3de2[_0x3565('0x53')]['id']}})['then'](handleEntityNotFound(_0x1f6faf,null))['then'](function(_0x318e28){if(_0x318e28){_0xb893de=_0x318e28;_0x97e9dd[_0x3565('0x41')]=_[_0x3565('0x3e')](db[_0x3565('0x70')][_0x3565('0x3a')]);_0x97e9dd['query']=_['keys'](_0x2d3de2[_0x3565('0x3d')]);_0x97e9dd['filters']=_[_0x3565('0x40')](_0x97e9dd[_0x3565('0x41')],_0x97e9dd[_0x3565('0x3d')]);_0x2b4f36[_0x3565('0x42')]=_['intersection'](_0x97e9dd['model'],qs['fields'](_0x2d3de2[_0x3565('0x3d')][_0x3565('0x43')]));_0x2b4f36[_0x3565('0x42')]=_0x2b4f36['attributes'][_0x3565('0x44')]?_0x2b4f36[_0x3565('0x42')]:_0x97e9dd['model'];_0x2b4f36['order']=qs[_0x3565('0x48')](_0x2d3de2[_0x3565('0x3d')][_0x3565('0x48')]);_0x2b4f36[_0x3565('0x49')]=qs[_0x3565('0x3f')](_['pick'](_0x2d3de2['query'],_0x97e9dd[_0x3565('0x3f')]));if(_0x2d3de2[_0x3565('0x3d')]['filter']){_0x2b4f36[_0x3565('0x49')]=_[_0x3565('0x4a')](_0x2b4f36[_0x3565('0x49')],{'$or':_[_0x3565('0x2f')](_0x2b4f36['attributes'],function(_0x399676){var _0x472115={};_0x472115[_0x399676]={'$like':'%'+_0x2d3de2[_0x3565('0x3d')][_0x3565('0x2d')]+'%'};return _0x472115;})});}_0x2b4f36=_[_0x3565('0x4a')]({},_0x2b4f36,_0x2d3de2['options']);return _0xb893de[_0x3565('0x98')](_0x2b4f36);}})[_0x3565('0x27')](function(_0x40c292){if(_0x40c292){_0xf352b1=_0x40c292[_0x3565('0x44')];if(!_0x2d3de2[_0x3565('0x3d')][_0x3565('0x64')](_0x3565('0x45'))){_0x2b4f36['limit']=qs[_0x3565('0x46')](_0x2d3de2['query'][_0x3565('0x46')]);_0x2b4f36[_0x3565('0x22')]=qs[_0x3565('0x22')](_0x2d3de2[_0x3565('0x3d')][_0x3565('0x22')]);}return _0xb893de[_0x3565('0x98')](_0x2b4f36);}})['then'](function(_0x25f79a){if(_0x25f79a){return _0x25f79a?{'count':_0xf352b1,'rows':_0x25f79a}:null;}})['then'](respondWithResult(_0x1f6faf,null))[_0x3565('0x51')](handleError(_0x1f6faf,null));};exports[_0x3565('0x99')]=function(_0x1b3b65,_0xd29aa3,_0x569bd2){var _0x354a79={};var _0x14abf1={};var _0x4ab1c6;var _0x5b1c19;return db[_0x3565('0x39')][_0x3565('0x63')]({'where':{'id':_0x1b3b65['params']['id']}})[_0x3565('0x27')](handleEntityNotFound(_0xd29aa3,null))[_0x3565('0x27')](function(_0x1b62ca){if(_0x1b62ca){_0x4ab1c6=_0x1b62ca;_0x14abf1[_0x3565('0x41')]=_[_0x3565('0x3e')](db[_0x3565('0x7b')][_0x3565('0x3a')]);_0x14abf1[_0x3565('0x3d')]=_[_0x3565('0x3e')](_0x1b3b65['query']);_0x14abf1[_0x3565('0x3f')]=_[_0x3565('0x40')](_0x14abf1['model'],_0x14abf1['query']);_0x354a79[_0x3565('0x42')]=_[_0x3565('0x40')](_0x14abf1[_0x3565('0x41')],qs[_0x3565('0x43')](_0x1b3b65[_0x3565('0x3d')][_0x3565('0x43')]));_0x354a79['attributes']=_0x354a79['attributes'][_0x3565('0x44')]?_0x354a79['attributes']:_0x14abf1[_0x3565('0x41')];_0x354a79[_0x3565('0x47')]=qs[_0x3565('0x48')](_0x1b3b65[_0x3565('0x3d')][_0x3565('0x48')]);_0x354a79['where']=qs[_0x3565('0x3f')](_[_0x3565('0x6a')](_0x1b3b65['query'],_0x14abf1['filters']));if(_0x1b3b65['query'][_0x3565('0x2d')]){_0x354a79[_0x3565('0x49')]=_[_0x3565('0x4a')](_0x354a79[_0x3565('0x49')],{'$or':_[_0x3565('0x2f')](_0x354a79['attributes'],function(_0x4fe422){var _0x296a8b={};_0x296a8b[_0x4fe422]={'$like':'%'+_0x1b3b65[_0x3565('0x3d')]['filter']+'%'};return _0x296a8b;})});}_0x354a79=_[_0x3565('0x4a')]({},_0x354a79,_0x1b3b65[_0x3565('0x4c')]);return _0x4ab1c6[_0x3565('0x99')](_0x354a79);}})[_0x3565('0x27')](function(_0x5678d6){if(_0x5678d6){_0x5b1c19=_0x5678d6['length'];if(!_0x1b3b65[_0x3565('0x3d')][_0x3565('0x64')](_0x3565('0x45'))){_0x354a79['limit']=qs[_0x3565('0x46')](_0x1b3b65['query'][_0x3565('0x46')]);_0x354a79[_0x3565('0x22')]=qs[_0x3565('0x22')](_0x1b3b65['query']['offset']);}return _0x4ab1c6[_0x3565('0x99')](_0x354a79);}})['then'](function(_0x37b75d){return _0x37b75d?{'count':_0x5b1c19,'rows':_0x37b75d}:null;})[_0x3565('0x27')](respondWithResult(_0xd29aa3,null))[_0x3565('0x51')](handleError(_0xd29aa3,null));};exports[_0x3565('0x9a')]=function(_0x24aed5,_0x36d4ee,_0x4de3f8){var _0x306096={};var _0x5c6b7b={};var _0x2caa81;var _0x4f8270;return db[_0x3565('0x39')]['findOne']({'where':{'id':_0x24aed5[_0x3565('0x53')]['id']}})[_0x3565('0x27')](handleEntityNotFound(_0x36d4ee,null))[_0x3565('0x27')](function(_0x298541){if(_0x298541){_0x2caa81=_0x298541;_0x5c6b7b[_0x3565('0x41')]=_['keys'](db[_0x3565('0x9b')][_0x3565('0x3a')]);_0x5c6b7b['query']=_[_0x3565('0x3e')](_0x24aed5[_0x3565('0x3d')]);_0x5c6b7b[_0x3565('0x3f')]=_[_0x3565('0x40')](_0x5c6b7b[_0x3565('0x41')],_0x5c6b7b[_0x3565('0x3d')]);_0x306096['attributes']=_['intersection'](_0x5c6b7b[_0x3565('0x41')],qs[_0x3565('0x43')](_0x24aed5[_0x3565('0x3d')][_0x3565('0x43')]));_0x306096[_0x3565('0x42')]=_0x306096['attributes'][_0x3565('0x44')]?_0x306096[_0x3565('0x42')]:_0x5c6b7b[_0x3565('0x41')];_0x306096[_0x3565('0x47')]=qs[_0x3565('0x48')](_0x24aed5[_0x3565('0x3d')]['sort']);_0x306096['where']=qs['filters'](_['pick'](_0x24aed5[_0x3565('0x3d')],_0x5c6b7b[_0x3565('0x3f')]));if(_0x24aed5[_0x3565('0x3d')][_0x3565('0x2d')]){_0x306096[_0x3565('0x49')]=_[_0x3565('0x4a')](_0x306096['where'],{'$or':_[_0x3565('0x2f')](_0x306096[_0x3565('0x42')],function(_0xdb2c96){var _0x40ec67={};_0x40ec67[_0xdb2c96]={'$like':'%'+_0x24aed5[_0x3565('0x3d')][_0x3565('0x2d')]+'%'};return _0x40ec67;})});}_0x306096=_[_0x3565('0x4a')]({},_0x306096,_0x24aed5[_0x3565('0x4c')]);return _0x2caa81[_0x3565('0x9a')](_0x306096);}})[_0x3565('0x27')](function(_0x491256){if(_0x491256){_0x4f8270=_0x491256[_0x3565('0x44')];if(!_0x24aed5[_0x3565('0x3d')][_0x3565('0x64')](_0x3565('0x45'))){_0x306096[_0x3565('0x46')]=qs['limit'](_0x24aed5['query']['limit']);_0x306096[_0x3565('0x22')]=qs['offset'](_0x24aed5['query'][_0x3565('0x22')]);}return _0x2caa81['getLists'](_0x306096);}})[_0x3565('0x27')](function(_0x4f2d75){if(_0x4f2d75){return _0x4f2d75?{'count':_0x4f8270,'rows':_0x4f2d75}:null;}})[_0x3565('0x27')](respondWithResult(_0x36d4ee,null))[_0x3565('0x51')](handleError(_0x36d4ee,null));};exports[_0x3565('0x9c')]=function(_0x3c525d,_0x24506c,_0x14981c){var _0x513e4d,_0x6c53ac;return db['VoiceQueue'][_0x3565('0x32')]({'where':{'id':_0x3c525d['params']['id']}})[_0x3565('0x27')](handleEntityNotFound(_0x24506c,null))[_0x3565('0x27')](function(_0x2f134b){if(_0x2f134b){_0x6c53ac=_0x2f134b;return _0x2f134b[_0x3565('0x9c')](_0x3c525d[_0x3565('0x55')]['ids'],_[_0x3565('0x5e')](_0x3c525d[_0x3565('0x55')],[_0x3565('0x94'),'id'])||{});}return null;})['spread'](function(_0x3b759f){var _0x8ddcc5;_0x513e4d=_0x3b759f||[];var _0x4504f0=[];if(_0x3b759f){for(var _0x4da92d=0x0;_0x4da92d<_0x3b759f[_0x3565('0x44')];_0x4da92d+=0x1){var _0x4fd561=_0x3b759f[_0x4da92d]['get']({'plain':!![]});_0x6c53ac[_0x3565('0x9d')]=_0x3c525d['body']['dialCheckDuplicateType']?_0x3c525d[_0x3565('0x55')][_0x3565('0x9d')]:_0x6c53ac['dialCheckDuplicateType'];switch(_0x6c53ac[_0x3565('0x9d')]){case _0x3565('0x9e'):_0x8ddcc5=squel['insert']()[_0x3565('0x9f')]('cm_hopper')[_0x3565('0xa0')]([_0x3565('0xa1'),_0x3565('0xa2'),_0x3565('0xa3'),'ListId',_0x3565('0x65'),_0x3565('0x5d'),_0x3565('0x5f')],squel[_0x3565('0xa4')]()[_0x3565('0xa5')](_0x3565('0xa1'),_0x3565('0xa1'))[_0x3565('0xa5')](_0x3565('0xa6'),_0x3565('0xa2'))[_0x3565('0xa5')]('id',_0x3565('0xa3'))[_0x3565('0xa5')](_0x4fd561[_0x3565('0xa7')][_0x3565('0xa8')](),_0x3565('0xa9'))[_0x3565('0xa5')](_0x3c525d[_0x3565('0x53')]['id'][_0x3565('0xa8')](),_0x3565('0x65'))[_0x3565('0xa5')](_0x3565('0xa6'),_0x3565('0x5d'))[_0x3565('0xa5')](_0x3565('0xa6'),_0x3565('0x5f'))[_0x3565('0x81')](_0x3565('0xaa'))[_0x3565('0x49')]('deletedAt\x20IS\x20NULL')['where'](_0x3565('0xab'),_0x4fd561[_0x3565('0xa7')][_0x3565('0xa8')]())[_0x3565('0x49')](_0x3565('0xac'))['where'](_0x3565('0xad'),squel['select']()[_0x3565('0xa5')]('COALESCE(calleridnum,\x27\x27)')[_0x3565('0x81')](_0x3565('0xae'))[_0x3565('0x49')](_0x3565('0x86'),_0x3c525d[_0x3565('0x53')]['id'][_0x3565('0xa8')]()))['where'](_0x3565('0xad'),squel['select']()[_0x3565('0xa5')](_0x3565('0xaf'))[_0x3565('0x81')](_0x3565('0xb0'))[_0x3565('0x49')]('VoiceQueueId\x20=\x20?',_0x3c525d[_0x3565('0x53')]['id'][_0x3565('0xa8')]())))['toString']();break;case _0x3565('0xb1'):_0x8ddcc5=squel[_0x3565('0xb2')]()[_0x3565('0x9f')](_0x3565('0xb0'))['fromQuery']([_0x3565('0xa1'),_0x3565('0xa2'),_0x3565('0xa3'),_0x3565('0xa9'),_0x3565('0x65'),'createdAt','updatedAt'],squel[_0x3565('0xa4')]()[_0x3565('0xa5')](_0x3565('0xa1'),_0x3565('0xa1'))[_0x3565('0xa5')](_0x3565('0xa6'),_0x3565('0xa2'))['field']('id',_0x3565('0xa3'))[_0x3565('0xa5')](_0x4fd561[_0x3565('0xa7')][_0x3565('0xa8')](),_0x3565('0xa9'))[_0x3565('0xa5')](_0x3c525d['params']['id'][_0x3565('0xa8')](),_0x3565('0x65'))[_0x3565('0xa5')](_0x3565('0xa6'),_0x3565('0x5d'))['field'](_0x3565('0xa6'),_0x3565('0x5f'))[_0x3565('0x81')](_0x3565('0xaa'))[_0x3565('0x49')](_0x3565('0xb3'))[_0x3565('0x49')](_0x3565('0xab'),_0x4fd561[_0x3565('0xa7')][_0x3565('0xa8')]())[_0x3565('0x49')](_0x3565('0xac'))[_0x3565('0x49')](_0x3565('0xad'),squel[_0x3565('0xa4')]()['field'](_0x3565('0xaf'))['from']('cm_hopper')[_0x3565('0x49')](_0x3565('0x86'),_0x3c525d[_0x3565('0x53')]['id'][_0x3565('0xa8')]())))[_0x3565('0xa8')]();break;default:_0x8ddcc5=squel['insert']()['into'](_0x3565('0xb0'))[_0x3565('0xa0')]([_0x3565('0xa1'),'scheduledAt','ContactId',_0x3565('0xa9'),'VoiceQueueId',_0x3565('0x5d'),'updatedAt'],squel['select']()[_0x3565('0xa5')](_0x3565('0xa1'),_0x3565('0xa1'))[_0x3565('0xa5')](_0x3565('0xa6'),_0x3565('0xa2'))[_0x3565('0xa5')]('id',_0x3565('0xa3'))[_0x3565('0xa5')](_0x4fd561['CmListId'][_0x3565('0xa8')](),_0x3565('0xa9'))['field'](_0x3c525d[_0x3565('0x53')]['id']['toString'](),_0x3565('0x65'))[_0x3565('0xa5')](_0x3565('0xa6'),_0x3565('0x5d'))['field'](_0x3565('0xa6'),_0x3565('0x5f'))[_0x3565('0x81')](_0x3565('0xaa'))['where'](_0x3565('0xb3'))[_0x3565('0x49')](_0x3565('0xab'),_0x4fd561[_0x3565('0xa7')][_0x3565('0xa8')]())[_0x3565('0x49')]('phone\x20IS\x20NOT\x20NULL'))['toString']();}_0x4504f0[_0x3565('0x88')](db[_0x3565('0x78')][_0x3565('0x3d')](_0x8ddcc5));}return BPromise['all'](_0x4504f0);}})[_0x3565('0x27')](function(){return _0x513e4d;})[_0x3565('0x27')](respondWithResult(_0x24506c,null))[_0x3565('0x51')](handleError(_0x24506c,null));};exports[_0x3565('0xb4')]=function(_0x1326e6,_0x17c735,_0x4fcd51){return db[_0x3565('0x39')]['find']({'where':{'id':_0x1326e6[_0x3565('0x53')]['id']}})[_0x3565('0x27')](handleEntityNotFound(_0x17c735,null))['then'](function(_0x1fc8ac){if(_0x1fc8ac){return _0x1fc8ac[_0x3565('0xb4')](_0x1326e6[_0x3565('0x3d')]['ids']);}})['then'](function(_0x16e38e){if(_0x16e38e){return db[_0x3565('0x66')][_0x3565('0x28')]({'where':{'ListId':_0x1326e6[_0x3565('0x3d')][_0x3565('0x94')],'VoiceQueueId':_0x1326e6[_0x3565('0x53')]['id']}})[_0x3565('0x27')](function(){return _0x16e38e;});}})[_0x3565('0x27')](respondWithStatusCode(_0x17c735,null))['catch'](handleError(_0x17c735,null));};exports[_0x3565('0xb5')]=function(_0x4c50d4,_0x2f16ce,_0x2e1114){var _0x5e713a={};var _0x5e8f26={};var _0x1edf34;var _0x333132;return db['VoiceQueue'][_0x3565('0x63')]({'where':{'id':_0x4c50d4[_0x3565('0x53')]['id']}})[_0x3565('0x27')](handleEntityNotFound(_0x2f16ce,null))[_0x3565('0x27')](function(_0x5f0c34){if(_0x5f0c34){_0x1edf34=_0x5f0c34;_0x5e8f26[_0x3565('0x41')]=_[_0x3565('0x3e')](db[_0x3565('0x9b')][_0x3565('0x3a')]);_0x5e8f26[_0x3565('0x3d')]=_['keys'](_0x4c50d4[_0x3565('0x3d')]);_0x5e8f26[_0x3565('0x3f')]=_[_0x3565('0x40')](_0x5e8f26['model'],_0x5e8f26[_0x3565('0x3d')]);_0x5e713a[_0x3565('0x42')]=_[_0x3565('0x40')](_0x5e8f26[_0x3565('0x41')],qs[_0x3565('0x43')](_0x4c50d4[_0x3565('0x3d')][_0x3565('0x43')]));_0x5e713a[_0x3565('0x42')]=_0x5e713a[_0x3565('0x42')]['length']?_0x5e713a[_0x3565('0x42')]:_0x5e8f26[_0x3565('0x41')];_0x5e713a[_0x3565('0x47')]=qs[_0x3565('0x48')](_0x4c50d4[_0x3565('0x3d')][_0x3565('0x48')]);_0x5e713a['where']=qs['filters'](_[_0x3565('0x6a')](_0x4c50d4[_0x3565('0x3d')],_0x5e8f26['filters']));if(_0x4c50d4[_0x3565('0x3d')][_0x3565('0x2d')]){_0x5e713a[_0x3565('0x49')]=_[_0x3565('0x4a')](_0x5e713a[_0x3565('0x49')],{'$or':_[_0x3565('0x2f')](_0x5e713a[_0x3565('0x42')],function(_0x3705b9){var _0x250b97={};_0x250b97[_0x3705b9]={'$like':'%'+_0x4c50d4[_0x3565('0x3d')][_0x3565('0x2d')]+'%'};return _0x250b97;})});}_0x5e713a=_[_0x3565('0x4a')]({},_0x5e713a,_0x4c50d4[_0x3565('0x4c')]);return _0x1edf34[_0x3565('0xb5')](_0x5e713a);}})[_0x3565('0x27')](function(_0x550aab){if(_0x550aab){_0x333132=_0x550aab[_0x3565('0x44')];if(!_0x4c50d4[_0x3565('0x3d')][_0x3565('0x64')](_0x3565('0x45'))){_0x5e713a[_0x3565('0x46')]=qs[_0x3565('0x46')](_0x4c50d4[_0x3565('0x3d')]['limit']);_0x5e713a['offset']=qs['offset'](_0x4c50d4['query'][_0x3565('0x22')]);}return _0x1edf34[_0x3565('0xb5')](_0x5e713a);}})[_0x3565('0x27')](function(_0x20618c){if(_0x20618c){return _0x20618c?{'count':_0x333132,'rows':_0x20618c}:null;}})[_0x3565('0x27')](respondWithResult(_0x2f16ce,null))[_0x3565('0x51')](handleError(_0x2f16ce,null));};exports[_0x3565('0xb6')]=function(_0x2218e8,_0x23bd5f,_0x17dcbf){var _0x30b080,_0xdbb9b7;return db[_0x3565('0x39')][_0x3565('0x32')]({'where':{'id':_0x2218e8[_0x3565('0x53')]['id']}})['then'](handleEntityNotFound(_0x23bd5f,null))[_0x3565('0x27')](function(_0x229efb){if(_0x229efb){_0xdbb9b7=_0x229efb;return _0x229efb[_0x3565('0xb6')](_0x2218e8[_0x3565('0x55')][_0x3565('0x94')],_[_0x3565('0x5e')](_0x2218e8[_0x3565('0x55')],[_0x3565('0x94'),'id'])||{});}return null;})[_0x3565('0xb7')](function(_0x4a8a03){var _0xd4e74d;_0x30b080=_0x4a8a03||[];var _0x2022fc=[];if(_0x4a8a03){for(var _0x17a1cd=0x0;_0x17a1cd<_0x4a8a03['length'];_0x17a1cd+=0x1){var _0x34805d=_0x4a8a03[_0x17a1cd]['get']({'plain':!![]});_0xd4e74d=squel[_0x3565('0xb2')]()[_0x3565('0x9f')](_0x3565('0xb8'))['fromQuery']([_0x3565('0xa1'),_0x3565('0xa3'),_0x3565('0xa9'),_0x3565('0x65'),_0x3565('0x5d'),_0x3565('0x5f')],squel['select']()[_0x3565('0xa5')](_0x3565('0xa1'),_0x3565('0xa1'))['field']('id',_0x3565('0xa3'))[_0x3565('0xa5')](_0x34805d[_0x3565('0xa7')][_0x3565('0xa8')](),'ListId')['field'](_0x2218e8[_0x3565('0x53')]['id'][_0x3565('0xa8')](),_0x3565('0x65'))[_0x3565('0xa5')]('NOW()','createdAt')[_0x3565('0xa5')]('NOW()',_0x3565('0x5f'))[_0x3565('0x81')]('cm_contacts')[_0x3565('0x49')](_0x3565('0xb3'))[_0x3565('0x49')](_0x3565('0xab'),_0x34805d['CmListId']['toString']())[_0x3565('0x49')](_0x3565('0xac')))[_0x3565('0xa8')]();_0x2022fc[_0x3565('0x88')](db[_0x3565('0x78')]['query'](_0xd4e74d));}return BPromise[_0x3565('0x8d')](_0x2022fc);}})[_0x3565('0x27')](function(){return _0x30b080;})[_0x3565('0x27')](respondWithResult(_0x23bd5f,null))[_0x3565('0x51')](handleError(_0x23bd5f,null));};exports[_0x3565('0xb9')]=function(_0x2a5d89,_0x1f2b0a,_0x110dad){return db[_0x3565('0x39')]['find']({'where':{'id':_0x2a5d89[_0x3565('0x53')]['id']}})[_0x3565('0x27')](handleEntityNotFound(_0x1f2b0a,null))[_0x3565('0x27')](function(_0x470b0d){if(_0x470b0d){return _0x470b0d['removeBlackLists'](_0x2a5d89['query'][_0x3565('0x94')]);}})[_0x3565('0x27')](function(_0x507333){if(_0x507333){return db[_0x3565('0x6c')][_0x3565('0x28')]({'where':{'ListId':_0x2a5d89[_0x3565('0x3d')][_0x3565('0x94')],'VoiceQueueId':_0x2a5d89['params']['id']}})['then'](function(){return _0x507333;});}})[_0x3565('0x27')](respondWithStatusCode(_0x1f2b0a,null))[_0x3565('0x51')](handleError(_0x1f2b0a,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 7040909..9b4b3f0 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 _0x7d91=['emit','hook','exports','events','../../mysqldb','save','update'];(function(_0x2248c0,_0x523a1a){var _0x449b60=function(_0x41a698){while(--_0x41a698){_0x2248c0['push'](_0x2248c0['shift']());}};_0x449b60(++_0x523a1a);}(_0x7d91,0x130));var _0x17d9=function(_0x5518ff,_0x1a4afa){_0x5518ff=_0x5518ff-0x0;var _0x5547ee=_0x7d91[_0x5518ff];return _0x5547ee;};'use strict';var EventEmitter=require(_0x17d9('0x0'));var VoiceQueue=require(_0x17d9('0x1'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x17d9('0x2'),'afterUpdate':_0x17d9('0x3'),'afterDestroy':'remove'};function emitEvent(_0x52cc5d){return function(_0x30c170,_0x296d48,_0x4928ab){VoiceQueueEvents['emit'](_0x52cc5d+':'+_0x30c170['id'],_0x30c170);VoiceQueueEvents[_0x17d9('0x4')](_0x52cc5d,_0x30c170);_0x4928ab(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue[_0x17d9('0x5')](e,emitEvent(event));}}module[_0x17d9('0x6')]=VoiceQueueEvents; \ No newline at end of file +var _0x1382=['hook','exports','VoiceQueue','setMaxListeners','remove','emit','hasOwnProperty'];(function(_0x80c3ab,_0x3eaf75){var _0x112dfa=function(_0x69ef7c){while(--_0x69ef7c){_0x80c3ab['push'](_0x80c3ab['shift']());}};_0x112dfa(++_0x3eaf75);}(_0x1382,0x191));var _0x2138=function(_0x204c27,_0x4f1779){_0x204c27=_0x204c27-0x0;var _0x466cb1=_0x1382[_0x204c27];return _0x466cb1;};'use strict';var EventEmitter=require('events');var VoiceQueue=require('../../mysqldb')['db'][_0x2138('0x0')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x2138('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x2138('0x2')};function emitEvent(_0x465b17){return function(_0x243961,_0x7f898,_0x167f63){VoiceQueueEvents[_0x2138('0x3')](_0x465b17+':'+_0x243961['id'],_0x243961);VoiceQueueEvents['emit'](_0x465b17,_0x243961);_0x167f63(null);};}for(var e in events){if(events[_0x2138('0x4')](e)){var event=events[e];VoiceQueue[_0x2138('0x5')](e,emitEvent(event));}}module[_0x2138('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 437d176..5a104e8 100644 --- a/server/api/voiceQueue/voiceQueue.model.js +++ b/server/api/voiceQueue/voiceQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x008c=['define','voice_queues','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./voiceQueue.attributes','exports'];(function(_0x5746a1,_0x11eab1){var _0x551a43=function(_0x7ddcbe){while(--_0x7ddcbe){_0x5746a1['push'](_0x5746a1['shift']());}};_0x551a43(++_0x11eab1);}(_0x008c,0x188));var _0xc008=function(_0x44e5f6,_0x1cdb43){_0x44e5f6=_0x44e5f6-0x0;var _0x350e0e=_0x008c[_0x44e5f6];return _0x350e0e;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var logger=require(_0xc008('0x2'))(_0xc008('0x3'));var moment=require(_0xc008('0x4'));var BPromise=require('bluebird');var rp=require(_0xc008('0x5'));var fs=require('fs');var path=require(_0xc008('0x6'));var rimraf=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var attributes=require(_0xc008('0x9'));module[_0xc008('0xa')]=function(_0x13aa7,_0x39bb5e){return _0x13aa7[_0xc008('0xb')]('VoiceQueue',attributes,{'tableName':_0xc008('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x70e0=['voice_queues','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','./voiceQueue.attributes'];(function(_0x10bfd7,_0x38dd2d){var _0x4a1015=function(_0x513232){while(--_0x513232){_0x10bfd7['push'](_0x10bfd7['shift']());}};_0x4a1015(++_0x38dd2d);}(_0x70e0,0x17b));var _0x070e=function(_0x2c9b01,_0x1f3393){_0x2c9b01=_0x2c9b01-0x0;var _0xe87e5d=_0x70e0[_0x2c9b01];return _0xe87e5d;};'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 diff --git a/server/api/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js index 95d2972..878664a 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 _0x7432=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./voiceQueue.socket','register','request','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','VoiceQueue','findAll','options','raw','where','include','map','attributes','model','GetVoiceQueue','ShowVoiceQueue','find','util','ioredis','../../mysqldb','../../config/utils'];(function(_0x45b663,_0x1f9910){var _0x390b7c=function(_0x42dd5f){while(--_0x42dd5f){_0x45b663['push'](_0x45b663['shift']());}};_0x390b7c(++_0x1f9910);}(_0x7432,0x1ea));var _0x2743=function(_0x5729b8,_0x2e7e48){_0x5729b8=_0x5729b8-0x0;var _0xd8db8e=_0x7432[_0x5729b8];return _0xd8db8e;};'use strict';var _=require('lodash');var util=require(_0x2743('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2743('0x1'));var db=require(_0x2743('0x2'))['db'];var utils=require(_0x2743('0x3'));var logger=require(_0x2743('0x4'))(_0x2743('0x5'));var config=require(_0x2743('0x6'));var jayson=require(_0x2743('0x7'));var client=jayson[_0x2743('0x8')][_0x2743('0x9')]({'port':0x232a});config[_0x2743('0xa')]=_['defaults'](config['redis'],{'host':_0x2743('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2743('0xa')]));require(_0x2743('0xc'))[_0x2743('0xd')](socket);function respondWithRpcPromise(_0x44d277,_0x4dd562,_0x2e458f){return new BPromise(function(_0x49ff2d,_0x3072ef){return client[_0x2743('0xe')](_0x44d277,_0x2e458f)[_0x2743('0xf')](function(_0x172c51){logger[_0x2743('0x10')](_0x2743('0x11'),_0x4dd562,_0x2743('0x12'));logger[_0x2743('0x13')]('VoiceQueue,\x20%s,\x20%s,\x20%s',_0x4dd562,_0x2743('0x12'),JSON[_0x2743('0x14')](_0x172c51));if(_0x172c51[_0x2743('0x15')]){if(_0x172c51[_0x2743('0x15')][_0x2743('0x16')]===0x1f4){logger[_0x2743('0x15')](_0x2743('0x11'),_0x4dd562,_0x172c51['error'][_0x2743('0x17')]);return _0x3072ef(_0x172c51[_0x2743('0x15')][_0x2743('0x17')]);}logger['error'](_0x2743('0x11'),_0x4dd562,_0x172c51[_0x2743('0x15')][_0x2743('0x17')]);return _0x49ff2d(_0x172c51[_0x2743('0x15')][_0x2743('0x17')]);}else{logger[_0x2743('0x10')](_0x2743('0x11'),_0x4dd562,_0x2743('0x12'));_0x49ff2d(_0x172c51[_0x2743('0x18')][_0x2743('0x17')]);}})[_0x2743('0x19')](function(_0x1c4115){logger[_0x2743('0x15')](_0x2743('0x11'),_0x4dd562,_0x1c4115);_0x3072ef(_0x1c4115);});});}exports['GetVoiceQueue']=function(_0x40a420){var _0x22589a=this;return new Promise(function(_0x5e1919,_0x3ec6b4){return db[_0x2743('0x1a')][_0x2743('0x1b')]({'raw':_0x40a420[_0x2743('0x1c')]?_0x40a420[_0x2743('0x1c')][_0x2743('0x1d')]===undefined?!![]:![]:!![],'where':_0x40a420[_0x2743('0x1c')]?_0x40a420[_0x2743('0x1c')][_0x2743('0x1e')]||null:null,'attributes':_0x40a420[_0x2743('0x1c')]?_0x40a420[_0x2743('0x1c')]['attributes']||null:null,'limit':_0x40a420['options']?_0x40a420['options']['limit']||null:null,'include':_0x40a420[_0x2743('0x1c')]?_0x40a420['options'][_0x2743('0x1f')]?_[_0x2743('0x20')](_0x40a420[_0x2743('0x1c')][_0x2743('0x1f')],function(_0xed5f08){return{'model':db[_0xed5f08['model']],'as':_0xed5f08['as'],'attributes':_0xed5f08[_0x2743('0x21')],'include':_0xed5f08['include']?_[_0x2743('0x20')](_0xed5f08[_0x2743('0x1f')],function(_0x527a0a){return{'model':db[_0x527a0a[_0x2743('0x22')]],'as':_0x527a0a['as'],'attributes':_0x527a0a[_0x2743('0x21')],'include':_0x527a0a[_0x2743('0x1f')]?_[_0x2743('0x20')](_0x527a0a[_0x2743('0x1f')],function(_0x4a5700){return{'model':db[_0x4a5700[_0x2743('0x22')]],'as':_0x4a5700['as'],'attributes':_0x4a5700[_0x2743('0x21')]};}):[]};}):[]};}):[]:[]})[_0x2743('0xf')](function(_0x39364e){logger[_0x2743('0x10')](_0x2743('0x23'),_0x40a420);logger[_0x2743('0x13')](_0x2743('0x23'),_0x40a420,JSON[_0x2743('0x14')](_0x39364e));_0x5e1919(_0x39364e);})['catch'](function(_0x329fde){logger[_0x2743('0x15')](_0x2743('0x23'),_0x329fde[_0x2743('0x17')],_0x40a420);_0x3ec6b4(_0x22589a['error'](0x1f4,_0x329fde['message']));});});};exports[_0x2743('0x24')]=function(_0x15ae2e){var _0x19c16b=this;return new Promise(function(_0x2fe491,_0x56a0bf){return db[_0x2743('0x1a')][_0x2743('0x25')]({'raw':_0x15ae2e[_0x2743('0x1c')]?_0x15ae2e['options'][_0x2743('0x1d')]===undefined?!![]:![]:!![],'where':_0x15ae2e['options']?_0x15ae2e[_0x2743('0x1c')][_0x2743('0x1e')]||null:null,'attributes':_0x15ae2e['options']?_0x15ae2e['options'][_0x2743('0x21')]||null:null,'include':_0x15ae2e['options']?_0x15ae2e['options'][_0x2743('0x1f')]?_[_0x2743('0x20')](_0x15ae2e[_0x2743('0x1c')][_0x2743('0x1f')],function(_0x1134b6){return{'model':db[_0x1134b6[_0x2743('0x22')]],'as':_0x1134b6['as'],'attributes':_0x1134b6[_0x2743('0x21')],'include':_0x1134b6[_0x2743('0x1f')]?_[_0x2743('0x20')](_0x1134b6['include'],function(_0x20eb82){return{'model':db[_0x20eb82[_0x2743('0x22')]],'as':_0x20eb82['as'],'attributes':_0x20eb82[_0x2743('0x21')],'include':_0x20eb82['include']?_['map'](_0x20eb82[_0x2743('0x1f')],function(_0x1814db){return{'model':db[_0x1814db[_0x2743('0x22')]],'as':_0x1814db['as'],'attributes':_0x1814db['attributes']};}):[]};}):[]};}):[]:[]})[_0x2743('0xf')](function(_0x1af154){logger['info'](_0x2743('0x24'),_0x15ae2e);logger[_0x2743('0x13')]('ShowVoiceQueue',_0x15ae2e,JSON[_0x2743('0x14')](_0x1af154));_0x2fe491(_0x1af154);})[_0x2743('0x19')](function(_0x1dbfef){logger[_0x2743('0x15')](_0x2743('0x24'),_0x1dbfef[_0x2743('0x17')],_0x15ae2e);_0x56a0bf(_0x19c16b[_0x2743('0x15')](0x1f4,_0x1dbfef[_0x2743('0x17')]));});});}; \ No newline at end of file +var _0x03db=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','./voiceQueue.socket','request','then','info','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','VoiceQueue,\x20%s,\x20%s','message','catch','VoiceQueue','findAll','options','where','attributes','limit','include','model','GetVoiceQueue','stringify','find','raw','map','ShowVoiceQueue','lodash','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x1e5e67,_0x408793){var _0x51685c=function(_0x2d98e0){while(--_0x2d98e0){_0x1e5e67['push'](_0x1e5e67['shift']());}};_0x51685c(++_0x408793);}(_0x03db,0x1e9));var _0xb03d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x03db[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb03d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xb03d('0x1'));var rs=require(_0xb03d('0x2'));var fs=require('fs');var Redis=require(_0xb03d('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb03d('0x4'));var logger=require(_0xb03d('0x5'))(_0xb03d('0x6'));var config=require(_0xb03d('0x7'));var jayson=require(_0xb03d('0x8'));var client=jayson[_0xb03d('0x9')][_0xb03d('0xa')]({'port':0x232a});config[_0xb03d('0xb')]=_[_0xb03d('0xc')](config[_0xb03d('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb03d('0xb')]));require(_0xb03d('0xd'))['register'](socket);function respondWithRpcPromise(_0xeae552,_0x215fe0,_0x3446e8){return new BPromise(function(_0x755c25,_0x5c12af){return client[_0xb03d('0xe')](_0xeae552,_0x3446e8)[_0xb03d('0xf')](function(_0x36b9be){logger[_0xb03d('0x10')]('VoiceQueue,\x20%s,\x20%s',_0x215fe0,'request\x20sent');logger[_0xb03d('0x11')](_0xb03d('0x12'),_0x215fe0,_0xb03d('0x13'),JSON['stringify'](_0x36b9be));if(_0x36b9be[_0xb03d('0x14')]){if(_0x36b9be[_0xb03d('0x14')]['code']===0x1f4){logger[_0xb03d('0x14')](_0xb03d('0x15'),_0x215fe0,_0x36b9be[_0xb03d('0x14')][_0xb03d('0x16')]);return _0x5c12af(_0x36b9be[_0xb03d('0x14')]['message']);}logger[_0xb03d('0x14')]('VoiceQueue,\x20%s,\x20%s',_0x215fe0,_0x36b9be[_0xb03d('0x14')][_0xb03d('0x16')]);return _0x755c25(_0x36b9be[_0xb03d('0x14')]['message']);}else{logger[_0xb03d('0x10')](_0xb03d('0x15'),_0x215fe0,'request\x20sent');_0x755c25(_0x36b9be['result']['message']);}})[_0xb03d('0x17')](function(_0x5c5ce3){logger[_0xb03d('0x14')](_0xb03d('0x15'),_0x215fe0,_0x5c5ce3);_0x5c12af(_0x5c5ce3);});});}exports['GetVoiceQueue']=function(_0xe90699){var _0x1178a5=this;return new Promise(function(_0x44714f,_0x2f6333){return db[_0xb03d('0x18')][_0xb03d('0x19')]({'raw':_0xe90699[_0xb03d('0x1a')]?_0xe90699[_0xb03d('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0xe90699[_0xb03d('0x1a')]?_0xe90699[_0xb03d('0x1a')][_0xb03d('0x1b')]||null:null,'attributes':_0xe90699[_0xb03d('0x1a')]?_0xe90699[_0xb03d('0x1a')][_0xb03d('0x1c')]||null:null,'limit':_0xe90699[_0xb03d('0x1a')]?_0xe90699[_0xb03d('0x1a')][_0xb03d('0x1d')]||null:null,'include':_0xe90699[_0xb03d('0x1a')]?_0xe90699[_0xb03d('0x1a')][_0xb03d('0x1e')]?_['map'](_0xe90699['options']['include'],function(_0x4efe5f){return{'model':db[_0x4efe5f[_0xb03d('0x1f')]],'as':_0x4efe5f['as'],'attributes':_0x4efe5f[_0xb03d('0x1c')],'include':_0x4efe5f[_0xb03d('0x1e')]?_['map'](_0x4efe5f[_0xb03d('0x1e')],function(_0x41c726){return{'model':db[_0x41c726[_0xb03d('0x1f')]],'as':_0x41c726['as'],'attributes':_0x41c726['attributes'],'include':_0x41c726[_0xb03d('0x1e')]?_['map'](_0x41c726[_0xb03d('0x1e')],function(_0x2c7912){return{'model':db[_0x2c7912[_0xb03d('0x1f')]],'as':_0x2c7912['as'],'attributes':_0x2c7912[_0xb03d('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xb03d('0xf')](function(_0x43c3fa){logger['info'](_0xb03d('0x20'),_0xe90699);logger[_0xb03d('0x11')]('GetVoiceQueue',_0xe90699,JSON[_0xb03d('0x21')](_0x43c3fa));_0x44714f(_0x43c3fa);})[_0xb03d('0x17')](function(_0x11baf4){logger[_0xb03d('0x14')](_0xb03d('0x20'),_0x11baf4[_0xb03d('0x16')],_0xe90699);_0x2f6333(_0x1178a5['error'](0x1f4,_0x11baf4[_0xb03d('0x16')]));});});};exports['ShowVoiceQueue']=function(_0x2900df){var _0x19f22b=this;return new Promise(function(_0x4efa6d,_0xb1426){return db[_0xb03d('0x18')][_0xb03d('0x22')]({'raw':_0x2900df[_0xb03d('0x1a')]?_0x2900df['options'][_0xb03d('0x23')]===undefined?!![]:![]:!![],'where':_0x2900df[_0xb03d('0x1a')]?_0x2900df['options']['where']||null:null,'attributes':_0x2900df['options']?_0x2900df[_0xb03d('0x1a')][_0xb03d('0x1c')]||null:null,'include':_0x2900df[_0xb03d('0x1a')]?_0x2900df['options']['include']?_[_0xb03d('0x24')](_0x2900df[_0xb03d('0x1a')][_0xb03d('0x1e')],function(_0xe4353d){return{'model':db[_0xe4353d[_0xb03d('0x1f')]],'as':_0xe4353d['as'],'attributes':_0xe4353d[_0xb03d('0x1c')],'include':_0xe4353d[_0xb03d('0x1e')]?_[_0xb03d('0x24')](_0xe4353d[_0xb03d('0x1e')],function(_0x3f32a3){return{'model':db[_0x3f32a3[_0xb03d('0x1f')]],'as':_0x3f32a3['as'],'attributes':_0x3f32a3[_0xb03d('0x1c')],'include':_0x3f32a3[_0xb03d('0x1e')]?_[_0xb03d('0x24')](_0x3f32a3['include'],function(_0x59d864){return{'model':db[_0x59d864[_0xb03d('0x1f')]],'as':_0x59d864['as'],'attributes':_0x59d864['attributes']};}):[]};}):[]};}):[]:[]})[_0xb03d('0xf')](function(_0x1d0b7d){logger['info'](_0xb03d('0x25'),_0x2900df);logger[_0xb03d('0x11')](_0xb03d('0x25'),_0x2900df,JSON['stringify'](_0x1d0b7d));_0x4efa6d(_0x1d0b7d);})['catch'](function(_0x2f8e87){logger[_0xb03d('0x14')]('ShowVoiceQueue',_0x2f8e87[_0xb03d('0x16')],_0x2900df);_0xb1426(_0x19f22b['error'](0x1f4,_0x2f8e87[_0xb03d('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index e5cf2a0..2b35ab3 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 _0x7062=['emit','removeListener','length','voiceQueue:','save'];(function(_0x5506d0,_0x4b5687){var _0x2c4b26=function(_0x144ec2){while(--_0x144ec2){_0x5506d0['push'](_0x5506d0['shift']());}};_0x2c4b26(++_0x4b5687);}(_0x7062,0x144));var _0x2706=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x7062[_0xfae23b];return _0x200640;};'use strict';var VoiceQueueEvents=require('./voiceQueue.events');var events=[_0x2706('0x0'),'remove','update'];function createListener(_0x2211d1,_0x18e0cb){return function(_0x17bedd){_0x18e0cb[_0x2706('0x1')](_0x2211d1,_0x17bedd);};}function removeListener(_0x412c8f,_0x2f45f6){return function(){VoiceQueueEvents[_0x2706('0x2')](_0x412c8f,_0x2f45f6);};}exports['register']=function(_0x3d7e6c){for(var _0x22cfdd=0x0,_0x5cc3ad=events[_0x2706('0x3')];_0x22cfdd<_0x5cc3ad;_0x22cfdd++){var _0x3a03cb=events[_0x22cfdd];var _0x1919a0=createListener(_0x2706('0x4')+_0x3a03cb,_0x3d7e6c);VoiceQueueEvents['on'](_0x3a03cb,_0x1919a0);}}; \ No newline at end of file +var _0x6f7a=['save','remove','update','emit','removeListener','register','voiceQueue:','./voiceQueue.events'];(function(_0x9f5c9a,_0x8974ad){var _0x3ca309=function(_0x152c4a){while(--_0x152c4a){_0x9f5c9a['push'](_0x9f5c9a['shift']());}};_0x3ca309(++_0x8974ad);}(_0x6f7a,0x77));var _0xa6f7=function(_0x3abb9c,_0x569e95){_0x3abb9c=_0x3abb9c-0x0;var _0x46e554=_0x6f7a[_0x3abb9c];return _0x46e554;};'use strict';var VoiceQueueEvents=require(_0xa6f7('0x0'));var events=[_0xa6f7('0x1'),_0xa6f7('0x2'),_0xa6f7('0x3')];function createListener(_0x513327,_0x3c6520){return function(_0x507cc7){_0x3c6520[_0xa6f7('0x4')](_0x513327,_0x507cc7);};}function removeListener(_0x2cb3be,_0x235197){return function(){VoiceQueueEvents[_0xa6f7('0x5')](_0x2cb3be,_0x235197);};}exports[_0xa6f7('0x6')]=function(_0x3ef7e8){for(var _0x533f50=0x0,_0x2f8a28=events['length'];_0x533f50<_0x2f8a28;_0x533f50++){var _0x1c00c4=events[_0x533f50];var _0x421385=createListener(_0xa6f7('0x7')+_0x1c00c4,_0x3ef7e8);VoiceQueueEvents['on'](_0x1c00c4,_0x421385);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index e286e3b..138262b 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 _0x45ce=['post','create','put','util','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','index','describe','/index','getVoiceQueuesReport','/:id','show'];(function(_0x511078,_0x559727){var _0x28d32b=function(_0x5efdfd){while(--_0x5efdfd){_0x511078['push'](_0x511078['shift']());}};_0x28d32b(++_0x559727);}(_0x45ce,0xb7));var _0xe45c=function(_0x2b6ad8,_0x42cbd2){_0x2b6ad8=_0x2b6ad8-0x0;var _0xa97a91=_0x45ce[_0x2b6ad8];return _0xa97a91;};'use strict';var multer=require('multer');var util=require(_0xe45c('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe45c('0x1'));var router=express[_0xe45c('0x2')]();var fs_extra=require(_0xe45c('0x3'));var auth=require(_0xe45c('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xe45c('0x5'));var controller=require(_0xe45c('0x6'));router[_0xe45c('0x7')]('/',auth[_0xe45c('0x8')](),controller[_0xe45c('0x9')]);router[_0xe45c('0x7')]('/describe',auth[_0xe45c('0x8')](),controller[_0xe45c('0xa')]);router[_0xe45c('0x7')](_0xe45c('0xb'),auth[_0xe45c('0x8')](),controller[_0xe45c('0xc')]);router['get'](_0xe45c('0xd'),auth[_0xe45c('0x8')](),controller[_0xe45c('0xe')]);router[_0xe45c('0xf')]('/',auth[_0xe45c('0x8')](),controller[_0xe45c('0x10')]);router[_0xe45c('0x11')](_0xe45c('0xd'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xe45c('0xd'),auth[_0xe45c('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xb36e=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/index','getVoiceQueuesReport','/:id','show','post','create','update','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra'];(function(_0x1e3cb9,_0x3c697d){var _0xc3c95d=function(_0x32a9c3){while(--_0x32a9c3){_0x1e3cb9['push'](_0x1e3cb9['shift']());}};_0xc3c95d(++_0x3c697d);}(_0xb36e,0x1f4));var _0xeb36=function(_0x1360b5,_0x1d849e){_0x1360b5=_0x1360b5-0x0;var _0xb98af1=_0xb36e[_0x1360b5];return _0xb98af1;};'use strict';var multer=require(_0xeb36('0x0'));var util=require(_0xeb36('0x1'));var path=require('path');var timeout=require(_0xeb36('0x2'));var express=require(_0xeb36('0x3'));var router=express[_0xeb36('0x4')]();var fs_extra=require(_0xeb36('0x5'));var auth=require(_0xeb36('0x6'));var interaction=require(_0xeb36('0x7'));var config=require(_0xeb36('0x8'));var controller=require('./voiceQueueReport.controller');router[_0xeb36('0x9')]('/',auth[_0xeb36('0xa')](),controller['index']);router[_0xeb36('0x9')](_0xeb36('0xb'),auth[_0xeb36('0xa')](),controller[_0xeb36('0xc')]);router['get'](_0xeb36('0xd'),auth['isAuthenticated'](),controller[_0xeb36('0xe')]);router['get'](_0xeb36('0xf'),auth['isAuthenticated'](),controller[_0xeb36('0x10')]);router[_0xeb36('0x11')]('/',auth[_0xeb36('0xa')](),controller[_0xeb36('0x12')]);router['put'](_0xeb36('0xf'),auth[_0xeb36('0xa')](),controller[_0xeb36('0x13')]);router['delete']('/:id',auth[_0xeb36('0xa')](),controller[_0xeb36('0x14')]);module[_0xeb36('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index b50ea97..bd3768f 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 _0x6578=['holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','exports','STRING','DATE','getDataValue','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','queuecallerleaveAt','setDataValue'];(function(_0x22aa36,_0x3826bc){var _0x113a30=function(_0x2b1154){while(--_0x2b1154){_0x22aa36['push'](_0x22aa36['shift']());}};_0x113a30(++_0x3826bc);}(_0x6578,0x1b5));var _0x8657=function(_0x4788e9,_0x3eb1f4){_0x4788e9=_0x4788e9-0x0;var _0x5b7115=_0x6578[_0x4788e9];return _0x5b7115;};'use strict';var Sequelize=require(_0x8657('0x0'));var moment=require(_0x8657('0x1'));module[_0x8657('0x2')]={'type':{'type':Sequelize[_0x8657('0x3')]},'uniqueid':{'type':Sequelize[_0x8657('0x3')]},'calleridnum':{'type':Sequelize[_0x8657('0x3')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'queuecallerjoinAt':{'type':Sequelize[_0x8657('0x4')]},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0x457888){var _0x1737cb=moment(_0x457888);var _0x597f88=moment(this[_0x8657('0x5')](_0x8657('0x6')))[_0x8657('0x7')](_0x8657('0x8'));var _0x60e71a=_0x1737cb[_0x8657('0x9')](_0x597f88,_0x8657('0xa'));this['setDataValue'](_0x8657('0xb'),_0x457888);this[_0x8657('0xc')](_0x8657('0xd'),_0x60e71a||null);}},'position':{'type':Sequelize['INTEGER']},'count':{'type':Sequelize[_0x8657('0xe')]},'queuecallerabandon':{'type':Sequelize[_0x8657('0xf')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize[_0x8657('0xf')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x8657('0x4')]},'queuecallerexit':{'type':Sequelize[_0x8657('0xf')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize['DATE']},'queuecallerexitreason':{'type':Sequelize[_0x8657('0x3')],'comment':_0x8657('0x10')},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize[_0x8657('0x3')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x8657('0x3')]},'accountcode':{'type':Sequelize[_0x8657('0x3')]},'context':{'type':Sequelize[_0x8657('0x3')]},'exten':{'type':Sequelize[_0x8657('0x3')]},'priority':{'type':Sequelize[_0x8657('0x3')]},'holdtime':{'type':Sequelize[_0x8657('0xe')]},'mohtime':{'type':Sequelize[_0x8657('0xe')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x8657('0xf')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x8657('0x3')]},'transfer':{'type':Sequelize[_0x8657('0xf')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x8657('0x3')],'comment':_0x8657('0x11')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0x8657('0x3')]},'disposition':{'type':Sequelize[_0x8657('0x3')]},'secondDisposition':{'type':Sequelize[_0x8657('0x3')]},'thirdDisposition':{'type':Sequelize[_0x8657('0x3')]},'queuecallerenterreason':{'type':Sequelize[_0x8657('0xe')],'defaultValue':0x0}}; \ No newline at end of file +var _0xb010=['INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','STRING','DATE','getDataValue','format','YYYY-MM-DD\x20HH:mm:ss','seconds','queuecallerleaveAt','setDataValue','holdtime'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xb010,0xf4));var _0x0b01=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xb010[_0x4a9fb1];return _0x348672;};'use strict';var Sequelize=require(_0x0b01('0x0'));var moment=require(_0x0b01('0x1'));module['exports']={'type':{'type':Sequelize[_0x0b01('0x2')]},'uniqueid':{'type':Sequelize[_0x0b01('0x2')]},'calleridnum':{'type':Sequelize[_0x0b01('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x0b01('0x2')]},'queuecallerjoinAt':{'type':Sequelize[_0x0b01('0x3')]},'queuecallerleaveAt':{'type':Sequelize[_0x0b01('0x3')],'set':function(_0x1c2691){var _0x2c3041=moment(_0x1c2691);var _0x4adeea=moment(this[_0x0b01('0x4')]('queuecallerjoinAt'))[_0x0b01('0x5')](_0x0b01('0x6'));var _0x162bb1=_0x2c3041['diff'](_0x4adeea,_0x0b01('0x7'));this['setDataValue'](_0x0b01('0x8'),_0x1c2691);this[_0x0b01('0x9')](_0x0b01('0xa'),_0x162bb1||null);}},'position':{'type':Sequelize[_0x0b01('0xb')]},'count':{'type':Sequelize['INTEGER']},'queuecallerabandon':{'type':Sequelize[_0x0b01('0xc')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x0b01('0x3')]},'queuecallercomplete':{'type':Sequelize[_0x0b01('0xc')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize['DATE']},'queuecallerexit':{'type':Sequelize[_0x0b01('0xc')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize['DATE']},'queuecallerexitreason':{'type':Sequelize[_0x0b01('0x2')],'comment':_0x0b01('0xd')},'originalposition':{'type':Sequelize[_0x0b01('0xb')]},'channel':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x0b01('0x2')]},'connectedlinename':{'type':Sequelize[_0x0b01('0x2')]},'accountcode':{'type':Sequelize[_0x0b01('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'holdtime':{'type':Sequelize[_0x0b01('0xb')]},'mohtime':{'type':Sequelize[_0x0b01('0xb')],'defaultValue':0x0},'assigned':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x0b01('0x2')],'comment':_0x0b01('0xe')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x0b01('0x2')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'queuecallerenterreason':{'type':Sequelize[_0x0b01('0xb')],'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 46bc2c9..66f44cd 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 _0x3a42=['findAll','show','params','keys','intersection','includeAll','catch','create','body','find','describe','getVoiceQueuesReport','rows','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','destroy','error','name','send','index','map','VoiceQueueReport','rawAttributes','fieldName','type','key','model','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','include'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3a42,0x169));var _0x23a4=function(_0x4f1b04,_0x44b7b2){_0x4f1b04=_0x4f1b04-0x0;var _0x4a42c9=_0x3a42[_0x4f1b04];return _0x4a42c9;};'use strict';var emlformat=require(_0x23a4('0x0'));var rimraf=require(_0x23a4('0x1'));var zipdir=require(_0x23a4('0x2'));var jsonpatch=require(_0x23a4('0x3'));var rp=require(_0x23a4('0x4'));var moment=require(_0x23a4('0x5'));var BPromise=require(_0x23a4('0x6'));var Mustache=require(_0x23a4('0x7'));var util=require(_0x23a4('0x8'));var path=require(_0x23a4('0x9'));var sox=require(_0x23a4('0xa'));var csv=require(_0x23a4('0xb'));var ejs=require(_0x23a4('0xc'));var fs=require('fs');var fs_extra=require(_0x23a4('0xd'));var _=require(_0x23a4('0xe'));var squel=require('squel');var crypto=require(_0x23a4('0xf'));var jsforce=require(_0x23a4('0x10'));var deskjs=require(_0x23a4('0x11'));var toCsv=require(_0x23a4('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x23a4('0x12'));var qs=require(_0x23a4('0x13'));var as=require(_0x23a4('0x14'));var hardwareService=require(_0x23a4('0x15'));var logger=require(_0x23a4('0x16'))('api');var utils=require(_0x23a4('0x17'));var config=require(_0x23a4('0x18'));var licenseUtil=require(_0x23a4('0x19'));var db=require(_0x23a4('0x1a'))['db'];config[_0x23a4('0x1b')]=_[_0x23a4('0x1c')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x23a4('0x1d'))(new Redis(config[_0x23a4('0x1b')]));require(_0x23a4('0x1e'))[_0x23a4('0x1f')](socket);function respondWithStatusCode(_0x543bdd,_0xb83635){_0xb83635=_0xb83635||0xcc;return function(_0x22c3bb){if(_0x22c3bb){return _0x543bdd[_0x23a4('0x20')](_0xb83635);}return _0x543bdd['status'](_0xb83635)[_0x23a4('0x21')]();};}function respondWithResult(_0x5f4809,_0x444de0){_0x444de0=_0x444de0||0xc8;return function(_0x340054){if(_0x340054){return _0x5f4809[_0x23a4('0x22')](_0x444de0)[_0x23a4('0x23')](_0x340054);}};}function respondWithFilteredResult(_0x10c7e1,_0x5c6c87){return function(_0x4678a8){if(_0x4678a8){var _0x5b8253=typeof _0x5c6c87[_0x23a4('0x24')]==='undefined'&&typeof _0x5c6c87[_0x23a4('0x25')]===_0x23a4('0x26');var _0x485fba=_0x4678a8[_0x23a4('0x27')];var _0x2a751f=_0x5b8253?0x0:_0x5c6c87[_0x23a4('0x24')];var _0x260fc7=_0x5b8253?_0x4678a8[_0x23a4('0x27')]:_0x5c6c87[_0x23a4('0x24')]+_0x5c6c87[_0x23a4('0x25')];var _0x15f8bd;if(_0x260fc7>=_0x485fba){_0x260fc7=_0x485fba;_0x15f8bd=0xc8;}else{_0x15f8bd=0xce;}_0x10c7e1[_0x23a4('0x22')](_0x15f8bd);return _0x10c7e1[_0x23a4('0x28')](_0x23a4('0x29'),_0x2a751f+'-'+_0x260fc7+'/'+_0x485fba)['json'](_0x4678a8);}return null;};}function patchUpdates(_0x359e91){return function(_0x1acfb9){try{jsonpatch[_0x23a4('0x2a')](_0x1acfb9,_0x359e91,!![]);}catch(_0x2106d3){return BPromise[_0x23a4('0x2b')](_0x2106d3);}return _0x1acfb9[_0x23a4('0x2c')]();};}function saveUpdates(_0xd421cf,_0x18ee24){return function(_0x1908ef){if(_0x1908ef){return _0x1908ef['update'](_0xd421cf)[_0x23a4('0x2d')](function(_0x2bbbf2){return _0x2bbbf2;});}return null;};}function removeEntity(_0x57c817,_0x149c8e){return function(_0x397571){if(_0x397571){return _0x397571[_0x23a4('0x2e')]()[_0x23a4('0x2d')](function(){_0x57c817[_0x23a4('0x22')](0xcc)[_0x23a4('0x21')]();});}};}function handleEntityNotFound(_0x5873e1,_0x15498d){return function(_0x13c5b6){if(!_0x13c5b6){_0x5873e1[_0x23a4('0x20')](0x194);}return _0x13c5b6;};}function handleError(_0x291d83,_0x1f70ba){_0x1f70ba=_0x1f70ba||0x1f4;return function(_0x507f89){logger[_0x23a4('0x2f')](_0x507f89['stack']);if(_0x507f89[_0x23a4('0x30')]){delete _0x507f89[_0x23a4('0x30')];}_0x291d83[_0x23a4('0x22')](_0x1f70ba)[_0x23a4('0x31')](_0x507f89);};}exports[_0x23a4('0x32')]=function(_0x5ebd84,_0x33af7f){var _0x22ccee={},_0xa7fed7={},_0x26e55b={'count':0x0,'rows':[]};var _0x540914=_[_0x23a4('0x33')](db[_0x23a4('0x34')][_0x23a4('0x35')],function(_0x4fa668){return{'name':_0x4fa668[_0x23a4('0x36')],'type':_0x4fa668[_0x23a4('0x37')][_0x23a4('0x38')]};});_0xa7fed7[_0x23a4('0x39')]=_[_0x23a4('0x33')](_0x540914,_0x23a4('0x30'));_0xa7fed7[_0x23a4('0x3a')]=_['keys'](_0x5ebd84[_0x23a4('0x3a')]);_0xa7fed7['filters']=_['intersection'](_0xa7fed7[_0x23a4('0x39')],_0xa7fed7[_0x23a4('0x3a')]);_0x22ccee['attributes']=_['intersection'](_0xa7fed7[_0x23a4('0x39')],qs['fields'](_0x5ebd84[_0x23a4('0x3a')][_0x23a4('0x3b')]));_0x22ccee[_0x23a4('0x3c')]=_0x22ccee['attributes'][_0x23a4('0x3d')]?_0x22ccee[_0x23a4('0x3c')]:_0xa7fed7[_0x23a4('0x39')];if(!_0x5ebd84[_0x23a4('0x3a')][_0x23a4('0x3e')](_0x23a4('0x3f'))){_0x22ccee['limit']=qs[_0x23a4('0x25')](_0x5ebd84[_0x23a4('0x3a')]['limit']);_0x22ccee[_0x23a4('0x24')]=qs[_0x23a4('0x24')](_0x5ebd84[_0x23a4('0x3a')][_0x23a4('0x24')]);}_0x22ccee[_0x23a4('0x40')]=qs[_0x23a4('0x41')](_0x5ebd84[_0x23a4('0x3a')][_0x23a4('0x41')]);_0x22ccee['where']=qs[_0x23a4('0x42')](_[_0x23a4('0x43')](_0x5ebd84[_0x23a4('0x3a')],_0xa7fed7[_0x23a4('0x42')]),_0x540914);if(_0x5ebd84['query'][_0x23a4('0x44')]){_0x22ccee[_0x23a4('0x45')]=_[_0x23a4('0x46')](_0x22ccee['where'],{'$or':_['map'](_0x540914,function(_0x520a83){if(_0x520a83['type']!==_0x23a4('0x47')){var _0x5eeada={};_0x5eeada[_0x520a83[_0x23a4('0x30')]]={'$like':'%'+_0x5ebd84['query'][_0x23a4('0x44')]+'%'};return _0x5eeada;}})});}_0x22ccee=_[_0x23a4('0x46')]({},_0x22ccee,_0x5ebd84[_0x23a4('0x48')]);var _0x393700={'where':_0x22ccee[_0x23a4('0x45')]};return db[_0x23a4('0x34')][_0x23a4('0x27')](_0x393700)['then'](function(_0x3f8af0){_0x26e55b[_0x23a4('0x27')]=_0x3f8af0;if(_0x5ebd84[_0x23a4('0x3a')]['includeAll']){_0x22ccee[_0x23a4('0x49')]=[{'all':!![]}];}return db[_0x23a4('0x34')][_0x23a4('0x4a')](_0x22ccee);})[_0x23a4('0x2d')](function(_0x47447d){_0x26e55b['rows']=_0x47447d;return _0x26e55b;})[_0x23a4('0x2d')](respondWithFilteredResult(_0x33af7f,_0x22ccee))['catch'](handleError(_0x33af7f,null));};exports[_0x23a4('0x4b')]=function(_0x4ef581,_0x36f1cd){var _0x5dee07={'raw':![],'where':{'id':_0x4ef581[_0x23a4('0x4c')]['id']}},_0x3d5043={};_0x3d5043['model']=_['keys'](db[_0x23a4('0x34')][_0x23a4('0x35')]);_0x3d5043[_0x23a4('0x3a')]=_[_0x23a4('0x4d')](_0x4ef581[_0x23a4('0x3a')]);_0x3d5043[_0x23a4('0x42')]=_[_0x23a4('0x4e')](_0x3d5043[_0x23a4('0x39')],_0x3d5043[_0x23a4('0x3a')]);_0x5dee07[_0x23a4('0x3c')]=_['intersection'](_0x3d5043[_0x23a4('0x39')],qs['fields'](_0x4ef581['query']['fields']));_0x5dee07[_0x23a4('0x3c')]=_0x5dee07[_0x23a4('0x3c')]['length']?_0x5dee07['attributes']:_0x3d5043[_0x23a4('0x39')];if(_0x4ef581[_0x23a4('0x3a')][_0x23a4('0x4f')]){_0x5dee07[_0x23a4('0x49')]=[{'all':!![]}];}_0x5dee07=_['merge']({},_0x5dee07,_0x4ef581['options']);return db[_0x23a4('0x34')]['find'](_0x5dee07)[_0x23a4('0x2d')](handleEntityNotFound(_0x36f1cd,null))[_0x23a4('0x2d')](respondWithResult(_0x36f1cd,null))[_0x23a4('0x50')](handleError(_0x36f1cd,null));};exports[_0x23a4('0x51')]=function(_0x182f0e,_0x204845){return db[_0x23a4('0x34')][_0x23a4('0x51')](_0x182f0e[_0x23a4('0x52')],{})[_0x23a4('0x2d')](respondWithResult(_0x204845,0xc9))['catch'](handleError(_0x204845,null));};exports['update']=function(_0x2aba4b,_0x2c6f0a){if(_0x2aba4b[_0x23a4('0x52')]['id']){delete _0x2aba4b[_0x23a4('0x52')]['id'];}return db['VoiceQueueReport'][_0x23a4('0x53')]({'where':{'id':_0x2aba4b[_0x23a4('0x4c')]['id']}})[_0x23a4('0x2d')](handleEntityNotFound(_0x2c6f0a,null))[_0x23a4('0x2d')](saveUpdates(_0x2aba4b[_0x23a4('0x52')],null))[_0x23a4('0x2d')](respondWithResult(_0x2c6f0a,null))[_0x23a4('0x50')](handleError(_0x2c6f0a,null));};exports[_0x23a4('0x2e')]=function(_0x499783,_0x2ea260){return db['VoiceQueueReport'][_0x23a4('0x53')]({'where':{'id':_0x499783[_0x23a4('0x4c')]['id']}})[_0x23a4('0x2d')](handleEntityNotFound(_0x2ea260,null))[_0x23a4('0x2d')](removeEntity(_0x2ea260,null))['catch'](handleError(_0x2ea260,null));};exports[_0x23a4('0x54')]=function(_0x23e7a0,_0x36f674){return db['VoiceQueueReport'][_0x23a4('0x54')]()[_0x23a4('0x2d')](respondWithResult(_0x36f674,null))[_0x23a4('0x50')](handleError(_0x36f674,null));};exports[_0x23a4('0x55')]=function(_0x499b7f,_0x1e629d){var _0x4fb5f9={},_0x329edc={},_0x55ac8={'count':0x0,'rows':[]};_0x329edc[_0x23a4('0x39')]=_[_0x23a4('0x4d')](db['VoiceQueueReport'][_0x23a4('0x35')]);_0x329edc[_0x23a4('0x3a')]=_['keys'](_0x499b7f[_0x23a4('0x3a')]);_0x329edc[_0x23a4('0x42')]=_['intersection'](_0x329edc[_0x23a4('0x39')],_0x329edc[_0x23a4('0x3a')]);_0x4fb5f9[_0x23a4('0x3c')]=_[_0x23a4('0x4e')](_0x329edc[_0x23a4('0x39')],qs[_0x23a4('0x3b')](_0x499b7f[_0x23a4('0x3a')][_0x23a4('0x3b')]));_0x4fb5f9[_0x23a4('0x3c')]=_0x4fb5f9[_0x23a4('0x3c')][_0x23a4('0x3d')]?_0x4fb5f9[_0x23a4('0x3c')]:_0x329edc['model'];if(!_0x499b7f[_0x23a4('0x3a')][_0x23a4('0x3e')](_0x23a4('0x3f'))){_0x4fb5f9[_0x23a4('0x25')]=qs[_0x23a4('0x25')](_0x499b7f['query']['limit']);_0x4fb5f9[_0x23a4('0x24')]=qs['offset'](_0x499b7f[_0x23a4('0x3a')][_0x23a4('0x24')]);}_0x4fb5f9['order']=qs['sort'](_0x499b7f[_0x23a4('0x3a')]['sort']);_0x4fb5f9['where']=qs[_0x23a4('0x42')](_[_0x23a4('0x43')](_0x499b7f[_0x23a4('0x3a')],_0x329edc[_0x23a4('0x42')]));if(_0x499b7f[_0x23a4('0x3a')][_0x23a4('0x44')]){_0x4fb5f9[_0x23a4('0x45')]=_['merge'](_0x4fb5f9[_0x23a4('0x45')],{'$or':_[_0x23a4('0x33')](_0x4fb5f9[_0x23a4('0x3c')],function(_0x5e0266){var _0x462a17={};_0x462a17[_0x5e0266]={'$like':'%'+_0x499b7f[_0x23a4('0x3a')][_0x23a4('0x44')]+'%'};return _0x462a17;})});}_0x4fb5f9=_[_0x23a4('0x46')]({},_0x4fb5f9,_0x499b7f[_0x23a4('0x48')]);var _0x546318={'where':_0x4fb5f9[_0x23a4('0x45')]};return db[_0x23a4('0x34')][_0x23a4('0x27')](_0x546318)[_0x23a4('0x2d')](function(_0x162ab4){_0x55ac8[_0x23a4('0x27')]=_0x162ab4;if(_0x499b7f['query'][_0x23a4('0x4f')]){_0x4fb5f9[_0x23a4('0x49')]=[{'all':!![]}];}return db[_0x23a4('0x34')][_0x23a4('0x4a')](_0x4fb5f9);})[_0x23a4('0x2d')](function(_0x48a55c){_0x55ac8[_0x23a4('0x56')]=_0x48a55c;return _0x55ac8;})[_0x23a4('0x2d')](respondWithFilteredResult(_0x1e629d,_0x4fb5f9,'getVoiceQueuesReport'))[_0x23a4('0x50')](handleError(_0x1e629d,null,_0x23a4('0x55')));}; \ No newline at end of file +var _0xd852=['count','set','Content-Range','apply','save','update','destroy','then','error','stack','name','send','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','merge','where','options','VoiceQueueReport','include','findAll','catch','show','params','includeAll','find','create','body','describe','getVoiceQueuesReport','pick','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','redis','localhost','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus','status','end','json','offset','undefined','limit'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xd852,0x113));var _0x2d85=function(_0x1f8420,_0x47c03f){_0x1f8420=_0x1f8420-0x0;var _0x4d8b52=_0xd852[_0x1f8420];return _0x4d8b52;};'use strict';var emlformat=require(_0x2d85('0x0'));var rimraf=require(_0x2d85('0x1'));var zipdir=require(_0x2d85('0x2'));var jsonpatch=require(_0x2d85('0x3'));var rp=require('request-promise');var moment=require(_0x2d85('0x4'));var BPromise=require(_0x2d85('0x5'));var Mustache=require(_0x2d85('0x6'));var util=require(_0x2d85('0x7'));var path=require(_0x2d85('0x8'));var sox=require('sox');var csv=require(_0x2d85('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x2d85('0xa'));var crypto=require('crypto');var jsforce=require(_0x2d85('0xb'));var deskjs=require(_0x2d85('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2d85('0xd'));var Redis=require(_0x2d85('0xe'));var authService=require(_0x2d85('0xf'));var qs=require(_0x2d85('0x10'));var as=require(_0x2d85('0x11'));var hardwareService=require(_0x2d85('0x12'));var logger=require('../../config/logger')(_0x2d85('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x2d85('0x14'))['db'];config[_0x2d85('0x15')]=_['defaults'](config[_0x2d85('0x15')],{'host':_0x2d85('0x16'),'port':0x18eb});var socket=require(_0x2d85('0x17'))(new Redis(config['redis']));require(_0x2d85('0x18'))[_0x2d85('0x19')](socket);function respondWithStatusCode(_0x278a3a,_0x4448d5){_0x4448d5=_0x4448d5||0xcc;return function(_0x230d1e){if(_0x230d1e){return _0x278a3a[_0x2d85('0x1a')](_0x4448d5);}return _0x278a3a[_0x2d85('0x1b')](_0x4448d5)[_0x2d85('0x1c')]();};}function respondWithResult(_0x52e5ed,_0x2a5b5d){_0x2a5b5d=_0x2a5b5d||0xc8;return function(_0x51e7ee){if(_0x51e7ee){return _0x52e5ed[_0x2d85('0x1b')](_0x2a5b5d)[_0x2d85('0x1d')](_0x51e7ee);}};}function respondWithFilteredResult(_0x2e7b6e,_0xdef5f0){return function(_0xf38692){if(_0xf38692){var _0xddfcef=typeof _0xdef5f0[_0x2d85('0x1e')]===_0x2d85('0x1f')&&typeof _0xdef5f0[_0x2d85('0x20')]===_0x2d85('0x1f');var _0x5cc2ff=_0xf38692['count'];var _0x3d837d=_0xddfcef?0x0:_0xdef5f0['offset'];var _0x1fac15=_0xddfcef?_0xf38692[_0x2d85('0x21')]:_0xdef5f0[_0x2d85('0x1e')]+_0xdef5f0[_0x2d85('0x20')];var _0x4bf94c;if(_0x1fac15>=_0x5cc2ff){_0x1fac15=_0x5cc2ff;_0x4bf94c=0xc8;}else{_0x4bf94c=0xce;}_0x2e7b6e[_0x2d85('0x1b')](_0x4bf94c);return _0x2e7b6e[_0x2d85('0x22')](_0x2d85('0x23'),_0x3d837d+'-'+_0x1fac15+'/'+_0x5cc2ff)[_0x2d85('0x1d')](_0xf38692);}return null;};}function patchUpdates(_0x4c26f1){return function(_0x408f95){try{jsonpatch[_0x2d85('0x24')](_0x408f95,_0x4c26f1,!![]);}catch(_0x2aabb9){return BPromise['reject'](_0x2aabb9);}return _0x408f95[_0x2d85('0x25')]();};}function saveUpdates(_0x17203c,_0x46104c){return function(_0x5a245c){if(_0x5a245c){return _0x5a245c[_0x2d85('0x26')](_0x17203c)['then'](function(_0x4e62cd){return _0x4e62cd;});}return null;};}function removeEntity(_0x30346f,_0x5a4592){return function(_0x328c6a){if(_0x328c6a){return _0x328c6a[_0x2d85('0x27')]()[_0x2d85('0x28')](function(){_0x30346f['status'](0xcc)[_0x2d85('0x1c')]();});}};}function handleEntityNotFound(_0x23d682,_0x10ea88){return function(_0x189e64){if(!_0x189e64){_0x23d682[_0x2d85('0x1a')](0x194);}return _0x189e64;};}function handleError(_0x1932be,_0x4264a3){_0x4264a3=_0x4264a3||0x1f4;return function(_0x4253bd){logger[_0x2d85('0x29')](_0x4253bd[_0x2d85('0x2a')]);if(_0x4253bd[_0x2d85('0x2b')]){delete _0x4253bd[_0x2d85('0x2b')];}_0x1932be[_0x2d85('0x1b')](_0x4264a3)[_0x2d85('0x2c')](_0x4253bd);};}exports['index']=function(_0x3d9689,_0x1c240d){var _0x5527b5={},_0x7cabbd={},_0x1f418d={'count':0x0,'rows':[]};var _0x2bf079=_[_0x2d85('0x2d')](db['VoiceQueueReport'][_0x2d85('0x2e')],function(_0xd34b27){return{'name':_0xd34b27[_0x2d85('0x2f')],'type':_0xd34b27[_0x2d85('0x30')]['key']};});_0x7cabbd[_0x2d85('0x31')]=_[_0x2d85('0x2d')](_0x2bf079,_0x2d85('0x2b'));_0x7cabbd[_0x2d85('0x32')]=_[_0x2d85('0x33')](_0x3d9689[_0x2d85('0x32')]);_0x7cabbd[_0x2d85('0x34')]=_[_0x2d85('0x35')](_0x7cabbd['model'],_0x7cabbd['query']);_0x5527b5[_0x2d85('0x36')]=_[_0x2d85('0x35')](_0x7cabbd[_0x2d85('0x31')],qs['fields'](_0x3d9689[_0x2d85('0x32')][_0x2d85('0x37')]));_0x5527b5[_0x2d85('0x36')]=_0x5527b5[_0x2d85('0x36')][_0x2d85('0x38')]?_0x5527b5[_0x2d85('0x36')]:_0x7cabbd[_0x2d85('0x31')];if(!_0x3d9689[_0x2d85('0x32')][_0x2d85('0x39')](_0x2d85('0x3a'))){_0x5527b5['limit']=qs['limit'](_0x3d9689[_0x2d85('0x32')][_0x2d85('0x20')]);_0x5527b5[_0x2d85('0x1e')]=qs[_0x2d85('0x1e')](_0x3d9689['query'][_0x2d85('0x1e')]);}_0x5527b5['order']=qs[_0x2d85('0x3b')](_0x3d9689[_0x2d85('0x32')][_0x2d85('0x3b')]);_0x5527b5['where']=qs[_0x2d85('0x34')](_['pick'](_0x3d9689['query'],_0x7cabbd[_0x2d85('0x34')]),_0x2bf079);if(_0x3d9689[_0x2d85('0x32')][_0x2d85('0x3c')]){_0x5527b5['where']=_[_0x2d85('0x3d')](_0x5527b5[_0x2d85('0x3e')],{'$or':_[_0x2d85('0x2d')](_0x2bf079,function(_0x2e8536){if(_0x2e8536['type']!=='VIRTUAL'){var _0x3d2456={};_0x3d2456[_0x2e8536['name']]={'$like':'%'+_0x3d9689[_0x2d85('0x32')][_0x2d85('0x3c')]+'%'};return _0x3d2456;}})});}_0x5527b5=_[_0x2d85('0x3d')]({},_0x5527b5,_0x3d9689[_0x2d85('0x3f')]);var _0x4f9ed3={'where':_0x5527b5['where']};return db[_0x2d85('0x40')][_0x2d85('0x21')](_0x4f9ed3)[_0x2d85('0x28')](function(_0x124d47){_0x1f418d['count']=_0x124d47;if(_0x3d9689['query']['includeAll']){_0x5527b5[_0x2d85('0x41')]=[{'all':!![]}];}return db[_0x2d85('0x40')][_0x2d85('0x42')](_0x5527b5);})['then'](function(_0x4b68ae){_0x1f418d['rows']=_0x4b68ae;return _0x1f418d;})[_0x2d85('0x28')](respondWithFilteredResult(_0x1c240d,_0x5527b5))[_0x2d85('0x43')](handleError(_0x1c240d,null));};exports[_0x2d85('0x44')]=function(_0x51bd49,_0x409146){var _0x1cad05={'raw':![],'where':{'id':_0x51bd49[_0x2d85('0x45')]['id']}},_0x3c9ac1={};_0x3c9ac1['model']=_[_0x2d85('0x33')](db[_0x2d85('0x40')][_0x2d85('0x2e')]);_0x3c9ac1[_0x2d85('0x32')]=_[_0x2d85('0x33')](_0x51bd49[_0x2d85('0x32')]);_0x3c9ac1[_0x2d85('0x34')]=_[_0x2d85('0x35')](_0x3c9ac1['model'],_0x3c9ac1[_0x2d85('0x32')]);_0x1cad05[_0x2d85('0x36')]=_[_0x2d85('0x35')](_0x3c9ac1[_0x2d85('0x31')],qs[_0x2d85('0x37')](_0x51bd49[_0x2d85('0x32')]['fields']));_0x1cad05[_0x2d85('0x36')]=_0x1cad05['attributes'][_0x2d85('0x38')]?_0x1cad05[_0x2d85('0x36')]:_0x3c9ac1[_0x2d85('0x31')];if(_0x51bd49['query'][_0x2d85('0x46')]){_0x1cad05[_0x2d85('0x41')]=[{'all':!![]}];}_0x1cad05=_[_0x2d85('0x3d')]({},_0x1cad05,_0x51bd49['options']);return db[_0x2d85('0x40')][_0x2d85('0x47')](_0x1cad05)[_0x2d85('0x28')](handleEntityNotFound(_0x409146,null))[_0x2d85('0x28')](respondWithResult(_0x409146,null))[_0x2d85('0x43')](handleError(_0x409146,null));};exports[_0x2d85('0x48')]=function(_0x488647,_0x20bc2e){return db['VoiceQueueReport'][_0x2d85('0x48')](_0x488647[_0x2d85('0x49')],{})[_0x2d85('0x28')](respondWithResult(_0x20bc2e,0xc9))[_0x2d85('0x43')](handleError(_0x20bc2e,null));};exports['update']=function(_0x1c10dc,_0x1857ac){if(_0x1c10dc[_0x2d85('0x49')]['id']){delete _0x1c10dc[_0x2d85('0x49')]['id'];}return db[_0x2d85('0x40')][_0x2d85('0x47')]({'where':{'id':_0x1c10dc[_0x2d85('0x45')]['id']}})[_0x2d85('0x28')](handleEntityNotFound(_0x1857ac,null))[_0x2d85('0x28')](saveUpdates(_0x1c10dc[_0x2d85('0x49')],null))[_0x2d85('0x28')](respondWithResult(_0x1857ac,null))[_0x2d85('0x43')](handleError(_0x1857ac,null));};exports['destroy']=function(_0x51e85d,_0x3d02c2){return db[_0x2d85('0x40')]['find']({'where':{'id':_0x51e85d[_0x2d85('0x45')]['id']}})[_0x2d85('0x28')](handleEntityNotFound(_0x3d02c2,null))[_0x2d85('0x28')](removeEntity(_0x3d02c2,null))[_0x2d85('0x43')](handleError(_0x3d02c2,null));};exports[_0x2d85('0x4a')]=function(_0x4e1ca9,_0x10125e){return db['VoiceQueueReport'][_0x2d85('0x4a')]()['then'](respondWithResult(_0x10125e,null))[_0x2d85('0x43')](handleError(_0x10125e,null));};exports[_0x2d85('0x4b')]=function(_0x504076,_0x595808){var _0x3cf337={},_0x5c3885={},_0x46bc95={'count':0x0,'rows':[]};_0x5c3885[_0x2d85('0x31')]=_[_0x2d85('0x33')](db[_0x2d85('0x40')][_0x2d85('0x2e')]);_0x5c3885[_0x2d85('0x32')]=_[_0x2d85('0x33')](_0x504076[_0x2d85('0x32')]);_0x5c3885[_0x2d85('0x34')]=_['intersection'](_0x5c3885[_0x2d85('0x31')],_0x5c3885[_0x2d85('0x32')]);_0x3cf337['attributes']=_[_0x2d85('0x35')](_0x5c3885[_0x2d85('0x31')],qs[_0x2d85('0x37')](_0x504076[_0x2d85('0x32')][_0x2d85('0x37')]));_0x3cf337[_0x2d85('0x36')]=_0x3cf337[_0x2d85('0x36')]['length']?_0x3cf337[_0x2d85('0x36')]:_0x5c3885['model'];if(!_0x504076['query'][_0x2d85('0x39')]('nolimit')){_0x3cf337['limit']=qs['limit'](_0x504076[_0x2d85('0x32')][_0x2d85('0x20')]);_0x3cf337[_0x2d85('0x1e')]=qs['offset'](_0x504076['query']['offset']);}_0x3cf337['order']=qs['sort'](_0x504076['query'][_0x2d85('0x3b')]);_0x3cf337[_0x2d85('0x3e')]=qs['filters'](_[_0x2d85('0x4c')](_0x504076['query'],_0x5c3885['filters']));if(_0x504076[_0x2d85('0x32')]['filter']){_0x3cf337[_0x2d85('0x3e')]=_[_0x2d85('0x3d')](_0x3cf337[_0x2d85('0x3e')],{'$or':_['map'](_0x3cf337[_0x2d85('0x36')],function(_0x25d871){var _0x2d4f73={};_0x2d4f73[_0x25d871]={'$like':'%'+_0x504076[_0x2d85('0x32')][_0x2d85('0x3c')]+'%'};return _0x2d4f73;})});}_0x3cf337=_['merge']({},_0x3cf337,_0x504076[_0x2d85('0x3f')]);var _0x5a8a5b={'where':_0x3cf337[_0x2d85('0x3e')]};return db['VoiceQueueReport'][_0x2d85('0x21')](_0x5a8a5b)['then'](function(_0x3b59fb){_0x46bc95[_0x2d85('0x21')]=_0x3b59fb;if(_0x504076['query'][_0x2d85('0x46')]){_0x3cf337['include']=[{'all':!![]}];}return db[_0x2d85('0x40')][_0x2d85('0x42')](_0x3cf337);})[_0x2d85('0x28')](function(_0x419b46){_0x46bc95['rows']=_0x419b46;return _0x46bc95;})[_0x2d85('0x28')](respondWithFilteredResult(_0x595808,_0x3cf337,_0x2d85('0x4b')))[_0x2d85('0x43')](handleError(_0x595808,null,_0x2d85('0x4b')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index ee74b68..31ce0a4 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 _0xb8a0=['hook','exports','events','VoiceQueueReport','setMaxListeners','save','remove','hasOwnProperty'];(function(_0x1ae5ba,_0x32ba42){var _0x3e41be=function(_0x5f4841){while(--_0x5f4841){_0x1ae5ba['push'](_0x1ae5ba['shift']());}};_0x3e41be(++_0x32ba42);}(_0xb8a0,0x82));var _0x0b8a=function(_0x142746,_0x36f737){_0x142746=_0x142746-0x0;var _0x2248df=_0xb8a0[_0x142746];return _0x2248df;};'use strict';var EventEmitter=require(_0x0b8a('0x0'));var VoiceQueueReport=require('../../mysqldb')['db'][_0x0b8a('0x1')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x0b8a('0x2')](0x0);var events={'afterCreate':_0x0b8a('0x3'),'afterUpdate':'update','afterDestroy':_0x0b8a('0x4')};function emitEvent(_0x1aa4ab){return function(_0x4ac76e,_0x3a4f31,_0x3f344d){VoiceQueueReportEvents['emit'](_0x1aa4ab+':'+_0x4ac76e['id'],_0x4ac76e);VoiceQueueReportEvents['emit'](_0x1aa4ab,_0x4ac76e);_0x3f344d(null);};}for(var e in events){if(events[_0x0b8a('0x5')](e)){var event=events[e];VoiceQueueReport[_0x0b8a('0x6')](e,emitEvent(event));}}module[_0x0b8a('0x7')]=VoiceQueueReportEvents; \ No newline at end of file +var _0xf4ff=['remove','emit','hasOwnProperty','hook','events','setMaxListeners','save','update'];(function(_0x41476c,_0x91403){var _0x367e81=function(_0x5b1d38){while(--_0x5b1d38){_0x41476c['push'](_0x41476c['shift']());}};_0x367e81(++_0x91403);}(_0xf4ff,0xc4));var _0xff4f=function(_0x4efc99,_0x2c5cca){_0x4efc99=_0x4efc99-0x0;var _0x1b53ad=_0xf4ff[_0x4efc99];return _0x1b53ad;};'use strict';var EventEmitter=require(_0xff4f('0x0'));var VoiceQueueReport=require('../../mysqldb')['db']['VoiceQueueReport'];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xff4f('0x1')](0x0);var events={'afterCreate':_0xff4f('0x2'),'afterUpdate':_0xff4f('0x3'),'afterDestroy':_0xff4f('0x4')};function emitEvent(_0x4b7bdd){return function(_0x1e0b14,_0x8e223d,_0x1a7f25){VoiceQueueReportEvents[_0xff4f('0x5')](_0x4b7bdd+':'+_0x1e0b14['id'],_0x1e0b14);VoiceQueueReportEvents[_0xff4f('0x5')](_0x4b7bdd,_0x1e0b14);_0x1a7f25(null);};}for(var e in events){if(events[_0xff4f('0x6')](e)){var event=events[e];VoiceQueueReport[_0xff4f('0x7')](e,emitEvent(event));}}module['exports']=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index 0886813..92ff06c 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 _0x24b0=['../../config/logger','moment','bluebird','request-promise','path','rimraf','./voiceQueueReport.attributes','exports','define','VoiceQueueReport','report_queue','uniqueid','calleridnum','lodash','util'];(function(_0x4c7b20,_0x361515){var _0x4872bd=function(_0x358e19){while(--_0x358e19){_0x4c7b20['push'](_0x4c7b20['shift']());}};_0x4872bd(++_0x361515);}(_0x24b0,0x166));var _0x024b=function(_0x35980d,_0x400d86){_0x35980d=_0x35980d-0x0;var _0xd46e43=_0x24b0[_0x35980d];return _0xd46e43;};'use strict';var _=require(_0x024b('0x0'));var util=require(_0x024b('0x1'));var logger=require(_0x024b('0x2'))('api');var moment=require(_0x024b('0x3'));var BPromise=require(_0x024b('0x4'));var rp=require(_0x024b('0x5'));var fs=require('fs');var path=require(_0x024b('0x6'));var rimraf=require(_0x024b('0x7'));var config=require('../../config/environment');var attributes=require(_0x024b('0x8'));module[_0x024b('0x9')]=function(_0x256082,_0x83a70d){return _0x256082[_0x024b('0xa')](_0x024b('0xb'),attributes,{'tableName':_0x024b('0xc'),'paranoid':![],'indexes':[{'fields':[_0x024b('0xd')]},{'fields':[_0x024b('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xeb0f=['uniqueid','calleridnum','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./voiceQueueReport.attributes','exports','define','VoiceQueueReport','report_queue'];(function(_0x42f009,_0x5e27b1){var _0x22a1e0=function(_0x297993){while(--_0x297993){_0x42f009['push'](_0x42f009['shift']());}};_0x22a1e0(++_0x5e27b1);}(_0xeb0f,0x101));var _0xfeb0=function(_0x398094,_0x54dd2d){_0x398094=_0x398094-0x0;var _0x55353c=_0xeb0f[_0x398094];return _0x55353c;};'use strict';var _=require('lodash');var util=require(_0xfeb0('0x0'));var logger=require(_0xfeb0('0x1'))(_0xfeb0('0x2'));var moment=require(_0xfeb0('0x3'));var BPromise=require(_0xfeb0('0x4'));var rp=require(_0xfeb0('0x5'));var fs=require('fs');var path=require(_0xfeb0('0x6'));var rimraf=require('rimraf');var config=require(_0xfeb0('0x7'));var attributes=require(_0xfeb0('0x8'));module[_0xfeb0('0x9')]=function(_0x1cbc6d,_0x3ec4b4){return _0x1cbc6d[_0xfeb0('0xa')](_0xfeb0('0xb'),attributes,{'tableName':_0xfeb0('0xc'),'paranoid':![],'indexes':[{'fields':[_0xfeb0('0xd')]},{'fields':[_0xfeb0('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index 73ade0a..ab11ead 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 _0xc30a=['catch','GetVoiceQueueReport','VoiceQueueReport','options','raw','include','map','model','attributes','stringify','CreateVoiceQueueReport','create','body','UpdateVoiceQueueReport','limit','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','redis','defaults','./voiceQueueReport.socket','register','request','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','error','message','result'];(function(_0x183b18,_0x243de5){var _0xad9a35=function(_0x1acc55){while(--_0x1acc55){_0x183b18['push'](_0x183b18['shift']());}};_0xad9a35(++_0x243de5);}(_0xc30a,0x137));var _0xac30=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0xc30a[_0x4e9628];return _0x27bc8c;};'use strict';var _=require('lodash');var util=require(_0xac30('0x0'));var moment=require(_0xac30('0x1'));var BPromise=require('bluebird');var rs=require(_0xac30('0x2'));var fs=require('fs');var Redis=require(_0xac30('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xac30('0x4'));var logger=require(_0xac30('0x5'))(_0xac30('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xac30('0x7')]['http']({'port':0x232a});config[_0xac30('0x8')]=_[_0xac30('0x9')](config[_0xac30('0x8')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xac30('0x8')]));require(_0xac30('0xa'))[_0xac30('0xb')](socket);function respondWithRpcPromise(_0x4cfcd4,_0x237199,_0xe6cddb){return new BPromise(function(_0xbdd5ba,_0x488567){return client[_0xac30('0xc')](_0x4cfcd4,_0xe6cddb)[_0xac30('0xd')](function(_0x41b9ba){logger[_0xac30('0xe')](_0xac30('0xf'),_0x237199,_0xac30('0x10'));logger[_0xac30('0x11')](_0xac30('0x12'),_0x237199,_0xac30('0x10'),JSON['stringify'](_0x41b9ba));if(_0x41b9ba['error']){if(_0x41b9ba['error']['code']===0x1f4){logger[_0xac30('0x13')]('VoiceQueueReport,\x20%s,\x20%s',_0x237199,_0x41b9ba[_0xac30('0x13')][_0xac30('0x14')]);return _0x488567(_0x41b9ba[_0xac30('0x13')][_0xac30('0x14')]);}logger['error'](_0xac30('0xf'),_0x237199,_0x41b9ba[_0xac30('0x13')][_0xac30('0x14')]);return _0xbdd5ba(_0x41b9ba[_0xac30('0x13')][_0xac30('0x14')]);}else{logger['info'](_0xac30('0xf'),_0x237199,'request\x20sent');_0xbdd5ba(_0x41b9ba[_0xac30('0x15')][_0xac30('0x14')]);}})[_0xac30('0x16')](function(_0x3bd13e){logger[_0xac30('0x13')](_0xac30('0xf'),_0x237199,_0x3bd13e);_0x488567(_0x3bd13e);});});}exports[_0xac30('0x17')]=function(_0x5351d8){var _0x3f5644=this;return new Promise(function(_0x423f13,_0x48ee92){return db[_0xac30('0x18')]['findAll']({'raw':_0x5351d8[_0xac30('0x19')]?_0x5351d8[_0xac30('0x19')][_0xac30('0x1a')]===undefined?!![]:![]:!![],'where':_0x5351d8[_0xac30('0x19')]?_0x5351d8[_0xac30('0x19')]['where']||null:null,'attributes':_0x5351d8[_0xac30('0x19')]?_0x5351d8[_0xac30('0x19')]['attributes']||null:null,'limit':_0x5351d8[_0xac30('0x19')]?_0x5351d8['options']['limit']||null:null,'include':_0x5351d8[_0xac30('0x19')]?_0x5351d8['options'][_0xac30('0x1b')]?_[_0xac30('0x1c')](_0x5351d8[_0xac30('0x19')][_0xac30('0x1b')],function(_0x1eb66f){return{'model':db[_0x1eb66f[_0xac30('0x1d')]],'as':_0x1eb66f['as'],'attributes':_0x1eb66f['attributes'],'include':_0x1eb66f[_0xac30('0x1b')]?_[_0xac30('0x1c')](_0x1eb66f[_0xac30('0x1b')],function(_0x506d3c){return{'model':db[_0x506d3c[_0xac30('0x1d')]],'as':_0x506d3c['as'],'attributes':_0x506d3c[_0xac30('0x1e')],'include':_0x506d3c['include']?_[_0xac30('0x1c')](_0x506d3c[_0xac30('0x1b')],function(_0x117ce1){return{'model':db[_0x117ce1[_0xac30('0x1d')]],'as':_0x117ce1['as'],'attributes':_0x117ce1[_0xac30('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xac30('0xd')](function(_0x4005ae){logger[_0xac30('0xe')](_0xac30('0x17'),_0x5351d8);logger['debug'](_0xac30('0x17'),_0x5351d8,JSON[_0xac30('0x1f')](_0x4005ae));_0x423f13(_0x4005ae);})[_0xac30('0x16')](function(_0x4a2ba0){logger[_0xac30('0x13')](_0xac30('0x17'),_0x4a2ba0[_0xac30('0x14')],_0x5351d8);_0x48ee92(_0x3f5644[_0xac30('0x13')](0x1f4,_0x4a2ba0[_0xac30('0x14')]));});});};exports[_0xac30('0x20')]=function(_0x247f6c){var _0x2debe2=this;return new Promise(function(_0x3a87c4,_0x18991d){return db[_0xac30('0x18')][_0xac30('0x21')](_0x247f6c[_0xac30('0x22')],{'raw':_0x247f6c[_0xac30('0x19')]?_0x247f6c[_0xac30('0x19')][_0xac30('0x1a')]===undefined?!![]:![]:!![]})[_0xac30('0xd')](function(_0x27ce82){logger['info'](_0xac30('0x20'),_0x247f6c);logger[_0xac30('0x11')]('CreateVoiceQueueReport',_0x247f6c,JSON[_0xac30('0x1f')](_0x27ce82));_0x3a87c4(_0x27ce82);})[_0xac30('0x16')](function(_0x360a6f){logger[_0xac30('0x13')](_0xac30('0x20'),_0x360a6f[_0xac30('0x14')],_0x247f6c);_0x18991d(_0x2debe2[_0xac30('0x13')](0x1f4,_0x360a6f['message']));});});};exports[_0xac30('0x23')]=function(_0x238651){var _0x3ea6c1=this;return new Promise(function(_0x511c16,_0x465e83){return db['VoiceQueueReport']['update'](_0x238651[_0xac30('0x22')],{'raw':_0x238651['options']?_0x238651[_0xac30('0x19')][_0xac30('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x238651[_0xac30('0x19')]?_0x238651[_0xac30('0x19')]['where']||null:null,'attributes':_0x238651[_0xac30('0x19')]?_0x238651['options'][_0xac30('0x1e')]||null:null,'limit':_0x238651['options']?_0x238651[_0xac30('0x19')][_0xac30('0x24')]||null:null})[_0xac30('0xd')](function(_0x4d8d59){logger[_0xac30('0xe')](_0xac30('0x23'),_0x238651);logger[_0xac30('0x11')](_0xac30('0x23'),_0x238651,JSON[_0xac30('0x1f')](_0x4d8d59));_0x511c16(_0x4d8d59);})['catch'](function(_0x1972e2){logger['error']('UpdateVoiceQueueReport',_0x1972e2['message'],_0x238651);_0x465e83(_0x3ea6c1[_0xac30('0x13')](0x1f4,_0x1972e2[_0xac30('0x14')]));});});}; \ No newline at end of file +var _0xd042=['UpdateVoiceQueueReport','where','util','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./voiceQueueReport.socket','register','request','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','VoiceQueueReport','findAll','options','raw','attributes','limit','include','map','model','GetVoiceQueueReport','CreateVoiceQueueReport','create','body','debug'];(function(_0x119d5a,_0x19b457){var _0x15bff4=function(_0x1b7c78){while(--_0x1b7c78){_0x119d5a['push'](_0x119d5a['shift']());}};_0x15bff4(++_0x19b457);}(_0xd042,0x1ba));var _0x2d04=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xd042[_0x397e5f];return _0x5302b8;};'use strict';var _=require('lodash');var util=require(_0x2d04('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2d04('0x1'));var fs=require('fs');var Redis=require(_0x2d04('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x2d04('0x3'));var logger=require('../../config/logger')(_0x2d04('0x4'));var config=require(_0x2d04('0x5'));var jayson=require(_0x2d04('0x6'));var client=jayson[_0x2d04('0x7')][_0x2d04('0x8')]({'port':0x232a});config[_0x2d04('0x9')]=_[_0x2d04('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x2d04('0xb'))(new Redis(config['redis']));require(_0x2d04('0xc'))[_0x2d04('0xd')](socket);function respondWithRpcPromise(_0xb6c766,_0x4c1347,_0x3fb353){return new BPromise(function(_0x3b430d,_0x40adc8){return client[_0x2d04('0xe')](_0xb6c766,_0x3fb353)[_0x2d04('0xf')](function(_0x17e08b){logger[_0x2d04('0x10')](_0x2d04('0x11'),_0x4c1347,_0x2d04('0x12'));logger['debug']('VoiceQueueReport,\x20%s,\x20%s,\x20%s',_0x4c1347,_0x2d04('0x12'),JSON[_0x2d04('0x13')](_0x17e08b));if(_0x17e08b[_0x2d04('0x14')]){if(_0x17e08b[_0x2d04('0x14')][_0x2d04('0x15')]===0x1f4){logger['error']('VoiceQueueReport,\x20%s,\x20%s',_0x4c1347,_0x17e08b[_0x2d04('0x14')]['message']);return _0x40adc8(_0x17e08b['error']['message']);}logger[_0x2d04('0x14')](_0x2d04('0x11'),_0x4c1347,_0x17e08b['error'][_0x2d04('0x16')]);return _0x3b430d(_0x17e08b[_0x2d04('0x14')][_0x2d04('0x16')]);}else{logger[_0x2d04('0x10')](_0x2d04('0x11'),_0x4c1347,'request\x20sent');_0x3b430d(_0x17e08b[_0x2d04('0x17')][_0x2d04('0x16')]);}})['catch'](function(_0x2f4c34){logger['error']('VoiceQueueReport,\x20%s,\x20%s',_0x4c1347,_0x2f4c34);_0x40adc8(_0x2f4c34);});});}exports['GetVoiceQueueReport']=function(_0x48c55a){var _0x4a955e=this;return new Promise(function(_0x22eb01,_0x519b2a){return db[_0x2d04('0x18')][_0x2d04('0x19')]({'raw':_0x48c55a[_0x2d04('0x1a')]?_0x48c55a[_0x2d04('0x1a')][_0x2d04('0x1b')]===undefined?!![]:![]:!![],'where':_0x48c55a[_0x2d04('0x1a')]?_0x48c55a[_0x2d04('0x1a')]['where']||null:null,'attributes':_0x48c55a[_0x2d04('0x1a')]?_0x48c55a['options'][_0x2d04('0x1c')]||null:null,'limit':_0x48c55a[_0x2d04('0x1a')]?_0x48c55a['options'][_0x2d04('0x1d')]||null:null,'include':_0x48c55a[_0x2d04('0x1a')]?_0x48c55a[_0x2d04('0x1a')][_0x2d04('0x1e')]?_[_0x2d04('0x1f')](_0x48c55a[_0x2d04('0x1a')][_0x2d04('0x1e')],function(_0x4c20ea){return{'model':db[_0x4c20ea['model']],'as':_0x4c20ea['as'],'attributes':_0x4c20ea['attributes'],'include':_0x4c20ea[_0x2d04('0x1e')]?_[_0x2d04('0x1f')](_0x4c20ea[_0x2d04('0x1e')],function(_0x100cec){return{'model':db[_0x100cec['model']],'as':_0x100cec['as'],'attributes':_0x100cec[_0x2d04('0x1c')],'include':_0x100cec[_0x2d04('0x1e')]?_[_0x2d04('0x1f')](_0x100cec[_0x2d04('0x1e')],function(_0x110bfe){return{'model':db[_0x110bfe[_0x2d04('0x20')]],'as':_0x110bfe['as'],'attributes':_0x110bfe[_0x2d04('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x2d04('0xf')](function(_0x5600eb){logger['info'](_0x2d04('0x21'),_0x48c55a);logger['debug'](_0x2d04('0x21'),_0x48c55a,JSON[_0x2d04('0x13')](_0x5600eb));_0x22eb01(_0x5600eb);})['catch'](function(_0x5eedc4){logger['error']('GetVoiceQueueReport',_0x5eedc4['message'],_0x48c55a);_0x519b2a(_0x4a955e[_0x2d04('0x14')](0x1f4,_0x5eedc4[_0x2d04('0x16')]));});});};exports[_0x2d04('0x22')]=function(_0x2803df){var _0x586489=this;return new Promise(function(_0x424502,_0x813f15){return db[_0x2d04('0x18')][_0x2d04('0x23')](_0x2803df[_0x2d04('0x24')],{'raw':_0x2803df[_0x2d04('0x1a')]?_0x2803df[_0x2d04('0x1a')][_0x2d04('0x1b')]===undefined?!![]:![]:!![]})[_0x2d04('0xf')](function(_0x526498){logger['info'](_0x2d04('0x22'),_0x2803df);logger[_0x2d04('0x25')]('CreateVoiceQueueReport',_0x2803df,JSON['stringify'](_0x526498));_0x424502(_0x526498);})['catch'](function(_0x481e0f){logger[_0x2d04('0x14')](_0x2d04('0x22'),_0x481e0f[_0x2d04('0x16')],_0x2803df);_0x813f15(_0x586489[_0x2d04('0x14')](0x1f4,_0x481e0f[_0x2d04('0x16')]));});});};exports[_0x2d04('0x26')]=function(_0x350152){var _0x26930f=this;return new Promise(function(_0x2c7aaa,_0x5b3506){return db[_0x2d04('0x18')]['update'](_0x350152['body'],{'raw':_0x350152[_0x2d04('0x1a')]?_0x350152[_0x2d04('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x350152[_0x2d04('0x1a')]?_0x350152[_0x2d04('0x1a')][_0x2d04('0x27')]||null:null,'attributes':_0x350152[_0x2d04('0x1a')]?_0x350152[_0x2d04('0x1a')][_0x2d04('0x1c')]||null:null,'limit':_0x350152[_0x2d04('0x1a')]?_0x350152['options']['limit']||null:null})[_0x2d04('0xf')](function(_0x233df0){logger['info'](_0x2d04('0x26'),_0x350152);logger['debug'](_0x2d04('0x26'),_0x350152,JSON['stringify'](_0x233df0));_0x2c7aaa(_0x233df0);})['catch'](function(_0x24e332){logger[_0x2d04('0x14')]('UpdateVoiceQueueReport',_0x24e332['message'],_0x350152);_0x5b3506(_0x26930f['error'](0x1f4,_0x24e332['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index 357b9d4..e467bbc 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 _0xbeff=['removeListener','register','save','remove','update'];(function(_0xaac208,_0x29f03){var _0x1ad453=function(_0x204c1d){while(--_0x204c1d){_0xaac208['push'](_0xaac208['shift']());}};_0x1ad453(++_0x29f03);}(_0xbeff,0x8e));var _0xfbef=function(_0x3a432b,_0x30b6b8){_0x3a432b=_0x3a432b-0x0;var _0x205181=_0xbeff[_0x3a432b];return _0x205181;};'use strict';var VoiceQueueReportEvents=require('./voiceQueueReport.events');var events=[_0xfbef('0x0'),_0xfbef('0x1'),_0xfbef('0x2')];function createListener(_0x304d07,_0x114ed7){return function(_0x4fb975){_0x114ed7['emit'](_0x304d07,_0x4fb975);};}function removeListener(_0x474798,_0x387be8){return function(){VoiceQueueReportEvents[_0xfbef('0x3')](_0x474798,_0x387be8);};}exports[_0xfbef('0x4')]=function(_0x5496a6){for(var _0x295f40=0x0,_0x2ed5bc=events['length'];_0x295f40<_0x2ed5bc;_0x295f40++){var _0x257f3a=events[_0x295f40];var _0x43e95e=createListener('voiceQueueReport:'+_0x257f3a,_0x5496a6);VoiceQueueReportEvents['on'](_0x257f3a,_0x43e95e);}}; \ No newline at end of file +var _0xd765=['save','remove','update','emit','removeListener','length','./voiceQueueReport.events'];(function(_0x285e97,_0x3f7f63){var _0x383f43=function(_0x1795e8){while(--_0x1795e8){_0x285e97['push'](_0x285e97['shift']());}};_0x383f43(++_0x3f7f63);}(_0xd765,0xdf));var _0x5d76=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0xd765[_0x1cc8fe];return _0x230054;};'use strict';var VoiceQueueReportEvents=require(_0x5d76('0x0'));var events=[_0x5d76('0x1'),_0x5d76('0x2'),_0x5d76('0x3')];function createListener(_0x245264,_0x44fed4){return function(_0x4ce5da){_0x44fed4[_0x5d76('0x4')](_0x245264,_0x4ce5da);};}function removeListener(_0x5f18e0,_0x1a7983){return function(){VoiceQueueReportEvents[_0x5d76('0x5')](_0x5f18e0,_0x1a7983);};}exports['register']=function(_0x280536){for(var _0x175058=0x0,_0x444693=events[_0x5d76('0x6')];_0x175058<_0x444693;_0x175058++){var _0x333db6=events[_0x175058];var _0x116d32=createListener('voiceQueueReport:'+_0x333db6,_0x280536);VoiceQueueReportEvents['on'](_0x333db6,_0x116d32);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index 5134127..950edc4 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 _0x853b=['./voiceQueuesLog.controller','isAuthenticated','index','get','/:id','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x8e1758,_0x48f03e){var _0x122def=function(_0x2b7788){while(--_0x2b7788){_0x8e1758['push'](_0x8e1758['shift']());}};_0x122def(++_0x48f03e);}(_0x853b,0x161));var _0xb853=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x853b[_0x432682];return _0x463d05;};'use strict';var multer=require(_0xb853('0x0'));var util=require(_0xb853('0x1'));var path=require(_0xb853('0x2'));var timeout=require(_0xb853('0x3'));var express=require('express');var router=express[_0xb853('0x4')]();var fs_extra=require(_0xb853('0x5'));var auth=require(_0xb853('0x6'));var interaction=require(_0xb853('0x7'));var config=require('../../config/environment');var controller=require(_0xb853('0x8'));router['get']('/',auth[_0xb853('0x9')](),controller[_0xb853('0xa')]);router[_0xb853('0xb')](_0xb853('0xc'),auth[_0xb853('0x9')](),controller['show']);router[_0xb853('0xd')]('/',auth[_0xb853('0x9')](),controller[_0xb853('0xe')]);router[_0xb853('0xf')](_0xb853('0xc'),auth[_0xb853('0x9')](),controller['update']);router[_0xb853('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xb853('0x11')]);module[_0xb853('0x12')]=router; \ No newline at end of file +var _0xb0c9=['show','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','get','index','/:id','isAuthenticated'];(function(_0x2a6d45,_0x3c9321){var _0x295253=function(_0x51d622){while(--_0x51d622){_0x2a6d45['push'](_0x2a6d45['shift']());}};_0x295253(++_0x3c9321);}(_0xb0c9,0xd8));var _0x9b0c=function(_0x56ed51,_0x5acddc){_0x56ed51=_0x56ed51-0x0;var _0x521784=_0xb0c9[_0x56ed51];return _0x521784;};'use strict';var multer=require(_0x9b0c('0x0'));var util=require(_0x9b0c('0x1'));var path=require(_0x9b0c('0x2'));var timeout=require(_0x9b0c('0x3'));var express=require(_0x9b0c('0x4'));var router=express['Router']();var fs_extra=require(_0x9b0c('0x5'));var auth=require(_0x9b0c('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x9b0c('0x7'));var controller=require('./voiceQueuesLog.controller');router[_0x9b0c('0x8')]('/',auth['isAuthenticated'](),controller[_0x9b0c('0x9')]);router['get'](_0x9b0c('0xa'),auth[_0x9b0c('0xb')](),controller[_0x9b0c('0xc')]);router[_0x9b0c('0xd')]('/',auth['isAuthenticated'](),controller[_0x9b0c('0xe')]);router[_0x9b0c('0xf')](_0x9b0c('0xa'),auth[_0x9b0c('0xb')](),controller['update']);router[_0x9b0c('0x10')](_0x9b0c('0xa'),auth[_0x9b0c('0xb')](),controller[_0x9b0c('0x11')]);module[_0x9b0c('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index 7cf4c5d..d40fd55 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 _0xaafc=['format','YYYY-MM-DD\x20HH:mm:ss','moment','exports','STRING','DATE'];(function(_0x48beac,_0x29cb44){var _0x155200=function(_0x412c17){while(--_0x412c17){_0x48beac['push'](_0x48beac['shift']());}};_0x155200(++_0x29cb44);}(_0xaafc,0x176));var _0xcaaf=function(_0x56130e,_0x2b103b){_0x56130e=_0x56130e-0x0;var _0x2cc33d=_0xaafc[_0x56130e];return _0x2cc33d;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xcaaf('0x0'));module[_0xcaaf('0x1')]={'time':{'type':Sequelize[_0xcaaf('0x2')]},'callid':{'type':Sequelize[_0xcaaf('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xcaaf('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xcaaf('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xcaaf('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xcaaf('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xcaaf('0x3')],'allowNull':![],'defaultValue':moment()[_0xcaaf('0x4')](_0xcaaf('0x5'))}}; \ No newline at end of file +var _0x9199=['moment','STRING','DATE','format','sequelize'];(function(_0x308f27,_0x53d24e){var _0x562ef0=function(_0x339c22){while(--_0x339c22){_0x308f27['push'](_0x308f27['shift']());}};_0x562ef0(++_0x53d24e);}(_0x9199,0x1e9));var _0x9919=function(_0x1db72a,_0x22f6bc){_0x1db72a=_0x1db72a-0x0;var _0x1c7ee7=_0x9199[_0x1db72a];return _0x1c7ee7;};'use strict';var Sequelize=require(_0x9919('0x0'));var moment=require(_0x9919('0x1'));module['exports']={'time':{'type':Sequelize[_0x9919('0x2')]},'callid':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x9919('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x9919('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x9919('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x9919('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x9919('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x9919('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x9919('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x9919('0x3')],'allowNull':![],'defaultValue':moment()[_0x9919('0x4')]('YYYY-MM-DD\x20HH:mm:ss')}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index 28f26a4..833f409 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 _0x242c=['intersection','fields','hasOwnProperty','order','sort','where','pick','merge','type','VIRTUAL','filter','options','VoiceQueuesLog','includeAll','include','findAll','show','params','catch','create','body','destroy','find','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','error','name','send','index','map','rawAttributes','key','model','keys','query','filters','attributes'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x242c,0xa7));var _0xc242=function(_0x3c8757,_0x3bde2b){_0x3c8757=_0x3c8757-0x0;var _0x3baee9=_0x242c[_0x3c8757];return _0x3baee9;};'use strict';var emlformat=require(_0xc242('0x0'));var rimraf=require(_0xc242('0x1'));var zipdir=require(_0xc242('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc242('0x3'));var moment=require(_0xc242('0x4'));var BPromise=require(_0xc242('0x5'));var Mustache=require(_0xc242('0x6'));var util=require('util');var path=require(_0xc242('0x7'));var sox=require('sox');var csv=require(_0xc242('0x8'));var ejs=require(_0xc242('0x9'));var fs=require('fs');var fs_extra=require(_0xc242('0xa'));var _=require('lodash');var squel=require(_0xc242('0xb'));var crypto=require(_0xc242('0xc'));var jsforce=require(_0xc242('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xc242('0x8'));var querystring=require(_0xc242('0xe'));var Papa=require(_0xc242('0xf'));var Redis=require(_0xc242('0x10'));var authService=require(_0xc242('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc242('0x12'));var logger=require('../../config/logger')(_0xc242('0x13'));var utils=require('../../config/utils');var config=require(_0xc242('0x14'));var licenseUtil=require(_0xc242('0x15'));var db=require(_0xc242('0x16'))['db'];function respondWithStatusCode(_0x305e78,_0x23cfbb){_0x23cfbb=_0x23cfbb||0xcc;return function(_0x105522){if(_0x105522){return _0x305e78[_0xc242('0x17')](_0x23cfbb);}return _0x305e78[_0xc242('0x18')](_0x23cfbb)[_0xc242('0x19')]();};}function respondWithResult(_0xcf2d06,_0x5c64df){_0x5c64df=_0x5c64df||0xc8;return function(_0xc0336a){if(_0xc0336a){return _0xcf2d06['status'](_0x5c64df)[_0xc242('0x1a')](_0xc0336a);}};}function respondWithFilteredResult(_0x118486,_0x57383c){return function(_0x2e123e){if(_0x2e123e){var _0x1056fe=typeof _0x57383c['offset']===_0xc242('0x1b')&&typeof _0x57383c[_0xc242('0x1c')]==='undefined';var _0x190374=_0x2e123e[_0xc242('0x1d')];var _0x1274ba=_0x1056fe?0x0:_0x57383c[_0xc242('0x1e')];var _0x8a6a81=_0x1056fe?_0x2e123e['count']:_0x57383c[_0xc242('0x1e')]+_0x57383c[_0xc242('0x1c')];var _0x4e73c2;if(_0x8a6a81>=_0x190374){_0x8a6a81=_0x190374;_0x4e73c2=0xc8;}else{_0x4e73c2=0xce;}_0x118486['status'](_0x4e73c2);return _0x118486[_0xc242('0x1f')](_0xc242('0x20'),_0x1274ba+'-'+_0x8a6a81+'/'+_0x190374)[_0xc242('0x1a')](_0x2e123e);}return null;};}function patchUpdates(_0x355cbb){return function(_0x24e1df){try{jsonpatch[_0xc242('0x21')](_0x24e1df,_0x355cbb,!![]);}catch(_0x4c4eb2){return BPromise[_0xc242('0x22')](_0x4c4eb2);}return _0x24e1df[_0xc242('0x23')]();};}function saveUpdates(_0x26a1c5,_0x64f4a3){return function(_0x50204a){if(_0x50204a){return _0x50204a['update'](_0x26a1c5)[_0xc242('0x24')](function(_0x1f9a2a){return _0x1f9a2a;});}return null;};}function removeEntity(_0x5f0a03,_0x51c85c){return function(_0x5d4388){if(_0x5d4388){return _0x5d4388['destroy']()['then'](function(){_0x5f0a03['status'](0xcc)[_0xc242('0x19')]();});}};}function handleEntityNotFound(_0x326204,_0x28f4d8){return function(_0x22fc96){if(!_0x22fc96){_0x326204[_0xc242('0x17')](0x194);}return _0x22fc96;};}function handleError(_0x3f98fd,_0x21eede){_0x21eede=_0x21eede||0x1f4;return function(_0x4523f8){logger[_0xc242('0x25')](_0x4523f8['stack']);if(_0x4523f8[_0xc242('0x26')]){delete _0x4523f8[_0xc242('0x26')];}_0x3f98fd[_0xc242('0x18')](_0x21eede)[_0xc242('0x27')](_0x4523f8);};}exports[_0xc242('0x28')]=function(_0x552850,_0x22bf10){var _0x2b4a99={},_0x3d9c62={},_0x251034={'count':0x0,'rows':[]};var _0x3c7f07=_[_0xc242('0x29')](db['VoiceQueuesLog'][_0xc242('0x2a')],function(_0x1f7387){return{'name':_0x1f7387['fieldName'],'type':_0x1f7387['type'][_0xc242('0x2b')]};});_0x3d9c62[_0xc242('0x2c')]=_['map'](_0x3c7f07,'name');_0x3d9c62['query']=_[_0xc242('0x2d')](_0x552850[_0xc242('0x2e')]);_0x3d9c62[_0xc242('0x2f')]=_['intersection'](_0x3d9c62[_0xc242('0x2c')],_0x3d9c62[_0xc242('0x2e')]);_0x2b4a99[_0xc242('0x30')]=_[_0xc242('0x31')](_0x3d9c62[_0xc242('0x2c')],qs[_0xc242('0x32')](_0x552850[_0xc242('0x2e')][_0xc242('0x32')]));_0x2b4a99['attributes']=_0x2b4a99[_0xc242('0x30')]['length']?_0x2b4a99[_0xc242('0x30')]:_0x3d9c62['model'];if(!_0x552850[_0xc242('0x2e')][_0xc242('0x33')]('nolimit')){_0x2b4a99[_0xc242('0x1c')]=qs['limit'](_0x552850[_0xc242('0x2e')]['limit']);_0x2b4a99['offset']=qs['offset'](_0x552850[_0xc242('0x2e')][_0xc242('0x1e')]);}_0x2b4a99[_0xc242('0x34')]=qs[_0xc242('0x35')](_0x552850[_0xc242('0x2e')][_0xc242('0x35')]);_0x2b4a99[_0xc242('0x36')]=qs[_0xc242('0x2f')](_[_0xc242('0x37')](_0x552850[_0xc242('0x2e')],_0x3d9c62[_0xc242('0x2f')]),_0x3c7f07);if(_0x552850[_0xc242('0x2e')]['filter']){_0x2b4a99['where']=_[_0xc242('0x38')](_0x2b4a99['where'],{'$or':_[_0xc242('0x29')](_0x3c7f07,function(_0x3f4957){if(_0x3f4957[_0xc242('0x39')]!==_0xc242('0x3a')){var _0x5e154e={};_0x5e154e[_0x3f4957[_0xc242('0x26')]]={'$like':'%'+_0x552850[_0xc242('0x2e')][_0xc242('0x3b')]+'%'};return _0x5e154e;}})});}_0x2b4a99=_['merge']({},_0x2b4a99,_0x552850[_0xc242('0x3c')]);var _0x2cef58={'where':_0x2b4a99[_0xc242('0x36')]};return db[_0xc242('0x3d')][_0xc242('0x1d')](_0x2cef58)[_0xc242('0x24')](function(_0x9aabce){_0x251034['count']=_0x9aabce;if(_0x552850[_0xc242('0x2e')][_0xc242('0x3e')]){_0x2b4a99[_0xc242('0x3f')]=[{'all':!![]}];}return db[_0xc242('0x3d')][_0xc242('0x40')](_0x2b4a99);})['then'](function(_0x4ad7c2){_0x251034['rows']=_0x4ad7c2;return _0x251034;})[_0xc242('0x24')](respondWithFilteredResult(_0x22bf10,_0x2b4a99))['catch'](handleError(_0x22bf10,null));};exports[_0xc242('0x41')]=function(_0x287ab1,_0x42f029){var _0x31391d={'raw':!![],'where':{'id':_0x287ab1[_0xc242('0x42')]['id']}},_0x36cf2e={};_0x36cf2e['model']=_[_0xc242('0x2d')](db[_0xc242('0x3d')][_0xc242('0x2a')]);_0x36cf2e[_0xc242('0x2e')]=_[_0xc242('0x2d')](_0x287ab1[_0xc242('0x2e')]);_0x36cf2e[_0xc242('0x2f')]=_[_0xc242('0x31')](_0x36cf2e['model'],_0x36cf2e['query']);_0x31391d[_0xc242('0x30')]=_[_0xc242('0x31')](_0x36cf2e[_0xc242('0x2c')],qs[_0xc242('0x32')](_0x287ab1[_0xc242('0x2e')][_0xc242('0x32')]));_0x31391d[_0xc242('0x30')]=_0x31391d[_0xc242('0x30')]['length']?_0x31391d[_0xc242('0x30')]:_0x36cf2e[_0xc242('0x2c')];if(_0x287ab1['query'][_0xc242('0x3e')]){_0x31391d[_0xc242('0x3f')]=[{'all':!![]}];}_0x31391d=_[_0xc242('0x38')]({},_0x31391d,_0x287ab1['options']);return db['VoiceQueuesLog']['find'](_0x31391d)[_0xc242('0x24')](handleEntityNotFound(_0x42f029,null))[_0xc242('0x24')](respondWithResult(_0x42f029,null))[_0xc242('0x43')](handleError(_0x42f029,null));};exports[_0xc242('0x44')]=function(_0x5cb4f6,_0x15c102){return db['VoiceQueuesLog'][_0xc242('0x44')](_0x5cb4f6['body'],{})[_0xc242('0x24')](respondWithResult(_0x15c102,0xc9))[_0xc242('0x43')](handleError(_0x15c102,null));};exports['update']=function(_0x12c21a,_0x1a4768){if(_0x12c21a[_0xc242('0x45')]['id']){delete _0x12c21a['body']['id'];}return db[_0xc242('0x3d')]['find']({'where':{'id':_0x12c21a[_0xc242('0x42')]['id']}})[_0xc242('0x24')](handleEntityNotFound(_0x1a4768,null))[_0xc242('0x24')](saveUpdates(_0x12c21a[_0xc242('0x45')],null))['then'](respondWithResult(_0x1a4768,null))[_0xc242('0x43')](handleError(_0x1a4768,null));};exports[_0xc242('0x46')]=function(_0x184398,_0x24a14f){return db[_0xc242('0x3d')][_0xc242('0x47')]({'where':{'id':_0x184398['params']['id']}})[_0xc242('0x24')](handleEntityNotFound(_0x24a14f,null))['then'](removeEntity(_0x24a14f,null))[_0xc242('0x43')](handleError(_0x24a14f,null));}; \ No newline at end of file +var _0xf510=['model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','include','findAll','params','keys','includeAll','options','catch','create','body','update','find','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/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','then','destroy','error','name','send','index','VoiceQueuesLog','rawAttributes','type','key'];(function(_0x5e4d43,_0x135265){var _0x506d2a=function(_0x4bf239){while(--_0x4bf239){_0x5e4d43['push'](_0x5e4d43['shift']());}};_0x506d2a(++_0x135265);}(_0xf510,0xb0));var _0x0f51=function(_0x7a65c9,_0x310caf){_0x7a65c9=_0x7a65c9-0x0;var _0x35bc4b=_0xf510[_0x7a65c9];return _0x35bc4b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0f51('0x0'));var zipdir=require(_0x0f51('0x1'));var jsonpatch=require(_0x0f51('0x2'));var rp=require(_0x0f51('0x3'));var moment=require(_0x0f51('0x4'));var BPromise=require(_0x0f51('0x5'));var Mustache=require(_0x0f51('0x6'));var util=require(_0x0f51('0x7'));var path=require(_0x0f51('0x8'));var sox=require(_0x0f51('0x9'));var csv=require('to-csv');var ejs=require(_0x0f51('0xa'));var fs=require('fs');var fs_extra=require(_0x0f51('0xb'));var _=require('lodash');var squel=require(_0x0f51('0xc'));var crypto=require(_0x0f51('0xd'));var jsforce=require(_0x0f51('0xe'));var deskjs=require(_0x0f51('0xf'));var toCsv=require('to-csv');var querystring=require(_0x0f51('0x10'));var Papa=require(_0x0f51('0x11'));var Redis=require(_0x0f51('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x0f51('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0f51('0x14'));var logger=require(_0x0f51('0x15'))(_0x0f51('0x16'));var utils=require('../../config/utils');var config=require(_0x0f51('0x17'));var licenseUtil=require(_0x0f51('0x18'));var db=require(_0x0f51('0x19'))['db'];function respondWithStatusCode(_0x2cf616,_0x2c83ef){_0x2c83ef=_0x2c83ef||0xcc;return function(_0x2210ff){if(_0x2210ff){return _0x2cf616[_0x0f51('0x1a')](_0x2c83ef);}return _0x2cf616[_0x0f51('0x1b')](_0x2c83ef)[_0x0f51('0x1c')]();};}function respondWithResult(_0x12accc,_0x23e055){_0x23e055=_0x23e055||0xc8;return function(_0x1bec53){if(_0x1bec53){return _0x12accc[_0x0f51('0x1b')](_0x23e055)[_0x0f51('0x1d')](_0x1bec53);}};}function respondWithFilteredResult(_0x5b111,_0x1e568e){return function(_0x41de7f){if(_0x41de7f){var _0x27d693=typeof _0x1e568e[_0x0f51('0x1e')]===_0x0f51('0x1f')&&typeof _0x1e568e[_0x0f51('0x20')]===_0x0f51('0x1f');var _0x415c1f=_0x41de7f['count'];var _0x439191=_0x27d693?0x0:_0x1e568e[_0x0f51('0x1e')];var _0x44f1aa=_0x27d693?_0x41de7f[_0x0f51('0x21')]:_0x1e568e['offset']+_0x1e568e[_0x0f51('0x20')];var _0x51f060;if(_0x44f1aa>=_0x415c1f){_0x44f1aa=_0x415c1f;_0x51f060=0xc8;}else{_0x51f060=0xce;}_0x5b111['status'](_0x51f060);return _0x5b111['set'](_0x0f51('0x22'),_0x439191+'-'+_0x44f1aa+'/'+_0x415c1f)[_0x0f51('0x1d')](_0x41de7f);}return null;};}function patchUpdates(_0x41ee52){return function(_0x21ab34){try{jsonpatch['apply'](_0x21ab34,_0x41ee52,!![]);}catch(_0x1f855c){return BPromise[_0x0f51('0x23')](_0x1f855c);}return _0x21ab34['save']();};}function saveUpdates(_0xa5dc52,_0x3321df){return function(_0x3eb364){if(_0x3eb364){return _0x3eb364['update'](_0xa5dc52)[_0x0f51('0x24')](function(_0x241e8b){return _0x241e8b;});}return null;};}function removeEntity(_0x4d6fdc,_0x291a7f){return function(_0x411988){if(_0x411988){return _0x411988[_0x0f51('0x25')]()['then'](function(){_0x4d6fdc[_0x0f51('0x1b')](0xcc)[_0x0f51('0x1c')]();});}};}function handleEntityNotFound(_0x3ff614,_0x1ac4a4){return function(_0x2b5068){if(!_0x2b5068){_0x3ff614[_0x0f51('0x1a')](0x194);}return _0x2b5068;};}function handleError(_0x54d2bc,_0x15334f){_0x15334f=_0x15334f||0x1f4;return function(_0x23edbd){logger[_0x0f51('0x26')](_0x23edbd['stack']);if(_0x23edbd[_0x0f51('0x27')]){delete _0x23edbd['name'];}_0x54d2bc[_0x0f51('0x1b')](_0x15334f)[_0x0f51('0x28')](_0x23edbd);};}exports[_0x0f51('0x29')]=function(_0x476a5f,_0xf513d6){var _0x3cbf48={},_0x5e187a={},_0x1b817d={'count':0x0,'rows':[]};var _0x45e624=_['map'](db[_0x0f51('0x2a')][_0x0f51('0x2b')],function(_0x459e5e){return{'name':_0x459e5e['fieldName'],'type':_0x459e5e[_0x0f51('0x2c')][_0x0f51('0x2d')]};});_0x5e187a[_0x0f51('0x2e')]=_[_0x0f51('0x2f')](_0x45e624,_0x0f51('0x27'));_0x5e187a[_0x0f51('0x30')]=_['keys'](_0x476a5f[_0x0f51('0x30')]);_0x5e187a[_0x0f51('0x31')]=_[_0x0f51('0x32')](_0x5e187a[_0x0f51('0x2e')],_0x5e187a['query']);_0x3cbf48[_0x0f51('0x33')]=_[_0x0f51('0x32')](_0x5e187a[_0x0f51('0x2e')],qs[_0x0f51('0x34')](_0x476a5f[_0x0f51('0x30')]['fields']));_0x3cbf48[_0x0f51('0x33')]=_0x3cbf48[_0x0f51('0x33')][_0x0f51('0x35')]?_0x3cbf48[_0x0f51('0x33')]:_0x5e187a[_0x0f51('0x2e')];if(!_0x476a5f['query'][_0x0f51('0x36')](_0x0f51('0x37'))){_0x3cbf48[_0x0f51('0x20')]=qs['limit'](_0x476a5f[_0x0f51('0x30')]['limit']);_0x3cbf48[_0x0f51('0x1e')]=qs[_0x0f51('0x1e')](_0x476a5f[_0x0f51('0x30')][_0x0f51('0x1e')]);}_0x3cbf48[_0x0f51('0x38')]=qs[_0x0f51('0x39')](_0x476a5f[_0x0f51('0x30')][_0x0f51('0x39')]);_0x3cbf48[_0x0f51('0x3a')]=qs[_0x0f51('0x31')](_[_0x0f51('0x3b')](_0x476a5f['query'],_0x5e187a[_0x0f51('0x31')]),_0x45e624);if(_0x476a5f['query'][_0x0f51('0x3c')]){_0x3cbf48['where']=_[_0x0f51('0x3d')](_0x3cbf48[_0x0f51('0x3a')],{'$or':_['map'](_0x45e624,function(_0x1bb795){if(_0x1bb795['type']!==_0x0f51('0x3e')){var _0x3a6f32={};_0x3a6f32[_0x1bb795[_0x0f51('0x27')]]={'$like':'%'+_0x476a5f[_0x0f51('0x30')][_0x0f51('0x3c')]+'%'};return _0x3a6f32;}})});}_0x3cbf48=_[_0x0f51('0x3d')]({},_0x3cbf48,_0x476a5f['options']);var _0x431778={'where':_0x3cbf48['where']};return db[_0x0f51('0x2a')][_0x0f51('0x21')](_0x431778)[_0x0f51('0x24')](function(_0x25ee91){_0x1b817d[_0x0f51('0x21')]=_0x25ee91;if(_0x476a5f[_0x0f51('0x30')]['includeAll']){_0x3cbf48[_0x0f51('0x3f')]=[{'all':!![]}];}return db[_0x0f51('0x2a')][_0x0f51('0x40')](_0x3cbf48);})[_0x0f51('0x24')](function(_0x261c30){_0x1b817d['rows']=_0x261c30;return _0x1b817d;})[_0x0f51('0x24')](respondWithFilteredResult(_0xf513d6,_0x3cbf48))['catch'](handleError(_0xf513d6,null));};exports['show']=function(_0xd6e31a,_0x1cb2d3){var _0x3fb338={'raw':!![],'where':{'id':_0xd6e31a[_0x0f51('0x41')]['id']}},_0x21f9f3={};_0x21f9f3[_0x0f51('0x2e')]=_[_0x0f51('0x42')](db[_0x0f51('0x2a')][_0x0f51('0x2b')]);_0x21f9f3[_0x0f51('0x30')]=_[_0x0f51('0x42')](_0xd6e31a['query']);_0x21f9f3[_0x0f51('0x31')]=_[_0x0f51('0x32')](_0x21f9f3[_0x0f51('0x2e')],_0x21f9f3[_0x0f51('0x30')]);_0x3fb338[_0x0f51('0x33')]=_[_0x0f51('0x32')](_0x21f9f3[_0x0f51('0x2e')],qs[_0x0f51('0x34')](_0xd6e31a[_0x0f51('0x30')][_0x0f51('0x34')]));_0x3fb338[_0x0f51('0x33')]=_0x3fb338['attributes']['length']?_0x3fb338['attributes']:_0x21f9f3[_0x0f51('0x2e')];if(_0xd6e31a[_0x0f51('0x30')][_0x0f51('0x43')]){_0x3fb338['include']=[{'all':!![]}];}_0x3fb338=_[_0x0f51('0x3d')]({},_0x3fb338,_0xd6e31a[_0x0f51('0x44')]);return db[_0x0f51('0x2a')]['find'](_0x3fb338)[_0x0f51('0x24')](handleEntityNotFound(_0x1cb2d3,null))[_0x0f51('0x24')](respondWithResult(_0x1cb2d3,null))[_0x0f51('0x45')](handleError(_0x1cb2d3,null));};exports['create']=function(_0x662e8b,_0x3ab641){return db[_0x0f51('0x2a')][_0x0f51('0x46')](_0x662e8b[_0x0f51('0x47')],{})[_0x0f51('0x24')](respondWithResult(_0x3ab641,0xc9))[_0x0f51('0x45')](handleError(_0x3ab641,null));};exports[_0x0f51('0x48')]=function(_0x55ea09,_0x1a320e){if(_0x55ea09[_0x0f51('0x47')]['id']){delete _0x55ea09[_0x0f51('0x47')]['id'];}return db[_0x0f51('0x2a')][_0x0f51('0x49')]({'where':{'id':_0x55ea09[_0x0f51('0x41')]['id']}})[_0x0f51('0x24')](handleEntityNotFound(_0x1a320e,null))[_0x0f51('0x24')](saveUpdates(_0x55ea09[_0x0f51('0x47')],null))[_0x0f51('0x24')](respondWithResult(_0x1a320e,null))[_0x0f51('0x45')](handleError(_0x1a320e,null));};exports[_0x0f51('0x25')]=function(_0x295ca3,_0x1e44dd){return db[_0x0f51('0x2a')]['find']({'where':{'id':_0x295ca3['params']['id']}})['then'](handleEntityNotFound(_0x1e44dd,null))[_0x0f51('0x24')](removeEntity(_0x1e44dd,null))[_0x0f51('0x45')](handleError(_0x1e44dd,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 022de4c..9fc201c 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 _0x33ed=['event','dtm','util','moment','path','rimraf','../../config/environment','VoiceQueuesLog','voice_queues_log','event_dtm'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x33ed,0x66));var _0xd33e=function(_0x95411e,_0x38b4c3){_0x95411e=_0x95411e-0x0;var _0x2c8718=_0x33ed[_0x95411e];return _0x2c8718;};'use strict';var _=require('lodash');var util=require(_0xd33e('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xd33e('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xd33e('0x2'));var rimraf=require(_0xd33e('0x3'));var config=require(_0xd33e('0x4'));var attributes=require('./voiceQueuesLog.attributes');module['exports']=function(_0x19e69f,_0x230ec8){return _0x19e69f['define'](_0xd33e('0x5'),attributes,{'tableName':_0xd33e('0x6'),'paranoid':![],'indexes':[{'name':_0xd33e('0x7'),'fields':[_0xd33e('0x8'),_0xd33e('0x9')]}],'timestamps':![]});}; \ No newline at end of file +var _0x67c9=['voice_queues_log','dtm','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./voiceQueuesLog.attributes','exports','define','VoiceQueuesLog'];(function(_0x106e40,_0x3cc0fd){var _0x307b83=function(_0x1cf6a7){while(--_0x1cf6a7){_0x106e40['push'](_0x106e40['shift']());}};_0x307b83(++_0x3cc0fd);}(_0x67c9,0x1a6));var _0x967c=function(_0x4c440b,_0x3ea627){_0x4c440b=_0x4c440b-0x0;var _0x2d48cf=_0x67c9[_0x4c440b];return _0x2d48cf;};'use strict';var _=require(_0x967c('0x0'));var util=require(_0x967c('0x1'));var logger=require(_0x967c('0x2'))(_0x967c('0x3'));var moment=require(_0x967c('0x4'));var BPromise=require(_0x967c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x967c('0x6'));var rimraf=require(_0x967c('0x7'));var config=require(_0x967c('0x8'));var attributes=require(_0x967c('0x9'));module[_0x967c('0xa')]=function(_0x306620,_0x5d344b){return _0x306620[_0x967c('0xb')](_0x967c('0xc'),attributes,{'tableName':_0x967c('0xd'),'paranoid':![],'indexes':[{'name':'event_dtm','fields':['event',_0x967c('0xe')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index 33f8abe..0653aa9 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 _0x3a79=['rpc','../../config/environment','client','request','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','error','code','message','VoiceQueuesLog,\x20%s,\x20%s','info','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x3ac900,_0x138206){var _0x36f9ff=function(_0x3df908){while(--_0x3df908){_0x3ac900['push'](_0x3ac900['shift']());}};_0x36f9ff(++_0x138206);}(_0x3a79,0xca));var _0x93a7=function(_0x2578cd,_0x2bb9ef){_0x2578cd=_0x2578cd-0x0;var _0x16e469=_0x3a79[_0x2578cd];return _0x16e469;};'use strict';var _=require('lodash');var util=require(_0x93a7('0x0'));var moment=require(_0x93a7('0x1'));var BPromise=require('bluebird');var rs=require(_0x93a7('0x2'));var fs=require('fs');var Redis=require(_0x93a7('0x3'));var db=require(_0x93a7('0x4'))['db'];var utils=require(_0x93a7('0x5'));var logger=require(_0x93a7('0x6'))(_0x93a7('0x7'));var config=require(_0x93a7('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x93a7('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2579e5,_0x4690bb,_0x1b59d1){return new BPromise(function(_0x2417da,_0x3a512b){return client[_0x93a7('0xa')](_0x2579e5,_0x1b59d1)['then'](function(_0x2996db){logger['info']('VoiceQueuesLog,\x20%s,\x20%s',_0x4690bb,_0x93a7('0xb'));logger[_0x93a7('0xc')](_0x93a7('0xd'),_0x4690bb,'request\x20sent',JSON['stringify'](_0x2996db));if(_0x2996db[_0x93a7('0xe')]){if(_0x2996db[_0x93a7('0xe')][_0x93a7('0xf')]===0x1f4){logger['error']('VoiceQueuesLog,\x20%s,\x20%s',_0x4690bb,_0x2996db[_0x93a7('0xe')]['message']);return _0x3a512b(_0x2996db[_0x93a7('0xe')][_0x93a7('0x10')]);}logger[_0x93a7('0xe')](_0x93a7('0x11'),_0x4690bb,_0x2996db[_0x93a7('0xe')][_0x93a7('0x10')]);return _0x2417da(_0x2996db[_0x93a7('0xe')]['message']);}else{logger[_0x93a7('0x12')](_0x93a7('0x11'),_0x4690bb,'request\x20sent');_0x2417da(_0x2996db['result'][_0x93a7('0x10')]);}})['catch'](function(_0xfac49d){logger[_0x93a7('0xe')](_0x93a7('0x11'),_0x4690bb,_0xfac49d);_0x3a512b(_0xfac49d);});});} \ No newline at end of file +var _0x8029=['ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','then','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','lodash','util','bluebird','randomstring'];(function(_0x559da0,_0x371559){var _0x284239=function(_0xee9b8c){while(--_0xee9b8c){_0x559da0['push'](_0x559da0['shift']());}};_0x284239(++_0x371559);}(_0x8029,0xf8));var _0x9802=function(_0x36702a,_0x31c6e6){_0x36702a=_0x36702a-0x0;var _0xc8ca6d=_0x8029[_0x36702a];return _0xc8ca6d;};'use strict';var _=require(_0x9802('0x0'));var util=require(_0x9802('0x1'));var moment=require('moment');var BPromise=require(_0x9802('0x2'));var rs=require(_0x9802('0x3'));var fs=require('fs');var Redis=require(_0x9802('0x4'));var db=require(_0x9802('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9802('0x6'));var config=require(_0x9802('0x7'));var jayson=require(_0x9802('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x52f9a0,_0x39f748,_0xa50d40){return new BPromise(function(_0x1d1405,_0x331bb1){return client['request'](_0x52f9a0,_0xa50d40)[_0x9802('0x9')](function(_0x2930eb){logger['info'](_0x9802('0xa'),_0x39f748,_0x9802('0xb'));logger['debug']('VoiceQueuesLog,\x20%s,\x20%s,\x20%s',_0x39f748,'request\x20sent',JSON[_0x9802('0xc')](_0x2930eb));if(_0x2930eb[_0x9802('0xd')]){if(_0x2930eb[_0x9802('0xd')][_0x9802('0xe')]===0x1f4){logger['error']('VoiceQueuesLog,\x20%s,\x20%s',_0x39f748,_0x2930eb[_0x9802('0xd')][_0x9802('0xf')]);return _0x331bb1(_0x2930eb[_0x9802('0xd')][_0x9802('0xf')]);}logger[_0x9802('0xd')](_0x9802('0xa'),_0x39f748,_0x2930eb[_0x9802('0xd')][_0x9802('0xf')]);return _0x1d1405(_0x2930eb[_0x9802('0xd')][_0x9802('0xf')]);}else{logger[_0x9802('0x10')](_0x9802('0xa'),_0x39f748,_0x9802('0xb'));_0x1d1405(_0x2930eb['result']['message']);}})[_0x9802('0x11')](function(_0x440c8d){logger[_0x9802('0xd')]('VoiceQueuesLog,\x20%s,\x20%s',_0x39f748,_0x440c8d);_0x331bb1(_0x440c8d);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 8dea995..18fcf9a 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 _0x0b21=['show','/:id/download','download','downloads','/:id/transcribe','downloadTranscribe','post','create','update','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0x0b21,0xdb));var _0x10b2=function(_0xa65309,_0x109948){_0xa65309=_0xa65309-0x0;var _0x48a38f=_0x0b21[_0xa65309];return _0x48a38f;};'use strict';var multer=require('multer');var util=require(_0x10b2('0x0'));var path=require(_0x10b2('0x1'));var timeout=require(_0x10b2('0x2'));var express=require(_0x10b2('0x3'));var router=express['Router']();var fs_extra=require(_0x10b2('0x4'));var auth=require(_0x10b2('0x5'));var interaction=require(_0x10b2('0x6'));var config=require(_0x10b2('0x7'));var controller=require(_0x10b2('0x8'));router[_0x10b2('0x9')]('/',auth[_0x10b2('0xa')](),controller[_0x10b2('0xb')]);router['get'](_0x10b2('0xc'),auth[_0x10b2('0xa')](),controller[_0x10b2('0xd')]);router['get'](_0x10b2('0xe'),auth['isAuthenticated'](),controller[_0x10b2('0xf')]);router[_0x10b2('0x9')](_0x10b2('0x10'),auth[_0x10b2('0xa')](),controller[_0x10b2('0x11')]);router[_0x10b2('0x9')]('/:id/downloads',controller[_0x10b2('0x12')]);router['get'](_0x10b2('0x13'),auth[_0x10b2('0xa')](),controller[_0x10b2('0x14')]);router[_0x10b2('0x15')]('/',auth[_0x10b2('0xa')](),controller[_0x10b2('0x16')]);router[_0x10b2('0x15')](_0x10b2('0x13'),auth['isAuthenticated'](),controller['runTranscribe']);router['put'](_0x10b2('0xe'),auth[_0x10b2('0xa')](),controller[_0x10b2('0x17')]);router['delete'](_0x10b2('0xe'),auth['isAuthenticated'](),controller[_0x10b2('0x18')]);module[_0x10b2('0x19')]=router; \ No newline at end of file +var _0xd9c1=['../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','/:id/download','/:id/downloads','/:id/transcribe','post','update','delete','exports','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x3bbdae,_0x4bb9b5){var _0x1db911=function(_0x24e0dd){while(--_0x24e0dd){_0x3bbdae['push'](_0x3bbdae['shift']());}};_0x1db911(++_0x4bb9b5);}(_0xd9c1,0x1c8));var _0x1d9c=function(_0x13d3d5,_0x5d13d3){_0x13d3d5=_0x13d3d5-0x0;var _0x10a39d=_0xd9c1[_0x13d3d5];return _0x10a39d;};'use strict';var multer=require('multer');var util=require(_0x1d9c('0x0'));var path=require(_0x1d9c('0x1'));var timeout=require(_0x1d9c('0x2'));var express=require(_0x1d9c('0x3'));var router=express[_0x1d9c('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x1d9c('0x5'));var interaction=require(_0x1d9c('0x6'));var config=require(_0x1d9c('0x7'));var controller=require('./voiceRecording.controller');router[_0x1d9c('0x8')]('/',auth[_0x1d9c('0x9')](),controller['index']);router[_0x1d9c('0x8')](_0x1d9c('0xa'),auth[_0x1d9c('0x9')](),controller[_0x1d9c('0xb')]);router[_0x1d9c('0x8')](_0x1d9c('0xc'),auth[_0x1d9c('0x9')](),controller[_0x1d9c('0xd')]);router[_0x1d9c('0x8')](_0x1d9c('0xe'),auth[_0x1d9c('0x9')](),controller['download']);router[_0x1d9c('0x8')](_0x1d9c('0xf'),controller['downloads']);router['get'](_0x1d9c('0x10'),auth[_0x1d9c('0x9')](),controller['downloadTranscribe']);router[_0x1d9c('0x11')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/transcribe',auth[_0x1d9c('0x9')](),controller['runTranscribe']);router['put'](_0x1d9c('0xc'),auth[_0x1d9c('0x9')](),controller[_0x1d9c('0x12')]);router[_0x1d9c('0x13')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x1d9c('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index 502fe8e..ed8b370 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(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa9e0[_0x19e35c];return _0x3e1fe8;};'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(_0x4b2436,_0x452299){var _0x4f5ab2=function(_0x5c6679){while(--_0x5c6679){_0x4b2436['push'](_0x4b2436['shift']());}};_0x4f5ab2(++_0x452299);}(_0xa9e0,0x123));var _0x0a9e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xa9e0[_0x43d11d];return _0x38cd08;};'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 7ed38eb..25f0691 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 _0x3ef3=['upload','TranscribeService','startTranscriptionJob','basename','bucket','Bucket','Location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeStatus','TranscriptionJobStatus','runTranscribe','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribe','transcribeAccountId','transcribeRegion','language','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','Cloud\x20Provider\x20not\x20configured','data2','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','downloadTranscribe','fileText','root','.txt','Transcript\x20not\x20available','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','uuid/v4','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','end','name','send','index','map','VoiceRecording','rawAttributes','fieldName','type','key','differenceBy','query','keys','filters','intersection','attributes','fields','length','model','nolimit','order','sort','where','filter','merge','VIRTUAL','options','rows','catch','show','params','include','create','body','describe','download','../../components/encryptor','uniqueid','find','value','format','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','unlink','Not\x20found','downloads','sequelize','MD5','token','$and','push','extname','isNil','Entity\x20not\x20found','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','listBuckets','createBucket'];(function(_0x4460e7,_0x1da284){var _0x11c03d=function(_0x141783){while(--_0x141783){_0x4460e7['push'](_0x4460e7['shift']());}};_0x11c03d(++_0x1da284);}(_0x3ef3,0xc1));var _0x33ef=function(_0x1efeb1,_0xe82047){_0x1efeb1=_0x1efeb1-0x0;var _0x198efa=_0x3ef3[_0x1efeb1];return _0x198efa;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x33ef('0x0'));var zipdir=require(_0x33ef('0x1'));var jsonpatch=require(_0x33ef('0x2'));var rp=require(_0x33ef('0x3'));var moment=require(_0x33ef('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x33ef('0x5'));var util=require(_0x33ef('0x6'));var path=require('path');var sox=require(_0x33ef('0x7'));var csv=require(_0x33ef('0x8'));var ejs=require(_0x33ef('0x9'));var fs=require('fs');var fs_extra=require(_0x33ef('0xa'));var _=require(_0x33ef('0xb'));var squel=require(_0x33ef('0xc'));var crypto=require(_0x33ef('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x33ef('0xe'));var toCsv=require(_0x33ef('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var AWS=require('aws-sdk');var uuidv4=require(_0x33ef('0xf'));var Redis=require(_0x33ef('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x33ef('0x11'));var as=require(_0x33ef('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x33ef('0x13'))(_0x33ef('0x14'));var utils=require(_0x33ef('0x15'));var config=require(_0x33ef('0x16'));var licenseUtil=require(_0x33ef('0x17'));var db=require(_0x33ef('0x18'))['db'];function respondWithStatusCode(_0x5091e6,_0x544c84){_0x544c84=_0x544c84||0xcc;return function(_0x2767bb){if(_0x2767bb){return _0x5091e6[_0x33ef('0x19')](_0x544c84);}return _0x5091e6['status'](_0x544c84)['end']();};}function respondWithResult(_0x41dcee,_0x344cf0){_0x344cf0=_0x344cf0||0xc8;return function(_0x24eec2){if(_0x24eec2){return _0x41dcee[_0x33ef('0x1a')](_0x344cf0)[_0x33ef('0x1b')](_0x24eec2);}};}function respondWithFilteredResult(_0x378ac9,_0x13934a){return function(_0x5007fe){if(_0x5007fe){var _0x54ab3b=typeof _0x13934a[_0x33ef('0x1c')]===_0x33ef('0x1d')&&typeof _0x13934a[_0x33ef('0x1e')]===_0x33ef('0x1d');var _0x5e6664=_0x5007fe['count'];var _0x1edf77=_0x54ab3b?0x0:_0x13934a[_0x33ef('0x1c')];var _0x5cc8d7=_0x54ab3b?_0x5007fe[_0x33ef('0x1f')]:_0x13934a[_0x33ef('0x1c')]+_0x13934a[_0x33ef('0x1e')];var _0x4773c3;if(_0x5cc8d7>=_0x5e6664){_0x5cc8d7=_0x5e6664;_0x4773c3=0xc8;}else{_0x4773c3=0xce;}_0x378ac9[_0x33ef('0x1a')](_0x4773c3);return _0x378ac9[_0x33ef('0x20')](_0x33ef('0x21'),_0x1edf77+'-'+_0x5cc8d7+'/'+_0x5e6664)[_0x33ef('0x1b')](_0x5007fe);}return null;};}function patchUpdates(_0x58f89a){return function(_0x583115){try{jsonpatch['apply'](_0x583115,_0x58f89a,!![]);}catch(_0xd159b6){return BPromise[_0x33ef('0x22')](_0xd159b6);}return _0x583115[_0x33ef('0x23')]();};}function saveUpdates(_0x334ec4,_0x2e8095){return function(_0x4b298e){if(_0x4b298e){return _0x4b298e[_0x33ef('0x24')](_0x334ec4)[_0x33ef('0x25')](function(_0x24801e){return _0x24801e;});}return null;};}function removeEntity(_0x103478,_0x1969f4){return function(_0x544a45){if(_0x544a45){return _0x544a45[_0x33ef('0x26')]()[_0x33ef('0x25')](function(){_0x103478['status'](0xcc)[_0x33ef('0x27')]();});}};}function handleEntityNotFound(_0x2fd87c,_0x46fc58){return function(_0x1aa973){if(!_0x1aa973){_0x2fd87c[_0x33ef('0x19')](0x194);}return _0x1aa973;};}function handleError(_0x490aaf,_0x51ee4a){_0x51ee4a=_0x51ee4a||0x1f4;return function(_0xdffab9){logger['error'](_0xdffab9['stack']);if(_0xdffab9[_0x33ef('0x28')]){delete _0xdffab9[_0x33ef('0x28')];}_0x490aaf[_0x33ef('0x1a')](_0x51ee4a)[_0x33ef('0x29')](_0xdffab9);};}exports[_0x33ef('0x2a')]=function(_0x1c8cc4,_0x53fe8d){var _0x3036a3={},_0x1f621a={},_0x25a9b1={'count':0x0,'rows':[]};var _0x4ed595=_[_0x33ef('0x2b')](db[_0x33ef('0x2c')][_0x33ef('0x2d')],function(_0x1ceb8f){return{'name':_0x1ceb8f[_0x33ef('0x2e')],'type':_0x1ceb8f[_0x33ef('0x2f')][_0x33ef('0x30')]};});_0x1f621a['model']=_[_0x33ef('0x31')](_[_0x33ef('0x2b')](_0x4ed595,_0x33ef('0x28')),['format']);_0x1f621a[_0x33ef('0x32')]=_[_0x33ef('0x33')](_0x1c8cc4[_0x33ef('0x32')]);_0x1f621a[_0x33ef('0x34')]=_[_0x33ef('0x35')](_0x1f621a['model'],_0x1f621a[_0x33ef('0x32')]);_0x3036a3[_0x33ef('0x36')]=_[_0x33ef('0x35')](_0x1f621a['model'],qs[_0x33ef('0x37')](_0x1c8cc4[_0x33ef('0x32')][_0x33ef('0x37')]));_0x3036a3[_0x33ef('0x36')]=_0x3036a3['attributes'][_0x33ef('0x38')]?_0x3036a3[_0x33ef('0x36')]:_0x1f621a[_0x33ef('0x39')];if(!_0x1c8cc4[_0x33ef('0x32')]['hasOwnProperty'](_0x33ef('0x3a'))){_0x3036a3[_0x33ef('0x1e')]=qs[_0x33ef('0x1e')](_0x1c8cc4[_0x33ef('0x32')][_0x33ef('0x1e')]);_0x3036a3[_0x33ef('0x1c')]=qs[_0x33ef('0x1c')](_0x1c8cc4[_0x33ef('0x32')][_0x33ef('0x1c')]);}_0x3036a3[_0x33ef('0x3b')]=qs[_0x33ef('0x3c')](_0x1c8cc4['query'][_0x33ef('0x3c')]);_0x3036a3[_0x33ef('0x3d')]=qs[_0x33ef('0x34')](_['pick'](_0x1c8cc4['query'],_0x1f621a['filters']),_0x4ed595);if(_0x1c8cc4['query'][_0x33ef('0x3e')]){_0x3036a3[_0x33ef('0x3d')]=_[_0x33ef('0x3f')](_0x3036a3[_0x33ef('0x3d')],{'$or':_['map'](_0x4ed595,function(_0x34c2f3){if(_0x34c2f3[_0x33ef('0x2f')]!==_0x33ef('0x40')){var _0x1672e8={};_0x1672e8[_0x34c2f3['name']]={'$like':'%'+_0x1c8cc4[_0x33ef('0x32')]['filter']+'%'};return _0x1672e8;}})});}_0x3036a3=_['merge']({},_0x3036a3,_0x1c8cc4[_0x33ef('0x41')]);var _0x5885df={'where':_0x3036a3[_0x33ef('0x3d')]};return db[_0x33ef('0x2c')][_0x33ef('0x1f')](_0x5885df)[_0x33ef('0x25')](function(_0x580b3d){_0x25a9b1[_0x33ef('0x1f')]=_0x580b3d;if(_0x1c8cc4[_0x33ef('0x32')]['includeAll']){_0x3036a3['include']=[{'all':!![]}];}return db[_0x33ef('0x2c')]['findAll'](_0x3036a3);})[_0x33ef('0x25')](function(_0x28ae90){_0x25a9b1[_0x33ef('0x42')]=_0x28ae90;return _0x25a9b1;})[_0x33ef('0x25')](respondWithFilteredResult(_0x53fe8d,_0x3036a3))[_0x33ef('0x43')](handleError(_0x53fe8d,null));};exports[_0x33ef('0x44')]=function(_0x2f500a,_0x3e9a5f){var _0xdd47bc={'raw':![],'where':{'id':_0x2f500a[_0x33ef('0x45')]['id']}},_0x4909aa={};_0x4909aa['model']=_[_0x33ef('0x33')](db[_0x33ef('0x2c')][_0x33ef('0x2d')]);_0x4909aa[_0x33ef('0x32')]=_[_0x33ef('0x33')](_0x2f500a[_0x33ef('0x32')]);_0x4909aa[_0x33ef('0x34')]=_[_0x33ef('0x35')](_0x4909aa[_0x33ef('0x39')],_0x4909aa['query']);_0xdd47bc[_0x33ef('0x36')]=_['intersection'](_0x4909aa[_0x33ef('0x39')],qs[_0x33ef('0x37')](_0x2f500a[_0x33ef('0x32')]['fields']));_0xdd47bc['attributes']=_0xdd47bc[_0x33ef('0x36')]['length']?_0xdd47bc['attributes']:_0x4909aa[_0x33ef('0x39')];if(_0x2f500a[_0x33ef('0x32')]['includeAll']){_0xdd47bc[_0x33ef('0x46')]=[{'all':!![]}];}_0xdd47bc=_[_0x33ef('0x3f')]({},_0xdd47bc,_0x2f500a[_0x33ef('0x41')]);return db['VoiceRecording']['find'](_0xdd47bc)[_0x33ef('0x25')](handleEntityNotFound(_0x3e9a5f,null))[_0x33ef('0x25')](respondWithResult(_0x3e9a5f,null))['catch'](handleError(_0x3e9a5f,null));};exports[_0x33ef('0x47')]=function(_0x2a63e7,_0x3b37c6){return db[_0x33ef('0x2c')]['create'](_0x2a63e7[_0x33ef('0x48')],{})['then'](respondWithResult(_0x3b37c6,0xc9))[_0x33ef('0x43')](handleError(_0x3b37c6,null));};exports[_0x33ef('0x24')]=function(_0x15138a,_0x5d829e){if(_0x15138a[_0x33ef('0x48')]['id']){delete _0x15138a[_0x33ef('0x48')]['id'];}return db[_0x33ef('0x2c')]['find']({'where':{'id':_0x15138a['params']['id']}})['then'](handleEntityNotFound(_0x5d829e,null))[_0x33ef('0x25')](saveUpdates(_0x15138a[_0x33ef('0x48')],null))[_0x33ef('0x25')](respondWithResult(_0x5d829e,null))[_0x33ef('0x43')](handleError(_0x5d829e,null));};exports[_0x33ef('0x49')]=function(_0x446b50,_0x3b1635){return db[_0x33ef('0x2c')][_0x33ef('0x49')]()[_0x33ef('0x25')](respondWithResult(_0x3b1635,null))[_0x33ef('0x43')](handleError(_0x3b1635,null));};exports[_0x33ef('0x4a')]=function(_0x145868,_0x368111,_0x2f48da){var _0x59cf85=require(_0x33ef('0x4b'));var _0x158b81=![];var _0x32d87f={};if(_0x145868[_0x33ef('0x32')][_0x33ef('0x2f')]&&_0x145868[_0x33ef('0x32')][_0x33ef('0x2f')]===_0x33ef('0x4c')){_0x32d87f[_0x33ef('0x4c')]=_0x145868[_0x33ef('0x45')]['id'];}else{_0x32d87f['id']=_0x145868[_0x33ef('0x45')]['id'];}return db[_0x33ef('0x2c')][_0x33ef('0x4d')]({'where':_0x32d87f,'attributes':['id',_0x33ef('0x4e')],'raw':!![]})[_0x33ef('0x25')](handleEntityNotFound(_0x368111,null))[_0x33ef('0x25')](function(_0x1d590e){if(_0x1d590e){var _0x333694=_0x1d590e[_0x33ef('0x4e')];var _0xe1ed1e=util[_0x33ef('0x4f')](_0x33ef('0x50'),_0x333694);if(fs[_0x33ef('0x51')](_0xe1ed1e)){_0x158b81=!![];return _0x59cf85[_0x33ef('0x52')](_0xe1ed1e,_0x333694,config[_0x33ef('0x53')][_0x33ef('0x54')])[_0x33ef('0x25')](function(){return _0x1d590e;});}return _0x1d590e;}})[_0x33ef('0x25')](function(_0x4e7ab7){if(_0x4e7ab7){var _0x20a37c=_0x4e7ab7[_0x33ef('0x4e')];if(!fs[_0x33ef('0x51')](_0x20a37c)){throw new db[(_0x33ef('0x55'))][(_0x33ef('0x56'))](_0x33ef('0x57'));}if(_0x4e7ab7[_0x33ef('0x58')]){return _0x368111[_0x33ef('0x4a')](_0x20a37c,_0x4e7ab7[_0x33ef('0x58')]+path['extname'](_0x20a37c),function(){if(_0x158b81){fs[_0x33ef('0x59')](_0x20a37c);}});}else{return _0x368111['download'](_0x20a37c,function(_0x58f852){if(_0x158b81){fs[_0x33ef('0x59')](_0x20a37c);}});}}})['catch'](function(_0x47a1a4){if(_0x47a1a4['message']==='VoiceRecording\x20not\x20found'){_0x368111[_0x33ef('0x1a')](0x194)[_0x33ef('0x29')](_0x33ef('0x5a'));}else{return handleError(_0x368111,null);}});};exports[_0x33ef('0x5b')]=function(_0x111e9a,_0x507019,_0x34a2f3){var _0x49e04b=require(_0x33ef('0x4b'));var _0x2f0ebd=![];var _0x85ad03={'$and':[db[_0x33ef('0x5c')][_0x33ef('0x3d')](db['sequelize']['fn'](_0x33ef('0x5d'),db[_0x33ef('0x5c')]['col'](_0x33ef('0x4c'))),_0x111e9a['query'][_0x33ef('0x5e')])]};if(_0x111e9a[_0x33ef('0x32')][_0x33ef('0x2f')]&&_0x111e9a[_0x33ef('0x32')][_0x33ef('0x2f')]==='uniqueid'){_0x85ad03[_0x33ef('0x5f')][_0x33ef('0x60')]({'uniqueid':_0x111e9a['params']['id']});}else{_0x85ad03[_0x33ef('0x5f')][_0x33ef('0x60')]({'id':_0x111e9a[_0x33ef('0x45')]['id']});}return db[_0x33ef('0x2c')]['find']({'where':_0x85ad03,'attributes':['id','value'],'raw':!![]})['then'](handleEntityNotFound(_0x507019,null))[_0x33ef('0x25')](function(_0x118b45){if(_0x118b45){var _0x5076c1=util[_0x33ef('0x4f')](_0x33ef('0x50'),_0x118b45[_0x33ef('0x4e')]);if(fs['existsSync'](_0x5076c1)){_0x2f0ebd=!![];return _0x49e04b[_0x33ef('0x52')](_0x5076c1,_0x118b45[_0x33ef('0x4e')],config[_0x33ef('0x53')][_0x33ef('0x54')])['then'](function(){return _0x118b45;});}return _0x118b45;}})['then'](function(_0x4ef013){if(_0x4ef013){if(!fs[_0x33ef('0x51')](_0x4ef013[_0x33ef('0x4e')])){throw new db[(_0x33ef('0x55'))][(_0x33ef('0x56'))](_0x33ef('0x57'));}if(_0x4ef013[_0x33ef('0x58')]){return _0x507019[_0x33ef('0x4a')](_0x4ef013[_0x33ef('0x4e')],_0x4ef013[_0x33ef('0x58')]+path[_0x33ef('0x61')](_0x4ef013[_0x33ef('0x4e')]),function(){if(_0x2f0ebd){fs[_0x33ef('0x59')](_0x4ef013['value']);}});}else{return _0x507019['download'](_0x4ef013['value'],function(_0x4dbc5d){if(_0x2f0ebd){fs['unlink'](_0x4ef013[_0x33ef('0x4e')]);}});}}})[_0x33ef('0x43')](handleError(_0x507019,null));};exports[_0x33ef('0x26')]=function(_0x5a10cd,_0x2049b0){return db['VoiceRecording'][_0x33ef('0x4d')]({'where':{'id':_0x5a10cd[_0x33ef('0x45')]['id']}})[_0x33ef('0x25')](function(_0x44a674){if(_[_0x33ef('0x62')](_0x44a674)){throw new ReferenceError(_0x33ef('0x63'));}return _0x44a674;})[_0x33ef('0x25')](function(_0x525bd0){var _0xe17d48=_0x525bd0['value'];logger['info']('cancellazione\x20fisica\x20documento\x20%s',_0xe17d48);if(!_['isNil'](_0x525bd0[_0x33ef('0x4e')])&&fs[_0x33ef('0x51')](_0xe17d48)){logger[_0x33ef('0x64')](_0x33ef('0x65')+_0xe17d48+_0x33ef('0x66'));fs[_0x33ef('0x67')](_0xe17d48);}_0xe17d48=_0xe17d48+_0x33ef('0x68');if(!_['isNil'](_0x525bd0[_0x33ef('0x4e')])&&fs[_0x33ef('0x51')](_0xe17d48)){logger[_0x33ef('0x64')](_0x33ef('0x65')+_0xe17d48+_0x33ef('0x66'));fs[_0x33ef('0x67')](_0xe17d48);}return _0x525bd0;})['then'](function(_0x7f8bb3){if(!_0x7f8bb3)throw new InternalError();return _0x7f8bb3[_0x33ef('0x26')]();})[_0x33ef('0x25')](function(){_0x2049b0[_0x33ef('0x1a')](0xcc)[_0x33ef('0x27')]();})['catch'](handleError(_0x2049b0,null));};function getBucketslist(_0xc41248,_0x348672,_0x5ddee6){return new Promise(function(_0x1bc237,_0x313b7d){var _0x539c84=new AWS['S3']({'accessKeyId':_0x348672,'secretAccessKey':_0xc41248,'region':_0x5ddee6});_0x539c84[_0x33ef('0x69')]({},function(_0x16bf52,_0x407f35){if(_0x16bf52){return _0x313b7d(_0x16bf52);}else{return _0x1bc237(_0x407f35);}});});}function createBucket(_0x1f7e7e,_0x578768,_0x44cc2d,_0x3d988c){return new Promise(function(_0x5cdec8,_0x4e6c9e){var _0x170f85=new AWS['S3']({'accessKeyId':_0x578768,'secretAccessKey':_0x1f7e7e,'region':_0x44cc2d});_0x170f85[_0x33ef('0x6a')]({'Bucket':_0x3d988c},function(_0x10eb31,_0x3a15a8){if(_0x10eb31){return _0x4e6c9e(_0x10eb31);}else{return _0x5cdec8(_0x3a15a8);}});});}function uploadFile(_0x145624,_0x42ffdc,_0x3fa043,_0x304873,_0x1c43fb,_0x471e38){return new Promise(function(_0x2bf163,_0x6b4cf5){var _0x9fe2ba=new AWS['S3']({'accessKeyId':_0x42ffdc,'secretAccessKey':_0x145624,'region':_0x3fa043});_0x9fe2ba[_0x33ef('0x6b')]({'Bucket':_0x304873,'Key':_0x1c43fb,'Body':_0x471e38},function(_0x1e11da,_0xcb4914){if(_0x1e11da){return _0x6b4cf5(_0x1e11da);}else{return _0x2bf163(_0xcb4914);}});});}function startTranscribe(_0x265571,_0xedb092,_0x24c39e,_0x1382df,_0x5479e3,_0x3c0f6a){return new Promise(function(_0x558318,_0xb6c454){var _0x5427ec=new AWS[(_0x33ef('0x6c'))]({'accessKeyId':_0xedb092,'secretAccessKey':_0x265571,'region':_0x24c39e});_0x5427ec[_0x33ef('0x6d')]({'TranscriptionJobName':_0x1382df,'LanguageCode':_0x5479e3,'Media':{'MediaFileUri':_0x3c0f6a}},function(_0x19ad43,_0x523cf5){if(_0x19ad43){return _0xb6c454(_0x19ad43);}else{return _0x558318(_0x523cf5);}});});}function transcribe(_0x58f8d2,_0x379bbf,_0x2a4523,_0x13a264,_0x209e7a,_0x5cd73a,_0x5a22db){return new Promise(function(_0x24fffb,_0x4ae963){var _0x4e57a0={};logger[_0x33ef('0x64')](util[_0x33ef('0x4f')]('[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s',_0x58f8d2,_0x209e7a));return uploadFile(_0x379bbf,_0x2a4523,_0x13a264,_0x209e7a,path[_0x33ef('0x6e')](_0x5cd73a),fs['readFileSync'](_0x5cd73a))[_0x33ef('0x25')](function(_0x14fbbd){logger[_0x33ef('0x64')](util[_0x33ef('0x4f')]('[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)',_0x58f8d2,_0x209e7a,_0x14fbbd['Location']));_0x4e57a0[_0x33ef('0x6f')]=_0x14fbbd[_0x33ef('0x70')];_0x4e57a0['location']=_0x14fbbd[_0x33ef('0x71')];logger[_0x33ef('0x64')](util[_0x33ef('0x4f')](_0x33ef('0x72'),_0x58f8d2));return startTranscribe(_0x379bbf,_0x2a4523,_0x13a264,uuidv4(),_0x5a22db,_0x14fbbd[_0x33ef('0x71')]);})['then'](function(_0x2ed7bb){logger['info'](util['format'](_0x33ef('0x73'),_0x58f8d2,_0x2ed7bb[_0x33ef('0x74')]['TranscriptionJobName']));_0x4e57a0['transcribeName']=_0x2ed7bb[_0x33ef('0x74')][_0x33ef('0x75')];_0x4e57a0[_0x33ef('0x76')]=_0x2ed7bb[_0x33ef('0x74')][_0x33ef('0x77')];return _0x24fffb(_0x4e57a0);})[_0x33ef('0x43')](function(_0xfd6daa){return _0x4ae963(_0xfd6daa);});});}exports[_0x33ef('0x78')]=function(_0xb61d78,_0x2d955a,_0x1dee3e){var _0x487013;var _0x3f438a;var _0x18c31a;var _0x29a176=require(_0x33ef('0x4b'));return db[_0x33ef('0x2c')][_0x33ef('0x79')]({'where':{'id':_0xb61d78[_0x33ef('0x45')]['id']}})[_0x33ef('0x25')](function(_0x540bbe){if(_0x540bbe){var _0x43b993=util['format'](_0x33ef('0x50'),_0x540bbe[_0x33ef('0x4e')]);if(fs[_0x33ef('0x51')](_0x43b993)){cypher=!![];return _0x29a176[_0x33ef('0x52')](_0x43b993,_0x540bbe[_0x33ef('0x4e')],config[_0x33ef('0x53')][_0x33ef('0x54')])[_0x33ef('0x25')](function(){return _0x540bbe;});}return _0x540bbe;}})[_0x33ef('0x25')](function(_0x4866ad){if(!_0x4866ad){throw new db['Sequelize'][(_0x33ef('0x56'))](_0x33ef('0x7a'));}_0x3f438a=_0x4866ad;return db[_0x33ef('0x7b')][_0x33ef('0x79')]({'where':{'id':0x1}});})[_0x33ef('0x25')](handleEntityNotFound(_0x2d955a,null))[_0x33ef('0x25')](function(_0x494d3d){if(_0x494d3d){_0x487013=_0x494d3d;if(!_0x487013[_0x33ef('0x7c')]||!_0x487013[_0x33ef('0x7d')]||!_0x487013[_0x33ef('0x7e')]||!_0x487013[_0x33ef('0x7f')]||!_0x487013['bucket']){throw new db[(_0x33ef('0x55'))][(_0x33ef('0x56'))](_0x33ef('0x80'));}if(_0xb61d78[_0x33ef('0x48')][_0x33ef('0x81')]&&(!_0x487013[_0x33ef('0x82')]||!_0x487013[_0x33ef('0x83')]||!_0x487013[_0x33ef('0x84')]||!_0x487013[_0x33ef('0x7f')]||!_0x487013[_0x33ef('0x6f')])){throw new db[(_0x33ef('0x55'))][(_0x33ef('0x56'))](_0x33ef('0x85'));}return db[_0x33ef('0x86')][_0x33ef('0x79')]({'where':{'id':_0x487013['transcribeAccountId']}});}})[_0x33ef('0x25')](function(_0x221dee){if(!_0x221dee){throw new db[(_0x33ef('0x55'))][(_0x33ef('0x56'))](_0x33ef('0x87'));}if(!_0x221dee[_0x33ef('0x88')]||!_0x221dee['data2']){throw new db[(_0x33ef('0x55'))]['ValidationError'](_0x33ef('0x89'));}_0x18c31a=_0x221dee;return getBucketslist(_0x18c31a[_0x33ef('0x88')],_0x18c31a[_0x33ef('0x8a')],_0x487013[_0x33ef('0x7e')]);})[_0x33ef('0x25')](function(_0xda0fc1){if(_0xda0fc1&&_0xda0fc1[_0x33ef('0x8b')]){var _0x753657=_['find'](_0xda0fc1[_0x33ef('0x8b')],function(_0x35131d){return _0x35131d[_0x33ef('0x8c')]===_0x487013[_0x33ef('0x6f')];});if(!_0x753657){logger[_0x33ef('0x64')](util[_0x33ef('0x4f')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available',_0xb61d78[_0x33ef('0x45')]['id'],_0x487013[_0x33ef('0x6f')]));return createBucket(_0x18c31a[_0x33ef('0x88')],_0x18c31a['data2'],_0x487013[_0x33ef('0x7e')],_0x487013['bucket']);}logger[_0x33ef('0x64')](util['format'](_0x33ef('0x8d'),_0xb61d78[_0x33ef('0x45')]['id'],_0x487013[_0x33ef('0x6f')]));return;}})[_0x33ef('0x25')](function(_0x15e19d){if(_0x3f438a[_0x33ef('0x76')]===_0x33ef('0x8e')){return transcribe(_0xb61d78[_0x33ef('0x45')]['id'],_0x18c31a[_0x33ef('0x88')],_0x18c31a[_0x33ef('0x8a')],_0x487013[_0x33ef('0x7e')],_0x487013['bucket'],_0x3f438a[_0x33ef('0x4e')],_0x487013[_0x33ef('0x7f')]);}else{logger[_0x33ef('0x64')](util[_0x33ef('0x4f')](_0x33ef('0x8f'),_0xb61d78[_0x33ef('0x45')]['id']));return{'transcribeStatus':_0x33ef('0x90')};}})[_0x33ef('0x25')](function(_0x18e26c){if(_0x18e26c){_0x18e26c['tempSentiment']=_0xb61d78[_0x33ef('0x48')][_0x33ef('0x81')];return _0x3f438a['updateAttributes'](_0x18e26c);}})[_0x33ef('0x25')](respondWithResult(_0x2d955a,null))['catch'](handleError(_0x2d955a,null));};function writeFile(_0x1bba27,_0x5e69c){return new Promise(function(_0x2872e7,_0x3cabcd){fs['writeFile'](_0x5e69c,_0x1bba27,function(_0x454760,_0xf3a16b){if(_0x454760){return _0x3cabcd(_0x454760);}else{return _0x2872e7(_0xf3a16b);}});});}exports[_0x33ef('0x91')]=function(_0x389f75,_0x2385da,_0x142dfc){return db[_0x33ef('0x2c')]['findOne']({'where':{'id':_0x389f75[_0x33ef('0x45')]['id']}})['then'](handleEntityNotFound(_0x2385da))[_0x33ef('0x25')](function(_0x562a6c){if(_0x562a6c&&_0x562a6c[_0x33ef('0x92')]){var _0x5c4fe6=_0x562a6c[_0x33ef('0x92')];var _0x88efab=config[_0x33ef('0x93')]+'/server/files/transcribes/transcribe_'+_0x562a6c['id']+_0x33ef('0x94');if(fs[_0x33ef('0x51')](_0x88efab)){return _0x88efab;}return writeFile(_0x5c4fe6,_0x88efab)[_0x33ef('0x25')](function(){return _0x88efab;});}else{throw new db[(_0x33ef('0x55'))]['ValidationError'](_0x33ef('0x95'));}})['then'](function(_0x426fa4){return _0x2385da[_0x33ef('0x4a')](_0x426fa4);})['catch'](handleError(_0x2385da));}; \ No newline at end of file +var _0x4278=['createBucket','upload','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','Location','bucket','Bucket','TranscriptionJob','TranscriptionJobName','transcribeName','transcribeStatus','TranscriptionJobStatus','runTranscribe','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribe','transcribeAccountId','transcribeRegion','language','sentiment','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','data1','data2','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','runSentiment','writeFile','downloadTranscribe','fileText','root','Transcript\x20not\x20available','eml-format','rimraf','zip-dir','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','querystring','papaparse','aws-sdk','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','end','json','undefined','limit','count','offset','status','set','Content-Range','save','update','then','sendStatus','name','index','map','VoiceRecording','rawAttributes','type','key','differenceBy','format','query','filters','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','keys','intersection','length','find','create','body','describe','download','../../components/encryptor','uniqueid','value','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','unlink','message','send','Not\x20found','downloads','sequelize','col','token','$and','push','%s.cypher','destroy','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','listBuckets'];(function(_0x37eeb3,_0x383d1c){var _0x53556c=function(_0x12c808){while(--_0x12c808){_0x37eeb3['push'](_0x37eeb3['shift']());}};_0x53556c(++_0x383d1c);}(_0x4278,0x148));var _0x8427=function(_0x28e602,_0x2a8e93){_0x28e602=_0x28e602-0x0;var _0x2e589d=_0x4278[_0x28e602];return _0x2e589d;};'use strict';var emlformat=require(_0x8427('0x0'));var rimraf=require(_0x8427('0x1'));var zipdir=require(_0x8427('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8427('0x3'));var BPromise=require(_0x8427('0x4'));var Mustache=require(_0x8427('0x5'));var util=require('util');var path=require(_0x8427('0x6'));var sox=require(_0x8427('0x7'));var csv=require(_0x8427('0x8'));var ejs=require(_0x8427('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8427('0xa'));var crypto=require(_0x8427('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8427('0x8'));var querystring=require(_0x8427('0xc'));var Papa=require(_0x8427('0xd'));var AWS=require(_0x8427('0xe'));var uuidv4=require('uuid/v4');var Redis=require('ioredis');var authService=require(_0x8427('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x8427('0x10'));var hardwareService=require(_0x8427('0x11'));var logger=require('../../config/logger')(_0x8427('0x12'));var utils=require('../../config/utils');var config=require(_0x8427('0x13'));var licenseUtil=require(_0x8427('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x48a70e,_0x3f201c){_0x3f201c=_0x3f201c||0xcc;return function(_0xa41afb){if(_0xa41afb){return _0x48a70e['sendStatus'](_0x3f201c);}return _0x48a70e['status'](_0x3f201c)[_0x8427('0x15')]();};}function respondWithResult(_0x3b9f12,_0x2787ad){_0x2787ad=_0x2787ad||0xc8;return function(_0x41d479){if(_0x41d479){return _0x3b9f12['status'](_0x2787ad)[_0x8427('0x16')](_0x41d479);}};}function respondWithFilteredResult(_0x31ca5e,_0x1cdda7){return function(_0x78dc18){if(_0x78dc18){var _0x5f3ce6=typeof _0x1cdda7['offset']===_0x8427('0x17')&&typeof _0x1cdda7[_0x8427('0x18')]===_0x8427('0x17');var _0x1d081f=_0x78dc18[_0x8427('0x19')];var _0x53eadc=_0x5f3ce6?0x0:_0x1cdda7[_0x8427('0x1a')];var _0x338699=_0x5f3ce6?_0x78dc18['count']:_0x1cdda7['offset']+_0x1cdda7[_0x8427('0x18')];var _0x29062a;if(_0x338699>=_0x1d081f){_0x338699=_0x1d081f;_0x29062a=0xc8;}else{_0x29062a=0xce;}_0x31ca5e[_0x8427('0x1b')](_0x29062a);return _0x31ca5e[_0x8427('0x1c')](_0x8427('0x1d'),_0x53eadc+'-'+_0x338699+'/'+_0x1d081f)[_0x8427('0x16')](_0x78dc18);}return null;};}function patchUpdates(_0x230c15){return function(_0x164b72){try{jsonpatch['apply'](_0x164b72,_0x230c15,!![]);}catch(_0x46ffde){return BPromise['reject'](_0x46ffde);}return _0x164b72[_0x8427('0x1e')]();};}function saveUpdates(_0x108f34,_0x438ccc){return function(_0x52ce36){if(_0x52ce36){return _0x52ce36[_0x8427('0x1f')](_0x108f34)[_0x8427('0x20')](function(_0x360f5){return _0x360f5;});}return null;};}function removeEntity(_0x56d987,_0x3ffc48){return function(_0x5986bf){if(_0x5986bf){return _0x5986bf['destroy']()[_0x8427('0x20')](function(){_0x56d987[_0x8427('0x1b')](0xcc)[_0x8427('0x15')]();});}};}function handleEntityNotFound(_0x7aeda1,_0x430efe){return function(_0x4cefd2){if(!_0x4cefd2){_0x7aeda1[_0x8427('0x21')](0x194);}return _0x4cefd2;};}function handleError(_0x4b00ee,_0x5ce344){_0x5ce344=_0x5ce344||0x1f4;return function(_0xa35cec){logger['error'](_0xa35cec['stack']);if(_0xa35cec[_0x8427('0x22')]){delete _0xa35cec['name'];}_0x4b00ee[_0x8427('0x1b')](_0x5ce344)['send'](_0xa35cec);};}exports[_0x8427('0x23')]=function(_0x4a6a44,_0x11f18a){var _0x5e79a1={},_0x11ea82={},_0x4578c7={'count':0x0,'rows':[]};var _0x58cc53=_[_0x8427('0x24')](db[_0x8427('0x25')][_0x8427('0x26')],function(_0x3bea2c){return{'name':_0x3bea2c['fieldName'],'type':_0x3bea2c[_0x8427('0x27')][_0x8427('0x28')]};});_0x11ea82['model']=_[_0x8427('0x29')](_[_0x8427('0x24')](_0x58cc53,_0x8427('0x22')),[_0x8427('0x2a')]);_0x11ea82[_0x8427('0x2b')]=_['keys'](_0x4a6a44[_0x8427('0x2b')]);_0x11ea82[_0x8427('0x2c')]=_['intersection'](_0x11ea82[_0x8427('0x2d')],_0x11ea82[_0x8427('0x2b')]);_0x5e79a1[_0x8427('0x2e')]=_['intersection'](_0x11ea82['model'],qs[_0x8427('0x2f')](_0x4a6a44[_0x8427('0x2b')][_0x8427('0x2f')]));_0x5e79a1[_0x8427('0x2e')]=_0x5e79a1[_0x8427('0x2e')]['length']?_0x5e79a1[_0x8427('0x2e')]:_0x11ea82[_0x8427('0x2d')];if(!_0x4a6a44[_0x8427('0x2b')][_0x8427('0x30')](_0x8427('0x31'))){_0x5e79a1['limit']=qs[_0x8427('0x18')](_0x4a6a44['query']['limit']);_0x5e79a1[_0x8427('0x1a')]=qs[_0x8427('0x1a')](_0x4a6a44['query']['offset']);}_0x5e79a1[_0x8427('0x32')]=qs[_0x8427('0x33')](_0x4a6a44[_0x8427('0x2b')][_0x8427('0x33')]);_0x5e79a1['where']=qs[_0x8427('0x2c')](_['pick'](_0x4a6a44[_0x8427('0x2b')],_0x11ea82[_0x8427('0x2c')]),_0x58cc53);if(_0x4a6a44[_0x8427('0x2b')]['filter']){_0x5e79a1[_0x8427('0x34')]=_['merge'](_0x5e79a1[_0x8427('0x34')],{'$or':_[_0x8427('0x24')](_0x58cc53,function(_0x3b204b){if(_0x3b204b[_0x8427('0x27')]!==_0x8427('0x35')){var _0x4abcc7={};_0x4abcc7[_0x3b204b[_0x8427('0x22')]]={'$like':'%'+_0x4a6a44['query']['filter']+'%'};return _0x4abcc7;}})});}_0x5e79a1=_[_0x8427('0x36')]({},_0x5e79a1,_0x4a6a44['options']);var _0x5d4a29={'where':_0x5e79a1[_0x8427('0x34')]};return db[_0x8427('0x25')]['count'](_0x5d4a29)[_0x8427('0x20')](function(_0x56d9b4){_0x4578c7['count']=_0x56d9b4;if(_0x4a6a44[_0x8427('0x2b')][_0x8427('0x37')]){_0x5e79a1[_0x8427('0x38')]=[{'all':!![]}];}return db[_0x8427('0x25')][_0x8427('0x39')](_0x5e79a1);})[_0x8427('0x20')](function(_0x96b431){_0x4578c7[_0x8427('0x3a')]=_0x96b431;return _0x4578c7;})[_0x8427('0x20')](respondWithFilteredResult(_0x11f18a,_0x5e79a1))[_0x8427('0x3b')](handleError(_0x11f18a,null));};exports[_0x8427('0x3c')]=function(_0x4f26c9,_0x1308ed){var _0x388fe4={'raw':![],'where':{'id':_0x4f26c9[_0x8427('0x3d')]['id']}},_0x2bff9b={};_0x2bff9b[_0x8427('0x2d')]=_[_0x8427('0x3e')](db[_0x8427('0x25')][_0x8427('0x26')]);_0x2bff9b['query']=_[_0x8427('0x3e')](_0x4f26c9['query']);_0x2bff9b[_0x8427('0x2c')]=_[_0x8427('0x3f')](_0x2bff9b[_0x8427('0x2d')],_0x2bff9b[_0x8427('0x2b')]);_0x388fe4['attributes']=_['intersection'](_0x2bff9b[_0x8427('0x2d')],qs[_0x8427('0x2f')](_0x4f26c9[_0x8427('0x2b')][_0x8427('0x2f')]));_0x388fe4['attributes']=_0x388fe4[_0x8427('0x2e')][_0x8427('0x40')]?_0x388fe4[_0x8427('0x2e')]:_0x2bff9b['model'];if(_0x4f26c9[_0x8427('0x2b')][_0x8427('0x37')]){_0x388fe4['include']=[{'all':!![]}];}_0x388fe4=_[_0x8427('0x36')]({},_0x388fe4,_0x4f26c9['options']);return db[_0x8427('0x25')][_0x8427('0x41')](_0x388fe4)[_0x8427('0x20')](handleEntityNotFound(_0x1308ed,null))[_0x8427('0x20')](respondWithResult(_0x1308ed,null))[_0x8427('0x3b')](handleError(_0x1308ed,null));};exports[_0x8427('0x42')]=function(_0x41df2f,_0x33b6d7){return db[_0x8427('0x25')][_0x8427('0x42')](_0x41df2f['body'],{})['then'](respondWithResult(_0x33b6d7,0xc9))[_0x8427('0x3b')](handleError(_0x33b6d7,null));};exports['update']=function(_0x29a825,_0x328d5a){if(_0x29a825[_0x8427('0x43')]['id']){delete _0x29a825['body']['id'];}return db[_0x8427('0x25')]['find']({'where':{'id':_0x29a825[_0x8427('0x3d')]['id']}})[_0x8427('0x20')](handleEntityNotFound(_0x328d5a,null))[_0x8427('0x20')](saveUpdates(_0x29a825[_0x8427('0x43')],null))['then'](respondWithResult(_0x328d5a,null))[_0x8427('0x3b')](handleError(_0x328d5a,null));};exports['describe']=function(_0x1109dc,_0x1f3720){return db[_0x8427('0x25')][_0x8427('0x44')]()[_0x8427('0x20')](respondWithResult(_0x1f3720,null))[_0x8427('0x3b')](handleError(_0x1f3720,null));};exports[_0x8427('0x45')]=function(_0x3d7ecc,_0x156f68,_0x2ef27d){var _0x10d6da=require(_0x8427('0x46'));var _0x33e707=![];var _0x5d4d31={};if(_0x3d7ecc[_0x8427('0x2b')][_0x8427('0x27')]&&_0x3d7ecc[_0x8427('0x2b')][_0x8427('0x27')]===_0x8427('0x47')){_0x5d4d31[_0x8427('0x47')]=_0x3d7ecc[_0x8427('0x3d')]['id'];}else{_0x5d4d31['id']=_0x3d7ecc[_0x8427('0x3d')]['id'];}return db[_0x8427('0x25')][_0x8427('0x41')]({'where':_0x5d4d31,'attributes':['id',_0x8427('0x48')],'raw':!![]})['then'](handleEntityNotFound(_0x156f68,null))[_0x8427('0x20')](function(_0x153196){if(_0x153196){var _0x3a039c=_0x153196[_0x8427('0x48')];var _0x3e5918=util[_0x8427('0x2a')]('%s.cypher',_0x3a039c);if(fs[_0x8427('0x49')](_0x3e5918)){_0x33e707=!![];return _0x10d6da[_0x8427('0x4a')](_0x3e5918,_0x3a039c,config[_0x8427('0x4b')][_0x8427('0x4c')])['then'](function(){return _0x153196;});}return _0x153196;}})[_0x8427('0x20')](function(_0x9c43c6){if(_0x9c43c6){var _0x35a8d3=_0x9c43c6[_0x8427('0x48')];if(!fs['existsSync'](_0x35a8d3)){throw new db[(_0x8427('0x4d'))][(_0x8427('0x4e'))](_0x8427('0x4f'));}if(_0x9c43c6[_0x8427('0x50')]){return _0x156f68['download'](_0x35a8d3,_0x9c43c6['filename']+path['extname'](_0x35a8d3),function(){if(_0x33e707){fs[_0x8427('0x51')](_0x35a8d3);}});}else{return _0x156f68[_0x8427('0x45')](_0x35a8d3,function(_0x209ecb){if(_0x33e707){fs[_0x8427('0x51')](_0x35a8d3);}});}}})[_0x8427('0x3b')](function(_0x5bf20e){if(_0x5bf20e[_0x8427('0x52')]===_0x8427('0x4f')){_0x156f68[_0x8427('0x1b')](0x194)[_0x8427('0x53')](_0x8427('0x54'));}else{return handleError(_0x156f68,null);}});};exports[_0x8427('0x55')]=function(_0xfe46dc,_0xdb6316,_0x3ac873){var _0x2477c9=require(_0x8427('0x46'));var _0x5df28d=![];var _0x4d5467={'$and':[db[_0x8427('0x56')]['where'](db[_0x8427('0x56')]['fn']('MD5',db[_0x8427('0x56')][_0x8427('0x57')](_0x8427('0x47'))),_0xfe46dc[_0x8427('0x2b')][_0x8427('0x58')])]};if(_0xfe46dc[_0x8427('0x2b')][_0x8427('0x27')]&&_0xfe46dc['query']['type']==='uniqueid'){_0x4d5467[_0x8427('0x59')][_0x8427('0x5a')]({'uniqueid':_0xfe46dc[_0x8427('0x3d')]['id']});}else{_0x4d5467['$and'][_0x8427('0x5a')]({'id':_0xfe46dc['params']['id']});}return db[_0x8427('0x25')][_0x8427('0x41')]({'where':_0x4d5467,'attributes':['id',_0x8427('0x48')],'raw':!![]})[_0x8427('0x20')](handleEntityNotFound(_0xdb6316,null))[_0x8427('0x20')](function(_0x520973){if(_0x520973){var _0x3e0787=util[_0x8427('0x2a')](_0x8427('0x5b'),_0x520973['value']);if(fs[_0x8427('0x49')](_0x3e0787)){_0x5df28d=!![];return _0x2477c9[_0x8427('0x4a')](_0x3e0787,_0x520973[_0x8427('0x48')],config[_0x8427('0x4b')][_0x8427('0x4c')])['then'](function(){return _0x520973;});}return _0x520973;}})[_0x8427('0x20')](function(_0x28d866){if(_0x28d866){if(!fs[_0x8427('0x49')](_0x28d866[_0x8427('0x48')])){throw new db[(_0x8427('0x4d'))]['ValidationError'](_0x8427('0x4f'));}if(_0x28d866['filename']){return _0xdb6316[_0x8427('0x45')](_0x28d866[_0x8427('0x48')],_0x28d866['filename']+path['extname'](_0x28d866[_0x8427('0x48')]),function(){if(_0x5df28d){fs[_0x8427('0x51')](_0x28d866['value']);}});}else{return _0xdb6316[_0x8427('0x45')](_0x28d866[_0x8427('0x48')],function(_0x5a7643){if(_0x5df28d){fs[_0x8427('0x51')](_0x28d866[_0x8427('0x48')]);}});}}})['catch'](handleError(_0xdb6316,null));};exports[_0x8427('0x5c')]=function(_0x3b74d8,_0x2a9b53){return db[_0x8427('0x25')][_0x8427('0x41')]({'where':{'id':_0x3b74d8['params']['id']}})['then'](function(_0x46be28){if(_['isNil'](_0x46be28)){throw new ReferenceError(_0x8427('0x5d'));}return _0x46be28;})[_0x8427('0x20')](function(_0x4d0796){var _0x5277c6=_0x4d0796['value'];logger[_0x8427('0x5e')](_0x8427('0x5f'),_0x5277c6);if(!_[_0x8427('0x60')](_0x4d0796['value'])&&fs[_0x8427('0x49')](_0x5277c6)){logger[_0x8427('0x5e')](_0x8427('0x61')+_0x5277c6+_0x8427('0x62'));fs[_0x8427('0x63')](_0x5277c6);}_0x5277c6=_0x5277c6+'.cypher';if(!_[_0x8427('0x60')](_0x4d0796[_0x8427('0x48')])&&fs[_0x8427('0x49')](_0x5277c6)){logger[_0x8427('0x5e')](_0x8427('0x61')+_0x5277c6+_0x8427('0x62'));fs[_0x8427('0x63')](_0x5277c6);}return _0x4d0796;})[_0x8427('0x20')](function(_0x932b18){if(!_0x932b18)throw new InternalError();return _0x932b18[_0x8427('0x5c')]();})[_0x8427('0x20')](function(){_0x2a9b53[_0x8427('0x1b')](0xcc)[_0x8427('0x15')]();})['catch'](handleError(_0x2a9b53,null));};function getBucketslist(_0x4b7a1d,_0x11f77e,_0x4fc827){return new Promise(function(_0x2b82d2,_0x1c447e){var _0x11aa39=new AWS['S3']({'accessKeyId':_0x11f77e,'secretAccessKey':_0x4b7a1d,'region':_0x4fc827});_0x11aa39[_0x8427('0x64')]({},function(_0x5d354b,_0x1a7933){if(_0x5d354b){return _0x1c447e(_0x5d354b);}else{return _0x2b82d2(_0x1a7933);}});});}function createBucket(_0x58c926,_0xaf4e8b,_0x34295b,_0x5d8208){return new Promise(function(_0xf265be,_0x329463){var _0x2c9b30=new AWS['S3']({'accessKeyId':_0xaf4e8b,'secretAccessKey':_0x58c926,'region':_0x34295b});_0x2c9b30[_0x8427('0x65')]({'Bucket':_0x5d8208},function(_0x5efa94,_0x3cf42b){if(_0x5efa94){return _0x329463(_0x5efa94);}else{return _0xf265be(_0x3cf42b);}});});}function uploadFile(_0x10d427,_0xee2dd9,_0x3c1aad,_0x5f3917,_0x86d934,_0x2fa7f6){return new Promise(function(_0x4c9c72,_0x21f34e){var _0x241b45=new AWS['S3']({'accessKeyId':_0xee2dd9,'secretAccessKey':_0x10d427,'region':_0x3c1aad});_0x241b45[_0x8427('0x66')]({'Bucket':_0x5f3917,'Key':_0x86d934,'Body':_0x2fa7f6},function(_0x4529ac,_0x2c32a8){if(_0x4529ac){return _0x21f34e(_0x4529ac);}else{return _0x4c9c72(_0x2c32a8);}});});}function startTranscribe(_0x103e60,_0x11f2e6,_0x15953c,_0x555a99,_0x7b54e0,_0x10fb00){return new Promise(function(_0x3c7190,_0x57a625){var _0x1e2801=new AWS[(_0x8427('0x67'))]({'accessKeyId':_0x11f2e6,'secretAccessKey':_0x103e60,'region':_0x15953c});_0x1e2801[_0x8427('0x68')]({'TranscriptionJobName':_0x555a99,'LanguageCode':_0x7b54e0,'Media':{'MediaFileUri':_0x10fb00}},function(_0xa06063,_0x109b62){if(_0xa06063){return _0x57a625(_0xa06063);}else{return _0x3c7190(_0x109b62);}});});}function transcribe(_0x49e5fc,_0x5adb6b,_0xcbd2ce,_0x1d7a1f,_0xd7154b,_0x385fea,_0x6f1eb1){return new Promise(function(_0x5598fe,_0x593237){var _0x3792d1={};logger[_0x8427('0x5e')](util[_0x8427('0x2a')](_0x8427('0x69'),_0x49e5fc,_0xd7154b));return uploadFile(_0x5adb6b,_0xcbd2ce,_0x1d7a1f,_0xd7154b,path[_0x8427('0x6a')](_0x385fea),fs[_0x8427('0x6b')](_0x385fea))[_0x8427('0x20')](function(_0x42f38c){logger['info'](util[_0x8427('0x2a')]('[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)',_0x49e5fc,_0xd7154b,_0x42f38c[_0x8427('0x6c')]));_0x3792d1[_0x8427('0x6d')]=_0x42f38c[_0x8427('0x6e')];_0x3792d1['location']=_0x42f38c[_0x8427('0x6c')];logger[_0x8427('0x5e')](util['format']('[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request',_0x49e5fc));return startTranscribe(_0x5adb6b,_0xcbd2ce,_0x1d7a1f,uuidv4(),_0x6f1eb1,_0x42f38c[_0x8427('0x6c')]);})[_0x8427('0x20')](function(_0x1a8deb){logger[_0x8427('0x5e')](util[_0x8427('0x2a')]('[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created',_0x49e5fc,_0x1a8deb[_0x8427('0x6f')][_0x8427('0x70')]));_0x3792d1[_0x8427('0x71')]=_0x1a8deb['TranscriptionJob'][_0x8427('0x70')];_0x3792d1[_0x8427('0x72')]=_0x1a8deb[_0x8427('0x6f')][_0x8427('0x73')];return _0x5598fe(_0x3792d1);})[_0x8427('0x3b')](function(_0x3e770a){return _0x593237(_0x3e770a);});});}exports[_0x8427('0x74')]=function(_0xfb62f2,_0x47a392,_0x226b85){var _0x2ea590;var _0x138c9a;var _0x4bbeef;var _0x5c4d82=require(_0x8427('0x46'));return db[_0x8427('0x25')][_0x8427('0x75')]({'where':{'id':_0xfb62f2[_0x8427('0x3d')]['id']}})['then'](function(_0x31c56c){if(_0x31c56c){var _0xec0d28=util['format'](_0x8427('0x5b'),_0x31c56c[_0x8427('0x48')]);if(fs[_0x8427('0x49')](_0xec0d28)){cypher=!![];return _0x5c4d82[_0x8427('0x4a')](_0xec0d28,_0x31c56c['value'],config[_0x8427('0x4b')][_0x8427('0x4c')])[_0x8427('0x20')](function(){return _0x31c56c;});}return _0x31c56c;}})['then'](function(_0x5d9a3a){if(!_0x5d9a3a){throw new db[(_0x8427('0x4d'))]['ValidationError'](_0x8427('0x76'));}_0x138c9a=_0x5d9a3a;return db[_0x8427('0x77')]['findOne']({'where':{'id':0x1}});})[_0x8427('0x20')](handleEntityNotFound(_0x47a392,null))[_0x8427('0x20')](function(_0x35990c){if(_0x35990c){_0x2ea590=_0x35990c;if(!_0x2ea590[_0x8427('0x78')]||!_0x2ea590[_0x8427('0x79')]||!_0x2ea590[_0x8427('0x7a')]||!_0x2ea590[_0x8427('0x7b')]||!_0x2ea590[_0x8427('0x6d')]){throw new db['Sequelize'][(_0x8427('0x4e'))]('Transcribe\x20not\x20configured');}if(_0xfb62f2[_0x8427('0x43')]['runSentiment']&&(!_0x2ea590[_0x8427('0x7c')]||!_0x2ea590['sentimentAccountId']||!_0x2ea590[_0x8427('0x7d')]||!_0x2ea590[_0x8427('0x7b')]||!_0x2ea590[_0x8427('0x6d')])){throw new db[(_0x8427('0x4d'))][(_0x8427('0x4e'))](_0x8427('0x7e'));}return db[_0x8427('0x7f')][_0x8427('0x75')]({'where':{'id':_0x2ea590[_0x8427('0x79')]}});}})[_0x8427('0x20')](function(_0x5e1aa6){if(!_0x5e1aa6){throw new db[(_0x8427('0x4d'))][(_0x8427('0x4e'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x5e1aa6[_0x8427('0x80')]||!_0x5e1aa6[_0x8427('0x81')]){throw new db[(_0x8427('0x4d'))][(_0x8427('0x4e'))]('Cloud\x20Provider\x20not\x20configured');}_0x4bbeef=_0x5e1aa6;return getBucketslist(_0x4bbeef['data1'],_0x4bbeef['data2'],_0x2ea590[_0x8427('0x7a')]);})[_0x8427('0x20')](function(_0x5f593d){if(_0x5f593d&&_0x5f593d['Buckets']){var _0x3b47c6=_[_0x8427('0x41')](_0x5f593d['Buckets'],function(_0x22300e){return _0x22300e[_0x8427('0x82')]===_0x2ea590[_0x8427('0x6d')];});if(!_0x3b47c6){logger[_0x8427('0x5e')](util[_0x8427('0x2a')](_0x8427('0x83'),_0xfb62f2['params']['id'],_0x2ea590[_0x8427('0x6d')]));return createBucket(_0x4bbeef['data1'],_0x4bbeef['data2'],_0x2ea590[_0x8427('0x7a')],_0x2ea590[_0x8427('0x6d')]);}logger[_0x8427('0x5e')](util[_0x8427('0x2a')](_0x8427('0x84'),_0xfb62f2[_0x8427('0x3d')]['id'],_0x2ea590[_0x8427('0x6d')]));return;}})['then'](function(_0x31d103){if(_0x138c9a['transcribeStatus']===_0x8427('0x85')){return transcribe(_0xfb62f2[_0x8427('0x3d')]['id'],_0x4bbeef['data1'],_0x4bbeef[_0x8427('0x81')],_0x2ea590[_0x8427('0x7a')],_0x2ea590['bucket'],_0x138c9a[_0x8427('0x48')],_0x2ea590[_0x8427('0x7b')]);}else{logger['info'](util[_0x8427('0x2a')](_0x8427('0x86'),_0xfb62f2['params']['id']));return{'transcribeStatus':_0x8427('0x87')};}})[_0x8427('0x20')](function(_0x1a789b){if(_0x1a789b){_0x1a789b[_0x8427('0x88')]=_0xfb62f2[_0x8427('0x43')][_0x8427('0x89')];return _0x138c9a['updateAttributes'](_0x1a789b);}})[_0x8427('0x20')](respondWithResult(_0x47a392,null))[_0x8427('0x3b')](handleError(_0x47a392,null));};function writeFile(_0x1b4bda,_0x2be926){return new Promise(function(_0x1b2d49,_0x217c4c){fs[_0x8427('0x8a')](_0x2be926,_0x1b4bda,function(_0x32835f,_0x336761){if(_0x32835f){return _0x217c4c(_0x32835f);}else{return _0x1b2d49(_0x336761);}});});}exports[_0x8427('0x8b')]=function(_0x3bc6c4,_0x8520f6,_0x363005){return db['VoiceRecording'][_0x8427('0x75')]({'where':{'id':_0x3bc6c4[_0x8427('0x3d')]['id']}})[_0x8427('0x20')](handleEntityNotFound(_0x8520f6))[_0x8427('0x20')](function(_0x187a8){if(_0x187a8&&_0x187a8[_0x8427('0x8c')]){var _0x112692=_0x187a8[_0x8427('0x8c')];var _0x43fbd4=config[_0x8427('0x8d')]+'/server/files/transcribes/transcribe_'+_0x187a8['id']+'.txt';if(fs['existsSync'](_0x43fbd4)){return _0x43fbd4;}return writeFile(_0x112692,_0x43fbd4)[_0x8427('0x20')](function(){return _0x43fbd4;});}else{throw new db['Sequelize'][(_0x8427('0x4e'))](_0x8427('0x8e'));}})[_0x8427('0x20')](function(_0x3bc61c){return _0x8520f6[_0x8427('0x45')](_0x3bc61c);})['catch'](handleError(_0x8520f6));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index e426574..d516782 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 _0x1d1d=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceRecording.attributes','exports','define','voice_recordings','uniqueid','lodash','../../config/logger'];(function(_0x4271e6,_0x42904b){var _0x553a2e=function(_0x13217b){while(--_0x13217b){_0x4271e6['push'](_0x4271e6['shift']());}};_0x553a2e(++_0x42904b);}(_0x1d1d,0x1cc));var _0xd1d1=function(_0x2a7e32,_0x202dd5){_0x2a7e32=_0x2a7e32-0x0;var _0x575f54=_0x1d1d[_0x2a7e32];return _0x575f54;};'use strict';var _=require(_0xd1d1('0x0'));var util=require('util');var logger=require(_0xd1d1('0x1'))(_0xd1d1('0x2'));var moment=require(_0xd1d1('0x3'));var BPromise=require(_0xd1d1('0x4'));var rp=require(_0xd1d1('0x5'));var fs=require('fs');var path=require(_0xd1d1('0x6'));var rimraf=require(_0xd1d1('0x7'));var config=require(_0xd1d1('0x8'));var attributes=require(_0xd1d1('0x9'));module[_0xd1d1('0xa')]=function(_0x52ff1e,_0x31a8d2){return _0x52ff1e[_0xd1d1('0xb')]('VoiceRecording',attributes,{'tableName':_0xd1d1('0xc'),'paranoid':![],'indexes':[{'name':_0xd1d1('0xd'),'fields':[_0xd1d1('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4599=['./voiceRecording.attributes','exports','VoiceRecording','voice_recordings','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4599,0x155));var _0x9459=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x4599[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x9459('0x0'));var util=require('util');var logger=require(_0x9459('0x1'))(_0x9459('0x2'));var moment=require(_0x9459('0x3'));var BPromise=require(_0x9459('0x4'));var rp=require(_0x9459('0x5'));var fs=require('fs');var path=require(_0x9459('0x6'));var rimraf=require(_0x9459('0x7'));var config=require(_0x9459('0x8'));var attributes=require(_0x9459('0x9'));module[_0x9459('0xa')]=function(_0x41b4fb,_0x2c9abb){return _0x41b4fb['define'](_0x9459('0xb'),attributes,{'tableName':_0x9459('0xc'),'paranoid':![],'indexes':[{'name':_0x9459('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index 3c29c23..7aa92d9 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 _0x93e9=['http','request','then','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','VoiceRecording,\x20%s,\x20%s,\x20%s','error','message','result','catch','UpdateVoiceRecording','VoiceRecording','body','options','raw','where','attributes','limit','debug','stringify','../../components/encryptor','Setting','findOne','existsSync','value','format','%s.cypher','encryptFile','secrets','CreateVoiceRecording\x20file\x20encrypted','CreateVoiceRecording','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client'];(function(_0x43f638,_0x45397c){var _0x30d91f=function(_0x458acb){while(--_0x458acb){_0x43f638['push'](_0x43f638['shift']());}};_0x30d91f(++_0x45397c);}(_0x93e9,0xcc));var _0x993e=function(_0x1e93ed,_0x218a17){_0x1e93ed=_0x1e93ed-0x0;var _0x150ba2=_0x93e9[_0x1e93ed];return _0x150ba2;};'use strict';var _=require(_0x993e('0x0'));var util=require(_0x993e('0x1'));var moment=require(_0x993e('0x2'));var BPromise=require(_0x993e('0x3'));var rs=require(_0x993e('0x4'));var fs=require('fs');var Redis=require(_0x993e('0x5'));var db=require(_0x993e('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x993e('0x7'));var config=require(_0x993e('0x8'));var jayson=require(_0x993e('0x9'));var client=jayson[_0x993e('0xa')][_0x993e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2366d9,_0x12ac94,_0x1aef74){return new BPromise(function(_0x53d0ce,_0x4701d3){return client[_0x993e('0xc')](_0x2366d9,_0x1aef74)[_0x993e('0xd')](function(_0x280291){logger[_0x993e('0xe')](_0x993e('0xf'),_0x12ac94,_0x993e('0x10'));logger['debug'](_0x993e('0x11'),_0x12ac94,_0x993e('0x10'),JSON['stringify'](_0x280291));if(_0x280291['error']){if(_0x280291[_0x993e('0x12')]['code']===0x1f4){logger[_0x993e('0x12')]('VoiceRecording,\x20%s,\x20%s',_0x12ac94,_0x280291['error'][_0x993e('0x13')]);return _0x4701d3(_0x280291[_0x993e('0x12')][_0x993e('0x13')]);}logger[_0x993e('0x12')](_0x993e('0xf'),_0x12ac94,_0x280291[_0x993e('0x12')][_0x993e('0x13')]);return _0x53d0ce(_0x280291[_0x993e('0x12')][_0x993e('0x13')]);}else{logger[_0x993e('0xe')](_0x993e('0xf'),_0x12ac94,_0x993e('0x10'));_0x53d0ce(_0x280291[_0x993e('0x14')][_0x993e('0x13')]);}})[_0x993e('0x15')](function(_0x454475){logger[_0x993e('0x12')]('VoiceRecording,\x20%s,\x20%s',_0x12ac94,_0x454475);_0x4701d3(_0x454475);});});}exports[_0x993e('0x16')]=function(_0x1acd21){var _0x3cc2b9=this;return new Promise(function(_0x3d6109,_0xfc2cbb){return db[_0x993e('0x17')]['update'](_0x1acd21[_0x993e('0x18')],{'raw':_0x1acd21[_0x993e('0x19')]?_0x1acd21[_0x993e('0x19')][_0x993e('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1acd21[_0x993e('0x19')]?_0x1acd21[_0x993e('0x19')][_0x993e('0x1b')]||null:null,'attributes':_0x1acd21[_0x993e('0x19')]?_0x1acd21['options'][_0x993e('0x1c')]||null:null,'limit':_0x1acd21['options']?_0x1acd21[_0x993e('0x19')][_0x993e('0x1d')]||null:null})[_0x993e('0xd')](function(_0x5ba2a1){logger[_0x993e('0xe')](_0x993e('0x16'),_0x1acd21);logger[_0x993e('0x1e')](_0x993e('0x16'),_0x1acd21,JSON[_0x993e('0x1f')](_0x5ba2a1));_0x3d6109(_0x5ba2a1);})[_0x993e('0x15')](function(_0xa1c83e){logger[_0x993e('0x12')](_0x993e('0x16'),_0xa1c83e[_0x993e('0x13')],_0x1acd21);_0xfc2cbb(_0x3cc2b9[_0x993e('0x12')](0x1f4,_0xa1c83e[_0x993e('0x13')]));});});};exports['CreateVoiceRecording']=function(_0x2756a7){var _0x279bb8=this;return new Promise(function(_0x52b727,_0x27bbf7){var _0x4f5cc1=require(_0x993e('0x20'));var _0xa03fbd;return db[_0x993e('0x21')][_0x993e('0x22')]({'attributes':['id','callRecordingEncryption'],'where':{'id':0x1},'raw':!![]})['then'](function(_0x32e332){_0xa03fbd=_0x32e332;return db[_0x993e('0x17')]['create'](_0x2756a7[_0x993e('0x18')]);})[_0x993e('0xd')](function(_0x248354){if(_0xa03fbd['callRecordingEncryption']&&fs[_0x993e('0x23')](_0x248354[_0x993e('0x24')])){var _0x1f5d51=util[_0x993e('0x25')](_0x993e('0x26'),_0x248354['value']);return _0x4f5cc1[_0x993e('0x27')](_0x248354['value'],_0x1f5d51,config[_0x993e('0x28')]['recording'])[_0x993e('0xd')](function(){fs['unlink'](_0x248354[_0x993e('0x24')]);logger[_0x993e('0xe')](_0x993e('0x29'));return _0x248354;});}return _0x248354;})[_0x993e('0xd')](function(_0xbadd6e){logger[_0x993e('0xe')]('CreateVoiceRecording',_0x2756a7);logger[_0x993e('0x1e')]('CreateVoiceRecording',_0x2756a7,JSON['stringify'](_0xbadd6e));_0x52b727(_0xbadd6e);})[_0x993e('0x15')](function(_0x497d29){logger[_0x993e('0x12')](_0x993e('0x2a'),_0x497d29[_0x993e('0x13')],_0x2756a7);_0x27bbf7(_0x279bb8[_0x993e('0x12')](0x1f4,_0x497d29[_0x993e('0x13')]));});});}; \ No newline at end of file +var _0x81c6=['unlink','util','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','VoiceRecording,\x20%s,\x20%s','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','info','result','catch','UpdateVoiceRecording','VoiceRecording','update','options','raw','where','limit','../../components/encryptor','Setting','findOne','create','body','existsSync','value','%s.cypher','encryptFile','secrets'];(function(_0xd54059,_0x4361b3){var _0x28194c=function(_0xf01fb6){while(--_0xf01fb6){_0xd54059['push'](_0xd54059['shift']());}};_0x28194c(++_0x4361b3);}(_0x81c6,0x1d5));var _0x681c=function(_0x3f83dc,_0x5c8047){_0x3f83dc=_0x3f83dc-0x0;var _0x3876b8=_0x81c6[_0x3f83dc];return _0x3876b8;};'use strict';var _=require('lodash');var util=require(_0x681c('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x681c('0x1'));var db=require(_0x681c('0x2'))['db'];var utils=require(_0x681c('0x3'));var logger=require('../../config/logger')(_0x681c('0x4'));var config=require(_0x681c('0x5'));var jayson=require(_0x681c('0x6'));var client=jayson[_0x681c('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x45331,_0xdc57a5,_0x5624d7){return new BPromise(function(_0x5b5f22,_0x1750e2){return client[_0x681c('0x8')](_0x45331,_0x5624d7)[_0x681c('0x9')](function(_0x5de78e){logger['info'](_0x681c('0xa'),_0xdc57a5,'request\x20sent');logger[_0x681c('0xb')](_0x681c('0xc'),_0xdc57a5,_0x681c('0xd'),JSON[_0x681c('0xe')](_0x5de78e));if(_0x5de78e['error']){if(_0x5de78e['error'][_0x681c('0xf')]===0x1f4){logger[_0x681c('0x10')](_0x681c('0xa'),_0xdc57a5,_0x5de78e['error'][_0x681c('0x11')]);return _0x1750e2(_0x5de78e['error'][_0x681c('0x11')]);}logger['error'](_0x681c('0xa'),_0xdc57a5,_0x5de78e[_0x681c('0x10')][_0x681c('0x11')]);return _0x5b5f22(_0x5de78e[_0x681c('0x10')][_0x681c('0x11')]);}else{logger[_0x681c('0x12')]('VoiceRecording,\x20%s,\x20%s',_0xdc57a5,_0x681c('0xd'));_0x5b5f22(_0x5de78e[_0x681c('0x13')][_0x681c('0x11')]);}})[_0x681c('0x14')](function(_0x2fce11){logger[_0x681c('0x10')]('VoiceRecording,\x20%s,\x20%s',_0xdc57a5,_0x2fce11);_0x1750e2(_0x2fce11);});});}exports[_0x681c('0x15')]=function(_0x42f506){var _0x4a9192=this;return new Promise(function(_0x42304f,_0x5b03fd){return db[_0x681c('0x16')][_0x681c('0x17')](_0x42f506['body'],{'raw':_0x42f506[_0x681c('0x18')]?_0x42f506['options'][_0x681c('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x42f506[_0x681c('0x18')]?_0x42f506[_0x681c('0x18')][_0x681c('0x1a')]||null:null,'attributes':_0x42f506[_0x681c('0x18')]?_0x42f506['options']['attributes']||null:null,'limit':_0x42f506['options']?_0x42f506[_0x681c('0x18')][_0x681c('0x1b')]||null:null})[_0x681c('0x9')](function(_0x27b8a0){logger[_0x681c('0x12')](_0x681c('0x15'),_0x42f506);logger[_0x681c('0xb')](_0x681c('0x15'),_0x42f506,JSON[_0x681c('0xe')](_0x27b8a0));_0x42304f(_0x27b8a0);})[_0x681c('0x14')](function(_0x2be552){logger[_0x681c('0x10')](_0x681c('0x15'),_0x2be552[_0x681c('0x11')],_0x42f506);_0x5b03fd(_0x4a9192[_0x681c('0x10')](0x1f4,_0x2be552[_0x681c('0x11')]));});});};exports['CreateVoiceRecording']=function(_0x11063b){var _0x5705a7=this;return new Promise(function(_0x5f8d64,_0x4bf08e){var _0x583499=require(_0x681c('0x1c'));var _0x17ea7c;return db[_0x681c('0x1d')][_0x681c('0x1e')]({'attributes':['id','callRecordingEncryption'],'where':{'id':0x1},'raw':!![]})[_0x681c('0x9')](function(_0x39fca3){_0x17ea7c=_0x39fca3;return db[_0x681c('0x16')][_0x681c('0x1f')](_0x11063b[_0x681c('0x20')]);})[_0x681c('0x9')](function(_0x2c619f){if(_0x17ea7c['callRecordingEncryption']&&fs[_0x681c('0x21')](_0x2c619f[_0x681c('0x22')])){var _0x2e783d=util['format'](_0x681c('0x23'),_0x2c619f[_0x681c('0x22')]);return _0x583499[_0x681c('0x24')](_0x2c619f['value'],_0x2e783d,config[_0x681c('0x25')]['recording'])['then'](function(){fs[_0x681c('0x26')](_0x2c619f[_0x681c('0x22')]);logger[_0x681c('0x12')]('CreateVoiceRecording\x20file\x20encrypted');return _0x2c619f;});}return _0x2c619f;})[_0x681c('0x9')](function(_0x508fb9){logger[_0x681c('0x12')]('CreateVoiceRecording',_0x11063b);logger['debug']('CreateVoiceRecording',_0x11063b,JSON[_0x681c('0xe')](_0x508fb9));_0x5f8d64(_0x508fb9);})[_0x681c('0x14')](function(_0x5a349a){logger[_0x681c('0x10')]('CreateVoiceRecording',_0x5a349a['message'],_0x11063b);_0x4bf08e(_0x5705a7[_0x681c('0x10')](0x1f4,_0x5a349a['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index b0333b2..3e05ec0 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 _0x6582=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','post','create','/:id','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x5c7cd6,_0xa77e75){var _0x5820da=function(_0x2d499e){while(--_0x2d499e){_0x5c7cd6['push'](_0x5c7cd6['shift']());}};_0x5820da(++_0xa77e75);}(_0x6582,0x16f));var _0x2658=function(_0x2c0557,_0x4314fd){_0x2c0557=_0x2c0557-0x0;var _0x2878cd=_0x6582[_0x2c0557];return _0x2878cd;};'use strict';var multer=require(_0x2658('0x0'));var util=require(_0x2658('0x1'));var path=require(_0x2658('0x2'));var timeout=require('connect-timeout');var express=require(_0x2658('0x3'));var router=express[_0x2658('0x4')]();var fs_extra=require(_0x2658('0x5'));var auth=require(_0x2658('0x6'));var interaction=require(_0x2658('0x7'));var config=require(_0x2658('0x8'));var controller=require('./voiceTransferReport.controller');router[_0x2658('0x9')]('/',auth[_0x2658('0xa')](),controller[_0x2658('0xb')]);router['get'](_0x2658('0xc'),auth[_0x2658('0xa')](),controller[_0x2658('0xd')]);router['get']('/:id',auth[_0x2658('0xa')](),controller[_0x2658('0xe')]);router[_0x2658('0xf')]('/',auth[_0x2658('0xa')](),controller[_0x2658('0x10')]);router['put'](_0x2658('0x11'),auth[_0x2658('0xa')](),controller[_0x2658('0x12')]);router[_0x2658('0x13')](_0x2658('0x11'),auth[_0x2658('0xa')](),controller[_0x2658('0x14')]);module[_0x2658('0x15')]=router; \ No newline at end of file +var _0x4d7d=['index','/describe','isAuthenticated','describe','post','put','/:id','update','delete','destroy','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x1f88b6,_0x11b64c){var _0x31bc6b=function(_0x50b368){while(--_0x50b368){_0x1f88b6['push'](_0x1f88b6['shift']());}};_0x31bc6b(++_0x11b64c);}(_0x4d7d,0x13a));var _0xd4d7=function(_0x5b3950,_0x4e5556){_0x5b3950=_0x5b3950-0x0;var _0x41e436=_0x4d7d[_0x5b3950];return _0x41e436;};'use strict';var multer=require(_0xd4d7('0x0'));var util=require(_0xd4d7('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xd4d7('0x2'));var router=express[_0xd4d7('0x3')]();var fs_extra=require(_0xd4d7('0x4'));var auth=require(_0xd4d7('0x5'));var interaction=require(_0xd4d7('0x6'));var config=require(_0xd4d7('0x7'));var controller=require('./voiceTransferReport.controller');router[_0xd4d7('0x8')]('/',auth['isAuthenticated'](),controller[_0xd4d7('0x9')]);router[_0xd4d7('0x8')](_0xd4d7('0xa'),auth[_0xd4d7('0xb')](),controller[_0xd4d7('0xc')]);router[_0xd4d7('0x8')]('/:id',auth[_0xd4d7('0xb')](),controller['show']);router[_0xd4d7('0xd')]('/',auth[_0xd4d7('0xb')](),controller['create']);router[_0xd4d7('0xe')](_0xd4d7('0xf'),auth[_0xd4d7('0xb')](),controller[_0xd4d7('0x10')]);router[_0xd4d7('0x11')]('/:id',auth[_0xd4d7('0xb')](),controller[_0xd4d7('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index 90dc64b..013edab 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 _0x8ae9=['moment','ENUM','attended','STRING','Yes','sequelize'];(function(_0x55ecc7,_0x2d44c1){var _0x37bbeb=function(_0x2e62fd){while(--_0x2e62fd){_0x55ecc7['push'](_0x55ecc7['shift']());}};_0x37bbeb(++_0x2d44c1);}(_0x8ae9,0x13d));var _0x98ae=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8ae9[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x98ae('0x0'));var moment=require(_0x98ae('0x1'));module['exports']={'type':{'type':Sequelize[_0x98ae('0x2')]('blind',_0x98ae('0x3'))},'result':{'type':Sequelize[_0x98ae('0x4')]},'transfererchannel':{'type':Sequelize[_0x98ae('0x4')]},'transferercalleridnum':{'type':Sequelize[_0x98ae('0x4')]},'transferercalleridname':{'type':Sequelize[_0x98ae('0x4')]},'transfererconnectedlinenum':{'type':Sequelize[_0x98ae('0x4')]},'transfererconnectedlinename':{'type':Sequelize[_0x98ae('0x4')]},'transfereraccountcode':{'type':Sequelize['STRING']},'transferercontext':{'type':Sequelize[_0x98ae('0x4')]},'transfererexten':{'type':Sequelize['STRING']},'transfererlinkedid':{'type':Sequelize[_0x98ae('0x4')]},'transfereechannel':{'type':Sequelize[_0x98ae('0x4')]},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize[_0x98ae('0x4')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x98ae('0x4')]},'transfereeconnectedlinename':{'type':Sequelize[_0x98ae('0x4')]},'transfereeaccountcode':{'type':Sequelize[_0x98ae('0x4')]},'transfereecontext':{'type':Sequelize[_0x98ae('0x4')]},'transfereeexten':{'type':Sequelize[_0x98ae('0x4')]},'transfereelinkedid':{'type':Sequelize[_0x98ae('0x4')]},'isexternal':{'type':Sequelize['ENUM'](_0x98ae('0x5'),'No')},'context':{'type':Sequelize[_0x98ae('0x4')]},'extension':{'type':Sequelize[_0x98ae('0x4')]}}; \ No newline at end of file +var _0x4345=['ENUM','attended','STRING','exports'];(function(_0x521204,_0x141bd9){var _0x28f5c5=function(_0x36f94c){while(--_0x36f94c){_0x521204['push'](_0x521204['shift']());}};_0x28f5c5(++_0x141bd9);}(_0x4345,0x1af));var _0x5434=function(_0x4ff800,_0x3699d4){_0x4ff800=_0x4ff800-0x0;var _0x5c93a2=_0x4345[_0x4ff800];return _0x5c93a2;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x5434('0x0')]={'type':{'type':Sequelize[_0x5434('0x1')]('blind',_0x5434('0x2'))},'result':{'type':Sequelize['STRING']},'transfererchannel':{'type':Sequelize[_0x5434('0x3')]},'transferercalleridnum':{'type':Sequelize[_0x5434('0x3')]},'transferercalleridname':{'type':Sequelize[_0x5434('0x3')]},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize[_0x5434('0x3')]},'transfereraccountcode':{'type':Sequelize[_0x5434('0x3')]},'transferercontext':{'type':Sequelize[_0x5434('0x3')]},'transfererexten':{'type':Sequelize[_0x5434('0x3')]},'transfererlinkedid':{'type':Sequelize[_0x5434('0x3')]},'transfereechannel':{'type':Sequelize[_0x5434('0x3')]},'transfereecalleridnum':{'type':Sequelize[_0x5434('0x3')]},'transfereecalleridname':{'type':Sequelize['STRING']},'transfereeconnectedlinenum':{'type':Sequelize[_0x5434('0x3')]},'transfereeconnectedlinename':{'type':Sequelize['STRING']},'transfereeaccountcode':{'type':Sequelize[_0x5434('0x3')]},'transfereecontext':{'type':Sequelize[_0x5434('0x3')]},'transfereeexten':{'type':Sequelize[_0x5434('0x3')]},'transfereelinkedid':{'type':Sequelize[_0x5434('0x3')]},'isexternal':{'type':Sequelize['ENUM']('Yes','No')},'context':{'type':Sequelize[_0x5434('0x3')]},'extension':{'type':Sequelize[_0x5434('0x3')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index 8fd1b73..1bceeea 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 _0x7f63=['find','create','update','body','describe','eml-format','rimraf','zip-dir','mustache','util','sox','to-csv','ejs','lodash','squel','desk.js','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','stack','name','send','index','map','VoiceTransferReport','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes'];(function(_0x3aed72,_0x46eb13){var _0x1a84dc=function(_0x2a528e){while(--_0x2a528e){_0x3aed72['push'](_0x3aed72['shift']());}};_0x1a84dc(++_0x46eb13);}(_0x7f63,0x1b5));var _0x37f6=function(_0xe6b759,_0x2637a9){_0xe6b759=_0xe6b759-0x0;var _0x250568=_0x7f63[_0xe6b759];return _0x250568;};'use strict';var emlformat=require(_0x37f6('0x0'));var rimraf=require(_0x37f6('0x1'));var zipdir=require(_0x37f6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x37f6('0x3'));var util=require(_0x37f6('0x4'));var path=require('path');var sox=require(_0x37f6('0x5'));var csv=require(_0x37f6('0x6'));var ejs=require(_0x37f6('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x37f6('0x8'));var squel=require(_0x37f6('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x37f6('0xa'));var toCsv=require(_0x37f6('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x37f6('0xb'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x37f6('0xc'));var hardwareService=require(_0x37f6('0xd'));var logger=require('../../config/logger')('api');var utils=require(_0x37f6('0xe'));var config=require(_0x37f6('0xf'));var licenseUtil=require(_0x37f6('0x10'));var db=require(_0x37f6('0x11'))['db'];function respondWithStatusCode(_0x1b8d82,_0x3a28d7){_0x3a28d7=_0x3a28d7||0xcc;return function(_0x2aab9a){if(_0x2aab9a){return _0x1b8d82[_0x37f6('0x12')](_0x3a28d7);}return _0x1b8d82[_0x37f6('0x13')](_0x3a28d7)[_0x37f6('0x14')]();};}function respondWithResult(_0x3f7557,_0x177297){_0x177297=_0x177297||0xc8;return function(_0x13f2b5){if(_0x13f2b5){return _0x3f7557[_0x37f6('0x13')](_0x177297)[_0x37f6('0x15')](_0x13f2b5);}};}function respondWithFilteredResult(_0x56f52a,_0x7bc96f){return function(_0xb0a911){if(_0xb0a911){var _0x339bed=typeof _0x7bc96f[_0x37f6('0x16')]===_0x37f6('0x17')&&typeof _0x7bc96f['limit']==='undefined';var _0x40535b=_0xb0a911[_0x37f6('0x18')];var _0x2df6b8=_0x339bed?0x0:_0x7bc96f[_0x37f6('0x16')];var _0x3b0ecd=_0x339bed?_0xb0a911['count']:_0x7bc96f[_0x37f6('0x16')]+_0x7bc96f[_0x37f6('0x19')];var _0x1a34f9;if(_0x3b0ecd>=_0x40535b){_0x3b0ecd=_0x40535b;_0x1a34f9=0xc8;}else{_0x1a34f9=0xce;}_0x56f52a[_0x37f6('0x13')](_0x1a34f9);return _0x56f52a[_0x37f6('0x1a')](_0x37f6('0x1b'),_0x2df6b8+'-'+_0x3b0ecd+'/'+_0x40535b)[_0x37f6('0x15')](_0xb0a911);}return null;};}function patchUpdates(_0x469c95){return function(_0x4f2789){try{jsonpatch[_0x37f6('0x1c')](_0x4f2789,_0x469c95,!![]);}catch(_0x704db7){return BPromise[_0x37f6('0x1d')](_0x704db7);}return _0x4f2789[_0x37f6('0x1e')]();};}function saveUpdates(_0x20dca6,_0x5c3c9a){return function(_0x5999d9){if(_0x5999d9){return _0x5999d9['update'](_0x20dca6)[_0x37f6('0x1f')](function(_0x462814){return _0x462814;});}return null;};}function removeEntity(_0x50bfc3,_0x43edaf){return function(_0x50c03e){if(_0x50c03e){return _0x50c03e[_0x37f6('0x20')]()[_0x37f6('0x1f')](function(){_0x50bfc3[_0x37f6('0x13')](0xcc)[_0x37f6('0x14')]();});}};}function handleEntityNotFound(_0x1308df,_0x22f222){return function(_0x37c9dd){if(!_0x37c9dd){_0x1308df[_0x37f6('0x12')](0x194);}return _0x37c9dd;};}function handleError(_0x492b57,_0x3b5c6a){_0x3b5c6a=_0x3b5c6a||0x1f4;return function(_0x1db42e){logger['error'](_0x1db42e[_0x37f6('0x21')]);if(_0x1db42e[_0x37f6('0x22')]){delete _0x1db42e[_0x37f6('0x22')];}_0x492b57[_0x37f6('0x13')](_0x3b5c6a)[_0x37f6('0x23')](_0x1db42e);};}exports[_0x37f6('0x24')]=function(_0x26f55b,_0x5a3cdd){var _0x539883={},_0x996a1e={},_0x3b551b={'count':0x0,'rows':[]};var _0x1a07c9=_[_0x37f6('0x25')](db[_0x37f6('0x26')]['rawAttributes'],function(_0x253adc){return{'name':_0x253adc[_0x37f6('0x27')],'type':_0x253adc[_0x37f6('0x28')][_0x37f6('0x29')]};});_0x996a1e[_0x37f6('0x2a')]=_['map'](_0x1a07c9,_0x37f6('0x22'));_0x996a1e[_0x37f6('0x2b')]=_[_0x37f6('0x2c')](_0x26f55b[_0x37f6('0x2b')]);_0x996a1e[_0x37f6('0x2d')]=_[_0x37f6('0x2e')](_0x996a1e[_0x37f6('0x2a')],_0x996a1e['query']);_0x539883[_0x37f6('0x2f')]=_[_0x37f6('0x2e')](_0x996a1e[_0x37f6('0x2a')],qs[_0x37f6('0x30')](_0x26f55b[_0x37f6('0x2b')][_0x37f6('0x30')]));_0x539883[_0x37f6('0x2f')]=_0x539883[_0x37f6('0x2f')][_0x37f6('0x31')]?_0x539883[_0x37f6('0x2f')]:_0x996a1e[_0x37f6('0x2a')];if(!_0x26f55b['query']['hasOwnProperty'](_0x37f6('0x32'))){_0x539883[_0x37f6('0x19')]=qs[_0x37f6('0x19')](_0x26f55b[_0x37f6('0x2b')][_0x37f6('0x19')]);_0x539883[_0x37f6('0x16')]=qs[_0x37f6('0x16')](_0x26f55b['query'][_0x37f6('0x16')]);}_0x539883[_0x37f6('0x33')]=qs[_0x37f6('0x34')](_0x26f55b['query'][_0x37f6('0x34')]);_0x539883[_0x37f6('0x35')]=qs['filters'](_[_0x37f6('0x36')](_0x26f55b[_0x37f6('0x2b')],_0x996a1e[_0x37f6('0x2d')]),_0x1a07c9);if(_0x26f55b[_0x37f6('0x2b')]['filter']){_0x539883[_0x37f6('0x35')]=_['merge'](_0x539883[_0x37f6('0x35')],{'$or':_[_0x37f6('0x25')](_0x1a07c9,function(_0x330d05){if(_0x330d05[_0x37f6('0x28')]!==_0x37f6('0x37')){var _0x1cf3db={};_0x1cf3db[_0x330d05[_0x37f6('0x22')]]={'$like':'%'+_0x26f55b[_0x37f6('0x2b')][_0x37f6('0x38')]+'%'};return _0x1cf3db;}})});}_0x539883=_[_0x37f6('0x39')]({},_0x539883,_0x26f55b[_0x37f6('0x3a')]);var _0x4fdf93={'where':_0x539883['where']};return db[_0x37f6('0x26')][_0x37f6('0x18')](_0x4fdf93)['then'](function(_0x2cba7c){_0x3b551b[_0x37f6('0x18')]=_0x2cba7c;if(_0x26f55b[_0x37f6('0x2b')][_0x37f6('0x3b')]){_0x539883[_0x37f6('0x3c')]=[{'all':!![]}];}return db[_0x37f6('0x26')][_0x37f6('0x3d')](_0x539883);})[_0x37f6('0x1f')](function(_0x25eede){_0x3b551b[_0x37f6('0x3e')]=_0x25eede;return _0x3b551b;})[_0x37f6('0x1f')](respondWithFilteredResult(_0x5a3cdd,_0x539883))[_0x37f6('0x3f')](handleError(_0x5a3cdd,null));};exports[_0x37f6('0x40')]=function(_0x5bdeb8,_0x4531d2){var _0x29b638={'raw':!![],'where':{'id':_0x5bdeb8[_0x37f6('0x41')]['id']}},_0x34927c={};_0x34927c['model']=_[_0x37f6('0x2c')](db[_0x37f6('0x26')][_0x37f6('0x42')]);_0x34927c[_0x37f6('0x2b')]=_[_0x37f6('0x2c')](_0x5bdeb8['query']);_0x34927c[_0x37f6('0x2d')]=_['intersection'](_0x34927c[_0x37f6('0x2a')],_0x34927c[_0x37f6('0x2b')]);_0x29b638['attributes']=_[_0x37f6('0x2e')](_0x34927c['model'],qs[_0x37f6('0x30')](_0x5bdeb8[_0x37f6('0x2b')]['fields']));_0x29b638[_0x37f6('0x2f')]=_0x29b638[_0x37f6('0x2f')][_0x37f6('0x31')]?_0x29b638[_0x37f6('0x2f')]:_0x34927c['model'];if(_0x5bdeb8[_0x37f6('0x2b')]['includeAll']){_0x29b638['include']=[{'all':!![]}];}_0x29b638=_['merge']({},_0x29b638,_0x5bdeb8['options']);return db[_0x37f6('0x26')][_0x37f6('0x43')](_0x29b638)[_0x37f6('0x1f')](handleEntityNotFound(_0x4531d2,null))[_0x37f6('0x1f')](respondWithResult(_0x4531d2,null))[_0x37f6('0x3f')](handleError(_0x4531d2,null));};exports['create']=function(_0x10aef4,_0x11c4b4){return db[_0x37f6('0x26')][_0x37f6('0x44')](_0x10aef4['body'],{})['then'](respondWithResult(_0x11c4b4,0xc9))['catch'](handleError(_0x11c4b4,null));};exports[_0x37f6('0x45')]=function(_0x5dde57,_0x1edde2){if(_0x5dde57['body']['id']){delete _0x5dde57[_0x37f6('0x46')]['id'];}return db[_0x37f6('0x26')][_0x37f6('0x43')]({'where':{'id':_0x5dde57[_0x37f6('0x41')]['id']}})[_0x37f6('0x1f')](handleEntityNotFound(_0x1edde2,null))['then'](saveUpdates(_0x5dde57[_0x37f6('0x46')],null))[_0x37f6('0x1f')](respondWithResult(_0x1edde2,null))[_0x37f6('0x3f')](handleError(_0x1edde2,null));};exports[_0x37f6('0x20')]=function(_0x34b6b6,_0x10b79a){return db['VoiceTransferReport']['find']({'where':{'id':_0x34b6b6[_0x37f6('0x41')]['id']}})['then'](handleEntityNotFound(_0x10b79a,null))[_0x37f6('0x1f')](removeEntity(_0x10b79a,null))[_0x37f6('0x3f')](handleError(_0x10b79a,null));};exports[_0x37f6('0x47')]=function(_0x370ae5,_0x27584d){return db['VoiceTransferReport'][_0x37f6('0x47')]()[_0x37f6('0x1f')](respondWithResult(_0x27584d,null))[_0x37f6('0x3f')](handleError(_0x27584d,null));}; \ No newline at end of file +var _0xcf40=['apply','save','update','then','destroy','stack','name','index','map','VoiceTransferReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','body','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','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','offset','undefined','limit','count','Content-Range'];(function(_0x2d364e,_0x301c5e){var _0x1b9312=function(_0x1b05bb){while(--_0x1b05bb){_0x2d364e['push'](_0x2d364e['shift']());}};_0x1b9312(++_0x301c5e);}(_0xcf40,0x109));var _0x0cf4=function(_0x32480b,_0x7fd345){_0x32480b=_0x32480b-0x0;var _0x38f21e=_0xcf40[_0x32480b];return _0x38f21e;};'use strict';var emlformat=require(_0x0cf4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0cf4('0x1'));var jsonpatch=require(_0x0cf4('0x2'));var rp=require('request-promise');var moment=require(_0x0cf4('0x3'));var BPromise=require(_0x0cf4('0x4'));var Mustache=require(_0x0cf4('0x5'));var util=require(_0x0cf4('0x6'));var path=require(_0x0cf4('0x7'));var sox=require(_0x0cf4('0x8'));var csv=require(_0x0cf4('0x9'));var ejs=require(_0x0cf4('0xa'));var fs=require('fs');var fs_extra=require(_0x0cf4('0xb'));var _=require('lodash');var squel=require(_0x0cf4('0xc'));var crypto=require(_0x0cf4('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x0cf4('0x9'));var querystring=require(_0x0cf4('0xe'));var Papa=require(_0x0cf4('0xf'));var Redis=require(_0x0cf4('0x10'));var authService=require(_0x0cf4('0x11'));var qs=require(_0x0cf4('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0cf4('0x13'));var logger=require(_0x0cf4('0x14'))(_0x0cf4('0x15'));var utils=require(_0x0cf4('0x16'));var config=require(_0x0cf4('0x17'));var licenseUtil=require(_0x0cf4('0x18'));var db=require(_0x0cf4('0x19'))['db'];function respondWithStatusCode(_0x23ddc8,_0x3efb14){_0x3efb14=_0x3efb14||0xcc;return function(_0xbe3e96){if(_0xbe3e96){return _0x23ddc8[_0x0cf4('0x1a')](_0x3efb14);}return _0x23ddc8[_0x0cf4('0x1b')](_0x3efb14)[_0x0cf4('0x1c')]();};}function respondWithResult(_0x560757,_0x41e09a){_0x41e09a=_0x41e09a||0xc8;return function(_0x3fc418){if(_0x3fc418){return _0x560757[_0x0cf4('0x1b')](_0x41e09a)[_0x0cf4('0x1d')](_0x3fc418);}};}function respondWithFilteredResult(_0x5c3b98,_0x5ca494){return function(_0x3e8bb7){if(_0x3e8bb7){var _0x32a447=typeof _0x5ca494[_0x0cf4('0x1e')]===_0x0cf4('0x1f')&&typeof _0x5ca494[_0x0cf4('0x20')]==='undefined';var _0x48a094=_0x3e8bb7['count'];var _0x40bea4=_0x32a447?0x0:_0x5ca494[_0x0cf4('0x1e')];var _0x45d5ba=_0x32a447?_0x3e8bb7[_0x0cf4('0x21')]:_0x5ca494[_0x0cf4('0x1e')]+_0x5ca494['limit'];var _0x5380c8;if(_0x45d5ba>=_0x48a094){_0x45d5ba=_0x48a094;_0x5380c8=0xc8;}else{_0x5380c8=0xce;}_0x5c3b98[_0x0cf4('0x1b')](_0x5380c8);return _0x5c3b98['set'](_0x0cf4('0x22'),_0x40bea4+'-'+_0x45d5ba+'/'+_0x48a094)['json'](_0x3e8bb7);}return null;};}function patchUpdates(_0xe48bda){return function(_0x158998){try{jsonpatch[_0x0cf4('0x23')](_0x158998,_0xe48bda,!![]);}catch(_0xf16ecf){return BPromise['reject'](_0xf16ecf);}return _0x158998[_0x0cf4('0x24')]();};}function saveUpdates(_0x32a2a4,_0x5a8697){return function(_0x15260a){if(_0x15260a){return _0x15260a[_0x0cf4('0x25')](_0x32a2a4)[_0x0cf4('0x26')](function(_0x59aed9){return _0x59aed9;});}return null;};}function removeEntity(_0x546eaf,_0x46e4c1){return function(_0x4b684f){if(_0x4b684f){return _0x4b684f[_0x0cf4('0x27')]()[_0x0cf4('0x26')](function(){_0x546eaf[_0x0cf4('0x1b')](0xcc)[_0x0cf4('0x1c')]();});}};}function handleEntityNotFound(_0x173ebe,_0x5cac98){return function(_0x1a90d9){if(!_0x1a90d9){_0x173ebe[_0x0cf4('0x1a')](0x194);}return _0x1a90d9;};}function handleError(_0x2c9660,_0x506dd9){_0x506dd9=_0x506dd9||0x1f4;return function(_0x5a2773){logger['error'](_0x5a2773[_0x0cf4('0x28')]);if(_0x5a2773['name']){delete _0x5a2773[_0x0cf4('0x29')];}_0x2c9660[_0x0cf4('0x1b')](_0x506dd9)['send'](_0x5a2773);};}exports[_0x0cf4('0x2a')]=function(_0x2a7219,_0x7dd496){var _0x30511c={},_0x52ede5={},_0x1fd99e={'count':0x0,'rows':[]};var _0x46fa1d=_[_0x0cf4('0x2b')](db[_0x0cf4('0x2c')][_0x0cf4('0x2d')],function(_0x13b66c){return{'name':_0x13b66c[_0x0cf4('0x2e')],'type':_0x13b66c[_0x0cf4('0x2f')][_0x0cf4('0x30')]};});_0x52ede5[_0x0cf4('0x31')]=_['map'](_0x46fa1d,_0x0cf4('0x29'));_0x52ede5[_0x0cf4('0x32')]=_[_0x0cf4('0x33')](_0x2a7219[_0x0cf4('0x32')]);_0x52ede5['filters']=_[_0x0cf4('0x34')](_0x52ede5[_0x0cf4('0x31')],_0x52ede5[_0x0cf4('0x32')]);_0x30511c[_0x0cf4('0x35')]=_['intersection'](_0x52ede5['model'],qs[_0x0cf4('0x36')](_0x2a7219['query'][_0x0cf4('0x36')]));_0x30511c['attributes']=_0x30511c['attributes'][_0x0cf4('0x37')]?_0x30511c['attributes']:_0x52ede5[_0x0cf4('0x31')];if(!_0x2a7219[_0x0cf4('0x32')][_0x0cf4('0x38')](_0x0cf4('0x39'))){_0x30511c[_0x0cf4('0x20')]=qs['limit'](_0x2a7219[_0x0cf4('0x32')][_0x0cf4('0x20')]);_0x30511c[_0x0cf4('0x1e')]=qs[_0x0cf4('0x1e')](_0x2a7219[_0x0cf4('0x32')][_0x0cf4('0x1e')]);}_0x30511c[_0x0cf4('0x3a')]=qs[_0x0cf4('0x3b')](_0x2a7219[_0x0cf4('0x32')][_0x0cf4('0x3b')]);_0x30511c[_0x0cf4('0x3c')]=qs[_0x0cf4('0x3d')](_[_0x0cf4('0x3e')](_0x2a7219[_0x0cf4('0x32')],_0x52ede5['filters']),_0x46fa1d);if(_0x2a7219[_0x0cf4('0x32')][_0x0cf4('0x3f')]){_0x30511c['where']=_[_0x0cf4('0x40')](_0x30511c[_0x0cf4('0x3c')],{'$or':_[_0x0cf4('0x2b')](_0x46fa1d,function(_0x5e1844){if(_0x5e1844['type']!=='VIRTUAL'){var _0x4650f9={};_0x4650f9[_0x5e1844[_0x0cf4('0x29')]]={'$like':'%'+_0x2a7219[_0x0cf4('0x32')][_0x0cf4('0x3f')]+'%'};return _0x4650f9;}})});}_0x30511c=_[_0x0cf4('0x40')]({},_0x30511c,_0x2a7219[_0x0cf4('0x41')]);var _0x2aa960={'where':_0x30511c[_0x0cf4('0x3c')]};return db[_0x0cf4('0x2c')][_0x0cf4('0x21')](_0x2aa960)[_0x0cf4('0x26')](function(_0x58b3b7){_0x1fd99e[_0x0cf4('0x21')]=_0x58b3b7;if(_0x2a7219[_0x0cf4('0x32')][_0x0cf4('0x42')]){_0x30511c[_0x0cf4('0x43')]=[{'all':!![]}];}return db[_0x0cf4('0x2c')][_0x0cf4('0x44')](_0x30511c);})['then'](function(_0x129f6e){_0x1fd99e[_0x0cf4('0x45')]=_0x129f6e;return _0x1fd99e;})['then'](respondWithFilteredResult(_0x7dd496,_0x30511c))[_0x0cf4('0x46')](handleError(_0x7dd496,null));};exports[_0x0cf4('0x47')]=function(_0x3f230e,_0xed63e1){var _0x570273={'raw':!![],'where':{'id':_0x3f230e[_0x0cf4('0x48')]['id']}},_0x15bc19={};_0x15bc19[_0x0cf4('0x31')]=_['keys'](db[_0x0cf4('0x2c')]['rawAttributes']);_0x15bc19[_0x0cf4('0x32')]=_[_0x0cf4('0x33')](_0x3f230e[_0x0cf4('0x32')]);_0x15bc19[_0x0cf4('0x3d')]=_['intersection'](_0x15bc19['model'],_0x15bc19[_0x0cf4('0x32')]);_0x570273[_0x0cf4('0x35')]=_[_0x0cf4('0x34')](_0x15bc19[_0x0cf4('0x31')],qs[_0x0cf4('0x36')](_0x3f230e[_0x0cf4('0x32')][_0x0cf4('0x36')]));_0x570273['attributes']=_0x570273[_0x0cf4('0x35')]['length']?_0x570273[_0x0cf4('0x35')]:_0x15bc19[_0x0cf4('0x31')];if(_0x3f230e['query']['includeAll']){_0x570273[_0x0cf4('0x43')]=[{'all':!![]}];}_0x570273=_[_0x0cf4('0x40')]({},_0x570273,_0x3f230e[_0x0cf4('0x41')]);return db['VoiceTransferReport']['find'](_0x570273)['then'](handleEntityNotFound(_0xed63e1,null))[_0x0cf4('0x26')](respondWithResult(_0xed63e1,null))[_0x0cf4('0x46')](handleError(_0xed63e1,null));};exports['create']=function(_0x20cb8,_0x53462c){return db[_0x0cf4('0x2c')]['create'](_0x20cb8['body'],{})[_0x0cf4('0x26')](respondWithResult(_0x53462c,0xc9))[_0x0cf4('0x46')](handleError(_0x53462c,null));};exports[_0x0cf4('0x25')]=function(_0xccd7e2,_0x2f45d2){if(_0xccd7e2[_0x0cf4('0x49')]['id']){delete _0xccd7e2[_0x0cf4('0x49')]['id'];}return db[_0x0cf4('0x2c')]['find']({'where':{'id':_0xccd7e2[_0x0cf4('0x48')]['id']}})[_0x0cf4('0x26')](handleEntityNotFound(_0x2f45d2,null))[_0x0cf4('0x26')](saveUpdates(_0xccd7e2['body'],null))[_0x0cf4('0x26')](respondWithResult(_0x2f45d2,null))['catch'](handleError(_0x2f45d2,null));};exports['destroy']=function(_0x67e516,_0x181d09){return db[_0x0cf4('0x2c')]['find']({'where':{'id':_0x67e516[_0x0cf4('0x48')]['id']}})[_0x0cf4('0x26')](handleEntityNotFound(_0x181d09,null))[_0x0cf4('0x26')](removeEntity(_0x181d09,null))[_0x0cf4('0x46')](handleError(_0x181d09,null));};exports[_0x0cf4('0x4a')]=function(_0x1e5507,_0x8102b6){return db['VoiceTransferReport']['describe']()[_0x0cf4('0x26')](respondWithResult(_0x8102b6,null))[_0x0cf4('0x46')](handleError(_0x8102b6,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index 6f56415..955eb4b 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 _0x6900=['bluebird','request-promise','rimraf','../../config/environment','./voiceTransferReport.attributes','exports','define','VoiceTransferReport','lodash','../../config/logger','api','moment'];(function(_0x1d9e7d,_0x3005b7){var _0x458e6e=function(_0x2ab7b6){while(--_0x2ab7b6){_0x1d9e7d['push'](_0x1d9e7d['shift']());}};_0x458e6e(++_0x3005b7);}(_0x6900,0x98));var _0x0690=function(_0x11c573,_0x9e7c6e){_0x11c573=_0x11c573-0x0;var _0x6b72de=_0x6900[_0x11c573];return _0x6b72de;};'use strict';var _=require(_0x0690('0x0'));var util=require('util');var logger=require(_0x0690('0x1'))(_0x0690('0x2'));var moment=require(_0x0690('0x3'));var BPromise=require(_0x0690('0x4'));var rp=require(_0x0690('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0690('0x6'));var config=require(_0x0690('0x7'));var attributes=require(_0x0690('0x8'));module[_0x0690('0x9')]=function(_0x63842d,_0x595a73){return _0x63842d[_0x0690('0xa')](_0x0690('0xb'),attributes,{'tableName':'report_call_transfer','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3432=['define','VoiceTransferReport','report_call_transfer','lodash','util','../../config/logger','moment','bluebird','path','./voiceTransferReport.attributes','exports'];(function(_0x518b48,_0x18997e){var _0x326810=function(_0x5cdeb6){while(--_0x5cdeb6){_0x518b48['push'](_0x518b48['shift']());}};_0x326810(++_0x18997e);}(_0x3432,0x1e7));var _0x2343=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x3432[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x2343('0x0'));var util=require(_0x2343('0x1'));var logger=require(_0x2343('0x2'))('api');var moment=require(_0x2343('0x3'));var BPromise=require(_0x2343('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2343('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2343('0x6'));module[_0x2343('0x7')]=function(_0x252f65,_0x350456){return _0x252f65[_0x2343('0x8')](_0x2343('0x9'),attributes,{'tableName':_0x2343('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.rpc.js b/server/api/voiceTransferReport/voiceTransferReport.rpc.js index f0f781f..3b707dd 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 _0x31f6=['options','raw','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','CreateVoiceTransferReport','create','body'];(function(_0x424a9a,_0x2dd9af){var _0xa7831c=function(_0x512534){while(--_0x512534){_0x424a9a['push'](_0x424a9a['shift']());}};_0xa7831c(++_0x2dd9af);}(_0x31f6,0x12e));var _0x631f=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x31f6[_0x57b54c];return _0x59cc19;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x631f('0x0'));var BPromise=require('bluebird');var rs=require(_0x631f('0x1'));var fs=require('fs');var Redis=require(_0x631f('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x631f('0x3'));var logger=require(_0x631f('0x4'))(_0x631f('0x5'));var config=require(_0x631f('0x6'));var jayson=require(_0x631f('0x7'));var client=jayson[_0x631f('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x51f210,_0x47c6a9,_0xdb292b){return new BPromise(function(_0xcbeb3f,_0x507b5f){return client[_0x631f('0x9')](_0x51f210,_0xdb292b)[_0x631f('0xa')](function(_0x5cff0b){logger[_0x631f('0xb')](_0x631f('0xc'),_0x47c6a9,_0x631f('0xd'));logger[_0x631f('0xe')]('VoiceTransferReport,\x20%s,\x20%s,\x20%s',_0x47c6a9,'request\x20sent',JSON[_0x631f('0xf')](_0x5cff0b));if(_0x5cff0b[_0x631f('0x10')]){if(_0x5cff0b[_0x631f('0x10')][_0x631f('0x11')]===0x1f4){logger[_0x631f('0x10')](_0x631f('0xc'),_0x47c6a9,_0x5cff0b[_0x631f('0x10')]['message']);return _0x507b5f(_0x5cff0b['error'][_0x631f('0x12')]);}logger[_0x631f('0x10')](_0x631f('0xc'),_0x47c6a9,_0x5cff0b[_0x631f('0x10')][_0x631f('0x12')]);return _0xcbeb3f(_0x5cff0b[_0x631f('0x10')][_0x631f('0x12')]);}else{logger['info'](_0x631f('0xc'),_0x47c6a9,_0x631f('0xd'));_0xcbeb3f(_0x5cff0b['result'][_0x631f('0x12')]);}})[_0x631f('0x13')](function(_0x3cfdc6){logger['error']('VoiceTransferReport,\x20%s,\x20%s',_0x47c6a9,_0x3cfdc6);_0x507b5f(_0x3cfdc6);});});}exports[_0x631f('0x14')]=function(_0x57dc62){var _0x3a6d56=this;return new Promise(function(_0x4becdf,_0x536b70){return db['VoiceTransferReport'][_0x631f('0x15')](_0x57dc62[_0x631f('0x16')],{'raw':_0x57dc62['options']?_0x57dc62[_0x631f('0x17')][_0x631f('0x18')]===undefined?!![]:![]:!![]})[_0x631f('0xa')](function(_0x73813c){logger['info'](_0x631f('0x14'),_0x57dc62);logger[_0x631f('0xe')]('CreateVoiceTransferReport',_0x57dc62,JSON[_0x631f('0xf')](_0x73813c));_0x4becdf(_0x73813c);})[_0x631f('0x13')](function(_0x36b8d8){logger[_0x631f('0x10')](_0x631f('0x14'),_0x36b8d8[_0x631f('0x12')],_0x57dc62);_0x536b70(_0x3a6d56[_0x631f('0x10')](0x1f4,_0x36b8d8['message']));});});}; \ No newline at end of file +var _0xa0f1=['ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','info','VoiceTransferReport,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','raw','then','stringify','lodash','moment','bluebird'];(function(_0x2a21f1,_0x5b6d1a){var _0x19b89a=function(_0x3c7a42){while(--_0x3c7a42){_0x2a21f1['push'](_0x2a21f1['shift']());}};_0x19b89a(++_0x5b6d1a);}(_0xa0f1,0x9f));var _0x1a0f=function(_0x265ad4,_0x523fbe){_0x265ad4=_0x265ad4-0x0;var _0x3bf700=_0xa0f1[_0x265ad4];return _0x3bf700;};'use strict';var _=require(_0x1a0f('0x0'));var util=require('util');var moment=require(_0x1a0f('0x1'));var BPromise=require(_0x1a0f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1a0f('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1a0f('0x4'));var logger=require('../../config/logger')(_0x1a0f('0x5'));var config=require(_0x1a0f('0x6'));var jayson=require(_0x1a0f('0x7'));var client=jayson[_0x1a0f('0x8')][_0x1a0f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x187f88,_0x4a9168,_0x5b6d39){return new BPromise(function(_0x8e5a1a,_0x48a419){return client['request'](_0x187f88,_0x5b6d39)['then'](function(_0x51ebc6){logger[_0x1a0f('0xa')](_0x1a0f('0xb'),_0x4a9168,'request\x20sent');logger[_0x1a0f('0xc')]('VoiceTransferReport,\x20%s,\x20%s,\x20%s',_0x4a9168,_0x1a0f('0xd'),JSON['stringify'](_0x51ebc6));if(_0x51ebc6[_0x1a0f('0xe')]){if(_0x51ebc6['error'][_0x1a0f('0xf')]===0x1f4){logger[_0x1a0f('0xe')](_0x1a0f('0xb'),_0x4a9168,_0x51ebc6[_0x1a0f('0xe')][_0x1a0f('0x10')]);return _0x48a419(_0x51ebc6[_0x1a0f('0xe')][_0x1a0f('0x10')]);}logger[_0x1a0f('0xe')](_0x1a0f('0xb'),_0x4a9168,_0x51ebc6[_0x1a0f('0xe')][_0x1a0f('0x10')]);return _0x8e5a1a(_0x51ebc6['error'][_0x1a0f('0x10')]);}else{logger[_0x1a0f('0xa')](_0x1a0f('0xb'),_0x4a9168,_0x1a0f('0xd'));_0x8e5a1a(_0x51ebc6[_0x1a0f('0x11')][_0x1a0f('0x10')]);}})[_0x1a0f('0x12')](function(_0x4b148d){logger[_0x1a0f('0xe')](_0x1a0f('0xb'),_0x4a9168,_0x4b148d);_0x48a419(_0x4b148d);});});}exports[_0x1a0f('0x13')]=function(_0x3c0df){var _0x4bd502=this;return new Promise(function(_0x945431,_0x4e4a9a){return db[_0x1a0f('0x14')][_0x1a0f('0x15')](_0x3c0df[_0x1a0f('0x16')],{'raw':_0x3c0df[_0x1a0f('0x17')]?_0x3c0df['options'][_0x1a0f('0x18')]===undefined?!![]:![]:!![]})[_0x1a0f('0x19')](function(_0x41e11b){logger[_0x1a0f('0xa')](_0x1a0f('0x13'),_0x3c0df);logger[_0x1a0f('0xc')]('CreateVoiceTransferReport',_0x3c0df,JSON[_0x1a0f('0x1a')](_0x41e11b));_0x945431(_0x41e11b);})[_0x1a0f('0x12')](function(_0x13623c){logger[_0x1a0f('0xe')](_0x1a0f('0x13'),_0x13623c['message'],_0x3c0df);_0x4e4a9a(_0x4bd502[_0x1a0f('0xe')](0x1f4,_0x13623c['message']));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index 1086ce9..596ac9d 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 _0xd676=['/hold','hold','/unhold','unhold','/calls','calls','/transfer','transfer','express','../../components/auth/service','./webbar.controller','post','/originate','isAuthenticated','canUpdate','originate','/hangup','hangup','/answer','answer'];(function(_0x5754a4,_0x180a6c){var _0x1dfa7f=function(_0x524617){while(--_0x524617){_0x5754a4['push'](_0x5754a4['shift']());}};_0x1dfa7f(++_0x180a6c);}(_0xd676,0x198));var _0x6d67=function(_0x2272e9,_0x3f615e){_0x2272e9=_0x2272e9-0x0;var _0x54056=_0xd676[_0x2272e9];return _0x54056;};'use strict';var express=require(_0x6d67('0x0'));var router=express['Router']();var auth=require(_0x6d67('0x1'));var controller=require(_0x6d67('0x2'));router[_0x6d67('0x3')](_0x6d67('0x4'),auth[_0x6d67('0x5')](),auth[_0x6d67('0x6')](),controller[_0x6d67('0x7')]);router[_0x6d67('0x3')](_0x6d67('0x8'),auth[_0x6d67('0x5')](),auth[_0x6d67('0x6')](),controller[_0x6d67('0x9')]);router[_0x6d67('0x3')](_0x6d67('0xa'),auth[_0x6d67('0x5')](),auth[_0x6d67('0x6')](),controller[_0x6d67('0xb')]);router[_0x6d67('0x3')](_0x6d67('0xc'),auth[_0x6d67('0x5')](),auth[_0x6d67('0x6')](),controller[_0x6d67('0xd')]);router[_0x6d67('0x3')](_0x6d67('0xe'),auth[_0x6d67('0x5')](),auth['canUpdate'](),controller[_0x6d67('0xf')]);router[_0x6d67('0x3')](_0x6d67('0x10'),auth['isAuthenticated'](),auth[_0x6d67('0x6')](),controller[_0x6d67('0x11')]);router[_0x6d67('0x3')](_0x6d67('0x12'),auth[_0x6d67('0x5')](),auth[_0x6d67('0x6')](),controller[_0x6d67('0x13')]);module['exports']=router; \ No newline at end of file +var _0x2852=['post','/originate','isAuthenticated','originate','canUpdate','hangup','/answer','answer','/hold','hold','/unhold','calls','/transfer','transfer','express','Router','../../components/auth/service','./webbar.controller'];(function(_0x5897ad,_0x27e5bf){var _0x8a5ffa=function(_0x13c25a){while(--_0x13c25a){_0x5897ad['push'](_0x5897ad['shift']());}};_0x8a5ffa(++_0x27e5bf);}(_0x2852,0xf8));var _0x2285=function(_0x4b30ca,_0x5d81a7){_0x4b30ca=_0x4b30ca-0x0;var _0x21cf1f=_0x2852[_0x4b30ca];return _0x21cf1f;};'use strict';var express=require(_0x2285('0x0'));var router=express[_0x2285('0x1')]();var auth=require(_0x2285('0x2'));var controller=require(_0x2285('0x3'));router[_0x2285('0x4')](_0x2285('0x5'),auth[_0x2285('0x6')](),auth['canUpdate'](),controller[_0x2285('0x7')]);router[_0x2285('0x4')]('/hangup',auth[_0x2285('0x6')](),auth[_0x2285('0x8')](),controller[_0x2285('0x9')]);router[_0x2285('0x4')](_0x2285('0xa'),auth['isAuthenticated'](),auth[_0x2285('0x8')](),controller[_0x2285('0xb')]);router[_0x2285('0x4')](_0x2285('0xc'),auth['isAuthenticated'](),auth[_0x2285('0x8')](),controller[_0x2285('0xd')]);router['post'](_0x2285('0xe'),auth[_0x2285('0x6')](),auth[_0x2285('0x8')](),controller['unhold']);router['post']('/calls',auth[_0x2285('0x6')](),auth[_0x2285('0x8')](),controller[_0x2285('0xf')]);router[_0x2285('0x4')](_0x2285('0x10'),auth[_0x2285('0x6')](),auth[_0x2285('0x8')](),controller[_0x2285('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index 264e3ec..df550ff 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 _0xb0b9=['User','agent','VoiceChannels','all','rows','sessionId','length','sessionId\x20','\x20not\x20found!','originate','body','userId','callNumber','callerId','callbackUrl','entityFound:','format','user:%s','webbar:originate','json','originate\x20executed!','hangup','hangup\x20fired:','validate','webbar:hangup','hangup\x20executed!','answer','webbar:answer','answer\x20executed!','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','webbar:unhold','calls','calls\x20fired:','filter','webbar:conference','conference\x20executed!','transfer','transferNumber','webbar:transfer','transfer\x20executed!','path','../../config/environment','util','bluebird','jayson/promise','client','http','../../config/logger','webbarapi','ioredis','redis','defaults','localhost','socket.io-emitter','number','userId\x20is\x20required','string','callNumber\x20is\x20required','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','emit','log','handleError:','error','name','status','NotFound','then','code','message','catch'];(function(_0x25def3,_0x69218c){var _0x3a6b85=function(_0x21e7e4){while(--_0x21e7e4){_0x25def3['push'](_0x25def3['shift']());}};_0x3a6b85(++_0x69218c);}(_0xb0b9,0x1f3));var _0x9b0b=function(_0x247990,_0x3c4c47){_0x247990=_0x247990-0x0;var _0x9c509e=_0xb0b9[_0x247990];return _0x9c509e;};'use strict';var path=require(_0x9b0b('0x0'));var fs=require('fs');var _=require('lodash');var db=require('../../mysqldb')['db'];var config=require(_0x9b0b('0x1'));var util=require(_0x9b0b('0x2'));var BPromise=require(_0x9b0b('0x3'));var jayson=require(_0x9b0b('0x4'));var amiClient=jayson[_0x9b0b('0x5')][_0x9b0b('0x6')]({'port':0x232a});var logger=require(_0x9b0b('0x7'))(_0x9b0b('0x8'));var Redis=require(_0x9b0b('0x9'));config[_0x9b0b('0xa')]=_[_0x9b0b('0xb')](config[_0x9b0b('0xa')],{'host':_0x9b0b('0xc'),'port':0x18eb});var io=require(_0x9b0b('0xd'))(new Redis(config['redis']));var Schema=require('validate');var originateValidation=new Schema({'userId':{'type':_0x9b0b('0xe'),'required':[!![],_0x9b0b('0xf')]},'callNumber':{'type':_0x9b0b('0x10'),'required':[!![],_0x9b0b('0x11')]},'callerId':{'type':_0x9b0b('0x10')},'callbackUrl':{'type':_0x9b0b('0x10')}});var hangupValidation=new Schema({'userId':{'type':'number','required':[!![],_0x9b0b('0xf')]},'sessionId':{'type':_0x9b0b('0x10'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x9b0b('0xe'),'required':[!![],_0x9b0b('0xf')]},'sessionId':{'type':'string','required':![]}});var transferValidation=new Schema({'userId':{'type':'number','required':[!![],_0x9b0b('0xf')]},'sessionId':{'type':'string','required':[!![],_0x9b0b('0x12')]},'transferNumber':{'type':'string','required':[!![],_0x9b0b('0x13')]}});var holdValidation=new Schema({'userId':{'type':_0x9b0b('0xe'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x9b0b('0xe'),'required':[!![],_0x9b0b('0xf')]},'sessionId':{'type':_0x9b0b('0x10'),'required':![]}});var callsValidation=new Schema({'userId':{'type':'number','required':[!![],_0x9b0b('0xf')]}});var conferenceValidation=new Schema({'userId':{'type':_0x9b0b('0xe'),'required':[!![],_0x9b0b('0xf')]}});function emit(_0x1e92c1,_0x4665d8,_0x12f1b9){logger[_0x9b0b('0x14')](_0x1e92c1,_0x4665d8,JSON[_0x9b0b('0x15')](_0x12f1b9));io['to'](_0x1e92c1)[_0x9b0b('0x16')](_0x4665d8,_0x12f1b9);}function handleError(_0xcab079){return function(_0x264b6d){console[_0x9b0b('0x17')](_0x9b0b('0x18'),_0x264b6d,_0x264b6d instanceof RangeError);logger[_0x9b0b('0x19')](_0x264b6d['stack']);if(_0x264b6d instanceof RangeError){if(_0x264b6d[_0x9b0b('0x1a')]){delete _0x264b6d[_0x9b0b('0x1a')];}_0xcab079[_0x9b0b('0x1b')](0x194)['send'](_0x264b6d);}else{if(_0x264b6d[_0x9b0b('0x1a')]){delete _0x264b6d[_0x9b0b('0x1a')];}_0xcab079[_0x9b0b('0x1b')](0x1f4)['send'](_0x264b6d);}};}function checkError(){return function(_0x3f19ae){if(!_0x3f19ae){throw new RangeError(_0x9b0b('0x1c'));}return _0x3f19ae;};}function respondWithRpcPromise(_0x27b8e3,_0x16c8f9){return new BPromise(function(_0x4fe0a2,_0x30bfe8){var _0x408f70=amiClient;return _0x408f70['request'](_0x27b8e3,_0x16c8f9)[_0x9b0b('0x1d')](function(_0x1e7789){if(_0x1e7789[_0x9b0b('0x19')]){if(_0x1e7789[_0x9b0b('0x19')][_0x9b0b('0x1e')]===0x1f4){return _0x30bfe8(_0x1e7789[_0x9b0b('0x19')][_0x9b0b('0x1f')]);}return _0x4fe0a2(_0x1e7789[_0x9b0b('0x19')][_0x9b0b('0x1f')]);}else{_0x4fe0a2(_0x1e7789['result']);}})[_0x9b0b('0x20')](function(_0x22a136){_0x30bfe8(_0x22a136);});});}function getAgent(_0x246652){return db[_0x9b0b('0x21')]['findOne']({'where':{'id':_0x246652,'role':_0x9b0b('0x22')}})[_0x9b0b('0x1d')](checkError());}function getAgentCheckSession(_0x5c9ec3,_0x2841fc){return new BPromise(function(_0x1e25fb,_0x1a31ba){var _0x47a135=respondWithRpcPromise(_0x9b0b('0x23'));var _0xa4f392=getAgent(_0x5c9ec3);Promise[_0x9b0b('0x24')]([_0x47a135,_0xa4f392])['then'](function(_0x2575d8){var _0x32668d=_0x2575d8[0x0];var _0x21b533=_0x2575d8[0x1];var _0x22ce12=_['filter'](_0x32668d[_0x9b0b('0x25')],function(_0xfa71df){return _0xfa71df['UserId']==_0x21b533['id']&&_0xfa71df[_0x9b0b('0x26')]==_0x2841fc;});if(_0x22ce12[_0x9b0b('0x27')]==0x1){_0x1e25fb(_0x21b533);}else{_0x1a31ba(new RangeError(_0x9b0b('0x28')+_0x2841fc+_0x9b0b('0x29')));}});});}exports[_0x9b0b('0x2a')]=function(_0x26e90c,_0xfd6ce){logger[_0x9b0b('0x14')]('originate\x20fired:',_0x26e90c['body']);var _0x3fcf01=originateValidation['validate'](_0x26e90c[_0x9b0b('0x2b')]);if(_0x3fcf01['length']>0x0){return _0xfd6ce['status'](0x190)['json'](_0x3fcf01);}var _0x40e4c3=_0x26e90c[_0x9b0b('0x2b')][_0x9b0b('0x2c')];var _0x212b85=_0x26e90c[_0x9b0b('0x2b')][_0x9b0b('0x2d')];var _0x2938ff=_0x26e90c[_0x9b0b('0x2b')][_0x9b0b('0x2e')];var _0x444d20=_0x26e90c[_0x9b0b('0x2b')][_0x9b0b('0x2f')];return getAgent(_0x40e4c3)[_0x9b0b('0x1d')](function(_0x5dc1a6){logger[_0x9b0b('0x14')](_0x9b0b('0x30'),_0x5dc1a6[_0x9b0b('0x1a')]);emit(util[_0x9b0b('0x31')](_0x9b0b('0x32'),_0x5dc1a6[_0x9b0b('0x1a')]),_0x9b0b('0x33'),{'callNumber':_0x212b85,'callerId':_0x2938ff,'callbackUrl':_0x444d20});return _0xfd6ce[_0x9b0b('0x1b')](0xc8)[_0x9b0b('0x34')]({'error':![],'message':_0x9b0b('0x35')});})[_0x9b0b('0x20')](handleError(_0xfd6ce));};exports[_0x9b0b('0x36')]=function(_0x97d73a,_0x561942){logger['info'](_0x9b0b('0x37'),_0x97d73a[_0x9b0b('0x2b')]);var _0xe60dec=hangupValidation[_0x9b0b('0x38')](_0x97d73a[_0x9b0b('0x2b')]);if(_0xe60dec['length']>0x0){return _0x561942[_0x9b0b('0x1b')](0x190)[_0x9b0b('0x34')](_0xe60dec);}var _0x24cee7=_0x97d73a[_0x9b0b('0x2b')]['userId'];var _0x5ac75f=_0x97d73a[_0x9b0b('0x2b')]['sessionId'];return getAgent(_0x24cee7)[_0x9b0b('0x1d')](function(_0x316d86){logger[_0x9b0b('0x14')](_0x9b0b('0x30'),_0x316d86[_0x9b0b('0x1a')]);emit(util[_0x9b0b('0x31')](_0x9b0b('0x32'),_0x316d86[_0x9b0b('0x1a')]),_0x9b0b('0x39'),{'sessionId':_0x5ac75f});return _0x561942[_0x9b0b('0x1b')](0xc8)[_0x9b0b('0x34')]({'error':![],'message':_0x9b0b('0x3a')});})[_0x9b0b('0x20')](handleError(_0x561942));};exports[_0x9b0b('0x3b')]=function(_0xef0a28,_0x58d181){logger['info']('answer\x20fired:',_0xef0a28[_0x9b0b('0x2b')]);var _0x42d7e3=answerValidation[_0x9b0b('0x38')](_0xef0a28[_0x9b0b('0x2b')]);if(_0x42d7e3[_0x9b0b('0x27')]>0x0){return _0x58d181['status'](0x190)['json'](_0x42d7e3);}var _0x20ec55=_0xef0a28[_0x9b0b('0x2b')][_0x9b0b('0x2c')];var _0x136a33=_0xef0a28['body'][_0x9b0b('0x26')];return getAgent(_0x20ec55)[_0x9b0b('0x1d')](function(_0x177cde){logger[_0x9b0b('0x14')](_0x9b0b('0x30'),_0x177cde['name']);emit(util[_0x9b0b('0x31')](_0x9b0b('0x32'),_0x177cde[_0x9b0b('0x1a')]),_0x9b0b('0x3c'),{'sessionId':_0x136a33});return _0x58d181[_0x9b0b('0x1b')](0xc8)[_0x9b0b('0x34')]({'error':![],'message':_0x9b0b('0x3d')});})[_0x9b0b('0x20')](handleError(_0x58d181));};exports['hold']=function(_0x512ecc,_0x5bfa12){logger[_0x9b0b('0x14')](_0x9b0b('0x3e'),_0x512ecc[_0x9b0b('0x2b')]);var _0x25ed06=holdValidation[_0x9b0b('0x38')](_0x512ecc[_0x9b0b('0x2b')]);if(_0x25ed06[_0x9b0b('0x27')]>0x0){return _0x5bfa12[_0x9b0b('0x1b')](0x190)[_0x9b0b('0x34')](_0x25ed06);}var _0x1f2108=_0x512ecc[_0x9b0b('0x2b')]['userId'];var _0x3b15b3=_0x512ecc[_0x9b0b('0x2b')]['sessionId'];return getAgent(_0x1f2108)['then'](function(_0xd9410f){logger[_0x9b0b('0x14')](_0x9b0b('0x30'),_0xd9410f[_0x9b0b('0x1a')]);emit(util['format'](_0x9b0b('0x32'),_0xd9410f[_0x9b0b('0x1a')]),_0x9b0b('0x3f'),{'sessionId':_0x3b15b3});return _0x5bfa12[_0x9b0b('0x1b')](0xc8)[_0x9b0b('0x34')]({'error':![],'message':_0x9b0b('0x40')});})[_0x9b0b('0x20')](handleError(_0x5bfa12));};exports[_0x9b0b('0x41')]=function(_0x146654,_0x5d71d7){logger[_0x9b0b('0x14')]('unhold\x20fired:',_0x146654[_0x9b0b('0x2b')]);var _0x5eb636=unholdValidation['validate'](_0x146654[_0x9b0b('0x2b')]);if(_0x5eb636[_0x9b0b('0x27')]>0x0){return _0x5d71d7[_0x9b0b('0x1b')](0x190)[_0x9b0b('0x34')](_0x5eb636);}var _0x105503=_0x146654[_0x9b0b('0x2b')][_0x9b0b('0x2c')];var _0x495b3e=_0x146654['body']['sessionId'];return getAgent(_0x105503)[_0x9b0b('0x1d')](function(_0x250b06){logger[_0x9b0b('0x14')](_0x9b0b('0x30'),_0x250b06[_0x9b0b('0x1a')]);emit(util[_0x9b0b('0x31')]('user:%s',_0x250b06[_0x9b0b('0x1a')]),_0x9b0b('0x42'),{'sessionId':_0x495b3e});return _0x5d71d7['status'](0xc8)['json']({'error':![],'message':'unhold\x20executed!'});})[_0x9b0b('0x20')](handleError(_0x5d71d7));};exports[_0x9b0b('0x43')]=function(_0x5156c1,_0x51ea1d){logger['info'](_0x9b0b('0x44'),_0x51ea1d[_0x9b0b('0x2b')]);var _0x23225c=callsValidation[_0x9b0b('0x38')](_0x5156c1[_0x9b0b('0x2b')]);if(_0x23225c[_0x9b0b('0x27')]>0x0){return _0x51ea1d[_0x9b0b('0x1b')](0x190)[_0x9b0b('0x34')](_0x23225c);}var _0x283f31=_0x5156c1[_0x9b0b('0x2b')][_0x9b0b('0x2c')];var _0x4a2fbd=respondWithRpcPromise(_0x9b0b('0x23'));var _0x21f650=getAgent(_0x283f31);return Promise['all']([_0x4a2fbd,_0x21f650])[_0x9b0b('0x1d')](function(_0x30a39d){var _0x49ca3a=_0x30a39d[0x0];var _0x2a92b9=_0x30a39d[0x1];var _0x16f879=_[_0x9b0b('0x45')](_0x49ca3a[_0x9b0b('0x25')],function(_0x45b272){return _0x45b272['UserId']==_0x2a92b9['id'];});return _0x51ea1d[_0x9b0b('0x1b')](0xc8)[_0x9b0b('0x34')]({'count':_0x16f879[_0x9b0b('0x27')],'rows':_0x16f879});})[_0x9b0b('0x20')](handleError(_0x51ea1d));};exports['conference']=function(_0x4928b1,_0x25553d){logger[_0x9b0b('0x14')]('conference\x20fired:',_0x4928b1['body']);var _0x3a599d=conferenceValidation[_0x9b0b('0x38')](_0x4928b1[_0x9b0b('0x2b')]);if(_0x3a599d[_0x9b0b('0x27')]>0x0){return _0x25553d[_0x9b0b('0x1b')](0x190)[_0x9b0b('0x34')](_0x3a599d);}var _0xc935e1=_0x4928b1[_0x9b0b('0x2b')]['userId'];return getAgent(_0xc935e1)[_0x9b0b('0x1d')](function(_0x38ff6d){logger[_0x9b0b('0x14')](_0x9b0b('0x30'),_0x38ff6d['name']);emit(util[_0x9b0b('0x31')]('user:%s',_0x38ff6d[_0x9b0b('0x1a')]),_0x9b0b('0x46'));return _0x25553d[_0x9b0b('0x1b')](0xc8)[_0x9b0b('0x34')]({'error':![],'message':_0x9b0b('0x47')});})['catch'](handleError(_0x25553d));};exports[_0x9b0b('0x48')]=function(_0x3804e6,_0x4337c3){logger[_0x9b0b('0x14')]('transfer\x20fired:',_0x3804e6[_0x9b0b('0x2b')]);var _0x259340=transferValidation[_0x9b0b('0x38')](_0x3804e6[_0x9b0b('0x2b')]);if(_0x259340[_0x9b0b('0x27')]>0x0){return _0x4337c3['status'](0x190)[_0x9b0b('0x34')](_0x259340);}var _0x667604=_0x3804e6['body'][_0x9b0b('0x2c')];var _0x246056=_0x3804e6[_0x9b0b('0x2b')][_0x9b0b('0x26')];var _0x3b69a4=_0x3804e6[_0x9b0b('0x2b')][_0x9b0b('0x49')];return getAgent(_0x667604)[_0x9b0b('0x1d')](function(_0x1c0192){logger[_0x9b0b('0x14')](_0x9b0b('0x30'),_0x1c0192[_0x9b0b('0x1a')]);emit(util[_0x9b0b('0x31')]('user:%s',_0x1c0192[_0x9b0b('0x1a')]),_0x9b0b('0x4a'),{'sessionId':_0x246056,'transferNumber':_0x3b69a4});return _0x4337c3['status'](0xc8)['json']({'error':![],'message':_0x9b0b('0x4b')});})['catch'](handleError(_0x4337c3));}; \ No newline at end of file +var _0xaf80=['../../mysqldb','../../config/environment','client','http','../../config/logger','webbarapi','ioredis','redis','localhost','validate','number','string','callNumber\x20is\x20required','userId\x20is\x20required','sessionId\x20is\x20required','transferNumber\x20is\x20required','emit','log','handleError:','error','status','send','name','NotFound','request','then','code','message','result','catch','agent','all','filter','rows','UserId','length','\x20not\x20found!','originate\x20fired:','body','userId','callNumber','callerId','callbackUrl','info','entityFound:','format','user:%s','webbar:originate','json','originate\x20executed!','hangup','hangup\x20fired:','sessionId','webbar:hangup','hangup\x20executed!','answer','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','calls','VoiceChannels','conference','conference\x20fired:','webbar:conference','conference\x20executed!','transfer','webbar:transfer','path','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xaf80,0x1ef));var _0x0af8=function(_0x52bd7b,_0x4d01ca){_0x52bd7b=_0x52bd7b-0x0;var _0x1d7738=_0xaf80[_0x52bd7b];return _0x1d7738;};'use strict';var path=require(_0x0af8('0x0'));var fs=require('fs');var _=require(_0x0af8('0x1'));var db=require(_0x0af8('0x2'))['db'];var config=require(_0x0af8('0x3'));var util=require('util');var BPromise=require('bluebird');var jayson=require('jayson/promise');var amiClient=jayson[_0x0af8('0x4')][_0x0af8('0x5')]({'port':0x232a});var logger=require(_0x0af8('0x6'))(_0x0af8('0x7'));var Redis=require(_0x0af8('0x8'));config[_0x0af8('0x9')]=_['defaults'](config['redis'],{'host':_0x0af8('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0af8('0x9')]));var Schema=require(_0x0af8('0xb'));var originateValidation=new Schema({'userId':{'type':_0x0af8('0xc'),'required':[!![],'userId\x20is\x20required']},'callNumber':{'type':_0x0af8('0xd'),'required':[!![],_0x0af8('0xe')]},'callerId':{'type':_0x0af8('0xd')},'callbackUrl':{'type':'string'}});var hangupValidation=new Schema({'userId':{'type':'number','required':[!![],_0x0af8('0xf')]},'sessionId':{'type':_0x0af8('0xd'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x0af8('0xc'),'required':[!![],_0x0af8('0xf')]},'sessionId':{'type':_0x0af8('0xd'),'required':![]}});var transferValidation=new Schema({'userId':{'type':'number','required':[!![],_0x0af8('0xf')]},'sessionId':{'type':_0x0af8('0xd'),'required':[!![],_0x0af8('0x10')]},'transferNumber':{'type':_0x0af8('0xd'),'required':[!![],_0x0af8('0x11')]}});var holdValidation=new Schema({'userId':{'type':_0x0af8('0xc'),'required':[!![],_0x0af8('0xf')]},'sessionId':{'type':'string','required':![]}});var unholdValidation=new Schema({'userId':{'type':'number','required':[!![],_0x0af8('0xf')]},'sessionId':{'type':_0x0af8('0xd'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x0af8('0xc'),'required':[!![],_0x0af8('0xf')]}});var conferenceValidation=new Schema({'userId':{'type':_0x0af8('0xc'),'required':[!![],_0x0af8('0xf')]}});function emit(_0x4755cb,_0x325b4c,_0x50d5ba){logger['info'](_0x4755cb,_0x325b4c,JSON['stringify'](_0x50d5ba));io['to'](_0x4755cb)[_0x0af8('0x12')](_0x325b4c,_0x50d5ba);}function handleError(_0x465161){return function(_0x54e946){console[_0x0af8('0x13')](_0x0af8('0x14'),_0x54e946,_0x54e946 instanceof RangeError);logger[_0x0af8('0x15')](_0x54e946['stack']);if(_0x54e946 instanceof RangeError){if(_0x54e946['name']){delete _0x54e946['name'];}_0x465161[_0x0af8('0x16')](0x194)[_0x0af8('0x17')](_0x54e946);}else{if(_0x54e946['name']){delete _0x54e946[_0x0af8('0x18')];}_0x465161['status'](0x1f4)['send'](_0x54e946);}};}function checkError(){return function(_0x40384f){if(!_0x40384f){throw new RangeError(_0x0af8('0x19'));}return _0x40384f;};}function respondWithRpcPromise(_0x29cd4a,_0x5c0dd1){return new BPromise(function(_0x162e95,_0x52778f){var _0x592523=amiClient;return _0x592523[_0x0af8('0x1a')](_0x29cd4a,_0x5c0dd1)[_0x0af8('0x1b')](function(_0x4b0492){if(_0x4b0492[_0x0af8('0x15')]){if(_0x4b0492[_0x0af8('0x15')][_0x0af8('0x1c')]===0x1f4){return _0x52778f(_0x4b0492[_0x0af8('0x15')][_0x0af8('0x1d')]);}return _0x162e95(_0x4b0492['error']['message']);}else{_0x162e95(_0x4b0492[_0x0af8('0x1e')]);}})[_0x0af8('0x1f')](function(_0x359583){_0x52778f(_0x359583);});});}function getAgent(_0xb43164){return db['User']['findOne']({'where':{'id':_0xb43164,'role':_0x0af8('0x20')}})[_0x0af8('0x1b')](checkError());}function getAgentCheckSession(_0x23a102,_0x140104){return new BPromise(function(_0x2e8853,_0x410216){var _0x318476=respondWithRpcPromise('VoiceChannels');var _0x34aa8b=getAgent(_0x23a102);Promise[_0x0af8('0x21')]([_0x318476,_0x34aa8b])[_0x0af8('0x1b')](function(_0x20eab4){var _0x1b94cf=_0x20eab4[0x0];var _0x231230=_0x20eab4[0x1];var _0x4575b0=_[_0x0af8('0x22')](_0x1b94cf[_0x0af8('0x23')],function(_0x270b49){return _0x270b49[_0x0af8('0x24')]==_0x231230['id']&&_0x270b49['sessionId']==_0x140104;});if(_0x4575b0[_0x0af8('0x25')]==0x1){_0x2e8853(_0x231230);}else{_0x410216(new RangeError('sessionId\x20'+_0x140104+_0x0af8('0x26')));}});});}exports['originate']=function(_0x318ca7,_0x1d2d4f){logger['info'](_0x0af8('0x27'),_0x318ca7[_0x0af8('0x28')]);var _0x34b3e5=originateValidation['validate'](_0x318ca7[_0x0af8('0x28')]);if(_0x34b3e5[_0x0af8('0x25')]>0x0){return _0x1d2d4f[_0x0af8('0x16')](0x190)['json'](_0x34b3e5);}var _0x3c4657=_0x318ca7[_0x0af8('0x28')][_0x0af8('0x29')];var _0x1aded0=_0x318ca7[_0x0af8('0x28')][_0x0af8('0x2a')];var _0x4dcdbc=_0x318ca7[_0x0af8('0x28')][_0x0af8('0x2b')];var _0x73d193=_0x318ca7[_0x0af8('0x28')][_0x0af8('0x2c')];return getAgent(_0x3c4657)[_0x0af8('0x1b')](function(_0x13991a){logger[_0x0af8('0x2d')](_0x0af8('0x2e'),_0x13991a[_0x0af8('0x18')]);emit(util[_0x0af8('0x2f')](_0x0af8('0x30'),_0x13991a['name']),_0x0af8('0x31'),{'callNumber':_0x1aded0,'callerId':_0x4dcdbc,'callbackUrl':_0x73d193});return _0x1d2d4f[_0x0af8('0x16')](0xc8)[_0x0af8('0x32')]({'error':![],'message':_0x0af8('0x33')});})[_0x0af8('0x1f')](handleError(_0x1d2d4f));};exports[_0x0af8('0x34')]=function(_0x114ef3,_0x5e971f){logger[_0x0af8('0x2d')](_0x0af8('0x35'),_0x114ef3[_0x0af8('0x28')]);var _0x4d7e1f=hangupValidation[_0x0af8('0xb')](_0x114ef3[_0x0af8('0x28')]);if(_0x4d7e1f[_0x0af8('0x25')]>0x0){return _0x5e971f['status'](0x190)[_0x0af8('0x32')](_0x4d7e1f);}var _0x122382=_0x114ef3[_0x0af8('0x28')][_0x0af8('0x29')];var _0x44c198=_0x114ef3[_0x0af8('0x28')][_0x0af8('0x36')];return getAgent(_0x122382)['then'](function(_0x586924){logger[_0x0af8('0x2d')](_0x0af8('0x2e'),_0x586924['name']);emit(util[_0x0af8('0x2f')](_0x0af8('0x30'),_0x586924['name']),_0x0af8('0x37'),{'sessionId':_0x44c198});return _0x5e971f['status'](0xc8)[_0x0af8('0x32')]({'error':![],'message':_0x0af8('0x38')});})['catch'](handleError(_0x5e971f));};exports[_0x0af8('0x39')]=function(_0x3fefbc,_0x497695){logger[_0x0af8('0x2d')]('answer\x20fired:',_0x3fefbc[_0x0af8('0x28')]);var _0x423eee=answerValidation[_0x0af8('0xb')](_0x3fefbc['body']);if(_0x423eee['length']>0x0){return _0x497695[_0x0af8('0x16')](0x190)[_0x0af8('0x32')](_0x423eee);}var _0x37e54e=_0x3fefbc[_0x0af8('0x28')]['userId'];var _0x1293d8=_0x3fefbc[_0x0af8('0x28')][_0x0af8('0x36')];return getAgent(_0x37e54e)['then'](function(_0x15aa0c){logger[_0x0af8('0x2d')]('entityFound:',_0x15aa0c[_0x0af8('0x18')]);emit(util['format'](_0x0af8('0x30'),_0x15aa0c['name']),'webbar:answer',{'sessionId':_0x1293d8});return _0x497695['status'](0xc8)[_0x0af8('0x32')]({'error':![],'message':'answer\x20executed!'});})[_0x0af8('0x1f')](handleError(_0x497695));};exports['hold']=function(_0x226292,_0x38515e){logger[_0x0af8('0x2d')](_0x0af8('0x3a'),_0x226292[_0x0af8('0x28')]);var _0x562f09=holdValidation['validate'](_0x226292[_0x0af8('0x28')]);if(_0x562f09[_0x0af8('0x25')]>0x0){return _0x38515e[_0x0af8('0x16')](0x190)[_0x0af8('0x32')](_0x562f09);}var _0x3d86e2=_0x226292[_0x0af8('0x28')][_0x0af8('0x29')];var _0x578e52=_0x226292['body'][_0x0af8('0x36')];return getAgent(_0x3d86e2)[_0x0af8('0x1b')](function(_0x394525){logger[_0x0af8('0x2d')]('entityFound:',_0x394525[_0x0af8('0x18')]);emit(util[_0x0af8('0x2f')](_0x0af8('0x30'),_0x394525[_0x0af8('0x18')]),_0x0af8('0x3b'),{'sessionId':_0x578e52});return _0x38515e[_0x0af8('0x16')](0xc8)['json']({'error':![],'message':_0x0af8('0x3c')});})['catch'](handleError(_0x38515e));};exports[_0x0af8('0x3d')]=function(_0x4a43e3,_0xeddce9){logger[_0x0af8('0x2d')](_0x0af8('0x3e'),_0x4a43e3['body']);var _0x1400eb=unholdValidation[_0x0af8('0xb')](_0x4a43e3['body']);if(_0x1400eb[_0x0af8('0x25')]>0x0){return _0xeddce9[_0x0af8('0x16')](0x190)[_0x0af8('0x32')](_0x1400eb);}var _0x2a3db=_0x4a43e3[_0x0af8('0x28')][_0x0af8('0x29')];var _0x26bdc7=_0x4a43e3['body'][_0x0af8('0x36')];return getAgent(_0x2a3db)[_0x0af8('0x1b')](function(_0x49bd57){logger['info'](_0x0af8('0x2e'),_0x49bd57[_0x0af8('0x18')]);emit(util['format'](_0x0af8('0x30'),_0x49bd57[_0x0af8('0x18')]),'webbar:unhold',{'sessionId':_0x26bdc7});return _0xeddce9[_0x0af8('0x16')](0xc8)['json']({'error':![],'message':'unhold\x20executed!'});})[_0x0af8('0x1f')](handleError(_0xeddce9));};exports[_0x0af8('0x3f')]=function(_0x553625,_0x1cbc96){logger[_0x0af8('0x2d')]('calls\x20fired:',_0x1cbc96[_0x0af8('0x28')]);var _0x47d16c=callsValidation[_0x0af8('0xb')](_0x553625[_0x0af8('0x28')]);if(_0x47d16c['length']>0x0){return _0x1cbc96['status'](0x190)[_0x0af8('0x32')](_0x47d16c);}var _0x18da9c=_0x553625[_0x0af8('0x28')][_0x0af8('0x29')];var _0x524f79=respondWithRpcPromise(_0x0af8('0x40'));var _0x3910fb=getAgent(_0x18da9c);return Promise[_0x0af8('0x21')]([_0x524f79,_0x3910fb])['then'](function(_0x292f6c){var _0xff0eed=_0x292f6c[0x0];var _0x48879c=_0x292f6c[0x1];var _0x521e35=_[_0x0af8('0x22')](_0xff0eed[_0x0af8('0x23')],function(_0x2c2b10){return _0x2c2b10['UserId']==_0x48879c['id'];});return _0x1cbc96[_0x0af8('0x16')](0xc8)[_0x0af8('0x32')]({'count':_0x521e35[_0x0af8('0x25')],'rows':_0x521e35});})[_0x0af8('0x1f')](handleError(_0x1cbc96));};exports[_0x0af8('0x41')]=function(_0x5c3ab9,_0x143cf){logger['info'](_0x0af8('0x42'),_0x5c3ab9['body']);var _0x2d434a=conferenceValidation[_0x0af8('0xb')](_0x5c3ab9[_0x0af8('0x28')]);if(_0x2d434a[_0x0af8('0x25')]>0x0){return _0x143cf[_0x0af8('0x16')](0x190)[_0x0af8('0x32')](_0x2d434a);}var _0x7c1b83=_0x5c3ab9[_0x0af8('0x28')][_0x0af8('0x29')];return getAgent(_0x7c1b83)['then'](function(_0x3ff94a){logger[_0x0af8('0x2d')](_0x0af8('0x2e'),_0x3ff94a['name']);emit(util['format'](_0x0af8('0x30'),_0x3ff94a[_0x0af8('0x18')]),_0x0af8('0x43'));return _0x143cf[_0x0af8('0x16')](0xc8)[_0x0af8('0x32')]({'error':![],'message':_0x0af8('0x44')});})['catch'](handleError(_0x143cf));};exports[_0x0af8('0x45')]=function(_0x5b1c3a,_0x1d496d){logger[_0x0af8('0x2d')]('transfer\x20fired:',_0x5b1c3a['body']);var _0x563d0d=transferValidation[_0x0af8('0xb')](_0x5b1c3a[_0x0af8('0x28')]);if(_0x563d0d[_0x0af8('0x25')]>0x0){return _0x1d496d[_0x0af8('0x16')](0x190)[_0x0af8('0x32')](_0x563d0d);}var _0x2ee73e=_0x5b1c3a['body'][_0x0af8('0x29')];var _0x4ba986=_0x5b1c3a[_0x0af8('0x28')]['sessionId'];var _0x27cd1c=_0x5b1c3a[_0x0af8('0x28')]['transferNumber'];return getAgent(_0x2ee73e)[_0x0af8('0x1b')](function(_0x1b06fa){logger[_0x0af8('0x2d')](_0x0af8('0x2e'),_0x1b06fa[_0x0af8('0x18')]);emit(util['format'](_0x0af8('0x30'),_0x1b06fa[_0x0af8('0x18')]),_0x0af8('0x46'),{'sessionId':_0x4ba986,'transferNumber':_0x27cd1c});return _0x1d496d[_0x0af8('0x16')](0xc8)['json']({'error':![],'message':'transfer\x20executed!'});})['catch'](handleError(_0x1d496d));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index 6cc1714..71fc05d 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 _0x430c=['Router','./whatsappAccount.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','getAgents','/:id/applications','getApplications','post','addDisposition','/:id/users','addAgents','send','put','delete','destroy','removeDispositions','/:id/canned_answers','removeAgents','multer','connect-timeout','express'];(function(_0x426de2,_0x24acaf){var _0x1dbafc=function(_0x57e5d4){while(--_0x57e5d4){_0x426de2['push'](_0x426de2['shift']());}};_0x1dbafc(++_0x24acaf);}(_0x430c,0x1a1));var _0xc430=function(_0x591e16,_0x5aefc1){_0x591e16=_0x591e16-0x0;var _0x543b35=_0x430c[_0x591e16];return _0x543b35;};'use strict';var multer=require(_0xc430('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xc430('0x1'));var express=require(_0xc430('0x2'));var router=express[_0xc430('0x3')]();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(_0xc430('0x4'));router[_0xc430('0x5')]('/',auth['isAuthenticated'](),controller[_0xc430('0x6')]);router['get'](_0xc430('0x7'),auth[_0xc430('0x8')](),controller[_0xc430('0x9')]);router[_0xc430('0x5')](_0xc430('0xa'),auth[_0xc430('0x8')](),controller[_0xc430('0xb')]);router[_0xc430('0x5')](_0xc430('0xc'),auth['isAuthenticated'](),controller[_0xc430('0xd')]);router[_0xc430('0x5')]('/:id/canned_answers',auth[_0xc430('0x8')](),controller['getAnswers']);router[_0xc430('0x5')]('/:id/users',auth[_0xc430('0x8')](),controller[_0xc430('0xe')]);router[_0xc430('0x5')](_0xc430('0xf'),auth[_0xc430('0x8')](),controller[_0xc430('0x10')]);router[_0xc430('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0xc430('0x11')](_0xc430('0xc'),auth[_0xc430('0x8')](),controller[_0xc430('0x12')]);router[_0xc430('0x11')]('/:id/canned_answers',auth[_0xc430('0x8')](),controller['addAnswer']);router['post'](_0xc430('0x13'),auth[_0xc430('0x8')](),controller[_0xc430('0x14')]);router['post']('/:id/applications',auth[_0xc430('0x8')](),controller['addApplications']);router[_0xc430('0x11')]('/:id/notify',controller['notify']);router[_0xc430('0x11')]('/:id/send',auth[_0xc430('0x8')](),controller[_0xc430('0x15')]);router[_0xc430('0x16')](_0xc430('0xa'),auth[_0xc430('0x8')](),controller['update']);router[_0xc430('0x17')]('/:id',auth['isAuthenticated'](),controller[_0xc430('0x18')]);router[_0xc430('0x17')](_0xc430('0xc'),auth['isAuthenticated'](),controller[_0xc430('0x19')]);router['delete'](_0xc430('0x1a'),auth[_0xc430('0x8')](),controller['removeAnswers']);router[_0xc430('0x17')](_0xc430('0x13'),auth['isAuthenticated'](),controller[_0xc430('0x1b')]);module['exports']=router; \ No newline at end of file +var _0x33af=['getAnswers','/:id/users','/:id/applications','post','create','addDisposition','addAgents','addApplications','/:id/notify','/:id/send','send','put','/:id','update','delete','destroy','removeDispositions','/:id/canned_answers','removeAnswers','removeAgents','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappAccount.controller','get','index','/describe','isAuthenticated','describe','show','/:id/dispositions','getDispositions'];(function(_0x5a8407,_0x4e3846){var _0x118d6f=function(_0x1b7802){while(--_0x1b7802){_0x5a8407['push'](_0x5a8407['shift']());}};_0x118d6f(++_0x4e3846);}(_0x33af,0xec));var _0xf33a=function(_0x50408f,_0x92ffac){_0x50408f=_0x50408f-0x0;var _0xb02957=_0x33af[_0x50408f];return _0xb02957;};'use strict';var multer=require('multer');var util=require(_0xf33a('0x0'));var path=require('path');var timeout=require(_0xf33a('0x1'));var express=require(_0xf33a('0x2'));var router=express[_0xf33a('0x3')]();var fs_extra=require(_0xf33a('0x4'));var auth=require(_0xf33a('0x5'));var interaction=require(_0xf33a('0x6'));var config=require('../../config/environment');var controller=require(_0xf33a('0x7'));router[_0xf33a('0x8')]('/',auth['isAuthenticated'](),controller[_0xf33a('0x9')]);router[_0xf33a('0x8')](_0xf33a('0xa'),auth[_0xf33a('0xb')](),controller[_0xf33a('0xc')]);router[_0xf33a('0x8')]('/:id',auth[_0xf33a('0xb')](),controller[_0xf33a('0xd')]);router[_0xf33a('0x8')](_0xf33a('0xe'),auth[_0xf33a('0xb')](),controller[_0xf33a('0xf')]);router['get']('/:id/canned_answers',auth[_0xf33a('0xb')](),controller[_0xf33a('0x10')]);router[_0xf33a('0x8')](_0xf33a('0x11'),auth[_0xf33a('0xb')](),controller['getAgents']);router[_0xf33a('0x8')](_0xf33a('0x12'),auth['isAuthenticated'](),controller['getApplications']);router[_0xf33a('0x13')]('/',auth[_0xf33a('0xb')](),controller[_0xf33a('0x14')]);router[_0xf33a('0x13')](_0xf33a('0xe'),auth[_0xf33a('0xb')](),controller[_0xf33a('0x15')]);router[_0xf33a('0x13')]('/:id/canned_answers',auth[_0xf33a('0xb')](),controller['addAnswer']);router[_0xf33a('0x13')](_0xf33a('0x11'),auth['isAuthenticated'](),controller[_0xf33a('0x16')]);router[_0xf33a('0x13')]('/:id/applications',auth[_0xf33a('0xb')](),controller[_0xf33a('0x17')]);router[_0xf33a('0x13')](_0xf33a('0x18'),controller['notify']);router[_0xf33a('0x13')](_0xf33a('0x19'),auth[_0xf33a('0xb')](),controller[_0xf33a('0x1a')]);router[_0xf33a('0x1b')](_0xf33a('0x1c'),auth[_0xf33a('0xb')](),controller[_0xf33a('0x1d')]);router[_0xf33a('0x1e')](_0xf33a('0x1c'),auth['isAuthenticated'](),controller[_0xf33a('0x1f')]);router[_0xf33a('0x1e')](_0xf33a('0xe'),auth[_0xf33a('0xb')](),controller[_0xf33a('0x20')]);router['delete'](_0xf33a('0x21'),auth['isAuthenticated'](),controller[_0xf33a('0x22')]);router[_0xf33a('0x1e')](_0xf33a('0x11'),auth[_0xf33a('0xb')](),controller[_0xf33a('0x23')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index 2964c8e..ebfbc8c 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 _0xdd76=['setDataValue','sequelize','exports','STRING','name','generate','ENUM','TEXT','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId'];(function(_0x1fc86a,_0x54613a){var _0x357919=function(_0x48e964){while(--_0x48e964){_0x1fc86a['push'](_0x1fc86a['shift']());}};_0x357919(++_0x54613a);}(_0xdd76,0x1a1));var _0x6dd7=function(_0x564d92,_0x24f888){_0x564d92=_0x564d92-0x0;var _0x6c43be=_0xdd76[_0x564d92];return _0x6c43be;};'use strict';var Sequelize=require(_0x6dd7('0x0'));var rs=require('randomstring');module[_0x6dd7('0x1')]={'name':{'type':Sequelize[_0x6dd7('0x2')],'unique':_0x6dd7('0x3'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0x6dd7('0x2')],'defaultValue':function(){return rs[_0x6dd7('0x4')]();}},'phone':{'type':Sequelize[_0x6dd7('0x2')]},'type':{'type':Sequelize[_0x6dd7('0x5')]('twilio')},'accountSid':{'type':Sequelize[_0x6dd7('0x2')]},'authToken':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x6dd7('0x6')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x6dd7('0x7')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x6dd7('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x6dd7('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x6dd7('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x6dd7('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x6dd7('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x6dd7('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x6dd7('0x8')],'comment':_0x6dd7('0x9')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x6dd7('0xa'),'set':function(_0x481aca){if(!_0x481aca){this['setDataValue'](_0x6dd7('0xb'),null);}this[_0x6dd7('0xc')]('mandatoryDisposition',_0x481aca);}},'description':{'type':Sequelize[_0x6dd7('0x2')]}}; \ No newline at end of file +var _0x562b=['generate','ENUM','twilio','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','randomstring','exports','STRING','name'];(function(_0x5d23be,_0x3b4f3c){var _0x4d60a9=function(_0x57dce7){while(--_0x57dce7){_0x5d23be['push'](_0x5d23be['shift']());}};_0x4d60a9(++_0x3b4f3c);}(_0x562b,0x74));var _0xb562=function(_0x4ae625,_0xf396d0){_0x4ae625=_0x4ae625-0x0;var _0x31accf=_0x562b[_0x4ae625];return _0x31accf;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xb562('0x0'));module[_0xb562('0x1')]={'name':{'type':Sequelize[_0xb562('0x2')],'unique':_0xb562('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0xb562('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0xb562('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0xb562('0x2')],'defaultValue':function(){return rs[_0xb562('0x4')]();}},'phone':{'type':Sequelize[_0xb562('0x2')]},'type':{'type':Sequelize[_0xb562('0x5')](_0xb562('0x6'))},'accountSid':{'type':Sequelize[_0xb562('0x2')]},'authToken':{'type':Sequelize[_0xb562('0x2')]},'notificationTemplate':{'type':Sequelize[_0xb562('0x7')],'defaultValue':function(){return _0xb562('0x8');}},'notificationSound':{'type':Sequelize[_0xb562('0x9')],'defaultValue':![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xb562('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xb562('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xb562('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xb562('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xb562('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xb562('0xa')],'comment':_0xb562('0xb')},'mandatoryDisposition':{'type':Sequelize[_0xb562('0x9')],'defaultValue':![],'comment':_0xb562('0xc'),'set':function(_0x5e18ad){if(!_0x5e18ad){this[_0xb562('0xd')](_0xb562('0xe'),null);}this[_0xb562('0xd')]('mandatoryDisposition',_0x5e18ad);}},'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 1b8a705..46150cc 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 _0xc71d=['hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','rows','show','params','includeAll','include','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','describe','addDisposition','Disposition','getDispositions','pick','findAll','removeDispositions','ids','addAnswer','WhatsappAccountId','CannedAnswer','getAnswers','removeAnswers','addAgents','omit','spread','removeAgents','isArray','emit','userWhatsappAccount:remove','getAgents','findOne','User','sequelize','transaction','WhatsappApplication','bulkCreate','findAndCountAll','priority','getApplications','whatsapp','Applications','account','applications','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','difference','CompanyId','ListId','mobile','From','replace','whatsapp:','messageId','MessageSid','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','list','contact','WhatsappInteraction','interaction','created','autoclose','close','unmanaged','*,*,*,*','ContactId','UserId','unshift','waitForTheAssignedAgent','startRouting','Start','receiveMessage','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','twilio','Content-Type','text/xml','isNil','to\x20is\x20mandatory','List','DESC','out','WhatsappMessage','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','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','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','./whatsappAccount.socket','register','jayson/promise','client','then','info','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappAccount,\x20%s,\x20%s','message','catch','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','get','WhatsappAccounts','UserProfileResource','end','name','send','index','Pause','mandatoryDispositionPause','map','WhatsappAccount','rawAttributes','fieldName','type','model','keys','filters','intersection','query','fields','attributes','length'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xc71d,0x1ec));var _0xdc71=function(_0x55cc58,_0x5ce0af){_0x55cc58=_0x55cc58-0x0;var _0x26062e=_0xc71d[_0x55cc58];return _0x26062e;};'use strict';var emlformat=require(_0xdc71('0x0'));var rimraf=require(_0xdc71('0x1'));var zipdir=require(_0xdc71('0x2'));var jsonpatch=require(_0xdc71('0x3'));var rp=require(_0xdc71('0x4'));var moment=require('moment');var BPromise=require(_0xdc71('0x5'));var Mustache=require(_0xdc71('0x6'));var util=require(_0xdc71('0x7'));var path=require('path');var sox=require(_0xdc71('0x8'));var csv=require(_0xdc71('0x9'));var ejs=require(_0xdc71('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdc71('0xb'));var squel=require(_0xdc71('0xc'));var crypto=require(_0xdc71('0xd'));var jsforce=require(_0xdc71('0xe'));var deskjs=require(_0xdc71('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xdc71('0x10'));var Redis=require(_0xdc71('0x11'));var authService=require(_0xdc71('0x12'));var qs=require(_0xdc71('0x13'));var as=require(_0xdc71('0x14'));var hardwareService=require(_0xdc71('0x15'));var logger=require(_0xdc71('0x16'))('api');var utils=require(_0xdc71('0x17'));var config=require(_0xdc71('0x18'));var licenseUtil=require(_0xdc71('0x19'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xdc71('0x1a')](config[_0xdc71('0x1b')],{'host':_0xdc71('0x1c'),'port':0x18eb});var socket=require(_0xdc71('0x1d'))(new Redis(config[_0xdc71('0x1b')]));require(_0xdc71('0x1e'))[_0xdc71('0x1f')](socket);var jayson=require(_0xdc71('0x20'));var client=jayson[_0xdc71('0x21')]['http']({'port':0x232c});function respondWithRpcPromise(_0x2e796f,_0x1697c9,_0x5e2ea0,_0x336c3b){return new BPromise(function(_0x3a235c,_0x3cec50){var _0x59c245=_0x336c3b||client;return _0x59c245['request'](_0x2e796f,_0x5e2ea0)[_0xdc71('0x22')](function(_0x90b624){logger[_0xdc71('0x23')]('WhatsappAccount,\x20%s,\x20%s',_0x1697c9,_0xdc71('0x24'));logger[_0xdc71('0x25')](_0xdc71('0x26'),_0x1697c9,_0xdc71('0x24'),JSON[_0xdc71('0x27')](_0x90b624));if(_0x90b624[_0xdc71('0x28')]){if(_0x90b624[_0xdc71('0x28')][_0xdc71('0x29')]===0x1f4){logger[_0xdc71('0x28')](_0xdc71('0x2a'),_0x1697c9,_0x90b624[_0xdc71('0x28')][_0xdc71('0x2b')]);return _0x3cec50(_0x90b624[_0xdc71('0x28')][_0xdc71('0x2b')]);}logger[_0xdc71('0x28')]('WhatsappAccount,\x20%s,\x20%s',_0x1697c9,_0x90b624[_0xdc71('0x28')][_0xdc71('0x2b')]);return _0x3a235c(_0x90b624['error']['message']);}else{logger[_0xdc71('0x23')](_0xdc71('0x2a'),_0x1697c9,_0xdc71('0x24'));_0x3a235c(_0x90b624['result'][_0xdc71('0x2b')]);}})[_0xdc71('0x2c')](function(_0x3bada4){logger[_0xdc71('0x28')](_0xdc71('0x2a'),_0x1697c9,_0x3bada4);_0x3cec50(_0x3bada4);});});}function respondWithStatusCode(_0x10f7d6,_0x2e4aae){_0x2e4aae=_0x2e4aae||0xcc;return function(_0x5473a8){if(_0x5473a8){return _0x10f7d6[_0xdc71('0x2d')](_0x2e4aae);}return _0x10f7d6[_0xdc71('0x2e')](_0x2e4aae)['end']();};}function respondWithResult(_0x57a639,_0x53e512){_0x53e512=_0x53e512||0xc8;return function(_0x1b4984){if(_0x1b4984){return _0x57a639[_0xdc71('0x2e')](_0x53e512)[_0xdc71('0x2f')](_0x1b4984);}};}function respondWithFilteredResult(_0x2332ca,_0x31187b){return function(_0x1e0d14){if(_0x1e0d14){var _0x24ebc4=typeof _0x31187b['offset']===_0xdc71('0x30')&&typeof _0x31187b['limit']===_0xdc71('0x30');var _0x5e400f=_0x1e0d14[_0xdc71('0x31')];var _0x308c62=_0x24ebc4?0x0:_0x31187b[_0xdc71('0x32')];var _0x4a2811=_0x24ebc4?_0x1e0d14[_0xdc71('0x31')]:_0x31187b[_0xdc71('0x32')]+_0x31187b[_0xdc71('0x33')];var _0x17dc03;if(_0x4a2811>=_0x5e400f){_0x4a2811=_0x5e400f;_0x17dc03=0xc8;}else{_0x17dc03=0xce;}_0x2332ca[_0xdc71('0x2e')](_0x17dc03);return _0x2332ca[_0xdc71('0x34')](_0xdc71('0x35'),_0x308c62+'-'+_0x4a2811+'/'+_0x5e400f)[_0xdc71('0x2f')](_0x1e0d14);}return null;};}function patchUpdates(_0x3976d1){return function(_0x3aa7c0){try{jsonpatch[_0xdc71('0x36')](_0x3aa7c0,_0x3976d1,!![]);}catch(_0x169afa){return BPromise[_0xdc71('0x37')](_0x169afa);}return _0x3aa7c0[_0xdc71('0x38')]();};}function saveUpdates(_0x36a8d1,_0x5781c2){return function(_0x4bf068){if(_0x4bf068){return _0x4bf068[_0xdc71('0x39')](_0x36a8d1)[_0xdc71('0x22')](function(_0x1f8d51){return _0x1f8d51;});}return null;};}function removeEntity(_0xc123bd,_0x2715b4){return function(_0x32421f){if(_0x32421f){return _0x32421f[_0xdc71('0x3a')]()[_0xdc71('0x22')](function(){var _0x56185e=_0x32421f[_0xdc71('0x3b')]({'plain':!![]});var _0x376972=_0xdc71('0x3c');return db[_0xdc71('0x3d')]['destroy']({'where':{'type':_0x376972,'resourceId':_0x56185e['id']}})[_0xdc71('0x22')](function(){return _0x32421f;});})[_0xdc71('0x22')](function(){_0xc123bd[_0xdc71('0x2e')](0xcc)[_0xdc71('0x3e')]();});}};}function handleEntityNotFound(_0x262159,_0x368687){return function(_0x5d6c17){if(!_0x5d6c17){_0x262159[_0xdc71('0x2d')](0x194);}return _0x5d6c17;};}function handleError(_0x28cd7d,_0x541f80){_0x541f80=_0x541f80||0x1f4;return function(_0x5d6162){logger[_0xdc71('0x28')](_0x5d6162['stack']);if(_0x5d6162[_0xdc71('0x3f')]){delete _0x5d6162[_0xdc71('0x3f')];}_0x28cd7d[_0xdc71('0x2e')](_0x541f80)[_0xdc71('0x40')](_0x5d6162);};}exports[_0xdc71('0x41')]=function(_0x2f1bc5,_0x3fcd74){var _0x256d70={'include':[{'model':db[_0xdc71('0x42')],'as':_0xdc71('0x43')}]},_0x2a5ccd={},_0x3264f3={'count':0x0,'rows':[]};var _0x5b7326=_[_0xdc71('0x44')](db[_0xdc71('0x45')][_0xdc71('0x46')],function(_0x2757f2){return{'name':_0x2757f2[_0xdc71('0x47')],'type':_0x2757f2[_0xdc71('0x48')]['key']};});_0x2a5ccd[_0xdc71('0x49')]=_['map'](_0x5b7326,_0xdc71('0x3f'));_0x2a5ccd['query']=_[_0xdc71('0x4a')](_0x2f1bc5['query']);_0x2a5ccd[_0xdc71('0x4b')]=_[_0xdc71('0x4c')](_0x2a5ccd[_0xdc71('0x49')],_0x2a5ccd[_0xdc71('0x4d')]);_0x256d70['attributes']=_[_0xdc71('0x4c')](_0x2a5ccd[_0xdc71('0x49')],qs[_0xdc71('0x4e')](_0x2f1bc5['query'][_0xdc71('0x4e')]));_0x256d70['attributes']=_0x256d70[_0xdc71('0x4f')][_0xdc71('0x50')]?_0x256d70[_0xdc71('0x4f')]:_0x2a5ccd[_0xdc71('0x49')];if(!_0x2f1bc5['query'][_0xdc71('0x51')](_0xdc71('0x52'))){_0x256d70['limit']=qs[_0xdc71('0x33')](_0x2f1bc5[_0xdc71('0x4d')][_0xdc71('0x33')]);_0x256d70[_0xdc71('0x32')]=qs[_0xdc71('0x32')](_0x2f1bc5['query'][_0xdc71('0x32')]);}_0x256d70[_0xdc71('0x53')]=qs[_0xdc71('0x54')](_0x2f1bc5[_0xdc71('0x4d')][_0xdc71('0x54')]);_0x256d70['where']=qs[_0xdc71('0x4b')](_['pick'](_0x2f1bc5[_0xdc71('0x4d')],_0x2a5ccd[_0xdc71('0x4b')]),_0x5b7326);if(_0x2f1bc5[_0xdc71('0x4d')][_0xdc71('0x55')]){_0x256d70[_0xdc71('0x56')]=_[_0xdc71('0x57')](_0x256d70[_0xdc71('0x56')],{'$or':_[_0xdc71('0x44')](_0x5b7326,function(_0x69f596){if(_0x69f596[_0xdc71('0x48')]!==_0xdc71('0x58')){var _0x5a2e5f={};_0x5a2e5f[_0x69f596[_0xdc71('0x3f')]]={'$like':'%'+_0x2f1bc5[_0xdc71('0x4d')][_0xdc71('0x55')]+'%'};return _0x5a2e5f;}})});}_0x256d70=_[_0xdc71('0x57')]({},_0x256d70,_0x2f1bc5['options']);var _0x4a776e={'where':_0x256d70[_0xdc71('0x56')]};return db[_0xdc71('0x45')][_0xdc71('0x31')](_0x4a776e)[_0xdc71('0x22')](function(_0x4523ab){_0x3264f3[_0xdc71('0x31')]=_0x4523ab;if(_0x2f1bc5['query']['includeAll']){_0x256d70['include']=[{'all':!![]}];}return db[_0xdc71('0x45')]['findAll'](_0x256d70);})[_0xdc71('0x22')](function(_0x57e540){_0x3264f3[_0xdc71('0x59')]=_0x57e540;return _0x3264f3;})[_0xdc71('0x22')](respondWithFilteredResult(_0x3fcd74,_0x256d70))[_0xdc71('0x2c')](handleError(_0x3fcd74,null));};exports[_0xdc71('0x5a')]=function(_0xf9fcb4,_0x5adc61){var _0x4fa592={'raw':![],'where':{'id':_0xf9fcb4[_0xdc71('0x5b')]['id']},'include':[{'model':db[_0xdc71('0x42')],'as':_0xdc71('0x43')}]},_0x1a1e1f={};_0x1a1e1f['model']=_[_0xdc71('0x4a')](db['WhatsappAccount'][_0xdc71('0x46')]);_0x1a1e1f[_0xdc71('0x4d')]=_['keys'](_0xf9fcb4['query']);_0x1a1e1f['filters']=_['intersection'](_0x1a1e1f[_0xdc71('0x49')],_0x1a1e1f['query']);_0x4fa592['attributes']=_[_0xdc71('0x4c')](_0x1a1e1f[_0xdc71('0x49')],qs[_0xdc71('0x4e')](_0xf9fcb4['query'][_0xdc71('0x4e')]));_0x4fa592[_0xdc71('0x4f')]=_0x4fa592[_0xdc71('0x4f')][_0xdc71('0x50')]?_0x4fa592[_0xdc71('0x4f')]:_0x1a1e1f[_0xdc71('0x49')];if(_0xf9fcb4[_0xdc71('0x4d')][_0xdc71('0x5c')]){_0x4fa592[_0xdc71('0x5d')]=[{'all':!![]}];}_0x4fa592=_[_0xdc71('0x57')]({},_0x4fa592,_0xf9fcb4[_0xdc71('0x5e')]);return db[_0xdc71('0x45')][_0xdc71('0x5f')](_0x4fa592)[_0xdc71('0x22')](handleEntityNotFound(_0x5adc61,null))[_0xdc71('0x22')](respondWithResult(_0x5adc61,null))[_0xdc71('0x2c')](handleError(_0x5adc61,null));};exports['create']=function(_0x143dde,_0xdb7541){return db['WhatsappAccount']['create'](_0x143dde[_0xdc71('0x60')],{})[_0xdc71('0x22')](function(_0x4b2e9a){var _0x2e1c0d=_0x143dde[_0xdc71('0x61')]['get']({'plain':!![]});if(!_0x2e1c0d)throw new Error(_0xdc71('0x62'));if(_0x2e1c0d[_0xdc71('0x63')]===_0xdc71('0x61')){var _0x39e522=_0x4b2e9a['get']({'plain':!![]});var _0x886d5f=_0xdc71('0x3c');return db[_0xdc71('0x64')][_0xdc71('0x5f')]({'where':{'name':_0x886d5f,'userProfileId':_0x2e1c0d[_0xdc71('0x65')]},'raw':!![]})['then'](function(_0x11ce7d){if(_0x11ce7d&&_0x11ce7d[_0xdc71('0x66')]===0x0){return db[_0xdc71('0x3d')][_0xdc71('0x67')]({'name':_0x39e522[_0xdc71('0x3f')],'resourceId':_0x39e522['id'],'type':_0x11ce7d['name'],'sectionId':_0x11ce7d['id']},{})[_0xdc71('0x22')](function(){return _0x4b2e9a;});}else{return _0x4b2e9a;}})['catch'](function(_0xa5208d){logger['error'](_0xdc71('0x68'),_0xa5208d);throw _0xa5208d;});}return _0x4b2e9a;})['then'](respondWithResult(_0xdb7541,0xc9))[_0xdc71('0x2c')](handleError(_0xdb7541,null));};exports[_0xdc71('0x39')]=function(_0x2a2136,_0x374325){if(_0x2a2136[_0xdc71('0x60')]['id']){delete _0x2a2136['body']['id'];}return db['WhatsappAccount'][_0xdc71('0x5f')]({'where':{'id':_0x2a2136[_0xdc71('0x5b')]['id']},'include':[{'model':db[_0xdc71('0x42')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x374325,null))['then'](saveUpdates(_0x2a2136['body'],null))[_0xdc71('0x22')](respondWithResult(_0x374325,null))[_0xdc71('0x2c')](handleError(_0x374325,null));};exports[_0xdc71('0x3a')]=function(_0x4340a1,_0x3952f9){return db['WhatsappAccount'][_0xdc71('0x5f')]({'where':{'id':_0x4340a1[_0xdc71('0x5b')]['id']}})[_0xdc71('0x22')](handleEntityNotFound(_0x3952f9,null))[_0xdc71('0x22')](removeEntity(_0x3952f9,null))['catch'](handleError(_0x3952f9,null));};exports[_0xdc71('0x69')]=function(_0x1c4384,_0x16f0c4){return db['WhatsappAccount'][_0xdc71('0x69')]()[_0xdc71('0x22')](respondWithResult(_0x16f0c4,null))[_0xdc71('0x2c')](handleError(_0x16f0c4,null));};exports[_0xdc71('0x6a')]=function(_0x5e704d,_0x12c2b2,_0x57188e){if(_0x5e704d[_0xdc71('0x60')]['id']){delete _0x5e704d[_0xdc71('0x60')]['id'];}return db[_0xdc71('0x45')][_0xdc71('0x5f')]({'where':{'id':_0x5e704d[_0xdc71('0x5b')]['id']}})[_0xdc71('0x22')](handleEntityNotFound(_0x12c2b2,null))[_0xdc71('0x22')](function(_0x53ec18){if(_0x53ec18){_0x5e704d[_0xdc71('0x60')]['WhatsappAccountId']=_0x53ec18['id'];return db[_0xdc71('0x6b')][_0xdc71('0x67')](_0x5e704d[_0xdc71('0x60')]);}})[_0xdc71('0x22')](respondWithResult(_0x12c2b2,null))[_0xdc71('0x2c')](handleError(_0x12c2b2,null));};exports[_0xdc71('0x6c')]=function(_0x1c4c21,_0x38e173,_0xe14cae){var _0x3c1702={'raw':![],'where':{}};var _0x4d18d2={};var _0x5c4bf2={'count':0x0,'rows':[]};return db[_0xdc71('0x45')]['findOne']({'where':{'id':_0x1c4c21['params']['id']}})['then'](handleEntityNotFound(_0x38e173,null))['then'](function(_0x11786c){if(_0x11786c){_0x4d18d2[_0xdc71('0x49')]=_[_0xdc71('0x4a')](db[_0xdc71('0x6b')][_0xdc71('0x46')]);_0x4d18d2[_0xdc71('0x4d')]=_[_0xdc71('0x4a')](_0x1c4c21['query']);_0x4d18d2[_0xdc71('0x4b')]=_[_0xdc71('0x4c')](_0x4d18d2[_0xdc71('0x49')],_0x4d18d2[_0xdc71('0x4d')]);_0x3c1702[_0xdc71('0x4f')]=_[_0xdc71('0x4c')](_0x4d18d2[_0xdc71('0x49')],qs['fields'](_0x1c4c21[_0xdc71('0x4d')]['fields']));_0x3c1702[_0xdc71('0x4f')]=_0x3c1702[_0xdc71('0x4f')]['length']?_0x3c1702[_0xdc71('0x4f')]:_0x4d18d2['model'];if(!_0x1c4c21[_0xdc71('0x4d')][_0xdc71('0x51')](_0xdc71('0x52'))){_0x3c1702[_0xdc71('0x33')]=qs[_0xdc71('0x33')](_0x1c4c21[_0xdc71('0x4d')][_0xdc71('0x33')]);_0x3c1702[_0xdc71('0x32')]=qs['offset'](_0x1c4c21[_0xdc71('0x4d')][_0xdc71('0x32')]);}_0x3c1702['order']=qs[_0xdc71('0x54')](_0x1c4c21['query'][_0xdc71('0x54')]);_0x3c1702[_0xdc71('0x56')]=qs[_0xdc71('0x4b')](_[_0xdc71('0x6d')](_0x1c4c21[_0xdc71('0x4d')],_0x4d18d2[_0xdc71('0x4b')]));_0x3c1702[_0xdc71('0x56')]['WhatsappAccountId']=_0x11786c['id'];if(_0x1c4c21[_0xdc71('0x4d')][_0xdc71('0x55')]){_0x3c1702[_0xdc71('0x56')]=_[_0xdc71('0x57')](_0x3c1702[_0xdc71('0x56')],{'$or':_[_0xdc71('0x44')](_0x3c1702[_0xdc71('0x4f')],function(_0x14fe4d){var _0x599362={};_0x599362[_0x14fe4d]={'$like':'%'+_0x1c4c21['query'][_0xdc71('0x55')]+'%'};return _0x599362;})});}_0x3c1702=_[_0xdc71('0x57')]({},_0x3c1702,_0x1c4c21[_0xdc71('0x5e')]);return db['Disposition'][_0xdc71('0x31')]({'where':_0x3c1702[_0xdc71('0x56')]})[_0xdc71('0x22')](function(_0x4dc4da){_0x5c4bf2['count']=_0x4dc4da;if(_0x1c4c21[_0xdc71('0x4d')]['includeAll']){_0x3c1702[_0xdc71('0x5d')]=[{'all':!![]}];}return db[_0xdc71('0x6b')][_0xdc71('0x6e')](_0x3c1702);})['then'](function(_0x1b251d){_0x5c4bf2[_0xdc71('0x59')]=_0x1b251d;return _0x5c4bf2;});}})[_0xdc71('0x22')](respondWithFilteredResult(_0x38e173,_0x3c1702))['catch'](handleError(_0x38e173,null));};exports[_0xdc71('0x6f')]=function(_0x3d8bf7,_0x10bf80,_0xa09e2f){return db[_0xdc71('0x45')][_0xdc71('0x5f')]({'where':{'id':_0x3d8bf7[_0xdc71('0x5b')]['id']}})[_0xdc71('0x22')](handleEntityNotFound(_0x10bf80,null))['then'](function(_0x2c330e){if(_0x2c330e){return _0x2c330e['removeDispositions'](_0x3d8bf7['query'][_0xdc71('0x70')]);}})[_0xdc71('0x22')](respondWithStatusCode(_0x10bf80,null))[_0xdc71('0x2c')](handleError(_0x10bf80,null));};exports[_0xdc71('0x71')]=function(_0x413bf5,_0x7ae1cd,_0x56332e){if(_0x413bf5[_0xdc71('0x60')]['id']){delete _0x413bf5[_0xdc71('0x60')]['id'];}return db[_0xdc71('0x45')][_0xdc71('0x5f')]({'where':{'id':_0x413bf5[_0xdc71('0x5b')]['id']}})['then'](handleEntityNotFound(_0x7ae1cd,null))[_0xdc71('0x22')](function(_0x173c32){if(_0x173c32){_0x413bf5['body'][_0xdc71('0x72')]=_0x173c32['id'];return db[_0xdc71('0x73')]['create'](_0x413bf5[_0xdc71('0x60')]);}})['then'](respondWithResult(_0x7ae1cd,null))[_0xdc71('0x2c')](handleError(_0x7ae1cd,null));};exports[_0xdc71('0x74')]=function(_0x4ef337,_0x364752,_0x355864){var _0x516495={'raw':![],'where':{}};var _0x509018={};var _0x5589fd={'count':0x0,'rows':[]};return db[_0xdc71('0x45')]['findOne']({'where':{'id':_0x4ef337[_0xdc71('0x5b')]['id']}})['then'](handleEntityNotFound(_0x364752,null))[_0xdc71('0x22')](function(_0x59576e){if(_0x59576e){_0x509018['model']=_[_0xdc71('0x4a')](db[_0xdc71('0x73')][_0xdc71('0x46')]);_0x509018[_0xdc71('0x4d')]=_[_0xdc71('0x4a')](_0x4ef337['query']);_0x509018['filters']=_['intersection'](_0x509018[_0xdc71('0x49')],_0x509018[_0xdc71('0x4d')]);_0x516495[_0xdc71('0x4f')]=_[_0xdc71('0x4c')](_0x509018[_0xdc71('0x49')],qs[_0xdc71('0x4e')](_0x4ef337[_0xdc71('0x4d')][_0xdc71('0x4e')]));_0x516495['attributes']=_0x516495['attributes']['length']?_0x516495[_0xdc71('0x4f')]:_0x509018[_0xdc71('0x49')];if(!_0x4ef337[_0xdc71('0x4d')][_0xdc71('0x51')](_0xdc71('0x52'))){_0x516495['limit']=qs[_0xdc71('0x33')](_0x4ef337['query']['limit']);_0x516495['offset']=qs[_0xdc71('0x32')](_0x4ef337[_0xdc71('0x4d')][_0xdc71('0x32')]);}_0x516495[_0xdc71('0x53')]=qs[_0xdc71('0x54')](_0x4ef337[_0xdc71('0x4d')][_0xdc71('0x54')]);_0x516495[_0xdc71('0x56')]=qs[_0xdc71('0x4b')](_[_0xdc71('0x6d')](_0x4ef337[_0xdc71('0x4d')],_0x509018['filters']));_0x516495[_0xdc71('0x56')][_0xdc71('0x72')]=_0x59576e['id'];if(_0x4ef337[_0xdc71('0x4d')][_0xdc71('0x55')]){_0x516495['where']=_['merge'](_0x516495[_0xdc71('0x56')],{'$or':_[_0xdc71('0x44')](_0x516495[_0xdc71('0x4f')],function(_0x1df34e){var _0x42215b={};_0x42215b[_0x1df34e]={'$like':'%'+_0x4ef337['query'][_0xdc71('0x55')]+'%'};return _0x42215b;})});}_0x516495=_[_0xdc71('0x57')]({},_0x516495,_0x4ef337[_0xdc71('0x5e')]);return db[_0xdc71('0x73')]['count']({'where':_0x516495[_0xdc71('0x56')]})[_0xdc71('0x22')](function(_0x2aac36){_0x5589fd[_0xdc71('0x31')]=_0x2aac36;if(_0x4ef337[_0xdc71('0x4d')]['includeAll']){_0x516495[_0xdc71('0x5d')]=[{'all':!![]}];}return db[_0xdc71('0x73')]['findAll'](_0x516495);})['then'](function(_0x14ff81){_0x5589fd[_0xdc71('0x59')]=_0x14ff81;return _0x5589fd;});}})[_0xdc71('0x22')](respondWithFilteredResult(_0x364752,_0x516495))[_0xdc71('0x2c')](handleError(_0x364752,null));};exports['removeAnswers']=function(_0x31a6c6,_0x2e2642,_0x4e9cb2){return db[_0xdc71('0x45')][_0xdc71('0x5f')]({'where':{'id':_0x31a6c6['params']['id']}})[_0xdc71('0x22')](handleEntityNotFound(_0x2e2642,null))[_0xdc71('0x22')](function(_0x204ac3){if(_0x204ac3){return _0x204ac3[_0xdc71('0x75')](_0x31a6c6[_0xdc71('0x4d')][_0xdc71('0x70')]);}})[_0xdc71('0x22')](respondWithStatusCode(_0x2e2642,null))[_0xdc71('0x2c')](handleError(_0x2e2642,null));};exports[_0xdc71('0x76')]=function(_0x5c6665,_0x211510,_0x465eb8){return db['WhatsappAccount']['find']({'where':{'id':_0x5c6665[_0xdc71('0x5b')]['id']}})[_0xdc71('0x22')](handleEntityNotFound(_0x211510,null))['then'](function(_0x42a34e){if(_0x42a34e){return _0x42a34e[_0xdc71('0x76')](_0x5c6665[_0xdc71('0x60')][_0xdc71('0x70')],_[_0xdc71('0x77')](_0x5c6665['body'],[_0xdc71('0x70'),'id'])||{})[_0xdc71('0x78')](function(_0xdbb584){for(var _0x40e495=0x0;_0x40e495<_0x5c6665[_0xdc71('0x60')][_0xdc71('0x70')]['length'];_0x40e495+=0x1){socket['emit']('userWhatsappAccount:save',{'UserId':Number(_0x5c6665[_0xdc71('0x60')][_0xdc71('0x70')][_0x40e495]),'WhatsappAccountId':Number(_0x5c6665[_0xdc71('0x5b')]['id'])});}return _0xdbb584;});}})[_0xdc71('0x22')](respondWithResult(_0x211510,null))['catch'](handleError(_0x211510,null));};exports[_0xdc71('0x79')]=function(_0x4b5271,_0x1d1a47,_0x44e771){return db[_0xdc71('0x45')][_0xdc71('0x5f')]({'where':{'id':_0x4b5271[_0xdc71('0x5b')]['id']}})[_0xdc71('0x22')](handleEntityNotFound(_0x1d1a47,null))[_0xdc71('0x22')](function(_0x5b6edb){if(_0x5b6edb){return _0x5b6edb['removeAgents'](_0x4b5271[_0xdc71('0x4d')]['ids'])[_0xdc71('0x22')](function(){if(_[_0xdc71('0x7a')](_0x4b5271[_0xdc71('0x4d')][_0xdc71('0x70')])){for(var _0x2dc0f8=0x0;_0x2dc0f8<_0x4b5271[_0xdc71('0x4d')][_0xdc71('0x70')]['length'];_0x2dc0f8+=0x1){socket[_0xdc71('0x7b')](_0xdc71('0x7c'),{'UserId':Number(_0x4b5271[_0xdc71('0x4d')]['ids'][_0x2dc0f8]),'WhatsappAccountId':Number(_0x4b5271[_0xdc71('0x5b')]['id'])});}}else{socket[_0xdc71('0x7b')](_0xdc71('0x7c'),{'UserId':Number(_0x4b5271[_0xdc71('0x4d')]['ids']),'WhatsappAccountId':Number(_0x4b5271[_0xdc71('0x5b')]['id'])});}});}})[_0xdc71('0x22')](respondWithStatusCode(_0x1d1a47,null))[_0xdc71('0x2c')](handleError(_0x1d1a47,null));};exports[_0xdc71('0x7d')]=function(_0x5a43fa,_0x507a65,_0xa318a2){var _0x42d940={};var _0x25d1c8={};var _0x127b1e;var _0x517925;return db[_0xdc71('0x45')][_0xdc71('0x7e')]({'where':{'id':_0x5a43fa[_0xdc71('0x5b')]['id']}})[_0xdc71('0x22')](handleEntityNotFound(_0x507a65,null))[_0xdc71('0x22')](function(_0x2a6f7b){if(_0x2a6f7b){_0x127b1e=_0x2a6f7b;_0x25d1c8[_0xdc71('0x49')]=_[_0xdc71('0x4a')](db[_0xdc71('0x7f')][_0xdc71('0x46')]);_0x25d1c8[_0xdc71('0x4d')]=_['keys'](_0x5a43fa['query']);_0x25d1c8[_0xdc71('0x4b')]=_[_0xdc71('0x4c')](_0x25d1c8[_0xdc71('0x49')],_0x25d1c8['query']);_0x42d940[_0xdc71('0x4f')]=_[_0xdc71('0x4c')](_0x25d1c8[_0xdc71('0x49')],qs[_0xdc71('0x4e')](_0x5a43fa['query'][_0xdc71('0x4e')]));_0x42d940[_0xdc71('0x4f')]=_0x42d940[_0xdc71('0x4f')][_0xdc71('0x50')]?_0x42d940[_0xdc71('0x4f')]:_0x25d1c8[_0xdc71('0x49')];_0x42d940[_0xdc71('0x53')]=qs[_0xdc71('0x54')](_0x5a43fa[_0xdc71('0x4d')]['sort']);_0x42d940[_0xdc71('0x56')]=qs[_0xdc71('0x4b')](_[_0xdc71('0x6d')](_0x5a43fa[_0xdc71('0x4d')],_0x25d1c8[_0xdc71('0x4b')]));if(_0x5a43fa[_0xdc71('0x4d')][_0xdc71('0x55')]){_0x42d940[_0xdc71('0x56')]=_[_0xdc71('0x57')](_0x42d940[_0xdc71('0x56')],{'$or':_[_0xdc71('0x44')](_0x42d940[_0xdc71('0x4f')],function(_0xf61bd3){var _0x2de9c4={};_0x2de9c4[_0xf61bd3]={'$like':'%'+_0x5a43fa[_0xdc71('0x4d')][_0xdc71('0x55')]+'%'};return _0x2de9c4;})});}_0x42d940=_['merge']({},_0x42d940,_0x5a43fa['options']);return _0x127b1e[_0xdc71('0x7d')](_0x42d940);}})['then'](function(_0x268030){if(_0x268030){_0x517925=_0x268030[_0xdc71('0x50')];if(!_0x5a43fa[_0xdc71('0x4d')]['hasOwnProperty'](_0xdc71('0x52'))){_0x42d940[_0xdc71('0x33')]=qs[_0xdc71('0x33')](_0x5a43fa[_0xdc71('0x4d')][_0xdc71('0x33')]);_0x42d940[_0xdc71('0x32')]=qs[_0xdc71('0x32')](_0x5a43fa[_0xdc71('0x4d')][_0xdc71('0x32')]);}return _0x127b1e[_0xdc71('0x7d')](_0x42d940);}})['then'](function(_0x3ef3da){if(_0x3ef3da){return _0x3ef3da?{'count':_0x517925,'rows':_0x3ef3da}:null;}})[_0xdc71('0x22')](respondWithResult(_0x507a65,null))[_0xdc71('0x2c')](handleError(_0x507a65,null));};exports['addApplications']=function(_0x573c07,_0x52b719,_0x5badbc){return db[_0xdc71('0x45')][_0xdc71('0x7e')]({'where':{'id':_0x573c07[_0xdc71('0x5b')]['id']}})[_0xdc71('0x22')](handleEntityNotFound(_0x52b719,null))['then'](function(_0x414538){if(_0x414538){return db[_0xdc71('0x80')][_0xdc71('0x81')](function(_0x2a33cb){return db[_0xdc71('0x82')][_0xdc71('0x3a')]({'where':{'WhatsappAccountId':_0x573c07[_0xdc71('0x5b')]['id']},'transaction':_0x2a33cb})['then'](function(_0x215fe3){var _0x18d0f9=_[_0xdc71('0x44')](_0x573c07['body'],function(_0x1744f9){_0x1744f9[_0xdc71('0x72')]=_0x573c07['params']['id'];return _0x1744f9;});return db[_0xdc71('0x82')][_0xdc71('0x83')](_0x18d0f9,{'transaction':_0x2a33cb});});})[_0xdc71('0x22')](function(){return db[_0xdc71('0x82')][_0xdc71('0x84')]({'where':{'WhatsappAccountId':_0x573c07['params']['id']},'order':_0xdc71('0x85')});});}})[_0xdc71('0x22')](respondWithResult(_0x52b719,null))['catch'](handleError(_0x52b719,null));};exports[_0xdc71('0x86')]=function(_0x2b3bfb,_0x25827d,_0x253374){var _0x368b2c={};var _0x5f42f2={};var _0xfda3ef;var _0xe3e4ca;return db[_0xdc71('0x45')]['findOne']({'where':{'id':_0x2b3bfb[_0xdc71('0x5b')]['id']}})[_0xdc71('0x22')](handleEntityNotFound(_0x25827d,null))[_0xdc71('0x22')](function(_0x5d5d1b){if(_0x5d5d1b){_0xfda3ef=_0x5d5d1b;_0x5f42f2[_0xdc71('0x49')]=_['keys'](db[_0xdc71('0x82')][_0xdc71('0x46')]);_0x5f42f2[_0xdc71('0x4d')]=_[_0xdc71('0x4a')](_0x2b3bfb[_0xdc71('0x4d')]);_0x5f42f2[_0xdc71('0x4b')]=_[_0xdc71('0x4c')](_0x5f42f2['model'],_0x5f42f2[_0xdc71('0x4d')]);_0x368b2c[_0xdc71('0x4f')]=_[_0xdc71('0x4c')](_0x5f42f2[_0xdc71('0x49')],qs['fields'](_0x2b3bfb[_0xdc71('0x4d')][_0xdc71('0x4e')]));_0x368b2c[_0xdc71('0x4f')]=_0x368b2c[_0xdc71('0x4f')][_0xdc71('0x50')]?_0x368b2c[_0xdc71('0x4f')]:_0x5f42f2[_0xdc71('0x49')];_0x368b2c['order']=qs[_0xdc71('0x54')](_0x2b3bfb[_0xdc71('0x4d')][_0xdc71('0x54')]);_0x368b2c[_0xdc71('0x56')]=qs[_0xdc71('0x4b')](_[_0xdc71('0x6d')](_0x2b3bfb[_0xdc71('0x4d')],_0x5f42f2[_0xdc71('0x4b')]));if(_0x2b3bfb[_0xdc71('0x4d')]['filter']){_0x368b2c[_0xdc71('0x56')]=_[_0xdc71('0x57')](_0x368b2c[_0xdc71('0x56')],{'$or':_['map'](_0x368b2c[_0xdc71('0x4f')],function(_0x4a5c53){var _0x56d7b5={};_0x56d7b5[_0x4a5c53]={'$like':'%'+_0x2b3bfb[_0xdc71('0x4d')]['filter']+'%'};return _0x56d7b5;})});}_0x368b2c=_[_0xdc71('0x57')]({},_0x368b2c,_0x2b3bfb[_0xdc71('0x5e')]);return _0xfda3ef['getApplications'](_0x368b2c);}})[_0xdc71('0x22')](function(_0xd362ee){if(_0xd362ee){_0xe3e4ca=_0xd362ee[_0xdc71('0x50')];if(!_0x2b3bfb[_0xdc71('0x4d')][_0xdc71('0x51')](_0xdc71('0x52'))){_0x368b2c[_0xdc71('0x33')]=qs['limit'](_0x2b3bfb[_0xdc71('0x4d')][_0xdc71('0x33')]);_0x368b2c['offset']=qs['offset'](_0x2b3bfb['query'][_0xdc71('0x32')]);}return _0xfda3ef[_0xdc71('0x86')](_0x368b2c);}})[_0xdc71('0x22')](function(_0x3c775e){if(_0x3c775e){return _0x3c775e?{'count':_0xe3e4ca,'rows':_0x3c775e}:null;}})['then'](respondWithResult(_0x25827d,null))[_0xdc71('0x2c')](handleError(_0x25827d,null));};exports['notify']=function(_0x323fe0,_0x132a9b,_0x47ffe2){var _0x25a58e={'channel':_0xdc71('0x87')};var _0x1f141b=[];var _0x3665ee=[];var _0x4860eb={};return db[_0xdc71('0x45')][_0xdc71('0x5f')]({'where':{'id':_0x323fe0['params']['id']},'include':[{'model':db[_0xdc71('0x82')],'as':_0xdc71('0x88')}]})['then'](handleEntityNotFound(_0x132a9b,null))[_0xdc71('0x22')](function(_0x2134d0){_0x25a58e[_0xdc71('0x89')]=_0x2134d0;_0x25a58e[_0xdc71('0x8a')]=_['orderBy'](_0x2134d0[_0xdc71('0x88')],[_0xdc71('0x85')],[_0xdc71('0x8b')]);if(_0x25a58e[_0xdc71('0x89')]['Applications']){delete _0x25a58e[_0xdc71('0x89')][_0xdc71('0x88')];}return db[_0xdc71('0x8c')][_0xdc71('0x69')]();})[_0xdc71('0x22')](function(_0x48a855){if(!_0x48a855){throw new db[(_0xdc71('0x8d'))][(_0xdc71('0x8e'))](_0xdc71('0x8f'));}_0x1f141b=_['difference'](_[_0xdc71('0x4a')](_0x48a855),[_0xdc71('0x90'),_0xdc71('0x91')]);_0x3665ee=_[_0xdc71('0x92')](_[_0xdc71('0x4a')](_0x48a855),[_0xdc71('0x90'),_0xdc71('0x91'),_0xdc71('0x93'),_0xdc71('0x94')]);_0x25a58e[_0xdc71('0x60')]={'mapKey':_0xdc71('0x95')};if(_0x25a58e['account'][_0xdc71('0x48')]&&_0x25a58e[_0xdc71('0x89')][_0xdc71('0x48')]==='twilio'){_0x25a58e['body']['from']=_0x323fe0[_0xdc71('0x60')][_0xdc71('0x96')][_0xdc71('0x97')](_0xdc71('0x98'),'');_0x25a58e['body'][_0xdc71('0x60')]=_0x323fe0[_0xdc71('0x60')]['Body'];_0x25a58e['body'][_0xdc71('0x99')]=_0x323fe0[_0xdc71('0x60')][_0xdc71('0x9a')];}if(_0x25a58e[_0xdc71('0x60')]['id']){delete _0x25a58e[_0xdc71('0x60')]['id'];}if(_['isNil'](_0x25a58e['body'][_0xdc71('0x9b')])){throw new db[(_0xdc71('0x8d'))][(_0xdc71('0x8e'))](_0xdc71('0x9c'));}if(_['isNil'](_0x25a58e['body'][_0xdc71('0x60')])||_0x25a58e['body']['body']===''){throw new db[(_0xdc71('0x8d'))][(_0xdc71('0x8e'))](_0xdc71('0x9d'));}if(_['isNil'](_0x25a58e[_0xdc71('0x60')]['mapKey'])){throw new db['Sequelize'][(_0xdc71('0x8e'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3665ee);}if(!_['includes'](_0x3665ee,_0x25a58e[_0xdc71('0x60')][_0xdc71('0x9e')])){throw new db[(_0xdc71('0x8d'))][(_0xdc71('0x8e'))](_0xdc71('0x9f')+_0x3665ee);}_0x4860eb[_0x25a58e[_0xdc71('0x60')][_0xdc71('0x9e')]]=_0x25a58e[_0xdc71('0x60')][_0xdc71('0x9b')];return db[_0xdc71('0xa0')]['find']({'where':{'id':_0x25a58e[_0xdc71('0x89')]['ListId']},'include':[{'model':db['CmContact'],'as':_0xdc71('0xa1'),'where':_0x4860eb,'limit':0x1,'order':[[_0xdc71('0x91'),'DESC']]}]});})[_0xdc71('0x22')](handleEntityNotFound(_0x132a9b,null))['then'](function(_0x1212e2){if(_0x1212e2){_0x25a58e[_0xdc71('0xa2')]=_[_0xdc71('0x77')](_0x1212e2,[_0xdc71('0xa1')]);if(_0x1212e2[_0xdc71('0xa1')][_0xdc71('0x50')]){return _0x1212e2['Contacts'][0x0];}var _0x56ac42=_[_0xdc71('0x1a')](_0x25a58e['body'],{'firstName':_0x25a58e[_0xdc71('0x60')]['from'],'ListId':_0x1212e2['id']});_0x56ac42[_0x25a58e[_0xdc71('0x60')][_0xdc71('0x9e')]]=_0x25a58e[_0xdc71('0x60')][_0xdc71('0x9b')];return db[_0xdc71('0x8c')]['create'](_0x56ac42,{'fields':_0x1f141b,'raw':!![]});}})[_0xdc71('0x22')](handleEntityNotFound(_0x132a9b,null))[_0xdc71('0x22')](function(_0x162bc1){if(_0x162bc1){_0x25a58e[_0xdc71('0xa3')]=_0x162bc1;var _0x4fe838={'ContactId':_0x162bc1['id'],'phone':_0x25a58e[_0xdc71('0x60')][_0xdc71('0x9b')],'WhatsappAccountId':_0x323fe0[_0xdc71('0x5b')]['id']};var _0x4dbb59={'ContactId':_0x162bc1['id'],'WhatsappAccountId':_0x323fe0[_0xdc71('0x5b')]['id'],'closed':![]};return db[_0xdc71('0xa4')][_0xdc71('0x5f')]({'where':_0x4dbb59})[_0xdc71('0x22')](function(_0x23f786){if(_0x23f786){return[_0x23f786,![]];}return db[_0xdc71('0xa4')][_0xdc71('0x67')](_0x4fe838)[_0xdc71('0x22')](function(_0x8f4a3){return[_0x8f4a3,!![]];});});}})[_0xdc71('0x78')](function(_0x2d5354,_0xa6cb3d){_0x25a58e[_0xdc71('0xa5')]=_0x2d5354[_0xdc71('0x3b')]({'plain':!![]});_0x25a58e[_0xdc71('0xa5')][_0xdc71('0xa6')]=![];if(_0xa6cb3d){if(_0x25a58e[_0xdc71('0x89')][_0xdc71('0xa7')]){_0x25a58e[_0xdc71('0x8a')]['push']({'id':0x0,'priority':_0x25a58e[_0xdc71('0x8a')][_0xdc71('0x50')]+0x1,'app':_0xdc71('0xa8'),'appdata':_0xdc71('0xa9'),'interval':_0xdc71('0xaa')});}_0x25a58e['interaction']['created']=!![];}return db['WhatsappMessage'][_0xdc71('0x67')]({'phone':_0x25a58e[_0xdc71('0x60')][_0xdc71('0x9b')],'messageId':_0x25a58e['body'][_0xdc71('0x99')],'body':_0x25a58e[_0xdc71('0x60')][_0xdc71('0x60')],'WhatsappAccountId':_0x323fe0[_0xdc71('0x5b')]['id'],'WhatsappInteractionId':_0x2d5354['id'],'direction':'in','ContactId':_0x2d5354[_0xdc71('0xab')],'AttachmentId':_0x25a58e[_0xdc71('0x60')]['AttachmentId']});})['then'](function(_0x4ccb7a){_0x25a58e[_0xdc71('0x2b')]=_0x4ccb7a;if(_0x25a58e['interaction']['UserId']){return db[_0xdc71('0x7f')]['find']({'attributes':['id','name'],'where':{'id':_0x25a58e[_0xdc71('0xa5')][_0xdc71('0xac')]}})[_0xdc71('0x22')](function(_0x1fa9be){if(_0x1fa9be){_0x25a58e[_0xdc71('0x8a')][_0xdc71('0xad')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x1fa9be['name']+','+(_0x25a58e[_0xdc71('0x89')][_0xdc71('0xae')]||0xa),'interval':_0xdc71('0xaa')});}return respondWithRpcPromise('Start',_0xdc71('0xaf'),_0x25a58e);});}return respondWithRpcPromise(_0xdc71('0xb0'),_0xdc71('0xaf'),_0x25a58e);})[_0xdc71('0x22')](function(_0x3de5fe){if(_0x3de5fe){var _0x26524f=0xc8;var _0x513410=_0xdc71('0xb1');logger[_0xdc71('0x23')](_0xdc71('0x26'),_0x513410,_0x26524f,_0xdc71('0xb2'));logger[_0xdc71('0x25')](_0xdc71('0xb3'),_0x513410,_0x26524f,_0xdc71('0xb2'),JSON[_0xdc71('0x27')](_0x3de5fe));if(_0x25a58e[_0xdc71('0x89')][_0xdc71('0x48')]===_0xdc71('0xb4')){return _0x132a9b[_0xdc71('0x2e')](_0x26524f)[_0xdc71('0x34')](_0xdc71('0xb5'),_0xdc71('0xb6'))['send']('\x0a');}else{return _0x132a9b[_0xdc71('0x2e')](_0x26524f)[_0xdc71('0x2f')](_0x3de5fe);}}})[_0xdc71('0x2c')](handleError(_0x132a9b,null));};exports[_0xdc71('0x40')]=function(_0x3c1bac,_0x54e162,_0x334dd7){var _0x14279a,_0x25f36e,_0x4d406a;if(_[_0xdc71('0xb7')](_0x3c1bac['body'][_0xdc71('0x60')])||_0x3c1bac[_0xdc71('0x60')]['body']===''){throw new db[(_0xdc71('0x8d'))]['ValidationError'](_0xdc71('0x9d'));}if(_[_0xdc71('0xb7')](_0x3c1bac[_0xdc71('0x60')]['to'])){throw new db[(_0xdc71('0x8d'))][(_0xdc71('0x8e'))](_0xdc71('0xb8'));}_0x14279a=_0x3c1bac[_0xdc71('0x60')]['to'];return db['WhatsappAccount'][_0xdc71('0x5f')]({'where':{'id':_0x3c1bac[_0xdc71('0x5b')]['id']},'include':[{'model':db[_0xdc71('0xa0')],'as':_0xdc71('0xb9'),'include':[{'model':db[_0xdc71('0x8c')],'as':_0xdc71('0xa1'),'where':{'mobile':_0x14279a},'limit':0x1,'order':[[_0xdc71('0x91'),_0xdc71('0xba')]]}]}]})[_0xdc71('0x22')](handleEntityNotFound(_0x54e162,null))['then'](function(_0x25d702){if(_0x25d702&&_0x25d702['List']){_0x25f36e=_0x25d702[_0xdc71('0x3b')]({'plain':!![]});if(_0x25f36e[_0xdc71('0xb9')]&&_0x25f36e['List'][_0xdc71('0xa1')][_0xdc71('0x50')]){return _0x25f36e[_0xdc71('0xb9')][_0xdc71('0xa1')][0x0];}return db[_0xdc71('0x8c')][_0xdc71('0x67')](_[_0xdc71('0x1a')](_0x3c1bac['body'],{'firstName':_0x14279a,'mobile':_0x14279a,'phone':_0x14279a,'ListId':_0x25f36e[_0xdc71('0x94')]}));}})['then'](handleEntityNotFound(_0x54e162,null))[_0xdc71('0x22')](function(_0x8e99a7){if(_0x8e99a7){_0x4d406a=_0x8e99a7;return db['WhatsappInteraction'][_0xdc71('0x5f')]({'where':{'ContactId':_0x4d406a['id'],'closed':![],'WhatsappAccountId':_0x25f36e['id']}})[_0xdc71('0x22')](function(_0x51d4ba){if(_0x51d4ba){return[_0x51d4ba,![]];}return db['WhatsappInteraction'][_0xdc71('0x67')]({'UserId':_0x3c1bac[_0xdc71('0x61')]['id'],'ContactId':_0x4d406a['id'],'WhatsappAccountId':_0x25f36e['id'],'phone':_0x14279a,'firstMsgDirection':_0xdc71('0xbb'),'Messages':[_['merge'](_0x3c1bac[_0xdc71('0x60')],{'read':![],'body':_0x3c1bac['body'][_0xdc71('0x60')],'phone':_0x14279a,'WhatsappAccountId':_0x25f36e['id'],'UserId':_0x3c1bac[_0xdc71('0x61')]['id'],'ContactId':_0x4d406a['id']})]},{'include':[{'model':db[_0xdc71('0xbc')],'as':_0xdc71('0xbd')}]})['then'](function(_0x14e8e3){return[_0x14e8e3,!![]];});});}})[_0xdc71('0x78')](function(_0x1686a5,_0xa002ed){if(_0xa002ed){return _0x1686a5;}return db['WhatsappMessage'][_0xdc71('0x67')](_[_0xdc71('0x57')](_0x3c1bac[_0xdc71('0x60')],{'read':![],'body':_0x3c1bac[_0xdc71('0x60')][_0xdc71('0x60')],'phone':_0x14279a,'WhatsappAccountId':_0x25f36e['id'],'WhatsappInteractionId':_0x1686a5['id'],'UserId':_0x3c1bac[_0xdc71('0x61')]['id'],'ContactId':_0x4d406a['id']}))[_0xdc71('0x22')](function(_0x35d4d2){_0x1686a5['dataValues'][_0xdc71('0xbd')]=[];_0x1686a5[_0xdc71('0xbe')][_0xdc71('0xbd')]['push'](_0x35d4d2['dataValues']);return _0x1686a5;});})['then'](respondWithResult(_0x54e162,null))[_0xdc71('0x2c')](handleError(_0x54e162,null));}; \ No newline at end of file +var _0x481f=['crypto','jsforce','desk.js','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','./whatsappAccount.socket','register','client','request','then','WhatsappAccount,\x20%s,\x20%s','request\x20sent','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','get','destroy','stack','name','send','index','Pause','fieldName','key','keys','query','filters','intersection','model','attributes','fields','nolimit','order','sort','where','pick','merge','map','type','VIRTUAL','options','WhatsappAccount','includeAll','include','findAll','show','params','mandatoryDispositionPause','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','WhatsappAccounts','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','WhatsappAccountId','Disposition','findOne','rawAttributes','hasOwnProperty','filter','rows','removeDispositions','addAnswer','CannedAnswer','getAnswers','addAgents','ids','omit','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','getAgents','User','sequelize','WhatsappApplication','findAndCountAll','priority','getApplications','notify','Applications','account','applications','orderBy','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','From','replace','whatsapp:','Body','messageId','isNil','from','from\x20is\x20mandatory','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','DESC','list','Contacts','contact','WhatsappInteraction','spread','interaction','created','autoclose','push','close','*,*,*,*','WhatsappMessage','ContactId','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','\x0a','body\x20is\x20mandatory\x20and\x20not\x20empty','to\x20is\x20mandatory','CmList','List','out','Messages','dataValues','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel'];(function(_0xb5caa9,_0x56cab2){var _0x580ecf=function(_0x5c5654){while(--_0x5c5654){_0xb5caa9['push'](_0xb5caa9['shift']());}};_0x580ecf(++_0x56cab2);}(_0x481f,0x177));var _0xf481=function(_0x34e8f5,_0x889315){_0x34e8f5=_0x34e8f5-0x0;var _0x9d2ac0=_0x481f[_0x34e8f5];return _0x9d2ac0;};'use strict';var emlformat=require(_0xf481('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf481('0x1'));var jsonpatch=require(_0xf481('0x2'));var rp=require(_0xf481('0x3'));var moment=require(_0xf481('0x4'));var BPromise=require(_0xf481('0x5'));var Mustache=require('mustache');var util=require(_0xf481('0x6'));var path=require(_0xf481('0x7'));var sox=require('sox');var csv=require(_0xf481('0x8'));var ejs=require(_0xf481('0x9'));var fs=require('fs');var fs_extra=require(_0xf481('0xa'));var _=require(_0xf481('0xb'));var squel=require(_0xf481('0xc'));var crypto=require(_0xf481('0xd'));var jsforce=require(_0xf481('0xe'));var deskjs=require(_0xf481('0xf'));var toCsv=require(_0xf481('0x8'));var querystring=require('querystring');var Papa=require(_0xf481('0x10'));var Redis=require(_0xf481('0x11'));var authService=require(_0xf481('0x12'));var qs=require(_0xf481('0x13'));var as=require(_0xf481('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf481('0x15'))(_0xf481('0x16'));var utils=require(_0xf481('0x17'));var config=require(_0xf481('0x18'));var licenseUtil=require(_0xf481('0x19'));var db=require(_0xf481('0x1a'))['db'];config[_0xf481('0x1b')]=_[_0xf481('0x1c')](config['redis'],{'host':_0xf481('0x1d'),'port':0x18eb});var socket=require(_0xf481('0x1e'))(new Redis(config[_0xf481('0x1b')]));require(_0xf481('0x1f'))[_0xf481('0x20')](socket);var jayson=require('jayson/promise');var client=jayson[_0xf481('0x21')]['http']({'port':0x232c});function respondWithRpcPromise(_0x3b639a,_0x30f44e,_0x203f82,_0x109c92){return new BPromise(function(_0x20dcba,_0x3c6afe){var _0x55f8b5=_0x109c92||client;return _0x55f8b5[_0xf481('0x22')](_0x3b639a,_0x203f82)[_0xf481('0x23')](function(_0x304adc){logger['info'](_0xf481('0x24'),_0x30f44e,_0xf481('0x25'));logger['debug'](_0xf481('0x26'),_0x30f44e,_0xf481('0x25'),JSON[_0xf481('0x27')](_0x304adc));if(_0x304adc[_0xf481('0x28')]){if(_0x304adc[_0xf481('0x28')]['code']===0x1f4){logger[_0xf481('0x28')](_0xf481('0x24'),_0x30f44e,_0x304adc[_0xf481('0x28')][_0xf481('0x29')]);return _0x3c6afe(_0x304adc['error'][_0xf481('0x29')]);}logger[_0xf481('0x28')](_0xf481('0x24'),_0x30f44e,_0x304adc[_0xf481('0x28')][_0xf481('0x29')]);return _0x20dcba(_0x304adc[_0xf481('0x28')]['message']);}else{logger[_0xf481('0x2a')](_0xf481('0x24'),_0x30f44e,_0xf481('0x25'));_0x20dcba(_0x304adc[_0xf481('0x2b')][_0xf481('0x29')]);}})[_0xf481('0x2c')](function(_0x4242f1){logger[_0xf481('0x28')](_0xf481('0x24'),_0x30f44e,_0x4242f1);_0x3c6afe(_0x4242f1);});});}function respondWithStatusCode(_0x5b2b87,_0x183249){_0x183249=_0x183249||0xcc;return function(_0x2d1edc){if(_0x2d1edc){return _0x5b2b87[_0xf481('0x2d')](_0x183249);}return _0x5b2b87[_0xf481('0x2e')](_0x183249)[_0xf481('0x2f')]();};}function respondWithResult(_0x310eca,_0xa8241a){_0xa8241a=_0xa8241a||0xc8;return function(_0x3462a0){if(_0x3462a0){return _0x310eca[_0xf481('0x2e')](_0xa8241a)[_0xf481('0x30')](_0x3462a0);}};}function respondWithFilteredResult(_0x104bfd,_0x449e7d){return function(_0x38ef11){if(_0x38ef11){var _0x5d2433=typeof _0x449e7d[_0xf481('0x31')]===_0xf481('0x32')&&typeof _0x449e7d[_0xf481('0x33')]==='undefined';var _0x3f2f70=_0x38ef11['count'];var _0x55af68=_0x5d2433?0x0:_0x449e7d[_0xf481('0x31')];var _0x240f76=_0x5d2433?_0x38ef11[_0xf481('0x34')]:_0x449e7d[_0xf481('0x31')]+_0x449e7d[_0xf481('0x33')];var _0xfa22f3;if(_0x240f76>=_0x3f2f70){_0x240f76=_0x3f2f70;_0xfa22f3=0xc8;}else{_0xfa22f3=0xce;}_0x104bfd[_0xf481('0x2e')](_0xfa22f3);return _0x104bfd[_0xf481('0x35')](_0xf481('0x36'),_0x55af68+'-'+_0x240f76+'/'+_0x3f2f70)[_0xf481('0x30')](_0x38ef11);}return null;};}function patchUpdates(_0x125765){return function(_0x3ac447){try{jsonpatch['apply'](_0x3ac447,_0x125765,!![]);}catch(_0x31e0dc){return BPromise['reject'](_0x31e0dc);}return _0x3ac447[_0xf481('0x37')]();};}function saveUpdates(_0x3dfe12,_0x2f5863){return function(_0x32287a){if(_0x32287a){return _0x32287a['update'](_0x3dfe12)[_0xf481('0x23')](function(_0x5d4f0b){return _0x5d4f0b;});}return null;};}function removeEntity(_0xf24487,_0x574a29){return function(_0x44b542){if(_0x44b542){return _0x44b542['destroy']()[_0xf481('0x23')](function(){var _0x36da60=_0x44b542[_0xf481('0x38')]({'plain':!![]});var _0x2e5981='WhatsappAccounts';return db['UserProfileResource'][_0xf481('0x39')]({'where':{'type':_0x2e5981,'resourceId':_0x36da60['id']}})[_0xf481('0x23')](function(){return _0x44b542;});})[_0xf481('0x23')](function(){_0xf24487['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x36b161,_0x1e26e2){return function(_0x2349f7){if(!_0x2349f7){_0x36b161[_0xf481('0x2d')](0x194);}return _0x2349f7;};}function handleError(_0x3a376f,_0xa3c559){_0xa3c559=_0xa3c559||0x1f4;return function(_0x5a98d4){logger[_0xf481('0x28')](_0x5a98d4[_0xf481('0x3a')]);if(_0x5a98d4['name']){delete _0x5a98d4[_0xf481('0x3b')];}_0x3a376f[_0xf481('0x2e')](_0xa3c559)[_0xf481('0x3c')](_0x5a98d4);};}exports[_0xf481('0x3d')]=function(_0x1c53cc,_0x2d1308){var _0x1e641f={'include':[{'model':db[_0xf481('0x3e')],'as':'mandatoryDispositionPause'}]},_0x8eb28f={},_0x341639={'count':0x0,'rows':[]};var _0x4180fc=_['map'](db['WhatsappAccount']['rawAttributes'],function(_0xbca960){return{'name':_0xbca960[_0xf481('0x3f')],'type':_0xbca960['type'][_0xf481('0x40')]};});_0x8eb28f['model']=_['map'](_0x4180fc,'name');_0x8eb28f['query']=_[_0xf481('0x41')](_0x1c53cc[_0xf481('0x42')]);_0x8eb28f[_0xf481('0x43')]=_[_0xf481('0x44')](_0x8eb28f[_0xf481('0x45')],_0x8eb28f[_0xf481('0x42')]);_0x1e641f[_0xf481('0x46')]=_['intersection'](_0x8eb28f['model'],qs[_0xf481('0x47')](_0x1c53cc[_0xf481('0x42')][_0xf481('0x47')]));_0x1e641f[_0xf481('0x46')]=_0x1e641f[_0xf481('0x46')]['length']?_0x1e641f[_0xf481('0x46')]:_0x8eb28f[_0xf481('0x45')];if(!_0x1c53cc[_0xf481('0x42')]['hasOwnProperty'](_0xf481('0x48'))){_0x1e641f[_0xf481('0x33')]=qs[_0xf481('0x33')](_0x1c53cc['query'][_0xf481('0x33')]);_0x1e641f['offset']=qs[_0xf481('0x31')](_0x1c53cc['query'][_0xf481('0x31')]);}_0x1e641f[_0xf481('0x49')]=qs['sort'](_0x1c53cc[_0xf481('0x42')][_0xf481('0x4a')]);_0x1e641f[_0xf481('0x4b')]=qs[_0xf481('0x43')](_[_0xf481('0x4c')](_0x1c53cc['query'],_0x8eb28f['filters']),_0x4180fc);if(_0x1c53cc['query']['filter']){_0x1e641f[_0xf481('0x4b')]=_[_0xf481('0x4d')](_0x1e641f['where'],{'$or':_[_0xf481('0x4e')](_0x4180fc,function(_0x8ad104){if(_0x8ad104[_0xf481('0x4f')]!==_0xf481('0x50')){var _0x358b93={};_0x358b93[_0x8ad104[_0xf481('0x3b')]]={'$like':'%'+_0x1c53cc[_0xf481('0x42')]['filter']+'%'};return _0x358b93;}})});}_0x1e641f=_[_0xf481('0x4d')]({},_0x1e641f,_0x1c53cc[_0xf481('0x51')]);var _0x49a8a3={'where':_0x1e641f[_0xf481('0x4b')]};return db[_0xf481('0x52')][_0xf481('0x34')](_0x49a8a3)[_0xf481('0x23')](function(_0x3756f6){_0x341639[_0xf481('0x34')]=_0x3756f6;if(_0x1c53cc[_0xf481('0x42')][_0xf481('0x53')]){_0x1e641f[_0xf481('0x54')]=[{'all':!![]}];}return db[_0xf481('0x52')][_0xf481('0x55')](_0x1e641f);})['then'](function(_0x383e2d){_0x341639['rows']=_0x383e2d;return _0x341639;})[_0xf481('0x23')](respondWithFilteredResult(_0x2d1308,_0x1e641f))[_0xf481('0x2c')](handleError(_0x2d1308,null));};exports[_0xf481('0x56')]=function(_0x35aa8c,_0x439fbd){var _0x3b5817={'raw':![],'where':{'id':_0x35aa8c[_0xf481('0x57')]['id']},'include':[{'model':db['Pause'],'as':_0xf481('0x58')}]},_0x222262={};_0x222262[_0xf481('0x45')]=_['keys'](db[_0xf481('0x52')]['rawAttributes']);_0x222262[_0xf481('0x42')]=_[_0xf481('0x41')](_0x35aa8c[_0xf481('0x42')]);_0x222262['filters']=_[_0xf481('0x44')](_0x222262['model'],_0x222262[_0xf481('0x42')]);_0x3b5817['attributes']=_[_0xf481('0x44')](_0x222262[_0xf481('0x45')],qs['fields'](_0x35aa8c['query'][_0xf481('0x47')]));_0x3b5817[_0xf481('0x46')]=_0x3b5817[_0xf481('0x46')][_0xf481('0x59')]?_0x3b5817['attributes']:_0x222262[_0xf481('0x45')];if(_0x35aa8c[_0xf481('0x42')][_0xf481('0x53')]){_0x3b5817[_0xf481('0x54')]=[{'all':!![]}];}_0x3b5817=_[_0xf481('0x4d')]({},_0x3b5817,_0x35aa8c[_0xf481('0x51')]);return db[_0xf481('0x52')][_0xf481('0x5a')](_0x3b5817)[_0xf481('0x23')](handleEntityNotFound(_0x439fbd,null))[_0xf481('0x23')](respondWithResult(_0x439fbd,null))[_0xf481('0x2c')](handleError(_0x439fbd,null));};exports[_0xf481('0x5b')]=function(_0x4c77fe,_0x37f9dd){return db[_0xf481('0x52')]['create'](_0x4c77fe[_0xf481('0x5c')],{})['then'](function(_0x4d4462){var _0x2ad7e9=_0x4c77fe[_0xf481('0x5d')]['get']({'plain':!![]});if(!_0x2ad7e9)throw new Error(_0xf481('0x5e'));if(_0x2ad7e9[_0xf481('0x5f')]===_0xf481('0x5d')){var _0x4a62d1=_0x4d4462[_0xf481('0x38')]({'plain':!![]});var _0x27ffe7=_0xf481('0x60');return db[_0xf481('0x61')][_0xf481('0x5a')]({'where':{'name':_0x27ffe7,'userProfileId':_0x2ad7e9[_0xf481('0x62')]},'raw':!![]})[_0xf481('0x23')](function(_0x4e5293){if(_0x4e5293&&_0x4e5293[_0xf481('0x63')]===0x0){return db[_0xf481('0x64')][_0xf481('0x5b')]({'name':_0x4a62d1['name'],'resourceId':_0x4a62d1['id'],'type':_0x4e5293[_0xf481('0x3b')],'sectionId':_0x4e5293['id']},{})[_0xf481('0x23')](function(){return _0x4d4462;});}else{return _0x4d4462;}})[_0xf481('0x2c')](function(_0x89f1a6){logger['error'](_0xf481('0x65'),_0x89f1a6);throw _0x89f1a6;});}return _0x4d4462;})[_0xf481('0x23')](respondWithResult(_0x37f9dd,0xc9))['catch'](handleError(_0x37f9dd,null));};exports[_0xf481('0x66')]=function(_0x2573c4,_0x229817){if(_0x2573c4[_0xf481('0x5c')]['id']){delete _0x2573c4[_0xf481('0x5c')]['id'];}return db['WhatsappAccount']['find']({'where':{'id':_0x2573c4[_0xf481('0x57')]['id']},'include':[{'model':db[_0xf481('0x3e')],'as':'mandatoryDispositionPause'}]})[_0xf481('0x23')](handleEntityNotFound(_0x229817,null))[_0xf481('0x23')](saveUpdates(_0x2573c4[_0xf481('0x5c')],null))[_0xf481('0x23')](respondWithResult(_0x229817,null))['catch'](handleError(_0x229817,null));};exports['destroy']=function(_0x21416f,_0x33cb9e){return db[_0xf481('0x52')]['find']({'where':{'id':_0x21416f[_0xf481('0x57')]['id']}})[_0xf481('0x23')](handleEntityNotFound(_0x33cb9e,null))['then'](removeEntity(_0x33cb9e,null))[_0xf481('0x2c')](handleError(_0x33cb9e,null));};exports[_0xf481('0x67')]=function(_0x35dd79,_0x12b02f){return db[_0xf481('0x52')][_0xf481('0x67')]()[_0xf481('0x23')](respondWithResult(_0x12b02f,null))[_0xf481('0x2c')](handleError(_0x12b02f,null));};exports[_0xf481('0x68')]=function(_0x18b595,_0x43f749,_0x5daa3c){if(_0x18b595['body']['id']){delete _0x18b595[_0xf481('0x5c')]['id'];}return db[_0xf481('0x52')][_0xf481('0x5a')]({'where':{'id':_0x18b595[_0xf481('0x57')]['id']}})[_0xf481('0x23')](handleEntityNotFound(_0x43f749,null))[_0xf481('0x23')](function(_0x432de1){if(_0x432de1){_0x18b595['body'][_0xf481('0x69')]=_0x432de1['id'];return db[_0xf481('0x6a')][_0xf481('0x5b')](_0x18b595[_0xf481('0x5c')]);}})['then'](respondWithResult(_0x43f749,null))[_0xf481('0x2c')](handleError(_0x43f749,null));};exports['getDispositions']=function(_0x227b37,_0x5ac0bc,_0x33a2bf){var _0x4f79d3={'raw':![],'where':{}};var _0x165c71={};var _0x499650={'count':0x0,'rows':[]};return db[_0xf481('0x52')][_0xf481('0x6b')]({'where':{'id':_0x227b37[_0xf481('0x57')]['id']}})['then'](handleEntityNotFound(_0x5ac0bc,null))['then'](function(_0x4a21d8){if(_0x4a21d8){_0x165c71[_0xf481('0x45')]=_[_0xf481('0x41')](db['Disposition'][_0xf481('0x6c')]);_0x165c71['query']=_['keys'](_0x227b37[_0xf481('0x42')]);_0x165c71[_0xf481('0x43')]=_[_0xf481('0x44')](_0x165c71[_0xf481('0x45')],_0x165c71['query']);_0x4f79d3['attributes']=_['intersection'](_0x165c71['model'],qs['fields'](_0x227b37['query'][_0xf481('0x47')]));_0x4f79d3[_0xf481('0x46')]=_0x4f79d3[_0xf481('0x46')]['length']?_0x4f79d3[_0xf481('0x46')]:_0x165c71[_0xf481('0x45')];if(!_0x227b37[_0xf481('0x42')][_0xf481('0x6d')](_0xf481('0x48'))){_0x4f79d3[_0xf481('0x33')]=qs[_0xf481('0x33')](_0x227b37[_0xf481('0x42')]['limit']);_0x4f79d3[_0xf481('0x31')]=qs[_0xf481('0x31')](_0x227b37['query'][_0xf481('0x31')]);}_0x4f79d3[_0xf481('0x49')]=qs[_0xf481('0x4a')](_0x227b37['query'][_0xf481('0x4a')]);_0x4f79d3['where']=qs[_0xf481('0x43')](_[_0xf481('0x4c')](_0x227b37[_0xf481('0x42')],_0x165c71[_0xf481('0x43')]));_0x4f79d3[_0xf481('0x4b')][_0xf481('0x69')]=_0x4a21d8['id'];if(_0x227b37[_0xf481('0x42')]['filter']){_0x4f79d3[_0xf481('0x4b')]=_[_0xf481('0x4d')](_0x4f79d3['where'],{'$or':_[_0xf481('0x4e')](_0x4f79d3['attributes'],function(_0x49d9f2){var _0x39ecd9={};_0x39ecd9[_0x49d9f2]={'$like':'%'+_0x227b37[_0xf481('0x42')][_0xf481('0x6e')]+'%'};return _0x39ecd9;})});}_0x4f79d3=_[_0xf481('0x4d')]({},_0x4f79d3,_0x227b37['options']);return db[_0xf481('0x6a')][_0xf481('0x34')]({'where':_0x4f79d3[_0xf481('0x4b')]})[_0xf481('0x23')](function(_0x47be8b){_0x499650[_0xf481('0x34')]=_0x47be8b;if(_0x227b37[_0xf481('0x42')][_0xf481('0x53')]){_0x4f79d3[_0xf481('0x54')]=[{'all':!![]}];}return db[_0xf481('0x6a')][_0xf481('0x55')](_0x4f79d3);})[_0xf481('0x23')](function(_0x426a63){_0x499650[_0xf481('0x6f')]=_0x426a63;return _0x499650;});}})[_0xf481('0x23')](respondWithFilteredResult(_0x5ac0bc,_0x4f79d3))[_0xf481('0x2c')](handleError(_0x5ac0bc,null));};exports[_0xf481('0x70')]=function(_0x8474d,_0x205677,_0x2d3626){return db['WhatsappAccount'][_0xf481('0x5a')]({'where':{'id':_0x8474d[_0xf481('0x57')]['id']}})[_0xf481('0x23')](handleEntityNotFound(_0x205677,null))[_0xf481('0x23')](function(_0x5995f0){if(_0x5995f0){return _0x5995f0[_0xf481('0x70')](_0x8474d[_0xf481('0x42')]['ids']);}})['then'](respondWithStatusCode(_0x205677,null))[_0xf481('0x2c')](handleError(_0x205677,null));};exports[_0xf481('0x71')]=function(_0x28ac38,_0x45be0f,_0x534b06){if(_0x28ac38['body']['id']){delete _0x28ac38[_0xf481('0x5c')]['id'];}return db['WhatsappAccount'][_0xf481('0x5a')]({'where':{'id':_0x28ac38[_0xf481('0x57')]['id']}})['then'](handleEntityNotFound(_0x45be0f,null))[_0xf481('0x23')](function(_0x3a7d59){if(_0x3a7d59){_0x28ac38['body']['WhatsappAccountId']=_0x3a7d59['id'];return db[_0xf481('0x72')][_0xf481('0x5b')](_0x28ac38[_0xf481('0x5c')]);}})[_0xf481('0x23')](respondWithResult(_0x45be0f,null))[_0xf481('0x2c')](handleError(_0x45be0f,null));};exports[_0xf481('0x73')]=function(_0x474366,_0x34b0a9,_0x858d6d){var _0x517ca6={'raw':![],'where':{}};var _0x42b117={};var _0x23d737={'count':0x0,'rows':[]};return db[_0xf481('0x52')][_0xf481('0x6b')]({'where':{'id':_0x474366[_0xf481('0x57')]['id']}})[_0xf481('0x23')](handleEntityNotFound(_0x34b0a9,null))[_0xf481('0x23')](function(_0x2d9d7d){if(_0x2d9d7d){_0x42b117[_0xf481('0x45')]=_[_0xf481('0x41')](db[_0xf481('0x72')][_0xf481('0x6c')]);_0x42b117[_0xf481('0x42')]=_[_0xf481('0x41')](_0x474366[_0xf481('0x42')]);_0x42b117['filters']=_[_0xf481('0x44')](_0x42b117[_0xf481('0x45')],_0x42b117[_0xf481('0x42')]);_0x517ca6[_0xf481('0x46')]=_['intersection'](_0x42b117[_0xf481('0x45')],qs[_0xf481('0x47')](_0x474366[_0xf481('0x42')][_0xf481('0x47')]));_0x517ca6['attributes']=_0x517ca6[_0xf481('0x46')][_0xf481('0x59')]?_0x517ca6['attributes']:_0x42b117[_0xf481('0x45')];if(!_0x474366['query'][_0xf481('0x6d')](_0xf481('0x48'))){_0x517ca6['limit']=qs[_0xf481('0x33')](_0x474366[_0xf481('0x42')][_0xf481('0x33')]);_0x517ca6[_0xf481('0x31')]=qs[_0xf481('0x31')](_0x474366[_0xf481('0x42')][_0xf481('0x31')]);}_0x517ca6['order']=qs[_0xf481('0x4a')](_0x474366[_0xf481('0x42')][_0xf481('0x4a')]);_0x517ca6[_0xf481('0x4b')]=qs[_0xf481('0x43')](_[_0xf481('0x4c')](_0x474366[_0xf481('0x42')],_0x42b117[_0xf481('0x43')]));_0x517ca6[_0xf481('0x4b')][_0xf481('0x69')]=_0x2d9d7d['id'];if(_0x474366['query'][_0xf481('0x6e')]){_0x517ca6[_0xf481('0x4b')]=_[_0xf481('0x4d')](_0x517ca6['where'],{'$or':_['map'](_0x517ca6[_0xf481('0x46')],function(_0x51ba1d){var _0x2e950a={};_0x2e950a[_0x51ba1d]={'$like':'%'+_0x474366['query'][_0xf481('0x6e')]+'%'};return _0x2e950a;})});}_0x517ca6=_['merge']({},_0x517ca6,_0x474366[_0xf481('0x51')]);return db[_0xf481('0x72')]['count']({'where':_0x517ca6[_0xf481('0x4b')]})[_0xf481('0x23')](function(_0x5a583d){_0x23d737[_0xf481('0x34')]=_0x5a583d;if(_0x474366['query'][_0xf481('0x53')]){_0x517ca6[_0xf481('0x54')]=[{'all':!![]}];}return db[_0xf481('0x72')]['findAll'](_0x517ca6);})[_0xf481('0x23')](function(_0x186c6a){_0x23d737[_0xf481('0x6f')]=_0x186c6a;return _0x23d737;});}})[_0xf481('0x23')](respondWithFilteredResult(_0x34b0a9,_0x517ca6))[_0xf481('0x2c')](handleError(_0x34b0a9,null));};exports['removeAnswers']=function(_0x31c01c,_0x442264,_0x3bc707){return db['WhatsappAccount'][_0xf481('0x5a')]({'where':{'id':_0x31c01c[_0xf481('0x57')]['id']}})[_0xf481('0x23')](handleEntityNotFound(_0x442264,null))[_0xf481('0x23')](function(_0x3af512){if(_0x3af512){return _0x3af512['removeAnswers'](_0x31c01c[_0xf481('0x42')]['ids']);}})[_0xf481('0x23')](respondWithStatusCode(_0x442264,null))[_0xf481('0x2c')](handleError(_0x442264,null));};exports[_0xf481('0x74')]=function(_0x85445b,_0x5ac6c4,_0x4c78f5){return db[_0xf481('0x52')][_0xf481('0x5a')]({'where':{'id':_0x85445b['params']['id']}})[_0xf481('0x23')](handleEntityNotFound(_0x5ac6c4,null))[_0xf481('0x23')](function(_0x58628c){if(_0x58628c){return _0x58628c['addAgents'](_0x85445b[_0xf481('0x5c')][_0xf481('0x75')],_[_0xf481('0x76')](_0x85445b[_0xf481('0x5c')],[_0xf481('0x75'),'id'])||{})['spread'](function(_0x4008b9){for(var _0x19aecf=0x0;_0x19aecf<_0x85445b[_0xf481('0x5c')][_0xf481('0x75')]['length'];_0x19aecf+=0x1){socket[_0xf481('0x77')](_0xf481('0x78'),{'UserId':Number(_0x85445b[_0xf481('0x5c')]['ids'][_0x19aecf]),'WhatsappAccountId':Number(_0x85445b['params']['id'])});}return _0x4008b9;});}})[_0xf481('0x23')](respondWithResult(_0x5ac6c4,null))[_0xf481('0x2c')](handleError(_0x5ac6c4,null));};exports[_0xf481('0x79')]=function(_0x5e239d,_0x4ce81d,_0x440a71){return db[_0xf481('0x52')][_0xf481('0x5a')]({'where':{'id':_0x5e239d['params']['id']}})['then'](handleEntityNotFound(_0x4ce81d,null))[_0xf481('0x23')](function(_0x24c1c5){if(_0x24c1c5){return _0x24c1c5[_0xf481('0x79')](_0x5e239d[_0xf481('0x42')][_0xf481('0x75')])[_0xf481('0x23')](function(){if(_[_0xf481('0x7a')](_0x5e239d[_0xf481('0x42')][_0xf481('0x75')])){for(var _0x4e5b14=0x0;_0x4e5b14<_0x5e239d[_0xf481('0x42')][_0xf481('0x75')][_0xf481('0x59')];_0x4e5b14+=0x1){socket['emit'](_0xf481('0x7b'),{'UserId':Number(_0x5e239d[_0xf481('0x42')]['ids'][_0x4e5b14]),'WhatsappAccountId':Number(_0x5e239d['params']['id'])});}}else{socket[_0xf481('0x77')](_0xf481('0x7b'),{'UserId':Number(_0x5e239d[_0xf481('0x42')][_0xf481('0x75')]),'WhatsappAccountId':Number(_0x5e239d[_0xf481('0x57')]['id'])});}});}})[_0xf481('0x23')](respondWithStatusCode(_0x4ce81d,null))[_0xf481('0x2c')](handleError(_0x4ce81d,null));};exports[_0xf481('0x7c')]=function(_0x397033,_0x47780c,_0x36c169){var _0x218fca={};var _0x1e6b46={};var _0x5adce5;var _0x1501ca;return db[_0xf481('0x52')][_0xf481('0x6b')]({'where':{'id':_0x397033['params']['id']}})[_0xf481('0x23')](handleEntityNotFound(_0x47780c,null))[_0xf481('0x23')](function(_0x3d2feb){if(_0x3d2feb){_0x5adce5=_0x3d2feb;_0x1e6b46[_0xf481('0x45')]=_['keys'](db[_0xf481('0x7d')]['rawAttributes']);_0x1e6b46['query']=_[_0xf481('0x41')](_0x397033[_0xf481('0x42')]);_0x1e6b46[_0xf481('0x43')]=_[_0xf481('0x44')](_0x1e6b46[_0xf481('0x45')],_0x1e6b46['query']);_0x218fca['attributes']=_[_0xf481('0x44')](_0x1e6b46[_0xf481('0x45')],qs[_0xf481('0x47')](_0x397033[_0xf481('0x42')][_0xf481('0x47')]));_0x218fca[_0xf481('0x46')]=_0x218fca[_0xf481('0x46')][_0xf481('0x59')]?_0x218fca[_0xf481('0x46')]:_0x1e6b46[_0xf481('0x45')];_0x218fca[_0xf481('0x49')]=qs[_0xf481('0x4a')](_0x397033[_0xf481('0x42')][_0xf481('0x4a')]);_0x218fca['where']=qs[_0xf481('0x43')](_['pick'](_0x397033[_0xf481('0x42')],_0x1e6b46['filters']));if(_0x397033['query'][_0xf481('0x6e')]){_0x218fca[_0xf481('0x4b')]=_[_0xf481('0x4d')](_0x218fca['where'],{'$or':_[_0xf481('0x4e')](_0x218fca['attributes'],function(_0x1bce73){var _0x4045f6={};_0x4045f6[_0x1bce73]={'$like':'%'+_0x397033[_0xf481('0x42')][_0xf481('0x6e')]+'%'};return _0x4045f6;})});}_0x218fca=_['merge']({},_0x218fca,_0x397033['options']);return _0x5adce5[_0xf481('0x7c')](_0x218fca);}})[_0xf481('0x23')](function(_0x4729dc){if(_0x4729dc){_0x1501ca=_0x4729dc['length'];if(!_0x397033[_0xf481('0x42')][_0xf481('0x6d')](_0xf481('0x48'))){_0x218fca[_0xf481('0x33')]=qs[_0xf481('0x33')](_0x397033[_0xf481('0x42')][_0xf481('0x33')]);_0x218fca[_0xf481('0x31')]=qs[_0xf481('0x31')](_0x397033['query'][_0xf481('0x31')]);}return _0x5adce5[_0xf481('0x7c')](_0x218fca);}})['then'](function(_0x190477){if(_0x190477){return _0x190477?{'count':_0x1501ca,'rows':_0x190477}:null;}})[_0xf481('0x23')](respondWithResult(_0x47780c,null))[_0xf481('0x2c')](handleError(_0x47780c,null));};exports['addApplications']=function(_0x1e8288,_0x486e15,_0x1da49f){return db[_0xf481('0x52')][_0xf481('0x6b')]({'where':{'id':_0x1e8288[_0xf481('0x57')]['id']}})[_0xf481('0x23')](handleEntityNotFound(_0x486e15,null))[_0xf481('0x23')](function(_0xb261fa){if(_0xb261fa){return db[_0xf481('0x7e')]['transaction'](function(_0x81eea9){return db['WhatsappApplication'][_0xf481('0x39')]({'where':{'WhatsappAccountId':_0x1e8288[_0xf481('0x57')]['id']},'transaction':_0x81eea9})['then'](function(_0x397b8f){var _0x2ef4f3=_['map'](_0x1e8288[_0xf481('0x5c')],function(_0x5b5816){_0x5b5816['WhatsappAccountId']=_0x1e8288[_0xf481('0x57')]['id'];return _0x5b5816;});return db[_0xf481('0x7f')]['bulkCreate'](_0x2ef4f3,{'transaction':_0x81eea9});});})[_0xf481('0x23')](function(){return db[_0xf481('0x7f')][_0xf481('0x80')]({'where':{'WhatsappAccountId':_0x1e8288[_0xf481('0x57')]['id']},'order':_0xf481('0x81')});});}})[_0xf481('0x23')](respondWithResult(_0x486e15,null))['catch'](handleError(_0x486e15,null));};exports['getApplications']=function(_0x505320,_0x4be115,_0xf2c06){var _0x40266d={};var _0x52cb5e={};var _0xb5bcca;var _0x488a90;return db[_0xf481('0x52')]['findOne']({'where':{'id':_0x505320['params']['id']}})[_0xf481('0x23')](handleEntityNotFound(_0x4be115,null))[_0xf481('0x23')](function(_0xf99d0a){if(_0xf99d0a){_0xb5bcca=_0xf99d0a;_0x52cb5e['model']=_[_0xf481('0x41')](db[_0xf481('0x7f')][_0xf481('0x6c')]);_0x52cb5e['query']=_[_0xf481('0x41')](_0x505320['query']);_0x52cb5e['filters']=_['intersection'](_0x52cb5e['model'],_0x52cb5e['query']);_0x40266d[_0xf481('0x46')]=_['intersection'](_0x52cb5e[_0xf481('0x45')],qs[_0xf481('0x47')](_0x505320[_0xf481('0x42')][_0xf481('0x47')]));_0x40266d[_0xf481('0x46')]=_0x40266d[_0xf481('0x46')][_0xf481('0x59')]?_0x40266d[_0xf481('0x46')]:_0x52cb5e[_0xf481('0x45')];_0x40266d[_0xf481('0x49')]=qs[_0xf481('0x4a')](_0x505320[_0xf481('0x42')]['sort']);_0x40266d['where']=qs[_0xf481('0x43')](_[_0xf481('0x4c')](_0x505320['query'],_0x52cb5e['filters']));if(_0x505320[_0xf481('0x42')]['filter']){_0x40266d[_0xf481('0x4b')]=_[_0xf481('0x4d')](_0x40266d[_0xf481('0x4b')],{'$or':_[_0xf481('0x4e')](_0x40266d[_0xf481('0x46')],function(_0x24a2ff){var _0x1b7d95={};_0x1b7d95[_0x24a2ff]={'$like':'%'+_0x505320[_0xf481('0x42')][_0xf481('0x6e')]+'%'};return _0x1b7d95;})});}_0x40266d=_['merge']({},_0x40266d,_0x505320['options']);return _0xb5bcca[_0xf481('0x82')](_0x40266d);}})[_0xf481('0x23')](function(_0x2f37e2){if(_0x2f37e2){_0x488a90=_0x2f37e2[_0xf481('0x59')];if(!_0x505320[_0xf481('0x42')][_0xf481('0x6d')](_0xf481('0x48'))){_0x40266d[_0xf481('0x33')]=qs[_0xf481('0x33')](_0x505320['query'][_0xf481('0x33')]);_0x40266d[_0xf481('0x31')]=qs[_0xf481('0x31')](_0x505320[_0xf481('0x42')][_0xf481('0x31')]);}return _0xb5bcca[_0xf481('0x82')](_0x40266d);}})[_0xf481('0x23')](function(_0x41285e){if(_0x41285e){return _0x41285e?{'count':_0x488a90,'rows':_0x41285e}:null;}})['then'](respondWithResult(_0x4be115,null))[_0xf481('0x2c')](handleError(_0x4be115,null));};exports[_0xf481('0x83')]=function(_0x435895,_0x3769ea,_0x46d458){var _0xb91366={'channel':'whatsapp'};var _0x479b90=[];var _0x38057e=[];var _0x20b253={};return db[_0xf481('0x52')][_0xf481('0x5a')]({'where':{'id':_0x435895['params']['id']},'include':[{'model':db[_0xf481('0x7f')],'as':_0xf481('0x84')}]})[_0xf481('0x23')](handleEntityNotFound(_0x3769ea,null))[_0xf481('0x23')](function(_0x49c63c){_0xb91366[_0xf481('0x85')]=_0x49c63c;_0xb91366[_0xf481('0x86')]=_[_0xf481('0x87')](_0x49c63c[_0xf481('0x84')],[_0xf481('0x81')],[_0xf481('0x88')]);if(_0xb91366[_0xf481('0x85')][_0xf481('0x84')]){delete _0xb91366['account']['Applications'];}return db[_0xf481('0x89')][_0xf481('0x67')]();})[_0xf481('0x23')](function(_0x50ed80){if(!_0x50ed80){throw new db[(_0xf481('0x8a'))][(_0xf481('0x8b'))](_0xf481('0x8c'));}_0x479b90=_[_0xf481('0x8d')](_[_0xf481('0x41')](_0x50ed80),[_0xf481('0x8e'),_0xf481('0x8f')]);_0x38057e=_[_0xf481('0x8d')](_[_0xf481('0x41')](_0x50ed80),[_0xf481('0x8e'),_0xf481('0x8f'),_0xf481('0x90'),_0xf481('0x91')]);_0xb91366[_0xf481('0x5c')]={'mapKey':_0xf481('0x92')};if(_0xb91366[_0xf481('0x85')][_0xf481('0x4f')]&&_0xb91366['account'][_0xf481('0x4f')]===_0xf481('0x93')){_0xb91366['body']['from']=_0x435895[_0xf481('0x5c')][_0xf481('0x94')][_0xf481('0x95')](_0xf481('0x96'),'');_0xb91366['body'][_0xf481('0x5c')]=_0x435895[_0xf481('0x5c')][_0xf481('0x97')];_0xb91366[_0xf481('0x5c')][_0xf481('0x98')]=_0x435895[_0xf481('0x5c')]['MessageSid'];}if(_0xb91366[_0xf481('0x5c')]['id']){delete _0xb91366[_0xf481('0x5c')]['id'];}if(_[_0xf481('0x99')](_0xb91366[_0xf481('0x5c')][_0xf481('0x9a')])){throw new db[(_0xf481('0x8a'))][(_0xf481('0x8b'))](_0xf481('0x9b'));}if(_[_0xf481('0x99')](_0xb91366[_0xf481('0x5c')][_0xf481('0x5c')])||_0xb91366[_0xf481('0x5c')][_0xf481('0x5c')]===''){throw new db[(_0xf481('0x8a'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xf481('0x99')](_0xb91366[_0xf481('0x5c')]['mapKey'])){throw new db[(_0xf481('0x8a'))][(_0xf481('0x8b'))](_0xf481('0x9c')+_0x38057e);}if(!_[_0xf481('0x9d')](_0x38057e,_0xb91366[_0xf481('0x5c')]['mapKey'])){throw new db[(_0xf481('0x8a'))]['ValidationError'](_0xf481('0x9e')+_0x38057e);}_0x20b253[_0xb91366[_0xf481('0x5c')][_0xf481('0x9f')]]=_0xb91366[_0xf481('0x5c')][_0xf481('0x9a')];return db['CmList']['find']({'where':{'id':_0xb91366[_0xf481('0x85')][_0xf481('0x91')]},'include':[{'model':db[_0xf481('0x89')],'as':'Contacts','where':_0x20b253,'limit':0x1,'order':[['updatedAt',_0xf481('0xa0')]]}]});})[_0xf481('0x23')](handleEntityNotFound(_0x3769ea,null))['then'](function(_0x3a1c16){if(_0x3a1c16){_0xb91366[_0xf481('0xa1')]=_['omit'](_0x3a1c16,['Contacts']);if(_0x3a1c16[_0xf481('0xa2')][_0xf481('0x59')]){return _0x3a1c16[_0xf481('0xa2')][0x0];}var _0x533af2=_[_0xf481('0x1c')](_0xb91366[_0xf481('0x5c')],{'firstName':_0xb91366[_0xf481('0x5c')]['from'],'ListId':_0x3a1c16['id']});_0x533af2[_0xb91366[_0xf481('0x5c')]['mapKey']]=_0xb91366[_0xf481('0x5c')]['from'];return db[_0xf481('0x89')][_0xf481('0x5b')](_0x533af2,{'fields':_0x479b90,'raw':!![]});}})['then'](handleEntityNotFound(_0x3769ea,null))['then'](function(_0x3a784c){if(_0x3a784c){_0xb91366[_0xf481('0xa3')]=_0x3a784c;var _0x5de7d9={'ContactId':_0x3a784c['id'],'phone':_0xb91366['body'][_0xf481('0x9a')],'WhatsappAccountId':_0x435895[_0xf481('0x57')]['id']};var _0x2a6145={'ContactId':_0x3a784c['id'],'WhatsappAccountId':_0x435895[_0xf481('0x57')]['id'],'closed':![]};return db[_0xf481('0xa4')][_0xf481('0x5a')]({'where':_0x2a6145})[_0xf481('0x23')](function(_0x41608e){if(_0x41608e){return[_0x41608e,![]];}return db['WhatsappInteraction'][_0xf481('0x5b')](_0x5de7d9)[_0xf481('0x23')](function(_0x515659){return[_0x515659,!![]];});});}})[_0xf481('0xa5')](function(_0x318fae,_0x1596d9){_0xb91366[_0xf481('0xa6')]=_0x318fae[_0xf481('0x38')]({'plain':!![]});_0xb91366[_0xf481('0xa6')][_0xf481('0xa7')]=![];if(_0x1596d9){if(_0xb91366[_0xf481('0x85')][_0xf481('0xa8')]){_0xb91366[_0xf481('0x86')][_0xf481('0xa9')]({'id':0x0,'priority':_0xb91366[_0xf481('0x86')]['length']+0x1,'app':_0xf481('0xaa'),'appdata':'unmanaged','interval':_0xf481('0xab')});}_0xb91366[_0xf481('0xa6')][_0xf481('0xa7')]=!![];}return db[_0xf481('0xac')][_0xf481('0x5b')]({'phone':_0xb91366[_0xf481('0x5c')]['from'],'messageId':_0xb91366[_0xf481('0x5c')][_0xf481('0x98')],'body':_0xb91366[_0xf481('0x5c')][_0xf481('0x5c')],'WhatsappAccountId':_0x435895['params']['id'],'WhatsappInteractionId':_0x318fae['id'],'direction':'in','ContactId':_0x318fae[_0xf481('0xad')],'AttachmentId':_0xb91366[_0xf481('0x5c')]['AttachmentId']});})[_0xf481('0x23')](function(_0x3b28e1){_0xb91366[_0xf481('0x29')]=_0x3b28e1;if(_0xb91366['interaction'][_0xf481('0xae')]){return db['User'][_0xf481('0x5a')]({'attributes':['id',_0xf481('0x3b')],'where':{'id':_0xb91366[_0xf481('0xa6')][_0xf481('0xae')]}})[_0xf481('0x23')](function(_0x3f9f86){if(_0x3f9f86){_0xb91366['applications'][_0xf481('0xaf')]({'id':0x0,'priority':0x0,'app':_0xf481('0xb0'),'appdata':_0x3f9f86['name']+','+(_0xb91366[_0xf481('0x85')][_0xf481('0xb1')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xf481('0xb2'),'startRouting',_0xb91366);});}return respondWithRpcPromise(_0xf481('0xb2'),_0xf481('0xb3'),_0xb91366);})[_0xf481('0x23')](function(_0x185c7a){if(_0x185c7a){var _0x45da05=0xc8;var _0x4fb6d7=_0xf481('0xb4');logger['info']('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x4fb6d7,_0x45da05,_0xf481('0xb5'));logger[_0xf481('0xb6')](_0xf481('0xb7'),_0x4fb6d7,_0x45da05,'entity\x20found',JSON[_0xf481('0x27')](_0x185c7a));if(_0xb91366[_0xf481('0x85')]['type']===_0xf481('0x93')){return _0x3769ea['status'](_0x45da05)[_0xf481('0x35')](_0xf481('0xb8'),_0xf481('0xb9'))[_0xf481('0x3c')](_0xf481('0xba'));}else{return _0x3769ea[_0xf481('0x2e')](_0x45da05)[_0xf481('0x30')](_0x185c7a);}}})['catch'](handleError(_0x3769ea,null));};exports[_0xf481('0x3c')]=function(_0x115a9b,_0x5cb8a7,_0x12bfcb){var _0x5ed5bb,_0x34edbc,_0x2db2d3;if(_[_0xf481('0x99')](_0x115a9b['body'][_0xf481('0x5c')])||_0x115a9b[_0xf481('0x5c')][_0xf481('0x5c')]===''){throw new db[(_0xf481('0x8a'))][(_0xf481('0x8b'))](_0xf481('0xbb'));}if(_['isNil'](_0x115a9b[_0xf481('0x5c')]['to'])){throw new db[(_0xf481('0x8a'))][(_0xf481('0x8b'))](_0xf481('0xbc'));}_0x5ed5bb=_0x115a9b[_0xf481('0x5c')]['to'];return db['WhatsappAccount'][_0xf481('0x5a')]({'where':{'id':_0x115a9b[_0xf481('0x57')]['id']},'include':[{'model':db[_0xf481('0xbd')],'as':_0xf481('0xbe'),'include':[{'model':db[_0xf481('0x89')],'as':'Contacts','where':{'mobile':_0x5ed5bb},'limit':0x1,'order':[[_0xf481('0x8f'),_0xf481('0xa0')]]}]}]})[_0xf481('0x23')](handleEntityNotFound(_0x5cb8a7,null))[_0xf481('0x23')](function(_0x45cfae){if(_0x45cfae&&_0x45cfae[_0xf481('0xbe')]){_0x34edbc=_0x45cfae['get']({'plain':!![]});if(_0x34edbc['List']&&_0x34edbc[_0xf481('0xbe')]['Contacts'][_0xf481('0x59')]){return _0x34edbc[_0xf481('0xbe')][_0xf481('0xa2')][0x0];}return db[_0xf481('0x89')][_0xf481('0x5b')](_[_0xf481('0x1c')](_0x115a9b[_0xf481('0x5c')],{'firstName':_0x5ed5bb,'mobile':_0x5ed5bb,'phone':_0x5ed5bb,'ListId':_0x34edbc[_0xf481('0x91')]}));}})[_0xf481('0x23')](handleEntityNotFound(_0x5cb8a7,null))[_0xf481('0x23')](function(_0x193298){if(_0x193298){_0x2db2d3=_0x193298;return db[_0xf481('0xa4')][_0xf481('0x5a')]({'where':{'ContactId':_0x2db2d3['id'],'closed':![],'WhatsappAccountId':_0x34edbc['id']}})[_0xf481('0x23')](function(_0x32ee68){if(_0x32ee68){return[_0x32ee68,![]];}return db[_0xf481('0xa4')][_0xf481('0x5b')]({'UserId':_0x115a9b[_0xf481('0x5d')]['id'],'ContactId':_0x2db2d3['id'],'WhatsappAccountId':_0x34edbc['id'],'phone':_0x5ed5bb,'firstMsgDirection':_0xf481('0xbf'),'Messages':[_[_0xf481('0x4d')](_0x115a9b[_0xf481('0x5c')],{'read':![],'body':_0x115a9b[_0xf481('0x5c')][_0xf481('0x5c')],'phone':_0x5ed5bb,'WhatsappAccountId':_0x34edbc['id'],'UserId':_0x115a9b['user']['id'],'ContactId':_0x2db2d3['id']})]},{'include':[{'model':db['WhatsappMessage'],'as':_0xf481('0xc0')}]})[_0xf481('0x23')](function(_0xd9c977){return[_0xd9c977,!![]];});});}})[_0xf481('0xa5')](function(_0x5df073,_0x2d9026){if(_0x2d9026){return _0x5df073;}return db[_0xf481('0xac')][_0xf481('0x5b')](_[_0xf481('0x4d')](_0x115a9b[_0xf481('0x5c')],{'read':![],'body':_0x115a9b[_0xf481('0x5c')][_0xf481('0x5c')],'phone':_0x5ed5bb,'WhatsappAccountId':_0x34edbc['id'],'WhatsappInteractionId':_0x5df073['id'],'UserId':_0x115a9b[_0xf481('0x5d')]['id'],'ContactId':_0x2db2d3['id']}))['then'](function(_0xafc6b9){_0x5df073['dataValues'][_0xf481('0xc0')]=[];_0x5df073[_0xf481('0xc1')][_0xf481('0xc0')][_0xf481('0xa9')](_0xafc6b9['dataValues']);return _0x5df073;});})[_0xf481('0x23')](respondWithResult(_0x5cb8a7,null))[_0xf481('0x2c')](handleError(_0x5cb8a7,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index 2b7f53a..a6c1911 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 _0xed5c=['exports','../../mysqldb','WhatsappAccount','setMaxListeners','save','update','remove','hook'];(function(_0x52c340,_0x447cd2){var _0x445eac=function(_0xb7a26b){while(--_0xb7a26b){_0x52c340['push'](_0x52c340['shift']());}};_0x445eac(++_0x447cd2);}(_0xed5c,0x121));var _0xced5=function(_0x3848df,_0x1a8ae4){_0x3848df=_0x3848df-0x0;var _0xf9eed5=_0xed5c[_0x3848df];return _0xf9eed5;};'use strict';var EventEmitter=require('events');var WhatsappAccount=require(_0xced5('0x0'))['db'][_0xced5('0x1')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xced5('0x2')](0x0);var events={'afterCreate':_0xced5('0x3'),'afterUpdate':_0xced5('0x4'),'afterDestroy':_0xced5('0x5')};function emitEvent(_0x11acec){return function(_0x57f9a4,_0x4842d4,_0x2ff2fa){WhatsappAccountEvents['emit'](_0x11acec+':'+_0x57f9a4['id'],_0x57f9a4);WhatsappAccountEvents['emit'](_0x11acec,_0x57f9a4);_0x2ff2fa(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappAccount[_0xced5('0x6')](e,emitEvent(event));}}module[_0xced5('0x7')]=WhatsappAccountEvents; \ No newline at end of file +var _0xc3ec=['save','remove','emit','hook','exports','events','../../mysqldb','WhatsappAccount','setMaxListeners'];(function(_0x5c12ac,_0x264499){var _0x33f13e=function(_0x19804c){while(--_0x19804c){_0x5c12ac['push'](_0x5c12ac['shift']());}};_0x33f13e(++_0x264499);}(_0xc3ec,0xb9));var _0xcc3e=function(_0x393198,_0x3b75ba){_0x393198=_0x393198-0x0;var _0x474589=_0xc3ec[_0x393198];return _0x474589;};'use strict';var EventEmitter=require(_0xcc3e('0x0'));var WhatsappAccount=require(_0xcc3e('0x1'))['db'][_0xcc3e('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xcc3e('0x3')](0x0);var events={'afterCreate':_0xcc3e('0x4'),'afterUpdate':'update','afterDestroy':_0xcc3e('0x5')};function emitEvent(_0x24514f){return function(_0x3e6f6b,_0x430e56,_0x1647e6){WhatsappAccountEvents[_0xcc3e('0x6')](_0x24514f+':'+_0x3e6f6b['id'],_0x3e6f6b);WhatsappAccountEvents[_0xcc3e('0x6')](_0x24514f,_0x3e6f6b);_0x1647e6(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappAccount[_0xcc3e('0x7')](e,emitEvent(event));}}module[_0xcc3e('0x8')]=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index 9cbc376..c65e8bd 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 _0x5996=['../../config/logger','moment','rimraf','define','WhatsappAccount','lodash','util'];(function(_0x3c001e,_0x293e88){var _0x29e37b=function(_0x7cd6cc){while(--_0x7cd6cc){_0x3c001e['push'](_0x3c001e['shift']());}};_0x29e37b(++_0x293e88);}(_0x5996,0x124));var _0x6599=function(_0x340512,_0x4b1954){_0x340512=_0x340512-0x0;var _0x1b2de4=_0x5996[_0x340512];return _0x1b2de4;};'use strict';var _=require(_0x6599('0x0'));var util=require(_0x6599('0x1'));var logger=require(_0x6599('0x2'))('api');var moment=require(_0x6599('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6599('0x4'));var config=require('../../config/environment');var attributes=require('./whatsappAccount.attributes');module['exports']=function(_0x5ef89e,_0x3feb5e){return _0x5ef89e[_0x6599('0x5')](_0x6599('0x6'),attributes,{'tableName':'whatsapp_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x97db=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappAccount.attributes','exports','whatsapp_accounts','lodash','../../config/logger'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x97db,0x76));var _0xb97d=function(_0x2572f0,_0x5daa5d){_0x2572f0=_0x2572f0-0x0;var _0x527172=_0x97db[_0x2572f0];return _0x527172;};'use strict';var _=require(_0xb97d('0x0'));var util=require('util');var logger=require(_0xb97d('0x1'))(_0xb97d('0x2'));var moment=require(_0xb97d('0x3'));var BPromise=require(_0xb97d('0x4'));var rp=require(_0xb97d('0x5'));var fs=require('fs');var path=require(_0xb97d('0x6'));var rimraf=require(_0xb97d('0x7'));var config=require(_0xb97d('0x8'));var attributes=require(_0xb97d('0x9'));module[_0xb97d('0xa')]=function(_0x2e7563,_0x50126c){return _0x2e7563['define']('WhatsappAccount',attributes,{'tableName':_0xb97d('0xb'),'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 2cf1da6..e985ed0 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 _0xa1c4=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','request','then','info','debug','request\x20sent','stringify','error','code','WhatsappAccount,\x20%s,\x20%s','message','result','catch','WhatsappAccount','find','options','raw','attributes','include','map','model','ShowWhatsappAccount','lodash','util','moment','ioredis','../../mysqldb'];(function(_0x3db8c5,_0x318920){var _0x219609=function(_0x3f43ac){while(--_0x3f43ac){_0x3db8c5['push'](_0x3db8c5['shift']());}};_0x219609(++_0x318920);}(_0xa1c4,0xdf));var _0x4a1c=function(_0x2a56ad,_0x2b94bf){_0x2a56ad=_0x2a56ad-0x0;var _0x425175=_0xa1c4[_0x2a56ad];return _0x425175;};'use strict';var _=require(_0x4a1c('0x0'));var util=require(_0x4a1c('0x1'));var moment=require(_0x4a1c('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4a1c('0x3'));var db=require(_0x4a1c('0x4'))['db'];var utils=require(_0x4a1c('0x5'));var logger=require(_0x4a1c('0x6'))(_0x4a1c('0x7'));var config=require(_0x4a1c('0x8'));var jayson=require(_0x4a1c('0x9'));var client=jayson[_0x4a1c('0xa')]['http']({'port':0x232a});config[_0x4a1c('0xb')]=_[_0x4a1c('0xc')](config[_0x4a1c('0xb')],{'host':_0x4a1c('0xd'),'port':0x18eb});var socket=require(_0x4a1c('0xe'))(new Redis(config[_0x4a1c('0xb')]));require(_0x4a1c('0xf'))[_0x4a1c('0x10')](socket);function respondWithRpcPromise(_0x69c358,_0xe4dca2,_0x1d51da){return new BPromise(function(_0x408e9e,_0x2222fb){return client[_0x4a1c('0x11')](_0x69c358,_0x1d51da)[_0x4a1c('0x12')](function(_0x332029){logger[_0x4a1c('0x13')]('WhatsappAccount,\x20%s,\x20%s',_0xe4dca2,'request\x20sent');logger[_0x4a1c('0x14')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0xe4dca2,_0x4a1c('0x15'),JSON[_0x4a1c('0x16')](_0x332029));if(_0x332029[_0x4a1c('0x17')]){if(_0x332029[_0x4a1c('0x17')][_0x4a1c('0x18')]===0x1f4){logger[_0x4a1c('0x17')](_0x4a1c('0x19'),_0xe4dca2,_0x332029['error'][_0x4a1c('0x1a')]);return _0x2222fb(_0x332029[_0x4a1c('0x17')]['message']);}logger['error']('WhatsappAccount,\x20%s,\x20%s',_0xe4dca2,_0x332029[_0x4a1c('0x17')][_0x4a1c('0x1a')]);return _0x408e9e(_0x332029['error']['message']);}else{logger[_0x4a1c('0x13')](_0x4a1c('0x19'),_0xe4dca2,_0x4a1c('0x15'));_0x408e9e(_0x332029[_0x4a1c('0x1b')][_0x4a1c('0x1a')]);}})[_0x4a1c('0x1c')](function(_0x1899a3){logger[_0x4a1c('0x17')](_0x4a1c('0x19'),_0xe4dca2,_0x1899a3);_0x2222fb(_0x1899a3);});});}exports['ShowWhatsappAccount']=function(_0x2da804){var _0x5db552=this;return new Promise(function(_0xeaaf41,_0x23bfb2){return db[_0x4a1c('0x1d')][_0x4a1c('0x1e')]({'raw':_0x2da804[_0x4a1c('0x1f')]?_0x2da804[_0x4a1c('0x1f')][_0x4a1c('0x20')]===undefined?!![]:![]:!![],'where':_0x2da804[_0x4a1c('0x1f')]?_0x2da804[_0x4a1c('0x1f')]['where']||null:null,'attributes':_0x2da804[_0x4a1c('0x1f')]?_0x2da804[_0x4a1c('0x1f')][_0x4a1c('0x21')]||null:null,'include':_0x2da804[_0x4a1c('0x1f')]?_0x2da804[_0x4a1c('0x1f')][_0x4a1c('0x22')]?_[_0x4a1c('0x23')](_0x2da804[_0x4a1c('0x1f')][_0x4a1c('0x22')],function(_0xbb0599){return{'model':db[_0xbb0599[_0x4a1c('0x24')]],'as':_0xbb0599['as'],'attributes':_0xbb0599['attributes'],'include':_0xbb0599['include']?_['map'](_0xbb0599['include'],function(_0x3ced0b){return{'model':db[_0x3ced0b[_0x4a1c('0x24')]],'as':_0x3ced0b['as'],'attributes':_0x3ced0b['attributes'],'include':_0x3ced0b[_0x4a1c('0x22')]?_[_0x4a1c('0x23')](_0x3ced0b[_0x4a1c('0x22')],function(_0x432d1c){return{'model':db[_0x432d1c[_0x4a1c('0x24')]],'as':_0x432d1c['as'],'attributes':_0x432d1c[_0x4a1c('0x21')]};}):[]};}):[]};}):[]:[]})[_0x4a1c('0x12')](function(_0x352b30){logger['info']('ShowWhatsappAccount',_0x2da804);logger[_0x4a1c('0x14')]('ShowWhatsappAccount',_0x2da804,JSON[_0x4a1c('0x16')](_0x352b30));_0xeaaf41(_0x352b30);})[_0x4a1c('0x1c')](function(_0x5b7379){logger[_0x4a1c('0x17')](_0x4a1c('0x25'),_0x5b7379[_0x4a1c('0x1a')],_0x2da804);_0x23bfb2(_0x5db552[_0x4a1c('0x17')](0x1f4,_0x5b7379[_0x4a1c('0x1a')]));});});}; \ No newline at end of file +var _0x974f=['find','options','raw','where','attributes','include','map','model','debug','util','moment','bluebird','randomstring','jayson/promise','client','http','redis','defaults','socket.io-emitter','./whatsappAccount.socket','register','info','request\x20sent','stringify','error','WhatsappAccount,\x20%s,\x20%s','message','result','catch','ShowWhatsappAccount','WhatsappAccount'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x974f,0x85));var _0xf974=function(_0x14cfb8,_0x4db5ea){_0x14cfb8=_0x14cfb8-0x0;var _0x342994=_0x974f[_0x14cfb8];return _0x342994;};'use strict';var _=require('lodash');var util=require(_0xf974('0x0'));var moment=require(_0xf974('0x1'));var BPromise=require(_0xf974('0x2'));var rs=require(_0xf974('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xf974('0x4'));var client=jayson[_0xf974('0x5')][_0xf974('0x6')]({'port':0x232a});config[_0xf974('0x7')]=_[_0xf974('0x8')](config[_0xf974('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0xf974('0x9'))(new Redis(config[_0xf974('0x7')]));require(_0xf974('0xa'))[_0xf974('0xb')](socket);function respondWithRpcPromise(_0x3a7bbe,_0x1ee421,_0x4d82cb){return new BPromise(function(_0x933f8f,_0x4c7b0a){return client['request'](_0x3a7bbe,_0x4d82cb)['then'](function(_0x3dfdb2){logger[_0xf974('0xc')]('WhatsappAccount,\x20%s,\x20%s',_0x1ee421,'request\x20sent');logger['debug']('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x1ee421,_0xf974('0xd'),JSON[_0xf974('0xe')](_0x3dfdb2));if(_0x3dfdb2['error']){if(_0x3dfdb2[_0xf974('0xf')]['code']===0x1f4){logger[_0xf974('0xf')](_0xf974('0x10'),_0x1ee421,_0x3dfdb2[_0xf974('0xf')][_0xf974('0x11')]);return _0x4c7b0a(_0x3dfdb2[_0xf974('0xf')]['message']);}logger[_0xf974('0xf')](_0xf974('0x10'),_0x1ee421,_0x3dfdb2[_0xf974('0xf')]['message']);return _0x933f8f(_0x3dfdb2[_0xf974('0xf')]['message']);}else{logger[_0xf974('0xc')](_0xf974('0x10'),_0x1ee421,_0xf974('0xd'));_0x933f8f(_0x3dfdb2[_0xf974('0x12')][_0xf974('0x11')]);}})[_0xf974('0x13')](function(_0x1a7e51){logger[_0xf974('0xf')](_0xf974('0x10'),_0x1ee421,_0x1a7e51);_0x4c7b0a(_0x1a7e51);});});}exports[_0xf974('0x14')]=function(_0x1badf5){var _0xabcda1=this;return new Promise(function(_0x5e78f3,_0x4c5cd1){return db[_0xf974('0x15')][_0xf974('0x16')]({'raw':_0x1badf5[_0xf974('0x17')]?_0x1badf5['options'][_0xf974('0x18')]===undefined?!![]:![]:!![],'where':_0x1badf5[_0xf974('0x17')]?_0x1badf5[_0xf974('0x17')][_0xf974('0x19')]||null:null,'attributes':_0x1badf5[_0xf974('0x17')]?_0x1badf5[_0xf974('0x17')][_0xf974('0x1a')]||null:null,'include':_0x1badf5['options']?_0x1badf5['options'][_0xf974('0x1b')]?_[_0xf974('0x1c')](_0x1badf5[_0xf974('0x17')][_0xf974('0x1b')],function(_0x939e9){return{'model':db[_0x939e9[_0xf974('0x1d')]],'as':_0x939e9['as'],'attributes':_0x939e9[_0xf974('0x1a')],'include':_0x939e9[_0xf974('0x1b')]?_[_0xf974('0x1c')](_0x939e9[_0xf974('0x1b')],function(_0x123761){return{'model':db[_0x123761['model']],'as':_0x123761['as'],'attributes':_0x123761['attributes'],'include':_0x123761[_0xf974('0x1b')]?_[_0xf974('0x1c')](_0x123761[_0xf974('0x1b')],function(_0x2baa78){return{'model':db[_0x2baa78['model']],'as':_0x2baa78['as'],'attributes':_0x2baa78[_0xf974('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x31b7b7){logger['info']('ShowWhatsappAccount',_0x1badf5);logger[_0xf974('0x1e')](_0xf974('0x14'),_0x1badf5,JSON['stringify'](_0x31b7b7));_0x5e78f3(_0x31b7b7);})[_0xf974('0x13')](function(_0x42ceca){logger[_0xf974('0xf')](_0xf974('0x14'),_0x42ceca[_0xf974('0x11')],_0x1badf5);_0x4c5cd1(_0xabcda1[_0xf974('0xf')](0x1f4,_0x42ceca[_0xf974('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index 9ff8496..c1465ee 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 _0xecc8=['remove','emit','removeListener','length','whatsappAccount:'];(function(_0x1c470d,_0x81d66b){var _0x12141b=function(_0x45bfd3){while(--_0x45bfd3){_0x1c470d['push'](_0x1c470d['shift']());}};_0x12141b(++_0x81d66b);}(_0xecc8,0x18b));var _0x8ecc=function(_0xcf9899,_0x24633e){_0xcf9899=_0xcf9899-0x0;var _0x1937c4=_0xecc8[_0xcf9899];return _0x1937c4;};'use strict';var WhatsappAccountEvents=require('./whatsappAccount.events');var events=['save',_0x8ecc('0x0'),'update'];function createListener(_0x3ad579,_0x3a998f){return function(_0x2cd63e){_0x3a998f[_0x8ecc('0x1')](_0x3ad579,_0x2cd63e);};}function removeListener(_0x5b286e,_0x218389){return function(){WhatsappAccountEvents[_0x8ecc('0x2')](_0x5b286e,_0x218389);};}exports['register']=function(_0x3bebc5){for(var _0x10938d=0x0,_0x443b10=events[_0x8ecc('0x3')];_0x10938d<_0x443b10;_0x10938d++){var _0x5c29cc=events[_0x10938d];var _0x153c12=createListener(_0x8ecc('0x4')+_0x5c29cc,_0x3bebc5);WhatsappAccountEvents['on'](_0x5c29cc,_0x153c12);}}; \ No newline at end of file +var _0x1d09=['length','whatsappAccount:','./whatsappAccount.events','save','remove','register'];(function(_0x502c06,_0x3d5be6){var _0x4ae249=function(_0x3a724e){while(--_0x3a724e){_0x502c06['push'](_0x502c06['shift']());}};_0x4ae249(++_0x3d5be6);}(_0x1d09,0x140));var _0x91d0=function(_0x56fe98,_0x43dc16){_0x56fe98=_0x56fe98-0x0;var _0x212f4f=_0x1d09[_0x56fe98];return _0x212f4f;};'use strict';var WhatsappAccountEvents=require(_0x91d0('0x0'));var events=[_0x91d0('0x1'),_0x91d0('0x2'),'update'];function createListener(_0x46ee36,_0xc2ea4e){return function(_0x4c6904){_0xc2ea4e['emit'](_0x46ee36,_0x4c6904);};}function removeListener(_0x47f2d6,_0x21bc73){return function(){WhatsappAccountEvents['removeListener'](_0x47f2d6,_0x21bc73);};}exports[_0x91d0('0x3')]=function(_0x4ea283){for(var _0x3639eb=0x0,_0x3e69aa=events[_0x91d0('0x4')];_0x3639eb<_0x3e69aa;_0x3639eb++){var _0x4011df=events[_0x3639eb];var _0x390cb3=createListener(_0x91d0('0x5')+_0x4011df,_0x4ea283);WhatsappAccountEvents['on'](_0x4011df,_0x390cb3);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index 802d7c4..16791ce 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 _0x7f34=['delete','/:id','destroy','exports','multer','util','express','Router','fs-extra','./whatsappApplication.controller','get','isAuthenticated','index','show','post','create','put','update'];(function(_0x24b16e,_0x13bc57){var _0x468fdb=function(_0x542e97){while(--_0x542e97){_0x24b16e['push'](_0x24b16e['shift']());}};_0x468fdb(++_0x13bc57);}(_0x7f34,0xee));var _0x47f3=function(_0x2f74b9,_0x7e641f){_0x2f74b9=_0x2f74b9-0x0;var _0x242eb9=_0x7f34[_0x2f74b9];return _0x242eb9;};'use strict';var multer=require(_0x47f3('0x0'));var util=require(_0x47f3('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x47f3('0x2'));var router=express[_0x47f3('0x3')]();var fs_extra=require(_0x47f3('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x47f3('0x5'));router[_0x47f3('0x6')]('/',auth[_0x47f3('0x7')](),controller[_0x47f3('0x8')]);router[_0x47f3('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x47f3('0x9')]);router[_0x47f3('0xa')]('/',auth[_0x47f3('0x7')](),controller[_0x47f3('0xb')]);router[_0x47f3('0xc')]('/:id',auth['isAuthenticated'](),controller[_0x47f3('0xd')]);router[_0x47f3('0xe')](_0x47f3('0xf'),auth[_0x47f3('0x7')](),controller[_0x47f3('0x10')]);module[_0x47f3('0x11')]=router; \ No newline at end of file +var _0xf043=['get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappApplication.controller'];(function(_0x8ae98b,_0x155f88){var _0xc30bd4=function(_0x5ca462){while(--_0x5ca462){_0x8ae98b['push'](_0x8ae98b['shift']());}};_0xc30bd4(++_0x155f88);}(_0xf043,0xe8));var _0x3f04=function(_0x51b0dd,_0x1cb161){_0x51b0dd=_0x51b0dd-0x0;var _0x49a423=_0xf043[_0x51b0dd];return _0x49a423;};'use strict';var multer=require(_0x3f04('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x3f04('0x1'));var express=require('express');var router=express[_0x3f04('0x2')]();var fs_extra=require(_0x3f04('0x3'));var auth=require(_0x3f04('0x4'));var interaction=require(_0x3f04('0x5'));var config=require(_0x3f04('0x6'));var controller=require(_0x3f04('0x7'));router[_0x3f04('0x8')]('/',auth[_0x3f04('0x9')](),controller[_0x3f04('0xa')]);router[_0x3f04('0x8')](_0x3f04('0xb'),auth['isAuthenticated'](),controller[_0x3f04('0xc')]);router[_0x3f04('0xd')]('/',auth[_0x3f04('0x9')](),controller[_0x3f04('0xe')]);router[_0x3f04('0xf')](_0x3f04('0xb'),auth[_0x3f04('0x9')](),controller[_0x3f04('0x10')]);router[_0x3f04('0x11')](_0x3f04('0xb'),auth[_0x3f04('0x9')](),controller[_0x3f04('0x12')]);module[_0x3f04('0x13')]=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index f639e74..1a65771 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 _0xc610=['exports','INTEGER','TEXT','STRING'];(function(_0xbb7f97,_0x1aa2da){var _0x115d9b=function(_0x2f7608){while(--_0x2f7608){_0xbb7f97['push'](_0xbb7f97['shift']());}};_0x115d9b(++_0x1aa2da);}(_0xc610,0x140));var _0x0c61=function(_0x7b4397,_0x50ab04){_0x7b4397=_0x7b4397-0x0;var _0x16de0b=_0xc610[_0x7b4397];return _0x16de0b;};'use strict';var Sequelize=require('sequelize');module[_0x0c61('0x0')]={'priority':{'type':Sequelize[_0x0c61('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x0c61('0x2')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x0c61('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x01d1=['STRING','TEXT','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x13cd99,_0x50bd8d){var _0x1d42c7=function(_0x1fa433){while(--_0x1fa433){_0x13cd99['push'](_0x13cd99['shift']());}};_0x1d42c7(++_0x50bd8d);}(_0x01d1,0x189));var _0x101d=function(_0x4576fe,_0xdeb418){_0x4576fe=_0x4576fe-0x0;var _0x501123=_0x01d1[_0x4576fe];return _0x501123;};'use strict';var Sequelize=require(_0x101d('0x0'));module[_0x101d('0x1')]={'priority':{'type':Sequelize[_0x101d('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x101d('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x101d('0x4')]()},'description':{'type':Sequelize[_0x101d('0x3')]},'interval':{'type':Sequelize[_0x101d('0x3')],'defaultValue':_0x101d('0x5')}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index cf36d12..af37c90 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 _0xb2f3=['set','Content-Range','reject','save','update','destroy','then','name','send','map','WhatsappApplication','fieldName','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','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/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count'];(function(_0x61a5f6,_0x1bc817){var _0x295d16=function(_0x47f583){while(--_0x47f583){_0x61a5f6['push'](_0x61a5f6['shift']());}};_0x295d16(++_0x1bc817);}(_0xb2f3,0xfd));var _0x3b2f=function(_0x26462c,_0xd20a35){_0x26462c=_0x26462c-0x0;var _0x509a42=_0xb2f3[_0x26462c];return _0x509a42;};'use strict';var emlformat=require(_0x3b2f('0x0'));var rimraf=require(_0x3b2f('0x1'));var zipdir=require(_0x3b2f('0x2'));var jsonpatch=require(_0x3b2f('0x3'));var rp=require(_0x3b2f('0x4'));var moment=require(_0x3b2f('0x5'));var BPromise=require(_0x3b2f('0x6'));var Mustache=require('mustache');var util=require(_0x3b2f('0x7'));var path=require(_0x3b2f('0x8'));var sox=require(_0x3b2f('0x9'));var csv=require(_0x3b2f('0xa'));var ejs=require(_0x3b2f('0xb'));var fs=require('fs');var fs_extra=require(_0x3b2f('0xc'));var _=require(_0x3b2f('0xd'));var squel=require('squel');var crypto=require(_0x3b2f('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x3b2f('0xf'));var toCsv=require(_0x3b2f('0xa'));var querystring=require(_0x3b2f('0x10'));var Papa=require(_0x3b2f('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3b2f('0x12'));var as=require(_0x3b2f('0x13'));var hardwareService=require(_0x3b2f('0x14'));var logger=require(_0x3b2f('0x15'))(_0x3b2f('0x16'));var utils=require(_0x3b2f('0x17'));var config=require(_0x3b2f('0x18'));var licenseUtil=require(_0x3b2f('0x19'));var db=require(_0x3b2f('0x1a'))['db'];function respondWithStatusCode(_0x322dda,_0x458f93){_0x458f93=_0x458f93||0xcc;return function(_0x2a9d0e){if(_0x2a9d0e){return _0x322dda[_0x3b2f('0x1b')](_0x458f93);}return _0x322dda[_0x3b2f('0x1c')](_0x458f93)[_0x3b2f('0x1d')]();};}function respondWithResult(_0x4fb033,_0x3f1015){_0x3f1015=_0x3f1015||0xc8;return function(_0x4da3bd){if(_0x4da3bd){return _0x4fb033[_0x3b2f('0x1c')](_0x3f1015)[_0x3b2f('0x1e')](_0x4da3bd);}};}function respondWithFilteredResult(_0x525978,_0x241937){return function(_0x4c028a){if(_0x4c028a){var _0x3c0b3f=typeof _0x241937[_0x3b2f('0x1f')]===_0x3b2f('0x20')&&typeof _0x241937[_0x3b2f('0x21')]==='undefined';var _0x52e91d=_0x4c028a[_0x3b2f('0x22')];var _0x6d8948=_0x3c0b3f?0x0:_0x241937[_0x3b2f('0x1f')];var _0x3040d3=_0x3c0b3f?_0x4c028a[_0x3b2f('0x22')]:_0x241937[_0x3b2f('0x1f')]+_0x241937[_0x3b2f('0x21')];var _0x3d94c0;if(_0x3040d3>=_0x52e91d){_0x3040d3=_0x52e91d;_0x3d94c0=0xc8;}else{_0x3d94c0=0xce;}_0x525978[_0x3b2f('0x1c')](_0x3d94c0);return _0x525978[_0x3b2f('0x23')](_0x3b2f('0x24'),_0x6d8948+'-'+_0x3040d3+'/'+_0x52e91d)[_0x3b2f('0x1e')](_0x4c028a);}return null;};}function patchUpdates(_0x1688f4){return function(_0x2deb04){try{jsonpatch['apply'](_0x2deb04,_0x1688f4,!![]);}catch(_0x6fdf3f){return BPromise[_0x3b2f('0x25')](_0x6fdf3f);}return _0x2deb04[_0x3b2f('0x26')]();};}function saveUpdates(_0xef73a0,_0x57e96a){return function(_0x1476a0){if(_0x1476a0){return _0x1476a0[_0x3b2f('0x27')](_0xef73a0)['then'](function(_0x429649){return _0x429649;});}return null;};}function removeEntity(_0x49b9ab,_0x28ef68){return function(_0x94aced){if(_0x94aced){return _0x94aced[_0x3b2f('0x28')]()[_0x3b2f('0x29')](function(){_0x49b9ab['status'](0xcc)[_0x3b2f('0x1d')]();});}};}function handleEntityNotFound(_0x2ee755,_0x48592c){return function(_0x4db72f){if(!_0x4db72f){_0x2ee755[_0x3b2f('0x1b')](0x194);}return _0x4db72f;};}function handleError(_0x44fa57,_0x9cf807){_0x9cf807=_0x9cf807||0x1f4;return function(_0x2ca527){logger['error'](_0x2ca527['stack']);if(_0x2ca527[_0x3b2f('0x2a')]){delete _0x2ca527[_0x3b2f('0x2a')];}_0x44fa57[_0x3b2f('0x1c')](_0x9cf807)[_0x3b2f('0x2b')](_0x2ca527);};}exports['index']=function(_0x39f342,_0x4b76ea){var _0x30d504={},_0x21c8a4={},_0x171f99={'count':0x0,'rows':[]};var _0x469fc9=_[_0x3b2f('0x2c')](db[_0x3b2f('0x2d')]['rawAttributes'],function(_0x1fbcb6){return{'name':_0x1fbcb6[_0x3b2f('0x2e')],'type':_0x1fbcb6['type']['key']};});_0x21c8a4[_0x3b2f('0x2f')]=_[_0x3b2f('0x2c')](_0x469fc9,'name');_0x21c8a4['query']=_[_0x3b2f('0x30')](_0x39f342[_0x3b2f('0x31')]);_0x21c8a4[_0x3b2f('0x32')]=_[_0x3b2f('0x33')](_0x21c8a4[_0x3b2f('0x2f')],_0x21c8a4[_0x3b2f('0x31')]);_0x30d504['attributes']=_[_0x3b2f('0x33')](_0x21c8a4[_0x3b2f('0x2f')],qs['fields'](_0x39f342[_0x3b2f('0x31')][_0x3b2f('0x34')]));_0x30d504[_0x3b2f('0x35')]=_0x30d504[_0x3b2f('0x35')]['length']?_0x30d504[_0x3b2f('0x35')]:_0x21c8a4[_0x3b2f('0x2f')];if(!_0x39f342[_0x3b2f('0x31')][_0x3b2f('0x36')]('nolimit')){_0x30d504['limit']=qs[_0x3b2f('0x21')](_0x39f342[_0x3b2f('0x31')][_0x3b2f('0x21')]);_0x30d504[_0x3b2f('0x1f')]=qs[_0x3b2f('0x1f')](_0x39f342['query']['offset']);}_0x30d504[_0x3b2f('0x37')]=qs[_0x3b2f('0x38')](_0x39f342[_0x3b2f('0x31')]['sort']);_0x30d504[_0x3b2f('0x39')]=qs[_0x3b2f('0x32')](_[_0x3b2f('0x3a')](_0x39f342['query'],_0x21c8a4[_0x3b2f('0x32')]),_0x469fc9);if(_0x39f342[_0x3b2f('0x31')][_0x3b2f('0x3b')]){_0x30d504['where']=_['merge'](_0x30d504[_0x3b2f('0x39')],{'$or':_['map'](_0x469fc9,function(_0x508ad5){if(_0x508ad5[_0x3b2f('0x3c')]!==_0x3b2f('0x3d')){var _0x4ac830={};_0x4ac830[_0x508ad5[_0x3b2f('0x2a')]]={'$like':'%'+_0x39f342[_0x3b2f('0x31')][_0x3b2f('0x3b')]+'%'};return _0x4ac830;}})});}_0x30d504=_[_0x3b2f('0x3e')]({},_0x30d504,_0x39f342[_0x3b2f('0x3f')]);var _0xad28b3={'where':_0x30d504[_0x3b2f('0x39')]};return db[_0x3b2f('0x2d')]['count'](_0xad28b3)[_0x3b2f('0x29')](function(_0x321d43){_0x171f99[_0x3b2f('0x22')]=_0x321d43;if(_0x39f342[_0x3b2f('0x31')][_0x3b2f('0x40')]){_0x30d504[_0x3b2f('0x41')]=[{'all':!![]}];}return db[_0x3b2f('0x2d')][_0x3b2f('0x42')](_0x30d504);})[_0x3b2f('0x29')](function(_0x507813){_0x171f99[_0x3b2f('0x43')]=_0x507813;return _0x171f99;})[_0x3b2f('0x29')](respondWithFilteredResult(_0x4b76ea,_0x30d504))[_0x3b2f('0x44')](handleError(_0x4b76ea,null));};exports['show']=function(_0x2e6258,_0x4a2cdd){var _0xe84703={'raw':!![],'where':{'id':_0x2e6258[_0x3b2f('0x45')]['id']}},_0x23b747={};_0x23b747[_0x3b2f('0x2f')]=_[_0x3b2f('0x30')](db[_0x3b2f('0x2d')]['rawAttributes']);_0x23b747[_0x3b2f('0x31')]=_['keys'](_0x2e6258[_0x3b2f('0x31')]);_0x23b747[_0x3b2f('0x32')]=_['intersection'](_0x23b747[_0x3b2f('0x2f')],_0x23b747[_0x3b2f('0x31')]);_0xe84703[_0x3b2f('0x35')]=_[_0x3b2f('0x33')](_0x23b747[_0x3b2f('0x2f')],qs['fields'](_0x2e6258['query'][_0x3b2f('0x34')]));_0xe84703['attributes']=_0xe84703[_0x3b2f('0x35')]['length']?_0xe84703[_0x3b2f('0x35')]:_0x23b747[_0x3b2f('0x2f')];if(_0x2e6258[_0x3b2f('0x31')][_0x3b2f('0x40')]){_0xe84703['include']=[{'all':!![]}];}_0xe84703=_[_0x3b2f('0x3e')]({},_0xe84703,_0x2e6258[_0x3b2f('0x3f')]);return db[_0x3b2f('0x2d')]['find'](_0xe84703)[_0x3b2f('0x29')](handleEntityNotFound(_0x4a2cdd,null))[_0x3b2f('0x29')](respondWithResult(_0x4a2cdd,null))[_0x3b2f('0x44')](handleError(_0x4a2cdd,null));};exports[_0x3b2f('0x46')]=function(_0x5e6666,_0x267af4){return db[_0x3b2f('0x2d')][_0x3b2f('0x46')](_0x5e6666[_0x3b2f('0x47')],{})[_0x3b2f('0x29')](respondWithResult(_0x267af4,0xc9))[_0x3b2f('0x44')](handleError(_0x267af4,null));};exports[_0x3b2f('0x27')]=function(_0x2e182e,_0x56be24){if(_0x2e182e[_0x3b2f('0x47')]['id']){delete _0x2e182e[_0x3b2f('0x47')]['id'];}return db['WhatsappApplication']['find']({'where':{'id':_0x2e182e['params']['id']}})[_0x3b2f('0x29')](handleEntityNotFound(_0x56be24,null))[_0x3b2f('0x29')](saveUpdates(_0x2e182e[_0x3b2f('0x47')],null))[_0x3b2f('0x29')](respondWithResult(_0x56be24,null))['catch'](handleError(_0x56be24,null));};exports[_0x3b2f('0x28')]=function(_0x67a4c0,_0x5c98c6){return db['WhatsappApplication']['find']({'where':{'id':_0x67a4c0[_0x3b2f('0x45')]['id']}})[_0x3b2f('0x29')](handleEntityNotFound(_0x5c98c6,null))['then'](removeEntity(_0x5c98c6,null))['catch'](handleError(_0x5c98c6,null));}; \ No newline at end of file +var _0xa467=['hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','show','params','rawAttributes','find','create','body','catch','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','save','then','destroy','error','stack','name','send','index','WhatsappApplication','fieldName','type','key','model','map','keys','query','filters','attributes','intersection','fields','length'];(function(_0x4a9cfa,_0x40c434){var _0x95872f=function(_0x2b1cb2){while(--_0x2b1cb2){_0x4a9cfa['push'](_0x4a9cfa['shift']());}};_0x95872f(++_0x40c434);}(_0xa467,0x143));var _0x7a46=function(_0x402506,_0x34ab7c){_0x402506=_0x402506-0x0;var _0x4699c7=_0xa467[_0x402506];return _0x4699c7;};'use strict';var emlformat=require(_0x7a46('0x0'));var rimraf=require(_0x7a46('0x1'));var zipdir=require(_0x7a46('0x2'));var jsonpatch=require(_0x7a46('0x3'));var rp=require(_0x7a46('0x4'));var moment=require(_0x7a46('0x5'));var BPromise=require(_0x7a46('0x6'));var Mustache=require(_0x7a46('0x7'));var util=require(_0x7a46('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x7a46('0x9'));var ejs=require(_0x7a46('0xa'));var fs=require('fs');var fs_extra=require(_0x7a46('0xb'));var _=require(_0x7a46('0xc'));var squel=require(_0x7a46('0xd'));var crypto=require('crypto');var jsforce=require(_0x7a46('0xe'));var deskjs=require(_0x7a46('0xf'));var toCsv=require(_0x7a46('0x9'));var querystring=require(_0x7a46('0x10'));var Papa=require(_0x7a46('0x11'));var Redis=require(_0x7a46('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x7a46('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7a46('0x14'));var logger=require('../../config/logger')(_0x7a46('0x15'));var utils=require(_0x7a46('0x16'));var config=require(_0x7a46('0x17'));var licenseUtil=require(_0x7a46('0x18'));var db=require(_0x7a46('0x19'))['db'];function respondWithStatusCode(_0x5da2d3,_0x3ab309){_0x3ab309=_0x3ab309||0xcc;return function(_0x5fa58a){if(_0x5fa58a){return _0x5da2d3[_0x7a46('0x1a')](_0x3ab309);}return _0x5da2d3[_0x7a46('0x1b')](_0x3ab309)[_0x7a46('0x1c')]();};}function respondWithResult(_0x571a46,_0x78220){_0x78220=_0x78220||0xc8;return function(_0x53fd6a){if(_0x53fd6a){return _0x571a46['status'](_0x78220)[_0x7a46('0x1d')](_0x53fd6a);}};}function respondWithFilteredResult(_0x30acd7,_0x5e4f9d){return function(_0x32d58d){if(_0x32d58d){var _0x50704f=typeof _0x5e4f9d[_0x7a46('0x1e')]===_0x7a46('0x1f')&&typeof _0x5e4f9d['limit']===_0x7a46('0x1f');var _0x548cab=_0x32d58d[_0x7a46('0x20')];var _0x3aa0ad=_0x50704f?0x0:_0x5e4f9d[_0x7a46('0x1e')];var _0x279fc8=_0x50704f?_0x32d58d['count']:_0x5e4f9d[_0x7a46('0x1e')]+_0x5e4f9d[_0x7a46('0x21')];var _0x4b96d2;if(_0x279fc8>=_0x548cab){_0x279fc8=_0x548cab;_0x4b96d2=0xc8;}else{_0x4b96d2=0xce;}_0x30acd7[_0x7a46('0x1b')](_0x4b96d2);return _0x30acd7[_0x7a46('0x22')]('Content-Range',_0x3aa0ad+'-'+_0x279fc8+'/'+_0x548cab)['json'](_0x32d58d);}return null;};}function patchUpdates(_0x2cb5b3){return function(_0x1d5766){try{jsonpatch[_0x7a46('0x23')](_0x1d5766,_0x2cb5b3,!![]);}catch(_0x23d54e){return BPromise['reject'](_0x23d54e);}return _0x1d5766[_0x7a46('0x24')]();};}function saveUpdates(_0x2dc8cc,_0x5e9cb5){return function(_0x536e54){if(_0x536e54){return _0x536e54['update'](_0x2dc8cc)[_0x7a46('0x25')](function(_0x99c7ab){return _0x99c7ab;});}return null;};}function removeEntity(_0x57b669,_0x46512d){return function(_0x4b104b){if(_0x4b104b){return _0x4b104b[_0x7a46('0x26')]()[_0x7a46('0x25')](function(){_0x57b669['status'](0xcc)[_0x7a46('0x1c')]();});}};}function handleEntityNotFound(_0x1222ae,_0x107fff){return function(_0x3d9ae4){if(!_0x3d9ae4){_0x1222ae[_0x7a46('0x1a')](0x194);}return _0x3d9ae4;};}function handleError(_0x42f852,_0x27f001){_0x27f001=_0x27f001||0x1f4;return function(_0x595c66){logger[_0x7a46('0x27')](_0x595c66[_0x7a46('0x28')]);if(_0x595c66[_0x7a46('0x29')]){delete _0x595c66[_0x7a46('0x29')];}_0x42f852[_0x7a46('0x1b')](_0x27f001)[_0x7a46('0x2a')](_0x595c66);};}exports[_0x7a46('0x2b')]=function(_0x4d2b68,_0x1c276b){var _0x27b243={},_0x3b35dd={},_0xca2b9b={'count':0x0,'rows':[]};var _0x2b9500=_['map'](db[_0x7a46('0x2c')]['rawAttributes'],function(_0x5b423f){return{'name':_0x5b423f[_0x7a46('0x2d')],'type':_0x5b423f[_0x7a46('0x2e')][_0x7a46('0x2f')]};});_0x3b35dd[_0x7a46('0x30')]=_[_0x7a46('0x31')](_0x2b9500,'name');_0x3b35dd['query']=_[_0x7a46('0x32')](_0x4d2b68[_0x7a46('0x33')]);_0x3b35dd[_0x7a46('0x34')]=_['intersection'](_0x3b35dd[_0x7a46('0x30')],_0x3b35dd[_0x7a46('0x33')]);_0x27b243[_0x7a46('0x35')]=_[_0x7a46('0x36')](_0x3b35dd[_0x7a46('0x30')],qs[_0x7a46('0x37')](_0x4d2b68[_0x7a46('0x33')][_0x7a46('0x37')]));_0x27b243[_0x7a46('0x35')]=_0x27b243[_0x7a46('0x35')][_0x7a46('0x38')]?_0x27b243[_0x7a46('0x35')]:_0x3b35dd[_0x7a46('0x30')];if(!_0x4d2b68[_0x7a46('0x33')][_0x7a46('0x39')](_0x7a46('0x3a'))){_0x27b243['limit']=qs['limit'](_0x4d2b68[_0x7a46('0x33')][_0x7a46('0x21')]);_0x27b243[_0x7a46('0x1e')]=qs[_0x7a46('0x1e')](_0x4d2b68['query'][_0x7a46('0x1e')]);}_0x27b243[_0x7a46('0x3b')]=qs['sort'](_0x4d2b68[_0x7a46('0x33')][_0x7a46('0x3c')]);_0x27b243[_0x7a46('0x3d')]=qs['filters'](_['pick'](_0x4d2b68[_0x7a46('0x33')],_0x3b35dd[_0x7a46('0x34')]),_0x2b9500);if(_0x4d2b68[_0x7a46('0x33')][_0x7a46('0x3e')]){_0x27b243[_0x7a46('0x3d')]=_[_0x7a46('0x3f')](_0x27b243[_0x7a46('0x3d')],{'$or':_['map'](_0x2b9500,function(_0x517054){if(_0x517054[_0x7a46('0x2e')]!==_0x7a46('0x40')){var _0x50233e={};_0x50233e[_0x517054[_0x7a46('0x29')]]={'$like':'%'+_0x4d2b68[_0x7a46('0x33')][_0x7a46('0x3e')]+'%'};return _0x50233e;}})});}_0x27b243=_[_0x7a46('0x3f')]({},_0x27b243,_0x4d2b68[_0x7a46('0x41')]);var _0x3630a2={'where':_0x27b243[_0x7a46('0x3d')]};return db[_0x7a46('0x2c')][_0x7a46('0x20')](_0x3630a2)['then'](function(_0x332ba0){_0xca2b9b[_0x7a46('0x20')]=_0x332ba0;if(_0x4d2b68[_0x7a46('0x33')][_0x7a46('0x42')]){_0x27b243[_0x7a46('0x43')]=[{'all':!![]}];}return db[_0x7a46('0x2c')]['findAll'](_0x27b243);})[_0x7a46('0x25')](function(_0x328d25){_0xca2b9b['rows']=_0x328d25;return _0xca2b9b;})[_0x7a46('0x25')](respondWithFilteredResult(_0x1c276b,_0x27b243))['catch'](handleError(_0x1c276b,null));};exports[_0x7a46('0x44')]=function(_0x3776a3,_0xf75969){var _0x3df66b={'raw':!![],'where':{'id':_0x3776a3[_0x7a46('0x45')]['id']}},_0x221c29={};_0x221c29[_0x7a46('0x30')]=_['keys'](db[_0x7a46('0x2c')][_0x7a46('0x46')]);_0x221c29[_0x7a46('0x33')]=_['keys'](_0x3776a3[_0x7a46('0x33')]);_0x221c29[_0x7a46('0x34')]=_[_0x7a46('0x36')](_0x221c29['model'],_0x221c29[_0x7a46('0x33')]);_0x3df66b[_0x7a46('0x35')]=_[_0x7a46('0x36')](_0x221c29[_0x7a46('0x30')],qs['fields'](_0x3776a3['query'][_0x7a46('0x37')]));_0x3df66b[_0x7a46('0x35')]=_0x3df66b[_0x7a46('0x35')][_0x7a46('0x38')]?_0x3df66b['attributes']:_0x221c29[_0x7a46('0x30')];if(_0x3776a3[_0x7a46('0x33')][_0x7a46('0x42')]){_0x3df66b[_0x7a46('0x43')]=[{'all':!![]}];}_0x3df66b=_[_0x7a46('0x3f')]({},_0x3df66b,_0x3776a3['options']);return db[_0x7a46('0x2c')][_0x7a46('0x47')](_0x3df66b)['then'](handleEntityNotFound(_0xf75969,null))[_0x7a46('0x25')](respondWithResult(_0xf75969,null))['catch'](handleError(_0xf75969,null));};exports['create']=function(_0xb60717,_0x54f129){return db['WhatsappApplication'][_0x7a46('0x48')](_0xb60717[_0x7a46('0x49')],{})[_0x7a46('0x25')](respondWithResult(_0x54f129,0xc9))[_0x7a46('0x4a')](handleError(_0x54f129,null));};exports[_0x7a46('0x4b')]=function(_0x1bb3cb,_0xafef25){if(_0x1bb3cb[_0x7a46('0x49')]['id']){delete _0x1bb3cb[_0x7a46('0x49')]['id'];}return db[_0x7a46('0x2c')][_0x7a46('0x47')]({'where':{'id':_0x1bb3cb[_0x7a46('0x45')]['id']}})[_0x7a46('0x25')](handleEntityNotFound(_0xafef25,null))[_0x7a46('0x25')](saveUpdates(_0x1bb3cb[_0x7a46('0x49')],null))['then'](respondWithResult(_0xafef25,null))[_0x7a46('0x4a')](handleError(_0xafef25,null));};exports[_0x7a46('0x26')]=function(_0x4f7e87,_0x498275){return db[_0x7a46('0x2c')][_0x7a46('0x47')]({'where':{'id':_0x4f7e87['params']['id']}})[_0x7a46('0x25')](handleEntityNotFound(_0x498275,null))[_0x7a46('0x25')](removeEntity(_0x498275,null))[_0x7a46('0x4a')](handleError(_0x498275,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index f261b64..18f11c5 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 _0x8a9c=['utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./whatsappApplication.attributes','exports','define','WhatsappApplication','whatsapp_applications','utf8mb4'];(function(_0x33d214,_0x277a8e){var _0x1b36d1=function(_0x2446f8){while(--_0x2446f8){_0x33d214['push'](_0x33d214['shift']());}};_0x1b36d1(++_0x277a8e);}(_0x8a9c,0x12d));var _0xc8a9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8a9c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc8a9('0x0'));var util=require(_0xc8a9('0x1'));var logger=require(_0xc8a9('0x2'))(_0xc8a9('0x3'));var moment=require(_0xc8a9('0x4'));var BPromise=require('bluebird');var rp=require(_0xc8a9('0x5'));var fs=require('fs');var path=require(_0xc8a9('0x6'));var rimraf=require('rimraf');var config=require(_0xc8a9('0x7'));var attributes=require(_0xc8a9('0x8'));module[_0xc8a9('0x9')]=function(_0x4c1e04,_0xb4340b){return _0x4c1e04[_0xc8a9('0xa')](_0xc8a9('0xb'),attributes,{'tableName':_0xc8a9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc8a9('0xd'),'collate':_0xc8a9('0xe')});}; \ No newline at end of file +var _0x46fc=['WhatsappApplication','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','define'];(function(_0x3f8333,_0x5bfdc1){var _0x5b2cf8=function(_0x100250){while(--_0x100250){_0x3f8333['push'](_0x3f8333['shift']());}};_0x5b2cf8(++_0x5bfdc1);}(_0x46fc,0x103));var _0xc46f=function(_0x470d21,_0x990b34){_0x470d21=_0x470d21-0x0;var _0x34d960=_0x46fc[_0x470d21];return _0x34d960;};'use strict';var _=require(_0xc46f('0x0'));var util=require(_0xc46f('0x1'));var logger=require(_0xc46f('0x2'))(_0xc46f('0x3'));var moment=require(_0xc46f('0x4'));var BPromise=require(_0xc46f('0x5'));var rp=require(_0xc46f('0x6'));var fs=require('fs');var path=require(_0xc46f('0x7'));var rimraf=require(_0xc46f('0x8'));var config=require('../../config/environment');var attributes=require('./whatsappApplication.attributes');module[_0xc46f('0x9')]=function(_0x176c6f,_0x30ca8d){return _0x176c6f[_0xc46f('0xa')](_0xc46f('0xb'),attributes,{'tableName':_0xc46f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc46f('0xd'),'collate':_0xc46f('0xe')});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index 7475254..4ee0053 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 _0xb458=['WhatsappApplication,\x20%s,\x20%s,\x20%s','code','error','message','request\x20sent','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','then','info','WhatsappApplication,\x20%s,\x20%s','debug'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0xb458,0x103));var _0x8b45=function(_0x306626,_0x425e93){_0x306626=_0x306626-0x0;var _0x466728=_0xb458[_0x306626];return _0x466728;};'use strict';var _=require(_0x8b45('0x0'));var util=require(_0x8b45('0x1'));var moment=require(_0x8b45('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8b45('0x3'));var db=require(_0x8b45('0x4'))['db'];var utils=require(_0x8b45('0x5'));var logger=require(_0x8b45('0x6'))('rpc');var config=require(_0x8b45('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8b45('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x12bd05,_0x2daa9a,_0x3a8ccb){return new BPromise(function(_0x32342f,_0x4d1718){return client[_0x8b45('0x9')](_0x12bd05,_0x3a8ccb)[_0x8b45('0xa')](function(_0x33f30e){logger[_0x8b45('0xb')](_0x8b45('0xc'),_0x2daa9a,'request\x20sent');logger[_0x8b45('0xd')](_0x8b45('0xe'),_0x2daa9a,'request\x20sent',JSON['stringify'](_0x33f30e));if(_0x33f30e['error']){if(_0x33f30e['error'][_0x8b45('0xf')]===0x1f4){logger[_0x8b45('0x10')](_0x8b45('0xc'),_0x2daa9a,_0x33f30e['error'][_0x8b45('0x11')]);return _0x4d1718(_0x33f30e[_0x8b45('0x10')][_0x8b45('0x11')]);}logger[_0x8b45('0x10')](_0x8b45('0xc'),_0x2daa9a,_0x33f30e[_0x8b45('0x10')]['message']);return _0x32342f(_0x33f30e['error'][_0x8b45('0x11')]);}else{logger[_0x8b45('0xb')](_0x8b45('0xc'),_0x2daa9a,_0x8b45('0x12'));_0x32342f(_0x33f30e[_0x8b45('0x13')][_0x8b45('0x11')]);}})[_0x8b45('0x14')](function(_0x147d6b){logger[_0x8b45('0x10')](_0x8b45('0xc'),_0x2daa9a,_0x147d6b);_0x4d1718(_0x147d6b);});});} \ No newline at end of file +var _0x24ca=['request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','WhatsappApplication,\x20%s,\x20%s'];(function(_0x512679,_0x13a4d5){var _0x3ea076=function(_0x2e260f){while(--_0x2e260f){_0x512679['push'](_0x512679['shift']());}};_0x3ea076(++_0x13a4d5);}(_0x24ca,0x1bc));var _0xa24c=function(_0x5948dd,_0x1f6ac8){_0x5948dd=_0x5948dd-0x0;var _0xb1f8be=_0x24ca[_0x5948dd];return _0xb1f8be;};'use strict';var _=require(_0xa24c('0x0'));var util=require('util');var moment=require(_0xa24c('0x1'));var BPromise=require(_0xa24c('0x2'));var rs=require(_0xa24c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa24c('0x4'))['db'];var utils=require(_0xa24c('0x5'));var logger=require(_0xa24c('0x6'))(_0xa24c('0x7'));var config=require(_0xa24c('0x8'));var jayson=require(_0xa24c('0x9'));var client=jayson[_0xa24c('0xa')][_0xa24c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2dd348,_0x257264,_0x9a5013){return new BPromise(function(_0x481196,_0x42d89c){return client[_0xa24c('0xc')](_0x2dd348,_0x9a5013)[_0xa24c('0xd')](function(_0x5eac78){logger[_0xa24c('0xe')](_0xa24c('0xf'),_0x257264,_0xa24c('0x10'));logger[_0xa24c('0x11')](_0xa24c('0x12'),_0x257264,_0xa24c('0x10'),JSON[_0xa24c('0x13')](_0x5eac78));if(_0x5eac78[_0xa24c('0x14')]){if(_0x5eac78[_0xa24c('0x14')]['code']===0x1f4){logger[_0xa24c('0x14')](_0xa24c('0xf'),_0x257264,_0x5eac78[_0xa24c('0x14')][_0xa24c('0x15')]);return _0x42d89c(_0x5eac78['error'][_0xa24c('0x15')]);}logger[_0xa24c('0x14')](_0xa24c('0xf'),_0x257264,_0x5eac78[_0xa24c('0x14')][_0xa24c('0x15')]);return _0x481196(_0x5eac78[_0xa24c('0x14')][_0xa24c('0x15')]);}else{logger['info']('WhatsappApplication,\x20%s,\x20%s',_0x257264,_0xa24c('0x10'));_0x481196(_0x5eac78[_0xa24c('0x16')]['message']);}})['catch'](function(_0x221d21){logger[_0xa24c('0x14')]('WhatsappApplication,\x20%s,\x20%s',_0x257264,_0x221d21);_0x42d89c(_0x221d21);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index 40e327e..49150b3 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 _0xdc97=['/:id/download','download','post','/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','put','whatsappinteraction:update','update','delete','whatsappinteraction:destroy','destroy','removeTags','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../config/environment','./whatsappInteraction.controller','get','isAuthenticated','describe','/:id','show','/:id/messages','getMessages'];(function(_0x1c4fb7,_0x43e396){var _0x44a872=function(_0x4fc74d){while(--_0x4fc74d){_0x1c4fb7['push'](_0x1c4fb7['shift']());}};_0x44a872(++_0x43e396);}(_0xdc97,0x13b));var _0x7dc9=function(_0x562614,_0x27b8bb){_0x562614=_0x562614-0x0;var _0x3899b3=_0xdc97[_0x562614];return _0x3899b3;};'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')]('/',auth[_0x7dc9('0x9')](),controller['index']);router[_0x7dc9('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x7dc9('0xa')]);router[_0x7dc9('0x8')](_0x7dc9('0xb'),auth[_0x7dc9('0x9')](),controller[_0x7dc9('0xc')]);router['get'](_0x7dc9('0xd'),auth[_0x7dc9('0x9')](),controller[_0x7dc9('0xe')]);router[_0x7dc9('0x8')](_0x7dc9('0xf'),auth[_0x7dc9('0x9')](),controller[_0x7dc9('0x10')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x7dc9('0xd'),auth[_0x7dc9('0x9')](),controller['addMessage']);router[_0x7dc9('0x11')](_0x7dc9('0x12'),auth[_0x7dc9('0x9')](),interaction[_0x7dc9('0x13')](_0x7dc9('0x14'),_0x7dc9('0x15')),controller['addTags']);router[_0x7dc9('0x16')](_0x7dc9('0xb'),auth[_0x7dc9('0x9')](),interaction[_0x7dc9('0x13')](_0x7dc9('0x14'),_0x7dc9('0x17')),controller[_0x7dc9('0x18')]);router[_0x7dc9('0x19')](_0x7dc9('0xb'),auth['isAuthenticated'](),interaction[_0x7dc9('0x13')]('whatsapp',_0x7dc9('0x1a')),controller[_0x7dc9('0x1b')]);router['delete'](_0x7dc9('0x12'),auth[_0x7dc9('0x9')](),controller[_0x7dc9('0x1c')]);module[_0x7dc9('0x1d')]=router; \ No newline at end of file +var _0x5d58=['create','/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','addTags','whatsappinteraction:update','update','delete','whatsappinteraction:destroy','destroy','removeTags','exports','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','/:id/messages','/:id/download','download','post'];(function(_0x3cd8be,_0x6f80d7){var _0x4ff4c9=function(_0x1c218e){while(--_0x1c218e){_0x3cd8be['push'](_0x3cd8be['shift']());}};_0x4ff4c9(++_0x6f80d7);}(_0x5d58,0x187));var _0x85d5=function(_0x490355,_0x48e7f3){_0x490355=_0x490355-0x0;var _0x42618d=_0x5d58[_0x490355];return _0x42618d;};'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[_0x85d5('0x0')]();var fs_extra=require(_0x85d5('0x1'));var auth=require('../../components/auth/service');var interaction=require(_0x85d5('0x2'));var config=require(_0x85d5('0x3'));var controller=require('./whatsappInteraction.controller');router[_0x85d5('0x4')]('/',auth[_0x85d5('0x5')](),controller[_0x85d5('0x6')]);router[_0x85d5('0x4')]('/describe',auth[_0x85d5('0x5')](),controller[_0x85d5('0x7')]);router['get'](_0x85d5('0x8'),auth['isAuthenticated'](),controller[_0x85d5('0x9')]);router[_0x85d5('0x4')](_0x85d5('0xa'),auth['isAuthenticated'](),controller['getMessages']);router['get'](_0x85d5('0xb'),auth[_0x85d5('0x5')](),controller[_0x85d5('0xc')]);router[_0x85d5('0xd')]('/',auth[_0x85d5('0x5')](),controller[_0x85d5('0xe')]);router[_0x85d5('0xd')]('/:id/messages',auth['isAuthenticated'](),controller['addMessage']);router[_0x85d5('0xd')](_0x85d5('0xf'),auth[_0x85d5('0x5')](),interaction[_0x85d5('0x10')](_0x85d5('0x11'),_0x85d5('0x12')),controller[_0x85d5('0x13')]);router['put'](_0x85d5('0x8'),auth[_0x85d5('0x5')](),interaction[_0x85d5('0x10')](_0x85d5('0x11'),_0x85d5('0x14')),controller[_0x85d5('0x15')]);router[_0x85d5('0x16')](_0x85d5('0x8'),auth[_0x85d5('0x5')](),interaction[_0x85d5('0x10')](_0x85d5('0x11'),_0x85d5('0x17')),controller[_0x85d5('0x18')]);router[_0x85d5('0x16')](_0x85d5('0xf'),auth[_0x85d5('0x5')](),controller[_0x85d5('0x19')]);module[_0x85d5('0x1a')]=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index a049b95..0a7959e 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 _0x33ac=['moment','DATE','STRING','ENUM','out','BOOLEAN'];(function(_0x29f802,_0x42b9be){var _0x44b4d6=function(_0x254623){while(--_0x254623){_0x29f802['push'](_0x29f802['shift']());}};_0x44b4d6(++_0x42b9be);}(_0x33ac,0x1f2));var _0xc33a=function(_0x377daf,_0x4ae81f){_0x377daf=_0x377daf-0x0;var _0x15796e=_0x33ac[_0x377daf];return _0x15796e;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xc33a('0x0'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xc33a('0x1')]},'disposition':{'type':Sequelize[_0xc33a('0x2')]},'secondDisposition':{'type':Sequelize[_0xc33a('0x2')]},'thirdDisposition':{'type':Sequelize[_0xc33a('0x2')]},'note':{'type':Sequelize[_0xc33a('0x2')]},'phone':{'type':Sequelize[_0xc33a('0x2')]},'read1stAt':{'type':Sequelize[_0xc33a('0x1')]},'firstMsgDirection':{'type':Sequelize[_0xc33a('0x3')]('in',_0xc33a('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xc33a('0x4')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xc33a('0x5')],'defaultValue':![]}}; \ No newline at end of file +var _0xbeea=['ENUM','out','sequelize','exports','BOOLEAN','DATE','STRING'];(function(_0x2b39b0,_0x53f62c){var _0x2f0e50=function(_0x2832a3){while(--_0x2832a3){_0x2b39b0['push'](_0x2b39b0['shift']());}};_0x2f0e50(++_0x53f62c);}(_0xbeea,0xb1));var _0xabee=function(_0x775449,_0x4d8174){_0x775449=_0x775449-0x0;var _0x1e980f=_0xbeea[_0x775449];return _0x1e980f;};'use strict';var Sequelize=require(_0xabee('0x0'));var moment=require('moment');module[_0xabee('0x1')]={'closed':{'type':Sequelize[_0xabee('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xabee('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xabee('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xabee('0x4')]},'phone':{'type':Sequelize[_0xabee('0x4')]},'read1stAt':{'type':Sequelize[_0xabee('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xabee('0x5')]('in',_0xabee('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xabee('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xabee('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index 4ffbe53..1a133cb 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 _0xeed7=['../../config/license/util','../../mysqldb','defaults','redis','localhost','./whatsappInteraction.socket','register','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','status','end','sendStatus','error','stack','name','send','Users','map','fullname','TagIds','split','forEach','push','catch','index','WhatsappInteraction','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','select','field','color','from','u.id','ui.WhatsappInteractionId','left_join','users','u.id\x20=\x20ui.UserId','whatsapp_interactions','whatsapp_accounts','a.id\x20=\x20i.WhatsappAccountId','whatsapp_messages','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','tools_tags','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','body','some','i.WhatsappAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','QueryTypes','SELECT','clone','contactName','DESC','isEmpty','t.id\x20IN\x20?','resolve','WhatsappAccountId','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','role','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','agent','sequelize','toString','keyBy','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.WhatsappInteractionId\x20IN\x20?','rows','show','includeAll','include','options','create','params','describe','addMessage','ids','omit','findOne','nolimit','format','YYYY-MM-DD\x20HH:mm:ss','WhatsappMessage','findAll','addTags','setTags','spread','emit','whatsappInteractionTags:save','removeTags','download','unix','join','server','files','root','attachments','User','CmContact','firstName','lastName','Attachment','Messages','direction','secret','WhatsappAccount','Owner','mkdirSync','Account','N.A.','closed','closedAt','disposition','basename','createReadStream','pipe','out','System','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','Whatsapp','createPdfFromHTML','log','err','unlinkSync','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x4f3da4,_0x121375){var _0x1df1a1=function(_0x329dfc){while(--_0x329dfc){_0x4f3da4['push'](_0x4f3da4['shift']());}};_0x1df1a1(++_0x121375);}(_0xeed7,0xdf));var _0x7eed=function(_0x4d7d65,_0x43328f){_0x4d7d65=_0x4d7d65-0x0;var _0x56d2ae=_0xeed7[_0x4d7d65];return _0x56d2ae;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7eed('0x0'));var jsonpatch=require(_0x7eed('0x1'));var rp=require('request-promise');var moment=require(_0x7eed('0x2'));var BPromise=require(_0x7eed('0x3'));var Mustache=require(_0x7eed('0x4'));var util=require(_0x7eed('0x5'));var path=require('path');var sox=require(_0x7eed('0x6'));var csv=require(_0x7eed('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7eed('0x8'));var _=require(_0x7eed('0x9'));var squel=require(_0x7eed('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x7eed('0xb'));var toCsv=require(_0x7eed('0x7'));var querystring=require(_0x7eed('0xc'));var Papa=require('papaparse');var Redis=require(_0x7eed('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x7eed('0xe'));var pdf=require(_0x7eed('0xf'));var hardwareService=require(_0x7eed('0x10'));var logger=require(_0x7eed('0x11'))(_0x7eed('0x12'));var utils=require(_0x7eed('0x13'));var config=require(_0x7eed('0x14'));var licenseUtil=require(_0x7eed('0x15'));var db=require(_0x7eed('0x16'))['db'];config['redis']=_[_0x7eed('0x17')](config[_0x7eed('0x18')],{'host':_0x7eed('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x7eed('0x1a'))[_0x7eed('0x1b')](socket);function respondWithStatusCode(_0xe64c1,_0xdcfc59){_0xdcfc59=_0xdcfc59||0xcc;return function(_0x431738){if(_0x431738){return _0xe64c1['sendStatus'](_0xdcfc59);}return _0xe64c1['status'](_0xdcfc59)['end']();};}function respondWithResult(_0xdcfd1,_0x4f96c6){_0x4f96c6=_0x4f96c6||0xc8;return function(_0x545ca9){if(_0x545ca9){return _0xdcfd1['status'](_0x4f96c6)[_0x7eed('0x1c')](_0x545ca9);}};}function respondWithFilteredResult(_0x2fe55f,_0x5143db){return function(_0x1b36bb){if(_0x1b36bb){var _0x3ab3e2=typeof _0x5143db[_0x7eed('0x1d')]===_0x7eed('0x1e')&&typeof _0x5143db[_0x7eed('0x1f')]===_0x7eed('0x1e');var _0x2056df=_0x1b36bb[_0x7eed('0x20')];var _0x27b873=_0x3ab3e2?0x0:_0x5143db[_0x7eed('0x1d')];var _0x45357c=_0x3ab3e2?_0x1b36bb['count']:_0x5143db[_0x7eed('0x1d')]+_0x5143db['limit'];var _0x289d64;if(_0x45357c>=_0x2056df){_0x45357c=_0x2056df;_0x289d64=0xc8;}else{_0x289d64=0xce;}_0x2fe55f['status'](_0x289d64);return _0x2fe55f[_0x7eed('0x21')](_0x7eed('0x22'),_0x27b873+'-'+_0x45357c+'/'+_0x2056df)['json'](_0x1b36bb);}return null;};}function patchUpdates(_0x51e60e){return function(_0x5201ca){try{jsonpatch[_0x7eed('0x23')](_0x5201ca,_0x51e60e,!![]);}catch(_0x451e71){return BPromise[_0x7eed('0x24')](_0x451e71);}return _0x5201ca[_0x7eed('0x25')]();};}function saveUpdates(_0xfe3c86,_0x811eeb){return function(_0x329e5f){if(_0x329e5f){return _0x329e5f[_0x7eed('0x26')](_0xfe3c86)[_0x7eed('0x27')](function(_0x3e4824){return _0x3e4824;});}return null;};}function removeEntity(_0x2fc47f,_0x20420f){return function(_0x291b7c){if(_0x291b7c){return _0x291b7c[_0x7eed('0x28')]()[_0x7eed('0x27')](function(){_0x2fc47f[_0x7eed('0x29')](0xcc)[_0x7eed('0x2a')]();});}};}function handleEntityNotFound(_0x34c4ac,_0x1ee2e5){return function(_0x40d9a0){if(!_0x40d9a0){_0x34c4ac[_0x7eed('0x2b')](0x194);}return _0x40d9a0;};}function handleError(_0x356828,_0x34e625){_0x34e625=_0x34e625||0x1f4;return function(_0x764ea3){logger[_0x7eed('0x2c')](_0x764ea3[_0x7eed('0x2d')]);if(_0x764ea3[_0x7eed('0x2e')]){delete _0x764ea3[_0x7eed('0x2e')];}_0x356828[_0x7eed('0x29')](_0x34e625)[_0x7eed('0x2f')](_0x764ea3);};}function getInteractionUsers(_0x2abdd7,_0x3d6e09){return new BPromise(function(_0x6233d2,_0xc3d47e){try{if(_0x3d6e09[_0x2abdd7['id']]){_0x2abdd7[_0x7eed('0x30')]=_[_0x7eed('0x31')](_0x3d6e09[_0x2abdd7['id']],function(_0x55fae2){return{'id':_0x55fae2['id'],'fullname':_0x55fae2[_0x7eed('0x32')]};});}}catch(_0x34be5b){_0xc3d47e(_0x34be5b);}_0x6233d2(_0x2abdd7);});}function getInteractionTags(_0x1b17bb,_0x28e4d5){return new BPromise(function(_0x428180,_0x495471){try{if(_0x1b17bb['TagIds']){_0x1b17bb['Tags']=[];_0x1b17bb[_0x7eed('0x33')][_0x7eed('0x34')](',')[_0x7eed('0x35')](function(_0x2ca885){_0x1b17bb['Tags'][_0x7eed('0x36')](_0x28e4d5[_0x2ca885]);});}delete _0x1b17bb[_0x7eed('0x33')];}catch(_0x5dd011){_0x495471(_0x5dd011);}_0x428180(_0x1b17bb);});}function updateWhatsappInteraction(_0x533db1,_0x5447c6,_0x3320a7){return new BPromise(function(_0x13889c,_0x486cba){return getInteractionUsers(_0x533db1,_0x3320a7)[_0x7eed('0x27')](function(_0x558c87){return getInteractionTags(_0x558c87,_0x5447c6);})[_0x7eed('0x27')](function(_0x1fd843){_0x13889c(_0x1fd843);})[_0x7eed('0x37')](function(_0x40177a){_0x486cba(_0x40177a);});});}exports[_0x7eed('0x38')]=function(_0xfd70a1,_0x2f7e9a){var _0x36c708={},_0x57c89e={},_0x4eaeb4={'count':0x0,'rows':[]};var _0x55c1c=_[_0x7eed('0x31')](db[_0x7eed('0x39')][_0x7eed('0x3a')],function(_0x23878b){return{'name':_0x23878b[_0x7eed('0x3b')],'type':_0x23878b[_0x7eed('0x3c')][_0x7eed('0x3d')]};});_0x57c89e[_0x7eed('0x3e')]=_[_0x7eed('0x31')](_0x55c1c,'name');_0x57c89e[_0x7eed('0x3f')]=_[_0x7eed('0x40')](_0xfd70a1[_0x7eed('0x3f')]);_0x57c89e['filters']=_[_0x7eed('0x41')](_0x57c89e['model'],_0x57c89e[_0x7eed('0x3f')]);_0x36c708[_0x7eed('0x42')]=_[_0x7eed('0x41')](_0x57c89e[_0x7eed('0x3e')],qs[_0x7eed('0x43')](_0xfd70a1[_0x7eed('0x3f')][_0x7eed('0x43')]));_0x36c708[_0x7eed('0x42')]=_0x36c708[_0x7eed('0x42')][_0x7eed('0x44')]?_0x36c708[_0x7eed('0x42')]:_0x57c89e['model'];if(!_0xfd70a1[_0x7eed('0x3f')][_0x7eed('0x45')]('nolimit')){_0x36c708[_0x7eed('0x1f')]=qs[_0x7eed('0x1f')](_0xfd70a1[_0x7eed('0x3f')][_0x7eed('0x1f')]);_0x36c708[_0x7eed('0x1d')]=qs[_0x7eed('0x1d')](_0xfd70a1[_0x7eed('0x3f')][_0x7eed('0x1d')]);}_0x36c708[_0x7eed('0x46')]=qs[_0x7eed('0x47')](_0xfd70a1['query'][_0x7eed('0x47')]);_0x36c708[_0x7eed('0x48')]=qs[_0x7eed('0x49')](_[_0x7eed('0x4a')](_0xfd70a1[_0x7eed('0x3f')],_0x57c89e[_0x7eed('0x49')]),_0x55c1c);var _0x3e2cb2=[];var _0x3c4c43=squel[_0x7eed('0x4b')]()[_0x7eed('0x4c')]('id')[_0x7eed('0x4c')](_0x7eed('0x2e'))[_0x7eed('0x4c')](_0x7eed('0x4d'))[_0x7eed('0x4e')]('tools_tags');var _0x548588=squel[_0x7eed('0x4b')]()[_0x7eed('0x4c')](_0x7eed('0x4f'))['field']('u.fullname')[_0x7eed('0x4c')](_0x7eed('0x50'))[_0x7eed('0x4e')]('user_has_whatsapp_interactions','ui')[_0x7eed('0x51')](_0x7eed('0x52'),'u',_0x7eed('0x53'));var _0x306b26=squel[_0x7eed('0x4b')]()['from'](_0x7eed('0x54'),'i')[_0x7eed('0x51')]('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join'](_0x7eed('0x52'),'o','o.id\x20=\x20i.UserId')[_0x7eed('0x51')](_0x7eed('0x55'),'a',_0x7eed('0x56'))[_0x7eed('0x51')](_0x7eed('0x57'),'me',_0x7eed('0x58'))[_0x7eed('0x51')](_0x7eed('0x59'),'it',_0x7eed('0x5a'))[_0x7eed('0x51')](_0x7eed('0x5b'),'t','t.id\x20=\x20it.TagId');var _0x132e33=squel[_0x7eed('0x5c')]();var _0x27b26c=[];var _0x4e9a39=squel[_0x7eed('0x5c')]();var _0x2be206;if(_0xfd70a1['query'][_0x7eed('0x5d')]){_0x2be206=as[_0x7eed('0x5e')](_0xfd70a1[_0x7eed('0x3f')][_0x7eed('0x5d')]);var _0x498ee7=_0x2be206[_0x7eed('0x5f')];for(var _0x3994aa=0x0;_0x3994aa<_0x2be206['conditions'][_0x7eed('0x44')];_0x3994aa++){var _0x3b9cd7=_0x2be206[_0x7eed('0x60')][_0x3994aa];var _0x3953ee='i';var _0x15d46e=_[_0x7eed('0x61')](_0x55c1c,[_0x7eed('0x2e'),_0x3b9cd7[_0x7eed('0x4c')]]);if(!_0x15d46e){switch(_0x3b9cd7['field']){case _0x7eed('0x62'):if(_0x3b9cd7[_0x7eed('0x63')]==0x1){_0x306b26[_0x7eed('0x64')]('`'+_0x3b9cd7['field']+_0x7eed('0x65'));}else{_0x306b26[_0x7eed('0x64')]('`'+_0x3b9cd7[_0x7eed('0x4c')]+_0x7eed('0x66'));}break;case _0x7eed('0x67'):if(_0x3b9cd7['operator']==='$substring'){if(_0x3b9cd7[_0x7eed('0x63')][_0x7eed('0x34')]('\x20')['length']>0x1){_0x132e33[_0x498ee7](_0x7eed('0x68'),qs[_0x7eed('0x69')](_0x3b9cd7['value']),null);}else{var _0x432e70='%'+_0x3b9cd7['value']+'%';_0x132e33[_0x498ee7](_0x7eed('0x6a'),_0x432e70,_0x432e70,_0x432e70);}}else{_0x15d46e=_['find'](_0x55c1c,['name',_0x7eed('0x6b')]);_0x3b9cd7[_0x7eed('0x4c')]=_0x7eed('0x6b');_0x5e5ffa=as[_0x7eed('0x6c')](_0x3953ee,_0x15d46e['type'],_0x3b9cd7);_0x132e33[_0x498ee7](_0x5e5ffa[_0x7eed('0x6d')],_0x5e5ffa['value'][_0x7eed('0x6e')],_0x5e5ffa['value'][_0x7eed('0x2a')]);}break;case _0x7eed('0x6f'):var _0x5c993a=_0x3b9cd7['value'][_0x7eed('0x34')](',')[_0x7eed('0x31')](function(_0x5a8bf6){return Number(_0x5a8bf6);});_0x5c993a[_0x7eed('0x35')](function(_0x403632){_0x4e9a39['or'](_0x7eed('0x70'),'%,'+_0x403632+',%');});_0x27b26c=_[_0x7eed('0x71')](_0x27b26c,_0x5c993a);break;case'User':if(_0x3b9cd7[_0x7eed('0x72')]==='$substring'){_0x132e33[_0x498ee7](_0x7eed('0x73'),'%'+_0x3b9cd7[_0x7eed('0x63')]+'%',null);}else{_0x15d46e=_['find'](_0x55c1c,[_0x7eed('0x2e'),'UserId']);_0x3b9cd7[_0x7eed('0x4c')]='UserId';_0x5e5ffa=as['buildExpression'](_0x3953ee,_0x15d46e[_0x7eed('0x3c')],_0x3b9cd7);_0x132e33[_0x498ee7](_0x5e5ffa['text'],_0x5e5ffa[_0x7eed('0x63')][_0x7eed('0x6e')],_0x5e5ffa[_0x7eed('0x63')][_0x7eed('0x2a')]);}break;case _0x7eed('0x74'):_0x5e5ffa=as[_0x7eed('0x6c')]('me',null,_0x3b9cd7);_0x132e33[_0x498ee7](_0x5e5ffa[_0x7eed('0x6d')],_0x5e5ffa[_0x7eed('0x63')][_0x7eed('0x6e')],_0x5e5ffa[_0x7eed('0x63')][_0x7eed('0x2a')]);break;}}else{var _0x5e5ffa=as['buildExpression'](_0x3953ee,_0x15d46e[_0x7eed('0x3c')],_0x3b9cd7);_0x132e33[_0x498ee7](_0x5e5ffa['text'],_0x5e5ffa[_0x7eed('0x63')][_0x7eed('0x6e')],_0x5e5ffa[_0x7eed('0x63')][_0x7eed('0x2a')]);}}}else{var _0x3319d2=_(_0xfd70a1[_0x7eed('0x3f')])[_0x7eed('0x40')]()[_0x7eed('0x31')](function(_0x212715){return _[_0x7eed('0x75')](_0x55c1c,[_0x7eed('0x2e'),_0x212715])?_0x212715:undefined;})['compact']()['value']();if(!_['isEmpty'](_0x3319d2)){_0x3319d2[_0x7eed('0x35')](function(_0x4bac92){if(_0x4bac92==='WhatsappAccountId'){_0x306b26[_0x7eed('0x48')](_0x7eed('0x76'),[][_0x7eed('0x77')](_0xfd70a1['query'][_0x4bac92]));}else if(_0x4bac92===_0x7eed('0x78')){var _0x2d1395=JSON[_0x7eed('0x79')](_0xfd70a1[_0x7eed('0x3f')][_0x4bac92])[_0x7eed('0x7a')];var _0x4f467b=JSON[_0x7eed('0x79')](_0xfd70a1['query'][_0x4bac92])[_0x7eed('0x7b')];_0x306b26[_0x7eed('0x48')](_0x7eed('0x7c'),_0x2d1395,_0x4f467b);}else{if(_0xfd70a1['query'][_0x4bac92]===_0x7eed('0x7d')){_0x306b26[_0x7eed('0x48')]('i.'+_0x4bac92+_0x7eed('0x7e'));}else{_0x306b26['where']('i.'+_0x4bac92+_0x7eed('0x7f'),_0xfd70a1[_0x7eed('0x3f')][_0x4bac92]);}}});}if(_0xfd70a1[_0x7eed('0x3f')][_0x7eed('0x80')]){if(_0xfd70a1[_0x7eed('0x3f')]['read']==0x1){_0x306b26[_0x7eed('0x64')](_0x7eed('0x81'));}else{_0x306b26[_0x7eed('0x64')](_0x7eed('0x82'));}}if(_0xfd70a1[_0x7eed('0x3f')][_0x7eed('0x83')]){_0x27b26c=_[_0x7eed('0x84')](_0xfd70a1[_0x7eed('0x3f')][_0x7eed('0x83')])?_0xfd70a1[_0x7eed('0x3f')][_0x7eed('0x83')]:new Array(_0xfd70a1[_0x7eed('0x3f')][_0x7eed('0x83')]);_0x27b26c['forEach'](function(_0x308273){_0x4e9a39['or'](_0x7eed('0x70'),'%,'+_0x308273+',%');});}if(_0xfd70a1['query'][_0x7eed('0x85')]){var _0x19162b=_0xfd70a1[_0x7eed('0x3f')][_0x7eed('0x85')][_0x7eed('0x86')]('\x5c','\x5c\x5c')[_0x7eed('0x86')](/'/g,'\x27\x27');if(qs[_0x7eed('0x87')](_0x19162b)){_0x132e33['or'](_0x7eed('0x88'),_0x19162b+'%')['or'](_0x7eed('0x89'),_0x19162b+'%');}else{_0x132e33['or'](_0x7eed('0x8a'),qs[_0x7eed('0x69')](_0x19162b))['or'](_0x7eed('0x8b'),_0x19162b+'%');}}}_0x306b26['where'](_0x132e33);_0x306b26[_0x7eed('0x8c')]('i.id');var _0x181955={'type':db['Sequelize'][_0x7eed('0x8d')][_0x7eed('0x8e')],'raw':!![]};var _0x397094=_0x306b26[_0x7eed('0x8f')]();_0x397094[_0x7eed('0x4c')]('i.id');_0x397094[_0x7eed('0x4c')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x7eed('0x62'));if(_0x36c708[_0x7eed('0x46')]){_0x36c708['order'][_0x7eed('0x35')](function(_0x253171){var _0x550e24=_0x253171[0x0]===_0x7eed('0x90')?_0x253171[0x0]:'i.'+_0x253171[0x0];_0x306b26['order'](_0x550e24,_0x253171[0x1]===_0x7eed('0x91')?![]:!![]);});}if(!_[_0x7eed('0x92')](_0x27b26c)){_0x306b26[_0x7eed('0x64')](_0x4e9a39);_0x397094[_0x7eed('0x48')](_0x7eed('0x93'),_0x27b26c);}BPromise[_0x7eed('0x94')]()['then'](function(){if(!_0x2be206){if(_0xfd70a1['query'][_0x7eed('0x95')])return;_0x397094['where']('i.WhatsappAccountId\x20IS\x20NOT\x20NULL');_0x306b26[_0x7eed('0x48')](_0x7eed('0x96'));return;}if(_0xfd70a1[_0x7eed('0x97')][_0x7eed('0x98')]!=='agent')return;return _0xfd70a1[_0x7eed('0x97')][_0x7eed('0x99')]({'attributes':['id'],'raw':!![]})['then'](function(_0x11acc8){if(_['isEmpty'](_0x11acc8)){_0x397094[_0x7eed('0x48')](_0x7eed('0x9a'));_0x306b26['where'](_0x7eed('0x9a'));}else{_0x397094['where']('i.WhatsappAccountId\x20IN\x20?',_['map'](_0x11acc8,'id'));_0x306b26[_0x7eed('0x48')](_0x7eed('0x76'),_['map'](_0x11acc8,'id'));}});})['then'](function(){if(_0xfd70a1[_0x7eed('0x97')][_0x7eed('0x98')]===_0x7eed('0x9b')&&!_0x2be206&&!_0xfd70a1['query'][_0x7eed('0x95')])return[];return db[_0x7eed('0x9c')][_0x7eed('0x3f')](_0x397094[_0x7eed('0x9d')](),_0x181955);})[_0x7eed('0x27')](function(_0xfbdf0e){_0x4eaeb4[_0x7eed('0x20')]=_0xfbdf0e[_0x7eed('0x44')];if(_0x4eaeb4[_0x7eed('0x20')]===0x0)return[];return db[_0x7eed('0x9c')][_0x7eed('0x3f')](_0x3c4c43['toString'](),_0x181955)[_0x7eed('0x27')](function(_0x13353d){_0x3e2cb2=_[_0x7eed('0x9e')](_0x13353d,'id');_0x181955=_[_0x7eed('0x9f')](_0x181955,{'model':db[_0x7eed('0x39')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xfd70a1[_0x7eed('0x3f')][_0x7eed('0x43')]){_0x36c708['attributes'][_0x7eed('0x35')](function(_0x41c0d7){_0x306b26[_0x7eed('0x4c')]('i.'+_0x41c0d7);});}else{_0x306b26[_0x7eed('0x4c')](_0x7eed('0xa0'),_0x7eed('0x62'));_0x306b26[_0x7eed('0x4c')](_0x7eed('0xa1'),_0x7eed('0xa2'));_0x306b26[_0x7eed('0x4c')](_0x7eed('0xa3'),_0x7eed('0xa4'));_0x306b26[_0x7eed('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',_0x7eed('0x90'));_0x306b26[_0x7eed('0x4c')](_0x7eed('0xa5'));_0x306b26[_0x7eed('0x4c')]('c.firstName',_0x7eed('0xa6'));_0x306b26['field'](_0x7eed('0xa7'),_0x7eed('0xa8'));_0x306b26[_0x7eed('0x4c')](_0x7eed('0xa9'),_0x7eed('0xaa'));_0x306b26[_0x7eed('0x4c')](_0x7eed('0xab'),_0x7eed('0xac'));_0x306b26['field'](_0x7eed('0xad'),_0x7eed('0xae'));_0x306b26['field'](_0x7eed('0xaf'),_0x7eed('0xb0'));_0x306b26[_0x7eed('0x4c')](_0x7eed('0xb1'),_0x7eed('0xb2'));_0x306b26[_0x7eed('0x4c')](_0x7eed('0xb3'),_0x7eed('0xb4'));_0x306b26[_0x7eed('0x4c')](_0x7eed('0xb5'),_0x7eed('0x33'));}if(_0x36c708[_0x7eed('0x1f')])_0x306b26['limit'](_0x36c708[_0x7eed('0x1f')]);if(_0x36c708[_0x7eed('0x1d')])_0x306b26[_0x7eed('0x1d')](_0x36c708['offset']);return db[_0x7eed('0x9c')][_0x7eed('0x3f')](_0x306b26[_0x7eed('0x9d')](),_0x181955);})[_0x7eed('0x27')](function(_0x1c1daa){if(_0x1c1daa[_0x7eed('0x44')]>0x0)_0x548588['where'](_0x7eed('0xb6'),_[_0x7eed('0x31')](_0x1c1daa,'id'));return db[_0x7eed('0x9c')]['query'](_0x548588[_0x7eed('0x9d')](),_0x181955)[_0x7eed('0x27')](function(_0x1a964e){var _0x493bea=_['groupBy'](_0x1a964e,'WhatsappInteractionId');var _0x15bc50=[];_0x1c1daa[_0x7eed('0x35')](function(_0x24d670){_0x15bc50[_0x7eed('0x36')](updateWhatsappInteraction(_0x24d670,_0x3e2cb2,_0x493bea));});return BPromise['all'](_0x15bc50);});});})[_0x7eed('0x27')](function(_0x1675a7){_0x4eaeb4[_0x7eed('0xb7')]=_0x1675a7;return _0x4eaeb4;})[_0x7eed('0x27')](respondWithFilteredResult(_0x2f7e9a,_0x36c708))[_0x7eed('0x37')](handleError(_0x2f7e9a,null));};exports[_0x7eed('0xb8')]=function(_0x5a0e8d,_0xd6bee){var _0x5dd0d7={'raw':![],'where':{'id':_0x5a0e8d['params']['id']}},_0x29dd78={};_0x29dd78[_0x7eed('0x3e')]=_[_0x7eed('0x40')](db[_0x7eed('0x39')]['rawAttributes']);_0x29dd78[_0x7eed('0x3f')]=_[_0x7eed('0x40')](_0x5a0e8d['query']);_0x29dd78['filters']=_[_0x7eed('0x41')](_0x29dd78[_0x7eed('0x3e')],_0x29dd78[_0x7eed('0x3f')]);_0x5dd0d7[_0x7eed('0x42')]=_[_0x7eed('0x41')](_0x29dd78[_0x7eed('0x3e')],qs[_0x7eed('0x43')](_0x5a0e8d[_0x7eed('0x3f')][_0x7eed('0x43')]));_0x5dd0d7[_0x7eed('0x42')]=_0x5dd0d7[_0x7eed('0x42')][_0x7eed('0x44')]?_0x5dd0d7['attributes']:_0x29dd78[_0x7eed('0x3e')];if(_0x5a0e8d['query'][_0x7eed('0xb9')]){_0x5dd0d7[_0x7eed('0xba')]=[{'all':!![]}];}_0x5dd0d7=_[_0x7eed('0x9f')]({},_0x5dd0d7,_0x5a0e8d[_0x7eed('0xbb')]);return db['WhatsappInteraction'][_0x7eed('0x61')](_0x5dd0d7)['then'](handleEntityNotFound(_0xd6bee,null))[_0x7eed('0x27')](respondWithResult(_0xd6bee,null))[_0x7eed('0x37')](handleError(_0xd6bee,null));};exports[_0x7eed('0xbc')]=function(_0x1402bc,_0x101113){return db[_0x7eed('0x39')]['create'](_0x1402bc[_0x7eed('0x74')],{})[_0x7eed('0x27')](respondWithResult(_0x101113,0xc9))[_0x7eed('0x37')](handleError(_0x101113,null));};exports['update']=function(_0x2d6973,_0x4f1daf){if(_0x2d6973[_0x7eed('0x74')]['id']){delete _0x2d6973[_0x7eed('0x74')]['id'];}return db[_0x7eed('0x39')][_0x7eed('0x61')]({'where':{'id':_0x2d6973[_0x7eed('0xbd')]['id']}})['then'](handleEntityNotFound(_0x4f1daf,null))['then'](saveUpdates(_0x2d6973[_0x7eed('0x74')],null))['then'](respondWithResult(_0x4f1daf,null))[_0x7eed('0x37')](handleError(_0x4f1daf,null));};exports['destroy']=function(_0x43bd6d,_0x49f6d1){return db[_0x7eed('0x39')][_0x7eed('0x61')]({'where':{'id':_0x43bd6d[_0x7eed('0xbd')]['id']}})['then'](handleEntityNotFound(_0x49f6d1,null))[_0x7eed('0x27')](removeEntity(_0x49f6d1,null))[_0x7eed('0x37')](handleError(_0x49f6d1,null));};exports[_0x7eed('0xbe')]=function(_0x597083,_0x137a5e){return db[_0x7eed('0x39')][_0x7eed('0xbe')]()[_0x7eed('0x27')](respondWithResult(_0x137a5e,null))[_0x7eed('0x37')](handleError(_0x137a5e,null));};exports['addMessage']=function(_0x2f0bf8,_0x14afcf,_0x177fe7){return db['WhatsappMessage'][_0x7eed('0x61')]({'where':{'id':_0x2f0bf8[_0x7eed('0xbd')]['id']}})[_0x7eed('0x27')](handleEntityNotFound(_0x14afcf,null))[_0x7eed('0x27')](function(_0x414fef){if(_0x414fef){return _0x414fef[_0x7eed('0xbf')](_0x2f0bf8[_0x7eed('0x74')][_0x7eed('0xc0')],_[_0x7eed('0xc1')](_0x2f0bf8[_0x7eed('0x74')],[_0x7eed('0xc0'),'id'])||{});}})['then'](respondWithResult(_0x14afcf,null))[_0x7eed('0x37')](handleError(_0x14afcf,null));};exports['getMessages']=function(_0x1b502b,_0x424975,_0x2d5f16){var _0x1eabea={'raw':![],'where':{}};var _0x50a45a={};var _0x4beb0d={'count':0x0,'rows':[]};return db['WhatsappInteraction'][_0x7eed('0xc2')]({'where':{'id':_0x1b502b[_0x7eed('0xbd')]['id']}})[_0x7eed('0x27')](handleEntityNotFound(_0x424975,null))[_0x7eed('0x27')](function(_0x584059){if(_0x584059){_0x50a45a[_0x7eed('0x3e')]=_['keys'](db['WhatsappMessage']['rawAttributes']);_0x50a45a[_0x7eed('0x3f')]=_[_0x7eed('0x40')](_0x1b502b[_0x7eed('0x3f')]);_0x50a45a['filters']=_['intersection'](_0x50a45a[_0x7eed('0x3e')],_0x50a45a[_0x7eed('0x3f')]);_0x1eabea[_0x7eed('0x42')]=_['intersection'](_0x50a45a[_0x7eed('0x3e')],qs[_0x7eed('0x43')](_0x1b502b[_0x7eed('0x3f')][_0x7eed('0x43')]));_0x1eabea[_0x7eed('0x42')]=_0x1eabea[_0x7eed('0x42')]['length']?_0x1eabea[_0x7eed('0x42')]:_0x50a45a[_0x7eed('0x3e')];if(!_0x1b502b['query']['hasOwnProperty'](_0x7eed('0xc3'))){_0x1eabea[_0x7eed('0x1f')]=qs[_0x7eed('0x1f')](_0x1b502b['query'][_0x7eed('0x1f')]);_0x1eabea['offset']=qs[_0x7eed('0x1d')](_0x1b502b['query']['offset']);}_0x1eabea[_0x7eed('0x46')]=qs['sort'](_0x1b502b[_0x7eed('0x3f')][_0x7eed('0x47')]);_0x1eabea[_0x7eed('0x48')]=qs[_0x7eed('0x49')](_['pick'](_0x1b502b[_0x7eed('0x3f')],_0x50a45a[_0x7eed('0x49')]));_0x1eabea[_0x7eed('0x48')]['WhatsappInteractionId']=_0x584059['id'];if(_0x1b502b[_0x7eed('0x3f')][_0x7eed('0x85')]){_0x1eabea['where']=_[_0x7eed('0x9f')](_0x1eabea[_0x7eed('0x48')],{'$or':_[_0x7eed('0x31')](_0x1eabea['attributes'],function(_0x23254b){var _0x3532e9={};_0x3532e9[_0x23254b]={'$like':'%'+_0x1b502b[_0x7eed('0x3f')][_0x7eed('0x85')]+'%'};return _0x3532e9;})});}if(_0x1b502b[_0x7eed('0x3f')][_0x7eed('0x7a')]){var _0x281f50=_0x1b502b['query'][_0x7eed('0x7a')]['split'](',');var _0x5d1471={};_0x5d1471[_0x281f50[0x0]]={'$gte':moment(_0x281f50[0x1])[_0x7eed('0xc4')](_0x7eed('0xc5'))};_0x1eabea['where']=_['merge'](_0x1eabea[_0x7eed('0x48')],_0x5d1471);}_0x1eabea=_['merge']({},_0x1eabea,_0x1b502b[_0x7eed('0xbb')]);return db[_0x7eed('0xc6')]['count']({'where':_0x1eabea['where']})[_0x7eed('0x27')](function(_0x4d7faa){_0x4beb0d[_0x7eed('0x20')]=_0x4d7faa;if(_0x1b502b[_0x7eed('0x3f')][_0x7eed('0xb9')]){_0x1eabea[_0x7eed('0xba')]=[{'all':!![]}];}return db[_0x7eed('0xc6')][_0x7eed('0xc7')](_0x1eabea);})['then'](function(_0x35f025){_0x4beb0d['rows']=_0x35f025;return _0x4beb0d;});}})[_0x7eed('0x27')](respondWithFilteredResult(_0x424975,_0x1eabea))['catch'](handleError(_0x424975,null));};exports[_0x7eed('0xc8')]=function(_0x122982,_0x50ee02,_0x28ab66){return db[_0x7eed('0x39')][_0x7eed('0x61')]({'where':{'id':_0x122982['params']['id']}})[_0x7eed('0x27')](handleEntityNotFound(_0x50ee02,null))['then'](function(_0xb9806a){if(_0xb9806a){return _0xb9806a[_0x7eed('0xc9')](_0x122982['body'][_0x7eed('0xc0')],_[_0x7eed('0xc1')](_0x122982[_0x7eed('0x74')],[_0x7eed('0xc0'),'id'])||{})[_0x7eed('0xca')](function(){return db[_0x7eed('0x6f')][_0x7eed('0xc7')]({'attributes':['id',_0x7eed('0x2e'),_0x7eed('0x4d')],'where':{'id':_0x122982[_0x7eed('0x74')][_0x7eed('0xc0')]}});})['then'](function(_0x3fb287){socket[_0x7eed('0xcb')](_0x7eed('0xcc'),{'id':Number(_0x122982['params']['id']),'tags':_0x3fb287||[]});return{'id':Number(_0x122982['params']['id']),'tags':_0x3fb287||[]};});}})[_0x7eed('0x27')](respondWithResult(_0x50ee02,null))[_0x7eed('0x37')](handleError(_0x50ee02,null));};exports['removeTags']=function(_0x3534de,_0x45af8a,_0x3abe21){return db[_0x7eed('0x39')][_0x7eed('0x61')]({'where':{'id':_0x3534de['params']['id']}})[_0x7eed('0x27')](handleEntityNotFound(_0x45af8a,null))['then'](function(_0x5d2721){if(_0x5d2721){return _0x5d2721[_0x7eed('0xcd')](_0x3534de[_0x7eed('0x3f')][_0x7eed('0xc0')]);}})[_0x7eed('0x27')](respondWithStatusCode(_0x45af8a,null))[_0x7eed('0x37')](handleError(_0x45af8a,null));};exports[_0x7eed('0xce')]=function(_0x8a3c03,_0x1ed81d){var _0x23681a=moment()[_0x7eed('0xcf')]()[_0x7eed('0x9d')]();var _0xa53496=path[_0x7eed('0xd0')](config['root'],_0x7eed('0xd1'),_0x7eed('0xd2'),'tmp');var _0x1e8cd2=path[_0x7eed('0xd0')](config[_0x7eed('0xd3')],_0x7eed('0xd1'),_0x7eed('0xd2'),_0x7eed('0xd4'));var _0x39b0e6=path[_0x7eed('0xd0')](_0xa53496,_0x23681a);var _0x5cff01=util['format']('transcript-%d-%s.zip',_0x8a3c03[_0x7eed('0xbd')]['id'],_0x23681a);var _0x3ec437=path[_0x7eed('0xd0')](_0xa53496,_0x5cff01);var _0x34be57=[];_0x34be57[_0x7eed('0x36')]({'model':db[_0x7eed('0xd5')],'as':'User','attributes':['id',_0x7eed('0x32')],'raw':!![]});_0x34be57[_0x7eed('0x36')]({'model':db[_0x7eed('0xd6')],'as':'Contact','attributes':['id',_0x7eed('0xd7'),_0x7eed('0xd8')],'raw':!![]});if(_0x8a3c03[_0x7eed('0x3f')][_0x7eed('0xd4')]){_0x34be57[_0x7eed('0x36')]({'model':db[_0x7eed('0xd9')],'as':_0x7eed('0xd9'),'raw':!![]});}var _0x3c4e44=[{'model':db[_0x7eed('0xc6')],'as':_0x7eed('0xda'),'attributes':['id',_0x7eed('0x74'),_0x7eed('0x78'),_0x7eed('0xdb'),_0x7eed('0xdc'),_0x7eed('0x80')],'include':_0x34be57}];_0x3c4e44[_0x7eed('0x36')]({'model':db[_0x7eed('0xdd')],'as':'Account','attributes':['id',_0x7eed('0x2e')]});_0x3c4e44[_0x7eed('0x36')]({'model':db[_0x7eed('0xd5')],'as':_0x7eed('0xde'),'attributes':['id',_0x7eed('0x32')]});return db[_0x7eed('0x39')]['find']({'where':{'id':_0x8a3c03[_0x7eed('0xbd')]['id']},'include':_0x3c4e44})[_0x7eed('0x27')](handleEntityNotFound(_0x1ed81d,null))[_0x7eed('0x27')](function(_0x2614da){if(_0x2614da){var _0xc57046=_0x2614da['get']({'plain':!![]});fs[_0x7eed('0xdf')](_0x39b0e6);var _0x583e4f={'channel':'Whatsapp','account':_0xc57046[_0x7eed('0xe0')][_0x7eed('0x2e')],'agent':_0xc57046[_0x7eed('0xde')]?_0xc57046[_0x7eed('0xde')][_0x7eed('0x32')]:_0x7eed('0xe1'),'createdAt':moment(_0xc57046[_0x7eed('0x78')])[_0x7eed('0xc4')](_0x7eed('0xc5'))[_0x7eed('0x9d')](),'closedAt':_0xc57046[_0x7eed('0xe2')]?moment(_0xc57046[_0x7eed('0xe3')])[_0x7eed('0xc4')](_0x7eed('0xc5'))[_0x7eed('0x9d')]():'','disposition':_0xc57046[_0x7eed('0xe4')],'messages':_(_0xc57046[_0x7eed('0xda')])['filter']({'secret':![]})[_0x7eed('0x31')](function(_0x1486b3){if(_0x1486b3[_0x7eed('0xd9')]){var _0x476357=path[_0x7eed('0xd0')](_0x1e8cd2,_0x1486b3['Attachment'][_0x7eed('0xe5')]);if(fs['existsSync'](_0x476357)){fs[_0x7eed('0xe6')](_0x476357)[_0x7eed('0xe7')](fs['createWriteStream'](path[_0x7eed('0xd0')](_0x39b0e6,_0x1486b3[_0x7eed('0xd9')][_0x7eed('0xe5')])));}}return{'date':moment(_0x1486b3[_0x7eed('0x78')])['format'](_0x7eed('0xc5'))[_0x7eed('0x9d')](),'sender':_0x1486b3[_0x7eed('0xdb')]===_0x7eed('0xe8')?_0x1486b3['User']?_0x1486b3[_0x7eed('0xd5')][_0x7eed('0x32')]:_0x7eed('0xe9'):_0x1486b3['Contact'][_0x7eed('0xd7')]+(_0x1486b3[_0x7eed('0x67')]['lastName']?'\x20'+_0x1486b3[_0x7eed('0x67')]['lastName']:''),'body':_0x1486b3[_0x7eed('0xd9')]?_0x1486b3[_0x7eed('0xd9')][_0x7eed('0xe5')]:_0x1486b3[_0x7eed('0x74')],'direction':_0x1486b3[_0x7eed('0xdb')]===_0x7eed('0xe8')?'A':'C','secret':_0x1486b3[_0x7eed('0xdc')],'read':_0x1486b3[_0x7eed('0x80')],'attachment':_0x1486b3[_0x7eed('0xd9')]};})[_0x7eed('0x63')]()};return ejs[_0x7eed('0xea')](path['join'](config[_0x7eed('0xd3')],_0x7eed('0xd1'),_0x7eed('0xeb'),_0x7eed('0xec')),{'interaction':_0x583e4f})[_0x7eed('0x27')](function(_0x32acff){var _0x29052a=path[_0x7eed('0xd0')](_0x39b0e6,_0x7eed('0xed')+_0xc57046['id']+'-'+_0x23681a+_0x7eed('0xee'));var _0x30b8b9={'path':_0x29052a,'channel':_0x7eed('0xef'),'interactionId':_0xc57046['id']};return pdf[_0x7eed('0xf0')](_0x32acff,_0x30b8b9);})['then'](function(){return new BPromise(function(_0x23d23a,_0x78b0df){zipdir(_0x39b0e6,{'saveTo':_0x3ec437},function(_0x3a6ccd,_0x1139de){if(_0x3a6ccd)return _0x78b0df(_0x3a6ccd);return _0x23d23a(_0x1139de);});})[_0x7eed('0x27')](function(){return new BPromise(function(_0xb32a7a,_0x3f0684){rimraf(_0x39b0e6,function(_0x3ca377){if(_0x3ca377)_0x3f0684(_0x3ca377);return _0xb32a7a();});});})[_0x7eed('0x27')](function(){return _0x1ed81d['download'](_0x3ec437,_0x5cff01,function(_0x5cfef1){if(_0x5cfef1){console[_0x7eed('0xf1')](_0x7eed('0xf2'),_0x5cfef1);}else{fs[_0x7eed('0xf3')](_0x3ec437);}});});});}else{return _0x1ed81d[_0x7eed('0x2b')](0xc8);}})[_0x7eed('0x37')](handleError(_0x1ed81d,null));}; \ No newline at end of file +var _0xf12f=['u.id','u.fullname','ui.WhatsappInteractionId','user_has_whatsapp_interactions','u.id\x20=\x20ui.UserId','left_join','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','whatsapp_accounts','a.id\x20=\x20i.WhatsappAccountId','whatsapp_messages','me.WhatsappInteractionId\x20=\x20i.id','it.WhatsappInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','having','Contact','value','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','start','union','User','UserId','text','body','some','compact','isEmpty','i.WhatsappAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','isArray','filter','replace','isNumeric','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','WhatsappAccountId','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','toString','sequelize','keyBy','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.lastName','c.email','Contact.email','Contact.phone','c.mobile','c.fax','Contact.fax','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','WhatsappInteractionId','all','rows','show','includeAll','include','merge','options','create','params','describe','WhatsappMessage','addMessage','getMessages','findOne','nolimit','sort','pick','findAll','ids','omit','spread','Tag','emit','whatsappInteractionTags:save','removeTags','download','unix','tmp','server','files','attachments','format','transcript-%d-%s.zip','join','firstName','lastName','Attachment','Messages','direction','secret','Account','Owner','mkdirSync','Whatsapp','N.A.','YYYY-MM-DD\x20HH:mm:ss','closedAt','createReadStream','createWriteStream','basename','out','System','renderFile','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','log','err','unlinkSync','rimraf','zip-dir','fast-json-patch','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','Users','map','fullname','TagIds','Tags','split','forEach','push','catch','index','WhatsappInteraction','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','order','where','filters','select','field','color','from'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0xf12f,0x9c));var _0xff12=function(_0x3151a5,_0x556591){_0x3151a5=_0x3151a5-0x0;var _0x10a216=_0xf12f[_0x3151a5];return _0x10a216;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xff12('0x0'));var zipdir=require(_0xff12('0x1'));var jsonpatch=require(_0xff12('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xff12('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0xff12('0x4'));var sox=require(_0xff12('0x5'));var csv=require(_0xff12('0x6'));var ejs=require(_0xff12('0x7'));var fs=require('fs');var fs_extra=require(_0xff12('0x8'));var _=require(_0xff12('0x9'));var squel=require(_0xff12('0xa'));var crypto=require(_0xff12('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xff12('0x6'));var querystring=require('querystring');var Papa=require(_0xff12('0xc'));var Redis=require(_0xff12('0xd'));var authService=require(_0xff12('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xff12('0xf'));var pdf=require(_0xff12('0x10'));var hardwareService=require(_0xff12('0x11'));var logger=require(_0xff12('0x12'))('api');var utils=require(_0xff12('0x13'));var config=require(_0xff12('0x14'));var licenseUtil=require(_0xff12('0x15'));var db=require('../../mysqldb')['db'];config[_0xff12('0x16')]=_['defaults'](config[_0xff12('0x16')],{'host':_0xff12('0x17'),'port':0x18eb});var socket=require(_0xff12('0x18'))(new Redis(config[_0xff12('0x16')]));require('./whatsappInteraction.socket')['register'](socket);function respondWithStatusCode(_0x26afae,_0x3bab41){_0x3bab41=_0x3bab41||0xcc;return function(_0x46990b){if(_0x46990b){return _0x26afae[_0xff12('0x19')](_0x3bab41);}return _0x26afae[_0xff12('0x1a')](_0x3bab41)[_0xff12('0x1b')]();};}function respondWithResult(_0x42610f,_0x59e703){_0x59e703=_0x59e703||0xc8;return function(_0x54dc0a){if(_0x54dc0a){return _0x42610f[_0xff12('0x1a')](_0x59e703)[_0xff12('0x1c')](_0x54dc0a);}};}function respondWithFilteredResult(_0x21edfa,_0x37bb28){return function(_0x5a5d4a){if(_0x5a5d4a){var _0x464462=typeof _0x37bb28[_0xff12('0x1d')]===_0xff12('0x1e')&&typeof _0x37bb28[_0xff12('0x1f')]===_0xff12('0x1e');var _0xd0bd83=_0x5a5d4a[_0xff12('0x20')];var _0x5c01cb=_0x464462?0x0:_0x37bb28[_0xff12('0x1d')];var _0x20a01d=_0x464462?_0x5a5d4a[_0xff12('0x20')]:_0x37bb28[_0xff12('0x1d')]+_0x37bb28[_0xff12('0x1f')];var _0x2b7b91;if(_0x20a01d>=_0xd0bd83){_0x20a01d=_0xd0bd83;_0x2b7b91=0xc8;}else{_0x2b7b91=0xce;}_0x21edfa[_0xff12('0x1a')](_0x2b7b91);return _0x21edfa[_0xff12('0x21')](_0xff12('0x22'),_0x5c01cb+'-'+_0x20a01d+'/'+_0xd0bd83)[_0xff12('0x1c')](_0x5a5d4a);}return null;};}function patchUpdates(_0x2dc113){return function(_0x1e0e00){try{jsonpatch[_0xff12('0x23')](_0x1e0e00,_0x2dc113,!![]);}catch(_0x23f707){return BPromise['reject'](_0x23f707);}return _0x1e0e00[_0xff12('0x24')]();};}function saveUpdates(_0xe8a838,_0x119b64){return function(_0x41fa20){if(_0x41fa20){return _0x41fa20[_0xff12('0x25')](_0xe8a838)[_0xff12('0x26')](function(_0x286c1f){return _0x286c1f;});}return null;};}function removeEntity(_0x34dbc6,_0x29b1b5){return function(_0x33e584){if(_0x33e584){return _0x33e584[_0xff12('0x27')]()[_0xff12('0x26')](function(){_0x34dbc6[_0xff12('0x1a')](0xcc)[_0xff12('0x1b')]();});}};}function handleEntityNotFound(_0x57f4d4,_0x20f089){return function(_0x5330de){if(!_0x5330de){_0x57f4d4[_0xff12('0x19')](0x194);}return _0x5330de;};}function handleError(_0x2a947f,_0x2f76cc){_0x2f76cc=_0x2f76cc||0x1f4;return function(_0x108803){logger[_0xff12('0x28')](_0x108803[_0xff12('0x29')]);if(_0x108803[_0xff12('0x2a')]){delete _0x108803['name'];}_0x2a947f[_0xff12('0x1a')](_0x2f76cc)['send'](_0x108803);};}function getInteractionUsers(_0x240284,_0x503bd5){return new BPromise(function(_0x2c2820,_0x2f01cf){try{if(_0x503bd5[_0x240284['id']]){_0x240284[_0xff12('0x2b')]=_[_0xff12('0x2c')](_0x503bd5[_0x240284['id']],function(_0x4e74fc){return{'id':_0x4e74fc['id'],'fullname':_0x4e74fc[_0xff12('0x2d')]};});}}catch(_0x4de54d){_0x2f01cf(_0x4de54d);}_0x2c2820(_0x240284);});}function getInteractionTags(_0x5b124e,_0x40f7f1){return new BPromise(function(_0x369907,_0x182b6e){try{if(_0x5b124e[_0xff12('0x2e')]){_0x5b124e[_0xff12('0x2f')]=[];_0x5b124e['TagIds'][_0xff12('0x30')](',')[_0xff12('0x31')](function(_0x1f6e61){_0x5b124e['Tags'][_0xff12('0x32')](_0x40f7f1[_0x1f6e61]);});}delete _0x5b124e[_0xff12('0x2e')];}catch(_0xfbd479){_0x182b6e(_0xfbd479);}_0x369907(_0x5b124e);});}function updateWhatsappInteraction(_0x24cbe0,_0xb4aa66,_0xd5b78f){return new BPromise(function(_0x464652,_0x2fb2c2){return getInteractionUsers(_0x24cbe0,_0xd5b78f)[_0xff12('0x26')](function(_0x28ece7){return getInteractionTags(_0x28ece7,_0xb4aa66);})['then'](function(_0x4fe59f){_0x464652(_0x4fe59f);})[_0xff12('0x33')](function(_0x49bf6e){_0x2fb2c2(_0x49bf6e);});});}exports[_0xff12('0x34')]=function(_0x4589a3,_0x57997f){var _0x4ba267={},_0x5ae576={},_0x5c250d={'count':0x0,'rows':[]};var _0x47e718=_[_0xff12('0x2c')](db[_0xff12('0x35')][_0xff12('0x36')],function(_0x2491af){return{'name':_0x2491af[_0xff12('0x37')],'type':_0x2491af[_0xff12('0x38')][_0xff12('0x39')]};});_0x5ae576['model']=_[_0xff12('0x2c')](_0x47e718,_0xff12('0x2a'));_0x5ae576[_0xff12('0x3a')]=_[_0xff12('0x3b')](_0x4589a3[_0xff12('0x3a')]);_0x5ae576['filters']=_[_0xff12('0x3c')](_0x5ae576[_0xff12('0x3d')],_0x5ae576[_0xff12('0x3a')]);_0x4ba267[_0xff12('0x3e')]=_[_0xff12('0x3c')](_0x5ae576['model'],qs[_0xff12('0x3f')](_0x4589a3[_0xff12('0x3a')]['fields']));_0x4ba267[_0xff12('0x3e')]=_0x4ba267[_0xff12('0x3e')][_0xff12('0x40')]?_0x4ba267[_0xff12('0x3e')]:_0x5ae576[_0xff12('0x3d')];if(!_0x4589a3['query']['hasOwnProperty']('nolimit')){_0x4ba267[_0xff12('0x1f')]=qs[_0xff12('0x1f')](_0x4589a3[_0xff12('0x3a')][_0xff12('0x1f')]);_0x4ba267[_0xff12('0x1d')]=qs['offset'](_0x4589a3[_0xff12('0x3a')][_0xff12('0x1d')]);}_0x4ba267[_0xff12('0x41')]=qs['sort'](_0x4589a3[_0xff12('0x3a')]['sort']);_0x4ba267[_0xff12('0x42')]=qs[_0xff12('0x43')](_['pick'](_0x4589a3['query'],_0x5ae576[_0xff12('0x43')]),_0x47e718);var _0x465111=[];var _0x541e0e=squel[_0xff12('0x44')]()[_0xff12('0x45')]('id')[_0xff12('0x45')](_0xff12('0x2a'))[_0xff12('0x45')](_0xff12('0x46'))[_0xff12('0x47')]('tools_tags');var _0x1b8f89=squel[_0xff12('0x44')]()[_0xff12('0x45')](_0xff12('0x48'))[_0xff12('0x45')](_0xff12('0x49'))['field'](_0xff12('0x4a'))['from'](_0xff12('0x4b'),'ui')['left_join']('users','u',_0xff12('0x4c'));var _0x54e925=squel['select']()[_0xff12('0x47')]('whatsapp_interactions','i')[_0xff12('0x4d')]('cm_contacts','c',_0xff12('0x4e'))[_0xff12('0x4d')](_0xff12('0x4f'),'o',_0xff12('0x50'))[_0xff12('0x4d')](_0xff12('0x51'),'a',_0xff12('0x52'))[_0xff12('0x4d')](_0xff12('0x53'),'me',_0xff12('0x54'))[_0xff12('0x4d')]('whatsapp_interaction_has_tags','it',_0xff12('0x55'))[_0xff12('0x4d')](_0xff12('0x56'),'t',_0xff12('0x57'));var _0x234756=squel[_0xff12('0x58')]();var _0x1b1a97=[];var _0x3a0a62=squel[_0xff12('0x58')]();var _0xa472b6;if(_0x4589a3[_0xff12('0x3a')][_0xff12('0x59')]){_0xa472b6=as[_0xff12('0x5a')](_0x4589a3[_0xff12('0x3a')][_0xff12('0x59')]);var _0x546193=_0xa472b6[_0xff12('0x5b')];for(var _0x13c57a=0x0;_0x13c57a<_0xa472b6[_0xff12('0x5c')][_0xff12('0x40')];_0x13c57a++){var _0x10d784=_0xa472b6['conditions'][_0x13c57a];var _0x21e3ca='i';var _0x1389a2=_[_0xff12('0x5d')](_0x47e718,[_0xff12('0x2a'),_0x10d784[_0xff12('0x45')]]);if(!_0x1389a2){switch(_0x10d784[_0xff12('0x45')]){case _0xff12('0x5e'):if(_0x10d784['value']==0x1){_0x54e925[_0xff12('0x5f')]('`'+_0x10d784['field']+'`\x20=\x200');}else{_0x54e925['having']('`'+_0x10d784[_0xff12('0x45')]+'`\x20>\x200');}break;case _0xff12('0x60'):if(_0x10d784['operator']==='$substring'){if(_0x10d784[_0xff12('0x61')][_0xff12('0x30')]('\x20')[_0xff12('0x40')]>0x1){_0x234756[_0x546193](_0xff12('0x62'),qs[_0xff12('0x63')](_0x10d784[_0xff12('0x61')]),null);}else{var _0x4a7c8a='%'+_0x10d784[_0xff12('0x61')]+'%';_0x234756[_0x546193](_0xff12('0x64'),_0x4a7c8a,_0x4a7c8a,_0x4a7c8a);}}else{_0x1389a2=_[_0xff12('0x5d')](_0x47e718,[_0xff12('0x2a'),_0xff12('0x65')]);_0x10d784[_0xff12('0x45')]=_0xff12('0x65');_0x2eca6c=as[_0xff12('0x66')](_0x21e3ca,_0x1389a2['type'],_0x10d784);_0x234756[_0x546193](_0x2eca6c['text'],_0x2eca6c['value'][_0xff12('0x67')],_0x2eca6c[_0xff12('0x61')][_0xff12('0x1b')]);}break;case'Tag':var _0x17229f=_0x10d784['value']['split'](',')[_0xff12('0x2c')](function(_0x1fcbab){return Number(_0x1fcbab);});_0x17229f[_0xff12('0x31')](function(_0x36cd3f){_0x3a0a62['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x36cd3f+',%');});_0x1b1a97=_[_0xff12('0x68')](_0x1b1a97,_0x17229f);break;case _0xff12('0x69'):if(_0x10d784['operator']==='$substring'){_0x234756[_0x546193]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x10d784[_0xff12('0x61')]+'%',null);}else{_0x1389a2=_['find'](_0x47e718,[_0xff12('0x2a'),_0xff12('0x6a')]);_0x10d784[_0xff12('0x45')]=_0xff12('0x6a');_0x2eca6c=as[_0xff12('0x66')](_0x21e3ca,_0x1389a2[_0xff12('0x38')],_0x10d784);_0x234756[_0x546193](_0x2eca6c[_0xff12('0x6b')],_0x2eca6c[_0xff12('0x61')]['start'],_0x2eca6c['value']['end']);}break;case _0xff12('0x6c'):_0x2eca6c=as[_0xff12('0x66')]('me',null,_0x10d784);_0x234756[_0x546193](_0x2eca6c['text'],_0x2eca6c[_0xff12('0x61')][_0xff12('0x67')],_0x2eca6c[_0xff12('0x61')][_0xff12('0x1b')]);break;}}else{var _0x2eca6c=as[_0xff12('0x66')](_0x21e3ca,_0x1389a2[_0xff12('0x38')],_0x10d784);_0x234756[_0x546193](_0x2eca6c[_0xff12('0x6b')],_0x2eca6c[_0xff12('0x61')][_0xff12('0x67')],_0x2eca6c[_0xff12('0x61')][_0xff12('0x1b')]);}}}else{var _0x5ad82b=_(_0x4589a3['query'])[_0xff12('0x3b')]()[_0xff12('0x2c')](function(_0x44d116){return _[_0xff12('0x6d')](_0x47e718,[_0xff12('0x2a'),_0x44d116])?_0x44d116:undefined;})[_0xff12('0x6e')]()[_0xff12('0x61')]();if(!_[_0xff12('0x6f')](_0x5ad82b)){_0x5ad82b[_0xff12('0x31')](function(_0xb8d935){if(_0xb8d935==='WhatsappAccountId'){_0x54e925[_0xff12('0x42')](_0xff12('0x70'),[][_0xff12('0x71')](_0x4589a3['query'][_0xb8d935]));}else if(_0xb8d935===_0xff12('0x72')){var _0xa2c3ca=JSON[_0xff12('0x73')](_0x4589a3[_0xff12('0x3a')][_0xb8d935])[_0xff12('0x74')];var _0x18052e=JSON[_0xff12('0x73')](_0x4589a3[_0xff12('0x3a')][_0xb8d935])[_0xff12('0x75')];_0x54e925[_0xff12('0x42')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0xa2c3ca,_0x18052e);}else{if(_0x4589a3[_0xff12('0x3a')][_0xb8d935]===_0xff12('0x76')){_0x54e925['where']('i.'+_0xb8d935+_0xff12('0x77'));}else{_0x54e925[_0xff12('0x42')]('i.'+_0xb8d935+_0xff12('0x78'),_0x4589a3[_0xff12('0x3a')][_0xb8d935]);}}});}if(_0x4589a3['query'][_0xff12('0x79')]){if(_0x4589a3['query'][_0xff12('0x79')]==0x1){_0x54e925[_0xff12('0x5f')](_0xff12('0x7a'));}else{_0x54e925[_0xff12('0x5f')]('`unreadMessages`\x20>\x200');}}if(_0x4589a3[_0xff12('0x3a')][_0xff12('0x7b')]){_0x1b1a97=_[_0xff12('0x7c')](_0x4589a3[_0xff12('0x3a')][_0xff12('0x7b')])?_0x4589a3[_0xff12('0x3a')][_0xff12('0x7b')]:new Array(_0x4589a3['query']['tag']);_0x1b1a97['forEach'](function(_0x232fb6){_0x3a0a62['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x232fb6+',%');});}if(_0x4589a3[_0xff12('0x3a')][_0xff12('0x7d')]){var _0x30f9a5=_0x4589a3[_0xff12('0x3a')][_0xff12('0x7d')]['replace']('\x5c','\x5c\x5c')[_0xff12('0x7e')](/'/g,'\x27\x27');if(qs[_0xff12('0x7f')](_0x30f9a5)){_0x234756['or']('i.id\x20LIKE\x20?',_0x30f9a5+'%')['or'](_0xff12('0x80'),_0x30f9a5+'%');}else{_0x234756['or'](_0xff12('0x81'),qs[_0xff12('0x63')](_0x30f9a5))['or'](_0xff12('0x82'),_0x30f9a5+'%');}}}_0x54e925['where'](_0x234756);_0x54e925[_0xff12('0x83')](_0xff12('0x84'));var _0x33011d={'type':db[_0xff12('0x85')][_0xff12('0x86')][_0xff12('0x87')],'raw':!![]};var _0x5b1f87=_0x54e925['clone']();_0x5b1f87['field'](_0xff12('0x84'));_0x5b1f87['field'](_0xff12('0x88'),_0xff12('0x5e'));if(_0x4ba267['order']){_0x4ba267[_0xff12('0x41')][_0xff12('0x31')](function(_0x569e58){var _0x581de2=_0x569e58[0x0]==='contactName'?_0x569e58[0x0]:'i.'+_0x569e58[0x0];_0x54e925[_0xff12('0x41')](_0x581de2,_0x569e58[0x1]===_0xff12('0x89')?![]:!![]);});}if(!_['isEmpty'](_0x1b1a97)){_0x54e925[_0xff12('0x5f')](_0x3a0a62);_0x5b1f87[_0xff12('0x42')](_0xff12('0x8a'),_0x1b1a97);}BPromise['resolve']()[_0xff12('0x26')](function(){if(!_0xa472b6){if(_0x4589a3['query'][_0xff12('0x8b')])return;_0x5b1f87[_0xff12('0x42')](_0xff12('0x8c'));_0x54e925[_0xff12('0x42')](_0xff12('0x8c'));return;}if(_0x4589a3[_0xff12('0x8d')][_0xff12('0x8e')]!==_0xff12('0x8f'))return;return _0x4589a3['user'][_0xff12('0x90')]({'attributes':['id'],'raw':!![]})[_0xff12('0x26')](function(_0x5d8c4d){if(_[_0xff12('0x6f')](_0x5d8c4d)){_0x5b1f87[_0xff12('0x42')](_0xff12('0x91'));_0x54e925[_0xff12('0x42')](_0xff12('0x91'));}else{_0x5b1f87[_0xff12('0x42')](_0xff12('0x70'),_[_0xff12('0x2c')](_0x5d8c4d,'id'));_0x54e925[_0xff12('0x42')](_0xff12('0x70'),_['map'](_0x5d8c4d,'id'));}});})[_0xff12('0x26')](function(){if(_0x4589a3[_0xff12('0x8d')][_0xff12('0x8e')]===_0xff12('0x8f')&&!_0xa472b6&&!_0x4589a3[_0xff12('0x3a')][_0xff12('0x8b')])return[];return db['sequelize'][_0xff12('0x3a')](_0x5b1f87[_0xff12('0x92')](),_0x33011d);})[_0xff12('0x26')](function(_0x1d9dee){_0x5c250d[_0xff12('0x20')]=_0x1d9dee[_0xff12('0x40')];if(_0x5c250d[_0xff12('0x20')]===0x0)return[];return db[_0xff12('0x93')][_0xff12('0x3a')](_0x541e0e[_0xff12('0x92')](),_0x33011d)['then'](function(_0x34ca4f){_0x465111=_[_0xff12('0x94')](_0x34ca4f,'id');_0x33011d=_['merge'](_0x33011d,{'model':db['WhatsappInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4589a3[_0xff12('0x3a')][_0xff12('0x3f')]){_0x4ba267['attributes'][_0xff12('0x31')](function(_0x14349d){_0x54e925[_0xff12('0x45')]('i.'+_0x14349d);});}else{_0x54e925[_0xff12('0x45')](_0xff12('0x88'),_0xff12('0x5e'));_0x54e925[_0xff12('0x45')]('a.key',_0xff12('0x95'));_0x54e925[_0xff12('0x45')](_0xff12('0x96'),_0xff12('0x97'));_0x54e925[_0xff12('0x45')](_0xff12('0x98'),'contactName');_0x54e925[_0xff12('0x45')](_0xff12('0x99'));_0x54e925['field'](_0xff12('0x9a'),'Contact.firstName');_0x54e925[_0xff12('0x45')]('c.lastName',_0xff12('0x9b'));_0x54e925[_0xff12('0x45')](_0xff12('0x9c'),_0xff12('0x9d'));_0x54e925[_0xff12('0x45')]('c.phone',_0xff12('0x9e'));_0x54e925[_0xff12('0x45')](_0xff12('0x9f'),'Contact.mobile');_0x54e925[_0xff12('0x45')](_0xff12('0xa0'),_0xff12('0xa1'));_0x54e925['field']('o.fullname',_0xff12('0xa2'));_0x54e925[_0xff12('0x45')](_0xff12('0xa3'),_0xff12('0xa4'));_0x54e925['field'](_0xff12('0xa5'),_0xff12('0x2e'));}if(_0x4ba267[_0xff12('0x1f')])_0x54e925['limit'](_0x4ba267[_0xff12('0x1f')]);if(_0x4ba267['offset'])_0x54e925[_0xff12('0x1d')](_0x4ba267[_0xff12('0x1d')]);return db['sequelize'][_0xff12('0x3a')](_0x54e925['toString'](),_0x33011d);})['then'](function(_0x5f1a64){if(_0x5f1a64['length']>0x0)_0x1b8f89[_0xff12('0x42')]('ui.WhatsappInteractionId\x20IN\x20?',_[_0xff12('0x2c')](_0x5f1a64,'id'));return db[_0xff12('0x93')][_0xff12('0x3a')](_0x1b8f89[_0xff12('0x92')](),_0x33011d)[_0xff12('0x26')](function(_0x5ceff1){var _0x34e84c=_[_0xff12('0xa6')](_0x5ceff1,_0xff12('0xa7'));var _0x175f2c=[];_0x5f1a64[_0xff12('0x31')](function(_0x4d9d1f){_0x175f2c[_0xff12('0x32')](updateWhatsappInteraction(_0x4d9d1f,_0x465111,_0x34e84c));});return BPromise[_0xff12('0xa8')](_0x175f2c);});});})[_0xff12('0x26')](function(_0x15efb5){_0x5c250d[_0xff12('0xa9')]=_0x15efb5;return _0x5c250d;})[_0xff12('0x26')](respondWithFilteredResult(_0x57997f,_0x4ba267))[_0xff12('0x33')](handleError(_0x57997f,null));};exports[_0xff12('0xaa')]=function(_0x317885,_0x3407f1){var _0x595d31={'raw':![],'where':{'id':_0x317885['params']['id']}},_0x4b4528={};_0x4b4528[_0xff12('0x3d')]=_['keys'](db[_0xff12('0x35')]['rawAttributes']);_0x4b4528[_0xff12('0x3a')]=_[_0xff12('0x3b')](_0x317885[_0xff12('0x3a')]);_0x4b4528['filters']=_['intersection'](_0x4b4528[_0xff12('0x3d')],_0x4b4528[_0xff12('0x3a')]);_0x595d31[_0xff12('0x3e')]=_[_0xff12('0x3c')](_0x4b4528[_0xff12('0x3d')],qs[_0xff12('0x3f')](_0x317885[_0xff12('0x3a')]['fields']));_0x595d31[_0xff12('0x3e')]=_0x595d31[_0xff12('0x3e')]['length']?_0x595d31[_0xff12('0x3e')]:_0x4b4528[_0xff12('0x3d')];if(_0x317885[_0xff12('0x3a')][_0xff12('0xab')]){_0x595d31[_0xff12('0xac')]=[{'all':!![]}];}_0x595d31=_[_0xff12('0xad')]({},_0x595d31,_0x317885[_0xff12('0xae')]);return db[_0xff12('0x35')]['find'](_0x595d31)[_0xff12('0x26')](handleEntityNotFound(_0x3407f1,null))[_0xff12('0x26')](respondWithResult(_0x3407f1,null))[_0xff12('0x33')](handleError(_0x3407f1,null));};exports['create']=function(_0x5ac807,_0x457acc){return db[_0xff12('0x35')][_0xff12('0xaf')](_0x5ac807[_0xff12('0x6c')],{})[_0xff12('0x26')](respondWithResult(_0x457acc,0xc9))[_0xff12('0x33')](handleError(_0x457acc,null));};exports[_0xff12('0x25')]=function(_0x3b05fe,_0x53772d){if(_0x3b05fe[_0xff12('0x6c')]['id']){delete _0x3b05fe[_0xff12('0x6c')]['id'];}return db[_0xff12('0x35')]['find']({'where':{'id':_0x3b05fe[_0xff12('0xb0')]['id']}})[_0xff12('0x26')](handleEntityNotFound(_0x53772d,null))[_0xff12('0x26')](saveUpdates(_0x3b05fe[_0xff12('0x6c')],null))[_0xff12('0x26')](respondWithResult(_0x53772d,null))[_0xff12('0x33')](handleError(_0x53772d,null));};exports['destroy']=function(_0x5dc411,_0x5dced9){return db[_0xff12('0x35')][_0xff12('0x5d')]({'where':{'id':_0x5dc411[_0xff12('0xb0')]['id']}})[_0xff12('0x26')](handleEntityNotFound(_0x5dced9,null))[_0xff12('0x26')](removeEntity(_0x5dced9,null))[_0xff12('0x33')](handleError(_0x5dced9,null));};exports[_0xff12('0xb1')]=function(_0x1e63de,_0x37d89c){return db[_0xff12('0x35')][_0xff12('0xb1')]()[_0xff12('0x26')](respondWithResult(_0x37d89c,null))[_0xff12('0x33')](handleError(_0x37d89c,null));};exports['addMessage']=function(_0x3d9eb8,_0x4a61f3,_0x1ead4d){return db[_0xff12('0xb2')]['find']({'where':{'id':_0x3d9eb8['params']['id']}})[_0xff12('0x26')](handleEntityNotFound(_0x4a61f3,null))[_0xff12('0x26')](function(_0x27f82e){if(_0x27f82e){return _0x27f82e[_0xff12('0xb3')](_0x3d9eb8['body']['ids'],_['omit'](_0x3d9eb8[_0xff12('0x6c')],['ids','id'])||{});}})['then'](respondWithResult(_0x4a61f3,null))[_0xff12('0x33')](handleError(_0x4a61f3,null));};exports[_0xff12('0xb4')]=function(_0x5266b6,_0x4e5651,_0x4cd73d){var _0x1dce7f={'raw':![],'where':{}};var _0x4426e6={};var _0x2000ac={'count':0x0,'rows':[]};return db[_0xff12('0x35')][_0xff12('0xb5')]({'where':{'id':_0x5266b6['params']['id']}})[_0xff12('0x26')](handleEntityNotFound(_0x4e5651,null))['then'](function(_0x2b63d3){if(_0x2b63d3){_0x4426e6[_0xff12('0x3d')]=_['keys'](db[_0xff12('0xb2')]['rawAttributes']);_0x4426e6[_0xff12('0x3a')]=_['keys'](_0x5266b6[_0xff12('0x3a')]);_0x4426e6[_0xff12('0x43')]=_[_0xff12('0x3c')](_0x4426e6[_0xff12('0x3d')],_0x4426e6['query']);_0x1dce7f[_0xff12('0x3e')]=_[_0xff12('0x3c')](_0x4426e6['model'],qs[_0xff12('0x3f')](_0x5266b6[_0xff12('0x3a')]['fields']));_0x1dce7f['attributes']=_0x1dce7f['attributes'][_0xff12('0x40')]?_0x1dce7f[_0xff12('0x3e')]:_0x4426e6[_0xff12('0x3d')];if(!_0x5266b6[_0xff12('0x3a')]['hasOwnProperty'](_0xff12('0xb6'))){_0x1dce7f[_0xff12('0x1f')]=qs[_0xff12('0x1f')](_0x5266b6[_0xff12('0x3a')][_0xff12('0x1f')]);_0x1dce7f[_0xff12('0x1d')]=qs[_0xff12('0x1d')](_0x5266b6['query'][_0xff12('0x1d')]);}_0x1dce7f[_0xff12('0x41')]=qs['sort'](_0x5266b6[_0xff12('0x3a')][_0xff12('0xb7')]);_0x1dce7f[_0xff12('0x42')]=qs[_0xff12('0x43')](_[_0xff12('0xb8')](_0x5266b6[_0xff12('0x3a')],_0x4426e6[_0xff12('0x43')]));_0x1dce7f[_0xff12('0x42')][_0xff12('0xa7')]=_0x2b63d3['id'];if(_0x5266b6['query'][_0xff12('0x7d')]){_0x1dce7f[_0xff12('0x42')]=_[_0xff12('0xad')](_0x1dce7f[_0xff12('0x42')],{'$or':_[_0xff12('0x2c')](_0x1dce7f[_0xff12('0x3e')],function(_0x3036e2){var _0x1a562d={};_0x1a562d[_0x3036e2]={'$like':'%'+_0x5266b6[_0xff12('0x3a')]['filter']+'%'};return _0x1a562d;})});}if(_0x5266b6[_0xff12('0x3a')][_0xff12('0x74')]){var _0x183a38=_0x5266b6['query'][_0xff12('0x74')][_0xff12('0x30')](',');var _0x406ceb={};_0x406ceb[_0x183a38[0x0]]={'$gte':moment(_0x183a38[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x1dce7f[_0xff12('0x42')]=_[_0xff12('0xad')](_0x1dce7f[_0xff12('0x42')],_0x406ceb);}_0x1dce7f=_[_0xff12('0xad')]({},_0x1dce7f,_0x5266b6[_0xff12('0xae')]);return db['WhatsappMessage']['count']({'where':_0x1dce7f[_0xff12('0x42')]})[_0xff12('0x26')](function(_0x421414){_0x2000ac['count']=_0x421414;if(_0x5266b6[_0xff12('0x3a')][_0xff12('0xab')]){_0x1dce7f[_0xff12('0xac')]=[{'all':!![]}];}return db[_0xff12('0xb2')][_0xff12('0xb9')](_0x1dce7f);})['then'](function(_0x2f0a48){_0x2000ac[_0xff12('0xa9')]=_0x2f0a48;return _0x2000ac;});}})[_0xff12('0x26')](respondWithFilteredResult(_0x4e5651,_0x1dce7f))['catch'](handleError(_0x4e5651,null));};exports['addTags']=function(_0x561f23,_0x5c8802,_0x5b0a6a){return db[_0xff12('0x35')][_0xff12('0x5d')]({'where':{'id':_0x561f23[_0xff12('0xb0')]['id']}})[_0xff12('0x26')](handleEntityNotFound(_0x5c8802,null))[_0xff12('0x26')](function(_0x37dbd8){if(_0x37dbd8){return _0x37dbd8['setTags'](_0x561f23[_0xff12('0x6c')][_0xff12('0xba')],_[_0xff12('0xbb')](_0x561f23['body'],[_0xff12('0xba'),'id'])||{})[_0xff12('0xbc')](function(){return db[_0xff12('0xbd')][_0xff12('0xb9')]({'attributes':['id','name',_0xff12('0x46')],'where':{'id':_0x561f23[_0xff12('0x6c')][_0xff12('0xba')]}});})[_0xff12('0x26')](function(_0x495aca){socket[_0xff12('0xbe')](_0xff12('0xbf'),{'id':Number(_0x561f23[_0xff12('0xb0')]['id']),'tags':_0x495aca||[]});return{'id':Number(_0x561f23[_0xff12('0xb0')]['id']),'tags':_0x495aca||[]};});}})[_0xff12('0x26')](respondWithResult(_0x5c8802,null))[_0xff12('0x33')](handleError(_0x5c8802,null));};exports[_0xff12('0xc0')]=function(_0x5c09bd,_0x4afa20,_0x347758){return db[_0xff12('0x35')]['find']({'where':{'id':_0x5c09bd[_0xff12('0xb0')]['id']}})[_0xff12('0x26')](handleEntityNotFound(_0x4afa20,null))[_0xff12('0x26')](function(_0x591b79){if(_0x591b79){return _0x591b79[_0xff12('0xc0')](_0x5c09bd[_0xff12('0x3a')][_0xff12('0xba')]);}})['then'](respondWithStatusCode(_0x4afa20,null))[_0xff12('0x33')](handleError(_0x4afa20,null));};exports[_0xff12('0xc1')]=function(_0xf2f1d,_0x11089f){var _0x52a4a7=moment()[_0xff12('0xc2')]()[_0xff12('0x92')]();var _0x1db250=path['join'](config['root'],'server','files',_0xff12('0xc3'));var _0x300ee7=path['join'](config['root'],_0xff12('0xc4'),_0xff12('0xc5'),_0xff12('0xc6'));var _0x34f683=path['join'](_0x1db250,_0x52a4a7);var _0x1189e0=util[_0xff12('0xc7')](_0xff12('0xc8'),_0xf2f1d[_0xff12('0xb0')]['id'],_0x52a4a7);var _0x5d7e97=path[_0xff12('0xc9')](_0x1db250,_0x1189e0);var _0x32d2b0=[];_0x32d2b0[_0xff12('0x32')]({'model':db[_0xff12('0x69')],'as':_0xff12('0x69'),'attributes':['id',_0xff12('0x2d')],'raw':!![]});_0x32d2b0[_0xff12('0x32')]({'model':db['CmContact'],'as':_0xff12('0x60'),'attributes':['id',_0xff12('0xca'),_0xff12('0xcb')],'raw':!![]});if(_0xf2f1d['query']['attachments']){_0x32d2b0[_0xff12('0x32')]({'model':db['Attachment'],'as':_0xff12('0xcc'),'raw':!![]});}var _0x4ed84b=[{'model':db[_0xff12('0xb2')],'as':_0xff12('0xcd'),'attributes':['id',_0xff12('0x6c'),_0xff12('0x72'),_0xff12('0xce'),_0xff12('0xcf'),_0xff12('0x79')],'include':_0x32d2b0}];_0x4ed84b[_0xff12('0x32')]({'model':db['WhatsappAccount'],'as':_0xff12('0xd0'),'attributes':['id',_0xff12('0x2a')]});_0x4ed84b[_0xff12('0x32')]({'model':db[_0xff12('0x69')],'as':_0xff12('0xd1'),'attributes':['id','fullname']});return db['WhatsappInteraction']['find']({'where':{'id':_0xf2f1d[_0xff12('0xb0')]['id']},'include':_0x4ed84b})[_0xff12('0x26')](handleEntityNotFound(_0x11089f,null))[_0xff12('0x26')](function(_0x5cc705){if(_0x5cc705){var _0x20990e=_0x5cc705['get']({'plain':!![]});fs[_0xff12('0xd2')](_0x34f683);var _0x271404={'channel':_0xff12('0xd3'),'account':_0x20990e['Account']['name'],'agent':_0x20990e[_0xff12('0xd1')]?_0x20990e[_0xff12('0xd1')][_0xff12('0x2d')]:_0xff12('0xd4'),'createdAt':moment(_0x20990e[_0xff12('0x72')])['format'](_0xff12('0xd5'))[_0xff12('0x92')](),'closedAt':_0x20990e['closed']?moment(_0x20990e[_0xff12('0xd6')])['format'](_0xff12('0xd5'))[_0xff12('0x92')]():'','disposition':_0x20990e['disposition'],'messages':_(_0x20990e[_0xff12('0xcd')])[_0xff12('0x7d')]({'secret':![]})[_0xff12('0x2c')](function(_0x180218){if(_0x180218[_0xff12('0xcc')]){var _0x458704=path[_0xff12('0xc9')](_0x300ee7,_0x180218[_0xff12('0xcc')]['basename']);if(fs['existsSync'](_0x458704)){fs[_0xff12('0xd7')](_0x458704)['pipe'](fs[_0xff12('0xd8')](path[_0xff12('0xc9')](_0x34f683,_0x180218['Attachment'][_0xff12('0xd9')])));}}return{'date':moment(_0x180218['createdAt'])[_0xff12('0xc7')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'sender':_0x180218[_0xff12('0xce')]===_0xff12('0xda')?_0x180218[_0xff12('0x69')]?_0x180218['User'][_0xff12('0x2d')]:_0xff12('0xdb'):_0x180218[_0xff12('0x60')][_0xff12('0xca')]+(_0x180218[_0xff12('0x60')]['lastName']?'\x20'+_0x180218[_0xff12('0x60')][_0xff12('0xcb')]:''),'body':_0x180218[_0xff12('0xcc')]?_0x180218[_0xff12('0xcc')][_0xff12('0xd9')]:_0x180218[_0xff12('0x6c')],'direction':_0x180218[_0xff12('0xce')]===_0xff12('0xda')?'A':'C','secret':_0x180218['secret'],'read':_0x180218[_0xff12('0x79')],'attachment':_0x180218[_0xff12('0xcc')]};})['value']()};return ejs[_0xff12('0xdc')](path['join'](config['root'],'server',_0xff12('0xdd'),_0xff12('0xde')),{'interaction':_0x271404})['then'](function(_0x1fbd96){var _0x4c98b2=path[_0xff12('0xc9')](_0x34f683,'transcript-'+_0x20990e['id']+'-'+_0x52a4a7+_0xff12('0xdf'));var _0xb92739={'path':_0x4c98b2,'channel':_0xff12('0xd3'),'interactionId':_0x20990e['id']};return pdf[_0xff12('0xe0')](_0x1fbd96,_0xb92739);})[_0xff12('0x26')](function(){return new BPromise(function(_0x12ee97,_0x2c828a){zipdir(_0x34f683,{'saveTo':_0x5d7e97},function(_0x9b7d57,_0xa1e875){if(_0x9b7d57)return _0x2c828a(_0x9b7d57);return _0x12ee97(_0xa1e875);});})['then'](function(){return new BPromise(function(_0x13b351,_0x2d3806){rimraf(_0x34f683,function(_0x52fd73){if(_0x52fd73)_0x2d3806(_0x52fd73);return _0x13b351();});});})[_0xff12('0x26')](function(){return _0x11089f[_0xff12('0xc1')](_0x5d7e97,_0x1189e0,function(_0x4dffdc){if(_0x4dffdc){console[_0xff12('0xe1')](_0xff12('0xe2'),_0x4dffdc);}else{fs[_0xff12('0xe3')](_0x5d7e97);}});});});}else{return _0x11089f[_0xff12('0x19')](0xc8);}})['catch'](handleError(_0x11089f,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index 8ff68ba..8671529 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 _0xc29b=['exports','events','../../mysqldb','WhatsappInteraction','WhatsappMessage','setMaxListeners','update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook'];(function(_0x5be5f9,_0x327830){var _0x2c8e64=function(_0x972432){while(--_0x972432){_0x5be5f9['push'](_0x5be5f9['shift']());}};_0x2c8e64(++_0x327830);}(_0xc29b,0x12d));var _0xbc29=function(_0x3745d9,_0x2c4bc3){_0x3745d9=_0x3745d9-0x0;var _0x23f8ab=_0xc29b[_0x3745d9];return _0x23f8ab;};'use strict';var EventEmitter=require(_0xbc29('0x0'));var WhatsappInteraction=require(_0xbc29('0x1'))['db'][_0xbc29('0x2')];var WhatsappMessage=require('../../mysqldb')['db'][_0xbc29('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0xbc29('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0xbc29('0x5'),'afterDestroy':_0xbc29('0x6')};function emitEvent(_0x217922){return function(_0xa365e8,_0x1a6a62,_0x2b8a98){_0xa365e8[_0xbc29('0x7')]({'attributes':['id'],'raw':!![]})[_0xbc29('0x8')](function(_0x463e2b){_0xa365e8[_0xbc29('0x9')](_0xbc29('0xa'),_0x463e2b[_0xbc29('0xb')](function(_0x300f5c){return{'id':_0x300f5c['id']};}));return WhatsappMessage[_0xbc29('0xc')]({'where':{'WhatsappInteractionId':_0xa365e8['id'],'direction':'in','read':![]},'raw':!![]});})[_0xbc29('0x8')](function(_0x36d1e3){_0xa365e8[_0xbc29('0x9')](_0xbc29('0xd'),_0x36d1e3[_0xbc29('0xe')]);WhatsappInteractionEvents[_0xbc29('0xf')](_0x217922+':'+_0xa365e8['id'],_0xa365e8);WhatsappInteractionEvents['emit'](_0x217922,_0xa365e8);_0x2b8a98(null);})[_0xbc29('0x10')](_0x2b8a98(null));};}for(var e in events){if(events[_0xbc29('0x11')](e)){var event=events[e];WhatsappInteraction[_0xbc29('0x12')](e,emitEvent(event));}}module[_0xbc29('0x13')]=WhatsappInteractionEvents; \ No newline at end of file +var _0x4e65=['../../mysqldb','WhatsappInteraction','WhatsappMessage','setMaxListeners','remove','then','setDataValue','Users','map','unreadMessages','length','emit','catch','hook'];(function(_0x52609b,_0x157389){var _0x2a2088=function(_0x411071){while(--_0x411071){_0x52609b['push'](_0x52609b['shift']());}};_0x2a2088(++_0x157389);}(_0x4e65,0xc4));var _0x54e6=function(_0x5051d5,_0x5b547a){_0x5051d5=_0x5051d5-0x0;var _0x110fed=_0x4e65[_0x5051d5];return _0x110fed;};'use strict';var EventEmitter=require('events');var WhatsappInteraction=require(_0x54e6('0x0'))['db'][_0x54e6('0x1')];var WhatsappMessage=require(_0x54e6('0x0'))['db'][_0x54e6('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x54e6('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x54e6('0x4')};function emitEvent(_0x337956){return function(_0x1fee1d,_0x1eb261,_0x23b09a){_0x1fee1d['getUsers']({'attributes':['id'],'raw':!![]})[_0x54e6('0x5')](function(_0x5d437f){_0x1fee1d[_0x54e6('0x6')](_0x54e6('0x7'),_0x5d437f[_0x54e6('0x8')](function(_0x18a402){return{'id':_0x18a402['id']};}));return WhatsappMessage['findAll']({'where':{'WhatsappInteractionId':_0x1fee1d['id'],'direction':'in','read':![]},'raw':!![]});})[_0x54e6('0x5')](function(_0x2050eb){_0x1fee1d[_0x54e6('0x6')](_0x54e6('0x9'),_0x2050eb[_0x54e6('0xa')]);WhatsappInteractionEvents[_0x54e6('0xb')](_0x337956+':'+_0x1fee1d['id'],_0x1fee1d);WhatsappInteractionEvents['emit'](_0x337956,_0x1fee1d);_0x23b09a(null);})[_0x54e6('0xc')](_0x23b09a(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappInteraction[_0x54e6('0xd')](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 7292f25..db740b7 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 _0xe285=['changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','../../config/environment','./whatsappInteraction.attributes','define','WhatsappInteraction','whatsapp_interactions'];(function(_0x3f8205,_0x1d7014){var _0x54e50c=function(_0x58f14b){while(--_0x58f14b){_0x3f8205['push'](_0x3f8205['shift']());}};_0x54e50c(++_0x1d7014);}(_0xe285,0xe5));var _0x5e28=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0xe285[_0x3511d3];return _0x5d6321;};'use strict';var _=require(_0x5e28('0x0'));var util=require(_0x5e28('0x1'));var logger=require(_0x5e28('0x2'))(_0x5e28('0x3'));var moment=require(_0x5e28('0x4'));var BPromise=require(_0x5e28('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5e28('0x6'));var attributes=require(_0x5e28('0x7'));module['exports']=function(_0x1df66c,_0x230bd0){return _0x1df66c[_0x5e28('0x8')](_0x5e28('0x9'),attributes,{'tableName':_0x5e28('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x48eea7,_0x5a29f2,_0x33985f){if(_0x48eea7[_0x5e28('0xb')]('closed')){_0x48eea7[_0x5e28('0xc')]=moment()[_0x5e28('0xd')](_0x5e28('0xe'));}_0x33985f(null,_0x48eea7);}}});}; \ No newline at end of file +var _0xc386=['moment','bluebird','request-promise','path','../../config/environment','define','whatsapp_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api'];(function(_0x292aeb,_0x3990e9){var _0x8e6a3=function(_0x3dcb01){while(--_0x3dcb01){_0x292aeb['push'](_0x292aeb['shift']());}};_0x8e6a3(++_0x3990e9);}(_0xc386,0xfc));var _0x6c38=function(_0x286a88,_0x1fff26){_0x286a88=_0x286a88-0x0;var _0x35591e=_0xc386[_0x286a88];return _0x35591e;};'use strict';var _=require(_0x6c38('0x0'));var util=require(_0x6c38('0x1'));var logger=require(_0x6c38('0x2'))(_0x6c38('0x3'));var moment=require(_0x6c38('0x4'));var BPromise=require(_0x6c38('0x5'));var rp=require(_0x6c38('0x6'));var fs=require('fs');var path=require(_0x6c38('0x7'));var rimraf=require('rimraf');var config=require(_0x6c38('0x8'));var attributes=require('./whatsappInteraction.attributes');module['exports']=function(_0x56262e,_0x1b67fb){return _0x56262e[_0x6c38('0x9')]('WhatsappInteraction',attributes,{'tableName':_0x6c38('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2c6c78,_0x6915ac,_0x4dfe80){if(_0x2c6c78[_0x6c38('0xb')](_0x6c38('0xc'))){_0x2c6c78[_0x6c38('0xd')]=moment()[_0x6c38('0xe')](_0x6c38('0xf'));}_0x4dfe80(null,_0x2c6c78);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index 01004dd..5c8bb6a 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 _0xd8a9=['redis','defaults','socket.io-emitter','./whatsappInteraction.socket','request','then','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','UpdateWhatsappInteraction','WhatsappInteraction','update','body','options','raw','where','attributes','limit','stringify','addTags','omit','ids','spread','AddTags','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x474bc0,_0x26989c){var _0x4b24cf=function(_0x4be866){while(--_0x4be866){_0x474bc0['push'](_0x474bc0['shift']());}};_0x4b24cf(++_0x26989c);}(_0xd8a9,0x1b8));var _0x9d8a=function(_0x678c13,_0x24fc87){_0x678c13=_0x678c13-0x0;var _0x5a56c2=_0xd8a9[_0x678c13];return _0x5a56c2;};'use strict';var _=require(_0x9d8a('0x0'));var util=require(_0x9d8a('0x1'));var moment=require(_0x9d8a('0x2'));var BPromise=require(_0x9d8a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9d8a('0x4'))['db'];var utils=require(_0x9d8a('0x5'));var logger=require(_0x9d8a('0x6'))(_0x9d8a('0x7'));var config=require('../../config/environment');var jayson=require(_0x9d8a('0x8'));var client=jayson[_0x9d8a('0x9')][_0x9d8a('0xa')]({'port':0x232a});config[_0x9d8a('0xb')]=_[_0x9d8a('0xc')](config[_0x9d8a('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x9d8a('0xd'))(new Redis(config[_0x9d8a('0xb')]));require(_0x9d8a('0xe'))['register'](socket);function respondWithRpcPromise(_0x393239,_0x28ec15,_0x37c6f2){return new BPromise(function(_0x4d5ad3,_0x761f03){return client[_0x9d8a('0xf')](_0x393239,_0x37c6f2)[_0x9d8a('0x10')](function(_0x170afe){logger['info'](_0x9d8a('0x11'),_0x28ec15,_0x9d8a('0x12'));logger[_0x9d8a('0x13')](_0x9d8a('0x14'),_0x28ec15,_0x9d8a('0x12'),JSON['stringify'](_0x170afe));if(_0x170afe[_0x9d8a('0x15')]){if(_0x170afe[_0x9d8a('0x15')][_0x9d8a('0x16')]===0x1f4){logger['error'](_0x9d8a('0x11'),_0x28ec15,_0x170afe[_0x9d8a('0x15')][_0x9d8a('0x17')]);return _0x761f03(_0x170afe['error']['message']);}logger[_0x9d8a('0x15')](_0x9d8a('0x11'),_0x28ec15,_0x170afe[_0x9d8a('0x15')][_0x9d8a('0x17')]);return _0x4d5ad3(_0x170afe['error'][_0x9d8a('0x17')]);}else{logger[_0x9d8a('0x18')](_0x9d8a('0x11'),_0x28ec15,_0x9d8a('0x12'));_0x4d5ad3(_0x170afe['result'][_0x9d8a('0x17')]);}})[_0x9d8a('0x19')](function(_0x4b33a5){logger[_0x9d8a('0x15')](_0x9d8a('0x11'),_0x28ec15,_0x4b33a5);_0x761f03(_0x4b33a5);});});}exports[_0x9d8a('0x1a')]=function(_0x3f5a02){var _0xd4c993=this;return new Promise(function(_0x3ee2fe,_0xf4778f){return db[_0x9d8a('0x1b')][_0x9d8a('0x1c')](_0x3f5a02[_0x9d8a('0x1d')],{'raw':_0x3f5a02['options']?_0x3f5a02[_0x9d8a('0x1e')][_0x9d8a('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f5a02[_0x9d8a('0x1e')]?_0x3f5a02[_0x9d8a('0x1e')][_0x9d8a('0x20')]||null:null,'attributes':_0x3f5a02[_0x9d8a('0x1e')]?_0x3f5a02[_0x9d8a('0x1e')][_0x9d8a('0x21')]||null:null,'limit':_0x3f5a02[_0x9d8a('0x1e')]?_0x3f5a02['options'][_0x9d8a('0x22')]||null:null})[_0x9d8a('0x10')](function(_0x2c6d2c){logger[_0x9d8a('0x18')](_0x9d8a('0x1a'),_0x3f5a02);logger['debug']('UpdateWhatsappInteraction',_0x3f5a02,JSON[_0x9d8a('0x23')](_0x2c6d2c));_0x3ee2fe(_0x2c6d2c);})[_0x9d8a('0x19')](function(_0x13510d){logger[_0x9d8a('0x15')](_0x9d8a('0x1a'),_0x13510d[_0x9d8a('0x17')],_0x3f5a02);_0xf4778f(_0xd4c993[_0x9d8a('0x15')](0x1f4,_0x13510d['message']));});});};exports['AddTagsToWhatsappInteraction']=function(_0x580acf){return new Promise(function(_0x27fcdc,_0x55ce86){return db[_0x9d8a('0x1b')]['find']({'where':_0x580acf['options']?_0x580acf['options'][_0x9d8a('0x20')]||null:null})[_0x9d8a('0x10')](function(_0x2cc554){if(_0x2cc554){return _0x2cc554[_0x9d8a('0x24')](_0x580acf[_0x9d8a('0x1d')]['ids'],_[_0x9d8a('0x25')](_0x580acf[_0x9d8a('0x1d')],[_0x9d8a('0x26'),'id'])||{});}})[_0x9d8a('0x27')](function(_0x4b1047){logger['info']('AddTags',_0x580acf);logger['debug']('AddTags',_0x580acf,JSON[_0x9d8a('0x23')](_0x4b1047));_0x27fcdc(_0x4b1047);})[_0x9d8a('0x19')](function(_0x2bbc0e){logger[_0x9d8a('0x15')](_0x9d8a('0x28'),_0x2bbc0e[_0x9d8a('0x17')],_0x580acf);_0x55ce86(_this[_0x9d8a('0x15')](0x1f4,_0x2bbc0e[_0x9d8a('0x17')]));});});}; \ No newline at end of file +var _0xca19=['stringify','error','code','message','catch','UpdateWhatsappInteraction','WhatsappInteraction','update','options','raw','where','attributes','limit','then','AddTagsToWhatsappInteraction','find','addTags','ids','body','spread','AddTags','lodash','util','moment','ioredis','../../config/logger','rpc','../../config/environment','client','defaults','redis','localhost','register','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s'];(function(_0x3a3463,_0x223d11){var _0x3a075c=function(_0x5f4c2b){while(--_0x5f4c2b){_0x3a3463['push'](_0x3a3463['shift']());}};_0x3a075c(++_0x223d11);}(_0xca19,0x87));var _0x9ca1=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0xca19[_0x36eaaa];return _0x461349;};'use strict';var _=require(_0x9ca1('0x0'));var util=require(_0x9ca1('0x1'));var moment=require(_0x9ca1('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9ca1('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x9ca1('0x4'))(_0x9ca1('0x5'));var config=require(_0x9ca1('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x9ca1('0x7')]['http']({'port':0x232a});config['redis']=_[_0x9ca1('0x8')](config[_0x9ca1('0x9')],{'host':_0x9ca1('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9ca1('0x9')]));require('./whatsappInteraction.socket')[_0x9ca1('0xb')](socket);function respondWithRpcPromise(_0x15e526,_0x497732,_0x3f7bbe){return new BPromise(function(_0x5b151d,_0x3bf273){return client['request'](_0x15e526,_0x3f7bbe)['then'](function(_0x469ffa){logger[_0x9ca1('0xc')](_0x9ca1('0xd'),_0x497732,_0x9ca1('0xe'));logger[_0x9ca1('0xf')](_0x9ca1('0x10'),_0x497732,'request\x20sent',JSON[_0x9ca1('0x11')](_0x469ffa));if(_0x469ffa[_0x9ca1('0x12')]){if(_0x469ffa['error'][_0x9ca1('0x13')]===0x1f4){logger[_0x9ca1('0x12')](_0x9ca1('0xd'),_0x497732,_0x469ffa['error'][_0x9ca1('0x14')]);return _0x3bf273(_0x469ffa[_0x9ca1('0x12')][_0x9ca1('0x14')]);}logger['error']('WhatsappInteraction,\x20%s,\x20%s',_0x497732,_0x469ffa[_0x9ca1('0x12')][_0x9ca1('0x14')]);return _0x5b151d(_0x469ffa['error']['message']);}else{logger[_0x9ca1('0xc')](_0x9ca1('0xd'),_0x497732,_0x9ca1('0xe'));_0x5b151d(_0x469ffa['result'][_0x9ca1('0x14')]);}})[_0x9ca1('0x15')](function(_0x38e0db){logger[_0x9ca1('0x12')](_0x9ca1('0xd'),_0x497732,_0x38e0db);_0x3bf273(_0x38e0db);});});}exports[_0x9ca1('0x16')]=function(_0x28a208){var _0x4a75a9=this;return new Promise(function(_0x1bda1b,_0x30d3d4){return db[_0x9ca1('0x17')][_0x9ca1('0x18')](_0x28a208['body'],{'raw':_0x28a208[_0x9ca1('0x19')]?_0x28a208[_0x9ca1('0x19')][_0x9ca1('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x28a208[_0x9ca1('0x19')]?_0x28a208[_0x9ca1('0x19')][_0x9ca1('0x1b')]||null:null,'attributes':_0x28a208[_0x9ca1('0x19')]?_0x28a208[_0x9ca1('0x19')][_0x9ca1('0x1c')]||null:null,'limit':_0x28a208['options']?_0x28a208['options'][_0x9ca1('0x1d')]||null:null})[_0x9ca1('0x1e')](function(_0x82d8e3){logger['info']('UpdateWhatsappInteraction',_0x28a208);logger['debug']('UpdateWhatsappInteraction',_0x28a208,JSON[_0x9ca1('0x11')](_0x82d8e3));_0x1bda1b(_0x82d8e3);})['catch'](function(_0x331459){logger[_0x9ca1('0x12')](_0x9ca1('0x16'),_0x331459[_0x9ca1('0x14')],_0x28a208);_0x30d3d4(_0x4a75a9[_0x9ca1('0x12')](0x1f4,_0x331459[_0x9ca1('0x14')]));});});};exports[_0x9ca1('0x1f')]=function(_0x4b5ad5){return new Promise(function(_0x3fcd41,_0x520d2c){return db['WhatsappInteraction'][_0x9ca1('0x20')]({'where':_0x4b5ad5['options']?_0x4b5ad5[_0x9ca1('0x19')]['where']||null:null})[_0x9ca1('0x1e')](function(_0x593932){if(_0x593932){return _0x593932[_0x9ca1('0x21')](_0x4b5ad5['body'][_0x9ca1('0x22')],_['omit'](_0x4b5ad5[_0x9ca1('0x23')],[_0x9ca1('0x22'),'id'])||{});}})[_0x9ca1('0x24')](function(_0x3090c5){logger[_0x9ca1('0xc')]('AddTags',_0x4b5ad5);logger[_0x9ca1('0xf')](_0x9ca1('0x25'),_0x4b5ad5,JSON[_0x9ca1('0x11')](_0x3090c5));_0x3fcd41(_0x3090c5);})[_0x9ca1('0x15')](function(_0x75f21d){logger['error'](_0x9ca1('0x25'),_0x75f21d[_0x9ca1('0x14')],_0x4b5ad5);_0x520d2c(_this['error'](0x1f4,_0x75f21d[_0x9ca1('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index b71b327..ce9a24d 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 _0x8f2c=['whatsappInteraction:','./whatsappInteraction.events','save','remove','emit','register','length'];(function(_0x455fa3,_0x763d6a){var _0xe24c22=function(_0x1ab749){while(--_0x1ab749){_0x455fa3['push'](_0x455fa3['shift']());}};_0xe24c22(++_0x763d6a);}(_0x8f2c,0xe8));var _0xc8f2=function(_0x599f41,_0x4db732){_0x599f41=_0x599f41-0x0;var _0x2e4d58=_0x8f2c[_0x599f41];return _0x2e4d58;};'use strict';var WhatsappInteractionEvents=require(_0xc8f2('0x0'));var events=[_0xc8f2('0x1'),_0xc8f2('0x2'),'update'];function createListener(_0x48bc76,_0x1e2bd2){return function(_0x5e1375){_0x1e2bd2[_0xc8f2('0x3')](_0x48bc76,_0x5e1375);};}function removeListener(_0xe92816,_0x37fea7){return function(){WhatsappInteractionEvents['removeListener'](_0xe92816,_0x37fea7);};}exports[_0xc8f2('0x4')]=function(_0x24aed1){for(var _0x3dc770=0x0,_0x3113f2=events[_0xc8f2('0x5')];_0x3dc770<_0x3113f2;_0x3dc770++){var _0x3d59b4=events[_0x3dc770];var _0x288a51=createListener(_0xc8f2('0x6')+_0x3d59b4,_0x24aed1);WhatsappInteractionEvents['on'](_0x3d59b4,_0x288a51);}}; \ No newline at end of file +var _0x1353=['whatsappInteraction:','./whatsappInteraction.events','save','remove','emit','removeListener','register','length'];(function(_0x146f59,_0x16e733){var _0x59d0cc=function(_0x8b7fb9){while(--_0x8b7fb9){_0x146f59['push'](_0x146f59['shift']());}};_0x59d0cc(++_0x16e733);}(_0x1353,0x81));var _0x3135=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0x1353[_0xbd08b4];return _0x314f1e;};'use strict';var WhatsappInteractionEvents=require(_0x3135('0x0'));var events=[_0x3135('0x1'),_0x3135('0x2'),'update'];function createListener(_0x1d806d,_0x114f58){return function(_0x4f0845){_0x114f58[_0x3135('0x3')](_0x1d806d,_0x4f0845);};}function removeListener(_0x1e07a1,_0x3860f2){return function(){WhatsappInteractionEvents[_0x3135('0x4')](_0x1e07a1,_0x3860f2);};}exports[_0x3135('0x5')]=function(_0x1bca1f){for(var _0x1e0a39=0x0,_0x25e8be=events[_0x3135('0x6')];_0x1e0a39<_0x25e8be;_0x1e0a39++){var _0x3224c8=events[_0x1e0a39];var _0x398a19=createListener(_0x3135('0x7')+_0x3224c8,_0x1bca1f);WhatsappInteractionEvents['on'](_0x3224c8,_0x398a19);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index 8baa080..5f4277b 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 _0x4143=['../../config/environment','get','index','/describe','isAuthenticated','describe','show','tracked','whatsapp','whatsappmessage:create','create','status','put','/:id','update','/:id/accept','accept','/:id/reject','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x22d5c8,_0x50858f){var _0x57e598=function(_0x55ccf5){while(--_0x55ccf5){_0x22d5c8['push'](_0x22d5c8['shift']());}};_0x57e598(++_0x50858f);}(_0x4143,0x1da));var _0x3414=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0x4143[_0x47e7cb];return _0x2a8874;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3414('0x0'));var timeout=require('connect-timeout');var express=require(_0x3414('0x1'));var router=express[_0x3414('0x2')]();var fs_extra=require(_0x3414('0x3'));var auth=require(_0x3414('0x4'));var interaction=require(_0x3414('0x5'));var config=require(_0x3414('0x6'));var controller=require('./whatsappMessage.controller');router[_0x3414('0x7')]('/',auth['isAuthenticated'](),controller[_0x3414('0x8')]);router[_0x3414('0x7')](_0x3414('0x9'),auth[_0x3414('0xa')](),controller[_0x3414('0xb')]);router[_0x3414('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x3414('0xc')]);router['post']('/',auth[_0x3414('0xa')](),interaction[_0x3414('0xd')](_0x3414('0xe'),_0x3414('0xf')),controller[_0x3414('0x10')]);router['post']('/:id/status',controller[_0x3414('0x11')]);router[_0x3414('0x12')](_0x3414('0x13'),auth['isAuthenticated'](),controller[_0x3414('0x14')]);router[_0x3414('0x12')](_0x3414('0x15'),auth[_0x3414('0xa')](),controller[_0x3414('0x16')]);router['put'](_0x3414('0x17'),auth[_0x3414('0xa')](),controller['reject']);router['delete'](_0x3414('0x13'),auth[_0x3414('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xea39=['/describe','describe','/:id','show','create','post','status','/:id/accept','accept','put','/:id/reject','reject','delete','destroy','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','get','isAuthenticated'];(function(_0x5e4ad7,_0x3ad346){var _0x5639a8=function(_0x10eb62){while(--_0x10eb62){_0x5e4ad7['push'](_0x5e4ad7['shift']());}};_0x5639a8(++_0x3ad346);}(_0xea39,0x1f2));var _0x9ea3=function(_0x3dcec7,_0x58d97c){_0x3dcec7=_0x3dcec7-0x0;var _0x1f1623=_0xea39[_0x3dcec7];return _0x1f1623;};'use strict';var multer=require('multer');var util=require(_0x9ea3('0x0'));var path=require(_0x9ea3('0x1'));var timeout=require(_0x9ea3('0x2'));var express=require('express');var router=express[_0x9ea3('0x3')]();var fs_extra=require(_0x9ea3('0x4'));var auth=require(_0x9ea3('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./whatsappMessage.controller');router[_0x9ea3('0x6')]('/',auth[_0x9ea3('0x7')](),controller['index']);router[_0x9ea3('0x6')](_0x9ea3('0x8'),auth[_0x9ea3('0x7')](),controller[_0x9ea3('0x9')]);router[_0x9ea3('0x6')](_0x9ea3('0xa'),auth[_0x9ea3('0x7')](),controller[_0x9ea3('0xb')]);router['post']('/',auth['isAuthenticated'](),interaction['tracked']('whatsapp','whatsappmessage:create'),controller[_0x9ea3('0xc')]);router[_0x9ea3('0xd')]('/:id/status',controller[_0x9ea3('0xe')]);router['put']('/:id',auth[_0x9ea3('0x7')](),controller['update']);router['put'](_0x9ea3('0xf'),auth[_0x9ea3('0x7')](),controller[_0x9ea3('0x10')]);router[_0x9ea3('0x11')](_0x9ea3('0x12'),auth[_0x9ea3('0x7')](),controller[_0x9ea3('0x13')]);router[_0x9ea3('0x14')](_0x9ea3('0xa'),auth[_0x9ea3('0x7')](),controller[_0x9ea3('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index 39d6adb..7410d60 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 _0x8fed=['sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out','STRING','DATE'];(function(_0x22e782,_0x314c09){var _0xc6a20d=function(_0x30378c){while(--_0x30378c){_0x22e782['push'](_0x22e782['shift']());}};_0xc6a20d(++_0x314c09);}(_0x8fed,0xab));var _0xd8fe=function(_0x2a8f4f,_0x4c27c4){_0x2a8f4f=_0x2a8f4f-0x0;var _0xf65fd1=_0x8fed[_0x2a8f4f];return _0xf65fd1;};'use strict';var Sequelize=require(_0xd8fe('0x0'));module[_0xd8fe('0x1')]={'body':{'type':Sequelize[_0xd8fe('0x2')](_0xd8fe('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xd8fe('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xd8fe('0x5')]('in',_0xd8fe('0x6')),'defaultValue':_0xd8fe('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0xd8fe('0x7')](0xbe)},'phone':{'type':Sequelize[_0xd8fe('0x7')]},'readAt':{'type':Sequelize[_0xd8fe('0x8')]},'secret':{'type':Sequelize[_0xd8fe('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xd8fe('0x7')]},'providerResponse':{'type':Sequelize[_0xd8fe('0x2')]}}; \ No newline at end of file +var _0x4c9c=['medium','BOOLEAN','ENUM','out','STRING','DATE','TEXT'];(function(_0xb7f071,_0x34134a){var _0xdc2c6d=function(_0x58cdff){while(--_0x58cdff){_0xb7f071['push'](_0xb7f071['shift']());}};_0xdc2c6d(++_0x34134a);}(_0x4c9c,0x180));var _0xc4c9=function(_0x1c80bd,_0x356976){_0x1c80bd=_0x1c80bd-0x0;var _0x15b7fc=_0x4c9c[_0x1c80bd];return _0x15b7fc;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0xc4c9('0x0')](_0xc4c9('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0xc4c9('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0xc4c9('0x3')]('in',_0xc4c9('0x4')),'defaultValue':_0xc4c9('0x4'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0xc4c9('0x5')]},'readAt':{'type':Sequelize[_0xc4c9('0x6')]},'secret':{'type':Sequelize[_0xc4c9('0x2')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xc4c9('0x5')]},'providerResponse':{'type':Sequelize[_0xc4c9('0x0')]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index 924dbf9..744c4f9 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 _0xa051=['findAll','show','params','rawAttributes','fields','includeAll','options','find','create','body','destroy','describe','whatsapp-interactions','accept','whatsapp','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','WhatsappInteractionId','isNil','read1stAt','interaction','user','role','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','interface','SIP/%s','channel','motionChannel','EventManager','acceptmessage','reject','WhatsappInteraction','info','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','internal','event','rejectmessage','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','twilio','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','inspect','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','./whatsappMessage.socket','jayson/promise','client','then','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','save','update','stack','send','index','map','fieldName','model','name','query','keys','filters','intersection','attributes','hasOwnProperty','order','pick','filter','where','type','VIRTUAL','merge','include','WhatsappMessage'];(function(_0xc6ff3,_0x44f1dc){var _0x88cae4=function(_0x349652){while(--_0x349652){_0xc6ff3['push'](_0xc6ff3['shift']());}};_0x88cae4(++_0x44f1dc);}(_0xa051,0x156));var _0x1a05=function(_0x281a06,_0x47de05){_0x281a06=_0x281a06-0x0;var _0x223059=_0xa051[_0x281a06];return _0x223059;};'use strict';var emlformat=require(_0x1a05('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1a05('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1a05('0x2'));var moment=require(_0x1a05('0x3'));var BPromise=require(_0x1a05('0x4'));var Mustache=require(_0x1a05('0x5'));var util=require(_0x1a05('0x6'));var path=require(_0x1a05('0x7'));var sox=require(_0x1a05('0x8'));var csv=require('to-csv');var ejs=require(_0x1a05('0x9'));var fs=require('fs');var fs_extra=require(_0x1a05('0xa'));var _=require('lodash');var squel=require(_0x1a05('0xb'));var crypto=require(_0x1a05('0xc'));var jsforce=require(_0x1a05('0xd'));var deskjs=require(_0x1a05('0xe'));var toCsv=require(_0x1a05('0xf'));var querystring=require(_0x1a05('0x10'));var Papa=require(_0x1a05('0x11'));var Redis=require(_0x1a05('0x12'));var authService=require(_0x1a05('0x13'));var qs=require(_0x1a05('0x14'));var as=require(_0x1a05('0x15'));var hardwareService=require(_0x1a05('0x16'));var logger=require(_0x1a05('0x17'))('api');var utils=require(_0x1a05('0x18'));var config=require(_0x1a05('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x1a05('0x1a'))['db'];config['redis']=_[_0x1a05('0x1b')](config[_0x1a05('0x1c')],{'host':'localhost','port':0x18eb});var socket=require(_0x1a05('0x1d'))(new Redis(config[_0x1a05('0x1c')]));require(_0x1a05('0x1e'))['register'](socket);var jayson=require(_0x1a05('0x1f'));var client=jayson[_0x1a05('0x20')]['http']({'port':0x232c});var client9002=jayson[_0x1a05('0x20')]['http']({'port':0x232a});function respondWithRpcPromise(_0xe9db9c,_0x7b8a78,_0x26104d,_0x38c00f){return new BPromise(function(_0x211d41,_0x5b1cbe){var _0x5843b0=_0x38c00f||client;return _0x5843b0['request'](_0xe9db9c,_0x26104d)[_0x1a05('0x21')](function(_0x46a22a){logger['info'](_0x1a05('0x22'),_0x7b8a78,_0x1a05('0x23'));logger[_0x1a05('0x24')](_0x1a05('0x25'),_0x7b8a78,'request\x20sent',JSON[_0x1a05('0x26')](_0x46a22a));if(_0x46a22a[_0x1a05('0x27')]){if(_0x46a22a[_0x1a05('0x27')][_0x1a05('0x28')]===0x1f4){logger[_0x1a05('0x27')](_0x1a05('0x22'),_0x7b8a78,_0x46a22a[_0x1a05('0x27')][_0x1a05('0x29')]);return _0x5b1cbe(_0x46a22a[_0x1a05('0x27')][_0x1a05('0x29')]);}logger[_0x1a05('0x27')](_0x1a05('0x22'),_0x7b8a78,_0x46a22a['error'][_0x1a05('0x29')]);return _0x211d41(_0x46a22a['error']['message']);}else{logger['info'](_0x1a05('0x22'),_0x7b8a78,'request\x20sent');_0x211d41(_0x46a22a[_0x1a05('0x2a')]['message']);}})[_0x1a05('0x2b')](function(_0x5066a9){logger[_0x1a05('0x27')]('WhatsappMessage,\x20%s,\x20%s',_0x7b8a78,_0x5066a9);_0x5b1cbe(_0x5066a9);});});}function respondWithStatusCode(_0x25891c,_0x59f4d7){_0x59f4d7=_0x59f4d7||0xcc;return function(_0x551417){if(_0x551417){return _0x25891c[_0x1a05('0x2c')](_0x59f4d7);}return _0x25891c['status'](_0x59f4d7)[_0x1a05('0x2d')]();};}function respondWithResult(_0x39b64c,_0x3e89ce){_0x3e89ce=_0x3e89ce||0xc8;return function(_0x4e4ab2){if(_0x4e4ab2){return _0x39b64c[_0x1a05('0x2e')](_0x3e89ce)[_0x1a05('0x2f')](_0x4e4ab2);}};}function respondWithFilteredResult(_0xabb6f6,_0x71e1bd){return function(_0x22d82d){if(_0x22d82d){var _0x3a812c=typeof _0x71e1bd['offset']===_0x1a05('0x30')&&typeof _0x71e1bd[_0x1a05('0x31')]===_0x1a05('0x30');var _0x49b5b4=_0x22d82d['count'];var _0x11a6dc=_0x3a812c?0x0:_0x71e1bd[_0x1a05('0x32')];var _0x1328be=_0x3a812c?_0x22d82d[_0x1a05('0x33')]:_0x71e1bd[_0x1a05('0x32')]+_0x71e1bd[_0x1a05('0x31')];var _0x16e73e;if(_0x1328be>=_0x49b5b4){_0x1328be=_0x49b5b4;_0x16e73e=0xc8;}else{_0x16e73e=0xce;}_0xabb6f6['status'](_0x16e73e);return _0xabb6f6[_0x1a05('0x34')](_0x1a05('0x35'),_0x11a6dc+'-'+_0x1328be+'/'+_0x49b5b4)[_0x1a05('0x2f')](_0x22d82d);}return null;};}function patchUpdates(_0x5d6653){return function(_0x2ef315){try{jsonpatch['apply'](_0x2ef315,_0x5d6653,!![]);}catch(_0x3efb98){return BPromise['reject'](_0x3efb98);}return _0x2ef315[_0x1a05('0x36')]();};}function saveUpdates(_0x5f4796,_0x59b256){return function(_0x4151ce){if(_0x4151ce){return _0x4151ce[_0x1a05('0x37')](_0x5f4796)[_0x1a05('0x21')](function(_0x4e0a45){return _0x4e0a45;});}return null;};}function removeEntity(_0xaefdf4,_0x5ad7b9){return function(_0x33cd80){if(_0x33cd80){return _0x33cd80['destroy']()[_0x1a05('0x21')](function(){_0xaefdf4[_0x1a05('0x2e')](0xcc)[_0x1a05('0x2d')]();});}};}function handleEntityNotFound(_0x3319bf,_0x4c764c){return function(_0x2c8a92){if(!_0x2c8a92){_0x3319bf[_0x1a05('0x2c')](0x194);}return _0x2c8a92;};}function handleError(_0x389ccc,_0x339ba1){_0x339ba1=_0x339ba1||0x1f4;return function(_0x2d4eb5){logger['error'](_0x2d4eb5[_0x1a05('0x38')]);if(_0x2d4eb5['name']){delete _0x2d4eb5['name'];}_0x389ccc[_0x1a05('0x2e')](_0x339ba1)[_0x1a05('0x39')](_0x2d4eb5);};}exports[_0x1a05('0x3a')]=function(_0x2f01db,_0x34ff4d){var _0x4a1b39={},_0x4e1d0f={},_0xca4a2f={'count':0x0,'rows':[]};var _0x520df4=_[_0x1a05('0x3b')](db['WhatsappMessage']['rawAttributes'],function(_0x5dcf3a){return{'name':_0x5dcf3a[_0x1a05('0x3c')],'type':_0x5dcf3a['type']['key']};});_0x4e1d0f[_0x1a05('0x3d')]=_['map'](_0x520df4,_0x1a05('0x3e'));_0x4e1d0f[_0x1a05('0x3f')]=_[_0x1a05('0x40')](_0x2f01db[_0x1a05('0x3f')]);_0x4e1d0f[_0x1a05('0x41')]=_[_0x1a05('0x42')](_0x4e1d0f[_0x1a05('0x3d')],_0x4e1d0f[_0x1a05('0x3f')]);_0x4a1b39[_0x1a05('0x43')]=_[_0x1a05('0x42')](_0x4e1d0f[_0x1a05('0x3d')],qs['fields'](_0x2f01db['query']['fields']));_0x4a1b39['attributes']=_0x4a1b39[_0x1a05('0x43')]['length']?_0x4a1b39[_0x1a05('0x43')]:_0x4e1d0f[_0x1a05('0x3d')];if(!_0x2f01db[_0x1a05('0x3f')][_0x1a05('0x44')]('nolimit')){_0x4a1b39[_0x1a05('0x31')]=qs['limit'](_0x2f01db[_0x1a05('0x3f')]['limit']);_0x4a1b39[_0x1a05('0x32')]=qs['offset'](_0x2f01db[_0x1a05('0x3f')][_0x1a05('0x32')]);}_0x4a1b39[_0x1a05('0x45')]=qs['sort'](_0x2f01db[_0x1a05('0x3f')]['sort']);_0x4a1b39['where']=qs['filters'](_[_0x1a05('0x46')](_0x2f01db[_0x1a05('0x3f')],_0x4e1d0f['filters']),_0x520df4);if(_0x2f01db[_0x1a05('0x3f')][_0x1a05('0x47')]){_0x4a1b39[_0x1a05('0x48')]=_['merge'](_0x4a1b39['where'],{'$or':_[_0x1a05('0x3b')](_0x520df4,function(_0x456dcf){if(_0x456dcf[_0x1a05('0x49')]!==_0x1a05('0x4a')){var _0x57dd34={};_0x57dd34[_0x456dcf[_0x1a05('0x3e')]]={'$like':'%'+_0x2f01db[_0x1a05('0x3f')][_0x1a05('0x47')]+'%'};return _0x57dd34;}})});}_0x4a1b39=_[_0x1a05('0x4b')]({},_0x4a1b39,_0x2f01db['options']);var _0x1486ae={'where':_0x4a1b39[_0x1a05('0x48')]};return db['WhatsappMessage']['count'](_0x1486ae)[_0x1a05('0x21')](function(_0x3f0492){_0xca4a2f[_0x1a05('0x33')]=_0x3f0492;if(_0x2f01db['query']['includeAll']){_0x4a1b39[_0x1a05('0x4c')]=[{'all':!![]}];}return db[_0x1a05('0x4d')][_0x1a05('0x4e')](_0x4a1b39);})['then'](function(_0x9bb801){_0xca4a2f['rows']=_0x9bb801;return _0xca4a2f;})[_0x1a05('0x21')](respondWithFilteredResult(_0x34ff4d,_0x4a1b39))[_0x1a05('0x2b')](handleError(_0x34ff4d,null));};exports[_0x1a05('0x4f')]=function(_0x5140f6,_0xa4f8c8){var _0x3dc95b={'raw':!![],'where':{'id':_0x5140f6[_0x1a05('0x50')]['id']}},_0x9959b6={};_0x9959b6[_0x1a05('0x3d')]=_[_0x1a05('0x40')](db[_0x1a05('0x4d')][_0x1a05('0x51')]);_0x9959b6['query']=_[_0x1a05('0x40')](_0x5140f6[_0x1a05('0x3f')]);_0x9959b6[_0x1a05('0x41')]=_['intersection'](_0x9959b6[_0x1a05('0x3d')],_0x9959b6[_0x1a05('0x3f')]);_0x3dc95b[_0x1a05('0x43')]=_[_0x1a05('0x42')](_0x9959b6[_0x1a05('0x3d')],qs['fields'](_0x5140f6[_0x1a05('0x3f')][_0x1a05('0x52')]));_0x3dc95b['attributes']=_0x3dc95b[_0x1a05('0x43')]['length']?_0x3dc95b['attributes']:_0x9959b6['model'];if(_0x5140f6[_0x1a05('0x3f')][_0x1a05('0x53')]){_0x3dc95b[_0x1a05('0x4c')]=[{'all':!![]}];}_0x3dc95b=_[_0x1a05('0x4b')]({},_0x3dc95b,_0x5140f6[_0x1a05('0x54')]);return db[_0x1a05('0x4d')][_0x1a05('0x55')](_0x3dc95b)[_0x1a05('0x21')](handleEntityNotFound(_0xa4f8c8,null))[_0x1a05('0x21')](respondWithResult(_0xa4f8c8,null))[_0x1a05('0x2b')](handleError(_0xa4f8c8,null));};exports['create']=function(_0xa10bfa,_0x15e9c0){return db[_0x1a05('0x4d')][_0x1a05('0x56')](_0xa10bfa[_0x1a05('0x57')],{})['then'](respondWithResult(_0x15e9c0,0xc9))[_0x1a05('0x2b')](handleError(_0x15e9c0,null));};exports[_0x1a05('0x37')]=function(_0x11c4b0,_0xd6291){if(_0x11c4b0['body']['id']){delete _0x11c4b0[_0x1a05('0x57')]['id'];}return db[_0x1a05('0x4d')][_0x1a05('0x55')]({'where':{'id':_0x11c4b0[_0x1a05('0x50')]['id']}})['then'](handleEntityNotFound(_0xd6291,null))[_0x1a05('0x21')](saveUpdates(_0x11c4b0['body'],null))[_0x1a05('0x21')](respondWithResult(_0xd6291,null))[_0x1a05('0x2b')](handleError(_0xd6291,null));};exports[_0x1a05('0x58')]=function(_0x370e31,_0x3d7c8c){return db[_0x1a05('0x4d')][_0x1a05('0x55')]({'where':{'id':_0x370e31[_0x1a05('0x50')]['id']}})[_0x1a05('0x21')](handleEntityNotFound(_0x3d7c8c,null))[_0x1a05('0x21')](removeEntity(_0x3d7c8c,null))[_0x1a05('0x2b')](handleError(_0x3d7c8c,null));};exports['describe']=function(_0x339dc4,_0x3201b1){return db[_0x1a05('0x4d')][_0x1a05('0x59')]()[_0x1a05('0x21')](respondWithResult(_0x3201b1,null))[_0x1a05('0x2b')](handleError(_0x3201b1,null));};var interaction_log=require(_0x1a05('0x17'))(_0x1a05('0x5a'));exports[_0x1a05('0x5b')]=function(_0x2dfbf2,_0xf01bb4,_0x5b7909){var _0x350fac={'agent':{},'channel':_0x1a05('0x5c')};if(_0x2dfbf2[_0x1a05('0x57')]['id']){delete _0x2dfbf2[_0x1a05('0x57')]['id'];}_0x2dfbf2[_0x1a05('0x57')][_0x1a05('0x5d')]=!![];_0x2dfbf2[_0x1a05('0x57')][_0x1a05('0x5e')]=moment()[_0x1a05('0x5f')](_0x1a05('0x60'));_0x2dfbf2[_0x1a05('0x57')][_0x1a05('0x61')]=_0x2dfbf2['body'][_0x1a05('0x61')]||_0x2dfbf2['user']['id'];_0x350fac[_0x1a05('0x62')]['id']=_0x2dfbf2[_0x1a05('0x57')]['UserId'];return db[_0x1a05('0x4d')][_0x1a05('0x55')]({'where':{'id':_0x2dfbf2[_0x1a05('0x50')]['id'],'UserId':null}})[_0x1a05('0x21')](handleEntityNotFound(_0xf01bb4,null))[_0x1a05('0x21')](saveUpdates(_0x2dfbf2[_0x1a05('0x57')],null))[_0x1a05('0x21')](function(_0x4e7ca9){if(_0x4e7ca9){_0x350fac[_0x1a05('0x29')]=_0x4e7ca9[_0x1a05('0x63')]({'plain':!![]});return db['WhatsappInteraction'][_0x1a05('0x55')]({'where':{'id':_0x4e7ca9[_0x1a05('0x64')]}});}return null;})[_0x1a05('0x21')](handleEntityNotFound(_0xf01bb4,null))['then'](function(_0x52e273){if(_0x52e273){return _0x52e273[_0x1a05('0x37')]({'UserId':_0x2dfbf2[_0x1a05('0x57')][_0x1a05('0x61')],'read1stAt':_[_0x1a05('0x65')](_0x52e273[_0x1a05('0x66')])?moment()[_0x1a05('0x5f')](_0x1a05('0x60')):undefined});}return null;})[_0x1a05('0x21')](function(_0x15fedf){if(_0x15fedf){_0x350fac[_0x1a05('0x67')]=_0x15fedf[_0x1a05('0x63')]({'plain':!![]});interaction_log['info']('[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2dfbf2['user']['id'],_0x2dfbf2[_0x1a05('0x68')]['name'],_0x2dfbf2['user'][_0x1a05('0x69')],_0x350fac['interaction']['id'],_0x2dfbf2[_0x1a05('0x57')]?JSON['stringify'](_0x2dfbf2['body']):'null');return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x350fac);}return null;})['then'](function(_0x3be82c){var _0xbdbf4d=_0x1a05('0x6a')+_0x3be82c[_0x1a05('0x29')][_0x1a05('0x6b')];return db[_0x1a05('0x6c')][_0x1a05('0x3f')](_0xbdbf4d,{'type':db[_0x1a05('0x6d')][_0x1a05('0x6e')][_0x1a05('0x6f')],'raw':!![]})[_0x1a05('0x21')](function(_0x1192ab){return _0x1192ab;});})[_0x1a05('0x21')](function(_0x14acc4){if(_0x14acc4){_0x350fac['message'][_0x1a05('0x70')]=_0x14acc4[0x0];if(!_0x2dfbf2[_0x1a05('0x57')][_0x1a05('0x61')])return;return db[_0x1a05('0x71')][_0x1a05('0x55')]({'where':{'id':_0x2dfbf2['body'][_0x1a05('0x61')],'role':'agent'},'attributes':['id',_0x1a05('0x3e'),_0x1a05('0x72'),_0x1a05('0x73'),'internal'],'raw':!![]});}return null;})[_0x1a05('0x21')](function(_0x20b570){if(!_0x20b570)return null;_0x350fac[_0x1a05('0x29')][_0x1a05('0x62')]=_0x20b570;return _0x350fac;})[_0x1a05('0x21')](function(_0x3ee548){if(_0x3ee548){if(_0x2dfbf2[_0x1a05('0x57')]['manual']){_0x350fac[_0x1a05('0x29')][_0x1a05('0x74')]=util['format'](_0x1a05('0x75'),_0x2dfbf2[_0x1a05('0x68')]['name']);_0x350fac[_0x1a05('0x29')][_0x1a05('0x76')]=_0x350fac['channel'];_0x350fac[_0x1a05('0x29')][_0x1a05('0x77')]=_0x350fac[_0x1a05('0x76')];_0x350fac[_0x1a05('0x29')]['event']=_0x1a05('0x5b');return respondWithRpcPromise(_0x1a05('0x78'),_0x1a05('0x78'),{'event':_0x1a05('0x79'),'message':_0x350fac[_0x1a05('0x29')]},client9002)[_0x1a05('0x21')](function(){return _0x350fac;});}return _0x350fac;}return null;})[_0x1a05('0x21')](respondWithResult(_0xf01bb4,null))[_0x1a05('0x2b')](handleError(_0xf01bb4,null));};var interaction_log=require(_0x1a05('0x17'))(_0x1a05('0x5a'));exports[_0x1a05('0x7a')]=function(_0x2adb5b,_0x4a3b7a,_0x270d32){var _0x459999={'agent':{},'channel':_0x1a05('0x5c')};if(_0x2adb5b[_0x1a05('0x57')]['id']){delete _0x2adb5b[_0x1a05('0x57')]['id'];}_0x2adb5b[_0x1a05('0x57')][_0x1a05('0x61')]=_0x2adb5b[_0x1a05('0x57')]['UserId']||_0x2adb5b['user']['id'];_0x459999[_0x1a05('0x62')]['id']=_0x2adb5b[_0x1a05('0x57')][_0x1a05('0x61')];return db[_0x1a05('0x4d')]['find']({'where':{'id':_0x2adb5b[_0x1a05('0x50')]['id'],'UserId':null}})[_0x1a05('0x21')](handleEntityNotFound(_0x4a3b7a,null))['then'](function(_0x2982f3){if(_0x2982f3){_0x459999[_0x1a05('0x29')]=_0x2982f3[_0x1a05('0x63')]({'plain':!![]});return db[_0x1a05('0x7b')][_0x1a05('0x55')]({'where':{'id':_0x2982f3[_0x1a05('0x64')]}});}return null;})[_0x1a05('0x21')](handleEntityNotFound(_0x4a3b7a,null))[_0x1a05('0x21')](function(_0x919e13){if(_0x919e13){_0x459999[_0x1a05('0x67')]=_0x919e13[_0x1a05('0x63')]({'plain':!![]});interaction_log[_0x1a05('0x7c')](_0x1a05('0x7d'),_0x2adb5b[_0x1a05('0x68')]['id'],_0x2adb5b[_0x1a05('0x68')]['name'],_0x2adb5b[_0x1a05('0x68')][_0x1a05('0x69')],_0x459999[_0x1a05('0x67')]['id'],_0x2adb5b[_0x1a05('0x57')]?JSON[_0x1a05('0x26')](_0x2adb5b[_0x1a05('0x57')]):'null');return respondWithRpcPromise(_0x1a05('0x7e'),'rejectMessage',_0x459999);}return null;})[_0x1a05('0x21')](function(_0xceaaad){var _0x595f85=_0x1a05('0x6a')+_0xceaaad['message'][_0x1a05('0x6b')];return db['sequelize'][_0x1a05('0x3f')](_0x595f85,{'type':db[_0x1a05('0x6d')]['QueryTypes'][_0x1a05('0x6f')],'raw':!![]})[_0x1a05('0x21')](function(_0x48e10a){return _0x48e10a;});})[_0x1a05('0x21')](function(_0x52691a){if(_0x52691a){_0x459999[_0x1a05('0x29')][_0x1a05('0x70')]=_0x52691a[0x0];if(!_0x2adb5b[_0x1a05('0x57')]['UserId'])return;return db[_0x1a05('0x71')][_0x1a05('0x55')]({'where':{'id':_0x2adb5b[_0x1a05('0x57')][_0x1a05('0x61')],'role':_0x1a05('0x62')},'attributes':['id','name',_0x1a05('0x72'),_0x1a05('0x73'),_0x1a05('0x7f')],'raw':!![]});}return null;})[_0x1a05('0x21')](function(_0x360242){if(!_0x360242)return null;_0x459999[_0x1a05('0x29')]['agent']=_0x360242;return _0x459999;})[_0x1a05('0x21')](function(_0x2892d8){if(_0x2892d8){_0x2892d8[_0x1a05('0x29')][_0x1a05('0x74')]=util[_0x1a05('0x5f')](_0x1a05('0x75'),_0x2adb5b[_0x1a05('0x68')][_0x1a05('0x3e')]);_0x2892d8['message'][_0x1a05('0x76')]=_0x459999[_0x1a05('0x76')];_0x2892d8[_0x1a05('0x29')][_0x1a05('0x77')]=_0x459999[_0x1a05('0x76')];_0x2892d8[_0x1a05('0x29')][_0x1a05('0x80')]=_0x1a05('0x7a');respondWithRpcPromise('EventManager',_0x1a05('0x78'),{'event':_0x1a05('0x81'),'message':_0x2892d8[_0x1a05('0x29')]},client9002);return _0x459999;}return null;})[_0x1a05('0x21')](respondWithResult(_0x4a3b7a,null))[_0x1a05('0x2b')](handleError(_0x4a3b7a,null));};exports['status']=function(_0x55ea48,_0x459bb7,_0x18b759){if(_0x55ea48[_0x1a05('0x57')]['id']){delete _0x55ea48[_0x1a05('0x57')]['id'];}var _0x140854;return db[_0x1a05('0x4d')]['find']({'where':{'id':_0x55ea48[_0x1a05('0x50')]['id']}})[_0x1a05('0x21')](handleEntityNotFound(_0x459bb7,null))['then'](function(_0x4d6c75){if(_0x4d6c75){_0x140854=_0x4d6c75;return db[_0x1a05('0x82')][_0x1a05('0x55')]({'where':{'id':_0x4d6c75[_0x1a05('0x83')]}});}})[_0x1a05('0x21')](handleEntityNotFound(_0x459bb7,null))[_0x1a05('0x21')](function(_0x37f98c){if(_0x37f98c){logger[_0x1a05('0x24')](_0x1a05('0x84'),'status',_0x1a05('0x85'),_0x37f98c[_0x1a05('0x49')],util['inspect'](_0x55ea48[_0x1a05('0x57')],{'showHidden':![],'depth':null}));switch(_0x37f98c['type']){case _0x1a05('0x86'):if(_0x55ea48[_0x1a05('0x57')][_0x1a05('0x87')]&&_0x55ea48[_0x1a05('0x57')][_0x1a05('0x87')]===_0x140854[_0x1a05('0x88')]&&_0x55ea48['body'][_0x1a05('0x89')]&&_0x55ea48[_0x1a05('0x57')][_0x1a05('0x89')]===_0x1a05('0x5d')){return _0x140854['update']({'read':!![]});}else{logger['error'](_0x1a05('0x8a'),_0x1a05('0x2e'),_0x1a05('0x86'),util[_0x1a05('0x8b')](_0x55ea48['body'],{'showHidden':![],'depth':null}));}break;}return _0x140854;}})[_0x1a05('0x21')](respondWithResult(_0x459bb7,null))[_0x1a05('0x2b')](handleError(_0x459bb7,null));}; \ No newline at end of file +var _0xd421=['mustache','util','path','to-csv','ejs','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','jayson/promise','client','http','then','info','WhatsappMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','WhatsappMessage,\x20%s,\x20%s','message','catch','sendStatus','status','end','json','undefined','count','offset','set','apply','save','update','destroy','stack','name','send','index','map','WhatsappMessage','rawAttributes','type','model','query','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','filters','pick','where','merge','VIRTUAL','options','includeAll','findAll','show','params','keys','include','find','create','body','describe','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','WhatsappInteraction','WhatsappInteractionId','read1stAt','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','sequelize','Sequelize','QueryTypes','SELECT','contact','agent','fullname','email','internal','manual','interface','SIP/%s','channel','event','accept','EventManager','acceptmessage','whatsapp','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','ContactId','User','motionChannel','rejectmessage','WhatsappAccount','debug','WhatsppMessage,\x20%s,\x20%s,\x20%s','inspect','twilio','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','eml-format','rimraf','zip-dir','request-promise','moment','bluebird'];(function(_0x10824e,_0x453512){var _0x37d872=function(_0x4d7c5d){while(--_0x4d7c5d){_0x10824e['push'](_0x10824e['shift']());}};_0x37d872(++_0x453512);}(_0xd421,0x195));var _0x1d42=function(_0x66c159,_0x2e5ecd){_0x66c159=_0x66c159-0x0;var _0x1d5ccd=_0xd421[_0x66c159];return _0x1d5ccd;};'use strict';var emlformat=require(_0x1d42('0x0'));var rimraf=require(_0x1d42('0x1'));var zipdir=require(_0x1d42('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1d42('0x3'));var moment=require(_0x1d42('0x4'));var BPromise=require(_0x1d42('0x5'));var Mustache=require(_0x1d42('0x6'));var util=require(_0x1d42('0x7'));var path=require(_0x1d42('0x8'));var sox=require('sox');var csv=require(_0x1d42('0x9'));var ejs=require(_0x1d42('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x1d42('0xb'));var jsforce=require(_0x1d42('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x1d42('0x9'));var querystring=require(_0x1d42('0xd'));var Papa=require(_0x1d42('0xe'));var Redis=require(_0x1d42('0xf'));var authService=require(_0x1d42('0x10'));var qs=require(_0x1d42('0x11'));var as=require(_0x1d42('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1d42('0x13'))(_0x1d42('0x14'));var utils=require('../../config/utils');var config=require(_0x1d42('0x15'));var licenseUtil=require(_0x1d42('0x16'));var db=require(_0x1d42('0x17'))['db'];config[_0x1d42('0x18')]=_[_0x1d42('0x19')](config['redis'],{'host':_0x1d42('0x1a'),'port':0x18eb});var socket=require(_0x1d42('0x1b'))(new Redis(config['redis']));require(_0x1d42('0x1c'))[_0x1d42('0x1d')](socket);var jayson=require(_0x1d42('0x1e'));var client=jayson[_0x1d42('0x1f')][_0x1d42('0x20')]({'port':0x232c});var client9002=jayson[_0x1d42('0x1f')][_0x1d42('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x225253,_0x596222,_0x3cdf9c,_0x2eeacf){return new BPromise(function(_0x3b768a,_0x2a7668){var _0xd77cf6=_0x2eeacf||client;return _0xd77cf6['request'](_0x225253,_0x3cdf9c)[_0x1d42('0x21')](function(_0xbd89dd){logger[_0x1d42('0x22')]('WhatsappMessage,\x20%s,\x20%s',_0x596222,'request\x20sent');logger['debug'](_0x1d42('0x23'),_0x596222,_0x1d42('0x24'),JSON[_0x1d42('0x25')](_0xbd89dd));if(_0xbd89dd['error']){if(_0xbd89dd[_0x1d42('0x26')]['code']===0x1f4){logger[_0x1d42('0x26')](_0x1d42('0x27'),_0x596222,_0xbd89dd[_0x1d42('0x26')][_0x1d42('0x28')]);return _0x2a7668(_0xbd89dd[_0x1d42('0x26')]['message']);}logger['error']('WhatsappMessage,\x20%s,\x20%s',_0x596222,_0xbd89dd[_0x1d42('0x26')][_0x1d42('0x28')]);return _0x3b768a(_0xbd89dd[_0x1d42('0x26')][_0x1d42('0x28')]);}else{logger[_0x1d42('0x22')]('WhatsappMessage,\x20%s,\x20%s',_0x596222,_0x1d42('0x24'));_0x3b768a(_0xbd89dd['result'][_0x1d42('0x28')]);}})[_0x1d42('0x29')](function(_0x4b74bf){logger[_0x1d42('0x26')](_0x1d42('0x27'),_0x596222,_0x4b74bf);_0x2a7668(_0x4b74bf);});});}function respondWithStatusCode(_0x569425,_0x23b5cf){_0x23b5cf=_0x23b5cf||0xcc;return function(_0x23c84c){if(_0x23c84c){return _0x569425[_0x1d42('0x2a')](_0x23b5cf);}return _0x569425[_0x1d42('0x2b')](_0x23b5cf)[_0x1d42('0x2c')]();};}function respondWithResult(_0x880b6e,_0x528e24){_0x528e24=_0x528e24||0xc8;return function(_0x128269){if(_0x128269){return _0x880b6e[_0x1d42('0x2b')](_0x528e24)[_0x1d42('0x2d')](_0x128269);}};}function respondWithFilteredResult(_0x4889a7,_0x44ed7a){return function(_0x256327){if(_0x256327){var _0x5987f7=typeof _0x44ed7a['offset']==='undefined'&&typeof _0x44ed7a['limit']===_0x1d42('0x2e');var _0x30cb3e=_0x256327[_0x1d42('0x2f')];var _0x37e4d3=_0x5987f7?0x0:_0x44ed7a[_0x1d42('0x30')];var _0x428bcc=_0x5987f7?_0x256327['count']:_0x44ed7a[_0x1d42('0x30')]+_0x44ed7a['limit'];var _0x31d528;if(_0x428bcc>=_0x30cb3e){_0x428bcc=_0x30cb3e;_0x31d528=0xc8;}else{_0x31d528=0xce;}_0x4889a7[_0x1d42('0x2b')](_0x31d528);return _0x4889a7[_0x1d42('0x31')]('Content-Range',_0x37e4d3+'-'+_0x428bcc+'/'+_0x30cb3e)['json'](_0x256327);}return null;};}function patchUpdates(_0x392b12){return function(_0x483067){try{jsonpatch[_0x1d42('0x32')](_0x483067,_0x392b12,!![]);}catch(_0x51936f){return BPromise['reject'](_0x51936f);}return _0x483067[_0x1d42('0x33')]();};}function saveUpdates(_0x2bb1d8,_0x357976){return function(_0x4ef1eb){if(_0x4ef1eb){return _0x4ef1eb[_0x1d42('0x34')](_0x2bb1d8)['then'](function(_0x3e83b8){return _0x3e83b8;});}return null;};}function removeEntity(_0x1cb7e5,_0x4fd583){return function(_0x3b86f9){if(_0x3b86f9){return _0x3b86f9[_0x1d42('0x35')]()[_0x1d42('0x21')](function(){_0x1cb7e5[_0x1d42('0x2b')](0xcc)[_0x1d42('0x2c')]();});}};}function handleEntityNotFound(_0x2dd711,_0x4c3be8){return function(_0x15bb86){if(!_0x15bb86){_0x2dd711[_0x1d42('0x2a')](0x194);}return _0x15bb86;};}function handleError(_0x3a6098,_0x5b4945){_0x5b4945=_0x5b4945||0x1f4;return function(_0x131cd1){logger['error'](_0x131cd1[_0x1d42('0x36')]);if(_0x131cd1[_0x1d42('0x37')]){delete _0x131cd1[_0x1d42('0x37')];}_0x3a6098['status'](_0x5b4945)[_0x1d42('0x38')](_0x131cd1);};}exports[_0x1d42('0x39')]=function(_0x688a65,_0xac3f64){var _0x510629={},_0x78dd19={},_0x57e497={'count':0x0,'rows':[]};var _0x21d131=_[_0x1d42('0x3a')](db[_0x1d42('0x3b')][_0x1d42('0x3c')],function(_0x15aa3d){return{'name':_0x15aa3d['fieldName'],'type':_0x15aa3d[_0x1d42('0x3d')]['key']};});_0x78dd19[_0x1d42('0x3e')]=_[_0x1d42('0x3a')](_0x21d131,_0x1d42('0x37'));_0x78dd19[_0x1d42('0x3f')]=_['keys'](_0x688a65['query']);_0x78dd19['filters']=_[_0x1d42('0x40')](_0x78dd19['model'],_0x78dd19[_0x1d42('0x3f')]);_0x510629[_0x1d42('0x41')]=_['intersection'](_0x78dd19[_0x1d42('0x3e')],qs[_0x1d42('0x42')](_0x688a65['query']['fields']));_0x510629[_0x1d42('0x41')]=_0x510629[_0x1d42('0x41')][_0x1d42('0x43')]?_0x510629[_0x1d42('0x41')]:_0x78dd19[_0x1d42('0x3e')];if(!_0x688a65['query'][_0x1d42('0x44')]('nolimit')){_0x510629['limit']=qs[_0x1d42('0x45')](_0x688a65[_0x1d42('0x3f')]['limit']);_0x510629[_0x1d42('0x30')]=qs[_0x1d42('0x30')](_0x688a65[_0x1d42('0x3f')][_0x1d42('0x30')]);}_0x510629[_0x1d42('0x46')]=qs[_0x1d42('0x47')](_0x688a65[_0x1d42('0x3f')][_0x1d42('0x47')]);_0x510629['where']=qs[_0x1d42('0x48')](_[_0x1d42('0x49')](_0x688a65[_0x1d42('0x3f')],_0x78dd19[_0x1d42('0x48')]),_0x21d131);if(_0x688a65[_0x1d42('0x3f')]['filter']){_0x510629[_0x1d42('0x4a')]=_[_0x1d42('0x4b')](_0x510629[_0x1d42('0x4a')],{'$or':_[_0x1d42('0x3a')](_0x21d131,function(_0x2e1fcc){if(_0x2e1fcc[_0x1d42('0x3d')]!==_0x1d42('0x4c')){var _0x42dabc={};_0x42dabc[_0x2e1fcc[_0x1d42('0x37')]]={'$like':'%'+_0x688a65[_0x1d42('0x3f')]['filter']+'%'};return _0x42dabc;}})});}_0x510629=_[_0x1d42('0x4b')]({},_0x510629,_0x688a65[_0x1d42('0x4d')]);var _0x29d41f={'where':_0x510629[_0x1d42('0x4a')]};return db['WhatsappMessage'][_0x1d42('0x2f')](_0x29d41f)[_0x1d42('0x21')](function(_0x4eb49e){_0x57e497[_0x1d42('0x2f')]=_0x4eb49e;if(_0x688a65['query'][_0x1d42('0x4e')]){_0x510629['include']=[{'all':!![]}];}return db['WhatsappMessage'][_0x1d42('0x4f')](_0x510629);})['then'](function(_0x341cff){_0x57e497['rows']=_0x341cff;return _0x57e497;})[_0x1d42('0x21')](respondWithFilteredResult(_0xac3f64,_0x510629))[_0x1d42('0x29')](handleError(_0xac3f64,null));};exports[_0x1d42('0x50')]=function(_0x40e826,_0x59003e){var _0x5af1d3={'raw':!![],'where':{'id':_0x40e826[_0x1d42('0x51')]['id']}},_0x142120={};_0x142120[_0x1d42('0x3e')]=_['keys'](db[_0x1d42('0x3b')][_0x1d42('0x3c')]);_0x142120[_0x1d42('0x3f')]=_[_0x1d42('0x52')](_0x40e826['query']);_0x142120['filters']=_[_0x1d42('0x40')](_0x142120[_0x1d42('0x3e')],_0x142120[_0x1d42('0x3f')]);_0x5af1d3[_0x1d42('0x41')]=_[_0x1d42('0x40')](_0x142120[_0x1d42('0x3e')],qs[_0x1d42('0x42')](_0x40e826['query'][_0x1d42('0x42')]));_0x5af1d3[_0x1d42('0x41')]=_0x5af1d3['attributes'][_0x1d42('0x43')]?_0x5af1d3['attributes']:_0x142120['model'];if(_0x40e826[_0x1d42('0x3f')]['includeAll']){_0x5af1d3[_0x1d42('0x53')]=[{'all':!![]}];}_0x5af1d3=_[_0x1d42('0x4b')]({},_0x5af1d3,_0x40e826['options']);return db[_0x1d42('0x3b')][_0x1d42('0x54')](_0x5af1d3)[_0x1d42('0x21')](handleEntityNotFound(_0x59003e,null))[_0x1d42('0x21')](respondWithResult(_0x59003e,null))['catch'](handleError(_0x59003e,null));};exports[_0x1d42('0x55')]=function(_0x12e5ca,_0x993fd6){return db[_0x1d42('0x3b')]['create'](_0x12e5ca[_0x1d42('0x56')],{})[_0x1d42('0x21')](respondWithResult(_0x993fd6,0xc9))[_0x1d42('0x29')](handleError(_0x993fd6,null));};exports['update']=function(_0x1dba93,_0x209a28){if(_0x1dba93['body']['id']){delete _0x1dba93[_0x1d42('0x56')]['id'];}return db[_0x1d42('0x3b')][_0x1d42('0x54')]({'where':{'id':_0x1dba93[_0x1d42('0x51')]['id']}})[_0x1d42('0x21')](handleEntityNotFound(_0x209a28,null))[_0x1d42('0x21')](saveUpdates(_0x1dba93[_0x1d42('0x56')],null))[_0x1d42('0x21')](respondWithResult(_0x209a28,null))[_0x1d42('0x29')](handleError(_0x209a28,null));};exports[_0x1d42('0x35')]=function(_0x1e9d31,_0x12251b){return db['WhatsappMessage'][_0x1d42('0x54')]({'where':{'id':_0x1e9d31['params']['id']}})[_0x1d42('0x21')](handleEntityNotFound(_0x12251b,null))[_0x1d42('0x21')](removeEntity(_0x12251b,null))[_0x1d42('0x29')](handleError(_0x12251b,null));};exports['describe']=function(_0x1f325f,_0x13345b){return db[_0x1d42('0x3b')][_0x1d42('0x57')]()[_0x1d42('0x21')](respondWithResult(_0x13345b,null))[_0x1d42('0x29')](handleError(_0x13345b,null));};var interaction_log=require('../../config/logger')('whatsapp-interactions');exports['accept']=function(_0x1df505,_0x50bdd5,_0x3e5946){var _0x529905={'agent':{},'channel':'whatsapp'};if(_0x1df505[_0x1d42('0x56')]['id']){delete _0x1df505[_0x1d42('0x56')]['id'];}_0x1df505[_0x1d42('0x56')][_0x1d42('0x58')]=!![];_0x1df505[_0x1d42('0x56')][_0x1d42('0x59')]=moment()[_0x1d42('0x5a')](_0x1d42('0x5b'));_0x1df505[_0x1d42('0x56')][_0x1d42('0x5c')]=_0x1df505['body'][_0x1d42('0x5c')]||_0x1df505[_0x1d42('0x5d')]['id'];_0x529905['agent']['id']=_0x1df505[_0x1d42('0x56')][_0x1d42('0x5c')];return db[_0x1d42('0x3b')]['find']({'where':{'id':_0x1df505['params']['id'],'UserId':null}})[_0x1d42('0x21')](handleEntityNotFound(_0x50bdd5,null))[_0x1d42('0x21')](saveUpdates(_0x1df505['body'],null))[_0x1d42('0x21')](function(_0x3e8bf){if(_0x3e8bf){_0x529905[_0x1d42('0x28')]=_0x3e8bf[_0x1d42('0x5e')]({'plain':!![]});return db[_0x1d42('0x5f')][_0x1d42('0x54')]({'where':{'id':_0x3e8bf[_0x1d42('0x60')]}});}return null;})[_0x1d42('0x21')](handleEntityNotFound(_0x50bdd5,null))[_0x1d42('0x21')](function(_0x4dc6c7){if(_0x4dc6c7){return _0x4dc6c7[_0x1d42('0x34')]({'UserId':_0x1df505[_0x1d42('0x56')]['UserId'],'read1stAt':_['isNil'](_0x4dc6c7[_0x1d42('0x61')])?moment()[_0x1d42('0x5a')](_0x1d42('0x5b')):undefined});}return null;})[_0x1d42('0x21')](function(_0x32fb82){if(_0x32fb82){_0x529905[_0x1d42('0x62')]=_0x32fb82[_0x1d42('0x5e')]({'plain':!![]});interaction_log['info'](_0x1d42('0x63'),_0x1df505[_0x1d42('0x5d')]['id'],_0x1df505['user']['name'],_0x1df505[_0x1d42('0x5d')][_0x1d42('0x64')],_0x529905[_0x1d42('0x62')]['id'],_0x1df505[_0x1d42('0x56')]?JSON['stringify'](_0x1df505[_0x1d42('0x56')]):_0x1d42('0x65'));return respondWithRpcPromise(_0x1d42('0x66'),_0x1d42('0x67'),_0x529905);}return null;})[_0x1d42('0x21')](function(_0x586b7a){var _0x45f924='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x586b7a[_0x1d42('0x28')]['ContactId'];return db[_0x1d42('0x68')]['query'](_0x45f924,{'type':db[_0x1d42('0x69')][_0x1d42('0x6a')][_0x1d42('0x6b')],'raw':!![]})[_0x1d42('0x21')](function(_0x5a72cb){return _0x5a72cb;});})[_0x1d42('0x21')](function(_0x6f2bf8){if(_0x6f2bf8){_0x529905[_0x1d42('0x28')][_0x1d42('0x6c')]=_0x6f2bf8[0x0];if(!_0x1df505[_0x1d42('0x56')]['UserId'])return;return db['User'][_0x1d42('0x54')]({'where':{'id':_0x1df505['body'][_0x1d42('0x5c')],'role':_0x1d42('0x6d')},'attributes':['id',_0x1d42('0x37'),_0x1d42('0x6e'),_0x1d42('0x6f'),_0x1d42('0x70')],'raw':!![]});}return null;})[_0x1d42('0x21')](function(_0x475486){if(!_0x475486)return null;_0x529905[_0x1d42('0x28')]['agent']=_0x475486;return _0x529905;})['then'](function(_0x515601){if(_0x515601){if(_0x1df505[_0x1d42('0x56')][_0x1d42('0x71')]){_0x529905[_0x1d42('0x28')][_0x1d42('0x72')]=util['format'](_0x1d42('0x73'),_0x1df505['user'][_0x1d42('0x37')]);_0x529905[_0x1d42('0x28')][_0x1d42('0x74')]=_0x529905[_0x1d42('0x74')];_0x529905['message']['motionChannel']=_0x529905['channel'];_0x529905[_0x1d42('0x28')][_0x1d42('0x75')]=_0x1d42('0x76');return respondWithRpcPromise(_0x1d42('0x77'),'EventManager',{'event':_0x1d42('0x78'),'message':_0x529905[_0x1d42('0x28')]},client9002)[_0x1d42('0x21')](function(){return _0x529905;});}return _0x529905;}return null;})[_0x1d42('0x21')](respondWithResult(_0x50bdd5,null))[_0x1d42('0x29')](handleError(_0x50bdd5,null));};var interaction_log=require(_0x1d42('0x13'))('whatsapp-interactions');exports['reject']=function(_0x3b1ec6,_0x1e9eff,_0x155b78){var _0x480bfb={'agent':{},'channel':_0x1d42('0x79')};if(_0x3b1ec6[_0x1d42('0x56')]['id']){delete _0x3b1ec6[_0x1d42('0x56')]['id'];}_0x3b1ec6['body'][_0x1d42('0x5c')]=_0x3b1ec6['body'][_0x1d42('0x5c')]||_0x3b1ec6['user']['id'];_0x480bfb[_0x1d42('0x6d')]['id']=_0x3b1ec6[_0x1d42('0x56')]['UserId'];return db[_0x1d42('0x3b')][_0x1d42('0x54')]({'where':{'id':_0x3b1ec6[_0x1d42('0x51')]['id'],'UserId':null}})[_0x1d42('0x21')](handleEntityNotFound(_0x1e9eff,null))[_0x1d42('0x21')](function(_0x583e43){if(_0x583e43){_0x480bfb[_0x1d42('0x28')]=_0x583e43[_0x1d42('0x5e')]({'plain':!![]});return db['WhatsappInteraction']['find']({'where':{'id':_0x583e43[_0x1d42('0x60')]}});}return null;})[_0x1d42('0x21')](handleEntityNotFound(_0x1e9eff,null))[_0x1d42('0x21')](function(_0x5eeb6a){if(_0x5eeb6a){_0x480bfb[_0x1d42('0x62')]=_0x5eeb6a[_0x1d42('0x5e')]({'plain':!![]});interaction_log[_0x1d42('0x22')](_0x1d42('0x7a'),_0x3b1ec6[_0x1d42('0x5d')]['id'],_0x3b1ec6[_0x1d42('0x5d')][_0x1d42('0x37')],_0x3b1ec6['user'][_0x1d42('0x64')],_0x480bfb[_0x1d42('0x62')]['id'],_0x3b1ec6['body']?JSON['stringify'](_0x3b1ec6[_0x1d42('0x56')]):_0x1d42('0x65'));return respondWithRpcPromise('RejectMessage',_0x1d42('0x7b'),_0x480bfb);}return null;})[_0x1d42('0x21')](function(_0x254520){var _0x52c0ea='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x254520[_0x1d42('0x28')][_0x1d42('0x7c')];return db[_0x1d42('0x68')][_0x1d42('0x3f')](_0x52c0ea,{'type':db[_0x1d42('0x69')]['QueryTypes'][_0x1d42('0x6b')],'raw':!![]})[_0x1d42('0x21')](function(_0x232df6){return _0x232df6;});})[_0x1d42('0x21')](function(_0x45ea05){if(_0x45ea05){_0x480bfb[_0x1d42('0x28')][_0x1d42('0x6c')]=_0x45ea05[0x0];if(!_0x3b1ec6[_0x1d42('0x56')][_0x1d42('0x5c')])return;return db[_0x1d42('0x7d')][_0x1d42('0x54')]({'where':{'id':_0x3b1ec6[_0x1d42('0x56')][_0x1d42('0x5c')],'role':'agent'},'attributes':['id','name',_0x1d42('0x6e'),'email',_0x1d42('0x70')],'raw':!![]});}return null;})['then'](function(_0x3f53f1){if(!_0x3f53f1)return null;_0x480bfb[_0x1d42('0x28')][_0x1d42('0x6d')]=_0x3f53f1;return _0x480bfb;})[_0x1d42('0x21')](function(_0x5d9b03){if(_0x5d9b03){_0x5d9b03[_0x1d42('0x28')][_0x1d42('0x72')]=util['format']('SIP/%s',_0x3b1ec6[_0x1d42('0x5d')][_0x1d42('0x37')]);_0x5d9b03[_0x1d42('0x28')]['channel']=_0x480bfb[_0x1d42('0x74')];_0x5d9b03[_0x1d42('0x28')][_0x1d42('0x7e')]=_0x480bfb[_0x1d42('0x74')];_0x5d9b03[_0x1d42('0x28')]['event']='reject';respondWithRpcPromise(_0x1d42('0x77'),'EventManager',{'event':_0x1d42('0x7f'),'message':_0x5d9b03['message']},client9002);return _0x480bfb;}return null;})[_0x1d42('0x21')](respondWithResult(_0x1e9eff,null))['catch'](handleError(_0x1e9eff,null));};exports[_0x1d42('0x2b')]=function(_0x3e1f56,_0x3e1aa0,_0x2d9304){if(_0x3e1f56[_0x1d42('0x56')]['id']){delete _0x3e1f56[_0x1d42('0x56')]['id'];}var _0x5ec6e4;return db[_0x1d42('0x3b')]['find']({'where':{'id':_0x3e1f56['params']['id']}})[_0x1d42('0x21')](handleEntityNotFound(_0x3e1aa0,null))[_0x1d42('0x21')](function(_0x32fc3f){if(_0x32fc3f){_0x5ec6e4=_0x32fc3f;return db[_0x1d42('0x80')]['find']({'where':{'id':_0x32fc3f['WhatsappAccountId']}});}})[_0x1d42('0x21')](handleEntityNotFound(_0x3e1aa0,null))['then'](function(_0x506173){if(_0x506173){logger[_0x1d42('0x81')](_0x1d42('0x82'),_0x1d42('0x2b'),'received\x20delivery\x20report\x20from',_0x506173[_0x1d42('0x3d')],util[_0x1d42('0x83')](_0x3e1f56[_0x1d42('0x56')],{'showHidden':![],'depth':null}));switch(_0x506173[_0x1d42('0x3d')]){case _0x1d42('0x84'):if(_0x3e1f56[_0x1d42('0x56')][_0x1d42('0x85')]&&_0x3e1f56['body'][_0x1d42('0x85')]===_0x5ec6e4[_0x1d42('0x86')]&&_0x3e1f56[_0x1d42('0x56')][_0x1d42('0x87')]&&_0x3e1f56['body']['MessageStatus']===_0x1d42('0x58')){return _0x5ec6e4[_0x1d42('0x34')]({'read':!![]});}else{logger[_0x1d42('0x26')](_0x1d42('0x88'),'status',_0x1d42('0x84'),util['inspect'](_0x3e1f56[_0x1d42('0x56')],{'showHidden':![],'depth':null}));}break;}return _0x5ec6e4;}})[_0x1d42('0x21')](respondWithResult(_0x3e1aa0,null))[_0x1d42('0x29')](handleError(_0x3e1aa0,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index 9796121..4937a41 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 _0xbee3=['emit','hook','exports','../../mysqldb','save','update'];(function(_0x221460,_0x562b4e){var _0x337c1b=function(_0x5185be){while(--_0x5185be){_0x221460['push'](_0x221460['shift']());}};_0x337c1b(++_0x562b4e);}(_0xbee3,0xd5));var _0x3bee=function(_0x46635c,_0x2c2fb7){_0x46635c=_0x46635c-0x0;var _0x1d9656=_0xbee3[_0x46635c];return _0x1d9656;};'use strict';var EventEmitter=require('events');var WhatsappMessage=require(_0x3bee('0x0'))['db']['WhatsappMessage'];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3bee('0x1'),'afterUpdate':_0x3bee('0x2'),'afterDestroy':'remove'};function emitEvent(_0x4b354b){return function(_0x1956c1,_0x1cf379,_0x507c6a){WhatsappMessageEvents[_0x3bee('0x3')](_0x4b354b+':'+_0x1956c1['id'],_0x1956c1);WhatsappMessageEvents[_0x3bee('0x3')](_0x4b354b,_0x1956c1);_0x507c6a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappMessage[_0x3bee('0x4')](e,emitEvent(event));}}module[_0x3bee('0x5')]=WhatsappMessageEvents; \ No newline at end of file +var _0x7d25=['emit','hook','exports','../../mysqldb','WhatsappMessage','setMaxListeners','save','update','remove'];(function(_0x1fb932,_0xfa56d4){var _0x25ce50=function(_0x438690){while(--_0x438690){_0x1fb932['push'](_0x1fb932['shift']());}};_0x25ce50(++_0xfa56d4);}(_0x7d25,0x8a));var _0x57d2=function(_0x576170,_0x1712ae){_0x576170=_0x576170-0x0;var _0x397c70=_0x7d25[_0x576170];return _0x397c70;};'use strict';var EventEmitter=require('events');var WhatsappMessage=require(_0x57d2('0x0'))['db'][_0x57d2('0x1')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x57d2('0x2')](0x0);var events={'afterCreate':_0x57d2('0x3'),'afterUpdate':_0x57d2('0x4'),'afterDestroy':_0x57d2('0x5')};function emitEvent(_0x308bbd){return function(_0x5c1baa,_0x5337ca,_0x52a4f4){WhatsappMessageEvents['emit'](_0x308bbd+':'+_0x5c1baa['id'],_0x5c1baa);WhatsappMessageEvents[_0x57d2('0x6')](_0x308bbd,_0x5c1baa);_0x52a4f4(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappMessage[_0x57d2('0x7')](e,emitEvent(event));}}module[_0x57d2('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 e94c187..a97f1dd 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 _0x8829=['WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','body','models','get','toLowerCase','direction','secret','isNil','UserId','WhatsappInteractionId','update','catch','out','WhatsappAccountId','then','type','twilio','accountSid','authToken','messages','create','phone','whatsapp:','/api/whatsapp/messages/','/status?token=','token','sid','error','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','finally','utf8mb4_unicode_ci','lodash','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./whatsappMessage.attributes','define'];(function(_0x3190de,_0x1582cf){var _0x858c2=function(_0x13559d){while(--_0x13559d){_0x3190de['push'](_0x3190de['shift']());}};_0x858c2(++_0x1582cf);}(_0x8829,0x195));var _0x9882=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8829[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x9882('0x0'));var util=require('util');var logger=require(_0x9882('0x1'))(_0x9882('0x2'));var moment=require('moment');var BPromise=require(_0x9882('0x3'));var rp=require(_0x9882('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9882('0x5'));var config=require(_0x9882('0x6'));var attributes=require(_0x9882('0x7'));module['exports']=function(_0x2fb7ba,_0x376266){return _0x2fb7ba[_0x9882('0x8')](_0x9882('0x9'),attributes,{'tableName':_0x9882('0xa'),'paranoid':![],'indexes':[{'name':_0x9882('0xb'),'fields':['messageId']},{'name':_0x9882('0xc'),'fields':[_0x9882('0xd')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3496e6,_0x1f9454,_0x4df5e5){var _0x325a6d=_0x2fb7ba[_0x9882('0xe')];var _0x5b32be=_0x3496e6[_0x9882('0xf')]({'plain':!![]});if(_0x5b32be['direction'][_0x9882('0x10')]()==='in'||_0x5b32be[_0x9882('0x11')][_0x9882('0x10')]()==='out'&&!_0x5b32be[_0x9882('0x12')]&&!_[_0x9882('0x13')](_0x5b32be[_0x9882('0x14')])){_0x325a6d['WhatsappInteraction']['findOne']({'where':{'id':_0x5b32be[_0x9882('0x15')]}})['then'](function(_0x447e50){if(_0x447e50){_0x447e50[_0x9882('0x16')]({'lastMsgAt':_0x5b32be['createdAt'],'lastMsgDirection':_0x5b32be[_0x9882('0x11')][_0x9882('0x10')]()});}})[_0x9882('0x17')](function(_0x3f8a7c){console['error'](_0x3f8a7c);});}if(_0x5b32be['direction']===_0x9882('0x18')&&!_0x5b32be[_0x9882('0x12')]){var _0x196e88;_0x325a6d['WhatsappAccount']['find']({'where':{'id':_0x5b32be[_0x9882('0x19')]},'raw':!![]})[_0x9882('0x1a')](function(_0x383623){_0x196e88=_0x383623;if(_0x196e88&&_0x196e88[_0x9882('0x1b')]){switch(_0x196e88[_0x9882('0x1b')]){case _0x9882('0x1c'):var _0x2e6a72=require(_0x9882('0x1c'));if(_0x196e88[_0x9882('0x1d')]&&_0x196e88[_0x9882('0x1e')]&&_0x196e88['phone']){var _0x507353=new _0x2e6a72(_0x196e88[_0x9882('0x1d')],_0x196e88[_0x9882('0x1e')]);_0x507353[_0x9882('0x1f')][_0x9882('0x20')]({'body':_0x5b32be[_0x9882('0xd')],'to':'whatsapp:'+_0x5b32be[_0x9882('0x21')],'from':_0x9882('0x22')+_0x196e88['phone'],'statusCallback':_0x196e88['remote']+_0x9882('0x23')+_0x5b32be['id']+_0x9882('0x24')+_0x196e88[_0x9882('0x25')]})[_0x9882('0x1a')](function(_0x5c2b5c){if(_0x5c2b5c[_0x9882('0x26')]){return _0x3496e6['update']({'messageId':_0x5c2b5c['sid']});}})[_0x9882('0x17')](function(_0x30d7a4){logger[_0x9882('0x27')](_0x9882('0x28'),_0x9882('0x29'),_0x9882('0x1c'),util[_0x9882('0x2a')](_0x30d7a4,{'showHidden':![],'depth':null}));});}else{logger[_0x9882('0x27')](_0x9882('0x28'),'afterCreate','twilio',_0x9882('0x2b'));}break;}}})[_0x9882('0x2c')](function(){_0x4df5e5();});}else{_0x4df5e5();}}},'charset':'utf8mb4','collate':_0x9882('0x2d')});}; \ No newline at end of file +var _0x2b42=['WhatsappInteractionId','then','createdAt','toLowerCase','catch','error','find','WhatsappAccountId','type','twilio','accountSid','authToken','messages','body','whatsapp:','phone','remote','/api/whatsapp/messages/','/status?token=','token','update','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','finally','utf8mb4','utf8mb4_unicode_ci','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappMessage.attributes','exports','define','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','models','get','direction','out','secret','isNil','UserId','WhatsappInteraction','findOne'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x2b42,0xe7));var _0x22b4=function(_0x357be4,_0x3bc32f){_0x357be4=_0x357be4-0x0;var _0xa8b73d=_0x2b42[_0x357be4];return _0xa8b73d;};'use strict';var _=require('lodash');var util=require(_0x22b4('0x0'));var logger=require('../../config/logger')(_0x22b4('0x1'));var moment=require(_0x22b4('0x2'));var BPromise=require(_0x22b4('0x3'));var rp=require(_0x22b4('0x4'));var fs=require('fs');var path=require(_0x22b4('0x5'));var rimraf=require(_0x22b4('0x6'));var config=require(_0x22b4('0x7'));var attributes=require(_0x22b4('0x8'));module[_0x22b4('0x9')]=function(_0x4a6328,_0x44f3a2){return _0x4a6328[_0x22b4('0xa')](_0x22b4('0xb'),attributes,{'tableName':_0x22b4('0xc'),'paranoid':![],'indexes':[{'name':_0x22b4('0xd'),'fields':[_0x22b4('0xd')]},{'name':_0x22b4('0xe'),'fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x47d45c,_0x137957,_0x5f0338){var _0x3e4cf3=_0x4a6328[_0x22b4('0xf')];var _0x3e3692=_0x47d45c[_0x22b4('0x10')]({'plain':!![]});if(_0x3e3692['direction']['toLowerCase']()==='in'||_0x3e3692[_0x22b4('0x11')]['toLowerCase']()===_0x22b4('0x12')&&!_0x3e3692[_0x22b4('0x13')]&&!_[_0x22b4('0x14')](_0x3e3692[_0x22b4('0x15')])){_0x3e4cf3[_0x22b4('0x16')][_0x22b4('0x17')]({'where':{'id':_0x3e3692[_0x22b4('0x18')]}})[_0x22b4('0x19')](function(_0x538740){if(_0x538740){_0x538740['update']({'lastMsgAt':_0x3e3692[_0x22b4('0x1a')],'lastMsgDirection':_0x3e3692[_0x22b4('0x11')][_0x22b4('0x1b')]()});}})[_0x22b4('0x1c')](function(_0x3b9934){console[_0x22b4('0x1d')](_0x3b9934);});}if(_0x3e3692[_0x22b4('0x11')]===_0x22b4('0x12')&&!_0x3e3692[_0x22b4('0x13')]){var _0x25493b;_0x3e4cf3['WhatsappAccount'][_0x22b4('0x1e')]({'where':{'id':_0x3e3692[_0x22b4('0x1f')]},'raw':!![]})[_0x22b4('0x19')](function(_0x57d4b6){_0x25493b=_0x57d4b6;if(_0x25493b&&_0x25493b[_0x22b4('0x20')]){switch(_0x25493b['type']){case _0x22b4('0x21'):var _0x436afe=require(_0x22b4('0x21'));if(_0x25493b[_0x22b4('0x22')]&&_0x25493b[_0x22b4('0x23')]&&_0x25493b['phone']){var _0x590cbd=new _0x436afe(_0x25493b['accountSid'],_0x25493b[_0x22b4('0x23')]);_0x590cbd[_0x22b4('0x24')]['create']({'body':_0x3e3692[_0x22b4('0x25')],'to':_0x22b4('0x26')+_0x3e3692[_0x22b4('0x27')],'from':'whatsapp:'+_0x25493b[_0x22b4('0x27')],'statusCallback':_0x25493b[_0x22b4('0x28')]+_0x22b4('0x29')+_0x3e3692['id']+_0x22b4('0x2a')+_0x25493b[_0x22b4('0x2b')]})[_0x22b4('0x19')](function(_0x4cb97c){if(_0x4cb97c['sid']){return _0x47d45c[_0x22b4('0x2c')]({'messageId':_0x4cb97c['sid']});}})[_0x22b4('0x1c')](function(_0x48bd4d){logger[_0x22b4('0x1d')](_0x22b4('0x2d'),_0x22b4('0x2e'),_0x22b4('0x21'),util[_0x22b4('0x2f')](_0x48bd4d,{'showHidden':![],'depth':null}));});}else{logger[_0x22b4('0x1d')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x22b4('0x2e'),_0x22b4('0x21'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;}}})[_0x22b4('0x30')](function(){_0x5f0338();});}else{_0x5f0338();}}},'charset':_0x22b4('0x31'),'collate':_0x22b4('0x32')});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index 92f365a..595d2ba 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 _0x6391=['register','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','error','message','result','catch','CreateWhatsappMessage','create','options','raw','debug','stringify','lodash','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','./whatsappMessage.socket'];(function(_0x8e8ca7,_0x5a5e07){var _0x561381=function(_0x2f4bda){while(--_0x2f4bda){_0x8e8ca7['push'](_0x8e8ca7['shift']());}};_0x561381(++_0x5a5e07);}(_0x6391,0x1e1));var _0x1639=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0x6391[_0x37bd26];return _0xe83dc4;};'use strict';var _=require(_0x1639('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x1639('0x1'));var rs=require(_0x1639('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1639('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x1639('0x4'))(_0x1639('0x5'));var config=require(_0x1639('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x1639('0x7')][_0x1639('0x8')]({'port':0x232a});config[_0x1639('0x9')]=_['defaults'](config['redis'],{'host':_0x1639('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1639('0x9')]));require(_0x1639('0xb'))[_0x1639('0xc')](socket);function respondWithRpcPromise(_0x247e00,_0x4780ca,_0x3b44d1){return new BPromise(function(_0x450358,_0x24a693){return client[_0x1639('0xd')](_0x247e00,_0x3b44d1)[_0x1639('0xe')](function(_0x3a899c){logger[_0x1639('0xf')](_0x1639('0x10'),_0x4780ca,_0x1639('0x11'));logger['debug'](_0x1639('0x12'),_0x4780ca,_0x1639('0x11'),JSON['stringify'](_0x3a899c));if(_0x3a899c['error']){if(_0x3a899c[_0x1639('0x13')]['code']===0x1f4){logger[_0x1639('0x13')](_0x1639('0x10'),_0x4780ca,_0x3a899c[_0x1639('0x13')][_0x1639('0x14')]);return _0x24a693(_0x3a899c[_0x1639('0x13')]['message']);}logger[_0x1639('0x13')](_0x1639('0x10'),_0x4780ca,_0x3a899c['error'][_0x1639('0x14')]);return _0x450358(_0x3a899c[_0x1639('0x13')][_0x1639('0x14')]);}else{logger['info'](_0x1639('0x10'),_0x4780ca,'request\x20sent');_0x450358(_0x3a899c[_0x1639('0x15')][_0x1639('0x14')]);}})[_0x1639('0x16')](function(_0x1e6803){logger['error'](_0x1639('0x10'),_0x4780ca,_0x1e6803);_0x24a693(_0x1e6803);});});}exports[_0x1639('0x17')]=function(_0x190202){var _0x5053d5=this;return new Promise(function(_0x3e5195,_0x290f69){return db['WhatsappMessage'][_0x1639('0x18')](_0x190202['body'],{'raw':_0x190202[_0x1639('0x19')]?_0x190202[_0x1639('0x19')][_0x1639('0x1a')]===undefined?!![]:![]:!![]})[_0x1639('0xe')](function(_0x368142){logger[_0x1639('0xf')](_0x1639('0x17'),_0x190202);logger[_0x1639('0x1b')](_0x1639('0x17'),_0x190202,JSON[_0x1639('0x1c')](_0x368142));_0x3e5195(_0x368142);})['catch'](function(_0x2d6989){logger['error']('CreateWhatsappMessage',_0x2d6989[_0x1639('0x14')],_0x190202);_0x290f69(_0x5053d5['error'](0x1f4,_0x2d6989[_0x1639('0x14')]));});});}; \ No newline at end of file +var _0x7077=['body','options','raw','then','CreateWhatsappMessage','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','redis','defaults','./whatsappMessage.socket','register','request','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','WhatsappMessage','create'];(function(_0x45f951,_0x2750c8){var _0x24756c=function(_0x31c931){while(--_0x31c931){_0x45f951['push'](_0x45f951['shift']());}};_0x24756c(++_0x2750c8);}(_0x7077,0x150));var _0x7707=function(_0x526ae9,_0x56b82c){_0x526ae9=_0x526ae9-0x0;var _0xc0f3a9=_0x7077[_0x526ae9];return _0xc0f3a9;};'use strict';var _=require(_0x7707('0x0'));var util=require(_0x7707('0x1'));var moment=require(_0x7707('0x2'));var BPromise=require(_0x7707('0x3'));var rs=require(_0x7707('0x4'));var fs=require('fs');var Redis=require(_0x7707('0x5'));var db=require(_0x7707('0x6'))['db'];var utils=require(_0x7707('0x7'));var logger=require(_0x7707('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7707('0x9'));var client=jayson['client'][_0x7707('0xa')]({'port':0x232a});config[_0x7707('0xb')]=_[_0x7707('0xc')](config[_0x7707('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x7707('0xd'))[_0x7707('0xe')](socket);function respondWithRpcPromise(_0x1c6ee6,_0x56047c,_0x5d0386){return new BPromise(function(_0x85b1ec,_0x188eea){return client[_0x7707('0xf')](_0x1c6ee6,_0x5d0386)['then'](function(_0x102eb3){logger[_0x7707('0x10')](_0x7707('0x11'),_0x56047c,_0x7707('0x12'));logger[_0x7707('0x13')](_0x7707('0x14'),_0x56047c,_0x7707('0x12'),JSON[_0x7707('0x15')](_0x102eb3));if(_0x102eb3[_0x7707('0x16')]){if(_0x102eb3[_0x7707('0x16')]['code']===0x1f4){logger[_0x7707('0x16')](_0x7707('0x11'),_0x56047c,_0x102eb3[_0x7707('0x16')][_0x7707('0x17')]);return _0x188eea(_0x102eb3['error']['message']);}logger[_0x7707('0x16')](_0x7707('0x11'),_0x56047c,_0x102eb3[_0x7707('0x16')][_0x7707('0x17')]);return _0x85b1ec(_0x102eb3[_0x7707('0x16')][_0x7707('0x17')]);}else{logger['info'](_0x7707('0x11'),_0x56047c,_0x7707('0x12'));_0x85b1ec(_0x102eb3[_0x7707('0x18')][_0x7707('0x17')]);}})['catch'](function(_0x458033){logger[_0x7707('0x16')](_0x7707('0x11'),_0x56047c,_0x458033);_0x188eea(_0x458033);});});}exports['CreateWhatsappMessage']=function(_0x1735c5){var _0x5aa183=this;return new Promise(function(_0xdf47e6,_0x1bf5f9){return db[_0x7707('0x19')][_0x7707('0x1a')](_0x1735c5[_0x7707('0x1b')],{'raw':_0x1735c5[_0x7707('0x1c')]?_0x1735c5['options'][_0x7707('0x1d')]===undefined?!![]:![]:!![]})[_0x7707('0x1e')](function(_0xfa2aab){logger[_0x7707('0x10')](_0x7707('0x1f'),_0x1735c5);logger[_0x7707('0x13')](_0x7707('0x1f'),_0x1735c5,JSON['stringify'](_0xfa2aab));_0xdf47e6(_0xfa2aab);})[_0x7707('0x20')](function(_0x409417){logger[_0x7707('0x16')]('CreateWhatsappMessage',_0x409417[_0x7707('0x17')],_0x1735c5);_0x1bf5f9(_0x5aa183[_0x7707('0x16')](0x1f4,_0x409417[_0x7707('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index 0422e06..02c6020 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 _0xa2b9=['remove','update','emit','length','whatsappMessage:','save'];(function(_0x2ba39c,_0x3fb7be){var _0x13d6c4=function(_0x4709e8){while(--_0x4709e8){_0x2ba39c['push'](_0x2ba39c['shift']());}};_0x13d6c4(++_0x3fb7be);}(_0xa2b9,0x191));var _0x9a2b=function(_0x2913fd,_0x51ca8b){_0x2913fd=_0x2913fd-0x0;var _0x486cbf=_0xa2b9[_0x2913fd];return _0x486cbf;};'use strict';var WhatsappMessageEvents=require('./whatsappMessage.events');var events=[_0x9a2b('0x0'),_0x9a2b('0x1'),_0x9a2b('0x2')];function createListener(_0x3c19a8,_0x3002cb){return function(_0x1068dd){_0x3002cb[_0x9a2b('0x3')](_0x3c19a8,_0x1068dd);};}function removeListener(_0x3aacf6,_0x3eedc6){return function(){WhatsappMessageEvents['removeListener'](_0x3aacf6,_0x3eedc6);};}exports['register']=function(_0x5d57ff){for(var _0x268634=0x0,_0x3ee3e5=events[_0x9a2b('0x4')];_0x268634<_0x3ee3e5;_0x268634++){var _0x90f715=events[_0x268634];var _0x1130be=createListener(_0x9a2b('0x5')+_0x90f715,_0x5d57ff);WhatsappMessageEvents['on'](_0x90f715,_0x1130be);}}; \ No newline at end of file +var _0x7787=['save','update','emit','removeListener','register','length','whatsappMessage:'];(function(_0xadca93,_0x14a8ea){var _0x14c33c=function(_0xb2e2d1){while(--_0xb2e2d1){_0xadca93['push'](_0xadca93['shift']());}};_0x14c33c(++_0x14a8ea);}(_0x7787,0x103));var _0x7778=function(_0x504cbb,_0x40ff83){_0x504cbb=_0x504cbb-0x0;var _0x2b08af=_0x7787[_0x504cbb];return _0x2b08af;};'use strict';var WhatsappMessageEvents=require('./whatsappMessage.events');var events=[_0x7778('0x0'),'remove',_0x7778('0x1')];function createListener(_0x573108,_0x2397d9){return function(_0x38b6e1){_0x2397d9[_0x7778('0x2')](_0x573108,_0x38b6e1);};}function removeListener(_0x249ec7,_0x51db46){return function(){WhatsappMessageEvents[_0x7778('0x3')](_0x249ec7,_0x51db46);};}exports[_0x7778('0x4')]=function(_0x1864ce){for(var _0x390e4d=0x0,_0x305fee=events[_0x7778('0x5')];_0x390e4d<_0x305fee;_0x390e4d++){var _0x58bab1=events[_0x390e4d];var _0x468538=createListener(_0x7778('0x6')+_0x58bab1,_0x1864ce);WhatsappMessageEvents['on'](_0x58bab1,_0x468538);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index 63b8123..0675ac7 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 _0x4235=['getAgents','post','create','addTeams','addAgents','put','/:id','update','delete','destroy','removeTeams','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./whatsappQueue.controller','get','index','isAuthenticated','describe','/:id/members','/:id/teams','getTeams','/:id/users'];(function(_0x3a5648,_0x58054e){var _0x34126d=function(_0x3a6476){while(--_0x3a6476){_0x3a5648['push'](_0x3a5648['shift']());}};_0x34126d(++_0x58054e);}(_0x4235,0x1cb));var _0x5423=function(_0x2f2dd0,_0x242127){_0x2f2dd0=_0x2f2dd0-0x0;var _0x3c48d1=_0x4235[_0x2f2dd0];return _0x3c48d1;};'use strict';var multer=require(_0x5423('0x0'));var util=require(_0x5423('0x1'));var path=require(_0x5423('0x2'));var timeout=require(_0x5423('0x3'));var express=require(_0x5423('0x4'));var router=express[_0x5423('0x5')]();var fs_extra=require(_0x5423('0x6'));var auth=require(_0x5423('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x5423('0x8'));router[_0x5423('0x9')]('/',auth['isAuthenticated'](),controller[_0x5423('0xa')]);router[_0x5423('0x9')]('/describe',auth[_0x5423('0xb')](),controller[_0x5423('0xc')]);router[_0x5423('0x9')]('/:id',auth[_0x5423('0xb')](),controller['show']);router[_0x5423('0x9')](_0x5423('0xd'),auth[_0x5423('0xb')](),controller['getMembers']);router[_0x5423('0x9')](_0x5423('0xe'),auth[_0x5423('0xb')](),controller[_0x5423('0xf')]);router[_0x5423('0x9')](_0x5423('0x10'),auth[_0x5423('0xb')](),controller[_0x5423('0x11')]);router[_0x5423('0x12')]('/',auth[_0x5423('0xb')](),controller[_0x5423('0x13')]);router['post'](_0x5423('0xe'),auth[_0x5423('0xb')](),controller[_0x5423('0x14')]);router[_0x5423('0x12')](_0x5423('0x10'),auth['isAuthenticated'](),controller[_0x5423('0x15')]);router[_0x5423('0x16')](_0x5423('0x17'),auth[_0x5423('0xb')](),controller[_0x5423('0x18')]);router[_0x5423('0x19')]('/:id',auth[_0x5423('0xb')](),controller[_0x5423('0x1a')]);router[_0x5423('0x19')](_0x5423('0xe'),auth[_0x5423('0xb')](),controller[_0x5423('0x1b')]);router[_0x5423('0x19')](_0x5423('0x10'),auth[_0x5423('0xb')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0x3c21=['removeAgents','exports','multer','util','path','Router','fs-extra','../../config/environment','./whatsappQueue.controller','get','isAuthenticated','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','put','delete','destroy','removeTeams'];(function(_0x5315eb,_0x4b04d3){var _0xd2d81=function(_0xe667ca){while(--_0xe667ca){_0x5315eb['push'](_0x5315eb['shift']());}};_0xd2d81(++_0x4b04d3);}(_0x3c21,0x17c));var _0x13c2=function(_0x22a7f0,_0x5690f2){_0x22a7f0=_0x22a7f0-0x0;var _0x1a1170=_0x3c21[_0x22a7f0];return _0x1a1170;};'use strict';var multer=require(_0x13c2('0x0'));var util=require(_0x13c2('0x1'));var path=require(_0x13c2('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x13c2('0x3')]();var fs_extra=require(_0x13c2('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x13c2('0x5'));var controller=require(_0x13c2('0x6'));router[_0x13c2('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x13c2('0x7')]('/describe',auth[_0x13c2('0x8')](),controller[_0x13c2('0x9')]);router[_0x13c2('0x7')](_0x13c2('0xa'),auth[_0x13c2('0x8')](),controller[_0x13c2('0xb')]);router[_0x13c2('0x7')](_0x13c2('0xc'),auth[_0x13c2('0x8')](),controller[_0x13c2('0xd')]);router[_0x13c2('0x7')](_0x13c2('0xe'),auth[_0x13c2('0x8')](),controller[_0x13c2('0xf')]);router[_0x13c2('0x7')](_0x13c2('0x10'),auth[_0x13c2('0x8')](),controller[_0x13c2('0x11')]);router[_0x13c2('0x12')]('/',auth[_0x13c2('0x8')](),controller['create']);router[_0x13c2('0x12')]('/:id/teams',auth['isAuthenticated'](),controller[_0x13c2('0x13')]);router[_0x13c2('0x12')]('/:id/users',auth['isAuthenticated'](),controller[_0x13c2('0x14')]);router[_0x13c2('0x15')]('/:id',auth[_0x13c2('0x8')](),controller['update']);router[_0x13c2('0x16')](_0x13c2('0xa'),auth['isAuthenticated'](),controller[_0x13c2('0x17')]);router[_0x13c2('0x16')](_0x13c2('0xe'),auth[_0x13c2('0x8')](),controller[_0x13c2('0x18')]);router[_0x13c2('0x16')]('/:id/users',auth[_0x13c2('0x8')](),controller[_0x13c2('0x19')]);module[_0x13c2('0x1a')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index 9f11c0c..3c0a5a9 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 _0xb910=['beepall','roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory'];(function(_0x57b5a1,_0x236a67){var _0x4758e2=function(_0xd5899e){while(--_0xd5899e){_0x57b5a1['push'](_0x57b5a1['shift']());}};_0x4758e2(++_0x236a67);}(_0xb910,0x12b));var _0x0b91=function(_0x45f951,_0x2750c8){_0x45f951=_0x45f951-0x0;var _0x24756c=_0xb910[_0x45f951];return _0x24756c;};'use strict';var Sequelize=require(_0x0b91('0x0'));module[_0x0b91('0x1')]={'name':{'type':Sequelize[_0x0b91('0x2')],'unique':_0x0b91('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x0b91('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x0b91('0x5')](_0x0b91('0x6'),_0x0b91('0x7'),_0x0b91('0x8'))},'description':{'type':Sequelize[_0x0b91('0x2')]}}; \ No newline at end of file +var _0x8fcf=['sequelize','exports','STRING','INTEGER','roundrobin'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x8fcf,0x1db));var _0xf8fc=function(_0xde2158,_0x32d048){_0xde2158=_0xde2158-0x0;var _0x2a95e3=_0x8fcf[_0xde2158];return _0x2a95e3;};'use strict';var Sequelize=require(_0xf8fc('0x0'));module[_0xf8fc('0x1')]={'name':{'type':Sequelize[_0xf8fc('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0xf8fc('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory','beepall',_0xf8fc('0x4'))},'description':{'type':Sequelize[_0xf8fc('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index c16f45e..79bd74c 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 _0x7a73=['create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserWhatsappQueue','WhatsappQueueId','User','findAndCountAll','UserId','agent','updatedAt','format','SIP','whatsappPause','createdAt','getTeams','Team','ids','Agents','voicePause','interface','flatMap','transaction','addTeams','findOrCreate','forEach','emit','userWhatsappQueue:save','select','field','tq.TeamId','from','team_has_whatsapp_queues','user_has_teams','WhatsappQueueId\x20=\x20?','push','sequelize','QueryTypes','SELECT','TeamId','includes','union','value','removeTeams','removeAgents','addAgents','omit','spread','isArray','userWhatsappQueue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','defaults','redis','localhost','socket.io-emitter','./whatsappQueue.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','update','then','destroy','get','WhatsappQueues','UserProfileResource','error','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','WhatsappQueue','findAll','rows','catch','show','params','find'];(function(_0x4ca762,_0x409bc0){var _0x354ca2=function(_0xdc2b6f){while(--_0xdc2b6f){_0x4ca762['push'](_0x4ca762['shift']());}};_0x354ca2(++_0x409bc0);}(_0x7a73,0xc6));var _0x37a7=function(_0x11bc7c,_0x208665){_0x11bc7c=_0x11bc7c-0x0;var _0x19d227=_0x7a73[_0x11bc7c];return _0x19d227;};'use strict';var emlformat=require(_0x37a7('0x0'));var rimraf=require(_0x37a7('0x1'));var zipdir=require(_0x37a7('0x2'));var jsonpatch=require(_0x37a7('0x3'));var rp=require(_0x37a7('0x4'));var moment=require('moment');var BPromise=require(_0x37a7('0x5'));var Mustache=require(_0x37a7('0x6'));var util=require(_0x37a7('0x7'));var path=require(_0x37a7('0x8'));var sox=require('sox');var csv=require(_0x37a7('0x9'));var ejs=require(_0x37a7('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x37a7('0xb'));var squel=require('squel');var crypto=require(_0x37a7('0xc'));var jsforce=require(_0x37a7('0xd'));var deskjs=require(_0x37a7('0xe'));var toCsv=require('to-csv');var querystring=require(_0x37a7('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x37a7('0x10'));var as=require(_0x37a7('0x11'));var hardwareService=require(_0x37a7('0x12'));var logger=require(_0x37a7('0x13'))(_0x37a7('0x14'));var utils=require(_0x37a7('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x37a7('0x16'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x37a7('0x17')](config[_0x37a7('0x18')],{'host':_0x37a7('0x19'),'port':0x18eb});var socket=require(_0x37a7('0x1a'))(new Redis(config[_0x37a7('0x18')]));require(_0x37a7('0x1b'))[_0x37a7('0x1c')](socket);function respondWithStatusCode(_0x39dcbb,_0x400074){_0x400074=_0x400074||0xcc;return function(_0x1d61e1){if(_0x1d61e1){return _0x39dcbb[_0x37a7('0x1d')](_0x400074);}return _0x39dcbb[_0x37a7('0x1e')](_0x400074)[_0x37a7('0x1f')]();};}function respondWithResult(_0x31b042,_0x44bad3){_0x44bad3=_0x44bad3||0xc8;return function(_0x4d28c4){if(_0x4d28c4){return _0x31b042[_0x37a7('0x1e')](_0x44bad3)['json'](_0x4d28c4);}};}function respondWithFilteredResult(_0x65d49,_0x3cd6a0){return function(_0x1183a1){if(_0x1183a1){var _0xc6996b=typeof _0x3cd6a0[_0x37a7('0x20')]===_0x37a7('0x21')&&typeof _0x3cd6a0[_0x37a7('0x22')]==='undefined';var _0x4e96cd=_0x1183a1[_0x37a7('0x23')];var _0x2cb2f1=_0xc6996b?0x0:_0x3cd6a0['offset'];var _0x2aac20=_0xc6996b?_0x1183a1['count']:_0x3cd6a0[_0x37a7('0x20')]+_0x3cd6a0[_0x37a7('0x22')];var _0x16a34f;if(_0x2aac20>=_0x4e96cd){_0x2aac20=_0x4e96cd;_0x16a34f=0xc8;}else{_0x16a34f=0xce;}_0x65d49[_0x37a7('0x1e')](_0x16a34f);return _0x65d49[_0x37a7('0x24')]('Content-Range',_0x2cb2f1+'-'+_0x2aac20+'/'+_0x4e96cd)[_0x37a7('0x25')](_0x1183a1);}return null;};}function patchUpdates(_0x2b5067){return function(_0x3a6f3e){try{jsonpatch[_0x37a7('0x26')](_0x3a6f3e,_0x2b5067,!![]);}catch(_0x21939f){return BPromise[_0x37a7('0x27')](_0x21939f);}return _0x3a6f3e[_0x37a7('0x28')]();};}function saveUpdates(_0x51f503,_0x10172c){return function(_0x252019){if(_0x252019){return _0x252019[_0x37a7('0x29')](_0x51f503)[_0x37a7('0x2a')](function(_0x503e92){return _0x503e92;});}return null;};}function removeEntity(_0x49bb66,_0x897944){return function(_0xb6464a){if(_0xb6464a){return _0xb6464a[_0x37a7('0x2b')]()[_0x37a7('0x2a')](function(){var _0x28d7a3=_0xb6464a[_0x37a7('0x2c')]({'plain':!![]});var _0x584a0c=_0x37a7('0x2d');return db[_0x37a7('0x2e')]['destroy']({'where':{'type':_0x584a0c,'resourceId':_0x28d7a3['id']}})[_0x37a7('0x2a')](function(){return _0xb6464a;});})[_0x37a7('0x2a')](function(){_0x49bb66[_0x37a7('0x1e')](0xcc)[_0x37a7('0x1f')]();});}};}function handleEntityNotFound(_0xfe212a,_0x341b67){return function(_0x4a4d88){if(!_0x4a4d88){_0xfe212a[_0x37a7('0x1d')](0x194);}return _0x4a4d88;};}function handleError(_0x170941,_0x44697a){_0x44697a=_0x44697a||0x1f4;return function(_0x3751ca){logger[_0x37a7('0x2f')](_0x3751ca['stack']);if(_0x3751ca[_0x37a7('0x30')]){delete _0x3751ca[_0x37a7('0x30')];}_0x170941[_0x37a7('0x1e')](_0x44697a)[_0x37a7('0x31')](_0x3751ca);};}exports[_0x37a7('0x32')]=function(_0x57a1b3,_0xd4c557){var _0x23a1dd={},_0x353c7a={},_0x1d1bd7={'count':0x0,'rows':[]};var _0x1204cf=_[_0x37a7('0x33')](db['WhatsappQueue'][_0x37a7('0x34')],function(_0x39c417){return{'name':_0x39c417[_0x37a7('0x35')],'type':_0x39c417[_0x37a7('0x36')]['key']};});_0x353c7a[_0x37a7('0x37')]=_[_0x37a7('0x33')](_0x1204cf,_0x37a7('0x30'));_0x353c7a[_0x37a7('0x38')]=_[_0x37a7('0x39')](_0x57a1b3[_0x37a7('0x38')]);_0x353c7a[_0x37a7('0x3a')]=_[_0x37a7('0x3b')](_0x353c7a['model'],_0x353c7a[_0x37a7('0x38')]);_0x23a1dd['attributes']=_['intersection'](_0x353c7a[_0x37a7('0x37')],qs['fields'](_0x57a1b3[_0x37a7('0x38')][_0x37a7('0x3c')]));_0x23a1dd[_0x37a7('0x3d')]=_0x23a1dd[_0x37a7('0x3d')][_0x37a7('0x3e')]?_0x23a1dd[_0x37a7('0x3d')]:_0x353c7a['model'];if(!_0x57a1b3['query'][_0x37a7('0x3f')](_0x37a7('0x40'))){_0x23a1dd['limit']=qs[_0x37a7('0x22')](_0x57a1b3[_0x37a7('0x38')][_0x37a7('0x22')]);_0x23a1dd[_0x37a7('0x20')]=qs[_0x37a7('0x20')](_0x57a1b3[_0x37a7('0x38')][_0x37a7('0x20')]);}_0x23a1dd[_0x37a7('0x41')]=qs[_0x37a7('0x42')](_0x57a1b3['query'][_0x37a7('0x42')]);_0x23a1dd['where']=qs[_0x37a7('0x3a')](_[_0x37a7('0x43')](_0x57a1b3['query'],_0x353c7a['filters']),_0x1204cf);if(_0x57a1b3[_0x37a7('0x38')][_0x37a7('0x44')]){_0x23a1dd[_0x37a7('0x45')]=_[_0x37a7('0x46')](_0x23a1dd[_0x37a7('0x45')],{'$or':_['map'](_0x1204cf,function(_0x5cd245){if(_0x5cd245[_0x37a7('0x36')]!==_0x37a7('0x47')){var _0x121ae5={};_0x121ae5[_0x5cd245[_0x37a7('0x30')]]={'$like':'%'+_0x57a1b3[_0x37a7('0x38')][_0x37a7('0x44')]+'%'};return _0x121ae5;}})});}_0x23a1dd=_['merge']({},_0x23a1dd,_0x57a1b3[_0x37a7('0x48')]);var _0x5f248c={'where':_0x23a1dd['where']};return db['WhatsappQueue'][_0x37a7('0x23')](_0x5f248c)[_0x37a7('0x2a')](function(_0x15a886){_0x1d1bd7[_0x37a7('0x23')]=_0x15a886;if(_0x57a1b3[_0x37a7('0x38')][_0x37a7('0x49')]){_0x23a1dd[_0x37a7('0x4a')]=[{'all':!![]}];}return db[_0x37a7('0x4b')][_0x37a7('0x4c')](_0x23a1dd);})[_0x37a7('0x2a')](function(_0x1a01f9){_0x1d1bd7[_0x37a7('0x4d')]=_0x1a01f9;return _0x1d1bd7;})[_0x37a7('0x2a')](respondWithFilteredResult(_0xd4c557,_0x23a1dd))[_0x37a7('0x4e')](handleError(_0xd4c557,null));};exports[_0x37a7('0x4f')]=function(_0x508dfb,_0x401283){var _0x4ea346={'raw':!![],'where':{'id':_0x508dfb[_0x37a7('0x50')]['id']}},_0x240c4c={};_0x240c4c[_0x37a7('0x37')]=_['keys'](db[_0x37a7('0x4b')][_0x37a7('0x34')]);_0x240c4c[_0x37a7('0x38')]=_[_0x37a7('0x39')](_0x508dfb[_0x37a7('0x38')]);_0x240c4c[_0x37a7('0x3a')]=_['intersection'](_0x240c4c[_0x37a7('0x37')],_0x240c4c['query']);_0x4ea346['attributes']=_[_0x37a7('0x3b')](_0x240c4c['model'],qs['fields'](_0x508dfb[_0x37a7('0x38')][_0x37a7('0x3c')]));_0x4ea346['attributes']=_0x4ea346[_0x37a7('0x3d')]['length']?_0x4ea346['attributes']:_0x240c4c['model'];if(_0x508dfb[_0x37a7('0x38')][_0x37a7('0x49')]){_0x4ea346['include']=[{'all':!![]}];}_0x4ea346=_[_0x37a7('0x46')]({},_0x4ea346,_0x508dfb[_0x37a7('0x48')]);return db['WhatsappQueue'][_0x37a7('0x51')](_0x4ea346)[_0x37a7('0x2a')](handleEntityNotFound(_0x401283,null))[_0x37a7('0x2a')](respondWithResult(_0x401283,null))[_0x37a7('0x4e')](handleError(_0x401283,null));};exports['create']=function(_0x58db0e,_0x2f6e86){return db[_0x37a7('0x4b')][_0x37a7('0x52')](_0x58db0e[_0x37a7('0x53')],{})[_0x37a7('0x2a')](function(_0x5c1f5f){var _0x5590c7=_0x58db0e[_0x37a7('0x54')][_0x37a7('0x2c')]({'plain':!![]});if(!_0x5590c7)throw new Error(_0x37a7('0x55'));if(_0x5590c7['role']===_0x37a7('0x54')){var _0x59b8c2=_0x5c1f5f[_0x37a7('0x2c')]({'plain':!![]});var _0x271ce6=_0x37a7('0x2d');return db[_0x37a7('0x56')]['find']({'where':{'name':_0x271ce6,'userProfileId':_0x5590c7[_0x37a7('0x57')]},'raw':!![]})[_0x37a7('0x2a')](function(_0x1fb156){if(_0x1fb156&&_0x1fb156[_0x37a7('0x58')]===0x0){return db[_0x37a7('0x2e')][_0x37a7('0x52')]({'name':_0x59b8c2[_0x37a7('0x30')],'resourceId':_0x59b8c2['id'],'type':_0x1fb156['name'],'sectionId':_0x1fb156['id']},{})[_0x37a7('0x2a')](function(){return _0x5c1f5f;});}else{return _0x5c1f5f;}})['catch'](function(_0xa61db7){logger[_0x37a7('0x2f')](_0x37a7('0x59'),_0xa61db7);throw _0xa61db7;});}return _0x5c1f5f;})[_0x37a7('0x2a')](respondWithResult(_0x2f6e86,0xc9))[_0x37a7('0x4e')](handleError(_0x2f6e86,null));};exports[_0x37a7('0x29')]=function(_0x20f83d,_0x222e75){if(_0x20f83d[_0x37a7('0x53')]['id']){delete _0x20f83d[_0x37a7('0x53')]['id'];}return db[_0x37a7('0x4b')][_0x37a7('0x51')]({'where':{'id':_0x20f83d['params']['id']}})[_0x37a7('0x2a')](handleEntityNotFound(_0x222e75,null))[_0x37a7('0x2a')](saveUpdates(_0x20f83d[_0x37a7('0x53')],null))[_0x37a7('0x2a')](respondWithResult(_0x222e75,null))[_0x37a7('0x4e')](handleError(_0x222e75,null));};exports[_0x37a7('0x2b')]=function(_0x24de35,_0x222e5d){return db[_0x37a7('0x4b')][_0x37a7('0x51')]({'where':{'id':_0x24de35[_0x37a7('0x50')]['id']}})[_0x37a7('0x2a')](handleEntityNotFound(_0x222e5d,null))[_0x37a7('0x2a')](removeEntity(_0x222e5d,null))['catch'](handleError(_0x222e5d,null));};exports['describe']=function(_0x5984f0,_0x4da903){return db[_0x37a7('0x4b')][_0x37a7('0x5a')]()[_0x37a7('0x2a')](respondWithResult(_0x4da903,null))[_0x37a7('0x4e')](handleError(_0x4da903,null));};exports[_0x37a7('0x5b')]=function(_0x26d52a,_0x5d84bb,_0x3c8ee3){var _0x4b4eeb={'raw':!![],'where':{}},_0x7e3a35={},_0x335358;return db[_0x37a7('0x4b')][_0x37a7('0x5c')]({'where':{'id':_0x26d52a[_0x37a7('0x50')]['id']}})[_0x37a7('0x2a')](handleEntityNotFound(_0x5d84bb,null))[_0x37a7('0x2a')](function(_0xc4b8ff){if(_0xc4b8ff){_0x335358=_0xc4b8ff['get']({'plain':!![]});_0x7e3a35['model']=_['keys'](db[_0x37a7('0x5d')]['rawAttributes']);_0x7e3a35['query']=_[_0x37a7('0x39')](_0x26d52a[_0x37a7('0x38')]);_0x7e3a35[_0x37a7('0x3a')]=_[_0x37a7('0x3b')](_0x7e3a35[_0x37a7('0x37')],_0x7e3a35[_0x37a7('0x38')]);_0x4b4eeb[_0x37a7('0x3d')]=_[_0x37a7('0x3b')](_0x7e3a35[_0x37a7('0x37')],qs[_0x37a7('0x3c')](_0x26d52a['query'][_0x37a7('0x3c')]));_0x4b4eeb[_0x37a7('0x3d')]=_0x4b4eeb[_0x37a7('0x3d')][_0x37a7('0x3e')]?_0x4b4eeb['attributes']:_0x7e3a35['model'];if(!_0x26d52a[_0x37a7('0x38')][_0x37a7('0x3f')](_0x37a7('0x40'))){_0x4b4eeb[_0x37a7('0x22')]=qs[_0x37a7('0x22')](_0x26d52a[_0x37a7('0x38')]['limit']);_0x4b4eeb[_0x37a7('0x20')]=qs[_0x37a7('0x20')](_0x26d52a['query'][_0x37a7('0x20')]);}_0x4b4eeb[_0x37a7('0x41')]=qs[_0x37a7('0x42')](_0x26d52a[_0x37a7('0x38')][_0x37a7('0x42')]);_0x4b4eeb[_0x37a7('0x45')]=qs[_0x37a7('0x3a')](_[_0x37a7('0x43')](_0x26d52a[_0x37a7('0x38')],_0x7e3a35[_0x37a7('0x3a')]));_0x4b4eeb[_0x37a7('0x45')][_0x37a7('0x5e')]=_0xc4b8ff['id'];if(_0x26d52a['query']['filter']){_0x4b4eeb[_0x37a7('0x45')]=_[_0x37a7('0x46')](_0x4b4eeb[_0x37a7('0x45')],{'$or':_[_0x37a7('0x33')](_0x4b4eeb['attributes'],function(_0x4382f6){var _0x497327={};_0x497327[_0x4382f6]={'$like':'%'+_0x26d52a[_0x37a7('0x38')][_0x37a7('0x44')]+'%'};return _0x497327;})});}_0x4b4eeb=_['merge']({},_0x4b4eeb,_0x26d52a[_0x37a7('0x48')]);return db[_0x37a7('0x5d')][_0x37a7('0x4c')](_0x4b4eeb);}})['then'](function(_0x42232c){if(_0x42232c){return db[_0x37a7('0x5f')][_0x37a7('0x60')]({'where':{'id':_[_0x37a7('0x33')](_0x42232c,_0x37a7('0x61')),'role':_0x37a7('0x62')},'attributes':['id',_0x37a7('0x30'),'whatsappPause',_0x37a7('0x63'),'createdAt']});}})[_0x37a7('0x2a')](function(_0x546570){if(_0x546570){return{'count':_0x546570[_0x37a7('0x23')],'rows':_[_0x37a7('0x33')](_0x546570[_0x37a7('0x4d')],function(_0x44f9ac){return{'membername':_0x44f9ac[_0x37a7('0x30')],'UserId':_0x44f9ac['id'],'queue_name':_0x335358[_0x37a7('0x30')],'WhatsappQueueId':_0x335358['id'],'interface':util[_0x37a7('0x64')]('%s/%s',_0x37a7('0x65'),_0x44f9ac[_0x37a7('0x30')]),'penalty':0x0,'paused':_0x44f9ac[_0x37a7('0x66')],'createdAt':_0x44f9ac[_0x37a7('0x67')],'updatedAt':_0x44f9ac['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x37a7('0x2a')](respondWithFilteredResult(_0x5d84bb,_0x4b4eeb))[_0x37a7('0x4e')](handleError(_0x5d84bb,null));};exports[_0x37a7('0x68')]=function(_0xfa14ce,_0x2c17c2,_0x21676d){var _0xe0d21b={};var _0x3572ad={};var _0x466852;var _0x562801;return db[_0x37a7('0x4b')][_0x37a7('0x5c')]({'where':{'id':_0xfa14ce['params']['id']}})[_0x37a7('0x2a')](handleEntityNotFound(_0x2c17c2,null))['then'](function(_0x883266){if(_0x883266){_0x466852=_0x883266;_0x3572ad['model']=_[_0x37a7('0x39')](db[_0x37a7('0x69')]['rawAttributes']);_0x3572ad['query']=_[_0x37a7('0x39')](_0xfa14ce[_0x37a7('0x38')]);_0x3572ad['filters']=_[_0x37a7('0x3b')](_0x3572ad[_0x37a7('0x37')],_0x3572ad[_0x37a7('0x38')]);_0xe0d21b[_0x37a7('0x3d')]=_[_0x37a7('0x3b')](_0x3572ad[_0x37a7('0x37')],qs[_0x37a7('0x3c')](_0xfa14ce['query'][_0x37a7('0x3c')]));_0xe0d21b[_0x37a7('0x3d')]=_0xe0d21b[_0x37a7('0x3d')][_0x37a7('0x3e')]?_0xe0d21b['attributes']:_0x3572ad[_0x37a7('0x37')];_0xe0d21b[_0x37a7('0x41')]=qs['sort'](_0xfa14ce[_0x37a7('0x38')][_0x37a7('0x42')]);_0xe0d21b[_0x37a7('0x45')]=qs['filters'](_[_0x37a7('0x43')](_0xfa14ce[_0x37a7('0x38')],_0x3572ad['filters']));if(_0xfa14ce[_0x37a7('0x38')][_0x37a7('0x44')]){_0xe0d21b[_0x37a7('0x45')]=_[_0x37a7('0x46')](_0xe0d21b['where'],{'$or':_[_0x37a7('0x33')](_0xe0d21b[_0x37a7('0x3d')],function(_0x279f5b){var _0x2ca9b5={};_0x2ca9b5[_0x279f5b]={'$like':'%'+_0xfa14ce[_0x37a7('0x38')][_0x37a7('0x44')]+'%'};return _0x2ca9b5;})});}_0xe0d21b=_['merge']({},_0xe0d21b,_0xfa14ce['options']);return _0x466852[_0x37a7('0x68')](_0xe0d21b);}})['then'](function(_0x3a0262){if(_0x3a0262){_0x562801=_0x3a0262[_0x37a7('0x3e')];if(!_0xfa14ce[_0x37a7('0x38')]['hasOwnProperty'](_0x37a7('0x40'))){_0xe0d21b[_0x37a7('0x22')]=qs[_0x37a7('0x22')](_0xfa14ce[_0x37a7('0x38')][_0x37a7('0x22')]);_0xe0d21b[_0x37a7('0x20')]=qs[_0x37a7('0x20')](_0xfa14ce[_0x37a7('0x38')][_0x37a7('0x20')]);}return _0x466852[_0x37a7('0x68')](_0xe0d21b);}})[_0x37a7('0x2a')](function(_0xe66ac3){if(_0xe66ac3){return _0xe66ac3?{'count':_0x562801,'rows':_0xe66ac3}:null;}})[_0x37a7('0x2a')](respondWithResult(_0x2c17c2,null))[_0x37a7('0x4e')](handleError(_0x2c17c2,null));};exports['addTeams']=function(_0x542796,_0x4bb741,_0x37ea1b){var _0x13172c=_0x542796[_0x37a7('0x53')][_0x37a7('0x6a')];return db[_0x37a7('0x69')][_0x37a7('0x4c')]({'where':{'id':_0x13172c},'attributes':['id'],'include':[{'model':db[_0x37a7('0x5f')],'as':_0x37a7('0x6b'),'attributes':['id','name','online',_0x37a7('0x6c'),_0x37a7('0x6d')],'raw':!![]}]})[_0x37a7('0x2a')](function(_0x2a131b){if(_0x2a131b){var _0x3a7019=_[_0x37a7('0x6e')](_0x2a131b,function(_0x21efa7){var _0x14d918=_0x21efa7[_0x37a7('0x2c')]({'plain':!![]});return _0x14d918[_0x37a7('0x6b')];});return db[_0x37a7('0x4b')][_0x37a7('0x51')]({'where':{'id':_0x542796[_0x37a7('0x50')]['id']}})['then'](function(_0x1fa846){return db['sequelize'][_0x37a7('0x6f')](function(_0x277505){return _0x1fa846[_0x37a7('0x70')](_0x13172c,{'transaction':_0x277505})[_0x37a7('0x2a')](function(){return BPromise['each'](_0x3a7019,function(_0x624a9e){return db[_0x37a7('0x5d')][_0x37a7('0x71')]({'where':{'UserId':_0x624a9e['id'],'WhatsappQueueId':_0x542796[_0x37a7('0x50')]['id']},'transaction':_0x277505});});})[_0x37a7('0x2a')](function(){_0x3a7019[_0x37a7('0x72')](function(_0x11e0d2){socket[_0x37a7('0x73')](_0x37a7('0x74'),{'UserId':_0x11e0d2['id'],'WhatsappQueueId':_0x1fa846['id']});});});});});}})[_0x37a7('0x2a')](respondWithStatusCode(_0x4bb741,null))[_0x37a7('0x4e')](handleError(_0x4bb741,null));};exports['removeTeams']=function(_0x823fce,_0x1b901d,_0x1d6952){return db[_0x37a7('0x69')]['findAll']({'where':{'id':_0x823fce['query'][_0x37a7('0x6a')]},'attributes':['id'],'include':[{'model':db[_0x37a7('0x5f')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x37a7('0x2a')](handleEntityNotFound(_0x1b901d,null))[_0x37a7('0x2a')](function(_0xfed80a){var _0x12807b=_[_0x37a7('0x33')](_0xfed80a,'id');var _0x15ddf7=[];var _0x3abdab=[];var _0x11f3cb=squel[_0x37a7('0x75')]();_0x11f3cb[_0x37a7('0x76')](_0x37a7('0x77'))[_0x37a7('0x78')](_0x37a7('0x79'),'tq')['join'](_0x37a7('0x7a'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x37a7('0x45')](_0x37a7('0x7b'),_0x823fce['params']['id']);for(var _0x78cbc1=0x0;_0x78cbc1<_0xfed80a[_0x37a7('0x3e')];_0x78cbc1+=0x1){let _0x205bf5=_0xfed80a[_0x78cbc1];for(var _0xf66a59=0x0;_0xf66a59<_0x205bf5[_0x37a7('0x6b')][_0x37a7('0x3e')];_0xf66a59+=0x1){let _0x420cb2=_0x205bf5[_0x37a7('0x6b')][_0xf66a59];var _0x52f8ea=_0x11f3cb['clone']();_0x52f8ea['where']('ut.UserId\x20=\x20?',_0x420cb2['id']);_0x3abdab[_0x37a7('0x7c')](db[_0x37a7('0x7d')]['query'](_0x52f8ea['toString'](),{'type':db[_0x37a7('0x7d')][_0x37a7('0x7e')][_0x37a7('0x7f')]})[_0x37a7('0x2a')](function(_0x5d416e){if(_0x5d416e[_0x37a7('0x3e')]===0x1){return _0x420cb2['id'];}else{var _0x544aeb=_['every'](_['map'](_0x5d416e,_0x37a7('0x80')),function(_0x1e7bbf){return _[_0x37a7('0x81')](_0x12807b,_0x1e7bbf);});if(_0x544aeb){return _0x420cb2['id'];}}}));}}return BPromise['all'](_0x3abdab)[_0x37a7('0x2a')](function(_0x459f54){_0x15ddf7=_(_0x15ddf7)[_0x37a7('0x82')](_0x459f54)['compact']()[_0x37a7('0x83')]();return db[_0x37a7('0x4b')]['find']({'where':{'id':_0x823fce['params']['id']}})['then'](function(_0x31728d){return db[_0x37a7('0x7d')][_0x37a7('0x6f')](function(_0x591d1e){return _0x31728d[_0x37a7('0x84')](_0x823fce[_0x37a7('0x38')][_0x37a7('0x6a')],{'transaction':_0x591d1e})['then'](function(){if(!_['isEmpty'](_0x15ddf7)){return _0x31728d[_0x37a7('0x85')](_0x15ddf7,{'transaction':_0x591d1e});}})[_0x37a7('0x2a')](function(){_0x15ddf7[_0x37a7('0x72')](function(_0x531b64){socket[_0x37a7('0x73')]('userWhatsappQueue:remove',{'UserId':_0x531b64,'WhatsappQueueId':_0x31728d['id']});});});});});});})[_0x37a7('0x2a')](respondWithStatusCode(_0x1b901d,null))[_0x37a7('0x4e')](handleError(_0x1b901d,null));};exports[_0x37a7('0x86')]=function(_0x27f89c,_0x1f4f95,_0x4fd9b0){return db['WhatsappQueue'][_0x37a7('0x51')]({'where':{'id':_0x27f89c[_0x37a7('0x50')]['id']}})[_0x37a7('0x2a')](handleEntityNotFound(_0x1f4f95,null))['then'](function(_0x2e4117){if(_0x2e4117){return _0x2e4117['addAgents'](_0x27f89c['body'][_0x37a7('0x6a')],_[_0x37a7('0x87')](_0x27f89c['body'],['ids','id'])||{})[_0x37a7('0x88')](function(_0x5e537c){for(var _0x9416fc=0x0;_0x9416fc<_0x27f89c[_0x37a7('0x53')]['ids'][_0x37a7('0x3e')];_0x9416fc+=0x1){socket[_0x37a7('0x73')](_0x37a7('0x74'),{'UserId':Number(_0x27f89c[_0x37a7('0x53')][_0x37a7('0x6a')][_0x9416fc]),'WhatsappQueueId':Number(_0x27f89c[_0x37a7('0x50')]['id'])});}return _0x5e537c;});}})['then'](respondWithResult(_0x1f4f95,null))[_0x37a7('0x4e')](handleError(_0x1f4f95,null));};exports['removeAgents']=function(_0x954436,_0x3e83ea,_0x5d7e47){return db[_0x37a7('0x4b')][_0x37a7('0x51')]({'where':{'id':_0x954436[_0x37a7('0x50')]['id']}})['then'](handleEntityNotFound(_0x3e83ea,null))['then'](function(_0x523aaf){if(_0x523aaf){return _0x523aaf[_0x37a7('0x85')](_0x954436[_0x37a7('0x38')][_0x37a7('0x6a')])[_0x37a7('0x2a')](function(){if(_[_0x37a7('0x89')](_0x954436[_0x37a7('0x38')][_0x37a7('0x6a')])){for(var _0x14d814=0x0;_0x14d814<_0x954436[_0x37a7('0x38')]['ids'][_0x37a7('0x3e')];_0x14d814+=0x1){socket[_0x37a7('0x73')](_0x37a7('0x8a'),{'UserId':Number(_0x954436[_0x37a7('0x38')][_0x37a7('0x6a')][_0x14d814]),'WhatsappQueueId':Number(_0x954436[_0x37a7('0x50')]['id'])});}}else{socket[_0x37a7('0x73')]('userWhatsappQueue:remove',{'UserId':Number(_0x954436[_0x37a7('0x38')][_0x37a7('0x6a')]),'WhatsappQueueId':Number(_0x954436[_0x37a7('0x50')]['id'])});}});}})[_0x37a7('0x2a')](respondWithStatusCode(_0x3e83ea,null))[_0x37a7('0x4e')](handleError(_0x3e83ea,null));};exports[_0x37a7('0x8b')]=function(_0x4b19de,_0x388195,_0x354541){var _0x4d771d={};var _0x36e51f={};var _0x437507;var _0x27ecc5;return db[_0x37a7('0x4b')]['findOne']({'where':{'id':_0x4b19de['params']['id']}})[_0x37a7('0x2a')](handleEntityNotFound(_0x388195,null))[_0x37a7('0x2a')](function(_0x471806){if(_0x471806){_0x437507=_0x471806;_0x36e51f[_0x37a7('0x37')]=_['keys'](db[_0x37a7('0x5f')][_0x37a7('0x34')]);_0x36e51f['query']=_[_0x37a7('0x39')](_0x4b19de['query']);_0x36e51f[_0x37a7('0x3a')]=_['intersection'](_0x36e51f[_0x37a7('0x37')],_0x36e51f['query']);_0x4d771d[_0x37a7('0x3d')]=_['intersection'](_0x36e51f[_0x37a7('0x37')],qs[_0x37a7('0x3c')](_0x4b19de[_0x37a7('0x38')][_0x37a7('0x3c')]));_0x4d771d['attributes']=_0x4d771d['attributes'][_0x37a7('0x3e')]?_0x4d771d[_0x37a7('0x3d')]:_0x36e51f['model'];_0x4d771d['order']=qs[_0x37a7('0x42')](_0x4b19de[_0x37a7('0x38')][_0x37a7('0x42')]);_0x4d771d['where']=qs[_0x37a7('0x3a')](_[_0x37a7('0x43')](_0x4b19de['query'],_0x36e51f['filters']));if(_0x4b19de[_0x37a7('0x38')][_0x37a7('0x44')]){_0x4d771d[_0x37a7('0x45')]=_['merge'](_0x4d771d[_0x37a7('0x45')],{'$or':_[_0x37a7('0x33')](_0x4d771d[_0x37a7('0x3d')],function(_0x3f61d4){var _0x3347b7={};_0x3347b7[_0x3f61d4]={'$like':'%'+_0x4b19de[_0x37a7('0x38')][_0x37a7('0x44')]+'%'};return _0x3347b7;})});}_0x4d771d=_[_0x37a7('0x46')]({},_0x4d771d,_0x4b19de['options']);return _0x437507[_0x37a7('0x8b')](_0x4d771d);}})['then'](function(_0x43ec3b){if(_0x43ec3b){_0x27ecc5=_0x43ec3b[_0x37a7('0x3e')];if(!_0x4b19de[_0x37a7('0x38')][_0x37a7('0x3f')](_0x37a7('0x40'))){_0x4d771d[_0x37a7('0x22')]=qs[_0x37a7('0x22')](_0x4b19de[_0x37a7('0x38')][_0x37a7('0x22')]);_0x4d771d['offset']=qs[_0x37a7('0x20')](_0x4b19de[_0x37a7('0x38')][_0x37a7('0x20')]);}return _0x437507[_0x37a7('0x8b')](_0x4d771d);}})['then'](function(_0x48fa4d){if(_0x48fa4d){return _0x48fa4d?{'count':_0x27ecc5,'rows':_0x48fa4d}:null;}})[_0x37a7('0x2a')](respondWithResult(_0x388195,null))[_0x37a7('0x4e')](handleError(_0x388195,null));}; \ No newline at end of file +var _0xd2d2=['userProfileId','autoAssociation','update','describe','getMembers','UserWhatsappQueue','User','findAndCountAll','UserId','agent','whatsappPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','findOne','Team','addTeams','ids','Agents','online','voicePause','flatMap','sequelize','each','emit','userWhatsappQueue:save','removeTeams','select','tq.TeamId','from','team_has_whatsapp_queues','join','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','SELECT','every','TeamId','union','compact','transaction','removeAgents','userWhatsappQueue:remove','addAgents','spread','isArray','getAgents','zip-dir','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','then','destroy','get','WhatsappQueues','UserProfileResource','error','stack','name','send','index','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','WhatsappQueue','include','findAll','catch','show','params','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user'];(function(_0x824118,_0x488af2){var _0x55e59c=function(_0xb0992b){while(--_0xb0992b){_0x824118['push'](_0x824118['shift']());}};_0x55e59c(++_0x488af2);}(_0xd2d2,0x14a));var _0x2d2d=function(_0x55c3ec,_0x25267f){_0x55c3ec=_0x55c3ec-0x0;var _0xe43bb8=_0xd2d2[_0x55c3ec];return _0xe43bb8;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x2d2d('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2d2d('0x1'));var BPromise=require(_0x2d2d('0x2'));var Mustache=require(_0x2d2d('0x3'));var util=require(_0x2d2d('0x4'));var path=require('path');var sox=require(_0x2d2d('0x5'));var csv=require(_0x2d2d('0x6'));var ejs=require(_0x2d2d('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2d2d('0x8'));var squel=require(_0x2d2d('0x9'));var crypto=require(_0x2d2d('0xa'));var jsforce=require(_0x2d2d('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x2d2d('0x6'));var querystring=require('querystring');var Papa=require(_0x2d2d('0xc'));var Redis=require(_0x2d2d('0xd'));var authService=require(_0x2d2d('0xe'));var qs=require(_0x2d2d('0xf'));var as=require(_0x2d2d('0x10'));var hardwareService=require(_0x2d2d('0x11'));var logger=require(_0x2d2d('0x12'))(_0x2d2d('0x13'));var utils=require(_0x2d2d('0x14'));var config=require(_0x2d2d('0x15'));var licenseUtil=require(_0x2d2d('0x16'));var db=require(_0x2d2d('0x17'))['db'];config[_0x2d2d('0x18')]=_[_0x2d2d('0x19')](config[_0x2d2d('0x18')],{'host':_0x2d2d('0x1a'),'port':0x18eb});var socket=require(_0x2d2d('0x1b'))(new Redis(config['redis']));require(_0x2d2d('0x1c'))[_0x2d2d('0x1d')](socket);function respondWithStatusCode(_0x26706a,_0x1de6ee){_0x1de6ee=_0x1de6ee||0xcc;return function(_0x54dcdf){if(_0x54dcdf){return _0x26706a[_0x2d2d('0x1e')](_0x1de6ee);}return _0x26706a[_0x2d2d('0x1f')](_0x1de6ee)[_0x2d2d('0x20')]();};}function respondWithResult(_0x305a3c,_0x36ee7d){_0x36ee7d=_0x36ee7d||0xc8;return function(_0x460606){if(_0x460606){return _0x305a3c['status'](_0x36ee7d)[_0x2d2d('0x21')](_0x460606);}};}function respondWithFilteredResult(_0x1f5ec2,_0x2a436e){return function(_0x5c3f80){if(_0x5c3f80){var _0x2df982=typeof _0x2a436e[_0x2d2d('0x22')]===_0x2d2d('0x23')&&typeof _0x2a436e['limit']===_0x2d2d('0x23');var _0x6ff03e=_0x5c3f80[_0x2d2d('0x24')];var _0xa8f63d=_0x2df982?0x0:_0x2a436e[_0x2d2d('0x22')];var _0x5b6d71=_0x2df982?_0x5c3f80[_0x2d2d('0x24')]:_0x2a436e['offset']+_0x2a436e[_0x2d2d('0x25')];var _0x26d994;if(_0x5b6d71>=_0x6ff03e){_0x5b6d71=_0x6ff03e;_0x26d994=0xc8;}else{_0x26d994=0xce;}_0x1f5ec2[_0x2d2d('0x1f')](_0x26d994);return _0x1f5ec2['set'](_0x2d2d('0x26'),_0xa8f63d+'-'+_0x5b6d71+'/'+_0x6ff03e)['json'](_0x5c3f80);}return null;};}function patchUpdates(_0x11baf0){return function(_0x5e1fa0){try{jsonpatch[_0x2d2d('0x27')](_0x5e1fa0,_0x11baf0,!![]);}catch(_0x502d2b){return BPromise[_0x2d2d('0x28')](_0x502d2b);}return _0x5e1fa0[_0x2d2d('0x29')]();};}function saveUpdates(_0x50416f,_0x99a9a){return function(_0xf85605){if(_0xf85605){return _0xf85605['update'](_0x50416f)[_0x2d2d('0x2a')](function(_0x367475){return _0x367475;});}return null;};}function removeEntity(_0x39e5d3,_0x16e32d){return function(_0x37b6a7){if(_0x37b6a7){return _0x37b6a7[_0x2d2d('0x2b')]()[_0x2d2d('0x2a')](function(){var _0x1c5b16=_0x37b6a7[_0x2d2d('0x2c')]({'plain':!![]});var _0x3e4a03=_0x2d2d('0x2d');return db[_0x2d2d('0x2e')][_0x2d2d('0x2b')]({'where':{'type':_0x3e4a03,'resourceId':_0x1c5b16['id']}})['then'](function(){return _0x37b6a7;});})[_0x2d2d('0x2a')](function(){_0x39e5d3[_0x2d2d('0x1f')](0xcc)[_0x2d2d('0x20')]();});}};}function handleEntityNotFound(_0x2dcb59,_0x594194){return function(_0x55310b){if(!_0x55310b){_0x2dcb59[_0x2d2d('0x1e')](0x194);}return _0x55310b;};}function handleError(_0x3c9f74,_0x332f20){_0x332f20=_0x332f20||0x1f4;return function(_0x4d1f2c){logger[_0x2d2d('0x2f')](_0x4d1f2c[_0x2d2d('0x30')]);if(_0x4d1f2c[_0x2d2d('0x31')]){delete _0x4d1f2c[_0x2d2d('0x31')];}_0x3c9f74[_0x2d2d('0x1f')](_0x332f20)[_0x2d2d('0x32')](_0x4d1f2c);};}exports[_0x2d2d('0x33')]=function(_0x2b87e7,_0x19161a){var _0x4fbe6e={},_0x1d56dc={},_0x2d6ae4={'count':0x0,'rows':[]};var _0x35026e=_['map'](db['WhatsappQueue'][_0x2d2d('0x34')],function(_0x4af176){return{'name':_0x4af176[_0x2d2d('0x35')],'type':_0x4af176[_0x2d2d('0x36')][_0x2d2d('0x37')]};});_0x1d56dc['model']=_[_0x2d2d('0x38')](_0x35026e,_0x2d2d('0x31'));_0x1d56dc[_0x2d2d('0x39')]=_[_0x2d2d('0x3a')](_0x2b87e7[_0x2d2d('0x39')]);_0x1d56dc[_0x2d2d('0x3b')]=_[_0x2d2d('0x3c')](_0x1d56dc[_0x2d2d('0x3d')],_0x1d56dc[_0x2d2d('0x39')]);_0x4fbe6e[_0x2d2d('0x3e')]=_['intersection'](_0x1d56dc[_0x2d2d('0x3d')],qs[_0x2d2d('0x3f')](_0x2b87e7[_0x2d2d('0x39')]['fields']));_0x4fbe6e[_0x2d2d('0x3e')]=_0x4fbe6e['attributes'][_0x2d2d('0x40')]?_0x4fbe6e['attributes']:_0x1d56dc[_0x2d2d('0x3d')];if(!_0x2b87e7['query'][_0x2d2d('0x41')](_0x2d2d('0x42'))){_0x4fbe6e[_0x2d2d('0x25')]=qs['limit'](_0x2b87e7[_0x2d2d('0x39')][_0x2d2d('0x25')]);_0x4fbe6e[_0x2d2d('0x22')]=qs[_0x2d2d('0x22')](_0x2b87e7[_0x2d2d('0x39')][_0x2d2d('0x22')]);}_0x4fbe6e[_0x2d2d('0x43')]=qs[_0x2d2d('0x44')](_0x2b87e7[_0x2d2d('0x39')][_0x2d2d('0x44')]);_0x4fbe6e[_0x2d2d('0x45')]=qs[_0x2d2d('0x3b')](_[_0x2d2d('0x46')](_0x2b87e7[_0x2d2d('0x39')],_0x1d56dc[_0x2d2d('0x3b')]),_0x35026e);if(_0x2b87e7[_0x2d2d('0x39')][_0x2d2d('0x47')]){_0x4fbe6e[_0x2d2d('0x45')]=_['merge'](_0x4fbe6e[_0x2d2d('0x45')],{'$or':_[_0x2d2d('0x38')](_0x35026e,function(_0xab5d6d){if(_0xab5d6d[_0x2d2d('0x36')]!==_0x2d2d('0x48')){var _0x31606b={};_0x31606b[_0xab5d6d['name']]={'$like':'%'+_0x2b87e7['query'][_0x2d2d('0x47')]+'%'};return _0x31606b;}})});}_0x4fbe6e=_[_0x2d2d('0x49')]({},_0x4fbe6e,_0x2b87e7[_0x2d2d('0x4a')]);var _0x558159={'where':_0x4fbe6e[_0x2d2d('0x45')]};return db[_0x2d2d('0x4b')][_0x2d2d('0x24')](_0x558159)[_0x2d2d('0x2a')](function(_0x2b4f89){_0x2d6ae4[_0x2d2d('0x24')]=_0x2b4f89;if(_0x2b87e7[_0x2d2d('0x39')]['includeAll']){_0x4fbe6e[_0x2d2d('0x4c')]=[{'all':!![]}];}return db['WhatsappQueue'][_0x2d2d('0x4d')](_0x4fbe6e);})[_0x2d2d('0x2a')](function(_0x390ed3){_0x2d6ae4['rows']=_0x390ed3;return _0x2d6ae4;})[_0x2d2d('0x2a')](respondWithFilteredResult(_0x19161a,_0x4fbe6e))[_0x2d2d('0x4e')](handleError(_0x19161a,null));};exports[_0x2d2d('0x4f')]=function(_0x47e1ea,_0x110ffb){var _0x3e256b={'raw':!![],'where':{'id':_0x47e1ea[_0x2d2d('0x50')]['id']}},_0x396fbc={};_0x396fbc['model']=_[_0x2d2d('0x3a')](db[_0x2d2d('0x4b')]['rawAttributes']);_0x396fbc[_0x2d2d('0x39')]=_[_0x2d2d('0x3a')](_0x47e1ea[_0x2d2d('0x39')]);_0x396fbc[_0x2d2d('0x3b')]=_[_0x2d2d('0x3c')](_0x396fbc[_0x2d2d('0x3d')],_0x396fbc[_0x2d2d('0x39')]);_0x3e256b['attributes']=_[_0x2d2d('0x3c')](_0x396fbc[_0x2d2d('0x3d')],qs[_0x2d2d('0x3f')](_0x47e1ea[_0x2d2d('0x39')][_0x2d2d('0x3f')]));_0x3e256b[_0x2d2d('0x3e')]=_0x3e256b[_0x2d2d('0x3e')]['length']?_0x3e256b[_0x2d2d('0x3e')]:_0x396fbc[_0x2d2d('0x3d')];if(_0x47e1ea[_0x2d2d('0x39')][_0x2d2d('0x51')]){_0x3e256b[_0x2d2d('0x4c')]=[{'all':!![]}];}_0x3e256b=_[_0x2d2d('0x49')]({},_0x3e256b,_0x47e1ea[_0x2d2d('0x4a')]);return db[_0x2d2d('0x4b')][_0x2d2d('0x52')](_0x3e256b)[_0x2d2d('0x2a')](handleEntityNotFound(_0x110ffb,null))[_0x2d2d('0x2a')](respondWithResult(_0x110ffb,null))[_0x2d2d('0x4e')](handleError(_0x110ffb,null));};exports['create']=function(_0x251461,_0x344d96){return db[_0x2d2d('0x4b')][_0x2d2d('0x53')](_0x251461[_0x2d2d('0x54')],{})[_0x2d2d('0x2a')](function(_0x54e0a4){var _0x5d49b2=_0x251461['user']['get']({'plain':!![]});if(!_0x5d49b2)throw new Error(_0x2d2d('0x55'));if(_0x5d49b2['role']===_0x2d2d('0x56')){var _0x9b40a9=_0x54e0a4[_0x2d2d('0x2c')]({'plain':!![]});var _0x5a6eb5='WhatsappQueues';return db['UserProfileSection'][_0x2d2d('0x52')]({'where':{'name':_0x5a6eb5,'userProfileId':_0x5d49b2[_0x2d2d('0x57')]},'raw':!![]})[_0x2d2d('0x2a')](function(_0x288fbd){if(_0x288fbd&&_0x288fbd[_0x2d2d('0x58')]===0x0){return db[_0x2d2d('0x2e')][_0x2d2d('0x53')]({'name':_0x9b40a9[_0x2d2d('0x31')],'resourceId':_0x9b40a9['id'],'type':_0x288fbd[_0x2d2d('0x31')],'sectionId':_0x288fbd['id']},{})[_0x2d2d('0x2a')](function(){return _0x54e0a4;});}else{return _0x54e0a4;}})[_0x2d2d('0x4e')](function(_0x39c7eb){logger[_0x2d2d('0x2f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x39c7eb);throw _0x39c7eb;});}return _0x54e0a4;})[_0x2d2d('0x2a')](respondWithResult(_0x344d96,0xc9))[_0x2d2d('0x4e')](handleError(_0x344d96,null));};exports[_0x2d2d('0x59')]=function(_0x508af3,_0x5edca7){if(_0x508af3['body']['id']){delete _0x508af3[_0x2d2d('0x54')]['id'];}return db[_0x2d2d('0x4b')]['find']({'where':{'id':_0x508af3[_0x2d2d('0x50')]['id']}})[_0x2d2d('0x2a')](handleEntityNotFound(_0x5edca7,null))[_0x2d2d('0x2a')](saveUpdates(_0x508af3[_0x2d2d('0x54')],null))[_0x2d2d('0x2a')](respondWithResult(_0x5edca7,null))[_0x2d2d('0x4e')](handleError(_0x5edca7,null));};exports[_0x2d2d('0x2b')]=function(_0x56542b,_0x167adf){return db[_0x2d2d('0x4b')][_0x2d2d('0x52')]({'where':{'id':_0x56542b[_0x2d2d('0x50')]['id']}})[_0x2d2d('0x2a')](handleEntityNotFound(_0x167adf,null))['then'](removeEntity(_0x167adf,null))[_0x2d2d('0x4e')](handleError(_0x167adf,null));};exports[_0x2d2d('0x5a')]=function(_0x52557e,_0x299e57){return db[_0x2d2d('0x4b')][_0x2d2d('0x5a')]()[_0x2d2d('0x2a')](respondWithResult(_0x299e57,null))[_0x2d2d('0x4e')](handleError(_0x299e57,null));};exports[_0x2d2d('0x5b')]=function(_0x2e4dca,_0x4cd1de,_0x1dafb1){var _0x1a513f={'raw':!![],'where':{}},_0x4a7ff4={},_0x1ca735;return db['WhatsappQueue']['findOne']({'where':{'id':_0x2e4dca[_0x2d2d('0x50')]['id']}})[_0x2d2d('0x2a')](handleEntityNotFound(_0x4cd1de,null))[_0x2d2d('0x2a')](function(_0x284853){if(_0x284853){_0x1ca735=_0x284853[_0x2d2d('0x2c')]({'plain':!![]});_0x4a7ff4[_0x2d2d('0x3d')]=_[_0x2d2d('0x3a')](db[_0x2d2d('0x5c')][_0x2d2d('0x34')]);_0x4a7ff4[_0x2d2d('0x39')]=_[_0x2d2d('0x3a')](_0x2e4dca[_0x2d2d('0x39')]);_0x4a7ff4[_0x2d2d('0x3b')]=_[_0x2d2d('0x3c')](_0x4a7ff4[_0x2d2d('0x3d')],_0x4a7ff4['query']);_0x1a513f['attributes']=_[_0x2d2d('0x3c')](_0x4a7ff4[_0x2d2d('0x3d')],qs[_0x2d2d('0x3f')](_0x2e4dca['query'][_0x2d2d('0x3f')]));_0x1a513f[_0x2d2d('0x3e')]=_0x1a513f[_0x2d2d('0x3e')][_0x2d2d('0x40')]?_0x1a513f[_0x2d2d('0x3e')]:_0x4a7ff4[_0x2d2d('0x3d')];if(!_0x2e4dca['query'][_0x2d2d('0x41')](_0x2d2d('0x42'))){_0x1a513f[_0x2d2d('0x25')]=qs[_0x2d2d('0x25')](_0x2e4dca[_0x2d2d('0x39')][_0x2d2d('0x25')]);_0x1a513f[_0x2d2d('0x22')]=qs[_0x2d2d('0x22')](_0x2e4dca[_0x2d2d('0x39')][_0x2d2d('0x22')]);}_0x1a513f['order']=qs[_0x2d2d('0x44')](_0x2e4dca['query'][_0x2d2d('0x44')]);_0x1a513f[_0x2d2d('0x45')]=qs[_0x2d2d('0x3b')](_[_0x2d2d('0x46')](_0x2e4dca[_0x2d2d('0x39')],_0x4a7ff4[_0x2d2d('0x3b')]));_0x1a513f[_0x2d2d('0x45')]['WhatsappQueueId']=_0x284853['id'];if(_0x2e4dca['query']['filter']){_0x1a513f[_0x2d2d('0x45')]=_[_0x2d2d('0x49')](_0x1a513f[_0x2d2d('0x45')],{'$or':_[_0x2d2d('0x38')](_0x1a513f[_0x2d2d('0x3e')],function(_0x36db67){var _0x44efca={};_0x44efca[_0x36db67]={'$like':'%'+_0x2e4dca[_0x2d2d('0x39')][_0x2d2d('0x47')]+'%'};return _0x44efca;})});}_0x1a513f=_['merge']({},_0x1a513f,_0x2e4dca[_0x2d2d('0x4a')]);return db[_0x2d2d('0x5c')][_0x2d2d('0x4d')](_0x1a513f);}})[_0x2d2d('0x2a')](function(_0x56e361){if(_0x56e361){return db[_0x2d2d('0x5d')][_0x2d2d('0x5e')]({'where':{'id':_[_0x2d2d('0x38')](_0x56e361,_0x2d2d('0x5f')),'role':_0x2d2d('0x60')},'attributes':['id','name',_0x2d2d('0x61'),_0x2d2d('0x62'),_0x2d2d('0x63')]});}})[_0x2d2d('0x2a')](function(_0x13629e){if(_0x13629e){return{'count':_0x13629e['count'],'rows':_[_0x2d2d('0x38')](_0x13629e['rows'],function(_0x12021c){return{'membername':_0x12021c[_0x2d2d('0x31')],'UserId':_0x12021c['id'],'queue_name':_0x1ca735[_0x2d2d('0x31')],'WhatsappQueueId':_0x1ca735['id'],'interface':util[_0x2d2d('0x64')](_0x2d2d('0x65'),_0x2d2d('0x66'),_0x12021c[_0x2d2d('0x31')]),'penalty':0x0,'paused':_0x12021c[_0x2d2d('0x61')],'createdAt':_0x12021c[_0x2d2d('0x63')],'updatedAt':_0x12021c[_0x2d2d('0x62')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x2d2d('0x2a')](respondWithFilteredResult(_0x4cd1de,_0x1a513f))[_0x2d2d('0x4e')](handleError(_0x4cd1de,null));};exports[_0x2d2d('0x67')]=function(_0x16931a,_0x2fe27e,_0x557307){var _0x228f01={};var _0x18e58d={};var _0x4851d4;var _0x49ddd0;return db[_0x2d2d('0x4b')][_0x2d2d('0x68')]({'where':{'id':_0x16931a[_0x2d2d('0x50')]['id']}})['then'](handleEntityNotFound(_0x2fe27e,null))['then'](function(_0x303a38){if(_0x303a38){_0x4851d4=_0x303a38;_0x18e58d[_0x2d2d('0x3d')]=_[_0x2d2d('0x3a')](db[_0x2d2d('0x69')][_0x2d2d('0x34')]);_0x18e58d[_0x2d2d('0x39')]=_[_0x2d2d('0x3a')](_0x16931a[_0x2d2d('0x39')]);_0x18e58d['filters']=_[_0x2d2d('0x3c')](_0x18e58d[_0x2d2d('0x3d')],_0x18e58d[_0x2d2d('0x39')]);_0x228f01[_0x2d2d('0x3e')]=_['intersection'](_0x18e58d[_0x2d2d('0x3d')],qs[_0x2d2d('0x3f')](_0x16931a[_0x2d2d('0x39')][_0x2d2d('0x3f')]));_0x228f01[_0x2d2d('0x3e')]=_0x228f01[_0x2d2d('0x3e')]['length']?_0x228f01[_0x2d2d('0x3e')]:_0x18e58d[_0x2d2d('0x3d')];_0x228f01[_0x2d2d('0x43')]=qs[_0x2d2d('0x44')](_0x16931a[_0x2d2d('0x39')][_0x2d2d('0x44')]);_0x228f01[_0x2d2d('0x45')]=qs['filters'](_['pick'](_0x16931a[_0x2d2d('0x39')],_0x18e58d[_0x2d2d('0x3b')]));if(_0x16931a[_0x2d2d('0x39')]['filter']){_0x228f01[_0x2d2d('0x45')]=_['merge'](_0x228f01[_0x2d2d('0x45')],{'$or':_[_0x2d2d('0x38')](_0x228f01[_0x2d2d('0x3e')],function(_0x4315cc){var _0x3af516={};_0x3af516[_0x4315cc]={'$like':'%'+_0x16931a[_0x2d2d('0x39')][_0x2d2d('0x47')]+'%'};return _0x3af516;})});}_0x228f01=_[_0x2d2d('0x49')]({},_0x228f01,_0x16931a[_0x2d2d('0x4a')]);return _0x4851d4['getTeams'](_0x228f01);}})[_0x2d2d('0x2a')](function(_0x272ad7){if(_0x272ad7){_0x49ddd0=_0x272ad7[_0x2d2d('0x40')];if(!_0x16931a[_0x2d2d('0x39')][_0x2d2d('0x41')](_0x2d2d('0x42'))){_0x228f01[_0x2d2d('0x25')]=qs[_0x2d2d('0x25')](_0x16931a[_0x2d2d('0x39')][_0x2d2d('0x25')]);_0x228f01['offset']=qs[_0x2d2d('0x22')](_0x16931a[_0x2d2d('0x39')][_0x2d2d('0x22')]);}return _0x4851d4['getTeams'](_0x228f01);}})[_0x2d2d('0x2a')](function(_0x353531){if(_0x353531){return _0x353531?{'count':_0x49ddd0,'rows':_0x353531}:null;}})['then'](respondWithResult(_0x2fe27e,null))[_0x2d2d('0x4e')](handleError(_0x2fe27e,null));};exports[_0x2d2d('0x6a')]=function(_0x10adeb,_0xc3983,_0x3920f6){var _0x3cb84c=_0x10adeb['body'][_0x2d2d('0x6b')];return db[_0x2d2d('0x69')][_0x2d2d('0x4d')]({'where':{'id':_0x3cb84c},'attributes':['id'],'include':[{'model':db[_0x2d2d('0x5d')],'as':_0x2d2d('0x6c'),'attributes':['id','name',_0x2d2d('0x6d'),_0x2d2d('0x6e'),'interface'],'raw':!![]}]})[_0x2d2d('0x2a')](function(_0xbe31f5){if(_0xbe31f5){var _0x5ed174=_[_0x2d2d('0x6f')](_0xbe31f5,function(_0x185119){var _0x28e613=_0x185119[_0x2d2d('0x2c')]({'plain':!![]});return _0x28e613[_0x2d2d('0x6c')];});return db[_0x2d2d('0x4b')][_0x2d2d('0x52')]({'where':{'id':_0x10adeb[_0x2d2d('0x50')]['id']}})[_0x2d2d('0x2a')](function(_0xfb3517){return db[_0x2d2d('0x70')]['transaction'](function(_0x36effe){return _0xfb3517[_0x2d2d('0x6a')](_0x3cb84c,{'transaction':_0x36effe})[_0x2d2d('0x2a')](function(){return BPromise[_0x2d2d('0x71')](_0x5ed174,function(_0x20126d){return db[_0x2d2d('0x5c')]['findOrCreate']({'where':{'UserId':_0x20126d['id'],'WhatsappQueueId':_0x10adeb[_0x2d2d('0x50')]['id']},'transaction':_0x36effe});});})[_0x2d2d('0x2a')](function(){_0x5ed174['forEach'](function(_0x2feba9){socket[_0x2d2d('0x72')](_0x2d2d('0x73'),{'UserId':_0x2feba9['id'],'WhatsappQueueId':_0xfb3517['id']});});});});});}})[_0x2d2d('0x2a')](respondWithStatusCode(_0xc3983,null))[_0x2d2d('0x4e')](handleError(_0xc3983,null));};exports[_0x2d2d('0x74')]=function(_0x51cc97,_0x1e4a0e,_0x49d508){return db['Team'][_0x2d2d('0x4d')]({'where':{'id':_0x51cc97['query'][_0x2d2d('0x6b')]},'attributes':['id'],'include':[{'model':db[_0x2d2d('0x5d')],'as':_0x2d2d('0x6c'),'attributes':['id'],'raw':!![]}]})[_0x2d2d('0x2a')](handleEntityNotFound(_0x1e4a0e,null))[_0x2d2d('0x2a')](function(_0x376c35){var _0x458bcc=_['map'](_0x376c35,'id');var _0x260dd4=[];var _0x1ec5e9=[];var _0x3b04d9=squel[_0x2d2d('0x75')]();_0x3b04d9['field'](_0x2d2d('0x76'))[_0x2d2d('0x77')](_0x2d2d('0x78'),'tq')[_0x2d2d('0x79')]('user_has_teams','ut',_0x2d2d('0x7a'))[_0x2d2d('0x45')](_0x2d2d('0x7b'),_0x51cc97[_0x2d2d('0x50')]['id']);for(var _0x1c832a=0x0;_0x1c832a<_0x376c35[_0x2d2d('0x40')];_0x1c832a+=0x1){let _0x360bf2=_0x376c35[_0x1c832a];for(var _0x31a7e5=0x0;_0x31a7e5<_0x360bf2['Agents'][_0x2d2d('0x40')];_0x31a7e5+=0x1){let _0x50605f=_0x360bf2[_0x2d2d('0x6c')][_0x31a7e5];var _0x14cb5c=_0x3b04d9[_0x2d2d('0x7c')]();_0x14cb5c[_0x2d2d('0x45')](_0x2d2d('0x7d'),_0x50605f['id']);_0x1ec5e9['push'](db[_0x2d2d('0x70')][_0x2d2d('0x39')](_0x14cb5c[_0x2d2d('0x7e')](),{'type':db[_0x2d2d('0x70')]['QueryTypes'][_0x2d2d('0x7f')]})[_0x2d2d('0x2a')](function(_0x107c9a){if(_0x107c9a['length']===0x1){return _0x50605f['id'];}else{var _0x58b8cd=_[_0x2d2d('0x80')](_['map'](_0x107c9a,_0x2d2d('0x81')),function(_0x46cf55){return _['includes'](_0x458bcc,_0x46cf55);});if(_0x58b8cd){return _0x50605f['id'];}}}));}}return BPromise['all'](_0x1ec5e9)[_0x2d2d('0x2a')](function(_0x1f2e25){_0x260dd4=_(_0x260dd4)[_0x2d2d('0x82')](_0x1f2e25)[_0x2d2d('0x83')]()['value']();return db[_0x2d2d('0x4b')][_0x2d2d('0x52')]({'where':{'id':_0x51cc97[_0x2d2d('0x50')]['id']}})['then'](function(_0x4ff0d6){return db[_0x2d2d('0x70')][_0x2d2d('0x84')](function(_0x32485f){return _0x4ff0d6['removeTeams'](_0x51cc97['query']['ids'],{'transaction':_0x32485f})['then'](function(){if(!_['isEmpty'](_0x260dd4)){return _0x4ff0d6[_0x2d2d('0x85')](_0x260dd4,{'transaction':_0x32485f});}})['then'](function(){_0x260dd4['forEach'](function(_0x5353a8){socket[_0x2d2d('0x72')](_0x2d2d('0x86'),{'UserId':_0x5353a8,'WhatsappQueueId':_0x4ff0d6['id']});});});});});});})[_0x2d2d('0x2a')](respondWithStatusCode(_0x1e4a0e,null))[_0x2d2d('0x4e')](handleError(_0x1e4a0e,null));};exports['addAgents']=function(_0x13b52f,_0x199db3,_0xf84ee6){return db[_0x2d2d('0x4b')]['find']({'where':{'id':_0x13b52f[_0x2d2d('0x50')]['id']}})[_0x2d2d('0x2a')](handleEntityNotFound(_0x199db3,null))[_0x2d2d('0x2a')](function(_0x4287ff){if(_0x4287ff){return _0x4287ff[_0x2d2d('0x87')](_0x13b52f[_0x2d2d('0x54')][_0x2d2d('0x6b')],_['omit'](_0x13b52f[_0x2d2d('0x54')],['ids','id'])||{})[_0x2d2d('0x88')](function(_0x1a3e55){for(var _0x42808c=0x0;_0x42808c<_0x13b52f[_0x2d2d('0x54')][_0x2d2d('0x6b')]['length'];_0x42808c+=0x1){socket[_0x2d2d('0x72')](_0x2d2d('0x73'),{'UserId':Number(_0x13b52f[_0x2d2d('0x54')]['ids'][_0x42808c]),'WhatsappQueueId':Number(_0x13b52f['params']['id'])});}return _0x1a3e55;});}})[_0x2d2d('0x2a')](respondWithResult(_0x199db3,null))[_0x2d2d('0x4e')](handleError(_0x199db3,null));};exports[_0x2d2d('0x85')]=function(_0x4cc1c3,_0xd35766,_0x192f33){return db[_0x2d2d('0x4b')][_0x2d2d('0x52')]({'where':{'id':_0x4cc1c3['params']['id']}})[_0x2d2d('0x2a')](handleEntityNotFound(_0xd35766,null))[_0x2d2d('0x2a')](function(_0x42d37e){if(_0x42d37e){return _0x42d37e['removeAgents'](_0x4cc1c3[_0x2d2d('0x39')]['ids'])[_0x2d2d('0x2a')](function(){if(_[_0x2d2d('0x89')](_0x4cc1c3[_0x2d2d('0x39')][_0x2d2d('0x6b')])){for(var _0x37dc9e=0x0;_0x37dc9e<_0x4cc1c3['query'][_0x2d2d('0x6b')][_0x2d2d('0x40')];_0x37dc9e+=0x1){socket['emit'](_0x2d2d('0x86'),{'UserId':Number(_0x4cc1c3[_0x2d2d('0x39')][_0x2d2d('0x6b')][_0x37dc9e]),'WhatsappQueueId':Number(_0x4cc1c3[_0x2d2d('0x50')]['id'])});}}else{socket[_0x2d2d('0x72')](_0x2d2d('0x86'),{'UserId':Number(_0x4cc1c3[_0x2d2d('0x39')][_0x2d2d('0x6b')]),'WhatsappQueueId':Number(_0x4cc1c3['params']['id'])});}});}})[_0x2d2d('0x2a')](respondWithStatusCode(_0xd35766,null))['catch'](handleError(_0xd35766,null));};exports['getAgents']=function(_0x5f3639,_0x3ef295,_0x5310fe){var _0x53b696={};var _0x2292ae={};var _0x1fa559;var _0x517e4a;return db[_0x2d2d('0x4b')][_0x2d2d('0x68')]({'where':{'id':_0x5f3639[_0x2d2d('0x50')]['id']}})[_0x2d2d('0x2a')](handleEntityNotFound(_0x3ef295,null))[_0x2d2d('0x2a')](function(_0x78eca3){if(_0x78eca3){_0x1fa559=_0x78eca3;_0x2292ae[_0x2d2d('0x3d')]=_[_0x2d2d('0x3a')](db[_0x2d2d('0x5d')]['rawAttributes']);_0x2292ae[_0x2d2d('0x39')]=_[_0x2d2d('0x3a')](_0x5f3639['query']);_0x2292ae['filters']=_['intersection'](_0x2292ae[_0x2d2d('0x3d')],_0x2292ae['query']);_0x53b696[_0x2d2d('0x3e')]=_[_0x2d2d('0x3c')](_0x2292ae[_0x2d2d('0x3d')],qs[_0x2d2d('0x3f')](_0x5f3639[_0x2d2d('0x39')]['fields']));_0x53b696[_0x2d2d('0x3e')]=_0x53b696[_0x2d2d('0x3e')][_0x2d2d('0x40')]?_0x53b696['attributes']:_0x2292ae[_0x2d2d('0x3d')];_0x53b696[_0x2d2d('0x43')]=qs['sort'](_0x5f3639['query'][_0x2d2d('0x44')]);_0x53b696['where']=qs['filters'](_[_0x2d2d('0x46')](_0x5f3639[_0x2d2d('0x39')],_0x2292ae[_0x2d2d('0x3b')]));if(_0x5f3639[_0x2d2d('0x39')][_0x2d2d('0x47')]){_0x53b696[_0x2d2d('0x45')]=_[_0x2d2d('0x49')](_0x53b696[_0x2d2d('0x45')],{'$or':_[_0x2d2d('0x38')](_0x53b696[_0x2d2d('0x3e')],function(_0x46b68b){var _0x14fc20={};_0x14fc20[_0x46b68b]={'$like':'%'+_0x5f3639[_0x2d2d('0x39')][_0x2d2d('0x47')]+'%'};return _0x14fc20;})});}_0x53b696=_[_0x2d2d('0x49')]({},_0x53b696,_0x5f3639[_0x2d2d('0x4a')]);return _0x1fa559[_0x2d2d('0x8a')](_0x53b696);}})[_0x2d2d('0x2a')](function(_0x3b95b1){if(_0x3b95b1){_0x517e4a=_0x3b95b1['length'];if(!_0x5f3639['query']['hasOwnProperty'](_0x2d2d('0x42'))){_0x53b696[_0x2d2d('0x25')]=qs['limit'](_0x5f3639['query']['limit']);_0x53b696[_0x2d2d('0x22')]=qs[_0x2d2d('0x22')](_0x5f3639[_0x2d2d('0x39')][_0x2d2d('0x22')]);}return _0x1fa559[_0x2d2d('0x8a')](_0x53b696);}})[_0x2d2d('0x2a')](function(_0x5f4794){if(_0x5f4794){return _0x5f4794?{'count':_0x517e4a,'rows':_0x5f4794}:null;}})[_0x2d2d('0x2a')](respondWithResult(_0x3ef295,null))[_0x2d2d('0x4e')](handleError(_0x3ef295,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index 1e3ec21..1be844d 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 _0x4941=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0x4941,0x122));var _0x1494=function(_0x5235dd,_0x3f91cf){_0x5235dd=_0x5235dd-0x0;var _0x13059d=_0x4941[_0x5235dd];return _0x13059d;};'use strict';var EventEmitter=require(_0x1494('0x0'));var WhatsappQueue=require(_0x1494('0x1'))['db']['WhatsappQueue'];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x1494('0x2')](0x0);var events={'afterCreate':_0x1494('0x3'),'afterUpdate':_0x1494('0x4'),'afterDestroy':_0x1494('0x5')};function emitEvent(_0x14fcc9){return function(_0xe9d1f3,_0x1bb4ee,_0x58b4cc){WhatsappQueueEvents['emit'](_0x14fcc9+':'+_0xe9d1f3['id'],_0xe9d1f3);WhatsappQueueEvents[_0x1494('0x6')](_0x14fcc9,_0xe9d1f3);_0x58b4cc(null);};}for(var e in events){if(events[_0x1494('0x7')](e)){var event=events[e];WhatsappQueue[_0x1494('0x8')](e,emitEvent(event));}}module[_0x1494('0x9')]=WhatsappQueueEvents; \ No newline at end of file +var _0x201c=['setMaxListeners','save','update','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x201c,0x7e));var _0xc201=function(_0x4590ba,_0x212065){_0x4590ba=_0x4590ba-0x0;var _0x2b2d41=_0x201c[_0x4590ba];return _0x2b2d41;};'use strict';var EventEmitter=require(_0xc201('0x0'));var WhatsappQueue=require(_0xc201('0x1'))['db']['WhatsappQueue'];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0xc201('0x2')](0x0);var events={'afterCreate':_0xc201('0x3'),'afterUpdate':_0xc201('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2259ea){return function(_0x5780a7,_0x25e4dc,_0x290b86){WhatsappQueueEvents['emit'](_0x2259ea+':'+_0x5780a7['id'],_0x5780a7);WhatsappQueueEvents[_0xc201('0x5')](_0x2259ea,_0x5780a7);_0x290b86(null);};}for(var e in events){if(events[_0xc201('0x6')](e)){var event=events[e];WhatsappQueue[_0xc201('0x7')](e,emitEvent(event));}}module['exports']=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index e75e066..a3ca601 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 _0xdb7f=['moment','bluebird','request-promise','path','../../config/environment','./whatsappQueue.attributes','define','WhatsappQueue','../../config/logger','api'];(function(_0x276d7e,_0x4bf1a2){var _0x1bd1bb=function(_0x31f87b){while(--_0x31f87b){_0x276d7e['push'](_0x276d7e['shift']());}};_0x1bd1bb(++_0x4bf1a2);}(_0xdb7f,0xda));var _0xfdb7=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xdb7f[_0x4565bf];return _0x5610ba;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xfdb7('0x0'))(_0xfdb7('0x1'));var moment=require(_0xfdb7('0x2'));var BPromise=require(_0xfdb7('0x3'));var rp=require(_0xfdb7('0x4'));var fs=require('fs');var path=require(_0xfdb7('0x5'));var rimraf=require('rimraf');var config=require(_0xfdb7('0x6'));var attributes=require(_0xfdb7('0x7'));module['exports']=function(_0x2f235a,_0x4150be){return _0x2f235a[_0xfdb7('0x8')](_0xfdb7('0x9'),attributes,{'tableName':'whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb889=['whatsapp_queues','lodash','util','bluebird','request-promise','../../config/environment','exports','WhatsappQueue'];(function(_0x37b643,_0x2b3368){var _0xeda57e=function(_0x1e3d22){while(--_0x1e3d22){_0x37b643['push'](_0x37b643['shift']());}};_0xeda57e(++_0x2b3368);}(_0xb889,0x159));var _0x9b88=function(_0x88cd7b,_0x4c884c){_0x88cd7b=_0x88cd7b-0x0;var _0x56fcc8=_0xb889[_0x88cd7b];return _0x56fcc8;};'use strict';var _=require(_0x9b88('0x0'));var util=require(_0x9b88('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x9b88('0x2'));var rp=require(_0x9b88('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9b88('0x4'));var attributes=require('./whatsappQueue.attributes');module[_0x9b88('0x5')]=function(_0x26315b,_0x1aecf5){return _0x26315b['define'](_0x9b88('0x6'),attributes,{'tableName':_0x9b88('0x7'),'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 8c7561d..0215290 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 _0x4dc4=['options','where','attributes','limit','include','map','model','debug','ShowWhatsappQueue','find','raw','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','request','then','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetWhatsappQueue','WhatsappQueue','findAll'];(function(_0x101a58,_0xd02c1b){var _0x589e2c=function(_0x2b8fba){while(--_0x2b8fba){_0x101a58['push'](_0x101a58['shift']());}};_0x589e2c(++_0xd02c1b);}(_0x4dc4,0x131));var _0x44dc=function(_0x57cc7a,_0xf860ad){_0x57cc7a=_0x57cc7a-0x0;var _0x4855e7=_0x4dc4[_0x57cc7a];return _0x4855e7;};'use strict';var _=require('lodash');var util=require(_0x44dc('0x0'));var moment=require(_0x44dc('0x1'));var BPromise=require(_0x44dc('0x2'));var rs=require(_0x44dc('0x3'));var fs=require('fs');var Redis=require(_0x44dc('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x44dc('0x5'));var logger=require(_0x44dc('0x6'))(_0x44dc('0x7'));var config=require('../../config/environment');var jayson=require(_0x44dc('0x8'));var client=jayson[_0x44dc('0x9')][_0x44dc('0xa')]({'port':0x232a});config[_0x44dc('0xb')]=_[_0x44dc('0xc')](config[_0x44dc('0xb')],{'host':_0x44dc('0xd'),'port':0x18eb});var socket=require(_0x44dc('0xe'))(new Redis(config[_0x44dc('0xb')]));require(_0x44dc('0xf'))[_0x44dc('0x10')](socket);function respondWithRpcPromise(_0x5bea08,_0x4400f4,_0x494363){return new BPromise(function(_0x2102e7,_0x1ba4b2){return client[_0x44dc('0x11')](_0x5bea08,_0x494363)[_0x44dc('0x12')](function(_0x11927a){logger[_0x44dc('0x13')](_0x44dc('0x14'),_0x4400f4,_0x44dc('0x15'));logger['debug'](_0x44dc('0x16'),_0x4400f4,'request\x20sent',JSON[_0x44dc('0x17')](_0x11927a));if(_0x11927a[_0x44dc('0x18')]){if(_0x11927a[_0x44dc('0x18')][_0x44dc('0x19')]===0x1f4){logger[_0x44dc('0x18')]('WhatsappQueue,\x20%s,\x20%s',_0x4400f4,_0x11927a[_0x44dc('0x18')][_0x44dc('0x1a')]);return _0x1ba4b2(_0x11927a[_0x44dc('0x18')][_0x44dc('0x1a')]);}logger[_0x44dc('0x18')](_0x44dc('0x14'),_0x4400f4,_0x11927a[_0x44dc('0x18')][_0x44dc('0x1a')]);return _0x2102e7(_0x11927a[_0x44dc('0x18')][_0x44dc('0x1a')]);}else{logger[_0x44dc('0x13')](_0x44dc('0x14'),_0x4400f4,_0x44dc('0x15'));_0x2102e7(_0x11927a['result']['message']);}})[_0x44dc('0x1b')](function(_0x6e4aa1){logger[_0x44dc('0x18')](_0x44dc('0x14'),_0x4400f4,_0x6e4aa1);_0x1ba4b2(_0x6e4aa1);});});}exports[_0x44dc('0x1c')]=function(_0x1eb2ca){var _0x5e0618=this;return new Promise(function(_0x70f239,_0x560839){return db[_0x44dc('0x1d')][_0x44dc('0x1e')]({'raw':_0x1eb2ca[_0x44dc('0x1f')]?_0x1eb2ca[_0x44dc('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x1eb2ca[_0x44dc('0x1f')]?_0x1eb2ca[_0x44dc('0x1f')][_0x44dc('0x20')]||null:null,'attributes':_0x1eb2ca[_0x44dc('0x1f')]?_0x1eb2ca[_0x44dc('0x1f')][_0x44dc('0x21')]||null:null,'limit':_0x1eb2ca['options']?_0x1eb2ca['options'][_0x44dc('0x22')]||null:null,'include':_0x1eb2ca[_0x44dc('0x1f')]?_0x1eb2ca[_0x44dc('0x1f')][_0x44dc('0x23')]?_[_0x44dc('0x24')](_0x1eb2ca[_0x44dc('0x1f')][_0x44dc('0x23')],function(_0x2f006f){return{'model':db[_0x2f006f[_0x44dc('0x25')]],'as':_0x2f006f['as'],'attributes':_0x2f006f[_0x44dc('0x21')],'include':_0x2f006f[_0x44dc('0x23')]?_[_0x44dc('0x24')](_0x2f006f['include'],function(_0x1d1d73){return{'model':db[_0x1d1d73[_0x44dc('0x25')]],'as':_0x1d1d73['as'],'attributes':_0x1d1d73[_0x44dc('0x21')],'include':_0x1d1d73[_0x44dc('0x23')]?_[_0x44dc('0x24')](_0x1d1d73[_0x44dc('0x23')],function(_0x44c4cb){return{'model':db[_0x44c4cb[_0x44dc('0x25')]],'as':_0x44c4cb['as'],'attributes':_0x44c4cb[_0x44dc('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x8af362){logger[_0x44dc('0x13')](_0x44dc('0x1c'),_0x1eb2ca);logger[_0x44dc('0x26')]('GetWhatsappQueue',_0x1eb2ca,JSON[_0x44dc('0x17')](_0x8af362));_0x70f239(_0x8af362);})[_0x44dc('0x1b')](function(_0x163326){logger[_0x44dc('0x18')]('GetWhatsappQueue',_0x163326[_0x44dc('0x1a')],_0x1eb2ca);_0x560839(_0x5e0618[_0x44dc('0x18')](0x1f4,_0x163326[_0x44dc('0x1a')]));});});};exports[_0x44dc('0x27')]=function(_0x5d31ab){var _0x1616da=this;return new Promise(function(_0x50a572,_0x1547f1){return db[_0x44dc('0x1d')][_0x44dc('0x28')]({'raw':_0x5d31ab[_0x44dc('0x1f')]?_0x5d31ab[_0x44dc('0x1f')][_0x44dc('0x29')]===undefined?!![]:![]:!![],'where':_0x5d31ab['options']?_0x5d31ab[_0x44dc('0x1f')][_0x44dc('0x20')]||null:null,'attributes':_0x5d31ab[_0x44dc('0x1f')]?_0x5d31ab[_0x44dc('0x1f')][_0x44dc('0x21')]||null:null,'include':_0x5d31ab[_0x44dc('0x1f')]?_0x5d31ab[_0x44dc('0x1f')][_0x44dc('0x23')]?_[_0x44dc('0x24')](_0x5d31ab[_0x44dc('0x1f')]['include'],function(_0x3dadb9){return{'model':db[_0x3dadb9[_0x44dc('0x25')]],'as':_0x3dadb9['as'],'attributes':_0x3dadb9[_0x44dc('0x21')],'include':_0x3dadb9[_0x44dc('0x23')]?_['map'](_0x3dadb9['include'],function(_0x5b588f){return{'model':db[_0x5b588f[_0x44dc('0x25')]],'as':_0x5b588f['as'],'attributes':_0x5b588f[_0x44dc('0x21')],'include':_0x5b588f[_0x44dc('0x23')]?_[_0x44dc('0x24')](_0x5b588f['include'],function(_0x11f6dc){return{'model':db[_0x11f6dc[_0x44dc('0x25')]],'as':_0x11f6dc['as'],'attributes':_0x11f6dc[_0x44dc('0x21')]};}):[]};}):[]};}):[]:[]})[_0x44dc('0x12')](function(_0x1586be){logger['info']('ShowWhatsappQueue',_0x5d31ab);logger[_0x44dc('0x26')](_0x44dc('0x27'),_0x5d31ab,JSON[_0x44dc('0x17')](_0x1586be));_0x50a572(_0x1586be);})[_0x44dc('0x1b')](function(_0x5cbe19){logger[_0x44dc('0x18')](_0x44dc('0x27'),_0x5cbe19[_0x44dc('0x1a')],_0x5d31ab);_0x1547f1(_0x1616da[_0x44dc('0x18')](0x1f4,_0x5cbe19[_0x44dc('0x1a')]));});});}; \ No newline at end of file +var _0xaf74=['./whatsappQueue.socket','register','request','then','info','debug','request\x20sent','code','error','message','WhatsappQueue,\x20%s,\x20%s','result','catch','WhatsappQueue','findAll','options','raw','where','attributes','limit','include','model','map','GetWhatsappQueue','stringify','ShowWhatsappQueue','find','util','moment','bluebird','ioredis','../../config/utils','client','redis','defaults','localhost','socket.io-emitter'];(function(_0x368e09,_0x2c1517){var _0x14b7df=function(_0x5002af){while(--_0x5002af){_0x368e09['push'](_0x368e09['shift']());}};_0x14b7df(++_0x2c1517);}(_0xaf74,0x18d));var _0x4af7=function(_0x1cc71b,_0x2ccf55){_0x1cc71b=_0x1cc71b-0x0;var _0x5ca07c=_0xaf74[_0x1cc71b];return _0x5ca07c;};'use strict';var _=require('lodash');var util=require(_0x4af7('0x0'));var moment=require(_0x4af7('0x1'));var BPromise=require(_0x4af7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4af7('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4af7('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4af7('0x5')]['http']({'port':0x232a});config[_0x4af7('0x6')]=_[_0x4af7('0x7')](config[_0x4af7('0x6')],{'host':_0x4af7('0x8'),'port':0x18eb});var socket=require(_0x4af7('0x9'))(new Redis(config['redis']));require(_0x4af7('0xa'))[_0x4af7('0xb')](socket);function respondWithRpcPromise(_0x6c8255,_0x38c050,_0x22decb){return new BPromise(function(_0x208f5a,_0xd0f85c){return client[_0x4af7('0xc')](_0x6c8255,_0x22decb)[_0x4af7('0xd')](function(_0x56e3a2){logger[_0x4af7('0xe')]('WhatsappQueue,\x20%s,\x20%s',_0x38c050,'request\x20sent');logger[_0x4af7('0xf')]('WhatsappQueue,\x20%s,\x20%s,\x20%s',_0x38c050,_0x4af7('0x10'),JSON['stringify'](_0x56e3a2));if(_0x56e3a2['error']){if(_0x56e3a2['error'][_0x4af7('0x11')]===0x1f4){logger[_0x4af7('0x12')]('WhatsappQueue,\x20%s,\x20%s',_0x38c050,_0x56e3a2['error'][_0x4af7('0x13')]);return _0xd0f85c(_0x56e3a2[_0x4af7('0x12')][_0x4af7('0x13')]);}logger[_0x4af7('0x12')](_0x4af7('0x14'),_0x38c050,_0x56e3a2[_0x4af7('0x12')][_0x4af7('0x13')]);return _0x208f5a(_0x56e3a2[_0x4af7('0x12')][_0x4af7('0x13')]);}else{logger[_0x4af7('0xe')]('WhatsappQueue,\x20%s,\x20%s',_0x38c050,_0x4af7('0x10'));_0x208f5a(_0x56e3a2[_0x4af7('0x15')]['message']);}})[_0x4af7('0x16')](function(_0x19b4ae){logger['error']('WhatsappQueue,\x20%s,\x20%s',_0x38c050,_0x19b4ae);_0xd0f85c(_0x19b4ae);});});}exports['GetWhatsappQueue']=function(_0x3a860e){var _0x2e3e6e=this;return new Promise(function(_0x53aedb,_0xe4e4d7){return db[_0x4af7('0x17')][_0x4af7('0x18')]({'raw':_0x3a860e[_0x4af7('0x19')]?_0x3a860e[_0x4af7('0x19')][_0x4af7('0x1a')]===undefined?!![]:![]:!![],'where':_0x3a860e[_0x4af7('0x19')]?_0x3a860e[_0x4af7('0x19')][_0x4af7('0x1b')]||null:null,'attributes':_0x3a860e[_0x4af7('0x19')]?_0x3a860e[_0x4af7('0x19')][_0x4af7('0x1c')]||null:null,'limit':_0x3a860e['options']?_0x3a860e[_0x4af7('0x19')][_0x4af7('0x1d')]||null:null,'include':_0x3a860e[_0x4af7('0x19')]?_0x3a860e[_0x4af7('0x19')][_0x4af7('0x1e')]?_['map'](_0x3a860e[_0x4af7('0x19')][_0x4af7('0x1e')],function(_0x276c4c){return{'model':db[_0x276c4c[_0x4af7('0x1f')]],'as':_0x276c4c['as'],'attributes':_0x276c4c[_0x4af7('0x1c')],'include':_0x276c4c[_0x4af7('0x1e')]?_[_0x4af7('0x20')](_0x276c4c[_0x4af7('0x1e')],function(_0x53ef8f){return{'model':db[_0x53ef8f[_0x4af7('0x1f')]],'as':_0x53ef8f['as'],'attributes':_0x53ef8f[_0x4af7('0x1c')],'include':_0x53ef8f[_0x4af7('0x1e')]?_[_0x4af7('0x20')](_0x53ef8f[_0x4af7('0x1e')],function(_0x33be48){return{'model':db[_0x33be48[_0x4af7('0x1f')]],'as':_0x33be48['as'],'attributes':_0x33be48[_0x4af7('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2d1cdd){logger[_0x4af7('0xe')](_0x4af7('0x21'),_0x3a860e);logger[_0x4af7('0xf')]('GetWhatsappQueue',_0x3a860e,JSON[_0x4af7('0x22')](_0x2d1cdd));_0x53aedb(_0x2d1cdd);})[_0x4af7('0x16')](function(_0x48d547){logger[_0x4af7('0x12')](_0x4af7('0x21'),_0x48d547[_0x4af7('0x13')],_0x3a860e);_0xe4e4d7(_0x2e3e6e['error'](0x1f4,_0x48d547['message']));});});};exports[_0x4af7('0x23')]=function(_0xf8a60a){var _0x158a44=this;return new Promise(function(_0x596588,_0x3474b7){return db[_0x4af7('0x17')][_0x4af7('0x24')]({'raw':_0xf8a60a[_0x4af7('0x19')]?_0xf8a60a['options']['raw']===undefined?!![]:![]:!![],'where':_0xf8a60a['options']?_0xf8a60a[_0x4af7('0x19')][_0x4af7('0x1b')]||null:null,'attributes':_0xf8a60a[_0x4af7('0x19')]?_0xf8a60a[_0x4af7('0x19')]['attributes']||null:null,'include':_0xf8a60a[_0x4af7('0x19')]?_0xf8a60a['options']['include']?_[_0x4af7('0x20')](_0xf8a60a[_0x4af7('0x19')][_0x4af7('0x1e')],function(_0x5098db){return{'model':db[_0x5098db[_0x4af7('0x1f')]],'as':_0x5098db['as'],'attributes':_0x5098db[_0x4af7('0x1c')],'include':_0x5098db[_0x4af7('0x1e')]?_[_0x4af7('0x20')](_0x5098db[_0x4af7('0x1e')],function(_0x5b64d3){return{'model':db[_0x5b64d3[_0x4af7('0x1f')]],'as':_0x5b64d3['as'],'attributes':_0x5b64d3[_0x4af7('0x1c')],'include':_0x5b64d3['include']?_[_0x4af7('0x20')](_0x5b64d3[_0x4af7('0x1e')],function(_0x3fd04b){return{'model':db[_0x3fd04b[_0x4af7('0x1f')]],'as':_0x3fd04b['as'],'attributes':_0x3fd04b[_0x4af7('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x4af7('0xd')](function(_0x331030){logger[_0x4af7('0xe')]('ShowWhatsappQueue',_0xf8a60a);logger['debug'](_0x4af7('0x23'),_0xf8a60a,JSON[_0x4af7('0x22')](_0x331030));_0x596588(_0x331030);})[_0x4af7('0x16')](function(_0x4a4632){logger['error'](_0x4af7('0x23'),_0x4a4632[_0x4af7('0x13')],_0xf8a60a);_0x3474b7(_0x158a44['error'](0x1f4,_0x4a4632['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index 15d7f7c..f95a070 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 _0x10b6=['register','length','save','remove','update','emit'];(function(_0x331860,_0x2192ea){var _0x1aa26c=function(_0x5587d2){while(--_0x5587d2){_0x331860['push'](_0x331860['shift']());}};_0x1aa26c(++_0x2192ea);}(_0x10b6,0x170));var _0x610b=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x10b6[_0x3947c9];return _0x2e7871;};'use strict';var WhatsappQueueEvents=require('./whatsappQueue.events');var events=[_0x610b('0x0'),_0x610b('0x1'),_0x610b('0x2')];function createListener(_0x23ad61,_0x202faf){return function(_0x453740){_0x202faf[_0x610b('0x3')](_0x23ad61,_0x453740);};}function removeListener(_0x81211b,_0x503b0d){return function(){WhatsappQueueEvents['removeListener'](_0x81211b,_0x503b0d);};}exports[_0x610b('0x4')]=function(_0x5f2c10){for(var _0xf75b02=0x0,_0x38859a=events[_0x610b('0x5')];_0xf75b02<_0x38859a;_0xf75b02++){var _0x1920ea=events[_0xf75b02];var _0x157a2a=createListener('whatsappQueue:'+_0x1920ea,_0x5f2c10);WhatsappQueueEvents['on'](_0x1920ea,_0x157a2a);}}; \ No newline at end of file +var _0x3771=['./whatsappQueue.events','remove','update','emit','removeListener','register','length','whatsappQueue:'];(function(_0x3b594b,_0x5835c3){var _0x1ea5f8=function(_0x191b3e){while(--_0x191b3e){_0x3b594b['push'](_0x3b594b['shift']());}};_0x1ea5f8(++_0x5835c3);}(_0x3771,0x1a0));var _0x1377=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x3771[_0x432682];return _0x463d05;};'use strict';var WhatsappQueueEvents=require(_0x1377('0x0'));var events=['save',_0x1377('0x1'),_0x1377('0x2')];function createListener(_0x5d458a,_0x2d7acc){return function(_0x5d86b3){_0x2d7acc[_0x1377('0x3')](_0x5d458a,_0x5d86b3);};}function removeListener(_0x1364d3,_0xf91395){return function(){WhatsappQueueEvents[_0x1377('0x4')](_0x1364d3,_0xf91395);};}exports[_0x1377('0x5')]=function(_0x7e8a32){for(var _0xd3c77a=0x0,_0x4519e9=events[_0x1377('0x6')];_0xd3c77a<_0x4519e9;_0xd3c77a++){var _0x117738=events[_0xd3c77a];var _0x458969=createListener(_0x1377('0x7')+_0x117738,_0x7e8a32);WhatsappQueueEvents['on'](_0x117738,_0x458969);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index 6f8d42f..d11d4f1 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 _0x8bf7=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','update','delete','destroy','multer','util'];(function(_0x538f89,_0x59b28a){var _0x53e9fa=function(_0x32837f){while(--_0x32837f){_0x538f89['push'](_0x538f89['shift']());}};_0x53e9fa(++_0x59b28a);}(_0x8bf7,0x139));var _0x78bf=function(_0x327519,_0x3d83e0){_0x327519=_0x327519-0x0;var _0x4647e0=_0x8bf7[_0x327519];return _0x4647e0;};'use strict';var multer=require(_0x78bf('0x0'));var util=require(_0x78bf('0x1'));var path=require(_0x78bf('0x2'));var timeout=require('connect-timeout');var express=require(_0x78bf('0x3'));var router=express[_0x78bf('0x4')]();var fs_extra=require(_0x78bf('0x5'));var auth=require(_0x78bf('0x6'));var interaction=require(_0x78bf('0x7'));var config=require(_0x78bf('0x8'));var controller=require(_0x78bf('0x9'));router[_0x78bf('0xa')]('/',auth[_0x78bf('0xb')](),controller[_0x78bf('0xc')]);router[_0x78bf('0xa')](_0x78bf('0xd'),auth[_0x78bf('0xb')](),controller[_0x78bf('0xe')]);router[_0x78bf('0xa')](_0x78bf('0xf'),auth[_0x78bf('0xb')](),controller[_0x78bf('0x10')]);router[_0x78bf('0x11')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x78bf('0xf'),auth[_0x78bf('0xb')](),controller[_0x78bf('0x12')]);router[_0x78bf('0x13')](_0x78bf('0xf'),auth['isAuthenticated'](),controller[_0x78bf('0x14')]);module['exports']=router; \ No newline at end of file +var _0x93d3=['util','path','connect-timeout','express','Router','../../components/auth/service','./whatsappQueueReport.controller','get','isAuthenticated','index','/describe','/:id','post','put','delete','exports','multer'];(function(_0x98b0b9,_0x31f9a9){var _0x2300de=function(_0x1d4fb8){while(--_0x1d4fb8){_0x98b0b9['push'](_0x98b0b9['shift']());}};_0x2300de(++_0x31f9a9);}(_0x93d3,0x1ec));var _0x393d=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0x93d3[_0xa148b7];return _0x51efd3;};'use strict';var multer=require(_0x393d('0x0'));var util=require(_0x393d('0x1'));var path=require(_0x393d('0x2'));var timeout=require(_0x393d('0x3'));var express=require(_0x393d('0x4'));var router=express[_0x393d('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x393d('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x393d('0x7'));router[_0x393d('0x8')]('/',auth[_0x393d('0x9')](),controller[_0x393d('0xa')]);router['get'](_0x393d('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x393d('0x8')](_0x393d('0xc'),auth[_0x393d('0x9')](),controller['show']);router[_0x393d('0xd')]('/',auth[_0x393d('0x9')](),controller['create']);router[_0x393d('0xe')](_0x393d('0xc'),auth[_0x393d('0x9')](),controller['update']);router[_0x393d('0xf')](_0x393d('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x393d('0x10')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index a2fcd6a..e14203d 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(_0x4eadf9,_0x25c347){var _0x42cbe6=function(_0x3b1116){while(--_0x3b1116){_0x4eadf9['push'](_0x4eadf9['shift']());}};_0x42cbe6(++_0x25c347);}(_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(_0x27bcbb,_0x9974a7){var _0x502094=function(_0x2dab94){while(--_0x2dab94){_0x27bcbb['push'](_0x27bcbb['shift']());}};_0x502094(++_0x9974a7);}(_0x7a54,0x106));var _0x47a5=function(_0xb8be6b,_0x159f74){_0xb8be6b=_0xb8be6b-0x0;var _0x71a712=_0x7a54[_0xb8be6b];return _0x71a712;};'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 704098a..85d4f59 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 _0xb58b=['save','update','destroy','then','error','stack','name','send','index','map','WhatsappQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','include','findAll','rows','catch','find','create','body','params','describe','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','count','limit','set','Content-Range','apply','reject'];(function(_0x123c5e,_0x430bcf){var _0x2ffbfa=function(_0x478209){while(--_0x478209){_0x123c5e['push'](_0x123c5e['shift']());}};_0x2ffbfa(++_0x430bcf);}(_0xb58b,0x1f1));var _0xbb58=function(_0x337d91,_0x71ec2e){_0x337d91=_0x337d91-0x0;var _0x3c9252=_0xb58b[_0x337d91];return _0x3c9252;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbb58('0x0'));var zipdir=require(_0xbb58('0x1'));var jsonpatch=require(_0xbb58('0x2'));var rp=require('request-promise');var moment=require(_0xbb58('0x3'));var BPromise=require(_0xbb58('0x4'));var Mustache=require('mustache');var util=require(_0xbb58('0x5'));var path=require('path');var sox=require(_0xbb58('0x6'));var csv=require(_0xbb58('0x7'));var ejs=require(_0xbb58('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbb58('0x9'));var squel=require(_0xbb58('0xa'));var crypto=require(_0xbb58('0xb'));var jsforce=require(_0xbb58('0xc'));var deskjs=require(_0xbb58('0xd'));var toCsv=require(_0xbb58('0x7'));var querystring=require(_0xbb58('0xe'));var Papa=require(_0xbb58('0xf'));var Redis=require(_0xbb58('0x10'));var authService=require(_0xbb58('0x11'));var qs=require(_0xbb58('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb58('0x13'));var logger=require('../../config/logger')(_0xbb58('0x14'));var utils=require(_0xbb58('0x15'));var config=require(_0xbb58('0x16'));var licenseUtil=require(_0xbb58('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xe88799,_0x18810f){_0x18810f=_0x18810f||0xcc;return function(_0x4cda21){if(_0x4cda21){return _0xe88799[_0xbb58('0x18')](_0x18810f);}return _0xe88799[_0xbb58('0x19')](_0x18810f)[_0xbb58('0x1a')]();};}function respondWithResult(_0x3b9406,_0x19ceda){_0x19ceda=_0x19ceda||0xc8;return function(_0x58245f){if(_0x58245f){return _0x3b9406[_0xbb58('0x19')](_0x19ceda)[_0xbb58('0x1b')](_0x58245f);}};}function respondWithFilteredResult(_0x5f4751,_0x4ba30e){return function(_0x33c20f){if(_0x33c20f){var _0x445b1f=typeof _0x4ba30e[_0xbb58('0x1c')]==='undefined'&&typeof _0x4ba30e['limit']==='undefined';var _0x55156e=_0x33c20f[_0xbb58('0x1d')];var _0x3134ea=_0x445b1f?0x0:_0x4ba30e['offset'];var _0xbee66=_0x445b1f?_0x33c20f['count']:_0x4ba30e[_0xbb58('0x1c')]+_0x4ba30e[_0xbb58('0x1e')];var _0x3c33d9;if(_0xbee66>=_0x55156e){_0xbee66=_0x55156e;_0x3c33d9=0xc8;}else{_0x3c33d9=0xce;}_0x5f4751[_0xbb58('0x19')](_0x3c33d9);return _0x5f4751[_0xbb58('0x1f')](_0xbb58('0x20'),_0x3134ea+'-'+_0xbee66+'/'+_0x55156e)[_0xbb58('0x1b')](_0x33c20f);}return null;};}function patchUpdates(_0x497fd0){return function(_0x84f34){try{jsonpatch[_0xbb58('0x21')](_0x84f34,_0x497fd0,!![]);}catch(_0x3e64fe){return BPromise[_0xbb58('0x22')](_0x3e64fe);}return _0x84f34[_0xbb58('0x23')]();};}function saveUpdates(_0x5d4a91,_0x49453a){return function(_0x350be7){if(_0x350be7){return _0x350be7[_0xbb58('0x24')](_0x5d4a91)['then'](function(_0x27806d){return _0x27806d;});}return null;};}function removeEntity(_0x53b693,_0x21964d){return function(_0x287822){if(_0x287822){return _0x287822[_0xbb58('0x25')]()[_0xbb58('0x26')](function(){_0x53b693[_0xbb58('0x19')](0xcc)[_0xbb58('0x1a')]();});}};}function handleEntityNotFound(_0x2d556a,_0x15e4c5){return function(_0x4e0303){if(!_0x4e0303){_0x2d556a[_0xbb58('0x18')](0x194);}return _0x4e0303;};}function handleError(_0x3bd550,_0x1be0ae){_0x1be0ae=_0x1be0ae||0x1f4;return function(_0x129094){logger[_0xbb58('0x27')](_0x129094[_0xbb58('0x28')]);if(_0x129094[_0xbb58('0x29')]){delete _0x129094[_0xbb58('0x29')];}_0x3bd550[_0xbb58('0x19')](_0x1be0ae)[_0xbb58('0x2a')](_0x129094);};}exports[_0xbb58('0x2b')]=function(_0x28b3a3,_0x2a0481){var _0x4157c4={},_0x3559b6={},_0x573cca={'count':0x0,'rows':[]};var _0x2b0f73=_[_0xbb58('0x2c')](db[_0xbb58('0x2d')][_0xbb58('0x2e')],function(_0x3304b9){return{'name':_0x3304b9[_0xbb58('0x2f')],'type':_0x3304b9[_0xbb58('0x30')][_0xbb58('0x31')]};});_0x3559b6[_0xbb58('0x32')]=_['map'](_0x2b0f73,_0xbb58('0x29'));_0x3559b6[_0xbb58('0x33')]=_[_0xbb58('0x34')](_0x28b3a3[_0xbb58('0x33')]);_0x3559b6[_0xbb58('0x35')]=_[_0xbb58('0x36')](_0x3559b6[_0xbb58('0x32')],_0x3559b6[_0xbb58('0x33')]);_0x4157c4[_0xbb58('0x37')]=_[_0xbb58('0x36')](_0x3559b6[_0xbb58('0x32')],qs[_0xbb58('0x38')](_0x28b3a3[_0xbb58('0x33')]['fields']));_0x4157c4['attributes']=_0x4157c4['attributes'][_0xbb58('0x39')]?_0x4157c4[_0xbb58('0x37')]:_0x3559b6[_0xbb58('0x32')];if(!_0x28b3a3[_0xbb58('0x33')][_0xbb58('0x3a')](_0xbb58('0x3b'))){_0x4157c4[_0xbb58('0x1e')]=qs[_0xbb58('0x1e')](_0x28b3a3['query'][_0xbb58('0x1e')]);_0x4157c4[_0xbb58('0x1c')]=qs['offset'](_0x28b3a3[_0xbb58('0x33')]['offset']);}_0x4157c4[_0xbb58('0x3c')]=qs['sort'](_0x28b3a3[_0xbb58('0x33')][_0xbb58('0x3d')]);_0x4157c4['where']=qs[_0xbb58('0x35')](_[_0xbb58('0x3e')](_0x28b3a3[_0xbb58('0x33')],_0x3559b6[_0xbb58('0x35')]),_0x2b0f73);if(_0x28b3a3[_0xbb58('0x33')][_0xbb58('0x3f')]){_0x4157c4[_0xbb58('0x40')]=_[_0xbb58('0x41')](_0x4157c4['where'],{'$or':_[_0xbb58('0x2c')](_0x2b0f73,function(_0x31aa4b){if(_0x31aa4b[_0xbb58('0x30')]!=='VIRTUAL'){var _0x4dbd5e={};_0x4dbd5e[_0x31aa4b[_0xbb58('0x29')]]={'$like':'%'+_0x28b3a3['query'][_0xbb58('0x3f')]+'%'};return _0x4dbd5e;}})});}_0x4157c4=_[_0xbb58('0x41')]({},_0x4157c4,_0x28b3a3[_0xbb58('0x42')]);var _0x560911={'where':_0x4157c4['where']};return db[_0xbb58('0x2d')][_0xbb58('0x1d')](_0x560911)[_0xbb58('0x26')](function(_0x24d82d){_0x573cca[_0xbb58('0x1d')]=_0x24d82d;if(_0x28b3a3[_0xbb58('0x33')]['includeAll']){_0x4157c4[_0xbb58('0x43')]=[{'all':!![]}];}return db[_0xbb58('0x2d')][_0xbb58('0x44')](_0x4157c4);})[_0xbb58('0x26')](function(_0x1185b3){_0x573cca[_0xbb58('0x45')]=_0x1185b3;return _0x573cca;})['then'](respondWithFilteredResult(_0x2a0481,_0x4157c4))[_0xbb58('0x46')](handleError(_0x2a0481,null));};exports['show']=function(_0x22f1c3,_0x285ad4){var _0x29fb1c={'raw':!![],'where':{'id':_0x22f1c3['params']['id']}},_0x45817f={};_0x45817f[_0xbb58('0x32')]=_[_0xbb58('0x34')](db[_0xbb58('0x2d')][_0xbb58('0x2e')]);_0x45817f['query']=_[_0xbb58('0x34')](_0x22f1c3['query']);_0x45817f[_0xbb58('0x35')]=_[_0xbb58('0x36')](_0x45817f[_0xbb58('0x32')],_0x45817f[_0xbb58('0x33')]);_0x29fb1c[_0xbb58('0x37')]=_[_0xbb58('0x36')](_0x45817f[_0xbb58('0x32')],qs[_0xbb58('0x38')](_0x22f1c3[_0xbb58('0x33')][_0xbb58('0x38')]));_0x29fb1c[_0xbb58('0x37')]=_0x29fb1c[_0xbb58('0x37')][_0xbb58('0x39')]?_0x29fb1c['attributes']:_0x45817f[_0xbb58('0x32')];if(_0x22f1c3['query']['includeAll']){_0x29fb1c[_0xbb58('0x43')]=[{'all':!![]}];}_0x29fb1c=_[_0xbb58('0x41')]({},_0x29fb1c,_0x22f1c3[_0xbb58('0x42')]);return db[_0xbb58('0x2d')][_0xbb58('0x47')](_0x29fb1c)[_0xbb58('0x26')](handleEntityNotFound(_0x285ad4,null))[_0xbb58('0x26')](respondWithResult(_0x285ad4,null))[_0xbb58('0x46')](handleError(_0x285ad4,null));};exports[_0xbb58('0x48')]=function(_0x39995e,_0x440fb3){return db['WhatsappQueueReport'][_0xbb58('0x48')](_0x39995e[_0xbb58('0x49')],{})['then'](respondWithResult(_0x440fb3,0xc9))[_0xbb58('0x46')](handleError(_0x440fb3,null));};exports[_0xbb58('0x24')]=function(_0xf94897,_0xdb0ff7){if(_0xf94897['body']['id']){delete _0xf94897[_0xbb58('0x49')]['id'];}return db['WhatsappQueueReport'][_0xbb58('0x47')]({'where':{'id':_0xf94897[_0xbb58('0x4a')]['id']}})[_0xbb58('0x26')](handleEntityNotFound(_0xdb0ff7,null))['then'](saveUpdates(_0xf94897[_0xbb58('0x49')],null))[_0xbb58('0x26')](respondWithResult(_0xdb0ff7,null))['catch'](handleError(_0xdb0ff7,null));};exports[_0xbb58('0x25')]=function(_0x4ca201,_0x28301d){return db[_0xbb58('0x2d')][_0xbb58('0x47')]({'where':{'id':_0x4ca201[_0xbb58('0x4a')]['id']}})[_0xbb58('0x26')](handleEntityNotFound(_0x28301d,null))[_0xbb58('0x26')](removeEntity(_0x28301d,null))[_0xbb58('0x46')](handleError(_0x28301d,null));};exports['describe']=function(_0x449088,_0x1fd892){return db['WhatsappQueueReport'][_0xbb58('0x4b')]()[_0xbb58('0x26')](respondWithResult(_0x1fd892,null))['catch'](handleError(_0x1fd892,null));}; \ No newline at end of file +var _0xf4f4=['crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','end','sendStatus','error','stack','name','send','index','map','WhatsappQueueReport','fieldName','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','rawAttributes','length','find','create','body','params','destroy','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x51b6dc,_0x5a079b){var _0x70be33=function(_0x37584c){while(--_0x37584c){_0x51b6dc['push'](_0x51b6dc['shift']());}};_0x70be33(++_0x5a079b);}(_0xf4f4,0xe3));var _0x4f4f=function(_0x211158,_0x5edf3c){_0x211158=_0x211158-0x0;var _0x197bef=_0xf4f4[_0x211158];return _0x197bef;};'use strict';var emlformat=require(_0x4f4f('0x0'));var rimraf=require(_0x4f4f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4f4f('0x2'));var rp=require(_0x4f4f('0x3'));var moment=require(_0x4f4f('0x4'));var BPromise=require(_0x4f4f('0x5'));var Mustache=require(_0x4f4f('0x6'));var util=require('util');var path=require(_0x4f4f('0x7'));var sox=require('sox');var csv=require(_0x4f4f('0x8'));var ejs=require(_0x4f4f('0x9'));var fs=require('fs');var fs_extra=require(_0x4f4f('0xa'));var _=require(_0x4f4f('0xb'));var squel=require(_0x4f4f('0xc'));var crypto=require(_0x4f4f('0xd'));var jsforce=require(_0x4f4f('0xe'));var deskjs=require(_0x4f4f('0xf'));var toCsv=require('to-csv');var querystring=require(_0x4f4f('0x10'));var Papa=require(_0x4f4f('0x11'));var Redis=require(_0x4f4f('0x12'));var authService=require(_0x4f4f('0x13'));var qs=require(_0x4f4f('0x14'));var as=require(_0x4f4f('0x15'));var hardwareService=require(_0x4f4f('0x16'));var logger=require(_0x4f4f('0x17'))('api');var utils=require('../../config/utils');var config=require(_0x4f4f('0x18'));var licenseUtil=require(_0x4f4f('0x19'));var db=require(_0x4f4f('0x1a'))['db'];function respondWithStatusCode(_0x1b54b0,_0x282031){_0x282031=_0x282031||0xcc;return function(_0x1d7575){if(_0x1d7575){return _0x1b54b0['sendStatus'](_0x282031);}return _0x1b54b0[_0x4f4f('0x1b')](_0x282031)['end']();};}function respondWithResult(_0x216ba8,_0xe7c2d5){_0xe7c2d5=_0xe7c2d5||0xc8;return function(_0x3e16e9){if(_0x3e16e9){return _0x216ba8[_0x4f4f('0x1b')](_0xe7c2d5)['json'](_0x3e16e9);}};}function respondWithFilteredResult(_0x19f2fd,_0x4c68f4){return function(_0x47ab66){if(_0x47ab66){var _0x58de77=typeof _0x4c68f4[_0x4f4f('0x1c')]===_0x4f4f('0x1d')&&typeof _0x4c68f4[_0x4f4f('0x1e')]===_0x4f4f('0x1d');var _0x2d5e5d=_0x47ab66[_0x4f4f('0x1f')];var _0x1245c4=_0x58de77?0x0:_0x4c68f4[_0x4f4f('0x1c')];var _0x929a0b=_0x58de77?_0x47ab66[_0x4f4f('0x1f')]:_0x4c68f4[_0x4f4f('0x1c')]+_0x4c68f4[_0x4f4f('0x1e')];var _0x499277;if(_0x929a0b>=_0x2d5e5d){_0x929a0b=_0x2d5e5d;_0x499277=0xc8;}else{_0x499277=0xce;}_0x19f2fd[_0x4f4f('0x1b')](_0x499277);return _0x19f2fd[_0x4f4f('0x20')](_0x4f4f('0x21'),_0x1245c4+'-'+_0x929a0b+'/'+_0x2d5e5d)[_0x4f4f('0x22')](_0x47ab66);}return null;};}function patchUpdates(_0x302a79){return function(_0x460b4d){try{jsonpatch[_0x4f4f('0x23')](_0x460b4d,_0x302a79,!![]);}catch(_0x3e33d5){return BPromise[_0x4f4f('0x24')](_0x3e33d5);}return _0x460b4d[_0x4f4f('0x25')]();};}function saveUpdates(_0x469a1d,_0x17832f){return function(_0x17984d){if(_0x17984d){return _0x17984d[_0x4f4f('0x26')](_0x469a1d)['then'](function(_0x4f7261){return _0x4f7261;});}return null;};}function removeEntity(_0x525529,_0x272125){return function(_0x43e661){if(_0x43e661){return _0x43e661['destroy']()[_0x4f4f('0x27')](function(){_0x525529[_0x4f4f('0x1b')](0xcc)[_0x4f4f('0x28')]();});}};}function handleEntityNotFound(_0x2ec92a,_0x113ff7){return function(_0x31b30e){if(!_0x31b30e){_0x2ec92a[_0x4f4f('0x29')](0x194);}return _0x31b30e;};}function handleError(_0x50a8ce,_0x39fb9f){_0x39fb9f=_0x39fb9f||0x1f4;return function(_0x237cf9){logger[_0x4f4f('0x2a')](_0x237cf9[_0x4f4f('0x2b')]);if(_0x237cf9[_0x4f4f('0x2c')]){delete _0x237cf9['name'];}_0x50a8ce[_0x4f4f('0x1b')](_0x39fb9f)[_0x4f4f('0x2d')](_0x237cf9);};}exports[_0x4f4f('0x2e')]=function(_0x5deda9,_0x534075){var _0x4c2490={},_0x73b8bb={},_0x5b4f6a={'count':0x0,'rows':[]};var _0x354266=_[_0x4f4f('0x2f')](db[_0x4f4f('0x30')]['rawAttributes'],function(_0x460546){return{'name':_0x460546[_0x4f4f('0x31')],'type':_0x460546['type'][_0x4f4f('0x32')]};});_0x73b8bb[_0x4f4f('0x33')]=_[_0x4f4f('0x2f')](_0x354266,'name');_0x73b8bb[_0x4f4f('0x34')]=_[_0x4f4f('0x35')](_0x5deda9['query']);_0x73b8bb['filters']=_[_0x4f4f('0x36')](_0x73b8bb[_0x4f4f('0x33')],_0x73b8bb[_0x4f4f('0x34')]);_0x4c2490[_0x4f4f('0x37')]=_[_0x4f4f('0x36')](_0x73b8bb[_0x4f4f('0x33')],qs[_0x4f4f('0x38')](_0x5deda9[_0x4f4f('0x34')][_0x4f4f('0x38')]));_0x4c2490[_0x4f4f('0x37')]=_0x4c2490['attributes']['length']?_0x4c2490[_0x4f4f('0x37')]:_0x73b8bb['model'];if(!_0x5deda9[_0x4f4f('0x34')][_0x4f4f('0x39')](_0x4f4f('0x3a'))){_0x4c2490[_0x4f4f('0x1e')]=qs[_0x4f4f('0x1e')](_0x5deda9[_0x4f4f('0x34')][_0x4f4f('0x1e')]);_0x4c2490[_0x4f4f('0x1c')]=qs[_0x4f4f('0x1c')](_0x5deda9[_0x4f4f('0x34')][_0x4f4f('0x1c')]);}_0x4c2490[_0x4f4f('0x3b')]=qs['sort'](_0x5deda9[_0x4f4f('0x34')][_0x4f4f('0x3c')]);_0x4c2490[_0x4f4f('0x3d')]=qs[_0x4f4f('0x3e')](_[_0x4f4f('0x3f')](_0x5deda9[_0x4f4f('0x34')],_0x73b8bb[_0x4f4f('0x3e')]),_0x354266);if(_0x5deda9[_0x4f4f('0x34')][_0x4f4f('0x40')]){_0x4c2490['where']=_[_0x4f4f('0x41')](_0x4c2490[_0x4f4f('0x3d')],{'$or':_[_0x4f4f('0x2f')](_0x354266,function(_0x5eb174){if(_0x5eb174['type']!==_0x4f4f('0x42')){var _0x95a296={};_0x95a296[_0x5eb174[_0x4f4f('0x2c')]]={'$like':'%'+_0x5deda9[_0x4f4f('0x34')][_0x4f4f('0x40')]+'%'};return _0x95a296;}})});}_0x4c2490=_[_0x4f4f('0x41')]({},_0x4c2490,_0x5deda9[_0x4f4f('0x43')]);var _0x1ff7f3={'where':_0x4c2490[_0x4f4f('0x3d')]};return db[_0x4f4f('0x30')][_0x4f4f('0x1f')](_0x1ff7f3)[_0x4f4f('0x27')](function(_0x4e352e){_0x5b4f6a[_0x4f4f('0x1f')]=_0x4e352e;if(_0x5deda9[_0x4f4f('0x34')][_0x4f4f('0x44')]){_0x4c2490[_0x4f4f('0x45')]=[{'all':!![]}];}return db[_0x4f4f('0x30')]['findAll'](_0x4c2490);})['then'](function(_0x134710){_0x5b4f6a[_0x4f4f('0x46')]=_0x134710;return _0x5b4f6a;})[_0x4f4f('0x27')](respondWithFilteredResult(_0x534075,_0x4c2490))[_0x4f4f('0x47')](handleError(_0x534075,null));};exports['show']=function(_0x1aaf2c,_0x480919){var _0x10de24={'raw':!![],'where':{'id':_0x1aaf2c['params']['id']}},_0x5a7c94={};_0x5a7c94[_0x4f4f('0x33')]=_['keys'](db[_0x4f4f('0x30')][_0x4f4f('0x48')]);_0x5a7c94['query']=_[_0x4f4f('0x35')](_0x1aaf2c[_0x4f4f('0x34')]);_0x5a7c94['filters']=_[_0x4f4f('0x36')](_0x5a7c94[_0x4f4f('0x33')],_0x5a7c94[_0x4f4f('0x34')]);_0x10de24[_0x4f4f('0x37')]=_[_0x4f4f('0x36')](_0x5a7c94[_0x4f4f('0x33')],qs[_0x4f4f('0x38')](_0x1aaf2c[_0x4f4f('0x34')][_0x4f4f('0x38')]));_0x10de24[_0x4f4f('0x37')]=_0x10de24[_0x4f4f('0x37')][_0x4f4f('0x49')]?_0x10de24[_0x4f4f('0x37')]:_0x5a7c94[_0x4f4f('0x33')];if(_0x1aaf2c[_0x4f4f('0x34')]['includeAll']){_0x10de24[_0x4f4f('0x45')]=[{'all':!![]}];}_0x10de24=_['merge']({},_0x10de24,_0x1aaf2c['options']);return db[_0x4f4f('0x30')][_0x4f4f('0x4a')](_0x10de24)['then'](handleEntityNotFound(_0x480919,null))[_0x4f4f('0x27')](respondWithResult(_0x480919,null))[_0x4f4f('0x47')](handleError(_0x480919,null));};exports[_0x4f4f('0x4b')]=function(_0x2721b5,_0x222511){return db['WhatsappQueueReport'][_0x4f4f('0x4b')](_0x2721b5[_0x4f4f('0x4c')],{})[_0x4f4f('0x27')](respondWithResult(_0x222511,0xc9))[_0x4f4f('0x47')](handleError(_0x222511,null));};exports[_0x4f4f('0x26')]=function(_0x433787,_0x29314b){if(_0x433787[_0x4f4f('0x4c')]['id']){delete _0x433787[_0x4f4f('0x4c')]['id'];}return db['WhatsappQueueReport'][_0x4f4f('0x4a')]({'where':{'id':_0x433787[_0x4f4f('0x4d')]['id']}})['then'](handleEntityNotFound(_0x29314b,null))['then'](saveUpdates(_0x433787['body'],null))[_0x4f4f('0x27')](respondWithResult(_0x29314b,null))[_0x4f4f('0x47')](handleError(_0x29314b,null));};exports[_0x4f4f('0x4e')]=function(_0x5c5077,_0x389ec6){return db['WhatsappQueueReport'][_0x4f4f('0x4a')]({'where':{'id':_0x5c5077[_0x4f4f('0x4d')]['id']}})[_0x4f4f('0x27')](handleEntityNotFound(_0x389ec6,null))[_0x4f4f('0x27')](removeEntity(_0x389ec6,null))[_0x4f4f('0x47')](handleError(_0x389ec6,null));};exports[_0x4f4f('0x4f')]=function(_0x21408b,_0x88054a){return db[_0x4f4f('0x30')]['describe']()['then'](respondWithResult(_0x88054a,null))[_0x4f4f('0x47')](handleError(_0x88054a,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index ed18df6..18b42e0 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 _0x47c4=['exports','WhatsappQueueReport','report_whatsapp_queue','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappQueueReport.attributes'];(function(_0x458590,_0xe5676f){var _0x163368=function(_0x3bbf85){while(--_0x3bbf85){_0x458590['push'](_0x458590['shift']());}};_0x163368(++_0xe5676f);}(_0x47c4,0x1ee));var _0x447c=function(_0x2df507,_0x553862){_0x2df507=_0x2df507-0x0;var _0x1f7167=_0x47c4[_0x2df507];return _0x1f7167;};'use strict';var _=require(_0x447c('0x0'));var util=require(_0x447c('0x1'));var logger=require(_0x447c('0x2'))(_0x447c('0x3'));var moment=require('moment');var BPromise=require(_0x447c('0x4'));var rp=require(_0x447c('0x5'));var fs=require('fs');var path=require(_0x447c('0x6'));var rimraf=require(_0x447c('0x7'));var config=require(_0x447c('0x8'));var attributes=require(_0x447c('0x9'));module[_0x447c('0xa')]=function(_0x219a88,_0x17a4e1){return _0x219a88['define'](_0x447c('0xb'),attributes,{'tableName':_0x447c('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x447c('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x737f=['bluebird','path','rimraf','../../config/environment','./whatsappQueueReport.attributes','exports','define','WhatsappQueueReport','report_whatsapp_queue','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x25fb80,_0x921eeb){var _0x2becf0=function(_0x5d9d40){while(--_0x5d9d40){_0x25fb80['push'](_0x25fb80['shift']());}};_0x2becf0(++_0x921eeb);}(_0x737f,0x19f));var _0xf737=function(_0x126751,_0x3b37d9){_0x126751=_0x126751-0x0;var _0x444b55=_0x737f[_0x126751];return _0x444b55;};'use strict';var _=require(_0xf737('0x0'));var util=require(_0xf737('0x1'));var logger=require(_0xf737('0x2'))(_0xf737('0x3'));var moment=require(_0xf737('0x4'));var BPromise=require(_0xf737('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf737('0x6'));var rimraf=require(_0xf737('0x7'));var config=require(_0xf737('0x8'));var attributes=require(_0xf737('0x9'));module[_0xf737('0xa')]=function(_0x2519a1,_0xc07962){return _0x2519a1[_0xf737('0xb')](_0xf737('0xc'),attributes,{'tableName':_0xf737('0xd'),'paranoid':![],'indexes':[{'name':_0xf737('0xe'),'fields':[_0xf737('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index 20b9057..5159276 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 _0xcc56=['debug','UpdateWhatsappQueueReport','WhatsappQueueReport','update','attributes','limit','info','lodash','util','moment','randomstring','ioredis','../../config/logger','rpc','client','http','request','then','request\x20sent','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','WhatsappQueueReport,\x20%s,\x20%s','result','catch','CreateWhatsappQueueReport','body','options','raw'];(function(_0x4c5b70,_0x290ef3){var _0x2cb607=function(_0x552d0a){while(--_0x552d0a){_0x4c5b70['push'](_0x4c5b70['shift']());}};_0x2cb607(++_0x290ef3);}(_0xcc56,0x133));var _0x6cc5=function(_0x5101b8,_0xe57d1d){_0x5101b8=_0x5101b8-0x0;var _0x4644e0=_0xcc56[_0x5101b8];return _0x4644e0;};'use strict';var _=require(_0x6cc5('0x0'));var util=require(_0x6cc5('0x1'));var moment=require(_0x6cc5('0x2'));var BPromise=require('bluebird');var rs=require(_0x6cc5('0x3'));var fs=require('fs');var Redis=require(_0x6cc5('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6cc5('0x5'))(_0x6cc5('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6cc5('0x7')][_0x6cc5('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x402784,_0x32fa7a,_0x1ae4c5){return new BPromise(function(_0x4de25d,_0x1c2354){return client[_0x6cc5('0x9')](_0x402784,_0x1ae4c5)[_0x6cc5('0xa')](function(_0x55c559){logger['info']('WhatsappQueueReport,\x20%s,\x20%s',_0x32fa7a,_0x6cc5('0xb'));logger['debug'](_0x6cc5('0xc'),_0x32fa7a,_0x6cc5('0xb'),JSON[_0x6cc5('0xd')](_0x55c559));if(_0x55c559[_0x6cc5('0xe')]){if(_0x55c559[_0x6cc5('0xe')]['code']===0x1f4){logger[_0x6cc5('0xe')]('WhatsappQueueReport,\x20%s,\x20%s',_0x32fa7a,_0x55c559[_0x6cc5('0xe')][_0x6cc5('0xf')]);return _0x1c2354(_0x55c559[_0x6cc5('0xe')][_0x6cc5('0xf')]);}logger[_0x6cc5('0xe')](_0x6cc5('0x10'),_0x32fa7a,_0x55c559['error'][_0x6cc5('0xf')]);return _0x4de25d(_0x55c559['error'][_0x6cc5('0xf')]);}else{logger['info']('WhatsappQueueReport,\x20%s,\x20%s',_0x32fa7a,_0x6cc5('0xb'));_0x4de25d(_0x55c559[_0x6cc5('0x11')]['message']);}})[_0x6cc5('0x12')](function(_0x19afe9){logger[_0x6cc5('0xe')](_0x6cc5('0x10'),_0x32fa7a,_0x19afe9);_0x1c2354(_0x19afe9);});});}exports[_0x6cc5('0x13')]=function(_0x4759f4){var _0x45d344=this;return new Promise(function(_0x1b1cdf,_0x1cc40b){return db['WhatsappQueueReport']['create'](_0x4759f4[_0x6cc5('0x14')],{'raw':_0x4759f4[_0x6cc5('0x15')]?_0x4759f4[_0x6cc5('0x15')][_0x6cc5('0x16')]===undefined?!![]:![]:!![]})[_0x6cc5('0xa')](function(_0xf3a761){logger['info']('CreateWhatsappQueueReport',_0x4759f4);logger[_0x6cc5('0x17')]('CreateWhatsappQueueReport',_0x4759f4,JSON[_0x6cc5('0xd')](_0xf3a761));_0x1b1cdf(_0xf3a761);})[_0x6cc5('0x12')](function(_0x4e5612){logger[_0x6cc5('0xe')](_0x6cc5('0x13'),_0x4e5612[_0x6cc5('0xf')],_0x4759f4);_0x1cc40b(_0x45d344[_0x6cc5('0xe')](0x1f4,_0x4e5612[_0x6cc5('0xf')]));});});};exports[_0x6cc5('0x18')]=function(_0x1bcaa6){var _0x3ae720=this;return new Promise(function(_0x2b13bb,_0x5d147c){return db[_0x6cc5('0x19')][_0x6cc5('0x1a')](_0x1bcaa6['body'],{'raw':_0x1bcaa6[_0x6cc5('0x15')]?_0x1bcaa6[_0x6cc5('0x15')][_0x6cc5('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1bcaa6['options']?_0x1bcaa6['options']['where']||null:null,'attributes':_0x1bcaa6[_0x6cc5('0x15')]?_0x1bcaa6[_0x6cc5('0x15')][_0x6cc5('0x1b')]||null:null,'limit':_0x1bcaa6[_0x6cc5('0x15')]?_0x1bcaa6[_0x6cc5('0x15')][_0x6cc5('0x1c')]||null:null})[_0x6cc5('0xa')](function(_0x4a3e58){logger[_0x6cc5('0x1d')](_0x6cc5('0x18'),_0x1bcaa6);logger[_0x6cc5('0x17')](_0x6cc5('0x18'),_0x1bcaa6,JSON['stringify'](_0x4a3e58));_0x2b13bb(_0x4a3e58);})['catch'](function(_0x388012){logger['error'](_0x6cc5('0x18'),_0x388012[_0x6cc5('0xf')],_0x1bcaa6);_0x5d147c(_0x3ae720[_0x6cc5('0xe')](0x1f4,_0x388012[_0x6cc5('0xf')]));});});}; \ No newline at end of file +var _0x3d15=['result','catch','CreateWhatsappQueueReport','create','body','options','raw','UpdateWhatsappQueueReport','update','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','WhatsappQueueReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info'];(function(_0x2a3b62,_0x41667c){var _0x2fd3f2=function(_0x57ccd7){while(--_0x57ccd7){_0x2a3b62['push'](_0x2a3b62['shift']());}};_0x2fd3f2(++_0x41667c);}(_0x3d15,0x94));var _0x53d1=function(_0xe480f0,_0x4c0dc1){_0xe480f0=_0xe480f0-0x0;var _0x57b198=_0x3d15[_0xe480f0];return _0x57b198;};'use strict';var _=require(_0x53d1('0x0'));var util=require(_0x53d1('0x1'));var moment=require(_0x53d1('0x2'));var BPromise=require(_0x53d1('0x3'));var rs=require(_0x53d1('0x4'));var fs=require('fs');var Redis=require(_0x53d1('0x5'));var db=require(_0x53d1('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x53d1('0x7'))('rpc');var config=require(_0x53d1('0x8'));var jayson=require(_0x53d1('0x9'));var client=jayson[_0x53d1('0xa')][_0x53d1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4e8bc9,_0x1bf5b9,_0x38d14a){return new BPromise(function(_0x398ff8,_0xc8d43b){return client[_0x53d1('0xc')](_0x4e8bc9,_0x38d14a)[_0x53d1('0xd')](function(_0xd26227){logger['info'](_0x53d1('0xe'),_0x1bf5b9,'request\x20sent');logger[_0x53d1('0xf')]('WhatsappQueueReport,\x20%s,\x20%s,\x20%s',_0x1bf5b9,_0x53d1('0x10'),JSON[_0x53d1('0x11')](_0xd26227));if(_0xd26227[_0x53d1('0x12')]){if(_0xd26227[_0x53d1('0x12')][_0x53d1('0x13')]===0x1f4){logger[_0x53d1('0x12')](_0x53d1('0xe'),_0x1bf5b9,_0xd26227[_0x53d1('0x12')][_0x53d1('0x14')]);return _0xc8d43b(_0xd26227[_0x53d1('0x12')][_0x53d1('0x14')]);}logger[_0x53d1('0x12')]('WhatsappQueueReport,\x20%s,\x20%s',_0x1bf5b9,_0xd26227[_0x53d1('0x12')][_0x53d1('0x14')]);return _0x398ff8(_0xd26227[_0x53d1('0x12')][_0x53d1('0x14')]);}else{logger[_0x53d1('0x15')](_0x53d1('0xe'),_0x1bf5b9,_0x53d1('0x10'));_0x398ff8(_0xd26227[_0x53d1('0x16')]['message']);}})[_0x53d1('0x17')](function(_0x4ae0d0){logger[_0x53d1('0x12')](_0x53d1('0xe'),_0x1bf5b9,_0x4ae0d0);_0xc8d43b(_0x4ae0d0);});});}exports[_0x53d1('0x18')]=function(_0x519e75){var _0x3099cd=this;return new Promise(function(_0x34606a,_0x18de3e){return db['WhatsappQueueReport'][_0x53d1('0x19')](_0x519e75[_0x53d1('0x1a')],{'raw':_0x519e75[_0x53d1('0x1b')]?_0x519e75[_0x53d1('0x1b')][_0x53d1('0x1c')]===undefined?!![]:![]:!![]})[_0x53d1('0xd')](function(_0x302aac){logger['info'](_0x53d1('0x18'),_0x519e75);logger[_0x53d1('0xf')](_0x53d1('0x18'),_0x519e75,JSON[_0x53d1('0x11')](_0x302aac));_0x34606a(_0x302aac);})[_0x53d1('0x17')](function(_0x265c93){logger[_0x53d1('0x12')](_0x53d1('0x18'),_0x265c93[_0x53d1('0x14')],_0x519e75);_0x18de3e(_0x3099cd[_0x53d1('0x12')](0x1f4,_0x265c93[_0x53d1('0x14')]));});});};exports[_0x53d1('0x1d')]=function(_0xf6bcb6){var _0x7949b8=this;return new Promise(function(_0x5335fc,_0x4ebd40){return db['WhatsappQueueReport'][_0x53d1('0x1e')](_0xf6bcb6['body'],{'raw':_0xf6bcb6[_0x53d1('0x1b')]?_0xf6bcb6[_0x53d1('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xf6bcb6['options']?_0xf6bcb6['options'][_0x53d1('0x1f')]||null:null,'attributes':_0xf6bcb6[_0x53d1('0x1b')]?_0xf6bcb6[_0x53d1('0x1b')][_0x53d1('0x20')]||null:null,'limit':_0xf6bcb6[_0x53d1('0x1b')]?_0xf6bcb6[_0x53d1('0x1b')][_0x53d1('0x21')]||null:null})[_0x53d1('0xd')](function(_0x2f1521){logger[_0x53d1('0x15')](_0x53d1('0x1d'),_0xf6bcb6);logger['debug'](_0x53d1('0x1d'),_0xf6bcb6,JSON[_0x53d1('0x11')](_0x2f1521));_0x5335fc(_0x2f1521);})[_0x53d1('0x17')](function(_0x19a5c3){logger['error'](_0x53d1('0x1d'),_0x19a5c3[_0x53d1('0x14')],_0xf6bcb6);_0x4ebd40(_0x7949b8['error'](0x1f4,_0x19a5c3[_0x53d1('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index 3f2f7e6..bae58ae 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 _0x0d71=['get','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','express','Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappTransferReport.controller','isAuthenticated','index'];(function(_0x53b6f0,_0x134603){var _0xcbc09d=function(_0x47d7f8){while(--_0x47d7f8){_0x53b6f0['push'](_0x53b6f0['shift']());}};_0xcbc09d(++_0x134603);}(_0x0d71,0xf3));var _0x10d7=function(_0x100ef3,_0x35506f){_0x100ef3=_0x100ef3-0x0;var _0x5ed843=_0x0d71[_0x100ef3];return _0x5ed843;};'use strict';var multer=require(_0x10d7('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x10d7('0x1'));var router=express[_0x10d7('0x2')]();var fs_extra=require(_0x10d7('0x3'));var auth=require(_0x10d7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x10d7('0x5'));var controller=require(_0x10d7('0x6'));router['get']('/',auth[_0x10d7('0x7')](),controller[_0x10d7('0x8')]);router[_0x10d7('0x9')](_0x10d7('0xa'),auth['isAuthenticated'](),controller[_0x10d7('0xb')]);router[_0x10d7('0x9')](_0x10d7('0xc'),auth[_0x10d7('0x7')](),controller[_0x10d7('0xd')]);router[_0x10d7('0xe')]('/',auth['isAuthenticated'](),controller[_0x10d7('0xf')]);router[_0x10d7('0x10')](_0x10d7('0xc'),auth[_0x10d7('0x7')](),controller[_0x10d7('0x11')]);router[_0x10d7('0x12')](_0x10d7('0xc'),auth[_0x10d7('0x7')](),controller[_0x10d7('0x13')]);module[_0x10d7('0x14')]=router; \ No newline at end of file +var _0xfda3=['describe','/:id','show','post','create','put','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappTransferReport.controller','get','index','/describe','isAuthenticated'];(function(_0x4a7252,_0x40fb92){var _0x2240de=function(_0x23e2d6){while(--_0x23e2d6){_0x4a7252['push'](_0x4a7252['shift']());}};_0x2240de(++_0x40fb92);}(_0xfda3,0x12f));var _0x3fda=function(_0x4db5dc,_0x522901){_0x4db5dc=_0x4db5dc-0x0;var _0x62ee23=_0xfda3[_0x4db5dc];return _0x62ee23;};'use strict';var multer=require(_0x3fda('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x3fda('0x1'));var express=require(_0x3fda('0x2'));var router=express[_0x3fda('0x3')]();var fs_extra=require(_0x3fda('0x4'));var auth=require(_0x3fda('0x5'));var interaction=require(_0x3fda('0x6'));var config=require('../../config/environment');var controller=require(_0x3fda('0x7'));router[_0x3fda('0x8')]('/',auth['isAuthenticated'](),controller[_0x3fda('0x9')]);router['get'](_0x3fda('0xa'),auth[_0x3fda('0xb')](),controller[_0x3fda('0xc')]);router[_0x3fda('0x8')](_0x3fda('0xd'),auth[_0x3fda('0xb')](),controller[_0x3fda('0xe')]);router[_0x3fda('0xf')]('/',auth[_0x3fda('0xb')](),controller[_0x3fda('0x10')]);router[_0x3fda('0x11')](_0x3fda('0xd'),auth[_0x3fda('0xb')](),controller['update']);router[_0x3fda('0x12')](_0x3fda('0xd'),auth[_0x3fda('0xb')](),controller[_0x3fda('0x13')]);module[_0x3fda('0x14')]=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index 3cf514e..e59252d 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 _0xab54=['DATE','exports','STRING','ENUM','account','agent'];(function(_0x55850c,_0x229051){var _0x32d952=function(_0x31e80d){while(--_0x31e80d){_0x55850c['push'](_0x55850c['shift']());}};_0x32d952(++_0x229051);}(_0xab54,0x115));var _0x4ab5=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xab54[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require('sequelize');module[_0x4ab5('0x0')]={'uniqueid':{'type':Sequelize[_0x4ab5('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x4ab5('0x2')](_0x4ab5('0x3'),_0x4ab5('0x4'),'queue'),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x4ab5('0x5')]}}; \ No newline at end of file +var _0x7292=['ENUM','account','agent','DATE','sequelize','exports','STRING'];(function(_0x26439d,_0x2e737d){var _0x590fe0=function(_0x26f97c){while(--_0x26f97c){_0x26439d['push'](_0x26439d['shift']());}};_0x590fe0(++_0x2e737d);}(_0x7292,0x6d));var _0x2729=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x7292[_0x17d9e3];return _0x14192d;};'use strict';var Sequelize=require(_0x2729('0x0'));module[_0x2729('0x1')]={'uniqueid':{'type':Sequelize[_0x2729('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x2729('0x3')](_0x2729('0x4'),_0x2729('0x5'),'queue'),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x2729('0x6')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index fee7b4e..42f9957 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 _0x241f=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','json','offset','limit','count','status','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','WhatsappTransferReport','findAll','rows','catch','params','rawAttributes','find','create','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv'];(function(_0x174121,_0x308d62){var _0x2d5667=function(_0x4e6c57){while(--_0x4e6c57){_0x174121['push'](_0x174121['shift']());}};_0x2d5667(++_0x308d62);}(_0x241f,0x123));var _0xf241=function(_0x198247,_0x491c12){_0x198247=_0x198247-0x0;var _0x2b18bc=_0x241f[_0x198247];return _0x2b18bc;};'use strict';var emlformat=require(_0xf241('0x0'));var rimraf=require(_0xf241('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf241('0x2'));var rp=require('request-promise');var moment=require(_0xf241('0x3'));var BPromise=require(_0xf241('0x4'));var Mustache=require(_0xf241('0x5'));var util=require(_0xf241('0x6'));var path=require(_0xf241('0x7'));var sox=require(_0xf241('0x8'));var csv=require('to-csv');var ejs=require(_0xf241('0x9'));var fs=require('fs');var fs_extra=require(_0xf241('0xa'));var _=require(_0xf241('0xb'));var squel=require(_0xf241('0xc'));var crypto=require(_0xf241('0xd'));var jsforce=require(_0xf241('0xe'));var deskjs=require(_0xf241('0xf'));var toCsv=require(_0xf241('0x10'));var querystring=require(_0xf241('0x11'));var Papa=require(_0xf241('0x12'));var Redis=require(_0xf241('0x13'));var authService=require(_0xf241('0x14'));var qs=require(_0xf241('0x15'));var as=require(_0xf241('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf241('0x17'))(_0xf241('0x18'));var utils=require(_0xf241('0x19'));var config=require(_0xf241('0x1a'));var licenseUtil=require(_0xf241('0x1b'));var db=require(_0xf241('0x1c'))['db'];function respondWithStatusCode(_0x3dee4f,_0x39b014){_0x39b014=_0x39b014||0xcc;return function(_0x29bb22){if(_0x29bb22){return _0x3dee4f[_0xf241('0x1d')](_0x39b014);}return _0x3dee4f['status'](_0x39b014)['end']();};}function respondWithResult(_0x3b9ced,_0x171d13){_0x171d13=_0x171d13||0xc8;return function(_0x135569){if(_0x135569){return _0x3b9ced['status'](_0x171d13)[_0xf241('0x1e')](_0x135569);}};}function respondWithFilteredResult(_0x1e7a05,_0x4b1c93){return function(_0x224414){if(_0x224414){var _0x26d295=typeof _0x4b1c93[_0xf241('0x1f')]==='undefined'&&typeof _0x4b1c93[_0xf241('0x20')]==='undefined';var _0x12e82c=_0x224414[_0xf241('0x21')];var _0x4d6d8e=_0x26d295?0x0:_0x4b1c93[_0xf241('0x1f')];var _0x1a7a50=_0x26d295?_0x224414[_0xf241('0x21')]:_0x4b1c93[_0xf241('0x1f')]+_0x4b1c93['limit'];var _0x2a3b8f;if(_0x1a7a50>=_0x12e82c){_0x1a7a50=_0x12e82c;_0x2a3b8f=0xc8;}else{_0x2a3b8f=0xce;}_0x1e7a05[_0xf241('0x22')](_0x2a3b8f);return _0x1e7a05['set'](_0xf241('0x23'),_0x4d6d8e+'-'+_0x1a7a50+'/'+_0x12e82c)[_0xf241('0x1e')](_0x224414);}return null;};}function patchUpdates(_0x391574){return function(_0x599763){try{jsonpatch[_0xf241('0x24')](_0x599763,_0x391574,!![]);}catch(_0x438f38){return BPromise[_0xf241('0x25')](_0x438f38);}return _0x599763['save']();};}function saveUpdates(_0x76775d,_0xa92627){return function(_0x5c10e8){if(_0x5c10e8){return _0x5c10e8[_0xf241('0x26')](_0x76775d)[_0xf241('0x27')](function(_0x1c6424){return _0x1c6424;});}return null;};}function removeEntity(_0x20c9f8,_0x13f1b4){return function(_0x3ccc35){if(_0x3ccc35){return _0x3ccc35[_0xf241('0x28')]()['then'](function(){_0x20c9f8[_0xf241('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x40f3a2,_0x14318f){return function(_0x5de606){if(!_0x5de606){_0x40f3a2[_0xf241('0x1d')](0x194);}return _0x5de606;};}function handleError(_0x572564,_0x4cd4f5){_0x4cd4f5=_0x4cd4f5||0x1f4;return function(_0x2d6945){logger[_0xf241('0x29')](_0x2d6945[_0xf241('0x2a')]);if(_0x2d6945[_0xf241('0x2b')]){delete _0x2d6945[_0xf241('0x2b')];}_0x572564[_0xf241('0x22')](_0x4cd4f5)[_0xf241('0x2c')](_0x2d6945);};}exports[_0xf241('0x2d')]=function(_0x5e934e,_0x57c7d1){var _0x283388={},_0x420e68={},_0x243552={'count':0x0,'rows':[]};var _0x3c09ab=_[_0xf241('0x2e')](db['WhatsappTransferReport']['rawAttributes'],function(_0x5d0ab2){return{'name':_0x5d0ab2['fieldName'],'type':_0x5d0ab2['type'][_0xf241('0x2f')]};});_0x420e68[_0xf241('0x30')]=_[_0xf241('0x2e')](_0x3c09ab,_0xf241('0x2b'));_0x420e68[_0xf241('0x31')]=_[_0xf241('0x32')](_0x5e934e[_0xf241('0x31')]);_0x420e68[_0xf241('0x33')]=_[_0xf241('0x34')](_0x420e68[_0xf241('0x30')],_0x420e68[_0xf241('0x31')]);_0x283388[_0xf241('0x35')]=_[_0xf241('0x34')](_0x420e68[_0xf241('0x30')],qs[_0xf241('0x36')](_0x5e934e[_0xf241('0x31')]['fields']));_0x283388['attributes']=_0x283388[_0xf241('0x35')][_0xf241('0x37')]?_0x283388[_0xf241('0x35')]:_0x420e68[_0xf241('0x30')];if(!_0x5e934e[_0xf241('0x31')][_0xf241('0x38')](_0xf241('0x39'))){_0x283388[_0xf241('0x20')]=qs['limit'](_0x5e934e['query'][_0xf241('0x20')]);_0x283388['offset']=qs[_0xf241('0x1f')](_0x5e934e[_0xf241('0x31')][_0xf241('0x1f')]);}_0x283388[_0xf241('0x3a')]=qs['sort'](_0x5e934e[_0xf241('0x31')][_0xf241('0x3b')]);_0x283388[_0xf241('0x3c')]=qs['filters'](_[_0xf241('0x3d')](_0x5e934e['query'],_0x420e68[_0xf241('0x33')]),_0x3c09ab);if(_0x5e934e['query'][_0xf241('0x3e')]){_0x283388[_0xf241('0x3c')]=_['merge'](_0x283388[_0xf241('0x3c')],{'$or':_['map'](_0x3c09ab,function(_0x2c0e05){if(_0x2c0e05['type']!==_0xf241('0x3f')){var _0x3a9376={};_0x3a9376[_0x2c0e05[_0xf241('0x2b')]]={'$like':'%'+_0x5e934e['query']['filter']+'%'};return _0x3a9376;}})});}_0x283388=_[_0xf241('0x40')]({},_0x283388,_0x5e934e[_0xf241('0x41')]);var _0x2559ab={'where':_0x283388[_0xf241('0x3c')]};return db['WhatsappTransferReport'][_0xf241('0x21')](_0x2559ab)[_0xf241('0x27')](function(_0x3c68ac){_0x243552['count']=_0x3c68ac;if(_0x5e934e['query'][_0xf241('0x42')]){_0x283388[_0xf241('0x43')]=[{'all':!![]}];}return db[_0xf241('0x44')][_0xf241('0x45')](_0x283388);})[_0xf241('0x27')](function(_0x29b7cc){_0x243552[_0xf241('0x46')]=_0x29b7cc;return _0x243552;})[_0xf241('0x27')](respondWithFilteredResult(_0x57c7d1,_0x283388))[_0xf241('0x47')](handleError(_0x57c7d1,null));};exports['show']=function(_0x16ba9c,_0x1d74d2){var _0x2c5184={'raw':!![],'where':{'id':_0x16ba9c[_0xf241('0x48')]['id']}},_0x5ac369={};_0x5ac369['model']=_[_0xf241('0x32')](db[_0xf241('0x44')][_0xf241('0x49')]);_0x5ac369[_0xf241('0x31')]=_[_0xf241('0x32')](_0x16ba9c[_0xf241('0x31')]);_0x5ac369[_0xf241('0x33')]=_[_0xf241('0x34')](_0x5ac369['model'],_0x5ac369[_0xf241('0x31')]);_0x2c5184[_0xf241('0x35')]=_[_0xf241('0x34')](_0x5ac369['model'],qs[_0xf241('0x36')](_0x16ba9c[_0xf241('0x31')][_0xf241('0x36')]));_0x2c5184[_0xf241('0x35')]=_0x2c5184[_0xf241('0x35')][_0xf241('0x37')]?_0x2c5184[_0xf241('0x35')]:_0x5ac369[_0xf241('0x30')];if(_0x16ba9c[_0xf241('0x31')][_0xf241('0x42')]){_0x2c5184[_0xf241('0x43')]=[{'all':!![]}];}_0x2c5184=_[_0xf241('0x40')]({},_0x2c5184,_0x16ba9c[_0xf241('0x41')]);return db[_0xf241('0x44')][_0xf241('0x4a')](_0x2c5184)[_0xf241('0x27')](handleEntityNotFound(_0x1d74d2,null))[_0xf241('0x27')](respondWithResult(_0x1d74d2,null))[_0xf241('0x47')](handleError(_0x1d74d2,null));};exports['create']=function(_0x37b524,_0x4ce19f){return db[_0xf241('0x44')][_0xf241('0x4b')](_0x37b524['body'],{})[_0xf241('0x27')](respondWithResult(_0x4ce19f,0xc9))[_0xf241('0x47')](handleError(_0x4ce19f,null));};exports[_0xf241('0x26')]=function(_0x25d61f,_0x5dd37d){if(_0x25d61f['body']['id']){delete _0x25d61f['body']['id'];}return db[_0xf241('0x44')][_0xf241('0x4a')]({'where':{'id':_0x25d61f[_0xf241('0x48')]['id']}})[_0xf241('0x27')](handleEntityNotFound(_0x5dd37d,null))['then'](saveUpdates(_0x25d61f['body'],null))[_0xf241('0x27')](respondWithResult(_0x5dd37d,null))['catch'](handleError(_0x5dd37d,null));};exports['destroy']=function(_0x199eba,_0x137744){return db['WhatsappTransferReport']['find']({'where':{'id':_0x199eba[_0xf241('0x48')]['id']}})[_0xf241('0x27')](handleEntityNotFound(_0x137744,null))[_0xf241('0x27')](removeEntity(_0x137744,null))[_0xf241('0x47')](handleError(_0x137744,null));};exports[_0xf241('0x4c')]=function(_0x4d6bc4,_0x2895f6){return db[_0xf241('0x44')][_0xf241('0x4c')]()[_0xf241('0x27')](respondWithResult(_0x2895f6,null))[_0xf241('0x47')](handleError(_0x2895f6,null));}; \ No newline at end of file +var _0xcdc2=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save','destroy','then','name','send','index','rawAttributes','fieldName','type','key','model','keys','filters','intersection','attributes','fields','query','hasOwnProperty','order','sort','filter','where','merge','map','options','WhatsappTransferReport','includeAll','include','findAll','rows','catch','params','create','body','update','find','describe','eml-format'];(function(_0x172133,_0x10246b){var _0x2460e5=function(_0x3c4918){while(--_0x3c4918){_0x172133['push'](_0x172133['shift']());}};_0x2460e5(++_0x10246b);}(_0xcdc2,0x19d));var _0x2cdc=function(_0x1338d2,_0x226222){_0x1338d2=_0x1338d2-0x0;var _0x2df1c8=_0xcdc2[_0x1338d2];return _0x2df1c8;};'use strict';var emlformat=require(_0x2cdc('0x0'));var rimraf=require(_0x2cdc('0x1'));var zipdir=require(_0x2cdc('0x2'));var jsonpatch=require(_0x2cdc('0x3'));var rp=require(_0x2cdc('0x4'));var moment=require(_0x2cdc('0x5'));var BPromise=require(_0x2cdc('0x6'));var Mustache=require(_0x2cdc('0x7'));var util=require(_0x2cdc('0x8'));var path=require(_0x2cdc('0x9'));var sox=require(_0x2cdc('0xa'));var csv=require(_0x2cdc('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2cdc('0xc'));var squel=require('squel');var crypto=require(_0x2cdc('0xd'));var jsforce=require(_0x2cdc('0xe'));var deskjs=require(_0x2cdc('0xf'));var toCsv=require('to-csv');var querystring=require(_0x2cdc('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x2cdc('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2cdc('0x12'));var logger=require('../../config/logger')(_0x2cdc('0x13'));var utils=require(_0x2cdc('0x14'));var config=require(_0x2cdc('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4dd7d0,_0x53f515){_0x53f515=_0x53f515||0xcc;return function(_0x5951ca){if(_0x5951ca){return _0x4dd7d0[_0x2cdc('0x16')](_0x53f515);}return _0x4dd7d0[_0x2cdc('0x17')](_0x53f515)[_0x2cdc('0x18')]();};}function respondWithResult(_0x19c3d0,_0x4bf2f6){_0x4bf2f6=_0x4bf2f6||0xc8;return function(_0x4fb78b){if(_0x4fb78b){return _0x19c3d0[_0x2cdc('0x17')](_0x4bf2f6)[_0x2cdc('0x19')](_0x4fb78b);}};}function respondWithFilteredResult(_0x3cd5e0,_0x3715be){return function(_0x590fb4){if(_0x590fb4){var _0x570500=typeof _0x3715be[_0x2cdc('0x1a')]===_0x2cdc('0x1b')&&typeof _0x3715be[_0x2cdc('0x1c')]===_0x2cdc('0x1b');var _0x1d0633=_0x590fb4['count'];var _0x3a27bd=_0x570500?0x0:_0x3715be[_0x2cdc('0x1a')];var _0x4e3b93=_0x570500?_0x590fb4[_0x2cdc('0x1d')]:_0x3715be[_0x2cdc('0x1a')]+_0x3715be[_0x2cdc('0x1c')];var _0xa33fe6;if(_0x4e3b93>=_0x1d0633){_0x4e3b93=_0x1d0633;_0xa33fe6=0xc8;}else{_0xa33fe6=0xce;}_0x3cd5e0[_0x2cdc('0x17')](_0xa33fe6);return _0x3cd5e0[_0x2cdc('0x1e')]('Content-Range',_0x3a27bd+'-'+_0x4e3b93+'/'+_0x1d0633)['json'](_0x590fb4);}return null;};}function patchUpdates(_0x27bb5d){return function(_0x4f103c){try{jsonpatch['apply'](_0x4f103c,_0x27bb5d,!![]);}catch(_0x3ff658){return BPromise[_0x2cdc('0x1f')](_0x3ff658);}return _0x4f103c[_0x2cdc('0x20')]();};}function saveUpdates(_0x211eab,_0x3ce18a){return function(_0x22169c){if(_0x22169c){return _0x22169c['update'](_0x211eab)['then'](function(_0x19f1d6){return _0x19f1d6;});}return null;};}function removeEntity(_0x2ea200,_0x4bdb4d){return function(_0x202580){if(_0x202580){return _0x202580[_0x2cdc('0x21')]()[_0x2cdc('0x22')](function(){_0x2ea200[_0x2cdc('0x17')](0xcc)[_0x2cdc('0x18')]();});}};}function handleEntityNotFound(_0x480e57,_0x476c36){return function(_0x119936){if(!_0x119936){_0x480e57[_0x2cdc('0x16')](0x194);}return _0x119936;};}function handleError(_0x1afec9,_0x39203e){_0x39203e=_0x39203e||0x1f4;return function(_0x5468da){logger['error'](_0x5468da['stack']);if(_0x5468da[_0x2cdc('0x23')]){delete _0x5468da[_0x2cdc('0x23')];}_0x1afec9[_0x2cdc('0x17')](_0x39203e)[_0x2cdc('0x24')](_0x5468da);};}exports[_0x2cdc('0x25')]=function(_0x2433f5,_0x17316d){var _0x48224c={},_0x154761={},_0x564194={'count':0x0,'rows':[]};var _0x2acdd2=_['map'](db['WhatsappTransferReport'][_0x2cdc('0x26')],function(_0x2a58b0){return{'name':_0x2a58b0[_0x2cdc('0x27')],'type':_0x2a58b0[_0x2cdc('0x28')][_0x2cdc('0x29')]};});_0x154761[_0x2cdc('0x2a')]=_['map'](_0x2acdd2,_0x2cdc('0x23'));_0x154761['query']=_[_0x2cdc('0x2b')](_0x2433f5['query']);_0x154761[_0x2cdc('0x2c')]=_[_0x2cdc('0x2d')](_0x154761[_0x2cdc('0x2a')],_0x154761['query']);_0x48224c[_0x2cdc('0x2e')]=_[_0x2cdc('0x2d')](_0x154761['model'],qs['fields'](_0x2433f5['query'][_0x2cdc('0x2f')]));_0x48224c[_0x2cdc('0x2e')]=_0x48224c[_0x2cdc('0x2e')]['length']?_0x48224c[_0x2cdc('0x2e')]:_0x154761['model'];if(!_0x2433f5[_0x2cdc('0x30')][_0x2cdc('0x31')]('nolimit')){_0x48224c[_0x2cdc('0x1c')]=qs[_0x2cdc('0x1c')](_0x2433f5[_0x2cdc('0x30')]['limit']);_0x48224c[_0x2cdc('0x1a')]=qs['offset'](_0x2433f5[_0x2cdc('0x30')][_0x2cdc('0x1a')]);}_0x48224c[_0x2cdc('0x32')]=qs[_0x2cdc('0x33')](_0x2433f5['query'][_0x2cdc('0x33')]);_0x48224c['where']=qs[_0x2cdc('0x2c')](_['pick'](_0x2433f5['query'],_0x154761[_0x2cdc('0x2c')]),_0x2acdd2);if(_0x2433f5[_0x2cdc('0x30')][_0x2cdc('0x34')]){_0x48224c[_0x2cdc('0x35')]=_[_0x2cdc('0x36')](_0x48224c[_0x2cdc('0x35')],{'$or':_[_0x2cdc('0x37')](_0x2acdd2,function(_0x48e31e){if(_0x48e31e[_0x2cdc('0x28')]!=='VIRTUAL'){var _0x206c7e={};_0x206c7e[_0x48e31e[_0x2cdc('0x23')]]={'$like':'%'+_0x2433f5['query'][_0x2cdc('0x34')]+'%'};return _0x206c7e;}})});}_0x48224c=_[_0x2cdc('0x36')]({},_0x48224c,_0x2433f5[_0x2cdc('0x38')]);var _0x3356f7={'where':_0x48224c[_0x2cdc('0x35')]};return db[_0x2cdc('0x39')]['count'](_0x3356f7)['then'](function(_0x1d1f61){_0x564194['count']=_0x1d1f61;if(_0x2433f5[_0x2cdc('0x30')][_0x2cdc('0x3a')]){_0x48224c[_0x2cdc('0x3b')]=[{'all':!![]}];}return db[_0x2cdc('0x39')][_0x2cdc('0x3c')](_0x48224c);})[_0x2cdc('0x22')](function(_0x2b91a1){_0x564194[_0x2cdc('0x3d')]=_0x2b91a1;return _0x564194;})['then'](respondWithFilteredResult(_0x17316d,_0x48224c))[_0x2cdc('0x3e')](handleError(_0x17316d,null));};exports['show']=function(_0x3ab43b,_0x412217){var _0x4fdfe6={'raw':!![],'where':{'id':_0x3ab43b[_0x2cdc('0x3f')]['id']}},_0x50dc1b={};_0x50dc1b['model']=_[_0x2cdc('0x2b')](db['WhatsappTransferReport'][_0x2cdc('0x26')]);_0x50dc1b[_0x2cdc('0x30')]=_[_0x2cdc('0x2b')](_0x3ab43b['query']);_0x50dc1b[_0x2cdc('0x2c')]=_['intersection'](_0x50dc1b[_0x2cdc('0x2a')],_0x50dc1b['query']);_0x4fdfe6[_0x2cdc('0x2e')]=_[_0x2cdc('0x2d')](_0x50dc1b[_0x2cdc('0x2a')],qs[_0x2cdc('0x2f')](_0x3ab43b['query'][_0x2cdc('0x2f')]));_0x4fdfe6['attributes']=_0x4fdfe6[_0x2cdc('0x2e')]['length']?_0x4fdfe6[_0x2cdc('0x2e')]:_0x50dc1b[_0x2cdc('0x2a')];if(_0x3ab43b[_0x2cdc('0x30')][_0x2cdc('0x3a')]){_0x4fdfe6[_0x2cdc('0x3b')]=[{'all':!![]}];}_0x4fdfe6=_['merge']({},_0x4fdfe6,_0x3ab43b[_0x2cdc('0x38')]);return db[_0x2cdc('0x39')]['find'](_0x4fdfe6)[_0x2cdc('0x22')](handleEntityNotFound(_0x412217,null))['then'](respondWithResult(_0x412217,null))[_0x2cdc('0x3e')](handleError(_0x412217,null));};exports[_0x2cdc('0x40')]=function(_0x2136bc,_0x5ea543){return db[_0x2cdc('0x39')][_0x2cdc('0x40')](_0x2136bc[_0x2cdc('0x41')],{})[_0x2cdc('0x22')](respondWithResult(_0x5ea543,0xc9))[_0x2cdc('0x3e')](handleError(_0x5ea543,null));};exports[_0x2cdc('0x42')]=function(_0x37e1ea,_0x89bf5f){if(_0x37e1ea[_0x2cdc('0x41')]['id']){delete _0x37e1ea[_0x2cdc('0x41')]['id'];}return db['WhatsappTransferReport'][_0x2cdc('0x43')]({'where':{'id':_0x37e1ea[_0x2cdc('0x3f')]['id']}})[_0x2cdc('0x22')](handleEntityNotFound(_0x89bf5f,null))[_0x2cdc('0x22')](saveUpdates(_0x37e1ea[_0x2cdc('0x41')],null))['then'](respondWithResult(_0x89bf5f,null))[_0x2cdc('0x3e')](handleError(_0x89bf5f,null));};exports[_0x2cdc('0x21')]=function(_0x582487,_0x50174f){return db['WhatsappTransferReport'][_0x2cdc('0x43')]({'where':{'id':_0x582487[_0x2cdc('0x3f')]['id']}})[_0x2cdc('0x22')](handleEntityNotFound(_0x50174f,null))['then'](removeEntity(_0x50174f,null))[_0x2cdc('0x3e')](handleError(_0x50174f,null));};exports[_0x2cdc('0x44')]=function(_0x3bce10,_0x432e00){return db[_0x2cdc('0x39')][_0x2cdc('0x44')]()[_0x2cdc('0x22')](respondWithResult(_0x432e00,null))[_0x2cdc('0x3e')](handleError(_0x432e00,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index e3581d9..da9ba01 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 _0x443a=['../../config/logger','moment','path','../../config/environment','./whatsappTransferReport.attributes','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash','util'];(function(_0x55b6fb,_0x888180){var _0xfa142c=function(_0x44c6a6){while(--_0x44c6a6){_0x55b6fb['push'](_0x55b6fb['shift']());}};_0xfa142c(++_0x888180);}(_0x443a,0x12a));var _0xa443=function(_0x3b3c4d,_0x378062){_0x3b3c4d=_0x3b3c4d-0x0;var _0xc4b72c=_0x443a[_0x3b3c4d];return _0xc4b72c;};'use strict';var _=require(_0xa443('0x0'));var util=require(_0xa443('0x1'));var logger=require(_0xa443('0x2'))('api');var moment=require(_0xa443('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa443('0x4'));var rimraf=require('rimraf');var config=require(_0xa443('0x5'));var attributes=require(_0xa443('0x6'));module['exports']=function(_0xd57bab,_0x4ea5d0){return _0xd57bab['define'](_0xa443('0x7'),attributes,{'tableName':_0xa443('0x8'),'paranoid':![],'indexes':[{'name':_0xa443('0x9'),'fields':[_0xa443('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1074=['exports','define','WhatsappTransferReport','lodash','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./whatsappTransferReport.attributes'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x1074,0x16e));var _0x4107=function(_0x20038e,_0x4b6981){_0x20038e=_0x20038e-0x0;var _0x425e2e=_0x1074[_0x20038e];return _0x425e2e;};'use strict';var _=require(_0x4107('0x0'));var util=require('util');var logger=require(_0x4107('0x1'))(_0x4107('0x2'));var moment=require(_0x4107('0x3'));var BPromise=require(_0x4107('0x4'));var rp=require(_0x4107('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x4107('0x6'));var attributes=require(_0x4107('0x7'));module[_0x4107('0x8')]=function(_0xe7ab2b,_0x5a937e){return _0xe7ab2b[_0x4107('0x9')](_0x4107('0xa'),attributes,{'tableName':'report_whatsapp_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index c1e3ea4..76b47bb 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 _0x0d87=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','moment','ioredis'];(function(_0xb113d7,_0x2fc306){var _0xd5a08d=function(_0x873634){while(--_0x873634){_0xb113d7['push'](_0xb113d7['shift']());}};_0xd5a08d(++_0x2fc306);}(_0x0d87,0x83));var _0x70d8=function(_0x1ee108,_0x4c67b3){_0x1ee108=_0x1ee108-0x0;var _0x215410=_0x0d87[_0x1ee108];return _0x215410;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x70d8('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x70d8('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0x70d8('0x2'));var logger=require(_0x70d8('0x3'))('rpc');var config=require(_0x70d8('0x4'));var jayson=require(_0x70d8('0x5'));var client=jayson[_0x70d8('0x6')][_0x70d8('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5702d7,_0x168664,_0x52f23d){return new BPromise(function(_0x3965e3,_0x32524a){return client[_0x70d8('0x8')](_0x5702d7,_0x52f23d)[_0x70d8('0x9')](function(_0x21b891){logger[_0x70d8('0xa')](_0x70d8('0xb'),_0x168664,_0x70d8('0xc'));logger[_0x70d8('0xd')]('WhatsappTransferReport,\x20%s,\x20%s,\x20%s',_0x168664,_0x70d8('0xc'),JSON[_0x70d8('0xe')](_0x21b891));if(_0x21b891['error']){if(_0x21b891[_0x70d8('0xf')][_0x70d8('0x10')]===0x1f4){logger[_0x70d8('0xf')](_0x70d8('0xb'),_0x168664,_0x21b891[_0x70d8('0xf')][_0x70d8('0x11')]);return _0x32524a(_0x21b891[_0x70d8('0xf')][_0x70d8('0x11')]);}logger[_0x70d8('0xf')]('WhatsappTransferReport,\x20%s,\x20%s',_0x168664,_0x21b891[_0x70d8('0xf')]['message']);return _0x3965e3(_0x21b891[_0x70d8('0xf')][_0x70d8('0x11')]);}else{logger[_0x70d8('0xa')](_0x70d8('0xb'),_0x168664,_0x70d8('0xc'));_0x3965e3(_0x21b891[_0x70d8('0x12')][_0x70d8('0x11')]);}})['catch'](function(_0x114220){logger[_0x70d8('0xf')](_0x70d8('0xb'),_0x168664,_0x114220);_0x32524a(_0x114220);});});} \ No newline at end of file +var _0x39ef=['jayson/promise','client','http','request','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x217a3d,_0x49a7b9){var _0x39cf2a=function(_0x46865b){while(--_0x46865b){_0x217a3d['push'](_0x217a3d['shift']());}};_0x39cf2a(++_0x49a7b9);}(_0x39ef,0x1dc));var _0xf39e=function(_0x1ee477,_0xe2f0a2){_0x1ee477=_0x1ee477-0x0;var _0x33ce18=_0x39ef[_0x1ee477];return _0x33ce18;};'use strict';var _=require(_0xf39e('0x0'));var util=require('util');var moment=require(_0xf39e('0x1'));var BPromise=require('bluebird');var rs=require(_0xf39e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf39e('0x3'))['db'];var utils=require(_0xf39e('0x4'));var logger=require(_0xf39e('0x5'))(_0xf39e('0x6'));var config=require('../../config/environment');var jayson=require(_0xf39e('0x7'));var client=jayson[_0xf39e('0x8')][_0xf39e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2eda56,_0x3a4f60,_0x13afa7){return new BPromise(function(_0x32b0f3,_0x2efd97){return client[_0xf39e('0xa')](_0x2eda56,_0x13afa7)['then'](function(_0x120397){logger[_0xf39e('0xb')](_0xf39e('0xc'),_0x3a4f60,_0xf39e('0xd'));logger[_0xf39e('0xe')](_0xf39e('0xf'),_0x3a4f60,_0xf39e('0xd'),JSON[_0xf39e('0x10')](_0x120397));if(_0x120397[_0xf39e('0x11')]){if(_0x120397[_0xf39e('0x11')][_0xf39e('0x12')]===0x1f4){logger[_0xf39e('0x11')](_0xf39e('0xc'),_0x3a4f60,_0x120397[_0xf39e('0x11')]['message']);return _0x2efd97(_0x120397[_0xf39e('0x11')][_0xf39e('0x13')]);}logger['error'](_0xf39e('0xc'),_0x3a4f60,_0x120397[_0xf39e('0x11')][_0xf39e('0x13')]);return _0x32b0f3(_0x120397[_0xf39e('0x11')][_0xf39e('0x13')]);}else{logger[_0xf39e('0xb')](_0xf39e('0xc'),_0x3a4f60,'request\x20sent');_0x32b0f3(_0x120397[_0xf39e('0x14')][_0xf39e('0x13')]);}})['catch'](function(_0x4d72fa){logger['error'](_0xf39e('0xc'),_0x3a4f60,_0x4d72fa);_0x2efd97(_0x4d72fa);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index cded953..3c27eca 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2194=['./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','sequelize','sync','then','listen','info','start','map','filter','name','join','Offline\x20apps:','status','None','./config/seedDB','default','./config/license','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','lodash','./mysqldb','./rpc','./config/environment','app','./config/pm2','./config/pm2/config'];(function(_0x303a9a,_0x5e7791){var _0x35abbe=function(_0x1e342b){while(--_0x1e342b){_0x303a9a['push'](_0x303a9a['shift']());}};_0x35abbe(++_0x5e7791);}(_0x2194,0x138));var _0x4219=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0x2194[_0x387777];return _0x3f84c0;};'use strict';var _=require(_0x4219('0x0'));var mysqldb=require(_0x4219('0x1'));var rpc=require(_0x4219('0x2'));var config=require(_0x4219('0x3'));var logger=require('./config/logger')(_0x4219('0x4'));var pm2=require(_0x4219('0x5'));var pm2Config=require(_0x4219('0x6'));var schedule=require(_0x4219('0x7'));var chat=require(_0x4219('0x8'));var whatsapp=require(_0x4219('0x9'));var transcribe=require(_0x4219('0xa'));function main(){return mysqldb['db'][_0x4219('0xb')][_0x4219('0xc')]()[_0x4219('0xd')](function(){return rpc[_0x4219('0xe')]();})[_0x4219('0xd')](function(_0xe96403){logger[_0x4219('0xf')](_0xe96403);return chat[_0x4219('0x10')]();})['then'](function(){return whatsapp[_0x4219('0x10')]();})[_0x4219('0xd')](function(){return schedule['start']();})['then'](function(){return transcribe[_0x4219('0x10')]();})['then'](function(_0x45ac52){logger['info'](_0x45ac52);return pm2[_0x4219('0x10')](pm2Config);})[_0x4219('0xd')](function(_0x3c9107){logger['info']('Online\x20apps:',_[_0x4219('0x11')](_[_0x4219('0x12')](_0x3c9107,{'status':'online'}),_0x4219('0x13'))[_0x4219('0x14')]());logger[_0x4219('0xf')](_0x4219('0x15'),_[_0x4219('0x11')](_[_0x4219('0x12')](_0x3c9107,function(_0x165bd7){return _0x165bd7[_0x4219('0x16')]!=='online';}),'name')[_0x4219('0x14')]()||_0x4219('0x17'));config['seedDB']&&require(_0x4219('0x18'))[_0x4219('0x19')]();require(_0x4219('0x1a'))['default']();})['catch'](function(_0x2096a3){logger[_0x4219('0x1b')](_0x4219('0x1c'),_0x2096a3);process['exit'](0x1);});}main(); \ No newline at end of file +var _0x1457=['start','Online\x20apps:','filter','online','name','join','Offline\x20apps:','map','status','seedDB','./config/seedDB','default','./config/license','catch','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./rpc','./config/environment','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','sequelize','sync','then','info'];(function(_0x2ff762,_0x342c0b){var _0x158b02=function(_0x13c38e){while(--_0x13c38e){_0x2ff762['push'](_0x2ff762['shift']());}};_0x158b02(++_0x342c0b);}(_0x1457,0x1b1));var _0x7145=function(_0x3da832,_0x2133f1){_0x3da832=_0x3da832-0x0;var _0xe602f2=_0x1457[_0x3da832];return _0xe602f2;};'use strict';var _=require(_0x7145('0x0'));var mysqldb=require(_0x7145('0x1'));var rpc=require(_0x7145('0x2'));var config=require(_0x7145('0x3'));var logger=require(_0x7145('0x4'))(_0x7145('0x5'));var pm2=require(_0x7145('0x6'));var pm2Config=require(_0x7145('0x7'));var schedule=require('./config/schedule');var chat=require(_0x7145('0x8'));var whatsapp=require(_0x7145('0x9'));var transcribe=require(_0x7145('0xa'));function main(){return mysqldb['db'][_0x7145('0xb')][_0x7145('0xc')]()[_0x7145('0xd')](function(){return rpc['listen']();})[_0x7145('0xd')](function(_0x4f1cef){logger[_0x7145('0xe')](_0x4f1cef);return chat['start']();})[_0x7145('0xd')](function(){return whatsapp[_0x7145('0xf')]();})['then'](function(){return schedule[_0x7145('0xf')]();})[_0x7145('0xd')](function(){return transcribe['start']();})['then'](function(_0x74c76f){logger[_0x7145('0xe')](_0x74c76f);return pm2[_0x7145('0xf')](pm2Config);})[_0x7145('0xd')](function(_0x5a0d02){logger[_0x7145('0xe')](_0x7145('0x10'),_['map'](_[_0x7145('0x11')](_0x5a0d02,{'status':_0x7145('0x12')}),_0x7145('0x13'))[_0x7145('0x14')]());logger[_0x7145('0xe')](_0x7145('0x15'),_[_0x7145('0x16')](_[_0x7145('0x11')](_0x5a0d02,function(_0x30e586){return _0x30e586[_0x7145('0x17')]!==_0x7145('0x12');}),_0x7145('0x13'))[_0x7145('0x14')]()||'None');config[_0x7145('0x18')]&&require(_0x7145('0x19'))[_0x7145('0x1a')]();require(_0x7145('0x1b'))[_0x7145('0x1a')]();})[_0x7145('0x1c')](function(_0x3bfed0){logger[_0x7145('0x1d')](_0x7145('0x1e'),_0x3bfed0);process[_0x7145('0x1f')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index 846f286..4e075e2 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 _0xc47f=['allowmessenger','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControlPort','hotdesk','interface','userProfileId','wssPort','downloadAttachments','isChatInteractionAuthorized','isAuthenticated','use','user','ChatInteraction','findOne','params','then','closed','status','disposition','json','unmanaged','Unmanaged.','Forbidden.','catch','authorization','headers','Basic','User','find','name','pass','Bearer','Unknown\x20authorization\x20format','query','apikey','getUuid','Setting','allowedLoginAttempts','blockDuration','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blocked','blockedAt','add','minutes','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','update','Forbidden','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','role','cookie','motion.token','redirect','retrieveApiKey','generateApiKey','apiKeyIat','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','decryptString','split','toLowerCase','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','splice','encryptString','join','promisify','sign','secret','secrets','options','verify','randomBytes','toString','hex','floor','now','HS512','../../mysqldb','../../config/environment','../../config/license/hardware','../../config/license/util','../encryptor','lodash','jsonwebtoken','composable-middleware','basic-auth','crypto','bluebird','util','session','fullname','internal','permissions','md5secret','voicePause','faxPause','showWebBar','lastLoginAt','crudPermissions'];(function(_0x230c33,_0xdfcf9){var _0x19acae=function(_0xf4fdf1){while(--_0xf4fdf1){_0x230c33['push'](_0x230c33['shift']());}};_0x19acae(++_0xdfcf9);}(_0xc47f,0x1d6));var _0xfc47=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0xc47f[_0xa148b7];return _0x51efd3;};'use strict';var db=require(_0xfc47('0x0'))['db'];var config=require(_0xfc47('0x1'));var hardwareConf=require(_0xfc47('0x2'));var licenseUtil=require(_0xfc47('0x3'));var encryptor=require(_0xfc47('0x4'));var _=require(_0xfc47('0x5'));var jwt=require(_0xfc47('0x6'));var expressJwt=require('express-jwt');var compose=require(_0xfc47('0x7'));var basicAuth=require(_0xfc47('0x8'));var crypto=require(_0xfc47('0x9'));var BPromise=require(_0xfc47('0xa'));var util=require(_0xfc47('0xb'));var moment=require('moment');var validateJwt=expressJwt({'secret':config['secrets'][_0xfc47('0xc')]});var userAttributes=['id','role',_0xfc47('0xd'),'name',_0xfc47('0xe'),'email','userpic',_0xfc47('0xf'),_0xfc47('0x10'),_0xfc47('0x11'),'chatPause','mailPause',_0xfc47('0x12'),'smsPause','openchannelPause','pauseType',_0xfc47('0x13'),_0xfc47('0x14'),'lastPauseAt',_0xfc47('0x15'),_0xfc47('0x16'),_0xfc47('0x17'),_0xfc47('0x18'),_0xfc47('0x19'),_0xfc47('0x1a'),_0xfc47('0x1b'),_0xfc47('0x1c'),_0xfc47('0x1d'),_0xfc47('0x1e'),_0xfc47('0x1f'),_0xfc47('0x20'),'phoneBarRemoteControl',_0xfc47('0x21'),_0xfc47('0x22'),_0xfc47('0x23'),_0xfc47('0x24'),'privacyEnabled','settingsEnabled',_0xfc47('0x25'),'downloadVoiceRecordings','downloadOmnichannelInteractions',_0xfc47('0x26')];exports[_0xfc47('0x27')]=function(){return this[_0xfc47('0x28')](!![])[_0xfc47('0x29')](function(_0x5ab61b,_0x18d63e,_0x2c9ba5){if(_0x5ab61b[_0xfc47('0x2a')]){_0x2c9ba5();}else{return db[_0xfc47('0x2b')][_0xfc47('0x2c')]({'where':{'id':_0x5ab61b[_0xfc47('0x2d')]['id']},'attributes':['id','closed','disposition'],'raw':!![]})[_0xfc47('0x2e')](function(_0x2a693d){if(_0x2a693d&&_0x2a693d[_0xfc47('0x2f')]){return _0x18d63e[_0xfc47('0x30')](_0x2a693d[_0xfc47('0x31')]==='unmanaged'?0x195:0x193)[_0xfc47('0x32')]({'message':_0x2a693d[_0xfc47('0x31')]===_0xfc47('0x33')?_0xfc47('0x34'):_0xfc47('0x35')});}else{_0x2c9ba5();}})[_0xfc47('0x36')](function(_0xc7ea72){_0x2c9ba5(_0xc7ea72);});}});};exports[_0xfc47('0x28')]=function isAuthenticated(_0xd6e1af){return compose()[_0xfc47('0x29')](function(_0x58455e,_0x4c91fc,_0x2ad7c3){var _0x5e3342;if(_0x58455e['headers'][_0xfc47('0x37')]){if(_['startsWith'](_0x58455e[_0xfc47('0x38')][_0xfc47('0x37')],_0xfc47('0x39'))){var _0x27f5de=basicAuth(_0x58455e);db[_0xfc47('0x3a')][_0xfc47('0x3b')]({'where':{'name':_0x27f5de[_0xfc47('0x3c')]}})['then'](function(_0x451fba){if(!_0x451fba||!_0x451fba['authenticate'](_0x27f5de[_0xfc47('0x3d')])){return _0x4c91fc[_0xfc47('0x30')](0x191)[_0xfc47('0x32')]({'message':'Wrong\x20credentials.'});}_0x58455e[_0xfc47('0x2a')]={'id':_0x451fba['id']};_0x2ad7c3();})[_0xfc47('0x36')](function(_0x3583bc){_0x2ad7c3(_0x3583bc);});}else if(_['startsWith'](_0x58455e['headers']['authorization'],_0xfc47('0x3e'))){validateJwt(_0x58455e,_0x4c91fc,_0x2ad7c3);}else{if(_0xd6e1af){_0x2ad7c3();}else{return _0x4c91fc[_0xfc47('0x30')](0x193)[_0xfc47('0x32')]({'message':_0xfc47('0x3f')});}}}else if(_0x58455e[_0xfc47('0x40')][_0xfc47('0x41')]){try{var _0x2b521b={'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0xfc47('0x42')]()};verifyJwt(_0x58455e[_0xfc47('0x40')]['apikey'],_0x2b521b)[_0xfc47('0x2e')](function(_0x140f48){return db['User'][_0xfc47('0x3b')]({'where':{'id':_0x140f48['sub']}})[_0xfc47('0x2e')](function(_0x6089dd){_0x5e3342=_0x6089dd;return db[_0xfc47('0x43')][_0xfc47('0x2c')]({'where':{'id':0x1},'attributes':[_0xfc47('0x44'),_0xfc47('0x45')],'raw':!![]});})[_0xfc47('0x2e')](function(_0x345771){if(!_0x5e3342||!_[_0xfc47('0x46')](_0x5e3342[_0xfc47('0x47')],_0x140f48[_0xfc47('0x48')])){return _0x4c91fc[_0xfc47('0x30')](0x191)['json']({'message':_0xfc47('0x49')});}if(_0x5e3342[_0xfc47('0x4a')]){return _0x4c91fc[_0xfc47('0x30')](0x191)[_0xfc47('0x32')]({'message':_0xfc47('0x4b')});}if(_0x5e3342[_0xfc47('0x4c')]){if(_0x345771[_0xfc47('0x45')]>0x0){if(moment(_0x5e3342[_0xfc47('0x4d')])[_0xfc47('0x4e')](_0x345771['blockDuration'],_0xfc47('0x4f'))>moment()){return _0x4c91fc[_0xfc47('0x30')](0x191)[_0xfc47('0x32')]({'message':_0xfc47('0x4b')});}}else{return _0x4c91fc[_0xfc47('0x30')](0x191)[_0xfc47('0x32')]({'message':_0xfc47('0x4b')});}}_0x58455e[_0xfc47('0x2a')]={'id':_0x5e3342['id']};_0x2ad7c3();});})[_0xfc47('0x36')](function(){return _0x4c91fc[_0xfc47('0x30')](0x191)[_0xfc47('0x32')]({'message':_0xfc47('0x4b')});});}catch(_0x44fd46){_0x2ad7c3(_0x44fd46);}}else if(_0xd6e1af){_0x2ad7c3();}else{return _0x4c91fc[_0xfc47('0x30')](0x193)['json']({'message':_0xfc47('0x3f')});}})[_0xfc47('0x29')](function(_0x342161,_0xa740e,_0x5b4fb9){if(_0x342161[_0xfc47('0x2a')]){db[_0xfc47('0x3a')]['find']({'where':{'id':_0x342161[_0xfc47('0x2a')]['id']},'attributes':userAttributes})[_0xfc47('0x2e')](function(_0x3cb10d){if(!_0x3cb10d){return _0xa740e[_0xfc47('0x30')](0x194)[_0xfc47('0x32')]({'message':_0xfc47('0x50')});}_0x342161[_0xfc47('0x2a')]=_0x3cb10d;_0x5b4fb9();})[_0xfc47('0x36')](function(_0x5d3d43){_0x5b4fb9(_0x5d3d43);});}else if(_0xd6e1af){_0x5b4fb9();}else{return _0xa740e[_0xfc47('0x30')](0x194)[_0xfc47('0x32')]({'message':_0xfc47('0x51')});}});};exports[_0xfc47('0x52')]=function canUpdate(){return compose()['use'](function(_0x5032a0,_0x1fdcf0,_0x25ca98){return licenseUtil['getLicense']()['then'](function(_0x4b516b){if(_0x4b516b[_0xfc47('0x53')]){_0x25ca98();}else{return _0x1fdcf0['status'](0x193)[_0xfc47('0x32')]({'message':_0xfc47('0x54')});}})[_0xfc47('0x36')](function(_0x580300){_0x25ca98(_0x580300);});});};exports[_0xfc47('0x55')]=function(_0x1a4afd,_0xc54ba6,_0x474a87){_0x1a4afd[_0xfc47('0x55')]=!![];return _0x474a87();};exports[_0xfc47('0x56')]=function signToken(_0x546c01){return signJwt(_0x546c01);};exports[_0xfc47('0x57')]=function(_0x22a1f0,_0x5171dd){if(!_0x22a1f0[_0xfc47('0x2a')]){return _0x5171dd[_0xfc47('0x30')](0x194)[_0xfc47('0x32')]({'message':_0xfc47('0x58')});}var _0xd544e6={'payload':{'id':_0x22a1f0['user']['id'],'role':_0x22a1f0[_0xfc47('0x2a')][_0xfc47('0x59')]},'options':{'expiresIn':0x15180}};return signJwt(_0xd544e6)[_0xfc47('0x2e')](function(_0x584575){_0x5171dd[_0xfc47('0x5a')](_0xfc47('0x5b'),_0x584575);_0x5171dd[_0xfc47('0x5c')]('/dashboards/general');})[_0xfc47('0x36')](function(_0x5c1bb9){return _0x5171dd[_0xfc47('0x30')](0x1f4)['send'](_0x5c1bb9);});};exports[_0xfc47('0x5d')]=function(_0x12497f){if(_['isNil'](_0x12497f[_0xfc47('0x47')])||_['isNil'](_0x12497f['apiKeyIat'])){return null;}else{return createJwt(_0x12497f);}};exports[_0xfc47('0x5e')]=function(_0x209d4d){_0x209d4d[_0xfc47('0x47')]=generateNonce();_0x209d4d[_0xfc47('0x5f')]=generateIssuedAt();return createJwt(_0x209d4d);};exports[_0xfc47('0x60')]=function(_0x5d6455,_0x306e23){var _0x571c4a=_0x5d6455[_0xfc47('0x40')]['apikey'];if(_0x571c4a){var _0x55a01={'nonce':_0x306e23['apiKeyNonce'],'iat':_0x306e23[_0xfc47('0x5f')],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0xfc47('0x42')]()};return verifyJwt(_0x571c4a,_0x55a01)[_0xfc47('0x2e')](function(){return generateApiKey(_0x306e23);});}else{throw{'message':_0xfc47('0x61')};}};exports[_0xfc47('0x62')]=function(_0x2bcfb0){var _0x26831c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x26831c[_0xfc47('0x63')](_0x2bcfb0))throw new db[(_0xfc47('0x64'))][(_0xfc47('0x65'))](_0xfc47('0x66'));return;};exports['validatePasswordHistory']=function(_0x9bcd0c,_0x1ef6ff,_0x51f082){var _0x42f032=encryptor[_0xfc47('0x67')](_0x1ef6ff)[_0xfc47('0x68')](',');for(var _0x499131=0x0;_0x499131<_0x51f082;_0x499131++){if(!_0x42f032[_0x499131])break;if(_0x9bcd0c[_0xfc47('0x69')]()===_0x42f032[_0x499131][_0xfc47('0x69')]()){var _0x3f2064=util['format']('The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.',_0x51f082);if(_0x51f082===0x1){_0x3f2064=_0xfc47('0x6a');}throw new db[(_0xfc47('0x64'))]['ValidationError'](_0x3f2064);}}return;};exports[_0xfc47('0x6b')]=function(_0x3329e8,_0x44fcd2){var _0x11549d=_0x44fcd2?encryptor[_0xfc47('0x67')](_0x44fcd2)[_0xfc47('0x68')](','):[];if(_0x11549d['length']===0x5){_0x11549d[_0xfc47('0x6c')](-0x1,0x1);}_0x11549d['unshift'](_0x3329e8);return encryptor[_0xfc47('0x6d')](_0x11549d[_0xfc47('0x6e')](','));};function signJwt(_0x18380a){var _0x4d3939=BPromise[_0xfc47('0x6f')](jwt[_0xfc47('0x70')],{'context':jwt});var _0x3a28e3=_0x18380a[_0xfc47('0x71')]||config[_0xfc47('0x72')][_0xfc47('0xc')];return new BPromise(function(_0x2ec265,_0x5741c9){_0x4d3939(_0x18380a['payload'],_0x3a28e3,_0x18380a[_0xfc47('0x73')])[_0xfc47('0x2e')](function(_0x2a84a5){_0x2ec265(_0x2a84a5);})['catch'](function(_0x52e531){_0x5741c9(_0x52e531);});});}function verifyJwt(_0x1f3cea,_0x3d5a97,_0x50ede4){var _0x54de7f=BPromise[_0xfc47('0x6f')](jwt[_0xfc47('0x74')],{'context':jwt});var _0x1afba6=_0x50ede4||config['secrets'][_0xfc47('0xc')];return new BPromise(function(_0x5e1dc6,_0xe89edb){_0x54de7f(_0x1f3cea,_0x1afba6,_0x3d5a97)[_0xfc47('0x2e')](function(_0x218f52){_0x5e1dc6(_0x218f52);})[_0xfc47('0x36')](function(_0x5d5817){_0xe89edb(_0x5d5817);});});}function generateNonce(){return crypto[_0xfc47('0x75')](0x10)[_0xfc47('0x76')](_0xfc47('0x77'));}function generateIssuedAt(){return Math[_0xfc47('0x78')](Date[_0xfc47('0x79')]()/0x3e8)['toString']();}function createJwt(_0x4dd522){var _0x43ae89={'payload':{'iat':_0x4dd522[_0xfc47('0x5f')],'nonce':_0x4dd522[_0xfc47('0x47')]},'options':{'algorithm':_0xfc47('0x7a'),'subject':_0x4dd522['id'][_0xfc47('0x76')](),'issuer':hardwareConf['getUuid'](),'audience':hardwareConf['getUuid']()}};return signJwt(_0x43ae89)[_0xfc47('0x2e')](function(_0x346b49){return{'iat':_0x4dd522[_0xfc47('0x5f')],'nonce':_0x4dd522[_0xfc47('0x47')],'token':_0x346b49};});} \ No newline at end of file +var _0x6c9b=['Invalid\x20API\x20access\x20key','Unknown\x20authorization\x20format','find','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','/dashboards/general','send','isNil','apiKeyIat','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','decryptString','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','ValidationError','split','length','splice','unshift','encryptString','join','promisify','sign','secret','payload','verify','randomBytes','toString','now','HS512','../../mysqldb','../../config/environment','../../config/license/hardware','../../config/license/util','../encryptor','express-jwt','crypto','bluebird','util','moment','secrets','session','role','internal','email','permissions','md5secret','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','allowmessenger','passwordResetAt','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableSettings','phoneBarExpires','phoneBarRemoteControl','phoneBarRemoteControlPort','interface','privacyEnabled','settingsEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','isChatInteractionAuthorized','isAuthenticated','use','user','ChatInteraction','findOne','params','closed','disposition','unmanaged','json','Forbidden.','catch','headers','authorization','User','name','then','authenticate','pass','status','Wrong\x20credentials.','startsWith','Bearer','query','getUuid','apikey','sub','allowedLoginAttempts','blockDuration','isEqual','apiKeyNonce','disabled','blocked','blockedAt'];(function(_0x2a9f4,_0x25c14a){var _0x3c39e0=function(_0x3b8deb){while(--_0x3b8deb){_0x2a9f4['push'](_0x2a9f4['shift']());}};_0x3c39e0(++_0x25c14a);}(_0x6c9b,0x123));var _0xb6c9=function(_0x4fed0e,_0x3e91f9){_0x4fed0e=_0x4fed0e-0x0;var _0x1302bc=_0x6c9b[_0x4fed0e];return _0x1302bc;};'use strict';var db=require(_0xb6c9('0x0'))['db'];var config=require(_0xb6c9('0x1'));var hardwareConf=require(_0xb6c9('0x2'));var licenseUtil=require(_0xb6c9('0x3'));var encryptor=require(_0xb6c9('0x4'));var _=require('lodash');var jwt=require('jsonwebtoken');var expressJwt=require(_0xb6c9('0x5'));var compose=require('composable-middleware');var basicAuth=require('basic-auth');var crypto=require(_0xb6c9('0x6'));var BPromise=require(_0xb6c9('0x7'));var util=require(_0xb6c9('0x8'));var moment=require(_0xb6c9('0x9'));var validateJwt=expressJwt({'secret':config[_0xb6c9('0xa')][_0xb6c9('0xb')]});var userAttributes=['id',_0xb6c9('0xc'),'fullname','name',_0xb6c9('0xd'),_0xb6c9('0xe'),'userpic',_0xb6c9('0xf'),_0xb6c9('0x10'),_0xb6c9('0x11'),_0xb6c9('0x12'),_0xb6c9('0x13'),_0xb6c9('0x14'),_0xb6c9('0x15'),_0xb6c9('0x16'),_0xb6c9('0x17'),_0xb6c9('0x18'),_0xb6c9('0x19'),_0xb6c9('0x1a'),'crudPermissions',_0xb6c9('0x1b'),_0xb6c9('0x1c'),'alias',_0xb6c9('0x1d'),_0xb6c9('0x1e'),_0xb6c9('0x1f'),_0xb6c9('0x20'),'phoneBarEnableDtmfTone',_0xb6c9('0x21'),_0xb6c9('0x22'),'phoneBarPrefixRequired',_0xb6c9('0x23'),_0xb6c9('0x24'),'hotdesk',_0xb6c9('0x25'),'userProfileId',_0xb6c9('0x26'),_0xb6c9('0x27'),_0xb6c9('0x28'),_0xb6c9('0x29'),_0xb6c9('0x2a'),'downloadAttachments'];exports[_0xb6c9('0x2b')]=function(){return this[_0xb6c9('0x2c')](!![])[_0xb6c9('0x2d')](function(_0x41ec60,_0x3118b7,_0xead417){if(_0x41ec60[_0xb6c9('0x2e')]){_0xead417();}else{return db[_0xb6c9('0x2f')][_0xb6c9('0x30')]({'where':{'id':_0x41ec60[_0xb6c9('0x31')]['id']},'attributes':['id',_0xb6c9('0x32'),_0xb6c9('0x33')],'raw':!![]})['then'](function(_0x3d7aa2){if(_0x3d7aa2&&_0x3d7aa2[_0xb6c9('0x32')]){return _0x3118b7['status'](_0x3d7aa2[_0xb6c9('0x33')]===_0xb6c9('0x34')?0x195:0x193)[_0xb6c9('0x35')]({'message':_0x3d7aa2[_0xb6c9('0x33')]===_0xb6c9('0x34')?'Unmanaged.':_0xb6c9('0x36')});}else{_0xead417();}})[_0xb6c9('0x37')](function(_0x4a83de){_0xead417(_0x4a83de);});}});};exports[_0xb6c9('0x2c')]=function isAuthenticated(_0x1ea226){return compose()[_0xb6c9('0x2d')](function(_0x984150,_0x35a954,_0x2ba4dc){var _0x4dd43e;if(_0x984150['headers']['authorization']){if(_['startsWith'](_0x984150[_0xb6c9('0x38')][_0xb6c9('0x39')],'Basic')){var _0x2a21b8=basicAuth(_0x984150);db[_0xb6c9('0x3a')]['find']({'where':{'name':_0x2a21b8[_0xb6c9('0x3b')]}})[_0xb6c9('0x3c')](function(_0x177617){if(!_0x177617||!_0x177617[_0xb6c9('0x3d')](_0x2a21b8[_0xb6c9('0x3e')])){return _0x35a954[_0xb6c9('0x3f')](0x191)[_0xb6c9('0x35')]({'message':_0xb6c9('0x40')});}_0x984150[_0xb6c9('0x2e')]={'id':_0x177617['id']};_0x2ba4dc();})[_0xb6c9('0x37')](function(_0x5883b8){_0x2ba4dc(_0x5883b8);});}else if(_[_0xb6c9('0x41')](_0x984150['headers']['authorization'],_0xb6c9('0x42'))){validateJwt(_0x984150,_0x35a954,_0x2ba4dc);}else{if(_0x1ea226){_0x2ba4dc();}else{return _0x35a954[_0xb6c9('0x3f')](0x193)[_0xb6c9('0x35')]({'message':'Unknown\x20authorization\x20format'});}}}else if(_0x984150[_0xb6c9('0x43')]['apikey']){try{var _0x3292df={'audience':hardwareConf[_0xb6c9('0x44')](),'issuer':hardwareConf[_0xb6c9('0x44')]()};verifyJwt(_0x984150[_0xb6c9('0x43')][_0xb6c9('0x45')],_0x3292df)[_0xb6c9('0x3c')](function(_0x5a6bc4){return db['User']['find']({'where':{'id':_0x5a6bc4[_0xb6c9('0x46')]}})['then'](function(_0x53c8c4){_0x4dd43e=_0x53c8c4;return db['Setting'][_0xb6c9('0x30')]({'where':{'id':0x1},'attributes':[_0xb6c9('0x47'),_0xb6c9('0x48')],'raw':!![]});})[_0xb6c9('0x3c')](function(_0x1f686e){if(!_0x4dd43e||!_[_0xb6c9('0x49')](_0x4dd43e[_0xb6c9('0x4a')],_0x5a6bc4['nonce'])){return _0x35a954[_0xb6c9('0x3f')](0x191)['json']({'message':'API\x20access\x20key\x20is\x20not\x20valid\x20anymore'});}if(_0x4dd43e[_0xb6c9('0x4b')]){return _0x35a954[_0xb6c9('0x3f')](0x191)[_0xb6c9('0x35')]({'message':'Invalid\x20API\x20access\x20key'});}if(_0x4dd43e[_0xb6c9('0x4c')]){if(_0x1f686e[_0xb6c9('0x48')]>0x0){if(moment(_0x4dd43e[_0xb6c9('0x4d')])['add'](_0x1f686e[_0xb6c9('0x48')],'minutes')>moment()){return _0x35a954['status'](0x191)['json']({'message':_0xb6c9('0x4e')});}}else{return _0x35a954[_0xb6c9('0x3f')](0x191)[_0xb6c9('0x35')]({'message':_0xb6c9('0x4e')});}}_0x984150[_0xb6c9('0x2e')]={'id':_0x4dd43e['id']};_0x2ba4dc();});})[_0xb6c9('0x37')](function(){return _0x35a954[_0xb6c9('0x3f')](0x191)[_0xb6c9('0x35')]({'message':_0xb6c9('0x4e')});});}catch(_0x44293f){_0x2ba4dc(_0x44293f);}}else if(_0x1ea226){_0x2ba4dc();}else{return _0x35a954[_0xb6c9('0x3f')](0x193)[_0xb6c9('0x35')]({'message':_0xb6c9('0x4f')});}})[_0xb6c9('0x2d')](function(_0xba11f3,_0x5f2a24,_0x488a34){if(_0xba11f3[_0xb6c9('0x2e')]){db[_0xb6c9('0x3a')][_0xb6c9('0x50')]({'where':{'id':_0xba11f3[_0xb6c9('0x2e')]['id']},'attributes':userAttributes})['then'](function(_0xa3d4f6){if(!_0xa3d4f6){return _0x5f2a24[_0xb6c9('0x3f')](0x194)[_0xb6c9('0x35')]({'message':_0xb6c9('0x51')});}_0xba11f3[_0xb6c9('0x2e')]=_0xa3d4f6;_0x488a34();})[_0xb6c9('0x37')](function(_0xb22189){_0x488a34(_0xb22189);});}else if(_0x1ea226){_0x488a34();}else{return _0x5f2a24['status'](0x194)[_0xb6c9('0x35')]({'message':_0xb6c9('0x52')});}});};exports[_0xb6c9('0x53')]=function canUpdate(){return compose()[_0xb6c9('0x2d')](function(_0x479bf7,_0x2f6259,_0x567094){return licenseUtil[_0xb6c9('0x54')]()[_0xb6c9('0x3c')](function(_0x50410c){if(_0x50410c[_0xb6c9('0x55')]){_0x567094();}else{return _0x2f6259[_0xb6c9('0x3f')](0x193)['json']({'message':_0xb6c9('0x56')});}})[_0xb6c9('0x37')](function(_0x5c0e48){_0x567094(_0x5c0e48);});});};exports[_0xb6c9('0x57')]=function(_0x12e170,_0x354329,_0x3abee2){_0x12e170[_0xb6c9('0x57')]=!![];return _0x3abee2();};exports[_0xb6c9('0x58')]=function signToken(_0x1dabfb){return signJwt(_0x1dabfb);};exports[_0xb6c9('0x59')]=function(_0x4178b5,_0x2679d3){if(!_0x4178b5['user']){return _0x2679d3[_0xb6c9('0x3f')](0x194)[_0xb6c9('0x35')]({'message':_0xb6c9('0x5a')});}var _0x4094e6={'payload':{'id':_0x4178b5[_0xb6c9('0x2e')]['id'],'role':_0x4178b5[_0xb6c9('0x2e')]['role']},'options':{'expiresIn':0x15180}};return signJwt(_0x4094e6)[_0xb6c9('0x3c')](function(_0x35513e){_0x2679d3[_0xb6c9('0x5b')](_0xb6c9('0x5c'),_0x35513e);_0x2679d3['redirect'](_0xb6c9('0x5d'));})['catch'](function(_0x957096){return _0x2679d3[_0xb6c9('0x3f')](0x1f4)[_0xb6c9('0x5e')](_0x957096);});};exports['retrieveApiKey']=function(_0x31920a){if(_[_0xb6c9('0x5f')](_0x31920a[_0xb6c9('0x4a')])||_[_0xb6c9('0x5f')](_0x31920a[_0xb6c9('0x60')])){return null;}else{return createJwt(_0x31920a);}};exports['generateApiKey']=function(_0x5b8c5e){_0x5b8c5e[_0xb6c9('0x4a')]=generateNonce();_0x5b8c5e[_0xb6c9('0x60')]=generateIssuedAt();return createJwt(_0x5b8c5e);};exports[_0xb6c9('0x61')]=function(_0x11cc7f,_0x3b4353){var _0x166c02=_0x11cc7f[_0xb6c9('0x43')][_0xb6c9('0x45')];if(_0x166c02){var _0x1b85c6={'nonce':_0x3b4353[_0xb6c9('0x4a')],'iat':_0x3b4353['apiKeyIat'],'audience':hardwareConf[_0xb6c9('0x44')](),'issuer':hardwareConf[_0xb6c9('0x44')]()};return verifyJwt(_0x166c02,_0x1b85c6)[_0xb6c9('0x3c')](function(){return generateApiKey(_0x3b4353);});}else{throw{'message':_0xb6c9('0x62')};}};exports[_0xb6c9('0x63')]=function(_0x398238){var _0x476fd7=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x476fd7[_0xb6c9('0x64')](_0x398238))throw new db[(_0xb6c9('0x65'))]['ValidationError'](_0xb6c9('0x66'));return;};exports['validatePasswordHistory']=function(_0x464efb,_0x1f9e9b,_0xd8828b){var _0x373903=encryptor[_0xb6c9('0x67')](_0x1f9e9b)['split'](',');for(var _0xb029db=0x0;_0xb029db<_0xd8828b;_0xb029db++){if(!_0x373903[_0xb029db])break;if(_0x464efb[_0xb6c9('0x68')]()===_0x373903[_0xb029db][_0xb6c9('0x68')]()){var _0x169b13=util[_0xb6c9('0x69')]('The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.',_0xd8828b);if(_0xd8828b===0x1){_0x169b13=_0xb6c9('0x6a');}throw new db[(_0xb6c9('0x65'))][(_0xb6c9('0x6b'))](_0x169b13);}}return;};exports['updatePasswordsHistory']=function(_0x36b9af,_0x591cce){var _0x35a47d=_0x591cce?encryptor[_0xb6c9('0x67')](_0x591cce)[_0xb6c9('0x6c')](','):[];if(_0x35a47d[_0xb6c9('0x6d')]===0x5){_0x35a47d[_0xb6c9('0x6e')](-0x1,0x1);}_0x35a47d[_0xb6c9('0x6f')](_0x36b9af);return encryptor[_0xb6c9('0x70')](_0x35a47d[_0xb6c9('0x71')](','));};function signJwt(_0x42bee6){var _0xb8d3fd=BPromise[_0xb6c9('0x72')](jwt[_0xb6c9('0x73')],{'context':jwt});var _0x212be3=_0x42bee6[_0xb6c9('0x74')]||config[_0xb6c9('0xa')][_0xb6c9('0xb')];return new BPromise(function(_0x73853f,_0x754ad){_0xb8d3fd(_0x42bee6[_0xb6c9('0x75')],_0x212be3,_0x42bee6['options'])['then'](function(_0x317127){_0x73853f(_0x317127);})[_0xb6c9('0x37')](function(_0x261e28){_0x754ad(_0x261e28);});});}function verifyJwt(_0xf14146,_0x3d2dca,_0x4842f){var _0x1dc4d6=BPromise['promisify'](jwt[_0xb6c9('0x76')],{'context':jwt});var _0x52e502=_0x4842f||config[_0xb6c9('0xa')]['session'];return new BPromise(function(_0x2f7827,_0x526557){_0x1dc4d6(_0xf14146,_0x52e502,_0x3d2dca)['then'](function(_0x32ac42){_0x2f7827(_0x32ac42);})[_0xb6c9('0x37')](function(_0x3464cb){_0x526557(_0x3464cb);});});}function generateNonce(){return crypto[_0xb6c9('0x77')](0x10)[_0xb6c9('0x78')]('hex');}function generateIssuedAt(){return Math['floor'](Date[_0xb6c9('0x79')]()/0x3e8)[_0xb6c9('0x78')]();}function createJwt(_0x32f8b5){var _0x5561ed={'payload':{'iat':_0x32f8b5[_0xb6c9('0x60')],'nonce':_0x32f8b5[_0xb6c9('0x4a')]},'options':{'algorithm':_0xb6c9('0x7a'),'subject':_0x32f8b5['id'][_0xb6c9('0x78')](),'issuer':hardwareConf[_0xb6c9('0x44')](),'audience':hardwareConf[_0xb6c9('0x44')]()}};return signJwt(_0x5561ed)[_0xb6c9('0x3c')](function(_0x1020a5){return{'iat':_0x32f8b5[_0xb6c9('0x60')],'nonce':_0x32f8b5['apiKeyNonce'],'token':_0x1020a5};});} \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index 82d94d5..b70c4a3 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 _0x34b2=['end','final','close','unlink','createReadStream','createDecipher','encryptString','secret','utf8','base64','crypto','bluebird','lodash','../../config/environment','../../config/logger','app','aes-256-ctr','aes192','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','indexOf','hasOwnProperty','createWriteStream','createCipher','data','update','binary','write'];(function(_0x7f2a71,_0x1ce1e0){var _0xe26fc1=function(_0x36449e){while(--_0x36449e){_0x7f2a71['push'](_0x7f2a71['shift']());}};_0xe26fc1(++_0x1ce1e0);}(_0x34b2,0x1ea));var _0x234b=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0x34b2[_0x5bd426];return _0x23a7eb;};'use strict';var crypto=require(_0x234b('0x0'));var fs=require('fs');var BPromise=require(_0x234b('0x1'));var _=require(_0x234b('0x2'));var config=require(_0x234b('0x3'));var logger=require(_0x234b('0x4'))(_0x234b('0x5'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config['secrets']['session'],'algorithm':_0x234b('0x6')};const fileOptions={'algorithm':_0x234b('0x7')};if(config[_0x234b('0x8')]&&config[_0x234b('0x8')][_0x234b('0x9')]){var isSupported=isAlgorithmSupported(config[_0x234b('0x8')][_0x234b('0x9')]);if(isSupported){fileOptions['algorithm']=config['encrypt'][_0x234b('0x9')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x234b('0xa')](',\x20');logger[_0x234b('0xb')](config[_0x234b('0x8')][_0x234b('0x9')],_0x234b('0xc'),supportedAlgorithms);}}function isASupportedCipher(_0x2ed7f1){return AES_SUPPORTED_RX[_0x234b('0xd')](_0x2ed7f1);}function getSupportedCiphers(){return crypto['getCiphers']()['filter'](isASupportedCipher);}function isAlgorithmSupported(_0x341cab){return getSupportedCiphers()[_0x234b('0xe')](_0x341cab)>-0x1;}function combineOptions(_0x9b61fb){var _0x5d6a1d={};for(var _0x4773bf in fileOptions){if(fileOptions[_0x234b('0xf')](_0x4773bf)){_0x5d6a1d[_0x4773bf]=fileOptions[_0x4773bf];}}if(_0x9b61fb){for(var _0x5791b8 in _0x9b61fb){if(_0x9b61fb[_0x234b('0xf')](_0x5791b8)){_0x5d6a1d[_0x5791b8]=_0x9b61fb[_0x5791b8];}}}return _0x5d6a1d;}exports['encryptFile']=function(_0x4b8678,_0x5a1ddd,_0x30b82a,_0x12f0f7){return new BPromise(function(_0x57384d,_0x1f4dd8){_0x12f0f7=combineOptions(_0x12f0f7);var _0x12619f=new Buffer(_0x30b82a);var _0x4bab45=fs['createReadStream'](_0x4b8678);var _0x5dbb3b=fs[_0x234b('0x10')](_0x5a1ddd);var _0x2c4039=crypto[_0x234b('0x11')](_0x12f0f7[_0x234b('0x9')],_0x12619f);_0x4bab45['on'](_0x234b('0x12'),function(_0x4979d0){var _0x4cf4c7=new Buffer(_0x2c4039[_0x234b('0x13')](_0x4979d0),_0x234b('0x14'));_0x5dbb3b[_0x234b('0x15')](_0x4cf4c7);});_0x4bab45['on'](_0x234b('0x16'),function(){try{var _0x5e1a87=new Buffer(_0x2c4039[_0x234b('0x17')](_0x234b('0x14')),'binary');_0x5dbb3b[_0x234b('0x15')](_0x5e1a87);_0x5dbb3b[_0x234b('0x16')]();_0x5dbb3b['on'](_0x234b('0x18'),function(){return _0x57384d(_0x5a1ddd);});}catch(_0x3b72db){fs[_0x234b('0x19')](_0x5a1ddd);return _0x1f4dd8(_0x3b72db);}});});};exports['decryptFile']=function(_0x2581f6,_0xb252c5,_0x51d3e2,_0x1db3fb){return new BPromise(function(_0x2de6cd,_0x198039){_0x1db3fb=combineOptions(_0x1db3fb);var _0x549a49=new Buffer(_0x51d3e2);var _0x204907=fs[_0x234b('0x1a')](_0x2581f6);var _0x5dce18=fs['createWriteStream'](_0xb252c5);var _0x50cb67=crypto[_0x234b('0x1b')](_0x1db3fb[_0x234b('0x9')],_0x549a49);_0x204907['on']('data',function(_0x2a7065){var _0x5dfbf1=new Buffer(_0x50cb67[_0x234b('0x13')](_0x2a7065),'binary');_0x5dce18[_0x234b('0x15')](_0x5dfbf1);});_0x204907['on']('end',function(){try{var _0x283898=new Buffer(_0x50cb67[_0x234b('0x17')](_0x234b('0x14')),'binary');_0x5dce18[_0x234b('0x15')](_0x283898);_0x5dce18[_0x234b('0x16')]();_0x5dce18['on'](_0x234b('0x18'),function(){return _0x2de6cd(_0xb252c5);});}catch(_0x22f70d){fs['unlink'](_0xb252c5);return _0x198039(_0x22f70d);}});});};exports[_0x234b('0x1c')]=function(_0x1bc140,_0x20bd9d,_0x50fad7){var _0x39497b=_0x50fad7||stringOptions['algorithm'];var _0x2b773c=_0x20bd9d||stringOptions[_0x234b('0x1d')];var _0x2a95dc=crypto[_0x234b('0x11')](_0x39497b,_0x2b773c);var _0x440a81=_0x2a95dc[_0x234b('0x13')](_0x1bc140,_0x234b('0x1e'),_0x234b('0x1f'));_0x440a81+=_0x2a95dc['final'](_0x234b('0x1f'));return _0x440a81;};exports['decryptString']=function(_0x2f0926,_0x52b249,_0x43dc75){var _0x13365a=_0x43dc75||stringOptions[_0x234b('0x9')];var _0x12fd0f=_0x52b249||stringOptions[_0x234b('0x1d')];var _0x2a352d=crypto[_0x234b('0x1b')](_0x13365a,_0x12fd0f);var _0x62b5d7=_0x2a352d['update'](_0x2f0926,_0x234b('0x1f'),_0x234b('0x1e'));_0x62b5d7+=_0x2a352d[_0x234b('0x17')](_0x234b('0x1e'));return _0x62b5d7;}; \ No newline at end of file +var _0xcfc4=['base64','decryptString','bluebird','lodash','../../config/environment','app','secrets','session','aes-256-ctr','aes192','encrypt','algorithm','join','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','hasOwnProperty','encryptFile','createWriteStream','createCipher','data','update','binary','write','end','final','close','unlink','decryptFile','createReadStream','createDecipher','encryptString','secret','utf8'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcfc4,0x1bc));var _0x4cfc=function(_0x35cbab,_0x3d430d){_0x35cbab=_0x35cbab-0x0;var _0x1d838d=_0xcfc4[_0x35cbab];return _0x1d838d;};'use strict';var crypto=require('crypto');var fs=require('fs');var BPromise=require(_0x4cfc('0x0'));var _=require(_0x4cfc('0x1'));var config=require(_0x4cfc('0x2'));var logger=require('../../config/logger')(_0x4cfc('0x3'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x4cfc('0x4')][_0x4cfc('0x5')],'algorithm':_0x4cfc('0x6')};const fileOptions={'algorithm':_0x4cfc('0x7')};if(config[_0x4cfc('0x8')]&&config[_0x4cfc('0x8')][_0x4cfc('0x9')]){var isSupported=isAlgorithmSupported(config[_0x4cfc('0x8')][_0x4cfc('0x9')]);if(isSupported){fileOptions['algorithm']=config[_0x4cfc('0x8')][_0x4cfc('0x9')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x4cfc('0xa')](',\x20');logger['error'](config['encrypt'][_0x4cfc('0x9')],_0x4cfc('0xb'),supportedAlgorithms);}}function isASupportedCipher(_0x30f0d6){return AES_SUPPORTED_RX[_0x4cfc('0xc')](_0x30f0d6);}function getSupportedCiphers(){return crypto[_0x4cfc('0xd')]()['filter'](isASupportedCipher);}function isAlgorithmSupported(_0x3189a8){return getSupportedCiphers()['indexOf'](_0x3189a8)>-0x1;}function combineOptions(_0x5bf7b9){var _0x4ee9e6={};for(var _0x343c33 in fileOptions){if(fileOptions[_0x4cfc('0xe')](_0x343c33)){_0x4ee9e6[_0x343c33]=fileOptions[_0x343c33];}}if(_0x5bf7b9){for(var _0x2f8b9d in _0x5bf7b9){if(_0x5bf7b9['hasOwnProperty'](_0x2f8b9d)){_0x4ee9e6[_0x2f8b9d]=_0x5bf7b9[_0x2f8b9d];}}}return _0x4ee9e6;}exports[_0x4cfc('0xf')]=function(_0x514394,_0x4ad147,_0x14cece,_0x4bdf58){return new BPromise(function(_0x13876e,_0x36b987){_0x4bdf58=combineOptions(_0x4bdf58);var _0x46c30c=new Buffer(_0x14cece);var _0x1409d0=fs['createReadStream'](_0x514394);var _0x4c7039=fs[_0x4cfc('0x10')](_0x4ad147);var _0x4ac501=crypto[_0x4cfc('0x11')](_0x4bdf58[_0x4cfc('0x9')],_0x46c30c);_0x1409d0['on'](_0x4cfc('0x12'),function(_0x177233){var _0x2eaaa7=new Buffer(_0x4ac501[_0x4cfc('0x13')](_0x177233),_0x4cfc('0x14'));_0x4c7039[_0x4cfc('0x15')](_0x2eaaa7);});_0x1409d0['on'](_0x4cfc('0x16'),function(){try{var _0x565c20=new Buffer(_0x4ac501[_0x4cfc('0x17')](_0x4cfc('0x14')),_0x4cfc('0x14'));_0x4c7039[_0x4cfc('0x15')](_0x565c20);_0x4c7039['end']();_0x4c7039['on'](_0x4cfc('0x18'),function(){return _0x13876e(_0x4ad147);});}catch(_0x5d0b14){fs[_0x4cfc('0x19')](_0x4ad147);return _0x36b987(_0x5d0b14);}});});};exports[_0x4cfc('0x1a')]=function(_0x5a4478,_0x29ab66,_0x2f506f,_0x7ac681){return new BPromise(function(_0x2967fb,_0x67a722){_0x7ac681=combineOptions(_0x7ac681);var _0x177554=new Buffer(_0x2f506f);var _0x1caede=fs[_0x4cfc('0x1b')](_0x5a4478);var _0x3fbf34=fs[_0x4cfc('0x10')](_0x29ab66);var _0x412ded=crypto[_0x4cfc('0x1c')](_0x7ac681['algorithm'],_0x177554);_0x1caede['on'](_0x4cfc('0x12'),function(_0x45602b){var _0x13ea19=new Buffer(_0x412ded['update'](_0x45602b),_0x4cfc('0x14'));_0x3fbf34[_0x4cfc('0x15')](_0x13ea19);});_0x1caede['on'](_0x4cfc('0x16'),function(){try{var _0x5097b0=new Buffer(_0x412ded[_0x4cfc('0x17')](_0x4cfc('0x14')),_0x4cfc('0x14'));_0x3fbf34[_0x4cfc('0x15')](_0x5097b0);_0x3fbf34['end']();_0x3fbf34['on'](_0x4cfc('0x18'),function(){return _0x2967fb(_0x29ab66);});}catch(_0x3d6483){fs[_0x4cfc('0x19')](_0x29ab66);return _0x67a722(_0x3d6483);}});});};exports[_0x4cfc('0x1d')]=function(_0x3de042,_0x40e160,_0x4a6d2f){var _0x251267=_0x4a6d2f||stringOptions['algorithm'];var _0x421920=_0x40e160||stringOptions[_0x4cfc('0x1e')];var _0x1baddc=crypto[_0x4cfc('0x11')](_0x251267,_0x421920);var _0x58887c=_0x1baddc[_0x4cfc('0x13')](_0x3de042,_0x4cfc('0x1f'),_0x4cfc('0x20'));_0x58887c+=_0x1baddc['final'](_0x4cfc('0x20'));return _0x58887c;};exports[_0x4cfc('0x21')]=function(_0x4f9524,_0x4ba0c3,_0x1fa30c){var _0x370913=_0x1fa30c||stringOptions['algorithm'];var _0x40f7fa=_0x4ba0c3||stringOptions['secret'];var _0x143f1d=crypto[_0x4cfc('0x1c')](_0x370913,_0x40f7fa);var _0x12e918=_0x143f1d[_0x4cfc('0x13')](_0x4f9524,_0x4cfc('0x20'),'utf8');_0x12e918+=_0x143f1d[_0x4cfc('0x17')](_0x4cfc('0x1f'));return _0x12e918;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index cfe36d3..d7c2509 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 _0x6b26=['%s\x20limit\x20%d\x20OFFSET\x20%d','query','format','basename','.csv','existsSync','join','mkdirSync','each','csv','%s.%s','zip','zip\x20finished','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','util','path','lodash','to-csv','bluebird','../../mysqldb','../../config/logger','analytics','argv','AnalyticExtractedReport','update','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','splitSizeCsv','then','sequelize','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','split','length','range','isInteger','forEach','push'];(function(_0x579545,_0x3d6f7b){var _0x2a5a82=function(_0x4a0aed){while(--_0x4a0aed){_0x579545['push'](_0x579545['shift']());}};_0x2a5a82(++_0x3d6f7b);}(_0x6b26,0x172));var _0x66b2=function(_0x486c90,_0x4a84e5){_0x486c90=_0x486c90-0x0;var _0x44f930=_0x6b26[_0x486c90];return _0x44f930;};'use strict';var util=require(_0x66b2('0x0'));var path=require(_0x66b2('0x1'));var _=require(_0x66b2('0x2'));var csv=require(_0x66b2('0x3'));var fs=require('fs');var BPromise=require(_0x66b2('0x4'));var zipdir=require('zip-dir');var rimraf=require('rimraf');var db=require(_0x66b2('0x5'))['db'];var dbH=require(_0x66b2('0x5'))['dbH'];var logger=require(_0x66b2('0x6'))(_0x66b2('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0x66b2('0x8')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x66b2('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x252ffe,_0x3147e2){var _0x1610e9={'status':_0x252ffe};var _0x2f2f4a={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x3147e2){_0x1610e9['savename']=_0x3147e2;}return db[_0x66b2('0x9')][_0x66b2('0xa')](_0x1610e9,_0x2f2f4a);}function main(){var _0x5921ed=0x1388;var _0x20f7b3;logger[_0x66b2('0xb')](util['format'](_0x66b2('0xc'),EXTRACTED_REPORT_ID,_0x66b2('0xd')));return db[_0x66b2('0xe')][_0x66b2('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x66b2('0x10')]})['then'](function(_0x389b8b){if(_0x389b8b){_0x20f7b3=_0x389b8b;_0x5921ed=_0x20f7b3[_0x66b2('0x10')]||0x1388;}})[_0x66b2('0x11')](function(){return dbH[_0x66b2('0x12')]['query'](util['format'](_0x66b2('0x13'),QUERY),{'type':dbH[_0x66b2('0x12')][_0x66b2('0x14')][_0x66b2('0x15')]});})['then'](function(_0x51fd81){if(!_0x51fd81[0x0][_0x66b2('0x16')]){return analyticExtractedReport(_0x66b2('0x17'));}var _0x4aa17d=[];var _0x5c87f1=0x0;if(_0x20f7b3[_0x66b2('0x18')]){if(_0x51fd81&&_0x51fd81[_0x66b2('0x19')]){var _0x58835d=_[_0x66b2('0x1a')](_0x51fd81[0x0][_0x66b2('0x16')]/_0x5921ed);var _0x43899e=Number[_0x66b2('0x1b')](_0x51fd81[0x0]['num']/_0x5921ed)?_0x51fd81[0x0][_0x66b2('0x16')]%_0x5921ed:0x0;_0x58835d[_0x66b2('0x1c')](function(_0x368827){if(_0x368827>0x0){_0x5c87f1+=_0x5921ed;}_0x4aa17d[_0x66b2('0x1d')](dbH[_0x66b2('0x12')]['query'](util['format'](_0x66b2('0x1e'),QUERY,_0x5921ed,_0x5c87f1),{'type':dbH[_0x66b2('0x12')][_0x66b2('0x14')]['SELECT']}));});if(_0x43899e>0x0){_0x5c87f1+=_0x5921ed;_0x4aa17d['push'](dbH['sequelize'][_0x66b2('0x1f')](util[_0x66b2('0x20')](_0x66b2('0x1e'),QUERY,_0x43899e,_0x5c87f1),{'type':dbH[_0x66b2('0x12')][_0x66b2('0x14')][_0x66b2('0x15')]}));}}}else{_0x4aa17d[_0x66b2('0x1d')](dbH['sequelize']['query'](QUERY,{'type':dbH[_0x66b2('0x12')][_0x66b2('0x14')][_0x66b2('0x15')]}));}var _0x1af546=path['dirname'](PATH);var _0x104467=path[_0x66b2('0x21')](PATH,_0x66b2('0x22'));var _0x44cb28=_0x20f7b3['split']&&_0x4aa17d['length']>0x1;var _0x2c2250=[];if(!fs[_0x66b2('0x23')](path[_0x66b2('0x24')](_0x1af546,_0x104467))&&_0x44cb28){fs[_0x66b2('0x25')](path[_0x66b2('0x24')](_0x1af546,_0x104467));}return BPromise[_0x66b2('0x26')](_0x4aa17d,function(_0x43f907){_0x2c2250['push'](_0x43f907);})[_0x66b2('0x11')](function(){for(var _0x502fff=0x0;_0x502fff<_0x2c2250['length'];_0x502fff+=0x1){var _0x26d52d;var _0x466969=_0x2c2250[_0x502fff];if(_0x44cb28){_0x26d52d=path[_0x66b2('0x24')](_0x1af546,_0x104467,util[_0x66b2('0x20')]('%s%d.%s',_0x104467,_0x502fff,_0x66b2('0x27')));}else{_0x26d52d=path[_0x66b2('0x24')](_0x1af546,util[_0x66b2('0x20')]('%s.%s',_0x104467,_0x66b2('0x27')));}fs['writeFileSync'](_0x26d52d,csv(_0x466969));}})[_0x66b2('0x11')](function(){if(_0x44cb28){return new Promise(function(_0x80c3ee){zipdir(path[_0x66b2('0x24')](_0x1af546,_0x104467),{'saveTo':path['join'](_0x1af546,util[_0x66b2('0x20')](_0x66b2('0x28'),_0x104467,_0x66b2('0x29')))},function(_0x21a3ab,_0x2fe957){rimraf(path['join'](_0x1af546,_0x104467),function(){});_0x80c3ee(_0x66b2('0x2a'));});});}})['then'](function(){logger[_0x66b2('0xb')](util[_0x66b2('0x20')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport(_0x66b2('0x2b'),_0x44cb28?util[_0x66b2('0x20')](_0x66b2('0x28'),_0x104467,_0x44cb28?_0x66b2('0x29'):_0x66b2('0x27')):null);});})[_0x66b2('0x2c')](function(_0x5e6781){logger[_0x66b2('0xb')](util['format'](_0x66b2('0x2d'),EXTRACTED_REPORT_ID,_0x66b2('0xd')),util[_0x66b2('0x2e')](_0x5e6781,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x66b2('0x2f'));})[_0x66b2('0x30')](function(){process[_0x66b2('0x31')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x06d9=['CSV','find','splitSizeCsv','then','query','sequelize','QueryTypes','SELECT','num','Empty','split','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','basename','length','existsSync','join','mkdirSync','each','%s%d.%s','csv','%s.%s','zip','zip\x20finished','info','Completed','inspect','Failed','finally','exit','util','to-csv','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format'];(function(_0x76ab37,_0x11a4e4){var _0xbe65a8=function(_0xd340c0){while(--_0xd340c0){_0x76ab37['push'](_0x76ab37['shift']());}};_0xbe65a8(++_0x11a4e4);}(_0x06d9,0xd8));var _0x906d=function(_0x3071c5,_0x18fafe){_0x3071c5=_0x3071c5-0x0;var _0x4a403e=_0x06d9[_0x3071c5];return _0x4a403e;};'use strict';var util=require(_0x906d('0x0'));var path=require('path');var _=require('lodash');var csv=require(_0x906d('0x1'));var fs=require('fs');var BPromise=require('bluebird');var zipdir=require(_0x906d('0x2'));var rimraf=require(_0x906d('0x3'));var db=require(_0x906d('0x4'))['db'];var dbH=require(_0x906d('0x4'))[_0x906d('0x5')];var logger=require(_0x906d('0x6'))(_0x906d('0x7'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x906d('0x8')][0x3];var PATH=process[_0x906d('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x14be06,_0x17791f){var _0x4af3ff={'status':_0x14be06};var _0x11c1b7={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x17791f){_0x4af3ff[_0x906d('0x9')]=_0x17791f;}return db[_0x906d('0xa')][_0x906d('0xb')](_0x4af3ff,_0x11c1b7);}function main(){var _0x429d31=0x1388;var _0x5a9dd5;logger['info'](util[_0x906d('0xc')](_0x906d('0xd'),EXTRACTED_REPORT_ID,_0x906d('0xe')));return db['Setting'][_0x906d('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x906d('0x10')]})[_0x906d('0x11')](function(_0x470c73){if(_0x470c73){_0x5a9dd5=_0x470c73;_0x429d31=_0x5a9dd5['splitSizeCsv']||0x1388;}})[_0x906d('0x11')](function(){return dbH['sequelize'][_0x906d('0x12')](util['format']('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x906d('0x13')][_0x906d('0x14')][_0x906d('0x15')]});})[_0x906d('0x11')](function(_0xedb752){if(!_0xedb752[0x0][_0x906d('0x16')]){return analyticExtractedReport(_0x906d('0x17'));}var _0x300347=[];var _0xd8ffdc=0x0;if(_0x5a9dd5[_0x906d('0x18')]){if(_0xedb752&&_0xedb752['length']){var _0x317652=_['range'](_0xedb752[0x0][_0x906d('0x16')]/_0x429d31);var _0x8c99b6=Number[_0x906d('0x19')](_0xedb752[0x0][_0x906d('0x16')]/_0x429d31)?_0xedb752[0x0][_0x906d('0x16')]%_0x429d31:0x0;_0x317652[_0x906d('0x1a')](function(_0x44fc43){if(_0x44fc43>0x0){_0xd8ffdc+=_0x429d31;}_0x300347[_0x906d('0x1b')](dbH[_0x906d('0x13')][_0x906d('0x12')](util[_0x906d('0xc')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x429d31,_0xd8ffdc),{'type':dbH['sequelize'][_0x906d('0x14')][_0x906d('0x15')]}));});if(_0x8c99b6>0x0){_0xd8ffdc+=_0x429d31;_0x300347[_0x906d('0x1b')](dbH[_0x906d('0x13')][_0x906d('0x12')](util[_0x906d('0xc')](_0x906d('0x1c'),QUERY,_0x8c99b6,_0xd8ffdc),{'type':dbH['sequelize'][_0x906d('0x14')][_0x906d('0x15')]}));}}}else{_0x300347['push'](dbH[_0x906d('0x13')]['query'](QUERY,{'type':dbH['sequelize'][_0x906d('0x14')][_0x906d('0x15')]}));}var _0x1ede4d=path['dirname'](PATH);var _0x493e25=path[_0x906d('0x1d')](PATH,'.csv');var _0x4cb987=_0x5a9dd5[_0x906d('0x18')]&&_0x300347[_0x906d('0x1e')]>0x1;var _0x29aaee=[];if(!fs[_0x906d('0x1f')](path[_0x906d('0x20')](_0x1ede4d,_0x493e25))&&_0x4cb987){fs[_0x906d('0x21')](path[_0x906d('0x20')](_0x1ede4d,_0x493e25));}return BPromise[_0x906d('0x22')](_0x300347,function(_0x47067d){_0x29aaee[_0x906d('0x1b')](_0x47067d);})[_0x906d('0x11')](function(){for(var _0x5b7cf0=0x0;_0x5b7cf0<_0x29aaee[_0x906d('0x1e')];_0x5b7cf0+=0x1){var _0x408226;var _0x2e43b9=_0x29aaee[_0x5b7cf0];if(_0x4cb987){_0x408226=path[_0x906d('0x20')](_0x1ede4d,_0x493e25,util[_0x906d('0xc')](_0x906d('0x23'),_0x493e25,_0x5b7cf0,_0x906d('0x24')));}else{_0x408226=path[_0x906d('0x20')](_0x1ede4d,util[_0x906d('0xc')]('%s.%s',_0x493e25,_0x906d('0x24')));}fs['writeFileSync'](_0x408226,csv(_0x2e43b9));}})[_0x906d('0x11')](function(){if(_0x4cb987){return new Promise(function(_0x26c254){zipdir(path[_0x906d('0x20')](_0x1ede4d,_0x493e25),{'saveTo':path[_0x906d('0x20')](_0x1ede4d,util['format'](_0x906d('0x25'),_0x493e25,_0x906d('0x26')))},function(_0x3ee437,_0x4b7f38){rimraf(path[_0x906d('0x20')](_0x1ede4d,_0x493e25),function(){});_0x26c254(_0x906d('0x27'));});});}})[_0x906d('0x11')](function(){logger[_0x906d('0x28')](util[_0x906d('0xc')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x906d('0xe')));return analyticExtractedReport(_0x906d('0x29'),_0x4cb987?util[_0x906d('0xc')](_0x906d('0x25'),_0x493e25,_0x4cb987?'zip':_0x906d('0x24')):null);});})['catch'](function(_0x1f9d34){logger[_0x906d('0x28')](util['format']('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x906d('0xe')),util[_0x906d('0x2a')](_0x1f9d34,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x906d('0x2b'));})[_0x906d('0x2c')](function(){process[_0x906d('0x2d')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index 36514c6..871254f 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 _0x8316=['rimraf','bluebird','../../mysqldb','dbH','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','tableHeader','map','pick','toString','fill','length','body','push','concat','chunk','keys','forEach','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','format','endDate','header','pageBreak','before','margin','footer','Arial','right','num','Empty','Setting','split','splitSizePdf','then','range','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','basename','.pdf','join','mkdirSync','each','flatten','%s%d.%s','pdf','%s.%s','all','zip','zip\x20finished','PDF','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','findOne','inspect','Failed','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','channel','interactionId','YYYY-MM-DD','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','createWriteStream','finish','error','end','createPdfFromHTML','createPdfKitDocument','lodash','util','path','html-to-pdfmake'];(function(_0x2d7134,_0x27e314){var _0x480d83=function(_0x1f41f4){while(--_0x1f41f4){_0x2d7134['push'](_0x2d7134['shift']());}};_0x480d83(++_0x27e314);}(_0x8316,0xa6));var _0x6831=function(_0x5bdcef,_0x39b56b){_0x5bdcef=_0x5bdcef-0x0;var _0x3bef65=_0x8316[_0x5bdcef];return _0x3bef65;};'use strict';var _=require(_0x6831('0x0'));var fs=require('fs');var util=require(_0x6831('0x1'));var path=require(_0x6831('0x2'));var moment=require('moment');var htmlToPdfmake=require(_0x6831('0x3'));var PdfPrinter=require('pdfmake/src/printer');var zipdir=require('zip-dir');var rimraf=require(_0x6831('0x4'));var JSDOM=require('jsdom')['JSDOM'];var window=new JSDOM('')['window'];var BPromise=require(_0x6831('0x5'));var db=require(_0x6831('0x6'))['db'];var dbH=require(_0x6831('0x6'))[_0x6831('0x7')];var logger=require('../../config/logger')(_0x6831('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0x6831('0x9')][0x2]);var QUERY=process[_0x6831('0x9')][0x3];var PATH=process[_0x6831('0x9')][0x4];var NAME=process[_0x6831('0x9')][0x5];var FORMAT=_0x6831('0xa');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x5b106a,_0x5e3e26){var _0xd3c93a={'status':_0x5b106a};var _0x5181a8={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x5e3e26){_0xd3c93a[_0x6831('0xb')]=_0x5e3e26;}return db[_0x6831('0xc')][_0x6831('0xd')](_0xd3c93a,_0x5181a8);}function getHeaders(_0xf16449){return _['map'](_0xf16449,function(_0x33bb41){return{'text':_0x33bb41,'style':_0x6831('0xe')};});}function getRows(_0x36196a,_0x37a60c){return _[_0x6831('0xf')](_0x37a60c,function(_0x377178){return _(_0x377178)[_0x6831('0x10')](_0x36196a)[_0x6831('0xf')](function(_0xdb57cf){return _0xdb57cf?_[_0x6831('0x11')](_0xdb57cf):'';})['value']();});}function createTable(_0x961f0d,_0x11a423){var _0x75542d={'widths':_[_0x6831('0x12')](Array(_0x961f0d[_0x6831('0x13')]),0x91),'heights':function(_0x970d2d){return _0x970d2d===0x0?'auto':0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x240d39=getHeaders(_0x961f0d);_0x75542d[_0x6831('0x14')][_0x6831('0x15')](_0x240d39);var _0x41da47=getRows(_0x961f0d,_0x11a423);_0x75542d['body']=_0x75542d[_0x6831('0x14')][_0x6831('0x16')](_0x41da47);return _0x75542d;}function createTables(_0xe31dd4){var _0x597b4a=[];var _0x49ec66=_[_0x6831('0x17')](Object[_0x6831('0x18')](_0xe31dd4[0x0]),0x5);_0x49ec66[_0x6831('0x19')](function(_0x24ce30){_0x597b4a['push'](createTable(_0x24ce30,_0xe31dd4));});return _0x597b4a;}function getPDFDocDefinition(_0x128c3b){var _0x48af5c=util['format'](_0x6831('0x1a'),NAME,EXTRACTED_REPORT[_0x6831('0x1b')],moment(EXTRACTED_REPORT[_0x6831('0x1c')])[_0x6831('0x1d')](FORMAT),moment(EXTRACTED_REPORT[_0x6831('0x1e')])['format'](FORMAT));var _0x55239a=[];for(var _0x33f7b9=0x0;_0x33f7b9<_0x128c3b[_0x6831('0x13')];_0x33f7b9++){var _0x57364d=[];if(_0x33f7b9===0x0){_0x57364d['push']({'text':_0x48af5c,'style':_0x6831('0x1f')});}var _0x2c65f2={'table':_0x128c3b[_0x33f7b9]};if(_0x33f7b9>0x0){_0x2c65f2[_0x6831('0x20')]=_0x6831('0x21');_0x2c65f2[_0x6831('0x22')]=[0x0,0x46,0x0,0x0];}_0x57364d[_0x6831('0x15')](_0x2c65f2);_0x55239a[_0x6831('0x15')](_0x57364d);}return{'pageSize':'A4','pageOrientation':'landscape','content':_0x55239a,'footer':function(_0x1a9804,_0x19b41b){return{'text':_0x1a9804[_0x6831('0x11')]()+'\x20/\x20'+_0x19b41b,'style':_0x6831('0x23')};},'defaultStyle':{'font':_0x6831('0x24')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':'black'},'footer':{'alignment':_0x6831('0x25'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x1f47da){var _0x41c543=0x1388;var _0x3a8a63;if(!_0x1f47da[0x0][_0x6831('0x26')]){return analyticExtractedReport(_0x6831('0x27'));}return db[_0x6831('0x28')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x6831('0x29'),_0x6831('0x2a')]})[_0x6831('0x2b')](function(_0x52de37){if(_0x52de37){_0x3a8a63=_0x52de37;_0x41c543=_0x3a8a63[_0x6831('0x2a')]||0x3e8;}})[_0x6831('0x2b')](function(){var _0x199965=[];var _0x31502a=0x0;if(_0x3a8a63[_0x6831('0x29')]){if(_0x1f47da&&_0x1f47da[_0x6831('0x13')]){var _0x40a2c0=_[_0x6831('0x2c')](_0x1f47da[0x0]['num']/_0x41c543);var _0x23c598=Number['isInteger'](_0x1f47da[0x0][_0x6831('0x26')]/_0x41c543)?_0x1f47da[0x0][_0x6831('0x26')]%_0x41c543:0x0;_0x40a2c0[_0x6831('0x19')](function(_0xa64134){if(_0xa64134>0x0){_0x31502a+=_0x41c543;}_0x199965['push'](dbH[_0x6831('0x2d')][_0x6831('0x2e')](util['format'](_0x6831('0x2f'),QUERY,_0x41c543,_0x31502a),{'type':dbH[_0x6831('0x2d')][_0x6831('0x30')]['SELECT']}));});if(_0x23c598>0x0){_0x31502a+=_0x41c543;_0x199965['push'](dbH['sequelize'][_0x6831('0x2e')](util[_0x6831('0x1d')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x23c598,_0x31502a),{'type':dbH[_0x6831('0x2d')][_0x6831('0x30')]['SELECT']}));}}}else{_0x199965[_0x6831('0x15')](dbH[_0x6831('0x2d')][_0x6831('0x2e')](QUERY,{'type':dbH[_0x6831('0x2d')][_0x6831('0x30')][_0x6831('0x31')]}));}var _0x2fef06=path['dirname'](PATH);var _0x199981=path[_0x6831('0x32')](PATH,_0x6831('0x33'));var _0x1e30ff=_0x3a8a63[_0x6831('0x29')]&&_0x199965['length']>0x1;var _0x41da12=[];if(!fs['existsSync'](path[_0x6831('0x34')](_0x2fef06,_0x199981))&&_0x1e30ff){fs[_0x6831('0x35')](path[_0x6831('0x34')](_0x2fef06,_0x199981));}return BPromise[_0x6831('0x36')](_0x199965,function(_0x23342f){_0x41da12[_0x6831('0x15')](_0x23342f);})['then'](function(){var _0x2e38cb=[];for(var _0x4a0ae7=0x0;_0x4a0ae7<_0x41da12[_0x6831('0x13')];_0x4a0ae7+=0x1){var _0x45c5bc=_0x41da12[_0x4a0ae7];var _0x50f393=createTables(_[_0x6831('0x37')](_0x45c5bc));var _0x5be009;var _0x39773f=getPDFDocDefinition(_0x50f393);var _0x4c7057=getPDFPrinter();var _0x466fd3=_0x4c7057['createPdfKitDocument'](_0x39773f);if(_0x1e30ff){_0x5be009=path[_0x6831('0x34')](_0x2fef06,_0x199981,util[_0x6831('0x1d')](_0x6831('0x38'),_0x199981,_0x4a0ae7,_0x6831('0x39')));}else{_0x5be009=path[_0x6831('0x34')](_0x2fef06,util['format'](_0x6831('0x3a'),_0x199981,_0x6831('0x39')));}_0x2e38cb[_0x6831('0x15')](writePDFDocument(_0x466fd3,_0x5be009));}return Promise[_0x6831('0x3b')](_0x2e38cb);})[_0x6831('0x2b')](function(){if(_0x1e30ff){return new Promise(function(_0x2922c0){zipdir(path[_0x6831('0x34')](_0x2fef06,_0x199981),{'saveTo':path[_0x6831('0x34')](_0x2fef06,util[_0x6831('0x1d')](_0x6831('0x3a'),_0x199981,_0x6831('0x3c')))},function(){rimraf(path[_0x6831('0x34')](_0x2fef06,_0x199981),function(){});_0x2922c0(_0x6831('0x3d'));});});}})[_0x6831('0x2b')](function(){if(!_0x1e30ff)return;rimraf(path[_0x6831('0x34')](_0x2fef06,_0x199981),function(){});})[_0x6831('0x2b')](function(){logger['info'](util['format']('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x6831('0x3e')));return analyticExtractedReport('Completed',_0x1e30ff?util[_0x6831('0x1d')]('%s.%s',_0x199981,_0x1e30ff?_0x6831('0x3c'):_0x6831('0x39')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x6831('0x3f')](util[_0x6831('0x1d')](_0x6831('0x40'),EXTRACTED_REPORT_ID,'PDF'));return db[_0x6831('0xc')][_0x6831('0x41')]({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0xce4f14){EXTRACTED_REPORT=_0xce4f14;return dbH[_0x6831('0x2d')]['query'](util[_0x6831('0x1d')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x6831('0x2d')]['QueryTypes']['SELECT']});})[_0x6831('0x2b')](extractReport)['catch'](function(_0xbc944c){logger[_0x6831('0x3f')](util[_0x6831('0x1d')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x6831('0x3e')),util[_0x6831('0x42')](_0xbc944c,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x6831('0x43'));})[_0x6831('0x44')](function(){process[_0x6831('0x45')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x2fd318=new PdfPrinter({'Arial':{'normal':__dirname+_0x6831('0x46'),'bold':__dirname+'/fonts/arial-bold.ttf','italics':__dirname+_0x6831('0x47'),'bolditalics':__dirname+_0x6831('0x48')}});return _0x2fd318;}function getPDFDocDefinitionFromHTML(_0x20972e,_0x1ded6b){var _0x5a29fe=util[_0x6831('0x1d')]('%s\x20#%d',_0x1ded6b[_0x6831('0x49')],_0x1ded6b[_0x6831('0x4a')]);var _0xc2e79b=moment()['format'](_0x6831('0x4b'))['toString']();var _0x3818ad=htmlToPdfmake(_0x20972e,{'window':window,'tableAutoSize':!![]});return{'content':[_0x3818ad],'defaultStyle':{'font':_0x6831('0x24')},'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':_0x6831('0x4c'),'style':'header'}];},'footer':function(_0x808d56,_0x517ad4){return[{'text':util[_0x6831('0x1d')](_0x6831('0x4d'),_0x5a29fe,_0x808d56,_0x517ad4,_0xc2e79b),'style':_0x6831('0x23')}];}};}function writePDFDocument(_0x4f852e,_0x281616){return new Promise(function(_0x482aa9,_0x4c3349){var _0x56a6a6=_0x4f852e[_0x6831('0x4e')](fs[_0x6831('0x4f')](_0x281616));_0x56a6a6['on']('finish',function(){_0x482aa9(_0x6831('0x50'));});_0x56a6a6['on'](_0x6831('0x51'),function(_0x5aa0d2){_0x4c3349(_0x5aa0d2);});_0x4f852e[_0x6831('0x52')]();});}exports[_0x6831('0x53')]=function(_0x1663e8,_0x57e5f6){var _0x433386=getPDFPrinter();var _0x367d4a=getPDFDocDefinitionFromHTML(_0x1663e8,_0x57e5f6);var _0x3dc5f4=_0x433386[_0x6831('0x54')](_0x367d4a);return writePDFDocument(_0x3dc5f4,_0x57e5f6[_0x6831('0x2')])['catch'](function(_0x5dd78d){throw _0x5dd78d;});}; \ No newline at end of file +var _0xc7ea=['MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','map','tableHeader','pick','value','fill','length','body','push','concat','chunk','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','endDate','header','pageBreak','margin','footer','Arial','black','right','num','Empty','Setting','find','splitSizePdf','then','split','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','dirname','.pdf','mkdirSync','join','each','createPdfKitDocument','%s%d.%s','%s.%s','pdf','all','zip','zip\x20finished','info','PDF','Completed','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','interactionId','YYYY-MM-DD','toString','center','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','createWriteStream','finish','error','createPdfFromHTML','catch','lodash','util','path','moment','html-to-pdfmake','pdfmake/src/printer','zip-dir','rimraf','JSDOM','window','bluebird','../../mysqldb','../../config/logger','analytics','argv'];(function(_0x258e74,_0x459529){var _0x21f2fc=function(_0x1df3dd){while(--_0x1df3dd){_0x258e74['push'](_0x258e74['shift']());}};_0x21f2fc(++_0x459529);}(_0xc7ea,0xa3));var _0xac7e=function(_0x14742b,_0x85a9fc){_0x14742b=_0x14742b-0x0;var _0x1fe053=_0xc7ea[_0x14742b];return _0x1fe053;};'use strict';var _=require(_0xac7e('0x0'));var fs=require('fs');var util=require(_0xac7e('0x1'));var path=require(_0xac7e('0x2'));var moment=require(_0xac7e('0x3'));var htmlToPdfmake=require(_0xac7e('0x4'));var PdfPrinter=require(_0xac7e('0x5'));var zipdir=require(_0xac7e('0x6'));var rimraf=require(_0xac7e('0x7'));var JSDOM=require('jsdom')[_0xac7e('0x8')];var window=new JSDOM('')[_0xac7e('0x9')];var BPromise=require(_0xac7e('0xa'));var db=require('../../mysqldb')['db'];var dbH=require(_0xac7e('0xb'))['dbH'];var logger=require(_0xac7e('0xc'))(_0xac7e('0xd'));var EXTRACTED_REPORT_ID=Number(process[_0xac7e('0xe')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0xac7e('0xe')][0x4];var NAME=process[_0xac7e('0xe')][0x5];var FORMAT=_0xac7e('0xf');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0xe74b40,_0x2100c6){var _0x499ab2={'status':_0xe74b40};var _0x557e26={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2100c6){_0x499ab2[_0xac7e('0x10')]=_0x2100c6;}return db[_0xac7e('0x11')][_0xac7e('0x12')](_0x499ab2,_0x557e26);}function getHeaders(_0x460c50){return _[_0xac7e('0x13')](_0x460c50,function(_0xcf4519){return{'text':_0xcf4519,'style':_0xac7e('0x14')};});}function getRows(_0x150d1d,_0x12353a){return _['map'](_0x12353a,function(_0x378069){return _(_0x378069)[_0xac7e('0x15')](_0x150d1d)[_0xac7e('0x13')](function(_0x398b80){return _0x398b80?_['toString'](_0x398b80):'';})[_0xac7e('0x16')]();});}function createTable(_0x84c18b,_0x4a164b){var _0x4067f5={'widths':_[_0xac7e('0x17')](Array(_0x84c18b[_0xac7e('0x18')]),0x91),'heights':function(_0x781407){return _0x781407===0x0?'auto':0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x367f87=getHeaders(_0x84c18b);_0x4067f5[_0xac7e('0x19')][_0xac7e('0x1a')](_0x367f87);var _0xdf2c73=getRows(_0x84c18b,_0x4a164b);_0x4067f5[_0xac7e('0x19')]=_0x4067f5[_0xac7e('0x19')][_0xac7e('0x1b')](_0xdf2c73);return _0x4067f5;}function createTables(_0x1cf8c8){var _0x5f0bdc=[];var _0x1d255c=_[_0xac7e('0x1c')](Object['keys'](_0x1cf8c8[0x0]),0x5);_0x1d255c[_0xac7e('0x1d')](function(_0x21e8d6){_0x5f0bdc[_0xac7e('0x1a')](createTable(_0x21e8d6,_0x1cf8c8));});return _0x5f0bdc;}function getPDFDocDefinition(_0x111abe){var _0x5c2af3=util[_0xac7e('0x1e')](_0xac7e('0x1f'),NAME,EXTRACTED_REPORT[_0xac7e('0x20')],moment(EXTRACTED_REPORT[_0xac7e('0x21')])[_0xac7e('0x1e')](FORMAT),moment(EXTRACTED_REPORT[_0xac7e('0x22')])[_0xac7e('0x1e')](FORMAT));var _0x4bf15a=[];for(var _0x214d0a=0x0;_0x214d0a<_0x111abe[_0xac7e('0x18')];_0x214d0a++){var _0x3d1f0c=[];if(_0x214d0a===0x0){_0x3d1f0c[_0xac7e('0x1a')]({'text':_0x5c2af3,'style':_0xac7e('0x23')});}var _0x284236={'table':_0x111abe[_0x214d0a]};if(_0x214d0a>0x0){_0x284236[_0xac7e('0x24')]='before';_0x284236[_0xac7e('0x25')]=[0x0,0x46,0x0,0x0];}_0x3d1f0c[_0xac7e('0x1a')](_0x284236);_0x4bf15a[_0xac7e('0x1a')](_0x3d1f0c);}return{'pageSize':'A4','pageOrientation':'landscape','content':_0x4bf15a,'footer':function(_0x5bbae6,_0x2bfb67){return{'text':_0x5bbae6['toString']()+'\x20/\x20'+_0x2bfb67,'style':_0xac7e('0x26')};},'defaultStyle':{'font':_0xac7e('0x27')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xac7e('0x28')},'footer':{'alignment':_0xac7e('0x29'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x3c0049){var _0x3c0718=0x1388;var _0xf16e68;if(!_0x3c0049[0x0][_0xac7e('0x2a')]){return analyticExtractedReport(_0xac7e('0x2b'));}return db[_0xac7e('0x2c')][_0xac7e('0x2d')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0xac7e('0x2e')]})[_0xac7e('0x2f')](function(_0x27f36d){if(_0x27f36d){_0xf16e68=_0x27f36d;_0x3c0718=_0xf16e68[_0xac7e('0x2e')]||0x3e8;}})[_0xac7e('0x2f')](function(){var _0x274811=[];var _0x16e078=0x0;if(_0xf16e68[_0xac7e('0x30')]){if(_0x3c0049&&_0x3c0049[_0xac7e('0x18')]){var _0x1e290d=_['range'](_0x3c0049[0x0][_0xac7e('0x2a')]/_0x3c0718);var _0x5c6305=Number['isInteger'](_0x3c0049[0x0]['num']/_0x3c0718)?_0x3c0049[0x0]['num']%_0x3c0718:0x0;_0x1e290d['forEach'](function(_0xc10df9){if(_0xc10df9>0x0){_0x16e078+=_0x3c0718;}_0x274811[_0xac7e('0x1a')](dbH[_0xac7e('0x31')][_0xac7e('0x32')](util[_0xac7e('0x1e')](_0xac7e('0x33'),QUERY,_0x3c0718,_0x16e078),{'type':dbH[_0xac7e('0x31')][_0xac7e('0x34')]['SELECT']}));});if(_0x5c6305>0x0){_0x16e078+=_0x3c0718;_0x274811['push'](dbH[_0xac7e('0x31')][_0xac7e('0x32')](util[_0xac7e('0x1e')](_0xac7e('0x33'),QUERY,_0x5c6305,_0x16e078),{'type':dbH[_0xac7e('0x31')][_0xac7e('0x34')][_0xac7e('0x35')]}));}}}else{_0x274811[_0xac7e('0x1a')](dbH['sequelize'][_0xac7e('0x32')](QUERY,{'type':dbH[_0xac7e('0x31')][_0xac7e('0x34')]['SELECT']}));}var _0x1c043d=path[_0xac7e('0x36')](PATH);var _0x1eb43c=path['basename'](PATH,_0xac7e('0x37'));var _0x2f987e=_0xf16e68[_0xac7e('0x30')]&&_0x274811[_0xac7e('0x18')]>0x1;var _0xcd02c5=[];if(!fs['existsSync'](path['join'](_0x1c043d,_0x1eb43c))&&_0x2f987e){fs[_0xac7e('0x38')](path[_0xac7e('0x39')](_0x1c043d,_0x1eb43c));}return BPromise[_0xac7e('0x3a')](_0x274811,function(_0x4e3fc3){_0xcd02c5[_0xac7e('0x1a')](_0x4e3fc3);})[_0xac7e('0x2f')](function(){var _0x5d0f33=[];for(var _0xaf7543=0x0;_0xaf7543<_0xcd02c5[_0xac7e('0x18')];_0xaf7543+=0x1){var _0x4fae5a=_0xcd02c5[_0xaf7543];var _0x140f01=createTables(_['flatten'](_0x4fae5a));var _0x44b778;var _0x232e0d=getPDFDocDefinition(_0x140f01);var _0xe38b2e=getPDFPrinter();var _0x246b1d=_0xe38b2e[_0xac7e('0x3b')](_0x232e0d);if(_0x2f987e){_0x44b778=path['join'](_0x1c043d,_0x1eb43c,util[_0xac7e('0x1e')](_0xac7e('0x3c'),_0x1eb43c,_0xaf7543,'pdf'));}else{_0x44b778=path['join'](_0x1c043d,util[_0xac7e('0x1e')](_0xac7e('0x3d'),_0x1eb43c,_0xac7e('0x3e')));}_0x5d0f33[_0xac7e('0x1a')](writePDFDocument(_0x246b1d,_0x44b778));}return Promise[_0xac7e('0x3f')](_0x5d0f33);})['then'](function(){if(_0x2f987e){return new Promise(function(_0xbb5d5e){zipdir(path[_0xac7e('0x39')](_0x1c043d,_0x1eb43c),{'saveTo':path[_0xac7e('0x39')](_0x1c043d,util[_0xac7e('0x1e')](_0xac7e('0x3d'),_0x1eb43c,_0xac7e('0x40')))},function(){rimraf(path[_0xac7e('0x39')](_0x1c043d,_0x1eb43c),function(){});_0xbb5d5e(_0xac7e('0x41'));});});}})['then'](function(){if(!_0x2f987e)return;rimraf(path[_0xac7e('0x39')](_0x1c043d,_0x1eb43c),function(){});})[_0xac7e('0x2f')](function(){logger[_0xac7e('0x42')](util[_0xac7e('0x1e')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0xac7e('0x43')));return analyticExtractedReport(_0xac7e('0x44'),_0x2f987e?util['format'](_0xac7e('0x3d'),_0x1eb43c,_0x2f987e?_0xac7e('0x40'):_0xac7e('0x3e')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger['info'](util[_0xac7e('0x1e')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xac7e('0x43')));return db['AnalyticExtractedReport']['findOne']({'where':{'id':EXTRACTED_REPORT_ID}})[_0xac7e('0x2f')](function(_0x4b4dbc){EXTRACTED_REPORT=_0x4b4dbc;return dbH['sequelize'][_0xac7e('0x32')](util[_0xac7e('0x1e')](_0xac7e('0x45'),QUERY),{'type':dbH[_0xac7e('0x31')]['QueryTypes'][_0xac7e('0x35')]});})[_0xac7e('0x2f')](extractReport)['catch'](function(_0x1aad5c){logger[_0xac7e('0x42')](util[_0xac7e('0x1e')](_0xac7e('0x46'),EXTRACTED_REPORT_ID,_0xac7e('0x43')),util[_0xac7e('0x47')](_0x1aad5c,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xac7e('0x48'));})[_0xac7e('0x49')](function(){process[_0xac7e('0x4a')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x207c64=new PdfPrinter({'Arial':{'normal':__dirname+'/fonts/arial-regular.ttf','bold':__dirname+_0xac7e('0x4b'),'italics':__dirname+_0xac7e('0x4c'),'bolditalics':__dirname+_0xac7e('0x4d')}});return _0x207c64;}function getPDFDocDefinitionFromHTML(_0x3fc7e1,_0x5583fa){var _0x3d3038=util[_0xac7e('0x1e')](_0xac7e('0x4e'),_0x5583fa['channel'],_0x5583fa[_0xac7e('0x4f')]);var _0xb90e19=moment()[_0xac7e('0x1e')](_0xac7e('0x50'))[_0xac7e('0x51')]();var _0x2a567d=htmlToPdfmake(_0x3fc7e1,{'window':window,'tableAutoSize':!![]});return{'content':[_0x2a567d],'defaultStyle':{'font':_0xac7e('0x27')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xac7e('0x52'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0xac7e('0x52'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0xac7e('0x52')}},'header':function(){return[{'text':'Interaction\x20Transcript','style':_0xac7e('0x23')}];},'footer':function(_0x5e1825,_0x4ec993){return[{'text':util[_0xac7e('0x1e')](_0xac7e('0x53'),_0x3d3038,_0x5e1825,_0x4ec993,_0xb90e19),'style':_0xac7e('0x26')}];}};}function writePDFDocument(_0x16555c,_0x397918){return new Promise(function(_0x1b76b3,_0x24f7ef){var _0x4615c1=_0x16555c['pipe'](fs[_0xac7e('0x54')](_0x397918));_0x4615c1['on'](_0xac7e('0x55'),function(){_0x1b76b3('finish');});_0x4615c1['on'](_0xac7e('0x56'),function(_0x5ec4ee){_0x24f7ef(_0x5ec4ee);});_0x16555c['end']();});}exports[_0xac7e('0x57')]=function(_0x2dbad9,_0x3be8ec){var _0x544a41=getPDFPrinter();var _0x56b06a=getPDFDocDefinitionFromHTML(_0x2dbad9,_0x3be8ec);var _0x40a03a=_0x544a41['createPdfKitDocument'](_0x56b06a);return writePDFDocument(_0x40a03a,_0x3be8ec[_0xac7e('0x2')])[_0xac7e('0x58')](function(_0x4c13db){throw _0x4c13db;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index ce47664..6f2e8db 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 _0x9068=['.xlsx','existsSync','mkdirSync','join','each','%s%d.%s','xlsx','%s.%s','writeFileSync','binary','Completed','zip','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','util','lodash','json2xls','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','find','split','splitSizeXlsx','then','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','QueryTypes','SELECT','num','Empty','length','range','forEach','push','format','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename'];(function(_0x2a612d,_0x3a41a6){var _0x2da3b5=function(_0x58e7c5){while(--_0x58e7c5){_0x2a612d['push'](_0x2a612d['shift']());}};_0x2da3b5(++_0x3a41a6);}(_0x9068,0xea));var _0x8906=function(_0x15c89c,_0x5468f0){_0x15c89c=_0x15c89c-0x0;var _0xc08e1c=_0x9068[_0x15c89c];return _0xc08e1c;};'use strict';var util=require(_0x8906('0x0'));var path=require('path');var _=require(_0x8906('0x1'));var fs=require('fs');var json2xls=require(_0x8906('0x2'));var BPromise=require(_0x8906('0x3'));var zipdir=require(_0x8906('0x4'));var rimraf=require(_0x8906('0x5'));var db=require(_0x8906('0x6'))['db'];var dbH=require(_0x8906('0x6'))[_0x8906('0x7')];var logger=require(_0x8906('0x8'))(_0x8906('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0x8906('0xa')][0x2]);var QUERY=process[_0x8906('0xa')][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x2b38c6,_0x5690a2){var _0x3329f8={'status':_0x2b38c6};var _0x15bb34={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x5690a2){_0x3329f8[_0x8906('0xb')]=_0x5690a2;}return db[_0x8906('0xc')]['update'](_0x3329f8,_0x15bb34);}function main(){var _0x22c2ce=0x1388;var _0x3dd59d;logger[_0x8906('0xd')](util['format'](_0x8906('0xe'),EXTRACTED_REPORT_ID,_0x8906('0xf')));return db[_0x8906('0x10')][_0x8906('0x11')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x8906('0x12'),_0x8906('0x13')]})[_0x8906('0x14')](function(_0x5a1859){if(_0x5a1859){_0x3dd59d=_0x5a1859;_0x22c2ce=_0x3dd59d[_0x8906('0x13')]||0x1388;}})['then'](function(){return dbH['sequelize'][_0x8906('0x15')](util['format'](_0x8906('0x16'),QUERY),{'type':dbH[_0x8906('0x17')][_0x8906('0x18')][_0x8906('0x19')]});})[_0x8906('0x14')](function(_0x5c291b){if(!_0x5c291b[0x0][_0x8906('0x1a')]){return analyticExtractedReport(_0x8906('0x1b'));}var _0x36e079=[];var _0x5f290c=0x0;if(_0x3dd59d[_0x8906('0x12')]){if(_0x5c291b&&_0x5c291b[_0x8906('0x1c')]){var _0x34702c=_[_0x8906('0x1d')](_0x5c291b[0x0]['num']/_0x22c2ce);var _0x13f2e3=Number['isInteger'](_0x5c291b[0x0][_0x8906('0x1a')]/_0x22c2ce)?_0x5c291b[0x0][_0x8906('0x1a')]%_0x22c2ce:0x0;_0x34702c[_0x8906('0x1e')](function(_0x41e027){if(_0x41e027>0x0){_0x5f290c+=_0x22c2ce;}_0x36e079[_0x8906('0x1f')](dbH[_0x8906('0x17')][_0x8906('0x15')](util[_0x8906('0x20')](_0x8906('0x21'),QUERY,_0x22c2ce,_0x5f290c),{'type':dbH[_0x8906('0x17')]['QueryTypes']['SELECT']}));});if(_0x13f2e3>0x0){_0x5f290c+=_0x22c2ce;_0x36e079[_0x8906('0x1f')](dbH[_0x8906('0x17')][_0x8906('0x15')](util[_0x8906('0x20')](_0x8906('0x21'),QUERY,_0x13f2e3,_0x5f290c),{'type':dbH[_0x8906('0x17')]['QueryTypes'][_0x8906('0x19')]}));}}}else{_0x36e079[_0x8906('0x1f')](dbH[_0x8906('0x17')][_0x8906('0x15')](QUERY,{'type':dbH['sequelize'][_0x8906('0x18')][_0x8906('0x19')]}));}var _0x333875=path[_0x8906('0x22')](PATH);var _0x9aae11=path[_0x8906('0x23')](PATH,_0x8906('0x24'));var _0x46aa63=_0x3dd59d['split']&&_0x36e079['length']>0x1;var _0x229704=[];if(!fs[_0x8906('0x25')](path['join'](_0x333875,_0x9aae11))&&_0x46aa63){fs[_0x8906('0x26')](path[_0x8906('0x27')](_0x333875,_0x9aae11));}return BPromise[_0x8906('0x28')](_0x36e079,function(_0x537dd9){_0x229704[_0x8906('0x1f')](_0x537dd9);})[_0x8906('0x14')](function(){for(var _0x4a1b5d=0x0;_0x4a1b5d<_0x229704[_0x8906('0x1c')];_0x4a1b5d+=0x1){var _0x5cf107;var _0x264b53=_0x229704[_0x4a1b5d];if(_0x46aa63){_0x5cf107=path[_0x8906('0x27')](_0x333875,_0x9aae11,util[_0x8906('0x20')](_0x8906('0x29'),_0x9aae11,_0x4a1b5d,_0x8906('0x2a')));}else{_0x5cf107=path[_0x8906('0x27')](_0x333875,util[_0x8906('0x20')](_0x8906('0x2b'),_0x9aae11,_0x8906('0x2a')));}fs[_0x8906('0x2c')](_0x5cf107,json2xls(_0x264b53),_0x8906('0x2d'));}})[_0x8906('0x14')](function(){if(_0x46aa63){return new Promise(function(_0x141520){zipdir(path[_0x8906('0x27')](_0x333875,_0x9aae11),{'saveTo':path[_0x8906('0x27')](_0x333875,util[_0x8906('0x20')](_0x8906('0x2b'),_0x9aae11,'zip'))},function(_0x473874,_0x225e1a){rimraf(path[_0x8906('0x27')](_0x333875,_0x9aae11),function(){});_0x141520('zip\x20finished');});});}})[_0x8906('0x14')](function(){logger['info'](util[_0x8906('0x20')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x8906('0xf')));return analyticExtractedReport(_0x8906('0x2e'),_0x46aa63?util[_0x8906('0x20')](_0x8906('0x2b'),_0x9aae11,_0x46aa63?_0x8906('0x2f'):'xlsx'):null);});})[_0x8906('0x30')](function(_0xec0643){logger[_0x8906('0xd')](util[_0x8906('0x20')](_0x8906('0x31'),EXTRACTED_REPORT_ID,_0x8906('0xf')),util[_0x8906('0x32')](_0xec0643,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x8906('0x33'));})[_0x8906('0x34')](function(){process[_0x8906('0x35')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x69c4=['existsSync','join','mkdirSync','each','%s%d.%s','xlsx','%s.%s','binary','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','util','path','lodash','bluebird','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','find','split','splitSizeXlsx','then','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','QueryTypes','SELECT','num','Empty','length','range','isInteger','push','%s\x20limit\x20%d\x20OFFSET\x20%d','basename','.xlsx'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x69c4,0x1d4));var _0x469c=function(_0x3ef1bb,_0x5ba940){_0x3ef1bb=_0x3ef1bb-0x0;var _0x4d2d27=_0x69c4[_0x3ef1bb];return _0x4d2d27;};'use strict';var util=require(_0x469c('0x0'));var path=require(_0x469c('0x1'));var _=require(_0x469c('0x2'));var fs=require('fs');var json2xls=require('json2xls');var BPromise=require(_0x469c('0x3'));var zipdir=require('zip-dir');var rimraf=require('rimraf');var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')['dbH'];var logger=require(_0x469c('0x4'))(_0x469c('0x5'));var EXTRACTED_REPORT_ID=Number(process[_0x469c('0x6')][0x2]);var QUERY=process[_0x469c('0x6')][0x3];var PATH=process[_0x469c('0x6')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0xa52bb9,_0x5a87df){var _0x288ce5={'status':_0xa52bb9};var _0x2ac568={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x5a87df){_0x288ce5[_0x469c('0x7')]=_0x5a87df;}return db[_0x469c('0x8')][_0x469c('0x9')](_0x288ce5,_0x2ac568);}function main(){var _0x1ba954=0x1388;var _0x406808;logger[_0x469c('0xa')](util[_0x469c('0xb')](_0x469c('0xc'),EXTRACTED_REPORT_ID,_0x469c('0xd')));return db['Setting'][_0x469c('0xe')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x469c('0xf'),_0x469c('0x10')]})[_0x469c('0x11')](function(_0x1076b6){if(_0x1076b6){_0x406808=_0x1076b6;_0x1ba954=_0x406808[_0x469c('0x10')]||0x1388;}})[_0x469c('0x11')](function(){return dbH['sequelize'][_0x469c('0x12')](util[_0x469c('0xb')](_0x469c('0x13'),QUERY),{'type':dbH[_0x469c('0x14')][_0x469c('0x15')][_0x469c('0x16')]});})[_0x469c('0x11')](function(_0x2fb7b4){if(!_0x2fb7b4[0x0][_0x469c('0x17')]){return analyticExtractedReport(_0x469c('0x18'));}var _0x424589=[];var _0x17ebc4=0x0;if(_0x406808[_0x469c('0xf')]){if(_0x2fb7b4&&_0x2fb7b4[_0x469c('0x19')]){var _0x351042=_[_0x469c('0x1a')](_0x2fb7b4[0x0]['num']/_0x1ba954);var _0x214023=Number[_0x469c('0x1b')](_0x2fb7b4[0x0][_0x469c('0x17')]/_0x1ba954)?_0x2fb7b4[0x0]['num']%_0x1ba954:0x0;_0x351042['forEach'](function(_0x3cd593){if(_0x3cd593>0x0){_0x17ebc4+=_0x1ba954;}_0x424589[_0x469c('0x1c')](dbH['sequelize']['query'](util[_0x469c('0xb')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x1ba954,_0x17ebc4),{'type':dbH['sequelize'][_0x469c('0x15')][_0x469c('0x16')]}));});if(_0x214023>0x0){_0x17ebc4+=_0x1ba954;_0x424589[_0x469c('0x1c')](dbH[_0x469c('0x14')][_0x469c('0x12')](util[_0x469c('0xb')](_0x469c('0x1d'),QUERY,_0x214023,_0x17ebc4),{'type':dbH[_0x469c('0x14')][_0x469c('0x15')][_0x469c('0x16')]}));}}}else{_0x424589[_0x469c('0x1c')](dbH[_0x469c('0x14')][_0x469c('0x12')](QUERY,{'type':dbH['sequelize'][_0x469c('0x15')]['SELECT']}));}var _0x3145a7=path['dirname'](PATH);var _0x26d766=path[_0x469c('0x1e')](PATH,_0x469c('0x1f'));var _0x5177c8=_0x406808[_0x469c('0xf')]&&_0x424589[_0x469c('0x19')]>0x1;var _0x2e3ab6=[];if(!fs[_0x469c('0x20')](path[_0x469c('0x21')](_0x3145a7,_0x26d766))&&_0x5177c8){fs[_0x469c('0x22')](path[_0x469c('0x21')](_0x3145a7,_0x26d766));}return BPromise[_0x469c('0x23')](_0x424589,function(_0x2ca6ed){_0x2e3ab6[_0x469c('0x1c')](_0x2ca6ed);})[_0x469c('0x11')](function(){for(var _0xd3f419=0x0;_0xd3f419<_0x2e3ab6['length'];_0xd3f419+=0x1){var _0x543976;var _0x378769=_0x2e3ab6[_0xd3f419];if(_0x5177c8){_0x543976=path[_0x469c('0x21')](_0x3145a7,_0x26d766,util[_0x469c('0xb')](_0x469c('0x24'),_0x26d766,_0xd3f419,_0x469c('0x25')));}else{_0x543976=path[_0x469c('0x21')](_0x3145a7,util[_0x469c('0xb')](_0x469c('0x26'),_0x26d766,_0x469c('0x25')));}fs['writeFileSync'](_0x543976,json2xls(_0x378769),_0x469c('0x27'));}})[_0x469c('0x11')](function(){if(_0x5177c8){return new Promise(function(_0x37e4ae){zipdir(path['join'](_0x3145a7,_0x26d766),{'saveTo':path[_0x469c('0x21')](_0x3145a7,util[_0x469c('0xb')](_0x469c('0x26'),_0x26d766,_0x469c('0x28')))},function(_0x451f1b,_0xc6c537){rimraf(path[_0x469c('0x21')](_0x3145a7,_0x26d766),function(){});_0x37e4ae(_0x469c('0x29'));});});}})[_0x469c('0x11')](function(){logger['info'](util['format'](_0x469c('0x2a'),EXTRACTED_REPORT_ID,_0x469c('0xd')));return analyticExtractedReport(_0x469c('0x2b'),_0x5177c8?util[_0x469c('0xb')]('%s.%s',_0x26d766,_0x5177c8?_0x469c('0x28'):'xlsx'):null);});})[_0x469c('0x2c')](function(_0x4cfbdb){logger['info'](util[_0x469c('0xb')](_0x469c('0x2d'),EXTRACTED_REPORT_ID,_0x469c('0xd')),util[_0x469c('0x2e')](_0x4cfbdb,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x469c('0x2f'));})[_0x469c('0x30')](function(){process[_0x469c('0x31')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index 4f09c2a..e18a72e 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 _0xb717=['context','priority','VoiceExtensionId','inbound','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','CDR(routeid)=','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt','updatedAt','interval','*,*,*,*','IntervalId','tag','CDR(tag)=','outbound','callerID','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1',',${EXTEN},','last','concat','transaction','destroy','bulkCreate','sortBy','error','rewrite','lodash','util','models','Interval','findAll','then','VoiceExtension','uniq','map','exten','filter','groupBy','playback','hasOwnProperty','extension','find','extensions','push','type','Set','format','CDR(type)=%s'];(function(_0x1cdf85,_0x161b96){var _0x32b945=function(_0x29d94f){while(--_0x29d94f){_0x1cdf85['push'](_0x1cdf85['shift']());}};_0x32b945(++_0x161b96);}(_0xb717,0xc2));var _0x7b71=function(_0x3716be,_0x5ec953){_0x3716be=_0x3716be-0x0;var _0x5d19e0=_0xb717[_0x3716be];return _0x5d19e0;};'use strict';var _=require(_0x7b71('0x0'));var util=require(_0x7b71('0x1'));function rewrite(_0x48525b,_0x3c8394){var _0x49e619=this;return _0x48525b[_0x7b71('0x2')][_0x7b71('0x3')][_0x7b71('0x4')]({'raw':!![]})[_0x7b71('0x5')](function(_0x4bed8a){_0x49e619['intervals']=_0x4bed8a;return _0x48525b[_0x7b71('0x2')]['VoiceExtension'][_0x7b71('0x4')]({'where':{'IntervalId':_0x3c8394['IntervalId']},'raw':!![]});})[_0x7b71('0x5')](function(_0x1b8f01){return _0x48525b[_0x7b71('0x2')][_0x7b71('0x6')][_0x7b71('0x4')]({'where':{'exten':{'$in':_[_0x7b71('0x7')](_[_0x7b71('0x8')](_0x1b8f01,_0x7b71('0x9')))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})[_0x7b71('0x5')](function(_0x360ef6){var _0xfe884f=_[_0x7b71('0xa')](_0x360ef6,{'priority':'1'});var _0x4f679b=_[_0x7b71('0xa')](_0x360ef6,{'isApp':0x1});var _0x4b5803=_[_0x7b71('0xb')](_0x4f679b,_0x7b71('0x9'));var _0x4e32ae=['queue',_0x7b71('0xc')];var _0x1797ff=[];var _0x2260bc=[];for(var _0x5cde93 in _0x4b5803){if(_0x4b5803[_0x7b71('0xd')](_0x5cde93)){_0x49e619['priority']=0x2;_0x49e619['extensions']=[];_0x49e619[_0x7b71('0xe')]=_[_0x7b71('0xf')](_0xfe884f,{'exten':_0x4b5803[_0x5cde93][0x0][_0x7b71('0x9')]});_0x49e619[_0x7b71('0x10')][_0x7b71('0x11')]({'type':_0x4b5803[_0x5cde93][0x0][_0x7b71('0x12')],'app':_0x7b71('0x13'),'appdata':util[_0x7b71('0x14')](_0x7b71('0x15'),_0x4b5803[_0x5cde93][0x0][_0x7b71('0x12')]),'context':_0x4b5803[_0x5cde93][0x0][_0x7b71('0x16')],'exten':_0x4b5803[_0x5cde93][0x0][_0x7b71('0x9')],'priority':_0x49e619[_0x7b71('0x17')]++,'VoiceExtensionId':_0x4b5803[_0x5cde93][0x0][_0x7b71('0x18')]});if(_0x4b5803[_0x5cde93][0x0][_0x7b71('0x12')]===_0x7b71('0x19')){_0x49e619['extensions'][_0x7b71('0x11')]({'type':_0x4b5803[_0x5cde93][0x0][_0x7b71('0x12')],'app':_0x7b71('0x13'),'appdata':'CDR(routeid)='+_0x4b5803[_0x5cde93][0x0][_0x7b71('0x18')],'context':_0x4b5803[_0x5cde93][0x0][_0x7b71('0x16')],'exten':_0x4b5803[_0x5cde93][0x0][_0x7b71('0x9')],'priority':_0x49e619[_0x7b71('0x17')]++,'VoiceExtensionId':_0x4b5803[_0x5cde93][0x0]['VoiceExtensionId']});}else if(_0x4b5803[_0x5cde93][0x0][_0x7b71('0x12')]==='outbound'){if(_0x49e619[_0x7b71('0xe')]){_0x49e619['extensions'][_0x7b71('0x11')]({'type':_0x4b5803[_0x5cde93][0x0]['type'],'app':_0x7b71('0x13'),'appdata':_0x7b71('0x1a')+(_0x49e619['extension'][_0x7b71('0x1b')]?_0x7b71('0x1c')+_0x49e619[_0x7b71('0xe')][_0x7b71('0x1b')]+'}':_0x7b71('0x1d')),'context':_0x4b5803[_0x5cde93][0x0]['context'],'exten':_0x4b5803[_0x5cde93][0x0][_0x7b71('0x9')],'priority':_0x49e619['priority']++,'VoiceExtensionId':_0x4b5803[_0x5cde93][0x0][_0x7b71('0x18')]});}_0x49e619['extensions'][_0x7b71('0x11')]({'type':_0x4b5803[_0x5cde93][0x0][_0x7b71('0x12')],'app':_0x7b71('0x13'),'appdata':_0x7b71('0x1e')+_0x4b5803[_0x5cde93][0x0]['VoiceExtensionId'],'context':_0x4b5803[_0x5cde93][0x0][_0x7b71('0x16')],'exten':_0x4b5803[_0x5cde93][0x0][_0x7b71('0x9')],'priority':_0x49e619[_0x7b71('0x17')]++,'VoiceExtensionId':_0x4b5803[_0x5cde93][0x0][_0x7b71('0x18')]});var _0xa50638=_0x49e619['priority']++;_0x49e619[_0x7b71('0x10')][_0x7b71('0x11')]({'type':_0x4b5803[_0x5cde93][0x0][_0x7b71('0x12')],'app':'ExecIf','appdata':_0x7b71('0x1f')+(_0xa50638+0x2)+_0x7b71('0x20')+(_0xa50638+0x1)+')','context':_0x4b5803[_0x5cde93][0x0][_0x7b71('0x16')],'exten':_0x4b5803[_0x5cde93][0x0][_0x7b71('0x9')],'priority':_0xa50638,'VoiceExtensionId':_0x4b5803[_0x5cde93][0x0][_0x7b71('0x18')]});if(_0x49e619['extension']){_0x49e619[_0x7b71('0x10')][_0x7b71('0x11')]({'type':_0x4b5803[_0x5cde93][0x0][_0x7b71('0x12')],'app':_0x7b71('0x13'),'appdata':_0x49e619[_0x7b71('0xe')][_0x7b71('0x1b')]?_0x7b71('0x21')+_0x49e619[_0x7b71('0xe')][_0x7b71('0x1b')]+'}':_0x7b71('0x22'),'context':_0x4b5803[_0x5cde93][0x0]['context'],'exten':_0x4b5803[_0x5cde93][0x0][_0x7b71('0x9')],'priority':_0x49e619[_0x7b71('0x17')]++,'VoiceExtensionId':_0x4b5803[_0x5cde93][0x0]['VoiceExtensionId']});}_0x49e619[_0x7b71('0x10')]['push']({'type':_0x4b5803[_0x5cde93][0x0][_0x7b71('0x12')],'app':'Set','appdata':'outboundrouteid='+_0x4b5803[_0x5cde93][0x0][_0x7b71('0x18')],'context':_0x4b5803[_0x5cde93][0x0][_0x7b71('0x16')],'exten':_0x4b5803[_0x5cde93][0x0]['exten'],'priority':_0x49e619[_0x7b71('0x17')]++,'VoiceExtensionId':_0x4b5803[_0x5cde93][0x0]['VoiceExtensionId']});if(_0x49e619[_0x7b71('0xe')]&&_0x49e619['extension'][_0x7b71('0xd')](_0x7b71('0x23'))&&_0x49e619['extension'][_0x7b71('0x23')]!==_0x7b71('0x24')){_0x49e619['extensions']['push']({'type':_0x4b5803[_0x5cde93][0x0][_0x7b71('0x12')],'app':_0x7b71('0x13'),'appdata':_0x7b71('0x25'),'context':_0x4b5803[_0x5cde93][0x0][_0x7b71('0x16')],'exten':_0x4b5803[_0x5cde93][0x0][_0x7b71('0x9')],'priority':_0x49e619[_0x7b71('0x17')]++,'VoiceExtensionId':_0x4b5803[_0x5cde93][0x0][_0x7b71('0x18')]});_0x49e619[_0x7b71('0x10')][_0x7b71('0x11')]({'type':_0x4b5803[_0x5cde93][0x0][_0x7b71('0x12')],'app':'Set','appdata':_0x7b71('0x26')+_0x49e619['extension'][_0x7b71('0x23')]||_0x7b71('0x27'),'context':_0x4b5803[_0x5cde93][0x0][_0x7b71('0x16')],'exten':_0x4b5803[_0x5cde93][0x0][_0x7b71('0x9')],'priority':_0x49e619['priority']++,'VoiceExtensionId':_0x4b5803[_0x5cde93][0x0][_0x7b71('0x18')]});}}_0x49e619['extensions'][_0x7b71('0x11')]({'type':_0x4b5803[_0x5cde93][0x0][_0x7b71('0x12')],'app':'Set','appdata':_0x7b71('0x28'),'context':_0x4b5803[_0x5cde93][0x0][_0x7b71('0x16')],'exten':_0x4b5803[_0x5cde93][0x0][_0x7b71('0x9')],'priority':_0x49e619['priority']++,'VoiceExtensionId':_0x4b5803[_0x5cde93][0x0][_0x7b71('0x18')]});_0x49e619[_0x7b71('0x10')][_0x7b71('0x11')]({'type':_0x4b5803[_0x5cde93][0x0]['type'],'app':_0x7b71('0x13'),'appdata':_0x7b71('0x29'),'context':_0x4b5803[_0x5cde93][0x0][_0x7b71('0x16')],'exten':_0x4b5803[_0x5cde93][0x0][_0x7b71('0x9')],'priority':_0x49e619[_0x7b71('0x17')]++,'VoiceExtensionId':_0x4b5803[_0x5cde93][0x0][_0x7b71('0x18')]});_0x49e619[_0x7b71('0x10')][_0x7b71('0x11')]({'type':_0x4b5803[_0x5cde93][0x0][_0x7b71('0x12')],'app':'Set','appdata':_0x7b71('0x2a'),'context':_0x4b5803[_0x5cde93][0x0][_0x7b71('0x16')],'exten':_0x4b5803[_0x5cde93][0x0]['exten'],'priority':_0x49e619[_0x7b71('0x17')]++,'VoiceExtensionId':_0x4b5803[_0x5cde93][0x0][_0x7b71('0x18')]});for(var _0x597be9=0x0,_0x52937b=0x0;_0x597be9<_0x4b5803[_0x5cde93][_0x7b71('0x2b')];_0x597be9+=0x1,_0x52937b=0x0){var _0x55ee93=_0x4b5803[_0x5cde93][_0x597be9];if(_0x55ee93[_0x7b71('0x12')]){_0x55ee93[_0x7b71('0x12')]=_0x55ee93[_0x7b71('0x12')][_0x7b71('0x2c')]();}var _0x3be2fe=[];var _0x1e4b10=[];delete _0x55ee93['id'];delete _0x55ee93[_0x7b71('0x2d')];delete _0x55ee93[_0x7b71('0x2e')];var _0x52d2ef=_0x55ee93[_0x7b71('0x2f')]!==_0x7b71('0x30')?[_0x55ee93[_0x7b71('0x2f')]]:_0x55ee93['IntervalId']?_[_0x7b71('0x8')](_['filter'](_0x49e619['intervals'],{'IntervalId':_0x55ee93[_0x7b71('0x31')]}),'interval'):[];if(_0x55ee93['hasOwnProperty']('tag')){if(_0x55ee93[_0x7b71('0x32')]&&_0x55ee93[_0x7b71('0x32')]!=='--'){_0x3be2fe[_0x7b71('0x11')]({'type':_0x55ee93[_0x7b71('0x12')],'app':'Set','appdata':_0x7b71('0x33')+_0x55ee93[_0x7b71('0x32')],'context':_0x55ee93[_0x7b71('0x16')],'exten':_0x55ee93[_0x7b71('0x9')],'priority':_0x52d2ef[_0x7b71('0x2b')]+_0x49e619[_0x7b71('0x17')]+_0x52937b++,'VoiceExtensionId':_0x55ee93[_0x7b71('0x18')]});}}if(_0x55ee93[_0x7b71('0x12')]===_0x7b71('0x34')&&_0x55ee93[_0x7b71('0xd')](_0x7b71('0x35'))){if(_0x55ee93['callerID']){_0x3be2fe[_0x7b71('0x11')]({'type':_0x55ee93[_0x7b71('0x12')],'app':_0x7b71('0x36'),'appdata':_0x7b71('0x37')+_0x55ee93['callerID']+')','context':_0x55ee93['context'],'exten':_0x55ee93[_0x7b71('0x9')],'priority':_0x52d2ef['length']+_0x49e619[_0x7b71('0x17')]+_0x52937b++,'VoiceExtensionId':_0x55ee93[_0x7b71('0x18')]});}else{_0x3be2fe['push']({'type':_0x55ee93[_0x7b71('0x12')],'app':'ExecIf','appdata':_0x7b71('0x38'),'context':_0x55ee93[_0x7b71('0x16')],'exten':_0x55ee93[_0x7b71('0x9')],'priority':_0x52d2ef['length']+_0x49e619[_0x7b71('0x17')]+_0x52937b++,'VoiceExtensionId':_0x55ee93[_0x7b71('0x18')]});}}if(_0x55ee93[_0x7b71('0xd')](_0x7b71('0x39'))){if(_0x4e32ae['indexOf'](_0x55ee93[_0x7b71('0x3a')][_0x7b71('0x2c')]())>=0x0&&_0x55ee93[_0x7b71('0x3b')]!==_0x7b71('0x3c')){if(_0x55ee93[_0x7b71('0x39')]){_0x3be2fe[_0x7b71('0x11')]({'type':_0x55ee93[_0x7b71('0x12')],'app':_0x7b71('0x36'),'appdata':_0x7b71('0x3d'),'context':_0x55ee93[_0x7b71('0x16')],'exten':_0x55ee93['exten'],'priority':_0x52d2ef[_0x7b71('0x2b')]+_0x49e619[_0x7b71('0x17')]+_0x52937b++,'VoiceExtensionId':_0x55ee93[_0x7b71('0x18')]});_0x3be2fe[_0x7b71('0x11')]({'type':_0x55ee93[_0x7b71('0x12')],'app':'Set','appdata':_0x7b71('0x3e'),'context':_0x55ee93[_0x7b71('0x16')],'exten':_0x55ee93['exten'],'priority':_0x52d2ef[_0x7b71('0x2b')]+_0x49e619[_0x7b71('0x17')]+_0x52937b++,'VoiceExtensionId':_0x55ee93[_0x7b71('0x18')]});}else{_0x3be2fe[_0x7b71('0x11')]({'type':_0x55ee93['type'],'app':_0x7b71('0x36'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x55ee93[_0x7b71('0x16')],'exten':_0x55ee93['exten'],'priority':_0x52d2ef[_0x7b71('0x2b')]+_0x49e619[_0x7b71('0x17')]+_0x52937b++,'VoiceExtensionId':_0x55ee93[_0x7b71('0x18')]});_0x3be2fe['push']({'type':_0x55ee93[_0x7b71('0x12')],'app':_0x7b71('0x13'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x55ee93[_0x7b71('0x16')],'exten':_0x55ee93['exten'],'priority':_0x52d2ef[_0x7b71('0x2b')]+_0x49e619[_0x7b71('0x17')]+_0x52937b++,'VoiceExtensionId':_0x55ee93[_0x7b71('0x18')]});}}}for(var _0x2e0948=0x0;_0x2e0948<_0x52d2ef[_0x7b71('0x2b')];_0x2e0948+=0x1){var _0x305b4b=_0x49e619[_0x7b71('0x17')]+_0x52d2ef[_0x7b71('0x2b')];var _0x399809=_0x2e0948===_0x52d2ef[_0x7b71('0x2b')]-0x1?_0x49e619[_0x7b71('0x17')]+_0x3be2fe[_0x7b71('0x2b')]+_0x1e4b10['length']+0x2:_0x49e619['priority']+_0x2e0948+0x1;_0x3be2fe['splice'](_0x2e0948,0x0,{'type':_0x55ee93[_0x7b71('0x12')],'app':'GotoIfTime','appdata':_0x52d2ef[_0x2e0948]+'?'+_0x55ee93[_0x7b71('0x16')]+_0x7b71('0x3f')+_0x305b4b+':'+_0x55ee93[_0x7b71('0x16')]+_0x7b71('0x3f')+_0x399809,'exten':_0x55ee93['exten'],'context':_0x55ee93[_0x7b71('0x16')],'priority':_0x49e619[_0x7b71('0x17')]+_0x2e0948,'VoiceExtensionId':_0x4b5803[_0x5cde93][0x0][_0x7b71('0x18')]});}_0x55ee93[_0x7b71('0x17')]=_0x3be2fe['length']?_['last'](_0x3be2fe)[_0x7b71('0x17')]+0x1:_0x49e619[_0x7b71('0x17')];_0x49e619[_0x7b71('0x17')]=(_0x1e4b10[_0x7b71('0x2b')]?_[_0x7b71('0x40')](_0x1e4b10)[_0x7b71('0x17')]:_0x55ee93[_0x7b71('0x17')])+0x1;_0x49e619[_0x7b71('0x10')]=_['concat'](_0x49e619[_0x7b71('0x10')],_0x3be2fe,[_0x55ee93],_0x1e4b10);}_0x49e619[_0x7b71('0x10')]['push']({'type':_0x4b5803[_0x5cde93][0x0]['type'],'app':'Hangup','exten':_0x4b5803[_0x5cde93][0x0][_0x7b71('0x9')],'context':_0x4b5803[_0x5cde93][0x0][_0x7b71('0x16')],'priority':_0x49e619[_0x7b71('0x17')],'VoiceExtensionId':_0x4b5803[_0x5cde93][0x0]['VoiceExtensionId']});_0x1797ff['push'](_0x4b5803[_0x5cde93][0x0][_0x7b71('0x18')]);_0x2260bc=_[_0x7b71('0x41')](_0x2260bc,_0x49e619[_0x7b71('0x10')]);}}return _0x48525b[_0x7b71('0x42')](function(_0x3e0845){return _0x48525b[_0x7b71('0x2')][_0x7b71('0x6')][_0x7b71('0x43')]({'where':{'VoiceExtensionId':{'$in':_0x1797ff}},'transaction':_0x3e0845})[_0x7b71('0x5')](function(_0xd58581){return _0x48525b['models'][_0x7b71('0x6')][_0x7b71('0x44')](_[_0x7b71('0x45')](_0x2260bc,'priority'),{'transaction':_0x3e0845});});});})['catch'](function(_0x44dcbf){console[_0x7b71('0x46')](_0x44dcbf);});}exports[_0x7b71('0x47')]=rewrite; \ No newline at end of file +var _0x7372=['indexOf','appType','XCALLY-MOTION-ANSWER=1','splice',',${EXTEN},','last','concat','Hangup','transaction','destroy','sortBy','catch','rewrite','util','models','Interval','findAll','then','intervals','VoiceExtension','uniq','exten','CAST(priority\x20AS\x20UNSIGNED)','hasOwnProperty','priority','extensions','extension','find','push','type','Set','format','CDR(type)=%s','context','VoiceExtensionId','inbound','outbound','${EXTEN:','cutdigits','${EXTEN}','CDR(routeid)=','ExecIf','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','MONITOR_OPTIONS=ab','length','toLowerCase','updatedAt','interval','*,*,*,*','IntervalId','map','filter','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer'];(function(_0x1a1d9b,_0x5ea65a){var _0x1d7a59=function(_0xa1dea2){while(--_0xa1dea2){_0x1a1d9b['push'](_0x1a1d9b['shift']());}};_0x1d7a59(++_0x5ea65a);}(_0x7372,0x115));var _0x2737=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7372[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x2737('0x0'));function rewrite(_0x45e7e3,_0x5588d7){var _0x15fbf1=this;return _0x45e7e3[_0x2737('0x1')][_0x2737('0x2')][_0x2737('0x3')]({'raw':!![]})[_0x2737('0x4')](function(_0x5b0eaf){_0x15fbf1[_0x2737('0x5')]=_0x5b0eaf;return _0x45e7e3[_0x2737('0x1')][_0x2737('0x6')]['findAll']({'where':{'IntervalId':_0x5588d7['IntervalId']},'raw':!![]});})['then'](function(_0x21b1ae){return _0x45e7e3[_0x2737('0x1')][_0x2737('0x6')][_0x2737('0x3')]({'where':{'exten':{'$in':_[_0x2737('0x7')](_['map'](_0x21b1ae,_0x2737('0x8')))}},'order':[{'raw':_0x2737('0x9')}],'raw':!![]});})[_0x2737('0x4')](function(_0x3bc980){var _0x5f294f=_['filter'](_0x3bc980,{'priority':'1'});var _0x569387=_['filter'](_0x3bc980,{'isApp':0x1});var _0x440bfa=_['groupBy'](_0x569387,_0x2737('0x8'));var _0xdcf528=['queue','playback'];var _0x117a5e=[];var _0x2d85f0=[];for(var _0x5a9ed1 in _0x440bfa){if(_0x440bfa[_0x2737('0xa')](_0x5a9ed1)){_0x15fbf1[_0x2737('0xb')]=0x2;_0x15fbf1[_0x2737('0xc')]=[];_0x15fbf1[_0x2737('0xd')]=_[_0x2737('0xe')](_0x5f294f,{'exten':_0x440bfa[_0x5a9ed1][0x0][_0x2737('0x8')]});_0x15fbf1['extensions'][_0x2737('0xf')]({'type':_0x440bfa[_0x5a9ed1][0x0][_0x2737('0x10')],'app':_0x2737('0x11'),'appdata':util[_0x2737('0x12')](_0x2737('0x13'),_0x440bfa[_0x5a9ed1][0x0][_0x2737('0x10')]),'context':_0x440bfa[_0x5a9ed1][0x0][_0x2737('0x14')],'exten':_0x440bfa[_0x5a9ed1][0x0][_0x2737('0x8')],'priority':_0x15fbf1[_0x2737('0xb')]++,'VoiceExtensionId':_0x440bfa[_0x5a9ed1][0x0][_0x2737('0x15')]});if(_0x440bfa[_0x5a9ed1][0x0][_0x2737('0x10')]===_0x2737('0x16')){_0x15fbf1['extensions'][_0x2737('0xf')]({'type':_0x440bfa[_0x5a9ed1][0x0][_0x2737('0x10')],'app':_0x2737('0x11'),'appdata':'CDR(routeid)='+_0x440bfa[_0x5a9ed1][0x0][_0x2737('0x15')],'context':_0x440bfa[_0x5a9ed1][0x0][_0x2737('0x14')],'exten':_0x440bfa[_0x5a9ed1][0x0][_0x2737('0x8')],'priority':_0x15fbf1['priority']++,'VoiceExtensionId':_0x440bfa[_0x5a9ed1][0x0][_0x2737('0x15')]});}else if(_0x440bfa[_0x5a9ed1][0x0]['type']===_0x2737('0x17')){if(_0x15fbf1[_0x2737('0xd')]){_0x15fbf1[_0x2737('0xc')][_0x2737('0xf')]({'type':_0x440bfa[_0x5a9ed1][0x0][_0x2737('0x10')],'app':_0x2737('0x11'),'appdata':'CDR(destination)='+(_0x15fbf1['extension']['cutdigits']?_0x2737('0x18')+_0x15fbf1[_0x2737('0xd')][_0x2737('0x19')]+'}':_0x2737('0x1a')),'context':_0x440bfa[_0x5a9ed1][0x0][_0x2737('0x14')],'exten':_0x440bfa[_0x5a9ed1][0x0]['exten'],'priority':_0x15fbf1[_0x2737('0xb')]++,'VoiceExtensionId':_0x440bfa[_0x5a9ed1][0x0]['VoiceExtensionId']});}_0x15fbf1[_0x2737('0xc')]['push']({'type':_0x440bfa[_0x5a9ed1][0x0]['type'],'app':_0x2737('0x11'),'appdata':_0x2737('0x1b')+_0x440bfa[_0x5a9ed1][0x0]['VoiceExtensionId'],'context':_0x440bfa[_0x5a9ed1][0x0][_0x2737('0x14')],'exten':_0x440bfa[_0x5a9ed1][0x0]['exten'],'priority':_0x15fbf1[_0x2737('0xb')]++,'VoiceExtensionId':_0x440bfa[_0x5a9ed1][0x0]['VoiceExtensionId']});var _0x374ccc=_0x15fbf1[_0x2737('0xb')]++;_0x15fbf1['extensions'][_0x2737('0xf')]({'type':_0x440bfa[_0x5a9ed1][0x0][_0x2737('0x10')],'app':_0x2737('0x1c'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x374ccc+0x2)+'):Goto('+(_0x374ccc+0x1)+')','context':_0x440bfa[_0x5a9ed1][0x0][_0x2737('0x14')],'exten':_0x440bfa[_0x5a9ed1][0x0][_0x2737('0x8')],'priority':_0x374ccc,'VoiceExtensionId':_0x440bfa[_0x5a9ed1][0x0][_0x2737('0x15')]});if(_0x15fbf1[_0x2737('0xd')]){_0x15fbf1[_0x2737('0xc')][_0x2737('0xf')]({'type':_0x440bfa[_0x5a9ed1][0x0][_0x2737('0x10')],'app':_0x2737('0x11'),'appdata':_0x15fbf1[_0x2737('0xd')][_0x2737('0x19')]?_0x2737('0x1d')+_0x15fbf1[_0x2737('0xd')][_0x2737('0x19')]+'}':_0x2737('0x1e'),'context':_0x440bfa[_0x5a9ed1][0x0][_0x2737('0x14')],'exten':_0x440bfa[_0x5a9ed1][0x0]['exten'],'priority':_0x15fbf1[_0x2737('0xb')]++,'VoiceExtensionId':_0x440bfa[_0x5a9ed1][0x0]['VoiceExtensionId']});}_0x15fbf1[_0x2737('0xc')][_0x2737('0xf')]({'type':_0x440bfa[_0x5a9ed1][0x0][_0x2737('0x10')],'app':_0x2737('0x11'),'appdata':_0x2737('0x1f')+_0x440bfa[_0x5a9ed1][0x0][_0x2737('0x15')],'context':_0x440bfa[_0x5a9ed1][0x0][_0x2737('0x14')],'exten':_0x440bfa[_0x5a9ed1][0x0]['exten'],'priority':_0x15fbf1[_0x2737('0xb')]++,'VoiceExtensionId':_0x440bfa[_0x5a9ed1][0x0][_0x2737('0x15')]});if(_0x15fbf1[_0x2737('0xd')]&&_0x15fbf1[_0x2737('0xd')][_0x2737('0xa')](_0x2737('0x20'))&&_0x15fbf1[_0x2737('0xd')][_0x2737('0x20')]!==_0x2737('0x21')){_0x15fbf1[_0x2737('0xc')]['push']({'type':_0x440bfa[_0x5a9ed1][0x0][_0x2737('0x10')],'app':'Set','appdata':_0x2737('0x22'),'context':_0x440bfa[_0x5a9ed1][0x0][_0x2737('0x14')],'exten':_0x440bfa[_0x5a9ed1][0x0][_0x2737('0x8')],'priority':_0x15fbf1['priority']++,'VoiceExtensionId':_0x440bfa[_0x5a9ed1][0x0][_0x2737('0x15')]});_0x15fbf1[_0x2737('0xc')]['push']({'type':_0x440bfa[_0x5a9ed1][0x0][_0x2737('0x10')],'app':_0x2737('0x11'),'appdata':_0x2737('0x23')+_0x15fbf1[_0x2737('0xd')][_0x2737('0x20')]||_0x2737('0x24'),'context':_0x440bfa[_0x5a9ed1][0x0]['context'],'exten':_0x440bfa[_0x5a9ed1][0x0]['exten'],'priority':_0x15fbf1[_0x2737('0xb')]++,'VoiceExtensionId':_0x440bfa[_0x5a9ed1][0x0][_0x2737('0x15')]});}}_0x15fbf1[_0x2737('0xc')][_0x2737('0xf')]({'type':_0x440bfa[_0x5a9ed1][0x0][_0x2737('0x10')],'app':_0x2737('0x11'),'appdata':_0x2737('0x25'),'context':_0x440bfa[_0x5a9ed1][0x0][_0x2737('0x14')],'exten':_0x440bfa[_0x5a9ed1][0x0][_0x2737('0x8')],'priority':_0x15fbf1['priority']++,'VoiceExtensionId':_0x440bfa[_0x5a9ed1][0x0][_0x2737('0x15')]});_0x15fbf1[_0x2737('0xc')][_0x2737('0xf')]({'type':_0x440bfa[_0x5a9ed1][0x0][_0x2737('0x10')],'app':_0x2737('0x11'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x440bfa[_0x5a9ed1][0x0][_0x2737('0x14')],'exten':_0x440bfa[_0x5a9ed1][0x0][_0x2737('0x8')],'priority':_0x15fbf1[_0x2737('0xb')]++,'VoiceExtensionId':_0x440bfa[_0x5a9ed1][0x0][_0x2737('0x15')]});_0x15fbf1['extensions'][_0x2737('0xf')]({'type':_0x440bfa[_0x5a9ed1][0x0][_0x2737('0x10')],'app':_0x2737('0x11'),'appdata':_0x2737('0x26'),'context':_0x440bfa[_0x5a9ed1][0x0]['context'],'exten':_0x440bfa[_0x5a9ed1][0x0][_0x2737('0x8')],'priority':_0x15fbf1[_0x2737('0xb')]++,'VoiceExtensionId':_0x440bfa[_0x5a9ed1][0x0][_0x2737('0x15')]});for(var _0x48f895=0x0,_0x122e47=0x0;_0x48f895<_0x440bfa[_0x5a9ed1][_0x2737('0x27')];_0x48f895+=0x1,_0x122e47=0x0){var _0x364e0a=_0x440bfa[_0x5a9ed1][_0x48f895];if(_0x364e0a[_0x2737('0x10')]){_0x364e0a[_0x2737('0x10')]=_0x364e0a['type'][_0x2737('0x28')]();}var _0x2d9ec0=[];var _0x5e2a6c=[];delete _0x364e0a['id'];delete _0x364e0a['createdAt'];delete _0x364e0a[_0x2737('0x29')];var _0x502364=_0x364e0a[_0x2737('0x2a')]!==_0x2737('0x2b')?[_0x364e0a['interval']]:_0x364e0a[_0x2737('0x2c')]?_[_0x2737('0x2d')](_[_0x2737('0x2e')](_0x15fbf1['intervals'],{'IntervalId':_0x364e0a[_0x2737('0x2c')]}),_0x2737('0x2a')):[];if(_0x364e0a['hasOwnProperty'](_0x2737('0x2f'))){if(_0x364e0a[_0x2737('0x2f')]&&_0x364e0a[_0x2737('0x2f')]!=='--'){_0x2d9ec0[_0x2737('0xf')]({'type':_0x364e0a['type'],'app':_0x2737('0x11'),'appdata':_0x2737('0x30')+_0x364e0a[_0x2737('0x2f')],'context':_0x364e0a['context'],'exten':_0x364e0a[_0x2737('0x8')],'priority':_0x502364['length']+_0x15fbf1[_0x2737('0xb')]+_0x122e47++,'VoiceExtensionId':_0x364e0a[_0x2737('0x15')]});}}if(_0x364e0a['type']==='outbound'&&_0x364e0a['hasOwnProperty'](_0x2737('0x31'))){if(_0x364e0a['callerID']){_0x2d9ec0[_0x2737('0xf')]({'type':_0x364e0a[_0x2737('0x10')],'app':_0x2737('0x1c'),'appdata':_0x2737('0x32')+_0x364e0a[_0x2737('0x31')]+')','context':_0x364e0a[_0x2737('0x14')],'exten':_0x364e0a[_0x2737('0x8')],'priority':_0x502364[_0x2737('0x27')]+_0x15fbf1['priority']+_0x122e47++,'VoiceExtensionId':_0x364e0a['VoiceExtensionId']});}else{_0x2d9ec0[_0x2737('0xf')]({'type':_0x364e0a[_0x2737('0x10')],'app':_0x2737('0x1c'),'appdata':_0x2737('0x33'),'context':_0x364e0a[_0x2737('0x14')],'exten':_0x364e0a[_0x2737('0x8')],'priority':_0x502364[_0x2737('0x27')]+_0x15fbf1[_0x2737('0xb')]+_0x122e47++,'VoiceExtensionId':_0x364e0a[_0x2737('0x15')]});}}if(_0x364e0a[_0x2737('0xa')](_0x2737('0x34'))){if(_0xdcf528[_0x2737('0x35')](_0x364e0a['app'][_0x2737('0x28')]())>=0x0&&_0x364e0a[_0x2737('0x36')]!=='custom'){if(_0x364e0a[_0x2737('0x34')]){_0x2d9ec0['push']({'type':_0x364e0a[_0x2737('0x10')],'app':_0x2737('0x1c'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x364e0a[_0x2737('0x14')],'exten':_0x364e0a['exten'],'priority':_0x502364[_0x2737('0x27')]+_0x15fbf1[_0x2737('0xb')]+_0x122e47++,'VoiceExtensionId':_0x364e0a[_0x2737('0x15')]});_0x2d9ec0[_0x2737('0xf')]({'type':_0x364e0a[_0x2737('0x10')],'app':'Set','appdata':_0x2737('0x37'),'context':_0x364e0a[_0x2737('0x14')],'exten':_0x364e0a[_0x2737('0x8')],'priority':_0x502364[_0x2737('0x27')]+_0x15fbf1[_0x2737('0xb')]+_0x122e47++,'VoiceExtensionId':_0x364e0a[_0x2737('0x15')]});}else{_0x2d9ec0[_0x2737('0xf')]({'type':_0x364e0a[_0x2737('0x10')],'app':_0x2737('0x1c'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x364e0a[_0x2737('0x14')],'exten':_0x364e0a[_0x2737('0x8')],'priority':_0x502364[_0x2737('0x27')]+_0x15fbf1['priority']+_0x122e47++,'VoiceExtensionId':_0x364e0a[_0x2737('0x15')]});_0x2d9ec0[_0x2737('0xf')]({'type':_0x364e0a[_0x2737('0x10')],'app':_0x2737('0x11'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x364e0a[_0x2737('0x14')],'exten':_0x364e0a[_0x2737('0x8')],'priority':_0x502364[_0x2737('0x27')]+_0x15fbf1['priority']+_0x122e47++,'VoiceExtensionId':_0x364e0a[_0x2737('0x15')]});}}}for(var _0x1ff1fd=0x0;_0x1ff1fd<_0x502364[_0x2737('0x27')];_0x1ff1fd+=0x1){var _0x5c0b21=_0x15fbf1[_0x2737('0xb')]+_0x502364[_0x2737('0x27')];var _0x73bbf1=_0x1ff1fd===_0x502364[_0x2737('0x27')]-0x1?_0x15fbf1[_0x2737('0xb')]+_0x2d9ec0['length']+_0x5e2a6c[_0x2737('0x27')]+0x2:_0x15fbf1['priority']+_0x1ff1fd+0x1;_0x2d9ec0[_0x2737('0x38')](_0x1ff1fd,0x0,{'type':_0x364e0a[_0x2737('0x10')],'app':'GotoIfTime','appdata':_0x502364[_0x1ff1fd]+'?'+_0x364e0a[_0x2737('0x14')]+_0x2737('0x39')+_0x5c0b21+':'+_0x364e0a['context']+_0x2737('0x39')+_0x73bbf1,'exten':_0x364e0a[_0x2737('0x8')],'context':_0x364e0a[_0x2737('0x14')],'priority':_0x15fbf1[_0x2737('0xb')]+_0x1ff1fd,'VoiceExtensionId':_0x440bfa[_0x5a9ed1][0x0][_0x2737('0x15')]});}_0x364e0a[_0x2737('0xb')]=_0x2d9ec0[_0x2737('0x27')]?_[_0x2737('0x3a')](_0x2d9ec0)[_0x2737('0xb')]+0x1:_0x15fbf1[_0x2737('0xb')];_0x15fbf1[_0x2737('0xb')]=(_0x5e2a6c[_0x2737('0x27')]?_[_0x2737('0x3a')](_0x5e2a6c)[_0x2737('0xb')]:_0x364e0a[_0x2737('0xb')])+0x1;_0x15fbf1[_0x2737('0xc')]=_[_0x2737('0x3b')](_0x15fbf1[_0x2737('0xc')],_0x2d9ec0,[_0x364e0a],_0x5e2a6c);}_0x15fbf1['extensions']['push']({'type':_0x440bfa[_0x5a9ed1][0x0][_0x2737('0x10')],'app':_0x2737('0x3c'),'exten':_0x440bfa[_0x5a9ed1][0x0]['exten'],'context':_0x440bfa[_0x5a9ed1][0x0][_0x2737('0x14')],'priority':_0x15fbf1['priority'],'VoiceExtensionId':_0x440bfa[_0x5a9ed1][0x0]['VoiceExtensionId']});_0x117a5e[_0x2737('0xf')](_0x440bfa[_0x5a9ed1][0x0]['VoiceExtensionId']);_0x2d85f0=_[_0x2737('0x3b')](_0x2d85f0,_0x15fbf1[_0x2737('0xc')]);}}return _0x45e7e3[_0x2737('0x3d')](function(_0x4bfd73){return _0x45e7e3['models']['VoiceExtension'][_0x2737('0x3e')]({'where':{'VoiceExtensionId':{'$in':_0x117a5e}},'transaction':_0x4bfd73})[_0x2737('0x4')](function(_0x36afc0){return _0x45e7e3[_0x2737('0x1')][_0x2737('0x6')]['bulkCreate'](_[_0x2737('0x3f')](_0x2d85f0,_0x2737('0xb')),{'transaction':_0x4bfd73});});});})[_0x2737('0x40')](function(_0x44c205){console['error'](_0x44c205);});}exports[_0x2737('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 8c54291..34235a3 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 _0x0608=['outbound','dialCheckDuplicateType','CmList','Lists','always','sequelize','query','VoiceQueueId','onlyIfOpen','catch','all','Campaign','get','CampaignId','BlackLists','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','emit','contact:csv_','resume','resolve','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','createReadStream','pause','info','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','stringify','bluebird','util','lodash','squel','papaparse','../../../mysqldb','../../../config/environment','api','defaults','localhost','socket.io-emitter','redis','../../../api/cmContact/cmContact.socket','register','argv','undefined','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','null','Missing\x20socket_timestamp\x20parameter!','error','contact','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','message','join','data','firstName','firstName\x20not\x20specified!','phone','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','then','push','Error\x20while\x20creating\x20contact:\x20','checkHopper','inspect','insert','into','scheduledAt','createdAt','updatedAt','select','field','NOW()','toString','cm_contacts','where','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper','\x20=\x20?','ContactId','ListId\x20=\x20?','id\x20IN\x20?','str','from','cm_hopper_final','fromQuery','cm_hopper_black','VoiceQueue','findAll'];(function(_0x43c005,_0x1e97a4){var _0x4ea412=function(_0x3466ef){while(--_0x3466ef){_0x43c005['push'](_0x43c005['shift']());}};_0x4ea412(++_0x1e97a4);}(_0x0608,0x1e5));var _0x8060=function(_0x3c0a7e,_0x3e14ec){_0x3c0a7e=_0x3c0a7e-0x0;var _0x64f13b=_0x0608[_0x3c0a7e];return _0x64f13b;};'use strict';var BPromise=require(_0x8060('0x0'));var util=require(_0x8060('0x1'));var _=require(_0x8060('0x2'));var fs=require('fs');var squel=require(_0x8060('0x3'));var Papa=require(_0x8060('0x4'));var Redis=require('ioredis');var db=require(_0x8060('0x5'))['db'];var config=require(_0x8060('0x6'));var logger=require('../../../config/logger')(_0x8060('0x7'));config['redis']=_[_0x8060('0x8')](config['redis'],{'host':_0x8060('0x9'),'port':0x18eb});var socket=require(_0x8060('0xa'))(new Redis(config[_0x8060('0xb')]));require(_0x8060('0xc'))[_0x8060('0xd')](socket);try{if(!process[_0x8060('0xe')][0x2]||process[_0x8060('0xe')][0x2]===_0x8060('0xf')||process[_0x8060('0xe')][0x2]==='null'){throw new Error(_0x8060('0x10'));}var FILEPATH=process[_0x8060('0xe')][0x2];if(!process['argv'][0x3]||process[_0x8060('0xe')][0x3]===_0x8060('0xf')||process[_0x8060('0xe')][0x3]==='null'||!process[_0x8060('0xe')][0x4]||process[_0x8060('0xe')][0x4]===_0x8060('0xf')||process[_0x8060('0xe')][0x4]==='null'){throw new Error(_0x8060('0x11'));}var FIELDS=_[_0x8060('0x12')](process[_0x8060('0xe')][0x3][_0x8060('0x13')](','),process[_0x8060('0xe')][0x4]['split'](','));if(!process['argv'][0x5]||process['argv'][0x5]===_0x8060('0xf')||process[_0x8060('0xe')][0x5]==='null'){throw new Error(_0x8060('0x14'));}var LISTID=process[_0x8060('0xe')][0x5];var COMPANYID=process['argv'][0x6]&&process[_0x8060('0xe')][0x6]!==_0x8060('0xf')&&process[_0x8060('0xe')][0x6]!==_0x8060('0x15')?process[_0x8060('0xe')][0x6]:null;var DUPLICATES=process[_0x8060('0xe')][0x7]&&process[_0x8060('0xe')][0x7]!==_0x8060('0xf')&&process[_0x8060('0xe')][0x7]!=='null'?process[_0x8060('0xe')][0x7]:null;if(!process[_0x8060('0xe')][0x8]||process[_0x8060('0xe')][0x8]==='undefined'||process['argv'][0x8]===_0x8060('0x15')){throw new Error(_0x8060('0x16'));}var SOCKET_TIMESTAMP=process[_0x8060('0xe')][0x8];}catch(_0x5cf441){logger[_0x8060('0x17')](_0x5cf441);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(_0x56e363,_0x3db53e,_0x5aed01,_0x33ff0c){var _0x20a314={'message':_0x3db53e};_0x20a314[_0x56e363]=!![];if(_0x5aed01){_0x20a314[_0x8060('0x18')]=_0x5aed01;}if(_0x33ff0c){_0x20a314['index']=_0x33ff0c;}return _0x20a314;}function isEmail(_0x1f7841){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))*$/[_0x8060('0x19')](_0x1f7841);}function checkRow(_0x133eac,_0x39af2d,_0x55e4e3){return new BPromise(function(_0x366304,_0x1e14d7){if(_[_0x8060('0x1a')](_0x133eac)){return _0x1e14d7(handleCheckRowError(_0x8060('0x17'),_0x8060('0x1b'),null,_0x55e4e3));}if(_0x133eac[_0x8060('0x1c')]&&_0x133eac[_0x8060('0x1c')][_0x8060('0x1d')]){var _0x1d7c38=_[_0x8060('0x1e')](_0x133eac[_0x8060('0x1c')],_0x8060('0x1f'))[_0x8060('0x20')](';');return _0x1e14d7(handleCheckRowError(_0x8060('0x17'),_0x1d7c38,null,_0x55e4e3));}var _0x450934={};for(var _0x4bad6a in FIELDS){if(FIELDS['hasOwnProperty'](_0x4bad6a)&&FIELDS[_0x4bad6a]){_0x450934[_0x4bad6a]=_0x133eac[_0x8060('0x21')][0x0][FIELDS[_0x4bad6a]]||_0x133eac['data'][0x0]['\ufeff'+FIELDS[_0x4bad6a]];}}if(!_0x450934[_0x8060('0x22')]){return _0x1e14d7(handleCheckRowError('error',_0x8060('0x23'),null,_0x55e4e3));}if(!_0x450934[_0x8060('0x24')]){return _0x1e14d7(handleCheckRowError(_0x8060('0x17'),_0x8060('0x25'),null,_0x55e4e3));}if(_0x450934[_0x8060('0x26')]){var _0x1cd8df=moment(_0x450934[_0x8060('0x26')],_0x8060('0x27'));if(!_0x1cd8df[_0x8060('0x28')]()){return _0x1e14d7(handleCheckRowError(_0x8060('0x17'),_0x8060('0x29'),null,_0x55e4e3));}}if(_0x450934[_0x8060('0x2a')]){if(!isEmail(_0x450934[_0x8060('0x2a')])){return _0x1e14d7(handleCheckRowError(_0x8060('0x17'),_0x8060('0x2b'),null,_0x55e4e3));}}_0x450934[_0x8060('0x2c')]=LISTID;_0x450934[_0x8060('0x2d')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES['length']&&_0x39af2d){var _0x29e82d={};for(var _0x5d0bb8=0x0,_0x28a14e=DUPLICATES['length'];_0x5d0bb8<_0x28a14e;_0x5d0bb8+=0x1){_0x29e82d[DUPLICATES[_0x5d0bb8]]=_0x450934[DUPLICATES[_0x5d0bb8]];}var _0x30fda4=_['find'](_0x39af2d,_0x29e82d);if(_0x30fda4){return _0x1e14d7(handleCheckRowError(_0x8060('0x2e'),_0x8060('0x2f'),_0x30fda4,_0x55e4e3));}}return db[_0x8060('0x30')]['create'](_0x450934,{'raw':!![],'hooks':![],'fields':_['keys'](_0x450934)})[_0x8060('0x31')](function(_0x209b3f){if(DUPLICATES&&DUPLICATES[_0x8060('0x1d')]&&_0x39af2d){_0x39af2d[_0x8060('0x32')](_['pick'](_0x450934,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x209b3f['id'];return _0x366304();})['catch'](function(_0x5a015a){return _0x1e14d7(handleCheckRowError(_0x8060('0x17'),_0x8060('0x33')+(_0x5a015a[_0x8060('0x1f')]||JSON['stringify'](_0x5a015a)),null,_0x55e4e3));});});}function checkHopper(){function _0x154dd2(){return function(_0x532a70){logger[_0x8060('0x17')]('cmContact',_0x8060('0x34'),util[_0x8060('0x35')](_0x532a70,{'showHidden':![],'depth':null}));};}var _0x2dfbfb=function(_0x134c38,_0x4c718c){var _0x17c693=squel[_0x8060('0x36')]()[_0x8060('0x37')]('cm_hopper')['fromQuery']([_0x8060('0x24'),_0x8060('0x38'),'ContactId',_0x8060('0x2c'),_0x4c718c,_0x8060('0x39'),_0x8060('0x3a')],squel[_0x8060('0x3b')]()[_0x8060('0x3c')]('phone','phone')[_0x8060('0x3c')](_0x8060('0x3d'),_0x8060('0x38'))[_0x8060('0x3c')]('id','ContactId')[_0x8060('0x3c')](LISTID['toString'](),'ListId')['field'](_0x134c38['id'][_0x8060('0x3e')](),_0x4c718c)[_0x8060('0x3c')](_0x8060('0x3d'),_0x8060('0x39'))[_0x8060('0x3c')]('NOW()',_0x8060('0x3a'))['from'](_0x8060('0x3f'))[_0x8060('0x40')](_0x8060('0x41'))['where']('ListId\x20=\x20?',LISTID[_0x8060('0x3e')]())[_0x8060('0x40')](_0x8060('0x42'))['where'](_0x8060('0x43'),squel[_0x8060('0x3b')]()[_0x8060('0x3c')](_0x8060('0x24'))['from'](_0x8060('0x44'))[_0x8060('0x40')](_0x4c718c+_0x8060('0x45'),_0x134c38['id'][_0x8060('0x3e')]())))[_0x8060('0x3e')]();return _0x17c693;};var _0x2dbb38=function(_0x33be1b,_0x3519b7){var _0x2232da=squel['insert']()[_0x8060('0x37')](_0x8060('0x44'))['fromQuery']([_0x8060('0x24'),'scheduledAt',_0x8060('0x46'),_0x8060('0x2c'),_0x3519b7,_0x8060('0x39'),_0x8060('0x3a')],squel['select']()[_0x8060('0x3c')](_0x8060('0x24'),_0x8060('0x24'))[_0x8060('0x3c')]('NOW()','scheduledAt')[_0x8060('0x3c')]('id',_0x8060('0x46'))[_0x8060('0x3c')](LISTID[_0x8060('0x3e')](),_0x8060('0x2c'))['field'](_0x33be1b['id'][_0x8060('0x3e')](),_0x3519b7)['field'](_0x8060('0x3d'),_0x8060('0x39'))[_0x8060('0x3c')](_0x8060('0x3d'),_0x8060('0x3a'))['from'](_0x8060('0x3f'))[_0x8060('0x40')](_0x8060('0x41'))['where'](_0x8060('0x47'),LISTID['toString']())[_0x8060('0x40')](_0x8060('0x48'),squel[_0x8060('0x49')](hopperContacts))[_0x8060('0x40')](_0x8060('0x42'))['where'](_0x8060('0x43'),squel[_0x8060('0x3b')]()['field']('calleridnum')[_0x8060('0x4a')](_0x8060('0x4b'))['where'](_0x3519b7+_0x8060('0x45'),_0x33be1b['id'][_0x8060('0x3e')]()))[_0x8060('0x40')](_0x8060('0x43'),squel[_0x8060('0x3b')]()[_0x8060('0x3c')](_0x8060('0x24'))[_0x8060('0x4a')](_0x8060('0x44'))[_0x8060('0x40')](_0x3519b7+_0x8060('0x45'),_0x33be1b['id'][_0x8060('0x3e')]())))[_0x8060('0x3e')]();return _0x2232da;};function _0x5f272a(_0x459e2f,_0x2321a7){var _0xb69ca=squel[_0x8060('0x36')]()[_0x8060('0x37')]('cm_hopper')[_0x8060('0x4c')](['phone',_0x8060('0x38'),'ContactId',_0x8060('0x2c'),_0x2321a7,_0x8060('0x39'),_0x8060('0x3a')],squel[_0x8060('0x3b')]()[_0x8060('0x3c')](_0x8060('0x24'),'phone')['field'](_0x8060('0x3d'),_0x8060('0x38'))[_0x8060('0x3c')]('id',_0x8060('0x46'))[_0x8060('0x3c')](LISTID[_0x8060('0x3e')](),_0x8060('0x2c'))[_0x8060('0x3c')](_0x459e2f['id'][_0x8060('0x3e')](),_0x2321a7)['field'](_0x8060('0x3d'),'createdAt')[_0x8060('0x3c')](_0x8060('0x3d'),'updatedAt')['from'](_0x8060('0x3f'))['where'](_0x8060('0x41'))['where'](_0x8060('0x47'),LISTID[_0x8060('0x3e')]())[_0x8060('0x40')](_0x8060('0x48'),squel[_0x8060('0x49')](hopperContacts))['where']('phone\x20IS\x20NOT\x20NULL'))[_0x8060('0x3e')]();return _0xb69ca;}function _0x1ae885(_0x40938f,_0x1ce7f5){var _0x1dc58c=squel['insert']()[_0x8060('0x37')](_0x8060('0x4d'))[_0x8060('0x4c')]([_0x8060('0x24'),_0x8060('0x46'),_0x8060('0x2c'),_0x1ce7f5,_0x8060('0x39'),'updatedAt'],squel[_0x8060('0x3b')]()[_0x8060('0x3c')](_0x8060('0x24'),_0x8060('0x24'))[_0x8060('0x3c')]('id',_0x8060('0x46'))[_0x8060('0x3c')](LISTID[_0x8060('0x3e')](),'ListId')[_0x8060('0x3c')](_0x40938f['id'][_0x8060('0x3e')](),_0x1ce7f5)['field']('NOW()',_0x8060('0x39'))[_0x8060('0x3c')](_0x8060('0x3d'),_0x8060('0x3a'))[_0x8060('0x4a')](_0x8060('0x3f'))[_0x8060('0x40')]('deletedAt\x20IS\x20NULL')[_0x8060('0x40')]('ListId\x20=\x20?',LISTID[_0x8060('0x3e')]())[_0x8060('0x40')](_0x8060('0x48'),squel[_0x8060('0x49')](hopperContacts))['where'](_0x8060('0x42')))[_0x8060('0x3e')]();return _0x1dc58c;}return db[_0x8060('0x4e')][_0x8060('0x4f')]({'where':{'type':_0x8060('0x50')},'attributes':['id',_0x8060('0x51')],'include':[{'model':db[_0x8060('0x52')],'as':_0x8060('0x53'),'where':{'id':LISTID}}]})['then'](function(_0x9e599d){var _0x48c854=[];if(_0x9e599d){var _0x59fa96;for(var _0x151a5b=0x0,_0x9dfcba;_0x151a5b<_0x9e599d[_0x8060('0x1d')];_0x151a5b+=0x1){_0x9dfcba=_0x9e599d[_0x151a5b]['get']({'plain':!![]});switch(_0x9dfcba[_0x8060('0x51')]){case _0x8060('0x54'):_0x48c854[_0x8060('0x32')](db[_0x8060('0x55')][_0x8060('0x56')](_0x2dbb38(_0x9dfcba,_0x8060('0x57')))[_0x8060('0x31')](function(){})['catch'](_0x154dd2()));break;case _0x8060('0x58'):_0x48c854[_0x8060('0x32')](db[_0x8060('0x55')][_0x8060('0x56')](_0x2dfbfb(_0x9dfcba,_0x8060('0x57')))[_0x8060('0x31')](function(){})[_0x8060('0x59')](_0x154dd2()));break;default:_0x48c854['push'](db['sequelize'][_0x8060('0x56')](_0x5f272a(_0x9dfcba,_0x8060('0x57')))[_0x8060('0x31')](function(){})[_0x8060('0x59')](_0x154dd2()));}}}return _0x48c854;})[_0x8060('0x5a')]()[_0x8060('0x31')](function(){return db['VoiceQueue'][_0x8060('0x4f')]({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':db['CmList'],'as':'BlackLists','where':{'id':LISTID}}]})['then'](function(_0x545299){var _0x542311=[];if(_0x545299){var _0x224ff6;for(var _0x3793c7=0x0,_0x5aa945;_0x3793c7<_0x545299['length'];_0x3793c7+=0x1){_0x5aa945=_0x545299[_0x3793c7]['get']({'plain':!![]});_0x542311[_0x8060('0x32')](db[_0x8060('0x55')][_0x8060('0x56')](_0x1ae885(_0x5aa945,_0x8060('0x57')))[_0x8060('0x31')](function(){})[_0x8060('0x59')](_0x154dd2()));}}return _0x542311;})[_0x8060('0x5a')]();})['then'](function(){return db[_0x8060('0x5b')][_0x8060('0x4f')]({'attributes':['id',_0x8060('0x51')],'include':[{'model':db[_0x8060('0x52')],'as':_0x8060('0x53'),'where':{'id':LISTID}}]})[_0x8060('0x31')](function(_0x237e04){var _0x31d693=[];if(_0x237e04){for(var _0x4d1a46=0x0,_0x933a3a;_0x4d1a46<_0x237e04['length'];_0x4d1a46+=0x1){_0x933a3a=_0x237e04[_0x4d1a46][_0x8060('0x5c')]({'plain':!![]});switch(_0x933a3a['dialCheckDuplicateType']){case _0x8060('0x54'):_0x31d693[_0x8060('0x32')](db[_0x8060('0x55')][_0x8060('0x56')](_0x2dbb38(_0x933a3a,_0x8060('0x5d')))[_0x8060('0x31')](function(){})['catch'](_0x154dd2()));break;case _0x8060('0x58'):_0x31d693[_0x8060('0x32')](db[_0x8060('0x55')][_0x8060('0x56')](_0x2dfbfb(_0x933a3a,'CampaignId'))[_0x8060('0x31')](function(){})[_0x8060('0x59')](_0x154dd2()));break;default:_0x31d693[_0x8060('0x32')](db[_0x8060('0x55')][_0x8060('0x56')](_0x5f272a(_0x933a3a,_0x8060('0x5d')))[_0x8060('0x31')](function(){})[_0x8060('0x59')](_0x154dd2()));}}}return _0x31d693;})[_0x8060('0x5a')]();})['then'](function(){return db['Campaign'][_0x8060('0x4f')]({'attributes':['id'],'include':[{'model':db[_0x8060('0x52')],'as':_0x8060('0x5e'),'where':{'id':LISTID}}]})['then'](function(_0x5586e4){var _0x39b39b=[];if(_0x5586e4){for(var _0x52322b=0x0,_0x33c6a3;_0x52322b<_0x5586e4['length'];_0x52322b+=0x1){_0x33c6a3=_0x5586e4[_0x52322b][_0x8060('0x5c')]({'plain':!![]});_0x39b39b['push'](db[_0x8060('0x55')][_0x8060('0x56')](_0x1ae885(_0x33c6a3,'CampaignId'))[_0x8060('0x31')](function(){})['catch'](_0x154dd2()));}}return _0x39b39b;})[_0x8060('0x5a')]();})[_0x8060('0x59')](function(_0x2dcc91){logger[_0x8060('0x17')](_0x8060('0x5f'),_0x8060('0x60'),_0x2dcc91[_0x8060('0x1f')]);});}var processPromises=function(_0x495ea2){return BPromise[_0x8060('0x5a')](promises)[_0x8060('0x31')](function(_0x12cde5){})[_0x8060('0x59')](function(_0x2e7417){logger[_0x8060('0x17')](_0x8060('0x61'),JSON['stringify'](_0x2e7417));})[_0x8060('0x62')](function(){socket[_0x8060('0x63')](_0x8060('0x64')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x495ea2){return _0x495ea2[_0x8060('0x65')]();}});};var endCsv=function(){return BPromise[_0x8060('0x66')]()[_0x8060('0x31')](function(){if(hopperContacts){return checkHopper();}})[_0x8060('0x31')](function(){socket['emit']('contact:csv_'+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x8060('0x67')](FILEPATH);}catch(_0x41382d){logger[_0x8060('0x17')](_0x8060('0x68'),JSON['stringify'](_0x41382d));}finally{process[_0x8060('0x69')](0x0);}});};process['on'](_0x8060('0x6a'),function(){logger['info']('CSV\x20import\x20process\x20stopped!');endCsv();});function main(){return BPromise[_0x8060('0x66')]()['then'](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x8060('0x13')](',');return db[_0x8060('0x30')][_0x8060('0x4f')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x8060('0x31')](function(_0x3f6c68){var _0x16c5ce=fs[_0x8060('0x6b')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa['parse'](_0x16c5ce,{'header':!![],'skipEmptyLines':!![],'step':function(_0x1a9c84,_0x3f8dbc){total+=0x1;var _0x4e5be9=total;promises[_0x8060('0x32')](checkRow(_0x1a9c84,_0x3f6c68,_0x4e5be9)['then'](function(){success+=0x1;})['catch'](function(_0x163fc2){if(_0x163fc2[_0x8060('0x17')]){errors+=0x1;delete _0x163fc2[_0x8060('0x17')];}else if(_0x163fc2[_0x8060('0x2e')]){duplicates+=0x1;delete _0x163fc2[_0x8060('0x2e')];}rows[_0x8060('0x32')](_0x163fc2);}));if(total%0xc8===0x0){_0x3f8dbc[_0x8060('0x6c')]();return processPromises(_0x3f8dbc);}},'complete':function(){return processPromises()[_0x8060('0x31')](function(){logger[_0x8060('0x6d')](_0x8060('0x6e'));endCsv();});},'error':function(_0xb23f2b,_0x51a0bf){logger[_0x8060('0x6d')](_0x8060('0x6f'),JSON['stringify'](_0xb23f2b));endCsv();}});})[_0x8060('0x59')](function(_0x2f2337){logger[_0x8060('0x17')]('Error\x20executing\x20contact\x20csv\x20import:',JSON[_0x8060('0x70')](_0x2f2337));});}main(); \ No newline at end of file +var _0xd5da=['VoiceQueue','findAll','outbound','dialCheckDuplicateType','Lists','then','get','query','VoiceQueueId','onlyIfOpen','sequelize','all','CmList','Campaign','always','CampaignId','BlackLists','cmContact,\x20%s,\x20%s','Error\x20processing\x20rows\x20block:','finally','emit','contact:csv_','resume','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','resolve','createReadStream','parse','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','lodash','squel','papaparse','ioredis','../../../mysqldb','../../../config/environment','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','contact','index','test','isNil','error','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','hasOwnProperty','data','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','email','email\x20format\x20is\x20not\x20valid!','ListId','find','duplicate','CmContact','create','keys','push','catch','Error\x20while\x20creating\x20contact:\x20','message','stringify','checkHopper','inspect','cm_hopper','fromQuery','scheduledAt','ContactId','createdAt','select','field','NOW()','toString','updatedAt','from','cm_contacts','where','deletedAt\x20IS\x20NULL','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','into','str','phone\x20IS\x20NOT\x20NULL','calleridnum','cm_hopper_final','insert','ListId\x20=\x20?','id\x20IN\x20?','cm_hopper_black'];(function(_0x26462c,_0xd20a35){var _0x509a42=function(_0x1b22c9){while(--_0x1b22c9){_0x26462c['push'](_0x26462c['shift']());}};_0x509a42(++_0xd20a35);}(_0xd5da,0x172));var _0xad5d=function(_0x5c8092,_0x25120e){_0x5c8092=_0x5c8092-0x0;var _0x1dffd3=_0xd5da[_0x5c8092];return _0x1dffd3;};'use strict';var BPromise=require(_0xad5d('0x0'));var util=require('util');var _=require(_0xad5d('0x1'));var fs=require('fs');var squel=require(_0xad5d('0x2'));var Papa=require(_0xad5d('0x3'));var Redis=require(_0xad5d('0x4'));var db=require(_0xad5d('0x5'))['db'];var config=require(_0xad5d('0x6'));var logger=require('../../../config/logger')('api');config[_0xad5d('0x7')]=_[_0xad5d('0x8')](config['redis'],{'host':_0xad5d('0x9'),'port':0x18eb});var socket=require(_0xad5d('0xa'))(new Redis(config[_0xad5d('0x7')]));require(_0xad5d('0xb'))[_0xad5d('0xc')](socket);try{if(!process[_0xad5d('0xd')][0x2]||process[_0xad5d('0xd')][0x2]===_0xad5d('0xe')||process[_0xad5d('0xd')][0x2]===_0xad5d('0xf')){throw new Error(_0xad5d('0x10'));}var FILEPATH=process[_0xad5d('0xd')][0x2];if(!process[_0xad5d('0xd')][0x3]||process['argv'][0x3]===_0xad5d('0xe')||process[_0xad5d('0xd')][0x3]===_0xad5d('0xf')||!process[_0xad5d('0xd')][0x4]||process[_0xad5d('0xd')][0x4]===_0xad5d('0xe')||process[_0xad5d('0xd')][0x4]===_0xad5d('0xf')){throw new Error(_0xad5d('0x11'));}var FIELDS=_[_0xad5d('0x12')](process[_0xad5d('0xd')][0x3][_0xad5d('0x13')](','),process[_0xad5d('0xd')][0x4]['split'](','));if(!process[_0xad5d('0xd')][0x5]||process['argv'][0x5]===_0xad5d('0xe')||process[_0xad5d('0xd')][0x5]===_0xad5d('0xf')){throw new Error(_0xad5d('0x14'));}var LISTID=process[_0xad5d('0xd')][0x5];var COMPANYID=process['argv'][0x6]&&process[_0xad5d('0xd')][0x6]!=='undefined'&&process[_0xad5d('0xd')][0x6]!==_0xad5d('0xf')?process[_0xad5d('0xd')][0x6]:null;var DUPLICATES=process[_0xad5d('0xd')][0x7]&&process[_0xad5d('0xd')][0x7]!==_0xad5d('0xe')&&process[_0xad5d('0xd')][0x7]!==_0xad5d('0xf')?process[_0xad5d('0xd')][0x7]:null;if(!process[_0xad5d('0xd')][0x8]||process[_0xad5d('0xd')][0x8]===_0xad5d('0xe')||process[_0xad5d('0xd')][0x8]==='null'){throw new Error(_0xad5d('0x15'));}var SOCKET_TIMESTAMP=process[_0xad5d('0xd')][0x8];}catch(_0x1188fa){logger['error'](_0x1188fa);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(_0x155d4e,_0x388f53,_0x2eb09a,_0x4678d9){var _0x5a3dc0={'message':_0x388f53};_0x5a3dc0[_0x155d4e]=!![];if(_0x2eb09a){_0x5a3dc0[_0xad5d('0x16')]=_0x2eb09a;}if(_0x4678d9){_0x5a3dc0[_0xad5d('0x17')]=_0x4678d9;}return _0x5a3dc0;}function isEmail(_0x429629){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))*$/[_0xad5d('0x18')](_0x429629);}function checkRow(_0x215fa4,_0x425f0d,_0x5c90b9){return new BPromise(function(_0x5a7dc7,_0xc4054c){if(_[_0xad5d('0x19')](_0x215fa4)){return _0xc4054c(handleCheckRowError(_0xad5d('0x1a'),_0xad5d('0x1b'),null,_0x5c90b9));}if(_0x215fa4[_0xad5d('0x1c')]&&_0x215fa4['errors'][_0xad5d('0x1d')]){var _0x206266=_[_0xad5d('0x1e')](_0x215fa4['errors'],'message')['join'](';');return _0xc4054c(handleCheckRowError(_0xad5d('0x1a'),_0x206266,null,_0x5c90b9));}var _0x201526={};for(var _0x17279e in FIELDS){if(FIELDS[_0xad5d('0x1f')](_0x17279e)&&FIELDS[_0x17279e]){_0x201526[_0x17279e]=_0x215fa4[_0xad5d('0x20')][0x0][FIELDS[_0x17279e]]||_0x215fa4['data'][0x0]['\ufeff'+FIELDS[_0x17279e]];}}if(!_0x201526['firstName']){return _0xc4054c(handleCheckRowError('error','firstName\x20not\x20specified!',null,_0x5c90b9));}if(!_0x201526[_0xad5d('0x21')]){return _0xc4054c(handleCheckRowError(_0xad5d('0x1a'),_0xad5d('0x22'),null,_0x5c90b9));}if(_0x201526[_0xad5d('0x23')]){var _0x5d2b01=moment(_0x201526[_0xad5d('0x23')],_0xad5d('0x24'));if(!_0x5d2b01[_0xad5d('0x25')]()){return _0xc4054c(handleCheckRowError(_0xad5d('0x1a'),'birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!',null,_0x5c90b9));}}if(_0x201526[_0xad5d('0x26')]){if(!isEmail(_0x201526[_0xad5d('0x26')])){return _0xc4054c(handleCheckRowError(_0xad5d('0x1a'),_0xad5d('0x27'),null,_0x5c90b9));}}_0x201526[_0xad5d('0x28')]=LISTID;_0x201526['CompanyId']=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0xad5d('0x1d')]&&_0x425f0d){var _0xf11e65={};for(var _0x28179c=0x0,_0x4874e5=DUPLICATES[_0xad5d('0x1d')];_0x28179c<_0x4874e5;_0x28179c+=0x1){_0xf11e65[DUPLICATES[_0x28179c]]=_0x201526[DUPLICATES[_0x28179c]];}var _0x20960a=_[_0xad5d('0x29')](_0x425f0d,_0xf11e65);if(_0x20960a){return _0xc4054c(handleCheckRowError(_0xad5d('0x2a'),'Duplicate\x20Contact',_0x20960a,_0x5c90b9));}}return db[_0xad5d('0x2b')][_0xad5d('0x2c')](_0x201526,{'raw':!![],'hooks':![],'fields':_[_0xad5d('0x2d')](_0x201526)})['then'](function(_0x56674b){if(DUPLICATES&&DUPLICATES['length']&&_0x425f0d){_0x425f0d[_0xad5d('0x2e')](_['pick'](_0x201526,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x56674b['id'];return _0x5a7dc7();})[_0xad5d('0x2f')](function(_0x21f305){return _0xc4054c(handleCheckRowError('error',_0xad5d('0x30')+(_0x21f305[_0xad5d('0x31')]||JSON[_0xad5d('0x32')](_0x21f305)),null,_0x5c90b9));});});}function checkHopper(){function _0x4eb600(){return function(_0x5c88a2){logger[_0xad5d('0x1a')]('cmContact',_0xad5d('0x33'),util[_0xad5d('0x34')](_0x5c88a2,{'showHidden':![],'depth':null}));};}var _0x259bba=function(_0x1b7f50,_0x183b9b){var _0x45acf0=squel['insert']()['into'](_0xad5d('0x35'))[_0xad5d('0x36')](['phone',_0xad5d('0x37'),_0xad5d('0x38'),_0xad5d('0x28'),_0x183b9b,_0xad5d('0x39'),'updatedAt'],squel[_0xad5d('0x3a')]()[_0xad5d('0x3b')](_0xad5d('0x21'),'phone')[_0xad5d('0x3b')](_0xad5d('0x3c'),_0xad5d('0x37'))[_0xad5d('0x3b')]('id',_0xad5d('0x38'))['field'](LISTID[_0xad5d('0x3d')](),_0xad5d('0x28'))[_0xad5d('0x3b')](_0x1b7f50['id'][_0xad5d('0x3d')](),_0x183b9b)[_0xad5d('0x3b')](_0xad5d('0x3c'),_0xad5d('0x39'))[_0xad5d('0x3b')](_0xad5d('0x3c'),_0xad5d('0x3e'))[_0xad5d('0x3f')](_0xad5d('0x40'))[_0xad5d('0x41')](_0xad5d('0x42'))[_0xad5d('0x41')]('ListId\x20=\x20?',LISTID[_0xad5d('0x3d')]())['where']('phone\x20IS\x20NOT\x20NULL')['where'](_0xad5d('0x43'),squel[_0xad5d('0x3a')]()[_0xad5d('0x3b')]('phone')[_0xad5d('0x3f')](_0xad5d('0x35'))[_0xad5d('0x41')](_0x183b9b+_0xad5d('0x44'),_0x1b7f50['id'][_0xad5d('0x3d')]())))[_0xad5d('0x3d')]();return _0x45acf0;};var _0x2fbb88=function(_0x2fa0ba,_0x5d2c98){var _0x2b871d=squel['insert']()[_0xad5d('0x45')](_0xad5d('0x35'))['fromQuery']([_0xad5d('0x21'),'scheduledAt','ContactId',_0xad5d('0x28'),_0x5d2c98,_0xad5d('0x39'),'updatedAt'],squel['select']()[_0xad5d('0x3b')](_0xad5d('0x21'),_0xad5d('0x21'))[_0xad5d('0x3b')](_0xad5d('0x3c'),_0xad5d('0x37'))[_0xad5d('0x3b')]('id',_0xad5d('0x38'))['field'](LISTID[_0xad5d('0x3d')](),_0xad5d('0x28'))[_0xad5d('0x3b')](_0x2fa0ba['id'][_0xad5d('0x3d')](),_0x5d2c98)[_0xad5d('0x3b')](_0xad5d('0x3c'),_0xad5d('0x39'))['field'](_0xad5d('0x3c'),_0xad5d('0x3e'))[_0xad5d('0x3f')]('cm_contacts')['where'](_0xad5d('0x42'))['where']('ListId\x20=\x20?',LISTID['toString']())['where']('id\x20IN\x20?',squel[_0xad5d('0x46')](hopperContacts))[_0xad5d('0x41')](_0xad5d('0x47'))[_0xad5d('0x41')](_0xad5d('0x43'),squel[_0xad5d('0x3a')]()[_0xad5d('0x3b')](_0xad5d('0x48'))[_0xad5d('0x3f')](_0xad5d('0x49'))[_0xad5d('0x41')](_0x5d2c98+_0xad5d('0x44'),_0x2fa0ba['id'][_0xad5d('0x3d')]()))[_0xad5d('0x41')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0xad5d('0x3b')](_0xad5d('0x21'))['from'](_0xad5d('0x35'))[_0xad5d('0x41')](_0x5d2c98+_0xad5d('0x44'),_0x2fa0ba['id']['toString']())))[_0xad5d('0x3d')]();return _0x2b871d;};function _0x5f1985(_0x5a2263,_0x57e0e3){var _0x547f9f=squel[_0xad5d('0x4a')]()[_0xad5d('0x45')](_0xad5d('0x35'))[_0xad5d('0x36')]([_0xad5d('0x21'),_0xad5d('0x37'),'ContactId','ListId',_0x57e0e3,_0xad5d('0x39'),'updatedAt'],squel[_0xad5d('0x3a')]()['field']('phone',_0xad5d('0x21'))[_0xad5d('0x3b')](_0xad5d('0x3c'),_0xad5d('0x37'))[_0xad5d('0x3b')]('id',_0xad5d('0x38'))['field'](LISTID[_0xad5d('0x3d')](),_0xad5d('0x28'))[_0xad5d('0x3b')](_0x5a2263['id'][_0xad5d('0x3d')](),_0x57e0e3)['field'](_0xad5d('0x3c'),_0xad5d('0x39'))[_0xad5d('0x3b')](_0xad5d('0x3c'),_0xad5d('0x3e'))[_0xad5d('0x3f')](_0xad5d('0x40'))['where'](_0xad5d('0x42'))[_0xad5d('0x41')](_0xad5d('0x4b'),LISTID['toString']())[_0xad5d('0x41')](_0xad5d('0x4c'),squel[_0xad5d('0x46')](hopperContacts))['where'](_0xad5d('0x47')))['toString']();return _0x547f9f;}function _0x472ed7(_0x4a5c63,_0xdb5ffa){var _0x37bde7=squel[_0xad5d('0x4a')]()[_0xad5d('0x45')](_0xad5d('0x4d'))[_0xad5d('0x36')](['phone',_0xad5d('0x38'),_0xad5d('0x28'),_0xdb5ffa,_0xad5d('0x39'),_0xad5d('0x3e')],squel[_0xad5d('0x3a')]()[_0xad5d('0x3b')](_0xad5d('0x21'),'phone')[_0xad5d('0x3b')]('id',_0xad5d('0x38'))[_0xad5d('0x3b')](LISTID[_0xad5d('0x3d')](),_0xad5d('0x28'))[_0xad5d('0x3b')](_0x4a5c63['id'][_0xad5d('0x3d')](),_0xdb5ffa)[_0xad5d('0x3b')](_0xad5d('0x3c'),'createdAt')[_0xad5d('0x3b')]('NOW()',_0xad5d('0x3e'))['from'](_0xad5d('0x40'))['where'](_0xad5d('0x42'))[_0xad5d('0x41')](_0xad5d('0x4b'),LISTID[_0xad5d('0x3d')]())[_0xad5d('0x41')](_0xad5d('0x4c'),squel[_0xad5d('0x46')](hopperContacts))['where'](_0xad5d('0x47')))['toString']();return _0x37bde7;}return db[_0xad5d('0x4e')][_0xad5d('0x4f')]({'where':{'type':_0xad5d('0x50')},'attributes':['id',_0xad5d('0x51')],'include':[{'model':db['CmList'],'as':_0xad5d('0x52'),'where':{'id':LISTID}}]})[_0xad5d('0x53')](function(_0x5aa3a6){var _0x4f2012=[];if(_0x5aa3a6){var _0x37264a;for(var _0x5ca7a7=0x0,_0x23dc29;_0x5ca7a7<_0x5aa3a6[_0xad5d('0x1d')];_0x5ca7a7+=0x1){_0x23dc29=_0x5aa3a6[_0x5ca7a7][_0xad5d('0x54')]({'plain':!![]});switch(_0x23dc29[_0xad5d('0x51')]){case'always':_0x4f2012['push'](db['sequelize'][_0xad5d('0x55')](_0x2fbb88(_0x23dc29,_0xad5d('0x56')))[_0xad5d('0x53')](function(){})[_0xad5d('0x2f')](_0x4eb600()));break;case _0xad5d('0x57'):_0x4f2012[_0xad5d('0x2e')](db[_0xad5d('0x58')]['query'](_0x259bba(_0x23dc29,_0xad5d('0x56')))[_0xad5d('0x53')](function(){})[_0xad5d('0x2f')](_0x4eb600()));break;default:_0x4f2012[_0xad5d('0x2e')](db[_0xad5d('0x58')][_0xad5d('0x55')](_0x5f1985(_0x23dc29,_0xad5d('0x56')))[_0xad5d('0x53')](function(){})[_0xad5d('0x2f')](_0x4eb600()));}}}return _0x4f2012;})[_0xad5d('0x59')]()[_0xad5d('0x53')](function(){return db[_0xad5d('0x4e')][_0xad5d('0x4f')]({'where':{'type':_0xad5d('0x50')},'attributes':['id'],'include':[{'model':db[_0xad5d('0x5a')],'as':'BlackLists','where':{'id':LISTID}}]})['then'](function(_0x36934b){var _0x57f8b2=[];if(_0x36934b){var _0x48951a;for(var _0xe0775a=0x0,_0x562302;_0xe0775a<_0x36934b[_0xad5d('0x1d')];_0xe0775a+=0x1){_0x562302=_0x36934b[_0xe0775a][_0xad5d('0x54')]({'plain':!![]});_0x57f8b2[_0xad5d('0x2e')](db[_0xad5d('0x58')][_0xad5d('0x55')](_0x472ed7(_0x562302,_0xad5d('0x56')))['then'](function(){})[_0xad5d('0x2f')](_0x4eb600()));}}return _0x57f8b2;})[_0xad5d('0x59')]();})['then'](function(){return db[_0xad5d('0x5b')]['findAll']({'attributes':['id',_0xad5d('0x51')],'include':[{'model':db['CmList'],'as':'Lists','where':{'id':LISTID}}]})[_0xad5d('0x53')](function(_0x310ca2){var _0x3e5d57=[];if(_0x310ca2){for(var _0x4379d6=0x0,_0x4c8102;_0x4379d6<_0x310ca2[_0xad5d('0x1d')];_0x4379d6+=0x1){_0x4c8102=_0x310ca2[_0x4379d6][_0xad5d('0x54')]({'plain':!![]});switch(_0x4c8102[_0xad5d('0x51')]){case _0xad5d('0x5c'):_0x3e5d57['push'](db[_0xad5d('0x58')][_0xad5d('0x55')](_0x2fbb88(_0x4c8102,_0xad5d('0x5d')))[_0xad5d('0x53')](function(){})['catch'](_0x4eb600()));break;case _0xad5d('0x57'):_0x3e5d57[_0xad5d('0x2e')](db[_0xad5d('0x58')][_0xad5d('0x55')](_0x259bba(_0x4c8102,'CampaignId'))['then'](function(){})['catch'](_0x4eb600()));break;default:_0x3e5d57[_0xad5d('0x2e')](db['sequelize'][_0xad5d('0x55')](_0x5f1985(_0x4c8102,_0xad5d('0x5d')))[_0xad5d('0x53')](function(){})[_0xad5d('0x2f')](_0x4eb600()));}}}return _0x3e5d57;})[_0xad5d('0x59')]();})['then'](function(){return db['Campaign'][_0xad5d('0x4f')]({'attributes':['id'],'include':[{'model':db['CmList'],'as':_0xad5d('0x5e'),'where':{'id':LISTID}}]})[_0xad5d('0x53')](function(_0x48ff83){var _0x1f2e97=[];if(_0x48ff83){for(var _0x168382=0x0,_0x3c900d;_0x168382<_0x48ff83[_0xad5d('0x1d')];_0x168382+=0x1){_0x3c900d=_0x48ff83[_0x168382][_0xad5d('0x54')]({'plain':!![]});_0x1f2e97['push'](db['sequelize'][_0xad5d('0x55')](_0x472ed7(_0x3c900d,'CampaignId'))['then'](function(){})['catch'](_0x4eb600()));}}return _0x1f2e97;})[_0xad5d('0x59')]();})[_0xad5d('0x2f')](function(_0x50d7e1){logger[_0xad5d('0x1a')](_0xad5d('0x5f'),'generalCheckHopper',_0x50d7e1[_0xad5d('0x31')]);});}var processPromises=function(_0xb132ca){return BPromise['all'](promises)[_0xad5d('0x53')](function(_0x2932e5){})['catch'](function(_0x16c8b1){logger['error'](_0xad5d('0x60'),JSON[_0xad5d('0x32')](_0x16c8b1));})[_0xad5d('0x61')](function(){socket[_0xad5d('0x62')](_0xad5d('0x63')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0xb132ca){return _0xb132ca[_0xad5d('0x64')]();}});};var endCsv=function(){return BPromise['resolve']()[_0xad5d('0x53')](function(){if(hopperContacts){return checkHopper();}})[_0xad5d('0x53')](function(){socket[_0xad5d('0x62')](_0xad5d('0x63')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs['unlinkSync'](FILEPATH);}catch(_0x1d62c9){logger[_0xad5d('0x1a')](_0xad5d('0x65'),JSON[_0xad5d('0x32')](_0x1d62c9));}finally{process[_0xad5d('0x66')](0x0);}});};process['on'](_0xad5d('0x67'),function(){logger[_0xad5d('0x68')](_0xad5d('0x69'));endCsv();});function main(){return BPromise[_0xad5d('0x6a')]()['then'](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0xad5d('0x13')](',');return db['CmContact']['findAll']({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0xad5d('0x53')](function(_0x578347){var _0x4e5b6b=fs[_0xad5d('0x6b')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0xad5d('0x6c')](_0x4e5b6b,{'header':!![],'skipEmptyLines':!![],'step':function(_0x255b79,_0x1cd79d){total+=0x1;var _0x5cc859=total;promises[_0xad5d('0x2e')](checkRow(_0x255b79,_0x578347,_0x5cc859)[_0xad5d('0x53')](function(){success+=0x1;})['catch'](function(_0x30ac44){if(_0x30ac44[_0xad5d('0x1a')]){errors+=0x1;delete _0x30ac44['error'];}else if(_0x30ac44[_0xad5d('0x2a')]){duplicates+=0x1;delete _0x30ac44[_0xad5d('0x2a')];}rows[_0xad5d('0x2e')](_0x30ac44);}));if(total%0xc8===0x0){_0x1cd79d['pause']();return processPromises(_0x1cd79d);}},'complete':function(){return processPromises()[_0xad5d('0x53')](function(){logger[_0xad5d('0x68')](_0xad5d('0x6d'));endCsv();});},'error':function(_0x251f8b,_0x56560){logger['info'](_0xad5d('0x6e'),JSON[_0xad5d('0x32')](_0x251f8b));endCsv();}});})[_0xad5d('0x2f')](function(_0x233070){logger[_0xad5d('0x1a')](_0xad5d('0x6f'),JSON['stringify'](_0x233070));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index 3eb3d4c..6eb3d37 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 _0x40b9=['.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','join','cm_contacts.phone','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','scheduledat','ContactId','updatedAt','priority','UserId','recallme','cm_contacts','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22onlyIfOpen\x22','\x22always\x22','toString','cm_contacts.id','cm_hopper_black','ListId','createdAt','fields','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','ListId\x20=\x20?','\x20=\x20?','concat','keys',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','min_id','group','info','Received\x20SIGINT','error','message','exit','errors','push','code','sequelize','query','spread','catch','main','send','start','binding','root','server/files/tmp','header','parse','createReadStream','data','length','hasOwnProperty','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNumber','includes','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','SystemRow','appendFileSync','rows','emit','contact:import:','Abort\x20parser','abort','SystemError','step','duplicates','cm_contacts_','\x20LIKE\x20cm_contacts;','CompanyId','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','campaigns_has_cm_blacklists','CampaignId','each','then','finish','affectedRows','unlink','complete','argv','arguments\x20\x20\x20','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','path','lodash','papaparse','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/logger','import','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','phone','from'];(function(_0x35d483,_0x28b4a0){var _0x99edb7=function(_0x57ce32){while(--_0x57ce32){_0x35d483['push'](_0x35d483['shift']());}};_0x99edb7(++_0x28b4a0);}(_0x40b9,0x77));var _0x940b=function(_0xd70515,_0x50cfb3){_0xd70515=_0xd70515-0x0;var _0x1e9a3a=_0x40b9[_0xd70515];return _0x1e9a3a;};'use strict';var fs=require('fs');var path=require(_0x940b('0x0'));var _=require(_0x940b('0x1'));var Papa=require(_0x940b('0x2'));var util=require('util');var BPromise=require(_0x940b('0x3'));var moment=require(_0x940b('0x4'));var squel=require(_0x940b('0x5'));var Redis=require(_0x940b('0x6'));var db=require(_0x940b('0x7'))['db'];var config=require('../../../config/environment');var logger=require(_0x940b('0x8'))(_0x940b('0x9'));config[_0x940b('0xa')]=_[_0x940b('0xb')](config[_0x940b('0xa')],{'host':_0x940b('0xc'),'port':0x18eb});var socket=require(_0x940b('0xd'))(new Redis(config[_0x940b('0xa')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0x940b('0xe')](_0x940b('0xf'));function isEmail(_0x1c341f){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))*$/[_0x940b('0x10')](_0x1c341f);}function selectNotIn(_0x1e0f81,_0x468005,_0x371e43,_0x1e976d,_0x2bc58d){return squel[_0x940b('0x11')]()[_0x940b('0x12')](_0x940b('0x13'))[_0x940b('0x14')](_0x1e976d)['join'](_0x468005,null,_0x468005+_0x940b('0x15')+_0x1e976d+'.'+_0x371e43)[_0x940b('0x16')](_0x1e976d+'.'+_0x371e43+_0x940b('0x17')+_0x1e0f81+'.'+_0x371e43)['where'](_0x468005+_0x940b('0x18')+_0x2bc58d[_0x940b('0x19')]()+')');}function insertCmHopper(_0x29de00,_0x1646b2,_0x4b9de9,_0x2ab869,_0x3226fa){var _0x39463c=[_0x940b('0x1a'),'cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId',_0x1646b2+'.'+_0x2ab869,_0x940b('0x1b'),_0x940b('0x1c'),'cm_contacts.priority',_0x940b('0x1d'),'\x22'+_0x3226fa+'\x22'];return squel[_0x940b('0x1e')]()[_0x940b('0x1f')](_0x940b('0x20'))[_0x940b('0x21')]([_0x940b('0x13'),_0x940b('0x22'),_0x940b('0x23'),'ListId',_0x2ab869,'createdAt',_0x940b('0x24'),_0x940b('0x25'),_0x940b('0x26'),_0x940b('0x27')],squel['select']()['fields'](_0x39463c)[_0x940b('0x14')](_0x1646b2)['join'](_0x940b('0x28'),null,'cm_contacts.ListId\x20=\x20'+_0x1646b2+'.CmListId')[_0x940b('0x19')](_0x4b9de9,null,_0x4b9de9+_0x940b('0x15')+_0x1646b2+'.'+_0x2ab869)[_0x940b('0x16')](_0x1646b2+'.CmListId\x20=\x20?',_0x29de00)['where'](_0x940b('0x29'),NOW)[_0x940b('0x16')](_0x940b('0x2a'),selectNotIn(_0x1646b2,_0x4b9de9,_0x2ab869,_0x940b('0x20'),['\x22always\x22',_0x940b('0x2b')]))['where'](_0x940b('0x2a'),selectNotIn(_0x1646b2,_0x4b9de9,_0x2ab869,_0x940b('0x20'),[_0x940b('0x2c')])))[_0x940b('0x2d')]();}function insertCmHopperBlack(_0x6df26e,_0x395a1c,_0x1568ab,_0x135212){var _0x58ef6d=[_0x940b('0x1a'),_0x940b('0x2e'),'cm_contacts.ListId',_0x395a1c+'.'+_0x135212,_0x940b('0x1b'),_0x940b('0x1c')];return squel[_0x940b('0x1e')]()[_0x940b('0x1f')](_0x940b('0x2f'))[_0x940b('0x21')]([_0x940b('0x13'),_0x940b('0x23'),_0x940b('0x30'),_0x135212,_0x940b('0x31'),_0x940b('0x24')],squel[_0x940b('0x11')]()[_0x940b('0x32')](_0x58ef6d)[_0x940b('0x14')](_0x395a1c)[_0x940b('0x19')](_0x940b('0x28'),null,_0x940b('0x33')+_0x395a1c+_0x940b('0x34'))[_0x940b('0x19')](_0x1568ab,null,_0x1568ab+_0x940b('0x15')+_0x395a1c+'.'+_0x135212)[_0x940b('0x16')](_0x395a1c+_0x940b('0x35'),_0x6df26e)[_0x940b('0x16')](_0x940b('0x29'),NOW)[_0x940b('0x16')](_0x940b('0x2a'),squel[_0x940b('0x11')]()[_0x940b('0x12')](_0x940b('0x13'))[_0x940b('0x14')](_0x940b('0x2f'))[_0x940b('0x16')](_0x940b('0x36'),_0x6df26e)[_0x940b('0x16')](_0x135212+_0x940b('0x37'),_0x395a1c+'.'+_0x135212)))[_0x940b('0x2d')]();}function insertCmContact(_0x264fe4,_0x5b8ffd,_0x4eb588,_0x114ec6){var _0x58ad71=_[_0x940b('0x38')](_[_0x940b('0x39')](_0x114ec6),[_0x940b('0x30'),'CompanyId',_0x940b('0x31'),_0x940b('0x24')]);return squel[_0x940b('0x1e')]()[_0x940b('0x1f')](_0x940b('0x28'))[_0x940b('0x21')](_0x58ad71,squel[_0x940b('0x11')]()[_0x940b('0x32')](_0x58ad71)[_0x940b('0x14')](_0x5b8ffd)[_0x940b('0x16')]('('+_0x4eb588[_0x940b('0x19')](',')+_0x940b('0x3a'),squel[_0x940b('0x11')]()[_0x940b('0x32')](_0x4eb588)['from'](_0x940b('0x28'))['where'](_0x940b('0x36'),_0x264fe4)['where'](_0x940b('0x3b')))[_0x940b('0x16')]('id\x20IN\x20?',squel[_0x940b('0x11')]()['field']('MIN(id)',_0x940b('0x3c'))[_0x940b('0x14')](_0x5b8ffd)[_0x940b('0x3d')](_0x4eb588[_0x940b('0x19')](','))))[_0x940b('0x2d')]();}function handleStop(){logger[_0x940b('0x3e')](_0x940b('0x3f'));stopped=!![];}function handleUncaughtException(_0x3ef8f9){logger[_0x940b('0x40')](_0x3ef8f9[_0x940b('0x41')]);process[_0x940b('0x42')](0x1);}function handleError(_0x3407fa,_0x30255e){stats[_0x940b('0x43')][_0x940b('0x44')]({'name':_0x30255e[_0x940b('0x45')],'message':_0x30255e[_0x940b('0x41')],'row':_0x3407fa});}function handleQuery(_0xf9e08c){logger['info'](_0xf9e08c);return db[_0x940b('0x46')][_0x940b('0x47')](_0xf9e08c)[_0x940b('0x48')](function(_0x17dd31){results['push'](_0x17dd31);})[_0x940b('0x49')](function(_0x594303){logger[_0x940b('0x40')](_0x594303[_0x940b('0x41')]);});}function main(_0x211991,_0x4cfb4a,_0xc681f7,_0x51fd05){logger[_0x940b('0x3e')](_0x940b('0x4a'),_0x211991,JSON['stringify'](_0x4cfb4a));process[_0x940b('0x4b')](_0x940b('0x4c'));var _0x40042b=_0x4cfb4a[_0x940b('0x4d')];var _0x555755=_0x4cfb4a['socket_timestamp'];var _0x10337e=path[_0x940b('0x19')](config[_0x940b('0x4e')],_0x940b('0x4f'),_0x555755+'.csv');var _0x38317d=_[_0x940b('0x39')](_0x40042b)['join']();logger['info'](_0x940b('0x50'),_0x38317d);fs['writeFileSync'](_0x10337e,_0x38317d+'\x0a');Papa[_0x940b('0x51')](fs[_0x940b('0x52')](_0x211991),{'header':!![],'skipEmptyLines':!![],'step':function(_0x4ec004,_0xd0437b){try{for(var _0x2a6ce8=0x0,_0x36f0d3=[];_0x2a6ce8<_0x4ec004[_0x940b('0x53')][_0x940b('0x54')];_0x2a6ce8++){stats['rows']+=0x1;if(_0x4ec004[_0x940b('0x43')][_0x2a6ce8]){handleError(_0x4ec004[_0x940b('0x53')][_0x2a6ce8],_0x4ec004[_0x940b('0x43')][_0x2a6ce8]);}else{var _0x3de2af=[];for(var _0x511c23 in _0x40042b){if(_0x40042b[_0x940b('0x55')](_0x511c23)){if(_0x4ec004[_0x940b('0x53')][_0x2a6ce8][_0x40042b[_0x511c23]]){var _0x539ed4=_['trim'](_0x4ec004[_0x940b('0x53')][_0x2a6ce8][_0x40042b[_0x511c23]][_0x940b('0x56')](/"/g,'\x27'));switch(_0x511c23){case'scheduledat':var _0x1e479b=moment(_0x539ed4,_0x940b('0xf'),!![]);if(_0x1e479b[_0x940b('0x57')]()){_0x36f0d3['push']('\x22'+_0x539ed4+'\x22');}else{_0x3de2af['push'](_0x940b('0x58'));}break;case _0x940b('0x25'):var _0x48e610=parseInt(_0x539ed4);_0x539ed4=_['isNaN'](_0x48e610)||_0x48e610<0x0||_0x48e610>0x4?_0x51fd05?0x3:0x2:_0x48e610;_0x36f0d3[_0x940b('0x44')]('\x22'+_0x539ed4+'\x22');break;case _0x940b('0x26'):var _0x385d7e=parseInt(_0x539ed4);if(_[_0x940b('0x59')](_0x385d7e)&&_[_0x940b('0x5a')](_0xc681f7,_0x385d7e)){_0x36f0d3[_0x940b('0x44')]('\x22'+_0x385d7e+'\x22');}else{_0x3de2af['push'](_0x940b('0x5b'));}break;case _0x940b('0x5c'):if(isEmail(_0x539ed4)){_0x36f0d3[_0x940b('0x44')]('\x22'+_0x539ed4+'\x22');}else{_0x3de2af['push'](_0x940b('0x5d'));}break;case _0x940b('0x5e'):var _0x91eb6=moment(_0x539ed4,_0x940b('0x5f'),!![]);if(_0x91eb6[_0x940b('0x57')]()){_0x36f0d3[_0x940b('0x44')]('\x22'+_0x539ed4+'\x22');}else{_0x3de2af[_0x940b('0x44')](_0x940b('0x60'));}break;default:_0x36f0d3['push']('\x22'+_0x539ed4+'\x22');}}else{switch(_0x511c23){case _0x940b('0x61'):case _0x940b('0x13'):_0x3de2af[_0x940b('0x44')](_0x511c23+_0x940b('0x62'));break;default:_0x36f0d3[_0x940b('0x44')]('\x22\x22');}}}}if(_0x3de2af['length']){handleError(_0x4ec004[_0x940b('0x53')][_0x2a6ce8],{'code':_0x940b('0x63'),'message':_0x3de2af[_0x940b('0x19')]()});}else{fs[_0x940b('0x64')](_0x10337e,_0x36f0d3[_0x940b('0x19')]()+'\x0a');}_0x36f0d3=[];}if(!(stats[_0x940b('0x65')]%0xc8)){socket[_0x940b('0x66')](_0x940b('0x67')+_0x555755,stats);stats[_0x940b('0x43')]=[];}}if(stopped){logger[_0x940b('0x3e')](_0x940b('0x68'));_0xd0437b[_0x940b('0x69')]();}}catch(_0x492a2c){handleError(_0x4ec004['data'][_0x2a6ce8],{'code':_0x940b('0x6a'),'message':_0x492a2c[_0x940b('0x41')]});logger[_0x940b('0x40')](_0x940b('0x6b'),_0x492a2c[_0x940b('0x41')]);}},'complete':function(){try{var _0x1e7ec0=[];var _0x42604e='cm_contacts';if(_0x4cfb4a['duplicates']&&_0x4cfb4a[_0x940b('0x6c')][_0x940b('0x54')]){_0x42604e=_0x940b('0x6d')+_0x555755;_0x1e7ec0[_0x940b('0x44')]('CREATE\x20TABLE\x20'+_0x42604e+_0x940b('0x6e'));}var _0x538b78=util['format']('LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',_0x10337e,_0x42604e,_0x38317d,_0x4cfb4a['ListId'],_0x4cfb4a[_0x940b('0x6f')]||null,NOW,NOW);if(_[_0x940b('0x70')](_0x40042b[_0x940b('0x22')])){_0x538b78+=_0x940b('0x71');}_0x1e7ec0['push'](_0x538b78);if(_0x4cfb4a[_0x940b('0x6c')]&&_0x4cfb4a[_0x940b('0x6c')][_0x940b('0x54')]){_0x1e7ec0[_0x940b('0x44')](insertCmContact(_0x4cfb4a[_0x940b('0x30')],_0x42604e,_0x4cfb4a['duplicates'],_0x40042b));_0x1e7ec0[_0x940b('0x44')](_0x940b('0x72')+_0x42604e+';');}_0x1e7ec0[_0x940b('0x44')](insertCmHopper(_0x4cfb4a[_0x940b('0x30')],_0x940b('0x73'),_0x940b('0x74'),_0x940b('0x75'),_0x51fd05));_0x1e7ec0[_0x940b('0x44')](insertCmHopperBlack(_0x4cfb4a[_0x940b('0x30')],_0x940b('0x76'),_0x940b('0x74'),_0x940b('0x75')));_0x1e7ec0[_0x940b('0x44')](insertCmHopper(_0x4cfb4a[_0x940b('0x30')],_0x940b('0x77'),_0x940b('0x78'),'CampaignId',_0x51fd05));_0x1e7ec0['push'](insertCmHopperBlack(_0x4cfb4a[_0x940b('0x30')],_0x940b('0x79'),_0x940b('0x78'),_0x940b('0x7a')));BPromise[_0x940b('0x7b')](_0x1e7ec0,handleQuery)[_0x940b('0x7c')](function(_0x50a18d){stats[_0x940b('0x7d')]=!![];stats['affectedRows']=_0x4cfb4a[_0x940b('0x6c')]&&_0x4cfb4a[_0x940b('0x6c')][_0x940b('0x54')]?results[0x2][_0x940b('0x7e')]:results[0x0][_0x940b('0x7e')];socket[_0x940b('0x66')]('contact:import:'+_0x555755,stats);fs['unlink'](_0x211991);fs[_0x940b('0x7f')](_0x10337e);process[_0x940b('0x42')](0x0);})['catch'](function(_0x15a1fe){logger['error'](_0x15a1fe[_0x940b('0x41')]);process[_0x940b('0x42')](0x1);});}catch(_0x1774e4){logger[_0x940b('0x40')](_0x940b('0x80'),_0x1774e4[_0x940b('0x41')]);process[_0x940b('0x42')](0x1);}},'error':function(_0x43cf79,_0x1a32c9,_0x3d4914,_0x309e11){throw new Error(_0x309e11);}});}function validate(){if(process[_0x940b('0x81')]&&process[_0x940b('0x81')]['length']<0x4){throw new Error(_0x940b('0x82'));}var _0x188a23=path[_0x940b('0x19')](config['root'],_0x940b('0x4f'),process[_0x940b('0x81')][0x2]);if(!fs['existsSync'](_0x188a23)){throw new Error(_0x940b('0x83'));}var _0x478ec1={};try{_0x478ec1=JSON[_0x940b('0x51')](process['argv'][0x3]);if(!_0x478ec1[_0x940b('0x4d')]){throw new Error(_0x940b('0x84'));}if(!_0x478ec1[_0x940b('0x4d')][_0x940b('0x13')]){throw new Error(_0x940b('0x85'));}if(!_0x478ec1[_0x940b('0x4d')]['firstName']){throw new Error(_0x940b('0x86'));}var _0x4e805d=0x0;if(_0x478ec1[_0x940b('0x4d')][_0x940b('0x26')]){_0x4e805d=0x1;}if(!_0x478ec1[_0x940b('0x30')]){throw new Error(_0x940b('0x87'));}}catch(_0x4a42fb){throw new Error(_0x940b('0x88'));}var _0x429fa2=[];try{_0x429fa2=_[_0x940b('0x89')](JSON[_0x940b('0x51')](process[_0x940b('0x81')][0x4]),'id');}catch(_0x5996b2){logger[_0x940b('0x3e')](_0x940b('0x8a'));}main(_0x188a23,_0x478ec1,_0x429fa2,_0x4e805d);}validate();process['on'](_0x940b('0x8b'),handleStop);process['on']('uncaughtException',handleUncaughtException); \ No newline at end of file +var _0xe863=['replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNumber','includes','agent\x20not\x20exists','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','\x20not\x20specified','SystemRow','appendFileSync','emit','contact:import:','Abort\x20parser','abort','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','isNil',',\x20scheduledAt\x20=\x20NOW()','length','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','finish','affectedRows','exit','complete','argv','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName','firstName\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','util','moment','squel','ioredis','../../../config/environment','../../../config/logger','import','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','phone','join','.id\x20=\x20','\x20=\x20','where','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','insert','cm_hopper','fromQuery','scheduledat','ContactId','ListId','createdAt','priority','UserId','recallme','fields','from','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','cm_contacts.id','into','cm_hopper_black','cm_contacts','toString','concat','keys','CompanyId','updatedAt',')\x20NOT\x20IN\x20?','ListId\x20=\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','min_id','group','Received\x20SIGINT','error','message','errors','push','code','info','sequelize','query','catch','send','start','binding','socket_timestamp','root','server/files/tmp','.csv','header','writeFileSync','parse','createReadStream','data','rows','hasOwnProperty'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe863,0x1cb));var _0x3e86=function(_0x47eaff,_0x502553){_0x47eaff=_0x47eaff-0x0;var _0x53103e=_0xe863[_0x47eaff];return _0x53103e;};'use strict';var fs=require('fs');var path=require('path');var _=require('lodash');var Papa=require('papaparse');var util=require(_0x3e86('0x0'));var BPromise=require('bluebird');var moment=require(_0x3e86('0x1'));var squel=require(_0x3e86('0x2'));var Redis=require(_0x3e86('0x3'));var db=require('../../../mysqldb')['db'];var config=require(_0x3e86('0x4'));var logger=require(_0x3e86('0x5'))(_0x3e86('0x6'));config[_0x3e86('0x7')]=_[_0x3e86('0x8')](config[_0x3e86('0x7')],{'host':_0x3e86('0x9'),'port':0x18eb});var socket=require(_0x3e86('0xa'))(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0x3e86('0xb')](_0x3e86('0xc'));function isEmail(_0x596416){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))*$/[_0x3e86('0xd')](_0x596416);}function selectNotIn(_0x483834,_0x2aa515,_0x49fac2,_0x62e4de,_0x49bdf1){return squel[_0x3e86('0xe')]()[_0x3e86('0xf')](_0x3e86('0x10'))['from'](_0x62e4de)[_0x3e86('0x11')](_0x2aa515,null,_0x2aa515+_0x3e86('0x12')+_0x62e4de+'.'+_0x49fac2)['where'](_0x62e4de+'.'+_0x49fac2+_0x3e86('0x13')+_0x483834+'.'+_0x49fac2)[_0x3e86('0x14')](_0x2aa515+'.dialCheckDuplicateType\x20IN\x20('+_0x49bdf1['join']()+')');}function insertCmHopper(_0x968377,_0x3b7df6,_0x4d1931,_0x237cb8,_0x3a9787){var _0x1341c7=[_0x3e86('0x15'),_0x3e86('0x16'),'cm_contacts.id',_0x3e86('0x17'),_0x3b7df6+'.'+_0x237cb8,_0x3e86('0x18'),_0x3e86('0x19'),_0x3e86('0x1a'),'cm_contacts.UserId','\x22'+_0x3a9787+'\x22'];return squel[_0x3e86('0x1b')]()['into'](_0x3e86('0x1c'))[_0x3e86('0x1d')]([_0x3e86('0x10'),_0x3e86('0x1e'),_0x3e86('0x1f'),_0x3e86('0x20'),_0x237cb8,_0x3e86('0x21'),'updatedAt',_0x3e86('0x22'),_0x3e86('0x23'),_0x3e86('0x24')],squel[_0x3e86('0xe')]()[_0x3e86('0x25')](_0x1341c7)[_0x3e86('0x26')](_0x3b7df6)['join']('cm_contacts',null,_0x3e86('0x27')+_0x3b7df6+_0x3e86('0x28'))[_0x3e86('0x11')](_0x4d1931,null,_0x4d1931+'.id\x20=\x20'+_0x3b7df6+'.'+_0x237cb8)[_0x3e86('0x14')](_0x3b7df6+_0x3e86('0x29'),_0x968377)[_0x3e86('0x14')]('cm_contacts.createdAt\x20=\x20?',NOW)['where'](_0x3e86('0x2a'),selectNotIn(_0x3b7df6,_0x4d1931,_0x237cb8,_0x3e86('0x1c'),[_0x3e86('0x2b'),_0x3e86('0x2c')]))[_0x3e86('0x14')](_0x3e86('0x2a'),selectNotIn(_0x3b7df6,_0x4d1931,_0x237cb8,_0x3e86('0x1c'),[_0x3e86('0x2b')])))['toString']();}function insertCmHopperBlack(_0x4b7d49,_0x53ff63,_0x5d7028,_0x3604d0){var _0xca0cb9=['cm_contacts.phone',_0x3e86('0x2d'),_0x3e86('0x17'),_0x53ff63+'.'+_0x3604d0,_0x3e86('0x18'),_0x3e86('0x19')];return squel[_0x3e86('0x1b')]()[_0x3e86('0x2e')](_0x3e86('0x2f'))[_0x3e86('0x1d')]([_0x3e86('0x10'),_0x3e86('0x1f'),_0x3e86('0x20'),_0x3604d0,_0x3e86('0x21'),'updatedAt'],squel[_0x3e86('0xe')]()[_0x3e86('0x25')](_0xca0cb9)[_0x3e86('0x26')](_0x53ff63)[_0x3e86('0x11')](_0x3e86('0x30'),null,_0x3e86('0x27')+_0x53ff63+_0x3e86('0x28'))['join'](_0x5d7028,null,_0x5d7028+_0x3e86('0x12')+_0x53ff63+'.'+_0x3604d0)[_0x3e86('0x14')](_0x53ff63+_0x3e86('0x29'),_0x4b7d49)[_0x3e86('0x14')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x3e86('0x14')](_0x3e86('0x2a'),squel[_0x3e86('0xe')]()[_0x3e86('0xf')](_0x3e86('0x10'))[_0x3e86('0x26')](_0x3e86('0x2f'))[_0x3e86('0x14')]('ListId\x20=\x20?',_0x4b7d49)[_0x3e86('0x14')](_0x3604d0+'\x20=\x20?',_0x53ff63+'.'+_0x3604d0)))[_0x3e86('0x31')]();}function insertCmContact(_0x59ab19,_0x13dc36,_0x26880d,_0x2efb3a){var _0x5b8dde=_[_0x3e86('0x32')](_[_0x3e86('0x33')](_0x2efb3a),[_0x3e86('0x20'),_0x3e86('0x34'),_0x3e86('0x21'),_0x3e86('0x35')]);return squel[_0x3e86('0x1b')]()[_0x3e86('0x2e')](_0x3e86('0x30'))[_0x3e86('0x1d')](_0x5b8dde,squel[_0x3e86('0xe')]()[_0x3e86('0x25')](_0x5b8dde)['from'](_0x13dc36)['where']('('+_0x26880d['join'](',')+_0x3e86('0x36'),squel[_0x3e86('0xe')]()[_0x3e86('0x25')](_0x26880d)[_0x3e86('0x26')](_0x3e86('0x30'))[_0x3e86('0x14')](_0x3e86('0x37'),_0x59ab19)['where'](_0x3e86('0x38')))[_0x3e86('0x14')](_0x3e86('0x39'),squel[_0x3e86('0xe')]()['field'](_0x3e86('0x3a'),_0x3e86('0x3b'))['from'](_0x13dc36)[_0x3e86('0x3c')](_0x26880d['join'](','))))['toString']();}function handleStop(){logger['info'](_0x3e86('0x3d'));stopped=!![];}function handleUncaughtException(_0x3edc0f){logger[_0x3e86('0x3e')](_0x3edc0f[_0x3e86('0x3f')]);process['exit'](0x1);}function handleError(_0x161bb3,_0x6cd1d6){stats[_0x3e86('0x40')][_0x3e86('0x41')]({'name':_0x6cd1d6[_0x3e86('0x42')],'message':_0x6cd1d6[_0x3e86('0x3f')],'row':_0x161bb3});}function handleQuery(_0x5f0312){logger[_0x3e86('0x43')](_0x5f0312);return db[_0x3e86('0x44')][_0x3e86('0x45')](_0x5f0312)['spread'](function(_0x458947){results['push'](_0x458947);})[_0x3e86('0x46')](function(_0x4f7ff2){logger[_0x3e86('0x3e')](_0x4f7ff2[_0x3e86('0x3f')]);});}function main(_0xbab6af,_0x3aec6c,_0x262d94,_0x48a961){logger['info']('main',_0xbab6af,JSON['stringify'](_0x3aec6c));process[_0x3e86('0x47')](_0x3e86('0x48'));var _0x2fa38c=_0x3aec6c[_0x3e86('0x49')];var _0x297889=_0x3aec6c[_0x3e86('0x4a')];var _0x149fa0=path[_0x3e86('0x11')](config[_0x3e86('0x4b')],_0x3e86('0x4c'),_0x297889+_0x3e86('0x4d'));var _0x58d28d=_[_0x3e86('0x33')](_0x2fa38c)[_0x3e86('0x11')]();logger['info'](_0x3e86('0x4e'),_0x58d28d);fs[_0x3e86('0x4f')](_0x149fa0,_0x58d28d+'\x0a');Papa[_0x3e86('0x50')](fs[_0x3e86('0x51')](_0xbab6af),{'header':!![],'skipEmptyLines':!![],'step':function(_0x5d2d15,_0x182781){try{for(var _0x3bbd7a=0x0,_0x48f070=[];_0x3bbd7a<_0x5d2d15[_0x3e86('0x52')]['length'];_0x3bbd7a++){stats[_0x3e86('0x53')]+=0x1;if(_0x5d2d15[_0x3e86('0x40')][_0x3bbd7a]){handleError(_0x5d2d15[_0x3e86('0x52')][_0x3bbd7a],_0x5d2d15[_0x3e86('0x40')][_0x3bbd7a]);}else{var _0x43a28e=[];for(var _0x4c01c7 in _0x2fa38c){if(_0x2fa38c[_0x3e86('0x54')](_0x4c01c7)){if(_0x5d2d15[_0x3e86('0x52')][_0x3bbd7a][_0x2fa38c[_0x4c01c7]]){var _0x541f4f=_['trim'](_0x5d2d15[_0x3e86('0x52')][_0x3bbd7a][_0x2fa38c[_0x4c01c7]][_0x3e86('0x55')](/"/g,'\x27'));switch(_0x4c01c7){case _0x3e86('0x1e'):var _0x5a1955=moment(_0x541f4f,_0x3e86('0xc'),!![]);if(_0x5a1955[_0x3e86('0x56')]()){_0x48f070['push']('\x22'+_0x541f4f+'\x22');}else{_0x43a28e[_0x3e86('0x41')](_0x3e86('0x57'));}break;case _0x3e86('0x22'):var _0x424db5=parseInt(_0x541f4f);_0x541f4f=_['isNaN'](_0x424db5)||_0x424db5<0x0||_0x424db5>0x4?_0x48a961?0x3:0x2:_0x424db5;_0x48f070[_0x3e86('0x41')]('\x22'+_0x541f4f+'\x22');break;case _0x3e86('0x23'):var _0x345abf=parseInt(_0x541f4f);if(_[_0x3e86('0x58')](_0x345abf)&&_[_0x3e86('0x59')](_0x262d94,_0x345abf)){_0x48f070[_0x3e86('0x41')]('\x22'+_0x345abf+'\x22');}else{_0x43a28e[_0x3e86('0x41')](_0x3e86('0x5a'));}break;case'email':if(isEmail(_0x541f4f)){_0x48f070[_0x3e86('0x41')]('\x22'+_0x541f4f+'\x22');}else{_0x43a28e['push'](_0x3e86('0x5b'));}break;case _0x3e86('0x5c'):var _0x17ccb6=moment(_0x541f4f,_0x3e86('0x5d'),!![]);if(_0x17ccb6[_0x3e86('0x56')]()){_0x48f070[_0x3e86('0x41')]('\x22'+_0x541f4f+'\x22');}else{_0x43a28e[_0x3e86('0x41')](_0x3e86('0x5e'));}break;default:_0x48f070[_0x3e86('0x41')]('\x22'+_0x541f4f+'\x22');}}else{switch(_0x4c01c7){case'firstName':case _0x3e86('0x10'):_0x43a28e[_0x3e86('0x41')](_0x4c01c7+_0x3e86('0x5f'));break;default:_0x48f070[_0x3e86('0x41')]('\x22\x22');}}}}if(_0x43a28e['length']){handleError(_0x5d2d15[_0x3e86('0x52')][_0x3bbd7a],{'code':_0x3e86('0x60'),'message':_0x43a28e['join']()});}else{fs[_0x3e86('0x61')](_0x149fa0,_0x48f070['join']()+'\x0a');}_0x48f070=[];}if(!(stats['rows']%0xc8)){socket[_0x3e86('0x62')](_0x3e86('0x63')+_0x297889,stats);stats['errors']=[];}}if(stopped){logger[_0x3e86('0x43')](_0x3e86('0x64'));_0x182781[_0x3e86('0x65')]();}}catch(_0x6bdb42){handleError(_0x5d2d15[_0x3e86('0x52')][_0x3bbd7a],{'code':'SystemError','message':_0x6bdb42[_0x3e86('0x3f')]});logger[_0x3e86('0x3e')](_0x3e86('0x66'),_0x6bdb42[_0x3e86('0x3f')]);}},'complete':function(){try{var _0x29857b=[];var _0x54536a='cm_contacts';if(_0x3aec6c[_0x3e86('0x67')]&&_0x3aec6c[_0x3e86('0x67')]['length']){_0x54536a=_0x3e86('0x68')+_0x297889;_0x29857b[_0x3e86('0x41')](_0x3e86('0x69')+_0x54536a+_0x3e86('0x6a'));}var _0x24784b=util[_0x3e86('0xb')](_0x3e86('0x6b'),_0x149fa0,_0x54536a,_0x58d28d,_0x3aec6c[_0x3e86('0x20')],_0x3aec6c['CompanyId']||null,NOW,NOW);if(_[_0x3e86('0x6c')](_0x2fa38c[_0x3e86('0x1e')])){_0x24784b+=_0x3e86('0x6d');}_0x29857b[_0x3e86('0x41')](_0x24784b);if(_0x3aec6c[_0x3e86('0x67')]&&_0x3aec6c[_0x3e86('0x67')][_0x3e86('0x6e')]){_0x29857b[_0x3e86('0x41')](insertCmContact(_0x3aec6c[_0x3e86('0x20')],_0x54536a,_0x3aec6c[_0x3e86('0x67')],_0x2fa38c));_0x29857b['push'](_0x3e86('0x6f')+_0x54536a+';');}_0x29857b[_0x3e86('0x41')](insertCmHopper(_0x3aec6c[_0x3e86('0x20')],_0x3e86('0x70'),_0x3e86('0x71'),_0x3e86('0x72'),_0x48a961));_0x29857b['push'](insertCmHopperBlack(_0x3aec6c[_0x3e86('0x20')],_0x3e86('0x73'),_0x3e86('0x71'),_0x3e86('0x72')));_0x29857b[_0x3e86('0x41')](insertCmHopper(_0x3aec6c['ListId'],_0x3e86('0x74'),_0x3e86('0x75'),_0x3e86('0x76'),_0x48a961));_0x29857b['push'](insertCmHopperBlack(_0x3aec6c[_0x3e86('0x20')],_0x3e86('0x77'),_0x3e86('0x75'),_0x3e86('0x76')));BPromise[_0x3e86('0x78')](_0x29857b,handleQuery)[_0x3e86('0x79')](function(_0x3bdd86){stats[_0x3e86('0x7a')]=!![];stats[_0x3e86('0x7b')]=_0x3aec6c[_0x3e86('0x67')]&&_0x3aec6c[_0x3e86('0x67')][_0x3e86('0x6e')]?results[0x2][_0x3e86('0x7b')]:results[0x0]['affectedRows'];socket[_0x3e86('0x62')](_0x3e86('0x63')+_0x297889,stats);fs['unlink'](_0xbab6af);fs['unlink'](_0x149fa0);process[_0x3e86('0x7c')](0x0);})[_0x3e86('0x46')](function(_0x36eecf){logger[_0x3e86('0x3e')](_0x36eecf[_0x3e86('0x3f')]);process[_0x3e86('0x7c')](0x1);});}catch(_0x51b2f8){logger[_0x3e86('0x3e')](_0x3e86('0x7d'),_0x51b2f8[_0x3e86('0x3f')]);process['exit'](0x1);}},'error':function(_0x231af9,_0x575e1f,_0x37fca0,_0x1a17a1){throw new Error(_0x1a17a1);}});}function validate(){if(process[_0x3e86('0x7e')]&&process[_0x3e86('0x7e')][_0x3e86('0x6e')]<0x4){throw new Error('arguments\x20\x20\x20');}var _0x42b611=path[_0x3e86('0x11')](config[_0x3e86('0x4b')],_0x3e86('0x4c'),process[_0x3e86('0x7e')][0x2]);if(!fs[_0x3e86('0x7f')](_0x42b611)){throw new Error(_0x3e86('0x80'));}var _0x59aa36={};try{_0x59aa36=JSON['parse'](process[_0x3e86('0x7e')][0x3]);if(!_0x59aa36[_0x3e86('0x49')]){throw new Error(_0x3e86('0x81'));}if(!_0x59aa36['binding']['phone']){throw new Error(_0x3e86('0x82'));}if(!_0x59aa36['binding'][_0x3e86('0x83')]){throw new Error(_0x3e86('0x84'));}var _0x24fcb4=0x0;if(_0x59aa36[_0x3e86('0x49')][_0x3e86('0x23')]){_0x24fcb4=0x1;}if(!_0x59aa36[_0x3e86('0x20')]){throw new Error('ListId\x20is\x20mandatory');}}catch(_0x45ea94){throw new Error(_0x3e86('0x85'));}var _0x484fbe=[];try{_0x484fbe=_[_0x3e86('0x86')](JSON[_0x3e86('0x50')](process[_0x3e86('0x7e')][0x4]),'id');}catch(_0xc4b35){logger[_0x3e86('0x43')](_0x3e86('0x87'));}main(_0x42b611,_0x59aa36,_0x484fbe,_0x24fcb4);}validate();process['on']('SIGINT',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 5e1994e..354b862 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 _0x78ec=['keyValue','Caller\x20Number','Caller\x20Name','calleridname','Call\x20To','destexten','Queue','uniqueid','Date','agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Name','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Ring','Agent\x20Connect','Agent\x20Complete','agentcompleteAt','Talk\x20Time','talktime','Called\x20Number','Member\x20Name','membername','UniqueId','starttime','Complete\x20Time','Duration','duration','Billable\x20Time','billableseconds','string','[xCALLY\x20Ticket]','toLowerCase','voice','inbound','push','variable','queue','calleridnum','outbound','destcalleridnum','getDescriptions','***\x20Call\x20Info\x20***'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x78ec,0x9f));var _0xc78e=function(_0x57a262,_0x7dc3e3){_0x57a262=_0x57a262-0x0;var _0x496bcb=_0x78ec[_0x57a262];return _0x496bcb;};'use strict';exports['getSubjects']=function(_0x6f1f7b,_0x3da633){var _0xdf610e=[{'type':_0xc78e('0x0'),'content':_0xc78e('0x1'),'variableName':null}];switch(_0x6f1f7b[_0xc78e('0x2')]()){case _0xc78e('0x3'):switch(_0x3da633[_0xc78e('0x2')]()){case _0xc78e('0x4'):_0xdf610e[_0xc78e('0x5')]({'type':_0xc78e('0x6'),'content':'','variableName':_0xc78e('0x7')});_0xdf610e[_0xc78e('0x5')]({'type':_0xc78e('0x6'),'content':'','variableName':_0xc78e('0x8')});break;case _0xc78e('0x9'):_0xdf610e[_0xc78e('0x5')]({'type':'string','content':'Outbound\x20Call','variableName':null});_0xdf610e[_0xc78e('0x5')]({'type':_0xc78e('0x6'),'content':'','variableName':_0xc78e('0xa')});break;}}return _0xdf610e;};exports[_0xc78e('0xb')]=function(_0x4f5603,_0x326457){var _0x4ee2fd=[];switch(_0x4f5603[_0xc78e('0x2')]()){case'voice':switch(_0x326457[_0xc78e('0x2')]()){case _0xc78e('0x4'):_0x4ee2fd=[{'type':_0xc78e('0x0'),'content':_0xc78e('0xc'),'key':null,'keyType':null,'variableName':null},{'type':_0xc78e('0xd'),'content':'','key':_0xc78e('0xe'),'keyType':_0xc78e('0x6'),'variableName':'calleridnum'},{'type':_0xc78e('0xd'),'content':'','key':_0xc78e('0xf'),'keyType':_0xc78e('0x6'),'variableName':_0xc78e('0x10')},{'type':'keyValue','content':'','key':_0xc78e('0x11'),'keyType':_0xc78e('0x6'),'variableName':_0xc78e('0x12')},{'type':_0xc78e('0xd'),'content':'','key':_0xc78e('0x13'),'keyType':_0xc78e('0x6'),'variableName':_0xc78e('0x7')},{'type':'keyValue','content':'','key':'UniqueId','keyType':_0xc78e('0x6'),'variableName':_0xc78e('0x14')},{'type':_0xc78e('0xd'),'content':'','key':_0xc78e('0x15'),'keyType':_0xc78e('0x6'),'variableName':_0xc78e('0x16')},{'type':'string','content':_0xc78e('0x17'),'key':null,'keyType':null,'variableName':null},{'type':_0xc78e('0xd'),'content':'','key':_0xc78e('0x18'),'keyType':'variable','variableName':'destcalleridname'},{'type':'keyValue','content':'','key':_0xc78e('0x19'),'keyType':_0xc78e('0x6'),'variableName':_0xc78e('0xa')},{'type':_0xc78e('0x0'),'content':_0xc78e('0x1a'),'key':null,'keyType':null,'variableName':null},{'type':_0xc78e('0xd'),'content':'','key':_0xc78e('0x1b'),'keyType':_0xc78e('0x6'),'variableName':_0xc78e('0x16')},{'type':'keyValue','content':'','key':_0xc78e('0x1c'),'keyType':_0xc78e('0x6'),'variableName':'agentconnectAt'},{'type':_0xc78e('0xd'),'content':'','key':_0xc78e('0x1d'),'keyType':_0xc78e('0x6'),'variableName':_0xc78e('0x1e')},{'type':_0xc78e('0xd'),'content':'','key':'Hold\x20Time','keyType':'variable','variableName':'holdtime'},{'type':_0xc78e('0xd'),'content':'','key':_0xc78e('0x1f'),'keyType':_0xc78e('0x6'),'variableName':_0xc78e('0x20')}];break;case _0xc78e('0x9'):_0x4ee2fd=[{'type':_0xc78e('0x0'),'content':_0xc78e('0xc'),'variableName':null},{'type':_0xc78e('0xd'),'content':'','key':_0xc78e('0x21'),'keyType':_0xc78e('0x6'),'keyContent':'','variableName':_0xc78e('0xa')},{'type':_0xc78e('0xd'),'content':'','key':_0xc78e('0x22'),'keyType':_0xc78e('0x6'),'keyContent':'','variableName':_0xc78e('0x23')},{'type':_0xc78e('0xd'),'content':'','key':_0xc78e('0x24'),'keyType':_0xc78e('0x6'),'keyContent':'','variableName':_0xc78e('0x14')},{'type':_0xc78e('0xd'),'content':'','key':'Date','keyType':_0xc78e('0x6'),'keyContent':'','variableName':_0xc78e('0x25')},{'type':'string','content':_0xc78e('0x1a')},{'type':_0xc78e('0xd'),'content':'','key':'Answer\x20Time','keyType':_0xc78e('0x6'),'keyContent':'','variableName':'answertime'},{'type':_0xc78e('0xd'),'content':'','key':_0xc78e('0x26'),'keyType':_0xc78e('0x6'),'keyContent':'','variableName':'endtime'},{'type':_0xc78e('0xd'),'content':'','key':_0xc78e('0x27'),'keyType':_0xc78e('0x6'),'keyContent':'','variableName':_0xc78e('0x28')},{'type':_0xc78e('0xd'),'content':'','key':_0xc78e('0x29'),'keyType':_0xc78e('0x6'),'keyContent':'','variableName':_0xc78e('0x2a')}];break;}}return _0x4ee2fd;}; \ No newline at end of file +var _0x96ca=['variable','calleridnum','outbound','Outbound\x20Call','getDescriptions','keyValue','Caller\x20Number','Caller\x20Name','calleridname','Call\x20To','destexten','Queue','UniqueId','uniqueid','Date','agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Name','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Ring','Agent\x20Connect','agentconnectAt','Agent\x20Complete','agentcompleteAt','Hold\x20Time','holdtime','Talk\x20Time','Called\x20Number','destcalleridnum','Member\x20Name','membername','starttime','answertime','Complete\x20Time','endtime','Duration','billableseconds','string','[xCALLY\x20Ticket]','toLowerCase','voice','inbound','push','queue'];(function(_0x25fc1e,_0x424913){var _0x5e3746=function(_0x1010cc){while(--_0x1010cc){_0x25fc1e['push'](_0x25fc1e['shift']());}};_0x5e3746(++_0x424913);}(_0x96ca,0x161));var _0xa96c=function(_0x25bd0c,_0x10a934){_0x25bd0c=_0x25bd0c-0x0;var _0x1c8e6e=_0x96ca[_0x25bd0c];return _0x1c8e6e;};'use strict';exports['getSubjects']=function(_0x37582a,_0x116fec){var _0x4c6acd=[{'type':_0xa96c('0x0'),'content':_0xa96c('0x1'),'variableName':null}];switch(_0x37582a[_0xa96c('0x2')]()){case _0xa96c('0x3'):switch(_0x116fec[_0xa96c('0x2')]()){case _0xa96c('0x4'):_0x4c6acd[_0xa96c('0x5')]({'type':'variable','content':'','variableName':_0xa96c('0x6')});_0x4c6acd['push']({'type':_0xa96c('0x7'),'content':'','variableName':_0xa96c('0x8')});break;case _0xa96c('0x9'):_0x4c6acd['push']({'type':_0xa96c('0x0'),'content':_0xa96c('0xa'),'variableName':null});_0x4c6acd['push']({'type':_0xa96c('0x7'),'content':'','variableName':'destcalleridnum'});break;}}return _0x4c6acd;};exports[_0xa96c('0xb')]=function(_0x2a4c1e,_0x39cec8){var _0x16b84f=[];switch(_0x2a4c1e[_0xa96c('0x2')]()){case _0xa96c('0x3'):switch(_0x39cec8[_0xa96c('0x2')]()){case _0xa96c('0x4'):_0x16b84f=[{'type':'string','content':'***\x20Call\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0xa96c('0xc'),'content':'','key':_0xa96c('0xd'),'keyType':_0xa96c('0x7'),'variableName':_0xa96c('0x8')},{'type':_0xa96c('0xc'),'content':'','key':_0xa96c('0xe'),'keyType':_0xa96c('0x7'),'variableName':_0xa96c('0xf')},{'type':_0xa96c('0xc'),'content':'','key':_0xa96c('0x10'),'keyType':_0xa96c('0x7'),'variableName':_0xa96c('0x11')},{'type':_0xa96c('0xc'),'content':'','key':_0xa96c('0x12'),'keyType':_0xa96c('0x7'),'variableName':_0xa96c('0x6')},{'type':_0xa96c('0xc'),'content':'','key':_0xa96c('0x13'),'keyType':'variable','variableName':_0xa96c('0x14')},{'type':_0xa96c('0xc'),'content':'','key':_0xa96c('0x15'),'keyType':_0xa96c('0x7'),'variableName':_0xa96c('0x16')},{'type':_0xa96c('0x0'),'content':_0xa96c('0x17'),'key':null,'keyType':null,'variableName':null},{'type':_0xa96c('0xc'),'content':'','key':_0xa96c('0x18'),'keyType':_0xa96c('0x7'),'variableName':'destcalleridname'},{'type':_0xa96c('0xc'),'content':'','key':_0xa96c('0x19'),'keyType':_0xa96c('0x7'),'variableName':'destcalleridnum'},{'type':_0xa96c('0x0'),'content':_0xa96c('0x1a'),'key':null,'keyType':null,'variableName':null},{'type':_0xa96c('0xc'),'content':'','key':_0xa96c('0x1b'),'keyType':'variable','variableName':'agentcalledAt'},{'type':_0xa96c('0xc'),'content':'','key':_0xa96c('0x1c'),'keyType':_0xa96c('0x7'),'variableName':_0xa96c('0x1d')},{'type':_0xa96c('0xc'),'content':'','key':_0xa96c('0x1e'),'keyType':_0xa96c('0x7'),'variableName':_0xa96c('0x1f')},{'type':_0xa96c('0xc'),'content':'','key':_0xa96c('0x20'),'keyType':_0xa96c('0x7'),'variableName':_0xa96c('0x21')},{'type':_0xa96c('0xc'),'content':'','key':_0xa96c('0x22'),'keyType':_0xa96c('0x7'),'variableName':'talktime'}];break;case _0xa96c('0x9'):_0x16b84f=[{'type':_0xa96c('0x0'),'content':'***\x20Call\x20Info\x20***','variableName':null},{'type':'keyValue','content':'','key':_0xa96c('0x23'),'keyType':'variable','keyContent':'','variableName':_0xa96c('0x24')},{'type':'keyValue','content':'','key':_0xa96c('0x25'),'keyType':_0xa96c('0x7'),'keyContent':'','variableName':_0xa96c('0x26')},{'type':_0xa96c('0xc'),'content':'','key':'UniqueId','keyType':'variable','keyContent':'','variableName':'uniqueid'},{'type':_0xa96c('0xc'),'content':'','key':'Date','keyType':'variable','keyContent':'','variableName':_0xa96c('0x27')},{'type':_0xa96c('0x0'),'content':_0xa96c('0x1a')},{'type':_0xa96c('0xc'),'content':'','key':'Answer\x20Time','keyType':_0xa96c('0x7'),'keyContent':'','variableName':_0xa96c('0x28')},{'type':'keyValue','content':'','key':_0xa96c('0x29'),'keyType':_0xa96c('0x7'),'keyContent':'','variableName':_0xa96c('0x2a')},{'type':_0xa96c('0xc'),'content':'','key':_0xa96c('0x2b'),'keyType':'variable','keyContent':'','variableName':'duration'},{'type':_0xa96c('0xc'),'content':'','key':'Billable\x20Time','keyType':_0xa96c('0x7'),'keyContent':'','variableName':_0xa96c('0x2c')}];break;}}return _0x16b84f;}; \ No newline at end of file diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js index 4f10917..641af5e 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 _0x592b=['Interaction','findOne','then','update','info','catch','error','tracked','user','clone','body','omit','fax','mobile','lodash','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','chat-interactions','whatsapp-interactions','upperFirst','InteractionId','unknown','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','name','role','stringify'];(function(_0x33654f,_0x1313a8){var _0x1e01b4=function(_0x162879){while(--_0x162879){_0x33654f['push'](_0x33654f['shift']());}};_0x1e01b4(++_0x1313a8);}(_0x592b,0x68));var _0xb592=function(_0xf77fa6,_0x4c9df8){_0xf77fa6=_0xf77fa6-0x0;var _0x5bd317=_0x592b[_0xf77fa6];return _0x5bd317;};'use strict';var _=require(_0xb592('0x0'));var db=require(_0xb592('0x1'))['db'];var loggers={'openchannel':require(_0xb592('0x2'))(_0xb592('0x3')),'mail':require('../../config/logger')(_0xb592('0x4')),'fax':require('../../config/logger')(_0xb592('0x5')),'sms':require('../../config/logger')('sms-interactions'),'chat':require(_0xb592('0x2'))(_0xb592('0x6')),'whatsapp':require('../../config/logger')(_0xb592('0x7'))};function getInteractionId(_0x1af49f,_0x177d71,_0x345879){if(_0x1af49f&&_0x1af49f[_[_0xb592('0x8')](_0x345879)+_0xb592('0x9')]){return _0x1af49f[_['upperFirst'](_0x345879)+_0xb592('0x9')];}else if(_0x1af49f&&_0x1af49f['id']){return _0x1af49f['id'];}else if(_0x177d71&&_0x177d71['id']){return _0x177d71['id'];}else{return _0xb592('0xa');}}function log(_0x1419c0,_0x1c30b7,_0x324726,_0x43e5bc,_0x528629,_0x28e530){loggers[_0x528629[_0xb592('0xb')]()][_0x1419c0](_0xb592('0xc'),_0x28e530['toUpperCase'](),_0x1c30b7?_0x1c30b7['id']:null,_0x1c30b7?_0x1c30b7[_0xb592('0xd')]:null,_0x1c30b7?_0x1c30b7[_0xb592('0xe')]:null,getInteractionId(_0x324726,_0x43e5bc,_0x528629),_0x324726?JSON[_0xb592('0xf')](_0x324726):'null');}function updateUser(_0x2ad7ae,_0x806f6,_0x563fea,_0xf73e61,_0x16440a){db[_[_0xb592('0x8')](_0xf73e61)+_0xb592('0x10')][_0xb592('0x11')]({'where':{'id':getInteractionId(_0x806f6,_0x563fea,_0xf73e61)}})[_0xb592('0x12')](function(_0x25be97){if(_0x25be97){return _0x25be97[_0xb592('0x13')]({'UserId':_0x2ad7ae?_0x2ad7ae['id']:null});}})['then'](function(_0x48c47b){if(_0x48c47b){log(_0xb592('0x14'),_0x2ad7ae,_0x806f6,_0x563fea,_0xf73e61,_0x16440a);}})[_0xb592('0x15')](function(){log(_0xb592('0x16'),_0x2ad7ae,_0x806f6,_0x563fea,_0xf73e61,_0x16440a);});}exports[_0xb592('0x17')]=function(_0x25ac1d,_0x4ebc78){return function(_0x53e3c9,_0x465fb9,_0x5c24f3){var _0x3a54de=_0x53e3c9[_0xb592('0x18')];var _0x55ee4c={};var _0xa9a11b=_0x53e3c9['query'];if(_0x55ee4c){_0x55ee4c=_[_0xb592('0x19')](_0x53e3c9[_0xb592('0x1a')]);_0x55ee4c=_[_0xb592('0x1b')](_0x55ee4c,[_0xb592('0x1a'),'html','phone',_0xb592('0x1c'),_0xb592('0x1d')]);}updateUser(_0x3a54de,_0x55ee4c,_0xa9a11b,_0x25ac1d,_0x4ebc78);_0x5c24f3(null);};}; \ No newline at end of file +var _0xa606=['mail-interactions','fax-interactions','whatsapp-interactions','upperFirst','InteractionId','unknown','toLowerCase','toUpperCase','name','stringify','null','Interaction','then','info','tracked','user','query','clone','phone','fax','mobile','lodash','../../mysqldb','../../config/logger','openchannel-interactions'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa606,0x79));var _0x6a60=function(_0x31f347,_0x441ce3){_0x31f347=_0x31f347-0x0;var _0x599142=_0xa606[_0x31f347];return _0x599142;};'use strict';var _=require(_0x6a60('0x0'));var db=require(_0x6a60('0x1'))['db'];var loggers={'openchannel':require(_0x6a60('0x2'))(_0x6a60('0x3')),'mail':require(_0x6a60('0x2'))(_0x6a60('0x4')),'fax':require(_0x6a60('0x2'))(_0x6a60('0x5')),'sms':require(_0x6a60('0x2'))('sms-interactions'),'chat':require(_0x6a60('0x2'))('chat-interactions'),'whatsapp':require(_0x6a60('0x2'))(_0x6a60('0x6'))};function getInteractionId(_0x5676d3,_0x4efbf3,_0xf8fb31){if(_0x5676d3&&_0x5676d3[_[_0x6a60('0x7')](_0xf8fb31)+'InteractionId']){return _0x5676d3[_[_0x6a60('0x7')](_0xf8fb31)+_0x6a60('0x8')];}else if(_0x5676d3&&_0x5676d3['id']){return _0x5676d3['id'];}else if(_0x4efbf3&&_0x4efbf3['id']){return _0x4efbf3['id'];}else{return _0x6a60('0x9');}}function log(_0x2d2546,_0x4a2612,_0x3873bc,_0x3d5f94,_0xca774,_0x4e8a47){loggers[_0xca774[_0x6a60('0xa')]()][_0x2d2546]('[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4e8a47[_0x6a60('0xb')](),_0x4a2612?_0x4a2612['id']:null,_0x4a2612?_0x4a2612[_0x6a60('0xc')]:null,_0x4a2612?_0x4a2612['role']:null,getInteractionId(_0x3873bc,_0x3d5f94,_0xca774),_0x3873bc?JSON[_0x6a60('0xd')](_0x3873bc):_0x6a60('0xe'));}function updateUser(_0x28f8dd,_0x51c440,_0x336175,_0x598102,_0x2e0181){db[_[_0x6a60('0x7')](_0x598102)+_0x6a60('0xf')]['findOne']({'where':{'id':getInteractionId(_0x51c440,_0x336175,_0x598102)}})['then'](function(_0x2eb3cf){if(_0x2eb3cf){return _0x2eb3cf['update']({'UserId':_0x28f8dd?_0x28f8dd['id']:null});}})[_0x6a60('0x10')](function(_0x44de6c){if(_0x44de6c){log(_0x6a60('0x11'),_0x28f8dd,_0x51c440,_0x336175,_0x598102,_0x2e0181);}})['catch'](function(){log('error',_0x28f8dd,_0x51c440,_0x336175,_0x598102,_0x2e0181);});}exports[_0x6a60('0x12')]=function(_0x28df0a,_0x2f431b){return function(_0x568d4b,_0x3828ef,_0x41e34c){var _0xf6e11b=_0x568d4b[_0x6a60('0x13')];var _0x1d685e={};var _0x18472c=_0x568d4b[_0x6a60('0x14')];if(_0x1d685e){_0x1d685e=_[_0x6a60('0x15')](_0x568d4b['body']);_0x1d685e=_['omit'](_0x1d685e,['body','html',_0x6a60('0x16'),_0x6a60('0x17'),_0x6a60('0x18')]);}updateUser(_0xf6e11b,_0x1d685e,_0x18472c,_0x28df0a,_0x2f431b);_0x41e34c(null);};}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index 42fa114..0be5a0e 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 _0x892e=['License','findOne','then','count','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','admin','user','crypto','composable-middleware','../../mysqldb','data1','license','split','createDecipher','format','%s:%s:%s','update','base64','utf8','final','parse','hasOwnProperty','use'];(function(_0x1649fe,_0x5916da){var _0x473a67=function(_0x163cae){while(--_0x163cae){_0x1649fe['push'](_0x1649fe['shift']());}};_0x473a67(++_0x5916da);}(_0x892e,0x77));var _0xe892=function(_0x5c1c52,_0xeb731a){_0x5c1c52=_0x5c1c52-0x0;var _0xbabe2e=_0x892e[_0x5c1c52];return _0xbabe2e;};'use strict';var crypto=require(_0xe892('0x0'));var util=require('util');var compose=require(_0xe892('0x1'));var db=require(_0xe892('0x2'))['db'];var config=require('../../config/environment');function getValueFromLicense(_0x33e637,_0x16891b){if(_0x33e637&&_0x16891b){if(_0x16891b[_0xe892('0x3')]&&_0x16891b['license']){var _0x61f10c=_0x16891b[_0xe892('0x3')];var _0x429ca8=_0x16891b[_0xe892('0x4')];var _0x9fd87b=_0x61f10c[_0xe892('0x5')]('-')[0x4];var _0x1b5635=_0x61f10c[_0xe892('0x5')]('-')[0x0];var _0x345a58=crypto[_0xe892('0x6')]('aes-256-ctr',util[_0xe892('0x7')](_0xe892('0x8'),_0x9fd87b,_0x61f10c,_0x1b5635));var _0x51c36f=_0x345a58[_0xe892('0x9')](_0x429ca8,_0xe892('0xa'),_0xe892('0xb'));_0x51c36f+=_0x345a58[_0xe892('0xc')](_0xe892('0xb'));var _0x411e3d=JSON[_0xe892('0xd')](_0x51c36f);return _0x411e3d[_0xe892('0xe')](_0x33e637)?_0x411e3d[_0x33e637]:null;}}return null;}function isLimit(_0x47c084,_0x440e47,_0x56dfe0,_0x380069){var _0x2bb6a9=_0x440e47;return compose()[_0xe892('0xf')](function(_0x3a26b8,_0x3787d7,_0x5a4660){return db[_0xe892('0x10')][_0xe892('0x11')]({'where':{'id':0x1},'raw':!![]})[_0xe892('0x12')](function(_0x4f97e5){var _0x10e080=getValueFromLicense(_0x47c084,_0x4f97e5);return _0x10e080?_0x10e080:_0x2bb6a9;})[_0xe892('0x12')](function(_0x5633a6){_0x2bb6a9=_0x5633a6;return _0x56dfe0[_0xe892('0x13')](_0x380069);})[_0xe892('0x12')](function(_0x31231d){if(_0x31231d>=_0x2bb6a9){return _0x3787d7[_0xe892('0x14')](0x193)[_0xe892('0x15')]({'message':util[_0xe892('0x7')](_0xe892('0x16'),_0x47c084)});}_0x5a4660();})[_0xe892('0x17')](function(_0xf620ac){_0x5a4660(_0xf620ac);});});}function isUserLimit(){return isLimit(_0xe892('0x18'),0x1,db['User'],{'where':{'$or':[{'role':_0xe892('0x19')},{'role':_0xe892('0x1a')}]}});}exports['isUserLimit']=isUserLimit; \ No newline at end of file +var _0x827c=['isUserLimit','../../mysqldb','../../config/environment','license','split','aes-256-ctr','format','%s:%s:%s','update','base64','utf8','final','use','License','findOne','then','count','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','User','admin'];(function(_0x2ef16c,_0xd211ba){var _0x128a71=function(_0x4c12f4){while(--_0x4c12f4){_0x2ef16c['push'](_0x2ef16c['shift']());}};_0x128a71(++_0xd211ba);}(_0x827c,0x8b));var _0xc827=function(_0x49894c,_0x4f01f5){_0x49894c=_0x49894c-0x0;var _0x2aa221=_0x827c[_0x49894c];return _0x2aa221;};'use strict';var crypto=require('crypto');var util=require('util');var compose=require('composable-middleware');var db=require(_0xc827('0x0'))['db'];var config=require(_0xc827('0x1'));function getValueFromLicense(_0x221716,_0x36280c){if(_0x221716&&_0x36280c){if(_0x36280c['data1']&&_0x36280c[_0xc827('0x2')]){var _0x2aefc5=_0x36280c['data1'];var _0x29cf81=_0x36280c[_0xc827('0x2')];var _0x32383b=_0x2aefc5[_0xc827('0x3')]('-')[0x4];var _0x33f695=_0x2aefc5[_0xc827('0x3')]('-')[0x0];var _0x40f7d5=crypto['createDecipher'](_0xc827('0x4'),util[_0xc827('0x5')](_0xc827('0x6'),_0x32383b,_0x2aefc5,_0x33f695));var _0x31f9e5=_0x40f7d5[_0xc827('0x7')](_0x29cf81,_0xc827('0x8'),_0xc827('0x9'));_0x31f9e5+=_0x40f7d5[_0xc827('0xa')]('utf8');var _0x3f0095=JSON['parse'](_0x31f9e5);return _0x3f0095['hasOwnProperty'](_0x221716)?_0x3f0095[_0x221716]:null;}}return null;}function isLimit(_0x1073f8,_0x313eaa,_0x321567,_0x377485){var _0x38f8df=_0x313eaa;return compose()[_0xc827('0xb')](function(_0x4a784d,_0x2a207a,_0x332b5e){return db[_0xc827('0xc')][_0xc827('0xd')]({'where':{'id':0x1},'raw':!![]})['then'](function(_0x2d9dc3){var _0x1575ad=getValueFromLicense(_0x1073f8,_0x2d9dc3);return _0x1575ad?_0x1575ad:_0x38f8df;})[_0xc827('0xe')](function(_0x2abe0b){_0x38f8df=_0x2abe0b;return _0x321567[_0xc827('0xf')](_0x377485);})['then'](function(_0x2cb271){if(_0x2cb271>=_0x38f8df){return _0x2a207a[_0xc827('0x10')](0x193)[_0xc827('0x11')]({'message':util[_0xc827('0x5')](_0xc827('0x12'),_0x1073f8)});}_0x332b5e();})[_0xc827('0x13')](function(_0x2eb76c){_0x332b5e(_0x2eb76c);});});}function isUserLimit(){return isLimit('users',0x1,db[_0xc827('0x14')],{'where':{'$or':[{'role':_0xc827('0x15')},{'role':'user'}]}});}exports[_0xc827('0x16')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index 390f8e6..c63bfdb 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 _0x9f1c=['LIKE\x20?','$lt','$gt','<=\x20?','$gte','$between','BETWEEN\x20?\x20AND\x20?','start','pop','hours','minutes','lodash','moment','startsWith','[$or]','and','[$and]','replace','split','slice','forEach','shift','filter','map','conditions','push','buildExpression','$eq','operator','value','$lte','add','days','format','YYYY-MM-DD','castTo','text','CAST(','field','includes','$ne','$notIn','\x20IS\x20NULL)','$in','IN\x20?','NOT\x20IN\x20?','<>\x20?','$substring','$startsWith','$endsWith'];(function(_0x3f7fe1,_0x4d1af1){var _0x42181f=function(_0x3dbc0e){while(--_0x3dbc0e){_0x3f7fe1['push'](_0x3f7fe1['shift']());}};_0x42181f(++_0x4d1af1);}(_0x9f1c,0xd3));var _0xc9f1=function(_0x3dae48,_0x45777e){_0x3dae48=_0x3dae48-0x0;var _0xff2a19=_0x9f1c[_0x3dae48];return _0xff2a19;};'use strict';var _=require(_0xc9f1('0x0'));var moment=require(_0xc9f1('0x1'));exports['parseSearch']=function(_0x122151){var _0x3bd020={'conditions':[]};_0x3bd020['sqlOperator']=_[_0xc9f1('0x2')](_0x122151,_0xc9f1('0x3'))?'or':_0xc9f1('0x4');var _0xb32797=_0x122151['replace'](_0xc9f1('0x5'),'')[_0xc9f1('0x6')](_0xc9f1('0x3'),'')[_0xc9f1('0x7')]('||');for(var _0x4202ad=0x0;_0x4202ad<_0xb32797['length'];_0x4202ad++){var _0x39b130=_0xb32797[_0x4202ad][_0xc9f1('0x7')](':=');var _0x1ef9a4=_0x39b130[0x0];var _0x48e6de=_0x39b130[_0xc9f1('0x8')](0x1);_0x48e6de[_0xc9f1('0x9')](function(_0x183d8b){var _0x2cf80f=_0x183d8b[_0xc9f1('0x7')]('[')[_0xc9f1('0xa')]();var _0x2f397d=_0x183d8b['match'](/\[(.*?)\]/g);_0x2f397d[_0xc9f1('0x9')](function(_0x3e3543){var _0x2d2155=_0x3e3543[_0xc9f1('0x7')]('[')[_0xc9f1('0xb')](function(_0x4d1f00){return _0x4d1f00['indexOf'](']')>-0x1;})[_0xc9f1('0xc')](function(_0x16743c){return _0x16743c[_0xc9f1('0x7')](']')[0x0];})[0x0];_0x3bd020[_0xc9f1('0xd')][_0xc9f1('0xe')]({'field':_0x1ef9a4,'operator':_0x2cf80f,'value':_0x2d2155});});});}return _0x3bd020;};exports[_0xc9f1('0xf')]=function(_0x25bc85,_0x28721e,_0x54ea8c){var _0x12382c={};if(_0x28721e==='DATE'){if(_0x54ea8c['operator']===_0xc9f1('0x10')){_0x54ea8c[_0xc9f1('0x11')]='$between';_0x54ea8c['value']+=','+_0x54ea8c[_0xc9f1('0x12')];}else if(_['includes'](['$gt',_0xc9f1('0x13')],_0x54ea8c[_0xc9f1('0x11')])){_0x54ea8c[_0xc9f1('0x12')]=moment(_0x54ea8c[_0xc9f1('0x12')])[_0xc9f1('0x14')](0x1,_0xc9f1('0x15'))[_0xc9f1('0x16')](_0xc9f1('0x17'));}}if(_0x54ea8c[_0xc9f1('0x18')]){_0x28721e=_0x54ea8c[_0xc9f1('0x18')];_0x12382c[_0xc9f1('0x19')]=_0xc9f1('0x1a')+_0x25bc85+'.'+_0x54ea8c[_0xc9f1('0x1b')]+'\x20AS\x20'+_0x54ea8c['castTo']+')\x20'+parseOperator(_0x54ea8c[_0xc9f1('0x11')]);}else{_0x12382c[_0xc9f1('0x19')]=_0x25bc85+'.'+_0x54ea8c[_0xc9f1('0x1b')]+'\x20'+parseOperator(_0x54ea8c[_0xc9f1('0x11')]);}if(_[_0xc9f1('0x1c')]([_0xc9f1('0x1d'),_0xc9f1('0x1e')],_0x54ea8c[_0xc9f1('0x11')]))_0x12382c[_0xc9f1('0x19')]='('+_0x12382c['text']+'\x20OR\x20'+_0x25bc85+'.'+_0x54ea8c[_0xc9f1('0x1b')]+_0xc9f1('0x1f');_0x12382c[_0xc9f1('0x12')]=parseValue(_0x28721e,_0x54ea8c['operator'],_0x54ea8c[_0xc9f1('0x12')]);return _0x12382c;};function parseOperator(_0x3ef89a){var _0x26f754;switch(_0x3ef89a){case _0xc9f1('0x20'):_0x26f754=_0xc9f1('0x21');break;case _0xc9f1('0x1e'):_0x26f754=_0xc9f1('0x22');break;case _0xc9f1('0x10'):_0x26f754='=\x20?';break;case _0xc9f1('0x1d'):_0x26f754=_0xc9f1('0x23');break;case _0xc9f1('0x24'):case _0xc9f1('0x25'):case _0xc9f1('0x26'):_0x26f754=_0xc9f1('0x27');break;case _0xc9f1('0x28'):_0x26f754='<\x20?';break;case _0xc9f1('0x29'):_0x26f754='>\x20?';break;case'$lte':_0x26f754=_0xc9f1('0x2a');break;case _0xc9f1('0x2b'):_0x26f754='>=\x20?';break;case _0xc9f1('0x2c'):_0x26f754=_0xc9f1('0x2d');break;}return _0x26f754;}function parseValue(_0x34dc97,_0x578c18,_0x408fd5){var _0x45bf42={'start':undefined,'end':undefined};switch(_0x578c18){case _0xc9f1('0x20'):case'$notIn':_0x45bf42[_0xc9f1('0x2e')]=_0x408fd5[_0xc9f1('0x7')](',');break;case'$substring':_0x45bf42['start']='%'+_0x408fd5+'%';break;case _0xc9f1('0x25'):_0x45bf42[_0xc9f1('0x2e')]=_0x408fd5+'%';break;case _0xc9f1('0x26'):_0x45bf42[_0xc9f1('0x2e')]='%'+_0x408fd5;break;case'$between':var _0x543268=_0x408fd5[_0xc9f1('0x7')](',');var _0x408fd5=_0x543268[_0xc9f1('0xa')]();var _0xb02d21=_0x543268[_0xc9f1('0x2f')]();if(_0x34dc97==='DATE'){_0x408fd5=moment(_0x408fd5)['utcOffset'](0x0,!![])[_0xc9f1('0x16')]();_0xb02d21=moment(_0xb02d21)['utcOffset'](0x0,!![])['add'](0x17,_0xc9f1('0x30'))['add'](0x3b,_0xc9f1('0x31'))[_0xc9f1('0x14')](0x3b,'seconds')[_0xc9f1('0x16')]();}_0x45bf42={'start':_0x408fd5,'end':_0xb02d21};break;default:_0x45bf42[_0xc9f1('0x2e')]=_0x408fd5;break;}return _0x45bf42;} \ No newline at end of file +var _0xa507=['field','\x20AS\x20','$ne','$notIn','text','\x20OR\x20','\x20IS\x20NULL)','$in','IN\x20?','NOT\x20IN\x20?','=\x20?','<>\x20?','$substring','$startsWith','$lt','<\x20?','>\x20?','$lte','<=\x20?','$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?','start','$endsWith','pop','utcOffset','add','minutes','seconds','lodash','moment','parseSearch','sqlOperator','startsWith','[$or]','replace','[$and]','split','slice','forEach','shift','filter','indexOf','map','conditions','push','buildExpression','DATE','operator','$eq','$between','value','includes','$gt','days','format','YYYY-MM-DD','castTo','CAST('];(function(_0x35ccde,_0xbe027){var _0xbd6110=function(_0xba7aea){while(--_0xba7aea){_0x35ccde['push'](_0x35ccde['shift']());}};_0xbd6110(++_0xbe027);}(_0xa507,0xce));var _0x7a50=function(_0x33ac75,_0x4953e3){_0x33ac75=_0x33ac75-0x0;var _0x34d5f2=_0xa507[_0x33ac75];return _0x34d5f2;};'use strict';var _=require(_0x7a50('0x0'));var moment=require(_0x7a50('0x1'));exports[_0x7a50('0x2')]=function(_0x31fb81){var _0x1f92d0={'conditions':[]};_0x1f92d0[_0x7a50('0x3')]=_[_0x7a50('0x4')](_0x31fb81,_0x7a50('0x5'))?'or':'and';var _0x27d548=_0x31fb81[_0x7a50('0x6')](_0x7a50('0x7'),'')[_0x7a50('0x6')](_0x7a50('0x5'),'')[_0x7a50('0x8')]('||');for(var _0x37cc3b=0x0;_0x37cc3b<_0x27d548['length'];_0x37cc3b++){var _0x14a282=_0x27d548[_0x37cc3b][_0x7a50('0x8')](':=');var _0x5da685=_0x14a282[0x0];var _0x27da6f=_0x14a282[_0x7a50('0x9')](0x1);_0x27da6f[_0x7a50('0xa')](function(_0x1bcf62){var _0x14378c=_0x1bcf62[_0x7a50('0x8')]('[')[_0x7a50('0xb')]();var _0x29690d=_0x1bcf62['match'](/\[(.*?)\]/g);_0x29690d[_0x7a50('0xa')](function(_0x560a62){var _0x54e1a6=_0x560a62['split']('[')[_0x7a50('0xc')](function(_0x51a746){return _0x51a746[_0x7a50('0xd')](']')>-0x1;})[_0x7a50('0xe')](function(_0x20c9bc){return _0x20c9bc[_0x7a50('0x8')](']')[0x0];})[0x0];_0x1f92d0[_0x7a50('0xf')][_0x7a50('0x10')]({'field':_0x5da685,'operator':_0x14378c,'value':_0x54e1a6});});});}return _0x1f92d0;};exports[_0x7a50('0x11')]=function(_0x2c1379,_0x1307b3,_0x39b645){var _0x4ea9bd={};if(_0x1307b3===_0x7a50('0x12')){if(_0x39b645[_0x7a50('0x13')]===_0x7a50('0x14')){_0x39b645[_0x7a50('0x13')]=_0x7a50('0x15');_0x39b645[_0x7a50('0x16')]+=','+_0x39b645[_0x7a50('0x16')];}else if(_[_0x7a50('0x17')]([_0x7a50('0x18'),'$lte'],_0x39b645[_0x7a50('0x13')])){_0x39b645[_0x7a50('0x16')]=moment(_0x39b645[_0x7a50('0x16')])['add'](0x1,_0x7a50('0x19'))[_0x7a50('0x1a')](_0x7a50('0x1b'));}}if(_0x39b645['castTo']){_0x1307b3=_0x39b645[_0x7a50('0x1c')];_0x4ea9bd['text']=_0x7a50('0x1d')+_0x2c1379+'.'+_0x39b645[_0x7a50('0x1e')]+_0x7a50('0x1f')+_0x39b645['castTo']+')\x20'+parseOperator(_0x39b645[_0x7a50('0x13')]);}else{_0x4ea9bd['text']=_0x2c1379+'.'+_0x39b645[_0x7a50('0x1e')]+'\x20'+parseOperator(_0x39b645['operator']);}if(_['includes']([_0x7a50('0x20'),_0x7a50('0x21')],_0x39b645['operator']))_0x4ea9bd[_0x7a50('0x22')]='('+_0x4ea9bd[_0x7a50('0x22')]+_0x7a50('0x23')+_0x2c1379+'.'+_0x39b645[_0x7a50('0x1e')]+_0x7a50('0x24');_0x4ea9bd[_0x7a50('0x16')]=parseValue(_0x1307b3,_0x39b645[_0x7a50('0x13')],_0x39b645[_0x7a50('0x16')]);return _0x4ea9bd;};function parseOperator(_0x282d16){var _0x5d3af6;switch(_0x282d16){case _0x7a50('0x25'):_0x5d3af6=_0x7a50('0x26');break;case _0x7a50('0x21'):_0x5d3af6=_0x7a50('0x27');break;case _0x7a50('0x14'):_0x5d3af6=_0x7a50('0x28');break;case _0x7a50('0x20'):_0x5d3af6=_0x7a50('0x29');break;case _0x7a50('0x2a'):case _0x7a50('0x2b'):case'$endsWith':_0x5d3af6='LIKE\x20?';break;case _0x7a50('0x2c'):_0x5d3af6=_0x7a50('0x2d');break;case'$gt':_0x5d3af6=_0x7a50('0x2e');break;case _0x7a50('0x2f'):_0x5d3af6=_0x7a50('0x30');break;case _0x7a50('0x31'):_0x5d3af6=_0x7a50('0x32');break;case _0x7a50('0x15'):_0x5d3af6=_0x7a50('0x33');break;}return _0x5d3af6;}function parseValue(_0x21e1e4,_0x3b6505,_0x5c792a){var _0x316f24={'start':undefined,'end':undefined};switch(_0x3b6505){case _0x7a50('0x25'):case _0x7a50('0x21'):_0x316f24[_0x7a50('0x34')]=_0x5c792a[_0x7a50('0x8')](',');break;case'$substring':_0x316f24[_0x7a50('0x34')]='%'+_0x5c792a+'%';break;case _0x7a50('0x2b'):_0x316f24[_0x7a50('0x34')]=_0x5c792a+'%';break;case _0x7a50('0x35'):_0x316f24['start']='%'+_0x5c792a;break;case _0x7a50('0x15'):var _0x4de204=_0x5c792a[_0x7a50('0x8')](',');var _0x5c792a=_0x4de204['shift']();var _0x22317b=_0x4de204[_0x7a50('0x36')]();if(_0x21e1e4===_0x7a50('0x12')){_0x5c792a=moment(_0x5c792a)['utcOffset'](0x0,!![])['format']();_0x22317b=moment(_0x22317b)[_0x7a50('0x37')](0x0,!![])[_0x7a50('0x38')](0x17,'hours')[_0x7a50('0x38')](0x3b,_0x7a50('0x39'))[_0x7a50('0x38')](0x3b,_0x7a50('0x3a'))[_0x7a50('0x1a')]();}_0x316f24={'start':_0x5c792a,'end':_0x22317b};break;default:_0x316f24[_0x7a50('0x34')]=_0x5c792a;break;}return _0x316f24;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index 386d47a..1c16d6b 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 _0x8cad=['^[+]?[0-9]*$','match','getFullTextValue','replace','query','$id','model','name','intersection','attributes','hasOwnProperty','offset','order','pick','where','VIRTUAL','lower','filter','merge','options','lodash','sequelize','moment','parse','includes','keys','fields','split','filters','isEmpty','forOwn','find','type','isPlainObject','$gte','YYYY-MM-DD','$lte','utc','uniqueid','limit','sort','map','indexOf','priority','col','substr','DESC','cast','unsigned','ASC','omit','isArray','length','isObject','isString','unset','isNumeric'];(function(_0x4d8ed9,_0x2ae284){var _0x1e2140=function(_0x9cca89){while(--_0x9cca89){_0x4d8ed9['push'](_0x4d8ed9['shift']());}};_0x1e2140(++_0x2ae284);}(_0x8cad,0x1a3));var _0xd8ca=function(_0x1589dd,_0x2b9d22){_0x1589dd=_0x1589dd-0x0;var _0x1bddd1=_0x8cad[_0x1589dd];return _0x1bddd1;};'use strict';var _=require(_0xd8ca('0x0'));var sequelize=require(_0xd8ca('0x1'));var moment=require(_0xd8ca('0x2'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x18acb8){var _0x2aeccf=['ne'];try{var _0x58790f=JSON[_0xd8ca('0x3')](_0x18acb8);var _0x318a2e=Object['keys'](_0x58790f)[0x0];return _0x2aeccf[_0xd8ca('0x4')](_0x318a2e);}catch(_0x2c0ec3){return![];}}function getOperatorValue(_0x52129e){var _0x557406=JSON[_0xd8ca('0x3')](_0x52129e);var _0x19cbff=Object[_0xd8ca('0x5')](_0x557406)[0x0];var _0x37c273=_0x557406[_0x19cbff];return{['$'+_0x19cbff]:_0x37c273};}exports[_0xd8ca('0x6')]=function(_0x58ab03){var _0x3d47b0=null;if(_0x58ab03){_0x3d47b0=_0x58ab03[_0xd8ca('0x7')](',');}return _0x3d47b0;};exports[_0xd8ca('0x8')]=function(_0x470fa5,_0x121d9b){var _0x2f87b5={};if(!_[_0xd8ca('0x9')](_0x470fa5)){_[_0xd8ca('0xa')](_0x470fa5,function(_0x4cd1b4,_0x1afd68){try{if(_0x121d9b){var _0x262a30=_[_0xd8ca('0xb')](_0x121d9b,{'name':_0x1afd68})||{};if(hasSequelizeOperator(_0x4cd1b4)){_0x2f87b5[_0x1afd68]=getOperatorValue(_0x4cd1b4);}else if(_0x262a30[_0xd8ca('0xc')]==='DATE'&&_[_0xd8ca('0xd')](_0x4cd1b4)){var _0x3a5501=JSON[_0xd8ca('0x3')](_0x4cd1b4);var _0x533766={'$gte':moment(moment(_0x3a5501[_0xd8ca('0xe')])['format'](_0xd8ca('0xf')))['utc']()['format'](),'$lte':moment(moment(_0x3a5501[_0xd8ca('0x10')])['format']('YYYY-MM-DD'))[_0xd8ca('0x11')]()['subtract'](0x1,'s')['format']()};_0x2f87b5[_0x1afd68]=_0x533766;}else if(_0x262a30['name']===_0xd8ca('0x12')){_0x2f87b5[_0x1afd68]=_0x4cd1b4;}else{_0x2f87b5[_0x1afd68]=_['isArray'](_0x4cd1b4)?_0x4cd1b4:JSON[_0xd8ca('0x3')](_0x4cd1b4);}}else{_0x2f87b5[_0x1afd68]=_['isArray'](_0x4cd1b4)?_0x4cd1b4:JSON[_0xd8ca('0x3')](_0x4cd1b4);}}catch(_0x362227){_0x2f87b5[_0x1afd68]=_0x4cd1b4['split'](',');}});}return _0x2f87b5;};exports[_0xd8ca('0x13')]=function(_0x249bd4){_0x249bd4=parseInt(_0x249bd4,0xa);if(!_0x249bd4||_0x249bd4<0x0){_0x249bd4=LIMIT_VALUE;}return _0x249bd4;};exports['offset']=function(_0x1a3472){_0x1a3472=parseInt(_0x1a3472,0xa);if(!_0x1a3472||_0x1a3472<0x0){_0x1a3472=0x0;}return _0x1a3472;};exports[_0xd8ca('0x14')]=function(_0x27391b){var _0x4513a4,_0xfe0f0d=null;if(_0x27391b){_0x4513a4=_0x27391b['split'](',');_0xfe0f0d=_[_0xd8ca('0x15')](_0x4513a4,function(_0x48d2dc){if(_0x48d2dc[_0xd8ca('0x16')]('-')===0x0){return[_0x48d2dc===_0xd8ca('0x17')?sequelize['cast'](sequelize[_0xd8ca('0x18')](_0xd8ca('0x17')),'unsigned'):_0x48d2dc[_0xd8ca('0x19')](0x1),_0xd8ca('0x1a')];}else{return[_0x48d2dc===_0xd8ca('0x17')?sequelize[_0xd8ca('0x1b')](sequelize[_0xd8ca('0x18')](_0xd8ca('0x17')),_0xd8ca('0x1c')):_0x48d2dc,_0xd8ca('0x1d')];}});}return _0xfe0f0d;};exports[_0xd8ca('0x1e')]=function(_0x37644a,_0x41c077){if(_[_0xd8ca('0x9')](_0x37644a)){return _0x37644a;}if(_[_0xd8ca('0x1f')](_0x37644a)){for(var _0x31006e=0x0;_0x31006e<_0x37644a[_0xd8ca('0x20')];_0x31006e+=0x1){_0x37644a[_0x31006e]=this[_0xd8ca('0x1e')](_0x37644a[_0x31006e],_0x41c077);}return _0x37644a;}if(!_[_0xd8ca('0x21')](_0x37644a)){return _0x37644a;}if(_[_0xd8ca('0x22')](_0x41c077)){_0x41c077=[_0x41c077];}if(!_[_0xd8ca('0x1f')](_0x41c077)){return _0x37644a;}for(var _0x351a54=0x0;_0x351a54<_0x41c077[_0xd8ca('0x20')];_0x351a54+=0x1){_[_0xd8ca('0x23')](_0x37644a,_0x41c077[_0x351a54]);}for(var _0x3a4cff in _0x37644a){if(_0x37644a['hasOwnProperty'](_0x3a4cff)){_0x37644a[_0x3a4cff]=this['omit'](_0x37644a[_0x3a4cff],_0x41c077);}}return _0x37644a;};exports[_0xd8ca('0x24')]=function(_0x505c15){return _0x505c15['match'](RegExp(_0xd8ca('0x25')))?!![]:![];};exports['isEmail']=function(_0x337f5d){return _0x337f5d[_0xd8ca('0x26')](/^\S+@\S+$/)?!![]:![];};exports[_0xd8ca('0x27')]=function(_0x41fc3a){var _0x388899=[];_0x41fc3a['split'](/[ ,]+/)['forEach'](function(_0x27f595){_0x27f595=_0x27f595[_0xd8ca('0x28')](/([^:]")"+/g,'$1');_0x27f595='+'+_0x27f595+'*';if(_0x27f595['includes']('@'))_0x27f595='\x22'+_0x27f595+'\x22';_0x388899['push'](_0x27f595);});return _0x388899['join']('\x20');};exports['getOptions']=function(_0x54d5ab,_0x2c684c,_0x4262f8){var _0xc2ccc2={},_0x288e2e={};if(_0x2c684c[_0xd8ca('0x29')][_0xd8ca('0x2a')]){_0x2c684c[_0xd8ca('0x29')]['id']=_0x2c684c['query']['$id'];delete _0x2c684c[_0xd8ca('0x29')]['$id'];}_0xc2ccc2[_0xd8ca('0x2b')]=_[_0xd8ca('0x15')](_0x54d5ab,_0xd8ca('0x2c'));_0xc2ccc2[_0xd8ca('0x29')]=_['keys'](_0x2c684c[_0xd8ca('0x29')]);_0xc2ccc2[_0xd8ca('0x8')]=_[_0xd8ca('0x2d')](_0xc2ccc2[_0xd8ca('0x2b')],_0xc2ccc2[_0xd8ca('0x29')]);_0x288e2e[_0xd8ca('0x2e')]=_[_0xd8ca('0x2d')](_0xc2ccc2['model'],this[_0xd8ca('0x6')](_0x2c684c[_0xd8ca('0x29')][_0xd8ca('0x6')]));_0x288e2e[_0xd8ca('0x2e')]=_0x288e2e['attributes'][_0xd8ca('0x20')]?_0x288e2e['attributes']:_0xc2ccc2[_0xd8ca('0x2b')];if(!_0x2c684c['query'][_0xd8ca('0x2f')]('nolimit')){_0x288e2e['limit']=this[_0xd8ca('0x13')](_0x2c684c['query'][_0xd8ca('0x13')]);_0x288e2e[_0xd8ca('0x30')]=this['offset'](_0x2c684c[_0xd8ca('0x29')][_0xd8ca('0x30')]);}_0x288e2e[_0xd8ca('0x31')]=this[_0xd8ca('0x14')](_0x2c684c['query'][_0xd8ca('0x14')]);_0x288e2e['where']=this[_0xd8ca('0x8')](_[_0xd8ca('0x32')](_0x2c684c[_0xd8ca('0x29')],_0xc2ccc2['filters']),_0x54d5ab);if(_0x2c684c['query']['filter']){_0x288e2e[_0xd8ca('0x33')]=_['merge'](_0x288e2e['where'],{'$or':_[_0xd8ca('0x15')](_0x54d5ab,function(_0x445266){if(_0x445266[_0xd8ca('0xc')]!==_0xd8ca('0x34')){if(_0x4262f8){return sequelize[_0xd8ca('0x33')](sequelize['fn']('lower',sequelize[_0xd8ca('0x18')](_0x445266[_0xd8ca('0x2c')])),{'$like':sequelize['fn'](_0xd8ca('0x35'),'%'+_0x2c684c[_0xd8ca('0x29')][_0xd8ca('0x36')]+'%')});}else{var _0x4c3bf7={};_0x4c3bf7[_0x445266[_0xd8ca('0x2c')]]={'$like':'%'+_0x2c684c[_0xd8ca('0x29')][_0xd8ca('0x36')]+'%'};return _0x4c3bf7;}}})});}_0x288e2e=_[_0xd8ca('0x37')]({},_0x288e2e,_0x2c684c[_0xd8ca('0x38')]);return _0x288e2e;}; \ No newline at end of file +var _0x7cfa=['parse','includes','keys','split','isEmpty','forOwn','find','type','isPlainObject','$gte','format','YYYY-MM-DD','utc','$lte','subtract','name','uniqueid','isArray','limit','offset','sort','map','indexOf','priority','cast','col','unsigned','substr','DESC','ASC','omit','length','isObject','unset','match','^[+]?[0-9]*$','isEmail','forEach','replace','join','getOptions','query','$id','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','where','filters','pick','lower','filter','lodash','moment'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0x7cfa,0xa9));var _0xa7cf=function(_0x2e0454,_0x5ca866){_0x2e0454=_0x2e0454-0x0;var _0x3e00f5=_0x7cfa[_0x2e0454];return _0x3e00f5;};'use strict';var _=require(_0xa7cf('0x0'));var sequelize=require('sequelize');var moment=require(_0xa7cf('0x1'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x23104c){var _0x2b6131=['ne'];try{var _0x52e95f=JSON[_0xa7cf('0x2')](_0x23104c);var _0x314bb1=Object['keys'](_0x52e95f)[0x0];return _0x2b6131[_0xa7cf('0x3')](_0x314bb1);}catch(_0x417ebd){return![];}}function getOperatorValue(_0x2fa803){var _0x3944e6=JSON[_0xa7cf('0x2')](_0x2fa803);var _0x546bb5=Object[_0xa7cf('0x4')](_0x3944e6)[0x0];var _0x170014=_0x3944e6[_0x546bb5];return{['$'+_0x546bb5]:_0x170014};}exports['fields']=function(_0x7679e5){var _0x53f9cd=null;if(_0x7679e5){_0x53f9cd=_0x7679e5[_0xa7cf('0x5')](',');}return _0x53f9cd;};exports['filters']=function(_0x1c71fd,_0xa7b6e6){var _0x397f41={};if(!_[_0xa7cf('0x6')](_0x1c71fd)){_[_0xa7cf('0x7')](_0x1c71fd,function(_0x5a5ce8,_0x9c30f7){try{if(_0xa7b6e6){var _0x965dc0=_[_0xa7cf('0x8')](_0xa7b6e6,{'name':_0x9c30f7})||{};if(hasSequelizeOperator(_0x5a5ce8)){_0x397f41[_0x9c30f7]=getOperatorValue(_0x5a5ce8);}else if(_0x965dc0[_0xa7cf('0x9')]==='DATE'&&_[_0xa7cf('0xa')](_0x5a5ce8)){var _0x19c40f=JSON[_0xa7cf('0x2')](_0x5a5ce8);var _0x3303c8={'$gte':moment(moment(_0x19c40f[_0xa7cf('0xb')])[_0xa7cf('0xc')](_0xa7cf('0xd')))[_0xa7cf('0xe')]()['format'](),'$lte':moment(moment(_0x19c40f[_0xa7cf('0xf')])[_0xa7cf('0xc')](_0xa7cf('0xd')))[_0xa7cf('0xe')]()[_0xa7cf('0x10')](0x1,'s')[_0xa7cf('0xc')]()};_0x397f41[_0x9c30f7]=_0x3303c8;}else if(_0x965dc0[_0xa7cf('0x11')]===_0xa7cf('0x12')){_0x397f41[_0x9c30f7]=_0x5a5ce8;}else{_0x397f41[_0x9c30f7]=_[_0xa7cf('0x13')](_0x5a5ce8)?_0x5a5ce8:JSON[_0xa7cf('0x2')](_0x5a5ce8);}}else{_0x397f41[_0x9c30f7]=_[_0xa7cf('0x13')](_0x5a5ce8)?_0x5a5ce8:JSON['parse'](_0x5a5ce8);}}catch(_0x54bbe6){_0x397f41[_0x9c30f7]=_0x5a5ce8[_0xa7cf('0x5')](',');}});}return _0x397f41;};exports[_0xa7cf('0x14')]=function(_0x2ab5aa){_0x2ab5aa=parseInt(_0x2ab5aa,0xa);if(!_0x2ab5aa||_0x2ab5aa<0x0){_0x2ab5aa=LIMIT_VALUE;}return _0x2ab5aa;};exports[_0xa7cf('0x15')]=function(_0x533cb4){_0x533cb4=parseInt(_0x533cb4,0xa);if(!_0x533cb4||_0x533cb4<0x0){_0x533cb4=0x0;}return _0x533cb4;};exports[_0xa7cf('0x16')]=function(_0x566de9){var _0xf6528f,_0x46c5e9=null;if(_0x566de9){_0xf6528f=_0x566de9[_0xa7cf('0x5')](',');_0x46c5e9=_[_0xa7cf('0x17')](_0xf6528f,function(_0x24e4ad){if(_0x24e4ad[_0xa7cf('0x18')]('-')===0x0){return[_0x24e4ad===_0xa7cf('0x19')?sequelize[_0xa7cf('0x1a')](sequelize[_0xa7cf('0x1b')](_0xa7cf('0x19')),_0xa7cf('0x1c')):_0x24e4ad[_0xa7cf('0x1d')](0x1),_0xa7cf('0x1e')];}else{return[_0x24e4ad==='priority'?sequelize[_0xa7cf('0x1a')](sequelize['col']('priority'),_0xa7cf('0x1c')):_0x24e4ad,_0xa7cf('0x1f')];}});}return _0x46c5e9;};exports[_0xa7cf('0x20')]=function(_0x3be63f,_0x293705){if(_[_0xa7cf('0x6')](_0x3be63f)){return _0x3be63f;}if(_[_0xa7cf('0x13')](_0x3be63f)){for(var _0x359f14=0x0;_0x359f14<_0x3be63f[_0xa7cf('0x21')];_0x359f14+=0x1){_0x3be63f[_0x359f14]=this[_0xa7cf('0x20')](_0x3be63f[_0x359f14],_0x293705);}return _0x3be63f;}if(!_[_0xa7cf('0x22')](_0x3be63f)){return _0x3be63f;}if(_['isString'](_0x293705)){_0x293705=[_0x293705];}if(!_[_0xa7cf('0x13')](_0x293705)){return _0x3be63f;}for(var _0x59ff38=0x0;_0x59ff38<_0x293705['length'];_0x59ff38+=0x1){_[_0xa7cf('0x23')](_0x3be63f,_0x293705[_0x59ff38]);}for(var _0x4cec32 in _0x3be63f){if(_0x3be63f['hasOwnProperty'](_0x4cec32)){_0x3be63f[_0x4cec32]=this[_0xa7cf('0x20')](_0x3be63f[_0x4cec32],_0x293705);}}return _0x3be63f;};exports['isNumeric']=function(_0x4a680c){return _0x4a680c[_0xa7cf('0x24')](RegExp(_0xa7cf('0x25')))?!![]:![];};exports[_0xa7cf('0x26')]=function(_0x1cb678){return _0x1cb678[_0xa7cf('0x24')](/^\S+@\S+$/)?!![]:![];};exports['getFullTextValue']=function(_0x4f9492){var _0x174d6a=[];_0x4f9492[_0xa7cf('0x5')](/[ ,]+/)[_0xa7cf('0x27')](function(_0x298654){_0x298654=_0x298654[_0xa7cf('0x28')](/([^:]")"+/g,'$1');_0x298654='+'+_0x298654+'*';if(_0x298654[_0xa7cf('0x3')]('@'))_0x298654='\x22'+_0x298654+'\x22';_0x174d6a['push'](_0x298654);});return _0x174d6a[_0xa7cf('0x29')]('\x20');};exports[_0xa7cf('0x2a')]=function(_0x5aa73a,_0x1da406,_0x38b265){var _0x2e7a69={},_0x547f6a={};if(_0x1da406[_0xa7cf('0x2b')]['$id']){_0x1da406[_0xa7cf('0x2b')]['id']=_0x1da406[_0xa7cf('0x2b')][_0xa7cf('0x2c')];delete _0x1da406[_0xa7cf('0x2b')][_0xa7cf('0x2c')];}_0x2e7a69['model']=_[_0xa7cf('0x17')](_0x5aa73a,_0xa7cf('0x11'));_0x2e7a69[_0xa7cf('0x2b')]=_['keys'](_0x1da406[_0xa7cf('0x2b')]);_0x2e7a69['filters']=_[_0xa7cf('0x2d')](_0x2e7a69[_0xa7cf('0x2e')],_0x2e7a69[_0xa7cf('0x2b')]);_0x547f6a[_0xa7cf('0x2f')]=_[_0xa7cf('0x2d')](_0x2e7a69['model'],this[_0xa7cf('0x30')](_0x1da406['query']['fields']));_0x547f6a['attributes']=_0x547f6a[_0xa7cf('0x2f')]['length']?_0x547f6a[_0xa7cf('0x2f')]:_0x2e7a69[_0xa7cf('0x2e')];if(!_0x1da406['query'][_0xa7cf('0x31')](_0xa7cf('0x32'))){_0x547f6a[_0xa7cf('0x14')]=this[_0xa7cf('0x14')](_0x1da406[_0xa7cf('0x2b')][_0xa7cf('0x14')]);_0x547f6a['offset']=this['offset'](_0x1da406[_0xa7cf('0x2b')][_0xa7cf('0x15')]);}_0x547f6a[_0xa7cf('0x33')]=this[_0xa7cf('0x16')](_0x1da406[_0xa7cf('0x2b')][_0xa7cf('0x16')]);_0x547f6a[_0xa7cf('0x34')]=this[_0xa7cf('0x35')](_[_0xa7cf('0x36')](_0x1da406[_0xa7cf('0x2b')],_0x2e7a69[_0xa7cf('0x35')]),_0x5aa73a);if(_0x1da406[_0xa7cf('0x2b')]['filter']){_0x547f6a[_0xa7cf('0x34')]=_['merge'](_0x547f6a[_0xa7cf('0x34')],{'$or':_['map'](_0x5aa73a,function(_0x1273e5){if(_0x1273e5['type']!=='VIRTUAL'){if(_0x38b265){return sequelize[_0xa7cf('0x34')](sequelize['fn'](_0xa7cf('0x37'),sequelize[_0xa7cf('0x1b')](_0x1273e5[_0xa7cf('0x11')])),{'$like':sequelize['fn'](_0xa7cf('0x37'),'%'+_0x1da406['query'][_0xa7cf('0x38')]+'%')});}else{var _0x32cd3b={};_0x32cd3b[_0x1273e5[_0xa7cf('0x11')]]={'$like':'%'+_0x1da406[_0xa7cf('0x2b')][_0xa7cf('0x38')]+'%'};return _0x32cd3b;}}})});}_0x547f6a=_['merge']({},_0x547f6a,_0x1da406['options']);return _0x547f6a;}; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index 1af1b6f..bed7f45 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2a09=['initialize','express','serve-favicon','method-override','errorhandler','passport','moment','./environment','get','env','production','appPath','root','public','development','test','set','join','client','json\x20replacer','toISOString','split','use','static','views','engine','ejs','renderFile','html','urlencoded','50mb','json'];(function(_0x5eed8c,_0x4cc31a){var _0x2fec4e=function(_0x523aed){while(--_0x523aed){_0x5eed8c['push'](_0x5eed8c['shift']());}};_0x2fec4e(++_0x4cc31a);}(_0x2a09,0x1c1));var _0x92a0=function(_0x327405,_0x45a14f){_0x327405=_0x327405-0x0;var _0x32beec=_0x2a09[_0x327405];return _0x32beec;};'use strict';var express=require(_0x92a0('0x0'));var favicon=require(_0x92a0('0x1'));var bodyParser=require('body-parser');var methodOverride=require(_0x92a0('0x2'));var cookieParser=require('cookie-parser');var errorHandler=require(_0x92a0('0x3'));var path=require('path');var passport=require(_0x92a0('0x4'));var cors=require('cors');var moment=require(_0x92a0('0x5'));var config=require(_0x92a0('0x6'));var db=require('../mysqldb')['db'];exports['default']=function(_0x3cd451){var _0x5b8fdb=_0x3cd451[_0x92a0('0x7')](_0x92a0('0x8'));if(_0x5b8fdb===_0x92a0('0x9')){_0x3cd451['set'](_0x92a0('0xa'),path['join'](config[_0x92a0('0xb')],_0x92a0('0xc')));}if(_0x5b8fdb===_0x92a0('0xd')||_0x5b8fdb===_0x92a0('0xe')){_0x3cd451[_0x92a0('0xf')](_0x92a0('0xa'),path[_0x92a0('0x10')](config[_0x92a0('0xb')],_0x92a0('0x11')));_0x3cd451['use'](errorHandler());}_0x3cd451[_0x92a0('0xf')](_0x92a0('0x12'),function(_0x58ff63,_0x57676c){if(this[_0x58ff63]instanceof Date){_0x57676c=this[_0x58ff63][_0x92a0('0x13')]()[_0x92a0('0x14')]('.')[0x0]+'Z';}return _0x57676c;});_0x3cd451[_0x92a0('0x15')](express[_0x92a0('0x16')](_0x3cd451[_0x92a0('0x7')](_0x92a0('0xa'))));_0x3cd451[_0x92a0('0xf')](_0x92a0('0x17'),config[_0x92a0('0xb')]+'/server/views');_0x3cd451[_0x92a0('0x18')]('html',require(_0x92a0('0x19'))[_0x92a0('0x1a')]);_0x3cd451[_0x92a0('0xf')]('view\x20engine',_0x92a0('0x1b'));_0x3cd451[_0x92a0('0x15')](bodyParser[_0x92a0('0x1c')]({'limit':_0x92a0('0x1d'),'extended':!![]}));_0x3cd451['use'](bodyParser[_0x92a0('0x1e')]({'limit':_0x92a0('0x1d')}));_0x3cd451['use'](cors());_0x3cd451[_0x92a0('0x15')](methodOverride());_0x3cd451['use'](cookieParser());_0x3cd451[_0x92a0('0x15')](passport[_0x92a0('0x1f')]());}; \ No newline at end of file +var _0x69d7=['passport','cors','moment','./environment','production','set','root','public','development','test','join','use','toISOString','split','static','get','appPath','/server/views','engine','html','ejs','renderFile','view\x20engine','urlencoded','50mb','json','initialize','method-override','cookie-parser','errorhandler','path'];(function(_0x219ff6,_0x3e45e1){var _0x5e8912=function(_0x3e6d4e){while(--_0x3e6d4e){_0x219ff6['push'](_0x219ff6['shift']());}};_0x5e8912(++_0x3e45e1);}(_0x69d7,0xd5));var _0x769d=function(_0x42b648,_0x47702b){_0x42b648=_0x42b648-0x0;var _0x44ab47=_0x69d7[_0x42b648];return _0x44ab47;};'use strict';var express=require('express');var favicon=require('serve-favicon');var bodyParser=require('body-parser');var methodOverride=require(_0x769d('0x0'));var cookieParser=require(_0x769d('0x1'));var errorHandler=require(_0x769d('0x2'));var path=require(_0x769d('0x3'));var passport=require(_0x769d('0x4'));var cors=require(_0x769d('0x5'));var moment=require(_0x769d('0x6'));var config=require(_0x769d('0x7'));var db=require('../mysqldb')['db'];exports['default']=function(_0x3a56da){var _0x158c5f=_0x3a56da['get']('env');if(_0x158c5f===_0x769d('0x8')){_0x3a56da[_0x769d('0x9')]('appPath',path['join'](config[_0x769d('0xa')],_0x769d('0xb')));}if(_0x158c5f===_0x769d('0xc')||_0x158c5f===_0x769d('0xd')){_0x3a56da['set']('appPath',path[_0x769d('0xe')](config['root'],'client'));_0x3a56da[_0x769d('0xf')](errorHandler());}_0x3a56da['set']('json\x20replacer',function(_0x446b64,_0x5e1af3){if(this[_0x446b64]instanceof Date){_0x5e1af3=this[_0x446b64][_0x769d('0x10')]()[_0x769d('0x11')]('.')[0x0]+'Z';}return _0x5e1af3;});_0x3a56da[_0x769d('0xf')](express[_0x769d('0x12')](_0x3a56da[_0x769d('0x13')](_0x769d('0x14'))));_0x3a56da['set']('views',config[_0x769d('0xa')]+_0x769d('0x15'));_0x3a56da[_0x769d('0x16')](_0x769d('0x17'),require(_0x769d('0x18'))[_0x769d('0x19')]);_0x3a56da[_0x769d('0x9')](_0x769d('0x1a'),_0x769d('0x17'));_0x3a56da[_0x769d('0xf')](bodyParser[_0x769d('0x1b')]({'limit':_0x769d('0x1c'),'extended':!![]}));_0x3a56da[_0x769d('0xf')](bodyParser[_0x769d('0x1d')]({'limit':'50mb'}));_0x3a56da['use'](cors());_0x3a56da['use'](methodOverride());_0x3a56da[_0x769d('0xf')](cookieParser());_0x3a56da[_0x769d('0xf')](passport[_0x769d('0x1e')]());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index c3016e5..997cd32 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 _0x46c9=['substring','crypto','bimedia-machine-uuid','child_process','execSync','orderBy','keys','length','filter','family','internal','concat','head','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','cpus','map','join','createHash','md5','update','hex','getUuid','platform','test','licenseToken','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','digest'];(function(_0x1a381e,_0x3030ab){var _0x4d0482=function(_0x56a0a6){while(--_0x56a0a6){_0x1a381e['push'](_0x1a381e['shift']());}};_0x4d0482(++_0x3030ab);}(_0x46c9,0x13c));var _0x946c=function(_0x290fa6,_0x16d017){_0x290fa6=_0x290fa6-0x0;var _0x47f1f3=_0x46c9[_0x290fa6];return _0x47f1f3;};'use strict';var _=require('lodash');var os=require('os');var crypto=require(_0x946c('0x0'));var machine=require(_0x946c('0x1'));var exec=require(_0x946c('0x2'))[_0x946c('0x3')];var config=require('../environment');function getInterfaces(){var _0x117133=[];var _0x59638a=os['networkInterfaces']();var _0x101db1=_[_0x946c('0x4')](_[_0x946c('0x5')](_0x59638a));for(var _0x91541e=0x0;_0x91541e<_0x101db1[_0x946c('0x6')];_0x91541e++){var _0x3b8945=_0x59638a[_0x101db1[_0x91541e]][_0x946c('0x7')](function(_0x12628b){return _0x12628b[_0x946c('0x8')]==='IPv4'&&_0x12628b[_0x946c('0x9')]===![];});_0x117133=_0x117133[_0x946c('0xa')](_0x3b8945);}return _0x117133;}function getFirstInterface(){var _0x40732e=_[_0x946c('0xb')](getInterfaces());return{'macAddress':_0x40732e&&_0x40732e[_0x946c('0xc')]?_0x40732e[_0x946c('0xc')]:_0x946c('0xd'),'ipAddress':_0x40732e&&_0x40732e[_0x946c('0xe')]?_0x40732e[_0x946c('0xe')]:_0x946c('0xf')};}exports[_0x946c('0x10')]=getFirstInterface;function getCPUhash(){var _0x50eac1=_[_0x946c('0x4')](os[_0x946c('0x11')]()[_0x946c('0x12')](function(_0x2158cc){return _0x2158cc['model'];}))[_0x946c('0x13')](':');return crypto[_0x946c('0x14')](_0x946c('0x15'))[_0x946c('0x16')](_0x50eac1)['digest'](_0x946c('0x17'));}exports[_0x946c('0x18')]=function(){var _0x41e025=os[_0x946c('0x19')]();var _0x34632a=/[0-9a-f-]{36}/;if(config['licenseToken']&&_0x34632a[_0x946c('0x1a')](config[_0x946c('0x1b')])){return config[_0x946c('0x1b')];}else if(_0x41e025===_0x946c('0x1c')){return exec(_0x946c('0x1d'),{'encoding':_0x946c('0x1e')})[_0x946c('0x1f')]('\x0d\x0a','');}else{var _0x24a096=getFirstInterface();var _0xe38cdf=getCPUhash();var _0x45c70c=_0xe38cdf+'|'+os[_0x946c('0x20')]()+'|'+_0x24a096['macAddress']+'|'+_0x24a096['ipAddress'];var _0x2e313b=crypto[_0x946c('0x14')]('md5')[_0x946c('0x16')](_0x45c70c)[_0x946c('0x21')](_0x946c('0x17'));return _0x2e313b[_0x946c('0x22')](0x0,0x8)+'-'+_0x2e313b['substring'](0x8,0xc)+'-'+_0x2e313b['substring'](0xc,0x10)+'-'+_0x2e313b[_0x946c('0x22')](0x10,0x14)+'-'+_0x2e313b[_0x946c('0x22')](0x14);}}; \ No newline at end of file +var _0xd156=['join','createHash','md5','update','digest','hex','platform','test','licenseToken','replace','macAddress','ipAddress','substring','bimedia-machine-uuid','child_process','execSync','orderBy','filter','IPv4','internal','concat','head','mac','address','127.0.0.1','getFirstInterface'];(function(_0x5980bd,_0x47e661){var _0xd73e9a=function(_0x15ba35){while(--_0x15ba35){_0x5980bd['push'](_0x5980bd['shift']());}};_0xd73e9a(++_0x47e661);}(_0xd156,0x15f));var _0x6d15=function(_0x3af918,_0x31965c){_0x3af918=_0x3af918-0x0;var _0x40b183=_0xd156[_0x3af918];return _0x40b183;};'use strict';var _=require('lodash');var os=require('os');var crypto=require('crypto');var machine=require(_0x6d15('0x0'));var exec=require(_0x6d15('0x1'))[_0x6d15('0x2')];var config=require('../environment');function getInterfaces(){var _0x322d3d=[];var _0xcb9efd=os['networkInterfaces']();var _0x3a6ade=_[_0x6d15('0x3')](_['keys'](_0xcb9efd));for(var _0x58dba8=0x0;_0x58dba8<_0x3a6ade['length'];_0x58dba8++){var _0x54989e=_0xcb9efd[_0x3a6ade[_0x58dba8]][_0x6d15('0x4')](function(_0x5e38fb){return _0x5e38fb['family']===_0x6d15('0x5')&&_0x5e38fb[_0x6d15('0x6')]===![];});_0x322d3d=_0x322d3d[_0x6d15('0x7')](_0x54989e);}return _0x322d3d;}function getFirstInterface(){var _0x59d52d=_[_0x6d15('0x8')](getInterfaces());return{'macAddress':_0x59d52d&&_0x59d52d['mac']?_0x59d52d[_0x6d15('0x9')]:'00:00:00:00:00:00','ipAddress':_0x59d52d&&_0x59d52d[_0x6d15('0xa')]?_0x59d52d[_0x6d15('0xa')]:_0x6d15('0xb')};}exports[_0x6d15('0xc')]=getFirstInterface;function getCPUhash(){var _0x6106c1=_[_0x6d15('0x3')](os['cpus']()['map'](function(_0x5310a8){return _0x5310a8['model'];}))[_0x6d15('0xd')](':');return crypto[_0x6d15('0xe')](_0x6d15('0xf'))[_0x6d15('0x10')](_0x6106c1)[_0x6d15('0x11')](_0x6d15('0x12'));}exports['getUuid']=function(){var _0x5c102e=os[_0x6d15('0x13')]();var _0x4093c3=/[0-9a-f-]{36}/;if(config['licenseToken']&&_0x4093c3[_0x6d15('0x14')](config[_0x6d15('0x15')])){return config['licenseToken'];}else if(_0x5c102e==='win32'){return exec('dmidecode\x20--string\x20system-uuid',{'encoding':'utf8'})[_0x6d15('0x16')]('\x0d\x0a','');}else{var _0x13bbd1=getFirstInterface();var _0x2f814f=getCPUhash();var _0x484eda=_0x2f814f+'|'+os['hostname']()+'|'+_0x13bbd1[_0x6d15('0x17')]+'|'+_0x13bbd1[_0x6d15('0x18')];var _0x2dfab0=crypto['createHash'](_0x6d15('0xf'))[_0x6d15('0x10')](_0x484eda)['digest'](_0x6d15('0x12'));return _0x2dfab0[_0x6d15('0x19')](0x0,0x8)+'-'+_0x2dfab0[_0x6d15('0x19')](0x8,0xc)+'-'+_0x2dfab0[_0x6d15('0x19')](0xc,0x10)+'-'+_0x2dfab0['substring'](0x10,0x14)+'-'+_0x2dfab0['substring'](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index dcf72a4..fa5477f 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 _0xbe60=['diff','decryptString','DEMO\x20START\x20AT\x20%s','YYYY-MM-DD\x20HH:mm','error','message','finally','getUuid','License','findOrCreate','default','util','moment','request-promise','pkginfo','version','../../mysqldb','../../components/encryptor','./hardware','../logger','license','format','%s/api/servers/%s/check?version=%s','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','catch','get','data2','then','active','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','data1','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','info','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','update','encryptString'];(function(_0x1ed1e2,_0xdc162){var _0x438756=function(_0x37aaf3){while(--_0x37aaf3){_0x1ed1e2['push'](_0x1ed1e2['shift']());}};_0x438756(++_0xdc162);}(_0xbe60,0x10d));var _0x0be6=function(_0x9770d6,_0x1d88d5){_0x9770d6=_0x9770d6-0x0;var _0x2a7380=_0xbe60[_0x9770d6];return _0x2a7380;};'use strict';var util=require(_0x0be6('0x0'));var moment=require(_0x0be6('0x1'));var rp=require(_0x0be6('0x2'));var BPromise=require('bluebird');var pkginfo=require(_0x0be6('0x3'))(module,_0x0be6('0x4'));var db=require(_0x0be6('0x5'))['db'];var encryptor=require(_0x0be6('0x6'));var hardware=require(_0x0be6('0x7'));var logger=require(_0x0be6('0x8'))(_0x0be6('0x9'));var HOST='https://www.xcallymotion.com';var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x302379){return new BPromise(function(_0x415930,_0x57eae4){var _0x2c841a=util[_0x0be6('0xa')](_0x0be6('0xb'),HOST,_0x302379,module[_0x0be6('0xc')][_0x0be6('0x4')]);if(oldToken){_0x2c841a=util['format'](_0x0be6('0xd'),HOST,_0x302379,module[_0x0be6('0xc')][_0x0be6('0x4')],oldToken);}var _0x43608c={'uri':_0x2c841a,'method':_0x0be6('0xe'),'timeout':0xea60,'json':!![]};return rp(_0x43608c)['then'](function(_0x3b4e85){_0x415930(_0x3b4e85);})[_0x0be6('0xf')](function(_0x3fb713){_0x57eae4(_0x3fb713);});});}function manageLicense(_0x2162b7,_0x203711){var _0x4695cd=_0x203711[_0x0be6('0x10')]({'plain':!![]});if(!isOldTokenSent&&_0x4695cd['data1']!==_0x2162b7&&!_0x4695cd[_0x0be6('0x11')]){oldToken=_0x4695cd['data1'];}httpRequest(_0x2162b7)[_0x0be6('0x12')](function(_0x303db2){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x303db2[_0x0be6('0x13')]){isOldTokenSent=![];if(!_0x4695cd['license']&&_0x4695cd[_0x0be6('0x9')]!=_0x303db2[_0x0be6('0x9')]||_0x4695cd['license']&&_0x4695cd['data2']){logger['info'](_0x0be6('0x14'));}if(_0x4695cd[_0x0be6('0x9')]&&!_0x4695cd[_0x0be6('0x11')]&&_0x4695cd[_0x0be6('0x9')]!=_0x303db2[_0x0be6('0x9')]){logger['info'](_0x0be6('0x15'));}if(_0x4695cd[_0x0be6('0x9')]&&!_0x4695cd[_0x0be6('0x11')]&&_0x4695cd[_0x0be6('0x9')]==_0x303db2[_0x0be6('0x9')]){return _0x203711;}return _0x203711['update']({'data1':_0x2162b7,'data2':null,'license':_0x303db2[_0x0be6('0x9')]});}else{if(_0x303db2[_0x0be6('0x9')]||_0x4695cd[_0x0be6('0x9')]){if(!_0x4695cd['data2']){if(_0x4695cd[_0x0be6('0x16')]==_0x2162b7){GRAY_PERIOD_REASON=_0x0be6('0x17');logger['info'](_0x0be6('0x18'));}else{GRAY_PERIOD_REASON=_0x0be6('0x19');logger[_0x0be6('0x1a')](_0x0be6('0x1b'),_0x4695cd[_0x0be6('0x16')],_0x2162b7);}logger[_0x0be6('0x1a')](_0x0be6('0x1c'),GRAY_PERIOD_REASON[_0x0be6('0x1d')](),moment()[_0x0be6('0xa')]('YYYY-MM-DD\x20HH:mm'));return _0x203711[_0x0be6('0x1e')]({'data2':encryptor[_0x0be6('0x1f')](moment()[_0x0be6('0xa')]('YYYY-MM-DD\x20HH:mm'))});}else{if(moment()[_0x0be6('0x20')](encryptor[_0x0be6('0x21')](_0x4695cd[_0x0be6('0x11')]),'days')>DAYS){logger[_0x0be6('0x1a')](_0x0be6('0x22'),moment()[_0x0be6('0xa')](_0x0be6('0x23')));isOldTokenSent=![];return _0x203711['update']({'data1':_0x2162b7,'data2':null,'license':null});}}}else{if(_0x4695cd[_0x0be6('0x16')]!=_0x2162b7){logger[_0x0be6('0x1a')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x4695cd['data1'],_0x2162b7);return _0x203711[_0x0be6('0x1e')]({'data1':_0x2162b7,'data2':null,'license':null});}}}return _0x203711;})['then'](function(_0x4a4640){_0x203711=_0x4a4640;})[_0x0be6('0xf')](function(_0x293db3){logger[_0x0be6('0x24')](_0x293db3[_0x0be6('0x25')]);})[_0x0be6('0x26')](function(){setTimeout(function(){manageLicense(hardware[_0x0be6('0x27')](),_0x203711);},TIME);});}function defaultLicense(){var _0x2bf3dc=hardware[_0x0be6('0x27')]();if(_0x2bf3dc){return db[_0x0be6('0x28')][_0x0be6('0x29')]({'where':{'id':0x1},'defaults':{'data1':_0x2bf3dc}})['spread'](function(_0x562313,_0x1619c8){logger[_0x0be6('0x1a')]('SERVICE\x20LICENSE\x20STARTED\x20%s',_0x2bf3dc);manageLicense(_0x2bf3dc,_0x562313);})[_0x0be6('0xf')](function(_0x2b0505){logger[_0x0be6('0x24')](_0x2b0505['message']);});}}exports[_0x0be6('0x2a')]=defaultLicense; \ No newline at end of file +var _0x6721=['findOrCreate','SERVICE\x20LICENSE\x20STARTED\x20%s','default','util','moment','request-promise','bluebird','pkginfo','version','../../mysqldb','../../components/encryptor','license','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','then','catch','get','data2','data1','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','info','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','YYYY-MM-DD\x20HH:mm','encryptString','diff','days','DEMO\x20START\x20AT\x20%s','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','error','message','getUuid','License'];(function(_0x35b7d4,_0x5a5c43){var _0x4e8cee=function(_0x66859c){while(--_0x66859c){_0x35b7d4['push'](_0x35b7d4['shift']());}};_0x4e8cee(++_0x5a5c43);}(_0x6721,0x162));var _0x1672=function(_0x4796a1,_0x4b8075){_0x4796a1=_0x4796a1-0x0;var _0x18ddb9=_0x6721[_0x4796a1];return _0x18ddb9;};'use strict';var util=require(_0x1672('0x0'));var moment=require(_0x1672('0x1'));var rp=require(_0x1672('0x2'));var BPromise=require(_0x1672('0x3'));var pkginfo=require(_0x1672('0x4'))(module,_0x1672('0x5'));var db=require(_0x1672('0x6'))['db'];var encryptor=require(_0x1672('0x7'));var hardware=require('./hardware');var logger=require('../logger')(_0x1672('0x8'));var HOST=_0x1672('0x9');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x1cbc61){return new BPromise(function(_0x4dd9f6,_0x11ac3d){var _0x26246f=util[_0x1672('0xa')](_0x1672('0xb'),HOST,_0x1cbc61,module[_0x1672('0xc')]['version']);if(oldToken){_0x26246f=util[_0x1672('0xa')](_0x1672('0xd'),HOST,_0x1cbc61,module[_0x1672('0xc')][_0x1672('0x5')],oldToken);}var _0x5a3304={'uri':_0x26246f,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0x5a3304)[_0x1672('0xe')](function(_0x49d569){_0x4dd9f6(_0x49d569);})[_0x1672('0xf')](function(_0x4fdd2e){_0x11ac3d(_0x4fdd2e);});});}function manageLicense(_0xb48ada,_0x6e1eac){var _0x480a25=_0x6e1eac[_0x1672('0x10')]({'plain':!![]});if(!isOldTokenSent&&_0x480a25['data1']!==_0xb48ada&&!_0x480a25[_0x1672('0x11')]){oldToken=_0x480a25[_0x1672('0x12')];}httpRequest(_0xb48ada)[_0x1672('0xe')](function(_0xccecba){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0xccecba['active']){isOldTokenSent=![];if(!_0x480a25[_0x1672('0x8')]&&_0x480a25[_0x1672('0x8')]!=_0xccecba[_0x1672('0x8')]||_0x480a25['license']&&_0x480a25['data2']){logger['info'](_0x1672('0x13'));}if(_0x480a25[_0x1672('0x8')]&&!_0x480a25[_0x1672('0x11')]&&_0x480a25[_0x1672('0x8')]!=_0xccecba[_0x1672('0x8')]){logger[_0x1672('0x14')](_0x1672('0x15'));}if(_0x480a25['license']&&!_0x480a25[_0x1672('0x11')]&&_0x480a25[_0x1672('0x8')]==_0xccecba[_0x1672('0x8')]){return _0x6e1eac;}return _0x6e1eac[_0x1672('0x16')]({'data1':_0xb48ada,'data2':null,'license':_0xccecba[_0x1672('0x8')]});}else{if(_0xccecba[_0x1672('0x8')]||_0x480a25[_0x1672('0x8')]){if(!_0x480a25[_0x1672('0x11')]){if(_0x480a25[_0x1672('0x12')]==_0xb48ada){GRAY_PERIOD_REASON='Disabled';logger[_0x1672('0x14')](_0x1672('0x17'));}else{GRAY_PERIOD_REASON=_0x1672('0x18');logger[_0x1672('0x14')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x480a25[_0x1672('0x12')],_0xb48ada);}logger[_0x1672('0x14')](_0x1672('0x19'),GRAY_PERIOD_REASON['toUpperCase'](),moment()[_0x1672('0xa')](_0x1672('0x1a')));return _0x6e1eac[_0x1672('0x16')]({'data2':encryptor[_0x1672('0x1b')](moment()[_0x1672('0xa')](_0x1672('0x1a')))});}else{if(moment()[_0x1672('0x1c')](encryptor['decryptString'](_0x480a25[_0x1672('0x11')]),_0x1672('0x1d'))>DAYS){logger['info'](_0x1672('0x1e'),moment()[_0x1672('0xa')](_0x1672('0x1a')));isOldTokenSent=![];return _0x6e1eac[_0x1672('0x16')]({'data1':_0xb48ada,'data2':null,'license':null});}}}else{if(_0x480a25[_0x1672('0x12')]!=_0xb48ada){logger[_0x1672('0x14')](_0x1672('0x1f'),_0x480a25[_0x1672('0x12')],_0xb48ada);return _0x6e1eac[_0x1672('0x16')]({'data1':_0xb48ada,'data2':null,'license':null});}}}return _0x6e1eac;})[_0x1672('0xe')](function(_0x252723){_0x6e1eac=_0x252723;})['catch'](function(_0x2c1a84){logger[_0x1672('0x20')](_0x2c1a84[_0x1672('0x21')]);})['finally'](function(){setTimeout(function(){manageLicense(hardware[_0x1672('0x22')](),_0x6e1eac);},TIME);});}function defaultLicense(){var _0x10de36=hardware[_0x1672('0x22')]();if(_0x10de36){return db[_0x1672('0x23')][_0x1672('0x24')]({'where':{'id':0x1},'defaults':{'data1':_0x10de36}})['spread'](function(_0x17d36d,_0x29e74a){logger[_0x1672('0x14')](_0x1672('0x25'),_0x10de36);manageLicense(_0x10de36,_0x17d36d);})['catch'](function(_0x1bc75c){logger['error'](_0x1bc75c[_0x1672('0x21')]);});}}exports[_0x1672('0x26')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index 5b7a8d2..a5e292b 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 _0xf62d=['changed','disabled','message','then','findAll','role','sequelize','col','count','user','users','telephones','admin','countBy','telephone','License\x20limit\x20reached\x20for\x20telephones','exports','util','lodash','moment','./hardware','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','Breaking\x20license','getUuid','License','find','catch','uuid','data1','isEmpty','data2','split','format','%s:%s:%s','parse','demo','machineUuid','decryptString','gray','deadline','days'];(function(_0x43d3c2,_0x584fab){var _0x3d16ad=function(_0x46d01a){while(--_0x46d01a){_0x43d3c2['push'](_0x43d3c2['shift']());}};_0x3d16ad(++_0x584fab);}(_0xf62d,0x69));var _0xdf62=function(_0x32e8d5,_0x130fe2){_0x32e8d5=_0x32e8d5-0x0;var _0x276e99=_0xf62d[_0x32e8d5];return _0x276e99;};'use strict';var util=require(_0xdf62('0x0'));var _=require(_0xdf62('0x1'));var moment=require(_0xdf62('0x2'));var BPromise=require('bluebird');var hardware=require(_0xdf62('0x3'));var encryptor=require(_0xdf62('0x4'));var db=require(_0xdf62('0x5'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xdf62('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xdf62('0x7'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xdf62('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xdf62('0x8'),'machineUuid':hardware[_0xdf62('0x9')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x4309ab){return new BPromise(function(_0x1ef9e1,_0x26f0f7){return db[_0xdf62('0xa')][_0xdf62('0xb')](_['defaults'](_0x4309ab,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x1880c9){return checkLicense(_0x1880c9,null);})['then'](function(_0x5c626e){_0x1ef9e1(_0x5c626e);return;})[_0xdf62('0xc')](function(_0x2f82fa){_0x26f0f7(_0x2f82fa);});});}function checkLicense(_0x1e2d84,_0x5441a8){if(!_0x1e2d84){demoLicense[_0xdf62('0xd')]=_0x1e2d84[_0xdf62('0xe')];return demoLicense;}try{var _0xfeaee7=_0x5441a8||_0x1e2d84['license'];if(_[_0xdf62('0xf')](_0xfeaee7)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0x178cd3=_0x1e2d84[_0xdf62('0xe')];var _0x7a769c=_0x1e2d84[_0xdf62('0x10')];var _0x47510d=_0x178cd3[_0xdf62('0x11')]('-')[0x4];var _0x5d19d7=_0x178cd3[_0xdf62('0x11')]('-')[0x0];var _0x33233d=encryptor['decryptString'](_0xfeaee7,util[_0xdf62('0x12')](_0xdf62('0x13'),_0x47510d,_0x178cd3,_0x5d19d7));var _0x29e759=JSON[_0xdf62('0x14')](_0x33233d);_0x29e759[_0xdf62('0x15')]=![];_0x29e759['uuid']=_0x178cd3;_0x29e759[_0xdf62('0x16')]=hardware['getUuid']();if(_0x7a769c){var _0xc21d44=encryptor[_0xdf62('0x17')](_0x7a769c);_0x29e759[_0xdf62('0x18')]=_0xc21d44;_0x29e759[_0xdf62('0x19')]=moment(_0xc21d44)['add'](0x7,_0xdf62('0x1a'))[_0xdf62('0x12')]();_0x29e759['grayReason']=_0x29e759['uuid']!=_0x29e759[_0xdf62('0x16')]?_0xdf62('0x1b'):_0xdf62('0x1c');}return _0x29e759;}catch(_0x2884e6){breakingLicense[_0xdf62('0xd')]=_0x1e2d84[_0xdf62('0xe')];breakingLicense[_0xdf62('0x1d')]=_0x2884e6[_0xdf62('0x1d')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0xf7c4fb,_0x1d14f1){getLicense()[_0xdf62('0x1e')](function(_0x16153f){return db['User'][_0xdf62('0x1f')]({'attributes':[_0xdf62('0x20'),[db['sequelize']['fn']('COUNT',db[_0xdf62('0x21')][_0xdf62('0x22')](_0xdf62('0x20'))),_0xdf62('0x23')]],'group':_0xdf62('0x20'),'where':{'role':{'$or':['admin',_0xdf62('0x24'),'telephone']}},'raw':!![]})[_0xdf62('0x1e')](function(_0x3a2834){var _0x17c7e4={'user':_0x16153f[_0xdf62('0x25')]||0x0,'telephone':_0x16153f[_0xdf62('0x26')]||0x0};_0x3a2834['forEach'](function(_0x44676a){var _0x6ffa32=_0x44676a[_0xdf62('0x20')]===_0xdf62('0x27')?_0xdf62('0x24'):_0x44676a[_0xdf62('0x20')];_0x17c7e4[_0x6ffa32]-=_0x44676a[_0xdf62('0x23')];if(_0x17c7e4[_0x6ffa32]<0x0)_0x17c7e4[_0x6ffa32]=0x0;});_0xf7c4fb(_0x17c7e4);return;});})['catch'](function(_0x1d1762){_0x1d14f1(_0x1d1762);});});}function checkUserLimits(_0x20c2f3){return new BPromise(function(_0x5e3303,_0x3bd28a){getLimits()[_0xdf62('0x1e')](function(_0x3411f6){var _0x1ed7f0=_['pick'](_[_0xdf62('0x28')](_0x20c2f3,_0xdf62('0x20')),[_0xdf62('0x27'),_0xdf62('0x24'),_0xdf62('0x29')]);var _0x514770=(_0x1ed7f0[_0xdf62('0x27')]||0x0)+(_0x1ed7f0[_0xdf62('0x24')]||0x0);var _0x3eab94=_0x1ed7f0['telephone']||0x0;if(_0x514770>_0x3411f6['user'])return _0x3bd28a('License\x20limit\x20reached\x20for\x20users');if(_0x3eab94>_0x3411f6[_0xdf62('0x29')])return _0x3bd28a(_0xdf62('0x2a'));return _0x5e3303();})[_0xdf62('0xc')](function(_0x2abe5e){_0x3bd28a(_0x2abe5e);});});}module[_0xdf62('0x2b')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0x4c1e=['days','grayReason','changed','disabled','message','findAll','sequelize','COUNT','col','role','admin','user','users','telephones','forEach','count','pick','countBy','telephone','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','util','lodash','moment','bluebird','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','Breaking\x20license','License','find','then','catch','data1','isEmpty','License\x20key\x20value\x20not\x20found','data2','split','decryptString','format','%s:%s:%s','demo','uuid','machineUuid','getUuid','gray','deadline'];(function(_0x56740a,_0x568894){var _0x257144=function(_0x2b8cc5){while(--_0x2b8cc5){_0x56740a['push'](_0x56740a['shift']());}};_0x257144(++_0x568894);}(_0x4c1e,0x10b));var _0xe4c1=function(_0x5b184c,_0x93980c){_0x5b184c=_0x5b184c-0x0;var _0x358de9=_0x4c1e[_0x5b184c];return _0x358de9;};'use strict';var util=require(_0xe4c1('0x0'));var _=require(_0xe4c1('0x1'));var moment=require(_0xe4c1('0x2'));var BPromise=require(_0xe4c1('0x3'));var hardware=require('./hardware');var encryptor=require(_0xe4c1('0x4'));var db=require(_0xe4c1('0x5'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xe4c1('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xe4c1('0x7'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xe4c1('0x8'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x1e642c){return new BPromise(function(_0x55d8a0,_0x16d1a8){return db[_0xe4c1('0x9')][_0xe4c1('0xa')](_['defaults'](_0x1e642c,{'raw':!![],'where':{'id':0x1}}))[_0xe4c1('0xb')](function(_0xf31e59){return checkLicense(_0xf31e59,null);})['then'](function(_0x209684){_0x55d8a0(_0x209684);return;})[_0xe4c1('0xc')](function(_0x4f336e){_0x16d1a8(_0x4f336e);});});}function checkLicense(_0x21bf11,_0x1bcfe0){if(!_0x21bf11){demoLicense['uuid']=_0x21bf11[_0xe4c1('0xd')];return demoLicense;}try{var _0x4b223e=_0x1bcfe0||_0x21bf11['license'];if(_[_0xe4c1('0xe')](_0x4b223e)){throw new Error(_0xe4c1('0xf'));}var _0x2dff76=_0x21bf11[_0xe4c1('0xd')];var _0x4d9bd1=_0x21bf11[_0xe4c1('0x10')];var _0x55056c=_0x2dff76[_0xe4c1('0x11')]('-')[0x4];var _0x119458=_0x2dff76[_0xe4c1('0x11')]('-')[0x0];var _0x16eb20=encryptor[_0xe4c1('0x12')](_0x4b223e,util[_0xe4c1('0x13')](_0xe4c1('0x14'),_0x55056c,_0x2dff76,_0x119458));var _0x35f7b3=JSON['parse'](_0x16eb20);_0x35f7b3[_0xe4c1('0x15')]=![];_0x35f7b3[_0xe4c1('0x16')]=_0x2dff76;_0x35f7b3[_0xe4c1('0x17')]=hardware[_0xe4c1('0x18')]();if(_0x4d9bd1){var _0x290d86=encryptor[_0xe4c1('0x12')](_0x4d9bd1);_0x35f7b3[_0xe4c1('0x19')]=_0x290d86;_0x35f7b3[_0xe4c1('0x1a')]=moment(_0x290d86)['add'](0x7,_0xe4c1('0x1b'))[_0xe4c1('0x13')]();_0x35f7b3[_0xe4c1('0x1c')]=_0x35f7b3['uuid']!=_0x35f7b3[_0xe4c1('0x17')]?_0xe4c1('0x1d'):_0xe4c1('0x1e');}return _0x35f7b3;}catch(_0x5b442f){breakingLicense[_0xe4c1('0x16')]=_0x21bf11['data1'];breakingLicense[_0xe4c1('0x1f')]=_0x5b442f[_0xe4c1('0x1f')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x3c55a5,_0x5eedf3){getLicense()['then'](function(_0x477574){return db['User'][_0xe4c1('0x20')]({'attributes':['role',[db[_0xe4c1('0x21')]['fn'](_0xe4c1('0x22'),db[_0xe4c1('0x21')][_0xe4c1('0x23')](_0xe4c1('0x24'))),'count']],'group':_0xe4c1('0x24'),'where':{'role':{'$or':[_0xe4c1('0x25'),_0xe4c1('0x26'),'telephone']}},'raw':!![]})[_0xe4c1('0xb')](function(_0x303785){var _0x42bb4b={'user':_0x477574[_0xe4c1('0x27')]||0x0,'telephone':_0x477574[_0xe4c1('0x28')]||0x0};_0x303785[_0xe4c1('0x29')](function(_0xc91aca){var _0x40cd7c=_0xc91aca[_0xe4c1('0x24')]==='admin'?_0xe4c1('0x26'):_0xc91aca[_0xe4c1('0x24')];_0x42bb4b[_0x40cd7c]-=_0xc91aca[_0xe4c1('0x2a')];if(_0x42bb4b[_0x40cd7c]<0x0)_0x42bb4b[_0x40cd7c]=0x0;});_0x3c55a5(_0x42bb4b);return;});})['catch'](function(_0x22c7e9){_0x5eedf3(_0x22c7e9);});});}function checkUserLimits(_0x24bf57){return new BPromise(function(_0x2d8134,_0x1b0aa5){getLimits()[_0xe4c1('0xb')](function(_0x5c854d){var _0x5613a3=_[_0xe4c1('0x2b')](_[_0xe4c1('0x2c')](_0x24bf57,_0xe4c1('0x24')),['admin',_0xe4c1('0x26'),_0xe4c1('0x2d')]);var _0x146381=(_0x5613a3[_0xe4c1('0x25')]||0x0)+(_0x5613a3[_0xe4c1('0x26')]||0x0);var _0x478ad6=_0x5613a3['telephone']||0x0;if(_0x146381>_0x5c854d['user'])return _0x1b0aa5(_0xe4c1('0x2e'));if(_0x478ad6>_0x5c854d[_0xe4c1('0x2d')])return _0x1b0aa5(_0xe4c1('0x2f'));return _0x2d8134();})[_0xe4c1('0xc')](function(_0x14eff2){_0x1b0aa5(_0x14eff2);});});}module[_0xe4c1('0x30')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file diff --git a/server/config/local.env.js b/server/config/local.env.js index e692029..ba879f2 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 _0x47c5=['app-id','secret','exports','http://localhost:9000','myappanuglar-secret'];(function(_0x1c700d,_0x199cd9){var _0x17d3c3=function(_0x88a5e){while(--_0x88a5e){_0x1c700d['push'](_0x1c700d['shift']());}};_0x17d3c3(++_0x199cd9);}(_0x47c5,0x165));var _0x547c=function(_0x2a2cdf,_0x3f2801){_0x2a2cdf=_0x2a2cdf-0x0;var _0x5e8e12=_0x47c5[_0x2a2cdf];return _0x5e8e12;};'use strict';module[_0x547c('0x0')]={'DOMAIN':_0x547c('0x1'),'SESSION_SECRET':_0x547c('0x2'),'GOOGLE_ID':_0x547c('0x3'),'GOOGLE_SECRET':_0x547c('0x4'),'DEBUG':''}; \ No newline at end of file +var _0x02ce=['exports','http://localhost:9000','myappanuglar-secret','secret'];(function(_0x5ac1d0,_0x2591c1){var _0x307207=function(_0x2db6ea){while(--_0x2db6ea){_0x5ac1d0['push'](_0x5ac1d0['shift']());}};_0x307207(++_0x2591c1);}(_0x02ce,0x1ac));var _0xe02c=function(_0x22d59d,_0x848b8c){_0x22d59d=_0x22d59d-0x0;var _0x47639d=_0x02ce[_0x22d59d];return _0x47639d;};'use strict';module[_0xe02c('0x0')]={'DOMAIN':_0xe02c('0x1'),'SESSION_SECRET':_0xe02c('0x2'),'GOOGLE_ID':'app-id','GOOGLE_SECRET':_0xe02c('0x3'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index 5c1d601..82baff0 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8f76=['debugLevel','moment','util','path','INFO','/var','log','xcally','format','%s-%s.log','message','replace','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','toUpperCase','exports','transports','File','%s-%s','error','info','env'];(function(_0xd5f53e,_0x5a1236){var _0x55bd50=function(_0x3ab7ab){while(--_0x3ab7ab){_0xd5f53e['push'](_0xd5f53e['shift']());}};_0x55bd50(++_0x5a1236);}(_0x8f76,0x12c));var _0x68f7=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x8f76[_0x3b380d];return _0x54502b;};'use strict';var moment=require(_0x68f7('0x0'));var winston=require('winston');var util=require(_0x68f7('0x1'));var path=require(_0x68f7('0x2'));var debugLevel=_0x68f7('0x3');function filename(_0x372ba1,_0x5b80e1){return path['join'](_0x68f7('0x4'),_0x68f7('0x5'),_0x68f7('0x6'),util[_0x68f7('0x7')](_0x68f7('0x8'),_0x372ba1,_0x5b80e1));}function formatter(_0x48b6ec,_0x4e0f17){_0x4e0f17[_0x68f7('0x9')]=_0x4e0f17[_0x68f7('0x9')][_0x68f7('0xa')](/@@{/g,'{{{')[_0x68f7('0xa')](/}@@/g,_0x68f7('0xb'))[_0x68f7('0xa')](/@{/g,'{{')[_0x68f7('0xa')](/}@/g,'}}');return util[_0x68f7('0x7')](_0x68f7('0xc'),moment()[_0x68f7('0x7')](_0x68f7('0xd')),_0x4e0f17['level'][_0x68f7('0xe')](),_0x48b6ec,_0x4e0f17[_0x68f7('0x9')]);}module[_0x68f7('0xf')]=function(_0x5c0617){return new winston['Logger']({'transports':[new winston[(_0x68f7('0x10'))][(_0x68f7('0x11'))]({'name':util[_0x68f7('0x7')](_0x68f7('0x12'),_0x5c0617,_0x68f7('0x13')),'filename':filename(_0x5c0617,_0x68f7('0x13')),'level':_0x68f7('0x13'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x1682e1){return formatter(_0x5c0617,_0x1682e1);}}),new winston[(_0x68f7('0x10'))][(_0x68f7('0x11'))]({'name':util[_0x68f7('0x7')](_0x68f7('0x12'),_0x5c0617,_0x68f7('0x14')),'filename':filename(_0x5c0617,_0x68f7('0x14')),'level':'info','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x308230){return formatter(_0x5c0617,_0x308230);}}),new winston[(_0x68f7('0x10'))]['Console']({'level':process[_0x68f7('0x15')][_0x68f7('0x16')]||debugLevel,'json':![],'formatter':function(_0x338376){return formatter(_0x5c0617,_0x338376);}})]});}; \ No newline at end of file +var _0xf33b=['{{{','}}}','replace','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','exports','transports','File','%s-%s','error','info','Console','env','debugLevel','moment','util','INFO','join','/var','log','xcally','format','%s-%s.log','message'];(function(_0x4e3716,_0x3aa48e){var _0x51cea5=function(_0x3b9f3b){while(--_0x3b9f3b){_0x4e3716['push'](_0x4e3716['shift']());}};_0x51cea5(++_0x3aa48e);}(_0xf33b,0x162));var _0xbf33=function(_0x11f249,_0x4ca4a8){_0x11f249=_0x11f249-0x0;var _0x5c3656=_0xf33b[_0x11f249];return _0x5c3656;};'use strict';var moment=require(_0xbf33('0x0'));var winston=require('winston');var util=require(_0xbf33('0x1'));var path=require('path');var debugLevel=_0xbf33('0x2');function filename(_0x5d1481,_0x5c2d9e){return path[_0xbf33('0x3')](_0xbf33('0x4'),_0xbf33('0x5'),_0xbf33('0x6'),util[_0xbf33('0x7')](_0xbf33('0x8'),_0x5d1481,_0x5c2d9e));}function formatter(_0x113fa6,_0x4b2ad6){_0x4b2ad6[_0xbf33('0x9')]=_0x4b2ad6[_0xbf33('0x9')]['replace'](/@@{/g,_0xbf33('0xa'))['replace'](/}@@/g,_0xbf33('0xb'))[_0xbf33('0xc')](/@{/g,'{{')['replace'](/}@/g,'}}');return util[_0xbf33('0x7')](_0xbf33('0xd'),moment()[_0xbf33('0x7')](_0xbf33('0xe')),_0x4b2ad6[_0xbf33('0xf')][_0xbf33('0x10')](),_0x113fa6,_0x4b2ad6[_0xbf33('0x9')]);}module[_0xbf33('0x11')]=function(_0x38245c){return new winston['Logger']({'transports':[new winston[(_0xbf33('0x12'))][(_0xbf33('0x13'))]({'name':util[_0xbf33('0x7')](_0xbf33('0x14'),_0x38245c,_0xbf33('0x15')),'filename':filename(_0x38245c,_0xbf33('0x15')),'level':_0xbf33('0x15'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x29b5b3){return formatter(_0x38245c,_0x29b5b3);}}),new winston[(_0xbf33('0x12'))]['File']({'name':util['format']('%s-%s',_0x38245c,_0xbf33('0x16')),'filename':filename(_0x38245c,'info'),'level':_0xbf33('0x16'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x1c1cf7){return formatter(_0x38245c,_0x1c1cf7);}}),new winston[(_0xbf33('0x12'))][(_0xbf33('0x17'))]({'level':process[_0xbf33('0x18')][_0xbf33('0x19')]||debugLevel,'json':![],'formatter':function(_0x50bcd1){return formatter(_0x38245c,_0x50bcd1);}})]});}; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index 514fa46..0a54c33 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 _0xd9ec=['../../services/ami/index.js','agi','../../services/agi/index.js','email','../../services/email/index.js','routing','../../services/routing/index.js','xdr','exports','path','express','join','../../services/express/index.js','ami'];(function(_0x4dd86a,_0x157004){var _0x34a5d5=function(_0x5ee3f){while(--_0x5ee3f){_0x4dd86a['push'](_0x4dd86a['shift']());}};_0x34a5d5(++_0x157004);}(_0xd9ec,0x95));var _0xcd9e=function(_0x12b897,_0x1d8a72){_0x12b897=_0x12b897-0x0;var _0x2258a7=_0xd9ec[_0x12b897];return _0x2258a7;};'use strict';var path=require(_0xcd9e('0x0'));var os=require('os');var config={'apps':[{'name':_0xcd9e('0x1'),'script':path[_0xcd9e('0x2')](__dirname,_0xcd9e('0x3'))},{'name':_0xcd9e('0x4'),'script':path[_0xcd9e('0x2')](__dirname,_0xcd9e('0x5'))},{'name':_0xcd9e('0x6'),'script':path[_0xcd9e('0x2')](__dirname,_0xcd9e('0x7'))},{'name':_0xcd9e('0x8'),'script':path[_0xcd9e('0x2')](__dirname,_0xcd9e('0x9'))},{'name':_0xcd9e('0xa'),'script':path[_0xcd9e('0x2')](__dirname,_0xcd9e('0xb'))},{'name':_0xcd9e('0xc'),'script':path[_0xcd9e('0x2')](__dirname,'../../services/xdr/index.js')}]};module[_0xcd9e('0xd')]=config; \ No newline at end of file +var _0x42e0=['ami','join','../../services/ami/index.js','../../services/agi/index.js','email','../../services/email/index.js','routing','../../services/routing/index.js','xdr','path','express','../../services/express/index.js'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x42e0,0xbd));var _0x042e=function(_0x230271,_0xb9cc52){_0x230271=_0x230271-0x0;var _0x15ef7=_0x42e0[_0x230271];return _0x15ef7;};'use strict';var path=require(_0x042e('0x0'));var os=require('os');var config={'apps':[{'name':_0x042e('0x1'),'script':path['join'](__dirname,_0x042e('0x2'))},{'name':_0x042e('0x3'),'script':path[_0x042e('0x4')](__dirname,_0x042e('0x5'))},{'name':'agi','script':path[_0x042e('0x4')](__dirname,_0x042e('0x6'))},{'name':_0x042e('0x7'),'script':path['join'](__dirname,_0x042e('0x8'))},{'name':_0x042e('0x9'),'script':path[_0x042e('0x4')](__dirname,_0x042e('0xa'))},{'name':_0x042e('0xb'),'script':path[_0x042e('0x4')](__dirname,'../../services/xdr/index.js')}]};module['exports']=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 253d5bb..ebc862b 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 _0x4e68=['restart','then','list','describe','delete','dump','saved','pm2','bluebird','./config','connect','connected','start','disconnect','stop'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4e68,0x124));var _0x84e6=function(_0xd62776,_0x37ec9e){_0xd62776=_0xd62776-0x0;var _0x26f4e4=_0x4e68[_0xd62776];return _0x26f4e4;};'use strict';var pm2=require(_0x84e6('0x0'));var BPromise=require(_0x84e6('0x1'));var config=require(_0x84e6('0x2'));function connect(){return new BPromise(function(_0x50a077,_0x35494b){return pm2[_0x84e6('0x3')](function(_0x14d9ed){if(_0x14d9ed){return _0x35494b(_0x14d9ed);}return _0x50a077(_0x84e6('0x4'));});});};exports[_0x84e6('0x5')]=function(_0x1e9d49){return connect()['then'](function(){return new BPromise(function(_0x10fdda,_0x2c8ed5){return pm2['start'](_0x1e9d49,function(_0x257b9d,_0x19758d){if(_0x257b9d){return _0x2c8ed5(_0x257b9d);}pm2[_0x84e6('0x6')]();return _0x10fdda(_0x19758d);});});});};exports[_0x84e6('0x7')]=function(_0x2162d1){return connect()['then'](function(){return new BPromise(function(_0x381619,_0x38dfec){return pm2[_0x84e6('0x7')](_0x2162d1,function(_0x1a2d60,_0x42038b){if(_0x1a2d60){return _0x38dfec(_0x1a2d60);}pm2[_0x84e6('0x6')]();return _0x381619(_0x42038b);});});});};exports[_0x84e6('0x8')]=function(_0x1c0133){return connect()[_0x84e6('0x9')](function(){return new BPromise(function(_0x29765a,_0x222038){return pm2[_0x84e6('0x8')](_0x1c0133,function(_0x3cc179,_0x3cccc5){if(_0x3cc179){return _0x222038(_0x3cc179);}pm2[_0x84e6('0x6')]();return _0x29765a(_0x3cccc5);});});});};exports[_0x84e6('0xa')]=function(){return connect()[_0x84e6('0x9')](function(){return new BPromise(function(_0x94254e,_0x43535d){return pm2['list'](function(_0x4d99ee,_0x57f3db){if(_0x4d99ee){return _0x43535d(_0x4d99ee);}pm2[_0x84e6('0x6')]();return _0x94254e(_0x57f3db);});});});};exports[_0x84e6('0xb')]=function(_0x5f2f9f){return connect()[_0x84e6('0x9')](function(){return new BPromise(function(_0x4d05d5,_0x27d406){return pm2['describe'](_0x5f2f9f,function(_0x2a5ae7,_0x5c81c1){if(_0x2a5ae7){return _0x27d406(_0x2a5ae7);}pm2['disconnect']();return _0x4d05d5(_0x5c81c1);});});});};exports[_0x84e6('0xc')]=function(_0x1d8845){return connect()[_0x84e6('0x9')](function(){return new BPromise(function(_0x3d82a0,_0x2e036f){return pm2[_0x84e6('0xc')](_0x1d8845,function(_0x1fa669,_0x2eef72){if(_0x1fa669){return _0x2e036f(_0x1fa669);}pm2['disconnect']();return _0x3d82a0(_0x2eef72);});});});};exports[_0x84e6('0xd')]=function(){return connect()[_0x84e6('0x9')](function(){return new BPromise(function(_0x22ee5c,_0x72d65a){return pm2['dump'](function(_0x1badbb){if(_0x1badbb){return _0x72d65a(_0x1badbb);}return _0x22ee5c(_0x84e6('0xe'));});});});}; \ No newline at end of file +var _0x8fcd=['connect','connected','start','then','stop','disconnect','restart','list','describe','delete','dump','saved','pm2','bluebird','./config'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x8fcd,0x1b0));var _0xd8fc=function(_0x3f3f0b,_0x22049b){_0x3f3f0b=_0x3f3f0b-0x0;var _0x18da3b=_0x8fcd[_0x3f3f0b];return _0x18da3b;};'use strict';var pm2=require(_0xd8fc('0x0'));var BPromise=require(_0xd8fc('0x1'));var config=require(_0xd8fc('0x2'));function connect(){return new BPromise(function(_0x54a33d,_0x2b832a){return pm2[_0xd8fc('0x3')](function(_0x2438fe){if(_0x2438fe){return _0x2b832a(_0x2438fe);}return _0x54a33d(_0xd8fc('0x4'));});});};exports[_0xd8fc('0x5')]=function(_0x39d675){return connect()[_0xd8fc('0x6')](function(){return new BPromise(function(_0x5c2450,_0x3d12b7){return pm2[_0xd8fc('0x5')](_0x39d675,function(_0x3d3e39,_0x3573c9){if(_0x3d3e39){return _0x3d12b7(_0x3d3e39);}pm2['disconnect']();return _0x5c2450(_0x3573c9);});});});};exports['stop']=function(_0x428dec){return connect()[_0xd8fc('0x6')](function(){return new BPromise(function(_0x891b48,_0x5d4ce7){return pm2[_0xd8fc('0x7')](_0x428dec,function(_0x478dbb,_0x47e81f){if(_0x478dbb){return _0x5d4ce7(_0x478dbb);}pm2[_0xd8fc('0x8')]();return _0x891b48(_0x47e81f);});});});};exports['restart']=function(_0x7be4bd){return connect()[_0xd8fc('0x6')](function(){return new BPromise(function(_0x392795,_0x59b7c4){return pm2[_0xd8fc('0x9')](_0x7be4bd,function(_0x51c966,_0x4e6833){if(_0x51c966){return _0x59b7c4(_0x51c966);}pm2[_0xd8fc('0x8')]();return _0x392795(_0x4e6833);});});});};exports[_0xd8fc('0xa')]=function(){return connect()[_0xd8fc('0x6')](function(){return new BPromise(function(_0x5cdd78,_0x1268cf){return pm2['list'](function(_0x41fa73,_0x4247fe){if(_0x41fa73){return _0x1268cf(_0x41fa73);}pm2[_0xd8fc('0x8')]();return _0x5cdd78(_0x4247fe);});});});};exports[_0xd8fc('0xb')]=function(_0x3f2734){return connect()[_0xd8fc('0x6')](function(){return new BPromise(function(_0x642d82,_0x5a0b1e){return pm2['describe'](_0x3f2734,function(_0x320a9c,_0x3b266a){if(_0x320a9c){return _0x5a0b1e(_0x320a9c);}pm2[_0xd8fc('0x8')]();return _0x642d82(_0x3b266a);});});});};exports[_0xd8fc('0xc')]=function(_0x30b759){return connect()[_0xd8fc('0x6')](function(){return new BPromise(function(_0x5d7e23,_0x171802){return pm2[_0xd8fc('0xc')](_0x30b759,function(_0x373998,_0x236c85){if(_0x373998){return _0x171802(_0x373998);}pm2['disconnect']();return _0x5d7e23(_0x236c85);});});});};exports['dump']=function(){return connect()[_0xd8fc('0x6')](function(){return new BPromise(function(_0x5411e8,_0x4394c7){return pm2[_0xd8fc('0xd')](function(_0x3179c0){if(_0x3179c0){return _0x4394c7(_0x3179c0);}return _0x5411e8(_0xd8fc('0xe'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index afb32ec..c6d602c 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 _0xd8b6=['inspect','start','lodash','moment','ioredis','../../config/environment','../../mysqldb','../logger','redis','defaults','localhost','socket.io-emitter','Setting','find','chatTimeout','then','findAll','lastMsgAt','minutes','map','info','[CHAT]\x20Interactions\x20to\x20close:','join','ChatInteraction','update','system','format','YYYY-MM-DD\x20HH:mm:ss','length','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','chatInteraction:update','error','[CHAT]\x20Error\x20closing\x20interactions'];(function(_0x4cab1e,_0xfc5cde){var _0x1a8cd8=function(_0x2ce2b6){while(--_0x2ce2b6){_0x4cab1e['push'](_0x4cab1e['shift']());}};_0x1a8cd8(++_0xfc5cde);}(_0xd8b6,0xc8));var _0x6d8b=function(_0x45cc01,_0x2e635a){_0x45cc01=_0x45cc01-0x0;var _0x349d47=_0xd8b6[_0x45cc01];return _0x349d47;};'use strict';var _=require(_0x6d8b('0x0'));var moment=require(_0x6d8b('0x1'));var Redis=require(_0x6d8b('0x2'));var util=require('util');var config=require(_0x6d8b('0x3'));var db=require(_0x6d8b('0x4'))['db'];var logger=require(_0x6d8b('0x5'))('schedule');config[_0x6d8b('0x6')]=_[_0x6d8b('0x7')](config['redis'],{'host':_0x6d8b('0x8'),'port':0x18eb});var io=require(_0x6d8b('0x9'))(new Redis(config[_0x6d8b('0x6')]));function closeInteractions(){var _0x494441=0x0;var _0x1021f8=[];return db[_0x6d8b('0xa')][_0x6d8b('0xb')]({'raw':!![],'attributes':['id',_0x6d8b('0xc')],'where':{'id':0x1}})[_0x6d8b('0xd')](function(_0x46eb28){_0x494441=_0x46eb28['chatTimeout'];if(_0x494441){return db['ChatInteraction'][_0x6d8b('0xe')]({'raw':!![],'attributes':['id',_0x6d8b('0xf')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0x46eb28[_0x6d8b('0xc')],_0x6d8b('0x10'))}}});}else{return[];}})[_0x6d8b('0xd')](function(_0x5b928e){if(_0x5b928e&&_0x5b928e['length']){_0x1021f8=_[_0x6d8b('0x11')](_0x5b928e||[],'id');logger[_0x6d8b('0x12')](_0x6d8b('0x13'),_0x1021f8[_0x6d8b('0x14')]());return db[_0x6d8b('0x15')][_0x6d8b('0x16')]({'closeReason':_0x6d8b('0x17'),'disposition':'timeout','closed':!![],'closedAt':moment()[_0x6d8b('0x18')](_0x6d8b('0x19'))},{'where':{'id':_0x1021f8}});}})[_0x6d8b('0xd')](function(){if(_0x1021f8&&_0x1021f8[_0x6d8b('0x1a')]){logger[_0x6d8b('0x12')](_0x6d8b('0x1b'),_0x1021f8[_0x6d8b('0x14')]());for(var _0x419863=0x0;_0x419863<_0x1021f8[_0x6d8b('0x1a')];_0x419863++){io['emit'](_0x6d8b('0x1c'),{'id':_0x1021f8[_0x419863],'closed':!![]});}}})['catch'](function(_0x486290){logger[_0x6d8b('0x1d')](_0x6d8b('0x1e'),_0x486290?util[_0x6d8b('0x1f')](_0x486290,{'showHidden':![],'depth':null}):'');});}exports[_0x6d8b('0x20')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x9131=['map','[CHAT]\x20Interactions\x20to\x20close:','ChatInteraction','update','format','YYYY-MM-DD\x20HH:mm:ss','length','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','chatInteraction:update','catch','[CHAT]\x20Error\x20closing\x20interactions','inspect','start','lodash','util','../../config/environment','../../mysqldb','../logger','schedule','redis','defaults','localhost','socket.io-emitter','Setting','find','chatTimeout','then','findAll','lastMsgAt','subtract','minutes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9131,0xc7));var _0x1913=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9131[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1913('0x0'));var moment=require('moment');var Redis=require('ioredis');var util=require(_0x1913('0x1'));var config=require(_0x1913('0x2'));var db=require(_0x1913('0x3'))['db'];var logger=require(_0x1913('0x4'))(_0x1913('0x5'));config[_0x1913('0x6')]=_[_0x1913('0x7')](config[_0x1913('0x6')],{'host':_0x1913('0x8'),'port':0x18eb});var io=require(_0x1913('0x9'))(new Redis(config[_0x1913('0x6')]));function closeInteractions(){var _0x49fc85=0x0;var _0x4ac71b=[];return db[_0x1913('0xa')][_0x1913('0xb')]({'raw':!![],'attributes':['id',_0x1913('0xc')],'where':{'id':0x1}})[_0x1913('0xd')](function(_0x3122ef){_0x49fc85=_0x3122ef[_0x1913('0xc')];if(_0x49fc85){return db['ChatInteraction'][_0x1913('0xe')]({'raw':!![],'attributes':['id',_0x1913('0xf')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x1913('0x10')](_0x3122ef[_0x1913('0xc')],_0x1913('0x11'))}}});}else{return[];}})[_0x1913('0xd')](function(_0x2337ed){if(_0x2337ed&&_0x2337ed['length']){_0x4ac71b=_[_0x1913('0x12')](_0x2337ed||[],'id');logger['info'](_0x1913('0x13'),_0x4ac71b['join']());return db[_0x1913('0x14')][_0x1913('0x15')]({'closeReason':'system','disposition':'timeout','closed':!![],'closedAt':moment()[_0x1913('0x16')](_0x1913('0x17'))},{'where':{'id':_0x4ac71b}});}})[_0x1913('0xd')](function(){if(_0x4ac71b&&_0x4ac71b[_0x1913('0x18')]){logger['info'](_0x1913('0x19'),_0x4ac71b['join']());for(var _0x267ef9=0x0;_0x267ef9<_0x4ac71b['length'];_0x267ef9++){io['emit'](_0x1913('0x1a'),{'id':_0x4ac71b[_0x267ef9],'closed':!![]});}}})[_0x1913('0x1b')](function(_0x58987d){logger['error'](_0x1913('0x1c'),_0x58987d?util[_0x1913('0x1d')](_0x58987d,{'showHidden':![],'depth':null}):'');});}exports[_0x1913('0x1e')]=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 0473497..d437f86 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 _0x0b65=['MailServerOut','keys','toString','keyBy','difference','intersection','length','exists','my\x20id','resolve','run\x20job','cron','active','isBetween','startAt','endAt','add','start','add\x20cron','stop','deleteJob','stop\x20cron','update','update\x20cron','run','path','lodash','moment','cron-job-manager','jayson/promise','../logger','../../api/analyticDefaultReport/analyticDefaultReport.controller','http','info','Try\x20to\x20send\x20a\x20mail\x20to','MailAccount','Smtp','service','host','port','secure','authentication','auth','format','name','email','user','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','join','../../files/reports','savename','extname','existsSync','attachments','message','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','status','Sent','text','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','empty\x20file,\x20email\x20not\x20sent','SendMail','then','error','error\x20mail','catch','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit','subtractUnit\x20null\x20or\x20undefined','subtract','scheduled','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','findAll'];(function(_0x4e1d03,_0x786f3a){var _0x362d4b=function(_0x1924d2){while(--_0x1924d2){_0x4e1d03['push'](_0x4e1d03['shift']());}};_0x362d4b(++_0x786f3a);}(_0x0b65,0x6d));var _0x50b6=function(_0x2d57f8,_0x4f36bc){_0x2d57f8=_0x2d57f8-0x0;var _0x1c63a6=_0x0b65[_0x2d57f8];return _0x1c63a6;};'use strict';var fs=require('fs');var util=require('util');var path=require(_0x50b6('0x0'));var _=require(_0x50b6('0x1'));var moment=require(_0x50b6('0x2'));var CronJobManager=require(_0x50b6('0x3'));var jayson=require(_0x50b6('0x4'));var BPromise=require('bluebird');var logger=require(_0x50b6('0x5'))('schedule');var db=require('../../mysqldb')['db'];var analyticCustomReportController=require('../../api/analyticCustomReport/analyticCustomReport.controller');var analyticDefaultReportController=require(_0x50b6('0x6'));var client=jayson['client'][_0x50b6('0x7')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x324818,_0x50a102){return function(){logger[_0x50b6('0x8')](_0x50b6('0x9'),_0x324818['email']);var _0x5b2126=!![];var _0x117bc9={'tls':{'rejectUnauthorized':![]}};if(_0x324818[_0x50b6('0xa')][_0x50b6('0xb')][_0x50b6('0xc')]){_0x117bc9[_0x50b6('0xc')]=_0x324818[_0x50b6('0xa')][_0x50b6('0xb')][_0x50b6('0xc')];}else{_0x117bc9[_0x50b6('0xd')]=_0x324818[_0x50b6('0xa')]['Smtp'][_0x50b6('0xd')];_0x117bc9[_0x50b6('0xe')]=_0x324818[_0x50b6('0xa')][_0x50b6('0xb')][_0x50b6('0xe')];_0x117bc9[_0x50b6('0xf')]=_0x324818['MailAccount'][_0x50b6('0xb')][_0x50b6('0xf')];}if(_0x324818['MailAccount'][_0x50b6('0xb')][_0x50b6('0x10')]){_0x117bc9[_0x50b6('0x11')]={'user':_0x324818[_0x50b6('0xa')][_0x50b6('0xb')]['user'],'pass':_0x324818[_0x50b6('0xa')][_0x50b6('0xb')]['pass']};}var _0x3f58b0={'account':_0x117bc9,'message':{'from':util[_0x50b6('0x12')]('\x22%s\x22\x20<%s>',_0x324818[_0x50b6('0xa')][_0x50b6('0x13')],_0x324818[_0x50b6('0xa')][_0x50b6('0x14')]||_0x324818[_0x50b6('0xa')]['Smtp'][_0x50b6('0x15')]),'to':_0x324818[_0x50b6('0x14')],'cc':_0x324818['cc'],'bcc':_0x324818[_0x50b6('0x16')],'subject':util[_0x50b6('0x12')](_0x50b6('0x17'),_0x50a102['name'],_0x324818[_0x50b6('0x18')],_0x324818['subtractUnit'])}};var _0x4ae9c7=path[_0x50b6('0x19')](__dirname,_0x50b6('0x1a'));var _0x4df70a=_0x50a102[_0x50b6('0x1b')];var _0x23ff98=util[_0x50b6('0x12')]('%s.%s',path['basename'](_0x50a102[_0x50b6('0x1b')],path[_0x50b6('0x1c')](_0x50a102[_0x50b6('0x1b')])),'zip');var _0x3ba86b=path[_0x50b6('0x19')](_0x4ae9c7,_0x4df70a);var _0x4f0d77=path[_0x50b6('0x19')](_0x4ae9c7,_0x23ff98);if(fs[_0x50b6('0x1d')](_0x3ba86b)){_0x50a102['status']='Sent';_0x3f58b0['message'][_0x50b6('0x1e')]=[{'filename':_0x4df70a,'path':_0x3ba86b}];_0x3f58b0[_0x50b6('0x1f')]['text']=util['format'](_0x50b6('0x20'),JSON[_0x50b6('0x21')](_0x50a102,null,0x2));}else if(fs[_0x50b6('0x1d')](_0x4f0d77)){_0x50a102[_0x50b6('0x22')]=_0x50b6('0x23');_0x3f58b0[_0x50b6('0x1f')]['attachments']=[{'filename':_0x23ff98,'path':_0x4f0d77}];}else{_0x3f58b0[_0x50b6('0x1f')][_0x50b6('0x24')]=_0x50b6('0x25');if(!_0x324818['sendIfEmpty']){_0x5b2126=![];logger[_0x50b6('0x8')](_0x50b6('0x26'));}}if(_0x5b2126){return client['request'](_0x50b6('0x27'),_0x3f58b0)[_0x50b6('0x28')](function(_0x2a1806){if(_0x2a1806['error']){return logger[_0x50b6('0x29')](_0x50b6('0x2a'),JSON[_0x50b6('0x21')](_0x2a1806));}return logger[_0x50b6('0x8')]('email\x20sent');})[_0x50b6('0x2b')](function(_0xf0839b){return logger['error'](_0x50b6('0x2a'),JSON['stringify'](_0xf0839b));});}};}function handleError(){return function(_0x1e2645){return logger[_0x50b6('0x29')](JSON['stringify'](_0x1e2645));};}function handleResult(_0x2ae659){return function(_0xea548a){logger[_0x50b6('0x8')](_0x50b6('0x2c'),JSON['stringify'](_0xea548a));if(_0x2ae659[_0x50b6('0xa')]&&_0x2ae659[_0x50b6('0xa')][_0x50b6('0xb')]&&!_[_0x50b6('0x2d')](_0x2ae659[_0x50b6('0x14')])){setTimeout(handleSendEmail(_0x2ae659,_0xea548a),0x3c*0x3e8);}};}function handleJob(_0x1860b4){return function(){try{if(_[_0x50b6('0x2d')](_0x1860b4['subtractNumber'])){return logger[_0x50b6('0x8')](_0x50b6('0x2e'));}if(_[_0x50b6('0x2d')](_0x1860b4[_0x50b6('0x2f')])){return logger[_0x50b6('0x8')](_0x50b6('0x30'));}var _0x4fab3d={'startDate':moment()[_0x50b6('0x31')](_0x1860b4[_0x50b6('0x18')],_0x1860b4[_0x50b6('0x2f')])[_0x50b6('0x12')]('YYYY-MM-DD\x20HH:mm:ss'),'endDate':moment()[_0x50b6('0x12')]('YYYY-MM-DD\x20HH:mm:ss'),'type':_0x50b6('0x32'),'output':_0x1860b4[_0x50b6('0x33')],'name':_0x1860b4[_0x50b6('0x13')]};if(!_[_0x50b6('0x2d')](_0x1860b4[_0x50b6('0x34')])){logger['info'](_0x50b6('0x35'),_0x1860b4[_0x50b6('0x34')]);return analyticDefaultReportController[_0x50b6('0x36')]({'id':_0x1860b4[_0x50b6('0x34')]},_0x4fab3d)[_0x50b6('0x28')](handleResult(_0x1860b4))[_0x50b6('0x2b')](handleError());}if(!_[_0x50b6('0x2d')](_0x1860b4[_0x50b6('0x37')])){logger[_0x50b6('0x8')](_0x50b6('0x38'),_0x1860b4[_0x50b6('0x37')]);return analyticCustomReportController[_0x50b6('0x36')]({'id':_0x1860b4['CustomReportId']},_0x4fab3d)[_0x50b6('0x28')](handleResult(_0x1860b4))['catch'](handleError());}}catch(_0x68fac6){logger['error'](JSON[_0x50b6('0x21')](_0x68fac6));}return logger['info'](_0x50b6('0x39'));};}function getJobs(_0x603d35){var _0x168742={};if(_0x603d35){_0x168742['id']=_0x603d35;}return db['Schedule'][_0x50b6('0x3a')]({'where':_0x168742,'include':[{'model':db[_0x50b6('0xa')],'attributes':['id',_0x50b6('0x13'),_0x50b6('0x14')],'include':[{'model':db[_0x50b6('0x3b')],'as':_0x50b6('0xb')}]}]})[_0x50b6('0x28')](function(_0x4fcb75){var _0x284d0c=_[_0x50b6('0x3c')](manager['jobs']);var _0x204be9=_['map'](_0x4fcb75,function(_0x32d25d){return _0x32d25d['id'][_0x50b6('0x3d')]();});var _0x4238f5=_[_0x50b6('0x3e')](_0x4fcb75,function(_0x1359e2){return _0x1359e2['id'][_0x50b6('0x3d')]();});var _0x28d263=_0x603d35?_0x204be9:_[_0x50b6('0x3f')](_0x204be9,_0x284d0c);var _0x6ac883=_[_0x50b6('0x40')](_0x204be9,_0x284d0c);var _0x1dfe6c=_[_0x50b6('0x3f')](_0x284d0c,_0x204be9);var _0xb72d37;var _0x595dad;for(_0xb72d37=0x0;_0xb72d37<_0x1dfe6c[_0x50b6('0x41')]&&!_0x603d35;_0xb72d37+=0x1){_0x595dad=_0x1dfe6c[_0xb72d37][_0x50b6('0x3d')]();if(manager[_0x50b6('0x42')](_0x595dad)){manager['stop'](_0x595dad);manager['deleteJob'](_0x595dad);logger[_0x50b6('0x8')]('delete\x20cron',_0x595dad);}}logger[_0x50b6('0x8')]('toRun',JSON[_0x50b6('0x21')](_0x28d263));for(_0xb72d37=0x0;_0xb72d37<_0x28d263[_0x50b6('0x41')];_0xb72d37+=0x1){_0x595dad=_0x28d263[_0xb72d37][_0x50b6('0x3d')]();logger[_0x50b6('0x8')]('index',_0x595dad);if(_0x603d35){logger[_0x50b6('0x8')](_0x50b6('0x43'),_0x603d35);logger['info'](JSON[_0x50b6('0x21')](_0x4238f5[_0x595dad]));BPromise[_0x50b6('0x44')]()[_0x50b6('0x28')](handleJob(_0x4238f5[_0x595dad]));logger[_0x50b6('0x8')](_0x50b6('0x45'),_0x4238f5[_0x595dad][_0x50b6('0x13')],_0x4238f5[_0x595dad][_0x50b6('0x46')]);}else if(_0x4238f5[_0x595dad][_0x50b6('0x46')]&&_0x4238f5[_0x595dad][_0x50b6('0x47')]&&moment()[_0x50b6('0x48')](_0x4238f5[_0x595dad][_0x50b6('0x49')],_0x4238f5[_0x595dad][_0x50b6('0x4a')])){manager[_0x50b6('0x4b')](_0x595dad,_0x4238f5[_0x595dad][_0x50b6('0x46')],handleJob(_0x4238f5[_0x595dad]));manager[_0x50b6('0x4c')](_0x595dad);logger[_0x50b6('0x8')](_0x50b6('0x4d'),_0x4238f5[_0x595dad][_0x50b6('0x13')],_0x4238f5[_0x595dad][_0x50b6('0x46')]);}else if(manager['exists'](_0x595dad)){manager[_0x50b6('0x4e')](_0x595dad);manager[_0x50b6('0x4f')](_0x595dad);logger[_0x50b6('0x8')](_0x50b6('0x50'),_0x4238f5[_0x595dad][_0x50b6('0x13')],_0x4238f5[_0x595dad][_0x50b6('0x46')]);}}for(_0xb72d37=0x0,_0x595dad;_0xb72d37<_0x6ac883[_0x50b6('0x41')]&&!_0x603d35;_0xb72d37+=0x1){_0x595dad=_0x6ac883[_0xb72d37][_0x50b6('0x3d')]();if(manager[_0x50b6('0x42')](_0x595dad)){if(_0x4238f5[_0x595dad][_0x50b6('0x46')]&&_0x4238f5[_0x595dad][_0x50b6('0x47')]&&moment()['isBetween'](_0x4238f5[_0x595dad][_0x50b6('0x49')],_0x4238f5[_0x595dad]['endAt'])){manager[_0x50b6('0x51')](_0x595dad,_0x4238f5[_0x595dad]['cron'],handleJob(_0x4238f5[_0x595dad]));logger[_0x50b6('0x8')](_0x50b6('0x52'),_0x4238f5[_0x595dad]['name'],_0x4238f5[_0x595dad]['cron']);}else{manager['stop'](_0x595dad);manager[_0x50b6('0x4f')](_0x595dad);logger['info']('stop\x20cron',_0x4238f5[_0x595dad][_0x50b6('0x13')],_0x4238f5[_0x595dad][_0x50b6('0x46')]);}}}})['catch'](function(_0x55f237){logger[_0x50b6('0x29')](JSON[_0x50b6('0x21')](_0x55f237));});}exports[_0x50b6('0x53')]=function(_0x241fc2){return getJobs(_0x241fc2);};exports[_0x50b6('0x4c')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0x6568=['intersection','length','exists','stop','deleteJob','delete\x20cron','toRun','index','my\x20id','resolve','run\x20job','cron','active','add','start','add\x20cron','stop\x20cron','isBetween','startAt','endAt','update','update\x20cron','run','util','path','lodash','jayson/promise','bluebird','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','email','service','MailAccount','Smtp','host','port','secure','authentication','auth','pass','\x22%s\x22\x20<%s>','name','user','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','../../files/reports','savename','extname','zip','join','existsSync','status','message','format','stringify','Sent','attachments','text','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','error','error\x20mail','email\x20sent','catch','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','output','DefaultReportId','CustomReportId','runReport','no\x20report\x20id','Schedule','MailServerOut','jobs','map','toString','keyBy','difference'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6568,0x12b));var _0x8656=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6568[_0x3dd15e];return _0x231fd0;};'use strict';var fs=require('fs');var util=require(_0x8656('0x0'));var path=require(_0x8656('0x1'));var _=require(_0x8656('0x2'));var moment=require('moment');var CronJobManager=require('cron-job-manager');var jayson=require(_0x8656('0x3'));var BPromise=require(_0x8656('0x4'));var logger=require(_0x8656('0x5'))(_0x8656('0x6'));var db=require(_0x8656('0x7'))['db'];var analyticCustomReportController=require(_0x8656('0x8'));var analyticDefaultReportController=require(_0x8656('0x9'));var client=jayson[_0x8656('0xa')][_0x8656('0xb')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x5f9b19,_0x46d04c){return function(){logger[_0x8656('0xc')]('Try\x20to\x20send\x20a\x20mail\x20to',_0x5f9b19[_0x8656('0xd')]);var _0x5a3a54=!![];var _0x305029={'tls':{'rejectUnauthorized':![]}};if(_0x5f9b19['MailAccount']['Smtp'][_0x8656('0xe')]){_0x305029[_0x8656('0xe')]=_0x5f9b19[_0x8656('0xf')][_0x8656('0x10')][_0x8656('0xe')];}else{_0x305029[_0x8656('0x11')]=_0x5f9b19[_0x8656('0xf')][_0x8656('0x10')]['host'];_0x305029[_0x8656('0x12')]=_0x5f9b19[_0x8656('0xf')][_0x8656('0x10')][_0x8656('0x12')];_0x305029[_0x8656('0x13')]=_0x5f9b19[_0x8656('0xf')][_0x8656('0x10')][_0x8656('0x13')];}if(_0x5f9b19[_0x8656('0xf')][_0x8656('0x10')][_0x8656('0x14')]){_0x305029[_0x8656('0x15')]={'user':_0x5f9b19['MailAccount'][_0x8656('0x10')]['user'],'pass':_0x5f9b19[_0x8656('0xf')][_0x8656('0x10')][_0x8656('0x16')]};}var _0x19c97b={'account':_0x305029,'message':{'from':util['format'](_0x8656('0x17'),_0x5f9b19[_0x8656('0xf')][_0x8656('0x18')],_0x5f9b19['MailAccount'][_0x8656('0xd')]||_0x5f9b19[_0x8656('0xf')][_0x8656('0x10')][_0x8656('0x19')]),'to':_0x5f9b19[_0x8656('0xd')],'cc':_0x5f9b19['cc'],'bcc':_0x5f9b19[_0x8656('0x1a')],'subject':util['format'](_0x8656('0x1b'),_0x46d04c[_0x8656('0x18')],_0x5f9b19[_0x8656('0x1c')],_0x5f9b19[_0x8656('0x1d')])}};var _0x26a15f=path['join'](__dirname,_0x8656('0x1e'));var _0x494247=_0x46d04c[_0x8656('0x1f')];var _0x5c3591=util['format']('%s.%s',path['basename'](_0x46d04c[_0x8656('0x1f')],path[_0x8656('0x20')](_0x46d04c[_0x8656('0x1f')])),_0x8656('0x21'));var _0x401b4e=path[_0x8656('0x22')](_0x26a15f,_0x494247);var _0x23cd59=path['join'](_0x26a15f,_0x5c3591);if(fs[_0x8656('0x23')](_0x401b4e)){_0x46d04c[_0x8656('0x24')]='Sent';_0x19c97b[_0x8656('0x25')]['attachments']=[{'filename':_0x494247,'path':_0x401b4e}];_0x19c97b[_0x8656('0x25')]['text']=util[_0x8656('0x26')]('Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a',JSON[_0x8656('0x27')](_0x46d04c,null,0x2));}else if(fs['existsSync'](_0x23cd59)){_0x46d04c[_0x8656('0x24')]=_0x8656('0x28');_0x19c97b['message'][_0x8656('0x29')]=[{'filename':_0x5c3591,'path':_0x23cd59}];}else{_0x19c97b[_0x8656('0x25')][_0x8656('0x2a')]='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0x5f9b19[_0x8656('0x2b')]){_0x5a3a54=![];logger[_0x8656('0xc')](_0x8656('0x2c'));}}if(_0x5a3a54){return client[_0x8656('0x2d')](_0x8656('0x2e'),_0x19c97b)[_0x8656('0x2f')](function(_0x18067b){if(_0x18067b[_0x8656('0x30')]){return logger['error'](_0x8656('0x31'),JSON[_0x8656('0x27')](_0x18067b));}return logger[_0x8656('0xc')](_0x8656('0x32'));})[_0x8656('0x33')](function(_0xfed901){return logger[_0x8656('0x30')]('error\x20mail',JSON[_0x8656('0x27')](_0xfed901));});}};}function handleError(){return function(_0x159009){return logger[_0x8656('0x30')](JSON[_0x8656('0x27')](_0x159009));};}function handleResult(_0x385fa8){return function(_0x34da6a){logger['info'](_0x8656('0x34'),JSON[_0x8656('0x27')](_0x34da6a));if(_0x385fa8[_0x8656('0xf')]&&_0x385fa8[_0x8656('0xf')][_0x8656('0x10')]&&!_[_0x8656('0x35')](_0x385fa8[_0x8656('0xd')])){setTimeout(handleSendEmail(_0x385fa8,_0x34da6a),0x3c*0x3e8);}};}function handleJob(_0x59bbad){return function(){try{if(_[_0x8656('0x35')](_0x59bbad['subtractNumber'])){return logger[_0x8656('0xc')](_0x8656('0x36'));}if(_[_0x8656('0x35')](_0x59bbad[_0x8656('0x1d')])){return logger['info']('subtractUnit\x20null\x20or\x20undefined');}var _0x12277e={'startDate':moment()[_0x8656('0x37')](_0x59bbad[_0x8656('0x1c')],_0x59bbad[_0x8656('0x1d')])['format'](_0x8656('0x38')),'endDate':moment()[_0x8656('0x26')](_0x8656('0x38')),'type':'scheduled','output':_0x59bbad[_0x8656('0x39')],'name':_0x59bbad[_0x8656('0x18')]};if(!_[_0x8656('0x35')](_0x59bbad[_0x8656('0x3a')])){logger[_0x8656('0xc')]('exec\x20defaul\x20report\x20id:%s',_0x59bbad[_0x8656('0x3a')]);return analyticDefaultReportController['runReport']({'id':_0x59bbad['DefaultReportId']},_0x12277e)[_0x8656('0x2f')](handleResult(_0x59bbad))[_0x8656('0x33')](handleError());}if(!_[_0x8656('0x35')](_0x59bbad[_0x8656('0x3b')])){logger['info']('exec\x20custom\x20report\x20id:%s',_0x59bbad[_0x8656('0x3b')]);return analyticCustomReportController[_0x8656('0x3c')]({'id':_0x59bbad[_0x8656('0x3b')]},_0x12277e)[_0x8656('0x2f')](handleResult(_0x59bbad))[_0x8656('0x33')](handleError());}}catch(_0x1cc82a){logger[_0x8656('0x30')](JSON['stringify'](_0x1cc82a));}return logger[_0x8656('0xc')](_0x8656('0x3d'));};}function getJobs(_0xa90b96){var _0x2f7f00={};if(_0xa90b96){_0x2f7f00['id']=_0xa90b96;}return db[_0x8656('0x3e')]['findAll']({'where':_0x2f7f00,'include':[{'model':db[_0x8656('0xf')],'attributes':['id',_0x8656('0x18'),_0x8656('0xd')],'include':[{'model':db[_0x8656('0x3f')],'as':_0x8656('0x10')}]}]})['then'](function(_0x3fa669){var _0x1729a2=_['keys'](manager[_0x8656('0x40')]);var _0x37fe07=_[_0x8656('0x41')](_0x3fa669,function(_0xf2066a){return _0xf2066a['id'][_0x8656('0x42')]();});var _0x2fb034=_[_0x8656('0x43')](_0x3fa669,function(_0x59648e){return _0x59648e['id'][_0x8656('0x42')]();});var _0x20356a=_0xa90b96?_0x37fe07:_[_0x8656('0x44')](_0x37fe07,_0x1729a2);var _0x43d1d1=_[_0x8656('0x45')](_0x37fe07,_0x1729a2);var _0x4f573a=_[_0x8656('0x44')](_0x1729a2,_0x37fe07);var _0x1d467d;var _0x23c1a4;for(_0x1d467d=0x0;_0x1d467d<_0x4f573a[_0x8656('0x46')]&&!_0xa90b96;_0x1d467d+=0x1){_0x23c1a4=_0x4f573a[_0x1d467d][_0x8656('0x42')]();if(manager[_0x8656('0x47')](_0x23c1a4)){manager[_0x8656('0x48')](_0x23c1a4);manager[_0x8656('0x49')](_0x23c1a4);logger['info'](_0x8656('0x4a'),_0x23c1a4);}}logger[_0x8656('0xc')](_0x8656('0x4b'),JSON[_0x8656('0x27')](_0x20356a));for(_0x1d467d=0x0;_0x1d467d<_0x20356a[_0x8656('0x46')];_0x1d467d+=0x1){_0x23c1a4=_0x20356a[_0x1d467d][_0x8656('0x42')]();logger[_0x8656('0xc')](_0x8656('0x4c'),_0x23c1a4);if(_0xa90b96){logger[_0x8656('0xc')](_0x8656('0x4d'),_0xa90b96);logger[_0x8656('0xc')](JSON[_0x8656('0x27')](_0x2fb034[_0x23c1a4]));BPromise[_0x8656('0x4e')]()[_0x8656('0x2f')](handleJob(_0x2fb034[_0x23c1a4]));logger[_0x8656('0xc')](_0x8656('0x4f'),_0x2fb034[_0x23c1a4]['name'],_0x2fb034[_0x23c1a4][_0x8656('0x50')]);}else if(_0x2fb034[_0x23c1a4][_0x8656('0x50')]&&_0x2fb034[_0x23c1a4][_0x8656('0x51')]&&moment()['isBetween'](_0x2fb034[_0x23c1a4]['startAt'],_0x2fb034[_0x23c1a4]['endAt'])){manager[_0x8656('0x52')](_0x23c1a4,_0x2fb034[_0x23c1a4][_0x8656('0x50')],handleJob(_0x2fb034[_0x23c1a4]));manager[_0x8656('0x53')](_0x23c1a4);logger[_0x8656('0xc')](_0x8656('0x54'),_0x2fb034[_0x23c1a4]['name'],_0x2fb034[_0x23c1a4][_0x8656('0x50')]);}else if(manager[_0x8656('0x47')](_0x23c1a4)){manager['stop'](_0x23c1a4);manager[_0x8656('0x49')](_0x23c1a4);logger[_0x8656('0xc')](_0x8656('0x55'),_0x2fb034[_0x23c1a4][_0x8656('0x18')],_0x2fb034[_0x23c1a4][_0x8656('0x50')]);}}for(_0x1d467d=0x0,_0x23c1a4;_0x1d467d<_0x43d1d1[_0x8656('0x46')]&&!_0xa90b96;_0x1d467d+=0x1){_0x23c1a4=_0x43d1d1[_0x1d467d][_0x8656('0x42')]();if(manager['exists'](_0x23c1a4)){if(_0x2fb034[_0x23c1a4][_0x8656('0x50')]&&_0x2fb034[_0x23c1a4]['active']&&moment()[_0x8656('0x56')](_0x2fb034[_0x23c1a4][_0x8656('0x57')],_0x2fb034[_0x23c1a4][_0x8656('0x58')])){manager[_0x8656('0x59')](_0x23c1a4,_0x2fb034[_0x23c1a4]['cron'],handleJob(_0x2fb034[_0x23c1a4]));logger['info'](_0x8656('0x5a'),_0x2fb034[_0x23c1a4][_0x8656('0x18')],_0x2fb034[_0x23c1a4][_0x8656('0x50')]);}else{manager[_0x8656('0x48')](_0x23c1a4);manager[_0x8656('0x49')](_0x23c1a4);logger['info'](_0x8656('0x55'),_0x2fb034[_0x23c1a4][_0x8656('0x18')],_0x2fb034[_0x23c1a4][_0x8656('0x50')]);}}}})['catch'](function(_0x583c68){logger['error'](JSON[_0x8656('0x27')](_0x583c68));});}exports[_0x8656('0x5b')]=function(_0x5d155e){return getJobs(_0x5d155e);};exports[_0x8656('0x53')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file diff --git a/server/config/schedule/transcribe.js b/server/config/schedule/transcribe.js index 12716ca..2fd34f5 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 _0x8278=['sentiment','sentimentRegion','language','ValidationError','Transcript\x20not\x20available','sentimentAccountId','CloudProvider','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','SentimentScore','Negative','Mixed','Neutral','update','FAILED','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','Sentiment\x20Analysis\x20not\x20requested','bucket','findOne','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','Positive','catch','name','SequelizeValidationError','error','inspect','VoiceRecording','findAll','No\x20transcribe\x20job\x20to\x20check','Setting','transcribeAccountId','Transcribe\x20not\x20configured','push','lodash','aws-sdk','request-promise','util','../../config/logger','transcribe','TranscribeService','getTranscriptionJob','detectSentiment','substring','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','transcribeRegion','info','TranscriptionJob','TranscriptionJobStatus','COMPLETED','[RECORDING:%d]\x20Get\x20transcript','Transcript','then','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','fileText','transcript','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize'];(function(_0x1e7f37,_0x1d6b90){var _0x2ae848=function(_0x15c740){while(--_0x15c740){_0x1e7f37['push'](_0x1e7f37['shift']());}};_0x2ae848(++_0x1d6b90);}(_0x8278,0x1ae));var _0x8827=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8278[_0x3dd15e];return _0x231fd0;};var _=require(_0x8827('0x0'));var AWS=require(_0x8827('0x1'));var rp=require(_0x8827('0x2'));var util=require(_0x8827('0x3'));var BPromise=require('bluebird');var db=require('../../mysqldb')['db'];var logger=require(_0x8827('0x4'))(_0x8827('0x5'));function getTranscriptionJob(_0x9a5311,_0xf4c10,_0x5b72ad,_0x400227){return new Promise(function(_0x4342d7,_0x11797a){var _0x31d236=new AWS[(_0x8827('0x6'))]({'accessKeyId':_0xf4c10,'secretAccessKey':_0x9a5311,'region':_0x5b72ad});_0x31d236[_0x8827('0x7')]({'TranscriptionJobName':_0x400227},function(_0xb78af,_0x24af1d){if(_0xb78af){return _0x11797a(_0xb78af);}else{return _0x4342d7(_0x24af1d);}});});}function sentiment(_0x117d42,_0x416ba6,_0x3c1ba6,_0x126062,_0x219264){return new Promise(function(_0x500afa,_0x2bfd74){var _0x36d32b=new AWS['Comprehend']({'accessKeyId':_0x416ba6,'secretAccessKey':_0x117d42,'region':_0x3c1ba6});_0x36d32b[_0x8827('0x8')]({'Text':_0x126062,'LanguageCode':_0x219264[_0x8827('0x9')](0x0,0x2)},function(_0x509058,_0x41bef7){if(_0x509058){return _0x2bfd74(_0x509058);}else{return _0x500afa(_0x41bef7);}});});}function checkTranscribeJob(_0x479abf,_0x4a180c,_0x2cce86){var _0x449408;return new BPromise(function(_0x83aad2,_0x2abb63){logger['info'](util[_0x8827('0xa')](_0x8827('0xb'),_0x479abf['id'],_0x479abf[_0x8827('0xc')]));return getTranscriptionJob(_0x2cce86[_0x8827('0xd')],_0x2cce86[_0x8827('0xe')],_0x4a180c[_0x8827('0xf')],_0x479abf[_0x8827('0xc')])['then'](function(_0x4456e3){logger[_0x8827('0x10')](util[_0x8827('0xa')]('[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s',_0x479abf['id'],_0x479abf[_0x8827('0xc')],_0x4456e3[_0x8827('0x11')][_0x8827('0x12')]));if(!_0x479abf['fileText']){switch(_0x4456e3['TranscriptionJob'][_0x8827('0x12')]){case _0x8827('0x13'):var _0x5b71de={'transcribeStatus':_0x4456e3['TranscriptionJob'][_0x8827('0x12')],'fileUri':_0x4456e3['TranscriptionJob']['Transcript']['TranscriptFileUri']};logger[_0x8827('0x10')](util[_0x8827('0xa')](_0x8827('0x14'),_0x479abf['id']));return rp({'uri':_0x4456e3['TranscriptionJob'][_0x8827('0x15')]['TranscriptFileUri'],'json':!![]})[_0x8827('0x16')](function(_0x186787){logger['info'](util['format'](_0x8827('0x17'),_0x479abf['id']));if(_0x186787&&_0x186787['results']&&_0x186787[_0x8827('0x18')]['transcripts']&&_0x186787[_0x8827('0x18')][_0x8827('0x19')][_0x8827('0x1a')]){_0x5b71de['fileText']='';for(var _0x427e2f=0x0;_0x427e2f<_0x186787[_0x8827('0x18')][_0x8827('0x19')]['length'];_0x427e2f++){_0x5b71de[_0x8827('0x1b')]+=_0x186787['results'][_0x8827('0x19')][_0x427e2f][_0x8827('0x1c')]+'';}}return _0x479abf['update'](_0x5b71de);})[_0x8827('0x16')](function(){logger[_0x8827('0x10')](util[_0x8827('0xa')](_0x8827('0x1d'),_0x479abf['id']));if(!_0x479abf[_0x8827('0x1e')]){throw new db[(_0x8827('0x1f'))]['ValidationError']('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x4a180c[_0x8827('0x20')]||!_0x4a180c['sentimentAccountId']||!_0x4a180c[_0x8827('0x21')]||!_0x4a180c[_0x8827('0x22')]||!_0x4a180c['bucket']){throw new db['Sequelize'][(_0x8827('0x23'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x5b71de[_0x8827('0x1b')]){throw new Error(_0x8827('0x24'));}if(_0x4a180c[_0x8827('0x25')]===_0x2cce86['id']){return _0x2cce86;}else{return db[_0x8827('0x26')]['findOne']({'where':{'id':_settings[_0x8827('0x25')]}});}})['then'](function(_0x5a1888){if(!_0x5a1888){throw new db[(_0x8827('0x1f'))][(_0x8827('0x23'))](_0x8827('0x27'));}if(!_0x5a1888[_0x8827('0xd')]||!_0x5a1888['data2']){throw new db[(_0x8827('0x1f'))][(_0x8827('0x23'))](_0x8827('0x28'));}_0x449408=_0x5a1888;logger['info'](util[_0x8827('0xa')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x479abf['id']));return sentiment(_0x449408[_0x8827('0xd')],_0x449408[_0x8827('0xe')],_0x4a180c['sentimentRegion'],_0x5b71de[_0x8827('0x1b')],_0x4a180c[_0x8827('0x22')]);})['then'](function(_0x5390c9){logger[_0x8827('0x10')](util[_0x8827('0xa')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x479abf['id']));return _0x479abf['update']({'sentiment':_0x5390c9['Sentiment'],'sPositive':_0x5390c9[_0x8827('0x29')]['Positive'],'sNegative':_0x5390c9[_0x8827('0x29')][_0x8827('0x2a')],'sMixed':_0x5390c9[_0x8827('0x29')][_0x8827('0x2b')],'sNeutral':_0x5390c9[_0x8827('0x29')][_0x8827('0x2c')]});})['then'](function(){logger[_0x8827('0x10')](util[_0x8827('0xa')](_0x8827('0x1d'),_0x479abf['id']));_0x83aad2();});case'FAILED':return _0x479abf[_0x8827('0x2d')]({'transcribeStatus':_0x8827('0x2e'),'failureReason':_0x4456e3['TranscriptionJob']['FailureReason']})[_0x8827('0x16')](function(){logger[_0x8827('0x10')](util[_0x8827('0xa')](_0x8827('0x1d'),_0x479abf['id']));_0x83aad2();});default:logger[_0x8827('0x10')](util[_0x8827('0xa')](_0x8827('0x2f'),_0x479abf['id']));break;}}else{return BPromise['resolve']()[_0x8827('0x16')](function(){if(!_0x479abf['tempSentiment']){throw new db[(_0x8827('0x1f'))][(_0x8827('0x23'))](_0x8827('0x30'));}if(!_0x4a180c[_0x8827('0x20')]||!_0x4a180c[_0x8827('0x25')]||!_0x4a180c[_0x8827('0x21')]||!_0x4a180c[_0x8827('0x22')]||!_0x4a180c[_0x8827('0x31')]){throw new db[(_0x8827('0x1f'))][(_0x8827('0x23'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x479abf['fileText']){throw new Error(_0x8827('0x24'));}if(_0x4a180c[_0x8827('0x25')]===_0x2cce86['id']){return _0x2cce86;}else{return db[_0x8827('0x26')][_0x8827('0x32')]({'where':{'id':_settings[_0x8827('0x25')]}});}})[_0x8827('0x16')](function(_0x2f38d7){if(!_0x2f38d7){throw new db['Sequelize']['ValidationError'](_0x8827('0x27'));}if(!_0x2f38d7['data1']||!_0x2f38d7[_0x8827('0xe')]){throw new db[(_0x8827('0x1f'))][(_0x8827('0x23'))](_0x8827('0x28'));}_0x449408=_0x2f38d7;logger[_0x8827('0x10')](util['format']('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x479abf['id']));return sentiment(_0x449408[_0x8827('0xd')],_0x449408[_0x8827('0xe')],_0x4a180c[_0x8827('0x21')],_0x479abf[_0x8827('0x1b')],_0x4a180c[_0x8827('0x22')]);})[_0x8827('0x16')](function(_0x59f0ff){logger[_0x8827('0x10')](util[_0x8827('0xa')](_0x8827('0x33'),_0x479abf['id']));return _0x479abf['update']({'sentiment':_0x59f0ff[_0x8827('0x34')],'sPositive':_0x59f0ff['SentimentScore'][_0x8827('0x35')],'sNegative':_0x59f0ff[_0x8827('0x29')][_0x8827('0x2a')],'sMixed':_0x59f0ff['SentimentScore']['Mixed'],'sNeutral':_0x59f0ff[_0x8827('0x29')]['Neutral'],'transcribeStatus':_0x8827('0x13')});})[_0x8827('0x16')](function(){logger['info'](util[_0x8827('0xa')](_0x8827('0x1d'),_0x479abf['id']));_0x83aad2();});}})[_0x8827('0x36')](function(_0x207075){if(_0x207075){if(!_0x207075[_0x8827('0x37')]||_0x207075['name']!==_0x8827('0x38')){logger[_0x8827('0x39')](util['format']('[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis',_0x479abf['id']),util[_0x8827('0x3a')](_0x207075,{'showHidden':![],'depth':null}));}}_0x83aad2();});});}function checkTranscribe(){var _0x87aa7e;var _0x544ffe;var _0x361a03;return db[_0x8827('0x3b')][_0x8827('0x3c')]({'where':{'transcribeStatus':'IN_PROGRESS'}})[_0x8827('0x16')](function(_0x21b5d5){if(!_0x21b5d5||!_0x21b5d5[_0x8827('0x1a')]){throw new db[(_0x8827('0x1f'))][(_0x8827('0x23'))](_0x8827('0x3d'));}_0x87aa7e=_0x21b5d5;return db[_0x8827('0x3e')][_0x8827('0x32')]({'where':{'id':0x1}});})[_0x8827('0x16')](function(_0x3d1004){if(!_0x3d1004){throw new db[(_0x8827('0x1f'))][(_0x8827('0x23'))]('Settings\x20not\x20available');}_0x544ffe=_0x3d1004;if(!_0x544ffe[_0x8827('0x5')]||!_0x544ffe[_0x8827('0x3f')]||!_0x544ffe['transcribeRegion']||!_0x544ffe[_0x8827('0x22')]||!_0x544ffe['bucket']){throw new db[(_0x8827('0x1f'))][(_0x8827('0x23'))](_0x8827('0x40'));}return db[_0x8827('0x26')][_0x8827('0x32')]({'where':{'id':_0x544ffe[_0x8827('0x3f')]}});})[_0x8827('0x16')](function(_0x104496){if(!_0x104496){throw new db[(_0x8827('0x1f'))][(_0x8827('0x23'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x104496['data1']||!_0x104496[_0x8827('0xe')]){throw new db[(_0x8827('0x1f'))][(_0x8827('0x23'))](_0x8827('0x28'));}_0x361a03=_0x104496;var _0x4d01a6=[];_0x87aa7e['forEach'](function(_0x583dfc){_0x4d01a6[_0x8827('0x41')](checkTranscribeJob(_0x583dfc,_0x544ffe,_0x361a03));});return BPromise['all'](_0x4d01a6);})['catch'](function(_0x404604){if(_0x404604){if(!_0x404604['name']||_0x404604[_0x8827('0x37')]!==_0x8827('0x38')){logger[_0x8827('0x39')](util[_0x8827('0x3a')](_0x404604,{'showHidden':![],'depth':null}));}}});}exports['start']=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0x345e=['Settings\x20not\x20available','transcribeAccountId','forEach','all','name','lodash','aws-sdk','util','bluebird','../../mysqldb','../../config/logger','transcribe','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment','substring','info','transcribeName','data1','data2','transcribeRegion','then','format','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJobStatus','fileText','TranscriptionJob','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript','tempSentiment','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','language','bucket','Sequelize','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','sentimentAccountId','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','sentimentRegion','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','update','Sentiment','SentimentScore','Positive','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','FAILED','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','Negative','Neutral','catch','SequelizeValidationError','error','inspect','VoiceRecording','No\x20transcribe\x20job\x20to\x20check','Setting'];(function(_0x1ec8f9,_0x22f5e7){var _0x17cd3d=function(_0x156ad2){while(--_0x156ad2){_0x1ec8f9['push'](_0x1ec8f9['shift']());}};_0x17cd3d(++_0x22f5e7);}(_0x345e,0x168));var _0xe345=function(_0x216240,_0xb67e29){_0x216240=_0x216240-0x0;var _0x488ab8=_0x345e[_0x216240];return _0x488ab8;};var _=require(_0xe345('0x0'));var AWS=require(_0xe345('0x1'));var rp=require('request-promise');var util=require(_0xe345('0x2'));var BPromise=require(_0xe345('0x3'));var db=require(_0xe345('0x4'))['db'];var logger=require(_0xe345('0x5'))(_0xe345('0x6'));function getTranscriptionJob(_0x43d6fd,_0x469d06,_0x304b67,_0x414110){return new Promise(function(_0x575c38,_0x4491a9){var _0x38cc87=new AWS[(_0xe345('0x7'))]({'accessKeyId':_0x469d06,'secretAccessKey':_0x43d6fd,'region':_0x304b67});_0x38cc87[_0xe345('0x8')]({'TranscriptionJobName':_0x414110},function(_0x24f14f,_0x18f9a3){if(_0x24f14f){return _0x4491a9(_0x24f14f);}else{return _0x575c38(_0x18f9a3);}});});}function sentiment(_0x517809,_0x5912b2,_0x41bd55,_0x47382b,_0x322dc6){return new Promise(function(_0x15aa5a,_0x3d2b81){var _0x30d4d2=new AWS[(_0xe345('0x9'))]({'accessKeyId':_0x5912b2,'secretAccessKey':_0x517809,'region':_0x41bd55});_0x30d4d2[_0xe345('0xa')]({'Text':_0x47382b,'LanguageCode':_0x322dc6[_0xe345('0xb')](0x0,0x2)},function(_0x2efe39,_0x5ed9f0){if(_0x2efe39){return _0x3d2b81(_0x2efe39);}else{return _0x15aa5a(_0x5ed9f0);}});});}function checkTranscribeJob(_0xf95224,_0x1a8ced,_0x5a5df4){var _0x5d9379;return new BPromise(function(_0x2be002,_0x5bd8d6){logger[_0xe345('0xc')](util['format']('[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)',_0xf95224['id'],_0xf95224[_0xe345('0xd')]));return getTranscriptionJob(_0x5a5df4[_0xe345('0xe')],_0x5a5df4[_0xe345('0xf')],_0x1a8ced[_0xe345('0x10')],_0xf95224[_0xe345('0xd')])[_0xe345('0x11')](function(_0x1d3717){logger[_0xe345('0xc')](util[_0xe345('0x12')](_0xe345('0x13'),_0xf95224['id'],_0xf95224['transcribeName'],_0x1d3717['TranscriptionJob'][_0xe345('0x14')]));if(!_0xf95224[_0xe345('0x15')]){switch(_0x1d3717[_0xe345('0x16')][_0xe345('0x14')]){case _0xe345('0x17'):var _0x4bed9f={'transcribeStatus':_0x1d3717[_0xe345('0x16')][_0xe345('0x14')],'fileUri':_0x1d3717['TranscriptionJob'][_0xe345('0x18')][_0xe345('0x19')]};logger[_0xe345('0xc')](util[_0xe345('0x12')](_0xe345('0x1a'),_0xf95224['id']));return rp({'uri':_0x1d3717[_0xe345('0x16')]['Transcript'][_0xe345('0x19')],'json':!![]})['then'](function(_0x176e04){logger['info'](util[_0xe345('0x12')](_0xe345('0x1b'),_0xf95224['id']));if(_0x176e04&&_0x176e04[_0xe345('0x1c')]&&_0x176e04[_0xe345('0x1c')]['transcripts']&&_0x176e04['results'][_0xe345('0x1d')][_0xe345('0x1e')]){_0x4bed9f['fileText']='';for(var _0x575c9a=0x0;_0x575c9a<_0x176e04['results'][_0xe345('0x1d')][_0xe345('0x1e')];_0x575c9a++){_0x4bed9f[_0xe345('0x15')]+=_0x176e04['results']['transcripts'][_0x575c9a][_0xe345('0x1f')]+'';}}return _0xf95224['update'](_0x4bed9f);})[_0xe345('0x11')](function(){logger[_0xe345('0xc')](util[_0xe345('0x12')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0xf95224['id']));if(!_0xf95224[_0xe345('0x20')]){throw new db['Sequelize'][(_0xe345('0x21'))](_0xe345('0x22'));}if(!_0x1a8ced[_0xe345('0x23')]||!_0x1a8ced['sentimentAccountId']||!_0x1a8ced['sentimentRegion']||!_0x1a8ced[_0xe345('0x24')]||!_0x1a8ced[_0xe345('0x25')]){throw new db[(_0xe345('0x26'))][(_0xe345('0x21'))](_0xe345('0x27'));}if(!_0x4bed9f['fileText']){throw new Error(_0xe345('0x28'));}if(_0x1a8ced[_0xe345('0x29')]===_0x5a5df4['id']){return _0x5a5df4;}else{return db[_0xe345('0x2a')][_0xe345('0x2b')]({'where':{'id':_settings[_0xe345('0x29')]}});}})['then'](function(_0x163abd){if(!_0x163abd){throw new db[(_0xe345('0x26'))]['ValidationError'](_0xe345('0x2c'));}if(!_0x163abd[_0xe345('0xe')]||!_0x163abd[_0xe345('0xf')]){throw new db['Sequelize']['ValidationError'](_0xe345('0x2d'));}_0x5d9379=_0x163abd;logger[_0xe345('0xc')](util['format'](_0xe345('0x2e'),_0xf95224['id']));return sentiment(_0x5d9379[_0xe345('0xe')],_0x5d9379[_0xe345('0xf')],_0x1a8ced[_0xe345('0x2f')],_0x4bed9f[_0xe345('0x15')],_0x1a8ced[_0xe345('0x24')]);})[_0xe345('0x11')](function(_0x3ae902){logger[_0xe345('0xc')](util['format'](_0xe345('0x30'),_0xf95224['id']));return _0xf95224[_0xe345('0x31')]({'sentiment':_0x3ae902[_0xe345('0x32')],'sPositive':_0x3ae902[_0xe345('0x33')][_0xe345('0x34')],'sNegative':_0x3ae902[_0xe345('0x33')]['Negative'],'sMixed':_0x3ae902['SentimentScore']['Mixed'],'sNeutral':_0x3ae902[_0xe345('0x33')]['Neutral']});})[_0xe345('0x11')](function(){logger[_0xe345('0xc')](util[_0xe345('0x12')](_0xe345('0x35'),_0xf95224['id']));_0x2be002();});case'FAILED':return _0xf95224[_0xe345('0x31')]({'transcribeStatus':_0xe345('0x36'),'failureReason':_0x1d3717[_0xe345('0x16')]['FailureReason']})[_0xe345('0x11')](function(){logger[_0xe345('0xc')](util[_0xe345('0x12')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0xf95224['id']));_0x2be002();});default:logger['info'](util[_0xe345('0x12')](_0xe345('0x37'),_0xf95224['id']));break;}}else{return BPromise[_0xe345('0x38')]()['then'](function(){if(!_0xf95224['tempSentiment']){throw new db[(_0xe345('0x26'))][(_0xe345('0x21'))](_0xe345('0x22'));}if(!_0x1a8ced[_0xe345('0x23')]||!_0x1a8ced[_0xe345('0x29')]||!_0x1a8ced[_0xe345('0x2f')]||!_0x1a8ced[_0xe345('0x24')]||!_0x1a8ced[_0xe345('0x25')]){throw new db[(_0xe345('0x26'))][(_0xe345('0x21'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0xf95224[_0xe345('0x15')]){throw new Error(_0xe345('0x28'));}if(_0x1a8ced[_0xe345('0x29')]===_0x5a5df4['id']){return _0x5a5df4;}else{return db[_0xe345('0x2a')]['findOne']({'where':{'id':_settings['sentimentAccountId']}});}})['then'](function(_0x3d019c){if(!_0x3d019c){throw new db[(_0xe345('0x26'))][(_0xe345('0x21'))](_0xe345('0x2c'));}if(!_0x3d019c[_0xe345('0xe')]||!_0x3d019c[_0xe345('0xf')]){throw new db[(_0xe345('0x26'))][(_0xe345('0x21'))]('Cloud\x20Provider\x20not\x20configured');}_0x5d9379=_0x3d019c;logger[_0xe345('0xc')](util[_0xe345('0x12')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0xf95224['id']));return sentiment(_0x5d9379['data1'],_0x5d9379[_0xe345('0xf')],_0x1a8ced[_0xe345('0x2f')],_0xf95224[_0xe345('0x15')],_0x1a8ced['language']);})[_0xe345('0x11')](function(_0x3ed152){logger['info'](util['format'](_0xe345('0x30'),_0xf95224['id']));return _0xf95224[_0xe345('0x31')]({'sentiment':_0x3ed152['Sentiment'],'sPositive':_0x3ed152['SentimentScore'][_0xe345('0x34')],'sNegative':_0x3ed152['SentimentScore'][_0xe345('0x39')],'sMixed':_0x3ed152['SentimentScore']['Mixed'],'sNeutral':_0x3ed152[_0xe345('0x33')][_0xe345('0x3a')],'transcribeStatus':_0xe345('0x17')});})[_0xe345('0x11')](function(){logger[_0xe345('0xc')](util[_0xe345('0x12')](_0xe345('0x35'),_0xf95224['id']));_0x2be002();});}})[_0xe345('0x3b')](function(_0x336cbd){if(_0x336cbd){if(!_0x336cbd['name']||_0x336cbd['name']!==_0xe345('0x3c')){logger[_0xe345('0x3d')](util[_0xe345('0x12')]('[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis',_0xf95224['id']),util[_0xe345('0x3e')](_0x336cbd,{'showHidden':![],'depth':null}));}}_0x2be002();});});}function checkTranscribe(){var _0x4ef10;var _0x1c9821;var _0x22d1fe;return db[_0xe345('0x3f')]['findAll']({'where':{'transcribeStatus':'IN_PROGRESS'}})['then'](function(_0x132988){if(!_0x132988||!_0x132988[_0xe345('0x1e')]){throw new db[(_0xe345('0x26'))][(_0xe345('0x21'))](_0xe345('0x40'));}_0x4ef10=_0x132988;return db[_0xe345('0x41')]['findOne']({'where':{'id':0x1}});})[_0xe345('0x11')](function(_0x4a9b7f){if(!_0x4a9b7f){throw new db[(_0xe345('0x26'))][(_0xe345('0x21'))](_0xe345('0x42'));}_0x1c9821=_0x4a9b7f;if(!_0x1c9821['transcribe']||!_0x1c9821[_0xe345('0x43')]||!_0x1c9821[_0xe345('0x10')]||!_0x1c9821['language']||!_0x1c9821[_0xe345('0x25')]){throw new db[(_0xe345('0x26'))][(_0xe345('0x21'))]('Transcribe\x20not\x20configured');}return db[_0xe345('0x2a')]['findOne']({'where':{'id':_0x1c9821[_0xe345('0x43')]}});})[_0xe345('0x11')](function(_0x4e9b9f){if(!_0x4e9b9f){throw new db[(_0xe345('0x26'))]['ValidationError']('Cloud\x20Provider\x20not\x20available');}if(!_0x4e9b9f[_0xe345('0xe')]||!_0x4e9b9f[_0xe345('0xf')]){throw new db[(_0xe345('0x26'))]['ValidationError']('Cloud\x20Provider\x20not\x20configured');}_0x22d1fe=_0x4e9b9f;var _0x50e159=[];_0x4ef10[_0xe345('0x44')](function(_0x7c7e60){_0x50e159['push'](checkTranscribeJob(_0x7c7e60,_0x1c9821,_0x22d1fe));});return BPromise[_0xe345('0x45')](_0x50e159);})[_0xe345('0x3b')](function(_0xc8f27){if(_0xc8f27){if(!_0xc8f27[_0xe345('0x46')]||_0xc8f27['name']!==_0xe345('0x3c')){logger[_0xe345('0x3d')](util[_0xe345('0x3e')](_0xc8f27,{'showHidden':![],'depth':null}));}}});}exports['start']=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 97a864d..127a00d 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 _0x1d39=['length','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','whatsappInteraction:update','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','lodash','moment','ioredis','util','../../config/environment','../../mysqldb','schedule','redis','localhost','socket.io-emitter','WhatsappInteraction','findAll','lastMsgAt','subtract','hours','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','then'];(function(_0x29f2aa,_0x1c8536){var _0x27b347=function(_0x3543c6){while(--_0x3543c6){_0x29f2aa['push'](_0x29f2aa['shift']());}};_0x27b347(++_0x1c8536);}(_0x1d39,0x108));var _0x91d3=function(_0x9d5442,_0x33e9ab){_0x9d5442=_0x9d5442-0x0;var _0x5331b1=_0x1d39[_0x9d5442];return _0x5331b1;};'use strict';var _=require(_0x91d3('0x0'));var moment=require(_0x91d3('0x1'));var Redis=require(_0x91d3('0x2'));var util=require(_0x91d3('0x3'));var config=require(_0x91d3('0x4'));var db=require(_0x91d3('0x5'))['db'];var logger=require('../logger')(_0x91d3('0x6'));config[_0x91d3('0x7')]=_['defaults'](config['redis'],{'host':_0x91d3('0x8'),'port':0x18eb});var io=require(_0x91d3('0x9'))(new Redis(config[_0x91d3('0x7')]));function closeInteractions(){var _0x159243=[];return db[_0x91d3('0xa')][_0x91d3('0xb')]({'raw':!![],'attributes':['id',_0x91d3('0xc')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x91d3('0xd')](0x18,_0x91d3('0xe'))}}})['then'](function(_0x11aefa){if(_0x11aefa&&_0x11aefa['length']){_0x159243=_[_0x91d3('0xf')](_0x11aefa||[],'id');logger[_0x91d3('0x10')](_0x91d3('0x11'),_0x159243[_0x91d3('0x12')]());return db[_0x91d3('0xa')]['update']({'closeReason':_0x91d3('0x13'),'disposition':_0x91d3('0x14'),'closed':!![],'closedAt':moment()[_0x91d3('0x15')](_0x91d3('0x16'))},{'where':{'id':_0x159243}});}})[_0x91d3('0x17')](function(){if(_0x159243&&_0x159243[_0x91d3('0x18')]){logger[_0x91d3('0x10')](_0x91d3('0x19'),_0x159243[_0x91d3('0x12')]());for(var _0x294785=0x0;_0x294785<_0x159243['length'];_0x294785++){io[_0x91d3('0x1a')](_0x91d3('0x1b'),{'id':_0x159243[_0x294785],'closed':!![]});}}})[_0x91d3('0x1c')](function(_0x593ad4){logger[_0x91d3('0x1d')](_0x91d3('0x1e'),_0x593ad4?util[_0x91d3('0x1f')](_0x593ad4,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x1505=['defaults','localhost','socket.io-emitter','WhatsappInteraction','findAll','lastMsgAt','hours','then','length','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','emit','whatsappInteraction:update','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','start','lodash','util','../../mysqldb','../logger','redis'];(function(_0x21776b,_0x4817f7){var _0x254c78=function(_0x274cfc){while(--_0x274cfc){_0x21776b['push'](_0x21776b['shift']());}};_0x254c78(++_0x4817f7);}(_0x1505,0x1cb));var _0x5150=function(_0x412d5d,_0x36e117){_0x412d5d=_0x412d5d-0x0;var _0x27a43a=_0x1505[_0x412d5d];return _0x27a43a;};'use strict';var _=require(_0x5150('0x0'));var moment=require('moment');var Redis=require('ioredis');var util=require(_0x5150('0x1'));var config=require('../../config/environment');var db=require(_0x5150('0x2'))['db'];var logger=require(_0x5150('0x3'))('schedule');config[_0x5150('0x4')]=_[_0x5150('0x5')](config['redis'],{'host':_0x5150('0x6'),'port':0x18eb});var io=require(_0x5150('0x7'))(new Redis(config['redis']));function closeInteractions(){var _0x3052fd=[];return db[_0x5150('0x8')][_0x5150('0x9')]({'raw':!![],'attributes':['id',_0x5150('0xa')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()['subtract'](0x18,_0x5150('0xb'))}}})[_0x5150('0xc')](function(_0x191871){if(_0x191871&&_0x191871[_0x5150('0xd')]){_0x3052fd=_[_0x5150('0xe')](_0x191871||[],'id');logger[_0x5150('0xf')](_0x5150('0x10'),_0x3052fd[_0x5150('0x11')]());return db[_0x5150('0x8')][_0x5150('0x12')]({'closeReason':_0x5150('0x13'),'disposition':_0x5150('0x14'),'closed':!![],'closedAt':moment()[_0x5150('0x15')](_0x5150('0x16'))},{'where':{'id':_0x3052fd}});}})['then'](function(){if(_0x3052fd&&_0x3052fd[_0x5150('0xd')]){logger[_0x5150('0xf')]('[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:',_0x3052fd[_0x5150('0x11')]());for(var _0x5b76c7=0x0;_0x5b76c7<_0x3052fd[_0x5150('0xd')];_0x5b76c7++){io[_0x5150('0x17')](_0x5150('0x18'),{'id':_0x3052fd[_0x5b76c7],'closed':!![]});}}})[_0x5150('0x19')](function(_0x38b15d){logger[_0x5150('0x1a')](_0x5150('0x1b'),_0x38b15d?util['inspect'](_0x38b15d,{'showHidden':![],'depth':null}):'');});}exports[_0x5150('0x1c')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/seedContact.js b/server/config/seedContact.js index 21b3997..336c603 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3a44=['../mysqldb','Innocenzo','Biondo','innocenzo.biondo','push','now','@xcally.com','CmContact','destroy','then','finished\x20populating','contacts1','CmHopper','bulkCreate','log','hopper1','contacts2','util'];(function(_0x1e91eb,_0x5829a3){var _0x2af75a=function(_0x1815d1){while(--_0x1815d1){_0x1e91eb['push'](_0x1e91eb['shift']());}};_0x2af75a(++_0x5829a3);}(_0x3a44,0xc5));var _0x43a4=function(_0x2eb5fc,_0x113a9f){_0x2eb5fc=_0x2eb5fc-0x0;var _0x479695=_0x3a44[_0x2eb5fc];return _0x479695;};'use strict';var util=require(_0x43a4('0x0'));var db=require(_0x43a4('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts['push']({'id':i,'firstName':_0x43a4('0x2')+i,'lastName':_0x43a4('0x3')+i,'phone':0xf879fb460+i,'email':_0x43a4('0x4')+i+'@xcally.com'});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x43a4('0x5')]({'id':i,'active':![],'scheduledat':Date[_0x43a4('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x43a4('0x6')](),'updatedAt':Date[_0x43a4('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x43a4('0x5')]({'id':i,'firstName':_0x43a4('0x2')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0x43a4('0x7')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x43a4('0x5')]({'id':i,'active':![],'scheduledat':Date[_0x43a4('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date['now']()});}db[_0x43a4('0x8')][_0x43a4('0x9')]({'where':{}})['then'](function(){return db[_0x43a4('0x8')]['bulkCreate'](contacts);})[_0x43a4('0xa')](function(){console['log'](_0x43a4('0xb'),_0x43a4('0xc'));return db['CmHopper'][_0x43a4('0x9')]({'where':{}});})[_0x43a4('0xa')](function(){return db[_0x43a4('0xd')][_0x43a4('0xe')](hopper);})['then'](function(){console[_0x43a4('0xf')](_0x43a4('0xb'),_0x43a4('0x10'));return db[_0x43a4('0x8')][_0x43a4('0xe')](contacts2);})[_0x43a4('0xa')](function(){console['log'](_0x43a4('0xb'),_0x43a4('0x11'));return db['CmHopper'][_0x43a4('0xe')](hopper2);})['then'](function(){console[_0x43a4('0xf')]('finished\x20populating','hopper2');})['catch'](function(_0x238a9f){console[_0x43a4('0xf')](_0x238a9f);}); \ No newline at end of file +var _0xc488=['../mysqldb','push','Biondo','innocenzo.biondo','@xcally.com','now','Innocenzo','then','bulkCreate','log','finished\x20populating','destroy','hopper1','CmContact','contacts2','CmHopper','hopper2','util'];(function(_0xd0c48c,_0xd55dbb){var _0x359b1e=function(_0x18b061){while(--_0x18b061){_0xd0c48c['push'](_0xd0c48c['shift']());}};_0x359b1e(++_0xd55dbb);}(_0xc488,0x7d));var _0x8c48=function(_0x29df1f,_0x13c1b8){_0x29df1f=_0x29df1f-0x0;var _0x429c6f=_0xc488[_0x29df1f];return _0x429c6f;};'use strict';var util=require(_0x8c48('0x0'));var db=require(_0x8c48('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x8c48('0x2')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0x8c48('0x3')+i,'phone':0xf879fb460+i,'email':_0x8c48('0x4')+i+_0x8c48('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x8c48('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x8c48('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x8c48('0x6')](),'updatedAt':Date[_0x8c48('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x8c48('0x2')]({'id':i,'firstName':_0x8c48('0x7')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0x8c48('0x4')+i+_0x8c48('0x5')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x8c48('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x8c48('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x8c48('0x6')](),'updatedAt':Date[_0x8c48('0x6')]()});}db['CmContact']['destroy']({'where':{}})[_0x8c48('0x8')](function(){return db['CmContact'][_0x8c48('0x9')](contacts);})[_0x8c48('0x8')](function(){console[_0x8c48('0xa')](_0x8c48('0xb'),'contacts1');return db['CmHopper'][_0x8c48('0xc')]({'where':{}});})[_0x8c48('0x8')](function(){return db['CmHopper'][_0x8c48('0x9')](hopper);})['then'](function(){console['log']('finished\x20populating',_0x8c48('0xd'));return db[_0x8c48('0xe')]['bulkCreate'](contacts2);})[_0x8c48('0x8')](function(){console[_0x8c48('0xa')](_0x8c48('0xb'),_0x8c48('0xf'));return db[_0x8c48('0x10')][_0x8c48('0x9')](hopper2);})[_0x8c48('0x8')](function(){console[_0x8c48('0xa')](_0x8c48('0xb'),_0x8c48('0x11'));})['catch'](function(_0x37e1e1){console[_0x8c48('0xa')](_0x37e1e1);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index a181a39..cbc3e35 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5936=['add\x20user','catch','../mysqldb','agent','format','%s%s','%s%s@xcally.com','password','friend','udp','wss','yes','actpass','\x22%s\x22\x20<%s>','bulkCreate','then','log'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0x5936,0xdf));var _0x6593=function(_0x32c96f,_0xb17361){_0x32c96f=_0x32c96f-0x0;var _0x4b977b=_0x5936[_0x32c96f];return _0x4b977b;};'use strict';var util=require('util');var db=require(_0x6593('0x0'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users['push']({'name':util['format']('%s%s',_0x6593('0x1'),i),'fullname':util[_0x6593('0x2')](_0x6593('0x3'),_0x6593('0x1'),i),'email':util[_0x6593('0x2')](_0x6593('0x4'),_0x6593('0x1'),i),'role':_0x6593('0x1'),'password':_0x6593('0x5'),'internal':0xfa0+i,'type':_0x6593('0x6'),'transport':[_0x6593('0x7'),'ws',_0x6593('0x8')],'disallow':['all'],'allow':['ulaw'],'defaultuser':util[_0x6593('0x2')](_0x6593('0x3'),_0x6593('0x1'),i),'encryption':_0x6593('0x9'),'avpf':_0x6593('0x9'),'force_avp':_0x6593('0x9'),'icesupport':_0x6593('0x9'),'dtlsenable':_0x6593('0x9'),'dtlsverify':'no','dtlscertfile':'/etc/pki/tls/certs/motion.crt','dtlsprivatekey':'/etc/pki/tls/private/motion.key','dtlssetup':_0x6593('0xa'),'callerid':util[_0x6593('0x2')](_0x6593('0xb'),util[_0x6593('0x2')](_0x6593('0x3'),_0x6593('0x1'),i),0xfa0+i)});}db['User'][_0x6593('0xc')](users)[_0x6593('0xd')](function(){console[_0x6593('0xe')](_0x6593('0xf'));})[_0x6593('0x10')](function(_0x25b0e3){console['log'](_0x25b0e3);}); \ No newline at end of file +var _0xc53f=['yes','actpass','\x22%s\x22\x20<%s>','then','log','catch','util','../mysqldb','format','agent','%s%s@xcally.com','password','friend','udp','wss','all','ulaw','%s%s'];(function(_0x5c9f56,_0x42c9ad){var _0x2a726b=function(_0x4a13cd){while(--_0x4a13cd){_0x5c9f56['push'](_0x5c9f56['shift']());}};_0x2a726b(++_0x42c9ad);}(_0xc53f,0x15c));var _0xfc53=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xc53f[_0x484e36];return _0xafc85d;};'use strict';var util=require(_0xfc53('0x0'));var db=require(_0xfc53('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users['push']({'name':util[_0xfc53('0x2')]('%s%s',_0xfc53('0x3'),i),'fullname':util[_0xfc53('0x2')]('%s%s','agent',i),'email':util['format'](_0xfc53('0x4'),'agent',i),'role':_0xfc53('0x3'),'password':_0xfc53('0x5'),'internal':0xfa0+i,'type':_0xfc53('0x6'),'transport':[_0xfc53('0x7'),'ws',_0xfc53('0x8')],'disallow':[_0xfc53('0x9')],'allow':[_0xfc53('0xa')],'defaultuser':util['format'](_0xfc53('0xb'),_0xfc53('0x3'),i),'encryption':_0xfc53('0xc'),'avpf':_0xfc53('0xc'),'force_avp':_0xfc53('0xc'),'icesupport':_0xfc53('0xc'),'dtlsenable':_0xfc53('0xc'),'dtlsverify':'no','dtlscertfile':'/etc/pki/tls/certs/motion.crt','dtlsprivatekey':'/etc/pki/tls/private/motion.key','dtlssetup':_0xfc53('0xd'),'callerid':util['format'](_0xfc53('0xe'),util[_0xfc53('0x2')](_0xfc53('0xb'),_0xfc53('0x3'),i),0xfa0+i)});}db['User']['bulkCreate'](users)[_0xfc53('0xf')](function(){console[_0xfc53('0x10')]('add\x20user');})[_0xfc53('0x11')](function(_0x20b99a){console['log'](_0x20b99a);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 4c1019f..4aa7443 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8101=['telephone','agent','type','ivr','UserProfileSection','findOne','then','autoAssociation','VoiceQueues','FaxQueues','OpenchannelQueues','WhatsappQueues','findAll','Telephones','Trunks','IvrCampaigns','resourceId','map','where','role','format','%s:queue:%s','length','user:%s','handshake','find','userProfileId','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','voice:inbound','voice:outbound','hasOwnProperty','include','push','ChatQueue','SmsQueue','MailQueue','OpenchannelQueue','WhatsappQueue','Trunk','Campaign','VoiceQueue','SmsQueues','MailQueues','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','voice','chat','fax','sms','mail','telephone:%s','trunk:%s','campaign:%s:%s','leave','removeChatInteractions','user_has_chat_interactions:remove','removeMailInteractions','emit','user_has_mail_interactions:remove','FaxInteractions','removeFaxInteractions','user_has_fax_interactions:remove','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','join','default','connection','address','request','remoteAddress','remotePort','connectedAt','SocketIO\x20','nsp','DISCONNECTED','CONNECTED','lodash','util','bluebird','../mysqldb','./environment','name','Agents','User'];(function(_0x4d180c,_0x45c68e){var _0x49b57e=function(_0x264741){while(--_0x264741){_0x4d180c['push'](_0x4d180c['shift']());}};_0x49b57e(++_0x45c68e);}(_0x8101,0xc0));var _0x1810=function(_0x2055a7,_0x415a4c){_0x2055a7=_0x2055a7-0x0;var _0x42a14d=_0x8101[_0x2055a7];return _0x42a14d;};'use strict';var _=require(_0x1810('0x0'));var util=require(_0x1810('0x1'));var BPromise=require(_0x1810('0x2'));var db=require(_0x1810('0x3'))['db'];var config=require(_0x1810('0x4'));var queryQueues={'attributes':['id',_0x1810('0x5')],'include':[{'as':_0x1810('0x6'),'model':db[_0x1810('0x7')],'attributes':['id',_0x1810('0x5'),'role'],'raw':!![],'where':{'role':'agent'},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x1810('0x5')],'where':{'role':_0x1810('0x8')}};var queryTrunks={'raw':!![],'attributes':['id','name']};var queryAgents={'raw':!![],'attributes':['id',_0x1810('0x5')],'where':{'role':_0x1810('0x9')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x1810('0x5'),_0x1810('0xa')],'where':{'type':_0x1810('0xb')}};function getAssociatedResources(_0x271738,_0x197255,_0x2dde85){return db[_0x1810('0xc')][_0x1810('0xd')]({'where':{'name':_0x271738,'userProfileId':_0x197255},'raw':!![]})[_0x1810('0xe')](function(_0x5126d2){if(_0x5126d2){if(_0x5126d2[_0x1810('0xf')]){switch(_0x271738){case _0x1810('0x10'):case'ChatQueues':case _0x1810('0x11'):case'SmsQueues':case'MailQueues':case _0x1810('0x12'):case _0x1810('0x13'):return db[_0x2dde85][_0x1810('0x14')](queryQueues);case _0x1810('0x15'):return db[_0x2dde85][_0x1810('0x14')](queryTelephones);case _0x1810('0x16'):return db[_0x2dde85]['findAll'](queryTrunks);case _0x1810('0x17'):return db[_0x2dde85][_0x1810('0x14')](queryCampaigns);}}else{return db['UserProfileResource']['findAll']({'attributes':[_0x1810('0x18')],'where':{'sectionId':_0x5126d2['id']},'raw':!![]})['then'](function(_0x187dca){if(_0x187dca){var _0xbdebf5={'where':{'id':_[_0x1810('0x19')](_0x187dca,_0x1810('0x18'))},'raw':!![]};switch(_0x2dde85){case _0x1810('0x7'):_0xbdebf5[_0x1810('0x1a')][_0x1810('0x1b')]='telephone';break;case'Campaign':_0xbdebf5['where'][_0x1810('0xa')]='ivr';break;}return db[_0x2dde85][_0x1810('0x14')](_0xbdebf5);}else{return[];}});}}else{return[];}})[_0x1810('0xe')](function(_0x3876b0){return _0x3876b0;});}function joinOrLeaveQueues(_0x27c51b,_0x57477e,_0x1490c3,_0x5c8c36){_0x27c51b[_0x57477e](util[_0x1810('0x1c')](_0x1810('0x1d'),_0x1490c3,_0x5c8c36['name']));if(_0x5c8c36[_0x1810('0x6')]){for(var _0x42672f=0x0;_0x42672f<_0x5c8c36[_0x1810('0x6')][_0x1810('0x1e')];_0x42672f+=0x1){_0x27c51b[_0x57477e](util[_0x1810('0x1c')](_0x1810('0x1f'),_0x5c8c36['Agents'][_0x42672f][_0x1810('0x5')]));}}}function joinOrLeave(_0x198bbc,_0x254062,_0x77b5ed){var _0x53ca63;if(_0x198bbc[_0x1810('0x20')]['query']['id']){db['User'][_0x1810('0x21')]({'attributes':['id',_0x1810('0x5'),_0x1810('0x1b'),_0x1810('0x22')],'where':{'id':_0x198bbc[_0x1810('0x20')]['query']['id']},'include':[{'model':db[_0x1810('0x23')],'as':_0x1810('0x24'),'attributes':['id'],'raw':!![]},{'model':db[_0x1810('0x25')],'as':_0x1810('0x26'),'attributes':['id'],'raw':!![]},{'model':db['FaxInteraction'],'as':'FaxInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x1810('0x27')],'as':_0x1810('0x28'),'attributes':['id'],'raw':!![]},{'model':db[_0x1810('0x29')],'as':_0x1810('0x2a'),'attributes':['id'],'raw':!![]},{'model':db[_0x1810('0x2b')],'as':_0x1810('0x2c'),'attributes':['id'],'raw':!![]}]})[_0x1810('0xe')](function(_0x3e122b){if(_0x3e122b){_0x53ca63=_0x3e122b;_0x198bbc[_0x254062](util[_0x1810('0x1c')](_0x1810('0x1f'),_0x3e122b[_0x1810('0x5')]));var _0x223638=[];switch(_0x3e122b[_0x1810('0x1b')]){case'admin':_0x198bbc[_0x254062](_0x1810('0x2d'));_0x198bbc[_0x254062](_0x1810('0x2e'));if(queryQueues[_0x1810('0x2f')](_0x1810('0x30'))){delete queryQueues[_0x1810('0x30')];}_0x223638[_0x1810('0x31')](db['VoiceQueue'][_0x1810('0x14')](queryQueues));_0x223638[_0x1810('0x31')](db[_0x1810('0x32')][_0x1810('0x14')](queryQueues));_0x223638[_0x1810('0x31')](db['FaxQueue'][_0x1810('0x14')](queryQueues));_0x223638[_0x1810('0x31')](db[_0x1810('0x33')]['findAll'](queryQueues));_0x223638[_0x1810('0x31')](db[_0x1810('0x34')][_0x1810('0x14')](queryQueues));_0x223638[_0x1810('0x31')](db[_0x1810('0x35')][_0x1810('0x14')](queryQueues));_0x223638[_0x1810('0x31')](db[_0x1810('0x36')][_0x1810('0x14')](queryQueues));_0x223638[_0x1810('0x31')](db[_0x1810('0x7')][_0x1810('0x14')](queryTelephones));_0x223638[_0x1810('0x31')](db[_0x1810('0x37')][_0x1810('0x14')](queryTrunks));_0x223638['push'](db[_0x1810('0x38')]['findAll'](queryCampaigns));_0x223638['push'](db[_0x1810('0x7')][_0x1810('0x14')](queryAgents));break;case'user':_0x198bbc[_0x254062](_0x1810('0x2d'));_0x198bbc[_0x254062](_0x1810('0x2e'));_0x223638[_0x1810('0x31')](getAssociatedResources(_0x1810('0x10'),_0x3e122b[_0x1810('0x22')],_0x1810('0x39')));_0x223638[_0x1810('0x31')](getAssociatedResources('ChatQueues',_0x3e122b[_0x1810('0x22')],_0x1810('0x32')));_0x223638['push'](getAssociatedResources('FaxQueues',_0x3e122b[_0x1810('0x22')],'FaxQueue'));_0x223638[_0x1810('0x31')](getAssociatedResources(_0x1810('0x3a'),_0x3e122b[_0x1810('0x22')],_0x1810('0x33')));_0x223638[_0x1810('0x31')](getAssociatedResources(_0x1810('0x3b'),_0x3e122b[_0x1810('0x22')],_0x1810('0x34')));_0x223638[_0x1810('0x31')](getAssociatedResources('OpenchannelQueues',_0x3e122b[_0x1810('0x22')],'OpenchannelQueue'));_0x223638[_0x1810('0x31')](getAssociatedResources(_0x1810('0x13'),_0x3e122b[_0x1810('0x22')],_0x1810('0x36')));_0x223638[_0x1810('0x31')](getAssociatedResources(_0x1810('0x15'),_0x3e122b[_0x1810('0x22')],_0x1810('0x7')));_0x223638[_0x1810('0x31')](getAssociatedResources(_0x1810('0x16'),_0x3e122b['userProfileId'],_0x1810('0x37')));_0x223638[_0x1810('0x31')](getAssociatedResources(_0x1810('0x17'),_0x3e122b['userProfileId'],_0x1810('0x38')));_0x223638[_0x1810('0x31')](db[_0x1810('0x7')][_0x1810('0x14')](queryAgents));break;case _0x1810('0x9'):_0x198bbc[_0x254062](_0x1810('0x2d'));_0x198bbc[_0x254062]('voice:outbound');_0x223638[_0x1810('0x31')](_0x3e122b[_0x1810('0x3c')]({'attributes':['id',_0x1810('0x5')]}));_0x223638[_0x1810('0x31')](_0x3e122b[_0x1810('0x3d')]({'attributes':['id','name']}));_0x223638[_0x1810('0x31')](_0x3e122b[_0x1810('0x3e')]({'attributes':['id',_0x1810('0x5')]}));_0x223638[_0x1810('0x31')](_0x3e122b[_0x1810('0x3f')]({'attributes':['id',_0x1810('0x5')]}));_0x223638[_0x1810('0x31')](_0x3e122b[_0x1810('0x40')]({'attributes':['id',_0x1810('0x5')]}));_0x223638[_0x1810('0x31')](_0x3e122b[_0x1810('0x41')]({'attributes':['id','name']}));_0x223638[_0x1810('0x31')](_0x3e122b['getWhatsappQueues']({'attributes':['id',_0x1810('0x5')]}));break;}return BPromise['all'](_0x223638);}})[_0x1810('0xe')](function(_0x18b946){if(_0x18b946&&_0x18b946[_0x1810('0x1e')]){for(var _0x2f3c21=0x0;_0x2f3c21<_0x18b946[_0x1810('0x1e')];_0x2f3c21+=0x1){for(var _0x9446e9=0x0;_0x9446e9<_0x18b946[_0x2f3c21][_0x1810('0x1e')];_0x9446e9+=0x1){switch(_0x2f3c21){case 0x0:joinOrLeaveQueues(_0x198bbc,_0x254062,_0x1810('0x42'),_0x18b946[_0x2f3c21][_0x9446e9]);break;case 0x1:joinOrLeaveQueues(_0x198bbc,_0x254062,_0x1810('0x43'),_0x18b946[_0x2f3c21][_0x9446e9]);break;case 0x2:joinOrLeaveQueues(_0x198bbc,_0x254062,_0x1810('0x44'),_0x18b946[_0x2f3c21][_0x9446e9]);break;case 0x3:joinOrLeaveQueues(_0x198bbc,_0x254062,_0x1810('0x45'),_0x18b946[_0x2f3c21][_0x9446e9]);break;case 0x4:joinOrLeaveQueues(_0x198bbc,_0x254062,_0x1810('0x46'),_0x18b946[_0x2f3c21][_0x9446e9]);break;case 0x5:joinOrLeaveQueues(_0x198bbc,_0x254062,'openchannel',_0x18b946[_0x2f3c21][_0x9446e9]);break;case 0x6:joinOrLeaveQueues(_0x198bbc,_0x254062,'whatsapp',_0x18b946[_0x2f3c21][_0x9446e9]);break;case 0x7:if(_0x53ca63[_0x1810('0x1b')]!=='agent')_0x198bbc[_0x254062](util[_0x1810('0x1c')](_0x1810('0x47'),_0x18b946[_0x2f3c21][_0x9446e9]['name']));break;case 0x8:if(_0x53ca63['role']!==_0x1810('0x9'))_0x198bbc[_0x254062](util[_0x1810('0x1c')](_0x1810('0x48'),_0x18b946[_0x2f3c21][_0x9446e9][_0x1810('0x5')]));break;case 0x9:if(_0x53ca63[_0x1810('0x1b')]!=='agent')_0x198bbc[_0x254062](util[_0x1810('0x1c')](_0x1810('0x49'),_0x18b946[_0x2f3c21][_0x9446e9][_0x1810('0xa')],_0x18b946[_0x2f3c21][_0x9446e9][_0x1810('0x5')]));break;case 0xa:_0x198bbc[_0x254062](util[_0x1810('0x1c')](_0x1810('0x1f'),_0x18b946[_0x2f3c21][_0x9446e9][_0x1810('0x5')]));break;}}}}})[_0x1810('0xe')](function(){if(_0x254062===_0x1810('0x4a')){var _0x3eff89=_[_0x1810('0x19')](_0x53ca63['ChatInteractions'],'id');return _0x53ca63[_0x1810('0x4b')](_0x3eff89)[_0x1810('0xe')](function(){for(var _0x236aaa=0x0;_0x236aaa<_0x3eff89[_0x1810('0x1e')];_0x236aaa+=0x1){_0x77b5ed['emit'](_0x1810('0x4c'),{'ChatInteractionId':Number(_0x3eff89[_0x236aaa]),'UserId':Number(_0x53ca63['id'])});}});}})[_0x1810('0xe')](function(){if(_0x254062==='leave'){var _0x8b722e=_['map'](_0x53ca63['MailInteractions'],'id');return _0x53ca63[_0x1810('0x4d')](_0x8b722e)['then'](function(){for(var _0x4207c4=0x0;_0x4207c4<_0x8b722e[_0x1810('0x1e')];_0x4207c4+=0x1){_0x77b5ed[_0x1810('0x4e')](_0x1810('0x4f'),{'MailInteractionId':Number(_0x8b722e[_0x4207c4]),'UserId':Number(_0x53ca63['id'])});}});}})[_0x1810('0xe')](function(){if(_0x254062===_0x1810('0x4a')){var _0x20eba4=_[_0x1810('0x19')](_0x53ca63[_0x1810('0x50')],'id');return _0x53ca63[_0x1810('0x51')](_0x20eba4)[_0x1810('0xe')](function(){for(var _0x4a71a8=0x0;_0x4a71a8<_0x20eba4['length'];_0x4a71a8+=0x1){_0x77b5ed['emit'](_0x1810('0x52'),{'FaxInteractionId':Number(_0x20eba4[_0x4a71a8]),'UserId':Number(_0x53ca63['id'])});}});}})[_0x1810('0xe')](function(){if(_0x254062===_0x1810('0x4a')){var _0x53bec7=_[_0x1810('0x19')](_0x53ca63[_0x1810('0x28')],'id');return _0x53ca63['removeSmsInteractions'](_0x53bec7)[_0x1810('0xe')](function(){for(var _0x2a9cd0=0x0;_0x2a9cd0<_0x53bec7[_0x1810('0x1e')];_0x2a9cd0+=0x1){_0x77b5ed['emit']('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0x53bec7[_0x2a9cd0]),'UserId':Number(_0x53ca63['id'])});}});}})[_0x1810('0xe')](function(){if(_0x254062===_0x1810('0x4a')){var _0x4590c7=_[_0x1810('0x19')](_0x53ca63[_0x1810('0x2a')],'id');return _0x53ca63['removeOpenchannelInteractions'](_0x4590c7)[_0x1810('0xe')](function(){for(var _0x528355=0x0;_0x528355<_0x4590c7[_0x1810('0x1e')];_0x528355+=0x1){_0x77b5ed['emit'](_0x1810('0x53'),{'OpenchannelInteractionId':Number(_0x4590c7[_0x528355]),'UserId':Number(_0x53ca63['id'])});}});}})[_0x1810('0xe')](function(){if(_0x254062==='leave'){var _0xd81b16=_['map'](_0x53ca63[_0x1810('0x2c')],'id');return _0x53ca63[_0x1810('0x54')](_0xd81b16)[_0x1810('0xe')](function(){for(var _0x4638d2=0x0;_0x4638d2<_0xd81b16[_0x1810('0x1e')];_0x4638d2+=0x1){_0x77b5ed['emit'](_0x1810('0x55'),{'WhatsappInteractionId':Number(_0xd81b16[_0x4638d2]),'UserId':Number(_0x53ca63['id'])});}});}})[_0x1810('0x56')](function(_0x5a5798){_0x198bbc[_0x1810('0x57')](_0x5a5798);});}}function onDisconnect(_0x5e8b6f,_0x59f35c){joinOrLeave(_0x5e8b6f,_0x1810('0x4a'),_0x59f35c);}function onConnect(_0x116287){joinOrLeave(_0x116287,_0x1810('0x58'));}exports[_0x1810('0x59')]=function(_0x4dfae2){_0x4dfae2['on'](_0x1810('0x5a'),function(_0xb99fa0){_0xb99fa0['setMaxListeners'](0x0);_0xb99fa0[_0x1810('0x5b')]=_0xb99fa0[_0x1810('0x5c')][_0x1810('0x5a')][_0x1810('0x5d')]+':'+_0xb99fa0[_0x1810('0x5c')][_0x1810('0x5a')][_0x1810('0x5e')];_0xb99fa0[_0x1810('0x5f')]=new Date();_0xb99fa0[_0x1810('0x57')]=function(_0x41eaef){console[_0x1810('0x57')](_0x1810('0x60')+_0xb99fa0[_0x1810('0x61')][_0x1810('0x5')]+'['+_0xb99fa0[_0x1810('0x5b')]+']',_0x41eaef);};_0xb99fa0['on']('disconnect',function(){onDisconnect(_0xb99fa0,_0x4dfae2);_0xb99fa0[_0x1810('0x57')](_0x1810('0x62'));});onConnect(_0xb99fa0);_0xb99fa0[_0x1810('0x57')](_0x1810('0x63'));});}; \ No newline at end of file +var _0x3e2a=['OpenchannelQueues','findAll','Telephones','Trunks','resourceId','then','map','role','Campaign','where','type','format','%s:queue:%s','length','user:%s','handshake','userProfileId','ChatInteraction','ChatInteractions','MailInteraction','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','voice:inbound','voice:outbound','include','VoiceQueue','push','ChatQueue','FaxQueue','SmsQueue','MailQueue','WhatsappQueue','Trunk','FaxQueues','OpenchannelQueue','IvrCampaigns','getVoiceQueues','getChatQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','all','voice','fax','sms','openchannel','whatsapp','trunk:%s','campaign:%s:%s','removeChatInteractions','emit','user_has_chat_interactions:remove','leave','MailInteractions','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','log','join','default','connection','setMaxListeners','address','remoteAddress','request','disconnect','DISCONNECTED','lodash','util','bluebird','../mysqldb','./environment','name','Agents','User','agent','telephone','ivr','UserProfileSection','autoAssociation','VoiceQueues','ChatQueues','SmsQueues','MailQueues'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x3e2a,0x10c));var _0xa3e2=function(_0x4ce19b,_0xbba834){_0x4ce19b=_0x4ce19b-0x0;var _0x617495=_0x3e2a[_0x4ce19b];return _0x617495;};'use strict';var _=require(_0xa3e2('0x0'));var util=require(_0xa3e2('0x1'));var BPromise=require(_0xa3e2('0x2'));var db=require(_0xa3e2('0x3'))['db'];var config=require(_0xa3e2('0x4'));var queryQueues={'attributes':['id',_0xa3e2('0x5')],'include':[{'as':_0xa3e2('0x6'),'model':db[_0xa3e2('0x7')],'attributes':['id',_0xa3e2('0x5'),'role'],'raw':!![],'where':{'role':_0xa3e2('0x8')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id','name'],'where':{'role':_0xa3e2('0x9')}};var queryTrunks={'raw':!![],'attributes':['id',_0xa3e2('0x5')]};var queryAgents={'raw':!![],'attributes':['id',_0xa3e2('0x5')],'where':{'role':_0xa3e2('0x8')}};var queryCampaigns={'raw':!![],'attributes':['id',_0xa3e2('0x5'),'type'],'where':{'type':_0xa3e2('0xa')}};function getAssociatedResources(_0x16ffa6,_0x4b00fa,_0x3b5326){return db[_0xa3e2('0xb')]['findOne']({'where':{'name':_0x16ffa6,'userProfileId':_0x4b00fa},'raw':!![]})['then'](function(_0x4cb0f0){if(_0x4cb0f0){if(_0x4cb0f0[_0xa3e2('0xc')]){switch(_0x16ffa6){case _0xa3e2('0xd'):case _0xa3e2('0xe'):case'FaxQueues':case _0xa3e2('0xf'):case _0xa3e2('0x10'):case _0xa3e2('0x11'):case'WhatsappQueues':return db[_0x3b5326][_0xa3e2('0x12')](queryQueues);case _0xa3e2('0x13'):return db[_0x3b5326]['findAll'](queryTelephones);case _0xa3e2('0x14'):return db[_0x3b5326][_0xa3e2('0x12')](queryTrunks);case'IvrCampaigns':return db[_0x3b5326][_0xa3e2('0x12')](queryCampaigns);}}else{return db['UserProfileResource']['findAll']({'attributes':[_0xa3e2('0x15')],'where':{'sectionId':_0x4cb0f0['id']},'raw':!![]})[_0xa3e2('0x16')](function(_0x3f2319){if(_0x3f2319){var _0x4d1c19={'where':{'id':_[_0xa3e2('0x17')](_0x3f2319,'resourceId')},'raw':!![]};switch(_0x3b5326){case _0xa3e2('0x7'):_0x4d1c19['where'][_0xa3e2('0x18')]=_0xa3e2('0x9');break;case _0xa3e2('0x19'):_0x4d1c19[_0xa3e2('0x1a')][_0xa3e2('0x1b')]=_0xa3e2('0xa');break;}return db[_0x3b5326]['findAll'](_0x4d1c19);}else{return[];}});}}else{return[];}})[_0xa3e2('0x16')](function(_0xd6151a){return _0xd6151a;});}function joinOrLeaveQueues(_0x7471c1,_0x41373c,_0x478582,_0x288757){_0x7471c1[_0x41373c](util[_0xa3e2('0x1c')](_0xa3e2('0x1d'),_0x478582,_0x288757[_0xa3e2('0x5')]));if(_0x288757['Agents']){for(var _0x3d8540=0x0;_0x3d8540<_0x288757['Agents'][_0xa3e2('0x1e')];_0x3d8540+=0x1){_0x7471c1[_0x41373c](util[_0xa3e2('0x1c')](_0xa3e2('0x1f'),_0x288757['Agents'][_0x3d8540][_0xa3e2('0x5')]));}}}function joinOrLeave(_0x21dcef,_0x5d63c4,_0x29559c){var _0x416730;if(_0x21dcef[_0xa3e2('0x20')]['query']['id']){db['User']['find']({'attributes':['id',_0xa3e2('0x5'),_0xa3e2('0x18'),_0xa3e2('0x21')],'where':{'id':_0x21dcef['handshake']['query']['id']},'include':[{'model':db[_0xa3e2('0x22')],'as':_0xa3e2('0x23'),'attributes':['id'],'raw':!![]},{'model':db[_0xa3e2('0x24')],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db['FaxInteraction'],'as':'FaxInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xa3e2('0x25')],'as':_0xa3e2('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0xa3e2('0x27')],'as':_0xa3e2('0x28'),'attributes':['id'],'raw':!![]},{'model':db[_0xa3e2('0x29')],'as':_0xa3e2('0x2a'),'attributes':['id'],'raw':!![]}]})[_0xa3e2('0x16')](function(_0x2d6d88){if(_0x2d6d88){_0x416730=_0x2d6d88;_0x21dcef[_0x5d63c4](util[_0xa3e2('0x1c')](_0xa3e2('0x1f'),_0x2d6d88[_0xa3e2('0x5')]));var _0x5b63a9=[];switch(_0x2d6d88[_0xa3e2('0x18')]){case'admin':_0x21dcef[_0x5d63c4](_0xa3e2('0x2b'));_0x21dcef[_0x5d63c4](_0xa3e2('0x2c'));if(queryQueues['hasOwnProperty'](_0xa3e2('0x2d'))){delete queryQueues[_0xa3e2('0x2d')];}_0x5b63a9['push'](db[_0xa3e2('0x2e')][_0xa3e2('0x12')](queryQueues));_0x5b63a9[_0xa3e2('0x2f')](db[_0xa3e2('0x30')][_0xa3e2('0x12')](queryQueues));_0x5b63a9[_0xa3e2('0x2f')](db[_0xa3e2('0x31')][_0xa3e2('0x12')](queryQueues));_0x5b63a9['push'](db[_0xa3e2('0x32')][_0xa3e2('0x12')](queryQueues));_0x5b63a9[_0xa3e2('0x2f')](db[_0xa3e2('0x33')][_0xa3e2('0x12')](queryQueues));_0x5b63a9['push'](db['OpenchannelQueue'][_0xa3e2('0x12')](queryQueues));_0x5b63a9[_0xa3e2('0x2f')](db[_0xa3e2('0x34')]['findAll'](queryQueues));_0x5b63a9[_0xa3e2('0x2f')](db[_0xa3e2('0x7')][_0xa3e2('0x12')](queryTelephones));_0x5b63a9['push'](db[_0xa3e2('0x35')]['findAll'](queryTrunks));_0x5b63a9['push'](db[_0xa3e2('0x19')]['findAll'](queryCampaigns));_0x5b63a9['push'](db[_0xa3e2('0x7')][_0xa3e2('0x12')](queryAgents));break;case'user':_0x21dcef[_0x5d63c4](_0xa3e2('0x2b'));_0x21dcef[_0x5d63c4]('voice:outbound');_0x5b63a9[_0xa3e2('0x2f')](getAssociatedResources(_0xa3e2('0xd'),_0x2d6d88[_0xa3e2('0x21')],_0xa3e2('0x2e')));_0x5b63a9[_0xa3e2('0x2f')](getAssociatedResources(_0xa3e2('0xe'),_0x2d6d88[_0xa3e2('0x21')],_0xa3e2('0x30')));_0x5b63a9[_0xa3e2('0x2f')](getAssociatedResources(_0xa3e2('0x36'),_0x2d6d88['userProfileId'],'FaxQueue'));_0x5b63a9[_0xa3e2('0x2f')](getAssociatedResources(_0xa3e2('0xf'),_0x2d6d88['userProfileId'],'SmsQueue'));_0x5b63a9[_0xa3e2('0x2f')](getAssociatedResources(_0xa3e2('0x10'),_0x2d6d88[_0xa3e2('0x21')],_0xa3e2('0x33')));_0x5b63a9[_0xa3e2('0x2f')](getAssociatedResources(_0xa3e2('0x11'),_0x2d6d88['userProfileId'],_0xa3e2('0x37')));_0x5b63a9[_0xa3e2('0x2f')](getAssociatedResources('WhatsappQueues',_0x2d6d88[_0xa3e2('0x21')],'WhatsappQueue'));_0x5b63a9[_0xa3e2('0x2f')](getAssociatedResources(_0xa3e2('0x13'),_0x2d6d88[_0xa3e2('0x21')],_0xa3e2('0x7')));_0x5b63a9['push'](getAssociatedResources(_0xa3e2('0x14'),_0x2d6d88[_0xa3e2('0x21')],_0xa3e2('0x35')));_0x5b63a9[_0xa3e2('0x2f')](getAssociatedResources(_0xa3e2('0x38'),_0x2d6d88['userProfileId'],_0xa3e2('0x19')));_0x5b63a9[_0xa3e2('0x2f')](db[_0xa3e2('0x7')]['findAll'](queryAgents));break;case _0xa3e2('0x8'):_0x21dcef[_0x5d63c4](_0xa3e2('0x2b'));_0x21dcef[_0x5d63c4](_0xa3e2('0x2c'));_0x5b63a9[_0xa3e2('0x2f')](_0x2d6d88[_0xa3e2('0x39')]({'attributes':['id','name']}));_0x5b63a9[_0xa3e2('0x2f')](_0x2d6d88[_0xa3e2('0x3a')]({'attributes':['id',_0xa3e2('0x5')]}));_0x5b63a9['push'](_0x2d6d88['getFaxQueues']({'attributes':['id',_0xa3e2('0x5')]}));_0x5b63a9[_0xa3e2('0x2f')](_0x2d6d88['getSmsQueues']({'attributes':['id',_0xa3e2('0x5')]}));_0x5b63a9[_0xa3e2('0x2f')](_0x2d6d88[_0xa3e2('0x3b')]({'attributes':['id',_0xa3e2('0x5')]}));_0x5b63a9[_0xa3e2('0x2f')](_0x2d6d88[_0xa3e2('0x3c')]({'attributes':['id',_0xa3e2('0x5')]}));_0x5b63a9[_0xa3e2('0x2f')](_0x2d6d88[_0xa3e2('0x3d')]({'attributes':['id',_0xa3e2('0x5')]}));break;}return BPromise[_0xa3e2('0x3e')](_0x5b63a9);}})[_0xa3e2('0x16')](function(_0x1c98c0){if(_0x1c98c0&&_0x1c98c0[_0xa3e2('0x1e')]){for(var _0x19e40b=0x0;_0x19e40b<_0x1c98c0[_0xa3e2('0x1e')];_0x19e40b+=0x1){for(var _0x5277ac=0x0;_0x5277ac<_0x1c98c0[_0x19e40b]['length'];_0x5277ac+=0x1){switch(_0x19e40b){case 0x0:joinOrLeaveQueues(_0x21dcef,_0x5d63c4,_0xa3e2('0x3f'),_0x1c98c0[_0x19e40b][_0x5277ac]);break;case 0x1:joinOrLeaveQueues(_0x21dcef,_0x5d63c4,'chat',_0x1c98c0[_0x19e40b][_0x5277ac]);break;case 0x2:joinOrLeaveQueues(_0x21dcef,_0x5d63c4,_0xa3e2('0x40'),_0x1c98c0[_0x19e40b][_0x5277ac]);break;case 0x3:joinOrLeaveQueues(_0x21dcef,_0x5d63c4,_0xa3e2('0x41'),_0x1c98c0[_0x19e40b][_0x5277ac]);break;case 0x4:joinOrLeaveQueues(_0x21dcef,_0x5d63c4,'mail',_0x1c98c0[_0x19e40b][_0x5277ac]);break;case 0x5:joinOrLeaveQueues(_0x21dcef,_0x5d63c4,_0xa3e2('0x42'),_0x1c98c0[_0x19e40b][_0x5277ac]);break;case 0x6:joinOrLeaveQueues(_0x21dcef,_0x5d63c4,_0xa3e2('0x43'),_0x1c98c0[_0x19e40b][_0x5277ac]);break;case 0x7:if(_0x416730[_0xa3e2('0x18')]!=='agent')_0x21dcef[_0x5d63c4](util[_0xa3e2('0x1c')]('telephone:%s',_0x1c98c0[_0x19e40b][_0x5277ac][_0xa3e2('0x5')]));break;case 0x8:if(_0x416730[_0xa3e2('0x18')]!==_0xa3e2('0x8'))_0x21dcef[_0x5d63c4](util['format'](_0xa3e2('0x44'),_0x1c98c0[_0x19e40b][_0x5277ac][_0xa3e2('0x5')]));break;case 0x9:if(_0x416730['role']!=='agent')_0x21dcef[_0x5d63c4](util[_0xa3e2('0x1c')](_0xa3e2('0x45'),_0x1c98c0[_0x19e40b][_0x5277ac][_0xa3e2('0x1b')],_0x1c98c0[_0x19e40b][_0x5277ac][_0xa3e2('0x5')]));break;case 0xa:_0x21dcef[_0x5d63c4](util[_0xa3e2('0x1c')](_0xa3e2('0x1f'),_0x1c98c0[_0x19e40b][_0x5277ac]['name']));break;}}}}})[_0xa3e2('0x16')](function(){if(_0x5d63c4==='leave'){var _0x48aff7=_['map'](_0x416730[_0xa3e2('0x23')],'id');return _0x416730[_0xa3e2('0x46')](_0x48aff7)[_0xa3e2('0x16')](function(){for(var _0x5bf3bb=0x0;_0x5bf3bb<_0x48aff7[_0xa3e2('0x1e')];_0x5bf3bb+=0x1){_0x29559c[_0xa3e2('0x47')](_0xa3e2('0x48'),{'ChatInteractionId':Number(_0x48aff7[_0x5bf3bb]),'UserId':Number(_0x416730['id'])});}});}})[_0xa3e2('0x16')](function(){if(_0x5d63c4===_0xa3e2('0x49')){var _0xc31bdd=_[_0xa3e2('0x17')](_0x416730[_0xa3e2('0x4a')],'id');return _0x416730[_0xa3e2('0x4b')](_0xc31bdd)[_0xa3e2('0x16')](function(){for(var _0x1a61d0=0x0;_0x1a61d0<_0xc31bdd[_0xa3e2('0x1e')];_0x1a61d0+=0x1){_0x29559c['emit'](_0xa3e2('0x4c'),{'MailInteractionId':Number(_0xc31bdd[_0x1a61d0]),'UserId':Number(_0x416730['id'])});}});}})[_0xa3e2('0x16')](function(){if(_0x5d63c4===_0xa3e2('0x49')){var _0x3060b5=_['map'](_0x416730[_0xa3e2('0x4d')],'id');return _0x416730['removeFaxInteractions'](_0x3060b5)['then'](function(){for(var _0x1b08b9=0x0;_0x1b08b9<_0x3060b5[_0xa3e2('0x1e')];_0x1b08b9+=0x1){_0x29559c[_0xa3e2('0x47')](_0xa3e2('0x4e'),{'FaxInteractionId':Number(_0x3060b5[_0x1b08b9]),'UserId':Number(_0x416730['id'])});}});}})[_0xa3e2('0x16')](function(){if(_0x5d63c4==='leave'){var _0x341adb=_[_0xa3e2('0x17')](_0x416730[_0xa3e2('0x26')],'id');return _0x416730[_0xa3e2('0x4f')](_0x341adb)[_0xa3e2('0x16')](function(){for(var _0x4d076f=0x0;_0x4d076f<_0x341adb[_0xa3e2('0x1e')];_0x4d076f+=0x1){_0x29559c[_0xa3e2('0x47')](_0xa3e2('0x50'),{'SmsInteractionId':Number(_0x341adb[_0x4d076f]),'UserId':Number(_0x416730['id'])});}});}})[_0xa3e2('0x16')](function(){if(_0x5d63c4===_0xa3e2('0x49')){var _0x16781f=_[_0xa3e2('0x17')](_0x416730['OpenchannelInteractions'],'id');return _0x416730[_0xa3e2('0x51')](_0x16781f)[_0xa3e2('0x16')](function(){for(var _0x46dafd=0x0;_0x46dafd<_0x16781f['length'];_0x46dafd+=0x1){_0x29559c[_0xa3e2('0x47')](_0xa3e2('0x52'),{'OpenchannelInteractionId':Number(_0x16781f[_0x46dafd]),'UserId':Number(_0x416730['id'])});}});}})['then'](function(){if(_0x5d63c4===_0xa3e2('0x49')){var _0x11a225=_[_0xa3e2('0x17')](_0x416730[_0xa3e2('0x2a')],'id');return _0x416730[_0xa3e2('0x53')](_0x11a225)['then'](function(){for(var _0x28136b=0x0;_0x28136b<_0x11a225[_0xa3e2('0x1e')];_0x28136b+=0x1){_0x29559c[_0xa3e2('0x47')](_0xa3e2('0x54'),{'WhatsappInteractionId':Number(_0x11a225[_0x28136b]),'UserId':Number(_0x416730['id'])});}});}})['catch'](function(_0x2b239a){_0x21dcef[_0xa3e2('0x55')](_0x2b239a);});}}function onDisconnect(_0x243b68,_0x47d540){joinOrLeave(_0x243b68,_0xa3e2('0x49'),_0x47d540);}function onConnect(_0x3dfb06){joinOrLeave(_0x3dfb06,_0xa3e2('0x56'));}exports[_0xa3e2('0x57')]=function(_0x19a65c){_0x19a65c['on'](_0xa3e2('0x58'),function(_0x3ffe7d){_0x3ffe7d[_0xa3e2('0x59')](0x0);_0x3ffe7d[_0xa3e2('0x5a')]=_0x3ffe7d['request'][_0xa3e2('0x58')][_0xa3e2('0x5b')]+':'+_0x3ffe7d[_0xa3e2('0x5c')][_0xa3e2('0x58')]['remotePort'];_0x3ffe7d['connectedAt']=new Date();_0x3ffe7d[_0xa3e2('0x55')]=function(_0xb5938b){console[_0xa3e2('0x55')]('SocketIO\x20'+_0x3ffe7d['nsp']['name']+'['+_0x3ffe7d[_0xa3e2('0x5a')]+']',_0xb5938b);};_0x3ffe7d['on'](_0xa3e2('0x5d'),function(){onDisconnect(_0x3ffe7d,_0x19a65c);_0x3ffe7d['log'](_0xa3e2('0x5e'));});onConnect(_0x3ffe7d);_0x3ffe7d[_0xa3e2('0x55')]('CONNECTED');});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index bc14d35..f84ec5b 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 _0x5356=['Fax','FaxMessage','Mail','substatus','MailMessage','Openchannel','OpenchannelInteraction','request','EventManager','then','info','Trigger,\x20%s','error','code','catch','get','direction','ContactId','sequelize','QueryTypes','SELECT','User','UserId','fullname','email','internal','format','SIP/%s','name','channel','incomingmessage','outgoingmessage','motionChannel','event','opened','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','contact','changed','closed','query','find','interface','default','length','model','toLowerCase','util','../../mysqldb','jayson/promise','../logger','client','http','Chat','ChatInteraction','afterUpdate','closedinteraction','ChatMessage','Sms','afterCreate','newinteraction','SmsInteraction','SmsMessage','Whatsapp','WhatsappInteraction','newmessage','FaxInteraction'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5356,0x17e));var _0x6535=function(_0x43feee,_0x18e157){_0x43feee=_0x43feee-0x0;var _0xfa958a=_0x5356[_0x43feee];return _0xfa958a;};'use strict';var util=require(_0x6535('0x0'));var db=require(_0x6535('0x1'))['db'];var jayson=require(_0x6535('0x2'));var logger=require(_0x6535('0x3'))('triggers');var _=require('lodash');var client=jayson[_0x6535('0x4')][_0x6535('0x5')]({'port':0x232a});var triggers=[{'channel':_0x6535('0x6'),'model':_0x6535('0x7'),'event':'afterCreate','condition':'newinteraction','callback':afterCreate},{'channel':_0x6535('0x6'),'model':'ChatInteraction','event':_0x6535('0x8'),'condition':_0x6535('0x9'),'callback':afterUpdate},{'channel':_0x6535('0x6'),'model':_0x6535('0xa'),'event':'afterCreate','condition':'newmessage','callback':afterCreateMessage},{'channel':_0x6535('0xb'),'model':'SmsInteraction','event':_0x6535('0xc'),'condition':_0x6535('0xd'),'callback':afterCreate},{'channel':'Sms','model':_0x6535('0xe'),'event':'afterUpdate','condition':_0x6535('0x9'),'callback':afterUpdate},{'channel':_0x6535('0xb'),'model':_0x6535('0xf'),'event':_0x6535('0xc'),'condition':'newmessage','callback':afterCreateMessage},{'channel':'Whatsapp','model':'WhatsappInteraction','event':_0x6535('0xc'),'condition':_0x6535('0xd'),'callback':afterCreate},{'channel':_0x6535('0x10'),'model':_0x6535('0x11'),'event':_0x6535('0x8'),'condition':_0x6535('0x9'),'callback':afterUpdate},{'channel':_0x6535('0x10'),'model':'WhatsappMessage','event':'afterCreate','condition':_0x6535('0x12'),'callback':afterCreateMessage},{'channel':'Fax','model':_0x6535('0x13'),'event':_0x6535('0xc'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x6535('0x14'),'model':_0x6535('0x13'),'event':_0x6535('0x8'),'condition':_0x6535('0x9'),'callback':afterUpdate},{'channel':_0x6535('0x14'),'model':_0x6535('0x15'),'event':_0x6535('0xc'),'condition':_0x6535('0x12'),'callback':afterCreateMessage},{'channel':'Mail','model':'MailInteraction','event':_0x6535('0xc'),'condition':_0x6535('0xd'),'callback':afterCreate},{'channel':_0x6535('0x16'),'model':'MailInteraction','event':_0x6535('0x8'),'condition':_0x6535('0x9'),'callback':afterUpdate},{'channel':'Mail','model':'MailInteraction','event':_0x6535('0x17'),'condition':_0x6535('0x17'),'callback':afterUpdate},{'channel':_0x6535('0x16'),'model':_0x6535('0x18'),'event':_0x6535('0xc'),'condition':_0x6535('0x12'),'callback':afterCreateMessage},{'channel':_0x6535('0x19'),'model':_0x6535('0x1a'),'event':_0x6535('0xc'),'condition':_0x6535('0xd'),'callback':afterCreate},{'channel':_0x6535('0x19'),'model':_0x6535('0x1a'),'event':_0x6535('0x8'),'condition':_0x6535('0x9'),'callback':afterUpdate},{'channel':_0x6535('0x19'),'model':'OpenchannelMessage','event':_0x6535('0xc'),'condition':'newmessage','callback':afterCreateMessage}];function request(_0x2b6738){return client[_0x6535('0x1b')](_0x6535('0x1c'),_0x2b6738)[_0x6535('0x1d')](function(_0x2ac40e){logger[_0x6535('0x1e')](_0x6535('0x1f'),_0x6535('0x1c'),_0x2ac40e);if(_0x2ac40e[_0x6535('0x20')]){if(_0x2ac40e[_0x6535('0x20')][_0x6535('0x21')]===0x1f4){logger['error']('Trigger,\x20%s',_0x6535('0x1c'),_0x2ac40e[_0x6535('0x20')]);}}})[_0x6535('0x22')](function(_0x4079d9){logger[_0x6535('0x20')](_0x6535('0x1f'),_0x6535('0x1c'),_0x4079d9);});}function afterCreateMessage(_0x4b7bc5,_0x464061){return function(_0x11b4ec,_0xe82fe5){_0x11b4ec=_0x11b4ec[_0x6535('0x23')]({'plain':!![]});_0x11b4ec['channel']=_0x4b7bc5;_0x11b4ec['motionChannel']=_0x4b7bc5;_0x11b4ec['event']=_0x11b4ec[_0x6535('0x24')];var _0x2689d5='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x11b4ec[_0x6535('0x25')];return db[_0x6535('0x26')]['query'](_0x2689d5,{'type':db['Sequelize'][_0x6535('0x27')][_0x6535('0x28')],'raw':!![]})[_0x6535('0x1d')](function(_0x2d4395){return _0x2d4395;})[_0x6535('0x1d')](function(_0x13d91e){if(_0x13d91e){_0x11b4ec['contact']=_0x13d91e[0x0];}if(_0x11b4ec['UserId']){return db[_0x6535('0x29')]['find']({'where':{'id':_0x11b4ec[_0x6535('0x2a')]},'attributes':['id','name',_0x6535('0x2b'),_0x6535('0x2c'),_0x6535('0x2d')],'raw':!![]})['then'](function(_0x404f93){_0x11b4ec['interface']=util[_0x6535('0x2e')](_0x6535('0x2f'),_0x404f93[_0x6535('0x30')]);_0x11b4ec[_0x6535('0x31')]=_0x4b7bc5;_0x11b4ec['agent']=_0x404f93;return request({'event':_0x6535('0x32'),'message':_0x11b4ec});})[_0x6535('0x22')](function(_0x2840c2){console[_0x6535('0x20')](_0x2840c2);});}else{return request({'event':_0x6535('0x33'),'message':_0x11b4ec});}});};}function afterCreate(_0x314de9,_0x2f13eb){return function(_0x5e19a8,_0x143a70){_0x5e19a8=_0x5e19a8[_0x6535('0x23')]({'plain':!![]});_0x5e19a8[_0x6535('0x31')]=_0x314de9;_0x5e19a8[_0x6535('0x34')]=_0x314de9;_0x5e19a8[_0x6535('0x35')]=_0x6535('0x36');var _0x470ac3=_0x6535('0x37')+_0x5e19a8[_0x6535('0x25')];return db[_0x6535('0x26')]['query'](_0x470ac3,{'type':db[_0x6535('0x38')][_0x6535('0x27')][_0x6535('0x28')],'raw':!![]})[_0x6535('0x1d')](function(_0x5b6be4){return _0x5b6be4;})['then'](function(_0xd41b7c){if(_0xd41b7c){_0x5e19a8[_0x6535('0x39')]=_0xd41b7c[0x0];}return request({'event':_0x2f13eb,'message':_0x5e19a8});});};}function afterUpdate(_0x27bb17,_0x5c9a08){return function(_0x3a3da8,_0x399798){if(_0x3a3da8[_0x6535('0x3a')](_0x6535('0x3b'))&&_0x3a3da8[_0x6535('0x3b')]){_0x3a3da8=_0x3a3da8['get']({'plain':!![]});_0x3a3da8[_0x6535('0x31')]=_0x27bb17;_0x3a3da8[_0x6535('0x34')]=_0x27bb17;_0x3a3da8[_0x6535('0x35')]='closed';var _0x30b964=_0x6535('0x37')+_0x3a3da8['ContactId'];return db[_0x6535('0x26')][_0x6535('0x3c')](_0x30b964,{'type':db[_0x6535('0x38')][_0x6535('0x27')][_0x6535('0x28')],'raw':!![]})[_0x6535('0x1d')](function(_0x1cfe3e){return _0x1cfe3e;})[_0x6535('0x1d')](function(_0x5a75a7){if(_0x5a75a7){_0x3a3da8[_0x6535('0x39')]=_0x5a75a7[0x0];}if(_0x3a3da8[_0x6535('0x2a')]){return db['User'][_0x6535('0x3d')]({'where':{'id':_0x3a3da8[_0x6535('0x2a')]},'attributes':['id',_0x6535('0x30'),_0x6535('0x2b'),'email',_0x6535('0x2d')],'raw':!![]})[_0x6535('0x1d')](function(_0x86aefc){_0x3a3da8[_0x6535('0x3e')]=util[_0x6535('0x2e')](_0x6535('0x2f'),_0x86aefc[_0x6535('0x30')]);_0x3a3da8['agent']=_0x86aefc;return request({'event':_0x5c9a08,'message':_0x3a3da8});})[_0x6535('0x22')](function(_0x3e2b39){console['error'](_0x3e2b39);});}else{return request({'event':_0x5c9a08,'message':_0x3a3da8});}});}else if(_0x3a3da8[_0x6535('0x3a')](_0x6535('0x17'))){_0x3a3da8=_0x3a3da8[_0x6535('0x23')]({'plain':!![]});_0x3a3da8[_0x6535('0x31')]=_0x27bb17;_0x3a3da8[_0x6535('0x35')]=_0x6535('0x17');var _0x30b964=_0x6535('0x37')+_0x3a3da8[_0x6535('0x25')];return db['sequelize'][_0x6535('0x3c')](_0x30b964,{'type':db[_0x6535('0x38')][_0x6535('0x27')]['SELECT'],'raw':!![]})[_0x6535('0x1d')](function(_0x2437f4){return _0x2437f4;})['then'](function(_0x4a4a7f){if(_0x4a4a7f){_0x3a3da8['contact']=_0x4a4a7f[0x0];}if(_0x3a3da8['UserId']){return db[_0x6535('0x29')]['find']({'where':{'id':_0x3a3da8[_0x6535('0x2a')]},'attributes':['id',_0x6535('0x30'),_0x6535('0x2b'),'email',_0x6535('0x2d')],'raw':!![]})[_0x6535('0x1d')](function(_0x3cbf4c){_0x3a3da8[_0x6535('0x3e')]=util[_0x6535('0x2e')](_0x6535('0x2f'),_0x3cbf4c['name']);_0x3a3da8['agent']=_0x3cbf4c;return request({'event':_0x5c9a08,'message':_0x3a3da8});})[_0x6535('0x22')](function(_0x4ad0ec){console[_0x6535('0x20')](_0x4ad0ec);});}else{return request({'event':_0x5c9a08,'message':_0x3a3da8});}});}};}exports[_0x6535('0x3f')]=function(){for(var _0x17284=0x0;_0x17284=_0x1b16c3[_0x3146('0x12')]){throw Error(_0x3146('0x13'));}_0x5cb5e9(_0x321af0);})['catch'](function(_0x25ae4a){_0x25da34(_0x25ae4a);});});}; \ No newline at end of file +var _0x80a7=['Maximum\x20login\x20has\x20been\x20reached','catch','lodash','bluebird','../mysqldb','./license/util','voice','chat','fax','sms','whatsapp','openchannel','getChannels','isValidChannel','toLowerCase','includes','clearBlockUser','blockedAt','updateAttributes','role','agent','User','then','getLicense','agents'];(function(_0x10a96c,_0xd8e7f2){var _0x53e738=function(_0x17009d){while(--_0x17009d){_0x10a96c['push'](_0x10a96c['shift']());}};_0x53e738(++_0xd8e7f2);}(_0x80a7,0x12e));var _0x780a=function(_0x218994,_0x2cf487){_0x218994=_0x218994-0x0;var _0x3f350b=_0x80a7[_0x218994];return _0x3f350b;};'use strict';var _=require(_0x780a('0x0'));var BPromise=require(_0x780a('0x1'));var db=require(_0x780a('0x2'))['db'];var util=require(_0x780a('0x3'));var channels=[_0x780a('0x4'),'mail',_0x780a('0x5'),_0x780a('0x6'),_0x780a('0x7'),_0x780a('0x8'),_0x780a('0x9')];exports[_0x780a('0xa')]=function(){return channels;};exports[_0x780a('0xb')]=function(_0x5a4acc){_0x5a4acc=_0x5a4acc[_0x780a('0xc')]();return _[_0x780a('0xd')](channels,_0x5a4acc);};exports[_0x780a('0xe')]=function(_0x26b4f9,_0x1d8921,_0x191d6c,_0x44d38d){var _0x3bc935={'loginAttempts':_0x1d8921,'blocked':_0x191d6c};if(!_['isUndefined'](_0x44d38d)){_0x3bc935[_0x780a('0xf')]=_0x44d38d;}return _0x26b4f9[_0x780a('0x10')](_0x3bc935);};exports['getLicense']=function(_0x412ba6){return new BPromise(function(_0x462db4,_0x1add74){var _0x53bce9=0x0;if(_0x412ba6[_0x780a('0x11')]!==_0x780a('0x12')){_0x462db4(_0x412ba6);}db[_0x780a('0x13')]['count']({'where':{'role':_0x780a('0x12'),'online':!![],'id':{'$ne':_0x412ba6['id']}}})[_0x780a('0x14')](function(_0x119739){_0x53bce9=_0x119739;return util[_0x780a('0x15')]();})[_0x780a('0x14')](function(_0x2b3dce){if(_0x2b3dce&&_0x2b3dce[_0x780a('0x16')]&&_0x53bce9>=_0x2b3dce['agents']){throw Error(_0x780a('0x17'));}_0x462db4(_0x412ba6);})[_0x780a('0x18')](function(_0x294683){_0x1add74(_0x294683);});});}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index b350391..4e8cfc1 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xad55=['render','send','exports','404','status'];(function(_0xeafa35,_0x24d7ba){var _0x53b3f4=function(_0x1e2476){while(--_0x1e2476){_0xeafa35['push'](_0xeafa35['shift']());}};_0x53b3f4(++_0x24d7ba);}(_0xad55,0xe8));var _0x5ad5=function(_0xdf6b54,_0x14dc4c){_0xdf6b54=_0xdf6b54-0x0;var _0xb2cc62=_0xad55[_0xdf6b54];return _0xb2cc62;};'use strict';module[_0x5ad5('0x0')][0x194]=function pageNotFound(_0xcb6849,_0x411c69){var _0x1eaa54=_0x5ad5('0x1');var _0x445b7c=0x194;var _0xdbbce={'status':_0x445b7c};_0x411c69[_0x5ad5('0x2')](_0xdbbce[_0x5ad5('0x2')]);_0x411c69[_0x5ad5('0x3')](_0x1eaa54,{},function(_0x3ef4ce,_0x274587){if(_0x3ef4ce){return _0x411c69['status'](_0xdbbce[_0x5ad5('0x2')])['json'](_0xdbbce);}_0x411c69[_0x5ad5('0x4')](_0x274587);});}; \ No newline at end of file +var _0x9140=['send','exports','404','status'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0x9140,0x185));var _0x0914=function(_0x4b6e7f,_0x5ae553){_0x4b6e7f=_0x4b6e7f-0x0;var _0x289367=_0x9140[_0x4b6e7f];return _0x289367;};'use strict';module[_0x0914('0x0')][0x194]=function pageNotFound(_0x260718,_0xc01fdd){var _0x409f51=_0x0914('0x1');var _0x5df384=0x194;var _0x8b3299={'status':_0x5df384};_0xc01fdd[_0x0914('0x2')](_0x8b3299[_0x0914('0x2')]);_0xc01fdd['render'](_0x409f51,{},function(_0x342dde,_0x282aa7){if(_0x342dde){return _0xc01fdd[_0x0914('0x2')](_0x8b3299[_0x0914('0x2')])['json'](_0x8b3299);}_0xc01fdd[_0x0914('0x3')](_0x282aa7);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index 4b0cbad..b71956c 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xecd7=['user_has_openchannel_interactions','user_has_whatsapp_interactions','VoicePrefixes','MailQueues','ChatQueues','SmsQueue','SmsQueues','OpenchannelQueue','WhatsappQueues','UserWhatsappQueue','ChatWebsites','user_has_chat_websites','FaxAccounts','MailAccount','user_has_mail_accounts','OpenchannelAccounts','SmsAccounts','user_has_sms_accounts','user_has_whatsapp_accounts','SquareProjects','user_has_square_projects','SpiedAgents','ChanSpyId','VoiceContext','Applications','Sound','moh_has_sounds','VoiceQueueId','Hoppers','HopperHistories','HopperBlacks','JscriptySessionReport','JscriptySessions','TrunkId','TrunkBackup','TrunkBackupId','Interval','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Teams','VoiceRecording','Messages','VoiceMailMessage','VoiceCallReport','QueueCalls','uniqueid','VoiceAgentReport','AgentReports','Contact','ContactId','MailAccountId','Imap','Smtp','Disposition','Dispositions','Answers','Interactions','MailApplication','List','ListId','TemplateId','Agents','team_has_mail_queues','MailInteractionId','Account','Owner','Tag','mail_interaction_has_tags','ThroughTags','Interaction','ChatOfflineMessageId','restrict','MailQueueReport','DashboardItem','Items','FaxAccountId','Exntensions','FaxMessage','user_has_fax_accounts','TagId','FaxInteractionId','fax_interaction_has_tags','Tags','Users','AttachmentId','UserFaxQueue','team_has_fax_queues','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','team_has_sms_queues','OpenchannelAccountId','user_has_openchannel_accounts','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','team_has_openchannel_queues','ChatWebsiteId','ProactiveActions','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','team_has_chat_queues','ChatGroupId','Members','CompanyId','OpenchannelInteractions','CmCompany','Company','cm_contact_has_tags','Agent','OwnerId','Queue','CampaignId','Automation','All','Any','AutomationAnyId','Actions','AutomationId','ParentId','Intervals','Extensions','MailApplications','FaxApplications','SmsApplications','DefaultReportId','Mohs','whatsapp_interaction_has_tags','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','Fields','CustomReportId','AnalyticMetric','MetricId','Configurations','AccountId','Subjects','DescriptionId','Subject','Description','Field','FieldId','Variable','VariableId','SubjectId','Descriptions','int_desk_configuration_has_tags','int_zendesk_configuration_has_tags','VtigerAccount','ServicenowAccount','ToId','SessionId','JscriptyQuestionReport','ProjectId','VoiceQueues','FaxQueues','OpenchannelQueues','team_has_whatsapp_queues','SquareProjectId','BlackLists','FromAccount','FromUserId','ToUserId','ToMailQueueId','ToMailAccountId','ToAccount','FromChatWebsiteId','FromAgent','ToAgent','ToChatQueueId','ToQueue','ToChatWebsiteId','FaxTransferReport','ToFaxQueueId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelAccountId','ToSmsAccountId','CustomFields','Queues','userProfileId','UserProfileSections','sectionId','WhatsappAccountId','WhatsappMessage','WhatsappInteractionId','WhatsappQueueReport','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','../config/environment','sequelize','lodash','jstz','determine','defaultsDeep','motion2','xC@LL1234','127.0.0.1','mysql','utf8mb4','name','utf8','utf8_general_ci','sequelizeHistory','xcall','database','password','options','username','User','import','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','ScreenRecording','../api/screenRecording/screenRecording.model','../api/voiceMail/voiceMail.model','../api/voiceMailMessage/voiceMailMessage.model','../api/voiceCallReport/voiceCallReport.model','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','../api/mailAccount/mailAccount.model','MailQueue','MailSubstatus','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.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','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','CmContact','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','../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','CannedAnswer','../api/disposition/disposition.model','Condition','../api/interval/interval.model','Pause','../api/pause/pause.model','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','../api/sound/sound.model','../api/tag/tag.model','Template','../api/template/template.model','Trigger','Integration','../api/integration/integration.model','IntegrationReport','AnalyticCustomReport','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','SugarcrmAccount','SugarcrmConfiguration','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','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','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','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/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','Network','../api/network/network.model','ChatQueueReport','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','SquareReport','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','SquareOdbc','SquareProject','../api/squareProject/squareProject.model','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','Attachment','Plugin','MailTransferReport','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','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','../api/whatsappMessage/whatsappMessage.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','hasOne','VoiceMail','UserId','hasMany','Recordings','VoiceQueuesRt','cascade','CmHopperFinal','HopperFinals','HopperHistory','ChatInteractions','FaxInteractions','WhatsappInteractions','UserNotifications','SenderId','belongsTo','Groups','chat_group_has_users','belongsToMany','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','user_has_teams','MailInteraction','MailInteractions','user_has_mail_interactions','user_has_chat_interactions','user_has_fax_interactions','SmsInteractions','user_has_sms_interactions'];(function(_0x58965a,_0x2e71db){var _0x254efc=function(_0xf14fb4){while(--_0xf14fb4){_0x58965a['push'](_0x58965a['shift']());}};_0x254efc(++_0x2e71db);}(_0xecd7,0xc7));var _0x7ecd=function(_0x42eec9,_0x226928){_0x42eec9=_0x42eec9-0x0;var _0x49b27a=_0xecd7[_0x42eec9];return _0x49b27a;};'use strict';var config=require(_0x7ecd('0x0'));var Sequelize=require(_0x7ecd('0x1'));var _=require(_0x7ecd('0x2'));var jstz=require(_0x7ecd('0x3'));var timezone=jstz[_0x7ecd('0x4')]();config[_0x7ecd('0x1')]=_[_0x7ecd('0x5')](config[_0x7ecd('0x1')],{'database':_0x7ecd('0x6'),'username':'xcall','password':_0x7ecd('0x7'),'options':{'host':_0x7ecd('0x8'),'port':0xcea,'dialect':_0x7ecd('0x9'),'dialectOptions':{'charset':_0x7ecd('0xa')},'logging':![],'timezone':timezone[_0x7ecd('0xb')](),'define':{'charset':_0x7ecd('0xc'),'collate':_0x7ecd('0xd')}}});config[_0x7ecd('0xe')]=_[_0x7ecd('0x5')](config[_0x7ecd('0xe')],{'database':'motion2','username':_0x7ecd('0xf'),'password':_0x7ecd('0x7'),'options':{'host':_0x7ecd('0x8'),'port':0xcea,'dialect':_0x7ecd('0x9'),'dialectOptions':{'charset':_0x7ecd('0xa')},'logging':![],'timezone':timezone[_0x7ecd('0xb')](),'define':{'charset':_0x7ecd('0xc'),'collate':_0x7ecd('0xd')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x7ecd('0x1')][_0x7ecd('0x10')],config[_0x7ecd('0x1')]['username'],config[_0x7ecd('0x1')][_0x7ecd('0x11')],config[_0x7ecd('0x1')][_0x7ecd('0x12')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelizeHistory'][_0x7ecd('0x10')],config[_0x7ecd('0xe')][_0x7ecd('0x13')],config[_0x7ecd('0xe')]['password'],config[_0x7ecd('0xe')]['options'])};db[_0x7ecd('0x14')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')]('../api/user/user.model');db[_0x7ecd('0x16')]=db['sequelize'][_0x7ecd('0x15')](_0x7ecd('0x17'));db['VoiceContext']=db[_0x7ecd('0x1')]['import'](_0x7ecd('0x18'));db[_0x7ecd('0x19')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0x1a'));db[_0x7ecd('0x1b')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0x1c'));db[_0x7ecd('0x1d')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0x1e'));db['VoiceRecording']=db[_0x7ecd('0x1')][_0x7ecd('0x15')]('../api/voiceRecording/voiceRecording.model');db[_0x7ecd('0x1f')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0x20'));db['VoiceMail']=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0x21'));db['VoiceMailMessage']=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0x22'));db['VoiceCallReport']=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0x23'));db['VoiceDialReport']=db[_0x7ecd('0x1')][_0x7ecd('0x15')]('../api/voiceDialReport/voiceDialReport.model');db['VoiceAgentReport']=db[_0x7ecd('0x1')][_0x7ecd('0x15')]('../api/voiceAgentReport/voiceAgentReport.model');db['VoiceQueueReport']=db['sequelize']['import'](_0x7ecd('0x24'));db[_0x7ecd('0x25')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0x26'));db[_0x7ecd('0x27')]=db['sequelize'][_0x7ecd('0x15')](_0x7ecd('0x28'));db['VoiceTransferReport']=db[_0x7ecd('0x1')]['import'](_0x7ecd('0x29'));db[_0x7ecd('0x2a')]=db[_0x7ecd('0x1')]['import']('../api/userVoiceQueueRt/userVoiceQueueRt.model');db[_0x7ecd('0x2b')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0x2c'));db['UserChatQueue']=db[_0x7ecd('0x1')][_0x7ecd('0x15')]('../api/userChatQueue/userChatQueue.model');db[_0x7ecd('0x2d')]=db[_0x7ecd('0x1')]['import'](_0x7ecd('0x2e'));db['UserFaxQueue']=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0x2f'));db[_0x7ecd('0x30')]=db['sequelize'][_0x7ecd('0x15')](_0x7ecd('0x31'));db[_0x7ecd('0x32')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0x33'));db['UserWhatsappQueue']=db['sequelize']['import'](_0x7ecd('0x34'));db[_0x7ecd('0x35')]=db[_0x7ecd('0x1')]['import'](_0x7ecd('0x36'));db[_0x7ecd('0x37')]=db[_0x7ecd('0x1')]['import'](_0x7ecd('0x38'));db['MailAccount']=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0x39'));db[_0x7ecd('0x3a')]=db['sequelize']['import']('../api/mailQueue/mailQueue.model');db[_0x7ecd('0x3b')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')]('../api/mailSubstatus/mailSubstatus.model');db['MailInteraction']=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0x3c'));db[_0x7ecd('0x3d')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0x3e'));db['MailApplication']=db[_0x7ecd('0x1')][_0x7ecd('0x15')]('../api/mailApplication/mailApplication.model');db['MailQueueReport']=db['sequelize']['import'](_0x7ecd('0x3f'));db[_0x7ecd('0x40')]=db['sequelize'][_0x7ecd('0x15')]('../api/dashboard/dashboard.model');db['DashboardItem']=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0x41'));db[_0x7ecd('0x42')]=db['sequelize'][_0x7ecd('0x15')](_0x7ecd('0x43'));db[_0x7ecd('0x44')]=db['sequelize']['import'](_0x7ecd('0x45'));db[_0x7ecd('0x46')]=db[_0x7ecd('0x1')]['import'](_0x7ecd('0x47'));db['FaxMessage']=db[_0x7ecd('0x1')][_0x7ecd('0x15')]('../api/faxMessage/faxMessage.model');db[_0x7ecd('0x48')]=db[_0x7ecd('0x1')]['import'](_0x7ecd('0x49'));db[_0x7ecd('0x4a')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0x4b'));db[_0x7ecd('0x4c')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0x4d'));db[_0x7ecd('0x4e')]=db[_0x7ecd('0x1')]['import'](_0x7ecd('0x4f'));db[_0x7ecd('0x50')]=db['sequelize'][_0x7ecd('0x15')](_0x7ecd('0x51'));db[_0x7ecd('0x52')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0x53'));db['SmsQueue']=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0x54'));db[_0x7ecd('0x55')]=db[_0x7ecd('0x1')]['import'](_0x7ecd('0x56'));db[_0x7ecd('0x57')]=db['sequelize'][_0x7ecd('0x15')](_0x7ecd('0x58'));db[_0x7ecd('0x59')]=db['sequelize']['import'](_0x7ecd('0x5a'));db[_0x7ecd('0x5b')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')]('../api/openchannelMessage/openchannelMessage.model');db['OpenchannelQueue']=db['sequelize'][_0x7ecd('0x15')]('../api/openchannelQueue/openchannelQueue.model');db[_0x7ecd('0x5c')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0x5d'));db[_0x7ecd('0x5e')]=db[_0x7ecd('0x1')]['import'](_0x7ecd('0x5f'));db[_0x7ecd('0x60')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0x61'));db[_0x7ecd('0x62')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0x63'));db[_0x7ecd('0x64')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0x65'));db[_0x7ecd('0x66')]=db['sequelize'][_0x7ecd('0x15')]('../api/chatOfflineMessage/chatOfflineMessage.model');db[_0x7ecd('0x67')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0x68'));db[_0x7ecd('0x69')]=db['sequelize'][_0x7ecd('0x15')](_0x7ecd('0x6a'));db[_0x7ecd('0x6b')]=db['sequelize'][_0x7ecd('0x15')]('../api/chatProactiveAction/chatProactiveAction.model');db['CmCompany']=db[_0x7ecd('0x1')]['import']('../api/cmCompany/cmCompany.model');db[_0x7ecd('0x6c')]=db['sequelize']['import'](_0x7ecd('0x6d'));db[_0x7ecd('0x6e')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0x6f'));db[_0x7ecd('0x70')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0x71'));db['CmHopperFinal']=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0x72'));db[_0x7ecd('0x73')]=db['sequelize'][_0x7ecd('0x15')](_0x7ecd('0x74'));db[_0x7ecd('0x75')]=db['sequelize']['import'](_0x7ecd('0x76'));db[_0x7ecd('0x77')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0x78'));db[_0x7ecd('0x79')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0x7a'));db['Automation']=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0x7b'));db[_0x7ecd('0x7c')]=db['sequelize'][_0x7ecd('0x15')]('../api/cannedAnswer/cannedAnswer.model');db['Disposition']=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0x7d'));db[_0x7ecd('0x7e')]=db['sequelize'][_0x7ecd('0x15')]('../api/condition/condition.model');db['Interval']=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0x7f'));db[_0x7ecd('0x80')]=db[_0x7ecd('0x1')]['import'](_0x7ecd('0x81'));db['Cdr']=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0x82'));db[_0x7ecd('0x83')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0x84'));db[_0x7ecd('0x85')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0x86'));db['Sound']=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0x87'));db['Tag']=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0x88'));db[_0x7ecd('0x89')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0x8a'));db[_0x7ecd('0x8b')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')]('../api/trigger/trigger.model');db['Variable']=db['sequelize'][_0x7ecd('0x15')]('../api/variable/variable.model');db[_0x7ecd('0x8c')]=db['sequelize'][_0x7ecd('0x15')](_0x7ecd('0x8d'));db[_0x7ecd('0x8e')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')]('../api/integrationReport/integrationReport.model');db[_0x7ecd('0x8f')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')]('../api/analyticCustomReport/analyticCustomReport.model');db[_0x7ecd('0x90')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0x91'));db['AnalyticExtractedReport']=db[_0x7ecd('0x1')]['import']('../api/analyticExtractedReport/analyticExtractedReport.model');db['AnalyticMetric']=db[_0x7ecd('0x1')]['import'](_0x7ecd('0x92'));db[_0x7ecd('0x93')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')]('../api/analyticFieldReport/analyticFieldReport.model');db[_0x7ecd('0x94')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0x95'));db[_0x7ecd('0x96')]=db[_0x7ecd('0x1')]['import']('../api/intSalesforceAccount/intSalesforceAccount.model');db[_0x7ecd('0x97')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0x98'));db[_0x7ecd('0x99')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')]('../api/intSalesforceField/intSalesforceField.model');db[_0x7ecd('0x9a')]=db[_0x7ecd('0x1')]['import']('../api/intSugarcrmAccount/intSugarcrmAccount.model');db[_0x7ecd('0x9b')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')]('../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model');db[_0x7ecd('0x9c')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0x9d'));db[_0x7ecd('0x9e')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0x9f'));db[_0x7ecd('0xa0')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0xa1'));db[_0x7ecd('0xa2')]=db['sequelize'][_0x7ecd('0x15')](_0x7ecd('0xa3'));db[_0x7ecd('0xa4')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0xa5'));db[_0x7ecd('0xa6')]=db['sequelize']['import'](_0x7ecd('0xa7'));db[_0x7ecd('0xa8')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')]('../api/intZohoField/intZohoField.model');db[_0x7ecd('0xa9')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0xaa'));db[_0x7ecd('0xab')]=db[_0x7ecd('0x1')]['import'](_0x7ecd('0xac'));db[_0x7ecd('0xad')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0xae'));db[_0x7ecd('0xaf')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0xb0'));db[_0x7ecd('0xb1')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0xb2'));db[_0x7ecd('0xb3')]=db['sequelize'][_0x7ecd('0x15')](_0x7ecd('0xb4'));db['VtigerAccount']=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0xb5'));db[_0x7ecd('0xb6')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')]('../api/intVtigerConfiguration/intVtigerConfiguration.model');db[_0x7ecd('0xb7')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0xb8'));db['ServicenowAccount']=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0xb9'));db[_0x7ecd('0xba')]=db['sequelize']['import'](_0x7ecd('0xbb'));db[_0x7ecd('0xbc')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0xbd'));db[_0x7ecd('0xbe')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0xbf'));db[_0x7ecd('0xc0')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0xc1'));db[_0x7ecd('0xc2')]=db['sequelize']['import']('../api/intDynamics365Field/intDynamics365Field.model');db[_0x7ecd('0xc3')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0xc4'));db[_0x7ecd('0xc5')]=db[_0x7ecd('0x1')]['import'](_0x7ecd('0xc6'));db[_0x7ecd('0xc7')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0xc8'));db[_0x7ecd('0x8c')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0x8d'));db[_0x7ecd('0xc9')]=db[_0x7ecd('0x1')]['import'](_0x7ecd('0xca'));db[_0x7ecd('0xcb')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')]('../api/chatQueueReport/chatQueueReport.model');db[_0x7ecd('0xcc')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0xcd'));db[_0x7ecd('0xce')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0xcf'));db['JscriptyQuestionReport']=db[_0x7ecd('0x1')]['import'](_0x7ecd('0xd0'));db['JscriptySessionReport']=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0xd1'));db[_0x7ecd('0xd2')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')]('../api/smsQueueReport/smsQueueReport.model');db[_0x7ecd('0xd3')]=db['sequelize']['import']('../api/squareReport/squareReport.model');db[_0x7ecd('0xd4')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0xd5'));db[_0x7ecd('0xd6')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0xd7'));db[_0x7ecd('0xd8')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0xd9'));db[_0x7ecd('0xda')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')]('../api/squareOdbc/squareOdbc.model');db[_0x7ecd('0xdb')]=db['sequelize']['import'](_0x7ecd('0xdc'));db['SquareRecording']=db['sequelize'][_0x7ecd('0x15')](_0x7ecd('0xdd'));db[_0x7ecd('0xde')]=db[_0x7ecd('0x1')]['import'](_0x7ecd('0xdf'));db[_0x7ecd('0xe0')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0xe1'));db[_0x7ecd('0xe2')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0xe3'));db[_0x7ecd('0xe4')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0xe5'));db[_0x7ecd('0xe6')]=db['sequelize']['import'](_0x7ecd('0xe7'));db[_0x7ecd('0xe8')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')]('../api/attachment/attachment.model');db[_0x7ecd('0xe9')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')]('../api/plugin/plugin.model');db[_0x7ecd('0xea')]=db[_0x7ecd('0x1')]['import']('../api/mailTransferReport/mailTransferReport.model');db[_0x7ecd('0xeb')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0xec'));db['FaxTransferReport']=db[_0x7ecd('0x1')][_0x7ecd('0x15')]('../api/faxTransferReport/faxTransferReport.model');db[_0x7ecd('0xed')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0xee'));db[_0x7ecd('0xef')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0xf0'));db[_0x7ecd('0xf1')]=db['sequelize'][_0x7ecd('0x15')](_0x7ecd('0xf2'));db[_0x7ecd('0xf3')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0xf4'));db[_0x7ecd('0xf5')]=db['sequelize'][_0x7ecd('0x15')]('../api/userProfile/userProfile.model');db[_0x7ecd('0xf6')]=db['sequelize'][_0x7ecd('0x15')](_0x7ecd('0xf7'));db[_0x7ecd('0xf8')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0xf9'));db[_0x7ecd('0xfa')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')]('../api/userNotification/userNotification.model');db[_0x7ecd('0xfb')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0xfc'));db[_0x7ecd('0xfd')]=db['sequelize'][_0x7ecd('0x15')](_0x7ecd('0xfe'));db[_0x7ecd('0xff')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0x100'));db['WhatsappMessage']=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0x101'));db['WhatsappQueueReport']=db[_0x7ecd('0x1')][_0x7ecd('0x15')]('../api/whatsappQueueReport/whatsappQueueReport.model');db[_0x7ecd('0x102')]=db['sequelize']['import'](_0x7ecd('0x103'));db[_0x7ecd('0x104')]=db['sequelize'][_0x7ecd('0x15')]('../api/whatsappQueue/whatsappQueue.model');db[_0x7ecd('0x105')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0x106'));db[_0x7ecd('0x107')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0x108'));db[_0x7ecd('0x109')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0x10a'));db[_0x7ecd('0x10b')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0x10c'));db[_0x7ecd('0x14')][_0x7ecd('0x10d')](db[_0x7ecd('0x10e')],{'as':_0x7ecd('0x10e'),'onDelete':'cascade','foreignKey':_0x7ecd('0x10f')});db[_0x7ecd('0x14')][_0x7ecd('0x110')](db['VoiceRecording'],{'as':_0x7ecd('0x111'),'foreignKey':_0x7ecd('0x10f')});db[_0x7ecd('0x14')][_0x7ecd('0x110')](db[_0x7ecd('0x2a')],{'as':_0x7ecd('0x112'),'foreignKey':_0x7ecd('0x10f')});db['User'][_0x7ecd('0x110')](db[_0x7ecd('0x19')],{'as':'Extensions','onDelete':_0x7ecd('0x113'),'hooks':!![]});db[_0x7ecd('0x14')][_0x7ecd('0x110')](db[_0x7ecd('0x114')],{'as':_0x7ecd('0x115'),'foreignKey':_0x7ecd('0x10f')});db[_0x7ecd('0x14')]['hasMany'](db['CmHopperHistory'],{'as':_0x7ecd('0x116'),'foreignKey':_0x7ecd('0x10f')});db[_0x7ecd('0x14')][_0x7ecd('0x110')](db[_0x7ecd('0x75')],{'as':_0x7ecd('0x75'),'foreignKey':_0x7ecd('0x10f')});db[_0x7ecd('0x14')][_0x7ecd('0x110')](db[_0x7ecd('0x59')],{'as':'OpenchannelInteractions','foreignKey':_0x7ecd('0x10f')});db['User']['hasMany'](db[_0x7ecd('0x62')],{'as':_0x7ecd('0x117'),'foreignKey':_0x7ecd('0x10f')});db[_0x7ecd('0x14')]['hasMany'](db['SmsInteraction'],{'as':'SmsInteractions','foreignKey':_0x7ecd('0x10f')});db[_0x7ecd('0x14')]['hasMany'](db[_0x7ecd('0x46')],{'as':_0x7ecd('0x118'),'foreignKey':_0x7ecd('0x10f')});db[_0x7ecd('0x14')]['hasMany'](db['MailInteraction'],{'as':'MailInteractions','foreignKey':_0x7ecd('0x10f')});db[_0x7ecd('0x14')][_0x7ecd('0x110')](db[_0x7ecd('0xff')],{'as':_0x7ecd('0x119'),'foreignKey':_0x7ecd('0x10f')});db[_0x7ecd('0x14')][_0x7ecd('0x110')](db[_0x7ecd('0xfa')],{'as':_0x7ecd('0x11a'),'foreignKey':_0x7ecd('0x11b')});db['User'][_0x7ecd('0x11c')](db[_0x7ecd('0xf5')],{'as':_0x7ecd('0xf5'),'foreignKey':'userProfileId'});db[_0x7ecd('0x14')]['belongsToMany'](db['ChatGroup'],{'as':_0x7ecd('0x11d'),'through':_0x7ecd('0x11e')});db[_0x7ecd('0x14')][_0x7ecd('0x11f')](db[_0x7ecd('0x6c')],{'as':_0x7ecd('0x120'),'through':_0x7ecd('0x121')});db['User'][_0x7ecd('0x11f')](db[_0x7ecd('0xf1')],{'as':_0x7ecd('0x122'),'through':_0x7ecd('0x123')});db[_0x7ecd('0x14')][_0x7ecd('0x11f')](db['Team'],{'through':_0x7ecd('0x124')});db[_0x7ecd('0x14')][_0x7ecd('0x11f')](db[_0x7ecd('0x125')],{'as':_0x7ecd('0x126'),'through':_0x7ecd('0x127')});db[_0x7ecd('0x14')][_0x7ecd('0x11f')](db[_0x7ecd('0x62')],{'as':_0x7ecd('0x117'),'through':_0x7ecd('0x128')});db['User'][_0x7ecd('0x11f')](db[_0x7ecd('0x46')],{'as':'FaxInteractions','through':_0x7ecd('0x129')});db['User'][_0x7ecd('0x11f')](db[_0x7ecd('0x50')],{'as':_0x7ecd('0x12a'),'through':_0x7ecd('0x12b')});db[_0x7ecd('0x14')][_0x7ecd('0x11f')](db[_0x7ecd('0x59')],{'as':'OpenchannelInteractions','through':_0x7ecd('0x12c')});db[_0x7ecd('0x14')][_0x7ecd('0x11f')](db['WhatsappInteraction'],{'as':_0x7ecd('0x119'),'through':_0x7ecd('0x12d')});db[_0x7ecd('0x14')]['belongsToMany'](db['VoiceQueue'],{'as':'VoiceQueues','through':_0x7ecd('0x2b'),'required':![]});db[_0x7ecd('0x14')]['belongsToMany'](db[_0x7ecd('0xf3')],{'as':_0x7ecd('0x12e'),'through':_0x7ecd('0x10b'),'required':![]});db[_0x7ecd('0x14')][_0x7ecd('0x11f')](db[_0x7ecd('0x3a')],{'as':_0x7ecd('0x12f'),'through':_0x7ecd('0x2d'),'required':![]});db['User'][_0x7ecd('0x11f')](db[_0x7ecd('0x67')],{'as':_0x7ecd('0x130'),'through':'UserChatQueue','required':![],'hooks':!![]});db[_0x7ecd('0x14')][_0x7ecd('0x11f')](db[_0x7ecd('0x48')],{'as':'FaxQueues','through':'UserFaxQueue','required':![]});db[_0x7ecd('0x14')][_0x7ecd('0x11f')](db[_0x7ecd('0x131')],{'as':_0x7ecd('0x132'),'through':_0x7ecd('0x30'),'required':![]});db[_0x7ecd('0x14')][_0x7ecd('0x11f')](db[_0x7ecd('0x133')],{'as':'OpenchannelQueues','through':_0x7ecd('0x32'),'required':![]});db[_0x7ecd('0x14')]['belongsToMany'](db[_0x7ecd('0x104')],{'as':_0x7ecd('0x134'),'through':_0x7ecd('0x135'),'required':![]});db[_0x7ecd('0x14')]['belongsToMany'](db['CmList'],{'through':'cm_user_has_lists'});db[_0x7ecd('0x14')][_0x7ecd('0x11f')](db[_0x7ecd('0x5c')],{'as':_0x7ecd('0x136'),'through':_0x7ecd('0x137')});db[_0x7ecd('0x14')][_0x7ecd('0x11f')](db[_0x7ecd('0x42')],{'as':_0x7ecd('0x138'),'through':'user_has_fax_accounts'});db['User']['belongsToMany'](db[_0x7ecd('0x139')],{'as':'MailAccounts','through':_0x7ecd('0x13a')});db['User'][_0x7ecd('0x11f')](db[_0x7ecd('0x55')],{'as':_0x7ecd('0x13b'),'through':'user_has_openchannel_accounts'});db[_0x7ecd('0x14')]['belongsToMany'](db['SmsAccount'],{'as':_0x7ecd('0x13c'),'through':_0x7ecd('0x13d')});db[_0x7ecd('0x14')][_0x7ecd('0x11f')](db[_0x7ecd('0xfb')],{'as':'WhatsappAccounts','through':_0x7ecd('0x13e')});db[_0x7ecd('0x14')][_0x7ecd('0x11f')](db['SquareProject'],{'as':_0x7ecd('0x13f'),'through':_0x7ecd('0x140')});db[_0x7ecd('0x16')][_0x7ecd('0x110')](db[_0x7ecd('0x19')],{'as':_0x7ecd('0x141'),'onDelete':_0x7ecd('0x113'),'foreignKey':_0x7ecd('0x142')});db[_0x7ecd('0x143')]['hasMany'](db['VoiceExtension'],{'onDelete':_0x7ecd('0x113')});db[_0x7ecd('0x19')][_0x7ecd('0x110')](db[_0x7ecd('0x19')],{'as':_0x7ecd('0x144'),'onDelete':_0x7ecd('0x113')});db[_0x7ecd('0x1b')]['belongsToMany'](db[_0x7ecd('0x145')],{'as':'Sounds','through':_0x7ecd('0x146')});db[_0x7ecd('0x1d')]['hasMany'](db['UserVoiceQueueRt'],{'as':'Members','foreignKey':_0x7ecd('0x147')});db[_0x7ecd('0x1d')][_0x7ecd('0x110')](db[_0x7ecd('0x6e')],{'as':_0x7ecd('0x148'),'foreignKey':'VoiceQueueId'});db[_0x7ecd('0x1d')][_0x7ecd('0x110')](db[_0x7ecd('0x114')],{'as':_0x7ecd('0x115'),'foreignKey':_0x7ecd('0x147')});db['VoiceQueue'][_0x7ecd('0x110')](db[_0x7ecd('0x73')],{'as':_0x7ecd('0x149'),'foreignKey':_0x7ecd('0x147')});db[_0x7ecd('0x1d')]['hasMany'](db[_0x7ecd('0x75')],{'as':_0x7ecd('0x75'),'foreignKey':'VoiceQueueId'});db[_0x7ecd('0x1d')][_0x7ecd('0x110')](db[_0x7ecd('0x70')],{'as':_0x7ecd('0x14a'),'foreignKey':_0x7ecd('0x147')});db['VoiceQueue'][_0x7ecd('0x110')](db[_0x7ecd('0x14b')],{'as':_0x7ecd('0x14c'),'foreignKey':_0x7ecd('0x147')});db['VoiceQueue'][_0x7ecd('0x11c')](db[_0x7ecd('0x27')],{'as':'Trunk','foreignKey':_0x7ecd('0x14d')});db[_0x7ecd('0x1d')][_0x7ecd('0x11c')](db['Trunk'],{'as':_0x7ecd('0x14e'),'foreignKey':_0x7ecd('0x14f')});db[_0x7ecd('0x1d')]['belongsTo'](db[_0x7ecd('0x150')],{'as':_0x7ecd('0x150'),'foreignKey':_0x7ecd('0x151')});db[_0x7ecd('0x1d')][_0x7ecd('0x11c')](db[_0x7ecd('0x80')],{'as':_0x7ecd('0x152'),'foreignKey':_0x7ecd('0x153')});db[_0x7ecd('0x1d')]['belongsToMany'](db[_0x7ecd('0xf1')],{'as':_0x7ecd('0x122'),'through':_0x7ecd('0x154')});db[_0x7ecd('0x1d')][_0x7ecd('0x11f')](db[_0x7ecd('0x14')],{'as':'Agents','through':_0x7ecd('0x2b')});db[_0x7ecd('0x1d')][_0x7ecd('0x11f')](db[_0x7ecd('0xe0')],{'as':_0x7ecd('0x155'),'through':_0x7ecd('0x107')});db[_0x7ecd('0x1d')][_0x7ecd('0x11f')](db[_0x7ecd('0xf1')],{'as':'BlackLists','through':'voice_queues_has_cm_blacklists'});db[_0x7ecd('0x156')][_0x7ecd('0x11c')](db['User'],{'as':_0x7ecd('0x14'),'foreignKey':_0x7ecd('0x10f')});db[_0x7ecd('0x1f')][_0x7ecd('0x11c')](db[_0x7ecd('0x14')],{'as':_0x7ecd('0x14'),'foreignKey':_0x7ecd('0x10f')});db[_0x7ecd('0x10e')][_0x7ecd('0x110')](db['VoiceMailMessage'],{'as':_0x7ecd('0x157'),'onDelete':_0x7ecd('0x113'),'foreignKey':'mailboxuser','sourceKey':'mailbox'});db[_0x7ecd('0x158')][_0x7ecd('0x11c')](db[_0x7ecd('0x10e')],{'foreignKey':'mailboxuser','targetKey':'mailbox'});db[_0x7ecd('0x159')][_0x7ecd('0x110')](db['VoiceQueueReport'],{'as':_0x7ecd('0x15a'),'foreignKey':_0x7ecd('0x15b'),'constraints':![]});db[_0x7ecd('0x159')][_0x7ecd('0x110')](db[_0x7ecd('0x15c')],{'as':_0x7ecd('0x15d'),'foreignKey':_0x7ecd('0x15b'),'constraints':![]});db[_0x7ecd('0x159')][_0x7ecd('0x11c')](db[_0x7ecd('0x14')],{'as':'User','foreignKey':_0x7ecd('0x10f')});db[_0x7ecd('0x159')][_0x7ecd('0x11c')](db[_0x7ecd('0x6c')],{'as':_0x7ecd('0x15e'),'foreignKey':_0x7ecd('0x15f')});db['MailServerIn']['belongsTo'](db[_0x7ecd('0x139')],{'as':_0x7ecd('0x139'),'foreignKey':_0x7ecd('0x160')});db[_0x7ecd('0x37')][_0x7ecd('0x11c')](db[_0x7ecd('0x139')],{'as':'MailAccount','foreignKey':_0x7ecd('0x160')});db[_0x7ecd('0x139')][_0x7ecd('0x10d')](db[_0x7ecd('0x35')],{'as':_0x7ecd('0x161'),'onDelete':_0x7ecd('0x113')});db[_0x7ecd('0x139')][_0x7ecd('0x10d')](db[_0x7ecd('0x37')],{'as':_0x7ecd('0x162'),'onDelete':_0x7ecd('0x113')});db[_0x7ecd('0x139')]['hasMany'](db[_0x7ecd('0x163')],{'as':_0x7ecd('0x164'),'foreignKey':_0x7ecd('0x160'),'onDelete':'cascade'});db[_0x7ecd('0x139')][_0x7ecd('0x110')](db[_0x7ecd('0x7c')],{'as':_0x7ecd('0x165'),'foreignKey':'MailAccountId'});db[_0x7ecd('0x139')]['hasMany'](db[_0x7ecd('0x3d')],{'as':'Messages','foreignKey':'MailAccountId'});db[_0x7ecd('0x139')]['hasMany'](db[_0x7ecd('0x125')],{'as':_0x7ecd('0x166')});db[_0x7ecd('0x139')][_0x7ecd('0x110')](db[_0x7ecd('0x167')],{'as':'Applications'});db['MailAccount'][_0x7ecd('0x11c')](db[_0x7ecd('0xf1')],{'as':_0x7ecd('0x168'),'foreignKey':_0x7ecd('0x169')});db[_0x7ecd('0x139')][_0x7ecd('0x11c')](db[_0x7ecd('0x89')],{'as':_0x7ecd('0x89'),'foreignKey':_0x7ecd('0x16a')});db[_0x7ecd('0x139')][_0x7ecd('0x11c')](db['Pause'],{'as':_0x7ecd('0x152'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x7ecd('0x139')]['belongsToMany'](db[_0x7ecd('0x14')],{'as':_0x7ecd('0x16b'),'through':_0x7ecd('0x13a')});db[_0x7ecd('0x3a')][_0x7ecd('0x11f')](db[_0x7ecd('0x14')],{'as':'Agents','through':_0x7ecd('0x2d')});db[_0x7ecd('0x3a')]['belongsToMany'](db['Team'],{'through':_0x7ecd('0x16c'),'as':_0x7ecd('0x155')});db[_0x7ecd('0x125')]['hasMany'](db['MailMessage'],{'as':_0x7ecd('0x157'),'onDelete':_0x7ecd('0x113'),'foreignKey':_0x7ecd('0x16d')});db[_0x7ecd('0x125')][_0x7ecd('0x11c')](db[_0x7ecd('0x139')],{'as':_0x7ecd('0x16e'),'foreignKey':_0x7ecd('0x160')});db[_0x7ecd('0x125')][_0x7ecd('0x11c')](db['CmContact'],{'as':_0x7ecd('0x15e'),'foreignKey':_0x7ecd('0x15f')});db[_0x7ecd('0x125')]['belongsTo'](db[_0x7ecd('0x14')],{'as':_0x7ecd('0x16f'),'foreignKey':_0x7ecd('0x10f')});db[_0x7ecd('0x125')][_0x7ecd('0x11f')](db[_0x7ecd('0x170')],{'through':'mail_interaction_has_tags','as':'Tags'});db[_0x7ecd('0x125')][_0x7ecd('0x11f')](db[_0x7ecd('0x170')],{'through':_0x7ecd('0x171'),'as':_0x7ecd('0x172')});db[_0x7ecd('0x125')][_0x7ecd('0x11f')](db[_0x7ecd('0x14')],{'as':'Users','through':_0x7ecd('0x127'),'foreignKey':_0x7ecd('0x16d')});db['MailMessage'][_0x7ecd('0x110')](db[_0x7ecd('0xe8')],{'as':'Attachments','onDelete':'cascade'});db[_0x7ecd('0x3d')][_0x7ecd('0x11c')](db[_0x7ecd('0x14')],{'as':_0x7ecd('0x14')});db[_0x7ecd('0x3d')][_0x7ecd('0x11c')](db[_0x7ecd('0x6c')],{'onDelete':_0x7ecd('0x113'),'as':_0x7ecd('0x15e')});db[_0x7ecd('0x3d')][_0x7ecd('0x11c')](db[_0x7ecd('0x125')],{'as':_0x7ecd('0x173'),'foreignKey':_0x7ecd('0x16d')});db['MailMessage'][_0x7ecd('0x11c')](db['MailAccount'],{'as':'Account','foreignKey':_0x7ecd('0x160')});db[_0x7ecd('0x3d')][_0x7ecd('0x11c')](db[_0x7ecd('0x5c')],{'as':_0x7ecd('0x5c'),'foreignKey':'ChatWebsiteId'});db[_0x7ecd('0x3d')][_0x7ecd('0x11c')](db[_0x7ecd('0x66')],{'as':_0x7ecd('0x66'),'foreignKey':_0x7ecd('0x174')});db[_0x7ecd('0x167')][_0x7ecd('0x11c')](db[_0x7ecd('0x14')],{'onDelete':'restrict'});db[_0x7ecd('0x167')][_0x7ecd('0x11c')](db['MailQueue'],{'onDelete':_0x7ecd('0x175')});db[_0x7ecd('0x167')][_0x7ecd('0x11c')](db[_0x7ecd('0x139')],{'onDelete':'restrict'});db[_0x7ecd('0x167')]['belongsTo'](db['Interval'],{'onDelete':_0x7ecd('0x175'),'foreignKey':_0x7ecd('0x151')});db['MailApplication'][_0x7ecd('0x11c')](db[_0x7ecd('0x170')],{'onDelete':_0x7ecd('0x175'),'foreignKey':'TagId'});db[_0x7ecd('0x176')][_0x7ecd('0x11c')](db[_0x7ecd('0x139')],{});db[_0x7ecd('0x176')][_0x7ecd('0x11c')](db[_0x7ecd('0xf1')],{'as':'List','foreignKey':_0x7ecd('0x169')});db[_0x7ecd('0x176')][_0x7ecd('0x11c')](db[_0x7ecd('0x6c')],{'as':_0x7ecd('0x15e'),'foreignKey':_0x7ecd('0x15f')});db[_0x7ecd('0x176')][_0x7ecd('0x11c')](db[_0x7ecd('0x125')],{});db['MailQueueReport'][_0x7ecd('0x11c')](db['MailMessage'],{});db['MailQueueReport'][_0x7ecd('0x11c')](db[_0x7ecd('0x14')],{});db[_0x7ecd('0x176')]['belongsTo'](db['MailQueue'],{});db[_0x7ecd('0x40')][_0x7ecd('0x110')](db[_0x7ecd('0x177')],{'as':_0x7ecd('0x178'),'onDelete':_0x7ecd('0x113')});db[_0x7ecd('0x42')][_0x7ecd('0x110')](db[_0x7ecd('0x163')],{'as':_0x7ecd('0x164'),'foreignKey':'FaxAccountId','onDelete':_0x7ecd('0x113')});db[_0x7ecd('0x42')][_0x7ecd('0x110')](db['CannedAnswer'],{'as':_0x7ecd('0x165'),'foreignKey':_0x7ecd('0x179')});db[_0x7ecd('0x42')][_0x7ecd('0x110')](db[_0x7ecd('0x46')],{'as':_0x7ecd('0x166')});db[_0x7ecd('0x42')][_0x7ecd('0x110')](db[_0x7ecd('0x44')],{'as':_0x7ecd('0x144')});db[_0x7ecd('0x42')][_0x7ecd('0x110')](db[_0x7ecd('0x19')],{'as':_0x7ecd('0x17a'),'onDelete':'cascade'});db['FaxAccount'][_0x7ecd('0x110')](db[_0x7ecd('0x17b')],{'as':_0x7ecd('0x157')});db['FaxAccount'][_0x7ecd('0x11c')](db[_0x7ecd('0x27')],{'as':_0x7ecd('0x27')});db[_0x7ecd('0x42')][_0x7ecd('0x11c')](db[_0x7ecd('0xf1')],{'as':_0x7ecd('0x168'),'foreignKey':_0x7ecd('0x169')});db[_0x7ecd('0x42')][_0x7ecd('0x11c')](db[_0x7ecd('0x80')],{'as':_0x7ecd('0x152'),'foreignKey':_0x7ecd('0x153')});db[_0x7ecd('0x42')][_0x7ecd('0x11f')](db[_0x7ecd('0x14')],{'as':'Agents','through':_0x7ecd('0x17c')});db[_0x7ecd('0x44')][_0x7ecd('0x11c')](db[_0x7ecd('0x14')],{'onDelete':_0x7ecd('0x175')});db[_0x7ecd('0x44')][_0x7ecd('0x11c')](db['FaxQueue'],{'onDelete':_0x7ecd('0x175')});db[_0x7ecd('0x44')][_0x7ecd('0x11c')](db[_0x7ecd('0x42')],{'onDelete':_0x7ecd('0x175')});db[_0x7ecd('0x44')][_0x7ecd('0x11c')](db['Tag'],{'onDelete':_0x7ecd('0x175'),'foreignKey':_0x7ecd('0x17d')});db[_0x7ecd('0x46')]['hasMany'](db[_0x7ecd('0x17b')],{'as':'Messages','onDelete':'cascade','foreignKey':_0x7ecd('0x17e')});db[_0x7ecd('0x46')][_0x7ecd('0x11c')](db['FaxAccount'],{'as':_0x7ecd('0x16e'),'foreignKey':_0x7ecd('0x179')});db[_0x7ecd('0x46')][_0x7ecd('0x11c')](db[_0x7ecd('0x6c')],{'as':_0x7ecd('0x15e'),'foreignKey':'ContactId'});db[_0x7ecd('0x46')]['belongsTo'](db[_0x7ecd('0x14')],{'as':_0x7ecd('0x16f'),'foreignKey':'UserId'});db[_0x7ecd('0x46')][_0x7ecd('0x11f')](db[_0x7ecd('0x170')],{'through':_0x7ecd('0x17f'),'as':_0x7ecd('0x180')});db[_0x7ecd('0x46')][_0x7ecd('0x11f')](db[_0x7ecd('0x170')],{'through':_0x7ecd('0x17f'),'as':_0x7ecd('0x172')});db['FaxInteraction']['belongsToMany'](db['User'],{'as':_0x7ecd('0x181'),'through':_0x7ecd('0x129'),'foreignKey':'FaxInteractionId'});db[_0x7ecd('0x17b')][_0x7ecd('0x11c')](db[_0x7ecd('0x14')],{'onDelete':_0x7ecd('0x113'),'as':_0x7ecd('0x14')});db['FaxMessage'][_0x7ecd('0x11c')](db[_0x7ecd('0x46')],{'as':'Interaction','foreignKey':_0x7ecd('0x17e')});db[_0x7ecd('0x17b')]['belongsTo'](db[_0x7ecd('0x6c')],{'onDelete':'cascade','as':_0x7ecd('0x15e')});db[_0x7ecd('0x17b')][_0x7ecd('0x11c')](db[_0x7ecd('0xe8')],{'as':'Attachment','foreignKey':_0x7ecd('0x182')});db[_0x7ecd('0x17b')]['belongsTo'](db[_0x7ecd('0x42')],{'as':_0x7ecd('0x16e'),'foreignKey':'FaxAccountId'});db[_0x7ecd('0x48')][_0x7ecd('0x11f')](db[_0x7ecd('0x14')],{'as':_0x7ecd('0x16b'),'through':_0x7ecd('0x183')});db[_0x7ecd('0x48')]['belongsToMany'](db[_0x7ecd('0xe0')],{'through':_0x7ecd('0x184'),'as':_0x7ecd('0x155')});db[_0x7ecd('0x4a')][_0x7ecd('0x11c')](db[_0x7ecd('0x42')],{});db['FaxQueueReport'][_0x7ecd('0x11c')](db[_0x7ecd('0xf1')],{'as':_0x7ecd('0x168'),'foreignKey':'ListId'});db[_0x7ecd('0x4a')][_0x7ecd('0x11c')](db[_0x7ecd('0x6c')],{'as':_0x7ecd('0x15e'),'foreignKey':_0x7ecd('0x15f')});db[_0x7ecd('0x4a')]['belongsTo'](db['FaxInteraction'],{});db[_0x7ecd('0x4a')][_0x7ecd('0x11c')](db['FaxMessage'],{});db['FaxQueueReport'][_0x7ecd('0x11c')](db[_0x7ecd('0x14')],{});db[_0x7ecd('0x4a')]['belongsTo'](db['FaxQueue'],{});db[_0x7ecd('0x4c')]['hasMany'](db['Disposition'],{'as':_0x7ecd('0x164'),'foreignKey':_0x7ecd('0x185'),'onDelete':'cascade'});db[_0x7ecd('0x4c')][_0x7ecd('0x110')](db[_0x7ecd('0x7c')],{'as':_0x7ecd('0x165'),'foreignKey':_0x7ecd('0x185')});db[_0x7ecd('0x4c')][_0x7ecd('0x110')](db[_0x7ecd('0x52')],{'as':_0x7ecd('0x157'),'foreignKey':'SmsAccountId'});db[_0x7ecd('0x4c')]['hasMany'](db['SmsInteraction'],{'as':_0x7ecd('0x166')});db[_0x7ecd('0x4c')]['hasMany'](db[_0x7ecd('0x4e')],{'as':_0x7ecd('0x144')});db[_0x7ecd('0x4c')][_0x7ecd('0x11c')](db[_0x7ecd('0xf1')],{'as':_0x7ecd('0x168'),'foreignKey':_0x7ecd('0x169')});db[_0x7ecd('0x4c')][_0x7ecd('0x11c')](db['Pause'],{'as':_0x7ecd('0x152'),'foreignKey':_0x7ecd('0x153')});db[_0x7ecd('0x4c')][_0x7ecd('0x11f')](db[_0x7ecd('0x14')],{'as':_0x7ecd('0x16b'),'through':'user_has_sms_accounts'});db[_0x7ecd('0x4e')][_0x7ecd('0x11c')](db[_0x7ecd('0x14')],{'onDelete':_0x7ecd('0x175')});db[_0x7ecd('0x4e')][_0x7ecd('0x11c')](db[_0x7ecd('0x131')],{'onDelete':_0x7ecd('0x175')});db[_0x7ecd('0x4e')][_0x7ecd('0x11c')](db['SmsAccount'],{'onDelete':_0x7ecd('0x175')});db[_0x7ecd('0x4e')][_0x7ecd('0x11c')](db[_0x7ecd('0x150')],{'onDelete':_0x7ecd('0x175'),'foreignKey':_0x7ecd('0x151')});db[_0x7ecd('0x4e')]['belongsTo'](db[_0x7ecd('0x170')],{'onDelete':_0x7ecd('0x175'),'foreignKey':_0x7ecd('0x17d')});db[_0x7ecd('0x50')]['hasMany'](db[_0x7ecd('0x52')],{'as':'Messages','onDelete':_0x7ecd('0x113'),'foreignKey':_0x7ecd('0x186')});db['SmsInteraction'][_0x7ecd('0x11c')](db['SmsAccount'],{'as':'Account','foreignKey':'SmsAccountId'});db[_0x7ecd('0x50')][_0x7ecd('0x11c')](db[_0x7ecd('0x6c')],{'as':'Contact','foreignKey':_0x7ecd('0x15f')});db[_0x7ecd('0x50')][_0x7ecd('0x11c')](db[_0x7ecd('0x14')],{'as':'Owner','foreignKey':'UserId'});db['SmsInteraction'][_0x7ecd('0x11f')](db[_0x7ecd('0x170')],{'through':_0x7ecd('0x187'),'as':_0x7ecd('0x180')});db['SmsInteraction'][_0x7ecd('0x11f')](db[_0x7ecd('0x170')],{'through':_0x7ecd('0x187'),'as':_0x7ecd('0x172')});db[_0x7ecd('0x50')][_0x7ecd('0x11f')](db[_0x7ecd('0x14')],{'as':_0x7ecd('0x181'),'through':_0x7ecd('0x12b'),'foreignKey':_0x7ecd('0x186')});db[_0x7ecd('0x52')][_0x7ecd('0x11c')](db[_0x7ecd('0x14')],{'as':_0x7ecd('0x14')});db[_0x7ecd('0x52')][_0x7ecd('0x11c')](db[_0x7ecd('0x6c')],{'onDelete':_0x7ecd('0x113'),'as':'Contact'});db[_0x7ecd('0x52')][_0x7ecd('0x11c')](db['SmsInteraction'],{'onDelete':_0x7ecd('0x113'),'as':'Interaction','foreignKey':_0x7ecd('0x186')});db[_0x7ecd('0x52')]['belongsTo'](db['SmsAccount'],{'as':_0x7ecd('0x16e'),'foreignKey':'SmsAccountId'});db[_0x7ecd('0x131')][_0x7ecd('0x11f')](db[_0x7ecd('0x14')],{'as':'Agents','through':_0x7ecd('0x30'),'foreignKey':'SmsQueueId'});db[_0x7ecd('0x131')][_0x7ecd('0x11f')](db['Team'],{'through':_0x7ecd('0x188'),'as':'Teams'});db[_0x7ecd('0x55')]['hasMany'](db[_0x7ecd('0x163')],{'as':_0x7ecd('0x164'),'foreignKey':_0x7ecd('0x189'),'onDelete':_0x7ecd('0x113')});db['OpenchannelAccount'][_0x7ecd('0x110')](db['CannedAnswer'],{'as':_0x7ecd('0x165'),'foreignKey':_0x7ecd('0x189')});db[_0x7ecd('0x55')][_0x7ecd('0x110')](db['OpenchannelInteraction'],{'as':_0x7ecd('0x166'),'foreignKey':_0x7ecd('0x189')});db[_0x7ecd('0x55')][_0x7ecd('0x110')](db['OpenchannelMessage'],{'as':_0x7ecd('0x157'),'foreignKey':_0x7ecd('0x189')});db[_0x7ecd('0x55')][_0x7ecd('0x110')](db[_0x7ecd('0x57')],{'as':_0x7ecd('0x144'),'foreignKey':_0x7ecd('0x189')});db[_0x7ecd('0x55')][_0x7ecd('0x11c')](db['CmList'],{'as':_0x7ecd('0x168'),'foreignKey':'ListId'});db['OpenchannelAccount']['belongsTo'](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db[_0x7ecd('0x55')][_0x7ecd('0x11f')](db[_0x7ecd('0x14')],{'as':_0x7ecd('0x16b'),'through':_0x7ecd('0x18a')});db[_0x7ecd('0x57')][_0x7ecd('0x11c')](db[_0x7ecd('0x14')],{'onDelete':_0x7ecd('0x175')});db[_0x7ecd('0x57')][_0x7ecd('0x11c')](db[_0x7ecd('0x133')],{'onDelete':_0x7ecd('0x175'),'foreignKey':_0x7ecd('0x18b')});db[_0x7ecd('0x57')][_0x7ecd('0x11c')](db[_0x7ecd('0x55')],{'onDelete':_0x7ecd('0x175'),'foreignKey':_0x7ecd('0x189')});db[_0x7ecd('0x57')][_0x7ecd('0x11c')](db[_0x7ecd('0x150')],{'onDelete':_0x7ecd('0x175'),'foreignKey':'IntervalId'});db[_0x7ecd('0x57')][_0x7ecd('0x11c')](db[_0x7ecd('0x170')],{'onDelete':_0x7ecd('0x175'),'foreignKey':_0x7ecd('0x17d')});db['OpenchannelInteraction'][_0x7ecd('0x110')](db[_0x7ecd('0x5b')],{'as':'Messages','onDelete':'cascade','foreignKey':_0x7ecd('0x18c')});db['OpenchannelInteraction'][_0x7ecd('0x11c')](db[_0x7ecd('0x55')],{'as':'Account','foreignKey':_0x7ecd('0x189')});db[_0x7ecd('0x59')][_0x7ecd('0x11c')](db['CmContact'],{'as':_0x7ecd('0x15e'),'foreignKey':_0x7ecd('0x15f')});db[_0x7ecd('0x59')][_0x7ecd('0x11c')](db[_0x7ecd('0x14')],{'as':_0x7ecd('0x16f'),'foreignKey':_0x7ecd('0x10f')});db['OpenchannelInteraction'][_0x7ecd('0x11f')](db['Tag'],{'through':_0x7ecd('0x18d'),'as':'Tags'});db[_0x7ecd('0x59')][_0x7ecd('0x11f')](db[_0x7ecd('0x170')],{'through':'openchannel_interaction_has_tags','as':_0x7ecd('0x172')});db[_0x7ecd('0x59')][_0x7ecd('0x11f')](db['User'],{'as':_0x7ecd('0x181'),'through':'user_has_openchannel_interactions','foreignKey':_0x7ecd('0x18c')});db[_0x7ecd('0x5b')][_0x7ecd('0x11c')](db['User'],{'onDelete':_0x7ecd('0x113'),'as':_0x7ecd('0x14')});db[_0x7ecd('0x5b')][_0x7ecd('0x11c')](db[_0x7ecd('0x6c')],{'onDelete':'cascade','as':_0x7ecd('0x15e')});db['OpenchannelMessage'][_0x7ecd('0x11c')](db[_0x7ecd('0x59')],{'onDelete':_0x7ecd('0x113'),'as':_0x7ecd('0x173'),'foreignKey':'OpenchannelInteractionId'});db[_0x7ecd('0x5b')][_0x7ecd('0x11c')](db[_0x7ecd('0xe8')],{'as':_0x7ecd('0xe8'),'foreignKey':'AttachmentId'});db[_0x7ecd('0x5b')][_0x7ecd('0x11c')](db['OpenchannelAccount'],{'as':_0x7ecd('0x16e'),'foreignKey':_0x7ecd('0x189')});db[_0x7ecd('0x133')][_0x7ecd('0x11f')](db[_0x7ecd('0x14')],{'as':_0x7ecd('0x16b'),'through':_0x7ecd('0x32'),'foreignKey':_0x7ecd('0x18b')});db['OpenchannelQueue'][_0x7ecd('0x11f')](db[_0x7ecd('0xe0')],{'through':_0x7ecd('0x18e'),'as':_0x7ecd('0x155')});db[_0x7ecd('0x5c')][_0x7ecd('0x110')](db[_0x7ecd('0x163')],{'as':_0x7ecd('0x164'),'foreignKey':_0x7ecd('0x18f'),'onDelete':_0x7ecd('0x113')});db['ChatWebsite'][_0x7ecd('0x110')](db['CannedAnswer'],{'as':_0x7ecd('0x165'),'foreignKey':_0x7ecd('0x18f')});db[_0x7ecd('0x5c')][_0x7ecd('0x110')](db[_0x7ecd('0x6b')],{'as':_0x7ecd('0x190')});db[_0x7ecd('0x5c')][_0x7ecd('0x110')](db['ChatInteraction'],{'as':_0x7ecd('0x166')});db[_0x7ecd('0x5c')][_0x7ecd('0x110')](db[_0x7ecd('0x60')],{'as':'Applications'});db[_0x7ecd('0x5c')]['hasMany'](db[_0x7ecd('0x64')],{'as':_0x7ecd('0x157')});db[_0x7ecd('0x5c')][_0x7ecd('0x11c')](db[_0x7ecd('0xf1')],{'as':'List','foreignKey':_0x7ecd('0x169')});db['ChatWebsite'][_0x7ecd('0x11c')](db[_0x7ecd('0x150')],{'as':_0x7ecd('0x150'),'foreignKey':_0x7ecd('0x151')});db[_0x7ecd('0x5c')]['belongsTo'](db['MailAccount'],{'as':_0x7ecd('0x139'),'foreignKey':_0x7ecd('0x160')});db['ChatWebsite'][_0x7ecd('0x11c')](db[_0x7ecd('0x80')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db[_0x7ecd('0x5c')]['belongsToMany'](db['User'],{'as':_0x7ecd('0x16b'),'through':'user_has_chat_websites'});db[_0x7ecd('0x5e')][_0x7ecd('0x11c')](db[_0x7ecd('0x55')],{});db[_0x7ecd('0x5e')][_0x7ecd('0x11c')](db[_0x7ecd('0xf1')],{'as':_0x7ecd('0x168'),'foreignKey':_0x7ecd('0x169')});db[_0x7ecd('0x5e')]['belongsTo'](db[_0x7ecd('0x6c')],{'as':_0x7ecd('0x15e'),'foreignKey':_0x7ecd('0x15f')});db[_0x7ecd('0x5e')][_0x7ecd('0x11c')](db[_0x7ecd('0x59')],{});db[_0x7ecd('0x5e')]['belongsTo'](db[_0x7ecd('0x5b')],{});db['OpenchannelQueueReport'][_0x7ecd('0x11c')](db[_0x7ecd('0x14')],{});db[_0x7ecd('0x5e')][_0x7ecd('0x11c')](db['OpenchannelQueue'],{});db[_0x7ecd('0x60')][_0x7ecd('0x11c')](db[_0x7ecd('0x14')],{'as':'Agent','foreignKey':_0x7ecd('0x10f'),'onDelete':_0x7ecd('0x175')});db['ChatApplication'][_0x7ecd('0x11c')](db[_0x7ecd('0x67')],{'as':'Queue','foreignKey':_0x7ecd('0x191'),'onDelete':_0x7ecd('0x175')});db['ChatApplication'][_0x7ecd('0x11c')](db[_0x7ecd('0x5c')],{'as':_0x7ecd('0x192'),'foreignKey':_0x7ecd('0x18f'),'onDelete':'restrict'});db[_0x7ecd('0x60')][_0x7ecd('0x11c')](db['Tag'],{'onDelete':'restrict','foreignKey':_0x7ecd('0x17d')});db[_0x7ecd('0x62')][_0x7ecd('0x110')](db[_0x7ecd('0x64')],{'as':_0x7ecd('0x157'),'onDelete':'cascade','foreignKey':_0x7ecd('0x193')});db[_0x7ecd('0x62')]['belongsTo'](db[_0x7ecd('0x5c')],{'as':_0x7ecd('0x16e'),'foreignKey':'ChatWebsiteId'});db[_0x7ecd('0x62')][_0x7ecd('0x11c')](db[_0x7ecd('0x6c')],{'as':_0x7ecd('0x15e'),'foreignKey':_0x7ecd('0x15f')});db[_0x7ecd('0x62')][_0x7ecd('0x11c')](db[_0x7ecd('0x14')],{'as':_0x7ecd('0x16f'),'foreignKey':_0x7ecd('0x10f')});db[_0x7ecd('0x62')]['belongsToMany'](db[_0x7ecd('0x170')],{'through':_0x7ecd('0x194'),'as':_0x7ecd('0x180')});db[_0x7ecd('0x62')][_0x7ecd('0x11f')](db[_0x7ecd('0x170')],{'through':_0x7ecd('0x194'),'as':_0x7ecd('0x172')});db[_0x7ecd('0x62')]['belongsToMany'](db[_0x7ecd('0x14')],{'as':_0x7ecd('0x181'),'through':'user_has_chat_interactions','foreignKey':_0x7ecd('0x193')});db[_0x7ecd('0x64')][_0x7ecd('0x11c')](db[_0x7ecd('0x14')],{'onDelete':_0x7ecd('0x113'),'as':_0x7ecd('0x14')});db[_0x7ecd('0x64')]['belongsTo'](db['CmContact'],{'onDelete':_0x7ecd('0x113'),'as':_0x7ecd('0x15e'),'foreignKey':_0x7ecd('0x15f')});db[_0x7ecd('0x64')]['belongsTo'](db[_0x7ecd('0x62')],{'onDelete':_0x7ecd('0x113'),'as':'Interaction','foreignKey':_0x7ecd('0x193')});db['ChatMessage'][_0x7ecd('0x11c')](db[_0x7ecd('0xe8')],{'as':_0x7ecd('0xe8'),'foreignKey':_0x7ecd('0x182')});db[_0x7ecd('0x64')][_0x7ecd('0x11c')](db['ChatWebsite'],{'as':_0x7ecd('0x16e'),'foreignKey':_0x7ecd('0x18f')});db[_0x7ecd('0x66')][_0x7ecd('0x110')](db[_0x7ecd('0xe8')],{'as':'Attachments','foreignKey':_0x7ecd('0x174'),'onDelete':'cascade','hooks':!![]});db[_0x7ecd('0x66')][_0x7ecd('0x11c')](db[_0x7ecd('0x6c')],{'onDelete':_0x7ecd('0x113'),'as':_0x7ecd('0x15e'),'foreignKey':_0x7ecd('0x15f')});db[_0x7ecd('0x66')]['belongsTo'](db[_0x7ecd('0x5c')],{'as':_0x7ecd('0x16e'),'foreignKey':'ChatWebsiteId'});db[_0x7ecd('0x67')][_0x7ecd('0x11f')](db[_0x7ecd('0x14')],{'as':'Agents','through':'UserChatQueue','hooks':!![]});db['ChatQueue'][_0x7ecd('0x11f')](db[_0x7ecd('0xe0')],{'through':_0x7ecd('0x195'),'as':'Teams'});db['ChatGroup']['hasMany'](db[_0x7ecd('0xcc')],{'as':_0x7ecd('0x157'),'foreignKey':_0x7ecd('0x196'),'onDelete':'cascade'});db[_0x7ecd('0x69')]['belongsToMany'](db[_0x7ecd('0x14')],{'as':_0x7ecd('0x197'),'through':'chat_group_has_users'});db[_0x7ecd('0x6b')][_0x7ecd('0x11c')](db[_0x7ecd('0x5c')],{'as':_0x7ecd('0x192'),'foreignKey':_0x7ecd('0x18f')});db['CmCompany'][_0x7ecd('0x110')](db['CmContact'],{'as':_0x7ecd('0x120'),'foreignKey':_0x7ecd('0x198')});db[_0x7ecd('0x6c')][_0x7ecd('0x110')](db[_0x7ecd('0x6e')],{'as':_0x7ecd('0x148'),'foreignKey':_0x7ecd('0x15f')});db['CmContact'][_0x7ecd('0x110')](db[_0x7ecd('0x114')],{'as':_0x7ecd('0x115'),'foreignKey':_0x7ecd('0x15f')});db[_0x7ecd('0x6c')][_0x7ecd('0x110')](db[_0x7ecd('0x73')],{'as':_0x7ecd('0x149'),'foreignKey':_0x7ecd('0x15f')});db[_0x7ecd('0x6c')][_0x7ecd('0x110')](db[_0x7ecd('0x75')],{'as':_0x7ecd('0x75'),'foreignKey':_0x7ecd('0x15f')});db[_0x7ecd('0x6c')]['hasMany'](db[_0x7ecd('0x14b')],{'as':'JscriptySessions','foreignKey':'ContactId'});db[_0x7ecd('0x6c')]['hasMany'](db[_0x7ecd('0x59')],{'as':_0x7ecd('0x199'),'foreignKey':_0x7ecd('0x15f'),'onDelete':_0x7ecd('0x175')});db['CmContact'][_0x7ecd('0x110')](db['ChatInteraction'],{'as':_0x7ecd('0x117'),'foreignKey':'ContactId','onDelete':'restrict'});db[_0x7ecd('0x6c')]['hasMany'](db['SmsInteraction'],{'as':'SmsInteractions','foreignKey':'ContactId','onDelete':_0x7ecd('0x175')});db[_0x7ecd('0x6c')][_0x7ecd('0x110')](db[_0x7ecd('0x46')],{'as':_0x7ecd('0x118'),'foreignKey':_0x7ecd('0x15f'),'onDelete':_0x7ecd('0x175')});db[_0x7ecd('0x6c')][_0x7ecd('0x110')](db[_0x7ecd('0x125')],{'as':_0x7ecd('0x126'),'foreignKey':_0x7ecd('0x15f'),'onDelete':_0x7ecd('0x175')});db[_0x7ecd('0x6c')][_0x7ecd('0x11c')](db[_0x7ecd('0x19a')],{'as':_0x7ecd('0x19b'),'foreignKey':_0x7ecd('0x198')});db[_0x7ecd('0x6c')][_0x7ecd('0x11c')](db['CmList'],{'as':_0x7ecd('0x168'),'foreignKey':'ListId','onDelete':'cascade'});db[_0x7ecd('0x6c')][_0x7ecd('0x11f')](db[_0x7ecd('0x14')],{'as':_0x7ecd('0x181'),'through':'cm_user_has_contacts'});db[_0x7ecd('0x6c')][_0x7ecd('0x11f')](db[_0x7ecd('0x170')],{'as':_0x7ecd('0x180'),'through':_0x7ecd('0x19c')});db[_0x7ecd('0x6c')][_0x7ecd('0x11f')](db[_0x7ecd('0x170')],{'through':_0x7ecd('0x19c'),'as':_0x7ecd('0x172')});db[_0x7ecd('0x6e')][_0x7ecd('0x11c')](db[_0x7ecd('0x6c')],{'as':_0x7ecd('0x15e'),'foreignKey':_0x7ecd('0x15f'),'onDelete':_0x7ecd('0x113')});db['CmHopper']['belongsTo'](db[_0x7ecd('0xf1')],{'as':_0x7ecd('0x168'),'foreignKey':_0x7ecd('0x169'),'onDelete':'cascade'});db['CmHopper'][_0x7ecd('0x11c')](db[_0x7ecd('0x14')],{'as':_0x7ecd('0x19d'),'foreignKey':_0x7ecd('0x10f')});db[_0x7ecd('0x6e')][_0x7ecd('0x11c')](db['VoiceQueue'],{'as':'Queue','foreignKey':'VoiceQueueId','onDelete':_0x7ecd('0x113')});db[_0x7ecd('0x6e')][_0x7ecd('0x11c')](db[_0x7ecd('0xe4')],{'as':_0x7ecd('0xe4'),'foreignKey':'CampaignId','onDelete':_0x7ecd('0x113')});db[_0x7ecd('0x6e')][_0x7ecd('0x11c')](db[_0x7ecd('0x14')],{'as':'Owner','foreignKey':_0x7ecd('0x19e')});db['CmHopperBlack'][_0x7ecd('0x11c')](db[_0x7ecd('0x6c')],{'as':'Contact','foreignKey':_0x7ecd('0x15f'),'onDelete':_0x7ecd('0x113')});db['CmHopperBlack'][_0x7ecd('0x11c')](db['CmList'],{'as':_0x7ecd('0x168'),'foreignKey':_0x7ecd('0x169'),'onDelete':'cascade'});db['CmHopperBlack'][_0x7ecd('0x11c')](db[_0x7ecd('0x1d')],{'as':_0x7ecd('0x19f'),'foreignKey':_0x7ecd('0x147'),'onDelete':_0x7ecd('0x113')});db[_0x7ecd('0x70')][_0x7ecd('0x11c')](db[_0x7ecd('0xe4')],{'as':'Campaign','foreignKey':_0x7ecd('0x1a0'),'onDelete':_0x7ecd('0x113')});db[_0x7ecd('0x1a1')][_0x7ecd('0x110')](db[_0x7ecd('0x7e')],{'as':{'plural':_0x7ecd('0x1a2'),'singular':'OneAll'},'foreignKey':'AutomationAllId','onDelete':_0x7ecd('0x113'),'hooks':!![]});db[_0x7ecd('0x1a1')][_0x7ecd('0x110')](db[_0x7ecd('0x7e')],{'as':{'plural':_0x7ecd('0x1a3'),'singular':'OneAny'},'foreignKey':_0x7ecd('0x1a4'),'onDelete':_0x7ecd('0x113'),'hooks':!![]});db[_0x7ecd('0x1a1')][_0x7ecd('0x110')](db[_0x7ecd('0x79')],{'as':_0x7ecd('0x1a5'),'foreignKey':_0x7ecd('0x1a6'),'onDelete':_0x7ecd('0x113'),'hooks':!![]});db['Disposition'][_0x7ecd('0x110')](db[_0x7ecd('0x163')],{'as':_0x7ecd('0x164'),'foreignKey':_0x7ecd('0x1a7'),'onDelete':_0x7ecd('0x113')});db[_0x7ecd('0x150')][_0x7ecd('0x110')](db[_0x7ecd('0x150')],{'as':_0x7ecd('0x1a8'),'foreignKey':_0x7ecd('0x151'),'onDelete':_0x7ecd('0x113'),'hooks':!![],'required':![]});db['Interval']['hasMany'](db[_0x7ecd('0x19')],{'as':_0x7ecd('0x1a9'),'foreignKey':_0x7ecd('0x151'),'onDelete':_0x7ecd('0x175')});db[_0x7ecd('0x150')]['hasMany'](db[_0x7ecd('0x167')],{'as':_0x7ecd('0x1aa'),'foreignKey':_0x7ecd('0x151')});db[_0x7ecd('0x150')][_0x7ecd('0x110')](db[_0x7ecd('0x60')],{'as':'ChatApplications','foreignKey':_0x7ecd('0x151')});db[_0x7ecd('0x150')][_0x7ecd('0x110')](db[_0x7ecd('0x44')],{'as':_0x7ecd('0x1ab'),'foreignKey':'IntervalId'});db['Interval'][_0x7ecd('0x110')](db['SmsApplication'],{'as':_0x7ecd('0x1ac'),'foreignKey':_0x7ecd('0x151')});db[_0x7ecd('0x85')][_0x7ecd('0x11c')](db['MailAccount'],{});db['Schedule'][_0x7ecd('0x11c')](db['AnalyticDefaultReport'],{'foreignKey':_0x7ecd('0x1ad')});db['Schedule'][_0x7ecd('0x11c')](db[_0x7ecd('0x8f')],{'foreignKey':'CustomReportId'});db['Sound'][_0x7ecd('0x11f')](db[_0x7ecd('0x1b')],{'as':_0x7ecd('0x1ae'),'through':_0x7ecd('0x146'),'onDelete':_0x7ecd('0x175')});db[_0x7ecd('0x170')][_0x7ecd('0x11f')](db[_0x7ecd('0x6c')],{'through':_0x7ecd('0x19c')});db[_0x7ecd('0x170')][_0x7ecd('0x11f')](db[_0x7ecd('0x62')],{'through':_0x7ecd('0x194')});db[_0x7ecd('0x170')][_0x7ecd('0x11f')](db[_0x7ecd('0x125')],{'through':_0x7ecd('0x171')});db[_0x7ecd('0x170')][_0x7ecd('0x11f')](db[_0x7ecd('0x50')],{'through':_0x7ecd('0x187')});db[_0x7ecd('0x170')][_0x7ecd('0x11f')](db[_0x7ecd('0x46')],{'through':_0x7ecd('0x17f')});db['Tag'][_0x7ecd('0x11f')](db[_0x7ecd('0x59')],{'through':'openchannel_interaction_has_tags'});db[_0x7ecd('0x170')]['belongsToMany'](db[_0x7ecd('0xff')],{'through':_0x7ecd('0x1af')});db['Trigger'][_0x7ecd('0x110')](db['Condition'],{'as':{'plural':_0x7ecd('0x1b0'),'singular':_0x7ecd('0x1b1')},'foreignKey':_0x7ecd('0x1b2'),'onDelete':_0x7ecd('0x113'),'hooks':!![]});db['Trigger'][_0x7ecd('0x110')](db[_0x7ecd('0x7e')],{'as':{'plural':_0x7ecd('0x1b3'),'singular':_0x7ecd('0x1b4')},'foreignKey':_0x7ecd('0x1b5'),'onDelete':_0x7ecd('0x113'),'hooks':!![]});db[_0x7ecd('0x8b')]['hasMany'](db[_0x7ecd('0x79')],{'as':'Actions','foreignKey':'TriggerId','onDelete':_0x7ecd('0x113'),'hooks':!![]});db[_0x7ecd('0x8f')][_0x7ecd('0x110')](db[_0x7ecd('0x93')],{'as':_0x7ecd('0x1b6'),'onDelete':_0x7ecd('0x113'),'foreignKey':_0x7ecd('0x1b7'),'hooks':!![]});db[_0x7ecd('0x90')][_0x7ecd('0x110')](db[_0x7ecd('0x93')],{'as':_0x7ecd('0x1b6'),'onDelete':_0x7ecd('0x113'),'foreignKey':_0x7ecd('0x1ad')});db[_0x7ecd('0x1b8')][_0x7ecd('0x110')](db['AnalyticFieldReport'],{'as':_0x7ecd('0x1b6'),'onDelete':'cascade','foreignKey':_0x7ecd('0x1b9')});db['AnalyticFieldReport'][_0x7ecd('0x11c')](db[_0x7ecd('0x1b8')],{'foreignKey':'MetricId'});db[_0x7ecd('0x96')][_0x7ecd('0x110')](db[_0x7ecd('0x97')],{'as':_0x7ecd('0x1ba'),'onDelete':_0x7ecd('0x113'),'foreignKey':_0x7ecd('0x1bb')});db[_0x7ecd('0x97')]['hasMany'](db['SalesforceField'],{'as':_0x7ecd('0x1bc'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0x7ecd('0x97')][_0x7ecd('0x110')](db['SalesforceField'],{'as':'Descriptions','onDelete':_0x7ecd('0x113'),'foreignKey':_0x7ecd('0x1bd')});db['SalesforceConfiguration'][_0x7ecd('0x110')](db[_0x7ecd('0x99')],{'as':_0x7ecd('0x1b6'),'onDelete':_0x7ecd('0x113'),'foreignKey':'FieldId'});db['SalesforceConfiguration'][_0x7ecd('0x11c')](db[_0x7ecd('0x96')],{'as':_0x7ecd('0x16e'),'foreignKey':_0x7ecd('0x1bb')});db['SalesforceField']['hasMany'](db['SalesforceField'],{'as':_0x7ecd('0x1be'),'foreignKey':'SubjectId'});db[_0x7ecd('0x99')][_0x7ecd('0x110')](db[_0x7ecd('0x99')],{'as':_0x7ecd('0x1bf'),'foreignKey':_0x7ecd('0x1bd')});db[_0x7ecd('0x99')]['hasMany'](db['SalesforceField'],{'as':_0x7ecd('0x1c0'),'foreignKey':_0x7ecd('0x1c1')});db[_0x7ecd('0x99')]['belongsTo'](db['Variable'],{'as':_0x7ecd('0x1c2'),'foreignKey':_0x7ecd('0x1c3')});db[_0x7ecd('0x9a')][_0x7ecd('0x110')](db[_0x7ecd('0x9b')],{'as':_0x7ecd('0x1ba'),'onDelete':'cascade','foreignKey':_0x7ecd('0x1bb')});db[_0x7ecd('0x9b')][_0x7ecd('0x110')](db[_0x7ecd('0x9c')],{'as':_0x7ecd('0x1bc'),'onDelete':'cascade','foreignKey':_0x7ecd('0x1c4')});db[_0x7ecd('0x9b')][_0x7ecd('0x110')](db[_0x7ecd('0x9c')],{'as':_0x7ecd('0x1c5'),'onDelete':_0x7ecd('0x113'),'foreignKey':'DescriptionId'});db[_0x7ecd('0x9b')][_0x7ecd('0x110')](db[_0x7ecd('0x9c')],{'as':_0x7ecd('0x1b6'),'onDelete':_0x7ecd('0x113'),'foreignKey':'FieldId'});db[_0x7ecd('0x9b')][_0x7ecd('0x11c')](db[_0x7ecd('0x9a')],{'as':_0x7ecd('0x16e'),'foreignKey':_0x7ecd('0x1bb')});db['SugarcrmField'][_0x7ecd('0x110')](db[_0x7ecd('0x9c')],{'as':'Subject','foreignKey':'SubjectId'});db[_0x7ecd('0x9c')][_0x7ecd('0x110')](db[_0x7ecd('0x9c')],{'as':_0x7ecd('0x1bf'),'foreignKey':'DescriptionId'});db[_0x7ecd('0x9c')][_0x7ecd('0x110')](db[_0x7ecd('0x9c')],{'as':'Field','foreignKey':_0x7ecd('0x1c1')});db[_0x7ecd('0x9c')][_0x7ecd('0x11c')](db[_0x7ecd('0x1c2')],{'as':_0x7ecd('0x1c2'),'foreignKey':_0x7ecd('0x1c3')});db[_0x7ecd('0x9e')][_0x7ecd('0x110')](db[_0x7ecd('0xa0')],{'as':_0x7ecd('0x1ba'),'onDelete':_0x7ecd('0x113'),'foreignKey':_0x7ecd('0x1bb')});db[_0x7ecd('0xa0')]['hasMany'](db[_0x7ecd('0xa2')],{'as':_0x7ecd('0x1bc'),'onDelete':'cascade','foreignKey':_0x7ecd('0x1c4')});db[_0x7ecd('0xa0')][_0x7ecd('0x110')](db[_0x7ecd('0xa2')],{'as':_0x7ecd('0x1c5'),'onDelete':_0x7ecd('0x113'),'foreignKey':_0x7ecd('0x1bd')});db[_0x7ecd('0xa0')]['hasMany'](db['DeskField'],{'as':_0x7ecd('0x1b6'),'onDelete':_0x7ecd('0x113'),'foreignKey':_0x7ecd('0x1c1')});db[_0x7ecd('0xa0')][_0x7ecd('0x11c')](db[_0x7ecd('0x9e')],{'as':_0x7ecd('0x16e'),'foreignKey':_0x7ecd('0x1bb')});db[_0x7ecd('0xa0')][_0x7ecd('0x11f')](db['Tag'],{'through':_0x7ecd('0x1c6')});db[_0x7ecd('0xa2')][_0x7ecd('0x110')](db[_0x7ecd('0xa2')],{'as':'Subject','foreignKey':_0x7ecd('0x1c4')});db['DeskField'][_0x7ecd('0x110')](db[_0x7ecd('0xa2')],{'as':_0x7ecd('0x1bf'),'foreignKey':_0x7ecd('0x1bd')});db[_0x7ecd('0xa2')][_0x7ecd('0x110')](db[_0x7ecd('0xa2')],{'as':_0x7ecd('0x1c0'),'foreignKey':'FieldId'});db['DeskField'][_0x7ecd('0x11c')](db[_0x7ecd('0x1c2')],{'as':_0x7ecd('0x1c2'),'foreignKey':_0x7ecd('0x1c3')});db[_0x7ecd('0xa4')][_0x7ecd('0x110')](db[_0x7ecd('0xa6')],{'as':_0x7ecd('0x1ba'),'onDelete':_0x7ecd('0x113'),'foreignKey':_0x7ecd('0x1bb')});db[_0x7ecd('0xa6')]['hasMany'](db[_0x7ecd('0xa8')],{'as':_0x7ecd('0x1bc'),'onDelete':'cascade','foreignKey':_0x7ecd('0x1c4')});db['ZohoConfiguration'][_0x7ecd('0x110')](db['ZohoField'],{'as':_0x7ecd('0x1c5'),'onDelete':_0x7ecd('0x113'),'foreignKey':_0x7ecd('0x1bd')});db[_0x7ecd('0xa6')]['hasMany'](db[_0x7ecd('0xa8')],{'as':_0x7ecd('0x1b6'),'onDelete':_0x7ecd('0x113'),'foreignKey':_0x7ecd('0x1c1')});db['ZohoConfiguration'][_0x7ecd('0x11c')](db[_0x7ecd('0xa4')],{'as':_0x7ecd('0x16e'),'foreignKey':_0x7ecd('0x1bb')});db[_0x7ecd('0xa8')][_0x7ecd('0x110')](db[_0x7ecd('0xa8')],{'as':'Subject','foreignKey':'SubjectId'});db['ZohoField'][_0x7ecd('0x110')](db[_0x7ecd('0xa8')],{'as':'Description','foreignKey':_0x7ecd('0x1bd')});db[_0x7ecd('0xa8')]['hasMany'](db[_0x7ecd('0xa8')],{'as':'Field','foreignKey':_0x7ecd('0x1c1')});db[_0x7ecd('0xa8')][_0x7ecd('0x11c')](db[_0x7ecd('0x1c2')],{'as':_0x7ecd('0x1c2'),'foreignKey':_0x7ecd('0x1c3')});db['ZendeskAccount'][_0x7ecd('0x110')](db['ZendeskConfiguration'],{'as':_0x7ecd('0x1ba'),'onDelete':_0x7ecd('0x113'),'foreignKey':_0x7ecd('0x1bb')});db[_0x7ecd('0xab')][_0x7ecd('0x110')](db[_0x7ecd('0xad')],{'as':_0x7ecd('0x1bc'),'foreignKey':_0x7ecd('0x1c4')});db['ZendeskConfiguration'][_0x7ecd('0x110')](db[_0x7ecd('0xad')],{'as':'Descriptions','foreignKey':_0x7ecd('0x1bd')});db[_0x7ecd('0xab')]['hasMany'](db['ZendeskField'],{'as':_0x7ecd('0x1b6'),'foreignKey':_0x7ecd('0x1c1')});db[_0x7ecd('0xab')]['belongsTo'](db[_0x7ecd('0xa9')],{'as':'Account','foreignKey':_0x7ecd('0x1bb')});db[_0x7ecd('0xab')][_0x7ecd('0x11f')](db['Tag'],{'through':_0x7ecd('0x1c7')});db['ZendeskField'][_0x7ecd('0x110')](db[_0x7ecd('0xad')],{'as':_0x7ecd('0x1be'),'foreignKey':'SubjectId'});db[_0x7ecd('0xad')][_0x7ecd('0x110')](db['ZendeskField'],{'as':_0x7ecd('0x1bf'),'foreignKey':_0x7ecd('0x1bd')});db[_0x7ecd('0xad')][_0x7ecd('0x110')](db[_0x7ecd('0xad')],{'as':_0x7ecd('0x1c0'),'foreignKey':_0x7ecd('0x1c1')});db[_0x7ecd('0xad')][_0x7ecd('0x11c')](db[_0x7ecd('0x1c2')],{'as':_0x7ecd('0x1c2'),'foreignKey':_0x7ecd('0x1c3')});db[_0x7ecd('0xaf')][_0x7ecd('0x110')](db[_0x7ecd('0xb1')],{'as':_0x7ecd('0x1ba'),'onDelete':_0x7ecd('0x113'),'foreignKey':_0x7ecd('0x1bb')});db[_0x7ecd('0xb1')]['hasMany'](db[_0x7ecd('0xb3')],{'as':_0x7ecd('0x1bc'),'onDelete':_0x7ecd('0x113'),'foreignKey':_0x7ecd('0x1c4')});db[_0x7ecd('0xb1')]['hasMany'](db['FreshdeskField'],{'as':'Descriptions','onDelete':'cascade','foreignKey':'DescriptionId'});db[_0x7ecd('0xb1')]['hasMany'](db[_0x7ecd('0xb3')],{'as':'Fields','onDelete':'cascade','foreignKey':_0x7ecd('0x1c1')});db[_0x7ecd('0xb1')][_0x7ecd('0x11c')](db[_0x7ecd('0xaf')],{'as':_0x7ecd('0x16e'),'foreignKey':_0x7ecd('0x1bb')});db[_0x7ecd('0xb1')][_0x7ecd('0x11f')](db[_0x7ecd('0x170')],{'through':'int_freshdesk_configuration_has_tags'});db[_0x7ecd('0xb3')][_0x7ecd('0x110')](db[_0x7ecd('0xb3')],{'as':_0x7ecd('0x1be'),'foreignKey':_0x7ecd('0x1c4')});db[_0x7ecd('0xb3')][_0x7ecd('0x110')](db[_0x7ecd('0xb3')],{'as':_0x7ecd('0x1bf'),'foreignKey':_0x7ecd('0x1bd')});db[_0x7ecd('0xb3')][_0x7ecd('0x110')](db[_0x7ecd('0xb3')],{'as':_0x7ecd('0x1c0'),'foreignKey':'FieldId'});db[_0x7ecd('0xb3')][_0x7ecd('0x11c')](db['Variable'],{'as':_0x7ecd('0x1c2'),'foreignKey':_0x7ecd('0x1c3')});db[_0x7ecd('0x1c8')]['hasMany'](db[_0x7ecd('0xb6')],{'as':_0x7ecd('0x1ba'),'onDelete':'cascade','foreignKey':'AccountId'});db['VtigerConfiguration'][_0x7ecd('0x110')](db[_0x7ecd('0xb7')],{'as':'Subjects','foreignKey':_0x7ecd('0x1c4')});db['VtigerConfiguration']['hasMany'](db[_0x7ecd('0xb7')],{'as':_0x7ecd('0x1c5'),'foreignKey':_0x7ecd('0x1bd')});db[_0x7ecd('0xb6')][_0x7ecd('0x110')](db[_0x7ecd('0xb7')],{'as':_0x7ecd('0x1b6'),'foreignKey':_0x7ecd('0x1c1')});db[_0x7ecd('0xb6')][_0x7ecd('0x11c')](db[_0x7ecd('0x1c8')],{'as':'Account','foreignKey':_0x7ecd('0x1bb')});db['VtigerField'][_0x7ecd('0x110')](db[_0x7ecd('0xb7')],{'as':_0x7ecd('0x1be'),'foreignKey':_0x7ecd('0x1c4')});db['VtigerField'][_0x7ecd('0x110')](db['VtigerField'],{'as':_0x7ecd('0x1bf'),'foreignKey':'DescriptionId'});db[_0x7ecd('0xb7')][_0x7ecd('0x110')](db[_0x7ecd('0xb7')],{'as':_0x7ecd('0x1c0'),'foreignKey':_0x7ecd('0x1c1')});db[_0x7ecd('0xb7')][_0x7ecd('0x11c')](db[_0x7ecd('0x1c2')],{'as':_0x7ecd('0x1c2'),'foreignKey':_0x7ecd('0x1c3')});db[_0x7ecd('0x1c9')]['hasMany'](db[_0x7ecd('0xba')],{'as':_0x7ecd('0x1ba'),'onDelete':_0x7ecd('0x113'),'foreignKey':'AccountId'});db['ServicenowConfiguration'][_0x7ecd('0x110')](db['ServicenowField'],{'as':'Subjects','foreignKey':'SubjectId'});db[_0x7ecd('0xba')]['hasMany'](db[_0x7ecd('0xbc')],{'as':_0x7ecd('0x1c5'),'foreignKey':_0x7ecd('0x1bd')});db[_0x7ecd('0xba')][_0x7ecd('0x110')](db['ServicenowField'],{'as':_0x7ecd('0x1b6'),'foreignKey':_0x7ecd('0x1c1')});db[_0x7ecd('0xba')][_0x7ecd('0x11c')](db[_0x7ecd('0x1c9')],{'as':_0x7ecd('0x16e'),'foreignKey':'AccountId'});db[_0x7ecd('0xbc')][_0x7ecd('0x110')](db[_0x7ecd('0xbc')],{'as':_0x7ecd('0x1be'),'foreignKey':_0x7ecd('0x1c4')});db[_0x7ecd('0xbc')][_0x7ecd('0x110')](db['ServicenowField'],{'as':_0x7ecd('0x1bf'),'foreignKey':_0x7ecd('0x1bd')});db[_0x7ecd('0xbc')][_0x7ecd('0x110')](db[_0x7ecd('0xbc')],{'as':_0x7ecd('0x1c0'),'foreignKey':'FieldId'});db[_0x7ecd('0xbc')]['belongsTo'](db[_0x7ecd('0x1c2')],{'as':_0x7ecd('0x1c2'),'foreignKey':_0x7ecd('0x1c3')});db['Dynamics365Account'][_0x7ecd('0x110')](db[_0x7ecd('0xc0')],{'as':_0x7ecd('0x1ba'),'onDelete':_0x7ecd('0x113'),'foreignKey':_0x7ecd('0x1bb')});db[_0x7ecd('0xc0')][_0x7ecd('0x110')](db['Dynamics365Field'],{'as':_0x7ecd('0x1bc'),'onDelete':_0x7ecd('0x113'),'foreignKey':'SubjectId'});db[_0x7ecd('0xc0')][_0x7ecd('0x110')](db[_0x7ecd('0xc2')],{'as':_0x7ecd('0x1c5'),'onDelete':_0x7ecd('0x113'),'foreignKey':_0x7ecd('0x1bd')});db[_0x7ecd('0xc0')][_0x7ecd('0x110')](db['Dynamics365Field'],{'as':'Fields','onDelete':_0x7ecd('0x113'),'foreignKey':_0x7ecd('0x1c1')});db[_0x7ecd('0xc0')][_0x7ecd('0x11c')](db[_0x7ecd('0xbe')],{'as':'Account','foreignKey':_0x7ecd('0x1bb')});db[_0x7ecd('0xc2')][_0x7ecd('0x110')](db[_0x7ecd('0xc2')],{'as':_0x7ecd('0x1be'),'foreignKey':'SubjectId'});db['Dynamics365Field'][_0x7ecd('0x110')](db[_0x7ecd('0xc2')],{'as':_0x7ecd('0x1bf'),'foreignKey':'DescriptionId'});db[_0x7ecd('0xc2')][_0x7ecd('0x110')](db['Dynamics365Field'],{'as':'Field','foreignKey':_0x7ecd('0x1c1')});db[_0x7ecd('0xc2')]['belongsTo'](db[_0x7ecd('0x1c2')],{'as':_0x7ecd('0x1c2'),'foreignKey':_0x7ecd('0x1c3')});db[_0x7ecd('0xc3')][_0x7ecd('0x110')](db[_0x7ecd('0xc5')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0x7ecd('0x1bb')});db['FreshsalesConfiguration'][_0x7ecd('0x110')](db[_0x7ecd('0xc7')],{'as':_0x7ecd('0x1bc'),'foreignKey':'SubjectId'});db[_0x7ecd('0xc5')][_0x7ecd('0x110')](db[_0x7ecd('0xc7')],{'as':_0x7ecd('0x1c5'),'foreignKey':_0x7ecd('0x1bd')});db[_0x7ecd('0xc5')][_0x7ecd('0x110')](db[_0x7ecd('0xc7')],{'as':'Fields','foreignKey':'FieldId'});db['FreshsalesConfiguration'][_0x7ecd('0x11c')](db['FreshsalesAccount'],{'as':'Account','foreignKey':'AccountId'});db[_0x7ecd('0xc7')][_0x7ecd('0x110')](db['FreshsalesField'],{'as':_0x7ecd('0x1be'),'foreignKey':_0x7ecd('0x1c4')});db[_0x7ecd('0xc7')][_0x7ecd('0x110')](db[_0x7ecd('0xc7')],{'as':_0x7ecd('0x1bf'),'foreignKey':_0x7ecd('0x1bd')});db[_0x7ecd('0xc7')][_0x7ecd('0x110')](db[_0x7ecd('0xc7')],{'as':_0x7ecd('0x1c0'),'foreignKey':_0x7ecd('0x1c1')});db['FreshsalesField'][_0x7ecd('0x11c')](db['Variable'],{'as':_0x7ecd('0x1c2'),'foreignKey':_0x7ecd('0x1c3')});db[_0x7ecd('0xcb')]['belongsTo'](db['ChatWebsite'],{});db['ChatQueueReport'][_0x7ecd('0x11c')](db[_0x7ecd('0xf1')],{'as':_0x7ecd('0x168'),'foreignKey':_0x7ecd('0x169')});db[_0x7ecd('0xcb')][_0x7ecd('0x11c')](db[_0x7ecd('0x6c')],{'as':_0x7ecd('0x15e'),'foreignKey':'ContactId'});db[_0x7ecd('0xcb')][_0x7ecd('0x11c')](db[_0x7ecd('0x62')],{});db[_0x7ecd('0xcb')][_0x7ecd('0x11c')](db[_0x7ecd('0x64')],{});db['ChatQueueReport']['belongsTo'](db[_0x7ecd('0x14')],{});db[_0x7ecd('0xcb')][_0x7ecd('0x11c')](db[_0x7ecd('0x67')],{});db['ChatInternalMessage'][_0x7ecd('0x11c')](db[_0x7ecd('0x14')],{'onDelete':'cascade','foreignKey':'FromId'});db[_0x7ecd('0xcc')][_0x7ecd('0x11c')](db['User'],{'onDelete':'cascade','foreignKey':_0x7ecd('0x1ca')});db[_0x7ecd('0x14b')]['hasMany'](db['JscriptyQuestionReport'],{'foreignKey':_0x7ecd('0x1cb'),'onDelete':_0x7ecd('0x113')});db[_0x7ecd('0x14b')][_0x7ecd('0x110')](db['JscriptyAnswerReport'],{'foreignKey':_0x7ecd('0x1cb'),'onDelete':_0x7ecd('0x113')});db[_0x7ecd('0xd2')][_0x7ecd('0x11c')](db['SmsAccount'],{});db['SmsQueueReport'][_0x7ecd('0x11c')](db['CmList'],{'as':'List','foreignKey':_0x7ecd('0x169')});db['SmsQueueReport'][_0x7ecd('0x11c')](db[_0x7ecd('0x6c')],{'as':_0x7ecd('0x15e'),'foreignKey':_0x7ecd('0x15f')});db[_0x7ecd('0xd2')][_0x7ecd('0x11c')](db[_0x7ecd('0x50')],{});db['SmsQueueReport'][_0x7ecd('0x11c')](db[_0x7ecd('0x52')],{});db[_0x7ecd('0xd2')][_0x7ecd('0x11c')](db[_0x7ecd('0x14')],{});db[_0x7ecd('0xd2')][_0x7ecd('0x11c')](db[_0x7ecd('0x131')],{});db[_0x7ecd('0xd6')][_0x7ecd('0x110')](db[_0x7ecd('0x14b')],{'foreignKey':'ProjectId'});db[_0x7ecd('0xd6')][_0x7ecd('0x110')](db[_0x7ecd('0x1cc')],{'foreignKey':_0x7ecd('0x1cd')});db[_0x7ecd('0xd6')][_0x7ecd('0x110')](db['JscriptyAnswerReport'],{'foreignKey':_0x7ecd('0x1cd')});db[_0x7ecd('0xdb')][_0x7ecd('0x11f')](db[_0x7ecd('0x14')],{'as':_0x7ecd('0x181'),'through':'user_has_square_projects'});db[_0x7ecd('0xe0')][_0x7ecd('0x11f')](db[_0x7ecd('0x14')],{'as':_0x7ecd('0x16b'),'through':_0x7ecd('0x124')});db[_0x7ecd('0xe0')][_0x7ecd('0x11f')](db[_0x7ecd('0x1d')],{'through':'TeamVoiceQueue','as':_0x7ecd('0x1ce')});db[_0x7ecd('0xe0')][_0x7ecd('0x11f')](db['MailQueue'],{'through':'team_has_mail_queues','as':_0x7ecd('0x12f')});db[_0x7ecd('0xe0')][_0x7ecd('0x11f')](db[_0x7ecd('0x67')],{'through':'team_has_chat_queues','as':_0x7ecd('0x130')});db['Team'][_0x7ecd('0x11f')](db[_0x7ecd('0x48')],{'through':_0x7ecd('0x184'),'as':_0x7ecd('0x1cf')});db[_0x7ecd('0xe0')][_0x7ecd('0x11f')](db[_0x7ecd('0x131')],{'through':_0x7ecd('0x188'),'as':_0x7ecd('0x132')});db[_0x7ecd('0xe0')][_0x7ecd('0x11f')](db[_0x7ecd('0x133')],{'through':'team_has_openchannel_queues','as':_0x7ecd('0x1d0')});db[_0x7ecd('0xe0')]['belongsToMany'](db[_0x7ecd('0x104')],{'through':_0x7ecd('0x1d1'),'as':_0x7ecd('0x134')});db[_0x7ecd('0xe0')][_0x7ecd('0x11f')](db[_0x7ecd('0xf3')],{'through':_0x7ecd('0x109'),'as':_0x7ecd('0x12e')});db[_0x7ecd('0xe4')][_0x7ecd('0x110')](db['CmHopper'],{'as':'Hoppers','foreignKey':'CampaignId'});db[_0x7ecd('0xe4')][_0x7ecd('0x110')](db[_0x7ecd('0x114')],{'as':_0x7ecd('0x115'),'foreignKey':_0x7ecd('0x1a0')});db['Campaign']['hasMany'](db[_0x7ecd('0x73')],{'as':_0x7ecd('0x149'),'foreignKey':_0x7ecd('0x1a0')});db[_0x7ecd('0xe4')]['hasMany'](db[_0x7ecd('0x70')],{'as':_0x7ecd('0x14a'),'foreignKey':'CampaignId'});db['Campaign']['belongsTo'](db[_0x7ecd('0x27')],{'as':'Trunk','foreignKey':'TrunkId'});db[_0x7ecd('0xe4')]['belongsTo'](db[_0x7ecd('0x27')],{'as':'TrunkBackup','foreignKey':_0x7ecd('0x14f')});db['Campaign'][_0x7ecd('0x11c')](db['Interval'],{'as':_0x7ecd('0x150'),'foreignKey':_0x7ecd('0x151')});db[_0x7ecd('0xe4')][_0x7ecd('0x11c')](db[_0x7ecd('0xdb')],{'as':_0x7ecd('0xdb'),'foreignKey':_0x7ecd('0x1d2')});db[_0x7ecd('0xe4')]['belongsToMany'](db['CmList'],{'as':_0x7ecd('0x122'),'through':'campaigns_has_cm_lists'});db[_0x7ecd('0xe4')][_0x7ecd('0x11f')](db[_0x7ecd('0xf1')],{'as':_0x7ecd('0x1d3'),'through':'campaigns_has_cm_blacklists'});db['Attachment'][_0x7ecd('0x11c')](db[_0x7ecd('0x66')],{'as':_0x7ecd('0x66'),'foreignKey':_0x7ecd('0x174')});db[_0x7ecd('0xea')][_0x7ecd('0x11c')](db[_0x7ecd('0x3d')],{});db[_0x7ecd('0xea')][_0x7ecd('0x11c')](db[_0x7ecd('0x125')],{});db[_0x7ecd('0xea')][_0x7ecd('0x11c')](db[_0x7ecd('0x139')],{'foreignKey':'FromMailAccountId','as':_0x7ecd('0x1d4')});db[_0x7ecd('0xea')]['belongsTo'](db[_0x7ecd('0x14')],{'foreignKey':_0x7ecd('0x1d5'),'as':'FromAgent'});db[_0x7ecd('0xea')][_0x7ecd('0x11c')](db[_0x7ecd('0x14')],{'foreignKey':_0x7ecd('0x1d6'),'as':'ToAgent'});db['MailTransferReport']['belongsTo'](db[_0x7ecd('0x3a')],{'foreignKey':_0x7ecd('0x1d7'),'as':'ToQueue'});db[_0x7ecd('0xea')][_0x7ecd('0x11c')](db['MailAccount'],{'foreignKey':_0x7ecd('0x1d8'),'as':_0x7ecd('0x1d9')});db[_0x7ecd('0xeb')][_0x7ecd('0x11c')](db[_0x7ecd('0x64')],{});db[_0x7ecd('0xeb')][_0x7ecd('0x11c')](db[_0x7ecd('0x62')],{});db['ChatTransferReport'][_0x7ecd('0x11c')](db[_0x7ecd('0x5c')],{'foreignKey':_0x7ecd('0x1da'),'as':_0x7ecd('0x1d4')});db['ChatTransferReport'][_0x7ecd('0x11c')](db[_0x7ecd('0x14')],{'foreignKey':'FromUserId','as':_0x7ecd('0x1db')});db[_0x7ecd('0xeb')][_0x7ecd('0x11c')](db[_0x7ecd('0x14')],{'foreignKey':'ToUserId','as':_0x7ecd('0x1dc')});db[_0x7ecd('0xeb')][_0x7ecd('0x11c')](db[_0x7ecd('0x67')],{'foreignKey':_0x7ecd('0x1dd'),'as':_0x7ecd('0x1de')});db[_0x7ecd('0xeb')][_0x7ecd('0x11c')](db['ChatWebsite'],{'foreignKey':_0x7ecd('0x1df'),'as':_0x7ecd('0x1d9')});db[_0x7ecd('0x1e0')]['belongsTo'](db[_0x7ecd('0x17b')],{});db[_0x7ecd('0x1e0')][_0x7ecd('0x11c')](db['FaxInteraction'],{});db[_0x7ecd('0x1e0')][_0x7ecd('0x11c')](db[_0x7ecd('0x42')],{'foreignKey':'FromFaxAccountId','as':_0x7ecd('0x1d4')});db[_0x7ecd('0x1e0')]['belongsTo'](db[_0x7ecd('0x14')],{'foreignKey':_0x7ecd('0x1d5'),'as':_0x7ecd('0x1db')});db[_0x7ecd('0x1e0')][_0x7ecd('0x11c')](db['User'],{'foreignKey':'ToUserId','as':_0x7ecd('0x1dc')});db[_0x7ecd('0x1e0')][_0x7ecd('0x11c')](db[_0x7ecd('0x48')],{'foreignKey':_0x7ecd('0x1e1'),'as':_0x7ecd('0x1de')});db[_0x7ecd('0x1e0')]['belongsTo'](db[_0x7ecd('0x42')],{'foreignKey':_0x7ecd('0x1e2'),'as':_0x7ecd('0x1d9')});db[_0x7ecd('0xed')]['belongsTo'](db['OpenchannelMessage'],{});db[_0x7ecd('0xed')]['belongsTo'](db['OpenchannelInteraction'],{});db[_0x7ecd('0xed')]['belongsTo'](db[_0x7ecd('0x55')],{'foreignKey':_0x7ecd('0x1e3'),'as':_0x7ecd('0x1d4')});db[_0x7ecd('0xed')][_0x7ecd('0x11c')](db['User'],{'foreignKey':_0x7ecd('0x1d5'),'as':'FromAgent'});db[_0x7ecd('0xed')][_0x7ecd('0x11c')](db[_0x7ecd('0x14')],{'foreignKey':_0x7ecd('0x1d6'),'as':_0x7ecd('0x1dc')});db[_0x7ecd('0xed')][_0x7ecd('0x11c')](db[_0x7ecd('0x133')],{'foreignKey':'ToOpenchannelQueueId','as':'ToQueue'});db[_0x7ecd('0xed')][_0x7ecd('0x11c')](db[_0x7ecd('0x55')],{'foreignKey':_0x7ecd('0x1e4'),'as':'ToAccount'});db[_0x7ecd('0xef')]['belongsTo'](db[_0x7ecd('0x52')],{});db['SmsTransferReport'][_0x7ecd('0x11c')](db['SmsInteraction'],{});db[_0x7ecd('0xef')][_0x7ecd('0x11c')](db[_0x7ecd('0x4c')],{'foreignKey':'FromSmsAccountId','as':_0x7ecd('0x1d4')});db[_0x7ecd('0xef')]['belongsTo'](db[_0x7ecd('0x14')],{'foreignKey':_0x7ecd('0x1d5'),'as':_0x7ecd('0x1db')});db['SmsTransferReport']['belongsTo'](db[_0x7ecd('0x14')],{'foreignKey':_0x7ecd('0x1d6'),'as':_0x7ecd('0x1dc')});db[_0x7ecd('0xef')][_0x7ecd('0x11c')](db[_0x7ecd('0x131')],{'foreignKey':'ToSmsQueueId','as':_0x7ecd('0x1de')});db['SmsTransferReport']['belongsTo'](db['SmsAccount'],{'foreignKey':_0x7ecd('0x1e5'),'as':'ToAccount'});db['CmList'][_0x7ecd('0x110')](db[_0x7ecd('0x163')],{'as':_0x7ecd('0x164'),'foreignKey':_0x7ecd('0x169'),'onDelete':'cascade'});db[_0x7ecd('0xf1')]['hasMany'](db[_0x7ecd('0x77')],{'as':_0x7ecd('0x1e6'),'foreignKey':'ListId'});db[_0x7ecd('0xf1')][_0x7ecd('0x110')](db[_0x7ecd('0x6c')],{'as':_0x7ecd('0x120'),'onDelete':'cascade','foreignKey':_0x7ecd('0x169')});db['CmList'][_0x7ecd('0x110')](db[_0x7ecd('0x114')],{'as':_0x7ecd('0x115'),'foreignKey':_0x7ecd('0x169')});db[_0x7ecd('0xf1')][_0x7ecd('0x110')](db['CmHopperHistory'],{'as':_0x7ecd('0x116'),'foreignKey':_0x7ecd('0x169')});db[_0x7ecd('0xf1')]['hasMany'](db[_0x7ecd('0x75')],{'as':_0x7ecd('0x75'),'foreignKey':_0x7ecd('0x169')});db[_0x7ecd('0xf1')][_0x7ecd('0x11f')](db[_0x7ecd('0x1d')],{'as':_0x7ecd('0x1e7'),'through':_0x7ecd('0x154')});db[_0x7ecd('0xf1')][_0x7ecd('0x11f')](db[_0x7ecd('0x14')],{'as':_0x7ecd('0x16b'),'through':_0x7ecd('0x123')});db[_0x7ecd('0xf3')][_0x7ecd('0x110')](db[_0x7ecd('0x19')],{'as':_0x7ecd('0x1a9'),'onDelete':_0x7ecd('0x113')});db[_0x7ecd('0xf3')]['belongsToMany'](db[_0x7ecd('0x14')],{'as':'Agents','through':_0x7ecd('0x10b')});db[_0x7ecd('0xf3')][_0x7ecd('0x11f')](db[_0x7ecd('0xe0')],{'through':_0x7ecd('0x109'),'as':_0x7ecd('0x155')});db[_0x7ecd('0xf5')]['hasMany'](db['User'],{'as':_0x7ecd('0x181'),'foreignKey':_0x7ecd('0x1e8')});db[_0x7ecd('0xf5')][_0x7ecd('0x110')](db[_0x7ecd('0xf6')],{'as':_0x7ecd('0x1e9'),'foreignKey':'userProfileId','onDelete':'cascade'});db[_0x7ecd('0xf6')][_0x7ecd('0x110')](db['UserProfileResource'],{'as':'Resources','foreignKey':_0x7ecd('0x1ea'),'onDelete':'cascade'});db['WhatsappAccount'][_0x7ecd('0x110')](db['Disposition'],{'as':_0x7ecd('0x164'),'foreignKey':_0x7ecd('0x1eb'),'onDelete':_0x7ecd('0x113')});db['WhatsappAccount']['hasMany'](db[_0x7ecd('0x7c')],{'as':_0x7ecd('0x165'),'foreignKey':'WhatsappAccountId'});db[_0x7ecd('0xfb')][_0x7ecd('0x110')](db[_0x7ecd('0x1ec')],{'as':_0x7ecd('0x157'),'foreignKey':_0x7ecd('0x1eb')});db[_0x7ecd('0xfb')]['hasMany'](db[_0x7ecd('0xff')],{'as':_0x7ecd('0x166')});db['WhatsappAccount']['hasMany'](db[_0x7ecd('0xfd')],{'as':_0x7ecd('0x144')});db[_0x7ecd('0xfb')][_0x7ecd('0x11c')](db[_0x7ecd('0xf1')],{'as':_0x7ecd('0x168'),'foreignKey':_0x7ecd('0x169')});db[_0x7ecd('0xfb')][_0x7ecd('0x11c')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x7ecd('0x153')});db[_0x7ecd('0xfb')][_0x7ecd('0x11f')](db[_0x7ecd('0x14')],{'as':_0x7ecd('0x16b'),'through':_0x7ecd('0x13e')});db[_0x7ecd('0xfd')][_0x7ecd('0x11c')](db['User'],{'onDelete':_0x7ecd('0x175')});db[_0x7ecd('0xfd')][_0x7ecd('0x11c')](db[_0x7ecd('0x104')],{'onDelete':_0x7ecd('0x175')});db[_0x7ecd('0xfd')]['belongsTo'](db['WhatsappAccount'],{'onDelete':'restrict'});db[_0x7ecd('0xfd')][_0x7ecd('0x11c')](db[_0x7ecd('0x150')],{'onDelete':'restrict','foreignKey':_0x7ecd('0x151')});db[_0x7ecd('0xfd')][_0x7ecd('0x11c')](db['Tag'],{'onDelete':'restrict','foreignKey':_0x7ecd('0x17d')});db[_0x7ecd('0xff')][_0x7ecd('0x110')](db['WhatsappMessage'],{'as':_0x7ecd('0x157'),'onDelete':_0x7ecd('0x113'),'foreignKey':'WhatsappInteractionId'});db[_0x7ecd('0xff')][_0x7ecd('0x11c')](db[_0x7ecd('0xfb')],{'as':_0x7ecd('0x16e'),'foreignKey':_0x7ecd('0x1eb')});db['WhatsappInteraction'][_0x7ecd('0x11c')](db[_0x7ecd('0x6c')],{'as':'Contact','foreignKey':_0x7ecd('0x15f')});db[_0x7ecd('0xff')][_0x7ecd('0x11c')](db['User'],{'as':'Owner','foreignKey':_0x7ecd('0x10f')});db[_0x7ecd('0xff')]['belongsToMany'](db['Tag'],{'through':'whatsapp_interaction_has_tags','as':_0x7ecd('0x180')});db[_0x7ecd('0xff')][_0x7ecd('0x11f')](db['Tag'],{'through':'whatsapp_interaction_has_tags','as':'ThroughTags'});db['WhatsappInteraction'][_0x7ecd('0x11f')](db['User'],{'as':_0x7ecd('0x181'),'through':_0x7ecd('0x12d'),'foreignKey':_0x7ecd('0x1ed')});db[_0x7ecd('0x1ec')][_0x7ecd('0x11c')](db[_0x7ecd('0x14')],{'as':_0x7ecd('0x14')});db[_0x7ecd('0x1ec')][_0x7ecd('0x11c')](db[_0x7ecd('0x6c')],{'onDelete':'cascade','as':_0x7ecd('0x15e')});db['WhatsappMessage']['belongsTo'](db['WhatsappInteraction'],{'onDelete':_0x7ecd('0x113'),'as':_0x7ecd('0x173'),'foreignKey':'WhatsappInteractionId'});db[_0x7ecd('0x1ec')][_0x7ecd('0x11c')](db['WhatsappAccount'],{'as':_0x7ecd('0x16e'),'foreignKey':_0x7ecd('0x1eb')});db[_0x7ecd('0x1ee')][_0x7ecd('0x11c')](db[_0x7ecd('0xfb')],{});db[_0x7ecd('0x1ee')][_0x7ecd('0x11c')](db[_0x7ecd('0xf1')],{'as':_0x7ecd('0x168'),'foreignKey':'ListId'});db[_0x7ecd('0x1ee')][_0x7ecd('0x11c')](db[_0x7ecd('0x6c')],{'as':'Contact','foreignKey':_0x7ecd('0x15f')});db[_0x7ecd('0x1ee')][_0x7ecd('0x11c')](db['WhatsappInteraction'],{});db[_0x7ecd('0x1ee')][_0x7ecd('0x11c')](db[_0x7ecd('0x104')],{});db['WhatsappQueueReport'][_0x7ecd('0x11c')](db['WhatsappMessage'],{});db[_0x7ecd('0x1ee')][_0x7ecd('0x11c')](db[_0x7ecd('0x14')],{});db[_0x7ecd('0x102')][_0x7ecd('0x11c')](db[_0x7ecd('0x1ec')],{});db[_0x7ecd('0x102')]['belongsTo'](db[_0x7ecd('0xff')],{});db[_0x7ecd('0x102')][_0x7ecd('0x11c')](db['WhatsappAccount'],{'foreignKey':_0x7ecd('0x1ef'),'as':_0x7ecd('0x1d4')});db[_0x7ecd('0x102')]['belongsTo'](db['WhatsappAccount'],{'foreignKey':_0x7ecd('0x1f0'),'as':'ToAccount'});db[_0x7ecd('0x102')]['belongsTo'](db[_0x7ecd('0x104')],{'foreignKey':_0x7ecd('0x1f1'),'as':_0x7ecd('0x1de')});db[_0x7ecd('0x102')][_0x7ecd('0x11c')](db[_0x7ecd('0x14')],{'foreignKey':_0x7ecd('0x1d5'),'as':'FromAgent'});db[_0x7ecd('0x102')][_0x7ecd('0x11c')](db[_0x7ecd('0x14')],{'foreignKey':_0x7ecd('0x1d6'),'as':_0x7ecd('0x1dc')});db['WhatsappQueue'][_0x7ecd('0x11f')](db['User'],{'as':_0x7ecd('0x16b'),'through':'UserWhatsappQueue','foreignKey':_0x7ecd('0x1f2')});db['WhatsappQueue'][_0x7ecd('0x11f')](db[_0x7ecd('0xe0')],{'through':_0x7ecd('0x1d1'),'as':_0x7ecd('0x155')});module['exports']={'db':db,'dbH':dbH}; \ No newline at end of file +var _0xf6c8=['../api/userProfile/userProfile.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','WhatsappTransferReport','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','../api/userVoicePrefix/userVoicePrefix.model','hasOne','cascade','UserId','hasMany','Recordings','Extensions','HopperFinals','OpenchannelInteraction','ChatInteraction','ChatInteractions','FaxInteractions','WhatsappInteractions','belongsTo','userProfileId','belongsToMany','Groups','Contacts','cm_user_has_contacts','Lists','Team','user_has_teams','user_has_mail_interactions','user_has_chat_interactions','user_has_fax_interactions','SmsInteractions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueues','UserVoicePrefix','MailQueues','UserMailQueue','ChatQueues','FaxQueues','UserSmsQueue','OpenchannelQueue','UserWhatsappQueue','cm_user_has_lists','FaxAccount','FaxAccounts','MailAccounts','OpenchannelAccount','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccount','SmsAccounts','user_has_sms_accounts','SquareProjects','user_has_square_projects','VoiceChanSpy','ChanSpyId','Sounds','moh_has_sounds','Members','VoiceQueueId','HopperHistories','HopperBlacks','JscriptySessions','TrunkId','TrunkBackup','TrunkBackupId','Pause','mandatoryDispositionPause','mandatoryDispositionPauseId','Teams','BlackLists','voice_queues_has_cm_blacklists','Messages','mailboxuser','mailbox','QueueCalls','ContactId','MailAccountId','Imap','Answers','Interactions','List','ListId','TemplateId','Agents','user_has_mail_accounts','team_has_mail_queues','MailInteractionId','Account','Contact','mail_interaction_has_tags','Tags','ThroughTags','Users','Attachments','Interaction','ChatWebsiteId','ChatOfflineMessage','ChatOfflineMessageId','restrict','IntervalId','TagId','MailQueueReport','Items','FaxAccountId','Applications','Exntensions','user_has_fax_accounts','FaxInteractionId','Owner','fax_interaction_has_tags','AttachmentId','Dispositions','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','team_has_openchannel_queues','ChatMessage','user_has_chat_websites','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','team_has_chat_queues','ChatGroupId','chat_group_has_users','CompanyId','Hoppers','OpenchannelInteractions','MailInteractions','Company','cm_contact_has_tags','Agent','CampaignId','OwnerId','All','Any','OneAny','AutomationAnyId','Actions','AutomationId','ParentId','Intervals','MailApplications','ChatApplications','FaxApplications','SmsApplications','Schedule','DefaultReportId','Mohs','whatsapp_interaction_has_tags','AllConditions','AllCondition','AnyConditions','AnyCondition','TriggerAnyId','TriggerId','Fields','MetricId','Configurations','AccountId','SubjectId','FieldId','Subject','Description','DescriptionId','Field','VariableId','Subjects','SugarcrmAccount','DeskAccount','Descriptions','int_desk_configuration_has_tags','ZohoField','int_zendesk_configuration_has_tags','ServicenowConfiguration','FromId','ToId','SessionId','SmsQueueReport','JscriptyQuestionReport','ProjectId','team_has_fax_queues','SmsQueues','team_has_whatsapp_queues','WhatsappQueues','VoicePrefixes','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToMailQueueId','ToQueue','ToMailAccountId','ToAccount','ToUserId','ToAgent','ToChatQueueId','FromFaxAccountId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','CustomFields','HopperHistory','Queues','voice_queues_has_cm_lists','UserProfileSection','UserProfileSections','Resources','sectionId','WhatsappAccountId','user_has_whatsapp_accounts','WhatsappInteractionId','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','exports','../config/environment','sequelize','lodash','jstz','defaultsDeep','motion2','xC@LL1234','mysql','utf8mb4','utf8_general_ci','sequelizeHistory','127.0.0.1','name','utf8','password','options','database','username','User','import','../api/user/user.model','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','VoiceAgentReport','VoiceQueueReport','MemberReport','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','VoiceTransferReport','UserVoiceQueueRt','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','../api/chatInteraction/chatInteraction.model','../api/chatMessage/chatMessage.model','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','CmContact','../api/cmContact/cmContact.model','CmHopper','CmHopperBlack','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','Automation','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','Condition','../api/condition/condition.model','Interval','../api/interval/interval.model','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZendeskAccount','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','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','Integration','Network','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SquareReport','../api/squareReport/squareReport.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','SquareMessage','../api/squareMessage/squareMessage.model','../api/team/team.model','License','../api/license/license.model','Campaign','Migration','../api/migration/migration.model','Attachment','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile'];(function(_0x584b82,_0x31580f){var _0x32e41d=function(_0x3d5b4d){while(--_0x3d5b4d){_0x584b82['push'](_0x584b82['shift']());}};_0x32e41d(++_0x31580f);}(_0xf6c8,0xf6));var _0x8f6c=function(_0x2cf2e9,_0xd58ea1){_0x2cf2e9=_0x2cf2e9-0x0;var _0xd3670d=_0xf6c8[_0x2cf2e9];return _0xd3670d;};'use strict';var config=require(_0x8f6c('0x0'));var Sequelize=require(_0x8f6c('0x1'));var _=require(_0x8f6c('0x2'));var jstz=require(_0x8f6c('0x3'));var timezone=jstz['determine']();config[_0x8f6c('0x1')]=_[_0x8f6c('0x4')](config[_0x8f6c('0x1')],{'database':_0x8f6c('0x5'),'username':'xcall','password':_0x8f6c('0x6'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':_0x8f6c('0x7'),'dialectOptions':{'charset':_0x8f6c('0x8')},'logging':![],'timezone':timezone['name'](),'define':{'charset':'utf8','collate':_0x8f6c('0x9')}}});config[_0x8f6c('0xa')]=_[_0x8f6c('0x4')](config['sequelizeHistory'],{'database':_0x8f6c('0x5'),'username':'xcall','password':_0x8f6c('0x6'),'options':{'host':_0x8f6c('0xb'),'port':0xcea,'dialect':_0x8f6c('0x7'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0x8f6c('0xc')](),'define':{'charset':_0x8f6c('0xd'),'collate':_0x8f6c('0x9')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x8f6c('0x1')]['database'],config[_0x8f6c('0x1')]['username'],config['sequelize'][_0x8f6c('0xe')],config[_0x8f6c('0x1')][_0x8f6c('0xf')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x8f6c('0xa')][_0x8f6c('0x10')],config[_0x8f6c('0xa')][_0x8f6c('0x11')],config['sequelizeHistory'][_0x8f6c('0xe')],config[_0x8f6c('0xa')][_0x8f6c('0xf')])};db[_0x8f6c('0x12')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0x14'));db['VoiceChanSpy']=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0x15'));db[_0x8f6c('0x16')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0x17'));db[_0x8f6c('0x18')]=db['sequelize'][_0x8f6c('0x13')]('../api/voiceExtension/voiceExtension.model');db[_0x8f6c('0x19')]=db[_0x8f6c('0x1')]['import'](_0x8f6c('0x1a'));db[_0x8f6c('0x1b')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0x1c'));db[_0x8f6c('0x1d')]=db[_0x8f6c('0x1')]['import'](_0x8f6c('0x1e'));db[_0x8f6c('0x1f')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0x20'));db[_0x8f6c('0x21')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0x22'));db[_0x8f6c('0x23')]=db['sequelize'][_0x8f6c('0x13')](_0x8f6c('0x24'));db[_0x8f6c('0x25')]=db['sequelize'][_0x8f6c('0x13')](_0x8f6c('0x26'));db[_0x8f6c('0x27')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')]('../api/voiceDialReport/voiceDialReport.model');db[_0x8f6c('0x28')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')]('../api/voiceAgentReport/voiceAgentReport.model');db[_0x8f6c('0x29')]=db['sequelize']['import']('../api/voiceQueueReport/voiceQueueReport.model');db[_0x8f6c('0x2a')]=db[_0x8f6c('0x1')]['import'](_0x8f6c('0x2b'));db[_0x8f6c('0x2c')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0x2d'));db[_0x8f6c('0x2e')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')]('../api/voiceTransferReport/voiceTransferReport.model');db[_0x8f6c('0x2f')]=db['sequelize'][_0x8f6c('0x13')]('../api/userVoiceQueueRt/userVoiceQueueRt.model');db[_0x8f6c('0x30')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0x31'));db[_0x8f6c('0x32')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0x33'));db['UserMailQueue']=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0x34'));db[_0x8f6c('0x35')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0x36'));db['UserSmsQueue']=db[_0x8f6c('0x1')][_0x8f6c('0x13')]('../api/userSmsQueue/userSmsQueue.model');db[_0x8f6c('0x37')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0x38'));db['UserWhatsappQueue']=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0x39'));db[_0x8f6c('0x3a')]=db['sequelize']['import'](_0x8f6c('0x3b'));db[_0x8f6c('0x3c')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0x3d'));db[_0x8f6c('0x3e')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0x3f'));db[_0x8f6c('0x40')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0x41'));db['MailSubstatus']=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0x42'));db[_0x8f6c('0x43')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0x44'));db[_0x8f6c('0x45')]=db['sequelize'][_0x8f6c('0x13')](_0x8f6c('0x46'));db[_0x8f6c('0x47')]=db[_0x8f6c('0x1')]['import'](_0x8f6c('0x48'));db['MailQueueReport']=db['sequelize'][_0x8f6c('0x13')](_0x8f6c('0x49'));db[_0x8f6c('0x4a')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0x4b'));db[_0x8f6c('0x4c')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0x4d'));db['FaxAccount']=db[_0x8f6c('0x1')]['import'](_0x8f6c('0x4e'));db[_0x8f6c('0x4f')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0x50'));db[_0x8f6c('0x51')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')]('../api/faxInteraction/faxInteraction.model');db[_0x8f6c('0x52')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0x53'));db[_0x8f6c('0x54')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0x55'));db[_0x8f6c('0x56')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0x57'));db['SmsAccount']=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0x58'));db[_0x8f6c('0x59')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0x5a'));db[_0x8f6c('0x5b')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0x5c'));db[_0x8f6c('0x5d')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0x5e'));db[_0x8f6c('0x5f')]=db['sequelize'][_0x8f6c('0x13')](_0x8f6c('0x60'));db['OpenchannelAccount']=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0x61'));db[_0x8f6c('0x62')]=db['sequelize'][_0x8f6c('0x13')](_0x8f6c('0x63'));db['OpenchannelInteraction']=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0x64'));db[_0x8f6c('0x65')]=db['sequelize'][_0x8f6c('0x13')](_0x8f6c('0x66'));db['OpenchannelQueue']=db[_0x8f6c('0x1')][_0x8f6c('0x13')]('../api/openchannelQueue/openchannelQueue.model');db[_0x8f6c('0x67')]=db['sequelize'][_0x8f6c('0x13')](_0x8f6c('0x68'));db[_0x8f6c('0x69')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0x6a'));db[_0x8f6c('0x6b')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0x6c'));db['ChatInteraction']=db['sequelize'][_0x8f6c('0x13')](_0x8f6c('0x6d'));db['ChatMessage']=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0x6e'));db['ChatOfflineMessage']=db['sequelize']['import'](_0x8f6c('0x6f'));db[_0x8f6c('0x70')]=db[_0x8f6c('0x1')]['import'](_0x8f6c('0x71'));db[_0x8f6c('0x72')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0x73'));db[_0x8f6c('0x74')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0x75'));db[_0x8f6c('0x76')]=db['sequelize'][_0x8f6c('0x13')]('../api/cmCompany/cmCompany.model');db[_0x8f6c('0x77')]=db['sequelize'][_0x8f6c('0x13')](_0x8f6c('0x78'));db[_0x8f6c('0x79')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')]('../api/cmHopper/cmHopper.model');db[_0x8f6c('0x7a')]=db[_0x8f6c('0x1')]['import']('../api/cmHopperBlack/cmHopperBlack.model');db[_0x8f6c('0x7b')]=db[_0x8f6c('0x1')]['import'](_0x8f6c('0x7c'));db[_0x8f6c('0x7d')]=db[_0x8f6c('0x1')]['import']('../api/cmHopperHistory/cmHopperHistory.model');db[_0x8f6c('0x7e')]=db[_0x8f6c('0x1')]['import'](_0x8f6c('0x7f'));db[_0x8f6c('0x80')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0x81'));db[_0x8f6c('0x82')]=db[_0x8f6c('0x1')]['import'](_0x8f6c('0x83'));db[_0x8f6c('0x84')]=db[_0x8f6c('0x1')]['import']('../api/automation/automation.model');db[_0x8f6c('0x85')]=db['sequelize'][_0x8f6c('0x13')](_0x8f6c('0x86'));db[_0x8f6c('0x87')]=db['sequelize'][_0x8f6c('0x13')]('../api/disposition/disposition.model');db[_0x8f6c('0x88')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0x89'));db[_0x8f6c('0x8a')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0x8b'));db['Pause']=db[_0x8f6c('0x1')][_0x8f6c('0x13')]('../api/pause/pause.model');db[_0x8f6c('0x8c')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0x8d'));db[_0x8f6c('0x8e')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')]('../api/voiceQueuesLog/voiceQueuesLog.model');db['Schedule']=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0x8f'));db[_0x8f6c('0x90')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0x91'));db[_0x8f6c('0x92')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0x93'));db[_0x8f6c('0x94')]=db[_0x8f6c('0x1')]['import'](_0x8f6c('0x95'));db[_0x8f6c('0x96')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0x97'));db[_0x8f6c('0x98')]=db[_0x8f6c('0x1')]['import'](_0x8f6c('0x99'));db['Integration']=db[_0x8f6c('0x1')][_0x8f6c('0x13')]('../api/integration/integration.model');db[_0x8f6c('0x9a')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0x9b'));db[_0x8f6c('0x9c')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0x9d'));db[_0x8f6c('0x9e')]=db['sequelize'][_0x8f6c('0x13')]('../api/analyticDefaultReport/analyticDefaultReport.model');db[_0x8f6c('0x9f')]=db[_0x8f6c('0x1')]['import'](_0x8f6c('0xa0'));db[_0x8f6c('0xa1')]=db[_0x8f6c('0x1')]['import'](_0x8f6c('0xa2'));db[_0x8f6c('0xa3')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')]('../api/analyticFieldReport/analyticFieldReport.model');db['AnalyticTreeReport']=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0xa4'));db[_0x8f6c('0xa5')]=db['sequelize'][_0x8f6c('0x13')](_0x8f6c('0xa6'));db[_0x8f6c('0xa7')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0xa8'));db[_0x8f6c('0xa9')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')]('../api/intSalesforceField/intSalesforceField.model');db['SugarcrmAccount']=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0xaa'));db[_0x8f6c('0xab')]=db['sequelize']['import'](_0x8f6c('0xac'));db[_0x8f6c('0xad')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0xae'));db['DeskAccount']=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0xaf'));db[_0x8f6c('0xb0')]=db['sequelize'][_0x8f6c('0x13')](_0x8f6c('0xb1'));db[_0x8f6c('0xb2')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0xb3'));db[_0x8f6c('0xb4')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0xb5'));db[_0x8f6c('0xb6')]=db['sequelize'][_0x8f6c('0x13')](_0x8f6c('0xb7'));db['ZohoField']=db[_0x8f6c('0x1')][_0x8f6c('0x13')]('../api/intZohoField/intZohoField.model');db[_0x8f6c('0xb8')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')]('../api/intZendeskAccount/intZendeskAccount.model');db[_0x8f6c('0xb9')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0xba'));db[_0x8f6c('0xbb')]=db[_0x8f6c('0x1')]['import'](_0x8f6c('0xbc'));db[_0x8f6c('0xbd')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0xbe'));db[_0x8f6c('0xbf')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0xc0'));db[_0x8f6c('0xc1')]=db['sequelize'][_0x8f6c('0x13')](_0x8f6c('0xc2'));db[_0x8f6c('0xc3')]=db['sequelize']['import'](_0x8f6c('0xc4'));db[_0x8f6c('0xc5')]=db['sequelize'][_0x8f6c('0x13')](_0x8f6c('0xc6'));db[_0x8f6c('0xc7')]=db['sequelize'][_0x8f6c('0x13')](_0x8f6c('0xc8'));db[_0x8f6c('0xc9')]=db['sequelize'][_0x8f6c('0x13')](_0x8f6c('0xca'));db['ServicenowConfiguration']=db['sequelize'][_0x8f6c('0x13')](_0x8f6c('0xcb'));db[_0x8f6c('0xcc')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0xcd'));db[_0x8f6c('0xce')]=db['sequelize'][_0x8f6c('0x13')]('../api/intDynamics365Account/intDynamics365Account.model');db[_0x8f6c('0xcf')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0xd0'));db[_0x8f6c('0xd1')]=db[_0x8f6c('0x1')]['import']('../api/intDynamics365Field/intDynamics365Field.model');db[_0x8f6c('0xd2')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0xd3'));db[_0x8f6c('0xd4')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0xd5'));db[_0x8f6c('0xd6')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')]('../api/intFreshsalesField/intFreshsalesField.model');db[_0x8f6c('0xd7')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')]('../api/integration/integration.model');db[_0x8f6c('0xd8')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0xd9'));db[_0x8f6c('0xda')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0xdb'));db[_0x8f6c('0xdc')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0xdd'));db[_0x8f6c('0xde')]=db[_0x8f6c('0x1')]['import'](_0x8f6c('0xdf'));db['JscriptyQuestionReport']=db['sequelize'][_0x8f6c('0x13')](_0x8f6c('0xe0'));db[_0x8f6c('0xe1')]=db[_0x8f6c('0x1')]['import'](_0x8f6c('0xe2'));db['SmsQueueReport']=db[_0x8f6c('0x1')]['import']('../api/smsQueueReport/smsQueueReport.model');db[_0x8f6c('0xe3')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0xe4'));db['SquareDetailsReport']=db[_0x8f6c('0x1')]['import']('../api/squareReportDetail/squareReportDetail.model');db[_0x8f6c('0xe5')]=db['sequelize'][_0x8f6c('0x13')](_0x8f6c('0xe6'));db[_0x8f6c('0xe7')]=db['sequelize'][_0x8f6c('0x13')](_0x8f6c('0xe8'));db['SquareOdbc']=db[_0x8f6c('0x1')]['import'](_0x8f6c('0xe9'));db[_0x8f6c('0xea')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0xeb'));db[_0x8f6c('0xec')]=db[_0x8f6c('0x1')]['import'](_0x8f6c('0xed'));db[_0x8f6c('0xee')]=db[_0x8f6c('0x1')]['import'](_0x8f6c('0xef'));db['Team']=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0xf0'));db[_0x8f6c('0xf1')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0xf2'));db[_0x8f6c('0xf3')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')]('../api/campaign/campaign.model');db[_0x8f6c('0xf4')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0xf5'));db[_0x8f6c('0xf6')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')]('../api/attachment/attachment.model');db[_0x8f6c('0xf7')]=db[_0x8f6c('0x1')]['import'](_0x8f6c('0xf8'));db[_0x8f6c('0xf9')]=db['sequelize'][_0x8f6c('0x13')](_0x8f6c('0xfa'));db[_0x8f6c('0xfb')]=db[_0x8f6c('0x1')]['import'](_0x8f6c('0xfc'));db[_0x8f6c('0xfd')]=db['sequelize'][_0x8f6c('0x13')](_0x8f6c('0xfe'));db[_0x8f6c('0xff')]=db[_0x8f6c('0x1')]['import'](_0x8f6c('0x100'));db[_0x8f6c('0x101')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0x102'));db[_0x8f6c('0x103')]=db['sequelize'][_0x8f6c('0x13')]('../api/cmList/cmList.model');db[_0x8f6c('0x104')]=db['sequelize'][_0x8f6c('0x13')](_0x8f6c('0x105'));db[_0x8f6c('0x106')]=db[_0x8f6c('0x1')]['import'](_0x8f6c('0x107'));db['UserProfileSection']=db[_0x8f6c('0x1')][_0x8f6c('0x13')]('../api/userProfileSection/userProfileSection.model');db[_0x8f6c('0x108')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0x109'));db[_0x8f6c('0x10a')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0x10b'));db[_0x8f6c('0x10c')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0x10d'));db[_0x8f6c('0x10e')]=db['sequelize'][_0x8f6c('0x13')](_0x8f6c('0x10f'));db[_0x8f6c('0x110')]=db['sequelize'][_0x8f6c('0x13')](_0x8f6c('0x111'));db[_0x8f6c('0x112')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0x113'));db[_0x8f6c('0x114')]=db[_0x8f6c('0x1')]['import']('../api/whatsappQueueReport/whatsappQueueReport.model');db[_0x8f6c('0x115')]=db[_0x8f6c('0x1')]['import']('../api/whatsappTransferReport/whatsappTransferReport.model');db[_0x8f6c('0x116')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0x117'));db[_0x8f6c('0x118')]=db[_0x8f6c('0x1')]['import'](_0x8f6c('0x119'));db[_0x8f6c('0x11a')]=db['sequelize'][_0x8f6c('0x13')](_0x8f6c('0x11b'));db[_0x8f6c('0x11c')]=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0x11d'));db['UserVoicePrefix']=db[_0x8f6c('0x1')][_0x8f6c('0x13')](_0x8f6c('0x11e'));db[_0x8f6c('0x12')][_0x8f6c('0x11f')](db[_0x8f6c('0x21')],{'as':_0x8f6c('0x21'),'onDelete':_0x8f6c('0x120'),'foreignKey':_0x8f6c('0x121')});db['User'][_0x8f6c('0x122')](db['VoiceRecording'],{'as':_0x8f6c('0x123'),'foreignKey':_0x8f6c('0x121')});db[_0x8f6c('0x12')][_0x8f6c('0x122')](db[_0x8f6c('0x2f')],{'as':'VoiceQueuesRt','foreignKey':'UserId'});db[_0x8f6c('0x12')]['hasMany'](db[_0x8f6c('0x18')],{'as':_0x8f6c('0x124'),'onDelete':_0x8f6c('0x120'),'hooks':!![]});db[_0x8f6c('0x12')][_0x8f6c('0x122')](db[_0x8f6c('0x7b')],{'as':_0x8f6c('0x125'),'foreignKey':_0x8f6c('0x121')});db[_0x8f6c('0x12')][_0x8f6c('0x122')](db['CmHopperHistory'],{'as':'HopperHistory','foreignKey':_0x8f6c('0x121')});db[_0x8f6c('0x12')][_0x8f6c('0x122')](db[_0x8f6c('0x7e')],{'as':_0x8f6c('0x7e'),'foreignKey':'UserId'});db[_0x8f6c('0x12')][_0x8f6c('0x122')](db[_0x8f6c('0x126')],{'as':'OpenchannelInteractions','foreignKey':'UserId'});db[_0x8f6c('0x12')]['hasMany'](db[_0x8f6c('0x127')],{'as':_0x8f6c('0x128'),'foreignKey':_0x8f6c('0x121')});db[_0x8f6c('0x12')][_0x8f6c('0x122')](db[_0x8f6c('0x5b')],{'as':'SmsInteractions','foreignKey':_0x8f6c('0x121')});db['User'][_0x8f6c('0x122')](db[_0x8f6c('0x51')],{'as':_0x8f6c('0x129'),'foreignKey':_0x8f6c('0x121')});db[_0x8f6c('0x12')]['hasMany'](db[_0x8f6c('0x43')],{'as':'MailInteractions','foreignKey':_0x8f6c('0x121')});db['User']['hasMany'](db[_0x8f6c('0x110')],{'as':_0x8f6c('0x12a'),'foreignKey':_0x8f6c('0x121')});db['User']['hasMany'](db[_0x8f6c('0x10a')],{'as':'UserNotifications','foreignKey':'SenderId'});db['User'][_0x8f6c('0x12b')](db[_0x8f6c('0x106')],{'as':_0x8f6c('0x106'),'foreignKey':_0x8f6c('0x12c')});db[_0x8f6c('0x12')][_0x8f6c('0x12d')](db['ChatGroup'],{'as':_0x8f6c('0x12e'),'through':'chat_group_has_users'});db[_0x8f6c('0x12')][_0x8f6c('0x12d')](db[_0x8f6c('0x77')],{'as':_0x8f6c('0x12f'),'through':_0x8f6c('0x130')});db[_0x8f6c('0x12')][_0x8f6c('0x12d')](db[_0x8f6c('0x103')],{'as':_0x8f6c('0x131'),'through':'cm_user_has_lists'});db['User'][_0x8f6c('0x12d')](db[_0x8f6c('0x132')],{'through':_0x8f6c('0x133')});db['User'][_0x8f6c('0x12d')](db[_0x8f6c('0x43')],{'as':'MailInteractions','through':_0x8f6c('0x134')});db[_0x8f6c('0x12')][_0x8f6c('0x12d')](db[_0x8f6c('0x127')],{'as':'ChatInteractions','through':_0x8f6c('0x135')});db[_0x8f6c('0x12')][_0x8f6c('0x12d')](db[_0x8f6c('0x51')],{'as':_0x8f6c('0x129'),'through':_0x8f6c('0x136')});db[_0x8f6c('0x12')][_0x8f6c('0x12d')](db['SmsInteraction'],{'as':_0x8f6c('0x137'),'through':'user_has_sms_interactions'});db[_0x8f6c('0x12')]['belongsToMany'](db[_0x8f6c('0x126')],{'as':'OpenchannelInteractions','through':_0x8f6c('0x138')});db['User'][_0x8f6c('0x12d')](db[_0x8f6c('0x110')],{'as':_0x8f6c('0x12a'),'through':_0x8f6c('0x139')});db[_0x8f6c('0x12')][_0x8f6c('0x12d')](db[_0x8f6c('0x1b')],{'as':_0x8f6c('0x13a'),'through':'UserVoiceQueue','required':![]});db['User'][_0x8f6c('0x12d')](db[_0x8f6c('0x104')],{'as':'VoicePrefixes','through':_0x8f6c('0x13b'),'required':![]});db[_0x8f6c('0x12')][_0x8f6c('0x12d')](db[_0x8f6c('0x40')],{'as':_0x8f6c('0x13c'),'through':_0x8f6c('0x13d'),'required':![]});db[_0x8f6c('0x12')]['belongsToMany'](db[_0x8f6c('0x70')],{'as':_0x8f6c('0x13e'),'through':_0x8f6c('0x32'),'required':![],'hooks':!![]});db[_0x8f6c('0x12')][_0x8f6c('0x12d')](db[_0x8f6c('0x54')],{'as':_0x8f6c('0x13f'),'through':'UserFaxQueue','required':![]});db[_0x8f6c('0x12')]['belongsToMany'](db[_0x8f6c('0x5f')],{'as':'SmsQueues','through':_0x8f6c('0x140'),'required':![]});db['User'][_0x8f6c('0x12d')](db[_0x8f6c('0x141')],{'as':'OpenchannelQueues','through':_0x8f6c('0x37'),'required':![]});db[_0x8f6c('0x12')][_0x8f6c('0x12d')](db['WhatsappQueue'],{'as':'WhatsappQueues','through':_0x8f6c('0x142'),'required':![]});db['User'][_0x8f6c('0x12d')](db[_0x8f6c('0x103')],{'through':_0x8f6c('0x143')});db[_0x8f6c('0x12')][_0x8f6c('0x12d')](db[_0x8f6c('0x67')],{'as':'ChatWebsites','through':'user_has_chat_websites'});db[_0x8f6c('0x12')][_0x8f6c('0x12d')](db[_0x8f6c('0x144')],{'as':_0x8f6c('0x145'),'through':'user_has_fax_accounts'});db[_0x8f6c('0x12')][_0x8f6c('0x12d')](db[_0x8f6c('0x3e')],{'as':_0x8f6c('0x146'),'through':'user_has_mail_accounts'});db[_0x8f6c('0x12')][_0x8f6c('0x12d')](db[_0x8f6c('0x147')],{'as':_0x8f6c('0x148'),'through':_0x8f6c('0x149')});db[_0x8f6c('0x12')]['belongsToMany'](db[_0x8f6c('0x14a')],{'as':_0x8f6c('0x14b'),'through':_0x8f6c('0x14c')});db[_0x8f6c('0x12')][_0x8f6c('0x12d')](db[_0x8f6c('0x10c')],{'as':'WhatsappAccounts','through':'user_has_whatsapp_accounts'});db['User'][_0x8f6c('0x12d')](db['SquareProject'],{'as':_0x8f6c('0x14d'),'through':_0x8f6c('0x14e')});db[_0x8f6c('0x14f')][_0x8f6c('0x122')](db[_0x8f6c('0x18')],{'as':'SpiedAgents','onDelete':'cascade','foreignKey':_0x8f6c('0x150')});db[_0x8f6c('0x16')][_0x8f6c('0x122')](db[_0x8f6c('0x18')],{'onDelete':'cascade'});db[_0x8f6c('0x18')][_0x8f6c('0x122')](db[_0x8f6c('0x18')],{'as':'Applications','onDelete':'cascade'});db[_0x8f6c('0x19')][_0x8f6c('0x12d')](db['Sound'],{'as':_0x8f6c('0x151'),'through':_0x8f6c('0x152')});db['VoiceQueue'][_0x8f6c('0x122')](db[_0x8f6c('0x2f')],{'as':_0x8f6c('0x153'),'foreignKey':'VoiceQueueId'});db[_0x8f6c('0x1b')]['hasMany'](db['CmHopper'],{'as':'Hoppers','foreignKey':_0x8f6c('0x154')});db[_0x8f6c('0x1b')]['hasMany'](db[_0x8f6c('0x7b')],{'as':'HopperFinals','foreignKey':_0x8f6c('0x154')});db[_0x8f6c('0x1b')][_0x8f6c('0x122')](db[_0x8f6c('0x7d')],{'as':_0x8f6c('0x155'),'foreignKey':_0x8f6c('0x154')});db['VoiceQueue'][_0x8f6c('0x122')](db[_0x8f6c('0x7e')],{'as':_0x8f6c('0x7e'),'foreignKey':_0x8f6c('0x154')});db[_0x8f6c('0x1b')][_0x8f6c('0x122')](db[_0x8f6c('0x7a')],{'as':_0x8f6c('0x156'),'foreignKey':_0x8f6c('0x154')});db[_0x8f6c('0x1b')]['hasMany'](db[_0x8f6c('0xe1')],{'as':_0x8f6c('0x157'),'foreignKey':_0x8f6c('0x154')});db['VoiceQueue']['belongsTo'](db[_0x8f6c('0x2c')],{'as':_0x8f6c('0x2c'),'foreignKey':_0x8f6c('0x158')});db[_0x8f6c('0x1b')]['belongsTo'](db[_0x8f6c('0x2c')],{'as':_0x8f6c('0x159'),'foreignKey':_0x8f6c('0x15a')});db[_0x8f6c('0x1b')][_0x8f6c('0x12b')](db[_0x8f6c('0x8a')],{'as':_0x8f6c('0x8a'),'foreignKey':'IntervalId'});db[_0x8f6c('0x1b')]['belongsTo'](db[_0x8f6c('0x15b')],{'as':_0x8f6c('0x15c'),'foreignKey':_0x8f6c('0x15d')});db[_0x8f6c('0x1b')][_0x8f6c('0x12d')](db['CmList'],{'as':_0x8f6c('0x131'),'through':'voice_queues_has_cm_lists'});db[_0x8f6c('0x1b')][_0x8f6c('0x12d')](db[_0x8f6c('0x12')],{'as':'Agents','through':'UserVoiceQueue'});db['VoiceQueue'][_0x8f6c('0x12d')](db[_0x8f6c('0x132')],{'as':_0x8f6c('0x15e'),'through':'TeamVoiceQueue'});db[_0x8f6c('0x1b')][_0x8f6c('0x12d')](db[_0x8f6c('0x103')],{'as':_0x8f6c('0x15f'),'through':_0x8f6c('0x160')});db['VoiceRecording'][_0x8f6c('0x12b')](db['User'],{'as':_0x8f6c('0x12'),'foreignKey':_0x8f6c('0x121')});db[_0x8f6c('0x1f')][_0x8f6c('0x12b')](db[_0x8f6c('0x12')],{'as':_0x8f6c('0x12'),'foreignKey':_0x8f6c('0x121')});db[_0x8f6c('0x21')][_0x8f6c('0x122')](db[_0x8f6c('0x23')],{'as':_0x8f6c('0x161'),'onDelete':_0x8f6c('0x120'),'foreignKey':_0x8f6c('0x162'),'sourceKey':_0x8f6c('0x163')});db[_0x8f6c('0x23')]['belongsTo'](db[_0x8f6c('0x21')],{'foreignKey':_0x8f6c('0x162'),'targetKey':'mailbox'});db['VoiceCallReport']['hasMany'](db['VoiceQueueReport'],{'as':_0x8f6c('0x164'),'foreignKey':'uniqueid','constraints':![]});db[_0x8f6c('0x25')][_0x8f6c('0x122')](db[_0x8f6c('0x28')],{'as':'AgentReports','foreignKey':'uniqueid','constraints':![]});db['VoiceCallReport'][_0x8f6c('0x12b')](db[_0x8f6c('0x12')],{'as':'User','foreignKey':_0x8f6c('0x121')});db['VoiceCallReport']['belongsTo'](db[_0x8f6c('0x77')],{'as':'Contact','foreignKey':_0x8f6c('0x165')});db[_0x8f6c('0x3a')][_0x8f6c('0x12b')](db[_0x8f6c('0x3e')],{'as':'MailAccount','foreignKey':_0x8f6c('0x166')});db[_0x8f6c('0x3c')][_0x8f6c('0x12b')](db[_0x8f6c('0x3e')],{'as':'MailAccount','foreignKey':_0x8f6c('0x166')});db[_0x8f6c('0x3e')][_0x8f6c('0x11f')](db[_0x8f6c('0x3a')],{'as':_0x8f6c('0x167'),'onDelete':_0x8f6c('0x120')});db[_0x8f6c('0x3e')][_0x8f6c('0x11f')](db[_0x8f6c('0x3c')],{'as':'Smtp','onDelete':_0x8f6c('0x120')});db[_0x8f6c('0x3e')][_0x8f6c('0x122')](db['Disposition'],{'as':'Dispositions','foreignKey':_0x8f6c('0x166'),'onDelete':_0x8f6c('0x120')});db[_0x8f6c('0x3e')]['hasMany'](db[_0x8f6c('0x85')],{'as':_0x8f6c('0x168'),'foreignKey':_0x8f6c('0x166')});db[_0x8f6c('0x3e')][_0x8f6c('0x122')](db['MailMessage'],{'as':'Messages','foreignKey':'MailAccountId'});db['MailAccount'][_0x8f6c('0x122')](db[_0x8f6c('0x43')],{'as':_0x8f6c('0x169')});db['MailAccount'][_0x8f6c('0x122')](db[_0x8f6c('0x47')],{'as':'Applications'});db[_0x8f6c('0x3e')][_0x8f6c('0x12b')](db['CmList'],{'as':_0x8f6c('0x16a'),'foreignKey':_0x8f6c('0x16b')});db['MailAccount'][_0x8f6c('0x12b')](db[_0x8f6c('0x94')],{'as':_0x8f6c('0x94'),'foreignKey':_0x8f6c('0x16c')});db[_0x8f6c('0x3e')][_0x8f6c('0x12b')](db['Pause'],{'as':_0x8f6c('0x15c'),'foreignKey':_0x8f6c('0x15d')});db[_0x8f6c('0x3e')][_0x8f6c('0x12d')](db[_0x8f6c('0x12')],{'as':_0x8f6c('0x16d'),'through':_0x8f6c('0x16e')});db[_0x8f6c('0x40')][_0x8f6c('0x12d')](db['User'],{'as':'Agents','through':_0x8f6c('0x13d')});db['MailQueue'][_0x8f6c('0x12d')](db[_0x8f6c('0x132')],{'through':_0x8f6c('0x16f'),'as':_0x8f6c('0x15e')});db['MailInteraction'][_0x8f6c('0x122')](db[_0x8f6c('0x45')],{'as':'Messages','onDelete':_0x8f6c('0x120'),'foreignKey':_0x8f6c('0x170')});db[_0x8f6c('0x43')][_0x8f6c('0x12b')](db[_0x8f6c('0x3e')],{'as':_0x8f6c('0x171'),'foreignKey':_0x8f6c('0x166')});db['MailInteraction'][_0x8f6c('0x12b')](db[_0x8f6c('0x77')],{'as':_0x8f6c('0x172'),'foreignKey':_0x8f6c('0x165')});db[_0x8f6c('0x43')][_0x8f6c('0x12b')](db['User'],{'as':'Owner','foreignKey':_0x8f6c('0x121')});db[_0x8f6c('0x43')]['belongsToMany'](db[_0x8f6c('0x92')],{'through':_0x8f6c('0x173'),'as':_0x8f6c('0x174')});db[_0x8f6c('0x43')][_0x8f6c('0x12d')](db[_0x8f6c('0x92')],{'through':'mail_interaction_has_tags','as':_0x8f6c('0x175')});db[_0x8f6c('0x43')][_0x8f6c('0x12d')](db[_0x8f6c('0x12')],{'as':_0x8f6c('0x176'),'through':_0x8f6c('0x134'),'foreignKey':_0x8f6c('0x170')});db[_0x8f6c('0x45')][_0x8f6c('0x122')](db[_0x8f6c('0xf6')],{'as':_0x8f6c('0x177'),'onDelete':_0x8f6c('0x120')});db[_0x8f6c('0x45')][_0x8f6c('0x12b')](db[_0x8f6c('0x12')],{'as':_0x8f6c('0x12')});db[_0x8f6c('0x45')]['belongsTo'](db[_0x8f6c('0x77')],{'onDelete':_0x8f6c('0x120'),'as':'Contact'});db['MailMessage']['belongsTo'](db['MailInteraction'],{'as':_0x8f6c('0x178'),'foreignKey':_0x8f6c('0x170')});db[_0x8f6c('0x45')][_0x8f6c('0x12b')](db['MailAccount'],{'as':'Account','foreignKey':_0x8f6c('0x166')});db[_0x8f6c('0x45')]['belongsTo'](db[_0x8f6c('0x67')],{'as':'ChatWebsite','foreignKey':_0x8f6c('0x179')});db[_0x8f6c('0x45')][_0x8f6c('0x12b')](db[_0x8f6c('0x17a')],{'as':_0x8f6c('0x17a'),'foreignKey':_0x8f6c('0x17b')});db[_0x8f6c('0x47')][_0x8f6c('0x12b')](db[_0x8f6c('0x12')],{'onDelete':_0x8f6c('0x17c')});db[_0x8f6c('0x47')][_0x8f6c('0x12b')](db['MailQueue'],{'onDelete':_0x8f6c('0x17c')});db['MailApplication'][_0x8f6c('0x12b')](db[_0x8f6c('0x3e')],{'onDelete':_0x8f6c('0x17c')});db[_0x8f6c('0x47')][_0x8f6c('0x12b')](db[_0x8f6c('0x8a')],{'onDelete':_0x8f6c('0x17c'),'foreignKey':_0x8f6c('0x17d')});db[_0x8f6c('0x47')][_0x8f6c('0x12b')](db[_0x8f6c('0x92')],{'onDelete':_0x8f6c('0x17c'),'foreignKey':_0x8f6c('0x17e')});db['MailQueueReport'][_0x8f6c('0x12b')](db[_0x8f6c('0x3e')],{});db['MailQueueReport'][_0x8f6c('0x12b')](db[_0x8f6c('0x103')],{'as':_0x8f6c('0x16a'),'foreignKey':_0x8f6c('0x16b')});db[_0x8f6c('0x17f')][_0x8f6c('0x12b')](db[_0x8f6c('0x77')],{'as':_0x8f6c('0x172'),'foreignKey':_0x8f6c('0x165')});db['MailQueueReport'][_0x8f6c('0x12b')](db[_0x8f6c('0x43')],{});db[_0x8f6c('0x17f')][_0x8f6c('0x12b')](db[_0x8f6c('0x45')],{});db[_0x8f6c('0x17f')][_0x8f6c('0x12b')](db[_0x8f6c('0x12')],{});db['MailQueueReport'][_0x8f6c('0x12b')](db[_0x8f6c('0x40')],{});db[_0x8f6c('0x4a')]['hasMany'](db[_0x8f6c('0x4c')],{'as':_0x8f6c('0x180'),'onDelete':'cascade'});db[_0x8f6c('0x144')][_0x8f6c('0x122')](db[_0x8f6c('0x87')],{'as':'Dispositions','foreignKey':_0x8f6c('0x181'),'onDelete':_0x8f6c('0x120')});db['FaxAccount'][_0x8f6c('0x122')](db[_0x8f6c('0x85')],{'as':_0x8f6c('0x168'),'foreignKey':_0x8f6c('0x181')});db[_0x8f6c('0x144')]['hasMany'](db['FaxInteraction'],{'as':_0x8f6c('0x169')});db['FaxAccount']['hasMany'](db[_0x8f6c('0x4f')],{'as':_0x8f6c('0x182')});db['FaxAccount'][_0x8f6c('0x122')](db['VoiceExtension'],{'as':_0x8f6c('0x183'),'onDelete':_0x8f6c('0x120')});db[_0x8f6c('0x144')][_0x8f6c('0x122')](db['FaxMessage'],{'as':_0x8f6c('0x161')});db[_0x8f6c('0x144')][_0x8f6c('0x12b')](db[_0x8f6c('0x2c')],{'as':_0x8f6c('0x2c')});db['FaxAccount'][_0x8f6c('0x12b')](db[_0x8f6c('0x103')],{'as':'List','foreignKey':_0x8f6c('0x16b')});db[_0x8f6c('0x144')][_0x8f6c('0x12b')](db[_0x8f6c('0x15b')],{'as':'mandatoryDispositionPause','foreignKey':_0x8f6c('0x15d')});db['FaxAccount'][_0x8f6c('0x12d')](db[_0x8f6c('0x12')],{'as':_0x8f6c('0x16d'),'through':_0x8f6c('0x184')});db[_0x8f6c('0x4f')]['belongsTo'](db[_0x8f6c('0x12')],{'onDelete':_0x8f6c('0x17c')});db[_0x8f6c('0x4f')][_0x8f6c('0x12b')](db['FaxQueue'],{'onDelete':_0x8f6c('0x17c')});db[_0x8f6c('0x4f')][_0x8f6c('0x12b')](db[_0x8f6c('0x144')],{'onDelete':'restrict'});db[_0x8f6c('0x4f')][_0x8f6c('0x12b')](db[_0x8f6c('0x92')],{'onDelete':'restrict','foreignKey':'TagId'});db[_0x8f6c('0x51')][_0x8f6c('0x122')](db[_0x8f6c('0x52')],{'as':_0x8f6c('0x161'),'onDelete':_0x8f6c('0x120'),'foreignKey':_0x8f6c('0x185')});db['FaxInteraction']['belongsTo'](db[_0x8f6c('0x144')],{'as':'Account','foreignKey':_0x8f6c('0x181')});db[_0x8f6c('0x51')][_0x8f6c('0x12b')](db[_0x8f6c('0x77')],{'as':_0x8f6c('0x172'),'foreignKey':_0x8f6c('0x165')});db[_0x8f6c('0x51')][_0x8f6c('0x12b')](db[_0x8f6c('0x12')],{'as':_0x8f6c('0x186'),'foreignKey':'UserId'});db['FaxInteraction'][_0x8f6c('0x12d')](db['Tag'],{'through':_0x8f6c('0x187'),'as':_0x8f6c('0x174')});db[_0x8f6c('0x51')][_0x8f6c('0x12d')](db[_0x8f6c('0x92')],{'through':'fax_interaction_has_tags','as':_0x8f6c('0x175')});db[_0x8f6c('0x51')][_0x8f6c('0x12d')](db['User'],{'as':_0x8f6c('0x176'),'through':_0x8f6c('0x136'),'foreignKey':_0x8f6c('0x185')});db['FaxMessage']['belongsTo'](db['User'],{'onDelete':_0x8f6c('0x120'),'as':_0x8f6c('0x12')});db[_0x8f6c('0x52')][_0x8f6c('0x12b')](db['FaxInteraction'],{'as':'Interaction','foreignKey':_0x8f6c('0x185')});db[_0x8f6c('0x52')][_0x8f6c('0x12b')](db[_0x8f6c('0x77')],{'onDelete':_0x8f6c('0x120'),'as':_0x8f6c('0x172')});db[_0x8f6c('0x52')][_0x8f6c('0x12b')](db[_0x8f6c('0xf6')],{'as':'Attachment','foreignKey':_0x8f6c('0x188')});db['FaxMessage'][_0x8f6c('0x12b')](db['FaxAccount'],{'as':'Account','foreignKey':_0x8f6c('0x181')});db[_0x8f6c('0x54')][_0x8f6c('0x12d')](db[_0x8f6c('0x12')],{'as':_0x8f6c('0x16d'),'through':_0x8f6c('0x35')});db[_0x8f6c('0x54')]['belongsToMany'](db[_0x8f6c('0x132')],{'through':'team_has_fax_queues','as':_0x8f6c('0x15e')});db['FaxQueueReport'][_0x8f6c('0x12b')](db[_0x8f6c('0x144')],{});db[_0x8f6c('0x56')]['belongsTo'](db[_0x8f6c('0x103')],{'as':_0x8f6c('0x16a'),'foreignKey':_0x8f6c('0x16b')});db[_0x8f6c('0x56')]['belongsTo'](db[_0x8f6c('0x77')],{'as':_0x8f6c('0x172'),'foreignKey':_0x8f6c('0x165')});db[_0x8f6c('0x56')][_0x8f6c('0x12b')](db['FaxInteraction'],{});db[_0x8f6c('0x56')][_0x8f6c('0x12b')](db[_0x8f6c('0x52')],{});db[_0x8f6c('0x56')]['belongsTo'](db[_0x8f6c('0x12')],{});db[_0x8f6c('0x56')][_0x8f6c('0x12b')](db[_0x8f6c('0x54')],{});db['SmsAccount']['hasMany'](db[_0x8f6c('0x87')],{'as':_0x8f6c('0x189'),'foreignKey':'SmsAccountId','onDelete':_0x8f6c('0x120')});db['SmsAccount']['hasMany'](db[_0x8f6c('0x85')],{'as':'Answers','foreignKey':_0x8f6c('0x18a')});db[_0x8f6c('0x14a')][_0x8f6c('0x122')](db['SmsMessage'],{'as':_0x8f6c('0x161'),'foreignKey':_0x8f6c('0x18a')});db['SmsAccount']['hasMany'](db['SmsInteraction'],{'as':_0x8f6c('0x169')});db[_0x8f6c('0x14a')]['hasMany'](db['SmsApplication'],{'as':_0x8f6c('0x182')});db[_0x8f6c('0x14a')][_0x8f6c('0x12b')](db[_0x8f6c('0x103')],{'as':'List','foreignKey':_0x8f6c('0x16b')});db[_0x8f6c('0x14a')][_0x8f6c('0x12b')](db[_0x8f6c('0x15b')],{'as':'mandatoryDispositionPause','foreignKey':_0x8f6c('0x15d')});db[_0x8f6c('0x14a')]['belongsToMany'](db[_0x8f6c('0x12')],{'as':_0x8f6c('0x16d'),'through':_0x8f6c('0x14c')});db[_0x8f6c('0x59')]['belongsTo'](db[_0x8f6c('0x12')],{'onDelete':'restrict'});db[_0x8f6c('0x59')][_0x8f6c('0x12b')](db['SmsQueue'],{'onDelete':_0x8f6c('0x17c')});db[_0x8f6c('0x59')][_0x8f6c('0x12b')](db[_0x8f6c('0x14a')],{'onDelete':_0x8f6c('0x17c')});db[_0x8f6c('0x59')][_0x8f6c('0x12b')](db[_0x8f6c('0x8a')],{'onDelete':_0x8f6c('0x17c'),'foreignKey':'IntervalId'});db[_0x8f6c('0x59')]['belongsTo'](db['Tag'],{'onDelete':_0x8f6c('0x17c'),'foreignKey':_0x8f6c('0x17e')});db['SmsInteraction'][_0x8f6c('0x122')](db[_0x8f6c('0x5d')],{'as':'Messages','onDelete':_0x8f6c('0x120'),'foreignKey':_0x8f6c('0x18b')});db[_0x8f6c('0x5b')][_0x8f6c('0x12b')](db['SmsAccount'],{'as':_0x8f6c('0x171'),'foreignKey':'SmsAccountId'});db[_0x8f6c('0x5b')]['belongsTo'](db[_0x8f6c('0x77')],{'as':_0x8f6c('0x172'),'foreignKey':_0x8f6c('0x165')});db[_0x8f6c('0x5b')][_0x8f6c('0x12b')](db[_0x8f6c('0x12')],{'as':_0x8f6c('0x186'),'foreignKey':_0x8f6c('0x121')});db['SmsInteraction'][_0x8f6c('0x12d')](db['Tag'],{'through':_0x8f6c('0x18c'),'as':_0x8f6c('0x174')});db[_0x8f6c('0x5b')][_0x8f6c('0x12d')](db[_0x8f6c('0x92')],{'through':_0x8f6c('0x18c'),'as':_0x8f6c('0x175')});db['SmsInteraction'][_0x8f6c('0x12d')](db[_0x8f6c('0x12')],{'as':_0x8f6c('0x176'),'through':'user_has_sms_interactions','foreignKey':_0x8f6c('0x18b')});db[_0x8f6c('0x5d')][_0x8f6c('0x12b')](db['User'],{'as':'User'});db[_0x8f6c('0x5d')][_0x8f6c('0x12b')](db[_0x8f6c('0x77')],{'onDelete':'cascade','as':'Contact'});db[_0x8f6c('0x5d')][_0x8f6c('0x12b')](db[_0x8f6c('0x5b')],{'onDelete':_0x8f6c('0x120'),'as':_0x8f6c('0x178'),'foreignKey':_0x8f6c('0x18b')});db[_0x8f6c('0x5d')][_0x8f6c('0x12b')](db['SmsAccount'],{'as':'Account','foreignKey':_0x8f6c('0x18a')});db[_0x8f6c('0x5f')][_0x8f6c('0x12d')](db[_0x8f6c('0x12')],{'as':'Agents','through':'UserSmsQueue','foreignKey':_0x8f6c('0x18d')});db[_0x8f6c('0x5f')][_0x8f6c('0x12d')](db[_0x8f6c('0x132')],{'through':_0x8f6c('0x18e'),'as':_0x8f6c('0x15e')});db[_0x8f6c('0x147')]['hasMany'](db[_0x8f6c('0x87')],{'as':_0x8f6c('0x189'),'foreignKey':'OpenchannelAccountId','onDelete':_0x8f6c('0x120')});db[_0x8f6c('0x147')][_0x8f6c('0x122')](db[_0x8f6c('0x85')],{'as':_0x8f6c('0x168'),'foreignKey':_0x8f6c('0x18f')});db[_0x8f6c('0x147')]['hasMany'](db[_0x8f6c('0x126')],{'as':_0x8f6c('0x169'),'foreignKey':_0x8f6c('0x18f')});db[_0x8f6c('0x147')][_0x8f6c('0x122')](db[_0x8f6c('0x65')],{'as':_0x8f6c('0x161'),'foreignKey':_0x8f6c('0x18f')});db[_0x8f6c('0x147')][_0x8f6c('0x122')](db['OpenchannelApplication'],{'as':'Applications','foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount']['belongsTo'](db[_0x8f6c('0x103')],{'as':'List','foreignKey':_0x8f6c('0x16b')});db[_0x8f6c('0x147')][_0x8f6c('0x12b')](db[_0x8f6c('0x15b')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db[_0x8f6c('0x147')][_0x8f6c('0x12d')](db['User'],{'as':_0x8f6c('0x16d'),'through':_0x8f6c('0x149')});db[_0x8f6c('0x62')]['belongsTo'](db[_0x8f6c('0x12')],{'onDelete':_0x8f6c('0x17c')});db[_0x8f6c('0x62')]['belongsTo'](db['OpenchannelQueue'],{'onDelete':_0x8f6c('0x17c'),'foreignKey':_0x8f6c('0x190')});db[_0x8f6c('0x62')][_0x8f6c('0x12b')](db[_0x8f6c('0x147')],{'onDelete':_0x8f6c('0x17c'),'foreignKey':_0x8f6c('0x18f')});db[_0x8f6c('0x62')][_0x8f6c('0x12b')](db[_0x8f6c('0x8a')],{'onDelete':'restrict','foreignKey':_0x8f6c('0x17d')});db[_0x8f6c('0x62')]['belongsTo'](db['Tag'],{'onDelete':'restrict','foreignKey':'TagId'});db[_0x8f6c('0x126')][_0x8f6c('0x122')](db[_0x8f6c('0x65')],{'as':_0x8f6c('0x161'),'onDelete':_0x8f6c('0x120'),'foreignKey':_0x8f6c('0x191')});db['OpenchannelInteraction'][_0x8f6c('0x12b')](db[_0x8f6c('0x147')],{'as':'Account','foreignKey':_0x8f6c('0x18f')});db[_0x8f6c('0x126')][_0x8f6c('0x12b')](db[_0x8f6c('0x77')],{'as':_0x8f6c('0x172'),'foreignKey':'ContactId'});db[_0x8f6c('0x126')][_0x8f6c('0x12b')](db[_0x8f6c('0x12')],{'as':_0x8f6c('0x186'),'foreignKey':_0x8f6c('0x121')});db['OpenchannelInteraction']['belongsToMany'](db[_0x8f6c('0x92')],{'through':'openchannel_interaction_has_tags','as':_0x8f6c('0x174')});db[_0x8f6c('0x126')]['belongsToMany'](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0x8f6c('0x175')});db['OpenchannelInteraction']['belongsToMany'](db['User'],{'as':_0x8f6c('0x176'),'through':'user_has_openchannel_interactions','foreignKey':_0x8f6c('0x191')});db[_0x8f6c('0x65')][_0x8f6c('0x12b')](db['User'],{'onDelete':'cascade','as':_0x8f6c('0x12')});db[_0x8f6c('0x65')][_0x8f6c('0x12b')](db[_0x8f6c('0x77')],{'onDelete':'cascade','as':_0x8f6c('0x172')});db[_0x8f6c('0x65')][_0x8f6c('0x12b')](db[_0x8f6c('0x126')],{'onDelete':_0x8f6c('0x120'),'as':_0x8f6c('0x178'),'foreignKey':_0x8f6c('0x191')});db[_0x8f6c('0x65')][_0x8f6c('0x12b')](db[_0x8f6c('0xf6')],{'as':_0x8f6c('0xf6'),'foreignKey':'AttachmentId'});db['OpenchannelMessage'][_0x8f6c('0x12b')](db[_0x8f6c('0x147')],{'as':_0x8f6c('0x171'),'foreignKey':_0x8f6c('0x18f')});db[_0x8f6c('0x141')][_0x8f6c('0x12d')](db[_0x8f6c('0x12')],{'as':'Agents','through':_0x8f6c('0x37'),'foreignKey':_0x8f6c('0x190')});db[_0x8f6c('0x141')]['belongsToMany'](db[_0x8f6c('0x132')],{'through':_0x8f6c('0x192'),'as':_0x8f6c('0x15e')});db[_0x8f6c('0x67')][_0x8f6c('0x122')](db[_0x8f6c('0x87')],{'as':_0x8f6c('0x189'),'foreignKey':_0x8f6c('0x179'),'onDelete':_0x8f6c('0x120')});db[_0x8f6c('0x67')][_0x8f6c('0x122')](db[_0x8f6c('0x85')],{'as':_0x8f6c('0x168'),'foreignKey':'ChatWebsiteId'});db['ChatWebsite'][_0x8f6c('0x122')](db[_0x8f6c('0x74')],{'as':'ProactiveActions'});db[_0x8f6c('0x67')]['hasMany'](db[_0x8f6c('0x127')],{'as':'Interactions'});db[_0x8f6c('0x67')][_0x8f6c('0x122')](db[_0x8f6c('0x6b')],{'as':_0x8f6c('0x182')});db[_0x8f6c('0x67')][_0x8f6c('0x122')](db[_0x8f6c('0x193')],{'as':_0x8f6c('0x161')});db['ChatWebsite']['belongsTo'](db[_0x8f6c('0x103')],{'as':'List','foreignKey':_0x8f6c('0x16b')});db[_0x8f6c('0x67')]['belongsTo'](db[_0x8f6c('0x8a')],{'as':_0x8f6c('0x8a'),'foreignKey':'IntervalId'});db['ChatWebsite']['belongsTo'](db[_0x8f6c('0x3e')],{'as':_0x8f6c('0x3e'),'foreignKey':_0x8f6c('0x166')});db[_0x8f6c('0x67')][_0x8f6c('0x12b')](db[_0x8f6c('0x15b')],{'as':'mandatoryDispositionPause','foreignKey':_0x8f6c('0x15d')});db[_0x8f6c('0x67')]['belongsToMany'](db[_0x8f6c('0x12')],{'as':_0x8f6c('0x16d'),'through':_0x8f6c('0x194')});db[_0x8f6c('0x69')][_0x8f6c('0x12b')](db[_0x8f6c('0x147')],{});db[_0x8f6c('0x69')][_0x8f6c('0x12b')](db[_0x8f6c('0x103')],{'as':_0x8f6c('0x16a'),'foreignKey':'ListId'});db[_0x8f6c('0x69')][_0x8f6c('0x12b')](db['CmContact'],{'as':_0x8f6c('0x172'),'foreignKey':'ContactId'});db[_0x8f6c('0x69')][_0x8f6c('0x12b')](db['OpenchannelInteraction'],{});db[_0x8f6c('0x69')][_0x8f6c('0x12b')](db[_0x8f6c('0x65')],{});db[_0x8f6c('0x69')]['belongsTo'](db[_0x8f6c('0x12')],{});db[_0x8f6c('0x69')][_0x8f6c('0x12b')](db[_0x8f6c('0x141')],{});db[_0x8f6c('0x6b')][_0x8f6c('0x12b')](db['User'],{'as':'Agent','foreignKey':_0x8f6c('0x121'),'onDelete':'restrict'});db[_0x8f6c('0x6b')][_0x8f6c('0x12b')](db[_0x8f6c('0x70')],{'as':_0x8f6c('0x195'),'foreignKey':_0x8f6c('0x196'),'onDelete':'restrict'});db[_0x8f6c('0x6b')][_0x8f6c('0x12b')](db[_0x8f6c('0x67')],{'as':_0x8f6c('0x197'),'foreignKey':_0x8f6c('0x179'),'onDelete':'restrict'});db[_0x8f6c('0x6b')][_0x8f6c('0x12b')](db[_0x8f6c('0x92')],{'onDelete':_0x8f6c('0x17c'),'foreignKey':'TagId'});db[_0x8f6c('0x127')][_0x8f6c('0x122')](db[_0x8f6c('0x193')],{'as':'Messages','onDelete':_0x8f6c('0x120'),'foreignKey':_0x8f6c('0x198')});db[_0x8f6c('0x127')][_0x8f6c('0x12b')](db[_0x8f6c('0x67')],{'as':'Account','foreignKey':'ChatWebsiteId'});db['ChatInteraction'][_0x8f6c('0x12b')](db[_0x8f6c('0x77')],{'as':'Contact','foreignKey':_0x8f6c('0x165')});db[_0x8f6c('0x127')][_0x8f6c('0x12b')](db[_0x8f6c('0x12')],{'as':_0x8f6c('0x186'),'foreignKey':_0x8f6c('0x121')});db[_0x8f6c('0x127')]['belongsToMany'](db['Tag'],{'through':_0x8f6c('0x199'),'as':'Tags'});db['ChatInteraction']['belongsToMany'](db[_0x8f6c('0x92')],{'through':_0x8f6c('0x199'),'as':_0x8f6c('0x175')});db[_0x8f6c('0x127')][_0x8f6c('0x12d')](db['User'],{'as':_0x8f6c('0x176'),'through':_0x8f6c('0x135'),'foreignKey':'ChatInteractionId'});db[_0x8f6c('0x193')][_0x8f6c('0x12b')](db['User'],{'onDelete':_0x8f6c('0x120'),'as':'User'});db['ChatMessage']['belongsTo'](db[_0x8f6c('0x77')],{'onDelete':'cascade','as':_0x8f6c('0x172'),'foreignKey':_0x8f6c('0x165')});db['ChatMessage'][_0x8f6c('0x12b')](db[_0x8f6c('0x127')],{'onDelete':_0x8f6c('0x120'),'as':'Interaction','foreignKey':'ChatInteractionId'});db[_0x8f6c('0x193')][_0x8f6c('0x12b')](db[_0x8f6c('0xf6')],{'as':_0x8f6c('0xf6'),'foreignKey':'AttachmentId'});db[_0x8f6c('0x193')][_0x8f6c('0x12b')](db['ChatWebsite'],{'as':_0x8f6c('0x171'),'foreignKey':_0x8f6c('0x179')});db[_0x8f6c('0x17a')][_0x8f6c('0x122')](db[_0x8f6c('0xf6')],{'as':_0x8f6c('0x177'),'foreignKey':_0x8f6c('0x17b'),'onDelete':_0x8f6c('0x120'),'hooks':!![]});db[_0x8f6c('0x17a')][_0x8f6c('0x12b')](db['CmContact'],{'onDelete':'cascade','as':'Contact','foreignKey':'ContactId'});db['ChatOfflineMessage'][_0x8f6c('0x12b')](db[_0x8f6c('0x67')],{'as':_0x8f6c('0x171'),'foreignKey':_0x8f6c('0x179')});db[_0x8f6c('0x70')][_0x8f6c('0x12d')](db['User'],{'as':'Agents','through':_0x8f6c('0x32'),'hooks':!![]});db[_0x8f6c('0x70')][_0x8f6c('0x12d')](db[_0x8f6c('0x132')],{'through':_0x8f6c('0x19a'),'as':_0x8f6c('0x15e')});db[_0x8f6c('0x72')][_0x8f6c('0x122')](db[_0x8f6c('0xdc')],{'as':_0x8f6c('0x161'),'foreignKey':_0x8f6c('0x19b'),'onDelete':_0x8f6c('0x120')});db['ChatGroup'][_0x8f6c('0x12d')](db[_0x8f6c('0x12')],{'as':_0x8f6c('0x153'),'through':_0x8f6c('0x19c')});db[_0x8f6c('0x74')][_0x8f6c('0x12b')](db[_0x8f6c('0x67')],{'as':_0x8f6c('0x197'),'foreignKey':_0x8f6c('0x179')});db[_0x8f6c('0x76')][_0x8f6c('0x122')](db['CmContact'],{'as':_0x8f6c('0x12f'),'foreignKey':_0x8f6c('0x19d')});db[_0x8f6c('0x77')][_0x8f6c('0x122')](db[_0x8f6c('0x79')],{'as':_0x8f6c('0x19e'),'foreignKey':_0x8f6c('0x165')});db['CmContact']['hasMany'](db[_0x8f6c('0x7b')],{'as':_0x8f6c('0x125'),'foreignKey':_0x8f6c('0x165')});db[_0x8f6c('0x77')]['hasMany'](db['CmHopperHistory'],{'as':_0x8f6c('0x155'),'foreignKey':_0x8f6c('0x165')});db[_0x8f6c('0x77')]['hasMany'](db['ReportAgentPreview'],{'as':'ReportAgentPreview','foreignKey':_0x8f6c('0x165')});db[_0x8f6c('0x77')][_0x8f6c('0x122')](db[_0x8f6c('0xe1')],{'as':_0x8f6c('0x157'),'foreignKey':'ContactId'});db['CmContact'][_0x8f6c('0x122')](db[_0x8f6c('0x126')],{'as':_0x8f6c('0x19f'),'foreignKey':_0x8f6c('0x165'),'onDelete':'restrict'});db[_0x8f6c('0x77')][_0x8f6c('0x122')](db['ChatInteraction'],{'as':_0x8f6c('0x128'),'foreignKey':_0x8f6c('0x165'),'onDelete':_0x8f6c('0x17c')});db['CmContact']['hasMany'](db['SmsInteraction'],{'as':_0x8f6c('0x137'),'foreignKey':'ContactId','onDelete':_0x8f6c('0x17c')});db[_0x8f6c('0x77')]['hasMany'](db[_0x8f6c('0x51')],{'as':_0x8f6c('0x129'),'foreignKey':_0x8f6c('0x165'),'onDelete':_0x8f6c('0x17c')});db[_0x8f6c('0x77')][_0x8f6c('0x122')](db[_0x8f6c('0x43')],{'as':_0x8f6c('0x1a0'),'foreignKey':_0x8f6c('0x165'),'onDelete':_0x8f6c('0x17c')});db[_0x8f6c('0x77')]['belongsTo'](db[_0x8f6c('0x76')],{'as':_0x8f6c('0x1a1'),'foreignKey':'CompanyId'});db[_0x8f6c('0x77')]['belongsTo'](db['CmList'],{'as':'List','foreignKey':_0x8f6c('0x16b'),'onDelete':_0x8f6c('0x120')});db[_0x8f6c('0x77')][_0x8f6c('0x12d')](db[_0x8f6c('0x12')],{'as':'Users','through':'cm_user_has_contacts'});db['CmContact'][_0x8f6c('0x12d')](db[_0x8f6c('0x92')],{'as':'Tags','through':_0x8f6c('0x1a2')});db[_0x8f6c('0x77')][_0x8f6c('0x12d')](db[_0x8f6c('0x92')],{'through':_0x8f6c('0x1a2'),'as':_0x8f6c('0x175')});db[_0x8f6c('0x79')][_0x8f6c('0x12b')](db[_0x8f6c('0x77')],{'as':'Contact','foreignKey':'ContactId','onDelete':_0x8f6c('0x120')});db[_0x8f6c('0x79')][_0x8f6c('0x12b')](db['CmList'],{'as':'List','foreignKey':_0x8f6c('0x16b'),'onDelete':'cascade'});db[_0x8f6c('0x79')][_0x8f6c('0x12b')](db[_0x8f6c('0x12')],{'as':_0x8f6c('0x1a3'),'foreignKey':_0x8f6c('0x121')});db[_0x8f6c('0x79')][_0x8f6c('0x12b')](db[_0x8f6c('0x1b')],{'as':_0x8f6c('0x195'),'foreignKey':_0x8f6c('0x154'),'onDelete':_0x8f6c('0x120')});db[_0x8f6c('0x79')]['belongsTo'](db[_0x8f6c('0xf3')],{'as':_0x8f6c('0xf3'),'foreignKey':_0x8f6c('0x1a4'),'onDelete':_0x8f6c('0x120')});db[_0x8f6c('0x79')]['belongsTo'](db[_0x8f6c('0x12')],{'as':'Owner','foreignKey':_0x8f6c('0x1a5')});db['CmHopperBlack'][_0x8f6c('0x12b')](db[_0x8f6c('0x77')],{'as':'Contact','foreignKey':_0x8f6c('0x165'),'onDelete':_0x8f6c('0x120')});db[_0x8f6c('0x7a')][_0x8f6c('0x12b')](db[_0x8f6c('0x103')],{'as':_0x8f6c('0x16a'),'foreignKey':'ListId','onDelete':_0x8f6c('0x120')});db[_0x8f6c('0x7a')][_0x8f6c('0x12b')](db['VoiceQueue'],{'as':_0x8f6c('0x195'),'foreignKey':_0x8f6c('0x154'),'onDelete':_0x8f6c('0x120')});db[_0x8f6c('0x7a')][_0x8f6c('0x12b')](db['Campaign'],{'as':'Campaign','foreignKey':'CampaignId','onDelete':'cascade'});db[_0x8f6c('0x84')][_0x8f6c('0x122')](db[_0x8f6c('0x88')],{'as':{'plural':_0x8f6c('0x1a6'),'singular':'OneAll'},'foreignKey':'AutomationAllId','onDelete':'cascade','hooks':!![]});db[_0x8f6c('0x84')]['hasMany'](db[_0x8f6c('0x88')],{'as':{'plural':_0x8f6c('0x1a7'),'singular':_0x8f6c('0x1a8')},'foreignKey':_0x8f6c('0x1a9'),'onDelete':_0x8f6c('0x120'),'hooks':!![]});db[_0x8f6c('0x84')][_0x8f6c('0x122')](db['Action'],{'as':_0x8f6c('0x1aa'),'foreignKey':_0x8f6c('0x1ab'),'onDelete':_0x8f6c('0x120'),'hooks':!![]});db[_0x8f6c('0x87')][_0x8f6c('0x122')](db[_0x8f6c('0x87')],{'as':_0x8f6c('0x189'),'foreignKey':_0x8f6c('0x1ac'),'onDelete':'cascade'});db[_0x8f6c('0x8a')][_0x8f6c('0x122')](db['Interval'],{'as':_0x8f6c('0x1ad'),'foreignKey':_0x8f6c('0x17d'),'onDelete':_0x8f6c('0x120'),'hooks':!![],'required':![]});db[_0x8f6c('0x8a')][_0x8f6c('0x122')](db[_0x8f6c('0x18')],{'as':_0x8f6c('0x124'),'foreignKey':_0x8f6c('0x17d'),'onDelete':_0x8f6c('0x17c')});db['Interval'][_0x8f6c('0x122')](db[_0x8f6c('0x47')],{'as':_0x8f6c('0x1ae'),'foreignKey':'IntervalId'});db[_0x8f6c('0x8a')]['hasMany'](db[_0x8f6c('0x6b')],{'as':_0x8f6c('0x1af'),'foreignKey':_0x8f6c('0x17d')});db[_0x8f6c('0x8a')][_0x8f6c('0x122')](db[_0x8f6c('0x4f')],{'as':_0x8f6c('0x1b0'),'foreignKey':_0x8f6c('0x17d')});db[_0x8f6c('0x8a')][_0x8f6c('0x122')](db[_0x8f6c('0x59')],{'as':_0x8f6c('0x1b1'),'foreignKey':_0x8f6c('0x17d')});db[_0x8f6c('0x1b2')]['belongsTo'](db[_0x8f6c('0x3e')],{});db[_0x8f6c('0x1b2')]['belongsTo'](db[_0x8f6c('0x9e')],{'foreignKey':_0x8f6c('0x1b3')});db[_0x8f6c('0x1b2')]['belongsTo'](db[_0x8f6c('0x9c')],{'foreignKey':'CustomReportId'});db[_0x8f6c('0x90')]['belongsToMany'](db[_0x8f6c('0x19')],{'as':_0x8f6c('0x1b4'),'through':'moh_has_sounds','onDelete':_0x8f6c('0x17c')});db['Tag'][_0x8f6c('0x12d')](db['CmContact'],{'through':_0x8f6c('0x1a2')});db[_0x8f6c('0x92')][_0x8f6c('0x12d')](db[_0x8f6c('0x127')],{'through':'chat_interaction_has_tags'});db['Tag'][_0x8f6c('0x12d')](db['MailInteraction'],{'through':_0x8f6c('0x173')});db[_0x8f6c('0x92')]['belongsToMany'](db['SmsInteraction'],{'through':_0x8f6c('0x18c')});db['Tag']['belongsToMany'](db[_0x8f6c('0x51')],{'through':_0x8f6c('0x187')});db[_0x8f6c('0x92')]['belongsToMany'](db[_0x8f6c('0x126')],{'through':'openchannel_interaction_has_tags'});db[_0x8f6c('0x92')][_0x8f6c('0x12d')](db['WhatsappInteraction'],{'through':_0x8f6c('0x1b5')});db[_0x8f6c('0x96')]['hasMany'](db['Condition'],{'as':{'plural':_0x8f6c('0x1b6'),'singular':_0x8f6c('0x1b7')},'foreignKey':'TriggerAllId','onDelete':'cascade','hooks':!![]});db[_0x8f6c('0x96')]['hasMany'](db['Condition'],{'as':{'plural':_0x8f6c('0x1b8'),'singular':_0x8f6c('0x1b9')},'foreignKey':_0x8f6c('0x1ba'),'onDelete':'cascade','hooks':!![]});db[_0x8f6c('0x96')][_0x8f6c('0x122')](db['Action'],{'as':'Actions','foreignKey':_0x8f6c('0x1bb'),'onDelete':_0x8f6c('0x120'),'hooks':!![]});db[_0x8f6c('0x9c')][_0x8f6c('0x122')](db[_0x8f6c('0xa3')],{'as':_0x8f6c('0x1bc'),'onDelete':_0x8f6c('0x120'),'foreignKey':'CustomReportId','hooks':!![]});db[_0x8f6c('0x9e')][_0x8f6c('0x122')](db[_0x8f6c('0xa3')],{'as':_0x8f6c('0x1bc'),'onDelete':'cascade','foreignKey':_0x8f6c('0x1b3')});db[_0x8f6c('0xa1')][_0x8f6c('0x122')](db['AnalyticFieldReport'],{'as':'Fields','onDelete':'cascade','foreignKey':_0x8f6c('0x1bd')});db['AnalyticFieldReport'][_0x8f6c('0x12b')](db[_0x8f6c('0xa1')],{'foreignKey':_0x8f6c('0x1bd')});db['SalesforceAccount'][_0x8f6c('0x122')](db[_0x8f6c('0xa7')],{'as':_0x8f6c('0x1be'),'onDelete':_0x8f6c('0x120'),'foreignKey':_0x8f6c('0x1bf')});db[_0x8f6c('0xa7')][_0x8f6c('0x122')](db[_0x8f6c('0xa9')],{'as':'Subjects','onDelete':_0x8f6c('0x120'),'foreignKey':_0x8f6c('0x1c0')});db[_0x8f6c('0xa7')][_0x8f6c('0x122')](db['SalesforceField'],{'as':'Descriptions','onDelete':_0x8f6c('0x120'),'foreignKey':'DescriptionId'});db[_0x8f6c('0xa7')][_0x8f6c('0x122')](db[_0x8f6c('0xa9')],{'as':_0x8f6c('0x1bc'),'onDelete':'cascade','foreignKey':_0x8f6c('0x1c1')});db[_0x8f6c('0xa7')][_0x8f6c('0x12b')](db['SalesforceAccount'],{'as':_0x8f6c('0x171'),'foreignKey':_0x8f6c('0x1bf')});db[_0x8f6c('0xa9')][_0x8f6c('0x122')](db[_0x8f6c('0xa9')],{'as':_0x8f6c('0x1c2'),'foreignKey':_0x8f6c('0x1c0')});db['SalesforceField']['hasMany'](db['SalesforceField'],{'as':_0x8f6c('0x1c3'),'foreignKey':_0x8f6c('0x1c4')});db[_0x8f6c('0xa9')]['hasMany'](db[_0x8f6c('0xa9')],{'as':_0x8f6c('0x1c5'),'foreignKey':_0x8f6c('0x1c1')});db[_0x8f6c('0xa9')][_0x8f6c('0x12b')](db['Variable'],{'as':_0x8f6c('0x98'),'foreignKey':_0x8f6c('0x1c6')});db['SugarcrmAccount'][_0x8f6c('0x122')](db['SugarcrmConfiguration'],{'as':_0x8f6c('0x1be'),'onDelete':_0x8f6c('0x120'),'foreignKey':_0x8f6c('0x1bf')});db['SugarcrmConfiguration'][_0x8f6c('0x122')](db['SugarcrmField'],{'as':_0x8f6c('0x1c7'),'onDelete':_0x8f6c('0x120'),'foreignKey':_0x8f6c('0x1c0')});db[_0x8f6c('0xab')][_0x8f6c('0x122')](db[_0x8f6c('0xad')],{'as':'Descriptions','onDelete':'cascade','foreignKey':_0x8f6c('0x1c4')});db[_0x8f6c('0xab')]['hasMany'](db[_0x8f6c('0xad')],{'as':_0x8f6c('0x1bc'),'onDelete':_0x8f6c('0x120'),'foreignKey':_0x8f6c('0x1c1')});db[_0x8f6c('0xab')][_0x8f6c('0x12b')](db[_0x8f6c('0x1c8')],{'as':_0x8f6c('0x171'),'foreignKey':_0x8f6c('0x1bf')});db[_0x8f6c('0xad')][_0x8f6c('0x122')](db[_0x8f6c('0xad')],{'as':_0x8f6c('0x1c2'),'foreignKey':_0x8f6c('0x1c0')});db['SugarcrmField'][_0x8f6c('0x122')](db[_0x8f6c('0xad')],{'as':_0x8f6c('0x1c3'),'foreignKey':_0x8f6c('0x1c4')});db[_0x8f6c('0xad')]['hasMany'](db[_0x8f6c('0xad')],{'as':_0x8f6c('0x1c5'),'foreignKey':_0x8f6c('0x1c1')});db['SugarcrmField'][_0x8f6c('0x12b')](db['Variable'],{'as':_0x8f6c('0x98'),'foreignKey':'VariableId'});db[_0x8f6c('0x1c9')][_0x8f6c('0x122')](db['DeskConfiguration'],{'as':_0x8f6c('0x1be'),'onDelete':_0x8f6c('0x120'),'foreignKey':_0x8f6c('0x1bf')});db[_0x8f6c('0xb0')]['hasMany'](db[_0x8f6c('0xb2')],{'as':'Subjects','onDelete':_0x8f6c('0x120'),'foreignKey':_0x8f6c('0x1c0')});db['DeskConfiguration'][_0x8f6c('0x122')](db[_0x8f6c('0xb2')],{'as':_0x8f6c('0x1ca'),'onDelete':_0x8f6c('0x120'),'foreignKey':_0x8f6c('0x1c4')});db[_0x8f6c('0xb0')][_0x8f6c('0x122')](db[_0x8f6c('0xb2')],{'as':_0x8f6c('0x1bc'),'onDelete':_0x8f6c('0x120'),'foreignKey':_0x8f6c('0x1c1')});db[_0x8f6c('0xb0')][_0x8f6c('0x12b')](db[_0x8f6c('0x1c9')],{'as':_0x8f6c('0x171'),'foreignKey':_0x8f6c('0x1bf')});db[_0x8f6c('0xb0')][_0x8f6c('0x12d')](db[_0x8f6c('0x92')],{'through':_0x8f6c('0x1cb')});db['DeskField'][_0x8f6c('0x122')](db[_0x8f6c('0xb2')],{'as':_0x8f6c('0x1c2'),'foreignKey':_0x8f6c('0x1c0')});db['DeskField']['hasMany'](db[_0x8f6c('0xb2')],{'as':_0x8f6c('0x1c3'),'foreignKey':_0x8f6c('0x1c4')});db['DeskField']['hasMany'](db[_0x8f6c('0xb2')],{'as':'Field','foreignKey':'FieldId'});db[_0x8f6c('0xb2')][_0x8f6c('0x12b')](db[_0x8f6c('0x98')],{'as':_0x8f6c('0x98'),'foreignKey':_0x8f6c('0x1c6')});db[_0x8f6c('0xb4')][_0x8f6c('0x122')](db['ZohoConfiguration'],{'as':_0x8f6c('0x1be'),'onDelete':_0x8f6c('0x120'),'foreignKey':_0x8f6c('0x1bf')});db[_0x8f6c('0xb6')][_0x8f6c('0x122')](db[_0x8f6c('0x1cc')],{'as':'Subjects','onDelete':_0x8f6c('0x120'),'foreignKey':_0x8f6c('0x1c0')});db[_0x8f6c('0xb6')][_0x8f6c('0x122')](db[_0x8f6c('0x1cc')],{'as':_0x8f6c('0x1ca'),'onDelete':_0x8f6c('0x120'),'foreignKey':_0x8f6c('0x1c4')});db['ZohoConfiguration'][_0x8f6c('0x122')](db[_0x8f6c('0x1cc')],{'as':_0x8f6c('0x1bc'),'onDelete':'cascade','foreignKey':_0x8f6c('0x1c1')});db['ZohoConfiguration'][_0x8f6c('0x12b')](db[_0x8f6c('0xb4')],{'as':_0x8f6c('0x171'),'foreignKey':_0x8f6c('0x1bf')});db[_0x8f6c('0x1cc')][_0x8f6c('0x122')](db[_0x8f6c('0x1cc')],{'as':'Subject','foreignKey':_0x8f6c('0x1c0')});db['ZohoField']['hasMany'](db[_0x8f6c('0x1cc')],{'as':_0x8f6c('0x1c3'),'foreignKey':_0x8f6c('0x1c4')});db['ZohoField'][_0x8f6c('0x122')](db['ZohoField'],{'as':_0x8f6c('0x1c5'),'foreignKey':'FieldId'});db[_0x8f6c('0x1cc')][_0x8f6c('0x12b')](db[_0x8f6c('0x98')],{'as':_0x8f6c('0x98'),'foreignKey':_0x8f6c('0x1c6')});db['ZendeskAccount'][_0x8f6c('0x122')](db['ZendeskConfiguration'],{'as':_0x8f6c('0x1be'),'onDelete':_0x8f6c('0x120'),'foreignKey':_0x8f6c('0x1bf')});db[_0x8f6c('0xb9')][_0x8f6c('0x122')](db[_0x8f6c('0xbb')],{'as':_0x8f6c('0x1c7'),'foreignKey':_0x8f6c('0x1c0')});db[_0x8f6c('0xb9')]['hasMany'](db[_0x8f6c('0xbb')],{'as':_0x8f6c('0x1ca'),'foreignKey':_0x8f6c('0x1c4')});db[_0x8f6c('0xb9')][_0x8f6c('0x122')](db['ZendeskField'],{'as':_0x8f6c('0x1bc'),'foreignKey':_0x8f6c('0x1c1')});db[_0x8f6c('0xb9')][_0x8f6c('0x12b')](db['ZendeskAccount'],{'as':_0x8f6c('0x171'),'foreignKey':_0x8f6c('0x1bf')});db[_0x8f6c('0xb9')][_0x8f6c('0x12d')](db[_0x8f6c('0x92')],{'through':_0x8f6c('0x1cd')});db['ZendeskField'][_0x8f6c('0x122')](db[_0x8f6c('0xbb')],{'as':'Subject','foreignKey':'SubjectId'});db[_0x8f6c('0xbb')][_0x8f6c('0x122')](db['ZendeskField'],{'as':_0x8f6c('0x1c3'),'foreignKey':_0x8f6c('0x1c4')});db[_0x8f6c('0xbb')][_0x8f6c('0x122')](db[_0x8f6c('0xbb')],{'as':_0x8f6c('0x1c5'),'foreignKey':'FieldId'});db[_0x8f6c('0xbb')][_0x8f6c('0x12b')](db[_0x8f6c('0x98')],{'as':_0x8f6c('0x98'),'foreignKey':_0x8f6c('0x1c6')});db['FreshdeskAccount'][_0x8f6c('0x122')](db[_0x8f6c('0xbf')],{'as':'Configurations','onDelete':_0x8f6c('0x120'),'foreignKey':'AccountId'});db[_0x8f6c('0xbf')][_0x8f6c('0x122')](db[_0x8f6c('0xc1')],{'as':_0x8f6c('0x1c7'),'onDelete':_0x8f6c('0x120'),'foreignKey':'SubjectId'});db[_0x8f6c('0xbf')][_0x8f6c('0x122')](db[_0x8f6c('0xc1')],{'as':'Descriptions','onDelete':_0x8f6c('0x120'),'foreignKey':_0x8f6c('0x1c4')});db['FreshdeskConfiguration'][_0x8f6c('0x122')](db[_0x8f6c('0xc1')],{'as':_0x8f6c('0x1bc'),'onDelete':_0x8f6c('0x120'),'foreignKey':'FieldId'});db[_0x8f6c('0xbf')]['belongsTo'](db[_0x8f6c('0xbd')],{'as':_0x8f6c('0x171'),'foreignKey':'AccountId'});db[_0x8f6c('0xbf')]['belongsToMany'](db[_0x8f6c('0x92')],{'through':'int_freshdesk_configuration_has_tags'});db['FreshdeskField'][_0x8f6c('0x122')](db[_0x8f6c('0xc1')],{'as':_0x8f6c('0x1c2'),'foreignKey':'SubjectId'});db[_0x8f6c('0xc1')][_0x8f6c('0x122')](db[_0x8f6c('0xc1')],{'as':_0x8f6c('0x1c3'),'foreignKey':'DescriptionId'});db['FreshdeskField']['hasMany'](db[_0x8f6c('0xc1')],{'as':_0x8f6c('0x1c5'),'foreignKey':_0x8f6c('0x1c1')});db[_0x8f6c('0xc1')][_0x8f6c('0x12b')](db['Variable'],{'as':'Variable','foreignKey':_0x8f6c('0x1c6')});db[_0x8f6c('0xc3')]['hasMany'](db[_0x8f6c('0xc5')],{'as':_0x8f6c('0x1be'),'onDelete':_0x8f6c('0x120'),'foreignKey':_0x8f6c('0x1bf')});db['VtigerConfiguration'][_0x8f6c('0x122')](db[_0x8f6c('0xc7')],{'as':_0x8f6c('0x1c7'),'foreignKey':_0x8f6c('0x1c0')});db[_0x8f6c('0xc5')]['hasMany'](db[_0x8f6c('0xc7')],{'as':_0x8f6c('0x1ca'),'foreignKey':'DescriptionId'});db[_0x8f6c('0xc5')][_0x8f6c('0x122')](db['VtigerField'],{'as':_0x8f6c('0x1bc'),'foreignKey':_0x8f6c('0x1c1')});db[_0x8f6c('0xc5')]['belongsTo'](db['VtigerAccount'],{'as':_0x8f6c('0x171'),'foreignKey':'AccountId'});db[_0x8f6c('0xc7')]['hasMany'](db['VtigerField'],{'as':_0x8f6c('0x1c2'),'foreignKey':_0x8f6c('0x1c0')});db['VtigerField'][_0x8f6c('0x122')](db[_0x8f6c('0xc7')],{'as':'Description','foreignKey':_0x8f6c('0x1c4')});db[_0x8f6c('0xc7')][_0x8f6c('0x122')](db['VtigerField'],{'as':_0x8f6c('0x1c5'),'foreignKey':_0x8f6c('0x1c1')});db[_0x8f6c('0xc7')][_0x8f6c('0x12b')](db[_0x8f6c('0x98')],{'as':_0x8f6c('0x98'),'foreignKey':_0x8f6c('0x1c6')});db[_0x8f6c('0xc9')]['hasMany'](db['ServicenowConfiguration'],{'as':_0x8f6c('0x1be'),'onDelete':_0x8f6c('0x120'),'foreignKey':'AccountId'});db['ServicenowConfiguration']['hasMany'](db[_0x8f6c('0xcc')],{'as':_0x8f6c('0x1c7'),'foreignKey':_0x8f6c('0x1c0')});db['ServicenowConfiguration'][_0x8f6c('0x122')](db['ServicenowField'],{'as':_0x8f6c('0x1ca'),'foreignKey':_0x8f6c('0x1c4')});db[_0x8f6c('0x1ce')][_0x8f6c('0x122')](db[_0x8f6c('0xcc')],{'as':_0x8f6c('0x1bc'),'foreignKey':'FieldId'});db['ServicenowConfiguration'][_0x8f6c('0x12b')](db[_0x8f6c('0xc9')],{'as':_0x8f6c('0x171'),'foreignKey':_0x8f6c('0x1bf')});db[_0x8f6c('0xcc')][_0x8f6c('0x122')](db['ServicenowField'],{'as':_0x8f6c('0x1c2'),'foreignKey':_0x8f6c('0x1c0')});db[_0x8f6c('0xcc')][_0x8f6c('0x122')](db[_0x8f6c('0xcc')],{'as':_0x8f6c('0x1c3'),'foreignKey':'DescriptionId'});db['ServicenowField']['hasMany'](db[_0x8f6c('0xcc')],{'as':_0x8f6c('0x1c5'),'foreignKey':_0x8f6c('0x1c1')});db['ServicenowField'][_0x8f6c('0x12b')](db['Variable'],{'as':'Variable','foreignKey':_0x8f6c('0x1c6')});db['Dynamics365Account'][_0x8f6c('0x122')](db[_0x8f6c('0xcf')],{'as':_0x8f6c('0x1be'),'onDelete':_0x8f6c('0x120'),'foreignKey':_0x8f6c('0x1bf')});db['Dynamics365Configuration'][_0x8f6c('0x122')](db['Dynamics365Field'],{'as':_0x8f6c('0x1c7'),'onDelete':_0x8f6c('0x120'),'foreignKey':'SubjectId'});db[_0x8f6c('0xcf')][_0x8f6c('0x122')](db['Dynamics365Field'],{'as':'Descriptions','onDelete':_0x8f6c('0x120'),'foreignKey':_0x8f6c('0x1c4')});db[_0x8f6c('0xcf')][_0x8f6c('0x122')](db['Dynamics365Field'],{'as':'Fields','onDelete':_0x8f6c('0x120'),'foreignKey':'FieldId'});db[_0x8f6c('0xcf')]['belongsTo'](db['Dynamics365Account'],{'as':'Account','foreignKey':_0x8f6c('0x1bf')});db[_0x8f6c('0xd1')][_0x8f6c('0x122')](db[_0x8f6c('0xd1')],{'as':_0x8f6c('0x1c2'),'foreignKey':_0x8f6c('0x1c0')});db[_0x8f6c('0xd1')]['hasMany'](db['Dynamics365Field'],{'as':_0x8f6c('0x1c3'),'foreignKey':'DescriptionId'});db[_0x8f6c('0xd1')][_0x8f6c('0x122')](db[_0x8f6c('0xd1')],{'as':_0x8f6c('0x1c5'),'foreignKey':_0x8f6c('0x1c1')});db[_0x8f6c('0xd1')][_0x8f6c('0x12b')](db[_0x8f6c('0x98')],{'as':_0x8f6c('0x98'),'foreignKey':_0x8f6c('0x1c6')});db[_0x8f6c('0xd2')]['hasMany'](db[_0x8f6c('0xd4')],{'as':_0x8f6c('0x1be'),'onDelete':_0x8f6c('0x120'),'foreignKey':'AccountId'});db['FreshsalesConfiguration'][_0x8f6c('0x122')](db[_0x8f6c('0xd6')],{'as':_0x8f6c('0x1c7'),'foreignKey':'SubjectId'});db[_0x8f6c('0xd4')][_0x8f6c('0x122')](db[_0x8f6c('0xd6')],{'as':'Descriptions','foreignKey':_0x8f6c('0x1c4')});db[_0x8f6c('0xd4')][_0x8f6c('0x122')](db[_0x8f6c('0xd6')],{'as':_0x8f6c('0x1bc'),'foreignKey':'FieldId'});db['FreshsalesConfiguration'][_0x8f6c('0x12b')](db[_0x8f6c('0xd2')],{'as':_0x8f6c('0x171'),'foreignKey':_0x8f6c('0x1bf')});db[_0x8f6c('0xd6')][_0x8f6c('0x122')](db[_0x8f6c('0xd6')],{'as':_0x8f6c('0x1c2'),'foreignKey':_0x8f6c('0x1c0')});db[_0x8f6c('0xd6')][_0x8f6c('0x122')](db[_0x8f6c('0xd6')],{'as':_0x8f6c('0x1c3'),'foreignKey':_0x8f6c('0x1c4')});db[_0x8f6c('0xd6')]['hasMany'](db[_0x8f6c('0xd6')],{'as':_0x8f6c('0x1c5'),'foreignKey':_0x8f6c('0x1c1')});db[_0x8f6c('0xd6')][_0x8f6c('0x12b')](db['Variable'],{'as':_0x8f6c('0x98'),'foreignKey':_0x8f6c('0x1c6')});db[_0x8f6c('0xda')][_0x8f6c('0x12b')](db[_0x8f6c('0x67')],{});db['ChatQueueReport'][_0x8f6c('0x12b')](db[_0x8f6c('0x103')],{'as':_0x8f6c('0x16a'),'foreignKey':'ListId'});db[_0x8f6c('0xda')][_0x8f6c('0x12b')](db[_0x8f6c('0x77')],{'as':_0x8f6c('0x172'),'foreignKey':_0x8f6c('0x165')});db[_0x8f6c('0xda')][_0x8f6c('0x12b')](db[_0x8f6c('0x127')],{});db[_0x8f6c('0xda')][_0x8f6c('0x12b')](db['ChatMessage'],{});db[_0x8f6c('0xda')]['belongsTo'](db[_0x8f6c('0x12')],{});db[_0x8f6c('0xda')][_0x8f6c('0x12b')](db['ChatQueue'],{});db[_0x8f6c('0xdc')][_0x8f6c('0x12b')](db[_0x8f6c('0x12')],{'onDelete':_0x8f6c('0x120'),'foreignKey':_0x8f6c('0x1cf')});db[_0x8f6c('0xdc')]['belongsTo'](db[_0x8f6c('0x12')],{'onDelete':_0x8f6c('0x120'),'foreignKey':_0x8f6c('0x1d0')});db[_0x8f6c('0xe1')][_0x8f6c('0x122')](db['JscriptyQuestionReport'],{'foreignKey':_0x8f6c('0x1d1'),'onDelete':_0x8f6c('0x120')});db['JscriptySessionReport'][_0x8f6c('0x122')](db[_0x8f6c('0xde')],{'foreignKey':'SessionId','onDelete':_0x8f6c('0x120')});db[_0x8f6c('0x1d2')][_0x8f6c('0x12b')](db['SmsAccount'],{});db[_0x8f6c('0x1d2')]['belongsTo'](db[_0x8f6c('0x103')],{'as':_0x8f6c('0x16a'),'foreignKey':_0x8f6c('0x16b')});db[_0x8f6c('0x1d2')][_0x8f6c('0x12b')](db['CmContact'],{'as':_0x8f6c('0x172'),'foreignKey':_0x8f6c('0x165')});db[_0x8f6c('0x1d2')][_0x8f6c('0x12b')](db['SmsInteraction'],{});db[_0x8f6c('0x1d2')][_0x8f6c('0x12b')](db['SmsMessage'],{});db[_0x8f6c('0x1d2')][_0x8f6c('0x12b')](db[_0x8f6c('0x12')],{});db['SmsQueueReport'][_0x8f6c('0x12b')](db['SmsQueue'],{});db[_0x8f6c('0xe5')]['hasMany'](db['JscriptySessionReport'],{'foreignKey':'ProjectId'});db[_0x8f6c('0xe5')][_0x8f6c('0x122')](db[_0x8f6c('0x1d3')],{'foreignKey':_0x8f6c('0x1d4')});db['JscriptyProject'][_0x8f6c('0x122')](db['JscriptyAnswerReport'],{'foreignKey':_0x8f6c('0x1d4')});db['SquareProject'][_0x8f6c('0x12d')](db['User'],{'as':_0x8f6c('0x176'),'through':'user_has_square_projects'});db['Team']['belongsToMany'](db['User'],{'as':_0x8f6c('0x16d'),'through':_0x8f6c('0x133')});db[_0x8f6c('0x132')][_0x8f6c('0x12d')](db[_0x8f6c('0x1b')],{'through':'TeamVoiceQueue','as':_0x8f6c('0x13a')});db['Team'][_0x8f6c('0x12d')](db[_0x8f6c('0x40')],{'through':_0x8f6c('0x16f'),'as':_0x8f6c('0x13c')});db['Team']['belongsToMany'](db[_0x8f6c('0x70')],{'through':_0x8f6c('0x19a'),'as':'ChatQueues'});db[_0x8f6c('0x132')][_0x8f6c('0x12d')](db['FaxQueue'],{'through':_0x8f6c('0x1d5'),'as':'FaxQueues'});db[_0x8f6c('0x132')][_0x8f6c('0x12d')](db[_0x8f6c('0x5f')],{'through':_0x8f6c('0x18e'),'as':_0x8f6c('0x1d6')});db[_0x8f6c('0x132')][_0x8f6c('0x12d')](db['OpenchannelQueue'],{'through':_0x8f6c('0x192'),'as':'OpenchannelQueues'});db[_0x8f6c('0x132')][_0x8f6c('0x12d')](db['WhatsappQueue'],{'through':_0x8f6c('0x1d7'),'as':_0x8f6c('0x1d8')});db[_0x8f6c('0x132')]['belongsToMany'](db[_0x8f6c('0x104')],{'through':_0x8f6c('0x11c'),'as':_0x8f6c('0x1d9')});db[_0x8f6c('0xf3')][_0x8f6c('0x122')](db[_0x8f6c('0x79')],{'as':_0x8f6c('0x19e'),'foreignKey':'CampaignId'});db['Campaign'][_0x8f6c('0x122')](db[_0x8f6c('0x7b')],{'as':_0x8f6c('0x125'),'foreignKey':_0x8f6c('0x1a4')});db['Campaign'][_0x8f6c('0x122')](db['CmHopperHistory'],{'as':_0x8f6c('0x155'),'foreignKey':_0x8f6c('0x1a4')});db[_0x8f6c('0xf3')][_0x8f6c('0x122')](db[_0x8f6c('0x7a')],{'as':_0x8f6c('0x156'),'foreignKey':_0x8f6c('0x1a4')});db['Campaign'][_0x8f6c('0x12b')](db['Trunk'],{'as':'Trunk','foreignKey':_0x8f6c('0x158')});db[_0x8f6c('0xf3')][_0x8f6c('0x12b')](db['Trunk'],{'as':_0x8f6c('0x159'),'foreignKey':'TrunkBackupId'});db[_0x8f6c('0xf3')][_0x8f6c('0x12b')](db['Interval'],{'as':_0x8f6c('0x8a'),'foreignKey':_0x8f6c('0x17d')});db['Campaign'][_0x8f6c('0x12b')](db['SquareProject'],{'as':_0x8f6c('0xea'),'foreignKey':'SquareProjectId'});db[_0x8f6c('0xf3')][_0x8f6c('0x12d')](db[_0x8f6c('0x103')],{'as':_0x8f6c('0x131'),'through':_0x8f6c('0x1da')});db[_0x8f6c('0xf3')]['belongsToMany'](db['CmList'],{'as':_0x8f6c('0x15f'),'through':_0x8f6c('0x1db')});db['Attachment'][_0x8f6c('0x12b')](db[_0x8f6c('0x17a')],{'as':'ChatOfflineMessage','foreignKey':_0x8f6c('0x17b')});db['MailTransferReport'][_0x8f6c('0x12b')](db[_0x8f6c('0x45')],{});db[_0x8f6c('0xf9')][_0x8f6c('0x12b')](db['MailInteraction'],{});db[_0x8f6c('0xf9')][_0x8f6c('0x12b')](db[_0x8f6c('0x3e')],{'foreignKey':_0x8f6c('0x1dc'),'as':_0x8f6c('0x1dd')});db['MailTransferReport'][_0x8f6c('0x12b')](db[_0x8f6c('0x12')],{'foreignKey':_0x8f6c('0x1de'),'as':_0x8f6c('0x1df')});db[_0x8f6c('0xf9')][_0x8f6c('0x12b')](db[_0x8f6c('0x12')],{'foreignKey':'ToUserId','as':'ToAgent'});db['MailTransferReport'][_0x8f6c('0x12b')](db[_0x8f6c('0x40')],{'foreignKey':_0x8f6c('0x1e0'),'as':_0x8f6c('0x1e1')});db[_0x8f6c('0xf9')][_0x8f6c('0x12b')](db['MailAccount'],{'foreignKey':_0x8f6c('0x1e2'),'as':_0x8f6c('0x1e3')});db[_0x8f6c('0xfb')][_0x8f6c('0x12b')](db[_0x8f6c('0x193')],{});db[_0x8f6c('0xfb')]['belongsTo'](db[_0x8f6c('0x127')],{});db[_0x8f6c('0xfb')][_0x8f6c('0x12b')](db['ChatWebsite'],{'foreignKey':'FromChatWebsiteId','as':_0x8f6c('0x1dd')});db[_0x8f6c('0xfb')][_0x8f6c('0x12b')](db[_0x8f6c('0x12')],{'foreignKey':_0x8f6c('0x1de'),'as':_0x8f6c('0x1df')});db['ChatTransferReport'][_0x8f6c('0x12b')](db['User'],{'foreignKey':_0x8f6c('0x1e4'),'as':_0x8f6c('0x1e5')});db['ChatTransferReport'][_0x8f6c('0x12b')](db['ChatQueue'],{'foreignKey':_0x8f6c('0x1e6'),'as':_0x8f6c('0x1e1')});db[_0x8f6c('0xfb')]['belongsTo'](db[_0x8f6c('0x67')],{'foreignKey':'ToChatWebsiteId','as':_0x8f6c('0x1e3')});db['FaxTransferReport']['belongsTo'](db[_0x8f6c('0x52')],{});db[_0x8f6c('0xfd')][_0x8f6c('0x12b')](db[_0x8f6c('0x51')],{});db['FaxTransferReport']['belongsTo'](db[_0x8f6c('0x144')],{'foreignKey':_0x8f6c('0x1e7'),'as':'FromAccount'});db[_0x8f6c('0xfd')][_0x8f6c('0x12b')](db['User'],{'foreignKey':_0x8f6c('0x1de'),'as':_0x8f6c('0x1df')});db['FaxTransferReport']['belongsTo'](db['User'],{'foreignKey':_0x8f6c('0x1e4'),'as':_0x8f6c('0x1e5')});db['FaxTransferReport'][_0x8f6c('0x12b')](db[_0x8f6c('0x54')],{'foreignKey':'ToFaxQueueId','as':_0x8f6c('0x1e1')});db['FaxTransferReport'][_0x8f6c('0x12b')](db['FaxAccount'],{'foreignKey':_0x8f6c('0x1e8'),'as':_0x8f6c('0x1e3')});db[_0x8f6c('0xff')][_0x8f6c('0x12b')](db[_0x8f6c('0x65')],{});db[_0x8f6c('0xff')][_0x8f6c('0x12b')](db[_0x8f6c('0x126')],{});db[_0x8f6c('0xff')][_0x8f6c('0x12b')](db['OpenchannelAccount'],{'foreignKey':_0x8f6c('0x1e9'),'as':_0x8f6c('0x1dd')});db[_0x8f6c('0xff')][_0x8f6c('0x12b')](db[_0x8f6c('0x12')],{'foreignKey':'FromUserId','as':_0x8f6c('0x1df')});db[_0x8f6c('0xff')]['belongsTo'](db['User'],{'foreignKey':_0x8f6c('0x1e4'),'as':_0x8f6c('0x1e5')});db['OpenchannelTransferReport'][_0x8f6c('0x12b')](db['OpenchannelQueue'],{'foreignKey':'ToOpenchannelQueueId','as':_0x8f6c('0x1e1')});db[_0x8f6c('0xff')]['belongsTo'](db[_0x8f6c('0x147')],{'foreignKey':_0x8f6c('0x1ea'),'as':'ToAccount'});db[_0x8f6c('0x101')][_0x8f6c('0x12b')](db['SmsMessage'],{});db[_0x8f6c('0x101')]['belongsTo'](db[_0x8f6c('0x5b')],{});db[_0x8f6c('0x101')][_0x8f6c('0x12b')](db[_0x8f6c('0x14a')],{'foreignKey':_0x8f6c('0x1eb'),'as':_0x8f6c('0x1dd')});db[_0x8f6c('0x101')][_0x8f6c('0x12b')](db[_0x8f6c('0x12')],{'foreignKey':'FromUserId','as':'FromAgent'});db['SmsTransferReport']['belongsTo'](db[_0x8f6c('0x12')],{'foreignKey':_0x8f6c('0x1e4'),'as':_0x8f6c('0x1e5')});db[_0x8f6c('0x101')][_0x8f6c('0x12b')](db['SmsQueue'],{'foreignKey':_0x8f6c('0x1ec'),'as':_0x8f6c('0x1e1')});db[_0x8f6c('0x101')][_0x8f6c('0x12b')](db[_0x8f6c('0x14a')],{'foreignKey':_0x8f6c('0x1ed'),'as':_0x8f6c('0x1e3')});db[_0x8f6c('0x103')][_0x8f6c('0x122')](db[_0x8f6c('0x87')],{'as':_0x8f6c('0x189'),'foreignKey':'ListId','onDelete':_0x8f6c('0x120')});db[_0x8f6c('0x103')]['hasMany'](db[_0x8f6c('0x80')],{'as':_0x8f6c('0x1ee'),'foreignKey':_0x8f6c('0x16b')});db['CmList'][_0x8f6c('0x122')](db[_0x8f6c('0x77')],{'as':_0x8f6c('0x12f'),'onDelete':_0x8f6c('0x120'),'foreignKey':_0x8f6c('0x16b')});db[_0x8f6c('0x103')][_0x8f6c('0x122')](db[_0x8f6c('0x7b')],{'as':_0x8f6c('0x125'),'foreignKey':_0x8f6c('0x16b')});db[_0x8f6c('0x103')]['hasMany'](db[_0x8f6c('0x7d')],{'as':_0x8f6c('0x1ef'),'foreignKey':_0x8f6c('0x16b')});db['CmList'][_0x8f6c('0x122')](db['ReportAgentPreview'],{'as':'ReportAgentPreview','foreignKey':_0x8f6c('0x16b')});db[_0x8f6c('0x103')]['belongsToMany'](db[_0x8f6c('0x1b')],{'as':_0x8f6c('0x1f0'),'through':_0x8f6c('0x1f1')});db[_0x8f6c('0x103')][_0x8f6c('0x12d')](db['User'],{'as':_0x8f6c('0x16d'),'through':_0x8f6c('0x143')});db[_0x8f6c('0x104')][_0x8f6c('0x122')](db[_0x8f6c('0x18')],{'as':_0x8f6c('0x124'),'onDelete':_0x8f6c('0x120')});db[_0x8f6c('0x104')]['belongsToMany'](db[_0x8f6c('0x12')],{'as':_0x8f6c('0x16d'),'through':_0x8f6c('0x13b')});db[_0x8f6c('0x104')][_0x8f6c('0x12d')](db[_0x8f6c('0x132')],{'through':'TeamVoicePrefix','as':_0x8f6c('0x15e')});db[_0x8f6c('0x106')][_0x8f6c('0x122')](db[_0x8f6c('0x12')],{'as':_0x8f6c('0x176'),'foreignKey':'userProfileId'});db[_0x8f6c('0x106')][_0x8f6c('0x122')](db[_0x8f6c('0x1f2')],{'as':_0x8f6c('0x1f3'),'foreignKey':'userProfileId','onDelete':_0x8f6c('0x120')});db['UserProfileSection'][_0x8f6c('0x122')](db[_0x8f6c('0x108')],{'as':_0x8f6c('0x1f4'),'foreignKey':_0x8f6c('0x1f5'),'onDelete':_0x8f6c('0x120')});db[_0x8f6c('0x10c')][_0x8f6c('0x122')](db[_0x8f6c('0x87')],{'as':_0x8f6c('0x189'),'foreignKey':_0x8f6c('0x1f6'),'onDelete':_0x8f6c('0x120')});db[_0x8f6c('0x10c')][_0x8f6c('0x122')](db[_0x8f6c('0x85')],{'as':_0x8f6c('0x168'),'foreignKey':_0x8f6c('0x1f6')});db[_0x8f6c('0x10c')]['hasMany'](db[_0x8f6c('0x112')],{'as':'Messages','foreignKey':_0x8f6c('0x1f6')});db['WhatsappAccount'][_0x8f6c('0x122')](db['WhatsappInteraction'],{'as':_0x8f6c('0x169')});db[_0x8f6c('0x10c')]['hasMany'](db[_0x8f6c('0x10e')],{'as':_0x8f6c('0x182')});db[_0x8f6c('0x10c')]['belongsTo'](db[_0x8f6c('0x103')],{'as':_0x8f6c('0x16a'),'foreignKey':_0x8f6c('0x16b')});db[_0x8f6c('0x10c')][_0x8f6c('0x12b')](db[_0x8f6c('0x15b')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db[_0x8f6c('0x10c')][_0x8f6c('0x12d')](db[_0x8f6c('0x12')],{'as':'Agents','through':_0x8f6c('0x1f7')});db[_0x8f6c('0x10e')][_0x8f6c('0x12b')](db[_0x8f6c('0x12')],{'onDelete':'restrict'});db[_0x8f6c('0x10e')][_0x8f6c('0x12b')](db[_0x8f6c('0x116')],{'onDelete':'restrict'});db[_0x8f6c('0x10e')][_0x8f6c('0x12b')](db[_0x8f6c('0x10c')],{'onDelete':_0x8f6c('0x17c')});db[_0x8f6c('0x10e')][_0x8f6c('0x12b')](db[_0x8f6c('0x8a')],{'onDelete':'restrict','foreignKey':'IntervalId'});db[_0x8f6c('0x10e')][_0x8f6c('0x12b')](db[_0x8f6c('0x92')],{'onDelete':_0x8f6c('0x17c'),'foreignKey':_0x8f6c('0x17e')});db['WhatsappInteraction'][_0x8f6c('0x122')](db['WhatsappMessage'],{'as':_0x8f6c('0x161'),'onDelete':_0x8f6c('0x120'),'foreignKey':'WhatsappInteractionId'});db[_0x8f6c('0x110')][_0x8f6c('0x12b')](db['WhatsappAccount'],{'as':_0x8f6c('0x171'),'foreignKey':_0x8f6c('0x1f6')});db['WhatsappInteraction'][_0x8f6c('0x12b')](db[_0x8f6c('0x77')],{'as':_0x8f6c('0x172'),'foreignKey':'ContactId'});db['WhatsappInteraction'][_0x8f6c('0x12b')](db[_0x8f6c('0x12')],{'as':_0x8f6c('0x186'),'foreignKey':'UserId'});db['WhatsappInteraction'][_0x8f6c('0x12d')](db[_0x8f6c('0x92')],{'through':_0x8f6c('0x1b5'),'as':'Tags'});db[_0x8f6c('0x110')]['belongsToMany'](db[_0x8f6c('0x92')],{'through':_0x8f6c('0x1b5'),'as':_0x8f6c('0x175')});db[_0x8f6c('0x110')][_0x8f6c('0x12d')](db['User'],{'as':_0x8f6c('0x176'),'through':_0x8f6c('0x139'),'foreignKey':_0x8f6c('0x1f8')});db[_0x8f6c('0x112')]['belongsTo'](db[_0x8f6c('0x12')],{'as':'User'});db[_0x8f6c('0x112')][_0x8f6c('0x12b')](db[_0x8f6c('0x77')],{'onDelete':_0x8f6c('0x120'),'as':_0x8f6c('0x172')});db[_0x8f6c('0x112')][_0x8f6c('0x12b')](db[_0x8f6c('0x110')],{'onDelete':'cascade','as':_0x8f6c('0x178'),'foreignKey':'WhatsappInteractionId'});db[_0x8f6c('0x112')][_0x8f6c('0x12b')](db[_0x8f6c('0x10c')],{'as':'Account','foreignKey':'WhatsappAccountId'});db[_0x8f6c('0x114')]['belongsTo'](db[_0x8f6c('0x10c')],{});db[_0x8f6c('0x114')]['belongsTo'](db['CmList'],{'as':_0x8f6c('0x16a'),'foreignKey':_0x8f6c('0x16b')});db['WhatsappQueueReport'][_0x8f6c('0x12b')](db['CmContact'],{'as':_0x8f6c('0x172'),'foreignKey':_0x8f6c('0x165')});db[_0x8f6c('0x114')][_0x8f6c('0x12b')](db['WhatsappInteraction'],{});db['WhatsappQueueReport']['belongsTo'](db[_0x8f6c('0x116')],{});db['WhatsappQueueReport']['belongsTo'](db[_0x8f6c('0x112')],{});db[_0x8f6c('0x114')]['belongsTo'](db[_0x8f6c('0x12')],{});db[_0x8f6c('0x115')][_0x8f6c('0x12b')](db[_0x8f6c('0x112')],{});db['WhatsappTransferReport'][_0x8f6c('0x12b')](db['WhatsappInteraction'],{});db['WhatsappTransferReport'][_0x8f6c('0x12b')](db[_0x8f6c('0x10c')],{'foreignKey':_0x8f6c('0x1f9'),'as':_0x8f6c('0x1dd')});db[_0x8f6c('0x115')][_0x8f6c('0x12b')](db[_0x8f6c('0x10c')],{'foreignKey':_0x8f6c('0x1fa'),'as':_0x8f6c('0x1e3')});db['WhatsappTransferReport'][_0x8f6c('0x12b')](db[_0x8f6c('0x116')],{'foreignKey':_0x8f6c('0x1fb'),'as':_0x8f6c('0x1e1')});db[_0x8f6c('0x115')][_0x8f6c('0x12b')](db[_0x8f6c('0x12')],{'foreignKey':_0x8f6c('0x1de'),'as':_0x8f6c('0x1df')});db['WhatsappTransferReport'][_0x8f6c('0x12b')](db[_0x8f6c('0x12')],{'foreignKey':_0x8f6c('0x1e4'),'as':_0x8f6c('0x1e5')});db[_0x8f6c('0x116')][_0x8f6c('0x12d')](db['User'],{'as':'Agents','through':_0x8f6c('0x142'),'foreignKey':'WhatsappQueueId'});db[_0x8f6c('0x116')][_0x8f6c('0x12d')](db[_0x8f6c('0x132')],{'through':_0x8f6c('0x1d7'),'as':_0x8f6c('0x15e')});module[_0x8f6c('0x1fc')]={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index 6c1e12d..aaa7d0b 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x93f6=['./api/voiceQueuesLog','/api/schedules','/api/sounds','./api/sound','/api/tags','/api/templates','/api/variables','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','/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/intZendeskField','/api/integrations/freshdesk/accounts','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./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/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','./api/squareRecording','/api/square/messages','./api/squareMessage','./api/license','/api/campaigns','./api/campaign','/api/migrations','./api/migration','/api/attachments','./api/attachment','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','/api/cm/lists','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfile','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','./api/whatsappApplication','./api/whatsappInteraction','/api/whatsapp/messages','/api/whatsapp/reports/queue','/api/whatsapp/queues','/api/cloudProviders','./api/cloudProvider','/api/realtime','/api/auth/local','./api/authLocal','/api/jira','/api/rpc','./api/rpc','/api/version','/api/system','./api/system','/api/pm2','./api/pm2','/api/webbar','./api/webbar','/apidoc','join','/www','static','root','/demo','/snippet','/plugins','/server/files/plugins','route','get','sendFile','resolve','appPath','/index.html','username','password','newPassword','apiKey','firstName','lastName','phone','mobile','clientId','clientSecret','securityToken','code','accessKey','tenantId','channelSecret','accessTokenSecret','authToken','consumerKey','consumerSecret','calleridnum','exten','privateKey','accesskeyid','secretaccesskey','accountSid','localstationid','secret','registry','oldPassword','isPlainObject','}@@','replace','lodash','path','express','express-winston','./config/environment','api','./config/logger','auth','default','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','body','\x20body=%s','method','x-forwarded-for','headers','connection','statusCode','user','name','role','inspect','use','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','format','remoteAddress','responseTime','agent_name','test','url','./api/user','/api/voice/chanspy','./api/voiceChanSpy','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','./api/voiceMailMessage','/api/voice/dials/reports','/api/voice/agents/reports','./api/voiceAgentReport','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailSubstatus','/api/mail/interactions','/api/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','/api/dashboards','./api/dashboard','/api/dashboards/items','/api/fax/accounts','./api/faxAccount','/api/fax/applications','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsInteraction','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','/api/chat/websites','./api/chatWebsite','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/groups','/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/cm/custom_fields','./api/cmCustomField','./api/action','/api/automations','./api/automation','/api/canned_answers','/api/dispositions','./api/disposition','./api/condition','/api/pauses','./api/pause','/api/voiceQueuesLog'];(function(_0x2a3542,_0x5494d2){var _0xef0c09=function(_0x45d535){while(--_0x45d535){_0x2a3542['push'](_0x2a3542['shift']());}};_0xef0c09(++_0x5494d2);}(_0x93f6,0xc2));var _0x693f=function(_0x2d0ba4,_0x2182ab){_0x2d0ba4=_0x2d0ba4-0x0;var _0x3d7822=_0x93f6[_0x2d0ba4];return _0x3d7822;};'use strict';var _=require(_0x693f('0x0'));var path=require(_0x693f('0x1'));var express=require(_0x693f('0x2'));var ewinston=require(_0x693f('0x3'));var util=require('util');var errors=require('./errors');var config=require(_0x693f('0x4'));var logger=require('./config/logger')(_0x693f('0x5'));var authLogger=require(_0x693f('0x6'))(_0x693f('0x7'));exports[_0x693f('0x8')]=function(_0x30a389){_0x30a389['use'](ewinston[_0x693f('0x9')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x42e8ee,_0x24efe0){var _0x5964df=_0x693f('0xa');if(!_['isEmpty'](_0x42e8ee[_0x693f('0xb')])){_0x5964df+=_0x693f('0xc');var _0x3038cc=_0x42e8ee[_0x693f('0xb')];maskSensitiveData(_0x3038cc);}return util['format'](_0x5964df,_0x42e8ee[_0x693f('0xd')],_0x42e8ee['headers'][_0x693f('0xe')]?_0x42e8ee[_0x693f('0xf')][_0x693f('0xe')]:_0x42e8ee[_0x693f('0x10')]['remoteAddress']||_0x42e8ee['ip'],_0x42e8ee['url'],_0x24efe0[_0x693f('0x11')],_0x24efe0['responseTime'],_0x42e8ee['user']?_0x42e8ee[_0x693f('0x12')]['id']:null,_0x42e8ee['user']?_0x42e8ee[_0x693f('0x12')][_0x693f('0x13')]:null,_0x42e8ee[_0x693f('0x12')]?_0x42e8ee[_0x693f('0x12')][_0x693f('0x14')]:null,_0x3038cc?util[_0x693f('0x15')](_0x3038cc,![],null):'');}}));_0x30a389[_0x693f('0x16')](ewinston[_0x693f('0x9')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x4f8cde,_0x6eff13){var _0x107d0c='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s';if(_0x4f8cde['body']&&_0x4f8cde[_0x693f('0xb')][_0x693f('0x17')]&&_0x4f8cde[_0x693f('0xb')][_0x693f('0x18')]){_0x107d0c=_0x693f('0x19');}return util[_0x693f('0x1a')](_0x107d0c,_0x4f8cde[_0x693f('0xd')],_0x4f8cde['headers'][_0x693f('0xe')]?_0x4f8cde[_0x693f('0xf')][_0x693f('0xe')]:_0x4f8cde[_0x693f('0x10')][_0x693f('0x1b')]||_0x4f8cde['ip'],_0x4f8cde['url'],_0x6eff13[_0x693f('0x11')],_0x6eff13[_0x693f('0x1c')],_0x4f8cde[_0x693f('0x12')]?_0x4f8cde[_0x693f('0x12')]['id']:null,_0x4f8cde[_0x693f('0x12')]?_0x4f8cde[_0x693f('0x12')][_0x693f('0x13')]:null,_0x4f8cde['user']?_0x4f8cde['user']['role']:null,_0x4f8cde[_0x693f('0xb')]&&_0x4f8cde[_0x693f('0xb')]['device']?_0x4f8cde[_0x693f('0xb')][_0x693f('0x17')]:'other',_0x4f8cde[_0x693f('0xb')]&&_0x4f8cde['body'][_0x693f('0x18')]?_0x4f8cde[_0x693f('0xb')]['agent_id']:'',_0x4f8cde[_0x693f('0xb')]&&_0x4f8cde[_0x693f('0xb')][_0x693f('0x1d')]?_0x4f8cde[_0x693f('0xb')][_0x693f('0x1d')]:'');},'ignoreRoute':function(_0x5d0542){var _0x31c7bf=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x31c7bf[_0x693f('0x1e')](_0x5d0542[_0x693f('0x1f')]);}}));_0x30a389[_0x693f('0x16')]('/api/users',require(_0x693f('0x20')));_0x30a389[_0x693f('0x16')](_0x693f('0x21'),require(_0x693f('0x22')));_0x30a389[_0x693f('0x16')]('/api/voice/contexts',require(_0x693f('0x23')));_0x30a389[_0x693f('0x16')](_0x693f('0x24'),require(_0x693f('0x25')));_0x30a389[_0x693f('0x16')](_0x693f('0x26'),require('./api/voiceMusicOnHold'));_0x30a389['use'](_0x693f('0x27'),require(_0x693f('0x28')));_0x30a389[_0x693f('0x16')](_0x693f('0x29'),require(_0x693f('0x2a')));_0x30a389[_0x693f('0x16')](_0x693f('0x2b'),require(_0x693f('0x2c')));_0x30a389[_0x693f('0x16')](_0x693f('0x2d'),require(_0x693f('0x2e')));_0x30a389['use']('/api/voice/mails/messages',require(_0x693f('0x2f')));_0x30a389[_0x693f('0x16')]('/api/voice/calls/reports',require('./api/voiceCallReport'));_0x30a389[_0x693f('0x16')](_0x693f('0x30'),require('./api/voiceDialReport'));_0x30a389[_0x693f('0x16')](_0x693f('0x31'),require(_0x693f('0x32')));_0x30a389[_0x693f('0x16')]('/api/voice/queues/reports',require(_0x693f('0x33')));_0x30a389[_0x693f('0x16')](_0x693f('0x34'),require(_0x693f('0x35')));_0x30a389['use'](_0x693f('0x36'),require(_0x693f('0x37')));_0x30a389['use']('/api/voice/transfers/reports',require('./api/voiceTransferReport'));_0x30a389['use']('/api/mail/out_servers',require(_0x693f('0x38')));_0x30a389[_0x693f('0x16')](_0x693f('0x39'),require(_0x693f('0x3a')));_0x30a389[_0x693f('0x16')](_0x693f('0x3b'),require('./api/mailQueue'));_0x30a389[_0x693f('0x16')]('/api/mail/substatuses',require(_0x693f('0x3c')));_0x30a389[_0x693f('0x16')](_0x693f('0x3d'),require('./api/mailInteraction'));_0x30a389[_0x693f('0x16')](_0x693f('0x3e'),require(_0x693f('0x3f')));_0x30a389[_0x693f('0x16')](_0x693f('0x40'),require(_0x693f('0x41')));_0x30a389['use'](_0x693f('0x42'),require('./api/mailQueueReport'));_0x30a389['use'](_0x693f('0x43'),require(_0x693f('0x44')));_0x30a389[_0x693f('0x16')](_0x693f('0x45'),require('./api/dashboardItem'));_0x30a389['use'](_0x693f('0x46'),require(_0x693f('0x47')));_0x30a389['use'](_0x693f('0x48'),require('./api/faxApplication'));_0x30a389[_0x693f('0x16')](_0x693f('0x49'),require(_0x693f('0x4a')));_0x30a389[_0x693f('0x16')](_0x693f('0x4b'),require('./api/faxMessage'));_0x30a389[_0x693f('0x16')](_0x693f('0x4c'),require(_0x693f('0x4d')));_0x30a389['use'](_0x693f('0x4e'),require(_0x693f('0x4f')));_0x30a389[_0x693f('0x16')](_0x693f('0x50'),require(_0x693f('0x51')));_0x30a389[_0x693f('0x16')](_0x693f('0x52'),require('./api/smsApplication'));_0x30a389[_0x693f('0x16')]('/api/sms/interactions',require(_0x693f('0x53')));_0x30a389[_0x693f('0x16')]('/api/sms/messages',require(_0x693f('0x54')));_0x30a389['use'](_0x693f('0x55'),require(_0x693f('0x56')));_0x30a389[_0x693f('0x16')](_0x693f('0x57'),require(_0x693f('0x58')));_0x30a389[_0x693f('0x16')](_0x693f('0x59'),require(_0x693f('0x5a')));_0x30a389[_0x693f('0x16')](_0x693f('0x5b'),require(_0x693f('0x5c')));_0x30a389['use'](_0x693f('0x5d'),require(_0x693f('0x5e')));_0x30a389['use'](_0x693f('0x5f'),require('./api/openchannelQueue'));_0x30a389[_0x693f('0x16')](_0x693f('0x60'),require(_0x693f('0x61')));_0x30a389[_0x693f('0x16')]('/api/openchannel/reports/queue',require(_0x693f('0x62')));_0x30a389['use'](_0x693f('0x63'),require(_0x693f('0x64')));_0x30a389[_0x693f('0x16')](_0x693f('0x65'),require(_0x693f('0x66')));_0x30a389[_0x693f('0x16')](_0x693f('0x67'),require(_0x693f('0x68')));_0x30a389[_0x693f('0x16')](_0x693f('0x69'),require(_0x693f('0x6a')));_0x30a389[_0x693f('0x16')]('/api/chat/queues',require('./api/chatQueue'));_0x30a389[_0x693f('0x16')](_0x693f('0x6b'),require('./api/chatGroup'));_0x30a389[_0x693f('0x16')](_0x693f('0x6c'),require(_0x693f('0x6d')));_0x30a389['use'](_0x693f('0x6e'),require(_0x693f('0x6f')));_0x30a389[_0x693f('0x16')](_0x693f('0x70'),require(_0x693f('0x71')));_0x30a389['use'](_0x693f('0x72'),require(_0x693f('0x73')));_0x30a389[_0x693f('0x16')](_0x693f('0x74'),require(_0x693f('0x75')));_0x30a389[_0x693f('0x16')](_0x693f('0x76'),require(_0x693f('0x77')));_0x30a389['use'](_0x693f('0x78'),require(_0x693f('0x79')));_0x30a389['use'](_0x693f('0x7a'),require(_0x693f('0x7b')));_0x30a389[_0x693f('0x16')]('/api/actions',require(_0x693f('0x7c')));_0x30a389[_0x693f('0x16')](_0x693f('0x7d'),require(_0x693f('0x7e')));_0x30a389[_0x693f('0x16')](_0x693f('0x7f'),require('./api/cannedAnswer'));_0x30a389[_0x693f('0x16')](_0x693f('0x80'),require(_0x693f('0x81')));_0x30a389[_0x693f('0x16')]('/api/conditions',require(_0x693f('0x82')));_0x30a389[_0x693f('0x16')]('/api/intervals',require('./api/interval'));_0x30a389['use'](_0x693f('0x83'),require(_0x693f('0x84')));_0x30a389['use']('/api/cdr',require('./api/cdr'));_0x30a389['use'](_0x693f('0x85'),require(_0x693f('0x86')));_0x30a389[_0x693f('0x16')](_0x693f('0x87'),require('./api/schedule'));_0x30a389[_0x693f('0x16')](_0x693f('0x88'),require(_0x693f('0x89')));_0x30a389[_0x693f('0x16')](_0x693f('0x8a'),require('./api/tag'));_0x30a389[_0x693f('0x16')](_0x693f('0x8b'),require('./api/template'));_0x30a389[_0x693f('0x16')]('/api/triggers',require('./api/trigger'));_0x30a389[_0x693f('0x16')](_0x693f('0x8c'),require(_0x693f('0x8d')));_0x30a389[_0x693f('0x16')](_0x693f('0x8e'),require(_0x693f('0x8f')));_0x30a389[_0x693f('0x16')](_0x693f('0x90'),require(_0x693f('0x91')));_0x30a389[_0x693f('0x16')](_0x693f('0x92'),require(_0x693f('0x93')));_0x30a389['use'](_0x693f('0x94'),require(_0x693f('0x95')));_0x30a389[_0x693f('0x16')]('/api/analytics/extracted_reports',require(_0x693f('0x96')));_0x30a389[_0x693f('0x16')](_0x693f('0x97'),require(_0x693f('0x98')));_0x30a389[_0x693f('0x16')](_0x693f('0x99'),require(_0x693f('0x9a')));_0x30a389[_0x693f('0x16')](_0x693f('0x9b'),require(_0x693f('0x9c')));_0x30a389[_0x693f('0x16')]('/api/integrations/salesforce/accounts',require(_0x693f('0x9d')));_0x30a389['use'](_0x693f('0x9e'),require(_0x693f('0x9f')));_0x30a389[_0x693f('0x16')](_0x693f('0xa0'),require(_0x693f('0xa1')));_0x30a389[_0x693f('0x16')]('/api/integrations/sugarcrm/accounts',require(_0x693f('0xa2')));_0x30a389[_0x693f('0x16')](_0x693f('0xa3'),require(_0x693f('0xa4')));_0x30a389[_0x693f('0x16')](_0x693f('0xa5'),require('./api/intSugarcrmField'));_0x30a389[_0x693f('0x16')](_0x693f('0xa6'),require(_0x693f('0xa7')));_0x30a389[_0x693f('0x16')](_0x693f('0xa8'),require(_0x693f('0xa9')));_0x30a389['use'](_0x693f('0xaa'),require(_0x693f('0xab')));_0x30a389['use'](_0x693f('0xac'),require(_0x693f('0xad')));_0x30a389[_0x693f('0x16')](_0x693f('0xae'),require('./api/intZohoConfiguration'));_0x30a389[_0x693f('0x16')](_0x693f('0xaf'),require(_0x693f('0xb0')));_0x30a389['use'](_0x693f('0xb1'),require(_0x693f('0xb2')));_0x30a389[_0x693f('0x16')](_0x693f('0xb3'),require(_0x693f('0xb4')));_0x30a389[_0x693f('0x16')]('/api/integrations/zendesk/fields',require(_0x693f('0xb5')));_0x30a389[_0x693f('0x16')](_0x693f('0xb6'),require('./api/intFreshdeskAccount'));_0x30a389[_0x693f('0x16')](_0x693f('0xb7'),require(_0x693f('0xb8')));_0x30a389[_0x693f('0x16')](_0x693f('0xb9'),require('./api/intFreshdeskField'));_0x30a389[_0x693f('0x16')]('/api/integrations/vtiger/accounts',require('./api/intVtigerAccount'));_0x30a389['use'](_0x693f('0xba'),require(_0x693f('0xbb')));_0x30a389[_0x693f('0x16')](_0x693f('0xbc'),require(_0x693f('0xbd')));_0x30a389[_0x693f('0x16')](_0x693f('0xbe'),require(_0x693f('0xbf')));_0x30a389[_0x693f('0x16')](_0x693f('0xc0'),require(_0x693f('0xc1')));_0x30a389[_0x693f('0x16')](_0x693f('0xc2'),require(_0x693f('0xc3')));_0x30a389[_0x693f('0x16')](_0x693f('0xc4'),require(_0x693f('0xc5')));_0x30a389[_0x693f('0x16')](_0x693f('0xc6'),require(_0x693f('0xc7')));_0x30a389['use'](_0x693f('0xc8'),require(_0x693f('0xc9')));_0x30a389[_0x693f('0x16')](_0x693f('0xca'),require(_0x693f('0xcb')));_0x30a389[_0x693f('0x16')]('/api/integrations/freshsales/configurations',require(_0x693f('0xcc')));_0x30a389[_0x693f('0x16')](_0x693f('0xcd'),require(_0x693f('0xce')));_0x30a389[_0x693f('0x16')](_0x693f('0xcf'),require(_0x693f('0xd0')));_0x30a389['use'](_0x693f('0xd1'),require(_0x693f('0xd2')));_0x30a389[_0x693f('0x16')](_0x693f('0xd3'),require(_0x693f('0xd4')));_0x30a389[_0x693f('0x16')](_0x693f('0xd5'),require('./api/jscriptyAnswerReport'));_0x30a389[_0x693f('0x16')]('/api/jscripty/questions/reports',require(_0x693f('0xd6')));_0x30a389[_0x693f('0x16')](_0x693f('0xd7'),require(_0x693f('0xd8')));_0x30a389[_0x693f('0x16')](_0x693f('0xd9'),require('./api/smsQueueReport'));_0x30a389[_0x693f('0x16')](_0x693f('0xda'),require(_0x693f('0xdb')));_0x30a389[_0x693f('0x16')](_0x693f('0xdc'),require(_0x693f('0xdd')));_0x30a389[_0x693f('0x16')](_0x693f('0xde'),require(_0x693f('0xdf')));_0x30a389[_0x693f('0x16')](_0x693f('0xe0'),require(_0x693f('0xe1')));_0x30a389['use'](_0x693f('0xe2'),require(_0x693f('0xe3')));_0x30a389['use'](_0x693f('0xe4'),require(_0x693f('0xe5')));_0x30a389[_0x693f('0x16')]('/api/square/recordings',require(_0x693f('0xe6')));_0x30a389['use'](_0x693f('0xe7'),require(_0x693f('0xe8')));_0x30a389['use']('/api/teams',require('./api/team'));_0x30a389['use']('/api/license',require(_0x693f('0xe9')));_0x30a389[_0x693f('0x16')](_0x693f('0xea'),require(_0x693f('0xeb')));_0x30a389[_0x693f('0x16')](_0x693f('0xec'),require(_0x693f('0xed')));_0x30a389['use'](_0x693f('0xee'),require(_0x693f('0xef')));_0x30a389['use'](_0x693f('0xf0'),require(_0x693f('0xf1')));_0x30a389[_0x693f('0x16')](_0x693f('0xf2'),require(_0x693f('0xf3')));_0x30a389[_0x693f('0x16')](_0x693f('0xf4'),require(_0x693f('0xf5')));_0x30a389[_0x693f('0x16')]('/api/fax/reports/transfer',require('./api/faxTransferReport'));_0x30a389['use'](_0x693f('0xf6'),require(_0x693f('0xf7')));_0x30a389[_0x693f('0x16')](_0x693f('0xf8'),require('./api/smsTransferReport'));_0x30a389[_0x693f('0x16')](_0x693f('0xf9'),require('./api/cmList'));_0x30a389[_0x693f('0x16')](_0x693f('0xfa'),require(_0x693f('0xfb')));_0x30a389[_0x693f('0x16')](_0x693f('0xfc'),require(_0x693f('0xfd')));_0x30a389[_0x693f('0x16')]('/api/userProfile/sections',require(_0x693f('0xfe')));_0x30a389['use'](_0x693f('0xff'),require(_0x693f('0x100')));_0x30a389[_0x693f('0x16')](_0x693f('0x101'),require(_0x693f('0x102')));_0x30a389[_0x693f('0x16')](_0x693f('0x103'),require(_0x693f('0x104')));_0x30a389['use']('/api/whatsapp/applications',require(_0x693f('0x105')));_0x30a389[_0x693f('0x16')]('/api/whatsapp/interactions',require(_0x693f('0x106')));_0x30a389[_0x693f('0x16')](_0x693f('0x107'),require('./api/whatsappMessage'));_0x30a389[_0x693f('0x16')](_0x693f('0x108'),require('./api/whatsappQueueReport'));_0x30a389[_0x693f('0x16')]('/api/whatsapp/reports/transfer',require('./api/whatsappTransferReport'));_0x30a389['use'](_0x693f('0x109'),require('./api/whatsappQueue'));_0x30a389['use'](_0x693f('0x10a'),require(_0x693f('0x10b')));_0x30a389[_0x693f('0x16')](_0x693f('0x10c'),require('./api/realtime'));_0x30a389[_0x693f('0x16')](_0x693f('0x10d'),require(_0x693f('0x10e')));_0x30a389[_0x693f('0x16')]('/api/auth/google',require('./api/authGoogle'));_0x30a389[_0x693f('0x16')](_0x693f('0x10f'),require('./api/jira'));_0x30a389['use'](_0x693f('0x110'),require(_0x693f('0x111')));_0x30a389[_0x693f('0x16')](_0x693f('0x112'),require('./api/version'));_0x30a389[_0x693f('0x16')](_0x693f('0x113'),require(_0x693f('0x114')));_0x30a389[_0x693f('0x16')](_0x693f('0x115'),require(_0x693f('0x116')));_0x30a389[_0x693f('0x16')](_0x693f('0x117'),require(_0x693f('0x118')));_0x30a389[_0x693f('0x16')](_0x693f('0x119'),express['static'](path[_0x693f('0x11a')](config['root'],_0x693f('0x119'))));_0x30a389[_0x693f('0x16')](_0x693f('0x11b'),express[_0x693f('0x11c')](path[_0x693f('0x11a')](config[_0x693f('0x11d')],_0x693f('0x11b'))));_0x30a389[_0x693f('0x16')](_0x693f('0x11e'),express[_0x693f('0x11c')](path['join'](config[_0x693f('0x11d')],_0x693f('0x11e'))));_0x30a389[_0x693f('0x16')](_0x693f('0x11f'),express[_0x693f('0x11c')](path[_0x693f('0x11a')](config[_0x693f('0x11d')],'snippet','3.0.0')));_0x30a389[_0x693f('0x16')](_0x693f('0x120'),express[_0x693f('0x11c')](path[_0x693f('0x11a')](config[_0x693f('0x11d')],_0x693f('0x121'))));_0x30a389['route']('/:url(api|auth|components|app|bower_components|assets)/*')['get'](errors[0x194]);_0x30a389[_0x693f('0x122')]('/*')[_0x693f('0x123')](function(_0x1e4add,_0x5b0936){_0x5b0936[_0x693f('0x124')](path[_0x693f('0x125')](_0x30a389[_0x693f('0x123')](_0x693f('0x126'))+_0x693f('0x127')));});};var sensitiveFields=[_0x693f('0x128'),_0x693f('0x129'),_0x693f('0x12a'),_0x693f('0x12b'),_0x693f('0x12c'),_0x693f('0x12d'),'street',_0x693f('0x12e'),_0x693f('0x12f'),'fax','email',_0x693f('0x130'),_0x693f('0x131'),_0x693f('0x132'),_0x693f('0x133'),_0x693f('0x134'),_0x693f('0x135'),'token',_0x693f('0x136'),'accessToken',_0x693f('0x137'),_0x693f('0x138'),_0x693f('0x139'),_0x693f('0x13a'),'membername','calleridname',_0x693f('0x13b'),_0x693f('0x13c'),'vidaooApiKey','clientEmail',_0x693f('0x13d'),_0x693f('0x13e'),_0x693f('0x13f'),'key','user','pass',_0x693f('0x140'),_0x693f('0x141'),'dsn',_0x693f('0x142'),_0x693f('0x143'),_0x693f('0x144')];function maskSensitiveData(_0x1db350){var _0x205e7b=/(?!^)[\s\S](?!$)/g;if(!_[_0x693f('0x145')](_0x1db350))return;for(var _0x5a307e in _0x1db350){if(_['isArray'](_0x1db350[_0x5a307e])){for(var _0xa25ba=0x0;_0xa25ba<_0x1db350[_0x5a307e]['length'];_0xa25ba++){maskSensitiveData(_0x1db350[_0x5a307e][_0xa25ba]);}}else if(_[_0x693f('0x145')](_0x1db350[_0x5a307e])){maskSensitiveData(_0x1db350[_0x5a307e]);}else if(_['isString'](_0x1db350[_0x5a307e])){_0x1db350[_0x5a307e]=_0x1db350[_0x5a307e]['replace'](/{{{/g,'@@{')['replace'](/}}}/g,_0x693f('0x146'))[_0x693f('0x147')](/{{/g,'@{')[_0x693f('0x147')](/}}/g,'}@');if(_['includes'](sensitiveFields,_0x5a307e)){_0x1db350[_0x5a307e]=_0x1db350[_0x5a307e][_0x693f('0x147')](_0x205e7b,'*');}}}} \ No newline at end of file +var _0xc51c=['express','express-winston','./errors','./config/environment','api','./config/logger','auth','use','logger','body','format','method','headers','connection','remoteAddress','url','statusCode','user','role','inspect','device','agent_id','x-forwarded-for','name','other','agent_name','test','./api/user','./api/voiceChanSpy','/api/voice/contexts','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceAgentReport','/api/members/reports','./api/memberReport','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/interactions','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/dashboardItem','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','/api/fax/queues','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','/api/sms/queues','./api/smsQueue','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','./api/chatApplication','/api/chat/interactions','./api/chatMessage','./api/chatOfflineMessage','/api/chat/groups','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','./api/action','/api/automations','/api/canned_answers','./api/cannedAnswer','/api/dispositions','/api/conditions','./api/condition','/api/intervals','./api/interval','./api/pause','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','/api/sounds','./api/sound','./api/tag','/api/triggers','./api/trigger','/api/variables','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','./api/analyticCustomReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','./api/intSalesforceAccount','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','./api/intZohoField','./api/intZendeskAccount','./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/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','/api/integrations/servicenow/accounts','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','./api/team','/api/license','./api/license','/api/campaigns','./api/campaign','/api/migrations','/api/attachments','./api/attachment','/api/plugins','./api/mailTransferReport','./api/chatTransferReport','/api/fax/reports/transfer','./api/openchannelTransferReport','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','./api/cloudProvider','/api/realtime','./api/realtime','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','/api/rpc','./api/rpc','./api/version','/api/system','./api/system','/api/pm2','./api/pm2','./api/webbar','/apidoc','static','join','root','/demo','/snippet','snippet','3.0.0','/server/files/plugins','/:url(api|auth|components|app|bower_components|assets)/*','get','route','sendFile','resolve','appPath','/index.html','newPassword','lastName','mobile','fax','email','clientId','clientSecret','securityToken','code','accessKey','tenantId','token','channelSecret','accessToken','authToken','consumerSecret','membername','calleridname','calleridnum','vidaooApiKey','clientEmail','privateKey','accesskeyid','secretaccesskey','pass','accountSid','localstationid','dsn','registry','oldPassword','isPlainObject','length','isString','replace','@@{','}@@','includes','lodash','path'];(function(_0x580c79,_0x5dae47){var _0x1f6577=function(_0x2f9395){while(--_0x2f9395){_0x580c79['push'](_0x580c79['shift']());}};_0x1f6577(++_0x5dae47);}(_0xc51c,0x140));var _0xcc51=function(_0x2f9ae0,_0x554af5){_0x2f9ae0=_0x2f9ae0-0x0;var _0x48c532=_0xc51c[_0x2f9ae0];return _0x48c532;};'use strict';var _=require(_0xcc51('0x0'));var path=require(_0xcc51('0x1'));var express=require(_0xcc51('0x2'));var ewinston=require(_0xcc51('0x3'));var util=require('util');var errors=require(_0xcc51('0x4'));var config=require(_0xcc51('0x5'));var logger=require('./config/logger')(_0xcc51('0x6'));var authLogger=require(_0xcc51('0x7'))(_0xcc51('0x8'));exports['default']=function(_0x329df0){_0x329df0[_0xcc51('0x9')](ewinston[_0xcc51('0xa')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x10fc19,_0x5a07cc){var _0x3e99f4='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s';if(!_['isEmpty'](_0x10fc19['body'])){_0x3e99f4+='\x20body=%s';var _0xa70a02=_0x10fc19[_0xcc51('0xb')];maskSensitiveData(_0xa70a02);}return util[_0xcc51('0xc')](_0x3e99f4,_0x10fc19[_0xcc51('0xd')],_0x10fc19[_0xcc51('0xe')]['x-forwarded-for']?_0x10fc19['headers']['x-forwarded-for']:_0x10fc19[_0xcc51('0xf')][_0xcc51('0x10')]||_0x10fc19['ip'],_0x10fc19[_0xcc51('0x11')],_0x5a07cc[_0xcc51('0x12')],_0x5a07cc['responseTime'],_0x10fc19[_0xcc51('0x13')]?_0x10fc19[_0xcc51('0x13')]['id']:null,_0x10fc19[_0xcc51('0x13')]?_0x10fc19['user']['name']:null,_0x10fc19['user']?_0x10fc19[_0xcc51('0x13')][_0xcc51('0x14')]:null,_0xa70a02?util[_0xcc51('0x15')](_0xa70a02,![],null):'');}}));_0x329df0[_0xcc51('0x9')](ewinston[_0xcc51('0xa')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x2c18a0,_0x3ae8d5){var _0x333cfc='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s';if(_0x2c18a0[_0xcc51('0xb')]&&_0x2c18a0['body'][_0xcc51('0x16')]&&_0x2c18a0['body'][_0xcc51('0x17')]){_0x333cfc='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)';}return util[_0xcc51('0xc')](_0x333cfc,_0x2c18a0['method'],_0x2c18a0[_0xcc51('0xe')][_0xcc51('0x18')]?_0x2c18a0[_0xcc51('0xe')][_0xcc51('0x18')]:_0x2c18a0[_0xcc51('0xf')][_0xcc51('0x10')]||_0x2c18a0['ip'],_0x2c18a0[_0xcc51('0x11')],_0x3ae8d5[_0xcc51('0x12')],_0x3ae8d5['responseTime'],_0x2c18a0[_0xcc51('0x13')]?_0x2c18a0['user']['id']:null,_0x2c18a0['user']?_0x2c18a0['user'][_0xcc51('0x19')]:null,_0x2c18a0[_0xcc51('0x13')]?_0x2c18a0[_0xcc51('0x13')][_0xcc51('0x14')]:null,_0x2c18a0[_0xcc51('0xb')]&&_0x2c18a0[_0xcc51('0xb')][_0xcc51('0x16')]?_0x2c18a0['body'][_0xcc51('0x16')]:_0xcc51('0x1a'),_0x2c18a0[_0xcc51('0xb')]&&_0x2c18a0[_0xcc51('0xb')][_0xcc51('0x17')]?_0x2c18a0[_0xcc51('0xb')]['agent_id']:'',_0x2c18a0[_0xcc51('0xb')]&&_0x2c18a0[_0xcc51('0xb')]['agent_name']?_0x2c18a0[_0xcc51('0xb')][_0xcc51('0x1b')]:'');},'ignoreRoute':function(_0x3f0a67){var _0x56c486=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x56c486[_0xcc51('0x1c')](_0x3f0a67[_0xcc51('0x11')]);}}));_0x329df0[_0xcc51('0x9')]('/api/users',require(_0xcc51('0x1d')));_0x329df0[_0xcc51('0x9')]('/api/voice/chanspy',require(_0xcc51('0x1e')));_0x329df0[_0xcc51('0x9')](_0xcc51('0x1f'),require('./api/voiceContext'));_0x329df0[_0xcc51('0x9')](_0xcc51('0x20'),require(_0xcc51('0x21')));_0x329df0[_0xcc51('0x9')](_0xcc51('0x22'),require(_0xcc51('0x23')));_0x329df0[_0xcc51('0x9')](_0xcc51('0x24'),require(_0xcc51('0x25')));_0x329df0[_0xcc51('0x9')](_0xcc51('0x26'),require(_0xcc51('0x27')));_0x329df0[_0xcc51('0x9')]('/api/screen/recordings',require('./api/screenRecording'));_0x329df0['use']('/api/voice/mails',require(_0xcc51('0x28')));_0x329df0[_0xcc51('0x9')](_0xcc51('0x29'),require(_0xcc51('0x2a')));_0x329df0[_0xcc51('0x9')](_0xcc51('0x2b'),require(_0xcc51('0x2c')));_0x329df0[_0xcc51('0x9')](_0xcc51('0x2d'),require('./api/voiceDialReport'));_0x329df0['use']('/api/voice/agents/reports',require(_0xcc51('0x2e')));_0x329df0['use']('/api/voice/queues/reports',require('./api/voiceQueueReport'));_0x329df0[_0xcc51('0x9')](_0xcc51('0x2f'),require(_0xcc51('0x30')));_0x329df0[_0xcc51('0x9')]('/api/trunks',require(_0xcc51('0x31')));_0x329df0[_0xcc51('0x9')](_0xcc51('0x32'),require(_0xcc51('0x33')));_0x329df0['use']('/api/mail/out_servers',require('./api/mailServerOut'));_0x329df0[_0xcc51('0x9')](_0xcc51('0x34'),require(_0xcc51('0x35')));_0x329df0[_0xcc51('0x9')](_0xcc51('0x36'),require(_0xcc51('0x37')));_0x329df0[_0xcc51('0x9')]('/api/mail/substatuses',require('./api/mailSubstatus'));_0x329df0['use'](_0xcc51('0x38'),require('./api/mailInteraction'));_0x329df0[_0xcc51('0x9')]('/api/mail/messages',require(_0xcc51('0x39')));_0x329df0[_0xcc51('0x9')](_0xcc51('0x3a'),require(_0xcc51('0x3b')));_0x329df0[_0xcc51('0x9')]('/api/mail/reports/queue',require('./api/mailQueueReport'));_0x329df0['use'](_0xcc51('0x3c'),require(_0xcc51('0x3d')));_0x329df0[_0xcc51('0x9')](_0xcc51('0x3e'),require(_0xcc51('0x3f')));_0x329df0['use']('/api/fax/accounts',require(_0xcc51('0x40')));_0x329df0[_0xcc51('0x9')](_0xcc51('0x41'),require(_0xcc51('0x42')));_0x329df0['use'](_0xcc51('0x43'),require(_0xcc51('0x44')));_0x329df0[_0xcc51('0x9')](_0xcc51('0x45'),require('./api/faxMessage'));_0x329df0['use'](_0xcc51('0x46'),require('./api/faxQueue'));_0x329df0['use'](_0xcc51('0x47'),require(_0xcc51('0x48')));_0x329df0[_0xcc51('0x9')](_0xcc51('0x49'),require(_0xcc51('0x4a')));_0x329df0[_0xcc51('0x9')](_0xcc51('0x4b'),require(_0xcc51('0x4c')));_0x329df0['use'](_0xcc51('0x4d'),require(_0xcc51('0x4e')));_0x329df0[_0xcc51('0x9')](_0xcc51('0x4f'),require('./api/smsMessage'));_0x329df0[_0xcc51('0x9')](_0xcc51('0x50'),require(_0xcc51('0x51')));_0x329df0[_0xcc51('0x9')]('/api/openchannel/accounts',require(_0xcc51('0x52')));_0x329df0['use'](_0xcc51('0x53'),require(_0xcc51('0x54')));_0x329df0[_0xcc51('0x9')](_0xcc51('0x55'),require(_0xcc51('0x56')));_0x329df0[_0xcc51('0x9')]('/api/openchannel/messages',require('./api/openchannelMessage'));_0x329df0['use']('/api/openchannel/queues',require('./api/openchannelQueue'));_0x329df0[_0xcc51('0x9')](_0xcc51('0x57'),require(_0xcc51('0x58')));_0x329df0[_0xcc51('0x9')](_0xcc51('0x59'),require(_0xcc51('0x5a')));_0x329df0[_0xcc51('0x9')]('/api/chat/applications',require(_0xcc51('0x5b')));_0x329df0[_0xcc51('0x9')](_0xcc51('0x5c'),require('./api/chatInteraction'));_0x329df0[_0xcc51('0x9')]('/api/chat/messages',require(_0xcc51('0x5d')));_0x329df0[_0xcc51('0x9')]('/api/chat/offline_messages',require(_0xcc51('0x5e')));_0x329df0[_0xcc51('0x9')]('/api/chat/queues',require('./api/chatQueue'));_0x329df0['use'](_0xcc51('0x5f'),require('./api/chatGroup'));_0x329df0[_0xcc51('0x9')](_0xcc51('0x60'),require(_0xcc51('0x61')));_0x329df0[_0xcc51('0x9')](_0xcc51('0x62'),require(_0xcc51('0x63')));_0x329df0[_0xcc51('0x9')]('/api/cm/contacts',require(_0xcc51('0x64')));_0x329df0['use'](_0xcc51('0x65'),require(_0xcc51('0x66')));_0x329df0[_0xcc51('0x9')](_0xcc51('0x67'),require(_0xcc51('0x68')));_0x329df0['use']('/api/cm/hopper_final',require(_0xcc51('0x69')));_0x329df0[_0xcc51('0x9')](_0xcc51('0x6a'),require(_0xcc51('0x6b')));_0x329df0[_0xcc51('0x9')]('/api/cm/custom_fields',require('./api/cmCustomField'));_0x329df0[_0xcc51('0x9')]('/api/actions',require(_0xcc51('0x6c')));_0x329df0[_0xcc51('0x9')](_0xcc51('0x6d'),require('./api/automation'));_0x329df0[_0xcc51('0x9')](_0xcc51('0x6e'),require(_0xcc51('0x6f')));_0x329df0[_0xcc51('0x9')](_0xcc51('0x70'),require('./api/disposition'));_0x329df0[_0xcc51('0x9')](_0xcc51('0x71'),require(_0xcc51('0x72')));_0x329df0[_0xcc51('0x9')](_0xcc51('0x73'),require(_0xcc51('0x74')));_0x329df0[_0xcc51('0x9')]('/api/pauses',require(_0xcc51('0x75')));_0x329df0[_0xcc51('0x9')](_0xcc51('0x76'),require(_0xcc51('0x77')));_0x329df0[_0xcc51('0x9')](_0xcc51('0x78'),require(_0xcc51('0x79')));_0x329df0[_0xcc51('0x9')](_0xcc51('0x7a'),require('./api/schedule'));_0x329df0[_0xcc51('0x9')](_0xcc51('0x7b'),require(_0xcc51('0x7c')));_0x329df0[_0xcc51('0x9')]('/api/tags',require(_0xcc51('0x7d')));_0x329df0[_0xcc51('0x9')]('/api/templates',require('./api/template'));_0x329df0[_0xcc51('0x9')](_0xcc51('0x7e'),require(_0xcc51('0x7f')));_0x329df0[_0xcc51('0x9')](_0xcc51('0x80'),require(_0xcc51('0x81')));_0x329df0[_0xcc51('0x9')](_0xcc51('0x82'),require(_0xcc51('0x83')));_0x329df0[_0xcc51('0x9')](_0xcc51('0x84'),require(_0xcc51('0x85')));_0x329df0['use']('/api/analytics/custom_reports',require(_0xcc51('0x86')));_0x329df0[_0xcc51('0x9')]('/api/analytics/default_reports',require('./api/analyticDefaultReport'));_0x329df0['use'](_0xcc51('0x87'),require(_0xcc51('0x88')));_0x329df0['use'](_0xcc51('0x89'),require('./api/analyticMetric'));_0x329df0['use'](_0xcc51('0x8a'),require(_0xcc51('0x8b')));_0x329df0[_0xcc51('0x9')](_0xcc51('0x8c'),require(_0xcc51('0x8d')));_0x329df0[_0xcc51('0x9')]('/api/integrations/salesforce/accounts',require(_0xcc51('0x8e')));_0x329df0[_0xcc51('0x9')]('/api/integrations/salesforce/configurations',require(_0xcc51('0x8f')));_0x329df0[_0xcc51('0x9')](_0xcc51('0x90'),require(_0xcc51('0x91')));_0x329df0[_0xcc51('0x9')]('/api/integrations/sugarcrm/accounts',require(_0xcc51('0x92')));_0x329df0['use'](_0xcc51('0x93'),require(_0xcc51('0x94')));_0x329df0[_0xcc51('0x9')](_0xcc51('0x95'),require(_0xcc51('0x96')));_0x329df0[_0xcc51('0x9')](_0xcc51('0x97'),require('./api/intDeskAccount'));_0x329df0[_0xcc51('0x9')](_0xcc51('0x98'),require(_0xcc51('0x99')));_0x329df0[_0xcc51('0x9')](_0xcc51('0x9a'),require(_0xcc51('0x9b')));_0x329df0[_0xcc51('0x9')](_0xcc51('0x9c'),require(_0xcc51('0x9d')));_0x329df0['use'](_0xcc51('0x9e'),require(_0xcc51('0x9f')));_0x329df0['use']('/api/integrations/zoho/fields',require(_0xcc51('0xa0')));_0x329df0['use']('/api/integrations/zendesk/accounts',require(_0xcc51('0xa1')));_0x329df0[_0xcc51('0x9')]('/api/integrations/zendesk/configurations',require(_0xcc51('0xa2')));_0x329df0[_0xcc51('0x9')](_0xcc51('0xa3'),require(_0xcc51('0xa4')));_0x329df0[_0xcc51('0x9')](_0xcc51('0xa5'),require(_0xcc51('0xa6')));_0x329df0['use'](_0xcc51('0xa7'),require(_0xcc51('0xa8')));_0x329df0['use'](_0xcc51('0xa9'),require(_0xcc51('0xaa')));_0x329df0[_0xcc51('0x9')](_0xcc51('0xab'),require(_0xcc51('0xac')));_0x329df0[_0xcc51('0x9')](_0xcc51('0xad'),require(_0xcc51('0xae')));_0x329df0[_0xcc51('0x9')](_0xcc51('0xaf'),require('./api/intVtigerField'));_0x329df0['use'](_0xcc51('0xb0'),require('./api/intServicenowAccount'));_0x329df0[_0xcc51('0x9')](_0xcc51('0xb1'),require(_0xcc51('0xb2')));_0x329df0['use']('/api/integrations/servicenow/fields',require(_0xcc51('0xb3')));_0x329df0['use'](_0xcc51('0xb4'),require(_0xcc51('0xb5')));_0x329df0['use'](_0xcc51('0xb6'),require(_0xcc51('0xb7')));_0x329df0['use'](_0xcc51('0xb8'),require(_0xcc51('0xb9')));_0x329df0[_0xcc51('0x9')](_0xcc51('0xba'),require(_0xcc51('0xbb')));_0x329df0['use'](_0xcc51('0xbc'),require(_0xcc51('0xbd')));_0x329df0[_0xcc51('0x9')](_0xcc51('0xbe'),require(_0xcc51('0xbf')));_0x329df0[_0xcc51('0x9')](_0xcc51('0xc0'),require(_0xcc51('0xc1')));_0x329df0[_0xcc51('0x9')](_0xcc51('0xc2'),require(_0xcc51('0xc3')));_0x329df0[_0xcc51('0x9')](_0xcc51('0xc4'),require(_0xcc51('0xc5')));_0x329df0[_0xcc51('0x9')](_0xcc51('0xc6'),require(_0xcc51('0xc7')));_0x329df0[_0xcc51('0x9')]('/api/jscripty/questions/reports',require(_0xcc51('0xc8')));_0x329df0[_0xcc51('0x9')](_0xcc51('0xc9'),require(_0xcc51('0xca')));_0x329df0[_0xcc51('0x9')](_0xcc51('0xcb'),require(_0xcc51('0xcc')));_0x329df0[_0xcc51('0x9')](_0xcc51('0xcd'),require(_0xcc51('0xce')));_0x329df0[_0xcc51('0x9')](_0xcc51('0xcf'),require(_0xcc51('0xd0')));_0x329df0['use'](_0xcc51('0xd1'),require(_0xcc51('0xd2')));_0x329df0[_0xcc51('0x9')]('/api/settings',require(_0xcc51('0xd3')));_0x329df0[_0xcc51('0x9')](_0xcc51('0xd4'),require(_0xcc51('0xd5')));_0x329df0[_0xcc51('0x9')](_0xcc51('0xd6'),require(_0xcc51('0xd7')));_0x329df0[_0xcc51('0x9')](_0xcc51('0xd8'),require(_0xcc51('0xd9')));_0x329df0['use'](_0xcc51('0xda'),require(_0xcc51('0xdb')));_0x329df0['use'](_0xcc51('0xdc'),require(_0xcc51('0xdd')));_0x329df0[_0xcc51('0x9')](_0xcc51('0xde'),require(_0xcc51('0xdf')));_0x329df0['use'](_0xcc51('0xe0'),require(_0xcc51('0xe1')));_0x329df0[_0xcc51('0x9')](_0xcc51('0xe2'),require('./api/migration'));_0x329df0[_0xcc51('0x9')](_0xcc51('0xe3'),require(_0xcc51('0xe4')));_0x329df0[_0xcc51('0x9')](_0xcc51('0xe5'),require('./api/plugin'));_0x329df0[_0xcc51('0x9')]('/api/mail/reports/transfer',require(_0xcc51('0xe6')));_0x329df0[_0xcc51('0x9')]('/api/chat/reports/transfer',require(_0xcc51('0xe7')));_0x329df0[_0xcc51('0x9')](_0xcc51('0xe8'),require('./api/faxTransferReport'));_0x329df0[_0xcc51('0x9')]('/api/openchannel/reports/transfer',require(_0xcc51('0xe9')));_0x329df0[_0xcc51('0x9')]('/api/sms/reports/transfer',require('./api/smsTransferReport'));_0x329df0['use']('/api/cm/lists',require(_0xcc51('0xea')));_0x329df0[_0xcc51('0x9')](_0xcc51('0xeb'),require(_0xcc51('0xec')));_0x329df0[_0xcc51('0x9')](_0xcc51('0xed'),require('./api/userProfile'));_0x329df0[_0xcc51('0x9')](_0xcc51('0xee'),require(_0xcc51('0xef')));_0x329df0['use'](_0xcc51('0xf0'),require('./api/userProfileResource'));_0x329df0[_0xcc51('0x9')](_0xcc51('0xf1'),require(_0xcc51('0xf2')));_0x329df0[_0xcc51('0x9')](_0xcc51('0xf3'),require(_0xcc51('0xf4')));_0x329df0[_0xcc51('0x9')](_0xcc51('0xf5'),require(_0xcc51('0xf6')));_0x329df0[_0xcc51('0x9')]('/api/whatsapp/interactions',require(_0xcc51('0xf7')));_0x329df0[_0xcc51('0x9')](_0xcc51('0xf8'),require(_0xcc51('0xf9')));_0x329df0[_0xcc51('0x9')](_0xcc51('0xfa'),require(_0xcc51('0xfb')));_0x329df0[_0xcc51('0x9')](_0xcc51('0xfc'),require(_0xcc51('0xfd')));_0x329df0[_0xcc51('0x9')]('/api/whatsapp/queues',require('./api/whatsappQueue'));_0x329df0[_0xcc51('0x9')]('/api/cloudProviders',require(_0xcc51('0xfe')));_0x329df0[_0xcc51('0x9')](_0xcc51('0xff'),require(_0xcc51('0x100')));_0x329df0['use'](_0xcc51('0x101'),require(_0xcc51('0x102')));_0x329df0['use'](_0xcc51('0x103'),require(_0xcc51('0x104')));_0x329df0[_0xcc51('0x9')]('/api/jira',require('./api/jira'));_0x329df0[_0xcc51('0x9')](_0xcc51('0x105'),require(_0xcc51('0x106')));_0x329df0[_0xcc51('0x9')]('/api/version',require(_0xcc51('0x107')));_0x329df0[_0xcc51('0x9')](_0xcc51('0x108'),require(_0xcc51('0x109')));_0x329df0['use'](_0xcc51('0x10a'),require(_0xcc51('0x10b')));_0x329df0['use']('/api/webbar',require(_0xcc51('0x10c')));_0x329df0[_0xcc51('0x9')](_0xcc51('0x10d'),express[_0xcc51('0x10e')](path[_0xcc51('0x10f')](config[_0xcc51('0x110')],_0xcc51('0x10d'))));_0x329df0[_0xcc51('0x9')]('/www',express[_0xcc51('0x10e')](path[_0xcc51('0x10f')](config[_0xcc51('0x110')],'/www')));_0x329df0[_0xcc51('0x9')](_0xcc51('0x111'),express['static'](path[_0xcc51('0x10f')](config[_0xcc51('0x110')],_0xcc51('0x111'))));_0x329df0[_0xcc51('0x9')](_0xcc51('0x112'),express[_0xcc51('0x10e')](path['join'](config['root'],_0xcc51('0x113'),_0xcc51('0x114'))));_0x329df0['use']('/plugins',express[_0xcc51('0x10e')](path[_0xcc51('0x10f')](config[_0xcc51('0x110')],_0xcc51('0x115'))));_0x329df0['route'](_0xcc51('0x116'))[_0xcc51('0x117')](errors[0x194]);_0x329df0[_0xcc51('0x118')]('/*')[_0xcc51('0x117')](function(_0x20abcb,_0x50aac1){_0x50aac1[_0xcc51('0x119')](path[_0xcc51('0x11a')](_0x329df0[_0xcc51('0x117')](_0xcc51('0x11b'))+_0xcc51('0x11c')));});};var sensitiveFields=['username','password',_0xcc51('0x11d'),'apiKey','firstName',_0xcc51('0x11e'),'street','phone',_0xcc51('0x11f'),_0xcc51('0x120'),_0xcc51('0x121'),_0xcc51('0x122'),_0xcc51('0x123'),_0xcc51('0x124'),_0xcc51('0x125'),_0xcc51('0x126'),_0xcc51('0x127'),_0xcc51('0x128'),_0xcc51('0x129'),_0xcc51('0x12a'),'accessTokenSecret',_0xcc51('0x12b'),'consumerKey',_0xcc51('0x12c'),_0xcc51('0x12d'),_0xcc51('0x12e'),_0xcc51('0x12f'),'exten',_0xcc51('0x130'),_0xcc51('0x131'),_0xcc51('0x132'),_0xcc51('0x133'),_0xcc51('0x134'),'key',_0xcc51('0x13'),_0xcc51('0x135'),_0xcc51('0x136'),_0xcc51('0x137'),_0xcc51('0x138'),'secret',_0xcc51('0x139'),_0xcc51('0x13a')];function maskSensitiveData(_0x311dd6){var _0x5c1a81=/(?!^)[\s\S](?!$)/g;if(!_[_0xcc51('0x13b')](_0x311dd6))return;for(var _0x5e8a8a in _0x311dd6){if(_['isArray'](_0x311dd6[_0x5e8a8a])){for(var _0x52aad8=0x0;_0x52aad8<_0x311dd6[_0x5e8a8a][_0xcc51('0x13c')];_0x52aad8++){maskSensitiveData(_0x311dd6[_0x5e8a8a][_0x52aad8]);}}else if(_['isPlainObject'](_0x311dd6[_0x5e8a8a])){maskSensitiveData(_0x311dd6[_0x5e8a8a]);}else if(_[_0xcc51('0x13d')](_0x311dd6[_0x5e8a8a])){_0x311dd6[_0x5e8a8a]=_0x311dd6[_0x5e8a8a][_0xcc51('0x13e')](/{{{/g,_0xcc51('0x13f'))[_0xcc51('0x13e')](/}}}/g,_0xcc51('0x140'))['replace'](/{{/g,'@{')[_0xcc51('0x13e')](/}}/g,'}@');if(_[_0xcc51('0x141')](sensitiveFields,_0x5e8a8a)){_0x311dd6[_0x5e8a8a]=_0x311dd6[_0x5e8a8a][_0xcc51('0x13e')](_0x5c1a81,'*');}}}} \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 491e10a..f9b87bd 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1c25=['jayson/promise','bluebird','lodash','../config/environment','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailQueue/mailQueue.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','server','http','rpc','port','error','listen','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default'];(function(_0x68385b,_0x4817d6){var _0x1b9dbb=function(_0x5b6b31){while(--_0x5b6b31){_0x68385b['push'](_0x68385b['shift']());}};_0x1b9dbb(++_0x4817d6);}(_0x1c25,0x118));var _0x51c2=function(_0x2b8202,_0x196a97){_0x2b8202=_0x2b8202-0x0;var _0xecfc33=_0x1c25[_0x2b8202];return _0xecfc33;};'use strict';var jayson=require(_0x51c2('0x0'));var BPromise=require(_0x51c2('0x1'));var _=require(_0x51c2('0x2'));var config=require(_0x51c2('0x3'));exports['listen']=function(){return new BPromise(function(_0x1adbff,_0x49db1c){var _0x12b631={};_0x12b631=_[_0x51c2('0x4')](_0x12b631,require(_0x51c2('0x5')));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require(_0x51c2('0x6')));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require(_0x51c2('0x7')));_0x12b631=_['merge'](_0x12b631,require(_0x51c2('0x8')));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require(_0x51c2('0x9')));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require('../api/voiceDialReport/voiceDialReport.rpc'));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require('../api/voiceAgentReport/voiceAgentReport.rpc'));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require(_0x51c2('0xa')));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require('../api/memberReport/memberReport.rpc'));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require(_0x51c2('0xb')));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require(_0x51c2('0xc')));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require('../api/userVoiceQueueRt/userVoiceQueueRt.rpc'));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require(_0x51c2('0xd')));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require('../api/mailAccount/mailAccount.rpc'));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require(_0x51c2('0xe')));_0x12b631=_['merge'](_0x12b631,require('../api/mailInteraction/mailInteraction.rpc'));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require('../api/mailMessage/mailMessage.rpc'));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require('../api/mailApplication/mailApplication.rpc'));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require(_0x51c2('0xf')));_0x12b631=_['merge'](_0x12b631,require('../api/faxAccount/faxAccount.rpc'));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require(_0x51c2('0x10')));_0x12b631=_['merge'](_0x12b631,require(_0x51c2('0x11')));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require(_0x51c2('0x12')));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require(_0x51c2('0x13')));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require(_0x51c2('0x14')));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require(_0x51c2('0x15')));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require(_0x51c2('0x16')));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require(_0x51c2('0x17')));_0x12b631=_['merge'](_0x12b631,require(_0x51c2('0x18')));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require('../api/openchannelApplication/openchannelApplication.rpc'));_0x12b631=_['merge'](_0x12b631,require('../api/openchannelInteraction/openchannelInteraction.rpc'));_0x12b631=_['merge'](_0x12b631,require(_0x51c2('0x19')));_0x12b631=_['merge'](_0x12b631,require(_0x51c2('0x1a')));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require(_0x51c2('0x1b')));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require(_0x51c2('0x1c')));_0x12b631=_['merge'](_0x12b631,require(_0x51c2('0x1d')));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require(_0x51c2('0x1e')));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require(_0x51c2('0x1f')));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require(_0x51c2('0x20')));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require(_0x51c2('0x21')));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require(_0x51c2('0x22')));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require(_0x51c2('0x23')));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require(_0x51c2('0x24')));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require(_0x51c2('0x25')));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require(_0x51c2('0x26')));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require(_0x51c2('0x27')));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require(_0x51c2('0x28')));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require('../api/trigger/trigger.rpc'));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require(_0x51c2('0x29')));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require(_0x51c2('0x2a')));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require('../api/intSugarcrmAccount/intSugarcrmAccount.rpc'));_0x12b631=_['merge'](_0x12b631,require('../api/intDeskAccount/intDeskAccount.rpc'));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require(_0x51c2('0x2b')));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require(_0x51c2('0x2c')));_0x12b631=_['merge'](_0x12b631,require('../api/intFreshdeskAccount/intFreshdeskAccount.rpc'));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require('../api/intVtigerAccount/intVtigerAccount.rpc'));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require(_0x51c2('0x2d')));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require(_0x51c2('0x2e')));_0x12b631=_['merge'](_0x12b631,require(_0x51c2('0x2f')));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require('../api/chatQueueReport/chatQueueReport.rpc'));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require(_0x51c2('0x30')));_0x12b631=_['merge'](_0x12b631,require(_0x51c2('0x31')));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require(_0x51c2('0x32')));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require('../api/setting/setting.rpc'));_0x12b631=_['merge'](_0x12b631,require(_0x51c2('0x33')));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require(_0x51c2('0x34')));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require(_0x51c2('0x35')));_0x12b631=_['merge'](_0x12b631,require(_0x51c2('0x36')));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require(_0x51c2('0x37')));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require('../api/attachment/attachment.rpc'));_0x12b631=_['merge'](_0x12b631,require(_0x51c2('0x38')));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require(_0x51c2('0x39')));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require(_0x51c2('0x3a')));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require(_0x51c2('0x3b')));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require(_0x51c2('0x3c')));_0x12b631=_['merge'](_0x12b631,require('../api/whatsappQueue/whatsappQueue.rpc'));var _0x235a4e=jayson[_0x51c2('0x3d')](_0x12b631)[_0x51c2('0x3e')]();var _0x346ee5=config[_0x51c2('0x3f')][_0x51c2('0x40')]||config['port']+0x1;var _0x310bc0=config[_0x51c2('0x3f')]['ip']||'localhost';_0x235a4e['on'](_0x51c2('0x41'),function(_0x402a0b){return _0x49db1c(_0x402a0b);});_0x235a4e[_0x51c2('0x42')](_0x346ee5,_0x310bc0,function(){console['log'](_0x51c2('0x43'),_0x310bc0,_0x346ee5);require(_0x51c2('0x44'))[_0x51c2('0x45')]();return _0x1adbff('RPC\x20listening\x20on\x20'+_0x310bc0+':'+_0x346ee5);});});}; \ No newline at end of file +var _0x2c84=['../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappMessage/whatsappMessage.rpc','server','http','rpc','port','localhost','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','lodash','listen','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.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/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2c84,0x129));var _0x42c8=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x2c84[_0x3947c9];return _0x2e7871;};'use strict';var jayson=require('jayson/promise');var BPromise=require('bluebird');var _=require(_0x42c8('0x0'));var config=require('../config/environment');exports[_0x42c8('0x1')]=function(){return new BPromise(function(_0x5a9540,_0x417949){var _0x4a4952={};_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require(_0x42c8('0x3')));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require(_0x42c8('0x4')));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require('../api/voiceQueue/voiceQueue.rpc'));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require(_0x42c8('0x5')));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require(_0x42c8('0x6')));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require(_0x42c8('0x7')));_0x4a4952=_['merge'](_0x4a4952,require(_0x42c8('0x8')));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require(_0x42c8('0x9')));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require('../api/memberReport/memberReport.rpc'));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require(_0x42c8('0xa')));_0x4a4952=_['merge'](_0x4a4952,require(_0x42c8('0xb')));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require(_0x42c8('0xc')));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require(_0x42c8('0xd')));_0x4a4952=_['merge'](_0x4a4952,require('../api/mailAccount/mailAccount.rpc'));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require('../api/mailQueue/mailQueue.rpc'));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require(_0x42c8('0xe')));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require(_0x42c8('0xf')));_0x4a4952=_['merge'](_0x4a4952,require(_0x42c8('0x10')));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require(_0x42c8('0x11')));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require('../api/faxAccount/faxAccount.rpc'));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require('../api/faxApplication/faxApplication.rpc'));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require(_0x42c8('0x12')));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require('../api/faxMessage/faxMessage.rpc'));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require(_0x42c8('0x13')));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require(_0x42c8('0x14')));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require(_0x42c8('0x15')));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require('../api/smsInteraction/smsInteraction.rpc'));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require(_0x42c8('0x16')));_0x4a4952=_['merge'](_0x4a4952,require(_0x42c8('0x17')));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require('../api/openchannelApplication/openchannelApplication.rpc'));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require(_0x42c8('0x18')));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require(_0x42c8('0x19')));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require(_0x42c8('0x1a')));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require('../api/openchannelQueueReport/openchannelQueueReport.rpc'));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require(_0x42c8('0x1b')));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require(_0x42c8('0x1c')));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require(_0x42c8('0x1d')));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require(_0x42c8('0x1e')));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require(_0x42c8('0x1f')));_0x4a4952=_['merge'](_0x4a4952,require('../api/cmHopperBlack/cmHopperBlack.rpc'));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require('../api/cmHopperFinal/cmHopperFinal.rpc'));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require(_0x42c8('0x20')));_0x4a4952=_['merge'](_0x4a4952,require(_0x42c8('0x21')));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require(_0x42c8('0x22')));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require(_0x42c8('0x23')));_0x4a4952=_['merge'](_0x4a4952,require(_0x42c8('0x24')));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require(_0x42c8('0x25')));_0x4a4952=_['merge'](_0x4a4952,require(_0x42c8('0x26')));_0x4a4952=_['merge'](_0x4a4952,require(_0x42c8('0x27')));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require('../api/intSalesforceAccount/intSalesforceAccount.rpc'));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require('../api/intSugarcrmAccount/intSugarcrmAccount.rpc'));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require(_0x42c8('0x28')));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require(_0x42c8('0x29')));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require(_0x42c8('0x2a')));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require(_0x42c8('0x2b')));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require(_0x42c8('0x2c')));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require('../api/intServicenowAccount/intServicenowAccount.rpc'));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require('../api/intDynamics365Account/intDynamics365Account.rpc'));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require(_0x42c8('0x2d')));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require(_0x42c8('0x2e')));_0x4a4952=_['merge'](_0x4a4952,require(_0x42c8('0x2f')));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require(_0x42c8('0x30')));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require(_0x42c8('0x31')));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require(_0x42c8('0x32')));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require(_0x42c8('0x33')));_0x4a4952=_['merge'](_0x4a4952,require(_0x42c8('0x34')));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require(_0x42c8('0x35')));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require(_0x42c8('0x36')));_0x4a4952=_['merge'](_0x4a4952,require('../api/campaign/campaign.rpc'));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require('../api/attachment/attachment.rpc'));_0x4a4952=_['merge'](_0x4a4952,require('../api/plugin/plugin.rpc'));_0x4a4952=_['merge'](_0x4a4952,require(_0x42c8('0x37')));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require('../api/whatsappInteraction/whatsappInteraction.rpc'));_0x4a4952=_['merge'](_0x4a4952,require(_0x42c8('0x38')));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require('../api/whatsappQueueReport/whatsappQueueReport.rpc'));_0x4a4952=_[_0x42c8('0x2')](_0x4a4952,require('../api/whatsappQueue/whatsappQueue.rpc'));var _0x1f2011=jayson[_0x42c8('0x39')](_0x4a4952)[_0x42c8('0x3a')]();var _0x129230=config[_0x42c8('0x3b')][_0x42c8('0x3c')]||config[_0x42c8('0x3c')]+0x1;var _0x5c6b3c=config[_0x42c8('0x3b')]['ip']||_0x42c8('0x3d');_0x1f2011['on'](_0x42c8('0x3e'),function(_0x537a31){return _0x417949(_0x537a31);});_0x1f2011[_0x42c8('0x1')](_0x129230,_0x5c6b3c,function(){console[_0x42c8('0x3f')](_0x42c8('0x40'),_0x5c6b3c,_0x129230);require(_0x42c8('0x41'))[_0x42c8('0x42')]();return _0x5a9540(_0x42c8('0x43')+_0x5c6b3c+':'+_0x129230);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index 6984c09..6c9e3bd 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 _0x553f=['pipe','command','write','inherits','sendRequest','prototype','ANSWER','getData','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','isArray','join','EXEC\x20%s\x20%s','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isBoolean','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','GOTO\x20%s\x20%s\x20%s','GET\x20VARIABLE\x20\x22%s\x22','recordFile','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','AGI','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','lodash','events','EventEmitter','./reply','call','utf8','setTimeout','setEncoding','headers','line','hangup','substring','search','520\x20End\x20of\x20proper','function','no\x20code','replace','indexOf','substr','startsWith','split','length','match','error','emit','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','destroy'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x553f,0x1c0));var _0xf553=function(_0x50ce08,_0x341c11){_0x50ce08=_0x50ce08-0x0;var _0x3005c3=_0x553f[_0x50ce08];return _0x3005c3;};'use strict';var util=require(_0xf553('0x0'));var _=require(_0xf553('0x1'));var EventEmitter=require(_0xf553('0x2'))[_0xf553('0x3')];var AGIReply=require(_0xf553('0x4'));var AGIError=require('./error');function AGIChannel(_0x5bcb5b){var _0x44e3b4=this,_0x59dcf9=new AGIReply(),_0x2864fd=![],_0x3b3c90={};EventEmitter[_0xf553('0x5')](_0x44e3b4);_0x5bcb5b['setEncoding'](_0xf553('0x6'));_0x5bcb5b[_0xf553('0x7')](0x8*0x3c*0x3c*0x3e8);_0x59dcf9[_0xf553('0x8')]('utf8');_0x59dcf9['on'](_0xf553('0x9'),function(_0xe2eec6){for(var _0x5d750a in _0xe2eec6){_0x44e3b4[_0x5d750a]=_0xe2eec6[_0x5d750a];}_0x44e3b4['emit']('ready');});_0x59dcf9['on'](_0xf553('0xa'),function(_0x1c9514){if(_0x1c9514['toLowerCase']()==_0xf553('0xb')){_0x44e3b4['emit'](_0xf553('0xb'));return;}if(_0x1c9514[_0xf553('0xc')](0x0,0xb)=='520-Invalid'){_0x2864fd=!![];}if(_0x2864fd){_0x3b3c90['rx']+=_0x1c9514+'\x0a';if(_0x1c9514[_0xf553('0xd')](_0xf553('0xe'))!=-0x1){_0x2864fd=![];}}else{_0x3b3c90['rx']=_0x1c9514;}if(_0x2864fd){return;}if(typeof _0x3b3c90['cb']==_0xf553('0xf')){var _0x3a296c=_0x3b3c90['rx'][_0xf553('0xc')](0x0,0x3),_0x16be09=null,_0x15231e=null;_0x3a296c=parseInt(_0x3a296c);if(isNaN(_0x3a296c)){_0x3b3c90['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0xf553('0x10')});return;}if(_0x3a296c!=0xc8){_0x3b3c90['cb'](null,{'code':_0x3a296c,'result':-0x1,'extra':'KO'});return;}_0x16be09=_0x3b3c90['rx'][_0xf553('0xc')](0x4)[_0xf553('0x11')]('result=','');if(_0x16be09[_0xf553('0x12')]('\x20')!=-0x1){_0x16be09=_0x16be09[_0xf553('0x13')](0x0,_0x16be09['indexOf']('\x20'));}if(_[_0xf553('0x14')](_0x16be09,'-1')){_0x16be09=parseInt(_0x16be09);}_0x15231e=_0x3b3c90['rx'][_0xf553('0x15')]('\x20');if(_0x15231e[_0xf553('0x16')]==0x3){_0x15231e=_0x15231e[0x2][_0xf553('0xc')](0x1,_0x15231e[0x2][_0xf553('0x16')]-0x1);}else if(_0x15231e[_0xf553('0x16')]>0x3){var _0x4b4292=/\((.+)\)/;var _0x450bb3=_0x3b3c90['rx'][_0xf553('0x17')](_0x4b4292);if(_0x450bb3){_0x15231e=_0x450bb3[0x1];}else{_0x15231e=null;}}else{_0x15231e=null;}_0x3b3c90['cb'](null,{'code':_0x3a296c,'result':_0x16be09,'extra':_0x15231e});}});_0x5bcb5b['on'](_0xf553('0x18'),function(_0x14ae9c){_0x44e3b4[_0xf553('0x19')]('error',new AGIError(_0xf553('0x1a'),_0x14ae9c[_0xf553('0x1b')]));});_0x5bcb5b['on']('close',function(){_0x44e3b4['emit'](_0xf553('0x1c'),new AGIError(_0xf553('0x1d')));});_0x5bcb5b['on']('timeout',function(){_0x44e3b4['emit'](_0xf553('0x1e'),new AGIError('E_AGI_SOCKET_TIMEOUT'));_0x5bcb5b[_0xf553('0x1f')]();});_0x5bcb5b[_0xf553('0x20')](_0x59dcf9);this[_0xf553('0x21')]=function(_0x392e45,_0x2ad893){var _0x392e45=_0x392e45||'',_0x2ad893=typeof _0x2ad893=='function'?_0x2ad893:new Function();_0x3b3c90={'tx':_0x392e45,'rx':'','cb':_0x2ad893};_0x5bcb5b[_0xf553('0x22')](_0x392e45+'\x0a');},this[_0xf553('0x1c')]=function(){_0x5bcb5b['destroy']();};}util[_0xf553('0x23')](AGIChannel,EventEmitter);AGIChannel['prototype'][_0xf553('0x24')]=function(_0x107f0f){return this[_0xf553('0x21')]['sync'](this,_0x107f0f);};AGIChannel[_0xf553('0x25')]['answer']=function(){return this[_0xf553('0x24')](_0xf553('0x26'));};AGIChannel['prototype'][_0xf553('0x27')]=function(_0x532fa5,_0x14d287,_0x33ee2d){_0x532fa5=_0x532fa5===undefined?'beep':_0x532fa5;_0x14d287=_0x14d287===undefined?'5':_0x14d287;_0x33ee2d=_0x33ee2d===undefined?'1':_0x33ee2d;return this[_0xf553('0x24')](util[_0xf553('0x28')](_0xf553('0x29'),_0x532fa5,_0x14d287*0x3e8,_0x33ee2d));};AGIChannel['prototype'][_0xf553('0x2a')]=function(_0x3e06e0){_0x3e06e0=_0x3e06e0||_0xf553('0x2b');return this[_0xf553('0x24')](util['format'](_0xf553('0x2c'),_0x3e06e0));};AGIChannel[_0xf553('0x25')][_0xf553('0x2d')]=function(_0xac9992,_0x31cafc){if(_[_0xf553('0x2e')](_0x31cafc)){return this[_0xf553('0x24')](util[_0xf553('0x28')]('EXEC\x20%s\x20%s',_0xac9992,_0x31cafc[_0xf553('0x2f')](',')));}return this[_0xf553('0x24')](util['format'](_0xf553('0x30'),_0xac9992,_0x31cafc));};AGIChannel[_0xf553('0x25')][_0xf553('0x31')]=function(_0x279108){return this[_0xf553('0x24')](util['format'](_0xf553('0x32'),_0x279108));};AGIChannel[_0xf553('0x25')][_0xf553('0x33')]=function(_0x17d93e){return this[_0xf553('0x24')](util[_0xf553('0x28')](_0xf553('0x34'),_0x17d93e));};AGIChannel[_0xf553('0x25')][_0xf553('0x35')]=function(_0x2d2904){return this[_0xf553('0x24')](util['format'](_0xf553('0x36'),_0x2d2904));};AGIChannel[_0xf553('0x25')][_0xf553('0xb')]=function(){return this[_0xf553('0x24')](_0xf553('0x37'));};AGIChannel[_0xf553('0x25')][_0xf553('0x38')]=function(_0x5b2ef,_0x109585){var _0x47c502=_[_0xf553('0x39')](_0x109585)||_[_0xf553('0x3a')](_0x109585)?_0x109585[_0xf553('0x3b')]():_0x109585;return this[_0xf553('0x24')](util['format'](_0xf553('0x3c'),_0x5b2ef,_0x47c502?_0x47c502[_0xf553('0x3b')]()[_0xf553('0x11')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0xf553('0x25')][_0xf553('0x3d')]=function(_0x38ae1c,_0x26a0ec){return this[_0xf553('0x24')](util[_0xf553('0x28')](_0xf553('0x3e'),_0x38ae1c,_0x26a0ec));};AGIChannel['prototype'][_0xf553('0x3f')]=function(_0x101518,_0x266b9d){return this['sendRequest'](util[_0xf553('0x28')]('SAY\x20DIGITS\x20%s\x20%s',_0x101518,_0x266b9d));};AGIChannel[_0xf553('0x25')][_0xf553('0x40')]=function(_0x582931,_0x16a533){return this['sendRequest'](util[_0xf553('0x28')](_0xf553('0x41'),_0x582931,_0x16a533));};AGIChannel[_0xf553('0x25')][_0xf553('0x42')]=function(_0x2b0535,_0x1f7b3a,_0x580077){_0x1f7b3a=_0x1f7b3a||this[_0xf553('0x43')];_0x580077=_0x580077||0x1;this[_0xf553('0x31')](_0x2b0535);this[_0xf553('0x33')](_0x1f7b3a);this[_0xf553('0x35')](_0x580077);return this[_0xf553('0x2a')](util[_0xf553('0x28')](_0xf553('0x44'),_0x2b0535,_0x1f7b3a,_0x580077));};AGIChannel[_0xf553('0x25')]['getVariable']=function(_0x222666){return this[_0xf553('0x24')](util[_0xf553('0x28')](_0xf553('0x45'),_0x222666));};AGIChannel[_0xf553('0x25')][_0xf553('0x46')]=function(_0x38f1b5,_0x4ef97d,_0xbd6be1,_0x286b1c,_0x5dabbb,_0x42b21d){_0x4ef97d=_0x4ef97d||'wav';_0xbd6be1=_0xbd6be1||'';_0x286b1c=_0x286b1c===undefined?-0x1:_0x286b1c==='-1'?-0x1:_0x286b1c*0x3e8;_0x5dabbb=_0x5dabbb===undefined?'':'s='+_0x5dabbb;_0x42b21d=_0x42b21d?_0xf553('0x47'):'';return this[_0xf553('0x24')](util[_0xf553('0x28')](_0xf553('0x48'),_0x38f1b5,_0x4ef97d,_0xbd6be1,_0x286b1c,_0x42b21d,_0x5dabbb));};AGIChannel[_0xf553('0x25')][_0xf553('0x49')]=function(_0x2581d4,_0x2a8313){_0x2a8313=_0x2a8313||'';return this[_0xf553('0x24')](util[_0xf553('0x28')](_0xf553('0x4a'),_0x2581d4,_0x2a8313));};AGIChannel[_0xf553('0x25')]['agi']=function(_0x230dac){return this[_0xf553('0x2d')](_0xf553('0x4b'),_0x230dac);};AGIChannel[_0xf553('0x25')]['wait']=function(_0x421ad8){return this['exec'](_0xf553('0x4c'),_0x421ad8);};AGIChannel[_0xf553('0x25')]['error']=function(_0x374c59,_0x4d2e2e){this['noop'](util[_0xf553('0x28')](_0xf553('0x4d'),_0x374c59['id'],_0x374c59[_0xf553('0x4e')],_0x4d2e2e));return{'code':0x1f4,'result':'-1','extra':''};};module[_0xf553('0x4f')]=AGIChannel; \ No newline at end of file +var _0x01db=['command','write','prototype','sync','answer','sendRequest','ANSWER','getData','beep','format','noop','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','join','SET\x20CONTEXT\x20%s','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','isBoolean','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','continueAt','extension','setContext','setExtension','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','agi','AGI','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','EventEmitter','./reply','./error','call','setEncoding','utf8','setTimeout','headers','emit','ready','line','toLowerCase','hangup','substring','520-Invalid','search','520\x20End\x20of\x20proper','function','no\x20code','replace','result=','substr','indexOf','startsWith','split','length','match','error','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe'];(function(_0x1ae5ab,_0xc5d441){var _0x1ce001=function(_0x5ef96d){while(--_0x5ef96d){_0x1ae5ab['push'](_0x1ae5ab['shift']());}};_0x1ce001(++_0xc5d441);}(_0x01db,0x171));var _0xb01d=function(_0x4ee2a5,_0x143c0e){_0x4ee2a5=_0x4ee2a5-0x0;var _0x378a21=_0x01db[_0x4ee2a5];return _0x378a21;};'use strict';var util=require(_0xb01d('0x0'));var _=require('lodash');var EventEmitter=require('events')[_0xb01d('0x1')];var AGIReply=require(_0xb01d('0x2'));var AGIError=require(_0xb01d('0x3'));function AGIChannel(_0x4df2c9){var _0x13069a=this,_0x5c3864=new AGIReply(),_0x4cc905=![],_0x267f09={};EventEmitter[_0xb01d('0x4')](_0x13069a);_0x4df2c9[_0xb01d('0x5')](_0xb01d('0x6'));_0x4df2c9[_0xb01d('0x7')](0x8*0x3c*0x3c*0x3e8);_0x5c3864[_0xb01d('0x5')](_0xb01d('0x6'));_0x5c3864['on'](_0xb01d('0x8'),function(_0x518609){for(var _0x4c96d5 in _0x518609){_0x13069a[_0x4c96d5]=_0x518609[_0x4c96d5];}_0x13069a[_0xb01d('0x9')](_0xb01d('0xa'));});_0x5c3864['on'](_0xb01d('0xb'),function(_0x3b2de4){if(_0x3b2de4[_0xb01d('0xc')]()==_0xb01d('0xd')){_0x13069a['emit']('hangup');return;}if(_0x3b2de4[_0xb01d('0xe')](0x0,0xb)==_0xb01d('0xf')){_0x4cc905=!![];}if(_0x4cc905){_0x267f09['rx']+=_0x3b2de4+'\x0a';if(_0x3b2de4[_0xb01d('0x10')](_0xb01d('0x11'))!=-0x1){_0x4cc905=![];}}else{_0x267f09['rx']=_0x3b2de4;}if(_0x4cc905){return;}if(typeof _0x267f09['cb']==_0xb01d('0x12')){var _0x447479=_0x267f09['rx']['substring'](0x0,0x3),_0xbcc293=null,_0x48b905=null;_0x447479=parseInt(_0x447479);if(isNaN(_0x447479)){_0x267f09['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0xb01d('0x13')});return;}if(_0x447479!=0xc8){_0x267f09['cb'](null,{'code':_0x447479,'result':-0x1,'extra':'KO'});return;}_0xbcc293=_0x267f09['rx']['substring'](0x4)[_0xb01d('0x14')](_0xb01d('0x15'),'');if(_0xbcc293['indexOf']('\x20')!=-0x1){_0xbcc293=_0xbcc293[_0xb01d('0x16')](0x0,_0xbcc293[_0xb01d('0x17')]('\x20'));}if(_[_0xb01d('0x18')](_0xbcc293,'-1')){_0xbcc293=parseInt(_0xbcc293);}_0x48b905=_0x267f09['rx'][_0xb01d('0x19')]('\x20');if(_0x48b905['length']==0x3){_0x48b905=_0x48b905[0x2][_0xb01d('0xe')](0x1,_0x48b905[0x2]['length']-0x1);}else if(_0x48b905[_0xb01d('0x1a')]>0x3){var _0x9a96e=/\((.+)\)/;var _0x15b165=_0x267f09['rx'][_0xb01d('0x1b')](_0x9a96e);if(_0x15b165){_0x48b905=_0x15b165[0x1];}else{_0x48b905=null;}}else{_0x48b905=null;}_0x267f09['cb'](null,{'code':_0x447479,'result':_0xbcc293,'extra':_0x48b905});}});_0x4df2c9['on']('error',function(_0xe47874){_0x13069a[_0xb01d('0x9')](_0xb01d('0x1c'),new AGIError('E_AGI_SOCKET_ERROR',_0xe47874[_0xb01d('0x1d')]));});_0x4df2c9['on']('close',function(){_0x13069a[_0xb01d('0x9')](_0xb01d('0x1e'),new AGIError(_0xb01d('0x1f')));});_0x4df2c9['on'](_0xb01d('0x20'),function(){_0x13069a[_0xb01d('0x9')]('timeout',new AGIError(_0xb01d('0x21')));_0x4df2c9[_0xb01d('0x22')]();});_0x4df2c9[_0xb01d('0x23')](_0x5c3864);this[_0xb01d('0x24')]=function(_0x18cc0e,_0x7de0a2){var _0x18cc0e=_0x18cc0e||'',_0x7de0a2=typeof _0x7de0a2==_0xb01d('0x12')?_0x7de0a2:new Function();_0x267f09={'tx':_0x18cc0e,'rx':'','cb':_0x7de0a2};_0x4df2c9[_0xb01d('0x25')](_0x18cc0e+'\x0a');},this[_0xb01d('0x1e')]=function(){_0x4df2c9[_0xb01d('0x22')]();};}util['inherits'](AGIChannel,EventEmitter);AGIChannel[_0xb01d('0x26')]['sendRequest']=function(_0xed76c0){return this[_0xb01d('0x24')][_0xb01d('0x27')](this,_0xed76c0);};AGIChannel[_0xb01d('0x26')][_0xb01d('0x28')]=function(){return this[_0xb01d('0x29')](_0xb01d('0x2a'));};AGIChannel[_0xb01d('0x26')][_0xb01d('0x2b')]=function(_0x1236c2,_0x1fbfe3,_0x531d37){_0x1236c2=_0x1236c2===undefined?_0xb01d('0x2c'):_0x1236c2;_0x1fbfe3=_0x1fbfe3===undefined?'5':_0x1fbfe3;_0x531d37=_0x531d37===undefined?'1':_0x531d37;return this[_0xb01d('0x29')](util[_0xb01d('0x2d')]('GET\x20DATA\x20\x22%s\x22\x20%s\x20%s',_0x1236c2,_0x1fbfe3*0x3e8,_0x531d37));};AGIChannel[_0xb01d('0x26')][_0xb01d('0x2e')]=function(_0x1659fa){_0x1659fa=_0x1659fa||'NO\x20MESSAGE';return this[_0xb01d('0x29')](util['format'](_0xb01d('0x2f'),_0x1659fa));};AGIChannel[_0xb01d('0x26')][_0xb01d('0x30')]=function(_0x513eac,_0x2f3046){if(_[_0xb01d('0x31')](_0x2f3046)){return this[_0xb01d('0x29')](util[_0xb01d('0x2d')](_0xb01d('0x32'),_0x513eac,_0x2f3046[_0xb01d('0x33')](',')));}return this['sendRequest'](util[_0xb01d('0x2d')](_0xb01d('0x32'),_0x513eac,_0x2f3046));};AGIChannel[_0xb01d('0x26')]['setContext']=function(_0x56185c){return this['sendRequest'](util['format'](_0xb01d('0x34'),_0x56185c));};AGIChannel[_0xb01d('0x26')]['setExtension']=function(_0x5c872f){return this[_0xb01d('0x29')](util[_0xb01d('0x2d')](_0xb01d('0x35'),_0x5c872f));};AGIChannel[_0xb01d('0x26')][_0xb01d('0x36')]=function(_0x42fd41){return this[_0xb01d('0x29')](util[_0xb01d('0x2d')](_0xb01d('0x37'),_0x42fd41));};AGIChannel['prototype'][_0xb01d('0xd')]=function(){return this[_0xb01d('0x29')](_0xb01d('0x38'));};AGIChannel[_0xb01d('0x26')]['setVariable']=function(_0x3d2380,_0x5260c5){var _0x109283=_[_0xb01d('0x39')](_0x5260c5)||_[_0xb01d('0x3a')](_0x5260c5)?_0x5260c5[_0xb01d('0x3b')]():_0x5260c5;return this['sendRequest'](util[_0xb01d('0x2d')](_0xb01d('0x3c'),_0x3d2380,_0x109283?_0x109283[_0xb01d('0x3b')]()[_0xb01d('0x14')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0xb01d('0x26')]['sayNumber']=function(_0x76d421,_0x28f18b){return this[_0xb01d('0x29')](util[_0xb01d('0x2d')](_0xb01d('0x3d'),_0x76d421,_0x28f18b));};AGIChannel[_0xb01d('0x26')][_0xb01d('0x3e')]=function(_0x5d191c,_0x4b93f0){return this[_0xb01d('0x29')](util['format'](_0xb01d('0x3f'),_0x5d191c,_0x4b93f0));};AGIChannel[_0xb01d('0x26')]['sayPhonetic']=function(_0x847853,_0x325715){return this[_0xb01d('0x29')](util[_0xb01d('0x2d')]('SAY\x20PHONETIC\x20\x22%s\x22\x20%s',_0x847853,_0x325715));};AGIChannel[_0xb01d('0x26')][_0xb01d('0x40')]=function(_0x5c2313,_0x1fb47c,_0x4f3278){_0x1fb47c=_0x1fb47c||this[_0xb01d('0x41')];_0x4f3278=_0x4f3278||0x1;this[_0xb01d('0x42')](_0x5c2313);this[_0xb01d('0x43')](_0x1fb47c);this['setPriority'](_0x4f3278);return this[_0xb01d('0x2e')](util['format'](_0xb01d('0x44'),_0x5c2313,_0x1fb47c,_0x4f3278));};AGIChannel[_0xb01d('0x26')][_0xb01d('0x45')]=function(_0x2f582f){return this['sendRequest'](util['format'](_0xb01d('0x46'),_0x2f582f));};AGIChannel[_0xb01d('0x26')][_0xb01d('0x47')]=function(_0x35af3c,_0x11e5cc,_0x3e3c8a,_0x44567a,_0x11691d,_0x25ebb6){_0x11e5cc=_0x11e5cc||'wav';_0x3e3c8a=_0x3e3c8a||'';_0x44567a=_0x44567a===undefined?-0x1:_0x44567a==='-1'?-0x1:_0x44567a*0x3e8;_0x11691d=_0x11691d===undefined?'':'s='+_0x11691d;_0x25ebb6=_0x25ebb6?'BEEP':'';return this['sendRequest'](util[_0xb01d('0x2d')](_0xb01d('0x48'),_0x35af3c,_0x11e5cc,_0x3e3c8a,_0x44567a,_0x25ebb6,_0x11691d));};AGIChannel['prototype'][_0xb01d('0x49')]=function(_0x5b23a5,_0x59e85c){_0x59e85c=_0x59e85c||'';return this[_0xb01d('0x29')](util[_0xb01d('0x2d')]('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x5b23a5,_0x59e85c));};AGIChannel[_0xb01d('0x26')][_0xb01d('0x4a')]=function(_0x29f3a9){return this[_0xb01d('0x30')](_0xb01d('0x4b'),_0x29f3a9);};AGIChannel[_0xb01d('0x26')][_0xb01d('0x4c')]=function(_0x50d6cc){return this['exec'](_0xb01d('0x4d'),_0x50d6cc);};AGIChannel['prototype']['error']=function(_0x2e4755,_0x75b2e7){this[_0xb01d('0x2e')](util['format'](_0xb01d('0x4e'),_0x2e4755['id'],_0x2e4755[_0xb01d('0x4f')],_0x75b2e7));return{'code':0x1f4,'result':'-1','extra':''};};module[_0xb01d('0x50')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index 6fe1e82..7f82313 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 _0xae20=['Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20closed.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_UNDEFINED','push','format','apply','message','name','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.'];(function(_0x595fe2,_0x5bc192){var _0x391c92=function(_0x4c97b1){while(--_0x4c97b1){_0x595fe2['push'](_0x595fe2['shift']());}};_0x391c92(++_0x5bc192);}(_0xae20,0x85));var _0x0ae2=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xae20[_0x4a9fb1];return _0x348672;};'use strict';var util=require('util');var error={'E_AGI_UNDEFINED':_0x0ae2('0x0'),'E_AGI_ARGUMENT_PORT':_0x0ae2('0x1'),'E_AGI_SERVER_ERROR':_0x0ae2('0x2'),'E_AGI_SERVER_CLOSE':_0x0ae2('0x3'),'E_AGI_SERVER_MAXCONNECTION':_0x0ae2('0x4'),'E_AGI_SERVER_VOICE_DISABLED':_0x0ae2('0x5'),'E_AGI_SOCKET_ERROR':'Socket\x20error.\x20Code:\x20%s.','E_AGI_SOCKET_CLOSE':_0x0ae2('0x6'),'E_AGI_SOCKET_TIMEOUT':'Socket\x20timeout.','E_AGI_COMMAND_EMPTY':_0x0ae2('0x7'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x0ae2('0x8'),'E_AGI_IVR_ENTRY':'Missing\x20\x27ivr.entry\x27\x20menu.'};function AGIError(_0x4a0f2d){var _0x4a0f2d=_0x4a0f2d||null,_0x13d1d2=_0x13d1d2||[],_0x539be0=0x1,_0x1db73d='';if(!error[_0x4a0f2d]){_0x4a0f2d=_0x0ae2('0x9');}_0x13d1d2[_0x0ae2('0xa')](error[_0x4a0f2d]);while(arguments[_0x539be0]){_0x13d1d2[_0x0ae2('0xa')](arguments[_0x539be0]);_0x539be0++;}_0x1db73d=util[_0x0ae2('0xb')][_0x0ae2('0xc')](util,_0x13d1d2);this[_0x0ae2('0xd')]=_0x1db73d;this[_0x0ae2('0xe')]=_0x4a0f2d;}module['exports']=AGIError; \ No newline at end of file +var _0x20df=['util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','format','apply','message','exports'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x20df,0x7e));var _0xf20d=function(_0x5ad771,_0x34186f){_0x5ad771=_0x5ad771-0x0;var _0x5b5dce=_0x20df[_0x5ad771];return _0x5b5dce;};'use strict';var util=require(_0xf20d('0x0'));var error={'E_AGI_UNDEFINED':_0xf20d('0x1'),'E_AGI_ARGUMENT_PORT':_0xf20d('0x2'),'E_AGI_SERVER_ERROR':_0xf20d('0x3'),'E_AGI_SERVER_CLOSE':_0xf20d('0x4'),'E_AGI_SERVER_MAXCONNECTION':_0xf20d('0x5'),'E_AGI_SERVER_VOICE_DISABLED':_0xf20d('0x6'),'E_AGI_SOCKET_ERROR':_0xf20d('0x7'),'E_AGI_SOCKET_CLOSE':_0xf20d('0x8'),'E_AGI_SOCKET_TIMEOUT':'Socket\x20timeout.','E_AGI_COMMAND_EMPTY':_0xf20d('0x9'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xf20d('0xa'),'E_AGI_IVR_ENTRY':_0xf20d('0xb')};function AGIError(_0x4e7aaf){var _0x4e7aaf=_0x4e7aaf||null,_0x31236e=_0x31236e||[],_0x1517ec=0x1,_0x36d2d3='';if(!error[_0x4e7aaf]){_0x4e7aaf=_0xf20d('0xc');}_0x31236e[_0xf20d('0xd')](error[_0x4e7aaf]);while(arguments[_0x1517ec]){_0x31236e[_0xf20d('0xd')](arguments[_0x1517ec]);_0x1517ec++;}_0x36d2d3=util[_0xf20d('0xe')][_0xf20d('0xf')](util,_0x31236e);this[_0xf20d('0x10')]=_0x36d2d3;this['name']=_0x4e7aaf;}module[_0xf20d('0x11')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index 6fa86c9..98282a7 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 _0x5c0f=['info','no\x20edge/s\x20available','condition','split','agicommand','vswitch','target','invalid','includes','max\x20retry\x20reach','condition\x20not\x20found','exports','lodash','agi','menu','getdigits','getsecretdigits','vertices','numberOfEdges','addVertex','edges','prototype','addEdge','size','getVertex','traverseBFS','stop\x20traverse','length'];(function(_0x46cbed,_0x27428c){var _0x54aba8=function(_0x3ee20f){while(--_0x3ee20f){_0x46cbed['push'](_0x46cbed['shift']());}};_0x54aba8(++_0x27428c);}(_0x5c0f,0xb4));var _0xf5c0=function(_0x229cbb,_0x4ca837){_0x229cbb=_0x229cbb-0x0;var _0x14432a=_0x5c0f[_0x229cbb];return _0x14432a;};'use strict';var _=require(_0xf5c0('0x0'));var logger=require('../../../config/logger')(_0xf5c0('0x1'));var verticesWithRetry=[_0xf5c0('0x2'),_0xf5c0('0x3'),_0xf5c0('0x4')];var Graph=function(){this[_0xf5c0('0x5')]={};this['edges']={};this[_0xf5c0('0x6')]=0x0;};Graph['prototype'][_0xf5c0('0x7')]=function(_0xa74eb1){this[_0xf5c0('0x5')][_0xa74eb1['id']]=_0xa74eb1;this[_0xf5c0('0x8')][_0xa74eb1['id']]=[];};Graph[_0xf5c0('0x9')][_0xf5c0('0xa')]=function(_0x1c761a,_0x51b74f,_0x25ce50){this[_0xf5c0('0x8')][_0x1c761a]['push']({'target':_0x51b74f,'condition':_0x25ce50});this[_0xf5c0('0x6')]+=0x1;};Graph['prototype'][_0xf5c0('0xb')]=function(){return _[_0xf5c0('0xb')](this['vertices']);};Graph['prototype']['relations']=function(){return this['numberOfEdges'];};Graph['prototype'][_0xf5c0('0xc')]=function(_0x42fe6a){return this['vertices'][_0x42fe6a];};Graph[_0xf5c0('0x9')][_0xf5c0('0xd')]=function(_0x3c8f48,_0x16b8c0){if(!this[_0xf5c0('0x5')][_0x3c8f48]){return logger['info']('no\x20vertex\x20found');}var _0x40bf4d=_0x16b8c0(this['vertices'][_0x3c8f48]);if(!_0x40bf4d){return logger['info'](_0xf5c0('0xe'));}if(this[_0xf5c0('0x8')][_0x3c8f48][_0xf5c0('0xf')]===0x0){return logger[_0xf5c0('0x10')](_0xf5c0('0x11'));}for(var _0x5f418d=0x0,_0x2e30aa=[],_0x1a1919=![];_0x5f418d\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','dnid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','toJson','mxGraphModel','root','agicommand','hasOwnProperty','retry','maxRetry','addVertex','mxCell','isArray','length','source','target','value','getSquareProject','then','catch','createSquareReport','agi_','substring','inspect','debug','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','hangup','sync','production','start','joinAt','YYYY-MM-DD\x20HH:mm:ss','omit','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','vertex','context','extension','priority','response','code','result','isUndefined','toString','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','Project\x20%s\x20not\x20published','Project\x20%s\x20not\x20found','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','listening','connection','xml2json','lodash','syncho','util','moment','../../config/environment','../../config/license/util','./rpc','./mailRpc','./graph','./vertices','agi','defaults','127.0.0.1','nextTick','error','stack','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','format','name','message','[%s]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1'];(function(_0x21001b,_0x3ff1a8){var _0x665a00=function(_0x98d912){while(--_0x98d912){_0x21001b['push'](_0x21001b['shift']());}};_0x665a00(++_0x3ff1a8);}(_0xa349,0x161));var _0x9a34=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa349[_0x3dd15e];return _0x231fd0;};'use strict';var parser=require(_0x9a34('0x0'));var _=require(_0x9a34('0x1'));var syncho=require(_0x9a34('0x2'));var util=require(_0x9a34('0x3'));var moment=require(_0x9a34('0x4'));var config=require(_0x9a34('0x5'));var logger=require('../../config/logger')('agi');var utilLicense=require(_0x9a34('0x6'));var rpc=require(_0x9a34('0x7'));var mailRpc=require(_0x9a34('0x8'));var Graph=require(_0x9a34('0x9'));var Vertices=require(_0x9a34('0xa'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x9a34('0xb')]=_[_0x9a34('0xc')](config['agi'],{'ip':_0x9a34('0xd'),'port':0x11dd});function connectionHandler(_0x357801){process[_0x9a34('0xe')](function(){syncho(function(){try{setChannelVariables(_0x357801);agiHandler(_0x357801);}catch(_0x115270){logger[_0x9a34('0xf')](_0x115270[_0x9a34('0x10')]);}});});}function listeningHandler(){console[_0x9a34('0x11')](_0x9a34('0x12'),config[_0x9a34('0xb')][_0x9a34('0x13')]);logger[_0x9a34('0x14')](util[_0x9a34('0x15')]('[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d',config[_0x9a34('0xb')]['ip'],config[_0x9a34('0xb')][_0x9a34('0x13')]));}function errorHandler(_0x18d932){if(_0x18d932&&_0x18d932[_0x9a34('0x16')]&&_0x18d932[_0x9a34('0x17')]){logger[_0x9a34('0xf')](util[_0x9a34('0x15')](_0x9a34('0x18'),_0x18d932['name'],_0x18d932[_0x9a34('0x17')]));}else{logger[_0x9a34('0xf')](util[_0x9a34('0x15')]('[ERROR]\x20%s',_0x18d932[_0x9a34('0x10')]));}}function closeHandler(){logger[_0x9a34('0x14')](util['format'](_0x9a34('0x19'),this[_0x9a34('0x1a')],this[_0x9a34('0x1b')],this[_0x9a34('0x1c')],this['dnid'],this[_0x9a34('0x1d')]));try{createSquareReport(this);}catch(_0x441ce9){logger[_0x9a34('0xf')](_0x441ce9[_0x9a34('0x10')]);}}function timeoutHandler(){logger['info'](util['format'](_0x9a34('0x1e'),this[_0x9a34('0x1a')],this[_0x9a34('0x1b')],this[_0x9a34('0x1c')],this[_0x9a34('0x1f')],this['uniqueid']));}function hangupHandler(){logger[_0x9a34('0x14')](util[_0x9a34('0x15')](_0x9a34('0x20'),this[_0x9a34('0x1a')],this[_0x9a34('0x1b')],this['callerid'],this[_0x9a34('0x1f')],this[_0x9a34('0x1d')]));this[_0x9a34('0x21')]=!![];}function getRoot(_0x11cd2d){return parser[_0x9a34('0x22')](_0x11cd2d,{'object':!![]})[_0x9a34('0x23')][_0x9a34('0x24')];}function addVertex(_0x29d356,_0xcd7a2c,_0x1e1fd4){_0xcd7a2c[_0x9a34('0x25')]=_0x1e1fd4;if(_0xcd7a2c[_0x9a34('0x26')](_0x9a34('0x27'))){_0xcd7a2c[_0x9a34('0x28')]=parseInt(_0xcd7a2c[_0x9a34('0x27')],0xa);}_0x29d356[_0x9a34('0x29')](_['omit'](_0xcd7a2c,_0x9a34('0x2a')));}function initGraph(_0x1b6c73,_0x531339){var _0x5a1bde=new Graph();for(var _0x48951f in _0x1b6c73){if(_0x1b6c73[_0x9a34('0x26')](_0x48951f)){if(_[_0x9a34('0x2b')](_0x1b6c73[_0x48951f])){for(var _0x1172aa=0x0;_0x1172aa<_0x1b6c73[_0x48951f][_0x9a34('0x2c')];_0x1172aa+=0x1){addVertex(_0x5a1bde,_0x1b6c73[_0x48951f][_0x1172aa],_0x48951f);}}else{addVertex(_0x5a1bde,_0x1b6c73[_0x48951f],_0x48951f);}}}for(var _0x21adb1=0x0;_0x21adb1<_0x531339['length'];_0x21adb1+=0x1){if(_0x531339[_0x21adb1][_0x9a34('0x2d')]&&_0x531339[_0x21adb1][_0x9a34('0x2e')]){_0x5a1bde['addEdge'](_0x531339[_0x21adb1][_0x9a34('0x2d')],_0x531339[_0x21adb1][_0x9a34('0x2e')],_0x531339[_0x21adb1][_0x9a34('0x2f')]);}}return _0x5a1bde;}function getSquareProject(_0x41c6d3,_0x2a634e){rpc[_0x9a34('0x30')](_0x41c6d3)[_0x9a34('0x31')](function(_0x262249){_0x2a634e(null,_0x262249);})[_0x9a34('0x32')](function(_0x1ee34f){_0x2a634e(null,_0x1ee34f);});}function createSquareReport(_0x2d196f,_0x37ecf3){rpc[_0x9a34('0x33')](_0x2d196f)[_0x9a34('0x31')](function(_0x1a25b9){if(_0x37ecf3){_0x37ecf3(null,_0x1a25b9);}})[_0x9a34('0x32')](function(_0x346e48){if(_0x37ecf3){_0x37ecf3(null,_0x346e48);}});}function setChannelVariables(_0x9bc8d5){for(var _0x12e08b in _0x9bc8d5){if(_0x9bc8d5['hasOwnProperty'](_0x12e08b)){if(_0x12e08b['indexOf'](_0x9a34('0x34'))===0x0){_0x9bc8d5[_0x12e08b[_0x9a34('0x35')](0x4)]=_0x9bc8d5[_0x12e08b];delete _0x9bc8d5[_0x12e08b];}}}}function getLogFromObject(_0x1b463c){return util[_0x9a34('0x36')](_0x1b463c,{'showHidden':![],'depth':null});}function agiHandler(_0x19b171){var _0x158ac2,_0x31049c,_0x3ec7ce,_0x569ae6,_0xa4dda8;logger[_0x9a34('0x37')]('variables',JSON[_0x9a34('0x38')](_0x19b171,null,0x2));logger[_0x9a34('0x14')](util[_0x9a34('0x15')](_0x9a34('0x39'),_0x19b171[_0x9a34('0x1a')],_0x19b171[_0x9a34('0x1b')],_0x19b171[_0x9a34('0x1c')],_0x19b171[_0x9a34('0x1f')],_0x19b171[_0x9a34('0x1d')]));_0x19b171['on']('error',errorHandler);_0x19b171['on'](_0x9a34('0x3a'),closeHandler);_0x19b171['on'](_0x9a34('0x3b'),timeoutHandler);_0x19b171[_0x9a34('0x21')]=![];_0x19b171['on'](_0x9a34('0x3c'),hangupHandler);var _0x496941=getSquareProject[_0x9a34('0x3d')](null,_0x19b171[_0x9a34('0x1a')]);if(_0x496941){if(_0x496941[_0x9a34('0x3e')]){_0x158ac2=getRoot(_0x496941[_0x9a34('0x3e')]);if(_0x158ac2&&_0x158ac2[_0x9a34('0x3f')]){logger[_0x9a34('0x37')](_0x9a34('0x24'),JSON[_0x9a34('0x38')](_0x158ac2,null,0x2));_0x19b171[_0x9a34('0x40')]=moment()[_0x9a34('0x15')](_0x9a34('0x41'));_0x31049c=initGraph(_[_0x9a34('0x42')](_0x158ac2,_0x9a34('0x2a')),_0x158ac2[_0x9a34('0x2a')]);_0x3ec7ce=new Vertices(_0x19b171,rpc,mailRpc);logger[_0x9a34('0x14')](util[_0x9a34('0x15')](_0x9a34('0x43'),_0x19b171[_0x9a34('0x1a')],_0x19b171[_0x9a34('0x1b')],_0x19b171[_0x9a34('0x1c')],_0x19b171['dnid'],_0x19b171[_0x9a34('0x1d')]));_0x31049c[_0x9a34('0x44')](_0x158ac2[_0x9a34('0x3f')]['id'],function(_0x2ce044){try{_0x2ce044=_0x3ec7ce['clear'](_0x2ce044);logger[_0x9a34('0x37')](_0x9a34('0x45'),JSON['stringify'](_0x2ce044,null,0x2));if(_0x2ce044[_0x9a34('0x25')]==='gotoc'){logger[_0x9a34('0x14')]('gotoc\x20block\x20stop\x20traverse\x20BFS');_0x19b171['context']=_0x2ce044[_0x9a34('0x46')]||_0x19b171['context'];_0x19b171[_0x9a34('0x47')]=_0x2ce044[_0x9a34('0x47')];_0x19b171[_0x9a34('0x48')]=_0x2ce044[_0x9a34('0x48')]?_0x2ce044[_0x9a34('0x48')]-0x1:0x1;return null;}else if(_0x2ce044&&_0x3ec7ce[_0x2ce044[_0x9a34('0x25')]]){_0xa4dda8=_0x3ec7ce[_0x2ce044[_0x9a34('0x25')]](_0x2ce044);logger['info'](_0x9a34('0x49'),JSON[_0x9a34('0x38')](_0xa4dda8,null,0x2));if(_0xa4dda8&&_0xa4dda8[_0x9a34('0x4a')]===AGI_CODE_SUCCESS&&_0xa4dda8[_0x9a34('0x4b')]!==AGI_RESULT_ERROR&&!_0x19b171[_0x9a34('0x21')]){logger[_0x9a34('0x37')]('response',getLogFromObject(_0xa4dda8));return _[_0x9a34('0x4c')](_0xa4dda8[_0x9a34('0x4b')])?null:_0xa4dda8['result'][_0x9a34('0x4d')]();}else{logger[_0x9a34('0xf')]('response',getLogFromObject(_0xa4dda8));return null;}}else{logger[_0x9a34('0xf')](_0x9a34('0x4e'));return null;}}catch(_0x2c3ab2){logger[_0x9a34('0xf')](_0x2c3ab2['stack']);return null;}});if(_0x158ac2[_0x9a34('0x4f')]){logger[_0x9a34('0x14')](util['format'](_0x9a34('0x50'),_0x19b171['arg_1'],_0x19b171[_0x9a34('0x1b')],_0x19b171[_0x9a34('0x1c')],_0x19b171[_0x9a34('0x1f')],_0x19b171[_0x9a34('0x1d')]));_0x31049c[_0x9a34('0x44')](_0x158ac2[_0x9a34('0x4f')]['id'],function(_0x1e54e3){try{_0x1e54e3=_0x3ec7ce['clear'](_0x1e54e3);logger[_0x9a34('0x37')](_0x9a34('0x45'),JSON[_0x9a34('0x38')](_0x1e54e3,null,0x2));if(_0x1e54e3&&_0x3ec7ce[_0x1e54e3[_0x9a34('0x25')]]){_0xa4dda8=_0x3ec7ce[_0x1e54e3[_0x9a34('0x25')]](_0x1e54e3);if(_0xa4dda8){logger['debug'](_0x9a34('0x49'),getLogFromObject(_0xa4dda8));return _[_0x9a34('0x4c')](_0xa4dda8[_0x9a34('0x4b')])?null:_0xa4dda8[_0x9a34('0x4b')][_0x9a34('0x4d')]();}else{logger['error'](_0x9a34('0x49'),getLogFromObject(_0xa4dda8));return null;}}else{logger[_0x9a34('0xf')]('agicommand\x20not\x20found');return null;}}catch(_0x508c17){logger[_0x9a34('0xf')](_0x508c17['stack']);return null;}});}logger[_0x9a34('0x14')](util[_0x9a34('0x15')](_0x9a34('0x51'),_0x19b171[_0x9a34('0x1a')],_0x19b171[_0x9a34('0x1b')],_0x19b171[_0x9a34('0x1c')],_0x19b171[_0x9a34('0x1f')],_0x19b171['uniqueid']));logger['info'](util[_0x9a34('0x15')](_0x9a34('0x52'),_0x19b171['context'],_0x19b171['extension'],parseInt(_0x19b171[_0x9a34('0x48')],0xa)+0x1));_0x19b171[_0x9a34('0x53')](_0x19b171[_0x9a34('0x46')],_0x19b171[_0x9a34('0x47')],parseInt(_0x19b171['priority'],0xa)+0x1);_0x19b171[_0x9a34('0x3a')]();}}else{logger[_0x9a34('0xf')](util[_0x9a34('0x15')](_0x9a34('0x54'),_0x19b171[_0x9a34('0x1a')]));_0x19b171['continueAt'](_0x19b171[_0x9a34('0x46')],_0x19b171['extension'],parseInt(_0x19b171[_0x9a34('0x48')],0xa)+0x1);_0x19b171[_0x9a34('0x3a')]();}}else{logger[_0x9a34('0xf')](util[_0x9a34('0x15')](_0x9a34('0x55'),_0x19b171['arg_1']));_0x19b171['continueAt'](_0x19b171['context'],_0x19b171[_0x9a34('0x47')],parseInt(_0x19b171[_0x9a34('0x48')],0xa)+0x1);_0x19b171[_0x9a34('0x3a')]();}}function main(){var _0x5dabf1;return utilLicense[_0x9a34('0x56')]()[_0x9a34('0x31')](function(_0x15b56f){if(_0x15b56f){if(_0x15b56f[_0x9a34('0x57')]){if(_0x15b56f[_0x9a34('0x58')]&&_0x15b56f['callysquare']>0x0){logger['info'](util[_0x9a34('0x15')](_0x9a34('0x59'),_0x15b56f[_0x9a34('0x58')]));_0x5dabf1=_0x15b56f[_0x9a34('0x58')];}else{logger[_0x9a34('0x14')](_0x9a34('0x5a'));}}else{logger[_0x9a34('0x14')](_0x9a34('0x5b'));_0x5dabf1=-0x1;}}})[_0x9a34('0x32')](function(_0x3d4738){logger['error'](_0x9a34('0x5c'),_0x3d4738[_0x9a34('0x10')]);})[_0x9a34('0x4f')](function(){var _0x415020=require('./server')(config[_0x9a34('0xb')][_0x9a34('0x13')],config['agi']['ip'],_0x5dabf1);_0x415020['on'](_0x9a34('0xf'),errorHandler);_0x415020['on'](_0x9a34('0x5d'),listeningHandler);_0x415020['on'](_0x9a34('0x5e'),connectionHandler);_0x415020['on']('close',closeHandler);});}main(); \ No newline at end of file +var _0x85c8=['gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','evtHangup','isUndefined','result','toString','agicommand\x20not\x20found','finally','clear','vertex','[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','close','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20UNLIMITED','./server','listening','xml2json','lodash','syncho','util','moment','../../config/logger','agi','./mailRpc','./graph','./vertices','defaults','127.0.0.1','stack','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','message','error','[%s]\x20%s','format','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','uniqueid','[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','toJson','mxGraphModel','root','agicommand','retry','maxRetry','addVertex','omit','mxCell','hasOwnProperty','isArray','length','target','addEdge','source','value','getSquareProject','then','createSquareReport','catch','indexOf','agi_','variables','hangup','sync','production','stringify','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','start','debug','gotoc'];(function(_0x54fdbd,_0x269060){var _0x1501ab=function(_0x26db98){while(--_0x26db98){_0x54fdbd['push'](_0x54fdbd['shift']());}};_0x1501ab(++_0x269060);}(_0x85c8,0x123));var _0x885c=function(_0x55728f,_0x13fc9d){_0x55728f=_0x55728f-0x0;var _0x11d5de=_0x85c8[_0x55728f];return _0x11d5de;};'use strict';var parser=require(_0x885c('0x0'));var _=require(_0x885c('0x1'));var syncho=require(_0x885c('0x2'));var util=require(_0x885c('0x3'));var moment=require(_0x885c('0x4'));var config=require('../../config/environment');var logger=require(_0x885c('0x5'))(_0x885c('0x6'));var utilLicense=require('../../config/license/util');var rpc=require('./rpc');var mailRpc=require(_0x885c('0x7'));var Graph=require(_0x885c('0x8'));var Vertices=require(_0x885c('0x9'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x885c('0x6')]=_[_0x885c('0xa')](config[_0x885c('0x6')],{'ip':_0x885c('0xb'),'port':0x11dd});function connectionHandler(_0x3bc8d2){process['nextTick'](function(){syncho(function(){try{setChannelVariables(_0x3bc8d2);agiHandler(_0x3bc8d2);}catch(_0x33fc39){logger['error'](_0x33fc39[_0x885c('0xc')]);}});});}function listeningHandler(){console[_0x885c('0xd')](_0x885c('0xe'),config[_0x885c('0x6')][_0x885c('0xf')]);logger[_0x885c('0x10')](util['format'](_0x885c('0x11'),config['agi']['ip'],config[_0x885c('0x6')][_0x885c('0xf')]));}function errorHandler(_0x25d89c){if(_0x25d89c&&_0x25d89c[_0x885c('0x12')]&&_0x25d89c[_0x885c('0x13')]){logger[_0x885c('0x14')](util['format'](_0x885c('0x15'),_0x25d89c[_0x885c('0x12')],_0x25d89c[_0x885c('0x13')]));}else{logger[_0x885c('0x14')](util[_0x885c('0x16')]('[ERROR]\x20%s',_0x25d89c[_0x885c('0xc')]));}}function closeHandler(){logger[_0x885c('0x10')](util[_0x885c('0x16')](_0x885c('0x17'),this[_0x885c('0x18')],this[_0x885c('0x19')],this[_0x885c('0x1a')],this[_0x885c('0x1b')],this[_0x885c('0x1c')]));try{createSquareReport(this);}catch(_0x261b35){logger[_0x885c('0x14')](_0x261b35[_0x885c('0xc')]);}}function timeoutHandler(){logger[_0x885c('0x10')](util['format'](_0x885c('0x1d'),this[_0x885c('0x18')],this[_0x885c('0x19')],this[_0x885c('0x1a')],this[_0x885c('0x1b')],this['uniqueid']));}function hangupHandler(){logger[_0x885c('0x10')](util[_0x885c('0x16')](_0x885c('0x1e'),this['arg_1'],this[_0x885c('0x19')],this[_0x885c('0x1a')],this['dnid'],this[_0x885c('0x1c')]));this['evtHangup']=!![];}function getRoot(_0x3b4394){return parser[_0x885c('0x1f')](_0x3b4394,{'object':!![]})[_0x885c('0x20')][_0x885c('0x21')];}function addVertex(_0x903c0e,_0x37fc50,_0x41e086){_0x37fc50[_0x885c('0x22')]=_0x41e086;if(_0x37fc50['hasOwnProperty'](_0x885c('0x23'))){_0x37fc50[_0x885c('0x24')]=parseInt(_0x37fc50[_0x885c('0x23')],0xa);}_0x903c0e[_0x885c('0x25')](_[_0x885c('0x26')](_0x37fc50,_0x885c('0x27')));}function initGraph(_0x34d235,_0x2c7fd6){var _0x25622a=new Graph();for(var _0x940391 in _0x34d235){if(_0x34d235[_0x885c('0x28')](_0x940391)){if(_[_0x885c('0x29')](_0x34d235[_0x940391])){for(var _0x25d82f=0x0;_0x25d82f<_0x34d235[_0x940391][_0x885c('0x2a')];_0x25d82f+=0x1){addVertex(_0x25622a,_0x34d235[_0x940391][_0x25d82f],_0x940391);}}else{addVertex(_0x25622a,_0x34d235[_0x940391],_0x940391);}}}for(var _0x4c2e93=0x0;_0x4c2e93<_0x2c7fd6[_0x885c('0x2a')];_0x4c2e93+=0x1){if(_0x2c7fd6[_0x4c2e93]['source']&&_0x2c7fd6[_0x4c2e93][_0x885c('0x2b')]){_0x25622a[_0x885c('0x2c')](_0x2c7fd6[_0x4c2e93][_0x885c('0x2d')],_0x2c7fd6[_0x4c2e93][_0x885c('0x2b')],_0x2c7fd6[_0x4c2e93][_0x885c('0x2e')]);}}return _0x25622a;}function getSquareProject(_0x2fd6a7,_0x15508f){rpc[_0x885c('0x2f')](_0x2fd6a7)[_0x885c('0x30')](function(_0x27100e){_0x15508f(null,_0x27100e);})['catch'](function(_0x4341df){_0x15508f(null,_0x4341df);});}function createSquareReport(_0x5ed2b9,_0x32f8ab){rpc[_0x885c('0x31')](_0x5ed2b9)['then'](function(_0x1ddccb){if(_0x32f8ab){_0x32f8ab(null,_0x1ddccb);}})[_0x885c('0x32')](function(_0x17e4b7){if(_0x32f8ab){_0x32f8ab(null,_0x17e4b7);}});}function setChannelVariables(_0x41d509){for(var _0x39f6a2 in _0x41d509){if(_0x41d509[_0x885c('0x28')](_0x39f6a2)){if(_0x39f6a2[_0x885c('0x33')](_0x885c('0x34'))===0x0){_0x41d509[_0x39f6a2['substring'](0x4)]=_0x41d509[_0x39f6a2];delete _0x41d509[_0x39f6a2];}}}}function getLogFromObject(_0x31b49b){return util['inspect'](_0x31b49b,{'showHidden':![],'depth':null});}function agiHandler(_0x36923c){var _0x241a51,_0x46d0d7,_0x269201,_0x20f36f,_0x4bd2ae;logger['debug'](_0x885c('0x35'),JSON['stringify'](_0x36923c,null,0x2));logger[_0x885c('0x10')](util['format']('[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x36923c[_0x885c('0x18')],_0x36923c[_0x885c('0x19')],_0x36923c[_0x885c('0x1a')],_0x36923c[_0x885c('0x1b')],_0x36923c['uniqueid']));_0x36923c['on'](_0x885c('0x14'),errorHandler);_0x36923c['on']('close',closeHandler);_0x36923c['on']('timeout',timeoutHandler);_0x36923c['evtHangup']=![];_0x36923c['on'](_0x885c('0x36'),hangupHandler);var _0x324c2c=getSquareProject[_0x885c('0x37')](null,_0x36923c[_0x885c('0x18')]);if(_0x324c2c){if(_0x324c2c[_0x885c('0x38')]){_0x241a51=getRoot(_0x324c2c[_0x885c('0x38')]);if(_0x241a51&&_0x241a51['start']){logger['debug'](_0x885c('0x21'),JSON[_0x885c('0x39')](_0x241a51,null,0x2));_0x36923c[_0x885c('0x3a')]=moment()[_0x885c('0x16')](_0x885c('0x3b'));_0x46d0d7=initGraph(_[_0x885c('0x26')](_0x241a51,_0x885c('0x27')),_0x241a51[_0x885c('0x27')]);_0x269201=new Vertices(_0x36923c,rpc,mailRpc);logger[_0x885c('0x10')](util['format'](_0x885c('0x3c'),_0x36923c[_0x885c('0x18')],_0x36923c[_0x885c('0x19')],_0x36923c[_0x885c('0x1a')],_0x36923c['dnid'],_0x36923c[_0x885c('0x1c')]));_0x46d0d7[_0x885c('0x3d')](_0x241a51[_0x885c('0x3e')]['id'],function(_0x299fc6){try{_0x299fc6=_0x269201['clear'](_0x299fc6);logger[_0x885c('0x3f')]('vertex',JSON['stringify'](_0x299fc6,null,0x2));if(_0x299fc6[_0x885c('0x22')]===_0x885c('0x40')){logger[_0x885c('0x10')](_0x885c('0x41'));_0x36923c[_0x885c('0x42')]=_0x299fc6[_0x885c('0x42')]||_0x36923c['context'];_0x36923c['extension']=_0x299fc6[_0x885c('0x43')];_0x36923c['priority']=_0x299fc6[_0x885c('0x44')]?_0x299fc6[_0x885c('0x44')]-0x1:0x1;return null;}else if(_0x299fc6&&_0x269201[_0x299fc6['agicommand']]){_0x4bd2ae=_0x269201[_0x299fc6[_0x885c('0x22')]](_0x299fc6);logger['info'](_0x885c('0x45'),JSON['stringify'](_0x4bd2ae,null,0x2));if(_0x4bd2ae&&_0x4bd2ae[_0x885c('0x46')]===AGI_CODE_SUCCESS&&_0x4bd2ae['result']!==AGI_RESULT_ERROR&&!_0x36923c[_0x885c('0x47')]){logger['debug'](_0x885c('0x45'),getLogFromObject(_0x4bd2ae));return _[_0x885c('0x48')](_0x4bd2ae[_0x885c('0x49')])?null:_0x4bd2ae['result'][_0x885c('0x4a')]();}else{logger[_0x885c('0x14')](_0x885c('0x45'),getLogFromObject(_0x4bd2ae));return null;}}else{logger[_0x885c('0x14')](_0x885c('0x4b'));return null;}}catch(_0x5b499f){logger[_0x885c('0x14')](_0x5b499f[_0x885c('0xc')]);return null;}});if(_0x241a51[_0x885c('0x4c')]){logger[_0x885c('0x10')](util['format']('[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x36923c[_0x885c('0x18')],_0x36923c[_0x885c('0x19')],_0x36923c[_0x885c('0x1a')],_0x36923c[_0x885c('0x1b')],_0x36923c[_0x885c('0x1c')]));_0x46d0d7[_0x885c('0x3d')](_0x241a51[_0x885c('0x4c')]['id'],function(_0x433bbb){try{_0x433bbb=_0x269201[_0x885c('0x4d')](_0x433bbb);logger[_0x885c('0x3f')](_0x885c('0x4e'),JSON[_0x885c('0x39')](_0x433bbb,null,0x2));if(_0x433bbb&&_0x269201[_0x433bbb[_0x885c('0x22')]]){_0x4bd2ae=_0x269201[_0x433bbb[_0x885c('0x22')]](_0x433bbb);if(_0x4bd2ae){logger[_0x885c('0x3f')](_0x885c('0x45'),getLogFromObject(_0x4bd2ae));return _['isUndefined'](_0x4bd2ae[_0x885c('0x49')])?null:_0x4bd2ae[_0x885c('0x49')][_0x885c('0x4a')]();}else{logger[_0x885c('0x14')]('response',getLogFromObject(_0x4bd2ae));return null;}}else{logger['error'](_0x885c('0x4b'));return null;}}catch(_0x2d7ba3){logger[_0x885c('0x14')](_0x2d7ba3[_0x885c('0xc')]);return null;}});}logger[_0x885c('0x10')](util[_0x885c('0x16')](_0x885c('0x4f'),_0x36923c[_0x885c('0x18')],_0x36923c['calleridname'],_0x36923c['callerid'],_0x36923c[_0x885c('0x1b')],_0x36923c['uniqueid']));logger[_0x885c('0x10')](util[_0x885c('0x16')](_0x885c('0x50'),_0x36923c[_0x885c('0x42')],_0x36923c[_0x885c('0x43')],parseInt(_0x36923c[_0x885c('0x44')],0xa)+0x1));_0x36923c[_0x885c('0x51')](_0x36923c[_0x885c('0x42')],_0x36923c['extension'],parseInt(_0x36923c[_0x885c('0x44')],0xa)+0x1);_0x36923c[_0x885c('0x52')]();}}else{logger['error'](util[_0x885c('0x16')]('Project\x20%s\x20not\x20published',_0x36923c[_0x885c('0x18')]));_0x36923c[_0x885c('0x51')](_0x36923c[_0x885c('0x42')],_0x36923c[_0x885c('0x43')],parseInt(_0x36923c[_0x885c('0x44')],0xa)+0x1);_0x36923c[_0x885c('0x52')]();}}else{logger[_0x885c('0x14')](util[_0x885c('0x16')]('Project\x20%s\x20not\x20found',_0x36923c[_0x885c('0x18')]));_0x36923c[_0x885c('0x51')](_0x36923c[_0x885c('0x42')],_0x36923c['extension'],parseInt(_0x36923c[_0x885c('0x44')],0xa)+0x1);_0x36923c['close']();}}function main(){var _0x3dd221;return utilLicense[_0x885c('0x53')]()[_0x885c('0x30')](function(_0x71181e){if(_0x71181e){if(_0x71181e[_0x885c('0x54')]){if(_0x71181e[_0x885c('0x55')]&&_0x71181e[_0x885c('0x55')]>0x0){logger[_0x885c('0x10')](util[_0x885c('0x16')]('[LICENSE]\x20CHANNELS:\x20%s',_0x71181e['callysquare']));_0x3dd221=_0x71181e['callysquare'];}else{logger['info'](_0x885c('0x56'));}}else{logger[_0x885c('0x10')]('[LICENSE]\x20VOICE\x20IS\x20DISABLED');_0x3dd221=-0x1;}}})['catch'](function(_0x1d445f){logger['error']('[LICENSE]',_0x1d445f[_0x885c('0xc')]);})[_0x885c('0x4c')](function(){var _0x143aa1=require(_0x885c('0x57'))(config[_0x885c('0x6')][_0x885c('0xf')],config['agi']['ip'],_0x3dd221);_0x143aa1['on']('error',errorHandler);_0x143aa1['on'](_0x885c('0x58'),listeningHandler);_0x143aa1['on']('connection',connectionHandler);_0x143aa1['on']('close',closeHandler);});}main(); \ No newline at end of file diff --git a/server/services/agi/mailRpc/index.js b/server/services/agi/mailRpc/index.js index 693a084..483601d 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 _0xddfb=['message','result','catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','request','then','error'];(function(_0x245e1c,_0x1213a8){var _0x4308ca=function(_0x4de3e7){while(--_0x4de3e7){_0x245e1c['push'](_0x245e1c['shift']());}};_0x4308ca(++_0x1213a8);}(_0xddfb,0x14f));var _0xbddf=function(_0x4020f3,_0x61e83c){_0x4020f3=_0x4020f3-0x0;var _0x2cc849=_0xddfb[_0x4020f3];return _0x2cc849;};'use strict';var BPromise=require(_0xbddf('0x0'));var jayson=require(_0xbddf('0x1'));var client=jayson[_0xbddf('0x2')]['http']({'port':0x232b});function request(_0x596f57,_0x43a4ea){return new BPromise(function(_0x47807e,_0x2e7664){return client[_0xbddf('0x3')](_0x596f57,_0x43a4ea)[_0xbddf('0x4')](function(_0x5a99d9){if(_0x5a99d9[_0xbddf('0x5')]){return _0x2e7664(_0x5a99d9['error'][_0xbddf('0x6')]);}else{return _0x47807e(_0x5a99d9[_0xbddf('0x7')]);}})[_0xbddf('0x8')](function(_0x143c73){return _0x2e7664(_0x143c73);});});}exports[_0xbddf('0x9')]=function(_0x2b3495,_0x4cfd11){return request(_0xbddf('0xa'),{'account':_0x2b3495,'message':_0x4cfd11});}; \ No newline at end of file +var _0xddbf=['jayson/promise','client','http','then','error','result','sendMailMessage','bluebird'];(function(_0x37e845,_0x219f9f){var _0x59e55b=function(_0x5dc6c8){while(--_0x5dc6c8){_0x37e845['push'](_0x37e845['shift']());}};_0x59e55b(++_0x219f9f);}(_0xddbf,0x12f));var _0xfddb=function(_0x276528,_0x58af5f){_0x276528=_0x276528-0x0;var _0x4cfeb9=_0xddbf[_0x276528];return _0x4cfeb9;};'use strict';var BPromise=require(_0xfddb('0x0'));var jayson=require(_0xfddb('0x1'));var client=jayson[_0xfddb('0x2')][_0xfddb('0x3')]({'port':0x232b});function request(_0x24af65,_0x46b8e2){return new BPromise(function(_0x22c26f,_0x2893f4){return client['request'](_0x24af65,_0x46b8e2)[_0xfddb('0x4')](function(_0x318b54){if(_0x318b54[_0xfddb('0x5')]){return _0x2893f4(_0x318b54[_0xfddb('0x5')]['message']);}else{return _0x22c26f(_0x318b54[_0xfddb('0x6')]);}})['catch'](function(_0x230c4a){return _0x2893f4(_0x230c4a);});});}exports[_0xfddb('0x7')]=function(_0xb72537,_0x5e0d1b){return request('SendMail',{'account':_0xb72537,'message':_0x5e0d1b});}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index 5ef5d8a..e526cba 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 _0x8441=['length','split','indexOf','slice','trim','headers','emit','line','exports','util','stream','Transform','_localBuffer','_inBody','prototype','\x0d\x0a\x0d\x0a','toString','substring'];(function(_0x5a4d0d,_0x40a833){var _0x4e5562=function(_0x66b580){while(--_0x66b580){_0x5a4d0d['push'](_0x5a4d0d['shift']());}};_0x4e5562(++_0x40a833);}(_0x8441,0x1dd));var _0x1844=function(_0x3371a5,_0x24f8e2){_0x3371a5=_0x3371a5-0x0;var _0x47a8ea=_0x8441[_0x3371a5];return _0x47a8ea;};'use strict';var util=require(_0x1844('0x0'));var Transform=require(_0x1844('0x1'))[_0x1844('0x2')];function AGIReply(_0x1f0f2f){Transform['call'](this,_0x1f0f2f);this[_0x1844('0x3')]='';this[_0x1844('0x4')]=![];}util['inherits'](AGIReply,Transform);AGIReply[_0x1844('0x5')]['_transform']=function(_0x1ecb90,_0x546d9b,_0x2cd366){var _0x28076b='\x0a',_0x44ab21=['\x0a\x0a',_0x1844('0x6')],_0x11eb95=-0x1,_0x335bba=-0x1,_0x21bc6a='',_0xcc16c0=0x0,_0x406e2d='',_0x37caaf='';this[_0x1844('0x3')]+=_0x1ecb90[_0x1844('0x7')]();_0x406e2d=this['_localBuffer'];if(!this[_0x1844('0x4')]){_0xcc16c0=0x0;while(_0x44ab21[_0xcc16c0]){while((_0x335bba=_0x406e2d['indexOf'](_0x44ab21[_0xcc16c0]))!=-0x1){_0x21bc6a=_0x44ab21[_0xcc16c0];_0x37caaf=_0x406e2d[_0x1844('0x8')](0x0,_0x335bba);_0x406e2d=_0x406e2d[_0x1844('0x8')](_0x335bba+_0x21bc6a[_0x1844('0x9')]);var _0x3b4b97=_0x37caaf[_0x1844('0xa')](_0x28076b),_0x3ece79=0x0,_0x28b4f1={},_0x4293c9='',_0x507794='',_0x229db9=-0x1;while(_0x3b4b97[_0x3ece79]){_0x229db9=_0x3b4b97[_0x3ece79][_0x1844('0xb')](':');if(_0x229db9!=-0x1){_0x4293c9=_0x3b4b97[_0x3ece79][_0x1844('0xc')](0x0,_0x229db9)[_0x1844('0xd')]();_0x507794=_0x3b4b97[_0x3ece79][_0x1844('0xc')](_0x229db9+0x1)[_0x1844('0xd')]();if(_0x4293c9[_0x1844('0x9')]>0x0){_0x28b4f1[_0x4293c9]=_0x507794;}}else{}_0x3ece79++;}this['emit'](_0x1844('0xe'),_0x28b4f1);this[_0x1844('0x4')]=!![];}_0xcc16c0++;}this[_0x1844('0x3')]=_0x406e2d;}else{while((_0x11eb95=_0x406e2d['indexOf'](_0x28076b))!=-0x1){_0x37caaf=_0x406e2d[_0x1844('0x8')](0x0,_0x11eb95);this[_0x1844('0xf')](_0x1844('0x10'),_0x37caaf);_0x406e2d=_0x406e2d[_0x1844('0x8')](_0x11eb95+_0x28076b[_0x1844('0x9')]);}this[_0x1844('0x3')]=_0x406e2d;}_0x2cd366();};module[_0x1844('0x11')]=AGIReply; \ No newline at end of file +var _0x2b95=['emit','headers','exports','Transform','call','_localBuffer','_inBody','inherits','prototype','_transform','\x0d\x0a\x0d\x0a','toString','indexOf','substring','length','split','slice','trim'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2b95,0x159));var _0x52b9=function(_0x2d61ac,_0x18ff36){_0x2d61ac=_0x2d61ac-0x0;var _0x3f7d3c=_0x2b95[_0x2d61ac];return _0x3f7d3c;};'use strict';var util=require('util');var Transform=require('stream')[_0x52b9('0x0')];function AGIReply(_0x156c19){Transform[_0x52b9('0x1')](this,_0x156c19);this[_0x52b9('0x2')]='';this[_0x52b9('0x3')]=![];}util[_0x52b9('0x4')](AGIReply,Transform);AGIReply[_0x52b9('0x5')][_0x52b9('0x6')]=function(_0x16b0b4,_0x3df583,_0x1b62d6){var _0x49a291='\x0a',_0x5560d2=['\x0a\x0a',_0x52b9('0x7')],_0xee7714=-0x1,_0x45d484=-0x1,_0x5ea6c4='',_0x20004c=0x0,_0xb8eceb='',_0x2e4df6='';this[_0x52b9('0x2')]+=_0x16b0b4[_0x52b9('0x8')]();_0xb8eceb=this[_0x52b9('0x2')];if(!this[_0x52b9('0x3')]){_0x20004c=0x0;while(_0x5560d2[_0x20004c]){while((_0x45d484=_0xb8eceb[_0x52b9('0x9')](_0x5560d2[_0x20004c]))!=-0x1){_0x5ea6c4=_0x5560d2[_0x20004c];_0x2e4df6=_0xb8eceb['substring'](0x0,_0x45d484);_0xb8eceb=_0xb8eceb[_0x52b9('0xa')](_0x45d484+_0x5ea6c4[_0x52b9('0xb')]);var _0x5dc571=_0x2e4df6[_0x52b9('0xc')](_0x49a291),_0x3c9668=0x0,_0x239314={},_0x4f8ed8='',_0x7c39e0='',_0x5b6924=-0x1;while(_0x5dc571[_0x3c9668]){_0x5b6924=_0x5dc571[_0x3c9668]['indexOf'](':');if(_0x5b6924!=-0x1){_0x4f8ed8=_0x5dc571[_0x3c9668][_0x52b9('0xd')](0x0,_0x5b6924)[_0x52b9('0xe')]();_0x7c39e0=_0x5dc571[_0x3c9668][_0x52b9('0xd')](_0x5b6924+0x1)[_0x52b9('0xe')]();if(_0x4f8ed8[_0x52b9('0xb')]>0x0){_0x239314[_0x4f8ed8]=_0x7c39e0;}}else{}_0x3c9668++;}this[_0x52b9('0xf')](_0x52b9('0x10'),_0x239314);this[_0x52b9('0x3')]=!![];}_0x20004c++;}this[_0x52b9('0x2')]=_0xb8eceb;}else{while((_0xee7714=_0xb8eceb[_0x52b9('0x9')](_0x49a291))!=-0x1){_0x2e4df6=_0xb8eceb[_0x52b9('0xa')](0x0,_0xee7714);this[_0x52b9('0xf')]('line',_0x2e4df6);_0xb8eceb=_0xb8eceb[_0x52b9('0xa')](_0xee7714+_0x49a291['length']);}this[_0x52b9('0x2')]=_0xb8eceb;}_0x1b62d6();};module[_0x52b9('0x11')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index 195caab..0ffe860 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 _0x811e=['save_name','getIntervalById','ShowInterval','Interval','createSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','format','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','then','CreateCmContact','getPauseById','agentLogin','LoginUser','agentPause','agentUnpause','UnpauseUser','agentLogout','LogoutUser','moment','util','jayson/promise','client','http','request','error','message','result','catch','production','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','name','email','ShowSquareProject','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','getUserById','ShowUser','ShowTrunk','getSoundById'];(function(_0x57110a,_0x3f7b1c){var _0x40be25=function(_0x4c74d4){while(--_0x4c74d4){_0x57110a['push'](_0x57110a['shift']());}};_0x40be25(++_0x3f7b1c);}(_0x811e,0x173));var _0xe811=function(_0xbbfbe5,_0xea27e5){_0xbbfbe5=_0xbbfbe5-0x0;var _0x1bd762=_0x811e[_0xbbfbe5];return _0x1bd762;};'use strict';var BPromise=require('bluebird');var moment=require(_0xe811('0x0'));var _=require('lodash');var util=require(_0xe811('0x1'));var jayson=require(_0xe811('0x2'));var client=jayson[_0xe811('0x3')][_0xe811('0x4')]({'port':0x2329});function request(_0x41c6a0,_0x3b37d3){return new BPromise(function(_0x3bc235,_0x5b0ecf){return client[_0xe811('0x5')](_0x41c6a0,_0x3b37d3)['then'](function(_0x5d99ca){if(_0x5d99ca[_0xe811('0x6')]){return _0x5b0ecf(_0x5d99ca['error'][_0xe811('0x7')]);}else{return _0x3bc235(_0x5d99ca[_0xe811('0x8')]);}})[_0xe811('0x9')](function(_0x383cdf){return _0x5b0ecf(_0x383cdf);});});}exports['getSquareProject']=function(_0x4fe722){return request('ShowSquareProject',{'options':{'raw':![],'where':{'name':_0x4fe722},'attributes':[_0xe811('0xa')]}});};exports[_0xe811('0xb')]=function(_0x2f60c3){return request(_0xe811('0xc'),{'options':{'raw':![],'where':{'id':_0x2f60c3},'include':[{'model':_0xe811('0xd'),'as':_0xe811('0xe')}],'attributes':['id',_0xe811('0xf'),_0xe811('0x10')]}});};exports['getSquareProjectById']=function(_0x11d0ff){return request(_0xe811('0x11'),{'options':{'where':{'id':_0x11d0ff},'attributes':[_0xe811('0xf')]}});};exports[_0xe811('0x12')]=function(_0x691d8){return request(_0xe811('0x13'),{'options':{'where':{'id':_0x691d8},'attributes':[_0xe811('0xf')]}});};exports[_0xe811('0x14')]=function(_0x1e3a6a){return request(_0xe811('0x15'),{'options':{'where':{'id':_0x1e3a6a},'attributes':[_0xe811('0xf')]}});};exports[_0xe811('0x16')]=function(_0x1d8d0a){return request(_0xe811('0x17'),{'options':{'where':{'id':_0x1d8d0a},'attributes':['dsn']}});};exports[_0xe811('0x18')]=function(_0x51423d){return request(_0xe811('0x19'),{'options':{'where':{'id':_0x51423d},'attributes':[_0xe811('0xf')]}});};exports['getTrunkById']=function(_0x24773a){return request(_0xe811('0x1a'),{'options':{'where':{'id':_0x24773a},'attributes':[_0xe811('0xf')]}});};exports[_0xe811('0x1b')]=function(_0x544a9e){return request('ShowSound',{'options':{'where':{'id':_0x544a9e},'attributes':[_0xe811('0x1c')]}});};exports[_0xe811('0x1d')]=function(_0x296234){return request(_0xe811('0x1e'),{'options':{'raw':![],'where':{'id':_0x296234},'include':[{'model':_0xe811('0x1f'),'as':'Intervals'}]}});};exports['getSmsAccountById']=function(_0x2ce312){return request('ShowSmsAccount',{'options':{'where':{'id':_0x2ce312},'attributes':['id',_0xe811('0xf')]}});};exports[_0xe811('0x20')]=function(_0x5d6f92){return request('CreateSmsMessage',{'body':_0x5d6f92});};exports[_0xe811('0x21')]=function(_0x1bb877){return request(_0xe811('0x22'),{'body':_0x1bb877});};exports[_0xe811('0x23')]=function(_0x41fd55){return request(_0xe811('0x24'),{'body':_[_0xe811('0x25')](_0x41fd55,{'project_name':_0x41fd55[_0xe811('0x26')],'prev_project_name':_0x41fd55[_0xe811('0x27')]||'','is_subproject':_0x41fd55[_0xe811('0x27')]?!![]:![],'leaveAt':moment()[_0xe811('0x28')]('YYYY-MM-DD\x20HH:mm:ss')})});};exports[_0xe811('0x29')]=function(_0x5591ff){return request(_0xe811('0x2a'),{'body':_0x5591ff});};exports[_0xe811('0x2b')]=function(_0x5bfdbe){return request(_0xe811('0x2c'),{'body':_0x5bfdbe});};exports[_0xe811('0x2d')]=function(_0x351152){return request(_0xe811('0x2e'),{'options':{'raw':![],'where':{'phone':_0x351152['phone'],'ListId':_0x351152['ListId']}}})[_0xe811('0x2f')](function(_0x149841){if(_0x149841){return _0x149841;}return request(_0xe811('0x30'),{'body':_0x351152});});};exports[_0xe811('0x31')]=function(_0x4fcaeb){return request('ShowPause',{'options':{'where':{'id':_0x4fcaeb},'attributes':[_0xe811('0xf')]}});};exports[_0xe811('0x32')]=function(_0x5a856f,_0x386e9a){return request(_0xe811('0x33'),{'body':{'interface':_0x386e9a},'options':{'where':_0x5a856f}});};exports[_0xe811('0x34')]=function(_0x4ff246,_0x2fc272,_0x565ee4){return request('PauseUser',{'body':{'type':_0x2fc272,'uniqueid':_0x565ee4},'options':{'where':_0x4ff246}});};exports[_0xe811('0x35')]=function(_0x36d559){return request(_0xe811('0x36'),{'body':{},'options':{'where':_0x36d559}});};exports[_0xe811('0x37')]=function(_0x2c443f){return request(_0xe811('0x38'),{'body':{},'options':{'where':_0x2c443f}});}; \ No newline at end of file +var _0x91b1=['arg_2','YYYY-MM-DD\x20HH:mm:ss','CreateSquareRecording','CreateSquareMessage','createCmContact','ShowCmHopper','phone','then','CreateCmContact','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','agentLogout','LogoutUser','bluebird','moment','lodash','util','client','http','request','error','catch','getSquareProject','ShowSquareProject','ShowMailAccount','Smtp','name','email','getSquareProjectById','ShowVoiceQueue','getVariableById','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','ShowUser','getTrunkById','ShowTrunk','getSoundById','ShowSound','save_name','getIntervalById','Intervals','getSmsAccountById','ShowSmsAccount','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1'];(function(_0x4704dc,_0x575a5f){var _0x254d81=function(_0x3b135d){while(--_0x3b135d){_0x4704dc['push'](_0x4704dc['shift']());}};_0x254d81(++_0x575a5f);}(_0x91b1,0x1c8));var _0x191b=function(_0x176329,_0x568c84){_0x176329=_0x176329-0x0;var _0x31997c=_0x91b1[_0x176329];return _0x31997c;};'use strict';var BPromise=require(_0x191b('0x0'));var moment=require(_0x191b('0x1'));var _=require(_0x191b('0x2'));var util=require(_0x191b('0x3'));var jayson=require('jayson/promise');var client=jayson[_0x191b('0x4')][_0x191b('0x5')]({'port':0x2329});function request(_0x5b103a,_0x90bb9){return new BPromise(function(_0xd86823,_0x438e34){return client[_0x191b('0x6')](_0x5b103a,_0x90bb9)['then'](function(_0x4295d8){if(_0x4295d8[_0x191b('0x7')]){return _0x438e34(_0x4295d8[_0x191b('0x7')]['message']);}else{return _0xd86823(_0x4295d8['result']);}})[_0x191b('0x8')](function(_0x1d6d9f){return _0x438e34(_0x1d6d9f);});});}exports[_0x191b('0x9')]=function(_0x33fe8d){return request(_0x191b('0xa'),{'options':{'raw':![],'where':{'name':_0x33fe8d},'attributes':['production']}});};exports['getMailAccountById']=function(_0x463704){return request(_0x191b('0xb'),{'options':{'raw':![],'where':{'id':_0x463704},'include':[{'model':'MailServerOut','as':_0x191b('0xc')}],'attributes':['id',_0x191b('0xd'),_0x191b('0xe')]}});};exports[_0x191b('0xf')]=function(_0x228129){return request(_0x191b('0xa'),{'options':{'where':{'id':_0x228129},'attributes':[_0x191b('0xd')]}});};exports['getVoiceQueueById']=function(_0x461923){return request(_0x191b('0x10'),{'options':{'where':{'id':_0x461923},'attributes':[_0x191b('0xd')]}});};exports[_0x191b('0x11')]=function(_0xeee1fb){return request('ShowVariable',{'options':{'where':{'id':_0xeee1fb},'attributes':[_0x191b('0xd')]}});};exports[_0x191b('0x12')]=function(_0x1df384){return request(_0x191b('0x13'),{'options':{'where':{'id':_0x1df384},'attributes':[_0x191b('0x14')]}});};exports[_0x191b('0x15')]=function(_0x4097a0){return request(_0x191b('0x16'),{'options':{'where':{'id':_0x4097a0},'attributes':[_0x191b('0xd')]}});};exports[_0x191b('0x17')]=function(_0x3b7adc){return request(_0x191b('0x18'),{'options':{'where':{'id':_0x3b7adc},'attributes':[_0x191b('0xd')]}});};exports[_0x191b('0x19')]=function(_0x4bebba){return request(_0x191b('0x1a'),{'options':{'where':{'id':_0x4bebba},'attributes':[_0x191b('0x1b')]}});};exports[_0x191b('0x1c')]=function(_0x56ed11){return request('ShowInterval',{'options':{'raw':![],'where':{'id':_0x56ed11},'include':[{'model':'Interval','as':_0x191b('0x1d')}]}});};exports[_0x191b('0x1e')]=function(_0x19b2c0){return request(_0x191b('0x1f'),{'options':{'where':{'id':_0x19b2c0},'attributes':['id','name']}});};exports['createSmsMessage']=function(_0x482169){return request(_0x191b('0x20'),{'body':_0x482169});};exports[_0x191b('0x21')]=function(_0x3956b1){return request(_0x191b('0x22'),{'body':_0x3956b1});};exports[_0x191b('0x23')]=function(_0x10c800){return request(_0x191b('0x24'),{'body':_[_0x191b('0x25')](_0x10c800,{'project_name':_0x10c800[_0x191b('0x26')],'prev_project_name':_0x10c800[_0x191b('0x27')]||'','is_subproject':_0x10c800['arg_2']?!![]:![],'leaveAt':moment()['format'](_0x191b('0x28'))})});};exports['createSquareRecording']=function(_0x5a7c13){return request(_0x191b('0x29'),{'body':_0x5a7c13});};exports['createSquareMessage']=function(_0x17b580){return request(_0x191b('0x2a'),{'body':_0x17b580});};exports[_0x191b('0x2b')]=function(_0x5425fb){return request(_0x191b('0x2c'),{'options':{'raw':![],'where':{'phone':_0x5425fb[_0x191b('0x2d')],'ListId':_0x5425fb['ListId']}}})[_0x191b('0x2e')](function(_0x94f9e4){if(_0x94f9e4){return _0x94f9e4;}return request(_0x191b('0x2f'),{'body':_0x5425fb});});};exports['getPauseById']=function(_0x172d61){return request(_0x191b('0x30'),{'options':{'where':{'id':_0x172d61},'attributes':[_0x191b('0xd')]}});};exports[_0x191b('0x31')]=function(_0x5bb763,_0x5345f9){return request(_0x191b('0x32'),{'body':{'interface':_0x5345f9},'options':{'where':_0x5bb763}});};exports[_0x191b('0x33')]=function(_0x27a47b,_0x690227,_0x2d5b30){return request(_0x191b('0x34'),{'body':{'type':_0x690227,'uniqueid':_0x2d5b30},'options':{'where':_0x27a47b}});};exports['agentUnpause']=function(_0x213419){return request('UnpauseUser',{'body':{},'options':{'where':_0x213419}});};exports[_0x191b('0x35')]=function(_0xc295fc){return request(_0x191b('0x36'),{'body':{},'options':{'where':_0xc295fc}});}; \ 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 42b002e..5739a0e 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 _0x938d=['./polly','./lex'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0x938d,0x122));var _0xd938=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x938d[_0x3dd15e];return _0x231fd0;};var polly=require(_0xd938('0x0'));var lex=require(_0xd938('0x1'));module['exports']={'polly':polly,'lex':lex}; \ No newline at end of file +var _0xc4f5=['exports','./lex'];(function(_0x16996b,_0x30dce4){var _0x2bdf42=function(_0x4e7384){while(--_0x4e7384){_0x16996b['push'](_0x16996b['shift']());}};_0x2bdf42(++_0x30dce4);}(_0xc4f5,0xa5));var _0x5c4f=function(_0x2610db,_0x454344){_0x2610db=_0x2610db-0x0;var _0x5d4d96=_0xc4f5[_0x2610db];return _0x5d4d96;};var polly=require('./polly');var lex=require(_0x5c4f('0x0'));module[_0x5c4f('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 aa294fd..1a8a92f 100644 --- a/server/services/agi/scripts/aws/lex/index.js +++ b/server/services/agi/scripts/aws/lex/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c00=['./lib/api','exports'];(function(_0x1a4969,_0x3bb31e){var _0x2ff811=function(_0x3f144d){while(--_0x3f144d){_0x1a4969['push'](_0x1a4969['shift']());}};_0x2ff811(++_0x3bb31e);}(_0x9c00,0x1a0));var _0x09c0=function(_0x4057a1,_0x315235){_0x4057a1=_0x4057a1-0x0;var _0x12f4a3=_0x9c00[_0x4057a1];return _0x12f4a3;};'use strict';var lex=require(_0x09c0('0x0'));module[_0x09c0('0x1')]=function(_0x4dff21,_0x5e32e7,_0xe0d293,_0x8c9907,_0x5d1967,_0x220c0c){return lex(_0x4dff21,_0x5e32e7,_0xe0d293,_0x8c9907,_0x5d1967,_0x220c0c);}; \ No newline at end of file +'use strict';var lex=require('./lib/api');module['exports']=function(_0x46400f,_0xa5f6b7,_0x4a08d4,_0x5080f5,_0x229028,_0x1fdf5b){return lex(_0x46400f,_0xa5f6b7,_0x4a08d4,_0x5080f5,_0x229028,_0x1fdf5b);}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/lib/api.js b/server/services/agi/scripts/aws/lex/lib/api.js index cc6feb8..9fb6c7d 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(_0x44c19f,_0x28eec2){var _0x3f2bd1=function(_0x363815){while(--_0x363815){_0x44c19f['push'](_0x44c19f['shift']());}};_0x3f2bd1(++_0x28eec2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xa9e0[_0x3b5250];return _0xc844a1;};'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(_0x6bfb8f,_0x2a4a90){var _0x2317c5=function(_0x2ba04f){while(--_0x2ba04f){_0x6bfb8f['push'](_0x6bfb8f['shift']());}};_0x2317c5(++_0x2a4a90);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0xa9e0[_0xf0bcac];return _0x4e4c65;};'use strict';var BPromise=require(_0x0a9e('0x0'));var AWS=require(_0x0a9e('0x1'));function lexResult(_0x29929c,_0x5dd881){return new BPromise(function(_0x550fbc,_0x18d5c9){_0x29929c['postText'](_0x5dd881,function(_0x333808,_0x432180){if(_0x333808){_0x18d5c9(_0x333808);}if(_0x432180[_0x0a9e('0x2')]){for(const _0x991246 in _0x432180[_0x0a9e('0x2')]){if(_0x432180['slots'][_0x0a9e('0x3')](_0x991246)){var _0x441e3a=_0x432180[_0x0a9e('0x2')][_0x991246];_0x432180['slot_'+_0x991246]=_0x441e3a;}}}_0x550fbc(_0x432180);});});}module['exports']=function(_0xe42b77,_0x56465b,_0x52cace,_0x39753a,_0xf81284,_0x307b3e){var _0x3ab53f=new AWS[(_0x0a9e('0x4'))]({'accessKeyId':_0x56465b,'secretAccessKey':_0x52cace,'region':_0x39753a});var _0xbd1168={'botAlias':'$LATEST','botName':_0x307b3e,'inputText':_0xf81284,'userId':_0xe42b77};return lexResult(_0x3ab53f,_0xbd1168);}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/polly/index.js b/server/services/agi/scripts/aws/polly/index.js index e4754bc..aac0c26 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 _0x7a14=['./lib/api','exports'];(function(_0x106aac,_0x66eb9a){var _0x4ac9f2=function(_0x567b8a){while(--_0x567b8a){_0x106aac['push'](_0x106aac['shift']());}};_0x4ac9f2(++_0x66eb9a);}(_0x7a14,0xfa));var _0x47a1=function(_0x19605e,_0x32be85){_0x19605e=_0x19605e-0x0;var _0x47545b=_0x7a14[_0x19605e];return _0x47545b;};'use strict';var polly=require(_0x47a1('0x0'));module[_0x47a1('0x1')]=function(_0x3e15ac,_0x44ab6f,_0x151373,_0x627e71,_0x11b992,_0x52a9b4,_0xc8bed){return polly(_0x3e15ac,_0x44ab6f,_0x151373,_0x627e71,_0x11b992,_0x52a9b4,_0xc8bed);}; \ No newline at end of file +var _0x28c8=['./lib/api','exports'];(function(_0x16b1a5,_0x318267){var _0x475e25=function(_0x2e3bf6){while(--_0x2e3bf6){_0x16b1a5['push'](_0x16b1a5['shift']());}};_0x475e25(++_0x318267);}(_0x28c8,0x1ac));var _0x828c=function(_0x291f8b,_0x3b5591){_0x291f8b=_0x291f8b-0x0;var _0x275171=_0x28c8[_0x291f8b];return _0x275171;};'use strict';var polly=require(_0x828c('0x0'));module[_0x828c('0x1')]=function(_0x5b2e11,_0x22eb27,_0x4d79b3,_0x2724fc,_0x2c862d,_0x31baf1,_0x9a3ae0){return polly(_0x5b2e11,_0x22eb27,_0x4d79b3,_0x2724fc,_0x2c862d,_0x31baf1,_0x9a3ae0);}; \ 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 ba6b60a..196de68 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 _0x7737=['Invalid\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','mp3','path','synthesizeSpeech','AudioStream'];(function(_0x93813a,_0x42999a){var _0x201d7b=function(_0x5492ac){while(--_0x5492ac){_0x93813a['push'](_0x93813a['shift']());}};_0x201d7b(++_0x42999a);}(_0x7737,0x162));var _0x7773=function(_0x5f4cd7,_0x459c44){_0x5f4cd7=_0x5f4cd7-0x0;var _0x47c93f=_0x7737[_0x5f4cd7];return _0x47c93f;};'use strict';var fs=require('fs');var path=require(_0x7773('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var AWS=require('aws-sdk');function pollyResult(_0x5ac6ee,_0x3c6987,_0xfe0fe2){return new BPromise(function(_0x11b372,_0x1fed04){_0x5ac6ee[_0x7773('0x1')](_0x3c6987,function(_0x527a36,_0x1dbba9){if(_0x527a36){_0x1fed04(_0x527a36);}else if(_0x1dbba9){if(_0x1dbba9[_0x7773('0x2')]instanceof Buffer){fs['writeFile'](_0xfe0fe2,_0x1dbba9['AudioStream'],function(_0x4f1855){if(_0x4f1855){_0x1fed04(_0x4f1855);}else{_0x11b372();}});}else{_0x1fed04(new Error(_0x7773('0x3')));}}else{_0x1fed04(new Error('No\x20data\x20response\x20from\x20aws\x20Polly!'));}});});}module[_0x7773('0x4')]=function(_0x4a279e,_0x47674d,_0x24fbdd,_0x148b9c,_0x515f07,_0x4e9fcf,_0x37c209){var _0x2b74ab=new AWS[(_0x7773('0x5'))]({'accessKeyId':_0x4a279e,'secretAccessKey':_0x47674d,'region':_0x24fbdd});var _0x35d857={'Text':_0x515f07,'TextType':_0x4e9fcf||'text','OutputFormat':_0x7773('0x6'),'VoiceId':_0x148b9c};return pollyResult(_0x2b74ab,_0x35d857,_0x37c209);}; \ No newline at end of file +var _0xd365=['AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','mp3','path','bluebird','aws-sdk'];(function(_0x50b651,_0x2ce0c5){var _0x1ec2b0=function(_0x468b6d){while(--_0x468b6d){_0x50b651['push'](_0x50b651['shift']());}};_0x1ec2b0(++_0x2ce0c5);}(_0xd365,0x133));var _0x5d36=function(_0x20137b,_0x45503e){_0x20137b=_0x20137b-0x0;var _0x4eedd7=_0xd365[_0x20137b];return _0x4eedd7;};'use strict';var fs=require('fs');var path=require(_0x5d36('0x0'));var BPromise=require(_0x5d36('0x1'));var rs=require('randomstring');var AWS=require(_0x5d36('0x2'));function pollyResult(_0x3a0bed,_0x194d2f,_0x22b57f){return new BPromise(function(_0x2cc82f,_0x9e795c){_0x3a0bed['synthesizeSpeech'](_0x194d2f,function(_0x3325d4,_0x221b6a){if(_0x3325d4){_0x9e795c(_0x3325d4);}else if(_0x221b6a){if(_0x221b6a[_0x5d36('0x3')]instanceof Buffer){fs[_0x5d36('0x4')](_0x22b57f,_0x221b6a['AudioStream'],function(_0x59a304){if(_0x59a304){_0x9e795c(_0x59a304);}else{_0x2cc82f();}});}else{_0x9e795c(new Error(_0x5d36('0x5')));}}else{_0x9e795c(new Error('No\x20data\x20response\x20from\x20aws\x20Polly!'));}});});}module[_0x5d36('0x6')]=function(_0x259300,_0x2c6951,_0x49f07e,_0x347b0e,_0x14031b,_0x3ed920,_0x367b32){var _0x1ffac7=new AWS[(_0x5d36('0x7'))]({'accessKeyId':_0x259300,'secretAccessKey':_0x2c6951,'region':_0x49f07e});var _0x2aa051={'Text':_0x14031b,'TextType':_0x3ed920||_0x5d36('0x8'),'OutputFormat':_0x5d36('0x9'),'VoiceId':_0x347b0e};return pollyResult(_0x1ffac7,_0x2aa051,_0x367b32);}; \ 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 0089519..76fc23d 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 _0x2ec8=['exports','./lib/api'];(function(_0xaa9c26,_0x207191){var _0x5d4ec9=function(_0x591f86){while(--_0x591f86){_0xaa9c26['push'](_0xaa9c26['shift']());}};_0x5d4ec9(++_0x207191);}(_0x2ec8,0x177));var _0x82ec=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x2ec8[_0x5ddb1c];return _0x354adc;};'use strict';var asr=require(_0x82ec('0x0'));module[_0x82ec('0x1')]=function(_0x45ba4e,_0x1c93a0,_0x495489,_0x2b42ce){return asr(_0x45ba4e,_0x1c93a0,_0x495489);}; \ No newline at end of file +var _0x19fb=['exports'];(function(_0x4a4075,_0x54a036){var _0x577f5c=function(_0x40a799){while(--_0x40a799){_0x4a4075['push'](_0x4a4075['shift']());}};_0x577f5c(++_0x54a036);}(_0x19fb,0x86));var _0xb19f=function(_0xc48fb3,_0x4bbc86){_0xc48fb3=_0xc48fb3-0x0;var _0x30f471=_0x19fb[_0xc48fb3];return _0x30f471;};'use strict';var asr=require('./lib/api');module[_0xb19f('0x0')]=function(_0x4aca8d,_0x438057,_0x18f952,_0x42770a){return asr(_0x4aca8d,_0x438057,_0x18f952);}; \ 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 f24d711..02d7f63 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 _0xbe31=['string','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync','toString','base64','POST','/v1/speech:recognize?key=','LINEAR16','8000','bluebird','https://speech.googleapis.com','exports','length'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0xbe31,0x83));var _0x1be3=function(_0x30dea6,_0x45559f){_0x30dea6=_0x30dea6-0x0;var _0x1a70bd=_0xbe31[_0x30dea6];return _0x1a70bd;};'use strict';var url=require('url');var BPromise=require(_0x1be3('0x0'));var fs=require('fs');var host=_0x1be3('0x1');module[_0x1be3('0x2')]=function(_0x474db2,_0x228047,_0x1bd12d){return new BPromise(function(_0xacfa1e,_0x2c1ddd){var _0x3aacc2;if(typeof _0x474db2!=='string'||_0x474db2[_0x1be3('0x3')]===0x0){return _0x2c1ddd('filepath\x20should\x20be\x20a\x20string');}if(typeof _0x228047!==_0x1be3('0x4')||_0x228047[_0x1be3('0x3')]===0x0){return _0x2c1ddd(_0x1be3('0x5'));}if(typeof _0x1bd12d!==_0x1be3('0x6')&&(typeof _0x1bd12d!==_0x1be3('0x4')||_0x1bd12d[_0x1be3('0x3')]===0x0)){return _0x2c1ddd(_0x1be3('0x7'));}try{_0x3aacc2=fs[_0x1be3('0x8')](_0x474db2)[_0x1be3('0x9')](_0x1be3('0xa'));}catch(_0x548e99){return _0x2c1ddd(_0x548e99);}return _0xacfa1e({'method':_0x1be3('0xb'),'uri':host+_0x1be3('0xc')+_0x228047,'body':{'config':{'encoding':_0x1be3('0xd'),'sampleRateHertz':_0x1be3('0xe'),'languageCode':_0x1bd12d},'audio':{'content':_0x3aacc2}},'json':!![]});});}; \ No newline at end of file +var _0x89c4=['POST','/v1/speech:recognize?key=','LINEAR16','8000','url','bluebird','exports','string','length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','undefined','readFileSync','base64'];(function(_0x1c9bd0,_0x1216d6){var _0x216fa1=function(_0x5cafbd){while(--_0x5cafbd){_0x1c9bd0['push'](_0x1c9bd0['shift']());}};_0x216fa1(++_0x1216d6);}(_0x89c4,0x82));var _0x489c=function(_0x290a9f,_0x457846){_0x290a9f=_0x290a9f-0x0;var _0x14dcb5=_0x89c4[_0x290a9f];return _0x14dcb5;};'use strict';var url=require(_0x489c('0x0'));var BPromise=require(_0x489c('0x1'));var fs=require('fs');var host='https://speech.googleapis.com';module[_0x489c('0x2')]=function(_0x57d86a,_0x4b7f17,_0x165089){return new BPromise(function(_0x35a116,_0xf7eda){var _0x397017;if(typeof _0x57d86a!==_0x489c('0x3')||_0x57d86a[_0x489c('0x4')]===0x0){return _0xf7eda(_0x489c('0x5'));}if(typeof _0x4b7f17!=='string'||_0x4b7f17[_0x489c('0x4')]===0x0){return _0xf7eda(_0x489c('0x6'));}if(typeof _0x165089!==_0x489c('0x7')&&(typeof _0x165089!==_0x489c('0x3')||_0x165089['length']===0x0)){return _0xf7eda('lang\x20should\x20be\x20a\x20string');}try{_0x397017=fs[_0x489c('0x8')](_0x57d86a)['toString'](_0x489c('0x9'));}catch(_0x3cc086){return _0xf7eda(_0x3cc086);}return _0x35a116({'method':_0x489c('0xa'),'uri':host+_0x489c('0xb')+_0x4b7f17,'body':{'config':{'encoding':_0x489c('0xc'),'sampleRateHertz':_0x489c('0xd'),'languageCode':_0x165089},'audio':{'content':_0x397017}},'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 8900592..057326d 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 _0x54a6=['./asr','exports'];(function(_0x22df61,_0x4ae290){var _0x18329f=function(_0x3ec2ee){while(--_0x3ec2ee){_0x22df61['push'](_0x22df61['shift']());}};_0x18329f(++_0x4ae290);}(_0x54a6,0x1bc));var _0x654a=function(_0x381276,_0x3f9d76){_0x381276=_0x381276-0x0;var _0xdadc4=_0x54a6[_0x381276];return _0xdadc4;};var asr=require(_0x654a('0x0'));module[_0x654a('0x1')]={'asr':asr}; \ No newline at end of file +var _0x3eb0=['exports','./asr'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x3eb0,0x1ed));var _0x03eb=function(_0xb4f821,_0x11cb61){_0xb4f821=_0xb4f821-0x0;var _0x38dd91=_0x3eb0[_0xb4f821];return _0x38dd91;};var asr=require(_0x03eb('0x0'));module[_0x03eb('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/scripts/index.js b/server/services/agi/scripts/index.js index b7e3003..7599da3 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 _0x2536=['./google','./sestek','./tilde','../../../config/logger','agi','https:','path','WHAT_EVER','get','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','info','unlink','pipe','end','protocol','data','transcode','wav','error\x20convert','finish\x20to\x20convert','start','resolve','tmp','generate','.wav','writeFileSync','then','chmodSync','777','split','toString','base64','googleCloudTTS','?key=','voice','audioConfig','text:synthesize','POST','from','writeFile','googleCloudTTS\x20path','googleTTS','utf8','f.req=','stringify','jQ1olc','null','generic','slice','length','text\x20length\x20limit\x20reached','\x22\x20might\x20not\x20exist','parse\x20response\x20failed:\x0a','.mp3','goggleTTS\x20path','googleASR','uri','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','message','googleDialogflow','result','source','actionIncomplete','fulfillment','speech','score','status','code','endConversation','metadata','replace','SessionsClient','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','action','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','intent','name','displayName','isFallback','languageCode','queryText','responseId','intentDetectionConfidence','asr','Tilde\x20ASR\x20confidence','awsPolly','awsLex','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','model=%s','freeform=3','sestekNDA','text','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','dirName','apiai-promise','bluebird','http','https','md5','request-promise','randomstring','url','util','./aws'];(function(_0x159c31,_0x245238){var _0x2c10e4=function(_0x1a495a){while(--_0x1a495a){_0x159c31['push'](_0x159c31['shift']());}};_0x2c10e4(++_0x245238);}(_0x2536,0x7c));var _0x6253=function(_0x27fcaa,_0x4d1dca){_0x27fcaa=_0x27fcaa-0x0;var _0x204840=_0x2536[_0x27fcaa];return _0x204840;};'use strict';var apiai=require(_0x6253('0x0'));var BPromise=require(_0x6253('0x1'));var dialogflow=require('dialogflow');var fs=require('fs');var http=require(_0x6253('0x2'));var https=require(_0x6253('0x3'));var md5=require(_0x6253('0x4'));var path=require('path');var querystring=require('querystring');var rp=require(_0x6253('0x5'));var rs=require(_0x6253('0x6'));var sox=require('sox');var tts=require('google-tts-api');var urlParse=require(_0x6253('0x7'))['parse'];var util=require(_0x6253('0x8'));var aws=require(_0x6253('0x9'));var google=require(_0x6253('0xa'));var sestek=require(_0x6253('0xb'));var tilde=require(_0x6253('0xc'));var logger=require(_0x6253('0xd'))(_0x6253('0xe'));var ISPEECH_API='https://api.ispeech.org/api/rest';function downloadFile(_0x574093,_0x40863){return new BPromise(function(_0x10403e,_0x38b82c){var _0xff8c71=urlParse(_0x574093);var _0x5241f1=_0xff8c71['protocol']===_0x6253('0xf')?https:http;var _0x3f3fcb={'host':_0xff8c71['host'],'path':_0xff8c71[_0x6253('0x10')],'headers':{'user-agent':_0x6253('0x11')}};_0x5241f1[_0x6253('0x12')](_0x3f3fcb,function(_0x1492f6){if(_0x1492f6[_0x6253('0x13')]!==0xc8){logger[_0x6253('0x14')](_0x6253('0x15')+_0x574093+_0x6253('0x16')+_0x1492f6[_0x6253('0x13')]+'\x20('+_0x1492f6['statusMessage']+')');_0x38b82c(new Error(_0x6253('0x15')+_0x574093+_0x6253('0x16')+_0x1492f6[_0x6253('0x13')]+'\x20('+_0x1492f6[_0x6253('0x17')]+')'));return;}var _0x2d48b5=fs[_0x6253('0x18')](_0x40863);_0x2d48b5['on'](_0x6253('0x19'),function(){logger[_0x6253('0x1a')]('finish\x20download\x20file');_0x2d48b5['close'](_0x10403e);});_0x2d48b5['on'](_0x6253('0x14'),function(_0x14c98a){fs[_0x6253('0x1b')](_0x40863);logger[_0x6253('0x14')]('download\x20error',_0x14c98a);_0x38b82c(_0x14c98a);});_0x1492f6[_0x6253('0x1c')](_0x2d48b5);})['on']('error',function(_0x1dfc1c){logger[_0x6253('0x14')](_0x1dfc1c);_0x38b82c(_0x1dfc1c);})[_0x6253('0x1d')]();});}function uploadFile(_0x3b5f12){return new BPromise(function(_0x26b27a,_0x51672a){var _0x5b825b=urlParse(_0x3b5f12);var _0x35dd6a=_0x5b825b[_0x6253('0x1e')]===_0x6253('0xf')?https:http;var _0x3e7824={'host':_0x5b825b['host'],'path':_0x5b825b['path'],'headers':{'user-agent':_0x6253('0x11')}};_0x35dd6a['get'](_0x3e7824,function(_0x294efd){if(_0x294efd['statusCode']!==0xc8){_0x51672a(new Error(_0x6253('0x15')+_0x3b5f12+_0x6253('0x16')+_0x294efd[_0x6253('0x13')]+'\x20('+_0x294efd['statusMessage']+')'));return;}var _0x453175='';_0x294efd['on'](_0x6253('0x1f'),function(_0x4bebce){_0x453175+=_0x4bebce;});_0x294efd['on'](_0x6253('0x1d'),function(){_0x26b27a(_0x453175);});})['on'](_0x6253('0x14'),function(_0x2a5bf4){_0x51672a(_0x2a5bf4);})[_0x6253('0x1d')]();});}function convertFile(_0x259714,_0x329101){return new BPromise(function(_0x17f32b,_0x2585de){var _0x4c7fda=sox[_0x6253('0x20')](_0x259714,_0x329101,{'sampleRate':0x1f40,'format':_0x6253('0x21'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x4c7fda['on'](_0x6253('0x14'),function(_0x4fd2dc){logger[_0x6253('0x14')](_0x6253('0x22'),_0x4fd2dc);_0x2585de(_0x4fd2dc);});_0x4c7fda['on'](_0x6253('0x1d'),function(){logger[_0x6253('0x1a')](_0x6253('0x23'));_0x17f32b();});_0x4c7fda[_0x6253('0x24')]();});}function base64Decode(_0x4bc58a,_0x2b2999){var _0x5a2f6b=path[_0x6253('0x25')](__dirname,_0x6253('0x26'),rs[_0x6253('0x27')](0x4)+_0x6253('0x28'));fs[_0x6253('0x29')](_0x5a2f6b,_0x4bc58a,'base64');return convertFile(_0x5a2f6b,_0x2b2999)[_0x6253('0x2a')](function(){try{fs[_0x6253('0x1b')](_0x5a2f6b);fs[_0x6253('0x2b')](_0x2b2999,_0x6253('0x2c'));}catch(_0x10c059){logger[_0x6253('0x14')](_0x10c059);}return _0x2b2999[_0x6253('0x2d')]('.')[0x0];});}function base64Encode(_0x3b300d){var _0x3e5297=fs['readFileSync'](_0x3b300d);return new Buffer(_0x3e5297)[_0x6253('0x2e')](_0x6253('0x2f'));}exports[_0x6253('0x30')]=function(_0x3eb90c,_0x4b3056,_0x56e3ea,_0x327172,_0xa1a1d5,_0x264fc8){var _0x292478,_0x2f8c29;var _0xc69a72='https://texttospeech.googleapis.com/v1/';var _0xdbf8f6=_0x6253('0x31')+_0x3eb90c;var _0x58d4af={};if(_0x4b3056==='ssml'){_0x58d4af['input']={'ssml':_0x56e3ea};}else{_0x58d4af['input']={'text':_0x56e3ea};};_0x58d4af[_0x6253('0x32')]={'languageCode':_0x327172,'ssmlGender':_0xa1a1d5};_0x58d4af[_0x6253('0x33')]={'audioEncoding':'MP3','sampleRateHertz':0x1f40};var _0x57c092={'url':_0xc69a72+_0x6253('0x34')+_0xdbf8f6,'method':_0x6253('0x35'),'json':!![],'body':_0x58d4af};return rp(_0x57c092)[_0x6253('0x2a')](function(_0x331598){return new BPromise(function(_0x2b7958,_0x3a2aca){_0x292478=path['resolve'](__dirname,_0x6253('0x26'),rs[_0x6253('0x27')](0x4)+'.mp3');var _0x2ea3cb=Buffer[_0x6253('0x36')](_0x331598['audioContent'],_0x6253('0x2f'));return fs[_0x6253('0x37')](_0x292478,_0x2ea3cb,function(_0x405916){_0x3a2aca(_0x405916);},function(_0x4db56e){fs[_0x6253('0x2b')](_0x292478,_0x6253('0x2c'));_0x2b7958(_0x4db56e);});});})['then'](function(_0x555424){_0x2f8c29=path['resolve'](__dirname,'tmp',rs[_0x6253('0x27')](0x4)+_0x6253('0x28'));return convertFile(_0x292478,_0x2f8c29);})[_0x6253('0x2a')](function(){try{fs[_0x6253('0x1b')](_0x292478);fs[_0x6253('0x2b')](_0x2f8c29,_0x6253('0x2c'));}catch(_0x440d08){logger[_0x6253('0x14')](_0x440d08);}logger['info'](_0x6253('0x38'),_0x2f8c29[_0x6253('0x2d')]('.')[0x0]);return _0x2f8c29[_0x6253('0x2d')]('.')[0x0];});};exports[_0x6253('0x39')]=function(_0x5d5b94,_0xc7a074){var _0x17d34c='https://translate.google.com/_/TranslateWebserverUi/data/batchexecute';var _0x3acae2,_0x51e7fa;var _0x4f3bdd;var _0x104599={'encoding':_0x6253('0x3a'),'method':_0x6253('0x35'),'timeout':0x2710,'url':_0x17d34c,'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':_0x6253('0x3b')+encodeURIComponent(JSON[_0x6253('0x3c')]([[[_0x6253('0x3d'),JSON[_0x6253('0x3c')]([_0x5d5b94,_0xc7a074||'en',![],_0x6253('0x3e')]),null,_0x6253('0x3f')]]]))};return rp(_0x104599)[_0x6253('0x2a')](function(_0x2420eb){try{_0x4f3bdd=eval(_0x2420eb[_0x6253('0x40')](0x5))[0x0][0x2];}catch(_0x950548){throw new Error('parse\x20response\x20failed:\x0a'+_0x2420eb[_0x6253('0x1f')]);}if(!_0x4f3bdd){if(_0x5d5b94[_0x6253('0x41')]>0xc8){throw new Error(_0x6253('0x42'));}else{throw new Error('lang\x20\x22'+_0xc7a074+_0x6253('0x43'));}}try{_0x4f3bdd=eval(_0x4f3bdd)[0x0];}catch(_0x57f977){throw new Error(_0x6253('0x44')+res['data']);}const _0x305288=_0x4f3bdd;_0x3acae2=path['resolve'](__dirname,_0x6253('0x26'),rs[_0x6253('0x27')](0x4)+_0x6253('0x45'));fs[_0x6253('0x29')](_0x3acae2,_0x4f3bdd,{'encoding':_0x6253('0x2f')});_0x51e7fa=path[_0x6253('0x25')](__dirname,'tmp',rs[_0x6253('0x27')](0x4)+_0x6253('0x28'));return convertFile(_0x3acae2,_0x51e7fa);})[_0x6253('0x2a')](function(){try{fs[_0x6253('0x1b')](_0x3acae2);fs[_0x6253('0x2b')](_0x51e7fa,'777');}catch(_0x15d8b7){logger[_0x6253('0x14')](_0x15d8b7);}logger[_0x6253('0x1a')](_0x6253('0x46'),_0x51e7fa[_0x6253('0x2d')]('.')[0x0]);return _0x51e7fa['split']('.')[0x0];});};exports[_0x6253('0x47')]=function(_0x5e17c6,_0x1e7722,_0x102077){return google['asr'](_0x5e17c6,_0x1e7722,_0x102077)[_0x6253('0x2a')](function(_0x11fd6c){logger[_0x6253('0x1a')](_0x11fd6c[_0x6253('0x48')]);return rp(_0x11fd6c);})['then'](function(_0x4640d8){var _0x31a895='';var _0x16ef35=0x0;try{fs[_0x6253('0x1b')](_0x5e17c6);}catch(_0x56c00f){logger['error'](_0x56c00f);}if(_0x4640d8&&_0x4640d8['results']){_0x31a895=_0x4640d8[_0x6253('0x49')][_0x6253('0x4a')](function(_0x299825){return _0x299825&&_0x299825[_0x6253('0x4b')][0x0]&&_0x299825[_0x6253('0x4b')][0x0][_0x6253('0x4c')]?_0x299825[_0x6253('0x4b')][0x0][_0x6253('0x4c')]:'';})[_0x6253('0x4d')]('\x0a');_0x16ef35=_0x4640d8[_0x6253('0x49')]['map'](function(_0xbbba6){return _0xbbba6&&_0xbbba6['alternatives'][0x0]&&_0xbbba6[_0x6253('0x4b')][0x0][_0x6253('0x4e')]?_0xbbba6['alternatives'][0x0][_0x6253('0x4e')]:0x0;})['join']('\x0a');}logger[_0x6253('0x1a')](_0x6253('0x4f'),_0x31a895);logger[_0x6253('0x1a')](_0x6253('0x50'),_0x16ef35);return{'transcript':_0x31a895,'confidence':_0x16ef35};})[_0x6253('0x51')](function(_0x4007ca){logger[_0x6253('0x14')](_0x6253('0x52'),_0x4007ca['statusCode'],_0x4007ca['name'],_0x4007ca[_0x6253('0x53')]);});};exports[_0x6253('0x54')]=function(_0x52cbc9,_0x4c3f76,_0x25acae,_0x2ccf66){var _0x5f5149=apiai(_0x4c3f76,{'language':_0x2ccf66||'en'});return _0x5f5149['textRequest'](_0x25acae,{'sessionId':md5(_0x52cbc9)})[_0x6253('0x2a')](function(_0x128307){logger[_0x6253('0x1a')](JSON[_0x6253('0x3c')](_0x128307));return{'source':_0x128307[_0x6253('0x55')][_0x6253('0x56')],'resolvedQuery':_0x128307['result']['resolvedQuery'],'action':_0x128307[_0x6253('0x55')]['action'],'actionIncomplete':_0x128307['result'][_0x6253('0x57')],'speech':_0x128307[_0x6253('0x55')][_0x6253('0x58')][_0x6253('0x59')],'score':_0x128307['result'][_0x6253('0x5a')],'statusCode':_0x128307[_0x6253('0x5b')][_0x6253('0x5c')],'endConversation':_0x128307['result']['metadata'][_0x6253('0x5d')]||![],'isFallbackIntent':_0x128307['result'][_0x6253('0x5e')]['isFallbackIntent']};});};exports['googleDialogflowV2']=function(_0x207085,_0x1fda44,_0x451fd3,_0x51fef2,_0x240f9f,_0x24b0af){var _0x208e54=_0x51fef2[_0x6253('0x5f')](/\\n/g,'\x0a');var _0x1f4342={'credentials':{'private_key':_0x208e54,'client_email':_0x451fd3}};var _0x4ba8d2=new dialogflow[(_0x6253('0x60'))](_0x1f4342);var _0x508b55=_0x4ba8d2[_0x6253('0x61')](_0x1fda44,md5(_0x207085));var _0x4c1834={'session':_0x508b55,'queryInput':{'text':{'text':_0x240f9f,'languageCode':_0x24b0af}}};return _0x4ba8d2[_0x6253('0x62')](_0x4c1834)[_0x6253('0x2a')](function(_0x119729){if(_0x119729&&_0x119729[_0x6253('0x41')]){logger[_0x6253('0x1a')](_0x6253('0x63'),JSON[_0x6253('0x3c')](_0x119729));var _0x42441d=_0x119729[0x0];if(_0x42441d){var _0x28225d={'action':_0x42441d['queryResult'][_0x6253('0x64')],'allRequiredParamsPresent':_0x42441d[_0x6253('0x65')][_0x6253('0x66')],'endConversation':_0x42441d['queryResult'][_0x6253('0x67')]&&_0x42441d['queryResult'][_0x6253('0x67')][_0x6253('0x68')]?_0x42441d['queryResult'][_0x6253('0x67')][_0x6253('0x68')][_0x6253('0x69')]['boolValue']:![],'fulfillmentText':_0x42441d[_0x6253('0x65')]['fulfillmentText'],'intentName':_0x42441d[_0x6253('0x65')][_0x6253('0x6a')][_0x6253('0x6b')],'intentDisplayName':_0x42441d[_0x6253('0x65')]['intent'][_0x6253('0x6c')],'isFallbackIntent':_0x42441d[_0x6253('0x65')][_0x6253('0x6a')][_0x6253('0x6d')],'languageCode':_0x42441d[_0x6253('0x65')][_0x6253('0x6e')],'queryText':_0x42441d['queryResult'][_0x6253('0x6f')],'responseId':_0x42441d[_0x6253('0x70')],'score':_0x42441d['queryResult'][_0x6253('0x71')],'speech':_0x42441d[_0x6253('0x65')]['fulfillmentText'],'providerResponse':JSON[_0x6253('0x3c')](_0x119729)};return _0x28225d;}}});};exports['tildeASR']=function(_0x4afae1,_0x195a84,_0x284722,_0x5cf5d4){return tilde[_0x6253('0x72')](_0x4afae1,_0x195a84,_0x284722,_0x5cf5d4)['then'](function(_0x2eef5e){try{fs[_0x6253('0x1b')](_0x4afae1);}catch(_0x5ab302){logger[_0x6253('0x14')](_0x5ab302);}logger[_0x6253('0x1a')]('Tilde\x20ASR\x20transcription',_0x2eef5e['transcript']);logger[_0x6253('0x1a')](_0x6253('0x73'),_0x2eef5e[_0x6253('0x4e')]);return _0x2eef5e;});};exports[_0x6253('0x74')]=function(_0x22f592,_0x460bbc,_0x5474b6,_0x214600,_0xbc8796,_0x25615a){var _0x4fef2f=path['resolve'](__dirname,'tmp',rs[_0x6253('0x27')](0x4)+_0x6253('0x45'));var _0x3fc835;return aws['polly'](_0x22f592,_0x460bbc,_0x5474b6,_0x214600,_0xbc8796,_0x25615a,_0x4fef2f)['then'](function(){_0x3fc835=path[_0x6253('0x25')](__dirname,_0x6253('0x26'),rs['generate'](0x4)+_0x6253('0x28'));return convertFile(_0x4fef2f,_0x3fc835);})['then'](function(){try{fs['unlink'](_0x4fef2f);fs['chmodSync'](_0x3fc835,_0x6253('0x2c'));}catch(_0x4fc68d){logger[_0x6253('0x14')](_0x4fc68d);}return _0x3fc835['split']('.')[0x0];});};exports[_0x6253('0x75')]=function(_0x5b2d4b,_0x14eeb6,_0x3f1eb2,_0x45b4b4,_0x46731c,_0x1951b3){return aws[_0x6253('0x76')](_0x5b2d4b,_0x14eeb6,_0x3f1eb2,_0x45b4b4,_0x46731c,_0x1951b3)[_0x6253('0x2a')](function(_0x306e30){logger['info'](JSON[_0x6253('0x3c')](_0x306e30));return _0x306e30;});};exports[_0x6253('0x77')]=function(_0x39e03d,_0x42f8e8,_0x436d84,_0x4cc595){var _0x259e0=util[_0x6253('0x78')](_0x6253('0x79'),ISPEECH_API,_0x39e03d,encodeURIComponent(_0x42f8e8),_0x436d84,_0x4cc595);var _0x35ce05=path[_0x6253('0x25')](__dirname,_0x6253('0x26'),rs[_0x6253('0x27')](0x4)+_0x6253('0x45'));var _0x4b93d8;return downloadFile(_0x259e0,_0x35ce05)[_0x6253('0x2a')](function(){_0x4b93d8=path[_0x6253('0x25')](__dirname,_0x6253('0x26'),rs[_0x6253('0x27')](0x4)+'.wav');return convertFile(_0x35ce05,_0x4b93d8);})[_0x6253('0x2a')](function(){try{fs[_0x6253('0x1b')](_0x35ce05);fs[_0x6253('0x2b')](_0x4b93d8,_0x6253('0x2c'));}catch(_0x26e21c){logger[_0x6253('0x14')](_0x26e21c);}return _0x4b93d8[_0x6253('0x2d')]('.')[0x0];});};exports[_0x6253('0x7a')]=function(_0x1af2cf,_0x522121,_0x58da55,_0x57b3ea){var _0x514b74=util[_0x6253('0x78')]('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x522121,_0x58da55,base64Encode(_0x1af2cf),_0x57b3ea?util[_0x6253('0x78')](_0x6253('0x7b'),encodeURIComponent(_0x57b3ea)):_0x6253('0x7c'));return uploadFile(_0x514b74)[_0x6253('0x2a')](function(_0x2248e1){return querystring['parse'](_0x2248e1);});};exports[_0x6253('0x7d')]=function(_0x2a9c6f,_0xf63233){return sestek['nda'](_0x2a9c6f,_0xf63233)[_0x6253('0x2a')](function(_0x190358){logger[_0x6253('0x1a')](JSON['stringify'](_0x190358));var _0x20e260={'speech':_0x190358[_0x6253('0x7e')],'action':_0x190358[_0x6253('0x7f')]?_0x190358[_0x6253('0x7f')][_0x6253('0x80')]:undefined,'actiondata':_0x190358[_0x6253('0x7f')]?_0x190358['channelData'][_0x6253('0x81')]:undefined};if(_0x190358[_0x6253('0x7f')]&&_0x190358[_0x6253('0x7f')][_0x6253('0x82')]){return base64Decode(_0x190358[_0x6253('0x7f')][_0x6253('0x82')][_0x6253('0x83')],path['resolve'](__dirname,_0x6253('0x26'),rs[_0x6253('0x27')](0x4)+_0x6253('0x28')))['then'](function(_0x4d0353){_0x20e260[_0x6253('0x84')]=_0x4d0353;return _0x20e260;});}return _0x20e260;});};exports[_0x6253('0x85')]=function(){return __dirname;}; \ No newline at end of file +var _0xabd3=['languageCode','fulfillmentText','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','polly','awsLex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','text','channelData','CustomAction','AudioFromTts','Data','audiofile','apiai-promise','bluebird','http','https','md5','path','querystring','randomstring','google-tts-api','url','parse','util','./aws','./google','../../../config/logger','agi','https://api.ispeech.org/api/rest','https:','host','WHAT_EVER','statusCode','error','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','info','finish\x20download\x20file','close','download\x20error','pipe','end','protocol','data','wav','error\x20convert','finish\x20to\x20convert','tmp','generate','.wav','writeFileSync','unlink','chmodSync','777','split','readFileSync','base64','googleCloudTTS','https://texttospeech.googleapis.com/v1/','ssml','input','voice','audioConfig','MP3','POST','resolve','.mp3','from','audioContent','writeFile','then','googleCloudTTS\x20path','googleTTS','application/x-www-form-urlencoded','stringify','jQ1olc','null','generic','slice','parse\x20response\x20failed:\x0a','length','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','googleASR','asr','results','map','alternatives','transcript','confidence','join','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest','result','resolvedQuery','action','actionIncomplete','fulfillment','score','status','code','metadata','isFallbackIntent','googleDialogflowV2','replace','SessionsClient','sessionPath','detectIntent','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','intent','displayName','isFallback'];(function(_0x4717b8,_0x331c49){var _0x42a536=function(_0x580b33){while(--_0x580b33){_0x4717b8['push'](_0x4717b8['shift']());}};_0x42a536(++_0x331c49);}(_0xabd3,0x98));var _0x3abd=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0xabd3[_0x209941];return _0x1e8729;};'use strict';var apiai=require(_0x3abd('0x0'));var BPromise=require(_0x3abd('0x1'));var dialogflow=require('dialogflow');var fs=require('fs');var http=require(_0x3abd('0x2'));var https=require(_0x3abd('0x3'));var md5=require(_0x3abd('0x4'));var path=require(_0x3abd('0x5'));var querystring=require(_0x3abd('0x6'));var rp=require('request-promise');var rs=require(_0x3abd('0x7'));var sox=require('sox');var tts=require(_0x3abd('0x8'));var urlParse=require(_0x3abd('0x9'))[_0x3abd('0xa')];var util=require(_0x3abd('0xb'));var aws=require(_0x3abd('0xc'));var google=require(_0x3abd('0xd'));var sestek=require('./sestek');var tilde=require('./tilde');var logger=require(_0x3abd('0xe'))(_0x3abd('0xf'));var ISPEECH_API=_0x3abd('0x10');function downloadFile(_0xbdb10e,_0x437bd3){return new BPromise(function(_0x2c6ef2,_0x3520b9){var _0x1e7554=urlParse(_0xbdb10e);var _0x5ded23=_0x1e7554['protocol']===_0x3abd('0x11')?https:http;var _0x23f532={'host':_0x1e7554[_0x3abd('0x12')],'path':_0x1e7554[_0x3abd('0x5')],'headers':{'user-agent':_0x3abd('0x13')}};_0x5ded23['get'](_0x23f532,function(_0x41f300){if(_0x41f300[_0x3abd('0x14')]!==0xc8){logger[_0x3abd('0x15')]('request\x20to\x20'+_0xbdb10e+_0x3abd('0x16')+_0x41f300[_0x3abd('0x14')]+'\x20('+_0x41f300[_0x3abd('0x17')]+')');_0x3520b9(new Error('request\x20to\x20'+_0xbdb10e+'\x20failed,\x20status\x20code\x20=\x20'+_0x41f300[_0x3abd('0x14')]+'\x20('+_0x41f300[_0x3abd('0x17')]+')'));return;}var _0x36150a=fs[_0x3abd('0x18')](_0x437bd3);_0x36150a['on'](_0x3abd('0x19'),function(){logger[_0x3abd('0x1a')](_0x3abd('0x1b'));_0x36150a[_0x3abd('0x1c')](_0x2c6ef2);});_0x36150a['on'](_0x3abd('0x15'),function(_0x4920c4){fs['unlink'](_0x437bd3);logger[_0x3abd('0x15')](_0x3abd('0x1d'),_0x4920c4);_0x3520b9(_0x4920c4);});_0x41f300[_0x3abd('0x1e')](_0x36150a);})['on'](_0x3abd('0x15'),function(_0x211edb){logger['error'](_0x211edb);_0x3520b9(_0x211edb);})[_0x3abd('0x1f')]();});}function uploadFile(_0x45be74){return new BPromise(function(_0x188ff4,_0x1e33d1){var _0x28a638=urlParse(_0x45be74);var _0x5332d9=_0x28a638[_0x3abd('0x20')]===_0x3abd('0x11')?https:http;var _0x36eec8={'host':_0x28a638[_0x3abd('0x12')],'path':_0x28a638[_0x3abd('0x5')],'headers':{'user-agent':_0x3abd('0x13')}};_0x5332d9['get'](_0x36eec8,function(_0x588c1a){if(_0x588c1a['statusCode']!==0xc8){_0x1e33d1(new Error('request\x20to\x20'+_0x45be74+_0x3abd('0x16')+_0x588c1a['statusCode']+'\x20('+_0x588c1a[_0x3abd('0x17')]+')'));return;}var _0x5d9c9d='';_0x588c1a['on'](_0x3abd('0x21'),function(_0x31855b){_0x5d9c9d+=_0x31855b;});_0x588c1a['on'](_0x3abd('0x1f'),function(){_0x188ff4(_0x5d9c9d);});})['on'](_0x3abd('0x15'),function(_0xfa1582){_0x1e33d1(_0xfa1582);})[_0x3abd('0x1f')]();});}function convertFile(_0x2cdbd5,_0x599b60){return new BPromise(function(_0x446a04,_0x108003){var _0x11fd1e=sox['transcode'](_0x2cdbd5,_0x599b60,{'sampleRate':0x1f40,'format':_0x3abd('0x22'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x11fd1e['on'](_0x3abd('0x15'),function(_0x55006a){logger[_0x3abd('0x15')](_0x3abd('0x23'),_0x55006a);_0x108003(_0x55006a);});_0x11fd1e['on'](_0x3abd('0x1f'),function(){logger[_0x3abd('0x1a')](_0x3abd('0x24'));_0x446a04();});_0x11fd1e['start']();});}function base64Decode(_0x4c1b5a,_0x5977b3){var _0x56735=path['resolve'](__dirname,_0x3abd('0x25'),rs[_0x3abd('0x26')](0x4)+_0x3abd('0x27'));fs[_0x3abd('0x28')](_0x56735,_0x4c1b5a,'base64');return convertFile(_0x56735,_0x5977b3)['then'](function(){try{fs[_0x3abd('0x29')](_0x56735);fs[_0x3abd('0x2a')](_0x5977b3,_0x3abd('0x2b'));}catch(_0x182c6f){logger['error'](_0x182c6f);}return _0x5977b3[_0x3abd('0x2c')]('.')[0x0];});}function base64Encode(_0x483c1a){var _0x13ad17=fs[_0x3abd('0x2d')](_0x483c1a);return new Buffer(_0x13ad17)['toString'](_0x3abd('0x2e'));}exports[_0x3abd('0x2f')]=function(_0x1f2133,_0x10550a,_0x5dbd34,_0x150c2a,_0x204a84,_0x29a721){var _0x13727f,_0x183a26;var _0x2e468c=_0x3abd('0x30');var _0x25aeae='?key='+_0x1f2133;var _0x13278a={};if(_0x10550a===_0x3abd('0x31')){_0x13278a[_0x3abd('0x32')]={'ssml':_0x5dbd34};}else{_0x13278a[_0x3abd('0x32')]={'text':_0x5dbd34};};_0x13278a[_0x3abd('0x33')]={'languageCode':_0x150c2a,'ssmlGender':_0x204a84};_0x13278a[_0x3abd('0x34')]={'audioEncoding':_0x3abd('0x35'),'sampleRateHertz':0x1f40};var _0x1dbb96={'url':_0x2e468c+'text:synthesize'+_0x25aeae,'method':_0x3abd('0x36'),'json':!![],'body':_0x13278a};return rp(_0x1dbb96)['then'](function(_0x194464){return new BPromise(function(_0x18f35a,_0x495355){_0x13727f=path[_0x3abd('0x37')](__dirname,_0x3abd('0x25'),rs['generate'](0x4)+_0x3abd('0x38'));var _0x5a7c06=Buffer[_0x3abd('0x39')](_0x194464[_0x3abd('0x3a')],_0x3abd('0x2e'));return fs[_0x3abd('0x3b')](_0x13727f,_0x5a7c06,function(_0x531c7c){_0x495355(_0x531c7c);},function(_0x581e70){fs[_0x3abd('0x2a')](_0x13727f,_0x3abd('0x2b'));_0x18f35a(_0x581e70);});});})[_0x3abd('0x3c')](function(_0x42ac1d){_0x183a26=path['resolve'](__dirname,_0x3abd('0x25'),rs[_0x3abd('0x26')](0x4)+_0x3abd('0x27'));return convertFile(_0x13727f,_0x183a26);})[_0x3abd('0x3c')](function(){try{fs[_0x3abd('0x29')](_0x13727f);fs[_0x3abd('0x2a')](_0x183a26,_0x3abd('0x2b'));}catch(_0x2745f9){logger[_0x3abd('0x15')](_0x2745f9);}logger['info'](_0x3abd('0x3d'),_0x183a26[_0x3abd('0x2c')]('.')[0x0]);return _0x183a26[_0x3abd('0x2c')]('.')[0x0];});};exports[_0x3abd('0x3e')]=function(_0x38d193,_0x4bdba6){var _0x81b379='https://translate.google.com/_/TranslateWebserverUi/data/batchexecute';var _0x359c0c,_0x558c56;var _0x40d75a;var _0x218e26={'encoding':'utf8','method':_0x3abd('0x36'),'timeout':0x2710,'url':_0x81b379,'headers':{'Content-Type':_0x3abd('0x3f')},'body':'f.req='+encodeURIComponent(JSON[_0x3abd('0x40')]([[[_0x3abd('0x41'),JSON[_0x3abd('0x40')]([_0x38d193,_0x4bdba6||'en',![],_0x3abd('0x42')]),null,_0x3abd('0x43')]]]))};return rp(_0x218e26)['then'](function(_0x53440c){try{_0x40d75a=eval(_0x53440c[_0x3abd('0x44')](0x5))[0x0][0x2];}catch(_0x15d7db){throw new Error(_0x3abd('0x45')+_0x53440c['data']);}if(!_0x40d75a){if(_0x38d193[_0x3abd('0x46')]>0xc8){throw new Error(_0x3abd('0x47'));}else{throw new Error(_0x3abd('0x48')+_0x4bdba6+_0x3abd('0x49'));}}try{_0x40d75a=eval(_0x40d75a)[0x0];}catch(_0x5cadf4){throw new Error(_0x3abd('0x45')+res[_0x3abd('0x21')]);}const _0x5898ab=_0x40d75a;_0x359c0c=path['resolve'](__dirname,_0x3abd('0x25'),rs[_0x3abd('0x26')](0x4)+_0x3abd('0x38'));fs[_0x3abd('0x28')](_0x359c0c,_0x40d75a,{'encoding':'base64'});_0x558c56=path[_0x3abd('0x37')](__dirname,_0x3abd('0x25'),rs[_0x3abd('0x26')](0x4)+_0x3abd('0x27'));return convertFile(_0x359c0c,_0x558c56);})[_0x3abd('0x3c')](function(){try{fs[_0x3abd('0x29')](_0x359c0c);fs[_0x3abd('0x2a')](_0x558c56,_0x3abd('0x2b'));}catch(_0x5ac7c8){logger['error'](_0x5ac7c8);}logger[_0x3abd('0x1a')]('goggleTTS\x20path',_0x558c56['split']('.')[0x0]);return _0x558c56['split']('.')[0x0];});};exports[_0x3abd('0x4a')]=function(_0x31f03f,_0x30c11f,_0x10b73a){return google[_0x3abd('0x4b')](_0x31f03f,_0x30c11f,_0x10b73a)[_0x3abd('0x3c')](function(_0xbc3b56){logger[_0x3abd('0x1a')](_0xbc3b56['uri']);return rp(_0xbc3b56);})[_0x3abd('0x3c')](function(_0x37480f){var _0x2aaec8='';var _0x623612=0x0;try{fs[_0x3abd('0x29')](_0x31f03f);}catch(_0x3f9f0f){logger[_0x3abd('0x15')](_0x3f9f0f);}if(_0x37480f&&_0x37480f[_0x3abd('0x4c')]){_0x2aaec8=_0x37480f[_0x3abd('0x4c')][_0x3abd('0x4d')](function(_0x294e9){return _0x294e9&&_0x294e9[_0x3abd('0x4e')][0x0]&&_0x294e9['alternatives'][0x0][_0x3abd('0x4f')]?_0x294e9['alternatives'][0x0]['transcript']:'';})['join']('\x0a');_0x623612=_0x37480f[_0x3abd('0x4c')][_0x3abd('0x4d')](function(_0x4119e1){return _0x4119e1&&_0x4119e1[_0x3abd('0x4e')][0x0]&&_0x4119e1[_0x3abd('0x4e')][0x0][_0x3abd('0x50')]?_0x4119e1[_0x3abd('0x4e')][0x0][_0x3abd('0x50')]:0x0;})[_0x3abd('0x51')]('\x0a');}logger[_0x3abd('0x1a')]('googleASR\x20transcription',_0x2aaec8);logger['info']('googleASR\x20confidence',_0x623612);return{'transcript':_0x2aaec8,'confidence':_0x623612};})['catch'](function(_0xe1c3b1){logger['error'](_0x3abd('0x52'),_0xe1c3b1[_0x3abd('0x14')],_0xe1c3b1[_0x3abd('0x53')],_0xe1c3b1[_0x3abd('0x54')]);});};exports[_0x3abd('0x55')]=function(_0x10e8f0,_0x45b141,_0x1cb8c2,_0x186a94){var _0x437e9c=apiai(_0x45b141,{'language':_0x186a94||'en'});return _0x437e9c[_0x3abd('0x56')](_0x1cb8c2,{'sessionId':md5(_0x10e8f0)})[_0x3abd('0x3c')](function(_0x49e426){logger['info'](JSON[_0x3abd('0x40')](_0x49e426));return{'source':_0x49e426[_0x3abd('0x57')]['source'],'resolvedQuery':_0x49e426[_0x3abd('0x57')][_0x3abd('0x58')],'action':_0x49e426[_0x3abd('0x57')][_0x3abd('0x59')],'actionIncomplete':_0x49e426['result'][_0x3abd('0x5a')],'speech':_0x49e426[_0x3abd('0x57')][_0x3abd('0x5b')]['speech'],'score':_0x49e426[_0x3abd('0x57')][_0x3abd('0x5c')],'statusCode':_0x49e426[_0x3abd('0x5d')][_0x3abd('0x5e')],'endConversation':_0x49e426[_0x3abd('0x57')][_0x3abd('0x5f')]['endConversation']||![],'isFallbackIntent':_0x49e426[_0x3abd('0x57')][_0x3abd('0x5f')][_0x3abd('0x60')]};});};exports[_0x3abd('0x61')]=function(_0x134709,_0x2b9e90,_0x35ea0b,_0x35c394,_0x57b25b,_0x6d9509){var _0x8e3711=_0x35c394[_0x3abd('0x62')](/\\n/g,'\x0a');var _0x2b87b2={'credentials':{'private_key':_0x8e3711,'client_email':_0x35ea0b}};var _0x1dac19=new dialogflow[(_0x3abd('0x63'))](_0x2b87b2);var _0x259472=_0x1dac19[_0x3abd('0x64')](_0x2b9e90,md5(_0x134709));var _0x1fd3e9={'session':_0x259472,'queryInput':{'text':{'text':_0x57b25b,'languageCode':_0x6d9509}}};return _0x1dac19[_0x3abd('0x65')](_0x1fd3e9)[_0x3abd('0x3c')](function(_0x5cf71e){if(_0x5cf71e&&_0x5cf71e[_0x3abd('0x46')]){logger[_0x3abd('0x1a')]('Dialogflow\x20V2\x20response:',JSON[_0x3abd('0x40')](_0x5cf71e));var _0x3f57f8=_0x5cf71e[0x0];if(_0x3f57f8){var _0x23c97c={'action':_0x3f57f8[_0x3abd('0x66')]['action'],'allRequiredParamsPresent':_0x3f57f8[_0x3abd('0x66')][_0x3abd('0x67')],'endConversation':_0x3f57f8[_0x3abd('0x66')][_0x3abd('0x68')]&&_0x3f57f8[_0x3abd('0x66')][_0x3abd('0x68')]['fields']?_0x3f57f8[_0x3abd('0x66')]['diagnosticInfo'][_0x3abd('0x69')][_0x3abd('0x6a')]['boolValue']:![],'fulfillmentText':_0x3f57f8[_0x3abd('0x66')]['fulfillmentText'],'intentName':_0x3f57f8[_0x3abd('0x66')][_0x3abd('0x6b')][_0x3abd('0x53')],'intentDisplayName':_0x3f57f8[_0x3abd('0x66')]['intent'][_0x3abd('0x6c')],'isFallbackIntent':_0x3f57f8['queryResult'][_0x3abd('0x6b')][_0x3abd('0x6d')],'languageCode':_0x3f57f8[_0x3abd('0x66')][_0x3abd('0x6e')],'queryText':_0x3f57f8['queryResult']['queryText'],'responseId':_0x3f57f8['responseId'],'score':_0x3f57f8['queryResult']['intentDetectionConfidence'],'speech':_0x3f57f8[_0x3abd('0x66')][_0x3abd('0x6f')],'providerResponse':JSON[_0x3abd('0x40')](_0x5cf71e)};return _0x23c97c;}}});};exports[_0x3abd('0x70')]=function(_0x4499d6,_0x5cdc8c,_0x32cf00,_0x454fd8){return tilde[_0x3abd('0x4b')](_0x4499d6,_0x5cdc8c,_0x32cf00,_0x454fd8)[_0x3abd('0x3c')](function(_0x17e380){try{fs[_0x3abd('0x29')](_0x4499d6);}catch(_0x1bb418){logger[_0x3abd('0x15')](_0x1bb418);}logger['info'](_0x3abd('0x71'),_0x17e380[_0x3abd('0x4f')]);logger[_0x3abd('0x1a')](_0x3abd('0x72'),_0x17e380[_0x3abd('0x50')]);return _0x17e380;});};exports[_0x3abd('0x73')]=function(_0x435ce3,_0xbfe8cc,_0x197a73,_0x174360,_0x242b3d,_0x1023fb){var _0x4ac47a=path[_0x3abd('0x37')](__dirname,'tmp',rs['generate'](0x4)+_0x3abd('0x38'));var _0x374452;return aws[_0x3abd('0x74')](_0x435ce3,_0xbfe8cc,_0x197a73,_0x174360,_0x242b3d,_0x1023fb,_0x4ac47a)[_0x3abd('0x3c')](function(){_0x374452=path[_0x3abd('0x37')](__dirname,_0x3abd('0x25'),rs[_0x3abd('0x26')](0x4)+'.wav');return convertFile(_0x4ac47a,_0x374452);})[_0x3abd('0x3c')](function(){try{fs[_0x3abd('0x29')](_0x4ac47a);fs[_0x3abd('0x2a')](_0x374452,_0x3abd('0x2b'));}catch(_0x39aff4){logger[_0x3abd('0x15')](_0x39aff4);}return _0x374452[_0x3abd('0x2c')]('.')[0x0];});};exports[_0x3abd('0x75')]=function(_0x5a6f21,_0x29f33b,_0x5d0a38,_0x3997ce,_0x4f4635,_0x24861c){return aws['lex'](_0x5a6f21,_0x29f33b,_0x5d0a38,_0x3997ce,_0x4f4635,_0x24861c)[_0x3abd('0x3c')](function(_0x5ee0f7){logger[_0x3abd('0x1a')](JSON['stringify'](_0x5ee0f7));return _0x5ee0f7;});};exports[_0x3abd('0x76')]=function(_0x11db9a,_0x440a2d,_0x4994a4,_0x5080dc){var _0x226b73=util[_0x3abd('0x77')](_0x3abd('0x78'),ISPEECH_API,_0x11db9a,encodeURIComponent(_0x440a2d),_0x4994a4,_0x5080dc);var _0xd9cb5=path['resolve'](__dirname,_0x3abd('0x25'),rs[_0x3abd('0x26')](0x4)+_0x3abd('0x38'));var _0x32892e;return downloadFile(_0x226b73,_0xd9cb5)[_0x3abd('0x3c')](function(){_0x32892e=path['resolve'](__dirname,_0x3abd('0x25'),rs[_0x3abd('0x26')](0x4)+'.wav');return convertFile(_0xd9cb5,_0x32892e);})[_0x3abd('0x3c')](function(){try{fs[_0x3abd('0x29')](_0xd9cb5);fs[_0x3abd('0x2a')](_0x32892e,_0x3abd('0x2b'));}catch(_0x1f993e){logger[_0x3abd('0x15')](_0x1f993e);}return _0x32892e[_0x3abd('0x2c')]('.')[0x0];});};exports[_0x3abd('0x79')]=function(_0x4d443b,_0x3da053,_0x1a337e,_0x1697ff){var _0x579c4f=util['format'](_0x3abd('0x7a'),ISPEECH_API,_0x3da053,_0x1a337e,base64Encode(_0x4d443b),_0x1697ff?util[_0x3abd('0x77')](_0x3abd('0x7b'),encodeURIComponent(_0x1697ff)):_0x3abd('0x7c'));return uploadFile(_0x579c4f)[_0x3abd('0x3c')](function(_0x484355){return querystring['parse'](_0x484355);});};exports['sestekNDA']=function(_0x3a1d3d,_0x52e084){return sestek['nda'](_0x3a1d3d,_0x52e084)[_0x3abd('0x3c')](function(_0x4d2f05){logger[_0x3abd('0x1a')](JSON[_0x3abd('0x40')](_0x4d2f05));var _0x4dafa3={'speech':_0x4d2f05[_0x3abd('0x7d')],'action':_0x4d2f05[_0x3abd('0x7e')]?_0x4d2f05[_0x3abd('0x7e')][_0x3abd('0x7f')]:undefined,'actiondata':_0x4d2f05[_0x3abd('0x7e')]?_0x4d2f05[_0x3abd('0x7e')]['CustomActionData']:undefined};if(_0x4d2f05['channelData']&&_0x4d2f05['channelData'][_0x3abd('0x80')]){return base64Decode(_0x4d2f05[_0x3abd('0x7e')][_0x3abd('0x80')][_0x3abd('0x81')],path[_0x3abd('0x37')](__dirname,_0x3abd('0x25'),rs[_0x3abd('0x26')](0x4)+'.wav'))[_0x3abd('0x3c')](function(_0x5ab315){_0x4dafa3[_0x3abd('0x82')]=_0x5ab315;return _0x4dafa3;});}return _0x4dafa3;});};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 a65e033..107b12d 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 _0x15bb=['./nda'];(function(_0x2a9d17,_0x27fa70){var _0x39bafb=function(_0x2fd563){while(--_0x2fd563){_0x2a9d17['push'](_0x2a9d17['shift']());}};_0x39bafb(++_0x27fa70);}(_0x15bb,0x140));var _0xb15b=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x15bb[_0x1035c1];return _0x308d67;};var nda=require(_0xb15b('0x0'));module['exports']={'nda':nda}; \ No newline at end of file +var _0x22d6=['./nda','exports'];(function(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0x22d6,0xc6));var _0x622d=function(_0x469a2d,_0x53bcbe){_0x469a2d=_0x469a2d-0x0;var _0x148147=_0x22d6[_0x469a2d];return _0x148147;};var nda=require(_0x622d('0x0'));module[_0x622d('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 0886c5e..1006bd4 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 _0xd9dc=['Bearer\x20','project','body','channelData','AudioOutputSettings','custom_action','CustomAction','custom_action_data','CustomActionData','info','stringify','url','../../../../../config/logger','exports','POST','resolve','ndauth_url','/token','password','then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','uniqueid','callerid','calleridname','extension'];(function(_0x1973cd,_0x21d1b3){var _0x38f926=function(_0x1f3fd4){while(--_0x1f3fd4){_0x1973cd['push'](_0x1973cd['shift']());}};_0x38f926(++_0x21d1b3);}(_0xd9dc,0x1be));var _0xcd9d=function(_0x15f5e4,_0x5b6b4c){_0x15f5e4=_0x15f5e4-0x0;var _0x4830e5=_0xd9dc[_0x15f5e4];return _0x4830e5;};'use strict';var rp=require('request-promise');var url=require(_0xcd9d('0x0'));var logger=require(_0xcd9d('0x1'))('agi');module[_0xcd9d('0x2')]=function(_0x21af9a,_0x8b7ba5){var _0x521588={'method':_0xcd9d('0x3'),'uri':url[_0xcd9d('0x4')](_0x8b7ba5[_0xcd9d('0x5')],_0xcd9d('0x6')),'form':{'grant_type':_0xcd9d('0x7'),'username':_0x8b7ba5['username'],'password':_0x8b7ba5[_0xcd9d('0x7')]},'json':!![]};return rp(_0x521588)[_0xcd9d('0x8')](function(_0x1d8770){var _0x285e75={'method':_0xcd9d('0x3'),'uri':url['resolve'](_0x8b7ba5[_0xcd9d('0x9')],_0xcd9d('0xa')),'body':{'type':_0x8b7ba5[_0xcd9d('0xb')]||_0xcd9d('0xc'),'channelId':_0xcd9d('0xd'),'conversation':{'id':_0x21af9a[_0xcd9d('0xe')]},'from':{'id':_0x21af9a[_0xcd9d('0xf')],'name':_0x21af9a[_0xcd9d('0x10')]},'recipient':{'id':_0x21af9a['dnid'],'name':_0x21af9a[_0xcd9d('0x11')]},'text':_0x8b7ba5['text'],'channelData':{}},'headers':{'Authorization':_0xcd9d('0x12')+_0x1d8770['access_token']},'json':!![]};if(_0x8b7ba5[_0xcd9d('0x13')]){_0x285e75[_0xcd9d('0x14')][_0xcd9d('0x15')]['ProjectName']=_0x8b7ba5[_0xcd9d('0x13')];}if(_0x8b7ba5['ndagenerate_audio']=='1'){_0x285e75[_0xcd9d('0x14')][_0xcd9d('0x15')][_0xcd9d('0x16')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':'audio/wav'};}if(_0x8b7ba5[_0xcd9d('0x17')]){_0x285e75[_0xcd9d('0x14')]['channelData'][_0xcd9d('0x18')]=_0x8b7ba5['custom_action'];if(_0x8b7ba5[_0xcd9d('0x19')]){_0x285e75['body'][_0xcd9d('0x15')][_0xcd9d('0x1a')]=_0x8b7ba5[_0xcd9d('0x19')];}}logger[_0xcd9d('0x1b')](JSON[_0xcd9d('0x1c')](_0x285e75));return rp(_0x285e75);});}; \ No newline at end of file +var _0x6d2e=['POST','/token','password','username','then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','message','Nda','callerid','calleridname','dnid','extension','Bearer\x20','access_token','body','channelData','project','ndagenerate_audio','AudioOutputSettings','audio/wav','custom_action','CustomAction','custom_action_data','CustomActionData','info','stringify','url','../../../../../config/logger','agi','exports'];(function(_0x12aaee,_0x5bf50c){var _0x37c350=function(_0x182775){while(--_0x182775){_0x12aaee['push'](_0x12aaee['shift']());}};_0x37c350(++_0x5bf50c);}(_0x6d2e,0x97));var _0xe6d2=function(_0x52c8e8,_0x5ee20d){_0x52c8e8=_0x52c8e8-0x0;var _0x31bb1a=_0x6d2e[_0x52c8e8];return _0x31bb1a;};'use strict';var rp=require('request-promise');var url=require(_0xe6d2('0x0'));var logger=require(_0xe6d2('0x1'))(_0xe6d2('0x2'));module[_0xe6d2('0x3')]=function(_0x412889,_0xf81df7){var _0x4dbf04={'method':_0xe6d2('0x4'),'uri':url['resolve'](_0xf81df7['ndauth_url'],_0xe6d2('0x5')),'form':{'grant_type':_0xe6d2('0x6'),'username':_0xf81df7[_0xe6d2('0x7')],'password':_0xf81df7['password']},'json':!![]};return rp(_0x4dbf04)[_0xe6d2('0x8')](function(_0x53906e){var _0x2e227e={'method':_0xe6d2('0x4'),'uri':url['resolve'](_0xf81df7[_0xe6d2('0x9')],_0xe6d2('0xa')),'body':{'type':_0xf81df7['ndaactivity_type']||_0xe6d2('0xb'),'channelId':_0xe6d2('0xc'),'conversation':{'id':_0x412889['uniqueid']},'from':{'id':_0x412889[_0xe6d2('0xd')],'name':_0x412889[_0xe6d2('0xe')]},'recipient':{'id':_0x412889[_0xe6d2('0xf')],'name':_0x412889[_0xe6d2('0x10')]},'text':_0xf81df7['text'],'channelData':{}},'headers':{'Authorization':_0xe6d2('0x11')+_0x53906e[_0xe6d2('0x12')]},'json':!![]};if(_0xf81df7['project']){_0x2e227e[_0xe6d2('0x13')][_0xe6d2('0x14')]['ProjectName']=_0xf81df7[_0xe6d2('0x15')];}if(_0xf81df7[_0xe6d2('0x16')]=='1'){_0x2e227e[_0xe6d2('0x13')][_0xe6d2('0x14')][_0xe6d2('0x17')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xe6d2('0x18')};}if(_0xf81df7[_0xe6d2('0x19')]){_0x2e227e[_0xe6d2('0x13')][_0xe6d2('0x14')][_0xe6d2('0x1a')]=_0xf81df7[_0xe6d2('0x19')];if(_0xf81df7[_0xe6d2('0x1b')]){_0x2e227e[_0xe6d2('0x13')][_0xe6d2('0x14')][_0xe6d2('0x1c')]=_0xf81df7['custom_action_data'];}}logger[_0xe6d2('0x1d')](JSON[_0xe6d2('0x1e')](_0x2e227e));return rp(_0x2e227e);});}; \ 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 fabb257..f892914 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 _0x7dc5=['exports','./lib/api'];(function(_0x4744de,_0x1790bd){var _0x3fb120=function(_0xcb8bd8){while(--_0xcb8bd8){_0x4744de['push'](_0x4744de['shift']());}};_0x3fb120(++_0x1790bd);}(_0x7dc5,0x179));var _0x57dc=function(_0x1188a8,_0xc1498d){_0x1188a8=_0x1188a8-0x0;var _0x50c1c1=_0x7dc5[_0x1188a8];return _0x50c1c1;};'use strict';var asr=require(_0x57dc('0x0'));module[_0x57dc('0x1')]=function(_0x2f91a4,_0x30c7d8,_0x450355,_0x3e7875){return asr(_0x2f91a4,_0x30c7d8,_0x450355,_0x3e7875);}; \ No newline at end of file +var _0xbe8b=['./lib/api','exports'];(function(_0x216e5a,_0x24cd58){var _0xd7ca2f=function(_0x14ae4e){while(--_0x14ae4e){_0x216e5a['push'](_0x216e5a['shift']());}};_0xd7ca2f(++_0x24cd58);}(_0xbe8b,0x128));var _0xbbe8=function(_0xff76c7,_0x25228d){_0xff76c7=_0xff76c7-0x0;var _0x16ef62=_0xbe8b[_0xff76c7];return _0x16ef62;};'use strict';var asr=require(_0xbbe8('0x0'));module[_0xbbe8('0x1')]=function(_0x1efc5f,_0x17ef21,_0x21c8e8,_0x588d85){return asr(_0x1efc5f,_0x17ef21,_0x21c8e8,_0x588d85);}; \ 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 fb58fc9..be34d70 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 _0x003f=['open','message','bluebird','lodash','crypto','../../../../../../config/logger','agi','exports','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','sha1','update','digest','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','createReadStream','close','EOS','error','Tilde\x20ASR\x20send\x20error','terminate','result','final','info','hypotheses','transcript','likelihood','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Error\x20Tilde\x20ASR\x20socket','isObject'];(function(_0x31ced5,_0x5d5415){var _0x10d9e5=function(_0x2e51a5){while(--_0x2e51a5){_0x31ced5['push'](_0x31ced5['shift']());}};_0x10d9e5(++_0x5d5415);}(_0x003f,0x9a));var _0xf003=function(_0x4a00fc,_0x477312){_0x4a00fc=_0x4a00fc-0x0;var _0x58e756=_0x003f[_0x4a00fc];return _0x58e756;};'use strict';var BPromise=require(_0xf003('0x0'));var _=require(_0xf003('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require('moment');var crypto=require(_0xf003('0x2'));var logger=require(_0xf003('0x3'))(_0xf003('0x4'));module[_0xf003('0x5')]=function(_0x3e9ea9,_0xe7133b,_0x1caf6b,_0x36ff4f){return new BPromise(function(_0x289604,_0x2f70ed){logger['info'](_0xf003('0x6'),_0x36ff4f||_0xf003('0x7'));var _0x51d6c7=new WebSocket(_0x36ff4f||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE',{'perMessageDeflate':![]});var _0x22c338='';var _0x457d98='0';var _0x2e6d22='1';var _0xe1e0a9=_0xf003('0x8');function _0x5f0f90(_0x56f4b4){var _0x3ba913=crypto['createHash'](_0xf003('0x9'));_0x3ba913[_0xf003('0xa')](_0x56f4b4);return _0x3ba913[_0xf003('0xb')]('hex');}function _0x3ec177(){try{logger['info'](_0xf003('0xc'));var _0x2fa9fa=moment()[_0xf003('0xd')]();var _0x426479=_0x5f0f90(_0x2fa9fa+_0xe7133b+_0x1caf6b);_0x51d6c7[_0xf003('0xe')](JSON[_0xf003('0xf')]({'appID':_0xe7133b,'timestamp':_0x2fa9fa,'appKey':_0x426479}));var _0x4809d0=fs[_0xf003('0x10')](_0x3e9ea9);_0x4809d0['on']('data',function(_0x31783d){_0x51d6c7[_0xf003('0xe')](_0x31783d);});_0x4809d0['on'](_0xf003('0x11'),function(){_0x51d6c7[_0xf003('0xe')](_0xf003('0x12'));});}catch(_0x55a638){logger[_0xf003('0x13')](_0xf003('0x14'),JSON[_0xf003('0xf')](_0x55a638));_0x51d6c7[_0xf003('0x15')]();}}function _0x8f7e37(_0x67b9d1){try{if(_0x67b9d1){var _0x38c6f1=JSON['parse'](_0x67b9d1);switch(_0x38c6f1['status']){case 0x0:if(_0x38c6f1['result']){if(_0x38c6f1[_0xf003('0x16')][_0xf003('0x17')]){logger[_0xf003('0x18')]('Tilde\x20ASR\x20hypoteses',JSON[_0xf003('0xf')](_0x38c6f1[_0xf003('0x16')][_0xf003('0x19')]));_0x22c338=_0x38c6f1['result'][_0xf003('0x19')][0x0][_0xf003('0x1a')];_0x457d98=_0x38c6f1['result'][_0xf003('0x19')][0x0][_0xf003('0x1b')];_0x2e6d22='0';_0xe1e0a9=_0xf003('0x1c');_0x51d6c7[_0xf003('0x15')]();}}break;case 0x1:logger[_0xf003('0x18')](_0xf003('0x8'));_0x2e6d22='1';_0xe1e0a9=_0xf003('0x8');break;case 0x2:logger[_0xf003('0x18')](_0xf003('0x1d'));_0x2e6d22='2';_0xe1e0a9='Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.';break;case 0x9:logger[_0xf003('0x18')](_0xf003('0x1e'));_0x2e6d22='9';_0xe1e0a9=_0xf003('0x1e');break;case 0xa:logger['info']('Authentication\x20failed.');_0x2e6d22='10';_0xe1e0a9=_0xf003('0x1f');break;case 0xb:logger[_0xf003('0x18')]('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x2e6d22='11';_0xe1e0a9=_0xf003('0x20');}}}catch(_0x1be9ae){logger[_0xf003('0x13')](_0xf003('0x21'),JSON[_0xf003('0xf')](_0x1be9ae));_0x51d6c7[_0xf003('0x15')]();}}function _0x5ca60d(){logger[_0xf003('0x18')]('Close\x20Tilde\x20ASR\x20socket');_0x289604({'transcript':_0x22c338,'confidence':_0x457d98,'status':_0x2e6d22,'status_message':_0xe1e0a9});}function _0x4cc1b6(_0x3d38f9){logger[_0xf003('0x13')](_0xf003('0x22'));if(!_['isNil'](_0x3d38f9)){logger[_0xf003('0x13')](_[_0xf003('0x23')](_0x3d38f9)?JSON['stringify'](_0x3d38f9):_0x3d38f9);}}_0x51d6c7['on'](_0xf003('0x24'),_0x3ec177);_0x51d6c7['on'](_0xf003('0x25'),_0x8f7e37);_0x51d6c7['on'](_0xf003('0x11'),_0x5ca60d);_0x51d6c7['on'](_0xf003('0x13'),_0x4cc1b6);});}; \ No newline at end of file +var _0x29bb=['Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isObject','open','message','bluebird','lodash','moment','crypto','../../../../../../config/logger','agi','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','update','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','data','close','EOS','error','Tilde\x20ASR\x20send\x20error','terminate','parse','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','transcript'];(function(_0x1c66d8,_0x16d85d){var _0xf1cc0a=function(_0x2d8ff4){while(--_0x2d8ff4){_0x1c66d8['push'](_0x1c66d8['shift']());}};_0xf1cc0a(++_0x16d85d);}(_0x29bb,0x89));var _0xb29b=function(_0x57ff51,_0x3059b2){_0x57ff51=_0x57ff51-0x0;var _0x379a36=_0x29bb[_0x57ff51];return _0x379a36;};'use strict';var BPromise=require(_0xb29b('0x0'));var _=require(_0xb29b('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xb29b('0x2'));var crypto=require(_0xb29b('0x3'));var logger=require(_0xb29b('0x4'))(_0xb29b('0x5'));module[_0xb29b('0x6')]=function(_0x34ca48,_0x411b83,_0x3db863,_0xb68641){return new BPromise(function(_0xc6c3f3,_0x2baf8f){logger[_0xb29b('0x7')](_0xb29b('0x8'),_0xb68641||_0xb29b('0x9'));var _0x1ad5bb=new WebSocket(_0xb68641||_0xb29b('0x9'),{'perMessageDeflate':![]});var _0x37ae92='';var _0x576c83='0';var _0x490118='1';var _0xa059d2=_0xb29b('0xa');function _0x37404a(_0x447435){var _0x3e28a2=crypto[_0xb29b('0xb')](_0xb29b('0xc'));_0x3e28a2[_0xb29b('0xd')](_0x447435);return _0x3e28a2['digest']('hex');}function _0x159241(){try{logger[_0xb29b('0x7')](_0xb29b('0xe'));var _0x3fc188=moment()[_0xb29b('0xf')]();var _0x1d2479=_0x37404a(_0x3fc188+_0x411b83+_0x3db863);_0x1ad5bb[_0xb29b('0x10')](JSON[_0xb29b('0x11')]({'appID':_0x411b83,'timestamp':_0x3fc188,'appKey':_0x1d2479}));var _0x458457=fs['createReadStream'](_0x34ca48);_0x458457['on'](_0xb29b('0x12'),function(_0x2d1c66){_0x1ad5bb['send'](_0x2d1c66);});_0x458457['on'](_0xb29b('0x13'),function(){_0x1ad5bb[_0xb29b('0x10')](_0xb29b('0x14'));});}catch(_0x94c352){logger[_0xb29b('0x15')](_0xb29b('0x16'),JSON[_0xb29b('0x11')](_0x94c352));_0x1ad5bb[_0xb29b('0x17')]();}}function _0x2c9ae0(_0x11868f){try{if(_0x11868f){var _0x32102f=JSON[_0xb29b('0x18')](_0x11868f);switch(_0x32102f[_0xb29b('0x19')]){case 0x0:if(_0x32102f[_0xb29b('0x1a')]){if(_0x32102f[_0xb29b('0x1a')][_0xb29b('0x1b')]){logger[_0xb29b('0x7')](_0xb29b('0x1c'),JSON[_0xb29b('0x11')](_0x32102f[_0xb29b('0x1a')]['hypotheses']));_0x37ae92=_0x32102f[_0xb29b('0x1a')][_0xb29b('0x1d')][0x0][_0xb29b('0x1e')];_0x576c83=_0x32102f['result']['hypotheses'][0x0]['likelihood'];_0x490118='0';_0xa059d2=_0xb29b('0x1f');_0x1ad5bb['terminate']();}}break;case 0x1:logger[_0xb29b('0x7')](_0xb29b('0xa'));_0x490118='1';_0xa059d2=_0xb29b('0xa');break;case 0x2:logger[_0xb29b('0x7')](_0xb29b('0x20'));_0x490118='2';_0xa059d2='Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.';break;case 0x9:logger[_0xb29b('0x7')](_0xb29b('0x21'));_0x490118='9';_0xa059d2=_0xb29b('0x21');break;case 0xa:logger[_0xb29b('0x7')](_0xb29b('0x22'));_0x490118='10';_0xa059d2=_0xb29b('0x22');break;case 0xb:logger['info'](_0xb29b('0x23'));_0x490118='11';_0xa059d2=_0xb29b('0x23');}}}catch(_0x7dc9ee){logger[_0xb29b('0x15')](_0xb29b('0x24'),JSON[_0xb29b('0x11')](_0x7dc9ee));_0x1ad5bb[_0xb29b('0x17')]();}}function _0x2ae98d(){logger['info'](_0xb29b('0x25'));_0xc6c3f3({'transcript':_0x37ae92,'confidence':_0x576c83,'status':_0x490118,'status_message':_0xa059d2});}function _0x471b53(_0x5a8ad1){logger[_0xb29b('0x15')](_0xb29b('0x26'));if(!_['isNil'](_0x5a8ad1)){logger[_0xb29b('0x15')](_[_0xb29b('0x27')](_0x5a8ad1)?JSON['stringify'](_0x5a8ad1):_0x5a8ad1);}}_0x1ad5bb['on'](_0xb29b('0x28'),_0x159241);_0x1ad5bb['on'](_0xb29b('0x29'),_0x2c9ae0);_0x1ad5bb['on'](_0xb29b('0x13'),_0x2ae98d);_0x1ad5bb['on'](_0xb29b('0x15'),_0x471b53);});}; \ 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 d57b397..5f84813 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 _0x4856=['./asr','exports'];(function(_0x4f4bb8,_0x32e15d){var _0xf6e91f=function(_0x2d1fd6){while(--_0x2d1fd6){_0x4f4bb8['push'](_0x4f4bb8['shift']());}};_0xf6e91f(++_0x32e15d);}(_0x4856,0x12c));var _0x6485=function(_0x2a7210,_0x2f3d23){_0x2a7210=_0x2a7210-0x0;var _0x460766=_0x4856[_0x2a7210];return _0x460766;};var asr=require(_0x6485('0x0'));module[_0x6485('0x1')]={'asr':asr}; \ No newline at end of file +var _0x14fc=['./asr','exports'];(function(_0x11d796,_0x1069a9){var _0x322bb8=function(_0x5c6730){while(--_0x5c6730){_0x11d796['push'](_0x11d796['shift']());}};_0x322bb8(++_0x1069a9);}(_0x14fc,0x170));var _0xc14f=function(_0x20acdb,_0x210c8e){_0x20acdb=_0x20acdb-0x0;var _0x383b0d=_0x14fc[_0x20acdb];return _0x383b0d;};var asr=require(_0xc14f('0x0'));module[_0xc14f('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index fe8ae04..86177a0 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 _0x30ac=['call','emit','error','E_AGI_ARGUMENT_PORT','createServer','listen','listening','destroy','E_AGI_SERVER_MAXCONNECTION','ready','connection','E_AGI_SERVER_ERROR','code','E_AGI_SERVER_CLOSE','nextTick','inherits','exports','util','net','events','EventEmitter','./error','./channel','127.0.0.1'];(function(_0x13b6fc,_0x539ca2){var _0x5079aa=function(_0x45158f){while(--_0x45158f){_0x13b6fc['push'](_0x13b6fc['shift']());}};_0x5079aa(++_0x539ca2);}(_0x30ac,0x191));var _0xc30a=function(_0x55e1d1,_0x3c9376){_0x55e1d1=_0x55e1d1-0x0;var _0x1165db=_0x30ac[_0x55e1d1];return _0x1165db;};'use strict';var util=require(_0xc30a('0x0'));var net=require(_0xc30a('0x1'));var EventEmitter=require(_0xc30a('0x2'))[_0xc30a('0x3')];var AGIError=require(_0xc30a('0x4'));var AGIChannel=require(_0xc30a('0x5'));var AGIServer=function(_0x1226d6,_0x1f845a,_0x174af7){var _0x8c45a=this,_0x1226d6=_0x1226d6||0x11dd,_0x1f845a=_0x1f845a||_0xc30a('0x6'),_0x59e5e3=null,_0x52ffa4=0x0;EventEmitter[_0xc30a('0x7')](_0x8c45a);function _0x24f1cf(){if(!_0x1226d6){_0x8c45a[_0xc30a('0x8')](_0xc30a('0x9'),new AGIError(_0xc30a('0xa')));return![];}_0x59e5e3=net[_0xc30a('0xb')]();_0x59e5e3[_0xc30a('0xc')](_0x1226d6,_0x1f845a);_0x59e5e3['on'](_0xc30a('0xd'),function(){_0x8c45a[_0xc30a('0x8')]('listening');});_0x59e5e3['on']('connection',function(_0x4f3cc3){_0x59e5e3['getConnections'](function(_0x44a162,_0x49dd66){if(_0x44a162){_0x8c45a[_0xc30a('0x8')](_0xc30a('0x9'),new AGIError('E_AGI_SERVER_ERROR',_0x44a162));}else if(_0x174af7&&_0x174af7<0x0){_0x8c45a['emit']('error',new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0x4f3cc3[_0xc30a('0xe')]();}else if(_0x174af7&&_0x174af7>0x0&&_0x174af7<_0x49dd66){_0x52ffa4+=0x1;_0x8c45a['emit'](_0xc30a('0x9'),new AGIError(_0xc30a('0xf'),_0x52ffa4));_0x4f3cc3['destroy']();}else{var _0x5b7c8b=new AGIChannel(_0x4f3cc3);_0x5b7c8b['on'](_0xc30a('0x10'),function(){_0x8c45a[_0xc30a('0x8')](_0xc30a('0x11'),_0x5b7c8b);});}});});_0x59e5e3['on'](_0xc30a('0x9'),function(_0xdf1b78){_0x8c45a['emit'](_0xc30a('0x9'),new AGIError(_0xc30a('0x12'),_0xdf1b78[_0xc30a('0x13')]));});_0x59e5e3['on']('close',function(){_0x8c45a['emit']('close',new AGIError(_0xc30a('0x14')));});}process[_0xc30a('0x15')](function(){_0x24f1cf();});};util[_0xc30a('0x16')](AGIServer,EventEmitter);module[_0xc30a('0x17')]=function(_0x5ce147,_0x3bbfa7,_0x21e4b2){return new AGIServer(_0x5ce147,_0x3bbfa7,_0x21e4b2);}; \ No newline at end of file +var _0xc3e8=['getConnections','emit','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','E_AGI_SERVER_MAXCONNECTION','destroy','ready','close','E_AGI_SERVER_CLOSE','exports','util','net','EventEmitter','./channel','call','error','E_AGI_ARGUMENT_PORT','createServer','listen','listening','connection'];(function(_0x2cdd7d,_0x234261){var _0x101071=function(_0x3e7ee3){while(--_0x3e7ee3){_0x2cdd7d['push'](_0x2cdd7d['shift']());}};_0x101071(++_0x234261);}(_0xc3e8,0x1c3));var _0x8c3e=function(_0x482cce,_0x2fd9ce){_0x482cce=_0x482cce-0x0;var _0x162a9d=_0xc3e8[_0x482cce];return _0x162a9d;};'use strict';var util=require(_0x8c3e('0x0'));var net=require(_0x8c3e('0x1'));var EventEmitter=require('events')[_0x8c3e('0x2')];var AGIError=require('./error');var AGIChannel=require(_0x8c3e('0x3'));var AGIServer=function(_0x2db95a,_0x5d051d,_0x1c721d){var _0x4f4eaa=this,_0x2db95a=_0x2db95a||0x11dd,_0x5d051d=_0x5d051d||'127.0.0.1',_0x46e6ae=null,_0x24926f=0x0;EventEmitter[_0x8c3e('0x4')](_0x4f4eaa);function _0x5d1357(){if(!_0x2db95a){_0x4f4eaa['emit'](_0x8c3e('0x5'),new AGIError(_0x8c3e('0x6')));return![];}_0x46e6ae=net[_0x8c3e('0x7')]();_0x46e6ae[_0x8c3e('0x8')](_0x2db95a,_0x5d051d);_0x46e6ae['on']('listening',function(){_0x4f4eaa['emit'](_0x8c3e('0x9'));});_0x46e6ae['on'](_0x8c3e('0xa'),function(_0x24f13a){_0x46e6ae[_0x8c3e('0xb')](function(_0x1b9583,_0x1c6986){if(_0x1b9583){_0x4f4eaa[_0x8c3e('0xc')](_0x8c3e('0x5'),new AGIError(_0x8c3e('0xd'),_0x1b9583));}else if(_0x1c721d&&_0x1c721d<0x0){_0x4f4eaa[_0x8c3e('0xc')](_0x8c3e('0x5'),new AGIError(_0x8c3e('0xe')));_0x24f13a['destroy']();}else if(_0x1c721d&&_0x1c721d>0x0&&_0x1c721d<_0x1c6986){_0x24926f+=0x1;_0x4f4eaa[_0x8c3e('0xc')](_0x8c3e('0x5'),new AGIError(_0x8c3e('0xf'),_0x24926f));_0x24f13a[_0x8c3e('0x10')]();}else{var _0x549bdc=new AGIChannel(_0x24f13a);_0x549bdc['on'](_0x8c3e('0x11'),function(){_0x4f4eaa[_0x8c3e('0xc')]('connection',_0x549bdc);});}});});_0x46e6ae['on'](_0x8c3e('0x5'),function(_0x551575){_0x4f4eaa['emit'](_0x8c3e('0x5'),new AGIError('E_AGI_SERVER_ERROR',_0x551575['code']));});_0x46e6ae['on'](_0x8c3e('0x12'),function(){_0x4f4eaa['emit'](_0x8c3e('0x12'),new AGIError(_0x8c3e('0x13')));});}process['nextTick'](function(){_0x5d1357();});};util['inherits'](AGIServer,EventEmitter);module[_0x8c3e('0x14')]=function(_0x3afa03,_0x4f3c92,_0x32fbcd){return new AGIServer(_0x3afa03,_0x4f3c92,_0x32fbcd);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index 4ed95e4..04bdef6 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 _0x6aa1=['getVariableById','then','name','catch','getVoiceQueue','getVoiceQueueById','getSquareProject','getSquareProjectById','getSquareOdbc','getSquareOdbcById','dsn','getUser','getUserById','getSoundById','getSoundPath','getMailAccount','getMailAccountById','sendMailMessage','getIntervalById','IntervalId','map','Intervals','interval','format','%s/sounds/converted/%s','getQueryOdbc','error','Error\x20getting\x20ODBC\x20connection\x20%s','query','Error\x20executing\x20query\x20%s','info','Query\x20executed\x20correctly\x20%s','close','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','agicommand','arg_1','callerid','createSquareRecording','uniqueid','calleridname','context','priority','dnid','file','createSquareMessage','createCmContact','isEmpty','isNil','callback_','random','lastName','phone','list_id','callback','Callback\x20scheduled\x20at\x20','scheduledAt','toString','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','agentLogin','internal','%s/%s@from-sip/n','LOCAL','trim','replace','googleCloudTTS','apiKey','text','languageCode','en-US','ssmlGender','MALE','audioEncoding','MP3','googleTTS','restAPI','url','method','number','timeout','includes','POST','body','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','render','headers','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','dialogflow_language','dialogflowV2_project_id','client_email','private_key','sestekNDA','ispeechTTS','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_secret_access_key','aws_polly_voice','Amy','aws_text_type','awsLex','aws_bot_name','googleASR','key','google_asr_language','tildeASR','appid','clone','hasOwnProperty','isString','replaceAllVariables','recursiveNodeIndex','isPlainObject','isArray','length','saveRestApiResult','%s.%s','setVariable','replaceObjectAllVariables','split','replaceAll','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','extra','maxRetry','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','label','noop','no\x20text\x20configured','exec','MRCPSynth','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','minutes','callback_priority','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','Executed\x20command\x20MRCPSynth\x20%s','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','RECOG_CONFIDENCE()','LUMENVOX_ASR_INSTANCE','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','variable_id','no\x20variable\x20found','forEach','keys','%s_ROWS_COUNT','dial','debug','sip_id','DIAL','SIP/%s','opts','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','DIALOGFLOW_%s','toUpperCase','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','no\x20client_email\x20configured','no\x20private_key\x20configured','dialogflowV2_language','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','googleDialogflowV2','providerResponse','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20username\x20configured','password','no\x20password\x20configured','Trying\x20SestekNDA:\x20%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','.wav','SestekNDA\x20Result\x20%s','end','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','getTrunk','trunk_name','finally','getdigits','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','getSound','no\x20file\x20audio\x20found','no\x20variable\x20selected\x20for\x20the\x20result','getData','response','maxdigit','mindigit','hiddendigitsnum','generate','first','substr','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','unlink','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','beep','recordFile','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','appsecret','no\x20appsecret\x20configured','intKey','tilde\x20%s\x20file\x20created','gotoc','continueAt','extension','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','false','gotoiftime','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','NOBEEP','ispeech\x20%s\x20file\x20created','IspeechASR\x20Result\x20%s','ispeechtts','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','Enter\x20in\x20MATH\x20(%s)\x20block','operation','math\x20%s','%s[%s]','Enter\x20in\x20MENU\x20(%s)\x20block','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','Enter\x20in\x20PAUSE\x20(%s)\x20block','FIND\x20AGENT\x20%s\x20BY\x20%s','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','gosub','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','%s/recordings/%s','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','no\x20url\x20configured','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','statusMessage','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','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','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','Enter\x20in\x20SENDSMS\x20(%s)\x20block','no\x20sms\x20account\x20configured','sms_account_id','no\x20sms\x20account\x20found','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','variable_value','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Answer','Skipped\x20Answer','subproject','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','127.0.0.1','system','shellCommand','command','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','no\x20variable\x20selected','join','exports','lodash','shelljs','odbc','randomstring','moment','request-promise','../../config/logger','agi','../../config/environment','./scripts','/var/opt/motion2/server/files','rawHeaders','rawBody','menu','channel','rpc','mailRpc','prototype','getVariable'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x6aa1,0x1b5));var _0x16aa=function(_0xef0b6b,_0x3fda41){_0xef0b6b=_0xef0b6b-0x0;var _0x32d020=_0x6aa1[_0xef0b6b];return _0x32d020;};'use strict';var fs=require('fs');var path=require('path');var util=require('util');var _=require(_0x16aa('0x0'));var sh=require(_0x16aa('0x1'));var odbc=require(_0x16aa('0x2'))();var rs=require(_0x16aa('0x3'));var moment=require(_0x16aa('0x4'));var Mustache=require('mustache');var rp=require(_0x16aa('0x5'));var logger=require(_0x16aa('0x6'))(_0x16aa('0x7'));var config=require(_0x16aa('0x8'));var scripts=require(_0x16aa('0x9'));var FILES_PATH=_0x16aa('0xa');var recursiveMapAttributes=[_0x16aa('0xb'),_0x16aa('0xc')];var verticesWithRetry=[_0x16aa('0xd'),'getdigits','getsecretdigits'];var AGIVertices=function(_0x4003fd,_0x4f90ce,_0x29658f){this[_0x16aa('0xe')]=_0x4003fd;this[_0x16aa('0xf')]=_0x4f90ce;this[_0x16aa('0x10')]=_0x29658f;};AGIVertices[_0x16aa('0x11')][_0x16aa('0x12')]=function(_0x37c4f4,_0x49d13a){this[_0x16aa('0xf')][_0x16aa('0x13')](_0x37c4f4)[_0x16aa('0x14')](function(_0x16ef79){_0x49d13a(null,_0x16ef79?_0x16ef79[_0x16aa('0x15')]:![]);})[_0x16aa('0x16')](function(_0x4e56b1){_0x49d13a(_0x4e56b1);});};AGIVertices['prototype'][_0x16aa('0x17')]=function(_0x760422,_0x50f9bd){this[_0x16aa('0xf')][_0x16aa('0x18')](_0x760422)[_0x16aa('0x14')](function(_0x10affb){_0x50f9bd(null,_0x10affb?_0x10affb['name']:![]);})[_0x16aa('0x16')](function(_0x58dd9a){_0x50f9bd(_0x58dd9a);});};AGIVertices['prototype'][_0x16aa('0x19')]=function(_0x42f25a,_0x2df462){this[_0x16aa('0xf')][_0x16aa('0x1a')](_0x42f25a)[_0x16aa('0x14')](function(_0x358d53){_0x2df462(null,_0x358d53?_0x358d53[_0x16aa('0x15')]:![]);})[_0x16aa('0x16')](function(_0x262432){_0x2df462(_0x262432);});};AGIVertices[_0x16aa('0x11')][_0x16aa('0x1b')]=function(_0x2be220,_0xb509fa){this['rpc'][_0x16aa('0x1c')](_0x2be220)[_0x16aa('0x14')](function(_0x90e5a7){_0xb509fa(null,_0x90e5a7?_0x90e5a7[_0x16aa('0x1d')]:![]);})[_0x16aa('0x16')](function(_0x33c2d4){_0xb509fa(_0x33c2d4);});};AGIVertices['prototype'][_0x16aa('0x1e')]=function(_0x24b71c,_0x4f5eba){this[_0x16aa('0xf')][_0x16aa('0x1f')](_0x24b71c)[_0x16aa('0x14')](function(_0x41dcfc){_0x4f5eba(null,_0x41dcfc?_0x41dcfc[_0x16aa('0x15')]:![]);})[_0x16aa('0x16')](function(_0x21482c){_0x4f5eba(_0x21482c);});};AGIVertices[_0x16aa('0x11')]['getTrunk']=function(_0x379f59,_0x283931){this['rpc']['getTrunkById'](_0x379f59)[_0x16aa('0x14')](function(_0x47a0f4){_0x283931(null,_0x47a0f4?_0x47a0f4[_0x16aa('0x15')]:![]);})[_0x16aa('0x16')](function(_0x1d121b){_0x283931(_0x1d121b);});};AGIVertices['prototype']['getSound']=function(_0x447548,_0x377137){var _0xd80f7f=this;this[_0x16aa('0xf')][_0x16aa('0x20')](_0x447548)[_0x16aa('0x14')](function(_0x295605){_0x377137(null,_0x295605?_0xd80f7f[_0x16aa('0x21')](_0x295605['save_name']):![]);})[_0x16aa('0x16')](function(_0x1da0d7){_0x377137(_0x1da0d7);});};AGIVertices[_0x16aa('0x11')][_0x16aa('0x22')]=function(_0x296b40,_0x61ecae){this[_0x16aa('0xf')][_0x16aa('0x23')](_0x296b40)[_0x16aa('0x14')](function(_0x736806){_0x61ecae(null,_0x736806?_0x736806:![]);})[_0x16aa('0x16')](function(_0x4f944f){_0x61ecae(_0x4f944f);});};AGIVertices[_0x16aa('0x11')][_0x16aa('0x24')]=function(_0x3192de,_0x1329e4,_0xa98818){this[_0x16aa('0x10')][_0x16aa('0x24')](_0x3192de,_0x1329e4)['then'](function(){_0xa98818(null);})[_0x16aa('0x16')](function(_0x42d8f1){_0xa98818(_0x42d8f1);});};AGIVertices[_0x16aa('0x11')]['getIntervals']=function(_0x57e224,_0x55cb68){this[_0x16aa('0xf')][_0x16aa('0x25')](_0x57e224)[_0x16aa('0x14')](function(_0x160a26){if(_0x160a26){if(_0x160a26[_0x16aa('0x26')]){_0x55cb68(null,[_0x160a26['interval']]);}else{_0x55cb68(null,_[_0x16aa('0x27')](_0x160a26[_0x16aa('0x28')],_0x16aa('0x29')));}}else{_0x55cb68(null,![]);}})[_0x16aa('0x16')](function(_0x4b8302){_0x55cb68(_0x4b8302);});};AGIVertices[_0x16aa('0x11')]['getSoundPath']=function(_0x35ac3f){return util[_0x16aa('0x2a')](_0x16aa('0x2b'),FILES_PATH,_0x35ac3f);};AGIVertices[_0x16aa('0x11')][_0x16aa('0x2c')]=function(_0x56cc9c,_0x84853b,_0x3484ca){odbc['open'](_0x56cc9c,function(_0x297bad){if(_0x297bad){logger[_0x16aa('0x2d')](_0x16aa('0x2e'),_0x297bad);_0x3484ca(_0x297bad);}else{logger['info']('ODBC\x20connection\x20successfully');odbc[_0x16aa('0x2f')](_0x84853b,function(_0x27859,_0x473002){if(_0x27859){logger['info'](_0x16aa('0x30'),_0x84853b);_0x3484ca(_0x27859);}else{logger[_0x16aa('0x31')](_0x16aa('0x32'),_0x84853b);odbc[_0x16aa('0x33')](function(_0x1de1d3){if(_0x1de1d3){logger['error']('Error\x20closing\x20connection\x20to\x20odbc\x20%s',_0x1de1d3);}_0x3484ca(null,_0x473002);});}});}});};AGIVertices[_0x16aa('0x11')][_0x16aa('0x34')]=function(_0x554afa,_0x38d123){this['rpc'][_0x16aa('0x35')](_0x554afa)[_0x16aa('0x14')](function(_0x5866f5){_0x38d123(null,_0x5866f5?_0x5866f5:![]);})[_0x16aa('0x16')](function(_0x3a6e92){_0x38d123(_0x3a6e92);});};AGIVertices['prototype'][_0x16aa('0x36')]=function(_0x4db57d,_0x1c210b){this[_0x16aa('0xf')][_0x16aa('0x36')](_0x4db57d)[_0x16aa('0x14')](function(_0x23df88){_0x1c210b(null,_0x23df88);})['catch'](function(_0x2cc068){_0x1c210b(_0x2cc068);});};AGIVertices[_0x16aa('0x11')][_0x16aa('0x37')]=function(_0x1b0c05,_0x388697,_0x31abe2){this['rpc'][_0x16aa('0x37')]({'uniqueid':this[_0x16aa('0xe')]['uniqueid'],'node':_0x1b0c05['label'],'application':_0x1b0c05[_0x16aa('0x38')],'data':_0x388697||null,'project_name':this[_0x16aa('0xe')][_0x16aa('0x39')],'callerid':this['channel'][_0x16aa('0x3a')]})[_0x16aa('0x14')](function(_0x4a2cc3){if(_0x31abe2){_0x31abe2(null,_0x4a2cc3);}})[_0x16aa('0x16')](function(_0x42eff4){if(_0x31abe2){_0x31abe2(_0x42eff4);}});};AGIVertices[_0x16aa('0x11')]['createSquareRecording']=function(_0x4ebae4,_0x5264bf,_0x2bd4cf,_0x4e0a51){this['rpc'][_0x16aa('0x3b')]({'uniqueid':this[_0x16aa('0xe')][_0x16aa('0x3c')],'callerid':this['channel'][_0x16aa('0x3a')],'calleridname':this['channel'][_0x16aa('0x3d')],'context':this[_0x16aa('0xe')][_0x16aa('0x3e')],'extension':this[_0x16aa('0xe')]['extension'],'priority':this[_0x16aa('0xe')][_0x16aa('0x3f')],'accountcode':this[_0x16aa('0xe')]['accountcode'],'dnid':this[_0x16aa('0xe')][_0x16aa('0x40')],'projectName':this[_0x16aa('0xe')]['arg_1'],'saveName':_0x5264bf,'filename':_0x4ebae4[_0x16aa('0x41')]||_0x5264bf,'savePath':_0x2bd4cf})[_0x16aa('0x14')](function(_0x22625c){_0x4e0a51(null,_0x22625c);})[_0x16aa('0x16')](function(_0x21e7a8){_0x4e0a51(_0x21e7a8);});};AGIVertices[_0x16aa('0x11')][_0x16aa('0x42')]=function(_0x556b1c,_0x530eae,_0x82a2c3,_0x3f0a2a,_0x415bd9){this['rpc'][_0x16aa('0x42')]({'uniqueid':this[_0x16aa('0xe')][_0x16aa('0x3c')],'body':_0x556b1c,'direction':_0x530eae,'providerName':_0x82a2c3,'providerResponse':_0x3f0a2a})[_0x16aa('0x14')](function(_0x2232a9){if(_0x415bd9){_0x415bd9(null,_0x2232a9);}})['catch'](function(_0x1fbee9){if(_0x415bd9){_0x415bd9(_0x1fbee9);}});};AGIVertices['prototype'][_0x16aa('0x43')]=function(_0x178b4e,_0x13791d){this[_0x16aa('0xf')][_0x16aa('0x43')]({'firstName':_[_0x16aa('0x44')](_0x178b4e[_0x16aa('0x15')])||_[_0x16aa('0x45')](_0x178b4e['name'])?_0x16aa('0x46')+Math[_0x16aa('0x47')]():_0x178b4e[_0x16aa('0x15')],'lastName':_[_0x16aa('0x44')](_0x178b4e[_0x16aa('0x48')])||_[_0x16aa('0x45')](_0x178b4e['lastName'])?null:_0x178b4e['lastName'],'phone':_0x178b4e[_0x16aa('0x49')],'ListId':_0x178b4e[_0x16aa('0x4a')],'scheduledat':_0x178b4e['scheduledAt'],'callbackUniqueid':this[_0x16aa('0xe')]['uniqueid'],'tags':_0x16aa('0x4b'),'description':_0x16aa('0x4c')+_0x178b4e[_0x16aa('0x4d')][_0x16aa('0x4e')](),'priority':_0x178b4e['callback_priority']})[_0x16aa('0x14')](function(_0x240390){_0x13791d(null,_0x240390);})[_0x16aa('0x16')](function(_0x1eab03){_0x13791d(_0x1eab03);});};AGIVertices['prototype'][_0x16aa('0x4f')]=function(_0x5f311e,_0x4158f8){this[_0x16aa('0xf')][_0x16aa('0x50')](_0x5f311e)[_0x16aa('0x14')](function(_0x366b99){_0x4158f8(null,_0x366b99?_0x366b99['name']:![]);})[_0x16aa('0x16')](function(_0x58bf07){_0x4158f8(_0x58bf07);});};AGIVertices['prototype'][_0x16aa('0x51')]=function(_0x5bbe4a,_0xaef44a,_0x2d8726){var _0x26fb4f={'role':_0x16aa('0x52')};_0x26fb4f[_0x5bbe4a]=this[_0x16aa('0xe')]['callerid'];this['rpc'][_0x16aa('0x51')](_0x26fb4f,_0xaef44a,this[_0x16aa('0xe')][_0x16aa('0x3c')])[_0x16aa('0x14')](function(_0x5bf947){_0x2d8726(null,_[_0x16aa('0x45')](_0x5bf947)?![]:!![]);})[_0x16aa('0x16')](function(_0x47cdb6){logger['error'](_0x47cdb6);_0x2d8726(null,![]);});};AGIVertices[_0x16aa('0x11')]['agentUnpause']=function(_0x673a6c,_0x392637){var _0x54bff0={'role':_0x16aa('0x52')};_0x54bff0[_0x673a6c]=this['channel'][_0x16aa('0x3a')];this[_0x16aa('0xf')][_0x16aa('0x53')](_0x54bff0)[_0x16aa('0x14')](function(_0x3aef45){_0x392637(null,_[_0x16aa('0x45')](_0x3aef45)?![]:!![]);})[_0x16aa('0x16')](function(_0x572ab1){logger[_0x16aa('0x2d')](_0x572ab1);_0x392637(null,![]);});};AGIVertices[_0x16aa('0x11')][_0x16aa('0x54')]=function(_0x14a159,_0x4557b6){var _0x2eae7d={'role':_0x16aa('0x52')};_0x2eae7d[_0x14a159]=this['channel'][_0x16aa('0x3a')];this['rpc'][_0x16aa('0x54')](_0x2eae7d)[_0x16aa('0x14')](function(_0x3e2bfa){_0x4557b6(null,_[_0x16aa('0x45')](_0x3e2bfa)?![]:!![]);})[_0x16aa('0x16')](function(_0x3a9ba6){logger[_0x16aa('0x2d')](_0x3a9ba6);_0x4557b6(null,![]);});};AGIVertices[_0x16aa('0x11')][_0x16aa('0x55')]=function(_0x993ef8,_0x491762){var _0x48b06a={'role':_0x16aa('0x52')};_0x48b06a[_0x993ef8]=this[_0x16aa('0xe')][_0x16aa('0x3a')];var _0xf2d122=_0x993ef8!=_0x16aa('0x56')?util[_0x16aa('0x2a')](_0x16aa('0x57'),_0x16aa('0x58'),this[_0x16aa('0xe')]['callerid']):undefined;this[_0x16aa('0xf')][_0x16aa('0x55')](_0x48b06a,_0xf2d122)[_0x16aa('0x14')](function(_0x24a1b8){_0x491762(null,_[_0x16aa('0x45')](_0x24a1b8)?![]:!![]);})['catch'](function(_0x3905d8){logger[_0x16aa('0x2d')](_0x3905d8);_0x491762(null,![]);});};AGIVertices['prototype']['shellCommand']=function(_0x40a99b,_0x18f70d){sh['exec'](_[_0x16aa('0x59')](_0x40a99b),function(_0x26c95e,_0x734763){var _0x1846d7=_0x734763[_0x16aa('0x5a')](/(\r\n|\n|\r)/gm,'');_0x18f70d(null,_0x1846d7);});};AGIVertices[_0x16aa('0x11')]['googleCloudTTS']=function(_0x596035,_0x1934b8){scripts[_0x16aa('0x5b')](_0x596035[_0x16aa('0x5c')],_0x596035['google_cloud_tts_text_type']||_0x16aa('0x5d'),_0x596035[_0x16aa('0x5d')],_0x596035[_0x16aa('0x5e')]||_0x16aa('0x5f'),_0x596035[_0x16aa('0x60')]||_0x16aa('0x61'),_0x596035[_0x16aa('0x62')]||_0x16aa('0x63'))[_0x16aa('0x14')](function(_0x2a3f3a){_0x1934b8(null,_0x2a3f3a);})[_0x16aa('0x16')](function(_0x1c30b4){_0x1934b8(_0x1c30b4);});};AGIVertices['prototype'][_0x16aa('0x64')]=function(_0x44cc30,_0x2d54e4){scripts['googleTTS'](_0x44cc30['text'],_0x44cc30['google_tts_language']||'en',0x1)[_0x16aa('0x14')](function(_0x14749a){_0x2d54e4(null,_0x14749a);})[_0x16aa('0x16')](function(_0x58b967){_0x2d54e4(_0x58b967);});};AGIVertices['prototype'][_0x16aa('0x65')]=function(_0x3e3234,_0x236d8d){var _0x294863={'uri':_0x3e3234[_0x16aa('0x66')],'method':_0x3e3234[_0x16aa('0x67')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x3e3234['timeout'])===_0x16aa('0x68')&&parseInt(_0x3e3234[_0x16aa('0x69')])>=0x1?parseInt(_0x3e3234['timeout'])*0x3e8:0x5*0x3e8};if(_[_0x16aa('0x6a')]([_0x16aa('0x6b'),'PUT'],_0x294863[_0x16aa('0x67')]['toUpperCase']())){try{_0x294863[_0x16aa('0x6c')]=_0x3e3234['rawBody']?JSON[_0x16aa('0x6d')](_0x3e3234[_0x16aa('0xc')]):{};}catch(_0x1585cb){logger[_0x16aa('0x2d')](_0x16aa('0x6e'),_0x1585cb);}}try{_0x294863['headers']=_0x3e3234['rawHeaders']?JSON[_0x16aa('0x6d')](_0x3e3234['rawHeaders']):{};}catch(_0x1258b1){logger[_0x16aa('0x2d')](_0x16aa('0x6f'),_0x1258b1);}if(_0x3e3234[_0x16aa('0x70')]){try{var _0x36473e=require(_0x3e3234['computedVariables'])[_0x16aa('0x71')](this,_0x294863);_0x294863['uri']=Mustache[_0x16aa('0x72')](_0x3e3234[_0x16aa('0x66')],_0x36473e,{},['$$','$$']);if(_0x294863[_0x16aa('0x73')]){_0x294863[_0x16aa('0x73')]=JSON['parse'](Mustache[_0x16aa('0x72')](JSON[_0x16aa('0x74')](_0x294863[_0x16aa('0x73')]),_0x36473e,{},['$$','$$']));}if(_0x294863[_0x16aa('0x6c')]){_0x294863[_0x16aa('0x6c')]=JSON['parse'](Mustache[_0x16aa('0x72')](JSON[_0x16aa('0x74')](_0x294863['body']),_0x36473e,{},['$$','$$']));}}catch(_0x270d6d){logger[_0x16aa('0x2d')](_0x16aa('0x75'),_0x270d6d);}}rp(_0x294863)[_0x16aa('0x14')](function(_0x53acba){var _0x285f43={'statusCode':_0x53acba[_0x16aa('0x76')]||0xc8,'statusMessage':_0x53acba['statusMessage']||'OK','headers':_0x53acba['headers']||{},'body':_0x53acba[_0x16aa('0x6c')]||{}};_0x236d8d(null,_0x285f43);})[_0x16aa('0x16')](function(_0x3ee127){var _0x2f8d0d={'statusCode':_0x3ee127[_0x16aa('0x76')]||0x1f4,'statusMessage':_0x3ee127[_0x16aa('0x77')]||_0x16aa('0x78'),'headers':_0x3ee127[_0x16aa('0x79')]['headers']||{},'body':_0x3ee127['options']['body']||{}};_0x236d8d(null,_0x2f8d0d);});};AGIVertices[_0x16aa('0x11')][_0x16aa('0x7a')]=function(_0x1c1ff9,_0x192fc0){scripts[_0x16aa('0x7a')](this[_0x16aa('0xe')][_0x16aa('0x3c')],_0x1c1ff9['key'],_0x1c1ff9[_0x16aa('0x5d')],_0x1c1ff9[_0x16aa('0x7b')]||'en')[_0x16aa('0x14')](function(_0x37fb92){_0x192fc0(null,_0x37fb92);})[_0x16aa('0x16')](function(_0x541a13){_0x192fc0(_0x541a13);});};AGIVertices[_0x16aa('0x11')]['googleDialogflowV2']=function(_0x21007b,_0x3ffbdb){scripts['googleDialogflowV2'](this[_0x16aa('0xe')][_0x16aa('0x3c')],_0x21007b[_0x16aa('0x7c')],_0x21007b[_0x16aa('0x7d')],_0x21007b[_0x16aa('0x7e')],_0x21007b[_0x16aa('0x5d')],_0x21007b['dialogflowV2_language']||'en')[_0x16aa('0x14')](function(_0x5d3b47){_0x3ffbdb(null,_0x5d3b47);})['catch'](function(_0xccadab){_0x3ffbdb(_0xccadab);});};AGIVertices[_0x16aa('0x11')][_0x16aa('0x7f')]=function(_0x3cf14b,_0x3adbcf){scripts[_0x16aa('0x7f')](this[_0x16aa('0xe')],_0x3cf14b)[_0x16aa('0x14')](function(_0xb7ddd0){_0x3adbcf(null,_0xb7ddd0);})['catch'](function(_0x36d6d0){_0x3adbcf(_0x36d6d0);});};AGIVertices[_0x16aa('0x11')][_0x16aa('0x80')]=function(_0x56e5af,_0x476329){scripts['ispeechTTS'](_0x56e5af['key'],_0x56e5af[_0x16aa('0x5d')],_0x56e5af[_0x16aa('0x81')]||_0x16aa('0x5f'),_0x56e5af[_0x16aa('0x82')])['then'](function(_0x2b7ddc){_0x476329(null,_0x2b7ddc);})['catch'](function(_0x41686c){_0x476329(_0x41686c);});};AGIVertices[_0x16aa('0x11')][_0x16aa('0x83')]=function(_0x5a4c83,_0x57edf1,_0x18f844){scripts['ispeechASR'](_0x57edf1,_0x5a4c83['key'],_0x5a4c83[_0x16aa('0x84')]||_0x16aa('0x5f'),this[_0x16aa('0x85')](_0x5a4c83[_0x16aa('0x86')])?_0x5a4c83[_0x16aa('0x86')]:undefined)[_0x16aa('0x14')](function(_0x151e7e){_0x18f844(null,_0x151e7e);})[_0x16aa('0x16')](function(_0x1157fe){_0x18f844(_0x1157fe);});};AGIVertices[_0x16aa('0x11')][_0x16aa('0x87')]=function(_0x19587d,_0xccee32){scripts['awsPolly'](_0x19587d['aws_access_key_id'],_0x19587d[_0x16aa('0x88')],_0x19587d['aws_polly_region'],_0x19587d[_0x16aa('0x89')]||_0x16aa('0x8a'),_0x19587d[_0x16aa('0x5d')],_0x19587d[_0x16aa('0x8b')]||_0x16aa('0x5d'))[_0x16aa('0x14')](function(_0x280cae){_0xccee32(null,_0x280cae);})[_0x16aa('0x16')](function(_0x207de1){_0xccee32(_0x207de1);});};AGIVertices[_0x16aa('0x11')][_0x16aa('0x8c')]=function(_0x2a7893,_0x2539c0){scripts[_0x16aa('0x8c')](this[_0x16aa('0xe')][_0x16aa('0x3c')],_0x2a7893['aws_access_key_id'],_0x2a7893['aws_secret_access_key'],_0x2a7893['aws_lex_region'],_0x2a7893[_0x16aa('0x5d')],_0x2a7893[_0x16aa('0x8d')])['then'](function(_0x4c5363){_0x2539c0(null,_0x4c5363);})[_0x16aa('0x16')](function(_0x157b17){_0x2539c0(_0x157b17);});};AGIVertices['prototype'][_0x16aa('0x8e')]=function(_0x23db92,_0x59291a,_0x570465){scripts[_0x16aa('0x8e')](_0x59291a,_0x23db92[_0x16aa('0x8f')],_0x23db92[_0x16aa('0x90')]||'en-US')[_0x16aa('0x14')](function(_0x3afd75){_0x570465(null,_0x3afd75);})['catch'](function(_0x44b109){_0x570465(_0x44b109);});};AGIVertices[_0x16aa('0x11')]['tildeASR']=function(_0x4a2382,_0x32b531,_0x55edc1){scripts[_0x16aa('0x91')](_0x32b531,_0x4a2382[_0x16aa('0x92')],_0x4a2382['appsecret'],_0x4a2382['uri'])[_0x16aa('0x14')](function(_0x5bf008){_0x55edc1(null,_0x5bf008);})[_0x16aa('0x16')](function(_0xe36d0c){_0x55edc1(_0xe36d0c);});};AGIVertices[_0x16aa('0x11')]['clear']=function(_0x40db63){var _0x1b97cf=_[_0x16aa('0x6a')](verticesWithRetry,_0x40db63['agicommand'])?_0x40db63:_[_0x16aa('0x93')](_0x40db63);for(var _0x4d9de1 in _0x1b97cf){if(_0x1b97cf[_0x16aa('0x94')](_0x4d9de1)){if(_0x1b97cf[_0x4d9de1]&&_[_0x16aa('0x95')](_0x1b97cf[_0x4d9de1])){if(_[_0x16aa('0x6a')](recursiveMapAttributes,_0x4d9de1)){_0x1b97cf[_0x4d9de1]=this['replaceObjectAllVariables'](_0x1b97cf[_0x4d9de1]);}else{_0x1b97cf[_0x4d9de1]=this[_0x16aa('0x96')](_0x1b97cf[_0x4d9de1]);}}}}return _0x1b97cf;};AGIVertices[_0x16aa('0x11')][_0x16aa('0x97')]=function(_0x4e8b9c){for(var _0x14c7ac in _0x4e8b9c){if(_0x4e8b9c[_0x16aa('0x94')](_0x14c7ac)){if(_[_0x16aa('0x98')](_0x4e8b9c[_0x14c7ac])){this[_0x16aa('0x97')](_0x4e8b9c[_0x14c7ac]);}else if(_[_0x16aa('0x99')](_0x4e8b9c[_0x14c7ac])){for(var _0x178e6d=0x0;_0x178e6d<_0x4e8b9c[_0x14c7ac][_0x16aa('0x9a')];_0x178e6d++){this[_0x16aa('0x97')](_0x4e8b9c[_0x14c7ac][_0x178e6d]);}}else if(_[_0x16aa('0x95')](_0x4e8b9c[_0x14c7ac])){_0x4e8b9c[_0x14c7ac]=this[_0x16aa('0x96')](_0x4e8b9c[_0x14c7ac]);}}}};AGIVertices[_0x16aa('0x11')]['saveRestApiResult']=function(_0x2a82d8,_0x56e1b4){for(var _0x120e44 in _0x2a82d8){if(_0x2a82d8['hasOwnProperty'](_0x120e44)){if(_[_0x16aa('0x98')](_0x2a82d8[_0x120e44])){if(!_[_0x16aa('0x44')](_0x2a82d8[_0x120e44])){this[_0x16aa('0x9b')](_0x2a82d8[_0x120e44],util[_0x16aa('0x2a')](_0x16aa('0x9c'),_0x56e1b4,_0x120e44));}}else if(_[_0x16aa('0x99')](_0x2a82d8[_0x120e44])){for(var _0xa6b953=0x0;_0xa6b953<_0x2a82d8[_0x120e44][_0x16aa('0x9a')];_0xa6b953++){this[_0x16aa('0x9b')](_0x2a82d8[_0x120e44][_0xa6b953],util[_0x16aa('0x2a')](_0x16aa('0x9c'),_0x56e1b4,_0x120e44+'['+_0xa6b953+']'));}}else{if(!_[_0x16aa('0x45')](_0x2a82d8[_0x120e44])){this[_0x16aa('0xe')][_0x16aa('0x9d')](util[_0x16aa('0x2a')](_0x16aa('0x9c'),_0x56e1b4,_0x120e44),_0x2a82d8[_0x120e44]);}}}}};AGIVertices['prototype'][_0x16aa('0x9e')]=function(_0x443861){try{var _0x1a0784=JSON[_0x16aa('0x6d')](_0x443861);this[_0x16aa('0x97')](_0x1a0784);return JSON[_0x16aa('0x74')](_0x1a0784);}catch(_0x546e53){return this[_0x16aa('0x96')](_0x443861);}};AGIVertices[_0x16aa('0x11')][_0x16aa('0x96')]=function(_0x31f2d6){var _0x4beb22=_0x31f2d6['split']('{');for(var _0x4fb884=0x1;_0x4fb884<_0x4beb22['length'];_0x4fb884+=0x1){var _0x2055a9=_0x4beb22[_0x4fb884][_0x16aa('0x9f')]('}');if(_0x2055a9[_0x16aa('0x9a')]>0x1){_0x31f2d6=_0x31f2d6[_0x16aa('0xa0')]('{'+_0x2055a9[0x0]+'}',this['channel']['getVariable'](_0x2055a9[0x0])['extra']||_0x2055a9[0x0]);}}if(_0x4beb22[_0x16aa('0x9a')]===0x1){return _0x31f2d6[_0x16aa('0x4e')]();}return this[_0x16aa('0x96')](_0x31f2d6);};AGIVertices[_0x16aa('0x11')][_0x16aa('0xa1')]=function(_0x11e424,_0x281c6c){var _0x1f4e4b=this[_0x16aa('0xe')]['getVariable'](_0x11e424);if(_0x1f4e4b[_0x16aa('0xa2')]===-0x1){return _0x1f4e4b;}logger[_0x16aa('0x31')](util[_0x16aa('0x2a')](_0x16aa('0xa3'),_0x281c6c,_0x1f4e4b[_0x16aa('0xa4')]));return this[_0x16aa('0xe')]['setVariable'](_0x281c6c,_0x1f4e4b[_0x16aa('0xa4')]);};AGIVertices['prototype'][_0x16aa('0x85')]=function(_0x550e8a){return _0x550e8a&&_0x550e8a!=='0'&&_0x550e8a!=='-1'&&_0x550e8a!=='';};AGIVertices[_0x16aa('0x11')][_0x16aa('0xa5')]=function(_0x52d506){this[_0x16aa('0x37')][_0x16aa('0x71')](this,_0x52d506,'-');_0x52d506[_0x16aa('0xa6')]=_0x52d506['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices[_0x16aa('0x11')][_0x16aa('0xa7')]=function(_0x101333){logger[_0x16aa('0x31')](util['format'](_0x16aa('0xa8'),_0x101333[_0x16aa('0xa9')]));if(!this['isConfigured'](_0x101333['text'])){return this[_0x16aa('0xe')][_0x16aa('0xaa')](_0x16aa('0xab'));}var _0x19ed7b='\x22'+_0x101333['text']+'\x22';if(this[_0x16aa('0x85')](_0x101333[_0x16aa('0x79')])){_0x19ed7b+=','+_0x101333['options'];}var _0x178c65=this[_0x16aa('0xe')][_0x16aa('0xac')](_0x16aa('0xad'),_0x19ed7b);if(_0x178c65[_0x16aa('0xa2')]===-0x1){return _0x178c65;}return this[_0x16aa('0xe')][_0x16aa('0xaa')](util[_0x16aa('0x2a')]('Executed\x20command\x20MRCPSynth\x20%s',_0x19ed7b));};AGIVertices[_0x16aa('0x11')][_0x16aa('0xae')]=function(_0x4fc0ef){logger[_0x16aa('0x31')](util[_0x16aa('0x2a')](_0x16aa('0xaf'),_0x4fc0ef[_0x16aa('0xa9')]));if(!this[_0x16aa('0x85')](_0x4fc0ef[_0x16aa('0xb0')])){return this['channel'][_0x16aa('0xaa')](_0x16aa('0xb1'));}var _0x582b8e=_0x4fc0ef[_0x16aa('0xb0')];if(this['isConfigured'](_0x4fc0ef[_0x16aa('0x79')])){_0x582b8e+=','+_0x4fc0ef['options'];}var _0x5959e0=this['channel'][_0x16aa('0xac')](_0x16aa('0xb2'),_0x582b8e);if(_0x5959e0['result']===-0x1){return _0x5959e0;}var _0x2563b4=this[_0x16aa('0xa1')]('RECOG_CONFIDENCE()',_0x16aa('0xb3'));if(_0x2563b4['result']===-0x1){return _0x2563b4;}var _0x390d74=this[_0x16aa('0xa1')](_0x16aa('0xb4'),_0x16aa('0xb5'));if(_0x390d74[_0x16aa('0xa2')]===-0x1){return _0x390d74;}var _0x4df897=this[_0x16aa('0xa1')](_0x16aa('0xb6'),'MRCP_RECOG_INSTANCE');if(_0x4df897[_0x16aa('0xa2')]===-0x1){return _0x4df897;}return this[_0x16aa('0xe')][_0x16aa('0xaa')](util['format'](_0x16aa('0xb7'),_0x582b8e));};AGIVertices[_0x16aa('0x11')][_0x16aa('0x7')]=function(_0x3a6b64){logger[_0x16aa('0x31')](util[_0x16aa('0x2a')](_0x16aa('0xb8'),_0x3a6b64[_0x16aa('0xa9')]));return this[_0x16aa('0xe')][_0x16aa('0x7')]([_0x3a6b64['command'],_0x3a6b64[_0x16aa('0xb9')]]);};AGIVertices[_0x16aa('0x11')][_0x16aa('0xba')]=function(_0x1d64b4){logger[_0x16aa('0x31')](util[_0x16aa('0x2a')](_0x16aa('0xbb'),_0x1d64b4[_0x16aa('0xa9')]));if(this[_0x16aa('0x85')](_0x1d64b4['timeout'])){logger[_0x16aa('0x31')](util[_0x16aa('0x2a')]('Wait\x20%s\x20seconds\x20before\x20answer',_0x1d64b4[_0x16aa('0x69')]));var _0x159d50=this[_0x16aa('0xe')][_0x16aa('0xbc')](_0x1d64b4[_0x16aa('0x69')]);if(_0x159d50[_0x16aa('0xa2')]===-0x1){return _0x159d50;}}return this[_0x16aa('0xe')]['answer']();};AGIVertices[_0x16aa('0x11')][_0x16aa('0x4b')]=function(_0x2c5c88){logger[_0x16aa('0x31')](util[_0x16aa('0x2a')](_0x16aa('0xbd'),_0x2c5c88['label']));if(!this[_0x16aa('0x85')](_0x2c5c88['list_id'])){return this['channel'][_0x16aa('0x2d')](_0x2c5c88,_0x16aa('0xbe'));}_0x2c5c88[_0x16aa('0x4d')]=moment();if(this['isConfigured'](_0x2c5c88[_0x16aa('0xbf')])){_0x2c5c88['scheduledAt']=moment()['add'](_0x2c5c88['delay'],_0x16aa('0xc0'));}if(!this['isConfigured'](_0x2c5c88['callback_priority'])){_0x2c5c88[_0x16aa('0xc1')]=0x2;}this[_0x16aa('0x43')]['sync'](this,_0x2c5c88);return this[_0x16aa('0xe')]['noop'](util['format'](_0x16aa('0xc2'),_0x2c5c88['phone'],_0x2c5c88['list_id'],_0x2c5c88['scheduledAt']));};AGIVertices[_0x16aa('0x11')][_0x16aa('0xc3')]=function(_0x434ea8){logger[_0x16aa('0x31')](util['format'](_0x16aa('0xc4'),_0x434ea8[_0x16aa('0xa9')]));var _0x33742b=this['channel']['exec'](_0x434ea8[_0x16aa('0xc5')],_0x434ea8[_0x16aa('0x79')]);if(_0x33742b[_0x16aa('0xa2')]===-0x1){return _0x33742b;}return this[_0x16aa('0xe')]['noop'](util['format'](_0x16aa('0xc6'),_0x434ea8[_0x16aa('0xc5')],_0x434ea8[_0x16aa('0x79')]));};AGIVertices[_0x16aa('0x11')][_0x16aa('0xc7')]=function(_0x2245e4){logger[_0x16aa('0x31')](util[_0x16aa('0x2a')](_0x16aa('0xc8'),_0x2245e4['label']));if(!this[_0x16aa('0x85')](_0x2245e4[_0x16aa('0x5d')])){return this[_0x16aa('0xe')][_0x16aa('0xaa')](_0x16aa('0xab'));}var _0x34fcb9='\x22'+_0x2245e4[_0x16aa('0x5d')]+'\x22';if(this[_0x16aa('0x85')](_0x2245e4[_0x16aa('0x79')])){_0x34fcb9+=','+_0x2245e4[_0x16aa('0x79')];}var _0x372331=this[_0x16aa('0xe')][_0x16aa('0xac')]('MRCPSynth',_0x34fcb9);if(_0x372331[_0x16aa('0xa2')]===-0x1){return _0x372331;}return this[_0x16aa('0xe')][_0x16aa('0xaa')](util[_0x16aa('0x2a')](_0x16aa('0xc9'),_0x34fcb9));};AGIVertices[_0x16aa('0x11')][_0x16aa('0xca')]=function(_0x4a5424){logger['info'](util['format'](_0x16aa('0xcb'),_0x4a5424['label']));if(!this[_0x16aa('0x85')](_0x4a5424[_0x16aa('0x5d')])){return this[_0x16aa('0xe')]['noop'](_0x16aa('0xab'));}var _0xd0c680='\x22'+_0x4a5424['text']+'\x22';if(this[_0x16aa('0x85')](_0x4a5424[_0x16aa('0x79')])){_0xd0c680+=','+_0x4a5424[_0x16aa('0x79')];}var _0x38b214=this[_0x16aa('0xe')][_0x16aa('0xac')](_0x16aa('0xad'),_0xd0c680);if(_0x38b214[_0x16aa('0xa2')]===-0x1){return _0x38b214;}return this[_0x16aa('0xe')][_0x16aa('0xaa')](util[_0x16aa('0x2a')]('Executed\x20command\x20MRCPSynth\x20%s',_0xd0c680));};AGIVertices[_0x16aa('0x11')][_0x16aa('0xcc')]=function(_0x33fe5b){logger['info'](util[_0x16aa('0x2a')](_0x16aa('0xcd'),_0x33fe5b[_0x16aa('0xa9')]));if(!this['isConfigured'](_0x33fe5b[_0x16aa('0xb0')])){return this[_0x16aa('0xe')]['noop'](_0x16aa('0xb1'));}var _0xd0e5fe=_0x33fe5b[_0x16aa('0xb0')];if(this[_0x16aa('0x85')](_0x33fe5b[_0x16aa('0x79')])){_0xd0e5fe+=','+_0x33fe5b[_0x16aa('0x79')];}var _0x4b955f=this['channel']['exec'](_0x16aa('0xb2'),_0xd0e5fe);if(_0x4b955f['result']===-0x1){return _0x4b955f;}var _0x2a19c1=this[_0x16aa('0xa1')](_0x16aa('0xce'),'LUMENVOX_ASR_CONFIDENCE');if(_0x2a19c1[_0x16aa('0xa2')]===-0x1){return _0x2a19c1;}var _0x3e9fcd=this['getAndSetVariable'](_0x16aa('0xb4'),'LUMENVOX_ASR_TRANSCRIPT');if(_0x3e9fcd['result']===-0x1){return _0x3e9fcd;}var _0x155bed=this[_0x16aa('0xa1')](_0x16aa('0xb6'),_0x16aa('0xcf'));if(_0x155bed[_0x16aa('0xa2')]===-0x1){return _0x155bed;}return this[_0x16aa('0xe')][_0x16aa('0xaa')](util[_0x16aa('0x2a')](_0x16aa('0xb7'),_0xd0e5fe));};AGIVertices[_0x16aa('0x11')][_0x16aa('0xd0')]=function(_0x38287d){logger[_0x16aa('0x31')](util[_0x16aa('0x2a')](_0x16aa('0xd1'),_0x38287d[_0x16aa('0xa9')]));if(!this[_0x16aa('0x85')](_0x38287d[_0x16aa('0xb0')])){return this[_0x16aa('0xe')]['noop'](_0x16aa('0xb1'));}var _0x2a820f=_0x38287d[_0x16aa('0xb0')];if(this[_0x16aa('0x85')](_0x38287d[_0x16aa('0x79')])){_0x2a820f+=','+_0x38287d[_0x16aa('0x79')];}var _0x5c4e37=this[_0x16aa('0xe')][_0x16aa('0xac')]('MRCPRecog',_0x2a820f);if(_0x5c4e37[_0x16aa('0xa2')]===-0x1){return _0x5c4e37;}var _0x1ee381=this[_0x16aa('0xa1')]('RECOG_CONFIDENCE()',_0x16aa('0xd2'));if(_0x1ee381[_0x16aa('0xa2')]===-0x1){return _0x1ee381;}var _0x13000b=this[_0x16aa('0xa1')]('RECOG_INPUT()',_0x16aa('0xd3'));if(_0x13000b['result']===-0x1){return _0x13000b;}var _0x36221a=this[_0x16aa('0xa1')](_0x16aa('0xb6'),_0x16aa('0xd4'));if(_0x36221a[_0x16aa('0xa2')]===-0x1){return _0x36221a;}return this[_0x16aa('0xe')][_0x16aa('0xaa')](util[_0x16aa('0x2a')](_0x16aa('0xb7'),_0x2a820f));};AGIVertices['prototype'][_0x16aa('0xd5')]=function(_0x21f330){logger[_0x16aa('0x31')](util['format'](_0x16aa('0xd6'),_0x21f330[_0x16aa('0xa9')]));if(!this[_0x16aa('0x85')](_0x21f330[_0x16aa('0xd7')])){return this[_0x16aa('0xe')][_0x16aa('0x2d')](_0x21f330,_0x16aa('0xd8'));}var _0x24e03b=this['getSquareOdbc']['sync'](this,_0x21f330[_0x16aa('0xd7')]);if(!_0x24e03b){return this[_0x16aa('0xe')][_0x16aa('0x2d')](_0x21f330,'no\x20odbc\x20database\x20found');}if(!this[_0x16aa('0x85')](_0x21f330[_0x16aa('0x2f')])){return this[_0x16aa('0xe')][_0x16aa('0x2d')](_0x21f330,'no\x20query\x20configured');}var _0x39c80e=_0x21f330[_0x16aa('0x2f')]['replace'](/(\r\n|\n|\r)/gm,'\x20');this[_0x16aa('0xe')]['noop'](util[_0x16aa('0x2a')]('query:\x20%s',_0x39c80e));var _0x45b865=this[_0x16aa('0x2c')][_0x16aa('0x71')](this,_0x24e03b,_0x39c80e);this['createSquareDetailsReport']['sync'](this,_0x21f330,_0x39c80e);if(!this[_0x16aa('0x85')](_0x21f330[_0x16aa('0xd9')])){return this['channel'][_0x16aa('0xaa')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x174cbc=this[_0x16aa('0x12')][_0x16aa('0x71')](this,_0x21f330[_0x16aa('0xd9')]);if(!_0x174cbc){return this[_0x16aa('0xe')][_0x16aa('0x2d')](_0x21f330,_0x16aa('0xda'));}var _0x103f90=this;_0x45b865[_0x16aa('0xdb')](function(_0x5a0711,_0x285c79){Object[_0x16aa('0xdc')](_0x5a0711)['forEach'](function(_0x164608){_0x103f90[_0x16aa('0xe')][_0x16aa('0x9d')](util[_0x16aa('0x2a')]('%s[%s][%s]',_0x174cbc,_0x285c79,_0x164608),_0x5a0711[_0x164608]);});});this[_0x16aa('0xe')]['setVariable'](util[_0x16aa('0x2a')](_0x16aa('0xdd'),_0x174cbc),_0x45b865[_0x16aa('0x9a')]);return this[_0x16aa('0xe')][_0x16aa('0xaa')](util[_0x16aa('0x2a')]('variable\x20%s\x20set',_0x174cbc));};AGIVertices['prototype'][_0x16aa('0xde')]=function(_0xbd18fb){logger[_0x16aa('0xdf')](util[_0x16aa('0x2a')]('Enter\x20in\x20DIAL\x20(%s)\x20block',_0xbd18fb[_0x16aa('0xa9')]));if(!this['isConfigured'](_0xbd18fb[_0x16aa('0xe0')])){return this[_0x16aa('0xe')][_0x16aa('0x2d')](_0xbd18fb,'no\x20user\x20selected');}var _0x269aee=this[_0x16aa('0x1e')]['sync'](this,_0xbd18fb['sip_id']);if(!_0x269aee){return this[_0x16aa('0xe')][_0x16aa('0x2d')](_0xbd18fb,'no\x20user\x20found');}var _0x500d2c=this[_0x16aa('0xe')][_0x16aa('0xac')](_0x16aa('0xe1'),[util['format'](_0x16aa('0xe2'),_0x269aee),_0xbd18fb[_0x16aa('0x69')],_0xbd18fb[_0x16aa('0xe3')],_0xbd18fb[_0x16aa('0x66')]]);if(_0x500d2c[_0x16aa('0xa2')]===-0x1){return _0x500d2c;}return this[_0x16aa('0xe')][_0x16aa('0xaa')](util[_0x16aa('0x2a')]('Executed\x20command\x20%s',_0x16aa('0xe1')));};AGIVertices[_0x16aa('0x11')][_0x16aa('0xe4')]=function(_0x4bf0cc){logger['info'](util[_0x16aa('0x2a')](_0x16aa('0xe5'),_0x4bf0cc[_0x16aa('0xa9')]));if(!this[_0x16aa('0x85')](_0x4bf0cc[_0x16aa('0x8f')])){return this['channel'][_0x16aa('0xaa')](_0x16aa('0xe6'));}if(!this[_0x16aa('0x85')](_0x4bf0cc[_0x16aa('0x5d')])){return this['channel'][_0x16aa('0xaa')](_0x16aa('0xab'));}this[_0x16aa('0xe')][_0x16aa('0xe7')]=!![];this['createSquareDetailsReport'](_0x4bf0cc);this[_0x16aa('0x42')](_0x4bf0cc[_0x16aa('0x5d')],'in','','');this[_0x16aa('0xe')][_0x16aa('0xaa')](util[_0x16aa('0x2a')]('Trying\x20Dialogflow:\x20%s',_0x4bf0cc[_0x16aa('0x5d')]));var _0x438ef5=this[_0x16aa('0x7a')]['sync'](this,_0x4bf0cc);if(_0x438ef5){for(var _0x1f8ea2 in _0x438ef5){if(_0x438ef5[_0x16aa('0x94')](_0x1f8ea2)){this['channel'][_0x16aa('0x9d')](util[_0x16aa('0x2a')](_0x16aa('0xe8'),_0x1f8ea2[_0x16aa('0xe9')]()),_0x438ef5[_0x1f8ea2]);}}this[_0x16aa('0x42')](_0x438ef5[_0x16aa('0xea')],_0x16aa('0xeb'),_0x16aa('0xe4'),'');return this[_0x16aa('0xe')][_0x16aa('0xaa')](util[_0x16aa('0x2a')](_0x16aa('0xec'),_0x438ef5['speech']));}return this[_0x16aa('0xe')][_0x16aa('0x2d')](_0x4bf0cc,_0x16aa('0xed'));};AGIVertices['prototype'][_0x16aa('0xee')]=function(_0x1909b5){logger['info'](util[_0x16aa('0x2a')](_0x16aa('0xef'),_0x1909b5[_0x16aa('0xa9')]));if(!this['isConfigured'](_0x1909b5['dialogflowV2_project_id'])){return this[_0x16aa('0xe')]['noop'](_0x16aa('0xf0'));}if(!this[_0x16aa('0x85')](_0x1909b5[_0x16aa('0x7d')])){return this['channel'][_0x16aa('0xaa')](_0x16aa('0xf1'));}if(!this[_0x16aa('0x85')](_0x1909b5['private_key'])){return this[_0x16aa('0xe')][_0x16aa('0xaa')](_0x16aa('0xf2'));}if(!this[_0x16aa('0x85')](_0x1909b5[_0x16aa('0xf3')])){return this['channel'][_0x16aa('0xaa')](_0x16aa('0xf4'));}if(!this['isConfigured'](_0x1909b5[_0x16aa('0x5d')])){return this[_0x16aa('0xe')][_0x16aa('0xaa')]('no\x20text\x20configured');}this[_0x16aa('0xe')][_0x16aa('0xe7')]=!![];this[_0x16aa('0x37')](_0x1909b5);this[_0x16aa('0x42')](_0x1909b5[_0x16aa('0x5d')],'in','','');this[_0x16aa('0xe')]['noop'](util['format'](_0x16aa('0xf5'),_0x1909b5['text']));var _0x506cc0=this[_0x16aa('0xf6')]['sync'](this,_0x1909b5);if(_0x506cc0){for(var _0x4a5935 in _0x506cc0){if(_0x506cc0[_0x16aa('0x94')](_0x4a5935)){if(_0x4a5935!=='providerResponse'){this[_0x16aa('0xe')][_0x16aa('0x9d')](util[_0x16aa('0x2a')]('DIALOGFLOW_%s',_0x4a5935[_0x16aa('0xe9')]()),_0x506cc0[_0x4a5935]);}}}this[_0x16aa('0x42')](_0x506cc0['speech'],_0x16aa('0xeb'),_0x16aa('0xee'),_0x506cc0[_0x16aa('0xf7')]);return this[_0x16aa('0xe')][_0x16aa('0xaa')](util[_0x16aa('0x2a')]('DialogflowV2\x20Result\x20%s',_0x506cc0[_0x16aa('0xea')]));}return this[_0x16aa('0xe')][_0x16aa('0x2d')](_0x1909b5,'DialogflowV2\x20is\x20unreachable');};AGIVertices[_0x16aa('0x11')][_0x16aa('0xf8')]=function(_0x322da8){logger[_0x16aa('0x31')](util['format'](_0x16aa('0xf9'),_0x322da8['label']));if(!this[_0x16aa('0x85')](_0x322da8[_0x16aa('0xfa')])){return this[_0x16aa('0xe')][_0x16aa('0xaa')]('no\x20ndauth\x20url\x20configured');}if(!this[_0x16aa('0x85')](_0x322da8['username'])){return this[_0x16aa('0xe')][_0x16aa('0xaa')](_0x16aa('0xfb'));}if(!this[_0x16aa('0x85')](_0x322da8[_0x16aa('0xfc')])){return this[_0x16aa('0xe')]['noop'](_0x16aa('0xfd'));}if(!this[_0x16aa('0x85')](_0x322da8['ndassistant_url'])){return this[_0x16aa('0xe')][_0x16aa('0xaa')](_0x16aa('0xab'));}this['channel']['bot']=!![];this[_0x16aa('0x37')](_0x322da8);this[_0x16aa('0x42')](_0x322da8[_0x16aa('0x5d')],'in','','');this[_0x16aa('0xe')][_0x16aa('0xaa')](util[_0x16aa('0x2a')](_0x16aa('0xfe'),_0x322da8[_0x16aa('0x5d')]));var _0x65f68=this['sestekNDA']['sync'](this,_0x322da8);if(_0x65f68){for(var _0x147ab6 in _0x65f68){if(_0x65f68[_0x16aa('0x94')](_0x147ab6)){this[_0x16aa('0xe')][_0x16aa('0x9d')](util[_0x16aa('0x2a')]('SESTEK_NDA_%s',_0x147ab6[_0x16aa('0xe9')]()),_0x65f68[_0x147ab6]);}}this[_0x16aa('0x42')](_0x65f68['speech'],_0x16aa('0xeb'),'sesteknda','');if(_0x65f68[_0x16aa('0xff')]){this[_0x16aa('0xe')][_0x16aa('0xaa')](util['format'](_0x16aa('0x100'),_0x65f68['audiofile']));var _0x3369f0=this[_0x16aa('0xe')][_0x16aa('0x101')](_0x65f68['audiofile']);try{fs['unlink'](_0x65f68[_0x16aa('0xff')]+_0x16aa('0x102'));}catch(_0x330a22){logger[_0x16aa('0x2d')](_0x330a22);}return _0x3369f0;}else{return this[_0x16aa('0xe')][_0x16aa('0xaa')](util['format'](_0x16aa('0x103'),_0x65f68['speech']));}}return this[_0x16aa('0xe')][_0x16aa('0x2d')](_0x322da8,'SestekNDA\x20is\x20unreachable');};AGIVertices['prototype'][_0x16aa('0x104')]=function(_0x5bcf90){logger[_0x16aa('0x31')](util['format']('Enter\x20in\x20END\x20(%s)\x20block',_0x5bcf90['label']));return this[_0x16aa('0xe')][_0x16aa('0xaa')](_0x16aa('0x104'));};AGIVertices[_0x16aa('0x11')]['ext_dial']=function(_0x5b7366){logger[_0x16aa('0x31')](util[_0x16aa('0x2a')](_0x16aa('0x105'),_0x5b7366[_0x16aa('0xa9')]));var _0x548aba='';if(_0x5b7366[_0x16aa('0x106')]){if(!this[_0x16aa('0x85')](_0x5b7366[_0x16aa('0x106')])){return this[_0x16aa('0xe')][_0x16aa('0x2d')](_0x5b7366,_0x16aa('0x107'));}else{var _0x7c3bd8=parseInt(_0x5b7366[_0x16aa('0x106')],0xa);if(isNaN(_0x7c3bd8)){_0x548aba=_0x5b7366[_0x16aa('0x106')];}else{_0x548aba=this[_0x16aa('0x108')]['sync'](this,_0x5b7366[_0x16aa('0x106')]);if(!_0x548aba){return this[_0x16aa('0xe')][_0x16aa('0x2d')](_0x5b7366,'no\x20trunk\x20found');}}}}else if(_0x5b7366[_0x16aa('0x109')]){_0x548aba=_0x5b7366[_0x16aa('0x109')];}else{return this[_0x16aa('0xe')][_0x16aa('0x2d')](_0x5b7366,'no\x20trunk\x20selected');}var _0x37c11e=this[_0x16aa('0xe')]['exec'](_0x16aa('0xe1'),[util[_0x16aa('0x2a')]('SIP/%s/%s',_0x548aba,_0x5b7366[_0x16aa('0x49')]),_0x5b7366[_0x16aa('0x69')],_0x5b7366[_0x16aa('0xe3')],_0x5b7366[_0x16aa('0x66')]]);if(_0x37c11e['result']===-0x1){return _0x37c11e;}return this[_0x16aa('0xe')]['noop'](util['format']('Executed\x20command\x20%s','DIAL'));};AGIVertices[_0x16aa('0x11')][_0x16aa('0x10a')]=function(_0x4ddecb){logger[_0x16aa('0x31')](util['format']('Enter\x20in\x20FINALLY\x20(%s)\x20block',_0x4ddecb[_0x16aa('0xa9')]));return this[_0x16aa('0xe')][_0x16aa('0xaa')]('finally');};AGIVertices['prototype'][_0x16aa('0x10b')]=function(_0x4223f2){logger[_0x16aa('0x31')](util[_0x16aa('0x2a')](_0x16aa('0x10c'),_0x4223f2[_0x16aa('0xa9')]));if(_0x4223f2[_0x16aa('0xa6')]===0x0){return this[_0x16aa('0xa5')](_0x4223f2);}_0x4223f2['retry']-=0x1;if(!this[_0x16aa('0x85')](_0x4223f2[_0x16aa('0x10d')])){return this['channel'][_0x16aa('0x2d')](_0x4223f2,_0x16aa('0x10e'));}var _0x40470e=this[_0x16aa('0x10f')][_0x16aa('0x71')](this,_0x4223f2[_0x16aa('0x10d')]);if(!_0x40470e){return this[_0x16aa('0xe')][_0x16aa('0x2d')](_0x4223f2,_0x16aa('0x110'));}if(!this[_0x16aa('0x85')](_0x4223f2[_0x16aa('0xd9')])){return this[_0x16aa('0xe')][_0x16aa('0x2d')](_0x16aa('0x111'));}var _0x2ddde0=this[_0x16aa('0xe')][_0x16aa('0x112')](_0x40470e,_0x4223f2[_0x16aa('0x113')],_0x4223f2[_0x16aa('0x114')]);var _0x33185b=_0x2ddde0['result']?_0x2ddde0[_0x16aa('0xa2')][_0x16aa('0x4e')]():'';logger[_0x16aa('0x31')]('test',JSON['stringify'](_0x2ddde0));if(_0x2ddde0[_0x16aa('0xa2')]===-0x1){this[_0x16aa('0x37')][_0x16aa('0x71')](this,_0x4223f2,_0x33185b);return _0x2ddde0;}else if(_0x2ddde0[_0x16aa('0xa4')]==='timeout'){_0x2ddde0[_0x16aa('0xa2')]=_0x33185b['length']>=parseInt(_0x4223f2[_0x16aa('0x115')])?'x':'i';}else{_0x2ddde0[_0x16aa('0xa2')]=_0x33185b[_0x16aa('0x9a')]>=parseInt(_0x4223f2[_0x16aa('0x115')])&&_0x33185b[_0x16aa('0x9a')]<=parseInt(_0x4223f2[_0x16aa('0x114')])?'x':'i';}var _0x52750f=this['getVariable'][_0x16aa('0x71')](this,_0x4223f2[_0x16aa('0xd9')]);if(!_0x52750f){return this[_0x16aa('0xe')][_0x16aa('0x2d')](_0x4223f2,'no\x20variable\x20found');}this[_0x16aa('0xe')]['setVariable'](_0x52750f,_0x33185b);if(this[_0x16aa('0x85')](_0x4223f2[_0x16aa('0x116')])){var _0x2eeae1=parseInt(_0x4223f2[_0x16aa('0x116')],0xa);var _0x1fa983=rs[_0x16aa('0x117')]({'charset':'*','length':_0x2eeae1});var _0x31d430=_0x33185b['length'];if(_0x31d430>0x0){if(_0x31d430>_0x2eeae1){this[_0x16aa('0x37')][_0x16aa('0x71')](this,_0x4223f2,_0x4223f2['hiddendigitspos']===_0x16aa('0x118')?_0x1fa983+_0x33185b[_0x16aa('0x119')](_0x2eeae1):_0x33185b[_0x16aa('0x119')](0x0,_0x31d430-_0x2eeae1)+_0x1fa983);}else{this[_0x16aa('0x37')][_0x16aa('0x71')](this,_0x4223f2,rs[_0x16aa('0x117')]({'charset':'*','length':_0x31d430}));}}else{this[_0x16aa('0x37')][_0x16aa('0x71')](this,_0x4223f2,'');}}else{this[_0x16aa('0x37')][_0x16aa('0x71')](this,_0x4223f2,_0x33185b);}return _0x2ddde0;};AGIVertices[_0x16aa('0x11')]['getsecretdigits']=function(_0x158c4d){logger[_0x16aa('0x31')](util[_0x16aa('0x2a')]('Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block',_0x158c4d[_0x16aa('0xa9')]));return this['getdigits'](_0x158c4d);};AGIVertices[_0x16aa('0x11')][_0x16aa('0x11a')]=function(_0x152014){logger['info'](util['format'](_0x16aa('0x11b'),_0x152014[_0x16aa('0xa9')]));this[_0x16aa('0x37')][_0x16aa('0x71')](this,_0x152014,_0x152014[_0x16aa('0x11c')]);return this[_0x16aa('0xe')][_0x16aa('0xaa')](util[_0x16aa('0x2a')](_0x16aa('0x11d'),_0x152014[_0x16aa('0x11c')]));};AGIVertices[_0x16aa('0x11')][_0x16aa('0x11e')]=function(_0x4c53e6){logger[_0x16aa('0x31')](util['format'](_0x16aa('0x11f'),_0x4c53e6[_0x16aa('0xa9')]));if(!this[_0x16aa('0x85')](_0x4c53e6['aws_access_key_id'])||!this[_0x16aa('0x85')](_0x4c53e6['aws_secret_access_key'])){return this[_0x16aa('0xe')]['noop'](_0x16aa('0x120'));}if(!this[_0x16aa('0x85')](_0x4c53e6['text'])){return this[_0x16aa('0xe')][_0x16aa('0xaa')](_0x16aa('0xab'));}this[_0x16aa('0xe')]['noop'](util[_0x16aa('0x2a')](_0x16aa('0x121'),_0x4c53e6[_0x16aa('0x5d')]));var _0x14a19f=this['awsPolly'][_0x16aa('0x71')](this,_0x4c53e6);if(_0x14a19f){this[_0x16aa('0xe')]['noop'](util[_0x16aa('0x2a')](_0x16aa('0x122'),_0x14a19f));var _0x5e6cb5=this[_0x16aa('0xe')][_0x16aa('0x101')](_0x14a19f);try{fs[_0x16aa('0x123')](_0x14a19f+_0x16aa('0x102'));}catch(_0x1efbab){logger[_0x16aa('0x2d')](_0x1efbab);}return _0x5e6cb5;}return this[_0x16aa('0xe')][_0x16aa('0x2d')](_0x4c53e6,_0x16aa('0x124'));};AGIVertices[_0x16aa('0x11')][_0x16aa('0x125')]=function(_0xc5c993){logger['info'](util[_0x16aa('0x2a')](_0x16aa('0x126'),_0xc5c993[_0x16aa('0xa9')]));if(!this['isConfigured'](_0xc5c993['aws_access_key_id'])||!this['isConfigured'](_0xc5c993[_0x16aa('0x88')])){return this[_0x16aa('0xe')]['noop'](_0x16aa('0x120'));}if(!this[_0x16aa('0x85')](_0xc5c993[_0x16aa('0x8d')])){return this['channel']['noop'](_0x16aa('0x127'));}if(!this[_0x16aa('0x85')](_0xc5c993[_0x16aa('0x5d')])){return this[_0x16aa('0xe')][_0x16aa('0xaa')]('no\x20text\x20configured');}this[_0x16aa('0xe')][_0x16aa('0xe7')]=!![];this['createSquareDetailsReport'](_0xc5c993);this[_0x16aa('0x42')](_0xc5c993[_0x16aa('0x5d')],'in','','');this['channel'][_0x16aa('0xaa')](util[_0x16aa('0x2a')](_0x16aa('0x128'),_0xc5c993[_0x16aa('0x5d')]));var _0x4b9e07=this['awsLex'][_0x16aa('0x71')](this,_0xc5c993);if(_0x4b9e07){for(var _0x1e846f in _0x4b9e07){if(_0x4b9e07['hasOwnProperty'](_0x1e846f)&&_['isString'](_0x4b9e07[_0x1e846f])){this[_0x16aa('0xe')][_0x16aa('0x9d')](util['format']('AWS_LEX_%s',_0x1e846f[_0x16aa('0xe9')]()),_0x4b9e07[_0x1e846f]);}}if(_[_0x16aa('0x45')](_0x4b9e07[_0x16aa('0x77')])){return this[_0x16aa('0xe')][_0x16aa('0xaa')](_0x16aa('0x129'));}else{this['createSquareMessage'](_0x4b9e07['message'],'out',_0x16aa('0x12a'),'');return this[_0x16aa('0xe')][_0x16aa('0xaa')](util[_0x16aa('0x2a')](_0x16aa('0x12b'),_0x4b9e07['message']));}}return this[_0x16aa('0xe')][_0x16aa('0x2d')](_0xc5c993,_0x16aa('0x12c'));};AGIVertices[_0x16aa('0x11')][_0x16aa('0x12d')]=function(_0x2b1e1b){logger['info'](util[_0x16aa('0x2a')](_0x16aa('0x12e'),_0x2b1e1b[_0x16aa('0xa9')],_0x2b1e1b[_0x16aa('0x69')]));if(!this[_0x16aa('0x85')](_0x2b1e1b[_0x16aa('0x8f')])){return this[_0x16aa('0xe')][_0x16aa('0xaa')](_0x16aa('0xe6'));}var _0x418af7=_0x16aa('0x12f');var _0x55414e=util['format']('%s/recordings/%s',FILES_PATH,rs[_0x16aa('0x117')](0x4));var _0x327a6d=util[_0x16aa('0x2a')](_0x16aa('0x9c'),_0x55414e,_0x418af7);var _0x465b32=!![];if(_0x2b1e1b[_0x16aa('0x130')]==='NOBEEP'){_0x465b32=![];}var _0x285735=this['channel'][_0x16aa('0x131')](_0x55414e,_0x418af7,_0x2b1e1b['intKey'],_0x2b1e1b[_0x16aa('0x69')],undefined,_0x465b32);if(_0x285735[_0x16aa('0xa2')]!==-0x1){this[_0x16aa('0xe')][_0x16aa('0xaa')](util[_0x16aa('0x2a')](_0x16aa('0x132'),_0x327a6d));var _0x4508e0=this['googleASR'][_0x16aa('0x71')](this,_0x2b1e1b,_0x327a6d);if(_0x4508e0){for(var _0x10df4d in _0x4508e0){if(_0x4508e0[_0x16aa('0x94')](_0x10df4d)){this[_0x16aa('0xe')]['setVariable'](util[_0x16aa('0x2a')](_0x16aa('0x133'),_0x10df4d['toUpperCase']()),_0x4508e0[_0x10df4d]);}}return this[_0x16aa('0xe')][_0x16aa('0xaa')](util[_0x16aa('0x2a')](_0x16aa('0x134'),JSON[_0x16aa('0x74')](_0x4508e0)));}}return _0x285735;};AGIVertices['prototype'][_0x16aa('0x135')]=function(_0x68a073){logger[_0x16aa('0x31')](util[_0x16aa('0x2a')]('Enter\x20in\x20TILDEASR\x20(%s)\x20block',_0x68a073[_0x16aa('0xa9')]));if(!this[_0x16aa('0x85')](_0x68a073[_0x16aa('0x92')])){return this[_0x16aa('0xe')][_0x16aa('0xaa')]('no\x20appid\x20configured');}if(!this[_0x16aa('0x85')](_0x68a073[_0x16aa('0x136')])){return this[_0x16aa('0xe')][_0x16aa('0xaa')](_0x16aa('0x137'));}var _0x1943a5=_0x16aa('0x12f');var _0x1da1b6=util[_0x16aa('0x2a')]('%s/recordings/%s',FILES_PATH,rs[_0x16aa('0x117')](0x4));var _0x54b8cc=util['format'](_0x16aa('0x9c'),_0x1da1b6,_0x1943a5);var _0x186dd1=!![];if(_0x68a073[_0x16aa('0x130')]==='NOBEEP'){_0x186dd1=![];}var _0x54c09e=this['channel'][_0x16aa('0x131')](_0x1da1b6,_0x1943a5,_0x68a073[_0x16aa('0x138')],_0x68a073['timeout'],undefined,_0x186dd1);if(_0x54c09e['result']!==-0x1){this[_0x16aa('0xe')][_0x16aa('0xaa')](util[_0x16aa('0x2a')](_0x16aa('0x139'),_0x54b8cc));var _0x578060=this[_0x16aa('0x91')]['sync'](this,_0x68a073,_0x54b8cc);if(_0x578060){for(var _0x1bcf0e in _0x578060){if(_0x578060[_0x16aa('0x94')](_0x1bcf0e)){this['channel'][_0x16aa('0x9d')](util[_0x16aa('0x2a')]('TILDE_ASR_%s',_0x1bcf0e[_0x16aa('0xe9')]()),_0x578060[_0x1bcf0e]);}}return this[_0x16aa('0xe')][_0x16aa('0xaa')](util[_0x16aa('0x2a')]('TildeASR\x20Result\x20%s',JSON['stringify'](_0x578060)));}}return _0x54c09e;};AGIVertices['prototype'][_0x16aa('0x13a')]=function(_0x225a6a){logger[_0x16aa('0x31')](util[_0x16aa('0x2a')]('Enter\x20in\x20GOTO\x20(%s)\x20block',_0x225a6a[_0x16aa('0xa9')]));return this[_0x16aa('0xe')][_0x16aa('0x13b')](_0x225a6a[_0x16aa('0x3e')],_0x225a6a[_0x16aa('0x13c')],_0x225a6a[_0x16aa('0x3f')]);};AGIVertices[_0x16aa('0x11')]['gotoif']=function(_0x1fbb65){logger['info'](util[_0x16aa('0x2a')](_0x16aa('0x13d'),_0x1fbb65[_0x16aa('0xa9')]));if(!this[_0x16aa('0x85')](_0x1fbb65[_0x16aa('0x13e')])){return this[_0x16aa('0xe')][_0x16aa('0x2d')](_0x1fbb65,_0x16aa('0x13f'));}try{var _0x3f449d=eval(_0x1fbb65[_0x16aa('0x13e')])?_0x16aa('0x140'):_0x16aa('0x141');this['channel']['noop'](util['format']('EVAL\x20CONDITION\x20%s\x20%s',_0x1fbb65[_0x16aa('0x13e')],_0x3f449d));return{'code':0xc8,'result':_0x3f449d};}catch(_0x51e2b8){return{'code':0xc8,'result':_0x16aa('0x141')};}};AGIVertices[_0x16aa('0x11')][_0x16aa('0x142')]=function(_0x238677){logger[_0x16aa('0x31')](util[_0x16aa('0x2a')]('Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block',_0x238677[_0x16aa('0xa9')]));if(!this[_0x16aa('0x85')](_0x238677[_0x16aa('0x143')])){return this[_0x16aa('0xe')][_0x16aa('0x2d')](_0x238677,_0x16aa('0x144'));}var _0x52e9b3=this['getIntervals']['sync'](this,_0x238677[_0x16aa('0x143')]);if(!_0x52e9b3){return this['channel']['error'](_0x238677,_0x16aa('0x145'));}for(var _0x2c64a2=0x0;_0x2c64a2<_0x52e9b3[_0x16aa('0x9a')];_0x2c64a2+=0x1){var _0x122c63=this[_0x16aa('0xe')][_0x16aa('0x12')](util[_0x16aa('0x2a')](_0x16aa('0x146'),_0x52e9b3[_0x2c64a2]));if(_0x122c63[_0x16aa('0xa2')]===-0x1){return _0x122c63;}logger[_0x16aa('0x31')](util[_0x16aa('0x2a')](_0x16aa('0x147'),_0x52e9b3[_0x2c64a2],_0x122c63['extra']));if(_0x122c63[_0x16aa('0xa4')]==='true'){logger['info'](util[_0x16aa('0x2a')]('IFTIME\x20%s\x20%s',_0x52e9b3[_0x2c64a2],_0x16aa('0x140')));this[_0x16aa('0xe')][_0x16aa('0xaa')](util[_0x16aa('0x2a')](_0x16aa('0x147'),_0x52e9b3[_0x2c64a2],_0x16aa('0x140')));return{'code':0xc8,'result':_0x16aa('0x140')};}else{logger[_0x16aa('0x31')](util[_0x16aa('0x2a')](_0x16aa('0x147'),_0x52e9b3[_0x2c64a2],'false'));this[_0x16aa('0xe')]['noop'](util[_0x16aa('0x2a')](_0x16aa('0x147'),_0x52e9b3[_0x2c64a2],_0x16aa('0x141')));}}return{'code':0xc8,'result':_0x16aa('0x141')};};AGIVertices[_0x16aa('0x11')][_0x16aa('0x148')]=function(_0x36a0e2){logger['info'](util[_0x16aa('0x2a')](_0x16aa('0x149'),_0x36a0e2[_0x16aa('0xa9')]));return this[_0x16aa('0xe')]['hangup']();};AGIVertices[_0x16aa('0x11')][_0x16aa('0x14a')]=function(_0x3ab7f6){logger[_0x16aa('0x31')](util[_0x16aa('0x2a')]('Enter\x20in\x20ISPEECHASR\x20(%s)\x20block',_0x3ab7f6[_0x16aa('0xa9')]));if(!this[_0x16aa('0x85')](_0x3ab7f6[_0x16aa('0x8f')])){return this[_0x16aa('0xe')]['noop']('no\x20key\x20configured');}var _0x36326d=_0x16aa('0x12f');var _0x19caf1=util[_0x16aa('0x2a')]('%s/recordings/%s',FILES_PATH,rs[_0x16aa('0x117')](0x4));var _0xa902c9=util[_0x16aa('0x2a')](_0x16aa('0x9c'),_0x19caf1,_0x36326d);var _0xb9cd12=!![];if(_0x3ab7f6['beep']===_0x16aa('0x14b')){_0xb9cd12=![];}var _0x2b5837=this['channel'][_0x16aa('0x131')](_0x19caf1,_0x36326d,_0x3ab7f6[_0x16aa('0x138')],_0x3ab7f6[_0x16aa('0x69')],undefined,_0xb9cd12);if(_0x2b5837[_0x16aa('0xa2')]!==-0x1){this[_0x16aa('0xe')][_0x16aa('0xaa')](util['format'](_0x16aa('0x14c'),_0xa902c9));var _0x4b372e=this[_0x16aa('0x83')][_0x16aa('0x71')](this,_0x3ab7f6,_0xa902c9);if(_0x4b372e){for(var _0x412136 in _0x4b372e){if(_0x4b372e[_0x16aa('0x94')](_0x412136)){this[_0x16aa('0xe')][_0x16aa('0x9d')](util[_0x16aa('0x2a')]('ISPEECH_ASR_%s',_0x412136[_0x16aa('0xe9')]()),_0x4b372e[_0x412136]);}}return this[_0x16aa('0xe')][_0x16aa('0xaa')](util[_0x16aa('0x2a')](_0x16aa('0x14d'),JSON[_0x16aa('0x74')](_0x4b372e)));}}return _0x2b5837;};AGIVertices[_0x16aa('0x11')][_0x16aa('0x14e')]=function(_0x3d45a1){logger[_0x16aa('0x31')](util[_0x16aa('0x2a')]('Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block',_0x3d45a1[_0x16aa('0xa9')]));if(!this[_0x16aa('0x85')](_0x3d45a1[_0x16aa('0x8f')])){return this[_0x16aa('0xe')][_0x16aa('0xaa')](_0x16aa('0xe6'));}if(!this[_0x16aa('0x85')](_0x3d45a1[_0x16aa('0x5d')])){return this[_0x16aa('0xe')][_0x16aa('0xaa')](_0x16aa('0xab'));}this['channel'][_0x16aa('0xaa')](util[_0x16aa('0x2a')](_0x16aa('0x14f'),_0x3d45a1[_0x16aa('0x5d')]));var _0x496288=this[_0x16aa('0x80')][_0x16aa('0x71')](this,_0x3d45a1);if(_0x496288){this[_0x16aa('0xe')][_0x16aa('0xaa')](util['format']('ispeech\x20%s\x20file\x20created',_0x496288));var _0x1538f9=this[_0x16aa('0xe')][_0x16aa('0x101')](_0x496288,_0x3d45a1[_0x16aa('0x138')]);try{fs[_0x16aa('0x123')](_0x496288+_0x16aa('0x102'));}catch(_0x4a081f){logger['error'](_0x4a081f);}return _0x1538f9;}return this[_0x16aa('0xe')][_0x16aa('0x2d')](_0x3d45a1,_0x16aa('0x150'));};AGIVertices[_0x16aa('0x11')][_0x16aa('0x151')]=function(_0x3d89cd){logger['info'](util[_0x16aa('0x2a')](_0x16aa('0x152'),_0x3d89cd[_0x16aa('0xa9')]));if(!this[_0x16aa('0x85')](_0x3d89cd[_0x16aa('0x153')])){return this[_0x16aa('0xe')]['error'](_0x3d89cd,_0x16aa('0x154'));}logger['info'](util[_0x16aa('0x2a')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x16aa('0xe')][_0x16aa('0x3a')],_0x3d89cd[_0x16aa('0x153')]));var _0x1c602d=this[_0x16aa('0x55')]['sync'](this,_0x3d89cd[_0x16aa('0x153')]);if(_0x1c602d){logger['info'](util[_0x16aa('0x2a')](_0x16aa('0x155'),this['channel'][_0x16aa('0x3a')],_0x3d89cd['findBy']));this['channel']['noop'](util[_0x16aa('0x2a')](_0x16aa('0x155'),this[_0x16aa('0xe')][_0x16aa('0x3a')],_0x3d89cd[_0x16aa('0x153')]));return{'code':0xc8,'result':_0x16aa('0x156')};}else{logger[_0x16aa('0x31')](util[_0x16aa('0x2a')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x16aa('0xe')][_0x16aa('0x3a')],_0x3d89cd['findBy']));this[_0x16aa('0xe')][_0x16aa('0xaa')](util['format'](_0x16aa('0x157'),this[_0x16aa('0xe')]['callerid'],_0x3d89cd[_0x16aa('0x153')]));return{'code':0xc8,'result':_0x16aa('0x158')};}};AGIVertices['prototype'][_0x16aa('0x159')]=function(_0x86356d){logger[_0x16aa('0x31')](util[_0x16aa('0x2a')](_0x16aa('0x15a'),_0x86356d['label']));if(!this['isConfigured'](_0x86356d['findBy'])){return this[_0x16aa('0xe')][_0x16aa('0x2d')](_0x86356d,_0x16aa('0x154'));}logger[_0x16aa('0x31')](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x16aa('0xe')][_0x16aa('0x3a')],_0x86356d['findBy']));var _0x266969=this[_0x16aa('0x54')][_0x16aa('0x71')](this,_0x86356d[_0x16aa('0x153')]);if(_0x266969){logger['info'](util[_0x16aa('0x2a')](_0x16aa('0x155'),this['channel'][_0x16aa('0x3a')],_0x86356d[_0x16aa('0x153')]));this['channel']['noop'](util[_0x16aa('0x2a')](_0x16aa('0x155'),this[_0x16aa('0xe')][_0x16aa('0x3a')],_0x86356d[_0x16aa('0x153')]));return{'code':0xc8,'result':'success'};}else{logger[_0x16aa('0x31')](util[_0x16aa('0x2a')](_0x16aa('0x157'),this['channel'][_0x16aa('0x3a')],_0x86356d[_0x16aa('0x153')]));this[_0x16aa('0xe')][_0x16aa('0xaa')](util[_0x16aa('0x2a')](_0x16aa('0x157'),this['channel'][_0x16aa('0x3a')],_0x86356d[_0x16aa('0x153')]));return{'code':0xc8,'result':_0x16aa('0x158')};}};AGIVertices[_0x16aa('0x11')]['math']=function(_0x28709a){logger[_0x16aa('0x31')](util[_0x16aa('0x2a')](_0x16aa('0x15b'),_0x28709a['label']));if(!this[_0x16aa('0x85')](_0x28709a[_0x16aa('0x15c')])){return this[_0x16aa('0xe')][_0x16aa('0x2d')](_0x28709a,'no\x20operation\x20configured');}this['channel'][_0x16aa('0xaa')](util[_0x16aa('0x2a')](_0x16aa('0x15d'),_0x28709a[_0x16aa('0x15c')]));var _0x24453d=eval(_0x28709a[_0x16aa('0x15c')]);if(!this[_0x16aa('0x85')](_0x28709a['variable_id'])){return this['channel']['noop']('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x54da73=this[_0x16aa('0x12')][_0x16aa('0x71')](this,_0x28709a[_0x16aa('0xd9')]);if(!_0x54da73){return this[_0x16aa('0xe')][_0x16aa('0x2d')](_0x28709a,_0x16aa('0xda'));}if(_[_0x16aa('0x99')](_0x24453d)){var _0xd20d65=this;_0x24453d[_0x16aa('0xdb')](function(_0x16b0c6,_0x37c7db){_0xd20d65['channel'][_0x16aa('0x9d')](util['format'](_0x16aa('0x15e'),_0x54da73,_0x37c7db),_0x16b0c6);});return this[_0x16aa('0xe')][_0x16aa('0xaa')](util[_0x16aa('0x2a')]('variable\x20%s[key]\x20set',_0x54da73));}else{return this[_0x16aa('0xe')][_0x16aa('0x9d')](_0x54da73,_0x24453d);}};AGIVertices[_0x16aa('0x11')][_0x16aa('0xd')]=function(_0xd092){logger['info'](util['format'](_0x16aa('0x15f'),_0xd092['label']));if(_0xd092[_0x16aa('0xa6')]===0x0){return this[_0x16aa('0xa5')](_0xd092);}_0xd092[_0x16aa('0xa6')]-=0x1;if(!this[_0x16aa('0x85')](_0xd092[_0x16aa('0x10d')])){return this[_0x16aa('0xe')][_0x16aa('0x2d')](_0xd092,_0x16aa('0x10e'));}var _0x31ad55=this[_0x16aa('0x10f')][_0x16aa('0x71')](this,_0xd092[_0x16aa('0x10d')]);if(!_0x31ad55){return this[_0x16aa('0xe')][_0x16aa('0x2d')](_0xd092,_0x16aa('0x110'));}var _0x1960e7=this['channel'][_0x16aa('0x112')](_0x31ad55,_0xd092[_0x16aa('0x113')],_0xd092[_0x16aa('0x160')]);var _0x748d13=_0x1960e7[_0x16aa('0xa2')];if(_0x1960e7[_0x16aa('0xa2')]===-0x1){this[_0x16aa('0x37')]['sync'](this,_0xd092,'-1');return _0x1960e7;}else if(_0x1960e7[_0x16aa('0xa4')]===_0x16aa('0x69')){_0x1960e7[_0x16aa('0xa2')]=_0x1960e7[_0x16aa('0xa2')][_0x16aa('0x9a')]>0x0?_0x1960e7[_0x16aa('0xa2')]:'t';}else if(_['isEmpty'](_0x1960e7['result'])){_0x1960e7['result']='#';_0x748d13='#';}if(!this[_0x16aa('0x85')](_0xd092[_0x16aa('0xd9')])){this['channel'][_0x16aa('0xaa')](_0x16aa('0x111'));}else{var _0x145507=this['getVariable'][_0x16aa('0x71')](this,_0xd092[_0x16aa('0xd9')]);if(!_0x145507){return this[_0x16aa('0xe')]['error'](_0xd092,_0x16aa('0xda'));}this['channel'][_0x16aa('0x9d')](_0x145507,_0x748d13);}this['createSquareDetailsReport']['sync'](this,_0xd092,_0x748d13);return _0x1960e7;};AGIVertices[_0x16aa('0x11')][_0x16aa('0xaa')]=function(_0x214bf2){logger[_0x16aa('0x31')](util[_0x16aa('0x2a')](_0x16aa('0x161'),_0x214bf2[_0x16aa('0xa9')]));return this[_0x16aa('0xe')][_0x16aa('0xaa')](_0x214bf2[_0x16aa('0x162')]||_0x214bf2[_0x16aa('0xa9')]);};AGIVertices[_0x16aa('0x11')]['pause']=function(_0x3ee0b9){logger[_0x16aa('0x31')](util[_0x16aa('0x2a')](_0x16aa('0x163'),_0x3ee0b9[_0x16aa('0xa9')]));if(!this[_0x16aa('0x85')](_0x3ee0b9['findBy'])){return this['channel'][_0x16aa('0x2d')](_0x3ee0b9,'no\x20find\x20by\x20configured');}logger['info'](util[_0x16aa('0x2a')](_0x16aa('0x164'),this[_0x16aa('0xe')][_0x16aa('0x3a')],_0x3ee0b9['findBy']));var _0x30853a=this[_0x16aa('0x4f')][_0x16aa('0x71')](this,_0x3ee0b9['pause_id']);var _0x5381fd=this[_0x16aa('0x51')][_0x16aa('0x71')](this,_0x3ee0b9[_0x16aa('0x153')],_0x30853a);if(_0x5381fd){logger['info'](util['format']('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x16aa('0x3a')],_0x3ee0b9[_0x16aa('0x153')]));this[_0x16aa('0xe')][_0x16aa('0xaa')](util[_0x16aa('0x2a')](_0x16aa('0x155'),this[_0x16aa('0xe')]['callerid'],_0x3ee0b9[_0x16aa('0x153')]));return{'code':0xc8,'result':_0x16aa('0x156')};}else{logger['info'](util[_0x16aa('0x2a')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel']['callerid'],_0x3ee0b9[_0x16aa('0x153')]));this['channel'][_0x16aa('0xaa')](util['format'](_0x16aa('0x155'),this[_0x16aa('0xe')]['callerid'],_0x3ee0b9['findBy']));return{'code':0xc8,'result':_0x16aa('0x158')};}};AGIVertices['prototype'][_0x16aa('0x165')]=function(_0x5a11ab){logger[_0x16aa('0x31')](util[_0x16aa('0x2a')](_0x16aa('0x166'),_0x5a11ab[_0x16aa('0xa9')]));if(!this[_0x16aa('0x85')](_0x5a11ab[_0x16aa('0x10d')])){return this[_0x16aa('0xe')][_0x16aa('0x2d')](_0x5a11ab,_0x16aa('0x10e'));}var _0xa35b74=this['getSound']['sync'](this,_0x5a11ab[_0x16aa('0x10d')]);if(!_0xa35b74){return this['channel']['error'](_0x5a11ab,_0x16aa('0x110'));}var _0x583ee2=this[_0x16aa('0xe')][_0x16aa('0xac')]('PLAYBACK',[_0xa35b74,_0x5a11ab[_0x16aa('0xe3')]]);if(_0x583ee2[_0x16aa('0xa2')]===-0x1){return _0x583ee2;}return this[_0x16aa('0xe')]['noop'](util[_0x16aa('0x2a')]('Executed\x20command\x20%s\x20%s','PLAYBACK',_0xa35b74));};AGIVertices[_0x16aa('0x11')]['queue']=function(_0x2c2244){logger[_0x16aa('0x31')](util['format'](_0x16aa('0x167'),_0x2c2244[_0x16aa('0xa9')]));if(!this[_0x16aa('0x85')](_0x2c2244[_0x16aa('0x168')])){return this[_0x16aa('0xe')]['error'](_0x2c2244,_0x16aa('0x169'));}var _0x39f81c='';var _0x48eda6=parseInt(_0x2c2244[_0x16aa('0x168')],0xa);if(isNaN(_0x48eda6)){_0x39f81c=_0x2c2244[_0x16aa('0x168')];}else{_0x39f81c=this[_0x16aa('0x17')][_0x16aa('0x71')](this,_0x2c2244[_0x16aa('0x168')]);if(!_0x39f81c){return this[_0x16aa('0xe')][_0x16aa('0x2d')](_0x2c2244,_0x16aa('0x16a'));}}var _0x58a540='';if(this[_0x16aa('0x85')](_0x2c2244[_0x16aa('0x10d')])){var _0x1cdf67=this[_0x16aa('0x10f')]['sync'](this,_0x2c2244[_0x16aa('0x10d')]);if(_0x1cdf67){_0x58a540=_0x1cdf67;}}this['createSquareDetailsReport']['sync'](this,_0x2c2244,_0x39f81c);if(_0x2c2244[_0x16aa('0xe3')][_0x16aa('0x16b')]('x')<0x0){_0x2c2244['opts']+='x';}if(_0x2c2244[_0x16aa('0xe3')][_0x16aa('0x16b')]('X')<0x0){_0x2c2244[_0x16aa('0xe3')]+='X';}this[_0x16aa('0xe')][_0x16aa('0x9d')](_0x16aa('0x16c'),_0x39f81c?_0x39f81c[_0x16aa('0x16d')]():'');var _0x2479d9=this[_0x16aa('0xe')]['exec'](_0x16aa('0x16e'),[_0x39f81c,_0x2c2244[_0x16aa('0xe3')],_0x2c2244['url'],_0x58a540,_0x2c2244[_0x16aa('0x69')],_0x2c2244[_0x16aa('0x7')],_0x2c2244[_0x16aa('0x16f')],_0x2c2244[_0x16aa('0x170')],'',_0x2c2244[_0x16aa('0x171')]]);if(_0x2479d9[_0x16aa('0xa2')]===-0x1){return _0x2479d9;}return this['channel'][_0x16aa('0xaa')](util['format']('Executed\x20command\x20%s\x20%s',_0x16aa('0x16e'),_0x39f81c));};AGIVertices['prototype'][_0x16aa('0x172')]=function(_0x44319b){logger['info'](util[_0x16aa('0x2a')](_0x16aa('0x173'),_0x44319b[_0x16aa('0xa9')]));var _0x7853bf=_0x44319b[_0x16aa('0x174')]||_0x16aa('0x12f');var _0x4e13b7=util['format'](_0x16aa('0x175'),this[_0x16aa('0xe')][_0x16aa('0x3c')],rs['generate'](0x5));var _0x216cba=util['format'](_0x16aa('0x176'),FILES_PATH,_0x4e13b7,_0x7853bf);var _0x4d7063=util[_0x16aa('0x2a')](_0x16aa('0x177'),FILES_PATH,_0x4e13b7);this['createSquareRecording'][_0x16aa('0x71')](this,_0x44319b,_0x4e13b7,_0x216cba);this[_0x16aa('0xe')][_0x16aa('0x9d')]('RECORDING_SAVENAME',_0x4e13b7);logger[_0x16aa('0x31')](_0x16aa('0x178'),_0x4d7063,_0x7853bf,_0x44319b['escape_digits'],_0x44319b[_0x16aa('0x69')]);return this[_0x16aa('0xe')]['recordFile'](_0x4d7063,_0x7853bf,_0x44319b[_0x16aa('0x179')],_0x44319b[_0x16aa('0x69')],undefined,!![]);};AGIVertices[_0x16aa('0x11')][_0x16aa('0x17a')]=function(_0x5a18d5){logger[_0x16aa('0x31')](util[_0x16aa('0x2a')]('Enter\x20in\x20RESTAPI\x20(%s)\x20block',_0x5a18d5[_0x16aa('0xa9')]));if(!this[_0x16aa('0x85')](_0x5a18d5[_0x16aa('0x66')])){return this[_0x16aa('0xe')][_0x16aa('0xaa')](_0x16aa('0x17b'));}var _0x1c7949=this[_0x16aa('0x65')][_0x16aa('0x71')](this,_0x5a18d5);logger[_0x16aa('0x31')](util[_0x16aa('0x2a')]('Response:',util[_0x16aa('0x17c')](_0x1c7949,{'showHidden':![],'depth':null})));if(!this[_0x16aa('0x85')](_0x5a18d5[_0x16aa('0xd9')])){return this[_0x16aa('0xe')][_0x16aa('0xaa')](_0x16aa('0x17d'));}var _0x5c06b5=this[_0x16aa('0x12')][_0x16aa('0x71')](this,_0x5a18d5[_0x16aa('0xd9')]);if(!_0x5c06b5){return this[_0x16aa('0xe')][_0x16aa('0x2d')](_0x5a18d5,'no\x20variable\x20found');}this['channel'][_0x16aa('0x9d')](util[_0x16aa('0x2a')](_0x16aa('0x17e'),_0x5c06b5),_0x1c7949['statusCode']?_0x1c7949[_0x16aa('0x76')]:'200');this[_0x16aa('0xe')][_0x16aa('0x9d')](util['format']('%s_STATUS_MESSAGE',_0x5c06b5),_0x1c7949[_0x16aa('0x17f')]?_0x1c7949[_0x16aa('0x17f')]:'OK');if(_0x1c7949[_0x16aa('0x6c')]){try{this[_0x16aa('0x9b')](_0x1c7949[_0x16aa('0x6c')],_0x5c06b5);}catch(_0x40754e){logger[_0x16aa('0x2d')](util[_0x16aa('0x2a')]('Unable\x20to\x20set\x20result\x20in\x20variable\x20%s',_0x5c06b5));}}return this['channel'][_0x16aa('0xaa')](util[_0x16aa('0x2a')]('variable\x20%s\x20set',_0x5c06b5));};AGIVertices[_0x16aa('0x11')][_0x16aa('0x180')]=function(_0x4998c2){logger['info'](util[_0x16aa('0x2a')](_0x16aa('0x181'),_0x4998c2['label']));return this[_0x16aa('0xe')]['sayDigits'](_0x4998c2[_0x16aa('0x182')][_0x16aa('0x5a')](/\s+/g,''),_0x4998c2['escape_digits']);};AGIVertices[_0x16aa('0x11')][_0x16aa('0x183')]=function(_0x2b57c5){logger['info'](util['format'](_0x16aa('0x184'),_0x2b57c5[_0x16aa('0xa9')]));return this[_0x16aa('0xe')][_0x16aa('0x185')](_0x2b57c5['number']['replace'](/\s+/g,''),_0x2b57c5['escape_digits']);};AGIVertices[_0x16aa('0x11')][_0x16aa('0x186')]=function(_0x2e3d36){logger[_0x16aa('0x31')](util['format'](_0x16aa('0x187'),_0x2e3d36['label']));return this[_0x16aa('0xe')]['sayPhonetic'](_0x2e3d36[_0x16aa('0x5d')],_0x2e3d36['escape_digits']);};AGIVertices[_0x16aa('0x11')][_0x16aa('0x188')]=function(_0x3d1e57){logger[_0x16aa('0x31')](util['format'](_0x16aa('0x189'),_0x3d1e57[_0x16aa('0xa9')]));if(!this['isConfigured'](_0x3d1e57[_0x16aa('0x18a')])){return this[_0x16aa('0xe')][_0x16aa('0xaa')]('no\x20mail\x20account\x20configured');}var _0x42e665=this[_0x16aa('0x22')]['sync'](this,_0x3d1e57[_0x16aa('0x18a')]);if(!_0x42e665||!_0x42e665[_0x16aa('0x18b')]){return this[_0x16aa('0xe')][_0x16aa('0x2d')](_0x3d1e57,_0x16aa('0x18c'));}var _0x2a86e4={'from':util[_0x16aa('0x2a')](_0x16aa('0x18d'),_0x42e665[_0x16aa('0x15')],_0x42e665[_0x16aa('0x18e')]||_0x42e665[_0x16aa('0x18b')][_0x16aa('0x18f')]),'to':_0x3d1e57['to']||'','cc':_0x3d1e57['cc']||'','bcc':_0x3d1e57[_0x16aa('0x190')]||'','subject':_0x3d1e57[_0x16aa('0x191')],'html':_0x3d1e57[_0x16aa('0x5d')],'text':_0x3d1e57[_0x16aa('0x5d')]};var _0x5c65b3={'tls':{'rejectUnauthorized':![]}};if(_0x42e665[_0x16aa('0x18b')][_0x16aa('0x192')]){_0x5c65b3[_0x16aa('0x192')]=_0x42e665[_0x16aa('0x18b')][_0x16aa('0x192')];}else{_0x5c65b3['host']=_0x42e665[_0x16aa('0x18b')][_0x16aa('0x193')];_0x5c65b3[_0x16aa('0x194')]=_0x42e665['Smtp']['port'];_0x5c65b3[_0x16aa('0x195')]=_0x42e665[_0x16aa('0x18b')]['secure'];}if(_0x42e665[_0x16aa('0x18b')][_0x16aa('0x196')]){_0x5c65b3['auth']={'user':_0x42e665['Smtp'][_0x16aa('0x18f')],'pass':_0x42e665[_0x16aa('0x18b')][_0x16aa('0x197')]};}if(this[_0x16aa('0x85')](_0x3d1e57[_0x16aa('0x198')])){}logger[_0x16aa('0xdf')](_0x16aa('0x199'),JSON[_0x16aa('0x74')](_0x2a86e4));this['createSquareDetailsReport'][_0x16aa('0x71')](this,_0x3d1e57,_0x3d1e57[_0x16aa('0x18a')]);this['channel']['noop'](util[_0x16aa('0x2a')](_0x16aa('0x19a'),_0x42e665['name']));this['sendMailMessage'][_0x16aa('0x71')](this,_0x5c65b3,_0x2a86e4);return this[_0x16aa('0xe')]['noop'](_0x16aa('0x19b'));};AGIVertices['prototype']['sendFax']=function(_0x2a95d8){logger[_0x16aa('0x31')](util[_0x16aa('0x2a')](_0x16aa('0x19c'),_0x2a95d8[_0x16aa('0xa9')]));return this[_0x16aa('0xe')][_0x16aa('0xaa')](_0x16aa('0x19d'));};AGIVertices['prototype']['sendSMS']=function(_0x12852a){logger[_0x16aa('0x31')](util[_0x16aa('0x2a')](_0x16aa('0x19e'),_0x12852a['label']));if(!this[_0x16aa('0x85')](_0x12852a['sms_account_id'])){return this[_0x16aa('0xe')]['noop'](_0x16aa('0x19f'));}var _0x244a0c=this[_0x16aa('0x34')][_0x16aa('0x71')](this,_0x12852a[_0x16aa('0x1a0')]);if(!_0x244a0c){return this[_0x16aa('0xe')][_0x16aa('0x2d')](_0x12852a,_0x16aa('0x1a1'));}var _0x1da3e4={'body':_0x12852a['sms_text'],'phone':_0x12852a['to']||'','SmsAccountId':_0x244a0c['id']};logger[_0x16aa('0xdf')](_0x16aa('0x1a2'),JSON[_0x16aa('0x74')](_0x1da3e4));this[_0x16aa('0x37')]['sync'](this,_0x12852a,_0x12852a[_0x16aa('0x1a0')]);this['channel']['noop'](util[_0x16aa('0x2a')](_0x16aa('0x1a3'),_0x244a0c[_0x16aa('0x15')]));this[_0x16aa('0x36')][_0x16aa('0x71')](this,_0x1da3e4);return this[_0x16aa('0xe')][_0x16aa('0xaa')](_0x16aa('0x1a4'));};AGIVertices[_0x16aa('0x11')][_0x16aa('0x1a5')]=function(_0x43dad8){logger[_0x16aa('0x31')](util[_0x16aa('0x2a')](_0x16aa('0x1a6'),_0x43dad8[_0x16aa('0xa9')]));if(!this[_0x16aa('0x85')](_0x43dad8[_0x16aa('0xd9')])){return this[_0x16aa('0xe')][_0x16aa('0x2d')](_0x43dad8,'no\x20variable\x20selected');}var _0x4efed9=this[_0x16aa('0x12')][_0x16aa('0x71')](this,_0x43dad8[_0x16aa('0xd9')]);if(!_0x4efed9){return this[_0x16aa('0xe')]['error'](_0x43dad8,_0x16aa('0xda'));}return this[_0x16aa('0xe')]['setVariable'](_0x4efed9,_0x43dad8[_0x16aa('0x1a7')]);};AGIVertices['prototype']['start']=function(_0x385f84){logger[_0x16aa('0x31')](util[_0x16aa('0x2a')](_0x16aa('0x1a8'),_0x385f84[_0x16aa('0xa9')]));this[_0x16aa('0xe')][_0x16aa('0xaa')](_0x16aa('0x1a9'));if(_0x385f84['answer']===_0x16aa('0x1aa')){this['channel'][_0x16aa('0xaa')](_0x16aa('0x1ab'));return this[_0x16aa('0xe')][_0x16aa('0xba')]();}return this[_0x16aa('0xe')]['noop'](_0x16aa('0x1ac'));};AGIVertices[_0x16aa('0x11')][_0x16aa('0x1ad')]=function(_0xed51bd){logger[_0x16aa('0x31')](util[_0x16aa('0x2a')]('Enter\x20in\x20SUBPROJECT\x20(%s)\x20block',_0xed51bd[_0x16aa('0xa9')]));if(!this[_0x16aa('0x85')](_0xed51bd[_0x16aa('0x1ae')])){return this[_0x16aa('0xe')][_0x16aa('0x2d')](_0xed51bd,_0x16aa('0x1af'));}var _0x53da30=this[_0x16aa('0x19')]['sync'](this,_0xed51bd[_0x16aa('0x1ae')]);if(!this['isConfigured'](_0x53da30)){return this[_0x16aa('0xe')][_0x16aa('0x2d')](_0xed51bd,util[_0x16aa('0x2a')](_0x16aa('0x1b0'),_0xed51bd[_0x16aa('0x1ae')]));}if(_0x53da30===this[_0x16aa('0xe')][_0x16aa('0x39')]){return this['channel'][_0x16aa('0x2d')](_0xed51bd,_0x16aa('0x1b1'));}this['createSquareDetailsReport']['sync'](this,_0xed51bd,_0x53da30);var _0x22af03=this[_0x16aa('0xe')]['exec'](_0x16aa('0x1b2'),util['format']('agi://%s/square,\x22%s\x22,\x22%s\x22',config['agi'][_0x16aa('0x193')]||_0x16aa('0x1b3'),_0x53da30,this['channel'][_0x16aa('0x39')]));if(_0x22af03['result']===-0x1){return _0x22af03;}return this['channel'][_0x16aa('0xaa')](util[_0x16aa('0x2a')](_0x16aa('0xc6'),'AGI',_0x53da30));};AGIVertices[_0x16aa('0x11')][_0x16aa('0x1b4')]=function(_0x154694){logger[_0x16aa('0x31')](util[_0x16aa('0x2a')]('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x154694[_0x16aa('0xa9')]));var _0x5d8e10=this[_0x16aa('0x1b5')]['sync'](this,_0x154694[_0x16aa('0x1b6')]);this[_0x16aa('0x37')]['sync'](this,_0x154694,_0x154694[_0x16aa('0x1b6')]);if(this[_0x16aa('0x85')](_0x154694['variable_id'])){var _0x5996cf=this[_0x16aa('0x12')][_0x16aa('0x71')](this,_0x154694[_0x16aa('0xd9')]);if(_0x5996cf){this[_0x16aa('0xe')][_0x16aa('0x9d')](_0x5996cf,_0x5d8e10);return this[_0x16aa('0xe')][_0x16aa('0xaa')](util[_0x16aa('0x2a')]('sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s',_0x154694[_0x16aa('0x1b6')],_0x5996cf));}}return this[_0x16aa('0xe')]['noop'](util[_0x16aa('0x2a')](_0x16aa('0x1b7'),_0x154694['command']));};AGIVertices[_0x16aa('0x11')][_0x16aa('0x1b8')]=function(_0x4d7e65){logger[_0x16aa('0x31')](util[_0x16aa('0x2a')](_0x16aa('0x1b9'),_0x4d7e65[_0x16aa('0xa9')]));_0x4d7e65[_0x16aa('0x5d')]=_0x4d7e65['text'][_0x16aa('0x5a')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x4d7e65[_0x16aa('0x5c')])){return this[_0x16aa('0xe')]['noop']('no\x20apiKey\x20configured');}if(!this[_0x16aa('0x85')](_0x4d7e65[_0x16aa('0x5d')])){return this[_0x16aa('0xe')][_0x16aa('0xaa')](_0x16aa('0xab'));}this['channel']['noop'](util[_0x16aa('0x2a')](_0x16aa('0x1ba'),_0x4d7e65[_0x16aa('0x5d')]));var _0x22267f=this[_0x16aa('0x5b')]['sync'](this,_0x4d7e65);if(_0x22267f){this[_0x16aa('0xe')][_0x16aa('0xaa')](util[_0x16aa('0x2a')](_0x16aa('0x1bb'),_0x22267f));var _0x545119=this[_0x16aa('0xe')]['streamFile'](_0x22267f);try{fs[_0x16aa('0x123')](_0x22267f+_0x16aa('0x102'));}catch(_0x41b96c){logger[_0x16aa('0x2d')](_0x41b96c);}return _0x545119;}return this[_0x16aa('0xe')]['error'](_0x4d7e65,'Google\x20Cloud\x20TTS\x20is\x20unreachable');};AGIVertices['prototype']['tts']=function(_0x48c3b8){logger[_0x16aa('0x31')](util['format'](_0x16aa('0x1bc'),_0x48c3b8[_0x16aa('0xa9')]));_0x48c3b8[_0x16aa('0x5d')]=_0x48c3b8[_0x16aa('0x5d')][_0x16aa('0x5a')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x16aa('0x85')](_0x48c3b8['text'])){return this[_0x16aa('0xe')][_0x16aa('0xaa')](_0x16aa('0xab'));}this[_0x16aa('0xe')][_0x16aa('0xaa')](util['format'](_0x16aa('0x1bd'),_0x48c3b8[_0x16aa('0x5d')]));var _0x2b48ae=this[_0x16aa('0x64')][_0x16aa('0x71')](this,_0x48c3b8);if(_0x2b48ae){this[_0x16aa('0xe')][_0x16aa('0xaa')](util[_0x16aa('0x2a')](_0x16aa('0x1be'),_0x2b48ae));var _0x15b63c=this[_0x16aa('0xe')][_0x16aa('0x101')](_0x2b48ae);try{fs[_0x16aa('0x123')](_0x2b48ae+'.wav');}catch(_0x4da5ec){logger[_0x16aa('0x2d')](_0x4da5ec);}return _0x15b63c;}return this[_0x16aa('0xe')][_0x16aa('0x2d')](_0x48c3b8,'Google\x20TTS\x20is\x20unreachable');};AGIVertices[_0x16aa('0x11')][_0x16aa('0x1bf')]=function(_0x3462b1){logger[_0x16aa('0x31')](util[_0x16aa('0x2a')](_0x16aa('0x1c0'),_0x3462b1[_0x16aa('0xa9')]));if(!this['isConfigured'](_0x3462b1[_0x16aa('0x153')])){return this[_0x16aa('0xe')][_0x16aa('0x2d')](_0x3462b1,'no\x20find\x20by\x20configured');}logger[_0x16aa('0x31')](util[_0x16aa('0x2a')](_0x16aa('0x164'),this['channel']['callerid'],_0x3462b1[_0x16aa('0x153')]));var _0x599841=this[_0x16aa('0x53')][_0x16aa('0x71')](this,_0x3462b1[_0x16aa('0x153')]);if(_0x599841){logger['info'](util[_0x16aa('0x2a')](_0x16aa('0x155'),this['channel'][_0x16aa('0x3a')],_0x3462b1[_0x16aa('0x153')]));this[_0x16aa('0xe')]['noop'](util[_0x16aa('0x2a')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x16aa('0xe')][_0x16aa('0x3a')],_0x3462b1[_0x16aa('0x153')]));return{'code':0xc8,'result':_0x16aa('0x156')};}else{logger[_0x16aa('0x31')](util['format'](_0x16aa('0x157'),this[_0x16aa('0xe')][_0x16aa('0x3a')],_0x3462b1[_0x16aa('0x153')]));this[_0x16aa('0xe')]['noop'](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0x16aa('0x3a')],_0x3462b1[_0x16aa('0x153')]));return{'code':0xc8,'result':_0x16aa('0x158')};}};AGIVertices[_0x16aa('0x11')]['voicemail']=function(_0x4f6078){logger[_0x16aa('0x31')](util[_0x16aa('0x2a')]('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x4f6078[_0x16aa('0xa9')]));var _0x3a442e=this[_0x16aa('0xe')][_0x16aa('0xac')](_0x16aa('0x1c1'),[_0x4f6078[_0x16aa('0x1c2')],_0x4f6078[_0x16aa('0x79')]]);if(_0x3a442e[_0x16aa('0xa2')]===-0x1){return _0x3a442e;}return this[_0x16aa('0xe')]['noop'](util['format'](_0x16aa('0xc6'),_0x16aa('0x1c1'),_0x4f6078[_0x16aa('0x1c2')]));};AGIVertices[_0x16aa('0x11')][_0x16aa('0x1c3')]=function(_0x296af7){logger[_0x16aa('0x31')](util[_0x16aa('0x2a')](_0x16aa('0x1c4'),_0x296af7[_0x16aa('0xa9')]));if(!this[_0x16aa('0x85')](_0x296af7[_0x16aa('0xd9')])){return this[_0x16aa('0xe')][_0x16aa('0x2d')](_0x296af7,_0x16aa('0x1c5'));}var _0x5e1f98=this[_0x16aa('0x12')][_0x16aa('0x71')](this,_0x296af7[_0x16aa('0xd9')]);if(!_0x5e1f98){return this[_0x16aa('0xe')][_0x16aa('0x2d')](_0x296af7,'no\x20variable\x20found');}var _0x2f8521=this[_0x16aa('0xe')][_0x16aa('0x12')](_0x5e1f98);return{'code':0xc8,'result':_0x2f8521[_0x16aa('0xa4')]?_0x2f8521[_0x16aa('0xa4')]:'-'};};String['prototype'][_0x16aa('0xa0')]=function(_0x1b0379,_0x47036f){return this[_0x16aa('0x9f')](_0x1b0379)[_0x16aa('0x1c6')](_0x47036f);};module[_0x16aa('0x1c7')]=AGIVertices; \ No newline at end of file +var _0x75ab=['getSquareProject','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','AGI','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','Enter\x20in\x20SWITCH\x20(%s)\x20block','no\x20variable\x20selected','replaceAll','exports','path','util','lodash','shelljs','odbc','moment','request-promise','../../config/logger','agi','../../config/environment','./scripts','/var/opt/motion2/server/files','rawHeaders','getdigits','channel','rpc','mailRpc','prototype','getVariable','getVariableById','then','name','catch','getVoiceQueueById','getSquareProjectById','getSquareOdbc','getUserById','getTrunk','getSoundById','getSoundPath','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','IntervalId','map','Intervals','interval','format','%s/sounds/converted/%s','getQueryOdbc','error','Error\x20getting\x20ODBC\x20connection\x20%s','ODBC\x20connection\x20successfully','info','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','arg_1','callerid','createSquareRecording','calleridname','priority','accountcode','dnid','createSquareMessage','createCmContact','isEmpty','isNil','lastName','phone','list_id','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','agentLogin','LOCAL','shellCommand','trim','replace','googleCloudTTS','apiKey','text','languageCode','en-US','ssmlGender','audioEncoding','googleTTS','google_tts_language','restAPI','url','method','timeout','number','body','rawBody','parse','headers','computedVariables','sync','uri','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','dialogflowV2_language','ispeechTTS','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','Amy','awsLex','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','appsecret','clear','includes','agicommand','hasOwnProperty','replaceObjectAllVariables','replaceAllVariables','isPlainObject','recursiveNodeIndex','length','isString','saveRestApiResult','%s.%s','setVariable','split','extra','getAndSetVariable','result','maxRetry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','exec','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','answer','callback','no\x20list\x20selected','scheduledAt','add','delay','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','Executed\x20command\x20%s\x20%s','application','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','no\x20grammar\x20configured','LUMENVOX_ASR_TRANSCRIPT','Executed\x20command\x20MRCPRecog\x20%s','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','no\x20odbc\x20database\x20found','query','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','getUser','no\x20user\x20found','DIAL','SIP/%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','toUpperCase','speech','out','Dialogflow\x20Result\x20%s','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','Trying\x20DialogflowV2:\x20%s','providerResponse','DIALOGFLOW_%s','DialogflowV2\x20Result\x20%s','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','sestekNDA','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20found','trunk_name','no\x20trunk\x20selected','SIP/%s/%s','opts','Executed\x20command\x20%s','finally','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','retry','file_id','no\x20file\x20audio\x20selected','getSound','getData','response','test','mindigit','hiddendigitsnum','generate','first','substr','getsecretdigits','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','unlink','.wav','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','message','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','beep','NOBEEP','intKey','google\x20%s\x20file\x20created','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appsecret\x20configured','recordFile','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','context','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','true','false','EVAL\x20CONDITION\x20%s\x20%s','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','ispeechasr','ispeechtts','streamFile','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','success','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','isArray','%s[%s]','variable\x20%s[key]\x20set','menu','Enter\x20in\x20MENU\x20(%s)\x20block','no\x20file\x20audio\x20found','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','AGENT\x20%s\x20FOUND\x20BY','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','getVoiceQueue','no\x20queue\x20found','indexOf','toLowerCase','macro','gosub','position','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','no\x20mail\x20account\x20found','email','Smtp','subject','service','host','port','secure','authentication','auth','pass','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id'];(function(_0x344bba,_0x384a46){var _0x49cacc=function(_0x2390e8){while(--_0x2390e8){_0x344bba['push'](_0x344bba['shift']());}};_0x49cacc(++_0x384a46);}(_0x75ab,0x1eb));var _0xb75a=function(_0x1bf938,_0xf6f5f5){_0x1bf938=_0x1bf938-0x0;var _0x1f2b2f=_0x75ab[_0x1bf938];return _0x1f2b2f;};'use strict';var fs=require('fs');var path=require(_0xb75a('0x0'));var util=require(_0xb75a('0x1'));var _=require(_0xb75a('0x2'));var sh=require(_0xb75a('0x3'));var odbc=require(_0xb75a('0x4'))();var rs=require('randomstring');var moment=require(_0xb75a('0x5'));var Mustache=require('mustache');var rp=require(_0xb75a('0x6'));var logger=require(_0xb75a('0x7'))(_0xb75a('0x8'));var config=require(_0xb75a('0x9'));var scripts=require(_0xb75a('0xa'));var FILES_PATH=_0xb75a('0xb');var recursiveMapAttributes=[_0xb75a('0xc'),'rawBody'];var verticesWithRetry=['menu',_0xb75a('0xd'),'getsecretdigits'];var AGIVertices=function(_0x4ec30f,_0x490360,_0x5f3f9a){this[_0xb75a('0xe')]=_0x4ec30f;this[_0xb75a('0xf')]=_0x490360;this[_0xb75a('0x10')]=_0x5f3f9a;};AGIVertices[_0xb75a('0x11')][_0xb75a('0x12')]=function(_0x3537f2,_0x1157d6){this[_0xb75a('0xf')][_0xb75a('0x13')](_0x3537f2)[_0xb75a('0x14')](function(_0x1cfe2a){_0x1157d6(null,_0x1cfe2a?_0x1cfe2a[_0xb75a('0x15')]:![]);})[_0xb75a('0x16')](function(_0x1516fb){_0x1157d6(_0x1516fb);});};AGIVertices[_0xb75a('0x11')]['getVoiceQueue']=function(_0x1853c4,_0x15193e){this[_0xb75a('0xf')][_0xb75a('0x17')](_0x1853c4)[_0xb75a('0x14')](function(_0x5c196c){_0x15193e(null,_0x5c196c?_0x5c196c['name']:![]);})[_0xb75a('0x16')](function(_0x2efdbb){_0x15193e(_0x2efdbb);});};AGIVertices[_0xb75a('0x11')]['getSquareProject']=function(_0xa3e3ef,_0x51cc1b){this['rpc'][_0xb75a('0x18')](_0xa3e3ef)[_0xb75a('0x14')](function(_0x2c6b6f){_0x51cc1b(null,_0x2c6b6f?_0x2c6b6f[_0xb75a('0x15')]:![]);})[_0xb75a('0x16')](function(_0x5ee210){_0x51cc1b(_0x5ee210);});};AGIVertices[_0xb75a('0x11')][_0xb75a('0x19')]=function(_0x40b0de,_0x4f2cbe){this[_0xb75a('0xf')]['getSquareOdbcById'](_0x40b0de)[_0xb75a('0x14')](function(_0x1d54d0){_0x4f2cbe(null,_0x1d54d0?_0x1d54d0['dsn']:![]);})['catch'](function(_0x326f64){_0x4f2cbe(_0x326f64);});};AGIVertices['prototype']['getUser']=function(_0x315958,_0x5bd9a8){this[_0xb75a('0xf')][_0xb75a('0x1a')](_0x315958)[_0xb75a('0x14')](function(_0x302627){_0x5bd9a8(null,_0x302627?_0x302627['name']:![]);})[_0xb75a('0x16')](function(_0x3baddf){_0x5bd9a8(_0x3baddf);});};AGIVertices[_0xb75a('0x11')][_0xb75a('0x1b')]=function(_0x5eede9,_0x4555d1){this[_0xb75a('0xf')]['getTrunkById'](_0x5eede9)['then'](function(_0x3d5b9d){_0x4555d1(null,_0x3d5b9d?_0x3d5b9d[_0xb75a('0x15')]:![]);})['catch'](function(_0x212e1e){_0x4555d1(_0x212e1e);});};AGIVertices[_0xb75a('0x11')]['getSound']=function(_0x30efa1,_0x1d854d){var _0x4cc778=this;this['rpc'][_0xb75a('0x1c')](_0x30efa1)[_0xb75a('0x14')](function(_0x262d7d){_0x1d854d(null,_0x262d7d?_0x4cc778[_0xb75a('0x1d')](_0x262d7d[_0xb75a('0x1e')]):![]);})[_0xb75a('0x16')](function(_0x29407a){_0x1d854d(_0x29407a);});};AGIVertices['prototype'][_0xb75a('0x1f')]=function(_0x448e69,_0x42c750){this[_0xb75a('0xf')][_0xb75a('0x20')](_0x448e69)[_0xb75a('0x14')](function(_0x634450){_0x42c750(null,_0x634450?_0x634450:![]);})[_0xb75a('0x16')](function(_0x20c156){_0x42c750(_0x20c156);});};AGIVertices[_0xb75a('0x11')][_0xb75a('0x21')]=function(_0x4bead1,_0x26d167,_0x36f784){this[_0xb75a('0x10')][_0xb75a('0x21')](_0x4bead1,_0x26d167)[_0xb75a('0x14')](function(){_0x36f784(null);})[_0xb75a('0x16')](function(_0x234d0f){_0x36f784(_0x234d0f);});};AGIVertices['prototype'][_0xb75a('0x22')]=function(_0x2fdf32,_0x3a15b9){this[_0xb75a('0xf')][_0xb75a('0x23')](_0x2fdf32)[_0xb75a('0x14')](function(_0x3c79a5){if(_0x3c79a5){if(_0x3c79a5[_0xb75a('0x24')]){_0x3a15b9(null,[_0x3c79a5['interval']]);}else{_0x3a15b9(null,_[_0xb75a('0x25')](_0x3c79a5[_0xb75a('0x26')],_0xb75a('0x27')));}}else{_0x3a15b9(null,![]);}})['catch'](function(_0x12e173){_0x3a15b9(_0x12e173);});};AGIVertices[_0xb75a('0x11')]['getSoundPath']=function(_0x2f883c){return util[_0xb75a('0x28')](_0xb75a('0x29'),FILES_PATH,_0x2f883c);};AGIVertices[_0xb75a('0x11')][_0xb75a('0x2a')]=function(_0x2408b9,_0x25f1d3,_0x5e137){odbc['open'](_0x2408b9,function(_0x2636ba){if(_0x2636ba){logger[_0xb75a('0x2b')](_0xb75a('0x2c'),_0x2636ba);_0x5e137(_0x2636ba);}else{logger['info'](_0xb75a('0x2d'));odbc['query'](_0x25f1d3,function(_0x40126,_0x5389c5){if(_0x40126){logger[_0xb75a('0x2e')](_0xb75a('0x2f'),_0x25f1d3);_0x5e137(_0x40126);}else{logger[_0xb75a('0x2e')](_0xb75a('0x30'),_0x25f1d3);odbc[_0xb75a('0x31')](function(_0x560f6e){if(_0x560f6e){logger[_0xb75a('0x2b')](_0xb75a('0x32'),_0x560f6e);}_0x5e137(null,_0x5389c5);});}});}});};AGIVertices['prototype'][_0xb75a('0x33')]=function(_0xebad3b,_0x2780ff){this[_0xb75a('0xf')][_0xb75a('0x34')](_0xebad3b)['then'](function(_0x20fe43){_0x2780ff(null,_0x20fe43?_0x20fe43:![]);})['catch'](function(_0x30aeed){_0x2780ff(_0x30aeed);});};AGIVertices[_0xb75a('0x11')][_0xb75a('0x35')]=function(_0x16208f,_0x32b644){this[_0xb75a('0xf')][_0xb75a('0x35')](_0x16208f)[_0xb75a('0x14')](function(_0x19fc31){_0x32b644(null,_0x19fc31);})['catch'](function(_0x3b6909){_0x32b644(_0x3b6909);});};AGIVertices[_0xb75a('0x11')][_0xb75a('0x36')]=function(_0x47d59a,_0x3ccfd8,_0x500ca8){this[_0xb75a('0xf')]['createSquareDetailsReport']({'uniqueid':this[_0xb75a('0xe')][_0xb75a('0x37')],'node':_0x47d59a[_0xb75a('0x38')],'application':_0x47d59a['agicommand'],'data':_0x3ccfd8||null,'project_name':this[_0xb75a('0xe')][_0xb75a('0x39')],'callerid':this[_0xb75a('0xe')][_0xb75a('0x3a')]})[_0xb75a('0x14')](function(_0x4e27c5){if(_0x500ca8){_0x500ca8(null,_0x4e27c5);}})[_0xb75a('0x16')](function(_0x597e9c){if(_0x500ca8){_0x500ca8(_0x597e9c);}});};AGIVertices[_0xb75a('0x11')][_0xb75a('0x3b')]=function(_0x5ed168,_0x45d06e,_0x2f91d4,_0x5efd4a){this[_0xb75a('0xf')][_0xb75a('0x3b')]({'uniqueid':this[_0xb75a('0xe')][_0xb75a('0x37')],'callerid':this[_0xb75a('0xe')][_0xb75a('0x3a')],'calleridname':this['channel'][_0xb75a('0x3c')],'context':this[_0xb75a('0xe')]['context'],'extension':this[_0xb75a('0xe')]['extension'],'priority':this[_0xb75a('0xe')][_0xb75a('0x3d')],'accountcode':this[_0xb75a('0xe')][_0xb75a('0x3e')],'dnid':this['channel'][_0xb75a('0x3f')],'projectName':this['channel'][_0xb75a('0x39')],'saveName':_0x45d06e,'filename':_0x5ed168['file']||_0x45d06e,'savePath':_0x2f91d4})['then'](function(_0x10f437){_0x5efd4a(null,_0x10f437);})[_0xb75a('0x16')](function(_0x4417c7){_0x5efd4a(_0x4417c7);});};AGIVertices[_0xb75a('0x11')]['createSquareMessage']=function(_0x23f488,_0x49b43b,_0x1a05b4,_0x37ad63,_0x4974a8){this['rpc'][_0xb75a('0x40')]({'uniqueid':this[_0xb75a('0xe')][_0xb75a('0x37')],'body':_0x23f488,'direction':_0x49b43b,'providerName':_0x1a05b4,'providerResponse':_0x37ad63})[_0xb75a('0x14')](function(_0x2ff2ca){if(_0x4974a8){_0x4974a8(null,_0x2ff2ca);}})[_0xb75a('0x16')](function(_0x57cbb3){if(_0x4974a8){_0x4974a8(_0x57cbb3);}});};AGIVertices[_0xb75a('0x11')][_0xb75a('0x41')]=function(_0x52a683,_0x5b2c71){this['rpc'][_0xb75a('0x41')]({'firstName':_[_0xb75a('0x42')](_0x52a683['name'])||_[_0xb75a('0x43')](_0x52a683[_0xb75a('0x15')])?'callback_'+Math['random']():_0x52a683[_0xb75a('0x15')],'lastName':_['isEmpty'](_0x52a683[_0xb75a('0x44')])||_[_0xb75a('0x43')](_0x52a683['lastName'])?null:_0x52a683[_0xb75a('0x44')],'phone':_0x52a683[_0xb75a('0x45')],'ListId':_0x52a683[_0xb75a('0x46')],'scheduledat':_0x52a683['scheduledAt'],'callbackUniqueid':this[_0xb75a('0xe')][_0xb75a('0x37')],'tags':'callback','description':_0xb75a('0x47')+_0x52a683['scheduledAt'][_0xb75a('0x48')](),'priority':_0x52a683[_0xb75a('0x49')]})[_0xb75a('0x14')](function(_0x4b7e07){_0x5b2c71(null,_0x4b7e07);})[_0xb75a('0x16')](function(_0x3b1502){_0x5b2c71(_0x3b1502);});};AGIVertices[_0xb75a('0x11')][_0xb75a('0x4a')]=function(_0x2f8043,_0x2e55f3){this[_0xb75a('0xf')][_0xb75a('0x4b')](_0x2f8043)[_0xb75a('0x14')](function(_0x3311bd){_0x2e55f3(null,_0x3311bd?_0x3311bd[_0xb75a('0x15')]:![]);})[_0xb75a('0x16')](function(_0x4d8dfc){_0x2e55f3(_0x4d8dfc);});};AGIVertices[_0xb75a('0x11')][_0xb75a('0x4c')]=function(_0x2c905d,_0x3d74ad,_0x166f5c){var _0x5901a6={'role':_0xb75a('0x4d')};_0x5901a6[_0x2c905d]=this[_0xb75a('0xe')][_0xb75a('0x3a')];this['rpc']['agentPause'](_0x5901a6,_0x3d74ad,this[_0xb75a('0xe')][_0xb75a('0x37')])['then'](function(_0xdbb0dd){_0x166f5c(null,_[_0xb75a('0x43')](_0xdbb0dd)?![]:!![]);})[_0xb75a('0x16')](function(_0x63ba64){logger[_0xb75a('0x2b')](_0x63ba64);_0x166f5c(null,![]);});};AGIVertices['prototype']['agentUnpause']=function(_0x2399eb,_0xfac227){var _0x57d1bc={'role':_0xb75a('0x4d')};_0x57d1bc[_0x2399eb]=this[_0xb75a('0xe')][_0xb75a('0x3a')];this[_0xb75a('0xf')][_0xb75a('0x4e')](_0x57d1bc)['then'](function(_0x2d11a9){_0xfac227(null,_[_0xb75a('0x43')](_0x2d11a9)?![]:!![]);})['catch'](function(_0x49bb1b){logger[_0xb75a('0x2b')](_0x49bb1b);_0xfac227(null,![]);});};AGIVertices['prototype']['agentLogout']=function(_0x5977e8,_0x12b5d5){var _0x290e08={'role':_0xb75a('0x4d')};_0x290e08[_0x5977e8]=this[_0xb75a('0xe')][_0xb75a('0x3a')];this[_0xb75a('0xf')][_0xb75a('0x4f')](_0x290e08)[_0xb75a('0x14')](function(_0x372a7c){_0x12b5d5(null,_[_0xb75a('0x43')](_0x372a7c)?![]:!![]);})[_0xb75a('0x16')](function(_0x5845d9){logger[_0xb75a('0x2b')](_0x5845d9);_0x12b5d5(null,![]);});};AGIVertices[_0xb75a('0x11')][_0xb75a('0x50')]=function(_0x3afffc,_0x47701c){var _0x1aca27={'role':_0xb75a('0x4d')};_0x1aca27[_0x3afffc]=this[_0xb75a('0xe')]['callerid'];var _0x5c6169=_0x3afffc!='internal'?util[_0xb75a('0x28')]('%s/%s@from-sip/n',_0xb75a('0x51'),this['channel'][_0xb75a('0x3a')]):undefined;this['rpc'][_0xb75a('0x50')](_0x1aca27,_0x5c6169)['then'](function(_0x2555ee){_0x47701c(null,_[_0xb75a('0x43')](_0x2555ee)?![]:!![]);})['catch'](function(_0x55723f){logger[_0xb75a('0x2b')](_0x55723f);_0x47701c(null,![]);});};AGIVertices[_0xb75a('0x11')][_0xb75a('0x52')]=function(_0x67ad23,_0x293ec4){sh['exec'](_[_0xb75a('0x53')](_0x67ad23),function(_0x17361e,_0x270926){var _0x536ebf=_0x270926[_0xb75a('0x54')](/(\r\n|\n|\r)/gm,'');_0x293ec4(null,_0x536ebf);});};AGIVertices[_0xb75a('0x11')]['googleCloudTTS']=function(_0x3f9f75,_0x3918b3){scripts[_0xb75a('0x55')](_0x3f9f75[_0xb75a('0x56')],_0x3f9f75['google_cloud_tts_text_type']||_0xb75a('0x57'),_0x3f9f75[_0xb75a('0x57')],_0x3f9f75[_0xb75a('0x58')]||_0xb75a('0x59'),_0x3f9f75[_0xb75a('0x5a')]||'MALE',_0x3f9f75[_0xb75a('0x5b')]||'MP3')['then'](function(_0x1b2c5d){_0x3918b3(null,_0x1b2c5d);})['catch'](function(_0x41f0b6){_0x3918b3(_0x41f0b6);});};AGIVertices[_0xb75a('0x11')]['googleTTS']=function(_0x466a41,_0x4a77bc){scripts[_0xb75a('0x5c')](_0x466a41[_0xb75a('0x57')],_0x466a41[_0xb75a('0x5d')]||'en',0x1)[_0xb75a('0x14')](function(_0x5a89bb){_0x4a77bc(null,_0x5a89bb);})[_0xb75a('0x16')](function(_0x1db98d){_0x4a77bc(_0x1db98d);});};AGIVertices[_0xb75a('0x11')][_0xb75a('0x5e')]=function(_0x478b02,_0x2a4b9d){var _0xf10f1b={'uri':_0x478b02[_0xb75a('0x5f')],'method':_0x478b02[_0xb75a('0x60')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x478b02[_0xb75a('0x61')])===_0xb75a('0x62')&&parseInt(_0x478b02[_0xb75a('0x61')])>=0x1?parseInt(_0x478b02[_0xb75a('0x61')])*0x3e8:0x5*0x3e8};if(_['includes'](['POST','PUT'],_0xf10f1b[_0xb75a('0x60')]['toUpperCase']())){try{_0xf10f1b[_0xb75a('0x63')]=_0x478b02[_0xb75a('0x64')]?JSON[_0xb75a('0x65')](_0x478b02[_0xb75a('0x64')]):{};}catch(_0x5654de){logger[_0xb75a('0x2b')]('An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function',_0x5654de);}}try{_0xf10f1b[_0xb75a('0x66')]=_0x478b02[_0xb75a('0xc')]?JSON[_0xb75a('0x65')](_0x478b02[_0xb75a('0xc')]):{};}catch(_0x26fcd4){logger[_0xb75a('0x2b')]('An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function',_0x26fcd4);}if(_0x478b02['computedVariables']){try{var _0x1666d5=require(_0x478b02[_0xb75a('0x67')])[_0xb75a('0x68')](this,_0xf10f1b);_0xf10f1b[_0xb75a('0x69')]=Mustache['render'](_0x478b02[_0xb75a('0x5f')],_0x1666d5,{},['$$','$$']);if(_0xf10f1b[_0xb75a('0x66')]){_0xf10f1b[_0xb75a('0x66')]=JSON['parse'](Mustache[_0xb75a('0x6a')](JSON[_0xb75a('0x6b')](_0xf10f1b['headers']),_0x1666d5,{},['$$','$$']));}if(_0xf10f1b[_0xb75a('0x63')]){_0xf10f1b[_0xb75a('0x63')]=JSON[_0xb75a('0x65')](Mustache[_0xb75a('0x6a')](JSON[_0xb75a('0x6b')](_0xf10f1b[_0xb75a('0x63')]),_0x1666d5,{},['$$','$$']));}}catch(_0x593432){logger['error'](_0xb75a('0x6c'),_0x593432);}}rp(_0xf10f1b)[_0xb75a('0x14')](function(_0x9f0e3f){var _0x469e43={'statusCode':_0x9f0e3f[_0xb75a('0x6d')]||0xc8,'statusMessage':_0x9f0e3f[_0xb75a('0x6e')]||'OK','headers':_0x9f0e3f[_0xb75a('0x66')]||{},'body':_0x9f0e3f[_0xb75a('0x63')]||{}};_0x2a4b9d(null,_0x469e43);})[_0xb75a('0x16')](function(_0x220c0e){var _0x5f61f5={'statusCode':_0x220c0e[_0xb75a('0x6d')]||0x1f4,'statusMessage':_0x220c0e['message']||_0xb75a('0x6f'),'headers':_0x220c0e[_0xb75a('0x70')]['headers']||{},'body':_0x220c0e[_0xb75a('0x70')][_0xb75a('0x63')]||{}};_0x2a4b9d(null,_0x5f61f5);});};AGIVertices['prototype'][_0xb75a('0x71')]=function(_0x2ae9f5,_0x2752a7){scripts[_0xb75a('0x71')](this[_0xb75a('0xe')][_0xb75a('0x37')],_0x2ae9f5[_0xb75a('0x72')],_0x2ae9f5[_0xb75a('0x57')],_0x2ae9f5[_0xb75a('0x73')]||'en')[_0xb75a('0x14')](function(_0x3def7e){_0x2752a7(null,_0x3def7e);})[_0xb75a('0x16')](function(_0x146e92){_0x2752a7(_0x146e92);});};AGIVertices[_0xb75a('0x11')][_0xb75a('0x74')]=function(_0x3f41e5,_0x2e4bb5){scripts[_0xb75a('0x74')](this[_0xb75a('0xe')][_0xb75a('0x37')],_0x3f41e5[_0xb75a('0x75')],_0x3f41e5[_0xb75a('0x76')],_0x3f41e5[_0xb75a('0x77')],_0x3f41e5[_0xb75a('0x57')],_0x3f41e5[_0xb75a('0x78')]||'en')[_0xb75a('0x14')](function(_0x4f3551){_0x2e4bb5(null,_0x4f3551);})['catch'](function(_0x3f0055){_0x2e4bb5(_0x3f0055);});};AGIVertices[_0xb75a('0x11')]['sestekNDA']=function(_0x11f78a,_0x3014c3){scripts['sestekNDA'](this[_0xb75a('0xe')],_0x11f78a)[_0xb75a('0x14')](function(_0x2a2daa){_0x3014c3(null,_0x2a2daa);})[_0xb75a('0x16')](function(_0x212e32){_0x3014c3(_0x212e32);});};AGIVertices[_0xb75a('0x11')]['ispeechTTS']=function(_0x57d6da,_0x4fb2c0){scripts[_0xb75a('0x79')](_0x57d6da[_0xb75a('0x72')],_0x57d6da['text'],_0x57d6da[_0xb75a('0x7a')]||_0xb75a('0x59'),_0x57d6da[_0xb75a('0x7b')])[_0xb75a('0x14')](function(_0x5bcb16){_0x4fb2c0(null,_0x5bcb16);})[_0xb75a('0x16')](function(_0x5d050d){_0x4fb2c0(_0x5d050d);});};AGIVertices['prototype'][_0xb75a('0x7c')]=function(_0x2b0019,_0x2f34c5,_0x3bb4a1){scripts['ispeechASR'](_0x2f34c5,_0x2b0019[_0xb75a('0x72')],_0x2b0019[_0xb75a('0x7d')]||_0xb75a('0x59'),this[_0xb75a('0x7e')](_0x2b0019[_0xb75a('0x7f')])?_0x2b0019['model']:undefined)[_0xb75a('0x14')](function(_0x58fb48){_0x3bb4a1(null,_0x58fb48);})[_0xb75a('0x16')](function(_0x4fbcce){_0x3bb4a1(_0x4fbcce);});};AGIVertices[_0xb75a('0x11')]['awsPolly']=function(_0xe68190,_0x4bc8e4){scripts[_0xb75a('0x80')](_0xe68190[_0xb75a('0x81')],_0xe68190[_0xb75a('0x82')],_0xe68190[_0xb75a('0x83')],_0xe68190[_0xb75a('0x84')]||_0xb75a('0x85'),_0xe68190[_0xb75a('0x57')],_0xe68190['aws_text_type']||'text')[_0xb75a('0x14')](function(_0x415506){_0x4bc8e4(null,_0x415506);})[_0xb75a('0x16')](function(_0x210056){_0x4bc8e4(_0x210056);});};AGIVertices[_0xb75a('0x11')][_0xb75a('0x86')]=function(_0x391a48,_0x19d150){scripts[_0xb75a('0x86')](this[_0xb75a('0xe')][_0xb75a('0x37')],_0x391a48[_0xb75a('0x81')],_0x391a48[_0xb75a('0x82')],_0x391a48[_0xb75a('0x87')],_0x391a48['text'],_0x391a48[_0xb75a('0x88')])[_0xb75a('0x14')](function(_0x1623b1){_0x19d150(null,_0x1623b1);})[_0xb75a('0x16')](function(_0x35d286){_0x19d150(_0x35d286);});};AGIVertices[_0xb75a('0x11')][_0xb75a('0x89')]=function(_0x2ed71d,_0x5d0088,_0x3a5278){scripts[_0xb75a('0x89')](_0x5d0088,_0x2ed71d[_0xb75a('0x72')],_0x2ed71d[_0xb75a('0x8a')]||_0xb75a('0x59'))[_0xb75a('0x14')](function(_0x2c1d76){_0x3a5278(null,_0x2c1d76);})[_0xb75a('0x16')](function(_0xb16b88){_0x3a5278(_0xb16b88);});};AGIVertices[_0xb75a('0x11')][_0xb75a('0x8b')]=function(_0x5a6bfa,_0xb40523,_0x5e1c74){scripts[_0xb75a('0x8b')](_0xb40523,_0x5a6bfa[_0xb75a('0x8c')],_0x5a6bfa[_0xb75a('0x8d')],_0x5a6bfa['uri'])[_0xb75a('0x14')](function(_0x462a3a){_0x5e1c74(null,_0x462a3a);})[_0xb75a('0x16')](function(_0x29d8da){_0x5e1c74(_0x29d8da);});};AGIVertices[_0xb75a('0x11')][_0xb75a('0x8e')]=function(_0x53aaf1){var _0x34c3f5=_[_0xb75a('0x8f')](verticesWithRetry,_0x53aaf1[_0xb75a('0x90')])?_0x53aaf1:_['clone'](_0x53aaf1);for(var _0x58c16f in _0x34c3f5){if(_0x34c3f5[_0xb75a('0x91')](_0x58c16f)){if(_0x34c3f5[_0x58c16f]&&_['isString'](_0x34c3f5[_0x58c16f])){if(_['includes'](recursiveMapAttributes,_0x58c16f)){_0x34c3f5[_0x58c16f]=this[_0xb75a('0x92')](_0x34c3f5[_0x58c16f]);}else{_0x34c3f5[_0x58c16f]=this[_0xb75a('0x93')](_0x34c3f5[_0x58c16f]);}}}}return _0x34c3f5;};AGIVertices[_0xb75a('0x11')]['recursiveNodeIndex']=function(_0x101075){for(var _0x2d0ce8 in _0x101075){if(_0x101075[_0xb75a('0x91')](_0x2d0ce8)){if(_[_0xb75a('0x94')](_0x101075[_0x2d0ce8])){this[_0xb75a('0x95')](_0x101075[_0x2d0ce8]);}else if(_['isArray'](_0x101075[_0x2d0ce8])){for(var _0x2f6a93=0x0;_0x2f6a93<_0x101075[_0x2d0ce8][_0xb75a('0x96')];_0x2f6a93++){this[_0xb75a('0x95')](_0x101075[_0x2d0ce8][_0x2f6a93]);}}else if(_[_0xb75a('0x97')](_0x101075[_0x2d0ce8])){_0x101075[_0x2d0ce8]=this[_0xb75a('0x93')](_0x101075[_0x2d0ce8]);}}}};AGIVertices[_0xb75a('0x11')][_0xb75a('0x98')]=function(_0x4ff9e5,_0x47f2ac){for(var _0xcf5c54 in _0x4ff9e5){if(_0x4ff9e5[_0xb75a('0x91')](_0xcf5c54)){if(_[_0xb75a('0x94')](_0x4ff9e5[_0xcf5c54])){if(!_[_0xb75a('0x42')](_0x4ff9e5[_0xcf5c54])){this[_0xb75a('0x98')](_0x4ff9e5[_0xcf5c54],util['format'](_0xb75a('0x99'),_0x47f2ac,_0xcf5c54));}}else if(_['isArray'](_0x4ff9e5[_0xcf5c54])){for(var _0x157e3a=0x0;_0x157e3a<_0x4ff9e5[_0xcf5c54][_0xb75a('0x96')];_0x157e3a++){this[_0xb75a('0x98')](_0x4ff9e5[_0xcf5c54][_0x157e3a],util[_0xb75a('0x28')](_0xb75a('0x99'),_0x47f2ac,_0xcf5c54+'['+_0x157e3a+']'));}}else{if(!_[_0xb75a('0x43')](_0x4ff9e5[_0xcf5c54])){this[_0xb75a('0xe')][_0xb75a('0x9a')](util[_0xb75a('0x28')](_0xb75a('0x99'),_0x47f2ac,_0xcf5c54),_0x4ff9e5[_0xcf5c54]);}}}}};AGIVertices[_0xb75a('0x11')][_0xb75a('0x92')]=function(_0x45cad9){try{var _0xa18976=JSON[_0xb75a('0x65')](_0x45cad9);this['recursiveNodeIndex'](_0xa18976);return JSON[_0xb75a('0x6b')](_0xa18976);}catch(_0x390942){return this['replaceAllVariables'](_0x45cad9);}};AGIVertices[_0xb75a('0x11')][_0xb75a('0x93')]=function(_0x1b5651){var _0x41b4f9=_0x1b5651[_0xb75a('0x9b')]('{');for(var _0x1cc4ab=0x1;_0x1cc4ab<_0x41b4f9[_0xb75a('0x96')];_0x1cc4ab+=0x1){var _0x10e195=_0x41b4f9[_0x1cc4ab][_0xb75a('0x9b')]('}');if(_0x10e195['length']>0x1){_0x1b5651=_0x1b5651['replaceAll']('{'+_0x10e195[0x0]+'}',this[_0xb75a('0xe')][_0xb75a('0x12')](_0x10e195[0x0])[_0xb75a('0x9c')]||_0x10e195[0x0]);}}if(_0x41b4f9[_0xb75a('0x96')]===0x1){return _0x1b5651[_0xb75a('0x48')]();}return this[_0xb75a('0x93')](_0x1b5651);};AGIVertices[_0xb75a('0x11')][_0xb75a('0x9d')]=function(_0xbb7527,_0x182037){var _0x30bc55=this[_0xb75a('0xe')]['getVariable'](_0xbb7527);if(_0x30bc55[_0xb75a('0x9e')]===-0x1){return _0x30bc55;}logger['info'](util[_0xb75a('0x28')]('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x182037,_0x30bc55[_0xb75a('0x9c')]));return this[_0xb75a('0xe')]['setVariable'](_0x182037,_0x30bc55['extra']);};AGIVertices[_0xb75a('0x11')][_0xb75a('0x7e')]=function(_0x537652){return _0x537652&&_0x537652!=='0'&&_0x537652!=='-1'&&_0x537652!=='';};AGIVertices['prototype'][_0xb75a('0x9f')]=function(_0xa7987f){this[_0xb75a('0x36')][_0xb75a('0x68')](this,_0xa7987f,'-');_0xa7987f['retry']=_0xa7987f['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices[_0xb75a('0x11')][_0xb75a('0xa0')]=function(_0x135a5e){logger[_0xb75a('0x2e')](util[_0xb75a('0x28')](_0xb75a('0xa1'),_0x135a5e['label']));if(!this[_0xb75a('0x7e')](_0x135a5e[_0xb75a('0x57')])){return this[_0xb75a('0xe')][_0xb75a('0xa2')](_0xb75a('0xa3'));}var _0x19cbe9='\x22'+_0x135a5e[_0xb75a('0x57')]+'\x22';if(this[_0xb75a('0x7e')](_0x135a5e[_0xb75a('0x70')])){_0x19cbe9+=','+_0x135a5e[_0xb75a('0x70')];}var _0x3671b0=this[_0xb75a('0xe')][_0xb75a('0xa4')](_0xb75a('0xa5'),_0x19cbe9);if(_0x3671b0[_0xb75a('0x9e')]===-0x1){return _0x3671b0;}return this[_0xb75a('0xe')][_0xb75a('0xa2')](util[_0xb75a('0x28')](_0xb75a('0xa6'),_0x19cbe9));};AGIVertices[_0xb75a('0x11')]['mrcprecog']=function(_0x6d1791){logger[_0xb75a('0x2e')](util[_0xb75a('0x28')](_0xb75a('0xa7'),_0x6d1791[_0xb75a('0x38')]));if(!this[_0xb75a('0x7e')](_0x6d1791['grammar'])){return this[_0xb75a('0xe')][_0xb75a('0xa2')]('no\x20grammar\x20configured');}var _0x1b42ab=_0x6d1791[_0xb75a('0xa8')];if(this[_0xb75a('0x7e')](_0x6d1791[_0xb75a('0x70')])){_0x1b42ab+=','+_0x6d1791[_0xb75a('0x70')];}var _0x4d3b53=this[_0xb75a('0xe')][_0xb75a('0xa4')](_0xb75a('0xa9'),_0x1b42ab);if(_0x4d3b53[_0xb75a('0x9e')]===-0x1){return _0x4d3b53;}var _0x5e3c8e=this[_0xb75a('0x9d')](_0xb75a('0xaa'),_0xb75a('0xab'));if(_0x5e3c8e[_0xb75a('0x9e')]===-0x1){return _0x5e3c8e;}var _0x3db0d8=this['getAndSetVariable'](_0xb75a('0xac'),_0xb75a('0xad'));if(_0x3db0d8[_0xb75a('0x9e')]===-0x1){return _0x3db0d8;}var _0x21a9a8=this[_0xb75a('0x9d')](_0xb75a('0xae'),_0xb75a('0xaf'));if(_0x21a9a8['result']===-0x1){return _0x21a9a8;}return this[_0xb75a('0xe')][_0xb75a('0xa2')](util[_0xb75a('0x28')]('Executed\x20command\x20MRCPRecog\x20%s',_0x1b42ab));};AGIVertices[_0xb75a('0x11')][_0xb75a('0x8')]=function(_0x36fd86){logger[_0xb75a('0x2e')](util[_0xb75a('0x28')](_0xb75a('0xb0'),_0x36fd86[_0xb75a('0x38')]));return this[_0xb75a('0xe')][_0xb75a('0x8')]([_0x36fd86[_0xb75a('0xb1')],_0x36fd86[_0xb75a('0xb2')]]);};AGIVertices['prototype']['answer']=function(_0x3c84c){logger[_0xb75a('0x2e')](util[_0xb75a('0x28')](_0xb75a('0xb3'),_0x3c84c[_0xb75a('0x38')]));if(this['isConfigured'](_0x3c84c['timeout'])){logger[_0xb75a('0x2e')](util[_0xb75a('0x28')](_0xb75a('0xb4'),_0x3c84c[_0xb75a('0x61')]));var _0x383916=this['channel'][_0xb75a('0xb5')](_0x3c84c[_0xb75a('0x61')]);if(_0x383916[_0xb75a('0x9e')]===-0x1){return _0x383916;}}return this[_0xb75a('0xe')][_0xb75a('0xb6')]();};AGIVertices[_0xb75a('0x11')][_0xb75a('0xb7')]=function(_0x5af48c){logger['info'](util['format']('Enter\x20in\x20CALLBACK\x20(%s)\x20block',_0x5af48c[_0xb75a('0x38')]));if(!this[_0xb75a('0x7e')](_0x5af48c[_0xb75a('0x46')])){return this[_0xb75a('0xe')][_0xb75a('0x2b')](_0x5af48c,_0xb75a('0xb8'));}_0x5af48c[_0xb75a('0xb9')]=moment();if(this[_0xb75a('0x7e')](_0x5af48c['delay'])){_0x5af48c[_0xb75a('0xb9')]=moment()[_0xb75a('0xba')](_0x5af48c[_0xb75a('0xbb')],_0xb75a('0xbc'));}if(!this[_0xb75a('0x7e')](_0x5af48c[_0xb75a('0x49')])){_0x5af48c[_0xb75a('0x49')]=0x2;}this[_0xb75a('0x41')][_0xb75a('0x68')](this,_0x5af48c);return this['channel'][_0xb75a('0xa2')](util[_0xb75a('0x28')](_0xb75a('0xbd'),_0x5af48c[_0xb75a('0x45')],_0x5af48c[_0xb75a('0x46')],_0x5af48c[_0xb75a('0xb9')]));};AGIVertices['prototype']['custom_app']=function(_0x18dcf2){logger[_0xb75a('0x2e')](util[_0xb75a('0x28')](_0xb75a('0xbe'),_0x18dcf2[_0xb75a('0x38')]));var _0x459ca5=this[_0xb75a('0xe')]['exec'](_0x18dcf2['application'],_0x18dcf2[_0xb75a('0x70')]);if(_0x459ca5[_0xb75a('0x9e')]===-0x1){return _0x459ca5;}return this['channel'][_0xb75a('0xa2')](util['format'](_0xb75a('0xbf'),_0x18dcf2[_0xb75a('0xc0')],_0x18dcf2[_0xb75a('0x70')]));};AGIVertices[_0xb75a('0x11')][_0xb75a('0xc1')]=function(_0x4d8b2d){logger['info'](util[_0xb75a('0x28')](_0xb75a('0xc2'),_0x4d8b2d[_0xb75a('0x38')]));if(!this[_0xb75a('0x7e')](_0x4d8b2d[_0xb75a('0x57')])){return this[_0xb75a('0xe')][_0xb75a('0xa2')](_0xb75a('0xa3'));}var _0x2b5c67='\x22'+_0x4d8b2d[_0xb75a('0x57')]+'\x22';if(this[_0xb75a('0x7e')](_0x4d8b2d[_0xb75a('0x70')])){_0x2b5c67+=','+_0x4d8b2d[_0xb75a('0x70')];}var _0x6630e7=this[_0xb75a('0xe')][_0xb75a('0xa4')](_0xb75a('0xa5'),_0x2b5c67);if(_0x6630e7[_0xb75a('0x9e')]===-0x1){return _0x6630e7;}return this['channel']['noop'](util[_0xb75a('0x28')](_0xb75a('0xa6'),_0x2b5c67));};AGIVertices[_0xb75a('0x11')][_0xb75a('0xc3')]=function(_0x29496e){logger[_0xb75a('0x2e')](util[_0xb75a('0x28')](_0xb75a('0xc4'),_0x29496e[_0xb75a('0x38')]));if(!this[_0xb75a('0x7e')](_0x29496e[_0xb75a('0x57')])){return this[_0xb75a('0xe')][_0xb75a('0xa2')](_0xb75a('0xa3'));}var _0x473a4a='\x22'+_0x29496e[_0xb75a('0x57')]+'\x22';if(this[_0xb75a('0x7e')](_0x29496e['options'])){_0x473a4a+=','+_0x29496e[_0xb75a('0x70')];}var _0x225943=this[_0xb75a('0xe')][_0xb75a('0xa4')]('MRCPSynth',_0x473a4a);if(_0x225943[_0xb75a('0x9e')]===-0x1){return _0x225943;}return this['channel'][_0xb75a('0xa2')](util['format'](_0xb75a('0xa6'),_0x473a4a));};AGIVertices[_0xb75a('0x11')][_0xb75a('0xc5')]=function(_0x2d8aec){logger[_0xb75a('0x2e')](util['format'](_0xb75a('0xc6'),_0x2d8aec[_0xb75a('0x38')]));if(!this[_0xb75a('0x7e')](_0x2d8aec['grammar'])){return this['channel'][_0xb75a('0xa2')](_0xb75a('0xc7'));}var _0x544c8a=_0x2d8aec['grammar'];if(this[_0xb75a('0x7e')](_0x2d8aec[_0xb75a('0x70')])){_0x544c8a+=','+_0x2d8aec['options'];}var _0x4e46=this[_0xb75a('0xe')][_0xb75a('0xa4')](_0xb75a('0xa9'),_0x544c8a);if(_0x4e46['result']===-0x1){return _0x4e46;}var _0x3c5418=this['getAndSetVariable']('RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE');if(_0x3c5418[_0xb75a('0x9e')]===-0x1){return _0x3c5418;}var _0x23b457=this['getAndSetVariable'](_0xb75a('0xac'),_0xb75a('0xc8'));if(_0x23b457[_0xb75a('0x9e')]===-0x1){return _0x23b457;}var _0x25d8a4=this[_0xb75a('0x9d')](_0xb75a('0xae'),'LUMENVOX_ASR_INSTANCE');if(_0x25d8a4[_0xb75a('0x9e')]===-0x1){return _0x25d8a4;}return this[_0xb75a('0xe')][_0xb75a('0xa2')](util[_0xb75a('0x28')](_0xb75a('0xc9'),_0x544c8a));};AGIVertices[_0xb75a('0x11')][_0xb75a('0xca')]=function(_0x27b4da){logger['info'](util[_0xb75a('0x28')](_0xb75a('0xcb'),_0x27b4da['label']));if(!this[_0xb75a('0x7e')](_0x27b4da[_0xb75a('0xa8')])){return this[_0xb75a('0xe')][_0xb75a('0xa2')]('no\x20grammar\x20configured');}var _0x5d3985=_0x27b4da[_0xb75a('0xa8')];if(this[_0xb75a('0x7e')](_0x27b4da['options'])){_0x5d3985+=','+_0x27b4da[_0xb75a('0x70')];}var _0x1f76b4=this['channel']['exec'](_0xb75a('0xa9'),_0x5d3985);if(_0x1f76b4[_0xb75a('0x9e')]===-0x1){return _0x1f76b4;}var _0x19deaf=this[_0xb75a('0x9d')]('RECOG_CONFIDENCE()',_0xb75a('0xcc'));if(_0x19deaf['result']===-0x1){return _0x19deaf;}var _0x5c74da=this[_0xb75a('0x9d')](_0xb75a('0xac'),_0xb75a('0xcd'));if(_0x5c74da['result']===-0x1){return _0x5c74da;}var _0x2fe7cd=this[_0xb75a('0x9d')](_0xb75a('0xae'),_0xb75a('0xce'));if(_0x2fe7cd[_0xb75a('0x9e')]===-0x1){return _0x2fe7cd;}return this[_0xb75a('0xe')]['noop'](util[_0xb75a('0x28')]('Executed\x20command\x20MRCPRecog\x20%s',_0x5d3985));};AGIVertices['prototype'][_0xb75a('0xcf')]=function(_0x292d05){logger[_0xb75a('0x2e')](util[_0xb75a('0x28')](_0xb75a('0xd0'),_0x292d05[_0xb75a('0x38')]));if(!this[_0xb75a('0x7e')](_0x292d05['odbc_id'])){return this[_0xb75a('0xe')][_0xb75a('0x2b')](_0x292d05,'no\x20database\x20selected');}var _0x154e1d=this[_0xb75a('0x19')][_0xb75a('0x68')](this,_0x292d05['odbc_id']);if(!_0x154e1d){return this[_0xb75a('0xe')]['error'](_0x292d05,_0xb75a('0xd1'));}if(!this[_0xb75a('0x7e')](_0x292d05[_0xb75a('0xd2')])){return this[_0xb75a('0xe')][_0xb75a('0x2b')](_0x292d05,'no\x20query\x20configured');}var _0x8287de=_0x292d05[_0xb75a('0xd2')][_0xb75a('0x54')](/(\r\n|\n|\r)/gm,'\x20');this[_0xb75a('0xe')]['noop'](util[_0xb75a('0x28')]('query:\x20%s',_0x8287de));var _0x546006=this['getQueryOdbc'][_0xb75a('0x68')](this,_0x154e1d,_0x8287de);this[_0xb75a('0x36')][_0xb75a('0x68')](this,_0x292d05,_0x8287de);if(!this[_0xb75a('0x7e')](_0x292d05[_0xb75a('0xd3')])){return this[_0xb75a('0xe')][_0xb75a('0xa2')](_0xb75a('0xd4'));}var _0x302cb1=this[_0xb75a('0x12')][_0xb75a('0x68')](this,_0x292d05[_0xb75a('0xd3')]);if(!_0x302cb1){return this['channel']['error'](_0x292d05,_0xb75a('0xd5'));}var _0xa685d2=this;_0x546006[_0xb75a('0xd6')](function(_0xd84131,_0x103310){Object[_0xb75a('0xd7')](_0xd84131)[_0xb75a('0xd6')](function(_0x267f10){_0xa685d2[_0xb75a('0xe')][_0xb75a('0x9a')](util[_0xb75a('0x28')](_0xb75a('0xd8'),_0x302cb1,_0x103310,_0x267f10),_0xd84131[_0x267f10]);});});this[_0xb75a('0xe')][_0xb75a('0x9a')](util[_0xb75a('0x28')](_0xb75a('0xd9'),_0x302cb1),_0x546006['length']);return this[_0xb75a('0xe')][_0xb75a('0xa2')](util['format'](_0xb75a('0xda'),_0x302cb1));};AGIVertices[_0xb75a('0x11')][_0xb75a('0xdb')]=function(_0x3dbcff){logger[_0xb75a('0xdc')](util['format'](_0xb75a('0xdd'),_0x3dbcff['label']));if(!this[_0xb75a('0x7e')](_0x3dbcff[_0xb75a('0xde')])){return this['channel'][_0xb75a('0x2b')](_0x3dbcff,_0xb75a('0xdf'));}var _0x372ae0=this[_0xb75a('0xe0')][_0xb75a('0x68')](this,_0x3dbcff['sip_id']);if(!_0x372ae0){return this['channel']['error'](_0x3dbcff,_0xb75a('0xe1'));}var _0x546c8d=this[_0xb75a('0xe')][_0xb75a('0xa4')](_0xb75a('0xe2'),[util[_0xb75a('0x28')](_0xb75a('0xe3'),_0x372ae0),_0x3dbcff[_0xb75a('0x61')],_0x3dbcff['opts'],_0x3dbcff[_0xb75a('0x5f')]]);if(_0x546c8d['result']===-0x1){return _0x546c8d;}return this['channel'][_0xb75a('0xa2')](util[_0xb75a('0x28')]('Executed\x20command\x20%s',_0xb75a('0xe2')));};AGIVertices[_0xb75a('0x11')][_0xb75a('0xe4')]=function(_0x4e40fa){logger[_0xb75a('0x2e')](util[_0xb75a('0x28')](_0xb75a('0xe5'),_0x4e40fa[_0xb75a('0x38')]));if(!this[_0xb75a('0x7e')](_0x4e40fa['key'])){return this[_0xb75a('0xe')][_0xb75a('0xa2')](_0xb75a('0xe6'));}if(!this[_0xb75a('0x7e')](_0x4e40fa[_0xb75a('0x57')])){return this[_0xb75a('0xe')]['noop']('no\x20text\x20configured');}this[_0xb75a('0xe')][_0xb75a('0xe7')]=!![];this['createSquareDetailsReport'](_0x4e40fa);this[_0xb75a('0x40')](_0x4e40fa[_0xb75a('0x57')],'in','','');this[_0xb75a('0xe')]['noop'](util[_0xb75a('0x28')](_0xb75a('0xe8'),_0x4e40fa[_0xb75a('0x57')]));var _0x4bc863=this[_0xb75a('0x71')]['sync'](this,_0x4e40fa);if(_0x4bc863){for(var _0x3b4751 in _0x4bc863){if(_0x4bc863[_0xb75a('0x91')](_0x3b4751)){this[_0xb75a('0xe')][_0xb75a('0x9a')](util[_0xb75a('0x28')]('DIALOGFLOW_%s',_0x3b4751[_0xb75a('0xe9')]()),_0x4bc863[_0x3b4751]);}}this[_0xb75a('0x40')](_0x4bc863[_0xb75a('0xea')],_0xb75a('0xeb'),'dialogflow','');return this[_0xb75a('0xe')][_0xb75a('0xa2')](util[_0xb75a('0x28')](_0xb75a('0xec'),_0x4bc863['speech']));}return this[_0xb75a('0xe')][_0xb75a('0x2b')](_0x4e40fa,_0xb75a('0xed'));};AGIVertices[_0xb75a('0x11')][_0xb75a('0xee')]=function(_0x477585){logger[_0xb75a('0x2e')](util[_0xb75a('0x28')](_0xb75a('0xef'),_0x477585[_0xb75a('0x38')]));if(!this['isConfigured'](_0x477585[_0xb75a('0x75')])){return this[_0xb75a('0xe')][_0xb75a('0xa2')](_0xb75a('0xf0'));}if(!this[_0xb75a('0x7e')](_0x477585[_0xb75a('0x76')])){return this[_0xb75a('0xe')][_0xb75a('0xa2')](_0xb75a('0xf1'));}if(!this[_0xb75a('0x7e')](_0x477585['private_key'])){return this['channel']['noop'](_0xb75a('0xf2'));}if(!this[_0xb75a('0x7e')](_0x477585[_0xb75a('0x78')])){return this[_0xb75a('0xe')][_0xb75a('0xa2')](_0xb75a('0xf3'));}if(!this[_0xb75a('0x7e')](_0x477585['text'])){return this['channel']['noop']('no\x20text\x20configured');}this[_0xb75a('0xe')][_0xb75a('0xe7')]=!![];this[_0xb75a('0x36')](_0x477585);this[_0xb75a('0x40')](_0x477585[_0xb75a('0x57')],'in','','');this[_0xb75a('0xe')]['noop'](util[_0xb75a('0x28')](_0xb75a('0xf4'),_0x477585['text']));var _0x492542=this['googleDialogflowV2'][_0xb75a('0x68')](this,_0x477585);if(_0x492542){for(var _0x52c0c8 in _0x492542){if(_0x492542['hasOwnProperty'](_0x52c0c8)){if(_0x52c0c8!==_0xb75a('0xf5')){this[_0xb75a('0xe')][_0xb75a('0x9a')](util['format'](_0xb75a('0xf6'),_0x52c0c8[_0xb75a('0xe9')]()),_0x492542[_0x52c0c8]);}}}this['createSquareMessage'](_0x492542['speech'],_0xb75a('0xeb'),'dialogflowV2',_0x492542[_0xb75a('0xf5')]);return this[_0xb75a('0xe')][_0xb75a('0xa2')](util[_0xb75a('0x28')](_0xb75a('0xf7'),_0x492542[_0xb75a('0xea')]));}return this[_0xb75a('0xe')]['error'](_0x477585,'DialogflowV2\x20is\x20unreachable');};AGIVertices[_0xb75a('0x11')][_0xb75a('0xf8')]=function(_0x191355){logger[_0xb75a('0x2e')](util[_0xb75a('0x28')](_0xb75a('0xf9'),_0x191355['label']));if(!this[_0xb75a('0x7e')](_0x191355[_0xb75a('0xfa')])){return this[_0xb75a('0xe')][_0xb75a('0xa2')](_0xb75a('0xfb'));}if(!this[_0xb75a('0x7e')](_0x191355[_0xb75a('0xfc')])){return this[_0xb75a('0xe')][_0xb75a('0xa2')](_0xb75a('0xfd'));}if(!this[_0xb75a('0x7e')](_0x191355[_0xb75a('0xfe')])){return this[_0xb75a('0xe')][_0xb75a('0xa2')](_0xb75a('0xff'));}if(!this[_0xb75a('0x7e')](_0x191355[_0xb75a('0x100')])){return this[_0xb75a('0xe')][_0xb75a('0xa2')](_0xb75a('0xa3'));}this[_0xb75a('0xe')][_0xb75a('0xe7')]=!![];this[_0xb75a('0x36')](_0x191355);this[_0xb75a('0x40')](_0x191355[_0xb75a('0x57')],'in','','');this[_0xb75a('0xe')][_0xb75a('0xa2')](util[_0xb75a('0x28')](_0xb75a('0x101'),_0x191355[_0xb75a('0x57')]));var _0x2afa4e=this[_0xb75a('0x102')]['sync'](this,_0x191355);if(_0x2afa4e){for(var _0x1df8a8 in _0x2afa4e){if(_0x2afa4e[_0xb75a('0x91')](_0x1df8a8)){this['channel'][_0xb75a('0x9a')](util[_0xb75a('0x28')](_0xb75a('0x103'),_0x1df8a8[_0xb75a('0xe9')]()),_0x2afa4e[_0x1df8a8]);}}this[_0xb75a('0x40')](_0x2afa4e['speech'],_0xb75a('0xeb'),_0xb75a('0xf8'),'');if(_0x2afa4e[_0xb75a('0x104')]){this[_0xb75a('0xe')]['noop'](util[_0xb75a('0x28')](_0xb75a('0x105'),_0x2afa4e['audiofile']));var _0x303992=this[_0xb75a('0xe')]['streamFile'](_0x2afa4e[_0xb75a('0x104')]);try{fs['unlink'](_0x2afa4e['audiofile']+'.wav');}catch(_0x110f83){logger[_0xb75a('0x2b')](_0x110f83);}return _0x303992;}else{return this[_0xb75a('0xe')]['noop'](util[_0xb75a('0x28')]('SestekNDA\x20Result\x20%s',_0x2afa4e['speech']));}}return this[_0xb75a('0xe')][_0xb75a('0x2b')](_0x191355,'SestekNDA\x20is\x20unreachable');};AGIVertices['prototype']['end']=function(_0x443c34){logger['info'](util[_0xb75a('0x28')](_0xb75a('0x106'),_0x443c34[_0xb75a('0x38')]));return this[_0xb75a('0xe')][_0xb75a('0xa2')]('end');};AGIVertices[_0xb75a('0x11')][_0xb75a('0x107')]=function(_0x121164){logger[_0xb75a('0x2e')](util['format'](_0xb75a('0x108'),_0x121164[_0xb75a('0x38')]));var _0x1a4ae5='';if(_0x121164[_0xb75a('0x109')]){if(!this[_0xb75a('0x7e')](_0x121164[_0xb75a('0x109')])){return this[_0xb75a('0xe')][_0xb75a('0x2b')](_0x121164,'no\x20trunk\x20selected');}else{var _0x3cfda1=parseInt(_0x121164[_0xb75a('0x109')],0xa);if(isNaN(_0x3cfda1)){_0x1a4ae5=_0x121164['trunk_id'];}else{_0x1a4ae5=this[_0xb75a('0x1b')][_0xb75a('0x68')](this,_0x121164[_0xb75a('0x109')]);if(!_0x1a4ae5){return this[_0xb75a('0xe')][_0xb75a('0x2b')](_0x121164,_0xb75a('0x10a'));}}}}else if(_0x121164[_0xb75a('0x10b')]){_0x1a4ae5=_0x121164[_0xb75a('0x10b')];}else{return this[_0xb75a('0xe')][_0xb75a('0x2b')](_0x121164,_0xb75a('0x10c'));}var _0x535746=this[_0xb75a('0xe')][_0xb75a('0xa4')](_0xb75a('0xe2'),[util['format'](_0xb75a('0x10d'),_0x1a4ae5,_0x121164[_0xb75a('0x45')]),_0x121164[_0xb75a('0x61')],_0x121164[_0xb75a('0x10e')],_0x121164[_0xb75a('0x5f')]]);if(_0x535746[_0xb75a('0x9e')]===-0x1){return _0x535746;}return this[_0xb75a('0xe')][_0xb75a('0xa2')](util[_0xb75a('0x28')](_0xb75a('0x10f'),_0xb75a('0xe2')));};AGIVertices[_0xb75a('0x11')][_0xb75a('0x110')]=function(_0xb4c696){logger[_0xb75a('0x2e')](util[_0xb75a('0x28')]('Enter\x20in\x20FINALLY\x20(%s)\x20block',_0xb4c696[_0xb75a('0x38')]));return this['channel'][_0xb75a('0xa2')]('finally');};AGIVertices[_0xb75a('0x11')][_0xb75a('0xd')]=function(_0x49f5a4){logger['info'](util[_0xb75a('0x28')](_0xb75a('0x111'),_0x49f5a4['label']));if(_0x49f5a4['retry']===0x0){return this[_0xb75a('0x9f')](_0x49f5a4);}_0x49f5a4[_0xb75a('0x112')]-=0x1;if(!this[_0xb75a('0x7e')](_0x49f5a4[_0xb75a('0x113')])){return this[_0xb75a('0xe')]['error'](_0x49f5a4,_0xb75a('0x114'));}var _0x4c0da5=this[_0xb75a('0x115')][_0xb75a('0x68')](this,_0x49f5a4['file_id']);if(!_0x4c0da5){return this[_0xb75a('0xe')][_0xb75a('0x2b')](_0x49f5a4,'no\x20file\x20audio\x20found');}if(!this[_0xb75a('0x7e')](_0x49f5a4['variable_id'])){return this[_0xb75a('0xe')]['error']('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x2ad1d5=this[_0xb75a('0xe')][_0xb75a('0x116')](_0x4c0da5,_0x49f5a4[_0xb75a('0x117')],_0x49f5a4['maxdigit']);var _0x21d5eb=_0x2ad1d5[_0xb75a('0x9e')]?_0x2ad1d5['result']['toString']():'';logger['info'](_0xb75a('0x118'),JSON['stringify'](_0x2ad1d5));if(_0x2ad1d5[_0xb75a('0x9e')]===-0x1){this['createSquareDetailsReport'][_0xb75a('0x68')](this,_0x49f5a4,_0x21d5eb);return _0x2ad1d5;}else if(_0x2ad1d5['extra']===_0xb75a('0x61')){_0x2ad1d5['result']=_0x21d5eb[_0xb75a('0x96')]>=parseInt(_0x49f5a4[_0xb75a('0x119')])?'x':'i';}else{_0x2ad1d5['result']=_0x21d5eb[_0xb75a('0x96')]>=parseInt(_0x49f5a4[_0xb75a('0x119')])&&_0x21d5eb[_0xb75a('0x96')]<=parseInt(_0x49f5a4['maxdigit'])?'x':'i';}var _0x5369f3=this[_0xb75a('0x12')][_0xb75a('0x68')](this,_0x49f5a4[_0xb75a('0xd3')]);if(!_0x5369f3){return this[_0xb75a('0xe')][_0xb75a('0x2b')](_0x49f5a4,'no\x20variable\x20found');}this[_0xb75a('0xe')][_0xb75a('0x9a')](_0x5369f3,_0x21d5eb);if(this[_0xb75a('0x7e')](_0x49f5a4[_0xb75a('0x11a')])){var _0x3ab9e1=parseInt(_0x49f5a4[_0xb75a('0x11a')],0xa);var _0xefd73e=rs[_0xb75a('0x11b')]({'charset':'*','length':_0x3ab9e1});var _0x409b22=_0x21d5eb[_0xb75a('0x96')];if(_0x409b22>0x0){if(_0x409b22>_0x3ab9e1){this['createSquareDetailsReport']['sync'](this,_0x49f5a4,_0x49f5a4['hiddendigitspos']===_0xb75a('0x11c')?_0xefd73e+_0x21d5eb[_0xb75a('0x11d')](_0x3ab9e1):_0x21d5eb['substr'](0x0,_0x409b22-_0x3ab9e1)+_0xefd73e);}else{this[_0xb75a('0x36')][_0xb75a('0x68')](this,_0x49f5a4,rs[_0xb75a('0x11b')]({'charset':'*','length':_0x409b22}));}}else{this['createSquareDetailsReport'][_0xb75a('0x68')](this,_0x49f5a4,'');}}else{this[_0xb75a('0x36')][_0xb75a('0x68')](this,_0x49f5a4,_0x21d5eb);}return _0x2ad1d5;};AGIVertices[_0xb75a('0x11')][_0xb75a('0x11e')]=function(_0x236150){logger[_0xb75a('0x2e')](util[_0xb75a('0x28')]('Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block',_0x236150[_0xb75a('0x38')]));return this['getdigits'](_0x236150);};AGIVertices[_0xb75a('0x11')][_0xb75a('0x11f')]=function(_0x4bac40){logger[_0xb75a('0x2e')](util[_0xb75a('0x28')](_0xb75a('0x120'),_0x4bac40[_0xb75a('0x38')]));this['createSquareDetailsReport'][_0xb75a('0x68')](this,_0x4bac40,_0x4bac40[_0xb75a('0x121')]);return this[_0xb75a('0xe')][_0xb75a('0xa2')](util[_0xb75a('0x28')](_0xb75a('0x122'),_0x4bac40['goalname']));};AGIVertices[_0xb75a('0x11')][_0xb75a('0x123')]=function(_0x19b36a){logger[_0xb75a('0x2e')](util[_0xb75a('0x28')]('[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block',_0x19b36a['label']));if(!this[_0xb75a('0x7e')](_0x19b36a[_0xb75a('0x81')])||!this['isConfigured'](_0x19b36a[_0xb75a('0x82')])){return this[_0xb75a('0xe')][_0xb75a('0xa2')](_0xb75a('0x124'));}if(!this[_0xb75a('0x7e')](_0x19b36a[_0xb75a('0x57')])){return this[_0xb75a('0xe')][_0xb75a('0xa2')](_0xb75a('0xa3'));}this['channel']['noop'](util['format'](_0xb75a('0x125'),_0x19b36a[_0xb75a('0x57')]));var _0xd54cd6=this[_0xb75a('0x80')][_0xb75a('0x68')](this,_0x19b36a);if(_0xd54cd6){this[_0xb75a('0xe')][_0xb75a('0xa2')](util['format'](_0xb75a('0x126'),_0xd54cd6));var _0x3d4e91=this['channel']['streamFile'](_0xd54cd6);try{fs[_0xb75a('0x127')](_0xd54cd6+_0xb75a('0x128'));}catch(_0x945ed){logger['error'](_0x945ed);}return _0x3d4e91;}return this[_0xb75a('0xe')]['error'](_0x19b36a,_0xb75a('0x129'));};AGIVertices['prototype'][_0xb75a('0x12a')]=function(_0x55a4cd){logger['info'](util['format'](_0xb75a('0x12b'),_0x55a4cd[_0xb75a('0x38')]));if(!this[_0xb75a('0x7e')](_0x55a4cd[_0xb75a('0x81')])||!this[_0xb75a('0x7e')](_0x55a4cd[_0xb75a('0x82')])){return this['channel']['noop'](_0xb75a('0x124'));}if(!this['isConfigured'](_0x55a4cd['aws_bot_name'])){return this[_0xb75a('0xe')]['noop'](_0xb75a('0x12c'));}if(!this['isConfigured'](_0x55a4cd['text'])){return this['channel'][_0xb75a('0xa2')](_0xb75a('0xa3'));}this[_0xb75a('0xe')][_0xb75a('0xe7')]=!![];this[_0xb75a('0x36')](_0x55a4cd);this[_0xb75a('0x40')](_0x55a4cd[_0xb75a('0x57')],'in','','');this['channel'][_0xb75a('0xa2')](util[_0xb75a('0x28')](_0xb75a('0x12d'),_0x55a4cd[_0xb75a('0x57')]));var _0xfc53d2=this['awsLex'][_0xb75a('0x68')](this,_0x55a4cd);if(_0xfc53d2){for(var _0x14c917 in _0xfc53d2){if(_0xfc53d2['hasOwnProperty'](_0x14c917)&&_['isString'](_0xfc53d2[_0x14c917])){this['channel'][_0xb75a('0x9a')](util[_0xb75a('0x28')](_0xb75a('0x12e'),_0x14c917[_0xb75a('0xe9')]()),_0xfc53d2[_0x14c917]);}}if(_[_0xb75a('0x43')](_0xfc53d2['message'])){return this[_0xb75a('0xe')][_0xb75a('0xa2')](_0xb75a('0x12f'));}else{this[_0xb75a('0x40')](_0xfc53d2['message'],_0xb75a('0xeb'),_0xb75a('0x130'),'');return this[_0xb75a('0xe')]['noop'](util[_0xb75a('0x28')](_0xb75a('0x131'),_0xfc53d2[_0xb75a('0x132')]));}}return this['channel'][_0xb75a('0x2b')](_0x55a4cd,_0xb75a('0x133'));};AGIVertices['prototype'][_0xb75a('0x134')]=function(_0x224456){logger[_0xb75a('0x2e')](util['format'](_0xb75a('0x135'),_0x224456[_0xb75a('0x38')],_0x224456[_0xb75a('0x61')]));if(!this['isConfigured'](_0x224456['key'])){return this[_0xb75a('0xe')]['noop'](_0xb75a('0xe6'));}var _0x1388db=_0xb75a('0x136');var _0x2784af=util[_0xb75a('0x28')](_0xb75a('0x137'),FILES_PATH,rs[_0xb75a('0x11b')](0x4));var _0x360978=util['format'](_0xb75a('0x99'),_0x2784af,_0x1388db);var _0x34312b=!![];if(_0x224456[_0xb75a('0x138')]===_0xb75a('0x139')){_0x34312b=![];}var _0x41e01c=this[_0xb75a('0xe')]['recordFile'](_0x2784af,_0x1388db,_0x224456[_0xb75a('0x13a')],_0x224456[_0xb75a('0x61')],undefined,_0x34312b);if(_0x41e01c[_0xb75a('0x9e')]!==-0x1){this[_0xb75a('0xe')]['noop'](util[_0xb75a('0x28')](_0xb75a('0x13b'),_0x360978));var _0x12633a=this[_0xb75a('0x89')]['sync'](this,_0x224456,_0x360978);if(_0x12633a){for(var _0x4f0582 in _0x12633a){if(_0x12633a['hasOwnProperty'](_0x4f0582)){this[_0xb75a('0xe')][_0xb75a('0x9a')](util[_0xb75a('0x28')]('GOOGLE_ASR_%s',_0x4f0582['toUpperCase']()),_0x12633a[_0x4f0582]);}}return this['channel'][_0xb75a('0xa2')](util[_0xb75a('0x28')](_0xb75a('0x13c'),JSON[_0xb75a('0x6b')](_0x12633a)));}}return _0x41e01c;};AGIVertices[_0xb75a('0x11')][_0xb75a('0x13d')]=function(_0x39a322){logger[_0xb75a('0x2e')](util[_0xb75a('0x28')](_0xb75a('0x13e'),_0x39a322['label']));if(!this[_0xb75a('0x7e')](_0x39a322[_0xb75a('0x8c')])){return this[_0xb75a('0xe')]['noop']('no\x20appid\x20configured');}if(!this['isConfigured'](_0x39a322['appsecret'])){return this[_0xb75a('0xe')][_0xb75a('0xa2')](_0xb75a('0x13f'));}var _0x673a80='wav';var _0x2fd982=util[_0xb75a('0x28')](_0xb75a('0x137'),FILES_PATH,rs[_0xb75a('0x11b')](0x4));var _0x372e48=util[_0xb75a('0x28')]('%s.%s',_0x2fd982,_0x673a80);var _0x183fdd=!![];if(_0x39a322[_0xb75a('0x138')]===_0xb75a('0x139')){_0x183fdd=![];}var _0x2ada36=this[_0xb75a('0xe')][_0xb75a('0x140')](_0x2fd982,_0x673a80,_0x39a322[_0xb75a('0x13a')],_0x39a322['timeout'],undefined,_0x183fdd);if(_0x2ada36[_0xb75a('0x9e')]!==-0x1){this[_0xb75a('0xe')][_0xb75a('0xa2')](util[_0xb75a('0x28')]('tilde\x20%s\x20file\x20created',_0x372e48));var _0x4efe53=this[_0xb75a('0x8b')]['sync'](this,_0x39a322,_0x372e48);if(_0x4efe53){for(var _0x297d60 in _0x4efe53){if(_0x4efe53[_0xb75a('0x91')](_0x297d60)){this[_0xb75a('0xe')]['setVariable'](util[_0xb75a('0x28')]('TILDE_ASR_%s',_0x297d60[_0xb75a('0xe9')]()),_0x4efe53[_0x297d60]);}}return this[_0xb75a('0xe')][_0xb75a('0xa2')](util[_0xb75a('0x28')](_0xb75a('0x141'),JSON[_0xb75a('0x6b')](_0x4efe53)));}}return _0x2ada36;};AGIVertices['prototype'][_0xb75a('0x142')]=function(_0x23bc16){logger[_0xb75a('0x2e')](util['format'](_0xb75a('0x143'),_0x23bc16[_0xb75a('0x38')]));return this[_0xb75a('0xe')][_0xb75a('0x144')](_0x23bc16[_0xb75a('0x145')],_0x23bc16['extension'],_0x23bc16[_0xb75a('0x3d')]);};AGIVertices[_0xb75a('0x11')][_0xb75a('0x146')]=function(_0x5b9be6){logger['info'](util[_0xb75a('0x28')](_0xb75a('0x147'),_0x5b9be6[_0xb75a('0x38')]));if(!this['isConfigured'](_0x5b9be6[_0xb75a('0x148')])){return this[_0xb75a('0xe')][_0xb75a('0x2b')](_0x5b9be6,'no\x20condition\x20configured');}try{var _0x5c580e=eval(_0x5b9be6[_0xb75a('0x148')])?_0xb75a('0x149'):_0xb75a('0x14a');this[_0xb75a('0xe')][_0xb75a('0xa2')](util[_0xb75a('0x28')](_0xb75a('0x14b'),_0x5b9be6[_0xb75a('0x148')],_0x5c580e));return{'code':0xc8,'result':_0x5c580e};}catch(_0x156f1b){return{'code':0xc8,'result':_0xb75a('0x14a')};}};AGIVertices[_0xb75a('0x11')]['gotoiftime']=function(_0x237b67){logger[_0xb75a('0x2e')](util[_0xb75a('0x28')](_0xb75a('0x14c'),_0x237b67[_0xb75a('0x38')]));if(!this['isConfigured'](_0x237b67['interval_id'])){return this[_0xb75a('0xe')][_0xb75a('0x2b')](_0x237b67,_0xb75a('0x14d'));}var _0x3d03ad=this[_0xb75a('0x22')][_0xb75a('0x68')](this,_0x237b67['interval_id']);if(!_0x3d03ad){return this[_0xb75a('0xe')]['error'](_0x237b67,_0xb75a('0x14e'));}for(var _0x3bbfd7=0x0;_0x3bbfd7<_0x3d03ad[_0xb75a('0x96')];_0x3bbfd7+=0x1){var _0x18c662=this[_0xb75a('0xe')][_0xb75a('0x12')](util[_0xb75a('0x28')](_0xb75a('0x14f'),_0x3d03ad[_0x3bbfd7]));if(_0x18c662[_0xb75a('0x9e')]===-0x1){return _0x18c662;}logger[_0xb75a('0x2e')](util['format']('IFTIME\x20%s\x20%s',_0x3d03ad[_0x3bbfd7],_0x18c662[_0xb75a('0x9c')]));if(_0x18c662['extra']===_0xb75a('0x149')){logger[_0xb75a('0x2e')](util[_0xb75a('0x28')]('IFTIME\x20%s\x20%s',_0x3d03ad[_0x3bbfd7],'true'));this['channel'][_0xb75a('0xa2')](util[_0xb75a('0x28')](_0xb75a('0x150'),_0x3d03ad[_0x3bbfd7],'true'));return{'code':0xc8,'result':_0xb75a('0x149')};}else{logger['info'](util[_0xb75a('0x28')](_0xb75a('0x150'),_0x3d03ad[_0x3bbfd7],_0xb75a('0x14a')));this[_0xb75a('0xe')][_0xb75a('0xa2')](util['format']('IFTIME\x20%s\x20%s',_0x3d03ad[_0x3bbfd7],_0xb75a('0x14a')));}}return{'code':0xc8,'result':_0xb75a('0x14a')};};AGIVertices[_0xb75a('0x11')][_0xb75a('0x151')]=function(_0x2b2428){logger['info'](util['format']('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0x2b2428['label']));return this[_0xb75a('0xe')][_0xb75a('0x151')]();};AGIVertices['prototype'][_0xb75a('0x152')]=function(_0x5efd32){logger[_0xb75a('0x2e')](util[_0xb75a('0x28')]('Enter\x20in\x20ISPEECHASR\x20(%s)\x20block',_0x5efd32[_0xb75a('0x38')]));if(!this[_0xb75a('0x7e')](_0x5efd32[_0xb75a('0x72')])){return this[_0xb75a('0xe')]['noop'](_0xb75a('0xe6'));}var _0x44e0a1=_0xb75a('0x136');var _0x1d7c48=util[_0xb75a('0x28')](_0xb75a('0x137'),FILES_PATH,rs[_0xb75a('0x11b')](0x4));var _0x3f2fbe=util[_0xb75a('0x28')](_0xb75a('0x99'),_0x1d7c48,_0x44e0a1);var _0x36ef6e=!![];if(_0x5efd32['beep']==='NOBEEP'){_0x36ef6e=![];}var _0x304251=this[_0xb75a('0xe')][_0xb75a('0x140')](_0x1d7c48,_0x44e0a1,_0x5efd32[_0xb75a('0x13a')],_0x5efd32[_0xb75a('0x61')],undefined,_0x36ef6e);if(_0x304251[_0xb75a('0x9e')]!==-0x1){this[_0xb75a('0xe')][_0xb75a('0xa2')](util['format']('ispeech\x20%s\x20file\x20created',_0x3f2fbe));var _0x513b2e=this[_0xb75a('0x7c')][_0xb75a('0x68')](this,_0x5efd32,_0x3f2fbe);if(_0x513b2e){for(var _0x531864 in _0x513b2e){if(_0x513b2e[_0xb75a('0x91')](_0x531864)){this['channel'][_0xb75a('0x9a')](util[_0xb75a('0x28')]('ISPEECH_ASR_%s',_0x531864[_0xb75a('0xe9')]()),_0x513b2e[_0x531864]);}}return this[_0xb75a('0xe')]['noop'](util[_0xb75a('0x28')]('IspeechASR\x20Result\x20%s',JSON['stringify'](_0x513b2e)));}}return _0x304251;};AGIVertices['prototype'][_0xb75a('0x153')]=function(_0x69f2c3){logger[_0xb75a('0x2e')](util['format']('Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block',_0x69f2c3[_0xb75a('0x38')]));if(!this[_0xb75a('0x7e')](_0x69f2c3[_0xb75a('0x72')])){return this[_0xb75a('0xe')]['noop']('no\x20key\x20configured');}if(!this['isConfigured'](_0x69f2c3[_0xb75a('0x57')])){return this[_0xb75a('0xe')][_0xb75a('0xa2')](_0xb75a('0xa3'));}this[_0xb75a('0xe')][_0xb75a('0xa2')](util['format']('Trying\x20ispeech\x20TTS\x20%s',_0x69f2c3[_0xb75a('0x57')]));var _0x3911af=this[_0xb75a('0x79')]['sync'](this,_0x69f2c3);if(_0x3911af){this[_0xb75a('0xe')][_0xb75a('0xa2')](util['format']('ispeech\x20%s\x20file\x20created',_0x3911af));var _0x33433e=this[_0xb75a('0xe')][_0xb75a('0x154')](_0x3911af,_0x69f2c3[_0xb75a('0x13a')]);try{fs[_0xb75a('0x127')](_0x3911af+_0xb75a('0x128'));}catch(_0x1c387b){logger[_0xb75a('0x2b')](_0x1c387b);}return _0x33433e;}return this['channel']['error'](_0x69f2c3,_0xb75a('0x155'));};AGIVertices[_0xb75a('0x11')][_0xb75a('0x156')]=function(_0x5e2c96){logger[_0xb75a('0x2e')](util[_0xb75a('0x28')](_0xb75a('0x157'),_0x5e2c96[_0xb75a('0x38')]));if(!this[_0xb75a('0x7e')](_0x5e2c96[_0xb75a('0x158')])){return this[_0xb75a('0xe')][_0xb75a('0x2b')](_0x5e2c96,_0xb75a('0x159'));}logger[_0xb75a('0x2e')](util[_0xb75a('0x28')](_0xb75a('0x15a'),this['channel'][_0xb75a('0x3a')],_0x5e2c96[_0xb75a('0x158')]));var _0x5ca36a=this['agentLogin'][_0xb75a('0x68')](this,_0x5e2c96['findBy']);if(_0x5ca36a){logger[_0xb75a('0x2e')](util[_0xb75a('0x28')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0xb75a('0x3a')],_0x5e2c96[_0xb75a('0x158')]));this['channel'][_0xb75a('0xa2')](util[_0xb75a('0x28')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xb75a('0xe')]['callerid'],_0x5e2c96[_0xb75a('0x158')]));return{'code':0xc8,'result':'success'};}else{logger[_0xb75a('0x2e')](util[_0xb75a('0x28')](_0xb75a('0x15b'),this[_0xb75a('0xe')][_0xb75a('0x3a')],_0x5e2c96[_0xb75a('0x158')]));this['channel']['noop'](util['format'](_0xb75a('0x15b'),this[_0xb75a('0xe')][_0xb75a('0x3a')],_0x5e2c96['findBy']));return{'code':0xc8,'result':_0xb75a('0x15c')};}};AGIVertices['prototype'][_0xb75a('0x15d')]=function(_0x470719){logger[_0xb75a('0x2e')](util[_0xb75a('0x28')]('Enter\x20in\x20LOGOUT\x20(%s)\x20block',_0x470719[_0xb75a('0x38')]));if(!this[_0xb75a('0x7e')](_0x470719[_0xb75a('0x158')])){return this['channel'][_0xb75a('0x2b')](_0x470719,'no\x20find\x20by\x20configured');}logger['info'](util[_0xb75a('0x28')](_0xb75a('0x15a'),this[_0xb75a('0xe')][_0xb75a('0x3a')],_0x470719[_0xb75a('0x158')]));var _0x4d6b83=this[_0xb75a('0x4f')][_0xb75a('0x68')](this,_0x470719[_0xb75a('0x158')]);if(_0x4d6b83){logger[_0xb75a('0x2e')](util[_0xb75a('0x28')]('AGENT\x20%s\x20FOUND\x20BY',this['channel']['callerid'],_0x470719[_0xb75a('0x158')]));this[_0xb75a('0xe')][_0xb75a('0xa2')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0xb75a('0xe')][_0xb75a('0x3a')],_0x470719[_0xb75a('0x158')]));return{'code':0xc8,'result':_0xb75a('0x15e')};}else{logger[_0xb75a('0x2e')](util[_0xb75a('0x28')](_0xb75a('0x15b'),this['channel']['callerid'],_0x470719[_0xb75a('0x158')]));this['channel'][_0xb75a('0xa2')](util['format'](_0xb75a('0x15b'),this[_0xb75a('0xe')]['callerid'],_0x470719[_0xb75a('0x158')]));return{'code':0xc8,'result':_0xb75a('0x15c')};}};AGIVertices[_0xb75a('0x11')][_0xb75a('0x15f')]=function(_0x1dbbbe){logger[_0xb75a('0x2e')](util[_0xb75a('0x28')](_0xb75a('0x160'),_0x1dbbbe['label']));if(!this[_0xb75a('0x7e')](_0x1dbbbe[_0xb75a('0x161')])){return this[_0xb75a('0xe')][_0xb75a('0x2b')](_0x1dbbbe,_0xb75a('0x162'));}this[_0xb75a('0xe')][_0xb75a('0xa2')](util[_0xb75a('0x28')]('math\x20%s',_0x1dbbbe[_0xb75a('0x161')]));var _0x2770cf=eval(_0x1dbbbe[_0xb75a('0x161')]);if(!this[_0xb75a('0x7e')](_0x1dbbbe[_0xb75a('0xd3')])){return this[_0xb75a('0xe')][_0xb75a('0xa2')](_0xb75a('0xd4'));}var _0xc32940=this[_0xb75a('0x12')][_0xb75a('0x68')](this,_0x1dbbbe['variable_id']);if(!_0xc32940){return this[_0xb75a('0xe')][_0xb75a('0x2b')](_0x1dbbbe,_0xb75a('0xd5'));}if(_[_0xb75a('0x163')](_0x2770cf)){var _0x178027=this;_0x2770cf['forEach'](function(_0x276f2e,_0x156b77){_0x178027[_0xb75a('0xe')][_0xb75a('0x9a')](util[_0xb75a('0x28')](_0xb75a('0x164'),_0xc32940,_0x156b77),_0x276f2e);});return this[_0xb75a('0xe')][_0xb75a('0xa2')](util[_0xb75a('0x28')](_0xb75a('0x165'),_0xc32940));}else{return this[_0xb75a('0xe')][_0xb75a('0x9a')](_0xc32940,_0x2770cf);}};AGIVertices[_0xb75a('0x11')][_0xb75a('0x166')]=function(_0x4a3ebf){logger[_0xb75a('0x2e')](util[_0xb75a('0x28')](_0xb75a('0x167'),_0x4a3ebf[_0xb75a('0x38')]));if(_0x4a3ebf[_0xb75a('0x112')]===0x0){return this['maxRetry'](_0x4a3ebf);}_0x4a3ebf[_0xb75a('0x112')]-=0x1;if(!this[_0xb75a('0x7e')](_0x4a3ebf[_0xb75a('0x113')])){return this['channel'][_0xb75a('0x2b')](_0x4a3ebf,_0xb75a('0x114'));}var _0x3b6627=this[_0xb75a('0x115')][_0xb75a('0x68')](this,_0x4a3ebf[_0xb75a('0x113')]);if(!_0x3b6627){return this['channel']['error'](_0x4a3ebf,_0xb75a('0x168'));}var _0x269620=this[_0xb75a('0xe')][_0xb75a('0x116')](_0x3b6627,_0x4a3ebf[_0xb75a('0x117')],_0x4a3ebf[_0xb75a('0x169')]);var _0x4043d5=_0x269620[_0xb75a('0x9e')];if(_0x269620[_0xb75a('0x9e')]===-0x1){this[_0xb75a('0x36')]['sync'](this,_0x4a3ebf,'-1');return _0x269620;}else if(_0x269620[_0xb75a('0x9c')]===_0xb75a('0x61')){_0x269620[_0xb75a('0x9e')]=_0x269620[_0xb75a('0x9e')][_0xb75a('0x96')]>0x0?_0x269620['result']:'t';}else if(_[_0xb75a('0x42')](_0x269620[_0xb75a('0x9e')])){_0x269620[_0xb75a('0x9e')]='#';_0x4043d5='#';}if(!this[_0xb75a('0x7e')](_0x4a3ebf['variable_id'])){this[_0xb75a('0xe')][_0xb75a('0xa2')](_0xb75a('0xd4'));}else{var _0x2fc4da=this[_0xb75a('0x12')][_0xb75a('0x68')](this,_0x4a3ebf['variable_id']);if(!_0x2fc4da){return this[_0xb75a('0xe')]['error'](_0x4a3ebf,'no\x20variable\x20found');}this['channel'][_0xb75a('0x9a')](_0x2fc4da,_0x4043d5);}this['createSquareDetailsReport'][_0xb75a('0x68')](this,_0x4a3ebf,_0x4043d5);return _0x269620;};AGIVertices['prototype'][_0xb75a('0xa2')]=function(_0xd3154b){logger['info'](util[_0xb75a('0x28')](_0xb75a('0x16a'),_0xd3154b[_0xb75a('0x38')]));return this[_0xb75a('0xe')][_0xb75a('0xa2')](_0xd3154b[_0xb75a('0x16b')]||_0xd3154b[_0xb75a('0x38')]);};AGIVertices[_0xb75a('0x11')][_0xb75a('0x16c')]=function(_0x53d86e){logger[_0xb75a('0x2e')](util['format'](_0xb75a('0x16d'),_0x53d86e[_0xb75a('0x38')]));if(!this[_0xb75a('0x7e')](_0x53d86e[_0xb75a('0x158')])){return this[_0xb75a('0xe')][_0xb75a('0x2b')](_0x53d86e,_0xb75a('0x159'));}logger['info'](util[_0xb75a('0x28')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this['channel'][_0xb75a('0x3a')],_0x53d86e[_0xb75a('0x158')]));var _0x378687=this['getPause'][_0xb75a('0x68')](this,_0x53d86e['pause_id']);var _0x5b3570=this['agentPause']['sync'](this,_0x53d86e[_0xb75a('0x158')],_0x378687);if(_0x5b3570){logger[_0xb75a('0x2e')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0xb75a('0xe')][_0xb75a('0x3a')],_0x53d86e['findBy']));this[_0xb75a('0xe')][_0xb75a('0xa2')](util['format'](_0xb75a('0x16e'),this['channel'][_0xb75a('0x3a')],_0x53d86e['findBy']));return{'code':0xc8,'result':_0xb75a('0x15e')};}else{logger[_0xb75a('0x2e')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xb75a('0xe')][_0xb75a('0x3a')],_0x53d86e['findBy']));this[_0xb75a('0xe')][_0xb75a('0xa2')](util[_0xb75a('0x28')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xb75a('0xe')]['callerid'],_0x53d86e[_0xb75a('0x158')]));return{'code':0xc8,'result':_0xb75a('0x15c')};}};AGIVertices['prototype'][_0xb75a('0x16f')]=function(_0x1c7634){logger[_0xb75a('0x2e')](util[_0xb75a('0x28')](_0xb75a('0x170'),_0x1c7634[_0xb75a('0x38')]));if(!this[_0xb75a('0x7e')](_0x1c7634['file_id'])){return this[_0xb75a('0xe')][_0xb75a('0x2b')](_0x1c7634,_0xb75a('0x114'));}var _0x2579ce=this['getSound'][_0xb75a('0x68')](this,_0x1c7634[_0xb75a('0x113')]);if(!_0x2579ce){return this[_0xb75a('0xe')][_0xb75a('0x2b')](_0x1c7634,'no\x20file\x20audio\x20found');}var _0x122e2b=this[_0xb75a('0xe')][_0xb75a('0xa4')]('PLAYBACK',[_0x2579ce,_0x1c7634[_0xb75a('0x10e')]]);if(_0x122e2b[_0xb75a('0x9e')]===-0x1){return _0x122e2b;}return this[_0xb75a('0xe')][_0xb75a('0xa2')](util[_0xb75a('0x28')](_0xb75a('0xbf'),_0xb75a('0x171'),_0x2579ce));};AGIVertices[_0xb75a('0x11')]['queue']=function(_0x123f1a){logger[_0xb75a('0x2e')](util[_0xb75a('0x28')](_0xb75a('0x172'),_0x123f1a[_0xb75a('0x38')]));if(!this[_0xb75a('0x7e')](_0x123f1a[_0xb75a('0x173')])){return this[_0xb75a('0xe')][_0xb75a('0x2b')](_0x123f1a,_0xb75a('0x174'));}var _0x26a2dc='';var _0x54c8fa=parseInt(_0x123f1a[_0xb75a('0x173')],0xa);if(isNaN(_0x54c8fa)){_0x26a2dc=_0x123f1a['queue_id'];}else{_0x26a2dc=this[_0xb75a('0x175')]['sync'](this,_0x123f1a[_0xb75a('0x173')]);if(!_0x26a2dc){return this['channel']['error'](_0x123f1a,_0xb75a('0x176'));}}var _0x5ab2c8='';if(this[_0xb75a('0x7e')](_0x123f1a[_0xb75a('0x113')])){var _0x18b3b9=this[_0xb75a('0x115')][_0xb75a('0x68')](this,_0x123f1a['file_id']);if(_0x18b3b9){_0x5ab2c8=_0x18b3b9;}}this['createSquareDetailsReport'][_0xb75a('0x68')](this,_0x123f1a,_0x26a2dc);if(_0x123f1a[_0xb75a('0x10e')]['indexOf']('x')<0x0){_0x123f1a[_0xb75a('0x10e')]+='x';}if(_0x123f1a[_0xb75a('0x10e')][_0xb75a('0x177')]('X')<0x0){_0x123f1a[_0xb75a('0x10e')]+='X';}this[_0xb75a('0xe')]['setVariable']('XMCS-QUEUE',_0x26a2dc?_0x26a2dc[_0xb75a('0x178')]():'');var _0x2e8456=this['channel'][_0xb75a('0xa4')]('QUEUE',[_0x26a2dc,_0x123f1a[_0xb75a('0x10e')],_0x123f1a[_0xb75a('0x5f')],_0x5ab2c8,_0x123f1a['timeout'],_0x123f1a[_0xb75a('0x8')],_0x123f1a[_0xb75a('0x179')],_0x123f1a[_0xb75a('0x17a')],'',_0x123f1a[_0xb75a('0x17b')]]);if(_0x2e8456[_0xb75a('0x9e')]===-0x1){return _0x2e8456;}return this[_0xb75a('0xe')]['noop'](util[_0xb75a('0x28')](_0xb75a('0xbf'),'QUEUE',_0x26a2dc));};AGIVertices[_0xb75a('0x11')]['record']=function(_0x32435d){logger['info'](util[_0xb75a('0x28')](_0xb75a('0x17c'),_0x32435d[_0xb75a('0x38')]));var _0x3b16f5=_0x32435d[_0xb75a('0x17d')]||_0xb75a('0x136');var _0x209d27=util['format'](_0xb75a('0x17e'),this[_0xb75a('0xe')]['uniqueid'],rs[_0xb75a('0x11b')](0x5));var _0x51a92f=util[_0xb75a('0x28')]('%s/recordings/%s.%s',FILES_PATH,_0x209d27,_0x3b16f5);var _0x9c339f=util[_0xb75a('0x28')](_0xb75a('0x137'),FILES_PATH,_0x209d27);this['createSquareRecording'][_0xb75a('0x68')](this,_0x32435d,_0x209d27,_0x51a92f);this[_0xb75a('0xe')][_0xb75a('0x9a')](_0xb75a('0x17f'),_0x209d27);logger['info'](_0xb75a('0x180'),_0x9c339f,_0x3b16f5,_0x32435d[_0xb75a('0x181')],_0x32435d['timeout']);return this['channel']['recordFile'](_0x9c339f,_0x3b16f5,_0x32435d[_0xb75a('0x181')],_0x32435d['timeout'],undefined,!![]);};AGIVertices['prototype'][_0xb75a('0x182')]=function(_0x519929){logger[_0xb75a('0x2e')](util[_0xb75a('0x28')]('Enter\x20in\x20RESTAPI\x20(%s)\x20block',_0x519929[_0xb75a('0x38')]));if(!this[_0xb75a('0x7e')](_0x519929[_0xb75a('0x5f')])){return this[_0xb75a('0xe')][_0xb75a('0xa2')]('no\x20url\x20configured');}var _0x722fde=this[_0xb75a('0x5e')][_0xb75a('0x68')](this,_0x519929);logger['info'](util[_0xb75a('0x28')](_0xb75a('0x183'),util[_0xb75a('0x184')](_0x722fde,{'showHidden':![],'depth':null})));if(!this['isConfigured'](_0x519929['variable_id'])){return this[_0xb75a('0xe')][_0xb75a('0xa2')](_0xb75a('0x185'));}var _0x1b9ca7=this[_0xb75a('0x12')]['sync'](this,_0x519929[_0xb75a('0xd3')]);if(!_0x1b9ca7){return this[_0xb75a('0xe')][_0xb75a('0x2b')](_0x519929,'no\x20variable\x20found');}this['channel'][_0xb75a('0x9a')](util[_0xb75a('0x28')](_0xb75a('0x186'),_0x1b9ca7),_0x722fde['statusCode']?_0x722fde[_0xb75a('0x6d')]:_0xb75a('0x187'));this['channel'][_0xb75a('0x9a')](util[_0xb75a('0x28')](_0xb75a('0x188'),_0x1b9ca7),_0x722fde['statusMessage']?_0x722fde[_0xb75a('0x6e')]:'OK');if(_0x722fde['body']){try{this['saveRestApiResult'](_0x722fde['body'],_0x1b9ca7);}catch(_0x54c6cd){logger[_0xb75a('0x2b')](util['format'](_0xb75a('0x189'),_0x1b9ca7));}}return this[_0xb75a('0xe')][_0xb75a('0xa2')](util['format']('variable\x20%s\x20set',_0x1b9ca7));};AGIVertices[_0xb75a('0x11')]['saydigits']=function(_0x4edffb){logger[_0xb75a('0x2e')](util['format'](_0xb75a('0x18a'),_0x4edffb[_0xb75a('0x38')]));return this[_0xb75a('0xe')][_0xb75a('0x18b')](_0x4edffb['digits'][_0xb75a('0x54')](/\s+/g,''),_0x4edffb['escape_digits']);};AGIVertices['prototype']['saynumber']=function(_0x2e2f9d){logger[_0xb75a('0x2e')](util['format'](_0xb75a('0x18c'),_0x2e2f9d[_0xb75a('0x38')]));return this['channel'][_0xb75a('0x18d')](_0x2e2f9d[_0xb75a('0x62')][_0xb75a('0x54')](/\s+/g,''),_0x2e2f9d['escape_digits']);};AGIVertices['prototype']['sayphonetic']=function(_0x303b88){logger['info'](util[_0xb75a('0x28')](_0xb75a('0x18e'),_0x303b88[_0xb75a('0x38')]));return this[_0xb75a('0xe')][_0xb75a('0x18f')](_0x303b88[_0xb75a('0x57')],_0x303b88[_0xb75a('0x181')]);};AGIVertices['prototype'][_0xb75a('0x190')]=function(_0x518419){logger[_0xb75a('0x2e')](util[_0xb75a('0x28')](_0xb75a('0x191'),_0x518419['label']));if(!this['isConfigured'](_0x518419[_0xb75a('0x192')])){return this[_0xb75a('0xe')][_0xb75a('0xa2')](_0xb75a('0x193'));}var _0xf9a245=this[_0xb75a('0x1f')][_0xb75a('0x68')](this,_0x518419[_0xb75a('0x192')]);if(!_0xf9a245||!_0xf9a245['Smtp']){return this[_0xb75a('0xe')][_0xb75a('0x2b')](_0x518419,_0xb75a('0x194'));}var _0x2b37dd={'from':util[_0xb75a('0x28')]('\x22%s\x22\x20<%s>',_0xf9a245[_0xb75a('0x15')],_0xf9a245[_0xb75a('0x195')]||_0xf9a245[_0xb75a('0x196')]['user']),'to':_0x518419['to']||'','cc':_0x518419['cc']||'','bcc':_0x518419['bcc']||'','subject':_0x518419[_0xb75a('0x197')],'html':_0x518419[_0xb75a('0x57')],'text':_0x518419[_0xb75a('0x57')]};var _0x1377cc={'tls':{'rejectUnauthorized':![]}};if(_0xf9a245[_0xb75a('0x196')][_0xb75a('0x198')]){_0x1377cc[_0xb75a('0x198')]=_0xf9a245[_0xb75a('0x196')][_0xb75a('0x198')];}else{_0x1377cc[_0xb75a('0x199')]=_0xf9a245[_0xb75a('0x196')][_0xb75a('0x199')];_0x1377cc[_0xb75a('0x19a')]=_0xf9a245['Smtp'][_0xb75a('0x19a')];_0x1377cc[_0xb75a('0x19b')]=_0xf9a245[_0xb75a('0x196')][_0xb75a('0x19b')];}if(_0xf9a245[_0xb75a('0x196')][_0xb75a('0x19c')]){_0x1377cc[_0xb75a('0x19d')]={'user':_0xf9a245[_0xb75a('0x196')]['user'],'pass':_0xf9a245['Smtp'][_0xb75a('0x19e')]};}if(this[_0xb75a('0x7e')](_0x518419['template_id'])){}logger[_0xb75a('0xdc')](_0xb75a('0x19f'),JSON[_0xb75a('0x6b')](_0x2b37dd));this[_0xb75a('0x36')][_0xb75a('0x68')](this,_0x518419,_0x518419['account_id']);this[_0xb75a('0xe')][_0xb75a('0xa2')](util[_0xb75a('0x28')](_0xb75a('0x1a0'),_0xf9a245['name']));this[_0xb75a('0x21')][_0xb75a('0x68')](this,_0x1377cc,_0x2b37dd);return this[_0xb75a('0xe')][_0xb75a('0xa2')](_0xb75a('0x1a1'));};AGIVertices[_0xb75a('0x11')][_0xb75a('0x1a2')]=function(_0x4eea93){logger[_0xb75a('0x2e')](util[_0xb75a('0x28')]('Enter\x20in\x20SENDFAX\x20(%s)\x20block',_0x4eea93[_0xb75a('0x38')]));return this['channel'][_0xb75a('0xa2')](_0xb75a('0x1a3'));};AGIVertices[_0xb75a('0x11')][_0xb75a('0x1a4')]=function(_0x29c5d2){logger[_0xb75a('0x2e')](util['format'](_0xb75a('0x1a5'),_0x29c5d2['label']));if(!this[_0xb75a('0x7e')](_0x29c5d2[_0xb75a('0x1a6')])){return this[_0xb75a('0xe')][_0xb75a('0xa2')](_0xb75a('0x1a7'));}var _0x110fe1=this[_0xb75a('0x33')][_0xb75a('0x68')](this,_0x29c5d2['sms_account_id']);if(!_0x110fe1){return this[_0xb75a('0xe')]['error'](_0x29c5d2,'no\x20sms\x20account\x20found');}var _0xe8086={'body':_0x29c5d2['sms_text'],'phone':_0x29c5d2['to']||'','SmsAccountId':_0x110fe1['id']};logger['debug']('sendSMS\x20message',JSON[_0xb75a('0x6b')](_0xe8086));this['createSquareDetailsReport']['sync'](this,_0x29c5d2,_0x29c5d2[_0xb75a('0x1a6')]);this[_0xb75a('0xe')][_0xb75a('0xa2')](util[_0xb75a('0x28')]('Trying\x20SendSMS\x20with\x20account\x20%s',_0x110fe1[_0xb75a('0x15')]));this[_0xb75a('0x35')][_0xb75a('0x68')](this,_0xe8086);return this[_0xb75a('0xe')][_0xb75a('0xa2')](_0xb75a('0x1a8'));};AGIVertices['prototype'][_0xb75a('0x1a9')]=function(_0x3cf618){logger[_0xb75a('0x2e')](util[_0xb75a('0x28')]('Enter\x20in\x20SET\x20(%s)\x20block',_0x3cf618['label']));if(!this[_0xb75a('0x7e')](_0x3cf618[_0xb75a('0xd3')])){return this['channel'][_0xb75a('0x2b')](_0x3cf618,'no\x20variable\x20selected');}var _0x3758f3=this['getVariable'][_0xb75a('0x68')](this,_0x3cf618['variable_id']);if(!_0x3758f3){return this['channel']['error'](_0x3cf618,_0xb75a('0xd5'));}return this['channel'][_0xb75a('0x9a')](_0x3758f3,_0x3cf618[_0xb75a('0x1aa')]);};AGIVertices[_0xb75a('0x11')][_0xb75a('0x1ab')]=function(_0x302363){logger[_0xb75a('0x2e')](util[_0xb75a('0x28')](_0xb75a('0x1ac'),_0x302363[_0xb75a('0x38')]));this[_0xb75a('0xe')][_0xb75a('0xa2')](_0xb75a('0x1ad'));if(_0x302363[_0xb75a('0xb6')]===_0xb75a('0x1ae')){this['channel'][_0xb75a('0xa2')]('Answer');return this['channel'][_0xb75a('0xb6')]();}return this[_0xb75a('0xe')][_0xb75a('0xa2')](_0xb75a('0x1af'));};AGIVertices[_0xb75a('0x11')][_0xb75a('0x1b0')]=function(_0x1bbf96){logger[_0xb75a('0x2e')](util[_0xb75a('0x28')](_0xb75a('0x1b1'),_0x1bbf96[_0xb75a('0x38')]));if(!this['isConfigured'](_0x1bbf96[_0xb75a('0x1b2')])){return this[_0xb75a('0xe')][_0xb75a('0x2b')](_0x1bbf96,'no\x20subproject\x20selected');}var _0x38eead=this[_0xb75a('0x1b3')]['sync'](this,_0x1bbf96[_0xb75a('0x1b2')]);if(!this['isConfigured'](_0x38eead)){return this[_0xb75a('0xe')][_0xb75a('0x2b')](_0x1bbf96,util['format'](_0xb75a('0x1b4'),_0x1bbf96[_0xb75a('0x1b2')]));}if(_0x38eead===this[_0xb75a('0xe')]['arg_1']){return this[_0xb75a('0xe')][_0xb75a('0x2b')](_0x1bbf96,_0xb75a('0x1b5'));}this[_0xb75a('0x36')][_0xb75a('0x68')](this,_0x1bbf96,_0x38eead);var _0xb8aace=this[_0xb75a('0xe')]['exec']('AGI',util[_0xb75a('0x28')](_0xb75a('0x1b6'),config[_0xb75a('0x8')][_0xb75a('0x199')]||'127.0.0.1',_0x38eead,this['channel'][_0xb75a('0x39')]));if(_0xb8aace[_0xb75a('0x9e')]===-0x1){return _0xb8aace;}return this['channel']['noop'](util['format'](_0xb75a('0xbf'),_0xb75a('0x1b7'),_0x38eead));};AGIVertices[_0xb75a('0x11')][_0xb75a('0x1b8')]=function(_0x31aa1d){logger[_0xb75a('0x2e')](util[_0xb75a('0x28')](_0xb75a('0x1b9'),_0x31aa1d[_0xb75a('0x38')]));var _0x2a5eae=this[_0xb75a('0x52')]['sync'](this,_0x31aa1d[_0xb75a('0xb1')]);this[_0xb75a('0x36')][_0xb75a('0x68')](this,_0x31aa1d,_0x31aa1d['command']);if(this[_0xb75a('0x7e')](_0x31aa1d['variable_id'])){var _0x148d4b=this['getVariable'][_0xb75a('0x68')](this,_0x31aa1d['variable_id']);if(_0x148d4b){this[_0xb75a('0xe')][_0xb75a('0x9a')](_0x148d4b,_0x2a5eae);return this[_0xb75a('0xe')][_0xb75a('0xa2')](util[_0xb75a('0x28')](_0xb75a('0x1ba'),_0x31aa1d[_0xb75a('0xb1')],_0x148d4b));}}return this[_0xb75a('0xe')][_0xb75a('0xa2')](util[_0xb75a('0x28')](_0xb75a('0x1bb'),_0x31aa1d[_0xb75a('0xb1')]));};AGIVertices['prototype'][_0xb75a('0x1bc')]=function(_0x2e5fea){logger[_0xb75a('0x2e')](util[_0xb75a('0x28')]('Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block',_0x2e5fea['label']));_0x2e5fea[_0xb75a('0x57')]=_0x2e5fea['text'][_0xb75a('0x54')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x2e5fea[_0xb75a('0x56')])){return this[_0xb75a('0xe')][_0xb75a('0xa2')](_0xb75a('0x1bd'));}if(!this[_0xb75a('0x7e')](_0x2e5fea['text'])){return this[_0xb75a('0xe')][_0xb75a('0xa2')](_0xb75a('0xa3'));}this[_0xb75a('0xe')][_0xb75a('0xa2')](util[_0xb75a('0x28')](_0xb75a('0x1be'),_0x2e5fea[_0xb75a('0x57')]));var _0x10d005=this[_0xb75a('0x55')][_0xb75a('0x68')](this,_0x2e5fea);if(_0x10d005){this[_0xb75a('0xe')][_0xb75a('0xa2')](util[_0xb75a('0x28')](_0xb75a('0x1bf'),_0x10d005));var _0x51ee77=this[_0xb75a('0xe')]['streamFile'](_0x10d005);try{fs[_0xb75a('0x127')](_0x10d005+_0xb75a('0x128'));}catch(_0x5cb591){logger['error'](_0x5cb591);}return _0x51ee77;}return this[_0xb75a('0xe')][_0xb75a('0x2b')](_0x2e5fea,_0xb75a('0x1c0'));};AGIVertices[_0xb75a('0x11')][_0xb75a('0x1c1')]=function(_0x5d12b){logger['info'](util[_0xb75a('0x28')](_0xb75a('0x1c2'),_0x5d12b[_0xb75a('0x38')]));_0x5d12b['text']=_0x5d12b[_0xb75a('0x57')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xb75a('0x7e')](_0x5d12b['text'])){return this[_0xb75a('0xe')][_0xb75a('0xa2')](_0xb75a('0xa3'));}this[_0xb75a('0xe')][_0xb75a('0xa2')](util[_0xb75a('0x28')](_0xb75a('0x1c3'),_0x5d12b[_0xb75a('0x57')]));var _0x385e12=this[_0xb75a('0x5c')][_0xb75a('0x68')](this,_0x5d12b);if(_0x385e12){this['channel'][_0xb75a('0xa2')](util[_0xb75a('0x28')](_0xb75a('0x1c4'),_0x385e12));var _0x500c17=this[_0xb75a('0xe')][_0xb75a('0x154')](_0x385e12);try{fs[_0xb75a('0x127')](_0x385e12+_0xb75a('0x128'));}catch(_0x18234d){logger['error'](_0x18234d);}return _0x500c17;}return this['channel'][_0xb75a('0x2b')](_0x5d12b,_0xb75a('0x1c5'));};AGIVertices['prototype']['unpause']=function(_0x801c7c){logger[_0xb75a('0x2e')](util[_0xb75a('0x28')](_0xb75a('0x1c6'),_0x801c7c[_0xb75a('0x38')]));if(!this['isConfigured'](_0x801c7c[_0xb75a('0x158')])){return this[_0xb75a('0xe')][_0xb75a('0x2b')](_0x801c7c,_0xb75a('0x159'));}logger[_0xb75a('0x2e')](util[_0xb75a('0x28')](_0xb75a('0x15a'),this[_0xb75a('0xe')]['callerid'],_0x801c7c[_0xb75a('0x158')]));var _0x5c4cf0=this[_0xb75a('0x4e')]['sync'](this,_0x801c7c[_0xb75a('0x158')]);if(_0x5c4cf0){logger[_0xb75a('0x2e')](util[_0xb75a('0x28')](_0xb75a('0x16e'),this['channel']['callerid'],_0x801c7c[_0xb75a('0x158')]));this[_0xb75a('0xe')]['noop'](util[_0xb75a('0x28')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xb75a('0xe')]['callerid'],_0x801c7c['findBy']));return{'code':0xc8,'result':_0xb75a('0x15e')};}else{logger[_0xb75a('0x2e')](util[_0xb75a('0x28')](_0xb75a('0x15b'),this[_0xb75a('0xe')][_0xb75a('0x3a')],_0x801c7c[_0xb75a('0x158')]));this[_0xb75a('0xe')][_0xb75a('0xa2')](util[_0xb75a('0x28')](_0xb75a('0x15b'),this[_0xb75a('0xe')][_0xb75a('0x3a')],_0x801c7c['findBy']));return{'code':0xc8,'result':_0xb75a('0x15c')};}};AGIVertices['prototype'][_0xb75a('0x1c7')]=function(_0x579b1f){logger[_0xb75a('0x2e')](util[_0xb75a('0x28')](_0xb75a('0x1c8'),_0x579b1f[_0xb75a('0x38')]));var _0x2ebd4c=this['channel'][_0xb75a('0xa4')](_0xb75a('0x1c9'),[_0x579b1f['mailbox'],_0x579b1f[_0xb75a('0x70')]]);if(_0x2ebd4c[_0xb75a('0x9e')]===-0x1){return _0x2ebd4c;}return this['channel'][_0xb75a('0xa2')](util[_0xb75a('0x28')](_0xb75a('0xbf'),_0xb75a('0x1c9'),_0x579b1f[_0xb75a('0x1ca')]));};AGIVertices[_0xb75a('0x11')]['vswitch']=function(_0x333cd8){logger[_0xb75a('0x2e')](util['format'](_0xb75a('0x1cb'),_0x333cd8[_0xb75a('0x38')]));if(!this[_0xb75a('0x7e')](_0x333cd8[_0xb75a('0xd3')])){return this['channel']['error'](_0x333cd8,_0xb75a('0x1cc'));}var _0x5d3ef9=this[_0xb75a('0x12')][_0xb75a('0x68')](this,_0x333cd8[_0xb75a('0xd3')]);if(!_0x5d3ef9){return this['channel'][_0xb75a('0x2b')](_0x333cd8,'no\x20variable\x20found');}var _0x531f02=this['channel'][_0xb75a('0x12')](_0x5d3ef9);return{'code':0xc8,'result':_0x531f02[_0xb75a('0x9c')]?_0x531f02[_0xb75a('0x9c')]:'-'};};String[_0xb75a('0x11')][_0xb75a('0x1cd')]=function(_0x31baec,_0x57deb9){return this['split'](_0x31baec)['join'](_0x57deb9);};module[_0xb75a('0x1ce')]=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index 2458cea..fcc0a1b 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 _0x8ce4=['message','mandatoryDisposition','interface','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','syncHangupRequest','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','transfertargetuniqueid','origtransfereruniqueid','transfereruniqueid','[%s][BLINDTRANSFER:LINKEDID]','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','[ACW][syncAgentRingNoAnswer]\x20%s','util','lodash','moment','../ami','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','channels','bind','hanguprequest','hangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','startAcw','queue','ACW','mandatoryDispositionPause','then','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','timers','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','updateAcw','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','finally','[ACW][START]\x20%s','prototype','update','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s'];(function(_0x2fcdbe,_0x27f901){var _0x28ced4=function(_0x5d809f){while(--_0x5d809f){_0x2fcdbe['push'](_0x2fcdbe['shift']());}};_0x28ced4(++_0x27f901);}(_0x8ce4,0xb9));var _0x48ce=function(_0x5ec453,_0x30b0ba){_0x5ec453=_0x5ec453-0x0;var _0x25548f=_0x8ce4[_0x5ec453];return _0x25548f;};'use strict';var util=require(_0x48ce('0x0'));var _=require(_0x48ce('0x1'));var moment=require(_0x48ce('0x2'));var ami=require(_0x48ce('0x3'));var logger=require(_0x48ce('0x4'))(_0x48ce('0x5'));var RpcUser=require(_0x48ce('0x6'));var RpcVoiceAgentReport=require(_0x48ce('0x7'));function Acw(_0x45c83a){this['voiceQueues']=_0x45c83a[_0x48ce('0x8')];this[_0x48ce('0x9')]=_0x45c83a[_0x48ce('0x9')];this['timers']=_0x45c83a['timers'];this[_0x48ce('0xa')]={};ami['on']('agentconnect',this['syncAgentConnect'][_0x48ce('0xb')](this));ami['on'](_0x48ce('0xc'),this['syncHangupRequest'][_0x48ce('0xb')](this));ami['on'](_0x48ce('0xd'),this['syncHangup'][_0x48ce('0xb')](this));ami['on'](_0x48ce('0xe'),this[_0x48ce('0xf')][_0x48ce('0xb')](this));ami['on'](_0x48ce('0x10'),this[_0x48ce('0x11')][_0x48ce('0xb')](this));ami['on']('blindtransfer',this[_0x48ce('0x12')][_0x48ce('0xb')](this));ami['on'](_0x48ce('0x13'),this[_0x48ce('0x14')]['bind'](this));}function getDiff(_0x38f7c6){var _0x3b7dd0=moment()[_0x48ce('0x15')](0x0);var _0x44171e=moment(_0x38f7c6)[_0x48ce('0x15')](0x0);return _0x3b7dd0[_0x48ce('0x16')](_0x44171e,'seconds');}Acw['prototype'][_0x48ce('0x17')]=function(_0x1b1ca6){try{var _0x2d654d=this;var _0x36ec96=this[_0x48ce('0xa')][_0x1b1ca6]['interface'];var _0x67e382=this[_0x48ce('0xa')][_0x1b1ca6][_0x48ce('0x18')];var _0x42e13e=this['voiceQueues'][_0x67e382];var _0x5f02e7=![];var _0x3cfb3c=_0x48ce('0x19');if(_0x42e13e['mandatoryDisposition']){if(_0x42e13e[_0x48ce('0x1a')]['name']){_0x5f02e7=!![];_0x3cfb3c=_0x42e13e[_0x48ce('0x1a')]['name'];}}ami['Action']({'action':'QueuePause','interface':_0x36ec96,'paused':!![],'reason':_0x3cfb3c})[_0x48ce('0x1b')](function(_0x374746){if(_0x2d654d[_0x48ce('0x9')][_0x36ec96]){return RpcUser['getAgent'](_0x2d654d[_0x48ce('0x9')][_0x36ec96]['id'])[_0x48ce('0x1b')](function(_0xba883f){if(_0xba883f&&!_0xba883f['voicePause']){logger[_0x48ce('0x1c')](_0x48ce('0x1d'),_0x1b1ca6,_0x36ec96,_0x67e382);var _0x342b77=_0x2d654d[_0x48ce('0xa')][_0x1b1ca6][_0x48ce('0x1e')]&&_0x2d654d[_0x48ce('0xa')][_0x1b1ca6][_0x48ce('0x1f')]?_0x2d654d[_0x48ce('0xa')][_0x1b1ca6][_0x48ce('0x1f')]:_0x1b1ca6;return RpcUser[_0x48ce('0x20')](_0x2d654d['agents'][_0x36ec96],_0x3cfb3c,_0x342b77)[_0x48ce('0x1b')](function(_0x40e7a1){if(!_0x5f02e7){_0x2d654d[_0x48ce('0x21')][_0x36ec96]={};logger['info'](_0x48ce('0x22'),_0x1b1ca6,_0x2d654d[_0x48ce('0x8')][_0x67e382][_0x48ce('0x23')],_0x36ec96,_0x67e382);_0x2d654d[_0x48ce('0x21')][_0x36ec96][_0x48ce('0x24')]=setTimeout(_0x2d654d['stopAcw']['bind'](_0x2d654d,_0x36ec96),_0x2d654d[_0x48ce('0x8')][_0x67e382][_0x48ce('0x23')]*0x3e8);_0x2d654d['timers'][_0x36ec96][_0x48ce('0x25')]=moment()[_0x48ce('0x26')](_0x48ce('0x27'));_0x2d654d[_0x48ce('0x21')][_0x36ec96][_0x48ce('0x28')]=_0x1b1ca6;_0x2d654d[_0x48ce('0x21')][_0x36ec96]['queue']=_0x67e382;_0x2d654d[_0x48ce('0x21')][_0x36ec96][_0x48ce('0x29')]=function(){var _0x1ea4a6=getDiff(_0x2d654d[_0x48ce('0x21')][_0x36ec96][_0x48ce('0x25')]);clearTimeout(_0x2d654d['timers'][_0x36ec96]['timer']);_0x2d654d[_0x48ce('0x21')][_0x36ec96][_0x48ce('0x24')]=![];RpcVoiceAgentReport['update']({'acwtime':_0x1ea4a6},_0x2d654d[_0x48ce('0x21')][_0x36ec96]['uniqueid'],_0x36ec96)[_0x48ce('0x1b')](function(_0x2b1869){logger[_0x48ce('0x1c')](_0x48ce('0x2a'),_0x1b1ca6,_0x1ea4a6,_0x2b1869);})[_0x48ce('0x2b')](function(_0x161e39){logger[_0x48ce('0x2c')](_0x48ce('0x2d'),_0x1b1ca6,_0x161e39);});delete _0x2d654d[_0x48ce('0x21')][_0x36ec96];};}});}else{logger[_0x48ce('0x1c')](_0x48ce('0x2e'),_0x1b1ca6,_0x36ec96,_0x67e382);}});}})[_0x48ce('0x2b')](function(_0x3782d3){logger[_0x48ce('0x2c')](_0x48ce('0x22'),_0x1b1ca6,_0x2d654d[_0x48ce('0x8')][_0x67e382][_0x48ce('0x23')],_0x36ec96,_0x67e382);})[_0x48ce('0x2f')](function(){delete _0x2d654d['channels'][_0x1b1ca6];});}catch(_0x20fae4){logger[_0x48ce('0x2c')](_0x48ce('0x30'),_0x20fae4['message']);}};Acw[_0x48ce('0x31')]['stopAcw']=function(_0x19b90b){try{var _0x54098b=this;if(_0x54098b[_0x48ce('0x21')][_0x19b90b]){_0x54098b[_0x48ce('0x21')][_0x19b90b]['timer']=![];var _0x551290=_0x54098b['timers'][_0x19b90b]['uniqueid'];var _0x42a69a=_0x54098b['timers'][_0x19b90b][_0x48ce('0x18')];var _0x5bed86=_0x54098b[_0x48ce('0x8')][_0x42a69a][_0x48ce('0x23')];logger[_0x48ce('0x1c')]('[%s][TIMER][STOP][AGENT:%s]',_0x551290,_0x19b90b);RpcUser['saveUnpause'](this[_0x48ce('0x9')][_0x19b90b]);RpcVoiceAgentReport[_0x48ce('0x32')]({'acwtime':_0x5bed86,'agentacw':!![]},_0x551290,_0x19b90b)[_0x48ce('0x1b')](function(_0x4b905c){logger[_0x48ce('0x1c')]('[%s][UPDATE][ACWTIME:%s]',_0x551290,_0x5bed86,_0x4b905c);})[_0x48ce('0x2b')](function(_0x5d23cc){logger[_0x48ce('0x2c')](_0x48ce('0x2d'),_0x551290,_0x5d23cc);});}else{logger[_0x48ce('0x2c')](_0x48ce('0x33'),_0x19b90b);if(_0x54098b[_0x48ce('0x21')]){logger['info'](_0x48ce('0x34'),JSON[_0x48ce('0x35')](_0x54098b[_0x48ce('0x21')]));}}}catch(_0x22ffbe){logger[_0x48ce('0x2c')](_0x48ce('0x36'),_0x22ffbe[_0x48ce('0x37')]);}};Acw[_0x48ce('0x31')]['syncAgentConnect']=function(_0x173b8f){try{if(this[_0x48ce('0x8')][_0x173b8f[_0x48ce('0x18')]]&&(this[_0x48ce('0x8')][_0x173b8f['queue']]['acw']||this[_0x48ce('0x8')][_0x173b8f[_0x48ce('0x18')]][_0x48ce('0x38')])){if(this[_0x48ce('0x9')][_0x173b8f[_0x48ce('0x39')]]){this[_0x48ce('0xa')][_0x173b8f[_0x48ce('0x28')]]={'queue':_0x173b8f[_0x48ce('0x18')],'interface':_0x173b8f[_0x48ce('0x39')],'destlinkedid':_0x173b8f['destlinkedid']};}}}catch(_0x1598fd){logger['error'](_0x48ce('0x3a'),_0x1598fd[_0x48ce('0x37')]);}};Acw[_0x48ce('0x31')][_0x48ce('0x14')]=function(_0x470e8a){try{if(this[_0x48ce('0x8')][_0x470e8a[_0x48ce('0x18')]]&&(this[_0x48ce('0x8')][_0x470e8a[_0x48ce('0x18')]][_0x48ce('0x5')]||this[_0x48ce('0x8')][_0x470e8a[_0x48ce('0x18')]][_0x48ce('0x38')])){if(this[_0x48ce('0x9')][_0x470e8a[_0x48ce('0x39')]]){this[_0x48ce('0xa')][_0x470e8a[_0x48ce('0x28')]]={'queue':_0x470e8a[_0x48ce('0x18')],'interface':_0x470e8a[_0x48ce('0x39')]};}}}catch(_0x106a27){logger[_0x48ce('0x2c')](_0x48ce('0x3b'),_0x106a27[_0x48ce('0x37')]);}};Acw[_0x48ce('0x31')][_0x48ce('0x3c')]=function(_0x91e94f){try{if(this[_0x48ce('0xa')][_0x91e94f[_0x48ce('0x28')]]&&_[_0x48ce('0x3d')](this[_0x48ce('0xa')][_0x91e94f['uniqueid']][_0x48ce('0x1e')])){logger[_0x48ce('0x1c')](_0x48ce('0x3e'),_0x91e94f[_0x48ce('0x28')]);this[_0x48ce('0x17')](_0x91e94f[_0x48ce('0x28')]);}else if(this[_0x48ce('0xa')][_0x91e94f[_0x48ce('0x3f')]]&&_[_0x48ce('0x3d')](this[_0x48ce('0xa')][_0x91e94f[_0x48ce('0x3f')]]['attended'])){logger[_0x48ce('0x1c')](_0x48ce('0x40'),_0x91e94f[_0x48ce('0x3f')]);this['startAcw'](_0x91e94f[_0x48ce('0x3f')]);}}catch(_0xd0dc6f){logger['error'](_0x48ce('0x41'),_0xd0dc6f[_0x48ce('0x37')]);}};Acw[_0x48ce('0x31')]['syncHangup']=function(_0x39b6e5){try{if(this[_0x48ce('0xa')][_0x39b6e5[_0x48ce('0x28')]]&&this[_0x48ce('0xa')][_0x39b6e5['uniqueid']][_0x48ce('0x1e')]){logger[_0x48ce('0x1c')](_0x48ce('0x42'),_0x39b6e5['uniqueid']);this[_0x48ce('0x17')](_0x39b6e5[_0x48ce('0x28')]);}else if(this[_0x48ce('0xa')][_0x39b6e5[_0x48ce('0x3f')]]&&this[_0x48ce('0xa')][_0x39b6e5['linkedid']][_0x48ce('0x1e')]){logger['info'](_0x48ce('0x43'),_0x39b6e5[_0x48ce('0x3f')]);this[_0x48ce('0x17')](_0x39b6e5['linkedid']);}}catch(_0x3fbdf0){logger[_0x48ce('0x2c')](_0x48ce('0x44'),_0x3fbdf0[_0x48ce('0x37')]);}};Acw[_0x48ce('0x31')][_0x48ce('0x11')]=function(_0x21e36f){try{if(!_[_0x48ce('0x45')](this[_0x48ce('0xa')][_0x21e36f[_0x48ce('0x46')]])){this[_0x48ce('0x17')](_0x21e36f[_0x48ce('0x46')]);if(this[_0x48ce('0xa')][_0x21e36f['secondtransfereruniqueid']]){this['channels'][_0x21e36f['secondtransfereruniqueid']][_0x48ce('0x1e')]=!![];this[_0x48ce('0xa')][_0x21e36f[_0x48ce('0x47')]]=this['channels'][_0x21e36f['secondtransfereruniqueid']];delete this[_0x48ce('0xa')][_0x21e36f['secondtransfereruniqueid']];}}else if(!_['isNil'](this[_0x48ce('0xa')][_0x21e36f[_0x48ce('0x47')]])){this[_0x48ce('0x17')](_0x21e36f[_0x48ce('0x47')]);if(this[_0x48ce('0xa')][_0x21e36f[_0x48ce('0x48')]]){this['channels'][_0x21e36f[_0x48ce('0x48')]]['attended']=!![];this[_0x48ce('0xa')][_0x21e36f[_0x48ce('0x46')]]=this[_0x48ce('0xa')][_0x21e36f[_0x48ce('0x48')]];delete this[_0x48ce('0xa')][_0x21e36f['origtransfereruniqueid']];}}}catch(_0x2d1b6e){logger['error']('[ACW][syncAttendedTransfer]\x20%s',_0x2d1b6e['message']);}};Acw['prototype'][_0x48ce('0x12')]=function(_0x455d1a){try{if(this['channels'][_0x455d1a[_0x48ce('0x49')]]){logger[_0x48ce('0x1c')]('[%s][BLINDTRANSFER:UNIQUEID]',JSON[_0x48ce('0x35')](_0x455d1a['transfereruniqueid']));this[_0x48ce('0x17')](_0x455d1a['transfereruniqueid']);}else if(this[_0x48ce('0xa')][_0x455d1a['transfererlinkedid']]){logger['info'](_0x48ce('0x4a'),JSON[_0x48ce('0x35')](_0x455d1a[_0x48ce('0x4b')]));this[_0x48ce('0x17')](_0x455d1a['transfererlinkedid']);}}catch(_0x15d33b){logger[_0x48ce('0x2c')](_0x48ce('0x4c'),_0x15d33b[_0x48ce('0x37')]);}};Acw[_0x48ce('0x31')][_0x48ce('0xf')]=function(_0x3b2c85){try{if(this[_0x48ce('0x8')][_0x3b2c85[_0x48ce('0x18')]]&&this[_0x48ce('0x8')][_0x3b2c85[_0x48ce('0x18')]]['autopause']===_0x48ce('0x4d')){if(this[_0x48ce('0x9')][_0x3b2c85['interface']]){logger[_0x48ce('0x1c')](_0x48ce('0x4e'),_0x3b2c85['uniqueid'],_0x3b2c85[_0x48ce('0x39')],_0x3b2c85[_0x48ce('0x18')]);return RpcUser[_0x48ce('0x20')](this[_0x48ce('0x9')][_0x3b2c85[_0x48ce('0x39')]],'Auto-Pause',_0x3b2c85[_0x48ce('0x28')]);}}}catch(_0x49c39a){logger[_0x48ce('0x2c')](_0x48ce('0x4f'),_0x49c39a['message']);}};module['exports']=Acw; \ No newline at end of file +var _0x202d=['format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','lastPauseAt','timer','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','finally','[ACW][START]\x20%s','message','prototype','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','update','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','stringify','[ACW][STOP]\x20%s','syncAgentConnect','syncAgentConnectPreview','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfereruniqueid','transfererlinkedid','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','savePause','[ACW][syncAgentRingNoAnswer]\x20%s','util','moment','../ami','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','agents','timers','channels','agentconnect','bind','syncHangupRequest','hangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','seconds','startAcw','interface','queue','voiceQueues','ACW','mandatoryDisposition','name','mandatoryDispositionPause','Action','QueuePause','then','getAgent','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','stopAcw'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x202d,0x172));var _0xd202=function(_0x553086,_0x16a0f6){_0x553086=_0x553086-0x0;var _0x3d54f8=_0x202d[_0x553086];return _0x3d54f8;};'use strict';var util=require(_0xd202('0x0'));var _=require('lodash');var moment=require(_0xd202('0x1'));var ami=require(_0xd202('0x2'));var logger=require(_0xd202('0x3'))(_0xd202('0x4'));var RpcUser=require(_0xd202('0x5'));var RpcVoiceAgentReport=require(_0xd202('0x6'));function Acw(_0x3f0575){this['voiceQueues']=_0x3f0575['voiceQueues'];this[_0xd202('0x7')]=_0x3f0575[_0xd202('0x7')];this[_0xd202('0x8')]=_0x3f0575[_0xd202('0x8')];this[_0xd202('0x9')]={};ami['on'](_0xd202('0xa'),this['syncAgentConnect'][_0xd202('0xb')](this));ami['on']('hanguprequest',this[_0xd202('0xc')][_0xd202('0xb')](this));ami['on'](_0xd202('0xd'),this['syncHangup'][_0xd202('0xb')](this));ami['on'](_0xd202('0xe'),this[_0xd202('0xf')][_0xd202('0xb')](this));ami['on'](_0xd202('0x10'),this[_0xd202('0x11')][_0xd202('0xb')](this));ami['on'](_0xd202('0x12'),this[_0xd202('0x13')][_0xd202('0xb')](this));ami['on']('custom:agentConnectPreview',this['syncAgentConnectPreview'][_0xd202('0xb')](this));}function getDiff(_0x2004cf){var _0x52ba00=moment()['milliseconds'](0x0);var _0x2211cb=moment(_0x2004cf)['milliseconds'](0x0);return _0x52ba00['diff'](_0x2211cb,_0xd202('0x14'));}Acw['prototype'][_0xd202('0x15')]=function(_0x5f4114){try{var _0x23d84b=this;var _0x379855=this[_0xd202('0x9')][_0x5f4114][_0xd202('0x16')];var _0x262182=this[_0xd202('0x9')][_0x5f4114][_0xd202('0x17')];var _0x2501f7=this[_0xd202('0x18')][_0x262182];var _0x20d420=![];var _0x4a5bc5=_0xd202('0x19');if(_0x2501f7[_0xd202('0x1a')]){if(_0x2501f7['mandatoryDispositionPause'][_0xd202('0x1b')]){_0x20d420=!![];_0x4a5bc5=_0x2501f7[_0xd202('0x1c')][_0xd202('0x1b')];}}ami[_0xd202('0x1d')]({'action':_0xd202('0x1e'),'interface':_0x379855,'paused':!![],'reason':_0x4a5bc5})[_0xd202('0x1f')](function(_0x3e74f8){if(_0x23d84b[_0xd202('0x7')][_0x379855]){return RpcUser[_0xd202('0x20')](_0x23d84b[_0xd202('0x7')][_0x379855]['id'])[_0xd202('0x1f')](function(_0x5c59d3){if(_0x5c59d3&&!_0x5c59d3['voicePause']){logger[_0xd202('0x21')](_0xd202('0x22'),_0x5f4114,_0x379855,_0x262182);var _0x1109fa=_0x23d84b[_0xd202('0x9')][_0x5f4114][_0xd202('0x23')]&&_0x23d84b[_0xd202('0x9')][_0x5f4114][_0xd202('0x24')]?_0x23d84b['channels'][_0x5f4114][_0xd202('0x24')]:_0x5f4114;return RpcUser['savePause'](_0x23d84b[_0xd202('0x7')][_0x379855],_0x4a5bc5,_0x1109fa)['then'](function(_0x501e73){if(!_0x20d420){_0x23d84b[_0xd202('0x8')][_0x379855]={};logger[_0xd202('0x21')](_0xd202('0x25'),_0x5f4114,_0x23d84b[_0xd202('0x18')][_0x262182][_0xd202('0x26')],_0x379855,_0x262182);_0x23d84b[_0xd202('0x8')][_0x379855]['timer']=setTimeout(_0x23d84b[_0xd202('0x27')][_0xd202('0xb')](_0x23d84b,_0x379855),_0x23d84b[_0xd202('0x18')][_0x262182][_0xd202('0x26')]*0x3e8);_0x23d84b[_0xd202('0x8')][_0x379855]['lastPauseAt']=moment()[_0xd202('0x28')](_0xd202('0x29'));_0x23d84b['timers'][_0x379855][_0xd202('0x2a')]=_0x5f4114;_0x23d84b[_0xd202('0x8')][_0x379855]['queue']=_0x262182;_0x23d84b[_0xd202('0x8')][_0x379855]['updateAcw']=function(){var _0x18a649=getDiff(_0x23d84b[_0xd202('0x8')][_0x379855][_0xd202('0x2b')]);clearTimeout(_0x23d84b[_0xd202('0x8')][_0x379855]['timer']);_0x23d84b[_0xd202('0x8')][_0x379855][_0xd202('0x2c')]=![];RpcVoiceAgentReport['update']({'acwtime':_0x18a649},_0x23d84b['timers'][_0x379855][_0xd202('0x2a')],_0x379855)[_0xd202('0x1f')](function(_0x578fd4){logger[_0xd202('0x21')](_0xd202('0x2d'),_0x5f4114,_0x18a649,_0x578fd4);})[_0xd202('0x2e')](function(_0x4c6ed7){logger[_0xd202('0x2f')](_0xd202('0x30'),_0x5f4114,_0x4c6ed7);});delete _0x23d84b[_0xd202('0x8')][_0x379855];};}});}else{logger[_0xd202('0x21')](_0xd202('0x31'),_0x5f4114,_0x379855,_0x262182);}});}})[_0xd202('0x2e')](function(_0x2ba820){logger[_0xd202('0x2f')](_0xd202('0x25'),_0x5f4114,_0x23d84b['voiceQueues'][_0x262182][_0xd202('0x26')],_0x379855,_0x262182);})[_0xd202('0x32')](function(){delete _0x23d84b[_0xd202('0x9')][_0x5f4114];});}catch(_0x59af07){logger[_0xd202('0x2f')](_0xd202('0x33'),_0x59af07[_0xd202('0x34')]);}};Acw[_0xd202('0x35')]['stopAcw']=function(_0x5b6ddc){try{var _0x4c6bf1=this;if(_0x4c6bf1['timers'][_0x5b6ddc]){_0x4c6bf1[_0xd202('0x8')][_0x5b6ddc][_0xd202('0x2c')]=![];var _0x461e3b=_0x4c6bf1[_0xd202('0x8')][_0x5b6ddc][_0xd202('0x2a')];var _0x4441ec=_0x4c6bf1[_0xd202('0x8')][_0x5b6ddc][_0xd202('0x17')];var _0x42c6a3=_0x4c6bf1[_0xd202('0x18')][_0x4441ec]['acwTimeout'];logger[_0xd202('0x21')](_0xd202('0x36'),_0x461e3b,_0x5b6ddc);RpcUser[_0xd202('0x37')](this[_0xd202('0x7')][_0x5b6ddc]);RpcVoiceAgentReport[_0xd202('0x38')]({'acwtime':_0x42c6a3,'agentacw':!![]},_0x461e3b,_0x5b6ddc)[_0xd202('0x1f')](function(_0x30ab77){logger[_0xd202('0x21')](_0xd202('0x2d'),_0x461e3b,_0x42c6a3,_0x30ab77);})[_0xd202('0x2e')](function(_0x3fd6cd){logger[_0xd202('0x2f')](_0xd202('0x30'),_0x461e3b,_0x3fd6cd);});}else{logger[_0xd202('0x2f')](_0xd202('0x39'),_0x5b6ddc);if(_0x4c6bf1['timers']){logger[_0xd202('0x21')]('[ACW][TIMERS]',JSON[_0xd202('0x3a')](_0x4c6bf1[_0xd202('0x8')]));}}}catch(_0x1faf3a){logger[_0xd202('0x2f')](_0xd202('0x3b'),_0x1faf3a['message']);}};Acw[_0xd202('0x35')][_0xd202('0x3c')]=function(_0x36293f){try{if(this['voiceQueues'][_0x36293f[_0xd202('0x17')]]&&(this['voiceQueues'][_0x36293f[_0xd202('0x17')]][_0xd202('0x4')]||this[_0xd202('0x18')][_0x36293f['queue']][_0xd202('0x1a')])){if(this[_0xd202('0x7')][_0x36293f['interface']]){this[_0xd202('0x9')][_0x36293f[_0xd202('0x2a')]]={'queue':_0x36293f[_0xd202('0x17')],'interface':_0x36293f['interface'],'destlinkedid':_0x36293f[_0xd202('0x24')]};}}}catch(_0x10b46c){logger[_0xd202('0x2f')]('[ACW][syncAgentConnect]\x20%s',_0x10b46c[_0xd202('0x34')]);}};Acw[_0xd202('0x35')][_0xd202('0x3d')]=function(_0x11d36f){try{if(this[_0xd202('0x18')][_0x11d36f['queue']]&&(this[_0xd202('0x18')][_0x11d36f[_0xd202('0x17')]][_0xd202('0x4')]||this['voiceQueues'][_0x11d36f[_0xd202('0x17')]][_0xd202('0x1a')])){if(this['agents'][_0x11d36f[_0xd202('0x16')]]){this['channels'][_0x11d36f[_0xd202('0x2a')]]={'queue':_0x11d36f[_0xd202('0x17')],'interface':_0x11d36f[_0xd202('0x16')]};}}}catch(_0x1a12fe){logger[_0xd202('0x2f')](_0xd202('0x3e'),_0x1a12fe['message']);}};Acw[_0xd202('0x35')]['syncHangupRequest']=function(_0x1b2625){try{if(this[_0xd202('0x9')][_0x1b2625[_0xd202('0x2a')]]&&_[_0xd202('0x3f')](this[_0xd202('0x9')][_0x1b2625[_0xd202('0x2a')]][_0xd202('0x23')])){logger['info']('[%s][HANGUP:UNIQUEID]',_0x1b2625[_0xd202('0x2a')]);this[_0xd202('0x15')](_0x1b2625[_0xd202('0x2a')]);}else if(this['channels'][_0x1b2625[_0xd202('0x40')]]&&_[_0xd202('0x3f')](this[_0xd202('0x9')][_0x1b2625[_0xd202('0x40')]][_0xd202('0x23')])){logger[_0xd202('0x21')](_0xd202('0x41'),_0x1b2625[_0xd202('0x40')]);this[_0xd202('0x15')](_0x1b2625[_0xd202('0x40')]);}}catch(_0x61ff63){logger['error'](_0xd202('0x42'),_0x61ff63[_0xd202('0x34')]);}};Acw[_0xd202('0x35')]['syncHangup']=function(_0x2424d8){try{if(this['channels'][_0x2424d8[_0xd202('0x2a')]]&&this[_0xd202('0x9')][_0x2424d8[_0xd202('0x2a')]][_0xd202('0x23')]){logger[_0xd202('0x21')](_0xd202('0x43'),_0x2424d8['uniqueid']);this['startAcw'](_0x2424d8[_0xd202('0x2a')]);}else if(this[_0xd202('0x9')][_0x2424d8[_0xd202('0x40')]]&&this[_0xd202('0x9')][_0x2424d8[_0xd202('0x40')]]['attended']){logger[_0xd202('0x21')](_0xd202('0x44'),_0x2424d8[_0xd202('0x40')]);this[_0xd202('0x15')](_0x2424d8[_0xd202('0x40')]);}}catch(_0x4db928){logger[_0xd202('0x2f')]('[ACW][syncHangup]\x20%s',_0x4db928[_0xd202('0x34')]);}};Acw[_0xd202('0x35')][_0xd202('0x11')]=function(_0x5f1177){try{if(!_[_0xd202('0x45')](this[_0xd202('0x9')][_0x5f1177[_0xd202('0x46')]])){this['startAcw'](_0x5f1177['transfereeuniqueid']);if(this[_0xd202('0x9')][_0x5f1177[_0xd202('0x47')]]){this[_0xd202('0x9')][_0x5f1177[_0xd202('0x47')]][_0xd202('0x23')]=!![];this[_0xd202('0x9')][_0x5f1177[_0xd202('0x48')]]=this[_0xd202('0x9')][_0x5f1177[_0xd202('0x47')]];delete this['channels'][_0x5f1177[_0xd202('0x47')]];}}else if(!_[_0xd202('0x45')](this['channels'][_0x5f1177[_0xd202('0x48')]])){this[_0xd202('0x15')](_0x5f1177[_0xd202('0x48')]);if(this[_0xd202('0x9')][_0x5f1177[_0xd202('0x49')]]){this['channels'][_0x5f1177['origtransfereruniqueid']][_0xd202('0x23')]=!![];this[_0xd202('0x9')][_0x5f1177[_0xd202('0x46')]]=this[_0xd202('0x9')][_0x5f1177[_0xd202('0x49')]];delete this[_0xd202('0x9')][_0x5f1177[_0xd202('0x49')]];}}}catch(_0x42540a){logger[_0xd202('0x2f')]('[ACW][syncAttendedTransfer]\x20%s',_0x42540a[_0xd202('0x34')]);}};Acw['prototype'][_0xd202('0x13')]=function(_0x5688eb){try{if(this[_0xd202('0x9')][_0x5688eb['transfereruniqueid']]){logger['info'](_0xd202('0x4a'),JSON[_0xd202('0x3a')](_0x5688eb[_0xd202('0x4b')]));this[_0xd202('0x15')](_0x5688eb[_0xd202('0x4b')]);}else if(this[_0xd202('0x9')][_0x5688eb[_0xd202('0x4c')]]){logger[_0xd202('0x21')]('[%s][BLINDTRANSFER:LINKEDID]',JSON['stringify'](_0x5688eb[_0xd202('0x4c')]));this['startAcw'](_0x5688eb[_0xd202('0x4c')]);}}catch(_0x53eb82){logger[_0xd202('0x2f')]('[ACW][syncBlindTransfer]\x20%s',_0x53eb82[_0xd202('0x34')]);}};Acw[_0xd202('0x35')][_0xd202('0xf')]=function(_0x160e51){try{if(this[_0xd202('0x18')][_0x160e51[_0xd202('0x17')]]&&this[_0xd202('0x18')][_0x160e51['queue']][_0xd202('0x4d')]===_0xd202('0x4e')){if(this[_0xd202('0x7')][_0x160e51[_0xd202('0x16')]]){logger['info'](_0xd202('0x4f'),_0x160e51[_0xd202('0x2a')],_0x160e51[_0xd202('0x16')],_0x160e51[_0xd202('0x17')]);return RpcUser[_0xd202('0x50')](this[_0xd202('0x7')][_0x160e51[_0xd202('0x16')]],'Auto-Pause',_0x160e51[_0xd202('0x2a')]);}}}catch(_0x368b49){logger[_0xd202('0x2f')](_0xd202('0x51'),_0x368b49[_0xd202('0x34')]);}};module['exports']=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index 292445c..cedadb9 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 _0x3981=['queuesummary','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionDeviceStateList','actionCoreShowChannels','catch','log','close','exports','bluebird','lodash','../../config/logger','ami','../../config/environment','asterisk','port','password','Action','promisify','format','inspect','error','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','username','actionSipShowRegistry','sipshowregistry','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary'];(function(_0x2a3081,_0x3885e3){var _0x34180b=function(_0x1580d0){while(--_0x1580d0){_0x2a3081['push'](_0x2a3081['shift']());}};_0x34180b(++_0x3885e3);}(_0x3981,0xd5));var _0x1398=function(_0x28c9f9,_0x104b33){_0x28c9f9=_0x28c9f9-0x0;var _0xb8494e=_0x3981[_0x28c9f9];return _0xb8494e;};'use strict';var Manager=require('asterisk-manager');var BPromise=require(_0x1398('0x0'));var moment=require('moment');var util=require('util');var _=require(_0x1398('0x1'));var logger=require(_0x1398('0x2'))(_0x1398('0x3'));var config=require(_0x1398('0x4'));var ami=new Manager(config[_0x1398('0x5')][_0x1398('0x6')],config[_0x1398('0x5')]['ip'],config['asterisk']['username'],config['asterisk'][_0x1398('0x7')],!![]);ami['keepConnected']();ami[_0x1398('0x8')]=BPromise[_0x1398('0x9')](ami['action']);function error(_0x39eb62){logger['error'](util[_0x1398('0xa')]('Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s',config[_0x1398('0x5')]['username'],config[_0x1398('0x5')]['ip'],config[_0x1398('0x5')][_0x1398('0x6')],util[_0x1398('0xb')](_0x39eb62,![],null)));}function close(){logger[_0x1398('0xc')](util[_0x1398('0xa')](_0x1398('0xd'),config['asterisk'][_0x1398('0xe')],config[_0x1398('0x5')]['ip'],config[_0x1398('0x5')]['port']));}ami[_0x1398('0xf')]=function(){return function(){return ami['Action']({'action':_0x1398('0x10')});};};ami['actionDeviceStateList']=function(){return function(){return ami[_0x1398('0x8')]({'action':_0x1398('0x11')});};};ami[_0x1398('0x12')]=function(){return function(){return ami[_0x1398('0x8')]({'action':_0x1398('0x13')});};};ami[_0x1398('0x14')]=function(){return function(){return ami[_0x1398('0x8')]({'action':_0x1398('0x15')});};};ami['actionCoreShowChannels']=function(){return function(){return ami['Action']({'action':_0x1398('0x16')});};};function connect(_0x32fce8){logger[_0x1398('0x17')](util[_0x1398('0xa')](_0x1398('0x18'),config['asterisk'][_0x1398('0xe')],config[_0x1398('0x5')]['ip'],config[_0x1398('0x5')][_0x1398('0x6')]));ami[_0x1398('0x19')](_0x1398('0xc'),error);ami[_0x1398('0x19')]('close',close);}ami['on'](_0x1398('0x1a'),connect);ami['on'](_0x1398('0x1b'),function(_0x11af97){logger['info'](util[_0x1398('0xa')](_0x1398('0x1c'),config[_0x1398('0x5')][_0x1398('0xe')],config[_0x1398('0x5')]['ip'],config[_0x1398('0x5')]['port'],util[_0x1398('0xb')](_0x11af97,![],null)));});ami['on'](_0x1398('0x1d'),function(_0x218a03){logger[_0x1398('0x17')](util[_0x1398('0xa')](_0x1398('0x1e'),config['asterisk'][_0x1398('0xe')],config[_0x1398('0x5')]['ip'],config[_0x1398('0x5')][_0x1398('0x6')]));return BPromise[_0x1398('0x1f')]()[_0x1398('0x20')](ami['actionSipShowRegistry']())[_0x1398('0x20')](ami[_0x1398('0x21')]())[_0x1398('0x20')](ami['actionSipPeerStatus']())[_0x1398('0x20')](ami[_0x1398('0x14')]())[_0x1398('0x20')](ami[_0x1398('0x22')]())[_0x1398('0x23')](function(_0x2ce0df){console[_0x1398('0x24')](_0x2ce0df);});});ami[_0x1398('0x19')](_0x1398('0xc'),error);ami[_0x1398('0x19')](_0x1398('0x25'),close);module[_0x1398('0x26')]=ami; \ No newline at end of file +var _0x2427=['port','username','password','keepConnected','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','Action','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','resolve','then','actionDeviceStateList','exports','asterisk-manager','bluebird','moment','lodash','../../config/logger','../../config/environment','asterisk'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x2427,0xd1));var _0x7242=function(_0x324c4e,_0x8cb7a6){_0x324c4e=_0x324c4e-0x0;var _0x3f5859=_0x2427[_0x324c4e];return _0x3f5859;};'use strict';var Manager=require(_0x7242('0x0'));var BPromise=require(_0x7242('0x1'));var moment=require(_0x7242('0x2'));var util=require('util');var _=require(_0x7242('0x3'));var logger=require(_0x7242('0x4'))('ami');var config=require(_0x7242('0x5'));var ami=new Manager(config[_0x7242('0x6')][_0x7242('0x7')],config[_0x7242('0x6')]['ip'],config['asterisk'][_0x7242('0x8')],config[_0x7242('0x6')][_0x7242('0x9')],!![]);ami[_0x7242('0xa')]();ami['Action']=BPromise['promisify'](ami['action']);function error(_0x20dddb){logger[_0x7242('0xb')](util[_0x7242('0xc')](_0x7242('0xd'),config[_0x7242('0x6')][_0x7242('0x8')],config['asterisk']['ip'],config[_0x7242('0x6')]['port'],util[_0x7242('0xe')](_0x20dddb,![],null)));}function close(){logger[_0x7242('0xb')](util[_0x7242('0xc')](_0x7242('0xf'),config[_0x7242('0x6')][_0x7242('0x8')],config['asterisk']['ip'],config[_0x7242('0x6')]['port']));}ami[_0x7242('0x10')]=function(){return function(){return ami['Action']({'action':'sipshowregistry'});};};ami['actionDeviceStateList']=function(){return function(){return ami[_0x7242('0x11')]({'action':_0x7242('0x12')});};};ami[_0x7242('0x13')]=function(){return function(){return ami[_0x7242('0x11')]({'action':_0x7242('0x14')});};};ami[_0x7242('0x15')]=function(){return function(){return ami['Action']({'action':_0x7242('0x16')});};};ami[_0x7242('0x17')]=function(){return function(){return ami[_0x7242('0x11')]({'action':'coreshowchannels'});};};function connect(_0x3d8f4f){logger[_0x7242('0x18')](util[_0x7242('0xc')](_0x7242('0x19'),config[_0x7242('0x6')][_0x7242('0x8')],config[_0x7242('0x6')]['ip'],config[_0x7242('0x6')]['port']));ami[_0x7242('0x1a')](_0x7242('0xb'),error);ami[_0x7242('0x1a')](_0x7242('0x1b'),close);}ami['on'](_0x7242('0x1c'),connect);ami['on'](_0x7242('0x1d'),function(_0x88c6b8){logger['info'](util[_0x7242('0xc')](_0x7242('0x1e'),config['asterisk'][_0x7242('0x8')],config[_0x7242('0x6')]['ip'],config[_0x7242('0x6')][_0x7242('0x7')],util['inspect'](_0x88c6b8,![],null)));});ami['on'](_0x7242('0x1f'),function(_0x33d219){logger['info'](util[_0x7242('0xc')]('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0x7242('0x6')][_0x7242('0x8')],config[_0x7242('0x6')]['ip'],config[_0x7242('0x6')][_0x7242('0x7')]));return BPromise[_0x7242('0x20')]()[_0x7242('0x21')](ami[_0x7242('0x10')]())['then'](ami[_0x7242('0x22')]())['then'](ami[_0x7242('0x13')]())[_0x7242('0x21')](ami[_0x7242('0x15')]())['then'](ami[_0x7242('0x17')]())['catch'](function(_0x279e0b){console['log'](_0x279e0b);});});ami[_0x7242('0x1a')](_0x7242('0xb'),error);ami[_0x7242('0x1a')]('close',close);module[_0x7242('0x23')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index 17d2f7c..a15c8bb 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 _0xcb91=['request','debug','memberReport','error','rpc','message','result','catch','exports','../../config/logger','ami','client','http'];(function(_0x54d4fe,_0x55e869){var _0x1ab5bb=function(_0x5b1af2){while(--_0x5b1af2){_0x54d4fe['push'](_0x54d4fe['shift']());}};_0x1ab5bb(++_0x55e869);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4b9978,_0x58eb71){_0x4b9978=_0x4b9978-0x0;var _0x42f0e5=_0xcb91[_0x4b9978];return _0x42f0e5;};'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 +var _0xaa88=['bluebird','../../config/logger','ami','http','Request','rpc','memberReport','error','message','result','catch','jayson/promise'];(function(_0x49c090,_0x5a6a99){var _0x12513d=function(_0x325620){while(--_0x325620){_0x49c090['push'](_0x49c090['shift']());}};_0x12513d(++_0x5a6a99);}(_0xaa88,0x137));var _0x8aa8=function(_0x3239f5,_0x50e77c){_0x3239f5=_0x3239f5-0x0;var _0x3559c8=_0xaa88[_0x3239f5];return _0x3559c8;};'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 diff --git a/server/services/ami/dialer/action.js b/server/services/ami/dialer/action.js index 0794ea9..8a24b3f 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 _0x93ed=['ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','number','substring','getQueue','exports','util','moment','string','isNil','voiceQueue','name','phone','Contact','firstName','lastName','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry'];(function(_0x2b9705,_0xe1f810){var _0x5b72d3=function(_0x110fa7){while(--_0x110fa7){_0x2b9705['push'](_0x2b9705['shift']());}};_0x5b72d3(++_0xe1f810);}(_0x93ed,0xca));var _0xd93e=function(_0x38baac,_0x2772b3){_0x38baac=_0x38baac-0x0;var _0x47baf1=_0x93ed[_0x38baac];return _0x47baf1;};'use strict';var util=require(_0xd93e('0x0'));var _=require('lodash');var moment=require(_0xd93e('0x1'));function checkNameSurname(_0x5d9945,_0x1d2291,_0xbb71f){var _0x5e8800='';if(!_['isNil'](_0x1d2291)&&_0xd93e('0x2')===typeof _0x1d2291){_0x5e8800+=_0x1d2291;}if(!_[_0xd93e('0x3')](_0xbb71f)&&_0xd93e('0x2')===typeof _0xbb71f){_0x5e8800+='\x20'+_0xbb71f;}if(_0x5e8800!==''){return _0x5e8800;}return _0x5d9945;}function Action(_0x4be0fb,_0x3df26e,_0x40fac7){this[_0xd93e('0x4')]=_0x4be0fb;this['uniqueid']=_0x40fac7||undefined;this[_0xd93e('0x5')]=checkNameSurname(_0x3df26e['Contact'][_0xd93e('0x6')],_0x3df26e[_0xd93e('0x7')][_0xd93e('0x8')],_0x3df26e[_0xd93e('0x7')][_0xd93e('0x9')]);this['number']=_0x3df26e[_0xd93e('0x7')][_0xd93e('0x6')];this[_0xd93e('0xa')]=_0x4be0fb[_0xd93e('0x5')];this[_0xd93e('0xb')]=_0x3df26e[_0xd93e('0xb')]||![];this['type']=_0x4be0fb[_0xd93e('0xc')];this[_0xd93e('0xd')]=_0x4be0fb['dialQueueTimeout']||0x3;this[_0xd93e('0xe')]=_0x3df26e[_0xd93e('0xe')];this[_0xd93e('0xf')]=_0x3df26e['countbusyretry'];this[_0xd93e('0x10')]=_0x3df26e[_0xd93e('0x10')];this[_0xd93e('0x11')]=_0x3df26e[_0xd93e('0x11')];this[_0xd93e('0x12')]=_0x3df26e['countnosuchnumberretry'];this[_0xd93e('0x13')]=_0x3df26e[_0xd93e('0x13')];this[_0xd93e('0x14')]=_0x3df26e[_0xd93e('0x14')];this[_0xd93e('0x15')]=_0x3df26e[_0xd93e('0x15')];this[_0xd93e('0x16')]=_0x3df26e[_0xd93e('0x16')];this[_0xd93e('0x17')]=_0x3df26e[_0xd93e('0x17')];this[_0xd93e('0x18')]=_0x3df26e[_0xd93e('0x18')];this[_0xd93e('0x19')]=_0x3df26e['UserId'];this[_0xd93e('0x1a')]=_0x3df26e[_0xd93e('0x1a')];this[_0xd93e('0x1b')]=_0x3df26e[_0xd93e('0x1b')];this[_0xd93e('0x1c')]=_0x3df26e['id'];this['ContactFirstName']=_0x3df26e[_0xd93e('0x7')]['firstName']||'';this[_0xd93e('0x1d')]=moment()[_0xd93e('0x1e')](_0xd93e('0x1f'));this[_0xd93e('0x20')]=_0x3df26e[_0xd93e('0x20')];this[_0xd93e('0x21')]=_0x3df26e[_0xd93e('0x21')];this['callbackat']=_0x3df26e[_0xd93e('0x22')];this[_0xd93e('0x23')]=_0x3df26e[_0xd93e('0x23')];this['originatecalleridnum']='';this[_0xd93e('0x24')]='';}Action[_0xd93e('0x25')][_0xd93e('0x26')]=function(){return util[_0xd93e('0x1e')](_0xd93e('0x27'),this[_0xd93e('0x5')],this[_0xd93e('0x4')][_0xd93e('0x28')]>0x0?this[_0xd93e('0x29')][_0xd93e('0x2a')](this['voiceQueue'][_0xd93e('0x28')]):this[_0xd93e('0x29')]);};Action[_0xd93e('0x25')][_0xd93e('0x2b')]=function(){return this[_0xd93e('0xa')];};module[_0xd93e('0x2c')]=Action; \ No newline at end of file +var _0xf161=['format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','recallme','prototype','\x22%s\x22\x20<%s>','dialCutDigit','substring','getQueue','exports','util','lodash','moment','isNil','string','voiceQueue','uniqueid','name','phone','Contact','lastName','number','queue','active','type','dialQueueTimeout','scheduledat','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime'];(function(_0x4fc6ff,_0x1f7862){var _0x4a417c=function(_0x1ac562){while(--_0x1ac562){_0x4fc6ff['push'](_0x4fc6ff['shift']());}};_0x4a417c(++_0x1f7862);}(_0xf161,0x89));var _0x1f16=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0xf161[_0x82129b];return _0x2ae5dc;};'use strict';var util=require(_0x1f16('0x0'));var _=require(_0x1f16('0x1'));var moment=require(_0x1f16('0x2'));function checkNameSurname(_0xfc491e,_0x23fe77,_0x395036){var _0x2ac2fe='';if(!_[_0x1f16('0x3')](_0x23fe77)&&_0x1f16('0x4')===typeof _0x23fe77){_0x2ac2fe+=_0x23fe77;}if(!_[_0x1f16('0x3')](_0x395036)&&_0x1f16('0x4')===typeof _0x395036){_0x2ac2fe+='\x20'+_0x395036;}if(_0x2ac2fe!==''){return _0x2ac2fe;}return _0xfc491e;}function Action(_0x1b8741,_0x5abeb0,_0x397b24){this[_0x1f16('0x5')]=_0x1b8741;this[_0x1f16('0x6')]=_0x397b24||undefined;this[_0x1f16('0x7')]=checkNameSurname(_0x5abeb0['Contact'][_0x1f16('0x8')],_0x5abeb0[_0x1f16('0x9')]['firstName'],_0x5abeb0['Contact'][_0x1f16('0xa')]);this[_0x1f16('0xb')]=_0x5abeb0[_0x1f16('0x9')]['phone'];this[_0x1f16('0xc')]=_0x1b8741[_0x1f16('0x7')];this['active']=_0x5abeb0[_0x1f16('0xd')]||![];this[_0x1f16('0xe')]=_0x1b8741[_0x1f16('0xe')];this[_0x1f16('0xf')]=_0x1b8741[_0x1f16('0xf')]||0x3;this[_0x1f16('0x10')]=_0x5abeb0[_0x1f16('0x10')];this['countbusyretry']=_0x5abeb0['countbusyretry'];this[_0x1f16('0x11')]=_0x5abeb0[_0x1f16('0x11')];this[_0x1f16('0x12')]=_0x5abeb0['countnoanswerretry'];this[_0x1f16('0x13')]=_0x5abeb0[_0x1f16('0x13')];this[_0x1f16('0x14')]=_0x5abeb0['countdropretry'];this['countabandonedretry']=_0x5abeb0['countabandonedretry'];this[_0x1f16('0x15')]=_0x5abeb0[_0x1f16('0x15')];this[_0x1f16('0x16')]=_0x5abeb0[_0x1f16('0x16')];this[_0x1f16('0x17')]=_0x5abeb0[_0x1f16('0x17')];this[_0x1f16('0x18')]=_0x5abeb0[_0x1f16('0x18')];this[_0x1f16('0x19')]=_0x5abeb0[_0x1f16('0x19')];this[_0x1f16('0x1a')]=_0x5abeb0[_0x1f16('0x1a')];this[_0x1f16('0x1b')]=_0x5abeb0['CampaignId'];this[_0x1f16('0x1c')]=_0x5abeb0['id'];this[_0x1f16('0x1d')]=_0x5abeb0[_0x1f16('0x9')]['firstName']||'';this[_0x1f16('0x1e')]=moment()[_0x1f16('0x1f')](_0x1f16('0x20'));this[_0x1f16('0x21')]=_0x5abeb0['callback'];this[_0x1f16('0x22')]=_0x5abeb0['callbackuniqueid'];this['callbackat']=_0x5abeb0['callbackat'];this[_0x1f16('0x23')]=_0x5abeb0[_0x1f16('0x23')];this['originatecalleridnum']='';this['originatecalleridname']='';}Action[_0x1f16('0x24')]['getCaller']=function(){return util['format'](_0x1f16('0x25'),this[_0x1f16('0x7')],this['voiceQueue'][_0x1f16('0x26')]>0x0?this['number'][_0x1f16('0x27')](this['voiceQueue'][_0x1f16('0x26')]):this[_0x1f16('0xb')]);};Action[_0x1f16('0x24')][_0x1f16('0x28')]=function(){return this[_0x1f16('0xc')];};module[_0x1f16('0x29')]=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js index c30c2cf..7e0870d 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 _0x7dfb=['CampaignId','originatecalleridnum','originatecalleridname','util','lodash','milliseconds','diff','seconds','state','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','uniqueid','calleridname','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0x7dfb,0x10b));var _0xb7df=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0x7dfb[_0x28947d];return _0x12d2ee;};'use strict';var util=require(_0xb7df('0x0'));var _=require(_0xb7df('0x1'));var moment=require('moment');function getSeconds(_0x349df6,_0x3910d5){var _0x54456c=moment(_0x349df6)[_0xb7df('0x2')](0x0);var _0x4f6290=moment(_0x3910d5)[_0xb7df('0x2')](0x0);return _0x54456c[_0xb7df('0x3')](_0x4f6290,_0xb7df('0x4'));}function AgentComplete(_0x563d19,_0x6241eb){this[_0xb7df('0x5')]=0x4;this['statedesc']=_0xb7df('0x6');this['scheduledat']=_0x563d19[_0xb7df('0x7')];this[_0xb7df('0x8')]=_0x563d19[_0xb7df('0x8')];this[_0xb7df('0x9')]=_0x563d19[_0xb7df('0x8')]===_0xb7df('0xa')?_0xb7df('0xb'):_0x563d19[_0xb7df('0x8')];this[_0xb7df('0xc')]=_0x563d19[_0xb7df('0xc')];this[_0xb7df('0xd')]=_0x563d19[_0xb7df('0xd')];this['countnoanswerretry']=_0x563d19[_0xb7df('0xe')];this[_0xb7df('0xf')]=_0x563d19[_0xb7df('0xc')]+_0x563d19[_0xb7df('0xd')]+_0x563d19['countnoanswerretry']+_0x563d19['countnosuchnumberretry']+_0x563d19[_0xb7df('0x10')]+_0x563d19[_0xb7df('0x11')]+_0x563d19[_0xb7df('0x12')]+_0x563d19[_0xb7df('0x13')];this[_0xb7df('0x14')]=_0x563d19['countnosuchnumberretry'];this[_0xb7df('0x10')]=_0x563d19[_0xb7df('0x10')];this[_0xb7df('0x11')]=_0x563d19[_0xb7df('0x11')];this[_0xb7df('0x12')]=_0x563d19[_0xb7df('0x12')];this[_0xb7df('0x13')]=_0x563d19[_0xb7df('0x13')];this[_0xb7df('0x15')]=_0x6241eb[_0xb7df('0x15')];this[_0xb7df('0x16')]=_0x563d19['name'];this['calleridnum']=_0x563d19['number'];this[_0xb7df('0x17')]=_0x563d19['starttime'];this[_0xb7df('0x18')]=_0x563d19[_0xb7df('0x18')];this[_0xb7df('0x19')]=_0x563d19[_0xb7df('0x19')];this[_0xb7df('0x1a')]=moment()[_0xb7df('0x1b')](_0xb7df('0x1c'));this[_0xb7df('0x1d')]=getSeconds(_0x563d19['responsetime'],_0x563d19[_0xb7df('0x17')]);this['holdtime']=getSeconds(_0x563d19['answertime'],_0x563d19[_0xb7df('0x18')]);this[_0xb7df('0x1e')]=getSeconds(this[_0xb7df('0x1a')],_0x563d19[_0xb7df('0x19')]);this['queue']=_0x6241eb[_0xb7df('0xb')];this[_0xb7df('0x1f')]=_0x6241eb['membername'];this[_0xb7df('0x20')]=_0x6241eb['reason'];this['callback']=_0x563d19[_0xb7df('0x21')];this[_0xb7df('0x22')]=_0x563d19[_0xb7df('0x22')];this[_0xb7df('0x23')]=_0x563d19[_0xb7df('0x23')];this[_0xb7df('0x24')]=_0x563d19['recallme'];this[_0xb7df('0x25')]=_0x563d19[_0xb7df('0x25')];this[_0xb7df('0x26')]=_0x563d19[_0xb7df('0x26')];this[_0xb7df('0x27')]=_0x563d19[_0xb7df('0x27')];this[_0xb7df('0x28')]=_0x563d19[_0xb7df('0x28')];this[_0xb7df('0x29')]=_0x563d19[_0xb7df('0x29')];this[_0xb7df('0x2a')]=_0x563d19[_0xb7df('0x2a')]||'';this[_0xb7df('0x2b')]=_0x563d19['originatecalleridname']||'';}module['exports']=AgentComplete; \ No newline at end of file +var _0xdd96=['originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','state','statedesc','scheduledat','type','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','uniqueid','calleridname','calleridnum','number','starttime','responsetime','answertime','endtime','YYYY-MM-DD\x20HH:mm:ss','ringtime','talktime','queue','membername','reason','callback','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId'];(function(_0x1a8e5e,_0xd94f20){var _0x35e401=function(_0x46e485){while(--_0x46e485){_0x1a8e5e['push'](_0x1a8e5e['shift']());}};_0x35e401(++_0xd94f20);}(_0xdd96,0x84));var _0x6dd9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdd96[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x6dd9('0x0'));var _=require(_0x6dd9('0x1'));var moment=require(_0x6dd9('0x2'));function getSeconds(_0x119309,_0x404d3c){var _0xfb6331=moment(_0x119309)[_0x6dd9('0x3')](0x0);var _0x51ef54=moment(_0x404d3c)[_0x6dd9('0x3')](0x0);return _0xfb6331[_0x6dd9('0x4')](_0x51ef54,'seconds');}function AgentComplete(_0x20efd9,_0x7018ab){this[_0x6dd9('0x5')]=0x4;this[_0x6dd9('0x6')]='Answer';this[_0x6dd9('0x7')]=_0x20efd9[_0x6dd9('0x7')];this[_0x6dd9('0x8')]=_0x20efd9[_0x6dd9('0x8')];this['campaigntype']=_0x20efd9['type']===_0x6dd9('0x9')?'queue':_0x20efd9[_0x6dd9('0x8')];this[_0x6dd9('0xa')]=_0x20efd9[_0x6dd9('0xa')];this[_0x6dd9('0xb')]=_0x20efd9[_0x6dd9('0xb')];this['countnoanswerretry']=_0x20efd9[_0x6dd9('0xc')];this['countglobal']=_0x20efd9[_0x6dd9('0xa')]+_0x20efd9[_0x6dd9('0xb')]+_0x20efd9['countnoanswerretry']+_0x20efd9['countnosuchnumberretry']+_0x20efd9[_0x6dd9('0xd')]+_0x20efd9[_0x6dd9('0xe')]+_0x20efd9[_0x6dd9('0xf')]+_0x20efd9[_0x6dd9('0x10')];this[_0x6dd9('0x11')]=_0x20efd9[_0x6dd9('0x11')];this['countdropretry']=_0x20efd9[_0x6dd9('0xd')];this[_0x6dd9('0xe')]=_0x20efd9[_0x6dd9('0xe')];this[_0x6dd9('0xf')]=_0x20efd9[_0x6dd9('0xf')];this[_0x6dd9('0x10')]=_0x20efd9[_0x6dd9('0x10')];this[_0x6dd9('0x12')]=_0x7018ab[_0x6dd9('0x12')];this[_0x6dd9('0x13')]=_0x20efd9['name'];this[_0x6dd9('0x14')]=_0x20efd9[_0x6dd9('0x15')];this['starttime']=_0x20efd9[_0x6dd9('0x16')];this[_0x6dd9('0x17')]=_0x20efd9[_0x6dd9('0x17')];this[_0x6dd9('0x18')]=_0x20efd9[_0x6dd9('0x18')];this[_0x6dd9('0x19')]=moment()['format'](_0x6dd9('0x1a'));this[_0x6dd9('0x1b')]=getSeconds(_0x20efd9[_0x6dd9('0x17')],_0x20efd9[_0x6dd9('0x16')]);this['holdtime']=getSeconds(_0x20efd9['answertime'],_0x20efd9[_0x6dd9('0x17')]);this[_0x6dd9('0x1c')]=getSeconds(this[_0x6dd9('0x19')],_0x20efd9[_0x6dd9('0x18')]);this[_0x6dd9('0x1d')]=_0x7018ab[_0x6dd9('0x1d')];this[_0x6dd9('0x1e')]=_0x7018ab[_0x6dd9('0x1e')];this[_0x6dd9('0x1f')]=_0x7018ab[_0x6dd9('0x1f')];this[_0x6dd9('0x20')]=_0x20efd9[_0x6dd9('0x20')];this['callbackuniqueid']=_0x20efd9['callbackuniqueid'];this[_0x6dd9('0x21')]=_0x20efd9[_0x6dd9('0x21')];this['recallme']=_0x20efd9[_0x6dd9('0x22')];this[_0x6dd9('0x23')]=_0x20efd9['ContactId'];this['ListId']=_0x20efd9[_0x6dd9('0x24')];this[_0x6dd9('0x25')]=_0x20efd9[_0x6dd9('0x25')];this[_0x6dd9('0x26')]=_0x20efd9[_0x6dd9('0x26')];this[_0x6dd9('0x27')]=_0x20efd9[_0x6dd9('0x27')];this[_0x6dd9('0x28')]=_0x20efd9[_0x6dd9('0x28')]||'';this[_0x6dd9('0x29')]=_0x20efd9[_0x6dd9('0x29')]||'';}module[_0x6dd9('0x2a')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js index bdfc663..b0f85de 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 _0x106f=['scheduledat','type','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countdropretry','countagentrejectretry','queue','calleridname','calleridnum','starttime','responsetime','ringtime','holdtime','talktime','callback','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','diff','seconds','uniqueid'];(function(_0x509a5b,_0x5f43a1){var _0x107f1e=function(_0x491fc8){while(--_0x491fc8){_0x509a5b['push'](_0x509a5b['shift']());}};_0x107f1e(++_0x5f43a1);}(_0x106f,0x162));var _0xf106=function(_0x477c83,_0x2c5e84){_0x477c83=_0x477c83-0x0;var _0x24fb6c=_0x106f[_0x477c83];return _0x24fb6c;};'use strict';var util=require(_0xf106('0x0'));var _=require(_0xf106('0x1'));var moment=require('moment');function getSeconds(_0x4014dd,_0x6d8236){var _0x59bc3a=moment(_0x4014dd)[_0xf106('0x2')](0x0);var _0x4ab04f=moment(_0x6d8236)[_0xf106('0x2')](0x0);return _0x59bc3a[_0xf106('0x3')](_0x4ab04f,_0xf106('0x4'));}function Final(_0x318376){this[_0xf106('0x5')]=_0x318376[_0xf106('0x5')];this[_0xf106('0x6')]=_0x318376['scheduledat'];this[_0xf106('0x7')]=_0x318376[_0xf106('0x7')];this['campaigntype']=_0x318376['type']==='outbound'?'queue':_0x318376['type'];this[_0xf106('0x8')]=_0x318376[_0xf106('0x8')];this[_0xf106('0x9')]=_0x318376[_0xf106('0x9')];this[_0xf106('0xa')]=_0x318376[_0xf106('0xa')];this[_0xf106('0xb')]=_0x318376[_0xf106('0x8')]+_0x318376[_0xf106('0x9')]+_0x318376[_0xf106('0xa')]+_0x318376[_0xf106('0xc')]+_0x318376['countdropretry']+_0x318376[_0xf106('0xd')]+_0x318376[_0xf106('0xe')]+_0x318376['countagentrejectretry'];this['countnosuchnumberretry']=_0x318376[_0xf106('0xc')];this[_0xf106('0xf')]=_0x318376[_0xf106('0xf')];this['countabandonedretry']=_0x318376[_0xf106('0xd')];this[_0xf106('0xe')]=_0x318376[_0xf106('0xe')];this['countagentrejectretry']=_0x318376[_0xf106('0x10')];this[_0xf106('0x11')]=_0x318376['queue'];this[_0xf106('0x12')]=_0x318376[_0xf106('0x12')];this[_0xf106('0x13')]=_0x318376['calleridnum'];this['starttime']=_0x318376[_0xf106('0x14')];this[_0xf106('0x15')]=_0x318376[_0xf106('0x15')];this['endtime']=_0x318376[_0xf106('0x15')];this[_0xf106('0x16')]=_0x318376[_0xf106('0x16')]||0x0;this[_0xf106('0x17')]=_0x318376[_0xf106('0x17')]||0x0;this[_0xf106('0x18')]=_0x318376[_0xf106('0x18')]||0x0;this[_0xf106('0x19')]=_0x318376[_0xf106('0x19')];this['callbackuniqueid']=_0x318376['callbackuniqueid'];this[_0xf106('0x1a')]=_0x318376['callbackat'];this[_0xf106('0x1b')]=_0x318376[_0xf106('0x1b')];this[_0xf106('0x1c')]=_0x318376[_0xf106('0x1c')];this[_0xf106('0x1d')]=_0x318376['ListId'];this['UserId']=_0x318376[_0xf106('0x1e')];this[_0xf106('0x1f')]=_0x318376[_0xf106('0x1f')];this[_0xf106('0x20')]=_0x318376[_0xf106('0x20')];this[_0xf106('0x21')]=_0x318376[_0xf106('0x21')]||'';this[_0xf106('0x22')]=_0x318376[_0xf106('0x22')]||'';}module[_0xf106('0x23')]=Final; \ No newline at end of file +var _0x3937=['countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','calleridnum','responsetime','endtime','ringtime','holdtime','callback','callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','moment','diff','seconds','uniqueid','scheduledat','type','outbound','queue','countbusyretry','countglobal','countcongestionretry','countnosuchnumberretry'];(function(_0x1f4608,_0x9822d6){var _0x13be13=function(_0x2b573b){while(--_0x2b573b){_0x1f4608['push'](_0x1f4608['shift']());}};_0x13be13(++_0x9822d6);}(_0x3937,0xbf));var _0x7393=function(_0x274202,_0x4100ba){_0x274202=_0x274202-0x0;var _0x495c1a=_0x3937[_0x274202];return _0x495c1a;};'use strict';var util=require(_0x7393('0x0'));var _=require('lodash');var moment=require(_0x7393('0x1'));function getSeconds(_0x182983,_0x49aa96){var _0x45cd02=moment(_0x182983)['milliseconds'](0x0);var _0x224468=moment(_0x49aa96)['milliseconds'](0x0);return _0x45cd02[_0x7393('0x2')](_0x224468,_0x7393('0x3'));}function Final(_0x20011b){this[_0x7393('0x4')]=_0x20011b[_0x7393('0x4')];this[_0x7393('0x5')]=_0x20011b[_0x7393('0x5')];this[_0x7393('0x6')]=_0x20011b[_0x7393('0x6')];this['campaigntype']=_0x20011b['type']===_0x7393('0x7')?_0x7393('0x8'):_0x20011b[_0x7393('0x6')];this['countbusyretry']=_0x20011b[_0x7393('0x9')];this['countcongestionretry']=_0x20011b['countcongestionretry'];this['countnoanswerretry']=_0x20011b['countnoanswerretry'];this[_0x7393('0xa')]=_0x20011b[_0x7393('0x9')]+_0x20011b[_0x7393('0xb')]+_0x20011b['countnoanswerretry']+_0x20011b[_0x7393('0xc')]+_0x20011b[_0x7393('0xd')]+_0x20011b[_0x7393('0xe')]+_0x20011b[_0x7393('0xf')]+_0x20011b[_0x7393('0x10')];this[_0x7393('0xc')]=_0x20011b[_0x7393('0xc')];this[_0x7393('0xd')]=_0x20011b[_0x7393('0xd')];this['countabandonedretry']=_0x20011b['countabandonedretry'];this[_0x7393('0xf')]=_0x20011b['countmachineretry'];this['countagentrejectretry']=_0x20011b['countagentrejectretry'];this[_0x7393('0x8')]=_0x20011b['queue'];this[_0x7393('0x11')]=_0x20011b[_0x7393('0x11')];this['calleridnum']=_0x20011b[_0x7393('0x12')];this['starttime']=_0x20011b['starttime'];this[_0x7393('0x13')]=_0x20011b[_0x7393('0x13')];this[_0x7393('0x14')]=_0x20011b[_0x7393('0x13')];this[_0x7393('0x15')]=_0x20011b[_0x7393('0x15')]||0x0;this[_0x7393('0x16')]=_0x20011b[_0x7393('0x16')]||0x0;this['talktime']=_0x20011b['talktime']||0x0;this[_0x7393('0x17')]=_0x20011b[_0x7393('0x17')];this[_0x7393('0x18')]=_0x20011b[_0x7393('0x18')];this[_0x7393('0x19')]=_0x20011b['callbackat'];this['recallme']=_0x20011b['recallme'];this[_0x7393('0x1a')]=_0x20011b['ContactId'];this['ListId']=_0x20011b[_0x7393('0x1b')];this[_0x7393('0x1c')]=_0x20011b['UserId'];this[_0x7393('0x1d')]=_0x20011b[_0x7393('0x1d')];this[_0x7393('0x1e')]=_0x20011b[_0x7393('0x1e')];this[_0x7393('0x1f')]=_0x20011b[_0x7393('0x1f')]||'';this[_0x7393('0x20')]=_0x20011b[_0x7393('0x20')]||'';}module[_0x7393('0x21')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index b852c62..242eaaf 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 _0xa0ae=['callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','lodash','moment','milliseconds','diff','seconds','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','IVR','reason','cause-txt'];(function(_0x168143,_0x3ec1e4){var _0x164b3c=function(_0x239fbf){while(--_0x239fbf){_0x168143['push'](_0x168143['shift']());}};_0x164b3c(++_0x3ec1e4);}(_0xa0ae,0x1ac));var _0xea0a=function(_0x245afe,_0x319cde){_0x245afe=_0x245afe-0x0;var _0x4eefde=_0xa0ae[_0x245afe];return _0x4eefde;};'use strict';var util=require('util');var _=require(_0xea0a('0x0'));var moment=require(_0xea0a('0x1'));function getSeconds(_0xea2909,_0x4f0eaf){var _0x487187=moment(_0xea2909)[_0xea0a('0x2')](0x0);var _0x370bf4=moment(_0x4f0eaf)[_0xea0a('0x2')](0x0);return _0x487187[_0xea0a('0x3')](_0x370bf4,_0xea0a('0x4'));}function Hangup(_0x4ca7d5,_0xac9684){this[_0xea0a('0x5')]=0x4;this[_0xea0a('0x6')]=_0xea0a('0x7');this[_0xea0a('0x8')]=_0x4ca7d5[_0xea0a('0x8')];this['type']=_0x4ca7d5[_0xea0a('0x9')];this[_0xea0a('0xa')]=_0x4ca7d5['type']===_0xea0a('0xb')?_0xea0a('0xc'):_0x4ca7d5['type'];this[_0xea0a('0xd')]=_0x4ca7d5[_0xea0a('0xd')];this[_0xea0a('0xe')]=_0x4ca7d5[_0xea0a('0xe')];this[_0xea0a('0xf')]=_0x4ca7d5[_0xea0a('0xf')];this['countglobal']=_0x4ca7d5[_0xea0a('0xd')]+_0x4ca7d5['countcongestionretry']+_0x4ca7d5['countnoanswerretry']+_0x4ca7d5[_0xea0a('0x10')]+_0x4ca7d5[_0xea0a('0x11')]+_0x4ca7d5[_0xea0a('0x12')]+_0x4ca7d5[_0xea0a('0x13')]+_0x4ca7d5[_0xea0a('0x14')];this[_0xea0a('0x10')]=_0x4ca7d5[_0xea0a('0x10')];this[_0xea0a('0x11')]=_0x4ca7d5[_0xea0a('0x11')];this['countabandonedretry']=_0x4ca7d5[_0xea0a('0x12')];this[_0xea0a('0x13')]=_0x4ca7d5[_0xea0a('0x13')];this['countagentrejectretry']=_0x4ca7d5[_0xea0a('0x14')];this['uniqueid']=_0xac9684[_0xea0a('0x15')];this[_0xea0a('0x16')]=_0x4ca7d5[_0xea0a('0x17')];this['calleridnum']=_0x4ca7d5['number'];this[_0xea0a('0x18')]=_0x4ca7d5[_0xea0a('0x18')];this['responsetime']=_0x4ca7d5[_0xea0a('0x19')];this[_0xea0a('0x1a')]=moment()[_0xea0a('0x1b')](_0xea0a('0x1c'));this[_0xea0a('0x1d')]=getSeconds(_0x4ca7d5[_0xea0a('0x19')],_0x4ca7d5[_0xea0a('0x18')]);this[_0xea0a('0x1e')]=0x0;this['talktime']=getSeconds(this[_0xea0a('0x1a')],_0x4ca7d5[_0xea0a('0x19')]);this[_0xea0a('0xc')]=_0x4ca7d5[_0xea0a('0xc')];this['membername']=_0xea0a('0x1f');this[_0xea0a('0x20')]=_0xac9684[_0xea0a('0x21')];this['callback']=_0x4ca7d5['callback'];this[_0xea0a('0x22')]=_0x4ca7d5['callbackuniqueid'];this[_0xea0a('0x23')]=_0x4ca7d5[_0xea0a('0x23')];this[_0xea0a('0x24')]=_0x4ca7d5[_0xea0a('0x24')];this[_0xea0a('0x25')]=_0x4ca7d5[_0xea0a('0x25')];this[_0xea0a('0x26')]=_0x4ca7d5[_0xea0a('0x26')];this[_0xea0a('0x27')]=_0x4ca7d5[_0xea0a('0x27')];this[_0xea0a('0x28')]=_0x4ca7d5[_0xea0a('0x28')];this[_0xea0a('0x29')]=_0x4ca7d5['CampaignId'];}module['exports']=Hangup; \ No newline at end of file +var _0xcfd6=['IVR','reason','cause-txt','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','CampaignId','exports','util','lodash','milliseconds','diff','seconds','state','statedesc','Answer','scheduledat','type','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','calleridnum','number','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','starttime','holdtime','talktime','queue','membername'];(function(_0x33ba5a,_0x460a6c){var _0x28e057=function(_0x401cc7){while(--_0x401cc7){_0x33ba5a['push'](_0x33ba5a['shift']());}};_0x28e057(++_0x460a6c);}(_0xcfd6,0x113));var _0x6cfd=function(_0x1b2a72,_0x56612b){_0x1b2a72=_0x1b2a72-0x0;var _0x41141c=_0xcfd6[_0x1b2a72];return _0x41141c;};'use strict';var util=require(_0x6cfd('0x0'));var _=require(_0x6cfd('0x1'));var moment=require('moment');function getSeconds(_0x46b47e,_0x3baba9){var _0x40baa0=moment(_0x46b47e)['milliseconds'](0x0);var _0xda5721=moment(_0x3baba9)[_0x6cfd('0x2')](0x0);return _0x40baa0[_0x6cfd('0x3')](_0xda5721,_0x6cfd('0x4'));}function Hangup(_0x56a0a7,_0x223112){this[_0x6cfd('0x5')]=0x4;this[_0x6cfd('0x6')]=_0x6cfd('0x7');this[_0x6cfd('0x8')]=_0x56a0a7[_0x6cfd('0x8')];this[_0x6cfd('0x9')]=_0x56a0a7[_0x6cfd('0x9')];this['campaigntype']=_0x56a0a7[_0x6cfd('0x9')]===_0x6cfd('0xa')?'queue':_0x56a0a7[_0x6cfd('0x9')];this[_0x6cfd('0xb')]=_0x56a0a7['countbusyretry'];this[_0x6cfd('0xc')]=_0x56a0a7[_0x6cfd('0xc')];this[_0x6cfd('0xd')]=_0x56a0a7[_0x6cfd('0xd')];this['countglobal']=_0x56a0a7[_0x6cfd('0xb')]+_0x56a0a7[_0x6cfd('0xc')]+_0x56a0a7[_0x6cfd('0xd')]+_0x56a0a7[_0x6cfd('0xe')]+_0x56a0a7[_0x6cfd('0xf')]+_0x56a0a7[_0x6cfd('0x10')]+_0x56a0a7[_0x6cfd('0x11')]+_0x56a0a7['countagentrejectretry'];this[_0x6cfd('0xe')]=_0x56a0a7['countnosuchnumberretry'];this[_0x6cfd('0xf')]=_0x56a0a7[_0x6cfd('0xf')];this[_0x6cfd('0x10')]=_0x56a0a7[_0x6cfd('0x10')];this['countmachineretry']=_0x56a0a7[_0x6cfd('0x11')];this[_0x6cfd('0x12')]=_0x56a0a7[_0x6cfd('0x12')];this[_0x6cfd('0x13')]=_0x223112['uniqueid'];this[_0x6cfd('0x14')]=_0x56a0a7['name'];this[_0x6cfd('0x15')]=_0x56a0a7[_0x6cfd('0x16')];this['starttime']=_0x56a0a7['starttime'];this['responsetime']=_0x56a0a7[_0x6cfd('0x17')];this[_0x6cfd('0x18')]=moment()[_0x6cfd('0x19')](_0x6cfd('0x1a'));this[_0x6cfd('0x1b')]=getSeconds(_0x56a0a7[_0x6cfd('0x17')],_0x56a0a7[_0x6cfd('0x1c')]);this[_0x6cfd('0x1d')]=0x0;this[_0x6cfd('0x1e')]=getSeconds(this[_0x6cfd('0x18')],_0x56a0a7[_0x6cfd('0x17')]);this[_0x6cfd('0x1f')]=_0x56a0a7[_0x6cfd('0x1f')];this[_0x6cfd('0x20')]=_0x6cfd('0x21');this[_0x6cfd('0x22')]=_0x223112[_0x6cfd('0x23')];this['callback']=_0x56a0a7['callback'];this[_0x6cfd('0x24')]=_0x56a0a7[_0x6cfd('0x24')];this[_0x6cfd('0x25')]=_0x56a0a7[_0x6cfd('0x25')];this['recallme']=_0x56a0a7[_0x6cfd('0x26')];this[_0x6cfd('0x27')]=_0x56a0a7['ContactId'];this[_0x6cfd('0x28')]=_0x56a0a7['ListId'];this[_0x6cfd('0x29')]=_0x56a0a7[_0x6cfd('0x29')];this['VoiceQueueId']=_0x56a0a7['VoiceQueueId'];this['CampaignId']=_0x56a0a7[_0x6cfd('0x2a')];}module[_0x6cfd('0x2b')]=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js index b81b950..95d085e 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 _0x0eca=['recallme','ContactId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','moment','milliseconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','calleridname','name','calleridnum','number','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat'];(function(_0x11ff8a,_0x269ec4){var _0x415be3=function(_0x407051){while(--_0x407051){_0x11ff8a['push'](_0x11ff8a['shift']());}};_0x415be3(++_0x269ec4);}(_0x0eca,0x12f));var _0xa0ec=function(_0x55bf29,_0x42915f){_0x55bf29=_0x55bf29-0x0;var _0x3bcec5=_0x0eca[_0x55bf29];return _0x3bcec5;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0xa0ec('0x0'));function getSeconds(_0x45515c,_0x3d872d){var _0x423387=moment(_0x45515c)['milliseconds'](0x0);var _0x3f362c=moment(_0x3d872d)[_0xa0ec('0x1')](0x0);return _0x423387['diff'](_0x3f362c,'seconds');}function History(_0x30f1f0){this[_0xa0ec('0x2')]=_0x30f1f0[_0xa0ec('0x2')];this[_0xa0ec('0x3')]=_0x30f1f0[_0xa0ec('0x3')]||undefined;this[_0xa0ec('0x4')]=_0x30f1f0[_0xa0ec('0x4')];this[_0xa0ec('0x5')]=_0x30f1f0[_0xa0ec('0x4')]===_0xa0ec('0x6')?_0xa0ec('0x7'):_0x30f1f0[_0xa0ec('0x4')];this[_0xa0ec('0x8')]=_0x30f1f0[_0xa0ec('0x8')];this[_0xa0ec('0x9')]=_0x30f1f0['countcongestionretry'];this['countnoanswerretry']=_0x30f1f0[_0xa0ec('0xa')];this[_0xa0ec('0xb')]=_0x30f1f0[_0xa0ec('0x8')]+_0x30f1f0[_0xa0ec('0x9')]+_0x30f1f0['countnoanswerretry']+_0x30f1f0['countnosuchnumberretry']+_0x30f1f0[_0xa0ec('0xc')]+_0x30f1f0[_0xa0ec('0xd')]+_0x30f1f0[_0xa0ec('0xe')]+_0x30f1f0[_0xa0ec('0xf')];this[_0xa0ec('0x10')]=_0x30f1f0['countnosuchnumberretry'];this['countdropretry']=_0x30f1f0[_0xa0ec('0xc')];this[_0xa0ec('0xd')]=_0x30f1f0[_0xa0ec('0xd')];this[_0xa0ec('0xe')]=_0x30f1f0['countmachineretry'];this['countagentrejectretry']=_0x30f1f0[_0xa0ec('0xf')];this['queue']=_0x30f1f0[_0xa0ec('0x7')];this[_0xa0ec('0x11')]=_0x30f1f0[_0xa0ec('0x12')];this[_0xa0ec('0x13')]=_0x30f1f0[_0xa0ec('0x14')];this[_0xa0ec('0x15')]=_0x30f1f0[_0xa0ec('0x15')];this[_0xa0ec('0x16')]=_0x30f1f0[_0xa0ec('0x16')];this[_0xa0ec('0x17')]=_0x30f1f0[_0xa0ec('0x16')];this[_0xa0ec('0x18')]=getSeconds(_0x30f1f0[_0xa0ec('0x16')],_0x30f1f0['starttime']);this[_0xa0ec('0x19')]=0x0;this[_0xa0ec('0x1a')]=0x0;this[_0xa0ec('0x1b')]=_0x30f1f0['callback'];this[_0xa0ec('0x1c')]=_0x30f1f0['callbackuniqueid'];this['callbackat']=_0x30f1f0[_0xa0ec('0x1d')];this[_0xa0ec('0x1e')]=_0x30f1f0[_0xa0ec('0x1e')];this[_0xa0ec('0x1f')]=_0x30f1f0[_0xa0ec('0x1f')];this['ListId']=_0x30f1f0['ListId'];this['UserId']=_0x30f1f0[_0xa0ec('0x20')];this[_0xa0ec('0x21')]=_0x30f1f0['VoiceQueueId'];this[_0xa0ec('0x22')]=_0x30f1f0['CampaignId'];this[_0xa0ec('0x23')]=_0x30f1f0[_0xa0ec('0x23')]||'';this[_0xa0ec('0x24')]=_0x30f1f0[_0xa0ec('0x24')]||'';}module['exports']=History; \ No newline at end of file +var _0x38bc=['campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','name','calleridnum','number','starttime','responsetime','holdtime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type'];(function(_0x2f421,_0x5144c4){var _0x27b4af=function(_0x119470){while(--_0x119470){_0x2f421['push'](_0x2f421['shift']());}};_0x27b4af(++_0x5144c4);}(_0x38bc,0x120));var _0xc38b=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0x38bc[_0x51020b];return _0x371e47;};'use strict';var util=require(_0xc38b('0x0'));var _=require('lodash');var moment=require(_0xc38b('0x1'));function getSeconds(_0x438ac2,_0x5c42f7){var _0x4ef597=moment(_0x438ac2)[_0xc38b('0x2')](0x0);var _0x3d9550=moment(_0x5c42f7)[_0xc38b('0x2')](0x0);return _0x4ef597[_0xc38b('0x3')](_0x3d9550,_0xc38b('0x4'));}function History(_0x5a98e2){this[_0xc38b('0x5')]=_0x5a98e2[_0xc38b('0x5')];this[_0xc38b('0x6')]=_0x5a98e2[_0xc38b('0x6')]||undefined;this['type']=_0x5a98e2[_0xc38b('0x7')];this[_0xc38b('0x8')]=_0x5a98e2[_0xc38b('0x7')]===_0xc38b('0x9')?_0xc38b('0xa'):_0x5a98e2[_0xc38b('0x7')];this[_0xc38b('0xb')]=_0x5a98e2[_0xc38b('0xb')];this[_0xc38b('0xc')]=_0x5a98e2[_0xc38b('0xc')];this[_0xc38b('0xd')]=_0x5a98e2['countnoanswerretry'];this[_0xc38b('0xe')]=_0x5a98e2['countbusyretry']+_0x5a98e2['countcongestionretry']+_0x5a98e2[_0xc38b('0xd')]+_0x5a98e2[_0xc38b('0xf')]+_0x5a98e2['countdropretry']+_0x5a98e2[_0xc38b('0x10')]+_0x5a98e2[_0xc38b('0x11')]+_0x5a98e2[_0xc38b('0x12')];this['countnosuchnumberretry']=_0x5a98e2[_0xc38b('0xf')];this['countdropretry']=_0x5a98e2['countdropretry'];this[_0xc38b('0x10')]=_0x5a98e2[_0xc38b('0x10')];this['countmachineretry']=_0x5a98e2['countmachineretry'];this[_0xc38b('0x12')]=_0x5a98e2[_0xc38b('0x12')];this[_0xc38b('0xa')]=_0x5a98e2[_0xc38b('0xa')];this[_0xc38b('0x13')]=_0x5a98e2[_0xc38b('0x14')];this[_0xc38b('0x15')]=_0x5a98e2[_0xc38b('0x16')];this[_0xc38b('0x17')]=_0x5a98e2[_0xc38b('0x17')];this[_0xc38b('0x18')]=_0x5a98e2[_0xc38b('0x18')];this['endtime']=_0x5a98e2[_0xc38b('0x18')];this['ringtime']=getSeconds(_0x5a98e2[_0xc38b('0x18')],_0x5a98e2[_0xc38b('0x17')]);this[_0xc38b('0x19')]=0x0;this['talktime']=0x0;this[_0xc38b('0x1a')]=_0x5a98e2['callback'];this[_0xc38b('0x1b')]=_0x5a98e2[_0xc38b('0x1b')];this['callbackat']=_0x5a98e2[_0xc38b('0x1c')];this[_0xc38b('0x1d')]=_0x5a98e2[_0xc38b('0x1d')];this[_0xc38b('0x1e')]=_0x5a98e2[_0xc38b('0x1e')];this['ListId']=_0x5a98e2[_0xc38b('0x1f')];this[_0xc38b('0x20')]=_0x5a98e2[_0xc38b('0x20')];this[_0xc38b('0x21')]=_0x5a98e2['VoiceQueueId'];this[_0xc38b('0x22')]=_0x5a98e2[_0xc38b('0x22')];this[_0xc38b('0x23')]=_0x5a98e2[_0xc38b('0x23')]||'';this[_0xc38b('0x24')]=_0x5a98e2[_0xc38b('0x24')]||'';}module['exports']=History; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index efb2ed3..e5a8c3e 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 _0x4a47=['replace','random','match','actionOriginate','originate','voiceQueue\x20is\x20undefine','Contact','phone','contact\x20is\x20undefine','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','ACTIVE','xcally-motion-dialer','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-CAMPAIGNID','tags','createdAt','updatedAt','XMD-','toUpper','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','XMD-ORIGINATECALLERIDNAME','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','SIP/%s/%s%s','trim','dialCutDigit','substring','from-sip','[originateError]:\x20%s','OriginateError','[originate][error]','syncOriginateResponse','getQueue','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialAbandonedMaxRetry','[rescheduleContact][Abandoned]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','object','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','outboundNoSuchCallsDay','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','NoAnswer','custom:agentnoanswer','noanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','reason\x205\x20busy','outboundCongestionCallsDay','Congestion','custom:agentcongestion','reason\x208\x20congestion','[syncAgentComplete][createHistory][11]','reason\x2011\x20abandoned','outboundRejectCallsDay','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','Global','dialPredictiveOptimizationPercentage','round','predictiveIntervalMaxThreshold','predictiveIntervalAvailable','predictiveIntervalMinThreshold','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','[CatchErlangB]','outboundQueuePauses','floor','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','dialRecallMeTimeout','Agent','voicePause','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','Blacklist','inBlackList','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','Contact.phone','loggerHandler','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','reachable','dialOrderByScheduledAt','tryOriginatePredictive','[handlePredictive][limitChannel]','[actionOriginatePredictive]\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','Error','p\x20=\x20','interval\x20=\x20','Amax\x20=\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','[busyFactor]','m\x20=\x20','exports','util','lodash','bluebird','uuid','moment','ioredis','../../../config/environment/','../../../config/logger','booked','../ami','redis','defaults','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/voiceQueueRt','./action','./history','./queueCallerAbandon','./hangup','env','XCALLY_IP_AGI','127.0.0.1','rrmemory','roundrobin','prototype','enqueue','tail','finally','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','contactsId','uniqueId','startProgressive','ivrOriginated','queueBooked','queueBookedRR','syncAgentConnect','syncQueueCallerAbandon','bind','originateresponse','agentcomplete','custom:queuesummary','hangup','syncHangup','newexten','syncNewExten','varset','syncVarSet','syncQueueStatusComplete','loopCampaigns','isUndefined','NOT_ACTIVE','name','\x20NOT\x20Active','Interval','message','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','[ifTime][Action]','stringify','milliseconds','diff','emit','type','answered','available','loggedIn','pTalking','sumBillable','sumHoldTime','talking','unmanaged','abandoned','waiting','dialMethod','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangBusyFactor','startPredictive','Trunk','callerid','md5','format','voice_queue:save','ivr','campaign:save','isEmpty','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','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangAbandonmentRate','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','seconds','clearing\x20variable\x20start\x20predictive','handlePredictive','outbound','string','\x22%s\x22\x20<%s>','error','inspect','length','undefined','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20not\x20active','state','statedesc','endtime','clearZombieChannels','[uniqueid]','[actions]','sequence','isNil','Action','status','channel','catch','No\x20such\x20channel','queue','[Dialer][checkChannel][ivr]','countReScheduled','resolve','then','[countReScheduled]\x20','checkIsBlackList','[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','[updateOriginated]\x20object\x20originated\x20is\x20negative','emptyContact','notFound','saveInDb','pick','ContactId','ListId','VoiceQueueId','CampaignId','[emptyContact]','isSuccess','Success','isTrunkReachable','active','SIP/%s','unmonitored','variable','exten','HANGUP','uniqueid','outboundAnswerCallsDay','buildObj','amd','[syncHangupInAMD]','dialAMDActive','value','MACHINE','Machine','membername','AMD','countmachineretry','countglobal','custom:amd','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','reason\x2019\x20machine....','dialMachineRetryFrequency','minutes','HangupInAMD','[syncHangupInAMDIvr][createHistory]','[syncAgentComplete][createHistory][0]','countabandonedretry','countagentrejectretry','dialMachineMaxRetry','createStateFinal','add','YYYY-MM-DD\x20HH:mm:ss','[rescheduleContact][Machine]','ivrAnswerCallsDay','dialQueueProject','AnswerAGI','cause-txt','Unknow','[syncHangupIvr][createHistory]','[syncHangupIvr]','reason','agent','agiafterat','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','answertime','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','dialQueueTimeout','Drop','dropreason','dialDropMaxRetry','dialDropRetryFrequency','[rescheduleContact][Drop]','starttime','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','Abandoned','CALLEREXIT','actions','syncQueueMember','actionid','strategy','locked','paused','stateinterface','push','merge','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','run','idHopper','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','unlockRR','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','syncCampaigns','checkIsTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','checkIfTime','ifTime','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','command','iftime\x20%s,%s','interval','content','indexOf','true','all','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','\x20Interval\x20is\x20overtime:\x20','checkDialMethod','power','handlePower','dialPowerLevel','predictive','Queue','method\x20not\x20recognized','launchHandleIvr','handleIvr','syncQueueSummary','dialActive','dialGlobalInterval','dialTimezone','[syncQueueSummary]','[syncCampaigns]','\x5cw{0,','pow'];(function(_0xfcfe92,_0x14ea66){var _0x166ba1=function(_0x45f01a){while(--_0x45f01a){_0xfcfe92['push'](_0xfcfe92['shift']());}};_0x166ba1(++_0x14ea66);}(_0x4a47,0xb5));var _0x74a4=function(_0x26474a,_0x3cfcfd){_0x26474a=_0x26474a-0x0;var _0x32e0e0=_0x4a47[_0x26474a];return _0x32e0e0;};'use strict';var util=require(_0x74a4('0x0'));var _=require(_0x74a4('0x1'));var BPromise=require(_0x74a4('0x2'));var uuid=require(_0x74a4('0x3'));var moment=require(_0x74a4('0x4'));var rr=require('rr');var md5=require('md5');var Redis=require(_0x74a4('0x5'));var ut=require('../preview/util/util');var config=require(_0x74a4('0x6'));var logger=require(_0x74a4('0x7'))('dialer');var loggerBooked=require(_0x74a4('0x7'))(_0x74a4('0x8'));var loggerPredictive=require(_0x74a4('0x7'))('predictive');var loggerPredictiveCalls=require(_0x74a4('0x7'))('predictiveCalls');var loggerSyncQueueSummary=require(_0x74a4('0x7'))('syncQueueSummary');var ami=require(_0x74a4('0x9'));config[_0x74a4('0xa')]=_[_0x74a4('0xb')](config[_0x74a4('0xa')],{'host':'localhost','port':0x18eb});var io=require(_0x74a4('0xc'))(new Redis(config[_0x74a4('0xa')]));var cmHopper=require(_0x74a4('0xd'));var cmHopperHistory=require(_0x74a4('0xe'));var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require(_0x74a4('0xf'));var Action=require(_0x74a4('0x10'));var History=require(_0x74a4('0x11'));var Final=require('./final');var AgentComplete=require('./agentComplete');var QueueCallerAbandon=require(_0x74a4('0x12'));var Hangup=require(_0x74a4('0x13'));var ipAgi=process[_0x74a4('0x14')][_0x74a4('0x15')]||_0x74a4('0x16');var strategy={'rrmemory':_0x74a4('0x17'),'roundrobin':_0x74a4('0x18')};var Sequence=function(){};Sequence[_0x74a4('0x19')][_0x74a4('0x1a')]=function(_0xbf6e1e){this[_0x74a4('0x1b')]=this[_0x74a4('0x1b')]?this[_0x74a4('0x1b')][_0x74a4('0x1c')](_0xbf6e1e):_0xbf6e1e();};function Dialer(_0x3d9b8c,_0xa1dd7e){this['sequence']=new Sequence();this[_0x74a4('0x1d')]=_0xa1dd7e;this[_0x74a4('0x1e')]=_0x3d9b8c[_0x74a4('0x1e')];this[_0x74a4('0x1f')]=_0x3d9b8c['campaigns'];this[_0x74a4('0x20')]=_0x3d9b8c[_0x74a4('0x20')];this[_0x74a4('0x21')]=_0x3d9b8c[_0x74a4('0x21')];this['maxNumberOriginate']=config[_0x74a4('0x22')]||0x2;this[_0x74a4('0x23')]={};this['actions']={};this[_0x74a4('0x24')]={};this[_0x74a4('0x25')]={};this['optionPredictive']={};this['startPredictive']={};this[_0x74a4('0x26')]={};this[_0x74a4('0x27')]={};this[_0x74a4('0x28')]={};this[_0x74a4('0x29')]={};ami['on']('agentconnect',this[_0x74a4('0x2a')]['bind'](this));ami['on']('queuecallerabandon',this[_0x74a4('0x2b')][_0x74a4('0x2c')](this));ami['on'](_0x74a4('0x2d'),this['syncOriginateResponse'][_0x74a4('0x2c')](this));ami['on'](_0x74a4('0x2e'),this['syncAgentComplete'][_0x74a4('0x2c')](this));ami['on'](_0x74a4('0x2f'),this['syncQueueSummary'][_0x74a4('0x2c')](this));ami['on'](_0x74a4('0x30'),this[_0x74a4('0x31')]['bind'](this));ami['on'](_0x74a4('0x32'),this[_0x74a4('0x33')][_0x74a4('0x2c')](this));ami['on'](_0x74a4('0x34'),this[_0x74a4('0x35')][_0x74a4('0x2c')](this));ami['on']('queuemember',this['syncQueueMember'][_0x74a4('0x2c')](this));ami['on']('queuestatuscomplete',this[_0x74a4('0x36')]['bind'](this));this[_0x74a4('0x37')]();this['loopClearZombieChannels']();}function isNotNull(_0x5a1dad){return _0x5a1dad!==null&&!_[_0x74a4('0x38')](_0x5a1dad);}function checkIsLoggedIn(_0x376f29,_0x309846){return function(){if(_0x309846<=0x0){_0x376f29['message']='AGENTS_NOT_LOGGED';throw _0x376f29['name']+'\x20AGENTS\x20NOT\x20LOGGED';}};}function isActive(_0x56ffa5){return _0x56ffa5;}function checkIsActive(_0x4c5f49,_0x176610){return function(){if(!isActive(_0x176610)){_0x4c5f49['message']=_0x74a4('0x39');throw _0x4c5f49[_0x74a4('0x3a')]+_0x74a4('0x3b');}};}function checkInterval(_0x5b277a){return function(){if(!isNotNull(_0x5b277a[_0x74a4('0x3c')])){_0x5b277a[_0x74a4('0x3d')]=_0x74a4('0x3e');throw _0x5b277a[_0x74a4('0x3a')]+_0x74a4('0x3f');}if(!isNotNull(_0x5b277a[_0x74a4('0x3c')][_0x74a4('0x40')])){_0x5b277a[_0x74a4('0x3d')]='INTERVAL_IS_NULL';throw _0x5b277a[_0x74a4('0x3a')]+_0x74a4('0x3f');}if(!isNotNull(_['isEmpty'](_0x5b277a[_0x74a4('0x3c')]['Intervals']))){_0x5b277a['message']=_0x74a4('0x3e');throw _0x5b277a[_0x74a4('0x3a')]+_0x74a4('0x3f');}};}function msgResponse(_0x30cd17,_0x1d4e14,_0x431264){return{'action':_0x30cd17,'response':_0x1d4e14,'message':_0x431264,'stack':_0x431264};}function myreject(_0x299179){return function(_0x582eb4){return _0x299179(msgResponse(_0x74a4('0x41'),'Error',JSON[_0x74a4('0x42')](_0x582eb4)));};}function getSeconds(_0x3da4f6,_0x26572e){var _0x5d874c=moment(_0x3da4f6)[_0x74a4('0x43')](0x0);var _0x4ad9f9=moment(_0x26572e)[_0x74a4('0x43')](0x0);return _0x5d874c[_0x74a4('0x44')](_0x4ad9f9,'seconds');}function emit(_0x2d503d,_0x43f44d,_0x461b22){io['to'](_0x2d503d)[_0x74a4('0x45')](_0x43f44d,_0x461b22);}function emitVoiceQueueSummary(_0x1de439){if(_0x1de439[_0x74a4('0x46')]==='outbound'){var _0x46dcc2={'id':_0x1de439['id'],'name':_0x1de439[_0x74a4('0x3a')],'strategy':_0x1de439['strategy'],'answered':_0x1de439[_0x74a4('0x47')],'available':_0x1de439[_0x74a4('0x48')],'loggedIn':_0x1de439[_0x74a4('0x49')],'pTalking':_0x1de439[_0x74a4('0x4a')],'sumBillable':_0x1de439[_0x74a4('0x4b')],'sumDuration':_0x1de439['sumDuration'],'sumHoldTime':_0x1de439[_0x74a4('0x4c')]||0x0,'talking':_0x1de439[_0x74a4('0x4d')],'total':_0x1de439['total'],'type':_0x1de439[_0x74a4('0x46')],'unmanaged':_0x1de439[_0x74a4('0x4e')],'abandoned':_0x1de439[_0x74a4('0x4f')],'waiting':_0x1de439[_0x74a4('0x50')],'loggedInDb':_0x1de439['loggedInDb'],'dialActive':_0x1de439['dialActive'],'dialMethod':_0x1de439[_0x74a4('0x51')],'dialOriginateCallerIdName':_0x1de439['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x1de439['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x1de439[_0x74a4('0x52')],'dialPrefix':_0x1de439[_0x74a4('0x53')],'outboundAnswerAgiCallsDay':_0x1de439[_0x74a4('0x54')],'outboundAnswerCallsDay':_0x1de439['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x1de439[_0x74a4('0x55')],'outboundBusyCallsDay':_0x1de439[_0x74a4('0x56')],'outboundCongestionCallsDay':_0x1de439['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x1de439[_0x74a4('0x57')],'outboundDropCallsDayCallersExit':_0x1de439[_0x74a4('0x58')],'outboundDropCallsDayTimeout':_0x1de439[_0x74a4('0x59')],'outboundNoAnswerCallsDay':_0x1de439[_0x74a4('0x5a')],'outboundNoSuchCallsDay':_0x1de439['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x1de439[_0x74a4('0x5b')],'outboundReCallsDay':_0x1de439[_0x74a4('0x5c')],'outboundRejectCallsDay':_0x1de439['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x1de439[_0x74a4('0x5d')],'predictiveIntervalAnsweredCalls':_0x1de439[_0x74a4('0x5e')],'predictiveIntervalAvgHoldtime':_0x1de439[_0x74a4('0x5f')],'predictiveIntervalAvgTalktime':_0x1de439[_0x74a4('0x60')],'predictiveIntervalDroppedCallsCallersExit':_0x1de439[_0x74a4('0x61')],'predictiveIntervalDroppedCallsTimeout':_0x1de439[_0x74a4('0x62')],'predictiveIntervalErlangCalls':_0x1de439[_0x74a4('0x63')],'predictiveIntervalErlangCallsDroppedCalls':_0x1de439[_0x74a4('0x64')],'predictiveIntervalHitRate':_0x1de439[_0x74a4('0x65')],'predictiveIntervalMultiplicativeFactor':_0x1de439[_0x74a4('0x66')],'predictiveIntervalPauses':_0x1de439[_0x74a4('0x67')],'predictiveIntervalAvailable':_0x1de439['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x1de439[_0x74a4('0x68')],'message':_0x1de439['message'],'originated':_0x1de439[_0x74a4('0x69')],'erlangCalls':_0x1de439[_0x74a4('0x6a')],'erlangCallToSecond':_0x1de439[_0x74a4('0x6b')],'erlangAbandonmentRate':_0x1de439['erlangAbandonmentRate'],'erlangBusyFactor':_0x1de439[_0x74a4('0x6c')],'startPredictive':_0x1de439[_0x74a4('0x6d')],'startProgressive':_0x1de439['startProgressive']};if(_0x1de439[_0x74a4('0x6e')]){_0x46dcc2[_0x74a4('0x6e')]={'id':_0x1de439[_0x74a4('0x6e')]['id'],'name':_0x1de439[_0x74a4('0x6e')][_0x74a4('0x3a')],'active':_0x1de439['Trunk']['active'],'callerid':_0x1de439['Trunk'][_0x74a4('0x6f')]};}if(_0x1de439[_0x74a4('0x3c')]){_0x46dcc2[_0x74a4('0x3c')]={'id':_0x1de439['Interval']['id'],'name':_0x1de439[_0x74a4('0x3c')][_0x74a4('0x3a')]};}var _0x1c0ebf=md5(JSON[_0x74a4('0x42')](_0x46dcc2));if(_0x1de439['md5']!==_0x1c0ebf){_0x1de439[_0x74a4('0x70')]=_0x1c0ebf;emit(util[_0x74a4('0x71')]('voice:queue:%s',_0x46dcc2['name']),_0x74a4('0x72'),_0x46dcc2);}}}function emitCampaignSummary(_0x386c38){if(_0x386c38['type']===_0x74a4('0x73')){emit(util[_0x74a4('0x71')]('campaign:ivr:%s',_0x386c38[_0x74a4('0x3a')]),_0x74a4('0x74'),_0x386c38);}}function checkGetDataPredictive(_0x64ee1d){if(isNotNull(_0x64ee1d)&&!_[_0x74a4('0x75')](_0x64ee1d)){loggerPredictive[_0x74a4('0x76')](_0x74a4('0x77'));loggerPredictive[_0x74a4('0x76')](_0x74a4('0x78'),_0x64ee1d[_0x74a4('0x68')]);loggerPredictive[_0x74a4('0x76')](_0x74a4('0x79'),_0x64ee1d[_0x74a4('0x5e')]);loggerPredictive[_0x74a4('0x76')](_0x74a4('0x7a'),_0x64ee1d['predictiveIntervalDroppedCallsTimeout']);loggerPredictive[_0x74a4('0x76')]('Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x64ee1d[_0x74a4('0x61')]);loggerPredictive[_0x74a4('0x76')](_0x74a4('0x7b'),_0x64ee1d[_0x74a4('0x5f')]);loggerPredictive[_0x74a4('0x76')](_0x74a4('0x7c'),_0x64ee1d[_0x74a4('0x60')]);loggerPredictive[_0x74a4('0x76')]('---------------------------');if(_0x64ee1d[_0x74a4('0x68')]>0x0){if(!_[_0x74a4('0x38')](_0x64ee1d['predictiveIntervalAvgTalktime'])&&_0x64ee1d[_0x74a4('0x60')]>0x0){return!![];}loggerPredictive['info'](_0x74a4('0x7d'));if(!_[_0x74a4('0x38')](_0x64ee1d[_0x74a4('0x5f')])&&_0x64ee1d[_0x74a4('0x5f')]>0x0){return!![];}loggerPredictive[_0x74a4('0x76')](_0x74a4('0x7e'));}else{loggerPredictive[_0x74a4('0x76')]('Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive[_0x74a4('0x76')](_0x74a4('0x7f'));}return![];}function mergeDataErlangB(_0x4077cd){return function(_0x60dfe2){loggerPredictive[_0x74a4('0x76')]('---------\x20ErlangB\x20---------');loggerPredictive['info']('Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x60dfe2['erlangCalls']);loggerPredictive[_0x74a4('0x76')](_0x74a4('0x80'),_0x60dfe2[_0x74a4('0x6b')]);loggerPredictive[_0x74a4('0x76')](_0x74a4('0x81'),_0x60dfe2[_0x74a4('0x82')]);loggerPredictive[_0x74a4('0x76')](_0x74a4('0x83'),_0x60dfe2[_0x74a4('0x6c')]);loggerPredictive[_0x74a4('0x76')](_0x74a4('0x81'),_0x60dfe2[_0x74a4('0x82')]);loggerPredictive[_0x74a4('0x76')](_0x74a4('0x84'));_['merge'](_0x4077cd,_0x60dfe2);};}function getDiff(_0x17df43){var _0x4708a5=moment()['milliseconds'](0x0);var _0x52f5fb=moment(_0x17df43)[_0x74a4('0x43')](0x0);return _0x4708a5['diff'](_0x52f5fb,_0x74a4('0x85'));}function ifInterval(_0x46936c,_0x41d5db){if(_[_0x74a4('0x38')](_0x41d5db)){return![];}return getDiff(_0x41d5db)<_0x46936c*0x3c;}function freeVariablesPredictive(_0x2e07c2){if(isNotNull(_0x2e07c2)){if(!_['isUndefined'](_0x2e07c2['startProgressive'])){_0x2e07c2[_0x74a4('0x26')]=undefined;loggerPredictive['info'](_0x2e07c2[_0x74a4('0x3a')],'clearing\x20variable\x20start\x20progressive');}if(!_[_0x74a4('0x38')](_0x2e07c2[_0x74a4('0x6d')])){_0x2e07c2[_0x74a4('0x6d')]=undefined;loggerPredictive[_0x74a4('0x76')](_0x2e07c2[_0x74a4('0x3a')],_0x74a4('0x86'));}if(!_[_0x74a4('0x38')](_0x2e07c2[_0x74a4('0x87')])){clearInterval(_0x2e07c2['handlePredictive']);_0x2e07c2['handlePredictive']=undefined;loggerPredictive['info'](_0x2e07c2['name'],'clearing\x20variable\x20handle\x20predictive');}}}function erlangb(_0x5142d7,_0x1beb18){if(_0x1beb18===0x0){return 0x0;}var _0x2ff38b=0x1;for(var _0xaba4f3=0x1;_0xaba4f3<=_0x1beb18;_0xaba4f3+=0x1){_0x2ff38b=0x1+_0x2ff38b*_0xaba4f3/_0x5142d7;}return 0x1/_0x2ff38b;}function isVoiceQueueOutbound(_0x4972dd){return _0x4972dd===_0x74a4('0x88');}function isNotPreview(_0x256d8e){return _0x256d8e!==_0x74a4('0x1d');}function isCampaignIvr(_0x28ebb2){return _0x28ebb2===_0x74a4('0x73');}function getCallerId(_0x375954,_0x115223,_0x554bc5){if(!_[_0x74a4('0x38')](_0x554bc5)&&typeof _0x554bc5===_0x74a4('0x89')&&!_[_0x74a4('0x75')](_0x554bc5)){if(!_[_0x74a4('0x38')](_0x115223)&&typeof _0x115223===_0x74a4('0x89')&&!_[_0x74a4('0x75')](_0x115223)){return util[_0x74a4('0x71')]('\x22%s\x22\x20<%s>',_0x115223,_0x554bc5);}return util[_0x74a4('0x71')](_0x74a4('0x8a'),_0x554bc5,_0x554bc5);}if(!_[_0x74a4('0x38')](_0x375954)&&typeof _0x375954==='string'&&!_[_0x74a4('0x75')](_0x375954)){return _0x375954;}return'\x22\x22\x20<>';}function loggerCatchQueueSummary(_0x50d047,_0x94a50f){return function(_0x292a10){freeVariablesPredictive(_0x94a50f);emitVoiceQueueSummary(_0x94a50f);emitCampaignSummary(_0x94a50f);loggerSyncQueueSummary[_0x74a4('0x8b')](_0x50d047,util[_0x74a4('0x8c')](_0x292a10,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x24d2ef,_0x5b3235){return function(_0x56858b){loggerPredictive[_0x74a4('0x8b')](_0x5b3235[_0x74a4('0x3a')],_0x24d2ef);loggerPredictive[_0x74a4('0x8b')](_0x56858b['stack']);freeVariablesPredictive(_0x5b3235);};}function loggerCatch(_0x290300){return function(_0x3256c6){logger['error'](_0x290300,util[_0x74a4('0x8c')](_0x3256c6,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x2ab6e2){return _0x2ab6e2&&!_[_0x74a4('0x38')](_0x2ab6e2)&&_0x2ab6e2[_0x74a4('0x8d')]>0x0;}function decremetOriginate(_0x59b269){if(!_[_0x74a4('0x38')](_0x59b269)&&_0x59b269!==null){if(typeof _0x59b269[_0x74a4('0x69')]!==_0x74a4('0x8e')){if(_0x59b269['originated']>0x0){_0x59b269[_0x74a4('0x69')]-=0x1;}else{logger[_0x74a4('0x8b')](_0x74a4('0x8f'));}}}else{logger['error'](_0x74a4('0x90'));}}function checkContactLowerLimitOriginate(_0x13a613,_0x321cfa,_0x1e6408){if(_0x321cfa>_0x1e6408){for(var _0x4435a3=0x0;_0x4435a3<_0x321cfa-_0x1e6408;_0x4435a3+=0x1){decremetOriginate(_0x13a613);}}}function loggerGetContactDialer(_0x3b2710,_0x337cf2,_0x441d2f){return function(_0xaf7752){checkContactLowerLimitOriginate(_0x337cf2,_0x441d2f,0x0);logger[_0x74a4('0x8b')](_0x3b2710,util[_0x74a4('0x8c')](_0xaf7752,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x1292b4){return function(_0x338692){if(isNotNull(_0x338692)&&isNotNull(_0x338692[0x0])){if(_0x338692[0x0][_0x74a4('0x91')]>0x0){_0x1292b4[_0x74a4('0x3d')]=_0x74a4('0x92');logger['info']('[getContactDialer2][ReScheduled]'+_0x1292b4[_0x74a4('0x3a')],_0x338692[0x0][_0x74a4('0x91')],_0x74a4('0x93'));}else{_0x1292b4[_0x74a4('0x3d')]=_0x74a4('0x94');logger[_0x74a4('0x76')](_0x74a4('0x95')+_0x1292b4[_0x74a4('0x3a')]);}}};}function notSendMessagesQueue(_0x11daf3){if(_0x11daf3[_0x74a4('0x96')]){freeVariablesPredictive(_0x11daf3);if(_0x11daf3['originated']===0x0&&_0x11daf3[_0x74a4('0x4d')]===0x0&&_0x11daf3['waiting']===0x0&&(_0x11daf3[_0x74a4('0x4a')]||0x0)===0x0){_0x11daf3['sendMessageOneNotActive']=![];_0x11daf3[_0x74a4('0x48')]=0x0;_0x11daf3[_0x74a4('0x3d')]=_0x74a4('0x39');loggerSyncQueueSummary['error'](_0x74a4('0x97'),_0x11daf3['name'],'is\x20not\x20active');}else{_0x11daf3[_0x74a4('0x3d')]='IS_DISACTIVED';loggerSyncQueueSummary[_0x74a4('0x8b')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x11daf3[_0x74a4('0x3a')],_0x74a4('0x98'));}emitVoiceQueueSummary(_0x11daf3);}}function notSendMessagesCampaign(_0x2f42ad){if(_0x2f42ad[_0x74a4('0x96')]){if(_0x2f42ad[_0x74a4('0x69')]===0x0){_0x2f42ad[_0x74a4('0x96')]=![];_0x2f42ad['message']='NOT_ACTIVE';loggerSyncQueueSummary[_0x74a4('0x8b')](_0x74a4('0x99'),_0x2f42ad['name'],_0x74a4('0x9a'));}else{_0x2f42ad['message']='IS_DISACTIVED';loggerSyncQueueSummary[_0x74a4('0x8b')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x2f42ad[_0x74a4('0x3a')],'is\x20disactive');}emitCampaignSummary(_0x2f42ad);}}function createObjHistory(_0x1c7972,_0x5477ec,_0x1b9dbd,_0x3d20fb,_0xe4823b){_0x1c7972[_0x74a4('0x3d')]=_0x1b9dbd;var _0x4d6a25=new Action(_0x1c7972,_0x5477ec);var _0x281347=new History(_0x4d6a25);_0x281347[_0x74a4('0x9b')]=_0x3d20fb;_0x281347[_0x74a4('0x9c')]=_0xe4823b;_0x281347[_0x74a4('0x9d')]=_0x4d6a25['starttime'];return _0x281347;}Dialer[_0x74a4('0x19')]['loopClearZombieChannels']=function(){var _0x1f3925=this;setInterval(function(){_0x1f3925[_0x74a4('0x9e')](_0x1f3925[_0x74a4('0x25')],_0x74a4('0x9f'));_0x1f3925[_0x74a4('0x9e')](_0x1f3925['actions'],_0x74a4('0xa0'));},0x32c8);};Dialer[_0x74a4('0x19')][_0x74a4('0x9e')]=function(_0x1566f8,_0x165f59){var _0x337d19=this;for(var _0x2e33be in _0x1566f8){if(typeof _0x1566f8[_0x2e33be]!==_0x74a4('0x8e')){this[_0x74a4('0xa1')][_0x74a4('0x1a')](function(){if(!_[_0x74a4('0xa2')](_0x1566f8[_0x2e33be])){return ami[_0x74a4('0xa3')]({'action':_0x74a4('0xa4'),'channel':_0x1566f8[_0x2e33be][_0x74a4('0xa5')]})[_0x74a4('0xa6')](function(_0x2ed6c0){if(_0x2ed6c0[_0x74a4('0x3d')]===_0x74a4('0xa7')){setTimeout(function(){if(_0x1566f8[_0x2e33be]&&_0x1566f8[_0x2e33be][_0x74a4('0x46')]!==_0x74a4('0x73')){_0x337d19['updateOriginated'](_0x337d19[_0x74a4('0x1e')][_0x1566f8[_0x2e33be][_0x74a4('0xa8')]]);logger[_0x74a4('0x8b')]('[Dialer][checkChannel]',_0x165f59,_0x2e33be,_0x1566f8[_0x2e33be][_0x74a4('0xa8')]);delete _0x1566f8[_0x2e33be];}if(_0x1566f8[_0x2e33be]&&_0x1566f8[_0x2e33be][_0x74a4('0x46')]==='ivr'){_0x337d19['updateOriginated'](_0x337d19[_0x74a4('0x1f')][_0x1566f8[_0x2e33be][_0x74a4('0xa8')]]);logger[_0x74a4('0x8b')](_0x74a4('0xa9'),_0x165f59,_0x2e33be,_0x1566f8[_0x2e33be][_0x74a4('0xa8')]);delete _0x1566f8[_0x2e33be];}},0x2328);}});}});}}};Dialer[_0x74a4('0x19')][_0x74a4('0xaa')]=function(_0x54a11c){return BPromise[_0x74a4('0xab')]()[_0x74a4('0xac')](cmHopper['countReScheduled'](_0x54a11c))[_0x74a4('0xa6')](loggerCatch(_0x74a4('0xad')));};Dialer[_0x74a4('0x19')][_0x74a4('0xae')]=function(_0x334eec){return BPromise[_0x74a4('0xab')]()[_0x74a4('0xac')](cmHopperBlack[_0x74a4('0xae')](_0x334eec))[_0x74a4('0xa6')](loggerCatch('[checkIsBlackList]\x20'));};Dialer[_0x74a4('0x19')]['checkIsBlackListIvr']=function(_0x5e2410){return BPromise[_0x74a4('0xab')]()[_0x74a4('0xac')](cmHopperBlack['checkIsBlackListIvr'](_0x5e2410))[_0x74a4('0xa6')](loggerCatch(_0x74a4('0xaf')));};Dialer[_0x74a4('0x19')][_0x74a4('0xb0')]=function(_0x21d836){return BPromise[_0x74a4('0xab')]()[_0x74a4('0xac')](cmHopperHistory[_0x74a4('0xb1')](_0x21d836))['catch'](loggerCatch(_0x74a4('0xb2')));};Dialer['prototype'][_0x74a4('0xb3')]=function(_0x397feb){return BPromise[_0x74a4('0xab')]()[_0x74a4('0xac')](cmHopper[_0x74a4('0xb3')](_0x397feb))['catch'](loggerCatch(_0x74a4('0xb4')));};Dialer[_0x74a4('0x19')][_0x74a4('0xb5')]=function(_0x2d0473,_0x2b0352,_0x199684){return BPromise['resolve']()[_0x74a4('0xac')](cmHopper[_0x74a4('0xb5')](_0x2d0473,_0x2b0352,_0x199684))[_0x74a4('0xa6')](loggerCatch(_0x74a4('0xb6')));};Dialer[_0x74a4('0x19')][_0x74a4('0xb7')]=function(_0x240229,_0x5c0997,_0x5b6b55,_0x1f79f9,_0x28df00){return BPromise[_0x74a4('0xab')]()[_0x74a4('0xac')](cmHopper[_0x74a4('0xb7')](_0x240229,_0x5c0997,_0x5b6b55,_0x1f79f9))[_0x74a4('0xa6')](function(_0x5d11a4){_0x28df00[_0x74a4('0xb8')]-=_0x5b6b55;_0x28df00[_0x74a4('0xb8')]=_0x28df00[_0x74a4('0xb8')]>0x0?_0x28df00[_0x74a4('0xb8')]:0x0;loggerCatch('[getContactDialer]\x20')(_0x5d11a4);});};Dialer[_0x74a4('0x19')][_0x74a4('0xb9')]=function(_0xecc7e8,_0x479996,_0x2ccefb,_0x4d2932){return BPromise['resolve']()[_0x74a4('0xac')](cmHopper['getContactDialerIvr'](_0xecc7e8,_0x479996,_0x2ccefb))['catch'](function(_0x22286d){_0x4d2932['temp']-=_0x479996;_0x4d2932['temp']=_0x4d2932[_0x74a4('0xb8')]>0x0?_0x4d2932['temp']:0x0;loggerCatch('[getContactDialerIvr]\x20')(_0x22286d);});};Dialer[_0x74a4('0x19')][_0x74a4('0xba')]=function(_0xaf0478){return BPromise[_0x74a4('0xab')]()[_0x74a4('0xac')](voiceQueueRt[_0x74a4('0xba')](_0xaf0478))[_0x74a4('0xa6')](loggerCatch(_0x74a4('0xbb')));};Dialer[_0x74a4('0x19')][_0x74a4('0xbc')]=function(_0x43f669){return BPromise[_0x74a4('0xab')]()[_0x74a4('0xac')](cmHopper[_0x74a4('0xbc')](_0x43f669))[_0x74a4('0xa6')](loggerCatch(_0x74a4('0xbd')));};Dialer[_0x74a4('0x19')][_0x74a4('0xbe')]=function(_0x2a522c){return BPromise[_0x74a4('0xab')]()[_0x74a4('0xac')](cmHopperHistory[_0x74a4('0xbe')](_0x2a522c))[_0x74a4('0xa6')](loggerCatch(_0x74a4('0xbf')));};Dialer['prototype'][_0x74a4('0xc0')]=function(_0x263036){if(!_['isUndefined'](_0x263036)&&_0x263036!==null){if(typeof _0x263036[_0x74a4('0x69')]!==_0x74a4('0x8e')){if(_0x263036[_0x74a4('0x69')]>0x0){_0x263036[_0x74a4('0x69')]-=0x1;}else{logger[_0x74a4('0x8b')](_0x74a4('0xc1'));}}}else{logger[_0x74a4('0x8b')]('[updateOriginated]\x20is\x20null\x20or\x20undefined');}};Dialer['prototype']['loggerHandler']=function(_0x1d099f,_0x1b59f7){var _0x40bbbd=this;return function(_0x4c49a4){_0x40bbbd['updateOriginated'](_0x1b59f7);logger['error'](_0x1d099f,util[_0x74a4('0x8c')](_0x4c49a4,{'showHidden':![],'depth':null}));};};Dialer['prototype'][_0x74a4('0xc2')]=function(_0x25e0e7,_0x17148e,_0x261e35){var _0x453705={'state':0x19,'statedesc':_0x74a4('0xc3')};this[_0x74a4('0xc0')](_0x17148e);this[_0x74a4('0xc4')](_['merge'](_0x453705,_[_0x74a4('0xc5')](_0x261e35,[_0x74a4('0xc6'),_0x74a4('0xc7'),'UserId',_0x74a4('0xc8'),_0x74a4('0xc9')])),'[emptyContact][createHistory]',_0x74a4('0xca'));logger['error'](_0x25e0e7);};Dialer[_0x74a4('0x19')][_0x74a4('0xcb')]=function(_0x5b3d31){return _0x5b3d31===_0x74a4('0xcc');};Dialer['prototype'][_0x74a4('0xcd')]=function(_0x1d25ef){return!_[_0x74a4('0x38')](_0x1d25ef)&&_0x1d25ef&&!_[_0x74a4('0x38')](_0x1d25ef['name'])&&!_[_0x74a4('0x38')](_0x1d25ef['active'])&&_0x1d25ef[_0x74a4('0xce')]&&(this[_0x74a4('0x21')][util[_0x74a4('0x71')]('SIP/%s',_0x1d25ef['name'])][_0x74a4('0xa4')]==='reachable'||this[_0x74a4('0x21')][util[_0x74a4('0x71')](_0x74a4('0xcf'),_0x1d25ef[_0x74a4('0x3a')])]['status']===_0x74a4('0xd0'));};Dialer['prototype'][_0x74a4('0xc4')]=function(_0xfe2e31,_0x1fe6c4,_0x39acb7){this[_0x74a4('0xbe')](_0xfe2e31)[_0x74a4('0xa6')](loggerCatch(_0x1fe6c4));this[_0x74a4('0xbc')](_0xfe2e31)[_0x74a4('0xa6')](loggerCatch(_0x39acb7));};Dialer[_0x74a4('0x19')][_0x74a4('0x35')]=function(_0x217182){var _0x438d32=this[_0x74a4('0x25')][_0x217182['uniqueid']];var _0x5c06f6;if(!_[_0x74a4('0xa2')](_0x217182)&&!_[_0x74a4('0xa2')](_0x217182[_0x74a4('0xd1')])&&!_['isNil'](_0x217182[_0x74a4('0xd1')]['amdstatus'])&&_0x217182[_0x74a4('0xd2')]==='xcally-motion-dialer'&&_0x438d32){if(_0x438d32[_0x74a4('0x46')]!==_0x74a4('0x73')&&this[_0x74a4('0x1e')][_0x438d32[_0x74a4('0xa8')]]['dialAMDActive']&&_0x217182['value']===_0x74a4('0xd3')){delete this[_0x74a4('0x25')][_0x217182[_0x74a4('0xd4')]];this['updateOriginated'](this[_0x74a4('0x1e')][_0x438d32[_0x74a4('0xa8')]]);this[_0x74a4('0x1e')][_0x438d32['queue']][_0x74a4('0xd5')]+=0x1;this[_0x74a4('0x1e')][_0x438d32[_0x74a4('0xa8')]][_0x74a4('0x54')]+=0x1;_0x5c06f6=new Hangup(_0x438d32,_0x217182);_0x5c06f6[_0x74a4('0x9b')]=0x12;_0x5c06f6['statedesc']='HangupInAMD';_0x5c06f6['membername']='AMD';ami['emit']('custom:amd',ut[_0x74a4('0xd6')](_0x5c06f6,_0x74a4('0xd7')));this[_0x74a4('0xc4')](_0x5c06f6,'[syncHangupInAMD][createHistory]',_0x74a4('0xd8'));}if(_0x438d32[_0x74a4('0x46')]!==_0x74a4('0x73')&&this[_0x74a4('0x1e')][_0x438d32['queue']][_0x74a4('0xd9')]&&_0x217182[_0x74a4('0xda')]===_0x74a4('0xdb')){var _0x2c0beb=this;return new BPromise(function(_0x350e79,_0x4c4a7f){delete _0x2c0beb[_0x74a4('0x25')][_0x217182[_0x74a4('0xd4')]];_0x2c0beb[_0x74a4('0xc0')](_0x2c0beb[_0x74a4('0x1e')][_0x438d32['queue']]);_0x2c0beb[_0x74a4('0x1e')][_0x438d32[_0x74a4('0xa8')]]['outboundAnswerCallsDay']+=0x1;_0x2c0beb[_0x74a4('0x1e')][_0x438d32[_0x74a4('0xa8')]][_0x74a4('0x54')]+=0x1;var _0x28a67d=_0x2c0beb['voiceQueues'][_0x438d32[_0x74a4('0xa8')]];var _0xf264c=new Hangup(_0x438d32,_0x217182);_0xf264c['state']=0x13;_0xf264c['statedesc']=_0x74a4('0xdc');_0xf264c[_0x74a4('0xdd')]=_0x74a4('0xde');_0xf264c[_0x74a4('0xdf')]+=0x1;_0xf264c[_0x74a4('0xe0')]+=0x1;_0xf264c[_0x74a4('0xd7')]=!![];ami[_0x74a4('0x45')](_0x74a4('0xe1'),ut[_0x74a4('0xd6')](_0xf264c,_0x74a4('0xd7')));_0x2c0beb[_0x74a4('0xbe')](_0xf264c)['catch'](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0xf264c[_0x74a4('0xe2')]+_0xf264c[_0x74a4('0xe3')]+_0xf264c[_0x74a4('0xe4')]+_0xf264c[_0x74a4('0xe5')]+_0xf264c[_0x74a4('0xe6')]+_0xf264c['countabandonedretry']+_0xf264c[_0x74a4('0xdf')]+_0xf264c['countagentrejectretry']>=_0x28a67d[_0x74a4('0xe7')]){_0x2c0beb[_0x74a4('0xe8')](_0xf264c,_0x350e79,_0x4c4a7f,_0x74a4('0xe9'));}else{if(_0xf264c[_0x74a4('0xdf')]>=_0x28a67d['dialMachineMaxRetry']){_0x2c0beb['createStateFinal'](_0xf264c,_0x350e79,_0x4c4a7f,_0x74a4('0xea'));}else{_0x2c0beb['rescheduleContact']({'active':![],'countmachineretry':_0xf264c[_0x74a4('0xdf')],'scheduledat':moment()['add'](_0x28a67d[_0x74a4('0xeb')],_0x74a4('0xec'))[_0x74a4('0x71')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0xf264c[_0x74a4('0xc6')],'ListId':_0xf264c[_0x74a4('0xc7')],'VoiceQueueId':_0xf264c[_0x74a4('0xc8')]||undefined,'CampaignId':_0xf264c['CampaignId']||undefined})['catch'](loggerCatch('[rescheduleContact][Machine]'));_0x350e79({'reschedule':0x1});}}});}if(_0x438d32[_0x74a4('0x46')]==='ivr'&&this['campaigns'][_0x438d32[_0x74a4('0xa8')]][_0x74a4('0xd9')]&&_0x217182['value']==='HANGUP'){delete this[_0x74a4('0x25')][_0x217182[_0x74a4('0xd4')]];this[_0x74a4('0xc0')](this[_0x74a4('0x1f')][_0x438d32['queue']]);_0x5c06f6=new Hangup(_0x438d32,_0x217182);_0x5c06f6[_0x74a4('0x9b')]=0x12;_0x5c06f6[_0x74a4('0x9c')]=_0x74a4('0xed');_0x5c06f6[_0x74a4('0xdd')]=_0x74a4('0xde');ami['emit']('custom:amd',ut[_0x74a4('0xd6')](_0x5c06f6,_0x74a4('0xd7')));this['saveInDb'](_0x5c06f6,_0x74a4('0xee'),'[syncHangupInAMDIvr]');}if(_0x438d32[_0x74a4('0x46')]===_0x74a4('0x73')&&this['campaigns'][_0x438d32[_0x74a4('0xa8')]]['dialAMDActive']&&_0x217182[_0x74a4('0xda')]===_0x74a4('0xdb')){var _0x2c0beb=this;return new BPromise(function(_0x3dafa0,_0xd96bfd){delete _0x2c0beb[_0x74a4('0x25')][_0x217182[_0x74a4('0xd4')]];_0x2c0beb[_0x74a4('0xc0')](_0x2c0beb['campaigns'][_0x438d32[_0x74a4('0xa8')]]);_0x2c0beb[_0x74a4('0x1f')][_0x438d32['queue']][_0x74a4('0xd5')]+=0x1;_0x2c0beb[_0x74a4('0x1f')][_0x438d32[_0x74a4('0xa8')]][_0x74a4('0x54')]+=0x1;var _0x3d076c=_0x2c0beb['campaigns'][_0x438d32[_0x74a4('0xa8')]];var _0x2a5112=new Hangup(_0x438d32,_0x217182);_0x2a5112[_0x74a4('0x9b')]=0x13;_0x2a5112[_0x74a4('0x9c')]='Machine';_0x2a5112['membername']=_0x74a4('0xde');_0x2a5112['countmachineretry']+=0x1;_0x2a5112[_0x74a4('0xe0')]+=0x1;_0x2a5112[_0x74a4('0xd7')]=!![];ami['emit'](_0x74a4('0xe1'),ut[_0x74a4('0xd6')](_0x2a5112,_0x74a4('0xd7')));_0x2c0beb[_0x74a4('0xbe')](_0x2a5112)[_0x74a4('0xa6')](loggerCatch(_0x74a4('0xef')));if(_0x2a5112[_0x74a4('0xe2')]+_0x2a5112['countcongestionretry']+_0x2a5112['countnoanswerretry']+_0x2a5112['countnosuchnumberretry']+_0x2a5112[_0x74a4('0xe6')]+_0x2a5112[_0x74a4('0xf0')]+_0x2a5112[_0x74a4('0xdf')]+_0x2a5112[_0x74a4('0xf1')]>=_0x3d076c[_0x74a4('0xe7')]){_0x2c0beb[_0x74a4('0xe8')](_0x2a5112,_0x3dafa0,_0xd96bfd,'reason19\x20machine....');}else{if(_0x2a5112[_0x74a4('0xdf')]>=_0x3d076c[_0x74a4('0xf2')]){_0x2c0beb[_0x74a4('0xf3')](_0x2a5112,_0x3dafa0,_0xd96bfd,_0x74a4('0xea'));}else{_0x2c0beb['rescheduleContact']({'active':![],'countmachineretry':_0x2a5112[_0x74a4('0xdf')],'scheduledat':moment()[_0x74a4('0xf4')](_0x3d076c[_0x74a4('0xeb')],_0x74a4('0xec'))[_0x74a4('0x71')](_0x74a4('0xf5')),'ContactId':_0x2a5112[_0x74a4('0xc6')],'ListId':_0x2a5112['ListId'],'VoiceQueueId':_0x2a5112['VoiceQueueId']||undefined,'CampaignId':_0x2a5112['CampaignId']||undefined})[_0x74a4('0xa6')](loggerCatch(_0x74a4('0xf6')));_0x3dafa0({'reschedule':0x1});}}});}}};Dialer[_0x74a4('0x19')][_0x74a4('0x31')]=function(_0x3d52dc){var _0x1f6d5f=this[_0x74a4('0x25')][_0x3d52dc[_0x74a4('0xd4')]];var _0x4a78a3=this;var _0x556331;if(_0x1f6d5f&&_0x1f6d5f[_0x74a4('0x46')]===_0x74a4('0x73')){delete this[_0x74a4('0x25')][_0x3d52dc[_0x74a4('0xd4')]];this['updateOriginated'](this[_0x74a4('0x1f')][_0x1f6d5f[_0x74a4('0xa8')]]);this['campaigns'][_0x1f6d5f['queue']][_0x74a4('0xf7')]+=0x1;_0x556331=new Hangup(_0x1f6d5f,_0x3d52dc);this[_0x74a4('0xbe')](_0x556331)[_0x74a4('0xa6')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x74a4('0xbc')](_0x556331)[_0x74a4('0xa6')](loggerCatch('[syncHangupIvr]'));}if(_0x1f6d5f&&_0x1f6d5f[_0x74a4('0x46')]!==_0x74a4('0x73')&&isNotNull(this[_0x74a4('0x1e')][_0x1f6d5f['queue']][_0x74a4('0xf8')])){delete this[_0x74a4('0x25')][_0x3d52dc[_0x74a4('0xd4')]];this[_0x74a4('0xc0')](this[_0x74a4('0x1e')][_0x1f6d5f[_0x74a4('0xa8')]]);this[_0x74a4('0x1e')][_0x1f6d5f['queue']][_0x74a4('0xd5')]+=0x1;this[_0x74a4('0x1e')][_0x1f6d5f[_0x74a4('0xa8')]][_0x74a4('0x54')]+=0x1;_0x556331=new Hangup(_0x1f6d5f,_0x3d52dc);_0x556331[_0x74a4('0x9b')]=0x10;_0x556331[_0x74a4('0x9c')]=_0x74a4('0xf9');_0x556331['membername']='AGI';this[_0x74a4('0xbe')](_0x556331)['catch'](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x74a4('0xbc')](_0x556331)[_0x74a4('0xa6')](loggerCatch('[syncHangupIvr]'));}if(_0x1f6d5f&&_0x1f6d5f['type']!==_0x74a4('0x73')&&!isNotNull(this[_0x74a4('0x1e')][_0x1f6d5f[_0x74a4('0xa8')]]['dialQueueProject'])){delete this[_0x74a4('0x25')][_0x3d52dc['uniqueid']];this[_0x74a4('0xc0')](this[_0x74a4('0x1e')][_0x1f6d5f['queue']]);this[_0x74a4('0x1e')][_0x1f6d5f[_0x74a4('0xa8')]][_0x74a4('0x5d')]+=0x1;_0x556331=new Hangup(_0x1f6d5f,_0x3d52dc);_0x556331[_0x74a4('0x9b')]=0xc;_0x556331[_0x74a4('0x9c')]=_0x3d52dc[_0x74a4('0xfa')];_0x556331[_0x74a4('0xdd')]=_0x74a4('0xfb');this['createHistory'](_0x556331)['catch'](loggerCatch(_0x74a4('0xfc')));this[_0x74a4('0xbc')](_0x556331)['catch'](loggerCatch(_0x74a4('0xfd')));}};Dialer['prototype']['syncAgentComplete']=function(_0xc798f8){var _0x5c56c8=this[_0x74a4('0x25')][_0xc798f8[_0x74a4('0xd4')]];var _0x4ccd04=this;if(this[_0x74a4('0x1e')][_0xc798f8[_0x74a4('0xa8')]]){if(_0x5c56c8&&_0x5c56c8[_0x74a4('0x46')]!=='ivr'){delete this[_0x74a4('0x25')][_0xc798f8[_0x74a4('0xd4')]];this[_0x74a4('0x1e')][_0xc798f8[_0x74a4('0xa8')]][_0x74a4('0xd5')]+=0x1;var _0x56e59d=new AgentComplete(_0x5c56c8,_0xc798f8);if(_0xc798f8[_0x74a4('0xfe')]===_0x74a4('0xff')){_0x56e59d[_0x74a4('0x100')]=this[_0x74a4('0x1e')][_0xc798f8[_0x74a4('0xa8')]]['dialQueueProject2']&&this[_0x74a4('0x1e')][_0xc798f8[_0x74a4('0xa8')]][_0x74a4('0x101')]?moment()[_0x74a4('0x71')](_0x74a4('0xf5')):undefined;}this[_0x74a4('0xbe')](_0x56e59d)[_0x74a4('0xa6')](loggerCatch(_0x74a4('0x102')));this[_0x74a4('0xbc')](_0x56e59d)[_0x74a4('0xa6')](loggerCatch('[syncAgentComplete]'));}}};Dialer[_0x74a4('0x19')][_0x74a4('0x2a')]=function(_0x26708e){if(this['voiceQueues'][_0x26708e['queue']]){if(this[_0x74a4('0x25')][_0x26708e[_0x74a4('0xd4')]]&&this[_0x74a4('0x25')][_0x26708e[_0x74a4('0xd4')]]['type']!=='ivr'){this[_0x74a4('0xc0')](this[_0x74a4('0x1e')][_0x26708e[_0x74a4('0xa8')]]);this['uniqueId'][_0x26708e['uniqueid']][_0x74a4('0x103')]=moment()[_0x74a4('0x71')](_0x74a4('0xf5'));}}};Dialer[_0x74a4('0x19')][_0x74a4('0x104')]=function(_0xafbe1c){this['createHistory'](_0xafbe1c)[_0x74a4('0xa6')](loggerCatch(_0x74a4('0x102')));this['moveContactManagedDialer'](_0xafbe1c)[_0x74a4('0xa6')](loggerCatch(_0x74a4('0x105')));};Dialer['prototype'][_0x74a4('0x2b')]=function(_0x5a84bb){var _0xc9468f=this[_0x74a4('0x25')][_0x5a84bb['uniqueid']];var _0x43310d=this;if(this[_0x74a4('0x1e')][_0x5a84bb[_0x74a4('0xa8')]]){if(_0xc9468f&&_0xc9468f[_0x74a4('0x46')]!==_0x74a4('0x73')){delete this[_0x74a4('0x25')][_0x5a84bb[_0x74a4('0xd4')]];this['updateOriginated'](this[_0x74a4('0x1e')][_0x5a84bb[_0x74a4('0xa8')]]);_0xc9468f[_0x74a4('0x106')]=moment()[_0x74a4('0x71')](_0x74a4('0xf5'));var _0x3b5c31=new QueueCallerAbandon(_0xc9468f,_0x5a84bb);if(getSeconds(_0xc9468f[_0x74a4('0x106')],_0xc9468f[_0x74a4('0x107')])>=_0xc9468f[_0x74a4('0x108')]){this[_0x74a4('0x1e')][_0x5a84bb[_0x74a4('0xa8')]]['predictiveIntervalDroppedCallsTimeout']+=0x1;this[_0x74a4('0x1e')][_0x5a84bb[_0x74a4('0xa8')]]['outboundDropCallsDayTimeout']+=0x1;this[_0x74a4('0x1e')][_0x5a84bb[_0x74a4('0xa8')]][_0x74a4('0x64')]+=0x1;_0x3b5c31['state']=0xa;_0x3b5c31[_0x74a4('0x9c')]=_0x74a4('0x109');_0x3b5c31[_0x74a4('0x10a')]='TIMEOUT';_0x3b5c31[_0x74a4('0x100')]=this['voiceQueues'][_0x5a84bb[_0x74a4('0xa8')]]['dialQueueProject2']?moment()[_0x74a4('0x71')](_0x74a4('0xf5')):undefined;_0x3b5c31[_0x74a4('0xe6')]+=0x1;_0x3b5c31[_0x74a4('0xe0')]+=0x1;if(_0x3b5c31[_0x74a4('0xe6')]>=this[_0x74a4('0x1e')][_0x5a84bb['queue']][_0x74a4('0x10b')]){this[_0x74a4('0x104')](_0x3b5c31);}else{this[_0x74a4('0xb3')]({'active':![],'countdropretry':_0x3b5c31[_0x74a4('0xe6')],'scheduledat':moment()[_0x74a4('0xf4')](this[_0x74a4('0x1e')][_0x5a84bb[_0x74a4('0xa8')]][_0x74a4('0x10c')],_0x74a4('0xec'))['format'](_0x74a4('0xf5')),'ContactId':_0xc9468f['ContactId'],'ListId':_0xc9468f[_0x74a4('0xc7')],'VoiceQueueId':_0xc9468f['VoiceQueueId']||undefined,'CampaignId':_0xc9468f['CampaignId']||undefined})['catch'](loggerCatch(_0x74a4('0x10d')));var _0x417843=new History(_0x3b5c31);_0x417843[_0x74a4('0x9b')]=0xa;_0x417843[_0x74a4('0x9c')]=_0x74a4('0x109');_0x417843[_0x74a4('0x10e')]=moment()[_0x74a4('0x71')](_0x74a4('0xf5'));_0x417843[_0x74a4('0x9d')]=_0x417843['starttime'];_0x417843[_0x74a4('0x10f')]=_0x3b5c31[_0x74a4('0x10f')];_0x417843[_0x74a4('0x110')]=_0x3b5c31[_0x74a4('0x110')];this['createHistory'](_0x417843)['catch'](loggerCatch(_0x74a4('0x111')));}}else{this[_0x74a4('0x1e')][_0x5a84bb['queue']][_0x74a4('0x61')]+=0x1;this[_0x74a4('0x1e')][_0x5a84bb[_0x74a4('0xa8')]][_0x74a4('0x58')]+=0x1;_0x3b5c31[_0x74a4('0x9b')]=0xb;_0x3b5c31[_0x74a4('0x9c')]=_0x74a4('0x112');_0x3b5c31[_0x74a4('0x10a')]=_0x74a4('0x113');_0x3b5c31['countabandonedretry']+=0x1;_0x3b5c31[_0x74a4('0xe0')]+=0x1;if(_0x3b5c31[_0x74a4('0xf0')]>=this[_0x74a4('0x1e')][_0x5a84bb[_0x74a4('0xa8')]]['dialAbandonedMaxRetry']){this[_0x74a4('0x104')](_0x3b5c31);}else{this[_0x74a4('0xb3')]({'active':![],'countabandonedretry':_0x3b5c31[_0x74a4('0xf0')],'scheduledat':moment()[_0x74a4('0xf4')](this[_0x74a4('0x1e')][_0x5a84bb[_0x74a4('0xa8')]]['dialAbandonedRetryFrequency'],'minutes')[_0x74a4('0x71')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0xc9468f[_0x74a4('0xc6')],'ListId':_0xc9468f['ListId'],'VoiceQueueId':_0xc9468f['VoiceQueueId']||undefined,'CampaignId':_0xc9468f[_0x74a4('0xc9')]||undefined})[_0x74a4('0xa6')](loggerCatch('[rescheduleContact][Abandoned]'));var _0x417843=new History(_0x3b5c31);_0x417843[_0x74a4('0x9b')]=0xb;_0x417843[_0x74a4('0x9c')]=_0x74a4('0x112');_0x417843[_0x74a4('0x10e')]=moment()[_0x74a4('0x71')](_0x74a4('0xf5'));_0x417843[_0x74a4('0x9d')]=_0x417843[_0x74a4('0x10e')];_0x417843[_0x74a4('0x10f')]=_0x3b5c31['calleridname'];_0x417843['calleridnum']=_0x3b5c31[_0x74a4('0x110')];this[_0x74a4('0xbe')](_0x417843)['catch'](loggerCatch('[syncAgentComplete][createHistory][11]'));}}}}};Dialer[_0x74a4('0x19')][_0x74a4('0x33')]=function(_0x7077ba){if(this[_0x74a4('0x114')][_0x7077ba[_0x74a4('0xd4')]]){this[_0x74a4('0x114')][_0x7077ba[_0x74a4('0xd4')]][_0x74a4('0xa5')]=_0x7077ba['channel'];}if(this['uniqueId'][_0x7077ba[_0x74a4('0xd4')]]){this[_0x74a4('0x25')][_0x7077ba[_0x74a4('0xd4')]][_0x74a4('0xa5')]=_0x7077ba[_0x74a4('0xa5')];}};Dialer[_0x74a4('0x19')][_0x74a4('0x115')]=function(_0x3549a0){if(strategy[this[_0x74a4('0x1e')][this['actions'][_0x3549a0[_0x74a4('0x116')]][_0x74a4('0xa8')]][_0x74a4('0x117')]]===_0x74a4('0x18')){if(this[_0x74a4('0x114')][_0x3549a0[_0x74a4('0x116')]]&&_[_0x74a4('0xa2')](this[_0x74a4('0x114')][_0x3549a0[_0x74a4('0x116')]][_0x74a4('0x118')])&&_0x3549a0[_0x74a4('0xa4')]==='1'&&_0x3549a0[_0x74a4('0x119')]==='0'){if(this['agents'][_0x3549a0[_0x74a4('0x11a')]]){if(!this['agents'][_0x3549a0[_0x74a4('0x11a')]][_0x74a4('0x118')]){this[_0x74a4('0x20')][_0x3549a0['stateinterface']]['locked']=!![];this[_0x74a4('0x114')][_0x3549a0[_0x74a4('0x116')]][_0x74a4('0x118')]=!![];this[_0x74a4('0x114')][_0x3549a0['actionid']][_0x74a4('0x11a')]=_0x3549a0[_0x74a4('0x11a')];}}}}else if((strategy[this[_0x74a4('0x1e')][this[_0x74a4('0x114')][_0x3549a0[_0x74a4('0x116')]][_0x74a4('0xa8')]][_0x74a4('0x117')]]||_0x74a4('0x17'))===_0x74a4('0x17')){if(this[_0x74a4('0x114')][_0x3549a0['actionid']]){if(this[_0x74a4('0x20')][_0x3549a0['stateinterface']]){this['actions'][_0x3549a0[_0x74a4('0x116')]][_0x74a4('0x11a')]=_0x3549a0[_0x74a4('0x11a')];if(_['isNil'](this[_0x74a4('0x28')][this[_0x74a4('0x114')][_0x3549a0[_0x74a4('0x116')]][_0x74a4('0xa8')]])){this[_0x74a4('0x28')][this[_0x74a4('0x114')][_0x3549a0[_0x74a4('0x116')]][_0x74a4('0xa8')]]=[];}this[_0x74a4('0x28')][this[_0x74a4('0x114')][_0x3549a0[_0x74a4('0x116')]][_0x74a4('0xa8')]][_0x74a4('0x11b')](_[_0x74a4('0x11c')](_['pick'](this['actions'][_0x3549a0['actionid']],['idHopper',_0x74a4('0x11a')]),{'status':_0x3549a0['status'],'paused':_0x3549a0[_0x74a4('0x119')]}));}}}};function unlockQueueStatus(_0x581fb7,_0x33a124){setTimeout(function(){if(_['isUndefined'](_0x581fb7[_0x74a4('0x11d')])){loggerBooked['error'](_0x74a4('0x11e'),_0x33a124);}_0x581fb7['queueStatusComplete']=!![];loggerBooked[_0x74a4('0x76')](_0x74a4('0x11f'),_0x33a124,JSON['stringify'](_[_0x74a4('0xc5')](_0x581fb7,[_0x74a4('0x3a'),_0x74a4('0x11d')])));},0x1f3);}Dialer[_0x74a4('0x19')]['syncQueueStatusComplete']=function(_0x38cb43){var _0x5830fd=this;var _0x1c7f0d=_0x5830fd[_0x74a4('0x1e')][_0x5830fd[_0x74a4('0x114')][_0x38cb43[_0x74a4('0x116')]][_0x74a4('0xa8')]];if(strategy[this[_0x74a4('0x1e')][this['actions'][_0x38cb43[_0x74a4('0x116')]][_0x74a4('0xa8')]][_0x74a4('0x117')]]===_0x74a4('0x18')){if(this[_0x74a4('0x114')][_0x38cb43[_0x74a4('0x116')]]&&this[_0x74a4('0x114')][_0x38cb43[_0x74a4('0x116')]][_0x74a4('0x11a')]){this[_0x74a4('0x1d')][_0x74a4('0x120')](this[_0x74a4('0x114')][_0x38cb43[_0x74a4('0x116')]][_0x74a4('0x121')],this[_0x74a4('0x114')][_0x38cb43[_0x74a4('0x116')]][_0x74a4('0x11a')])[_0x74a4('0xa6')](function(_0x33eec8){logger[_0x74a4('0x8b')](_0x74a4('0x122'),util[_0x74a4('0x8c')](_0x33eec8,{'showHidden':![],'depth':null}));})['finally'](function(){_0x5830fd[_0x74a4('0xc0')](_0x5830fd[_0x74a4('0x1e')][_0x5830fd['actions'][_0x38cb43[_0x74a4('0x116')]][_0x74a4('0xa8')]]);_0x5830fd[_0x74a4('0x20')][_0x5830fd[_0x74a4('0x114')][_0x38cb43[_0x74a4('0x116')]][_0x74a4('0x11a')]][_0x74a4('0x118')]=![];delete _0x5830fd[_0x74a4('0x114')][_0x38cb43['actionid']];unlockQueueStatus(_0x1c7f0d);});}else{this[_0x74a4('0xc0')](this[_0x74a4('0x1e')][this[_0x74a4('0x114')][_0x38cb43[_0x74a4('0x116')]][_0x74a4('0xa8')]]);this['rescheduleContact']({'active':![],'ContactId':this[_0x74a4('0x114')][_0x38cb43['actionid']][_0x74a4('0xc6')],'ListId':this[_0x74a4('0x114')][_0x38cb43[_0x74a4('0x116')]][_0x74a4('0xc7')],'VoiceQueueId':this['actions'][_0x38cb43[_0x74a4('0x116')]][_0x74a4('0xc8')]||undefined,'CampaignId':this[_0x74a4('0x114')][_0x38cb43['actionid']][_0x74a4('0xc9')]||undefined})[_0x74a4('0xa6')](loggerCatch(_0x74a4('0x123')));delete this[_0x74a4('0x114')][_0x38cb43['actionid']];unlockQueueStatus(_0x1c7f0d);}}else if((strategy[this[_0x74a4('0x1e')][this[_0x74a4('0x114')][_0x38cb43[_0x74a4('0x116')]][_0x74a4('0xa8')]]['strategy']]||_0x74a4('0x17'))===_0x74a4('0x17')){var _0x249f31;if(this[_0x74a4('0x114')][_0x38cb43['actionid']]&&!_[_0x74a4('0x75')](this[_0x74a4('0x28')][this[_0x74a4('0x114')][_0x38cb43['actionid']][_0x74a4('0xa8')]])){if(this[_0x74a4('0x29')][_0x5830fd[_0x74a4('0x114')][_0x38cb43[_0x74a4('0x116')]][_0x74a4('0xa8')]]){this[_0x74a4('0x29')][_0x5830fd[_0x74a4('0x114')][_0x38cb43['actionid']][_0x74a4('0xa8')]]=this[_0x74a4('0x29')][this[_0x74a4('0x114')][_0x38cb43[_0x74a4('0x116')]]['queue']]?this[_0x74a4('0x29')][this['actions'][_0x38cb43[_0x74a4('0x116')]][_0x74a4('0xa8')]]:this[_0x74a4('0x28')][this[_0x74a4('0x114')][_0x38cb43[_0x74a4('0x116')]]['queue']]?this[_0x74a4('0x28')][this['actions'][_0x38cb43[_0x74a4('0x116')]][_0x74a4('0xa8')]][_0x74a4('0x124')]||0x0:0x0;}this['queueBooked'][this[_0x74a4('0x114')][_0x38cb43['actionid']][_0x74a4('0xa8')]][_0x74a4('0x124')]=this['queueBookedRR'][this[_0x74a4('0x114')][_0x38cb43[_0x74a4('0x116')]][_0x74a4('0xa8')]];for(var _0x5621ec=0x0;_0x5621ec=0x0;})['catch'](myreject(_0x3bd2e5)));}}else{_0x56fc0d[_0x74a4('0x11b')](ami['Action']({'action':'command','command':util['format'](_0x74a4('0x139'),_0x10d393,!_[_0x74a4('0x38')](config['timezones'][_0x32bb44])?_0x32bb44:'')})[_0x74a4('0xac')](function(_0x424d03){return _0x424d03[_0x74a4('0x13b')][_0x74a4('0x13c')](_0x74a4('0x13d'))>=0x0;})[_0x74a4('0xa6')](myreject(_0x3bd2e5)));}BPromise[_0x74a4('0x13e')](_0x56fc0d)[_0x74a4('0xac')](function(_0x1380ba){var _0x191310=_[_0x74a4('0x13f')](_0x1380ba);if(_0x191310){return _0x1141d3(_0x191310);}else{_0xe823d6['message']=_0x175eed?_0x74a4('0x140'):_0x74a4('0x141');return _0x3bd2e5(msgResponse('[ifTime][promiseAll]',_0x74a4('0x132'),'Global:\x20'+_0x175eed+'\x20'+_0x4a2b3e+_0x74a4('0x142')+util['inspect'](_0x10d393,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x32bb44));}})['catch'](function(_0x5c12ac){return _0x3bd2e5(msgResponse(_0x74a4('0x130'),_0x74a4('0x132'),JSON[_0x74a4('0x42')](_0x5c12ac)));});});};Dialer['prototype'][_0x74a4('0x143')]=function(_0x359a0f){var _0xaf1278=this;return function(){switch(_0x359a0f['dialMethod']){case'progressive':freeVariablesPredictive(_0x359a0f);_0xaf1278['handlePower'](_0x359a0f,0x1);break;case _0x74a4('0x144'):freeVariablesPredictive(_0x359a0f);_0xaf1278[_0x74a4('0x145')](_0x359a0f,_0x359a0f[_0x74a4('0x146')]);break;case _0x74a4('0x147'):_0xaf1278['predictive'](_0x359a0f);break;case _0x74a4('0x8'):freeVariablesPredictive(_0x359a0f);_0xaf1278[_0x74a4('0x145')](_0x359a0f,0x1);break;default:freeVariablesPredictive(_0x359a0f);logger[_0x74a4('0x8b')](_0x74a4('0x148'),_0x359a0f['name'],_0x74a4('0x149'));}};};Dialer[_0x74a4('0x19')][_0x74a4('0x14a')]=function(_0x12c5d2){var _0x1da8a7=this;return function(){_0x1da8a7[_0x74a4('0x14b')](_0x12c5d2);};};Dialer['prototype'][_0x74a4('0x14c')]=function(_0x12ab4a){var _0x512b2f=this;if(isNotPreview(_0x12ab4a[_0x74a4('0x51')])){if(isVoiceQueueOutbound(_0x12ab4a['type'])&&isActive(_0x12ab4a[_0x74a4('0x14d')])){_0x12ab4a['sendMessageOneNotActive']=!![];BPromise['resolve']()[_0x74a4('0xac')](checkIsLoggedIn(_0x12ab4a,_0x12ab4a['loggedIn']))[_0x74a4('0xac')](checkIsActive(_0x12ab4a,_0x12ab4a['dialActive']))[_0x74a4('0xac')](checkInterval(_0x12ab4a))['then'](_0x512b2f[_0x74a4('0x12c')](_0x12ab4a))[_0x74a4('0xac')](_0x512b2f[_0x74a4('0x12f')](_0x12ab4a[_0x74a4('0x14e')],_0x12ab4a[_0x74a4('0x14f')],_0x12ab4a[_0x74a4('0x3a')],_0x12ab4a))['then'](_0x512b2f[_0x74a4('0x131')](_0x12ab4a[_0x74a4('0x3c')],_0x12ab4a[_0x74a4('0x14f')],_0x12ab4a[_0x74a4('0x3a')],_0x12ab4a))[_0x74a4('0xac')](_0x512b2f[_0x74a4('0x143')](_0x12ab4a))[_0x74a4('0xa6')](loggerCatchQueueSummary(_0x74a4('0x150'),_0x12ab4a));}else{notSendMessagesQueue(_0x12ab4a);}}else{freeVariablesPredictive(_0x12ab4a);}};Dialer[_0x74a4('0x19')][_0x74a4('0x12b')]=function(){var _0x1870fa=this;var _0x18caac;for(var _0x1477cb in this[_0x74a4('0x1f')]){if(typeof this[_0x74a4('0x1f')][_0x1477cb]!==_0x74a4('0x8e')){_0x18caac=this[_0x74a4('0x1f')][_0x1477cb];if(isCampaignIvr(_0x18caac[_0x74a4('0x46')])&&isActive(_0x18caac[_0x74a4('0xce')])){_0x18caac[_0x74a4('0x96')]=!![];BPromise[_0x74a4('0xab')]()[_0x74a4('0xac')](checkIsActive(_0x18caac,_0x18caac[_0x74a4('0xce')]))[_0x74a4('0xac')](checkInterval(_0x18caac))['then'](_0x1870fa[_0x74a4('0x12c')](_0x18caac))['then'](_0x1870fa['checkIfTime'](_0x18caac[_0x74a4('0x14e')],_0x18caac[_0x74a4('0x14f')],_0x18caac[_0x74a4('0x3a')],_0x18caac))['then'](_0x1870fa[_0x74a4('0x131')](_0x18caac[_0x74a4('0x3c')],_0x18caac[_0x74a4('0x14f')],_0x18caac[_0x74a4('0x3a')],_0x18caac))['then'](_0x1870fa[_0x74a4('0x14a')](_0x18caac))['catch'](loggerCatchQueueSummary(_0x74a4('0x151'),_0x18caac));}else{notSendMessagesCampaign(_0x18caac);}}}};function getCallerIdRandom(_0xce9b64,_0x568cf3){var _0x4d912f;var _0x5578ee;var _0x2b4d2b;if(_0x568cf3<=0x0){_0x568cf3=0x1;}_0x4d912f=new RegExp(_0x74a4('0x152')+_0x568cf3+'}$');_0x5578ee=Math[_0x74a4('0x153')](0xa,_0x568cf3-0x1);_0x2b4d2b=Math['pow'](0xa,_0x568cf3)-0x1;return util[_0x74a4('0x71')]('%s',_[_0x74a4('0x154')](_0xce9b64,_0x4d912f,_[_0x74a4('0x155')](_0x5578ee,_0x2b4d2b)));}function extractCalleridName(_0xcfb124){var _0x15f30f=_0xcfb124['match'](/"(.*?)"/);return _0x15f30f?_0x15f30f[0x1]:_0xcfb124;}function extractCalleridNumber(_0x787d20){var _0x28535c=_0x787d20[_0x74a4('0x156')](/<(.*?)>/);return _0x28535c?_0x28535c[0x1]:_0x787d20;}Dialer[_0x74a4('0x19')][_0x74a4('0x157')]=function(_0x1917f5,_0x24a1f6){var _0x4bdcc2=this;var _0x295bb9=uuid['v4']();this[_0x74a4('0x114')][_0x295bb9]=new Action(_0x1917f5,_0x24a1f6,_0x295bb9);return new BPromise(function(_0x1f61cd,_0x4bc074){if(_[_0x74a4('0x38')](_0x1917f5)&&typeof _0x1917f5!=='object'){return _0x4bc074(msgResponse(_0x74a4('0x158'),_0x74a4('0x132'),_0x74a4('0x159')));}if(_[_0x74a4('0x38')](_0x24a1f6[_0x74a4('0x15a')][_0x74a4('0x15b')])||_0x24a1f6['Contact'][_0x74a4('0x15b')]===null){return _0x4bc074(msgResponse('originate','Failure',_0x74a4('0x15c')));}var _0x29b5ce={'XMD-CALLERID':_0x4bdcc2[_0x74a4('0x114')][_0x295bb9]['getCaller'](),'XMD-AGI':_0x1917f5[_0x74a4('0xf8')]?util[_0x74a4('0x71')](_0x74a4('0x15d'),ipAgi,_0x1917f5[_0x74a4('0xf8')]):_0x74a4('0x15e'),'XMD-AGIAFTER':_0x1917f5['dialQueueProject2']?util['format'](_0x74a4('0x15d'),ipAgi,_0x1917f5['dialQueueProject2']):_0x74a4('0x15e'),'XMD-QUEUE':_0x1917f5[_0x74a4('0x46')]===_0x74a4('0x88')?util[_0x74a4('0x71')](_0x74a4('0x15f'),_0x1917f5[_0x74a4('0x3a')],_0x1917f5[_0x74a4('0x160')]||'',_0x1917f5[_0x74a4('0x101')]?'c':'',_0x1917f5['dialQueueTimeout']||0x3):_0x74a4('0x15e'),'XMD-CONTACTID':_0x24a1f6[_0x74a4('0xc6')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x4bdcc2[_0x74a4('0x114')][_0x295bb9]['getCaller'](),'XMD-AMD':_0x1917f5[_0x74a4('0xd9')]?_0x74a4('0x161'):_0x74a4('0x15e'),'XMD-DESTINATION':_0x74a4('0x162')};if(_0x1917f5[_0x74a4('0xd9')]){_0x29b5ce['XMD-AMDINITIALSILENCE']=_0x1917f5['dialAMDInitialSilence']||0x9c4;_0x29b5ce[_0x74a4('0x163')]=_0x1917f5[_0x74a4('0x164')]||0x5dc;_0x29b5ce[_0x74a4('0x165')]=_0x1917f5[_0x74a4('0x166')]||0x320;_0x29b5ce[_0x74a4('0x167')]=_0x1917f5[_0x74a4('0x168')]||0x1388;_0x29b5ce[_0x74a4('0x169')]=_0x1917f5['dialAMDMinWordLength']||0x64;_0x29b5ce[_0x74a4('0x16a')]=_0x1917f5[_0x74a4('0x16b')]||0x32;_0x29b5ce[_0x74a4('0x16c')]=_0x1917f5[_0x74a4('0x16d')]||0x3;_0x29b5ce['XMD-AMDSILENCETHRESHOLD']=_0x1917f5[_0x74a4('0x16e')]||0x100;_0x29b5ce[_0x74a4('0x16f')]=_0x1917f5[_0x74a4('0x170')]||0x1388;}if(_0x1917f5[_0x74a4('0x46')]===_0x74a4('0x88')){_0x29b5ce['XMD-VOICEQUEUEID']=_0x24a1f6['VoiceQueueId'];}else{_0x29b5ce[_0x74a4('0x171')]=_0x24a1f6['CampaignId'];}for(var _0x1674e8 in _0x24a1f6[_0x74a4('0x15a')]){if(typeof _0x24a1f6[_0x74a4('0x15a')][_0x1674e8]!==_0x74a4('0x8e')){if(isNotNull(_0x24a1f6[_0x74a4('0x15a')][_0x1674e8])&&_0x1674e8!=='id'&&_0x1674e8!==_0x74a4('0x172')&&_0x1674e8!==_0x74a4('0x173')&&_0x1674e8!==_0x74a4('0x174')){_0x29b5ce[util[_0x74a4('0x71')]('%s%s',_0x74a4('0x175'),_[_0x74a4('0x176')](_0x1674e8))]=_0x24a1f6['Contact'][_0x1674e8];}}}var _0x164c5b=_0x4bdcc2[_0x74a4('0xcd')](_0x1917f5[_0x74a4('0x6e')])?getCallerId(_0x1917f5[_0x74a4('0x6e')][_0x74a4('0x6f')],_0x1917f5[_0x74a4('0x177')],_0x1917f5[_0x74a4('0x178')]>0x0?getCallerIdRandom(_0x1917f5[_0x74a4('0x179')],_0x1917f5[_0x74a4('0x178')]):_0x1917f5['dialOriginateCallerIdNumber']):getCallerId(_['isNil'](_0x1917f5['TrunkBackup'])?_0x1917f5['Trunk'][_0x74a4('0x6f')]:_0x1917f5[_0x74a4('0x12d')]['callerid'],_0x1917f5[_0x74a4('0x177')],_0x1917f5[_0x74a4('0x178')]>0x0?getCallerIdRandom(_0x1917f5['dialOriginateCallerIdNumber'],_0x1917f5[_0x74a4('0x178')]):_0x1917f5[_0x74a4('0x179')]);if(_0x164c5b){_0x29b5ce[_0x74a4('0x17a')]=_0x4bdcc2[_0x74a4('0x114')][_0x295bb9]['originatecalleridname']=extractCalleridName(_0x164c5b);_0x29b5ce[_0x74a4('0x17b')]=_0x4bdcc2[_0x74a4('0x114')][_0x295bb9][_0x74a4('0x17c')]=extractCalleridNumber(_0x164c5b);}return ami['Action']({'actionid':_0x295bb9,'action':_0x74a4('0x158'),'channel':_0x4bdcc2[_0x74a4('0xcd')](_0x1917f5[_0x74a4('0x6e')])?util[_0x74a4('0x71')](_0x74a4('0x17d'),_0x1917f5['Trunk'][_0x74a4('0x3a')],isNotNull(_0x1917f5[_0x74a4('0x53')])?_0x1917f5[_0x74a4('0x53')][_0x74a4('0x17e')]()||'':'',_0x1917f5[_0x74a4('0x17f')]>0x0?_0x24a1f6['Contact'][_0x74a4('0x15b')][_0x74a4('0x180')](_0x1917f5[_0x74a4('0x17f')]):_0x24a1f6[_0x74a4('0x15a')]['phone']):util[_0x74a4('0x71')]('SIP/%s/%s%s',_[_0x74a4('0xa2')](_0x1917f5[_0x74a4('0x12d')])?_0x1917f5[_0x74a4('0x6e')]['name']:_0x1917f5[_0x74a4('0x12d')][_0x74a4('0x3a')],isNotNull(_0x1917f5[_0x74a4('0x53')])?_0x1917f5['dialPrefix'][_0x74a4('0x17e')]()||'':'',_0x1917f5[_0x74a4('0x17f')]>0x0?_0x24a1f6['Contact']['phone'][_0x74a4('0x180')](_0x1917f5[_0x74a4('0x17f')]):_0x24a1f6[_0x74a4('0x15a')]['phone']),'callerid':_0x164c5b,'Exten':_0x74a4('0x162'),'Context':_0x74a4('0x181'),'Priority':'1','variable':_0x29b5ce,'timeout':(_0x1917f5[_0x74a4('0x52')]||0x1e)*0x3e8,'async':!![],'channelid':_0x295bb9})[_0x74a4('0xac')](function(_0x5c23bd){return _0x1f61cd(_0x5c23bd);})[_0x74a4('0xa6')](function(_0x1727ba){_0x1917f5['outboundOriginateFailureCallsDay']+=0x1;var _0x287e37=new History(_0x4bdcc2[_0x74a4('0x114')][_0x295bb9]);logger[_0x74a4('0x8b')](util[_0x74a4('0x71')](_0x74a4('0x182'),JSON[_0x74a4('0x42')](_0x1727ba)));_0x287e37['state']=0xe;_0x287e37[_0x74a4('0x9c')]=_0x74a4('0x183');_0x287e37[_0x74a4('0x10e')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x287e37[_0x74a4('0x9d')]=_0x287e37[_0x74a4('0x10e')];_0x4bdcc2[_0x74a4('0xbe')](_0x287e37)[_0x74a4('0xa6')](loggerCatch(_0x74a4('0x184')));_0x4bdcc2[_0x74a4('0xbc')](_0x287e37)[_0x74a4('0xa6')](loggerCatch(_0x74a4('0x184')))[_0x74a4('0x1c')](function(){delete _0x4bdcc2[_0x74a4('0x114')][_0x295bb9];return _0x4bc074(msgResponse(_0x74a4('0x158'),'Error','originate\x20action\x20Error'));});});});};Dialer[_0x74a4('0x19')][_0x74a4('0x185')]=function(_0x5b66d9){var _0x5f013c=this[_0x74a4('0x114')][_0x5b66d9['actionid']];if(_0x5f013c){delete this[_0x74a4('0x114')][_0x5b66d9['actionid']];_0x5f013c[_0x74a4('0x107')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x28d6ae=_0x5f013c[_0x74a4('0x46')]===_0x74a4('0x73')?this[_0x74a4('0x1f')][_0x5f013c['queue']]:this['voiceQueues'][_0x5f013c[_0x74a4('0x186')]()];if(!this[_0x74a4('0xcb')](_0x5b66d9[_0x74a4('0x187')])){this[_0x74a4('0xc0')](_0x28d6ae);return this[_0x74a4('0x188')](_0x5f013c,_0x28d6ae,_0x5b66d9)[_0x74a4('0xa6')](loggerCatch(_0x74a4('0x189')));}this[_0x74a4('0x25')][_0x5b66d9['uniqueid']]=_0x5f013c;}};Dialer[_0x74a4('0x19')][_0x74a4('0x18a')]=function(_0x3d0c6c,_0x2cc4f6,_0x472b59){var _0x14092d=new History(_0x2cc4f6);if(_0x14092d['countbusyretry']+_0x14092d[_0x74a4('0xe3')]+_0x14092d[_0x74a4('0xe4')]+_0x14092d[_0x74a4('0xe5')]+_0x14092d[_0x74a4('0xe6')]+_0x14092d[_0x74a4('0xf0')]+_0x14092d[_0x74a4('0xdf')]+_0x14092d[_0x74a4('0xf1')]>=_0x472b59['dialGlobalMaxRetry']-0x1){return!![];}switch(_0x3d0c6c){case 0x3:if(_0x14092d[_0x74a4('0xe4')]>=_0x472b59['dialNoAnswerMaxRetry']-0x1){return!![];}this['rescheduleContact']({'active':![],'countnoanswerretry':_0x14092d[_0x74a4('0xe4')]+=0x1,'scheduledat':moment()[_0x74a4('0xf4')](_0x472b59[_0x74a4('0x18b')],_0x74a4('0xec'))['format'](_0x74a4('0xf5')),'ContactId':_0x14092d[_0x74a4('0xc6')],'ListId':_0x14092d[_0x74a4('0xc7')],'VoiceQueueId':_0x14092d[_0x74a4('0xc8')]||undefined,'CampaignId':_0x14092d['CampaignId']||undefined})[_0x74a4('0xa6')](loggerCatch(_0x74a4('0x18c')));break;case 0x5:if(_0x14092d[_0x74a4('0xe2')]>=_0x472b59[_0x74a4('0x18d')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countbusyretry':_0x14092d[_0x74a4('0xe2')]+=0x1,'scheduledat':moment()['add'](_0x472b59['dialBusyRetryFrequency'],_0x74a4('0xec'))[_0x74a4('0x71')](_0x74a4('0xf5')),'ContactId':_0x14092d[_0x74a4('0xc6')],'ListId':_0x14092d[_0x74a4('0xc7')],'VoiceQueueId':_0x14092d[_0x74a4('0xc8')]||undefined,'CampaignId':_0x14092d[_0x74a4('0xc9')]||undefined})[_0x74a4('0xa6')](loggerCatch(_0x74a4('0x18e')));break;case 0x8:if(_0x14092d[_0x74a4('0xe3')]>=_0x472b59[_0x74a4('0x18f')]-0x1){return!![];}this[_0x74a4('0xb3')]({'active':![],'countcongestionretry':_0x14092d[_0x74a4('0xe3')]+=0x1,'scheduledat':moment()[_0x74a4('0xf4')](_0x472b59['dialCongestionRetryFrequency'],_0x74a4('0xec'))[_0x74a4('0x71')](_0x74a4('0xf5')),'ContactId':_0x14092d[_0x74a4('0xc6')],'ListId':_0x14092d[_0x74a4('0xc7')],'VoiceQueueId':_0x14092d[_0x74a4('0xc8')]||undefined,'CampaignId':_0x14092d[_0x74a4('0xc9')]||undefined})['catch'](loggerCatch(_0x74a4('0x190')));break;case 0x0:if(_0x14092d[_0x74a4('0xe5')]>=_0x472b59[_0x74a4('0x191')]-0x1){return!![];}else{this[_0x74a4('0xb3')]({'active':![],'countnosuchnumberretry':_0x14092d[_0x74a4('0xe5')]+=0x1,'scheduledat':moment()[_0x74a4('0xf4')](_0x472b59[_0x74a4('0x192')],'minutes')[_0x74a4('0x71')](_0x74a4('0xf5')),'ContactId':_0x14092d[_0x74a4('0xc6')],'ListId':_0x14092d[_0x74a4('0xc7')],'VoiceQueueId':_0x14092d[_0x74a4('0xc8')]||undefined,'CampaignId':_0x14092d[_0x74a4('0xc9')]||undefined})['catch'](loggerCatch('[rescheduleContact][NoSuchNumber]'));}break;case 0xa:if(_0x14092d['countdropretry']>=_0x472b59[_0x74a4('0x10b')]-0x1){return!![];}this[_0x74a4('0xb3')]({'active':![],'countdropretry':_0x14092d[_0x74a4('0xe6')]+=0x1,'scheduledat':moment()[_0x74a4('0xf4')](_0x472b59[_0x74a4('0x10c')],'minutes')[_0x74a4('0x71')](_0x74a4('0xf5')),'ContactId':_0x14092d['ContactId'],'ListId':_0x14092d[_0x74a4('0xc7')],'VoiceQueueId':_0x14092d[_0x74a4('0xc8')]||undefined,'CampaignId':_0x14092d[_0x74a4('0xc9')]||undefined})[_0x74a4('0xa6')](loggerCatch(_0x74a4('0x10d')));break;case 0xb:if(_0x14092d[_0x74a4('0xf0')]>=_0x472b59[_0x74a4('0x193')]-0x1){return!![];}this[_0x74a4('0xb3')]({'active':![],'countabandonedretry':_0x14092d[_0x74a4('0xf0')]+=0x1,'scheduledat':moment()[_0x74a4('0xf4')](_0x472b59['dialAbandonedRetryFrequency'],_0x74a4('0xec'))[_0x74a4('0x71')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x14092d['ContactId'],'ListId':_0x14092d['ListId'],'VoiceQueueId':_0x14092d[_0x74a4('0xc8')]||undefined,'CampaignId':_0x14092d[_0x74a4('0xc9')]||undefined})['catch'](loggerCatch(_0x74a4('0x194')));break;case 0x13:if(_0x14092d[_0x74a4('0xdf')]>=_0x472b59[_0x74a4('0xf2')]-0x1){return!![];}this[_0x74a4('0xb3')]({'active':![],'countmachineretry':_0x14092d[_0x74a4('0xdf')]+=0x1,'scheduledat':moment()[_0x74a4('0xf4')](_0x472b59[_0x74a4('0xeb')],_0x74a4('0xec'))[_0x74a4('0x71')](_0x74a4('0xf5')),'ContactId':_0x14092d[_0x74a4('0xc6')],'ListId':_0x14092d[_0x74a4('0xc7')],'VoiceQueueId':_0x14092d['VoiceQueueId']||undefined,'CampaignId':_0x14092d[_0x74a4('0xc9')]||undefined})[_0x74a4('0xa6')](loggerCatch(_0x74a4('0xf6')));break;case 0x14:if(_0x14092d[_0x74a4('0xf1')]>=_0x472b59[_0x74a4('0x195')]-0x1){return!![];}this[_0x74a4('0xb3')]({'active':![],'countagentrejectretry':_0x14092d['countagentrejectretry']+=0x1,'scheduledat':moment()[_0x74a4('0xf4')](_0x472b59[_0x74a4('0x196')],_0x74a4('0xec'))[_0x74a4('0x71')](_0x74a4('0xf5')),'ContactId':_0x14092d[_0x74a4('0xc6')],'ListId':_0x14092d[_0x74a4('0xc7')],'VoiceQueueId':_0x14092d[_0x74a4('0xc8')]||undefined,'CampaignId':_0x14092d[_0x74a4('0xc9')]||undefined})[_0x74a4('0xa6')](loggerCatch('[rescheduleContact][AgentReject]'));break;default:return!![];}};Dialer[_0x74a4('0x19')][_0x74a4('0x188')]=function(_0x3c0133,_0x310da9,_0x1ae0bd){var _0x170c0f=this;var _0x426206=new History(_0x3c0133);return new BPromise(function(_0x36aa6f,_0x46538e){if(_[_0x74a4('0x38')](_0x310da9)&&typeof _0x310da9!==_0x74a4('0x197')){return _0x46538e(msgResponse(_0x74a4('0x198'),_0x74a4('0x132'),_0x74a4('0x199')));}if(_[_0x74a4('0x38')](_0x1ae0bd)&&typeof _0x1ae0bd!==_0x74a4('0x197')){return _0x46538e(msgResponse(_0x74a4('0x198'),_0x74a4('0x132'),_0x74a4('0x19a')));}switch(_0x1ae0bd[_0x74a4('0xfe')]){case'0':_0x310da9[_0x74a4('0x19b')]+=0x1;_0x426206[_0x74a4('0x9b')]=0x0;_0x426206['statedesc']=_0x74a4('0x19c');_0x426206['countnosuchnumberretry']+=0x1;_0x426206['countglobal']+=0x1;ami[_0x74a4('0x45')](_0x74a4('0x19d'),ut[_0x74a4('0xd6')](_0x3c0133,_0x74a4('0x19e')));_0x170c0f[_0x74a4('0xbe')](_0x426206)[_0x74a4('0xa6')](loggerCatch(_0x74a4('0xef')));if(_0x170c0f[_0x74a4('0x18a')](0x0,_0x3c0133,_0x310da9)){if(_0x426206[_0x74a4('0xe5')]>=_0x310da9[_0x74a4('0x191')]){_0x170c0f[_0x74a4('0xf3')](_0x426206,_0x36aa6f,_0x46538e,_0x74a4('0x19f'));}else{_0x170c0f['stateGlobal'](_0x426206,_0x36aa6f,_0x46538e,_0x74a4('0x19f'));}}break;case'3':_0x310da9[_0x74a4('0x5a')]+=0x1;_0x426206[_0x74a4('0x9b')]=0x3;_0x426206[_0x74a4('0x9c')]=_0x74a4('0x1a0');_0x426206[_0x74a4('0xe4')]+=0x1;_0x426206[_0x74a4('0xe0')]+=0x1;ami[_0x74a4('0x45')](_0x74a4('0x1a1'),ut[_0x74a4('0xd6')](_0x3c0133,_0x74a4('0x1a2')));_0x170c0f[_0x74a4('0xbe')](_0x426206)[_0x74a4('0xa6')](loggerCatch(_0x74a4('0x1a3')));if(_0x170c0f[_0x74a4('0x18a')](0x3,_0x3c0133,_0x310da9)){if(_0x426206[_0x74a4('0xe4')]>=_0x310da9['dialNoAnswerMaxRetry']){_0x170c0f[_0x74a4('0xf3')](_0x426206,_0x36aa6f,_0x46538e,_0x74a4('0x1a4'));}else{_0x170c0f[_0x74a4('0xe8')](_0x426206,_0x36aa6f,_0x46538e,'reason\x203\x20ringing\x20no\x20answer');}}break;case'5':_0x310da9[_0x74a4('0x56')]+=0x1;_0x426206[_0x74a4('0x9b')]=0x5;_0x426206[_0x74a4('0x9c')]=_0x74a4('0x1a5');_0x426206['countbusyretry']+=0x1;_0x426206[_0x74a4('0xe0')]+=0x1;ami[_0x74a4('0x45')](_0x74a4('0x1a6'),ut[_0x74a4('0xd6')](_0x3c0133,'busy'));_0x170c0f['createHistory'](_0x426206)[_0x74a4('0xa6')](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x170c0f['checkRetriveMax'](0x5,_0x3c0133,_0x310da9)){if(_0x426206[_0x74a4('0xe2')]>=_0x310da9[_0x74a4('0x18d')]){_0x170c0f['createStateFinal'](_0x426206,_0x36aa6f,_0x46538e,_0x74a4('0x1a7'));}else{_0x170c0f[_0x74a4('0xe8')](_0x426206,_0x36aa6f,_0x46538e,_0x74a4('0x1a7'));}}break;case'8':_0x310da9[_0x74a4('0x1a8')]+=0x1;_0x426206[_0x74a4('0x9b')]=0x8;_0x426206['statedesc']=_0x74a4('0x1a9');_0x426206[_0x74a4('0xe3')]+=0x1;_0x426206[_0x74a4('0xe0')]+=0x1;ami[_0x74a4('0x45')](_0x74a4('0x1aa'),ut[_0x74a4('0xd6')](_0x3c0133,'congestion'));_0x170c0f[_0x74a4('0xbe')](_0x426206)[_0x74a4('0xa6')](loggerCatch('[syncAgentComplete][createHistory][8]'));if(_0x170c0f[_0x74a4('0x18a')](0x8,_0x3c0133,_0x310da9)){if(_0x426206[_0x74a4('0xe3')]>=_0x310da9[_0x74a4('0x18f')]){_0x170c0f[_0x74a4('0xf3')](_0x426206,_0x36aa6f,_0x46538e,_0x74a4('0x1ab'));}else{_0x170c0f[_0x74a4('0xe8')](_0x426206,_0x36aa6f,_0x46538e,'reason\x208\x20congestion');}}break;case'11':_0x310da9['outboundAbandonedCallsDay']+=0x1;_0x426206[_0x74a4('0x9b')]=0xb;_0x426206[_0x74a4('0x9c')]=_0x74a4('0x112');_0x426206[_0x74a4('0xf0')]+=0x1;_0x426206[_0x74a4('0xe0')]+=0x1;_0x170c0f[_0x74a4('0xbe')](_0x426206)[_0x74a4('0xa6')](loggerCatch(_0x74a4('0x1ac')));if(_0x170c0f['checkRetriveMax'](0xb,_0x3c0133,_0x310da9)){if(_0x426206[_0x74a4('0xf0')]>=_0x310da9[_0x74a4('0x193')]){_0x170c0f[_0x74a4('0xf3')](_0x426206,_0x36aa6f,_0x46538e,_0x74a4('0x1ad'));}else{_0x170c0f[_0x74a4('0xe8')](_0x426206,_0x36aa6f,_0x46538e,'reason\x2011\x20abandoned');}}break;case'20':_0x310da9[_0x74a4('0x1ae')]+=0x1;_0x426206[_0x74a4('0x9b')]=0x14;_0x426206[_0x74a4('0x9c')]=_0x74a4('0x1af');_0x426206[_0x74a4('0xf1')]+=0x1;_0x426206[_0x74a4('0xe0')]+=0x1;ami[_0x74a4('0x45')](_0x74a4('0x1b0'),ut[_0x74a4('0xd6')](_0x3c0133,_0x74a4('0x1b1')));_0x170c0f[_0x74a4('0xbe')](_0x426206)[_0x74a4('0xa6')](loggerCatch(_0x74a4('0x1b2')));if(_0x170c0f[_0x74a4('0x18a')](0x14,_0x3c0133,_0x310da9)){if(_0x426206['countagentrejectretry']>=_0x310da9[_0x74a4('0x195')]){_0x170c0f['createStateFinal'](_0x426206,_0x36aa6f,_0x46538e,_0x74a4('0x1b3'));}else{_0x170c0f[_0x74a4('0xe8')](_0x426206,_0x36aa6f,_0x46538e,'reason\x2020\x20agentreject');}}break;default:_0x310da9[_0x74a4('0x5d')]+=0x1;_0x426206[_0x74a4('0x9b')]=0xc;_0x426206[_0x74a4('0x9c')]=_0x1ae0bd[_0x74a4('0xfe')];_0x170c0f['createHistory'](_0x426206)['catch'](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x170c0f['checkRetriveMax'](_0x1ae0bd[_0x74a4('0xfe')],_0x3c0133,_0x310da9)){if(_0x426206[_0x74a4('0xe2')]+_0x426206['countcongestionretry']+_0x426206[_0x74a4('0xe4')]+_0x426206[_0x74a4('0xe5')]+_0x426206['countdropretry']+_0x426206[_0x74a4('0xf0')]+_0x426206[_0x74a4('0xdf')]+_0x426206[_0x74a4('0xf1')]>=_0x310da9[_0x74a4('0xe7')]){_0x170c0f[_0x74a4('0xe8')](_0x426206,_0x36aa6f,_0x46538e,_0x1ae0bd[_0x74a4('0xfe')]);}else{_0x170c0f[_0x74a4('0xf3')](_0x426206,_0x36aa6f,_0x46538e,_0x1ae0bd[_0x74a4('0xfe')]);}}}});};Dialer[_0x74a4('0x19')][_0x74a4('0xe8')]=function(_0xd02d34,_0x3b336f,_0x2a6e35,_0x54149d){var _0x195116=new Final(_0xd02d34);_0x195116['state']=0xf;_0x195116[_0x74a4('0x9c')]=_0x74a4('0x1b4');this[_0x74a4('0xf3')](_0x195116,_0x3b336f,_0x2a6e35,_0x54149d);};Dialer[_0x74a4('0x19')]['createStateFinal']=function(_0x53ac0d,_0x242e50,_0x3fbe75,_0x127477){this[_0x74a4('0xbc')](_0x53ac0d)[_0x74a4('0xac')](function(){return _0x242e50(msgResponse(_0x74a4('0x198'),'Success',_0x127477));})[_0x74a4('0xa6')](function(){return _0x3fbe75(msgResponse('[moveContactManagedDialer][0]','Failure','contact\x20not\x20moved'));});};Dialer[_0x74a4('0x19')][_0x74a4('0x147')]=function(_0x249da0){var _0x1b7c31=_0x249da0[_0x74a4('0x1b5')]/0x64;var _0x3395c8=_0x249da0['outboundDropCallsDayTimeout']/(_0x249da0['outboundDropCallsDayTimeout']+_0x249da0['outboundAnswerCallsDay']);var _0x143fcf=Math[_0x74a4('0x1b6')](_0x249da0['predictiveIntervalAvailable']*(_0x249da0[_0x74a4('0x1b7')]/0x64));var _0x58fba4=Math[_0x74a4('0x1b6')](_0x249da0[_0x74a4('0x1b8')]*(_0x249da0[_0x74a4('0x1b9')]/0x64));var _0x29f3a0=_0x249da0['available']+_0x249da0[_0x74a4('0x4d')];var _0x299ae0=Math['floor'](_0x249da0['erlangCalls']*_0x249da0[_0x74a4('0x82')]*_0x249da0[_0x74a4('0x65')]*_0x249da0[_0x74a4('0x66')]);if(_[_0x74a4('0x38')](_0x249da0[_0x74a4('0x26')])){if(!_[_0x74a4('0x38')](_0x249da0['startPredictive'])){_0x249da0[_0x74a4('0x6d')]=undefined;loggerPredictive['error'](_0x74a4('0x1ba'),_0x74a4('0x1bb'));}if(!_[_0x74a4('0x38')](_0x249da0[_0x74a4('0x87')])){loggerPredictive[_0x74a4('0x8b')]('[startMethodPredictive][StartProgressive]',_0x74a4('0x1bc'));clearInterval(_0x249da0['handlePredictive']);_0x249da0['handlePredictive']=undefined;}_0x249da0[_0x74a4('0x26')]=moment()[_0x74a4('0x71')](_0x74a4('0xf5'));loggerPredictive[_0x74a4('0x76')](_0x249da0[_0x74a4('0x3a')],_0x74a4('0x1bd'),_0x249da0[_0x74a4('0x26')]);this[_0x74a4('0x145')](_0x249da0,0x1);}else if(ifInterval(_0x249da0[_0x74a4('0x1be')],_0x249da0[_0x74a4('0x26')])){this[_0x74a4('0x145')](_0x249da0,0x1);loggerPredictiveCalls[_0x74a4('0x76')](_0x74a4('0x1bf'),_0x249da0['startProgressive'],_0x249da0['name']);_0x249da0[_0x74a4('0x6a')]=0x0;_0x249da0[_0x74a4('0x64')]=0x0;}else if(_0x1b7c31<_0x3395c8&&_0x249da0[_0x74a4('0x1c0')]===_0x74a4('0x1c1')){freeVariablesPredictive(_0x249da0);loggerPredictive[_0x74a4('0x76')](_0x74a4('0x1c2'),'Dropped\x20calls\x20day',_0x3395c8,_0x74a4('0x26'),_0x249da0['name']);}else if(_0x299ae0<_0x249da0[_0x74a4('0x64')]&&_0x249da0[_0x74a4('0x1c0')]===_0x74a4('0x1c1')){freeVariablesPredictive(_0x249da0);loggerPredictive[_0x74a4('0x76')](_0x74a4('0x1c3'),_0x74a4('0x1c4'),_0x299ae0,_0x74a4('0x1c5'),_0x249da0[_0x74a4('0x64')],_0x74a4('0x26'),_0x249da0['name']);}else if(!ifInterval(_0x249da0['dialPredictiveInterval'],_0x249da0[_0x74a4('0x26')])&&_[_0x74a4('0x38')](_0x249da0['startPredictive'])&&!_['isUndefined'](_0x249da0[_0x74a4('0x26')])){_0x249da0[_0x74a4('0x6d')]=moment()[_0x74a4('0x71')](_0x74a4('0xf5'));loggerPredictive['info'](_0x249da0[_0x74a4('0x3a')],_0x74a4('0x1c6'),_0x249da0['startPredictive']);this[_0x74a4('0xb0')](_0x249da0[_0x74a4('0x1be')])[_0x74a4('0xac')](this[_0x74a4('0x1c7')](_0x249da0))['then'](mergeDataErlangB(_0x249da0))[_0x74a4('0xac')](this[_0x74a4('0x1c8')](_0x249da0))[_0x74a4('0xa6')](loggerCatchPredictive(_0x74a4('0x1c9'),_0x249da0));}else if(!ifInterval(_0x249da0[_0x74a4('0x1be')],_0x249da0[_0x74a4('0x6d')])){_0x249da0['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0x249da0[_0x74a4('0x6d')]=moment()['format'](_0x74a4('0xf5'));loggerPredictive[_0x74a4('0x76')](_0x249da0['name'],'recalculate\x20predictive\x20at',_0x249da0[_0x74a4('0x6d')]);clearInterval(_0x249da0['handlePredictive']);_0x249da0[_0x74a4('0x87')]=undefined;this[_0x74a4('0xb0')](_0x249da0[_0x74a4('0x1be')])[_0x74a4('0xac')](this['getDataPredictive'](_0x249da0))[_0x74a4('0xac')](mergeDataErlangB(_0x249da0))[_0x74a4('0xac')](this[_0x74a4('0x1c8')](_0x249da0))[_0x74a4('0xa6')](loggerCatchPredictive(_0x74a4('0x1ca'),_0x249da0));}else if(_0x249da0[_0x74a4('0x1b8')]&&_0x29f3a0<_0x249da0[_0x74a4('0x1b8')]-_0x58fba4){freeVariablesPredictive(_0x249da0);loggerPredictive['info'](_0x249da0['name'],_0x74a4('0x1cb'),_0x29f3a0,_0x74a4('0x1cc'),_0x249da0['predictiveIntervalAvailable'],'-',_0x58fba4,'=',_0x249da0[_0x74a4('0x1b8')]-_0x58fba4,')');}else if(_0x249da0['predictiveIntervalAvailable']&&_0x29f3a0>_0x249da0[_0x74a4('0x1b8')]+_0x143fcf){freeVariablesPredictive(_0x249da0);loggerPredictive[_0x74a4('0x76')](_0x249da0['name'],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x29f3a0,')\x20are\x20more\x20than\x20threshold\x20(',_0x249da0[_0x74a4('0x1b8')],'+',_0x143fcf,'=',_0x249da0[_0x74a4('0x1b8')]+_0x143fcf,')');}};Dialer['prototype']['getDataPredictive']=function(_0x1acfd6){var _0xf3e9ff=this;return function(_0x4d895f){return new BPromise(function(_0x362e7c,_0x179285){_['merge'](_0x1acfd6,_0x4d895f[0x0]);if(checkGetDataPredictive(_0x4d895f[0x0])){var _0x5697f0=_0x1acfd6[_0x74a4('0x1b8')]=_0x1acfd6[_0x74a4('0x4d')]+_0x1acfd6[_0x74a4('0x48')];var _0xb7e4e0=_0x1acfd6[_0x74a4('0x1be')]*0x3c;var _0x54e437=_0x4d895f[0x0][_0x74a4('0x60')]+_0x4d895f[0x0][_0x74a4('0x5f')];var _0x195b55=(_0x4d895f[0x0]['predictiveIntervalAnsweredCalls']+_0x4d895f[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x4d895f[0x0][_0x74a4('0x61')])/_0x4d895f[0x0]['predictiveIntervalTotalCalls'];_0x1acfd6[_0x74a4('0x65')]=_0x195b55>0x0?_0x195b55:0x1;switch(_0x1acfd6[_0x74a4('0x1c0')]){case'dropRate':var _0x3e6c5d=_0x1acfd6[_0x74a4('0x1b5')]/0x64;return _0xf3e9ff[_0x74a4('0x1cd')](_0x5697f0,_0xb7e4e0,_0x54e437,_0x195b55,_0x3e6c5d)['then'](function(_0x27ff58){return _0x362e7c(_0x27ff58);});case _0x74a4('0x1ce'):var _0x204371=_0x1acfd6['dialPredictiveOptimizationPercentage']/0x64;return _0xf3e9ff[_0x74a4('0x1cf')](_0x5697f0,_0xb7e4e0,_0x54e437,_0x195b55,_0x204371)[_0x74a4('0xac')](function(_0x1a046c){return _0x362e7c(_0x1a046c);});default:return _0x179285(msgResponse(_0x74a4('0x1d0'),'Failure',_0x74a4('0x1d1')));}}else{return _0x179285(msgResponse(_0x74a4('0x1d0'),'Failure',_0x74a4('0x1d2')));}});};};Dialer['prototype']['getDataPredictiveOld']=function(_0x28955e){var _0x3a461d=this;return function(_0x41f1ec){return new BPromise(function(_0x2fa2c1,_0x396e07){_[_0x74a4('0x11c')](_0x28955e,_0x41f1ec[0x0]);if(checkGetDataPredictive(_0x41f1ec[0x0])){loggerPredictive[_0x74a4('0x76')](JSON[_0x74a4('0x42')](_0x41f1ec[0x0]));if(_0x28955e[_0x74a4('0x1c0')]===_0x74a4('0x1c1')){return _0x3a461d[_0x74a4('0xba')](_0x28955e['id'])[_0x74a4('0xac')](function(_0x492b45){var _0x9d08c9=_0x28955e[_0x74a4('0x49')]-_0x492b45[0x0]['outboundQueuePauses'];var _0x168824=_0x28955e[_0x74a4('0x1be')]*0x3c;var _0x45583a=_0x41f1ec[0x0]['predictiveIntervalAvgTalktime']+_0x41f1ec[0x0][_0x74a4('0x5f')];var _0x43a1c5=(_0x41f1ec[0x0][_0x74a4('0x5e')]+_0x41f1ec[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x41f1ec[0x0][_0x74a4('0x61')])/_0x41f1ec[0x0]['predictiveIntervalTotalCalls'];var _0x34e25b=_0x28955e[_0x74a4('0x1b5')]/0x64;_0x28955e[_0x74a4('0x67')]=_0x492b45[0x0]['outboundQueuePauses']||0x0;_0x28955e[_0x74a4('0x65')]=_0x43a1c5>0x0?_0x43a1c5:0x1;return _0x3a461d['abandonmentRate'](_0x9d08c9,_0x168824,_0x45583a,_0x43a1c5,_0x34e25b);})[_0x74a4('0xac')](function(_0x4175da){return _0x2fa2c1(_0x4175da);})[_0x74a4('0xa6')](function(_0x3f2d3c){return _0x396e07(msgResponse(_0x74a4('0x1d3'),'Failure',JSON[_0x74a4('0x42')](_0x3f2d3c)));});}if(_0x28955e[_0x74a4('0x1c0')]===_0x74a4('0x1ce')){return _0x3a461d[_0x74a4('0xba')](_0x28955e['id'])[_0x74a4('0xac')](function(_0x21664c){var _0x3b7418=_0x28955e['loggedIn']-_0x21664c[0x0][_0x74a4('0x1d4')];var _0x2d86d4=_0x28955e['dialPredictiveInterval']*0x3c;var _0x385d46=_0x41f1ec[0x0]['predictiveIntervalAvgTalktime']+_0x41f1ec[0x0][_0x74a4('0x5f')];var _0x109911=(_0x41f1ec[0x0]['predictiveIntervalAnsweredCalls']+_0x41f1ec[0x0][_0x74a4('0x62')]+_0x41f1ec[0x0][_0x74a4('0x61')])/_0x41f1ec[0x0][_0x74a4('0x68')];var _0xf9603d=_0x28955e[_0x74a4('0x1b5')]/0x64;_0x28955e[_0x74a4('0x67')]=_0x21664c[0x0][_0x74a4('0x1d4')]||0x0;_0x28955e[_0x74a4('0x65')]=_0x109911>0x0?_0x109911:0x1;return _0x3a461d[_0x74a4('0x1cf')](_0x3b7418,_0x2d86d4,_0x385d46,_0x109911,_0xf9603d);})[_0x74a4('0xac')](function(_0x5f52fa){return _0x2fa2c1(_0x5f52fa);})[_0x74a4('0xa6')](function(_0x49cd1b){return _0x396e07(msgResponse(_0x74a4('0x1d3'),'Failure',JSON['stringify'](_0x49cd1b)));});}}else{return _0x396e07(msgResponse('[getDataPredictive]',_0x74a4('0x132'),'check\x20failure'));}});};};Dialer[_0x74a4('0x19')][_0x74a4('0x1c8')]=function(_0x463c7e){var _0xda86b4=this;return function(){var _0x4d5a58=0x0;var _0x58202a=Math[_0x74a4('0x1d5')](_0x463c7e['erlangCallToSecond']*0x3e8);if(_0x58202a>0x0){_0x58202a=_0x58202a<0x64?0x64:_0x58202a;loggerPredictive[_0x74a4('0x76')](_0x463c7e[_0x74a4('0x3a')],_0x74a4('0x1d6'),_0x58202a,_0x74a4('0x43'));_0x463c7e['handlePredictive']=setInterval(function(){_0xda86b4[_0x74a4('0x87')](_0x463c7e);loggerPredictiveCalls[_0x74a4('0x76')](_0x74a4('0x1d7'),_0x4d5a58+=0x1);},_0x58202a);}else{loggerPredictive[_0x74a4('0x76')](_0x463c7e[_0x74a4('0x3a')],_0x74a4('0x1d8'));}};};Dialer[_0x74a4('0x19')][_0x74a4('0x1d9')]=function(_0x3b7bb7,_0x3c1b9e){var _0x25e77d=this;return function(_0x3f3178){if(_[_0x74a4('0x75')](_0x3f3178)){if(_[_0x74a4('0xa2')](_0x3c1b9e['UserId'])||!_0x3c1b9e[_0x74a4('0x1da')]){if(_0x3b7bb7[_0x74a4('0x51')]==='booked'){_0x3b7bb7['queueStatusComplete']=_[_0x74a4('0x38')](_0x3b7bb7[_0x74a4('0x11d')])?!![]:_0x3b7bb7['queueStatusComplete'];var _0x542bc7=uuid['v4']();_0x25e77d[_0x74a4('0x114')][_0x542bc7]=new Action(_0x3b7bb7,_0x3c1b9e,_0x542bc7);loggerBooked[_0x74a4('0x76')]('[booked][checkContactBlack]',_0x542bc7,_0x74a4('0x1db'),JSON[_0x74a4('0x42')](_0x3b7bb7['queueStatusComplete']),_0x74a4('0x1dc'),_0x3b7bb7[_0x74a4('0x3a')]);if(_0x3b7bb7[_0x74a4('0x11d')]){_0x3b7bb7['queueStatusComplete']=![];_0x25e77d[_0x74a4('0x28')][_0x25e77d[_0x74a4('0x114')][_0x542bc7]['queue']]=[];ami['Action']({'actionid':_0x542bc7,'action':_0x74a4('0x1dd'),'queue':_0x3b7bb7[_0x74a4('0x3a')]})[_0x74a4('0xa6')](function(){_0x25e77d[_0x74a4('0xc0')](_0x3b7bb7);_0x25e77d[_0x74a4('0xb3')]({'active':![],'ContactId':_0x25e77d[_0x74a4('0x114')][_0x542bc7][_0x74a4('0xc6')],'ListId':_0x25e77d[_0x74a4('0x114')][_0x542bc7]['ListId'],'VoiceQueueId':_0x25e77d[_0x74a4('0x114')][_0x542bc7][_0x74a4('0xc8')]||undefined,'CampaignId':_0x25e77d['actions'][_0x542bc7][_0x74a4('0xc9')]||undefined})[_0x74a4('0xa6')](loggerCatch(_0x74a4('0x1de')));delete _0x25e77d['actions'][_0x542bc7];});}else{loggerBooked[_0x74a4('0x76')](_0x74a4('0x1df'),JSON['stringify'](_0x3b7bb7[_0x74a4('0x11d')]),_0x74a4('0x1dc'),_0x3b7bb7['name']);_0x25e77d[_0x74a4('0xc0')](_0x3b7bb7);_0x25e77d[_0x74a4('0xb3')]({'active':![],'ContactId':_0x25e77d['actions'][_0x542bc7][_0x74a4('0xc6')],'ListId':_0x25e77d[_0x74a4('0x114')][_0x542bc7][_0x74a4('0xc7')],'VoiceQueueId':_0x25e77d[_0x74a4('0x114')][_0x542bc7][_0x74a4('0xc8')]||undefined,'CampaignId':_0x25e77d[_0x74a4('0x114')][_0x542bc7][_0x74a4('0xc9')]||undefined})[_0x74a4('0xa6')](loggerCatch(_0x74a4('0x1de')));delete _0x25e77d[_0x74a4('0x114')][_0x542bc7];}}else{return _0x25e77d['actionOriginate'](_0x3b7bb7,_0x3c1b9e);}}else{if(getDiff(_0x3c1b9e[_0x74a4('0x1e0')])<_0x3b7bb7[_0x74a4('0x1e1')]*0x3c){if(_0x3c1b9e[_0x74a4('0x1e2')]&&!_0x3c1b9e[_0x74a4('0x1e2')][_0x74a4('0x1e3')]){_0x25e77d[_0x74a4('0x1d')][_0x74a4('0x120')](_0x3c1b9e['id'])['finally'](function(){_0x25e77d[_0x74a4('0xc0')](_0x3b7bb7);});}else{_0x25e77d[_0x74a4('0xb5')]({'active':![]},_0x3c1b9e['id'],0x1)['finally'](function(){_0x25e77d[_0x74a4('0xc0')](_0x3b7bb7);});}}else{_0x3b7bb7['outboundReCallsDay']+=0x1;_0x25e77d['updateOriginated'](_0x3b7bb7);if(_0x3b7bb7[_0x74a4('0x1e4')]){_0x25e77d['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0x3c1b9e[_0x74a4('0xc6')],'ListId':_0x3c1b9e[_0x74a4('0xc7')],'VoiceQueueId':_0x3c1b9e['VoiceQueueId']||undefined,'CampaignId':_0x3c1b9e[_0x74a4('0xc9')]||undefined})[_0x74a4('0xa6')](loggerCatch(_0x74a4('0x1e5')));_0x25e77d[_0x74a4('0xbe')](createObjHistory(_0x3b7bb7,_0x3c1b9e,'RECALLINQUEUE',0x17,_0x74a4('0x1e6')))[_0x74a4('0xa6')](loggerCatch(_0x74a4('0x1e7')));}else{_0x25e77d[_0x74a4('0xc4')](createObjHistory(_0x3b7bb7,_0x3c1b9e,_0x74a4('0x1e8'),0x16,_0x74a4('0x1e9')),_0x74a4('0x1ea'),_0x74a4('0x1eb'));}}}}else{_0x3b7bb7[_0x74a4('0x55')]+=0x1;_0x25e77d[_0x74a4('0xc4')](createObjHistory(_0x3b7bb7,_0x3c1b9e,'BLACKLIST',0xd,_0x74a4('0x1ec')),'[Originate][historyBlacklist]','[Originate][MoveBlacklist]');throw _0x74a4('0x1ed');}};};Dialer[_0x74a4('0x19')][_0x74a4('0x14b')]=function(_0xc6f824){var _0x3bde02=this;var _0x31f092=_0xc6f824['limitCalls']-_0xc6f824[_0x74a4('0x69')]-_0xc6f824[_0x74a4('0xb8')];emitCampaignSummary(_0xc6f824);if(_0x31f092>0x0){if(_0x31f092>this[_0x74a4('0x22')]){_0x31f092=this[_0x74a4('0x22')];}_0xc6f824['temp']+=_0x31f092;this['getContactDialerIvr'](_0xc6f824['id'],_0x31f092,_0xc6f824['dialOrderByScheduledAt'],_0xc6f824)[_0x74a4('0xac')](function(_0x5e6416){_0xc6f824['temp']-=_0x31f092;_0xc6f824[_0x74a4('0xb8')]=_0xc6f824['temp']>0x0?_0xc6f824['temp']:0x0;if(!checkContactEmpty(_0x5e6416)){_0xc6f824[_0x74a4('0x3d')]='AVAILABLE_CONTACTS_FINISHED';logger[_0x74a4('0x76')]('[getContactCampaign2][Empty]'+_0xc6f824[_0x74a4('0x3a')]);}else{_0xc6f824[_0x74a4('0x69')]+=_0x5e6416['length'];_0xc6f824[_0x74a4('0x3d')]=_0x74a4('0x1ee');for(var _0x4e91ca=0x0;_0x4e91ca<_0x5e6416[_0x74a4('0x8d')];_0x4e91ca+=0x1){_0xc6f824[_0x74a4('0x1ef')]+=0x1;if(_[_0x74a4('0xa2')](_0x5e6416[_0x4e91ca])||_[_0x74a4('0xa2')](_0x5e6416[_0x4e91ca][_0x74a4('0x15a')])||_['isNil'](_0x5e6416[_0x4e91ca][_0x74a4('0x15a')][_0x74a4('0x15b')])){_0x3bde02[_0x74a4('0xc2')](_0x74a4('0x1f0'),_0xc6f824,_0x5e6416[_0x4e91ca]);}else{_0x3bde02['checkIsBlackListIvr'](_[_0x74a4('0xc5')](_0x5e6416[_0x4e91ca],[_0x74a4('0xc9'),_0x74a4('0x1f1')]))['then'](_0x3bde02[_0x74a4('0x1d9')](_0xc6f824,_0x5e6416[_0x4e91ca]))[_0x74a4('0xa6')](_0x3bde02[_0x74a4('0x1f2')](_0x74a4('0x1f3'),_0xc6f824));}}}})[_0x74a4('0xa6')](loggerGetContactDialer(_0x74a4('0x1f4'),_0xc6f824,_0x31f092));}};Dialer[_0x74a4('0x19')]['handlePower']=function(_0x153af6,_0x304edc){var _0x498b9e=this;var _0x4e1767=[];var _0x252a5c=_0x304edc>=0x1?_0x304edc:0x1;if(_0x153af6['dialMethod']===_0x74a4('0x8')){_0x252a5c=0x1;}var _0x34b7b6=Math[_0x74a4('0x1d5')](_0x153af6[_0x74a4('0x48')]*_0x252a5c)-_0x153af6['originated']-_0x153af6['temp'];emitVoiceQueueSummary(_0x153af6);if(_0x153af6['dialLimitQueue']>0x0){var _0x2bde95=_0x153af6[_0x74a4('0x1f5')]-_0x153af6['originated']-_0x153af6[_0x74a4('0x4d')]-_0x153af6['temp']-_0x153af6['pTalking'];if(_0x34b7b6>_0x2bde95){_0x34b7b6=_0x2bde95;}}if(_0x34b7b6>0x0){if(_0x153af6['dialMethod']===_0x74a4('0x8')){_0x34b7b6=0x1;}if(_0x34b7b6>this[_0x74a4('0x22')]){_0x34b7b6=this[_0x74a4('0x22')];}_0x153af6['temp']+=_0x34b7b6;for(var _0x4d210a in this[_0x74a4('0x20')]){if(typeof this[_0x74a4('0x20')][_0x4d210a]!==_0x74a4('0x8e')){if(this['agents'][_0x4d210a]['state']===_0x74a4('0x1f6')&&this[_0x74a4('0x20')][_0x4d210a][_0x74a4('0xa4')]===_0x74a4('0x1f7')){_0x4e1767[_0x74a4('0x11b')](this['agents'][_0x4d210a]['id']);}}}this[_0x74a4('0xb7')](_0x153af6['id'],_0x4e1767,_0x34b7b6,_0x153af6[_0x74a4('0x1f8')],_0x153af6)['then'](function(_0x2b72b0){_0x153af6[_0x74a4('0xb8')]-=_0x34b7b6;_0x153af6[_0x74a4('0xb8')]=_0x153af6[_0x74a4('0xb8')]>0x0?_0x153af6[_0x74a4('0xb8')]:0x0;if(!checkContactEmpty(_0x2b72b0)){_0x498b9e['countReScheduled'](_0x153af6)['then'](sendMessageReschedule(_0x153af6))['catch'](loggerCatch('[countReScheduled]\x20'));}else{_0x153af6[_0x74a4('0x69')]+=_0x2b72b0[_0x74a4('0x8d')];_0x153af6[_0x74a4('0x3d')]=_0x153af6['dialMethod']===_0x74a4('0x8')?_0x74a4('0x161'):_0x74a4('0x1ee');for(var _0x42284d=0x0;_0x42284d<_0x2b72b0['length'];_0x42284d+=0x1){if(_['isNil'](_0x2b72b0[_0x42284d])||_[_0x74a4('0xa2')](_0x2b72b0[_0x42284d]['Contact'])||_[_0x74a4('0xa2')](_0x2b72b0[_0x42284d][_0x74a4('0x15a')][_0x74a4('0x15b')])){_0x498b9e[_0x74a4('0xc2')](_0x74a4('0x1f0'),_0x153af6,_0x2b72b0[_0x42284d]);}else{_0x498b9e[_0x74a4('0xae')](_[_0x74a4('0xc5')](_0x2b72b0[_0x42284d],[_0x74a4('0xc8'),'Contact.phone']))[_0x74a4('0xac')](_0x498b9e[_0x74a4('0x1d9')](_0x153af6,_0x2b72b0[_0x42284d]))[_0x74a4('0xa6')](_0x498b9e['loggerHandler']('[actionOriginate]\x20',_0x153af6));}}}})[_0x74a4('0xa6')](loggerGetContactDialer('[getContactDialer2]',_0x153af6,_0x34b7b6));}};Dialer[_0x74a4('0x19')][_0x74a4('0x87')]=function(_0x5ae559){if(_0x5ae559[_0x74a4('0x1f5')]>0x0){var _0x1e094b=_0x5ae559[_0x74a4('0x1f5')]-_0x5ae559[_0x74a4('0x69')]-_0x5ae559[_0x74a4('0x4d')];if(_0x1e094b>0x0){this[_0x74a4('0x1f9')](_0x5ae559);}else{loggerPredictiveCalls[_0x74a4('0x76')](_0x74a4('0x1fa'));}}else{this[_0x74a4('0x1f9')](_0x5ae559);}};Dialer[_0x74a4('0x19')][_0x74a4('0x1f9')]=function(_0x55bb9d){var _0x1ed62f=this;var _0x5a9d43=[];_0x55bb9d[_0x74a4('0x69')]+=0x1;for(var _0x3def6f in this[_0x74a4('0x20')]){if(typeof this['agents'][_0x3def6f]!=='undefined'){if(this[_0x74a4('0x20')][_0x3def6f][_0x74a4('0x9b')]==='not_inuse'&&this['agents'][_0x3def6f][_0x74a4('0xa4')]===_0x74a4('0x1f7')){_0x5a9d43[_0x74a4('0x11b')](this[_0x74a4('0x20')][_0x3def6f]['id']);}}}this[_0x74a4('0xb7')](_0x55bb9d['id'],_0x5a9d43,0x1,_0x55bb9d[_0x74a4('0x1f8')],_0x55bb9d)[_0x74a4('0xac')](function(_0x19ec1f){if(!checkContactEmpty(_0x19ec1f)){checkContactLowerLimitOriginate(_0x55bb9d,0x1,0x0);_0x1ed62f[_0x74a4('0xaa')](_0x55bb9d)['then'](sendMessageReschedule(_0x55bb9d))[_0x74a4('0xa6')](loggerCatch('[countReScheduled]\x20'));}else{_0x55bb9d[_0x74a4('0x3d')]=_0x74a4('0x1ee');if(_['isNil'](_0x19ec1f[0x0])||_[_0x74a4('0xa2')](_0x19ec1f[0x0][_0x74a4('0x15a')])||_[_0x74a4('0xa2')](_0x19ec1f[0x0]['Contact'][_0x74a4('0x15b')])){_0x1ed62f[_0x74a4('0xc2')](_0x74a4('0x1f0'),_0x55bb9d,_0x19ec1f[0x0]);}else{_0x1ed62f['checkIsBlackList'](_[_0x74a4('0xc5')](_0x19ec1f[0x0],[_0x74a4('0xc8'),'Contact.phone']))[_0x74a4('0xac')](_0x1ed62f['checkContactBlack'](_0x55bb9d,_0x19ec1f[0x0]))[_0x74a4('0xa6')](_0x1ed62f['loggerHandler'](_0x74a4('0x1fb'),_0x55bb9d));}}})[_0x74a4('0xa6')](loggerGetContactDialer('[getContactDialerPredictive]',_0x55bb9d,0x1));emitVoiceQueueSummary(_0x55bb9d);};Dialer[_0x74a4('0x19')][_0x74a4('0x1cd')]=function(_0x103ee3,_0x476189,_0x457f22,_0x5b6484,_0x1e756f,_0x5cb93d){loggerPredictive['info']('--------\x20Drop\x20Rate\x20--------');loggerPredictive[_0x74a4('0x76')]('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',_0x103ee3);loggerPredictive[_0x74a4('0x76')](_0x74a4('0x1fc'),_0x476189);loggerPredictive[_0x74a4('0x76')](_0x74a4('0x1fd'),_0x457f22);loggerPredictive['info'](_0x74a4('0x1fe'),_0x5b6484);loggerPredictive['info'](_0x74a4('0x1ff'),_0x1e756f);loggerPredictive[_0x74a4('0x76')](_0x74a4('0x84'));return new BPromise(function(_0x915349,_0x5730a6){if(_0x103ee3<=0x0||isNaN(_0x103ee3)){return _0x5730a6(msgResponse(_0x74a4('0x200'),_0x74a4('0x201'),'m\x20=\x20'+_0x103ee3));}if(_0x457f22<=0x0||isNaN(_0x457f22)){return _0x5730a6(msgResponse('[abandonmentRate]',_0x74a4('0x201'),'Ts\x20=\x20'+_0x457f22));}if(_0x5b6484<=0x0||isNaN(_0x5b6484)){return _0x5730a6(msgResponse(_0x74a4('0x200'),_0x74a4('0x201'),_0x74a4('0x202')+_0x5b6484));}if(_0x476189<=0x0||isNaN(_0x476189)){return _0x5730a6(msgResponse(_0x74a4('0x200'),_0x74a4('0x201'),_0x74a4('0x203')+_0x476189));}if(_0x1e756f<=0x0||isNaN(_0x1e756f)){return _0x5730a6(msgResponse('[abandonmentRate]','Error',_0x74a4('0x204')+_0x1e756f));}_0x5cb93d=_0x5cb93d||0x0;var _0x4c2116=0x1/_0x457f22;var _0x2ba523=0x0;var _0x1a33b1=0x0;var _0x2827c7=0x0;var _0x3af1b1=0x0;for(var _0x5c5a9e=0x0;_0x2827c7<_0x1e756f;_0x5c5a9e+=0x1){_0x1a33b1=_0x5c5a9e/_0x476189;_0x2ba523=(_0x5b6484*_0x1a33b1+_0x5cb93d)/_0x4c2116;_0x2827c7=erlangb(_0x2ba523,_0x103ee3);_0x3af1b1=_0x2ba523/_0x103ee3*(0x1-erlangb(_0x2ba523,_0x103ee3));}return _0x915349({'erlangCalls':_0x5c5a9e,'erlangCallToSecond':_0x476189/_0x5c5a9e,'erlangAbandonmentRate':_0x2827c7,'erlangBusyFactor':_0x3af1b1});});};Dialer[_0x74a4('0x19')][_0x74a4('0x1cf')]=function(_0x17208a,_0x3aada7,_0xaea958,_0x3d2fe3,_0x38fcce,_0x384e36){loggerPredictive['info']('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive[_0x74a4('0x76')](_0x74a4('0x205'),_0x17208a);loggerPredictive['info']('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3aada7);loggerPredictive[_0x74a4('0x76')](_0x74a4('0x1fd'),_0xaea958);loggerPredictive[_0x74a4('0x76')]('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',_0x3d2fe3);loggerPredictive[_0x74a4('0x76')]('Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x38fcce);loggerPredictive[_0x74a4('0x76')](_0x74a4('0x84'));return new BPromise(function(_0x4cf54b,_0x34dfef){if(_0x17208a<=0x0||isNaN(_0x17208a)){return _0x34dfef(msgResponse(_0x74a4('0x206'),'Error',_0x74a4('0x207')+_0x17208a));}if(_0xaea958<=0x0||isNaN(_0xaea958)){return _0x34dfef(msgResponse(_0x74a4('0x206'),_0x74a4('0x201'),'Ts\x20=\x20'+_0xaea958));}if(_0x3d2fe3<=0x0||isNaN(_0x3d2fe3)){return _0x34dfef(msgResponse(_0x74a4('0x206'),_0x74a4('0x201'),_0x74a4('0x202')+_0x3d2fe3));}if(_0x3aada7<=0x0||isNaN(_0x3aada7)){return _0x34dfef(msgResponse(_0x74a4('0x206'),'Error',_0x74a4('0x203')+_0x3aada7));}if(_0x38fcce<=0x0||isNaN(_0x38fcce)){return _0x34dfef(msgResponse(_0x74a4('0x206'),_0x74a4('0x201'),'Umin\x20=\x20'+_0x38fcce));}_0x384e36=_0x384e36||0x0;var _0x24455c=0x1/_0xaea958;var _0x3617bb=0x0;var _0x3084fe=0x0;var _0x3fb199=0x0;var _0x395a63=0x0;for(var _0x30ec97=0x0;_0x395a63<_0x38fcce;_0x30ec97+=0x1){_0x3084fe=_0x30ec97/_0x3aada7;_0x3617bb=(_0x3d2fe3*_0x3084fe+_0x384e36)/_0x24455c;_0x3fb199=erlangb(_0x3617bb,_0x17208a);_0x395a63=_0x3617bb/_0x17208a*(0x1-erlangb(_0x3617bb,_0x17208a));}return _0x4cf54b({'erlangCalls':_0x30ec97,'erlangCallToSecond':_0x3aada7/_0x30ec97,'erlangAbandonmentRate':_0x3fb199,'erlangBusyFactor':_0x395a63});});};module[_0x74a4('0x208')]=Dialer; \ No newline at end of file +var _0x8b2b=['waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','startPredictive','Trunk','active','callerid','format','voice:queue:%s','voice_queue:save','ivr','campaign:ivr:%s','campaign:save','info','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\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','---------------------------','isUndefined','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\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','merge','clearing\x20variable\x20start\x20progressive','handlePredictive','clearing\x20variable\x20handle\x20predictive','outbound','string','\x22%s\x22\x20<%s>','inspect','error','[decremetOriginate]\x20object\x20originated\x20is\x20negative','contactsRescheduled','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Queue:\x20','IS_DISACTIVED','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20not\x20active','state','endtime','starttime','clearZombieChannels','[uniqueid]','[actions]','undefined','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel][ivr]','countReScheduled','resolve','then','[countReScheduled]\x20','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','loggerHandler','emptyContact','notFound','saveInDb','pick','ContactId','ListId','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','[emptyContact]','Success','isTrunkReachable','SIP/%s','unmonitored','uniqueid','isNil','variable','exten','xcally-motion-dialer','dialAMDActive','value','HANGUP','statedesc','HangupInAMD','buildObj','MACHINE','Machine','membername','AMD','countmachineretry','countglobal','amd','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','dialGlobalMaxRetry','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','rescheduleContact','add','dialMachineRetryFrequency','YYYY-MM-DD\x20HH:mm:ss','[rescheduleContact][Machine]','custom:amd','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','[syncAgentComplete][createHistory][0]','stateGlobal','reason\x2019\x20machine....','minutes','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AGI','cause-txt','Unknow','reason','agent','agiafterat','dialAgiAfterHangupAgent','[syncAgentComplete]','syncAgentConnect','answertime','queueCallerAbandonCreateState','[syncAgentComplete][createHistory]','[syncQueueCallerAbandon]\x20[Drop]','droptime','dialQueueTimeout','dropreason','TIMEOUT','dialQueueProject2','dialDropMaxRetry','dialDropRetryFrequency','[rescheduleContact][Drop]','Drop','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','Abandoned','CALLEREXIT','dialAbandonedMaxRetry','actionid','strategy','roundrobin','locked','paused','stateinterface','push','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','run','idHopper','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','[Catch][Preview][syncQueueStatusComplete]','finally','[booked][RR][finaly]','contactAgent-idHopper:\x20','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','syncCampaigns','checkIsTrunkReachable','TrunkBackup','checkIfTime','ifTime','checkIfTimeIntervals','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','Failure','isArray','length','command','interval','true','iftime\x20%s,%s','content','some','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','progressive','power','handlePower','dialPowerLevel','method\x20not\x20recognized','launchHandleIvr','handleIvr','dialTimezone','dialGlobalInterval','[syncCampaigns]','\x5cw{0,','pow','replace','random','match','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','Contact','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','dialer','ACTIVE','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','createdAt','updatedAt','%s%s','XMD-','toUpper','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridnum','SIP/%s/%s%s','trim','dialCutDigit','substring','OriginateError','[originate][error]','getQueue','isSuccess','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','countagentrejectretry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','outboundNoSuchCallsDay','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','NoAnswer','noanswer','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','dialCongestionMaxRetry','reason\x208\x20congestion','outboundAbandonedCallsDay','[syncAgentComplete][createHistory][11]','reason\x2011\x20abandoned','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','dialPredictiveOptimizationPercentage','predictiveIntervalMaxThreshold','round','predictiveIntervalMinThreshold','floor','check\x20predictive\x20is\x20not\x20undefine','[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','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(','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','check\x20failure','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','Queue:\x20','scheduledat','dialRecallMeTimeout','Agent','voicePause','outboundReCallsDay','dialRecallInQueue','RECALLINQUEUE','[Originate][HistoryDialRecallInQueue][historyCatch]','[Originate][HistoryRecallClose][historyCatch]','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','limitCalls','dialOrderByScheduledAt','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','Contact.phone','[getContactCampaign2]','dialLimitQueue','not_inuse','reachable','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','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','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','interval\x20=\x20','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','[busyFactor]','p\x20=\x20','Umin\x20=\x20','exports','util','lodash','bluebird','moment','md5','ioredis','../preview/util/util','../../../config/environment/','../../../config/logger','booked','predictive','syncQueueSummary','../ami','redis','defaults','socket.io-emitter','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./action','./history','./final','./queueCallerAbandon','127.0.0.1','rrmemory','prototype','enqueue','tail','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','optionPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','bind','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','syncHangup','newexten','syncNewExten','varset','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','message','AGENTS_NOT_LOGGED','name','NOT_ACTIVE','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','isEmpty','[ifTime][Action]','Error','stringify','milliseconds','diff','seconds','emit','type','answered','available','loggedIn','pTalking','sumHoldTime','talking','total','unmanaged'];(function(_0x59328b,_0x3e1186){var _0x2593ea=function(_0x11ba1e){while(--_0x11ba1e){_0x59328b['push'](_0x59328b['shift']());}};_0x2593ea(++_0x3e1186);}(_0x8b2b,0x1c0));var _0xb8b2=function(_0x1ce3f5,_0x117417){_0x1ce3f5=_0x1ce3f5-0x0;var _0x175233=_0x8b2b[_0x1ce3f5];return _0x175233;};'use strict';var util=require(_0xb8b2('0x0'));var _=require(_0xb8b2('0x1'));var BPromise=require(_0xb8b2('0x2'));var uuid=require('uuid');var moment=require(_0xb8b2('0x3'));var rr=require('rr');var md5=require(_0xb8b2('0x4'));var Redis=require(_0xb8b2('0x5'));var ut=require(_0xb8b2('0x6'));var config=require(_0xb8b2('0x7'));var logger=require(_0xb8b2('0x8'))('dialer');var loggerBooked=require('../../../config/logger')(_0xb8b2('0x9'));var loggerPredictive=require(_0xb8b2('0x8'))(_0xb8b2('0xa'));var loggerPredictiveCalls=require(_0xb8b2('0x8'))('predictiveCalls');var loggerSyncQueueSummary=require('../../../config/logger')(_0xb8b2('0xb'));var ami=require(_0xb8b2('0xc'));config[_0xb8b2('0xd')]=_[_0xb8b2('0xe')](config[_0xb8b2('0xd')],{'host':'localhost','port':0x18eb});var io=require(_0xb8b2('0xf'))(new Redis(config['redis']));var cmHopper=require('../rpc/cmHopper');var cmHopperHistory=require(_0xb8b2('0x10'));var cmHopperBlack=require(_0xb8b2('0x11'));var voiceQueueRt=require(_0xb8b2('0x12'));var Action=require(_0xb8b2('0x13'));var History=require(_0xb8b2('0x14'));var Final=require(_0xb8b2('0x15'));var AgentComplete=require('./agentComplete');var QueueCallerAbandon=require(_0xb8b2('0x16'));var Hangup=require('./hangup');var ipAgi=process['env']['XCALLY_IP_AGI']||_0xb8b2('0x17');var strategy={'rrmemory':_0xb8b2('0x18'),'roundrobin':'roundrobin'};var Sequence=function(){};Sequence[_0xb8b2('0x19')][_0xb8b2('0x1a')]=function(_0x333bfb){this[_0xb8b2('0x1b')]=this[_0xb8b2('0x1b')]?this['tail']['finally'](_0x333bfb):_0x333bfb();};function Dialer(_0xda50ef,_0x7eff5){this[_0xb8b2('0x1c')]=new Sequence();this[_0xb8b2('0x1d')]=_0x7eff5;this[_0xb8b2('0x1e')]=_0xda50ef['voiceQueues'];this['campaigns']=_0xda50ef[_0xb8b2('0x1f')];this[_0xb8b2('0x20')]=_0xda50ef[_0xb8b2('0x20')];this[_0xb8b2('0x21')]=_0xda50ef['trunks'];this[_0xb8b2('0x22')]=config[_0xb8b2('0x22')]||0x2;this[_0xb8b2('0x23')]={};this[_0xb8b2('0x24')]={};this[_0xb8b2('0x25')]={};this[_0xb8b2('0x26')]={};this[_0xb8b2('0x27')]={};this['startPredictive']={};this[_0xb8b2('0x28')]={};this[_0xb8b2('0x29')]={};this[_0xb8b2('0x2a')]={};this[_0xb8b2('0x2b')]={};ami['on'](_0xb8b2('0x2c'),this['syncAgentConnect'][_0xb8b2('0x2d')](this));ami['on']('queuecallerabandon',this[_0xb8b2('0x2e')][_0xb8b2('0x2d')](this));ami['on'](_0xb8b2('0x2f'),this[_0xb8b2('0x30')]['bind'](this));ami['on'](_0xb8b2('0x31'),this[_0xb8b2('0x32')][_0xb8b2('0x2d')](this));ami['on']('custom:queuesummary',this['syncQueueSummary']['bind'](this));ami['on']('hangup',this[_0xb8b2('0x33')][_0xb8b2('0x2d')](this));ami['on'](_0xb8b2('0x34'),this[_0xb8b2('0x35')][_0xb8b2('0x2d')](this));ami['on'](_0xb8b2('0x36'),this[_0xb8b2('0x37')][_0xb8b2('0x2d')](this));ami['on'](_0xb8b2('0x38'),this[_0xb8b2('0x39')][_0xb8b2('0x2d')](this));ami['on'](_0xb8b2('0x3a'),this[_0xb8b2('0x3b')][_0xb8b2('0x2d')](this));this[_0xb8b2('0x3c')]();this[_0xb8b2('0x3d')]();}function isNotNull(_0x3f9dc8){return _0x3f9dc8!==null&&!_['isUndefined'](_0x3f9dc8);}function checkIsLoggedIn(_0x37ea31,_0x1899d9){return function(){if(_0x1899d9<=0x0){_0x37ea31[_0xb8b2('0x3e')]=_0xb8b2('0x3f');throw _0x37ea31[_0xb8b2('0x40')]+'\x20AGENTS\x20NOT\x20LOGGED';}};}function isActive(_0x29cde1){return _0x29cde1;}function checkIsActive(_0x407864,_0x26309e){return function(){if(!isActive(_0x26309e)){_0x407864['message']=_0xb8b2('0x41');throw _0x407864[_0xb8b2('0x40')]+'\x20NOT\x20Active';}};}function checkInterval(_0xa11e1){return function(){if(!isNotNull(_0xa11e1[_0xb8b2('0x42')])){_0xa11e1[_0xb8b2('0x3e')]=_0xb8b2('0x43');throw _0xa11e1[_0xb8b2('0x40')]+_0xb8b2('0x44');}if(!isNotNull(_0xa11e1[_0xb8b2('0x42')][_0xb8b2('0x45')])){_0xa11e1[_0xb8b2('0x3e')]=_0xb8b2('0x43');throw _0xa11e1['name']+_0xb8b2('0x44');}if(!isNotNull(_[_0xb8b2('0x46')](_0xa11e1['Interval'][_0xb8b2('0x45')]))){_0xa11e1[_0xb8b2('0x3e')]=_0xb8b2('0x43');throw _0xa11e1[_0xb8b2('0x40')]+_0xb8b2('0x44');}};}function msgResponse(_0x27180e,_0x298997,_0x337c6e){return{'action':_0x27180e,'response':_0x298997,'message':_0x337c6e,'stack':_0x337c6e};}function myreject(_0x18fa6e){return function(_0x1a4fa0){return _0x18fa6e(msgResponse(_0xb8b2('0x47'),_0xb8b2('0x48'),JSON[_0xb8b2('0x49')](_0x1a4fa0)));};}function getSeconds(_0x43198d,_0x352c5f){var _0x43b71d=moment(_0x43198d)[_0xb8b2('0x4a')](0x0);var _0x9d012d=moment(_0x352c5f)[_0xb8b2('0x4a')](0x0);return _0x43b71d[_0xb8b2('0x4b')](_0x9d012d,_0xb8b2('0x4c'));}function emit(_0x433fe6,_0x22649a,_0x84bef9){io['to'](_0x433fe6)[_0xb8b2('0x4d')](_0x22649a,_0x84bef9);}function emitVoiceQueueSummary(_0x3de2e0){if(_0x3de2e0[_0xb8b2('0x4e')]==='outbound'){var _0x482d64={'id':_0x3de2e0['id'],'name':_0x3de2e0[_0xb8b2('0x40')],'strategy':_0x3de2e0['strategy'],'answered':_0x3de2e0[_0xb8b2('0x4f')],'available':_0x3de2e0[_0xb8b2('0x50')],'loggedIn':_0x3de2e0[_0xb8b2('0x51')],'pTalking':_0x3de2e0[_0xb8b2('0x52')],'sumBillable':_0x3de2e0['sumBillable'],'sumDuration':_0x3de2e0['sumDuration'],'sumHoldTime':_0x3de2e0[_0xb8b2('0x53')]||0x0,'talking':_0x3de2e0[_0xb8b2('0x54')],'total':_0x3de2e0[_0xb8b2('0x55')],'type':_0x3de2e0[_0xb8b2('0x4e')],'unmanaged':_0x3de2e0[_0xb8b2('0x56')],'abandoned':_0x3de2e0['abandoned'],'waiting':_0x3de2e0[_0xb8b2('0x57')],'loggedInDb':_0x3de2e0[_0xb8b2('0x58')],'dialActive':_0x3de2e0[_0xb8b2('0x59')],'dialMethod':_0x3de2e0[_0xb8b2('0x5a')],'dialOriginateCallerIdName':_0x3de2e0[_0xb8b2('0x5b')],'dialOriginateCallerIdNumber':_0x3de2e0['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x3de2e0[_0xb8b2('0x5c')],'dialPrefix':_0x3de2e0[_0xb8b2('0x5d')],'outboundAnswerAgiCallsDay':_0x3de2e0[_0xb8b2('0x5e')],'outboundAnswerCallsDay':_0x3de2e0[_0xb8b2('0x5f')],'outboundBlacklistCallsDay':_0x3de2e0[_0xb8b2('0x60')],'outboundBusyCallsDay':_0x3de2e0[_0xb8b2('0x61')],'outboundCongestionCallsDay':_0x3de2e0[_0xb8b2('0x62')],'outboundDropCallsDayACS':_0x3de2e0[_0xb8b2('0x63')],'outboundDropCallsDayCallersExit':_0x3de2e0[_0xb8b2('0x64')],'outboundDropCallsDayTimeout':_0x3de2e0[_0xb8b2('0x65')],'outboundNoAnswerCallsDay':_0x3de2e0['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x3de2e0['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x3de2e0[_0xb8b2('0x66')],'outboundReCallsDay':_0x3de2e0['outboundReCallsDay'],'outboundRejectCallsDay':_0x3de2e0[_0xb8b2('0x67')],'outboundUnknownCallsDay':_0x3de2e0[_0xb8b2('0x68')],'predictiveIntervalAnsweredCalls':_0x3de2e0[_0xb8b2('0x69')],'predictiveIntervalAvgHoldtime':_0x3de2e0[_0xb8b2('0x6a')],'predictiveIntervalAvgTalktime':_0x3de2e0[_0xb8b2('0x6b')],'predictiveIntervalDroppedCallsCallersExit':_0x3de2e0['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x3de2e0[_0xb8b2('0x6c')],'predictiveIntervalErlangCalls':_0x3de2e0[_0xb8b2('0x6d')],'predictiveIntervalErlangCallsDroppedCalls':_0x3de2e0[_0xb8b2('0x6e')],'predictiveIntervalHitRate':_0x3de2e0[_0xb8b2('0x6f')],'predictiveIntervalMultiplicativeFactor':_0x3de2e0[_0xb8b2('0x70')],'predictiveIntervalPauses':_0x3de2e0[_0xb8b2('0x71')],'predictiveIntervalAvailable':_0x3de2e0[_0xb8b2('0x72')],'predictiveIntervalTotalCalls':_0x3de2e0[_0xb8b2('0x73')],'message':_0x3de2e0[_0xb8b2('0x3e')],'originated':_0x3de2e0[_0xb8b2('0x74')],'erlangCalls':_0x3de2e0[_0xb8b2('0x75')],'erlangCallToSecond':_0x3de2e0['erlangCallToSecond'],'erlangAbandonmentRate':_0x3de2e0[_0xb8b2('0x76')],'erlangBusyFactor':_0x3de2e0[_0xb8b2('0x77')],'startPredictive':_0x3de2e0[_0xb8b2('0x78')],'startProgressive':_0x3de2e0[_0xb8b2('0x28')]};if(_0x3de2e0[_0xb8b2('0x79')]){_0x482d64[_0xb8b2('0x79')]={'id':_0x3de2e0[_0xb8b2('0x79')]['id'],'name':_0x3de2e0[_0xb8b2('0x79')][_0xb8b2('0x40')],'active':_0x3de2e0[_0xb8b2('0x79')][_0xb8b2('0x7a')],'callerid':_0x3de2e0[_0xb8b2('0x79')][_0xb8b2('0x7b')]};}if(_0x3de2e0['Interval']){_0x482d64[_0xb8b2('0x42')]={'id':_0x3de2e0[_0xb8b2('0x42')]['id'],'name':_0x3de2e0['Interval'][_0xb8b2('0x40')]};}var _0x2b9c9a=md5(JSON[_0xb8b2('0x49')](_0x482d64));if(_0x3de2e0['md5']!==_0x2b9c9a){_0x3de2e0[_0xb8b2('0x4')]=_0x2b9c9a;emit(util[_0xb8b2('0x7c')](_0xb8b2('0x7d'),_0x482d64[_0xb8b2('0x40')]),_0xb8b2('0x7e'),_0x482d64);}}}function emitCampaignSummary(_0x174a3d){if(_0x174a3d[_0xb8b2('0x4e')]===_0xb8b2('0x7f')){emit(util[_0xb8b2('0x7c')](_0xb8b2('0x80'),_0x174a3d[_0xb8b2('0x40')]),_0xb8b2('0x81'),_0x174a3d);}}function checkGetDataPredictive(_0xc28eb9){if(isNotNull(_0xc28eb9)&&!_[_0xb8b2('0x46')](_0xc28eb9)){loggerPredictive[_0xb8b2('0x82')]('-----\x20Stats\x20Predictive\x20---');loggerPredictive['info'](_0xb8b2('0x83'),_0xc28eb9[_0xb8b2('0x73')]);loggerPredictive[_0xb8b2('0x82')](_0xb8b2('0x84'),_0xc28eb9[_0xb8b2('0x69')]);loggerPredictive[_0xb8b2('0x82')]('Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xc28eb9[_0xb8b2('0x6c')]);loggerPredictive[_0xb8b2('0x82')](_0xb8b2('0x85'),_0xc28eb9[_0xb8b2('0x86')]);loggerPredictive[_0xb8b2('0x82')](_0xb8b2('0x87'),_0xc28eb9[_0xb8b2('0x6a')]);loggerPredictive[_0xb8b2('0x82')]('AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xc28eb9[_0xb8b2('0x6b')]);loggerPredictive['info'](_0xb8b2('0x88'));if(_0xc28eb9[_0xb8b2('0x73')]>0x0){if(!_[_0xb8b2('0x89')](_0xc28eb9[_0xb8b2('0x6b')])&&_0xc28eb9[_0xb8b2('0x6b')]>0x0){return!![];}loggerPredictive[_0xb8b2('0x82')](_0xb8b2('0x8a'));if(!_['isUndefined'](_0xc28eb9[_0xb8b2('0x6a')])&&_0xc28eb9[_0xb8b2('0x6a')]>0x0){return!![];}loggerPredictive[_0xb8b2('0x82')](_0xb8b2('0x8b'));}else{loggerPredictive[_0xb8b2('0x82')]('Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive[_0xb8b2('0x82')]('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x52598e){return function(_0x26fd29){loggerPredictive[_0xb8b2('0x82')](_0xb8b2('0x8c'));loggerPredictive[_0xb8b2('0x82')](_0xb8b2('0x8d'),_0x26fd29[_0xb8b2('0x75')]);loggerPredictive[_0xb8b2('0x82')](_0xb8b2('0x8e'),_0x26fd29[_0xb8b2('0x8f')]);loggerPredictive[_0xb8b2('0x82')](_0xb8b2('0x90'),_0x26fd29[_0xb8b2('0x76')]);loggerPredictive['info'](_0xb8b2('0x91'),_0x26fd29[_0xb8b2('0x77')]);loggerPredictive['info'](_0xb8b2('0x90'),_0x26fd29[_0xb8b2('0x76')]);loggerPredictive[_0xb8b2('0x82')](_0xb8b2('0x88'));_[_0xb8b2('0x92')](_0x52598e,_0x26fd29);};}function getDiff(_0x5361f8){var _0x356e20=moment()['milliseconds'](0x0);var _0x28c92d=moment(_0x5361f8)[_0xb8b2('0x4a')](0x0);return _0x356e20[_0xb8b2('0x4b')](_0x28c92d,'seconds');}function ifInterval(_0x34c3c9,_0x21c7ec){if(_[_0xb8b2('0x89')](_0x21c7ec)){return![];}return getDiff(_0x21c7ec)<_0x34c3c9*0x3c;}function freeVariablesPredictive(_0x41d670){if(isNotNull(_0x41d670)){if(!_[_0xb8b2('0x89')](_0x41d670['startProgressive'])){_0x41d670['startProgressive']=undefined;loggerPredictive[_0xb8b2('0x82')](_0x41d670[_0xb8b2('0x40')],_0xb8b2('0x93'));}if(!_[_0xb8b2('0x89')](_0x41d670[_0xb8b2('0x78')])){_0x41d670[_0xb8b2('0x78')]=undefined;loggerPredictive[_0xb8b2('0x82')](_0x41d670[_0xb8b2('0x40')],'clearing\x20variable\x20start\x20predictive');}if(!_[_0xb8b2('0x89')](_0x41d670['handlePredictive'])){clearInterval(_0x41d670['handlePredictive']);_0x41d670[_0xb8b2('0x94')]=undefined;loggerPredictive[_0xb8b2('0x82')](_0x41d670[_0xb8b2('0x40')],_0xb8b2('0x95'));}}}function erlangb(_0x419710,_0x8ac34e){if(_0x8ac34e===0x0){return 0x0;}var _0x1ffea7=0x1;for(var _0xa6ffa1=0x1;_0xa6ffa1<=_0x8ac34e;_0xa6ffa1+=0x1){_0x1ffea7=0x1+_0x1ffea7*_0xa6ffa1/_0x419710;}return 0x1/_0x1ffea7;}function isVoiceQueueOutbound(_0x552719){return _0x552719===_0xb8b2('0x96');}function isNotPreview(_0x714005){return _0x714005!=='preview';}function isCampaignIvr(_0xe2c61b){return _0xe2c61b==='ivr';}function getCallerId(_0x2132b4,_0x213fe9,_0x150d69){if(!_[_0xb8b2('0x89')](_0x150d69)&&typeof _0x150d69===_0xb8b2('0x97')&&!_['isEmpty'](_0x150d69)){if(!_['isUndefined'](_0x213fe9)&&typeof _0x213fe9===_0xb8b2('0x97')&&!_[_0xb8b2('0x46')](_0x213fe9)){return util['format'](_0xb8b2('0x98'),_0x213fe9,_0x150d69);}return util[_0xb8b2('0x7c')](_0xb8b2('0x98'),_0x150d69,_0x150d69);}if(!_['isUndefined'](_0x2132b4)&&typeof _0x2132b4===_0xb8b2('0x97')&&!_[_0xb8b2('0x46')](_0x2132b4)){return _0x2132b4;}return'\x22\x22\x20<>';}function loggerCatchQueueSummary(_0x417d6f,_0xcf1f6e){return function(_0x5b0055){freeVariablesPredictive(_0xcf1f6e);emitVoiceQueueSummary(_0xcf1f6e);emitCampaignSummary(_0xcf1f6e);loggerSyncQueueSummary['error'](_0x417d6f,util[_0xb8b2('0x99')](_0x5b0055,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x1b5402,_0x2a7709){return function(_0x5f206d){loggerPredictive['error'](_0x2a7709['name'],_0x1b5402);loggerPredictive[_0xb8b2('0x9a')](_0x5f206d['stack']);freeVariablesPredictive(_0x2a7709);};}function loggerCatch(_0x411176){return function(_0x188ca6){logger[_0xb8b2('0x9a')](_0x411176,util[_0xb8b2('0x99')](_0x188ca6,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x2f8ae6){return _0x2f8ae6&&!_[_0xb8b2('0x89')](_0x2f8ae6)&&_0x2f8ae6['length']>0x0;}function decremetOriginate(_0x4ddae3){if(!_[_0xb8b2('0x89')](_0x4ddae3)&&_0x4ddae3!==null){if(typeof _0x4ddae3[_0xb8b2('0x74')]!=='undefined'){if(_0x4ddae3[_0xb8b2('0x74')]>0x0){_0x4ddae3[_0xb8b2('0x74')]-=0x1;}else{logger[_0xb8b2('0x9a')](_0xb8b2('0x9b'));}}}else{logger[_0xb8b2('0x9a')]('[decremetOriginate]\x20is\x20null\x20or\x20undefined');}}function checkContactLowerLimitOriginate(_0x2231cc,_0x396d75,_0x472dda){if(_0x396d75>_0x472dda){for(var _0x5c03a3=0x0;_0x5c03a3<_0x396d75-_0x472dda;_0x5c03a3+=0x1){decremetOriginate(_0x2231cc);}}}function loggerGetContactDialer(_0xbdc200,_0x2de419,_0x4fd3ce){return function(_0x287001){checkContactLowerLimitOriginate(_0x2de419,_0x4fd3ce,0x0);logger[_0xb8b2('0x9a')](_0xbdc200,util[_0xb8b2('0x99')](_0x287001,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x199d6e){return function(_0x5b7a0e){if(isNotNull(_0x5b7a0e)&&isNotNull(_0x5b7a0e[0x0])){if(_0x5b7a0e[0x0][_0xb8b2('0x9c')]>0x0){_0x199d6e[_0xb8b2('0x3e')]='RESCHEDULED_CONTACTS';logger[_0xb8b2('0x82')]('[getContactDialer2][ReScheduled]'+_0x199d6e[_0xb8b2('0x40')],_0x5b7a0e[0x0][_0xb8b2('0x9c')],'contacts');}else{_0x199d6e['message']='AVAILABLE_CONTACTS_FINISHED';logger['info']('[getContactDialer2][Empty]'+_0x199d6e['name']);}}};}function notSendMessagesQueue(_0x1878ee){if(_0x1878ee[_0xb8b2('0x9d')]){freeVariablesPredictive(_0x1878ee);if(_0x1878ee[_0xb8b2('0x74')]===0x0&&_0x1878ee[_0xb8b2('0x54')]===0x0&&_0x1878ee[_0xb8b2('0x57')]===0x0&&(_0x1878ee[_0xb8b2('0x52')]||0x0)===0x0){_0x1878ee[_0xb8b2('0x9d')]=![];_0x1878ee[_0xb8b2('0x50')]=0x0;_0x1878ee[_0xb8b2('0x3e')]=_0xb8b2('0x41');loggerSyncQueueSummary[_0xb8b2('0x9a')](_0xb8b2('0x9e'),_0x1878ee['name'],'is\x20not\x20active');}else{_0x1878ee[_0xb8b2('0x3e')]=_0xb8b2('0x9f');loggerSyncQueueSummary[_0xb8b2('0x9a')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x1878ee['name'],_0xb8b2('0xa0'));}emitVoiceQueueSummary(_0x1878ee);}}function notSendMessagesCampaign(_0x50f942){if(_0x50f942[_0xb8b2('0x9d')]){if(_0x50f942[_0xb8b2('0x74')]===0x0){_0x50f942[_0xb8b2('0x9d')]=![];_0x50f942[_0xb8b2('0x3e')]='NOT_ACTIVE';loggerSyncQueueSummary[_0xb8b2('0x9a')](_0xb8b2('0xa1'),_0x50f942[_0xb8b2('0x40')],_0xb8b2('0xa2'));}else{_0x50f942[_0xb8b2('0x3e')]=_0xb8b2('0x9f');loggerSyncQueueSummary['error'](_0xb8b2('0xa1'),_0x50f942[_0xb8b2('0x40')],'is\x20disactive');}emitCampaignSummary(_0x50f942);}}function createObjHistory(_0xeedb47,_0x422293,_0x3fd1be,_0x503c71,_0x4838a4){_0xeedb47[_0xb8b2('0x3e')]=_0x3fd1be;var _0x5130a2=new Action(_0xeedb47,_0x422293);var _0x4c3c3b=new History(_0x5130a2);_0x4c3c3b[_0xb8b2('0xa3')]=_0x503c71;_0x4c3c3b['statedesc']=_0x4838a4;_0x4c3c3b[_0xb8b2('0xa4')]=_0x5130a2[_0xb8b2('0xa5')];return _0x4c3c3b;}Dialer['prototype'][_0xb8b2('0x3d')]=function(){var _0x3fa3fe=this;setInterval(function(){_0x3fa3fe[_0xb8b2('0xa6')](_0x3fa3fe['uniqueId'],_0xb8b2('0xa7'));_0x3fa3fe['clearZombieChannels'](_0x3fa3fe[_0xb8b2('0x24')],_0xb8b2('0xa8'));},0x32c8);};Dialer[_0xb8b2('0x19')][_0xb8b2('0xa6')]=function(_0x7d00d1,_0x21a9e0){var _0xe2655d=this;for(var _0x613aef in _0x7d00d1){if(typeof _0x7d00d1[_0x613aef]!==_0xb8b2('0xa9')){this['sequence'][_0xb8b2('0x1a')](function(){if(!_['isNil'](_0x7d00d1[_0x613aef])){return ami[_0xb8b2('0xaa')]({'action':_0xb8b2('0xab'),'channel':_0x7d00d1[_0x613aef][_0xb8b2('0xac')]})[_0xb8b2('0xad')](function(_0x32c03e){if(_0x32c03e['message']===_0xb8b2('0xae')){setTimeout(function(){if(_0x7d00d1[_0x613aef]&&_0x7d00d1[_0x613aef][_0xb8b2('0x4e')]!==_0xb8b2('0x7f')){_0xe2655d[_0xb8b2('0xaf')](_0xe2655d[_0xb8b2('0x1e')][_0x7d00d1[_0x613aef][_0xb8b2('0xb0')]]);logger[_0xb8b2('0x9a')]('[Dialer][checkChannel]',_0x21a9e0,_0x613aef,_0x7d00d1[_0x613aef][_0xb8b2('0xb0')]);delete _0x7d00d1[_0x613aef];}if(_0x7d00d1[_0x613aef]&&_0x7d00d1[_0x613aef]['type']==='ivr'){_0xe2655d[_0xb8b2('0xaf')](_0xe2655d['campaigns'][_0x7d00d1[_0x613aef][_0xb8b2('0xb0')]]);logger['error'](_0xb8b2('0xb1'),_0x21a9e0,_0x613aef,_0x7d00d1[_0x613aef][_0xb8b2('0xb0')]);delete _0x7d00d1[_0x613aef];}},0x2328);}});}});}}};Dialer[_0xb8b2('0x19')][_0xb8b2('0xb2')]=function(_0x4481df){return BPromise[_0xb8b2('0xb3')]()[_0xb8b2('0xb4')](cmHopper[_0xb8b2('0xb2')](_0x4481df))[_0xb8b2('0xad')](loggerCatch(_0xb8b2('0xb5')));};Dialer[_0xb8b2('0x19')][_0xb8b2('0xb6')]=function(_0x2c6529){return BPromise[_0xb8b2('0xb3')]()[_0xb8b2('0xb4')](cmHopperBlack[_0xb8b2('0xb6')](_0x2c6529))[_0xb8b2('0xad')](loggerCatch(_0xb8b2('0xb7')));};Dialer[_0xb8b2('0x19')][_0xb8b2('0xb8')]=function(_0x1400ee){return BPromise['resolve']()[_0xb8b2('0xb4')](cmHopperBlack[_0xb8b2('0xb8')](_0x1400ee))[_0xb8b2('0xad')](loggerCatch(_0xb8b2('0xb9')));};Dialer[_0xb8b2('0x19')][_0xb8b2('0xba')]=function(_0x49449a){return BPromise[_0xb8b2('0xb3')]()[_0xb8b2('0xb4')](cmHopperHistory[_0xb8b2('0xbb')](_0x49449a))['catch'](loggerCatch(_0xb8b2('0xbc')));};Dialer[_0xb8b2('0x19')]['rescheduleContact']=function(_0x431a18){return BPromise[_0xb8b2('0xb3')]()[_0xb8b2('0xb4')](cmHopper['rescheduleContact'](_0x431a18))[_0xb8b2('0xad')](loggerCatch(_0xb8b2('0xbd')));};Dialer[_0xb8b2('0x19')][_0xb8b2('0xbe')]=function(_0x160547,_0x4c2955,_0x29c842){return BPromise[_0xb8b2('0xb3')]()[_0xb8b2('0xb4')](cmHopper[_0xb8b2('0xbe')](_0x160547,_0x4c2955,_0x29c842))[_0xb8b2('0xad')](loggerCatch(_0xb8b2('0xbf')));};Dialer['prototype'][_0xb8b2('0xc0')]=function(_0x8b15c1,_0x4844c9,_0x12e497,_0x1fd6df,_0x29e894){return BPromise[_0xb8b2('0xb3')]()[_0xb8b2('0xb4')](cmHopper[_0xb8b2('0xc0')](_0x8b15c1,_0x4844c9,_0x12e497,_0x1fd6df))[_0xb8b2('0xad')](function(_0x3f5b25){_0x29e894[_0xb8b2('0xc1')]-=_0x12e497;_0x29e894[_0xb8b2('0xc1')]=_0x29e894[_0xb8b2('0xc1')]>0x0?_0x29e894[_0xb8b2('0xc1')]:0x0;loggerCatch(_0xb8b2('0xc2'))(_0x3f5b25);});};Dialer['prototype'][_0xb8b2('0xc3')]=function(_0x58b66a,_0x904e81,_0x3989ee,_0x1261b2){return BPromise['resolve']()['then'](cmHopper['getContactDialerIvr'](_0x58b66a,_0x904e81,_0x3989ee))[_0xb8b2('0xad')](function(_0x55da0e){_0x1261b2[_0xb8b2('0xc1')]-=_0x904e81;_0x1261b2[_0xb8b2('0xc1')]=_0x1261b2[_0xb8b2('0xc1')]>0x0?_0x1261b2[_0xb8b2('0xc1')]:0x0;loggerCatch('[getContactDialerIvr]\x20')(_0x55da0e);});};Dialer['prototype']['getVoiceQueueRtPauses']=function(_0x3e955e){return BPromise[_0xb8b2('0xb3')]()['then'](voiceQueueRt[_0xb8b2('0xc4')](_0x3e955e))[_0xb8b2('0xad')](loggerCatch(_0xb8b2('0xc5')));};Dialer[_0xb8b2('0x19')][_0xb8b2('0xc6')]=function(_0x10849d){return BPromise[_0xb8b2('0xb3')]()[_0xb8b2('0xb4')](cmHopper['moveContactManagedDialer'](_0x10849d))['catch'](loggerCatch(_0xb8b2('0xc7')));};Dialer[_0xb8b2('0x19')][_0xb8b2('0xc8')]=function(_0x1e38fa){return BPromise[_0xb8b2('0xb3')]()[_0xb8b2('0xb4')](cmHopperHistory[_0xb8b2('0xc8')](_0x1e38fa))[_0xb8b2('0xad')](loggerCatch(_0xb8b2('0xc9')));};Dialer[_0xb8b2('0x19')][_0xb8b2('0xaf')]=function(_0x381577){if(!_['isUndefined'](_0x381577)&&_0x381577!==null){if(typeof _0x381577[_0xb8b2('0x74')]!==_0xb8b2('0xa9')){if(_0x381577[_0xb8b2('0x74')]>0x0){_0x381577['originated']-=0x1;}else{logger['error'](_0xb8b2('0xca'));}}}else{logger[_0xb8b2('0x9a')]('[updateOriginated]\x20is\x20null\x20or\x20undefined');}};Dialer[_0xb8b2('0x19')][_0xb8b2('0xcb')]=function(_0x435b68,_0x172a03){var _0x4341ae=this;return function(_0x5463b0){_0x4341ae[_0xb8b2('0xaf')](_0x172a03);logger['error'](_0x435b68,util[_0xb8b2('0x99')](_0x5463b0,{'showHidden':![],'depth':null}));};};Dialer[_0xb8b2('0x19')][_0xb8b2('0xcc')]=function(_0x50a048,_0x51ac7d,_0x8cbd39){var _0x206662={'state':0x19,'statedesc':_0xb8b2('0xcd')};this[_0xb8b2('0xaf')](_0x51ac7d);this[_0xb8b2('0xce')](_[_0xb8b2('0x92')](_0x206662,_[_0xb8b2('0xcf')](_0x8cbd39,[_0xb8b2('0xd0'),_0xb8b2('0xd1'),_0xb8b2('0xd2'),_0xb8b2('0xd3'),_0xb8b2('0xd4')])),_0xb8b2('0xd5'),_0xb8b2('0xd6'));logger[_0xb8b2('0x9a')](_0x50a048);};Dialer[_0xb8b2('0x19')]['isSuccess']=function(_0x350057){return _0x350057===_0xb8b2('0xd7');};Dialer[_0xb8b2('0x19')][_0xb8b2('0xd8')]=function(_0x55c2e5){return!_[_0xb8b2('0x89')](_0x55c2e5)&&_0x55c2e5&&!_[_0xb8b2('0x89')](_0x55c2e5[_0xb8b2('0x40')])&&!_[_0xb8b2('0x89')](_0x55c2e5[_0xb8b2('0x7a')])&&_0x55c2e5['active']&&(this[_0xb8b2('0x21')][util[_0xb8b2('0x7c')]('SIP/%s',_0x55c2e5[_0xb8b2('0x40')])]['status']==='reachable'||this[_0xb8b2('0x21')][util[_0xb8b2('0x7c')](_0xb8b2('0xd9'),_0x55c2e5['name'])][_0xb8b2('0xab')]===_0xb8b2('0xda'));};Dialer[_0xb8b2('0x19')][_0xb8b2('0xce')]=function(_0x22a803,_0x53f7d1,_0x4c77dd){this[_0xb8b2('0xc8')](_0x22a803)[_0xb8b2('0xad')](loggerCatch(_0x53f7d1));this['moveContactManagedDialer'](_0x22a803)[_0xb8b2('0xad')](loggerCatch(_0x4c77dd));};Dialer[_0xb8b2('0x19')][_0xb8b2('0x37')]=function(_0x34e4f7){var _0x1025ef=this['uniqueId'][_0x34e4f7[_0xb8b2('0xdb')]];var _0x531232;if(!_[_0xb8b2('0xdc')](_0x34e4f7)&&!_['isNil'](_0x34e4f7[_0xb8b2('0xdd')])&&!_[_0xb8b2('0xdc')](_0x34e4f7[_0xb8b2('0xdd')]['amdstatus'])&&_0x34e4f7[_0xb8b2('0xde')]===_0xb8b2('0xdf')&&_0x1025ef){if(_0x1025ef[_0xb8b2('0x4e')]!=='ivr'&&this['voiceQueues'][_0x1025ef[_0xb8b2('0xb0')]][_0xb8b2('0xe0')]&&_0x34e4f7[_0xb8b2('0xe1')]===_0xb8b2('0xe2')){delete this[_0xb8b2('0x26')][_0x34e4f7['uniqueid']];this[_0xb8b2('0xaf')](this['voiceQueues'][_0x1025ef[_0xb8b2('0xb0')]]);this[_0xb8b2('0x1e')][_0x1025ef[_0xb8b2('0xb0')]][_0xb8b2('0x5f')]+=0x1;this[_0xb8b2('0x1e')][_0x1025ef[_0xb8b2('0xb0')]][_0xb8b2('0x5e')]+=0x1;_0x531232=new Hangup(_0x1025ef,_0x34e4f7);_0x531232[_0xb8b2('0xa3')]=0x12;_0x531232[_0xb8b2('0xe3')]=_0xb8b2('0xe4');_0x531232['membername']='AMD';ami['emit']('custom:amd',ut[_0xb8b2('0xe5')](_0x531232,'amd'));this[_0xb8b2('0xce')](_0x531232,'[syncHangupInAMD][createHistory]','[syncHangupInAMD]');}if(_0x1025ef[_0xb8b2('0x4e')]!==_0xb8b2('0x7f')&&this[_0xb8b2('0x1e')][_0x1025ef[_0xb8b2('0xb0')]][_0xb8b2('0xe0')]&&_0x34e4f7[_0xb8b2('0xe1')]===_0xb8b2('0xe6')){var _0x29db0e=this;return new BPromise(function(_0x35471c,_0x28a288){delete _0x29db0e['uniqueId'][_0x34e4f7['uniqueid']];_0x29db0e[_0xb8b2('0xaf')](_0x29db0e[_0xb8b2('0x1e')][_0x1025ef[_0xb8b2('0xb0')]]);_0x29db0e[_0xb8b2('0x1e')][_0x1025ef[_0xb8b2('0xb0')]][_0xb8b2('0x5f')]+=0x1;_0x29db0e[_0xb8b2('0x1e')][_0x1025ef[_0xb8b2('0xb0')]][_0xb8b2('0x5e')]+=0x1;var _0x4e1327=_0x29db0e[_0xb8b2('0x1e')][_0x1025ef[_0xb8b2('0xb0')]];var _0x569f5a=new Hangup(_0x1025ef,_0x34e4f7);_0x569f5a[_0xb8b2('0xa3')]=0x13;_0x569f5a[_0xb8b2('0xe3')]=_0xb8b2('0xe7');_0x569f5a[_0xb8b2('0xe8')]=_0xb8b2('0xe9');_0x569f5a[_0xb8b2('0xea')]+=0x1;_0x569f5a[_0xb8b2('0xeb')]+=0x1;_0x569f5a[_0xb8b2('0xec')]=!![];ami['emit']('custom:amd',ut[_0xb8b2('0xe5')](_0x569f5a,'amd'));_0x29db0e[_0xb8b2('0xc8')](_0x569f5a)[_0xb8b2('0xad')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x569f5a[_0xb8b2('0xed')]+_0x569f5a[_0xb8b2('0xee')]+_0x569f5a[_0xb8b2('0xef')]+_0x569f5a[_0xb8b2('0xf0')]+_0x569f5a[_0xb8b2('0xf1')]+_0x569f5a[_0xb8b2('0xf2')]+_0x569f5a[_0xb8b2('0xea')]+_0x569f5a['countagentrejectretry']>=_0x4e1327[_0xb8b2('0xf3')]){_0x29db0e['stateGlobal'](_0x569f5a,_0x35471c,_0x28a288,_0xb8b2('0xf4'));}else{if(_0x569f5a[_0xb8b2('0xea')]>=_0x4e1327[_0xb8b2('0xf5')]){_0x29db0e[_0xb8b2('0xf6')](_0x569f5a,_0x35471c,_0x28a288,'reason\x2019\x20machine....');}else{_0x29db0e[_0xb8b2('0xf7')]({'active':![],'countmachineretry':_0x569f5a[_0xb8b2('0xea')],'scheduledat':moment()[_0xb8b2('0xf8')](_0x4e1327[_0xb8b2('0xf9')],'minutes')[_0xb8b2('0x7c')](_0xb8b2('0xfa')),'ContactId':_0x569f5a[_0xb8b2('0xd0')],'ListId':_0x569f5a[_0xb8b2('0xd1')],'VoiceQueueId':_0x569f5a['VoiceQueueId']||undefined,'CampaignId':_0x569f5a[_0xb8b2('0xd4')]||undefined})[_0xb8b2('0xad')](loggerCatch(_0xb8b2('0xfb')));_0x35471c({'reschedule':0x1});}}});}if(_0x1025ef[_0xb8b2('0x4e')]===_0xb8b2('0x7f')&&this[_0xb8b2('0x1f')][_0x1025ef['queue']][_0xb8b2('0xe0')]&&_0x34e4f7[_0xb8b2('0xe1')]==='HANGUP'){delete this[_0xb8b2('0x26')][_0x34e4f7[_0xb8b2('0xdb')]];this['updateOriginated'](this['campaigns'][_0x1025ef['queue']]);_0x531232=new Hangup(_0x1025ef,_0x34e4f7);_0x531232[_0xb8b2('0xa3')]=0x12;_0x531232[_0xb8b2('0xe3')]=_0xb8b2('0xe4');_0x531232['membername']='AMD';ami[_0xb8b2('0x4d')](_0xb8b2('0xfc'),ut[_0xb8b2('0xe5')](_0x531232,_0xb8b2('0xec')));this['saveInDb'](_0x531232,_0xb8b2('0xfd'),_0xb8b2('0xfe'));}if(_0x1025ef['type']===_0xb8b2('0x7f')&&this[_0xb8b2('0x1f')][_0x1025ef[_0xb8b2('0xb0')]][_0xb8b2('0xe0')]&&_0x34e4f7[_0xb8b2('0xe1')]==='MACHINE'){var _0x29db0e=this;return new BPromise(function(_0x2e11e1,_0x242ef8){delete _0x29db0e['uniqueId'][_0x34e4f7[_0xb8b2('0xdb')]];_0x29db0e[_0xb8b2('0xaf')](_0x29db0e[_0xb8b2('0x1f')][_0x1025ef['queue']]);_0x29db0e['campaigns'][_0x1025ef[_0xb8b2('0xb0')]][_0xb8b2('0x5f')]+=0x1;_0x29db0e[_0xb8b2('0x1f')][_0x1025ef[_0xb8b2('0xb0')]][_0xb8b2('0x5e')]+=0x1;var _0x2defea=_0x29db0e['campaigns'][_0x1025ef[_0xb8b2('0xb0')]];var _0x138c00=new Hangup(_0x1025ef,_0x34e4f7);_0x138c00[_0xb8b2('0xa3')]=0x13;_0x138c00[_0xb8b2('0xe3')]=_0xb8b2('0xe7');_0x138c00[_0xb8b2('0xe8')]=_0xb8b2('0xe9');_0x138c00[_0xb8b2('0xea')]+=0x1;_0x138c00[_0xb8b2('0xeb')]+=0x1;_0x138c00[_0xb8b2('0xec')]=!![];ami[_0xb8b2('0x4d')](_0xb8b2('0xfc'),ut['buildObj'](_0x138c00,_0xb8b2('0xec')));_0x29db0e['createHistory'](_0x138c00)['catch'](loggerCatch(_0xb8b2('0xff')));if(_0x138c00[_0xb8b2('0xed')]+_0x138c00[_0xb8b2('0xee')]+_0x138c00[_0xb8b2('0xef')]+_0x138c00[_0xb8b2('0xf0')]+_0x138c00['countdropretry']+_0x138c00[_0xb8b2('0xf2')]+_0x138c00[_0xb8b2('0xea')]+_0x138c00['countagentrejectretry']>=_0x2defea[_0xb8b2('0xf3')]){_0x29db0e[_0xb8b2('0x100')](_0x138c00,_0x2e11e1,_0x242ef8,'reason19\x20machine....');}else{if(_0x138c00['countmachineretry']>=_0x2defea[_0xb8b2('0xf5')]){_0x29db0e['createStateFinal'](_0x138c00,_0x2e11e1,_0x242ef8,_0xb8b2('0x101'));}else{_0x29db0e['rescheduleContact']({'active':![],'countmachineretry':_0x138c00[_0xb8b2('0xea')],'scheduledat':moment()['add'](_0x2defea[_0xb8b2('0xf9')],_0xb8b2('0x102'))[_0xb8b2('0x7c')](_0xb8b2('0xfa')),'ContactId':_0x138c00[_0xb8b2('0xd0')],'ListId':_0x138c00[_0xb8b2('0xd1')],'VoiceQueueId':_0x138c00['VoiceQueueId']||undefined,'CampaignId':_0x138c00[_0xb8b2('0xd4')]||undefined})[_0xb8b2('0xad')](loggerCatch(_0xb8b2('0xfb')));_0x2e11e1({'reschedule':0x1});}}});}}};Dialer['prototype'][_0xb8b2('0x33')]=function(_0x650fe){var _0xb49f9c=this[_0xb8b2('0x26')][_0x650fe['uniqueid']];var _0x1ba7a0=this;var _0x19b6fe;if(_0xb49f9c&&_0xb49f9c['type']===_0xb8b2('0x7f')){delete this[_0xb8b2('0x26')][_0x650fe[_0xb8b2('0xdb')]];this[_0xb8b2('0xaf')](this[_0xb8b2('0x1f')][_0xb49f9c[_0xb8b2('0xb0')]]);this[_0xb8b2('0x1f')][_0xb49f9c[_0xb8b2('0xb0')]][_0xb8b2('0x103')]+=0x1;_0x19b6fe=new Hangup(_0xb49f9c,_0x650fe);this['createHistory'](_0x19b6fe)[_0xb8b2('0xad')](loggerCatch(_0xb8b2('0x104')));this[_0xb8b2('0xc6')](_0x19b6fe)[_0xb8b2('0xad')](loggerCatch(_0xb8b2('0x105')));}if(_0xb49f9c&&_0xb49f9c['type']!==_0xb8b2('0x7f')&&isNotNull(this['voiceQueues'][_0xb49f9c['queue']][_0xb8b2('0x106')])){delete this[_0xb8b2('0x26')][_0x650fe['uniqueid']];this[_0xb8b2('0xaf')](this['voiceQueues'][_0xb49f9c[_0xb8b2('0xb0')]]);this[_0xb8b2('0x1e')][_0xb49f9c[_0xb8b2('0xb0')]][_0xb8b2('0x5f')]+=0x1;this[_0xb8b2('0x1e')][_0xb49f9c[_0xb8b2('0xb0')]][_0xb8b2('0x5e')]+=0x1;_0x19b6fe=new Hangup(_0xb49f9c,_0x650fe);_0x19b6fe['state']=0x10;_0x19b6fe[_0xb8b2('0xe3')]='AnswerAGI';_0x19b6fe[_0xb8b2('0xe8')]=_0xb8b2('0x107');this['createHistory'](_0x19b6fe)[_0xb8b2('0xad')](loggerCatch(_0xb8b2('0x104')));this[_0xb8b2('0xc6')](_0x19b6fe)[_0xb8b2('0xad')](loggerCatch(_0xb8b2('0x105')));}if(_0xb49f9c&&_0xb49f9c[_0xb8b2('0x4e')]!==_0xb8b2('0x7f')&&!isNotNull(this[_0xb8b2('0x1e')][_0xb49f9c[_0xb8b2('0xb0')]][_0xb8b2('0x106')])){delete this[_0xb8b2('0x26')][_0x650fe[_0xb8b2('0xdb')]];this[_0xb8b2('0xaf')](this[_0xb8b2('0x1e')][_0xb49f9c[_0xb8b2('0xb0')]]);this['voiceQueues'][_0xb49f9c[_0xb8b2('0xb0')]][_0xb8b2('0x68')]+=0x1;_0x19b6fe=new Hangup(_0xb49f9c,_0x650fe);_0x19b6fe[_0xb8b2('0xa3')]=0xc;_0x19b6fe[_0xb8b2('0xe3')]=_0x650fe[_0xb8b2('0x108')];_0x19b6fe['membername']=_0xb8b2('0x109');this[_0xb8b2('0xc8')](_0x19b6fe)[_0xb8b2('0xad')](loggerCatch(_0xb8b2('0x104')));this[_0xb8b2('0xc6')](_0x19b6fe)[_0xb8b2('0xad')](loggerCatch(_0xb8b2('0x105')));}};Dialer[_0xb8b2('0x19')][_0xb8b2('0x32')]=function(_0x2f5adb){var _0x27aadd=this[_0xb8b2('0x26')][_0x2f5adb[_0xb8b2('0xdb')]];var _0x1ee47a=this;if(this[_0xb8b2('0x1e')][_0x2f5adb['queue']]){if(_0x27aadd&&_0x27aadd[_0xb8b2('0x4e')]!==_0xb8b2('0x7f')){delete this[_0xb8b2('0x26')][_0x2f5adb['uniqueid']];this['voiceQueues'][_0x2f5adb['queue']][_0xb8b2('0x5f')]+=0x1;var _0xc111b5=new AgentComplete(_0x27aadd,_0x2f5adb);if(_0x2f5adb[_0xb8b2('0x10a')]===_0xb8b2('0x10b')){_0xc111b5[_0xb8b2('0x10c')]=this['voiceQueues'][_0x2f5adb[_0xb8b2('0xb0')]]['dialQueueProject2']&&this[_0xb8b2('0x1e')][_0x2f5adb[_0xb8b2('0xb0')]][_0xb8b2('0x10d')]?moment()['format'](_0xb8b2('0xfa')):undefined;}this[_0xb8b2('0xc8')](_0xc111b5)['catch'](loggerCatch('[syncAgentComplete][createHistory]'));this[_0xb8b2('0xc6')](_0xc111b5)['catch'](loggerCatch(_0xb8b2('0x10e')));}}};Dialer[_0xb8b2('0x19')][_0xb8b2('0x10f')]=function(_0x212833){if(this[_0xb8b2('0x1e')][_0x212833['queue']]){if(this[_0xb8b2('0x26')][_0x212833['uniqueid']]&&this[_0xb8b2('0x26')][_0x212833[_0xb8b2('0xdb')]][_0xb8b2('0x4e')]!==_0xb8b2('0x7f')){this[_0xb8b2('0xaf')](this[_0xb8b2('0x1e')][_0x212833[_0xb8b2('0xb0')]]);this['uniqueId'][_0x212833[_0xb8b2('0xdb')]][_0xb8b2('0x110')]=moment()[_0xb8b2('0x7c')]('YYYY-MM-DD\x20HH:mm:ss');}}};Dialer[_0xb8b2('0x19')][_0xb8b2('0x111')]=function(_0x2113a3){this['createHistory'](_0x2113a3)[_0xb8b2('0xad')](loggerCatch(_0xb8b2('0x112')));this[_0xb8b2('0xc6')](_0x2113a3)[_0xb8b2('0xad')](loggerCatch(_0xb8b2('0x113')));};Dialer['prototype'][_0xb8b2('0x2e')]=function(_0x442676){var _0x5678d8=this['uniqueId'][_0x442676[_0xb8b2('0xdb')]];var _0x1ce1a1=this;if(this['voiceQueues'][_0x442676['queue']]){if(_0x5678d8&&_0x5678d8[_0xb8b2('0x4e')]!==_0xb8b2('0x7f')){delete this[_0xb8b2('0x26')][_0x442676[_0xb8b2('0xdb')]];this[_0xb8b2('0xaf')](this[_0xb8b2('0x1e')][_0x442676[_0xb8b2('0xb0')]]);_0x5678d8['droptime']=moment()[_0xb8b2('0x7c')](_0xb8b2('0xfa'));var _0x48dbce=new QueueCallerAbandon(_0x5678d8,_0x442676);if(getSeconds(_0x5678d8[_0xb8b2('0x114')],_0x5678d8['responsetime'])>=_0x5678d8[_0xb8b2('0x115')]){this[_0xb8b2('0x1e')][_0x442676['queue']][_0xb8b2('0x6c')]+=0x1;this['voiceQueues'][_0x442676[_0xb8b2('0xb0')]]['outboundDropCallsDayTimeout']+=0x1;this['voiceQueues'][_0x442676['queue']][_0xb8b2('0x6e')]+=0x1;_0x48dbce[_0xb8b2('0xa3')]=0xa;_0x48dbce[_0xb8b2('0xe3')]='Drop';_0x48dbce[_0xb8b2('0x116')]=_0xb8b2('0x117');_0x48dbce['agiafterat']=this[_0xb8b2('0x1e')][_0x442676[_0xb8b2('0xb0')]][_0xb8b2('0x118')]?moment()[_0xb8b2('0x7c')](_0xb8b2('0xfa')):undefined;_0x48dbce['countdropretry']+=0x1;_0x48dbce[_0xb8b2('0xeb')]+=0x1;if(_0x48dbce['countdropretry']>=this['voiceQueues'][_0x442676[_0xb8b2('0xb0')]][_0xb8b2('0x119')]){this[_0xb8b2('0x111')](_0x48dbce);}else{this[_0xb8b2('0xf7')]({'active':![],'countdropretry':_0x48dbce[_0xb8b2('0xf1')],'scheduledat':moment()[_0xb8b2('0xf8')](this['voiceQueues'][_0x442676[_0xb8b2('0xb0')]][_0xb8b2('0x11a')],'minutes')['format'](_0xb8b2('0xfa')),'ContactId':_0x5678d8[_0xb8b2('0xd0')],'ListId':_0x5678d8[_0xb8b2('0xd1')],'VoiceQueueId':_0x5678d8[_0xb8b2('0xd3')]||undefined,'CampaignId':_0x5678d8[_0xb8b2('0xd4')]||undefined})[_0xb8b2('0xad')](loggerCatch(_0xb8b2('0x11b')));var _0x5e7394=new History(_0x48dbce);_0x5e7394[_0xb8b2('0xa3')]=0xa;_0x5e7394['statedesc']=_0xb8b2('0x11c');_0x5e7394[_0xb8b2('0xa5')]=moment()[_0xb8b2('0x7c')]('YYYY-MM-DD\x20HH:mm:ss');_0x5e7394[_0xb8b2('0xa4')]=_0x5e7394[_0xb8b2('0xa5')];_0x5e7394[_0xb8b2('0x11d')]=_0x48dbce['calleridname'];_0x5e7394[_0xb8b2('0x11e')]=_0x48dbce['calleridnum'];this[_0xb8b2('0xc8')](_0x5e7394)[_0xb8b2('0xad')](loggerCatch(_0xb8b2('0x11f')));}}else{this['voiceQueues'][_0x442676[_0xb8b2('0xb0')]][_0xb8b2('0x86')]+=0x1;this[_0xb8b2('0x1e')][_0x442676['queue']][_0xb8b2('0x64')]+=0x1;_0x48dbce[_0xb8b2('0xa3')]=0xb;_0x48dbce['statedesc']=_0xb8b2('0x120');_0x48dbce[_0xb8b2('0x116')]=_0xb8b2('0x121');_0x48dbce[_0xb8b2('0xf2')]+=0x1;_0x48dbce[_0xb8b2('0xeb')]+=0x1;if(_0x48dbce['countabandonedretry']>=this[_0xb8b2('0x1e')][_0x442676[_0xb8b2('0xb0')]][_0xb8b2('0x122')]){this[_0xb8b2('0x111')](_0x48dbce);}else{this[_0xb8b2('0xf7')]({'active':![],'countabandonedretry':_0x48dbce[_0xb8b2('0xf2')],'scheduledat':moment()['add'](this[_0xb8b2('0x1e')][_0x442676[_0xb8b2('0xb0')]]['dialAbandonedRetryFrequency'],_0xb8b2('0x102'))[_0xb8b2('0x7c')](_0xb8b2('0xfa')),'ContactId':_0x5678d8[_0xb8b2('0xd0')],'ListId':_0x5678d8[_0xb8b2('0xd1')],'VoiceQueueId':_0x5678d8['VoiceQueueId']||undefined,'CampaignId':_0x5678d8[_0xb8b2('0xd4')]||undefined})[_0xb8b2('0xad')](loggerCatch('[rescheduleContact][Abandoned]'));var _0x5e7394=new History(_0x48dbce);_0x5e7394[_0xb8b2('0xa3')]=0xb;_0x5e7394[_0xb8b2('0xe3')]=_0xb8b2('0x120');_0x5e7394[_0xb8b2('0xa5')]=moment()[_0xb8b2('0x7c')](_0xb8b2('0xfa'));_0x5e7394['endtime']=_0x5e7394['starttime'];_0x5e7394['calleridname']=_0x48dbce[_0xb8b2('0x11d')];_0x5e7394['calleridnum']=_0x48dbce[_0xb8b2('0x11e')];this[_0xb8b2('0xc8')](_0x5e7394)[_0xb8b2('0xad')](loggerCatch('[syncAgentComplete][createHistory][11]'));}}}}};Dialer['prototype'][_0xb8b2('0x35')]=function(_0x1cf0b6){if(this[_0xb8b2('0x24')][_0x1cf0b6[_0xb8b2('0xdb')]]){this[_0xb8b2('0x24')][_0x1cf0b6[_0xb8b2('0xdb')]][_0xb8b2('0xac')]=_0x1cf0b6['channel'];}if(this['uniqueId'][_0x1cf0b6[_0xb8b2('0xdb')]]){this['uniqueId'][_0x1cf0b6[_0xb8b2('0xdb')]][_0xb8b2('0xac')]=_0x1cf0b6[_0xb8b2('0xac')];}};Dialer[_0xb8b2('0x19')][_0xb8b2('0x39')]=function(_0x549a7d){if(strategy[this[_0xb8b2('0x1e')][this[_0xb8b2('0x24')][_0x549a7d[_0xb8b2('0x123')]]['queue']][_0xb8b2('0x124')]]===_0xb8b2('0x125')){if(this[_0xb8b2('0x24')][_0x549a7d[_0xb8b2('0x123')]]&&_[_0xb8b2('0xdc')](this[_0xb8b2('0x24')][_0x549a7d[_0xb8b2('0x123')]][_0xb8b2('0x126')])&&_0x549a7d[_0xb8b2('0xab')]==='1'&&_0x549a7d[_0xb8b2('0x127')]==='0'){if(this['agents'][_0x549a7d[_0xb8b2('0x128')]]){if(!this[_0xb8b2('0x20')][_0x549a7d[_0xb8b2('0x128')]][_0xb8b2('0x126')]){this['agents'][_0x549a7d[_0xb8b2('0x128')]]['locked']=!![];this[_0xb8b2('0x24')][_0x549a7d[_0xb8b2('0x123')]]['locked']=!![];this[_0xb8b2('0x24')][_0x549a7d[_0xb8b2('0x123')]][_0xb8b2('0x128')]=_0x549a7d[_0xb8b2('0x128')];}}}}else if((strategy[this[_0xb8b2('0x1e')][this[_0xb8b2('0x24')][_0x549a7d['actionid']]['queue']][_0xb8b2('0x124')]]||_0xb8b2('0x18'))===_0xb8b2('0x18')){if(this[_0xb8b2('0x24')][_0x549a7d['actionid']]){if(this[_0xb8b2('0x20')][_0x549a7d[_0xb8b2('0x128')]]){this[_0xb8b2('0x24')][_0x549a7d[_0xb8b2('0x123')]][_0xb8b2('0x128')]=_0x549a7d['stateinterface'];if(_[_0xb8b2('0xdc')](this[_0xb8b2('0x2a')][this['actions'][_0x549a7d[_0xb8b2('0x123')]][_0xb8b2('0xb0')]])){this['queueBooked'][this[_0xb8b2('0x24')][_0x549a7d['actionid']][_0xb8b2('0xb0')]]=[];}this[_0xb8b2('0x2a')][this[_0xb8b2('0x24')][_0x549a7d[_0xb8b2('0x123')]]['queue']][_0xb8b2('0x129')](_[_0xb8b2('0x92')](_[_0xb8b2('0xcf')](this[_0xb8b2('0x24')][_0x549a7d[_0xb8b2('0x123')]],['idHopper',_0xb8b2('0x128')]),{'status':_0x549a7d['status'],'paused':_0x549a7d['paused']}));}}}};function unlockQueueStatus(_0x7fe563,_0x2d7bb4){setTimeout(function(){if(_['isUndefined'](_0x7fe563[_0xb8b2('0x12a')])){loggerBooked[_0xb8b2('0x9a')](_0xb8b2('0x12b'),_0x2d7bb4);}_0x7fe563[_0xb8b2('0x12a')]=!![];loggerBooked['info'](_0xb8b2('0x12c'),_0x2d7bb4,JSON[_0xb8b2('0x49')](_[_0xb8b2('0xcf')](_0x7fe563,[_0xb8b2('0x40'),'queueStatusComplete'])));},0x1f3);}Dialer['prototype'][_0xb8b2('0x3b')]=function(_0x25c180){var _0xfc10b8=this;var _0x2f6a9c=_0xfc10b8[_0xb8b2('0x1e')][_0xfc10b8[_0xb8b2('0x24')][_0x25c180[_0xb8b2('0x123')]]['queue']];if(strategy[this[_0xb8b2('0x1e')][this[_0xb8b2('0x24')][_0x25c180[_0xb8b2('0x123')]][_0xb8b2('0xb0')]][_0xb8b2('0x124')]]===_0xb8b2('0x125')){if(this[_0xb8b2('0x24')][_0x25c180[_0xb8b2('0x123')]]&&this[_0xb8b2('0x24')][_0x25c180['actionid']][_0xb8b2('0x128')]){this[_0xb8b2('0x1d')][_0xb8b2('0x12d')](this[_0xb8b2('0x24')][_0x25c180[_0xb8b2('0x123')]][_0xb8b2('0x12e')],this[_0xb8b2('0x24')][_0x25c180[_0xb8b2('0x123')]][_0xb8b2('0x128')])[_0xb8b2('0xad')](function(_0x1bc77c){logger[_0xb8b2('0x9a')]('[Catch][Preview][syncQueueStatusComplete]',util['inspect'](_0x1bc77c,{'showHidden':![],'depth':null}));})['finally'](function(){_0xfc10b8[_0xb8b2('0xaf')](_0xfc10b8['voiceQueues'][_0xfc10b8[_0xb8b2('0x24')][_0x25c180[_0xb8b2('0x123')]]['queue']]);_0xfc10b8['agents'][_0xfc10b8[_0xb8b2('0x24')][_0x25c180[_0xb8b2('0x123')]]['stateinterface']][_0xb8b2('0x126')]=![];delete _0xfc10b8['actions'][_0x25c180[_0xb8b2('0x123')]];unlockQueueStatus(_0x2f6a9c);});}else{this['updateOriginated'](this[_0xb8b2('0x1e')][this[_0xb8b2('0x24')][_0x25c180[_0xb8b2('0x123')]][_0xb8b2('0xb0')]]);this['rescheduleContact']({'active':![],'ContactId':this['actions'][_0x25c180['actionid']][_0xb8b2('0xd0')],'ListId':this['actions'][_0x25c180[_0xb8b2('0x123')]][_0xb8b2('0xd1')],'VoiceQueueId':this[_0xb8b2('0x24')][_0x25c180[_0xb8b2('0x123')]][_0xb8b2('0xd3')]||undefined,'CampaignId':this[_0xb8b2('0x24')][_0x25c180[_0xb8b2('0x123')]][_0xb8b2('0xd4')]||undefined})[_0xb8b2('0xad')](loggerCatch(_0xb8b2('0x12f')));delete this[_0xb8b2('0x24')][_0x25c180[_0xb8b2('0x123')]];unlockQueueStatus(_0x2f6a9c);}}else if((strategy[this[_0xb8b2('0x1e')][this['actions'][_0x25c180[_0xb8b2('0x123')]]['queue']][_0xb8b2('0x124')]]||'rrmemory')===_0xb8b2('0x18')){var _0x13b1fd;if(this[_0xb8b2('0x24')][_0x25c180['actionid']]&&!_[_0xb8b2('0x46')](this[_0xb8b2('0x2a')][this[_0xb8b2('0x24')][_0x25c180[_0xb8b2('0x123')]][_0xb8b2('0xb0')]])){if(this['queueBookedRR'][_0xfc10b8[_0xb8b2('0x24')][_0x25c180[_0xb8b2('0x123')]][_0xb8b2('0xb0')]]){this[_0xb8b2('0x2b')][_0xfc10b8['actions'][_0x25c180['actionid']][_0xb8b2('0xb0')]]=this['queueBookedRR'][this[_0xb8b2('0x24')][_0x25c180[_0xb8b2('0x123')]][_0xb8b2('0xb0')]]?this['queueBookedRR'][this['actions'][_0x25c180[_0xb8b2('0x123')]][_0xb8b2('0xb0')]]:this[_0xb8b2('0x2a')][this[_0xb8b2('0x24')][_0x25c180['actionid']]['queue']]?this[_0xb8b2('0x2a')][this['actions'][_0x25c180[_0xb8b2('0x123')]][_0xb8b2('0xb0')]][_0xb8b2('0x130')]||0x0:0x0;}this[_0xb8b2('0x2a')][this[_0xb8b2('0x24')][_0x25c180[_0xb8b2('0x123')]][_0xb8b2('0xb0')]]['_rr']=this['queueBookedRR'][this[_0xb8b2('0x24')][_0x25c180[_0xb8b2('0x123')]][_0xb8b2('0xb0')]];for(var _0x1c6ad1=0x0;_0x1c6ad1=0x0;})[_0xb8b2('0xad')](myreject(_0x1abf0d)));}}else{_0x3e96d4[_0xb8b2('0x129')](ami[_0xb8b2('0xaa')]({'action':'command','command':util['format'](_0xb8b2('0x14b'),_0x1e9dce,!_[_0xb8b2('0x89')](config[_0xb8b2('0x143')][_0x283739])?_0x283739:'')})[_0xb8b2('0xb4')](function(_0x25f28f){return _0x25f28f[_0xb8b2('0x14c')]['indexOf'](_0xb8b2('0x14a'))>=0x0;})[_0xb8b2('0xad')](myreject(_0x1abf0d)));}BPromise['all'](_0x3e96d4)[_0xb8b2('0xb4')](function(_0x3d8389){var _0x13b997=_[_0xb8b2('0x14d')](_0x3d8389);if(_0x13b997){return _0x2f8ba3(_0x13b997);}else{_0x38f000[_0xb8b2('0x3e')]=_0x24b2b6?'GLOBAL_INTERVAL_IS_OVERTIME':'INTERVAL_IS_OVERTIME';return _0x1abf0d(msgResponse(_0xb8b2('0x14e'),_0xb8b2('0x145'),_0xb8b2('0x14f')+_0x24b2b6+'\x20'+_0x4ad8c7+_0xb8b2('0x150')+util[_0xb8b2('0x99')](_0x1e9dce,{'showHidden':![],'depth':null})+_0xb8b2('0x151')+_0x283739));}})[_0xb8b2('0xad')](function(_0x16674b){return _0x1abf0d(msgResponse(_0xb8b2('0x13f'),'Failure',JSON[_0xb8b2('0x49')](_0x16674b)));});});};Dialer[_0xb8b2('0x19')][_0xb8b2('0x152')]=function(_0x38e3c9){var _0x2f3122=this;return function(){switch(_0x38e3c9[_0xb8b2('0x5a')]){case _0xb8b2('0x153'):freeVariablesPredictive(_0x38e3c9);_0x2f3122['handlePower'](_0x38e3c9,0x1);break;case _0xb8b2('0x154'):freeVariablesPredictive(_0x38e3c9);_0x2f3122[_0xb8b2('0x155')](_0x38e3c9,_0x38e3c9[_0xb8b2('0x156')]);break;case _0xb8b2('0xa'):_0x2f3122['predictive'](_0x38e3c9);break;case _0xb8b2('0x9'):freeVariablesPredictive(_0x38e3c9);_0x2f3122[_0xb8b2('0x155')](_0x38e3c9,0x1);break;default:freeVariablesPredictive(_0x38e3c9);logger[_0xb8b2('0x9a')]('Queue',_0x38e3c9['name'],_0xb8b2('0x157'));}};};Dialer[_0xb8b2('0x19')][_0xb8b2('0x158')]=function(_0x51611e){var _0x8e62d0=this;return function(){_0x8e62d0[_0xb8b2('0x159')](_0x51611e);};};Dialer[_0xb8b2('0x19')][_0xb8b2('0xb')]=function(_0x187a20){var _0x24a57c=this;if(isNotPreview(_0x187a20[_0xb8b2('0x5a')])){if(isVoiceQueueOutbound(_0x187a20['type'])&&isActive(_0x187a20['dialActive'])){_0x187a20[_0xb8b2('0x9d')]=!![];BPromise[_0xb8b2('0xb3')]()[_0xb8b2('0xb4')](checkIsLoggedIn(_0x187a20,_0x187a20[_0xb8b2('0x51')]))[_0xb8b2('0xb4')](checkIsActive(_0x187a20,_0x187a20['dialActive']))[_0xb8b2('0xb4')](checkInterval(_0x187a20))[_0xb8b2('0xb4')](_0x24a57c['checkIsTrunkReachable'](_0x187a20))[_0xb8b2('0xb4')](_0x24a57c[_0xb8b2('0x13e')](_0x187a20['dialGlobalInterval'],_0x187a20[_0xb8b2('0x15a')],_0x187a20['name'],_0x187a20))[_0xb8b2('0xb4')](_0x24a57c[_0xb8b2('0x140')](_0x187a20[_0xb8b2('0x42')],_0x187a20[_0xb8b2('0x15a')],_0x187a20[_0xb8b2('0x40')],_0x187a20))[_0xb8b2('0xb4')](_0x24a57c[_0xb8b2('0x152')](_0x187a20))[_0xb8b2('0xad')](loggerCatchQueueSummary('[syncQueueSummary]',_0x187a20));}else{notSendMessagesQueue(_0x187a20);}}else{freeVariablesPredictive(_0x187a20);}};Dialer[_0xb8b2('0x19')][_0xb8b2('0x13b')]=function(){var _0x1b8ce6=this;var _0x5a6269;for(var _0x1c00a6 in this[_0xb8b2('0x1f')]){if(typeof this[_0xb8b2('0x1f')][_0x1c00a6]!==_0xb8b2('0xa9')){_0x5a6269=this[_0xb8b2('0x1f')][_0x1c00a6];if(isCampaignIvr(_0x5a6269[_0xb8b2('0x4e')])&&isActive(_0x5a6269[_0xb8b2('0x7a')])){_0x5a6269[_0xb8b2('0x9d')]=!![];BPromise[_0xb8b2('0xb3')]()[_0xb8b2('0xb4')](checkIsActive(_0x5a6269,_0x5a6269['active']))[_0xb8b2('0xb4')](checkInterval(_0x5a6269))[_0xb8b2('0xb4')](_0x1b8ce6[_0xb8b2('0x13c')](_0x5a6269))[_0xb8b2('0xb4')](_0x1b8ce6['checkIfTime'](_0x5a6269[_0xb8b2('0x15b')],_0x5a6269[_0xb8b2('0x15a')],_0x5a6269[_0xb8b2('0x40')],_0x5a6269))[_0xb8b2('0xb4')](_0x1b8ce6[_0xb8b2('0x140')](_0x5a6269[_0xb8b2('0x42')],_0x5a6269[_0xb8b2('0x15a')],_0x5a6269[_0xb8b2('0x40')],_0x5a6269))[_0xb8b2('0xb4')](_0x1b8ce6[_0xb8b2('0x158')](_0x5a6269))['catch'](loggerCatchQueueSummary(_0xb8b2('0x15c'),_0x5a6269));}else{notSendMessagesCampaign(_0x5a6269);}}}};function getCallerIdRandom(_0x5b2885,_0x48ea66){var _0x4b6ef8;var _0x179d91;var _0x578bfe;if(_0x48ea66<=0x0){_0x48ea66=0x1;}_0x4b6ef8=new RegExp(_0xb8b2('0x15d')+_0x48ea66+'}$');_0x179d91=Math[_0xb8b2('0x15e')](0xa,_0x48ea66-0x1);_0x578bfe=Math[_0xb8b2('0x15e')](0xa,_0x48ea66)-0x1;return util['format']('%s',_[_0xb8b2('0x15f')](_0x5b2885,_0x4b6ef8,_[_0xb8b2('0x160')](_0x179d91,_0x578bfe)));}function extractCalleridName(_0x464993){var _0x345712=_0x464993[_0xb8b2('0x161')](/"(.*?)"/);return _0x345712?_0x345712[0x1]:_0x464993;}function extractCalleridNumber(_0xe225f4){var _0x8057d8=_0xe225f4[_0xb8b2('0x161')](/<(.*?)>/);return _0x8057d8?_0x8057d8[0x1]:_0xe225f4;}Dialer['prototype'][_0xb8b2('0x162')]=function(_0x47aa7f,_0x173099){var _0x2f06c=this;var _0x34f126=uuid['v4']();this[_0xb8b2('0x24')][_0x34f126]=new Action(_0x47aa7f,_0x173099,_0x34f126);return new BPromise(function(_0x4c6c14,_0x17449d){if(_['isUndefined'](_0x47aa7f)&&typeof _0x47aa7f!==_0xb8b2('0x163')){return _0x17449d(msgResponse(_0xb8b2('0x164'),_0xb8b2('0x145'),_0xb8b2('0x165')));}if(_[_0xb8b2('0x89')](_0x173099[_0xb8b2('0x166')][_0xb8b2('0x167')])||_0x173099['Contact']['phone']===null){return _0x17449d(msgResponse(_0xb8b2('0x164'),_0xb8b2('0x145'),_0xb8b2('0x168')));}var _0x4d79a7={'XMD-CALLERID':_0x2f06c[_0xb8b2('0x24')][_0x34f126][_0xb8b2('0x169')](),'XMD-AGI':_0x47aa7f[_0xb8b2('0x106')]?util['format'](_0xb8b2('0x16a'),ipAgi,_0x47aa7f[_0xb8b2('0x106')]):_0xb8b2('0x16b'),'XMD-AGIAFTER':_0x47aa7f[_0xb8b2('0x118')]?util[_0xb8b2('0x7c')](_0xb8b2('0x16a'),ipAgi,_0x47aa7f[_0xb8b2('0x118')]):'NONE','XMD-QUEUE':_0x47aa7f[_0xb8b2('0x4e')]===_0xb8b2('0x96')?util[_0xb8b2('0x7c')]('\x22%s,%s%s,,,%s\x22',_0x47aa7f[_0xb8b2('0x40')],_0x47aa7f['dialQueueOptions']||'',_0x47aa7f[_0xb8b2('0x10d')]?'c':'',_0x47aa7f[_0xb8b2('0x115')]||0x3):_0xb8b2('0x16b'),'XMD-CONTACTID':_0x173099[_0xb8b2('0xd0')],'XMD-CDRTYPE':_0xb8b2('0x16c'),'CALLERID(all)':_0x2f06c[_0xb8b2('0x24')][_0x34f126][_0xb8b2('0x169')](),'XMD-AMD':_0x47aa7f[_0xb8b2('0xe0')]?_0xb8b2('0x16d'):_0xb8b2('0x16b'),'XMD-DESTINATION':'xcally-motion-dialer'};if(_0x47aa7f[_0xb8b2('0xe0')]){_0x4d79a7[_0xb8b2('0x16e')]=_0x47aa7f[_0xb8b2('0x16f')]||0x9c4;_0x4d79a7[_0xb8b2('0x170')]=_0x47aa7f['dialAMDGreeting']||0x5dc;_0x4d79a7['XMD-AMDAFTERGREETINGSILENCE']=_0x47aa7f[_0xb8b2('0x171')]||0x320;_0x4d79a7[_0xb8b2('0x172')]=_0x47aa7f[_0xb8b2('0x173')]||0x1388;_0x4d79a7['XMD-AMDMINWORDLENGTH']=_0x47aa7f[_0xb8b2('0x174')]||0x64;_0x4d79a7[_0xb8b2('0x175')]=_0x47aa7f['dialAMDBetweenWordsSilence']||0x32;_0x4d79a7[_0xb8b2('0x176')]=_0x47aa7f[_0xb8b2('0x177')]||0x3;_0x4d79a7['XMD-AMDSILENCETHRESHOLD']=_0x47aa7f[_0xb8b2('0x178')]||0x100;_0x4d79a7[_0xb8b2('0x179')]=_0x47aa7f[_0xb8b2('0x17a')]||0x1388;}if(_0x47aa7f[_0xb8b2('0x4e')]===_0xb8b2('0x96')){_0x4d79a7[_0xb8b2('0x17b')]=_0x173099[_0xb8b2('0xd3')];}else{_0x4d79a7[_0xb8b2('0x17c')]=_0x173099[_0xb8b2('0xd4')];}for(var _0x3bee81 in _0x173099['Contact']){if(typeof _0x173099[_0xb8b2('0x166')][_0x3bee81]!==_0xb8b2('0xa9')){if(isNotNull(_0x173099[_0xb8b2('0x166')][_0x3bee81])&&_0x3bee81!=='id'&&_0x3bee81!=='tags'&&_0x3bee81!==_0xb8b2('0x17d')&&_0x3bee81!==_0xb8b2('0x17e')){_0x4d79a7[util[_0xb8b2('0x7c')](_0xb8b2('0x17f'),_0xb8b2('0x180'),_[_0xb8b2('0x181')](_0x3bee81))]=_0x173099[_0xb8b2('0x166')][_0x3bee81];}}}var _0xe6011a=_0x2f06c[_0xb8b2('0xd8')](_0x47aa7f[_0xb8b2('0x79')])?getCallerId(_0x47aa7f[_0xb8b2('0x79')]['callerid'],_0x47aa7f['dialOriginateCallerIdName'],_0x47aa7f[_0xb8b2('0x182')]>0x0?getCallerIdRandom(_0x47aa7f[_0xb8b2('0x183')],_0x47aa7f[_0xb8b2('0x182')]):_0x47aa7f['dialOriginateCallerIdNumber']):getCallerId(_[_0xb8b2('0xdc')](_0x47aa7f[_0xb8b2('0x13d')])?_0x47aa7f[_0xb8b2('0x79')][_0xb8b2('0x7b')]:_0x47aa7f['TrunkBackup'][_0xb8b2('0x7b')],_0x47aa7f[_0xb8b2('0x5b')],_0x47aa7f['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x47aa7f[_0xb8b2('0x183')],_0x47aa7f['dialRandomLastDigitCallerIdNumber']):_0x47aa7f[_0xb8b2('0x183')]);if(_0xe6011a){_0x4d79a7[_0xb8b2('0x184')]=_0x2f06c[_0xb8b2('0x24')][_0x34f126]['originatecalleridname']=extractCalleridName(_0xe6011a);_0x4d79a7['XMD-ORIGINATECALLERIDNUM']=_0x2f06c[_0xb8b2('0x24')][_0x34f126][_0xb8b2('0x185')]=extractCalleridNumber(_0xe6011a);}return ami[_0xb8b2('0xaa')]({'actionid':_0x34f126,'action':'originate','channel':_0x2f06c[_0xb8b2('0xd8')](_0x47aa7f[_0xb8b2('0x79')])?util[_0xb8b2('0x7c')](_0xb8b2('0x186'),_0x47aa7f[_0xb8b2('0x79')][_0xb8b2('0x40')],isNotNull(_0x47aa7f[_0xb8b2('0x5d')])?_0x47aa7f[_0xb8b2('0x5d')][_0xb8b2('0x187')]()||'':'',_0x47aa7f[_0xb8b2('0x188')]>0x0?_0x173099[_0xb8b2('0x166')][_0xb8b2('0x167')][_0xb8b2('0x189')](_0x47aa7f['dialCutDigit']):_0x173099['Contact']['phone']):util['format'](_0xb8b2('0x186'),_[_0xb8b2('0xdc')](_0x47aa7f[_0xb8b2('0x13d')])?_0x47aa7f[_0xb8b2('0x79')]['name']:_0x47aa7f[_0xb8b2('0x13d')]['name'],isNotNull(_0x47aa7f[_0xb8b2('0x5d')])?_0x47aa7f[_0xb8b2('0x5d')][_0xb8b2('0x187')]()||'':'',_0x47aa7f[_0xb8b2('0x188')]>0x0?_0x173099[_0xb8b2('0x166')][_0xb8b2('0x167')][_0xb8b2('0x189')](_0x47aa7f[_0xb8b2('0x188')]):_0x173099[_0xb8b2('0x166')]['phone']),'callerid':_0xe6011a,'Exten':_0xb8b2('0xdf'),'Context':'from-sip','Priority':'1','variable':_0x4d79a7,'timeout':(_0x47aa7f[_0xb8b2('0x5c')]||0x1e)*0x3e8,'async':!![],'channelid':_0x34f126})[_0xb8b2('0xb4')](function(_0x6d3b6e){return _0x4c6c14(_0x6d3b6e);})['catch'](function(_0x4ce30a){_0x47aa7f[_0xb8b2('0x66')]+=0x1;var _0x305349=new History(_0x2f06c['actions'][_0x34f126]);logger[_0xb8b2('0x9a')](util[_0xb8b2('0x7c')]('[originateError]:\x20%s',JSON[_0xb8b2('0x49')](_0x4ce30a)));_0x305349['state']=0xe;_0x305349['statedesc']=_0xb8b2('0x18a');_0x305349[_0xb8b2('0xa5')]=moment()[_0xb8b2('0x7c')]('YYYY-MM-DD\x20HH:mm:ss');_0x305349['endtime']=_0x305349[_0xb8b2('0xa5')];_0x2f06c['createHistory'](_0x305349)['catch'](loggerCatch(_0xb8b2('0x18b')));_0x2f06c[_0xb8b2('0xc6')](_0x305349)[_0xb8b2('0xad')](loggerCatch(_0xb8b2('0x18b')))[_0xb8b2('0x135')](function(){delete _0x2f06c[_0xb8b2('0x24')][_0x34f126];return _0x17449d(msgResponse(_0xb8b2('0x164'),'Error','originate\x20action\x20Error'));});});});};Dialer[_0xb8b2('0x19')]['syncOriginateResponse']=function(_0x322279){var _0x194371=this['actions'][_0x322279['actionid']];if(_0x194371){delete this[_0xb8b2('0x24')][_0x322279[_0xb8b2('0x123')]];_0x194371['responsetime']=moment()[_0xb8b2('0x7c')](_0xb8b2('0xfa'));var _0x2da6ad=_0x194371['type']===_0xb8b2('0x7f')?this['campaigns'][_0x194371[_0xb8b2('0xb0')]]:this[_0xb8b2('0x1e')][_0x194371[_0xb8b2('0x18c')]()];if(!this[_0xb8b2('0x18d')](_0x322279[_0xb8b2('0x18e')])){this['updateOriginated'](_0x2da6ad);return this[_0xb8b2('0x18f')](_0x194371,_0x2da6ad,_0x322279)['catch'](loggerCatch(_0xb8b2('0x190')));}this[_0xb8b2('0x26')][_0x322279['uniqueid']]=_0x194371;}};Dialer[_0xb8b2('0x19')][_0xb8b2('0x191')]=function(_0x453308,_0x4a5ede,_0x8ea52f){var _0x3ff5e8=new History(_0x4a5ede);if(_0x3ff5e8[_0xb8b2('0xed')]+_0x3ff5e8[_0xb8b2('0xee')]+_0x3ff5e8[_0xb8b2('0xef')]+_0x3ff5e8[_0xb8b2('0xf0')]+_0x3ff5e8[_0xb8b2('0xf1')]+_0x3ff5e8[_0xb8b2('0xf2')]+_0x3ff5e8[_0xb8b2('0xea')]+_0x3ff5e8[_0xb8b2('0x192')]>=_0x8ea52f[_0xb8b2('0xf3')]-0x1){return!![];}switch(_0x453308){case 0x3:if(_0x3ff5e8[_0xb8b2('0xef')]>=_0x8ea52f[_0xb8b2('0x193')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countnoanswerretry':_0x3ff5e8[_0xb8b2('0xef')]+=0x1,'scheduledat':moment()[_0xb8b2('0xf8')](_0x8ea52f[_0xb8b2('0x194')],_0xb8b2('0x102'))[_0xb8b2('0x7c')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3ff5e8[_0xb8b2('0xd0')],'ListId':_0x3ff5e8['ListId'],'VoiceQueueId':_0x3ff5e8[_0xb8b2('0xd3')]||undefined,'CampaignId':_0x3ff5e8[_0xb8b2('0xd4')]||undefined})[_0xb8b2('0xad')](loggerCatch(_0xb8b2('0x195')));break;case 0x5:if(_0x3ff5e8[_0xb8b2('0xed')]>=_0x8ea52f['dialBusyMaxRetry']-0x1){return!![];}this[_0xb8b2('0xf7')]({'active':![],'countbusyretry':_0x3ff5e8['countbusyretry']+=0x1,'scheduledat':moment()['add'](_0x8ea52f['dialBusyRetryFrequency'],_0xb8b2('0x102'))[_0xb8b2('0x7c')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3ff5e8[_0xb8b2('0xd0')],'ListId':_0x3ff5e8[_0xb8b2('0xd1')],'VoiceQueueId':_0x3ff5e8[_0xb8b2('0xd3')]||undefined,'CampaignId':_0x3ff5e8[_0xb8b2('0xd4')]||undefined})[_0xb8b2('0xad')](loggerCatch('[rescheduleContact]\x20[Busy]'));break;case 0x8:if(_0x3ff5e8[_0xb8b2('0xee')]>=_0x8ea52f['dialCongestionMaxRetry']-0x1){return!![];}this[_0xb8b2('0xf7')]({'active':![],'countcongestionretry':_0x3ff5e8[_0xb8b2('0xee')]+=0x1,'scheduledat':moment()[_0xb8b2('0xf8')](_0x8ea52f[_0xb8b2('0x196')],_0xb8b2('0x102'))[_0xb8b2('0x7c')](_0xb8b2('0xfa')),'ContactId':_0x3ff5e8[_0xb8b2('0xd0')],'ListId':_0x3ff5e8[_0xb8b2('0xd1')],'VoiceQueueId':_0x3ff5e8['VoiceQueueId']||undefined,'CampaignId':_0x3ff5e8[_0xb8b2('0xd4')]||undefined})[_0xb8b2('0xad')](loggerCatch(_0xb8b2('0x197')));break;case 0x0:if(_0x3ff5e8[_0xb8b2('0xf0')]>=_0x8ea52f[_0xb8b2('0x198')]-0x1){return!![];}else{this[_0xb8b2('0xf7')]({'active':![],'countnosuchnumberretry':_0x3ff5e8['countnosuchnumberretry']+=0x1,'scheduledat':moment()[_0xb8b2('0xf8')](_0x8ea52f[_0xb8b2('0x199')],_0xb8b2('0x102'))[_0xb8b2('0x7c')](_0xb8b2('0xfa')),'ContactId':_0x3ff5e8[_0xb8b2('0xd0')],'ListId':_0x3ff5e8['ListId'],'VoiceQueueId':_0x3ff5e8[_0xb8b2('0xd3')]||undefined,'CampaignId':_0x3ff5e8[_0xb8b2('0xd4')]||undefined})[_0xb8b2('0xad')](loggerCatch(_0xb8b2('0x19a')));}break;case 0xa:if(_0x3ff5e8[_0xb8b2('0xf1')]>=_0x8ea52f['dialDropMaxRetry']-0x1){return!![];}this[_0xb8b2('0xf7')]({'active':![],'countdropretry':_0x3ff5e8[_0xb8b2('0xf1')]+=0x1,'scheduledat':moment()['add'](_0x8ea52f[_0xb8b2('0x11a')],_0xb8b2('0x102'))[_0xb8b2('0x7c')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3ff5e8[_0xb8b2('0xd0')],'ListId':_0x3ff5e8[_0xb8b2('0xd1')],'VoiceQueueId':_0x3ff5e8['VoiceQueueId']||undefined,'CampaignId':_0x3ff5e8['CampaignId']||undefined})[_0xb8b2('0xad')](loggerCatch(_0xb8b2('0x11b')));break;case 0xb:if(_0x3ff5e8['countabandonedretry']>=_0x8ea52f['dialAbandonedMaxRetry']-0x1){return!![];}this[_0xb8b2('0xf7')]({'active':![],'countabandonedretry':_0x3ff5e8[_0xb8b2('0xf2')]+=0x1,'scheduledat':moment()[_0xb8b2('0xf8')](_0x8ea52f[_0xb8b2('0x19b')],'minutes')[_0xb8b2('0x7c')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3ff5e8[_0xb8b2('0xd0')],'ListId':_0x3ff5e8[_0xb8b2('0xd1')],'VoiceQueueId':_0x3ff5e8[_0xb8b2('0xd3')]||undefined,'CampaignId':_0x3ff5e8[_0xb8b2('0xd4')]||undefined})[_0xb8b2('0xad')](loggerCatch(_0xb8b2('0x19c')));break;case 0x13:if(_0x3ff5e8[_0xb8b2('0xea')]>=_0x8ea52f[_0xb8b2('0xf5')]-0x1){return!![];}this[_0xb8b2('0xf7')]({'active':![],'countmachineretry':_0x3ff5e8[_0xb8b2('0xea')]+=0x1,'scheduledat':moment()[_0xb8b2('0xf8')](_0x8ea52f[_0xb8b2('0xf9')],_0xb8b2('0x102'))[_0xb8b2('0x7c')](_0xb8b2('0xfa')),'ContactId':_0x3ff5e8['ContactId'],'ListId':_0x3ff5e8['ListId'],'VoiceQueueId':_0x3ff5e8['VoiceQueueId']||undefined,'CampaignId':_0x3ff5e8[_0xb8b2('0xd4')]||undefined})[_0xb8b2('0xad')](loggerCatch(_0xb8b2('0xfb')));break;case 0x14:if(_0x3ff5e8[_0xb8b2('0x192')]>=_0x8ea52f[_0xb8b2('0x19d')]-0x1){return!![];}this[_0xb8b2('0xf7')]({'active':![],'countagentrejectretry':_0x3ff5e8['countagentrejectretry']+=0x1,'scheduledat':moment()[_0xb8b2('0xf8')](_0x8ea52f[_0xb8b2('0x19e')],_0xb8b2('0x102'))[_0xb8b2('0x7c')](_0xb8b2('0xfa')),'ContactId':_0x3ff5e8['ContactId'],'ListId':_0x3ff5e8[_0xb8b2('0xd1')],'VoiceQueueId':_0x3ff5e8[_0xb8b2('0xd3')]||undefined,'CampaignId':_0x3ff5e8[_0xb8b2('0xd4')]||undefined})[_0xb8b2('0xad')](loggerCatch('[rescheduleContact][AgentReject]'));break;default:return!![];}};Dialer[_0xb8b2('0x19')][_0xb8b2('0x18f')]=function(_0x27bda2,_0x30b807,_0x3afca0){var _0x2c0f9c=this;var _0xc3713a=new History(_0x27bda2);return new BPromise(function(_0x257443,_0x3c3bb0){if(_[_0xb8b2('0x89')](_0x30b807)&&typeof _0x30b807!==_0xb8b2('0x163')){return _0x3c3bb0(msgResponse(_0xb8b2('0x19f'),_0xb8b2('0x145'),_0xb8b2('0x1a0')));}if(_['isUndefined'](_0x3afca0)&&typeof _0x3afca0!==_0xb8b2('0x163')){return _0x3c3bb0(msgResponse(_0xb8b2('0x19f'),_0xb8b2('0x145'),_0xb8b2('0x1a1')));}switch(_0x3afca0['reason']){case'0':_0x30b807[_0xb8b2('0x1a2')]+=0x1;_0xc3713a[_0xb8b2('0xa3')]=0x0;_0xc3713a[_0xb8b2('0xe3')]=_0xb8b2('0x1a3');_0xc3713a[_0xb8b2('0xf0')]+=0x1;_0xc3713a['countglobal']+=0x1;ami[_0xb8b2('0x4d')](_0xb8b2('0x1a4'),ut[_0xb8b2('0xe5')](_0x27bda2,_0xb8b2('0x1a5')));_0x2c0f9c[_0xb8b2('0xc8')](_0xc3713a)['catch'](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x2c0f9c[_0xb8b2('0x191')](0x0,_0x27bda2,_0x30b807)){if(_0xc3713a[_0xb8b2('0xf0')]>=_0x30b807[_0xb8b2('0x198')]){_0x2c0f9c[_0xb8b2('0xf6')](_0xc3713a,_0x257443,_0x3c3bb0,_0xb8b2('0x1a6'));}else{_0x2c0f9c[_0xb8b2('0x100')](_0xc3713a,_0x257443,_0x3c3bb0,'reason\x200\x20no\x20such\x20number....');}}break;case'3':_0x30b807[_0xb8b2('0x1a7')]+=0x1;_0xc3713a[_0xb8b2('0xa3')]=0x3;_0xc3713a[_0xb8b2('0xe3')]=_0xb8b2('0x1a8');_0xc3713a['countnoanswerretry']+=0x1;_0xc3713a['countglobal']+=0x1;ami[_0xb8b2('0x4d')]('custom:agentnoanswer',ut[_0xb8b2('0xe5')](_0x27bda2,_0xb8b2('0x1a9')));_0x2c0f9c[_0xb8b2('0xc8')](_0xc3713a)[_0xb8b2('0xad')](loggerCatch('[syncAgentComplete][createHistory][3]'));if(_0x2c0f9c['checkRetriveMax'](0x3,_0x27bda2,_0x30b807)){if(_0xc3713a['countnoanswerretry']>=_0x30b807['dialNoAnswerMaxRetry']){_0x2c0f9c['createStateFinal'](_0xc3713a,_0x257443,_0x3c3bb0,_0xb8b2('0x1aa'));}else{_0x2c0f9c['stateGlobal'](_0xc3713a,_0x257443,_0x3c3bb0,_0xb8b2('0x1aa'));}}break;case'5':_0x30b807[_0xb8b2('0x61')]+=0x1;_0xc3713a[_0xb8b2('0xa3')]=0x5;_0xc3713a[_0xb8b2('0xe3')]=_0xb8b2('0x1ab');_0xc3713a[_0xb8b2('0xed')]+=0x1;_0xc3713a['countglobal']+=0x1;ami[_0xb8b2('0x4d')](_0xb8b2('0x1ac'),ut[_0xb8b2('0xe5')](_0x27bda2,_0xb8b2('0x1ad')));_0x2c0f9c['createHistory'](_0xc3713a)[_0xb8b2('0xad')](loggerCatch(_0xb8b2('0x1ae')));if(_0x2c0f9c[_0xb8b2('0x191')](0x5,_0x27bda2,_0x30b807)){if(_0xc3713a[_0xb8b2('0xed')]>=_0x30b807['dialBusyMaxRetry']){_0x2c0f9c[_0xb8b2('0xf6')](_0xc3713a,_0x257443,_0x3c3bb0,_0xb8b2('0x1af'));}else{_0x2c0f9c[_0xb8b2('0x100')](_0xc3713a,_0x257443,_0x3c3bb0,_0xb8b2('0x1af'));}}break;case'8':_0x30b807['outboundCongestionCallsDay']+=0x1;_0xc3713a['state']=0x8;_0xc3713a[_0xb8b2('0xe3')]=_0xb8b2('0x1b0');_0xc3713a['countcongestionretry']+=0x1;_0xc3713a[_0xb8b2('0xeb')]+=0x1;ami[_0xb8b2('0x4d')](_0xb8b2('0x1b1'),ut[_0xb8b2('0xe5')](_0x27bda2,_0xb8b2('0x1b2')));_0x2c0f9c['createHistory'](_0xc3713a)[_0xb8b2('0xad')](loggerCatch(_0xb8b2('0x1b3')));if(_0x2c0f9c[_0xb8b2('0x191')](0x8,_0x27bda2,_0x30b807)){if(_0xc3713a['countcongestionretry']>=_0x30b807[_0xb8b2('0x1b4')]){_0x2c0f9c['createStateFinal'](_0xc3713a,_0x257443,_0x3c3bb0,_0xb8b2('0x1b5'));}else{_0x2c0f9c['stateGlobal'](_0xc3713a,_0x257443,_0x3c3bb0,'reason\x208\x20congestion');}}break;case'11':_0x30b807[_0xb8b2('0x1b6')]+=0x1;_0xc3713a[_0xb8b2('0xa3')]=0xb;_0xc3713a[_0xb8b2('0xe3')]=_0xb8b2('0x120');_0xc3713a[_0xb8b2('0xf2')]+=0x1;_0xc3713a[_0xb8b2('0xeb')]+=0x1;_0x2c0f9c[_0xb8b2('0xc8')](_0xc3713a)[_0xb8b2('0xad')](loggerCatch(_0xb8b2('0x1b7')));if(_0x2c0f9c[_0xb8b2('0x191')](0xb,_0x27bda2,_0x30b807)){if(_0xc3713a[_0xb8b2('0xf2')]>=_0x30b807[_0xb8b2('0x122')]){_0x2c0f9c[_0xb8b2('0xf6')](_0xc3713a,_0x257443,_0x3c3bb0,_0xb8b2('0x1b8'));}else{_0x2c0f9c['stateGlobal'](_0xc3713a,_0x257443,_0x3c3bb0,'reason\x2011\x20abandoned');}}break;case'20':_0x30b807[_0xb8b2('0x67')]+=0x1;_0xc3713a[_0xb8b2('0xa3')]=0x14;_0xc3713a[_0xb8b2('0xe3')]=_0xb8b2('0x1b9');_0xc3713a[_0xb8b2('0x192')]+=0x1;_0xc3713a[_0xb8b2('0xeb')]+=0x1;ami[_0xb8b2('0x4d')](_0xb8b2('0x1ba'),ut[_0xb8b2('0xe5')](_0x27bda2,_0xb8b2('0x1bb')));_0x2c0f9c[_0xb8b2('0xc8')](_0xc3713a)[_0xb8b2('0xad')](loggerCatch(_0xb8b2('0x1bc')));if(_0x2c0f9c[_0xb8b2('0x191')](0x14,_0x27bda2,_0x30b807)){if(_0xc3713a[_0xb8b2('0x192')]>=_0x30b807[_0xb8b2('0x19d')]){_0x2c0f9c[_0xb8b2('0xf6')](_0xc3713a,_0x257443,_0x3c3bb0,_0xb8b2('0x1bd'));}else{_0x2c0f9c[_0xb8b2('0x100')](_0xc3713a,_0x257443,_0x3c3bb0,_0xb8b2('0x1bd'));}}break;default:_0x30b807[_0xb8b2('0x68')]+=0x1;_0xc3713a['state']=0xc;_0xc3713a[_0xb8b2('0xe3')]=_0x3afca0[_0xb8b2('0x10a')];_0x2c0f9c[_0xb8b2('0xc8')](_0xc3713a)[_0xb8b2('0xad')](loggerCatch(_0xb8b2('0x1be')));if(_0x2c0f9c[_0xb8b2('0x191')](_0x3afca0[_0xb8b2('0x10a')],_0x27bda2,_0x30b807)){if(_0xc3713a[_0xb8b2('0xed')]+_0xc3713a[_0xb8b2('0xee')]+_0xc3713a[_0xb8b2('0xef')]+_0xc3713a[_0xb8b2('0xf0')]+_0xc3713a['countdropretry']+_0xc3713a[_0xb8b2('0xf2')]+_0xc3713a[_0xb8b2('0xea')]+_0xc3713a[_0xb8b2('0x192')]>=_0x30b807[_0xb8b2('0xf3')]){_0x2c0f9c[_0xb8b2('0x100')](_0xc3713a,_0x257443,_0x3c3bb0,_0x3afca0[_0xb8b2('0x10a')]);}else{_0x2c0f9c[_0xb8b2('0xf6')](_0xc3713a,_0x257443,_0x3c3bb0,_0x3afca0[_0xb8b2('0x10a')]);}}}});};Dialer[_0xb8b2('0x19')][_0xb8b2('0x100')]=function(_0x95576a,_0x4be636,_0x1db294,_0x3e14bc){var _0x5dbf56=new Final(_0x95576a);_0x5dbf56[_0xb8b2('0xa3')]=0xf;_0x5dbf56[_0xb8b2('0xe3')]=_0xb8b2('0x1bf');this[_0xb8b2('0xf6')](_0x5dbf56,_0x4be636,_0x1db294,_0x3e14bc);};Dialer['prototype']['createStateFinal']=function(_0x6cf04f,_0x14e0de,_0x190369,_0x253f87){this[_0xb8b2('0xc6')](_0x6cf04f)['then'](function(){return _0x14e0de(msgResponse(_0xb8b2('0x19f'),_0xb8b2('0xd7'),_0x253f87));})[_0xb8b2('0xad')](function(){return _0x190369(msgResponse(_0xb8b2('0x1c0'),'Failure','contact\x20not\x20moved'));});};Dialer[_0xb8b2('0x19')]['predictive']=function(_0x144c84){var _0x278d15=_0x144c84[_0xb8b2('0x1c1')]/0x64;var _0x575c68=_0x144c84[_0xb8b2('0x65')]/(_0x144c84['outboundDropCallsDayTimeout']+_0x144c84[_0xb8b2('0x5f')]);var _0x4e2158=Math['round'](_0x144c84[_0xb8b2('0x72')]*(_0x144c84[_0xb8b2('0x1c2')]/0x64));var _0x5bb127=Math[_0xb8b2('0x1c3')](_0x144c84['predictiveIntervalAvailable']*(_0x144c84[_0xb8b2('0x1c4')]/0x64));var _0x5ed469=_0x144c84['available']+_0x144c84[_0xb8b2('0x54')];var _0x5d4690=Math[_0xb8b2('0x1c5')](_0x144c84[_0xb8b2('0x75')]*_0x144c84[_0xb8b2('0x76')]*_0x144c84[_0xb8b2('0x6f')]*_0x144c84['predictiveIntervalMultiplicativeFactor']);if(_['isUndefined'](_0x144c84[_0xb8b2('0x28')])){if(!_['isUndefined'](_0x144c84['startPredictive'])){_0x144c84['startPredictive']=undefined;loggerPredictive[_0xb8b2('0x9a')]('[startMethodPredictive][StartProgressive]',_0xb8b2('0x1c6'));}if(!_[_0xb8b2('0x89')](_0x144c84[_0xb8b2('0x94')])){loggerPredictive[_0xb8b2('0x9a')](_0xb8b2('0x1c7'),_0xb8b2('0x1c8'));clearInterval(_0x144c84[_0xb8b2('0x94')]);_0x144c84['handlePredictive']=undefined;}_0x144c84[_0xb8b2('0x28')]=moment()[_0xb8b2('0x7c')](_0xb8b2('0xfa'));loggerPredictive[_0xb8b2('0x82')](_0x144c84['name'],_0xb8b2('0x1c9'),_0x144c84['startProgressive']);this[_0xb8b2('0x155')](_0x144c84,0x1);}else if(ifInterval(_0x144c84[_0xb8b2('0x1ca')],_0x144c84[_0xb8b2('0x28')])){this[_0xb8b2('0x155')](_0x144c84,0x1);loggerPredictiveCalls[_0xb8b2('0x82')](_0xb8b2('0x1cb'),_0x144c84[_0xb8b2('0x28')],_0x144c84[_0xb8b2('0x40')]);_0x144c84['erlangCalls']=0x0;_0x144c84[_0xb8b2('0x6e')]=0x0;}else if(_0x278d15<_0x575c68&&_0x144c84[_0xb8b2('0x1cc')]===_0xb8b2('0x1cd')){freeVariablesPredictive(_0x144c84);loggerPredictive['info']('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]',_0xb8b2('0x1ce'),_0x575c68,_0xb8b2('0x28'),_0x144c84[_0xb8b2('0x40')]);}else if(_0x5d4690<_0x144c84[_0xb8b2('0x6e')]&&_0x144c84[_0xb8b2('0x1cc')]==='dropRate'){freeVariablesPredictive(_0x144c84);loggerPredictive[_0xb8b2('0x82')](_0xb8b2('0x1cf'),_0xb8b2('0x1d0'),_0x5d4690,_0xb8b2('0x1d1'),_0x144c84[_0xb8b2('0x6e')],_0xb8b2('0x28'),_0x144c84['name']);}else if(!ifInterval(_0x144c84['dialPredictiveInterval'],_0x144c84[_0xb8b2('0x28')])&&_[_0xb8b2('0x89')](_0x144c84[_0xb8b2('0x78')])&&!_['isUndefined'](_0x144c84['startProgressive'])){_0x144c84[_0xb8b2('0x78')]=moment()[_0xb8b2('0x7c')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0xb8b2('0x82')](_0x144c84[_0xb8b2('0x40')],_0xb8b2('0x1d2'),_0x144c84[_0xb8b2('0x78')]);this[_0xb8b2('0xba')](_0x144c84['dialPredictiveInterval'])[_0xb8b2('0xb4')](this[_0xb8b2('0x1d3')](_0x144c84))[_0xb8b2('0xb4')](mergeDataErlangB(_0x144c84))[_0xb8b2('0xb4')](this[_0xb8b2('0x1d4')](_0x144c84))[_0xb8b2('0xad')](loggerCatchPredictive(_0xb8b2('0x1d5'),_0x144c84));}else if(!ifInterval(_0x144c84[_0xb8b2('0x1ca')],_0x144c84[_0xb8b2('0x78')])){_0x144c84[_0xb8b2('0x6e')]=0x0;_0x144c84[_0xb8b2('0x78')]=moment()['format'](_0xb8b2('0xfa'));loggerPredictive[_0xb8b2('0x82')](_0x144c84[_0xb8b2('0x40')],_0xb8b2('0x1d6'),_0x144c84[_0xb8b2('0x78')]);clearInterval(_0x144c84[_0xb8b2('0x94')]);_0x144c84['handlePredictive']=undefined;this[_0xb8b2('0xba')](_0x144c84['dialPredictiveInterval'])['then'](this[_0xb8b2('0x1d3')](_0x144c84))[_0xb8b2('0xb4')](mergeDataErlangB(_0x144c84))[_0xb8b2('0xb4')](this['startMethodPredictive'](_0x144c84))['catch'](loggerCatchPredictive(_0xb8b2('0x1d7'),_0x144c84));}else if(_0x144c84['predictiveIntervalAvailable']&&_0x5ed469<_0x144c84[_0xb8b2('0x72')]-_0x5bb127){freeVariablesPredictive(_0x144c84);loggerPredictive[_0xb8b2('0x82')](_0x144c84[_0xb8b2('0x40')],_0xb8b2('0x1d8'),_0x5ed469,')\x20are\x20less\x20than\x20threshold\x20(',_0x144c84[_0xb8b2('0x72')],'-',_0x5bb127,'=',_0x144c84[_0xb8b2('0x72')]-_0x5bb127,')');}else if(_0x144c84[_0xb8b2('0x72')]&&_0x5ed469>_0x144c84[_0xb8b2('0x72')]+_0x4e2158){freeVariablesPredictive(_0x144c84);loggerPredictive[_0xb8b2('0x82')](_0x144c84[_0xb8b2('0x40')],_0xb8b2('0x1d8'),_0x5ed469,_0xb8b2('0x1d9'),_0x144c84[_0xb8b2('0x72')],'+',_0x4e2158,'=',_0x144c84[_0xb8b2('0x72')]+_0x4e2158,')');}};Dialer[_0xb8b2('0x19')][_0xb8b2('0x1d3')]=function(_0x599184){var _0x2c0c4c=this;return function(_0x55da76){return new BPromise(function(_0x148428,_0x187b80){_[_0xb8b2('0x92')](_0x599184,_0x55da76[0x0]);if(checkGetDataPredictive(_0x55da76[0x0])){var _0x221955=_0x599184[_0xb8b2('0x72')]=_0x599184[_0xb8b2('0x54')]+_0x599184[_0xb8b2('0x50')];var _0x9a91b6=_0x599184[_0xb8b2('0x1ca')]*0x3c;var _0x426117=_0x55da76[0x0][_0xb8b2('0x6b')]+_0x55da76[0x0]['predictiveIntervalAvgHoldtime'];var _0x188203=(_0x55da76[0x0][_0xb8b2('0x69')]+_0x55da76[0x0][_0xb8b2('0x6c')]+_0x55da76[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x55da76[0x0][_0xb8b2('0x73')];_0x599184['predictiveIntervalHitRate']=_0x188203>0x0?_0x188203:0x1;switch(_0x599184[_0xb8b2('0x1cc')]){case _0xb8b2('0x1cd'):var _0x1759d8=_0x599184[_0xb8b2('0x1c1')]/0x64;return _0x2c0c4c[_0xb8b2('0x1da')](_0x221955,_0x9a91b6,_0x426117,_0x188203,_0x1759d8)['then'](function(_0x3bbbbb){return _0x148428(_0x3bbbbb);});case _0xb8b2('0x1db'):var _0x40e9aa=_0x599184[_0xb8b2('0x1c1')]/0x64;return _0x2c0c4c[_0xb8b2('0x1dc')](_0x221955,_0x9a91b6,_0x426117,_0x188203,_0x40e9aa)[_0xb8b2('0xb4')](function(_0x518256){return _0x148428(_0x518256);});default:return _0x187b80(msgResponse(_0xb8b2('0x1dd'),_0xb8b2('0x145'),'Unknown\x20Predictive'));}}else{return _0x187b80(msgResponse(_0xb8b2('0x1dd'),'Failure',_0xb8b2('0x1de')));}});};};Dialer[_0xb8b2('0x19')][_0xb8b2('0x1df')]=function(_0x58a33d){var _0x37938d=this;return function(_0x1f098f){return new BPromise(function(_0x32e02a,_0x17fcf0){_[_0xb8b2('0x92')](_0x58a33d,_0x1f098f[0x0]);if(checkGetDataPredictive(_0x1f098f[0x0])){loggerPredictive['info'](JSON[_0xb8b2('0x49')](_0x1f098f[0x0]));if(_0x58a33d[_0xb8b2('0x1cc')]===_0xb8b2('0x1cd')){return _0x37938d[_0xb8b2('0xc4')](_0x58a33d['id'])[_0xb8b2('0xb4')](function(_0x3298d7){var _0x379e76=_0x58a33d[_0xb8b2('0x51')]-_0x3298d7[0x0]['outboundQueuePauses'];var _0x432587=_0x58a33d[_0xb8b2('0x1ca')]*0x3c;var _0x30d1a7=_0x1f098f[0x0]['predictiveIntervalAvgTalktime']+_0x1f098f[0x0]['predictiveIntervalAvgHoldtime'];var _0x3ef6b4=(_0x1f098f[0x0][_0xb8b2('0x69')]+_0x1f098f[0x0][_0xb8b2('0x6c')]+_0x1f098f[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x1f098f[0x0][_0xb8b2('0x73')];var _0x1e942e=_0x58a33d['dialPredictiveOptimizationPercentage']/0x64;_0x58a33d[_0xb8b2('0x71')]=_0x3298d7[0x0][_0xb8b2('0x1e0')]||0x0;_0x58a33d[_0xb8b2('0x6f')]=_0x3ef6b4>0x0?_0x3ef6b4:0x1;return _0x37938d[_0xb8b2('0x1da')](_0x379e76,_0x432587,_0x30d1a7,_0x3ef6b4,_0x1e942e);})[_0xb8b2('0xb4')](function(_0x373424){return _0x32e02a(_0x373424);})[_0xb8b2('0xad')](function(_0x309653){return _0x17fcf0(msgResponse(_0xb8b2('0x1e1'),_0xb8b2('0x145'),JSON[_0xb8b2('0x49')](_0x309653)));});}if(_0x58a33d['dialPredictiveOptimization']===_0xb8b2('0x1db')){return _0x37938d['getVoiceQueueRtPauses'](_0x58a33d['id'])['then'](function(_0x4f2519){var _0x4bcf98=_0x58a33d['loggedIn']-_0x4f2519[0x0]['outboundQueuePauses'];var _0x19c6a5=_0x58a33d[_0xb8b2('0x1ca')]*0x3c;var _0x51c864=_0x1f098f[0x0][_0xb8b2('0x6b')]+_0x1f098f[0x0][_0xb8b2('0x6a')];var _0x15ccba=(_0x1f098f[0x0][_0xb8b2('0x69')]+_0x1f098f[0x0][_0xb8b2('0x6c')]+_0x1f098f[0x0][_0xb8b2('0x86')])/_0x1f098f[0x0][_0xb8b2('0x73')];var _0x146a56=_0x58a33d['dialPredictiveOptimizationPercentage']/0x64;_0x58a33d[_0xb8b2('0x71')]=_0x4f2519[0x0][_0xb8b2('0x1e0')]||0x0;_0x58a33d['predictiveIntervalHitRate']=_0x15ccba>0x0?_0x15ccba:0x1;return _0x37938d['busyFactor'](_0x4bcf98,_0x19c6a5,_0x51c864,_0x15ccba,_0x146a56);})[_0xb8b2('0xb4')](function(_0x58015f){return _0x32e02a(_0x58015f);})['catch'](function(_0x156c48){return _0x17fcf0(msgResponse(_0xb8b2('0x1e1'),_0xb8b2('0x145'),JSON[_0xb8b2('0x49')](_0x156c48)));});}}else{return _0x17fcf0(msgResponse(_0xb8b2('0x1dd'),_0xb8b2('0x145'),_0xb8b2('0x1de')));}});};};Dialer[_0xb8b2('0x19')][_0xb8b2('0x1d4')]=function(_0x98d655){var _0x14ac97=this;return function(){var _0x52dfa7=0x0;var _0xb8ed7f=Math[_0xb8b2('0x1c5')](_0x98d655[_0xb8b2('0x8f')]*0x3e8);if(_0xb8ed7f>0x0){_0xb8ed7f=_0xb8ed7f<0x64?0x64:_0xb8ed7f;loggerPredictive['info'](_0x98d655[_0xb8b2('0x40')],'one\x20call\x20every:',_0xb8ed7f,'milliseconds');_0x98d655[_0xb8b2('0x94')]=setInterval(function(){_0x14ac97['handlePredictive'](_0x98d655);loggerPredictiveCalls[_0xb8b2('0x82')](_0xb8b2('0x1e2'),_0x52dfa7+=0x1);},_0xb8ed7f);}else{loggerPredictive[_0xb8b2('0x82')](_0x98d655[_0xb8b2('0x40')],_0xb8b2('0x1e3'));}};};Dialer['prototype'][_0xb8b2('0x1e4')]=function(_0x5d2631,_0x245be3){var _0x52f610=this;return function(_0x21c937){if(_[_0xb8b2('0x46')](_0x21c937)){if(_['isNil'](_0x245be3[_0xb8b2('0xd2')])||!_0x245be3[_0xb8b2('0x1e5')]){if(_0x5d2631[_0xb8b2('0x5a')]===_0xb8b2('0x9')){_0x5d2631[_0xb8b2('0x12a')]=_[_0xb8b2('0x89')](_0x5d2631[_0xb8b2('0x12a')])?!![]:_0x5d2631[_0xb8b2('0x12a')];var _0x594cdf=uuid['v4']();_0x52f610[_0xb8b2('0x24')][_0x594cdf]=new Action(_0x5d2631,_0x245be3,_0x594cdf);loggerBooked[_0xb8b2('0x82')](_0xb8b2('0x1e6'),_0x594cdf,_0xb8b2('0x1e7'),JSON['stringify'](_0x5d2631[_0xb8b2('0x12a')]),'Queue:\x20',_0x5d2631[_0xb8b2('0x40')]);if(_0x5d2631[_0xb8b2('0x12a')]){_0x5d2631[_0xb8b2('0x12a')]=![];_0x52f610[_0xb8b2('0x2a')][_0x52f610[_0xb8b2('0x24')][_0x594cdf][_0xb8b2('0xb0')]]=[];ami[_0xb8b2('0xaa')]({'actionid':_0x594cdf,'action':_0xb8b2('0x1e8'),'queue':_0x5d2631['name']})[_0xb8b2('0xad')](function(){_0x52f610[_0xb8b2('0xaf')](_0x5d2631);_0x52f610['rescheduleContact']({'active':![],'ContactId':_0x52f610[_0xb8b2('0x24')][_0x594cdf][_0xb8b2('0xd0')],'ListId':_0x52f610[_0xb8b2('0x24')][_0x594cdf]['ListId'],'VoiceQueueId':_0x52f610[_0xb8b2('0x24')][_0x594cdf][_0xb8b2('0xd3')]||undefined,'CampaignId':_0x52f610[_0xb8b2('0x24')][_0x594cdf][_0xb8b2('0xd4')]||undefined})[_0xb8b2('0xad')](loggerCatch(_0xb8b2('0x1e9')));delete _0x52f610[_0xb8b2('0x24')][_0x594cdf];});}else{loggerBooked['info'](_0xb8b2('0x1ea'),JSON[_0xb8b2('0x49')](_0x5d2631['queueStatusComplete']),_0xb8b2('0x1eb'),_0x5d2631['name']);_0x52f610[_0xb8b2('0xaf')](_0x5d2631);_0x52f610[_0xb8b2('0xf7')]({'active':![],'ContactId':_0x52f610['actions'][_0x594cdf]['ContactId'],'ListId':_0x52f610['actions'][_0x594cdf]['ListId'],'VoiceQueueId':_0x52f610[_0xb8b2('0x24')][_0x594cdf][_0xb8b2('0xd3')]||undefined,'CampaignId':_0x52f610[_0xb8b2('0x24')][_0x594cdf]['CampaignId']||undefined})[_0xb8b2('0xad')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x52f610[_0xb8b2('0x24')][_0x594cdf];}}else{return _0x52f610['actionOriginate'](_0x5d2631,_0x245be3);}}else{if(getDiff(_0x245be3[_0xb8b2('0x1ec')])<_0x5d2631[_0xb8b2('0x1ed')]*0x3c){if(_0x245be3[_0xb8b2('0x1ee')]&&!_0x245be3[_0xb8b2('0x1ee')][_0xb8b2('0x1ef')]){_0x52f610[_0xb8b2('0x1d')]['run'](_0x245be3['id'])[_0xb8b2('0x135')](function(){_0x52f610[_0xb8b2('0xaf')](_0x5d2631);});}else{_0x52f610[_0xb8b2('0xbe')]({'active':![]},_0x245be3['id'],0x1)['finally'](function(){_0x52f610[_0xb8b2('0xaf')](_0x5d2631);});}}else{_0x5d2631[_0xb8b2('0x1f0')]+=0x1;_0x52f610[_0xb8b2('0xaf')](_0x5d2631);if(_0x5d2631[_0xb8b2('0x1f1')]){_0x52f610[_0xb8b2('0xf7')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x245be3[_0xb8b2('0xd0')],'ListId':_0x245be3[_0xb8b2('0xd1')],'VoiceQueueId':_0x245be3[_0xb8b2('0xd3')]||undefined,'CampaignId':_0x245be3['CampaignId']||undefined})['catch'](loggerCatch('[rescheduleContact][dialRecallInQueue]'));_0x52f610['createHistory'](createObjHistory(_0x5d2631,_0x245be3,_0xb8b2('0x1f2'),0x17,'RecallInQueue'))[_0xb8b2('0xad')](loggerCatch(_0xb8b2('0x1f3')));}else{_0x52f610[_0xb8b2('0xce')](createObjHistory(_0x5d2631,_0x245be3,'RECALLFAILEDTIMEOUT',0x16,'RecallFailedTimeout'),_0xb8b2('0x1f4'),'[Originate][HistoryRecallClose]');}}}}else{_0x5d2631['outboundBlacklistCallsDay']+=0x1;_0x52f610[_0xb8b2('0xce')](createObjHistory(_0x5d2631,_0x245be3,'BLACKLIST',0xd,_0xb8b2('0x1f5')),_0xb8b2('0x1f6'),_0xb8b2('0x1f7'));throw _0xb8b2('0x1f8');}};};Dialer[_0xb8b2('0x19')][_0xb8b2('0x159')]=function(_0x1f5646){var _0x3c3d0c=this;var _0x2e4f06=_0x1f5646[_0xb8b2('0x1f9')]-_0x1f5646[_0xb8b2('0x74')]-_0x1f5646['temp'];emitCampaignSummary(_0x1f5646);if(_0x2e4f06>0x0){if(_0x2e4f06>this[_0xb8b2('0x22')]){_0x2e4f06=this[_0xb8b2('0x22')];}_0x1f5646['temp']+=_0x2e4f06;this['getContactDialerIvr'](_0x1f5646['id'],_0x2e4f06,_0x1f5646[_0xb8b2('0x1fa')],_0x1f5646)[_0xb8b2('0xb4')](function(_0x20ec8f){_0x1f5646[_0xb8b2('0xc1')]-=_0x2e4f06;_0x1f5646[_0xb8b2('0xc1')]=_0x1f5646[_0xb8b2('0xc1')]>0x0?_0x1f5646[_0xb8b2('0xc1')]:0x0;if(!checkContactEmpty(_0x20ec8f)){_0x1f5646['message']='AVAILABLE_CONTACTS_FINISHED';logger['info'](_0xb8b2('0x1fb')+_0x1f5646[_0xb8b2('0x40')]);}else{_0x1f5646[_0xb8b2('0x74')]+=_0x20ec8f[_0xb8b2('0x147')];_0x1f5646['message']=_0xb8b2('0x1fc');for(var _0x3cff33=0x0;_0x3cff33<_0x20ec8f[_0xb8b2('0x147')];_0x3cff33+=0x1){_0x1f5646[_0xb8b2('0x1fd')]+=0x1;if(_[_0xb8b2('0xdc')](_0x20ec8f[_0x3cff33])||_['isNil'](_0x20ec8f[_0x3cff33][_0xb8b2('0x166')])||_[_0xb8b2('0xdc')](_0x20ec8f[_0x3cff33]['Contact']['phone'])){_0x3c3d0c[_0xb8b2('0xcc')](_0xb8b2('0x1fe'),_0x1f5646,_0x20ec8f[_0x3cff33]);}else{_0x3c3d0c[_0xb8b2('0xb8')](_[_0xb8b2('0xcf')](_0x20ec8f[_0x3cff33],[_0xb8b2('0xd4'),_0xb8b2('0x1ff')]))[_0xb8b2('0xb4')](_0x3c3d0c[_0xb8b2('0x1e4')](_0x1f5646,_0x20ec8f[_0x3cff33]))[_0xb8b2('0xad')](_0x3c3d0c[_0xb8b2('0xcb')]('[actionOriginateIvr]\x20',_0x1f5646));}}}})['catch'](loggerGetContactDialer(_0xb8b2('0x200'),_0x1f5646,_0x2e4f06));}};Dialer['prototype'][_0xb8b2('0x155')]=function(_0xc1a924,_0x53f138){var _0x2975e5=this;var _0x41da7d=[];var _0x377af1=_0x53f138>=0x1?_0x53f138:0x1;if(_0xc1a924['dialMethod']===_0xb8b2('0x9')){_0x377af1=0x1;}var _0x39f298=Math[_0xb8b2('0x1c5')](_0xc1a924[_0xb8b2('0x50')]*_0x377af1)-_0xc1a924['originated']-_0xc1a924[_0xb8b2('0xc1')];emitVoiceQueueSummary(_0xc1a924);if(_0xc1a924['dialLimitQueue']>0x0){var _0xaa3867=_0xc1a924[_0xb8b2('0x201')]-_0xc1a924[_0xb8b2('0x74')]-_0xc1a924[_0xb8b2('0x54')]-_0xc1a924['temp']-_0xc1a924[_0xb8b2('0x52')];if(_0x39f298>_0xaa3867){_0x39f298=_0xaa3867;}}if(_0x39f298>0x0){if(_0xc1a924[_0xb8b2('0x5a')]===_0xb8b2('0x9')){_0x39f298=0x1;}if(_0x39f298>this[_0xb8b2('0x22')]){_0x39f298=this['maxNumberOriginate'];}_0xc1a924['temp']+=_0x39f298;for(var _0x21811d in this[_0xb8b2('0x20')]){if(typeof this[_0xb8b2('0x20')][_0x21811d]!==_0xb8b2('0xa9')){if(this['agents'][_0x21811d][_0xb8b2('0xa3')]===_0xb8b2('0x202')&&this[_0xb8b2('0x20')][_0x21811d][_0xb8b2('0xab')]===_0xb8b2('0x203')){_0x41da7d['push'](this[_0xb8b2('0x20')][_0x21811d]['id']);}}}this[_0xb8b2('0xc0')](_0xc1a924['id'],_0x41da7d,_0x39f298,_0xc1a924[_0xb8b2('0x1fa')],_0xc1a924)[_0xb8b2('0xb4')](function(_0x1504f5){_0xc1a924[_0xb8b2('0xc1')]-=_0x39f298;_0xc1a924[_0xb8b2('0xc1')]=_0xc1a924[_0xb8b2('0xc1')]>0x0?_0xc1a924[_0xb8b2('0xc1')]:0x0;if(!checkContactEmpty(_0x1504f5)){_0x2975e5[_0xb8b2('0xb2')](_0xc1a924)[_0xb8b2('0xb4')](sendMessageReschedule(_0xc1a924))[_0xb8b2('0xad')](loggerCatch(_0xb8b2('0xb5')));}else{_0xc1a924[_0xb8b2('0x74')]+=_0x1504f5['length'];_0xc1a924[_0xb8b2('0x3e')]=_0xc1a924[_0xb8b2('0x5a')]==='booked'?_0xb8b2('0x16d'):_0xb8b2('0x1fc');for(var _0x52e24=0x0;_0x52e24<_0x1504f5[_0xb8b2('0x147')];_0x52e24+=0x1){if(_[_0xb8b2('0xdc')](_0x1504f5[_0x52e24])||_[_0xb8b2('0xdc')](_0x1504f5[_0x52e24][_0xb8b2('0x166')])||_['isNil'](_0x1504f5[_0x52e24][_0xb8b2('0x166')]['phone'])){_0x2975e5[_0xb8b2('0xcc')](_0xb8b2('0x1fe'),_0xc1a924,_0x1504f5[_0x52e24]);}else{_0x2975e5[_0xb8b2('0xb6')](_['pick'](_0x1504f5[_0x52e24],['VoiceQueueId','Contact.phone']))[_0xb8b2('0xb4')](_0x2975e5['checkContactBlack'](_0xc1a924,_0x1504f5[_0x52e24]))[_0xb8b2('0xad')](_0x2975e5[_0xb8b2('0xcb')](_0xb8b2('0x1fe'),_0xc1a924));}}}})[_0xb8b2('0xad')](loggerGetContactDialer(_0xb8b2('0x204'),_0xc1a924,_0x39f298));}};Dialer[_0xb8b2('0x19')][_0xb8b2('0x94')]=function(_0x2369d8){if(_0x2369d8[_0xb8b2('0x201')]>0x0){var _0x5af0a3=_0x2369d8[_0xb8b2('0x201')]-_0x2369d8[_0xb8b2('0x74')]-_0x2369d8['talking'];if(_0x5af0a3>0x0){this[_0xb8b2('0x205')](_0x2369d8);}else{loggerPredictiveCalls[_0xb8b2('0x82')](_0xb8b2('0x206'));}}else{this[_0xb8b2('0x205')](_0x2369d8);}};Dialer[_0xb8b2('0x19')][_0xb8b2('0x205')]=function(_0x3a6273){var _0x34dd41=this;var _0x7a3382=[];_0x3a6273['originated']+=0x1;for(var _0x26755e in this[_0xb8b2('0x20')]){if(typeof this[_0xb8b2('0x20')][_0x26755e]!=='undefined'){if(this[_0xb8b2('0x20')][_0x26755e][_0xb8b2('0xa3')]===_0xb8b2('0x202')&&this[_0xb8b2('0x20')][_0x26755e][_0xb8b2('0xab')]===_0xb8b2('0x203')){_0x7a3382[_0xb8b2('0x129')](this['agents'][_0x26755e]['id']);}}}this['getContactDialer'](_0x3a6273['id'],_0x7a3382,0x1,_0x3a6273['dialOrderByScheduledAt'],_0x3a6273)[_0xb8b2('0xb4')](function(_0x149653){if(!checkContactEmpty(_0x149653)){checkContactLowerLimitOriginate(_0x3a6273,0x1,0x0);_0x34dd41[_0xb8b2('0xb2')](_0x3a6273)[_0xb8b2('0xb4')](sendMessageReschedule(_0x3a6273))[_0xb8b2('0xad')](loggerCatch(_0xb8b2('0xb5')));}else{_0x3a6273[_0xb8b2('0x3e')]=_0xb8b2('0x1fc');if(_['isNil'](_0x149653[0x0])||_[_0xb8b2('0xdc')](_0x149653[0x0]['Contact'])||_[_0xb8b2('0xdc')](_0x149653[0x0][_0xb8b2('0x166')]['phone'])){_0x34dd41['emptyContact']('[actionOriginate]\x20',_0x3a6273,_0x149653[0x0]);}else{_0x34dd41['checkIsBlackList'](_['pick'](_0x149653[0x0],[_0xb8b2('0xd3'),_0xb8b2('0x1ff')]))[_0xb8b2('0xb4')](_0x34dd41[_0xb8b2('0x1e4')](_0x3a6273,_0x149653[0x0]))[_0xb8b2('0xad')](_0x34dd41[_0xb8b2('0xcb')](_0xb8b2('0x207'),_0x3a6273));}}})[_0xb8b2('0xad')](loggerGetContactDialer(_0xb8b2('0x208'),_0x3a6273,0x1));emitVoiceQueueSummary(_0x3a6273);};Dialer[_0xb8b2('0x19')][_0xb8b2('0x1da')]=function(_0x454d66,_0x1336f3,_0x4b1b0c,_0x18052b,_0x5cafb5,_0x3aeca9){loggerPredictive[_0xb8b2('0x82')]('--------\x20Drop\x20Rate\x20--------');loggerPredictive[_0xb8b2('0x82')]('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',_0x454d66);loggerPredictive[_0xb8b2('0x82')](_0xb8b2('0x209'),_0x1336f3);loggerPredictive[_0xb8b2('0x82')](_0xb8b2('0x20a'),_0x4b1b0c);loggerPredictive[_0xb8b2('0x82')]('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',_0x18052b);loggerPredictive[_0xb8b2('0x82')](_0xb8b2('0x20b'),_0x5cafb5);loggerPredictive[_0xb8b2('0x82')](_0xb8b2('0x88'));return new BPromise(function(_0x4d6099,_0x215fc2){if(_0x454d66<=0x0||isNaN(_0x454d66)){return _0x215fc2(msgResponse(_0xb8b2('0x20c'),_0xb8b2('0x48'),_0xb8b2('0x20d')+_0x454d66));}if(_0x4b1b0c<=0x0||isNaN(_0x4b1b0c)){return _0x215fc2(msgResponse('[abandonmentRate]','Error',_0xb8b2('0x20e')+_0x4b1b0c));}if(_0x18052b<=0x0||isNaN(_0x18052b)){return _0x215fc2(msgResponse(_0xb8b2('0x20c'),_0xb8b2('0x48'),'p\x20=\x20'+_0x18052b));}if(_0x1336f3<=0x0||isNaN(_0x1336f3)){return _0x215fc2(msgResponse(_0xb8b2('0x20c'),_0xb8b2('0x48'),_0xb8b2('0x20f')+_0x1336f3));}if(_0x5cafb5<=0x0||isNaN(_0x5cafb5)){return _0x215fc2(msgResponse(_0xb8b2('0x20c'),'Error',_0xb8b2('0x210')+_0x5cafb5));}_0x3aeca9=_0x3aeca9||0x0;var _0xfc876f=0x1/_0x4b1b0c;var _0x37bc7a=0x0;var _0x475b9a=0x0;var _0x374206=0x0;var _0x384999=0x0;for(var _0x4f811f=0x0;_0x374206<_0x5cafb5;_0x4f811f+=0x1){_0x475b9a=_0x4f811f/_0x1336f3;_0x37bc7a=(_0x18052b*_0x475b9a+_0x3aeca9)/_0xfc876f;_0x374206=erlangb(_0x37bc7a,_0x454d66);_0x384999=_0x37bc7a/_0x454d66*(0x1-erlangb(_0x37bc7a,_0x454d66));}return _0x4d6099({'erlangCalls':_0x4f811f,'erlangCallToSecond':_0x1336f3/_0x4f811f,'erlangAbandonmentRate':_0x374206,'erlangBusyFactor':_0x384999});});};Dialer[_0xb8b2('0x19')][_0xb8b2('0x1dc')]=function(_0x3d9293,_0x40a0fd,_0xb72c3b,_0x445b9d,_0x1564fc,_0x2b2688){loggerPredictive[_0xb8b2('0x82')](_0xb8b2('0x211'));loggerPredictive['info']('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',_0x3d9293);loggerPredictive[_0xb8b2('0x82')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x40a0fd);loggerPredictive[_0xb8b2('0x82')](_0xb8b2('0x20a'),_0xb72c3b);loggerPredictive[_0xb8b2('0x82')](_0xb8b2('0x212'),_0x445b9d);loggerPredictive[_0xb8b2('0x82')]('Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1564fc);loggerPredictive['info'](_0xb8b2('0x88'));return new BPromise(function(_0x2d3da9,_0x48230d){if(_0x3d9293<=0x0||isNaN(_0x3d9293)){return _0x48230d(msgResponse('[busyFactor]',_0xb8b2('0x48'),_0xb8b2('0x20d')+_0x3d9293));}if(_0xb72c3b<=0x0||isNaN(_0xb72c3b)){return _0x48230d(msgResponse(_0xb8b2('0x213'),_0xb8b2('0x48'),_0xb8b2('0x20e')+_0xb72c3b));}if(_0x445b9d<=0x0||isNaN(_0x445b9d)){return _0x48230d(msgResponse(_0xb8b2('0x213'),_0xb8b2('0x48'),_0xb8b2('0x214')+_0x445b9d));}if(_0x40a0fd<=0x0||isNaN(_0x40a0fd)){return _0x48230d(msgResponse(_0xb8b2('0x213'),'Error','interval\x20=\x20'+_0x40a0fd));}if(_0x1564fc<=0x0||isNaN(_0x1564fc)){return _0x48230d(msgResponse(_0xb8b2('0x213'),_0xb8b2('0x48'),_0xb8b2('0x215')+_0x1564fc));}_0x2b2688=_0x2b2688||0x0;var _0x560927=0x1/_0xb72c3b;var _0xf1eebd=0x0;var _0x5d9b30=0x0;var _0x29e963=0x0;var _0x120ef0=0x0;for(var _0x4babc8=0x0;_0x120ef0<_0x1564fc;_0x4babc8+=0x1){_0x5d9b30=_0x4babc8/_0x40a0fd;_0xf1eebd=(_0x445b9d*_0x5d9b30+_0x2b2688)/_0x560927;_0x29e963=erlangb(_0xf1eebd,_0x3d9293);_0x120ef0=_0xf1eebd/_0x3d9293*(0x1-erlangb(_0xf1eebd,_0x3d9293));}return _0x2d3da9({'erlangCalls':_0x4babc8,'erlangCallToSecond':_0x40a0fd/_0x4babc8,'erlangAbandonmentRate':_0x29e963,'erlangBusyFactor':_0x120ef0});});};module[_0xb8b2('0x216')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index 80945a5..35eabca 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 _0x5e99=['type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','starttime','responsetime','droptime','endtime','ringtime','membername','reason','callback','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','milliseconds','diff','seconds','scheduledat'];(function(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0x5e99,0x19d));var _0x95e9=function(_0x16d7c6,_0x4338a4){_0x16d7c6=_0x16d7c6-0x0;var _0x2838ac=_0x5e99[_0x16d7c6];return _0x2838ac;};'use strict';var util=require(_0x95e9('0x0'));var _=require('lodash');var moment=require('moment');function getSeconds(_0x3c76ab,_0xb00c36){var _0x5218a2=moment(_0x3c76ab)[_0x95e9('0x1')](0x0);var _0x9f2137=moment(_0xb00c36)['milliseconds'](0x0);return _0x5218a2[_0x95e9('0x2')](_0x9f2137,_0x95e9('0x3'));}function QueueCallerAbandon(_0x4aa4ab,_0x2dd6f7){this[_0x95e9('0x4')]=_0x4aa4ab[_0x95e9('0x4')];this[_0x95e9('0x5')]=_0x4aa4ab[_0x95e9('0x5')];this['campaigntype']=_0x4aa4ab[_0x95e9('0x5')]===_0x95e9('0x6')?_0x95e9('0x7'):_0x4aa4ab[_0x95e9('0x5')];this[_0x95e9('0x8')]=_0x4aa4ab['countbusyretry'];this['countcongestionretry']=_0x4aa4ab[_0x95e9('0x9')];this[_0x95e9('0xa')]=_0x4aa4ab[_0x95e9('0xa')];this[_0x95e9('0xb')]=_0x4aa4ab[_0x95e9('0x8')]+_0x4aa4ab['countcongestionretry']+_0x4aa4ab['countnoanswerretry']+_0x4aa4ab[_0x95e9('0xc')]+_0x4aa4ab[_0x95e9('0xd')]+_0x4aa4ab[_0x95e9('0xe')]+_0x4aa4ab[_0x95e9('0xf')]+_0x4aa4ab[_0x95e9('0x10')];this[_0x95e9('0xc')]=_0x4aa4ab[_0x95e9('0xc')];this[_0x95e9('0xd')]=_0x4aa4ab[_0x95e9('0xd')];this[_0x95e9('0xe')]=_0x4aa4ab['countabandonedretry'];this[_0x95e9('0xf')]=_0x4aa4ab[_0x95e9('0xf')];this['countagentrejectretry']=_0x4aa4ab[_0x95e9('0x10')];this['uniqueid']=_0x2dd6f7[_0x95e9('0x11')];this[_0x95e9('0x12')]=_0x4aa4ab[_0x95e9('0x13')];this[_0x95e9('0x14')]=_0x4aa4ab['number'];this[_0x95e9('0x15')]=_0x4aa4ab['starttime'];this['responsetime']=_0x4aa4ab[_0x95e9('0x16')];this[_0x95e9('0x17')]=_0x4aa4ab['droptime'];this[_0x95e9('0x18')]=this[_0x95e9('0x17')];this[_0x95e9('0x19')]=getSeconds(_0x4aa4ab[_0x95e9('0x16')],_0x4aa4ab['starttime']);this['holdtime']=getSeconds(this[_0x95e9('0x17')],_0x4aa4ab['responsetime']);this['talktime']=0x0;this[_0x95e9('0x7')]=_0x2dd6f7['queue'];this[_0x95e9('0x1a')]=_0x2dd6f7['connectedlinename'];this[_0x95e9('0x1b')]=_0x2dd6f7['reason'];this[_0x95e9('0x1c')]=_0x4aa4ab[_0x95e9('0x1c')];this['callbackuniqueid']=_0x4aa4ab['callbackuniqueid'];this[_0x95e9('0x1d')]=_0x4aa4ab['callbackat'];this['recallme']=_0x4aa4ab[_0x95e9('0x1e')];this[_0x95e9('0x1f')]=_0x4aa4ab[_0x95e9('0x1f')];this[_0x95e9('0x20')]=_0x4aa4ab[_0x95e9('0x20')];this[_0x95e9('0x21')]=_0x4aa4ab[_0x95e9('0x21')];this['VoiceQueueId']=_0x4aa4ab[_0x95e9('0x22')];this[_0x95e9('0x23')]=_0x4aa4ab[_0x95e9('0x23')];this[_0x95e9('0x24')]=_0x4aa4ab['originatecalleridnum']||'';this['originatecalleridname']=_0x4aa4ab[_0x95e9('0x25')]||'';}module['exports']=QueueCallerAbandon; \ No newline at end of file +var _0xe70f=['type','campaigntype','outbound','countcongestionretry','countnoanswerretry','countglobal','countbusyretry','countdropretry','countabandonedretry','countmachineretry','countnosuchnumberretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','starttime','responsetime','droptime','ringtime','holdtime','talktime','queue','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','exports','moment','milliseconds','diff','seconds','scheduledat'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0xe70f,0x14b));var _0xfe70=function(_0x59efd7,_0x4267df){_0x59efd7=_0x59efd7-0x0;var _0x28cd47=_0xe70f[_0x59efd7];return _0x28cd47;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0xfe70('0x0'));function getSeconds(_0x16fe5a,_0xc35a72){var _0x1a0a90=moment(_0x16fe5a)[_0xfe70('0x1')](0x0);var _0x350f5d=moment(_0xc35a72)[_0xfe70('0x1')](0x0);return _0x1a0a90[_0xfe70('0x2')](_0x350f5d,_0xfe70('0x3'));}function QueueCallerAbandon(_0x3301eb,_0x343178){this['scheduledat']=_0x3301eb[_0xfe70('0x4')];this[_0xfe70('0x5')]=_0x3301eb['type'];this[_0xfe70('0x6')]=_0x3301eb['type']===_0xfe70('0x7')?'queue':_0x3301eb['type'];this['countbusyretry']=_0x3301eb['countbusyretry'];this[_0xfe70('0x8')]=_0x3301eb[_0xfe70('0x8')];this[_0xfe70('0x9')]=_0x3301eb['countnoanswerretry'];this[_0xfe70('0xa')]=_0x3301eb[_0xfe70('0xb')]+_0x3301eb['countcongestionretry']+_0x3301eb['countnoanswerretry']+_0x3301eb['countnosuchnumberretry']+_0x3301eb[_0xfe70('0xc')]+_0x3301eb[_0xfe70('0xd')]+_0x3301eb[_0xfe70('0xe')]+_0x3301eb['countagentrejectretry'];this[_0xfe70('0xf')]=_0x3301eb[_0xfe70('0xf')];this[_0xfe70('0xc')]=_0x3301eb[_0xfe70('0xc')];this['countabandonedretry']=_0x3301eb[_0xfe70('0xd')];this[_0xfe70('0xe')]=_0x3301eb[_0xfe70('0xe')];this['countagentrejectretry']=_0x3301eb[_0xfe70('0x10')];this[_0xfe70('0x11')]=_0x343178[_0xfe70('0x11')];this[_0xfe70('0x12')]=_0x3301eb[_0xfe70('0x13')];this[_0xfe70('0x14')]=_0x3301eb['number'];this[_0xfe70('0x15')]=_0x3301eb[_0xfe70('0x15')];this[_0xfe70('0x16')]=_0x3301eb[_0xfe70('0x16')];this['droptime']=_0x3301eb[_0xfe70('0x17')];this['endtime']=this[_0xfe70('0x17')];this[_0xfe70('0x18')]=getSeconds(_0x3301eb['responsetime'],_0x3301eb['starttime']);this[_0xfe70('0x19')]=getSeconds(this['droptime'],_0x3301eb[_0xfe70('0x16')]);this[_0xfe70('0x1a')]=0x0;this[_0xfe70('0x1b')]=_0x343178[_0xfe70('0x1b')];this[_0xfe70('0x1c')]=_0x343178[_0xfe70('0x1d')];this['reason']=_0x343178[_0xfe70('0x1e')];this[_0xfe70('0x1f')]=_0x3301eb[_0xfe70('0x1f')];this[_0xfe70('0x20')]=_0x3301eb[_0xfe70('0x20')];this[_0xfe70('0x21')]=_0x3301eb[_0xfe70('0x21')];this[_0xfe70('0x22')]=_0x3301eb[_0xfe70('0x22')];this[_0xfe70('0x23')]=_0x3301eb['ContactId'];this[_0xfe70('0x24')]=_0x3301eb[_0xfe70('0x24')];this[_0xfe70('0x25')]=_0x3301eb[_0xfe70('0x25')];this['VoiceQueueId']=_0x3301eb[_0xfe70('0x26')];this[_0xfe70('0x27')]=_0x3301eb[_0xfe70('0x27')];this[_0xfe70('0x28')]=_0x3301eb[_0xfe70('0x28')]||'';this['originatecalleridname']=_0x3301eb['originatecalleridname']||'';}module[_0xfe70('0x29')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index 330ad43..20b4bcb 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(_0x143f1c,_0x21d805){var _0x404d38=function(_0x3061c6){while(--_0x3061c6){_0x143f1c['push'](_0x143f1c['shift']());}};_0x404d38(++_0x21d805);}(_0xa9e0,0x123));var _0x0a9e=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xa9e0[_0x46aff0];return _0x9d78cf;};'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(_0x121fee,_0x334eb2){var _0x4957ee=function(_0x4deb95){while(--_0x4deb95){_0x121fee['push'](_0x121fee['shift']());}};_0x4957ee(++_0x334eb2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xa9e0[_0x5037ab];return _0x512adb;};'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 11fcf1c..aaa838c 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 _0xe133=['%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','addVariables','ext','isTrunkReachable','isNil','SIP/%s','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20path','Is\x20Valid','bluebird','moment','path','./util/gs','../../../config/logger','fax','./rpcDb','./channel','./util/util','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','newchannel','syncNewchannel','bind','varset','syncVarSet','newstate','syncNewState','newexten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','originateresponse','syncOriginateResponse','prototype','from-voip-provider','hasOwnProperty','exten','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','actions','variable','value','channelstate','channelstatedesc','syncNewExten','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','message','create','.pdf','application/pdf','parse','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','pick','response','AttachmentId','update','SENDING\x20FAILED\x20','then','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','syncHangup','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','faxstatusstring','send','execOriginate','FaxAccountId','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkTrunk','Trunk','isValid','format','execute'];(function(_0x209584,_0x3f06f0){var _0x4f3e4c=function(_0x139951){while(--_0x139951){_0x209584['push'](_0x209584['shift']());}};_0x4f3e4c(++_0x3f06f0);}(_0xe133,0x163));var _0x3e13=function(_0x5b4b54,_0x4eb635){_0x5b4b54=_0x5b4b54-0x0;var _0xe8e8a4=_0xe133[_0x5b4b54];return _0xe8e8a4;};'use strict';var util=require('util');var _=require('lodash');var BPromise=require(_0x3e13('0x0'));var uuid=require('uuid');var moment=require(_0x3e13('0x1'));var path=require(_0x3e13('0x2'));var tiff2pdf=require('tiff2pdf');var gs=require(_0x3e13('0x3'));var logger=require(_0x3e13('0x4'))(_0x3e13('0x5'));var ami=require('../ami');var rpcDb=require(_0x3e13('0x6'));var Channel=require(_0x3e13('0x7'));var ut=require(_0x3e13('0x8'));var Action=require(_0x3e13('0x9'));var faxAccount=require(_0x3e13('0xa'));var attachment=require(_0x3e13('0xb'));var faxMessage=require(_0x3e13('0xc'));function Fax(_0x318651){this[_0x3e13('0xd')]={};this[_0x3e13('0xe')]=_0x318651[_0x3e13('0xe')];this[_0x3e13('0xf')]=_0x318651['trunks'];this['actions']={};ami['on'](_0x3e13('0x10'),this[_0x3e13('0x11')][_0x3e13('0x12')](this));ami['on'](_0x3e13('0x13'),this[_0x3e13('0x14')][_0x3e13('0x12')](this));ami['on'](_0x3e13('0x15'),this[_0x3e13('0x16')][_0x3e13('0x12')](this));ami['on'](_0x3e13('0x17'),this['syncNewExten'][_0x3e13('0x12')](this));ami['on'](_0x3e13('0x18'),this[_0x3e13('0x19')][_0x3e13('0x12')](this));ami['on'](_0x3e13('0x1a'),this[_0x3e13('0x1b')][_0x3e13('0x12')](this));ami['on']('hangup',this['syncHangup'][_0x3e13('0x12')](this));ami['on'](_0x3e13('0x1c'),this[_0x3e13('0x1d')][_0x3e13('0x12')](this));}Fax[_0x3e13('0x1e')][_0x3e13('0x11')]=function(_0x3a31d5){if(_0x3a31d5['context']===_0x3e13('0x1f')){for(var _0x4cc527 in this['faxAccounts']){if(this['faxAccounts'][_0x3e13('0x20')](_0x4cc527)){if(_0x3a31d5[_0x3e13('0x21')]===this[_0x3e13('0xe')][_0x4cc527][_0x3e13('0x22')]){this[_0x3e13('0xd')][_0x3a31d5[_0x3e13('0x23')]]={};this['channels'][_0x3a31d5[_0x3e13('0x23')]][_0x3e13('0x24')]=_0x3a31d5['channel'];this['channels'][_0x3a31d5[_0x3e13('0x23')]]['id']=this[_0x3e13('0xe')][_0x4cc527]['id'];this[_0x3e13('0xd')][_0x3a31d5['uniqueid']][_0x3e13('0x25')]=this[_0x3e13('0xe')][_0x4cc527][_0x3e13('0x25')];logger[_0x3e13('0x26')](_0x3a31d5[_0x3e13('0x23')],_0x3e13('0x27'));}}}}if(this[_0x3e13('0x28')][_0x3a31d5['uniqueid']]){this['channels'][_0x3a31d5[_0x3e13('0x23')]]={};this[_0x3e13('0xd')][_0x3a31d5[_0x3e13('0x23')]][_0x3e13('0x24')]=_0x3a31d5[_0x3e13('0x24')];logger[_0x3e13('0x26')](_0x3a31d5[_0x3e13('0x23')],_0x3e13('0x27'));}};Fax[_0x3e13('0x1e')][_0x3e13('0x14')]=function(_0x19112d){if(this[_0x3e13('0xd')][_0x19112d[_0x3e13('0x23')]]){for(var _0x3a078b in _0x19112d[_0x3e13('0x29')]){if(_0x19112d['variable']['hasOwnProperty'](_0x3a078b)){this[_0x3e13('0xd')][_0x19112d[_0x3e13('0x23')]][_0x3a078b]=_0x19112d[_0x3e13('0x2a')];}}}};Fax[_0x3e13('0x1e')]['syncNewState']=function(_0x24e9f2){if(this[_0x3e13('0xd')][_0x24e9f2[_0x3e13('0x23')]]){this[_0x3e13('0xd')][_0x24e9f2['uniqueid']][_0x3e13('0x2b')]=_0x24e9f2[_0x3e13('0x2b')];this['channels'][_0x24e9f2[_0x3e13('0x23')]][_0x3e13('0x2c')]=_0x24e9f2['channelstatedesc'];}};Fax['prototype'][_0x3e13('0x2d')]=function(_0x39df24){if(this['channels'][_0x39df24[_0x3e13('0x23')]]){for(var _0x56ea44 in _0x39df24[_0x3e13('0x29')]){if(_0x39df24['variable'][_0x3e13('0x20')](_0x56ea44)){this[_0x3e13('0xd')][_0x39df24[_0x3e13('0x23')]][_0x56ea44]=_0x39df24['value'];}}}};Fax['prototype'][_0x3e13('0x19')]=function(_0x4dfcc7){if(this[_0x3e13('0xd')][_0x4dfcc7[_0x3e13('0x23')]]){this['channels'][_0x4dfcc7[_0x3e13('0x23')]][_0x3e13('0x2e')]=_0x4dfcc7[_0x3e13('0x2e')];this['channels'][_0x4dfcc7[_0x3e13('0x23')]][_0x3e13('0x2f')]=_0x4dfcc7[_0x3e13('0x2f')];this[_0x3e13('0xd')][_0x4dfcc7[_0x3e13('0x23')]][_0x3e13('0x22')]=_0x4dfcc7[_0x3e13('0x22')];this[_0x3e13('0xd')][_0x4dfcc7[_0x3e13('0x23')]][_0x3e13('0x30')]=_0x4dfcc7[_0x3e13('0x30')];logger[_0x3e13('0x26')](_0x4dfcc7[_0x3e13('0x23')],_0x3e13('0x31'));}};Fax['prototype']['syncReceiveFax']=function(_0x799ef4){var _0x360eac=this;if(this['channels'][_0x799ef4[_0x3e13('0x23')]]){var _0x1c6cbe=this[_0x3e13('0xd')][_0x799ef4[_0x3e13('0x23')]]['id'];this[_0x3e13('0xd')][_0x799ef4[_0x3e13('0x23')]][_0x3e13('0x32')]=_0x799ef4[_0x3e13('0x32')];this[_0x3e13('0xd')][_0x799ef4['uniqueid']][_0x3e13('0x33')]=_0x799ef4[_0x3e13('0x33')];this[_0x3e13('0xd')][_0x799ef4[_0x3e13('0x23')]][_0x3e13('0x22')]=_0x799ef4[_0x3e13('0x22')];this['channels'][_0x799ef4[_0x3e13('0x23')]][_0x3e13('0x34')]=_0x799ef4['resolution'];this[_0x3e13('0xd')][_0x799ef4[_0x3e13('0x23')]][_0x3e13('0x35')]=_0x799ef4[_0x3e13('0x35')];this[_0x3e13('0xd')][_0x799ef4['uniqueid']][_0x3e13('0x30')]=_0x799ef4[_0x3e13('0x30')];this['channels'][_0x799ef4[_0x3e13('0x23')]][_0x3e13('0x36')]=_0x799ef4[_0x3e13('0x36')];if(this['channels'][_0x799ef4[_0x3e13('0x23')]]['pagestransferred']>0x0){tiff2pdf(_0x799ef4[_0x3e13('0x30')],_0x3e13('0x37'),function(_0x13585e){logger[_0x3e13('0x26')](_0x799ef4['uniqueid'],'\x20result\x20conversion\x20file\x20',_0x13585e[_0x3e13('0x38')]);attachment[_0x3e13('0x39')]({'name':path['parse'](_0x799ef4[_0x3e13('0x30')])['name'],'basename':path['parse'](_0x799ef4['filename'])['name']+_0x3e13('0x3a'),'type':_0x3e13('0x3b')})['then'](function(_0x14390a){faxAccount['notify'](_0x1c6cbe,{'from':_0x799ef4[_0x3e13('0x36')],'mapKey':'fax','body':path[_0x3e13('0x3c')](_0x799ef4[_0x3e13('0x30')])['name']+_0x3e13('0x3a'),'AttachmentId':_0x14390a['id']})[_0x3e13('0x3d')](function(_0x3fa584){logger[_0x3e13('0x3e')](_0x799ef4['uniqueid'],_0x3e13('0x3f'),JSON[_0x3e13('0x40')](_0x3fa584));});})[_0x3e13('0x3d')](function(_0x4e5ab6){logger[_0x3e13('0x3e')](_0x799ef4['uniqueid'],'\x20receiveFax\x20',JSON[_0x3e13('0x40')](_0x4e5ab6));});});}logger['info'](_0x799ef4[_0x3e13('0x23')],_0x3e13('0x41'));}};Fax[_0x3e13('0x1e')][_0x3e13('0x1d')]=function(_0x3d36c2){if(this[_0x3e13('0x28')][_0x3d36c2['uniqueid']]){_['merge'](this[_0x3e13('0xd')][_0x3d36c2[_0x3e13('0x23')]],_[_0x3e13('0x42')](_0x3d36c2,[_0x3e13('0x43'),'reason']));}};function updateStatus(_0x22a318){if(_0x22a318[_0x3e13('0x44')]){faxMessage[_0x3e13('0x45')](_0x22a318['AttachmentId'],{'failMessage':_0x3e13('0x46')})[_0x3e13('0x47')](function(_0x1f9d18){ut[_0x3e13('0x48')](_0x3e13('0x49'),_0x1f9d18);})[_0x3e13('0x3d')](function(_0x44623b){ut[_0x3e13('0x48')](_0x3e13('0x4a'),_0x44623b);});}else{ut[_0x3e13('0x48')]('[Fax][Message][Error][NoUpdate2]');}}Fax['prototype'][_0x3e13('0x4b')]=function(_0x1fe56d,_0x25a8d8,_0x4afe7d){var _0x23eff1=this;var _0x7e7748={};if(_0x25a8d8){_0x7e7748={'read':_0x25a8d8};}else{_0x7e7748={'failMessage':_0x4afe7d};}if(this[_0x3e13('0x28')][_0x1fe56d]['AttachmentId']){faxMessage[_0x3e13('0x45')](this[_0x3e13('0x28')][_0x1fe56d]['AttachmentId'],_0x7e7748)['then'](function(_0x48d5f8){ut[_0x3e13('0x48')](_0x3e13('0x4c'),_0x48d5f8);})[_0x3e13('0x3d')](function(_0x12bbfe){ut['logger'](_0x3e13('0x4d'),_0x12bbfe);})[_0x3e13('0x4e')](function(){delete _0x23eff1[_0x3e13('0xd')][_0x1fe56d];delete _0x23eff1[_0x3e13('0x28')][_0x1fe56d];});}else{ut['logger'](_0x3e13('0x4f'));delete this[_0x3e13('0xd')][_0x1fe56d];delete this[_0x3e13('0x28')][_0x1fe56d];}};Fax[_0x3e13('0x1e')][_0x3e13('0x50')]=function(_0x5c7375){var _0x4fd5bf=this;if(this[_0x3e13('0xd')][_0x5c7375[_0x3e13('0x23')]]){if(this[_0x3e13('0x28')][_0x5c7375[_0x3e13('0x23')]]){this['channels'][_0x5c7375[_0x3e13('0x23')]]['id']=this[_0x3e13('0x28')][_0x5c7375[_0x3e13('0x23')]]['id'];this[_0x3e13('0xd')][_0x5c7375['uniqueid']]['name']=this[_0x3e13('0x28')][_0x5c7375['uniqueid']][_0x3e13('0x25')];}logger['info'](_0x5c7375[_0x3e13('0x23')],this[_0x3e13('0x28')][_0x5c7375[_0x3e13('0x23')]]?_0x3e13('0x51'):_0x3e13('0x52'),JSON['stringify'](this[_0x3e13('0xd')][_0x5c7375[_0x3e13('0x23')]]));if(this[_0x3e13('0x28')][_0x5c7375[_0x3e13('0x23')]]){if(this['channels'][_0x5c7375[_0x3e13('0x23')]][_0x3e13('0x53')]>0x0&&this[_0x3e13('0xd')][_0x5c7375[_0x3e13('0x23')]]['faxstatus']===_0x3e13('0x54')){this[_0x3e13('0x4b')](_0x5c7375['uniqueid'],!![]);}else{this[_0x3e13('0x4b')](_0x5c7375['uniqueid'],![],this['channels'][_0x5c7375[_0x3e13('0x23')]]['faxstatusstring']?'SENDING\x20FAILED:\x20'+this[_0x3e13('0xd')][_0x5c7375[_0x3e13('0x23')]][_0x3e13('0x55')]:'SENDING\x20FAILED');}}}};Fax[_0x3e13('0x1e')][_0x3e13('0x56')]=function(_0x209e1b){var _0x2988b8=this;return new BPromise(function(_0x427f3b,_0xa769b2){_0x2988b8[_0x3e13('0x57')](_0x209e1b,_0x2988b8['faxAccounts'][_0x209e1b[_0x3e13('0x58')]])[_0x3e13('0x47')](function(_0x5a9787){ut[_0x3e13('0x48')]('[Fax][execOriginate][success]',_0x5a9787);_0x427f3b(ut['message'](_0x3e13('0x59')));})[_0x3e13('0x3d')](function(_0x360721){ut[_0x3e13('0x48')](_0x3e13('0x5a'),_0x360721);updateStatus(_0x209e1b);_0xa769b2(ut['message'](_0x3e13('0x5b')));});});};Fax['prototype']['checkAfterSend']=function(_0x12698a){var _0x43d3ff=this;return new BPromise(function(_0xea22d7,_0x5e887d){var _0x36eb36=_0x43d3ff[_0x3e13('0x5c')](_0x43d3ff['faxAccounts'][_0x12698a['FaxAccountId']][_0x3e13('0x5d')],_0x12698a);if(_0x36eb36[_0x3e13('0x5e')]){_0xea22d7(ut[_0x3e13('0x38')]('Trunk\x20Reachable'));}else{_0x5e887d(ut['message'](_0x36eb36[_0x3e13('0x38')]));}});};function originate(_0x1b7123,_0x19a990,_0x738d04){return new BPromise(function(_0x6f36ba,_0x45c8c3){if(_0x738d04){var _0x1eacfa=util[_0x3e13('0x5f')]('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[_0x3e13('0x3c')](_0x1b7123[_0x3e13('0x2')])[_0x3e13('0x25')],_0x1b7123[_0x3e13('0x2')]);gs[_0x3e13('0x60')](_0x1eacfa)['then'](function(){_0x1b7123['path']=util[_0x3e13('0x5f')](_0x3e13('0x61'),path[_0x3e13('0x3c')](_0x1b7123[_0x3e13('0x2')])[_0x3e13('0x62')],path['parse'](_0x1b7123[_0x3e13('0x2')])[_0x3e13('0x25')]);_0x19a990[_0x3e13('0x63')]=_0x1b7123[_0x3e13('0x2')];ut[_0x3e13('0x48')](_0x3e13('0x64'),'');ami['Action'](ut['variablesAction'](_0x1b7123,_0x19a990))[_0x3e13('0x47')](function(_0x4760d9){_0x6f36ba(_0x4760d9);})[_0x3e13('0x3d')](function(_0x17f87c){_0x45c8c3(_0x17f87c);});})[_0x3e13('0x3d')](function(_0x4b55a9){_0x45c8c3(_0x4b55a9);});}else{ami[_0x3e13('0x65')](ut['variablesAction'](_0x1b7123,_0x19a990))[_0x3e13('0x47')](function(_0x549221){_0x6f36ba(_0x549221);})[_0x3e13('0x3d')](function(_0x3d4146){_0x45c8c3(_0x3d4146);});}});}Fax[_0x3e13('0x1e')][_0x3e13('0x57')]=function(_0x7e982f,_0x50c6ca){var _0x9d52f9=this;return new BPromise(function(_0x68db53,_0x145954){var _0x3c4f81=uuid['v4']();var _0x1be530=ut[_0x3e13('0x66')](_0x7e982f,_0x50c6ca);_0x9d52f9[_0x3e13('0x28')][_0x3c4f81]=new Action(_0x3c4f81,_0x50c6ca,_0x7e982f);var _0xd66965=_0x9d52f9[_0x3e13('0x28')][_0x3c4f81];if(path[_0x3e13('0x3c')](_0x7e982f[_0x3e13('0x2')])[_0x3e13('0x67')]===_0x3e13('0x3a')){originate(_0xd66965,_0x1be530,!![])['then'](function(_0x2cccab){_0x68db53(_0x2cccab);})[_0x3e13('0x3d')](function(_0x1687af){_0x145954(_0x1687af);});}else{originate(_0xd66965,_0x1be530,![])[_0x3e13('0x47')](function(_0x352230){_0x68db53(_0x352230);})[_0x3e13('0x3d')](function(_0x310b25){_0x145954(_0x310b25);});}});};Fax[_0x3e13('0x1e')][_0x3e13('0x68')]=function(_0x14468b){return!_[_0x3e13('0x69')](_0x14468b)&&!_[_0x3e13('0x69')](_0x14468b['name'])&&!_['isNil'](_0x14468b['active'])&&_0x14468b['active']&&!_[_0x3e13('0x69')](this[_0x3e13('0xf')][util[_0x3e13('0x5f')]('SIP/%s',_0x14468b[_0x3e13('0x25')])])&&!_[_0x3e13('0x69')](this[_0x3e13('0xf')][util[_0x3e13('0x5f')](_0x3e13('0x6a'),_0x14468b[_0x3e13('0x25')])][_0x3e13('0x2f')])&&(this[_0x3e13('0xf')][util[_0x3e13('0x5f')](_0x3e13('0x6a'),_0x14468b[_0x3e13('0x25')])]['status']==='reachable'||this[_0x3e13('0xf')][util['format'](_0x3e13('0x6a'),_0x14468b[_0x3e13('0x25')])][_0x3e13('0x2f')]==='unmonitored');};Fax['prototype']['checkTrunk']=function(_0x5f34be,_0x33edc3){if(!this[_0x3e13('0x68')](_0x5f34be)){ut[_0x3e13('0x48')](_0x3e13('0x6b'),_[_0x3e13('0x69')](_0x5f34be)?'':_0x5f34be[_0x3e13('0x25')]+_0x3e13('0x6c'));return{'isValid':![],'message':_0x3e13('0x6d')};}if(_[_0x3e13('0x69')](_0x33edc3[_0x3e13('0x5')])){ut[_0x3e13('0x48')](_0x3e13('0x6e'),JSON[_0x3e13('0x40')](_0x33edc3));return{'isValid':![],'message':'Empty\x20Fax'};}if(_[_0x3e13('0x69')](_0x33edc3[_0x3e13('0x2')])){ut[_0x3e13('0x48')]('[Fax][checkTrunk][Empty\x20path]',JSON[_0x3e13('0x40')](_0x33edc3));return{'isValid':![],'message':_0x3e13('0x6f')};}return{'isValid':!![],'message':_0x3e13('0x70')};};module['exports']=Fax; \ No newline at end of file +var _0x29c3=['varset','newstate','syncNewState','syncNewExten','faxstatus','syncFaxStatus','hangup','syncHangup','originateresponse','prototype','from-voip-provider','faxAccounts','hasOwnProperty','exten','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','actions','syncVarSet','variable','value','channelstate','channelstatedesc','operation','status','filename','\x20syncFaxStatus\x20','syncReceiveFax','remotestationid','pagestransferred','resolution','/var/opt/motion2/server/files/attachments/','message','create','parse','.pdf','application/pdf','calleridnum','fax','error','\x20notify\x20','stringify','\x20receiveFax\x20','syncOriginateResponse','merge','pick','response','reason','AttachmentId','update','SENDING\x20FAILED\x20','then','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','catch','[Fax][Message][NoUpdate1]','finally','\x20hangup\x20sendFile\x20','faxpages','SUCCESS','SENDING\x20FAILED:\x20','faxstatusstring','SENDING\x20FAILED','send','execOriginate','[Fax][execOriginate][success]','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','FaxAccountId','Trunk','isValid','Trunk\x20Reachable','format','execute','%s/%s.tif','dir','Convert\x20pdf\x20to\x20tif','variablesAction','Action','addVariables','isNil','active','SIP/%s','reachable','unmonitored','isTrunkReachable','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20path','Is\x20Valid','exports','lodash','moment','path','tiff2pdf','./util/gs','../../../config/logger','../ami','./channel','./util/util','../rpc/attachment','../rpc/faxMessage','channels','trunks','newchannel','syncNewchannel','bind'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x29c3,0x66));var _0x329c=function(_0x378f09,_0x2aa146){_0x378f09=_0x378f09-0x0;var _0x25977b=_0x29c3[_0x378f09];return _0x25977b;};'use strict';var util=require('util');var _=require(_0x329c('0x0'));var BPromise=require('bluebird');var uuid=require('uuid');var moment=require(_0x329c('0x1'));var path=require(_0x329c('0x2'));var tiff2pdf=require(_0x329c('0x3'));var gs=require(_0x329c('0x4'));var logger=require(_0x329c('0x5'))('fax');var ami=require(_0x329c('0x6'));var rpcDb=require('./rpcDb');var Channel=require(_0x329c('0x7'));var ut=require(_0x329c('0x8'));var Action=require('./action');var faxAccount=require('../rpc/faxAccount');var attachment=require(_0x329c('0x9'));var faxMessage=require(_0x329c('0xa'));function Fax(_0x1ac0c1){this[_0x329c('0xb')]={};this['faxAccounts']=_0x1ac0c1['faxAccounts'];this[_0x329c('0xc')]=_0x1ac0c1['trunks'];this['actions']={};ami['on'](_0x329c('0xd'),this[_0x329c('0xe')][_0x329c('0xf')](this));ami['on'](_0x329c('0x10'),this['syncVarSet'][_0x329c('0xf')](this));ami['on'](_0x329c('0x11'),this[_0x329c('0x12')][_0x329c('0xf')](this));ami['on']('newexten',this[_0x329c('0x13')]['bind'](this));ami['on'](_0x329c('0x14'),this[_0x329c('0x15')][_0x329c('0xf')](this));ami['on']('receivefax',this['syncReceiveFax'][_0x329c('0xf')](this));ami['on'](_0x329c('0x16'),this[_0x329c('0x17')]['bind'](this));ami['on'](_0x329c('0x18'),this['syncOriginateResponse'][_0x329c('0xf')](this));}Fax[_0x329c('0x19')][_0x329c('0xe')]=function(_0x360286){if(_0x360286['context']===_0x329c('0x1a')){for(var _0x20e7b5 in this['faxAccounts']){if(this[_0x329c('0x1b')][_0x329c('0x1c')](_0x20e7b5)){if(_0x360286[_0x329c('0x1d')]===this[_0x329c('0x1b')][_0x20e7b5][_0x329c('0x1e')]){this[_0x329c('0xb')][_0x360286[_0x329c('0x1f')]]={};this[_0x329c('0xb')][_0x360286[_0x329c('0x1f')]][_0x329c('0x20')]=_0x360286[_0x329c('0x20')];this['channels'][_0x360286[_0x329c('0x1f')]]['id']=this['faxAccounts'][_0x20e7b5]['id'];this['channels'][_0x360286[_0x329c('0x1f')]][_0x329c('0x21')]=this['faxAccounts'][_0x20e7b5][_0x329c('0x21')];logger[_0x329c('0x22')](_0x360286[_0x329c('0x1f')],_0x329c('0x23'));}}}}if(this[_0x329c('0x24')][_0x360286['uniqueid']]){this[_0x329c('0xb')][_0x360286['uniqueid']]={};this[_0x329c('0xb')][_0x360286[_0x329c('0x1f')]]['channel']=_0x360286['channel'];logger['info'](_0x360286[_0x329c('0x1f')],_0x329c('0x23'));}};Fax[_0x329c('0x19')][_0x329c('0x25')]=function(_0x3fb600){if(this[_0x329c('0xb')][_0x3fb600[_0x329c('0x1f')]]){for(var _0xee00b4 in _0x3fb600['variable']){if(_0x3fb600[_0x329c('0x26')]['hasOwnProperty'](_0xee00b4)){this[_0x329c('0xb')][_0x3fb600[_0x329c('0x1f')]][_0xee00b4]=_0x3fb600[_0x329c('0x27')];}}}};Fax[_0x329c('0x19')]['syncNewState']=function(_0x3ab649){if(this[_0x329c('0xb')][_0x3ab649[_0x329c('0x1f')]]){this[_0x329c('0xb')][_0x3ab649['uniqueid']][_0x329c('0x28')]=_0x3ab649[_0x329c('0x28')];this[_0x329c('0xb')][_0x3ab649[_0x329c('0x1f')]][_0x329c('0x29')]=_0x3ab649[_0x329c('0x29')];}};Fax['prototype'][_0x329c('0x13')]=function(_0x4ab24a){if(this[_0x329c('0xb')][_0x4ab24a[_0x329c('0x1f')]]){for(var _0x2d7c37 in _0x4ab24a[_0x329c('0x26')]){if(_0x4ab24a[_0x329c('0x26')][_0x329c('0x1c')](_0x2d7c37)){this['channels'][_0x4ab24a[_0x329c('0x1f')]][_0x2d7c37]=_0x4ab24a[_0x329c('0x27')];}}}};Fax[_0x329c('0x19')][_0x329c('0x15')]=function(_0x1989ab){if(this[_0x329c('0xb')][_0x1989ab[_0x329c('0x1f')]]){this['channels'][_0x1989ab['uniqueid']][_0x329c('0x2a')]=_0x1989ab[_0x329c('0x2a')];this['channels'][_0x1989ab[_0x329c('0x1f')]][_0x329c('0x2b')]=_0x1989ab['status'];this['channels'][_0x1989ab[_0x329c('0x1f')]][_0x329c('0x1e')]=_0x1989ab['localstationid'];this['channels'][_0x1989ab[_0x329c('0x1f')]][_0x329c('0x2c')]=_0x1989ab[_0x329c('0x2c')];logger[_0x329c('0x22')](_0x1989ab[_0x329c('0x1f')],_0x329c('0x2d'));}};Fax[_0x329c('0x19')][_0x329c('0x2e')]=function(_0xefab71){var _0x370f40=this;if(this['channels'][_0xefab71[_0x329c('0x1f')]]){var _0x425d0d=this[_0x329c('0xb')][_0xefab71['uniqueid']]['id'];this[_0x329c('0xb')][_0xefab71[_0x329c('0x1f')]][_0x329c('0x2f')]=_0xefab71[_0x329c('0x2f')];this[_0x329c('0xb')][_0xefab71['uniqueid']][_0x329c('0x30')]=_0xefab71[_0x329c('0x30')];this[_0x329c('0xb')][_0xefab71[_0x329c('0x1f')]][_0x329c('0x1e')]=_0xefab71['localstationid'];this[_0x329c('0xb')][_0xefab71[_0x329c('0x1f')]][_0x329c('0x31')]=_0xefab71[_0x329c('0x31')];this[_0x329c('0xb')][_0xefab71[_0x329c('0x1f')]]['transferrate']=_0xefab71['transferrate'];this[_0x329c('0xb')][_0xefab71[_0x329c('0x1f')]]['filename']=_0xefab71[_0x329c('0x2c')];this[_0x329c('0xb')][_0xefab71[_0x329c('0x1f')]]['calleridnum']=_0xefab71['calleridnum'];if(this['channels'][_0xefab71['uniqueid']][_0x329c('0x30')]>0x0){tiff2pdf(_0xefab71['filename'],_0x329c('0x32'),function(_0x1887ec){logger[_0x329c('0x22')](_0xefab71['uniqueid'],'\x20result\x20conversion\x20file\x20',_0x1887ec[_0x329c('0x33')]);attachment[_0x329c('0x34')]({'name':path[_0x329c('0x35')](_0xefab71[_0x329c('0x2c')])['name'],'basename':path[_0x329c('0x35')](_0xefab71['filename'])[_0x329c('0x21')]+_0x329c('0x36'),'type':_0x329c('0x37')})['then'](function(_0x4786bc){faxAccount['notify'](_0x425d0d,{'from':_0xefab71[_0x329c('0x38')],'mapKey':_0x329c('0x39'),'body':path[_0x329c('0x35')](_0xefab71[_0x329c('0x2c')])['name']+_0x329c('0x36'),'AttachmentId':_0x4786bc['id']})['catch'](function(_0x17c485){logger[_0x329c('0x3a')](_0xefab71[_0x329c('0x1f')],_0x329c('0x3b'),JSON[_0x329c('0x3c')](_0x17c485));});})['catch'](function(_0x406a47){logger[_0x329c('0x3a')](_0xefab71['uniqueid'],_0x329c('0x3d'),JSON[_0x329c('0x3c')](_0x406a47));});});}logger[_0x329c('0x22')](_0xefab71[_0x329c('0x1f')],'\x20receiveFax\x20');}};Fax[_0x329c('0x19')][_0x329c('0x3e')]=function(_0x589128){if(this[_0x329c('0x24')][_0x589128[_0x329c('0x1f')]]){_[_0x329c('0x3f')](this[_0x329c('0xb')][_0x589128[_0x329c('0x1f')]],_[_0x329c('0x40')](_0x589128,[_0x329c('0x41'),_0x329c('0x42')]));}};function updateStatus(_0x1ddd34){if(_0x1ddd34[_0x329c('0x43')]){faxMessage[_0x329c('0x44')](_0x1ddd34[_0x329c('0x43')],{'failMessage':_0x329c('0x45')})[_0x329c('0x46')](function(_0x3ebe04){ut[_0x329c('0x47')](_0x329c('0x48'),_0x3ebe04);})['catch'](function(_0x51a791){ut[_0x329c('0x47')](_0x329c('0x49'),_0x51a791);});}else{ut['logger'](_0x329c('0x4a'));}}Fax[_0x329c('0x19')][_0x329c('0x4b')]=function(_0x5d50ad,_0x13e8a6,_0x41b951){var _0x1359ed=this;var _0x2fe337={};if(_0x13e8a6){_0x2fe337={'read':_0x13e8a6};}else{_0x2fe337={'failMessage':_0x41b951};}if(this[_0x329c('0x24')][_0x5d50ad][_0x329c('0x43')]){faxMessage['update'](this[_0x329c('0x24')][_0x5d50ad][_0x329c('0x43')],_0x2fe337)[_0x329c('0x46')](function(_0x519a10){ut['logger'](_0x329c('0x4c'),_0x519a10);})[_0x329c('0x4d')](function(_0x199cfa){ut['logger'](_0x329c('0x4e'),_0x199cfa);})[_0x329c('0x4f')](function(){delete _0x1359ed[_0x329c('0xb')][_0x5d50ad];delete _0x1359ed['actions'][_0x5d50ad];});}else{ut[_0x329c('0x47')]('[Fax][Message][NoUpdate2]');delete this[_0x329c('0xb')][_0x5d50ad];delete this[_0x329c('0x24')][_0x5d50ad];}};Fax['prototype'][_0x329c('0x17')]=function(_0x297fbe){var _0x4e973f=this;if(this[_0x329c('0xb')][_0x297fbe[_0x329c('0x1f')]]){if(this[_0x329c('0x24')][_0x297fbe['uniqueid']]){this[_0x329c('0xb')][_0x297fbe[_0x329c('0x1f')]]['id']=this[_0x329c('0x24')][_0x297fbe[_0x329c('0x1f')]]['id'];this[_0x329c('0xb')][_0x297fbe['uniqueid']][_0x329c('0x21')]=this[_0x329c('0x24')][_0x297fbe[_0x329c('0x1f')]][_0x329c('0x21')];}logger['info'](_0x297fbe[_0x329c('0x1f')],this[_0x329c('0x24')][_0x297fbe[_0x329c('0x1f')]]?_0x329c('0x50'):'\x20hangup\x20faxRiceive\x20',JSON[_0x329c('0x3c')](this[_0x329c('0xb')][_0x297fbe[_0x329c('0x1f')]]));if(this[_0x329c('0x24')][_0x297fbe[_0x329c('0x1f')]]){if(this['channels'][_0x297fbe[_0x329c('0x1f')]][_0x329c('0x51')]>0x0&&this[_0x329c('0xb')][_0x297fbe[_0x329c('0x1f')]][_0x329c('0x14')]===_0x329c('0x52')){this['updateStatus'](_0x297fbe[_0x329c('0x1f')],!![]);}else{this[_0x329c('0x4b')](_0x297fbe[_0x329c('0x1f')],![],this[_0x329c('0xb')][_0x297fbe[_0x329c('0x1f')]]['faxstatusstring']?_0x329c('0x53')+this[_0x329c('0xb')][_0x297fbe[_0x329c('0x1f')]][_0x329c('0x54')]:_0x329c('0x55'));}}}};Fax[_0x329c('0x19')][_0x329c('0x56')]=function(_0x3b70ee){var _0x4a5a38=this;return new BPromise(function(_0x10e3da,_0x2ad398){_0x4a5a38[_0x329c('0x57')](_0x3b70ee,_0x4a5a38[_0x329c('0x1b')][_0x3b70ee['FaxAccountId']])[_0x329c('0x46')](function(_0x211559){ut['logger'](_0x329c('0x58'),_0x211559);_0x10e3da(ut[_0x329c('0x33')]('Fax\x20received'));})[_0x329c('0x4d')](function(_0x245a51){ut[_0x329c('0x47')](_0x329c('0x59'),_0x245a51);updateStatus(_0x3b70ee);_0x2ad398(ut['message'](_0x329c('0x5a')));});});};Fax[_0x329c('0x19')][_0x329c('0x5b')]=function(_0x39467d){var _0x2fbaf3=this;return new BPromise(function(_0x5721bc,_0x267e7b){var _0xadfe84=_0x2fbaf3[_0x329c('0x5c')](_0x2fbaf3[_0x329c('0x1b')][_0x39467d[_0x329c('0x5d')]][_0x329c('0x5e')],_0x39467d);if(_0xadfe84[_0x329c('0x5f')]){_0x5721bc(ut[_0x329c('0x33')](_0x329c('0x60')));}else{_0x267e7b(ut[_0x329c('0x33')](_0xadfe84[_0x329c('0x33')]));}});};function originate(_0x5bb284,_0xc99526,_0x47d67f){return new BPromise(function(_0x293fdf,_0x21963a){if(_0x47d67f){var _0x22a8d6=util[_0x329c('0x61')]('gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit',path['parse'](_0x5bb284['path'])[_0x329c('0x21')],_0x5bb284[_0x329c('0x2')]);gs[_0x329c('0x62')](_0x22a8d6)[_0x329c('0x46')](function(){_0x5bb284[_0x329c('0x2')]=util[_0x329c('0x61')](_0x329c('0x63'),path['parse'](_0x5bb284[_0x329c('0x2')])[_0x329c('0x64')],path['parse'](_0x5bb284[_0x329c('0x2')])['name']);_0xc99526['XMF-PATH']=_0x5bb284[_0x329c('0x2')];ut['logger'](_0x329c('0x65'),'');ami['Action'](ut[_0x329c('0x66')](_0x5bb284,_0xc99526))[_0x329c('0x46')](function(_0x33aca8){_0x293fdf(_0x33aca8);})[_0x329c('0x4d')](function(_0x19822e){_0x21963a(_0x19822e);});})[_0x329c('0x4d')](function(_0x5b8c57){_0x21963a(_0x5b8c57);});}else{ami[_0x329c('0x67')](ut['variablesAction'](_0x5bb284,_0xc99526))[_0x329c('0x46')](function(_0x37edea){_0x293fdf(_0x37edea);})['catch'](function(_0x5d3113){_0x21963a(_0x5d3113);});}});}Fax['prototype'][_0x329c('0x57')]=function(_0x3e4e06,_0x4ea021){var _0x29794d=this;return new BPromise(function(_0x5793fd,_0x522283){var _0x19e635=uuid['v4']();var _0x38f4f1=ut[_0x329c('0x68')](_0x3e4e06,_0x4ea021);_0x29794d[_0x329c('0x24')][_0x19e635]=new Action(_0x19e635,_0x4ea021,_0x3e4e06);var _0x574aed=_0x29794d[_0x329c('0x24')][_0x19e635];if(path[_0x329c('0x35')](_0x3e4e06['path'])['ext']==='.pdf'){originate(_0x574aed,_0x38f4f1,!![])['then'](function(_0x193fcd){_0x5793fd(_0x193fcd);})[_0x329c('0x4d')](function(_0x4ea630){_0x522283(_0x4ea630);});}else{originate(_0x574aed,_0x38f4f1,![])[_0x329c('0x46')](function(_0x5986f7){_0x5793fd(_0x5986f7);})[_0x329c('0x4d')](function(_0x198813){_0x522283(_0x198813);});}});};Fax[_0x329c('0x19')]['isTrunkReachable']=function(_0x3e428c){return!_['isNil'](_0x3e428c)&&!_[_0x329c('0x69')](_0x3e428c[_0x329c('0x21')])&&!_['isNil'](_0x3e428c[_0x329c('0x6a')])&&_0x3e428c[_0x329c('0x6a')]&&!_[_0x329c('0x69')](this['trunks'][util[_0x329c('0x61')](_0x329c('0x6b'),_0x3e428c['name'])])&&!_[_0x329c('0x69')](this[_0x329c('0xc')][util[_0x329c('0x61')]('SIP/%s',_0x3e428c[_0x329c('0x21')])][_0x329c('0x2b')])&&(this['trunks'][util['format']('SIP/%s',_0x3e428c[_0x329c('0x21')])][_0x329c('0x2b')]===_0x329c('0x6c')||this['trunks'][util[_0x329c('0x61')](_0x329c('0x6b'),_0x3e428c[_0x329c('0x21')])][_0x329c('0x2b')]===_0x329c('0x6d'));};Fax[_0x329c('0x19')][_0x329c('0x5c')]=function(_0x172831,_0x247578){if(!this[_0x329c('0x6e')](_0x172831)){ut[_0x329c('0x47')](_0x329c('0x6f'),_[_0x329c('0x69')](_0x172831)?'':_0x172831['name']+_0x329c('0x70'));return{'isValid':![],'message':_0x329c('0x71')};}if(_[_0x329c('0x69')](_0x247578[_0x329c('0x39')])){ut['logger'](_0x329c('0x72'),JSON[_0x329c('0x3c')](_0x247578));return{'isValid':![],'message':'Empty\x20Fax'};}if(_['isNil'](_0x247578[_0x329c('0x2')])){ut['logger']('[Fax][checkTrunk][Empty\x20path]',JSON[_0x329c('0x3c')](_0x247578));return{'isValid':![],'message':_0x329c('0x73')};}return{'isValid':!![],'message':_0x329c('0x74')};};module[_0x329c('0x75')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index 621c8bf..3417e7a 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 _0x1397=['notify','resolve','catch','util','bluebird','preview','lodash','error','inspect'];(function(_0xe33081,_0x2a90a1){var _0x3cbbf7=function(_0x1fa95c){while(--_0x1fa95c){_0xe33081['push'](_0xe33081['shift']());}};_0x3cbbf7(++_0x2a90a1);}(_0x1397,0x66));var _0x7139=function(_0x357d69,_0xf80d4d){_0x357d69=_0x357d69-0x0;var _0x3182e9=_0x1397[_0x357d69];return _0x3182e9;};'use strict';var util=require(_0x7139('0x0'));var BPromise=require(_0x7139('0x1'));var logger=require('../../../config/logger')(_0x7139('0x2'));var _=require(_0x7139('0x3'));var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0x50a1cf){return function(_0x2ce95c){logger[_0x7139('0x4')](_0x50a1cf,util[_0x7139('0x5')](_0x2ce95c,{'showHidden':![],'depth':null}));};}exports[_0x7139('0x6')]=function(_0x1af7de,_0x5b830f){return BPromise[_0x7139('0x7')]()['then'](faxAccount[_0x7139('0x6')](_0x1af7de,_0x5b830f))[_0x7139('0x8')](loggerCatch('[Notify]\x20'));}; \ No newline at end of file +var _0x8246=['bluebird','preview','lodash','../rpc/faxAccount','error','notify','then','util'];(function(_0x19d334,_0x50f329){var _0x5dc8b6=function(_0x4d071f){while(--_0x4d071f){_0x19d334['push'](_0x19d334['shift']());}};_0x5dc8b6(++_0x50f329);}(_0x8246,0x197));var _0x6824=function(_0x4235b1,_0x53f0bb){_0x4235b1=_0x4235b1-0x0;var _0x38cbcd=_0x8246[_0x4235b1];return _0x38cbcd;};'use strict';var util=require(_0x6824('0x0'));var BPromise=require(_0x6824('0x1'));var logger=require('../../../config/logger')(_0x6824('0x2'));var _=require(_0x6824('0x3'));var faxAccount=require(_0x6824('0x4'));function loggerCatch(_0x39bbdc){return function(_0x173b7d){logger[_0x6824('0x5')](_0x39bbdc,util['inspect'](_0x173b7d,{'showHidden':![],'depth':null}));};}exports[_0x6824('0x6')]=function(_0x3ea6d8,_0x21e1ee){return BPromise['resolve']()[_0x6824('0x7')](faxAccount[_0x6824('0x6')](_0x3ea6d8,_0x21e1ee))['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 03df804..a3f5e06 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 _0x607b=['../../../../config/logger','bluebird','child_process','exec','execute','info','Exec\x20gs','\x20Error\x20:','inspect','util'];(function(_0x54a892,_0x1a4eeb){var _0x1f24f1=function(_0x2044d5){while(--_0x2044d5){_0x54a892['push'](_0x54a892['shift']());}};_0x1f24f1(++_0x1a4eeb);}(_0x607b,0x9f));var _0xb607=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x607b[_0x311c35];return _0x5cc50c;};'use strict';var util=require(_0xb607('0x0'));var logger=require(_0xb607('0x1'))('fax');var BPromise=require(_0xb607('0x2'));var exec=require(_0xb607('0x3'))[_0xb607('0x4')];exports[_0xb607('0x5')]=function(_0x1a31be){return new BPromise(function(_0x32474b,_0x470fe5){exec(_0x1a31be,function(_0x335e74,_0x1ea4e0,_0x5cd9b1){logger[_0xb607('0x6')](_0xb607('0x7'),_0x1ea4e0);if(_0x335e74){logger[_0xb607('0x6')](_0xb607('0x7'),_0xb607('0x8'),util[_0xb607('0x9')](_0x335e74,{'showHidden':![],'depth':null}),_0x1ea4e0,_0x5cd9b1);_0x470fe5(_0x335e74);}_0x32474b(_0x1ea4e0);});});}; \ No newline at end of file +var _0x496b=['exec','info','Exec\x20gs','\x20Error\x20:','inspect','util','../../../../config/logger','fax','bluebird','child_process'];(function(_0x1f4926,_0x2dc76e){var _0x5c0d7c=function(_0x35f4c4){while(--_0x35f4c4){_0x1f4926['push'](_0x1f4926['shift']());}};_0x5c0d7c(++_0x2dc76e);}(_0x496b,0xaf));var _0xb496=function(_0x496738,_0x3f1a9f){_0x496738=_0x496738-0x0;var _0xee1381=_0x496b[_0x496738];return _0xee1381;};'use strict';var util=require(_0xb496('0x0'));var logger=require(_0xb496('0x1'))(_0xb496('0x2'));var BPromise=require(_0xb496('0x3'));var exec=require(_0xb496('0x4'))[_0xb496('0x5')];exports['execute']=function(_0x44a2e7){return new BPromise(function(_0x1bc258,_0x132370){exec(_0x44a2e7,function(_0x468ccc,_0x2babb5,_0x5ec057){logger[_0xb496('0x6')](_0xb496('0x7'),_0x2babb5);if(_0x468ccc){logger['info'](_0xb496('0x7'),_0xb496('0x8'),util[_0xb496('0x9')](_0x468ccc,{'showHidden':![],'depth':null}),_0x2babb5,_0x5ec057);_0x132370(_0x468ccc);}_0x1bc258(_0x2babb5);});});}; \ 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 b5f1f68..5a98dcf 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 _0xd81f=['logger','info','ecm','minrate','maxrate','\x22%s\x22','modem','t38timeout','localstationid','path','variablesAction','uniqueid','originate','xcally-motion-fax','from-sip','format','\x22%s\x22\x20<%s>','headerinfo','util','lodash','moment','../../../../config/logger','fax','message'];(function(_0x108c5b,_0x52c0fb){var _0x2afb52=function(_0x586416){while(--_0x586416){_0x108c5b['push'](_0x108c5b['shift']());}};_0x2afb52(++_0x52c0fb);}(_0xd81f,0x1c2));var _0xfd81=function(_0x2d364e,_0x301c5e){_0x2d364e=_0x2d364e-0x0;var _0x1b9312=_0xd81f[_0x2d364e];return _0x1b9312;};'use strict';var util=require(_0xfd81('0x0'));var _=require(_0xfd81('0x1'));var moment=require(_0xfd81('0x2'));var logger=require(_0xfd81('0x3'))(_0xfd81('0x4'));exports[_0xfd81('0x5')]=function(_0x4408ec){return{'message':_0x4408ec};};exports[_0xfd81('0x6')]=function(_0x14c3cb,_0x1f3a18){logger[_0xfd81('0x7')](_0x14c3cb,util['inspect'](_0x1f3a18,{'showHidden':![],'depth':null}));};exports['addVariables']=function(_0x34008a,_0x518119){var _0x1dd30c={'XMF-ECM':_0x518119[_0xfd81('0x8')],'XMF-HEADERINFO':_0x518119['headerinfo'],'XMF-MINRATE':_0x518119[_0xfd81('0x9')],'XMF-MAXRATE':_0x518119[_0xfd81('0xa')],'XMF-MODEM':util['format'](_0xfd81('0xb'),_0x518119[_0xfd81('0xc')]),'XMF-GATEWAY':_0x518119['gateway'],'XMF-FAXDETECT':_0x518119['faxdetect'],'XMF-T38TIMEOUT':_0x518119[_0xfd81('0xd')],'XMF-LOCALSTATIONID':_0x518119[_0xfd81('0xe')],'XMF-PATH':_0x34008a[_0xfd81('0xf')]};return _0x1dd30c;};exports[_0xfd81('0x10')]=function(_0x22c774,_0x1fdbe7){return{'actionid':_0x22c774[_0xfd81('0x11')],'action':_0xfd81('0x12'),'channel':_0x22c774['channel'],'Exten':_0xfd81('0x13'),'Context':_0xfd81('0x14'),'Priority':'1','callerid':util[_0xfd81('0x15')](_0xfd81('0x16'),_0x22c774[_0xfd81('0x17')]?_0x22c774['headerinfo']:'',_0x22c774[_0xfd81('0xe')]),'variable':_0x1fdbe7,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x22c774[_0xfd81('0x11')]};}; \ No newline at end of file +var _0x125a=['inspect','addVariables','headerinfo','minrate','format','\x22%s\x22','modem','gateway','t38timeout','localstationid','variablesAction','uniqueid','originate','xcally-motion-fax','from-sip','util','lodash','../../../../config/logger','message','logger','info'];(function(_0x159bab,_0x57b2c0){var _0x42b01c=function(_0x134cb5){while(--_0x134cb5){_0x159bab['push'](_0x159bab['shift']());}};_0x42b01c(++_0x57b2c0);}(_0x125a,0x78));var _0xa125=function(_0x5959c9,_0x2ed153){_0x5959c9=_0x5959c9-0x0;var _0x4ffcbc=_0x125a[_0x5959c9];return _0x4ffcbc;};'use strict';var util=require(_0xa125('0x0'));var _=require(_0xa125('0x1'));var moment=require('moment');var logger=require(_0xa125('0x2'))('fax');exports[_0xa125('0x3')]=function(_0x40872c){return{'message':_0x40872c};};exports[_0xa125('0x4')]=function(_0x5ece37,_0x215d38){logger[_0xa125('0x5')](_0x5ece37,util[_0xa125('0x6')](_0x215d38,{'showHidden':![],'depth':null}));};exports[_0xa125('0x7')]=function(_0x2918de,_0xfef7b0){var _0x41e2c7={'XMF-ECM':_0xfef7b0['ecm'],'XMF-HEADERINFO':_0xfef7b0[_0xa125('0x8')],'XMF-MINRATE':_0xfef7b0[_0xa125('0x9')],'XMF-MAXRATE':_0xfef7b0['maxrate'],'XMF-MODEM':util[_0xa125('0xa')](_0xa125('0xb'),_0xfef7b0[_0xa125('0xc')]),'XMF-GATEWAY':_0xfef7b0[_0xa125('0xd')],'XMF-FAXDETECT':_0xfef7b0['faxdetect'],'XMF-T38TIMEOUT':_0xfef7b0[_0xa125('0xe')],'XMF-LOCALSTATIONID':_0xfef7b0[_0xa125('0xf')],'XMF-PATH':_0x2918de['path']};return _0x41e2c7;};exports[_0xa125('0x10')]=function(_0x594bb6,_0x248f9d){return{'actionid':_0x594bb6[_0xa125('0x11')],'action':_0xa125('0x12'),'channel':_0x594bb6['channel'],'Exten':_0xa125('0x13'),'Context':_0xa125('0x14'),'Priority':'1','callerid':util[_0xa125('0xa')]('\x22%s\x22\x20<%s>',_0x594bb6['headerinfo']?_0x594bb6[_0xa125('0x8')]:'',_0x594bb6['localstationid']),'variable':_0x248f9d,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x594bb6[_0xa125('0x11')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index addcaad..373a690 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 _0xa636=['initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','getFreshsalesAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','log','listen','sync','util','./server','./report','./acw','./trigger','./dialer','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','get','hour','then','getAgents','getTelephones','initTelephones','getTrunks','initTrunks','getVoiceQueues','getTriggers','getTemplates','initTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','initSugarcrmAccounts','initFreshdeskAccounts'];(function(_0x53da91,_0x269795){var _0x58c9df=function(_0x4f54e2){while(--_0x4f54e2){_0x53da91['push'](_0x53da91['shift']());}};_0x58c9df(++_0x269795);}(_0xa636,0xe0));var _0x6a63=function(_0x28ad6c,_0x599a96){_0x28ad6c=_0x28ad6c-0x0;var _0x597de8=_0xa636[_0x28ad6c];return _0x597de8;};'use strict';var BPromise=require('bluebird');var util=require(_0x6a63('0x0'));var moment=require('moment');var server=require(_0x6a63('0x1'));var Realtime=require('./realtime');var Report=require(_0x6a63('0x2'));var Acw=require(_0x6a63('0x3'));var Trigger=require(_0x6a63('0x4'));var Dialer=require(_0x6a63('0x5'));var Preview=require(_0x6a63('0x6'));var Fax=require(_0x6a63('0x7'));var user=require(_0x6a63('0x8'));var voiceQueue=require(_0x6a63('0x9'));var voiceQueueReport=require(_0x6a63('0xa'));var voiceCallReport=require(_0x6a63('0xb'));var trunk=require(_0x6a63('0xc'));var trigger=require('./rpc/trigger');var template=require(_0x6a63('0xd'));var cmHopperHistory=require(_0x6a63('0xe'));var campaign=require(_0x6a63('0xf'));var voiceExtension=require(_0x6a63('0x10'));var faxAccount=require(_0x6a63('0x11'));var zendesk=require(_0x6a63('0x12'));var salesforce=require(_0x6a63('0x13'));var sugarcrm=require(_0x6a63('0x14'));var freshdesk=require(_0x6a63('0x15'));var desk=require(_0x6a63('0x16'));var zoho=require(_0x6a63('0x17'));var vtiger=require(_0x6a63('0x18'));var freshsales=require(_0x6a63('0x19'));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 isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x6a63('0x1a')](_0x6a63('0x1b'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x6a63('0x1a')]('hour')===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise['resolve']()[_0x6a63('0x1c')](user[_0x6a63('0x1d')]())[_0x6a63('0x1c')](realtime['initAgents']())[_0x6a63('0x1c')](user[_0x6a63('0x1e')]())['then'](realtime[_0x6a63('0x1f')]())['then'](trunk[_0x6a63('0x20')]())['then'](realtime[_0x6a63('0x21')]())['then'](voiceQueue[_0x6a63('0x22')]())[_0x6a63('0x1c')](realtime['initVoiceQueues']())['then'](trigger[_0x6a63('0x23')]())[_0x6a63('0x1c')](realtime['initTriggers']())[_0x6a63('0x1c')](template[_0x6a63('0x24')]())[_0x6a63('0x1c')](realtime[_0x6a63('0x25')]())['then'](zendesk[_0x6a63('0x26')]())[_0x6a63('0x1c')](realtime[_0x6a63('0x27')]())[_0x6a63('0x1c')](salesforce[_0x6a63('0x28')]())[_0x6a63('0x1c')](realtime[_0x6a63('0x29')]())[_0x6a63('0x1c')](sugarcrm['getSugarcrmAccounts']())[_0x6a63('0x1c')](realtime[_0x6a63('0x2a')]())[_0x6a63('0x1c')](freshdesk['getFreshdeskAccounts']())['then'](realtime[_0x6a63('0x2b')]())[_0x6a63('0x1c')](desk['getDeskAccounts']())[_0x6a63('0x1c')](realtime[_0x6a63('0x2c')]())[_0x6a63('0x1c')](zoho[_0x6a63('0x2d')]())[_0x6a63('0x1c')](realtime[_0x6a63('0x2e')]())[_0x6a63('0x1c')](vtiger[_0x6a63('0x2f')]())['then'](realtime['initVtigerAccounts']())[_0x6a63('0x1c')](freshsales[_0x6a63('0x30')]())[_0x6a63('0x1c')](realtime['initFreshsalesAccounts']())[_0x6a63('0x1c')](servicenow['getServicenowAccounts']())[_0x6a63('0x1c')](realtime[_0x6a63('0x31')]())[_0x6a63('0x1c')](dynamics365[_0x6a63('0x32')]())[_0x6a63('0x1c')](realtime[_0x6a63('0x33')]())['then'](campaign[_0x6a63('0x34')]())[_0x6a63('0x1c')](realtime[_0x6a63('0x35')]())[_0x6a63('0x1c')](voiceExtension[_0x6a63('0x36')]())[_0x6a63('0x1c')](realtime['initVoiceExtensions']())['then'](faxAccount['getFaxAccounts']())[_0x6a63('0x1c')](realtime[_0x6a63('0x37')]())[_0x6a63('0x1c')](function(){return realtime;});}function initParams(){return BPromise['resolve']()[_0x6a63('0x1c')](voiceQueueReport[_0x6a63('0x38')]())[_0x6a63('0x1c')](realtime[_0x6a63('0x39')]())['then'](cmHopperHistory[_0x6a63('0x3a')]())['then'](realtime['initVoiceQueueHopperHistory']())[_0x6a63('0x1c')](cmHopperHistory[_0x6a63('0x3b')]())[_0x6a63('0x1c')](realtime[_0x6a63('0x3c')]())['then'](voiceCallReport[_0x6a63('0x3d')]())[_0x6a63('0x1c')](realtime[_0x6a63('0x3e')]())['then'](function(_0x5c2c96){})[_0x6a63('0x3f')](function(_0x37818d){console[_0x6a63('0x40')](_0x37818d);});}function main(){return server[_0x6a63('0x41')](realtime,preview,fax)[_0x6a63('0x1c')](function(_0x52e226){return initRealtime();})[_0x6a63('0x1c')](function(){return initParams();})[_0x6a63('0x1c')](function(){report[_0x6a63('0x42')]();setInterval(initRealtime,0x1388);})[_0x6a63('0x3f')](function(_0x3938a3){console[_0x6a63('0x40')](_0x3938a3);});}main(); \ No newline at end of file +var _0x849e=['./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/dynamics365','get','hour','then','initAgents','getTelephones','getTrunks','initTrunks','getVoiceQueues','getTriggers','initTriggers','getTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','getZohoAccounts','initZohoAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','resolve','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','getCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','log','listen','sync','catch','moment','./server','./realtime','./report','./acw','./trigger','./preview'];(function(_0x53914c,_0x302ac0){var _0x40decd=function(_0x4a14a0){while(--_0x4a14a0){_0x53914c['push'](_0x53914c['shift']());}};_0x40decd(++_0x302ac0);}(_0x849e,0x19d));var _0xe849=function(_0x2f6b21,_0x2f8725){_0x2f6b21=_0x2f6b21-0x0;var _0x5c74b0=_0x849e[_0x2f6b21];return _0x5c74b0;};'use strict';var BPromise=require('bluebird');var util=require('util');var moment=require(_0xe849('0x0'));var server=require(_0xe849('0x1'));var Realtime=require(_0xe849('0x2'));var Report=require(_0xe849('0x3'));var Acw=require(_0xe849('0x4'));var Trigger=require(_0xe849('0x5'));var Dialer=require('./dialer');var Preview=require(_0xe849('0x6'));var Fax=require(_0xe849('0x7'));var user=require(_0xe849('0x8'));var voiceQueue=require(_0xe849('0x9'));var voiceQueueReport=require(_0xe849('0xa'));var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require(_0xe849('0xb'));var trigger=require(_0xe849('0xc'));var template=require(_0xe849('0xd'));var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require(_0xe849('0xe'));var voiceExtension=require(_0xe849('0xf'));var faxAccount=require(_0xe849('0x10'));var zendesk=require(_0xe849('0x11'));var salesforce=require(_0xe849('0x12'));var sugarcrm=require(_0xe849('0x13'));var freshdesk=require(_0xe849('0x14'));var desk=require(_0xe849('0x15'));var zoho=require(_0xe849('0x16'));var vtiger=require(_0xe849('0x17'));var freshsales=require(_0xe849('0x18'));var servicenow=require('./rpc/integrations/servicenow');var dynamics365=require(_0xe849('0x19'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0xe849('0x1a')](_0xe849('0x1b'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0xe849('0x1a')](_0xe849('0x1b'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise['resolve']()[_0xe849('0x1c')](user['getAgents']())[_0xe849('0x1c')](realtime[_0xe849('0x1d')]())[_0xe849('0x1c')](user[_0xe849('0x1e')]())[_0xe849('0x1c')](realtime['initTelephones']())['then'](trunk[_0xe849('0x1f')]())['then'](realtime[_0xe849('0x20')]())['then'](voiceQueue[_0xe849('0x21')]())[_0xe849('0x1c')](realtime['initVoiceQueues']())[_0xe849('0x1c')](trigger[_0xe849('0x22')]())[_0xe849('0x1c')](realtime[_0xe849('0x23')]())[_0xe849('0x1c')](template[_0xe849('0x24')]())[_0xe849('0x1c')](realtime['initTemplates']())['then'](zendesk[_0xe849('0x25')]())[_0xe849('0x1c')](realtime[_0xe849('0x26')]())['then'](salesforce[_0xe849('0x27')]())[_0xe849('0x1c')](realtime[_0xe849('0x28')]())[_0xe849('0x1c')](sugarcrm[_0xe849('0x29')]())[_0xe849('0x1c')](realtime['initSugarcrmAccounts']())['then'](freshdesk[_0xe849('0x2a')]())[_0xe849('0x1c')](realtime[_0xe849('0x2b')]())[_0xe849('0x1c')](desk[_0xe849('0x2c')]())[_0xe849('0x1c')](realtime['initDeskAccounts']())[_0xe849('0x1c')](zoho[_0xe849('0x2d')]())[_0xe849('0x1c')](realtime[_0xe849('0x2e')]())[_0xe849('0x1c')](vtiger['getVtigerAccounts']())[_0xe849('0x1c')](realtime[_0xe849('0x2f')]())[_0xe849('0x1c')](freshsales[_0xe849('0x30')]())[_0xe849('0x1c')](realtime[_0xe849('0x31')]())['then'](servicenow[_0xe849('0x32')]())[_0xe849('0x1c')](realtime[_0xe849('0x33')]())[_0xe849('0x1c')](dynamics365['getDynamics365Accounts']())[_0xe849('0x1c')](realtime[_0xe849('0x34')]())[_0xe849('0x1c')](campaign[_0xe849('0x35')]())[_0xe849('0x1c')](realtime[_0xe849('0x36')]())[_0xe849('0x1c')](voiceExtension[_0xe849('0x37')]())['then'](realtime[_0xe849('0x38')]())[_0xe849('0x1c')](faxAccount[_0xe849('0x39')]())[_0xe849('0x1c')](realtime[_0xe849('0x3a')]())[_0xe849('0x1c')](function(){return realtime;});}function initParams(){return BPromise[_0xe849('0x3b')]()['then'](voiceQueueReport[_0xe849('0x3c')]())[_0xe849('0x1c')](realtime[_0xe849('0x3d')]())[_0xe849('0x1c')](cmHopperHistory[_0xe849('0x3e')]())['then'](realtime['initVoiceQueueHopperHistory']())[_0xe849('0x1c')](cmHopperHistory[_0xe849('0x3f')]())[_0xe849('0x1c')](realtime['initCampaignHopperHistory']())[_0xe849('0x1c')](voiceCallReport[_0xe849('0x40')]())[_0xe849('0x1c')](realtime[_0xe849('0x41')]())[_0xe849('0x1c')](function(_0x5a71d2){})['catch'](function(_0x339855){console[_0xe849('0x42')](_0x339855);});}function main(){return server[_0xe849('0x43')](realtime,preview,fax)['then'](function(_0x3cc071){return initRealtime();})[_0xe849('0x1c')](function(){return initParams();})['then'](function(){report[_0xe849('0x44')]();setInterval(initRealtime,0x1388);})[_0xe849('0x45')](function(_0x418649){console[_0xe849('0x42')](_0x418649);});}main(); \ No newline at end of file diff --git a/server/services/ami/model/agent.js b/server/services/ami/model/agent.js index 0501c0e..be09ef6 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(_0x432a9a,_0x5d951c){var _0x5dc88c=function(_0x2f5ee8){while(--_0x2f5ee8){_0x432a9a['push'](_0x432a9a['shift']());}};_0x5dc88c(++_0x5d951c);}(_0xe706,0xa3));var _0x6e70=function(_0x134999,_0x4de0c9){_0x134999=_0x134999-0x0;var _0x46e471=_0xe706[_0x134999];return _0x46e471;};'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 _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(_0x56d74b,_0x25faac){var _0x2a5ebf=function(_0x35f2d0){while(--_0x35f2d0){_0x56d74b['push'](_0x56d74b['shift']());}};_0x2a5ebf(++_0x25faac);}(_0xe706,0xa3));var _0x6e70=function(_0x487ab4,_0x1e24e8){_0x487ab4=_0x487ab4-0x0;var _0x3bef77=_0xe706[_0x487ab4];return _0x3bef77;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var moment=require(_0x6e70('0x2'));var md5=require('md5');var Redis=require(_0x6e70('0x3'));var config=require(_0x6e70('0x4'));config[_0x6e70('0x5')]=_[_0x6e70('0x6')](config[_0x6e70('0x5')],{'host':_0x6e70('0x7'),'port':0x18eb});var io=require(_0x6e70('0x8'))(new Redis(config[_0x6e70('0x5')]));function Agent(_0x1b0389){this['id']=_0x1b0389['id']||0x0;this[_0x6e70('0x9')]=_0x1b0389[_0x6e70('0x9')]||'';this[_0x6e70('0xa')]=_0x1b0389[_0x6e70('0xa')]||'';this[_0x6e70('0xb')]=_0x1b0389[_0x6e70('0xb')]||'';this[_0x6e70('0xc')]=_0x1b0389[_0x6e70('0xc')]||'';this[_0x6e70('0xd')]=_0x6e70('0xe');this[_0x6e70('0xf')]=0x0;this[_0x6e70('0x10')]=_0x6e70('0xe');this[_0x6e70('0x11')]='';this[_0x6e70('0x12')]='';this['mobile']='';this['interface']='';this[_0x6e70('0x13')]=_0x1b0389[_0x6e70('0x13')]||![];this[_0x6e70('0x14')]=_0x6e70('0xe');this[_0x6e70('0x15')]=0x0;this[_0x6e70('0x16')]='';this[_0x6e70('0x17')]='';this[_0x6e70('0x18')]=![];this['local']=![];this['md5']='';}Agent['prototype'][_0x6e70('0x19')]=function(_0x5a37a6){var _0x53aed0;if(_0x5a37a6&&_0x5a37a6[_0x6e70('0xd')]){_0x53aed0=_0x5a37a6[_0x6e70('0xd')]['toLowerCase']();switch(_0x53aed0){case _0x6e70('0x1a'):_0x53aed0='idle';break;case _0x6e70('0x1b'):_0x53aed0=_0x6e70('0x1c');break;}}if(_0x53aed0&&this['voiceStatus']!==_0x53aed0||_0x5a37a6['statePause']){this[_0x6e70('0x15')]=_['toNumber'](moment()[_0x6e70('0x1d')]('x'));}if(_0x53aed0){this[_0x6e70('0x14')]=_0x53aed0;}var _0x53acdc={'id':this['id'],'name':this['name'],'email':this[_0x6e70('0xa')],'accountcode':this[_0x6e70('0xb')],'fullname':this[_0x6e70('0xc')],'state':this[_0x6e70('0xd')],'stateTime':this[_0x6e70('0xf')],'status':this[_0x6e70('0x10')],'address':this[_0x6e70('0x11')],'online':this[_0x6e70('0x13')],'voiceStatus':this[_0x6e70('0x14')],'voiceStatusTime':this[_0x6e70('0x15')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0x6e70('0x17')],'interface':this[_0x6e70('0x1e')],'onhold':this[_0x6e70('0x18')]};var _0x502b2d=md5(JSON[_0x6e70('0x1f')](_0x53acdc));if(this[_0x6e70('0x20')]!==_0x502b2d){this[_0x6e70('0x20')]=_0x502b2d;io['to'](util['format'](_0x6e70('0x21'),_0x53acdc['name']))['emit']('user:save',_0x53acdc);io[_0x6e70('0x22')](_0x6e70('0x23'),_0x53acdc);}};module['exports']=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index b51bc62..17d6ef8 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 _0x11d9=['originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialOrderByScheduledAt','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','name','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','type','campaign'];(function(_0x2085f3,_0x50105b){var _0x384e3c=function(_0x235fa0){while(--_0x235fa0){_0x2085f3['push'](_0x2085f3['shift']());}};_0x384e3c(++_0x50105b);}(_0x11d9,0x155));var _0x911d=function(_0x48e404,_0x579a40){_0x48e404=_0x48e404-0x0;var _0x217f36=_0x11d9[_0x48e404];return _0x217f36;};'use strict';function Campaign(_0x59f80e){this['id']=_0x59f80e['id']||0x0;this['name']=_0x59f80e['name']||'';this[_0x911d('0x0')]=_0x59f80e[_0x911d('0x0')]||_0x911d('0x1');this[_0x911d('0x2')]=0x0;this[_0x911d('0x3')]=0x0;this[_0x911d('0x4')]=0x0;this[_0x911d('0x5')]=0x0;this[_0x911d('0x6')]='';this[_0x911d('0x7')]=!![];this[_0x911d('0x8')]=_0x59f80e[_0x911d('0x8')];this[_0x911d('0x9')]=_0x59f80e[_0x911d('0x9')];this[_0x911d('0xa')]=_0x59f80e[_0x911d('0xa')]||null;this[_0x911d('0xb')]=_0x59f80e['dialGlobalInterval']?_0x59f80e[_0x911d('0xb')]:null;this[_0x911d('0xc')]=_0x59f80e[_0x911d('0xc')];this[_0x911d('0xd')]=_0x59f80e[_0x911d('0xd')];this['dialOriginateTimeout']=_0x59f80e[_0x911d('0xe')]||0x1e;this['dialCongestionMaxRetry']=_0x59f80e['dialCongestionMaxRetry'];this[_0x911d('0xf')]=_0x59f80e[_0x911d('0xf')];this[_0x911d('0x10')]=_0x59f80e[_0x911d('0x10')];this['dialBusyRetryFrequency']=_0x59f80e[_0x911d('0x11')];this['dialNoAnswerMaxRetry']=_0x59f80e[_0x911d('0x12')];this[_0x911d('0x13')]=_0x59f80e[_0x911d('0x13')];this[_0x911d('0x14')]=_0x59f80e[_0x911d('0x14')];this[_0x911d('0x15')]=_0x59f80e[_0x911d('0x15')]||0x3;this[_0x911d('0x16')]=_0x59f80e['dialNoSuchNumberRetryFrequency']||0x96;this['dialDropMaxRetry']=_0x59f80e[_0x911d('0x17')]||0x3;this['dialDropRetryFrequency']=_0x59f80e[_0x911d('0x18')]||0x96;this[_0x911d('0x19')]=_0x59f80e[_0x911d('0x19')]||0x3;this['dialAbandonedRetryFrequency']=_0x59f80e['dialAbandonedRetryFrequency']||0x96;this[_0x911d('0x1a')]=_0x59f80e[_0x911d('0x1a')]||0x3;this[_0x911d('0x1b')]=_0x59f80e['dialMachineRetryFrequency']||0x96;this[_0x911d('0x1c')]=_0x59f80e['dialAgentRejectMaxRetry']||0x3;this['dialAgentRejectRetryFrequency']=_0x59f80e['dialAgentRejectRetryFrequency']||0x96;this['dialOrderByScheduledAt']=_0x59f80e[_0x911d('0x1d')]||'DESC';this['dialPrefix']=_0x59f80e[_0x911d('0x1e')]||undefined;this[_0x911d('0x1f')]=_0x59f80e[_0x911d('0x1f')]||undefined;this[_0x911d('0x20')]=_0x59f80e[_0x911d('0x20')]||undefined;this['TrunkBackup']=_0x59f80e[_0x911d('0x21')]?_0x59f80e[_0x911d('0x21')]:undefined;this[_0x911d('0x22')]=_0x59f80e['Trunk']?_0x59f80e[_0x911d('0x22')]:undefined;this[_0x911d('0x23')]=_0x59f80e[_0x911d('0x23')]?_0x59f80e[_0x911d('0x23')]:undefined;this[_0x911d('0x24')]=_0x59f80e['SquareProject']?_0x59f80e['SquareProject']:undefined;this[_0x911d('0x25')]=_0x59f80e[_0x911d('0x24')]?_0x59f80e[_0x911d('0x24')][_0x911d('0x26')]:undefined;this[_0x911d('0x27')]=_0x59f80e[_0x911d('0x27')]||![];this[_0x911d('0x28')]=_0x59f80e[_0x911d('0x28')];this[_0x911d('0x29')]=_0x59f80e['dialAMDGreeting'];this[_0x911d('0x2a')]=_0x59f80e[_0x911d('0x2a')];this['dialAMDTotalAnalysisTime']=_0x59f80e[_0x911d('0x2b')];this['dialAMDMinWordLength']=_0x59f80e[_0x911d('0x2c')];this['dialAMDBetweenWordsSilence']=_0x59f80e[_0x911d('0x2d')];this[_0x911d('0x2e')]=_0x59f80e[_0x911d('0x2e')];this[_0x911d('0x2f')]=_0x59f80e['dialAMDSilenceThreshold'];this['dialAMDMaximumWordLength']=_0x59f80e[_0x911d('0x30')];}module['exports']=Campaign; \ No newline at end of file +var _0xb6e0=['dialAMDMaximumWordLength','exports','name','type','campaign','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords'];(function(_0x46184c,_0x31958e){var _0x3127f2=function(_0x2e5542){while(--_0x2e5542){_0x46184c['push'](_0x46184c['shift']());}};_0x3127f2(++_0x31958e);}(_0xb6e0,0x66));var _0x0b6e=function(_0x33d3e8,_0x3f57a6){_0x33d3e8=_0x33d3e8-0x0;var _0x397d73=_0xb6e0[_0x33d3e8];return _0x397d73;};'use strict';function Campaign(_0x1051ba){this['id']=_0x1051ba['id']||0x0;this[_0x0b6e('0x0')]=_0x1051ba['name']||'';this[_0x0b6e('0x1')]=_0x1051ba[_0x0b6e('0x1')]||_0x0b6e('0x2');this[_0x0b6e('0x3')]=0x0;this[_0x0b6e('0x4')]=0x0;this[_0x0b6e('0x5')]=0x0;this[_0x0b6e('0x6')]=0x0;this[_0x0b6e('0x7')]='';this[_0x0b6e('0x8')]=!![];this[_0x0b6e('0x9')]=_0x1051ba[_0x0b6e('0x9')];this[_0x0b6e('0xa')]=_0x1051ba[_0x0b6e('0xa')];this[_0x0b6e('0xb')]=_0x1051ba[_0x0b6e('0xb')]||null;this[_0x0b6e('0xc')]=_0x1051ba['dialGlobalInterval']?_0x1051ba[_0x0b6e('0xc')]:null;this[_0x0b6e('0xd')]=_0x1051ba[_0x0b6e('0xd')];this[_0x0b6e('0xe')]=_0x1051ba[_0x0b6e('0xe')];this[_0x0b6e('0xf')]=_0x1051ba[_0x0b6e('0xf')]||0x1e;this[_0x0b6e('0x10')]=_0x1051ba[_0x0b6e('0x10')];this[_0x0b6e('0x11')]=_0x1051ba[_0x0b6e('0x11')];this[_0x0b6e('0x12')]=_0x1051ba[_0x0b6e('0x12')];this[_0x0b6e('0x13')]=_0x1051ba[_0x0b6e('0x13')];this[_0x0b6e('0x14')]=_0x1051ba[_0x0b6e('0x14')];this[_0x0b6e('0x15')]=_0x1051ba[_0x0b6e('0x15')];this['dialGlobalMaxRetry']=_0x1051ba[_0x0b6e('0x16')];this[_0x0b6e('0x17')]=_0x1051ba[_0x0b6e('0x17')]||0x3;this[_0x0b6e('0x18')]=_0x1051ba['dialNoSuchNumberRetryFrequency']||0x96;this[_0x0b6e('0x19')]=_0x1051ba[_0x0b6e('0x19')]||0x3;this[_0x0b6e('0x1a')]=_0x1051ba[_0x0b6e('0x1a')]||0x96;this[_0x0b6e('0x1b')]=_0x1051ba['dialAbandonedMaxRetry']||0x3;this['dialAbandonedRetryFrequency']=_0x1051ba[_0x0b6e('0x1c')]||0x96;this['dialMachineMaxRetry']=_0x1051ba['dialMachineMaxRetry']||0x3;this[_0x0b6e('0x1d')]=_0x1051ba[_0x0b6e('0x1d')]||0x96;this['dialAgentRejectMaxRetry']=_0x1051ba[_0x0b6e('0x1e')]||0x3;this[_0x0b6e('0x1f')]=_0x1051ba[_0x0b6e('0x1f')]||0x96;this[_0x0b6e('0x20')]=_0x1051ba[_0x0b6e('0x20')]||_0x0b6e('0x21');this[_0x0b6e('0x22')]=_0x1051ba[_0x0b6e('0x22')]||undefined;this['dialRandomLastDigitCallerIdNumber']=_0x1051ba[_0x0b6e('0x23')]||undefined;this[_0x0b6e('0x24')]=_0x1051ba[_0x0b6e('0x24')]||undefined;this['TrunkBackup']=_0x1051ba[_0x0b6e('0x25')]?_0x1051ba[_0x0b6e('0x25')]:undefined;this[_0x0b6e('0x26')]=_0x1051ba[_0x0b6e('0x26')]?_0x1051ba['Trunk']:undefined;this[_0x0b6e('0x27')]=_0x1051ba[_0x0b6e('0x27')]?_0x1051ba[_0x0b6e('0x27')]:undefined;this['SquareProject']=_0x1051ba['SquareProject']?_0x1051ba[_0x0b6e('0x28')]:undefined;this['dialQueueProject']=_0x1051ba['SquareProject']?_0x1051ba[_0x0b6e('0x28')][_0x0b6e('0x0')]:undefined;this['dialAMDActive']=_0x1051ba[_0x0b6e('0x29')]||![];this['dialAMDInitialSilence']=_0x1051ba[_0x0b6e('0x2a')];this[_0x0b6e('0x2b')]=_0x1051ba[_0x0b6e('0x2b')];this['dialAMDAfterGreetingSilence']=_0x1051ba['dialAMDAfterGreetingSilence'];this['dialAMDTotalAnalysisTime']=_0x1051ba[_0x0b6e('0x2c')];this[_0x0b6e('0x2d')]=_0x1051ba[_0x0b6e('0x2d')];this['dialAMDBetweenWordsSilence']=_0x1051ba[_0x0b6e('0x2e')];this['dialAMDMaximumNumberOfWords']=_0x1051ba[_0x0b6e('0x2f')];this['dialAMDSilenceThreshold']=_0x1051ba['dialAMDSilenceThreshold'];this['dialAMDMaximumWordLength']=_0x1051ba[_0x0b6e('0x30')];}module[_0x0b6e('0x31')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index 8a3964f..81e7b09 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 _0x00ea=['abandoned','lastapplication','duration','billableseconds','type','tag','disposition','monitorFilename','queue','transfercalleridnum','transferType','mohtime','exports','channel','destinationchannel','calleridname','connectedlinenum','connectedlinename','accountcode','context','uniqueid','exten','answered','answertime','endtime'];(function(_0x187a70,_0x1c55a0){var _0x33e3e9=function(_0x1d5873){while(--_0x1d5873){_0x187a70['push'](_0x187a70['shift']());}};_0x33e3e9(++_0x1c55a0);}(_0x00ea,0x19d));var _0xa00e=function(_0x4d1e96,_0x36196a){_0x4d1e96=_0x4d1e96-0x0;var _0x1e0c01=_0x00ea[_0x4d1e96];return _0x1e0c01;};'use strict';function Channel(){this['starttime']=null;this[_0xa00e('0x0')]='';this[_0xa00e('0x1')]='';this['calleridnum']=0x0;this[_0xa00e('0x2')]='';this[_0xa00e('0x3')]=undefined;this[_0xa00e('0x4')]=undefined;this[_0xa00e('0x5')]=0x0;this[_0xa00e('0x6')]='';this[_0xa00e('0x7')]=0x0;this['linkedid']=0x0;this[_0xa00e('0x8')]=0x0;this[_0xa00e('0x9')]=![];this[_0xa00e('0xa')]=null;this[_0xa00e('0xb')]=null;this['unmanaged']=![];this[_0xa00e('0xc')]=![];this[_0xa00e('0xd')]='';this['lastdata']='';this[_0xa00e('0xe')]=0x0;this[_0xa00e('0xf')]=0x0;this['holdtime']=0x0;this[_0xa00e('0x10')]=null;this[_0xa00e('0x11')]=null;this[_0xa00e('0x12')]=null;this['monitor']=![];this[_0xa00e('0x13')]=null;this[_0xa00e('0x14')]=null;this['monitors']=[];this[_0xa00e('0x15')]=undefined;this['transferconnectedlinenum']=undefined;this[_0xa00e('0x16')]=undefined;this[_0xa00e('0x17')]=0x0;}module[_0xa00e('0x18')]=Channel; \ No newline at end of file +var _0xea12=['exten','answertime','endtime','abandoned','duration','billableseconds','type','tag','queue','transferType','mohtime','exports','starttime','channel','destinationchannel','calleridnum','connectedlinenum','connectedlinename','context','uniqueid','linkedid'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xea12,0x1c5));var _0x2ea1=function(_0x18fdfb,_0x1bea79){_0x18fdfb=_0x18fdfb-0x0;var _0x4a0a85=_0xea12[_0x18fdfb];return _0x4a0a85;};'use strict';function Channel(){this[_0x2ea1('0x0')]=null;this[_0x2ea1('0x1')]='';this[_0x2ea1('0x2')]='';this[_0x2ea1('0x3')]=0x0;this['calleridname']='';this[_0x2ea1('0x4')]=undefined;this[_0x2ea1('0x5')]=undefined;this['accountcode']=0x0;this[_0x2ea1('0x6')]='';this[_0x2ea1('0x7')]=0x0;this[_0x2ea1('0x8')]=0x0;this[_0x2ea1('0x9')]=0x0;this['answered']=![];this[_0x2ea1('0xa')]=null;this[_0x2ea1('0xb')]=null;this['unmanaged']=![];this[_0x2ea1('0xc')]=![];this['lastapplication']='';this['lastdata']='';this[_0x2ea1('0xd')]=0x0;this[_0x2ea1('0xe')]=0x0;this['holdtime']=0x0;this[_0x2ea1('0xf')]=null;this[_0x2ea1('0x10')]=null;this['disposition']=null;this['monitor']=![];this['monitorFilename']=null;this[_0x2ea1('0x11')]=null;this['monitors']=[];this['transfercalleridnum']=undefined;this['transferconnectedlinenum']=undefined;this[_0x2ea1('0x12')]=undefined;this[_0x2ea1('0x13')]=0x0;}module[_0x2ea1('0x14')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index 0281287..2b0960e 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 _0x4fa2=['serverUrl','Configurations','exports','name','username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type'];(function(_0x53d22f,_0x467b3c){var _0xc332de=function(_0x380419){while(--_0x380419){_0x53d22f['push'](_0x53d22f['shift']());}};_0xc332de(++_0x467b3c);}(_0x4fa2,0x107));var _0x24fa=function(_0x2afbb0,_0x44f16d){_0x2afbb0=_0x2afbb0-0x0;var _0x411ff2=_0x4fa2[_0x2afbb0];return _0x411ff2;};'use strict';function DeskAccount(_0x5c2195){this['id']=_0x5c2195['id']||0x0;this[_0x24fa('0x0')]=_0x5c2195['name']||'';this['username']=_0x5c2195[_0x24fa('0x1')]||'';this[_0x24fa('0x2')]=_0x5c2195[_0x24fa('0x2')]||'';this[_0x24fa('0x3')]=_0x5c2195[_0x24fa('0x3')]||'';this[_0x24fa('0x4')]=_0x5c2195[_0x24fa('0x4')]||'';this['consumerKey']=_0x5c2195[_0x24fa('0x5')]||'';this[_0x24fa('0x6')]=_0x5c2195[_0x24fa('0x6')]||'';this[_0x24fa('0x7')]=_0x5c2195['token']||'';this[_0x24fa('0x8')]=_0x5c2195[_0x24fa('0x8')]||'';this[_0x24fa('0x9')]=_0x5c2195[_0x24fa('0x9')]||'';this[_0x24fa('0xa')]=_0x5c2195[_0x24fa('0xa')]||'';this[_0x24fa('0xb')]=_0x5c2195[_0x24fa('0xb')]||{};}module[_0x24fa('0xc')]=DeskAccount; \ No newline at end of file +var _0xca5e=['tokenSecret','type','serverUrl','Configurations','name','username','remoteUri','authType','consumerSecret','token'];(function(_0x574ef0,_0xbb264c){var _0x364c97=function(_0x22cf99){while(--_0x22cf99){_0x574ef0['push'](_0x574ef0['shift']());}};_0x364c97(++_0xbb264c);}(_0xca5e,0x108));var _0xeca5=function(_0x4b61d2,_0x4c9cdb){_0x4b61d2=_0x4b61d2-0x0;var _0x33fc2a=_0xca5e[_0x4b61d2];return _0x33fc2a;};'use strict';function DeskAccount(_0x57d4b7){this['id']=_0x57d4b7['id']||0x0;this[_0xeca5('0x0')]=_0x57d4b7['name']||'';this[_0xeca5('0x1')]=_0x57d4b7[_0xeca5('0x1')]||'';this[_0xeca5('0x2')]=_0x57d4b7['remoteUri']||'';this[_0xeca5('0x3')]=_0x57d4b7['authType']||'';this['password']=_0x57d4b7['password']||'';this['consumerKey']=_0x57d4b7['consumerKey']||'';this[_0xeca5('0x4')]=_0x57d4b7['consumerSecret']||'';this[_0xeca5('0x5')]=_0x57d4b7[_0xeca5('0x5')]||'';this['tokenSecret']=_0x57d4b7[_0xeca5('0x6')]||'';this[_0xeca5('0x7')]=_0x57d4b7[_0xeca5('0x7')]||'';this['serverUrl']=_0x57d4b7[_0xeca5('0x8')]||'';this[_0xeca5('0x9')]=_0x57d4b7[_0xeca5('0x9')]||{};}module['exports']=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index d94042f..94a3602 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(_0x4099ee,_0x38495a){var _0x1b7bfc=function(_0x5f5388){while(--_0x5f5388){_0x4099ee['push'](_0x4099ee['shift']());}};_0x1b7bfc(++_0x38495a);}(_0xe706,0xa3));var _0x6e70=function(_0x42276c,_0x141d47){_0x42276c=_0x42276c-0x0;var _0x1b5009=_0xe706[_0x42276c];return _0x1b5009;};'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 _0x6e6c=['clientSecret','serverUrl','Configurations','name','username','remoteUri','tenantId','clientId'];(function(_0x207489,_0xad20bf){var _0x23b632=function(_0x51f8ee){while(--_0x51f8ee){_0x207489['push'](_0x207489['shift']());}};_0x23b632(++_0xad20bf);}(_0x6e6c,0xc3));var _0xc6e6=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x6e6c[_0x501510];return _0x1e6ee5;};'use strict';function Dynamics365Account(_0xc51915){this['id']=_0xc51915['id']||0x0;this[_0xc6e6('0x0')]=_0xc51915['name']||'';this[_0xc6e6('0x1')]=_0xc51915[_0xc6e6('0x1')]||'';this['password']=_0xc51915['password']||'';this[_0xc6e6('0x2')]=_0xc51915['remoteUri']||'';this[_0xc6e6('0x3')]=_0xc51915['tenantId']||'';this[_0xc6e6('0x4')]=_0xc51915[_0xc6e6('0x4')]||'';this['clientSecret']=_0xc51915[_0xc6e6('0x5')]||{};this[_0xc6e6('0x6')]=_0xc51915['serverUrl']||'';this[_0xc6e6('0x7')]=_0xc51915[_0xc6e6('0x7')]||{};}module['exports']=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index 0134131..fa4b1b4 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 _0xec63=['modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','name','description','ecm','headerinfo','localstationid','minrate','maxrate'];(function(_0x39db05,_0x3868d0){var _0x3f0e22=function(_0x532c4f){while(--_0x532c4f){_0x39db05['push'](_0x39db05['shift']());}};_0x3f0e22(++_0x3868d0);}(_0xec63,0x12b));var _0x3ec6=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xec63[_0x20a584];return _0x4b41a8;};'use strict';function FaxAccount(_0x316135){this['id']=_0x316135['id']||0x0;this[_0x3ec6('0x0')]=_0x316135[_0x3ec6('0x0')]||'';this[_0x3ec6('0x1')]=_0x316135[_0x3ec6('0x1')];this[_0x3ec6('0x2')]=_0x316135[_0x3ec6('0x2')];this[_0x3ec6('0x3')]=_0x316135[_0x3ec6('0x3')];this[_0x3ec6('0x4')]=_0x316135['localstationid'];this[_0x3ec6('0x5')]=_0x316135[_0x3ec6('0x5')]||0x960;this['maxrate']=_0x316135[_0x3ec6('0x6')]||0x3840;this[_0x3ec6('0x7')]=_0x316135[_0x3ec6('0x7')]||_0x3ec6('0x8');this[_0x3ec6('0x9')]=_0x316135[_0x3ec6('0x9')]||'no';this[_0x3ec6('0xa')]=_0x316135[_0x3ec6('0xa')]||'no';this[_0x3ec6('0xb')]=_0x316135['t38timeout']||0x1388;this[_0x3ec6('0xc')]=_0x316135[_0x3ec6('0xc')]||_0x3ec6('0xd');this['Trunk']=_0x316135['Trunk']?_0x316135[_0x3ec6('0xe')]:undefined;this[_0x3ec6('0xf')]=_0x316135['ListId'];this[_0x3ec6('0x10')]=_0x316135['key'];}module['exports']=FaxAccount; \ No newline at end of file +var _0x4331=['ListId','key','exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','tech','SIP','Trunk'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x4331,0x9c));var _0x1433=function(_0x21f27d,_0x2305ba){_0x21f27d=_0x21f27d-0x0;var _0x504a7b=_0x4331[_0x21f27d];return _0x504a7b;};'use strict';function FaxAccount(_0x9deed3){this['id']=_0x9deed3['id']||0x0;this[_0x1433('0x0')]=_0x9deed3['name']||'';this['description']=_0x9deed3[_0x1433('0x1')];this[_0x1433('0x2')]=_0x9deed3[_0x1433('0x2')];this['headerinfo']=_0x9deed3[_0x1433('0x3')];this[_0x1433('0x4')]=_0x9deed3[_0x1433('0x4')];this['minrate']=_0x9deed3[_0x1433('0x5')]||0x960;this[_0x1433('0x6')]=_0x9deed3[_0x1433('0x6')]||0x3840;this[_0x1433('0x7')]=_0x9deed3[_0x1433('0x7')]||_0x1433('0x8');this[_0x1433('0x9')]=_0x9deed3['gateway']||'no';this[_0x1433('0xa')]=_0x9deed3['faxdetect']||'no';this['t38timeout']=_0x9deed3['t38timeout']||0x1388;this[_0x1433('0xb')]=_0x9deed3[_0x1433('0xb')]||_0x1433('0xc');this[_0x1433('0xd')]=_0x9deed3[_0x1433('0xd')]?_0x9deed3[_0x1433('0xd')]:undefined;this[_0x1433('0xe')]=_0x9deed3[_0x1433('0xe')];this[_0x1433('0xf')]=_0x9deed3[_0x1433('0xf')];}module[_0x1433('0x10')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index 8d5bd11..6582de2 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 _0xb68f=['token','remoteUri','serverUrl','Configurations','name','username'];(function(_0x17510c,_0x33647c){var _0x40edef=function(_0xe326be){while(--_0xe326be){_0x17510c['push'](_0x17510c['shift']());}};_0x40edef(++_0x33647c);}(_0xb68f,0x1d8));var _0xfb68=function(_0x2e1299,_0x143cc9){_0x2e1299=_0x2e1299-0x0;var _0x690203=_0xb68f[_0x2e1299];return _0x690203;};'use strict';function FreshdeskAccount(_0x29f675){this['id']=_0x29f675['id']||0x0;this[_0xfb68('0x0')]=_0x29f675[_0xfb68('0x0')]||'';this[_0xfb68('0x1')]=_0x29f675[_0xfb68('0x1')]||'';this['apiKey']=_0x29f675[_0xfb68('0x2')]||'';this[_0xfb68('0x3')]=_0x29f675[_0xfb68('0x3')]||'';this['serverUrl']=_0x29f675[_0xfb68('0x4')]||'';this['Configurations']=_0x29f675[_0xfb68('0x5')]||{};}module['exports']=FreshdeskAccount; \ No newline at end of file +var _0xeae9=['username','apiKey','token','serverUrl','exports','name'];(function(_0x123ada,_0x1da51a){var _0x360ae2=function(_0x2380f1){while(--_0x2380f1){_0x123ada['push'](_0x123ada['shift']());}};_0x360ae2(++_0x1da51a);}(_0xeae9,0xe9));var _0x9eae=function(_0x2c4841,_0x354e33){_0x2c4841=_0x2c4841-0x0;var _0x18ef3d=_0xeae9[_0x2c4841];return _0x18ef3d;};'use strict';function FreshdeskAccount(_0x47de21){this['id']=_0x47de21['id']||0x0;this[_0x9eae('0x0')]=_0x47de21[_0x9eae('0x0')]||'';this[_0x9eae('0x1')]=_0x47de21[_0x9eae('0x1')]||'';this[_0x9eae('0x2')]=_0x47de21[_0x9eae('0x3')]||'';this['remoteUri']=_0x47de21['remoteUri']||'';this['serverUrl']=_0x47de21[_0x9eae('0x4')]||'';this['Configurations']=_0x47de21['Configurations']||{};}module[_0x9eae('0x5')]=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index bfa6ea4..217b162 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 _0x9a14=['name','username','apiKey','token','remoteUri','serverUrl'];(function(_0x29de96,_0x42cc38){var _0x1b9352=function(_0x4a288a){while(--_0x4a288a){_0x29de96['push'](_0x29de96['shift']());}};_0x1b9352(++_0x42cc38);}(_0x9a14,0xa8));var _0x49a1=function(_0x3ca5dc,_0x3e5c12){_0x3ca5dc=_0x3ca5dc-0x0;var _0x4d3b89=_0x9a14[_0x3ca5dc];return _0x4d3b89;};'use strict';function FreshsalesAccount(_0x1d4a28){this['id']=_0x1d4a28['id']||0x0;this['name']=_0x1d4a28[_0x49a1('0x0')]||'';this[_0x49a1('0x1')]=_0x1d4a28[_0x49a1('0x1')]||'';this[_0x49a1('0x2')]=_0x1d4a28[_0x49a1('0x3')]||'';this[_0x49a1('0x4')]=_0x1d4a28[_0x49a1('0x4')]||'';this[_0x49a1('0x5')]=_0x1d4a28['serverUrl']||'';this['Configurations']=_0x1d4a28['Configurations']||{};}module['exports']=FreshsalesAccount; \ No newline at end of file +var _0xe260=['Configurations','name','username','apiKey','token','remoteUri','serverUrl'];(function(_0x309f89,_0x4dcee4){var _0xbbbf35=function(_0x5461c4){while(--_0x5461c4){_0x309f89['push'](_0x309f89['shift']());}};_0xbbbf35(++_0x4dcee4);}(_0xe260,0x94));var _0x0e26=function(_0xaead12,_0x49ab24){_0xaead12=_0xaead12-0x0;var _0x220193=_0xe260[_0xaead12];return _0x220193;};'use strict';function FreshsalesAccount(_0x544271){this['id']=_0x544271['id']||0x0;this['name']=_0x544271[_0x0e26('0x0')]||'';this[_0x0e26('0x1')]=_0x544271[_0x0e26('0x1')]||'';this[_0x0e26('0x2')]=_0x544271[_0x0e26('0x3')]||'';this[_0x0e26('0x4')]=_0x544271[_0x0e26('0x4')]||'';this[_0x0e26('0x5')]=_0x544271[_0x0e26('0x5')]||'';this[_0x0e26('0x6')]=_0x544271['Configurations']||{};}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 88da915..1806025 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 _0xafd7=['context','exten','priority','holdtime','assigned','motionChannel','voice','mohtime','variables','exports','type','inbound','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','position','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexitAt','originalposition','channel','connectedlinenum','connectedlinename','accountcode'];(function(_0x2d4065,_0x38dc95){var _0xef6016=function(_0x195cee){while(--_0x195cee){_0x2d4065['push'](_0x2d4065['shift']());}};_0xef6016(++_0x38dc95);}(_0xafd7,0x1bd));var _0x7afd=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xafd7[_0x4a9fb1];return _0x348672;};'use strict';function QueueReport(){this[_0x7afd('0x0')]=_0x7afd('0x1');this[_0x7afd('0x2')]='';this[_0x7afd('0x3')]='';this[_0x7afd('0x4')]='';this[_0x7afd('0x5')]='';this[_0x7afd('0x6')]=null;this[_0x7afd('0x7')]=null;this[_0x7afd('0x8')]=0x1;this['count']=0x1;this[_0x7afd('0x9')]=![];this[_0x7afd('0xa')]=null;this[_0x7afd('0xb')]=![];this[_0x7afd('0xc')]=null;this['queuecallerexit']=![];this[_0x7afd('0xd')]=null;this[_0x7afd('0xe')]=0x1;this[_0x7afd('0xf')]='';this[_0x7afd('0x10')]='';this[_0x7afd('0x11')]='';this[_0x7afd('0x12')]='';this[_0x7afd('0x13')]='';this[_0x7afd('0x14')]='';this[_0x7afd('0x15')]='';this[_0x7afd('0x16')]=0x0;this[_0x7afd('0x17')]=![];this['lastAssignedTo']='';this[_0x7afd('0x18')]=_0x7afd('0x19');this[_0x7afd('0x1a')]=0x0;this[_0x7afd('0x1b')]={};}module[_0x7afd('0x1c')]=QueueReport; \ No newline at end of file +var _0x970b=['voice','type','uniqueid','calleridname','queue','queuecallerjoinAt','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','channel','connectedlinenum','connectedlinename','accountcode','context','exten','priority','holdtime','assigned','motionChannel'];(function(_0x5eef05,_0x1be989){var _0x56d4b8=function(_0x57993d){while(--_0x57993d){_0x5eef05['push'](_0x5eef05['shift']());}};_0x56d4b8(++_0x1be989);}(_0x970b,0x169));var _0xb970=function(_0x1809c5,_0x46cabc){_0x1809c5=_0x1809c5-0x0;var _0x5254a4=_0x970b[_0x1809c5];return _0x5254a4;};'use strict';function QueueReport(){this[_0xb970('0x0')]='inbound';this[_0xb970('0x1')]='';this['calleridnum']='';this[_0xb970('0x2')]='';this[_0xb970('0x3')]='';this[_0xb970('0x4')]=null;this['queuecallerleaveAt']=null;this['position']=0x1;this[_0xb970('0x5')]=0x1;this[_0xb970('0x6')]=![];this[_0xb970('0x7')]=null;this[_0xb970('0x8')]=![];this['queuecallercompleteAt']=null;this['queuecallerexit']=![];this['queuecallerexitAt']=null;this['originalposition']=0x1;this[_0xb970('0x9')]='';this[_0xb970('0xa')]='';this[_0xb970('0xb')]='';this[_0xb970('0xc')]='';this[_0xb970('0xd')]='';this[_0xb970('0xe')]='';this[_0xb970('0xf')]='';this[_0xb970('0x10')]=0x0;this[_0xb970('0x11')]=![];this['lastAssignedTo']='';this[_0xb970('0x12')]=_0xb970('0x13');this['mohtime']=0x0;this['variables']={};}module['exports']=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index 6245871..34b7d6e 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 _0x3713=['password','clientId','clientSecret','securityToken','type','integrationTab','Configurations','exports','name','username','remoteUri'];(function(_0x6f25cf,_0x390699){var _0x11145c=function(_0x2a0a27){while(--_0x2a0a27){_0x6f25cf['push'](_0x6f25cf['shift']());}};_0x11145c(++_0x390699);}(_0x3713,0xa2));var _0x3371=function(_0x308a49,_0x522c88){_0x308a49=_0x308a49-0x0;var _0x48a495=_0x3713[_0x308a49];return _0x48a495;};'use strict';function SalesforceAccount(_0x47ef96){this['id']=_0x47ef96['id']||0x0;this[_0x3371('0x0')]=_0x47ef96[_0x3371('0x0')]||'';this[_0x3371('0x1')]=_0x47ef96[_0x3371('0x1')]||'';this[_0x3371('0x2')]=_0x47ef96['remoteUri']||'';this[_0x3371('0x3')]=_0x47ef96[_0x3371('0x3')]||'';this[_0x3371('0x4')]=_0x47ef96[_0x3371('0x4')]||'';this['clientSecret']=_0x47ef96[_0x3371('0x5')]||'';this[_0x3371('0x6')]=_0x47ef96[_0x3371('0x6')]||'';this[_0x3371('0x7')]=_0x47ef96[_0x3371('0x7')]||_0x3371('0x8');this['serverUrl']=_0x47ef96['serverUrl']||'';this[_0x3371('0x9')]=_0x47ef96['Configurations']||{};}module[_0x3371('0xa')]=SalesforceAccount; \ No newline at end of file +var _0x9dfc=['username','remoteUri','password','clientId','clientSecret','securityToken','type','integrationTab','serverUrl','Configurations'];(function(_0x316500,_0x3951d6){var _0x160664=function(_0x2b4f14){while(--_0x2b4f14){_0x316500['push'](_0x316500['shift']());}};_0x160664(++_0x3951d6);}(_0x9dfc,0x140));var _0xc9df=function(_0x13eacb,_0x4a5c19){_0x13eacb=_0x13eacb-0x0;var _0x2d64f5=_0x9dfc[_0x13eacb];return _0x2d64f5;};'use strict';function SalesforceAccount(_0x2f2321){this['id']=_0x2f2321['id']||0x0;this['name']=_0x2f2321['name']||'';this['username']=_0x2f2321[_0xc9df('0x0')]||'';this[_0xc9df('0x1')]=_0x2f2321[_0xc9df('0x1')]||'';this[_0xc9df('0x2')]=_0x2f2321[_0xc9df('0x2')]||'';this[_0xc9df('0x3')]=_0x2f2321[_0xc9df('0x3')]||'';this[_0xc9df('0x4')]=_0x2f2321[_0xc9df('0x4')]||'';this[_0xc9df('0x5')]=_0x2f2321['securityToken']||'';this[_0xc9df('0x6')]=_0x2f2321[_0xc9df('0x6')]||_0xc9df('0x7');this[_0xc9df('0x8')]=_0x2f2321[_0xc9df('0x8')]||'';this['Configurations']=_0x2f2321[_0xc9df('0x9')]||{};}module['exports']=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index 1587d76..642ee04 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 _0xf681=['name','password','remoteUri','serverUrl','Configurations'];(function(_0x52ddf2,_0x2ff25f){var _0x2dce61=function(_0x2d1831){while(--_0x2d1831){_0x52ddf2['push'](_0x52ddf2['shift']());}};_0x2dce61(++_0x2ff25f);}(_0xf681,0xaf));var _0x1f68=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xf681[_0xa464c9];return _0x3d73c4;};'use strict';function ServicenowAccount(_0x3993b3){this['id']=_0x3993b3['id']||0x0;this[_0x1f68('0x0')]=_0x3993b3['name']||'';this['username']=_0x3993b3['username']||'';this[_0x1f68('0x1')]=_0x3993b3[_0x1f68('0x1')]||'';this[_0x1f68('0x2')]=_0x3993b3['remoteUri']||'';this[_0x1f68('0x3')]=_0x3993b3[_0x1f68('0x3')]||'';this['Configurations']=_0x3993b3[_0x1f68('0x4')]||{};}module['exports']=ServicenowAccount; \ No newline at end of file +var _0x1049=['name','username','password','remoteUri','serverUrl','Configurations','exports'];(function(_0x43cf20,_0x5ea501){var _0x34ef16=function(_0x40b2bb){while(--_0x40b2bb){_0x43cf20['push'](_0x43cf20['shift']());}};_0x34ef16(++_0x5ea501);}(_0x1049,0x173));var _0x9104=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1049[_0x3dd15e];return _0x231fd0;};'use strict';function ServicenowAccount(_0x547301){this['id']=_0x547301['id']||0x0;this[_0x9104('0x0')]=_0x547301[_0x9104('0x0')]||'';this[_0x9104('0x1')]=_0x547301[_0x9104('0x1')]||'';this[_0x9104('0x2')]=_0x547301[_0x9104('0x2')]||'';this[_0x9104('0x3')]=_0x547301[_0x9104('0x3')]||'';this[_0x9104('0x4')]=_0x547301[_0x9104('0x4')]||'';this[_0x9104('0x5')]=_0x547301[_0x9104('0x5')]||{};}module[_0x9104('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 6219930..41d30ce 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 _0x1550=['Configurations','exports','name','username','password','remoteUri'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1550,0x170));var _0x0155=function(_0x23f526,_0x73a21e){_0x23f526=_0x23f526-0x0;var _0xe289ab=_0x1550[_0x23f526];return _0xe289ab;};'use strict';function SugarcrmAccount(_0x1bf52d){this['id']=_0x1bf52d['id']||0x0;this[_0x0155('0x0')]=_0x1bf52d[_0x0155('0x0')]||'';this[_0x0155('0x1')]=_0x1bf52d[_0x0155('0x1')]||'';this[_0x0155('0x2')]=_0x1bf52d[_0x0155('0x2')]||'';this['remoteUri']=_0x1bf52d[_0x0155('0x3')]||'';this['serverUrl']=_0x1bf52d['serverUrl']||'';this[_0x0155('0x4')]=_0x1bf52d[_0x0155('0x4')]||{};}module[_0x0155('0x5')]=SugarcrmAccount; \ No newline at end of file +var _0x5fc1=['name','username','password','remoteUri','serverUrl','Configurations'];(function(_0x560381,_0x1bfa8f){var _0x5f52b5=function(_0x36c011){while(--_0x36c011){_0x560381['push'](_0x560381['shift']());}};_0x5f52b5(++_0x1bfa8f);}(_0x5fc1,0x78));var _0x15fc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5fc1[_0x3dd15e];return _0x231fd0;};'use strict';function SugarcrmAccount(_0x548113){this['id']=_0x548113['id']||0x0;this[_0x15fc('0x0')]=_0x548113[_0x15fc('0x0')]||'';this[_0x15fc('0x1')]=_0x548113[_0x15fc('0x1')]||'';this[_0x15fc('0x2')]=_0x548113[_0x15fc('0x2')]||'';this[_0x15fc('0x3')]=_0x548113['remoteUri']||'';this[_0x15fc('0x4')]=_0x548113[_0x15fc('0x4')]||'';this[_0x15fc('0x5')]=_0x548113['Configurations']||{};}module['exports']=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index bd77d36..752be6a 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 _0x8e44=['exports','name','state','unknown','stateTime','status','address'];(function(_0x10067f,_0x308021){var _0x59e395=function(_0x1d5f91){while(--_0x1d5f91){_0x10067f['push'](_0x10067f['shift']());}};_0x59e395(++_0x308021);}(_0x8e44,0x1ac));var _0x48e4=function(_0x572473,_0x43edff){_0x572473=_0x572473-0x0;var _0x2bc49d=_0x8e44[_0x572473];return _0x2bc49d;};'use strict';function Telephone(_0x21fbc7){this['id']=_0x21fbc7['id']||0x0;this[_0x48e4('0x0')]=_0x21fbc7[_0x48e4('0x0')]||'';this['accountcode']=_0x21fbc7['accountcode']||'';this[_0x48e4('0x1')]=_0x48e4('0x2');this[_0x48e4('0x3')]=0x0;this[_0x48e4('0x4')]='unknown';this[_0x48e4('0x5')]='';}module[_0x48e4('0x6')]=Telephone; \ No newline at end of file +var _0x8d79=['exports','name','state','unknown','stateTime'];(function(_0x555201,_0x4e7d9e){var _0x359681=function(_0x263a3a){while(--_0x263a3a){_0x555201['push'](_0x555201['shift']());}};_0x359681(++_0x4e7d9e);}(_0x8d79,0x10a));var _0x98d7=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x8d79[_0x167cc1];return _0x10bc4b;};'use strict';function Telephone(_0x20b47d){this['id']=_0x20b47d['id']||0x0;this[_0x98d7('0x0')]=_0x20b47d[_0x98d7('0x0')]||'';this['accountcode']=_0x20b47d['accountcode']||'';this[_0x98d7('0x1')]=_0x98d7('0x2');this[_0x98d7('0x3')]=0x0;this['status']='unknown';this['address']='';}module[_0x98d7('0x4')]=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index 2e85bdc..88018f5 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(_0x245426,_0x48b9e5){var _0x43ee14=function(_0x1c2630){while(--_0x1c2630){_0x245426['push'](_0x245426['shift']());}};_0x43ee14(++_0x48b9e5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xa9e0[_0x433a86];return _0x23000c;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template; \ No newline at end of file +var _0xa9e0=['exports','name'];(function(_0x38dc59,_0x1bf1e8){var _0x2ff4d0=function(_0x4effec){while(--_0x4effec){_0x38dc59['push'](_0x38dc59['shift']());}};_0x2ff4d0(++_0x1bf1e8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xa9e0[_0x2b10c6];return _0x3789d2;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template; \ No newline at end of file diff --git a/server/services/ami/model/trigger.js b/server/services/ami/model/trigger.js index 5b151a6..8a3199f 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 _0x2032=['exports','name','channel','voice','status','AllConditions','AnyConditions','Actions'];(function(_0x43d64e,_0x2a537a){var _0x550ae8=function(_0x1cf4ec){while(--_0x1cf4ec){_0x43d64e['push'](_0x43d64e['shift']());}};_0x550ae8(++_0x2a537a);}(_0x2032,0xd9));var _0x2203=function(_0x3e2ada,_0x1eb5ca){_0x3e2ada=_0x3e2ada-0x0;var _0x4149ee=_0x2032[_0x3e2ada];return _0x4149ee;};'use strict';function Trigger(_0x4d6c97){this['id']=_0x4d6c97['id']||0x0;this[_0x2203('0x0')]=_0x4d6c97[_0x2203('0x0')]||'';this[_0x2203('0x1')]=_0x4d6c97['channel']||_0x2203('0x2');this[_0x2203('0x3')]=_0x4d6c97['status']||![];this[_0x2203('0x4')]=_0x4d6c97[_0x2203('0x4')]||[];this[_0x2203('0x5')]=_0x4d6c97[_0x2203('0x5')]||[];this[_0x2203('0x6')]=_0x4d6c97[_0x2203('0x6')]||[];}module[_0x2203('0x7')]=Trigger; \ No newline at end of file +var _0x4fc2=['name','channel','voice','status','AllConditions','AnyConditions','Actions'];(function(_0xdae520,_0x5cb070){var _0x21f40a=function(_0x153d31){while(--_0x153d31){_0xdae520['push'](_0xdae520['shift']());}};_0x21f40a(++_0x5cb070);}(_0x4fc2,0x111));var _0x24fc=function(_0x3a607e,_0x54d530){_0x3a607e=_0x3a607e-0x0;var _0x37b106=_0x4fc2[_0x3a607e];return _0x37b106;};'use strict';function Trigger(_0x5ea3ab){this['id']=_0x5ea3ab['id']||0x0;this[_0x24fc('0x0')]=_0x5ea3ab[_0x24fc('0x0')]||'';this[_0x24fc('0x1')]=_0x5ea3ab['channel']||_0x24fc('0x2');this[_0x24fc('0x3')]=_0x5ea3ab[_0x24fc('0x3')]||![];this['AllConditions']=_0x5ea3ab[_0x24fc('0x4')]||[];this[_0x24fc('0x5')]=_0x5ea3ab['AnyConditions']||[];this[_0x24fc('0x6')]=_0x5ea3ab[_0x24fc('0x6')]||[];}module['exports']=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index f77b9b7..155fd5e 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 _0xd278=['address','defaultuser','exports','active','name','unknown','registry','port','domainport','refresh','stateRegistry'];(function(_0x31ef44,_0x3741ab){var _0x110a80=function(_0x11c2fb){while(--_0x11c2fb){_0x31ef44['push'](_0x31ef44['shift']());}};_0x110a80(++_0x3741ab);}(_0xd278,0x179));var _0x8d27=function(_0x4a5b7f,_0xc83244){_0x4a5b7f=_0x4a5b7f-0x0;var _0x4a7959=_0xd278[_0x4a5b7f];return _0x4a7959;};'use strict';function Trunk(_0x16cb20){this['id']=_0x16cb20['id']||0x0;this[_0x8d27('0x0')]=_0x16cb20[_0x8d27('0x0')]||![];this['name']=_0x16cb20[_0x8d27('0x1')]||'';this['state']='unknown';this['stateTime']=0x0;this['status']=_0x8d27('0x2');this[_0x8d27('0x3')]=_0x16cb20[_0x8d27('0x3')]&&_0x16cb20[_0x8d27('0x3')]['indexOf'](':')?_0x16cb20[_0x8d27('0x3')]['split'](':')[0x0]:'';this['host']='';this[_0x8d27('0x4')]='';this['domain']='';this[_0x8d27('0x5')]='';this[_0x8d27('0x6')]='';this[_0x8d27('0x7')]=_0x8d27('0x2');this['registrationtime']='';this[_0x8d27('0x8')]='';this[_0x8d27('0x9')]=_0x16cb20[_0x8d27('0x9')]||'';}module[_0x8d27('0xa')]=Trunk; \ No newline at end of file +var _0xfc30=['active','name','state','unknown','registry','indexOf','split','port','domain','domainport','refresh','registrationtime','address','defaultuser'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xfc30,0x1a4));var _0x0fc3=function(_0x47066d,_0x2ea60d){_0x47066d=_0x47066d-0x0;var _0x34baa9=_0xfc30[_0x47066d];return _0x34baa9;};'use strict';function Trunk(_0x5105f3){this['id']=_0x5105f3['id']||0x0;this[_0x0fc3('0x0')]=_0x5105f3[_0x0fc3('0x0')]||![];this[_0x0fc3('0x1')]=_0x5105f3[_0x0fc3('0x1')]||'';this[_0x0fc3('0x2')]='unknown';this['stateTime']=0x0;this['status']=_0x0fc3('0x3');this[_0x0fc3('0x4')]=_0x5105f3[_0x0fc3('0x4')]&&_0x5105f3[_0x0fc3('0x4')][_0x0fc3('0x5')](':')?_0x5105f3[_0x0fc3('0x4')][_0x0fc3('0x6')](':')[0x0]:'';this['host']='';this[_0x0fc3('0x7')]='';this[_0x0fc3('0x8')]='';this[_0x0fc3('0x9')]='';this[_0x0fc3('0xa')]='';this['stateRegistry']=_0x0fc3('0x3');this[_0x0fc3('0xb')]='';this[_0x0fc3('0xc')]='';this['defaultuser']=_0x5105f3[_0x0fc3('0xd')]||'';}module['exports']=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index b52ae1a..3cf1102 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 _0x4c86=['recordingFormat','exports','exten'];(function(_0x2fd064,_0x10f8ab){var _0x1b0168=function(_0x4fee0e){while(--_0x4fee0e){_0x2fd064['push'](_0x2fd064['shift']());}};_0x1b0168(++_0x10f8ab);}(_0x4c86,0x161));var _0x64c8=function(_0xb228c7,_0x17c4e3){_0xb228c7=_0xb228c7-0x0;var _0x1ec18f=_0x4c86[_0xb228c7];return _0x1ec18f;};'use strict';function voiceExtension(_0x564562){this['id']=_0x564562['id']||0x0;this[_0x64c8('0x0')]=_0x564562[_0x64c8('0x0')]||'';this[_0x64c8('0x1')]=_0x564562['recordingFormat']||'none';this['mandatoryDisposition']=_0x564562['mandatoryDisposition']||![];}module[_0x64c8('0x2')]=voiceExtension; \ No newline at end of file +var _0xe31c=['exten','recordingFormat','none','mandatoryDisposition'];(function(_0x45b034,_0x3a57dd){var _0x509cb0=function(_0x3a89d5){while(--_0x3a89d5){_0x45b034['push'](_0x45b034['shift']());}};_0x509cb0(++_0x3a57dd);}(_0xe31c,0x9c));var _0xce31=function(_0x2d0c58,_0x1aea21){_0x2d0c58=_0x2d0c58-0x0;var _0x520fcb=_0xe31c[_0x2d0c58];return _0x520fcb;};'use strict';function voiceExtension(_0x18b91e){this['id']=_0x18b91e['id']||0x0;this['exten']=_0x18b91e[_0xce31('0x0')]||'';this[_0xce31('0x1')]=_0x18b91e[_0xce31('0x1')]||_0xce31('0x2');this[_0xce31('0x3')]=_0x18b91e[_0xce31('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 b597254..80b7a93 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 _0x83a7=['dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayCallersExit','outboundReCallsDay','outboundAbandonedDay','startProgressive','startPredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','erlangCalls','erlangCallToSecond','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','unknown','not_inuse','invalid','unavailable','ringing','wav','wav49','gsm','roundrobin','name','monitor_format','inbound','waiting','total','sumBillable','abandoned','loggedIn','available','acw','acwTimeout','autopause','sendMessageOneNotActive','message','originated','dialTimezone','dialGlobalInterval','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','rrmemory','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDMaximumNumberOfWords'];(function(_0xc6e150,_0x119453){var _0x859eb4=function(_0x2cafbe){while(--_0x2cafbe){_0xc6e150['push'](_0xc6e150['shift']());}};_0x859eb4(++_0x119453);}(_0x83a7,0x1f2));var _0x783a=function(_0x14e937,_0x2dbe0f){_0x14e937=_0x14e937-0x0;var _0x5b6faa=_0x83a7[_0x14e937];return _0x5b6faa;};'use strict';var statusDesc=[_0x783a('0x0'),_0x783a('0x1'),'inuse','busy',_0x783a('0x2'),_0x783a('0x3'),_0x783a('0x4'),'ringinuse','onhold'];var monitorFormat={'wav':_0x783a('0x5'),'wav49':_0x783a('0x6'),'gsm':_0x783a('0x7')};var strategy={'rrmemory':'rrmemory','roundrobin':_0x783a('0x8')};function VoiceQueue(_0x103273){this['id']=_0x103273['id']||0x0;this['name']=_0x103273[_0x783a('0x9')]||'';this['monitor_format']=_0x103273[_0x783a('0xa')]||'';this['type']=_0x103273['type']||_0x783a('0xb');this[_0x783a('0xc')]=0x0;this['talking']=0x0;this[_0x783a('0xd')]=0x0;this['answered']=0x0;this['sumDuration']=0x0;this['sumHoldTime']=0x0;this[_0x783a('0xe')]=0x0;this['unmanaged']=0x0;this[_0x783a('0xf')]=0x0;this[_0x783a('0x10')]=0x0;this[_0x783a('0x11')]=0x0;this['acw']=_0x103273[_0x783a('0x12')]||![];this[_0x783a('0x13')]=_0x103273[_0x783a('0x13')]||0xa;this['autopause']=_0x103273[_0x783a('0x14')]||'no';this[_0x783a('0x15')]=!![];this[_0x783a('0x16')]='';this[_0x783a('0x17')]=0x0;this['temp']=0x0;this[_0x783a('0x18')]=_0x103273[_0x783a('0x18')]||null;this[_0x783a('0x19')]=_0x103273[_0x783a('0x19')]?_0x103273[_0x783a('0x19')]:null;this['dialActive']=_0x103273['dialActive'];this[_0x783a('0x1a')]=_0x103273[_0x783a('0x1a')]||_0x783a('0x1b');this[_0x783a('0x1c')]=_0x103273[_0x783a('0x1c')]||0x0;this[_0x783a('0x1d')]=_0x103273[_0x783a('0x1d')]||0x0;this[_0x783a('0x1e')]=_0x103273[_0x783a('0x1e')]||0x1;this[_0x783a('0x1f')]=_0x103273[_0x783a('0x1f')]||'dropRate';this[_0x783a('0x20')]=_0x103273['dialPredictiveOptimizationPercentage']||0.03;this[_0x783a('0x21')]=_0x103273[_0x783a('0x21')]||0x258;this[_0x783a('0x22')]=_0x103273['dialOriginateCallerIdName']||_0x783a('0x23');this[_0x783a('0x24')]=_0x103273[_0x783a('0x24')]||_0x783a('0x23');this[_0x783a('0x25')]=_0x103273[_0x783a('0x25')]||0x1e;this[_0x783a('0x26')]=_0x103273[_0x783a('0x26')]||_0x783a('0x27');this[_0x783a('0x28')]=_0x103273[_0x783a('0x28')]||0x3;this[_0x783a('0x29')]=_0x103273[_0x783a('0x29')]||undefined;this[_0x783a('0x2a')]=_0x103273['dialCongestionMaxRetry']||0x3;this[_0x783a('0x2b')]=_0x103273['dialCongestionRetryFrequency']||0x96;this['dialBusyMaxRetry']=_0x103273[_0x783a('0x2c')]||0x3;this[_0x783a('0x2d')]=_0x103273[_0x783a('0x2d')]||0x96;this[_0x783a('0x2e')]=_0x103273['dialNoAnswerMaxRetry']||0x3;this['dialNoAnswerRetryFrequency']=_0x103273[_0x783a('0x2f')]||0x96;this[_0x783a('0x30')]=_0x103273[_0x783a('0x30')]||0x3;this[_0x783a('0x31')]=_0x103273[_0x783a('0x31')]||0x96;this[_0x783a('0x32')]=_0x103273['dialDropMaxRetry']||0x3;this['dialDropRetryFrequency']=_0x103273[_0x783a('0x33')]||0x96;this[_0x783a('0x34')]=_0x103273[_0x783a('0x34')]||0x3;this[_0x783a('0x35')]=_0x103273[_0x783a('0x35')]||0x96;this[_0x783a('0x36')]=_0x103273['dialMachineMaxRetry']||0x3;this[_0x783a('0x37')]=_0x103273[_0x783a('0x37')]||0x96;this[_0x783a('0x38')]=_0x103273[_0x783a('0x38')]||0x3;this[_0x783a('0x39')]=_0x103273[_0x783a('0x39')]||0x96;this[_0x783a('0x3a')]=_0x103273[_0x783a('0x3a')]||0x4;this[_0x783a('0x3b')]=_0x103273[_0x783a('0x3b')]?_0x103273[_0x783a('0x3b')]:undefined;this[_0x783a('0x3c')]=_0x103273['TrunkBackup']?_0x103273[_0x783a('0x3c')]:undefined;this[_0x783a('0x3d')]=_0x103273[_0x783a('0x3d')]||undefined;this[_0x783a('0x3e')]=_0x103273[_0x783a('0x3e')]?_0x103273['Interval']:undefined;this[_0x783a('0x3f')]=_0x103273['dialOrderByScheduledAt']||_0x783a('0x40');this[_0x783a('0x41')]=_0x103273['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x783a('0x42')]=_0x103273['dialCutDigit']||undefined;this[_0x783a('0x43')]=strategy[_0x103273[_0x783a('0x43')]]||_0x783a('0x44');this[_0x783a('0x45')]=!![];this[_0x783a('0x46')]=_0x103273[_0x783a('0x46')]||![];this[_0x783a('0x47')]=_0x103273[_0x783a('0x47')];this[_0x783a('0x48')]=_0x103273[_0x783a('0x48')];this[_0x783a('0x49')]=_0x103273['dialAMDAfterGreetingSilence'];this[_0x783a('0x4a')]=_0x103273['dialAMDTotalAnalysisTime'];this[_0x783a('0x4b')]=_0x103273[_0x783a('0x4b')];this['dialAMDBetweenWordsSilence']=_0x103273['dialAMDBetweenWordsSilence'];this[_0x783a('0x4c')]=_0x103273[_0x783a('0x4c')];this['dialAMDSilenceThreshold']=_0x103273[_0x783a('0x4d')];this[_0x783a('0x4e')]=_0x103273[_0x783a('0x4e')];this[_0x783a('0x4f')]=0x0;this['pTalking']=0x0;this[_0x783a('0x50')]=_0x103273[_0x783a('0x50')];this[_0x783a('0x51')]=0x0;this[_0x783a('0x52')]=0x0;this[_0x783a('0x53')]=0x0;this[_0x783a('0x54')]=0x0;this['outboundCongestionCallsDay']=0x0;this[_0x783a('0x55')]=0x0;this[_0x783a('0x56')]=0x0;this['outboundBlacklistCallsDay']=0x0;this['outboundOriginateFailureCallsDay']=0x0;this[_0x783a('0x57')]=0x0;this['outboundDropCallsDayTimeout']=0x0;this['outboundDropCallsDayACS']=0x0;this[_0x783a('0x58')]=0x0;this[_0x783a('0x59')]=0x0;this[_0x783a('0x5a')]=undefined;this[_0x783a('0x5b')]=undefined;this['handlePredictive']=undefined;this[_0x783a('0x5c')]=1.05;this[_0x783a('0x5d')]=0x0;this[_0x783a('0x5e')]=0x0;this[_0x783a('0x5f')]=0x0;this[_0x783a('0x60')]=0x0;this[_0x783a('0x61')]=0x0;this['predictiveIntervalAvgTalktime']=0x0;this[_0x783a('0x62')]=0x0;this[_0x783a('0x63')]=0x0;this[_0x783a('0x64')]=_0x103273[_0x783a('0x65')]||0x14;this[_0x783a('0x66')]=_0x103273[_0x783a('0x65')]||0xa;this[_0x783a('0x67')]=0x0;this[_0x783a('0x68')]=0x0;this['predictiveIntervalHitRate']=0x1;this[_0x783a('0x69')]=0x0;this[_0x783a('0x6a')]=0x0;this['erlangAbandonmentRate']=0x0;this[_0x783a('0x6b')]=0x0;this[_0x783a('0x6c')]=_0x103273['dialRecallMeTimeout']||0x1e;this['dialRecallInQueue']=_0x103273[_0x783a('0x6d')]||![];this[_0x783a('0x6e')]=_0x103273[_0x783a('0x6e')]||undefined;this[_0x783a('0x6f')]=_0x103273['dialAgiAfterHangupClient']||![];this[_0x783a('0x70')]=_0x103273[_0x783a('0x70')]||![];this[_0x783a('0xa')]=monitorFormat[_0x103273[_0x783a('0xa')]]?monitorFormat[_0x103273[_0x783a('0xa')]]:undefined;this[_0x783a('0x71')]=_0x103273[_0x783a('0x71')]||![];this[_0x783a('0x72')]=_0x103273[_0x783a('0x72')]?_0x103273['mandatoryDispositionPause']:undefined;}module['exports']=VoiceQueue; \ No newline at end of file +var _0x40d8=['dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayACS','startPredictive','handlePredictive','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','erlangCalls','erlangCallToSecond','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','mandatoryDisposition','mandatoryDispositionPause','exports','not_inuse','inuse','busy','invalid','unavailable','ringing','ringinuse','wav','wav49','gsm','rrmemory','name','monitor_format','type','inbound','waiting','talking','total','answered','sumBillable','abandoned','loggedIn','available','acw','acwTimeout','autopause','sendMessageOneNotActive','message','originated','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','anonymous','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry'];(function(_0x38bf4b,_0x3d8e9d){var _0xc29177=function(_0x52d635){while(--_0x52d635){_0x38bf4b['push'](_0x38bf4b['shift']());}};_0xc29177(++_0x3d8e9d);}(_0x40d8,0x121));var _0x840d=function(_0xa60623,_0x2d4e4f){_0xa60623=_0xa60623-0x0;var _0x4a6487=_0x40d8[_0xa60623];return _0x4a6487;};'use strict';var statusDesc=['unknown',_0x840d('0x0'),_0x840d('0x1'),_0x840d('0x2'),_0x840d('0x3'),_0x840d('0x4'),_0x840d('0x5'),_0x840d('0x6'),'onhold'];var monitorFormat={'wav':_0x840d('0x7'),'wav49':_0x840d('0x8'),'gsm':_0x840d('0x9')};var strategy={'rrmemory':_0x840d('0xa'),'roundrobin':'roundrobin'};function VoiceQueue(_0x4ae1a9){this['id']=_0x4ae1a9['id']||0x0;this[_0x840d('0xb')]=_0x4ae1a9[_0x840d('0xb')]||'';this['monitor_format']=_0x4ae1a9[_0x840d('0xc')]||'';this[_0x840d('0xd')]=_0x4ae1a9['type']||_0x840d('0xe');this[_0x840d('0xf')]=0x0;this[_0x840d('0x10')]=0x0;this[_0x840d('0x11')]=0x0;this[_0x840d('0x12')]=0x0;this['sumDuration']=0x0;this['sumHoldTime']=0x0;this[_0x840d('0x13')]=0x0;this['unmanaged']=0x0;this[_0x840d('0x14')]=0x0;this[_0x840d('0x15')]=0x0;this[_0x840d('0x16')]=0x0;this[_0x840d('0x17')]=_0x4ae1a9['acw']||![];this[_0x840d('0x18')]=_0x4ae1a9[_0x840d('0x18')]||0xa;this[_0x840d('0x19')]=_0x4ae1a9['autopause']||'no';this[_0x840d('0x1a')]=!![];this[_0x840d('0x1b')]='';this[_0x840d('0x1c')]=0x0;this['temp']=0x0;this[_0x840d('0x1d')]=_0x4ae1a9['dialTimezone']||null;this[_0x840d('0x1e')]=_0x4ae1a9['dialGlobalInterval']?_0x4ae1a9['dialGlobalInterval']:null;this[_0x840d('0x1f')]=_0x4ae1a9['dialActive'];this[_0x840d('0x20')]=_0x4ae1a9['dialMethod']||_0x840d('0x21');this[_0x840d('0x22')]=_0x4ae1a9[_0x840d('0x22')]||0x0;this[_0x840d('0x23')]=_0x4ae1a9['dialLimitQueue']||0x0;this['dialPowerLevel']=_0x4ae1a9[_0x840d('0x24')]||0x1;this[_0x840d('0x25')]=_0x4ae1a9[_0x840d('0x25')]||_0x840d('0x26');this['dialPredictiveOptimizationPercentage']=_0x4ae1a9[_0x840d('0x27')]||0.03;this[_0x840d('0x28')]=_0x4ae1a9[_0x840d('0x28')]||0x258;this[_0x840d('0x29')]=_0x4ae1a9[_0x840d('0x29')]||'anonymous';this['dialOriginateCallerIdNumber']=_0x4ae1a9[_0x840d('0x2a')]||_0x840d('0x2b');this[_0x840d('0x2c')]=_0x4ae1a9['dialOriginateTimeout']||0x1e;this[_0x840d('0x2d')]=_0x4ae1a9[_0x840d('0x2d')]||'tTxX';this[_0x840d('0x2e')]=_0x4ae1a9[_0x840d('0x2e')]||0x3;this[_0x840d('0x2f')]=_0x4ae1a9[_0x840d('0x2f')]||undefined;this[_0x840d('0x30')]=_0x4ae1a9['dialCongestionMaxRetry']||0x3;this[_0x840d('0x31')]=_0x4ae1a9[_0x840d('0x31')]||0x96;this[_0x840d('0x32')]=_0x4ae1a9['dialBusyMaxRetry']||0x3;this[_0x840d('0x33')]=_0x4ae1a9[_0x840d('0x33')]||0x96;this[_0x840d('0x34')]=_0x4ae1a9[_0x840d('0x34')]||0x3;this[_0x840d('0x35')]=_0x4ae1a9['dialNoAnswerRetryFrequency']||0x96;this[_0x840d('0x36')]=_0x4ae1a9['dialNoSuchNumberMaxRetry']||0x3;this[_0x840d('0x37')]=_0x4ae1a9[_0x840d('0x37')]||0x96;this[_0x840d('0x38')]=_0x4ae1a9[_0x840d('0x38')]||0x3;this['dialDropRetryFrequency']=_0x4ae1a9[_0x840d('0x39')]||0x96;this[_0x840d('0x3a')]=_0x4ae1a9[_0x840d('0x3a')]||0x3;this[_0x840d('0x3b')]=_0x4ae1a9[_0x840d('0x3b')]||0x96;this[_0x840d('0x3c')]=_0x4ae1a9['dialMachineMaxRetry']||0x3;this[_0x840d('0x3d')]=_0x4ae1a9[_0x840d('0x3d')]||0x96;this[_0x840d('0x3e')]=_0x4ae1a9[_0x840d('0x3e')]||0x3;this[_0x840d('0x3f')]=_0x4ae1a9[_0x840d('0x3f')]||0x96;this[_0x840d('0x40')]=_0x4ae1a9[_0x840d('0x40')]||0x4;this[_0x840d('0x41')]=_0x4ae1a9[_0x840d('0x41')]?_0x4ae1a9[_0x840d('0x41')]:undefined;this[_0x840d('0x42')]=_0x4ae1a9[_0x840d('0x42')]?_0x4ae1a9[_0x840d('0x42')]:undefined;this[_0x840d('0x43')]=_0x4ae1a9[_0x840d('0x43')]||undefined;this['Interval']=_0x4ae1a9['Interval']?_0x4ae1a9['Interval']:undefined;this[_0x840d('0x44')]=_0x4ae1a9['dialOrderByScheduledAt']||_0x840d('0x45');this[_0x840d('0x46')]=_0x4ae1a9[_0x840d('0x46')]||undefined;this[_0x840d('0x47')]=_0x4ae1a9[_0x840d('0x47')]||undefined;this['strategy']=strategy[_0x4ae1a9[_0x840d('0x48')]]||_0x840d('0xa');this[_0x840d('0x49')]=!![];this[_0x840d('0x4a')]=_0x4ae1a9[_0x840d('0x4a')]||![];this[_0x840d('0x4b')]=_0x4ae1a9[_0x840d('0x4b')];this[_0x840d('0x4c')]=_0x4ae1a9['dialAMDGreeting'];this[_0x840d('0x4d')]=_0x4ae1a9[_0x840d('0x4d')];this['dialAMDTotalAnalysisTime']=_0x4ae1a9[_0x840d('0x4e')];this['dialAMDMinWordLength']=_0x4ae1a9[_0x840d('0x4f')];this['dialAMDBetweenWordsSilence']=_0x4ae1a9['dialAMDBetweenWordsSilence'];this[_0x840d('0x50')]=_0x4ae1a9[_0x840d('0x50')];this['dialAMDSilenceThreshold']=_0x4ae1a9[_0x840d('0x51')];this[_0x840d('0x52')]=_0x4ae1a9[_0x840d('0x52')];this['outboundRejectCallsDay']=0x0;this['pTalking']=0x0;this['timeout']=_0x4ae1a9[_0x840d('0x53')];this[_0x840d('0x54')]=0x0;this[_0x840d('0x55')]=0x0;this[_0x840d('0x56')]=0x0;this[_0x840d('0x57')]=0x0;this[_0x840d('0x58')]=0x0;this['outboundNoSuchCallsDay']=0x0;this['outboundUnknownCallsDay']=0x0;this['outboundBlacklistCallsDay']=0x0;this[_0x840d('0x59')]=0x0;this[_0x840d('0x5a')]=0x0;this['outboundDropCallsDayTimeout']=0x0;this[_0x840d('0x5b')]=0x0;this['outboundReCallsDay']=0x0;this['outboundAbandonedDay']=0x0;this['startProgressive']=undefined;this[_0x840d('0x5c')]=undefined;this[_0x840d('0x5d')]=undefined;this['predictiveIntervalMultiplicativeFactor']=1.05;this[_0x840d('0x5e')]=0x0;this[_0x840d('0x5f')]=0x0;this[_0x840d('0x60')]=0x0;this[_0x840d('0x61')]=0x0;this[_0x840d('0x62')]=0x0;this[_0x840d('0x63')]=0x0;this[_0x840d('0x64')]=0x0;this[_0x840d('0x65')]=0x0;this[_0x840d('0x66')]=_0x4ae1a9[_0x840d('0x67')]||0x14;this[_0x840d('0x68')]=_0x4ae1a9[_0x840d('0x67')]||0xa;this[_0x840d('0x69')]=0x0;this[_0x840d('0x6a')]=0x0;this['predictiveIntervalHitRate']=0x1;this[_0x840d('0x6b')]=0x0;this[_0x840d('0x6c')]=0x0;this['erlangAbandonmentRate']=0x0;this['erlangBusyFactor']=0x0;this['dialRecallMeTimeout']=_0x4ae1a9[_0x840d('0x6d')]||0x1e;this['dialRecallInQueue']=_0x4ae1a9[_0x840d('0x6e')]||![];this['dialQueueProject2']=_0x4ae1a9[_0x840d('0x6f')]||undefined;this[_0x840d('0x70')]=_0x4ae1a9[_0x840d('0x70')]||![];this['dialAgiAfterHangupAgent']=_0x4ae1a9['dialAgiAfterHangupAgent']||![];this['monitor_format']=monitorFormat[_0x4ae1a9[_0x840d('0xc')]]?monitorFormat[_0x4ae1a9[_0x840d('0xc')]]:undefined;this[_0x840d('0x71')]=_0x4ae1a9['mandatoryDisposition']||![];this[_0x840d('0x72')]=_0x4ae1a9[_0x840d('0x72')]?_0x4ae1a9['mandatoryDispositionPause']:undefined;}module[_0x840d('0x73')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index 2e22f4e..4ef1d31 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 _0xb393=['name','username','accessKey','remoteUri','serverUrl','exports'];(function(_0x3de177,_0x297e3a){var _0x79c1cc=function(_0x16cb1d){while(--_0x16cb1d){_0x3de177['push'](_0x3de177['shift']());}};_0x79c1cc(++_0x297e3a);}(_0xb393,0x78));var _0x3b39=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb393[_0x3dd15e];return _0x231fd0;};'use strict';function VtigerAccount(_0x1e0aed){this['id']=_0x1e0aed['id']||0x0;this[_0x3b39('0x0')]=_0x1e0aed['name']||'';this[_0x3b39('0x1')]=_0x1e0aed[_0x3b39('0x1')]||'';this[_0x3b39('0x2')]=_0x1e0aed[_0x3b39('0x2')]||'';this[_0x3b39('0x3')]=_0x1e0aed[_0x3b39('0x3')]||'';this[_0x3b39('0x4')]=_0x1e0aed[_0x3b39('0x4')]||'';this['Configurations']=_0x1e0aed['Configurations']||{};}module[_0x3b39('0x5')]=VtigerAccount; \ No newline at end of file +var _0x49bb=['name','username','accessKey','remoteUri','serverUrl','Configurations','exports'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x49bb,0x11f));var _0xb49b=function(_0x58ca37,_0x3de8c2){_0x58ca37=_0x58ca37-0x0;var _0x4c3b06=_0x49bb[_0x58ca37];return _0x4c3b06;};'use strict';function VtigerAccount(_0x55fc62){this['id']=_0x55fc62['id']||0x0;this[_0xb49b('0x0')]=_0x55fc62['name']||'';this[_0xb49b('0x1')]=_0x55fc62[_0xb49b('0x1')]||'';this[_0xb49b('0x2')]=_0x55fc62[_0xb49b('0x2')]||'';this['remoteUri']=_0x55fc62[_0xb49b('0x3')]||'';this['serverUrl']=_0x55fc62[_0xb49b('0x4')]||'';this[_0xb49b('0x5')]=_0x55fc62['Configurations']||{};}module[_0xb49b('0x6')]=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index 9ab49cf..52acfab 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 _0xeb43=['token','remoteUri','authType','type','integrationTab','serverUrl','Configurations','exports','name','username','password'];(function(_0x2b7627,_0x326fb8){var _0x3a2ba8=function(_0x2d7c0e){while(--_0x2d7c0e){_0x2b7627['push'](_0x2b7627['shift']());}};_0x3a2ba8(++_0x326fb8);}(_0xeb43,0xb8));var _0x3eb4=function(_0x39cc8f,_0xb60cd8){_0x39cc8f=_0x39cc8f-0x0;var _0x15e616=_0xeb43[_0x39cc8f];return _0x15e616;};'use strict';function ZendeskAccount(_0xee75b1){this['id']=_0xee75b1['id']||0x0;this[_0x3eb4('0x0')]=_0xee75b1['name']||'';this[_0x3eb4('0x1')]=_0xee75b1[_0x3eb4('0x1')]||'';this[_0x3eb4('0x2')]=_0xee75b1['password']||'';this[_0x3eb4('0x3')]=_0xee75b1['token']||'';this['remoteUri']=_0xee75b1[_0x3eb4('0x4')]||'';this[_0x3eb4('0x5')]=_0xee75b1[_0x3eb4('0x5')]||'';this[_0x3eb4('0x6')]=_0xee75b1['type']||_0x3eb4('0x7');this['serverUrl']=_0xee75b1[_0x3eb4('0x8')]||'';this[_0x3eb4('0x9')]=_0xee75b1[_0x3eb4('0x9')]||{};}module[_0x3eb4('0xa')]=ZendeskAccount; \ No newline at end of file +var _0x5a20=['serverUrl','Configurations','exports','name','password','token','authType','type'];(function(_0xc13882,_0x1c0ce0){var _0x4eb1dc=function(_0x219672){while(--_0x219672){_0xc13882['push'](_0xc13882['shift']());}};_0x4eb1dc(++_0x1c0ce0);}(_0x5a20,0x19b));var _0x05a2=function(_0x297d6f,_0x12c8be){_0x297d6f=_0x297d6f-0x0;var _0x4e0852=_0x5a20[_0x297d6f];return _0x4e0852;};'use strict';function ZendeskAccount(_0x230c49){this['id']=_0x230c49['id']||0x0;this['name']=_0x230c49[_0x05a2('0x0')]||'';this['username']=_0x230c49['username']||'';this['password']=_0x230c49[_0x05a2('0x1')]||'';this[_0x05a2('0x2')]=_0x230c49[_0x05a2('0x2')]||'';this['remoteUri']=_0x230c49['remoteUri']||'';this[_0x05a2('0x3')]=_0x230c49[_0x05a2('0x3')]||'';this[_0x05a2('0x4')]=_0x230c49['type']||'integrationTab';this[_0x05a2('0x5')]=_0x230c49[_0x05a2('0x5')]||'';this[_0x05a2('0x6')]=_0x230c49[_0x05a2('0x6')]||{};}module[_0x05a2('0x7')]=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index 2bc4bc4..755d519 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 _0x1903=['exports','description','host','zone','clientSecret','serverUrl','code','refreshToken','Configurations'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x1903,0xd0));var _0x3190=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1903[_0x14add3];return _0x4a174f;};'use strict';function ZohoAccount(_0x3127c9){this['id']=_0x3127c9['id']||0x0;this['name']=_0x3127c9['name']||'';this['description']=_0x3127c9[_0x3190('0x0')]||'';this[_0x3190('0x1')]=_0x3127c9[_0x3190('0x1')]||'';this[_0x3190('0x2')]=_0x3127c9[_0x3190('0x2')]||'';this['clientId']=_0x3127c9['clientId']||'';this[_0x3190('0x3')]=_0x3127c9[_0x3190('0x3')]||'';this[_0x3190('0x4')]=_0x3127c9['serverUrl']||'';this[_0x3190('0x5')]=_0x3127c9[_0x3190('0x5')]||'';this[_0x3190('0x6')]=_0x3127c9[_0x3190('0x6')]||'';this[_0x3190('0x7')]=_0x3127c9[_0x3190('0x7')]||{};}module[_0x3190('0x8')]=ZohoAccount; \ No newline at end of file +var _0x7ba2=['zone','clientId','clientSecret','serverUrl','code','refreshToken','Configurations','exports','name','description','host'];(function(_0x52b876,_0x294af5){var _0x1084b9=function(_0x281f38){while(--_0x281f38){_0x52b876['push'](_0x52b876['shift']());}};_0x1084b9(++_0x294af5);}(_0x7ba2,0x1cb));var _0x27ba=function(_0x276d10,_0x435d5f){_0x276d10=_0x276d10-0x0;var _0x56f291=_0x7ba2[_0x276d10];return _0x56f291;};'use strict';function ZohoAccount(_0x39e6fc){this['id']=_0x39e6fc['id']||0x0;this['name']=_0x39e6fc[_0x27ba('0x0')]||'';this[_0x27ba('0x1')]=_0x39e6fc[_0x27ba('0x1')]||'';this[_0x27ba('0x2')]=_0x39e6fc['host']||'';this['zone']=_0x39e6fc[_0x27ba('0x3')]||'';this[_0x27ba('0x4')]=_0x39e6fc[_0x27ba('0x4')]||'';this[_0x27ba('0x5')]=_0x39e6fc[_0x27ba('0x5')]||'';this[_0x27ba('0x6')]=_0x39e6fc[_0x27ba('0x6')]||'';this[_0x27ba('0x7')]=_0x39e6fc[_0x27ba('0x7')]||'';this[_0x27ba('0x8')]=_0x39e6fc[_0x27ba('0x8')]||'';this[_0x27ba('0x9')]=_0x39e6fc['Configurations']||{};}module[_0x27ba('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 5e53cde..0214764 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 _0x9282=['countnosuchnumberretry','countdropretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridname','prototype','number','lodash','moment','string','isNil','uniqueid','type','campaigntype','queue','dialAnswer','membername','Agent','name','channelAgent','SIP/%s','calleridname','phone','Contact','lastName','active','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countabandonedretry','countmachineretry','countagentrejectretry'];(function(_0x36087c,_0x34daad){var _0x24563e=function(_0x485aa8){while(--_0x485aa8){_0x36087c['push'](_0x36087c['shift']());}};_0x24563e(++_0x34daad);}(_0x9282,0xd0));var _0x2928=function(_0x514816,_0x57c091){_0x514816=_0x514816-0x0;var _0x5c3a43=_0x9282[_0x514816];return _0x5c3a43;};'use strict';var util=require('util');var _=require(_0x2928('0x0'));var moment=require(_0x2928('0x1'));function checkNameSurname(_0x27e9b4,_0x1d8783,_0x466465){var _0x5a0082='';if(!_['isNil'](_0x1d8783)&&_0x2928('0x2')===typeof _0x1d8783){_0x5a0082+=_0x1d8783;}if(!_[_0x2928('0x3')](_0x466465)&&_0x2928('0x2')===typeof _0x466465){_0x5a0082+='\x20'+_0x466465;}if(_0x5a0082!==''){return _0x5a0082;}return _0x27e9b4;}function Action(_0xbe1ffc,_0x3d85be,_0x57d1b5,_0x15afce,_0x44323f){this[_0x2928('0x4')]=_0x57d1b5||undefined;this['idContact']=_0xbe1ffc['id'];this['queue']=_0x3d85be['name'];this['type']=_0x3d85be[_0x2928('0x5')];this[_0x2928('0x6')]=_0x2928('0x7');this[_0x2928('0x8')]=![];this[_0x2928('0x9')]=_[_0x2928('0x3')](_0xbe1ffc['Agent'])?undefined:_0xbe1ffc[_0x2928('0xa')][_0x2928('0xb')];this[_0x2928('0xc')]=this[_0x2928('0x9')]?util['format'](_0x2928('0xd'),this[_0x2928('0x9')]):_0x15afce||undefined;this[_0x2928('0xe')]=checkNameSurname(_0xbe1ffc['Contact'][_0x2928('0xf')],_0xbe1ffc['Contact']['firstName'],_0xbe1ffc[_0x2928('0x10')][_0x2928('0x11')]);this[_0x2928('0x12')]=_0xbe1ffc[_0x2928('0x12')]||![];this['calleridnum']=_0xbe1ffc[_0x2928('0x10')]['phone'];this[_0x2928('0x13')]=_0xbe1ffc[_0x2928('0x13')];this[_0x2928('0x14')]=_0xbe1ffc[_0x2928('0x14')]||0x0;this['countcongestionretry']=_0xbe1ffc[_0x2928('0x15')]||0x0;this[_0x2928('0x16')]=_0xbe1ffc[_0x2928('0x16')]||0x0;this['countglobal']=(_0xbe1ffc['countbusyretry']||0x0)+(_0xbe1ffc[_0x2928('0x15')]||0x0)+(_0xbe1ffc[_0x2928('0x16')]||0x0)+(_0xbe1ffc['countnosuchnumberretry']||0x0)+(_0xbe1ffc['countdropretry']||0x0)+(_0xbe1ffc[_0x2928('0x17')]||0x0)+(_0xbe1ffc[_0x2928('0x18')]||0x0)+(_0xbe1ffc[_0x2928('0x19')]||0x0);this['countnosuchnumberretry']=_0xbe1ffc[_0x2928('0x1a')]||0x0;this[_0x2928('0x1b')]=_0xbe1ffc[_0x2928('0x1b')]||0x0;this['countabandonedretry']=_0xbe1ffc[_0x2928('0x17')]||0x0;this[_0x2928('0x18')]=_0xbe1ffc[_0x2928('0x18')]||0x0;this[_0x2928('0x19')]=_0xbe1ffc[_0x2928('0x19')]||0x0;this[_0x2928('0x1c')]=_0xbe1ffc['callback'];this[_0x2928('0x1d')]=_0xbe1ffc['callbackuniqueid'];this[_0x2928('0x1e')]=_0xbe1ffc['callbackat'];this[_0x2928('0x1f')]=_0xbe1ffc[_0x2928('0x1f')];this['ContactId']=_0xbe1ffc[_0x2928('0x20')];this[_0x2928('0x21')]=_0xbe1ffc['ListId'];this[_0x2928('0x22')]=_[_0x2928('0x3')](_0xbe1ffc[_0x2928('0xa')])?_0xbe1ffc[_0x2928('0x22')]:_0xbe1ffc['Agent']['id'];this[_0x2928('0x23')]=_0xbe1ffc[_0x2928('0x23')];this['originatecalleridnum']='';this[_0x2928('0x24')]='';}Action[_0x2928('0x25')]['getCaller']=function(){return util['format']('\x22%s\x22\x20<%s>',this['calleridname'],this[_0x2928('0x26')]);};module['exports']=Action; \ No newline at end of file +var _0xfed6=['originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','calleridname','exports','util','lodash','isNil','string','uniqueid','queue','type','Agent','name','channelAgent','membername','format','Contact','phone','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ListId','UserId','VoiceQueueId'];(function(_0x406ea6,_0x4e2bd0){var _0x21e927=function(_0x98737c){while(--_0x98737c){_0x406ea6['push'](_0x406ea6['shift']());}};_0x21e927(++_0x4e2bd0);}(_0xfed6,0xf7));var _0x6fed=function(_0x4a6fb8,_0x1c0e0f){_0x4a6fb8=_0x4a6fb8-0x0;var _0xe92da=_0xfed6[_0x4a6fb8];return _0xe92da;};'use strict';var util=require(_0x6fed('0x0'));var _=require(_0x6fed('0x1'));var moment=require('moment');function checkNameSurname(_0x166071,_0x279926,_0x3ffb75){var _0x430830='';if(!_[_0x6fed('0x2')](_0x279926)&&_0x6fed('0x3')===typeof _0x279926){_0x430830+=_0x279926;}if(!_[_0x6fed('0x2')](_0x3ffb75)&&_0x6fed('0x3')===typeof _0x3ffb75){_0x430830+='\x20'+_0x3ffb75;}if(_0x430830!==''){return _0x430830;}return _0x166071;}function Action(_0x5d00df,_0x4bd5cd,_0x20e723,_0x3194d4,_0xc4d486){this[_0x6fed('0x4')]=_0x20e723||undefined;this['idContact']=_0x5d00df['id'];this[_0x6fed('0x5')]=_0x4bd5cd['name'];this[_0x6fed('0x6')]=_0x4bd5cd[_0x6fed('0x6')];this['campaigntype']=_0x6fed('0x5');this['dialAnswer']=![];this['membername']=_[_0x6fed('0x2')](_0x5d00df[_0x6fed('0x7')])?undefined:_0x5d00df[_0x6fed('0x7')][_0x6fed('0x8')];this[_0x6fed('0x9')]=this[_0x6fed('0xa')]?util[_0x6fed('0xb')]('SIP/%s',this[_0x6fed('0xa')]):_0x3194d4||undefined;this['calleridname']=checkNameSurname(_0x5d00df[_0x6fed('0xc')][_0x6fed('0xd')],_0x5d00df[_0x6fed('0xc')]['firstName'],_0x5d00df[_0x6fed('0xc')]['lastName']);this[_0x6fed('0xe')]=_0x5d00df[_0x6fed('0xe')]||![];this[_0x6fed('0xf')]=_0x5d00df[_0x6fed('0xc')][_0x6fed('0xd')];this[_0x6fed('0x10')]=_0x5d00df[_0x6fed('0x10')];this['countbusyretry']=_0x5d00df[_0x6fed('0x11')]||0x0;this['countcongestionretry']=_0x5d00df[_0x6fed('0x12')]||0x0;this[_0x6fed('0x13')]=_0x5d00df[_0x6fed('0x13')]||0x0;this[_0x6fed('0x14')]=(_0x5d00df[_0x6fed('0x11')]||0x0)+(_0x5d00df[_0x6fed('0x12')]||0x0)+(_0x5d00df[_0x6fed('0x13')]||0x0)+(_0x5d00df[_0x6fed('0x15')]||0x0)+(_0x5d00df[_0x6fed('0x16')]||0x0)+(_0x5d00df[_0x6fed('0x17')]||0x0)+(_0x5d00df[_0x6fed('0x18')]||0x0)+(_0x5d00df['countagentrejectretry']||0x0);this[_0x6fed('0x15')]=_0x5d00df[_0x6fed('0x15')]||0x0;this[_0x6fed('0x16')]=_0x5d00df[_0x6fed('0x16')]||0x0;this[_0x6fed('0x17')]=_0x5d00df[_0x6fed('0x17')]||0x0;this[_0x6fed('0x18')]=_0x5d00df['countmachineretry']||0x0;this[_0x6fed('0x19')]=_0x5d00df[_0x6fed('0x19')]||0x0;this['callback']=_0x5d00df[_0x6fed('0x1a')];this['callbackuniqueid']=_0x5d00df[_0x6fed('0x1b')];this[_0x6fed('0x1c')]=_0x5d00df[_0x6fed('0x1c')];this['recallme']=_0x5d00df[_0x6fed('0x1d')];this['ContactId']=_0x5d00df['ContactId'];this[_0x6fed('0x1e')]=_0x5d00df[_0x6fed('0x1e')];this[_0x6fed('0x1f')]=_[_0x6fed('0x2')](_0x5d00df[_0x6fed('0x7')])?_0x5d00df['UserId']:_0x5d00df[_0x6fed('0x7')]['id'];this[_0x6fed('0x20')]=_0x5d00df[_0x6fed('0x20')];this[_0x6fed('0x21')]='';this[_0x6fed('0x22')]='';}Action[_0x6fed('0x23')][_0x6fed('0x24')]=function(){return util[_0x6fed('0xb')](_0x6fed('0x25'),this[_0x6fed('0x26')],this['number']);};module[_0x6fed('0x27')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index e348b78..384e747 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 _0x735a=['custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','SIP/%s','reachable','execRun','unlockContact','recallme','validateContact','isValid','checkIsBlackList','Contact.phone','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','isEmpty','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','trim','substring','dialCutDigit','SIP/%s/%s%s','getCallerId','getCallerIdRandom','dialRandomLastDigitCallerIdNumber','originatecalleridname','originatecalleridnum','toLowerVariables','Action','variablesAction','channelAgent','destconnectedlinenum','calleridnum','user:%s','user:agentconnect','accountcode','[originated][increment]','logLookAgent','clone','isFailure','response','rejected','starttime','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','transfer','[syncHangup][talking][transfer]','destuniqueid','addVariable','variables','syncVarSet','keys','variable','[syncVarSet][Preview]','transfertargetlinkedid','transfererlinkedid','exports','util','bluebird','uuid','md5','ioredis','../../../config/environment','../../../config/logger','./rpcDb','./util/util','redis','socket.io-emitter','prototype','enqueue','tail','sequence','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','syncOriginateResponse','bind','hangup','hanguprequest','syncHangupRequest','dialend','syncDialEnd','newexten','syncNewExten','varset','attendedtransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','type','outbound','name','answered','available','loggedIn','pTalking','sumHoldTime','talking','total','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialPrefix','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangBusyFactor','startPredictive','Trunk','active','callerid','Interval','stringify','format','voice:queue:%s','voice_queue:save','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice_queue_channel:remove','sendMessageOneNotActive','paused','message','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20disactive','hasOwnProperty','dialMethod','booked','setMessage','recallMe','clearZombieChannel','isNil','[clearZombieChannels][talking]','Queue','queue','originated:\x20','originated','pTalking:\x20','dialAnswer','pick','contactId','UserId','VoiceQueueId','ListId','status','channel','No\x20such\x20channel','updateOriginated','decrementTalkink','[clearZombieChannel]','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','clearZombieChannels','[action]','getContactRecallMe','agentReadyId','then','length','scheduledat','dialRecallMeTimeout','Agent','voicePause','run','logger2','[RecallMe]','catch','disableContact','YYYY-MM-DD\x20HH:mm:ss','logCustomer','RecallInQueue','dialRecallInQueue','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','IsNotLoggedIn','isActive','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','outboundNoSuchCallsDay','countnosuchnumberretry','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','buildObj','nosuchnumber','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','scheduledAt','unlockAgent','linkedid','ANSWER','responsetime','answertime','\x20Queue','custom:agentconnect','connect','buildAcw','custom:agentcomplete','complete','outboundAnswerCallsDay','[16]','countglobal','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','sumDuration','talktime','sumBillable','BUSY','Busy','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','dialGlobalMaxRetry','[callProgressDetectingCustomer][logBusyGlobal]','countbusyretry','dialBusyMaxRetry','rescheduleContact','dialBusyRetryFrequency','activeContact','NOANSWER','countnoanswerretry','NoAnswer','custom:agentnoanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerRetryFrequency','CONGESTION','countcongestionretry','Congestion','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','CANCEL','countagentrejectretry','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','AgentReject','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','countmachineretry','cause-txt','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','uniqueid','destlinkedid','callProgressDetectingAgent','isUndefined','object','reason','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','logAgent','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','checkInBlack','Contact','phone','lookAgent','execCall','Queue:\x20','\x20IdHopper:\x20','idContact'];(function(_0x526524,_0x3f3389){var _0x2a689d=function(_0x3a20f0){while(--_0x3a20f0){_0x526524['push'](_0x526524['shift']());}};_0x2a689d(++_0x3f3389);}(_0x735a,0x193));var _0xa735=function(_0x10f3d0,_0x4fe1e1){_0x10f3d0=_0x10f3d0-0x0;var _0x3710dd=_0x735a[_0x10f3d0];return _0x3710dd;};'use strict';var util=require(_0xa735('0x0'));var _=require('lodash');var BPromise=require(_0xa735('0x1'));var uuid=require(_0xa735('0x2'));var moment=require('moment');var md5=require(_0xa735('0x3'));var Redis=require(_0xa735('0x4'));var config=require(_0xa735('0x5'));var logger=require('../../../config/logger')('preview');var loggerAction=require(_0xa735('0x6'))('actionPreview');var ami=require('../ami');var rpcDb=require(_0xa735('0x7'));var Action=require('./action');var ut=require(_0xa735('0x8'));config[_0xa735('0x9')]=_['defaults'](config[_0xa735('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0xa735('0xa'))(new Redis(config[_0xa735('0x9')]));var Sequence=function(){};Sequence[_0xa735('0xb')][_0xa735('0xc')]=function(_0x267427){this[_0xa735('0xd')]=this[_0xa735('0xd')]?this['tail']['finally'](_0x267427):_0x267427();};function Preview(_0xe99e13){this[_0xa735('0xe')]=new Sequence();this[_0xa735('0xf')]=_0xe99e13[_0xa735('0x10')];this[_0xa735('0x11')]=_0xe99e13[_0xa735('0x11')];this[_0xa735('0x12')]={};this['agents']=_0xe99e13[_0xa735('0x13')];this[_0xa735('0x14')]=0x0;ami['on']('originateresponse',this[_0xa735('0x15')][_0xa735('0x16')](this));ami['on'](_0xa735('0x17'),this['syncHangup'][_0xa735('0x16')](this));ami['on'](_0xa735('0x18'),this[_0xa735('0x19')]['bind'](this));ami['on'](_0xa735('0x1a'),this[_0xa735('0x1b')][_0xa735('0x16')](this));ami['on'](_0xa735('0x1c'),this[_0xa735('0x1d')][_0xa735('0x16')](this));ami['on'](_0xa735('0x1e'),this['syncVarSet'][_0xa735('0x16')](this));ami['on'](_0xa735('0x1f'),this['syncAttendedTransfer'][_0xa735('0x16')](this));ami['on'](_0xa735('0x20'),this[_0xa735('0x21')][_0xa735('0x16')](this));this[_0xa735('0x22')](this[_0xa735('0xf')]);}function emit(_0x281d8f,_0x5df816,_0xa70b5a){io['to'](_0x281d8f)[_0xa735('0x23')](_0x5df816,_0xa70b5a);}function emitCampaignPreview(_0x40b528){if(_0x40b528[_0xa735('0x24')]===_0xa735('0x25')){var _0x4dcb74={'id':_0x40b528['id'],'name':_0x40b528[_0xa735('0x26')],'strategy':_0x40b528['strategy'],'answered':_0x40b528[_0xa735('0x27')],'available':_0x40b528[_0xa735('0x28')],'loggedIn':_0x40b528[_0xa735('0x29')],'pTalking':_0x40b528[_0xa735('0x2a')],'sumBillable':_0x40b528['sumBillable'],'sumDuration':_0x40b528['sumDuration'],'sumHoldTime':_0x40b528[_0xa735('0x2b')]||0x0,'talking':_0x40b528[_0xa735('0x2c')],'total':_0x40b528[_0xa735('0x2d')],'type':_0x40b528[_0xa735('0x24')],'unmanaged':_0x40b528[_0xa735('0x2e')],'abandoned':_0x40b528[_0xa735('0x2f')],'waiting':_0x40b528[_0xa735('0x30')],'loggedInDb':_0x40b528[_0xa735('0x31')],'dialActive':_0x40b528[_0xa735('0x32')],'dialMethod':_0x40b528['dialMethod'],'dialOriginateCallerIdName':_0x40b528[_0xa735('0x33')],'dialOriginateCallerIdNumber':_0x40b528[_0xa735('0x34')],'dialOriginateTimeout':_0x40b528['dialOriginateTimeout'],'dialPrefix':_0x40b528[_0xa735('0x35')],'outboundAnswerAgiCallsDay':_0x40b528[_0xa735('0x36')],'outboundAnswerCallsDay':_0x40b528['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x40b528[_0xa735('0x37')],'outboundBusyCallsDay':_0x40b528[_0xa735('0x38')],'outboundCongestionCallsDay':_0x40b528[_0xa735('0x39')],'outboundDropCallsDayACS':_0x40b528[_0xa735('0x3a')],'outboundDropCallsDayCallersExit':_0x40b528[_0xa735('0x3b')],'outboundDropCallsDayTimeout':_0x40b528[_0xa735('0x3c')],'outboundNoAnswerCallsDay':_0x40b528[_0xa735('0x3d')],'outboundNoSuchCallsDay':_0x40b528['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x40b528[_0xa735('0x3e')],'outboundReCallsDay':_0x40b528[_0xa735('0x3f')],'outboundRejectCallsDay':_0x40b528[_0xa735('0x40')],'outboundUnknownCallsDay':_0x40b528[_0xa735('0x41')],'outboundAbandonedCallsDay':_0x40b528[_0xa735('0x42')],'predictiveIntervalAnsweredCalls':_0x40b528[_0xa735('0x43')],'predictiveIntervalAvgHoldtime':_0x40b528['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x40b528[_0xa735('0x44')],'predictiveIntervalDroppedCallsCallersExit':_0x40b528['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x40b528[_0xa735('0x45')],'predictiveIntervalErlangCalls':_0x40b528[_0xa735('0x46')],'predictiveIntervalErlangCallsDroppedCalls':_0x40b528['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x40b528[_0xa735('0x47')],'predictiveIntervalMultiplicativeFactor':_0x40b528['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x40b528[_0xa735('0x48')],'predictiveIntervalAvailable':_0x40b528['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x40b528[_0xa735('0x49')],'message':_0x40b528['message'],'originated':_0x40b528['originated'],'erlangCalls':_0x40b528[_0xa735('0x4a')],'erlangCallToSecond':_0x40b528[_0xa735('0x4b')],'erlangAbandonmentRate':_0x40b528['erlangAbandonmentRate'],'erlangBusyFactor':_0x40b528[_0xa735('0x4c')],'startPredictive':_0x40b528[_0xa735('0x4d')],'startProgressive':_0x40b528['startProgressive']};if(_0x40b528[_0xa735('0x4e')]){_0x4dcb74[_0xa735('0x4e')]={'id':_0x40b528[_0xa735('0x4e')]['id'],'name':_0x40b528[_0xa735('0x4e')]['name'],'active':_0x40b528[_0xa735('0x4e')][_0xa735('0x4f')],'callerid':_0x40b528[_0xa735('0x4e')][_0xa735('0x50')]};}if(_0x40b528['Interval']){_0x4dcb74[_0xa735('0x51')]={'id':_0x40b528[_0xa735('0x51')]['id'],'name':_0x40b528[_0xa735('0x51')][_0xa735('0x26')]};}var _0x53399f=md5(JSON[_0xa735('0x52')](_0x4dcb74));if(_0x40b528['md5']!==_0x53399f){_0x40b528[_0xa735('0x3')]=_0x53399f;emit(util[_0xa735('0x53')](_0xa735('0x54'),_0x4dcb74[_0xa735('0x26')]),_0xa735('0x55'),_0x4dcb74);}}}function emitVoiceQueueChannelRemove(_0x4011bb){logger[_0xa735('0x56')](_0xa735('0x57'),JSON[_0xa735('0x52')](_0x4011bb));emit(util['format']('voice:queue:%s',_0x4011bb[_0xa735('0x26')]),_0xa735('0x58'),_0x4011bb);io['emit']('voice_queue_presence:remove',_0x4011bb);}function notSendMessagesQueue(_0x3bd8a6){if(_0x3bd8a6[_0xa735('0x59')]){if(_0x3bd8a6['originated']===0x0&&_0x3bd8a6[_0xa735('0x2a')]===0x0){_0x3bd8a6['sendMessageOneNotActive']=![];_0x3bd8a6[_0xa735('0x28')]=0x0;_0x3bd8a6[_0xa735('0x5a')]=0x0;_0x3bd8a6[_0xa735('0x5b')]=_0xa735('0x5c');ut[_0xa735('0x5d')](_0xa735('0x5e'),_0x3bd8a6['name']+'\x20is\x20not\x20active');}else{_0x3bd8a6['message']='IS_DISACTIVED';ut[_0xa735('0x5d')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x3bd8a6[_0xa735('0x26')]+_0xa735('0x5f'));}emitCampaignPreview(_0x3bd8a6);}}Preview['prototype'][_0xa735('0x22')]=function(){var _0x9ec851=this;setInterval(function(){_0x9ec851['syncCampaigns']();},0x7cf);};Preview[_0xa735('0xb')]['syncCampaigns']=function(){var _0x511ca2=this[_0xa735('0xf')];this[_0xa735('0x14')]+=0x1;for(var _0xc99f13 in _0x511ca2){if(_0x511ca2[_0xa735('0x60')](_0xc99f13)&&(_0x511ca2[_0xc99f13]['dialMethod']==='preview'||_0x511ca2[_0xc99f13][_0xa735('0x61')]===_0xa735('0x62'))&&_0x511ca2[_0xc99f13][_0xa735('0x24')]===_0xa735('0x25')){if(this[_0xa735('0x14')]>0x7){this[_0xa735('0x14')]=0x0;this['clearZombieChannels']();}}if(_0x511ca2[_0xa735('0x60')](_0xc99f13)&&_0x511ca2[_0xc99f13][_0xa735('0x61')]==='preview'&&_0x511ca2[_0xc99f13][_0xa735('0x24')]===_0xa735('0x25')){if(_0x511ca2[_0xc99f13][_0xa735('0x32')]){this[_0xa735('0x63')](_0x511ca2[_0xc99f13]);this[_0xa735('0x64')](_0x511ca2[_0xc99f13]);}else{notSendMessagesQueue(_0x511ca2[_0xc99f13]);}}}};Preview[_0xa735('0xb')][_0xa735('0x65')]=function(_0xdf18f3){var _0x40de11=this;this[_0xa735('0xe')][_0xa735('0xc')](function(){if(!_[_0xa735('0x66')](_0x40de11[_0xa735('0x12')][_0xdf18f3])){loggerAction[_0xa735('0x56')](_0xa735('0x67'),_0xdf18f3,_0xa735('0x68'),_0x40de11[_0xa735('0x12')][_0xdf18f3][_0xa735('0x69')],_0xa735('0x6a'),JSON[_0xa735('0x52')](_0x40de11[_0xa735('0xf')][_0x40de11[_0xa735('0x12')][_0xdf18f3][_0xa735('0x69')]][_0xa735('0x6b')]),_0xa735('0x6c'),JSON[_0xa735('0x52')](_0x40de11[_0xa735('0xf')][_0x40de11[_0xa735('0x12')][_0xdf18f3][_0xa735('0x69')]][_0xa735('0x2a')]),JSON[_0xa735('0x52')](_0x40de11[_0xa735('0x12')][_0xdf18f3][_0xa735('0x6d')]),JSON[_0xa735('0x52')](_[_0xa735('0x6e')](_0x40de11[_0xa735('0x12')][_0xdf18f3],[_0xa735('0x6f'),_0xa735('0x70'),_0xa735('0x71'),_0xa735('0x72')])));return ami['Action']({'action':_0xa735('0x73'),'channel':_0x40de11['actions'][_0xdf18f3][_0xa735('0x74')]})['catch'](function(_0x49f6fc){if(_0x49f6fc[_0xa735('0x5b')]===_0xa735('0x75')){setTimeout(function(){if(_0x40de11[_0xa735('0x12')][_0xdf18f3]){ut[_0xa735('0x76')](_0x40de11[_0xa735('0xf')][_0x40de11[_0xa735('0x12')][_0xdf18f3][_0xa735('0x69')]],'[clearZombieChannel]');if(_0x40de11[_0xa735('0x12')][_0xdf18f3][_0xa735('0x6d')]===!![]){ut[_0xa735('0x77')](_0x40de11[_0xa735('0xf')][_0x40de11[_0xa735('0x12')][_0xdf18f3][_0xa735('0x69')]],_0xa735('0x78'));ut[_0xa735('0x79')](_0xa735('0x7a')+_0xdf18f3,_0x40de11[_0xa735('0x12')][_0xdf18f3][_0xa735('0x69')]);}ut['loggerError'](_0xa735('0x7b')+_0xdf18f3,_0x40de11[_0xa735('0x12')][_0xdf18f3]['queue']);delete _0x40de11['actions'][_0xdf18f3];}},0x2328);}});}});};Preview[_0xa735('0xb')][_0xa735('0x7c')]=function(){var _0x147346=this;loggerAction[_0xa735('0x56')](_0xa735('0x7d'),_['size'](this[_0xa735('0x12')]));for(var _0x4b05c3 in this['actions']){if(_0x147346[_0xa735('0x12')][_0xa735('0x60')](_0x4b05c3)){_0x147346['clearZombieChannel'](_0x4b05c3);}}};Preview['prototype'][_0xa735('0x64')]=function(_0x28ab40){var _0x17a302=this;rpcDb[_0xa735('0x7e')](_0x28ab40['id'],ut[_0xa735('0x7f')](this[_0xa735('0x13')]))[_0xa735('0x80')](function(_0x4d431d){if(!_['isNil'](_0x4d431d)){for(var _0x260336=0x0;_0x260336<_0x4d431d[_0xa735('0x81')];_0x260336+=0x1){if(ut['getDiff'](_0x4d431d[_0x260336][_0xa735('0x82')])<_0x28ab40[_0xa735('0x83')]*0x3c){if(_0x4d431d[_0x260336][_0xa735('0x84')]&&!_0x4d431d[_0x260336][_0xa735('0x84')][_0xa735('0x85')]){_0x17a302[_0xa735('0x86')](_0x4d431d[_0x260336]['id'])[_0xa735('0x80')](ut[_0xa735('0x87')](_0xa735('0x88')))[_0xa735('0x89')](ut[_0xa735('0x87')](_0xa735('0x88')));}else{rpcDb[_0xa735('0x8a')](_0x4d431d[_0x260336]['id']);}}else{var _0x48f865=new Action(_0x4d431d[_0x260336],_0x28ab40);_0x48f865['starttime']=moment()[_0xa735('0x53')](_0xa735('0x8b'));_0x28ab40[_0xa735('0x3f')]+=0x1;ut[_0xa735('0x8c')](_0x48f865,0x17,_0xa735('0x8d'));if(_0x28ab40[_0xa735('0x8e')]){rpcDb['rescheduleContactInQueue'](ut['createBody'](_0x4d431d[_0x260336]));rpcDb[_0xa735('0x8f')](_0x48f865,_0xa735('0x90'));}else{ut['logCustomer'](_0x48f865,0x16,'RecallFailedTimeout');rpcDb[_0xa735('0x8f')](_0x48f865,_0xa735('0x91'));rpcDb[_0xa735('0x92')](_0x48f865,_0xa735('0x91'));}}}}})['catch'](ut[_0xa735('0x87')](_0xa735('0x93')));};Preview[_0xa735('0xb')][_0xa735('0x63')]=function(_0x10e55d){_0x10e55d['sendMessageOneNotActive']=!![];if(ut[_0xa735('0x94')](_0x10e55d[_0xa735('0x29')])){_0x10e55d['message']='AGENTS_NOT_LOGGED';}else if(!ut[_0xa735('0x95')](_0x10e55d[_0xa735('0x32')])){_0x10e55d[_0xa735('0x5b')]=_0xa735('0x5c');}else if(!this[_0xa735('0x96')](_0x10e55d['Trunk'])){if(!this['isTrunkReachable'](_0x10e55d[_0xa735('0x97')])){_0x10e55d[_0xa735('0x5b')]=_0xa735('0x98');}else{_0x10e55d['message']=_0xa735('0x99');}}else{_0x10e55d['message']=_0xa735('0x99');}emitCampaignPreview(_0x10e55d);};Preview[_0xa735('0xb')][_0xa735('0x9a')]=function(_0x1ee7df,_0x2fe40f,_0x4e2434){var _0x35070d=this;var _0x33ef2e=this[_0xa735('0x12')][_0x2fe40f];var _0x3e4eb8=this[_0xa735('0xf')][_0x33ef2e['queue']];var _0x2878ad;if(_0x3e4eb8){switch(_0x4e2434){case'1':_0x3e4eb8[_0xa735('0x9b')]+=0x1;_0x33ef2e[_0xa735('0x9c')]+=0x1;_0x33ef2e['countglobal']=ut[_0xa735('0x9d')](_0x33ef2e);ut['logCustomer'](_0x33ef2e,0x0,_0xa735('0x9e'));ami['emit'](_0xa735('0x9f'),ut[_0xa735('0xa0')](_0x33ef2e,_0xa735('0xa1')));rpcDb[_0xa735('0x8f')](_0x33ef2e,'[callProgressDetectingCustomer][logNoSuch]');if(ut[_0xa735('0x9d')](_0x33ef2e)>=_0x3e4eb8['dialGlobalMaxRetry']){_0x2878ad=ut[_0xa735('0xa2')](_0x33ef2e,0xf,_0xa735('0xa3'));rpcDb['createCustomerFinal'](_0x2878ad,_0xa735('0xa4'));}else{if(_0x33ef2e[_0xa735('0x9c')]>=_0x3e4eb8[_0xa735('0xa5')]){rpcDb[_0xa735('0x92')](_0x33ef2e,_0xa735('0xa4'));}else{rpcDb['rescheduleContact'](ut[_0xa735('0xa6')](_0x33ef2e,'countnosuchnumberretry',_0x3e4eb8['dialNoSuchNumberRetryFrequency']),_0x33ef2e[_0xa735('0xa7')],_0x33ef2e['activeContact']);}}delete this[_0xa735('0x12')][_0x1ee7df[_0xa735('0xa8')]];break;case _0xa735('0xa9'):var _0x2e0e33=moment()[_0xa735('0x53')](_0xa735('0x8b'));_0x33ef2e[_0xa735('0xaa')]=_0x2e0e33;_0x33ef2e[_0xa735('0xab')]=_0x2e0e33;_0x33ef2e['dialAnswer']=!![];_0x3e4eb8['pTalking']+=0x1;logger[_0xa735('0x56')]('[syncHangup][talking][increment]',_0x33ef2e['uniqueid'],_0xa735('0xac'),_0x3e4eb8[_0xa735('0x26')],_0xa735('0x6c'),_0x3e4eb8[_0xa735('0x2a')]);ami['emit'](_0xa735('0xad'),ut[_0xa735('0xa0')](_0x33ef2e,_0xa735('0xae'),this[_0xa735('0xf')][_0x33ef2e[_0xa735('0x69')]]));if(_0x3e4eb8['acw']){ami[_0xa735('0x23')]('custom:agentConnectPreview',ut[_0xa735('0xaf')](_0x33ef2e));}break;case'16':ami[_0xa735('0x23')](_0xa735('0xb0'),ut['buildObj'](_0x33ef2e,_0xa735('0xb1'),this[_0xa735('0xf')][_0x33ef2e[_0xa735('0x69')]]));emitVoiceQueueChannelRemove(ut[_0xa735('0xa0')](_0x33ef2e,_0xa735('0xb1')));_0x3e4eb8[_0xa735('0xb2')]+=0x1;_0x3e4eb8[_0xa735('0x2d')]+=0x1;_0x3e4eb8[_0xa735('0x27')]+=0x1;ut[_0xa735('0x77')](_0x3e4eb8,_0xa735('0xb3'));_0x33ef2e[_0xa735('0xb4')]=ut['totalGlobal'](_0x33ef2e);ut[_0xa735('0x8c')](_0x33ef2e,0x4,_0xa735('0xb5'));rpcDb[_0xa735('0x8f')](_0x33ef2e,_0xa735('0xb6'));rpcDb[_0xa735('0x92')](_0x33ef2e,_0xa735('0xb7'));rpcDb['crateCustomerReportQueue'](_0x33ef2e);_0x3e4eb8[_0xa735('0xb8')]+=_0x33ef2e[_0xa735('0xb9')];_0x3e4eb8[_0xa735('0xba')]+=_0x33ef2e['talktime'];logger['info']('[syncHangup][talking][decrement]',_0x33ef2e['uniqueid'],_0xa735('0xac'),_0x3e4eb8[_0xa735('0x26')],'pTalking:\x20',_0x3e4eb8[_0xa735('0x2a')]);delete this[_0xa735('0x12')][_0x1ee7df[_0xa735('0xa8')]];break;case _0xa735('0xbb'):_0x3e4eb8[_0xa735('0x38')]+=0x1;_0x33ef2e['countbusyretry']+=0x1;_0x33ef2e['countglobal']=ut['totalGlobal'](_0x33ef2e);ut[_0xa735('0x8c')](_0x33ef2e,0x5,_0xa735('0xbc'));ami[_0xa735('0x23')](_0xa735('0xbd'),ut[_0xa735('0xa0')](_0x33ef2e,_0xa735('0xbe')));rpcDb[_0xa735('0x8f')](_0x33ef2e,_0xa735('0xbf'));if(ut[_0xa735('0x9d')](_0x33ef2e)>=_0x3e4eb8[_0xa735('0xc0')]){_0x2878ad=ut[_0xa735('0xa2')](_0x33ef2e,0xf,_0xa735('0xa3'));rpcDb['createCustomerFinal'](_0x2878ad,_0xa735('0xc1'));}else{if(_0x33ef2e[_0xa735('0xc2')]>=_0x3e4eb8[_0xa735('0xc3')]){rpcDb[_0xa735('0x92')](_0x33ef2e,'[callProgressDetectingCustomer][logBusy]');}else{rpcDb[_0xa735('0xc4')](ut[_0xa735('0xa6')](_0x33ef2e,_0xa735('0xc2'),_0x3e4eb8[_0xa735('0xc5')]),_0x33ef2e[_0xa735('0xa7')],_0x33ef2e[_0xa735('0xc6')]);}}break;case _0xa735('0xc7'):_0x3e4eb8[_0xa735('0x3d')]+=0x1;_0x33ef2e[_0xa735('0xc8')]+=0x1;_0x33ef2e[_0xa735('0xb4')]=ut['totalGlobal'](_0x33ef2e);ut[_0xa735('0x8c')](_0x33ef2e,0x3,_0xa735('0xc9'));ami[_0xa735('0x23')](_0xa735('0xca'),ut[_0xa735('0xa0')](_0x33ef2e,'noanswer'));rpcDb[_0xa735('0x8f')](_0x33ef2e,_0xa735('0xcb'));if(ut['totalGlobal'](_0x33ef2e)>=_0x3e4eb8[_0xa735('0xc0')]){_0x2878ad=ut[_0xa735('0xa2')](_0x33ef2e,0xf,_0xa735('0xa3'));rpcDb['createCustomerFinal'](_0x2878ad,_0xa735('0xcc'));}else{if(_0x33ef2e['countnoanswerretry']>=_0x3e4eb8['dialNoAnswerMaxRetry']){rpcDb['createCustomerFinal'](_0x33ef2e,_0xa735('0xcb'));}else{rpcDb[_0xa735('0xc4')](ut['scheduledAt'](_0x33ef2e,'countnoanswerretry',_0x3e4eb8[_0xa735('0xcd')]),_0x33ef2e[_0xa735('0xa7')],_0x33ef2e['activeContact']);}}break;case _0xa735('0xce'):_0x3e4eb8[_0xa735('0x39')]+=0x1;_0x33ef2e[_0xa735('0xcf')]+=0x1;_0x33ef2e[_0xa735('0xb4')]=ut[_0xa735('0x9d')](_0x33ef2e);ut[_0xa735('0x8c')](_0x33ef2e,0x8,_0xa735('0xd0'));ami[_0xa735('0x23')]('custom:agentcongestion',ut[_0xa735('0xa0')](_0x33ef2e,'congestion'));rpcDb[_0xa735('0x8f')](_0x33ef2e,'[callProgressDetectingCustomer][logCongestion]');if(ut[_0xa735('0x9d')](_0x33ef2e)>=_0x3e4eb8[_0xa735('0xc0')]){_0x2878ad=ut[_0xa735('0xa2')](_0x33ef2e,0xf,'Global');rpcDb['createCustomerFinal'](_0x2878ad,_0xa735('0xd1'));}else{if(_0x33ef2e['countcongestionretry']>=_0x3e4eb8[_0xa735('0xd2')]){rpcDb[_0xa735('0x92')](_0x33ef2e,'[callProgressDetectingCustomer][logCongestion]');}else{rpcDb[_0xa735('0xc4')](ut['scheduledAt'](_0x33ef2e,_0xa735('0xcf'),_0x3e4eb8[_0xa735('0xc5')]),_0x33ef2e[_0xa735('0xa7')],_0x33ef2e['activeContact']);}}break;case _0xa735('0xd3'):_0x3e4eb8['outboundRejectCallsDay']+=0x1;_0x33ef2e[_0xa735('0xd4')]+=0x1;_0x33ef2e[_0xa735('0xb4')]=ut[_0xa735('0x9d')](_0x33ef2e);ut[_0xa735('0x8c')](_0x33ef2e,0x14,'AgentReject');ami['emit'](_0xa735('0xd5'),ut[_0xa735('0xa0')](_0x33ef2e,_0xa735('0xd6')));rpcDb[_0xa735('0x8f')](_0x33ef2e,_0xa735('0xd7'));if(ut[_0xa735('0x9d')](_0x33ef2e)>=_0x3e4eb8[_0xa735('0xc0')]){_0x2878ad=ut['cloneAction'](_0x33ef2e,0x14,_0xa735('0xd8'));rpcDb[_0xa735('0x92')](_0x2878ad,_0xa735('0xd9'));}else{if(_0x33ef2e['countagentrejectretry']>=_0x3e4eb8[_0xa735('0xda')]){rpcDb[_0xa735('0x92')](_0x33ef2e,_0xa735('0xd9'));}else{rpcDb[_0xa735('0xc4')](ut[_0xa735('0xa6')](_0x33ef2e,_0xa735('0xd4'),_0x3e4eb8['dialAgentRejectRetryFrequency']),_0x33ef2e['unlockAgent'],_0x33ef2e[_0xa735('0xc6')]);}}break;case'ABANDONED':_0x3e4eb8['outboundAbandonedCallsDay']+=0x1;_0x33ef2e[_0xa735('0xdb')]+=0x1;_0x33ef2e['countglobal']=ut[_0xa735('0x9d')](_0x33ef2e);ut[_0xa735('0x8c')](_0x33ef2e,0xb,_0xa735('0xdc'));rpcDb['createCustomerHistory'](_0x33ef2e,_0xa735('0xdd'));if(ut[_0xa735('0x9d')](_0x33ef2e)>=_0x3e4eb8[_0xa735('0xc0')]){_0x2878ad=ut[_0xa735('0xa2')](_0x33ef2e,0xf,_0xa735('0xa3'));rpcDb[_0xa735('0x92')](_0x2878ad,_0xa735('0xdd'));}else{if(_0x33ef2e[_0xa735('0xde')]>=_0x3e4eb8[_0xa735('0xdf')]){rpcDb[_0xa735('0x92')](_0x33ef2e,_0xa735('0xdd'));}else{rpcDb[_0xa735('0xc4')](ut[_0xa735('0xa6')](_0x33ef2e,_0xa735('0xdb'),_0x3e4eb8['dialAbandonedRetryFrequency']),_0x33ef2e[_0xa735('0xa7')],_0x33ef2e['activeContact']);}}break;case'18':_0x3e4eb8[_0xa735('0x41')]+=0x1;_0x33ef2e[_0xa735('0xe0')]+=0x1;_0x33ef2e[_0xa735('0xb4')]=ut[_0xa735('0x9d')](_0x33ef2e);ut[_0xa735('0x8c')](_0x33ef2e,0x12,_0x1ee7df[_0xa735('0xe1')]||_0x1ee7df[_0xa735('0xe2')]);ami[_0xa735('0x23')](_0xa735('0xe3'),ut[_0xa735('0xa0')](_0x33ef2e,_0xa735('0xe4')));rpcDb[_0xa735('0x8f')](_0x33ef2e,_0xa735('0xe5'));if(ut[_0xa735('0x9d')](_0x33ef2e)>=_0x3e4eb8[_0xa735('0xc0')]){_0x2878ad=ut[_0xa735('0xa2')](_0x33ef2e,0xf,'Global');rpcDb['createCustomerFinal'](_0x2878ad,_0xa735('0xe5'));}else{rpcDb[_0xa735('0x92')](_0x33ef2e,'[callProgressDetectingCustomer][hangupInAMD]');}delete this[_0xa735('0x12')][_0x1ee7df[_0xa735('0xa8')]];break;case'19':_0x3e4eb8[_0xa735('0x41')]+=0x1;_0x33ef2e[_0xa735('0xb4')]=ut['totalGlobal'](_0x33ef2e);ut[_0xa735('0x8c')](_0x33ef2e,0x13,_0x1ee7df[_0xa735('0xe1')]||_0x1ee7df['dialstatus']);ami[_0xa735('0x23')](_0xa735('0xe3'),ut['buildObj'](_0x33ef2e,_0xa735('0xe4')));rpcDb[_0xa735('0x8f')](_0x33ef2e,_0xa735('0xe6'));if(ut[_0xa735('0x9d')](_0x33ef2e)>=_0x3e4eb8[_0xa735('0xc0')]){_0x2878ad=ut[_0xa735('0xa2')](_0x33ef2e,0xf,'Global');rpcDb[_0xa735('0x92')](_0x2878ad,_0xa735('0xe6'));}else{rpcDb[_0xa735('0x92')](_0x33ef2e,'[callProgressDetectingCustomer][machine]');}delete this['actions'][_0x1ee7df[_0xa735('0xa8')]];break;default:if(_0x33ef2e[_0xa735('0x6d')]){ut[_0xa735('0x77')](_0x3e4eb8,'[default]');ut[_0xa735('0x79')](_0xa735('0xe7')+_0x3e4eb8[_0xa735('0x26')],_0x1ee7df);}_0x3e4eb8[_0xa735('0x41')]+=0x1;_0x33ef2e[_0xa735('0xb4')]=ut[_0xa735('0x9d')](_0x33ef2e);ut[_0xa735('0x8c')](_0x33ef2e,0xc,_0x1ee7df['cause-txt']||_0x1ee7df[_0xa735('0xe2')]);rpcDb[_0xa735('0x8f')](_0x33ef2e,_0xa735('0xe8'));if(ut[_0xa735('0x9d')](_0x33ef2e)>=_0x3e4eb8[_0xa735('0xc0')]){_0x2878ad=ut['cloneAction'](_0x33ef2e,0xf,_0xa735('0xa3'));rpcDb['createCustomerFinal'](_0x2878ad,_0xa735('0xe9'));}else{rpcDb['createCustomerFinal'](_0x33ef2e,_0xa735('0xe9'));}delete this['actions'][_0x1ee7df[_0xa735('0xa8')]];}if(!(_0x33ef2e[_0xa735('0x6d')]&&_0x4e2434==='16')){ut['updateOriginated'](_0x3e4eb8,_0xa735('0xea'));logger[_0xa735('0x56')](_0xa735('0xeb'),_0x33ef2e[_0xa735('0xec')],'\x20Queue',_0x3e4eb8[_0xa735('0x26')],'originated:\x20',_0x3e4eb8[_0xa735('0x6b')]);}if(_0x4e2434!==_0xa735('0xa9')){delete this[_0xa735('0x12')][_0x1ee7df[_0xa735('0xa8')]];delete this[_0xa735('0x12')][_0x1ee7df[_0xa735('0xed')]];}}};Preview['prototype'][_0xa735('0xee')]=function(_0x4b6ab3,_0x5c9b9e,_0x372634){if(_[_0xa735('0xef')](_0x5c9b9e)&&'object'!==typeof _0x5c9b9e){return;}if(_[_0xa735('0xef')](_0x372634)&&_0xa735('0xf0')!==typeof _0x372634){return;}switch(_0x372634[_0xa735('0xf1')]){case'0':ut['logAgent'](_0x4b6ab3,0x0,'NoSuchNumber');rpcDb[_0xa735('0xf2')](_0x4b6ab3,_0xa735('0xf3'));break;case'3':ut[_0xa735('0xf4')](_0x4b6ab3,0x3,_0xa735('0xc9'));rpcDb[_0xa735('0xf2')](_0x4b6ab3,'[callProgressDetectingAgent][logNoAnswer]');break;case'5':ut['logAgent'](_0x4b6ab3,0x5,'Busy');rpcDb[_0xa735('0xf2')](_0x4b6ab3,_0xa735('0xf5'));break;case'8':ut[_0xa735('0xf4')](_0x4b6ab3,0x8,'Congestion');rpcDb['createAgentHistory'](_0x4b6ab3,_0xa735('0xf6'));break;case'22':ut[_0xa735('0xf4')](_0x4b6ab3,0x16,_0xa735('0xf7'));rpcDb[_0xa735('0xf2')](_0x4b6ab3,_0xa735('0xf8'));break;default:ut['logAgent'](_0x4b6ab3,0xc,_0x372634[_0xa735('0xf1')]);rpcDb[_0xa735('0xf2')](_0x4b6ab3,_0xa735('0xf6'));}ut['updateOriginated'](_0x5c9b9e,_0xa735('0xf9'));logger['info'](_0xa735('0xfa'),_0x4b6ab3[_0xa735('0xec')],'\x20Queue',_0x5c9b9e[_0xa735('0x26')],_0xa735('0x6a'),_0x5c9b9e['originated']);delete this[_0xa735('0x12')][_0x4b6ab3['uniqueid']];};Preview[_0xa735('0xb')][_0xa735('0xfb')]=function(_0x438326,_0xb344d3,_0x3f1dc6,_0x3c22bc,_0x202936){var _0x41fc9c=this;return new BPromise(function(_0x3468c8,_0x28e10b){if(_[_0xa735('0x66')](_0xb344d3)||_[_0xa735('0x66')](_0xb344d3[_0xa735('0xfc')])||_[_0xa735('0x66')](_0xb344d3['Contact'][_0xa735('0xfd')])||_['isNil'](_0xb344d3[_0xa735('0x71')])){_0x28e10b(ut[_0xa735('0x5b')]('Contact\x20is\x20undefined',_0x3c22bc,_0x202936));return;}var _0x4f20f3=uuid['v4']();var _0x2f0da8=_0x41fc9c['campaignsPreview'][_0xb344d3[_0xa735('0x68')]['name']];var _0x1e9c88=_0x3f1dc6?_0x41fc9c[_0xa735('0x13')][_0x3f1dc6]['id']:undefined;_0x41fc9c[_0xa735('0x12')][_0x4f20f3]=new Action(_0xb344d3,_0x2f0da8,_0x4f20f3,_0x3f1dc6,_0x1e9c88);var _0x3b5219=_0x41fc9c[_0xa735('0x12')][_0x4f20f3];_0x3b5219[_0xa735('0xa7')]=_0x3c22bc;_0x3b5219[_0xa735('0xc6')]=_0x202936;_0x3b5219[_0xa735('0xfe')]=_0x3f1dc6;if(_['isEmpty'](_0x438326)){_0x41fc9c[_0xa735('0xff')](_0x3b5219,_0x2f0da8,_0xb344d3,_0x3f1dc6)[_0xa735('0x80')](function(_0x3b8188){logger[_0xa735('0x56')]('[Preview][execCall][success]',_0xa735('0x100')+_0x3b5219[_0xa735('0x69')]+_0xa735('0x101')+_0x3b5219[_0xa735('0x102')],JSON[_0xa735('0x52')](_0x3b8188));ami[_0xa735('0x23')](_0xa735('0x103'),ut[_0xa735('0xa0')](_0x3b5219,_0xa735('0x104'),_0x41fc9c[_0xa735('0xf')][_0x3b5219[_0xa735('0x69')]]));_0x3468c8(ut[_0xa735('0x5b')](_0xa735('0x105')));})[_0xa735('0x89')](function(_0x526491){ut[_0xa735('0x5d')](_0xa735('0x106'),_0x526491);_0x28e10b(ut['message'](_0xa735('0x107'),_0x3c22bc,_0x202936));});}else{_0x2f0da8[_0xa735('0x37')]+=0x1;ut['logBlacklist'](_0x3b5219);rpcDb[_0xa735('0x108')](_0x3b5219,_0xa735('0x109'));delete _0x41fc9c[_0xa735('0x12')][_0x4f20f3];_0x28e10b(ut[_0xa735('0x5b')](_0xa735('0x10a'),_0x3c22bc,_0x202936));}});};Preview[_0xa735('0xb')][_0xa735('0x96')]=function(_0x58b02b){return!_['isNil'](_0x58b02b)&&!_[_0xa735('0x66')](_0x58b02b[_0xa735('0x26')])&&!_['isNil'](_0x58b02b[_0xa735('0x4f')])&&_0x58b02b['active']&&!_[_0xa735('0x66')](this['trunks'][util['format']('SIP/%s',_0x58b02b[_0xa735('0x26')])])&&!_[_0xa735('0x66')](this['trunks'][util[_0xa735('0x53')](_0xa735('0x10b'),_0x58b02b['name'])]['status'])&&(this['trunks'][util[_0xa735('0x53')](_0xa735('0x10b'),_0x58b02b[_0xa735('0x26')])][_0xa735('0x73')]===_0xa735('0x10c')||this[_0xa735('0x11')][util[_0xa735('0x53')](_0xa735('0x10b'),_0x58b02b['name'])]['status']==='unmonitored');};Preview[_0xa735('0xb')][_0xa735('0x86')]=function(_0x356d25,_0x82f9f0){var _0x4c9df4=this;return new BPromise(function(_0x1747f6,_0x54a7ec){_0x4c9df4[_0xa735('0x10d')](_0x356d25,_0x82f9f0)[_0xa735('0x80')](function(_0x75d60d){_0x1747f6(_[_0xa735('0x6e')](_0x75d60d,['message']));})[_0xa735('0x89')](function(_0x20d689){if(_0x20d689['unlock']){rpcDb[_0xa735('0x10e')](_0x356d25);}if(_0x20d689['active']){rpcDb[_0xa735('0x8a')](_0x356d25);}_0x54a7ec(_[_0xa735('0x6e')](_0x20d689,[_0xa735('0x5b')]));});});};Preview['prototype'][_0xa735('0x10d')]=function(_0x4c6b1b,_0x2e26d6){var _0x3b09ec=this;return new BPromise(function(_0x5c3ea0,_0x242934){var _0x41185d,_0x2976b3;rpcDb['getContactPreview'](_0x4c6b1b)[_0xa735('0x80')](function(_0x5e2293){if(!_[_0xa735('0x66')](_0x5e2293[0x0])){_0x2976b3=_0x5e2293[0x0][_0xa735('0x10f')]?![]:!![];_0x41185d=_0x5e2293[0x0]['recallme']?!![]:![];_0x41185d=_0x2e26d6?!![]:_0x41185d;}var _0x1a761f=_0x3b09ec[_0xa735('0x110')](_0x5e2293);if(_0x1a761f[_0xa735('0x111')]){rpcDb[_0xa735('0x112')](_[_0xa735('0x6e')](_0x5e2293[0x0],[_0xa735('0x71'),_0xa735('0x113')]))[_0xa735('0x80')](function(_0x483a96){_0x3b09ec[_0xa735('0xfb')](_0x483a96,_0x5e2293[0x0],_0x2e26d6,_0x2976b3,_0x41185d)['then'](function(_0x2f158e){_0x5c3ea0(_0x2f158e);})[_0xa735('0x89')](function(_0x3a1ba0){_0x242934(_0x3a1ba0);});})[_0xa735('0x89')](function(_0x2f2681){ut['logger'](_0xa735('0x114'),_0x2f2681);_0x242934(ut[_0xa735('0x5b')](_0xa735('0x115'),_0x2976b3,_0x41185d));});}else{_0x242934(ut[_0xa735('0x5b')](_0x1a761f[_0xa735('0x5b')],_0x2976b3,_0x41185d));}})[_0xa735('0x89')](function(_0x47f666){ut['logger'](_0xa735('0x116'),_0x47f666);_0x242934(ut[_0xa735('0x5b')](_0xa735('0x115'),![],!![]));});});};Preview[_0xa735('0xb')][_0xa735('0x110')]=function(_0x36ba68){if(_['isNil'](_0x36ba68)||_[_0xa735('0x117')](_0x36ba68)||!_['isNil'](_0x36ba68[0x0][_0xa735('0x84')])&&_['isNil'](_0x36ba68[0x0]['Agent'][_0xa735('0x26')])){ut['logger']('[Preview][validateContact][Empty\x20Contact]',_0x36ba68);return{'isValid':![],'message':'Empty\x20Contact'};}var _0x214125=this[_0xa735('0xf')][_0x36ba68[0x0][_0xa735('0x68')][_0xa735('0x26')]];_0x214125['message']=_0xa735('0x99');if(_[_0xa735('0x66')](_0x214125)){ut['logger']('[Preview][validateContact][Empty\x20Campaign]',_0x214125);return{'isValid':![],'message':'Empty\x20Campaign'};}if(!this[_0xa735('0x96')](_0x214125['Trunk'])){ut[_0xa735('0x5d')](_0xa735('0x118'),_0xa735('0x119')+_0x214125[_0xa735('0x26')]+_0xa735('0x11a'));if(!this['isTrunkReachable'](_0x214125[_0xa735('0x97')])){ut[_0xa735('0x5d')](_0xa735('0x118'),_0x214125[_0xa735('0x26')]+_0xa735('0x11b'));return{'isValid':![],'message':_0xa735('0x11c')};}}if(!ut[_0xa735('0x95')](_0x214125[_0xa735('0x32')])){ut[_0xa735('0x5d')](_0xa735('0x11d'),_0x214125[_0xa735('0x26')]+_0xa735('0x11e'));return{'isValid':![],'message':_0xa735('0x119')+_0x214125['name']+_0xa735('0x11e')};}return{'isValid':!![],'message':_0xa735('0x11f')};};Preview[_0xa735('0xb')][_0xa735('0xff')]=function(_0x2a298a,_0x5c80fa,_0x315b78,_0x1372ed){var _0x3b071c=this;return new BPromise(function(_0x5628d9,_0x53d932){var _0x256896=_0x2a298a[_0xa735('0xec')];var _0x1fb0dd=_0x3b071c[_0xa735('0x96')](_0x5c80fa['Trunk'])?util['format']('SIP/%s/%s%s',_0x5c80fa[_0xa735('0x4e')][_0xa735('0x26')],_[_0xa735('0x66')](_0x5c80fa[_0xa735('0x35')])?'':_0x5c80fa[_0xa735('0x35')][_0xa735('0x120')]()||'',_0x5c80fa['dialCutDigit']>0x0?_0x315b78[_0xa735('0xfc')][_0xa735('0xfd')][_0xa735('0x121')](_0x5c80fa[_0xa735('0x122')]):_0x315b78[_0xa735('0xfc')]['phone']):util['format'](_0xa735('0x123'),_[_0xa735('0x66')](_0x5c80fa[_0xa735('0x97')])?_0x5c80fa[_0xa735('0x4e')][_0xa735('0x26')]:_0x5c80fa[_0xa735('0x97')]['name'],_['isNil'](_0x5c80fa[_0xa735('0x35')])?'':_0x5c80fa[_0xa735('0x35')][_0xa735('0x120')]()||'',_0x5c80fa[_0xa735('0x122')]>0x0?_0x315b78[_0xa735('0xfc')][_0xa735('0xfd')]['substring'](_0x5c80fa['dialCutDigit']):_0x315b78['Contact']['phone']);var _0x4c847d=_0x3b071c[_0xa735('0x96')](_0x5c80fa[_0xa735('0x4e')])?ut[_0xa735('0x124')](_0x5c80fa[_0xa735('0x4e')][_0xa735('0x50')],_0x5c80fa[_0xa735('0x33')],_0x5c80fa['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0xa735('0x125')](_0x5c80fa[_0xa735('0x34')],_0x5c80fa['dialRandomLastDigitCallerIdNumber']):_0x5c80fa[_0xa735('0x34')]):ut[_0xa735('0x124')](_['isNil'](_0x5c80fa[_0xa735('0x97')])?_0x5c80fa[_0xa735('0x4e')][_0xa735('0x50')]:_0x5c80fa[_0xa735('0x97')]['callerid'],_0x5c80fa[_0xa735('0x33')],_0x5c80fa[_0xa735('0x126')]>0x0?ut[_0xa735('0x125')](_0x5c80fa[_0xa735('0x34')],_0x5c80fa[_0xa735('0x126')]):_0x5c80fa[_0xa735('0x34')]);if(_0x4c847d){_0x2a298a[_0xa735('0x127')]=ut['extractCalleridName'](_0x4c847d);_0x2a298a[_0xa735('0x128')]=ut['extractCalleridNumber'](_0x4c847d);}var _0x4eb700=ut['addVariables'](_0x5c80fa,_0x315b78,_0x1fb0dd,_0x4c847d,_0x256896,_0x2a298a);_['merge'](_0x2a298a,ut[_0xa735('0x129')](_0x4eb700));_0x2a298a['starttime']=moment()[_0xa735('0x53')]('YYYY-MM-DD\x20HH:mm:ss');ami[_0xa735('0x12a')](ut[_0xa735('0x12b')](_0x2a298a,_0x5c80fa,_0x4eb700,_0x2a298a[_0xa735('0xc6')],_0x1372ed))['then'](function(_0x347a55){var _0x50ba96=_0x2a298a[_0xa735('0x12c')];if(!_[_0xa735('0x66')](_0x50ba96)){if(!_[_0xa735('0x66')](_0x3b071c[_0xa735('0x13')][_0x50ba96])){_0x3b071c[_0xa735('0x13')][_0x50ba96][_0xa735('0x12d')]=_0x2a298a[_0xa735('0x12e')];emit(util[_0xa735('0x53')](_0xa735('0x12f'),_0x3b071c[_0xa735('0x13')][_0x50ba96]['name']),_0xa735('0x130'),{'destaccountcode':_0x3b071c[_0xa735('0x13')][_0x50ba96][_0xa735('0x131')],'destconnectedlinenum':_0x2a298a[_0xa735('0x12e')]});}}_0x5c80fa[_0xa735('0x6b')]+=0x1;logger[_0xa735('0x56')](_0xa735('0x132'),_0x256896,_0xa735('0xac'),_0x5c80fa[_0xa735('0x26')],_0xa735('0x6a'),_0x5c80fa[_0xa735('0x6b')]);_0x5628d9(_0x347a55);})[_0xa735('0x89')](function(_0x30fb2a){ut[_0xa735('0xf4')](_0x2a298a,0xe,'OriginateError');rpcDb[_0xa735('0xf2')](_0x2a298a,'[originateFailure][logOriginateFailure]');_0x53d932(_0x30fb2a);});});};Preview['prototype'][_0xa735('0x1d')]=function(_0x37d1e4){if(this[_0xa735('0x12')][_0x37d1e4[_0xa735('0xa8')]]){this[_0xa735('0x12')][_0x37d1e4[_0xa735('0xa8')]][_0xa735('0x74')]=_0x37d1e4[_0xa735('0x74')];}};Preview[_0xa735('0xb')][_0xa735('0x15')]=function(_0x4bf208){var _0x1bb1d6=this;var _0x53eae1=this[_0xa735('0x12')][_0x4bf208['actionid']];if(_0x53eae1){if(_0x53eae1['lookAgent']&&this['agents'][_0x53eae1[_0xa735('0xfe')]]){ut[_0xa735('0x133')](_0x53eae1,this[_0xa735('0x13')][_0x53eae1[_0xa735('0xfe')]]['name'],this[_0xa735('0x13')][_0x53eae1['lookAgent']]['id']);}var _0x539c33=_[_0xa735('0x134')](_0x53eae1);_0x539c33[_0xa735('0xaa')]=moment()[_0xa735('0x53')]('YYYY-MM-DD\x20HH:mm:ss');var _0x3a4e10=_0x1bb1d6[_0xa735('0xf')][_0x53eae1[_0xa735('0x69')]];if(ut[_0xa735('0x135')](_0x4bf208[_0xa735('0x136')])){if(_0x53eae1[_0xa735('0xa7')]){rpcDb[_0xa735('0x10e')](_0x53eae1[_0xa735('0x102')]);}if(_0x53eae1['activeContact']){rpcDb[_0xa735('0x8a')](_0x53eae1['idContact']);}ami[_0xa735('0x23')]('custom:agentringnoanswer',ut[_0xa735('0xa0')](_0x53eae1,_0xa735('0x137'),this['campaignsPreview'][_0x53eae1['queue']]));this[_0xa735('0xee')](_0x539c33,_0x3a4e10,_0x4bf208);}else{_0x53eae1[_0xa735('0x138')]=moment()['format'](_0xa735('0x8b'));ut[_0xa735('0xf4')](_0x539c33,0x4,_0xa735('0xb5'));rpcDb[_0xa735('0xf2')](_0x539c33,_0xa735('0x139'));}}};Preview[_0xa735('0xb')]['syncHangup']=function(_0x5ce2db){var _0x59158d=this;var _0x8f37f4=this[_0xa735('0x12')][_0x5ce2db[_0xa735('0xa8')]];var _0x1905e4;if(_0x8f37f4){_0x1905e4=this[_0xa735('0xf')][_0x8f37f4[_0xa735('0x69')]];logger[_0xa735('0x56')](_0xa735('0x13a'),_0x5ce2db[_0xa735('0xa8')],_0xa735('0xac'),_0x1905e4[_0xa735('0x26')],_0xa735('0x6c'),_0x1905e4[_0xa735('0x2a')]);}if(this[_0xa735('0x12')][_0x5ce2db[_0xa735('0xa8')]]&&_0x5ce2db[_0xa735('0xa8')]!==_0x5ce2db[_0xa735('0xec')]){if(_0x5ce2db[_0xa735('0x13b')]==='16'&&this[_0xa735('0x12')][_0x5ce2db[_0xa735('0xa8')]][_0xa735('0x6d')]){this['callProgressDetectingCustomer'](_0x5ce2db,_0x5ce2db[_0xa735('0xa8')],_0x5ce2db['cause']);}else if(this[_0xa735('0x12')][_0x5ce2db[_0xa735('0xa8')]][_0xa735('0x6d')]){logger[_0xa735('0x56')](_0xa735('0x13c'),_0x5ce2db[_0xa735('0xa8')],_0x5ce2db[_0xa735('0x13b')],_0xa735('0xac'),_0x1905e4['name'],'pTalking:\x20',_0x1905e4[_0xa735('0x2a')]);this[_0xa735('0x9a')](_0x5ce2db,_0x5ce2db[_0xa735('0xa8')],_0x5ce2db['cause']);}}else if(_0x8f37f4&&_[_0xa735('0x66')](_0x8f37f4[_0xa735('0x13d')])&&_0x1905e4[_0xa735('0x13e')]&&_0x5ce2db[_0xa735('0xa8')]===_0x5ce2db[_0xa735('0xec')]&&_[_0xa735('0x66')](_0x5ce2db[_0xa735('0xf1')])&&_0x5ce2db[_0xa735('0x13b')]==='16'&&_0x5ce2db['channelstate']==='6'&&_['isUndefined'](_0x8f37f4[_0xa735('0x13f')])){if(_0x8f37f4[_0xa735('0xa7')]){rpcDb[_0xa735('0x10e')](_0x8f37f4[_0xa735('0x102')]);}if(_0x8f37f4[_0xa735('0xc6')]){rpcDb[_0xa735('0x8a')](_0x8f37f4['idContact']);}_0x5ce2db[_0xa735('0xf1')]='22';this[_0xa735('0xee')](_0x8f37f4,_0x1905e4,_0x5ce2db);}else if(_0x8f37f4&&_0x8f37f4[_0xa735('0x13f')]){if(_0x5ce2db['cause']==='16'&&this[_0xa735('0x12')][_0x5ce2db[_0xa735('0xa8')]][_0xa735('0x6d')]){logger[_0xa735('0x56')](_0xa735('0x140'),_0x5ce2db[_0xa735('0xa8')],_0x5ce2db[_0xa735('0x13b')],'\x20Queue',_0x1905e4[_0xa735('0x26')],'pTalking:\x20',_0x1905e4[_0xa735('0x2a')]);this['callProgressDetectingCustomer'](_0x5ce2db,_0x5ce2db[_0xa735('0xa8')],_0x5ce2db[_0xa735('0x13b')]);}else if(this[_0xa735('0x12')][_0x5ce2db['linkedid']][_0xa735('0x6d')]){logger[_0xa735('0x56')]('[syncHangup][talking][cause]',_0x5ce2db[_0xa735('0xa8')],_0x5ce2db['cause'],'\x20Queue',_0x1905e4[_0xa735('0x26')],_0xa735('0x6c'),_0x1905e4[_0xa735('0x2a')]);this[_0xa735('0x9a')](_0x5ce2db,_0x5ce2db[_0xa735('0xa8')],_0x5ce2db[_0xa735('0x13b')]);}}};Preview[_0xa735('0xb')][_0xa735('0x1b')]=function(_0x13881e){if(this[_0xa735('0x12')][_0x13881e[_0xa735('0xed')]]&&_0x13881e[_0xa735('0xed')]!==_0x13881e[_0xa735('0x141')]){this[_0xa735('0x9a')](_0x13881e,_0x13881e[_0xa735('0xed')],_0x13881e[_0xa735('0xe2')]);}};Preview[_0xa735('0xb')][_0xa735('0x19')]=function(_0x3e55ad){if(this['actions'][_0x3e55ad[_0xa735('0xa8')]]&&_0x3e55ad['linkedid']!==_0x3e55ad[_0xa735('0xec')]&&!this[_0xa735('0x12')][_0x3e55ad[_0xa735('0xa8')]][_0xa735('0x6d')]){if(_0x3e55ad['cause']==='1'){this[_0xa735('0x9a')](_0x3e55ad,_0x3e55ad['linkedid'],_0x3e55ad[_0xa735('0x13b')]);}}};Preview[_0xa735('0xb')][_0xa735('0x142')]=function(_0x38588f,_0x402f21,_0x38fdb8){if(this[_0xa735('0x12')][_0x38588f]){if(_[_0xa735('0x66')](this[_0xa735('0x12')][_0x38588f][_0xa735('0x143')])){this[_0xa735('0x12')][_0x38588f][_0xa735('0x143')]={};}this[_0xa735('0x12')][_0x38588f][_0xa735('0x143')][_0x402f21]=_0x38fdb8;}};Preview['prototype'][_0xa735('0x144')]=function(_0x54e66f){try{if(!_['isNil'](_0x54e66f)){if(ut['filterKey'](_[_0xa735('0x145')](_0x54e66f[_0xa735('0x146')])[0x0])){this[_0xa735('0x142')](_0x54e66f[_0xa735('0xec')],_[_0xa735('0x145')](_0x54e66f[_0xa735('0x146')])[0x0],_0x54e66f['value']);}}}catch(_0x356f23){logger['error'](_0xa735('0x147'),util['inspect'](_0x356f23,{'showHidden':![],'depth':null}));}};Preview['prototype']['syncAttendedTransfer']=function(_0x4955d4){if(_0x4955d4){if(this[_0xa735('0x12')][_0x4955d4[_0xa735('0x148')]]){this[_0xa735('0x12')][_0x4955d4[_0xa735('0x148')]][_0xa735('0x13f')]=!![];}}};Preview['prototype'][_0xa735('0x21')]=function(_0x50dd27){if(_0x50dd27){if(this[_0xa735('0x12')][_0x50dd27[_0xa735('0x149')]]){this['actions'][_0x50dd27['transfererlinkedid']][_0xa735('0x13f')]=!![];}}};module[_0xa735('0x14a')]=Preview; \ No newline at end of file +var _0xa82c=['validateContact','[Preview][getContactPreview]','isEmpty','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','isActive','\x20Not\x20Active','campaign\x20Name:\x20','Is\x20Valid','trim','dialCutDigit','substring','SIP/%s/%s%s','getCallerId','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','originatecalleridname','originatecalleridnum','addVariables','merge','toLowerVariables','Action','variablesAction','destconnectedlinenum','calleridnum','user:%s','accountcode','[originated][increment]','OriginateError','syncOriginateResponse','actionid','logLookAgent','clone','responsetime','YYYY-MM-DD\x20HH:mm:ss','isFailure','response','unlockContact','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','transfer','[syncHangup][talking][transfer]','syncHangupRequest','addVariable','variables','filterKey','keys','variable','value','error','[syncVarSet][Preview]','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','bluebird','uuid','moment','md5','ioredis','../../../config/environment','../../../config/logger','preview','actionPreview','./rpcDb','redis','defaults','localhost','socket.io-emitter','prototype','enqueue','tail','sequence','campaignsPreview','voiceQueues','trunks','actions','agents','originateresponse','bind','hangup','hanguprequest','dialend','syncDialEnd','syncNewExten','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','loopCampaigns','emit','type','outbound','name','strategy','answered','pTalking','sumBillable','sumHoldTime','talking','total','unmanaged','abandoned','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','format','voice:queue:%s','voice_queue:save','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','stringify','voice_queue_channel:remove','sendMessageOneNotActive','available','paused','NOT_ACTIVE','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','IS_DISACTIVED','logger','\x20is\x20disactive','syncCampaigns','hasOwnProperty','booked','clockClearZombieChannels','clearZombieChannels','setMessage','recallMe','clearZombieChannel','isNil','[clearZombieChannels][talking]','Queue','originated:\x20','queue','pTalking:\x20','pick','contactId','UserId','VoiceQueueId','status','channel','catch','No\x20such\x20channel','[clearZombieChannel]','dialAnswer','loggerError','[Dialer][checkChannel][Preview]','size','then','length','getDiff','scheduledat','Agent','voicePause','run','logger2','[RecallMe]','disableContact','starttime','outboundReCallsDay','logCustomer','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','loggedIn','message','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','outboundNoSuchCallsDay','countglobal','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','Global','countnosuchnumberretry','[callProgressDetectingCustomer][logNoSuchGlobal]','scheduledAt','dialNoSuchNumberRetryFrequency','unlockAgent','activeContact','ANSWER','answertime','uniqueid','custom:agentconnect','connect','acw','custom:agentConnectPreview','buildAcw','complete','decrementTalkink','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','sumDuration','talktime','[syncHangup][talking][decrement]','linkedid','countbusyretry','[callProgressDetectingCustomer][logBusy]','cloneAction','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','NOANSWER','countnoanswerretry','NoAnswer','custom:agentnoanswer','noanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','rescheduleContact','dialNoAnswerRetryFrequency','CONGESTION','custom:agentcongestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','countcongestionretry','dialCongestionMaxRetry','dialBusyRetryFrequency','CANCEL','AgentReject','[callProgressDetectingCustomer][logAgentReject]','countagentrejectretry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','ABANDONED','outboundAbandonedCallsDay','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','countabandonedretry','dialAbandonedRetryFrequency','countmachineretry','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','cause-txt','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','\x20Queue','destlinkedid','callProgressDetectingAgent','isUndefined','object','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logNoAnswer]','Busy','Congestion','[callProgressDetectingAgent][logCongestion]','updateOriginated','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','checkInBlack','Contact','phone','Contact\x20is\x20undefined','lookAgent','execCall','[Preview][execCall][success]','\x20IdHopper:\x20','idContact','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','[Blacklist][error]','Contact\x20in\x20black\x20List','SIP/%s','unmonitored','execRun','unlock','getContactPreview','recallme'];(function(_0x13e374,_0x9b46da){var _0x5e5d32=function(_0x5b291e){while(--_0x5b291e){_0x13e374['push'](_0x13e374['shift']());}};_0x5e5d32(++_0x9b46da);}(_0xa82c,0x197));var _0xca82=function(_0x391a65,_0x2ac56d){_0x391a65=_0x391a65-0x0;var _0x4fa17a=_0xa82c[_0x391a65];return _0x4fa17a;};'use strict';var util=require(_0xca82('0x0'));var _=require(_0xca82('0x1'));var BPromise=require(_0xca82('0x2'));var uuid=require(_0xca82('0x3'));var moment=require(_0xca82('0x4'));var md5=require(_0xca82('0x5'));var Redis=require(_0xca82('0x6'));var config=require(_0xca82('0x7'));var logger=require(_0xca82('0x8'))(_0xca82('0x9'));var loggerAction=require(_0xca82('0x8'))(_0xca82('0xa'));var ami=require('../ami');var rpcDb=require(_0xca82('0xb'));var Action=require('./action');var ut=require('./util/util');config[_0xca82('0xc')]=_[_0xca82('0xd')](config[_0xca82('0xc')],{'host':_0xca82('0xe'),'port':0x18eb});var io=require(_0xca82('0xf'))(new Redis(config[_0xca82('0xc')]));var Sequence=function(){};Sequence[_0xca82('0x10')][_0xca82('0x11')]=function(_0x48b2ea){this['tail']=this[_0xca82('0x12')]?this[_0xca82('0x12')]['finally'](_0x48b2ea):_0x48b2ea();};function Preview(_0x557ac5){this[_0xca82('0x13')]=new Sequence();this[_0xca82('0x14')]=_0x557ac5[_0xca82('0x15')];this['trunks']=_0x557ac5[_0xca82('0x16')];this[_0xca82('0x17')]={};this['agents']=_0x557ac5[_0xca82('0x18')];this['clockClearZombieChannels']=0x0;ami['on'](_0xca82('0x19'),this['syncOriginateResponse'][_0xca82('0x1a')](this));ami['on'](_0xca82('0x1b'),this['syncHangup'][_0xca82('0x1a')](this));ami['on'](_0xca82('0x1c'),this['syncHangupRequest'][_0xca82('0x1a')](this));ami['on'](_0xca82('0x1d'),this[_0xca82('0x1e')][_0xca82('0x1a')](this));ami['on']('newexten',this[_0xca82('0x1f')][_0xca82('0x1a')](this));ami['on']('varset',this[_0xca82('0x20')][_0xca82('0x1a')](this));ami['on'](_0xca82('0x21'),this[_0xca82('0x22')][_0xca82('0x1a')](this));ami['on'](_0xca82('0x23'),this['syncBlindTransfer'][_0xca82('0x1a')](this));this[_0xca82('0x24')](this[_0xca82('0x14')]);}function emit(_0x2c398e,_0x119a06,_0x49b6a5){io['to'](_0x2c398e)[_0xca82('0x25')](_0x119a06,_0x49b6a5);}function emitCampaignPreview(_0x3c6f04){if(_0x3c6f04[_0xca82('0x26')]===_0xca82('0x27')){var _0x41efd1={'id':_0x3c6f04['id'],'name':_0x3c6f04[_0xca82('0x28')],'strategy':_0x3c6f04[_0xca82('0x29')],'answered':_0x3c6f04[_0xca82('0x2a')],'available':_0x3c6f04['available'],'loggedIn':_0x3c6f04['loggedIn'],'pTalking':_0x3c6f04[_0xca82('0x2b')],'sumBillable':_0x3c6f04[_0xca82('0x2c')],'sumDuration':_0x3c6f04['sumDuration'],'sumHoldTime':_0x3c6f04[_0xca82('0x2d')]||0x0,'talking':_0x3c6f04[_0xca82('0x2e')],'total':_0x3c6f04[_0xca82('0x2f')],'type':_0x3c6f04[_0xca82('0x26')],'unmanaged':_0x3c6f04[_0xca82('0x30')],'abandoned':_0x3c6f04[_0xca82('0x31')],'waiting':_0x3c6f04['waiting'],'loggedInDb':_0x3c6f04[_0xca82('0x32')],'dialActive':_0x3c6f04[_0xca82('0x33')],'dialMethod':_0x3c6f04[_0xca82('0x34')],'dialOriginateCallerIdName':_0x3c6f04[_0xca82('0x35')],'dialOriginateCallerIdNumber':_0x3c6f04[_0xca82('0x36')],'dialOriginateTimeout':_0x3c6f04[_0xca82('0x37')],'dialPrefix':_0x3c6f04[_0xca82('0x38')],'outboundAnswerAgiCallsDay':_0x3c6f04[_0xca82('0x39')],'outboundAnswerCallsDay':_0x3c6f04[_0xca82('0x3a')],'outboundBlacklistCallsDay':_0x3c6f04[_0xca82('0x3b')],'outboundBusyCallsDay':_0x3c6f04[_0xca82('0x3c')],'outboundCongestionCallsDay':_0x3c6f04[_0xca82('0x3d')],'outboundDropCallsDayACS':_0x3c6f04[_0xca82('0x3e')],'outboundDropCallsDayCallersExit':_0x3c6f04['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x3c6f04[_0xca82('0x3f')],'outboundNoAnswerCallsDay':_0x3c6f04[_0xca82('0x40')],'outboundNoSuchCallsDay':_0x3c6f04['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x3c6f04[_0xca82('0x41')],'outboundReCallsDay':_0x3c6f04['outboundReCallsDay'],'outboundRejectCallsDay':_0x3c6f04[_0xca82('0x42')],'outboundUnknownCallsDay':_0x3c6f04[_0xca82('0x43')],'outboundAbandonedCallsDay':_0x3c6f04['outboundAbandonedCallsDay'],'predictiveIntervalAnsweredCalls':_0x3c6f04['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x3c6f04[_0xca82('0x44')],'predictiveIntervalAvgTalktime':_0x3c6f04[_0xca82('0x45')],'predictiveIntervalDroppedCallsCallersExit':_0x3c6f04[_0xca82('0x46')],'predictiveIntervalDroppedCallsTimeout':_0x3c6f04[_0xca82('0x47')],'predictiveIntervalErlangCalls':_0x3c6f04[_0xca82('0x48')],'predictiveIntervalErlangCallsDroppedCalls':_0x3c6f04[_0xca82('0x49')],'predictiveIntervalHitRate':_0x3c6f04[_0xca82('0x4a')],'predictiveIntervalMultiplicativeFactor':_0x3c6f04[_0xca82('0x4b')],'predictiveIntervalPauses':_0x3c6f04[_0xca82('0x4c')],'predictiveIntervalAvailable':_0x3c6f04[_0xca82('0x4d')],'predictiveIntervalTotalCalls':_0x3c6f04[_0xca82('0x4e')],'message':_0x3c6f04['message'],'originated':_0x3c6f04[_0xca82('0x4f')],'erlangCalls':_0x3c6f04[_0xca82('0x50')],'erlangCallToSecond':_0x3c6f04[_0xca82('0x51')],'erlangAbandonmentRate':_0x3c6f04[_0xca82('0x52')],'erlangBusyFactor':_0x3c6f04[_0xca82('0x53')],'startPredictive':_0x3c6f04[_0xca82('0x54')],'startProgressive':_0x3c6f04[_0xca82('0x55')]};if(_0x3c6f04[_0xca82('0x56')]){_0x41efd1[_0xca82('0x56')]={'id':_0x3c6f04['Trunk']['id'],'name':_0x3c6f04[_0xca82('0x56')][_0xca82('0x28')],'active':_0x3c6f04[_0xca82('0x56')][_0xca82('0x57')],'callerid':_0x3c6f04['Trunk'][_0xca82('0x58')]};}if(_0x3c6f04[_0xca82('0x59')]){_0x41efd1['Interval']={'id':_0x3c6f04['Interval']['id'],'name':_0x3c6f04[_0xca82('0x59')][_0xca82('0x28')]};}var _0xa52b18=md5(JSON['stringify'](_0x41efd1));if(_0x3c6f04[_0xca82('0x5')]!==_0xa52b18){_0x3c6f04['md5']=_0xa52b18;emit(util[_0xca82('0x5a')](_0xca82('0x5b'),_0x41efd1[_0xca82('0x28')]),_0xca82('0x5c'),_0x41efd1);}}}function emitVoiceQueueChannelRemove(_0x39f736){logger[_0xca82('0x5d')](_0xca82('0x5e'),JSON[_0xca82('0x5f')](_0x39f736));emit(util['format']('voice:queue:%s',_0x39f736[_0xca82('0x28')]),_0xca82('0x60'),_0x39f736);io[_0xca82('0x25')]('voice_queue_presence:remove',_0x39f736);}function notSendMessagesQueue(_0x275e95){if(_0x275e95[_0xca82('0x61')]){if(_0x275e95[_0xca82('0x4f')]===0x0&&_0x275e95[_0xca82('0x2b')]===0x0){_0x275e95[_0xca82('0x61')]=![];_0x275e95[_0xca82('0x62')]=0x0;_0x275e95[_0xca82('0x63')]=0x0;_0x275e95['message']=_0xca82('0x64');ut['logger'](_0xca82('0x65'),_0x275e95[_0xca82('0x28')]+_0xca82('0x66'));}else{_0x275e95['message']=_0xca82('0x67');ut[_0xca82('0x68')](_0xca82('0x65'),_0x275e95[_0xca82('0x28')]+_0xca82('0x69'));}emitCampaignPreview(_0x275e95);}}Preview['prototype'][_0xca82('0x24')]=function(){var _0x5ecae4=this;setInterval(function(){_0x5ecae4[_0xca82('0x6a')]();},0x7cf);};Preview[_0xca82('0x10')][_0xca82('0x6a')]=function(){var _0x2108cf=this[_0xca82('0x14')];this['clockClearZombieChannels']+=0x1;for(var _0x1b356c in _0x2108cf){if(_0x2108cf[_0xca82('0x6b')](_0x1b356c)&&(_0x2108cf[_0x1b356c][_0xca82('0x34')]===_0xca82('0x9')||_0x2108cf[_0x1b356c][_0xca82('0x34')]===_0xca82('0x6c'))&&_0x2108cf[_0x1b356c]['type']===_0xca82('0x27')){if(this[_0xca82('0x6d')]>0x7){this[_0xca82('0x6d')]=0x0;this[_0xca82('0x6e')]();}}if(_0x2108cf[_0xca82('0x6b')](_0x1b356c)&&_0x2108cf[_0x1b356c][_0xca82('0x34')]===_0xca82('0x9')&&_0x2108cf[_0x1b356c][_0xca82('0x26')]==='outbound'){if(_0x2108cf[_0x1b356c][_0xca82('0x33')]){this[_0xca82('0x6f')](_0x2108cf[_0x1b356c]);this[_0xca82('0x70')](_0x2108cf[_0x1b356c]);}else{notSendMessagesQueue(_0x2108cf[_0x1b356c]);}}}};Preview[_0xca82('0x10')][_0xca82('0x71')]=function(_0x5a2736){var _0x49f0b0=this;this[_0xca82('0x13')][_0xca82('0x11')](function(){if(!_[_0xca82('0x72')](_0x49f0b0['actions'][_0x5a2736])){loggerAction[_0xca82('0x5d')](_0xca82('0x73'),_0x5a2736,_0xca82('0x74'),_0x49f0b0[_0xca82('0x17')][_0x5a2736]['queue'],_0xca82('0x75'),JSON['stringify'](_0x49f0b0['campaignsPreview'][_0x49f0b0[_0xca82('0x17')][_0x5a2736][_0xca82('0x76')]][_0xca82('0x4f')]),_0xca82('0x77'),JSON[_0xca82('0x5f')](_0x49f0b0[_0xca82('0x14')][_0x49f0b0[_0xca82('0x17')][_0x5a2736][_0xca82('0x76')]][_0xca82('0x2b')]),JSON[_0xca82('0x5f')](_0x49f0b0[_0xca82('0x17')][_0x5a2736]['dialAnswer']),JSON['stringify'](_[_0xca82('0x78')](_0x49f0b0['actions'][_0x5a2736],[_0xca82('0x79'),_0xca82('0x7a'),_0xca82('0x7b'),'ListId'])));return ami['Action']({'action':_0xca82('0x7c'),'channel':_0x49f0b0[_0xca82('0x17')][_0x5a2736][_0xca82('0x7d')]})[_0xca82('0x7e')](function(_0xb739fa){if(_0xb739fa['message']===_0xca82('0x7f')){setTimeout(function(){if(_0x49f0b0['actions'][_0x5a2736]){ut['updateOriginated'](_0x49f0b0[_0xca82('0x14')][_0x49f0b0[_0xca82('0x17')][_0x5a2736][_0xca82('0x76')]],_0xca82('0x80'));if(_0x49f0b0[_0xca82('0x17')][_0x5a2736][_0xca82('0x81')]===!![]){ut['decrementTalkink'](_0x49f0b0[_0xca82('0x14')][_0x49f0b0[_0xca82('0x17')][_0x5a2736][_0xca82('0x76')]],'[clearZombieChannel]');ut[_0xca82('0x82')]('[Dialer][checkChannel][pTalking][Preview]'+_0x5a2736,_0x49f0b0[_0xca82('0x17')][_0x5a2736][_0xca82('0x76')]);}ut[_0xca82('0x82')](_0xca82('0x83')+_0x5a2736,_0x49f0b0[_0xca82('0x17')][_0x5a2736][_0xca82('0x76')]);delete _0x49f0b0['actions'][_0x5a2736];}},0x2328);}});}});};Preview['prototype'][_0xca82('0x6e')]=function(){var _0x2c5559=this;loggerAction[_0xca82('0x5d')]('[action]',_[_0xca82('0x84')](this[_0xca82('0x17')]));for(var _0x424d1b in this[_0xca82('0x17')]){if(_0x2c5559[_0xca82('0x17')]['hasOwnProperty'](_0x424d1b)){_0x2c5559['clearZombieChannel'](_0x424d1b);}}};Preview[_0xca82('0x10')][_0xca82('0x70')]=function(_0x196f94){var _0x2d9690=this;rpcDb['getContactRecallMe'](_0x196f94['id'],ut['agentReadyId'](this[_0xca82('0x18')]))[_0xca82('0x85')](function(_0x2f2eca){if(!_['isNil'](_0x2f2eca)){for(var _0x142af=0x0;_0x142af<_0x2f2eca[_0xca82('0x86')];_0x142af+=0x1){if(ut[_0xca82('0x87')](_0x2f2eca[_0x142af][_0xca82('0x88')])<_0x196f94['dialRecallMeTimeout']*0x3c){if(_0x2f2eca[_0x142af]['Agent']&&!_0x2f2eca[_0x142af][_0xca82('0x89')][_0xca82('0x8a')]){_0x2d9690[_0xca82('0x8b')](_0x2f2eca[_0x142af]['id'])[_0xca82('0x85')](ut['logger2']('[RecallMe]'))[_0xca82('0x7e')](ut[_0xca82('0x8c')](_0xca82('0x8d')));}else{rpcDb[_0xca82('0x8e')](_0x2f2eca[_0x142af]['id']);}}else{var _0x13ac31=new Action(_0x2f2eca[_0x142af],_0x196f94);_0x13ac31[_0xca82('0x8f')]=moment()[_0xca82('0x5a')]('YYYY-MM-DD\x20HH:mm:ss');_0x196f94[_0xca82('0x90')]+=0x1;ut[_0xca82('0x91')](_0x13ac31,0x17,'RecallInQueue');if(_0x196f94[_0xca82('0x92')]){rpcDb[_0xca82('0x93')](ut[_0xca82('0x94')](_0x2f2eca[_0x142af]));rpcDb[_0xca82('0x95')](_0x13ac31,_0xca82('0x96'));}else{ut['logCustomer'](_0x13ac31,0x16,_0xca82('0x97'));rpcDb[_0xca82('0x95')](_0x13ac31,_0xca82('0x98'));rpcDb[_0xca82('0x99')](_0x13ac31,'[HistoryRecallClose]');}}}}})[_0xca82('0x7e')](ut[_0xca82('0x8c')](_0xca82('0x9a')));};Preview[_0xca82('0x10')]['setMessage']=function(_0x531e18){_0x531e18[_0xca82('0x61')]=!![];if(ut['IsNotLoggedIn'](_0x531e18[_0xca82('0x9b')])){_0x531e18[_0xca82('0x9c')]='AGENTS_NOT_LOGGED';}else if(!ut['isActive'](_0x531e18[_0xca82('0x33')])){_0x531e18[_0xca82('0x9c')]=_0xca82('0x64');}else if(!this[_0xca82('0x9d')](_0x531e18[_0xca82('0x56')])){if(!this[_0xca82('0x9d')](_0x531e18[_0xca82('0x9e')])){_0x531e18[_0xca82('0x9c')]=_0xca82('0x9f');}else{_0x531e18[_0xca82('0x9c')]=_0xca82('0xa0');}}else{_0x531e18[_0xca82('0x9c')]=_0xca82('0xa0');}emitCampaignPreview(_0x531e18);};Preview[_0xca82('0x10')][_0xca82('0xa1')]=function(_0x50827b,_0x429d23,_0x5ec40d){var _0x4fbec1=this;var _0x40f077=this['actions'][_0x429d23];var _0x30fa2f=this[_0xca82('0x14')][_0x40f077[_0xca82('0x76')]];var _0x278e8c;if(_0x30fa2f){switch(_0x5ec40d){case'1':_0x30fa2f[_0xca82('0xa2')]+=0x1;_0x40f077['countnosuchnumberretry']+=0x1;_0x40f077[_0xca82('0xa3')]=ut[_0xca82('0xa4')](_0x40f077);ut[_0xca82('0x91')](_0x40f077,0x0,_0xca82('0xa5'));ami[_0xca82('0x25')](_0xca82('0xa6'),ut[_0xca82('0xa7')](_0x40f077,_0xca82('0xa8')));rpcDb[_0xca82('0x95')](_0x40f077,_0xca82('0xa9'));if(ut[_0xca82('0xa4')](_0x40f077)>=_0x30fa2f[_0xca82('0xaa')]){_0x278e8c=ut['cloneAction'](_0x40f077,0xf,_0xca82('0xab'));rpcDb[_0xca82('0x99')](_0x278e8c,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x40f077[_0xca82('0xac')]>=_0x30fa2f['dialNoSuchNumberMaxRetry']){rpcDb['createCustomerFinal'](_0x40f077,_0xca82('0xad'));}else{rpcDb['rescheduleContact'](ut[_0xca82('0xae')](_0x40f077,'countnosuchnumberretry',_0x30fa2f[_0xca82('0xaf')]),_0x40f077[_0xca82('0xb0')],_0x40f077[_0xca82('0xb1')]);}}delete this['actions'][_0x50827b['linkedid']];break;case _0xca82('0xb2'):var _0x88d8d1=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x40f077['responsetime']=_0x88d8d1;_0x40f077[_0xca82('0xb3')]=_0x88d8d1;_0x40f077[_0xca82('0x81')]=!![];_0x30fa2f[_0xca82('0x2b')]+=0x1;logger[_0xca82('0x5d')]('[syncHangup][talking][increment]',_0x40f077[_0xca82('0xb4')],'\x20Queue',_0x30fa2f[_0xca82('0x28')],'pTalking:\x20',_0x30fa2f['pTalking']);ami[_0xca82('0x25')](_0xca82('0xb5'),ut[_0xca82('0xa7')](_0x40f077,_0xca82('0xb6'),this['campaignsPreview'][_0x40f077[_0xca82('0x76')]]));if(_0x30fa2f[_0xca82('0xb7')]){ami['emit'](_0xca82('0xb8'),ut[_0xca82('0xb9')](_0x40f077));}break;case'16':ami[_0xca82('0x25')]('custom:agentcomplete',ut[_0xca82('0xa7')](_0x40f077,_0xca82('0xba'),this[_0xca82('0x14')][_0x40f077[_0xca82('0x76')]]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x40f077,'complete'));_0x30fa2f[_0xca82('0x3a')]+=0x1;_0x30fa2f[_0xca82('0x2f')]+=0x1;_0x30fa2f[_0xca82('0x2a')]+=0x1;ut[_0xca82('0xbb')](_0x30fa2f,_0xca82('0xbc'));_0x40f077[_0xca82('0xa3')]=ut['totalGlobal'](_0x40f077);ut['logCustomer'](_0x40f077,0x4,_0xca82('0xbd'));rpcDb[_0xca82('0x95')](_0x40f077,_0xca82('0xbe'));rpcDb[_0xca82('0x99')](_0x40f077,'[callProgressDetectingCustomer][logAnswerGlobal]');rpcDb['crateCustomerReportQueue'](_0x40f077);_0x30fa2f[_0xca82('0xbf')]+=_0x40f077[_0xca82('0xc0')];_0x30fa2f['sumBillable']+=_0x40f077['talktime'];logger[_0xca82('0x5d')](_0xca82('0xc1'),_0x40f077[_0xca82('0xb4')],'\x20Queue',_0x30fa2f[_0xca82('0x28')],'pTalking:\x20',_0x30fa2f[_0xca82('0x2b')]);delete this['actions'][_0x50827b[_0xca82('0xc2')]];break;case'BUSY':_0x30fa2f[_0xca82('0x3c')]+=0x1;_0x40f077[_0xca82('0xc3')]+=0x1;_0x40f077[_0xca82('0xa3')]=ut[_0xca82('0xa4')](_0x40f077);ut[_0xca82('0x91')](_0x40f077,0x5,'Busy');ami[_0xca82('0x25')]('custom:agentbusy',ut['buildObj'](_0x40f077,'busy'));rpcDb[_0xca82('0x95')](_0x40f077,_0xca82('0xc4'));if(ut[_0xca82('0xa4')](_0x40f077)>=_0x30fa2f[_0xca82('0xaa')]){_0x278e8c=ut[_0xca82('0xc5')](_0x40f077,0xf,_0xca82('0xab'));rpcDb[_0xca82('0x99')](_0x278e8c,_0xca82('0xc6'));}else{if(_0x40f077[_0xca82('0xc3')]>=_0x30fa2f[_0xca82('0xc7')]){rpcDb['createCustomerFinal'](_0x40f077,'[callProgressDetectingCustomer][logBusy]');}else{rpcDb['rescheduleContact'](ut[_0xca82('0xae')](_0x40f077,_0xca82('0xc3'),_0x30fa2f['dialBusyRetryFrequency']),_0x40f077['unlockAgent'],_0x40f077[_0xca82('0xb1')]);}}break;case _0xca82('0xc8'):_0x30fa2f[_0xca82('0x40')]+=0x1;_0x40f077[_0xca82('0xc9')]+=0x1;_0x40f077[_0xca82('0xa3')]=ut['totalGlobal'](_0x40f077);ut[_0xca82('0x91')](_0x40f077,0x3,_0xca82('0xca'));ami[_0xca82('0x25')](_0xca82('0xcb'),ut[_0xca82('0xa7')](_0x40f077,_0xca82('0xcc')));rpcDb[_0xca82('0x95')](_0x40f077,_0xca82('0xcd'));if(ut['totalGlobal'](_0x40f077)>=_0x30fa2f['dialGlobalMaxRetry']){_0x278e8c=ut['cloneAction'](_0x40f077,0xf,_0xca82('0xab'));rpcDb[_0xca82('0x99')](_0x278e8c,_0xca82('0xce'));}else{if(_0x40f077['countnoanswerretry']>=_0x30fa2f[_0xca82('0xcf')]){rpcDb[_0xca82('0x99')](_0x40f077,_0xca82('0xcd'));}else{rpcDb[_0xca82('0xd0')](ut[_0xca82('0xae')](_0x40f077,_0xca82('0xc9'),_0x30fa2f[_0xca82('0xd1')]),_0x40f077['unlockAgent'],_0x40f077[_0xca82('0xb1')]);}}break;case _0xca82('0xd2'):_0x30fa2f['outboundCongestionCallsDay']+=0x1;_0x40f077['countcongestionretry']+=0x1;_0x40f077[_0xca82('0xa3')]=ut['totalGlobal'](_0x40f077);ut['logCustomer'](_0x40f077,0x8,'Congestion');ami['emit'](_0xca82('0xd3'),ut[_0xca82('0xa7')](_0x40f077,'congestion'));rpcDb['createCustomerHistory'](_0x40f077,_0xca82('0xd4'));if(ut[_0xca82('0xa4')](_0x40f077)>=_0x30fa2f[_0xca82('0xaa')]){_0x278e8c=ut[_0xca82('0xc5')](_0x40f077,0xf,'Global');rpcDb[_0xca82('0x99')](_0x278e8c,_0xca82('0xd5'));}else{if(_0x40f077[_0xca82('0xd6')]>=_0x30fa2f[_0xca82('0xd7')]){rpcDb['createCustomerFinal'](_0x40f077,_0xca82('0xd4'));}else{rpcDb['rescheduleContact'](ut[_0xca82('0xae')](_0x40f077,_0xca82('0xd6'),_0x30fa2f[_0xca82('0xd8')]),_0x40f077['unlockAgent'],_0x40f077['activeContact']);}}break;case _0xca82('0xd9'):_0x30fa2f[_0xca82('0x42')]+=0x1;_0x40f077['countagentrejectretry']+=0x1;_0x40f077['countglobal']=ut[_0xca82('0xa4')](_0x40f077);ut[_0xca82('0x91')](_0x40f077,0x14,_0xca82('0xda'));ami['emit']('custom:agentreject',ut[_0xca82('0xa7')](_0x40f077,'agentreject'));rpcDb[_0xca82('0x95')](_0x40f077,'[syncHangupRequest][logAgentReject]');if(ut['totalGlobal'](_0x40f077)>=_0x30fa2f['dialGlobalMaxRetry']){_0x278e8c=ut['cloneAction'](_0x40f077,0x14,'AgentReject');rpcDb[_0xca82('0x99')](_0x278e8c,_0xca82('0xdb'));}else{if(_0x40f077[_0xca82('0xdc')]>=_0x30fa2f[_0xca82('0xdd')]){rpcDb[_0xca82('0x99')](_0x40f077,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb['rescheduleContact'](ut[_0xca82('0xae')](_0x40f077,'countagentrejectretry',_0x30fa2f[_0xca82('0xde')]),_0x40f077[_0xca82('0xb0')],_0x40f077[_0xca82('0xb1')]);}}break;case _0xca82('0xdf'):_0x30fa2f[_0xca82('0xe0')]+=0x1;_0x40f077['countabandonedretry']+=0x1;_0x40f077[_0xca82('0xa3')]=ut[_0xca82('0xa4')](_0x40f077);ut[_0xca82('0x91')](_0x40f077,0xb,_0xca82('0xe1'));rpcDb[_0xca82('0x95')](_0x40f077,'[callProgressDetectingCustomer][logAbandoned]');if(ut['totalGlobal'](_0x40f077)>=_0x30fa2f[_0xca82('0xaa')]){_0x278e8c=ut[_0xca82('0xc5')](_0x40f077,0xf,'Global');rpcDb[_0xca82('0x99')](_0x278e8c,_0xca82('0xe2'));}else{if(_0x40f077[_0xca82('0xe3')]>=_0x30fa2f[_0xca82('0xe4')]){rpcDb[_0xca82('0x99')](_0x40f077,_0xca82('0xe2'));}else{rpcDb['rescheduleContact'](ut[_0xca82('0xae')](_0x40f077,_0xca82('0xe5'),_0x30fa2f[_0xca82('0xe6')]),_0x40f077[_0xca82('0xb0')],_0x40f077[_0xca82('0xb1')]);}}break;case'18':_0x30fa2f[_0xca82('0x43')]+=0x1;_0x40f077[_0xca82('0xe7')]+=0x1;_0x40f077[_0xca82('0xa3')]=ut['totalGlobal'](_0x40f077);ut[_0xca82('0x91')](_0x40f077,0x12,_0x50827b['cause-txt']||_0x50827b[_0xca82('0xe8')]);ami[_0xca82('0x25')](_0xca82('0xe9'),ut[_0xca82('0xa7')](_0x40f077,_0xca82('0xea')));rpcDb[_0xca82('0x95')](_0x40f077,_0xca82('0xeb'));if(ut[_0xca82('0xa4')](_0x40f077)>=_0x30fa2f[_0xca82('0xaa')]){_0x278e8c=ut[_0xca82('0xc5')](_0x40f077,0xf,'Global');rpcDb[_0xca82('0x99')](_0x278e8c,_0xca82('0xeb'));}else{rpcDb['createCustomerFinal'](_0x40f077,'[callProgressDetectingCustomer][hangupInAMD]');}delete this[_0xca82('0x17')][_0x50827b[_0xca82('0xc2')]];break;case'19':_0x30fa2f['outboundUnknownCallsDay']+=0x1;_0x40f077['countglobal']=ut[_0xca82('0xa4')](_0x40f077);ut[_0xca82('0x91')](_0x40f077,0x13,_0x50827b[_0xca82('0xec')]||_0x50827b[_0xca82('0xe8')]);ami[_0xca82('0x25')]('custom:amd',ut['buildObj'](_0x40f077,_0xca82('0xea')));rpcDb[_0xca82('0x95')](_0x40f077,'[callProgressDetectingCustomer][machine]');if(ut[_0xca82('0xa4')](_0x40f077)>=_0x30fa2f['dialGlobalMaxRetry']){_0x278e8c=ut[_0xca82('0xc5')](_0x40f077,0xf,'Global');rpcDb[_0xca82('0x99')](_0x278e8c,'[callProgressDetectingCustomer][machine]');}else{rpcDb[_0xca82('0x99')](_0x40f077,_0xca82('0xed'));}delete this['actions'][_0x50827b[_0xca82('0xc2')]];break;default:if(_0x40f077[_0xca82('0x81')]){ut[_0xca82('0xbb')](_0x30fa2f,_0xca82('0xee'));ut['loggerError'](_0xca82('0xef')+_0x30fa2f[_0xca82('0x28')],_0x50827b);}_0x30fa2f[_0xca82('0x43')]+=0x1;_0x40f077[_0xca82('0xa3')]=ut[_0xca82('0xa4')](_0x40f077);ut[_0xca82('0x91')](_0x40f077,0xc,_0x50827b[_0xca82('0xec')]||_0x50827b['dialstatus']);rpcDb['createCustomerHistory'](_0x40f077,_0xca82('0xf0'));if(ut[_0xca82('0xa4')](_0x40f077)>=_0x30fa2f[_0xca82('0xaa')]){_0x278e8c=ut['cloneAction'](_0x40f077,0xf,_0xca82('0xab'));rpcDb['createCustomerFinal'](_0x278e8c,_0xca82('0xf1'));}else{rpcDb[_0xca82('0x99')](_0x40f077,_0xca82('0xf1'));}delete this[_0xca82('0x17')][_0x50827b[_0xca82('0xc2')]];}if(!(_0x40f077[_0xca82('0x81')]&&_0x5ec40d==='16')){ut['updateOriginated'](_0x30fa2f,_0xca82('0xf2'));logger[_0xca82('0x5d')](_0xca82('0xf3'),_0x40f077[_0xca82('0xb4')],_0xca82('0xf4'),_0x30fa2f[_0xca82('0x28')],'originated:\x20',_0x30fa2f[_0xca82('0x4f')]);}if(_0x5ec40d!==_0xca82('0xb2')){delete this[_0xca82('0x17')][_0x50827b[_0xca82('0xc2')]];delete this[_0xca82('0x17')][_0x50827b[_0xca82('0xf5')]];}}};Preview[_0xca82('0x10')][_0xca82('0xf6')]=function(_0x2ac06b,_0x1090f5,_0x1f1def){if(_[_0xca82('0xf7')](_0x1090f5)&&'object'!==typeof _0x1090f5){return;}if(_[_0xca82('0xf7')](_0x1f1def)&&_0xca82('0xf8')!==typeof _0x1f1def){return;}switch(_0x1f1def[_0xca82('0xf9')]){case'0':ut[_0xca82('0xfa')](_0x2ac06b,0x0,_0xca82('0xa5'));rpcDb[_0xca82('0xfb')](_0x2ac06b,_0xca82('0xfc'));break;case'3':ut[_0xca82('0xfa')](_0x2ac06b,0x3,_0xca82('0xca'));rpcDb[_0xca82('0xfb')](_0x2ac06b,_0xca82('0xfd'));break;case'5':ut['logAgent'](_0x2ac06b,0x5,_0xca82('0xfe'));rpcDb[_0xca82('0xfb')](_0x2ac06b,'[callProgressDetectingAgent][logBusy]');break;case'8':ut['logAgent'](_0x2ac06b,0x8,_0xca82('0xff'));rpcDb[_0xca82('0xfb')](_0x2ac06b,_0xca82('0x100'));break;case'22':ut[_0xca82('0xfa')](_0x2ac06b,0x16,'AnswerAGI');rpcDb['createAgentHistory'](_0x2ac06b,'[callProgressDetectingAgent][logAnswerAGI]');break;default:ut[_0xca82('0xfa')](_0x2ac06b,0xc,_0x1f1def[_0xca82('0xf9')]);rpcDb['createAgentHistory'](_0x2ac06b,'[callProgressDetectingAgent][logCongestion]');}ut[_0xca82('0x101')](_0x1090f5,_0xca82('0x102'));logger[_0xca82('0x5d')](_0xca82('0x103'),_0x2ac06b[_0xca82('0xb4')],_0xca82('0xf4'),_0x1090f5[_0xca82('0x28')],_0xca82('0x75'),_0x1090f5[_0xca82('0x4f')]);delete this[_0xca82('0x17')][_0x2ac06b[_0xca82('0xb4')]];};Preview['prototype'][_0xca82('0x104')]=function(_0x24e2a9,_0x337e02,_0x74b42d,_0x361f9d,_0x537096){var _0x2d4047=this;return new BPromise(function(_0x410d7a,_0x4dc6ca){if(_[_0xca82('0x72')](_0x337e02)||_[_0xca82('0x72')](_0x337e02[_0xca82('0x105')])||_['isNil'](_0x337e02[_0xca82('0x105')][_0xca82('0x106')])||_[_0xca82('0x72')](_0x337e02[_0xca82('0x7b')])){_0x4dc6ca(ut['message'](_0xca82('0x107'),_0x361f9d,_0x537096));return;}var _0x2b2750=uuid['v4']();var _0x40c77d=_0x2d4047[_0xca82('0x14')][_0x337e02[_0xca82('0x74')][_0xca82('0x28')]];var _0x3a1849=_0x74b42d?_0x2d4047[_0xca82('0x18')][_0x74b42d]['id']:undefined;_0x2d4047[_0xca82('0x17')][_0x2b2750]=new Action(_0x337e02,_0x40c77d,_0x2b2750,_0x74b42d,_0x3a1849);var _0xf64fe4=_0x2d4047[_0xca82('0x17')][_0x2b2750];_0xf64fe4[_0xca82('0xb0')]=_0x361f9d;_0xf64fe4[_0xca82('0xb1')]=_0x537096;_0xf64fe4[_0xca82('0x108')]=_0x74b42d;if(_['isEmpty'](_0x24e2a9)){_0x2d4047[_0xca82('0x109')](_0xf64fe4,_0x40c77d,_0x337e02,_0x74b42d)['then'](function(_0xe7650c){logger['info'](_0xca82('0x10a'),'Queue:\x20'+_0xf64fe4[_0xca82('0x76')]+_0xca82('0x10b')+_0xf64fe4[_0xca82('0x10c')],JSON[_0xca82('0x5f')](_0xe7650c));ami['emit'](_0xca82('0x10d'),ut[_0xca82('0xa7')](_0xf64fe4,_0xca82('0x10e'),_0x2d4047[_0xca82('0x14')][_0xf64fe4[_0xca82('0x76')]]));_0x410d7a(ut['message'](_0xca82('0x10f')));})['catch'](function(_0x204392){ut[_0xca82('0x68')](_0xca82('0x110'),_0x204392);_0x4dc6ca(ut['message'](_0xca82('0x111'),_0x361f9d,_0x537096));});}else{_0x40c77d[_0xca82('0x3b')]+=0x1;ut[_0xca82('0x112')](_0xf64fe4);rpcDb['createHistory'](_0xf64fe4,_0xca82('0x113'));delete _0x2d4047['actions'][_0x2b2750];_0x4dc6ca(ut[_0xca82('0x9c')](_0xca82('0x114'),_0x361f9d,_0x537096));}});};Preview['prototype'][_0xca82('0x9d')]=function(_0x18b871){return!_[_0xca82('0x72')](_0x18b871)&&!_['isNil'](_0x18b871[_0xca82('0x28')])&&!_[_0xca82('0x72')](_0x18b871[_0xca82('0x57')])&&_0x18b871['active']&&!_[_0xca82('0x72')](this[_0xca82('0x16')][util['format']('SIP/%s',_0x18b871[_0xca82('0x28')])])&&!_[_0xca82('0x72')](this['trunks'][util[_0xca82('0x5a')](_0xca82('0x115'),_0x18b871[_0xca82('0x28')])][_0xca82('0x7c')])&&(this[_0xca82('0x16')][util[_0xca82('0x5a')](_0xca82('0x115'),_0x18b871[_0xca82('0x28')])]['status']==='reachable'||this[_0xca82('0x16')][util[_0xca82('0x5a')](_0xca82('0x115'),_0x18b871['name'])][_0xca82('0x7c')]===_0xca82('0x116'));};Preview[_0xca82('0x10')][_0xca82('0x8b')]=function(_0x172388,_0x4b373d){var _0x104b74=this;return new BPromise(function(_0x109769,_0x49c755){_0x104b74[_0xca82('0x117')](_0x172388,_0x4b373d)[_0xca82('0x85')](function(_0x19dff7){_0x109769(_[_0xca82('0x78')](_0x19dff7,['message']));})[_0xca82('0x7e')](function(_0x2bf1cb){if(_0x2bf1cb[_0xca82('0x118')]){rpcDb['unlockContact'](_0x172388);}if(_0x2bf1cb['active']){rpcDb[_0xca82('0x8e')](_0x172388);}_0x49c755(_[_0xca82('0x78')](_0x2bf1cb,[_0xca82('0x9c')]));});});};Preview[_0xca82('0x10')][_0xca82('0x117')]=function(_0x25739a,_0x4adfde){var _0x724f11=this;return new BPromise(function(_0x19b54a,_0x1e91cc){var _0x110a19,_0x1a29f2;rpcDb[_0xca82('0x119')](_0x25739a)[_0xca82('0x85')](function(_0x330f8e){if(!_['isNil'](_0x330f8e[0x0])){_0x1a29f2=_0x330f8e[0x0][_0xca82('0x11a')]?![]:!![];_0x110a19=_0x330f8e[0x0][_0xca82('0x11a')]?!![]:![];_0x110a19=_0x4adfde?!![]:_0x110a19;}var _0x54d86e=_0x724f11[_0xca82('0x11b')](_0x330f8e);if(_0x54d86e['isValid']){rpcDb['checkIsBlackList'](_[_0xca82('0x78')](_0x330f8e[0x0],[_0xca82('0x7b'),'Contact.phone']))['then'](function(_0x2ea06f){_0x724f11['checkInBlack'](_0x2ea06f,_0x330f8e[0x0],_0x4adfde,_0x1a29f2,_0x110a19)[_0xca82('0x85')](function(_0x512613){_0x19b54a(_0x512613);})[_0xca82('0x7e')](function(_0x94dd1b){_0x1e91cc(_0x94dd1b);});})[_0xca82('0x7e')](function(_0x349031){ut[_0xca82('0x68')]('[Preview][checkIsBlackList]',_0x349031);_0x1e91cc(ut[_0xca82('0x9c')]('Call\x20unsuccessful',_0x1a29f2,_0x110a19));});}else{_0x1e91cc(ut['message'](_0x54d86e['message'],_0x1a29f2,_0x110a19));}})['catch'](function(_0x1a8bb6){ut[_0xca82('0x68')](_0xca82('0x11c'),_0x1a8bb6);_0x1e91cc(ut[_0xca82('0x9c')]('Call\x20unsuccessful',![],!![]));});});};Preview[_0xca82('0x10')]['validateContact']=function(_0x4baeb4){if(_[_0xca82('0x72')](_0x4baeb4)||_[_0xca82('0x11d')](_0x4baeb4)||!_[_0xca82('0x72')](_0x4baeb4[0x0]['Agent'])&&_['isNil'](_0x4baeb4[0x0]['Agent'][_0xca82('0x28')])){ut[_0xca82('0x68')](_0xca82('0x11e'),_0x4baeb4);return{'isValid':![],'message':_0xca82('0x11f')};}var _0xa0d1b=this[_0xca82('0x14')][_0x4baeb4[0x0][_0xca82('0x74')][_0xca82('0x28')]];_0xa0d1b[_0xca82('0x9c')]=_0xca82('0xa0');if(_[_0xca82('0x72')](_0xa0d1b)){ut[_0xca82('0x68')](_0xca82('0x120'),_0xa0d1b);return{'isValid':![],'message':_0xca82('0x121')};}if(!this[_0xca82('0x9d')](_0xa0d1b['Trunk'])){ut[_0xca82('0x68')](_0xca82('0x122'),'campaign\x20Name:\x20'+_0xa0d1b[_0xca82('0x28')]+_0xca82('0x123'));if(!this[_0xca82('0x9d')](_0xa0d1b['TrunkBackup'])){ut[_0xca82('0x68')]('[Preview][validateContact][Trunk\x20not\x20work]',_0xa0d1b[_0xca82('0x28')]+'\x20Trunk\x20Backup\x20is\x20not\x20active');return{'isValid':![],'message':'Trunk\x20not\x20work'};}}if(!ut[_0xca82('0x124')](_0xa0d1b[_0xca82('0x33')])){ut[_0xca82('0x68')]('[Preview][validateContact][Campaign\x20Active]',_0xa0d1b['name']+_0xca82('0x125'));return{'isValid':![],'message':_0xca82('0x126')+_0xa0d1b['name']+'\x20Not\x20Active'};}return{'isValid':!![],'message':_0xca82('0x127')};};Preview[_0xca82('0x10')]['execCall']=function(_0x3246a0,_0x45dcc1,_0x130f07,_0xc5c097){var _0x3af6d6=this;return new BPromise(function(_0x454647,_0x1d1028){var _0x13c934=_0x3246a0[_0xca82('0xb4')];var _0x542d90=_0x3af6d6[_0xca82('0x9d')](_0x45dcc1['Trunk'])?util[_0xca82('0x5a')]('SIP/%s/%s%s',_0x45dcc1['Trunk'][_0xca82('0x28')],_[_0xca82('0x72')](_0x45dcc1[_0xca82('0x38')])?'':_0x45dcc1['dialPrefix'][_0xca82('0x128')]()||'',_0x45dcc1[_0xca82('0x129')]>0x0?_0x130f07[_0xca82('0x105')]['phone'][_0xca82('0x12a')](_0x45dcc1['dialCutDigit']):_0x130f07['Contact'][_0xca82('0x106')]):util['format'](_0xca82('0x12b'),_[_0xca82('0x72')](_0x45dcc1['TrunkBackup'])?_0x45dcc1[_0xca82('0x56')][_0xca82('0x28')]:_0x45dcc1[_0xca82('0x9e')]['name'],_['isNil'](_0x45dcc1['dialPrefix'])?'':_0x45dcc1[_0xca82('0x38')][_0xca82('0x128')]()||'',_0x45dcc1[_0xca82('0x129')]>0x0?_0x130f07['Contact'][_0xca82('0x106')]['substring'](_0x45dcc1[_0xca82('0x129')]):_0x130f07['Contact'][_0xca82('0x106')]);var _0x44a673=_0x3af6d6[_0xca82('0x9d')](_0x45dcc1[_0xca82('0x56')])?ut[_0xca82('0x12c')](_0x45dcc1[_0xca82('0x56')][_0xca82('0x58')],_0x45dcc1['dialOriginateCallerIdName'],_0x45dcc1['dialRandomLastDigitCallerIdNumber']>0x0?ut['getCallerIdRandom'](_0x45dcc1[_0xca82('0x36')],_0x45dcc1['dialRandomLastDigitCallerIdNumber']):_0x45dcc1['dialOriginateCallerIdNumber']):ut[_0xca82('0x12c')](_[_0xca82('0x72')](_0x45dcc1['TrunkBackup'])?_0x45dcc1[_0xca82('0x56')][_0xca82('0x58')]:_0x45dcc1['TrunkBackup'][_0xca82('0x58')],_0x45dcc1[_0xca82('0x35')],_0x45dcc1[_0xca82('0x12d')]>0x0?ut[_0xca82('0x12e')](_0x45dcc1[_0xca82('0x36')],_0x45dcc1['dialRandomLastDigitCallerIdNumber']):_0x45dcc1[_0xca82('0x36')]);if(_0x44a673){_0x3246a0[_0xca82('0x12f')]=ut['extractCalleridName'](_0x44a673);_0x3246a0[_0xca82('0x130')]=ut['extractCalleridNumber'](_0x44a673);}var _0x3b6da1=ut[_0xca82('0x131')](_0x45dcc1,_0x130f07,_0x542d90,_0x44a673,_0x13c934,_0x3246a0);_[_0xca82('0x132')](_0x3246a0,ut[_0xca82('0x133')](_0x3b6da1));_0x3246a0[_0xca82('0x8f')]=moment()[_0xca82('0x5a')]('YYYY-MM-DD\x20HH:mm:ss');ami[_0xca82('0x134')](ut[_0xca82('0x135')](_0x3246a0,_0x45dcc1,_0x3b6da1,_0x3246a0[_0xca82('0xb1')],_0xc5c097))[_0xca82('0x85')](function(_0x3eb45a){var _0x9aa1b9=_0x3246a0['channelAgent'];if(!_[_0xca82('0x72')](_0x9aa1b9)){if(!_[_0xca82('0x72')](_0x3af6d6[_0xca82('0x18')][_0x9aa1b9])){_0x3af6d6[_0xca82('0x18')][_0x9aa1b9][_0xca82('0x136')]=_0x3246a0[_0xca82('0x137')];emit(util['format'](_0xca82('0x138'),_0x3af6d6[_0xca82('0x18')][_0x9aa1b9][_0xca82('0x28')]),'user:agentconnect',{'destaccountcode':_0x3af6d6[_0xca82('0x18')][_0x9aa1b9][_0xca82('0x139')],'destconnectedlinenum':_0x3246a0['calleridnum']});}}_0x45dcc1[_0xca82('0x4f')]+=0x1;logger['info'](_0xca82('0x13a'),_0x13c934,'\x20Queue',_0x45dcc1[_0xca82('0x28')],_0xca82('0x75'),_0x45dcc1[_0xca82('0x4f')]);_0x454647(_0x3eb45a);})[_0xca82('0x7e')](function(_0x543f52){ut[_0xca82('0xfa')](_0x3246a0,0xe,_0xca82('0x13b'));rpcDb[_0xca82('0xfb')](_0x3246a0,'[originateFailure][logOriginateFailure]');_0x1d1028(_0x543f52);});});};Preview['prototype'][_0xca82('0x1f')]=function(_0x2b0e30){if(this[_0xca82('0x17')][_0x2b0e30[_0xca82('0xc2')]]){this[_0xca82('0x17')][_0x2b0e30[_0xca82('0xc2')]][_0xca82('0x7d')]=_0x2b0e30[_0xca82('0x7d')];}};Preview['prototype'][_0xca82('0x13c')]=function(_0x50a0b5){var _0x22fa29=this;var _0x3eefe1=this['actions'][_0x50a0b5[_0xca82('0x13d')]];if(_0x3eefe1){if(_0x3eefe1['lookAgent']&&this[_0xca82('0x18')][_0x3eefe1[_0xca82('0x108')]]){ut[_0xca82('0x13e')](_0x3eefe1,this['agents'][_0x3eefe1[_0xca82('0x108')]][_0xca82('0x28')],this[_0xca82('0x18')][_0x3eefe1[_0xca82('0x108')]]['id']);}var _0x17ad07=_[_0xca82('0x13f')](_0x3eefe1);_0x17ad07[_0xca82('0x140')]=moment()[_0xca82('0x5a')](_0xca82('0x141'));var _0x22fad6=_0x22fa29['campaignsPreview'][_0x3eefe1[_0xca82('0x76')]];if(ut[_0xca82('0x142')](_0x50a0b5[_0xca82('0x143')])){if(_0x3eefe1[_0xca82('0xb0')]){rpcDb[_0xca82('0x144')](_0x3eefe1[_0xca82('0x10c')]);}if(_0x3eefe1['activeContact']){rpcDb[_0xca82('0x8e')](_0x3eefe1[_0xca82('0x10c')]);}ami[_0xca82('0x25')]('custom:agentringnoanswer',ut[_0xca82('0xa7')](_0x3eefe1,'rejected',this[_0xca82('0x14')][_0x3eefe1[_0xca82('0x76')]]));this[_0xca82('0xf6')](_0x17ad07,_0x22fad6,_0x50a0b5);}else{_0x3eefe1['starttime']=moment()[_0xca82('0x5a')](_0xca82('0x141'));ut['logAgent'](_0x17ad07,0x4,_0xca82('0xbd'));rpcDb['createAgentHistory'](_0x17ad07,_0xca82('0x145'));}}};Preview['prototype']['syncHangup']=function(_0x42981c){var _0x3ce15e=this;var _0x4c6cee=this[_0xca82('0x17')][_0x42981c[_0xca82('0xc2')]];var _0x1feb69;if(_0x4c6cee){_0x1feb69=this[_0xca82('0x14')][_0x4c6cee[_0xca82('0x76')]];logger[_0xca82('0x5d')](_0xca82('0x146'),_0x42981c[_0xca82('0xc2')],_0xca82('0xf4'),_0x1feb69[_0xca82('0x28')],_0xca82('0x77'),_0x1feb69[_0xca82('0x2b')]);}if(this['actions'][_0x42981c[_0xca82('0xc2')]]&&_0x42981c[_0xca82('0xc2')]!==_0x42981c[_0xca82('0xb4')]){if(_0x42981c[_0xca82('0x147')]==='16'&&this['actions'][_0x42981c['linkedid']][_0xca82('0x81')]){this['callProgressDetectingCustomer'](_0x42981c,_0x42981c[_0xca82('0xc2')],_0x42981c[_0xca82('0x147')]);}else if(this[_0xca82('0x17')][_0x42981c['linkedid']]['dialAnswer']){logger[_0xca82('0x5d')](_0xca82('0x148'),_0x42981c[_0xca82('0xc2')],_0x42981c['cause'],_0xca82('0xf4'),_0x1feb69[_0xca82('0x28')],_0xca82('0x77'),_0x1feb69[_0xca82('0x2b')]);this[_0xca82('0xa1')](_0x42981c,_0x42981c[_0xca82('0xc2')],_0x42981c[_0xca82('0x147')]);}}else if(_0x4c6cee&&_[_0xca82('0x72')](_0x4c6cee[_0xca82('0x149')])&&_0x1feb69[_0xca82('0x14a')]&&_0x42981c[_0xca82('0xc2')]===_0x42981c[_0xca82('0xb4')]&&_[_0xca82('0x72')](_0x42981c[_0xca82('0xf9')])&&_0x42981c[_0xca82('0x147')]==='16'&&_0x42981c['channelstate']==='6'&&_[_0xca82('0xf7')](_0x4c6cee[_0xca82('0x14b')])){if(_0x4c6cee[_0xca82('0xb0')]){rpcDb[_0xca82('0x144')](_0x4c6cee[_0xca82('0x10c')]);}if(_0x4c6cee[_0xca82('0xb1')]){rpcDb[_0xca82('0x8e')](_0x4c6cee[_0xca82('0x10c')]);}_0x42981c[_0xca82('0xf9')]='22';this[_0xca82('0xf6')](_0x4c6cee,_0x1feb69,_0x42981c);}else if(_0x4c6cee&&_0x4c6cee[_0xca82('0x14b')]){if(_0x42981c['cause']==='16'&&this['actions'][_0x42981c[_0xca82('0xc2')]][_0xca82('0x81')]){logger[_0xca82('0x5d')](_0xca82('0x14c'),_0x42981c[_0xca82('0xc2')],_0x42981c[_0xca82('0x147')],_0xca82('0xf4'),_0x1feb69[_0xca82('0x28')],_0xca82('0x77'),_0x1feb69['pTalking']);this[_0xca82('0xa1')](_0x42981c,_0x42981c[_0xca82('0xc2')],_0x42981c['cause']);}else if(this['actions'][_0x42981c['linkedid']][_0xca82('0x81')]){logger[_0xca82('0x5d')](_0xca82('0x148'),_0x42981c[_0xca82('0xc2')],_0x42981c[_0xca82('0x147')],_0xca82('0xf4'),_0x1feb69[_0xca82('0x28')],'pTalking:\x20',_0x1feb69[_0xca82('0x2b')]);this[_0xca82('0xa1')](_0x42981c,_0x42981c[_0xca82('0xc2')],_0x42981c[_0xca82('0x147')]);}}};Preview[_0xca82('0x10')][_0xca82('0x1e')]=function(_0x2f2d4c){if(this[_0xca82('0x17')][_0x2f2d4c[_0xca82('0xf5')]]&&_0x2f2d4c[_0xca82('0xf5')]!==_0x2f2d4c['destuniqueid']){this[_0xca82('0xa1')](_0x2f2d4c,_0x2f2d4c['destlinkedid'],_0x2f2d4c['dialstatus']);}};Preview[_0xca82('0x10')][_0xca82('0x14d')]=function(_0x1bf236){if(this[_0xca82('0x17')][_0x1bf236['linkedid']]&&_0x1bf236[_0xca82('0xc2')]!==_0x1bf236[_0xca82('0xb4')]&&!this[_0xca82('0x17')][_0x1bf236[_0xca82('0xc2')]][_0xca82('0x81')]){if(_0x1bf236[_0xca82('0x147')]==='1'){this[_0xca82('0xa1')](_0x1bf236,_0x1bf236[_0xca82('0xc2')],_0x1bf236[_0xca82('0x147')]);}}};Preview[_0xca82('0x10')][_0xca82('0x14e')]=function(_0x75b288,_0x596791,_0x42ef06){if(this['actions'][_0x75b288]){if(_['isNil'](this[_0xca82('0x17')][_0x75b288][_0xca82('0x14f')])){this[_0xca82('0x17')][_0x75b288][_0xca82('0x14f')]={};}this[_0xca82('0x17')][_0x75b288][_0xca82('0x14f')][_0x596791]=_0x42ef06;}};Preview[_0xca82('0x10')][_0xca82('0x20')]=function(_0x566aa4){try{if(!_['isNil'](_0x566aa4)){if(ut[_0xca82('0x150')](_[_0xca82('0x151')](_0x566aa4[_0xca82('0x152')])[0x0])){this[_0xca82('0x14e')](_0x566aa4[_0xca82('0xb4')],_[_0xca82('0x151')](_0x566aa4[_0xca82('0x152')])[0x0],_0x566aa4[_0xca82('0x153')]);}}}catch(_0x4f6859){logger[_0xca82('0x154')](_0xca82('0x155'),util['inspect'](_0x4f6859,{'showHidden':![],'depth':null}));}};Preview[_0xca82('0x10')][_0xca82('0x22')]=function(_0x17b9da){if(_0x17b9da){if(this[_0xca82('0x17')][_0x17b9da[_0xca82('0x156')]]){this[_0xca82('0x17')][_0x17b9da[_0xca82('0x156')]][_0xca82('0x14b')]=!![];}}};Preview[_0xca82('0x10')]['syncBlindTransfer']=function(_0x301fb4){if(_0x301fb4){if(this['actions'][_0x301fb4['transfererlinkedid']]){this[_0xca82('0x17')][_0x301fb4[_0xca82('0x157')]][_0xca82('0x14b')]=!![];}}};module[_0xca82('0x158')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index d38268c..593ec1a 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 _0xf938=['queuecallercompleteAt','endtime','connectedlinename','context','from-sip','exten','xcally-motion-preview','holdtime','assigned','lastAssignedTo','membername','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','util','bluebird','../../../config/logger','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','error','inspect','then','createHistory','catch','[createHistory]\x20','[moveContactManagedDialer]\x20','checkIsBlackList','resolve','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','active','rescheduleContact','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','queuecallerleaveAt','queuecallercomplete'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xf938,0x7e));var _0x8f93=function(_0x3dd23c,_0x18c32f){_0x3dd23c=_0x3dd23c-0x0;var _0x520bf8=_0xf938[_0x3dd23c];return _0x520bf8;};'use strict';var util=require(_0x8f93('0x0'));var BPromise=require(_0x8f93('0x1'));var logger=require(_0x8f93('0x2'))('preview');var _=require('lodash');var cmHopper=require(_0x8f93('0x3'));var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require(_0x8f93('0x4'));var cmHopperBlack=require(_0x8f93('0x5'));var voiceQueueRt=require(_0x8f93('0x6'));var agentReportPreview=require(_0x8f93('0x7'));var voiceQueueReport=require('../rpc/voiceQueueReport');function loggerCatch(_0x329575){return function(_0x4e0350){logger[_0x8f93('0x8')](_0x329575,util[_0x8f93('0x9')](_0x4e0350,{'showHidden':![],'depth':null}));};}function create(_0x117e09){return BPromise['resolve']()[_0x8f93('0xa')](cmHopperHistory[_0x8f93('0xb')](_0x117e09))[_0x8f93('0xc')](loggerCatch(_0x8f93('0xd')));}function createAgent(_0x49b239){return BPromise['resolve']()[_0x8f93('0xa')](agentReportPreview[_0x8f93('0xb')](_0x49b239))['catch'](loggerCatch(_0x8f93('0xd')));}function moveContact(_0x3cc0f9){return BPromise['resolve']()[_0x8f93('0xa')](cmHopper['moveContactManagedDialer'](_0x3cc0f9,!![]))['catch'](loggerCatch(_0x8f93('0xe')));}exports[_0x8f93('0xf')]=function(_0x541d2b){return BPromise[_0x8f93('0x10')]()['then'](cmHopperBlack[_0x8f93('0xf')](_0x541d2b))[_0x8f93('0xc')](loggerCatch('[checkIsBlackList]\x20'));};exports[_0x8f93('0x11')]=function(_0x290264){return BPromise['resolve']()[_0x8f93('0xa')](cmHopper[_0x8f93('0x11')](_0x290264))[_0x8f93('0xc')](loggerCatch(_0x8f93('0x12')));};exports[_0x8f93('0xb')]=function(_0x338e5d,_0x135e8a){create(_0x338e5d)['catch'](loggerCatch(_0x135e8a));moveContact(_0x338e5d)[_0x8f93('0xc')](loggerCatch(_0x135e8a));};exports[_0x8f93('0x13')]=function(_0x18b375,_0x5c779c){createAgent(_0x18b375)[_0x8f93('0xc')](loggerCatch(_0x5c779c));};exports[_0x8f93('0x14')]=function(_0x386148,_0x540127){create(_0x386148)[_0x8f93('0xc')](loggerCatch(_0x540127));};exports['createCustomerFinal']=function(_0x2db908,_0x1fc766){moveContact(_0x2db908)[_0x8f93('0xc')](loggerCatch(_0x1fc766));};exports['rescheduleContact']=function(_0x201a1f,_0x594a59,_0x191f8d){if(_0x594a59){_0x201a1f['UserId']=null;}if(_0x191f8d){_0x201a1f[_0x8f93('0x15')]=![];}return BPromise['resolve']()[_0x8f93('0xa')](cmHopper[_0x8f93('0x16')](_0x201a1f))[_0x8f93('0xc')](loggerCatch(_0x8f93('0x17')));};exports[_0x8f93('0x18')]=function(_0x4aa536){return BPromise[_0x8f93('0x10')]()[_0x8f93('0xa')](cmHopper[_0x8f93('0x18')](_0x4aa536))[_0x8f93('0xc')](loggerCatch(_0x8f93('0x19')));};exports[_0x8f93('0x1a')]=function(_0x4bca19){return BPromise[_0x8f93('0x10')]()[_0x8f93('0xa')](cmHopper['unlockContact']({'UserId':null},_0x4bca19,0x1))[_0x8f93('0xc')](loggerCatch(_0x8f93('0x1b')));};exports[_0x8f93('0x1c')]=function(_0x36ed28){return BPromise[_0x8f93('0x10')]()[_0x8f93('0xa')](cmHopper[_0x8f93('0x1a')]({'active':![]},_0x36ed28,0x1))[_0x8f93('0xc')](loggerCatch(_0x8f93('0x1d')));};exports[_0x8f93('0x1e')]=function(_0x2dee25){var _0x475ccd={};_0x475ccd[_0x8f93('0x1f')]=_0x2dee25[_0x8f93('0x1f')];_0x475ccd[_0x8f93('0x20')]=_0x2dee25[_0x8f93('0x20')];_0x475ccd[_0x8f93('0x21')]=_0x2dee25[_0x8f93('0x21')];_0x475ccd['calleridname']=_0x2dee25['calleridname'];_0x475ccd['queue']=_0x2dee25['queue'];_0x475ccd['queuecallerjoinAt']=_0x2dee25['answertime'];_0x475ccd[_0x8f93('0x22')]=_0x2dee25['answertime'];_0x475ccd[_0x8f93('0x23')]=0x1;_0x475ccd[_0x8f93('0x24')]=_0x2dee25[_0x8f93('0x25')];_0x475ccd[_0x8f93('0x26')]=_0x2dee25['membername'];_0x475ccd[_0x8f93('0x27')]=_0x8f93('0x28');_0x475ccd[_0x8f93('0x29')]=_0x8f93('0x2a');_0x475ccd[_0x8f93('0x2b')]=0x0;_0x475ccd[_0x8f93('0x2c')]=0x1;_0x475ccd[_0x8f93('0x2d')]=_0x2dee25[_0x8f93('0x2e')];_0x475ccd[_0x8f93('0x2f')]=_0x8f93('0x30');return BPromise[_0x8f93('0x10')]()[_0x8f93('0xa')](voiceQueueReport[_0x8f93('0x31')](_0x475ccd))[_0x8f93('0xc')](loggerCatch(_0x8f93('0x32')));};exports[_0x8f93('0x33')]=function(_0x5c84ad,_0x4bf2d4){return BPromise[_0x8f93('0x10')]()[_0x8f93('0xa')](cmHopper[_0x8f93('0x33')](_0x5c84ad,_0x4bf2d4))[_0x8f93('0xc')](loggerCatch(_0x8f93('0x34')));};exports[_0x8f93('0x35')]=function(_0x37480b){return BPromise[_0x8f93('0x10')]()[_0x8f93('0xa')](cmHopper[_0x8f93('0x16')](_0x37480b,!![],!![]))[_0x8f93('0xc')](loggerCatch('[rescheduleContactInQueue]\x20'));}; \ No newline at end of file +var _0xf62f=['preview','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueReport','error','inspect','then','createHistory','catch','[createHistory]\x20','resolve','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','UserId','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','disableContact','[activeContact]\x20','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','membername','context','exten','xcally-motion-preview','assigned','lastAssignedTo','queuecallerexitreason','create','[voiceQueueReport]\x20','getContactRecallMe','rescheduleContactInQueue','rescheduleContact','bluebird'];(function(_0x45641d,_0x3a874e){var _0x482481=function(_0x4bb839){while(--_0x4bb839){_0x45641d['push'](_0x45641d['shift']());}};_0x482481(++_0x3a874e);}(_0xf62f,0x67));var _0xff62=function(_0x2980c5,_0x11c0be){_0x2980c5=_0x2980c5-0x0;var _0x42578e=_0xf62f[_0x2980c5];return _0x42578e;};'use strict';var util=require('util');var BPromise=require(_0xff62('0x0'));var logger=require('../../../config/logger')(_0xff62('0x1'));var _=require('lodash');var cmHopper=require(_0xff62('0x2'));var cmHopperFinal=require(_0xff62('0x3'));var cmHopperHistory=require(_0xff62('0x4'));var cmHopperBlack=require(_0xff62('0x5'));var voiceQueueRt=require('../rpc/voiceQueueRt');var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require(_0xff62('0x6'));function loggerCatch(_0x17285b){return function(_0x2dc18d){logger[_0xff62('0x7')](_0x17285b,util[_0xff62('0x8')](_0x2dc18d,{'showHidden':![],'depth':null}));};}function create(_0x279ed9){return BPromise['resolve']()[_0xff62('0x9')](cmHopperHistory[_0xff62('0xa')](_0x279ed9))[_0xff62('0xb')](loggerCatch(_0xff62('0xc')));}function createAgent(_0x12594a){return BPromise['resolve']()['then'](agentReportPreview[_0xff62('0xa')](_0x12594a))[_0xff62('0xb')](loggerCatch(_0xff62('0xc')));}function moveContact(_0x47f60c){return BPromise[_0xff62('0xd')]()[_0xff62('0x9')](cmHopper['moveContactManagedDialer'](_0x47f60c,!![]))[_0xff62('0xb')](loggerCatch(_0xff62('0xe')));}exports[_0xff62('0xf')]=function(_0x4f4032){return BPromise['resolve']()[_0xff62('0x9')](cmHopperBlack[_0xff62('0xf')](_0x4f4032))[_0xff62('0xb')](loggerCatch(_0xff62('0x10')));};exports[_0xff62('0x11')]=function(_0x78d116){return BPromise['resolve']()[_0xff62('0x9')](cmHopper[_0xff62('0x11')](_0x78d116))[_0xff62('0xb')](loggerCatch(_0xff62('0x12')));};exports[_0xff62('0xa')]=function(_0x451f12,_0x21c3db){create(_0x451f12)['catch'](loggerCatch(_0x21c3db));moveContact(_0x451f12)['catch'](loggerCatch(_0x21c3db));};exports[_0xff62('0x13')]=function(_0x31b9fe,_0x3b4825){createAgent(_0x31b9fe)[_0xff62('0xb')](loggerCatch(_0x3b4825));};exports[_0xff62('0x14')]=function(_0x78cc54,_0xe71465){create(_0x78cc54)[_0xff62('0xb')](loggerCatch(_0xe71465));};exports['createCustomerFinal']=function(_0x4217d1,_0x4222ff){moveContact(_0x4217d1)[_0xff62('0xb')](loggerCatch(_0x4222ff));};exports['rescheduleContact']=function(_0x3329f0,_0x65a05,_0x508da3){if(_0x65a05){_0x3329f0[_0xff62('0x15')]=null;}if(_0x508da3){_0x3329f0[_0xff62('0x16')]=![];}return BPromise['resolve']()['then'](cmHopper['rescheduleContact'](_0x3329f0))[_0xff62('0xb')](loggerCatch(_0xff62('0x17')));};exports[_0xff62('0x18')]=function(_0x4a1d52){return BPromise[_0xff62('0xd')]()[_0xff62('0x9')](cmHopper[_0xff62('0x18')](_0x4a1d52))[_0xff62('0xb')](loggerCatch(_0xff62('0x19')));};exports[_0xff62('0x1a')]=function(_0x3a5d23){return BPromise['resolve']()[_0xff62('0x9')](cmHopper[_0xff62('0x1a')]({'UserId':null},_0x3a5d23,0x1))[_0xff62('0xb')](loggerCatch('[unlockContact]\x20'));};exports[_0xff62('0x1b')]=function(_0x9898a9){return BPromise[_0xff62('0xd')]()[_0xff62('0x9')](cmHopper['unlockContact']({'active':![]},_0x9898a9,0x1))[_0xff62('0xb')](loggerCatch(_0xff62('0x1c')));};exports['crateCustomerReportQueue']=function(_0x32d726){var _0x3e07e1={};_0x3e07e1[_0xff62('0x1d')]=_0x32d726[_0xff62('0x1d')];_0x3e07e1['uniqueid']=_0x32d726[_0xff62('0x1e')];_0x3e07e1['calleridnum']=_0x32d726[_0xff62('0x1f')];_0x3e07e1['calleridname']=_0x32d726[_0xff62('0x20')];_0x3e07e1['queue']=_0x32d726[_0xff62('0x21')];_0x3e07e1[_0xff62('0x22')]=_0x32d726[_0xff62('0x23')];_0x3e07e1['queuecallerleaveAt']=_0x32d726['answertime'];_0x3e07e1[_0xff62('0x24')]=0x1;_0x3e07e1[_0xff62('0x25')]=_0x32d726[_0xff62('0x26')];_0x3e07e1[_0xff62('0x27')]=_0x32d726[_0xff62('0x28')];_0x3e07e1[_0xff62('0x29')]='from-sip';_0x3e07e1[_0xff62('0x2a')]=_0xff62('0x2b');_0x3e07e1['holdtime']=0x0;_0x3e07e1[_0xff62('0x2c')]=0x1;_0x3e07e1[_0xff62('0x2d')]=_0x32d726[_0xff62('0x28')];_0x3e07e1[_0xff62('0x2e')]='COMPLETED';return BPromise[_0xff62('0xd')]()['then'](voiceQueueReport[_0xff62('0x2f')](_0x3e07e1))[_0xff62('0xb')](loggerCatch(_0xff62('0x30')));};exports[_0xff62('0x31')]=function(_0x22958e,_0x20547f){return BPromise['resolve']()[_0xff62('0x9')](cmHopper[_0xff62('0x31')](_0x22958e,_0x20547f))[_0xff62('0xb')](loggerCatch('[GetContactRecallMe]\x20'));};exports[_0xff62('0x32')]=function(_0x391ac0){return BPromise['resolve']()[_0xff62('0x9')](cmHopper[_0xff62('0x33')](_0x391ac0,!![],!![]))[_0xff62('0xb')](loggerCatch('[rescheduleContactInQueue]\x20'));}; \ 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 c3c3afc..108914e 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 _0x09b2=['variablesAction','RECALL','BOOKED','uniqueid','originate','channelAgent','from-sip','timeout','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','cloneAction','Global','scheduledAt','active','add','minutes','ListId','VoiceQueueId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','buildObj','lastevent','queue','voice','mandatoryDisposition','interface','not_inuse','status','reachable','push','diff','createBody','filterKey','idContact','type','dialAnswer','calleridname','countglobal','callbackuniqueid','recallme','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-contactid','xmd-cdrtype','xmd-agi','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqos','rtpaudioqosbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','replace','random','extractCalleridName','extractCalleridNumber','match','util','../../../../config/logger','preview','env','XCALLY_IP_AGI','127.0.0.1','milliseconds','seconds','loggerCatch','error','inspect','info','loggerError','logger2','message','getCallerId','isUndefined','string','isEmpty','\x22%s\x22\x20<%s>','format','\x22\x22\x20<>','isActive','isNil','addVariables','Queue','name','calleridnum','ContactId','dialer','dialOriginateTimeout','dialQueueProject2','\x22agi://%s/square,%s\x22','dialQueueProject','NONE','originatecalleridname','xcally-motion-preview','_XCALLY_MIXMONITOR_FORMAT','Contact','hasOwnProperty','createdAt','updatedAt','%s%s','XMD-','toLowerVariables','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','starttime','responsetime','endtime','logAgent','ringtime','logLookAgent','membername','UserId','answertime','isFailure','Failure'];(function(_0x35f168,_0x576358){var _0x397a87=function(_0xddc043){while(--_0xddc043){_0x35f168['push'](_0x35f168['shift']());}};_0x397a87(++_0x576358);}(_0x09b2,0x15e));var _0x209b=function(_0x49d21f,_0x6e7f5){_0x49d21f=_0x49d21f-0x0;var _0x1b93f2=_0x09b2[_0x49d21f];return _0x1b93f2;};'use strict';var util=require(_0x209b('0x0'));var _=require('lodash');var moment=require('moment');var logger=require(_0x209b('0x1'))(_0x209b('0x2'));var ipAgi=process[_0x209b('0x3')][_0x209b('0x4')]||_0x209b('0x5');function getSeconds(_0x3cfda8,_0x1a8a3d){var _0x14fc19=moment(_0x3cfda8)['milliseconds'](0x0);var _0x1e589d=moment(_0x1a8a3d)[_0x209b('0x6')](0x0);return _0x14fc19['diff'](_0x1e589d,_0x209b('0x7'));}exports[_0x209b('0x8')]=function(_0x1325f2){return function(_0x2b2600){logger[_0x209b('0x9')](_0x1325f2,util[_0x209b('0xa')](_0x2b2600,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x1f60c8,_0x1630b3){logger[_0x209b('0xb')](_0x1f60c8,util['inspect'](_0x1630b3,{'showHidden':![],'depth':null}));};exports[_0x209b('0xc')]=function(_0x10a456,_0x5ae6a8){logger[_0x209b('0x9')](_0x10a456,util[_0x209b('0xa')](_0x5ae6a8,{'showHidden':![],'depth':null}));};exports[_0x209b('0xd')]=function(_0x4b0470){return function(_0x4e7345){logger['info'](_0x4b0470,util[_0x209b('0xa')](_0x4e7345,{'showHidden':![],'depth':null}));};};exports[_0x209b('0xe')]=function(_0xae3f70,_0x3fdd9e,_0x41724b){return{'message':_0xae3f70,'unlock':_0x3fdd9e,'active':_0x41724b};};exports[_0x209b('0xf')]=function(_0x271a23,_0x58154d,_0xa2b181){if(!_[_0x209b('0x10')](_0xa2b181)&&_0x209b('0x11')===typeof _0xa2b181&&!_[_0x209b('0x12')](_0xa2b181)){if(!_['isUndefined'](_0x58154d)&&_0x209b('0x11')===typeof _0x58154d&&!_[_0x209b('0x12')](_0x58154d)){return util['format'](_0x209b('0x13'),_0x58154d,_0xa2b181);}return util[_0x209b('0x14')](_0x209b('0x13'),_0xa2b181,_0xa2b181);}if(!_[_0x209b('0x10')](_0x271a23)&&_0x209b('0x11')===typeof _0x271a23&&!_[_0x209b('0x12')](_0x271a23)){return _0x271a23;}return _0x209b('0x15');};exports[_0x209b('0x16')]=function(_0x5c6cf2){if(_[_0x209b('0x17')](_0x5c6cf2)){return![];}return _0x5c6cf2;};exports[_0x209b('0x18')]=function(_0x16a264,_0x5f3bb2,_0x3c9645,_0x20e07b,_0x2c9bc5,_0x538707){var _0x272492={'XMD-QUEUE':_0x5f3bb2[_0x209b('0x19')]?_0x5f3bb2['Queue'][_0x209b('0x1a')]:'','XMD-CALLERID':_0x20e07b,'XMD-CALLERID-PREVIEW':_0x538707?util[_0x209b('0x14')](_0x209b('0x13'),_0x538707['calleridname'],_0x538707[_0x209b('0x1b')]):_0x20e07b,'XMD-DIALID':_0x2c9bc5,'XMD-CONTACTID':_0x5f3bb2[_0x209b('0x1c')],'XMD-CDRTYPE':_0x209b('0x1d'),'CALLERID(all)':_0x20e07b,'XMD-VOICEQUEUEID':_0x5f3bb2['VoiceQueueId'],'XMD-DIALCHANNEL':_0x3c9645,'XMD-DIALTIMEOUT':_0x16a264[_0x209b('0x1e')]||0x1e,'XMD-DIALOPTIONS':util[_0x209b('0x14')]('\x22rtTxX%s%s\x22',_0x16a264[_0x209b('0x1f')]?'g':'',_['isEmpty'](_0x16a264['monitor_format'])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x16a264['dialPreviewUrl']||'','XMD-AGI':_0x16a264['dialQueueProject']?util[_0x209b('0x14')](_0x209b('0x20'),ipAgi,_0x16a264[_0x209b('0x21')]):_0x209b('0x22'),'XMD-AGIAFTER':_0x16a264[_0x209b('0x1f')]?util[_0x209b('0x14')](_0x209b('0x20'),ipAgi,_0x16a264['dialQueueProject2']):_0x209b('0x22'),'XMD-ORIGINATECALLERIDNUM':_0x538707?_0x538707['originatecalleridnum']:'','XMD-ORIGINATECALLERIDNAME':_0x538707?_0x538707[_0x209b('0x23')]:'','XMD-DESTINATION':_0x209b('0x24')};if(!_['isEmpty'](_0x16a264['monitor_format'])){_0x272492[util[_0x209b('0x14')]('%s',_0x209b('0x25'))]=_0x16a264['monitor_format'];_0x272492[util[_0x209b('0x14')]('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x2c9bc5;}if(_0x5f3bb2&&_0x5f3bb2[_0x209b('0x26')]){for(var _0x5e4df8 in _0x5f3bb2[_0x209b('0x26')]){if(_0x5f3bb2[_0x209b('0x26')][_0x209b('0x27')](_0x5e4df8)){if(!_[_0x209b('0x17')](_0x5f3bb2[_0x209b('0x26')][_0x5e4df8])&&_0x5e4df8!=='id'&&_0x5e4df8!=='tags'&&_0x5e4df8!==_0x209b('0x28')&&_0x5e4df8!==_0x209b('0x29')){_0x272492[util['format'](_0x209b('0x2a'),_0x209b('0x2b'),_['toUpper'](_0x5e4df8))]=_0x5f3bb2[_0x209b('0x26')][_0x5e4df8];}}}}return _0x272492;};exports[_0x209b('0x2c')]=function(_0xb9b8fe){var _0xa472ea={};for(var _0x5d9fb3 in _0xb9b8fe){if(_0xb9b8fe['hasOwnProperty'](_0x5d9fb3)){_0xa472ea[util[_0x209b('0x14')]('%s',_['toLower'](_0x5d9fb3))]=_0xb9b8fe[_0x5d9fb3];}}return{'variables':_0xa472ea};};exports['updateOriginated']=function(_0x1715b4,_0x1da125){if(!_['isNil'](_0x1715b4)){if(_0x1715b4[_0x209b('0x27')](_0x209b('0x2d'))){if(_0x1715b4[_0x209b('0x2d')]>0x0){_0x1715b4[_0x209b('0x2d')]-=0x1;}else{logger[_0x209b('0x9')](_0x209b('0x2e'),_0x1da125);}}}else{logger[_0x209b('0x9')](_0x209b('0x2f'),_0x1da125);}};exports[_0x209b('0x30')]=function(_0x3e0a40){var _0x39a192=moment()[_0x209b('0x14')](_0x209b('0x31'));_0x3e0a40[_0x209b('0x32')]=0xd;_0x3e0a40[_0x209b('0x33')]=_0x209b('0x34');_0x3e0a40[_0x209b('0x35')]=_0x39a192;_0x3e0a40[_0x209b('0x36')]=_0x39a192;_0x3e0a40[_0x209b('0x37')]=_0x39a192;};exports[_0x209b('0x38')]=function(_0x638e0,_0x2edc52,_0x38a1ab){var _0x3a1583=moment()[_0x209b('0x14')](_0x209b('0x31'));_0x638e0[_0x209b('0x32')]=_0x2edc52;_0x638e0['statedesc']=_0x38a1ab;_0x638e0[_0x209b('0x36')]=_0x3a1583;_0x638e0[_0x209b('0x39')]=getSeconds(_0x638e0['responsetime'],_0x638e0[_0x209b('0x35')]);};exports[_0x209b('0x3a')]=function(_0x4bf10e,_0x543b6a,_0x146464){_0x4bf10e[_0x209b('0x3b')]=_0x543b6a;_0x4bf10e[_0x209b('0x3c')]=_0x146464;};exports['logCustomer']=function(_0x159df7,_0x438b8a,_0x23c346){var _0x335d34=moment()[_0x209b('0x14')]('YYYY-MM-DD\x20HH:mm:ss');_0x159df7['state']=_0x438b8a;_0x159df7[_0x209b('0x33')]=_0x23c346;_0x159df7[_0x209b('0x36')]=_0x159df7['responsetime']?_0x159df7[_0x209b('0x36')]:_0x335d34;_0x159df7[_0x209b('0x37')]=_0x159df7[_0x209b('0x37')]?_0x159df7[_0x209b('0x37')]:_0x335d34;_0x159df7[_0x209b('0x39')]=getSeconds(_0x159df7[_0x209b('0x36')]||0x0,_0x159df7[_0x209b('0x35')]||0x0);_0x159df7['talktime']=_0x159df7[_0x209b('0x3d')]?getSeconds(_0x159df7[_0x209b('0x37')],_0x159df7[_0x209b('0x3d')]):0x0;};exports[_0x209b('0x3e')]=function(_0x15680f){return _0x15680f===_0x209b('0x3f');};exports[_0x209b('0x40')]=function(_0x58c282,_0x3535c9,_0x38509e,_0x5e5e94,_0x2d86f5){var _0x4941dd=_0x5e5e94?_0x209b('0x41'):_0x58c282['calleridname'];_0x4941dd=_0x2d86f5?_0x209b('0x42'):_0x4941dd;return{'actionid':_0x58c282[_0x209b('0x43')],'action':_0x209b('0x44'),'channel':_0x58c282[_0x209b('0x45')],'callerid':util[_0x209b('0x14')](_0x209b('0x13'),_0x4941dd,_0x58c282[_0x209b('0x1b')]),'Exten':_0x209b('0x24'),'Context':_0x209b('0x46'),'Priority':'1','variable':_0x38509e,'timeout':(_0x3535c9[_0x209b('0x47')]||0x1e)*0x3e8,'async':!![],'channelid':_0x58c282['uniqueid']};};exports[_0x209b('0x48')]=function(_0x2cf33b){return _0x2cf33b[_0x209b('0x49')]+_0x2cf33b[_0x209b('0x4a')]+_0x2cf33b[_0x209b('0x4b')]+_0x2cf33b['countagentrejectretry']+_0x2cf33b['countnosuchnumberretry'];};exports[_0x209b('0x4c')]=function(_0x21d05d){var _0x57a5df=_['clone'](_0x21d05d);_0x57a5df['state']=0xf;_0x57a5df['statedesc']=_0x209b('0x4d');return _0x57a5df;};exports[_0x209b('0x4e')]=function(_0x3cb791,_0x9198ca,_0xd9bbba){var _0x5783bb={};_0x5783bb[_0x9198ca]=_0x3cb791[_0x9198ca];_0x5783bb[_0x209b('0x4f')]=![];_0x5783bb['scheduledat']=moment()[_0x209b('0x50')](_0xd9bbba,_0x209b('0x51'))['format'](_0x209b('0x31'));_0x5783bb[_0x209b('0x1c')]=_0x3cb791[_0x209b('0x1c')];_0x5783bb[_0x209b('0x52')]=_0x3cb791[_0x209b('0x52')];_0x5783bb[_0x209b('0x53')]=_0x3cb791['VoiceQueueId']||undefined;return _0x5783bb;};exports[_0x209b('0x54')]=function(_0x56061,_0x3bbb82){if(!_[_0x209b('0x17')](_0x56061)){if(_0x56061[_0x209b('0x55')]>0x0){_0x56061[_0x209b('0x55')]-=0x1;}else{logger[_0x209b('0x9')](_0x3bbb82,_0x209b('0x56'));}}else{logger[_0x209b('0x9')](_0x3bbb82,_0x209b('0x57'));}};exports[_0x209b('0x58')]=function(_0x4d859e){if(_0x4d859e<=0x0){return!![];}return![];};exports[_0x209b('0x59')]=function(_0x46ee14,_0x4caf8f,_0x2c9b1c){_0x46ee14[_0x209b('0x5a')]=_0x4caf8f;_0x46ee14['name']=_0x46ee14[_0x209b('0x5b')];_0x46ee14['interface']=_0x46ee14['channelAgent'];_0x46ee14['motionChannel']=_0x209b('0x5c');if(_0x2c9b1c){_0x46ee14[_0x209b('0x5d')]=_0x2c9b1c[_0x209b('0x5d')];}return _0x46ee14;};exports['buildAcw']=function(_0x8ddbf4){var _0xfa59e5={};_0xfa59e5[_0x209b('0x5b')]=_0x8ddbf4['queue'];_0xfa59e5[_0x209b('0x5e')]=_0x8ddbf4[_0x209b('0x45')];_0xfa59e5['uniqueid']=_0x8ddbf4[_0x209b('0x43')];return _0xfa59e5;};exports['agentReadyId']=function(_0x41a70f){var _0x3374ea=[];for(var _0x5b5b31 in _0x41a70f){if(_0x41a70f[_0x209b('0x27')](_0x5b5b31)){if(!_[_0x209b('0x17')](_0x41a70f[_0x5b5b31])&&_0x41a70f[_0x5b5b31]['state']===_0x209b('0x5f')&&_0x41a70f[_0x5b5b31][_0x209b('0x60')]===_0x209b('0x61')){_0x3374ea[_0x209b('0x62')](_0x41a70f[_0x5b5b31]['id']);}}}return _0x3374ea;};exports['getDiff']=function(_0x2358b7){var _0x4e5c6c=moment()['milliseconds'](0x0);var _0x1cb31c=moment(_0x2358b7)[_0x209b('0x6')](0x0);return _0x4e5c6c[_0x209b('0x63')](_0x1cb31c,_0x209b('0x7'));};exports[_0x209b('0x64')]=function(_0xc88fdb){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0xc88fdb[_0x209b('0x1c')],'ListId':_0xc88fdb[_0x209b('0x52')],'VoiceQueueId':_0xc88fdb[_0x209b('0x53')]||undefined,'CampaignId':_0xc88fdb['CampaignId']||undefined};};exports[_0x209b('0x65')]=function(_0x14f1ae){if(_0x14f1ae===_0x209b('0x43')||_0x14f1ae===_0x209b('0x66')||_0x14f1ae===_0x209b('0x5b')||_0x14f1ae===_0x209b('0x67')||_0x14f1ae==='campaigntype'||_0x14f1ae===_0x209b('0x68')||_0x14f1ae==='membername'||_0x14f1ae==='channelAgent'||_0x14f1ae===_0x209b('0x69')||_0x14f1ae==='active'||_0x14f1ae==='calleridnum'||_0x14f1ae==='scheduledat'||_0x14f1ae===_0x209b('0x49')||_0x14f1ae===_0x209b('0x4a')||_0x14f1ae==='countnoanswerretry'||_0x14f1ae===_0x209b('0x6a')||_0x14f1ae==='callback'||_0x14f1ae===_0x209b('0x6b')||_0x14f1ae==='callbackat'||_0x14f1ae===_0x209b('0x6c')||_0x14f1ae===_0x209b('0x1c')||_0x14f1ae===_0x209b('0x52')||_0x14f1ae==='UserId'||_0x14f1ae===_0x209b('0x53')||_0x14f1ae===_0x209b('0x6d')||_0x14f1ae===_0x209b('0x6e')||_0x14f1ae===_0x209b('0x6f')||_0x14f1ae===_0x209b('0x70')||_0x14f1ae===_0x209b('0x71')||_0x14f1ae==='xmd-dialurl'||_0x14f1ae===_0x209b('0x72')||_0x14f1ae===_0x209b('0x73')||_0x14f1ae===_0x209b('0x74')||_0x14f1ae==='xmd-dialchannel'||_0x14f1ae===_0x209b('0x75')||_0x14f1ae===_0x209b('0x76')||_0x14f1ae==='xmd-callerid'||_0x14f1ae==='xmd-agiafter'||_0x14f1ae===_0x209b('0x77')||_0x14f1ae==='rtpaudioqos'||_0x14f1ae==='rtpaudioqosbridged'||_0x14f1ae===_0x209b('0x78')||_0x14f1ae===_0x209b('0x79')||_0x14f1ae===_0x209b('0x7a')||_0x14f1ae===_0x209b('0x7b')||_0x14f1ae===_0x209b('0x7c')||_0x14f1ae===_0x209b('0x7d')||_0x14f1ae===_0x209b('0x7e')||_0x14f1ae===_0x209b('0x7f')||_0x14f1ae===_0x209b('0x78')||_0x14f1ae==='rtpaudioqosjitterbridged'||_0x14f1ae==='rtpaudioqosloss'||_0x14f1ae==='rtpaudioqoslossbridged'||_0x14f1ae===_0x209b('0x7c')||_0x14f1ae===_0x209b('0x7d')||_0x14f1ae===_0x209b('0x80')||_0x14f1ae===_0x209b('0x81')||_0x14f1ae===_0x209b('0x32')||_0x14f1ae===_0x209b('0x33')){return![];}return!![];};exports[_0x209b('0x82')]=function(_0x9bd63e,_0x1ac11d){var _0x198fe3,_0x3f7bc1,_0x409499;if(_0x1ac11d<=0x0){_0x1ac11d=0x1;}_0x198fe3=new RegExp(_0x209b('0x83')+_0x1ac11d+'}$');_0x3f7bc1=Math[_0x209b('0x84')](0xa,_0x1ac11d-0x1);_0x409499=Math[_0x209b('0x84')](0xa,_0x1ac11d)-0x1;return util[_0x209b('0x14')]('%s',_[_0x209b('0x85')](_0x9bd63e,_0x198fe3,_[_0x209b('0x86')](_0x3f7bc1,_0x409499)));};exports[_0x209b('0x87')]=function(_0x4dbecd){var _0x46bdbf=_0x4dbecd['match'](/"(.*?)"/);return _0x46bdbf?_0x46bdbf[0x1]:_0x4dbecd;};exports[_0x209b('0x88')]=function(_0x4e249d){var _0x3e5c33=_0x4e249d[_0x209b('0x89')](/<(.*?)>/);return _0x3e5c33?_0x3e5c33[0x1]:_0x4e249d;}; \ No newline at end of file +var _0x9daa=['logger2','message','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','Queue','name','calleridname','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','createdAt','updatedAt','%s%s','XMD-','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','starttime','responsetime','logAgent','logLookAgent','UserId','logCustomer','endtime','talktime','answertime','Failure','variablesAction','RECALL','BOOKED','uniqueid','from-sip','timeout','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','cloneAction','clone','scheduledAt','active','scheduledat','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','buildObj','queue','interface','channelAgent','motionChannel','voice','mandatoryDisposition','buildAcw','agentReadyId','not_inuse','status','reachable','push','getDiff','createBody','idContact','type','membername','countglobal','callback','callbackuniqueid','recallme','sipcallid','xmd-voicequeueid','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-cdrtype','xmd-agi','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqos','bridgepeer','bridgepvtcallid','getCallerIdRandom','pow','replace','random','extractCalleridName','match','extractCalleridNumber','util','lodash','moment','../../../../config/logger','preview','env','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','seconds','loggerCatch','error','inspect','logger','info'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x9daa,0x80));var _0xa9da=function(_0x4f80a7,_0x3ed415){_0x4f80a7=_0x4f80a7-0x0;var _0x5f2dc6=_0x9daa[_0x4f80a7];return _0x5f2dc6;};'use strict';var util=require(_0xa9da('0x0'));var _=require(_0xa9da('0x1'));var moment=require(_0xa9da('0x2'));var logger=require(_0xa9da('0x3'))(_0xa9da('0x4'));var ipAgi=process[_0xa9da('0x5')][_0xa9da('0x6')]||_0xa9da('0x7');function getSeconds(_0x374540,_0x30984d){var _0x260789=moment(_0x374540)[_0xa9da('0x8')](0x0);var _0x154ce1=moment(_0x30984d)[_0xa9da('0x8')](0x0);return _0x260789[_0xa9da('0x9')](_0x154ce1,_0xa9da('0xa'));}exports[_0xa9da('0xb')]=function(_0x157b6f){return function(_0x1e7283){logger[_0xa9da('0xc')](_0x157b6f,util[_0xa9da('0xd')](_0x1e7283,{'showHidden':![],'depth':null}));};};exports[_0xa9da('0xe')]=function(_0x1b4806,_0x1b3851){logger[_0xa9da('0xf')](_0x1b4806,util['inspect'](_0x1b3851,{'showHidden':![],'depth':null}));};exports['loggerError']=function(_0x21c826,_0x25623c){logger[_0xa9da('0xc')](_0x21c826,util[_0xa9da('0xd')](_0x25623c,{'showHidden':![],'depth':null}));};exports[_0xa9da('0x10')]=function(_0xac03ca){return function(_0x23ec1c){logger[_0xa9da('0xf')](_0xac03ca,util[_0xa9da('0xd')](_0x23ec1c,{'showHidden':![],'depth':null}));};};exports[_0xa9da('0x11')]=function(_0x195987,_0x5c0d8f,_0x33b25e){return{'message':_0x195987,'unlock':_0x5c0d8f,'active':_0x33b25e};};exports[_0xa9da('0x12')]=function(_0x2415df,_0x47f3b0,_0x1c6ac3){if(!_[_0xa9da('0x13')](_0x1c6ac3)&&_0xa9da('0x14')===typeof _0x1c6ac3&&!_[_0xa9da('0x15')](_0x1c6ac3)){if(!_[_0xa9da('0x13')](_0x47f3b0)&&_0xa9da('0x14')===typeof _0x47f3b0&&!_[_0xa9da('0x15')](_0x47f3b0)){return util[_0xa9da('0x16')]('\x22%s\x22\x20<%s>',_0x47f3b0,_0x1c6ac3);}return util[_0xa9da('0x16')](_0xa9da('0x17'),_0x1c6ac3,_0x1c6ac3);}if(!_[_0xa9da('0x13')](_0x2415df)&&_0xa9da('0x14')===typeof _0x2415df&&!_[_0xa9da('0x15')](_0x2415df)){return _0x2415df;}return _0xa9da('0x18');};exports[_0xa9da('0x19')]=function(_0x1f6174){if(_[_0xa9da('0x1a')](_0x1f6174)){return![];}return _0x1f6174;};exports['addVariables']=function(_0x4e37c5,_0x51a0e6,_0x510542,_0x547548,_0x33d6e5,_0x1fcaba){var _0x5353e1={'XMD-QUEUE':_0x51a0e6['Queue']?_0x51a0e6[_0xa9da('0x1b')][_0xa9da('0x1c')]:'','XMD-CALLERID':_0x547548,'XMD-CALLERID-PREVIEW':_0x1fcaba?util[_0xa9da('0x16')](_0xa9da('0x17'),_0x1fcaba[_0xa9da('0x1d')],_0x1fcaba[_0xa9da('0x1e')]):_0x547548,'XMD-DIALID':_0x33d6e5,'XMD-CONTACTID':_0x51a0e6[_0xa9da('0x1f')],'XMD-CDRTYPE':_0xa9da('0x20'),'CALLERID(all)':_0x547548,'XMD-VOICEQUEUEID':_0x51a0e6[_0xa9da('0x21')],'XMD-DIALCHANNEL':_0x510542,'XMD-DIALTIMEOUT':_0x4e37c5[_0xa9da('0x22')]||0x1e,'XMD-DIALOPTIONS':util[_0xa9da('0x16')](_0xa9da('0x23'),_0x4e37c5[_0xa9da('0x24')]?'g':'',_['isEmpty'](_0x4e37c5[_0xa9da('0x25')])?'':_0xa9da('0x26')),'XMD-DIALURL':_0x4e37c5[_0xa9da('0x27')]||'','XMD-AGI':_0x4e37c5[_0xa9da('0x28')]?util[_0xa9da('0x16')](_0xa9da('0x29'),ipAgi,_0x4e37c5[_0xa9da('0x28')]):'NONE','XMD-AGIAFTER':_0x4e37c5[_0xa9da('0x24')]?util[_0xa9da('0x16')](_0xa9da('0x29'),ipAgi,_0x4e37c5['dialQueueProject2']):_0xa9da('0x2a'),'XMD-ORIGINATECALLERIDNUM':_0x1fcaba?_0x1fcaba[_0xa9da('0x2b')]:'','XMD-ORIGINATECALLERIDNAME':_0x1fcaba?_0x1fcaba[_0xa9da('0x2c')]:'','XMD-DESTINATION':_0xa9da('0x2d')};if(!_[_0xa9da('0x15')](_0x4e37c5[_0xa9da('0x25')])){_0x5353e1[util['format']('%s',_0xa9da('0x2e'))]=_0x4e37c5['monitor_format'];_0x5353e1[util[_0xa9da('0x16')]('%s',_0xa9da('0x2f'))]=_0x33d6e5;}if(_0x51a0e6&&_0x51a0e6['Contact']){for(var _0xc38337 in _0x51a0e6[_0xa9da('0x30')]){if(_0x51a0e6[_0xa9da('0x30')][_0xa9da('0x31')](_0xc38337)){if(!_['isNil'](_0x51a0e6[_0xa9da('0x30')][_0xc38337])&&_0xc38337!=='id'&&_0xc38337!==_0xa9da('0x32')&&_0xc38337!==_0xa9da('0x33')&&_0xc38337!==_0xa9da('0x34')){_0x5353e1[util[_0xa9da('0x16')](_0xa9da('0x35'),_0xa9da('0x36'),_['toUpper'](_0xc38337))]=_0x51a0e6[_0xa9da('0x30')][_0xc38337];}}}}return _0x5353e1;};exports['toLowerVariables']=function(_0x4c9f0c){var _0xcf510d={};for(var _0x4e1237 in _0x4c9f0c){if(_0x4c9f0c[_0xa9da('0x31')](_0x4e1237)){_0xcf510d[util[_0xa9da('0x16')]('%s',_[_0xa9da('0x37')](_0x4e1237))]=_0x4c9f0c[_0x4e1237];}}return{'variables':_0xcf510d};};exports[_0xa9da('0x38')]=function(_0x4703a4,_0x5b2042){if(!_[_0xa9da('0x1a')](_0x4703a4)){if(_0x4703a4[_0xa9da('0x31')](_0xa9da('0x39'))){if(_0x4703a4[_0xa9da('0x39')]>0x0){_0x4703a4[_0xa9da('0x39')]-=0x1;}else{logger[_0xa9da('0xc')](_0xa9da('0x3a'),_0x5b2042);}}}else{logger['error']('[updateOriginated]\x20is\x20null\x20or\x20undefined',_0x5b2042);}};exports[_0xa9da('0x3b')]=function(_0x2c6f5d){var _0x5715c8=moment()[_0xa9da('0x16')](_0xa9da('0x3c'));_0x2c6f5d[_0xa9da('0x3d')]=0xd;_0x2c6f5d[_0xa9da('0x3e')]=_0xa9da('0x3f');_0x2c6f5d[_0xa9da('0x40')]=_0x5715c8;_0x2c6f5d[_0xa9da('0x41')]=_0x5715c8;_0x2c6f5d['endtime']=_0x5715c8;};exports[_0xa9da('0x42')]=function(_0x3d79b0,_0x35c7fe,_0x215830){var _0x36523c=moment()[_0xa9da('0x16')](_0xa9da('0x3c'));_0x3d79b0[_0xa9da('0x3d')]=_0x35c7fe;_0x3d79b0[_0xa9da('0x3e')]=_0x215830;_0x3d79b0[_0xa9da('0x41')]=_0x36523c;_0x3d79b0['ringtime']=getSeconds(_0x3d79b0[_0xa9da('0x41')],_0x3d79b0['starttime']);};exports[_0xa9da('0x43')]=function(_0xb6f144,_0x56a5f0,_0x46ef5d){_0xb6f144['membername']=_0x56a5f0;_0xb6f144[_0xa9da('0x44')]=_0x46ef5d;};exports[_0xa9da('0x45')]=function(_0x170263,_0xc58b9b,_0x447f02){var _0x5998fe=moment()['format'](_0xa9da('0x3c'));_0x170263[_0xa9da('0x3d')]=_0xc58b9b;_0x170263['statedesc']=_0x447f02;_0x170263[_0xa9da('0x41')]=_0x170263[_0xa9da('0x41')]?_0x170263[_0xa9da('0x41')]:_0x5998fe;_0x170263[_0xa9da('0x46')]=_0x170263['endtime']?_0x170263['endtime']:_0x5998fe;_0x170263['ringtime']=getSeconds(_0x170263[_0xa9da('0x41')]||0x0,_0x170263[_0xa9da('0x40')]||0x0);_0x170263[_0xa9da('0x47')]=_0x170263[_0xa9da('0x48')]?getSeconds(_0x170263[_0xa9da('0x46')],_0x170263[_0xa9da('0x48')]):0x0;};exports['isFailure']=function(_0x127df8){return _0x127df8===_0xa9da('0x49');};exports[_0xa9da('0x4a')]=function(_0xe6da21,_0x276390,_0x5e95cb,_0x23ae8b,_0x48f919){var _0x5d9c2c=_0x23ae8b?_0xa9da('0x4b'):_0xe6da21[_0xa9da('0x1d')];_0x5d9c2c=_0x48f919?_0xa9da('0x4c'):_0x5d9c2c;return{'actionid':_0xe6da21[_0xa9da('0x4d')],'action':'originate','channel':_0xe6da21['channelAgent'],'callerid':util[_0xa9da('0x16')](_0xa9da('0x17'),_0x5d9c2c,_0xe6da21[_0xa9da('0x1e')]),'Exten':_0xa9da('0x2d'),'Context':_0xa9da('0x4e'),'Priority':'1','variable':_0x5e95cb,'timeout':(_0x276390[_0xa9da('0x4f')]||0x1e)*0x3e8,'async':!![],'channelid':_0xe6da21[_0xa9da('0x4d')]};};exports['totalGlobal']=function(_0x261272){return _0x261272[_0xa9da('0x50')]+_0x261272[_0xa9da('0x51')]+_0x261272[_0xa9da('0x52')]+_0x261272['countagentrejectretry']+_0x261272[_0xa9da('0x53')];};exports[_0xa9da('0x54')]=function(_0x511a33){var _0xf83e1b=_[_0xa9da('0x55')](_0x511a33);_0xf83e1b[_0xa9da('0x3d')]=0xf;_0xf83e1b[_0xa9da('0x3e')]='Global';return _0xf83e1b;};exports[_0xa9da('0x56')]=function(_0x36c5a4,_0x3d1b0e,_0x4bf6c2){var _0x41d045={};_0x41d045[_0x3d1b0e]=_0x36c5a4[_0x3d1b0e];_0x41d045[_0xa9da('0x57')]=![];_0x41d045[_0xa9da('0x58')]=moment()['add'](_0x4bf6c2,_0xa9da('0x59'))[_0xa9da('0x16')](_0xa9da('0x3c'));_0x41d045['ContactId']=_0x36c5a4[_0xa9da('0x1f')];_0x41d045['ListId']=_0x36c5a4[_0xa9da('0x5a')];_0x41d045[_0xa9da('0x21')]=_0x36c5a4[_0xa9da('0x21')]||undefined;return _0x41d045;};exports[_0xa9da('0x5b')]=function(_0x200ae5,_0xa4ff88){if(!_[_0xa9da('0x1a')](_0x200ae5)){if(_0x200ae5[_0xa9da('0x5c')]>0x0){_0x200ae5[_0xa9da('0x5c')]-=0x1;}else{logger[_0xa9da('0xc')](_0xa4ff88,_0xa9da('0x5d'));}}else{logger[_0xa9da('0xc')](_0xa4ff88,_0xa9da('0x5e'));}};exports['IsNotLoggedIn']=function(_0x3f3ebb){if(_0x3f3ebb<=0x0){return!![];}return![];};exports[_0xa9da('0x5f')]=function(_0x40ea70,_0x1e8bf8,_0x2a979b){_0x40ea70['lastevent']=_0x1e8bf8;_0x40ea70[_0xa9da('0x1c')]=_0x40ea70[_0xa9da('0x60')];_0x40ea70[_0xa9da('0x61')]=_0x40ea70[_0xa9da('0x62')];_0x40ea70[_0xa9da('0x63')]=_0xa9da('0x64');if(_0x2a979b){_0x40ea70['mandatoryDisposition']=_0x2a979b[_0xa9da('0x65')];}return _0x40ea70;};exports[_0xa9da('0x66')]=function(_0x48ad7c){var _0x3aeffc={};_0x3aeffc[_0xa9da('0x60')]=_0x48ad7c[_0xa9da('0x60')];_0x3aeffc[_0xa9da('0x61')]=_0x48ad7c['channelAgent'];_0x3aeffc[_0xa9da('0x4d')]=_0x48ad7c[_0xa9da('0x4d')];return _0x3aeffc;};exports[_0xa9da('0x67')]=function(_0x3d0c65){var _0x281eae=[];for(var _0x4b5498 in _0x3d0c65){if(_0x3d0c65['hasOwnProperty'](_0x4b5498)){if(!_['isNil'](_0x3d0c65[_0x4b5498])&&_0x3d0c65[_0x4b5498][_0xa9da('0x3d')]===_0xa9da('0x68')&&_0x3d0c65[_0x4b5498][_0xa9da('0x69')]===_0xa9da('0x6a')){_0x281eae[_0xa9da('0x6b')](_0x3d0c65[_0x4b5498]['id']);}}}return _0x281eae;};exports[_0xa9da('0x6c')]=function(_0x674507){var _0x2b4845=moment()[_0xa9da('0x8')](0x0);var _0x4dd359=moment(_0x674507)[_0xa9da('0x8')](0x0);return _0x2b4845[_0xa9da('0x9')](_0x4dd359,'seconds');};exports[_0xa9da('0x6d')]=function(_0x3f5813){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x3f5813[_0xa9da('0x1f')],'ListId':_0x3f5813[_0xa9da('0x5a')],'VoiceQueueId':_0x3f5813[_0xa9da('0x21')]||undefined,'CampaignId':_0x3f5813['CampaignId']||undefined};};exports['filterKey']=function(_0x3481c7){if(_0x3481c7==='uniqueid'||_0x3481c7===_0xa9da('0x6e')||_0x3481c7==='queue'||_0x3481c7===_0xa9da('0x6f')||_0x3481c7==='campaigntype'||_0x3481c7==='dialAnswer'||_0x3481c7===_0xa9da('0x70')||_0x3481c7===_0xa9da('0x62')||_0x3481c7==='calleridname'||_0x3481c7===_0xa9da('0x57')||_0x3481c7===_0xa9da('0x1e')||_0x3481c7===_0xa9da('0x58')||_0x3481c7==='countbusyretry'||_0x3481c7===_0xa9da('0x51')||_0x3481c7===_0xa9da('0x52')||_0x3481c7===_0xa9da('0x71')||_0x3481c7===_0xa9da('0x72')||_0x3481c7===_0xa9da('0x73')||_0x3481c7==='callbackat'||_0x3481c7===_0xa9da('0x74')||_0x3481c7==='ContactId'||_0x3481c7===_0xa9da('0x5a')||_0x3481c7==='UserId'||_0x3481c7==='VoiceQueueId'||_0x3481c7===_0xa9da('0x75')||_0x3481c7===_0xa9da('0x76')||_0x3481c7==='xmd-queue'||_0x3481c7==='xmd-phone'||_0x3481c7===_0xa9da('0x77')||_0x3481c7===_0xa9da('0x78')||_0x3481c7===_0xa9da('0x79')||_0x3481c7===_0xa9da('0x7a')||_0x3481c7===_0xa9da('0x7b')||_0x3481c7===_0xa9da('0x7c')||_0x3481c7==='xmd-contactid'||_0x3481c7===_0xa9da('0x7d')||_0x3481c7==='xmd-callerid'||_0x3481c7==='xmd-agiafter'||_0x3481c7===_0xa9da('0x7e')||_0x3481c7==='rtpaudioqos'||_0x3481c7===_0xa9da('0x7f')||_0x3481c7===_0xa9da('0x80')||_0x3481c7===_0xa9da('0x81')||_0x3481c7===_0xa9da('0x82')||_0x3481c7===_0xa9da('0x83')||_0x3481c7===_0xa9da('0x84')||_0x3481c7===_0xa9da('0x85')||_0x3481c7===_0xa9da('0x86')||_0x3481c7===_0xa9da('0x7f')||_0x3481c7===_0xa9da('0x80')||_0x3481c7==='rtpaudioqosjitterbridged'||_0x3481c7==='rtpaudioqosloss'||_0x3481c7==='rtpaudioqoslossbridged'||_0x3481c7===_0xa9da('0x84')||_0x3481c7===_0xa9da('0x85')||_0x3481c7===_0xa9da('0x87')||_0x3481c7===_0xa9da('0x88')||_0x3481c7==='state'||_0x3481c7==='statedesc'){return![];}return!![];};exports[_0xa9da('0x89')]=function(_0x3a2acd,_0xf72b14){var _0xfd38a,_0x363e36,_0x31b0d7;if(_0xf72b14<=0x0){_0xf72b14=0x1;}_0xfd38a=new RegExp('\x5cw{0,'+_0xf72b14+'}$');_0x363e36=Math['pow'](0xa,_0xf72b14-0x1);_0x31b0d7=Math[_0xa9da('0x8a')](0xa,_0xf72b14)-0x1;return util[_0xa9da('0x16')]('%s',_[_0xa9da('0x8b')](_0x3a2acd,_0xfd38a,_[_0xa9da('0x8c')](_0x363e36,_0x31b0d7)));};exports[_0xa9da('0x8d')]=function(_0x5a9f7b){var _0x13c1ad=_0x5a9f7b[_0xa9da('0x8e')](/"(.*?)"/);return _0x13c1ad?_0x13c1ad[0x1]:_0x5a9f7b;};exports[_0xa9da('0x8f')]=function(_0x977f41){var _0x192323=_0x977f41[_0xa9da('0x8e')](/<(.*?)>/);return _0x192323?_0x192323[0x1]:_0x977f41;}; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index 81d28a8..2b8d12d 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 _0xc8b1=['queueremove','queuepause','voicequeuechannel','voicechannel','voicequeuechannelredirect','queueadd','string','number','boolean'];(function(_0x3e7f7b,_0x2663db){var _0x5e9cce=function(_0x4be0f1){while(--_0x4be0f1){_0x3e7f7b['push'](_0x3e7f7b['shift']());}};_0x5e9cce(++_0x2663db);}(_0xc8b1,0x17f));var _0x1c8b=function(_0x1c6003,_0x438753){_0x1c6003=_0x1c6003-0x0;var _0x2ed126=_0xc8b1[_0x1c6003];return _0x2ed126;};'use strict';exports[_0x1c8b('0x0')]={'queue':{'type':_0x1c8b('0x1'),'required':!![]},'interface':{'type':_0x1c8b('0x1'),'required':!![]},'membername':{'type':_0x1c8b('0x1'),'required':!![]},'penalty':{'type':_0x1c8b('0x2'),'required':![]},'paused':{'type':_0x1c8b('0x3'),'required':![]}};exports[_0x1c8b('0x4')]={'queue':{'type':_0x1c8b('0x1'),'required':!![]},'interface':{'type':_0x1c8b('0x1'),'required':!![]}};exports[_0x1c8b('0x5')]={'interface':{'type':_0x1c8b('0x1'),'required':!![]},'paused':{'type':_0x1c8b('0x3')},'reason':{'type':'string','required':![]}};exports['reload']={'module':{'type':_0x1c8b('0x1'),'required':![]}};exports[_0x1c8b('0x6')]={'uniqueid':{'type':_0x1c8b('0x1'),'required':!![]}};exports[_0x1c8b('0x7')]={'uniqueid':{'type':_0x1c8b('0x1'),'required':!![]},'filename':{'type':_0x1c8b('0x1')},'format':{'type':_0x1c8b('0x1')},'mixmonitorid':{'type':'string'}};exports['voicequeuechannelhangup']={'uniqueid':{'type':_0x1c8b('0x1'),'required':!![]}};exports[_0x1c8b('0x8')]={'uniqueid':{'type':_0x1c8b('0x1'),'required':!![]},'exten':{'type':_0x1c8b('0x1'),'required':!![]},'context':{'type':_0x1c8b('0x1')}}; \ No newline at end of file +var _0xd91a=['reload','voicequeuechannel','voicechannel','voicequeuechannelredirect','string','number','boolean','queuepause'];(function(_0x25c044,_0xbd05f8){var _0x558ee5=function(_0x5de5d2){while(--_0x5de5d2){_0x25c044['push'](_0x25c044['shift']());}};_0x558ee5(++_0xbd05f8);}(_0xd91a,0x1b4));var _0xad91=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd91a[_0x20a584];return _0x4b41a8;};'use strict';exports['queueadd']={'queue':{'type':_0xad91('0x0'),'required':!![]},'interface':{'type':_0xad91('0x0'),'required':!![]},'membername':{'type':_0xad91('0x0'),'required':!![]},'penalty':{'type':_0xad91('0x1'),'required':![]},'paused':{'type':_0xad91('0x2'),'required':![]}};exports['queueremove']={'queue':{'type':_0xad91('0x0'),'required':!![]},'interface':{'type':_0xad91('0x0'),'required':!![]}};exports[_0xad91('0x3')]={'interface':{'type':_0xad91('0x0'),'required':!![]},'paused':{'type':_0xad91('0x2')},'reason':{'type':_0xad91('0x0'),'required':![]}};exports[_0xad91('0x4')]={'module':{'type':_0xad91('0x0'),'required':![]}};exports[_0xad91('0x5')]={'uniqueid':{'type':_0xad91('0x0'),'required':!![]}};exports[_0xad91('0x6')]={'uniqueid':{'type':_0xad91('0x0'),'required':!![]},'filename':{'type':_0xad91('0x0')},'format':{'type':_0xad91('0x0')},'mixmonitorid':{'type':'string'}};exports['voicequeuechannelhangup']={'uniqueid':{'type':_0xad91('0x0'),'required':!![]}};exports[_0xad91('0x7')]={'uniqueid':{'type':_0xad91('0x0'),'required':!![]},'exten':{'type':_0xad91('0x0'),'required':!![]},'context':{'type':_0xad91('0x0')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index 006b48d..ec5a090 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 _0x2a39=['initTelephones','length','isUndefined','initTrunks','initTemplates','initSalesforceAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','servicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','freshsalesAccounts','merge','initVoiceQueueReports','groupBy','queue','queuecallerexit','queuecallerabandon','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallercomplete','initVoiceCallReports','outbound','duration','disposition','answered','billableseconds','initCampaigns','dialQueueProject','SquareProject','voiceExtensions','initFaxAccounts','bluebird','util','lodash','moment','../model/agent','../model/trunk','../model/trigger','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/freshsalesAccount','../model/faxAccount','telephones','trunks','voiceQueues','triggers','campaigns','templates','channels','outboundChannels','timers','settings','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','dynamics365Accounts','faxAccounts','mapKeys','hasOwnProperty','format','name','interface','SIP/%s','total','sumHoldTime','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','unmanaged','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','mergeFromDatabase','prototype','initAgents','agents'];(function(_0x359bbe,_0x5b7fcc){var _0x1b3353=function(_0x34b41c){while(--_0x34b41c){_0x359bbe['push'](_0x359bbe['shift']());}};_0x1b3353(++_0x5b7fcc);}(_0x2a39,0x91));var _0x92a3=function(_0x469687,_0x40608d){_0x469687=_0x469687-0x0;var _0x1127c9=_0x2a39[_0x469687];return _0x1127c9;};'use strict';var BPromise=require(_0x92a3('0x0'));var util=require(_0x92a3('0x1'));var _=require(_0x92a3('0x2'));var moment=require(_0x92a3('0x3'));var Agent=require(_0x92a3('0x4'));var Telephone=require('../model/telephone');var Trunk=require(_0x92a3('0x5'));var VoiceQueue=require('../model/voiceQueue');var Trigger=require(_0x92a3('0x6'));var Template=require(_0x92a3('0x7'));var Campaign=require(_0x92a3('0x8'));var VoiceExtension=require(_0x92a3('0x9'));var ZendeskAccount=require(_0x92a3('0xa'));var SalesforceAccount=require(_0x92a3('0xb'));var FreshdeskAccount=require(_0x92a3('0xc'));var SugarcrmAccount=require('../model/sugarcrmAccount');var ZohoAccount=require(_0x92a3('0xd'));var DeskAccount=require(_0x92a3('0xe'));var VtigerAccount=require(_0x92a3('0xf'));var ServicenowAccount=require('../model/servicenowAccount');var Dynamics365Account=require('../model/dynamics365Account');var FreshsalesAccount=require(_0x92a3('0x10'));var FaxAccount=require(_0x92a3('0x11'));var Realtime=function(){this['agents']={};this[_0x92a3('0x12')]={};this[_0x92a3('0x13')]={};this[_0x92a3('0x14')]={};this[_0x92a3('0x15')]={};this[_0x92a3('0x16')]={};this[_0x92a3('0x17')]={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0x92a3('0x18')]={};this['queueChannels']={};this[_0x92a3('0x19')]={};this[_0x92a3('0x1a')]={};this[_0x92a3('0x1b')]={};this[_0x92a3('0x1c')]={};this[_0x92a3('0x1d')]={};this[_0x92a3('0x1e')]={};this[_0x92a3('0x1f')]={};this[_0x92a3('0x20')]={};this[_0x92a3('0x21')]={};this[_0x92a3('0x22')]={};this['servicenowAccounts']={};this[_0x92a3('0x23')]={};this['freshsalesAccounts']={};this[_0x92a3('0x24')]={};};function freeIsNotKey(_0x282eed,_0x5691c2,_0x58fd40){var _0x22221d=_[_0x92a3('0x25')](_0x282eed,function(_0x378c10,_0x442fb8){return _0x378c10[_0x58fd40];});for(var _0x286bb5 in _0x5691c2){if(_0x5691c2[_0x92a3('0x26')](_0x286bb5)){if(!_0x22221d[_0x286bb5]){delete _0x5691c2[_0x286bb5];}}}}function freeIsNotKeySip(_0x35d773,_0x235823){var _0x4149ae=_[_0x92a3('0x25')](_0x35d773,function(_0x390e86,_0x4584b5){return util[_0x92a3('0x27')]('SIP/%s',_0x390e86[_0x92a3('0x28')]);});for(var _0x2f6583 in _0x235823){if(_0x235823[_0x92a3('0x26')](_0x2f6583)){if(!_0x4149ae[_0x2f6583]){delete _0x235823[_0x2f6583];}}}}function freeIsNotKeyAgent(_0x4cc8d1,_0x38d04f){var _0x21654b=_[_0x92a3('0x25')](_0x4cc8d1,function(_0x357b3,_0x24cb0d){var _0x525127=_['isNil'](_0x357b3[_0x92a3('0x29')])?util['format'](_0x92a3('0x2a'),_0x357b3['name']):_0x357b3['interface'];return _0x525127;});for(var _0x9a7bd4 in _0x38d04f){if(_0x38d04f[_0x92a3('0x26')](_0x9a7bd4)){if(!_0x21654b[_0x9a7bd4]){delete _0x38d04f[_0x9a7bd4];}}}}function clearVoiceCallReports(_0x4d928a){_0x4d928a[_0x92a3('0x2b')]=0x0;_0x4d928a['answered']=0x0;_0x4d928a[_0x92a3('0x2c')]=0x0;_0x4d928a[_0x92a3('0x2d')]=0x0;_0x4d928a[_0x92a3('0x2e')]=0x0;}function clearCampaigns(_0x312be1){if(!_[_0x92a3('0x2f')](_0x312be1)){for(var _0x3d8f37 in _0x312be1){if(_0x312be1[_0x92a3('0x26')](_0x3d8f37)){_0x312be1[_0x3d8f37][_0x92a3('0x30')]=0x0;_0x312be1[_0x3d8f37][_0x92a3('0x31')]=0x0;}}}}function clearVoiceQueues(_0x5248e7){if(!_[_0x92a3('0x2f')](_0x5248e7)){for(var _0x415dad in _0x5248e7){if(_0x5248e7[_0x92a3('0x26')](_0x415dad)){_0x5248e7[_0x415dad]['total']=0x0;_0x5248e7[_0x415dad]['answered']=0x0;_0x5248e7[_0x415dad][_0x92a3('0x32')]=0x0;_0x5248e7[_0x415dad]['abandoned']=0x0;_0x5248e7[_0x415dad]['sumHoldTime']=0x0;_0x5248e7[_0x415dad][_0x92a3('0x2d')]=0x0;_0x5248e7[_0x415dad][_0x92a3('0x2e')]=0x0;_0x5248e7[_0x415dad][_0x92a3('0x33')]=0x0;_0x5248e7[_0x415dad][_0x92a3('0x34')]=0x0;_0x5248e7[_0x415dad][_0x92a3('0x35')]=0x0;_0x5248e7[_0x415dad][_0x92a3('0x36')]=0x0;_0x5248e7[_0x415dad][_0x92a3('0x37')]=0x0;_0x5248e7[_0x415dad][_0x92a3('0x38')]=0x0;_0x5248e7[_0x415dad][_0x92a3('0x39')]=0x0;_0x5248e7[_0x415dad][_0x92a3('0x3a')]=0x0;_0x5248e7[_0x415dad][_0x92a3('0x3b')]=0x0;_0x5248e7[_0x415dad][_0x92a3('0x3c')]=0x0;_0x5248e7[_0x415dad][_0x92a3('0x3d')]=0x0;_0x5248e7[_0x415dad][_0x92a3('0x3e')]=0x0;_0x5248e7[_0x415dad]['outboundAnswerAgiCallsDay']=0x0;_0x5248e7[_0x415dad][_0x92a3('0x3f')]=0x0;_0x5248e7[_0x415dad][_0x92a3('0x40')]=!![];}}}}Realtime['prototype'][_0x92a3('0x41')]=function(_0x30e562,_0x36aafd){for(var _0x17c321 in _0x36aafd){if(_0x30e562[_0x92a3('0x26')](_0x17c321)){_0x30e562[_0x17c321]=_0x36aafd[_0x17c321];}}};Realtime[_0x92a3('0x42')][_0x92a3('0x43')]=function(){var _0x7d4aad=this;return function(_0x38934f){if(_0x38934f){freeIsNotKeyAgent(_0x38934f,_0x7d4aad[_0x92a3('0x44')]);for(var _0x53919d=0x0,_0x56231b={},_0xd47a04={};_0x53919d<_0x38934f['length'];_0x53919d+=0x1){_0x56231b=_0x38934f[_0x53919d];var _0xfe159b=_['isNil'](_0x56231b[_0x92a3('0x29')])?util[_0x92a3('0x27')](_0x92a3('0x2a'),_0x56231b[_0x92a3('0x28')]):_0x56231b[_0x92a3('0x29')];if(_['isUndefined'](_0x7d4aad['agents'][_0xfe159b])){_0x7d4aad[_0x92a3('0x44')][_0xfe159b]=new Agent(_0x56231b);}else{_0x7d4aad[_0x92a3('0x41')](_0x7d4aad[_0x92a3('0x44')][_0xfe159b],_0x56231b);}}}return _0x7d4aad[_0x92a3('0x44')];};};Realtime[_0x92a3('0x42')][_0x92a3('0x45')]=function(){var _0x54afe1=this;return function(_0x5c1d5f){if(_0x5c1d5f){freeIsNotKeySip(_0x5c1d5f,_0x54afe1[_0x92a3('0x12')]);for(var _0x4781ad=0x0,_0x443a03={},_0x312362={};_0x4781ad<_0x5c1d5f[_0x92a3('0x46')];_0x4781ad+=0x1){_0x443a03=_0x5c1d5f[_0x4781ad];if(_[_0x92a3('0x47')](_0x54afe1['telephones'][util[_0x92a3('0x27')](_0x92a3('0x2a'),_0x443a03[_0x92a3('0x28')])])){_0x54afe1[_0x92a3('0x12')][util['format'](_0x92a3('0x2a'),_0x443a03['name'])]=new Telephone(_0x443a03);}else{_0x54afe1[_0x92a3('0x41')](_0x54afe1['telephones'][util[_0x92a3('0x27')](_0x92a3('0x2a'),_0x443a03[_0x92a3('0x28')])],_0x443a03);}}}return _0x54afe1[_0x92a3('0x12')];};};Realtime[_0x92a3('0x42')][_0x92a3('0x48')]=function(){var _0x2022e8=this;return function(_0x33d905){if(_0x33d905){freeIsNotKeySip(_0x33d905,_0x2022e8[_0x92a3('0x13')]);for(var _0x359bb9=0x0,_0x1b7940={},_0x2dd266={};_0x359bb9<_0x33d905[_0x92a3('0x46')];_0x359bb9+=0x1){_0x1b7940=_0x33d905[_0x359bb9];if(_['isUndefined'](_0x2022e8[_0x92a3('0x13')][util[_0x92a3('0x27')](_0x92a3('0x2a'),_0x1b7940[_0x92a3('0x28')])])){_0x2022e8[_0x92a3('0x13')][util[_0x92a3('0x27')](_0x92a3('0x2a'),_0x1b7940['name'])]=new Trunk(_0x1b7940);}else{_0x2022e8[_0x92a3('0x41')](_0x2022e8[_0x92a3('0x13')][util[_0x92a3('0x27')]('SIP/%s',_0x1b7940[_0x92a3('0x28')])],_0x1b7940);}}}return _0x2022e8[_0x92a3('0x13')];};};Realtime[_0x92a3('0x42')]['initVoiceQueues']=function(){var _0x3968fe=this;return function(_0x1fb7e1){if(_0x1fb7e1){freeIsNotKey(_0x1fb7e1,_0x3968fe[_0x92a3('0x14')],'name');for(var _0x2afc7e=0x0,_0x8464c8={},_0x752725={};_0x2afc7e<_0x1fb7e1[_0x92a3('0x46')];_0x2afc7e+=0x1){_0x8464c8=_0x1fb7e1[_0x2afc7e];if(_[_0x92a3('0x47')](_0x3968fe[_0x92a3('0x14')][_0x8464c8[_0x92a3('0x28')]])){_0x3968fe['voiceQueues'][_0x8464c8[_0x92a3('0x28')]]=new VoiceQueue(_0x8464c8);}else{_0x3968fe[_0x92a3('0x41')](_0x3968fe[_0x92a3('0x14')][_0x8464c8[_0x92a3('0x28')]],_0x8464c8);}}}return _0x3968fe[_0x92a3('0x14')];};};Realtime['prototype']['initTriggers']=function(){var _0x26287a=this;return function(_0x3e2db2){if(_0x3e2db2){freeIsNotKey(_0x3e2db2,_0x26287a['triggers'],'id');for(var _0xfbf807=0x0,_0x1d09a7={},_0x3fd683={};_0xfbf807<_0x3e2db2['length'];_0xfbf807+=0x1){_0x1d09a7=_0x3e2db2[_0xfbf807];if(_[_0x92a3('0x47')](_0x26287a[_0x92a3('0x15')][_0x1d09a7['id']])){_0x26287a[_0x92a3('0x15')][_0x1d09a7['id']]=new Trigger(_0x1d09a7);}else{_0x26287a[_0x92a3('0x41')](_0x26287a['triggers'][_0x1d09a7['id']],_0x1d09a7);}}}return _0x26287a[_0x92a3('0x15')];};};Realtime['prototype'][_0x92a3('0x49')]=function(){var _0x54e5a4=this;return function(_0x10af79){if(_0x10af79){freeIsNotKey(_0x10af79,_0x54e5a4[_0x92a3('0x17')],'id');for(var _0x1ab761=0x0,_0x16a2b4={},_0x20f10e={};_0x1ab761<_0x10af79[_0x92a3('0x46')];_0x1ab761+=0x1){_0x16a2b4=_0x10af79[_0x1ab761];if(_[_0x92a3('0x47')](_0x54e5a4[_0x92a3('0x17')][_0x16a2b4['id']])){_0x54e5a4[_0x92a3('0x17')][_0x16a2b4['id']]=new Template(_0x16a2b4);}else{_0x54e5a4[_0x92a3('0x41')](_0x54e5a4[_0x92a3('0x17')][_0x16a2b4['id']],_0x16a2b4);}}}return _0x54e5a4['templates'];};};Realtime['prototype']['initZendeskAccounts']=function(){var _0x511a3b=this;return function(_0x5988b8){if(_0x5988b8){freeIsNotKey(_0x5988b8,_0x511a3b['zendeskAccounts'],'id');for(var _0x27338e=0x0,_0x2399bb={},_0x45b47c={};_0x27338e<_0x5988b8['length'];_0x27338e+=0x1){_0x2399bb=_0x5988b8[_0x27338e];if(_[_0x92a3('0x47')](_0x511a3b[_0x92a3('0x1c')][_0x2399bb['id']])){_0x511a3b['zendeskAccounts'][_0x2399bb['id']]=new ZendeskAccount(_0x2399bb);}else{_0x511a3b[_0x92a3('0x41')](_0x511a3b[_0x92a3('0x1c')][_0x2399bb['id']],_0x2399bb);}}}return _0x511a3b[_0x92a3('0x1c')];};};Realtime['prototype'][_0x92a3('0x4a')]=function(){var _0x153502=this;return function(_0x4dde29){if(_0x4dde29){freeIsNotKey(_0x4dde29,_0x153502['salesforceAccounts'],'id');for(var _0x2940c2=0x0,_0x2aadd6={},_0x815f76={};_0x2940c2<_0x4dde29[_0x92a3('0x46')];_0x2940c2+=0x1){_0x2aadd6=_0x4dde29[_0x2940c2];if(_['isUndefined'](_0x153502[_0x92a3('0x1d')][_0x2aadd6['id']])){_0x153502[_0x92a3('0x1d')][_0x2aadd6['id']]=new SalesforceAccount(_0x2aadd6);}else{_0x153502[_0x92a3('0x41')](_0x153502[_0x92a3('0x1d')][_0x2aadd6['id']],_0x2aadd6);}}}return _0x153502[_0x92a3('0x1d')];};};Realtime[_0x92a3('0x42')]['initFreshdeskAccounts']=function(){var _0x3b8d49=this;return function(_0x313222){if(_0x313222){freeIsNotKey(_0x313222,_0x3b8d49[_0x92a3('0x1f')],'id');for(var _0x17d751=0x0,_0x7ad466={},_0x2540e8={};_0x17d751<_0x313222[_0x92a3('0x46')];_0x17d751+=0x1){_0x7ad466=_0x313222[_0x17d751];if(_[_0x92a3('0x47')](_0x3b8d49['freshdeskAccounts'][_0x7ad466['id']])){_0x3b8d49['freshdeskAccounts'][_0x7ad466['id']]=new FreshdeskAccount(_0x7ad466);}else{_0x3b8d49[_0x92a3('0x41')](_0x3b8d49['freshdeskAccounts'][_0x7ad466['id']],_0x7ad466);}}}return _0x3b8d49['freshdeskAccounts'];};};Realtime[_0x92a3('0x42')]['initZohoAccounts']=function(){var _0x4aa6c2=this;return function(_0x5bf2bf){if(_0x5bf2bf){freeIsNotKey(_0x5bf2bf,_0x4aa6c2[_0x92a3('0x20')],'id');for(var _0x5995aa=0x0,_0x38de75={},_0x4a6a73={};_0x5995aa<_0x5bf2bf[_0x92a3('0x46')];_0x5995aa+=0x1){_0x38de75=_0x5bf2bf[_0x5995aa];if(_[_0x92a3('0x47')](_0x4aa6c2['zohoAccounts'][_0x38de75['id']])){_0x4aa6c2['zohoAccounts'][_0x38de75['id']]=new ZohoAccount(_0x38de75);}else{_0x4aa6c2['mergeFromDatabase'](_0x4aa6c2[_0x92a3('0x20')][_0x38de75['id']],_0x38de75);}}}return _0x4aa6c2['zohoAccounts'];};};Realtime[_0x92a3('0x42')][_0x92a3('0x4b')]=function(){var _0xbd71a7=this;return function(_0x51a8b5){if(_0x51a8b5){freeIsNotKey(_0x51a8b5,_0xbd71a7[_0x92a3('0x21')],'id');for(var _0x563ed5=0x0,_0x3b0cb1={},_0x2a5197={};_0x563ed5<_0x51a8b5[_0x92a3('0x46')];_0x563ed5+=0x1){_0x3b0cb1=_0x51a8b5[_0x563ed5];if(_[_0x92a3('0x47')](_0xbd71a7[_0x92a3('0x21')][_0x3b0cb1['id']])){_0xbd71a7[_0x92a3('0x21')][_0x3b0cb1['id']]=new DeskAccount(_0x3b0cb1);}else{_0xbd71a7['mergeFromDatabase'](_0xbd71a7['deskAccounts'][_0x3b0cb1['id']],_0x3b0cb1);}}}return _0xbd71a7[_0x92a3('0x21')];};};Realtime[_0x92a3('0x42')][_0x92a3('0x4c')]=function(){var _0x1e7ba8=this;return function(_0x3e0002){if(_0x3e0002){freeIsNotKey(_0x3e0002,_0x1e7ba8['sugarcrmAccounts'],'id');for(var _0x53ba70=0x0,_0xe58137={},_0x1a4430={};_0x53ba70<_0x3e0002[_0x92a3('0x46')];_0x53ba70+=0x1){_0xe58137=_0x3e0002[_0x53ba70];if(_[_0x92a3('0x47')](_0x1e7ba8[_0x92a3('0x1e')][_0xe58137['id']])){_0x1e7ba8[_0x92a3('0x1e')][_0xe58137['id']]=new SugarcrmAccount(_0xe58137);}else{_0x1e7ba8[_0x92a3('0x41')](_0x1e7ba8['sugarcrmAccounts'][_0xe58137['id']],_0xe58137);}}}return _0x1e7ba8[_0x92a3('0x1e')];};};Realtime[_0x92a3('0x42')][_0x92a3('0x4d')]=function(){var _0x4b15a2=this;return function(_0xa399a9){if(_0xa399a9){freeIsNotKey(_0xa399a9,_0x4b15a2[_0x92a3('0x22')],'id');for(var _0x5cdaf5=0x0,_0x3955e8={},_0x347cbb={};_0x5cdaf5<_0xa399a9[_0x92a3('0x46')];_0x5cdaf5+=0x1){_0x3955e8=_0xa399a9[_0x5cdaf5];if(_[_0x92a3('0x47')](_0x4b15a2[_0x92a3('0x22')][_0x3955e8['id']])){_0x4b15a2['vtigerAccounts'][_0x3955e8['id']]=new VtigerAccount(_0x3955e8);}else{_0x4b15a2[_0x92a3('0x41')](_0x4b15a2[_0x92a3('0x22')][_0x3955e8['id']],_0x3955e8);}}}return _0x4b15a2[_0x92a3('0x22')];};};Realtime[_0x92a3('0x42')][_0x92a3('0x4e')]=function(){var _0x1a6b61=this;return function(_0x2c45fd){if(_0x2c45fd){freeIsNotKey(_0x2c45fd,_0x1a6b61[_0x92a3('0x4f')],'id');for(var _0x1a274b=0x0,_0x509f54={},_0x3c057f={};_0x1a274b<_0x2c45fd['length'];_0x1a274b+=0x1){_0x509f54=_0x2c45fd[_0x1a274b];if(_[_0x92a3('0x47')](_0x1a6b61[_0x92a3('0x4f')][_0x509f54['id']])){_0x1a6b61[_0x92a3('0x4f')][_0x509f54['id']]=new ServicenowAccount(_0x509f54);}else{_0x1a6b61[_0x92a3('0x41')](_0x1a6b61['servicenowAccounts'][_0x509f54['id']],_0x509f54);}}}return _0x1a6b61[_0x92a3('0x4f')];};};Realtime[_0x92a3('0x42')][_0x92a3('0x50')]=function(){var _0x261555=this;return function(_0x2aae62){if(_0x2aae62){freeIsNotKey(_0x2aae62,_0x261555[_0x92a3('0x23')],'id');for(var _0x4dd4c1=0x0,_0x325582={},_0x498313={};_0x4dd4c1<_0x2aae62[_0x92a3('0x46')];_0x4dd4c1+=0x1){_0x325582=_0x2aae62[_0x4dd4c1];if(_[_0x92a3('0x47')](_0x261555['dynamics365Accounts'][_0x325582['id']])){_0x261555[_0x92a3('0x23')][_0x325582['id']]=new Dynamics365Account(_0x325582);}else{_0x261555['mergeFromDatabase'](_0x261555['dynamics365Accounts'][_0x325582['id']],_0x325582);}}}return _0x261555[_0x92a3('0x23')];};};Realtime[_0x92a3('0x42')][_0x92a3('0x51')]=function(){var _0x3de503=this;return function(_0x196be5){if(_0x196be5){freeIsNotKey(_0x196be5,_0x3de503[_0x92a3('0x52')],'id');for(var _0x1b2b18=0x0,_0x1fe2d5={},_0x4fdf80={};_0x1b2b18<_0x196be5[_0x92a3('0x46')];_0x1b2b18+=0x1){_0x1fe2d5=_0x196be5[_0x1b2b18];if(_[_0x92a3('0x47')](_0x3de503[_0x92a3('0x52')][_0x1fe2d5['id']])){_0x3de503[_0x92a3('0x52')][_0x1fe2d5['id']]=new FreshsalesAccount(_0x1fe2d5);}else{_0x3de503[_0x92a3('0x41')](_0x3de503[_0x92a3('0x52')][_0x1fe2d5['id']],_0x1fe2d5);}}}return _0x3de503['freshsalesAccounts'];};};Realtime['prototype']['initVoiceQueueHopperHistory']=function(){var _0x2a40b4=this;return function(_0xd08e0){for(var _0x2fd91=0x0;_0x2fd91<_0xd08e0[_0x92a3('0x46')];_0x2fd91+=0x1){_[_0x92a3('0x53')](_0x2a40b4[_0x92a3('0x14')][_0xd08e0[_0x2fd91]['name']],_0xd08e0[_0x2fd91]);}return _0x2a40b4[_0x92a3('0x14')];};};Realtime[_0x92a3('0x42')][_0x92a3('0x54')]=function(){var _0x46d879=this;return function(_0x5766f8){clearVoiceQueues(_0x46d879['voiceQueues']);if(_0x5766f8){_0x5766f8=_[_0x92a3('0x55')](_0x5766f8,'uniqueid');for(var _0x2fabc2 in _0x5766f8){if(_0x5766f8[_0x92a3('0x26')](_0x2fabc2)){var _0x3b08ca={};for(var _0x44fac9=0x0;_0x44fac9<_0x5766f8[_0x2fabc2][_0x92a3('0x46')];_0x44fac9+=0x1){var _0x26f7ae=_0x5766f8[_0x2fabc2][_0x44fac9][_0x92a3('0x56')];if(_0x46d879['voiceQueues'][_0x26f7ae]){if(_0x5766f8[_0x2fabc2][_0x44fac9][_0x92a3('0x57')]){_0x46d879[_0x92a3('0x14')][_0x26f7ae][_0x92a3('0x32')]+=0x1;}if(_0x5766f8[_0x2fabc2][_0x44fac9][_0x92a3('0x58')]){_0x46d879[_0x92a3('0x14')][_0x26f7ae]['abandoned']+=0x1;}_0x46d879[_0x92a3('0x14')][_0x26f7ae][_0x92a3('0x2c')]+=moment(_0x5766f8[_0x2fabc2][_0x44fac9][_0x92a3('0x59')])[_0x92a3('0x5a')](moment(_0x5766f8[_0x2fabc2][_0x44fac9][_0x92a3('0x5b')]),_0x92a3('0x5c'))||0x0;if(_0x44fac9===_0x5766f8[_0x2fabc2]['length']-0x1){_0x46d879[_0x92a3('0x14')][_0x26f7ae]['sumDuration']+=moment(_0x5766f8[_0x2fabc2][_0x44fac9][_0x92a3('0x5d')]||_0x5766f8[_0x2fabc2][_0x44fac9][_0x92a3('0x5e')]||_0x5766f8[_0x2fabc2][_0x44fac9]['queuecallerexitAt'])['diff'](moment(_0x5766f8[_0x2fabc2][_0x44fac9]['queuecallerjoinAt']),'seconds')||0x0;_0x46d879[_0x92a3('0x14')][_0x26f7ae][_0x92a3('0x2b')]+=0x1;if(_0x5766f8[_0x2fabc2][_0x44fac9][_0x92a3('0x5f')]){_0x46d879[_0x92a3('0x14')][_0x26f7ae]['answered']+=0x1;_0x46d879[_0x92a3('0x14')][_0x26f7ae][_0x92a3('0x2e')]+=moment(_0x5766f8[_0x2fabc2][_0x44fac9][_0x92a3('0x5d')])[_0x92a3('0x5a')](moment(_0x5766f8[_0x2fabc2][_0x44fac9][_0x92a3('0x59')]),_0x92a3('0x5c'))||0x0;}}else{_0x46d879[_0x92a3('0x14')][_0x26f7ae][_0x92a3('0x2d')]+=_0x46d879[_0x92a3('0x14')][_0x26f7ae][_0x92a3('0x2c')]||0x0;}}}}}}return _0x46d879[_0x92a3('0x14')];};};Realtime[_0x92a3('0x42')][_0x92a3('0x60')]=function(){var _0x2807ae=this;return function(_0x36f839){clearVoiceCallReports(_0x2807ae[_0x92a3('0x61')]);if(_0x36f839){for(var _0x155091=0x0;_0x155091<_0x36f839['length'];_0x155091+=0x1){_0x2807ae['outbound'][_0x92a3('0x2b')]+=0x1;_0x2807ae[_0x92a3('0x61')][_0x92a3('0x2d')]+=_0x36f839[_0x155091][_0x92a3('0x62')];if(_0x36f839[_0x155091][_0x92a3('0x63')]==='ANSWERED'){_0x2807ae[_0x92a3('0x61')][_0x92a3('0x64')]+=0x1;_0x2807ae[_0x92a3('0x61')][_0x92a3('0x2c')]+=_0x36f839[_0x155091][_0x92a3('0x62')]-_0x36f839[_0x155091]['billableseconds']||0x0;_0x2807ae['outbound'][_0x92a3('0x2e')]+=_0x36f839[_0x155091][_0x92a3('0x65')];}}}return _0x2807ae[_0x92a3('0x61')];};};Realtime[_0x92a3('0x42')][_0x92a3('0x66')]=function(){var _0x4c9167=this;return function(_0x4ae85f){if(_0x4ae85f){freeIsNotKey(_0x4ae85f,_0x4c9167[_0x92a3('0x16')],'name');for(var _0xc49bea=0x0,_0x486908={};_0xc49bea<_0x4ae85f[_0x92a3('0x46')];_0xc49bea+=0x1){_0x486908=_0x4ae85f[_0xc49bea];if(_[_0x92a3('0x47')](_0x4c9167[_0x92a3('0x16')][_0x486908[_0x92a3('0x28')]])){_0x4c9167['campaigns'][_0x486908['name']]=new Campaign(_0x486908);}else{_0x4c9167[_0x92a3('0x41')](_0x4c9167['campaigns'][_0x486908[_0x92a3('0x28')]],_0x486908);_0x4c9167[_0x92a3('0x16')][_0x486908[_0x92a3('0x28')]][_0x92a3('0x67')]=_0x486908[_0x92a3('0x68')]?_0x486908[_0x92a3('0x68')][_0x92a3('0x28')]:undefined;}}}return _0x4c9167[_0x92a3('0x16')];};};Realtime[_0x92a3('0x42')]['initVoiceExtensions']=function(){var _0x527f1e=this;return function(_0x429476){if(_0x429476){freeIsNotKey(_0x429476,_0x527f1e[_0x92a3('0x69')],'id');for(var _0x2db122=0x0,_0x370f05={};_0x2db122<_0x429476[_0x92a3('0x46')];_0x2db122+=0x1){_0x370f05=_0x429476[_0x2db122];if(_[_0x92a3('0x47')](_0x527f1e[_0x92a3('0x69')][_0x370f05['id']])){_0x527f1e[_0x92a3('0x69')][_0x370f05['id']]=new VoiceExtension(_0x370f05);}else{_0x527f1e[_0x92a3('0x41')](_0x527f1e['voiceExtensions'][_0x370f05['id']],_0x370f05);}}}return _0x527f1e[_0x92a3('0x69')];};};Realtime[_0x92a3('0x42')]['initCampaignHopperHistory']=function(){var _0x227f13=this;return function(_0x5edfc2){clearCampaigns(_0x227f13[_0x92a3('0x16')]);for(var _0x43ce46=0x0;_0x43ce46<_0x5edfc2[_0x92a3('0x46')];_0x43ce46+=0x1){_[_0x92a3('0x53')](_0x227f13[_0x92a3('0x16')][_0x5edfc2[_0x43ce46]['name']],_0x5edfc2[_0x43ce46]);}return _0x227f13[_0x92a3('0x16')];};};Realtime['prototype'][_0x92a3('0x6a')]=function(){var _0x149ea0=this;return function(_0x588e38){if(_0x588e38){freeIsNotKey(_0x588e38,_0x149ea0[_0x92a3('0x24')],'id');for(var _0x5c38e2=0x0,_0x3b633f={},_0x16edf6={};_0x5c38e2<_0x588e38[_0x92a3('0x46')];_0x5c38e2+=0x1){_0x3b633f=_0x588e38[_0x5c38e2];if(_[_0x92a3('0x47')](_0x149ea0[_0x92a3('0x24')][_0x3b633f['id']])){_0x149ea0[_0x92a3('0x24')][_0x3b633f['id']]=new FaxAccount(_0x3b633f);}else{_0x149ea0[_0x92a3('0x41')](_0x149ea0['faxAccounts'][_0x3b633f['id']],_0x3b633f);}}}return _0x149ea0['faxAccounts'];};};module['exports']=Realtime; \ No newline at end of file +var _0x4444=['sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','total','unmanaged','abandoned','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundDropCallsDayTimeout','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','mergeFromDatabase','isUndefined','initTelephones','telephones','length','initTrunks','voiceQueues','initTriggers','triggers','initTemplates','templates','initZendeskAccounts','zendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','initDeskAccounts','initSugarcrmAccounts','sugarcrmAccounts','initServicenowAccounts','servicenowAccounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','groupBy','queuecallerabandon','diff','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','queuecallercomplete','queuecallerleaveAt','duration','disposition','ANSWERED','billableseconds','initCampaigns','dialQueueProject','SquareProject','initCampaignHopperHistory','moment','../model/agent','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/campaign','../model/voiceExtension','../model/salesforceAccount','../model/freshdeskAccount','../model/deskAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','agents','trunks','campaigns','outbound','voiceExtensions','channels','queueChannels','settings','salesforceAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','format','SIP/%s','name','hasOwnProperty','isNil','interface','answered','sumHoldTime'];(function(_0x132610,_0x521f72){var _0x4a9b42=function(_0x4ac8e5){while(--_0x4ac8e5){_0x132610['push'](_0x132610['shift']());}};_0x4a9b42(++_0x521f72);}(_0x4444,0x102));var _0x4444=function(_0x144b16,_0x528837){_0x144b16=_0x144b16-0x0;var _0x50369d=_0x4444[_0x144b16];return _0x50369d;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require('lodash');var moment=require(_0x4444('0x0'));var Agent=require(_0x4444('0x1'));var Telephone=require(_0x4444('0x2'));var Trunk=require(_0x4444('0x3'));var VoiceQueue=require(_0x4444('0x4'));var Trigger=require(_0x4444('0x5'));var Template=require('../model/template');var Campaign=require(_0x4444('0x6'));var VoiceExtension=require(_0x4444('0x7'));var ZendeskAccount=require('../model/zendeskAccount');var SalesforceAccount=require(_0x4444('0x8'));var FreshdeskAccount=require(_0x4444('0x9'));var SugarcrmAccount=require('../model/sugarcrmAccount');var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require(_0x4444('0xa'));var VtigerAccount=require('../model/vtigerAccount');var ServicenowAccount=require(_0x4444('0xb'));var Dynamics365Account=require(_0x4444('0xc'));var FreshsalesAccount=require(_0x4444('0xd'));var FaxAccount=require('../model/faxAccount');var Realtime=function(){this[_0x4444('0xe')]={};this['telephones']={};this[_0x4444('0xf')]={};this['voiceQueues']={};this['triggers']={};this[_0x4444('0x10')]={};this['templates']={};this[_0x4444('0x11')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x4444('0x12')]={};this[_0x4444('0x13')]={};this[_0x4444('0x14')]={};this['outboundChannels']={};this['timers']={};this[_0x4444('0x15')]={};this['zendeskAccounts']={};this[_0x4444('0x16')]={};this['sugarcrmAccounts']={};this[_0x4444('0x17')]={};this[_0x4444('0x18')]={};this[_0x4444('0x19')]={};this[_0x4444('0x1a')]={};this['servicenowAccounts']={};this[_0x4444('0x1b')]={};this[_0x4444('0x1c')]={};this[_0x4444('0x1d')]={};};function freeIsNotKey(_0x53ea15,_0x141235,_0x3f9b3a){var _0x280489=_[_0x4444('0x1e')](_0x53ea15,function(_0x20d801,_0x43fd1e){return _0x20d801[_0x3f9b3a];});for(var _0x387a6f in _0x141235){if(_0x141235['hasOwnProperty'](_0x387a6f)){if(!_0x280489[_0x387a6f]){delete _0x141235[_0x387a6f];}}}}function freeIsNotKeySip(_0x30f7b7,_0x1ccc31){var _0x519a17=_['mapKeys'](_0x30f7b7,function(_0x2ee6c4,_0x5c9866){return util[_0x4444('0x1f')](_0x4444('0x20'),_0x2ee6c4[_0x4444('0x21')]);});for(var _0x1ad8f6 in _0x1ccc31){if(_0x1ccc31[_0x4444('0x22')](_0x1ad8f6)){if(!_0x519a17[_0x1ad8f6]){delete _0x1ccc31[_0x1ad8f6];}}}}function freeIsNotKeyAgent(_0x183575,_0x5690db){var _0x4f0218=_[_0x4444('0x1e')](_0x183575,function(_0x4ba7fb,_0x447db9){var _0x20b858=_[_0x4444('0x23')](_0x4ba7fb[_0x4444('0x24')])?util[_0x4444('0x1f')]('SIP/%s',_0x4ba7fb[_0x4444('0x21')]):_0x4ba7fb[_0x4444('0x24')];return _0x20b858;});for(var _0x3458e9 in _0x5690db){if(_0x5690db[_0x4444('0x22')](_0x3458e9)){if(!_0x4f0218[_0x3458e9]){delete _0x5690db[_0x3458e9];}}}}function clearVoiceCallReports(_0xeb26a2){_0xeb26a2['total']=0x0;_0xeb26a2[_0x4444('0x25')]=0x0;_0xeb26a2[_0x4444('0x26')]=0x0;_0xeb26a2[_0x4444('0x27')]=0x0;_0xeb26a2[_0x4444('0x28')]=0x0;}function clearCampaigns(_0x12eed6){if(!_[_0x4444('0x29')](_0x12eed6)){for(var _0x4dd34a in _0x12eed6){if(_0x12eed6[_0x4444('0x22')](_0x4dd34a)){_0x12eed6[_0x4dd34a][_0x4444('0x2a')]=0x0;_0x12eed6[_0x4dd34a][_0x4444('0x2b')]=0x0;}}}}function clearVoiceQueues(_0x2ea862){if(!_[_0x4444('0x29')](_0x2ea862)){for(var _0x4331fe in _0x2ea862){if(_0x2ea862['hasOwnProperty'](_0x4331fe)){_0x2ea862[_0x4331fe][_0x4444('0x2c')]=0x0;_0x2ea862[_0x4331fe][_0x4444('0x25')]=0x0;_0x2ea862[_0x4331fe][_0x4444('0x2d')]=0x0;_0x2ea862[_0x4331fe][_0x4444('0x2e')]=0x0;_0x2ea862[_0x4331fe]['sumHoldTime']=0x0;_0x2ea862[_0x4331fe]['sumDuration']=0x0;_0x2ea862[_0x4331fe][_0x4444('0x28')]=0x0;_0x2ea862[_0x4331fe][_0x4444('0x2f')]=0x0;_0x2ea862[_0x4331fe]['outboundNoAnswerCallsDay']=0x0;_0x2ea862[_0x4331fe][_0x4444('0x30')]=0x0;_0x2ea862[_0x4331fe]['outboundCongestionCallsDay']=0x0;_0x2ea862[_0x4331fe]['outboundNoSuchCallsDay']=0x0;_0x2ea862[_0x4331fe]['outboundUnknownCallsDay']=0x0;_0x2ea862[_0x4331fe][_0x4444('0x31')]=0x0;_0x2ea862[_0x4331fe]['outboundDropCallsDayCallersExit']=0x0;_0x2ea862[_0x4331fe][_0x4444('0x32')]=0x0;_0x2ea862[_0x4331fe][_0x4444('0x33')]=0x0;_0x2ea862[_0x4331fe][_0x4444('0x34')]=0x0;_0x2ea862[_0x4331fe][_0x4444('0x35')]=0x0;_0x2ea862[_0x4331fe][_0x4444('0x2f')]=0x0;_0x2ea862[_0x4331fe][_0x4444('0x36')]=0x0;_0x2ea862[_0x4331fe][_0x4444('0x37')]=!![];}}}}Realtime[_0x4444('0x38')][_0x4444('0x39')]=function(_0x381680,_0x204dd7){for(var _0x398c6e in _0x204dd7){if(_0x381680[_0x4444('0x22')](_0x398c6e)){_0x381680[_0x398c6e]=_0x204dd7[_0x398c6e];}}};Realtime['prototype']['initAgents']=function(){var _0x49c522=this;return function(_0x2b0ce8){if(_0x2b0ce8){freeIsNotKeyAgent(_0x2b0ce8,_0x49c522[_0x4444('0xe')]);for(var _0x5dc3a3=0x0,_0x170e1f={},_0x57f5cd={};_0x5dc3a3<_0x2b0ce8['length'];_0x5dc3a3+=0x1){_0x170e1f=_0x2b0ce8[_0x5dc3a3];var _0x46d781=_[_0x4444('0x23')](_0x170e1f[_0x4444('0x24')])?util[_0x4444('0x1f')](_0x4444('0x20'),_0x170e1f[_0x4444('0x21')]):_0x170e1f[_0x4444('0x24')];if(_[_0x4444('0x3a')](_0x49c522[_0x4444('0xe')][_0x46d781])){_0x49c522['agents'][_0x46d781]=new Agent(_0x170e1f);}else{_0x49c522['mergeFromDatabase'](_0x49c522[_0x4444('0xe')][_0x46d781],_0x170e1f);}}}return _0x49c522[_0x4444('0xe')];};};Realtime[_0x4444('0x38')][_0x4444('0x3b')]=function(){var _0x39626b=this;return function(_0x5ca9aa){if(_0x5ca9aa){freeIsNotKeySip(_0x5ca9aa,_0x39626b[_0x4444('0x3c')]);for(var _0x37abd8=0x0,_0x3d0050={},_0x21218d={};_0x37abd8<_0x5ca9aa[_0x4444('0x3d')];_0x37abd8+=0x1){_0x3d0050=_0x5ca9aa[_0x37abd8];if(_[_0x4444('0x3a')](_0x39626b['telephones'][util['format']('SIP/%s',_0x3d0050['name'])])){_0x39626b['telephones'][util[_0x4444('0x1f')](_0x4444('0x20'),_0x3d0050[_0x4444('0x21')])]=new Telephone(_0x3d0050);}else{_0x39626b[_0x4444('0x39')](_0x39626b['telephones'][util[_0x4444('0x1f')]('SIP/%s',_0x3d0050[_0x4444('0x21')])],_0x3d0050);}}}return _0x39626b[_0x4444('0x3c')];};};Realtime[_0x4444('0x38')][_0x4444('0x3e')]=function(){var _0x46a563=this;return function(_0x50f59e){if(_0x50f59e){freeIsNotKeySip(_0x50f59e,_0x46a563['trunks']);for(var _0xcbf297=0x0,_0x5e0037={},_0x8ab30={};_0xcbf297<_0x50f59e['length'];_0xcbf297+=0x1){_0x5e0037=_0x50f59e[_0xcbf297];if(_[_0x4444('0x3a')](_0x46a563[_0x4444('0xf')][util[_0x4444('0x1f')](_0x4444('0x20'),_0x5e0037['name'])])){_0x46a563[_0x4444('0xf')][util[_0x4444('0x1f')]('SIP/%s',_0x5e0037[_0x4444('0x21')])]=new Trunk(_0x5e0037);}else{_0x46a563[_0x4444('0x39')](_0x46a563[_0x4444('0xf')][util[_0x4444('0x1f')](_0x4444('0x20'),_0x5e0037['name'])],_0x5e0037);}}}return _0x46a563[_0x4444('0xf')];};};Realtime[_0x4444('0x38')]['initVoiceQueues']=function(){var _0x3a2adb=this;return function(_0x5d9d20){if(_0x5d9d20){freeIsNotKey(_0x5d9d20,_0x3a2adb[_0x4444('0x3f')],_0x4444('0x21'));for(var _0x1061d8=0x0,_0x31383e={},_0x3bf921={};_0x1061d8<_0x5d9d20['length'];_0x1061d8+=0x1){_0x31383e=_0x5d9d20[_0x1061d8];if(_[_0x4444('0x3a')](_0x3a2adb['voiceQueues'][_0x31383e['name']])){_0x3a2adb['voiceQueues'][_0x31383e[_0x4444('0x21')]]=new VoiceQueue(_0x31383e);}else{_0x3a2adb[_0x4444('0x39')](_0x3a2adb['voiceQueues'][_0x31383e[_0x4444('0x21')]],_0x31383e);}}}return _0x3a2adb[_0x4444('0x3f')];};};Realtime['prototype'][_0x4444('0x40')]=function(){var _0x1c4a59=this;return function(_0x1a8cce){if(_0x1a8cce){freeIsNotKey(_0x1a8cce,_0x1c4a59[_0x4444('0x41')],'id');for(var _0x91af12=0x0,_0x5a008b={},_0x46ada5={};_0x91af12<_0x1a8cce[_0x4444('0x3d')];_0x91af12+=0x1){_0x5a008b=_0x1a8cce[_0x91af12];if(_['isUndefined'](_0x1c4a59[_0x4444('0x41')][_0x5a008b['id']])){_0x1c4a59[_0x4444('0x41')][_0x5a008b['id']]=new Trigger(_0x5a008b);}else{_0x1c4a59[_0x4444('0x39')](_0x1c4a59[_0x4444('0x41')][_0x5a008b['id']],_0x5a008b);}}}return _0x1c4a59['triggers'];};};Realtime[_0x4444('0x38')][_0x4444('0x42')]=function(){var _0x387672=this;return function(_0x343def){if(_0x343def){freeIsNotKey(_0x343def,_0x387672[_0x4444('0x43')],'id');for(var _0x3463e0=0x0,_0x49348c={},_0x423aa5={};_0x3463e0<_0x343def[_0x4444('0x3d')];_0x3463e0+=0x1){_0x49348c=_0x343def[_0x3463e0];if(_[_0x4444('0x3a')](_0x387672[_0x4444('0x43')][_0x49348c['id']])){_0x387672[_0x4444('0x43')][_0x49348c['id']]=new Template(_0x49348c);}else{_0x387672[_0x4444('0x39')](_0x387672[_0x4444('0x43')][_0x49348c['id']],_0x49348c);}}}return _0x387672['templates'];};};Realtime['prototype'][_0x4444('0x44')]=function(){var _0xc0ab84=this;return function(_0x35b58d){if(_0x35b58d){freeIsNotKey(_0x35b58d,_0xc0ab84[_0x4444('0x45')],'id');for(var _0x398577=0x0,_0x2dbe94={},_0x179d35={};_0x398577<_0x35b58d[_0x4444('0x3d')];_0x398577+=0x1){_0x2dbe94=_0x35b58d[_0x398577];if(_[_0x4444('0x3a')](_0xc0ab84[_0x4444('0x45')][_0x2dbe94['id']])){_0xc0ab84[_0x4444('0x45')][_0x2dbe94['id']]=new ZendeskAccount(_0x2dbe94);}else{_0xc0ab84['mergeFromDatabase'](_0xc0ab84[_0x4444('0x45')][_0x2dbe94['id']],_0x2dbe94);}}}return _0xc0ab84[_0x4444('0x45')];};};Realtime[_0x4444('0x38')][_0x4444('0x46')]=function(){var _0x3b8999=this;return function(_0x446fdf){if(_0x446fdf){freeIsNotKey(_0x446fdf,_0x3b8999[_0x4444('0x16')],'id');for(var _0x465625=0x0,_0x545c48={},_0x5bd8de={};_0x465625<_0x446fdf[_0x4444('0x3d')];_0x465625+=0x1){_0x545c48=_0x446fdf[_0x465625];if(_[_0x4444('0x3a')](_0x3b8999[_0x4444('0x16')][_0x545c48['id']])){_0x3b8999['salesforceAccounts'][_0x545c48['id']]=new SalesforceAccount(_0x545c48);}else{_0x3b8999['mergeFromDatabase'](_0x3b8999[_0x4444('0x16')][_0x545c48['id']],_0x545c48);}}}return _0x3b8999[_0x4444('0x16')];};};Realtime[_0x4444('0x38')][_0x4444('0x47')]=function(){var _0x33fbf9=this;return function(_0x57e359){if(_0x57e359){freeIsNotKey(_0x57e359,_0x33fbf9[_0x4444('0x17')],'id');for(var _0x3abf09=0x0,_0x4b1b63={},_0x40ee00={};_0x3abf09<_0x57e359[_0x4444('0x3d')];_0x3abf09+=0x1){_0x4b1b63=_0x57e359[_0x3abf09];if(_[_0x4444('0x3a')](_0x33fbf9[_0x4444('0x17')][_0x4b1b63['id']])){_0x33fbf9[_0x4444('0x17')][_0x4b1b63['id']]=new FreshdeskAccount(_0x4b1b63);}else{_0x33fbf9[_0x4444('0x39')](_0x33fbf9[_0x4444('0x17')][_0x4b1b63['id']],_0x4b1b63);}}}return _0x33fbf9['freshdeskAccounts'];};};Realtime['prototype']['initZohoAccounts']=function(){var _0x5e689d=this;return function(_0x4dc34b){if(_0x4dc34b){freeIsNotKey(_0x4dc34b,_0x5e689d[_0x4444('0x18')],'id');for(var _0x11e01e=0x0,_0x426385={},_0x4545c2={};_0x11e01e<_0x4dc34b[_0x4444('0x3d')];_0x11e01e+=0x1){_0x426385=_0x4dc34b[_0x11e01e];if(_[_0x4444('0x3a')](_0x5e689d[_0x4444('0x18')][_0x426385['id']])){_0x5e689d[_0x4444('0x18')][_0x426385['id']]=new ZohoAccount(_0x426385);}else{_0x5e689d[_0x4444('0x39')](_0x5e689d[_0x4444('0x18')][_0x426385['id']],_0x426385);}}}return _0x5e689d[_0x4444('0x18')];};};Realtime['prototype'][_0x4444('0x48')]=function(){var _0x1447b6=this;return function(_0x45f59f){if(_0x45f59f){freeIsNotKey(_0x45f59f,_0x1447b6['deskAccounts'],'id');for(var _0x17d1b2=0x0,_0x213910={},_0x495635={};_0x17d1b2<_0x45f59f['length'];_0x17d1b2+=0x1){_0x213910=_0x45f59f[_0x17d1b2];if(_[_0x4444('0x3a')](_0x1447b6[_0x4444('0x19')][_0x213910['id']])){_0x1447b6[_0x4444('0x19')][_0x213910['id']]=new DeskAccount(_0x213910);}else{_0x1447b6[_0x4444('0x39')](_0x1447b6['deskAccounts'][_0x213910['id']],_0x213910);}}}return _0x1447b6[_0x4444('0x19')];};};Realtime[_0x4444('0x38')][_0x4444('0x49')]=function(){var _0x1f1864=this;return function(_0x18094b){if(_0x18094b){freeIsNotKey(_0x18094b,_0x1f1864[_0x4444('0x4a')],'id');for(var _0x2178c3=0x0,_0x52b15c={},_0x370176={};_0x2178c3<_0x18094b[_0x4444('0x3d')];_0x2178c3+=0x1){_0x52b15c=_0x18094b[_0x2178c3];if(_['isUndefined'](_0x1f1864[_0x4444('0x4a')][_0x52b15c['id']])){_0x1f1864[_0x4444('0x4a')][_0x52b15c['id']]=new SugarcrmAccount(_0x52b15c);}else{_0x1f1864[_0x4444('0x39')](_0x1f1864['sugarcrmAccounts'][_0x52b15c['id']],_0x52b15c);}}}return _0x1f1864[_0x4444('0x4a')];};};Realtime[_0x4444('0x38')]['initVtigerAccounts']=function(){var _0x27da2f=this;return function(_0x2cc359){if(_0x2cc359){freeIsNotKey(_0x2cc359,_0x27da2f[_0x4444('0x1a')],'id');for(var _0x363496=0x0,_0x5f01ad={},_0x5c43fd={};_0x363496<_0x2cc359[_0x4444('0x3d')];_0x363496+=0x1){_0x5f01ad=_0x2cc359[_0x363496];if(_[_0x4444('0x3a')](_0x27da2f[_0x4444('0x1a')][_0x5f01ad['id']])){_0x27da2f['vtigerAccounts'][_0x5f01ad['id']]=new VtigerAccount(_0x5f01ad);}else{_0x27da2f[_0x4444('0x39')](_0x27da2f[_0x4444('0x1a')][_0x5f01ad['id']],_0x5f01ad);}}}return _0x27da2f[_0x4444('0x1a')];};};Realtime[_0x4444('0x38')][_0x4444('0x4b')]=function(){var _0x2aa1f4=this;return function(_0x19a157){if(_0x19a157){freeIsNotKey(_0x19a157,_0x2aa1f4[_0x4444('0x4c')],'id');for(var _0x43db3f=0x0,_0x2a0468={},_0x311360={};_0x43db3f<_0x19a157[_0x4444('0x3d')];_0x43db3f+=0x1){_0x2a0468=_0x19a157[_0x43db3f];if(_[_0x4444('0x3a')](_0x2aa1f4['servicenowAccounts'][_0x2a0468['id']])){_0x2aa1f4[_0x4444('0x4c')][_0x2a0468['id']]=new ServicenowAccount(_0x2a0468);}else{_0x2aa1f4[_0x4444('0x39')](_0x2aa1f4['servicenowAccounts'][_0x2a0468['id']],_0x2a0468);}}}return _0x2aa1f4[_0x4444('0x4c')];};};Realtime['prototype']['initDynamics365Accounts']=function(){var _0x100c76=this;return function(_0x4bb53e){if(_0x4bb53e){freeIsNotKey(_0x4bb53e,_0x100c76[_0x4444('0x1b')],'id');for(var _0x33341f=0x0,_0x28e6a5={},_0x311184={};_0x33341f<_0x4bb53e['length'];_0x33341f+=0x1){_0x28e6a5=_0x4bb53e[_0x33341f];if(_['isUndefined'](_0x100c76['dynamics365Accounts'][_0x28e6a5['id']])){_0x100c76[_0x4444('0x1b')][_0x28e6a5['id']]=new Dynamics365Account(_0x28e6a5);}else{_0x100c76[_0x4444('0x39')](_0x100c76[_0x4444('0x1b')][_0x28e6a5['id']],_0x28e6a5);}}}return _0x100c76['dynamics365Accounts'];};};Realtime['prototype'][_0x4444('0x4d')]=function(){var _0x365bd8=this;return function(_0x449a24){if(_0x449a24){freeIsNotKey(_0x449a24,_0x365bd8[_0x4444('0x1c')],'id');for(var _0xfdf06f=0x0,_0x130820={},_0x337de5={};_0xfdf06f<_0x449a24[_0x4444('0x3d')];_0xfdf06f+=0x1){_0x130820=_0x449a24[_0xfdf06f];if(_[_0x4444('0x3a')](_0x365bd8['freshsalesAccounts'][_0x130820['id']])){_0x365bd8[_0x4444('0x1c')][_0x130820['id']]=new FreshsalesAccount(_0x130820);}else{_0x365bd8[_0x4444('0x39')](_0x365bd8['freshsalesAccounts'][_0x130820['id']],_0x130820);}}}return _0x365bd8[_0x4444('0x1c')];};};Realtime[_0x4444('0x38')][_0x4444('0x4e')]=function(){var _0x4ec209=this;return function(_0x4b3873){for(var _0x223ee1=0x0;_0x223ee1<_0x4b3873['length'];_0x223ee1+=0x1){_[_0x4444('0x4f')](_0x4ec209[_0x4444('0x3f')][_0x4b3873[_0x223ee1][_0x4444('0x21')]],_0x4b3873[_0x223ee1]);}return _0x4ec209['voiceQueues'];};};Realtime[_0x4444('0x38')][_0x4444('0x50')]=function(){var _0x2e355b=this;return function(_0x4bed1f){clearVoiceQueues(_0x2e355b[_0x4444('0x3f')]);if(_0x4bed1f){_0x4bed1f=_[_0x4444('0x51')](_0x4bed1f,'uniqueid');for(var _0xcaf58e in _0x4bed1f){if(_0x4bed1f[_0x4444('0x22')](_0xcaf58e)){var _0x2447b8={};for(var _0x27f88f=0x0;_0x27f88f<_0x4bed1f[_0xcaf58e]['length'];_0x27f88f+=0x1){var _0x2f7e5a=_0x4bed1f[_0xcaf58e][_0x27f88f]['queue'];if(_0x2e355b[_0x4444('0x3f')][_0x2f7e5a]){if(_0x4bed1f[_0xcaf58e][_0x27f88f]['queuecallerexit']){_0x2e355b[_0x4444('0x3f')][_0x2f7e5a][_0x4444('0x2d')]+=0x1;}if(_0x4bed1f[_0xcaf58e][_0x27f88f][_0x4444('0x52')]){_0x2e355b[_0x4444('0x3f')][_0x2f7e5a][_0x4444('0x2e')]+=0x1;}_0x2e355b['voiceQueues'][_0x2f7e5a][_0x4444('0x26')]+=moment(_0x4bed1f[_0xcaf58e][_0x27f88f]['queuecallerleaveAt'])[_0x4444('0x53')](moment(_0x4bed1f[_0xcaf58e][_0x27f88f][_0x4444('0x54')]),_0x4444('0x55'))||0x0;if(_0x27f88f===_0x4bed1f[_0xcaf58e]['length']-0x1){_0x2e355b[_0x4444('0x3f')][_0x2f7e5a][_0x4444('0x27')]+=moment(_0x4bed1f[_0xcaf58e][_0x27f88f][_0x4444('0x56')]||_0x4bed1f[_0xcaf58e][_0x27f88f][_0x4444('0x57')]||_0x4bed1f[_0xcaf58e][_0x27f88f][_0x4444('0x58')])[_0x4444('0x53')](moment(_0x4bed1f[_0xcaf58e][_0x27f88f][_0x4444('0x54')]),'seconds')||0x0;_0x2e355b[_0x4444('0x3f')][_0x2f7e5a][_0x4444('0x2c')]+=0x1;if(_0x4bed1f[_0xcaf58e][_0x27f88f][_0x4444('0x59')]){_0x2e355b[_0x4444('0x3f')][_0x2f7e5a]['answered']+=0x1;_0x2e355b[_0x4444('0x3f')][_0x2f7e5a]['sumBillable']+=moment(_0x4bed1f[_0xcaf58e][_0x27f88f][_0x4444('0x56')])[_0x4444('0x53')](moment(_0x4bed1f[_0xcaf58e][_0x27f88f][_0x4444('0x5a')]),_0x4444('0x55'))||0x0;}}else{_0x2e355b[_0x4444('0x3f')][_0x2f7e5a][_0x4444('0x27')]+=_0x2e355b[_0x4444('0x3f')][_0x2f7e5a]['sumHoldTime']||0x0;}}}}}}return _0x2e355b[_0x4444('0x3f')];};};Realtime['prototype']['initVoiceCallReports']=function(){var _0x57cc55=this;return function(_0x457ce1){clearVoiceCallReports(_0x57cc55['outbound']);if(_0x457ce1){for(var _0x1248fa=0x0;_0x1248fa<_0x457ce1['length'];_0x1248fa+=0x1){_0x57cc55[_0x4444('0x11')][_0x4444('0x2c')]+=0x1;_0x57cc55[_0x4444('0x11')]['sumDuration']+=_0x457ce1[_0x1248fa][_0x4444('0x5b')];if(_0x457ce1[_0x1248fa][_0x4444('0x5c')]===_0x4444('0x5d')){_0x57cc55['outbound'][_0x4444('0x25')]+=0x1;_0x57cc55[_0x4444('0x11')][_0x4444('0x26')]+=_0x457ce1[_0x1248fa][_0x4444('0x5b')]-_0x457ce1[_0x1248fa][_0x4444('0x5e')]||0x0;_0x57cc55[_0x4444('0x11')]['sumBillable']+=_0x457ce1[_0x1248fa][_0x4444('0x5e')];}}}return _0x57cc55['outbound'];};};Realtime['prototype'][_0x4444('0x5f')]=function(){var _0x56e457=this;return function(_0x4e95df){if(_0x4e95df){freeIsNotKey(_0x4e95df,_0x56e457['campaigns'],_0x4444('0x21'));for(var _0x580035=0x0,_0x5e5951={};_0x580035<_0x4e95df[_0x4444('0x3d')];_0x580035+=0x1){_0x5e5951=_0x4e95df[_0x580035];if(_['isUndefined'](_0x56e457[_0x4444('0x10')][_0x5e5951['name']])){_0x56e457[_0x4444('0x10')][_0x5e5951[_0x4444('0x21')]]=new Campaign(_0x5e5951);}else{_0x56e457[_0x4444('0x39')](_0x56e457[_0x4444('0x10')][_0x5e5951['name']],_0x5e5951);_0x56e457[_0x4444('0x10')][_0x5e5951[_0x4444('0x21')]][_0x4444('0x60')]=_0x5e5951[_0x4444('0x61')]?_0x5e5951[_0x4444('0x61')][_0x4444('0x21')]:undefined;}}}return _0x56e457[_0x4444('0x10')];};};Realtime[_0x4444('0x38')]['initVoiceExtensions']=function(){var _0x3cdb37=this;return function(_0x57b2cd){if(_0x57b2cd){freeIsNotKey(_0x57b2cd,_0x3cdb37[_0x4444('0x12')],'id');for(var _0x34abd0=0x0,_0x54398d={};_0x34abd0<_0x57b2cd[_0x4444('0x3d')];_0x34abd0+=0x1){_0x54398d=_0x57b2cd[_0x34abd0];if(_[_0x4444('0x3a')](_0x3cdb37['voiceExtensions'][_0x54398d['id']])){_0x3cdb37['voiceExtensions'][_0x54398d['id']]=new VoiceExtension(_0x54398d);}else{_0x3cdb37['mergeFromDatabase'](_0x3cdb37['voiceExtensions'][_0x54398d['id']],_0x54398d);}}}return _0x3cdb37[_0x4444('0x12')];};};Realtime[_0x4444('0x38')][_0x4444('0x62')]=function(){var _0x4d1e4d=this;return function(_0x54a913){clearCampaigns(_0x4d1e4d[_0x4444('0x10')]);for(var _0x19fa98=0x0;_0x19fa98<_0x54a913[_0x4444('0x3d')];_0x19fa98+=0x1){_[_0x4444('0x4f')](_0x4d1e4d['campaigns'][_0x54a913[_0x19fa98][_0x4444('0x21')]],_0x54a913[_0x19fa98]);}return _0x4d1e4d[_0x4444('0x10')];};};Realtime[_0x4444('0x38')]['initFaxAccounts']=function(){var _0x2c5ba=this;return function(_0x2bf09a){if(_0x2bf09a){freeIsNotKey(_0x2bf09a,_0x2c5ba[_0x4444('0x1d')],'id');for(var _0x2d0401=0x0,_0x314634={},_0x4e01c9={};_0x2d0401<_0x2bf09a[_0x4444('0x3d')];_0x2d0401+=0x1){_0x314634=_0x2bf09a[_0x2d0401];if(_[_0x4444('0x3a')](_0x2c5ba[_0x4444('0x1d')][_0x314634['id']])){_0x2c5ba[_0x4444('0x1d')][_0x314634['id']]=new FaxAccount(_0x314634);}else{_0x2c5ba['mergeFromDatabase'](_0x2c5ba[_0x4444('0x1d')][_0x314634['id']],_0x314634);}}}return _0x2c5ba[_0x4444('0x1d')];};};module['exports']=Realtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index 7a63d2c..f3541a1 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 _0xb675=['transfererlinkedid','lodash','moment','util','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','telephones','prototype','realtime','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','custom:voiceCallReport','voiceCallReport','bind','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','blindTransfer','attendedTransfer','findAgent','agents','accountcode','name','isNil','find','format','SIP/%s','length','assigned','interface','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','create','match','destination','type','dialer','queue','lastdata','from-voip-provider','callerid','context','xcally-motion-preview','calleridpreview','calleridnum','originatecalleridnum','destinationchannel','channel','ANSWERED','connectedlinenum','calleridname','linkedid','transfers','transfereelinkedid','uniqueid','monitor','monitors','monitorFilename','createdAt','exten','connectedlinename','membername','xcally-motion-dialer','forEach','startsWith','Local','indexOf','phone','lastIndexOf'];(function(_0x432c36,_0x4082e8){var _0x3a14d0=function(_0x2ed287){while(--_0x2ed287){_0x432c36['push'](_0x432c36['shift']());}};_0x3a14d0(++_0x4082e8);}(_0xb675,0x159));var _0x5b67=function(_0x2678d6,_0x4e2001){_0x2678d6=_0x2678d6-0x0;var _0x475503=_0xb675[_0x2678d6];return _0x475503;};'use strict';var _=require(_0x5b67('0x0'));var moment=require(_0x5b67('0x1'));var util=require(_0x5b67('0x2'));var config=require('../../../config/environment');var ami=require(_0x5b67('0x3'));var RpcVoiceAgentReport=require(_0x5b67('0x4'));var RpcVoiceCallReport=require(_0x5b67('0x5'));var RpcVoiceDialReport=require(_0x5b67('0x6'));var RpcMemberReport=require(_0x5b67('0x7'));var RpcVoiceQueueReport=require(_0x5b67('0x8'));var RpcVoiceRecording=require(_0x5b67('0x9'));var RpcVoiceTransferReport=require(_0x5b67('0xa'));var VoiceQueueReport=require(_0x5b67('0xb'));var VoiceCallReport=require(_0x5b67('0xc'));var VoiceAgentReport=require(_0x5b67('0xd'));var VoiceDialReport=require(_0x5b67('0xe'));var UserReport=require(_0x5b67('0xf'));function Report(_0x2f5d58){this['realtime']=_0x2f5d58;this['agents']=_0x2f5d58['agents'];this[_0x5b67('0x10')]=_0x2f5d58[_0x5b67('0x10')];}Report[_0x5b67('0x11')]['sync']=function(_0x296204){var _0x489aba=new VoiceQueueReport(this['realtime']);var _0x4ceaa5=new VoiceAgentReport(this['realtime']);var _0x540d31=new VoiceDialReport(this[_0x5b67('0x12')]);var _0x21376c=new VoiceCallReport(this[_0x5b67('0x12')]);var _0x459446=new UserReport(this[_0x5b67('0x12')]);if(config[_0x5b67('0x13')]&&config[_0x5b67('0x13')][_0x5b67('0x14')]){ami['on'](_0x5b67('0x15'),this[_0x5b67('0x16')]['bind'](this));ami['on'](_0x5b67('0x17'),this[_0x5b67('0x18')][_0x5b67('0x19')](this));ami['on'](_0x5b67('0x1a'),this[_0x5b67('0x1b')][_0x5b67('0x19')](this));ami['on'](_0x5b67('0x1c'),this[_0x5b67('0x1d')][_0x5b67('0x19')](this));ami['on'](_0x5b67('0x1e'),this[_0x5b67('0x1f')][_0x5b67('0x19')](this));ami['on']('attendedtransfer',this[_0x5b67('0x20')][_0x5b67('0x19')](this));}};Report[_0x5b67('0x11')][_0x5b67('0x21')]=function(_0x23ce29){var _0x3b58e4;_0x3b58e4=_['find'](this[_0x5b67('0x22')],function(_0x5c94f1){return _0x5c94f1[_0x5b67('0x23')]==_0x23ce29||_0x5c94f1[_0x5b67('0x24')]==_0x23ce29;});if(_[_0x5b67('0x25')](_0x3b58e4)){var _0x3a6301=_[_0x5b67('0x26')](this['telephones'],function(_0x2ca94d){return _0x2ca94d['accountcode']==_0x23ce29||_0x2ca94d['name']==_0x23ce29;});if(_0x3a6301){_0x3b58e4=_[_0x5b67('0x26')](this['agents'],function(_0x11b180){return _0x11b180['interface']==util[_0x5b67('0x27')](_0x5b67('0x28'),_0x3a6301[_0x5b67('0x24')]);});}}return _0x3b58e4;};Report[_0x5b67('0x11')][_0x5b67('0x16')]=function(_0x621e2a){for(var _0x9306f1=0x0;_0x9306f1<_0x621e2a[_0x5b67('0x29')];_0x9306f1+=0x1){var _0x1be65c=this[_0x5b67('0x21')](_0x621e2a[_0x9306f1]['connectedlinenum']);if(_0x1be65c){_0x621e2a[_0x9306f1][_0x5b67('0x23')]=_0x1be65c[_0x5b67('0x23')];_0x621e2a[_0x9306f1][_0x5b67('0x2a')]=!![];_0x621e2a[_0x9306f1]['lastAssignedTo']=_0x1be65c[_0x5b67('0x24')];_0x621e2a[_0x9306f1][_0x5b67('0x2b')]=_[_0x5b67('0x25')](_0x1be65c['interface'])?util[_0x5b67('0x27')](_0x5b67('0x28'),_0x1be65c[_0x5b67('0x24')]):_0x1be65c[_0x5b67('0x2b')];if(_0x621e2a[_0x9306f1]['queuecallercomplete']){_0x621e2a[_0x9306f1][_0x5b67('0x2c')]=moment()['format'](_0x5b67('0x2d'));}if(_0x621e2a[_0x9306f1][_0x5b67('0x2e')]){_0x621e2a[_0x9306f1][_0x5b67('0x2f')]=moment()['format'](_0x5b67('0x2d'));}RpcMemberReport['voiceQueueReport'](_0x621e2a[_0x9306f1]);}RpcVoiceQueueReport[_0x5b67('0x30')](_0x621e2a[_0x9306f1]);}};function extractCalleridNumber(_0x28b777){var _0x19bb71=_0x28b777[_0x5b67('0x31')](/<(.*?)>/);return _0x19bb71?_0x19bb71[0x1]:_0x28b777;}Report[_0x5b67('0x11')][_0x5b67('0x18')]=function(_0x3e9a74){_0x3e9a74['destination']=_0x3e9a74[_0x5b67('0x32')]||_0x3e9a74['exten'];if(_0x3e9a74[_0x5b67('0x33')]==_0x5b67('0x34')){_0x3e9a74['lastapplication']=_0x5b67('0x35');_0x3e9a74[_0x5b67('0x36')]=_0x3e9a74[_0x5b67('0x35')];if(_0x3e9a74['context']==_0x5b67('0x37')){_0x3e9a74['accountcode']='';_0x3e9a74[_0x5b67('0x32')]=extractCalleridNumber(_0x3e9a74[_0x5b67('0x38')]);}else if(_0x3e9a74[_0x5b67('0x39')]=='from-sip'){if(_0x3e9a74[_0x5b67('0x32')]==_0x5b67('0x3a')){_0x3e9a74[_0x5b67('0x32')]=extractCalleridNumber(_0x3e9a74[_0x5b67('0x3b')]);_0x3e9a74[_0x5b67('0x3c')]=_0x3e9a74[_0x5b67('0x3d')];_0x3e9a74[_0x5b67('0x3e')]=[_0x3e9a74[_0x5b67('0x3f')],_0x3e9a74['channel']=_0x3e9a74[_0x5b67('0x3e')]][0x0];_0x3e9a74[_0x5b67('0x38')]=_0x3e9a74[_0x5b67('0x3b')];}else{_0x3e9a74['destination']=_0x3e9a74[_0x5b67('0x3c')];_0x3e9a74[_0x5b67('0x3c')]=_0x3e9a74[_0x5b67('0x3d')];if(_0x3e9a74['disposition']==_0x5b67('0x40')){_0x3e9a74[_0x5b67('0x23')]=_0x3e9a74[_0x5b67('0x41')];}else{_0x3e9a74['accountcode']='';}}}}else{_0x3e9a74[_0x5b67('0x38')]=util[_0x5b67('0x27')]('\x22%s\x22\x20<%s>',_0x3e9a74[_0x5b67('0x42')],_0x3e9a74[_0x5b67('0x3c')]);}if(RpcVoiceTransferReport['transfers'][_0x3e9a74[_0x5b67('0x43')]]){var _0x4586f7=RpcVoiceTransferReport[_0x5b67('0x44')][_0x3e9a74['linkedid']];_0x4586f7[_0x5b67('0x45')]=_0x3e9a74[_0x5b67('0x46')];RpcVoiceTransferReport[_0x5b67('0x1f')](_0x4586f7);delete RpcVoiceTransferReport[_0x5b67('0x44')][_0x3e9a74[_0x5b67('0x43')]];}RpcVoiceCallReport[_0x5b67('0x30')](_0x3e9a74);if(_0x3e9a74[_0x5b67('0x47')]){for(var _0x5a3031=0x0;_0x5a3031<_0x3e9a74[_0x5b67('0x48')][_0x5b67('0x29')];_0x5a3031+=0x1){_0x3e9a74[_0x5b67('0x49')]=_0x3e9a74[_0x5b67('0x48')][_0x5a3031]['filename'];_0x3e9a74[_0x5b67('0x4a')]=_0x3e9a74['monitors'][_0x5a3031][_0x5b67('0x4a')];if(_0x3e9a74[_0x5b67('0x4b')]=='xcally-motion-preview'){_0x3e9a74[_0x5b67('0x3c')]=_0x3e9a74[_0x5b67('0x41')];_0x3e9a74[_0x5b67('0x42')]=_0x3e9a74[_0x5b67('0x4c')];_0x3e9a74[_0x5b67('0x41')]=_0x3e9a74['accountcode'];_0x3e9a74[_0x5b67('0x4c')]=_0x3e9a74[_0x5b67('0x4d')];_0x3e9a74[_0x5b67('0x4b')]=_0x3e9a74[_0x5b67('0x3d')];}else if(_0x3e9a74[_0x5b67('0x4b')]==_0x5b67('0x4e')){_0x3e9a74['calleridnum']=_0x3e9a74['destination'];_0x3e9a74[_0x5b67('0x4b')]=_0x3e9a74[_0x5b67('0x3d')];}RpcVoiceRecording[_0x5b67('0x30')](_0x3e9a74);}}};Report[_0x5b67('0x11')][_0x5b67('0x1b')]=function(_0x126b1a){if(_['isArray'](_0x126b1a)){_0x126b1a[_0x5b67('0x4f')](function(_0x4dc0c8){RpcVoiceAgentReport['create'](_0x4dc0c8);});}else{RpcVoiceAgentReport[_0x5b67('0x30')](_0x126b1a);}};Report[_0x5b67('0x11')][_0x5b67('0x1d')]=function(_0x33ad44){RpcVoiceDialReport['create'](_0x33ad44);var _0x35f655;var _0x5f3c9d;var _0x3e4f32=_0x33ad44[_0x5b67('0x3f')];if(_[_0x5b67('0x50')](_0x3e4f32,_0x5b67('0x51'))){_0x5f3c9d=_0x3e4f32['substring'](_0x3e4f32['indexOf']('/')+0x1,_0x3e4f32[_0x5b67('0x52')]('@'));_0x35f655=_['find'](this[_0x5b67('0x22')],function(_0x3c9810){return _0x3c9810['mobile']==_0x5f3c9d||_0x3c9810[_0x5b67('0x53')]==_0x5f3c9d||_0x3c9810[_0x5b67('0x23')]==_0x5f3c9d;});}else{_0x5f3c9d=_0x3e4f32['substring'](_0x3e4f32[_0x5b67('0x52')]('/')+0x1,_0x3e4f32[_0x5b67('0x54')]('-'));_0x35f655=this[_0x5b67('0x21')](_0x5f3c9d);}if(_0x35f655){_0x33ad44[_0x5b67('0x2b')]=_[_0x5b67('0x25')](_0x35f655[_0x5b67('0x2b')])?util[_0x5b67('0x27')](_0x5b67('0x28'),_0x35f655[_0x5b67('0x24')]):_0x35f655[_0x5b67('0x2b')];_0x33ad44[_0x5b67('0x4d')]=_0x35f655[_0x5b67('0x24')];_0x33ad44[_0x5b67('0x23')]=_0x35f655[_0x5b67('0x23')];RpcMemberReport[_0x5b67('0x1d')](_0x33ad44);}};Report[_0x5b67('0x11')][_0x5b67('0x1f')]=function(_0x44af69){RpcVoiceTransferReport[_0x5b67('0x44')][_0x44af69[_0x5b67('0x55')]]=_0x44af69;};Report[_0x5b67('0x11')]['attendedTransfer']=function(_0x4aec0b){RpcVoiceTransferReport[_0x5b67('0x20')](_0x4aec0b);};module['exports']=Report; \ No newline at end of file +var _0xd779=['exten','type','dialer','lastapplication','queue','lastdata','context','from-voip-provider','callerid','xcally-motion-preview','calleridpreview','calleridnum','originatecalleridnum','destinationchannel','channel','disposition','ANSWERED','calleridname','transfers','linkedid','transfereelinkedid','uniqueid','monitors','monitorFilename','filename','createdAt','connectedlinename','membername','isArray','forEach','substring','indexOf','mobile','phone','lastIndexOf','attendedTransfer','exports','moment','../../../config/environment','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceRecording','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','agents','telephones','prototype','sync','realtime','xdr','disabled','bind','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','blindTransfer','findAgent','find','accountcode','name','isNil','interface','format','voiceQueueReport','length','connectedlinenum','assigned','lastAssignedTo','SIP/%s','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','YYYY-MM-DD\x20HH:mm:ss','create','destination'];(function(_0x9077a3,_0x4d77c3){var _0x157afb=function(_0x49ba86){while(--_0x49ba86){_0x9077a3['push'](_0x9077a3['shift']());}};_0x157afb(++_0x4d77c3);}(_0xd779,0x1bf));var _0x9d77=function(_0x39aff2,_0x1f06c3){_0x39aff2=_0x39aff2-0x0;var _0x4b986c=_0xd779[_0x39aff2];return _0x4b986c;};'use strict';var _=require('lodash');var moment=require(_0x9d77('0x0'));var util=require('util');var config=require(_0x9d77('0x1'));var ami=require('../ami');var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require('../rpc/voiceCallReport');var RpcVoiceDialReport=require(_0x9d77('0x2'));var RpcMemberReport=require(_0x9d77('0x3'));var RpcVoiceQueueReport=require('../rpc/voiceQueueReport');var RpcVoiceRecording=require(_0x9d77('0x4'));var RpcVoiceTransferReport=require('../rpc/voiceTransferReport');var VoiceQueueReport=require(_0x9d77('0x5'));var VoiceCallReport=require(_0x9d77('0x6'));var VoiceAgentReport=require(_0x9d77('0x7'));var VoiceDialReport=require(_0x9d77('0x8'));var UserReport=require('./userReport');function Report(_0x2de85c){this['realtime']=_0x2de85c;this[_0x9d77('0x9')]=_0x2de85c['agents'];this[_0x9d77('0xa')]=_0x2de85c[_0x9d77('0xa')];}Report[_0x9d77('0xb')][_0x9d77('0xc')]=function(_0x4927e5){var _0x2f1e1b=new VoiceQueueReport(this[_0x9d77('0xd')]);var _0x4c8be6=new VoiceAgentReport(this[_0x9d77('0xd')]);var _0x38c176=new VoiceDialReport(this[_0x9d77('0xd')]);var _0x565470=new VoiceCallReport(this[_0x9d77('0xd')]);var _0x4de709=new UserReport(this[_0x9d77('0xd')]);if(config[_0x9d77('0xe')]&&config[_0x9d77('0xe')][_0x9d77('0xf')]){ami['on']('custom:voiceQueueReport',this['voiceQueueReport'][_0x9d77('0x10')](this));ami['on'](_0x9d77('0x11'),this[_0x9d77('0x12')]['bind'](this));ami['on'](_0x9d77('0x13'),this[_0x9d77('0x14')][_0x9d77('0x10')](this));ami['on'](_0x9d77('0x15'),this[_0x9d77('0x16')][_0x9d77('0x10')](this));ami['on'](_0x9d77('0x17'),this[_0x9d77('0x18')][_0x9d77('0x10')](this));ami['on']('attendedtransfer',this['attendedTransfer'][_0x9d77('0x10')](this));}};Report[_0x9d77('0xb')][_0x9d77('0x19')]=function(_0x19835d){var _0x510902;_0x510902=_[_0x9d77('0x1a')](this['agents'],function(_0x1cefef){return _0x1cefef[_0x9d77('0x1b')]==_0x19835d||_0x1cefef[_0x9d77('0x1c')]==_0x19835d;});if(_[_0x9d77('0x1d')](_0x510902)){var _0x3979a3=_['find'](this[_0x9d77('0xa')],function(_0x3379ff){return _0x3379ff[_0x9d77('0x1b')]==_0x19835d||_0x3379ff[_0x9d77('0x1c')]==_0x19835d;});if(_0x3979a3){_0x510902=_[_0x9d77('0x1a')](this[_0x9d77('0x9')],function(_0x257e2e){return _0x257e2e[_0x9d77('0x1e')]==util[_0x9d77('0x1f')]('SIP/%s',_0x3979a3[_0x9d77('0x1c')]);});}}return _0x510902;};Report[_0x9d77('0xb')][_0x9d77('0x20')]=function(_0x59bb44){for(var _0x444b13=0x0;_0x444b13<_0x59bb44[_0x9d77('0x21')];_0x444b13+=0x1){var _0x40b8fa=this[_0x9d77('0x19')](_0x59bb44[_0x444b13][_0x9d77('0x22')]);if(_0x40b8fa){_0x59bb44[_0x444b13][_0x9d77('0x1b')]=_0x40b8fa[_0x9d77('0x1b')];_0x59bb44[_0x444b13][_0x9d77('0x23')]=!![];_0x59bb44[_0x444b13][_0x9d77('0x24')]=_0x40b8fa[_0x9d77('0x1c')];_0x59bb44[_0x444b13][_0x9d77('0x1e')]=_[_0x9d77('0x1d')](_0x40b8fa['interface'])?util[_0x9d77('0x1f')](_0x9d77('0x25'),_0x40b8fa['name']):_0x40b8fa[_0x9d77('0x1e')];if(_0x59bb44[_0x444b13][_0x9d77('0x26')]){_0x59bb44[_0x444b13][_0x9d77('0x27')]=moment()[_0x9d77('0x1f')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x59bb44[_0x444b13][_0x9d77('0x28')]){_0x59bb44[_0x444b13][_0x9d77('0x29')]=moment()[_0x9d77('0x1f')](_0x9d77('0x2a'));}RpcMemberReport[_0x9d77('0x20')](_0x59bb44[_0x444b13]);}RpcVoiceQueueReport[_0x9d77('0x2b')](_0x59bb44[_0x444b13]);}};function extractCalleridNumber(_0x3082a0){var _0x209296=_0x3082a0['match'](/<(.*?)>/);return _0x209296?_0x209296[0x1]:_0x3082a0;}Report['prototype'][_0x9d77('0x12')]=function(_0x56ace6){_0x56ace6[_0x9d77('0x2c')]=_0x56ace6[_0x9d77('0x2c')]||_0x56ace6[_0x9d77('0x2d')];if(_0x56ace6[_0x9d77('0x2e')]==_0x9d77('0x2f')){_0x56ace6[_0x9d77('0x30')]=_0x9d77('0x31');_0x56ace6[_0x9d77('0x32')]=_0x56ace6[_0x9d77('0x31')];if(_0x56ace6[_0x9d77('0x33')]==_0x9d77('0x34')){_0x56ace6[_0x9d77('0x1b')]='';_0x56ace6[_0x9d77('0x2c')]=extractCalleridNumber(_0x56ace6[_0x9d77('0x35')]);}else if(_0x56ace6[_0x9d77('0x33')]=='from-sip'){if(_0x56ace6[_0x9d77('0x2c')]==_0x9d77('0x36')){_0x56ace6[_0x9d77('0x2c')]=extractCalleridNumber(_0x56ace6[_0x9d77('0x37')]);_0x56ace6[_0x9d77('0x38')]=_0x56ace6[_0x9d77('0x39')];_0x56ace6[_0x9d77('0x3a')]=[_0x56ace6[_0x9d77('0x3b')],_0x56ace6['channel']=_0x56ace6[_0x9d77('0x3a')]][0x0];_0x56ace6[_0x9d77('0x35')]=_0x56ace6[_0x9d77('0x37')];}else{_0x56ace6[_0x9d77('0x2c')]=_0x56ace6['calleridnum'];_0x56ace6[_0x9d77('0x38')]=_0x56ace6[_0x9d77('0x39')];if(_0x56ace6[_0x9d77('0x3c')]==_0x9d77('0x3d')){_0x56ace6['accountcode']=_0x56ace6[_0x9d77('0x22')];}else{_0x56ace6[_0x9d77('0x1b')]='';}}}}else{_0x56ace6[_0x9d77('0x35')]=util[_0x9d77('0x1f')]('\x22%s\x22\x20<%s>',_0x56ace6[_0x9d77('0x3e')],_0x56ace6[_0x9d77('0x38')]);}if(RpcVoiceTransferReport[_0x9d77('0x3f')][_0x56ace6['linkedid']]){var _0x540bfa=RpcVoiceTransferReport[_0x9d77('0x3f')][_0x56ace6[_0x9d77('0x40')]];_0x540bfa[_0x9d77('0x41')]=_0x56ace6[_0x9d77('0x42')];RpcVoiceTransferReport[_0x9d77('0x18')](_0x540bfa);delete RpcVoiceTransferReport[_0x9d77('0x3f')][_0x56ace6['linkedid']];}RpcVoiceCallReport[_0x9d77('0x2b')](_0x56ace6);if(_0x56ace6['monitor']){for(var _0x457f88=0x0;_0x457f88<_0x56ace6[_0x9d77('0x43')]['length'];_0x457f88+=0x1){_0x56ace6[_0x9d77('0x44')]=_0x56ace6[_0x9d77('0x43')][_0x457f88][_0x9d77('0x45')];_0x56ace6[_0x9d77('0x46')]=_0x56ace6['monitors'][_0x457f88][_0x9d77('0x46')];if(_0x56ace6[_0x9d77('0x2d')]==_0x9d77('0x36')){_0x56ace6['calleridnum']=_0x56ace6['connectedlinenum'];_0x56ace6[_0x9d77('0x3e')]=_0x56ace6[_0x9d77('0x47')];_0x56ace6[_0x9d77('0x22')]=_0x56ace6[_0x9d77('0x1b')];_0x56ace6[_0x9d77('0x47')]=_0x56ace6[_0x9d77('0x48')];_0x56ace6[_0x9d77('0x2d')]=_0x56ace6[_0x9d77('0x39')];}else if(_0x56ace6[_0x9d77('0x2d')]=='xcally-motion-dialer'){_0x56ace6['calleridnum']=_0x56ace6[_0x9d77('0x2c')];_0x56ace6[_0x9d77('0x2d')]=_0x56ace6[_0x9d77('0x39')];}RpcVoiceRecording[_0x9d77('0x2b')](_0x56ace6);}}};Report[_0x9d77('0xb')][_0x9d77('0x14')]=function(_0x354d87){if(_[_0x9d77('0x49')](_0x354d87)){_0x354d87[_0x9d77('0x4a')](function(_0x3b139c){RpcVoiceAgentReport[_0x9d77('0x2b')](_0x3b139c);});}else{RpcVoiceAgentReport[_0x9d77('0x2b')](_0x354d87);}};Report[_0x9d77('0xb')][_0x9d77('0x16')]=function(_0x511991){RpcVoiceDialReport[_0x9d77('0x2b')](_0x511991);var _0x2e40ba;var _0x56a5a2;var _0x37bcc1=_0x511991[_0x9d77('0x3b')];if(_['startsWith'](_0x37bcc1,'Local')){_0x56a5a2=_0x37bcc1[_0x9d77('0x4b')](_0x37bcc1[_0x9d77('0x4c')]('/')+0x1,_0x37bcc1[_0x9d77('0x4c')]('@'));_0x2e40ba=_[_0x9d77('0x1a')](this[_0x9d77('0x9')],function(_0x59371c){return _0x59371c[_0x9d77('0x4d')]==_0x56a5a2||_0x59371c[_0x9d77('0x4e')]==_0x56a5a2||_0x59371c[_0x9d77('0x1b')]==_0x56a5a2;});}else{_0x56a5a2=_0x37bcc1['substring'](_0x37bcc1[_0x9d77('0x4c')]('/')+0x1,_0x37bcc1[_0x9d77('0x4f')]('-'));_0x2e40ba=this['findAgent'](_0x56a5a2);}if(_0x2e40ba){_0x511991[_0x9d77('0x1e')]=_['isNil'](_0x2e40ba[_0x9d77('0x1e')])?util[_0x9d77('0x1f')](_0x9d77('0x25'),_0x2e40ba[_0x9d77('0x1c')]):_0x2e40ba[_0x9d77('0x1e')];_0x511991[_0x9d77('0x48')]=_0x2e40ba[_0x9d77('0x1c')];_0x511991['accountcode']=_0x2e40ba[_0x9d77('0x1b')];RpcMemberReport[_0x9d77('0x16')](_0x511991);}};Report[_0x9d77('0xb')][_0x9d77('0x18')]=function(_0x4acda2){RpcVoiceTransferReport[_0x9d77('0x3f')][_0x4acda2['transfererlinkedid']]=_0x4acda2;};Report['prototype'][_0x9d77('0x50')]=function(_0x291263){RpcVoiceTransferReport[_0x9d77('0x50')](_0x291263);};module[_0x9d77('0x51')]=Report; \ No newline at end of file diff --git a/server/services/ami/report/userReport.js b/server/services/ami/report/userReport.js index d98946b..7235699 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 _0x85a7=['event','format','trunk:%s','name','device','local','toLowerCase','inuse','stateTime','toNumber','telephone:%s','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','trunk:save','startsWith','Local','substring','mobile','phone','updateStatusRealtime','[userReport][devicestatechange]','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','peer','address','registered','status','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','telephone:save','exports','lodash','moment','ioredis','bluebird','../../../config/environment','../../../config/logger','ami','redis','defaults','localhost','socket.io-emitter','trunks','agents','telephones','syncRegistry','bind','registry','devicestatechange','peerstatus','syncPeerStatus','syncRealtimeShow','resolve','then','actionSipShowRegistry','catch','error','[userReport][sipshowregistry]','inspect','actionDeviceStateList','actionSipPeerStatus','[userReport][sippeerstatus]','prototype','emit','isNotNull','info','[userReport][registry]\x20registry:%s\x20state:%s','username','state','debug','[userReport][registry]','find','merge','omit'];(function(_0x1034ee,_0x12998c){var _0x2922af=function(_0x13715a){while(--_0x13715a){_0x1034ee['push'](_0x1034ee['shift']());}};_0x2922af(++_0x12998c);}(_0x85a7,0x1c6));var _0x785a=function(_0x7aa4bd,_0x179245){_0x7aa4bd=_0x7aa4bd-0x0;var _0x331a73=_0x85a7[_0x7aa4bd];return _0x331a73;};'use strict';var _=require(_0x785a('0x0'));var moment=require(_0x785a('0x1'));var util=require('util');var Redis=require(_0x785a('0x2'));var BPromise=require(_0x785a('0x3'));var config=require(_0x785a('0x4'));var logger=require(_0x785a('0x5'))(_0x785a('0x6'));var ami=require('../ami');config[_0x785a('0x7')]=_[_0x785a('0x8')](config[_0x785a('0x7')],{'host':_0x785a('0x9'),'port':0x18eb});var io=require(_0x785a('0xa'))(new Redis(config['redis']));function UserReport(_0x193a10){this[_0x785a('0xb')]=_0x193a10[_0x785a('0xb')];this[_0x785a('0xc')]=_0x193a10['agents'];this[_0x785a('0xd')]=_0x193a10[_0x785a('0xd')];ami['on']('registryentry',this[_0x785a('0xe')][_0x785a('0xf')](this));ami['on'](_0x785a('0x10'),this['syncRegistry']['bind'](this));ami['on'](_0x785a('0x11'),this['syncDeviceState'][_0x785a('0xf')](this));ami['on'](_0x785a('0x12'),this[_0x785a('0x13')][_0x785a('0xf')](this));return this[_0x785a('0x14')]();}function showSipRegistrations(){Promise[_0x785a('0x15')]()[_0x785a('0x16')](ami[_0x785a('0x17')]())[_0x785a('0x18')](function(_0x5c4dda){logger[_0x785a('0x19')](_0x785a('0x1a'),util[_0x785a('0x1b')](_0x5c4dda,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0x785a('0x15')]()[_0x785a('0x16')](ami[_0x785a('0x1c')]())[_0x785a('0x18')](function(_0x3864f9){logger[_0x785a('0x19')]('[userReport][devicestatelist]',util['inspect'](_0x3864f9,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0x785a('0x15')]()[_0x785a('0x16')](ami[_0x785a('0x1d')]())['catch'](function(_0x136e94){logger[_0x785a('0x19')](_0x785a('0x1e'),util[_0x785a('0x1b')](_0x136e94,{'showHidden':![],'depth':null}));});}UserReport[_0x785a('0x1f')]['syncRealtimeShow']=function(){setInterval(function(){BPromise['resolve']()[_0x785a('0x16')](showSipRegistrations())[_0x785a('0x16')](listDeviceStates())[_0x785a('0x16')](showPeersStatus());},0x32c8);};UserReport[_0x785a('0x1f')]['isNotNull']=function(_0x5baf24){return _0x5baf24!==null&&!_['isUndefined'](_0x5baf24);};UserReport[_0x785a('0x1f')][_0x785a('0x20')]=function(_0x4cfcb5,_0x393b7a,_0x584e7b){io['to'](_0x4cfcb5)['emit'](_0x393b7a,_0x584e7b);};UserReport['prototype'][_0x785a('0xe')]=function(_0x57a18a){try{if(this[_0x785a('0x21')](_0x57a18a)){logger[_0x785a('0x22')](_0x785a('0x23'),_0x57a18a[_0x785a('0x24')],_0x57a18a[_0x785a('0x25')]);logger[_0x785a('0x26')](_0x785a('0x27'),util['inspect'](_0x57a18a,{'showHidden':![],'depth':null}));var _0x3ab76f=_[_0x785a('0x28')](this[_0x785a('0xb')],{'defaultuser':_0x57a18a[_0x785a('0x24')]});if(_0x3ab76f){_0x57a18a['stateRegistry']=_0x57a18a['state'];_[_0x785a('0x29')](_0x3ab76f,_[_0x785a('0x2a')](_0x57a18a,[_0x785a('0x2b'),'actionid',_0x785a('0x24'),_0x785a('0x25')]));logger[_0x785a('0x26')]('[userReport][registry]\x20sending\x20trunk:save\x20event:',util['inspect'](_0x3ab76f,{'showHidden':![],'depth':null}));this[_0x785a('0x20')](util[_0x785a('0x2c')](_0x785a('0x2d'),_0x3ab76f[_0x785a('0x2e')]),'trunk:save',_0x3ab76f);}}}catch(_0x2c1e56){logger[_0x785a('0x19')](_0x785a('0x27'),util[_0x785a('0x1b')](_0x2c1e56,{'showHidden':![],'depth':null}));}};UserReport['prototype']['syncDeviceState']=function(_0x5b4751){try{if(this['isNotNull'](_0x5b4751)){logger[_0x785a('0x22')]('[userReport][devicestatechange]\x20device:%s\x20state:%s',_0x5b4751[_0x785a('0x2f')],_0x5b4751['state']);logger[_0x785a('0x26')]('[userReport][devicestatechange]',util[_0x785a('0x1b')](_0x5b4751,{'showHidden':![],'depth':null}));if(this[_0x785a('0xc')][_0x5b4751[_0x785a('0x2f')]]){if(!this[_0x785a('0xc')][_0x5b4751[_0x785a('0x2f')]][_0x785a('0x30')]||_0x5b4751[_0x785a('0x25')][_0x785a('0x31')]()==_0x785a('0x32')){this[_0x785a('0xc')][_0x5b4751['device']][_0x785a('0x30')]=![];if(this['agents'][_0x5b4751[_0x785a('0x2f')]][_0x785a('0x25')]!==_0x5b4751['state'][_0x785a('0x31')]()){this[_0x785a('0xc')][_0x5b4751['device']][_0x785a('0x33')]=_[_0x785a('0x34')](moment()['format']('x'));}this['agents'][_0x5b4751['device']][_0x785a('0x25')]=_0x5b4751[_0x785a('0x25')][_0x785a('0x31')]();this['agents'][_0x5b4751['device']]['updateStatusRealtime'](_0x5b4751);}}else if(this[_0x785a('0xd')][_0x5b4751[_0x785a('0x2f')]]){if(this[_0x785a('0xd')][_0x5b4751['device']][_0x785a('0x25')]!==_0x5b4751[_0x785a('0x25')][_0x785a('0x31')]()){this[_0x785a('0xd')][_0x5b4751[_0x785a('0x2f')]][_0x785a('0x33')]=_[_0x785a('0x34')](moment()[_0x785a('0x2c')]('x'));}this[_0x785a('0xd')][_0x5b4751[_0x785a('0x2f')]][_0x785a('0x25')]=_0x5b4751[_0x785a('0x25')][_0x785a('0x31')]();logger['debug']('[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:',util[_0x785a('0x1b')](this[_0x785a('0xd')][_0x5b4751[_0x785a('0x2f')]],{'showHidden':![],'depth':null}));this[_0x785a('0x20')](util[_0x785a('0x2c')](_0x785a('0x35'),this[_0x785a('0xd')][_0x5b4751[_0x785a('0x2f')]][_0x785a('0x2e')]),'telephone:save',this['telephones'][_0x5b4751[_0x785a('0x2f')]]);}else if(this['trunks'][_0x5b4751[_0x785a('0x2f')]]){if(this[_0x785a('0xb')][_0x5b4751[_0x785a('0x2f')]][_0x785a('0x25')]!==_0x5b4751[_0x785a('0x25')][_0x785a('0x31')]()){this[_0x785a('0xb')][_0x5b4751['device']][_0x785a('0x33')]=_[_0x785a('0x34')](moment()[_0x785a('0x2c')]('x'));}this[_0x785a('0xb')][_0x5b4751['device']][_0x785a('0x25')]=_0x5b4751['state']['toLowerCase']();logger[_0x785a('0x26')](_0x785a('0x36'),util['inspect'](this[_0x785a('0xb')][_0x5b4751[_0x785a('0x2f')]],{'showHidden':![],'depth':null}));this[_0x785a('0x20')](util[_0x785a('0x2c')]('trunk:%s',this[_0x785a('0xb')][_0x5b4751[_0x785a('0x2f')]][_0x785a('0x2e')]),_0x785a('0x37'),this[_0x785a('0xb')][_0x5b4751[_0x785a('0x2f')]]);}else if(_[_0x785a('0x38')](_0x5b4751['device'],_0x785a('0x39'))){var _0x58467f=_0x5b4751[_0x785a('0x2f')];var _0x108051=_0x58467f[_0x785a('0x3a')](_0x58467f['indexOf']('/')+0x1,_0x58467f['indexOf']('@'));var _0xf5ab97=_[_0x785a('0x28')](this['agents'],function(_0xe93985){return _0xe93985[_0x785a('0x3b')]==_0x108051||_0xe93985[_0x785a('0x3c')]==_0x108051||_0xe93985['accountcode']==_0x108051;});if(_0xf5ab97){if(_0xf5ab97[_0x785a('0x25')]!==_0x5b4751[_0x785a('0x25')]['toLowerCase']()){_0xf5ab97[_0x785a('0x33')]=_[_0x785a('0x34')](moment()['format']('x'));}_0xf5ab97['state']=_0x5b4751[_0x785a('0x25')][_0x785a('0x31')]();_0xf5ab97[_0x785a('0x30')]=!![];_0xf5ab97[_0x785a('0x3d')](_0x5b4751);}}}}catch(_0x1962d0){logger[_0x785a('0x19')](_0x785a('0x3e'),util[_0x785a('0x1b')](_0x1962d0,{'showHidden':![],'depth':null}));}};UserReport[_0x785a('0x1f')][_0x785a('0x13')]=function(_0x12cca7){try{if(this['isNotNull'](_0x12cca7)&&this[_0x785a('0x21')](_0x12cca7[_0x785a('0x12')])){logger['info'](_0x785a('0x3f'),_0x12cca7[_0x785a('0x40')],_0x12cca7[_0x785a('0x41')],_0x12cca7[_0x785a('0x12')]);logger[_0x785a('0x26')]('[userReport][peerstatus]',util['inspect'](_0x12cca7,{'showHidden':![],'depth':null}));if(this[_0x785a('0xc')][_0x12cca7['peer']]){if(!this[_0x785a('0xc')][_0x12cca7[_0x785a('0x40')]][_0x785a('0x30')]||_0x12cca7[_0x785a('0x12')]['toLowerCase']()==_0x785a('0x42')){this[_0x785a('0xc')][_0x12cca7[_0x785a('0x40')]][_0x785a('0x30')]=![];this[_0x785a('0xc')][_0x12cca7[_0x785a('0x40')]]['status']=_0x12cca7[_0x785a('0x12')]['toLowerCase']();this[_0x785a('0xc')][_0x12cca7[_0x785a('0x40')]]['address']=_0x12cca7[_0x785a('0x41')];this[_0x785a('0xc')][_0x12cca7['peer']]['updateStatusRealtime'](_0x12cca7);}}else if(this[_0x785a('0xd')][_0x12cca7['peer']]){this[_0x785a('0xd')][_0x12cca7[_0x785a('0x40')]][_0x785a('0x43')]=_0x12cca7['peerstatus'][_0x785a('0x31')]();this[_0x785a('0xd')][_0x12cca7[_0x785a('0x40')]][_0x785a('0x41')]=_0x12cca7[_0x785a('0x41')];logger[_0x785a('0x26')](_0x785a('0x44'),util['inspect'](this[_0x785a('0xd')][_0x12cca7[_0x785a('0x40')]],{'showHidden':![],'depth':null}));this[_0x785a('0x20')](util[_0x785a('0x2c')]('telephone:%s',this[_0x785a('0xd')][_0x12cca7[_0x785a('0x40')]]['name']),_0x785a('0x45'),this[_0x785a('0xd')][_0x12cca7[_0x785a('0x40')]]);}else if(this[_0x785a('0xb')][_0x12cca7[_0x785a('0x40')]]){this[_0x785a('0xb')][_0x12cca7['peer']]['status']=_0x12cca7[_0x785a('0x12')][_0x785a('0x31')]();this['trunks'][_0x12cca7[_0x785a('0x40')]][_0x785a('0x41')]=_0x12cca7[_0x785a('0x41')];logger[_0x785a('0x26')]('[userReport][peerstatus]\x20sending\x20trunk:save\x20event:',util['inspect'](this['trunks'][_0x12cca7[_0x785a('0x40')]],{'showHidden':![],'depth':null}));this[_0x785a('0x20')](util[_0x785a('0x2c')](_0x785a('0x2d'),this[_0x785a('0xb')][_0x12cca7['peer']][_0x785a('0x2e')]),_0x785a('0x37'),this[_0x785a('0xb')][_0x12cca7['peer']]);}}}catch(_0x491086){logger[_0x785a('0x19')]('[userReport][peerstatus]',util[_0x785a('0x1b')](_0x491086,{'showHidden':![],'depth':null}));}};module[_0x785a('0x46')]=UserReport; \ No newline at end of file +var _0x4b66=['name','trunk:save','[userReport][devicestatechange]\x20device:%s\x20state:%s','[userReport][devicestatechange]','device','local','toLowerCase','stateTime','toNumber','format','telephone:%s','telephone:save','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','startsWith','Local','substring','indexOf','mobile','phone','accountcode','updateStatusRealtime','syncPeerStatus','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','peer','address','[userReport][peerstatus]','registered','status','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','moment','util','ioredis','bluebird','../../../config/environment','../ami','redis','localhost','socket.io-emitter','trunks','agents','telephones','registryentry','syncRegistry','bind','devicestatechange','syncDeviceState','peerstatus','resolve','then','actionSipShowRegistry','catch','error','[userReport][sipshowregistry]','[userReport][devicestatelist]','actionSipPeerStatus','[userReport][sippeerstatus]','prototype','syncRealtimeShow','isNotNull','isUndefined','emit','info','[userReport][registry]\x20registry:%s\x20state:%s','username','debug','[userReport][registry]','inspect','find','stateRegistry','omit','event','actionid','state','[userReport][registry]\x20sending\x20trunk:save\x20event:','trunk:%s'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x4b66,0x6a));var _0x64b6=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x4b66[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var moment=require(_0x64b6('0x0'));var util=require(_0x64b6('0x1'));var Redis=require(_0x64b6('0x2'));var BPromise=require(_0x64b6('0x3'));var config=require(_0x64b6('0x4'));var logger=require('../../../config/logger')('ami');var ami=require(_0x64b6('0x5'));config[_0x64b6('0x6')]=_['defaults'](config[_0x64b6('0x6')],{'host':_0x64b6('0x7'),'port':0x18eb});var io=require(_0x64b6('0x8'))(new Redis(config[_0x64b6('0x6')]));function UserReport(_0x58eeb9){this[_0x64b6('0x9')]=_0x58eeb9['trunks'];this['agents']=_0x58eeb9[_0x64b6('0xa')];this[_0x64b6('0xb')]=_0x58eeb9['telephones'];ami['on'](_0x64b6('0xc'),this[_0x64b6('0xd')][_0x64b6('0xe')](this));ami['on']('registry',this['syncRegistry'][_0x64b6('0xe')](this));ami['on'](_0x64b6('0xf'),this[_0x64b6('0x10')][_0x64b6('0xe')](this));ami['on'](_0x64b6('0x11'),this['syncPeerStatus'][_0x64b6('0xe')](this));return this['syncRealtimeShow']();}function showSipRegistrations(){Promise[_0x64b6('0x12')]()[_0x64b6('0x13')](ami[_0x64b6('0x14')]())[_0x64b6('0x15')](function(_0x533644){logger[_0x64b6('0x16')](_0x64b6('0x17'),util['inspect'](_0x533644,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0x64b6('0x12')]()[_0x64b6('0x13')](ami['actionDeviceStateList']())['catch'](function(_0x53aa36){logger[_0x64b6('0x16')](_0x64b6('0x18'),util['inspect'](_0x53aa36,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0x64b6('0x12')]()[_0x64b6('0x13')](ami[_0x64b6('0x19')]())[_0x64b6('0x15')](function(_0x1616ac){logger[_0x64b6('0x16')](_0x64b6('0x1a'),util['inspect'](_0x1616ac,{'showHidden':![],'depth':null}));});}UserReport[_0x64b6('0x1b')][_0x64b6('0x1c')]=function(){setInterval(function(){BPromise[_0x64b6('0x12')]()['then'](showSipRegistrations())['then'](listDeviceStates())[_0x64b6('0x13')](showPeersStatus());},0x32c8);};UserReport[_0x64b6('0x1b')][_0x64b6('0x1d')]=function(_0x4daa67){return _0x4daa67!==null&&!_[_0x64b6('0x1e')](_0x4daa67);};UserReport[_0x64b6('0x1b')]['emit']=function(_0x1b8ab6,_0x41197d,_0x46b2e0){io['to'](_0x1b8ab6)[_0x64b6('0x1f')](_0x41197d,_0x46b2e0);};UserReport[_0x64b6('0x1b')][_0x64b6('0xd')]=function(_0xd01e4){try{if(this[_0x64b6('0x1d')](_0xd01e4)){logger[_0x64b6('0x20')](_0x64b6('0x21'),_0xd01e4[_0x64b6('0x22')],_0xd01e4['state']);logger[_0x64b6('0x23')](_0x64b6('0x24'),util[_0x64b6('0x25')](_0xd01e4,{'showHidden':![],'depth':null}));var _0x26b8ae=_[_0x64b6('0x26')](this[_0x64b6('0x9')],{'defaultuser':_0xd01e4[_0x64b6('0x22')]});if(_0x26b8ae){_0xd01e4[_0x64b6('0x27')]=_0xd01e4['state'];_['merge'](_0x26b8ae,_[_0x64b6('0x28')](_0xd01e4,[_0x64b6('0x29'),_0x64b6('0x2a'),_0x64b6('0x22'),_0x64b6('0x2b')]));logger['debug'](_0x64b6('0x2c'),util['inspect'](_0x26b8ae,{'showHidden':![],'depth':null}));this[_0x64b6('0x1f')](util['format'](_0x64b6('0x2d'),_0x26b8ae[_0x64b6('0x2e')]),_0x64b6('0x2f'),_0x26b8ae);}}}catch(_0x40115a){logger['error']('[userReport][registry]',util[_0x64b6('0x25')](_0x40115a,{'showHidden':![],'depth':null}));}};UserReport[_0x64b6('0x1b')][_0x64b6('0x10')]=function(_0x2b0428){try{if(this[_0x64b6('0x1d')](_0x2b0428)){logger[_0x64b6('0x20')](_0x64b6('0x30'),_0x2b0428['device'],_0x2b0428['state']);logger[_0x64b6('0x23')](_0x64b6('0x31'),util[_0x64b6('0x25')](_0x2b0428,{'showHidden':![],'depth':null}));if(this[_0x64b6('0xa')][_0x2b0428[_0x64b6('0x32')]]){if(!this[_0x64b6('0xa')][_0x2b0428[_0x64b6('0x32')]][_0x64b6('0x33')]||_0x2b0428[_0x64b6('0x2b')][_0x64b6('0x34')]()=='inuse'){this[_0x64b6('0xa')][_0x2b0428[_0x64b6('0x32')]][_0x64b6('0x33')]=![];if(this[_0x64b6('0xa')][_0x2b0428[_0x64b6('0x32')]][_0x64b6('0x2b')]!==_0x2b0428[_0x64b6('0x2b')][_0x64b6('0x34')]()){this[_0x64b6('0xa')][_0x2b0428[_0x64b6('0x32')]][_0x64b6('0x35')]=_[_0x64b6('0x36')](moment()[_0x64b6('0x37')]('x'));}this['agents'][_0x2b0428[_0x64b6('0x32')]]['state']=_0x2b0428['state'][_0x64b6('0x34')]();this['agents'][_0x2b0428[_0x64b6('0x32')]]['updateStatusRealtime'](_0x2b0428);}}else if(this[_0x64b6('0xb')][_0x2b0428[_0x64b6('0x32')]]){if(this['telephones'][_0x2b0428['device']][_0x64b6('0x2b')]!==_0x2b0428[_0x64b6('0x2b')][_0x64b6('0x34')]()){this['telephones'][_0x2b0428[_0x64b6('0x32')]]['stateTime']=_[_0x64b6('0x36')](moment()[_0x64b6('0x37')]('x'));}this[_0x64b6('0xb')][_0x2b0428[_0x64b6('0x32')]]['state']=_0x2b0428[_0x64b6('0x2b')][_0x64b6('0x34')]();logger['debug']('[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:',util[_0x64b6('0x25')](this['telephones'][_0x2b0428[_0x64b6('0x32')]],{'showHidden':![],'depth':null}));this[_0x64b6('0x1f')](util[_0x64b6('0x37')](_0x64b6('0x38'),this[_0x64b6('0xb')][_0x2b0428[_0x64b6('0x32')]][_0x64b6('0x2e')]),_0x64b6('0x39'),this[_0x64b6('0xb')][_0x2b0428[_0x64b6('0x32')]]);}else if(this[_0x64b6('0x9')][_0x2b0428[_0x64b6('0x32')]]){if(this[_0x64b6('0x9')][_0x2b0428[_0x64b6('0x32')]][_0x64b6('0x2b')]!==_0x2b0428[_0x64b6('0x2b')][_0x64b6('0x34')]()){this[_0x64b6('0x9')][_0x2b0428[_0x64b6('0x32')]][_0x64b6('0x35')]=_[_0x64b6('0x36')](moment()['format']('x'));}this[_0x64b6('0x9')][_0x2b0428[_0x64b6('0x32')]]['state']=_0x2b0428[_0x64b6('0x2b')][_0x64b6('0x34')]();logger[_0x64b6('0x23')](_0x64b6('0x3a'),util[_0x64b6('0x25')](this[_0x64b6('0x9')][_0x2b0428[_0x64b6('0x32')]],{'showHidden':![],'depth':null}));this[_0x64b6('0x1f')](util[_0x64b6('0x37')](_0x64b6('0x2d'),this[_0x64b6('0x9')][_0x2b0428[_0x64b6('0x32')]][_0x64b6('0x2e')]),_0x64b6('0x2f'),this[_0x64b6('0x9')][_0x2b0428['device']]);}else if(_[_0x64b6('0x3b')](_0x2b0428[_0x64b6('0x32')],_0x64b6('0x3c'))){var _0x4d7cb8=_0x2b0428[_0x64b6('0x32')];var _0x1f87a0=_0x4d7cb8[_0x64b6('0x3d')](_0x4d7cb8[_0x64b6('0x3e')]('/')+0x1,_0x4d7cb8['indexOf']('@'));var _0x4854ca=_[_0x64b6('0x26')](this['agents'],function(_0x4c7b8b){return _0x4c7b8b[_0x64b6('0x3f')]==_0x1f87a0||_0x4c7b8b[_0x64b6('0x40')]==_0x1f87a0||_0x4c7b8b[_0x64b6('0x41')]==_0x1f87a0;});if(_0x4854ca){if(_0x4854ca[_0x64b6('0x2b')]!==_0x2b0428[_0x64b6('0x2b')][_0x64b6('0x34')]()){_0x4854ca[_0x64b6('0x35')]=_['toNumber'](moment()[_0x64b6('0x37')]('x'));}_0x4854ca[_0x64b6('0x2b')]=_0x2b0428[_0x64b6('0x2b')][_0x64b6('0x34')]();_0x4854ca[_0x64b6('0x33')]=!![];_0x4854ca[_0x64b6('0x42')](_0x2b0428);}}}}catch(_0x1f599d){logger[_0x64b6('0x16')](_0x64b6('0x31'),util[_0x64b6('0x25')](_0x1f599d,{'showHidden':![],'depth':null}));}};UserReport[_0x64b6('0x1b')][_0x64b6('0x43')]=function(_0xbf806f){try{if(this[_0x64b6('0x1d')](_0xbf806f)&&this['isNotNull'](_0xbf806f['peerstatus'])){logger[_0x64b6('0x20')](_0x64b6('0x44'),_0xbf806f[_0x64b6('0x45')],_0xbf806f[_0x64b6('0x46')],_0xbf806f[_0x64b6('0x11')]);logger[_0x64b6('0x23')](_0x64b6('0x47'),util[_0x64b6('0x25')](_0xbf806f,{'showHidden':![],'depth':null}));if(this[_0x64b6('0xa')][_0xbf806f[_0x64b6('0x45')]]){if(!this[_0x64b6('0xa')][_0xbf806f[_0x64b6('0x45')]]['local']||_0xbf806f[_0x64b6('0x11')][_0x64b6('0x34')]()==_0x64b6('0x48')){this[_0x64b6('0xa')][_0xbf806f['peer']][_0x64b6('0x33')]=![];this[_0x64b6('0xa')][_0xbf806f[_0x64b6('0x45')]][_0x64b6('0x49')]=_0xbf806f[_0x64b6('0x11')][_0x64b6('0x34')]();this['agents'][_0xbf806f[_0x64b6('0x45')]][_0x64b6('0x46')]=_0xbf806f[_0x64b6('0x46')];this[_0x64b6('0xa')][_0xbf806f[_0x64b6('0x45')]][_0x64b6('0x42')](_0xbf806f);}}else if(this[_0x64b6('0xb')][_0xbf806f[_0x64b6('0x45')]]){this[_0x64b6('0xb')][_0xbf806f[_0x64b6('0x45')]][_0x64b6('0x49')]=_0xbf806f[_0x64b6('0x11')][_0x64b6('0x34')]();this[_0x64b6('0xb')][_0xbf806f[_0x64b6('0x45')]][_0x64b6('0x46')]=_0xbf806f[_0x64b6('0x46')];logger[_0x64b6('0x23')](_0x64b6('0x4a'),util[_0x64b6('0x25')](this[_0x64b6('0xb')][_0xbf806f[_0x64b6('0x45')]],{'showHidden':![],'depth':null}));this[_0x64b6('0x1f')](util['format']('telephone:%s',this['telephones'][_0xbf806f['peer']][_0x64b6('0x2e')]),_0x64b6('0x39'),this[_0x64b6('0xb')][_0xbf806f[_0x64b6('0x45')]]);}else if(this[_0x64b6('0x9')][_0xbf806f[_0x64b6('0x45')]]){this[_0x64b6('0x9')][_0xbf806f['peer']]['status']=_0xbf806f['peerstatus']['toLowerCase']();this[_0x64b6('0x9')][_0xbf806f['peer']][_0x64b6('0x46')]=_0xbf806f[_0x64b6('0x46')];logger[_0x64b6('0x23')](_0x64b6('0x4b'),util['inspect'](this[_0x64b6('0x9')][_0xbf806f['peer']],{'showHidden':![],'depth':null}));this[_0x64b6('0x1f')](util[_0x64b6('0x37')](_0x64b6('0x2d'),this[_0x64b6('0x9')][_0xbf806f[_0x64b6('0x45')]][_0x64b6('0x2e')]),_0x64b6('0x2f'),this['trunks'][_0xbf806f[_0x64b6('0x45')]]);}}}catch(_0x2d460c){logger[_0x64b6('0x16')](_0x64b6('0x47'),util['inspect'](_0x2d460c,{'showHidden':![],'depth':null}));}};module['exports']=UserReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceAgentReport.js b/server/services/ami/report/voiceAgentReport.js index 82049fa..0e0e693 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 _0xdbcd=['syncAgentComplete','syncVarSet','hangup','syncHangup','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','prototype','emit','uniqueid','membername','debug','inspect','isUndefined','destuniqueid','format','called','inbound','voice','merge','event','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','custom:agentcalled','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','user:%s','user:called','error','[%s][voiceAgentReport][agentcalled]','syncAgentConnect','[%s][voiceAgentReport][agentconnect]\x20event:','hasOwnProperty','info','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','lastevent','connect','routealias','interface','pick','queue','destconnectedlinenum','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:','custom:agentconnect','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:','user:agentconnect','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','agentringnoanswerAt','YYYY-MM-DD\x20HH:mm:ss','answeredelsewheredestinationuniqueid','answeredelsewheremembername','answered_elsewhere','reason','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','[%s][voiceAgentReport][agentconnect]','isNotNull','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','rejected','[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:','custom:agentringnoanswer','[%s][voiceAgentReport][agentringnoanswer]','syncQueueCallerAbandon','[%s][voiceAgentReport][queuecallerabandon]\x20event:','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:','[%s][voiceAgentReport][queuecallerabandon]','[%s][voiceAgentReport][agentcomplete]\x20event:','agentconnectAt','agentcompleteAt','complete','transfer','agent','talktime','acw','acwTimeout','custom:agentcomplete','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','[%s][voiceAgentReport][agentcomplete]','addVariable','keys','variable','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','[%s][voiceAgentReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepvtcallid','membercalls','memberdynamic','memberlastcall','memberpenalty','memberrealtime','isNil','includes','[%s][voiceAgentReport][hangup]\x20destuniqueid:%s','values','[%s][voiceAgentReport][hangup]','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','[%s][voiceAgentReport][blindtransfer]\x20event:','transfereruniqueid','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diff','[%s][voiceAgentReport][blindtransfer]','[%s][voiceAgentReport][musiconholdstart]\x20event:','channel','substring','onhold','[%s][voiceAgentReport][musiconholdstart]','lastIndexOf','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','[%s][voiceAgentReport][musiconholdstop]','exports','moment','ioredis','../../../config/environment','../../../config/logger','../ami','redis','defaults','localhost','socket.io-emitter','channels','voiceChannels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','agentconnect','agentringnoanswer','bind','queuecallerabandon','agentcomplete'];(function(_0x36463f,_0x429571){var _0x14e517=function(_0x198d96){while(--_0x198d96){_0x36463f['push'](_0x36463f['shift']());}};_0x14e517(++_0x429571);}(_0xdbcd,0x1bc));var _0xddbc=function(_0x36dae3,_0x2623e7){_0x36dae3=_0x36dae3-0x0;var _0x423428=_0xdbcd[_0x36dae3];return _0x423428;};'use strict';var _=require('lodash');var moment=require(_0xddbc('0x0'));var util=require('util');var Redis=require(_0xddbc('0x1'));var config=require(_0xddbc('0x2'));var logger=require(_0xddbc('0x3'))('ami');var ami=require(_0xddbc('0x4'));config[_0xddbc('0x5')]=_[_0xddbc('0x6')](config['redis'],{'host':_0xddbc('0x7'),'port':0x18eb});var io=require(_0xddbc('0x8'))(new Redis(config[_0xddbc('0x5')]));function VoiceAgentReport(_0x84699b){this[_0xddbc('0x9')]={};this[_0xddbc('0xa')]=_0x84699b[_0xddbc('0x9')];this[_0xddbc('0xb')]=_0x84699b[_0xddbc('0xb')];this[_0xddbc('0xc')]=_0x84699b[_0xddbc('0xc')];this[_0xddbc('0xd')]={};ami['on'](_0xddbc('0xe'),this[_0xddbc('0xf')]['bind'](this));ami['on'](_0xddbc('0x10'),this['syncAgentConnect']['bind'](this));ami['on'](_0xddbc('0x11'),this['syncAgentRingNoAnswer'][_0xddbc('0x12')](this));ami['on'](_0xddbc('0x13'),this['syncQueueCallerAbandon']['bind'](this));ami['on'](_0xddbc('0x14'),this[_0xddbc('0x15')]['bind'](this));ami['on']('varset',this[_0xddbc('0x16')]['bind'](this));ami['on'](_0xddbc('0x17'),this[_0xddbc('0x18')]['bind'](this));ami['on']('musiconholdstart',this[_0xddbc('0x19')][_0xddbc('0x12')](this));ami['on'](_0xddbc('0x1a'),this[_0xddbc('0x1b')][_0xddbc('0x12')](this));ami['on'](_0xddbc('0x1c'),this[_0xddbc('0x1d')]['bind'](this));ami['on'](_0xddbc('0x1e'),this[_0xddbc('0x1f')][_0xddbc('0x12')](this));}VoiceAgentReport[_0xddbc('0x20')][_0xddbc('0x21')]=function(_0x22da1d,_0x54d4f5,_0x4240ff){io['to'](_0x22da1d)[_0xddbc('0x21')](_0x54d4f5,_0x4240ff);};VoiceAgentReport['prototype']['isNotNull']=function(_0x267b70){return _0x267b70!==null&&!_['isUndefined'](_0x267b70);};VoiceAgentReport[_0xddbc('0x20')]['syncAgentCalled']=function(_0x2a2c35){try{if(this['isNotNull'](_0x2a2c35)){logger['info']('[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x2a2c35[_0xddbc('0x22')],_0x2a2c35[_0xddbc('0x23')],_0x2a2c35['destuniqueid']);logger[_0xddbc('0x24')]('[%s][voiceAgentReport][agentcalled]\x20event:',_0x2a2c35['uniqueid'],util[_0xddbc('0x25')](_0x2a2c35,{'showHidden':![],'depth':null}));if(_[_0xddbc('0x26')](this[_0xddbc('0x9')][_0x2a2c35[_0xddbc('0x22')]])){this[_0xddbc('0x9')][_0x2a2c35[_0xddbc('0x22')]]={};}if(_[_0xddbc('0x26')](this['channels'][_0x2a2c35['uniqueid']][_0x2a2c35[_0xddbc('0x27')]])){this[_0xddbc('0x9')][_0x2a2c35[_0xddbc('0x22')]][_0x2a2c35[_0xddbc('0x27')]]={'agentcalledAt':moment()[_0xddbc('0x28')]('YYYY-MM-DD\x20HH:mm:ss'),'lastevent':_0xddbc('0x29'),'mandatoryDisposition':this['voiceQueues'][_0x2a2c35['queue']]?this['voiceQueues'][_0x2a2c35['queue']]['mandatoryDisposition']||![]:![],'type':this[_0xddbc('0xb')][_0x2a2c35['queue']]?this['voiceQueues'][_0x2a2c35['queue']]['type']||_0xddbc('0x2a'):_0xddbc('0x2a'),'variables':this['variables'][_0x2a2c35[_0xddbc('0x22')]],'motionChannel':_0xddbc('0x2b')};}_[_0xddbc('0x2c')](this[_0xddbc('0x9')][_0x2a2c35['uniqueid']][_0x2a2c35[_0xddbc('0x27')]],_['omit'](_0x2a2c35,[_0xddbc('0x2d'),'privilege']));logger['debug'](_0xddbc('0x2e'),_0x2a2c35[_0xddbc('0x22')],util[_0xddbc('0x25')](this[_0xddbc('0x9')][_0x2a2c35[_0xddbc('0x22')]][_0x2a2c35[_0xddbc('0x27')]],{'showHidden':![],'depth':null}));ami['emit'](_0xddbc('0x2f'),this['channels'][_0x2a2c35[_0xddbc('0x22')]][_0x2a2c35[_0xddbc('0x27')]]);logger['debug'](_0xddbc('0x30'),_0x2a2c35[_0xddbc('0x22')],util[_0xddbc('0x25')](this[_0xddbc('0x9')][_0x2a2c35[_0xddbc('0x22')]][_0x2a2c35['destuniqueid']],{'showHidden':![],'depth':null}));this[_0xddbc('0x21')](util['format'](_0xddbc('0x31'),_0x2a2c35['membername']),_0xddbc('0x32'),this[_0xddbc('0x9')][_0x2a2c35['uniqueid']][_0x2a2c35[_0xddbc('0x27')]]);}}catch(_0x4ab6d1){logger[_0xddbc('0x33')](_0xddbc('0x34'),_0x2a2c35[_0xddbc('0x22')],util['inspect'](_0x4ab6d1,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xddbc('0x20')][_0xddbc('0x35')]=function(_0x57b806){try{if(this['isNotNull'](_0x57b806)){if(this[_0xddbc('0x9')][_0x57b806[_0xddbc('0x22')]]){logger[_0xddbc('0x24')](_0xddbc('0x36'),_0x57b806[_0xddbc('0x22')],util[_0xddbc('0x25')](_0x57b806,{'showHidden':![],'depth':null}));for(var _0x4737e2 in this[_0xddbc('0x9')][_0x57b806[_0xddbc('0x22')]]){if(this[_0xddbc('0x9')][_0x57b806[_0xddbc('0x22')]][_0xddbc('0x37')](_0x4737e2)){if(_0x57b806[_0xddbc('0x27')]===_0x4737e2){logger[_0xddbc('0x38')]('[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x57b806['uniqueid'],_0x57b806[_0xddbc('0x23')],_0x57b806[_0xddbc('0x27')]);this['channels'][_0x57b806[_0xddbc('0x22')]][_0x4737e2]['agentconnectAt']=moment()[_0xddbc('0x28')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xddbc('0x9')][_0x57b806['uniqueid']][_0x4737e2][_0xddbc('0x39')]=_0x57b806[_0xddbc('0x39')];this[_0xddbc('0x9')][_0x57b806[_0xddbc('0x22')]][_0x4737e2][_0xddbc('0x3a')]=_0x57b806[_0xddbc('0x3a')];this[_0xddbc('0x9')][_0x57b806[_0xddbc('0x22')]][_0x4737e2][_0xddbc('0x3b')]=_0x57b806[_0xddbc('0x3b')];this['channels'][_0x57b806['uniqueid']][_0x4737e2][_0xddbc('0x3c')]=_0x57b806[_0xddbc('0x3c')];this[_0xddbc('0x9')][_0x57b806[_0xddbc('0x22')]][_0x4737e2][_0xddbc('0x3d')]=_0x57b806[_0xddbc('0x3d')];this[_0xddbc('0x9')][_0x57b806[_0xddbc('0x22')]][_0x4737e2][_0xddbc('0x3e')]=_0xddbc('0x3f');if(this[_0xddbc('0xa')][this['channels'][_0x57b806[_0xddbc('0x22')]][_0x4737e2][_0xddbc('0x22')]]){var _0x26f06e=this[_0xddbc('0xa')][this[_0xddbc('0x9')][_0x57b806[_0xddbc('0x22')]][_0x4737e2][_0xddbc('0x22')]][_0xddbc('0x40')];this['channels'][_0x57b806['uniqueid']][_0x4737e2]['routealias']=_0x26f06e;_0x57b806['routealias']=_0x26f06e;}_[_0xddbc('0x2c')](this[_0xddbc('0xc')][_0x57b806[_0xddbc('0x41')]],_[_0xddbc('0x42')](_0x57b806,[_0xddbc('0x43'),_0xddbc('0x44'),'routealias']));logger[_0xddbc('0x24')](_0xddbc('0x45'),_0x57b806[_0xddbc('0x22')],util[_0xddbc('0x25')](this['channels'][_0x57b806[_0xddbc('0x22')]][_0x57b806['destuniqueid']],{'showHidden':![],'depth':null}));ami[_0xddbc('0x21')](_0xddbc('0x46'),this[_0xddbc('0x9')][_0x57b806['uniqueid']][_0x57b806[_0xddbc('0x27')]]);logger['debug'](_0xddbc('0x47'),_0x57b806[_0xddbc('0x22')],util['inspect'](this['channels'][_0x57b806['uniqueid']][_0x57b806[_0xddbc('0x27')]],{'showHidden':![],'depth':null}));this[_0xddbc('0x21')](util[_0xddbc('0x28')]('user:%s',_0x57b806[_0xddbc('0x23')]),_0xddbc('0x48'),this[_0xddbc('0x9')][_0x57b806['uniqueid']][_0x57b806[_0xddbc('0x27')]]);}else if(!this[_0xddbc('0x9')][_0x57b806[_0xddbc('0x22')]][_0x4737e2]['agentringnoanswer']&&!this['channels'][_0x57b806[_0xddbc('0x22')]][_0x4737e2][_0xddbc('0x14')]){logger[_0xddbc('0x38')](_0xddbc('0x49'),_0x57b806['uniqueid'],this[_0xddbc('0x9')][_0x57b806[_0xddbc('0x22')]][_0x4737e2][_0xddbc('0x23')],_0x4737e2);this[_0xddbc('0x9')][_0x57b806['uniqueid']][_0x4737e2][_0xddbc('0x11')]=!![];this[_0xddbc('0x9')][_0x57b806[_0xddbc('0x22')]][_0x4737e2][_0xddbc('0x4a')]=moment()[_0xddbc('0x28')](_0xddbc('0x4b'));this['channels'][_0x57b806[_0xddbc('0x22')]][_0x4737e2][_0xddbc('0x4c')]=_0x57b806[_0xddbc('0x27')];this['channels'][_0x57b806['uniqueid']][_0x4737e2][_0xddbc('0x4d')]=_0x57b806[_0xddbc('0x23')];this['channels'][_0x57b806['uniqueid']][_0x4737e2]['lastevent']=_0xddbc('0x4e');this['channels'][_0x57b806[_0xddbc('0x22')]][_0x4737e2][_0xddbc('0x4f')]=_0xddbc('0x4e');logger[_0xddbc('0x24')](_0xddbc('0x50'),_0x57b806[_0xddbc('0x22')],util[_0xddbc('0x25')](this[_0xddbc('0x9')][_0x57b806['uniqueid']][_0x4737e2],{'showHidden':![],'depth':null}));ami['emit']('custom:agentansweredelsewhere',this['channels'][_0x57b806[_0xddbc('0x22')]][_0x4737e2]);}}}}}}catch(_0x393309){logger[_0xddbc('0x33')](_0xddbc('0x51'),_0x57b806[_0xddbc('0x22')],util['inspect'](_0x393309,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['syncAgentRingNoAnswer']=function(_0x36bb47){try{if(this[_0xddbc('0x52')](_0x36bb47)){logger[_0xddbc('0x24')]('[%s][voiceAgentReport][agentringnoanswer]\x20event:',_0x36bb47[_0xddbc('0x22')],util[_0xddbc('0x25')](_0x36bb47,{'showHidden':![],'depth':null}));if(this['channels'][_0x36bb47[_0xddbc('0x22')]]&&this[_0xddbc('0x9')][_0x36bb47[_0xddbc('0x22')]][_0x36bb47['destuniqueid']]){logger[_0xddbc('0x38')](_0xddbc('0x53'),_0x36bb47['uniqueid'],_0x36bb47[_0xddbc('0x23')],_0x36bb47[_0xddbc('0x27')]);this['channels'][_0x36bb47[_0xddbc('0x22')]][_0x36bb47[_0xddbc('0x27')]]['agentringnoanswer']=!![];this[_0xddbc('0x9')][_0x36bb47[_0xddbc('0x22')]][_0x36bb47[_0xddbc('0x27')]][_0xddbc('0x4a')]=moment()[_0xddbc('0x28')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xddbc('0x9')][_0x36bb47[_0xddbc('0x22')]][_0x36bb47[_0xddbc('0x27')]][_0xddbc('0x3e')]=_0xddbc('0x54');this[_0xddbc('0x9')][_0x36bb47[_0xddbc('0x22')]][_0x36bb47[_0xddbc('0x27')]][_0xddbc('0x4f')]=_0xddbc('0x54');logger[_0xddbc('0x24')](_0xddbc('0x55'),_0x36bb47[_0xddbc('0x22')],util[_0xddbc('0x25')](this[_0xddbc('0x9')][_0x36bb47[_0xddbc('0x22')]][_0x36bb47['destuniqueid']],{'showHidden':![],'depth':null}));ami[_0xddbc('0x21')](_0xddbc('0x56'),this['channels'][_0x36bb47['uniqueid']][_0x36bb47[_0xddbc('0x27')]]);}}}catch(_0x2e3cd0){logger[_0xddbc('0x33')](_0xddbc('0x57'),_0x36bb47['uniqueid'],util[_0xddbc('0x25')](_0x2e3cd0,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xddbc('0x20')][_0xddbc('0x58')]=function(_0x30f0d2){try{if(this[_0xddbc('0x52')](_0x30f0d2)){logger[_0xddbc('0x24')](_0xddbc('0x59'),_0x30f0d2[_0xddbc('0x22')],util[_0xddbc('0x25')](_0x30f0d2,{'showHidden':![],'depth':null}));if(this[_0xddbc('0x9')][_0x30f0d2[_0xddbc('0x22')]]){for(var _0x36dba7 in this[_0xddbc('0x9')][_0x30f0d2[_0xddbc('0x22')]]){if(this['channels'][_0x30f0d2[_0xddbc('0x22')]]['hasOwnProperty'](_0x36dba7)&&!this['channels'][_0x30f0d2[_0xddbc('0x22')]][_0x36dba7]['agentringnoanswer']&&!this[_0xddbc('0x9')][_0x30f0d2[_0xddbc('0x22')]][_0x36dba7][_0xddbc('0x14')]){logger[_0xddbc('0x38')](_0xddbc('0x5a'),_0x30f0d2['uniqueid'],this[_0xddbc('0x9')][_0x30f0d2['uniqueid']][_0x36dba7]['membername'],_0x36dba7);this[_0xddbc('0x9')][_0x30f0d2[_0xddbc('0x22')]][_0x36dba7][_0xddbc('0x11')]=!![];this[_0xddbc('0x9')][_0x30f0d2[_0xddbc('0x22')]][_0x36dba7][_0xddbc('0x4a')]=moment()['format'](_0xddbc('0x4b'));this[_0xddbc('0x9')][_0x30f0d2[_0xddbc('0x22')]][_0x36dba7][_0xddbc('0x3e')]=_0xddbc('0x5b');this[_0xddbc('0x9')][_0x30f0d2['uniqueid']][_0x36dba7][_0xddbc('0x4f')]=_0xddbc('0x5b');logger['debug'](_0xddbc('0x5c'),_0x30f0d2[_0xddbc('0x22')],util[_0xddbc('0x25')](this['channels'][_0x30f0d2[_0xddbc('0x22')]][_0x36dba7],{'showHidden':![],'depth':null}));ami[_0xddbc('0x21')]('custom:agentqueuecallerabandon',this[_0xddbc('0x9')][_0x30f0d2[_0xddbc('0x22')]][_0x36dba7]);}}}}}catch(_0x3b01b2){logger[_0xddbc('0x33')](_0xddbc('0x5d'),_0x30f0d2[_0xddbc('0x22')],util['inspect'](_0x3b01b2,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xddbc('0x15')]=function(_0x2f9aff){try{if(this[_0xddbc('0x52')](_0x2f9aff)){logger[_0xddbc('0x24')](_0xddbc('0x5e'),_0x2f9aff[_0xddbc('0x22')],util[_0xddbc('0x25')](_0x2f9aff,{'showHidden':![],'depth':null}));if(this[_0xddbc('0x9')][_0x2f9aff[_0xddbc('0x22')]]){for(var _0x45a783 in this[_0xddbc('0x9')][_0x2f9aff[_0xddbc('0x22')]]){if(this[_0xddbc('0x9')][_0x2f9aff['uniqueid']][_0xddbc('0x37')](_0x45a783)){if(this[_0xddbc('0x9')][_0x2f9aff[_0xddbc('0x22')]][_0x45a783][_0xddbc('0x5f')]&&!this[_0xddbc('0x9')][_0x2f9aff[_0xddbc('0x22')]][_0x45a783][_0xddbc('0x14')]){logger[_0xddbc('0x38')]('[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x2f9aff['uniqueid'],this[_0xddbc('0x9')][_0x2f9aff[_0xddbc('0x22')]][_0x45a783][_0xddbc('0x23')],_0x45a783);this[_0xddbc('0x9')][_0x2f9aff[_0xddbc('0x22')]][_0x45a783][_0xddbc('0x14')]=!![];this[_0xddbc('0x9')][_0x2f9aff[_0xddbc('0x22')]][_0x45a783][_0xddbc('0x60')]=moment()[_0xddbc('0x28')](_0xddbc('0x4b'));this['channels'][_0x2f9aff['uniqueid']][_0x45a783][_0xddbc('0x3e')]=_0xddbc('0x61');this[_0xddbc('0x9')][_0x2f9aff[_0xddbc('0x22')]][_0x45a783][_0xddbc('0x4f')]=_0x2f9aff[_0xddbc('0x4f')]==_0xddbc('0x62')?_0xddbc('0x63'):_0x2f9aff[_0xddbc('0x4f')];this['channels'][_0x2f9aff[_0xddbc('0x22')]][_0x45a783][_0xddbc('0x64')]=_0x2f9aff[_0xddbc('0x64')];if(this[_0xddbc('0xb')][_0x2f9aff[_0xddbc('0x43')]]&&this[_0xddbc('0xb')][_0x2f9aff['queue']][_0xddbc('0x65')]){this[_0xddbc('0x9')][_0x2f9aff['uniqueid']][_0x45a783]['acwtime']=this['voiceQueues'][_0x2f9aff['queue']][_0xddbc('0x66')];this[_0xddbc('0x9')][_0x2f9aff[_0xddbc('0x22')]][_0x45a783]['agentacw']=!![];}this[_0xddbc('0xc')][_0x2f9aff[_0xddbc('0x41')]]=_['omit'](this[_0xddbc('0xc')][_0x2f9aff[_0xddbc('0x41')]],[_0xddbc('0x43'),_0xddbc('0x44')]);logger['debug']('[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:',_0x2f9aff[_0xddbc('0x22')],util[_0xddbc('0x25')](this[_0xddbc('0x9')][_0x2f9aff[_0xddbc('0x22')]][_0x45a783],{'showHidden':![],'depth':null}));ami[_0xddbc('0x21')](_0xddbc('0x67'),this[_0xddbc('0x9')][_0x2f9aff[_0xddbc('0x22')]][_0x45a783]);logger['debug'](_0xddbc('0x68'),_0x2f9aff[_0xddbc('0x22')],util[_0xddbc('0x25')](this[_0xddbc('0x9')][_0x2f9aff[_0xddbc('0x22')]][_0x45a783],{'showHidden':![],'depth':null}));this[_0xddbc('0x21')](util['format'](_0xddbc('0x31'),_0x2f9aff[_0xddbc('0x23')]),_0xddbc('0x69'),this[_0xddbc('0x9')][_0x2f9aff[_0xddbc('0x22')]][_0x45a783]);}}}}}}catch(_0x5420c){logger['error'](_0xddbc('0x6a'),_0x2f9aff[_0xddbc('0x22')],util[_0xddbc('0x25')](_0x5420c,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xddbc('0x20')][_0xddbc('0x16')]=function(_0xc6ce72){try{if(this['isNotNull'](_0xc6ce72)){logger[_0xddbc('0x24')]('[%s][voiceAgentReport][varset]\x20event:',_0xc6ce72[_0xddbc('0x22')],util[_0xddbc('0x25')](_0xc6ce72,{'showHidden':![],'depth':null}));this[_0xddbc('0x6b')](_0xc6ce72['uniqueid'],_[_0xddbc('0x6c')](_0xc6ce72[_0xddbc('0x6d')])[0x0],_0xc6ce72[_0xddbc('0x6e')]);if(this[_0xddbc('0x9')][_0xc6ce72[_0xddbc('0x22')]]){for(var _0x5a605c in this[_0xddbc('0x9')][_0xc6ce72[_0xddbc('0x22')]]){if(this[_0xddbc('0x9')][_0xc6ce72['uniqueid']]['hasOwnProperty'](_0x5a605c)){logger[_0xddbc('0x38')](_0xddbc('0x6f'),_0xc6ce72[_0xddbc('0x22')],_0x5a605c,_[_0xddbc('0x6c')](_0xc6ce72['variable'])[0x0],_0xc6ce72[_0xddbc('0x6e')]);if(_[_0xddbc('0x26')](this[_0xddbc('0x9')][_0xc6ce72[_0xddbc('0x22')]][_0x5a605c][_0xddbc('0xd')])){this['channels'][_0xc6ce72[_0xddbc('0x22')]][_0x5a605c][_0xddbc('0xd')]={};}this[_0xddbc('0x9')][_0xc6ce72[_0xddbc('0x22')]][_0x5a605c]['variables']=this['variables'][_0xc6ce72[_0xddbc('0x22')]];}}}}}catch(_0x364914){logger[_0xddbc('0x33')](_0xddbc('0x70'),_0xc6ce72['uniqueid'],util[_0xddbc('0x25')](_0x364914,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xddbc('0x20')][_0xddbc('0x6b')]=function(_0x14f8c4,_0x3b14d7,_0x3904ef){var _0x2af5e8=[_0xddbc('0x71'),_0xddbc('0x72'),_0xddbc('0x73'),_0xddbc('0x74'),_0xddbc('0x75'),_0xddbc('0x76'),_0xddbc('0x77'),_0xddbc('0x78'),_0xddbc('0x79'),_0xddbc('0x7a'),'bridgepeer',_0xddbc('0x7b'),_0xddbc('0x7c'),_0xddbc('0x7d'),'memberinterface',_0xddbc('0x7e'),'membername',_0xddbc('0x7f'),_0xddbc('0x80')];if(!_[_0xddbc('0x81')](_0x3b14d7)&&!_[_0xddbc('0x82')](_0x2af5e8,_0x3b14d7)){if(_['isUndefined'](this[_0xddbc('0xd')][_0x14f8c4])){this[_0xddbc('0xd')][_0x14f8c4]={};}this[_0xddbc('0xd')][_0x14f8c4][_0x3b14d7]=_0x3904ef;}};VoiceAgentReport[_0xddbc('0x20')]['syncHangup']=function(_0x24a339){try{if(this[_0xddbc('0x52')](_0x24a339)){logger[_0xddbc('0x24')]('[%s][voiceAgentReport][hangup]\x20event:',_0x24a339['uniqueid'],util[_0xddbc('0x25')](_0x24a339,{'showHidden':![],'depth':null}));if(this['channels'][_0x24a339[_0xddbc('0x22')]]){for(var _0xb6c4e6 in this[_0xddbc('0x9')][_0x24a339['uniqueid']]){if(this[_0xddbc('0x9')][_0x24a339[_0xddbc('0x22')]]['hasOwnProperty'](_0xb6c4e6)){if(this[_0xddbc('0x9')][_0x24a339[_0xddbc('0x22')]][_0xb6c4e6]['reason']==_0xddbc('0x62')&&this[_0xddbc('0x9')][_0x24a339['uniqueid']][_0xb6c4e6]['agentcomplete']){logger[_0xddbc('0x38')](_0xddbc('0x83'),_0x24a339[_0xddbc('0x22')],_0xb6c4e6);this['channels'][_0x24a339[_0xddbc('0x22')]][_0xb6c4e6][_0xddbc('0x60')]=moment()[_0xddbc('0x28')](_0xddbc('0x4b'));}}}logger['debug']('[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:',_0x24a339[_0xddbc('0x22')],util[_0xddbc('0x25')](_[_0xddbc('0x84')](this['channels'][_0x24a339['uniqueid']]),{'showHidden':![],'depth':null}));ami[_0xddbc('0x21')]('custom:voiceAgentReport',_[_0xddbc('0x84')](this[_0xddbc('0x9')][_0x24a339[_0xddbc('0x22')]]));delete this[_0xddbc('0x9')][_0x24a339[_0xddbc('0x22')]];}if(this['variables'][_0x24a339[_0xddbc('0x22')]]){delete this[_0xddbc('0xd')][_0x24a339[_0xddbc('0x22')]];}}}catch(_0x5436bd){logger[_0xddbc('0x33')](_0xddbc('0x85'),_0x24a339['uniqueid'],util[_0xddbc('0x25')](_0x5436bd,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xddbc('0x20')]['syncAttendedTransfer']=function(_0x40d787){try{if(this[_0xddbc('0x52')](_0x40d787)){logger[_0xddbc('0x24')](_0xddbc('0x86'),_0x40d787['uniqueid'],util[_0xddbc('0x25')](_0x40d787,{'showHidden':![],'depth':null}));if(this[_0xddbc('0x9')][_0x40d787['transfereeuniqueid']]){for(var _0x18a282 in this['channels'][_0x40d787[_0xddbc('0x87')]]){if(this['channels'][_0x40d787['transfereeuniqueid']]['hasOwnProperty'](_0x18a282)){if(_0x40d787[_0xddbc('0x88')]===_0x18a282){logger[_0xddbc('0x38')](_0xddbc('0x89'),_0x40d787[_0xddbc('0x22')],this[_0xddbc('0x9')][_0x40d787[_0xddbc('0x87')]][_0x18a282][_0xddbc('0x23')],_0x18a282);var _0x597612=moment();this[_0xddbc('0x9')][_0x40d787['transfereeuniqueid']][_0x18a282][_0xddbc('0x14')]=!![];this[_0xddbc('0x9')][_0x40d787[_0xddbc('0x87')]][_0x18a282][_0xddbc('0x60')]=moment()[_0xddbc('0x28')](_0xddbc('0x4b'));this[_0xddbc('0x9')][_0x40d787[_0xddbc('0x87')]][_0x18a282][_0xddbc('0x3e')]=_0xddbc('0x61');this['channels'][_0x40d787[_0xddbc('0x87')]][_0x18a282]['reason']=_0xddbc('0x62');this['channels'][_0x40d787[_0xddbc('0x87')]][_0x18a282][_0xddbc('0x64')]=_0x597612['diff'](this[_0xddbc('0x9')][_0x40d787[_0xddbc('0x87')]][_0x18a282]['agentconnectAt'],_0xddbc('0x8a'));}}}}if(this[_0xddbc('0x9')][_0x40d787[_0xddbc('0x8b')]]){var _0x32a6c6=this[_0xddbc('0x9')][_0x40d787['secondtransfereruniqueid']];this[_0xddbc('0x9')][_0x40d787[_0xddbc('0x8b')]]=this['channels'][_0x40d787['transfereeuniqueid']];this['channels'][_0x40d787[_0xddbc('0x87')]]=_0x32a6c6;}}}catch(_0x2b1152){logger['error'](_0xddbc('0x8c'),_0x40d787[_0xddbc('0x22')],util[_0xddbc('0x25')](_0x2b1152,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xddbc('0x20')][_0xddbc('0x1f')]=function(_0x114b1c){try{if(this['isNotNull'](_0x114b1c)){logger['debug'](_0xddbc('0x8d'),_0x114b1c[_0xddbc('0x22')],util[_0xddbc('0x25')](_0x114b1c,{'showHidden':![],'depth':null}));if(this[_0xddbc('0x9')][_0x114b1c['transfereeuniqueid']]){for(var _0x51ac99 in this[_0xddbc('0x9')][_0x114b1c['transfereeuniqueid']]){if(this[_0xddbc('0x9')][_0x114b1c[_0xddbc('0x87')]][_0xddbc('0x37')](_0x51ac99)){if(_0x114b1c[_0xddbc('0x8e')]===_0x51ac99){logger[_0xddbc('0x38')](_0xddbc('0x8f'),_0x114b1c[_0xddbc('0x22')],this[_0xddbc('0x9')][_0x114b1c[_0xddbc('0x87')]][_0x51ac99][_0xddbc('0x23')],_0x51ac99);var _0x17c7fa=moment();this[_0xddbc('0x9')][_0x114b1c[_0xddbc('0x87')]][_0x51ac99][_0xddbc('0x14')]=!![];this[_0xddbc('0x9')][_0x114b1c[_0xddbc('0x87')]][_0x51ac99][_0xddbc('0x60')]=_0x17c7fa;this[_0xddbc('0x9')][_0x114b1c['transfereeuniqueid']][_0x51ac99][_0xddbc('0x3e')]='complete';this[_0xddbc('0x9')][_0x114b1c[_0xddbc('0x87')]][_0x51ac99][_0xddbc('0x4f')]=_0xddbc('0x62');this[_0xddbc('0x9')][_0x114b1c[_0xddbc('0x87')]][_0x51ac99][_0xddbc('0x64')]=_0x17c7fa[_0xddbc('0x90')](this[_0xddbc('0x9')][_0x114b1c['transfereeuniqueid']][_0x51ac99]['agentconnectAt'],_0xddbc('0x8a'));}}}}}}catch(_0x107af3){logger[_0xddbc('0x33')](_0xddbc('0x91'),_0x114b1c[_0xddbc('0x22')],util['inspect'](_0x107af3,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xddbc('0x20')][_0xddbc('0x19')]=function(_0xa8deef){var _0x2f1665='';try{if(this['isNotNull'](_0xa8deef)){logger['debug'](_0xddbc('0x92'),_0xa8deef['uniqueid'],util['inspect'](_0xa8deef,{'showHidden':![],'depth':null}));if(_0xa8deef[_0xddbc('0x93')]){_0x2f1665=_0xa8deef['channel'][_0xddbc('0x94')](0x0,_0xa8deef[_0xddbc('0x93')]['lastIndexOf']('-'));if(this[_0xddbc('0xc')][_0x2f1665]){logger[_0xddbc('0x38')]('[%s][voiceAgentReport][musiconholdstart]\x20interface:%s',_0xa8deef[_0xddbc('0x22')],_0x2f1665);this[_0xddbc('0xc')][_0x2f1665][_0xddbc('0x95')]=!![];}}}}catch(_0x5e2ba7){logger[_0xddbc('0x33')](_0xddbc('0x96'),_0xa8deef['uniqueid'],util[_0xddbc('0x25')](_0x5e2ba7,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xddbc('0x20')]['syncMusicOnHoldStop']=function(_0x4ac89b){var _0x1decbf='';try{if(this[_0xddbc('0x52')](_0x4ac89b)){logger[_0xddbc('0x24')]('[%s][voiceAgentReport][musiconholdstop]\x20event:',_0x4ac89b[_0xddbc('0x22')],util['inspect'](_0x4ac89b,{'showHidden':![],'depth':null}));if(_0x4ac89b[_0xddbc('0x93')]){_0x1decbf=_0x4ac89b['channel'][_0xddbc('0x94')](0x0,_0x4ac89b[_0xddbc('0x93')][_0xddbc('0x97')]('-'));if(this[_0xddbc('0xc')][_0x1decbf]){logger['info'](_0xddbc('0x98'),_0x4ac89b['uniqueid'],_0x1decbf);this[_0xddbc('0xc')][_0x1decbf][_0xddbc('0x95')]=![];}}}}catch(_0x487547){logger['error'](_0xddbc('0x99'),_0x4ac89b['uniqueid'],util[_0xddbc('0x25')](_0x487547,{'showHidden':![],'depth':null}));}};module[_0xddbc('0x9a')]=VoiceAgentReport; \ No newline at end of file +var _0xa5ea=['voiceQueues','agents','variables','syncAgentCalled','bind','agentconnect','syncAgentConnect','agentringnoanswer','queuecallerabandon','syncQueueCallerAbandon','syncAgentComplete','varset','syncVarSet','syncHangup','musiconholdstart','syncMusicOnHoldStop','syncAttendedTransfer','blindtransfer','syncBlindTransfer','prototype','emit','isNotNull','[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','membername','uniqueid','isUndefined','destuniqueid','format','YYYY-MM-DD\x20HH:mm:ss','queue','mandatoryDisposition','type','inbound','voice','merge','omit','privilege','inspect','custom:agentcalled','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','user:%s','error','[%s][voiceAgentReport][agentcalled]','debug','hasOwnProperty','info','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','connectedlinename','connectedlinenum','destchannelstatedesc','holdtime','lastevent','connect','routealias','interface','pick','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:','user:agentconnect','agentcomplete','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','agentringnoanswerAt','answeredelsewheredestinationuniqueid','answered_elsewhere','reason','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','syncAgentRingNoAnswer','[%s][voiceAgentReport][agentringnoanswer]\x20event:','rejected','[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:','[%s][voiceAgentReport][agentringnoanswer]','[%s][voiceAgentReport][queuecallerabandon]\x20event:','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:','custom:agentqueuecallerabandon','[%s][voiceAgentReport][queuecallerabandon]','agentconnectAt','agentcompleteAt','complete','transfer','talktime','acw','acwtime','acwTimeout','destconnectedlinenum','[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:','custom:agentcomplete','user:agentcomplete','[%s][voiceAgentReport][agentcomplete]','[%s][voiceAgentReport][varset]\x20event:','keys','variable','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','[%s][voiceAgentReport][varset]','addVariable','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','membercalls','memberdynamic','memberinterface','memberpenalty','memberrealtime','isNil','includes','custom:voiceAgentReport','values','[%s][voiceAgentReport][hangup]','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diff','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][blindtransfer]\x20event:','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','[%s][voiceAgentReport][blindtransfer]','syncMusicOnHoldStart','[%s][voiceAgentReport][musiconholdstart]\x20event:','channel','substring','lastIndexOf','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','lodash','moment','../../../config/environment','../../../config/logger','ami','redis','defaults','localhost','voiceChannels','channels'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa5ea,0x87));var _0xaa5e=function(_0x35b197,_0x3057b0){_0x35b197=_0x35b197-0x0;var _0x33c291=_0xa5ea[_0x35b197];return _0x33c291;};'use strict';var _=require(_0xaa5e('0x0'));var moment=require(_0xaa5e('0x1'));var util=require('util');var Redis=require('ioredis');var config=require(_0xaa5e('0x2'));var logger=require(_0xaa5e('0x3'))(_0xaa5e('0x4'));var ami=require('../ami');config[_0xaa5e('0x5')]=_[_0xaa5e('0x6')](config[_0xaa5e('0x5')],{'host':_0xaa5e('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xaa5e('0x5')]));function VoiceAgentReport(_0x221230){this['channels']={};this[_0xaa5e('0x8')]=_0x221230[_0xaa5e('0x9')];this[_0xaa5e('0xa')]=_0x221230[_0xaa5e('0xa')];this['agents']=_0x221230[_0xaa5e('0xb')];this[_0xaa5e('0xc')]={};ami['on']('agentcalled',this[_0xaa5e('0xd')][_0xaa5e('0xe')](this));ami['on'](_0xaa5e('0xf'),this[_0xaa5e('0x10')][_0xaa5e('0xe')](this));ami['on'](_0xaa5e('0x11'),this['syncAgentRingNoAnswer']['bind'](this));ami['on'](_0xaa5e('0x12'),this[_0xaa5e('0x13')][_0xaa5e('0xe')](this));ami['on']('agentcomplete',this[_0xaa5e('0x14')][_0xaa5e('0xe')](this));ami['on'](_0xaa5e('0x15'),this[_0xaa5e('0x16')]['bind'](this));ami['on']('hangup',this[_0xaa5e('0x17')][_0xaa5e('0xe')](this));ami['on'](_0xaa5e('0x18'),this['syncMusicOnHoldStart']['bind'](this));ami['on']('musiconholdstop',this[_0xaa5e('0x19')]['bind'](this));ami['on']('attendedtransfer',this[_0xaa5e('0x1a')][_0xaa5e('0xe')](this));ami['on'](_0xaa5e('0x1b'),this[_0xaa5e('0x1c')][_0xaa5e('0xe')](this));}VoiceAgentReport[_0xaa5e('0x1d')][_0xaa5e('0x1e')]=function(_0x58ad01,_0x5a4588,_0x28b28c){io['to'](_0x58ad01)[_0xaa5e('0x1e')](_0x5a4588,_0x28b28c);};VoiceAgentReport['prototype'][_0xaa5e('0x1f')]=function(_0x1bb3b7){return _0x1bb3b7!==null&&!_['isUndefined'](_0x1bb3b7);};VoiceAgentReport['prototype'][_0xaa5e('0xd')]=function(_0x10d9c4){try{if(this['isNotNull'](_0x10d9c4)){logger['info'](_0xaa5e('0x20'),_0x10d9c4['uniqueid'],_0x10d9c4[_0xaa5e('0x21')],_0x10d9c4['destuniqueid']);logger['debug']('[%s][voiceAgentReport][agentcalled]\x20event:',_0x10d9c4[_0xaa5e('0x22')],util['inspect'](_0x10d9c4,{'showHidden':![],'depth':null}));if(_[_0xaa5e('0x23')](this[_0xaa5e('0x9')][_0x10d9c4[_0xaa5e('0x22')]])){this['channels'][_0x10d9c4[_0xaa5e('0x22')]]={};}if(_[_0xaa5e('0x23')](this[_0xaa5e('0x9')][_0x10d9c4[_0xaa5e('0x22')]][_0x10d9c4['destuniqueid']])){this[_0xaa5e('0x9')][_0x10d9c4[_0xaa5e('0x22')]][_0x10d9c4[_0xaa5e('0x24')]]={'agentcalledAt':moment()[_0xaa5e('0x25')](_0xaa5e('0x26')),'lastevent':'called','mandatoryDisposition':this[_0xaa5e('0xa')][_0x10d9c4['queue']]?this[_0xaa5e('0xa')][_0x10d9c4[_0xaa5e('0x27')]][_0xaa5e('0x28')]||![]:![],'type':this[_0xaa5e('0xa')][_0x10d9c4[_0xaa5e('0x27')]]?this[_0xaa5e('0xa')][_0x10d9c4[_0xaa5e('0x27')]][_0xaa5e('0x29')]||_0xaa5e('0x2a'):_0xaa5e('0x2a'),'variables':this[_0xaa5e('0xc')][_0x10d9c4[_0xaa5e('0x22')]],'motionChannel':_0xaa5e('0x2b')};}_[_0xaa5e('0x2c')](this[_0xaa5e('0x9')][_0x10d9c4[_0xaa5e('0x22')]][_0x10d9c4[_0xaa5e('0x24')]],_[_0xaa5e('0x2d')](_0x10d9c4,['event',_0xaa5e('0x2e')]));logger['debug']('[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:',_0x10d9c4[_0xaa5e('0x22')],util[_0xaa5e('0x2f')](this['channels'][_0x10d9c4['uniqueid']][_0x10d9c4[_0xaa5e('0x24')]],{'showHidden':![],'depth':null}));ami[_0xaa5e('0x1e')](_0xaa5e('0x30'),this[_0xaa5e('0x9')][_0x10d9c4['uniqueid']][_0x10d9c4[_0xaa5e('0x24')]]);logger['debug'](_0xaa5e('0x31'),_0x10d9c4[_0xaa5e('0x22')],util[_0xaa5e('0x2f')](this[_0xaa5e('0x9')][_0x10d9c4[_0xaa5e('0x22')]][_0x10d9c4[_0xaa5e('0x24')]],{'showHidden':![],'depth':null}));this[_0xaa5e('0x1e')](util['format'](_0xaa5e('0x32'),_0x10d9c4[_0xaa5e('0x21')]),'user:called',this[_0xaa5e('0x9')][_0x10d9c4[_0xaa5e('0x22')]][_0x10d9c4['destuniqueid']]);}}catch(_0x1dd152){logger[_0xaa5e('0x33')](_0xaa5e('0x34'),_0x10d9c4[_0xaa5e('0x22')],util['inspect'](_0x1dd152,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xaa5e('0x1d')][_0xaa5e('0x10')]=function(_0x50e5b9){try{if(this[_0xaa5e('0x1f')](_0x50e5b9)){if(this[_0xaa5e('0x9')][_0x50e5b9['uniqueid']]){logger[_0xaa5e('0x35')]('[%s][voiceAgentReport][agentconnect]\x20event:',_0x50e5b9['uniqueid'],util[_0xaa5e('0x2f')](_0x50e5b9,{'showHidden':![],'depth':null}));for(var _0x21bd9a in this[_0xaa5e('0x9')][_0x50e5b9[_0xaa5e('0x22')]]){if(this['channels'][_0x50e5b9[_0xaa5e('0x22')]][_0xaa5e('0x36')](_0x21bd9a)){if(_0x50e5b9[_0xaa5e('0x24')]===_0x21bd9a){logger[_0xaa5e('0x37')](_0xaa5e('0x38'),_0x50e5b9['uniqueid'],_0x50e5b9['membername'],_0x50e5b9['destuniqueid']);this[_0xaa5e('0x9')][_0x50e5b9[_0xaa5e('0x22')]][_0x21bd9a]['agentconnectAt']=moment()[_0xaa5e('0x25')](_0xaa5e('0x26'));this[_0xaa5e('0x9')][_0x50e5b9['uniqueid']][_0x21bd9a][_0xaa5e('0x39')]=_0x50e5b9[_0xaa5e('0x39')];this['channels'][_0x50e5b9[_0xaa5e('0x22')]][_0x21bd9a][_0xaa5e('0x3a')]=_0x50e5b9[_0xaa5e('0x3a')];this[_0xaa5e('0x9')][_0x50e5b9[_0xaa5e('0x22')]][_0x21bd9a]['destchannelstate']=_0x50e5b9['destchannelstate'];this['channels'][_0x50e5b9[_0xaa5e('0x22')]][_0x21bd9a][_0xaa5e('0x3b')]=_0x50e5b9[_0xaa5e('0x3b')];this[_0xaa5e('0x9')][_0x50e5b9[_0xaa5e('0x22')]][_0x21bd9a]['holdtime']=_0x50e5b9[_0xaa5e('0x3c')];this[_0xaa5e('0x9')][_0x50e5b9['uniqueid']][_0x21bd9a][_0xaa5e('0x3d')]=_0xaa5e('0x3e');if(this[_0xaa5e('0x8')][this[_0xaa5e('0x9')][_0x50e5b9[_0xaa5e('0x22')]][_0x21bd9a][_0xaa5e('0x22')]]){var _0x597960=this[_0xaa5e('0x8')][this[_0xaa5e('0x9')][_0x50e5b9[_0xaa5e('0x22')]][_0x21bd9a]['uniqueid']]['routealias'];this[_0xaa5e('0x9')][_0x50e5b9[_0xaa5e('0x22')]][_0x21bd9a][_0xaa5e('0x3f')]=_0x597960;_0x50e5b9[_0xaa5e('0x3f')]=_0x597960;}_[_0xaa5e('0x2c')](this[_0xaa5e('0xb')][_0x50e5b9[_0xaa5e('0x40')]],_[_0xaa5e('0x41')](_0x50e5b9,[_0xaa5e('0x27'),'destconnectedlinenum',_0xaa5e('0x3f')]));logger[_0xaa5e('0x35')](_0xaa5e('0x42'),_0x50e5b9['uniqueid'],util[_0xaa5e('0x2f')](this[_0xaa5e('0x9')][_0x50e5b9[_0xaa5e('0x22')]][_0x50e5b9[_0xaa5e('0x24')]],{'showHidden':![],'depth':null}));ami['emit']('custom:agentconnect',this['channels'][_0x50e5b9[_0xaa5e('0x22')]][_0x50e5b9[_0xaa5e('0x24')]]);logger['debug'](_0xaa5e('0x43'),_0x50e5b9[_0xaa5e('0x22')],util[_0xaa5e('0x2f')](this['channels'][_0x50e5b9[_0xaa5e('0x22')]][_0x50e5b9['destuniqueid']],{'showHidden':![],'depth':null}));this[_0xaa5e('0x1e')](util[_0xaa5e('0x25')](_0xaa5e('0x32'),_0x50e5b9[_0xaa5e('0x21')]),_0xaa5e('0x44'),this[_0xaa5e('0x9')][_0x50e5b9[_0xaa5e('0x22')]][_0x50e5b9[_0xaa5e('0x24')]]);}else if(!this[_0xaa5e('0x9')][_0x50e5b9[_0xaa5e('0x22')]][_0x21bd9a][_0xaa5e('0x11')]&&!this[_0xaa5e('0x9')][_0x50e5b9[_0xaa5e('0x22')]][_0x21bd9a][_0xaa5e('0x45')]){logger['info'](_0xaa5e('0x46'),_0x50e5b9[_0xaa5e('0x22')],this[_0xaa5e('0x9')][_0x50e5b9[_0xaa5e('0x22')]][_0x21bd9a][_0xaa5e('0x21')],_0x21bd9a);this[_0xaa5e('0x9')][_0x50e5b9[_0xaa5e('0x22')]][_0x21bd9a]['agentringnoanswer']=!![];this[_0xaa5e('0x9')][_0x50e5b9[_0xaa5e('0x22')]][_0x21bd9a][_0xaa5e('0x47')]=moment()[_0xaa5e('0x25')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xaa5e('0x9')][_0x50e5b9['uniqueid']][_0x21bd9a][_0xaa5e('0x48')]=_0x50e5b9[_0xaa5e('0x24')];this[_0xaa5e('0x9')][_0x50e5b9[_0xaa5e('0x22')]][_0x21bd9a]['answeredelsewheremembername']=_0x50e5b9[_0xaa5e('0x21')];this[_0xaa5e('0x9')][_0x50e5b9[_0xaa5e('0x22')]][_0x21bd9a][_0xaa5e('0x3d')]=_0xaa5e('0x49');this['channels'][_0x50e5b9['uniqueid']][_0x21bd9a][_0xaa5e('0x4a')]=_0xaa5e('0x49');logger[_0xaa5e('0x35')](_0xaa5e('0x4b'),_0x50e5b9[_0xaa5e('0x22')],util[_0xaa5e('0x2f')](this[_0xaa5e('0x9')][_0x50e5b9['uniqueid']][_0x21bd9a],{'showHidden':![],'depth':null}));ami['emit']('custom:agentansweredelsewhere',this[_0xaa5e('0x9')][_0x50e5b9[_0xaa5e('0x22')]][_0x21bd9a]);}}}}}}catch(_0x4512d6){logger['error']('[%s][voiceAgentReport][agentconnect]',_0x50e5b9[_0xaa5e('0x22')],util['inspect'](_0x4512d6,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xaa5e('0x1d')][_0xaa5e('0x4c')]=function(_0x92142c){try{if(this[_0xaa5e('0x1f')](_0x92142c)){logger['debug'](_0xaa5e('0x4d'),_0x92142c[_0xaa5e('0x22')],util[_0xaa5e('0x2f')](_0x92142c,{'showHidden':![],'depth':null}));if(this[_0xaa5e('0x9')][_0x92142c[_0xaa5e('0x22')]]&&this[_0xaa5e('0x9')][_0x92142c[_0xaa5e('0x22')]][_0x92142c[_0xaa5e('0x24')]]){logger[_0xaa5e('0x37')]('[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected',_0x92142c[_0xaa5e('0x22')],_0x92142c[_0xaa5e('0x21')],_0x92142c[_0xaa5e('0x24')]);this[_0xaa5e('0x9')][_0x92142c[_0xaa5e('0x22')]][_0x92142c[_0xaa5e('0x24')]][_0xaa5e('0x11')]=!![];this[_0xaa5e('0x9')][_0x92142c[_0xaa5e('0x22')]][_0x92142c[_0xaa5e('0x24')]][_0xaa5e('0x47')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0xaa5e('0x9')][_0x92142c[_0xaa5e('0x22')]][_0x92142c[_0xaa5e('0x24')]][_0xaa5e('0x3d')]='rejected';this[_0xaa5e('0x9')][_0x92142c[_0xaa5e('0x22')]][_0x92142c[_0xaa5e('0x24')]]['reason']=_0xaa5e('0x4e');logger['debug'](_0xaa5e('0x4f'),_0x92142c['uniqueid'],util['inspect'](this[_0xaa5e('0x9')][_0x92142c[_0xaa5e('0x22')]][_0x92142c[_0xaa5e('0x24')]],{'showHidden':![],'depth':null}));ami['emit']('custom:agentringnoanswer',this[_0xaa5e('0x9')][_0x92142c[_0xaa5e('0x22')]][_0x92142c['destuniqueid']]);}}}catch(_0x50502b){logger[_0xaa5e('0x33')](_0xaa5e('0x50'),_0x92142c[_0xaa5e('0x22')],util[_0xaa5e('0x2f')](_0x50502b,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xaa5e('0x1d')][_0xaa5e('0x13')]=function(_0x4ea18f){try{if(this[_0xaa5e('0x1f')](_0x4ea18f)){logger[_0xaa5e('0x35')](_0xaa5e('0x51'),_0x4ea18f['uniqueid'],util[_0xaa5e('0x2f')](_0x4ea18f,{'showHidden':![],'depth':null}));if(this['channels'][_0x4ea18f['uniqueid']]){for(var _0x4c1849 in this[_0xaa5e('0x9')][_0x4ea18f[_0xaa5e('0x22')]]){if(this[_0xaa5e('0x9')][_0x4ea18f['uniqueid']][_0xaa5e('0x36')](_0x4c1849)&&!this[_0xaa5e('0x9')][_0x4ea18f[_0xaa5e('0x22')]][_0x4c1849]['agentringnoanswer']&&!this[_0xaa5e('0x9')][_0x4ea18f['uniqueid']][_0x4c1849][_0xaa5e('0x45')]){logger[_0xaa5e('0x37')](_0xaa5e('0x52'),_0x4ea18f[_0xaa5e('0x22')],this[_0xaa5e('0x9')][_0x4ea18f[_0xaa5e('0x22')]][_0x4c1849][_0xaa5e('0x21')],_0x4c1849);this['channels'][_0x4ea18f[_0xaa5e('0x22')]][_0x4c1849][_0xaa5e('0x11')]=!![];this[_0xaa5e('0x9')][_0x4ea18f[_0xaa5e('0x22')]][_0x4c1849]['agentringnoanswerAt']=moment()[_0xaa5e('0x25')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xaa5e('0x9')][_0x4ea18f['uniqueid']][_0x4c1849][_0xaa5e('0x3d')]=_0xaa5e('0x53');this[_0xaa5e('0x9')][_0x4ea18f[_0xaa5e('0x22')]][_0x4c1849][_0xaa5e('0x4a')]='abandoned';logger[_0xaa5e('0x35')](_0xaa5e('0x54'),_0x4ea18f[_0xaa5e('0x22')],util['inspect'](this[_0xaa5e('0x9')][_0x4ea18f['uniqueid']][_0x4c1849],{'showHidden':![],'depth':null}));ami[_0xaa5e('0x1e')](_0xaa5e('0x55'),this[_0xaa5e('0x9')][_0x4ea18f[_0xaa5e('0x22')]][_0x4c1849]);}}}}}catch(_0x363e0f){logger['error'](_0xaa5e('0x56'),_0x4ea18f[_0xaa5e('0x22')],util[_0xaa5e('0x2f')](_0x363e0f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xaa5e('0x1d')]['syncAgentComplete']=function(_0x291a57){try{if(this[_0xaa5e('0x1f')](_0x291a57)){logger['debug']('[%s][voiceAgentReport][agentcomplete]\x20event:',_0x291a57[_0xaa5e('0x22')],util[_0xaa5e('0x2f')](_0x291a57,{'showHidden':![],'depth':null}));if(this['channels'][_0x291a57[_0xaa5e('0x22')]]){for(var _0x4fdcf6 in this[_0xaa5e('0x9')][_0x291a57[_0xaa5e('0x22')]]){if(this['channels'][_0x291a57[_0xaa5e('0x22')]][_0xaa5e('0x36')](_0x4fdcf6)){if(this[_0xaa5e('0x9')][_0x291a57[_0xaa5e('0x22')]][_0x4fdcf6][_0xaa5e('0x57')]&&!this['channels'][_0x291a57[_0xaa5e('0x22')]][_0x4fdcf6][_0xaa5e('0x45')]){logger[_0xaa5e('0x37')]('[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x291a57[_0xaa5e('0x22')],this[_0xaa5e('0x9')][_0x291a57[_0xaa5e('0x22')]][_0x4fdcf6][_0xaa5e('0x21')],_0x4fdcf6);this[_0xaa5e('0x9')][_0x291a57[_0xaa5e('0x22')]][_0x4fdcf6][_0xaa5e('0x45')]=!![];this['channels'][_0x291a57[_0xaa5e('0x22')]][_0x4fdcf6][_0xaa5e('0x58')]=moment()[_0xaa5e('0x25')](_0xaa5e('0x26'));this['channels'][_0x291a57[_0xaa5e('0x22')]][_0x4fdcf6]['lastevent']=_0xaa5e('0x59');this[_0xaa5e('0x9')][_0x291a57[_0xaa5e('0x22')]][_0x4fdcf6][_0xaa5e('0x4a')]=_0x291a57[_0xaa5e('0x4a')]==_0xaa5e('0x5a')?'agent':_0x291a57[_0xaa5e('0x4a')];this['channels'][_0x291a57[_0xaa5e('0x22')]][_0x4fdcf6][_0xaa5e('0x5b')]=_0x291a57[_0xaa5e('0x5b')];if(this[_0xaa5e('0xa')][_0x291a57['queue']]&&this[_0xaa5e('0xa')][_0x291a57['queue']][_0xaa5e('0x5c')]){this[_0xaa5e('0x9')][_0x291a57[_0xaa5e('0x22')]][_0x4fdcf6][_0xaa5e('0x5d')]=this['voiceQueues'][_0x291a57[_0xaa5e('0x27')]][_0xaa5e('0x5e')];this[_0xaa5e('0x9')][_0x291a57[_0xaa5e('0x22')]][_0x4fdcf6]['agentacw']=!![];}this['agents'][_0x291a57[_0xaa5e('0x40')]]=_[_0xaa5e('0x2d')](this['agents'][_0x291a57[_0xaa5e('0x40')]],[_0xaa5e('0x27'),_0xaa5e('0x5f')]);logger[_0xaa5e('0x35')](_0xaa5e('0x60'),_0x291a57['uniqueid'],util['inspect'](this['channels'][_0x291a57[_0xaa5e('0x22')]][_0x4fdcf6],{'showHidden':![],'depth':null}));ami[_0xaa5e('0x1e')](_0xaa5e('0x61'),this[_0xaa5e('0x9')][_0x291a57[_0xaa5e('0x22')]][_0x4fdcf6]);logger[_0xaa5e('0x35')]('[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:',_0x291a57[_0xaa5e('0x22')],util[_0xaa5e('0x2f')](this[_0xaa5e('0x9')][_0x291a57[_0xaa5e('0x22')]][_0x4fdcf6],{'showHidden':![],'depth':null}));this[_0xaa5e('0x1e')](util[_0xaa5e('0x25')](_0xaa5e('0x32'),_0x291a57['membername']),_0xaa5e('0x62'),this[_0xaa5e('0x9')][_0x291a57[_0xaa5e('0x22')]][_0x4fdcf6]);}}}}}}catch(_0x5ae240){logger[_0xaa5e('0x33')](_0xaa5e('0x63'),_0x291a57[_0xaa5e('0x22')],util[_0xaa5e('0x2f')](_0x5ae240,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xaa5e('0x1d')][_0xaa5e('0x16')]=function(_0x596c07){try{if(this[_0xaa5e('0x1f')](_0x596c07)){logger[_0xaa5e('0x35')](_0xaa5e('0x64'),_0x596c07[_0xaa5e('0x22')],util[_0xaa5e('0x2f')](_0x596c07,{'showHidden':![],'depth':null}));this['addVariable'](_0x596c07[_0xaa5e('0x22')],_[_0xaa5e('0x65')](_0x596c07[_0xaa5e('0x66')])[0x0],_0x596c07[_0xaa5e('0x67')]);if(this['channels'][_0x596c07[_0xaa5e('0x22')]]){for(var _0x14f6ae in this['channels'][_0x596c07[_0xaa5e('0x22')]]){if(this['channels'][_0x596c07[_0xaa5e('0x22')]][_0xaa5e('0x36')](_0x14f6ae)){logger['info'](_0xaa5e('0x68'),_0x596c07[_0xaa5e('0x22')],_0x14f6ae,_['keys'](_0x596c07[_0xaa5e('0x66')])[0x0],_0x596c07['value']);if(_['isUndefined'](this[_0xaa5e('0x9')][_0x596c07[_0xaa5e('0x22')]][_0x14f6ae]['variables'])){this['channels'][_0x596c07[_0xaa5e('0x22')]][_0x14f6ae][_0xaa5e('0xc')]={};}this[_0xaa5e('0x9')][_0x596c07[_0xaa5e('0x22')]][_0x14f6ae][_0xaa5e('0xc')]=this['variables'][_0x596c07['uniqueid']];}}}}}catch(_0x51fa7e){logger['error'](_0xaa5e('0x69'),_0x596c07[_0xaa5e('0x22')],util[_0xaa5e('0x2f')](_0x51fa7e,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xaa5e('0x1d')][_0xaa5e('0x6a')]=function(_0x50e43d,_0x190347,_0x24cc05){var _0xd37a43=[_0xaa5e('0x6b'),_0xaa5e('0x6c'),_0xaa5e('0x6d'),_0xaa5e('0x6e'),_0xaa5e('0x6f'),_0xaa5e('0x70'),_0xaa5e('0x71'),_0xaa5e('0x72'),_0xaa5e('0x73'),_0xaa5e('0x74'),_0xaa5e('0x75'),'bridgepvtcallid',_0xaa5e('0x76'),_0xaa5e('0x77'),_0xaa5e('0x78'),'memberlastcall',_0xaa5e('0x21'),_0xaa5e('0x79'),_0xaa5e('0x7a')];if(!_[_0xaa5e('0x7b')](_0x190347)&&!_[_0xaa5e('0x7c')](_0xd37a43,_0x190347)){if(_[_0xaa5e('0x23')](this[_0xaa5e('0xc')][_0x50e43d])){this[_0xaa5e('0xc')][_0x50e43d]={};}this[_0xaa5e('0xc')][_0x50e43d][_0x190347]=_0x24cc05;}};VoiceAgentReport[_0xaa5e('0x1d')]['syncHangup']=function(_0x42ffae){try{if(this[_0xaa5e('0x1f')](_0x42ffae)){logger[_0xaa5e('0x35')]('[%s][voiceAgentReport][hangup]\x20event:',_0x42ffae['uniqueid'],util[_0xaa5e('0x2f')](_0x42ffae,{'showHidden':![],'depth':null}));if(this[_0xaa5e('0x9')][_0x42ffae[_0xaa5e('0x22')]]){for(var _0x29e5c0 in this['channels'][_0x42ffae[_0xaa5e('0x22')]]){if(this[_0xaa5e('0x9')][_0x42ffae[_0xaa5e('0x22')]]['hasOwnProperty'](_0x29e5c0)){if(this['channels'][_0x42ffae[_0xaa5e('0x22')]][_0x29e5c0][_0xaa5e('0x4a')]=='transfer'&&this[_0xaa5e('0x9')][_0x42ffae[_0xaa5e('0x22')]][_0x29e5c0][_0xaa5e('0x45')]){logger['info']('[%s][voiceAgentReport][hangup]\x20destuniqueid:%s',_0x42ffae[_0xaa5e('0x22')],_0x29e5c0);this[_0xaa5e('0x9')][_0x42ffae[_0xaa5e('0x22')]][_0x29e5c0][_0xaa5e('0x58')]=moment()[_0xaa5e('0x25')](_0xaa5e('0x26'));}}}logger[_0xaa5e('0x35')]('[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:',_0x42ffae[_0xaa5e('0x22')],util[_0xaa5e('0x2f')](_['values'](this[_0xaa5e('0x9')][_0x42ffae['uniqueid']]),{'showHidden':![],'depth':null}));ami[_0xaa5e('0x1e')](_0xaa5e('0x7d'),_[_0xaa5e('0x7e')](this[_0xaa5e('0x9')][_0x42ffae[_0xaa5e('0x22')]]));delete this['channels'][_0x42ffae[_0xaa5e('0x22')]];}if(this['variables'][_0x42ffae['uniqueid']]){delete this[_0xaa5e('0xc')][_0x42ffae['uniqueid']];}}}catch(_0x2b67b0){logger[_0xaa5e('0x33')](_0xaa5e('0x7f'),_0x42ffae[_0xaa5e('0x22')],util['inspect'](_0x2b67b0,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xaa5e('0x1d')][_0xaa5e('0x1a')]=function(_0x10cbcc){try{if(this[_0xaa5e('0x1f')](_0x10cbcc)){logger[_0xaa5e('0x35')](_0xaa5e('0x80'),_0x10cbcc['uniqueid'],util[_0xaa5e('0x2f')](_0x10cbcc,{'showHidden':![],'depth':null}));if(this[_0xaa5e('0x9')][_0x10cbcc[_0xaa5e('0x81')]]){for(var _0x23a0e6 in this['channels'][_0x10cbcc['transfereeuniqueid']]){if(this[_0xaa5e('0x9')][_0x10cbcc['transfereeuniqueid']][_0xaa5e('0x36')](_0x23a0e6)){if(_0x10cbcc['origtransfereruniqueid']===_0x23a0e6){logger[_0xaa5e('0x37')](_0xaa5e('0x82'),_0x10cbcc[_0xaa5e('0x22')],this['channels'][_0x10cbcc[_0xaa5e('0x81')]][_0x23a0e6][_0xaa5e('0x21')],_0x23a0e6);var _0xc00497=moment();this['channels'][_0x10cbcc[_0xaa5e('0x81')]][_0x23a0e6][_0xaa5e('0x45')]=!![];this['channels'][_0x10cbcc[_0xaa5e('0x81')]][_0x23a0e6][_0xaa5e('0x58')]=moment()[_0xaa5e('0x25')](_0xaa5e('0x26'));this[_0xaa5e('0x9')][_0x10cbcc[_0xaa5e('0x81')]][_0x23a0e6][_0xaa5e('0x3d')]=_0xaa5e('0x59');this[_0xaa5e('0x9')][_0x10cbcc[_0xaa5e('0x81')]][_0x23a0e6][_0xaa5e('0x4a')]=_0xaa5e('0x5a');this[_0xaa5e('0x9')][_0x10cbcc[_0xaa5e('0x81')]][_0x23a0e6][_0xaa5e('0x5b')]=_0xc00497[_0xaa5e('0x83')](this[_0xaa5e('0x9')][_0x10cbcc[_0xaa5e('0x81')]][_0x23a0e6][_0xaa5e('0x57')],_0xaa5e('0x84'));}}}}if(this[_0xaa5e('0x9')][_0x10cbcc[_0xaa5e('0x85')]]){var _0x2ebeed=this[_0xaa5e('0x9')][_0x10cbcc[_0xaa5e('0x85')]];this[_0xaa5e('0x9')][_0x10cbcc[_0xaa5e('0x85')]]=this[_0xaa5e('0x9')][_0x10cbcc['transfereeuniqueid']];this[_0xaa5e('0x9')][_0x10cbcc[_0xaa5e('0x81')]]=_0x2ebeed;}}}catch(_0x539864){logger[_0xaa5e('0x33')]('[%s][voiceAgentReport][attendedtransfer]',_0x10cbcc[_0xaa5e('0x22')],util[_0xaa5e('0x2f')](_0x539864,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xaa5e('0x1d')]['syncBlindTransfer']=function(_0x378313){try{if(this[_0xaa5e('0x1f')](_0x378313)){logger[_0xaa5e('0x35')](_0xaa5e('0x86'),_0x378313[_0xaa5e('0x22')],util[_0xaa5e('0x2f')](_0x378313,{'showHidden':![],'depth':null}));if(this[_0xaa5e('0x9')][_0x378313[_0xaa5e('0x81')]]){for(var _0x31f844 in this[_0xaa5e('0x9')][_0x378313[_0xaa5e('0x81')]]){if(this[_0xaa5e('0x9')][_0x378313[_0xaa5e('0x81')]][_0xaa5e('0x36')](_0x31f844)){if(_0x378313['transfereruniqueid']===_0x31f844){logger['info'](_0xaa5e('0x87'),_0x378313[_0xaa5e('0x22')],this['channels'][_0x378313[_0xaa5e('0x81')]][_0x31f844]['membername'],_0x31f844);var _0x1d5e33=moment();this[_0xaa5e('0x9')][_0x378313[_0xaa5e('0x81')]][_0x31f844][_0xaa5e('0x45')]=!![];this[_0xaa5e('0x9')][_0x378313[_0xaa5e('0x81')]][_0x31f844][_0xaa5e('0x58')]=_0x1d5e33;this['channels'][_0x378313[_0xaa5e('0x81')]][_0x31f844][_0xaa5e('0x3d')]=_0xaa5e('0x59');this[_0xaa5e('0x9')][_0x378313[_0xaa5e('0x81')]][_0x31f844][_0xaa5e('0x4a')]=_0xaa5e('0x5a');this[_0xaa5e('0x9')][_0x378313[_0xaa5e('0x81')]][_0x31f844]['talktime']=_0x1d5e33[_0xaa5e('0x83')](this[_0xaa5e('0x9')][_0x378313[_0xaa5e('0x81')]][_0x31f844][_0xaa5e('0x57')],_0xaa5e('0x84'));}}}}}}catch(_0x3c1d0b){logger[_0xaa5e('0x33')](_0xaa5e('0x88'),_0x378313[_0xaa5e('0x22')],util[_0xaa5e('0x2f')](_0x3c1d0b,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xaa5e('0x1d')][_0xaa5e('0x89')]=function(_0x15dae5){var _0x28413a='';try{if(this[_0xaa5e('0x1f')](_0x15dae5)){logger[_0xaa5e('0x35')](_0xaa5e('0x8a'),_0x15dae5['uniqueid'],util['inspect'](_0x15dae5,{'showHidden':![],'depth':null}));if(_0x15dae5[_0xaa5e('0x8b')]){_0x28413a=_0x15dae5['channel'][_0xaa5e('0x8c')](0x0,_0x15dae5['channel'][_0xaa5e('0x8d')]('-'));if(this['agents'][_0x28413a]){logger['info'](_0xaa5e('0x8e'),_0x15dae5[_0xaa5e('0x22')],_0x28413a);this[_0xaa5e('0xb')][_0x28413a][_0xaa5e('0x8f')]=!![];}}}}catch(_0x5d7200){logger['error']('[%s][voiceAgentReport][musiconholdstart]',_0x15dae5[_0xaa5e('0x22')],util[_0xaa5e('0x2f')](_0x5d7200,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xaa5e('0x19')]=function(_0xe2bb29){var _0x22bf86='';try{if(this[_0xaa5e('0x1f')](_0xe2bb29)){logger[_0xaa5e('0x35')]('[%s][voiceAgentReport][musiconholdstop]\x20event:',_0xe2bb29['uniqueid'],util[_0xaa5e('0x2f')](_0xe2bb29,{'showHidden':![],'depth':null}));if(_0xe2bb29[_0xaa5e('0x8b')]){_0x22bf86=_0xe2bb29['channel'][_0xaa5e('0x8c')](0x0,_0xe2bb29[_0xaa5e('0x8b')][_0xaa5e('0x8d')]('-'));if(this[_0xaa5e('0xb')][_0x22bf86]){logger[_0xaa5e('0x37')](_0xaa5e('0x90'),_0xe2bb29[_0xaa5e('0x22')],_0x22bf86);this[_0xaa5e('0xb')][_0x22bf86]['onhold']=![];}}}}catch(_0x15455f){logger['error']('[%s][voiceAgentReport][musiconholdstop]',_0xe2bb29['uniqueid'],util[_0xaa5e('0x2f')](_0x15455f,{'showHidden':![],'depth':null}));}};module['exports']=VoiceAgentReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceCallReport.js b/server/services/ami/report/voiceCallReport.js index 50d421b..f8ca839 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 _0x4169=['endtime','holdtime','billableseconds','omit','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','resolve','transferType','isEmpty','monitors','getSettings','Action','then','StopMixMonitor','catch','finally','event','BlindTransfer','type','outbound','[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:','custom:voiceCallReport','[%s][voiceCallReport][hangup]','origtransferercalleridnum','transfertargetcalleridnum','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','transferconnectedlinenum','secondtransfereruniqueid','transfertargetuniqueid','transfercalleridnum','origtransfereruniqueid','origtransfererlinkedid','some','ATTENDED','[%s][voiceCallReport][attendedtransfer]','[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','transfereecalleridnum','[%s][voiceCallReport][blindtransfer]\x20event:','extension','transfererchannel','transfereruniqueid','[%s][voiceCallReport][blindtransfer]','[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceCallReport][musiconholdstart]','[%s][voiceCallReport][musiconholdstop]\x20event:','mohstarttime','mohtime','[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s','[%s][voiceCallReport][musiconholdstop]','exports','bluebird','moment','util','path','ioredis','../../../config/environment','../../../config/logger','ami','../ami','../rpc/setting','unknown','inuse','busy','invalid','ringing','ringinuse','onhold','agi','dial','voicemail','NO\x20ANSWER','FAILED','ANSWERED','BUSY','redis','defaults','localhost','socket.io-emitter','channels','agents','blindTransfers','coreshowchannel','syncNewExten','bind','newexten','newchannel','newstate','syncNewState','varset','syncVarSet','hangup','syncHangup','newcallerid','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','[voiceCallReport][coreshowchannels]\x20started','actionCoreShowChannels','error','[voiceCallReport][coreshowchannels]','inspect','prototype','isNotNull','isUndefined','emit','syncNewCallerId','info','uniqueid','calleridname','debug','linkedid','merge','pick','context','from-sip','channel','split','destconnectedlinenum','connectedlinenum','format','user:%s','user:agentconnect','accountcode','[%s][voiceCallReport][newcallerid]','syncNewChannel','[%s][voiceCallReport][newchannel]\x20event:','OutgoingSpoolFailed','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','exten','starttime','YYYY-MM-DD\x20HH:mm:ss','channelstate','keys','[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:','name','[%s][voiceCallReport][newexten]\x20event:','application','toLowerCase','applicationdata','appdata','startsWith','CDR(routeAlias)','duration','subtract','seconds','disposition','includes','lastdata','set','cdr(','match','queue','[%s][voiceCallReport][newexten]','answered','answertime','diff','calleridnum','xcally-motion-preview','connectedlinename','destinationchannel','toNumber','UserId','membername','[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:','[%s][voiceCallReport][newstate]','syncMixMonitorFilename','monitor','endsWith','.wav49','replace','.WAV','monitorFilename','isNil','push','rec','[%s][voiceCallReport][varset]\x20event:','variable','mixmonitor_filename','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','value','xmd-phone','xmd-callerid','callerid','xmd-cdrtype','[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s','xmd-queue','xmd-originatecalleridnum','[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','xmd-destination','[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s','destination','xmd-callerid-preview','[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s','calleridpreview','xmcs-queue','[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s','sipcallid','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','sipcalluniqueid','[%s][voiceCallReport][varset]','[%s][voiceCallReport][hangup]\x20event:','cause-txt'];(function(_0x352809,_0x59100a){var _0x351383=function(_0x63b89b){while(--_0x63b89b){_0x352809['push'](_0x352809['shift']());}};_0x351383(++_0x59100a);}(_0x4169,0x102));var _0x9416=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x4169[_0x20a584];return _0x4b41a8;};'use strict';var BPromise=require(_0x9416('0x0'));var _=require('lodash');var moment=require(_0x9416('0x1'));var util=require(_0x9416('0x2'));var path=require(_0x9416('0x3'));var Redis=require(_0x9416('0x4'));var config=require(_0x9416('0x5'));var logger=require(_0x9416('0x6'))(_0x9416('0x7'));var ami=require(_0x9416('0x8'));var Channel=require('../model/channel');var RpcSetting=require(_0x9416('0x9'));var statusDesc=[_0x9416('0xa'),'not_inuse',_0x9416('0xb'),_0x9416('0xc'),_0x9416('0xd'),'unavailable',_0x9416('0xe'),_0x9416('0xf'),_0x9416('0x10')];var applications=['set','queue',_0x9416('0x11'),_0x9416('0x12'),'playback',_0x9416('0x13')];var dispositions=[_0x9416('0x14'),_0x9416('0x15'),_0x9416('0x15'),_0x9416('0x14'),_0x9416('0x14'),_0x9416('0x14'),_0x9416('0x16'),_0x9416('0x17'),_0x9416('0x15'),_0x9416('0x15'),_0x9416('0x15')];var actions={};config[_0x9416('0x18')]=_[_0x9416('0x19')](config['redis'],{'host':_0x9416('0x1a'),'port':0x18eb});var io=require(_0x9416('0x1b'))(new Redis(config[_0x9416('0x18')]));function VoiceCallReport(_0x3164e3){this[_0x9416('0x1c')]=_0x3164e3[_0x9416('0x1c')];this[_0x9416('0x1d')]=_0x3164e3['agents'];this[_0x9416('0x1e')]={};ami['on'](_0x9416('0x1f'),this[_0x9416('0x20')][_0x9416('0x21')](this));ami['on'](_0x9416('0x22'),this[_0x9416('0x20')]['bind'](this));ami['on'](_0x9416('0x23'),this['syncNewChannel'][_0x9416('0x21')](this));ami['on'](_0x9416('0x24'),this[_0x9416('0x25')][_0x9416('0x21')](this));ami['on'](_0x9416('0x26'),this[_0x9416('0x27')][_0x9416('0x21')](this));ami['on'](_0x9416('0x28'),this[_0x9416('0x29')]['bind'](this));ami['on'](_0x9416('0x2a'),this['syncNewCallerId']['bind'](this));ami['on'](_0x9416('0x2b'),this[_0x9416('0x2c')][_0x9416('0x21')](this));ami['on']('blindtransfer',this[_0x9416('0x2d')][_0x9416('0x21')](this));ami['on'](_0x9416('0x2e'),this[_0x9416('0x2f')][_0x9416('0x21')](this));ami['on'](_0x9416('0x30'),this[_0x9416('0x31')][_0x9416('0x21')](this));try{logger['info'](_0x9416('0x32'));ami[_0x9416('0x33')]();}catch(_0x3bd8f9){logger[_0x9416('0x34')](_0x9416('0x35'),util[_0x9416('0x36')](_0x3bd8f9,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0x9416('0x37')][_0x9416('0x38')]=function(_0x83e2a5){return _0x83e2a5!==null&&!_[_0x9416('0x39')](_0x83e2a5);};VoiceCallReport['prototype']['emit']=function(_0x2ff3a7,_0x37f128,_0x22cd38){io['to'](_0x2ff3a7)[_0x9416('0x3a')](_0x37f128,_0x22cd38);};VoiceCallReport['prototype'][_0x9416('0x3b')]=function(_0x3a7c07){try{if(this[_0x9416('0x38')](_0x3a7c07)){logger[_0x9416('0x3c')]('[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s',_0x3a7c07[_0x9416('0x3d')],_0x3a7c07[_0x9416('0x3e')],_0x3a7c07['calleridnum']);logger[_0x9416('0x3f')]('[%s][voiceCallReport][newcallerid]\x20event:',_0x3a7c07[_0x9416('0x3d')],util[_0x9416('0x36')](_0x3a7c07,{'showHidden':![],'depth':null}));if(_0x3a7c07['uniqueid']===_0x3a7c07[_0x9416('0x40')]){if(!_[_0x9416('0x39')](this[_0x9416('0x1c')][_0x3a7c07[_0x9416('0x3d')]])){_[_0x9416('0x41')](this[_0x9416('0x1c')][_0x3a7c07[_0x9416('0x3d')]],_[_0x9416('0x42')](_0x3a7c07,_['keys'](this['channels'][_0x3a7c07[_0x9416('0x3d')]])));}}if(_0x3a7c07[_0x9416('0x43')]===_0x9416('0x44')){if(this['agents'][_0x3a7c07[_0x9416('0x45')]['split']('-')[0x0]]){if(_0x3a7c07['exten']=='xcally-motion-preview'){this['agents'][_0x3a7c07[_0x9416('0x45')][_0x9416('0x46')]('-')[0x0]][_0x9416('0x47')]=_0x3a7c07[_0x9416('0x48')];this[_0x9416('0x3a')](util[_0x9416('0x49')](_0x9416('0x4a'),this['agents'][_0x3a7c07[_0x9416('0x45')][_0x9416('0x46')]('-')[0x0]]['name']),_0x9416('0x4b'),{'destaccountcode':this[_0x9416('0x1d')][_0x3a7c07[_0x9416('0x45')][_0x9416('0x46')]('-')[0x0]][_0x9416('0x4c')],'destconnectedlinenum':_0x3a7c07[_0x9416('0x48')]});}}}}}catch(_0x6a78f8){logger[_0x9416('0x34')](_0x9416('0x4d'),_0x3a7c07[_0x9416('0x3d')],util[_0x9416('0x36')](_0x6a78f8,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9416('0x37')][_0x9416('0x4e')]=function(_0x368b11){try{if(this[_0x9416('0x38')](_0x368b11)){logger[_0x9416('0x3f')](_0x9416('0x4f'),_0x368b11[_0x9416('0x3d')],util[_0x9416('0x36')](_0x368b11,{'showHidden':![],'depth':null}));if(_0x368b11[_0x9416('0x3d')]===_0x368b11[_0x9416('0x40')]&&_0x368b11['channel']!=_0x9416('0x50')){if(_[_0x9416('0x39')](this[_0x9416('0x1c')][_0x368b11[_0x9416('0x3d')]])){logger[_0x9416('0x3c')](_0x9416('0x51'),_0x368b11[_0x9416('0x3d')],_0x368b11[_0x9416('0x43')],_0x368b11[_0x9416('0x52')]);this[_0x9416('0x1c')][_0x368b11[_0x9416('0x3d')]]=new Channel();this['channels'][_0x368b11[_0x9416('0x3d')]][_0x9416('0x53')]=moment()[_0x9416('0x49')](_0x9416('0x54'));this['channels'][_0x368b11[_0x9416('0x3d')]]['disposition']=dispositions[_['toNumber'](_0x368b11[_0x9416('0x55')])];_[_0x9416('0x41')](this[_0x9416('0x1c')][_0x368b11[_0x9416('0x3d')]],_[_0x9416('0x42')](_0x368b11,_[_0x9416('0x56')](this[_0x9416('0x1c')][_0x368b11[_0x9416('0x3d')]])));if(_0x368b11[_0x9416('0x43')]===_0x9416('0x44')){if(this[_0x9416('0x1d')][_0x368b11['channel'][_0x9416('0x46')]('-')[0x0]]){if(_[_0x9416('0x39')](this[_0x9416('0x1d')][_0x368b11[_0x9416('0x45')][_0x9416('0x46')]('-')[0x0]][_0x9416('0x47')])){this[_0x9416('0x1d')][_0x368b11[_0x9416('0x45')][_0x9416('0x46')]('-')[0x0]][_0x9416('0x47')]=_0x368b11[_0x9416('0x52')];logger[_0x9416('0x3f')](_0x9416('0x57'),_0x368b11[_0x9416('0x3d')],util[_0x9416('0x36')]({'destaccountcode':this[_0x9416('0x1d')][_0x368b11[_0x9416('0x45')]['split']('-')[0x0]][_0x9416('0x4c')],'destconnectedlinenum':_0x368b11[_0x9416('0x52')]},{'showHidden':![],'depth':null}));this[_0x9416('0x3a')](util[_0x9416('0x49')](_0x9416('0x4a'),this[_0x9416('0x1d')][_0x368b11[_0x9416('0x45')]['split']('-')[0x0]][_0x9416('0x58')]),_0x9416('0x4b'),{'destaccountcode':this[_0x9416('0x1d')][_0x368b11['channel']['split']('-')[0x0]][_0x9416('0x4c')],'destconnectedlinenum':_0x368b11[_0x9416('0x52')]});}}}}}}}catch(_0x194307){logger['error']('[%s][voiceCallReport][newchannel]',_0x368b11['uniqueid'],util[_0x9416('0x36')](_0x194307,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9416('0x37')][_0x9416('0x20')]=function(_0x3bf0b3){try{if(this[_0x9416('0x38')](_0x3bf0b3)){logger[_0x9416('0x3f')](_0x9416('0x59'),_0x3bf0b3[_0x9416('0x3d')],util[_0x9416('0x36')](_0x3bf0b3,{'showHidden':![],'depth':null}));if(_0x3bf0b3[_0x9416('0x3d')]===_0x3bf0b3[_0x9416('0x40')]&&_0x3bf0b3[_0x9416('0x52')]!='h'&&_0x3bf0b3[_0x9416('0x45')]!='OutgoingSpoolFailed'){_0x3bf0b3[_0x9416('0x5a')]=_0x3bf0b3[_0x9416('0x5a')][_0x9416('0x5b')]();_0x3bf0b3[_0x9416('0x5c')]=_0x3bf0b3[_0x9416('0x5d')]&&_0x3bf0b3[_0x9416('0x5d')][_0x9416('0x5e')](_0x9416('0x5f'))?_0x3bf0b3[_0x9416('0x5d')]:(_0x3bf0b3[_0x9416('0x5d')]||_0x3bf0b3[_0x9416('0x5c')])[_0x9416('0x5b')]();logger[_0x9416('0x3c')]('[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s',_0x3bf0b3[_0x9416('0x3d')],_0x3bf0b3[_0x9416('0x5a')],_0x3bf0b3[_0x9416('0x5c')]);if(_[_0x9416('0x39')](this[_0x9416('0x1c')][_0x3bf0b3[_0x9416('0x3d')]])){this[_0x9416('0x1c')][_0x3bf0b3[_0x9416('0x3d')]]=new Channel();this['channels'][_0x3bf0b3[_0x9416('0x3d')]][_0x9416('0x53')]=_0x3bf0b3[_0x9416('0x60')]?moment()[_0x9416('0x61')](moment[_0x9416('0x60')](_0x3bf0b3[_0x9416('0x60')])[_0x9416('0x62')](),_0x9416('0x62'))[_0x9416('0x49')](_0x9416('0x54')):moment()[_0x9416('0x49')](_0x9416('0x54'));this[_0x9416('0x1c')][_0x3bf0b3[_0x9416('0x3d')]][_0x9416('0x63')]=_0x9416('0x14');}_[_0x9416('0x41')](this['channels'][_0x3bf0b3[_0x9416('0x3d')]],_[_0x9416('0x42')](_0x3bf0b3,_[_0x9416('0x56')](this[_0x9416('0x1c')][_0x3bf0b3[_0x9416('0x3d')]])));if(_[_0x9416('0x64')](applications,_0x3bf0b3[_0x9416('0x5a')])){this['channels'][_0x3bf0b3[_0x9416('0x3d')]]['lastapplication']=_0x3bf0b3[_0x9416('0x5a')];this[_0x9416('0x1c')][_0x3bf0b3[_0x9416('0x3d')]][_0x9416('0x65')]=_0x3bf0b3['applicationdata'];if(_0x3bf0b3[_0x9416('0x5a')]===_0x9416('0x66')&&_[_0x9416('0x5e')](_0x3bf0b3[_0x9416('0x5c')][_0x9416('0x5b')](),_0x9416('0x67'))){var _0x2bf858=_0x3bf0b3[_0x9416('0x5c')]['split']('=');var _0x4130f1=_0x2bf858[0x0][_0x9416('0x5b')]()[_0x9416('0x68')](/cdr\((.*)\)/);if(_0x4130f1){this[_0x9416('0x1c')][_0x3bf0b3[_0x9416('0x3d')]][_0x4130f1[0x1]]=_0x2bf858[0x1];}}else if(_0x3bf0b3[_0x9416('0x5a')]===_0x9416('0x69')){this['channels'][_0x3bf0b3[_0x9416('0x3d')]][_0x9416('0x69')]=_0x3bf0b3[_0x9416('0x5c')]['split'](',')[0x0];}}}}}catch(_0x315db4){logger['error'](_0x9416('0x6a'),_0x3bf0b3[_0x9416('0x3d')],util[_0x9416('0x36')](_0x315db4,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9416('0x37')][_0x9416('0x25')]=function(_0x25a97d){try{if(this[_0x9416('0x38')](_0x25a97d)){logger[_0x9416('0x3c')]('[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s',_0x25a97d['uniqueid'],_0x25a97d[_0x9416('0x40')],_0x25a97d[_0x9416('0x3e')],_0x25a97d['calleridnum']);logger[_0x9416('0x3f')]('[%s][voiceCallReport][newstate]\x20event:',_0x25a97d[_0x9416('0x3d')],util[_0x9416('0x36')](_0x25a97d,{'showHidden':![],'depth':null}));if(_0x25a97d[_0x9416('0x3d')]!==_0x25a97d[_0x9416('0x40')]){if(this['channels'][_0x25a97d[_0x9416('0x40')]]){if(_0x25a97d['channelstate']==='6'){if(!this[_0x9416('0x1c')][_0x25a97d[_0x9416('0x40')]][_0x9416('0x6b')]){var _0x8c3e2e=moment();this['channels'][_0x25a97d['linkedid']]['answered']=!![];this['channels'][_0x25a97d['linkedid']][_0x9416('0x6c')]=_0x8c3e2e[_0x9416('0x49')](_0x9416('0x54'));if(this[_0x9416('0x1c')][_0x25a97d[_0x9416('0x40')]][_0x9416('0x53')]){this[_0x9416('0x1c')][_0x25a97d[_0x9416('0x40')]]['holdtime']=_0x8c3e2e[_0x9416('0x6d')](this[_0x9416('0x1c')][_0x25a97d[_0x9416('0x40')]][_0x9416('0x53')],_0x9416('0x62'));}}this[_0x9416('0x1c')][_0x25a97d[_0x9416('0x40')]][_0x9416('0x40')]=_0x25a97d['uniqueid'];if(_0x25a97d[_0x9416('0x6e')]!==_0x9416('0x6f')){this['channels'][_0x25a97d['linkedid']][_0x9416('0x48')]=_0x25a97d['calleridnum'];}this[_0x9416('0x1c')][_0x25a97d[_0x9416('0x40')]][_0x9416('0x70')]=_0x25a97d['calleridname'];this['channels'][_0x25a97d[_0x9416('0x40')]][_0x9416('0x71')]=_0x25a97d[_0x9416('0x45')];this['channels'][_0x25a97d[_0x9416('0x40')]]['disposition']=dispositions[_[_0x9416('0x72')](_0x25a97d[_0x9416('0x55')])];if(this['agents'][_0x25a97d[_0x9416('0x45')][_0x9416('0x46')]('-')[0x0]]){this['channels'][_0x25a97d['linkedid']][_0x9416('0x73')]=this[_0x9416('0x1d')][_0x25a97d['channel'][_0x9416('0x46')]('-')[0x0]]['id'];this[_0x9416('0x1c')][_0x25a97d['linkedid']][_0x9416('0x74')]=this['agents'][_0x25a97d[_0x9416('0x45')][_0x9416('0x46')]('-')[0x0]][_0x9416('0x58')];}}}}else{if(this[_0x9416('0x1c')][_0x25a97d[_0x9416('0x3d')]]){if(_0x25a97d['channelstate']==='6'){if(this[_0x9416('0x1d')][_0x25a97d[_0x9416('0x45')]['split']('-')[0x0]]){this[_0x9416('0x1c')][_0x25a97d[_0x9416('0x3d')]][_0x9416('0x73')]=this[_0x9416('0x1d')][_0x25a97d[_0x9416('0x45')][_0x9416('0x46')]('-')[0x0]]['id'];this[_0x9416('0x1c')][_0x25a97d[_0x9416('0x3d')]][_0x9416('0x74')]=this[_0x9416('0x1d')][_0x25a97d['channel'][_0x9416('0x46')]('-')[0x0]][_0x9416('0x58')];}}}}if(_0x25a97d[_0x9416('0x55')]==='6'&&_0x25a97d[_0x9416('0x43')]===_0x9416('0x44')){if(this['agents'][_0x25a97d[_0x9416('0x45')]['split']('-')[0x0]]){this['agents'][_0x25a97d[_0x9416('0x45')]['split']('-')[0x0]]['destconnectedlinenum']=_0x25a97d['exten'];var _0x45c7cb;if(this[_0x9416('0x1c')][_0x25a97d['uniqueid']])_0x45c7cb=this[_0x9416('0x1c')][_0x25a97d[_0x9416('0x3d')]]['routealias'];else if(this[_0x9416('0x1c')][_0x25a97d[_0x9416('0x40')]])_0x45c7cb=this[_0x9416('0x1c')][_0x25a97d['linkedid']]['routealias'];logger[_0x9416('0x3f')](_0x9416('0x75'),_0x25a97d[_0x9416('0x3d')],util[_0x9416('0x36')]({'destaccountcode':this[_0x9416('0x1d')][_0x25a97d[_0x9416('0x45')]['split']('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x25a97d['exten'],'routealias':_0x45c7cb},{'showHidden':![],'depth':null}));this[_0x9416('0x3a')](util[_0x9416('0x49')](_0x9416('0x4a'),this[_0x9416('0x1d')][_0x25a97d[_0x9416('0x45')][_0x9416('0x46')]('-')[0x0]][_0x9416('0x58')]),_0x9416('0x4b'),{'destaccountcode':this[_0x9416('0x1d')][_0x25a97d[_0x9416('0x45')][_0x9416('0x46')]('-')[0x0]][_0x9416('0x4c')],'destconnectedlinenum':_0x25a97d[_0x9416('0x52')],'routealias':_0x45c7cb});}}}}catch(_0x2ca25c){logger[_0x9416('0x34')](_0x9416('0x76'),_0x25a97d['uniqueid'],util[_0x9416('0x36')](_0x2ca25c,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9416('0x37')][_0x9416('0x77')]=function(_0x5c3c11,_0x119e2d){try{if(this[_0x9416('0x1c')][_0x5c3c11]){logger[_0x9416('0x3c')]('[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s',_0x5c3c11,_0x119e2d);this[_0x9416('0x1c')][_0x5c3c11][_0x9416('0x78')]=!![];if(_[_0x9416('0x79')](_0x119e2d,_0x9416('0x7a'))){_0x119e2d=_0x119e2d[_0x9416('0x7b')](_0x9416('0x7a'),_0x9416('0x7c'));}this[_0x9416('0x1c')][_0x5c3c11][_0x9416('0x7d')]=_0x119e2d;var _0x3fe2c5=_['find'](this[_0x9416('0x1c')][_0x5c3c11]['monitors'],{'filename':_0x119e2d});if(_[_0x9416('0x7e')](_0x3fe2c5)){this[_0x9416('0x1c')][_0x5c3c11]['monitors'][_0x9416('0x7f')]({'filename':_0x119e2d,'createdAt':moment()['format'](_0x9416('0x54')),'mixmonitorid':'','status':_0x9416('0x80')});}}}catch(_0x4f0d00){logger[_0x9416('0x34')]('[%s][voiceCallReport][mixMonitorFilename]',_0x5c3c11,util['inspect'](_0x4f0d00,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9416('0x37')][_0x9416('0x27')]=function(_0x495853){try{if(this[_0x9416('0x38')](_0x495853)){logger[_0x9416('0x3f')](_0x9416('0x81'),_0x495853[_0x9416('0x3d')],util[_0x9416('0x36')](_0x495853,{'showHidden':![],'depth':null}));if(this['channels'][_0x495853[_0x9416('0x3d')]]&&_0x495853[_0x9416('0x45')]!='OutgoingSpoolFailed'){if(this[_0x9416('0x38')](_0x495853[_0x9416('0x82')])){if(this[_0x9416('0x38')](_0x495853[_0x9416('0x82')][_0x9416('0x83')])){logger['info'](_0x9416('0x84'),_0x495853[_0x9416('0x3d')],_0x495853[_0x9416('0x85')]);this['syncMixMonitorFilename'](_0x495853[_0x9416('0x3d')],_0x495853[_0x9416('0x85')]);}else if(this[_0x9416('0x38')](_0x495853[_0x9416('0x82')][_0x9416('0x86')])){logger[_0x9416('0x3c')]('[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s',_0x495853[_0x9416('0x3d')],_0x495853['value']);this[_0x9416('0x1c')][_0x495853[_0x9416('0x3d')]][_0x9416('0x6e')]=_0x495853['value'];}else if(this['isNotNull'](_0x495853[_0x9416('0x82')][_0x9416('0x87')])){logger['info']('[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s',_0x495853[_0x9416('0x3d')],_0x495853[_0x9416('0x85')]);this[_0x9416('0x1c')][_0x495853[_0x9416('0x3d')]][_0x9416('0x88')]=_0x495853[_0x9416('0x85')];}else if(this[_0x9416('0x38')](_0x495853[_0x9416('0x82')][_0x9416('0x89')])){logger[_0x9416('0x3c')](_0x9416('0x8a'),_0x495853[_0x9416('0x3d')],_0x495853[_0x9416('0x85')]);this[_0x9416('0x1c')][_0x495853[_0x9416('0x3d')]]['type']=_0x495853[_0x9416('0x85')];}else if(this[_0x9416('0x38')](_0x495853['variable'][_0x9416('0x8b')])){logger[_0x9416('0x3c')]('[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s',_0x495853[_0x9416('0x3d')],_0x495853[_0x9416('0x85')][_0x9416('0x46')](',')[0x0]);this[_0x9416('0x1c')][_0x495853[_0x9416('0x3d')]]['queue']=_0x495853[_0x9416('0x85')][_0x9416('0x46')](',')[0x0];}else if(this[_0x9416('0x38')](_0x495853[_0x9416('0x82')][_0x9416('0x8c')])){logger[_0x9416('0x3c')](_0x9416('0x8d'),_0x495853[_0x9416('0x3d')],_0x495853[_0x9416('0x85')]);this['channels'][_0x495853[_0x9416('0x3d')]]['originatecalleridnum']=_0x495853['value'];}else if(this[_0x9416('0x38')](_0x495853[_0x9416('0x82')][_0x9416('0x8e')])){logger[_0x9416('0x3c')](_0x9416('0x8f'),_0x495853[_0x9416('0x3d')],_0x495853['value']);this[_0x9416('0x1c')][_0x495853['uniqueid']][_0x9416('0x90')]=_0x495853[_0x9416('0x85')];}else if(this[_0x9416('0x38')](_0x495853['variable'][_0x9416('0x91')])){logger['info'](_0x9416('0x92'),_0x495853[_0x9416('0x3d')],_0x495853[_0x9416('0x85')]);this['channels'][_0x495853[_0x9416('0x3d')]][_0x9416('0x93')]=_0x495853[_0x9416('0x85')];}else if(this[_0x9416('0x38')](_0x495853['variable'][_0x9416('0x94')])){logger[_0x9416('0x3c')](_0x9416('0x95'),_0x495853[_0x9416('0x3d')],_0x495853[_0x9416('0x85')]);this[_0x9416('0x1c')][_0x495853['uniqueid']]['queue']=_0x495853[_0x9416('0x85')];}else if(this[_0x9416('0x38')](_0x495853[_0x9416('0x82')][_0x9416('0x96')])){logger[_0x9416('0x3c')](_0x9416('0x97'),_0x495853[_0x9416('0x3d')],_0x495853[_0x9416('0x85')]);this['channels'][_0x495853['uniqueid']][_0x9416('0x98')]=_0x495853['value'];}}}else if(this[_0x9416('0x38')](_0x495853[_0x9416('0x82')]['mixmonitor_filename'])){if(_0x495853[_0x9416('0x85')]){var _0x5323ce=path['parse'](_0x495853[_0x9416('0x85')])[_0x9416('0x58')];logger[_0x9416('0x3c')]('[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s',_0x5323ce,_0x495853[_0x9416('0x85')]);this[_0x9416('0x77')](_0x5323ce,_0x495853[_0x9416('0x85')]);}}else if(this[_0x9416('0x1c')][_0x495853[_0x9416('0x40')]]){if(this[_0x9416('0x38')](_0x495853[_0x9416('0x82')])){if(this[_0x9416('0x38')](_0x495853[_0x9416('0x82')][_0x9416('0x96')])){logger[_0x9416('0x3c')]('[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s',_0x495853[_0x9416('0x40')],_0x495853[_0x9416('0x85')]);this[_0x9416('0x1c')][_0x495853[_0x9416('0x40')]]['sipcalllinkedid']=_0x495853[_0x9416('0x85')];}}}}}catch(_0x11d52e){logger['error'](_0x9416('0x99'),_0x495853[_0x9416('0x3d')],util['inspect'](_0x11d52e,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x9416('0x29')]=function(_0x46f682){try{if(this[_0x9416('0x38')](_0x46f682)){logger['debug'](_0x9416('0x9a'),_0x46f682[_0x9416('0x3d')],util['inspect'](_0x46f682,{'showHidden':![],'depth':null}));if(this['channels'][_0x46f682[_0x9416('0x3d')]]){logger[_0x9416('0x3c')]('[%s][voiceCallReport][hangup]\x20reason:%s',_0x46f682[_0x9416('0x3d')],_0x46f682[_0x9416('0x9b')]);var _0x365913=moment();this[_0x9416('0x1c')][_0x46f682[_0x9416('0x3d')]][_0x9416('0x9c')]=_0x365913[_0x9416('0x49')](_0x9416('0x54'));this[_0x9416('0x1c')][_0x46f682['uniqueid']][_0x9416('0x60')]=_0x365913['diff'](this[_0x9416('0x1c')][_0x46f682[_0x9416('0x3d')]][_0x9416('0x53')],_0x9416('0x62'));if(this[_0x9416('0x1c')][_0x46f682[_0x9416('0x3d')]][_0x9416('0x6b')]){this['channels'][_0x46f682['uniqueid']]['billableseconds']=_0x365913[_0x9416('0x6d')](this[_0x9416('0x1c')][_0x46f682[_0x9416('0x3d')]]['answertime'],_0x9416('0x62'));this[_0x9416('0x1c')][_0x46f682[_0x9416('0x3d')]][_0x9416('0x9d')]=this[_0x9416('0x1c')][_0x46f682[_0x9416('0x3d')]][_0x9416('0x60')]-this[_0x9416('0x1c')][_0x46f682[_0x9416('0x3d')]][_0x9416('0x9e')];}if(_0x46f682['context']==='from-sip'){if(this[_0x9416('0x1d')][_0x46f682['channel']['split']('-')[0x0]]){this[_0x9416('0x1d')][_0x46f682[_0x9416('0x45')][_0x9416('0x46')]('-')[0x0]]=_[_0x9416('0x9f')](this['agents'][_0x46f682['channel'][_0x9416('0x46')]('-')[0x0]],[_0x9416('0x47')]);logger[_0x9416('0x3f')](_0x9416('0xa0'),_0x46f682[_0x9416('0x3d')],util[_0x9416('0x36')]({'id':this[_0x9416('0x1d')][_0x46f682[_0x9416('0x45')][_0x9416('0x46')]('-')[0x0]]['id'],'destaccountcode':this[_0x9416('0x1d')][_0x46f682[_0x9416('0x45')][_0x9416('0x46')]('-')[0x0]][_0x9416('0x4c')]},{'showHidden':![],'depth':null}));this['emit'](util['format'](_0x9416('0x4a'),this[_0x9416('0x1d')][_0x46f682[_0x9416('0x45')]['split']('-')[0x0]][_0x9416('0x58')]),_0x9416('0xa1'),{'id':this[_0x9416('0x1d')][_0x46f682[_0x9416('0x45')][_0x9416('0x46')]('-')[0x0]]['id'],'destaccountcode':this['agents'][_0x46f682[_0x9416('0x45')][_0x9416('0x46')]('-')[0x0]]['accountcode']});}}var _0x3e01ae=this;Promise[_0x9416('0xa2')]()['then'](function(){var _0x225566=_0x3e01ae[_0x9416('0x1c')][_0x46f682['uniqueid']];if(typeof _0x225566[_0x9416('0xa3')]==='undefined')return;if(_[_0x9416('0xa4')](_0x225566[_0x9416('0xa5')]))return;return RpcSetting[_0x9416('0xa6')]()['then'](function(_0xdfd13){if(!_0xdfd13['stopRecordingOnTransfer'])return;return Promise['resolve']()['then'](function(){return ami[_0x9416('0xa7')]({'action':'StopMixMonitor','channel':_0x225566['channel']})['catch'](function(){});})[_0x9416('0xa8')](function(){return ami[_0x9416('0xa7')]({'action':_0x9416('0xa9'),'channel':_0x225566[_0x9416('0x71')]})[_0x9416('0xaa')](function(){})[_0x9416('0xab')](function(){var _0x586321=_0x3e01ae[_0x9416('0x1d')][_0x225566[_0x9416('0x71')][_0x9416('0x46')]('-')[0x0]];if(!_0x586321)return;io[_0x9416('0x3a')]('webbar:stopmonitors',{'agentId':_0x586321['id'],'uniqueid':_0x225566[_0x9416('0x3d')]});});});});})[_0x9416('0xa8')](function(){if(_0x46f682[_0x9416('0xac')]===_0x9416('0xad')){_0x3e01ae[_0x9416('0x1e')][_0x46f682[_0x9416('0x3d')]]=_0x3e01ae['channels'][_0x46f682['uniqueid']];}else{if(_0x3e01ae['channels'][_0x46f682['uniqueid']][_0x9416('0xae')]===_0x9416('0xaf')&&_0x3e01ae[_0x9416('0x1e')][_0x46f682[_0x9416('0x3d')]]){_0x3e01ae[_0x9416('0x1c')][_0x46f682[_0x9416('0x3d')]][_0x9416('0x3d')]=[_0x3e01ae[_0x9416('0x1c')][_0x46f682['uniqueid']][_0x9416('0x40')],_0x3e01ae[_0x9416('0x1c')][_0x46f682['uniqueid']]['linkedid']=_0x3e01ae[_0x9416('0x1c')][_0x46f682[_0x9416('0x3d')]][_0x9416('0x3d')]][0x0];delete _0x3e01ae[_0x9416('0x1e')][_0x46f682[_0x9416('0x3d')]];}}logger[_0x9416('0x3f')](_0x9416('0xb0'),_0x46f682['uniqueid'],util[_0x9416('0x36')](_0x3e01ae[_0x9416('0x1c')][_0x46f682[_0x9416('0x3d')]],{'showHidden':![],'depth':null}));ami[_0x9416('0x3a')](_0x9416('0xb1'),_0x3e01ae[_0x9416('0x1c')][_0x46f682['uniqueid']]);delete _0x3e01ae[_0x9416('0x1c')][_0x46f682[_0x9416('0x3d')]];});}}}catch(_0x98567d){logger[_0x9416('0x34')](_0x9416('0xb2'),_0x46f682[_0x9416('0x3d')],util[_0x9416('0x36')](_0x98567d,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9416('0x37')][_0x9416('0x2c')]=function(_0x40125b){try{if(this[_0x9416('0x38')](_0x40125b)){logger[_0x9416('0x3c')]('[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s',_0x40125b[_0x9416('0x3d')],_0x40125b[_0x9416('0xb3')],_0x40125b[_0x9416('0xb4')]);logger[_0x9416('0x3f')](_0x9416('0xb5'),_0x40125b[_0x9416('0x3d')],util[_0x9416('0x36')](_0x40125b,{'showHidden':![],'depth':null}));if(this[_0x9416('0x1c')][_0x40125b['transfereeuniqueid']]){this[_0x9416('0x1c')][_0x40125b['transfereeuniqueid']]['transfercalleridnum']=_0x40125b[_0x9416('0xb3')];this[_0x9416('0x1c')][_0x40125b[_0x9416('0xb6')]][_0x9416('0xb7')]=_0x40125b[_0x9416('0xb4')];if(this[_0x9416('0x1c')][_0x40125b[_0x9416('0xb8')]]){var _0x24b938=this['channels'][_0x40125b[_0x9416('0xb8')]];this[_0x9416('0x1c')][_0x40125b[_0x9416('0xb8')]]=this[_0x9416('0x1c')][_0x40125b[_0x9416('0xb6')]];this[_0x9416('0x1c')][_0x40125b[_0x9416('0xb6')]]=_0x24b938;}}else if(this[_0x9416('0x1c')][_0x40125b[_0x9416('0xb9')]]){this[_0x9416('0x1c')][_0x40125b['transfertargetuniqueid']][_0x9416('0xba')]=_0x40125b[_0x9416('0xb3')];this[_0x9416('0x1c')][_0x40125b['transfertargetuniqueid']][_0x9416('0xb7')]=_0x40125b['transfertargetcalleridnum'];if(this[_0x9416('0x1c')][_0x40125b['origtransfereruniqueid']]){var _0x24b938=this[_0x9416('0x1c')][_0x40125b[_0x9416('0xbb')]];this['channels'][_0x40125b[_0x9416('0xbb')]]=this[_0x9416('0x1c')][_0x40125b['transfertargetuniqueid']];this['channels'][_0x40125b['transfertargetuniqueid']]=_0x24b938;}}if((this['channels'][_0x40125b[_0x9416('0xbb')]]||this[_0x9416('0x1c')][_0x40125b[_0x9416('0xbc')]])&&this[_0x9416('0x1c')][_0x40125b[_0x9416('0xb8')]]){var _0x134e44=_[_0x9416('0xbd')]([this[_0x9416('0x1c')][_0x40125b[_0x9416('0xbb')]],this[_0x9416('0x1c')][_0x40125b['origtransfererlinkedid']],this[_0x9416('0x1c')][_0x40125b[_0x9416('0xb8')]]],function(_0x38aace){return _0x38aace&&_0x38aace['type']===_0x9416('0xaf')&&_0x38aace['routeid'];});if(_0x134e44){if(this[_0x9416('0x1c')][_0x40125b['origtransfereruniqueid']])this[_0x9416('0x1c')][_0x40125b[_0x9416('0xbb')]]['transferType']='ATTENDED';if(this[_0x9416('0x1c')][_0x40125b[_0x9416('0xbc')]])this[_0x9416('0x1c')][_0x40125b[_0x9416('0xbc')]][_0x9416('0xa3')]=_0x9416('0xbe');this['channels'][_0x40125b[_0x9416('0xb8')]][_0x9416('0xa3')]=_0x9416('0xbe');}}}}catch(_0x4debcf){logger['error'](_0x9416('0xbf'),_0x40125b[_0x9416('0x3d')],util['inspect'](_0x4debcf,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9416('0x37')][_0x9416('0x2d')]=function(_0x9e0c3c){try{if(this[_0x9416('0x38')](_0x9e0c3c)){logger['info'](_0x9416('0xc0'),_0x9e0c3c[_0x9416('0x3d')],_0x9e0c3c[_0x9416('0xc1')],_0x9e0c3c['extension']);logger[_0x9416('0x3f')](_0x9416('0xc2'),_0x9e0c3c[_0x9416('0x3d')],util[_0x9416('0x36')](_0x9e0c3c,{'showHidden':![],'depth':null}));if(this[_0x9416('0x1c')][_0x9e0c3c['transfereeuniqueid']]){this[_0x9416('0x1c')][_0x9e0c3c[_0x9416('0xb6')]][_0x9416('0xba')]=_0x9e0c3c['transfereecalleridnum'];this[_0x9416('0x1c')][_0x9e0c3c['transfereeuniqueid']]['transferconnectedlinenum']=_0x9e0c3c[_0x9416('0xc3')];this['channels'][_0x9e0c3c[_0x9416('0xb6')]][_0x9416('0xa3')]='BLIND';this['syncHangup']({'event':_0x9416('0xad'),'uniqueid':_0x9e0c3c[_0x9416('0xb6')],'context':_0x9e0c3c[_0x9416('0x43')],'channel':_0x9e0c3c[_0x9416('0xc4')]});}else{this[_0x9416('0x1c')][_0x9e0c3c[_0x9416('0xc5')]][_0x9416('0xa3')]='BLIND';}}}catch(_0x93e60b){logger[_0x9416('0x34')](_0x9416('0xc6'),_0x9e0c3c[_0x9416('0x3d')],util[_0x9416('0x36')](_0x93e60b,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9416('0x37')][_0x9416('0x2f')]=function(_0x18f7f4){try{if(this[_0x9416('0x38')](_0x18f7f4)){logger[_0x9416('0x3f')]('[%s][voiceCallReport][musiconholdstart]\x20event:',_0x18f7f4[_0x9416('0x3d')],util[_0x9416('0x36')](_0x18f7f4,{'showHidden':![],'depth':null}));if(this[_0x9416('0x1c')][_0x18f7f4['uniqueid']]){if(!_['isNil'](this[_0x9416('0x1c')][_0x18f7f4['uniqueid']][_0x9416('0x6c')])){this['channels'][_0x18f7f4['uniqueid']]['mohstarttime']=moment()['format'](_0x9416('0x54'));logger[_0x9416('0x3c')](_0x9416('0xc7'),_0x18f7f4[_0x9416('0x3d')],this[_0x9416('0x1c')][_0x18f7f4[_0x9416('0x3d')]]['mohstarttime']);}}}}catch(_0x59505b){logger[_0x9416('0x34')](_0x9416('0xc8'),_0x18f7f4['uniqueid'],util[_0x9416('0x36')](_0x59505b,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9416('0x37')]['syncMusicOnHoldStop']=function(_0x3df801){try{if(this[_0x9416('0x38')](_0x3df801)){logger[_0x9416('0x3f')](_0x9416('0xc9'),_0x3df801[_0x9416('0x3d')],util['inspect'](_0x3df801,{'showHidden':![],'depth':null}));if(this[_0x9416('0x1c')][_0x3df801[_0x9416('0x3d')]]){if(!_[_0x9416('0x7e')](this[_0x9416('0x1c')][_0x3df801[_0x9416('0x3d')]][_0x9416('0xca')])){this['channels'][_0x3df801[_0x9416('0x3d')]][_0x9416('0xcb')]+=moment()['milliseconds'](0x0)[_0x9416('0x6d')](this[_0x9416('0x1c')][_0x3df801[_0x9416('0x3d')]][_0x9416('0xca')],_0x9416('0x62'));logger[_0x9416('0x3c')](_0x9416('0xcc'),_0x3df801['uniqueid'],this[_0x9416('0x1c')][_0x3df801[_0x9416('0x3d')]]['mohtime']);delete this[_0x9416('0x1c')][_0x3df801[_0x9416('0x3d')]][_0x9416('0xca')];}}}}catch(_0x1a850c){logger[_0x9416('0x34')](_0x9416('0xcd'),_0x3df801[_0x9416('0x3d')],util[_0x9416('0x36')](_0x1a850c,{'showHidden':![],'depth':null}));}};module[_0x9416('0xce')]=VoiceCallReport; \ No newline at end of file +var _0x2bfc=['coreshowchannel','syncNewExten','bind','newexten','newchannel','syncNewChannel','syncNewState','varset','syncVarSet','hangup','newcallerid','syncNewCallerId','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','info','actionCoreShowChannels','error','[voiceCallReport][coreshowchannels]','inspect','prototype','emit','isNotNull','uniqueid','debug','[%s][voiceCallReport][newcallerid]\x20event:','linkedid','merge','context','from-sip','channel','split','exten','xcally-motion-preview','destconnectedlinenum','connectedlinenum','format','user:%s','name','user:agentconnect','accountcode','[%s][voiceCallReport][newcallerid]','[%s][voiceCallReport][newchannel]\x20event:','OutgoingSpoolFailed','isUndefined','starttime','disposition','toNumber','pick','keys','[%s][voiceCallReport][newchannel]','[%s][voiceCallReport][newexten]\x20event:','application','toLowerCase','appdata','startsWith','CDR(routeAlias)','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','applicationdata','duration','subtract','seconds','includes','lastapplication','cdr(','match','[%s][voiceCallReport][newexten]','[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','calleridname','calleridnum','[%s][voiceCallReport][newstate]\x20event:','channelstate','answered','answertime','YYYY-MM-DD\x20HH:mm:ss','holdtime','connectedlinename','destinationchannel','membername','[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:','[%s][voiceCallReport][newstate]','syncMixMonitorFilename','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','monitor','endsWith','.wav49','replace','.WAV','monitorFilename','find','monitors','isNil','push','[%s][voiceCallReport][mixMonitorFilename]','[%s][voiceCallReport][varset]\x20event:','variable','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','value','xmd-phone','[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s','xmd-callerid','[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s','xmd-cdrtype','[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s','type','xmd-queue','[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s','[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','xmd-destination','destination','[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s','calleridpreview','xmcs-queue','sipcallid','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','sipcalluniqueid','mixmonitor_filename','parse','sipcalllinkedid','[%s][voiceCallReport][varset]','[%s][voiceCallReport][hangup]\x20reason:%s','cause-txt','billableseconds','diff','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','then','undefined','isEmpty','getSettings','stopRecordingOnTransfer','Action','StopMixMonitor','webbar:stopmonitors','event','BlindTransfer','outbound','blindTransfers','custom:voiceCallReport','[%s][voiceCallReport][hangup]','[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','transfercalleridnum','origtransferercalleridnum','transferconnectedlinenum','transfertargetcalleridnum','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','origtransfererlinkedid','some','transferType','ATTENDED','[%s][voiceCallReport][attendedtransfer]','[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','[%s][voiceCallReport][blindtransfer]\x20event:','transfereecalleridnum','extension','BLIND','syncHangup','transfererchannel','transfereruniqueid','[%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','bluebird','lodash','moment','util','path','../../../config/environment','../../../config/logger','ami','../ami','../model/channel','../rpc/setting','unknown','not_inuse','inuse','busy','invalid','unavailable','ringing','ringinuse','onhold','set','queue','agi','dial','voicemail','NO\x20ANSWER','FAILED','ANSWERED','BUSY','defaults','redis','localhost','socket.io-emitter','channels','agents'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2bfc,0x187));var _0xc2bf=function(_0x63454a,_0x4ae4c1){_0x63454a=_0x63454a-0x0;var _0x3b79be=_0x2bfc[_0x63454a];return _0x3b79be;};'use strict';var BPromise=require(_0xc2bf('0x0'));var _=require(_0xc2bf('0x1'));var moment=require(_0xc2bf('0x2'));var util=require(_0xc2bf('0x3'));var path=require(_0xc2bf('0x4'));var Redis=require('ioredis');var config=require(_0xc2bf('0x5'));var logger=require(_0xc2bf('0x6'))(_0xc2bf('0x7'));var ami=require(_0xc2bf('0x8'));var Channel=require(_0xc2bf('0x9'));var RpcSetting=require(_0xc2bf('0xa'));var statusDesc=[_0xc2bf('0xb'),_0xc2bf('0xc'),_0xc2bf('0xd'),_0xc2bf('0xe'),_0xc2bf('0xf'),_0xc2bf('0x10'),_0xc2bf('0x11'),_0xc2bf('0x12'),_0xc2bf('0x13')];var applications=[_0xc2bf('0x14'),_0xc2bf('0x15'),_0xc2bf('0x16'),_0xc2bf('0x17'),'playback',_0xc2bf('0x18')];var dispositions=[_0xc2bf('0x19'),_0xc2bf('0x1a'),_0xc2bf('0x1a'),'NO\x20ANSWER','NO\x20ANSWER','NO\x20ANSWER',_0xc2bf('0x1b'),_0xc2bf('0x1c'),_0xc2bf('0x1a'),_0xc2bf('0x1a'),_0xc2bf('0x1a')];var actions={};config['redis']=_[_0xc2bf('0x1d')](config[_0xc2bf('0x1e')],{'host':_0xc2bf('0x1f'),'port':0x18eb});var io=require(_0xc2bf('0x20'))(new Redis(config['redis']));function VoiceCallReport(_0x332b20){this[_0xc2bf('0x21')]=_0x332b20['channels'];this['agents']=_0x332b20[_0xc2bf('0x22')];this['blindTransfers']={};ami['on'](_0xc2bf('0x23'),this[_0xc2bf('0x24')][_0xc2bf('0x25')](this));ami['on'](_0xc2bf('0x26'),this[_0xc2bf('0x24')][_0xc2bf('0x25')](this));ami['on'](_0xc2bf('0x27'),this[_0xc2bf('0x28')][_0xc2bf('0x25')](this));ami['on']('newstate',this[_0xc2bf('0x29')]['bind'](this));ami['on'](_0xc2bf('0x2a'),this[_0xc2bf('0x2b')][_0xc2bf('0x25')](this));ami['on'](_0xc2bf('0x2c'),this['syncHangup'][_0xc2bf('0x25')](this));ami['on'](_0xc2bf('0x2d'),this[_0xc2bf('0x2e')][_0xc2bf('0x25')](this));ami['on'](_0xc2bf('0x2f'),this[_0xc2bf('0x30')][_0xc2bf('0x25')](this));ami['on'](_0xc2bf('0x31'),this[_0xc2bf('0x32')][_0xc2bf('0x25')](this));ami['on'](_0xc2bf('0x33'),this[_0xc2bf('0x34')][_0xc2bf('0x25')](this));ami['on'](_0xc2bf('0x35'),this[_0xc2bf('0x36')][_0xc2bf('0x25')](this));try{logger[_0xc2bf('0x37')]('[voiceCallReport][coreshowchannels]\x20started');ami[_0xc2bf('0x38')]();}catch(_0x203599){logger[_0xc2bf('0x39')](_0xc2bf('0x3a'),util[_0xc2bf('0x3b')](_0x203599,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0xc2bf('0x3c')]['isNotNull']=function(_0x20a091){return _0x20a091!==null&&!_['isUndefined'](_0x20a091);};VoiceCallReport['prototype']['emit']=function(_0x5025e1,_0x2dca53,_0x103bf9){io['to'](_0x5025e1)[_0xc2bf('0x3d')](_0x2dca53,_0x103bf9);};VoiceCallReport[_0xc2bf('0x3c')][_0xc2bf('0x2e')]=function(_0x37da22){try{if(this[_0xc2bf('0x3e')](_0x37da22)){logger[_0xc2bf('0x37')]('[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s',_0x37da22[_0xc2bf('0x3f')],_0x37da22['calleridname'],_0x37da22['calleridnum']);logger[_0xc2bf('0x40')](_0xc2bf('0x41'),_0x37da22[_0xc2bf('0x3f')],util[_0xc2bf('0x3b')](_0x37da22,{'showHidden':![],'depth':null}));if(_0x37da22[_0xc2bf('0x3f')]===_0x37da22[_0xc2bf('0x42')]){if(!_['isUndefined'](this[_0xc2bf('0x21')][_0x37da22[_0xc2bf('0x3f')]])){_[_0xc2bf('0x43')](this[_0xc2bf('0x21')][_0x37da22[_0xc2bf('0x3f')]],_['pick'](_0x37da22,_['keys'](this[_0xc2bf('0x21')][_0x37da22[_0xc2bf('0x3f')]])));}}if(_0x37da22[_0xc2bf('0x44')]===_0xc2bf('0x45')){if(this[_0xc2bf('0x22')][_0x37da22[_0xc2bf('0x46')][_0xc2bf('0x47')]('-')[0x0]]){if(_0x37da22[_0xc2bf('0x48')]==_0xc2bf('0x49')){this[_0xc2bf('0x22')][_0x37da22[_0xc2bf('0x46')][_0xc2bf('0x47')]('-')[0x0]][_0xc2bf('0x4a')]=_0x37da22[_0xc2bf('0x4b')];this[_0xc2bf('0x3d')](util[_0xc2bf('0x4c')](_0xc2bf('0x4d'),this['agents'][_0x37da22['channel'][_0xc2bf('0x47')]('-')[0x0]][_0xc2bf('0x4e')]),_0xc2bf('0x4f'),{'destaccountcode':this[_0xc2bf('0x22')][_0x37da22[_0xc2bf('0x46')][_0xc2bf('0x47')]('-')[0x0]][_0xc2bf('0x50')],'destconnectedlinenum':_0x37da22[_0xc2bf('0x4b')]});}}}}}catch(_0x151a82){logger[_0xc2bf('0x39')](_0xc2bf('0x51'),_0x37da22[_0xc2bf('0x3f')],util[_0xc2bf('0x3b')](_0x151a82,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xc2bf('0x28')]=function(_0x308b28){try{if(this[_0xc2bf('0x3e')](_0x308b28)){logger[_0xc2bf('0x40')](_0xc2bf('0x52'),_0x308b28[_0xc2bf('0x3f')],util[_0xc2bf('0x3b')](_0x308b28,{'showHidden':![],'depth':null}));if(_0x308b28[_0xc2bf('0x3f')]===_0x308b28[_0xc2bf('0x42')]&&_0x308b28[_0xc2bf('0x46')]!=_0xc2bf('0x53')){if(_[_0xc2bf('0x54')](this[_0xc2bf('0x21')][_0x308b28[_0xc2bf('0x3f')]])){logger['info']('[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s',_0x308b28['uniqueid'],_0x308b28[_0xc2bf('0x44')],_0x308b28['exten']);this[_0xc2bf('0x21')][_0x308b28[_0xc2bf('0x3f')]]=new Channel();this['channels'][_0x308b28[_0xc2bf('0x3f')]][_0xc2bf('0x55')]=moment()[_0xc2bf('0x4c')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x308b28[_0xc2bf('0x3f')]][_0xc2bf('0x56')]=dispositions[_[_0xc2bf('0x57')](_0x308b28['channelstate'])];_[_0xc2bf('0x43')](this[_0xc2bf('0x21')][_0x308b28[_0xc2bf('0x3f')]],_[_0xc2bf('0x58')](_0x308b28,_[_0xc2bf('0x59')](this['channels'][_0x308b28['uniqueid']])));if(_0x308b28[_0xc2bf('0x44')]==='from-sip'){if(this['agents'][_0x308b28[_0xc2bf('0x46')]['split']('-')[0x0]]){if(_[_0xc2bf('0x54')](this['agents'][_0x308b28['channel']['split']('-')[0x0]][_0xc2bf('0x4a')])){this[_0xc2bf('0x22')][_0x308b28['channel'][_0xc2bf('0x47')]('-')[0x0]]['destconnectedlinenum']=_0x308b28['exten'];logger['debug']('[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:',_0x308b28['uniqueid'],util[_0xc2bf('0x3b')]({'destaccountcode':this['agents'][_0x308b28[_0xc2bf('0x46')][_0xc2bf('0x47')]('-')[0x0]][_0xc2bf('0x50')],'destconnectedlinenum':_0x308b28['exten']},{'showHidden':![],'depth':null}));this[_0xc2bf('0x3d')](util[_0xc2bf('0x4c')](_0xc2bf('0x4d'),this[_0xc2bf('0x22')][_0x308b28[_0xc2bf('0x46')]['split']('-')[0x0]]['name']),_0xc2bf('0x4f'),{'destaccountcode':this['agents'][_0x308b28['channel'][_0xc2bf('0x47')]('-')[0x0]][_0xc2bf('0x50')],'destconnectedlinenum':_0x308b28[_0xc2bf('0x48')]});}}}}}}}catch(_0x529cdf){logger[_0xc2bf('0x39')](_0xc2bf('0x5a'),_0x308b28[_0xc2bf('0x3f')],util[_0xc2bf('0x3b')](_0x529cdf,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xc2bf('0x3c')]['syncNewExten']=function(_0x2761bd){try{if(this['isNotNull'](_0x2761bd)){logger['debug'](_0xc2bf('0x5b'),_0x2761bd['uniqueid'],util[_0xc2bf('0x3b')](_0x2761bd,{'showHidden':![],'depth':null}));if(_0x2761bd[_0xc2bf('0x3f')]===_0x2761bd[_0xc2bf('0x42')]&&_0x2761bd[_0xc2bf('0x48')]!='h'&&_0x2761bd[_0xc2bf('0x46')]!=_0xc2bf('0x53')){_0x2761bd[_0xc2bf('0x5c')]=_0x2761bd[_0xc2bf('0x5c')][_0xc2bf('0x5d')]();_0x2761bd['applicationdata']=_0x2761bd[_0xc2bf('0x5e')]&&_0x2761bd[_0xc2bf('0x5e')][_0xc2bf('0x5f')](_0xc2bf('0x60'))?_0x2761bd['appdata']:(_0x2761bd[_0xc2bf('0x5e')]||_0x2761bd['applicationdata'])['toLowerCase']();logger[_0xc2bf('0x37')](_0xc2bf('0x61'),_0x2761bd[_0xc2bf('0x3f')],_0x2761bd[_0xc2bf('0x5c')],_0x2761bd[_0xc2bf('0x62')]);if(_['isUndefined'](this['channels'][_0x2761bd[_0xc2bf('0x3f')]])){this[_0xc2bf('0x21')][_0x2761bd[_0xc2bf('0x3f')]]=new Channel();this[_0xc2bf('0x21')][_0x2761bd[_0xc2bf('0x3f')]][_0xc2bf('0x55')]=_0x2761bd[_0xc2bf('0x63')]?moment()[_0xc2bf('0x64')](moment[_0xc2bf('0x63')](_0x2761bd[_0xc2bf('0x63')])[_0xc2bf('0x65')](),'seconds')['format']('YYYY-MM-DD\x20HH:mm:ss'):moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x2761bd[_0xc2bf('0x3f')]]['disposition']=_0xc2bf('0x19');}_['merge'](this[_0xc2bf('0x21')][_0x2761bd[_0xc2bf('0x3f')]],_[_0xc2bf('0x58')](_0x2761bd,_[_0xc2bf('0x59')](this[_0xc2bf('0x21')][_0x2761bd[_0xc2bf('0x3f')]])));if(_[_0xc2bf('0x66')](applications,_0x2761bd[_0xc2bf('0x5c')])){this[_0xc2bf('0x21')][_0x2761bd['uniqueid']][_0xc2bf('0x67')]=_0x2761bd[_0xc2bf('0x5c')];this[_0xc2bf('0x21')][_0x2761bd[_0xc2bf('0x3f')]]['lastdata']=_0x2761bd[_0xc2bf('0x62')];if(_0x2761bd['application']===_0xc2bf('0x14')&&_[_0xc2bf('0x5f')](_0x2761bd['applicationdata'][_0xc2bf('0x5d')](),_0xc2bf('0x68'))){var _0x2fc199=_0x2761bd[_0xc2bf('0x62')][_0xc2bf('0x47')]('=');var _0x45f381=_0x2fc199[0x0][_0xc2bf('0x5d')]()[_0xc2bf('0x69')](/cdr\((.*)\)/);if(_0x45f381){this['channels'][_0x2761bd[_0xc2bf('0x3f')]][_0x45f381[0x1]]=_0x2fc199[0x1];}}else if(_0x2761bd[_0xc2bf('0x5c')]===_0xc2bf('0x15')){this[_0xc2bf('0x21')][_0x2761bd[_0xc2bf('0x3f')]][_0xc2bf('0x15')]=_0x2761bd[_0xc2bf('0x62')][_0xc2bf('0x47')](',')[0x0];}}}}}catch(_0x13885c){logger['error'](_0xc2bf('0x6a'),_0x2761bd['uniqueid'],util[_0xc2bf('0x3b')](_0x13885c,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xc2bf('0x3c')][_0xc2bf('0x29')]=function(_0x37a7f0){try{if(this['isNotNull'](_0x37a7f0)){logger['info'](_0xc2bf('0x6b'),_0x37a7f0[_0xc2bf('0x3f')],_0x37a7f0[_0xc2bf('0x42')],_0x37a7f0[_0xc2bf('0x6c')],_0x37a7f0[_0xc2bf('0x6d')]);logger[_0xc2bf('0x40')](_0xc2bf('0x6e'),_0x37a7f0['uniqueid'],util['inspect'](_0x37a7f0,{'showHidden':![],'depth':null}));if(_0x37a7f0[_0xc2bf('0x3f')]!==_0x37a7f0[_0xc2bf('0x42')]){if(this['channels'][_0x37a7f0[_0xc2bf('0x42')]]){if(_0x37a7f0[_0xc2bf('0x6f')]==='6'){if(!this['channels'][_0x37a7f0[_0xc2bf('0x42')]][_0xc2bf('0x70')]){var _0x5a88ee=moment();this[_0xc2bf('0x21')][_0x37a7f0[_0xc2bf('0x42')]][_0xc2bf('0x70')]=!![];this[_0xc2bf('0x21')][_0x37a7f0[_0xc2bf('0x42')]][_0xc2bf('0x71')]=_0x5a88ee[_0xc2bf('0x4c')](_0xc2bf('0x72'));if(this[_0xc2bf('0x21')][_0x37a7f0['linkedid']][_0xc2bf('0x55')]){this['channels'][_0x37a7f0[_0xc2bf('0x42')]][_0xc2bf('0x73')]=_0x5a88ee['diff'](this['channels'][_0x37a7f0['linkedid']][_0xc2bf('0x55')],'seconds');}}this[_0xc2bf('0x21')][_0x37a7f0['linkedid']][_0xc2bf('0x42')]=_0x37a7f0['uniqueid'];if(_0x37a7f0[_0xc2bf('0x6d')]!=='xcally-motion-preview'){this[_0xc2bf('0x21')][_0x37a7f0['linkedid']][_0xc2bf('0x4b')]=_0x37a7f0[_0xc2bf('0x6d')];}this[_0xc2bf('0x21')][_0x37a7f0[_0xc2bf('0x42')]][_0xc2bf('0x74')]=_0x37a7f0['calleridname'];this[_0xc2bf('0x21')][_0x37a7f0[_0xc2bf('0x42')]][_0xc2bf('0x75')]=_0x37a7f0[_0xc2bf('0x46')];this['channels'][_0x37a7f0[_0xc2bf('0x42')]]['disposition']=dispositions[_[_0xc2bf('0x57')](_0x37a7f0[_0xc2bf('0x6f')])];if(this['agents'][_0x37a7f0[_0xc2bf('0x46')][_0xc2bf('0x47')]('-')[0x0]]){this[_0xc2bf('0x21')][_0x37a7f0[_0xc2bf('0x42')]]['UserId']=this[_0xc2bf('0x22')][_0x37a7f0['channel']['split']('-')[0x0]]['id'];this[_0xc2bf('0x21')][_0x37a7f0[_0xc2bf('0x42')]][_0xc2bf('0x76')]=this['agents'][_0x37a7f0[_0xc2bf('0x46')][_0xc2bf('0x47')]('-')[0x0]][_0xc2bf('0x4e')];}}}}else{if(this[_0xc2bf('0x21')][_0x37a7f0[_0xc2bf('0x3f')]]){if(_0x37a7f0[_0xc2bf('0x6f')]==='6'){if(this[_0xc2bf('0x22')][_0x37a7f0[_0xc2bf('0x46')][_0xc2bf('0x47')]('-')[0x0]]){this[_0xc2bf('0x21')][_0x37a7f0[_0xc2bf('0x3f')]]['UserId']=this[_0xc2bf('0x22')][_0x37a7f0['channel']['split']('-')[0x0]]['id'];this[_0xc2bf('0x21')][_0x37a7f0[_0xc2bf('0x3f')]][_0xc2bf('0x76')]=this['agents'][_0x37a7f0['channel']['split']('-')[0x0]][_0xc2bf('0x4e')];}}}}if(_0x37a7f0[_0xc2bf('0x6f')]==='6'&&_0x37a7f0[_0xc2bf('0x44')]===_0xc2bf('0x45')){if(this[_0xc2bf('0x22')][_0x37a7f0[_0xc2bf('0x46')][_0xc2bf('0x47')]('-')[0x0]]){this[_0xc2bf('0x22')][_0x37a7f0[_0xc2bf('0x46')][_0xc2bf('0x47')]('-')[0x0]][_0xc2bf('0x4a')]=_0x37a7f0[_0xc2bf('0x48')];var _0x1244a7;if(this[_0xc2bf('0x21')][_0x37a7f0[_0xc2bf('0x3f')]])_0x1244a7=this[_0xc2bf('0x21')][_0x37a7f0[_0xc2bf('0x3f')]]['routealias'];else if(this[_0xc2bf('0x21')][_0x37a7f0[_0xc2bf('0x42')]])_0x1244a7=this['channels'][_0x37a7f0[_0xc2bf('0x42')]]['routealias'];logger[_0xc2bf('0x40')](_0xc2bf('0x77'),_0x37a7f0['uniqueid'],util['inspect']({'destaccountcode':this['agents'][_0x37a7f0['channel']['split']('-')[0x0]][_0xc2bf('0x50')],'destconnectedlinenum':_0x37a7f0[_0xc2bf('0x48')],'routealias':_0x1244a7},{'showHidden':![],'depth':null}));this[_0xc2bf('0x3d')](util[_0xc2bf('0x4c')]('user:%s',this[_0xc2bf('0x22')][_0x37a7f0[_0xc2bf('0x46')][_0xc2bf('0x47')]('-')[0x0]]['name']),_0xc2bf('0x4f'),{'destaccountcode':this[_0xc2bf('0x22')][_0x37a7f0[_0xc2bf('0x46')]['split']('-')[0x0]][_0xc2bf('0x50')],'destconnectedlinenum':_0x37a7f0[_0xc2bf('0x48')],'routealias':_0x1244a7});}}}}catch(_0x576257){logger['error'](_0xc2bf('0x78'),_0x37a7f0[_0xc2bf('0x3f')],util[_0xc2bf('0x3b')](_0x576257,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xc2bf('0x3c')][_0xc2bf('0x79')]=function(_0xd20998,_0x27e11b){try{if(this[_0xc2bf('0x21')][_0xd20998]){logger['info'](_0xc2bf('0x7a'),_0xd20998,_0x27e11b);this[_0xc2bf('0x21')][_0xd20998][_0xc2bf('0x7b')]=!![];if(_[_0xc2bf('0x7c')](_0x27e11b,_0xc2bf('0x7d'))){_0x27e11b=_0x27e11b[_0xc2bf('0x7e')]('.wav49',_0xc2bf('0x7f'));}this[_0xc2bf('0x21')][_0xd20998][_0xc2bf('0x80')]=_0x27e11b;var _0x4772fd=_[_0xc2bf('0x81')](this[_0xc2bf('0x21')][_0xd20998][_0xc2bf('0x82')],{'filename':_0x27e11b});if(_[_0xc2bf('0x83')](_0x4772fd)){this['channels'][_0xd20998][_0xc2bf('0x82')][_0xc2bf('0x84')]({'filename':_0x27e11b,'createdAt':moment()[_0xc2bf('0x4c')](_0xc2bf('0x72')),'mixmonitorid':'','status':'rec'});}}}catch(_0x1cc8de){logger[_0xc2bf('0x39')](_0xc2bf('0x85'),_0xd20998,util[_0xc2bf('0x3b')](_0x1cc8de,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xc2bf('0x3c')]['syncVarSet']=function(_0x26d8ad){try{if(this['isNotNull'](_0x26d8ad)){logger[_0xc2bf('0x40')](_0xc2bf('0x86'),_0x26d8ad['uniqueid'],util[_0xc2bf('0x3b')](_0x26d8ad,{'showHidden':![],'depth':null}));if(this['channels'][_0x26d8ad[_0xc2bf('0x3f')]]&&_0x26d8ad[_0xc2bf('0x46')]!=_0xc2bf('0x53')){if(this[_0xc2bf('0x3e')](_0x26d8ad['variable'])){if(this[_0xc2bf('0x3e')](_0x26d8ad[_0xc2bf('0x87')]['mixmonitor_filename'])){logger['info'](_0xc2bf('0x88'),_0x26d8ad['uniqueid'],_0x26d8ad[_0xc2bf('0x89')]);this[_0xc2bf('0x79')](_0x26d8ad[_0xc2bf('0x3f')],_0x26d8ad[_0xc2bf('0x89')]);}else if(this[_0xc2bf('0x3e')](_0x26d8ad[_0xc2bf('0x87')][_0xc2bf('0x8a')])){logger[_0xc2bf('0x37')](_0xc2bf('0x8b'),_0x26d8ad['uniqueid'],_0x26d8ad['value']);this['channels'][_0x26d8ad['uniqueid']][_0xc2bf('0x6d')]=_0x26d8ad[_0xc2bf('0x89')];}else if(this[_0xc2bf('0x3e')](_0x26d8ad[_0xc2bf('0x87')][_0xc2bf('0x8c')])){logger[_0xc2bf('0x37')](_0xc2bf('0x8d'),_0x26d8ad[_0xc2bf('0x3f')],_0x26d8ad['value']);this[_0xc2bf('0x21')][_0x26d8ad['uniqueid']]['callerid']=_0x26d8ad['value'];}else if(this[_0xc2bf('0x3e')](_0x26d8ad[_0xc2bf('0x87')][_0xc2bf('0x8e')])){logger[_0xc2bf('0x37')](_0xc2bf('0x8f'),_0x26d8ad['uniqueid'],_0x26d8ad['value']);this[_0xc2bf('0x21')][_0x26d8ad[_0xc2bf('0x3f')]][_0xc2bf('0x90')]=_0x26d8ad[_0xc2bf('0x89')];}else if(this[_0xc2bf('0x3e')](_0x26d8ad[_0xc2bf('0x87')][_0xc2bf('0x91')])){logger[_0xc2bf('0x37')](_0xc2bf('0x92'),_0x26d8ad[_0xc2bf('0x3f')],_0x26d8ad['value'][_0xc2bf('0x47')](',')[0x0]);this[_0xc2bf('0x21')][_0x26d8ad['uniqueid']][_0xc2bf('0x15')]=_0x26d8ad[_0xc2bf('0x89')][_0xc2bf('0x47')](',')[0x0];}else if(this[_0xc2bf('0x3e')](_0x26d8ad[_0xc2bf('0x87')]['xmd-originatecalleridnum'])){logger[_0xc2bf('0x37')](_0xc2bf('0x93'),_0x26d8ad['uniqueid'],_0x26d8ad['value']);this['channels'][_0x26d8ad[_0xc2bf('0x3f')]]['originatecalleridnum']=_0x26d8ad[_0xc2bf('0x89')];}else if(this['isNotNull'](_0x26d8ad[_0xc2bf('0x87')][_0xc2bf('0x94')])){logger[_0xc2bf('0x37')]('[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s',_0x26d8ad[_0xc2bf('0x3f')],_0x26d8ad['value']);this[_0xc2bf('0x21')][_0x26d8ad[_0xc2bf('0x3f')]][_0xc2bf('0x95')]=_0x26d8ad[_0xc2bf('0x89')];}else if(this[_0xc2bf('0x3e')](_0x26d8ad[_0xc2bf('0x87')]['xmd-callerid-preview'])){logger[_0xc2bf('0x37')](_0xc2bf('0x96'),_0x26d8ad[_0xc2bf('0x3f')],_0x26d8ad[_0xc2bf('0x89')]);this[_0xc2bf('0x21')][_0x26d8ad[_0xc2bf('0x3f')]][_0xc2bf('0x97')]=_0x26d8ad[_0xc2bf('0x89')];}else if(this['isNotNull'](_0x26d8ad[_0xc2bf('0x87')][_0xc2bf('0x98')])){logger['info']('[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s',_0x26d8ad[_0xc2bf('0x3f')],_0x26d8ad['value']);this[_0xc2bf('0x21')][_0x26d8ad[_0xc2bf('0x3f')]]['queue']=_0x26d8ad['value'];}else if(this[_0xc2bf('0x3e')](_0x26d8ad[_0xc2bf('0x87')][_0xc2bf('0x99')])){logger[_0xc2bf('0x37')](_0xc2bf('0x9a'),_0x26d8ad[_0xc2bf('0x3f')],_0x26d8ad[_0xc2bf('0x89')]);this[_0xc2bf('0x21')][_0x26d8ad[_0xc2bf('0x3f')]][_0xc2bf('0x9b')]=_0x26d8ad[_0xc2bf('0x89')];}}}else if(this['isNotNull'](_0x26d8ad[_0xc2bf('0x87')][_0xc2bf('0x9c')])){if(_0x26d8ad[_0xc2bf('0x89')]){var _0x79c9b=path[_0xc2bf('0x9d')](_0x26d8ad['value'])[_0xc2bf('0x4e')];logger[_0xc2bf('0x37')]('[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s',_0x79c9b,_0x26d8ad[_0xc2bf('0x89')]);this['syncMixMonitorFilename'](_0x79c9b,_0x26d8ad['value']);}}else if(this[_0xc2bf('0x21')][_0x26d8ad['linkedid']]){if(this[_0xc2bf('0x3e')](_0x26d8ad[_0xc2bf('0x87')])){if(this['isNotNull'](_0x26d8ad[_0xc2bf('0x87')]['sipcallid'])){logger[_0xc2bf('0x37')](_0xc2bf('0x9a'),_0x26d8ad[_0xc2bf('0x42')],_0x26d8ad[_0xc2bf('0x89')]);this['channels'][_0x26d8ad['linkedid']][_0xc2bf('0x9e')]=_0x26d8ad[_0xc2bf('0x89')];}}}}}catch(_0x1fa2b4){logger['error'](_0xc2bf('0x9f'),_0x26d8ad[_0xc2bf('0x3f')],util[_0xc2bf('0x3b')](_0x1fa2b4,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xc2bf('0x3c')]['syncHangup']=function(_0x3ab326){try{if(this[_0xc2bf('0x3e')](_0x3ab326)){logger[_0xc2bf('0x40')]('[%s][voiceCallReport][hangup]\x20event:',_0x3ab326['uniqueid'],util[_0xc2bf('0x3b')](_0x3ab326,{'showHidden':![],'depth':null}));if(this[_0xc2bf('0x21')][_0x3ab326['uniqueid']]){logger[_0xc2bf('0x37')](_0xc2bf('0xa0'),_0x3ab326[_0xc2bf('0x3f')],_0x3ab326[_0xc2bf('0xa1')]);var _0x5cfa8d=moment();this[_0xc2bf('0x21')][_0x3ab326['uniqueid']]['endtime']=_0x5cfa8d[_0xc2bf('0x4c')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xc2bf('0x21')][_0x3ab326['uniqueid']]['duration']=_0x5cfa8d['diff'](this[_0xc2bf('0x21')][_0x3ab326[_0xc2bf('0x3f')]][_0xc2bf('0x55')],_0xc2bf('0x65'));if(this[_0xc2bf('0x21')][_0x3ab326[_0xc2bf('0x3f')]][_0xc2bf('0x70')]){this[_0xc2bf('0x21')][_0x3ab326['uniqueid']][_0xc2bf('0xa2')]=_0x5cfa8d[_0xc2bf('0xa3')](this[_0xc2bf('0x21')][_0x3ab326['uniqueid']][_0xc2bf('0x71')],_0xc2bf('0x65'));this[_0xc2bf('0x21')][_0x3ab326[_0xc2bf('0x3f')]][_0xc2bf('0x73')]=this[_0xc2bf('0x21')][_0x3ab326['uniqueid']][_0xc2bf('0x63')]-this['channels'][_0x3ab326['uniqueid']]['billableseconds'];}if(_0x3ab326[_0xc2bf('0x44')]===_0xc2bf('0x45')){if(this[_0xc2bf('0x22')][_0x3ab326[_0xc2bf('0x46')][_0xc2bf('0x47')]('-')[0x0]]){this[_0xc2bf('0x22')][_0x3ab326['channel'][_0xc2bf('0x47')]('-')[0x0]]=_['omit'](this[_0xc2bf('0x22')][_0x3ab326[_0xc2bf('0x46')][_0xc2bf('0x47')]('-')[0x0]],[_0xc2bf('0x4a')]);logger[_0xc2bf('0x40')](_0xc2bf('0xa4'),_0x3ab326[_0xc2bf('0x3f')],util[_0xc2bf('0x3b')]({'id':this[_0xc2bf('0x22')][_0x3ab326[_0xc2bf('0x46')][_0xc2bf('0x47')]('-')[0x0]]['id'],'destaccountcode':this[_0xc2bf('0x22')][_0x3ab326['channel']['split']('-')[0x0]][_0xc2bf('0x50')]},{'showHidden':![],'depth':null}));this['emit'](util[_0xc2bf('0x4c')]('user:%s',this[_0xc2bf('0x22')][_0x3ab326[_0xc2bf('0x46')][_0xc2bf('0x47')]('-')[0x0]]['name']),_0xc2bf('0xa5'),{'id':this['agents'][_0x3ab326[_0xc2bf('0x46')][_0xc2bf('0x47')]('-')[0x0]]['id'],'destaccountcode':this['agents'][_0x3ab326['channel']['split']('-')[0x0]][_0xc2bf('0x50')]});}}var _0x4ede36=this;Promise['resolve']()[_0xc2bf('0xa6')](function(){var _0x294b2d=_0x4ede36[_0xc2bf('0x21')][_0x3ab326[_0xc2bf('0x3f')]];if(typeof _0x294b2d['transferType']===_0xc2bf('0xa7'))return;if(_[_0xc2bf('0xa8')](_0x294b2d['monitors']))return;return RpcSetting[_0xc2bf('0xa9')]()[_0xc2bf('0xa6')](function(_0xd05dd0){if(!_0xd05dd0[_0xc2bf('0xaa')])return;return Promise['resolve']()[_0xc2bf('0xa6')](function(){return ami[_0xc2bf('0xab')]({'action':'StopMixMonitor','channel':_0x294b2d[_0xc2bf('0x46')]})['catch'](function(){});})[_0xc2bf('0xa6')](function(){return ami[_0xc2bf('0xab')]({'action':_0xc2bf('0xac'),'channel':_0x294b2d[_0xc2bf('0x75')]})['catch'](function(){})['finally'](function(){var _0x575efe=_0x4ede36[_0xc2bf('0x22')][_0x294b2d[_0xc2bf('0x75')]['split']('-')[0x0]];if(!_0x575efe)return;io[_0xc2bf('0x3d')](_0xc2bf('0xad'),{'agentId':_0x575efe['id'],'uniqueid':_0x294b2d['uniqueid']});});});});})[_0xc2bf('0xa6')](function(){if(_0x3ab326[_0xc2bf('0xae')]===_0xc2bf('0xaf')){_0x4ede36['blindTransfers'][_0x3ab326['uniqueid']]=_0x4ede36[_0xc2bf('0x21')][_0x3ab326['uniqueid']];}else{if(_0x4ede36[_0xc2bf('0x21')][_0x3ab326[_0xc2bf('0x3f')]][_0xc2bf('0x90')]===_0xc2bf('0xb0')&&_0x4ede36[_0xc2bf('0xb1')][_0x3ab326[_0xc2bf('0x3f')]]){_0x4ede36[_0xc2bf('0x21')][_0x3ab326[_0xc2bf('0x3f')]][_0xc2bf('0x3f')]=[_0x4ede36[_0xc2bf('0x21')][_0x3ab326[_0xc2bf('0x3f')]][_0xc2bf('0x42')],_0x4ede36['channels'][_0x3ab326[_0xc2bf('0x3f')]][_0xc2bf('0x42')]=_0x4ede36['channels'][_0x3ab326[_0xc2bf('0x3f')]]['uniqueid']][0x0];delete _0x4ede36[_0xc2bf('0xb1')][_0x3ab326[_0xc2bf('0x3f')]];}}logger['debug']('[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:',_0x3ab326[_0xc2bf('0x3f')],util[_0xc2bf('0x3b')](_0x4ede36[_0xc2bf('0x21')][_0x3ab326[_0xc2bf('0x3f')]],{'showHidden':![],'depth':null}));ami[_0xc2bf('0x3d')](_0xc2bf('0xb2'),_0x4ede36[_0xc2bf('0x21')][_0x3ab326['uniqueid']]);delete _0x4ede36[_0xc2bf('0x21')][_0x3ab326['uniqueid']];});}}}catch(_0x348682){logger[_0xc2bf('0x39')](_0xc2bf('0xb3'),_0x3ab326[_0xc2bf('0x3f')],util[_0xc2bf('0x3b')](_0x348682,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xc2bf('0x3c')]['syncAttendedTransfer']=function(_0x1a42d8){try{if(this[_0xc2bf('0x3e')](_0x1a42d8)){logger['info'](_0xc2bf('0xb4'),_0x1a42d8[_0xc2bf('0x3f')],_0x1a42d8['origtransferercalleridnum'],_0x1a42d8['transfertargetcalleridnum']);logger[_0xc2bf('0x40')](_0xc2bf('0xb5'),_0x1a42d8[_0xc2bf('0x3f')],util[_0xc2bf('0x3b')](_0x1a42d8,{'showHidden':![],'depth':null}));if(this[_0xc2bf('0x21')][_0x1a42d8[_0xc2bf('0xb6')]]){this['channels'][_0x1a42d8[_0xc2bf('0xb6')]][_0xc2bf('0xb7')]=_0x1a42d8[_0xc2bf('0xb8')];this['channels'][_0x1a42d8[_0xc2bf('0xb6')]][_0xc2bf('0xb9')]=_0x1a42d8[_0xc2bf('0xba')];if(this[_0xc2bf('0x21')][_0x1a42d8[_0xc2bf('0xbb')]]){var _0x268ea4=this['channels'][_0x1a42d8[_0xc2bf('0xbb')]];this[_0xc2bf('0x21')][_0x1a42d8[_0xc2bf('0xbb')]]=this['channels'][_0x1a42d8[_0xc2bf('0xb6')]];this[_0xc2bf('0x21')][_0x1a42d8[_0xc2bf('0xb6')]]=_0x268ea4;}}else if(this[_0xc2bf('0x21')][_0x1a42d8[_0xc2bf('0xbc')]]){this[_0xc2bf('0x21')][_0x1a42d8[_0xc2bf('0xbc')]][_0xc2bf('0xb7')]=_0x1a42d8[_0xc2bf('0xb8')];this[_0xc2bf('0x21')][_0x1a42d8['transfertargetuniqueid']][_0xc2bf('0xb9')]=_0x1a42d8['transfertargetcalleridnum'];if(this[_0xc2bf('0x21')][_0x1a42d8[_0xc2bf('0xbd')]]){var _0x268ea4=this['channels'][_0x1a42d8['origtransfereruniqueid']];this[_0xc2bf('0x21')][_0x1a42d8[_0xc2bf('0xbd')]]=this[_0xc2bf('0x21')][_0x1a42d8[_0xc2bf('0xbc')]];this[_0xc2bf('0x21')][_0x1a42d8['transfertargetuniqueid']]=_0x268ea4;}}if((this['channels'][_0x1a42d8[_0xc2bf('0xbd')]]||this['channels'][_0x1a42d8[_0xc2bf('0xbe')]])&&this['channels'][_0x1a42d8[_0xc2bf('0xbb')]]){var _0x4a4401=_[_0xc2bf('0xbf')]([this['channels'][_0x1a42d8['origtransfereruniqueid']],this[_0xc2bf('0x21')][_0x1a42d8[_0xc2bf('0xbe')]],this[_0xc2bf('0x21')][_0x1a42d8['secondtransfereruniqueid']]],function(_0x579278){return _0x579278&&_0x579278[_0xc2bf('0x90')]===_0xc2bf('0xb0')&&_0x579278['routeid'];});if(_0x4a4401){if(this[_0xc2bf('0x21')][_0x1a42d8[_0xc2bf('0xbd')]])this[_0xc2bf('0x21')][_0x1a42d8[_0xc2bf('0xbd')]][_0xc2bf('0xc0')]=_0xc2bf('0xc1');if(this[_0xc2bf('0x21')][_0x1a42d8['origtransfererlinkedid']])this[_0xc2bf('0x21')][_0x1a42d8[_0xc2bf('0xbe')]]['transferType']=_0xc2bf('0xc1');this[_0xc2bf('0x21')][_0x1a42d8[_0xc2bf('0xbb')]]['transferType']='ATTENDED';}}}}catch(_0xd3a3db){logger['error'](_0xc2bf('0xc2'),_0x1a42d8[_0xc2bf('0x3f')],util[_0xc2bf('0x3b')](_0xd3a3db,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xc2bf('0x32')]=function(_0x56d14c){try{if(this[_0xc2bf('0x3e')](_0x56d14c)){logger['info'](_0xc2bf('0xc3'),_0x56d14c[_0xc2bf('0x3f')],_0x56d14c['transfereecalleridnum'],_0x56d14c['extension']);logger[_0xc2bf('0x40')](_0xc2bf('0xc4'),_0x56d14c[_0xc2bf('0x3f')],util['inspect'](_0x56d14c,{'showHidden':![],'depth':null}));if(this[_0xc2bf('0x21')][_0x56d14c[_0xc2bf('0xb6')]]){this[_0xc2bf('0x21')][_0x56d14c['transfereeuniqueid']][_0xc2bf('0xb7')]=_0x56d14c[_0xc2bf('0xc5')];this['channels'][_0x56d14c[_0xc2bf('0xb6')]][_0xc2bf('0xb9')]=_0x56d14c[_0xc2bf('0xc6')];this[_0xc2bf('0x21')][_0x56d14c['transfereeuniqueid']]['transferType']=_0xc2bf('0xc7');this[_0xc2bf('0xc8')]({'event':_0xc2bf('0xaf'),'uniqueid':_0x56d14c[_0xc2bf('0xb6')],'context':_0x56d14c[_0xc2bf('0x44')],'channel':_0x56d14c[_0xc2bf('0xc9')]});}else{this[_0xc2bf('0x21')][_0x56d14c[_0xc2bf('0xca')]][_0xc2bf('0xc0')]=_0xc2bf('0xc7');}}}catch(_0x334622){logger[_0xc2bf('0x39')](_0xc2bf('0xcb'),_0x56d14c[_0xc2bf('0x3f')],util[_0xc2bf('0x3b')](_0x334622,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xc2bf('0x34')]=function(_0x4d62a9){try{if(this['isNotNull'](_0x4d62a9)){logger['debug'](_0xc2bf('0xcc'),_0x4d62a9[_0xc2bf('0x3f')],util[_0xc2bf('0x3b')](_0x4d62a9,{'showHidden':![],'depth':null}));if(this[_0xc2bf('0x21')][_0x4d62a9['uniqueid']]){if(!_[_0xc2bf('0x83')](this[_0xc2bf('0x21')][_0x4d62a9[_0xc2bf('0x3f')]][_0xc2bf('0x71')])){this[_0xc2bf('0x21')][_0x4d62a9[_0xc2bf('0x3f')]][_0xc2bf('0xcd')]=moment()[_0xc2bf('0x4c')](_0xc2bf('0x72'));logger[_0xc2bf('0x37')](_0xc2bf('0xce'),_0x4d62a9[_0xc2bf('0x3f')],this[_0xc2bf('0x21')][_0x4d62a9[_0xc2bf('0x3f')]]['mohstarttime']);}}}}catch(_0x3612f5){logger[_0xc2bf('0x39')](_0xc2bf('0xcf'),_0x4d62a9[_0xc2bf('0x3f')],util['inspect'](_0x3612f5,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xc2bf('0x3c')]['syncMusicOnHoldStop']=function(_0x54b46b){try{if(this['isNotNull'](_0x54b46b)){logger['debug'](_0xc2bf('0xd0'),_0x54b46b['uniqueid'],util['inspect'](_0x54b46b,{'showHidden':![],'depth':null}));if(this['channels'][_0x54b46b[_0xc2bf('0x3f')]]){if(!_['isNil'](this[_0xc2bf('0x21')][_0x54b46b[_0xc2bf('0x3f')]][_0xc2bf('0xcd')])){this['channels'][_0x54b46b['uniqueid']][_0xc2bf('0xd1')]+=moment()['milliseconds'](0x0)[_0xc2bf('0xa3')](this[_0xc2bf('0x21')][_0x54b46b[_0xc2bf('0x3f')]]['mohstarttime'],_0xc2bf('0x65'));logger[_0xc2bf('0x37')](_0xc2bf('0xd2'),_0x54b46b['uniqueid'],this[_0xc2bf('0x21')][_0x54b46b[_0xc2bf('0x3f')]]['mohtime']);delete this[_0xc2bf('0x21')][_0x54b46b['uniqueid']]['mohstarttime'];}}}}catch(_0x4990c1){logger['error'](_0xc2bf('0xd3'),_0x54b46b[_0xc2bf('0x3f')],util['inspect'](_0x4990c1,{'showHidden':![],'depth':null}));}};module[_0xc2bf('0xd4')]=VoiceCallReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceDialReport.js b/server/services/ami/report/voiceDialReport.js index dcf78c4..9751d93 100644 --- a/server/services/ami/report/voiceDialReport.js +++ b/server/services/ami/report/voiceDialReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2a75=['sumHoldTime','sumBillable','sumDuration','[%s][voiceDialReport][hangup]\x20sending\x20voiceDialReport\x20event:','[%s][voiceDialReport][hangup]\x20sending\x20dialend\x20event:','custom:dialend','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound:save\x20event:','voice_outbound:save','[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event','voice_outbound_channel:remove','linkedid','destuniqueid','[%s][voiceDialReport][hangup]','[%s][voiceDialReport][newexten]\x20event:','toLowerCase','set','applicationdata','appdata','startsWith','cdr(','[%s][voiceDialReport][newexten]\x20application:%s\x20appdata:%s','application','split','[%s][voiceDialReport][newexten]','exports','lodash','../../../config/logger','../ami','redis','defaults','localhost','channels','outboundChannels','outbound','applications','variables','dialbegin','syncDialBegin','bind','dialend','syncDialEnd','varset','newexten','syncNewExten','hangup','syncHangup','prototype','isUndefined','emit','isNotNull','debug','[%s][voiceDialReport][dialbegin]\x20event:','uniqueid','merge','format','called','substring','channel','lastIndexOf','omit','event','privilege','info','[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called','membername','interface','[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:','inspect','voice:outbound','voice_outbound_channel:save','[%s][voiceDialReport][dialbegin]\x20sending\x20dialbegin\x20event:','error','dialstatus','connectedlinenum','connectedlinename','answertime','[%s][voiceDialReport][dialend]\x20agent:%s\x20lastevent:connect','[%s][voiceDialReport][dialend]\x20sending\x20dialconnect\x20event:','custom:dialconnect','[%s][voiceDialReport][dialend]','syncVarSet','addVariable','keys','variable','outboundrouteid','voice','[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s','[%s][voiceDialReport][varset]','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberinterface','memberlastcall','memberpenalty','isNil','[%s][voiceDialReport][hangup]\x20event:','[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete','endtime','YYYY-MM-DD\x20HH:mm:ss','diff','starttime','seconds','lastevent','complete','total','holdtime','billableseconds'];(function(_0x3ada0a,_0x5e94e9){var _0x41ffc0=function(_0xd4dabc){while(--_0xd4dabc){_0x3ada0a['push'](_0x3ada0a['shift']());}};_0x41ffc0(++_0x5e94e9);}(_0x2a75,0x8b));var _0x52a7=function(_0x35f17a,_0x19eee7){_0x35f17a=_0x35f17a-0x0;var _0x27e42b=_0x2a75[_0x35f17a];return _0x27e42b;};'use strict';var _=require(_0x52a7('0x0'));var moment=require('moment');var util=require('util');var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0x52a7('0x1'))('ami');var ami=require(_0x52a7('0x2'));config[_0x52a7('0x3')]=_[_0x52a7('0x4')](config[_0x52a7('0x3')],{'host':_0x52a7('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x52a7('0x3')]));function VoiceDialReport(_0xe0adb6){this[_0x52a7('0x6')]=_0xe0adb6[_0x52a7('0x7')];this[_0x52a7('0x8')]=_0xe0adb6['outbound'];this[_0x52a7('0x9')]={};this[_0x52a7('0xa')]={};ami['on'](_0x52a7('0xb'),this[_0x52a7('0xc')][_0x52a7('0xd')](this));ami['on'](_0x52a7('0xe'),this[_0x52a7('0xf')]['bind'](this));ami['on'](_0x52a7('0x10'),this['syncVarSet'][_0x52a7('0xd')](this));ami['on'](_0x52a7('0x11'),this[_0x52a7('0x12')][_0x52a7('0xd')](this));ami['on'](_0x52a7('0x13'),this[_0x52a7('0x14')][_0x52a7('0xd')](this));}VoiceDialReport[_0x52a7('0x15')]['isNotNull']=function(_0x107e13){return _0x107e13!==null&&!_[_0x52a7('0x16')](_0x107e13);};VoiceDialReport[_0x52a7('0x15')][_0x52a7('0x17')]=function(_0x242a1c,_0x2e1f85,_0x2c2566){io['to'](_0x242a1c)[_0x52a7('0x17')](_0x2e1f85,_0x2c2566);};VoiceDialReport['prototype'][_0x52a7('0xc')]=function(_0x4cc9e1){try{if(this[_0x52a7('0x18')](_0x4cc9e1)){logger[_0x52a7('0x19')](_0x52a7('0x1a'),_0x4cc9e1[_0x52a7('0x1b')],util['inspect'](_0x4cc9e1,{'showHidden':![],'depth':null}));if(this[_0x52a7('0x6')][_0x4cc9e1['uniqueid']]){_[_0x52a7('0x1c')](this[_0x52a7('0x6')][_0x4cc9e1[_0x52a7('0x1b')]],{'starttime':moment()[_0x52a7('0x1d')]('YYYY-MM-DD\x20HH:mm:ss'),'lastevent':_0x52a7('0x1e'),'interface':_0x4cc9e1['channel'][_0x52a7('0x1f')](0x0,_0x4cc9e1[_0x52a7('0x20')][_0x52a7('0x21')]('-')),'membername':_0x4cc9e1['channel']['substring'](_0x4cc9e1[_0x52a7('0x20')][_0x52a7('0x21')]('/')+0x1,_0x4cc9e1[_0x52a7('0x20')][_0x52a7('0x21')]('-'))},_[_0x52a7('0x22')](_0x4cc9e1,[_0x52a7('0x23'),_0x52a7('0x24')]));logger[_0x52a7('0x25')](_0x52a7('0x26'),_0x4cc9e1[_0x52a7('0x1b')],this[_0x52a7('0x6')][_0x4cc9e1[_0x52a7('0x1b')]][_0x52a7('0x27')],this[_0x52a7('0x6')][_0x4cc9e1['uniqueid']][_0x52a7('0x28')]);logger[_0x52a7('0x19')](_0x52a7('0x29'),_0x4cc9e1['uniqueid'],util[_0x52a7('0x2a')](this[_0x52a7('0x6')][_0x4cc9e1[_0x52a7('0x1b')]],{'showHidden':![],'depth':null}));if(this[_0x52a7('0x9')][_0x4cc9e1[_0x52a7('0x1b')]])_[_0x52a7('0x1c')](this[_0x52a7('0x6')][_0x4cc9e1[_0x52a7('0x1b')]],this[_0x52a7('0x9')][_0x4cc9e1[_0x52a7('0x1b')]]);this[_0x52a7('0x17')](_0x52a7('0x2b'),_0x52a7('0x2c'),this[_0x52a7('0x6')][_0x4cc9e1[_0x52a7('0x1b')]]);logger[_0x52a7('0x19')](_0x52a7('0x2d'),_0x4cc9e1[_0x52a7('0x1b')],util[_0x52a7('0x2a')](this[_0x52a7('0x6')][_0x4cc9e1[_0x52a7('0x1b')]],{'showHidden':![],'depth':null}));ami['emit']('custom:dialbegin',this[_0x52a7('0x6')][_0x4cc9e1['uniqueid']]);}}}catch(_0xa8d465){logger[_0x52a7('0x2e')]('[%s][voiceDialReport][dialbegin]',_0x4cc9e1['uniqueid'],util[_0x52a7('0x2a')](_0xa8d465,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0x52a7('0xf')]=function(_0x1c09f7){try{if(this['isNotNull'](_0x1c09f7)){logger[_0x52a7('0x19')]('[%s][voiceDialReport][dialend]\x20event:',_0x1c09f7[_0x52a7('0x1b')],util[_0x52a7('0x2a')](_0x1c09f7,{'showHidden':![],'depth':null}));if(this[_0x52a7('0x6')][_0x1c09f7['uniqueid']]){this[_0x52a7('0x6')][_0x1c09f7['uniqueid']]['dialstatus']=_0x1c09f7[_0x52a7('0x2f')];if(_0x1c09f7[_0x52a7('0x2f')]==='ANSWER'){this['channels'][_0x1c09f7['uniqueid']]['connectedlinenum']=_0x1c09f7[_0x52a7('0x30')];this[_0x52a7('0x6')][_0x1c09f7['uniqueid']]['connectedlinename']=_0x1c09f7[_0x52a7('0x31')];this[_0x52a7('0x6')][_0x1c09f7[_0x52a7('0x1b')]][_0x52a7('0x32')]=moment()[_0x52a7('0x1d')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x52a7('0x6')][_0x1c09f7[_0x52a7('0x1b')]]['lastevent']='connect';logger[_0x52a7('0x25')](_0x52a7('0x33'),_0x1c09f7[_0x52a7('0x1b')],_0x1c09f7[_0x52a7('0x20')][_0x52a7('0x1f')](_0x1c09f7[_0x52a7('0x20')][_0x52a7('0x21')]('/')+0x1,_0x1c09f7[_0x52a7('0x20')]['lastIndexOf']('-')));logger[_0x52a7('0x19')](_0x52a7('0x34'),_0x1c09f7[_0x52a7('0x1b')],util[_0x52a7('0x2a')](this['channels'][_0x1c09f7[_0x52a7('0x1b')]],{'showHidden':![],'depth':null}));ami[_0x52a7('0x17')](_0x52a7('0x35'),this['channels'][_0x1c09f7[_0x52a7('0x1b')]]);}logger[_0x52a7('0x19')]('[%s][voiceDialReport][dialend]\x20sending\x20voice_outbound_channel:save\x20event:',_0x1c09f7[_0x52a7('0x1b')],util[_0x52a7('0x2a')](this[_0x52a7('0x6')][_0x1c09f7[_0x52a7('0x1b')]],{'showHidden':![],'depth':null}));this[_0x52a7('0x17')]('voice:outbound',_0x52a7('0x2c'),this[_0x52a7('0x6')][_0x1c09f7[_0x52a7('0x1b')]]);}}}catch(_0x88f5b0){logger[_0x52a7('0x2e')](_0x52a7('0x36'),_0x1c09f7[_0x52a7('0x1b')],util[_0x52a7('0x2a')](_0x88f5b0,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x52a7('0x15')][_0x52a7('0x37')]=function(_0x3a97a4){try{if(this[_0x52a7('0x18')](_0x3a97a4)){logger[_0x52a7('0x19')]('[%s][voiceDialReport][varset]\x20event:',_0x3a97a4['uniqueid'],util['inspect'](_0x3a97a4,{'showHidden':![],'depth':null}));this[_0x52a7('0x38')](_0x3a97a4[_0x52a7('0x1b')],_[_0x52a7('0x39')](_0x3a97a4['variable'])[0x0],_0x3a97a4['value']);if(this[_0x52a7('0x18')](_0x3a97a4[_0x52a7('0x3a')])&&this['isNotNull'](_0x3a97a4[_0x52a7('0x3a')][_0x52a7('0x3b')])){if(_['isUndefined'](this['channels'][_0x3a97a4[_0x52a7('0x1b')]])){this['channels'][_0x3a97a4[_0x52a7('0x1b')]]={'routeId':_0x3a97a4['value'],'variables':this[_0x52a7('0xa')][_0x3a97a4[_0x52a7('0x1b')]],'motionChannel':_0x52a7('0x3c')};logger[_0x52a7('0x25')](_0x52a7('0x3d'),_0x3a97a4['uniqueid'],_0x3a97a4[_0x52a7('0x3a')][_0x52a7('0x3b')],_[_0x52a7('0x39')](_0x3a97a4['variable'])[0x0],_0x3a97a4['value']);logger[_0x52a7('0x19')]('[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:',_0x3a97a4['uniqueid'],util[_0x52a7('0x2a')](this[_0x52a7('0x6')][_0x3a97a4[_0x52a7('0x1b')]],{'showHidden':![],'depth':null}));this['emit']('voice:outbound',_0x52a7('0x2c'),this[_0x52a7('0x6')][_0x3a97a4[_0x52a7('0x1b')]]);}}}}catch(_0x131b61){logger[_0x52a7('0x2e')](_0x52a7('0x3e'),_0x3a97a4[_0x52a7('0x1b')],util[_0x52a7('0x2a')](_0x131b61,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x52a7('0x15')][_0x52a7('0x38')]=function(_0x49b5c9,_0xa9e06b,_0x36250c){var _0x781ec4=['rtpaudioqos',_0x52a7('0x3f'),_0x52a7('0x40'),_0x52a7('0x41'),'rtpaudioqosloss','rtpaudioqoslossbridged',_0x52a7('0x42'),_0x52a7('0x43'),_0x52a7('0x44'),_0x52a7('0x45'),_0x52a7('0x46'),_0x52a7('0x47'),_0x52a7('0x48'),'memberdynamic',_0x52a7('0x49'),_0x52a7('0x4a'),_0x52a7('0x27'),_0x52a7('0x4b'),'memberrealtime'];if(!_[_0x52a7('0x4c')](_0xa9e06b)&&!_['includes'](_0x781ec4,_0xa9e06b)){if(_[_0x52a7('0x16')](this['variables'][_0x49b5c9])){this[_0x52a7('0xa')][_0x49b5c9]={};}this[_0x52a7('0xa')][_0x49b5c9][_0xa9e06b]=_0x36250c;}};VoiceDialReport[_0x52a7('0x15')][_0x52a7('0x14')]=function(_0x5e38ff){try{if(this['isNotNull'](_0x5e38ff)){logger[_0x52a7('0x19')](_0x52a7('0x4d'),_0x5e38ff[_0x52a7('0x1b')],util[_0x52a7('0x2a')](_0x5e38ff,{'showHidden':![],'depth':null}));if(this[_0x52a7('0x6')][_0x5e38ff[_0x52a7('0x1b')]]){logger[_0x52a7('0x25')](_0x52a7('0x4e'),_0x5e38ff[_0x52a7('0x1b')],_0x5e38ff['cause-txt']);this[_0x52a7('0x6')][_0x5e38ff['uniqueid']][_0x52a7('0x4f')]=moment()[_0x52a7('0x1d')](_0x52a7('0x50'));this[_0x52a7('0x6')][_0x5e38ff[_0x52a7('0x1b')]]['duration']=moment(this[_0x52a7('0x6')][_0x5e38ff[_0x52a7('0x1b')]][_0x52a7('0x4f')])[_0x52a7('0x51')](this[_0x52a7('0x6')][_0x5e38ff[_0x52a7('0x1b')]][_0x52a7('0x52')],_0x52a7('0x53'));this[_0x52a7('0x6')][_0x5e38ff[_0x52a7('0x1b')]][_0x52a7('0x54')]=_0x52a7('0x55');this['outbound'][_0x52a7('0x56')]+=0x1;if(this[_0x52a7('0x6')][_0x5e38ff['uniqueid']][_0x52a7('0x32')]){this[_0x52a7('0x8')]['answered']+=0x1;this[_0x52a7('0x6')][_0x5e38ff[_0x52a7('0x1b')]][_0x52a7('0x57')]=moment(this[_0x52a7('0x6')][_0x5e38ff[_0x52a7('0x1b')]]['answertime'])[_0x52a7('0x51')](this['channels'][_0x5e38ff[_0x52a7('0x1b')]]['starttime'],_0x52a7('0x53'));this['channels'][_0x5e38ff[_0x52a7('0x1b')]][_0x52a7('0x58')]=moment(this[_0x52a7('0x6')][_0x5e38ff['uniqueid']][_0x52a7('0x4f')])[_0x52a7('0x51')](this[_0x52a7('0x6')][_0x5e38ff[_0x52a7('0x1b')]][_0x52a7('0x32')],'seconds');this[_0x52a7('0x8')][_0x52a7('0x59')]+=this[_0x52a7('0x6')][_0x5e38ff[_0x52a7('0x1b')]][_0x52a7('0x57')]||0x0;this[_0x52a7('0x8')][_0x52a7('0x5a')]+=this['channels'][_0x5e38ff[_0x52a7('0x1b')]][_0x52a7('0x58')];}this['outbound'][_0x52a7('0x5b')]+=this[_0x52a7('0x6')][_0x5e38ff[_0x52a7('0x1b')]]['duration'];logger[_0x52a7('0x19')](_0x52a7('0x5c'),_0x5e38ff['uniqueid'],util['inspect'](this[_0x52a7('0x6')][_0x5e38ff[_0x52a7('0x1b')]],{'showHidden':![],'depth':null}));ami['emit']('custom:voiceDialReport',this[_0x52a7('0x6')][_0x5e38ff[_0x52a7('0x1b')]]);logger[_0x52a7('0x19')](_0x52a7('0x5d'),_0x5e38ff[_0x52a7('0x1b')],util[_0x52a7('0x2a')](this[_0x52a7('0x6')][_0x5e38ff[_0x52a7('0x1b')]],{'showHidden':![],'depth':null}));ami[_0x52a7('0x17')](_0x52a7('0x5e'),this[_0x52a7('0x6')][_0x5e38ff[_0x52a7('0x1b')]]);logger[_0x52a7('0x19')](_0x52a7('0x5f'),_0x5e38ff[_0x52a7('0x1b')],util[_0x52a7('0x2a')](this[_0x52a7('0x6')][_0x5e38ff[_0x52a7('0x1b')]],{'showHidden':![],'depth':null}));this[_0x52a7('0x17')](_0x52a7('0x2b'),_0x52a7('0x60'),this[_0x52a7('0x8')]);logger[_0x52a7('0x25')](_0x52a7('0x61'),JSON['stringify'](this[_0x52a7('0x6')][_0x5e38ff['uniqueid']]));logger[_0x52a7('0x19')]('[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:',_0x5e38ff[_0x52a7('0x1b')],util[_0x52a7('0x2a')](this['channels'][_0x5e38ff[_0x52a7('0x1b')]],{'showHidden':![],'depth':null}));this[_0x52a7('0x17')](_0x52a7('0x2b'),_0x52a7('0x62'),this[_0x52a7('0x6')][_0x5e38ff[_0x52a7('0x1b')]]);delete this[_0x52a7('0x6')][_0x5e38ff[_0x52a7('0x1b')]];}else if(this[_0x52a7('0x6')][_0x5e38ff[_0x52a7('0x63')]]){this[_0x52a7('0x6')][_0x5e38ff[_0x52a7('0x63')]][_0x52a7('0x1b')]=this[_0x52a7('0x6')][_0x5e38ff['linkedid']][_0x52a7('0x64')];}if(this[_0x52a7('0xa')][_0x5e38ff[_0x52a7('0x1b')]]){delete this['variables'][_0x5e38ff[_0x52a7('0x1b')]];}}}catch(_0x3fba33){logger[_0x52a7('0x2e')](_0x52a7('0x65'),_0x5e38ff[_0x52a7('0x1b')],util[_0x52a7('0x2a')](_0x3fba33,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x52a7('0x15')][_0x52a7('0x12')]=function(_0x221601){try{if(this[_0x52a7('0x18')](_0x221601)){logger['debug'](_0x52a7('0x66'),_0x221601[_0x52a7('0x1b')],util[_0x52a7('0x2a')](_0x221601,{'showHidden':![],'depth':null}));if(_0x221601['application'][_0x52a7('0x67')]()===_0x52a7('0x68')){_0x221601[_0x52a7('0x69')]=(_0x221601[_0x52a7('0x6a')]||_0x221601[_0x52a7('0x69')])[_0x52a7('0x67')]();if(_[_0x52a7('0x6b')](_0x221601[_0x52a7('0x69')],_0x52a7('0x6c'))){if(_[_0x52a7('0x16')](this[_0x52a7('0x9')][_0x221601['uniqueid']]))this[_0x52a7('0x9')][_0x221601[_0x52a7('0x1b')]]={};logger[_0x52a7('0x25')](_0x52a7('0x6d'),_0x221601[_0x52a7('0x1b')],_0x221601[_0x52a7('0x6e')],_0x221601[_0x52a7('0x69')]);var _0x4e593b=_0x221601[_0x52a7('0x69')][_0x52a7('0x6f')]('=');var _0x3bcfca=_0x4e593b[0x0]['match'](/cdr\((.*)\)/);if(_0x3bcfca)this[_0x52a7('0x9')][_0x221601['uniqueid']][_0x3bcfca[0x1]]=_0x4e593b[0x1];}}}}catch(_0x5e447c){logger[_0x52a7('0x2e')](_0x52a7('0x70'),_0x221601[_0x52a7('0x1b')],util[_0x52a7('0x2a')](_0x5e447c,{'showHidden':![],'depth':null}));}};module[_0x52a7('0x71')]=VoiceDialReport; \ No newline at end of file +var _0xfaf7=['rtpaudioqos','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepvtcallid','memberdynamic','memberinterface','memberlastcall','membername','memberpenalty','memberrealtime','includes','duration','endtime','diff','starttime','lastevent','complete','total','answered','holdtime','billableseconds','seconds','sumBillable','[%s][voiceDialReport][hangup]\x20sending\x20voiceDialReport\x20event:','custom:voiceDialReport','custom:dialend','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound:save\x20event:','voice_outbound:save','[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event','stringify','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:','voice_outbound_channel:remove','linkedid','destuniqueid','[%s][voiceDialReport][hangup]','[%s][voiceDialReport][newexten]\x20event:','application','set','applicationdata','toLowerCase','startsWith','cdr(','[%s][voiceDialReport][newexten]\x20application:%s\x20appdata:%s','split','match','[%s][voiceDialReport][newexten]','exports','lodash','moment','util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','redis','localhost','socket.io-emitter','channels','outboundChannels','outbound','applications','variables','dialbegin','syncDialBegin','bind','dialend','syncDialEnd','varset','syncVarSet','syncHangup','prototype','isNotNull','emit','debug','uniqueid','inspect','merge','format','YYYY-MM-DD\x20HH:mm:ss','called','substring','channel','lastIndexOf','omit','info','[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called','[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:','voice_outbound_channel:save','[%s][voiceDialReport][dialbegin]\x20sending\x20dialbegin\x20event:','custom:dialbegin','error','dialstatus','ANSWER','connectedlinenum','connectedlinename','answertime','connect','[%s][voiceDialReport][dialend]\x20agent:%s\x20lastevent:connect','[%s][voiceDialReport][dialend]\x20sending\x20dialconnect\x20event:','custom:dialconnect','[%s][voiceDialReport][dialend]\x20sending\x20voice_outbound_channel:save\x20event:','addVariable','keys','value','variable','outboundrouteid','isUndefined','voice','[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:','voice:outbound','[%s][voiceDialReport][varset]'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xfaf7,0x18f));var _0x7faf=function(_0x307d86,_0x9264f2){_0x307d86=_0x307d86-0x0;var _0x361745=_0xfaf7[_0x307d86];return _0x361745;};'use strict';var _=require(_0x7faf('0x0'));var moment=require(_0x7faf('0x1'));var util=require(_0x7faf('0x2'));var Redis=require(_0x7faf('0x3'));var config=require(_0x7faf('0x4'));var logger=require(_0x7faf('0x5'))(_0x7faf('0x6'));var ami=require(_0x7faf('0x7'));config[_0x7faf('0x8')]=_['defaults'](config[_0x7faf('0x8')],{'host':_0x7faf('0x9'),'port':0x18eb});var io=require(_0x7faf('0xa'))(new Redis(config[_0x7faf('0x8')]));function VoiceDialReport(_0x25eb5c){this[_0x7faf('0xb')]=_0x25eb5c[_0x7faf('0xc')];this[_0x7faf('0xd')]=_0x25eb5c[_0x7faf('0xd')];this[_0x7faf('0xe')]={};this[_0x7faf('0xf')]={};ami['on'](_0x7faf('0x10'),this[_0x7faf('0x11')][_0x7faf('0x12')](this));ami['on'](_0x7faf('0x13'),this[_0x7faf('0x14')][_0x7faf('0x12')](this));ami['on'](_0x7faf('0x15'),this[_0x7faf('0x16')][_0x7faf('0x12')](this));ami['on']('newexten',this['syncNewExten'][_0x7faf('0x12')](this));ami['on']('hangup',this[_0x7faf('0x17')]['bind'](this));}VoiceDialReport[_0x7faf('0x18')][_0x7faf('0x19')]=function(_0x52d1a1){return _0x52d1a1!==null&&!_['isUndefined'](_0x52d1a1);};VoiceDialReport[_0x7faf('0x18')][_0x7faf('0x1a')]=function(_0x36d522,_0xa29522,_0x508aa2){io['to'](_0x36d522)[_0x7faf('0x1a')](_0xa29522,_0x508aa2);};VoiceDialReport[_0x7faf('0x18')]['syncDialBegin']=function(_0x49dee7){try{if(this[_0x7faf('0x19')](_0x49dee7)){logger[_0x7faf('0x1b')]('[%s][voiceDialReport][dialbegin]\x20event:',_0x49dee7[_0x7faf('0x1c')],util[_0x7faf('0x1d')](_0x49dee7,{'showHidden':![],'depth':null}));if(this['channels'][_0x49dee7[_0x7faf('0x1c')]]){_[_0x7faf('0x1e')](this[_0x7faf('0xb')][_0x49dee7[_0x7faf('0x1c')]],{'starttime':moment()[_0x7faf('0x1f')](_0x7faf('0x20')),'lastevent':_0x7faf('0x21'),'interface':_0x49dee7['channel'][_0x7faf('0x22')](0x0,_0x49dee7[_0x7faf('0x23')][_0x7faf('0x24')]('-')),'membername':_0x49dee7[_0x7faf('0x23')][_0x7faf('0x22')](_0x49dee7['channel']['lastIndexOf']('/')+0x1,_0x49dee7['channel']['lastIndexOf']('-'))},_[_0x7faf('0x25')](_0x49dee7,['event','privilege']));logger[_0x7faf('0x26')](_0x7faf('0x27'),_0x49dee7[_0x7faf('0x1c')],this[_0x7faf('0xb')][_0x49dee7['uniqueid']]['membername'],this[_0x7faf('0xb')][_0x49dee7[_0x7faf('0x1c')]]['interface']);logger[_0x7faf('0x1b')](_0x7faf('0x28'),_0x49dee7[_0x7faf('0x1c')],util[_0x7faf('0x1d')](this[_0x7faf('0xb')][_0x49dee7[_0x7faf('0x1c')]],{'showHidden':![],'depth':null}));if(this[_0x7faf('0xe')][_0x49dee7[_0x7faf('0x1c')]])_['merge'](this[_0x7faf('0xb')][_0x49dee7[_0x7faf('0x1c')]],this[_0x7faf('0xe')][_0x49dee7['uniqueid']]);this[_0x7faf('0x1a')]('voice:outbound',_0x7faf('0x29'),this[_0x7faf('0xb')][_0x49dee7[_0x7faf('0x1c')]]);logger[_0x7faf('0x1b')](_0x7faf('0x2a'),_0x49dee7['uniqueid'],util[_0x7faf('0x1d')](this[_0x7faf('0xb')][_0x49dee7[_0x7faf('0x1c')]],{'showHidden':![],'depth':null}));ami[_0x7faf('0x1a')](_0x7faf('0x2b'),this['channels'][_0x49dee7[_0x7faf('0x1c')]]);}}}catch(_0x403f9d){logger[_0x7faf('0x2c')]('[%s][voiceDialReport][dialbegin]',_0x49dee7[_0x7faf('0x1c')],util['inspect'](_0x403f9d,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0x7faf('0x14')]=function(_0xe3c9f3){try{if(this[_0x7faf('0x19')](_0xe3c9f3)){logger[_0x7faf('0x1b')]('[%s][voiceDialReport][dialend]\x20event:',_0xe3c9f3[_0x7faf('0x1c')],util[_0x7faf('0x1d')](_0xe3c9f3,{'showHidden':![],'depth':null}));if(this[_0x7faf('0xb')][_0xe3c9f3[_0x7faf('0x1c')]]){this['channels'][_0xe3c9f3[_0x7faf('0x1c')]][_0x7faf('0x2d')]=_0xe3c9f3['dialstatus'];if(_0xe3c9f3['dialstatus']===_0x7faf('0x2e')){this[_0x7faf('0xb')][_0xe3c9f3[_0x7faf('0x1c')]][_0x7faf('0x2f')]=_0xe3c9f3[_0x7faf('0x2f')];this[_0x7faf('0xb')][_0xe3c9f3['uniqueid']][_0x7faf('0x30')]=_0xe3c9f3['connectedlinename'];this[_0x7faf('0xb')][_0xe3c9f3[_0x7faf('0x1c')]][_0x7faf('0x31')]=moment()[_0x7faf('0x1f')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x7faf('0xb')][_0xe3c9f3[_0x7faf('0x1c')]]['lastevent']=_0x7faf('0x32');logger[_0x7faf('0x26')](_0x7faf('0x33'),_0xe3c9f3[_0x7faf('0x1c')],_0xe3c9f3[_0x7faf('0x23')][_0x7faf('0x22')](_0xe3c9f3['channel'][_0x7faf('0x24')]('/')+0x1,_0xe3c9f3['channel'][_0x7faf('0x24')]('-')));logger[_0x7faf('0x1b')](_0x7faf('0x34'),_0xe3c9f3[_0x7faf('0x1c')],util[_0x7faf('0x1d')](this[_0x7faf('0xb')][_0xe3c9f3[_0x7faf('0x1c')]],{'showHidden':![],'depth':null}));ami['emit'](_0x7faf('0x35'),this[_0x7faf('0xb')][_0xe3c9f3[_0x7faf('0x1c')]]);}logger[_0x7faf('0x1b')](_0x7faf('0x36'),_0xe3c9f3[_0x7faf('0x1c')],util[_0x7faf('0x1d')](this[_0x7faf('0xb')][_0xe3c9f3[_0x7faf('0x1c')]],{'showHidden':![],'depth':null}));this[_0x7faf('0x1a')]('voice:outbound','voice_outbound_channel:save',this[_0x7faf('0xb')][_0xe3c9f3[_0x7faf('0x1c')]]);}}}catch(_0x30459e){logger[_0x7faf('0x2c')]('[%s][voiceDialReport][dialend]',_0xe3c9f3[_0x7faf('0x1c')],util['inspect'](_0x30459e,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x7faf('0x18')][_0x7faf('0x16')]=function(_0x2296ce){try{if(this[_0x7faf('0x19')](_0x2296ce)){logger[_0x7faf('0x1b')]('[%s][voiceDialReport][varset]\x20event:',_0x2296ce[_0x7faf('0x1c')],util['inspect'](_0x2296ce,{'showHidden':![],'depth':null}));this[_0x7faf('0x37')](_0x2296ce['uniqueid'],_[_0x7faf('0x38')](_0x2296ce['variable'])[0x0],_0x2296ce[_0x7faf('0x39')]);if(this[_0x7faf('0x19')](_0x2296ce[_0x7faf('0x3a')])&&this[_0x7faf('0x19')](_0x2296ce['variable'][_0x7faf('0x3b')])){if(_[_0x7faf('0x3c')](this[_0x7faf('0xb')][_0x2296ce[_0x7faf('0x1c')]])){this[_0x7faf('0xb')][_0x2296ce[_0x7faf('0x1c')]]={'routeId':_0x2296ce[_0x7faf('0x39')],'variables':this['variables'][_0x2296ce[_0x7faf('0x1c')]],'motionChannel':_0x7faf('0x3d')};logger[_0x7faf('0x26')]('[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s',_0x2296ce[_0x7faf('0x1c')],_0x2296ce[_0x7faf('0x3a')][_0x7faf('0x3b')],_['keys'](_0x2296ce[_0x7faf('0x3a')])[0x0],_0x2296ce[_0x7faf('0x39')]);logger['debug'](_0x7faf('0x3e'),_0x2296ce[_0x7faf('0x1c')],util['inspect'](this[_0x7faf('0xb')][_0x2296ce[_0x7faf('0x1c')]],{'showHidden':![],'depth':null}));this[_0x7faf('0x1a')](_0x7faf('0x3f'),'voice_outbound_channel:save',this['channels'][_0x2296ce[_0x7faf('0x1c')]]);}}}}catch(_0xc1dd64){logger['error'](_0x7faf('0x40'),_0x2296ce['uniqueid'],util[_0x7faf('0x1d')](_0xc1dd64,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x7faf('0x18')][_0x7faf('0x37')]=function(_0x12dd57,_0x30485a,_0x3293f3){var _0x1c0ee9=[_0x7faf('0x41'),'rtpaudioqosbridged',_0x7faf('0x42'),'rtpaudioqosjitterbridged',_0x7faf('0x43'),_0x7faf('0x44'),'rtpaudioqosrtt',_0x7faf('0x45'),_0x7faf('0x46'),_0x7faf('0x47'),'bridgepeer',_0x7faf('0x48'),'membercalls',_0x7faf('0x49'),_0x7faf('0x4a'),_0x7faf('0x4b'),_0x7faf('0x4c'),_0x7faf('0x4d'),_0x7faf('0x4e')];if(!_['isNil'](_0x30485a)&&!_[_0x7faf('0x4f')](_0x1c0ee9,_0x30485a)){if(_[_0x7faf('0x3c')](this['variables'][_0x12dd57])){this[_0x7faf('0xf')][_0x12dd57]={};}this[_0x7faf('0xf')][_0x12dd57][_0x30485a]=_0x3293f3;}};VoiceDialReport['prototype'][_0x7faf('0x17')]=function(_0x43ad60){try{if(this[_0x7faf('0x19')](_0x43ad60)){logger[_0x7faf('0x1b')]('[%s][voiceDialReport][hangup]\x20event:',_0x43ad60[_0x7faf('0x1c')],util[_0x7faf('0x1d')](_0x43ad60,{'showHidden':![],'depth':null}));if(this['channels'][_0x43ad60[_0x7faf('0x1c')]]){logger['info']('[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete',_0x43ad60['uniqueid'],_0x43ad60['cause-txt']);this[_0x7faf('0xb')][_0x43ad60[_0x7faf('0x1c')]]['endtime']=moment()[_0x7faf('0x1f')](_0x7faf('0x20'));this[_0x7faf('0xb')][_0x43ad60['uniqueid']][_0x7faf('0x50')]=moment(this[_0x7faf('0xb')][_0x43ad60[_0x7faf('0x1c')]][_0x7faf('0x51')])[_0x7faf('0x52')](this[_0x7faf('0xb')][_0x43ad60[_0x7faf('0x1c')]][_0x7faf('0x53')],'seconds');this[_0x7faf('0xb')][_0x43ad60['uniqueid']][_0x7faf('0x54')]=_0x7faf('0x55');this[_0x7faf('0xd')][_0x7faf('0x56')]+=0x1;if(this[_0x7faf('0xb')][_0x43ad60[_0x7faf('0x1c')]][_0x7faf('0x31')]){this[_0x7faf('0xd')][_0x7faf('0x57')]+=0x1;this[_0x7faf('0xb')][_0x43ad60[_0x7faf('0x1c')]][_0x7faf('0x58')]=moment(this[_0x7faf('0xb')][_0x43ad60[_0x7faf('0x1c')]][_0x7faf('0x31')])[_0x7faf('0x52')](this[_0x7faf('0xb')][_0x43ad60[_0x7faf('0x1c')]][_0x7faf('0x53')],'seconds');this[_0x7faf('0xb')][_0x43ad60[_0x7faf('0x1c')]][_0x7faf('0x59')]=moment(this[_0x7faf('0xb')][_0x43ad60[_0x7faf('0x1c')]]['endtime'])[_0x7faf('0x52')](this[_0x7faf('0xb')][_0x43ad60[_0x7faf('0x1c')]][_0x7faf('0x31')],_0x7faf('0x5a'));this[_0x7faf('0xd')]['sumHoldTime']+=this['channels'][_0x43ad60[_0x7faf('0x1c')]]['holdtime']||0x0;this[_0x7faf('0xd')][_0x7faf('0x5b')]+=this[_0x7faf('0xb')][_0x43ad60[_0x7faf('0x1c')]]['billableseconds'];}this[_0x7faf('0xd')]['sumDuration']+=this[_0x7faf('0xb')][_0x43ad60[_0x7faf('0x1c')]]['duration'];logger[_0x7faf('0x1b')](_0x7faf('0x5c'),_0x43ad60[_0x7faf('0x1c')],util[_0x7faf('0x1d')](this[_0x7faf('0xb')][_0x43ad60[_0x7faf('0x1c')]],{'showHidden':![],'depth':null}));ami[_0x7faf('0x1a')](_0x7faf('0x5d'),this[_0x7faf('0xb')][_0x43ad60[_0x7faf('0x1c')]]);logger[_0x7faf('0x1b')]('[%s][voiceDialReport][hangup]\x20sending\x20dialend\x20event:',_0x43ad60[_0x7faf('0x1c')],util[_0x7faf('0x1d')](this[_0x7faf('0xb')][_0x43ad60[_0x7faf('0x1c')]],{'showHidden':![],'depth':null}));ami['emit'](_0x7faf('0x5e'),this[_0x7faf('0xb')][_0x43ad60['uniqueid']]);logger['debug'](_0x7faf('0x5f'),_0x43ad60[_0x7faf('0x1c')],util['inspect'](this[_0x7faf('0xb')][_0x43ad60[_0x7faf('0x1c')]],{'showHidden':![],'depth':null}));this[_0x7faf('0x1a')](_0x7faf('0x3f'),_0x7faf('0x60'),this[_0x7faf('0xd')]);logger[_0x7faf('0x26')](_0x7faf('0x61'),JSON[_0x7faf('0x62')](this[_0x7faf('0xb')][_0x43ad60[_0x7faf('0x1c')]]));logger[_0x7faf('0x1b')](_0x7faf('0x63'),_0x43ad60[_0x7faf('0x1c')],util[_0x7faf('0x1d')](this[_0x7faf('0xb')][_0x43ad60[_0x7faf('0x1c')]],{'showHidden':![],'depth':null}));this[_0x7faf('0x1a')]('voice:outbound',_0x7faf('0x64'),this[_0x7faf('0xb')][_0x43ad60[_0x7faf('0x1c')]]);delete this[_0x7faf('0xb')][_0x43ad60[_0x7faf('0x1c')]];}else if(this[_0x7faf('0xb')][_0x43ad60['linkedid']]){this['channels'][_0x43ad60[_0x7faf('0x65')]][_0x7faf('0x1c')]=this[_0x7faf('0xb')][_0x43ad60[_0x7faf('0x65')]][_0x7faf('0x66')];}if(this[_0x7faf('0xf')][_0x43ad60[_0x7faf('0x1c')]]){delete this['variables'][_0x43ad60[_0x7faf('0x1c')]];}}}catch(_0x2d3aa3){logger[_0x7faf('0x2c')](_0x7faf('0x67'),_0x43ad60[_0x7faf('0x1c')],util[_0x7faf('0x1d')](_0x2d3aa3,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x7faf('0x18')]['syncNewExten']=function(_0x40ef14){try{if(this['isNotNull'](_0x40ef14)){logger[_0x7faf('0x1b')](_0x7faf('0x68'),_0x40ef14['uniqueid'],util['inspect'](_0x40ef14,{'showHidden':![],'depth':null}));if(_0x40ef14[_0x7faf('0x69')]['toLowerCase']()===_0x7faf('0x6a')){_0x40ef14[_0x7faf('0x6b')]=(_0x40ef14['appdata']||_0x40ef14['applicationdata'])[_0x7faf('0x6c')]();if(_[_0x7faf('0x6d')](_0x40ef14[_0x7faf('0x6b')],_0x7faf('0x6e'))){if(_[_0x7faf('0x3c')](this['applications'][_0x40ef14['uniqueid']]))this[_0x7faf('0xe')][_0x40ef14[_0x7faf('0x1c')]]={};logger[_0x7faf('0x26')](_0x7faf('0x6f'),_0x40ef14[_0x7faf('0x1c')],_0x40ef14[_0x7faf('0x69')],_0x40ef14[_0x7faf('0x6b')]);var _0x3e82ac=_0x40ef14['applicationdata'][_0x7faf('0x70')]('=');var _0x4f9ab3=_0x3e82ac[0x0][_0x7faf('0x71')](/cdr\((.*)\)/);if(_0x4f9ab3)this['applications'][_0x40ef14['uniqueid']][_0x4f9ab3[0x1]]=_0x3e82ac[0x1];}}}}catch(_0x595aca){logger['error'](_0x7faf('0x72'),_0x40ef14['uniqueid'],util[_0x7faf('0x1d')](_0x595aca,{'showHidden':![],'depth':null}));}};module[_0x7faf('0x73')]=VoiceDialReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceQueueReport.js b/server/services/ami/report/voiceQueueReport.js index 1131268..9e36132 100644 --- a/server/services/ami/report/voiceQueueReport.js +++ b/server/services/ami/report/voiceQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8d97=['waiting','toNumber','callers','loggedin','available','[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:','custom:queuesummary','[voiceQueueReport][queuesummarycomplete]\x20event:','[%s][voiceQueueReport][queuecallerjoin]','isUndefined','queuecallerjoinAt','position','count','routealias','[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s','pick','last','queuecallercomplete','queuecallercompleteAt','holdtime','originalposition','queuecallerabandonAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexitreason','ABANDONED','lastAssignedTo','[%s][voiceQueueReport][queuecallerabandon]','[%s][voiceQueueReport][queuecallerleave]','queuecallerleaveAt','connectedlinenum','[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinename','[%s][voiceQueueReport][agentconnect]','COMPLETEDBYAGENT','[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT','[%s][voiceQueueReport][agentcomplete]','assigned','membername','transfer','reason','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED','startsWith','toLowerCase','local/','linkedid','queuecallerexit','add','FORWARDTRANSFER','transfertype','FORWARD','destexten','transferuniqueid','COMPLETEDBY','toUpperCase','[%s][voiceQueueReport][varset]','keys','variable','queuestatus','value','CONTINUE','queuecallerexitAt','TIMEOUT','lastevent','timeout','queueposition','EXITWITHKEY','[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s','addVariable','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','memberpenalty','memberrealtime','[%s][voiceQueueReport][hangup]','abandoned','seconds','length','milliseconds','diff','total','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:','custom:queuecallerunmanaged','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:','[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s','cause-txt','[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:','custom:voiceQueueReport','transfereeuniqueid','secondtransfererexten','secondtransfereruniqueid','ATTENDEDTRANSFER','ATTENDED','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','transfertargetuniqueid','transferexten','origtransfereruniqueid','[%s][voiceQueueReport][attendedtransfer]','syncBlindTransfer','[%s][voiceQueueReport][blindtransfer]','BLINDTRANSFER','extension','[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','BlindTransfer','[%s][voiceQueueReport][musiconholdstart]','mohstarttime','[%s][voiceQueueReport][musiconholdstop]','[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s','mohtime','[%s][voiceQueueReport][newexten]\x20event:','application','set','applicationdata','appdata','cdr(','[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s','match','[%s][voiceQueueReport][newexten]','exports','moment','util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','prototype','enqueue','tail','sequence','queueReports','channels','queueChannels','voiceQueues','flagQueueSummary','campaigns','variables','queuesummary','syncQueueSummary','bind','queuesummarycomplete','syncQueueSummaryComplete','queuecallerjoin','syncQueueCallerJoin','queuecallerabandon','syncQueueCallerAbandon','queuecallerleave','syncQueueCallerLeave','agentcomplete','agentconnect','syncAgentConnect','varset','syncVarSet','hangup','syncHangup','fullybooted','syncFullyBooted','newexten','syncNewExten','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','isEmpty','hasOwnProperty','originated','talking','pTalking','unlockRR','clearZombieChannels','switch','isNil','Action','status','channel','catch','message','No\x20such\x20channel','[%s][voiceQueueReport][checkChannel]','[%s][voiceQueueReport][checkQueueReport]','inspect','error','[%s][voiceQueueReport][checkVariables]','[FullyBooted]\x20clear\x20realtime','clearQueueReport','agents','emitVoiceQueueChannelRemove','clearqueuereport','emit','emitVoiceQueueChannelSave','debug',']\x20sending\x20voice_queue_channel:save\x20event:','uniqueid','format','voice:queue:%s','name','voice_queue_channel:save','[%s][voiceQueueReport][',']\x20sending\x20voice_queue_channel:remove\x20event:','voice_queue_channel:remove','emitVoiceQueueSummary','type','inbound','strategy','answered','loggedIn','sumBillable','sumDuration','sumHoldTime','unmanaged','Trunk','active','callerid','Interval','md5','[voiceQueueReport][','voice_queue:save','isNotNull','queues','[voiceQueueReport][queues]','loopQueueSummary','then','[voiceQueueReport][queuesummary]','[voiceQueueReport][queuesummary]\x20event:','info','[voiceQueueReport][queuesummary]\x20name:%s','queue','countBy'];(function(_0x5ad6f9,_0x4729a3){var _0x5a90fd=function(_0x247973){while(--_0x247973){_0x5ad6f9['push'](_0x5ad6f9['shift']());}};_0x5a90fd(++_0x4729a3);}(_0x8d97,0x82));var _0x78d9=function(_0x2c326d,_0x40810f){_0x2c326d=_0x2c326d-0x0;var _0x397af0=_0x8d97[_0x2c326d];return _0x397af0;};'use strict';var _=require('lodash');var moment=require(_0x78d9('0x0'));var util=require(_0x78d9('0x1'));var md5=require('md5');var Redis=require(_0x78d9('0x2'));var config=require(_0x78d9('0x3'));var logger=require(_0x78d9('0x4'))(_0x78d9('0x5'));var ami=require(_0x78d9('0x6'));var QueueReport=require('../model/queueReport');config[_0x78d9('0x7')]=_[_0x78d9('0x8')](config[_0x78d9('0x7')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var Sequence=function(){};Sequence[_0x78d9('0x9')][_0x78d9('0xa')]=function(_0x36b8f5){this[_0x78d9('0xb')]=this[_0x78d9('0xb')]?this[_0x78d9('0xb')]['finally'](_0x36b8f5):_0x36b8f5();};function VoiceQueueReport(_0x1a1453){this[_0x78d9('0xc')]=new Sequence();this[_0x78d9('0xd')]={};this['agents']=_0x1a1453['agents'];this[_0x78d9('0xe')]=_0x1a1453[_0x78d9('0xf')];this[_0x78d9('0x10')]=_0x1a1453[_0x78d9('0x10')];this[_0x78d9('0x11')]=!![];this[_0x78d9('0x12')]=_0x1a1453['campaigns'];this[_0x78d9('0x13')]={};ami['on'](_0x78d9('0x14'),this[_0x78d9('0x15')][_0x78d9('0x16')](this));ami['on'](_0x78d9('0x17'),this[_0x78d9('0x18')][_0x78d9('0x16')](this));ami['on'](_0x78d9('0x19'),this[_0x78d9('0x1a')][_0x78d9('0x16')](this));ami['on'](_0x78d9('0x1b'),this[_0x78d9('0x1c')][_0x78d9('0x16')](this));ami['on'](_0x78d9('0x1d'),this[_0x78d9('0x1e')][_0x78d9('0x16')](this));ami['on'](_0x78d9('0x1f'),this['syncAgentComplete'][_0x78d9('0x16')](this));ami['on'](_0x78d9('0x20'),this[_0x78d9('0x21')][_0x78d9('0x16')](this));ami['on'](_0x78d9('0x22'),this[_0x78d9('0x23')][_0x78d9('0x16')](this));ami['on'](_0x78d9('0x24'),this[_0x78d9('0x25')][_0x78d9('0x16')](this));ami['on'](_0x78d9('0x26'),this[_0x78d9('0x27')][_0x78d9('0x16')](this));ami['on'](_0x78d9('0x28'),this[_0x78d9('0x29')][_0x78d9('0x16')](this));ami['on']('musiconholdstart',this[_0x78d9('0x2a')][_0x78d9('0x16')](this));ami['on'](_0x78d9('0x2b'),this[_0x78d9('0x2c')]['bind'](this));ami['on'](_0x78d9('0x2d'),this[_0x78d9('0x2e')][_0x78d9('0x16')](this));ami['on']('blindtransfer',this['syncBlindTransfer'][_0x78d9('0x16')](this));this['loopQueueSummary']();this['loopQueueShow']();}function clearChannels(_0x4802f4){if(!_[_0x78d9('0x2f')](_0x4802f4)){for(var _0x1fa9a1 in _0x4802f4){if(_0x4802f4[_0x78d9('0x30')](_0x1fa9a1)){delete _0x4802f4[_0x1fa9a1];}}}}function clearCampaigns(_0xacd80c){if(!_[_0x78d9('0x2f')](_0xacd80c)){for(var _0x17db22 in _0xacd80c){if(_0xacd80c['hasOwnProperty'](_0x17db22)){_0xacd80c[_0x17db22][_0x78d9('0x31')]=0x0;}}}}function clearVoiceQueues(_0x53a0ab){if(!_[_0x78d9('0x2f')](_0x53a0ab)){for(var _0x3d9a53 in _0x53a0ab){if(_0x53a0ab[_0x78d9('0x30')](_0x3d9a53)){_0x53a0ab[_0x3d9a53]['originated']=0x0;_0x53a0ab[_0x3d9a53][_0x78d9('0x32')]=0x0;_0x53a0ab[_0x3d9a53][_0x78d9('0x33')]=0x0;_0x53a0ab[_0x3d9a53]['waiting']=0x0;_0x53a0ab[_0x3d9a53]['queueStatusComplete']=!![];}}}}function clearAgentBooked(_0x55617c){if(!_['isEmpty'](_0x55617c)){for(var _0x1e4f67 in _0x55617c){if(_0x55617c[_0x78d9('0x30')](_0x1e4f67)){_0x55617c[_0x1e4f67][_0x78d9('0x34')]=!![];}}}}VoiceQueueReport[_0x78d9('0x9')][_0x78d9('0x35')]=function(){var _0x3fe42b=this;for(var _0x457cc9 in this[_0x78d9('0xe')]){if(this[_0x78d9('0xe')][_0x78d9('0x30')](_0x457cc9)&&!this['channels'][_0x457cc9][_0x78d9('0x36')]){this['sequence']['enqueue'](function(){if(!_[_0x78d9('0x37')](_0x3fe42b[_0x78d9('0xe')][_0x457cc9])){return ami[_0x78d9('0x38')]({'action':_0x78d9('0x39'),'channel':_0x3fe42b[_0x78d9('0xe')][_0x457cc9][_0x78d9('0x3a')]})[_0x78d9('0x3b')](function(_0x5cc2c0){if(_0x5cc2c0[_0x78d9('0x3c')]===_0x78d9('0x3d')){setTimeout(function(){if(_0x3fe42b[_0x78d9('0xe')][_0x457cc9]){delete _0x3fe42b[_0x78d9('0xe')][_0x457cc9];logger['error'](_0x78d9('0x3e'),_0x457cc9,util['inspect'](_0x5cc2c0,{'showHidden':![],'depth':null}));}if(_0x3fe42b['queueReports'][_0x457cc9]){delete _0x3fe42b['queueReports'][_0x457cc9];logger['error'](_0x78d9('0x3f'),_0x457cc9,util[_0x78d9('0x40')](_0x5cc2c0,{'showHidden':![],'depth':null}));}if(_0x3fe42b[_0x78d9('0x13')][_0x457cc9]){delete _0x3fe42b[_0x78d9('0x13')][_0x457cc9];logger[_0x78d9('0x41')](_0x78d9('0x42'),_0x457cc9,util[_0x78d9('0x40')](_0x5cc2c0,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0x78d9('0x9')][_0x78d9('0x27')]=function(){logger[_0x78d9('0x41')](_0x78d9('0x43'));clearChannels(this[_0x78d9('0xe')]);this[_0x78d9('0x44')](this[_0x78d9('0xd')]);clearAgentBooked(this[_0x78d9('0x45')]);clearVoiceQueues(this[_0x78d9('0x10')]);clearCampaigns(this[_0x78d9('0x12')]);};VoiceQueueReport[_0x78d9('0x9')]['clearQueueReport']=function(_0x4cd79e){var _0x2ca911=this;if(!_[_0x78d9('0x2f')](_0x4cd79e)){for(var _0x14e404 in _0x4cd79e){if(_0x4cd79e[_0x78d9('0x30')](_0x14e404)){_0x2ca911[_0x78d9('0x46')](_0x4cd79e[_0x14e404],_0x78d9('0x47'));delete _0x4cd79e[_0x14e404];}}}};VoiceQueueReport['prototype'][_0x78d9('0x48')]=function(_0x364ac1,_0x2dc5f2,_0x237818){io['to'](_0x364ac1)[_0x78d9('0x48')](_0x2dc5f2,_0x237818);};VoiceQueueReport['prototype'][_0x78d9('0x49')]=function(_0x3ec28a,_0x1863d2){logger[_0x78d9('0x4a')]('[%s][voiceQueueReport]['+_0x1863d2+_0x78d9('0x4b'),_0x3ec28a[_0x78d9('0x4c')],util[_0x78d9('0x40')](_0x3ec28a,{'showHidden':![],'depth':null}));this[_0x78d9('0x48')](util[_0x78d9('0x4d')](_0x78d9('0x4e'),_0x3ec28a[_0x78d9('0x4f')]),_0x78d9('0x50'),_0x3ec28a);io[_0x78d9('0x48')]('voice_queue_presence:save',_0x3ec28a);};VoiceQueueReport[_0x78d9('0x9')][_0x78d9('0x46')]=function(_0x5c7854,_0xc4e054){logger[_0x78d9('0x4a')](_0x78d9('0x51')+_0xc4e054+_0x78d9('0x52'),_0x5c7854[_0x78d9('0x4c')],util[_0x78d9('0x40')](_0x5c7854,{'showHidden':![],'depth':null}));this[_0x78d9('0x48')](util[_0x78d9('0x4d')]('voice:queue:%s',_0x5c7854['name']),_0x78d9('0x53'),_0x5c7854);io[_0x78d9('0x48')]('voice_queue_presence:remove',_0x5c7854);};VoiceQueueReport[_0x78d9('0x9')][_0x78d9('0x54')]=function(_0x3ddf56,_0x347c33){if(_0x3ddf56[_0x78d9('0x55')]===_0x78d9('0x56')){var _0x302aa4={'id':_0x3ddf56['id'],'name':_0x3ddf56[_0x78d9('0x4f')],'strategy':_0x3ddf56[_0x78d9('0x57')],'answered':_0x3ddf56[_0x78d9('0x58')],'available':_0x3ddf56['available'],'loggedIn':_0x3ddf56[_0x78d9('0x59')],'pTalking':_0x3ddf56[_0x78d9('0x33')],'sumBillable':_0x3ddf56[_0x78d9('0x5a')],'sumDuration':_0x3ddf56[_0x78d9('0x5b')],'sumHoldTime':_0x3ddf56[_0x78d9('0x5c')]||0x0,'talking':_0x3ddf56['talking'],'total':_0x3ddf56['total'],'type':_0x3ddf56[_0x78d9('0x55')],'unmanaged':_0x3ddf56[_0x78d9('0x5d')],'abandoned':_0x3ddf56['abandoned'],'waiting':_0x3ddf56['waiting']};if(_0x3ddf56[_0x78d9('0x5e')]){_0x302aa4['Trunk']={'id':_0x3ddf56[_0x78d9('0x5e')]['id'],'name':_0x3ddf56[_0x78d9('0x5e')][_0x78d9('0x4f')],'active':_0x3ddf56[_0x78d9('0x5e')][_0x78d9('0x5f')],'callerid':_0x3ddf56[_0x78d9('0x5e')][_0x78d9('0x60')]};}if(_0x3ddf56[_0x78d9('0x61')]){_0x302aa4[_0x78d9('0x61')]={'id':_0x3ddf56[_0x78d9('0x61')]['id'],'name':_0x3ddf56[_0x78d9('0x61')]['name']};}var _0x3265a2=md5(JSON['stringify'](_0x302aa4));if(_0x3ddf56[_0x78d9('0x62')]!==_0x3265a2){_0x3ddf56[_0x78d9('0x62')]=_0x3265a2;logger[_0x78d9('0x4a')](_0x78d9('0x63')+_0x347c33+']\x20sending\x20voice_queue:save\x20event:',util[_0x78d9('0x40')](_0x302aa4,{'showHidden':![],'depth':null}));this['emit'](util['format']('voice:queue:%s',_0x302aa4[_0x78d9('0x4f')]),_0x78d9('0x64'),_0x302aa4);}}};VoiceQueueReport[_0x78d9('0x9')][_0x78d9('0x65')]=function(_0xae58bb){return _0xae58bb!==null&&!_['isUndefined'](_0xae58bb);};VoiceQueueReport[_0x78d9('0x9')]['loopQueueShow']=function(){var _0x351d4a=this;setInterval(function(){_0x351d4a[_0x78d9('0x35')]();ami[_0x78d9('0x38')]({'action':_0x78d9('0x66')})['catch'](function(_0x57a741){logger[_0x78d9('0x41')](_0x78d9('0x67'),util[_0x78d9('0x40')](_0x57a741,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport[_0x78d9('0x9')][_0x78d9('0x68')]=function(){var _0x176ba0=this;setInterval(function(){if(_0x176ba0[_0x78d9('0x11')]){return ami[_0x78d9('0x38')]({'action':_0x78d9('0x14')})[_0x78d9('0x69')](function(_0x468a4b){_0x176ba0[_0x78d9('0x11')]=![];})['catch'](function(_0xa9e1eb){logger[_0x78d9('0x41')](_0x78d9('0x6a'),util[_0x78d9('0x40')](_0xa9e1eb,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport['prototype'][_0x78d9('0x15')]=function(_0x42c3b9){try{if(this['isNotNull'](_0x42c3b9)&&this[_0x78d9('0x65')](_0x42c3b9['queue'])){logger['debug'](_0x78d9('0x6b'),util[_0x78d9('0x40')](_0x42c3b9,{'showHidden':![],'depth':null}));if(this[_0x78d9('0x10')][_0x42c3b9['queue']]){logger[_0x78d9('0x6c')](_0x78d9('0x6d'),_0x42c3b9[_0x78d9('0x6e')]);var _0x4c370c=_[_0x78d9('0x6f')](this['channels'],_0x78d9('0x6e'))[_0x42c3b9[_0x78d9('0x6e')]]||0x0;var _0x20f545=_0x4c370c-_0x42c3b9['callers'];if(this['voiceQueues'][_0x42c3b9[_0x78d9('0x6e')]][_0x78d9('0x70')]!==_[_0x78d9('0x71')](_0x42c3b9[_0x78d9('0x72')])||this['voiceQueues'][_0x42c3b9['queue']][_0x78d9('0x59')]!==_[_0x78d9('0x71')](_0x42c3b9[_0x78d9('0x73')])||this['voiceQueues'][_0x42c3b9['queue']][_0x78d9('0x74')]!==_[_0x78d9('0x71')](_0x42c3b9[_0x78d9('0x74')])||this[_0x78d9('0x10')][_0x42c3b9[_0x78d9('0x6e')]]['talking']!==_0x20f545){this[_0x78d9('0x10')][_0x42c3b9[_0x78d9('0x6e')]]['waiting']=_[_0x78d9('0x71')](_0x42c3b9[_0x78d9('0x72')]);this[_0x78d9('0x10')][_0x42c3b9[_0x78d9('0x6e')]][_0x78d9('0x59')]=_[_0x78d9('0x71')](_0x42c3b9[_0x78d9('0x73')]);this[_0x78d9('0x10')][_0x42c3b9[_0x78d9('0x6e')]][_0x78d9('0x74')]=_[_0x78d9('0x71')](_0x42c3b9[_0x78d9('0x74')]);this[_0x78d9('0x10')][_0x42c3b9[_0x78d9('0x6e')]][_0x78d9('0x32')]=_0x20f545>0x0?_0x20f545:0x0;this[_0x78d9('0x10')][_0x42c3b9[_0x78d9('0x6e')]][_0x78d9('0x32')]=this[_0x78d9('0x10')][_0x42c3b9[_0x78d9('0x6e')]]['talking']>_[_0x78d9('0x71')](_0x42c3b9[_0x78d9('0x73')])?_['toNumber'](_0x42c3b9[_0x78d9('0x73')]):this[_0x78d9('0x10')][_0x42c3b9[_0x78d9('0x6e')]][_0x78d9('0x32')];this['emitVoiceQueueSummary'](this[_0x78d9('0x10')][_0x42c3b9['queue']],_0x78d9('0x14'));}logger[_0x78d9('0x4a')](_0x78d9('0x75'),util[_0x78d9('0x40')](this[_0x78d9('0x10')][_0x42c3b9[_0x78d9('0x6e')]],{'showHidden':![],'depth':null}));ami[_0x78d9('0x48')](_0x78d9('0x76'),this['voiceQueues'][_0x42c3b9['queue']]);}}}catch(_0x4589de){logger['error'](_0x78d9('0x6a'),util['inspect'](_0x4589de,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x78d9('0x9')][_0x78d9('0x18')]=function(_0x5e6af7){logger[_0x78d9('0x4a')](_0x78d9('0x77'),util[_0x78d9('0x40')](_0x5e6af7,{'showHidden':![],'depth':null}));this['flagQueueSummary']=!![];};VoiceQueueReport[_0x78d9('0x9')][_0x78d9('0x1a')]=function(_0x538322){try{if(this[_0x78d9('0x65')](_0x538322)){logger[_0x78d9('0x4a')](_0x78d9('0x78'),_0x538322[_0x78d9('0x4c')],util['inspect'](_0x538322,{'showHidden':![],'depth':null}));if(_[_0x78d9('0x79')](this[_0x78d9('0xd')][_0x538322[_0x78d9('0x4c')]]))this[_0x78d9('0xd')][_0x538322[_0x78d9('0x4c')]]=[];if(_[_0x78d9('0x79')](this[_0x78d9('0xe')][_0x538322[_0x78d9('0x4c')]]))this[_0x78d9('0xe')][_0x538322['uniqueid']]={};var _0x5ae238=new QueueReport();_0x5ae238[_0x78d9('0x4f')]=_0x538322[_0x78d9('0x6e')];_0x5ae238[_0x78d9('0x55')]=this[_0x78d9('0x10')][_0x5ae238[_0x78d9('0x4f')]]&&this[_0x78d9('0x10')][_0x5ae238[_0x78d9('0x4f')]]['type']?this[_0x78d9('0x10')][_0x5ae238[_0x78d9('0x4f')]][_0x78d9('0x55')]||_0x78d9('0x56'):_0x78d9('0x56');_0x5ae238[_0x78d9('0x6e')]=_0x538322[_0x78d9('0x6e')];_0x5ae238[_0x78d9('0x7a')]=moment()[_0x78d9('0x4d')]('YYYY-MM-DD\x20HH:mm:ss');_0x5ae238[_0x78d9('0x7b')]=_0x538322['position'];_0x5ae238[_0x78d9('0x7c')]=_0x538322['count'];_0x5ae238['uniqueid']=_0x538322[_0x78d9('0x4c')];_0x5ae238[_0x78d9('0x7d')]=this[_0x78d9('0xe')][_0x538322[_0x78d9('0x4c')]][_0x78d9('0x7d')];logger['info'](_0x78d9('0x7e'),_0x5ae238['name'],_0x5ae238[_0x78d9('0x55')]);_['merge'](_0x5ae238,_[_0x78d9('0x7f')](_0x538322,_['keys'](_0x5ae238)));this[_0x78d9('0xd')][_0x538322[_0x78d9('0x4c')]]['push'](_0x5ae238);this['channels'][_0x538322[_0x78d9('0x4c')]]=_0x5ae238;this[_0x78d9('0x49')](_0x5ae238,_0x78d9('0x19'));}}catch(_0x2c9007){logger['error']('[%s][voiceQueueReport][queuecallerjoin]',_0x538322['uniqueid'],util[_0x78d9('0x40')](_0x2c9007,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x78d9('0x9')][_0x78d9('0x1c')]=function(_0x25bf3b){try{if(this['isNotNull'](_0x25bf3b)){logger[_0x78d9('0x4a')]('[%s][voiceQueueReport][queuecallerabandon]',_0x25bf3b['uniqueid'],util[_0x78d9('0x40')](_0x25bf3b,{'showHidden':![],'depth':null}));if(this[_0x78d9('0xd')][_0x25bf3b[_0x78d9('0x4c')]]){var _0x238cd9=_[_0x78d9('0x80')](this[_0x78d9('0xd')][_0x25bf3b[_0x78d9('0x4c')]]);_0x238cd9[_0x78d9('0x81')]=![];_0x238cd9[_0x78d9('0x82')]=null;_0x238cd9[_0x78d9('0x83')]=_0x25bf3b[_0x78d9('0x83')];_0x238cd9[_0x78d9('0x84')]=_0x25bf3b[_0x78d9('0x84')];_0x238cd9[_0x78d9('0x1b')]=!![];_0x238cd9[_0x78d9('0x85')]=moment()[_0x78d9('0x4d')](_0x78d9('0x86'));_0x238cd9[_0x78d9('0x87')]=_0x78d9('0x88');_0x238cd9[_0x78d9('0x89')]=null;logger[_0x78d9('0x6c')]('[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s',_0x238cd9[_0x78d9('0x4f')],_0x238cd9[_0x78d9('0x55')]);this[_0x78d9('0xe')][_0x25bf3b[_0x78d9('0x4c')]]=_0x238cd9;this[_0x78d9('0x46')](_0x238cd9,_0x78d9('0x1b'));}}}catch(_0x4a64c9){logger[_0x78d9('0x41')](_0x78d9('0x8a'),_0x25bf3b['uniqueid'],util['inspect'](_0x4a64c9,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x78d9('0x9')][_0x78d9('0x1e')]=function(_0x176aac){try{if(this[_0x78d9('0x65')](_0x176aac)){logger['debug'](_0x78d9('0x8b'),_0x176aac['uniqueid'],util[_0x78d9('0x40')](_0x176aac,{'showHidden':![],'depth':null}));if(this[_0x78d9('0xd')][_0x176aac[_0x78d9('0x4c')]]){var _0x37f51a=_[_0x78d9('0x80')](this['queueReports'][_0x176aac[_0x78d9('0x4c')]]);_0x37f51a[_0x78d9('0x8c')]=moment()['format'](_0x78d9('0x86'));_0x37f51a[_0x78d9('0x8d')]=_0x176aac[_0x78d9('0x8d')];_0x37f51a['connectedlinename']=_0x176aac['connectedlinename'];logger['info'](_0x78d9('0x8e'),_0x37f51a['name'],_0x37f51a['type'],_0x176aac[_0x78d9('0x8d')],_0x176aac[_0x78d9('0x8f')]);this[_0x78d9('0xe')][_0x176aac['uniqueid']]=_0x37f51a;this['emitVoiceQueueChannelSave'](_0x37f51a,_0x78d9('0x1d'));}}}catch(_0x3eee2e){logger['error'](_0x78d9('0x8b'),_0x176aac[_0x78d9('0x4c')],util['inspect'](_0x3eee2e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x78d9('0x9')][_0x78d9('0x21')]=function(_0xed29b5){try{if(this[_0x78d9('0x65')](_0xed29b5)){logger[_0x78d9('0x4a')](_0x78d9('0x90'),_0xed29b5[_0x78d9('0x4c')],util[_0x78d9('0x40')](_0xed29b5,{'showHidden':![],'depth':null}));if(this[_0x78d9('0xd')][_0xed29b5['uniqueid']]){var _0x1533ae=_[_0x78d9('0x80')](this['queueReports'][_0xed29b5[_0x78d9('0x4c')]]);_0x1533ae[_0x78d9('0x81')]=!![];_0x1533ae[_0x78d9('0x87')]=_0x78d9('0x91');logger[_0x78d9('0x6c')](_0x78d9('0x92'),_0x1533ae[_0x78d9('0x4f')],_0x1533ae[_0x78d9('0x55')]);}}}catch(_0x5533b2){logger[_0x78d9('0x41')]('[%s][voiceQueueReport][agentconnect]',_0xed29b5[_0x78d9('0x4c')],util[_0x78d9('0x40')](_0x5533b2,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x78d9('0x9')]['syncAgentComplete']=function(_0x1ba4fe){try{if(this[_0x78d9('0x65')](_0x1ba4fe)){logger[_0x78d9('0x4a')](_0x78d9('0x93'),_0x1ba4fe[_0x78d9('0x4c')],util[_0x78d9('0x40')](_0x1ba4fe,{'showHidden':![],'depth':null}));if(this[_0x78d9('0xd')][_0x1ba4fe[_0x78d9('0x4c')]]){var _0x36c101=_[_0x78d9('0x80')](this[_0x78d9('0xd')][_0x1ba4fe[_0x78d9('0x4c')]]);_0x36c101[_0x78d9('0x1b')]=![];_0x36c101[_0x78d9('0x85')]=null;_0x36c101[_0x78d9('0x94')]=!![];_0x36c101[_0x78d9('0x89')]=_0x1ba4fe[_0x78d9('0x95')];_0x36c101[_0x78d9('0x83')]=_0x1ba4fe[_0x78d9('0x83')];_0x36c101[_0x78d9('0x81')]=!![];_0x36c101['queuecallerexit']=![];_0x36c101['queuecallerexitAt']=null;if(!_0x36c101[_0x78d9('0x96')]){if(_0x1ba4fe[_0x78d9('0x97')]=='transfer'){_0x36c101[_0x78d9('0x87')]='COMPLETED';logger[_0x78d9('0x6c')](_0x78d9('0x98'),_0x36c101[_0x78d9('0x4f')],_0x36c101[_0x78d9('0x55')]);}else{if(_[_0x78d9('0x99')](_0x1ba4fe['channel'][_0x78d9('0x9a')](),_0x78d9('0x9b'))){if(this['queueReports'][_0x1ba4fe[_0x78d9('0x9c')]]){var _0x445078=_[_0x78d9('0x80')](this['queueReports'][_0x1ba4fe[_0x78d9('0x9c')]]);_0x445078[_0x78d9('0x81')]=![];_0x445078[_0x78d9('0x9d')]=!![];_0x445078['queuecallerexitAt']=moment(_0x36c101[_0x78d9('0x7a')])[_0x78d9('0x9e')](_0x1ba4fe[_0x78d9('0x83')],'seconds')['format'](_0x78d9('0x86'));_0x445078[_0x78d9('0x87')]=_0x78d9('0x9f');_0x445078[_0x78d9('0x96')]=!![];_0x445078[_0x78d9('0xa0')]=_0x78d9('0xa1');_0x445078['transferexten']=_0x1ba4fe[_0x78d9('0xa2')];_0x445078[_0x78d9('0xa3')]=_0x1ba4fe['uniqueid'];logger['info']('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER',_0x445078['name'],_0x445078[_0x78d9('0x55')]);var _0x2ccf0e=this[_0x78d9('0xd')][_0x1ba4fe[_0x78d9('0x9c')]];this[_0x78d9('0xd')][_0x1ba4fe[_0x78d9('0x9c')]]=this[_0x78d9('0xd')][_0x1ba4fe[_0x78d9('0x4c')]];this['queueReports'][_0x1ba4fe[_0x78d9('0x4c')]]=_0x2ccf0e;}}else{_0x36c101['queuecallerexitreason']=_0x78d9('0xa4')+_0x1ba4fe[_0x78d9('0x97')][_0x78d9('0xa5')]();logger[_0x78d9('0x6c')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s',_0x36c101['name'],_0x36c101[_0x78d9('0x55')],_0x36c101[_0x78d9('0x87')]);}}}this[_0x78d9('0xe')][_0x1ba4fe['uniqueid']]=_0x36c101;this[_0x78d9('0x46')](_0x36c101,_0x78d9('0x1f'));}}}catch(_0x202b34){logger[_0x78d9('0x41')](_0x78d9('0x93'),_0x1ba4fe[_0x78d9('0x4c')],util[_0x78d9('0x40')](_0x202b34,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x78d9('0x9')][_0x78d9('0x23')]=function(_0xf52cb6){try{if(this[_0x78d9('0x65')](_0xf52cb6)){logger[_0x78d9('0x4a')](_0x78d9('0xa6'),_0xf52cb6[_0x78d9('0x4c')],util['inspect'](_0xf52cb6,{'showHidden':![],'depth':null}));this['addVariable'](_0xf52cb6[_0x78d9('0x4c')],_[_0x78d9('0xa7')](_0xf52cb6['variable'])[0x0],_0xf52cb6['value']);if(this[_0x78d9('0xd')][_0xf52cb6[_0x78d9('0x4c')]]){var _0x329d0f=_['last'](this['queueReports'][_0xf52cb6[_0x78d9('0x4c')]]);if(_0x329d0f){if(this['isNotNull'](_0xf52cb6[_0x78d9('0xa8')])&&this['isNotNull'](_0xf52cb6[_0x78d9('0xa8')][_0x78d9('0xa9')])){switch(_0xf52cb6[_0x78d9('0xaa')]){case _0x78d9('0xab'):_0x329d0f[_0x78d9('0x9d')]=![];_0x329d0f[_0x78d9('0xac')]=null;break;case _0x78d9('0xad'):_0x329d0f[_0x78d9('0xae')]=_0x78d9('0xaf');_0x329d0f[_0x78d9('0x9d')]=!![];_0x329d0f[_0x78d9('0xac')]=moment()[_0x78d9('0x4d')](_0x78d9('0x86'));_0x329d0f['queuecallerleaveAt']=moment()[_0x78d9('0x4d')]('YYYY-MM-DD\x20HH:mm:ss');logger['debug']('[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:',_0xf52cb6[_0x78d9('0x4c')],util[_0x78d9('0x40')](_0x329d0f,{'showHidden':![],'depth':null}));ami[_0x78d9('0x48')]('custom:timeout',_0x329d0f);break;default:_0x329d0f[_0x78d9('0x9d')]=!![];_0x329d0f[_0x78d9('0xac')]=moment()[_0x78d9('0x4d')](_0x78d9('0x86'));_0x329d0f['queuecallerleaveAt']=moment()[_0x78d9('0x4d')](_0x78d9('0x86'));}_0x329d0f[_0x78d9('0x1b')]=![];_0x329d0f['queuecallerabandonAt']=null;_0x329d0f[_0x78d9('0x87')]=_0xf52cb6[_0x78d9('0xaa')];this['channels'][_0xf52cb6[_0x78d9('0x4c')]]=_0x329d0f;this['emitVoiceQueueChannelRemove'](_0x329d0f,_0x78d9('0x22'));}else if(this[_0x78d9('0x65')](_0xf52cb6[_0x78d9('0xa8')])&&this[_0x78d9('0x65')](_0xf52cb6['variable'][_0x78d9('0xb0')])){if(!_0x329d0f['queuecallerabandon']){_0x329d0f[_0x78d9('0x9d')]=!![];_0x329d0f[_0x78d9('0xac')]=moment()[_0x78d9('0x4d')](_0x78d9('0x86'));_0x329d0f[_0x78d9('0x87')]=_0x78d9('0xb1');_0x329d0f[_0x78d9('0x8c')]=moment()[_0x78d9('0x4d')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x78d9('0xe')][_0xf52cb6[_0x78d9('0x4c')]]=_0x329d0f;}}logger[_0x78d9('0x6c')](_0x78d9('0xb2'),_0xf52cb6[_0x78d9('0x4c')],_0x329d0f['name'],_0x329d0f[_0x78d9('0x55')],_[_0x78d9('0xa7')](_0xf52cb6[_0x78d9('0xa8')])[0x0],_0xf52cb6['value']);_0x329d0f[_0x78d9('0x13')]=this[_0x78d9('0x13')][_0xf52cb6[_0x78d9('0x4c')]];}}}}catch(_0x15c943){logger[_0x78d9('0x41')]('[%s][voiceQueueReport][varset]',_0xf52cb6[_0x78d9('0x4c')],util[_0x78d9('0x40')](_0x15c943,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x78d9('0x9')][_0x78d9('0xb3')]=function(_0x20d81a,_0x3ae8b7,_0x1cb775){var _0x4dfeec=[_0x78d9('0xb4'),_0x78d9('0xb5'),'rtpaudioqosjitter',_0x78d9('0xb6'),_0x78d9('0xb7'),_0x78d9('0xb8'),_0x78d9('0xb9'),_0x78d9('0xba'),_0x78d9('0xbb'),_0x78d9('0xbc'),_0x78d9('0xbd'),_0x78d9('0xbe'),_0x78d9('0xbf'),_0x78d9('0xc0'),_0x78d9('0xc1'),_0x78d9('0xc2'),_0x78d9('0x95'),_0x78d9('0xc3'),_0x78d9('0xc4')];if(!_[_0x78d9('0x37')](_0x3ae8b7)&&!_['includes'](_0x4dfeec,_0x3ae8b7)){if(_[_0x78d9('0x79')](this[_0x78d9('0x13')][_0x20d81a])){this['variables'][_0x20d81a]={};}this['variables'][_0x20d81a][_0x3ae8b7]=_0x1cb775;}};VoiceQueueReport['prototype'][_0x78d9('0x25')]=function(_0xb4ee3f){try{if(this[_0x78d9('0x65')](_0xb4ee3f)){logger[_0x78d9('0x4a')](_0x78d9('0xc5'),_0xb4ee3f[_0x78d9('0x4c')],util['inspect'](_0xb4ee3f,{'showHidden':![],'depth':null}));if(this[_0x78d9('0xd')][_0xb4ee3f[_0x78d9('0x4c')]]){for(var _0x46e300=0x0,_0x2f0905={};_0x46e3000x0?_0xfcb446:0x0;this[_0x2bf8('0x11')][_0x11f767['queue']][_0x2bf8('0x30')]=this[_0x2bf8('0x11')][_0x11f767[_0x2bf8('0x67')]][_0x2bf8('0x30')]>_['toNumber'](_0x11f767[_0x2bf8('0x6b')])?_[_0x2bf8('0x6a')](_0x11f767['loggedin']):this[_0x2bf8('0x11')][_0x11f767[_0x2bf8('0x67')]][_0x2bf8('0x30')];this[_0x2bf8('0x50')](this[_0x2bf8('0x11')][_0x11f767[_0x2bf8('0x67')]],'queuesummary');}logger[_0x2bf8('0x46')](_0x2bf8('0x6d'),util[_0x2bf8('0x3e')](this[_0x2bf8('0x11')][_0x11f767[_0x2bf8('0x67')]],{'showHidden':![],'depth':null}));ami[_0x2bf8('0x45')](_0x2bf8('0x6e'),this[_0x2bf8('0x11')][_0x11f767['queue']]);}}}catch(_0x102ffc){logger[_0x2bf8('0x3c')]('[voiceQueueReport][queuesummary]',util[_0x2bf8('0x3e')](_0x102ffc,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2bf8('0x9')]['syncQueueSummaryComplete']=function(_0x2f2484){logger['debug'](_0x2bf8('0x6f'),util['inspect'](_0x2f2484,{'showHidden':![],'depth':null}));this[_0x2bf8('0x12')]=!![];};VoiceQueueReport[_0x2bf8('0x9')]['syncQueueCallerJoin']=function(_0x4034e9){try{if(this[_0x2bf8('0x61')](_0x4034e9)){logger[_0x2bf8('0x46')](_0x2bf8('0x70'),_0x4034e9[_0x2bf8('0x4d')],util[_0x2bf8('0x3e')](_0x4034e9,{'showHidden':![],'depth':null}));if(_[_0x2bf8('0x62')](this[_0x2bf8('0xd')][_0x4034e9[_0x2bf8('0x4d')]]))this['queueReports'][_0x4034e9[_0x2bf8('0x4d')]]=[];if(_[_0x2bf8('0x62')](this[_0x2bf8('0xf')][_0x4034e9[_0x2bf8('0x4d')]]))this[_0x2bf8('0xf')][_0x4034e9['uniqueid']]={};var _0x118e87=new QueueReport();_0x118e87[_0x2bf8('0x4a')]=_0x4034e9['queue'];_0x118e87[_0x2bf8('0x51')]=this[_0x2bf8('0x11')][_0x118e87[_0x2bf8('0x4a')]]&&this[_0x2bf8('0x11')][_0x118e87[_0x2bf8('0x4a')]]['type']?this[_0x2bf8('0x11')][_0x118e87[_0x2bf8('0x4a')]][_0x2bf8('0x51')]||_0x2bf8('0x52'):_0x2bf8('0x52');_0x118e87[_0x2bf8('0x67')]=_0x4034e9[_0x2bf8('0x67')];_0x118e87['queuecallerjoinAt']=moment()[_0x2bf8('0x48')]('YYYY-MM-DD\x20HH:mm:ss');_0x118e87[_0x2bf8('0x71')]=_0x4034e9[_0x2bf8('0x71')];_0x118e87['count']=_0x4034e9[_0x2bf8('0x72')];_0x118e87[_0x2bf8('0x4d')]=_0x4034e9[_0x2bf8('0x4d')];_0x118e87[_0x2bf8('0x73')]=this[_0x2bf8('0xf')][_0x4034e9[_0x2bf8('0x4d')]][_0x2bf8('0x73')];logger[_0x2bf8('0x68')](_0x2bf8('0x74'),_0x118e87['name'],_0x118e87[_0x2bf8('0x51')]);_[_0x2bf8('0x75')](_0x118e87,_[_0x2bf8('0x76')](_0x4034e9,_[_0x2bf8('0x77')](_0x118e87)));this[_0x2bf8('0xd')][_0x4034e9[_0x2bf8('0x4d')]]['push'](_0x118e87);this[_0x2bf8('0xf')][_0x4034e9[_0x2bf8('0x4d')]]=_0x118e87;this[_0x2bf8('0x78')](_0x118e87,_0x2bf8('0x18'));}}catch(_0x3a1e15){logger['error'](_0x2bf8('0x70'),_0x4034e9['uniqueid'],util[_0x2bf8('0x3e')](_0x3a1e15,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2bf8('0x9')][_0x2bf8('0x1a')]=function(_0x427799){try{if(this['isNotNull'](_0x427799)){logger[_0x2bf8('0x46')](_0x2bf8('0x79'),_0x427799['uniqueid'],util[_0x2bf8('0x3e')](_0x427799,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x427799['uniqueid']]){var _0x578f1c=_[_0x2bf8('0x7a')](this[_0x2bf8('0xd')][_0x427799[_0x2bf8('0x4d')]]);_0x578f1c[_0x2bf8('0x7b')]=![];_0x578f1c['queuecallercompleteAt']=null;_0x578f1c[_0x2bf8('0x7c')]=_0x427799[_0x2bf8('0x7c')];_0x578f1c[_0x2bf8('0x7d')]=_0x427799[_0x2bf8('0x7d')];_0x578f1c[_0x2bf8('0x7e')]=!![];_0x578f1c['queuecallerabandonAt']=moment()[_0x2bf8('0x48')]('YYYY-MM-DD\x20HH:mm:ss');_0x578f1c[_0x2bf8('0x7f')]=_0x2bf8('0x80');_0x578f1c['lastAssignedTo']=null;logger[_0x2bf8('0x68')](_0x2bf8('0x81'),_0x578f1c[_0x2bf8('0x4a')],_0x578f1c['type']);this[_0x2bf8('0xf')][_0x427799[_0x2bf8('0x4d')]]=_0x578f1c;this[_0x2bf8('0x44')](_0x578f1c,_0x2bf8('0x7e'));}}}catch(_0x26cae1){logger[_0x2bf8('0x3c')](_0x2bf8('0x79'),_0x427799[_0x2bf8('0x4d')],util[_0x2bf8('0x3e')](_0x26cae1,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2bf8('0x9')][_0x2bf8('0x82')]=function(_0x117e6d){try{if(this[_0x2bf8('0x61')](_0x117e6d)){logger['debug'](_0x2bf8('0x83'),_0x117e6d[_0x2bf8('0x4d')],util['inspect'](_0x117e6d,{'showHidden':![],'depth':null}));if(this[_0x2bf8('0xd')][_0x117e6d[_0x2bf8('0x4d')]]){var _0x1263df=_[_0x2bf8('0x7a')](this[_0x2bf8('0xd')][_0x117e6d[_0x2bf8('0x4d')]]);_0x1263df[_0x2bf8('0x84')]=moment()[_0x2bf8('0x48')](_0x2bf8('0x85'));_0x1263df[_0x2bf8('0x86')]=_0x117e6d[_0x2bf8('0x86')];_0x1263df[_0x2bf8('0x87')]=_0x117e6d[_0x2bf8('0x87')];logger[_0x2bf8('0x68')](_0x2bf8('0x88'),_0x1263df[_0x2bf8('0x4a')],_0x1263df[_0x2bf8('0x51')],_0x117e6d['connectedlinenum'],_0x117e6d[_0x2bf8('0x87')]);this[_0x2bf8('0xf')][_0x117e6d['uniqueid']]=_0x1263df;this['emitVoiceQueueChannelSave'](_0x1263df,_0x2bf8('0x1b'));}}}catch(_0x342128){logger[_0x2bf8('0x3c')](_0x2bf8('0x83'),_0x117e6d[_0x2bf8('0x4d')],util[_0x2bf8('0x3e')](_0x342128,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x2bf8('0x1e')]=function(_0x4b7e5c){try{if(this['isNotNull'](_0x4b7e5c)){logger[_0x2bf8('0x46')](_0x2bf8('0x89'),_0x4b7e5c[_0x2bf8('0x4d')],util[_0x2bf8('0x3e')](_0x4b7e5c,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x4b7e5c[_0x2bf8('0x4d')]]){var _0x220048=_[_0x2bf8('0x7a')](this['queueReports'][_0x4b7e5c[_0x2bf8('0x4d')]]);_0x220048[_0x2bf8('0x7b')]=!![];_0x220048[_0x2bf8('0x7f')]='COMPLETEDBYAGENT';logger[_0x2bf8('0x68')](_0x2bf8('0x8a'),_0x220048['name'],_0x220048['type']);}}}catch(_0x1c44d8){logger[_0x2bf8('0x3c')](_0x2bf8('0x89'),_0x4b7e5c[_0x2bf8('0x4d')],util[_0x2bf8('0x3e')](_0x1c44d8,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2bf8('0x9')]['syncAgentComplete']=function(_0x2b7af0){try{if(this[_0x2bf8('0x61')](_0x2b7af0)){logger['debug']('[%s][voiceQueueReport][agentcomplete]',_0x2b7af0[_0x2bf8('0x4d')],util[_0x2bf8('0x3e')](_0x2b7af0,{'showHidden':![],'depth':null}));if(this[_0x2bf8('0xd')][_0x2b7af0[_0x2bf8('0x4d')]]){var _0x351256=_[_0x2bf8('0x7a')](this[_0x2bf8('0xd')][_0x2b7af0[_0x2bf8('0x4d')]]);_0x351256[_0x2bf8('0x7e')]=![];_0x351256['queuecallerabandonAt']=null;_0x351256[_0x2bf8('0x8b')]=!![];_0x351256[_0x2bf8('0x8c')]=_0x2b7af0[_0x2bf8('0x8d')];_0x351256[_0x2bf8('0x7c')]=_0x2b7af0[_0x2bf8('0x7c')];_0x351256[_0x2bf8('0x7b')]=!![];_0x351256[_0x2bf8('0x8e')]=![];_0x351256[_0x2bf8('0x8f')]=null;if(!_0x351256[_0x2bf8('0x90')]){if(_0x2b7af0[_0x2bf8('0x91')]==_0x2bf8('0x90')){_0x351256['queuecallerexitreason']='COMPLETED';logger['info'](_0x2bf8('0x92'),_0x351256[_0x2bf8('0x4a')],_0x351256[_0x2bf8('0x51')]);}else{if(_[_0x2bf8('0x93')](_0x2b7af0[_0x2bf8('0x39')]['toLowerCase'](),_0x2bf8('0x94'))){if(this[_0x2bf8('0xd')][_0x2b7af0['linkedid']]){var _0x5903dd=_[_0x2bf8('0x7a')](this[_0x2bf8('0xd')][_0x2b7af0[_0x2bf8('0x95')]]);_0x5903dd[_0x2bf8('0x7b')]=![];_0x5903dd[_0x2bf8('0x8e')]=!![];_0x5903dd[_0x2bf8('0x8f')]=moment(_0x351256[_0x2bf8('0x96')])[_0x2bf8('0x97')](_0x2b7af0['holdtime'],'seconds')[_0x2bf8('0x48')]('YYYY-MM-DD\x20HH:mm:ss');_0x5903dd[_0x2bf8('0x7f')]='FORWARDTRANSFER';_0x5903dd['transfer']=!![];_0x5903dd[_0x2bf8('0x98')]=_0x2bf8('0x99');_0x5903dd[_0x2bf8('0x9a')]=_0x2b7af0[_0x2bf8('0x9b')];_0x5903dd[_0x2bf8('0x9c')]=_0x2b7af0[_0x2bf8('0x4d')];logger[_0x2bf8('0x68')](_0x2bf8('0x9d'),_0x5903dd['name'],_0x5903dd[_0x2bf8('0x51')]);var _0x2d1430=this[_0x2bf8('0xd')][_0x2b7af0[_0x2bf8('0x95')]];this[_0x2bf8('0xd')][_0x2b7af0[_0x2bf8('0x95')]]=this[_0x2bf8('0xd')][_0x2b7af0[_0x2bf8('0x4d')]];this[_0x2bf8('0xd')][_0x2b7af0[_0x2bf8('0x4d')]]=_0x2d1430;}}else{_0x351256['queuecallerexitreason']=_0x2bf8('0x9e')+_0x2b7af0[_0x2bf8('0x91')]['toUpperCase']();logger[_0x2bf8('0x68')](_0x2bf8('0x9f'),_0x351256['name'],_0x351256[_0x2bf8('0x51')],_0x351256[_0x2bf8('0x7f')]);}}}this[_0x2bf8('0xf')][_0x2b7af0[_0x2bf8('0x4d')]]=_0x351256;this[_0x2bf8('0x44')](_0x351256,'agentcomplete');}}}catch(_0x5d003e){logger[_0x2bf8('0x3c')]('[%s][voiceQueueReport][agentcomplete]',_0x2b7af0[_0x2bf8('0x4d')],util[_0x2bf8('0x3e')](_0x5d003e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2bf8('0x9')][_0x2bf8('0x20')]=function(_0x2ac673){try{if(this['isNotNull'](_0x2ac673)){logger[_0x2bf8('0x46')](_0x2bf8('0xa0'),_0x2ac673[_0x2bf8('0x4d')],util[_0x2bf8('0x3e')](_0x2ac673,{'showHidden':![],'depth':null}));this[_0x2bf8('0xa1')](_0x2ac673['uniqueid'],_[_0x2bf8('0x77')](_0x2ac673['variable'])[0x0],_0x2ac673[_0x2bf8('0xa2')]);if(this['queueReports'][_0x2ac673[_0x2bf8('0x4d')]]){var _0xf5fdfa=_['last'](this[_0x2bf8('0xd')][_0x2ac673['uniqueid']]);if(_0xf5fdfa){if(this[_0x2bf8('0x61')](_0x2ac673[_0x2bf8('0xa3')])&&this[_0x2bf8('0x61')](_0x2ac673[_0x2bf8('0xa3')][_0x2bf8('0xa4')])){switch(_0x2ac673['value']){case'CONTINUE':_0xf5fdfa[_0x2bf8('0x8e')]=![];_0xf5fdfa[_0x2bf8('0x8f')]=null;break;case'TIMEOUT':_0xf5fdfa[_0x2bf8('0xa5')]=_0x2bf8('0xa6');_0xf5fdfa[_0x2bf8('0x8e')]=!![];_0xf5fdfa[_0x2bf8('0x8f')]=moment()[_0x2bf8('0x48')](_0x2bf8('0x85'));_0xf5fdfa['queuecallerleaveAt']=moment()[_0x2bf8('0x48')](_0x2bf8('0x85'));logger[_0x2bf8('0x46')]('[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:',_0x2ac673[_0x2bf8('0x4d')],util[_0x2bf8('0x3e')](_0xf5fdfa,{'showHidden':![],'depth':null}));ami[_0x2bf8('0x45')](_0x2bf8('0xa7'),_0xf5fdfa);break;default:_0xf5fdfa[_0x2bf8('0x8e')]=!![];_0xf5fdfa[_0x2bf8('0x8f')]=moment()[_0x2bf8('0x48')](_0x2bf8('0x85'));_0xf5fdfa[_0x2bf8('0x84')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0xf5fdfa[_0x2bf8('0x7e')]=![];_0xf5fdfa[_0x2bf8('0xa8')]=null;_0xf5fdfa['queuecallerexitreason']=_0x2ac673[_0x2bf8('0xa2')];this[_0x2bf8('0xf')][_0x2ac673[_0x2bf8('0x4d')]]=_0xf5fdfa;this[_0x2bf8('0x44')](_0xf5fdfa,'varset');}else if(this[_0x2bf8('0x61')](_0x2ac673[_0x2bf8('0xa3')])&&this[_0x2bf8('0x61')](_0x2ac673['variable'][_0x2bf8('0xa9')])){if(!_0xf5fdfa[_0x2bf8('0x7e')]){_0xf5fdfa[_0x2bf8('0x8e')]=!![];_0xf5fdfa[_0x2bf8('0x8f')]=moment()[_0x2bf8('0x48')](_0x2bf8('0x85'));_0xf5fdfa['queuecallerexitreason']=_0x2bf8('0xaa');_0xf5fdfa['queuecallerleaveAt']=moment()['format'](_0x2bf8('0x85'));this['channels'][_0x2ac673[_0x2bf8('0x4d')]]=_0xf5fdfa;}}logger[_0x2bf8('0x68')](_0x2bf8('0xab'),_0x2ac673['uniqueid'],_0xf5fdfa[_0x2bf8('0x4a')],_0xf5fdfa[_0x2bf8('0x51')],_['keys'](_0x2ac673[_0x2bf8('0xa3')])[0x0],_0x2ac673[_0x2bf8('0xa2')]);_0xf5fdfa[_0x2bf8('0x40')]=this['variables'][_0x2ac673[_0x2bf8('0x4d')]];}}}}catch(_0x4ad2b9){logger[_0x2bf8('0x3c')]('[%s][voiceQueueReport][varset]',_0x2ac673['uniqueid'],util[_0x2bf8('0x3e')](_0x4ad2b9,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2bf8('0x9')]['addVariable']=function(_0x5cd920,_0xc36cae,_0x23d8a7){var _0x4dd424=['rtpaudioqos',_0x2bf8('0xac'),_0x2bf8('0xad'),_0x2bf8('0xae'),_0x2bf8('0xaf'),_0x2bf8('0xb0'),'rtpaudioqosrtt',_0x2bf8('0xb1'),'sipcallid',_0x2bf8('0xb2'),_0x2bf8('0xb3'),'bridgepvtcallid',_0x2bf8('0xb4'),'memberdynamic',_0x2bf8('0xb5'),_0x2bf8('0xb6'),_0x2bf8('0x8d'),_0x2bf8('0xb7'),_0x2bf8('0xb8')];if(!_[_0x2bf8('0x36')](_0xc36cae)&&!_['includes'](_0x4dd424,_0xc36cae)){if(_[_0x2bf8('0x62')](this['variables'][_0x5cd920])){this[_0x2bf8('0x40')][_0x5cd920]={};}this[_0x2bf8('0x40')][_0x5cd920][_0xc36cae]=_0x23d8a7;}};VoiceQueueReport[_0x2bf8('0x9')][_0x2bf8('0x21')]=function(_0x390c33){try{if(this[_0x2bf8('0x61')](_0x390c33)){logger[_0x2bf8('0x46')]('[%s][voiceQueueReport][hangup]',_0x390c33[_0x2bf8('0x4d')],util[_0x2bf8('0x3e')](_0x390c33,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x390c33[_0x2bf8('0x4d')]]){for(var _0x5ab625=0x0,_0x1dd323={};_0x5ab625=0x0?moment(_0x1e1dc8['endtime'])[_0xec43('0x18')](_0x1e1dc8[_0xec43('0x16')],_0xec43('0xe')):null,'data1':_0xec43('0x19'),'data2':_0x1e1dc8[_0xec43('0x1a')],'data3':_0x1e1dc8[_0xec43('0x10')],'data4':_0x1e1dc8['dialstring']||null,'role':_0xec43('0x12'),'internal':_0x1e1dc8[_0xec43('0x1a')]?_['toNumber'](_0x1e1dc8['accountcode']):undefined,'uniqueid':_0x1e1dc8[_0xec43('0x14')]},'log':_0xec43('0x7')});}; \ No newline at end of file +var _0x2e38=['lastAssignedTo','isNil','interface','format','SIP/%s','TALKING','queuecallerleaveAt','diff','seconds','inbound','exten','queue','accountcode','toNumber','uniqueid','CreateMemberReport','voiceDialReport','Request','voice','membername','starttime','endtime','outbound','dialstring','agent','lodash','../client','voiceQueueReport','queuecallercompleteAt','queuecallerexitAt'];(function(_0x13b744,_0x3beea3){var _0x39f909=function(_0x298cdc){while(--_0x298cdc){_0x13b744['push'](_0x13b744['shift']());}};_0x39f909(++_0x3beea3);}(_0x2e38,0x19f));var _0x82e3=function(_0x37c585,_0xf210ac){_0x37c585=_0x37c585-0x0;var _0x13cba5=_0x2e38[_0x37c585];return _0x13cba5;};'use strict';var moment=require('moment');var _=require(_0x82e3('0x0'));var util=require('util');var client=require(_0x82e3('0x1'));exports[_0x82e3('0x2')]=function(_0x74d6d1){var _0x77e773=_0x74d6d1[_0x82e3('0x3')]||_0x74d6d1[_0x82e3('0x4')];return client['Request']('CreateMemberReport',{'body':{'channel':'voice','membername':_0x74d6d1[_0x82e3('0x5')],'interface':_[_0x82e3('0x6')](_0x74d6d1[_0x82e3('0x7')])?util[_0x82e3('0x8')](_0x82e3('0x9'),_0x74d6d1['lastAssignedTo']):_0x74d6d1[_0x82e3('0x7')],'type':_0x82e3('0xa'),'enterAt':_0x74d6d1[_0x82e3('0xb')],'exitAt':_0x77e773,'duration':moment(_0x77e773)[_0x82e3('0xc')](_0x74d6d1[_0x82e3('0xb')],_0x82e3('0xd')),'data1':_0x82e3('0xe'),'data2':_0x74d6d1['calleridnum'],'data3':_0x74d6d1[_0x82e3('0xf')],'data4':null,'data5':_0x74d6d1[_0x82e3('0x10')],'role':'agent','internal':_0x74d6d1[_0x82e3('0x11')]?_[_0x82e3('0x12')](_0x74d6d1['accountcode']):undefined,'uniqueid':_0x74d6d1[_0x82e3('0x13')]},'log':_0x82e3('0x14')});};exports[_0x82e3('0x15')]=function(_0x1b3642){return client[_0x82e3('0x16')](_0x82e3('0x14'),{'body':{'channel':_0x82e3('0x17'),'membername':_0x1b3642[_0x82e3('0x18')],'interface':_0x1b3642[_0x82e3('0x7')],'type':_0x82e3('0xa'),'enterAt':_0x1b3642[_0x82e3('0x19')],'exitAt':_0x1b3642[_0x82e3('0x1a')],'duration':moment(_0x1b3642[_0x82e3('0x1a')])[_0x82e3('0xc')](_0x1b3642[_0x82e3('0x19')],_0x82e3('0xd'))>=0x0?moment(_0x1b3642[_0x82e3('0x1a')])['diff'](_0x1b3642[_0x82e3('0x19')],_0x82e3('0xd')):null,'data1':_0x82e3('0x1b'),'data2':_0x1b3642[_0x82e3('0x11')],'data3':_0x1b3642[_0x82e3('0xf')],'data4':_0x1b3642[_0x82e3('0x1c')]||null,'role':_0x82e3('0x1d'),'internal':_0x1b3642['accountcode']?_[_0x82e3('0x12')](_0x1b3642[_0x82e3('0x11')]):undefined,'uniqueid':_0x1b3642['uniqueid']},'log':_0x82e3('0x14')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index d74ebc9..6c5a171 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 _0xf7c3=['../client','getSettings','Request','ShowSetting','GetSettings'];(function(_0x3bd76b,_0x1af0bd){var _0x24473d=function(_0x1fa3c4){while(--_0x1fa3c4){_0x3bd76b['push'](_0x3bd76b['shift']());}};_0x24473d(++_0x1af0bd);}(_0xf7c3,0x154));var _0x3f7c=function(_0x3e6a0c,_0x5e3743){_0x3e6a0c=_0x3e6a0c-0x0;var _0x306142=_0xf7c3[_0x3e6a0c];return _0x306142;};'use strict';var client=require(_0x3f7c('0x0'));exports[_0x3f7c('0x1')]=function(){return client[_0x3f7c('0x2')](_0x3f7c('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['stopRecordingOnTransfer']},'log':_0x3f7c('0x4')});}; \ No newline at end of file +var _0xca5a=['stopRecordingOnTransfer','GetSettings','getSettings','ShowSetting'];(function(_0x4eaa4c,_0x2f7422){var _0x15aec6=function(_0x23efc9){while(--_0x23efc9){_0x4eaa4c['push'](_0x4eaa4c['shift']());}};_0x15aec6(++_0x2f7422);}(_0xca5a,0x82));var _0xaca5=function(_0x400e6d,_0x240555){_0x400e6d=_0x400e6d-0x0;var _0x1d3517=_0xca5a[_0x400e6d];return _0x1d3517;};'use strict';var client=require('../client');exports[_0xaca5('0x0')]=function(){return client['Request'](_0xaca5('0x1'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xaca5('0x2')]},'log':_0xaca5('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index 5f7bd78..deb30d8 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 _0x4dee=['../client','getTemplates','Request','GetTemplate','html'];(function(_0x48a80d,_0x1b2aaf){var _0x267bcb=function(_0x5e7234){while(--_0x5e7234){_0x48a80d['push'](_0x48a80d['shift']());}};_0x267bcb(++_0x1b2aaf);}(_0x4dee,0x172));var _0xe4de=function(_0xadc71e,_0x14dec4){_0xadc71e=_0xadc71e-0x0;var _0x30cf04=_0x4dee[_0xadc71e];return _0x30cf04;};'use strict';var client=require(_0xe4de('0x0'));exports[_0xe4de('0x1')]=function(_0x3f3c74){return function(_0x1c55fa){return client[_0xe4de('0x2')](_0xe4de('0x3'),{'options':{'raw':!![],'attributes':['id','name',_0xe4de('0x4')]},'log':_0xe4de('0x3')});};}; \ No newline at end of file +var _0xddb5=['getTemplates','GetTemplate','name'];(function(_0x4fd75e,_0x219e4a){var _0x5b6338=function(_0xf2969c){while(--_0xf2969c){_0x4fd75e['push'](_0x4fd75e['shift']());}};_0x5b6338(++_0x219e4a);}(_0xddb5,0x120));var _0x5ddb=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xddb5[_0x14add3];return _0x4a174f;};'use strict';var client=require('../client');exports[_0x5ddb('0x0')]=function(_0x146963){return function(_0xe58d5){return client['Request'](_0x5ddb('0x1'),{'options':{'raw':!![],'attributes':['id',_0x5ddb('0x2'),'html']},'log':_0x5ddb('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index 93aa441..6143105 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 _0x5598=['data7','../client','getTriggers','Request','GetTrigger','channel','status','Condition','AllConditions','field','operator','AnyConditions','value','action','data1','data2','data3','data4','data5','data6'];(function(_0x176317,_0x4897b3){var _0xef2759=function(_0x581e2b){while(--_0x581e2b){_0x176317['push'](_0x176317['shift']());}};_0xef2759(++_0x4897b3);}(_0x5598,0x169));var _0x8559=function(_0x1559a3,_0x1e4f51){_0x1559a3=_0x1559a3-0x0;var _0x3a4b87=_0x5598[_0x1559a3];return _0x3a4b87;};'use strict';var client=require(_0x8559('0x0'));exports[_0x8559('0x1')]=function(_0x4fb4d5){return function(_0x5d8afd){return client[_0x8559('0x2')](_0x8559('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x8559('0x4'),_0x8559('0x5')],'include':[{'model':_0x8559('0x6'),'as':_0x8559('0x7'),'attributes':['id',_0x8559('0x8'),_0x8559('0x9'),'value']},{'model':'Condition','as':_0x8559('0xa'),'attributes':['id',_0x8559('0x8'),_0x8559('0x9'),_0x8559('0xb')]},{'model':'Action','as':'Actions','attributes':['id',_0x8559('0xc'),_0x8559('0xd'),_0x8559('0xe'),_0x8559('0xf'),_0x8559('0x10'),_0x8559('0x11'),_0x8559('0x12'),_0x8559('0x13')]}]},'log':_0x8559('0x3')});};}; \ No newline at end of file +var _0x8838=['data2','data3','data5','data6','data7','getTriggers','Request','GetTrigger','name','channel','status','Condition','field','operator','value','Action','Actions','action','data1'];(function(_0x4fbbaf,_0x2fc638){var _0x8796c5=function(_0x238003){while(--_0x238003){_0x4fbbaf['push'](_0x4fbbaf['shift']());}};_0x8796c5(++_0x2fc638);}(_0x8838,0x148));var _0x8883=function(_0x3e4b8d,_0x3a4e42){_0x3e4b8d=_0x3e4b8d-0x0;var _0x41d9e0=_0x8838[_0x3e4b8d];return _0x41d9e0;};'use strict';var client=require('../client');exports[_0x8883('0x0')]=function(_0x2be000){return function(_0x21b5c8){return client[_0x8883('0x1')](_0x8883('0x2'),{'options':{'raw':![],'attributes':['id',_0x8883('0x3'),_0x8883('0x4'),_0x8883('0x5')],'include':[{'model':_0x8883('0x6'),'as':'AllConditions','attributes':['id',_0x8883('0x7'),_0x8883('0x8'),_0x8883('0x9')]},{'model':_0x8883('0x6'),'as':'AnyConditions','attributes':['id',_0x8883('0x7'),_0x8883('0x8'),_0x8883('0x9')]},{'model':_0x8883('0xa'),'as':_0x8883('0xb'),'attributes':['id',_0x8883('0xc'),_0x8883('0xd'),_0x8883('0xe'),_0x8883('0xf'),'data4',_0x8883('0x10'),_0x8883('0x11'),_0x8883('0x12')]}]},'log':'GetTrigger'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index 7e69fe6..d3a7d88 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 _0xf4e6=['defaultuser','Request','GetTrunk','registry'];(function(_0x2aebf8,_0x4b07f5){var _0x304826=function(_0x57479f){while(--_0x57479f){_0x2aebf8['push'](_0x2aebf8['shift']());}};_0x304826(++_0x4b07f5);}(_0xf4e6,0x1e1));var _0x6f4e=function(_0x593564,_0x43583f){_0x593564=_0x593564-0x0;var _0x211a89=_0xf4e6[_0x593564];return _0x211a89;};'use strict';var client=require('../client');exports['getTrunks']=function(_0x5b5b9b){return function(_0x3a840e){return client[_0x6f4e('0x0')](_0x6f4e('0x1'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id','name',_0x6f4e('0x2'),_0x6f4e('0x3')]},'log':_0x6f4e('0x1')});};}; \ No newline at end of file +var _0x858e=['defaultuser','../client','Request','GetTrunk','registry'];(function(_0x563939,_0x35c59e){var _0xf0f55f=function(_0x4378d5){while(--_0x4378d5){_0x563939['push'](_0x563939['shift']());}};_0xf0f55f(++_0x35c59e);}(_0x858e,0x178));var _0xe858=function(_0x49ff3f,_0x531e8f){_0x49ff3f=_0x49ff3f-0x0;var _0x4f9703=_0x858e[_0x49ff3f];return _0x4f9703;};'use strict';var client=require(_0xe858('0x0'));exports['getTrunks']=function(_0x4fae34){return function(_0x20f8c7){return client[_0xe858('0x1')](_0xe858('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id','name',_0xe858('0x3'),_0xe858('0x4')]},'log':_0xe858('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index 661319c..1ed58fc 100644 --- a/server/services/ami/rpc/user.js +++ b/server/services/ami/rpc/user.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xedd9=['mobile','getTelephones','internal','PauseUser','savePause','saveUnpause','UnpauseUser','ShowUser','interface','getAgent','getAgents','Request','GetUser','agent','name','email','accountcode','fullname','lastLoginAt','pauseType','lastPauseAt','voicePause'];(function(_0x338f34,_0x48feb5){var _0xad0c12=function(_0x520459){while(--_0x520459){_0x338f34['push'](_0x338f34['shift']());}};_0xad0c12(++_0x48feb5);}(_0xedd9,0xfc));var _0x9edd=function(_0x2ef0a1,_0x54b424){_0x2ef0a1=_0x2ef0a1-0x0;var _0x44a1e1=_0xedd9[_0x2ef0a1];return _0x44a1e1;};'use strict';var client=require('../client');exports[_0x9edd('0x0')]=function(){return function(){return client[_0x9edd('0x1')](_0x9edd('0x2'),{'options':{'raw':![],'where':{'role':_0x9edd('0x3')},'attributes':['id',_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6'),_0x9edd('0x7'),'online',_0x9edd('0x8'),_0x9edd('0x9'),_0x9edd('0xa'),_0x9edd('0xb'),'phone',_0x9edd('0xc'),'interface']},'log':_0x9edd('0x0')});};};exports[_0x9edd('0xd')]=function(){return function(){return client[_0x9edd('0x1')](_0x9edd('0x2'),{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id',_0x9edd('0x4'),'accountcode',_0x9edd('0xe')]},'log':_0x9edd('0xd')});};};exports['savePause']=function(_0xbf9da6,_0x13dc4f,_0x5b6c00){return client[_0x9edd('0x1')](_0x9edd('0xf'),{'body':{'type':_0x13dc4f,'uniqueid':_0x5b6c00},'options':{'where':{'id':_0xbf9da6['id']}},'log':_0x9edd('0x10')});};exports[_0x9edd('0x11')]=function(_0x287ddd){return client[_0x9edd('0x1')](_0x9edd('0x12'),{'body':{},'options':{'where':{'id':_0x287ddd['id']}},'log':_0x9edd('0x10')});};exports['getAgent']=function(_0x176bfa){return client[_0x9edd('0x1')](_0x9edd('0x13'),{'options':{'raw':![],'where':{'role':_0x9edd('0x3'),'id':_0x176bfa},'attributes':['id',_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6'),_0x9edd('0x7'),'online',_0x9edd('0x8'),_0x9edd('0x9'),_0x9edd('0xa'),'voicePause',_0x9edd('0x14')]},'log':_0x9edd('0x15')});}; \ No newline at end of file +var _0x70e0=['getAgents','Request','name','email','accountcode','fullname','lastLoginAt','lastPauseAt','interface','getTelephones','GetUser','telephone','savePause','PauseUser','saveUnpause','getAgent','agent','online','pauseType','../client'];(function(_0x5820b7,_0x5d5a4c){var _0x58d2d8=function(_0x583372){while(--_0x583372){_0x5820b7['push'](_0x5820b7['shift']());}};_0x58d2d8(++_0x5d5a4c);}(_0x70e0,0x17b));var _0x070e=function(_0x93cddc,_0x19d44a){_0x93cddc=_0x93cddc-0x0;var _0x3dad23=_0x70e0[_0x93cddc];return _0x3dad23;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(){return function(){return client[_0x070e('0x2')]('GetUser',{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id',_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5'),_0x070e('0x6'),'online',_0x070e('0x7'),'pauseType',_0x070e('0x8'),'voicePause','phone','mobile',_0x070e('0x9')]},'log':_0x070e('0x1')});};};exports[_0x070e('0xa')]=function(){return function(){return client[_0x070e('0x2')](_0x070e('0xb'),{'options':{'raw':!![],'where':{'role':_0x070e('0xc')},'attributes':['id',_0x070e('0x3'),'accountcode','internal']},'log':_0x070e('0xa')});};};exports[_0x070e('0xd')]=function(_0x12bb37,_0xb8d819,_0xa927a2){return client[_0x070e('0x2')](_0x070e('0xe'),{'body':{'type':_0xb8d819,'uniqueid':_0xa927a2},'options':{'where':{'id':_0x12bb37['id']}},'log':_0x070e('0xd')});};exports[_0x070e('0xf')]=function(_0x5bf079){return client[_0x070e('0x2')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0x5bf079['id']}},'log':'savePause'});};exports[_0x070e('0x10')]=function(_0x56c7ba){return client['Request']('ShowUser',{'options':{'raw':![],'where':{'role':_0x070e('0x11'),'id':_0x56c7ba},'attributes':['id',_0x070e('0x3'),'email','accountcode',_0x070e('0x6'),_0x070e('0x12'),_0x070e('0x7'),_0x070e('0x13'),'lastPauseAt','voicePause',_0x070e('0x9')]},'log':_0x070e('0x10')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index 00a7afa..c61fe2c 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 _0x6ebd=['Request','CreateVoiceAgentReport','UpdateVoiceAgentReport','../client','create'];(function(_0x5d5bcb,_0x25e2ea){var _0x4ea5eb=function(_0x36782b){while(--_0x36782b){_0x5d5bcb['push'](_0x5d5bcb['shift']());}};_0x4ea5eb(++_0x25e2ea);}(_0x6ebd,0x94));var _0xd6eb=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x6ebd[_0x2b4411];return _0x8e41ef;};'use strict';var client=require(_0xd6eb('0x0'));exports[_0xd6eb('0x1')]=function(_0x5c3179){return client[_0xd6eb('0x2')]('CreateVoiceAgentReport',{'body':_0x5c3179,'log':_0xd6eb('0x3')});};exports['update']=function(_0x654643,_0x1b4c3f,_0x107d86){return client[_0xd6eb('0x2')]('UpdateVoiceAgentReport',{'body':_0x654643,'options':{'where':{'uniqueid':_0x1b4c3f,'interface':_0x107d86,'agentcomplete':!![]}},'log':_0xd6eb('0x4')});}; \ No newline at end of file +var _0xa15e=['create','CreateVoiceAgentReport','Request','UpdateVoiceAgentReport'];(function(_0x5ccab3,_0x5c7df5){var _0x8a5eb3=function(_0x13156f){while(--_0x13156f){_0x5ccab3['push'](_0x5ccab3['shift']());}};_0x8a5eb3(++_0x5c7df5);}(_0xa15e,0x140));var _0xea15=function(_0x38e1de,_0xea0531){_0x38e1de=_0x38e1de-0x0;var _0x3372ae=_0xa15e[_0x38e1de];return _0x3372ae;};'use strict';var client=require('../client');exports[_0xea15('0x0')]=function(_0x25e400){return client['Request'](_0xea15('0x1'),{'body':_0x25e400,'log':'CreateVoiceAgentReport'});};exports['update']=function(_0x2773e3,_0x395e20,_0xb78a78){return client[_0xea15('0x2')]('UpdateVoiceAgentReport',{'body':_0x2773e3,'options':{'where':{'uniqueid':_0x395e20,'interface':_0xb78a78,'agentcomplete':!![]}},'log':_0xea15('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index e7f5511..ad947d1 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 _0x4e31=['outbound','day','endOf','format','YYYY-MM-DD\x20HH:mm:ss','type','disposition','duration','billableseconds','GetVoiceCallReports','lodash','../client','create','Request','CreateVoiceCallReport','merge','calleridnum','context','callerid','getVoiceCallReports'];(function(_0x5c3781,_0x5824bd){var _0x2d3963=function(_0x423e72){while(--_0x423e72){_0x5c3781['push'](_0x5c3781['shift']());}};_0x2d3963(++_0x5824bd);}(_0x4e31,0x10e));var _0x14e3=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x4e31[_0x14add3];return _0x4a174f;};'use strict';var moment=require('moment');var util=require('util');var _=require(_0x14e3('0x0'));var client=require(_0x14e3('0x1'));exports[_0x14e3('0x2')]=function(_0x52ebc5){return client[_0x14e3('0x3')](_0x14e3('0x4'),{'body':_[_0x14e3('0x5')](_0x52ebc5,{'source':_0x52ebc5[_0x14e3('0x6')],'destinationcontext':_0x52ebc5[_0x14e3('0x7')],'callerid':_0x52ebc5[_0x14e3('0x8')],'amaflags':'DOCUMENTATION'}),'log':_0x14e3('0x4')});};exports[_0x14e3('0x9')]=function(){return function(){return client['Request']('GetVoiceCallReport',{'options':{'where':{'type':[_0x14e3('0xa')],'createdAt':{'$between':[moment()['startOf'](_0x14e3('0xb'))['format']('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0x14e3('0xc')](_0x14e3('0xb'))[_0x14e3('0xd')](_0x14e3('0xe'))]}},'attributes':[_0x14e3('0xf'),_0x14e3('0x10'),_0x14e3('0x11'),_0x14e3('0x12')]},'log':_0x14e3('0x13')});};}; \ No newline at end of file +var _0x6e4f=['day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','type','disposition','duration','GetVoiceCallReports','moment','lodash','../client','create','Request','CreateVoiceCallReport','merge','calleridnum','context','callerid','DOCUMENTATION','getVoiceCallReports','GetVoiceCallReport','startOf'];(function(_0x667d6,_0x2b1924){var _0x4882ac=function(_0x47a6ad){while(--_0x47a6ad){_0x667d6['push'](_0x667d6['shift']());}};_0x4882ac(++_0x2b1924);}(_0x6e4f,0x1ec));var _0xf6e4=function(_0x6b4a02,_0x1e23b0){_0x6b4a02=_0x6b4a02-0x0;var _0x51cf3e=_0x6e4f[_0x6b4a02];return _0x51cf3e;};'use strict';var moment=require(_0xf6e4('0x0'));var util=require('util');var _=require(_0xf6e4('0x1'));var client=require(_0xf6e4('0x2'));exports[_0xf6e4('0x3')]=function(_0x538b40){return client[_0xf6e4('0x4')](_0xf6e4('0x5'),{'body':_[_0xf6e4('0x6')](_0x538b40,{'source':_0x538b40[_0xf6e4('0x7')],'destinationcontext':_0x538b40[_0xf6e4('0x8')],'callerid':_0x538b40[_0xf6e4('0x9')],'amaflags':_0xf6e4('0xa')}),'log':_0xf6e4('0x5')});};exports[_0xf6e4('0xb')]=function(){return function(){return client[_0xf6e4('0x4')](_0xf6e4('0xc'),{'options':{'where':{'type':['outbound'],'createdAt':{'$between':[moment()[_0xf6e4('0xd')](_0xf6e4('0xe'))[_0xf6e4('0xf')](_0xf6e4('0x10')),moment()[_0xf6e4('0x11')](_0xf6e4('0xe'))['format'](_0xf6e4('0x10'))]}},'attributes':[_0xf6e4('0x12'),_0xf6e4('0x13'),_0xf6e4('0x14'),'billableseconds']},'log':_0xf6e4('0x15')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index d01e8ca..0fcc2e5 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 _0xaf6b=['Request','CreateVoiceDialReport'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0xaf6b,0x18e));var _0xbaf6=function(_0x2942eb,_0xfe049b){_0x2942eb=_0x2942eb-0x0;var _0x411cb3=_0xaf6b[_0x2942eb];return _0x411cb3;};'use strict';var client=require('../client');exports['create']=function(_0x297da4){return client[_0xbaf6('0x0')](_0xbaf6('0x1'),{'body':_0x297da4,'log':_0xbaf6('0x1')});}; \ No newline at end of file +var _0x787d=['Request','CreateVoiceDialReport','../client'];(function(_0x1f0794,_0x1e5fc4){var _0x243a0b=function(_0x3a8475){while(--_0x3a8475){_0x1f0794['push'](_0x1f0794['shift']());}};_0x243a0b(++_0x1e5fc4);}(_0x787d,0x125));var _0xd787=function(_0x29d2d2,_0x3344){_0x29d2d2=_0x29d2d2-0x0;var _0x3f6476=_0x787d[_0x29d2d2];return _0x3f6476;};'use strict';var client=require(_0xd787('0x0'));exports['create']=function(_0x461510){return client[_0xd787('0x1')](_0xd787('0x2'),{'body':_0x461510,'log':_0xd787('0x2')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index e8adb6d..a6b6cf6 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 _0x6ea9=['GetVoiceExtension','exten','../client','getVoiceExtensions','Request'];(function(_0x5c08cb,_0x456960){var _0x147907=function(_0x1da1be){while(--_0x1da1be){_0x5c08cb['push'](_0x5c08cb['shift']());}};_0x147907(++_0x456960);}(_0x6ea9,0x89));var _0x96ea=function(_0xce2aef,_0x1fd045){_0xce2aef=_0xce2aef-0x0;var _0x4f7781=_0x6ea9[_0xce2aef];return _0x4f7781;};'use strict';var client=require(_0x96ea('0x0'));exports[_0x96ea('0x1')]=function(){return function(){return client[_0x96ea('0x2')](_0x96ea('0x3'),{'options':{'raw':!![],'attributes':['id',_0x96ea('0x4'),'recordingFormat'],'where':{'VoiceExtensionId':null}},'log':_0x96ea('0x1')});};}; \ No newline at end of file +var _0x2e21=['Request','exten','../client','getVoiceExtensions'];(function(_0x49fda7,_0x1d84db){var _0x4c6f1f=function(_0x4c94f2){while(--_0x4c94f2){_0x49fda7['push'](_0x49fda7['shift']());}};_0x4c6f1f(++_0x1d84db);}(_0x2e21,0xba));var _0x12e2=function(_0x4d61b0,_0x31cf29){_0x4d61b0=_0x4d61b0-0x0;var _0x56a492=_0x2e21[_0x4d61b0];return _0x56a492;};'use strict';var client=require(_0x12e2('0x0'));exports[_0x12e2('0x1')]=function(){return function(){return client[_0x12e2('0x2')]('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id',_0x12e2('0x3'),'recordingFormat'],'where':{'VoiceExtensionId':null}},'log':_0x12e2('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index 14b4e63..b1341fe 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 _0xb7d7=['monitor_format','type','dialActive','dialMethod','dialLimitChannel','dialPowerLevel','dialPredictiveOptimization','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialTimezone','dialGlobalInterval','dialPrefix','dialAMDActive','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','dialCutDigit','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','Trunk','callerid','active','Pause','mandatoryDispositionPause','TrunkBackup','Interval','interval','../client','getVoiceQueues','Request','GetVoiceQueue','name','acw','acwTimeout','autopause'];(function(_0x31ced5,_0x5d5415){var _0x10d9e5=function(_0x2e51a5){while(--_0x2e51a5){_0x31ced5['push'](_0x31ced5['shift']());}};_0x10d9e5(++_0x5d5415);}(_0xb7d7,0xac));var _0x7b7d=function(_0x4ff5c7,_0x37473e){_0x4ff5c7=_0x4ff5c7-0x0;var _0x4db090=_0xb7d7[_0x4ff5c7];return _0x4db090;};'use strict';var client=require(_0x7b7d('0x0'));exports[_0x7b7d('0x1')]=function(){return function(){return client[_0x7b7d('0x2')](_0x7b7d('0x3'),{'options':{'raw':![],'attributes':['id',_0x7b7d('0x4'),_0x7b7d('0x5'),_0x7b7d('0x6'),_0x7b7d('0x7'),_0x7b7d('0x8'),_0x7b7d('0x9'),_0x7b7d('0xa'),_0x7b7d('0xb'),_0x7b7d('0xc'),'dialLimitQueue',_0x7b7d('0xd'),_0x7b7d('0xe'),'dialPredictiveOptimizationPercentage','dialPredictiveInterval',_0x7b7d('0xf'),_0x7b7d('0x10'),_0x7b7d('0x11'),_0x7b7d('0x12'),_0x7b7d('0x13'),_0x7b7d('0x14'),_0x7b7d('0x15'),'dialCongestionRetryFrequency',_0x7b7d('0x16'),_0x7b7d('0x17'),_0x7b7d('0x18'),_0x7b7d('0x19'),'dialGlobalMaxRetry',_0x7b7d('0x1a'),_0x7b7d('0x1b'),_0x7b7d('0x1c'),'dialCheckDuplicateType',_0x7b7d('0x1d'),'dialAMDInitialSilence',_0x7b7d('0x1e'),_0x7b7d('0x1f'),'dialAMDTotalAnalysisTime',_0x7b7d('0x20'),'dialAMDBetweenWordsSilence',_0x7b7d('0x21'),_0x7b7d('0x22'),'dialAMDMaximumWordLength','timeout',_0x7b7d('0x23'),_0x7b7d('0x24'),_0x7b7d('0x25'),_0x7b7d('0x26'),_0x7b7d('0x27'),_0x7b7d('0x28'),'monitor_format','strategy','dialRandomLastDigitCallerIdNumber',_0x7b7d('0x29'),'dialNoSuchNumberMaxRetry',_0x7b7d('0x2a'),_0x7b7d('0x2b'),_0x7b7d('0x2c'),_0x7b7d('0x2d'),'dialAbandonedRetryFrequency','dialMachineMaxRetry',_0x7b7d('0x2e'),_0x7b7d('0x2f'),_0x7b7d('0x30'),_0x7b7d('0x31'),_0x7b7d('0x32'),_0x7b7d('0x33')],'include':[{'model':_0x7b7d('0x34'),'as':_0x7b7d('0x34'),'attributes':['id','name',_0x7b7d('0x35'),_0x7b7d('0x36')]},{'model':_0x7b7d('0x37'),'as':_0x7b7d('0x38'),'attributes':['id','name']},{'model':'Trunk','as':_0x7b7d('0x39'),'attributes':['id','name',_0x7b7d('0x35'),'active']},{'model':'Interval','as':'Interval','attributes':['id',_0x7b7d('0x4')],'include':[{'model':_0x7b7d('0x3a'),'as':'Intervals','attributes':['id',_0x7b7d('0x4'),_0x7b7d('0x3b')]}]}]},'log':_0x7b7d('0x1')});};}; \ No newline at end of file +var _0x5fce=['mandatoryDispositionPause','TrunkBackup','callerid','Interval','Intervals','interval','../client','getVoiceQueues','Request','GetVoiceQueue','name','acw','acwTimeout','autopause','type','dialActive','dialMethod','dialLimitQueue','dialPredictiveOptimization','dialPredictiveInterval','dialOriginateCallerIdName','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialGlobalInterval','dialPrefix','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumWordLength','timeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupClient','dialQueueProject2','monitor_format','strategy','dialNoSuchNumberMaxRetry','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','Trunk','active'];(function(_0x7dbd65,_0x18da49){var _0x33d551=function(_0x7ce789){while(--_0x7ce789){_0x7dbd65['push'](_0x7dbd65['shift']());}};_0x33d551(++_0x18da49);}(_0x5fce,0x1ce));var _0xe5fc=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x5fce[_0x3947c9];return _0x2e7871;};'use strict';var client=require(_0xe5fc('0x0'));exports[_0xe5fc('0x1')]=function(){return function(){return client[_0xe5fc('0x2')](_0xe5fc('0x3'),{'options':{'raw':![],'attributes':['id',_0xe5fc('0x4'),_0xe5fc('0x5'),_0xe5fc('0x6'),_0xe5fc('0x7'),'monitor_format',_0xe5fc('0x8'),_0xe5fc('0x9'),_0xe5fc('0xa'),'dialLimitChannel',_0xe5fc('0xb'),'dialPowerLevel',_0xe5fc('0xc'),'dialPredictiveOptimizationPercentage',_0xe5fc('0xd'),_0xe5fc('0xe'),'dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout',_0xe5fc('0xf'),_0xe5fc('0x10'),_0xe5fc('0x11'),'dialBusyMaxRetry','dialBusyRetryFrequency',_0xe5fc('0x12'),_0xe5fc('0x13'),_0xe5fc('0x14'),'dialTimezone',_0xe5fc('0x15'),_0xe5fc('0x16'),'dialCheckDuplicateType',_0xe5fc('0x17'),_0xe5fc('0x18'),_0xe5fc('0x19'),_0xe5fc('0x1a'),_0xe5fc('0x1b'),_0xe5fc('0x1c'),_0xe5fc('0x1d'),'dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold',_0xe5fc('0x1e'),_0xe5fc('0x1f'),'dialRecallMeTimeout',_0xe5fc('0x20'),_0xe5fc('0x21'),'dialAgiAfterHangupAgent',_0xe5fc('0x22'),_0xe5fc('0x23'),_0xe5fc('0x24'),_0xe5fc('0x25'),'dialRandomLastDigitCallerIdNumber','dialCutDigit',_0xe5fc('0x26'),'dialNoSuchNumberRetryFrequency',_0xe5fc('0x27'),_0xe5fc('0x28'),_0xe5fc('0x29'),_0xe5fc('0x2a'),_0xe5fc('0x2b'),_0xe5fc('0x2c'),'dialAgentRejectMaxRetry',_0xe5fc('0x2d'),_0xe5fc('0x2e'),_0xe5fc('0x2f'),_0xe5fc('0x30')],'include':[{'model':'Trunk','as':_0xe5fc('0x31'),'attributes':['id',_0xe5fc('0x4'),'callerid',_0xe5fc('0x32')]},{'model':'Pause','as':_0xe5fc('0x33'),'attributes':['id',_0xe5fc('0x4')]},{'model':_0xe5fc('0x31'),'as':_0xe5fc('0x34'),'attributes':['id',_0xe5fc('0x4'),_0xe5fc('0x35'),_0xe5fc('0x32')]},{'model':'Interval','as':_0xe5fc('0x36'),'attributes':['id','name'],'include':[{'model':_0xe5fc('0x36'),'as':_0xe5fc('0x37'),'attributes':['id','name',_0xe5fc('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 ce676e8..798d4af 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(_0x513b11,_0x2e3b0e){var _0x429c70=function(_0x1fe340){while(--_0x1fe340){_0x513b11['push'](_0x513b11['shift']());}};_0x429c70(++_0x2e3b0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0xa9e0[_0x4c7fb5];return _0x2e10ac;};'use strict';var moment=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var client=require(_0x0a9e('0x2'));exports['create']=function(_0x550fbc){return client[_0x0a9e('0x3')]('CreateVoiceQueueReport',{'body':_0x550fbc,'log':_0x0a9e('0x4')});};exports[_0x0a9e('0x5')]=function(){return function(){return client[_0x0a9e('0x3')](_0x0a9e('0x6'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x0a9e('0x7')]('day')[_0x0a9e('0x8')](_0x0a9e('0x9')),moment()[_0x0a9e('0xa')]('day')['format'](_0x0a9e('0x9'))]}},'attributes':['uniqueid','queue',_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe'),_0x0a9e('0xf'),_0x0a9e('0x10'),'queuecallerabandon','queuecallerabandonAt']},'log':'GetVoiceQueueReports'});};}; \ No newline at end of file +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(_0x1a62aa,_0x27f866){var _0x913e84=function(_0x47d5c5){while(--_0x47d5c5){_0x1a62aa['push'](_0x1a62aa['shift']());}};_0x913e84(++_0x27f866);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xa9e0[_0xbb091];return _0x467a04;};'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 b1beb03..ea87319 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 _0xef5a=['GetVoiceQueueRtPauses','../client','getVoiceQueueRtPauses','Request'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xef5a,0x1a1));var _0xaef5=function(_0x41d851,_0x22fdd1){_0x41d851=_0x41d851-0x0;var _0x5c11d5=_0xef5a[_0x41d851];return _0x5c11d5;};'use strict';var client=require(_0xaef5('0x0'));exports[_0xaef5('0x1')]=function(_0x35b675){return function(){return client[_0xaef5('0x2')](_0xaef5('0x3'),{'options':{'where':{'VoiceQueueId':_0x35b675,'paused':!![]},'raw':!![]},'log':_0xaef5('0x1')});};}; \ No newline at end of file +var _0x7fed=['getVoiceQueueRtPauses','GetVoiceQueueRtPauses','../client'];(function(_0x61953a,_0x385ac6){var _0x4004b2=function(_0x10f073){while(--_0x10f073){_0x61953a['push'](_0x61953a['shift']());}};_0x4004b2(++_0x385ac6);}(_0x7fed,0x71));var _0xd7fe=function(_0x5a29b5,_0x3e106a){_0x5a29b5=_0x5a29b5-0x0;var _0x38babe=_0x7fed[_0x5a29b5];return _0x38babe;};'use strict';var client=require(_0xd7fe('0x0'));exports[_0xd7fe('0x1')]=function(_0x5f4754){return function(){return client['Request'](_0xd7fe('0x2'),{'options':{'where':{'VoiceQueueId':_0x5f4754,'paused':!![]},'raw':!![]},'log':_0xd7fe('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index 391cdbe..15fbf64 100644 --- a/server/services/ami/rpc/voiceRecording.js +++ b/server/services/ami/rpc/voiceRecording.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0x20e645,_0x3188fc){var _0x37a281=function(_0x124856){while(--_0x124856){_0x20e645['push'](_0x20e645['shift']());}};_0x37a281(++_0x3188fc);}(_0x7a54,0x106));var _0x47a5=function(_0x540c31,_0x578d44){_0x540c31=_0x540c31-0x0;var _0x3b1bf7=_0x7a54[_0x540c31];return _0x3b1bf7;};'use strict';var _=require(_0x47a5('0x0'));var client=require(_0x47a5('0x1'));exports[_0x47a5('0x2')]=function(_0x58157c){return client[_0x47a5('0x3')](_0x47a5('0x4'),{'body':_['merge'](_0x58157c,{'value':_0x58157c[_0x47a5('0x5')]}),'log':_0x47a5('0x4')});}; \ No newline at end of file +var _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0xed09d9,_0x193b6f){var _0x492860=function(_0x1b01f1){while(--_0x1b01f1){_0xed09d9['push'](_0xed09d9['shift']());}};_0x492860(++_0x193b6f);}(_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 d9fa3ce..ff81029 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 _0xed0e=['result','transfererchannel','transferercalleridname','transfererconnectedlinenum','transferercontext','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeaccountcode','transfereeexten','context','extension','CreateVoiceTransferReport','attendedTransfer','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinename','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetexten','transfertargetlinkedid','isexternal','origtransferercontext','origtransfererexten','attended','transfers','blindTransfer','Request'];(function(_0x2ca9d4,_0x51d5c6){var _0x258956=function(_0x47a0e5){while(--_0x47a0e5){_0x2ca9d4['push'](_0x2ca9d4['shift']());}};_0x258956(++_0x51d5c6);}(_0xed0e,0x1de));var _0xeed0=function(_0x20589d,_0x55d5bf){_0x20589d=_0x20589d-0x0;var _0x422de9=_0xed0e[_0x20589d];return _0x422de9;};'use strict';var client=require('../client');exports[_0xeed0('0x0')]={};exports[_0xeed0('0x1')]=function(_0xba2585){return client[_0xeed0('0x2')]('CreateVoiceTransferReport',{'body':{'result':_0xba2585[_0xeed0('0x3')],'transfererchannel':_0xba2585[_0xeed0('0x4')],'transferercalleridnum':_0xba2585['transferercalleridnum'],'transferercalleridname':_0xba2585[_0xeed0('0x5')],'transfererconnectedlinenum':_0xba2585[_0xeed0('0x6')],'transfererconnectedlinename':_0xba2585['transfererconnectedlinename'],'transfereraccountcode':_0xba2585['transfereraccountcode'],'transferercontext':_0xba2585[_0xeed0('0x7')],'transfererexten':_0xba2585['transfererexten'],'transfererlinkedid':_0xba2585[_0xeed0('0x8')],'transfereechannel':_0xba2585[_0xeed0('0x9')],'transfereecalleridnum':_0xba2585[_0xeed0('0xa')],'transfereecalleridname':_0xba2585[_0xeed0('0xb')],'transfereeconnectedlinenum':_0xba2585[_0xeed0('0xc')],'transfereeconnectedlinename':_0xba2585['transfereeconnectedlinename'],'transfereeaccountcode':_0xba2585[_0xeed0('0xd')],'transfereecontext':_0xba2585['transfereecontext'],'transfereeexten':_0xba2585[_0xeed0('0xe')],'transfereelinkedid':_0xba2585['transfereelinkedid'],'isexternal':_0xba2585['isexternal'],'context':_0xba2585[_0xeed0('0xf')],'extension':_0xba2585[_0xeed0('0x10')],'type':'blind'},'log':_0xeed0('0x11')});};exports[_0xeed0('0x12')]=function(_0x3929af){return client[_0xeed0('0x2')](_0xeed0('0x11'),{'body':{'result':_0x3929af[_0xeed0('0x3')],'transfererchannel':_0x3929af[_0xeed0('0x13')],'transferercalleridnum':_0x3929af[_0xeed0('0x14')],'transferercalleridname':_0x3929af[_0xeed0('0x15')],'transfererconnectedlinenum':_0x3929af['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x3929af[_0xeed0('0x16')],'transfereraccountcode':_0x3929af['origtransfereraccountcode'],'transferercontext':_0x3929af[_0xeed0('0x17')],'transfererexten':_0x3929af[_0xeed0('0x18')],'transfererlinkedid':_0x3929af[_0xeed0('0x19')],'transfereechannel':_0x3929af[_0xeed0('0x1a')],'transfereecalleridnum':_0x3929af['transfertargetcalleridnum'],'transfereecalleridname':_0x3929af[_0xeed0('0x1b')],'transfereeconnectedlinenum':_0x3929af[_0xeed0('0x1c')],'transfereeconnectedlinename':_0x3929af[_0xeed0('0x1d')],'transfereeaccountcode':_0x3929af[_0xeed0('0x1e')],'transfereecontext':_0x3929af['transfertargetcontext'],'transfereeexten':_0x3929af[_0xeed0('0x1f')],'transfereelinkedid':_0x3929af[_0xeed0('0x20')],'isexternal':_0x3929af[_0xeed0('0x21')],'context':_0x3929af[_0xeed0('0x22')],'extension':_0x3929af[_0xeed0('0x23')],'type':_0xeed0('0x24')},'log':_0xeed0('0x11')});}; \ No newline at end of file +var _0xd442=['transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinename','transfereraccountcode','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereelinkedid','extension','attendedTransfer','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','origtransfereraccountcode','secondtransferercontext','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinename','transfertargetlinkedid','isexternal','origtransferercontext','attended','../client','blindTransfer','Request','CreateVoiceTransferReport','result'];(function(_0x53da0e,_0x2c4eb0){var _0x3a6ae7=function(_0xbcafb3){while(--_0xbcafb3){_0x53da0e['push'](_0x53da0e['shift']());}};_0x3a6ae7(++_0x2c4eb0);}(_0xd442,0x163));var _0x2d44=function(_0xa5f8e4,_0x4eacfe){_0xa5f8e4=_0xa5f8e4-0x0;var _0x3ac236=_0xd442[_0xa5f8e4];return _0x3ac236;};'use strict';var client=require(_0x2d44('0x0'));exports['transfers']={};exports[_0x2d44('0x1')]=function(_0x334d0d){return client[_0x2d44('0x2')](_0x2d44('0x3'),{'body':{'result':_0x334d0d[_0x2d44('0x4')],'transfererchannel':_0x334d0d[_0x2d44('0x5')],'transferercalleridnum':_0x334d0d[_0x2d44('0x6')],'transferercalleridname':_0x334d0d[_0x2d44('0x7')],'transfererconnectedlinenum':_0x334d0d['transfererconnectedlinenum'],'transfererconnectedlinename':_0x334d0d[_0x2d44('0x8')],'transfereraccountcode':_0x334d0d[_0x2d44('0x9')],'transferercontext':_0x334d0d['transferercontext'],'transfererexten':_0x334d0d['transfererexten'],'transfererlinkedid':_0x334d0d[_0x2d44('0xa')],'transfereechannel':_0x334d0d[_0x2d44('0xb')],'transfereecalleridnum':_0x334d0d[_0x2d44('0xc')],'transfereecalleridname':_0x334d0d[_0x2d44('0xd')],'transfereeconnectedlinenum':_0x334d0d[_0x2d44('0xe')],'transfereeconnectedlinename':_0x334d0d[_0x2d44('0xf')],'transfereeaccountcode':_0x334d0d[_0x2d44('0x10')],'transfereecontext':_0x334d0d[_0x2d44('0x11')],'transfereeexten':_0x334d0d['transfereeexten'],'transfereelinkedid':_0x334d0d[_0x2d44('0x12')],'isexternal':_0x334d0d['isexternal'],'context':_0x334d0d['context'],'extension':_0x334d0d[_0x2d44('0x13')],'type':'blind'},'log':_0x2d44('0x3')});};exports[_0x2d44('0x14')]=function(_0x44a64c){return client[_0x2d44('0x2')](_0x2d44('0x3'),{'body':{'result':_0x44a64c[_0x2d44('0x4')],'transfererchannel':_0x44a64c[_0x2d44('0x15')],'transferercalleridnum':_0x44a64c[_0x2d44('0x16')],'transferercalleridname':_0x44a64c[_0x2d44('0x17')],'transfererconnectedlinenum':_0x44a64c[_0x2d44('0x18')],'transfererconnectedlinename':_0x44a64c['secondtransfererconnectedlinename'],'transfereraccountcode':_0x44a64c[_0x2d44('0x19')],'transferercontext':_0x44a64c[_0x2d44('0x1a')],'transfererexten':_0x44a64c['secondtransfererexten'],'transfererlinkedid':_0x44a64c[_0x2d44('0x1b')],'transfereechannel':_0x44a64c[_0x2d44('0x1c')],'transfereecalleridnum':_0x44a64c[_0x2d44('0x1d')],'transfereecalleridname':_0x44a64c[_0x2d44('0x1e')],'transfereeconnectedlinenum':_0x44a64c['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x44a64c[_0x2d44('0x1f')],'transfereeaccountcode':_0x44a64c['transfertargetaccountcode'],'transfereecontext':_0x44a64c['transfertargetcontext'],'transfereeexten':_0x44a64c['transfertargetexten'],'transfereelinkedid':_0x44a64c[_0x2d44('0x20')],'isexternal':_0x44a64c[_0x2d44('0x21')],'context':_0x44a64c[_0x2d44('0x22')],'extension':_0x44a64c['origtransfererexten'],'type':_0x2d44('0x23')},'log':'CreateVoiceTransferReport'});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index 7abd323..91354d3 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 _0x6657=['loggedIn','pTalking','sumBillable','sumDuration','talking','unmanaged','abandoned','waiting','loggedInDb','type','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','Interval','push','length','find','omit','undefined','values','channels','map','uniqueid','filename','MixMonitor','channel','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','toLowerCase','isNil','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','status','rec','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','resolve','StopMixMonitor','destinationchannel','%s.%s','StopMixMonitor\x20Success','queueChannels','voicequeuechannel','Hangup','voicequeuechannelredirect','exten','context','trunks','outboundChannels','run','Event\x20name\x20mandatory','emit','custom:','event','faxAccounts','checkAfterSend','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','jayson/promise','validate','bluebird','moment','../properties','../ami','listen','format','%s/%s','SIP','name','timers','timer','updateAcw','agents','updateStatusRealtime','QueuePause','error','asterisk','username','ami\x20disconnected','join','pick','keys','module','action','Reload','Action','then','message','catch','isConnected','command','Command','content','voiceQueues','hasOwnProperty','answered','available'];(function(_0x510d7a,_0x338220){var _0x12adfa=function(_0x5e966c){while(--_0x5e966c){_0x510d7a['push'](_0x510d7a['shift']());}};_0x12adfa(++_0x338220);}(_0x6657,0x17f));var _0x7665=function(_0x399b6e,_0x3ef3fd){_0x399b6e=_0x399b6e-0x0;var _0x145cf3=_0x6657[_0x399b6e];return _0x145cf3;};'use strict';var _=require(_0x7665('0x0'));var util=require('util');var jayson=require(_0x7665('0x1'));var schema=require(_0x7665('0x2'));var BPromise=require(_0x7665('0x3'));var moment=require(_0x7665('0x4'));var config=require('../../../config/environment');var properties=require(_0x7665('0x5'));var ami=require(_0x7665('0x6'));exports[_0x7665('0x7')]=function(_0x1c33b1,_0xcf83a8,_0x28b410){return new BPromise(function(_0x1a6f2f,_0x3387d8){var _0x4c0b5c={'QueuePause':function(_0x31da89){return new Promise(function(_0x464ec1,_0x24e6aa){var _0x37f647=util[_0x7665('0x8')](_0x7665('0x9'),_0x7665('0xa'),_0x31da89[_0x7665('0xb')]);if(_0x1c33b1['timers']&&_0x1c33b1[_0x7665('0xc')][_0x37f647]&&_0x1c33b1[_0x7665('0xc')][_0x37f647][_0x7665('0xd')]){_0x1c33b1['timers'][_0x37f647][_0x7665('0xe')]();}if(_0x1c33b1['agents'][_0x37f647]){_0x1c33b1[_0x7665('0xf')][_0x37f647][_0x7665('0x10')]({'statePause':_0x31da89['pause']?!![]:![]});}_0x464ec1({'code':0xc8,'message':_0x7665('0x11')});});},'Reload':function(_0x2e8dda){var _0x4dd9aa=this;return new Promise(function(_0x3e2717,_0x3ee33){if(ami['isConnected']()==![]){return _0x3ee33(_0x4dd9aa[_0x7665('0x12')](0x1f4,[config[_0x7665('0x13')]['ip'],config[_0x7665('0x13')][_0x7665('0x14')],_0x7665('0x15')][_0x7665('0x16')]('\x20')));}_0x2e8dda=_[_0x7665('0x17')](_0x2e8dda,_[_0x7665('0x18')](properties[_0x7665('0x19')]));_0x2e8dda[_0x7665('0x1a')]=_0x7665('0x1b');return ami[_0x7665('0x1c')](_0x2e8dda)[_0x7665('0x1d')](function(_0x34e7a8){_0x3e2717({'code':0xc8,'message':_0x34e7a8[_0x7665('0x1e')]});})[_0x7665('0x1f')](function(_0x522944){_0x3ee33(_0x4dd9aa[_0x7665('0x12')](0x1f5,_0x522944[_0x7665('0x1e')]));});});},'Command':function(_0x4f1f1d){var _0x32b37a=this;return new Promise(function(_0x2033a5,_0x6dd715){if(ami[_0x7665('0x20')]()==![]){return _0x6dd715(_0x32b37a['error'](0x1f4,[config[_0x7665('0x13')]['ip'],config[_0x7665('0x13')][_0x7665('0x14')],_0x7665('0x15')][_0x7665('0x16')]('\x20')));}_0x4f1f1d=_['pick'](_0x4f1f1d,_0x7665('0x21'));_0x4f1f1d['action']=_0x7665('0x22');return ami[_0x7665('0x1c')](_0x4f1f1d)['then'](function(_0x5652dd){_0x2033a5({'code':0xc8,'message':_0x5652dd[_0x7665('0x23')]});})[_0x7665('0x1f')](function(_0x4a9a25){_0x6dd715(_0x32b37a[_0x7665('0x12')](0x1f5,_0x4a9a25[_0x7665('0x1e')]));});});},'VoiceQueues':function(_0xcc4a89){return new Promise(function(_0x488d86,_0x5b5be6){var _0x566415=[];for(var _0x4dc736 in _0x1c33b1[_0x7665('0x24')]){if(_0x1c33b1[_0x7665('0x24')][_0x7665('0x25')](_0x4dc736)){var _0x5809e9=_0x1c33b1[_0x7665('0x24')][_0x4dc736];var _0x383d06={'id':_0x5809e9['id'],'name':_0x5809e9['name'],'strategy':_0x5809e9['strategy'],'answered':_0x5809e9[_0x7665('0x26')],'available':_0x5809e9[_0x7665('0x27')],'loggedIn':_0x5809e9[_0x7665('0x28')],'pTalking':_0x5809e9[_0x7665('0x29')],'sumBillable':_0x5809e9[_0x7665('0x2a')],'sumDuration':_0x5809e9[_0x7665('0x2b')],'sumHoldTime':_0x5809e9['sumHoldTime']||0x0,'talking':_0x5809e9[_0x7665('0x2c')],'total':_0x5809e9['total'],'type':_0x5809e9['type'],'unmanaged':_0x5809e9[_0x7665('0x2d')],'abandoned':_0x5809e9[_0x7665('0x2e')],'waiting':_0x5809e9[_0x7665('0x2f')],'loggedInDb':_0x5809e9[_0x7665('0x30')]};if(_0x5809e9[_0x7665('0x31')]===_0x7665('0x32')){_0x383d06[_0x7665('0x33')]=_0x5809e9[_0x7665('0x33')];_0x383d06[_0x7665('0x34')]=_0x5809e9[_0x7665('0x34')];_0x383d06[_0x7665('0x35')]=_0x5809e9[_0x7665('0x35')];_0x383d06[_0x7665('0x36')]=_0x5809e9[_0x7665('0x36')];_0x383d06[_0x7665('0x37')]=_0x5809e9[_0x7665('0x37')];_0x383d06[_0x7665('0x38')]=_0x5809e9[_0x7665('0x38')];_0x383d06[_0x7665('0x39')]=_0x5809e9['temp'];_0x383d06[_0x7665('0x3a')]=_0x5809e9[_0x7665('0x3a')];_0x383d06[_0x7665('0x3b')]=_0x5809e9[_0x7665('0x3b')];_0x383d06[_0x7665('0x3c')]=_0x5809e9[_0x7665('0x3c')];_0x383d06['outboundBusyCallsDay']=_0x5809e9[_0x7665('0x3d')];_0x383d06[_0x7665('0x3e')]=_0x5809e9[_0x7665('0x3e')];_0x383d06[_0x7665('0x3f')]=_0x5809e9[_0x7665('0x3f')];_0x383d06['outboundDropCallsDayCallersExit']=_0x5809e9[_0x7665('0x40')];_0x383d06['outboundDropCallsDayTimeout']=_0x5809e9[_0x7665('0x41')];_0x383d06['outboundNoAnswerCallsDay']=_0x5809e9[_0x7665('0x42')];_0x383d06[_0x7665('0x43')]=_0x5809e9[_0x7665('0x43')];_0x383d06[_0x7665('0x44')]=_0x5809e9[_0x7665('0x44')];_0x383d06[_0x7665('0x45')]=_0x5809e9['outboundReCallsDay'];_0x383d06[_0x7665('0x46')]=_0x5809e9[_0x7665('0x46')];_0x383d06[_0x7665('0x47')]=_0x5809e9[_0x7665('0x47')];_0x383d06['predictiveIntervalAnsweredCalls']=_0x5809e9[_0x7665('0x48')];_0x383d06[_0x7665('0x49')]=_0x5809e9[_0x7665('0x49')];_0x383d06[_0x7665('0x4a')]=_0x5809e9[_0x7665('0x4a')];_0x383d06['predictiveIntervalDroppedCallsCallersExit']=_0x5809e9[_0x7665('0x4b')];_0x383d06[_0x7665('0x4c')]=_0x5809e9[_0x7665('0x4c')];_0x383d06[_0x7665('0x4d')]=_0x5809e9[_0x7665('0x4d')];_0x383d06[_0x7665('0x4e')]=_0x5809e9[_0x7665('0x4e')];_0x383d06[_0x7665('0x4f')]=_0x5809e9[_0x7665('0x4f')];_0x383d06[_0x7665('0x50')]=_0x5809e9['predictiveIntervalMultiplicativeFactor'];_0x383d06['predictiveIntervalPauses']=_0x5809e9[_0x7665('0x51')];_0x383d06[_0x7665('0x52')]=_0x5809e9['predictiveIntervalAvailable'];_0x383d06['predictiveIntervalTotalCalls']=_0x5809e9[_0x7665('0x53')];_0x383d06[_0x7665('0x1e')]=_0x5809e9['message'];_0x383d06[_0x7665('0x54')]=_0x5809e9[_0x7665('0x54')];_0x383d06[_0x7665('0x55')]=_0x5809e9[_0x7665('0x55')];_0x383d06[_0x7665('0x56')]=_0x5809e9[_0x7665('0x56')];_0x383d06[_0x7665('0x57')]=_0x5809e9[_0x7665('0x57')];_0x383d06[_0x7665('0x58')]=_0x5809e9[_0x7665('0x58')];_0x383d06[_0x7665('0x59')]=_0x5809e9[_0x7665('0x59')];_0x383d06[_0x7665('0x5a')]=_0x5809e9[_0x7665('0x5a')];}if(_0x5809e9['Trunk']){_0x383d06[_0x7665('0x5b')]={'id':_0x5809e9['Trunk']['id'],'name':_0x5809e9[_0x7665('0x5b')][_0x7665('0xb')],'active':_0x5809e9[_0x7665('0x5b')][_0x7665('0x5c')],'callerid':_0x5809e9[_0x7665('0x5b')]['callerid']};}if(_0x5809e9[_0x7665('0x5d')]){_0x383d06[_0x7665('0x5d')]={'id':_0x5809e9['Interval']['id'],'name':_0x5809e9[_0x7665('0x5d')]['name']};}_0x566415[_0x7665('0x5e')](_0x383d06);}}_0x488d86({'count':_0x566415[_0x7665('0x5f')],'rows':_0x566415});});},'UpdateVoiceQueue':function(_0x1a1cd9){return new Promise(function(_0x503679,_0x4bc743){var _0x1c174c=_[_0x7665('0x60')](_0x1c33b1['voiceQueues'],{'id':parseInt(_0x1a1cd9['id'])});var _0x2343de=_[_0x7665('0x61')](_0x1a1cd9,['id']);if(_0x1c174c){for(var _0x2bc404 in _0x2343de){if(typeof _0x2343de[_0x2bc404]!==_0x7665('0x62')&&typeof _0x1c174c[_0x2bc404]!==_0x7665('0x62')){_0x1c174c[_0x2bc404]=_0x2343de[_0x2bc404];}}_0x503679(_0x1c174c);}else{_0x4bc743();}});},'VoiceChannels':function(_0x9bca68){return new Promise(function(_0x41dd53,_0x453904){var _0x2fe046=_[_0x7665('0x63')](_0x1c33b1[_0x7665('0x64')]);_0x41dd53({'count':_0x2fe046['length'],'rows':_0x2fe046});});},'VoiceChannelMixMonitor':function(_0x3762b6){var _0x5a21ee=this;return new Promise(function(_0x3d1ed0,_0x1cf4e2){if(ami[_0x7665('0x20')]()==![]){return _0x1cf4e2(_0x5a21ee[_0x7665('0x12')](0x1f4,[config['asterisk']['ip'],config[_0x7665('0x13')][_0x7665('0x14')],_0x7665('0x15')][_0x7665('0x16')]('\x20')));}var _0x69912d=schema(properties['voicechannel'])[_0x7665('0x2')](_0x3762b6);if(_0x69912d['length']>0x0){return _0x1cf4e2(_0x5a21ee[_0x7665('0x12')](0x1f4,_[_0x7665('0x65')](_0x69912d,'message')['join'](',\x20')));}var _0x9d5c0b=_[_0x7665('0x60')](_0x1c33b1[_0x7665('0x64')],{'uniqueid':_0x3762b6[_0x7665('0x66')]});if(_0x9d5c0b&&_0x9d5c0b['channel']){var _0x4d2d7a=util[_0x7665('0x8')]('%s.%s',_0x3762b6[_0x7665('0x67')]||_0x3762b6[_0x7665('0x66')],_0x3762b6[_0x7665('0x8')]||'wav');return ami[_0x7665('0x1c')]({'action':_0x7665('0x68'),'channel':_0x9d5c0b[_0x7665('0x69')],'file':_0x4d2d7a,'options':_0x7665('0x6a')})[_0x7665('0x1d')](function(_0x1d6814){var _0x13d10b=_[_0x7665('0x60')](_0x9d5c0b[_0x7665('0x6b')],{'filename':_0x7665('0x6c')+_0x4d2d7a[_0x7665('0x6d')]()});if(_[_0x7665('0x6e')](_0x13d10b)){_0x9d5c0b[_0x7665('0x6b')][_0x7665('0x5e')]({'filename':'/var/spool/asterisk/monitor/'+_0x4d2d7a['toLowerCase'](),'createdAt':moment()[_0x7665('0x8')](_0x7665('0x6f')),'mixmonitorid':_0x1d6814['mixmonitorid'],'status':'rec'});}else{_0x13d10b['mixmonitorid']=_0x1d6814[_0x7665('0x70')];_0x13d10b[_0x7665('0x71')]=_0x7665('0x72');}_0x3d1ed0({'code':0xc8,'message':[_0x3762b6[_0x7665('0x66')],_0x7665('0x73'),_0x1d6814[_0x7665('0x70')]][_0x7665('0x16')]('\x20'),'mixmonitorid':_0x1d6814[_0x7665('0x70')]});})[_0x7665('0x1f')](function(_0x242386){_0x1cf4e2(_0x5a21ee['error'](0x1f5,[_0x3762b6['uniqueid'],_0x242386[_0x7665('0x1e')][_0x7665('0x6d')]()][_0x7665('0x16')]('\x20')));});}else{return _0x1cf4e2(_0x5a21ee['error'](0x1f5,_0x7665('0x74')));}});},'VoiceChannelStopMixMonitor':function(_0x56ee91){var _0x17bbbe=this;return new Promise(function(_0xed47d0,_0x3d056c){if(ami[_0x7665('0x20')]()==![]){return _0x3d056c(_0x17bbbe[_0x7665('0x12')](0x1f4,[config[_0x7665('0x13')]['ip'],config[_0x7665('0x13')][_0x7665('0x14')],_0x7665('0x15')][_0x7665('0x16')]('\x20')));}var _0x3c6515=schema(properties['voicechannel'])[_0x7665('0x2')](_0x56ee91);if(_0x3c6515[_0x7665('0x5f')]>0x0){return _0x3d056c(_0x17bbbe[_0x7665('0x12')](0x1f4,_[_0x7665('0x65')](_0x3c6515,_0x7665('0x1e'))[_0x7665('0x16')](',\x20')));}var _0x42932e=_[_0x7665('0x60')](_0x1c33b1['channels'],{'uniqueid':_0x56ee91['uniqueid']});if(_0x42932e){return BPromise[_0x7665('0x75')]()[_0x7665('0x1d')](function(){if(_0x42932e[_0x7665('0x69')]){return ami[_0x7665('0x1c')]({'action':_0x7665('0x76'),'channel':_0x42932e[_0x7665('0x69')],'mixmonitorid':_0x56ee91['mixmonitorid']})[_0x7665('0x1f')](function(_0x38743a){});}})[_0x7665('0x1d')](function(){if(_0x42932e[_0x7665('0x77')]){return ami[_0x7665('0x1c')]({'action':_0x7665('0x76'),'channel':_0x42932e['destinationchannel'],'mixmonitorid':_0x56ee91[_0x7665('0x70')]})[_0x7665('0x1f')](function(_0x21151d){});}})[_0x7665('0x1d')](function(_0x54fc74){var _0x3b2b96=_[_0x7665('0x60')](_0x42932e[_0x7665('0x6b')],{'mixmonitorid':_0x56ee91[_0x7665('0x70')]});if(_0x3b2b96){_0x3b2b96[_0x7665('0x71')]='stop';}})[_0x7665('0x1d')](function(){var _0x44a17a=util['format'](_0x7665('0x78'),_0x56ee91['filename']||_0x56ee91[_0x7665('0x66')],_0x56ee91[_0x7665('0x8')]||'wav');var _0x2af15f=_['find'](_0x42932e['monitors'],{'filename':_0x7665('0x6c')+_0x44a17a[_0x7665('0x6d')]()});if(_0x2af15f){_0x2af15f['status']='stop';}})[_0x7665('0x1d')](function(){_0xed47d0({'code':0xc8,'message':[_0x56ee91['uniqueid'],_0x7665('0x79')][_0x7665('0x16')]('\x20')});})['catch'](function(_0x49562b){_0x3d056c(_0x17bbbe[_0x7665('0x12')](0x1f5,[_0x56ee91[_0x7665('0x66')],_0x49562b[_0x7665('0x1e')][_0x7665('0x6d')]()][_0x7665('0x16')]('\x20')));});}else{return _0x3d056c(_0x17bbbe[_0x7665('0x12')](0x1f5,_0x7665('0x74')));}});},'VoiceQueuesChannels':function(_0x4b86be){return new Promise(function(_0x3d3acd,_0x1f6b54){var _0x269621=_[_0x7665('0x63')](_0x1c33b1[_0x7665('0x7a')]);_0x3d3acd({'count':_0x269621[_0x7665('0x5f')],'rows':_0x269621});});},'VoiceQueuesChannel':function(_0xa89a8b){var _0x4ea88e=this;return new Promise(function(_0x561c2f,_0x2a4d06){var _0x52dd8d=schema(properties[_0x7665('0x7b')])['validate'](_0xa89a8b);if(_0x52dd8d[_0x7665('0x5f')]>0x0){return _0x2a4d06(_0x4ea88e[_0x7665('0x12')](0x1f4,_[_0x7665('0x65')](_0x52dd8d,'message')[_0x7665('0x16')](',\x20')));}var _0xeac63f=_['find'](_0x1c33b1['queueChannels'],{'uniqueid':_0xa89a8b[_0x7665('0x66')]});if(_0xeac63f){_0x561c2f(_0xeac63f);}else{return _0x2a4d06(_0x4ea88e[_0x7665('0x12')](0x1f5,_0x7665('0x74')));}});},'VoiceQueuesChannelHangup':function(_0xe6732){var _0x2d888a=this;return new Promise(function(_0x430dd0,_0xa8e489){if(ami[_0x7665('0x20')]()==![]){return _0xa8e489(_0x2d888a['error'](0x1f4,[config['asterisk']['ip'],config[_0x7665('0x13')][_0x7665('0x14')],'ami\x20disconnected'][_0x7665('0x16')]('\x20')));}var _0x48f351=schema(properties['voicequeuechannelhangup'])[_0x7665('0x2')](_0xe6732);if(_0x48f351[_0x7665('0x5f')]>0x0){return _0xa8e489(_0x2d888a[_0x7665('0x12')](0x1f4,_[_0x7665('0x65')](_0x48f351,_0x7665('0x1e'))['join'](',\x20')));}var _0x59b28c=_['find'](_0x1c33b1[_0x7665('0x7a')],{'uniqueid':_0xe6732['uniqueid']});if(_0x59b28c&&_0x59b28c[_0x7665('0x69')]){return ami['Action']({'action':_0x7665('0x7c'),'channel':_0x59b28c[_0x7665('0x69')]})[_0x7665('0x1d')](function(_0xe149cd){_0x430dd0({'code':0xc8,'message':[_0xe6732['uniqueid'],_0xe149cd['message'][_0x7665('0x6d')]()][_0x7665('0x16')]('\x20')});})[_0x7665('0x1f')](function(_0x2d8f53){_0xa8e489(_0x2d888a[_0x7665('0x12')](0x1f5,[_0xe6732[_0x7665('0x66')],_0x2d8f53[_0x7665('0x1e')][_0x7665('0x6d')]()][_0x7665('0x16')]('\x20')));});}else{return _0xa8e489(_0x2d888a[_0x7665('0x12')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x106908){var _0x18e913=this;return new Promise(function(_0x5d8b95,_0x1b6506){if(ami['isConnected']()==![]){return _0x1b6506(_0x18e913['error'](0x1f4,[config['asterisk']['ip'],config['asterisk']['username'],_0x7665('0x15')][_0x7665('0x16')]('\x20')));}var _0x506c71=schema(properties[_0x7665('0x7d')])[_0x7665('0x2')](_0x106908);if(_0x506c71[_0x7665('0x5f')]>0x0){return _0x1b6506(_0x18e913[_0x7665('0x12')](0x1f4,_['map'](_0x506c71,_0x7665('0x1e'))[_0x7665('0x16')](',\x20')));}var _0x5ce6b1=_[_0x7665('0x60')](_0x1c33b1[_0x7665('0x7a')],{'uniqueid':_0x106908[_0x7665('0x66')]});if(_0x5ce6b1&&_0x5ce6b1['channel']){return ami[_0x7665('0x1c')]({'action':'Redirect','channel':_0x5ce6b1['channel'],'exten':_0x106908[_0x7665('0x7e')],'context':_0x106908[_0x7665('0x7f')]||_0x5ce6b1[_0x7665('0x7f')],'priority':0x1})[_0x7665('0x1d')](function(_0x535e29){_0x5d8b95({'code':0xc8,'message':[_0x106908[_0x7665('0x66')],_0x535e29[_0x7665('0x1e')][_0x7665('0x6d')]()][_0x7665('0x16')]('\x20')});})[_0x7665('0x1f')](function(_0x244e57){_0x1b6506(_0x18e913[_0x7665('0x12')](0x1f5,[_0x106908[_0x7665('0x66')],_0x244e57[_0x7665('0x1e')][_0x7665('0x6d')]()][_0x7665('0x16')]('\x20')));});}else{return _0x1b6506(_0x18e913[_0x7665('0x12')](0x1f5,_0x7665('0x74')));}});},'Agents':function(_0x1ff152){return new Promise(function(_0x5c7eae,_0x2e1868){var _0x1b8830=_[_0x7665('0x63')](_0x1c33b1[_0x7665('0xf')]);_0x5c7eae({'count':_0x1b8830['length'],'rows':_0x1b8830});});},'Telephones':function(_0x36f154){return new Promise(function(_0xdf3ff2,_0x52108b){var _0x3bb518=_[_0x7665('0x63')](_0x1c33b1['telephones']);_0xdf3ff2({'count':_0x3bb518[_0x7665('0x5f')],'rows':_0x3bb518});});},'Trunks':function(_0x117d07){return new Promise(function(_0x1ec913,_0x4b6fc7){var _0xd8a3f6=_[_0x7665('0x63')](_0x1c33b1[_0x7665('0x80')]);_0x1ec913({'count':_0xd8a3f6[_0x7665('0x5f')],'rows':_0xd8a3f6});});},'OutboundChannels':function(_0x52090c){return new Promise(function(_0x2e1a9b,_0xa3e105){var _0x509904=_[_0x7665('0x63')](_0x1c33b1[_0x7665('0x81')]);_0x2e1a9b({'count':_0x509904[_0x7665('0x5f')],'rows':_0x509904});});},'Outbound':function(_0x294e3f){return new Promise(function(_0x3e79c4,_0x5ee9a6){_0x3e79c4(_0x1c33b1[_0x7665('0x32')]);});},'Campaigns':function(_0x2a9601){return new Promise(function(_0x1d82b2,_0x37540f){var _0x53c492=_[_0x7665('0x63')](_0x1c33b1['campaigns']);_0x1d82b2({'count':_0x53c492[_0x7665('0x5f')],'rows':_0x53c492});});},'VoiceQueuesPreview':function(_0x4f3a38){var _0x101e40=this;return new Promise(function(_0xf05cae,_0x231282){_0xcf83a8[_0x7665('0x82')](_0x4f3a38['id'])[_0x7665('0x1d')](function(_0xb074a7){_0xf05cae({'code':0xc8,'message':_0xb074a7[_0x7665('0x1e')]});})[_0x7665('0x1f')](function(_0x1088c8){_0x231282(_0x101e40[_0x7665('0x12')](0x1f4,_0x1088c8[_0x7665('0x1e')]));});});},'EventManager':function(_0x1983bd){var _0x58cb69=this;return new Promise(function(_0x51837a,_0x41bbb4){if(!_0x1983bd['event']){return _0x41bbb4(_0x58cb69['error'](0x1f4,_0x7665('0x83')));}ami[_0x7665('0x84')](_0x7665('0x85')+_0x1983bd[_0x7665('0x86')],_0x1983bd[_0x7665('0x1e')]);_0x51837a({'code':0xc8,'message':_0x1983bd});});},'FaxAccounts':function(_0x1e617f){return new Promise(function(_0x346328,_0x39a6e2){var _0x21af97=_['values'](_0x1c33b1[_0x7665('0x87')]);_0x346328({'count':_0x21af97[_0x7665('0x5f')],'rows':_0x21af97});});},'SendFax':function(_0x3a5993){var _0xd4452b=this;return new Promise(function(_0x4558ea,_0x442d83){_0x28b410['send'](_0x3a5993)[_0x7665('0x1d')](function(_0x1c505e){_0x4558ea({'code':0xc8,'message':_0x1c505e[_0x7665('0x1e')]});})[_0x7665('0x1f')](function(_0x3a4045){_0x442d83(_0xd4452b[_0x7665('0x12')](0x1f4,_0x3a4045['message']));});});},'CheckAfterSend':function(_0xba1a77){var _0x6949dc=this;return new Promise(function(_0x165ddd,_0xa64995){_0x28b410[_0x7665('0x88')](_0xba1a77)[_0x7665('0x1d')](function(_0x4410fe){_0x165ddd({'code':0xc8,'message':_0x4410fe[_0x7665('0x1e')]});})[_0x7665('0x1f')](function(_0x132170){_0xa64995(_0x6949dc[_0x7665('0x12')](0x1f4,_0x132170['message']));});});}};var _0x356786=jayson['server'](_0x4c0b5c)['http']();_0x356786['on'](_0x7665('0x12'),function(_0x1c83cb){return _0x3387d8(_0x1c83cb);});_0x356786[_0x7665('0x7')](0x232a,_0x7665('0x89'),function(){console[_0x7665('0x8a')](_0x7665('0x8b'),0x232a);return _0x1a6f2f(_0x7665('0x8c')+0x232a);});});}; \ No newline at end of file +var _0x6b1b=['join','Command','content','catch','voiceQueues','hasOwnProperty','name','strategy','answered','available','loggedIn','sumBillable','sumHoldTime','talking','total','type','unmanaged','abandoned','waiting','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','Interval','push','length','omit','undefined','values','channels','voicechannel','map','uniqueid','channel','%s.%s','filename','ai(mixmonitorid)','find','monitors','toLowerCase','/var/spool/asterisk/monitor/','mixmonitorid','status','rec','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','resolve','destinationchannel','StopMixMonitor','stop','wav','Hangup','queueChannels','exten','context','telephones','trunks','outboundChannels','campaigns','event','emit','custom:','send','server','http','127.0.0.1','util','jayson/promise','validate','moment','../../../config/environment','../properties','../ami','listen','format','SIP','timer','timers','agents','pause','QueuePause','isConnected','error','asterisk','username','ami\x20disconnected','action','Reload','Action','then','message'];(function(_0x3e2c1e,_0x1e8d40){var _0x1c6666=function(_0x190b73){while(--_0x190b73){_0x3e2c1e['push'](_0x3e2c1e['shift']());}};_0x1c6666(++_0x1e8d40);}(_0x6b1b,0x1e7));var _0xb6b1=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0x6b1b[_0x54d4fe];return _0x1ab5bb;};'use strict';var _=require('lodash');var util=require(_0xb6b1('0x0'));var jayson=require(_0xb6b1('0x1'));var schema=require(_0xb6b1('0x2'));var BPromise=require('bluebird');var moment=require(_0xb6b1('0x3'));var config=require(_0xb6b1('0x4'));var properties=require(_0xb6b1('0x5'));var ami=require(_0xb6b1('0x6'));exports[_0xb6b1('0x7')]=function(_0x345886,_0x41bf3e,_0x113a39){return new BPromise(function(_0x1ff716,_0x13334e){var _0x1a4cd0={'QueuePause':function(_0x5b440a){return new Promise(function(_0x2734cc,_0x52aa76){var _0x4da7d3=util[_0xb6b1('0x8')]('%s/%s',_0xb6b1('0x9'),_0x5b440a['name']);if(_0x345886['timers']&&_0x345886['timers'][_0x4da7d3]&&_0x345886['timers'][_0x4da7d3][_0xb6b1('0xa')]){_0x345886[_0xb6b1('0xb')][_0x4da7d3]['updateAcw']();}if(_0x345886[_0xb6b1('0xc')][_0x4da7d3]){_0x345886['agents'][_0x4da7d3]['updateStatusRealtime']({'statePause':_0x5b440a[_0xb6b1('0xd')]?!![]:![]});}_0x2734cc({'code':0xc8,'message':_0xb6b1('0xe')});});},'Reload':function(_0x12f3ff){var _0x327eee=this;return new Promise(function(_0x23881d,_0x18f6b5){if(ami[_0xb6b1('0xf')]()==![]){return _0x18f6b5(_0x327eee[_0xb6b1('0x10')](0x1f4,[config[_0xb6b1('0x11')]['ip'],config[_0xb6b1('0x11')][_0xb6b1('0x12')],_0xb6b1('0x13')]['join']('\x20')));}_0x12f3ff=_['pick'](_0x12f3ff,_['keys'](properties['module']));_0x12f3ff[_0xb6b1('0x14')]=_0xb6b1('0x15');return ami[_0xb6b1('0x16')](_0x12f3ff)[_0xb6b1('0x17')](function(_0x32e395){_0x23881d({'code':0xc8,'message':_0x32e395[_0xb6b1('0x18')]});})['catch'](function(_0x581e28){_0x18f6b5(_0x327eee[_0xb6b1('0x10')](0x1f5,_0x581e28[_0xb6b1('0x18')]));});});},'Command':function(_0x16d969){var _0x11e8ae=this;return new Promise(function(_0x45d9e6,_0x3fc9b1){if(ami['isConnected']()==![]){return _0x3fc9b1(_0x11e8ae['error'](0x1f4,[config[_0xb6b1('0x11')]['ip'],config[_0xb6b1('0x11')]['username'],'ami\x20disconnected'][_0xb6b1('0x19')]('\x20')));}_0x16d969=_['pick'](_0x16d969,'command');_0x16d969[_0xb6b1('0x14')]=_0xb6b1('0x1a');return ami[_0xb6b1('0x16')](_0x16d969)[_0xb6b1('0x17')](function(_0x164952){_0x45d9e6({'code':0xc8,'message':_0x164952[_0xb6b1('0x1b')]});})[_0xb6b1('0x1c')](function(_0x3b1ff7){_0x3fc9b1(_0x11e8ae[_0xb6b1('0x10')](0x1f5,_0x3b1ff7[_0xb6b1('0x18')]));});});},'VoiceQueues':function(_0x5069cd){return new Promise(function(_0x214cd0,_0x4f1e2e){var _0xd8e094=[];for(var _0x5864d6 in _0x345886[_0xb6b1('0x1d')]){if(_0x345886['voiceQueues'][_0xb6b1('0x1e')](_0x5864d6)){var _0x387603=_0x345886[_0xb6b1('0x1d')][_0x5864d6];var _0x178401={'id':_0x387603['id'],'name':_0x387603[_0xb6b1('0x1f')],'strategy':_0x387603[_0xb6b1('0x20')],'answered':_0x387603[_0xb6b1('0x21')],'available':_0x387603[_0xb6b1('0x22')],'loggedIn':_0x387603[_0xb6b1('0x23')],'pTalking':_0x387603['pTalking'],'sumBillable':_0x387603[_0xb6b1('0x24')],'sumDuration':_0x387603['sumDuration'],'sumHoldTime':_0x387603[_0xb6b1('0x25')]||0x0,'talking':_0x387603[_0xb6b1('0x26')],'total':_0x387603[_0xb6b1('0x27')],'type':_0x387603[_0xb6b1('0x28')],'unmanaged':_0x387603[_0xb6b1('0x29')],'abandoned':_0x387603[_0xb6b1('0x2a')],'waiting':_0x387603[_0xb6b1('0x2b')],'loggedInDb':_0x387603['loggedInDb']};if(_0x387603[_0xb6b1('0x28')]===_0xb6b1('0x2c')){_0x178401[_0xb6b1('0x2d')]=_0x387603['dialActive'];_0x178401[_0xb6b1('0x2e')]=_0x387603[_0xb6b1('0x2e')];_0x178401['dialOriginateCallerIdName']=_0x387603[_0xb6b1('0x2f')];_0x178401[_0xb6b1('0x30')]=_0x387603[_0xb6b1('0x30')];_0x178401[_0xb6b1('0x31')]=_0x387603[_0xb6b1('0x31')];_0x178401[_0xb6b1('0x32')]=_0x387603['dialPrefix'];_0x178401[_0xb6b1('0x33')]=_0x387603[_0xb6b1('0x33')];_0x178401['outboundAnswerAgiCallsDay']=_0x387603[_0xb6b1('0x34')];_0x178401['outboundAnswerCallsDay']=_0x387603[_0xb6b1('0x35')];_0x178401[_0xb6b1('0x36')]=_0x387603[_0xb6b1('0x36')];_0x178401[_0xb6b1('0x37')]=_0x387603[_0xb6b1('0x37')];_0x178401[_0xb6b1('0x38')]=_0x387603['outboundCongestionCallsDay'];_0x178401[_0xb6b1('0x39')]=_0x387603[_0xb6b1('0x39')];_0x178401[_0xb6b1('0x3a')]=_0x387603[_0xb6b1('0x3a')];_0x178401['outboundDropCallsDayTimeout']=_0x387603['outboundDropCallsDayTimeout'];_0x178401['outboundNoAnswerCallsDay']=_0x387603[_0xb6b1('0x3b')];_0x178401[_0xb6b1('0x3c')]=_0x387603[_0xb6b1('0x3c')];_0x178401[_0xb6b1('0x3d')]=_0x387603[_0xb6b1('0x3d')];_0x178401[_0xb6b1('0x3e')]=_0x387603[_0xb6b1('0x3e')];_0x178401[_0xb6b1('0x3f')]=_0x387603[_0xb6b1('0x3f')];_0x178401[_0xb6b1('0x40')]=_0x387603[_0xb6b1('0x40')];_0x178401[_0xb6b1('0x41')]=_0x387603['predictiveIntervalAnsweredCalls'];_0x178401[_0xb6b1('0x42')]=_0x387603[_0xb6b1('0x42')];_0x178401[_0xb6b1('0x43')]=_0x387603[_0xb6b1('0x43')];_0x178401[_0xb6b1('0x44')]=_0x387603[_0xb6b1('0x44')];_0x178401[_0xb6b1('0x45')]=_0x387603[_0xb6b1('0x45')];_0x178401[_0xb6b1('0x46')]=_0x387603[_0xb6b1('0x46')];_0x178401[_0xb6b1('0x47')]=_0x387603['predictiveIntervalErlangCallsDroppedCalls'];_0x178401[_0xb6b1('0x48')]=_0x387603[_0xb6b1('0x48')];_0x178401[_0xb6b1('0x49')]=_0x387603[_0xb6b1('0x49')];_0x178401[_0xb6b1('0x4a')]=_0x387603[_0xb6b1('0x4a')];_0x178401[_0xb6b1('0x4b')]=_0x387603[_0xb6b1('0x4b')];_0x178401['predictiveIntervalTotalCalls']=_0x387603['predictiveIntervalTotalCalls'];_0x178401[_0xb6b1('0x18')]=_0x387603[_0xb6b1('0x18')];_0x178401[_0xb6b1('0x4c')]=_0x387603['originated'];_0x178401[_0xb6b1('0x4d')]=_0x387603[_0xb6b1('0x4d')];_0x178401[_0xb6b1('0x4e')]=_0x387603[_0xb6b1('0x4e')];_0x178401[_0xb6b1('0x4f')]=_0x387603[_0xb6b1('0x4f')];_0x178401[_0xb6b1('0x50')]=_0x387603[_0xb6b1('0x50')];_0x178401['startPredictive']=_0x387603[_0xb6b1('0x51')];_0x178401['startProgressive']=_0x387603[_0xb6b1('0x52')];}if(_0x387603[_0xb6b1('0x53')]){_0x178401[_0xb6b1('0x53')]={'id':_0x387603[_0xb6b1('0x53')]['id'],'name':_0x387603[_0xb6b1('0x53')][_0xb6b1('0x1f')],'active':_0x387603['Trunk'][_0xb6b1('0x54')],'callerid':_0x387603[_0xb6b1('0x53')]['callerid']};}if(_0x387603[_0xb6b1('0x55')]){_0x178401['Interval']={'id':_0x387603[_0xb6b1('0x55')]['id'],'name':_0x387603[_0xb6b1('0x55')][_0xb6b1('0x1f')]};}_0xd8e094[_0xb6b1('0x56')](_0x178401);}}_0x214cd0({'count':_0xd8e094[_0xb6b1('0x57')],'rows':_0xd8e094});});},'UpdateVoiceQueue':function(_0x20489a){return new Promise(function(_0x19cc0f,_0x31a6c7){var _0x1d5b09=_['find'](_0x345886['voiceQueues'],{'id':parseInt(_0x20489a['id'])});var _0x3826bd=_[_0xb6b1('0x58')](_0x20489a,['id']);if(_0x1d5b09){for(var _0x5959ca in _0x3826bd){if(typeof _0x3826bd[_0x5959ca]!==_0xb6b1('0x59')&&typeof _0x1d5b09[_0x5959ca]!==_0xb6b1('0x59')){_0x1d5b09[_0x5959ca]=_0x3826bd[_0x5959ca];}}_0x19cc0f(_0x1d5b09);}else{_0x31a6c7();}});},'VoiceChannels':function(_0x6f7b41){return new Promise(function(_0x1a95cf,_0x7cebdc){var _0x505a80=_[_0xb6b1('0x5a')](_0x345886[_0xb6b1('0x5b')]);_0x1a95cf({'count':_0x505a80[_0xb6b1('0x57')],'rows':_0x505a80});});},'VoiceChannelMixMonitor':function(_0x3f02bc){var _0x4da826=this;return new Promise(function(_0x5bfd0e,_0x20e93b){if(ami['isConnected']()==![]){return _0x20e93b(_0x4da826[_0xb6b1('0x10')](0x1f4,[config[_0xb6b1('0x11')]['ip'],config['asterisk'][_0xb6b1('0x12')],'ami\x20disconnected'][_0xb6b1('0x19')]('\x20')));}var _0x7d4763=schema(properties[_0xb6b1('0x5c')])[_0xb6b1('0x2')](_0x3f02bc);if(_0x7d4763[_0xb6b1('0x57')]>0x0){return _0x20e93b(_0x4da826[_0xb6b1('0x10')](0x1f4,_[_0xb6b1('0x5d')](_0x7d4763,_0xb6b1('0x18'))[_0xb6b1('0x19')](',\x20')));}var _0x2700ed=_['find'](_0x345886[_0xb6b1('0x5b')],{'uniqueid':_0x3f02bc[_0xb6b1('0x5e')]});if(_0x2700ed&&_0x2700ed[_0xb6b1('0x5f')]){var _0x39c0d9=util[_0xb6b1('0x8')](_0xb6b1('0x60'),_0x3f02bc[_0xb6b1('0x61')]||_0x3f02bc[_0xb6b1('0x5e')],_0x3f02bc[_0xb6b1('0x8')]||'wav');return ami[_0xb6b1('0x16')]({'action':'MixMonitor','channel':_0x2700ed['channel'],'file':_0x39c0d9,'options':_0xb6b1('0x62')})[_0xb6b1('0x17')](function(_0x5be7bf){var _0x3b482b=_[_0xb6b1('0x63')](_0x2700ed[_0xb6b1('0x64')],{'filename':'/var/spool/asterisk/monitor/'+_0x39c0d9[_0xb6b1('0x65')]()});if(_['isNil'](_0x3b482b)){_0x2700ed['monitors'][_0xb6b1('0x56')]({'filename':_0xb6b1('0x66')+_0x39c0d9['toLowerCase'](),'createdAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x5be7bf[_0xb6b1('0x67')],'status':'rec'});}else{_0x3b482b['mixmonitorid']=_0x5be7bf['mixmonitorid'];_0x3b482b[_0xb6b1('0x68')]=_0xb6b1('0x69');}_0x5bfd0e({'code':0xc8,'message':[_0x3f02bc[_0xb6b1('0x5e')],_0xb6b1('0x6a'),_0x5be7bf[_0xb6b1('0x67')]][_0xb6b1('0x19')]('\x20'),'mixmonitorid':_0x5be7bf['mixmonitorid']});})[_0xb6b1('0x1c')](function(_0x322e35){_0x20e93b(_0x4da826['error'](0x1f5,[_0x3f02bc['uniqueid'],_0x322e35[_0xb6b1('0x18')][_0xb6b1('0x65')]()]['join']('\x20')));});}else{return _0x20e93b(_0x4da826['error'](0x1f5,_0xb6b1('0x6b')));}});},'VoiceChannelStopMixMonitor':function(_0x484afc){var _0x463482=this;return new Promise(function(_0x1ce8a2,_0x4a07ed){if(ami[_0xb6b1('0xf')]()==![]){return _0x4a07ed(_0x463482[_0xb6b1('0x10')](0x1f4,[config[_0xb6b1('0x11')]['ip'],config[_0xb6b1('0x11')][_0xb6b1('0x12')],_0xb6b1('0x13')][_0xb6b1('0x19')]('\x20')));}var _0x35aae0=schema(properties[_0xb6b1('0x5c')])[_0xb6b1('0x2')](_0x484afc);if(_0x35aae0['length']>0x0){return _0x4a07ed(_0x463482[_0xb6b1('0x10')](0x1f4,_[_0xb6b1('0x5d')](_0x35aae0,_0xb6b1('0x18'))[_0xb6b1('0x19')](',\x20')));}var _0x4a7796=_[_0xb6b1('0x63')](_0x345886[_0xb6b1('0x5b')],{'uniqueid':_0x484afc[_0xb6b1('0x5e')]});if(_0x4a7796){return BPromise[_0xb6b1('0x6c')]()[_0xb6b1('0x17')](function(){if(_0x4a7796[_0xb6b1('0x5f')]){return ami[_0xb6b1('0x16')]({'action':'StopMixMonitor','channel':_0x4a7796['channel'],'mixmonitorid':_0x484afc[_0xb6b1('0x67')]})['catch'](function(_0x2e91fa){});}})[_0xb6b1('0x17')](function(){if(_0x4a7796[_0xb6b1('0x6d')]){return ami['Action']({'action':_0xb6b1('0x6e'),'channel':_0x4a7796[_0xb6b1('0x6d')],'mixmonitorid':_0x484afc[_0xb6b1('0x67')]})[_0xb6b1('0x1c')](function(_0x463112){});}})['then'](function(_0x4ddcf3){var _0x11e94e=_[_0xb6b1('0x63')](_0x4a7796[_0xb6b1('0x64')],{'mixmonitorid':_0x484afc[_0xb6b1('0x67')]});if(_0x11e94e){_0x11e94e[_0xb6b1('0x68')]=_0xb6b1('0x6f');}})[_0xb6b1('0x17')](function(){var _0x3d6edf=util[_0xb6b1('0x8')](_0xb6b1('0x60'),_0x484afc[_0xb6b1('0x61')]||_0x484afc[_0xb6b1('0x5e')],_0x484afc['format']||_0xb6b1('0x70'));var _0x49ace7=_[_0xb6b1('0x63')](_0x4a7796[_0xb6b1('0x64')],{'filename':_0xb6b1('0x66')+_0x3d6edf['toLowerCase']()});if(_0x49ace7){_0x49ace7[_0xb6b1('0x68')]='stop';}})['then'](function(){_0x1ce8a2({'code':0xc8,'message':[_0x484afc[_0xb6b1('0x5e')],'StopMixMonitor\x20Success'][_0xb6b1('0x19')]('\x20')});})[_0xb6b1('0x1c')](function(_0x509667){_0x4a07ed(_0x463482[_0xb6b1('0x10')](0x1f5,[_0x484afc['uniqueid'],_0x509667[_0xb6b1('0x18')][_0xb6b1('0x65')]()][_0xb6b1('0x19')]('\x20')));});}else{return _0x4a07ed(_0x463482['error'](0x1f5,_0xb6b1('0x6b')));}});},'VoiceQueuesChannels':function(_0x4ef26a){return new Promise(function(_0x20f2f2,_0x469f7f){var _0x3e1695=_[_0xb6b1('0x5a')](_0x345886['queueChannels']);_0x20f2f2({'count':_0x3e1695[_0xb6b1('0x57')],'rows':_0x3e1695});});},'VoiceQueuesChannel':function(_0x410fe6){var _0x3e663d=this;return new Promise(function(_0xb611fa,_0x381793){var _0x2aa294=schema(properties['voicequeuechannel'])[_0xb6b1('0x2')](_0x410fe6);if(_0x2aa294[_0xb6b1('0x57')]>0x0){return _0x381793(_0x3e663d[_0xb6b1('0x10')](0x1f4,_[_0xb6b1('0x5d')](_0x2aa294,'message')[_0xb6b1('0x19')](',\x20')));}var _0x1c4bde=_['find'](_0x345886['queueChannels'],{'uniqueid':_0x410fe6['uniqueid']});if(_0x1c4bde){_0xb611fa(_0x1c4bde);}else{return _0x381793(_0x3e663d['error'](0x1f5,_0xb6b1('0x6b')));}});},'VoiceQueuesChannelHangup':function(_0x439b23){var _0x17ce08=this;return new Promise(function(_0xc203ce,_0x1d039a){if(ami[_0xb6b1('0xf')]()==![]){return _0x1d039a(_0x17ce08[_0xb6b1('0x10')](0x1f4,[config['asterisk']['ip'],config[_0xb6b1('0x11')]['username'],'ami\x20disconnected'][_0xb6b1('0x19')]('\x20')));}var _0x28213e=schema(properties['voicequeuechannelhangup'])[_0xb6b1('0x2')](_0x439b23);if(_0x28213e[_0xb6b1('0x57')]>0x0){return _0x1d039a(_0x17ce08[_0xb6b1('0x10')](0x1f4,_[_0xb6b1('0x5d')](_0x28213e,_0xb6b1('0x18'))['join'](',\x20')));}var _0x3d96c6=_[_0xb6b1('0x63')](_0x345886['queueChannels'],{'uniqueid':_0x439b23['uniqueid']});if(_0x3d96c6&&_0x3d96c6[_0xb6b1('0x5f')]){return ami[_0xb6b1('0x16')]({'action':_0xb6b1('0x71'),'channel':_0x3d96c6[_0xb6b1('0x5f')]})[_0xb6b1('0x17')](function(_0x28860e){_0xc203ce({'code':0xc8,'message':[_0x439b23[_0xb6b1('0x5e')],_0x28860e[_0xb6b1('0x18')][_0xb6b1('0x65')]()]['join']('\x20')});})[_0xb6b1('0x1c')](function(_0x57fd39){_0x1d039a(_0x17ce08[_0xb6b1('0x10')](0x1f5,[_0x439b23[_0xb6b1('0x5e')],_0x57fd39[_0xb6b1('0x18')]['toLowerCase']()][_0xb6b1('0x19')]('\x20')));});}else{return _0x1d039a(_0x17ce08[_0xb6b1('0x10')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x37c3e6){var _0x588390=this;return new Promise(function(_0x4c79dc,_0x955b9b){if(ami['isConnected']()==![]){return _0x955b9b(_0x588390[_0xb6b1('0x10')](0x1f4,[config['asterisk']['ip'],config[_0xb6b1('0x11')][_0xb6b1('0x12')],_0xb6b1('0x13')][_0xb6b1('0x19')]('\x20')));}var _0x3765ca=schema(properties['voicequeuechannelredirect'])[_0xb6b1('0x2')](_0x37c3e6);if(_0x3765ca[_0xb6b1('0x57')]>0x0){return _0x955b9b(_0x588390[_0xb6b1('0x10')](0x1f4,_[_0xb6b1('0x5d')](_0x3765ca,_0xb6b1('0x18'))[_0xb6b1('0x19')](',\x20')));}var _0x19415a=_[_0xb6b1('0x63')](_0x345886[_0xb6b1('0x72')],{'uniqueid':_0x37c3e6[_0xb6b1('0x5e')]});if(_0x19415a&&_0x19415a[_0xb6b1('0x5f')]){return ami[_0xb6b1('0x16')]({'action':'Redirect','channel':_0x19415a[_0xb6b1('0x5f')],'exten':_0x37c3e6[_0xb6b1('0x73')],'context':_0x37c3e6['context']||_0x19415a[_0xb6b1('0x74')],'priority':0x1})[_0xb6b1('0x17')](function(_0x5b02b7){_0x4c79dc({'code':0xc8,'message':[_0x37c3e6[_0xb6b1('0x5e')],_0x5b02b7['message'][_0xb6b1('0x65')]()]['join']('\x20')});})[_0xb6b1('0x1c')](function(_0x5e1d5c){_0x955b9b(_0x588390['error'](0x1f5,[_0x37c3e6[_0xb6b1('0x5e')],_0x5e1d5c[_0xb6b1('0x18')]['toLowerCase']()][_0xb6b1('0x19')]('\x20')));});}else{return _0x955b9b(_0x588390[_0xb6b1('0x10')](0x1f5,_0xb6b1('0x6b')));}});},'Agents':function(_0xac8b8a){return new Promise(function(_0x292dbe,_0x6b6d3){var _0x3e7949=_[_0xb6b1('0x5a')](_0x345886[_0xb6b1('0xc')]);_0x292dbe({'count':_0x3e7949[_0xb6b1('0x57')],'rows':_0x3e7949});});},'Telephones':function(_0x28231c){return new Promise(function(_0x18a71f,_0x521366){var _0x1d1e49=_[_0xb6b1('0x5a')](_0x345886[_0xb6b1('0x75')]);_0x18a71f({'count':_0x1d1e49[_0xb6b1('0x57')],'rows':_0x1d1e49});});},'Trunks':function(_0x489898){return new Promise(function(_0x1ee829,_0x2be41a){var _0x15818e=_[_0xb6b1('0x5a')](_0x345886[_0xb6b1('0x76')]);_0x1ee829({'count':_0x15818e[_0xb6b1('0x57')],'rows':_0x15818e});});},'OutboundChannels':function(_0x4872c7){return new Promise(function(_0x3954dd,_0x2c0509){var _0xe96200=_[_0xb6b1('0x5a')](_0x345886[_0xb6b1('0x77')]);_0x3954dd({'count':_0xe96200[_0xb6b1('0x57')],'rows':_0xe96200});});},'Outbound':function(_0x137c52){return new Promise(function(_0x433ce8,_0x400819){_0x433ce8(_0x345886[_0xb6b1('0x2c')]);});},'Campaigns':function(_0x3b9eb2){return new Promise(function(_0x54fa89,_0x5d3d77){var _0x2046e5=_[_0xb6b1('0x5a')](_0x345886[_0xb6b1('0x78')]);_0x54fa89({'count':_0x2046e5[_0xb6b1('0x57')],'rows':_0x2046e5});});},'VoiceQueuesPreview':function(_0x36d30b){var _0x32b89e=this;return new Promise(function(_0x43d32a,_0x3fbff1){_0x41bf3e['run'](_0x36d30b['id'])[_0xb6b1('0x17')](function(_0x1fa035){_0x43d32a({'code':0xc8,'message':_0x1fa035[_0xb6b1('0x18')]});})['catch'](function(_0x8f27ea){_0x3fbff1(_0x32b89e['error'](0x1f4,_0x8f27ea['message']));});});},'EventManager':function(_0x13f438){var _0x320c96=this;return new Promise(function(_0xa7b8d2,_0xf5dbf9){if(!_0x13f438[_0xb6b1('0x79')]){return _0xf5dbf9(_0x320c96[_0xb6b1('0x10')](0x1f4,'Event\x20name\x20mandatory'));}ami[_0xb6b1('0x7a')](_0xb6b1('0x7b')+_0x13f438[_0xb6b1('0x79')],_0x13f438[_0xb6b1('0x18')]);_0xa7b8d2({'code':0xc8,'message':_0x13f438});});},'FaxAccounts':function(_0x5712df){return new Promise(function(_0x4ea394,_0xdeaa28){var _0x5c8321=_[_0xb6b1('0x5a')](_0x345886['faxAccounts']);_0x4ea394({'count':_0x5c8321[_0xb6b1('0x57')],'rows':_0x5c8321});});},'SendFax':function(_0x516f87){var _0x58b209=this;return new Promise(function(_0x384595,_0x349feb){_0x113a39[_0xb6b1('0x7c')](_0x516f87)[_0xb6b1('0x17')](function(_0x3929e1){_0x384595({'code':0xc8,'message':_0x3929e1['message']});})[_0xb6b1('0x1c')](function(_0x170d5c){_0x349feb(_0x58b209[_0xb6b1('0x10')](0x1f4,_0x170d5c[_0xb6b1('0x18')]));});});},'CheckAfterSend':function(_0x523037){var _0xb668af=this;return new Promise(function(_0x5248c7,_0x3158cd){_0x113a39['checkAfterSend'](_0x523037)[_0xb6b1('0x17')](function(_0x554155){_0x5248c7({'code':0xc8,'message':_0x554155['message']});})['catch'](function(_0x4908ab){_0x3158cd(_0xb668af[_0xb6b1('0x10')](0x1f4,_0x4908ab['message']));});});}};var _0x25dbd6=jayson[_0xb6b1('0x7d')](_0x1a4cd0)[_0xb6b1('0x7e')]();_0x25dbd6['on'](_0xb6b1('0x10'),function(_0x5d1c1d){return _0x13334e(_0x5d1c1d);});_0x25dbd6[_0xb6b1('0x7')](0x232a,_0xb6b1('0x7f'),function(){console['log']('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x1ff716('RPC\x20listening\x20on\x20port:'+0x232a);});});}; \ No newline at end of file diff --git a/server/services/ami/trigger/cmContact/index.js b/server/services/ami/trigger/cmContact/index.js index ee9dd3f..ae3adeb 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 _0x6ca2=['uniqueid','data4','calleridnum','isNil','','calleridname','Unknown','destcalleridname','resolve','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','format','user:%s','name','trigger:%s','toLowerCase','bluebird','ioredis','util','../../../../config/logger','redis','defaults','localhost','stringify','emit','data1','data2','xmd-contactid','data3','routeId','destcalleridnum','firstName','lastName','phone','mobile','fax','ListId','createdAt','scheduledAt','updatedAt','union','then','length','[CM][%s][%s]\x20Contact\x20found:%s','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','map','join','info','[CM][%s][%s]\x20Contact\x20not\x20found'];(function(_0x4fe19c,_0x45d0fe){var _0x952ac7=function(_0x274a16){while(--_0x274a16){_0x4fe19c['push'](_0x4fe19c['shift']());}};_0x952ac7(++_0x45d0fe);}(_0x6ca2,0xa7));var _0x26ca=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x6ca2[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var BPromise=require(_0x26ca('0x0'));var Redis=require(_0x26ca('0x1'));var util=require(_0x26ca('0x2'));var config=require('../../../../config/environment');var logger=require(_0x26ca('0x3'))('trigger');var cmContactRpc=require('../../rpc/cmContact');config[_0x26ca('0x4')]=_[_0x26ca('0x5')](config[_0x26ca('0x4')],{'host':_0x26ca('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x26ca('0x4')]));function emit(_0x3d1241,_0x57aa23,_0x536b10,_0x3b786a,_0x382cd7){logger['info']('[CM][%s][%s]',_0x3d1241,_0x57aa23['id'],_0x536b10,_0x3b786a,JSON[_0x26ca('0x7')](_0x382cd7));io['to'](_0x536b10)[_0x26ca('0x8')](_0x3b786a,_0x382cd7);}exports['exec']=function(_0x412a12,_0x5e5d4c,_0x44790c,_0x5d345b){var _0x2e6474,_0x3bcb7f;var _0x4c88e2={};var _0x124b43=Number(_0x44790c[_0x26ca('0x9')]);var _0x2aa19d=_0x44790c[_0x26ca('0xa')]?Boolean(Number(_0x44790c[_0x26ca('0xa')])):![];var _0xd409fe;if(_0x5d345b[_0x26ca('0xb')]){_0x4c88e2['id']=_0x5d345b[_0x26ca('0xb')];}if(!_0x4c88e2['id']){_0x4c88e2['ListId']=_0x124b43;_0xd409fe=_0x44790c[_0x26ca('0xc')]&&_0x44790c[_0x26ca('0xc')]!=='0'?_0x44790c['data3']['split'](','):['phone'];_0x4c88e2['$or']=_['map'](_0xd409fe,function(_0x5e3630){var _0x5bb132={};_0x5bb132[_0x5e3630]=_0x5d345b[_0x26ca('0xd')]?_0x5d345b[_0x26ca('0xe')]:_0x5d345b['calleridnum'];return _0x5bb132;});}var _0x1ce763=['id',_0x26ca('0xf'),_0x26ca('0x10'),_0x26ca('0x11'),_0x26ca('0x12'),_0x26ca('0x13'),_0x26ca('0x14'),_0x26ca('0x15'),_0x26ca('0x16'),_0x26ca('0x17')];var _0x5876cf=_[_0x26ca('0x18')](_0x1ce763,_0xd409fe);BPromise['resolve']()['then'](cmContactRpc['getContacts']({'attributes':_0x5876cf,'where':_0x4c88e2}))[_0x26ca('0x19')](function(_0x570f9c){_0x3bcb7f=_0x570f9c;if(!_['isEmpty'](_0x3bcb7f)){if(_0x3bcb7f[_0x26ca('0x1a')]===0x1){_0x2e6474=_0x3bcb7f[0x0];logger['info'](_0x26ca('0x1b'),_0x5d345b['uniqueid'],_0x5e5d4c['id'],_0x2e6474['id']);}else{logger['info'](_0x26ca('0x1c'),_0x5d345b['uniqueid'],_0x5e5d4c['id'],_[_0x26ca('0x1d')](_0x3bcb7f,'id')[_0x26ca('0x1e')](','));}return;}else{logger[_0x26ca('0x1f')](_0x26ca('0x20'),_0x5d345b[_0x26ca('0x21')],_0x5e5d4c['id']);var _0x286af2={'ListId':_0x124b43};var _0x38ef03=_0x44790c[_0x26ca('0x22')]&&_0x44790c[_0x26ca('0x22')]!=='0'?_0x44790c[_0x26ca('0x22')]:'phone';if(_0x2aa19d){logger['info']('[CM][%s][%s]\x20Autocreate\x20enabled',_0x5d345b[_0x26ca('0x21')],_0x5e5d4c['id']);_0x286af2[_0x38ef03]=_['isNil'](_0x5d345b[_0x26ca('0xd')])?_0x5d345b[_0x26ca('0x23')]:_0x5d345b[_0x26ca('0xe')];if(_[_0x26ca('0x24')](_0x5d345b['routeId'])){_0x286af2[_0x26ca('0xf')]=_0x5d345b['calleridname']&&_0x5d345b['calleridname']!==_0x26ca('0x25')?_0x5d345b[_0x26ca('0x26')]:_0x26ca('0x27');}else{_0x286af2[_0x26ca('0xf')]=_0x5d345b[_0x26ca('0x28')]&&_0x5d345b['destcalleridname']!==''?_0x5d345b[_0x26ca('0x28')]:'Unknown';}return BPromise[_0x26ca('0x29')]()[_0x26ca('0x19')](cmContactRpc[_0x26ca('0x2a')](_0x286af2))[_0x26ca('0x19')](function(_0xbfaa0){_0x2e6474=_0xbfaa0;_0x3bcb7f[_0x26ca('0x2b')](_0xbfaa0);if(_0x2e6474){logger[_0x26ca('0x1f')](_0x26ca('0x2c'),_0x5d345b[_0x26ca('0x21')],_0x5e5d4c['id'],_0x2e6474['id']);}return;});}else{logger[_0x26ca('0x1f')]('[CM][%s][%s]\x20Autocreate\x20disabled',_0x5d345b[_0x26ca('0x21')],_0x5e5d4c['id']);_0x286af2[_0x38ef03]=_[_0x26ca('0x24')](_0x5d345b['routeId'])?_0x5d345b[_0x26ca('0x23')]:_0x5d345b[_0x26ca('0xe')];if(_[_0x26ca('0x24')](_0x5d345b[_0x26ca('0xd')])){_0x286af2[_0x26ca('0xf')]=_0x5d345b[_0x26ca('0x26')]&&_0x5d345b['calleridname']!==_0x26ca('0x25')?_0x5d345b[_0x26ca('0x26')]:_0x26ca('0x27');}else{_0x286af2['firstName']=_0x5d345b[_0x26ca('0x28')]&&_0x5d345b[_0x26ca('0x28')]!==_0x26ca('0x25')?_0x5d345b[_0x26ca('0x28')]:_0x26ca('0x27');}_0x2e6474=_0x286af2;_0x3bcb7f['push'](_0x286af2);return;}}})[_0x26ca('0x19')](function(){if(_0x412a12){emit(_0x5d345b[_0x26ca('0x21')],_0x5e5d4c,util[_0x26ca('0x2d')](_0x26ca('0x2e'),_0x412a12[_0x26ca('0x2f')]),util['format'](_0x26ca('0x30'),_0x44790c['action'][_0x26ca('0x31')]()),{'evt':_['merge'](_0x5d345b,{'autoCreate':_0x2aa19d}),'contact':_0x2e6474===undefined?{}:_0x2e6474,'contacts':_0x3bcb7f[_0x26ca('0x1a')]===0x0?undefined:_0x3bcb7f});}});}; \ No newline at end of file +var _0x57b2=['toLowerCase','merge','lodash','ioredis','util','../../../../config/environment','../../../../config/logger','../../rpc/cmContact','redis','defaults','localhost','socket.io-emitter','info','[CM][%s][%s]','stringify','emit','exec','data2','xmd-contactid','ListId','data3','split','phone','$or','map','routeId','destcalleridnum','calleridnum','firstName','mobile','updatedAt','getContacts','then','isEmpty','length','uniqueid','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','calleridname','','Unknown','destcalleridname','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','isNil','format','user:%s','name','trigger:%s','action'];(function(_0x31a371,_0x50828e){var _0x2a5bd6=function(_0x2fb481){while(--_0x2fb481){_0x31a371['push'](_0x31a371['shift']());}};_0x2a5bd6(++_0x50828e);}(_0x57b2,0x6e));var _0x257b=function(_0x38695b,_0x8d9af2){_0x38695b=_0x38695b-0x0;var _0x372ad6=_0x57b2[_0x38695b];return _0x372ad6;};'use strict';var _=require(_0x257b('0x0'));var BPromise=require('bluebird');var Redis=require(_0x257b('0x1'));var util=require(_0x257b('0x2'));var config=require(_0x257b('0x3'));var logger=require(_0x257b('0x4'))('trigger');var cmContactRpc=require(_0x257b('0x5'));config[_0x257b('0x6')]=_[_0x257b('0x7')](config[_0x257b('0x6')],{'host':_0x257b('0x8'),'port':0x18eb});var io=require(_0x257b('0x9'))(new Redis(config[_0x257b('0x6')]));function emit(_0x2cfe17,_0x248069,_0x18dc90,_0x5b9152,_0x5e0c39){logger[_0x257b('0xa')](_0x257b('0xb'),_0x2cfe17,_0x248069['id'],_0x18dc90,_0x5b9152,JSON[_0x257b('0xc')](_0x5e0c39));io['to'](_0x18dc90)[_0x257b('0xd')](_0x5b9152,_0x5e0c39);}exports[_0x257b('0xe')]=function(_0x17012f,_0x2a1768,_0x5a7ab8,_0x47bd9a){var _0x533fe6,_0xc6201a;var _0x5f4092={};var _0x3852af=Number(_0x5a7ab8['data1']);var _0x23aa92=_0x5a7ab8['data2']?Boolean(Number(_0x5a7ab8[_0x257b('0xf')])):![];var _0x339494;if(_0x47bd9a[_0x257b('0x10')]){_0x5f4092['id']=_0x47bd9a[_0x257b('0x10')];}if(!_0x5f4092['id']){_0x5f4092[_0x257b('0x11')]=_0x3852af;_0x339494=_0x5a7ab8['data3']&&_0x5a7ab8['data3']!=='0'?_0x5a7ab8[_0x257b('0x12')][_0x257b('0x13')](','):[_0x257b('0x14')];_0x5f4092[_0x257b('0x15')]=_[_0x257b('0x16')](_0x339494,function(_0x53c8a5){var _0x59dfb4={};_0x59dfb4[_0x53c8a5]=_0x47bd9a[_0x257b('0x17')]?_0x47bd9a[_0x257b('0x18')]:_0x47bd9a[_0x257b('0x19')];return _0x59dfb4;});}var _0x40f48a=['id',_0x257b('0x1a'),'lastName',_0x257b('0x14'),_0x257b('0x1b'),'fax',_0x257b('0x11'),'createdAt','scheduledAt',_0x257b('0x1c')];var _0x58b59c=_['union'](_0x40f48a,_0x339494);BPromise['resolve']()['then'](cmContactRpc[_0x257b('0x1d')]({'attributes':_0x58b59c,'where':_0x5f4092}))[_0x257b('0x1e')](function(_0x38a490){_0xc6201a=_0x38a490;if(!_[_0x257b('0x1f')](_0xc6201a)){if(_0xc6201a[_0x257b('0x20')]===0x1){_0x533fe6=_0xc6201a[0x0];logger['info']('[CM][%s][%s]\x20Contact\x20found:%s',_0x47bd9a[_0x257b('0x21')],_0x2a1768['id'],_0x533fe6['id']);}else{logger[_0x257b('0xa')]('[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]',_0x47bd9a[_0x257b('0x21')],_0x2a1768['id'],_['map'](_0xc6201a,'id')[_0x257b('0x22')](','));}return;}else{logger['info'](_0x257b('0x23'),_0x47bd9a[_0x257b('0x21')],_0x2a1768['id']);var _0x3009f4={'ListId':_0x3852af};var _0x367f32=_0x5a7ab8[_0x257b('0x24')]&&_0x5a7ab8[_0x257b('0x24')]!=='0'?_0x5a7ab8['data4']:'phone';if(_0x23aa92){logger[_0x257b('0xa')](_0x257b('0x25'),_0x47bd9a[_0x257b('0x21')],_0x2a1768['id']);_0x3009f4[_0x367f32]=_['isNil'](_0x47bd9a[_0x257b('0x17')])?_0x47bd9a[_0x257b('0x19')]:_0x47bd9a[_0x257b('0x18')];if(_['isNil'](_0x47bd9a['routeId'])){_0x3009f4['firstName']=_0x47bd9a['calleridname']&&_0x47bd9a[_0x257b('0x26')]!==_0x257b('0x27')?_0x47bd9a[_0x257b('0x26')]:_0x257b('0x28');}else{_0x3009f4['firstName']=_0x47bd9a[_0x257b('0x29')]&&_0x47bd9a['destcalleridname']!==''?_0x47bd9a[_0x257b('0x29')]:_0x257b('0x28');}return BPromise['resolve']()[_0x257b('0x1e')](cmContactRpc[_0x257b('0x2a')](_0x3009f4))[_0x257b('0x1e')](function(_0x5c9309){_0x533fe6=_0x5c9309;_0xc6201a[_0x257b('0x2b')](_0x5c9309);if(_0x533fe6){logger[_0x257b('0xa')](_0x257b('0x2c'),_0x47bd9a[_0x257b('0x21')],_0x2a1768['id'],_0x533fe6['id']);}return;});}else{logger[_0x257b('0xa')](_0x257b('0x2d'),_0x47bd9a[_0x257b('0x21')],_0x2a1768['id']);_0x3009f4[_0x367f32]=_[_0x257b('0x2e')](_0x47bd9a[_0x257b('0x17')])?_0x47bd9a[_0x257b('0x19')]:_0x47bd9a['destcalleridnum'];if(_['isNil'](_0x47bd9a[_0x257b('0x17')])){_0x3009f4['firstName']=_0x47bd9a['calleridname']&&_0x47bd9a['calleridname']!==_0x257b('0x27')?_0x47bd9a[_0x257b('0x26')]:_0x257b('0x28');}else{_0x3009f4['firstName']=_0x47bd9a[_0x257b('0x29')]&&_0x47bd9a['destcalleridname']!==_0x257b('0x27')?_0x47bd9a[_0x257b('0x29')]:'Unknown';}_0x533fe6=_0x3009f4;_0xc6201a['push'](_0x3009f4);return;}}})[_0x257b('0x1e')](function(){if(_0x17012f){emit(_0x47bd9a['uniqueid'],_0x2a1768,util[_0x257b('0x2f')](_0x257b('0x30'),_0x17012f[_0x257b('0x31')]),util[_0x257b('0x2f')](_0x257b('0x32'),_0x5a7ab8[_0x257b('0x33')][_0x257b('0x34')]()),{'evt':_[_0x257b('0x35')](_0x47bd9a,{'autoCreate':_0x23aa92}),'contact':_0x533fe6===undefined?{}:_0x533fe6,'contacts':_0xc6201a[_0x257b('0x20')]===0x0?undefined:_0xc6201a});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index ea26490..805a76b 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 _0xc6ef=['winApplication','winArguments','format','user:%s','name','action','trigger:%s','data1','contactmanager','exec','integration','queue','routeId','urlforward','search','replace','channel','every','AllConditions','checkConditions','AnyConditions','field','account','chat','ChatWebsiteId','operator','value','upperFirst','AccountId','interaction','message','event','agent','membername','lastevent','mailSubstatus','substatus','exports','util','lodash','url','ioredis','./integration','./cmContact','./script','../../../config/logger','trigger','redis','defaults','localhost','socket.io-emitter','popup','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','custom:agentcalled','syncCustomEvent','bind','custom:agentconnect','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentbusy','custom:queuecallerabandon','custom:timeout','syncAgentDial','custom:dialconnect','custom:dialend','custom:newinteraction','custom:closedinteraction','custom:incomingmessage','custom:acceptmessage','custom:rejectmessage','emit','info','stringify','clone','motionChannel','undefined','voice','checkTriggers','interface','prototype','status','checkTrigger','merge','length','Actions','toLowerCase','motionbar','TemplateId','data2','html','render','template\x20not\x20found','uri','buildUri','isNil','data3','data4','location','windowWidth','800','data5','windowHeight','data6','600'];(function(_0x3a8d06,_0xc5596f){var _0x3c1015=function(_0x1888a5){while(--_0x1888a5){_0x3a8d06['push'](_0x3a8d06['shift']());}};_0x3c1015(++_0xc5596f);}(_0xc6ef,0x18e));var _0xfc6e=function(_0x5c0935,_0x510eb7){_0x5c0935=_0x5c0935-0x0;var _0x15ae90=_0xc6ef[_0x5c0935];return _0x15ae90;};'use strict';var util=require(_0xfc6e('0x0'));var _=require(_0xfc6e('0x1'));var url=require(_0xfc6e('0x2'));var Mustache=require('mustache');var Redis=require(_0xfc6e('0x3'));var urlforward=require('./urlforward');var integration=require(_0xfc6e('0x4'));var cmContact=require(_0xfc6e('0x5'));var script=require(_0xfc6e('0x6'));var config=require('../../../config/environment');var logger=require(_0xfc6e('0x7'))(_0xfc6e('0x8'));var ami=require('../ami');config[_0xfc6e('0x9')]=_[_0xfc6e('0xa')](config[_0xfc6e('0x9')],{'host':_0xfc6e('0xb'),'port':0x18eb});var io=require(_0xfc6e('0xc'))(new Redis(config[_0xfc6e('0x9')]));var operators={'equals':function(_0x340d7d,_0xa6e74f){return _0x340d7d==_0xa6e74f;},'not_equals':function(_0x2f164f,_0x47928e){return _0x2f164f!=_0x47928e;}};var barAndWebActions=[_0xfc6e('0xd'),_0xfc6e('0x2'),_0xfc6e('0xe')];function Trigger(_0x2ceff6){this[_0xfc6e('0xf')]=_0x2ceff6[_0xfc6e('0xf')];this['agents']=_0x2ceff6[_0xfc6e('0x10')];this[_0xfc6e('0x11')]=_0x2ceff6[_0xfc6e('0x11')];this[_0xfc6e('0x12')]=_0x2ceff6[_0xfc6e('0x12')];this[_0xfc6e('0x13')]=_0x2ceff6['voiceExtensions'];this[_0xfc6e('0x14')]=_0x2ceff6[_0xfc6e('0x14')];this['freshdeskAccounts']=_0x2ceff6[_0xfc6e('0x15')];this['salesforceAccounts']=_0x2ceff6[_0xfc6e('0x16')];this[_0xfc6e('0x17')]=_0x2ceff6['sugarcrmAccounts'];this[_0xfc6e('0x18')]=_0x2ceff6[_0xfc6e('0x18')];this[_0xfc6e('0x19')]=_0x2ceff6[_0xfc6e('0x19')];this[_0xfc6e('0x1a')]=_0x2ceff6[_0xfc6e('0x1a')];this[_0xfc6e('0x1b')]=_0x2ceff6['servicenowAccounts'];this[_0xfc6e('0x1c')]=_0x2ceff6[_0xfc6e('0x1c')];this[_0xfc6e('0x1d')]=_0x2ceff6[_0xfc6e('0x1d')];this[_0xfc6e('0x1e')]={'zendesk':this[_0xfc6e('0x14')],'salesforce':this[_0xfc6e('0x16')],'freshdesk':this[_0xfc6e('0x15')],'sugarcrm':this[_0xfc6e('0x17')],'zoho':this[_0xfc6e('0x18')],'desk':this['deskAccounts'],'vtiger':this['vtigerAccounts'],'dynamics365':this[_0xfc6e('0x1c')],'freshsales':this[_0xfc6e('0x1d')],'servicenow':this[_0xfc6e('0x1b')]};ami['on'](_0xfc6e('0x1f'),this[_0xfc6e('0x20')][_0xfc6e('0x21')](this));ami['on'](_0xfc6e('0x22'),this['syncCustomEvent'][_0xfc6e('0x21')](this));ami['on']('custom:agentringnoanswer',this[_0xfc6e('0x20')][_0xfc6e('0x21')](this));ami['on']('custom:agentcomplete',this['syncCustomEvent'][_0xfc6e('0x21')](this));ami['on'](_0xfc6e('0x23'),this[_0xfc6e('0x20')]['bind'](this));ami['on'](_0xfc6e('0x24'),this[_0xfc6e('0x20')][_0xfc6e('0x21')](this));ami['on'](_0xfc6e('0x25'),this[_0xfc6e('0x20')][_0xfc6e('0x21')](this));ami['on']('custom:agentcongestion',this['syncCustomEvent'][_0xfc6e('0x21')](this));ami['on']('custom:agentreject',this['syncCustomEvent'][_0xfc6e('0x21')](this));ami['on']('custom:amd',this[_0xfc6e('0x20')][_0xfc6e('0x21')](this));ami['on'](_0xfc6e('0x26'),this['syncCustomEvent']['bind'](this));ami['on'](_0xfc6e('0x27'),this[_0xfc6e('0x20')][_0xfc6e('0x21')](this));ami['on']('custom:dialbegin',this[_0xfc6e('0x28')][_0xfc6e('0x21')](this));ami['on'](_0xfc6e('0x29'),this[_0xfc6e('0x28')]['bind'](this));ami['on'](_0xfc6e('0x2a'),this[_0xfc6e('0x28')][_0xfc6e('0x21')](this));ami['on'](_0xfc6e('0x2b'),this[_0xfc6e('0x20')][_0xfc6e('0x21')](this));ami['on'](_0xfc6e('0x2c'),this['syncCustomEvent'][_0xfc6e('0x21')](this));ami['on'](_0xfc6e('0x2d'),this[_0xfc6e('0x20')][_0xfc6e('0x21')](this));ami['on']('custom:outgoingmessage',this[_0xfc6e('0x20')][_0xfc6e('0x21')](this));ami['on'](_0xfc6e('0x2e'),this[_0xfc6e('0x20')][_0xfc6e('0x21')](this));ami['on'](_0xfc6e('0x2f'),this['syncCustomEvent'][_0xfc6e('0x21')](this));}Trigger['prototype'][_0xfc6e('0x30')]=function(_0x5b4342,_0x2bcb81,_0x5c0ad5){logger[_0xfc6e('0x31')](_0x5b4342,_0x2bcb81,JSON[_0xfc6e('0x32')](_0x5c0ad5));io['to'](_0x5b4342)[_0xfc6e('0x30')](_0x2bcb81,_0x5c0ad5);};Trigger['prototype']['syncCustomEvent']=function(_0x45b59f){var _0x365f63=_[_0xfc6e('0x33')](_0x45b59f);if(typeof _0x365f63[_0xfc6e('0x34')]===_0xfc6e('0x35')){_0x365f63[_0xfc6e('0x34')]=_0xfc6e('0x36');}this[_0xfc6e('0x37')](_0x365f63);};Trigger['prototype'][_0xfc6e('0x28')]=function(_0xe86429){if(this[_0xfc6e('0x10')][_0xe86429[_0xfc6e('0x38')]]){this[_0xfc6e('0x20')](_0xe86429);}};Trigger[_0xfc6e('0x39')][_0xfc6e('0x37')]=function(_0xe7ec84){var _0x33bd5e;for(var _0x4548f0 in this[_0xfc6e('0xf')]){if(this[_0xfc6e('0xf')]['hasOwnProperty'](_0x4548f0)){if(this['triggers'][_0x4548f0][_0xfc6e('0x3a')]){_0x33bd5e=this[_0xfc6e('0x3b')](this['triggers'][_0x4548f0],_0xe7ec84);if(_0x33bd5e){_[_0xfc6e('0x3c')](_0xe7ec84,_0xe7ec84['variables']);for(var _0xc5747b=0x0,_0x5470d9,_0x28782b,_0x3a2d38;_0xc5747b0x0){_0x3565cf=_['map'](_0x2dd5f,_0x40dc8f);}return _0x3565cf;}function getCustomFields(_0x33a1a5,_0x4690a6){var _0x45b675=[];var _0x50f9f5={'custom_fields':{}};if(_0x33a1a5[_0x43e7('0x28')]>0x0){_[_0x43e7('0x29')](_0x33a1a5,function(_0x2b85a5){if(_[_0x43e7('0x2a')]([_0x43e7('0x2b'),_0x43e7('0x2c')],_0x2b85a5[_0x43e7('0x2d')])&&_0x2b85a5[_0x43e7('0x2e')]&&!_0x2b85a5[_0x43e7('0x2f')]){_0x50f9f5[_0x2b85a5[_0x43e7('0x2e')]['toLowerCase']()]=_0x2b85a5[_0x43e7('0x30')][_0x43e7('0x21')]();}else if(_[_0x43e7('0x2a')]([_0x43e7('0x2b'),_0x43e7('0x2c')],_0x2b85a5['type'])&&_0x2b85a5[_0x43e7('0x31')]&&_0x2b85a5[_0x43e7('0x2f')]){_0x50f9f5[_0x43e7('0x32')][_0x2b85a5[_0x43e7('0x31')]]=_0x2b85a5['content']['toString']();}else if(_0x2b85a5['type']===_0x43e7('0x33')&&_0x2b85a5[_0x43e7('0x34')]&&_0x2b85a5[_0x43e7('0x31')]&&_0x2b85a5[_0x43e7('0x2f')]){_0x4690a6[_0x2b85a5[_0x43e7('0x34')]]&&(_0x50f9f5[_0x43e7('0x32')][_0x2b85a5['idField']]=_0x4690a6[_0x2b85a5['variableName']]['toString']());}else if(_0x2b85a5['type']==='customVariable'&&_0x2b85a5['Variable']&&_0x2b85a5['Variable'][_0x43e7('0x35')]&&_0x2b85a5['idField']&&_0x2b85a5[_0x43e7('0x2f')]){_0x4690a6[_0x2b85a5[_0x43e7('0x36')][_0x43e7('0x35')][_0x43e7('0x37')]()]&&(_0x50f9f5[_0x43e7('0x32')][_0x2b85a5[_0x43e7('0x31')]]=_0x4690a6[_0x2b85a5[_0x43e7('0x36')]['name']['toLowerCase']()]['toString']());}});}if(_0x50f9f5[_0x43e7('0x38')]){_0x50f9f5[_0x43e7('0x38')]=Number(_0x50f9f5[_0x43e7('0x38')]);}return _0x50f9f5;}function getTicket(_0x16cdba,_0x1b1440,_0x1ed538,_0x1d4589,_0x2ffd43){logger['info'](_0x43e7('0x39'));var _0x2b0ffe=_['merge']({'subject':intUtil[_0x43e7('0x3a')](_0x1d4589['Subjects'],_0x2ffd43,'\x20'),'type':_0x43e7('0x3b'),'status':_0x43e7('0x3c'),'labels':[_0x43e7('0x3d'),_0x43e7('0x3e'),_0x43e7('0x3f')][_0x43e7('0x40')](getTags(_0x1d4589['Tags'],'name')),'description':intUtil[_0x43e7('0x3a')](_0x1d4589[_0x43e7('0x41')],_0x2ffd43,'\x0a'),'_links':{'assigned_user':{'href':util[_0x43e7('0x16')](_0x43e7('0x42'),_0x1b1440['id']),'class':_0x43e7('0x43')}},'message':{'direction':'in','body':intUtil['getString'](_0x1d4589[_0x43e7('0x41')],_0x2ffd43,'\x0a')}},getCustomFields(_0x1d4589[_0x43e7('0x44')],_0x2ffd43));return request({'uri':util['format'](_0x43e7('0x45'),_0x16cdba['remoteUri'],_0x1ed538['id']),'method':_0x43e7('0x27'),'body':_0x2b0ffe});}exports['queue']=function(_0x3d81ae,_0x3b4235,_0x3a5807,_0x1c2c6b,_0x49b866,_0x47d6a1){var _0x103393,_0x40c509;_0x47d6a1[_0x43e7('0x14')]=intUtil[_0x43e7('0x46')](_0x47d6a1['remoteUri']);_0x47d6a1['serverUrl']=intUtil['stripTrailingSlash'](_0x47d6a1[_0x43e7('0x47')]);if(_0x49b866&&_0x49b866['monitor_format']){logger[_0x43e7('0xb')]('[QUEUE]','Recording\x20is\x20enabled!');_0x3b4235[_0x43e7('0x48')]=util['format'](_0x43e7('0x49'),_0x47d6a1[_0x43e7('0x47')],_0x3b4235[_0x43e7('0x4a')],md5(_0x3b4235[_0x43e7('0x4a')]));}else{_0x3b4235['recordingURL']='';}headers[_0x43e7('0x4b')]=getAuth(_0x47d6a1);return getUser(_0x47d6a1,_0x1c2c6b[_0x43e7('0x4c')])[_0x43e7('0xe')](function(_0x1fd277){_0x103393=_0x1fd277;logger[_0x43e7('0xb')](_0x43e7('0x4d'),_0x103393['id']);return getEndUser(_0x47d6a1,_0x3b4235['calleridname'],_0x3b4235['calleridnum']);})[_0x43e7('0xe')](function(_0x36a09e){_0x40c509=_0x36a09e;logger[_0x43e7('0xb')]('The\x20Enduser\x20ID\x20is:',_0x40c509['id']);return getTicket(_0x47d6a1,_0x103393,_0x40c509,_0x3a5807,_0x3b4235);})['then'](function(_0x56489b){if(_0x56489b){logger[_0x43e7('0xb')](_0x43e7('0x4e'));logger['info'](_0x43e7('0x4f'),_0x56489b['id']);switch(_0x47d6a1[_0x43e7('0x2d')]){case _0x43e7('0x50'):logger['info']('[QUEUE]','Displaying\x20ticket\x20to\x20agent...');emit(util['format'](_0x43e7('0x51'),_0x1c2c6b[_0x43e7('0x35')]),'trigger:desk:display',{'recordId':_0x56489b['id']});break;case _0x43e7('0x52'):logger[_0x43e7('0xb')](_0x43e7('0x53'),_0x43e7('0x54'));emit(util['format'](_0x43e7('0x51'),_0x1c2c6b['name']),'trigger:browser:url',{'uri':util[_0x43e7('0x16')](_0x43e7('0x55'),_0x56489b['id'])});break;default:logger[_0x43e7('0x56')](_0x43e7('0x53'),_0x43e7('0x57'));}}})[_0x43e7('0x58')](function(_0x1cd87c){console[_0x43e7('0x56')](_0x1cd87c);logger[_0x43e7('0x56')](_0x43e7('0x53'),JSON['stringify'](_0x1cd87c));});};exports[_0x43e7('0x59')]=function(_0x46c910,_0x499c03,_0x39e3ca,_0x4e6f6d,_0x35b799,_0x520857,_0x34e2ec){var _0x1f561f,_0xfe13fa;_0x520857['remoteUri']=intUtil['stripTrailingSlash'](_0x520857[_0x43e7('0x14')]);_0x520857[_0x43e7('0x47')]=intUtil[_0x43e7('0x46')](_0x520857[_0x43e7('0x47')]);if(_0x34e2ec&&_0x34e2ec[_0x43e7('0x5a')]&&_0x34e2ec[_0x43e7('0x5a')]!==_0x43e7('0x5b')){logger[_0x43e7('0xb')](_0x43e7('0x5c'),_0x43e7('0x5d'));_0x499c03[_0x43e7('0x48')]=util['format'](_0x43e7('0x49'),_0x520857[_0x43e7('0x47')],_0x499c03['uniqueid'],md5(_0x499c03[_0x43e7('0x4a')]));}headers[_0x43e7('0x4b')]=getAuth(_0x520857);return getUser(_0x520857,_0x4e6f6d[_0x43e7('0x4c')])['then'](function(_0x5d63c6){_0x1f561f=_0x5d63c6;logger[_0x43e7('0xb')](_0x43e7('0x4d'),_0x1f561f['id']);return getEndUser(_0x520857,_0x499c03['destcalleridname'],_0x499c03[_0x43e7('0x5e')]);})['then'](function(_0x49a6ce){_0xfe13fa=_0x49a6ce;logger[_0x43e7('0xb')](_0x43e7('0x5f'),_0xfe13fa['id']);return getTicket(_0x520857,_0x1f561f,_0xfe13fa,_0x39e3ca,_0x499c03);})[_0x43e7('0xe')](function(_0x40155c){if(_0x40155c){logger[_0x43e7('0xb')]('Ticket\x20created!');logger[_0x43e7('0xb')](_0x43e7('0x4f'),_0x40155c['id']);switch(_0x520857['type']){case _0x43e7('0x50'):logger[_0x43e7('0xb')](_0x43e7('0x53'),'Displaying\x20ticket\x20to\x20agent...');emit(util['format']('user:%s',_0x4e6f6d[_0x43e7('0x35')]),_0x43e7('0x60'),{'recordId':_0x40155c['id']});break;case _0x43e7('0x52'):logger[_0x43e7('0xb')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x43e7('0x16')](_0x43e7('0x51'),_0x4e6f6d[_0x43e7('0x35')]),_0x43e7('0x61'),{'uri':util['format'](_0x43e7('0x62'),_0x520857[_0x43e7('0x14')],_0x40155c['id'])});break;default:logger[_0x43e7('0x56')](_0x43e7('0x5c'),_0x43e7('0x57'));}}})[_0x43e7('0x58')](function(_0x4665db){logger[_0x43e7('0x56')](_0x43e7('0x5c'),JSON[_0x43e7('0x63')](_0x4665db));});};exports[_0x43e7('0x64')]=function(_0x57fdfe,_0x5f3824,_0x2b0711,_0x58a3a8,_0x501616,_0x50edb2){var _0xb3e981,_0xe666b0;_0x50edb2['remoteUri']=intUtil[_0x43e7('0x46')](_0x50edb2[_0x43e7('0x14')]);_0x50edb2[_0x43e7('0x47')]=intUtil['stripTrailingSlash'](_0x50edb2[_0x43e7('0x47')]);if(_0x501616&&_0x501616[_0x43e7('0x65')]){logger[_0x43e7('0xb')]('['+_0x5f3824[_0x43e7('0x66')][_0x43e7('0x67')]()+']',_0x43e7('0x5d'));_0x5f3824[_0x43e7('0x48')]=util['format'](_0x43e7('0x49'),_0x50edb2[_0x43e7('0x47')],_0x5f3824[_0x43e7('0x4a')],md5(_0x5f3824['uniqueid']));}else{_0x5f3824['recordingURL']='';}headers[_0x43e7('0x4b')]=getAuth(_0x50edb2);return getUser(_0x50edb2)['then'](function(_0x5cb26e){_0xb3e981=_0x5cb26e;logger[_0x43e7('0xb')](_0x43e7('0x4d'),_0xb3e981['id']);return getEndUser(_0x50edb2,_0x5f3824['calleridname'],_0x5f3824[_0x43e7('0x68')]);})[_0x43e7('0xe')](function(_0x1e2fed){_0xe666b0=_0x1e2fed;logger[_0x43e7('0xb')](_0x43e7('0x5f'),_0xe666b0['id']);return getTicket(_0x50edb2,_0xb3e981,_0xe666b0,_0x2b0711,_0x5f3824);})[_0x43e7('0xe')](function(_0x398a78){if(_0x398a78){logger['info'](_0x43e7('0x4e'));logger[_0x43e7('0xb')]('The\x20Ticket\x20ID\x20is:',_0x398a78['id']);}})[_0x43e7('0x58')](function(_0x5c2c5f){logger[_0x43e7('0x56')]('['+_0x5f3824[_0x43e7('0x66')][_0x43e7('0x67')]()+']',JSON[_0x43e7('0x63')](_0x5c2c5f));});}; \ No newline at end of file +var _0x814b=['calleridname','toUpperCase','lodash','request-promise','md5','util','ioredis','./util','../../../../config/logger','desk','redis','defaults','localhost','emit','application/json','validateEmail','info','Getting\x20agent\x20with\x20email','format','%s/users','then','total_entries','find','_embedded','entries','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me','remoteUri','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','debug','[HTTP]','%s:%s','authType','token','username','Basic\x20%s','toString','base64','Searching\x20enduser\x20with\x20phone','%s/customers/search','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/customers','POST','work','map','length','string','nameField','toLowerCase','content','picklist','idField','customField','custom_fields','type','variableName','customVariable','Variable','name','priority','merge','getString','Subjects','xCALLY','CTI','concat','Tags','Descriptions','/api/v2/users/%d','user','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','Authorization','email','The\x20User\x20ID\x20is:','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','integrationTab','user:%s','trigger:desk:display','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://xcally.desk.com/web/agent/case/%d','catch','error','stringify','recordingFormat','none','[OUTBOUND]','destcalleridnum','Displaying\x20ticket\x20to\x20agent...','unmanaged','lastevent'];(function(_0x51bb0b,_0x256820){var _0x5cec97=function(_0x2a39b7){while(--_0x2a39b7){_0x51bb0b['push'](_0x51bb0b['shift']());}};_0x5cec97(++_0x256820);}(_0x814b,0x1a2));var _0xb814=function(_0x51d129,_0x175d7d){_0x51d129=_0x51d129-0x0;var _0x44c377=_0x814b[_0x51d129];return _0x44c377;};'use strict';var _=require(_0xb814('0x0'));var rp=require(_0xb814('0x1'));var md5=require(_0xb814('0x2'));var util=require(_0xb814('0x3'));var Redis=require(_0xb814('0x4'));var intUtil=require(_0xb814('0x5'));var config=require('../../../../config/environment');var logger=require(_0xb814('0x6'))(_0xb814('0x7'));config[_0xb814('0x8')]=_[_0xb814('0x9')](config[_0xb814('0x8')],{'host':_0xb814('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xb814('0x8')]));function emit(_0x2e6272,_0x5c8539,_0x271af9){io['to'](_0x2e6272)[_0xb814('0xb')](_0x5c8539,_0x271af9);}var headers={'Content-Type':_0xb814('0xc'),'Accept':_0xb814('0xc')};function getUser(_0x1fea33,_0x21d4a5){if(intUtil[_0xb814('0xd')](_0x21d4a5)===!![]){logger[_0xb814('0xe')](_0xb814('0xf'),_0x21d4a5);return request({'uri':util[_0xb814('0x10')](_0xb814('0x11'),_0x1fea33['remoteUri'])})[_0xb814('0x12')](function(_0x56278f){if(_0x56278f[_0xb814('0x13')]){return _[_0xb814('0x14')](_0x56278f[_0xb814('0x15')][_0xb814('0x16')],{'email':_0x21d4a5});}})[_0xb814('0x12')](function(_0x3bde14){if(_0x3bde14){logger[_0xb814('0xe')](_0xb814('0x17'));return _0x3bde14;}else{logger[_0xb814('0xe')](_0xb814('0x18'));return request({'uri':util[_0xb814('0x10')](_0xb814('0x19'),_0x1fea33[_0xb814('0x1a')])});}});}else{logger[_0xb814('0xe')](_0xb814('0x1b'));return request({'uri':util[_0xb814('0x10')](_0xb814('0x19'),_0x1fea33[_0xb814('0x1a')])});}}function request(_0x125ce2){logger[_0xb814('0x1c')](_0xb814('0x1d'),JSON['stringify'](_0x125ce2));return rp(_[_0xb814('0x9')](_0x125ce2,{'method':'GET','headers':headers,'json':!![]}));}function getAuth(_0x270598){var _0xfac75b;if(_0x270598['authType']==='basic'){_0xfac75b=util['format'](_0xb814('0x1e'),_0x270598['username'],_0x270598['password']);}else if(_0x270598[_0xb814('0x1f')]===_0xb814('0x20')){_0xfac75b=util[_0xb814('0x10')]('%s/token:%s',_0x270598[_0xb814('0x21')],_0x270598['token']);}return util[_0xb814('0x10')](_0xb814('0x22'),new Buffer(_0xfac75b)[_0xb814('0x23')](_0xb814('0x24')));}function getEndUser(_0x27352e,_0x2bd039,_0x1f5d40){logger['info'](_0xb814('0x25'),_0x1f5d40);return request({'uri':util['format'](_0xb814('0x26'),_0x27352e[_0xb814('0x1a')]),'qs':{'phone':_0x1f5d40}})[_0xb814('0x12')](function(_0x208927){if(_0x208927[_0xb814('0x13')]){logger[_0xb814('0xe')](_0xb814('0x27'));return _0x208927['_embedded'][_0xb814('0x16')][0x0];}else{logger[_0xb814('0xe')](_0xb814('0x28'));return request({'uri':util[_0xb814('0x10')](_0xb814('0x29'),_0x27352e[_0xb814('0x1a')]),'method':_0xb814('0x2a'),'body':{'first_name':_0x2bd039,'title':_0x2bd039,'phone_numbers':[{'type':_0xb814('0x2b'),'value':_0x1f5d40}]}});}});}function getTags(_0x5a6291,_0x271aa8){var _0x328a08=[];if(_0x5a6291&&_0x5a6291['length']>0x0){_0x328a08=_[_0xb814('0x2c')](_0x5a6291,_0x271aa8);}return _0x328a08;}function getCustomFields(_0x37d24d,_0x530744){var _0x499f22=[];var _0x20577b={'custom_fields':{}};if(_0x37d24d[_0xb814('0x2d')]>0x0){_['forEach'](_0x37d24d,function(_0x338a28){if(_['includes']([_0xb814('0x2e'),'picklist'],_0x338a28['type'])&&_0x338a28[_0xb814('0x2f')]&&!_0x338a28['customField']){_0x20577b[_0x338a28[_0xb814('0x2f')][_0xb814('0x30')]()]=_0x338a28[_0xb814('0x31')]['toString']();}else if(_['includes']([_0xb814('0x2e'),_0xb814('0x32')],_0x338a28['type'])&&_0x338a28[_0xb814('0x33')]&&_0x338a28[_0xb814('0x34')]){_0x20577b[_0xb814('0x35')][_0x338a28[_0xb814('0x33')]]=_0x338a28[_0xb814('0x31')][_0xb814('0x23')]();}else if(_0x338a28[_0xb814('0x36')]==='variable'&&_0x338a28[_0xb814('0x37')]&&_0x338a28[_0xb814('0x33')]&&_0x338a28[_0xb814('0x34')]){_0x530744[_0x338a28[_0xb814('0x37')]]&&(_0x20577b[_0xb814('0x35')][_0x338a28['idField']]=_0x530744[_0x338a28[_0xb814('0x37')]]['toString']());}else if(_0x338a28[_0xb814('0x36')]===_0xb814('0x38')&&_0x338a28[_0xb814('0x39')]&&_0x338a28['Variable'][_0xb814('0x3a')]&&_0x338a28[_0xb814('0x33')]&&_0x338a28['customField']){_0x530744[_0x338a28[_0xb814('0x39')][_0xb814('0x3a')][_0xb814('0x30')]()]&&(_0x20577b[_0xb814('0x35')][_0x338a28[_0xb814('0x33')]]=_0x530744[_0x338a28[_0xb814('0x39')]['name'][_0xb814('0x30')]()]['toString']());}});}if(_0x20577b[_0xb814('0x3b')]){_0x20577b['priority']=Number(_0x20577b[_0xb814('0x3b')]);}return _0x20577b;}function getTicket(_0x4b9233,_0x2f8a2e,_0x26675a,_0x54a7fb,_0x4d308a){logger['info']('Creating\x20new\x20ticket...');var _0x17549e=_[_0xb814('0x3c')]({'subject':intUtil[_0xb814('0x3d')](_0x54a7fb[_0xb814('0x3e')],_0x4d308a,'\x20'),'type':'phone','status':'new','labels':[_0xb814('0x3f'),'Motion',_0xb814('0x40')][_0xb814('0x41')](getTags(_0x54a7fb[_0xb814('0x42')],_0xb814('0x3a'))),'description':intUtil[_0xb814('0x3d')](_0x54a7fb[_0xb814('0x43')],_0x4d308a,'\x0a'),'_links':{'assigned_user':{'href':util[_0xb814('0x10')](_0xb814('0x44'),_0x2f8a2e['id']),'class':_0xb814('0x45')}},'message':{'direction':'in','body':intUtil['getString'](_0x54a7fb['Descriptions'],_0x4d308a,'\x0a')}},getCustomFields(_0x54a7fb['Fields'],_0x4d308a));return request({'uri':util[_0xb814('0x10')]('%s/customers/%d/cases',_0x4b9233[_0xb814('0x1a')],_0x26675a['id']),'method':'POST','body':_0x17549e});}exports[_0xb814('0x46')]=function(_0x44ff56,_0x9ef639,_0x2e97cc,_0x4fae23,_0x30fc57,_0x15f01a){var _0x2b23c7,_0x22cf27;_0x15f01a[_0xb814('0x1a')]=intUtil[_0xb814('0x47')](_0x15f01a['remoteUri']);_0x15f01a[_0xb814('0x48')]=intUtil[_0xb814('0x47')](_0x15f01a[_0xb814('0x48')]);if(_0x30fc57&&_0x30fc57[_0xb814('0x49')]){logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x4b'));_0x9ef639['recordingURL']=util['format'](_0xb814('0x4c'),_0x15f01a[_0xb814('0x48')],_0x9ef639[_0xb814('0x4d')],md5(_0x9ef639[_0xb814('0x4d')]));}else{_0x9ef639[_0xb814('0x4e')]='';}headers[_0xb814('0x4f')]=getAuth(_0x15f01a);return getUser(_0x15f01a,_0x4fae23[_0xb814('0x50')])[_0xb814('0x12')](function(_0x2eb9b6){_0x2b23c7=_0x2eb9b6;logger[_0xb814('0xe')](_0xb814('0x51'),_0x2b23c7['id']);return getEndUser(_0x15f01a,_0x9ef639['calleridname'],_0x9ef639[_0xb814('0x52')]);})[_0xb814('0x12')](function(_0x4a76bb){_0x22cf27=_0x4a76bb;logger[_0xb814('0xe')]('The\x20Enduser\x20ID\x20is:',_0x22cf27['id']);return getTicket(_0x15f01a,_0x2b23c7,_0x22cf27,_0x2e97cc,_0x9ef639);})[_0xb814('0x12')](function(_0x37866f){if(_0x37866f){logger[_0xb814('0xe')](_0xb814('0x53'));logger[_0xb814('0xe')](_0xb814('0x54'),_0x37866f['id']);switch(_0x15f01a[_0xb814('0x36')]){case _0xb814('0x55'):logger[_0xb814('0xe')](_0xb814('0x4a'),'Displaying\x20ticket\x20to\x20agent...');emit(util['format'](_0xb814('0x56'),_0x4fae23[_0xb814('0x3a')]),_0xb814('0x57'),{'recordId':_0x37866f['id']});break;case _0xb814('0x58'):logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x59'));emit(util['format'](_0xb814('0x56'),_0x4fae23[_0xb814('0x3a')]),_0xb814('0x5a'),{'uri':util['format'](_0xb814('0x5b'),_0x37866f['id'])});break;default:logger['error'](_0xb814('0x4a'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0xb814('0x5c')](function(_0x3cf8f8){console['error'](_0x3cf8f8);logger[_0xb814('0x5d')](_0xb814('0x4a'),JSON[_0xb814('0x5e')](_0x3cf8f8));});};exports['outbound']=function(_0x3da050,_0x5f0e58,_0x13bdcf,_0x158893,_0x4aed78,_0x39952d,_0x4a3f84){var _0x539be7,_0x3b9709;_0x39952d[_0xb814('0x1a')]=intUtil[_0xb814('0x47')](_0x39952d['remoteUri']);_0x39952d[_0xb814('0x48')]=intUtil['stripTrailingSlash'](_0x39952d[_0xb814('0x48')]);if(_0x4a3f84&&_0x4a3f84[_0xb814('0x5f')]&&_0x4a3f84['recordingFormat']!==_0xb814('0x60')){logger['info'](_0xb814('0x61'),_0xb814('0x4b'));_0x5f0e58[_0xb814('0x4e')]=util[_0xb814('0x10')](_0xb814('0x4c'),_0x39952d[_0xb814('0x48')],_0x5f0e58[_0xb814('0x4d')],md5(_0x5f0e58[_0xb814('0x4d')]));}headers['Authorization']=getAuth(_0x39952d);return getUser(_0x39952d,_0x158893[_0xb814('0x50')])[_0xb814('0x12')](function(_0x5d71d5){_0x539be7=_0x5d71d5;logger[_0xb814('0xe')](_0xb814('0x51'),_0x539be7['id']);return getEndUser(_0x39952d,_0x5f0e58['destcalleridname'],_0x5f0e58[_0xb814('0x62')]);})['then'](function(_0x48362c){_0x3b9709=_0x48362c;logger[_0xb814('0xe')]('The\x20Enduser\x20ID\x20is:',_0x3b9709['id']);return getTicket(_0x39952d,_0x539be7,_0x3b9709,_0x13bdcf,_0x5f0e58);})[_0xb814('0x12')](function(_0xd1cd8b){if(_0xd1cd8b){logger[_0xb814('0xe')]('Ticket\x20created!');logger[_0xb814('0xe')]('The\x20Ticket\x20ID\x20is:',_0xd1cd8b['id']);switch(_0x39952d[_0xb814('0x36')]){case _0xb814('0x55'):logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x63'));emit(util[_0xb814('0x10')](_0xb814('0x56'),_0x158893[_0xb814('0x3a')]),_0xb814('0x57'),{'recordId':_0xd1cd8b['id']});break;case'newTab':logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x59'));emit(util[_0xb814('0x10')](_0xb814('0x56'),_0x158893[_0xb814('0x3a')]),'trigger:browser:url',{'uri':util[_0xb814('0x10')]('%s/agent/tickets/%s',_0x39952d[_0xb814('0x1a')],_0xd1cd8b['id'])});break;default:logger[_0xb814('0x5d')](_0xb814('0x61'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0xb814('0x5c')](function(_0x579351){logger[_0xb814('0x5d')]('[OUTBOUND]',JSON[_0xb814('0x5e')](_0x579351));});};exports[_0xb814('0x64')]=function(_0xa03cd2,_0x1b024f,_0x3377d4,_0x167d82,_0x143518,_0x4d44e3){var _0x44088d,_0x51ca51;_0x4d44e3[_0xb814('0x1a')]=intUtil[_0xb814('0x47')](_0x4d44e3[_0xb814('0x1a')]);_0x4d44e3[_0xb814('0x48')]=intUtil[_0xb814('0x47')](_0x4d44e3[_0xb814('0x48')]);if(_0x143518&&_0x143518['monitor_format']){logger[_0xb814('0xe')]('['+_0x1b024f[_0xb814('0x65')]['toUpperCase']()+']',_0xb814('0x4b'));_0x1b024f[_0xb814('0x4e')]=util[_0xb814('0x10')](_0xb814('0x4c'),_0x4d44e3[_0xb814('0x48')],_0x1b024f['uniqueid'],md5(_0x1b024f[_0xb814('0x4d')]));}else{_0x1b024f['recordingURL']='';}headers[_0xb814('0x4f')]=getAuth(_0x4d44e3);return getUser(_0x4d44e3)[_0xb814('0x12')](function(_0x2645f6){_0x44088d=_0x2645f6;logger[_0xb814('0xe')](_0xb814('0x51'),_0x44088d['id']);return getEndUser(_0x4d44e3,_0x1b024f[_0xb814('0x66')],_0x1b024f['calleridnum']);})['then'](function(_0x5d064b){_0x51ca51=_0x5d064b;logger[_0xb814('0xe')]('The\x20Enduser\x20ID\x20is:',_0x51ca51['id']);return getTicket(_0x4d44e3,_0x44088d,_0x51ca51,_0x3377d4,_0x1b024f);})[_0xb814('0x12')](function(_0x1d3954){if(_0x1d3954){logger[_0xb814('0xe')]('Ticket\x20created!');logger[_0xb814('0xe')](_0xb814('0x54'),_0x1d3954['id']);}})[_0xb814('0x5c')](function(_0x5aabbe){logger[_0xb814('0x5d')]('['+_0x1b024f[_0xb814('0x65')][_0xb814('0x67')]()+']',JSON[_0xb814('0x5e')](_0x5aabbe));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/dynamics365.js b/server/services/ami/trigger/integration/dynamics365.js index 95c426f..3f7baf5 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 _0x6f11=['toUpperCase','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','message','toLowerCase','outbound','destcalleridnum','calleridnum','/systemusers(','odata-entityid','substring','lastIndexOf','enduserId','GET','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','replace','%2b','telephone1','contactid',']\x20Enduser\x20created!',']\x20Enduser\x20Created!','forEach','includes','string','picklist','type','nameField','idField','indexOf','content','ticketType','incident','POST','assign','getString','Descriptions','/contacts(','Fields','phonecall','phonecalls','Subjects','callDirection','headers','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','format','user:%s','emit','trigger:browser:url','stripTrailingSlash','serverUrl','queue','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','tenantId','uniqueid','[QUEUE]','recordingURL','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s','ticketId',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20Dynamics365\x20integration','lodash','bluebird','util','./util','md5','ioredis','../../../../config/logger','../../../../config/environment','redis','defaults','clientId','remoteUri','username','password','clientSecret','then','catch','error',']\x20Wrong\x20credentials!','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','validateEmail','email','userEmail','length','internalemailaddress','info'];(function(_0x48b8b3,_0x14c694){var _0x3fb319=function(_0x9d13e9){while(--_0x9d13e9){_0x48b8b3['push'](_0x48b8b3['shift']());}};_0x3fb319(++_0x14c694);}(_0x6f11,0x1d2));var _0x16f1=function(_0x1d7608,_0x3cff59){_0x1d7608=_0x1d7608-0x0;var _0x3212bc=_0x6f11[_0x1d7608];return _0x3212bc;};'use strict';var _=require(_0x16f1('0x0'));var BPromise=require(_0x16f1('0x1'));var rp=require('request-promise');var util=require(_0x16f1('0x2'));var intUtil=require(_0x16f1('0x3'));var md5=require(_0x16f1('0x4'));var Redis=require(_0x16f1('0x5'));var logger=require(_0x16f1('0x6'))('dynamics365');var config=require(_0x16f1('0x7'));config[_0x16f1('0x8')]=_[_0x16f1('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x16f1('0x8')]));function getAuthToken(_0x32663f,_0x333051,_0x2b9652){var _0x4588af={'method':'POST','uri':_0x333051,'form':{'client_id':_0x32663f[_0x16f1('0xa')],'resource':_0x32663f[_0x16f1('0xb')],'username':_0x32663f[_0x16f1('0xc')],'password':_0x32663f[_0x16f1('0xd')],'grant_type':_0x16f1('0xd'),'client_secret':_0x32663f[_0x16f1('0xe')]},'json':!![]};return rp(_0x4588af)[_0x16f1('0xf')](function(_0x50ea9a){return _0x50ea9a['access_token'];})[_0x16f1('0x10')](function(_0x1e1f59){logger[_0x16f1('0x11')]('['+[_0x2b9652['toUpperCase']()]+_0x16f1('0x12'));return _0x1e1f59['message'];});}function getUser(_0x4b5e3d,_0xc463ed,_0x3745ca,_0x5d16fb,_0x1f10e9,_0x4ba3d3){return new BPromise(function(_0x3b7719,_0x188dc1){return getAuthToken(_0xc463ed,_0x5d16fb,_0x4ba3d3)[_0x16f1('0xf')](function(_0xd0f654){var _0x19790c={'method':'GET','uri':_0x1f10e9+_0x16f1('0x13'),'headers':{'Authorization':_0x16f1('0x14')+_0xd0f654,'OData-Version':_0x16f1('0x15')},'json':!![]};return rp(_0x19790c);})[_0x16f1('0xf')](function(_0x4355ec){var _0x17ac30=_0x4355ec[_0x16f1('0x16')];var _0x41e880=![];var _0x16cb42=null;if(!_['isNil'](_0x3745ca)){if(intUtil[_0x16f1('0x17')](_0x3745ca[_0x16f1('0x18')])){_0x4b5e3d[_0x16f1('0x19')]=_0x3745ca[_0x16f1('0x18')];for(_0x16cb42=0x0;_0x16cb42<_0x17ac30[_0x16f1('0x1a')];_0x16cb42++){if(_0x17ac30[_0x16cb42][_0x16f1('0x1b')]===_0x3745ca[_0x16f1('0x18')]&&!_0x17ac30[_0x16cb42]['isdisabled']){_0x41e880=!![];logger[_0x16f1('0x1c')]('['+[_0x4ba3d3[_0x16f1('0x1d')]()]+']\x20Agent\x20found\x20'+_0x17ac30[_0x16cb42][_0x16f1('0x1e')]+'!');_0x4b5e3d[_0x16f1('0x1f')]=_0x17ac30[_0x16cb42]['systemuserid'];}}}}if(!_0x41e880){logger[_0x16f1('0x1c')]('['+[_0x4ba3d3[_0x16f1('0x1d')]()]+_0x16f1('0x20'));_0x4b5e3d['userEmail']=_0xc463ed[_0x16f1('0xc')];for(_0x16cb42=0x0;_0x16cb42<_0x17ac30[_0x16f1('0x1a')];_0x16cb42++){if(_0x17ac30[_0x16cb42][_0x16f1('0x1b')]===_0xc463ed[_0x16f1('0xc')]){_0x4b5e3d['userId']=_0x17ac30[_0x16cb42][_0x16f1('0x1e')];}}}_0x3b7719(_0x4b5e3d);})[_0x16f1('0x10')](function(_0x5d7a60){_0x188dc1(_0x5d7a60[_0x16f1('0x21')]);});});}function createEndUser(_0x1442d8,_0x1c3525,_0x473180,_0x482835,_0x1990ae,_0x5dda3d){return new BPromise(function(_0x5b295d,_0x15fd55){return getAuthToken(_0x1c3525,_0x473180,_0x5dda3d)[_0x16f1('0xf')](function(_0x37d1ba){var _0x1a574a=_0x5dda3d[_0x16f1('0x22')]()===_0x16f1('0x23')?_0x1990ae[_0x16f1('0x24')]:_0x1990ae[_0x16f1('0x25')];var _0x47a49c={'method':'POST','uri':_0x482835+'contacts','body':{'telephone1':_0x1a574a,'fullname':_0x1a574a,'firstname':_0x1a574a,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x16f1('0x26')+_0x1442d8[_0x16f1('0x1f')]+')'},'headers':{'Authorization':_0x16f1('0x14')+_0x37d1ba,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x47a49c);})[_0x16f1('0xf')](function(_0x49c01f){var _0x47dc85=_0x49c01f['headers'][_0x16f1('0x27')];var _0xe97bbe=_0x47dc85[_0x16f1('0x28')](_0x47dc85[_0x16f1('0x29')]('(')+0x1,_0x47dc85['lastIndexOf'](')'));_0x1442d8[_0x16f1('0x2a')]=_0xe97bbe;_0x5b295d(_0x1442d8);})['catch'](function(_0x20675d){_0x15fd55(_0x20675d[_0x16f1('0x21')]);});});}function getEndUser(_0x43b4ba,_0x2ac210,_0x4ae537,_0xa89de,_0x3b7c94,_0x2ae31d){return new BPromise(function(_0x5a0927,_0xf6404b){var _0x519a9b=_0x2ae31d[_0x16f1('0x22')]()==='outbound'?_0x3b7c94[_0x16f1('0x24')]:_0x3b7c94[_0x16f1('0x25')];return getAuthToken(_0x2ac210,_0x4ae537,_0x2ae31d)['then'](function(_0x5e2d3a){var _0xe6910d={'method':_0x16f1('0x2b'),'uri':_0xa89de+_0x16f1('0x2c')+_0x519a9b[_0x16f1('0x2d')]('+',_0x16f1('0x2e'))+'\x27','headers':{'Authorization':_0x16f1('0x14')+_0x5e2d3a,'If-None-Match':null,'OData-Version':_0x16f1('0x15')},'json':!![]};return rp(_0xe6910d);})[_0x16f1('0xf')](function(_0x212d2d){var _0x24a90b=null;if(_0x212d2d){var _0x33391a=_0x212d2d[_0x16f1('0x16')];var _0x2489aa=![];for(_0x24a90b=0x0;_0x24a90b<_0x33391a[_0x16f1('0x1a')];_0x24a90b++){if(_0x33391a[_0x24a90b][_0x16f1('0x2f')]===_0x519a9b){_0x2489aa=!![];_0x43b4ba[_0x16f1('0x2a')]=_0x33391a[_0x24a90b][_0x16f1('0x30')];}}if(_0x2489aa){_0x5a0927(_0x43b4ba);}else{return createEndUser(_0x43b4ba,_0x2ac210,_0x4ae537,_0xa89de,_0x3b7c94,_0x2ae31d)['then'](function(_0x541661){logger[_0x16f1('0x1c')]('['+[_0x2ae31d['toUpperCase']()]+_0x16f1('0x31'),_0x541661[_0x16f1('0x2a')]);_0x5a0927(_0x541661);});}}else{return createEndUser(_0x43b4ba,_0x2ac210,_0x4ae537,_0xa89de,_0x3b7c94,_0x2ae31d)['then'](function(_0x5e14fd){logger[_0x16f1('0x1c')]('['+[_0x2ae31d[_0x16f1('0x1d')]()]+_0x16f1('0x32'),_0x5e14fd[_0x16f1('0x2a')]);_0x5a0927(_0x5e14fd);});}});});}function getCustomFields(_0x7f8e5d,_0x61bdb5,_0x41859a){var _0x30ff48={};if(_0x7f8e5d[_0x16f1('0x1a')]>0x0){_[_0x16f1('0x33')](_0x7f8e5d,function(_0x16ebb4){if(_[_0x16f1('0x34')]([_0x16f1('0x35'),_0x16f1('0x36')],_0x16ebb4[_0x16f1('0x37')])&&_0x16ebb4[_0x16f1('0x38')]&&!_0x16ebb4['customField']){var _0x117504=_0x16ebb4[_0x16f1('0x39')][_0x16f1('0x22')]();var _0x28dfdb=_0x117504[_0x16f1('0x28')](0x0,_0x117504[_0x16f1('0x3a')]('_'));var _0x252df2=_0x117504[_0x16f1('0x28')](_0x117504[_0x16f1('0x3a')]('_')+0x1);if(_0x28dfdb===_0x41859a){_0x30ff48[_0x252df2]=_0x16ebb4[_0x16f1('0x3b')];}}});}return _0x30ff48;}function getTicket(_0x5145a8,_0x4e0746,_0x1d3981,_0x131614,_0x40efcc,_0x26eaa2,_0x2e7b6d){return new BPromise(function(_0x31b077,_0x3b7976){var _0x21c241;return getAuthToken(_0x4e0746,_0x1d3981,_0x2e7b6d)[_0x16f1('0xf')](function(_0x12d18a){if(_0x26eaa2[_0x16f1('0x3c')]===_0x16f1('0x3d')){_0x21c241={'method':_0x16f1('0x3e'),'uri':_0x131614+'incidents','body':Object[_0x16f1('0x3f')]({},{'title':intUtil[_0x16f1('0x40')](_0x26eaa2['Subjects'],_0x40efcc,'\x20'),'description':intUtil['getString'](_0x26eaa2[_0x16f1('0x41')],_0x40efcc,'\x0a'),'customerid_contact@odata.bind':_0x16f1('0x42')+_0x5145a8['enduserId']+')','ownerid@odata.bind':_0x16f1('0x26')+_0x5145a8['userId']+')','caseorigincode':'1'},getCustomFields(_0x26eaa2[_0x16f1('0x43')],_0x40efcc,_0x26eaa2['ticketType'])),'headers':{'Authorization':_0x16f1('0x14')+_0x12d18a,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0x26eaa2[_0x16f1('0x3c')]===_0x16f1('0x44')){_0x21c241={'method':_0x16f1('0x3e'),'uri':_0x131614+_0x16f1('0x45'),'body':Object['assign']({},{'subject':intUtil[_0x16f1('0x40')](_0x26eaa2[_0x16f1('0x46')],_0x40efcc,'\x20'),'phonenumber':String(_0x40efcc[_0x16f1('0x25')]),'description':intUtil[_0x16f1('0x40')](_0x26eaa2[_0x16f1('0x41')],_0x40efcc,'\x0a'),'regardingobjectid_contact@odata.bind':_0x16f1('0x42')+_0x5145a8[_0x16f1('0x2a')]+')','ownerid@odata.bind':_0x16f1('0x26')+_0x5145a8[_0x16f1('0x1f')]+')','directioncode':_0x5145a8['callDirection']==='queue'?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0x16f1('0x26')+_0x5145a8[_0x16f1('0x1f')]+')','participationtypemask':_0x5145a8[_0x16f1('0x47')]==='queue'?0x2:0x1},{'partyid_contact@odata.bind':'/contacts('+_0x5145a8[_0x16f1('0x2a')]+')','participationtypemask':_0x5145a8[_0x16f1('0x47')]==='queue'?0x1:0x2}]},getCustomFields(_0x26eaa2[_0x16f1('0x43')],_0x40efcc,_0x26eaa2[_0x16f1('0x3c')])),'headers':{'Authorization':_0x16f1('0x14')+_0x12d18a,'OData-Version':_0x16f1('0x15')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x21c241);})[_0x16f1('0xf')](function(_0x3db7f9){var _0x230212=_0x3db7f9[_0x16f1('0x48')]['odata-entityid'];var _0x32a05b=_0x230212['substring'](_0x230212[_0x16f1('0x29')]('(')+0x1,_0x230212[_0x16f1('0x29')](')'));_0x5145a8['ticketId']=_0x32a05b;_0x31b077(_0x5145a8);})[_0x16f1('0x10')](function(_0x15f4b4){_0x3b7976(_0x15f4b4[_0x16f1('0x21')]);});});}function emit(_0x592d15,_0x2bf948,_0x54f7ae,_0x5e77e5){var _0x930c6e={'uri':util['format'](_0x16f1('0x49'),_0x592d15,_0x54f7ae,_0x5e77e5)};io['to'](util[_0x16f1('0x4a')](_0x16f1('0x4b'),_0x2bf948))[_0x16f1('0x4c')](_0x16f1('0x4d'),_0x930c6e);}exports['cs']=function(_0x786a40,_0x4a67fb,_0x44b6b9,_0x27d223,_0x59ef11,_0x45af0e,_0x131052,_0x1bf0cc){var _0x58baff={};_0x45af0e['remoteUri']=intUtil[_0x16f1('0x4e')](_0x45af0e[_0x16f1('0xb')]);_0x45af0e[_0x16f1('0x4f')]=intUtil[_0x16f1('0x4e')](_0x45af0e[_0x16f1('0x4f')]);_0x58baff['callDirection']=_0x1bf0cc===_0x16f1('0x50')||_0x1bf0cc===_0x16f1('0x51')?'queue':'outbound';var _0x3f82cd=util['format'](_0x16f1('0x52'),_0x45af0e[_0x16f1('0xb')]);var _0x3763be=util[_0x16f1('0x4a')](_0x16f1('0x53'),_0x45af0e[_0x16f1('0x54')]);var _0x3d8767=util[_0x16f1('0x4a')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x45af0e[_0x16f1('0x4f')],_0x4a67fb[_0x16f1('0x55')],md5(_0x4a67fb['uniqueid']));if(_0x59ef11&&_0x59ef11['monitor_format']){logger[_0x16f1('0x1c')](_0x16f1('0x56'),'Recording\x20is\x20enabled!');_0x4a67fb[_0x16f1('0x57')]=_0x3d8767;}else if(_0x131052&&_0x131052[_0x16f1('0x58')]&&_0x131052['recordingFormat']!==_0x16f1('0x59')){logger[_0x16f1('0x1c')](_0x16f1('0x5a'),_0x16f1('0x5b'));_0x4a67fb[_0x16f1('0x57')]=_0x3d8767;}else{_0x4a67fb['recordingURL']='';}return getUser(_0x58baff,_0x45af0e,_0x27d223,_0x3763be,_0x3f82cd,_0x1bf0cc)['then'](function(_0x3fc1fe){logger[_0x16f1('0x1c')]('['+_0x1bf0cc['toUpperCase']()+']\x20The\x20User\x20ID\x20is:',_0x3fc1fe[_0x16f1('0x1f')]);logger[_0x16f1('0x1c')]('['+_0x1bf0cc[_0x16f1('0x1d')]()+']\x20The\x20User\x20email\x20is:',_0x3fc1fe[_0x16f1('0x19')]);return getEndUser(_0x3fc1fe,_0x45af0e,_0x3763be,_0x3f82cd,_0x4a67fb,_0x1bf0cc);})['then'](function(_0x266a0b){logger[_0x16f1('0x1c')]('['+_0x1bf0cc[_0x16f1('0x1d')]()+_0x16f1('0x5c'),_0x266a0b[_0x16f1('0x2a')]);logger[_0x16f1('0x1c')]('['+_0x1bf0cc[_0x16f1('0x1d')]()+_0x16f1('0x5d'),_0x4a67fb[_0x16f1('0x25')]);return getTicket(_0x266a0b,_0x45af0e,_0x3763be,_0x3f82cd,_0x4a67fb,_0x44b6b9,_0x1bf0cc);})['then'](function(_0x820a98){logger[_0x16f1('0x1c')](util[_0x16f1('0x4a')]('['+_0x1bf0cc[_0x16f1('0x1d')]()+_0x16f1('0x5e'),_0x44b6b9[_0x16f1('0x3c')],_0x820a98[_0x16f1('0x5f')]));logger['info'](util['format']('['+_0x1bf0cc['toUpperCase']()+_0x16f1('0x60'),_0x1bf0cc));if(_0x1bf0cc!=='unmanaged'){logger[_0x16f1('0x1c')]('['+_0x1bf0cc['toUpperCase']()+']',_0x16f1('0x61'));emit(_0x45af0e[_0x16f1('0xb')],_0x27d223['name'],_0x44b6b9[_0x16f1('0x3c')],_0x820a98[_0x16f1('0x5f')]);}})[_0x16f1('0x10')](function(_0x5d8574){logger['error']('['+_0x1bf0cc[_0x16f1('0x1d')]()+_0x16f1('0x62'),util['inspect'](_0x5d8574,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x61f6=[']\x20The\x20%s\x20ID\x20is:\x20%s','ticketId',']\x20Call\x20direction:\x20%s','name','inspect','lodash','bluebird','request-promise','util','./util','md5','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','defaults','redis','localhost','socket.io-emitter','password','clientSecret','then','catch','error','toUpperCase',']\x20Wrong\x20credentials!','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','isNil','userEmail','email','length','isdisabled','systemuserid','userId','info',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','username','toLowerCase','outbound','destcalleridnum','calleridnum','POST','contacts','/systemusers(','headers','substring','lastIndexOf','enduserId','%2b','contactid',']\x20Enduser\x20created!','forEach','includes','string','nameField','customField','indexOf','content','ticketType','incident','assign','getString','Subjects','/contacts(','Fields','phonecall','phonecalls','Descriptions','queue','callDirection','odata-entityid','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','emit','trigger:browser:url','stripTrailingSlash','remoteUri','serverUrl','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','none','[OUTBOUND]','Recording\x20is\x20enabled!','recordingURL',']\x20The\x20User\x20ID\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:'];(function(_0x234e1a,_0x500d79){var _0x55aad2=function(_0x272396){while(--_0x272396){_0x234e1a['push'](_0x234e1a['shift']());}};_0x55aad2(++_0x500d79);}(_0x61f6,0x128));var _0x661f=function(_0x4a80f6,_0x3d43ad){_0x4a80f6=_0x4a80f6-0x0;var _0x5bc762=_0x61f6[_0x4a80f6];return _0x5bc762;};'use strict';var _=require(_0x661f('0x0'));var BPromise=require(_0x661f('0x1'));var rp=require(_0x661f('0x2'));var util=require(_0x661f('0x3'));var intUtil=require(_0x661f('0x4'));var md5=require(_0x661f('0x5'));var Redis=require(_0x661f('0x6'));var logger=require(_0x661f('0x7'))(_0x661f('0x8'));var config=require(_0x661f('0x9'));config['redis']=_[_0x661f('0xa')](config[_0x661f('0xb')],{'host':_0x661f('0xc'),'port':0x18eb});var io=require(_0x661f('0xd'))(new Redis(config[_0x661f('0xb')]));function getAuthToken(_0xb54801,_0x210e1d,_0x239efd){var _0x3d6342={'method':'POST','uri':_0x210e1d,'form':{'client_id':_0xb54801['clientId'],'resource':_0xb54801['remoteUri'],'username':_0xb54801['username'],'password':_0xb54801[_0x661f('0xe')],'grant_type':'password','client_secret':_0xb54801[_0x661f('0xf')]},'json':!![]};return rp(_0x3d6342)[_0x661f('0x10')](function(_0x28e122){return _0x28e122['access_token'];})[_0x661f('0x11')](function(_0x3f6d1c){logger[_0x661f('0x12')]('['+[_0x239efd[_0x661f('0x13')]()]+_0x661f('0x14'));return _0x3f6d1c[_0x661f('0x15')];});}function getUser(_0x9a2d63,_0x1850f8,_0x10c392,_0x5c8589,_0xfe4232,_0x1332dd){return new BPromise(function(_0x3afc24,_0x447287){return getAuthToken(_0x1850f8,_0x5c8589,_0x1332dd)[_0x661f('0x10')](function(_0x21dab2){var _0x2a5135={'method':_0x661f('0x16'),'uri':_0xfe4232+_0x661f('0x17'),'headers':{'Authorization':_0x661f('0x18')+_0x21dab2,'OData-Version':_0x661f('0x19')},'json':!![]};return rp(_0x2a5135);})[_0x661f('0x10')](function(_0x1134e7){var _0x23eb26=_0x1134e7[_0x661f('0x1a')];var _0x307121=![];var _0x362fc1=null;if(!_[_0x661f('0x1b')](_0x10c392)){if(intUtil['validateEmail'](_0x10c392['email'])){_0x9a2d63[_0x661f('0x1c')]=_0x10c392[_0x661f('0x1d')];for(_0x362fc1=0x0;_0x362fc1<_0x23eb26[_0x661f('0x1e')];_0x362fc1++){if(_0x23eb26[_0x362fc1]['internalemailaddress']===_0x10c392[_0x661f('0x1d')]&&!_0x23eb26[_0x362fc1][_0x661f('0x1f')]){_0x307121=!![];logger['info']('['+[_0x1332dd[_0x661f('0x13')]()]+']\x20Agent\x20found\x20'+_0x23eb26[_0x362fc1][_0x661f('0x20')]+'!');_0x9a2d63[_0x661f('0x21')]=_0x23eb26[_0x362fc1]['systemuserid'];}}}}if(!_0x307121){logger[_0x661f('0x22')]('['+[_0x1332dd[_0x661f('0x13')]()]+_0x661f('0x23'));_0x9a2d63['userEmail']=_0x1850f8[_0x661f('0x24')];for(_0x362fc1=0x0;_0x362fc1<_0x23eb26['length'];_0x362fc1++){if(_0x23eb26[_0x362fc1]['internalemailaddress']===_0x1850f8[_0x661f('0x24')]){_0x9a2d63[_0x661f('0x21')]=_0x23eb26[_0x362fc1][_0x661f('0x20')];}}}_0x3afc24(_0x9a2d63);})[_0x661f('0x11')](function(_0x1d47a0){_0x447287(_0x1d47a0[_0x661f('0x15')]);});});}function createEndUser(_0x51d4a5,_0x4e2229,_0x127d4b,_0x12fd1b,_0x3c31c9,_0x5bc28a){return new BPromise(function(_0x54cc0d,_0x1f4c12){return getAuthToken(_0x4e2229,_0x127d4b,_0x5bc28a)[_0x661f('0x10')](function(_0x728587){var _0x40a52f=_0x5bc28a[_0x661f('0x25')]()===_0x661f('0x26')?_0x3c31c9[_0x661f('0x27')]:_0x3c31c9[_0x661f('0x28')];var _0x49bc06={'method':_0x661f('0x29'),'uri':_0x12fd1b+_0x661f('0x2a'),'body':{'telephone1':_0x40a52f,'fullname':_0x40a52f,'firstname':_0x40a52f,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x661f('0x2b')+_0x51d4a5[_0x661f('0x21')]+')'},'headers':{'Authorization':_0x661f('0x18')+_0x728587,'OData-Version':_0x661f('0x19')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x49bc06);})[_0x661f('0x10')](function(_0x2e6e0f){var _0x4fe61e=_0x2e6e0f[_0x661f('0x2c')]['odata-entityid'];var _0x2df724=_0x4fe61e[_0x661f('0x2d')](_0x4fe61e['lastIndexOf']('(')+0x1,_0x4fe61e[_0x661f('0x2e')](')'));_0x51d4a5[_0x661f('0x2f')]=_0x2df724;_0x54cc0d(_0x51d4a5);})[_0x661f('0x11')](function(_0x565bc2){_0x1f4c12(_0x565bc2['message']);});});}function getEndUser(_0x499513,_0x57977e,_0x4ea922,_0x36a30c,_0x190207,_0x9c58ea){return new BPromise(function(_0x3fc80d,_0x3ac8eb){var _0x46268d=_0x9c58ea[_0x661f('0x25')]()===_0x661f('0x26')?_0x190207[_0x661f('0x27')]:_0x190207[_0x661f('0x28')];return getAuthToken(_0x57977e,_0x4ea922,_0x9c58ea)[_0x661f('0x10')](function(_0x340d91){var _0x15f232={'method':'GET','uri':_0x36a30c+'contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27'+_0x46268d['replace']('+',_0x661f('0x30'))+'\x27','headers':{'Authorization':'Bearer\x20'+_0x340d91,'If-None-Match':null,'OData-Version':_0x661f('0x19')},'json':!![]};return rp(_0x15f232);})[_0x661f('0x10')](function(_0x44fec0){var _0x28940a=null;if(_0x44fec0){var _0x37e22b=_0x44fec0['value'];var _0x27abfe=![];for(_0x28940a=0x0;_0x28940a<_0x37e22b[_0x661f('0x1e')];_0x28940a++){if(_0x37e22b[_0x28940a]['telephone1']===_0x46268d){_0x27abfe=!![];_0x499513[_0x661f('0x2f')]=_0x37e22b[_0x28940a][_0x661f('0x31')];}}if(_0x27abfe){_0x3fc80d(_0x499513);}else{return createEndUser(_0x499513,_0x57977e,_0x4ea922,_0x36a30c,_0x190207,_0x9c58ea)[_0x661f('0x10')](function(_0x46ba4d){logger[_0x661f('0x22')]('['+[_0x9c58ea['toUpperCase']()]+_0x661f('0x32'),_0x46ba4d['enduserId']);_0x3fc80d(_0x46ba4d);});}}else{return createEndUser(_0x499513,_0x57977e,_0x4ea922,_0x36a30c,_0x190207,_0x9c58ea)[_0x661f('0x10')](function(_0x837607){logger[_0x661f('0x22')]('['+[_0x9c58ea[_0x661f('0x13')]()]+']\x20Enduser\x20Created!',_0x837607[_0x661f('0x2f')]);_0x3fc80d(_0x837607);});}});});}function getCustomFields(_0x123853,_0x1f4594,_0xe284c2){var _0xcc374e={};if(_0x123853[_0x661f('0x1e')]>0x0){_[_0x661f('0x33')](_0x123853,function(_0x24ee33){if(_[_0x661f('0x34')]([_0x661f('0x35'),'picklist'],_0x24ee33['type'])&&_0x24ee33[_0x661f('0x36')]&&!_0x24ee33[_0x661f('0x37')]){var _0x1ecefc=_0x24ee33['idField'][_0x661f('0x25')]();var _0x1ecc74=_0x1ecefc[_0x661f('0x2d')](0x0,_0x1ecefc[_0x661f('0x38')]('_'));var _0x6534ea=_0x1ecefc[_0x661f('0x2d')](_0x1ecefc['indexOf']('_')+0x1);if(_0x1ecc74===_0xe284c2){_0xcc374e[_0x6534ea]=_0x24ee33[_0x661f('0x39')];}}});}return _0xcc374e;}function getTicket(_0x4a6e41,_0x146394,_0x59fef1,_0x455172,_0x5cac7f,_0x590953,_0x1f2ba7){return new BPromise(function(_0x5163ef,_0x5f4bd1){var _0x1ac99c;return getAuthToken(_0x146394,_0x59fef1,_0x1f2ba7)['then'](function(_0x5eb97b){if(_0x590953[_0x661f('0x3a')]===_0x661f('0x3b')){_0x1ac99c={'method':_0x661f('0x29'),'uri':_0x455172+'incidents','body':Object[_0x661f('0x3c')]({},{'title':intUtil[_0x661f('0x3d')](_0x590953[_0x661f('0x3e')],_0x5cac7f,'\x20'),'description':intUtil['getString'](_0x590953['Descriptions'],_0x5cac7f,'\x0a'),'customerid_contact@odata.bind':_0x661f('0x3f')+_0x4a6e41['enduserId']+')','ownerid@odata.bind':_0x661f('0x2b')+_0x4a6e41[_0x661f('0x21')]+')','caseorigincode':'1'},getCustomFields(_0x590953[_0x661f('0x40')],_0x5cac7f,_0x590953[_0x661f('0x3a')])),'headers':{'Authorization':_0x661f('0x18')+_0x5eb97b,'OData-Version':_0x661f('0x19')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x590953[_0x661f('0x3a')]===_0x661f('0x41')){_0x1ac99c={'method':'POST','uri':_0x455172+_0x661f('0x42'),'body':Object[_0x661f('0x3c')]({},{'subject':intUtil[_0x661f('0x3d')](_0x590953[_0x661f('0x3e')],_0x5cac7f,'\x20'),'phonenumber':String(_0x5cac7f[_0x661f('0x28')]),'description':intUtil[_0x661f('0x3d')](_0x590953[_0x661f('0x43')],_0x5cac7f,'\x0a'),'regardingobjectid_contact@odata.bind':_0x661f('0x3f')+_0x4a6e41['enduserId']+')','ownerid@odata.bind':_0x661f('0x2b')+_0x4a6e41[_0x661f('0x21')]+')','directioncode':_0x4a6e41['callDirection']===_0x661f('0x44')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0x661f('0x2b')+_0x4a6e41[_0x661f('0x21')]+')','participationtypemask':_0x4a6e41['callDirection']==='queue'?0x2:0x1},{'partyid_contact@odata.bind':_0x661f('0x3f')+_0x4a6e41[_0x661f('0x2f')]+')','participationtypemask':_0x4a6e41[_0x661f('0x45')]==='queue'?0x1:0x2}]},getCustomFields(_0x590953[_0x661f('0x40')],_0x5cac7f,_0x590953[_0x661f('0x3a')])),'headers':{'Authorization':'Bearer\x20'+_0x5eb97b,'OData-Version':_0x661f('0x19')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x1ac99c);})['then'](function(_0x4b22de){var _0x16d872=_0x4b22de[_0x661f('0x2c')][_0x661f('0x46')];var _0x1419bd=_0x16d872[_0x661f('0x2d')](_0x16d872[_0x661f('0x2e')]('(')+0x1,_0x16d872['lastIndexOf'](')'));_0x4a6e41['ticketId']=_0x1419bd;_0x5163ef(_0x4a6e41);})[_0x661f('0x11')](function(_0x6a5bff){_0x5f4bd1(_0x6a5bff[_0x661f('0x15')]);});});}function emit(_0x148c48,_0x2b44e8,_0x5cb68e,_0x2f1f41){var _0x48539e={'uri':util[_0x661f('0x47')](_0x661f('0x48'),_0x148c48,_0x5cb68e,_0x2f1f41)};io['to'](util[_0x661f('0x47')]('user:%s',_0x2b44e8))[_0x661f('0x49')](_0x661f('0x4a'),_0x48539e);}exports['cs']=function(_0x443080,_0x1d724b,_0x221608,_0x4f815d,_0x18655b,_0x28c530,_0x33122e,_0x2c19ea){var _0x277c34={};_0x28c530['remoteUri']=intUtil[_0x661f('0x4b')](_0x28c530[_0x661f('0x4c')]);_0x28c530[_0x661f('0x4d')]=intUtil[_0x661f('0x4b')](_0x28c530[_0x661f('0x4d')]);_0x277c34[_0x661f('0x45')]=_0x2c19ea===_0x661f('0x44')||_0x2c19ea===_0x661f('0x4e')?_0x661f('0x44'):_0x661f('0x26');var _0x16a5a4=util[_0x661f('0x47')](_0x661f('0x4f'),_0x28c530[_0x661f('0x4c')]);var _0x23ec63=util[_0x661f('0x47')](_0x661f('0x50'),_0x28c530[_0x661f('0x51')]);var _0x231d20=util[_0x661f('0x47')](_0x661f('0x52'),_0x28c530['serverUrl'],_0x1d724b[_0x661f('0x53')],md5(_0x1d724b[_0x661f('0x53')]));if(_0x18655b&&_0x18655b[_0x661f('0x54')]){logger[_0x661f('0x22')]('[QUEUE]','Recording\x20is\x20enabled!');_0x1d724b['recordingURL']=_0x231d20;}else if(_0x33122e&&_0x33122e['recordingFormat']&&_0x33122e['recordingFormat']!==_0x661f('0x55')){logger[_0x661f('0x22')](_0x661f('0x56'),_0x661f('0x57'));_0x1d724b[_0x661f('0x58')]=_0x231d20;}else{_0x1d724b[_0x661f('0x58')]='';}return getUser(_0x277c34,_0x28c530,_0x4f815d,_0x23ec63,_0x16a5a4,_0x2c19ea)[_0x661f('0x10')](function(_0x497e40){logger[_0x661f('0x22')]('['+_0x2c19ea[_0x661f('0x13')]()+_0x661f('0x59'),_0x497e40[_0x661f('0x21')]);logger[_0x661f('0x22')]('['+_0x2c19ea[_0x661f('0x13')]()+']\x20The\x20User\x20email\x20is:',_0x497e40[_0x661f('0x1c')]);return getEndUser(_0x497e40,_0x28c530,_0x23ec63,_0x16a5a4,_0x1d724b,_0x2c19ea);})[_0x661f('0x10')](function(_0x5d62dd){logger[_0x661f('0x22')]('['+_0x2c19ea['toUpperCase']()+_0x661f('0x5a'),_0x5d62dd[_0x661f('0x2f')]);logger[_0x661f('0x22')]('['+_0x2c19ea[_0x661f('0x13')]()+_0x661f('0x5b'),_0x1d724b[_0x661f('0x28')]);return getTicket(_0x5d62dd,_0x28c530,_0x23ec63,_0x16a5a4,_0x1d724b,_0x221608,_0x2c19ea);})[_0x661f('0x10')](function(_0x33e2de){logger[_0x661f('0x22')](util[_0x661f('0x47')]('['+_0x2c19ea[_0x661f('0x13')]()+_0x661f('0x5c'),_0x221608[_0x661f('0x3a')],_0x33e2de[_0x661f('0x5d')]));logger[_0x661f('0x22')](util[_0x661f('0x47')]('['+_0x2c19ea['toUpperCase']()+_0x661f('0x5e'),_0x2c19ea));if(_0x2c19ea!==_0x661f('0x4e')){logger['info']('['+_0x2c19ea['toUpperCase']()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x28c530[_0x661f('0x4c')],_0x4f815d[_0x661f('0x5f')],_0x221608[_0x661f('0x3a')],_0x33e2de[_0x661f('0x5d')]);}})[_0x661f('0x11')](function(_0x3ab411){logger[_0x661f('0x12')]('['+_0x2c19ea['toUpperCase']()+']\x20Error\x20running\x20Dynamics365\x20integration',util[_0x661f('0x60')](_0x3ab411,{'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 71fe575..0ec446c 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 _0x4d6e=['calleridname','calleridnum','getString','Subjects','Descriptions','
','name','Fields','custom_fields','mapValues','keyBy','%s/api/v2/tickets','remoteUri','POST','Ticket\x20created!','validateEmail','%s/api/v2/agents','then','Agent\x20found!','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','apiKey','toString','base64','debug','[HTTP]','stringify','GET','length','forEach','includes','string','type','nameField','toLowerCase','content','picklist','idField','customField','push','variable','variableName','customVariable','Variable','queue','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','Authorization','The\x20User\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','catch','outbound','recordingFormat','none','[OUTBOUND]','uniqueid','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','error','unmanaged','lastevent','toUpperCase','lodash','request-promise','md5','util','./util','../../../../config/environment','../../../../config/logger','freshdesk','defaults','redis','socket.io-emitter','application/json','emit','info','merge','format','Caller\x20-\x20%s'];(function(_0x59909d,_0x25cc06){var _0x294710=function(_0x144d71){while(--_0x144d71){_0x59909d['push'](_0x59909d['shift']());}};_0x294710(++_0x25cc06);}(_0x4d6e,0xb3));var _0xe4d6=function(_0x338338,_0x782573){_0x338338=_0x338338-0x0;var _0x3cf852=_0x4d6e[_0x338338];return _0x3cf852;};'use strict';var _=require(_0xe4d6('0x0'));var rp=require(_0xe4d6('0x1'));var md5=require(_0xe4d6('0x2'));var util=require(_0xe4d6('0x3'));var Redis=require('ioredis');var intUtil=require(_0xe4d6('0x4'));var config=require(_0xe4d6('0x5'));var logger=require(_0xe4d6('0x6'))(_0xe4d6('0x7'));config['redis']=_[_0xe4d6('0x8')](config[_0xe4d6('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0xe4d6('0xa'))(new Redis(config[_0xe4d6('0x9')]));var headers={'Content-Type':_0xe4d6('0xb'),'Accept':_0xe4d6('0xb')};function emit(_0x39a776,_0x2c59d8,_0x31be72){io['to'](_0x39a776)[_0xe4d6('0xc')](_0x2c59d8,_0x31be72);}function getTicket(_0x3e7ddd,_0xf14e2e,_0x3f3bd1,_0x3c6ddd,_0x445ab3){logger[_0xe4d6('0xd')]('Creating\x20new\x20ticket...');var _0x525cec=_[_0xe4d6('0xe')]({'responder_id':_0xf14e2e['id'],'requester_id':_0x3f3bd1['id'],'name':util[_0xe4d6('0xf')](_0xe4d6('0x10'),_0x445ab3[_0xe4d6('0x11')]),'phone':_0x445ab3[_0xe4d6('0x12')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xe4d6('0x13')](_0x3c6ddd[_0xe4d6('0x14')],_0x445ab3,'\x20'),'description':intUtil[_0xe4d6('0x13')](_0x3c6ddd[_0xe4d6('0x15')],_0x445ab3,_0xe4d6('0x16')),'tags':getTags(_0x3c6ddd['Tags'],_0xe4d6('0x17'))},getCustomFields(_0x3c6ddd[_0xe4d6('0x18')],_0x445ab3));_0x525cec[_0xe4d6('0x19')]=_[_0xe4d6('0x1a')](_[_0xe4d6('0x1b')](_0x525cec[_0xe4d6('0x19')],'id'),'value');return request({'uri':util[_0xe4d6('0xf')](_0xe4d6('0x1c'),_0x3e7ddd[_0xe4d6('0x1d')]),'method':_0xe4d6('0x1e'),'body':_0x525cec})['then'](function(_0x90439e){logger[_0xe4d6('0xd')](_0xe4d6('0x1f'));return _0x90439e;});}function getUser(_0x158544,_0x4b8012){if(intUtil[_0xe4d6('0x20')](_0x4b8012)){return request({'uri':util[_0xe4d6('0xf')](_0xe4d6('0x21'),_0x158544['remoteUri']),'qs':{'email':_0x4b8012}})[_0xe4d6('0x22')](function(_0x3a1c9d){if(_0x3a1c9d['length']){logger[_0xe4d6('0xd')](_0xe4d6('0x23'));return _[_0xe4d6('0x24')](_0x3a1c9d,function(_0x535bfd){return _0x535bfd[_0xe4d6('0x25')][_0xe4d6('0x26')]===_0x4b8012;});}else{logger['info'](_0xe4d6('0x27'));return request({'uri':util[_0xe4d6('0xf')](_0xe4d6('0x28'),_0x158544['remoteUri'])})['then'](function(_0x118559){logger[_0xe4d6('0xd')](_0xe4d6('0x29'));return _0x118559;});}});}else{logger['info'](_0xe4d6('0x2a'));return request({'uri':util[_0xe4d6('0xf')]('%s/api/v2/agents/me',_0x158544[_0xe4d6('0x1d')])})[_0xe4d6('0x22')](function(_0x4af0ca){logger[_0xe4d6('0xd')](_0xe4d6('0x29'));return _0x4af0ca;});}}function getEndUser(_0x2dbecf,_0x10d8e6,_0x7fe060){logger[_0xe4d6('0xd')](_0xe4d6('0x2b'),_0x7fe060);return request({'uri':util[_0xe4d6('0xf')](_0xe4d6('0x2c'),_0x2dbecf[_0xe4d6('0x1d')]),'qs':{'phone':_0x7fe060}})['then'](function(_0x29a5fe){if(_0x29a5fe['length']){logger[_0xe4d6('0xd')]('Enduser\x20found!');return _['find'](_0x29a5fe,{'phone':_0x7fe060});}else{logger[_0xe4d6('0xd')](_0xe4d6('0x2d'));return request({'uri':util['format'](_0xe4d6('0x2c'),_0x2dbecf[_0xe4d6('0x1d')]),'method':_0xe4d6('0x1e'),'body':{'name':_0x10d8e6,'phone':_0x7fe060}})[_0xe4d6('0x22')](function(_0x17311e){logger[_0xe4d6('0xd')](_0xe4d6('0x2e'));return _0x17311e;});}});}function getAuth(_0x8d11e3){return util[_0xe4d6('0xf')]('Basic\x20%s',new Buffer(_0x8d11e3[_0xe4d6('0x2f')]+':X')[_0xe4d6('0x30')](_0xe4d6('0x31')));}function request(_0x45936d){logger[_0xe4d6('0x32')](_0xe4d6('0x33'),JSON[_0xe4d6('0x34')](_0x45936d));return rp(_[_0xe4d6('0x8')](_0x45936d,{'method':_0xe4d6('0x35'),'headers':headers,'json':!![]}));}function getTags(_0x124f2e,_0x153695){var _0x12d245=[];if(_0x124f2e&&_0x124f2e['length']>0x0){_0x12d245=_['map'](_0x124f2e,_0x153695);}return _0x12d245;}function getCustomFields(_0x170669,_0x42953e){var _0x14eb9e=[];var _0x4063ef={'custom_fields':[]};if(_0x170669[_0xe4d6('0x36')]>0x0){_[_0xe4d6('0x37')](_0x170669,function(_0x3525f1){if(_[_0xe4d6('0x38')]([_0xe4d6('0x39'),'picklist'],_0x3525f1[_0xe4d6('0x3a')])&&_0x3525f1[_0xe4d6('0x3b')]&&!_0x3525f1['customField']){_0x4063ef[_0x3525f1[_0xe4d6('0x3b')][_0xe4d6('0x3c')]()]=_0x3525f1[_0xe4d6('0x3d')][_0xe4d6('0x30')]();}else if(_[_0xe4d6('0x38')]([_0xe4d6('0x39'),_0xe4d6('0x3e')],_0x3525f1[_0xe4d6('0x3a')])&&_0x3525f1[_0xe4d6('0x3f')]&&_0x3525f1[_0xe4d6('0x40')]){_0x4063ef[_0xe4d6('0x19')][_0xe4d6('0x41')]({'id':_0x3525f1['idField'],'value':_0x3525f1[_0xe4d6('0x3d')][_0xe4d6('0x30')]()});}else if(_0x3525f1[_0xe4d6('0x3a')]===_0xe4d6('0x42')&&_0x3525f1['variableName']&&_0x3525f1['idField']&&_0x3525f1[_0xe4d6('0x40')]){_0x42953e[_0x3525f1[_0xe4d6('0x43')]]&&_0x4063ef[_0xe4d6('0x19')]['push']({'id':_0x3525f1['idField'],'value':_0x42953e[_0x3525f1[_0xe4d6('0x43')]][_0xe4d6('0x30')]()});}else if(_0x3525f1[_0xe4d6('0x3a')]===_0xe4d6('0x44')&&_0x3525f1[_0xe4d6('0x45')]&&_0x3525f1['Variable'][_0xe4d6('0x17')]&&_0x3525f1[_0xe4d6('0x3f')]&&_0x3525f1[_0xe4d6('0x40')]){_0x42953e[_0x3525f1[_0xe4d6('0x45')]['name'][_0xe4d6('0x3c')]()]&&_0x4063ef['custom_fields'][_0xe4d6('0x41')]({'id':_0x3525f1[_0xe4d6('0x3f')],'value':_0x42953e[_0x3525f1[_0xe4d6('0x45')][_0xe4d6('0x17')][_0xe4d6('0x3c')]()]['toString']()});}});}return _0x4063ef;}exports[_0xe4d6('0x46')]=function(_0x3b18d2,_0x3d02f8,_0x58eb1f,_0x460e38,_0x4c7185,_0x49a81c){var _0x26cf5e,_0x41d6bf;_0x49a81c[_0xe4d6('0x1d')]=intUtil[_0xe4d6('0x47')](_0x49a81c[_0xe4d6('0x1d')]);_0x49a81c['serverUrl']=intUtil['stripTrailingSlash'](_0x49a81c['serverUrl']);if(_0x4c7185&&_0x4c7185[_0xe4d6('0x48')]){logger[_0xe4d6('0xd')](_0xe4d6('0x49'),_0xe4d6('0x4a'));_0x3d02f8[_0xe4d6('0x4b')]=util[_0xe4d6('0xf')](_0xe4d6('0x4c'),_0x49a81c[_0xe4d6('0x4d')],_0x3d02f8['uniqueid'],md5(_0x3d02f8['uniqueid']));}else{_0x3d02f8[_0xe4d6('0x4b')]='';}headers[_0xe4d6('0x4e')]=getAuth(_0x49a81c);return getUser(_0x49a81c,_0x460e38[_0xe4d6('0x26')])[_0xe4d6('0x22')](function(_0x1cb401){_0x26cf5e=_0x1cb401;logger['info'](_0xe4d6('0x4f'),_0x26cf5e['id']);return getEndUser(_0x49a81c,_0x3d02f8[_0xe4d6('0x11')],_0x3d02f8['calleridnum']);})['then'](function(_0x4216bf){_0x41d6bf=_0x4216bf;logger[_0xe4d6('0xd')]('The\x20Enduser\x20ID\x20is:',_0x41d6bf['id']);return getTicket(_0x49a81c,_0x26cf5e,_0x41d6bf,_0x58eb1f,_0x3d02f8);})[_0xe4d6('0x22')](function(_0x390501){if(_0x390501&&_0x390501['id']){logger['info'](_0xe4d6('0x1f'));logger[_0xe4d6('0xd')](_0xe4d6('0x50'),_0x390501['id']);logger[_0xe4d6('0xd')](_0xe4d6('0x49'),_0xe4d6('0x51'));emit(util[_0xe4d6('0xf')](_0xe4d6('0x52'),_0x460e38[_0xe4d6('0x17')]),_0xe4d6('0x53'),{'uri':util[_0xe4d6('0xf')](_0xe4d6('0x54'),_0x49a81c[_0xe4d6('0x1d')],_0x390501['id'])});}})[_0xe4d6('0x55')](function(_0x1f2b65){logger['error'](_0xe4d6('0x49'),JSON[_0xe4d6('0x34')](_0x1f2b65));});};exports[_0xe4d6('0x56')]=function(_0x3e8f36,_0x215a59,_0x5b8651,_0x55a28f,_0x228716,_0x22f4d7,_0x567129){var _0x12becf,_0x4cb739;_0x22f4d7[_0xe4d6('0x1d')]=intUtil['stripTrailingSlash'](_0x22f4d7[_0xe4d6('0x1d')]);_0x22f4d7[_0xe4d6('0x4d')]=intUtil[_0xe4d6('0x47')](_0x22f4d7[_0xe4d6('0x4d')]);if(_0x567129&&_0x567129['recordingFormat']&&_0x567129[_0xe4d6('0x57')]!==_0xe4d6('0x58')){logger[_0xe4d6('0xd')](_0xe4d6('0x59'),_0xe4d6('0x4a'));_0x215a59[_0xe4d6('0x4b')]=util[_0xe4d6('0xf')](_0xe4d6('0x4c'),_0x22f4d7['serverUrl'],_0x215a59['uniqueid'],md5(_0x215a59[_0xe4d6('0x5a')]));}headers[_0xe4d6('0x4e')]=getAuth(_0x22f4d7);return getUser(_0x22f4d7,_0x55a28f[_0xe4d6('0x26')])[_0xe4d6('0x22')](function(_0x1ec520){_0x12becf=_0x1ec520;logger[_0xe4d6('0xd')](_0xe4d6('0x4f'),_0x12becf['id']);return getEndUser(_0x22f4d7,_0x215a59[_0xe4d6('0x5b')],_0x215a59[_0xe4d6('0x5c')]);})['then'](function(_0x53c890){_0x4cb739=_0x53c890;logger['info'](_0xe4d6('0x5d'),_0x4cb739['id']);return getTicket(_0x22f4d7,_0x12becf,_0x4cb739,_0x5b8651,_0x215a59);})[_0xe4d6('0x22')](function(_0x44eb05){if(_0x44eb05&&_0x44eb05['id']){logger['info']('Ticket\x20created!');logger[_0xe4d6('0xd')]('The\x20Ticket\x20ID\x20is:',_0x44eb05['id']);logger[_0xe4d6('0xd')]('[OUTBOUND]',_0xe4d6('0x51'));emit(util[_0xe4d6('0xf')](_0xe4d6('0x52'),_0x55a28f[_0xe4d6('0x17')]),_0xe4d6('0x53'),{'uri':util[_0xe4d6('0xf')](_0xe4d6('0x54'),_0x22f4d7[_0xe4d6('0x1d')],_0x44eb05['id'])});}})['catch'](function(_0x9c4a4d){logger[_0xe4d6('0x5e')](_0xe4d6('0x59'),JSON['stringify'](_0x9c4a4d));});};exports[_0xe4d6('0x5f')]=function(_0x371980,_0x2bfd15,_0x37e799,_0x56770c,_0x3bdb20,_0x3eb521){var _0x5688f8,_0x306598;_0x3eb521[_0xe4d6('0x1d')]=intUtil['stripTrailingSlash'](_0x3eb521[_0xe4d6('0x1d')]);_0x3eb521[_0xe4d6('0x4d')]=intUtil['stripTrailingSlash'](_0x3eb521[_0xe4d6('0x4d')]);if(_0x3bdb20&&_0x3bdb20[_0xe4d6('0x48')]){logger[_0xe4d6('0xd')]('['+_0x2bfd15[_0xe4d6('0x60')]['toUpperCase']()+']',_0xe4d6('0x4a'));_0x2bfd15['recordingURL']=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3eb521[_0xe4d6('0x4d')],_0x2bfd15[_0xe4d6('0x5a')],md5(_0x2bfd15[_0xe4d6('0x5a')]));}else{_0x2bfd15[_0xe4d6('0x4b')]='';}headers[_0xe4d6('0x4e')]=getAuth(_0x3eb521);return getUser(_0x3eb521,'')[_0xe4d6('0x22')](function(_0x66169e){_0x5688f8=_0x66169e;logger[_0xe4d6('0xd')](_0xe4d6('0x4f'),_0x5688f8['id']);return getEndUser(_0x3eb521,_0x2bfd15[_0xe4d6('0x11')],_0x2bfd15['calleridnum']);})[_0xe4d6('0x22')](function(_0x37c8b4){_0x306598=_0x37c8b4;logger['info'](_0xe4d6('0x5d'),_0x306598['id']);return getTicket(_0x3eb521,_0x5688f8,_0x306598,_0x37e799,_0x2bfd15);})[_0xe4d6('0x22')](function(_0x5ac55f){if(_0x5ac55f){logger['info']('Ticket\x20created!');logger['info'](_0xe4d6('0x50'),_0x5ac55f['id']);}})[_0xe4d6('0x55')](function(_0x4c5a59){logger['error']('['+_0x2bfd15[_0xe4d6('0x60')][_0xe4d6('0x61')]()+']',JSON[_0xe4d6('0x34')](_0x4c5a59));});}; \ No newline at end of file +var _0x839e=['[OUTBOUND]','destcalleridname','destcalleridnum','unmanaged','lastevent','toUpperCase','lodash','request-promise','util','./util','../../../../config/environment','../../../../config/logger','freshdesk','redis','defaults','localhost','socket.io-emitter','application/json','Caller\x20-\x20%s','calleridname','calleridnum','getString','Descriptions','
','name','Fields','custom_fields','mapValues','keyBy','value','format','remoteUri','info','Ticket\x20created!','%s/api/v2/agents','then','Agent\x20found!','find','contact','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','length','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','apiKey','toString','base64','debug','stringify','GET','forEach','includes','picklist','type','nameField','toLowerCase','content','string','idField','customField','push','variable','variableName','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','error','outbound','recordingFormat','none'];(function(_0x1acb2a,_0x259dd4){var _0x1d991c=function(_0x2f504c){while(--_0x2f504c){_0x1acb2a['push'](_0x1acb2a['shift']());}};_0x1d991c(++_0x259dd4);}(_0x839e,0xba));var _0xe839=function(_0x185334,_0x4630ac){_0x185334=_0x185334-0x0;var _0xf2e59a=_0x839e[_0x185334];return _0xf2e59a;};'use strict';var _=require(_0xe839('0x0'));var rp=require(_0xe839('0x1'));var md5=require('md5');var util=require(_0xe839('0x2'));var Redis=require('ioredis');var intUtil=require(_0xe839('0x3'));var config=require(_0xe839('0x4'));var logger=require(_0xe839('0x5'))(_0xe839('0x6'));config[_0xe839('0x7')]=_[_0xe839('0x8')](config[_0xe839('0x7')],{'host':_0xe839('0x9'),'port':0x18eb});var io=require(_0xe839('0xa'))(new Redis(config[_0xe839('0x7')]));var headers={'Content-Type':_0xe839('0xb'),'Accept':'application/json'};function emit(_0x3c081b,_0x46c691,_0x24717d){io['to'](_0x3c081b)['emit'](_0x46c691,_0x24717d);}function getTicket(_0x22c3e1,_0x2249ba,_0x2d1e12,_0x4f0385,_0x414153){logger['info']('Creating\x20new\x20ticket...');var _0x4c738c=_['merge']({'responder_id':_0x2249ba['id'],'requester_id':_0x2d1e12['id'],'name':util['format'](_0xe839('0xc'),_0x414153[_0xe839('0xd')]),'phone':_0x414153[_0xe839('0xe')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xe839('0xf')](_0x4f0385['Subjects'],_0x414153,'\x20'),'description':intUtil[_0xe839('0xf')](_0x4f0385[_0xe839('0x10')],_0x414153,_0xe839('0x11')),'tags':getTags(_0x4f0385['Tags'],_0xe839('0x12'))},getCustomFields(_0x4f0385[_0xe839('0x13')],_0x414153));_0x4c738c[_0xe839('0x14')]=_[_0xe839('0x15')](_[_0xe839('0x16')](_0x4c738c[_0xe839('0x14')],'id'),_0xe839('0x17'));return request({'uri':util[_0xe839('0x18')]('%s/api/v2/tickets',_0x22c3e1[_0xe839('0x19')]),'method':'POST','body':_0x4c738c})['then'](function(_0x22047a){logger[_0xe839('0x1a')](_0xe839('0x1b'));return _0x22047a;});}function getUser(_0x3345b6,_0x46130b){if(intUtil['validateEmail'](_0x46130b)){return request({'uri':util[_0xe839('0x18')](_0xe839('0x1c'),_0x3345b6[_0xe839('0x19')]),'qs':{'email':_0x46130b}})[_0xe839('0x1d')](function(_0x570cf1){if(_0x570cf1['length']){logger[_0xe839('0x1a')](_0xe839('0x1e'));return _[_0xe839('0x1f')](_0x570cf1,function(_0x4fdccb){return _0x4fdccb[_0xe839('0x20')]['email']===_0x46130b;});}else{logger[_0xe839('0x1a')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format'](_0xe839('0x21'),_0x3345b6[_0xe839('0x19')])})[_0xe839('0x1d')](function(_0x15ed0c){logger[_0xe839('0x1a')](_0xe839('0x22'));return _0x15ed0c;});}});}else{logger['info'](_0xe839('0x23'));return request({'uri':util[_0xe839('0x18')]('%s/api/v2/agents/me',_0x3345b6['remoteUri'])})[_0xe839('0x1d')](function(_0x30c843){logger[_0xe839('0x1a')](_0xe839('0x22'));return _0x30c843;});}}function getEndUser(_0x1eb55d,_0x356d2f,_0x5261b9){logger['info'](_0xe839('0x24'),_0x5261b9);return request({'uri':util[_0xe839('0x18')](_0xe839('0x25'),_0x1eb55d[_0xe839('0x19')]),'qs':{'phone':_0x5261b9}})[_0xe839('0x1d')](function(_0x571ba1){if(_0x571ba1[_0xe839('0x26')]){logger[_0xe839('0x1a')](_0xe839('0x27'));return _[_0xe839('0x1f')](_0x571ba1,{'phone':_0x5261b9});}else{logger[_0xe839('0x1a')](_0xe839('0x28'));return request({'uri':util[_0xe839('0x18')](_0xe839('0x25'),_0x1eb55d[_0xe839('0x19')]),'method':'POST','body':{'name':_0x356d2f,'phone':_0x5261b9}})[_0xe839('0x1d')](function(_0x228b7a){logger[_0xe839('0x1a')](_0xe839('0x29'));return _0x228b7a;});}});}function getAuth(_0x1dbfd9){return util[_0xe839('0x18')]('Basic\x20%s',new Buffer(_0x1dbfd9[_0xe839('0x2a')]+':X')[_0xe839('0x2b')](_0xe839('0x2c')));}function request(_0x45f358){logger[_0xe839('0x2d')]('[HTTP]',JSON[_0xe839('0x2e')](_0x45f358));return rp(_[_0xe839('0x8')](_0x45f358,{'method':_0xe839('0x2f'),'headers':headers,'json':!![]}));}function getTags(_0x14c076,_0x1880f9){var _0x5765bf=[];if(_0x14c076&&_0x14c076[_0xe839('0x26')]>0x0){_0x5765bf=_['map'](_0x14c076,_0x1880f9);}return _0x5765bf;}function getCustomFields(_0x2504e5,_0x4f10f9){var _0x5ccd3f=[];var _0x6cded1={'custom_fields':[]};if(_0x2504e5[_0xe839('0x26')]>0x0){_[_0xe839('0x30')](_0x2504e5,function(_0x9d0b31){if(_[_0xe839('0x31')](['string',_0xe839('0x32')],_0x9d0b31[_0xe839('0x33')])&&_0x9d0b31[_0xe839('0x34')]&&!_0x9d0b31['customField']){_0x6cded1[_0x9d0b31[_0xe839('0x34')][_0xe839('0x35')]()]=_0x9d0b31[_0xe839('0x36')][_0xe839('0x2b')]();}else if(_[_0xe839('0x31')]([_0xe839('0x37'),_0xe839('0x32')],_0x9d0b31[_0xe839('0x33')])&&_0x9d0b31[_0xe839('0x38')]&&_0x9d0b31[_0xe839('0x39')]){_0x6cded1[_0xe839('0x14')][_0xe839('0x3a')]({'id':_0x9d0b31[_0xe839('0x38')],'value':_0x9d0b31[_0xe839('0x36')][_0xe839('0x2b')]()});}else if(_0x9d0b31[_0xe839('0x33')]===_0xe839('0x3b')&&_0x9d0b31['variableName']&&_0x9d0b31['idField']&&_0x9d0b31['customField']){_0x4f10f9[_0x9d0b31['variableName']]&&_0x6cded1[_0xe839('0x14')][_0xe839('0x3a')]({'id':_0x9d0b31[_0xe839('0x38')],'value':_0x4f10f9[_0x9d0b31[_0xe839('0x3c')]][_0xe839('0x2b')]()});}else if(_0x9d0b31[_0xe839('0x33')]==='customVariable'&&_0x9d0b31['Variable']&&_0x9d0b31['Variable']['name']&&_0x9d0b31['idField']&&_0x9d0b31['customField']){_0x4f10f9[_0x9d0b31[_0xe839('0x3d')][_0xe839('0x12')][_0xe839('0x35')]()]&&_0x6cded1[_0xe839('0x14')][_0xe839('0x3a')]({'id':_0x9d0b31['idField'],'value':_0x4f10f9[_0x9d0b31[_0xe839('0x3d')][_0xe839('0x12')]['toLowerCase']()][_0xe839('0x2b')]()});}});}return _0x6cded1;}exports[_0xe839('0x3e')]=function(_0x527056,_0x57fb5b,_0x25bd02,_0x344f14,_0x434a79,_0x45a449){var _0x4f7258,_0x57de4a;_0x45a449[_0xe839('0x19')]=intUtil[_0xe839('0x3f')](_0x45a449[_0xe839('0x19')]);_0x45a449[_0xe839('0x40')]=intUtil[_0xe839('0x3f')](_0x45a449[_0xe839('0x40')]);if(_0x434a79&&_0x434a79[_0xe839('0x41')]){logger[_0xe839('0x1a')](_0xe839('0x42'),_0xe839('0x43'));_0x57fb5b[_0xe839('0x44')]=util[_0xe839('0x18')](_0xe839('0x45'),_0x45a449[_0xe839('0x40')],_0x57fb5b[_0xe839('0x46')],md5(_0x57fb5b[_0xe839('0x46')]));}else{_0x57fb5b['recordingURL']='';}headers[_0xe839('0x47')]=getAuth(_0x45a449);return getUser(_0x45a449,_0x344f14[_0xe839('0x48')])['then'](function(_0x1d76e9){_0x4f7258=_0x1d76e9;logger['info'](_0xe839('0x49'),_0x4f7258['id']);return getEndUser(_0x45a449,_0x57fb5b[_0xe839('0xd')],_0x57fb5b[_0xe839('0xe')]);})['then'](function(_0x3ab907){_0x57de4a=_0x3ab907;logger[_0xe839('0x1a')](_0xe839('0x4a'),_0x57de4a['id']);return getTicket(_0x45a449,_0x4f7258,_0x57de4a,_0x25bd02,_0x57fb5b);})[_0xe839('0x1d')](function(_0x271d1b){if(_0x271d1b&&_0x271d1b['id']){logger[_0xe839('0x1a')](_0xe839('0x1b'));logger[_0xe839('0x1a')](_0xe839('0x4b'),_0x271d1b['id']);logger[_0xe839('0x1a')](_0xe839('0x42'),_0xe839('0x4c'));emit(util[_0xe839('0x18')](_0xe839('0x4d'),_0x344f14[_0xe839('0x12')]),_0xe839('0x4e'),{'uri':util[_0xe839('0x18')](_0xe839('0x4f'),_0x45a449['remoteUri'],_0x271d1b['id'])});}})['catch'](function(_0xbf53e2){logger[_0xe839('0x50')](_0xe839('0x42'),JSON[_0xe839('0x2e')](_0xbf53e2));});};exports[_0xe839('0x51')]=function(_0x4b4acf,_0x16068a,_0x187956,_0x27b79a,_0x94d3cb,_0x18ce26,_0x3023df){var _0x251174,_0x19d1fe;_0x18ce26[_0xe839('0x19')]=intUtil[_0xe839('0x3f')](_0x18ce26[_0xe839('0x19')]);_0x18ce26[_0xe839('0x40')]=intUtil[_0xe839('0x3f')](_0x18ce26['serverUrl']);if(_0x3023df&&_0x3023df[_0xe839('0x52')]&&_0x3023df[_0xe839('0x52')]!==_0xe839('0x53')){logger['info'](_0xe839('0x54'),'Recording\x20is\x20enabled!');_0x16068a['recordingURL']=util[_0xe839('0x18')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x18ce26['serverUrl'],_0x16068a[_0xe839('0x46')],md5(_0x16068a[_0xe839('0x46')]));}headers[_0xe839('0x47')]=getAuth(_0x18ce26);return getUser(_0x18ce26,_0x27b79a[_0xe839('0x48')])[_0xe839('0x1d')](function(_0x48b55f){_0x251174=_0x48b55f;logger[_0xe839('0x1a')](_0xe839('0x49'),_0x251174['id']);return getEndUser(_0x18ce26,_0x16068a[_0xe839('0x55')],_0x16068a[_0xe839('0x56')]);})[_0xe839('0x1d')](function(_0x1daca3){_0x19d1fe=_0x1daca3;logger[_0xe839('0x1a')](_0xe839('0x4a'),_0x19d1fe['id']);return getTicket(_0x18ce26,_0x251174,_0x19d1fe,_0x187956,_0x16068a);})['then'](function(_0x46d819){if(_0x46d819&&_0x46d819['id']){logger['info'](_0xe839('0x1b'));logger['info'](_0xe839('0x4b'),_0x46d819['id']);logger['info'](_0xe839('0x54'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xe839('0x18')](_0xe839('0x4d'),_0x27b79a[_0xe839('0x12')]),_0xe839('0x4e'),{'uri':util[_0xe839('0x18')](_0xe839('0x4f'),_0x18ce26['remoteUri'],_0x46d819['id'])});}})['catch'](function(_0x448aa8){logger[_0xe839('0x50')](_0xe839('0x54'),JSON[_0xe839('0x2e')](_0x448aa8));});};exports[_0xe839('0x57')]=function(_0x2e5e51,_0x3968ee,_0x1282e6,_0x194b29,_0x1560bf,_0x3e0a8e){var _0x4d3749,_0x35d97d;_0x3e0a8e['remoteUri']=intUtil[_0xe839('0x3f')](_0x3e0a8e[_0xe839('0x19')]);_0x3e0a8e[_0xe839('0x40')]=intUtil['stripTrailingSlash'](_0x3e0a8e[_0xe839('0x40')]);if(_0x1560bf&&_0x1560bf[_0xe839('0x41')]){logger[_0xe839('0x1a')]('['+_0x3968ee[_0xe839('0x58')][_0xe839('0x59')]()+']',_0xe839('0x43'));_0x3968ee[_0xe839('0x44')]=util[_0xe839('0x18')](_0xe839('0x45'),_0x3e0a8e[_0xe839('0x40')],_0x3968ee[_0xe839('0x46')],md5(_0x3968ee['uniqueid']));}else{_0x3968ee['recordingURL']='';}headers['Authorization']=getAuth(_0x3e0a8e);return getUser(_0x3e0a8e,'')['then'](function(_0x4ccdcb){_0x4d3749=_0x4ccdcb;logger[_0xe839('0x1a')]('The\x20User\x20ID\x20is:',_0x4d3749['id']);return getEndUser(_0x3e0a8e,_0x3968ee['calleridname'],_0x3968ee[_0xe839('0xe')]);})[_0xe839('0x1d')](function(_0x2bd5dc){_0x35d97d=_0x2bd5dc;logger[_0xe839('0x1a')](_0xe839('0x4a'),_0x35d97d['id']);return getTicket(_0x3e0a8e,_0x4d3749,_0x35d97d,_0x1282e6,_0x3968ee);})[_0xe839('0x1d')](function(_0x59418f){if(_0x59418f){logger[_0xe839('0x1a')](_0xe839('0x1b'));logger[_0xe839('0x1a')](_0xe839('0x4b'),_0x59418f['id']);}})['catch'](function(_0x1d52d1){logger['error']('['+_0x3968ee[_0xe839('0x58')][_0xe839('0x59')]()+']',JSON[_0xe839('0x2e')](_0x1d52d1));});}; \ 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 5db4938..9a90a82 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 _0x6f09=['mobile_number','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20created:','POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','getString','Subjects','Descriptions','Contact','add','ticketId','task','/contacts/','user:%s','emit','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','username','toLowerCase','destcalleridnum','callDirection','queue','unmanaged','outbound','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','request-promise','md5','util','moment','bluebird','ioredis','./util','../../../../config/logger','freshsales','defaults','redis','localhost','socket.io-emitter','GET','/api/selector/owners','headers','info','Getting\x20admin\x20information','users','adminEmail','adminId','Requested\x20Resource\x20not\x20Found','message','then','Getting\x20user\x20with\x20email','agentEmail','userEmail','length','email','userId','User\x20found:','catch','error','toUpperCase','/api/lookup?q=','&f=','&entities=contact','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber'];(function(_0x2c801e,_0x35485f){var _0x214743=function(_0x3d9f2c){while(--_0x3d9f2c){_0x2c801e['push'](_0x2c801e['shift']());}};_0x214743(++_0x35485f);}(_0x6f09,0x1ec));var _0x96f0=function(_0x27f019,_0x55a7f3){_0x27f019=_0x27f019-0x0;var _0x972691=_0x6f09[_0x27f019];return _0x972691;};'use strict';var _=require('lodash');var rp=require(_0x96f0('0x0'));var md5=require(_0x96f0('0x1'));var util=require(_0x96f0('0x2'));var moment=require(_0x96f0('0x3'));var Promise=require(_0x96f0('0x4'));var Redis=require(_0x96f0('0x5'));var intUtil=require(_0x96f0('0x6'));var config=require('../../../../config/environment');var logger=require(_0x96f0('0x7'))(_0x96f0('0x8'));config['redis']=_[_0x96f0('0x9')](config[_0x96f0('0xa')],{'host':_0x96f0('0xb'),'port':0x18eb});var io=require(_0x96f0('0xc'))(new Redis(config[_0x96f0('0xa')]));function getAdminId(_0x4d98ed,_0x53285f,_0x2617e9,_0xa2ecd8){return new Promise(function(_0x3a7056,_0xa14657){var _0x51240d=![];var _0x234123={'method':_0x96f0('0xd'),'uri':_0xa2ecd8+_0x96f0('0xe'),'json':!![]};_0x234123[_0x96f0('0xf')]=_0x2617e9;logger[_0x96f0('0x10')](_0x96f0('0x11'));return rp(_0x234123)['then'](function(_0x524ae9){if(_0x524ae9){var _0x3d1ec1=_0x524ae9[_0x96f0('0x12')];var _0xdb60e9=null;for(_0xdb60e9=0x0;_0xdb60e9<_0x3d1ec1['length'];_0xdb60e9++){if(_0x3d1ec1[_0xdb60e9]['email']===_0x4d98ed[_0x96f0('0x13')]){_0x4d98ed[_0x96f0('0x14')]=_0x3d1ec1[_0xdb60e9]['id'];_0x51240d=!![];}}if(_0x51240d){logger['info']('Admin\x20found:',_0x4d98ed[_0x96f0('0x14')]);_0x3a7056(_0x4d98ed);}else{_0xa14657({'statusCode':0x194,'message':_0x96f0('0x15')});}}else{_0xa14657({'statusCode':0x194,'message':_0x96f0('0x15')});}})['catch'](function(_0x40ca5c){logger['error']('['+[_0x53285f['toUpperCase']()]+']',_0x40ca5c[_0x96f0('0x16')]);_0xa14657(_0x40ca5c);});});}function getUser(_0x100460,_0x27de73,_0x2f27b1){return function(_0x3e73a9){return new Promise(function(_0x513dfc,_0x309be1){var _0x4c0976={'method':_0x96f0('0xd'),'uri':_0x2f27b1+_0x96f0('0xe'),'json':!![]};_0x4c0976[_0x96f0('0xf')]=_0x27de73;logger[_0x96f0('0x10')]('Getting\x20user\x20list');return rp(_0x4c0976)[_0x96f0('0x17')](function(_0x8cafda){if(_0x8cafda){var _0x2490f5=_0x8cafda[_0x96f0('0x12')];var _0x4a74af=![];var _0x934a1e=null;if(_0x3e73a9['agentEmail']!==null){logger['info'](_0x96f0('0x18'),_0x3e73a9[_0x96f0('0x19')]);_0x3e73a9[_0x96f0('0x1a')]=_0x3e73a9[_0x96f0('0x19')];for(_0x934a1e=0x0;_0x934a1e<_0x2490f5[_0x96f0('0x1b')];_0x934a1e++){if(_0x2490f5[_0x934a1e][_0x96f0('0x1c')]===_0x3e73a9['agentEmail']){_0x4a74af=!![];_0x3e73a9[_0x96f0('0x1d')]=_0x2490f5[_0x934a1e]['id'];logger['info'](_0x96f0('0x1e'),_0x3e73a9['userId']);}}}if(!_0x4a74af){logger[_0x96f0('0x10')]('Admin\x20selected');_0x3e73a9[_0x96f0('0x1a')]=_0x3e73a9[_0x96f0('0x13')];_0x3e73a9['userId']=_0x3e73a9['adminId'];_0x4a74af=!![];}if(_0x4a74af){_0x513dfc(_0x3e73a9);}else{_0x309be1({'statusCode':0x194,'message':_0x96f0('0x15')});}}else{_0x309be1({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0x96f0('0x1f')](function(_0x57909c){logger[_0x96f0('0x20')]('['+[_0x100460[_0x96f0('0x21')]()]+']',_0x57909c[_0x96f0('0x16')]);_0x309be1(_0x57909c);});});};}function searchContact(_0x4b1444,_0x4742ba,_0x273a9c,_0x48285c){return new Promise(function(_0x337466,_0x5f538b){var _0xdb9fe6={'method':_0x96f0('0xd'),'headers':_0x4742ba,'uri':_0x4b1444+_0x96f0('0x22')+_0x48285c+_0x96f0('0x23')+_0x273a9c+_0x96f0('0x24'),'json':!![]};rp(_0xdb9fe6)['then'](function(_0x4a2ab3){var _0x184192=_[_0x96f0('0x25')](_0x4a2ab3[_0x96f0('0x26')][_0x96f0('0x26')],[_0x273a9c,_0x48285c]);_0x337466(_0x184192);})[_0x96f0('0x1f')](function(_0x5ac3cc){_0x5f538b(_0x5ac3cc);});});}function getEndUser(_0x25d223,_0x454499,_0x381fd1){return function(_0x130790){return new Promise(function(_0x16a7c8,_0x21eac1){logger[_0x96f0('0x10')](util[_0x96f0('0x27')](_0x96f0('0x28'),_0x130790[_0x96f0('0x29')]));searchContact(_0x381fd1,_0x454499,_0x96f0('0x2a'),_0x130790[_0x96f0('0x29')])[_0x96f0('0x17')](function(_0x150a9e){if(_0x150a9e){_0x130790[_0x96f0('0x2b')]=_0x150a9e['id'];logger[_0x96f0('0x10')](_0x96f0('0x2c'),_0x130790[_0x96f0('0x2b')]);return _0x16a7c8(_0x130790);}searchContact(_0x381fd1,_0x454499,_0x96f0('0x2d'),_0x130790['contactNumber'])[_0x96f0('0x17')](function(_0x4bc5fc){if(_0x4bc5fc){_0x130790[_0x96f0('0x2b')]=_0x4bc5fc['id'];logger['info']('Contact\x20found\x20work_number:',_0x130790['endUserId']);return _0x16a7c8(_0x130790);}createEndUser(_0x130790,_0x25d223,_0x454499,_0x381fd1)[_0x96f0('0x17')](function(_0x327cf4){logger[_0x96f0('0x10')](_0x96f0('0x2e'),_0x327cf4[_0x96f0('0x2b')]);return _0x16a7c8(_0x327cf4);});});})[_0x96f0('0x1f')](function(_0x464e8f){_0x21eac1(_0x464e8f);});});};}function createEndUser(_0x560d7b,_0x257de4,_0x3d8d28,_0x1bb2bd){return new Promise(function(_0x242373,_0x5506d2){var _0x564bc9=moment();var _0x3c97fa={'method':_0x96f0('0x2f'),'uri':_0x1bb2bd+_0x96f0('0x30'),'body':{'contact':{'last_name':_0x560d7b[_0x96f0('0x29')],'work_number':_0x560d7b[_0x96f0('0x29')],'mobile_number':_0x560d7b[_0x96f0('0x29')],'owner_id':_0x560d7b['userId'],'created_at':_0x564bc9['format'](_0x96f0('0x31'))}},'json':!![]};_0x3c97fa['headers']=_0x3d8d28;logger[_0x96f0('0x10')](_0x96f0('0x32'));return rp(_0x3c97fa)[_0x96f0('0x17')](function(_0x316f36){_0x560d7b[_0x96f0('0x2b')]=_0x316f36[_0x96f0('0x33')]['id'];_0x242373(_0x560d7b);})[_0x96f0('0x1f')](function(_0x41e454){logger[_0x96f0('0x20')]('['+[_0x257de4[_0x96f0('0x21')]()]+']',_0x41e454['message']);_0x5506d2(_0x41e454['message']);});});}function getTicket(_0xabac98,_0xb17803,_0x164256,_0xd7d6ae,_0x1d2fe4){return function(_0x14ee68){logger[_0x96f0('0x10')](_0x96f0('0x34'));return new Promise(function(_0x4be472,_0x505faa){var _0x2f6932=moment();var _0x187ec5={'method':_0x96f0('0x2f'),'uri':_0x164256+'/api/tasks','body':{'title':intUtil[_0x96f0('0x35')](_0xd7d6ae[_0x96f0('0x36')],_0x1d2fe4,'\x20'),'description':intUtil[_0x96f0('0x35')](_0xd7d6ae[_0x96f0('0x37')],_0x1d2fe4,'\x0a'),'owner_id':_0x14ee68[_0x96f0('0x1d')],'creater_id':_0x14ee68[_0x96f0('0x14')],'targetable_id':_0x14ee68[_0x96f0('0x2b')],'targetable_type':_0x96f0('0x38'),'created_at':_0x2f6932['format']('YYYY-MM-DDTHH:mm:ss'),'due_date':_0x2f6932[_0x96f0('0x39')](0x1e,'m')[_0x96f0('0x27')]('YYYY-MM-DDTHH:mm:ss')},'json':!![]};_0x187ec5['headers']=_0xb17803;return rp(_0x187ec5)[_0x96f0('0x17')](function(_0x87c5da){_0x14ee68[_0x96f0('0x3a')]=_0x87c5da[_0x96f0('0x3b')]['id'];logger['info']('Task\x20created:',_0x14ee68[_0x96f0('0x3a')]);_0x4be472(_0x14ee68);})[_0x96f0('0x1f')](function(_0x5b5273){logger[_0x96f0('0x20')]('['+[_0xabac98[_0x96f0('0x21')]()]+']',_0x5b5273['message']);_0x505faa(_0x5b5273[_0x96f0('0x16')]);});});};}function emit(_0x5147b9,_0x59149b,_0x39a357){var _0x5ccfe8={'uri':_0x5147b9+_0x96f0('0x3c')+_0x39a357};io['to'](util['format'](_0x96f0('0x3d'),_0x59149b))[_0x96f0('0x3e')]('trigger:browser:url',_0x5ccfe8);}exports['cs']=function(_0x2f7f8d,_0x3507d2,_0x27ec71,_0x17dc92,_0x4b7674,_0x150553,_0x4f29ab,_0x77ca57){var _0x562e66={};var _0x174bf9={'Authorization':_0x96f0('0x3f')+_0x150553[_0x96f0('0x40')]};_0x150553[_0x96f0('0x41')]=intUtil[_0x96f0('0x42')](_0x150553[_0x96f0('0x41')]);_0x150553[_0x96f0('0x43')]=intUtil[_0x96f0('0x42')](_0x150553[_0x96f0('0x43')]);var _0x1756cb=_0x150553[_0x96f0('0x41')];_0x562e66['adminEmail']=_0x150553[_0x96f0('0x44')];_0x562e66[_0x96f0('0x29')]=_0x77ca57[_0x96f0('0x45')]()==='outbound'?_0x3507d2[_0x96f0('0x46')]:_0x3507d2['calleridnum'];_0x562e66[_0x96f0('0x47')]=_0x77ca57===_0x96f0('0x48')||_0x77ca57===_0x96f0('0x49')?_0x96f0('0x48'):_0x96f0('0x4a');if(_0x17dc92){_0x562e66[_0x96f0('0x19')]=_0x17dc92[_0x96f0('0x1c')];}var _0x56544b=util['format'](_0x96f0('0x4b'),_0x150553[_0x96f0('0x43')],_0x3507d2[_0x96f0('0x4c')],md5(_0x3507d2[_0x96f0('0x4c')]));if(_0x4b7674&&_0x4b7674[_0x96f0('0x4d')]){logger[_0x96f0('0x10')](_0x96f0('0x4e'),_0x96f0('0x4f'));_0x3507d2[_0x96f0('0x50')]=_0x56544b;}else if(_0x4f29ab&&_0x4f29ab['recordingFormat']&&_0x4f29ab[_0x96f0('0x51')]!==_0x96f0('0x52')){logger[_0x96f0('0x10')](_0x96f0('0x53'),_0x96f0('0x4f'));_0x3507d2[_0x96f0('0x50')]=_0x56544b;}else{_0x3507d2[_0x96f0('0x50')]='';}return getAdminId(_0x562e66,_0x77ca57,_0x174bf9,_0x1756cb)['then'](getUser(_0x77ca57,_0x174bf9,_0x1756cb))[_0x96f0('0x17')](getEndUser(_0x77ca57,_0x174bf9,_0x1756cb))[_0x96f0('0x17')](getTicket(_0x77ca57,_0x174bf9,_0x1756cb,_0x27ec71,_0x3507d2))[_0x96f0('0x17')](function(_0x24117b){logger[_0x96f0('0x10')](util[_0x96f0('0x27')](_0x96f0('0x54'),_0x24117b[_0x96f0('0x3a')]));if(_0x77ca57!==_0x96f0('0x49')){logger[_0x96f0('0x10')]('['+[_0x77ca57[_0x96f0('0x21')]()]+']',_0x96f0('0x55'));emit(_0x1756cb,_0x17dc92[_0x96f0('0x56')],_0x24117b[_0x96f0('0x2b')]);}})[_0x96f0('0x1f')](function(_0x1eff73){logger[_0x96f0('0x20')]('['+[_0x77ca57[_0x96f0('0x21')]()]+_0x96f0('0x57'),util[_0x96f0('0x58')](_0x1eff73,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xf0b4=['YYYY-MM-DDTHH:mm:ss','Creating\x20new\x20task','/api/tasks','getString','Subjects','Contact','add','task','/contacts/','user:%s','emit','trigger:browser:url','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','username','outbound','destcalleridnum','calleridnum','callDirection','unmanaged','queue','email','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','ticketId','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','request-promise','md5','util','moment','ioredis','redis','defaults','localhost','socket.io-emitter','/api/selector/owners','headers','info','Getting\x20admin\x20information','then','users','adminEmail','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','toUpperCase','message','GET','Getting\x20user\x20list','agentEmail','Getting\x20user\x20with\x20email','userEmail','length','userId','Admin\x20selected','error','/api/lookup?q=','&f=','&entities=contact','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20found\x20work_number:','Contact\x20created:','POST','/api/contacts'];(function(_0x50e5a8,_0x71505d){var _0x1eb65b=function(_0x2daaea){while(--_0x2daaea){_0x50e5a8['push'](_0x50e5a8['shift']());}};_0x1eb65b(++_0x71505d);}(_0xf0b4,0x1e0));var _0x4f0b=function(_0x34eac3,_0x6c473d){_0x34eac3=_0x34eac3-0x0;var _0x150ad0=_0xf0b4[_0x34eac3];return _0x150ad0;};'use strict';var _=require(_0x4f0b('0x0'));var rp=require(_0x4f0b('0x1'));var md5=require(_0x4f0b('0x2'));var util=require(_0x4f0b('0x3'));var moment=require(_0x4f0b('0x4'));var Promise=require('bluebird');var Redis=require(_0x4f0b('0x5'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require('../../../../config/logger')('freshsales');config[_0x4f0b('0x6')]=_[_0x4f0b('0x7')](config[_0x4f0b('0x6')],{'host':_0x4f0b('0x8'),'port':0x18eb});var io=require(_0x4f0b('0x9'))(new Redis(config[_0x4f0b('0x6')]));function getAdminId(_0x5f3e4d,_0x2d96e9,_0x5871b0,_0x50a8cb){return new Promise(function(_0x8095f7,_0x38ca14){var _0x13950a=![];var _0x1c7ca6={'method':'GET','uri':_0x50a8cb+_0x4f0b('0xa'),'json':!![]};_0x1c7ca6[_0x4f0b('0xb')]=_0x5871b0;logger[_0x4f0b('0xc')](_0x4f0b('0xd'));return rp(_0x1c7ca6)[_0x4f0b('0xe')](function(_0x182466){if(_0x182466){var _0x3b9b82=_0x182466[_0x4f0b('0xf')];var _0x759e05=null;for(_0x759e05=0x0;_0x759e05<_0x3b9b82['length'];_0x759e05++){if(_0x3b9b82[_0x759e05]['email']===_0x5f3e4d[_0x4f0b('0x10')]){_0x5f3e4d[_0x4f0b('0x11')]=_0x3b9b82[_0x759e05]['id'];_0x13950a=!![];}}if(_0x13950a){logger[_0x4f0b('0xc')](_0x4f0b('0x12'),_0x5f3e4d[_0x4f0b('0x11')]);_0x8095f7(_0x5f3e4d);}else{_0x38ca14({'statusCode':0x194,'message':_0x4f0b('0x13')});}}else{_0x38ca14({'statusCode':0x194,'message':_0x4f0b('0x13')});}})[_0x4f0b('0x14')](function(_0x45b317){logger['error']('['+[_0x2d96e9[_0x4f0b('0x15')]()]+']',_0x45b317[_0x4f0b('0x16')]);_0x38ca14(_0x45b317);});});}function getUser(_0x2e53fd,_0x56feb3,_0x46aa9a){return function(_0x1a6a23){return new Promise(function(_0x5cfff1,_0x5b9160){var _0x283a62={'method':_0x4f0b('0x17'),'uri':_0x46aa9a+'/api/selector/owners','json':!![]};_0x283a62[_0x4f0b('0xb')]=_0x56feb3;logger['info'](_0x4f0b('0x18'));return rp(_0x283a62)[_0x4f0b('0xe')](function(_0x4c69fe){if(_0x4c69fe){var _0x533bc8=_0x4c69fe['users'];var _0x5c1778=![];var _0x154bce=null;if(_0x1a6a23[_0x4f0b('0x19')]!==null){logger[_0x4f0b('0xc')](_0x4f0b('0x1a'),_0x1a6a23[_0x4f0b('0x19')]);_0x1a6a23[_0x4f0b('0x1b')]=_0x1a6a23[_0x4f0b('0x19')];for(_0x154bce=0x0;_0x154bce<_0x533bc8[_0x4f0b('0x1c')];_0x154bce++){if(_0x533bc8[_0x154bce]['email']===_0x1a6a23['agentEmail']){_0x5c1778=!![];_0x1a6a23[_0x4f0b('0x1d')]=_0x533bc8[_0x154bce]['id'];logger[_0x4f0b('0xc')]('User\x20found:',_0x1a6a23[_0x4f0b('0x1d')]);}}}if(!_0x5c1778){logger[_0x4f0b('0xc')](_0x4f0b('0x1e'));_0x1a6a23[_0x4f0b('0x1b')]=_0x1a6a23[_0x4f0b('0x10')];_0x1a6a23[_0x4f0b('0x1d')]=_0x1a6a23['adminId'];_0x5c1778=!![];}if(_0x5c1778){_0x5cfff1(_0x1a6a23);}else{_0x5b9160({'statusCode':0x194,'message':_0x4f0b('0x13')});}}else{_0x5b9160({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})['catch'](function(_0x3c3883){logger[_0x4f0b('0x1f')]('['+[_0x2e53fd[_0x4f0b('0x15')]()]+']',_0x3c3883[_0x4f0b('0x16')]);_0x5b9160(_0x3c3883);});});};}function searchContact(_0x1a08d6,_0x41bdf0,_0x4bc475,_0x50c1eb){return new Promise(function(_0x45c3d5,_0x4c1c50){var _0x1fb193={'method':_0x4f0b('0x17'),'headers':_0x41bdf0,'uri':_0x1a08d6+_0x4f0b('0x20')+_0x50c1eb+_0x4f0b('0x21')+_0x4bc475+_0x4f0b('0x22'),'json':!![]};rp(_0x1fb193)[_0x4f0b('0xe')](function(_0x240f5c){var _0x37c145=_[_0x4f0b('0x23')](_0x240f5c[_0x4f0b('0x24')][_0x4f0b('0x24')],[_0x4bc475,_0x50c1eb]);_0x45c3d5(_0x37c145);})[_0x4f0b('0x14')](function(_0x1e100d){_0x4c1c50(_0x1e100d);});});}function getEndUser(_0x5c54e4,_0x29851d,_0xbbf189){return function(_0xd0b393){return new Promise(function(_0x5e82aa,_0x55ea81){logger[_0x4f0b('0xc')](util[_0x4f0b('0x25')](_0x4f0b('0x26'),_0xd0b393[_0x4f0b('0x27')]));searchContact(_0xbbf189,_0x29851d,_0x4f0b('0x28'),_0xd0b393[_0x4f0b('0x27')])[_0x4f0b('0xe')](function(_0x55ad4e){if(_0x55ad4e){_0xd0b393[_0x4f0b('0x29')]=_0x55ad4e['id'];logger['info'](_0x4f0b('0x2a'),_0xd0b393[_0x4f0b('0x29')]);return _0x5e82aa(_0xd0b393);}searchContact(_0xbbf189,_0x29851d,_0x4f0b('0x2b'),_0xd0b393[_0x4f0b('0x27')])[_0x4f0b('0xe')](function(_0x40b024){if(_0x40b024){_0xd0b393[_0x4f0b('0x29')]=_0x40b024['id'];logger['info'](_0x4f0b('0x2c'),_0xd0b393[_0x4f0b('0x29')]);return _0x5e82aa(_0xd0b393);}createEndUser(_0xd0b393,_0x5c54e4,_0x29851d,_0xbbf189)[_0x4f0b('0xe')](function(_0xd575e7){logger[_0x4f0b('0xc')](_0x4f0b('0x2d'),_0xd575e7[_0x4f0b('0x29')]);return _0x5e82aa(_0xd575e7);});});})['catch'](function(_0x44b07d){_0x55ea81(_0x44b07d);});});};}function createEndUser(_0x4826c1,_0x202974,_0x50beb5,_0x430317){return new Promise(function(_0x5bcc11,_0x5697a3){var _0x11570d=moment();var _0x44e30c={'method':_0x4f0b('0x2e'),'uri':_0x430317+_0x4f0b('0x2f'),'body':{'contact':{'last_name':_0x4826c1[_0x4f0b('0x27')],'work_number':_0x4826c1[_0x4f0b('0x27')],'mobile_number':_0x4826c1[_0x4f0b('0x27')],'owner_id':_0x4826c1[_0x4f0b('0x1d')],'created_at':_0x11570d['format'](_0x4f0b('0x30'))}},'json':!![]};_0x44e30c[_0x4f0b('0xb')]=_0x50beb5;logger[_0x4f0b('0xc')]('Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact');return rp(_0x44e30c)[_0x4f0b('0xe')](function(_0x376245){_0x4826c1[_0x4f0b('0x29')]=_0x376245['contact']['id'];_0x5bcc11(_0x4826c1);})[_0x4f0b('0x14')](function(_0x3650a0){logger[_0x4f0b('0x1f')]('['+[_0x202974['toUpperCase']()]+']',_0x3650a0[_0x4f0b('0x16')]);_0x5697a3(_0x3650a0[_0x4f0b('0x16')]);});});}function getTicket(_0x4278e4,_0x3a51fe,_0x3055fb,_0x3093e1,_0x517450){return function(_0x17eb92){logger[_0x4f0b('0xc')](_0x4f0b('0x31'));return new Promise(function(_0x43e4b9,_0x11e18a){var _0x5981f8=moment();var _0x16015={'method':_0x4f0b('0x2e'),'uri':_0x3055fb+_0x4f0b('0x32'),'body':{'title':intUtil[_0x4f0b('0x33')](_0x3093e1[_0x4f0b('0x34')],_0x517450,'\x20'),'description':intUtil[_0x4f0b('0x33')](_0x3093e1['Descriptions'],_0x517450,'\x0a'),'owner_id':_0x17eb92[_0x4f0b('0x1d')],'creater_id':_0x17eb92[_0x4f0b('0x11')],'targetable_id':_0x17eb92[_0x4f0b('0x29')],'targetable_type':_0x4f0b('0x35'),'created_at':_0x5981f8[_0x4f0b('0x25')](_0x4f0b('0x30')),'due_date':_0x5981f8[_0x4f0b('0x36')](0x1e,'m')[_0x4f0b('0x25')]('YYYY-MM-DDTHH:mm:ss')},'json':!![]};_0x16015[_0x4f0b('0xb')]=_0x3a51fe;return rp(_0x16015)['then'](function(_0x3fe69e){_0x17eb92['ticketId']=_0x3fe69e[_0x4f0b('0x37')]['id'];logger['info']('Task\x20created:',_0x17eb92['ticketId']);_0x43e4b9(_0x17eb92);})[_0x4f0b('0x14')](function(_0xf83c16){logger['error']('['+[_0x4278e4[_0x4f0b('0x15')]()]+']',_0xf83c16['message']);_0x11e18a(_0xf83c16[_0x4f0b('0x16')]);});});};}function emit(_0x26e2a0,_0x451df0,_0x1a171b){var _0x317546={'uri':_0x26e2a0+_0x4f0b('0x38')+_0x1a171b};io['to'](util[_0x4f0b('0x25')](_0x4f0b('0x39'),_0x451df0))[_0x4f0b('0x3a')](_0x4f0b('0x3b'),_0x317546);}exports['cs']=function(_0x56e5d0,_0x426790,_0x38233f,_0x5da904,_0x5378b5,_0x46681d,_0x31a219,_0x472628){var _0x191360={};var _0x1434e5={'Authorization':_0x4f0b('0x3c')+_0x46681d[_0x4f0b('0x3d')]};_0x46681d[_0x4f0b('0x3e')]=intUtil['stripTrailingSlash'](_0x46681d[_0x4f0b('0x3e')]);_0x46681d['serverUrl']=intUtil[_0x4f0b('0x3f')](_0x46681d[_0x4f0b('0x40')]);var _0x4b855f=_0x46681d[_0x4f0b('0x3e')];_0x191360[_0x4f0b('0x10')]=_0x46681d[_0x4f0b('0x41')];_0x191360[_0x4f0b('0x27')]=_0x472628['toLowerCase']()===_0x4f0b('0x42')?_0x426790[_0x4f0b('0x43')]:_0x426790[_0x4f0b('0x44')];_0x191360[_0x4f0b('0x45')]=_0x472628==='queue'||_0x472628===_0x4f0b('0x46')?_0x4f0b('0x47'):_0x4f0b('0x42');if(_0x5da904){_0x191360[_0x4f0b('0x19')]=_0x5da904[_0x4f0b('0x48')];}var _0x220fc9=util[_0x4f0b('0x25')](_0x4f0b('0x49'),_0x46681d[_0x4f0b('0x40')],_0x426790['uniqueid'],md5(_0x426790[_0x4f0b('0x4a')]));if(_0x5378b5&&_0x5378b5[_0x4f0b('0x4b')]){logger[_0x4f0b('0xc')](_0x4f0b('0x4c'),_0x4f0b('0x4d'));_0x426790[_0x4f0b('0x4e')]=_0x220fc9;}else if(_0x31a219&&_0x31a219['recordingFormat']&&_0x31a219[_0x4f0b('0x4f')]!==_0x4f0b('0x50')){logger[_0x4f0b('0xc')](_0x4f0b('0x51'),'Recording\x20is\x20enabled!');_0x426790[_0x4f0b('0x4e')]=_0x220fc9;}else{_0x426790[_0x4f0b('0x4e')]='';}return getAdminId(_0x191360,_0x472628,_0x1434e5,_0x4b855f)[_0x4f0b('0xe')](getUser(_0x472628,_0x1434e5,_0x4b855f))[_0x4f0b('0xe')](getEndUser(_0x472628,_0x1434e5,_0x4b855f))[_0x4f0b('0xe')](getTicket(_0x472628,_0x1434e5,_0x4b855f,_0x38233f,_0x426790))[_0x4f0b('0xe')](function(_0x1053b4){logger[_0x4f0b('0xc')](util[_0x4f0b('0x25')](_0x4f0b('0x52'),_0x1053b4[_0x4f0b('0x53')]));if(_0x472628!==_0x4f0b('0x46')){logger[_0x4f0b('0xc')]('['+[_0x472628[_0x4f0b('0x15')]()]+']',_0x4f0b('0x54'));emit(_0x4b855f,_0x5da904[_0x4f0b('0x55')],_0x1053b4[_0x4f0b('0x29')]);}})[_0x4f0b('0x14')](function(_0xdeb67b){logger[_0x4f0b('0x1f')]('['+[_0x472628['toUpperCase']()]+_0x4f0b('0x56'),util[_0x4f0b('0x57')](_0xdeb67b,{'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 324f8d8..ea6f893 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 _0xf278=['%s\x20account\x20#%s\x20not\x20found','lodash','util','./zendesk','./salesforce','./sugarcrm','./freshdesk','./zoho','./desk','./servicenow','./dynamics365','salesforce','sugarcrm','freshdesk','zoho','desk','vtiger','dynamics365','freshsales','servicenow','exec','toLowerCase','data1','data2','find','data3','queue','routeId','outbound','log','EVENT\x20UNKNOWN','unmanaged','zendesk','unknown\x20integration','../../../../config/logger','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found'];(function(_0x21333c,_0x4fbbff){var _0x3a4dd6=function(_0x241665){while(--_0x241665){_0x21333c['push'](_0x21333c['shift']());}};_0x3a4dd6(++_0x4fbbff);}(_0xf278,0xeb));var _0x8f27=function(_0x40b2ed,_0x2b1765){_0x40b2ed=_0x40b2ed-0x0;var _0x18397d=_0xf278[_0x40b2ed];return _0x18397d;};'use strict';var _=require(_0x8f27('0x0'));var util=require(_0x8f27('0x1'));var zendesk=require(_0x8f27('0x2'));var salesforce=require(_0x8f27('0x3'));var sugarcrm=require(_0x8f27('0x4'));var freshdesk=require(_0x8f27('0x5'));var zoho=require(_0x8f27('0x6'));var desk=require(_0x8f27('0x7'));var vtiger=require('./vtiger');var servicenow=require(_0x8f27('0x8'));var dynamics365=require(_0x8f27('0x9'));var freshsales=require('./freshsales');var integrations=['zendesk',_0x8f27('0xa'),_0x8f27('0xb'),_0x8f27('0xc'),_0x8f27('0xd'),_0x8f27('0xe'),_0x8f27('0xf'),_0x8f27('0x10'),_0x8f27('0x11'),_0x8f27('0x12')];exports[_0x8f27('0x13')]=function(_0x33c6a5,_0x5e77d5,_0x2f0ba2,_0x131434,_0xfd4610,_0x12576a){if(_0x2f0ba2){if(_['includes'](integrations,_0x33c6a5['data1'][_0x8f27('0x14')]())){try{var _0x389bab=null;var _0x2daf57='';var _0x44543d=_0x2f0ba2[_0x33c6a5[_0x8f27('0x15')][_0x8f27('0x14')]()];if(_0x44543d){var _0x15ed7d=_0x44543d[_0x33c6a5[_0x8f27('0x16')]];if(_0x15ed7d){var _0x348b6e=_[_0x8f27('0x17')](_0x15ed7d['Configurations'],{'id':parseInt(_0x33c6a5[_0x8f27('0x18')],0xa)});if(_0x348b6e){if(_0x131434){if(_0xfd4610&&_0x5e77d5[_0x8f27('0x19')]){_0x2daf57=_0x8f27('0x19');}else if(_0x5e77d5[_0x8f27('0x1a')]){_0x2daf57=_0x8f27('0x1b');}else{console[_0x8f27('0x1c')](_0x8f27('0x1d'),_0x5e77d5);}}else{_0x2daf57=_0x8f27('0x1e');}switch(_0x33c6a5[_0x8f27('0x15')][_0x8f27('0x14')]()){case _0x8f27('0x1f'):zendesk[_0x2daf57](_0x33c6a5,_0x5e77d5,_0x348b6e,_0x131434,_0xfd4610,_0x15ed7d,_0x12576a);break;case _0x8f27('0xa'):salesforce[_0x2daf57](_0x33c6a5,_0x5e77d5,_0x348b6e,_0x131434,_0xfd4610,_0x15ed7d,_0x12576a);break;case _0x8f27('0xb'):sugarcrm[_0x2daf57](_0x33c6a5,_0x5e77d5,_0x348b6e,_0x131434,_0xfd4610,_0x15ed7d,_0x12576a);break;case _0x8f27('0xc'):freshdesk[_0x2daf57](_0x33c6a5,_0x5e77d5,_0x348b6e,_0x131434,_0xfd4610,_0x15ed7d,_0x12576a);break;case'zoho':zoho[_0x2daf57](_0x33c6a5,_0x5e77d5,_0x348b6e,_0x131434,_0xfd4610,_0x15ed7d,_0x12576a);break;case _0x8f27('0xe'):desk[_0x2daf57](_0x33c6a5,_0x5e77d5,_0x348b6e,_0x131434,_0xfd4610,_0x15ed7d,_0x12576a);break;case'vtiger':vtiger[_0x2daf57](_0x33c6a5,_0x5e77d5,_0x348b6e,_0x131434,_0xfd4610,_0x15ed7d,_0x12576a);break;case'freshsales':freshsales['cs'](_0x33c6a5,_0x5e77d5,_0x348b6e,_0x131434,_0xfd4610,_0x15ed7d,_0x12576a,_0x2daf57);break;case'servicenow':servicenow['cs'](_0x33c6a5,_0x5e77d5,_0x348b6e,_0x131434,_0xfd4610,_0x15ed7d,_0x12576a,_0x2daf57);break;case _0x8f27('0x10'):dynamics365['cs'](_0x33c6a5,_0x5e77d5,_0x348b6e,_0x131434,_0xfd4610,_0x15ed7d,_0x12576a,_0x2daf57);break;default:console[_0x8f27('0x1c')](_0x8f27('0x20'));}}else{_0x389bab=require(_0x8f27('0x21'))(_0x33c6a5[_0x8f27('0x15')][_0x8f27('0x14')]());_0x389bab[_0x8f27('0x22')](_0x8f27('0x23'),util[_0x8f27('0x24')](_0x8f27('0x25'),_0x33c6a5[_0x8f27('0x15')][_0x8f27('0x14')](),_0x33c6a5[_0x8f27('0x18')]));}}else{_0x389bab=require(_0x8f27('0x21'))(_0x33c6a5['data1']['toLowerCase']());_0x389bab['error'](_0x8f27('0x23'),util[_0x8f27('0x24')](_0x8f27('0x26'),_0x33c6a5[_0x8f27('0x15')][_0x8f27('0x14')](),_0x33c6a5[_0x8f27('0x16')]));}}else{}}catch(_0x10fee2){console['error'](_0x10fee2);}}}}; \ No newline at end of file +var _0xbc04=['vtiger','dynamics365','freshsales','servicenow','includes','data1','toLowerCase','data2','find','Configurations','queue','routeId','outbound','log','EVENT\x20UNKNOWN','unmanaged','zendesk','desk','unknown\x20integration','../../../../config/logger','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','data3','%s\x20account\x20#%s\x20not\x20found','lodash','util','./zendesk','./sugarcrm','./freshdesk','./desk','./vtiger','./servicenow','./dynamics365','./freshsales','salesforce','sugarcrm','freshdesk','zoho'];(function(_0x3e112d,_0x2bb132){var _0x531c31=function(_0x1954bc){while(--_0x1954bc){_0x3e112d['push'](_0x3e112d['shift']());}};_0x531c31(++_0x2bb132);}(_0xbc04,0xba));var _0x4bc0=function(_0x500efe,_0x126ff4){_0x500efe=_0x500efe-0x0;var _0x476d44=_0xbc04[_0x500efe];return _0x476d44;};'use strict';var _=require(_0x4bc0('0x0'));var util=require(_0x4bc0('0x1'));var zendesk=require(_0x4bc0('0x2'));var salesforce=require('./salesforce');var sugarcrm=require(_0x4bc0('0x3'));var freshdesk=require(_0x4bc0('0x4'));var zoho=require('./zoho');var desk=require(_0x4bc0('0x5'));var vtiger=require(_0x4bc0('0x6'));var servicenow=require(_0x4bc0('0x7'));var dynamics365=require(_0x4bc0('0x8'));var freshsales=require(_0x4bc0('0x9'));var integrations=['zendesk',_0x4bc0('0xa'),_0x4bc0('0xb'),_0x4bc0('0xc'),_0x4bc0('0xd'),'desk',_0x4bc0('0xe'),_0x4bc0('0xf'),_0x4bc0('0x10'),_0x4bc0('0x11')];exports['exec']=function(_0x50a0d1,_0x13bff0,_0x397db2,_0x2a84d8,_0x3e6866,_0x3a81a0){if(_0x397db2){if(_[_0x4bc0('0x12')](integrations,_0x50a0d1[_0x4bc0('0x13')][_0x4bc0('0x14')]())){try{var _0x188b39=null;var _0x4c4f85='';var _0x24f41f=_0x397db2[_0x50a0d1[_0x4bc0('0x13')][_0x4bc0('0x14')]()];if(_0x24f41f){var _0x247134=_0x24f41f[_0x50a0d1[_0x4bc0('0x15')]];if(_0x247134){var _0x5e8de7=_[_0x4bc0('0x16')](_0x247134[_0x4bc0('0x17')],{'id':parseInt(_0x50a0d1['data3'],0xa)});if(_0x5e8de7){if(_0x2a84d8){if(_0x3e6866&&_0x13bff0[_0x4bc0('0x18')]){_0x4c4f85=_0x4bc0('0x18');}else if(_0x13bff0[_0x4bc0('0x19')]){_0x4c4f85=_0x4bc0('0x1a');}else{console[_0x4bc0('0x1b')](_0x4bc0('0x1c'),_0x13bff0);}}else{_0x4c4f85=_0x4bc0('0x1d');}switch(_0x50a0d1[_0x4bc0('0x13')][_0x4bc0('0x14')]()){case _0x4bc0('0x1e'):zendesk[_0x4c4f85](_0x50a0d1,_0x13bff0,_0x5e8de7,_0x2a84d8,_0x3e6866,_0x247134,_0x3a81a0);break;case'salesforce':salesforce[_0x4c4f85](_0x50a0d1,_0x13bff0,_0x5e8de7,_0x2a84d8,_0x3e6866,_0x247134,_0x3a81a0);break;case _0x4bc0('0xb'):sugarcrm[_0x4c4f85](_0x50a0d1,_0x13bff0,_0x5e8de7,_0x2a84d8,_0x3e6866,_0x247134,_0x3a81a0);break;case _0x4bc0('0xc'):freshdesk[_0x4c4f85](_0x50a0d1,_0x13bff0,_0x5e8de7,_0x2a84d8,_0x3e6866,_0x247134,_0x3a81a0);break;case _0x4bc0('0xd'):zoho[_0x4c4f85](_0x50a0d1,_0x13bff0,_0x5e8de7,_0x2a84d8,_0x3e6866,_0x247134,_0x3a81a0);break;case _0x4bc0('0x1f'):desk[_0x4c4f85](_0x50a0d1,_0x13bff0,_0x5e8de7,_0x2a84d8,_0x3e6866,_0x247134,_0x3a81a0);break;case _0x4bc0('0xe'):vtiger[_0x4c4f85](_0x50a0d1,_0x13bff0,_0x5e8de7,_0x2a84d8,_0x3e6866,_0x247134,_0x3a81a0);break;case _0x4bc0('0x10'):freshsales['cs'](_0x50a0d1,_0x13bff0,_0x5e8de7,_0x2a84d8,_0x3e6866,_0x247134,_0x3a81a0,_0x4c4f85);break;case'servicenow':servicenow['cs'](_0x50a0d1,_0x13bff0,_0x5e8de7,_0x2a84d8,_0x3e6866,_0x247134,_0x3a81a0,_0x4c4f85);break;case _0x4bc0('0xf'):dynamics365['cs'](_0x50a0d1,_0x13bff0,_0x5e8de7,_0x2a84d8,_0x3e6866,_0x247134,_0x3a81a0,_0x4c4f85);break;default:console['log'](_0x4bc0('0x20'));}}else{_0x188b39=require(_0x4bc0('0x21'))(_0x50a0d1[_0x4bc0('0x13')][_0x4bc0('0x14')]());_0x188b39[_0x4bc0('0x22')](_0x4bc0('0x23'),util[_0x4bc0('0x24')](_0x4bc0('0x25'),_0x50a0d1[_0x4bc0('0x13')][_0x4bc0('0x14')](),_0x50a0d1[_0x4bc0('0x26')]));}}else{_0x188b39=require(_0x4bc0('0x21'))(_0x50a0d1[_0x4bc0('0x13')]['toLowerCase']());_0x188b39[_0x4bc0('0x22')](_0x4bc0('0x23'),util[_0x4bc0('0x24')](_0x4bc0('0x27'),_0x50a0d1[_0x4bc0('0x13')]['toLowerCase'](),_0x50a0d1[_0x4bc0('0x15')]));}}else{}}catch(_0x2c746c){console[_0x4bc0('0x22')](_0x2c746c);}}}}; \ 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 a969d2b..1f9f4ab 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 _0xb57a=['[OUTBOUND]','destcalleridname','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','unmanaged','lastevent','toUpperCase',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','moment','bluebird','md5','jsforce','ioredis','../../../../config/logger','salesforce','defaults','redis','socket.io-emitter','Subjects','getString','Descriptions','ticketType','Task','ActivityDate','utc','contact','endUserType','lead','WhoId','account','Case','ContactId','AccountId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','isNil','validateEmail','User','find','then','length','resolve','Name','user_id','display_name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','Contact','additionalSearchLead','merge','$or','account_contact_lead','additionalSearchAccount','execute','Lead','Account','first','Phone','attributes','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','Company','upperFirst','forEach','includes','string','type','idField','content','toString','variable','variableName','customVariable','name','Variable','password','concat','Connection','remoteUri','https://login.salesforce.com','clientId','clientSecret','username','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','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','user:%s','trigger:browser:url','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','outbound','recordingFormat'];(function(_0x3b9dd9,_0x260f93){var _0x2025d3=function(_0x5682a1){while(--_0x5682a1){_0x3b9dd9['push'](_0x3b9dd9['shift']());}};_0x2025d3(++_0x260f93);}(_0xb57a,0x88));var _0xab57=function(_0x3b1cab,_0x141d99){_0x3b1cab=_0x3b1cab-0x0;var _0xa8b56=_0xb57a[_0x3b1cab];return _0xa8b56;};'use strict';var _=require(_0xab57('0x0'));var rp=require('request-promise');var moment=require(_0xab57('0x1'));var BPromise=require(_0xab57('0x2'));var md5=require(_0xab57('0x3'));var jsforce=require(_0xab57('0x4'));var util=require('util');var Redis=require(_0xab57('0x5'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0xab57('0x6'))(_0xab57('0x7'));config['redis']=_[_0xab57('0x8')](config[_0xab57('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0xab57('0xa'))(new Redis(config[_0xab57('0x9')]));function emit(_0x1e3c45,_0x131f1c,_0x346820){io['to'](_0x1e3c45)['emit'](_0x131f1c,_0x346820);}function getTicket(_0x3093b5,_0x3f03b3,_0x25276c,_0x113e31,_0x2f5dd0,_0x4164ee,_0x4d00a9,_0x31019b){var _0x1e2313=Object['assign']({},{'OwnerId':_0x3f03b3['id'],'Subject':intUtil['getString'](_0x113e31[_0xab57('0xb')],_0x2f5dd0,'\x20'),'Description':intUtil[_0xab57('0xc')](_0x113e31[_0xab57('0xd')],_0x2f5dd0,'\x0a')},getCustomFields(_0x4164ee,_0x2f5dd0));if(_0x25276c){if(_0x113e31[_0xab57('0xe')]===_0xab57('0xf')){_0x1e2313[_0xab57('0x10')]=moment[_0xab57('0x11')]();_0x1e2313['IsReminderSet']=![];_0x1e2313['IsRecurrence']=![];if(_0x25276c['endUserType']===_0xab57('0x12')||_0x25276c[_0xab57('0x13')]===_0xab57('0x14')){_0x1e2313[_0xab57('0x15')]=_0x25276c['id'];}else if(_0x25276c[_0xab57('0x13')]===_0xab57('0x16')){_0x1e2313['WhatId']=_0x25276c['id'];}}else if(_0x113e31[_0xab57('0xe')]===_0xab57('0x17')){if(_0x25276c['endUserType']==='contact'){_0x1e2313[_0xab57('0x18')]=_0x25276c['id'];}else if(_0x25276c[_0xab57('0x13')]===_0xab57('0x16')){_0x1e2313[_0xab57('0x19')]=_0x25276c['id'];}else if(_0x25276c[_0xab57('0x13')]===_0xab57('0x14')&&_0x113e31[_0xab57('0x1a')]){_0x1e2313[_0x113e31['leadId']]=_0x25276c['id'];}else{logger[_0xab57('0x1b')](_0xab57('0x1c'));}}}return _0x4d00a9[_0xab57('0x1d')](_0x113e31[_0xab57('0xe')])[_0xab57('0x1e')](_0x1e2313);}function getUser(_0x52df5e,_0x4bb603,_0x521d15){if(!_[_0xab57('0x1f')](_0x4bb603)&&intUtil[_0xab57('0x20')](_0x4bb603)){var _0x4f22c6={'Email':_0x4bb603};var _0x177c24={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x521d15[_0xab57('0x1d')](_0xab57('0x21'))[_0xab57('0x22')](_0x4f22c6,_0x177c24)['execute']()[_0xab57('0x23')](function(_0x30c218){if(_0x30c218[_0xab57('0x24')]){var _0xf5427f=_['find'](_0x30c218,function(_0x2a77f9){return _0x2a77f9['Email']===_0x4bb603;});if(_0xf5427f){logger[_0xab57('0x1b')]('Agent\x20%s\x20found.',_0x4bb603);return BPromise[_0xab57('0x25')]({'id':_0xf5427f['Id'],'name':_0xf5427f[_0xab57('0x26')]});}}else{logger[_0xab57('0x1b')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x4bb603);return _0x521d15['identity']()[_0xab57('0x23')](function(_0xd4f1cb){return BPromise[_0xab57('0x25')]({'id':_0xd4f1cb[_0xab57('0x27')],'name':_0xd4f1cb[_0xab57('0x28')]});});}});}else{logger['info'](_0xab57('0x29'),_0x4bb603);return _0x521d15[_0xab57('0x2a')]()[_0xab57('0x23')](function(_0x415463){return BPromise[_0xab57('0x25')]({'id':_0x415463['user_id'],'name':_0x415463[_0xab57('0x28')]});});}}function getEndUser(_0x25558e,_0x2e66e8,_0x1b0155,_0x57a01b,_0x567054){var _0x20827c={'$or':{'Phone':_0x57a01b}};var _0x1acc69={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xab57('0x25')]()[_0xab57('0x23')](function(){logger[_0xab57('0x1b')](_0xab57('0x2b'),_0x57a01b,_0x2e66e8[_0xab57('0x2c')]);switch(_0x2e66e8[_0xab57('0x2c')]){case _0xab57('0x2d'):var _0x58fa21=_[_0xab57('0x2e')](_0x20827c);if(_0x2e66e8[_0xab57('0x2f')]){var _0x3a856e={};_0x3a856e[_0x2e66e8['additionalSearchContact']]=_0x57a01b;_['merge'](_0x58fa21['$or'],_0x3a856e);}return _0x567054[_0xab57('0x1d')](_0xab57('0x30'))[_0xab57('0x22')](_0x58fa21,_0x1acc69)['execute']()[_0xab57('0x23')](function(_0x1a1d31){if(_0x1a1d31&&_0x1a1d31[_0xab57('0x24')]){return _0x1a1d31;}else{var _0xd0da7e=_[_0xab57('0x2e')](_0x20827c);if(_0x2e66e8[_0xab57('0x31')]){var _0x3253a9={};_0x3253a9[_0x2e66e8[_0xab57('0x31')]]=_0x57a01b;_[_0xab57('0x32')](_0xd0da7e[_0xab57('0x33')],_0x3253a9);}return _0x567054[_0xab57('0x1d')]('Lead')[_0xab57('0x22')](_0xd0da7e,_0x1acc69);}});case _0xab57('0x34'):var _0x3bb434=_[_0xab57('0x2e')](_0x20827c);if(_0x2e66e8[_0xab57('0x35')]){var _0x3a856e={};_0x3a856e[_0x2e66e8[_0xab57('0x35')]]=_0x57a01b;_[_0xab57('0x32')](_0x3bb434[_0xab57('0x33')],_0x3a856e);}return _0x567054['sobject']('Account')[_0xab57('0x22')](_0x3bb434,_0x1acc69)[_0xab57('0x36')]()[_0xab57('0x23')](function(_0x465a0e){if(_0x465a0e&&_0x465a0e[_0xab57('0x24')]){return _0x465a0e;}else{var _0x3f1c9f=_[_0xab57('0x2e')](_0x20827c);if(_0x2e66e8[_0xab57('0x2f')]){var _0x1618ad={};_0x1618ad[_0x2e66e8[_0xab57('0x2f')]]=_0x57a01b;_['merge'](_0x3f1c9f['$or'],_0x1618ad);}return _0x567054['sobject']('Contact')[_0xab57('0x22')](_0x3f1c9f,_0x1acc69)[_0xab57('0x23')](function(_0x2bc83f){if(_0x2bc83f&&_0x2bc83f['length']){return _0x2bc83f;}else{var _0x310d90=_[_0xab57('0x2e')](_0x20827c);if(_0x2e66e8[_0xab57('0x31')]){var _0x390e95={};_0x390e95[_0x2e66e8[_0xab57('0x31')]]=_0x57a01b;_[_0xab57('0x32')](_0x310d90['$or'],_0x390e95);}return _0x567054[_0xab57('0x1d')]('Lead')[_0xab57('0x22')](_0x310d90,_0x1acc69);}});}});case'contact':var _0x58fa21=_['cloneDeep'](_0x20827c);if(_0x2e66e8[_0xab57('0x2f')]){var _0x3a856e={};_0x3a856e[_0x2e66e8[_0xab57('0x2f')]]=_0x57a01b;_[_0xab57('0x32')](_0x58fa21[_0xab57('0x33')],_0x3a856e);}return _0x567054[_0xab57('0x1d')](_0xab57('0x30'))['find'](_0x58fa21,_0x1acc69)[_0xab57('0x36')]();case _0xab57('0x14'):var _0x3bdbfe=_['cloneDeep'](_0x20827c);if(_0x2e66e8[_0xab57('0x31')]){var _0x3a856e={};_0x3a856e[_0x2e66e8[_0xab57('0x31')]]=_0x57a01b;_[_0xab57('0x32')](_0x3bdbfe[_0xab57('0x33')],_0x3a856e);}return _0x567054[_0xab57('0x1d')](_0xab57('0x37'))[_0xab57('0x22')](_0x3bdbfe,_0x1acc69);case _0xab57('0x16'):var _0x3bb434=_[_0xab57('0x2e')](_0x20827c);if(_0x2e66e8[_0xab57('0x35')]){var _0x3a856e={};_0x3a856e[_0x2e66e8[_0xab57('0x35')]]=_0x57a01b;_['merge'](_0x3bb434['$or'],_0x3a856e);}return _0x567054[_0xab57('0x1d')](_0xab57('0x38'))[_0xab57('0x22')](_0x3bb434,_0x1acc69);default:return null;}})[_0xab57('0x23')](function(_0x362060){if(_0x362060&&_0x362060[_0xab57('0x24')]){var _0x5111a7=_[_0xab57('0x39')](_0x362060);if(_0x5111a7){return BPromise['resolve']({'id':_0x5111a7['Id'],'name':_0x5111a7[_0xab57('0x26')],'phone':_0x5111a7[_0xab57('0x3a')],'endUserType':_0x5111a7[_0xab57('0x3b')]['type'][_0xab57('0x3c')]()});}}})[_0xab57('0x23')](function(_0x22d611){if(_0x22d611){logger['info']('Enduser\x20(%s)\x20with\x20phone\x20%s\x20found',_0x22d611[_0xab57('0x13')],_0x57a01b);return BPromise['resolve'](_0x22d611);}else{logger[_0xab57('0x1b')](_0xab57('0x3d'),_0x57a01b);var _0x380a8e={'Phone':_0x57a01b};if(_0x2e66e8[_0xab57('0x3e')]){if(_0x2e66e8[_0xab57('0x3e')]===_0xab57('0x12')){logger[_0xab57('0x1b')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x57a01b,_0x2e66e8[_0xab57('0x3e')]);_0x380a8e[_0xab57('0x3f')]=_0x1b0155!==_0xab57('0x40')?_0x1b0155:util['format'](_0xab57('0x41'),_0x57a01b);}else if(_0x2e66e8[_0xab57('0x3e')]==='lead'){logger[_0xab57('0x1b')](_0xab57('0x42'),_0x57a01b,_0x2e66e8['moduleCreate']);_0x380a8e[_0xab57('0x3f')]=_0x1b0155!==_0xab57('0x40')?_0x1b0155:util[_0xab57('0x43')](_0xab57('0x41'),_0x57a01b);_0x380a8e[_0xab57('0x44')]='No\x20Company';}else if(_0x2e66e8[_0xab57('0x3e')]===_0xab57('0x16')){logger[_0xab57('0x1b')](_0xab57('0x42'),_0x57a01b,_0x2e66e8[_0xab57('0x3e')]);_0x380a8e[_0xab57('0x26')]=_0x1b0155!==''?_0x1b0155:util[_0xab57('0x43')](_0xab57('0x41'),_0x57a01b);}else{return null;}}return _0x567054[_0xab57('0x1d')](_[_0xab57('0x45')](_0x2e66e8[_0xab57('0x3e')]))[_0xab57('0x1e')](_0x380a8e)[_0xab57('0x23')](function(_0x5019d3){return BPromise[_0xab57('0x25')]({'id':_0x5019d3['id'],'endUserType':_0x2e66e8[_0xab57('0x3e')]});});}});}function getCustomFields(_0xe0dd32,_0x1370d4){var _0x125bcf={};if(_0xe0dd32[_0xab57('0x24')]>0x0){_[_0xab57('0x46')](_0xe0dd32,function(_0x3d28d7){if(_[_0xab57('0x47')]([_0xab57('0x48'),'picklist'],_0x3d28d7[_0xab57('0x49')])&&_0x3d28d7[_0xab57('0x4a')]){_0x125bcf[_0x3d28d7[_0xab57('0x4a')]]=_0x3d28d7[_0xab57('0x4b')][_0xab57('0x4c')]();}else if(_0x3d28d7[_0xab57('0x49')]===_0xab57('0x4d')&&_0x3d28d7[_0xab57('0x4e')]&&_0x3d28d7[_0xab57('0x4a')]){_0x1370d4[_0x3d28d7['variableName']]&&(_0x125bcf[_0x3d28d7[_0xab57('0x4a')]]=_0x1370d4[_0x3d28d7[_0xab57('0x4e')]]['toString']());}else if(_0x3d28d7[_0xab57('0x49')]===_0xab57('0x4f')&&_0x3d28d7['Variable']&&_0x3d28d7['Variable'][_0xab57('0x50')]&&_0x3d28d7[_0xab57('0x4a')]){_0x1370d4[_0x3d28d7[_0xab57('0x51')][_0xab57('0x50')][_0xab57('0x3c')]()]&&(_0x125bcf[_0x3d28d7['idField']]=_0x1370d4[_0x3d28d7['Variable'][_0xab57('0x50')][_0xab57('0x3c')]()]['toString']());}});}return _0x125bcf;}function getConnection(_0x3829c5){var _0x44ca1b=_0x3829c5[_0xab57('0x52')][_0xab57('0x53')](_0x3829c5['securityToken']);var _0x5c90d1=new jsforce[(_0xab57('0x54'))]({'oauth2':{'loginUrl':_0x3829c5[_0xab57('0x55')]||_0xab57('0x56'),'clientId':_0x3829c5[_0xab57('0x57')],'clientSecret':_0x3829c5[_0xab57('0x58')]}});return _0x5c90d1['login'](_0x3829c5[_0xab57('0x59')],_0x44ca1b)[_0xab57('0x23')](function(){logger[_0xab57('0x1b')]('Connection\x20established.');return _0x5c90d1;});}exports[_0xab57('0x5a')]=function(_0x4573b4,_0x18d342,_0x46c0be,_0x1e650e,_0x450314,_0x447d6b){var _0x4dd443,_0x22be70,_0x533883,_0x358fc1;_0x447d6b['serverUrl']=intUtil[_0xab57('0x5b')](_0x447d6b[_0xab57('0x5c')]);_0x447d6b[_0xab57('0x55')]=intUtil[_0xab57('0x5b')](_0x447d6b[_0xab57('0x55')]);if(_0x450314&&_0x450314[_0xab57('0x5d')]){logger[_0xab57('0x1b')](_0xab57('0x5e'),_0xab57('0x5f'));_0x18d342[_0xab57('0x60')]=util['format'](_0xab57('0x61'),_0x447d6b[_0xab57('0x5c')],_0x18d342['uniqueid'],md5(_0x18d342[_0xab57('0x62')]));}else{_0x18d342[_0xab57('0x60')]='';}return getConnection(_0x447d6b)[_0xab57('0x23')](function(_0x23d1d5){_0x358fc1=_0x23d1d5;return getUser(_0x447d6b,_0x1e650e[_0xab57('0x63')],_0x358fc1);})[_0xab57('0x23')](function(_0x23ccf1){_0x4dd443=_0x23ccf1;return getEndUser(_0x447d6b,_0x46c0be,_0x18d342[_0xab57('0x64')],_0x18d342[_0xab57('0x65')],_0x358fc1);})[_0xab57('0x23')](function(_0x489225){_0x22be70=_0x489225;return getTicket(_0x447d6b,_0x4dd443,_0x22be70,_0x46c0be,_0x18d342,_0x46c0be[_0xab57('0x66')],_0x358fc1,_0xab57('0x5a'));})[_0xab57('0x23')](function(_0x379a74){_0x533883=_0x379a74;logger[_0xab57('0x1b')](_0xab57('0x67'),_0x533883['id']);logger['info'](_0xab57('0x68'),_0x533883['id'],_0x1e650e[_0xab57('0x50')],_0x447d6b[_0xab57('0x49')]);switch(_0x447d6b['type']){case _0xab57('0x69'):emit(util[_0xab57('0x43')]('user:%s',_0x1e650e[_0xab57('0x50')]),_0xab57('0x6a'),{'recordId':_0x533883['id']});break;case'newTab':emit(util[_0xab57('0x43')](_0xab57('0x6b'),_0x1e650e['name']),_0xab57('0x6c'),{'uri':util[_0xab57('0x43')](_0xab57('0x6d'),_0x358fc1[_0xab57('0x6e')],_0x533883['id'])});break;default:logger[_0xab57('0x6f')](_0xab57('0x70'));}})[_0xab57('0x71')](function(_0x44bed3){logger['error'](_0xab57('0x5e'),_0x44bed3);});};exports[_0xab57('0x72')]=function(_0x574911,_0x132ed2,_0x4dc122,_0x1519b8,_0x265896,_0x337c49,_0x121452){var _0x480458,_0x2c17c0,_0x2146d5,_0x4bd3f3;_0x337c49[_0xab57('0x5c')]=intUtil[_0xab57('0x5b')](_0x337c49[_0xab57('0x5c')]);_0x337c49['remoteUri']=intUtil['stripTrailingSlash'](_0x337c49[_0xab57('0x55')]);if(_0x121452&&_0x121452[_0xab57('0x73')]&&_0x121452[_0xab57('0x73')]!=='none'){logger[_0xab57('0x1b')](_0xab57('0x74'),_0xab57('0x5f'));_0x132ed2[_0xab57('0x60')]=util['format'](_0xab57('0x61'),_0x337c49[_0xab57('0x5c')],_0x132ed2[_0xab57('0x62')],md5(_0x132ed2[_0xab57('0x62')]));}return getConnection(_0x337c49)['then'](function(_0x220016){_0x4bd3f3=_0x220016;return getUser(_0x337c49,_0x1519b8['email'],_0x4bd3f3);})[_0xab57('0x23')](function(_0x3a088c){_0x480458=_0x3a088c;return getEndUser(_0x337c49,_0x4dc122,_0x132ed2[_0xab57('0x75')],_0x132ed2[_0xab57('0x76')],_0x4bd3f3);})[_0xab57('0x23')](function(_0x26fa20){_0x2c17c0=_0x26fa20;return getTicket(_0x337c49,_0x480458,_0x2c17c0,_0x4dc122,_0x132ed2,_0x4dc122[_0xab57('0x66')],_0x4bd3f3,_0xab57('0x72'));})['then'](function(_0x5f2786){_0x2146d5=_0x5f2786;logger['info'](_0xab57('0x77'),_0x2146d5['id']);logger['info'](_0xab57('0x78'),_0x2146d5['id'],_0x1519b8[_0xab57('0x50')],_0x337c49[_0xab57('0x49')]);switch(_0x337c49[_0xab57('0x49')]){case _0xab57('0x69'):emit(util['format']('user:%s',_0x1519b8[_0xab57('0x50')]),_0xab57('0x6a'),{'recordId':_0x2146d5['id']});break;case'newTab':emit(util[_0xab57('0x43')]('user:%s',_0x1519b8[_0xab57('0x50')]),_0xab57('0x6c'),{'uri':util[_0xab57('0x43')](_0xab57('0x6d'),_0x4bd3f3[_0xab57('0x6e')],_0x2146d5['id'])});break;default:logger[_0xab57('0x6f')](_0xab57('0x74'),'Salesforce\x20account\x20type\x20not\x20recognized');}})[_0xab57('0x71')](function(_0x4b4e63){logger[_0xab57('0x6f')]('[OUTBOUND]',_0x4b4e63);});};exports[_0xab57('0x79')]=function(_0x554b90,_0x553848,_0x1730a9,_0x1c2093,_0x41be7b,_0x5d1f90){var _0x4b532b,_0x211f33,_0x141c5d,_0x2e355d;_0x5d1f90[_0xab57('0x5c')]=intUtil[_0xab57('0x5b')](_0x5d1f90[_0xab57('0x5c')]);_0x5d1f90[_0xab57('0x55')]=intUtil[_0xab57('0x5b')](_0x5d1f90[_0xab57('0x55')]);if(_0x41be7b&&_0x41be7b[_0xab57('0x5d')]){logger[_0xab57('0x1b')]('['+_0x553848[_0xab57('0x7a')][_0xab57('0x7b')]()+']',_0xab57('0x5f'));_0x553848[_0xab57('0x60')]=util[_0xab57('0x43')](_0xab57('0x61'),_0x5d1f90[_0xab57('0x5c')],_0x553848[_0xab57('0x62')],md5(_0x553848[_0xab57('0x62')]));}else{_0x553848[_0xab57('0x60')]='';}return getConnection(_0x5d1f90)['then'](function(_0x3692fb){_0x2e355d=_0x3692fb;if(!_['isNil'](_0x1c2093)){return getUser(_0x5d1f90,_0x1c2093[_0xab57('0x50')],_0x2e355d);}else{return getUser(_0x5d1f90,null,_0x2e355d);}})[_0xab57('0x23')](function(_0x1adc3f){_0x4b532b=_0x1adc3f;return getEndUser(_0x5d1f90,_0x1730a9,_0x553848[_0xab57('0x64')],_0x553848[_0xab57('0x65')],_0x2e355d);})[_0xab57('0x23')](function(_0x20e4f0){_0x211f33=_0x20e4f0;return getTicket(_0x5d1f90,_0x4b532b,_0x211f33,_0x1730a9,_0x553848,_0x1730a9['Fields'],_0x2e355d);})[_0xab57('0x23')](function(_0x59f3ce){_0x141c5d=_0x59f3ce;logger[_0xab57('0x1b')]('['+_0x553848[_0xab57('0x7a')][_0xab57('0x7b')]()+_0xab57('0x7c'),_0x141c5d['id']);logger[_0xab57('0x1b')]('['+_0x553848[_0xab57('0x7a')][_0xab57('0x7b')]()+_0xab57('0x7d'),_0x5d1f90[_0xab57('0x49')]);})[_0xab57('0x71')](function(_0x2b0e87){logger['error']('['+_0x553848[_0xab57('0x7a')][_0xab57('0x7b')]()+']',_0x2b0e87);});}; \ No newline at end of file +var _0x4db7=['identity','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','cloneDeep','additionalSearchContact','merge','$or','sobject','Contact','execute','additionalSearchLead','Lead','account_contact_lead','Account','first','Phone','attributes','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','','format','Caller\x20-\x20%s','Company','No\x20Company','upperFirst','forEach','includes','string','idField','toString','variable','variableName','customVariable','Variable','name','password','concat','remoteUri','https://login.salesforce.com','clientId','clientSecret','login','username','Connection\x20established.','queue','serverUrl','stripTrailingSlash','monitor_format','Recording\x20is\x20enabled!','uniqueid','calleridname','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','trigger:salesforce:display','newTab','trigger:browser:url','%s/%s/e','instanceUrl','error','catch','[QUEUE]','outbound','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','lastevent','toUpperCase','recordingURL',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','moment','bluebird','md5','./util','../../../../config/environment','../../../../config/logger','salesforce','redis','defaults','localhost','emit','assign','getString','Descriptions','ticketType','ActivityDate','utc','IsReminderSet','IsRecurrence','endUserType','account','WhatId','Case','contact','ContactId','lead','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','create','isNil','validateEmail','User','find','then','length','Email','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.'];(function(_0x32f97a,_0x1b5fba){var _0x17d7b2=function(_0x5358d6){while(--_0x5358d6){_0x32f97a['push'](_0x32f97a['shift']());}};_0x17d7b2(++_0x1b5fba);}(_0x4db7,0x1da));var _0x74db=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x4db7[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0x74db('0x0'));var rp=require('request-promise');var moment=require(_0x74db('0x1'));var BPromise=require(_0x74db('0x2'));var md5=require(_0x74db('0x3'));var jsforce=require('jsforce');var util=require('util');var Redis=require('ioredis');var intUtil=require(_0x74db('0x4'));var config=require(_0x74db('0x5'));var logger=require(_0x74db('0x6'))(_0x74db('0x7'));config[_0x74db('0x8')]=_[_0x74db('0x9')](config[_0x74db('0x8')],{'host':_0x74db('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x1eb9d8,_0x27aa6f,_0xf6d3b2){io['to'](_0x1eb9d8)[_0x74db('0xb')](_0x27aa6f,_0xf6d3b2);}function getTicket(_0x9bcd96,_0x27a55c,_0x6678b,_0x150ab2,_0x3b91fb,_0x339f3a,_0x29087b,_0x149437){var _0x5a74fd=Object[_0x74db('0xc')]({},{'OwnerId':_0x27a55c['id'],'Subject':intUtil[_0x74db('0xd')](_0x150ab2['Subjects'],_0x3b91fb,'\x20'),'Description':intUtil[_0x74db('0xd')](_0x150ab2[_0x74db('0xe')],_0x3b91fb,'\x0a')},getCustomFields(_0x339f3a,_0x3b91fb));if(_0x6678b){if(_0x150ab2[_0x74db('0xf')]==='Task'){_0x5a74fd[_0x74db('0x10')]=moment[_0x74db('0x11')]();_0x5a74fd[_0x74db('0x12')]=![];_0x5a74fd[_0x74db('0x13')]=![];if(_0x6678b[_0x74db('0x14')]==='contact'||_0x6678b['endUserType']==='lead'){_0x5a74fd['WhoId']=_0x6678b['id'];}else if(_0x6678b['endUserType']===_0x74db('0x15')){_0x5a74fd[_0x74db('0x16')]=_0x6678b['id'];}}else if(_0x150ab2[_0x74db('0xf')]===_0x74db('0x17')){if(_0x6678b[_0x74db('0x14')]===_0x74db('0x18')){_0x5a74fd[_0x74db('0x19')]=_0x6678b['id'];}else if(_0x6678b[_0x74db('0x14')]===_0x74db('0x15')){_0x5a74fd['AccountId']=_0x6678b['id'];}else if(_0x6678b[_0x74db('0x14')]===_0x74db('0x1a')&&_0x150ab2[_0x74db('0x1b')]){_0x5a74fd[_0x150ab2['leadId']]=_0x6678b['id'];}else{logger[_0x74db('0x1c')](_0x74db('0x1d'));}}}return _0x29087b['sobject'](_0x150ab2[_0x74db('0xf')])[_0x74db('0x1e')](_0x5a74fd);}function getUser(_0x40ad97,_0x5a24c1,_0x242102){if(!_[_0x74db('0x1f')](_0x5a24c1)&&intUtil[_0x74db('0x20')](_0x5a24c1)){var _0x36c5f1={'Email':_0x5a24c1};var _0x3bd384={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x242102['sobject'](_0x74db('0x21'))[_0x74db('0x22')](_0x36c5f1,_0x3bd384)['execute']()[_0x74db('0x23')](function(_0x4e45eb){if(_0x4e45eb[_0x74db('0x24')]){var _0x211eb0=_[_0x74db('0x22')](_0x4e45eb,function(_0x2d3b0d){return _0x2d3b0d[_0x74db('0x25')]===_0x5a24c1;});if(_0x211eb0){logger[_0x74db('0x1c')](_0x74db('0x26'),_0x5a24c1);return BPromise[_0x74db('0x27')]({'id':_0x211eb0['Id'],'name':_0x211eb0[_0x74db('0x28')]});}}else{logger['info'](_0x74db('0x29'),_0x5a24c1);return _0x242102[_0x74db('0x2a')]()[_0x74db('0x23')](function(_0x277dc1){return BPromise['resolve']({'id':_0x277dc1[_0x74db('0x2b')],'name':_0x277dc1[_0x74db('0x2c')]});});}});}else{logger[_0x74db('0x1c')](_0x74db('0x29'),_0x5a24c1);return _0x242102[_0x74db('0x2a')]()[_0x74db('0x23')](function(_0x480fea){return BPromise[_0x74db('0x27')]({'id':_0x480fea['user_id'],'name':_0x480fea[_0x74db('0x2c')]});});}}function getEndUser(_0x39038a,_0x582e10,_0x22cbe7,_0x3110b6,_0x3a2cee){var _0x4d5a04={'$or':{'Phone':_0x3110b6}};var _0x4d87f2={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x74db('0x27')]()[_0x74db('0x23')](function(){logger[_0x74db('0x1c')](_0x74db('0x2d'),_0x3110b6,_0x582e10[_0x74db('0x2e')]);switch(_0x582e10[_0x74db('0x2e')]){case'contact_lead':var _0x1001af=_[_0x74db('0x2f')](_0x4d5a04);if(_0x582e10[_0x74db('0x30')]){var _0xbc68da={};_0xbc68da[_0x582e10[_0x74db('0x30')]]=_0x3110b6;_[_0x74db('0x31')](_0x1001af[_0x74db('0x32')],_0xbc68da);}return _0x3a2cee[_0x74db('0x33')](_0x74db('0x34'))[_0x74db('0x22')](_0x1001af,_0x4d87f2)[_0x74db('0x35')]()[_0x74db('0x23')](function(_0x5ec88a){if(_0x5ec88a&&_0x5ec88a[_0x74db('0x24')]){return _0x5ec88a;}else{var _0x1d71b2=_[_0x74db('0x2f')](_0x4d5a04);if(_0x582e10['additionalSearchLead']){var _0x5dae9e={};_0x5dae9e[_0x582e10[_0x74db('0x36')]]=_0x3110b6;_[_0x74db('0x31')](_0x1d71b2[_0x74db('0x32')],_0x5dae9e);}return _0x3a2cee[_0x74db('0x33')](_0x74db('0x37'))[_0x74db('0x22')](_0x1d71b2,_0x4d87f2);}});case _0x74db('0x38'):var _0x52a990=_['cloneDeep'](_0x4d5a04);if(_0x582e10['additionalSearchAccount']){var _0xbc68da={};_0xbc68da[_0x582e10['additionalSearchAccount']]=_0x3110b6;_[_0x74db('0x31')](_0x52a990[_0x74db('0x32')],_0xbc68da);}return _0x3a2cee[_0x74db('0x33')](_0x74db('0x39'))[_0x74db('0x22')](_0x52a990,_0x4d87f2)['execute']()[_0x74db('0x23')](function(_0x22f751){if(_0x22f751&&_0x22f751['length']){return _0x22f751;}else{var _0x3aa2b7=_[_0x74db('0x2f')](_0x4d5a04);if(_0x582e10[_0x74db('0x30')]){var _0x4dd824={};_0x4dd824[_0x582e10['additionalSearchContact']]=_0x3110b6;_[_0x74db('0x31')](_0x3aa2b7['$or'],_0x4dd824);}return _0x3a2cee['sobject'](_0x74db('0x34'))[_0x74db('0x22')](_0x3aa2b7,_0x4d87f2)[_0x74db('0x23')](function(_0xf7207e){if(_0xf7207e&&_0xf7207e[_0x74db('0x24')]){return _0xf7207e;}else{var _0x603c=_['cloneDeep'](_0x4d5a04);if(_0x582e10[_0x74db('0x36')]){var _0x2d26c9={};_0x2d26c9[_0x582e10['additionalSearchLead']]=_0x3110b6;_[_0x74db('0x31')](_0x603c['$or'],_0x2d26c9);}return _0x3a2cee[_0x74db('0x33')](_0x74db('0x37'))[_0x74db('0x22')](_0x603c,_0x4d87f2);}});}});case'contact':var _0x1001af=_[_0x74db('0x2f')](_0x4d5a04);if(_0x582e10[_0x74db('0x30')]){var _0xbc68da={};_0xbc68da[_0x582e10[_0x74db('0x30')]]=_0x3110b6;_[_0x74db('0x31')](_0x1001af[_0x74db('0x32')],_0xbc68da);}return _0x3a2cee[_0x74db('0x33')](_0x74db('0x34'))['find'](_0x1001af,_0x4d87f2)[_0x74db('0x35')]();case _0x74db('0x1a'):var _0x4f6cb6=_['cloneDeep'](_0x4d5a04);if(_0x582e10[_0x74db('0x36')]){var _0xbc68da={};_0xbc68da[_0x582e10[_0x74db('0x36')]]=_0x3110b6;_['merge'](_0x4f6cb6['$or'],_0xbc68da);}return _0x3a2cee[_0x74db('0x33')](_0x74db('0x37'))[_0x74db('0x22')](_0x4f6cb6,_0x4d87f2);case _0x74db('0x15'):var _0x52a990=_[_0x74db('0x2f')](_0x4d5a04);if(_0x582e10['additionalSearchAccount']){var _0xbc68da={};_0xbc68da[_0x582e10['additionalSearchAccount']]=_0x3110b6;_['merge'](_0x52a990[_0x74db('0x32')],_0xbc68da);}return _0x3a2cee['sobject']('Account')[_0x74db('0x22')](_0x52a990,_0x4d87f2);default:return null;}})[_0x74db('0x23')](function(_0x446092){if(_0x446092&&_0x446092[_0x74db('0x24')]){var _0x31c8e8=_[_0x74db('0x3a')](_0x446092);if(_0x31c8e8){return BPromise['resolve']({'id':_0x31c8e8['Id'],'name':_0x31c8e8[_0x74db('0x28')],'phone':_0x31c8e8[_0x74db('0x3b')],'endUserType':_0x31c8e8[_0x74db('0x3c')][_0x74db('0x3d')][_0x74db('0x3e')]()});}}})[_0x74db('0x23')](function(_0x24001b){if(_0x24001b){logger[_0x74db('0x1c')](_0x74db('0x3f'),_0x24001b[_0x74db('0x14')],_0x3110b6);return BPromise[_0x74db('0x27')](_0x24001b);}else{logger[_0x74db('0x1c')](_0x74db('0x40'),_0x3110b6);var _0x2fa734={'Phone':_0x3110b6};if(_0x582e10[_0x74db('0x41')]){if(_0x582e10[_0x74db('0x41')]===_0x74db('0x18')){logger[_0x74db('0x1c')](_0x74db('0x42'),_0x3110b6,_0x582e10[_0x74db('0x41')]);_0x2fa734[_0x74db('0x43')]=_0x22cbe7!==_0x74db('0x44')?_0x22cbe7:util[_0x74db('0x45')](_0x74db('0x46'),_0x3110b6);}else if(_0x582e10[_0x74db('0x41')]===_0x74db('0x1a')){logger[_0x74db('0x1c')](_0x74db('0x42'),_0x3110b6,_0x582e10[_0x74db('0x41')]);_0x2fa734['LastName']=_0x22cbe7!==_0x74db('0x44')?_0x22cbe7:util[_0x74db('0x45')](_0x74db('0x46'),_0x3110b6);_0x2fa734[_0x74db('0x47')]=_0x74db('0x48');}else if(_0x582e10[_0x74db('0x41')]===_0x74db('0x15')){logger[_0x74db('0x1c')](_0x74db('0x42'),_0x3110b6,_0x582e10[_0x74db('0x41')]);_0x2fa734[_0x74db('0x28')]=_0x22cbe7!==_0x74db('0x44')?_0x22cbe7:util['format'](_0x74db('0x46'),_0x3110b6);}else{return null;}}return _0x3a2cee[_0x74db('0x33')](_[_0x74db('0x49')](_0x582e10['moduleCreate']))[_0x74db('0x1e')](_0x2fa734)[_0x74db('0x23')](function(_0x3bd953){return BPromise['resolve']({'id':_0x3bd953['id'],'endUserType':_0x582e10[_0x74db('0x41')]});});}});}function getCustomFields(_0x2baa2b,_0x42ead0){var _0x1c4e40={};if(_0x2baa2b[_0x74db('0x24')]>0x0){_[_0x74db('0x4a')](_0x2baa2b,function(_0x2758cd){if(_[_0x74db('0x4b')]([_0x74db('0x4c'),'picklist'],_0x2758cd[_0x74db('0x3d')])&&_0x2758cd[_0x74db('0x4d')]){_0x1c4e40[_0x2758cd[_0x74db('0x4d')]]=_0x2758cd['content'][_0x74db('0x4e')]();}else if(_0x2758cd[_0x74db('0x3d')]===_0x74db('0x4f')&&_0x2758cd[_0x74db('0x50')]&&_0x2758cd[_0x74db('0x4d')]){_0x42ead0[_0x2758cd[_0x74db('0x50')]]&&(_0x1c4e40[_0x2758cd[_0x74db('0x4d')]]=_0x42ead0[_0x2758cd[_0x74db('0x50')]]['toString']());}else if(_0x2758cd['type']===_0x74db('0x51')&&_0x2758cd['Variable']&&_0x2758cd[_0x74db('0x52')][_0x74db('0x53')]&&_0x2758cd[_0x74db('0x4d')]){_0x42ead0[_0x2758cd[_0x74db('0x52')][_0x74db('0x53')]['toLowerCase']()]&&(_0x1c4e40[_0x2758cd[_0x74db('0x4d')]]=_0x42ead0[_0x2758cd[_0x74db('0x52')]['name'][_0x74db('0x3e')]()]['toString']());}});}return _0x1c4e40;}function getConnection(_0x247102){var _0x47a36d=_0x247102[_0x74db('0x54')][_0x74db('0x55')](_0x247102['securityToken']);var _0x52d712=new jsforce['Connection']({'oauth2':{'loginUrl':_0x247102[_0x74db('0x56')]||_0x74db('0x57'),'clientId':_0x247102[_0x74db('0x58')],'clientSecret':_0x247102[_0x74db('0x59')]}});return _0x52d712[_0x74db('0x5a')](_0x247102[_0x74db('0x5b')],_0x47a36d)[_0x74db('0x23')](function(){logger[_0x74db('0x1c')](_0x74db('0x5c'));return _0x52d712;});}exports[_0x74db('0x5d')]=function(_0xbe004,_0x521af,_0x203655,_0x225d5f,_0x2ca1b1,_0x27d141){var _0xa02172,_0x3d586b,_0x24a166,_0x49425b;_0x27d141[_0x74db('0x5e')]=intUtil[_0x74db('0x5f')](_0x27d141[_0x74db('0x5e')]);_0x27d141['remoteUri']=intUtil['stripTrailingSlash'](_0x27d141[_0x74db('0x56')]);if(_0x2ca1b1&&_0x2ca1b1[_0x74db('0x60')]){logger['info']('[QUEUE]',_0x74db('0x61'));_0x521af['recordingURL']=util[_0x74db('0x45')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x27d141['serverUrl'],_0x521af[_0x74db('0x62')],md5(_0x521af[_0x74db('0x62')]));}else{_0x521af['recordingURL']='';}return getConnection(_0x27d141)[_0x74db('0x23')](function(_0x1159f7){_0x49425b=_0x1159f7;return getUser(_0x27d141,_0x225d5f['email'],_0x49425b);})['then'](function(_0x2dcf81){_0xa02172=_0x2dcf81;return getEndUser(_0x27d141,_0x203655,_0x521af[_0x74db('0x63')],_0x521af[_0x74db('0x64')],_0x49425b);})[_0x74db('0x23')](function(_0x4e53f6){_0x3d586b=_0x4e53f6;return getTicket(_0x27d141,_0xa02172,_0x3d586b,_0x203655,_0x521af,_0x203655[_0x74db('0x65')],_0x49425b,_0x74db('0x5d'));})[_0x74db('0x23')](function(_0xf3012b){_0x24a166=_0xf3012b;logger[_0x74db('0x1c')](_0x74db('0x66'),_0x24a166['id']);logger['info'](_0x74db('0x67'),_0x24a166['id'],_0x225d5f[_0x74db('0x53')],_0x27d141[_0x74db('0x3d')]);switch(_0x27d141[_0x74db('0x3d')]){case'integrationTab':emit(util['format']('user:%s',_0x225d5f[_0x74db('0x53')]),_0x74db('0x68'),{'recordId':_0x24a166['id']});break;case _0x74db('0x69'):emit(util[_0x74db('0x45')]('user:%s',_0x225d5f[_0x74db('0x53')]),_0x74db('0x6a'),{'uri':util[_0x74db('0x45')](_0x74db('0x6b'),_0x49425b[_0x74db('0x6c')],_0x24a166['id'])});break;default:logger[_0x74db('0x6d')]('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})[_0x74db('0x6e')](function(_0x18ae61){logger[_0x74db('0x6d')](_0x74db('0x6f'),_0x18ae61);});};exports[_0x74db('0x70')]=function(_0x283fdf,_0x31f59b,_0x154d72,_0x17b8fd,_0x1791f1,_0x5d1f9a,_0x1ca3b6){var _0x1b863c,_0x4ac0e3,_0xada48f,_0x2471d0;_0x5d1f9a[_0x74db('0x5e')]=intUtil[_0x74db('0x5f')](_0x5d1f9a[_0x74db('0x5e')]);_0x5d1f9a[_0x74db('0x56')]=intUtil[_0x74db('0x5f')](_0x5d1f9a['remoteUri']);if(_0x1ca3b6&&_0x1ca3b6[_0x74db('0x71')]&&_0x1ca3b6[_0x74db('0x71')]!==_0x74db('0x72')){logger[_0x74db('0x1c')](_0x74db('0x73'),_0x74db('0x61'));_0x31f59b['recordingURL']=util[_0x74db('0x45')](_0x74db('0x74'),_0x5d1f9a[_0x74db('0x5e')],_0x31f59b[_0x74db('0x62')],md5(_0x31f59b[_0x74db('0x62')]));}return getConnection(_0x5d1f9a)[_0x74db('0x23')](function(_0x403ddc){_0x2471d0=_0x403ddc;return getUser(_0x5d1f9a,_0x17b8fd['email'],_0x2471d0);})['then'](function(_0x180d14){_0x1b863c=_0x180d14;return getEndUser(_0x5d1f9a,_0x154d72,_0x31f59b[_0x74db('0x75')],_0x31f59b['destcalleridnum'],_0x2471d0);})[_0x74db('0x23')](function(_0x5c2a62){_0x4ac0e3=_0x5c2a62;return getTicket(_0x5d1f9a,_0x1b863c,_0x4ac0e3,_0x154d72,_0x31f59b,_0x154d72['Fields'],_0x2471d0,_0x74db('0x70'));})[_0x74db('0x23')](function(_0x200c2e){_0xada48f=_0x200c2e;logger[_0x74db('0x1c')](_0x74db('0x76'),_0xada48f['id']);logger[_0x74db('0x1c')](_0x74db('0x77'),_0xada48f['id'],_0x17b8fd[_0x74db('0x53')],_0x5d1f9a[_0x74db('0x3d')]);switch(_0x5d1f9a[_0x74db('0x3d')]){case _0x74db('0x78'):emit(util[_0x74db('0x45')](_0x74db('0x79'),_0x17b8fd[_0x74db('0x53')]),'trigger:salesforce:display',{'recordId':_0xada48f['id']});break;case'newTab':emit(util[_0x74db('0x45')](_0x74db('0x79'),_0x17b8fd[_0x74db('0x53')]),_0x74db('0x6a'),{'uri':util[_0x74db('0x45')](_0x74db('0x6b'),_0x2471d0[_0x74db('0x6c')],_0xada48f['id'])});break;default:logger[_0x74db('0x6d')](_0x74db('0x73'),_0x74db('0x7a'));}})[_0x74db('0x6e')](function(_0x3e100b){logger[_0x74db('0x6d')](_0x74db('0x73'),_0x3e100b);});};exports[_0x74db('0x7b')]=function(_0x2ffc45,_0x354b90,_0x3ff462,_0x50fd13,_0x3d32b3,_0x2f6085){var _0x2ecaaf,_0x1167b4,_0x1f742d,_0x12cb60;_0x2f6085['serverUrl']=intUtil['stripTrailingSlash'](_0x2f6085[_0x74db('0x5e')]);_0x2f6085['remoteUri']=intUtil['stripTrailingSlash'](_0x2f6085['remoteUri']);if(_0x3d32b3&&_0x3d32b3[_0x74db('0x60')]){logger['info']('['+_0x354b90[_0x74db('0x7c')][_0x74db('0x7d')]()+']',_0x74db('0x61'));_0x354b90[_0x74db('0x7e')]=util[_0x74db('0x45')](_0x74db('0x74'),_0x2f6085['serverUrl'],_0x354b90[_0x74db('0x62')],md5(_0x354b90[_0x74db('0x62')]));}else{_0x354b90[_0x74db('0x7e')]='';}return getConnection(_0x2f6085)[_0x74db('0x23')](function(_0x529a1a){_0x12cb60=_0x529a1a;if(!_[_0x74db('0x1f')](_0x50fd13)){return getUser(_0x2f6085,_0x50fd13[_0x74db('0x53')],_0x12cb60);}else{return getUser(_0x2f6085,null,_0x12cb60);}})[_0x74db('0x23')](function(_0x2b0bb7){_0x2ecaaf=_0x2b0bb7;return getEndUser(_0x2f6085,_0x3ff462,_0x354b90[_0x74db('0x63')],_0x354b90[_0x74db('0x64')],_0x12cb60);})['then'](function(_0xeb0be6){_0x1167b4=_0xeb0be6;return getTicket(_0x2f6085,_0x2ecaaf,_0x1167b4,_0x3ff462,_0x354b90,_0x3ff462[_0x74db('0x65')],_0x12cb60);})[_0x74db('0x23')](function(_0x1e0380){_0x1f742d=_0x1e0380;logger[_0x74db('0x1c')]('['+_0x354b90[_0x74db('0x7c')][_0x74db('0x7d')]()+_0x74db('0x7f'),_0x1f742d['id']);logger[_0x74db('0x1c')]('['+_0x354b90[_0x74db('0x7c')][_0x74db('0x7d')]()+_0x74db('0x80'),_0x2f6085['type']);})['catch'](function(_0x2d48c2){logger['error']('['+_0x354b90[_0x74db('0x7c')][_0x74db('0x7d')]()+']',_0x2d48c2);});}; \ 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 b50e18d..0d7e0be 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 _0x4e84=['],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','],\x20getEndUser\x20crm','forEach','includes','string','picklist','nameField','customField','toLowerCase','content','toString','idField','type','variable','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','POST','incident','assign','getString','Subjects','Descriptions',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number',']\x20getTicket\x20crm','label','Incident','Incident\x20-\x20','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','%26sysparm_record_target%3Dincident','%255EORDERBYDESCnumber','format','user:%s','emit','trigger:browser:url','username','password','sysparm_display_value=true','remoteUri','serverUrl','%s/api/now/table/','isNil','email','destcalleridnum','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','recordingURL','recordingFormat','none','Recording\x20is\x20enabled!','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','lodash','bluebird','request-promise','util','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','defaults','redis','localhost','sys_user?sysparm_query=user_name%3Dadmin','result','length','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','],\x20getUser\x20input\x20crm','validateEmail','userEmail','sys_user?sysparm_query=email%3D','then','],\x20getUser\x20entity','true','userId','adminId','adminEmail',']\x20using\x20admin\x20profile','sys_user?','endUserNumber','user','System'];(function(_0x54cfcf,_0x3ecf5b){var _0x1c2060=function(_0x484a41){while(--_0x484a41){_0x54cfcf['push'](_0x54cfcf['shift']());}};_0x1c2060(++_0x3ecf5b);}(_0x4e84,0x183));var _0x44e8=function(_0x2eab35,_0xd8bab0){_0x2eab35=_0x2eab35-0x0;var _0x146028=_0x4e84[_0x2eab35];return _0x146028;};'use strict';var _=require(_0x44e8('0x0'));var Promise=require(_0x44e8('0x1'));var rp=require(_0x44e8('0x2'));var util=require(_0x44e8('0x3'));var md5=require(_0x44e8('0x4'));var Redis=require(_0x44e8('0x5'));var intUtil=require(_0x44e8('0x6'));var config=require(_0x44e8('0x7'));var logger=require(_0x44e8('0x8'))('servicenow');config['redis']=_[_0x44e8('0x9')](config[_0x44e8('0xa')],{'host':_0x44e8('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function getAdminUser(_0x100c81,_0x4ee326,_0x57510c,_0x2b2e59,_0x21ebda,_0x2f58a9){return new Promise(function(_0x310c8d,_0x3c11b7){var _0x229427={'method':'GET','uri':_0x2b2e59+_0x44e8('0xc')+'&'+_0x21ebda+'&'+_0x2f58a9,'auth':_0x4ee326,'json':!![]};return rp(_0x229427)['then'](function(_0x379a74){if(_0x379a74[_0x44e8('0xd')][_0x44e8('0xe')]>0x0){_0x57510c['adminId']=_0x379a74[_0x44e8('0xd')][0x0][_0x44e8('0xf')];}logger[_0x44e8('0x10')]('['+[_0x100c81[_0x44e8('0x11')]()]+_0x44e8('0x12'),_0x57510c);_0x310c8d(_0x57510c);})[_0x44e8('0x13')](function(_0x16efe6){logger[_0x44e8('0x14')]('['+[_0x100c81[_0x44e8('0x11')]()]+']',_0x16efe6[_0x44e8('0x15')]);_0x3c11b7(_0x16efe6[_0x44e8('0x15')]);});});}function getUser(_0x2b6fff,_0x397cbc,_0x3d64e4,_0x1d1f60,_0x15c101){return function(_0x5dff08){logger[_0x44e8('0x10')]('['+[_0x2b6fff[_0x44e8('0x11')]()]+_0x44e8('0x16'),_0x5dff08);return new Promise(function(_0x4f6e8d,_0x25290a){if(intUtil[_0x44e8('0x17')](_0x5dff08[_0x44e8('0x18')])){var _0x4849f5={'method':'GET','uri':_0x3d64e4+_0x44e8('0x19')+_0x5dff08[_0x44e8('0x18')]+'&'+_0x1d1f60+'&'+_0x15c101,'auth':_0x397cbc,'json':!![]};logger[_0x44e8('0x10')]('['+[_0x2b6fff[_0x44e8('0x11')]()]+'],\x20getUser\x20rp\x20obj',_0x4849f5);return rp(_0x4849f5)[_0x44e8('0x1a')](function(_0x4ca6ab){logger[_0x44e8('0x10')]('['+[_0x2b6fff[_0x44e8('0x11')]()]+_0x44e8('0x1b'),_0x4ca6ab);if(_0x4ca6ab['result'][_0x44e8('0xe')]>0x0&&String(_0x4ca6ab['result'][0x0]['active'])===_0x44e8('0x1c')){_0x5dff08[_0x44e8('0x1d')]=_0x4ca6ab['result'][0x0][_0x44e8('0xf')];}else{_0x5dff08[_0x44e8('0x1d')]=_0x5dff08[_0x44e8('0x1e')];_0x5dff08[_0x44e8('0x18')]=_0x5dff08[_0x44e8('0x1f')];}logger[_0x44e8('0x10')]('['+[_0x2b6fff[_0x44e8('0x11')]()]+'],\x20getUser\x20crm',_0x5dff08);_0x4f6e8d(_0x5dff08);})[_0x44e8('0x13')](function(_0x357ff5){logger['error']('['+[_0x2b6fff[_0x44e8('0x11')]()]+']',_0x357ff5['message']);_0x25290a(_0x357ff5['message']);});}else{logger[_0x44e8('0x10')]('['+[_0x2b6fff[_0x44e8('0x11')]()]+_0x44e8('0x20'));_0x5dff08[_0x44e8('0x1d')]=_0x5dff08[_0x44e8('0x1e')];_0x5dff08['userEmail']=_0x5dff08[_0x44e8('0x1f')];_0x4f6e8d(_0x5dff08);}});};}function createEndUser(_0xce7a1a,_0x4f3087,_0x2f775c,_0x16e9e6,_0x7c7631){logger[_0x44e8('0x10')]('['+[_0xce7a1a[_0x44e8('0x11')]()]+'],\x20createEndUser\x20input\x20crm',_0x2f775c);return new Promise(function(_0x1d82a4,_0x249c5b){var _0x2583c7={'method':'POST','uri':_0x16e9e6+_0x44e8('0x21')+_0x7c7631,'body':{'user_name':_0x2f775c[_0x44e8('0x22')],'roles':_0x44e8('0x23'),'first_name':_0x2f775c[_0x44e8('0x22')],'active':_0x44e8('0x1c'),'date_format':_0x44e8('0x24'),'phone':_0x2f775c[_0x44e8('0x22')]},'auth':_0x4f3087,'json':!![]};return rp(_0x2583c7)[_0x44e8('0x1a')](function(_0x59a6c3){logger[_0x44e8('0x10')]('['+[_0xce7a1a[_0x44e8('0x11')]()]+_0x44e8('0x25'),_0x59a6c3[_0x44e8('0xd')]);_0x2f775c[_0x44e8('0x26')]=_0x59a6c3[_0x44e8('0xd')][_0x44e8('0xf')];_0x1d82a4(_0x2f775c);})[_0x44e8('0x13')](function(_0x1f37e5){logger[_0x44e8('0x14')]('['+[_0xce7a1a[_0x44e8('0x11')]()]+']',_0x1f37e5[_0x44e8('0x15')]);_0x249c5b(_0x1f37e5[_0x44e8('0x15')]);});});}function getEndUser(_0x2b0371,_0x56fff4,_0x3f658b,_0x291908,_0x5d3d36){return function(_0x318068){logger[_0x44e8('0x10')]('['+[_0x2b0371[_0x44e8('0x11')]()]+_0x44e8('0x27'),_0x318068);return new Promise(function(_0xa917c5,_0x1d6818){var _0x2b0684={'method':'GET','uri':_0x3f658b+'sys_user?sysparm_query=phone%3D'+_0x318068['endUserNumber']+'&'+_0x291908+'&'+_0x5d3d36,'auth':_0x56fff4,'json':!![]};return rp(_0x2b0684)[_0x44e8('0x1a')](function(_0x3ec28d){if(_0x3ec28d[_0x44e8('0xd')][_0x44e8('0xe')]>0x0){_0x318068[_0x44e8('0x26')]=_0x3ec28d[_0x44e8('0xd')][0x0][_0x44e8('0xf')];logger[_0x44e8('0x10')]('['+[_0x2b0371['toUpperCase']()]+_0x44e8('0x28'),_0x318068);_0xa917c5(_0x318068);}else{return createEndUser(_0x2b0371,_0x56fff4,_0x318068,_0x3f658b,_0x291908)['then'](function(_0x2d67d3){logger[_0x44e8('0x10')]('['+[_0x2b0371['toUpperCase']()]+'],\x20createEndUser\x20crm',_0x2d67d3);_0xa917c5(_0x2d67d3);});}})[_0x44e8('0x13')](function(_0x190b1d){logger[_0x44e8('0x14')]('['+[_0x2b0371[_0x44e8('0x11')]()]+']',_0x190b1d[_0x44e8('0x15')]);_0x1d6818(_0x190b1d['message']);});});};}function getCustomFields(_0x234783,_0x5c743f){var _0x582c73={};if(_0x234783[_0x44e8('0xe')]>0x0){_[_0x44e8('0x29')](_0x234783,function(_0x5ba3ac){if(_[_0x44e8('0x2a')]([_0x44e8('0x2b'),_0x44e8('0x2c')],_0x5ba3ac['type'])&&_0x5ba3ac[_0x44e8('0x2d')]&&!_0x5ba3ac[_0x44e8('0x2e')]){_0x582c73[_0x5ba3ac['nameField'][_0x44e8('0x2f')]()]=_0x5ba3ac[_0x44e8('0x30')][_0x44e8('0x31')]();}else if(_['includes']([_0x44e8('0x2b'),_0x44e8('0x2c')],_0x5ba3ac['type'])&&_0x5ba3ac['idField']&&_0x5ba3ac[_0x44e8('0x2e')]){_0x582c73[_0x5ba3ac[_0x44e8('0x32')][_0x44e8('0x2f')]()]=_0x5ba3ac[_0x44e8('0x30')]['toString']();}else if(_0x5ba3ac[_0x44e8('0x33')]===_0x44e8('0x34')&&_0x5ba3ac['variableName']&&_0x5ba3ac[_0x44e8('0x32')]&&_0x5ba3ac[_0x44e8('0x2e')]){_0x582c73[_0x5ba3ac[_0x44e8('0x32')][_0x44e8('0x2f')]()]=_0x5c743f[_0x5ba3ac[_0x44e8('0x35')]][_0x44e8('0x31')]();}else if(_0x5ba3ac[_0x44e8('0x33')]===_0x44e8('0x36')&&_0x5ba3ac[_0x44e8('0x37')]&&_0x5ba3ac[_0x44e8('0x37')][_0x44e8('0x38')]&&_0x5ba3ac[_0x44e8('0x32')]&&_0x5ba3ac[_0x44e8('0x2e')]){_0x582c73[_0x5ba3ac['idField']['toLowerCase']()]=_0x5c743f[_0x5ba3ac[_0x44e8('0x37')][_0x44e8('0x38')][_0x44e8('0x2f')]()][_0x44e8('0x31')]();}});}return _0x582c73;}function getTicket(_0x2e978e,_0x265391,_0x1f126f,_0x164a6c,_0x4bd601,_0x5a4caf){return function(_0x56a9ee){logger['info']('['+[_0x2e978e[_0x44e8('0x11')]()]+_0x44e8('0x39'),_0x56a9ee);return new Promise(function(_0x4f49f9,_0x160374){var _0x50ace0=_0x2e978e[_0x44e8('0x2f')]()==='outbound'?_0x56a9ee[_0x44e8('0x1d')]:_0x56a9ee[_0x44e8('0x26')];var _0x177078={'method':_0x44e8('0x3a'),'uri':_0x1f126f+_0x44e8('0x3b')+'?'+_0x5a4caf,'body':Object[_0x44e8('0x3c')]({},{'active':_0x44e8('0x1c'),'caller_id':_0x50ace0,'assigned_to':_0x56a9ee[_0x44e8('0x1d')],'short_description':intUtil[_0x44e8('0x3d')](_0x164a6c[_0x44e8('0x3e')],_0x4bd601,'\x20'),'description':intUtil[_0x44e8('0x3d')](_0x164a6c[_0x44e8('0x3f')],_0x4bd601,'\x0a')},getCustomFields(_0x164a6c['Fields'],_0x4bd601)),'auth':_0x265391,'json':!![]};return rp(_0x177078)[_0x44e8('0x1a')](function(_0x33c76c){logger['info']('['+[_0x2e978e[_0x44e8('0x11')]()]+_0x44e8('0x40'),_0x33c76c[_0x44e8('0xd')]);_0x56a9ee[_0x44e8('0x41')]=_0x33c76c[_0x44e8('0xd')][_0x44e8('0xf')];_0x56a9ee[_0x44e8('0x42')]=_0x33c76c[_0x44e8('0xd')][_0x44e8('0x43')];logger[_0x44e8('0x10')]('['+[_0x2e978e[_0x44e8('0x11')]()]+_0x44e8('0x44'),_0x56a9ee);_0x4f49f9(_0x56a9ee);})[_0x44e8('0x13')](function(_0x1ea033){logger[_0x44e8('0x14')]('['+[_0x2e978e[_0x44e8('0x11')]()]+']',_0x1ea033[_0x44e8('0x15')]);_0x160374(_0x1ea033[_0x44e8('0x15')]);});});};}function createRemoteTag(_0x16363b,_0x57e418,_0x4ff037,_0x7fcf55){return new Promise(function(_0x5d3258,_0x5138ac){var _0x189d51={'method':'POST','uri':_0x4ff037+_0x44e8('0x45')+'?'+_0x7fcf55,'body':{'short_description':_0x16363b,'global':!![],'active':!![],'name':_0x16363b},'auth':_0x57e418,'json':!![]};return rp(_0x189d51)[_0x44e8('0x1a')](function(_0x455df6){var _0x4973ad=_0x455df6[_0x44e8('0xd')][_0x44e8('0xf')];_0x5d3258(_0x4973ad);});});}function getRemoteTag(_0x202657,_0x45ac60,_0xb13d76,_0xcb65d9,_0x413c67){return new Promise(function(_0x27c196,_0x23da6d){var _0x120ae9={'method':'GET','uri':_0xb13d76+'label'+'?sysparm_query=name%3D'+_0x202657+'&'+_0xcb65d9,'auth':_0x45ac60,'json':!![]};return rp(_0x120ae9)[_0x44e8('0x1a')](function(_0x50957b){if(_0x50957b[_0x44e8('0xd')][_0x44e8('0xe')]>0x0){var _0x508ba6=_0x50957b['result'][0x0][_0x44e8('0xf')];_0x27c196(_0x508ba6);}else{return createRemoteTag(_0x202657,_0x45ac60,_0xb13d76,_0xcb65d9)[_0x44e8('0x1a')](function(_0x44797b){_0x27c196(_0x44797b);});}});});}function assignTagToIncident(_0x577111,_0x2584a3,_0x4f070a,_0x34dff3,_0x11b589){return new Promise(function(_0x51ffe0,_0x6c1e53){var _0x2f454a={'method':'POST','uri':_0x4f070a+'label_entry'+'?'+_0x11b589,'body':{'label':_0x577111,'table':_0x44e8('0x3b'),'id_type':_0x44e8('0x46'),'table_key':_0x34dff3['ticketId'],'title':_0x44e8('0x47')+_0x34dff3[_0x44e8('0x42')],'id_display':_0x34dff3[_0x44e8('0x42')]},'auth':_0x2584a3,'json':!![]};return rp(_0x2f454a)[_0x44e8('0x1a')](function(_0x3ec47b){_0x51ffe0();})[_0x44e8('0x13')](function(){_0x51ffe0();});});}function manageTags(_0x5994b2,_0x1f3f43,_0x5e2822,_0x16fec0,_0x1165bd,_0x269a3c,_0x79f43f){return new Promise(function(_0x3313a6,_0x54b6ca){var _0x266532=[];_0x1f3f43[_0x44e8('0x29')](function(_0xb05e5){_0x266532[_0x44e8('0x48')](getRemoteTag(_0xb05e5,_0x5e2822,_0x16fec0,_0x269a3c,_0x79f43f));});return Promise[_0x44e8('0x49')](_0x266532)[_0x44e8('0x1a')](function(_0x3314a1){if(_0x3314a1['length']){logger[_0x44e8('0x10')]('['+[_0x5994b2[_0x44e8('0x11')]()]+_0x44e8('0x4a'),_0x3314a1);var _0x15352=[];_0x3314a1['forEach'](function(_0x504772){_0x15352[_0x44e8('0x48')](assignTagToIncident(_0x504772,_0x5e2822,_0x16fec0,_0x1165bd,_0x269a3c));});return Promise[_0x44e8('0x49')](_0x15352)[_0x44e8('0x1a')](function(){_0x3313a6();})[_0x44e8('0x13')](function(){_0x3313a6();});}else{_0x3313a6();}});});}function getTags(_0x4dc14e,_0x4b3e3f,_0x262af3,_0x105eb6,_0x1f97fa,_0x5bc21a){return function(_0x429c3f){return new Promise(function(_0x4ea48d,_0x49f94a){var _0xd36c1c=[];var _0x21729d=_0x105eb6[_0x44e8('0x4b')];if(_0x21729d&&_0x21729d[_0x44e8('0xe')]>0x0){_0xd36c1c=_[_0x44e8('0x4c')](_0x21729d,_0x44e8('0x38'));}if(_0xd36c1c['length']>0x0){return manageTags(_0x4dc14e,_0xd36c1c,_0x4b3e3f,_0x262af3,_0x429c3f,_0x1f97fa,_0x5bc21a)[_0x44e8('0x1a')](function(){_0x4ea48d(_0x429c3f);});}else{_0x4ea48d(_0x429c3f);}});};}function emit(_0x53c27f,_0x572c07,_0x60acd1){var _0x33f2d8=_0x44e8('0x4d')+'%26sysparm_record_row%3D1%26sysparm_record_rows%3D39'+'%26sysparm_record_list%3Dactive%253Dtrue'+_0x44e8('0x4e');var _0x41830d={'uri':_0x53c27f+'/nav_to.do?uri=incident.do?sys_id%3D'+_0x60acd1+_0x33f2d8};io['to'](util[_0x44e8('0x4f')](_0x44e8('0x50'),_0x572c07))[_0x44e8('0x51')](_0x44e8('0x52'),_0x41830d);}exports['cs']=function(_0x42a482,_0x6a9574,_0x2c796a,_0x340382,_0x3aa9f7,_0x2679fb,_0x1aadb5,_0x2215f1){var _0x4f1ca7={};var _0x1628cb={'user':_0x2679fb[_0x44e8('0x53')],'pass':_0x2679fb[_0x44e8('0x54')]};var _0x34e263='sysparm_limit=1';var _0xd22ad1=_0x44e8('0x55');_0x2679fb[_0x44e8('0x56')]=intUtil['stripTrailingSlash'](_0x2679fb[_0x44e8('0x56')]);_0x2679fb[_0x44e8('0x57')]=intUtil['stripTrailingSlash'](_0x2679fb[_0x44e8('0x57')]);var _0xcac68f=util[_0x44e8('0x4f')](_0x44e8('0x58'),_0x2679fb[_0x44e8('0x56')]);_0x4f1ca7[_0x44e8('0x18')]=!_[_0x44e8('0x59')](_0x340382)?_0x340382['email']:null;_0x4f1ca7[_0x44e8('0x1f')]=_0x2679fb[_0x44e8('0x5a')];_0x4f1ca7[_0x44e8('0x22')]=_0x2215f1[_0x44e8('0x2f')]()==='outbound'?_0x6a9574[_0x44e8('0x5b')]:_0x6a9574[_0x44e8('0x5c')];_0x4f1ca7[_0x44e8('0x5d')]=_0x2215f1===_0x44e8('0x5e')||_0x2215f1===_0x44e8('0x5f')?_0x44e8('0x5e'):'outbound';var _0xe1a6aa=util[_0x44e8('0x4f')](_0x44e8('0x60'),_0x2679fb[_0x44e8('0x57')],_0x6a9574[_0x44e8('0x61')],md5(_0x6a9574[_0x44e8('0x61')]));if(_0x3aa9f7&&_0x3aa9f7['monitor_format']){logger[_0x44e8('0x10')](_0x44e8('0x62'),'Recording\x20is\x20enabled!');_0x6a9574[_0x44e8('0x63')]=_0xe1a6aa;}else if(_0x1aadb5&&_0x1aadb5[_0x44e8('0x64')]&&_0x1aadb5[_0x44e8('0x64')]!==_0x44e8('0x65')){logger[_0x44e8('0x10')]('[OUTBOUND]',_0x44e8('0x66'));_0x6a9574[_0x44e8('0x63')]=_0xe1a6aa;}else{_0x6a9574['recordingURL']='';}return getAdminUser(_0x2215f1,_0x1628cb,_0x4f1ca7,_0xcac68f,_0xd22ad1,_0x34e263)['then'](getUser(_0x2215f1,_0x1628cb,_0xcac68f,_0xd22ad1,_0x34e263))[_0x44e8('0x1a')](getEndUser(_0x2215f1,_0x1628cb,_0xcac68f,_0xd22ad1,_0x34e263))[_0x44e8('0x1a')](getTicket(_0x2215f1,_0x1628cb,_0xcac68f,_0x2c796a,_0x6a9574,_0xd22ad1))[_0x44e8('0x1a')](function(_0x26fb5b){logger['info'](util['format']('The\x20ticket\x20ID\x20is:\x20%s',_0x26fb5b[_0x44e8('0x41')]));logger[_0x44e8('0x10')](util[_0x44e8('0x4f')](_0x44e8('0x67'),_0x2215f1));if(_0x2215f1!==_0x44e8('0x5f')){logger[_0x44e8('0x10')]('['+[_0x2215f1[_0x44e8('0x11')]()]+']',_0x44e8('0x68'));emit(_0x2679fb[_0x44e8('0x56')],_0x340382['name'],_0x26fb5b[_0x44e8('0x41')]);}})['catch'](function(_0x5127c6){logger[_0x44e8('0x14')]('['+[_0x2215f1['toUpperCase']()]+_0x44e8('0x69'),util['inspect'](_0x5127c6,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xa3c1=['sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','then','],\x20getUser\x20entity','active','userId','adminId','adminEmail','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','user','System','],\x20getEndUser\x20input\x20crm','GET','sys_user?sysparm_query=phone%3D','endUserId','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','includes','string','picklist','type','customField','nameField','toLowerCase','content','idField','toString','variable','variableName','customVariable','Variable','name','outbound','assign','true','getString','Subjects','Descriptions','ticketId','ticketNumber','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','incident','Incident','push','all','Tags','map','%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','trigger:browser:url','username','password','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','email','destcalleridnum','callDirection','queue','unmanaged','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','inspect','lodash','util','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','servicenow','redis','localhost','socket.io-emitter','sys_user?sysparm_query=user_name%3Dadmin','result','length','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','validateEmail','userEmail'];(function(_0x55518a,_0x15c3bc){var _0x2afeee=function(_0x24a30e){while(--_0x24a30e){_0x55518a['push'](_0x55518a['shift']());}};_0x2afeee(++_0x15c3bc);}(_0xa3c1,0x12a));var _0x1a3c=function(_0x3cca3a,_0x256a78){_0x3cca3a=_0x3cca3a-0x0;var _0xcbd284=_0xa3c1[_0x3cca3a];return _0xcbd284;};'use strict';var _=require(_0x1a3c('0x0'));var Promise=require('bluebird');var rp=require('request-promise');var util=require(_0x1a3c('0x1'));var md5=require(_0x1a3c('0x2'));var Redis=require(_0x1a3c('0x3'));var intUtil=require(_0x1a3c('0x4'));var config=require(_0x1a3c('0x5'));var logger=require(_0x1a3c('0x6'))(_0x1a3c('0x7'));config[_0x1a3c('0x8')]=_['defaults'](config['redis'],{'host':_0x1a3c('0x9'),'port':0x18eb});var io=require(_0x1a3c('0xa'))(new Redis(config['redis']));function getAdminUser(_0x36f01f,_0x21f927,_0x3ea357,_0x33435d,_0x1726ec,_0x3a05e3){return new Promise(function(_0x3be96e,_0x38c1e3){var _0x319fa9={'method':'GET','uri':_0x33435d+_0x1a3c('0xb')+'&'+_0x1726ec+'&'+_0x3a05e3,'auth':_0x21f927,'json':!![]};return rp(_0x319fa9)['then'](function(_0x380be1){if(_0x380be1[_0x1a3c('0xc')][_0x1a3c('0xd')]>0x0){_0x3ea357['adminId']=_0x380be1['result'][0x0][_0x1a3c('0xe')];}logger[_0x1a3c('0xf')]('['+[_0x36f01f[_0x1a3c('0x10')]()]+_0x1a3c('0x11'),_0x3ea357);_0x3be96e(_0x3ea357);})[_0x1a3c('0x12')](function(_0x14a089){logger[_0x1a3c('0x13')]('['+[_0x36f01f[_0x1a3c('0x10')]()]+']',_0x14a089[_0x1a3c('0x14')]);_0x38c1e3(_0x14a089['message']);});});}function getUser(_0x1d9b12,_0xae5bab,_0x49abf6,_0x36ce09,_0x2ce397){return function(_0x176006){logger[_0x1a3c('0xf')]('['+[_0x1d9b12[_0x1a3c('0x10')]()]+'],\x20getUser\x20input\x20crm',_0x176006);return new Promise(function(_0x4d0750,_0x1632b3){if(intUtil[_0x1a3c('0x15')](_0x176006[_0x1a3c('0x16')])){var _0x59d1d8={'method':'GET','uri':_0x49abf6+_0x1a3c('0x17')+_0x176006[_0x1a3c('0x16')]+'&'+_0x36ce09+'&'+_0x2ce397,'auth':_0xae5bab,'json':!![]};logger[_0x1a3c('0xf')]('['+[_0x1d9b12[_0x1a3c('0x10')]()]+_0x1a3c('0x18'),_0x59d1d8);return rp(_0x59d1d8)[_0x1a3c('0x19')](function(_0x366a55){logger[_0x1a3c('0xf')]('['+[_0x1d9b12[_0x1a3c('0x10')]()]+_0x1a3c('0x1a'),_0x366a55);if(_0x366a55[_0x1a3c('0xc')]['length']>0x0&&String(_0x366a55[_0x1a3c('0xc')][0x0][_0x1a3c('0x1b')])==='true'){_0x176006[_0x1a3c('0x1c')]=_0x366a55[_0x1a3c('0xc')][0x0][_0x1a3c('0xe')];}else{_0x176006[_0x1a3c('0x1c')]=_0x176006[_0x1a3c('0x1d')];_0x176006['userEmail']=_0x176006['adminEmail'];}logger[_0x1a3c('0xf')]('['+[_0x1d9b12[_0x1a3c('0x10')]()]+'],\x20getUser\x20crm',_0x176006);_0x4d0750(_0x176006);})[_0x1a3c('0x12')](function(_0x1d78d4){logger[_0x1a3c('0x13')]('['+[_0x1d9b12[_0x1a3c('0x10')]()]+']',_0x1d78d4[_0x1a3c('0x14')]);_0x1632b3(_0x1d78d4[_0x1a3c('0x14')]);});}else{logger[_0x1a3c('0xf')]('['+[_0x1d9b12['toUpperCase']()]+']\x20using\x20admin\x20profile');_0x176006['userId']=_0x176006[_0x1a3c('0x1d')];_0x176006['userEmail']=_0x176006[_0x1a3c('0x1e')];_0x4d0750(_0x176006);}});};}function createEndUser(_0x19f2ba,_0x15aa8c,_0x3c168d,_0x10facb,_0x55148e){logger[_0x1a3c('0xf')]('['+[_0x19f2ba['toUpperCase']()]+_0x1a3c('0x1f'),_0x3c168d);return new Promise(function(_0x4fecc4,_0x27afff){var _0x369ce8={'method':_0x1a3c('0x20'),'uri':_0x10facb+_0x1a3c('0x21')+_0x55148e,'body':{'user_name':_0x3c168d[_0x1a3c('0x22')],'roles':_0x1a3c('0x23'),'first_name':_0x3c168d[_0x1a3c('0x22')],'active':'true','date_format':_0x1a3c('0x24'),'phone':_0x3c168d['endUserNumber']},'auth':_0x15aa8c,'json':!![]};return rp(_0x369ce8)[_0x1a3c('0x19')](function(_0x25e237){logger[_0x1a3c('0xf')]('['+[_0x19f2ba[_0x1a3c('0x10')]()]+'],\x20EndUser\x20schema',_0x25e237[_0x1a3c('0xc')]);_0x3c168d['endUserId']=_0x25e237[_0x1a3c('0xc')][_0x1a3c('0xe')];_0x4fecc4(_0x3c168d);})[_0x1a3c('0x12')](function(_0x151c2a){logger[_0x1a3c('0x13')]('['+[_0x19f2ba[_0x1a3c('0x10')]()]+']',_0x151c2a[_0x1a3c('0x14')]);_0x27afff(_0x151c2a[_0x1a3c('0x14')]);});});}function getEndUser(_0x1abb98,_0x152e74,_0x5ce545,_0x367c34,_0x12a482){return function(_0x241eeb){logger[_0x1a3c('0xf')]('['+[_0x1abb98[_0x1a3c('0x10')]()]+_0x1a3c('0x25'),_0x241eeb);return new Promise(function(_0x10ce95,_0x323b65){var _0x176768={'method':_0x1a3c('0x26'),'uri':_0x5ce545+_0x1a3c('0x27')+_0x241eeb[_0x1a3c('0x22')]+'&'+_0x367c34+'&'+_0x12a482,'auth':_0x152e74,'json':!![]};return rp(_0x176768)[_0x1a3c('0x19')](function(_0x1a9508){if(_0x1a9508[_0x1a3c('0xc')][_0x1a3c('0xd')]>0x0){_0x241eeb[_0x1a3c('0x28')]=_0x1a9508['result'][0x0]['sys_id'];logger[_0x1a3c('0xf')]('['+[_0x1abb98[_0x1a3c('0x10')]()]+_0x1a3c('0x29'),_0x241eeb);_0x10ce95(_0x241eeb);}else{return createEndUser(_0x1abb98,_0x152e74,_0x241eeb,_0x5ce545,_0x367c34)[_0x1a3c('0x19')](function(_0x3cacd2){logger[_0x1a3c('0xf')]('['+[_0x1abb98['toUpperCase']()]+_0x1a3c('0x2a'),_0x3cacd2);_0x10ce95(_0x3cacd2);});}})['catch'](function(_0x118b31){logger[_0x1a3c('0x13')]('['+[_0x1abb98[_0x1a3c('0x10')]()]+']',_0x118b31['message']);_0x323b65(_0x118b31[_0x1a3c('0x14')]);});});};}function getCustomFields(_0x1aeec4,_0x51a611){var _0xe0da3f={};if(_0x1aeec4[_0x1a3c('0xd')]>0x0){_[_0x1a3c('0x2b')](_0x1aeec4,function(_0x3d4411){if(_[_0x1a3c('0x2c')]([_0x1a3c('0x2d'),_0x1a3c('0x2e')],_0x3d4411[_0x1a3c('0x2f')])&&_0x3d4411['nameField']&&!_0x3d4411[_0x1a3c('0x30')]){_0xe0da3f[_0x3d4411[_0x1a3c('0x31')][_0x1a3c('0x32')]()]=_0x3d4411[_0x1a3c('0x33')]['toString']();}else if(_['includes']([_0x1a3c('0x2d'),_0x1a3c('0x2e')],_0x3d4411[_0x1a3c('0x2f')])&&_0x3d4411[_0x1a3c('0x34')]&&_0x3d4411[_0x1a3c('0x30')]){_0xe0da3f[_0x3d4411[_0x1a3c('0x34')][_0x1a3c('0x32')]()]=_0x3d4411[_0x1a3c('0x33')][_0x1a3c('0x35')]();}else if(_0x3d4411['type']===_0x1a3c('0x36')&&_0x3d4411[_0x1a3c('0x37')]&&_0x3d4411[_0x1a3c('0x34')]&&_0x3d4411[_0x1a3c('0x30')]){_0xe0da3f[_0x3d4411[_0x1a3c('0x34')][_0x1a3c('0x32')]()]=_0x51a611[_0x3d4411[_0x1a3c('0x37')]][_0x1a3c('0x35')]();}else if(_0x3d4411[_0x1a3c('0x2f')]===_0x1a3c('0x38')&&_0x3d4411[_0x1a3c('0x39')]&&_0x3d4411[_0x1a3c('0x39')][_0x1a3c('0x3a')]&&_0x3d4411[_0x1a3c('0x34')]&&_0x3d4411[_0x1a3c('0x30')]){_0xe0da3f[_0x3d4411['idField']['toLowerCase']()]=_0x51a611[_0x3d4411[_0x1a3c('0x39')][_0x1a3c('0x3a')][_0x1a3c('0x32')]()][_0x1a3c('0x35')]();}});}return _0xe0da3f;}function getTicket(_0x21d514,_0x2d8c2c,_0x57e8ce,_0x725dfb,_0x484449,_0x356ef3){return function(_0x58fe52){logger[_0x1a3c('0xf')]('['+[_0x21d514[_0x1a3c('0x10')]()]+']\x20getTicket\x20input\x20crm',_0x58fe52);return new Promise(function(_0x1c6bdb,_0x1d8a64){var _0x15a50b=_0x21d514['toLowerCase']()===_0x1a3c('0x3b')?_0x58fe52['userId']:_0x58fe52[_0x1a3c('0x28')];var _0x1ba253={'method':_0x1a3c('0x20'),'uri':_0x57e8ce+'incident'+'?'+_0x356ef3,'body':Object[_0x1a3c('0x3c')]({},{'active':_0x1a3c('0x3d'),'caller_id':_0x15a50b,'assigned_to':_0x58fe52['userId'],'short_description':intUtil[_0x1a3c('0x3e')](_0x725dfb[_0x1a3c('0x3f')],_0x484449,'\x20'),'description':intUtil['getString'](_0x725dfb[_0x1a3c('0x40')],_0x484449,'\x0a')},getCustomFields(_0x725dfb['Fields'],_0x484449)),'auth':_0x2d8c2c,'json':!![]};return rp(_0x1ba253)['then'](function(_0x3ca0ee){logger[_0x1a3c('0xf')]('['+[_0x21d514['toUpperCase']()]+']\x20POST\x20incident\x20entity\x20schema',_0x3ca0ee['result']);_0x58fe52[_0x1a3c('0x41')]=_0x3ca0ee[_0x1a3c('0xc')]['sys_id'];_0x58fe52[_0x1a3c('0x42')]=_0x3ca0ee['result'][_0x1a3c('0x43')];logger[_0x1a3c('0xf')]('['+[_0x21d514[_0x1a3c('0x10')]()]+_0x1a3c('0x44'),_0x58fe52);_0x1c6bdb(_0x58fe52);})[_0x1a3c('0x12')](function(_0x301158){logger[_0x1a3c('0x13')]('['+[_0x21d514['toUpperCase']()]+']',_0x301158[_0x1a3c('0x14')]);_0x1d8a64(_0x301158[_0x1a3c('0x14')]);});});};}function createRemoteTag(_0x4eb78a,_0x39d597,_0x1a4351,_0x3d57aa){return new Promise(function(_0x35b8e6,_0x284e9d){var _0x5eb0f4={'method':_0x1a3c('0x20'),'uri':_0x1a4351+_0x1a3c('0x45')+'?'+_0x3d57aa,'body':{'short_description':_0x4eb78a,'global':!![],'active':!![],'name':_0x4eb78a},'auth':_0x39d597,'json':!![]};return rp(_0x5eb0f4)['then'](function(_0x20e74a){var _0x34501c=_0x20e74a['result'][_0x1a3c('0xe')];_0x35b8e6(_0x34501c);});});}function getRemoteTag(_0x12b0fd,_0x25e77d,_0x10d146,_0x5d2305,_0x813145){return new Promise(function(_0x48fabb,_0x48fe69){var _0x173dd0={'method':_0x1a3c('0x26'),'uri':_0x10d146+_0x1a3c('0x45')+_0x1a3c('0x46')+_0x12b0fd+'&'+_0x5d2305,'auth':_0x25e77d,'json':!![]};return rp(_0x173dd0)[_0x1a3c('0x19')](function(_0x15aafd){if(_0x15aafd[_0x1a3c('0xc')][_0x1a3c('0xd')]>0x0){var _0x395a60=_0x15aafd[_0x1a3c('0xc')][0x0][_0x1a3c('0xe')];_0x48fabb(_0x395a60);}else{return createRemoteTag(_0x12b0fd,_0x25e77d,_0x10d146,_0x5d2305)[_0x1a3c('0x19')](function(_0x20dbe2){_0x48fabb(_0x20dbe2);});}});});}function assignTagToIncident(_0x2aef1d,_0x1ae60b,_0x2c8403,_0x4be3e0,_0x39fe60){return new Promise(function(_0x1bfb2b,_0xa646d2){var _0x2923b1={'method':_0x1a3c('0x20'),'uri':_0x2c8403+'label_entry'+'?'+_0x39fe60,'body':{'label':_0x2aef1d,'table':_0x1a3c('0x47'),'id_type':_0x1a3c('0x48'),'table_key':_0x4be3e0['ticketId'],'title':'Incident\x20-\x20'+_0x4be3e0[_0x1a3c('0x42')],'id_display':_0x4be3e0[_0x1a3c('0x42')]},'auth':_0x1ae60b,'json':!![]};return rp(_0x2923b1)['then'](function(_0xf02819){_0x1bfb2b();})[_0x1a3c('0x12')](function(){_0x1bfb2b();});});}function manageTags(_0x1618a5,_0x14120d,_0x435b4c,_0x49f8ad,_0xc21c16,_0x15866d,_0x235d3c){return new Promise(function(_0x20c7bf,_0x2eb4d4){var _0x4b3d6b=[];_0x14120d[_0x1a3c('0x2b')](function(_0x5067a3){_0x4b3d6b[_0x1a3c('0x49')](getRemoteTag(_0x5067a3,_0x435b4c,_0x49f8ad,_0x15866d,_0x235d3c));});return Promise[_0x1a3c('0x4a')](_0x4b3d6b)[_0x1a3c('0x19')](function(_0x3defb7){if(_0x3defb7[_0x1a3c('0xd')]){logger['info']('['+[_0x1618a5[_0x1a3c('0x10')]()]+']\x20arrayPromises:\x20IDs\x20in\x20table\x20label',_0x3defb7);var _0x3eaae5=[];_0x3defb7['forEach'](function(_0x4371ab){_0x3eaae5[_0x1a3c('0x49')](assignTagToIncident(_0x4371ab,_0x435b4c,_0x49f8ad,_0xc21c16,_0x15866d));});return Promise[_0x1a3c('0x4a')](_0x3eaae5)[_0x1a3c('0x19')](function(){_0x20c7bf();})[_0x1a3c('0x12')](function(){_0x20c7bf();});}else{_0x20c7bf();}});});}function getTags(_0x2ca0fd,_0x55a8de,_0x1edbeb,_0x13874a,_0x455a1a,_0x3ce355){return function(_0x5a62a8){return new Promise(function(_0xff0713,_0x4c127a){var _0x22e55f=[];var _0x590f60=_0x13874a[_0x1a3c('0x4b')];if(_0x590f60&&_0x590f60[_0x1a3c('0xd')]>0x0){_0x22e55f=_[_0x1a3c('0x4c')](_0x590f60,_0x1a3c('0x3a'));}if(_0x22e55f[_0x1a3c('0xd')]>0x0){return manageTags(_0x2ca0fd,_0x22e55f,_0x55a8de,_0x1edbeb,_0x5a62a8,_0x455a1a,_0x3ce355)['then'](function(){_0xff0713(_0x5a62a8);});}else{_0xff0713(_0x5a62a8);}});};}function emit(_0x44917d,_0x1cd9e1,_0x2dff22){var _0x1ab15d=_0x1a3c('0x4d')+_0x1a3c('0x4e')+_0x1a3c('0x4f')+'%255EORDERBYDESCnumber';var _0xd07c35={'uri':_0x44917d+_0x1a3c('0x50')+_0x2dff22+_0x1ab15d};io['to'](util[_0x1a3c('0x51')](_0x1a3c('0x52'),_0x1cd9e1))[_0x1a3c('0x53')](_0x1a3c('0x54'),_0xd07c35);}exports['cs']=function(_0x1da55e,_0x5898ab,_0x49a88f,_0x425374,_0x167427,_0x4a690e,_0x51d52a,_0x53b34e){var _0x48e1e7={};var _0xdaef04={'user':_0x4a690e[_0x1a3c('0x55')],'pass':_0x4a690e[_0x1a3c('0x56')]};var _0x1eac87='sysparm_limit=1';var _0x5b244f=_0x1a3c('0x57');_0x4a690e[_0x1a3c('0x58')]=intUtil[_0x1a3c('0x59')](_0x4a690e[_0x1a3c('0x58')]);_0x4a690e[_0x1a3c('0x5a')]=intUtil['stripTrailingSlash'](_0x4a690e['serverUrl']);var _0x45d2f0=util[_0x1a3c('0x51')](_0x1a3c('0x5b'),_0x4a690e[_0x1a3c('0x58')]);_0x48e1e7[_0x1a3c('0x16')]=!_['isNil'](_0x425374)?_0x425374[_0x1a3c('0x5c')]:null;_0x48e1e7['adminEmail']=_0x4a690e[_0x1a3c('0x5c')];_0x48e1e7[_0x1a3c('0x22')]=_0x53b34e[_0x1a3c('0x32')]()==='outbound'?_0x5898ab[_0x1a3c('0x5d')]:_0x5898ab['calleridnum'];_0x48e1e7[_0x1a3c('0x5e')]=_0x53b34e===_0x1a3c('0x5f')||_0x53b34e===_0x1a3c('0x60')?_0x1a3c('0x5f'):'outbound';var _0x3c5c81=util[_0x1a3c('0x51')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4a690e[_0x1a3c('0x5a')],_0x5898ab['uniqueid'],md5(_0x5898ab[_0x1a3c('0x61')]));if(_0x167427&&_0x167427['monitor_format']){logger[_0x1a3c('0xf')](_0x1a3c('0x62'),_0x1a3c('0x63'));_0x5898ab[_0x1a3c('0x64')]=_0x3c5c81;}else if(_0x51d52a&&_0x51d52a['recordingFormat']&&_0x51d52a[_0x1a3c('0x65')]!==_0x1a3c('0x66')){logger[_0x1a3c('0xf')](_0x1a3c('0x67'),_0x1a3c('0x63'));_0x5898ab[_0x1a3c('0x64')]=_0x3c5c81;}else{_0x5898ab[_0x1a3c('0x64')]='';}return getAdminUser(_0x53b34e,_0xdaef04,_0x48e1e7,_0x45d2f0,_0x5b244f,_0x1eac87)[_0x1a3c('0x19')](getUser(_0x53b34e,_0xdaef04,_0x45d2f0,_0x5b244f,_0x1eac87))[_0x1a3c('0x19')](getEndUser(_0x53b34e,_0xdaef04,_0x45d2f0,_0x5b244f,_0x1eac87))[_0x1a3c('0x19')](getTicket(_0x53b34e,_0xdaef04,_0x45d2f0,_0x49a88f,_0x5898ab,_0x5b244f))[_0x1a3c('0x19')](function(_0xa815cf){logger['info'](util[_0x1a3c('0x51')](_0x1a3c('0x68'),_0xa815cf[_0x1a3c('0x41')]));logger[_0x1a3c('0xf')](util['format'](_0x1a3c('0x69'),_0x53b34e));if(_0x53b34e!=='unmanaged'){logger[_0x1a3c('0xf')]('['+[_0x53b34e['toUpperCase']()]+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x4a690e['remoteUri'],_0x425374[_0x1a3c('0x3a')],_0xa815cf['ticketId']);}})['catch'](function(_0x41db7a){logger[_0x1a3c('0x13')]('['+[_0x53b34e[_0x1a3c('0x10')]()]+']\x20Error\x20running\x20ServiceNow\x20integration',util[_0x1a3c('0x6a')](_0x41db7a,{'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 bace306..f6465cb 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 _0xb750=['map','type','string','nameField','toLowerCase','content','customField','variable','custom_fields','customVariable','Variable','POST','username','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','remoteUri','stripTrailingSlash','serverUrl','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','contacts','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','error','outbound','uri','recordingFormat','none','destcalleridname','destcalleridnum','Outbound','version','catch','[OUTBOUND]','lastevent','toUpperCase','Inbound','lodash','util','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','localhost','socket.io-emitter','info','name','getString','Subjects','assigned_user_id','Descriptions','date_start','toISOString','slice','duration_hours','parent_id','parent_type','direction','length','forEach','variableName','push','idField','set_entry','JSON','stringify','Calls','apiKey','toString','base64','get_server_info','isNil','Getting\x20agent\x20with\x20name','format','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','entry_list','name_value_list','user_name','value','Agent\x20found!','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','get_entry_list','Contacts','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','then','find','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Enduser\x20created.','debug','[HTTP]'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xb750,0x19f));var _0x0b75=function(_0x21721f,_0x4169e5){_0x21721f=_0x21721f-0x0;var _0x4b3367=_0xb750[_0x21721f];return _0x4b3367;};'use strict';var _=require(_0x0b75('0x0'));var rp=require('request-promise');var BPromise=require('bluebird');var md5=require('md5');var util=require(_0x0b75('0x1'));var Redis=require(_0x0b75('0x2'));var intUtil=require(_0x0b75('0x3'));var config=require(_0x0b75('0x4'));var logger=require(_0x0b75('0x5'))('sugarcrm');config[_0x0b75('0x6')]=_['defaults'](config[_0x0b75('0x6')],{'host':_0x0b75('0x7'),'port':0x18eb});var io=require(_0x0b75('0x8'))(new Redis(config[_0x0b75('0x6')]));var def={'method':'POST','json':!![]};function emit(_0x6078ec,_0x506b03,_0x4da4e7){io['to'](_0x6078ec)['emit'](_0x506b03,_0x4da4e7);}function getTicket(_0x5d2a91,_0x38a3c2,_0x333583,_0x10b7b4,_0x5f14bd,_0x1f2657,_0x3356a3,_0x4bc0fd){logger[_0x0b75('0x9')]('Creating\x20new\x20ticket...');var _0x125a55=new Date();var _0x405e72=[{'name':_0x0b75('0xa'),'value':intUtil[_0x0b75('0xb')](_0x10b7b4[_0x0b75('0xc')],_0x5f14bd,'\x20')},{'name':_0x0b75('0xd'),'value':_0x38a3c2['id']},{'name':'created_by','value':_0x38a3c2['id']},{'name':'description','value':intUtil['getString'](_0x10b7b4[_0x0b75('0xe')],_0x5f14bd,'\x0a')},{'name':_0x0b75('0xf'),'value':_0x125a55[_0x0b75('0x10')]()[_0x0b75('0x11')](0x0,0x13)['replace']('T','\x20')},{'name':_0x0b75('0x12'),'value':'0'},{'name':'duration_minutes','value':'15'},{'name':_0x0b75('0x13'),'value':_0x333583['id']},{'name':_0x0b75('0x14'),'value':'Contacts'},{'name':'parent_name','value':_0x333583[_0x0b75('0xa')]},{'name':_0x0b75('0x15'),'value':_0x4bc0fd}];if(_0x1f2657[_0x0b75('0x16')]){_[_0x0b75('0x17')](_0x1f2657,function(_0x2113db){if(_0x5f14bd[_0x2113db[_0x0b75('0x18')]]){_0x405e72[_0x0b75('0x19')]({'name':_0x2113db[_0x0b75('0x1a')],'value':_0x5f14bd[_0x2113db['variableName']]});}});}return request({'form':{'method':_0x0b75('0x1b'),'input_type':_0x0b75('0x1c'),'response_type':_0x0b75('0x1c'),'rest_data':JSON[_0x0b75('0x1d')]({'session':_0x3356a3['id'],'module_name':_0x0b75('0x1e'),'name_value_list':_0x405e72})}});}function getAuth(_0x7f748){return util['format']('Basic\x20%s',new Buffer(_0x7f748[_0x0b75('0x1f')]+':X')[_0x0b75('0x20')](_0x0b75('0x21')));}function getServerInfo(_0x49fb35){return request({'form':{'method':_0x0b75('0x22'),'input_type':_0x0b75('0x1c'),'response_type':_0x0b75('0x1c'),'rest_data':JSON[_0x0b75('0x1d')]({'session':_0x49fb35['id']})}});}function getUser(_0x4c0f57,_0x175231,_0x1df884){if(!_[_0x0b75('0x23')](_0x175231)){logger['info'](_0x0b75('0x24'),_0x175231);return request({'form':{'method':'get_entry_list','input_type':_0x0b75('0x1c'),'response_type':_0x0b75('0x1c'),'rest_data':JSON[_0x0b75('0x1d')]({'session':_0x1df884['id'],'module_name':'Employees','query':util[_0x0b75('0x25')](_0x0b75('0x26'),_0x175231),'order_by':'','offset':'0','select_fields':['id',_0x0b75('0xa'),'user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x344a58){if(_0x344a58[_0x0b75('0x27')][_0x0b75('0x16')]){var _0x36f728=_['find'](_0x344a58[_0x0b75('0x27')],function(_0xf07d5){return _0xf07d5[_0x0b75('0x28')][_0x0b75('0x29')][_0x0b75('0x2a')]===_0x175231;});if(_0x36f728){logger['info'](_0x0b75('0x2b'));return BPromise[_0x0b75('0x2c')]({'id':_0x36f728['name_value_list']['id'][_0x0b75('0x2a')],'name':_0x36f728['name_value_list'][_0x0b75('0xa')]['value']});}}logger[_0x0b75('0x9')](_0x0b75('0x2d'));return BPromise[_0x0b75('0x2c')]({'id':_0x1df884[_0x0b75('0x28')][_0x0b75('0x2e')]['value'],'name':_0x1df884['name_value_list'][_0x0b75('0x29')][_0x0b75('0x2a')]});});}else{logger[_0x0b75('0x9')](_0x0b75('0x2f'));return BPromise[_0x0b75('0x2c')]({'id':_0x1df884['name_value_list'][_0x0b75('0x2e')][_0x0b75('0x2a')],'name':_0x1df884['name_value_list']['user_name'][_0x0b75('0x2a')]});}}function getEndUser(_0x2b1638,_0x2f42f6,_0x1f1c82,_0x29237f){logger[_0x0b75('0x9')]('Searching\x20enduser\x20with\x20phone',_0x1f1c82);return request({'form':{'method':_0x0b75('0x30'),'input_type':_0x0b75('0x1c'),'response_type':_0x0b75('0x1c'),'rest_data':JSON[_0x0b75('0x1d')]({'session':_0x29237f['id'],'module_name':_0x0b75('0x31'),'query':util['format'](_0x0b75('0x32'),_0x1f1c82),'order_by':'','offset':'0','select_fields':['id','name',_0x0b75('0x33')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x0b75('0x34')](function(_0x595852){if(_0x595852[_0x0b75('0x27')]['length']){var _0x4e65ec=_[_0x0b75('0x35')](_0x595852[_0x0b75('0x27')],function(_0x7cb5af){return _0x7cb5af['name_value_list'][_0x0b75('0x33')][_0x0b75('0x2a')]===_0x1f1c82;});if(_0x4e65ec){logger[_0x0b75('0x9')](_0x0b75('0x36'));return BPromise[_0x0b75('0x2c')]({'id':_0x4e65ec[_0x0b75('0x28')]['id']['value'],'name':_0x4e65ec[_0x0b75('0x28')]['name'][_0x0b75('0x2a')],'phone':_0x4e65ec['name_value_list'][_0x0b75('0x33')]['value']});}}else{logger['info'](_0x0b75('0x37'));return request({'form':{'method':_0x0b75('0x1b'),'input_type':_0x0b75('0x1c'),'response_type':_0x0b75('0x1c'),'rest_data':JSON['stringify']({'session':_0x29237f['id'],'module_name':'Contacts','name_value_list':[{'name':_0x0b75('0x38'),'value':_0x2f42f6!==_0x0b75('0x39')?_0x2f42f6:util[_0x0b75('0x25')]('Caller\x20-\x20%s',_0x1f1c82)},{'name':_0x0b75('0x33'),'value':_0x1f1c82}]})}})[_0x0b75('0x34')](function(_0x49a081){logger['info'](_0x0b75('0x3a'));return BPromise[_0x0b75('0x2c')]({'id':_0x49a081['id'],'name':_0x49a081[_0x0b75('0x27')][_0x0b75('0x38')]['value'],'phone':_0x49a081[_0x0b75('0x27')]['phone_home']['value']});});}});}function request(_0x127fda){logger[_0x0b75('0x3b')](_0x0b75('0x3c'),JSON[_0x0b75('0x1d')](_0x127fda));return rp(_['merge'](def,_0x127fda));}function getTags(_0x71aae1,_0x5471a7){var _0x1e6009=[];if(_0x71aae1&&_0x71aae1[_0x0b75('0x16')]>0x0){_0x1e6009=_[_0x0b75('0x3d')](_0x71aae1,_0x5471a7);}return _0x1e6009;}function getCustomFields(_0x5bbbe7,_0x3feed7){var _0xadc780=[];var _0x4271ec={'custom_fields':[]};if(_0x5bbbe7['length']>0x0){_['forEach'](_0x5bbbe7,function(_0x45d682){if(_0x45d682[_0x0b75('0x3e')]===_0x0b75('0x3f')&&_0x45d682[_0x0b75('0x40')]&&!_0x45d682['customField']){_0x4271ec[_0x45d682[_0x0b75('0x40')][_0x0b75('0x41')]()]=_0x45d682[_0x0b75('0x42')]['toString']();}else if(_0x45d682[_0x0b75('0x3e')]==='string'&&_0x45d682[_0x0b75('0x1a')]&&_0x45d682[_0x0b75('0x43')]){_0x4271ec['custom_fields']['push']({'id':_0x45d682['idField'],'value':_0x45d682[_0x0b75('0x42')][_0x0b75('0x20')]()});}else if(_0x45d682[_0x0b75('0x3e')]===_0x0b75('0x44')&&_0x45d682[_0x0b75('0x18')]&&_0x45d682['idField']&&_0x45d682['customField']){_0x3feed7[_0x45d682['variableName']]&&_0x4271ec[_0x0b75('0x45')][_0x0b75('0x19')]({'id':_0x45d682[_0x0b75('0x1a')],'value':_0x3feed7[_0x45d682[_0x0b75('0x18')]]['toString']()});}else if(_0x45d682[_0x0b75('0x3e')]===_0x0b75('0x46')&&_0x45d682['Variable']&&_0x45d682[_0x0b75('0x47')]['name']&&_0x45d682['idField']&&_0x45d682[_0x0b75('0x43')]){_0x3feed7[_0x45d682[_0x0b75('0x47')][_0x0b75('0xa')]['toLowerCase']()]&&_0x4271ec[_0x0b75('0x45')][_0x0b75('0x19')]({'id':_0x45d682[_0x0b75('0x1a')],'value':_0x3feed7[_0x45d682[_0x0b75('0x47')][_0x0b75('0xa')][_0x0b75('0x41')]()]['toString']()});}});}return _0x4271ec;}function getConnection(_0x1256fa){return request({'method':_0x0b75('0x48'),'form':{'method':'login','input_type':_0x0b75('0x1c'),'response_type':_0x0b75('0x1c'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x1256fa[_0x0b75('0x49')],'password':_0x1256fa[_0x0b75('0x4a')],'encryption':_0x0b75('0x4b')},'application':_0x0b75('0x4c')})}})[_0x0b75('0x34')](function(_0x5c9ba0){var _0x11d4e4=_0x5c9ba0;if(_0x11d4e4['id']){def[_0x0b75('0x4d')]=_0x11d4e4['id'];return BPromise['resolve'](_0x11d4e4);}else{throw new Error(util['format'](_0x0b75('0x4e'),_0x1256fa['id']));}});}function setRelationship(_0x3b6342,_0x492765,_0x32e416,_0x3dc885){return request({'form':{'method':_0x0b75('0x4f'),'input_type':_0x0b75('0x1c'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x3b6342['id'],'module_name':_0x0b75('0x1e'),'module_id':_0x32e416['id'],'link_field_name':_0x3dc885,'related_ids':[_0x492765['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x0b75('0x50')]=function(_0x5c4569,_0x5a29b5,_0x84e8ba,_0x2620cc,_0xa22dba,_0x5ee950){var _0x406455,_0x26a287,_0x3af9b8,_0x516704;_0x5ee950[_0x0b75('0x51')]=intUtil[_0x0b75('0x52')](_0x5ee950[_0x0b75('0x51')]);_0x5ee950[_0x0b75('0x53')]=intUtil[_0x0b75('0x52')](_0x5ee950[_0x0b75('0x53')]);def['uri']=util[_0x0b75('0x25')](_0x0b75('0x54'),_0x5ee950['remoteUri']);if(_0xa22dba&&_0xa22dba[_0x0b75('0x55')]){logger[_0x0b75('0x9')](_0x0b75('0x56'),_0x0b75('0x57'));_0x5a29b5[_0x0b75('0x58')]=util[_0x0b75('0x25')](_0x0b75('0x59'),_0x5ee950[_0x0b75('0x53')],_0x5a29b5[_0x0b75('0x5a')],md5(_0x5a29b5[_0x0b75('0x5a')]));}else{_0x5a29b5['recordingURL']='';}return getConnection(_0x5ee950)[_0x0b75('0x34')](function(_0xf15238){_0x516704=_0xf15238;return getUser(_0x5ee950,_0x2620cc[_0x0b75('0xa')],_0x516704);})[_0x0b75('0x34')](function(_0x3651ba){_0x406455=_0x3651ba;logger[_0x0b75('0x9')](_0x0b75('0x5b'),_0x406455['id']);return getEndUser(_0x5ee950,_0x5a29b5[_0x0b75('0x5c')],_0x5a29b5[_0x0b75('0x5d')],_0x516704);})[_0x0b75('0x34')](function(_0x582099){_0x26a287=_0x582099;logger[_0x0b75('0x9')](_0x0b75('0x5e'),_0x26a287['id']);return getTicket(_0x5ee950,_0x406455,_0x26a287,_0x84e8ba,_0x5a29b5,_0x84e8ba[_0x0b75('0x5f')],_0x516704,'Inbound');})['then'](function(_0x18756b){_0x3af9b8=_0x18756b;logger[_0x0b75('0x9')](_0x0b75('0x60'));logger[_0x0b75('0x9')](_0x0b75('0x61'),_0x3af9b8['id']);return setRelationship(_0x516704,_0x406455,_0x3af9b8,_0x0b75('0x62'));})[_0x0b75('0x34')](function(){return setRelationship(_0x516704,_0x26a287,_0x3af9b8,_0x0b75('0x63'));})['then'](function(){return getServerInfo(_0x516704);})['then'](function(_0x387c42){var _0x20c2f1=parseInt(_0x387c42['version'][_0x0b75('0x64')](0x0));var _0x2eb257=util['format'](_0x0b75('0x65'),_0x5ee950[_0x0b75('0x51')],_0x3af9b8['id']);if(_0x20c2f1>0x6){_0x2eb257=util['format'](_0x0b75('0x66'),_0x5ee950['remoteUri'],_0x3af9b8['id']);}logger['info'](_0x0b75('0x56'),_0x0b75('0x67'));emit(util[_0x0b75('0x25')](_0x0b75('0x68'),_0x2620cc[_0x0b75('0xa')]),'trigger:browser:url',{'uri':_0x2eb257});})['catch'](function(_0x2f8aff){logger[_0x0b75('0x69')](_0x0b75('0x56'),JSON['stringify'](_0x2f8aff));});};exports[_0x0b75('0x6a')]=function(_0x1faf0c,_0x25764d,_0x2b2f76,_0x2a9c67,_0x1a2a2c,_0x44ed9d,_0x170192){var _0x41dab9,_0xb1264b,_0x5205b5,_0x33a844;_0x44ed9d[_0x0b75('0x51')]=intUtil[_0x0b75('0x52')](_0x44ed9d[_0x0b75('0x51')]);_0x44ed9d['serverUrl']=intUtil['stripTrailingSlash'](_0x44ed9d[_0x0b75('0x53')]);def[_0x0b75('0x6b')]=util[_0x0b75('0x25')](_0x0b75('0x54'),_0x44ed9d[_0x0b75('0x51')]);if(_0x170192&&_0x170192[_0x0b75('0x6c')]&&_0x170192[_0x0b75('0x6c')]!==_0x0b75('0x6d')){logger[_0x0b75('0x9')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x25764d[_0x0b75('0x58')]=util[_0x0b75('0x25')](_0x0b75('0x59'),_0x44ed9d[_0x0b75('0x53')],_0x25764d[_0x0b75('0x5a')],md5(_0x25764d['uniqueid']));}return getConnection(_0x44ed9d)['then'](function(_0x31cd91){_0x33a844=_0x31cd91;return getUser(_0x44ed9d,_0x2a9c67[_0x0b75('0xa')],_0x33a844);})['then'](function(_0x5dd156){_0x41dab9=_0x5dd156;logger[_0x0b75('0x9')](_0x0b75('0x5b'),_0x41dab9['id']);return getEndUser(_0x44ed9d,_0x25764d[_0x0b75('0x6e')],_0x25764d[_0x0b75('0x6f')],_0x33a844);})[_0x0b75('0x34')](function(_0x2ea78b){_0xb1264b=_0x2ea78b;logger['info']('The\x20Enduser\x20ID\x20is:',_0xb1264b['id']);return getTicket(_0x44ed9d,_0x41dab9,_0xb1264b,_0x2b2f76,_0x25764d,_0x2b2f76['Fields'],_0x33a844,_0x0b75('0x70'));})[_0x0b75('0x34')](function(_0x4e6f1a){_0x5205b5=_0x4e6f1a;logger['info']('Ticket\x20created!');logger['info'](_0x0b75('0x61'),_0x5205b5['id']);return setRelationship(_0x33a844,_0x41dab9,_0x5205b5,_0x0b75('0x62'));})['then'](function(){return setRelationship(_0x33a844,_0xb1264b,_0x5205b5,_0x0b75('0x63'));})['then'](function(){return getServerInfo(_0x33a844);})[_0x0b75('0x34')](function(_0x35fa58){var _0xeec727=parseInt(_0x35fa58[_0x0b75('0x71')]['charAt'](0x0));var _0x56bfb2=util[_0x0b75('0x25')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x44ed9d[_0x0b75('0x51')],_0x5205b5['id']);if(_0xeec727>0x6){_0x56bfb2=util[_0x0b75('0x25')](_0x0b75('0x66'),_0x44ed9d[_0x0b75('0x51')],_0x5205b5['id']);}logger[_0x0b75('0x9')]('[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0x0b75('0x68'),_0x2a9c67[_0x0b75('0xa')]),'trigger:browser:url',{'uri':_0x56bfb2});})[_0x0b75('0x72')](function(_0x870a08){logger[_0x0b75('0x69')](_0x0b75('0x73'),JSON['stringify'](_0x870a08));});};exports['unmanaged']=function(_0x501c7d,_0x42e9e7,_0x3f8cac,_0x30550f,_0xfdaf55,_0x3009ef){var _0x1ff176,_0x270a1d,_0x30b8c4,_0x35eb56;_0x3009ef[_0x0b75('0x51')]=intUtil['stripTrailingSlash'](_0x3009ef['remoteUri']);_0x3009ef[_0x0b75('0x53')]=intUtil['stripTrailingSlash'](_0x3009ef['serverUrl']);def[_0x0b75('0x6b')]=util[_0x0b75('0x25')]('%s/service/v4_1/rest.php',_0x3009ef['remoteUri']);if(_0xfdaf55&&_0xfdaf55[_0x0b75('0x55')]){logger['info']('['+_0x42e9e7[_0x0b75('0x74')][_0x0b75('0x75')]()+']','Recording\x20is\x20enabled!');_0x42e9e7[_0x0b75('0x58')]=util[_0x0b75('0x25')](_0x0b75('0x59'),_0x3009ef['serverUrl'],_0x42e9e7[_0x0b75('0x5a')],md5(_0x42e9e7[_0x0b75('0x5a')]));}else{_0x42e9e7[_0x0b75('0x58')]='';}return getConnection(_0x3009ef)['then'](function(_0x20bebb){_0x35eb56=_0x20bebb;if(!_[_0x0b75('0x23')](_0x30550f)){return getUser(_0x3009ef,_0x30550f[_0x0b75('0xa')],_0x35eb56);}else{return getUser(_0x3009ef,null,_0x35eb56);}})[_0x0b75('0x34')](function(_0x3eb73b){_0x1ff176=_0x3eb73b;logger[_0x0b75('0x9')](_0x0b75('0x5b'),_0x1ff176['id']);return getEndUser(_0x3009ef,_0x42e9e7['calleridname'],_0x42e9e7[_0x0b75('0x5d')],_0x35eb56);})['then'](function(_0x10cb14){_0x270a1d=_0x10cb14;logger[_0x0b75('0x9')](_0x0b75('0x5e'),_0x270a1d['id']);return getTicket(_0x3009ef,_0x1ff176,_0x270a1d,_0x3f8cac,_0x42e9e7,_0x3f8cac[_0x0b75('0x5f')],_0x35eb56,_0x0b75('0x76'));})['then'](function(_0x3a0aec){_0x30b8c4=_0x3a0aec;logger[_0x0b75('0x9')](_0x0b75('0x60'));logger['info'](_0x0b75('0x61'),_0x30b8c4['id']);return setRelationship(_0x35eb56,_0x1ff176,_0x30b8c4,_0x0b75('0x62'));})[_0x0b75('0x34')](function(){return setRelationship(_0x35eb56,_0x270a1d,_0x30b8c4,_0x0b75('0x63'));})[_0x0b75('0x34')](function(){return getServerInfo(_0x35eb56);})[_0x0b75('0x72')](function(_0x5ce1d4){logger[_0x0b75('0x69')]('['+_0x42e9e7[_0x0b75('0x74')][_0x0b75('0x75')]()+']',JSON[_0x0b75('0x1d')](_0x5ce1d4));});}; \ No newline at end of file +var _0xe30f=['then','find','entry_list','name_value_list','value','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','resolve','user_id','Searching\x20enduser\x20with\x20phone','stringify','Enduser\x20found!','phone_home','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Caller\x20-\x20%s','debug','[HTTP]','merge','map','string','nameField','customField','toLowerCase','type','idField','custom_fields','content','variable','customVariable','Variable','login','username','PLAIN','xCALLY\x20Motion\x20integration','sessionID','set_relationship','stripTrailingSlash','remoteUri','uri','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','error','recordingFormat','[OUTBOUND]','destcalleridnum','Fields','unmanaged','lastevent','toUpperCase','lodash','request-promise','bluebird','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','defaults','redis','localhost','POST','emit','info','Creating\x20new\x20ticket...','getString','Descriptions','date_start','toISOString','slice','replace','duration_hours','parent_id','parent_type','parent_name','name','direction','length','forEach','variableName','push','set_entry','JSON','Calls','format','Basic\x20%s','apiKey','toString','base64','get_server_info','isNil','Getting\x20agent\x20with\x20name','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name'];(function(_0x18a257,_0x12d221){var _0x35ec40=function(_0x3b74a0){while(--_0x3b74a0){_0x18a257['push'](_0x18a257['shift']());}};_0x35ec40(++_0x12d221);}(_0xe30f,0x1b1));var _0xfe30=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xe30f[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0xfe30('0x0'));var rp=require(_0xfe30('0x1'));var BPromise=require(_0xfe30('0x2'));var md5=require(_0xfe30('0x3'));var util=require(_0xfe30('0x4'));var Redis=require(_0xfe30('0x5'));var intUtil=require(_0xfe30('0x6'));var config=require(_0xfe30('0x7'));var logger=require(_0xfe30('0x8'))('sugarcrm');config['redis']=_[_0xfe30('0x9')](config[_0xfe30('0xa')],{'host':_0xfe30('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xfe30('0xa')]));var def={'method':_0xfe30('0xc'),'json':!![]};function emit(_0x5c6148,_0x2b24a3,_0x41046a){io['to'](_0x5c6148)[_0xfe30('0xd')](_0x2b24a3,_0x41046a);}function getTicket(_0x284b7d,_0x16c0f3,_0x3650bd,_0x52e4f8,_0x9e75,_0x2580ff,_0x2b2ada,_0x5c9118){logger[_0xfe30('0xe')](_0xfe30('0xf'));var _0x109785=new Date();var _0x474f2d=[{'name':'name','value':intUtil[_0xfe30('0x10')](_0x52e4f8['Subjects'],_0x9e75,'\x20')},{'name':'assigned_user_id','value':_0x16c0f3['id']},{'name':'created_by','value':_0x16c0f3['id']},{'name':'description','value':intUtil[_0xfe30('0x10')](_0x52e4f8[_0xfe30('0x11')],_0x9e75,'\x0a')},{'name':_0xfe30('0x12'),'value':_0x109785[_0xfe30('0x13')]()[_0xfe30('0x14')](0x0,0x13)[_0xfe30('0x15')]('T','\x20')},{'name':_0xfe30('0x16'),'value':'0'},{'name':'duration_minutes','value':'15'},{'name':_0xfe30('0x17'),'value':_0x3650bd['id']},{'name':_0xfe30('0x18'),'value':'Contacts'},{'name':_0xfe30('0x19'),'value':_0x3650bd[_0xfe30('0x1a')]},{'name':_0xfe30('0x1b'),'value':_0x5c9118}];if(_0x2580ff[_0xfe30('0x1c')]){_[_0xfe30('0x1d')](_0x2580ff,function(_0x3f2c65){if(_0x9e75[_0x3f2c65[_0xfe30('0x1e')]]){_0x474f2d[_0xfe30('0x1f')]({'name':_0x3f2c65['idField'],'value':_0x9e75[_0x3f2c65[_0xfe30('0x1e')]]});}});}return request({'form':{'method':_0xfe30('0x20'),'input_type':_0xfe30('0x21'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x2b2ada['id'],'module_name':_0xfe30('0x22'),'name_value_list':_0x474f2d})}});}function getAuth(_0x6b3d4c){return util[_0xfe30('0x23')](_0xfe30('0x24'),new Buffer(_0x6b3d4c[_0xfe30('0x25')]+':X')[_0xfe30('0x26')](_0xfe30('0x27')));}function getServerInfo(_0x1bc361){return request({'form':{'method':_0xfe30('0x28'),'input_type':_0xfe30('0x21'),'response_type':_0xfe30('0x21'),'rest_data':JSON['stringify']({'session':_0x1bc361['id']})}});}function getUser(_0x409a31,_0x31717b,_0x583c51){if(!_[_0xfe30('0x29')](_0x31717b)){logger[_0xfe30('0xe')](_0xfe30('0x2a'),_0x31717b);return request({'form':{'method':_0xfe30('0x2b'),'input_type':_0xfe30('0x21'),'response_type':_0xfe30('0x21'),'rest_data':JSON['stringify']({'session':_0x583c51['id'],'module_name':_0xfe30('0x2c'),'query':util[_0xfe30('0x23')](_0xfe30('0x2d'),_0x31717b),'order_by':'','offset':'0','select_fields':['id',_0xfe30('0x1a'),_0xfe30('0x2e')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xfe30('0x2f')](function(_0x448339){if(_0x448339['entry_list'][_0xfe30('0x1c')]){var _0xa2ed31=_[_0xfe30('0x30')](_0x448339[_0xfe30('0x31')],function(_0x32cc0b){return _0x32cc0b[_0xfe30('0x32')][_0xfe30('0x2e')][_0xfe30('0x33')]===_0x31717b;});if(_0xa2ed31){logger['info']('Agent\x20found!');return BPromise['resolve']({'id':_0xa2ed31['name_value_list']['id'][_0xfe30('0x33')],'name':_0xa2ed31['name_value_list'][_0xfe30('0x1a')]['value']});}}logger[_0xfe30('0xe')](_0xfe30('0x34'));return BPromise[_0xfe30('0x35')]({'id':_0x583c51[_0xfe30('0x32')][_0xfe30('0x36')][_0xfe30('0x33')],'name':_0x583c51[_0xfe30('0x32')][_0xfe30('0x2e')][_0xfe30('0x33')]});});}else{logger['info']('Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!');return BPromise[_0xfe30('0x35')]({'id':_0x583c51[_0xfe30('0x32')][_0xfe30('0x36')][_0xfe30('0x33')],'name':_0x583c51[_0xfe30('0x32')][_0xfe30('0x2e')][_0xfe30('0x33')]});}}function getEndUser(_0x3bb3db,_0x269580,_0x142f65,_0x3d8909){logger[_0xfe30('0xe')](_0xfe30('0x37'),_0x142f65);return request({'form':{'method':'get_entry_list','input_type':_0xfe30('0x21'),'response_type':_0xfe30('0x21'),'rest_data':JSON[_0xfe30('0x38')]({'session':_0x3d8909['id'],'module_name':'Contacts','query':util[_0xfe30('0x23')]('contacts.phone_home\x20=\x20\x22%s\x22',_0x142f65),'order_by':'','offset':'0','select_fields':['id','name','phone_home'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xfe30('0x2f')](function(_0x4fd92e){if(_0x4fd92e[_0xfe30('0x31')][_0xfe30('0x1c')]){var _0x3ed646=_[_0xfe30('0x30')](_0x4fd92e['entry_list'],function(_0x115f30){return _0x115f30[_0xfe30('0x32')]['phone_home'][_0xfe30('0x33')]===_0x142f65;});if(_0x3ed646){logger[_0xfe30('0xe')](_0xfe30('0x39'));return BPromise[_0xfe30('0x35')]({'id':_0x3ed646[_0xfe30('0x32')]['id'][_0xfe30('0x33')],'name':_0x3ed646[_0xfe30('0x32')]['name'][_0xfe30('0x33')],'phone':_0x3ed646[_0xfe30('0x32')][_0xfe30('0x3a')][_0xfe30('0x33')]});}}else{logger[_0xfe30('0xe')](_0xfe30('0x3b'));return request({'form':{'method':_0xfe30('0x20'),'input_type':_0xfe30('0x21'),'response_type':_0xfe30('0x21'),'rest_data':JSON[_0xfe30('0x38')]({'session':_0x3d8909['id'],'module_name':'Contacts','name_value_list':[{'name':_0xfe30('0x3c'),'value':_0x269580!==_0xfe30('0x3d')?_0x269580:util[_0xfe30('0x23')](_0xfe30('0x3e'),_0x142f65)},{'name':'phone_home','value':_0x142f65}]})}})[_0xfe30('0x2f')](function(_0x580a08){logger[_0xfe30('0xe')]('Enduser\x20created.');return BPromise[_0xfe30('0x35')]({'id':_0x580a08['id'],'name':_0x580a08[_0xfe30('0x31')]['first_name']['value'],'phone':_0x580a08[_0xfe30('0x31')][_0xfe30('0x3a')][_0xfe30('0x33')]});});}});}function request(_0x550ef5){logger[_0xfe30('0x3f')](_0xfe30('0x40'),JSON[_0xfe30('0x38')](_0x550ef5));return rp(_[_0xfe30('0x41')](def,_0x550ef5));}function getTags(_0x2915f3,_0x204816){var _0x314e02=[];if(_0x2915f3&&_0x2915f3['length']>0x0){_0x314e02=_[_0xfe30('0x42')](_0x2915f3,_0x204816);}return _0x314e02;}function getCustomFields(_0x7149b1,_0x26633d){var _0x12eae8=[];var _0x3d3a67={'custom_fields':[]};if(_0x7149b1[_0xfe30('0x1c')]>0x0){_['forEach'](_0x7149b1,function(_0x27ae56){if(_0x27ae56['type']===_0xfe30('0x43')&&_0x27ae56[_0xfe30('0x44')]&&!_0x27ae56[_0xfe30('0x45')]){_0x3d3a67[_0x27ae56['nameField'][_0xfe30('0x46')]()]=_0x27ae56['content'][_0xfe30('0x26')]();}else if(_0x27ae56[_0xfe30('0x47')]==='string'&&_0x27ae56[_0xfe30('0x48')]&&_0x27ae56[_0xfe30('0x45')]){_0x3d3a67[_0xfe30('0x49')][_0xfe30('0x1f')]({'id':_0x27ae56[_0xfe30('0x48')],'value':_0x27ae56[_0xfe30('0x4a')][_0xfe30('0x26')]()});}else if(_0x27ae56[_0xfe30('0x47')]===_0xfe30('0x4b')&&_0x27ae56['variableName']&&_0x27ae56[_0xfe30('0x48')]&&_0x27ae56[_0xfe30('0x45')]){_0x26633d[_0x27ae56[_0xfe30('0x1e')]]&&_0x3d3a67['custom_fields'][_0xfe30('0x1f')]({'id':_0x27ae56[_0xfe30('0x48')],'value':_0x26633d[_0x27ae56[_0xfe30('0x1e')]]['toString']()});}else if(_0x27ae56[_0xfe30('0x47')]===_0xfe30('0x4c')&&_0x27ae56[_0xfe30('0x4d')]&&_0x27ae56[_0xfe30('0x4d')][_0xfe30('0x1a')]&&_0x27ae56['idField']&&_0x27ae56[_0xfe30('0x45')]){_0x26633d[_0x27ae56['Variable'][_0xfe30('0x1a')][_0xfe30('0x46')]()]&&_0x3d3a67[_0xfe30('0x49')]['push']({'id':_0x27ae56[_0xfe30('0x48')],'value':_0x26633d[_0x27ae56['Variable'][_0xfe30('0x1a')][_0xfe30('0x46')]()]['toString']()});}});}return _0x3d3a67;}function getConnection(_0x574134){return request({'method':_0xfe30('0xc'),'form':{'method':_0xfe30('0x4e'),'input_type':_0xfe30('0x21'),'response_type':_0xfe30('0x21'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x574134[_0xfe30('0x4f')],'password':_0x574134['password'],'encryption':_0xfe30('0x50')},'application':_0xfe30('0x51')})}})[_0xfe30('0x2f')](function(_0x2d7c29){var _0x52809c=_0x2d7c29;if(_0x52809c['id']){def[_0xfe30('0x52')]=_0x52809c['id'];return BPromise[_0xfe30('0x35')](_0x52809c);}else{throw new Error(util[_0xfe30('0x23')]('Account\x20%d\x20is\x20not\x20valid',_0x574134['id']));}});}function setRelationship(_0x2e79cd,_0x2e5514,_0x397f87,_0x501f1a){return request({'form':{'method':_0xfe30('0x53'),'input_type':'JSON','response_type':_0xfe30('0x21'),'rest_data':JSON['stringify']({'session':_0x2e79cd['id'],'module_name':_0xfe30('0x22'),'module_id':_0x397f87['id'],'link_field_name':_0x501f1a,'related_ids':[_0x2e5514['id']],'name_value_list':[],'delete':0x0})}});}exports['queue']=function(_0x4a490e,_0x1dbdf2,_0x5e5ee1,_0x6f8d5c,_0x404218,_0x477fbc){var _0x487fd2,_0x2c397f,_0x869e0b,_0x95cb3e;_0x477fbc['remoteUri']=intUtil[_0xfe30('0x54')](_0x477fbc[_0xfe30('0x55')]);_0x477fbc['serverUrl']=intUtil[_0xfe30('0x54')](_0x477fbc['serverUrl']);def[_0xfe30('0x56')]=util[_0xfe30('0x23')](_0xfe30('0x57'),_0x477fbc[_0xfe30('0x55')]);if(_0x404218&&_0x404218[_0xfe30('0x58')]){logger[_0xfe30('0xe')](_0xfe30('0x59'),_0xfe30('0x5a'));_0x1dbdf2[_0xfe30('0x5b')]=util['format'](_0xfe30('0x5c'),_0x477fbc[_0xfe30('0x5d')],_0x1dbdf2[_0xfe30('0x5e')],md5(_0x1dbdf2['uniqueid']));}else{_0x1dbdf2['recordingURL']='';}return getConnection(_0x477fbc)['then'](function(_0x44dc12){_0x95cb3e=_0x44dc12;return getUser(_0x477fbc,_0x6f8d5c[_0xfe30('0x1a')],_0x95cb3e);})[_0xfe30('0x2f')](function(_0x421cff){_0x487fd2=_0x421cff;logger[_0xfe30('0xe')](_0xfe30('0x5f'),_0x487fd2['id']);return getEndUser(_0x477fbc,_0x1dbdf2[_0xfe30('0x60')],_0x1dbdf2[_0xfe30('0x61')],_0x95cb3e);})[_0xfe30('0x2f')](function(_0xd12601){_0x2c397f=_0xd12601;logger[_0xfe30('0xe')](_0xfe30('0x62'),_0x2c397f['id']);return getTicket(_0x477fbc,_0x487fd2,_0x2c397f,_0x5e5ee1,_0x1dbdf2,_0x5e5ee1['Fields'],_0x95cb3e,_0xfe30('0x63'));})['then'](function(_0x52ccdd){_0x869e0b=_0x52ccdd;logger['info'](_0xfe30('0x64'));logger[_0xfe30('0xe')](_0xfe30('0x65'),_0x869e0b['id']);return setRelationship(_0x95cb3e,_0x487fd2,_0x869e0b,_0xfe30('0x66'));})[_0xfe30('0x2f')](function(){return setRelationship(_0x95cb3e,_0x2c397f,_0x869e0b,_0xfe30('0x67'));})['then'](function(){return getServerInfo(_0x95cb3e);})['then'](function(_0x120fad){var _0x177d6a=parseInt(_0x120fad[_0xfe30('0x68')][_0xfe30('0x69')](0x0));var _0x2bdab3=util['format'](_0xfe30('0x6a'),_0x477fbc[_0xfe30('0x55')],_0x869e0b['id']);if(_0x177d6a>0x6){_0x2bdab3=util[_0xfe30('0x23')](_0xfe30('0x6b'),_0x477fbc[_0xfe30('0x55')],_0x869e0b['id']);}logger[_0xfe30('0xe')](_0xfe30('0x59'),_0xfe30('0x6c'));emit(util[_0xfe30('0x23')](_0xfe30('0x6d'),_0x6f8d5c[_0xfe30('0x1a')]),_0xfe30('0x6e'),{'uri':_0x2bdab3});})[_0xfe30('0x6f')](function(_0x5953df){logger[_0xfe30('0x70')](_0xfe30('0x59'),JSON[_0xfe30('0x38')](_0x5953df));});};exports['outbound']=function(_0x3bb2ad,_0x255080,_0x8aa74c,_0x276423,_0x3d747e,_0x2b85d6,_0x198b50){var _0x30b87b,_0x5d2f2c,_0x2a39ed,_0x531c8b;_0x2b85d6[_0xfe30('0x55')]=intUtil[_0xfe30('0x54')](_0x2b85d6[_0xfe30('0x55')]);_0x2b85d6[_0xfe30('0x5d')]=intUtil[_0xfe30('0x54')](_0x2b85d6['serverUrl']);def[_0xfe30('0x56')]=util[_0xfe30('0x23')](_0xfe30('0x57'),_0x2b85d6[_0xfe30('0x55')]);if(_0x198b50&&_0x198b50[_0xfe30('0x71')]&&_0x198b50[_0xfe30('0x71')]!=='none'){logger[_0xfe30('0xe')](_0xfe30('0x72'),_0xfe30('0x5a'));_0x255080[_0xfe30('0x5b')]=util[_0xfe30('0x23')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2b85d6['serverUrl'],_0x255080[_0xfe30('0x5e')],md5(_0x255080[_0xfe30('0x5e')]));}return getConnection(_0x2b85d6)[_0xfe30('0x2f')](function(_0x11bc7a){_0x531c8b=_0x11bc7a;return getUser(_0x2b85d6,_0x276423[_0xfe30('0x1a')],_0x531c8b);})[_0xfe30('0x2f')](function(_0x2e3c0b){_0x30b87b=_0x2e3c0b;logger[_0xfe30('0xe')]('The\x20User\x20ID\x20is:',_0x30b87b['id']);return getEndUser(_0x2b85d6,_0x255080['destcalleridname'],_0x255080[_0xfe30('0x73')],_0x531c8b);})['then'](function(_0x576082){_0x5d2f2c=_0x576082;logger[_0xfe30('0xe')](_0xfe30('0x62'),_0x5d2f2c['id']);return getTicket(_0x2b85d6,_0x30b87b,_0x5d2f2c,_0x8aa74c,_0x255080,_0x8aa74c[_0xfe30('0x74')],_0x531c8b,'Outbound');})['then'](function(_0x46885){_0x2a39ed=_0x46885;logger[_0xfe30('0xe')]('Ticket\x20created!');logger[_0xfe30('0xe')]('The\x20Ticket\x20ID\x20is:',_0x2a39ed['id']);return setRelationship(_0x531c8b,_0x30b87b,_0x2a39ed,'users');})[_0xfe30('0x2f')](function(){return setRelationship(_0x531c8b,_0x5d2f2c,_0x2a39ed,'contacts');})['then'](function(){return getServerInfo(_0x531c8b);})[_0xfe30('0x2f')](function(_0x196a95){var _0x267564=parseInt(_0x196a95['version'][_0xfe30('0x69')](0x0));var _0x151547=util[_0xfe30('0x23')](_0xfe30('0x6a'),_0x2b85d6[_0xfe30('0x55')],_0x2a39ed['id']);if(_0x267564>0x6){_0x151547=util[_0xfe30('0x23')](_0xfe30('0x6b'),_0x2b85d6['remoteUri'],_0x2a39ed['id']);}logger[_0xfe30('0xe')](_0xfe30('0x72'),_0xfe30('0x6c'));emit(util[_0xfe30('0x23')](_0xfe30('0x6d'),_0x276423[_0xfe30('0x1a')]),_0xfe30('0x6e'),{'uri':_0x151547});})[_0xfe30('0x6f')](function(_0x232c5f){logger[_0xfe30('0x70')](_0xfe30('0x72'),JSON['stringify'](_0x232c5f));});};exports[_0xfe30('0x75')]=function(_0x20c06f,_0x407399,_0x2d5e25,_0x18ec19,_0x3ac17e,_0x681b8){var _0x380475,_0x2e1c24,_0x378612,_0x263a60;_0x681b8['remoteUri']=intUtil[_0xfe30('0x54')](_0x681b8['remoteUri']);_0x681b8['serverUrl']=intUtil[_0xfe30('0x54')](_0x681b8['serverUrl']);def[_0xfe30('0x56')]=util[_0xfe30('0x23')](_0xfe30('0x57'),_0x681b8[_0xfe30('0x55')]);if(_0x3ac17e&&_0x3ac17e[_0xfe30('0x58')]){logger[_0xfe30('0xe')]('['+_0x407399[_0xfe30('0x76')]['toUpperCase']()+']',_0xfe30('0x5a'));_0x407399[_0xfe30('0x5b')]=util[_0xfe30('0x23')](_0xfe30('0x5c'),_0x681b8[_0xfe30('0x5d')],_0x407399[_0xfe30('0x5e')],md5(_0x407399[_0xfe30('0x5e')]));}else{_0x407399[_0xfe30('0x5b')]='';}return getConnection(_0x681b8)[_0xfe30('0x2f')](function(_0x1137cb){_0x263a60=_0x1137cb;if(!_['isNil'](_0x18ec19)){return getUser(_0x681b8,_0x18ec19[_0xfe30('0x1a')],_0x263a60);}else{return getUser(_0x681b8,null,_0x263a60);}})[_0xfe30('0x2f')](function(_0x1a35d2){_0x380475=_0x1a35d2;logger[_0xfe30('0xe')](_0xfe30('0x5f'),_0x380475['id']);return getEndUser(_0x681b8,_0x407399[_0xfe30('0x60')],_0x407399[_0xfe30('0x61')],_0x263a60);})[_0xfe30('0x2f')](function(_0x1bc3d8){_0x2e1c24=_0x1bc3d8;logger['info']('The\x20Enduser\x20ID\x20is:',_0x2e1c24['id']);return getTicket(_0x681b8,_0x380475,_0x2e1c24,_0x2d5e25,_0x407399,_0x2d5e25[_0xfe30('0x74')],_0x263a60,_0xfe30('0x63'));})[_0xfe30('0x2f')](function(_0x497c57){_0x378612=_0x497c57;logger['info'](_0xfe30('0x64'));logger[_0xfe30('0xe')](_0xfe30('0x65'),_0x378612['id']);return setRelationship(_0x263a60,_0x380475,_0x378612,'users');})[_0xfe30('0x2f')](function(){return setRelationship(_0x263a60,_0x2e1c24,_0x378612,'contacts');})[_0xfe30('0x2f')](function(){return getServerInfo(_0x263a60);})['catch'](function(_0x347551){logger[_0xfe30('0x70')]('['+_0x407399['lastevent'][_0xfe30('0x77')]()+']',JSON[_0xfe30('0x38')](_0x347551));});}; \ 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 a28cbac..ba01312 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 _0xa340=['name','toLowerCase','toString','keyValue','format','%s:\x20%s','keyContent','key','keyType','join','stripTrailingSlash','substring','lastIndexOf','isNil','test','lodash','util','getString','length','sortBy','type','string','push','variable','variableName','customVariable','Variable'];(function(_0x4087a4,_0xcc1d6d){var _0x245694=function(_0x2fb92f){while(--_0x2fb92f){_0x4087a4['push'](_0x4087a4['shift']());}};_0x245694(++_0xcc1d6d);}(_0xa340,0x11d));var _0x0a34=function(_0x5f467f,_0x26c296){_0x5f467f=_0x5f467f-0x0;var _0x4143aa=_0xa340[_0x5f467f];return _0x4143aa;};'use strict';var _=require(_0x0a34('0x0'));var util=require(_0x0a34('0x1'));exports[_0x0a34('0x2')]=function(_0x3e6eee,_0x4695f2,_0x2139e8){var _0x3294cb=[];if(_0x3e6eee[_0x0a34('0x3')]>0x0){var _0x577bfc=_[_0x0a34('0x4')](_0x3e6eee,['id']);for(var _0x2264be=0x0;_0x2264be<_0x577bfc['length'];_0x2264be++){var _0x15be4b=_0x577bfc[_0x2264be];if(_0x15be4b[_0x0a34('0x5')]===_0x0a34('0x6')){_0x3294cb[_0x0a34('0x7')](_0x15be4b['content']);}else if(_0x15be4b[_0x0a34('0x5')]===_0x0a34('0x8')&&_0x15be4b[_0x0a34('0x9')]){_0x4695f2[_0x15be4b[_0x0a34('0x9')]]&&_0x3294cb[_0x0a34('0x7')](_0x4695f2[_0x15be4b[_0x0a34('0x9')]]['toString']());}else if(_0x15be4b['type']===_0x0a34('0xa')&&_0x15be4b[_0x0a34('0xb')]&&_0x15be4b[_0x0a34('0xb')][_0x0a34('0xc')]){_0x4695f2[_0x15be4b[_0x0a34('0xb')][_0x0a34('0xc')][_0x0a34('0xd')]()]&&_0x3294cb[_0x0a34('0x7')](_0x4695f2[_0x15be4b['Variable'][_0x0a34('0xc')][_0x0a34('0xd')]()][_0x0a34('0xe')]());}else if(_0x15be4b[_0x0a34('0x5')]===_0x0a34('0xf')){if(_0x15be4b['keyType']==='string'&&_0x15be4b['key']){_0x3294cb[_0x0a34('0x7')](util[_0x0a34('0x10')](_0x0a34('0x11'),_0x15be4b['key'],_0x15be4b[_0x0a34('0x12')]));}else if(_0x15be4b['keyType']===_0x0a34('0x8')&&_0x15be4b[_0x0a34('0x9')]&&_0x15be4b[_0x0a34('0x13')]){_0x4695f2[_0x15be4b[_0x0a34('0x9')]]&&_0x3294cb[_0x0a34('0x7')](util[_0x0a34('0x10')](_0x0a34('0x11'),_0x15be4b['key'],_0x4695f2[_0x15be4b[_0x0a34('0x9')]]));}else if(_0x15be4b[_0x0a34('0x14')]===_0x0a34('0xa')&&_0x15be4b[_0x0a34('0xb')]&&_0x15be4b[_0x0a34('0xb')]['name']&&_0x15be4b[_0x0a34('0x13')]){_0x4695f2[_0x15be4b[_0x0a34('0xb')][_0x0a34('0xc')]['toLowerCase']()]&&_0x3294cb[_0x0a34('0x7')](util[_0x0a34('0x10')](_0x0a34('0x11'),_0x15be4b[_0x0a34('0x13')],_0x4695f2[_0x15be4b[_0x0a34('0xb')][_0x0a34('0xc')][_0x0a34('0xd')]()]));}}}}return _0x3294cb[_0x0a34('0x15')](_0x2139e8);};exports[_0x0a34('0x16')]=function(_0x30b46b){var _0x281df7=_0x30b46b['slice'](-0x1);if(_0x281df7==='/'){_0x30b46b=_0x30b46b[_0x0a34('0x17')](0x0,_0x30b46b[_0x0a34('0x18')](_0x281df7));}return _0x30b46b;};exports['validateEmail']=function(_0x35c4d1){if(!_[_0x0a34('0x19')](_0x35c4d1)&&_0x35c4d1!==''){var _0x36c666=/^(([^<>()\[\]\\.,;:\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 _0x36c666[_0x0a34('0x1a')](String(_0x35c4d1)[_0x0a34('0xd')]());}else{return![];}}; \ No newline at end of file +var _0x64d6=['variable','variableName','toString','Variable','name','toLowerCase','keyValue','keyType','key','format','%s:\x20%s','customVariable','join','stripTrailingSlash','substring','lastIndexOf','isNil','test','lodash','util','getString','type','push'];(function(_0x19c883,_0x2098c7){var _0x202144=function(_0x5b1523){while(--_0x5b1523){_0x19c883['push'](_0x19c883['shift']());}};_0x202144(++_0x2098c7);}(_0x64d6,0x1b0));var _0x664d=function(_0x11ab1f,_0xdc3026){_0x11ab1f=_0x11ab1f-0x0;var _0x39009c=_0x64d6[_0x11ab1f];return _0x39009c;};'use strict';var _=require(_0x664d('0x0'));var util=require(_0x664d('0x1'));exports[_0x664d('0x2')]=function(_0x37cf62,_0x3398da,_0x35fb23){var _0x4f0f3e=[];if(_0x37cf62['length']>0x0){var _0xcd4f11=_['sortBy'](_0x37cf62,['id']);for(var _0x4a8628=0x0;_0x4a8628<_0xcd4f11['length'];_0x4a8628++){var _0x655976=_0xcd4f11[_0x4a8628];if(_0x655976[_0x664d('0x3')]==='string'){_0x4f0f3e[_0x664d('0x4')](_0x655976['content']);}else if(_0x655976['type']===_0x664d('0x5')&&_0x655976[_0x664d('0x6')]){_0x3398da[_0x655976['variableName']]&&_0x4f0f3e[_0x664d('0x4')](_0x3398da[_0x655976[_0x664d('0x6')]][_0x664d('0x7')]());}else if(_0x655976['type']==='customVariable'&&_0x655976[_0x664d('0x8')]&&_0x655976[_0x664d('0x8')][_0x664d('0x9')]){_0x3398da[_0x655976[_0x664d('0x8')][_0x664d('0x9')][_0x664d('0xa')]()]&&_0x4f0f3e[_0x664d('0x4')](_0x3398da[_0x655976[_0x664d('0x8')]['name']['toLowerCase']()]['toString']());}else if(_0x655976['type']===_0x664d('0xb')){if(_0x655976[_0x664d('0xc')]==='string'&&_0x655976[_0x664d('0xd')]){_0x4f0f3e[_0x664d('0x4')](util[_0x664d('0xe')](_0x664d('0xf'),_0x655976[_0x664d('0xd')],_0x655976['keyContent']));}else if(_0x655976[_0x664d('0xc')]===_0x664d('0x5')&&_0x655976['variableName']&&_0x655976[_0x664d('0xd')]){_0x3398da[_0x655976['variableName']]&&_0x4f0f3e[_0x664d('0x4')](util[_0x664d('0xe')](_0x664d('0xf'),_0x655976[_0x664d('0xd')],_0x3398da[_0x655976[_0x664d('0x6')]]));}else if(_0x655976[_0x664d('0xc')]===_0x664d('0x10')&&_0x655976[_0x664d('0x8')]&&_0x655976[_0x664d('0x8')][_0x664d('0x9')]&&_0x655976[_0x664d('0xd')]){_0x3398da[_0x655976[_0x664d('0x8')]['name']['toLowerCase']()]&&_0x4f0f3e[_0x664d('0x4')](util['format'](_0x664d('0xf'),_0x655976[_0x664d('0xd')],_0x3398da[_0x655976[_0x664d('0x8')][_0x664d('0x9')][_0x664d('0xa')]()]));}}}}return _0x4f0f3e[_0x664d('0x11')](_0x35fb23);};exports[_0x664d('0x12')]=function(_0x3b9054){var _0x4a12bb=_0x3b9054['slice'](-0x1);if(_0x4a12bb==='/'){_0x3b9054=_0x3b9054[_0x664d('0x13')](0x0,_0x3b9054[_0x664d('0x14')](_0x4a12bb));}return _0x3b9054;};exports['validateEmail']=function(_0x1e47be){if(!_[_0x664d('0x15')](_0x1e47be)&&_0x1e47be!==''){var _0xfdb825=/^(([^<>()\[\]\\.,;:\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 _0xfdb825[_0x664d('0x16')](String(_0x1e47be)[_0x664d('0xa')]());}else{return![];}}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/vtiger.js b/server/services/ami/trigger/integration/vtiger.js index 00e671e..709f25f 100644 --- a/server/services/ami/trigger/integration/vtiger.js +++ b/server/services/ami/trigger/integration/vtiger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['variable','variableName','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','Normal','Open','Subjects','POST','format','%s/webservice.php','create','username','sessionName','HelpDesk','stringify','then','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','error','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','validateEmail','Getting\x20agent\x20with\x20email','GET','query','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','resolve','email1','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','statusCode','getUser','Searching\x20end\x20user\x20with\x20phone','remoteUri','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','getchallenge','login','token','Account\x20%d\x20is\x20not\x20valid','[HTTP]','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','The\x20User\x20ID\x20is:','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','The\x20Enduser\x20ID\x20is:','Fields','split','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridname','lastevent','lodash','request-promise','bluebird','ioredis','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','length','forEach','includes','idField','content','toString','type'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xa9e0[_0x139a3c];return _0x2b375b;};'use strict';var _=require(_0x0a9e('0x0'));var rp=require(_0x0a9e('0x1'));var BPromise=require(_0x0a9e('0x2'));var md5=require('md5');var util=require('util');var Redis=require(_0x0a9e('0x3'));var intUtil=require('./util');var config=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));config[_0x0a9e('0x7')]=_[_0x0a9e('0x8')](config['redis'],{'host':_0x0a9e('0x9'),'port':0x18eb});var io=require(_0x0a9e('0xa'))(new Redis(config[_0x0a9e('0x7')]));function emit(_0x5f41ea,_0x503809,_0xe42b77){io['to'](_0x5f41ea)['emit'](_0x503809,_0xe42b77);}function getCustomFields(_0x52cace,_0x39753a){var _0xf81284={};if(_0x52cace[_0x0a9e('0xb')]>0x0){_[_0x0a9e('0xc')](_0x52cace,function(_0xfeb75b){if(_[_0x0a9e('0xd')](['string','picklist'],_0xfeb75b['type'])&&_0xfeb75b['idField']){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0xfeb75b[_0x0a9e('0xf')][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x12')&&_0xfeb75b[_0x0a9e('0x13')]&&_0xfeb75b['idField']&&_0x39753a[_0xfeb75b[_0x0a9e('0x13')]]){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0x39753a[_0xfeb75b[_0x0a9e('0x13')]][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x14')&&_0xfeb75b['Variable']&&_0xfeb75b[_0x0a9e('0x15')]['name']&&_0xfeb75b[_0x0a9e('0xe')]&&_0x39753a[_0xfeb75b['Variable'][_0x0a9e('0x16')][_0x0a9e('0x17')]()]){_0xf81284[_0xfeb75b['idField']]=_0x39753a[_0xfeb75b[_0x0a9e('0x15')]['name'][_0x0a9e('0x17')]()][_0x0a9e('0x10')]();}});}return _0xf81284;}function createTicket(_0x106033,_0x205fd6,_0x31b1ca,_0x2eb11f,_0x530eb7,_0x20559e,_0x1314ae){logger[_0x0a9e('0x18')](_0x0a9e('0x19'));var _0x105080=_['merge']({'parent_id':'','assigned_user_id':_0x205fd6['id'],'ticketpriorities':_0x0a9e('0x1a'),'ticketstatus':_0x0a9e('0x1b'),'ticket_title':intUtil['getString'](_0x2eb11f[_0x0a9e('0x1c')],_0x530eb7,'\x20'),'description':intUtil['getString'](_0x2eb11f['Descriptions'],_0x530eb7,'\x0a'),'contact_id':_0x31b1ca['id']},getCustomFields(_0x20559e,_0x530eb7));var _0x3a02e1={'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x106033['remoteUri']),'form':{'operation':_0x0a9e('0x20'),'username':_0x106033[_0x0a9e('0x21')],'sessionName':_0x1314ae[_0x0a9e('0x22')],'elementType':_0x0a9e('0x23'),'element':JSON[_0x0a9e('0x24')](_0x105080)},'json':!![]};return request(_0x3a02e1)[_0x0a9e('0x25')](function(_0x16b1ca){if(_0x16b1ca['success']){return BPromise['resolve']({'id':_0x16b1ca[_0x0a9e('0x26')]['id']});}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x27'),JSON[_0x0a9e('0x24')](_0x16b1ca['error'])));}})[_0x0a9e('0x28')](function(_0x479bc4){var _0x45a1e7=_0x479bc4['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x2b'),_0x45a1e7,JSON[_0x0a9e('0x24')](_0x479bc4));});}function getUser(_0x140511,_0x1538a4,_0x11c3b6){if(intUtil[_0x0a9e('0x2c')](_0x1538a4)){logger['info'](_0x0a9e('0x2d'),_0x1538a4);return request({'method':_0x0a9e('0x2e'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x140511['remoteUri']),'qs':{'operation':_0x0a9e('0x2f'),'username':_0x140511[_0x0a9e('0x21')],'sessionName':_0x11c3b6[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x30'),_0x1538a4)},'json':!![]})[_0x0a9e('0x25')](function(_0x296f41){if(_0x296f41[_0x0a9e('0x31')]&&_0x296f41[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')]('Agent\x20found!');return BPromise[_0x0a9e('0x32')]({'id':_0x296f41[_0x0a9e('0x26')][0x0]['id'],'email':_0x296f41[_0x0a9e('0x26')][0x0][_0x0a9e('0x33')],'name':_0x296f41[_0x0a9e('0x26')][0x0]['first_name']+'\x20'+_0x296f41[_0x0a9e('0x26')][_0x0a9e('0x34')]});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511[_0x0a9e('0x21')],'name':_0x0a9e('0x37')});}})['catch'](function(_0x44295a){var _0x5e7238=_0x44295a[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x39'),_0x5e7238,JSON['stringify'](_0x44295a));});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511['username'],'name':'admin'})[_0x0a9e('0x28')](function(_0x5640eb){var _0x24936a=_0x5640eb[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getUser',_0x24936a,JSON[_0x0a9e('0x24')](_0x5640eb));});}}function getEndUser(_0x3bfce8,_0x3cae,_0x533942,_0x1dbf74){logger[_0x0a9e('0x18')](_0x0a9e('0x3a'),_0x533942);return request({'method':'GET','uri':util['format'](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'qs':{'operation':'query','username':_0x3bfce8[_0x0a9e('0x21')],'sessionName':_0x1dbf74[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x3c'),_0x533942,_0x533942,_0x533942,_0x533942,_0x533942)},'json':!![]})['then'](function(_0x5a594b){if(_0x5a594b[_0x0a9e('0x31')]&&_0x5a594b[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')](_0x0a9e('0x3d'));return BPromise[_0x0a9e('0x32')]({'id':_0x5a594b['result'][0x0]['id'],'name':_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3e')]+'\x20'+_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3f')],'phone':_0x533942});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x40'));return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x20'),'sessionName':_0x1dbf74[_0x0a9e('0x22')],'elementType':_0x0a9e('0x41'),'element':JSON[_0x0a9e('0x24')]({'lastname':_0x3cae,'phone':_0x533942,'assigned_user_id':'\x20'})},'json':!![]})[_0x0a9e('0x25')](function(_0x4d04c8){logger['info'](_0x0a9e('0x42'));return BPromise[_0x0a9e('0x32')]({'id':_0x4d04c8[_0x0a9e('0x26')]['id'],'name':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x3f')],'phone':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x43')]});})[_0x0a9e('0x28')](function(_0x432fcc){var _0x25c6e6=_0x432fcc[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')]('[vTiger],\x20%s,\x20%s,\x20%s',_0x0a9e('0x44'),_0x25c6e6,JSON[_0x0a9e('0x24')](_0x432fcc));});}});}function getConnection(_0xdd268f){var _0xfbd5ad=_0xdd268f[_0x0a9e('0x21')];var _0xbe9d19=_0xdd268f[_0x0a9e('0x45')];return request({'method':_0x0a9e('0x2e'),'uri':util['format'](_0x0a9e('0x1f'),_0xdd268f['remoteUri']),'qs':{'operation':_0x0a9e('0x46'),'username':_0xfbd5ad},'json':!![]})[_0x0a9e('0x25')](function(_0x8d6dd1){if(_0x8d6dd1['success']){return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0xdd268f[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x47'),'username':_0xfbd5ad,'accessKey':md5(_0x8d6dd1[_0x0a9e('0x26')][_0x0a9e('0x48')]+_0xbe9d19)},'json':!![]});}})['then'](function(_0x13f44d){if(_0x13f44d[_0x0a9e('0x31')]){return BPromise[_0x0a9e('0x32')](_0x13f44d[_0x0a9e('0x26')]);}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x49'),_0xdd268f['id']));}})[_0x0a9e('0x28')](function(_0x19383e){var _0x34febd=_0x19383e['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getConnection',_0x34febd,JSON['stringify'](_0x19383e));});}function request(_0x5ddf84){logger[_0x0a9e('0x18')](_0x0a9e('0x4a'),JSON[_0x0a9e('0x24')](_0x5ddf84));return rp(_0x5ddf84);}exports[_0x0a9e('0x4b')]=function(_0x61bb17,_0x30decb,_0x2e5165,_0x375c18,_0x5d38ae,_0x4b1b9f){var _0x53975a,_0x39d77d,_0x204173,_0x14d602;_0x4b1b9f['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x4b1b9f[_0x0a9e('0x3b')]);if(_0x5d38ae&&_0x5d38ae['monitor_format']){logger['info'](_0x0a9e('0x4d'),'Recording\x20is\x20enabled!');_0x30decb[_0x0a9e('0x4e')]=util['format'](_0x0a9e('0x4f'),_0x4b1b9f[_0x0a9e('0x50')],_0x30decb[_0x0a9e('0x51')],md5(_0x30decb['uniqueid']));}else{_0x30decb[_0x0a9e('0x4e')]='';}return getConnection(_0x4b1b9f)[_0x0a9e('0x25')](function(_0x508b47){_0x14d602=_0x508b47;return getUser(_0x4b1b9f,_0x375c18['email'],_0x14d602);})[_0x0a9e('0x25')](function(_0x3aedd0){_0x53975a=_0x3aedd0;logger['info'](_0x0a9e('0x52'),_0x53975a['id']);return getEndUser(_0x4b1b9f,_0x30decb['calleridname'],_0x30decb[_0x0a9e('0x53')],_0x14d602);})['then'](function(_0xe22ccc){_0x39d77d=_0xe22ccc;logger['info']('The\x20Enduser\x20ID\x20is:',_0x39d77d['id']);return createTicket(_0x4b1b9f,_0x53975a,_0x39d77d,_0x2e5165,_0x30decb,_0x2e5165['Fields'],_0x14d602);})[_0x0a9e('0x25')](function(_0x47de4c){_0x204173=_0x47de4c;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x204173['id']);var _0x232830=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x4b1b9f[_0x0a9e('0x3b')],_['split'](_0x204173['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x4d'),_0x0a9e('0x57'));emit(util[_0x0a9e('0x1e')](_0x0a9e('0x58'),_0x375c18[_0x0a9e('0x16')]),'trigger:browser:url',{'uri':_0x232830});})[_0x0a9e('0x28')](function(_0x26bc80){logger['error'](_0x0a9e('0x4d'),JSON['stringify'](_0x26bc80));});};exports[_0x0a9e('0x59')]=function(_0x5ba1f9,_0x4b3c1a,_0x5674ee,_0x273cb5,_0x49d231,_0x2244d6,_0x1fc70e){var _0x261adb,_0x7be420,_0x1cca9f,_0x26d7db;_0x2244d6['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x2244d6['remoteUri']);_0x2244d6[_0x0a9e('0x50')]=intUtil[_0x0a9e('0x4c')](_0x2244d6[_0x0a9e('0x50')]);if(_0x1fc70e&&_0x1fc70e['recordingFormat']&&_0x1fc70e[_0x0a9e('0x5a')]!==_0x0a9e('0x5b')){logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),'Recording\x20is\x20enabled!');_0x4b3c1a[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2244d6[_0x0a9e('0x50')],_0x4b3c1a[_0x0a9e('0x51')],md5(_0x4b3c1a[_0x0a9e('0x51')]));}return getConnection(_0x2244d6)[_0x0a9e('0x25')](function(_0x401837){_0x26d7db=_0x401837;return getUser(_0x2244d6,_0x273cb5['email'],_0x26d7db);})[_0x0a9e('0x25')](function(_0x2937e0){_0x261adb=_0x2937e0;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x261adb['id']);return getEndUser(_0x2244d6,_0x4b3c1a[_0x0a9e('0x5d')],_0x4b3c1a['destcalleridnum'],_0x26d7db);})['then'](function(_0x242745){_0x7be420=_0x242745;logger[_0x0a9e('0x18')](_0x0a9e('0x5e'),_0x7be420['id']);return createTicket(_0x2244d6,_0x261adb,_0x7be420,_0x5674ee,_0x4b3c1a,_0x5674ee[_0x0a9e('0x5f')],_0x26d7db);})[_0x0a9e('0x25')](function(_0xc8c264){_0x1cca9f=_0xc8c264;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1cca9f['id']);var _0x2e89b7=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x2244d6[_0x0a9e('0x3b')],_[_0x0a9e('0x60')](_0x1cca9f['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),_0x0a9e('0x57'));emit(util['format'](_0x0a9e('0x58'),_0x273cb5[_0x0a9e('0x16')]),_0x0a9e('0x61'),{'uri':_0x2e89b7});})['catch'](function(_0x1148a1){logger[_0x0a9e('0x29')]('[OUTBOUND]',JSON[_0x0a9e('0x24')](_0x1148a1));});};exports[_0x0a9e('0x62')]=function(_0x3ef315,_0x427946,_0x13b5c0,_0x4a43a8,_0x50cdce,_0x4a2438){var _0x40fb85,_0x18bf5d,_0x1104ad,_0x23a7d3;_0x4a2438[_0x0a9e('0x3b')]=intUtil[_0x0a9e('0x4c')](_0x4a2438[_0x0a9e('0x3b')]);_0x4a2438[_0x0a9e('0x50')]=intUtil['stripTrailingSlash'](_0x4a2438[_0x0a9e('0x50')]);if(_0x50cdce&&_0x50cdce[_0x0a9e('0x63')]){logger[_0x0a9e('0x18')]('['+_0x427946['lastevent'][_0x0a9e('0x64')]()+']','Recording\x20is\x20enabled!');_0x427946[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4a2438[_0x0a9e('0x50')],_0x427946[_0x0a9e('0x51')],md5(_0x427946[_0x0a9e('0x51')]));}else{_0x427946[_0x0a9e('0x4e')]='';}return getConnection(_0x4a2438)['then'](function(_0x1d442c){_0x23a7d3=_0x1d442c;return getUser(_0x4a2438,'',_0x23a7d3);})[_0x0a9e('0x25')](function(_0x371533){_0x40fb85=_0x371533;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x40fb85['id']);return getEndUser(_0x4a2438,_0x427946[_0x0a9e('0x65')],_0x427946[_0x0a9e('0x53')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0x361b21){_0x18bf5d=_0x361b21;logger['info'](_0x0a9e('0x5e'),_0x18bf5d['id']);return createTicket(_0x4a2438,_0x40fb85,_0x18bf5d,_0x13b5c0,_0x427946,_0x13b5c0[_0x0a9e('0x5f')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0xf410e5){_0x1104ad=_0xf410e5;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1104ad['id']);})[_0x0a9e('0x28')](function(_0x336dc3){logger[_0x0a9e('0x29')]('['+_0x427946[_0x0a9e('0x66')][_0x0a9e('0x64')]()+']',JSON[_0x0a9e('0x24')](_0x336dc3));});}; \ No newline at end of file +var _0xa9e0=['variable','variableName','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','Normal','Open','Subjects','POST','format','%s/webservice.php','create','username','sessionName','HelpDesk','stringify','then','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','error','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','validateEmail','Getting\x20agent\x20with\x20email','GET','query','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','resolve','email1','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','statusCode','getUser','Searching\x20end\x20user\x20with\x20phone','remoteUri','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','getchallenge','login','token','Account\x20%d\x20is\x20not\x20valid','[HTTP]','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','The\x20User\x20ID\x20is:','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','The\x20Enduser\x20ID\x20is:','Fields','split','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridname','lastevent','lodash','request-promise','bluebird','ioredis','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','length','forEach','includes','idField','content','toString','type'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xa9e0[_0x4dbaad];return _0x226c72;};'use strict';var _=require(_0x0a9e('0x0'));var rp=require(_0x0a9e('0x1'));var BPromise=require(_0x0a9e('0x2'));var md5=require('md5');var util=require('util');var Redis=require(_0x0a9e('0x3'));var intUtil=require('./util');var config=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));config[_0x0a9e('0x7')]=_[_0x0a9e('0x8')](config['redis'],{'host':_0x0a9e('0x9'),'port':0x18eb});var io=require(_0x0a9e('0xa'))(new Redis(config[_0x0a9e('0x7')]));function emit(_0x5f41ea,_0x503809,_0xe42b77){io['to'](_0x5f41ea)['emit'](_0x503809,_0xe42b77);}function getCustomFields(_0x52cace,_0x39753a){var _0xf81284={};if(_0x52cace[_0x0a9e('0xb')]>0x0){_[_0x0a9e('0xc')](_0x52cace,function(_0xfeb75b){if(_[_0x0a9e('0xd')](['string','picklist'],_0xfeb75b['type'])&&_0xfeb75b['idField']){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0xfeb75b[_0x0a9e('0xf')][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x12')&&_0xfeb75b[_0x0a9e('0x13')]&&_0xfeb75b['idField']&&_0x39753a[_0xfeb75b[_0x0a9e('0x13')]]){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0x39753a[_0xfeb75b[_0x0a9e('0x13')]][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x14')&&_0xfeb75b['Variable']&&_0xfeb75b[_0x0a9e('0x15')]['name']&&_0xfeb75b[_0x0a9e('0xe')]&&_0x39753a[_0xfeb75b['Variable'][_0x0a9e('0x16')][_0x0a9e('0x17')]()]){_0xf81284[_0xfeb75b['idField']]=_0x39753a[_0xfeb75b[_0x0a9e('0x15')]['name'][_0x0a9e('0x17')]()][_0x0a9e('0x10')]();}});}return _0xf81284;}function createTicket(_0x106033,_0x205fd6,_0x31b1ca,_0x2eb11f,_0x530eb7,_0x20559e,_0x1314ae){logger[_0x0a9e('0x18')](_0x0a9e('0x19'));var _0x105080=_['merge']({'parent_id':'','assigned_user_id':_0x205fd6['id'],'ticketpriorities':_0x0a9e('0x1a'),'ticketstatus':_0x0a9e('0x1b'),'ticket_title':intUtil['getString'](_0x2eb11f[_0x0a9e('0x1c')],_0x530eb7,'\x20'),'description':intUtil['getString'](_0x2eb11f['Descriptions'],_0x530eb7,'\x0a'),'contact_id':_0x31b1ca['id']},getCustomFields(_0x20559e,_0x530eb7));var _0x3a02e1={'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x106033['remoteUri']),'form':{'operation':_0x0a9e('0x20'),'username':_0x106033[_0x0a9e('0x21')],'sessionName':_0x1314ae[_0x0a9e('0x22')],'elementType':_0x0a9e('0x23'),'element':JSON[_0x0a9e('0x24')](_0x105080)},'json':!![]};return request(_0x3a02e1)[_0x0a9e('0x25')](function(_0x16b1ca){if(_0x16b1ca['success']){return BPromise['resolve']({'id':_0x16b1ca[_0x0a9e('0x26')]['id']});}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x27'),JSON[_0x0a9e('0x24')](_0x16b1ca['error'])));}})[_0x0a9e('0x28')](function(_0x479bc4){var _0x45a1e7=_0x479bc4['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x2b'),_0x45a1e7,JSON[_0x0a9e('0x24')](_0x479bc4));});}function getUser(_0x140511,_0x1538a4,_0x11c3b6){if(intUtil[_0x0a9e('0x2c')](_0x1538a4)){logger['info'](_0x0a9e('0x2d'),_0x1538a4);return request({'method':_0x0a9e('0x2e'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x140511['remoteUri']),'qs':{'operation':_0x0a9e('0x2f'),'username':_0x140511[_0x0a9e('0x21')],'sessionName':_0x11c3b6[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x30'),_0x1538a4)},'json':!![]})[_0x0a9e('0x25')](function(_0x296f41){if(_0x296f41[_0x0a9e('0x31')]&&_0x296f41[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')]('Agent\x20found!');return BPromise[_0x0a9e('0x32')]({'id':_0x296f41[_0x0a9e('0x26')][0x0]['id'],'email':_0x296f41[_0x0a9e('0x26')][0x0][_0x0a9e('0x33')],'name':_0x296f41[_0x0a9e('0x26')][0x0]['first_name']+'\x20'+_0x296f41[_0x0a9e('0x26')][_0x0a9e('0x34')]});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511[_0x0a9e('0x21')],'name':_0x0a9e('0x37')});}})['catch'](function(_0x44295a){var _0x5e7238=_0x44295a[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x39'),_0x5e7238,JSON['stringify'](_0x44295a));});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511['username'],'name':'admin'})[_0x0a9e('0x28')](function(_0x5640eb){var _0x24936a=_0x5640eb[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getUser',_0x24936a,JSON[_0x0a9e('0x24')](_0x5640eb));});}}function getEndUser(_0x3bfce8,_0x3cae,_0x533942,_0x1dbf74){logger[_0x0a9e('0x18')](_0x0a9e('0x3a'),_0x533942);return request({'method':'GET','uri':util['format'](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'qs':{'operation':'query','username':_0x3bfce8[_0x0a9e('0x21')],'sessionName':_0x1dbf74[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x3c'),_0x533942,_0x533942,_0x533942,_0x533942,_0x533942)},'json':!![]})['then'](function(_0x5a594b){if(_0x5a594b[_0x0a9e('0x31')]&&_0x5a594b[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')](_0x0a9e('0x3d'));return BPromise[_0x0a9e('0x32')]({'id':_0x5a594b['result'][0x0]['id'],'name':_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3e')]+'\x20'+_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3f')],'phone':_0x533942});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x40'));return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x20'),'sessionName':_0x1dbf74[_0x0a9e('0x22')],'elementType':_0x0a9e('0x41'),'element':JSON[_0x0a9e('0x24')]({'lastname':_0x3cae,'phone':_0x533942,'assigned_user_id':'\x20'})},'json':!![]})[_0x0a9e('0x25')](function(_0x4d04c8){logger['info'](_0x0a9e('0x42'));return BPromise[_0x0a9e('0x32')]({'id':_0x4d04c8[_0x0a9e('0x26')]['id'],'name':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x3f')],'phone':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x43')]});})[_0x0a9e('0x28')](function(_0x432fcc){var _0x25c6e6=_0x432fcc[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')]('[vTiger],\x20%s,\x20%s,\x20%s',_0x0a9e('0x44'),_0x25c6e6,JSON[_0x0a9e('0x24')](_0x432fcc));});}});}function getConnection(_0xdd268f){var _0xfbd5ad=_0xdd268f[_0x0a9e('0x21')];var _0xbe9d19=_0xdd268f[_0x0a9e('0x45')];return request({'method':_0x0a9e('0x2e'),'uri':util['format'](_0x0a9e('0x1f'),_0xdd268f['remoteUri']),'qs':{'operation':_0x0a9e('0x46'),'username':_0xfbd5ad},'json':!![]})[_0x0a9e('0x25')](function(_0x8d6dd1){if(_0x8d6dd1['success']){return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0xdd268f[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x47'),'username':_0xfbd5ad,'accessKey':md5(_0x8d6dd1[_0x0a9e('0x26')][_0x0a9e('0x48')]+_0xbe9d19)},'json':!![]});}})['then'](function(_0x13f44d){if(_0x13f44d[_0x0a9e('0x31')]){return BPromise[_0x0a9e('0x32')](_0x13f44d[_0x0a9e('0x26')]);}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x49'),_0xdd268f['id']));}})[_0x0a9e('0x28')](function(_0x19383e){var _0x34febd=_0x19383e['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getConnection',_0x34febd,JSON['stringify'](_0x19383e));});}function request(_0x5ddf84){logger[_0x0a9e('0x18')](_0x0a9e('0x4a'),JSON[_0x0a9e('0x24')](_0x5ddf84));return rp(_0x5ddf84);}exports[_0x0a9e('0x4b')]=function(_0x61bb17,_0x30decb,_0x2e5165,_0x375c18,_0x5d38ae,_0x4b1b9f){var _0x53975a,_0x39d77d,_0x204173,_0x14d602;_0x4b1b9f['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x4b1b9f[_0x0a9e('0x3b')]);if(_0x5d38ae&&_0x5d38ae['monitor_format']){logger['info'](_0x0a9e('0x4d'),'Recording\x20is\x20enabled!');_0x30decb[_0x0a9e('0x4e')]=util['format'](_0x0a9e('0x4f'),_0x4b1b9f[_0x0a9e('0x50')],_0x30decb[_0x0a9e('0x51')],md5(_0x30decb['uniqueid']));}else{_0x30decb[_0x0a9e('0x4e')]='';}return getConnection(_0x4b1b9f)[_0x0a9e('0x25')](function(_0x508b47){_0x14d602=_0x508b47;return getUser(_0x4b1b9f,_0x375c18['email'],_0x14d602);})[_0x0a9e('0x25')](function(_0x3aedd0){_0x53975a=_0x3aedd0;logger['info'](_0x0a9e('0x52'),_0x53975a['id']);return getEndUser(_0x4b1b9f,_0x30decb['calleridname'],_0x30decb[_0x0a9e('0x53')],_0x14d602);})['then'](function(_0xe22ccc){_0x39d77d=_0xe22ccc;logger['info']('The\x20Enduser\x20ID\x20is:',_0x39d77d['id']);return createTicket(_0x4b1b9f,_0x53975a,_0x39d77d,_0x2e5165,_0x30decb,_0x2e5165['Fields'],_0x14d602);})[_0x0a9e('0x25')](function(_0x47de4c){_0x204173=_0x47de4c;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x204173['id']);var _0x232830=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x4b1b9f[_0x0a9e('0x3b')],_['split'](_0x204173['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x4d'),_0x0a9e('0x57'));emit(util[_0x0a9e('0x1e')](_0x0a9e('0x58'),_0x375c18[_0x0a9e('0x16')]),'trigger:browser:url',{'uri':_0x232830});})[_0x0a9e('0x28')](function(_0x26bc80){logger['error'](_0x0a9e('0x4d'),JSON['stringify'](_0x26bc80));});};exports[_0x0a9e('0x59')]=function(_0x5ba1f9,_0x4b3c1a,_0x5674ee,_0x273cb5,_0x49d231,_0x2244d6,_0x1fc70e){var _0x261adb,_0x7be420,_0x1cca9f,_0x26d7db;_0x2244d6['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x2244d6['remoteUri']);_0x2244d6[_0x0a9e('0x50')]=intUtil[_0x0a9e('0x4c')](_0x2244d6[_0x0a9e('0x50')]);if(_0x1fc70e&&_0x1fc70e['recordingFormat']&&_0x1fc70e[_0x0a9e('0x5a')]!==_0x0a9e('0x5b')){logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),'Recording\x20is\x20enabled!');_0x4b3c1a[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2244d6[_0x0a9e('0x50')],_0x4b3c1a[_0x0a9e('0x51')],md5(_0x4b3c1a[_0x0a9e('0x51')]));}return getConnection(_0x2244d6)[_0x0a9e('0x25')](function(_0x401837){_0x26d7db=_0x401837;return getUser(_0x2244d6,_0x273cb5['email'],_0x26d7db);})[_0x0a9e('0x25')](function(_0x2937e0){_0x261adb=_0x2937e0;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x261adb['id']);return getEndUser(_0x2244d6,_0x4b3c1a[_0x0a9e('0x5d')],_0x4b3c1a['destcalleridnum'],_0x26d7db);})['then'](function(_0x242745){_0x7be420=_0x242745;logger[_0x0a9e('0x18')](_0x0a9e('0x5e'),_0x7be420['id']);return createTicket(_0x2244d6,_0x261adb,_0x7be420,_0x5674ee,_0x4b3c1a,_0x5674ee[_0x0a9e('0x5f')],_0x26d7db);})[_0x0a9e('0x25')](function(_0xc8c264){_0x1cca9f=_0xc8c264;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1cca9f['id']);var _0x2e89b7=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x2244d6[_0x0a9e('0x3b')],_[_0x0a9e('0x60')](_0x1cca9f['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),_0x0a9e('0x57'));emit(util['format'](_0x0a9e('0x58'),_0x273cb5[_0x0a9e('0x16')]),_0x0a9e('0x61'),{'uri':_0x2e89b7});})['catch'](function(_0x1148a1){logger[_0x0a9e('0x29')]('[OUTBOUND]',JSON[_0x0a9e('0x24')](_0x1148a1));});};exports[_0x0a9e('0x62')]=function(_0x3ef315,_0x427946,_0x13b5c0,_0x4a43a8,_0x50cdce,_0x4a2438){var _0x40fb85,_0x18bf5d,_0x1104ad,_0x23a7d3;_0x4a2438[_0x0a9e('0x3b')]=intUtil[_0x0a9e('0x4c')](_0x4a2438[_0x0a9e('0x3b')]);_0x4a2438[_0x0a9e('0x50')]=intUtil['stripTrailingSlash'](_0x4a2438[_0x0a9e('0x50')]);if(_0x50cdce&&_0x50cdce[_0x0a9e('0x63')]){logger[_0x0a9e('0x18')]('['+_0x427946['lastevent'][_0x0a9e('0x64')]()+']','Recording\x20is\x20enabled!');_0x427946[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4a2438[_0x0a9e('0x50')],_0x427946[_0x0a9e('0x51')],md5(_0x427946[_0x0a9e('0x51')]));}else{_0x427946[_0x0a9e('0x4e')]='';}return getConnection(_0x4a2438)['then'](function(_0x1d442c){_0x23a7d3=_0x1d442c;return getUser(_0x4a2438,'',_0x23a7d3);})[_0x0a9e('0x25')](function(_0x371533){_0x40fb85=_0x371533;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x40fb85['id']);return getEndUser(_0x4a2438,_0x427946[_0x0a9e('0x65')],_0x427946[_0x0a9e('0x53')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0x361b21){_0x18bf5d=_0x361b21;logger['info'](_0x0a9e('0x5e'),_0x18bf5d['id']);return createTicket(_0x4a2438,_0x40fb85,_0x18bf5d,_0x13b5c0,_0x427946,_0x13b5c0[_0x0a9e('0x5f')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0xf410e5){_0x1104ad=_0xf410e5;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1104ad['id']);})[_0x0a9e('0x28')](function(_0x336dc3){logger[_0x0a9e('0x29')]('['+_0x427946[_0x0a9e('0x66')][_0x0a9e('0x64')]()+']',JSON[_0x0a9e('0x24')](_0x336dc3));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/zendesk.js b/server/services/ami/trigger/integration/zendesk.js index ebf899a..769deda 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 _0xc18e=['The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','newTab','%s/agent/tickets/%s','replace','catch','inspect','unmanaged','lastevent','calleridname','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','zendesk','redis','localhost','socket.io-emitter','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','POST','Tags','name','getString','Fields','then','info','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','find','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','%s/search.json','type:user\x20role:end-user\x20phone:%s','length','filter','end-user','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Caller\x20-\x20%s','authType','password','%s:%s','token','%s/token:%s','Basic\x20%s','toString','base64','[HTTP]','stringify','GET','forEach','string','type','nameField','content','includes','idField','customField','custom_fields','push','variableName','customVariable','Variable','toLowerCase','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','Authorization','email','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','outbound','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s'];(function(_0x5cb1af,_0x4bdc8c){var _0x8d7940=function(_0x3db70a){while(--_0x3db70a){_0x5cb1af['push'](_0x5cb1af['shift']());}};_0x8d7940(++_0x4bdc8c);}(_0xc18e,0xe9));var _0xec18=function(_0x2ff238,_0x1811d2){_0x2ff238=_0x2ff238-0x0;var _0x204a56=_0xc18e[_0x2ff238];return _0x204a56;};'use strict';var _=require(_0xec18('0x0'));var rp=require(_0xec18('0x1'));var md5=require(_0xec18('0x2'));var util=require('util');var Redis=require(_0xec18('0x3'));var intUtil=require(_0xec18('0x4'));var config=require(_0xec18('0x5'));var logger=require(_0xec18('0x6'))(_0xec18('0x7'));config[_0xec18('0x8')]=_['defaults'](config[_0xec18('0x8')],{'host':_0xec18('0x9'),'port':0x18eb});var io=require(_0xec18('0xa'))(new Redis(config['redis']));function emit(_0x245a9b,_0x2059c8,_0xd82fb3){io['to'](_0x245a9b)['emit'](_0x2059c8,_0xd82fb3);}var headers={'Content-Type':'application/json','Accept':'application/json'};function getTicket(_0x561d7e,_0x3d337b,_0x2e5f04,_0x275ff4,_0x1b1fd5){logger['info'](_0xec18('0xb'));return request({'uri':util[_0xec18('0xc')](_0xec18('0xd'),_0x561d7e[_0xec18('0xe')]),'method':_0xec18('0xf'),'body':{'ticket':_['merge']({'requester_id':_0x2e5f04['id'],'submitter_id':_0x3d337b?_0x3d337b['id']:undefined,'assignee_id':_0x3d337b?_0x3d337b['id']:undefined,'tags':getTags(_0x275ff4[_0xec18('0x10')],_0xec18('0x11')),'subject':intUtil[_0xec18('0x12')](_0x275ff4['Subjects'],_0x1b1fd5,'\x20'),'description':intUtil[_0xec18('0x12')](_0x275ff4['Descriptions'],_0x1b1fd5,'\x0a'),'comment':{'public':![],'body':intUtil['getString'](_0x275ff4['Descriptions'],_0x1b1fd5,'\x0a')}},getCustomFields(_0x275ff4[_0xec18('0x13')],_0x1b1fd5))}})[_0xec18('0x14')](function(_0xee02e9){logger[_0xec18('0x15')](_0xec18('0x16'));return _0xee02e9[_0xec18('0x17')];});}function getUser(_0x145a82,_0x5baeea){if(intUtil[_0xec18('0x18')](_0x5baeea)){logger[_0xec18('0x15')](_0xec18('0x19'),_0x5baeea);return request({'uri':util['format']('%s/search.json',_0x145a82['remoteUri']),'qs':{'query':util[_0xec18('0xc')](_0xec18('0x1a'),_0x5baeea)}})[_0xec18('0x14')](function(_0x1a98fc){if(_0x1a98fc[_0xec18('0x1b')]){logger[_0xec18('0x15')](_0xec18('0x1c'));return _[_0xec18('0x1d')](_0x1a98fc[_0xec18('0x1e')],{'email':_0x5baeea,'role':_0xec18('0x1f')});}else{logger['info'](_0xec18('0x20'));return request({'uri':util[_0xec18('0xc')](_0xec18('0x21'),_0x145a82[_0xec18('0xe')])})[_0xec18('0x14')](function(_0x11205f){logger['info'](_0xec18('0x22'));return _0x11205f[_0xec18('0x23')];});}});}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xec18('0xc')]('%s/users/me.json',_0x145a82[_0xec18('0xe')])})[_0xec18('0x14')](function(_0xa9c7fa){logger[_0xec18('0x15')]('Admin\x20account\x20selected.');return _0xa9c7fa['user'];});}}function getEndUser(_0x21d066,_0x39eb95,_0x2e8ba8){logger[_0xec18('0x15')](_0xec18('0x24'),_0x2e8ba8);return request({'uri':util['format'](_0xec18('0x25'),_0x21d066[_0xec18('0xe')]),'qs':{'query':util[_0xec18('0xc')](_0xec18('0x26'),_0x2e8ba8)}})[_0xec18('0x14')](function(_0x4316f5){var _0x5d3c5b;if(_0x4316f5[_0xec18('0x1e')][_0xec18('0x27')]){_0x4316f5[_0xec18('0x1e')]=_[_0xec18('0x28')](_0x4316f5['results'],{'suspended':![],'role':_0xec18('0x29')});if(_0x4316f5[_0xec18('0x1e')][_0xec18('0x27')]){_0x5d3c5b=_['first'](_0x4316f5[_0xec18('0x1e')]);}}if(_0x5d3c5b){logger['info']('Enduser\x20found!');return _0x5d3c5b;}else{logger[_0xec18('0x15')](_0xec18('0x2a'));return request({'uri':util['format']('%s/users.json',_0x21d066['remoteUri']),'method':_0xec18('0xf'),'body':{'user':{'role':_0xec18('0x29'),'name':util['format'](_0xec18('0x2b'),_0x39eb95||_0x2e8ba8),'phone':_0x2e8ba8}}})[_0xec18('0x14')](function(_0x28a641){logger[_0xec18('0x15')]('Enduser\x20created.');return _0x28a641[_0xec18('0x23')];});}});}function getAuth(_0x2c8fd0){var _0x82324b;if(_0x2c8fd0[_0xec18('0x2c')]===_0xec18('0x2d')){_0x82324b=util[_0xec18('0xc')](_0xec18('0x2e'),_0x2c8fd0['username'],_0x2c8fd0['password']);}else if(_0x2c8fd0[_0xec18('0x2c')]===_0xec18('0x2f')){_0x82324b=util['format'](_0xec18('0x30'),_0x2c8fd0['username'],_0x2c8fd0['token']);}return util['format'](_0xec18('0x31'),new Buffer(_0x82324b)[_0xec18('0x32')](_0xec18('0x33')));}function request(_0xdc8e12){logger['debug'](_0xec18('0x34'),JSON[_0xec18('0x35')](_0xdc8e12));return rp(_['defaults'](_0xdc8e12,{'method':_0xec18('0x36'),'headers':headers,'json':!![]}));}function getTags(_0x4b4fe7,_0xcc8cf7){var _0x165fa5=[];if(_0x4b4fe7&&_0x4b4fe7[_0xec18('0x27')]>0x0){_0x165fa5=_['map'](_0x4b4fe7,_0xcc8cf7);}return _0x165fa5;}function getCustomFields(_0x3f65a5,_0xd6b285){var _0x157150=[];var _0x49cf0e={'custom_fields':[]};if(_0x3f65a5[_0xec18('0x27')]>0x0){_[_0xec18('0x37')](_0x3f65a5,function(_0x247e20){if(_['includes']([_0xec18('0x38'),'picklist'],_0x247e20[_0xec18('0x39')])&&_0x247e20[_0xec18('0x3a')]&&!_0x247e20['customField']){_0x49cf0e[_0x247e20['nameField']['toLowerCase']()]=_0x247e20[_0xec18('0x3b')][_0xec18('0x32')]();}else if(_[_0xec18('0x3c')]([_0xec18('0x38'),'picklist'],_0x247e20[_0xec18('0x39')])&&_0x247e20[_0xec18('0x3d')]&&_0x247e20[_0xec18('0x3e')]){_0x49cf0e[_0xec18('0x3f')][_0xec18('0x40')]({'id':_0x247e20['idField'],'value':_0x247e20[_0xec18('0x3b')][_0xec18('0x32')]()});}else if(_0x247e20[_0xec18('0x39')]==='variable'&&_0x247e20[_0xec18('0x41')]&&_0x247e20[_0xec18('0x3d')]&&_0x247e20[_0xec18('0x3e')]){_0xd6b285[_0x247e20['variableName']]&&_0x49cf0e[_0xec18('0x3f')][_0xec18('0x40')]({'id':_0x247e20['idField'],'value':_0xd6b285[_0x247e20['variableName']][_0xec18('0x32')]()});}else if(_0x247e20[_0xec18('0x39')]===_0xec18('0x42')&&_0x247e20[_0xec18('0x43')]&&_0x247e20[_0xec18('0x43')][_0xec18('0x11')]&&_0x247e20[_0xec18('0x3d')]&&_0x247e20[_0xec18('0x3e')]){_0xd6b285[_0x247e20[_0xec18('0x43')][_0xec18('0x11')][_0xec18('0x44')]()]&&_0x49cf0e[_0xec18('0x3f')][_0xec18('0x40')]({'id':_0x247e20[_0xec18('0x3d')],'value':_0xd6b285[_0x247e20[_0xec18('0x43')][_0xec18('0x11')][_0xec18('0x44')]()]['toString']()});}});}return _0x49cf0e;}exports[_0xec18('0x45')]=function(_0xad775e,_0x285dc9,_0x254e02,_0x253274,_0x42580c,_0xe54e99){var _0x264111,_0x14378a;_0xe54e99[_0xec18('0xe')]=intUtil[_0xec18('0x46')](_0xe54e99[_0xec18('0xe')]);_0xe54e99[_0xec18('0x47')]=intUtil[_0xec18('0x46')](_0xe54e99[_0xec18('0x47')]);if(_0x42580c&&_0x42580c[_0xec18('0x48')]){logger[_0xec18('0x15')](_0xec18('0x49'),_0xec18('0x4a'));_0x285dc9[_0xec18('0x4b')]=util[_0xec18('0xc')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xe54e99[_0xec18('0x47')],_0x285dc9[_0xec18('0x4c')],md5(_0x285dc9[_0xec18('0x4c')]));}else{_0x285dc9[_0xec18('0x4b')]='';}headers[_0xec18('0x4d')]=getAuth(_0xe54e99);return getUser(_0xe54e99,_0x253274[_0xec18('0x4e')])['then'](function(_0x4506fe){_0x264111=_0x4506fe;logger['info']('The\x20User\x20ID\x20is:',_0x264111['id']);return getEndUser(_0xe54e99,_0x285dc9['calleridname'],_0x285dc9[_0xec18('0x4f')]);})[_0xec18('0x14')](function(_0x5050d9){_0x14378a=_0x5050d9;logger['info'](_0xec18('0x50'),_0x14378a['id']);return getTicket(_0xe54e99,_0x264111,_0x14378a,_0x254e02,_0x285dc9);})[_0xec18('0x14')](function(_0x5c0822){if(_0x5c0822){logger[_0xec18('0x15')](_0xec18('0x51'),_0x5c0822['id']);switch(_0xe54e99[_0xec18('0x39')]){case _0xec18('0x52'):logger[_0xec18('0x15')](_0xec18('0x49'),_0xec18('0x53'));return request({'uri':util[_0xec18('0xc')](_0xec18('0x54'),_0xe54e99['remoteUri'],_0x264111['id'],_0x5c0822['id']),'method':'POST'});case'newTab':logger['info'](_0xec18('0x49'),_0xec18('0x55'));emit(util[_0xec18('0xc')](_0xec18('0x56'),_0x253274[_0xec18('0x11')]),_0xec18('0x57'),{'uri':util['format']('%s/agent/tickets/%s',_0xe54e99['remoteUri']['replace'](_0xec18('0x58'),''),_0x5c0822['id'])});break;default:logger[_0xec18('0x59')](_0xec18('0x49'),_0xec18('0x5a'));}}})['catch'](function(_0x33f423){logger['error'](_0xec18('0x5b'),util['inspect'](_0x33f423,{'showHidden':!![],'depth':null}));});};exports[_0xec18('0x5c')]=function(_0x2b837a,_0x39f188,_0x4593be,_0x1a9e03,_0x565030,_0x383210,_0x31649e){var _0x5b400e,_0xdd0644;_0x383210[_0xec18('0xe')]=intUtil[_0xec18('0x46')](_0x383210[_0xec18('0xe')]);_0x383210[_0xec18('0x47')]=intUtil[_0xec18('0x46')](_0x383210[_0xec18('0x47')]);if(_0x31649e&&_0x31649e[_0xec18('0x5d')]&&_0x31649e['recordingFormat']!==_0xec18('0x5e')){logger[_0xec18('0x15')](_0xec18('0x5f'),'Recording\x20is\x20enabled!');_0x39f188['recordingURL']=util[_0xec18('0xc')](_0xec18('0x60'),_0x383210[_0xec18('0x47')],_0x39f188[_0xec18('0x4c')],md5(_0x39f188[_0xec18('0x4c')]));}headers[_0xec18('0x4d')]=getAuth(_0x383210);return getUser(_0x383210,_0x1a9e03[_0xec18('0x4e')])[_0xec18('0x14')](function(_0x1090f6){_0x5b400e=_0x1090f6;logger[_0xec18('0x15')](_0xec18('0x61'),_0x5b400e['id']);return getEndUser(_0x383210,_0x39f188[_0xec18('0x62')],_0x39f188[_0xec18('0x63')]);})[_0xec18('0x14')](function(_0x3bca98){_0xdd0644=_0x3bca98;logger[_0xec18('0x15')](_0xec18('0x50'),_0xdd0644['id']);return getTicket(_0x383210,_0x5b400e,_0xdd0644,_0x4593be,_0x39f188);})[_0xec18('0x14')](function(_0x298df0){if(_0x298df0){logger[_0xec18('0x15')](_0xec18('0x51'),_0x298df0['id']);switch(_0x383210[_0xec18('0x39')]){case _0xec18('0x52'):logger[_0xec18('0x15')]('[OUTBOUND]',_0xec18('0x53'));return request({'uri':util[_0xec18('0xc')](_0xec18('0x54'),_0x383210[_0xec18('0xe')],_0x5b400e['id'],_0x298df0['id']),'method':_0xec18('0xf')});case _0xec18('0x64'):logger[_0xec18('0x15')](_0xec18('0x5f'),_0xec18('0x55'));emit(util[_0xec18('0xc')](_0xec18('0x56'),_0x1a9e03[_0xec18('0x11')]),_0xec18('0x57'),{'uri':util[_0xec18('0xc')](_0xec18('0x65'),_0x383210[_0xec18('0xe')][_0xec18('0x66')](_0xec18('0x58'),''),_0x298df0['id'])});break;default:logger[_0xec18('0x59')](_0xec18('0x5f'),_0xec18('0x5a'));}}})[_0xec18('0x67')](function(_0x4418f1){logger[_0xec18('0x59')]('[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration',util[_0xec18('0x68')](_0x4418f1,{'showHidden':!![],'depth':null}));});};exports[_0xec18('0x69')]=function(_0x458f1c,_0x56b13a,_0x4aafcf,_0x503bf5,_0x1aa82e,_0x1b5ff9){var _0x22efab,_0x2a6187;_0x1b5ff9['remoteUri']=intUtil[_0xec18('0x46')](_0x1b5ff9[_0xec18('0xe')]);_0x1b5ff9[_0xec18('0x47')]=intUtil[_0xec18('0x46')](_0x1b5ff9[_0xec18('0x47')]);if(_0x1aa82e&&_0x1aa82e[_0xec18('0x48')]){logger['info']('['+_0x56b13a[_0xec18('0x6a')]['toUpperCase']()+']',_0xec18('0x4a'));_0x56b13a[_0xec18('0x4b')]=util[_0xec18('0xc')](_0xec18('0x60'),_0x1b5ff9[_0xec18('0x47')],_0x56b13a['uniqueid'],md5(_0x56b13a[_0xec18('0x4c')]));}else{_0x56b13a[_0xec18('0x4b')]='';}headers[_0xec18('0x4d')]=getAuth(_0x1b5ff9);return getUser(_0x1b5ff9)[_0xec18('0x14')](function(_0x4b0b06){_0x22efab=_0x4b0b06;logger[_0xec18('0x15')]('The\x20User\x20ID\x20is:',_0x22efab['id']);return getEndUser(_0x1b5ff9,_0x56b13a[_0xec18('0x6b')],_0x56b13a[_0xec18('0x4f')]);})['then'](function(_0x4c4e0c){_0x2a6187=_0x4c4e0c;logger['info'](_0xec18('0x50'),_0x2a6187['id']);return getTicket(_0x1b5ff9,_0x22efab,_0x2a6187,_0x4aafcf,_0x56b13a);})[_0xec18('0x14')](function(_0x44a554){if(_0x44a554){logger[_0xec18('0x15')]('The\x20Ticket\x20ID\x20is:',_0x44a554['id']);}})['catch'](function(_0x3cd86c){logger[_0xec18('0x59')]('['+_0x56b13a[_0xec18('0x6a')][_0xec18('0x6c')]()+']'+_0xec18('0x6d'),util[_0xec18('0x68')](_0x3cd86c,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x9cab=['toLowerCase','content','picklist','idField','custom_fields','push','variable','variableName','customVariable','Variable','queue','serverUrl','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridnum','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...','user:%s','trigger:browser:url','%s/agent/tickets/%s','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!','email','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','replace','unmanaged','monitor_format','lastevent','toUpperCase','Authorization','calleridname','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','zendesk','redis','defaults','localhost','socket.io-emitter','emit','application/json','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','POST','merge','Tags','name','getString','Subjects','Descriptions','Fields','then','info','Ticket\x20created!','ticket','validateEmail','%s/search.json','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','results','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','user','%s/users/me.json','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','length','filter','end-user','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Caller\x20-\x20%s','authType','%s:%s','username','token','%s/token:%s','Basic\x20%s','toString','base64','[HTTP]','stringify','map','forEach','includes','string','type','nameField','customField'];(function(_0x2e3d60,_0x1f83f9){var _0x4a2d3c=function(_0x374054){while(--_0x374054){_0x2e3d60['push'](_0x2e3d60['shift']());}};_0x4a2d3c(++_0x1f83f9);}(_0x9cab,0x11b));var _0xb9ca=function(_0x25357a,_0x37a02c){_0x25357a=_0x25357a-0x0;var _0x257fc1=_0x9cab[_0x25357a];return _0x257fc1;};'use strict';var _=require(_0xb9ca('0x0'));var rp=require(_0xb9ca('0x1'));var md5=require(_0xb9ca('0x2'));var util=require(_0xb9ca('0x3'));var Redis=require(_0xb9ca('0x4'));var intUtil=require(_0xb9ca('0x5'));var config=require(_0xb9ca('0x6'));var logger=require(_0xb9ca('0x7'))(_0xb9ca('0x8'));config[_0xb9ca('0x9')]=_[_0xb9ca('0xa')](config[_0xb9ca('0x9')],{'host':_0xb9ca('0xb'),'port':0x18eb});var io=require(_0xb9ca('0xc'))(new Redis(config[_0xb9ca('0x9')]));function emit(_0xc3e321,_0x167fec,_0x553aab){io['to'](_0xc3e321)[_0xb9ca('0xd')](_0x167fec,_0x553aab);}var headers={'Content-Type':_0xb9ca('0xe'),'Accept':'application/json'};function getTicket(_0x4c77b4,_0x1f1c04,_0x357df1,_0x2625cb,_0x424a80){logger['info'](_0xb9ca('0xf'));return request({'uri':util[_0xb9ca('0x10')](_0xb9ca('0x11'),_0x4c77b4[_0xb9ca('0x12')]),'method':_0xb9ca('0x13'),'body':{'ticket':_[_0xb9ca('0x14')]({'requester_id':_0x357df1['id'],'submitter_id':_0x1f1c04?_0x1f1c04['id']:undefined,'assignee_id':_0x1f1c04?_0x1f1c04['id']:undefined,'tags':getTags(_0x2625cb[_0xb9ca('0x15')],_0xb9ca('0x16')),'subject':intUtil[_0xb9ca('0x17')](_0x2625cb[_0xb9ca('0x18')],_0x424a80,'\x20'),'description':intUtil[_0xb9ca('0x17')](_0x2625cb[_0xb9ca('0x19')],_0x424a80,'\x0a'),'comment':{'public':![],'body':intUtil[_0xb9ca('0x17')](_0x2625cb[_0xb9ca('0x19')],_0x424a80,'\x0a')}},getCustomFields(_0x2625cb[_0xb9ca('0x1a')],_0x424a80))}})[_0xb9ca('0x1b')](function(_0x1d2ec9){logger[_0xb9ca('0x1c')](_0xb9ca('0x1d'));return _0x1d2ec9[_0xb9ca('0x1e')];});}function getUser(_0x3f0799,_0x67aa6d){if(intUtil[_0xb9ca('0x1f')](_0x67aa6d)){logger[_0xb9ca('0x1c')]('Getting\x20agent\x20with\x20email',_0x67aa6d);return request({'uri':util[_0xb9ca('0x10')](_0xb9ca('0x20'),_0x3f0799[_0xb9ca('0x12')]),'qs':{'query':util[_0xb9ca('0x10')](_0xb9ca('0x21'),_0x67aa6d)}})['then'](function(_0x13e566){if(_0x13e566[_0xb9ca('0x22')]){logger[_0xb9ca('0x1c')](_0xb9ca('0x23'));return _['find'](_0x13e566[_0xb9ca('0x24')],{'email':_0x67aa6d,'role':'agent'});}else{logger['info'](_0xb9ca('0x25'));return request({'uri':util[_0xb9ca('0x10')]('%s/users/me.json',_0x3f0799['remoteUri'])})[_0xb9ca('0x1b')](function(_0x41772c){logger['info'](_0xb9ca('0x26'));return _0x41772c[_0xb9ca('0x27')];});}});}else{logger['info'](_0xb9ca('0x25'));return request({'uri':util[_0xb9ca('0x10')](_0xb9ca('0x28'),_0x3f0799['remoteUri'])})[_0xb9ca('0x1b')](function(_0x3212ae){logger[_0xb9ca('0x1c')](_0xb9ca('0x26'));return _0x3212ae[_0xb9ca('0x27')];});}}function getEndUser(_0x539bf7,_0x49cfa2,_0x500ece){logger[_0xb9ca('0x1c')](_0xb9ca('0x29'),_0x500ece);return request({'uri':util[_0xb9ca('0x10')](_0xb9ca('0x20'),_0x539bf7[_0xb9ca('0x12')]),'qs':{'query':util[_0xb9ca('0x10')](_0xb9ca('0x2a'),_0x500ece)}})[_0xb9ca('0x1b')](function(_0x3d4d8f){var _0x334bc3;if(_0x3d4d8f[_0xb9ca('0x24')][_0xb9ca('0x2b')]){_0x3d4d8f[_0xb9ca('0x24')]=_[_0xb9ca('0x2c')](_0x3d4d8f['results'],{'suspended':![],'role':_0xb9ca('0x2d')});if(_0x3d4d8f[_0xb9ca('0x24')][_0xb9ca('0x2b')]){_0x334bc3=_[_0xb9ca('0x2e')](_0x3d4d8f[_0xb9ca('0x24')]);}}if(_0x334bc3){logger[_0xb9ca('0x1c')](_0xb9ca('0x2f'));return _0x334bc3;}else{logger[_0xb9ca('0x1c')](_0xb9ca('0x30'));return request({'uri':util[_0xb9ca('0x10')](_0xb9ca('0x31'),_0x539bf7[_0xb9ca('0x12')]),'method':_0xb9ca('0x13'),'body':{'user':{'role':'end-user','name':util['format'](_0xb9ca('0x32'),_0x49cfa2||_0x500ece),'phone':_0x500ece}}})[_0xb9ca('0x1b')](function(_0xa0fcef){logger['info']('Enduser\x20created.');return _0xa0fcef[_0xb9ca('0x27')];});}});}function getAuth(_0x2be910){var _0x55856a;if(_0x2be910[_0xb9ca('0x33')]==='password'){_0x55856a=util[_0xb9ca('0x10')](_0xb9ca('0x34'),_0x2be910[_0xb9ca('0x35')],_0x2be910['password']);}else if(_0x2be910[_0xb9ca('0x33')]===_0xb9ca('0x36')){_0x55856a=util[_0xb9ca('0x10')](_0xb9ca('0x37'),_0x2be910[_0xb9ca('0x35')],_0x2be910['token']);}return util[_0xb9ca('0x10')](_0xb9ca('0x38'),new Buffer(_0x55856a)[_0xb9ca('0x39')](_0xb9ca('0x3a')));}function request(_0x448acc){logger['debug'](_0xb9ca('0x3b'),JSON[_0xb9ca('0x3c')](_0x448acc));return rp(_[_0xb9ca('0xa')](_0x448acc,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x5504f6,_0x4f5768){var _0x232098=[];if(_0x5504f6&&_0x5504f6[_0xb9ca('0x2b')]>0x0){_0x232098=_[_0xb9ca('0x3d')](_0x5504f6,_0x4f5768);}return _0x232098;}function getCustomFields(_0x5ea8ba,_0x24dd4d){var _0x79ddc1=[];var _0x5dcaaf={'custom_fields':[]};if(_0x5ea8ba[_0xb9ca('0x2b')]>0x0){_[_0xb9ca('0x3e')](_0x5ea8ba,function(_0x5c11e5){if(_[_0xb9ca('0x3f')]([_0xb9ca('0x40'),'picklist'],_0x5c11e5[_0xb9ca('0x41')])&&_0x5c11e5[_0xb9ca('0x42')]&&!_0x5c11e5[_0xb9ca('0x43')]){_0x5dcaaf[_0x5c11e5[_0xb9ca('0x42')][_0xb9ca('0x44')]()]=_0x5c11e5[_0xb9ca('0x45')][_0xb9ca('0x39')]();}else if(_['includes']([_0xb9ca('0x40'),_0xb9ca('0x46')],_0x5c11e5['type'])&&_0x5c11e5[_0xb9ca('0x47')]&&_0x5c11e5[_0xb9ca('0x43')]){_0x5dcaaf[_0xb9ca('0x48')][_0xb9ca('0x49')]({'id':_0x5c11e5[_0xb9ca('0x47')],'value':_0x5c11e5[_0xb9ca('0x45')][_0xb9ca('0x39')]()});}else if(_0x5c11e5[_0xb9ca('0x41')]===_0xb9ca('0x4a')&&_0x5c11e5[_0xb9ca('0x4b')]&&_0x5c11e5['idField']&&_0x5c11e5[_0xb9ca('0x43')]){_0x24dd4d[_0x5c11e5[_0xb9ca('0x4b')]]&&_0x5dcaaf[_0xb9ca('0x48')][_0xb9ca('0x49')]({'id':_0x5c11e5['idField'],'value':_0x24dd4d[_0x5c11e5[_0xb9ca('0x4b')]][_0xb9ca('0x39')]()});}else if(_0x5c11e5[_0xb9ca('0x41')]===_0xb9ca('0x4c')&&_0x5c11e5['Variable']&&_0x5c11e5[_0xb9ca('0x4d')][_0xb9ca('0x16')]&&_0x5c11e5[_0xb9ca('0x47')]&&_0x5c11e5[_0xb9ca('0x43')]){_0x24dd4d[_0x5c11e5[_0xb9ca('0x4d')][_0xb9ca('0x16')][_0xb9ca('0x44')]()]&&_0x5dcaaf[_0xb9ca('0x48')][_0xb9ca('0x49')]({'id':_0x5c11e5[_0xb9ca('0x47')],'value':_0x24dd4d[_0x5c11e5['Variable'][_0xb9ca('0x16')][_0xb9ca('0x44')]()][_0xb9ca('0x39')]()});}});}return _0x5dcaaf;}exports[_0xb9ca('0x4e')]=function(_0x38a99f,_0x51d162,_0x56fa58,_0x50a221,_0x26df0f,_0x49edb4){var _0x288dea,_0x40d497;_0x49edb4[_0xb9ca('0x12')]=intUtil['stripTrailingSlash'](_0x49edb4[_0xb9ca('0x12')]);_0x49edb4[_0xb9ca('0x4f')]=intUtil[_0xb9ca('0x50')](_0x49edb4[_0xb9ca('0x4f')]);if(_0x26df0f&&_0x26df0f['monitor_format']){logger['info'](_0xb9ca('0x51'),'Recording\x20is\x20enabled!');_0x51d162[_0xb9ca('0x52')]=util['format'](_0xb9ca('0x53'),_0x49edb4['serverUrl'],_0x51d162[_0xb9ca('0x54')],md5(_0x51d162[_0xb9ca('0x54')]));}else{_0x51d162['recordingURL']='';}headers['Authorization']=getAuth(_0x49edb4);return getUser(_0x49edb4,_0x50a221['email'])[_0xb9ca('0x1b')](function(_0x1d7834){_0x288dea=_0x1d7834;logger[_0xb9ca('0x1c')]('The\x20User\x20ID\x20is:',_0x288dea['id']);return getEndUser(_0x49edb4,_0x51d162['calleridname'],_0x51d162[_0xb9ca('0x55')]);})['then'](function(_0x48a05d){_0x40d497=_0x48a05d;logger[_0xb9ca('0x1c')](_0xb9ca('0x56'),_0x40d497['id']);return getTicket(_0x49edb4,_0x288dea,_0x40d497,_0x56fa58,_0x51d162);})[_0xb9ca('0x1b')](function(_0x446a3f){if(_0x446a3f){logger['info'](_0xb9ca('0x57'),_0x446a3f['id']);switch(_0x49edb4[_0xb9ca('0x41')]){case'integrationTab':logger[_0xb9ca('0x1c')](_0xb9ca('0x51'),_0xb9ca('0x58'));return request({'uri':util[_0xb9ca('0x10')](_0xb9ca('0x59'),_0x49edb4['remoteUri'],_0x288dea['id'],_0x446a3f['id']),'method':_0xb9ca('0x13')});case _0xb9ca('0x5a'):logger['info'](_0xb9ca('0x51'),_0xb9ca('0x5b'));emit(util['format'](_0xb9ca('0x5c'),_0x50a221['name']),_0xb9ca('0x5d'),{'uri':util['format'](_0xb9ca('0x5e'),_0x49edb4['remoteUri']['replace'](_0xb9ca('0x5f'),''),_0x446a3f['id'])});break;default:logger[_0xb9ca('0x60')]('[QUEUE]',_0xb9ca('0x61'));}}})[_0xb9ca('0x62')](function(_0x2a147a){logger[_0xb9ca('0x60')](_0xb9ca('0x63'),util[_0xb9ca('0x64')](_0x2a147a,{'showHidden':!![],'depth':null}));});};exports[_0xb9ca('0x65')]=function(_0x1e2ed7,_0x343d47,_0x305863,_0x232426,_0x41d6cb,_0x42efad,_0x183b72){var _0x1bbd21,_0x343301;_0x42efad[_0xb9ca('0x12')]=intUtil[_0xb9ca('0x50')](_0x42efad['remoteUri']);_0x42efad[_0xb9ca('0x4f')]=intUtil[_0xb9ca('0x50')](_0x42efad['serverUrl']);if(_0x183b72&&_0x183b72[_0xb9ca('0x66')]&&_0x183b72[_0xb9ca('0x66')]!=='none'){logger[_0xb9ca('0x1c')](_0xb9ca('0x67'),_0xb9ca('0x68'));_0x343d47['recordingURL']=util[_0xb9ca('0x10')](_0xb9ca('0x53'),_0x42efad['serverUrl'],_0x343d47[_0xb9ca('0x54')],md5(_0x343d47['uniqueid']));}headers['Authorization']=getAuth(_0x42efad);return getUser(_0x42efad,_0x232426[_0xb9ca('0x69')])[_0xb9ca('0x1b')](function(_0x3f104b){_0x1bbd21=_0x3f104b;logger[_0xb9ca('0x1c')](_0xb9ca('0x6a'),_0x1bbd21['id']);return getEndUser(_0x42efad,_0x343d47[_0xb9ca('0x6b')],_0x343d47[_0xb9ca('0x6c')]);})[_0xb9ca('0x1b')](function(_0x2ad791){_0x343301=_0x2ad791;logger[_0xb9ca('0x1c')]('The\x20Enduser\x20ID\x20is:',_0x343301['id']);return getTicket(_0x42efad,_0x1bbd21,_0x343301,_0x305863,_0x343d47);})['then'](function(_0x4e37b6){if(_0x4e37b6){logger[_0xb9ca('0x1c')](_0xb9ca('0x57'),_0x4e37b6['id']);switch(_0x42efad[_0xb9ca('0x41')]){case'integrationTab':logger['info'](_0xb9ca('0x67'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util['format'](_0xb9ca('0x59'),_0x42efad['remoteUri'],_0x1bbd21['id'],_0x4e37b6['id']),'method':'POST'});case _0xb9ca('0x5a'):logger['info'](_0xb9ca('0x67'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0xb9ca('0x5c'),_0x232426['name']),_0xb9ca('0x5d'),{'uri':util['format'](_0xb9ca('0x5e'),_0x42efad[_0xb9ca('0x12')][_0xb9ca('0x6d')]('/api/v2',''),_0x4e37b6['id'])});break;default:logger['error'](_0xb9ca('0x67'),_0xb9ca('0x61'));}}})[_0xb9ca('0x62')](function(_0x1b2995){logger[_0xb9ca('0x60')]('[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration',util[_0xb9ca('0x64')](_0x1b2995,{'showHidden':!![],'depth':null}));});};exports[_0xb9ca('0x6e')]=function(_0x1abb59,_0x253589,_0x341c95,_0x1416ce,_0x4ac3ad,_0x2e0efb){var _0x489fe3,_0x24dc9f;_0x2e0efb['remoteUri']=intUtil[_0xb9ca('0x50')](_0x2e0efb[_0xb9ca('0x12')]);_0x2e0efb['serverUrl']=intUtil[_0xb9ca('0x50')](_0x2e0efb[_0xb9ca('0x4f')]);if(_0x4ac3ad&&_0x4ac3ad[_0xb9ca('0x6f')]){logger[_0xb9ca('0x1c')]('['+_0x253589[_0xb9ca('0x70')][_0xb9ca('0x71')]()+']',_0xb9ca('0x68'));_0x253589[_0xb9ca('0x52')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2e0efb[_0xb9ca('0x4f')],_0x253589[_0xb9ca('0x54')],md5(_0x253589['uniqueid']));}else{_0x253589[_0xb9ca('0x52')]='';}headers[_0xb9ca('0x72')]=getAuth(_0x2e0efb);return getUser(_0x2e0efb)[_0xb9ca('0x1b')](function(_0x41aa5){_0x489fe3=_0x41aa5;logger[_0xb9ca('0x1c')](_0xb9ca('0x6a'),_0x489fe3['id']);return getEndUser(_0x2e0efb,_0x253589[_0xb9ca('0x73')],_0x253589['calleridnum']);})[_0xb9ca('0x1b')](function(_0x198d2e){_0x24dc9f=_0x198d2e;logger[_0xb9ca('0x1c')](_0xb9ca('0x56'),_0x24dc9f['id']);return getTicket(_0x2e0efb,_0x489fe3,_0x24dc9f,_0x341c95,_0x253589);})[_0xb9ca('0x1b')](function(_0x316bab){if(_0x316bab){logger[_0xb9ca('0x1c')](_0xb9ca('0x57'),_0x316bab['id']);}})[_0xb9ca('0x62')](function(_0x1c14aa){logger[_0xb9ca('0x60')]('['+_0x253589[_0xb9ca('0x70')][_0xb9ca('0x71')]()+']'+_0xb9ca('0x74'),util['inspect'](_0x1c14aa,{'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 3fea12b..824dbcc 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 _0x34b2=['variable','variableName','toString','customVariable','Variable','name','toLowerCase','split','isNil','access_token','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','/oauth/v2/token','clientId','clientSecret','refresh_token','then','add','seconds','catch','error','stack','format','ActiveUsers','Zoho-oauthtoken\x20','users','findIndex','email','info','Agent\x20found!','Using\x20the\x20admin\x20account!','Administrator','user','profile','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','POST','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','code','SUCCESS','details','Error:\x20','log','GET','contact_lead','uri','https://www.zohoapis.','/crm/v2/Contacts/search?criteria=((Phone:equals:','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','contact','Contacts','lead','Owner','administrator','Subject','getString','Description','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','$se_module','talktime','Call_Duration','utc','mm:ss','answertime','endtime','diff','starttime','YYYY-MM-DDTHH:mm:ss','lastevent','called','Call_Result','Called','complete','connect','Answered','rejected','abandoned','Abandoned','Call_Start_Time','outbound','agentcalledAt','Inbound','merge','Call\x20created!','err','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','com','The\x20User\x20ID\x20is:','calleridname','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','toUpperCase','calleridnum','lodash','request-promise','md5','util','./util','moment','ioredis','bluebird','../../../../config/environment','../../../../config/logger','zoho','redis','defaults','debug','[HTTP]','stringify','length','forEach','includes','string','picklist','type','idField','content'];(function(_0x2283dc,_0x2fcfc5){var _0x16db90=function(_0x376c35){while(--_0x376c35){_0x2283dc['push'](_0x2283dc['shift']());}};_0x16db90(++_0x2fcfc5);}(_0x34b2,0x11c));var _0x234b=function(_0x2bf8ac,_0x4226be){_0x2bf8ac=_0x2bf8ac-0x0;var _0x3ef094=_0x34b2[_0x2bf8ac];return _0x3ef094;};'use strict';var _=require(_0x234b('0x0'));var rp=require(_0x234b('0x1'));var md5=require(_0x234b('0x2'));var util=require(_0x234b('0x3'));var intUtil=require(_0x234b('0x4'));var moment=require(_0x234b('0x5'));var Redis=require(_0x234b('0x6'));var BPromise=require(_0x234b('0x7'));var config=require(_0x234b('0x8'));var logger=require(_0x234b('0x9'))(_0x234b('0xa'));config[_0x234b('0xb')]=_[_0x234b('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x234b('0xb')]));function emit(_0x84f1f0,_0x153974,_0x36d33f){io['to'](_0x84f1f0)['emit'](_0x153974,_0x36d33f);}function request(_0x4f4899){logger[_0x234b('0xd')](_0x234b('0xe'),JSON[_0x234b('0xf')](_0x4f4899));return rp(_0x4f4899);}function getCustomFields(_0x30b17b,_0x2446ee){var _0x1bd00f={};if(_0x30b17b[_0x234b('0x10')]>0x0){_[_0x234b('0x11')](_0x30b17b,function(_0x465dd4){if(_[_0x234b('0x12')]([_0x234b('0x13'),_0x234b('0x14')],_0x465dd4[_0x234b('0x15')])&&_0x465dd4['idField']){_0x1bd00f[_0x465dd4[_0x234b('0x16')]]=_0x465dd4[_0x234b('0x17')]['toString']();}else if(_0x465dd4[_0x234b('0x15')]===_0x234b('0x18')&&_0x465dd4['variableName']&&_0x465dd4[_0x234b('0x16')]&&_0x2446ee[_0x465dd4[_0x234b('0x19')]]){_0x1bd00f[_0x465dd4[_0x234b('0x16')]]=_0x2446ee[_0x465dd4[_0x234b('0x19')]][_0x234b('0x1a')]();}else if(_0x465dd4[_0x234b('0x15')]===_0x234b('0x1b')&&_0x465dd4[_0x234b('0x1c')]&&_0x465dd4[_0x234b('0x1c')]['name']&&_0x465dd4[_0x234b('0x16')]&&_0x2446ee[_0x465dd4[_0x234b('0x1c')][_0x234b('0x1d')][_0x234b('0x1e')]()]){_0x1bd00f[_0x465dd4[_0x234b('0x16')]]=_0x2446ee[_0x465dd4[_0x234b('0x1c')][_0x234b('0x1d')][_0x234b('0x1e')]()][_0x234b('0x1a')]();}});}return _0x1bd00f;}function getName(_0x2f2b0f){if(_0x2f2b0f['indexOf']('\x20')>0x0){var _0x2d11cf=_0x2f2b0f[_0x234b('0x1f')](/ (.+)/);if(_0x2d11cf[0x1]){return _0x2d11cf;}}return[_0x2f2b0f,_0x2f2b0f];}var accountsTokens={};function getAccessToken(_0x2a47e1){return new Promise(function(_0x44d8d3,_0x2b7191){if(!_['isNil'](accountsTokens[_0x2a47e1['id']])&&!_[_0x234b('0x20')](accountsTokens[_0x2a47e1['id']][_0x234b('0x21')])){if(moment()['isBefore'](accountsTokens[_0x2a47e1['id']][_0x234b('0x22')])){_0x44d8d3(accountsTokens[_0x2a47e1['id']][_0x234b('0x21')]);}}var _0xb3222;switch(_0x2a47e1[_0x234b('0x23')]){case'US':_0xb3222=_0x234b('0x24');break;case'AU':_0xb3222=_0x234b('0x25');break;case'EU':_0xb3222=_0x234b('0x26');break;case'IN':_0xb3222=_0x234b('0x27');break;case'CN':_0xb3222=_0x234b('0x28');break;default:_0xb3222=_0x234b('0x26');break;}var _0x476fb7={'method':'POST','uri':_0xb3222+_0x234b('0x29'),'qs':{'refresh_token':_0x2a47e1['refreshToken'],'client_id':_0x2a47e1[_0x234b('0x2a')],'client_secret':_0x2a47e1[_0x234b('0x2b')],'grant_type':_0x234b('0x2c')},'json':!![]};return rp(_0x476fb7)[_0x234b('0x2d')](function(_0x493108){accountsTokens[_0x2a47e1['id']]={'access_token':_0x493108[_0x234b('0x21')],'expires_in':moment()[_0x234b('0x2e')](_0x493108['expires_in'],_0x234b('0x2f'))};_0x44d8d3(_0x493108[_0x234b('0x21')]);})[_0x234b('0x30')](function(_0x45c6b3){logger[_0x234b('0x31')]('Failing\x20creating\x20the\x20access_token',_0x45c6b3[_0x234b('0x32')]);_0x2b7191(_0x45c6b3);});});}function getUser(_0x5d211b,_0x439577,_0x3b698f,_0x2cca1a){logger['info']('Search\x20user');return request({'method':'GET','uri':util[_0x234b('0x33')]('https://www.zohoapis.%s/crm/v2/users',_0x439577),'qs':{'type':_0x234b('0x34')},'headers':{'Authorization':_0x234b('0x35')+_0x5d211b},'json':!![]})[_0x234b('0x2d')](function(_0x2f00bf){if(_0x2f00bf['users']){var _0x51c089=-0x1;if(_['isArrayLikeObject'](_0x2f00bf[_0x234b('0x36')])){if(!_[_0x234b('0x20')](_0x2cca1a)){_0x51c089=_[_0x234b('0x37')](_0x2f00bf['users'],function(_0x21a2c6){return _0x21a2c6[_0x234b('0x38')]===_0x2cca1a;});}if(_0x51c089>=0x0){logger[_0x234b('0x39')](_0x234b('0x3a'));}else{logger[_0x234b('0x39')](_0x234b('0x3b'));_0x51c089=_[_0x234b('0x37')](_0x2f00bf[_0x234b('0x36')],function(_0x232195){return _0x232195['profile'][_0x234b('0x1d')]===_0x234b('0x3c');});}return _0x2f00bf['users'][_0x51c089];}else{if(_0x2f00bf[_0x234b('0x3d')][_0x234b('0x3e')]['name']===_0x234b('0x3c')){logger[_0x234b('0x39')]('Using\x20the\x20admin\x20account!');user=_0x2f00bf[_0x234b('0x3d')];return user;}else{logger[_0x234b('0x31')](_0x234b('0x3f'),JSON['stringify'](_0x2f00bf));throw new Error(_0x234b('0x40')+JSON[_0x234b('0xf')](_0x2f00bf));}}}else{logger['error'](_0x234b('0x3f'),JSON['stringify'](_0x2f00bf));throw new Error(_0x234b('0x40')+JSON['stringify'](_0x2f00bf));}})['catch'](function(_0x5063b6){console[_0x234b('0x31')](_0x5063b6);});}function getZohoUser(_0x41289d,_0x38e685){return new BPromise(function(_0x37c1f4,_0x7d9398){request(_0x41289d)[_0x234b('0x2d')](function(_0x201bb4){var _0x167950=null;if(_0x201bb4){_0x167950=_0x201bb4[_0x234b('0x41')][0x0];_0x167950[_0x234b('0x42')]=_0x38e685;}_0x37c1f4(_0x167950);})['catch'](function(_0xd48e4e){_0x7d9398(_0xd48e4e);});});}function createEndUser(_0x6aeb71,_0x1243d5,_0x515246,_0x45200a,_0x4d31fe,_0x5e11a3){var _0x515246=getName(_0x515246);return request({'method':_0x234b('0x43'),'uri':'https://www.zohoapis.'+_0x1243d5+_0x234b('0x44')+_[_0x234b('0x45')](_0x5e11a3[_0x234b('0x46')])+'s','body':{'data':[{'Last_Name':_0x515246[0x1],'First_Name':_0x515246[0x0],'Phone':_0x45200a,'Owner':{'name':!_[_0x234b('0x20')](_0x4d31fe[_0x234b('0x47')][_0x234b('0x1d')])?_0x4d31fe[_0x234b('0x47')][_0x234b('0x1d')]:!_['isNil'](_0x4d31fe[_0x234b('0x48')])?_0x4d31fe[_0x234b('0x48')]+'\x20'+_0x4d31fe[_0x234b('0x49')]:_0x4d31fe[_0x234b('0x49')],'id':_0x4d31fe['id']}}]},'headers':{'Authorization':_0x234b('0x35')+_0x6aeb71},'json':!![]})[_0x234b('0x2d')](function(_0x4817ca){if(_0x4817ca&&_0x4817ca[_0x234b('0x41')][0x0][_0x234b('0x4a')]===_0x234b('0x4b')){var _0xb5d9e3=_0x4817ca[_0x234b('0x41')][0x0][_0x234b('0x4c')];_0xb5d9e3['enduserType']=_[_0x234b('0x45')](_0x5e11a3['moduleCreate'])+'s';return _0xb5d9e3;}logger['error'](_0x234b('0x3f'),JSON[_0x234b('0xf')](data));throw new Error(_0x234b('0x4d')+JSON[_0x234b('0xf')](data));})['catch'](function(_0x47c712){console[_0x234b('0x4e')]('CREATE\x20ERROR',_0x47c712);});}function getEndUser(_0x30ef44,_0x1f6a9b,_0x314011,_0x5816cc,_0x61d331,_0x5ef306,_0x9fdb90){var _0x3d803d={'method':_0x234b('0x4f'),'uri':'','headers':{'Authorization':_0x234b('0x35')+_0x30ef44},'json':!![]};switch(_0x9fdb90['moduleSearch']){case _0x234b('0x50'):_0x3d803d[_0x234b('0x51')]=_0x234b('0x52')+_0x1f6a9b+_0x234b('0x53')+_0x61d331+'))';return getZohoUser(_0x3d803d,'Contacts')['then'](function(_0x5e86cd){if(_0x5e86cd)return _0x5e86cd;_0x3d803d['uri']=_0x234b('0x52')+_0x1f6a9b+_0x234b('0x54')+_0x61d331+'))';return getZohoUser(_0x3d803d,_0x234b('0x55'))['then'](function(_0x538738){if(_0x538738)return _0x538738;if(_0x9fdb90[_0x234b('0x46')]!=_0x234b('0x56')){return createEndUser(_0x30ef44,_0x1f6a9b,_0x5816cc,_0x61d331,_0x5ef306,_0x9fdb90);}else{return{};}});});break;case _0x234b('0x57'):_0x3d803d[_0x234b('0x51')]=_0x234b('0x52')+_0x1f6a9b+_0x234b('0x53')+_0x61d331+'))';return getZohoUser(_0x3d803d,_0x234b('0x58'))[_0x234b('0x2d')](function(_0x4d3cb3){if(_0x4d3cb3)return _0x4d3cb3;if(_0x9fdb90[_0x234b('0x46')]!='nothing'){return createEndUser(_0x30ef44,_0x1f6a9b,_0x5816cc,_0x61d331,_0x5ef306,_0x9fdb90);}else{return{};}});break;case _0x234b('0x59'):_0x3d803d[_0x234b('0x51')]='https://www.zohoapis.'+_0x1f6a9b+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x61d331+'))';return getZohoUser(_0x3d803d,_0x234b('0x55'))[_0x234b('0x2d')](function(_0x47d267){if(_0x47d267)return _0x47d267;if(_0x9fdb90[_0x234b('0x46')]!='nothing'){return createEndUser(_0x30ef44,_0x1f6a9b,_0x5816cc,_0x61d331,_0x5ef306,_0x9fdb90);}else{return{};}});break;}}function getCall(_0xe056e6,_0x39e15c,_0x31d969,_0x57b591,_0x54dd00,_0x18732c,_0x2fdae6,_0x54449b){logger[_0x234b('0x39')]('Creating\x20new\x20call...');var _0x5423a5={};_0x5423a5[_0x234b('0x5a')]={'name':!_[_0x234b('0x20')](_0x57b591[_0x234b('0x47')][_0x234b('0x1d')])&&!_['isNil'](_0x57b591[_0x234b('0x3e')]['name'])&&_0x57b591['profile'][_0x234b('0x1d')]===_0x234b('0x5b')?_0x57b591[_0x234b('0x47')][_0x234b('0x1d')]:!_[_0x234b('0x20')](_0x57b591[_0x234b('0x48')])?_0x57b591['first_name']+'\x20'+_0x57b591[_0x234b('0x49')]:_0x57b591[_0x234b('0x49')],'id':_0x57b591['id']};_0x5423a5[_0x234b('0x5c')]=intUtil[_0x234b('0x5d')](_0x18732c['Subjects'],_0x2fdae6,'\x20');_0x5423a5[_0x234b('0x5e')]=intUtil[_0x234b('0x5d')](_0x18732c[_0x234b('0x5f')],_0x2fdae6,'\x0a');if(_0x54dd00['enduserType']===_0x234b('0x58')){_0x5423a5[_0x234b('0x60')]={'name':!_[_0x234b('0x20')](_0x54dd00[_0x234b('0x61')])?_0x54dd00[_0x234b('0x61')]:!_[_0x234b('0x20')](_0x54dd00['First_Name'])?_0x54dd00[_0x234b('0x62')]+'\x20'+_0x54dd00[_0x234b('0x63')]:_0x54dd00[_0x234b('0x63')],'id':_0x54dd00['id']};}if(_0x54dd00[_0x234b('0x42')]==='Leads'){_0x5423a5['What_Id']={'name':!_[_0x234b('0x20')](_0x54dd00[_0x234b('0x61')])?_0x54dd00[_0x234b('0x61')]:!_[_0x234b('0x20')](_0x54dd00['First_Name'])?_0x54dd00['First_Name']+'\x20'+_0x54dd00[_0x234b('0x63')]:_0x54dd00['Last_Name'],'id':_0x54dd00['id']};_0x5423a5[_0x234b('0x64')]=_['startCase'](_0x54dd00[_0x234b('0x42')]);}if(_0x2fdae6[_0x234b('0x65')]){_0x5423a5[_0x234b('0x66')]=moment[_0x234b('0x67')](parseInt(_0x2fdae6[_0x234b('0x65')])*0x3e8)[_0x234b('0x33')](_0x234b('0x68'));}else if(_0x2fdae6[_0x234b('0x69')]&&_0x2fdae6[_0x234b('0x6a')]){_0x5423a5['Call_Duration']=moment[_0x234b('0x67')](moment(_0x2fdae6[_0x234b('0x6a')],'YYYY-MM-DDTHH:mm:ss')[_0x234b('0x6b')](moment(_0x2fdae6[_0x234b('0x6c')],_0x234b('0x6d'))))[_0x234b('0x33')](_0x234b('0x68'));}switch(_0x2fdae6[_0x234b('0x6e')]){case _0x234b('0x6f'):_0x5423a5[_0x234b('0x70')]=_0x234b('0x71');break;case _0x234b('0x72'):case _0x234b('0x73'):_0x5423a5[_0x234b('0x70')]=_0x234b('0x74');break;case _0x234b('0x75'):_0x5423a5[_0x234b('0x70')]='Rejected';break;case _0x234b('0x76'):_0x5423a5[_0x234b('0x70')]=_0x234b('0x77');break;case'timeout':_0x5423a5[_0x234b('0x70')]='Timeout';default:}_0x5423a5[_0x234b('0x78')]=(_0x54449b===_0x234b('0x79')?moment(_0x2fdae6[_0x234b('0x6c')])[_0x234b('0x33')](_0x234b('0x6d')):moment(_0x2fdae6[_0x234b('0x7a')])[_0x234b('0x33')]('YYYY-MM-DDTHH:mm:ss'))||moment()['format'](_0x234b('0x6d'));_0x5423a5['Call_Type']=_0x54449b||_0x234b('0x7b');_0x5423a5=_[_0x234b('0x7c')](_0x5423a5,getCustomFields(_0x18732c['Fields'],_0x2fdae6));return request({'method':_0x234b('0x43'),'uri':'https://www.zohoapis.'+_0x39e15c+'/crm/v2/Calls','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0xe056e6},'body':{'data':[_0x5423a5]},'json':!![]})[_0x234b('0x2d')](function(_0x1ff450){if(_0x1ff450&&_0x1ff450['data'][0x0]['code']==='SUCCESS'){logger[_0x234b('0x39')](_0x234b('0x7d'));return{'id':_0x1ff450[_0x234b('0x41')][0x0][_0x234b('0x4c')]['id']};}})['catch'](function(_0x2eb15f){logger[_0x234b('0x39')](_0x234b('0x7e'),_0x2eb15f[_0x234b('0x32')]);console['log'](_0x234b('0x7e'),_0x2eb15f);});}exports['queue']=function(_0xe39173,_0x180986,_0x1f7c8c,_0x16231d,_0x3f4f2a,_0x52252b){var _0x54fd7b,_0x22c2d4,_0x14a6e9;_0x52252b[_0x234b('0x7f')]=intUtil[_0x234b('0x80')](_0x52252b[_0x234b('0x7f')]);_0x52252b[_0x234b('0x81')]=intUtil[_0x234b('0x80')](_0x52252b[_0x234b('0x81')]);if(_0x3f4f2a&&_0x3f4f2a[_0x234b('0x82')]){logger[_0x234b('0x39')](_0x234b('0x83'),_0x234b('0x84'));_0x180986[_0x234b('0x85')]=_0x52252b[_0x234b('0x81')]+_0x234b('0x86')+_0x180986[_0x234b('0x87')]+_0x234b('0x88')+md5(_0x180986[_0x234b('0x87')]);}else{_0x180986[_0x234b('0x85')]='';}var _0x5cd132=_0x52252b[_0x234b('0x7f')]===_0x234b('0x89')?'eu':_0x234b('0x8a');return getAccessToken(_0x52252b)[_0x234b('0x2d')](function(_0x5580f7){_0x14a6e9=_0x5580f7;return getUser(_0x14a6e9,_0x5cd132,_0x52252b,_0x16231d[_0x234b('0x38')]);})[_0x234b('0x2d')](function(_0x21ae7d){_0x54fd7b=_0x21ae7d;logger[_0x234b('0x39')](_0x234b('0x8b'),_0x54fd7b['id']);return getEndUser(_0x14a6e9,_0x5cd132,_0x52252b,_0x180986[_0x234b('0x8c')],_0x180986['calleridnum'],_0x54fd7b,_0x1f7c8c);})['then'](function(_0x19ad09){_0x22c2d4=_0x19ad09;return getCall(_0x14a6e9,_0x5cd132,_0x52252b,_0x54fd7b,_0x22c2d4,_0x1f7c8c,_0x180986,_0x234b('0x7b'));})[_0x234b('0x2d')](function(_0x5f0549){if(_0x5f0549){logger[_0x234b('0x39')](_0x234b('0x8d'),_0x5f0549['id']);logger[_0x234b('0x39')](_0x234b('0x83'),_0x234b('0x8e'));emit(util['format'](_0x234b('0x8f'),_0x16231d[_0x234b('0x1d')]),_0x234b('0x90'),{'uri':_0x234b('0x91')+_0x52252b[_0x234b('0x7f')]+_0x234b('0x92')+_0x5f0549['id']});}})[_0x234b('0x30')](function(_0x525139){logger[_0x234b('0x31')]('[QUEUE]',JSON[_0x234b('0xf')](_0x525139));});};exports[_0x234b('0x79')]=function(_0x3598d8,_0x23436c,_0x453a31,_0x15484f,_0x2006a1,_0x50fe54,_0x495212){var _0x4dd6bb,_0x235ef0,_0x16539c;_0x50fe54[_0x234b('0x7f')]=intUtil['stripTrailingSlash'](_0x50fe54[_0x234b('0x7f')]);_0x50fe54['serverUrl']=intUtil['stripTrailingSlash'](_0x50fe54[_0x234b('0x81')]);if(_0x495212&&_0x495212[_0x234b('0x93')]&&_0x495212[_0x234b('0x93')]!==_0x234b('0x94')){logger['info'](_0x234b('0x95'),_0x234b('0x84'));_0x23436c[_0x234b('0x85')]=_0x50fe54[_0x234b('0x81')]+_0x234b('0x86')+_0x23436c['uniqueid']+'/downloads?type=uniqueid&token='+md5(_0x23436c['uniqueid']);}var _0x6a52c2=_0x50fe54[_0x234b('0x7f')]===_0x234b('0x89')?'eu':_0x234b('0x8a');return getAccessToken(_0x50fe54)[_0x234b('0x2d')](function(_0x395d11){_0x16539c=_0x395d11;return getUser(_0x16539c,_0x6a52c2,_0x50fe54,_0x15484f[_0x234b('0x38')]);})['then'](function(_0x1af1ee){_0x4dd6bb=_0x1af1ee;logger[_0x234b('0x39')](_0x234b('0x8b'),_0x4dd6bb['id']);return getEndUser(_0x16539c,_0x6a52c2,_0x50fe54,_0x23436c[_0x234b('0x96')],_0x23436c[_0x234b('0x97')],_0x4dd6bb,_0x453a31);})[_0x234b('0x2d')](function(_0xa5953a){_0x235ef0=_0xa5953a;return getCall(_0x16539c,_0x6a52c2,_0x50fe54,_0x4dd6bb,_0x235ef0,_0x453a31,_0x23436c,'Outbound');})[_0x234b('0x2d')](function(_0x679eb1){if(_0x679eb1){logger[_0x234b('0x39')](_0x234b('0x8d'),_0x679eb1['id']);logger[_0x234b('0x39')](_0x234b('0x95'),_0x234b('0x8e'));emit(util[_0x234b('0x33')](_0x234b('0x8f'),_0x15484f[_0x234b('0x1d')]),_0x234b('0x90'),{'uri':_0x234b('0x91')+_0x50fe54[_0x234b('0x7f')]+_0x234b('0x92')+_0x679eb1['id']});}})[_0x234b('0x30')](function(_0x39fb1b){logger['error'](_0x234b('0x95'),JSON['stringify'](_0x39fb1b));});};exports['unmanaged']=function(_0x3515b8,_0x5a960a,_0x879977,_0x1c676a,_0x239f03,_0x189e60){var _0x186dc2,_0x2b9b9b,_0x1915e1;_0x189e60[_0x234b('0x7f')]=intUtil[_0x234b('0x80')](_0x189e60['host']);_0x189e60[_0x234b('0x81')]=intUtil[_0x234b('0x80')](_0x189e60['serverUrl']);if(_0x239f03&&_0x239f03[_0x234b('0x82')]){logger[_0x234b('0x39')]('['+_0x5a960a['lastevent'][_0x234b('0x98')]()+']',_0x234b('0x84'));_0x5a960a[_0x234b('0x85')]=_0x189e60[_0x234b('0x81')]+'/api/voice/recordings/'+_0x5a960a[_0x234b('0x87')]+_0x234b('0x88')+md5(_0x5a960a[_0x234b('0x87')]);}else{_0x5a960a['recordingURL']='';}var _0x969363=_0x189e60[_0x234b('0x7f')]===_0x234b('0x89')?'eu':_0x234b('0x8a');return getAccessToken(_0x189e60)[_0x234b('0x2d')](function(_0x320fd0){_0x1915e1=_0x320fd0;return getUser(_0x1915e1,_0x969363,_0x189e60);})['then'](function(_0x59b100){_0x186dc2=_0x59b100;logger[_0x234b('0x39')](_0x234b('0x8b'),_0x186dc2['id']);return getEndUser(_0x1915e1,_0x969363,_0x189e60,_0x5a960a['calleridname'],_0x5a960a[_0x234b('0x99')],_0x186dc2,_0x879977);})['then'](function(_0x5a5b05){_0x2b9b9b=_0x5a5b05;return getCall(_0x1915e1,_0x969363,_0x189e60,_0x186dc2,_0x2b9b9b,_0x879977,_0x5a960a,_0x234b('0x7b'));})[_0x234b('0x2d')](function(_0x13e8ff){if(_0x13e8ff){logger[_0x234b('0x39')](_0x234b('0x8d'),_0x13e8ff['id']);}})[_0x234b('0x30')](function(_0x3c26e0){logger[_0x234b('0x31')]('['+_0x5a960a[_0x234b('0x6e')][_0x234b('0x98')]()+']',JSON[_0x234b('0xf')](_0x3c26e0));});}; \ No newline at end of file +var _0xebff=['Search\x20user','GET','format','ActiveUsers','Zoho-oauthtoken\x20','users','isArrayLikeObject','findIndex','email','info','Using\x20the\x20admin\x20account!','profile','Administrator','user','error','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','catch','enduserType','POST','https://www.zohoapis.','moduleCreate','role','first_name','last_name','data','code','SUCCESS','details','startCase','log','CREATE\x20ERROR','contact_lead','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','uri','nothing','contact','lead','Leads','Creating\x20new\x20call...','Owner','administrator','Subject','getString','Description','First_Name','What_Id','Full_Name','Last_Name','$se_module','utc','talktime','mm:ss','Call_Duration','endtime','YYYY-MM-DDTHH:mm:ss','starttime','complete','connect','Answered','rejected','abandoned','Call_Result','timeout','Call_Start_Time','outbound','agentcalledAt','Call_Type','Inbound','merge','Fields','/crm/v2/Calls','err','queue','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','/api/voice/recordings/','zoho.eu','com','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://crm.','recordingFormat','recordingURL','uniqueid','/downloads?type=uniqueid&token=','destcalleridname','destcalleridnum','Outbound','[OUTBOUND]','user:%s','/crm/EntityInfo.do?module=Calls&id=','unmanaged','lastevent','toUpperCase','lodash','md5','./util','moment','ioredis','bluebird','../../../../config/logger','zoho','localhost','redis','debug','[HTTP]','stringify','forEach','includes','string','picklist','idField','toString','type','variable','variableName','customVariable','Variable','name','indexOf','isNil','access_token','isBefore','expires_in','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.com.cn','/oauth/v2/token','refreshToken','clientId','clientSecret','then','seconds'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0xebff,0xf8));var _0xfebf=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0xebff[_0x40220a];return _0x3903cc;};'use strict';var _=require(_0xfebf('0x0'));var rp=require('request-promise');var md5=require(_0xfebf('0x1'));var util=require('util');var intUtil=require(_0xfebf('0x2'));var moment=require(_0xfebf('0x3'));var Redis=require(_0xfebf('0x4'));var BPromise=require(_0xfebf('0x5'));var config=require('../../../../config/environment');var logger=require(_0xfebf('0x6'))(_0xfebf('0x7'));config['redis']=_['defaults'](config['redis'],{'host':_0xfebf('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xfebf('0x9')]));function emit(_0x86e9c,_0x5da9e1,_0x5a011c){io['to'](_0x86e9c)['emit'](_0x5da9e1,_0x5a011c);}function request(_0x2d9a6c){logger[_0xfebf('0xa')](_0xfebf('0xb'),JSON[_0xfebf('0xc')](_0x2d9a6c));return rp(_0x2d9a6c);}function getCustomFields(_0x39eb48,_0x1b2ccb){var _0x2b0176={};if(_0x39eb48['length']>0x0){_[_0xfebf('0xd')](_0x39eb48,function(_0x43d5e3){if(_[_0xfebf('0xe')]([_0xfebf('0xf'),_0xfebf('0x10')],_0x43d5e3['type'])&&_0x43d5e3[_0xfebf('0x11')]){_0x2b0176[_0x43d5e3['idField']]=_0x43d5e3['content'][_0xfebf('0x12')]();}else if(_0x43d5e3[_0xfebf('0x13')]===_0xfebf('0x14')&&_0x43d5e3['variableName']&&_0x43d5e3[_0xfebf('0x11')]&&_0x1b2ccb[_0x43d5e3[_0xfebf('0x15')]]){_0x2b0176[_0x43d5e3[_0xfebf('0x11')]]=_0x1b2ccb[_0x43d5e3['variableName']][_0xfebf('0x12')]();}else if(_0x43d5e3[_0xfebf('0x13')]===_0xfebf('0x16')&&_0x43d5e3['Variable']&&_0x43d5e3[_0xfebf('0x17')][_0xfebf('0x18')]&&_0x43d5e3['idField']&&_0x1b2ccb[_0x43d5e3[_0xfebf('0x17')][_0xfebf('0x18')]['toLowerCase']()]){_0x2b0176[_0x43d5e3[_0xfebf('0x11')]]=_0x1b2ccb[_0x43d5e3[_0xfebf('0x17')][_0xfebf('0x18')]['toLowerCase']()][_0xfebf('0x12')]();}});}return _0x2b0176;}function getName(_0xfe4c49){if(_0xfe4c49[_0xfebf('0x19')]('\x20')>0x0){var _0x2a430b=_0xfe4c49['split'](/ (.+)/);if(_0x2a430b[0x1]){return _0x2a430b;}}return[_0xfe4c49,_0xfe4c49];}var accountsTokens={};function getAccessToken(_0x20adc6){return new Promise(function(_0x4105d5,_0x583814){if(!_[_0xfebf('0x1a')](accountsTokens[_0x20adc6['id']])&&!_['isNil'](accountsTokens[_0x20adc6['id']][_0xfebf('0x1b')])){if(moment()[_0xfebf('0x1c')](accountsTokens[_0x20adc6['id']][_0xfebf('0x1d')])){_0x4105d5(accountsTokens[_0x20adc6['id']][_0xfebf('0x1b')]);}}var _0x1429b1;switch(_0x20adc6['zone']){case'US':_0x1429b1=_0xfebf('0x1e');break;case'AU':_0x1429b1=_0xfebf('0x1f');break;case'EU':_0x1429b1=_0xfebf('0x20');break;case'IN':_0x1429b1='https://accounts.zoho.in';break;case'CN':_0x1429b1=_0xfebf('0x21');break;default:_0x1429b1=_0xfebf('0x20');break;}var _0x43fcc6={'method':'POST','uri':_0x1429b1+_0xfebf('0x22'),'qs':{'refresh_token':_0x20adc6[_0xfebf('0x23')],'client_id':_0x20adc6[_0xfebf('0x24')],'client_secret':_0x20adc6[_0xfebf('0x25')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x43fcc6)[_0xfebf('0x26')](function(_0x29ef2f){accountsTokens[_0x20adc6['id']]={'access_token':_0x29ef2f[_0xfebf('0x1b')],'expires_in':moment()['add'](_0x29ef2f[_0xfebf('0x1d')],_0xfebf('0x27'))};_0x4105d5(_0x29ef2f[_0xfebf('0x1b')]);})['catch'](function(_0x11ce09){logger['error']('Failing\x20creating\x20the\x20access_token',_0x11ce09['stack']);_0x583814(_0x11ce09);});});}function getUser(_0x4089f9,_0x597332,_0x5e46de,_0x5d57df){logger['info'](_0xfebf('0x28'));return request({'method':_0xfebf('0x29'),'uri':util[_0xfebf('0x2a')]('https://www.zohoapis.%s/crm/v2/users',_0x597332),'qs':{'type':_0xfebf('0x2b')},'headers':{'Authorization':_0xfebf('0x2c')+_0x4089f9},'json':!![]})[_0xfebf('0x26')](function(_0x156bc1){if(_0x156bc1[_0xfebf('0x2d')]){var _0x395cf4=-0x1;if(_[_0xfebf('0x2e')](_0x156bc1[_0xfebf('0x2d')])){if(!_['isNil'](_0x5d57df)){_0x395cf4=_[_0xfebf('0x2f')](_0x156bc1[_0xfebf('0x2d')],function(_0x9a205a){return _0x9a205a[_0xfebf('0x30')]===_0x5d57df;});}if(_0x395cf4>=0x0){logger[_0xfebf('0x31')]('Agent\x20found!');}else{logger[_0xfebf('0x31')](_0xfebf('0x32'));_0x395cf4=_['findIndex'](_0x156bc1[_0xfebf('0x2d')],function(_0x782491){return _0x782491[_0xfebf('0x33')][_0xfebf('0x18')]===_0xfebf('0x34');});}return _0x156bc1[_0xfebf('0x2d')][_0x395cf4];}else{if(_0x156bc1[_0xfebf('0x35')][_0xfebf('0x33')][_0xfebf('0x18')]==='Administrator'){logger[_0xfebf('0x31')](_0xfebf('0x32'));user=_0x156bc1[_0xfebf('0x35')];return user;}else{logger[_0xfebf('0x36')](_0xfebf('0x37'),JSON[_0xfebf('0xc')](_0x156bc1));throw new Error(_0xfebf('0x38')+JSON[_0xfebf('0xc')](_0x156bc1));}}}else{logger[_0xfebf('0x36')](_0xfebf('0x37'),JSON[_0xfebf('0xc')](_0x156bc1));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0xfebf('0xc')](_0x156bc1));}})[_0xfebf('0x39')](function(_0x122f9d){console[_0xfebf('0x36')](_0x122f9d);});}function getZohoUser(_0x2906b7,_0x36c24a){return new BPromise(function(_0x4adc4c,_0x27bf4){request(_0x2906b7)[_0xfebf('0x26')](function(_0x45de53){var _0x4aa9a4=null;if(_0x45de53){_0x4aa9a4=_0x45de53['data'][0x0];_0x4aa9a4[_0xfebf('0x3a')]=_0x36c24a;}_0x4adc4c(_0x4aa9a4);})[_0xfebf('0x39')](function(_0x14b2cf){_0x27bf4(_0x14b2cf);});});}function createEndUser(_0xba1069,_0x74739c,_0x161ee6,_0x494143,_0x5ea4c1,_0x52b86b){var _0x161ee6=getName(_0x161ee6);return request({'method':_0xfebf('0x3b'),'uri':_0xfebf('0x3c')+_0x74739c+'/crm/v2/'+_['startCase'](_0x52b86b[_0xfebf('0x3d')])+'s','body':{'data':[{'Last_Name':_0x161ee6[0x1],'First_Name':_0x161ee6[0x0],'Phone':_0x494143,'Owner':{'name':!_[_0xfebf('0x1a')](_0x5ea4c1['role'][_0xfebf('0x18')])?_0x5ea4c1[_0xfebf('0x3e')][_0xfebf('0x18')]:!_[_0xfebf('0x1a')](_0x5ea4c1['first_name'])?_0x5ea4c1[_0xfebf('0x3f')]+'\x20'+_0x5ea4c1[_0xfebf('0x40')]:_0x5ea4c1[_0xfebf('0x40')],'id':_0x5ea4c1['id']}}]},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0xba1069},'json':!![]})[_0xfebf('0x26')](function(_0x421ef4){if(_0x421ef4&&_0x421ef4[_0xfebf('0x41')][0x0][_0xfebf('0x42')]===_0xfebf('0x43')){var _0x15ddef=_0x421ef4['data'][0x0][_0xfebf('0x44')];_0x15ddef[_0xfebf('0x3a')]=_[_0xfebf('0x45')](_0x52b86b[_0xfebf('0x3d')])+'s';return _0x15ddef;}logger[_0xfebf('0x36')](_0xfebf('0x37'),JSON[_0xfebf('0xc')](data));throw new Error('Error:\x20'+JSON['stringify'](data));})['catch'](function(_0x3be436){console[_0xfebf('0x46')](_0xfebf('0x47'),_0x3be436);});}function getEndUser(_0x385f42,_0x5dc523,_0x185579,_0x224ba5,_0x7886b3,_0xc72ea5,_0x20c155){var _0x7e47c9={'method':_0xfebf('0x29'),'uri':'','headers':{'Authorization':_0xfebf('0x2c')+_0x385f42},'json':!![]};switch(_0x20c155['moduleSearch']){case _0xfebf('0x48'):_0x7e47c9['uri']=_0xfebf('0x3c')+_0x5dc523+_0xfebf('0x49')+_0x7886b3+'))';return getZohoUser(_0x7e47c9,_0xfebf('0x4a'))[_0xfebf('0x26')](function(_0x33a64c){if(_0x33a64c)return _0x33a64c;_0x7e47c9[_0xfebf('0x4b')]='https://www.zohoapis.'+_0x5dc523+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x7886b3+'))';return getZohoUser(_0x7e47c9,'Leads')['then'](function(_0x11e77b){if(_0x11e77b)return _0x11e77b;if(_0x20c155['moduleCreate']!=_0xfebf('0x4c')){return createEndUser(_0x385f42,_0x5dc523,_0x224ba5,_0x7886b3,_0xc72ea5,_0x20c155);}else{return{};}});});break;case _0xfebf('0x4d'):_0x7e47c9[_0xfebf('0x4b')]='https://www.zohoapis.'+_0x5dc523+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x7886b3+'))';return getZohoUser(_0x7e47c9,_0xfebf('0x4a'))['then'](function(_0xd47d4){if(_0xd47d4)return _0xd47d4;if(_0x20c155['moduleCreate']!=_0xfebf('0x4c')){return createEndUser(_0x385f42,_0x5dc523,_0x224ba5,_0x7886b3,_0xc72ea5,_0x20c155);}else{return{};}});break;case _0xfebf('0x4e'):_0x7e47c9[_0xfebf('0x4b')]='https://www.zohoapis.'+_0x5dc523+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x7886b3+'))';return getZohoUser(_0x7e47c9,_0xfebf('0x4f'))[_0xfebf('0x26')](function(_0x3ed3e0){if(_0x3ed3e0)return _0x3ed3e0;if(_0x20c155[_0xfebf('0x3d')]!=_0xfebf('0x4c')){return createEndUser(_0x385f42,_0x5dc523,_0x224ba5,_0x7886b3,_0xc72ea5,_0x20c155);}else{return{};}});break;}}function getCall(_0xe46619,_0x241fca,_0x2b95c6,_0x30cec1,_0x47a479,_0x236224,_0x276025,_0x2dc481){logger[_0xfebf('0x31')](_0xfebf('0x50'));var _0x4797de={};_0x4797de[_0xfebf('0x51')]={'name':!_[_0xfebf('0x1a')](_0x30cec1[_0xfebf('0x3e')]['name'])&&!_[_0xfebf('0x1a')](_0x30cec1[_0xfebf('0x33')][_0xfebf('0x18')])&&_0x30cec1[_0xfebf('0x33')][_0xfebf('0x18')]===_0xfebf('0x52')?_0x30cec1['role'][_0xfebf('0x18')]:!_[_0xfebf('0x1a')](_0x30cec1[_0xfebf('0x3f')])?_0x30cec1['first_name']+'\x20'+_0x30cec1['last_name']:_0x30cec1[_0xfebf('0x40')],'id':_0x30cec1['id']};_0x4797de[_0xfebf('0x53')]=intUtil[_0xfebf('0x54')](_0x236224['Subjects'],_0x276025,'\x20');_0x4797de[_0xfebf('0x55')]=intUtil[_0xfebf('0x54')](_0x236224['Descriptions'],_0x276025,'\x0a');if(_0x47a479[_0xfebf('0x3a')]===_0xfebf('0x4a')){_0x4797de['Who_Id']={'name':!_['isNil'](_0x47a479['Full_Name'])?_0x47a479['Full_Name']:!_[_0xfebf('0x1a')](_0x47a479[_0xfebf('0x56')])?_0x47a479['First_Name']+'\x20'+_0x47a479['Last_Name']:_0x47a479['Last_Name'],'id':_0x47a479['id']};}if(_0x47a479[_0xfebf('0x3a')]==='Leads'){_0x4797de[_0xfebf('0x57')]={'name':!_[_0xfebf('0x1a')](_0x47a479[_0xfebf('0x58')])?_0x47a479[_0xfebf('0x58')]:!_[_0xfebf('0x1a')](_0x47a479[_0xfebf('0x56')])?_0x47a479['First_Name']+'\x20'+_0x47a479[_0xfebf('0x59')]:_0x47a479[_0xfebf('0x59')],'id':_0x47a479['id']};_0x4797de[_0xfebf('0x5a')]=_['startCase'](_0x47a479['enduserType']);}if(_0x276025['talktime']){_0x4797de['Call_Duration']=moment[_0xfebf('0x5b')](parseInt(_0x276025[_0xfebf('0x5c')])*0x3e8)[_0xfebf('0x2a')](_0xfebf('0x5d'));}else if(_0x276025['answertime']&&_0x276025['endtime']){_0x4797de[_0xfebf('0x5e')]=moment[_0xfebf('0x5b')](moment(_0x276025[_0xfebf('0x5f')],_0xfebf('0x60'))['diff'](moment(_0x276025[_0xfebf('0x61')],_0xfebf('0x60'))))[_0xfebf('0x2a')](_0xfebf('0x5d'));}switch(_0x276025['lastevent']){case'called':_0x4797de['Call_Result']='Called';break;case _0xfebf('0x62'):case _0xfebf('0x63'):_0x4797de['Call_Result']=_0xfebf('0x64');break;case _0xfebf('0x65'):_0x4797de['Call_Result']='Rejected';break;case _0xfebf('0x66'):_0x4797de[_0xfebf('0x67')]='Abandoned';break;case _0xfebf('0x68'):_0x4797de['Call_Result']='Timeout';default:}_0x4797de[_0xfebf('0x69')]=(_0x2dc481===_0xfebf('0x6a')?moment(_0x276025[_0xfebf('0x61')])[_0xfebf('0x2a')](_0xfebf('0x60')):moment(_0x276025[_0xfebf('0x6b')])[_0xfebf('0x2a')](_0xfebf('0x60')))||moment()[_0xfebf('0x2a')]('YYYY-MM-DDTHH:mm:ss');_0x4797de[_0xfebf('0x6c')]=_0x2dc481||_0xfebf('0x6d');_0x4797de=_[_0xfebf('0x6e')](_0x4797de,getCustomFields(_0x236224[_0xfebf('0x6f')],_0x276025));return request({'method':_0xfebf('0x3b'),'uri':_0xfebf('0x3c')+_0x241fca+_0xfebf('0x70'),'headers':{'Authorization':_0xfebf('0x2c')+_0xe46619},'body':{'data':[_0x4797de]},'json':!![]})['then'](function(_0x4812b7){if(_0x4812b7&&_0x4812b7[_0xfebf('0x41')][0x0][_0xfebf('0x42')]===_0xfebf('0x43')){logger[_0xfebf('0x31')]('Call\x20created!');return{'id':_0x4812b7['data'][0x0][_0xfebf('0x44')]['id']};}})[_0xfebf('0x39')](function(_0x3ea99a){logger[_0xfebf('0x31')](_0xfebf('0x71'),_0x3ea99a['stack']);console['log']('err',_0x3ea99a);});}exports[_0xfebf('0x72')]=function(_0x430a51,_0x386713,_0x2c1f88,_0x2c0eee,_0x184913,_0x536519){var _0x20489c,_0x83badd,_0x2dc8c8;_0x536519[_0xfebf('0x73')]=intUtil[_0xfebf('0x74')](_0x536519[_0xfebf('0x73')]);_0x536519['serverUrl']=intUtil[_0xfebf('0x74')](_0x536519[_0xfebf('0x75')]);if(_0x184913&&_0x184913[_0xfebf('0x76')]){logger['info'](_0xfebf('0x77'),_0xfebf('0x78'));_0x386713['recordingURL']=_0x536519[_0xfebf('0x75')]+_0xfebf('0x79')+_0x386713['uniqueid']+'/downloads?type=uniqueid&token='+md5(_0x386713['uniqueid']);}else{_0x386713['recordingURL']='';}var _0x515eb0=_0x536519[_0xfebf('0x73')]===_0xfebf('0x7a')?'eu':_0xfebf('0x7b');return getAccessToken(_0x536519)[_0xfebf('0x26')](function(_0x1cca87){_0x2dc8c8=_0x1cca87;return getUser(_0x2dc8c8,_0x515eb0,_0x536519,_0x2c0eee[_0xfebf('0x30')]);})['then'](function(_0x5485d5){_0x20489c=_0x5485d5;logger[_0xfebf('0x31')](_0xfebf('0x7c'),_0x20489c['id']);return getEndUser(_0x2dc8c8,_0x515eb0,_0x536519,_0x386713[_0xfebf('0x7d')],_0x386713[_0xfebf('0x7e')],_0x20489c,_0x2c1f88);})[_0xfebf('0x26')](function(_0x1c1989){_0x83badd=_0x1c1989;return getCall(_0x2dc8c8,_0x515eb0,_0x536519,_0x20489c,_0x83badd,_0x2c1f88,_0x386713,_0xfebf('0x6d'));})[_0xfebf('0x26')](function(_0x52f1b7){if(_0x52f1b7){logger['info'](_0xfebf('0x7f'),_0x52f1b7['id']);logger['info']('[QUEUE]',_0xfebf('0x80'));emit(util[_0xfebf('0x2a')]('user:%s',_0x2c0eee['name']),_0xfebf('0x81'),{'uri':_0xfebf('0x82')+_0x536519[_0xfebf('0x73')]+'/crm/EntityInfo.do?module=Calls&id='+_0x52f1b7['id']});}})[_0xfebf('0x39')](function(_0x28bc10){logger[_0xfebf('0x36')](_0xfebf('0x77'),JSON['stringify'](_0x28bc10));});};exports['outbound']=function(_0x2fd5ea,_0x5abb63,_0x57c416,_0x14d01b,_0x3fab04,_0x59f6f1,_0x3d32a8){var _0x4cbe8f,_0x3c24c9,_0x912ca6;_0x59f6f1[_0xfebf('0x73')]=intUtil['stripTrailingSlash'](_0x59f6f1[_0xfebf('0x73')]);_0x59f6f1['serverUrl']=intUtil[_0xfebf('0x74')](_0x59f6f1['serverUrl']);if(_0x3d32a8&&_0x3d32a8[_0xfebf('0x83')]&&_0x3d32a8[_0xfebf('0x83')]!=='none'){logger[_0xfebf('0x31')]('[OUTBOUND]',_0xfebf('0x78'));_0x5abb63[_0xfebf('0x84')]=_0x59f6f1[_0xfebf('0x75')]+'/api/voice/recordings/'+_0x5abb63[_0xfebf('0x85')]+_0xfebf('0x86')+md5(_0x5abb63[_0xfebf('0x85')]);}var _0x5c5e05=_0x59f6f1['host']===_0xfebf('0x7a')?'eu':_0xfebf('0x7b');return getAccessToken(_0x59f6f1)[_0xfebf('0x26')](function(_0x39f5bc){_0x912ca6=_0x39f5bc;return getUser(_0x912ca6,_0x5c5e05,_0x59f6f1,_0x14d01b['email']);})[_0xfebf('0x26')](function(_0x26be77){_0x4cbe8f=_0x26be77;logger[_0xfebf('0x31')](_0xfebf('0x7c'),_0x4cbe8f['id']);return getEndUser(_0x912ca6,_0x5c5e05,_0x59f6f1,_0x5abb63[_0xfebf('0x87')],_0x5abb63[_0xfebf('0x88')],_0x4cbe8f,_0x57c416);})[_0xfebf('0x26')](function(_0x10e5c1){_0x3c24c9=_0x10e5c1;return getCall(_0x912ca6,_0x5c5e05,_0x59f6f1,_0x4cbe8f,_0x3c24c9,_0x57c416,_0x5abb63,_0xfebf('0x89'));})['then'](function(_0x42ef5c){if(_0x42ef5c){logger[_0xfebf('0x31')](_0xfebf('0x7f'),_0x42ef5c['id']);logger[_0xfebf('0x31')](_0xfebf('0x8a'),_0xfebf('0x80'));emit(util[_0xfebf('0x2a')](_0xfebf('0x8b'),_0x14d01b['name']),_0xfebf('0x81'),{'uri':_0xfebf('0x82')+_0x59f6f1[_0xfebf('0x73')]+_0xfebf('0x8c')+_0x42ef5c['id']});}})['catch'](function(_0x11cd11){logger[_0xfebf('0x36')](_0xfebf('0x8a'),JSON[_0xfebf('0xc')](_0x11cd11));});};exports[_0xfebf('0x8d')]=function(_0x5b298f,_0x420632,_0x59e4c4,_0x4bd26e,_0x56eb9d,_0x5e0953){var _0x30c99b,_0x57b431,_0x39847b;_0x5e0953[_0xfebf('0x73')]=intUtil['stripTrailingSlash'](_0x5e0953[_0xfebf('0x73')]);_0x5e0953['serverUrl']=intUtil['stripTrailingSlash'](_0x5e0953[_0xfebf('0x75')]);if(_0x56eb9d&&_0x56eb9d[_0xfebf('0x76')]){logger['info']('['+_0x420632[_0xfebf('0x8e')][_0xfebf('0x8f')]()+']','Recording\x20is\x20enabled!');_0x420632[_0xfebf('0x84')]=_0x5e0953[_0xfebf('0x75')]+_0xfebf('0x79')+_0x420632[_0xfebf('0x85')]+'/downloads?type=uniqueid&token='+md5(_0x420632['uniqueid']);}else{_0x420632['recordingURL']='';}var _0x50a13a=_0x5e0953[_0xfebf('0x73')]==='zoho.eu'?'eu':_0xfebf('0x7b');return getAccessToken(_0x5e0953)['then'](function(_0x26528c){_0x39847b=_0x26528c;return getUser(_0x39847b,_0x50a13a,_0x5e0953);})[_0xfebf('0x26')](function(_0xd3f1b0){_0x30c99b=_0xd3f1b0;logger[_0xfebf('0x31')]('The\x20User\x20ID\x20is:',_0x30c99b['id']);return getEndUser(_0x39847b,_0x50a13a,_0x5e0953,_0x420632[_0xfebf('0x7d')],_0x420632[_0xfebf('0x7e')],_0x30c99b,_0x59e4c4);})[_0xfebf('0x26')](function(_0x4d9042){_0x57b431=_0x4d9042;return getCall(_0x39847b,_0x50a13a,_0x5e0953,_0x30c99b,_0x57b431,_0x59e4c4,_0x420632,_0xfebf('0x6d'));})[_0xfebf('0x26')](function(_0x3a13ca){if(_0x3a13ca){logger[_0xfebf('0x31')](_0xfebf('0x7f'),_0x3a13ca['id']);}})[_0xfebf('0x39')](function(_0x26ff83){logger[_0xfebf('0x36')]('['+_0x420632['lastevent'][_0xfebf('0x8f')]()+']',JSON[_0xfebf('0xc')](_0x26ff83));});}; \ 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 f8643e7..f70a2b1 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 _0xccd7=['data2','data3','render','exec','error','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','util','shelljs','mustache','../../../../config/logger','trigger'];(function(_0x31b0c2,_0x166038){var _0x141601=function(_0x592ad6){while(--_0x592ad6){_0x31b0c2['push'](_0x31b0c2['shift']());}};_0x141601(++_0x166038);}(_0xccd7,0x140));var _0x7ccd=function(_0x132558,_0x521d93){_0x132558=_0x132558-0x0;var _0x34f138=_0xccd7[_0x132558];return _0x34f138;};'use strict';var util=require(_0x7ccd('0x0'));var sh=require(_0x7ccd('0x1'));var Mustache=require(_0x7ccd('0x2'));var logger=require(_0x7ccd('0x3'))(_0x7ccd('0x4'));exports['exec']=function(_0x160c76,_0x4fb0e6){var _0x115919=_0x160c76[_0x7ccd('0x5')]?_0x160c76['data2']:'Script';var _0x44dcb9=_0x160c76[_0x7ccd('0x6')]?Mustache[_0x7ccd('0x7')](_0x160c76[_0x7ccd('0x6')],_0x4fb0e6):_0x4fb0e6;sh[_0x7ccd('0x8')](_0x44dcb9,function(_0x28c009,_0x2e8df9,_0x39817c){if(_0x28c009!==0x0){logger[_0x7ccd('0x9')](util[_0x7ccd('0xa')](_0x7ccd('0xb'),_0x115919,_0x44dcb9,_0x28c009,_0x39817c));}else{logger[_0x7ccd('0xc')](util[_0x7ccd('0xa')]('%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s',_0x115919,_0x44dcb9,_0x2e8df9));}});}; \ No newline at end of file +var _0x3695=['%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','shelljs','../../../../config/logger','trigger','exec','data2','data3','render','error','format','info'];(function(_0x5772ae,_0x4d7475){var _0x38e851=function(_0x68b6c1){while(--_0x68b6c1){_0x5772ae['push'](_0x5772ae['shift']());}};_0x38e851(++_0x4d7475);}(_0x3695,0x7a));var _0x5369=function(_0x3373d6,_0x469c11){_0x3373d6=_0x3373d6-0x0;var _0xe84b65=_0x3695[_0x3373d6];return _0xe84b65;};'use strict';var util=require('util');var sh=require(_0x5369('0x0'));var Mustache=require('mustache');var logger=require(_0x5369('0x1'))(_0x5369('0x2'));exports[_0x5369('0x3')]=function(_0xc1f152,_0x2f0d29){var _0x1bb232=_0xc1f152[_0x5369('0x4')]?_0xc1f152[_0x5369('0x4')]:'Script';var _0x345485=_0xc1f152[_0x5369('0x5')]?Mustache[_0x5369('0x6')](_0xc1f152[_0x5369('0x5')],_0x2f0d29):_0x2f0d29;sh[_0x5369('0x3')](_0x345485,function(_0x548f96,_0x4b73d5,_0x4134b7){if(_0x548f96!==0x0){logger[_0x5369('0x7')](util[_0x5369('0x8')]('%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s',_0x1bb232,_0x345485,_0x548f96,_0x4134b7));}else{logger[_0x5369('0x9')](util[_0x5369('0x8')](_0x5369('0xa'),_0x1bb232,_0x345485,_0x4b73d5));}});}; \ 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 c7edf84..0bb4b34 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 _0x1178=['%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','name','message','request-promise','util','lodash','mustache','../../../../config/logger','trigger','exec','toUpperCase','data2','data5','number','data6','parse','error','stack','data1','DELETE','data7','render','body','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then'];(function(_0x2be99e,_0x6212bb){var _0x4bf783=function(_0x328bf2){while(--_0x328bf2){_0x2be99e['push'](_0x2be99e['shift']());}};_0x4bf783(++_0x6212bb);}(_0x1178,0x16c));var _0x8117=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x1178[_0x20a584];return _0x4b41a8;};'use strict';var rp=require(_0x8117('0x0'));var util=require(_0x8117('0x1'));var _=require(_0x8117('0x2'));var Mustache=require(_0x8117('0x3'));var logger=require(_0x8117('0x4'))(_0x8117('0x5'));exports[_0x8117('0x6')]=function(_0x1f8867,_0x214a8f){var _0x402974,_0x373a8b;var _0x23c711={'method':_0x1f8867['data1'][_0x8117('0x7')](),'uri':Mustache['render'](_0x1f8867[_0x8117('0x8')],_0x214a8f),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x1f8867[_0x8117('0x9')])===_0x8117('0xa')&&parseInt(_0x1f8867[_0x8117('0x9')])>=0x1&&parseInt(_0x1f8867[_0x8117('0x9')])<=0xa?parseInt(_0x1f8867[_0x8117('0x9')])*0x3e8:0x5*0x3e8};try{_0x23c711['headers']=_0x1f8867[_0x8117('0xb')]?JSON[_0x8117('0xc')](Mustache['render'](_0x1f8867[_0x8117('0xb')],_0x214a8f)):{};}catch(_0xaf057a){logger[_0x8117('0xd')](_0xaf057a[_0x8117('0xe')]);}switch(_0x1f8867[_0x8117('0xf')][_0x8117('0x7')]()){case'GET':case _0x8117('0x10'):_0x402974=null;_0x23c711['qs']=_0x214a8f;break;case'POST':case'PUT':if(_0x1f8867[_0x8117('0x11')]){try{_0x402974=JSON[_0x8117('0xc')](Mustache[_0x8117('0x12')](_0x1f8867[_0x8117('0x11')],_0x214a8f));_0x23c711[_0x8117('0x13')]=_0x402974;}catch(_0x4daf38){logger['error'](_0x4daf38[_0x8117('0xe')]);logger[_0x8117('0xd')](_0x8117('0x14'));}}else{_0x402974=_0x214a8f;_0x23c711[_0x8117('0x13')]=_0x402974;}break;}logger[_0x8117('0x15')](util[_0x8117('0x16')](_0x8117('0x17'),_0x1f8867[_0x8117('0xf')],_0x1f8867[_0x8117('0x8')],JSON[_0x8117('0x18')](_0x23c711)));rp(_0x23c711)[_0x8117('0x19')](function(_0x1e491b){_0x402974=!_['isNil'](_0x402974)?',\x20request\x20body:\x20'+_0x402974:'';_0x373a8b=typeof _0x1e491b[_0x8117('0x13')]==='object'?JSON[_0x8117('0x18')](_0x1e491b[_0x8117('0x13')]):_0x1e491b['body'];logger[_0x8117('0x15')](util[_0x8117('0x16')](_0x8117('0x1a'),_0x1f8867[_0x8117('0xf')],_0x1f8867['data2'],_0x1e491b['statusCode'],_0x373a8b));})['catch'](function(_0x20822d){logger[_0x8117('0xd')](util[_0x8117('0x16')]('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0x1f8867[_0x8117('0xf')],_0x1f8867[_0x8117('0x8')],_0x20822d[_0x8117('0x1b')],_0x20822d[_0x8117('0x1c')],_0x20822d[_0x8117('0x1d')]));});}; \ No newline at end of file +var _0x82a0=['mustache','../../../../config/logger','trigger','exec','data5','number','data6','parse','render','error','stack','data1','toUpperCase','GET','POST','PUT','data7','body','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then','isNil',',\x20request\x20body:\x20','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','data2','statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','message','request-promise','util'];(function(_0x2b152a,_0x3dd988){var _0x2ad4c7=function(_0x2fa97c){while(--_0x2fa97c){_0x2b152a['push'](_0x2b152a['shift']());}};_0x2ad4c7(++_0x3dd988);}(_0x82a0,0xca));var _0x082a=function(_0x5224ba,_0x3fb4e1){_0x5224ba=_0x5224ba-0x0;var _0x459bd2=_0x82a0[_0x5224ba];return _0x459bd2;};'use strict';var rp=require(_0x082a('0x0'));var util=require(_0x082a('0x1'));var _=require('lodash');var Mustache=require(_0x082a('0x2'));var logger=require(_0x082a('0x3'))(_0x082a('0x4'));exports[_0x082a('0x5')]=function(_0x57dc54,_0x27fe0c){var _0x19aa3a,_0x32069a;var _0x3060b={'method':_0x57dc54['data1']['toUpperCase'](),'uri':Mustache['render'](_0x57dc54['data2'],_0x27fe0c),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x57dc54[_0x082a('0x6')])===_0x082a('0x7')&&parseInt(_0x57dc54[_0x082a('0x6')])>=0x1&&parseInt(_0x57dc54[_0x082a('0x6')])<=0xa?parseInt(_0x57dc54[_0x082a('0x6')])*0x3e8:0x5*0x3e8};try{_0x3060b['headers']=_0x57dc54[_0x082a('0x8')]?JSON[_0x082a('0x9')](Mustache[_0x082a('0xa')](_0x57dc54[_0x082a('0x8')],_0x27fe0c)):{};}catch(_0x38aaf2){logger[_0x082a('0xb')](_0x38aaf2[_0x082a('0xc')]);}switch(_0x57dc54[_0x082a('0xd')][_0x082a('0xe')]()){case _0x082a('0xf'):case'DELETE':_0x19aa3a=null;_0x3060b['qs']=_0x27fe0c;break;case _0x082a('0x10'):case _0x082a('0x11'):if(_0x57dc54[_0x082a('0x12')]){try{_0x19aa3a=JSON[_0x082a('0x9')](Mustache[_0x082a('0xa')](_0x57dc54[_0x082a('0x12')],_0x27fe0c));_0x3060b[_0x082a('0x13')]=_0x19aa3a;}catch(_0xfa8295){logger[_0x082a('0xb')](_0xfa8295['stack']);logger[_0x082a('0xb')](_0x082a('0x14'));}}else{_0x19aa3a=_0x27fe0c;_0x3060b[_0x082a('0x13')]=_0x19aa3a;}break;}logger[_0x082a('0x15')](util[_0x082a('0x16')](_0x082a('0x17'),_0x57dc54[_0x082a('0xd')],_0x57dc54['data2'],JSON[_0x082a('0x18')](_0x3060b)));rp(_0x3060b)[_0x082a('0x19')](function(_0x7e4cb9){_0x19aa3a=!_[_0x082a('0x1a')](_0x19aa3a)?_0x082a('0x1b')+_0x19aa3a:'';_0x32069a=typeof _0x7e4cb9['body']==='object'?JSON[_0x082a('0x18')](_0x7e4cb9['body']):_0x7e4cb9['body'];logger['info'](util[_0x082a('0x16')](_0x082a('0x1c'),_0x57dc54['data1'],_0x57dc54[_0x082a('0x1d')],_0x7e4cb9[_0x082a('0x1e')],_0x32069a));})[_0x082a('0x1f')](function(_0x481ae0){logger[_0x082a('0xb')](util[_0x082a('0x16')](_0x082a('0x20'),_0x57dc54[_0x082a('0xd')],_0x57dc54['data2'],_0x481ae0[_0x082a('0x1e')],_0x481ae0['name'],_0x481ae0[_0x082a('0x21')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index a1c0775..ece05f1 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 _0xe048=['then','debug','rpc','error','message','result','exports','jayson/promise','../../config/logger','routing','client','Request','request'];(function(_0x3c4e4c,_0x36ff70){var _0x144a87=function(_0x5efb4b){while(--_0x5efb4b){_0x3c4e4c['push'](_0x3c4e4c['shift']());}};_0x144a87(++_0x36ff70);}(_0xe048,0x13f));var _0x8e04=function(_0x569ff4,_0x1f7757){_0x569ff4=_0x569ff4-0x0;var _0x256a36=_0xe048[_0x569ff4];return _0x256a36;};'use strict';var jayson=require(_0x8e04('0x0'));var BPromise=require('bluebird');var logger=require(_0x8e04('0x1'))(_0x8e04('0x2'));var client=jayson[_0x8e04('0x3')]['http']({'port':0x2329});client[_0x8e04('0x4')]=function(_0x3fe6d0,_0x4b4c00){return new BPromise(function(_0x41d5b4,_0x36691b){return client[_0x8e04('0x5')](_0x3fe6d0,_0x4b4c00)[_0x8e04('0x6')](function(_0xe61d15){logger[_0x8e04('0x7')](_0x8e04('0x8'),_0x8e04('0x2'),_0x3fe6d0,_0x4b4c00,_0xe61d15);if(_0xe61d15[_0x8e04('0x9')]){logger[_0x8e04('0x9')](_0x8e04('0x8'),_0x8e04('0x2'),_0x3fe6d0,_0xe61d15[_0x8e04('0x9')]['message'],_0x4b4c00);return _0x36691b(_0xe61d15[_0x8e04('0x9')][_0x8e04('0xa')]);}else{return _0x41d5b4(_0xe61d15[_0x8e04('0xb')]);}})['catch'](function(_0x3a70ca){logger[_0x8e04('0x9')](_0x8e04('0x8'),_0x8e04('0x2'),_0x3fe6d0,_0x3a70ca,_0x4b4c00);return _0x36691b(_0x3a70ca);});});};module[_0x8e04('0xc')]=client; \ No newline at end of file +var _0x98d2=['routing','client','http','request','then','debug','rpc','error','message','result','exports','bluebird'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0x98d2,0x6b));var _0x298d=function(_0x19aa84,_0x549537){_0x19aa84=_0x19aa84-0x0;var _0x536146=_0x98d2[_0x19aa84];return _0x536146;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x298d('0x0'));var logger=require('../../config/logger')(_0x298d('0x1'));var client=jayson[_0x298d('0x2')][_0x298d('0x3')]({'port':0x2329});client['Request']=function(_0x10b7b1,_0x176e81){return new BPromise(function(_0x10c1a4,_0x6ad218){return client[_0x298d('0x4')](_0x10b7b1,_0x176e81)[_0x298d('0x5')](function(_0x47ddb7){logger[_0x298d('0x6')](_0x298d('0x7'),_0x298d('0x1'),_0x10b7b1,_0x176e81,_0x47ddb7);if(_0x47ddb7['error']){logger[_0x298d('0x8')]('rpc',_0x298d('0x1'),_0x10b7b1,_0x47ddb7[_0x298d('0x8')][_0x298d('0x9')],_0x176e81);return _0x6ad218(_0x47ddb7['error'][_0x298d('0x9')]);}else{return _0x10c1a4(_0x47ddb7[_0x298d('0xa')]);}})['catch'](function(_0x3bb987){logger[_0x298d('0x8')]('rpc',_0x298d('0x1'),_0x10b7b1,_0x3bb987,_0x176e81);return _0x6ad218(_0x3bb987);});});};module[_0x298d('0xb')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index d8fe82a..ea294ff 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 _0x0e08=['then','initMailAccounts','refresh','mailAccounts','listen','getSettings','loginMailFrequency','catch','bluebird','./server','./realtime','./lib/email','./rpc/mailAccount','./rpc/setting','resolve'];(function(_0x260320,_0x5e0c95){var _0x457fef=function(_0x25311b){while(--_0x25311b){_0x260320['push'](_0x260320['shift']());}};_0x457fef(++_0x5e0c95);}(_0x0e08,0x18e));var _0x80e0=function(_0x49ce9a,_0x665aa0){_0x49ce9a=_0x49ce9a-0x0;var _0x337fa2=_0x0e08[_0x49ce9a];return _0x337fa2;};'use strict';var BPromise=require(_0x80e0('0x0'));var server=require(_0x80e0('0x1'));var Realtime=require(_0x80e0('0x2'));var EmailChannel=require(_0x80e0('0x3'));var mailAccount=require(_0x80e0('0x4'));var setting=require(_0x80e0('0x5'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0x80e0('0x6')]()['then'](mailAccount['getMailAccounts']())[_0x80e0('0x7')](realtime[_0x80e0('0x8')]())['then'](function(){email[_0x80e0('0x9')](realtime[_0x80e0('0xa')]);return realtime;});}function main(){return server[_0x80e0('0xb')](realtime,email)['then'](function(){return initRealtime();})[_0x80e0('0x7')](function(){return setting[_0x80e0('0xc')]();})[_0x80e0('0x7')](function(_0x4dd961){return setInterval(initRealtime,_0x4dd961[_0x80e0('0xd')]*0x3e8);})[_0x80e0('0xe')](function(_0x21776c){console['log'](_0x21776c);});}main(); \ No newline at end of file +var _0xe0b3=['./rpc/mailAccount','./rpc/setting','resolve','then','getMailAccounts','initMailAccounts','mailAccounts','listen','getSettings','catch','bluebird','./server','./realtime','./lib/email'];(function(_0x10d03a,_0x453026){var _0x4663bf=function(_0x5296f3){while(--_0x5296f3){_0x10d03a['push'](_0x10d03a['shift']());}};_0x4663bf(++_0x453026);}(_0xe0b3,0x1e6));var _0x3e0b=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe0b3[_0x321bb2];return _0x9c12ed;};'use strict';var BPromise=require(_0x3e0b('0x0'));var server=require(_0x3e0b('0x1'));var Realtime=require(_0x3e0b('0x2'));var EmailChannel=require(_0x3e0b('0x3'));var mailAccount=require(_0x3e0b('0x4'));var setting=require(_0x3e0b('0x5'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0x3e0b('0x6')]()[_0x3e0b('0x7')](mailAccount[_0x3e0b('0x8')]())[_0x3e0b('0x7')](realtime[_0x3e0b('0x9')]())[_0x3e0b('0x7')](function(){email['refresh'](realtime[_0x3e0b('0xa')]);return realtime;});}function main(){return server[_0x3e0b('0xb')](realtime,email)[_0x3e0b('0x7')](function(){return initRealtime();})[_0x3e0b('0x7')](function(){return setting[_0x3e0b('0xc')]();})['then'](function(_0x4e3800){return setInterval(initRealtime,_0x4e3800['loginMailFrequency']*0x3e8);})[_0x3e0b('0xd')](function(_0x5b313b){console['log'](_0x5b313b);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index fd91d4b..8e0756b 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 _0xba71=['from','then','Mail\x20accepted\x20from\x20routing','lastSync','sendMail','send','Smtp','verify','verified','catch','exports','lodash','moment','bluebird','md5','ioredis','email','redis','defaults','localhost','socket.io-emitter','./imap','./smtp','../rpc/mailAccount','info','mailAccounts','imapAccounts','smtp','emit','key','active','status','Imap','messageStatus','total','isNil','stringify','mailAccount:update','prototype','refresh','hasOwnProperty','handleImapBox','bind','end','handleImapEnd','error','handleImapError','disabled','connected','messages','handleImapEmail','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName'];(function(_0x443fae,_0x20eec1){var _0x45e27e=function(_0x4185f1){while(--_0x4185f1){_0x443fae['push'](_0x443fae['shift']());}};_0x45e27e(++_0x20eec1);}(_0xba71,0x77));var _0x1ba7=function(_0x1893b3,_0x44decb){_0x1893b3=_0x1893b3-0x0;var _0x42df82=_0xba71[_0x1893b3];return _0x42df82;};'use strict';var _=require(_0x1ba7('0x0'));var moment=require(_0x1ba7('0x1'));var BPromise=require(_0x1ba7('0x2'));var md5=require(_0x1ba7('0x3'));var Redis=require(_0x1ba7('0x4'));var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0x1ba7('0x5'));config[_0x1ba7('0x6')]=_[_0x1ba7('0x7')](config['redis'],{'host':_0x1ba7('0x8'),'port':0x18eb});var io=require(_0x1ba7('0x9'))(new Redis(config[_0x1ba7('0x6')]));var EmailImap=require(_0x1ba7('0xa'));var EmailSmtp=require(_0x1ba7('0xb'));var mailAccount=require(_0x1ba7('0xc'));var md5Accounts={};function EmailChannel(_0x22f153){logger[_0x1ba7('0xd')]('start\x20email\x20channel');this[_0x1ba7('0xe')]=_0x22f153[_0x1ba7('0xe')];this[_0x1ba7('0xf')]={};this[_0x1ba7('0x10')]=new EmailSmtp();}EmailChannel['prototype'][_0x1ba7('0x11')]=function(_0x41598c){var _0x241d06=this[_0x1ba7('0xe')][_0x41598c];var _0x445bb7={'id':_0x241d06['id'],'name':_0x241d06['name'],'key':_0x241d06[_0x1ba7('0x12')],'active':_0x241d06[_0x1ba7('0x13')],'Imap':{'status':_0x241d06['Imap'][_0x1ba7('0x14')],'messageStatus':_0x241d06[_0x1ba7('0x15')][_0x1ba7('0x16')],'total':_0x241d06['Imap'][_0x1ba7('0x17')]}};if(_[_0x1ba7('0x18')](md5Accounts[_0x41598c])){md5Accounts[_0x41598c]={};}var _0x532a84=md5(JSON[_0x1ba7('0x19')](_0x445bb7));if(md5Accounts[_0x41598c]['md5']!==_0x532a84){md5Accounts[_0x41598c][_0x1ba7('0x3')]=_0x532a84;io['emit'](_0x1ba7('0x1a'),_0x445bb7);}};EmailChannel[_0x1ba7('0x1b')][_0x1ba7('0x1c')]=function(_0x3c7de1){for(var _0x10a73d in _0x3c7de1){if(_0x3c7de1[_0x1ba7('0x1d')](_0x10a73d)){if(_0x3c7de1[_0x10a73d][_0x1ba7('0x15')]&&_0x3c7de1[_0x10a73d][_0x1ba7('0x13')]){var _0x5cf05c=_0x3c7de1[_0x10a73d][_0x1ba7('0x15')];if(!this[_0x1ba7('0xf')]['hasOwnProperty'](_0x5cf05c['id'])){this['imapAccounts'][_0x5cf05c['id']]=new EmailImap(_0x5cf05c,_0x3c7de1[_0x10a73d]['email']);this[_0x1ba7('0xf')][_0x5cf05c['id']]['on']('box',this[_0x1ba7('0x1e')][_0x1ba7('0x1f')](this,_0x10a73d));this[_0x1ba7('0xf')][_0x5cf05c['id']]['on'](_0x1ba7('0x5'),this['handleImapEmail'][_0x1ba7('0x1f')](this,_0x10a73d));this[_0x1ba7('0xf')][_0x5cf05c['id']]['on'](_0x1ba7('0x20'),this[_0x1ba7('0x21')]['bind'](this,_0x10a73d));this[_0x1ba7('0xf')][_0x5cf05c['id']]['on'](_0x1ba7('0x22'),this[_0x1ba7('0x23')][_0x1ba7('0x1f')](this,_0x10a73d));}}else{if(_['isNil'](this[_0x1ba7('0xe')][_0x10a73d]['Imap'])){this[_0x1ba7('0xe')][_0x10a73d]['Imap']={};}this['mailAccounts'][_0x10a73d]['Imap']['status']=_0x1ba7('0x24');this[_0x1ba7('0xe')][_0x10a73d][_0x1ba7('0x15')][_0x1ba7('0x16')]='';this[_0x1ba7('0x11')](_0x10a73d);}}}};EmailChannel[_0x1ba7('0x1b')]['handleImapBox']=function(_0x3f2580,_0x7dd654){if(this['mailAccounts'][_0x3f2580]){this[_0x1ba7('0xe')][_0x3f2580]['Imap']['status']=_0x1ba7('0x25');this[_0x1ba7('0xe')][_0x3f2580]['Imap']['messageStatus']=_0x7dd654['name'];if(_0x7dd654['messages']){this['mailAccounts'][_0x3f2580][_0x1ba7('0x15')][_0x1ba7('0x17')]=_0x7dd654[_0x1ba7('0x26')]['total'];}return this[_0x1ba7('0x11')](_0x3f2580);}};EmailChannel[_0x1ba7('0x1b')][_0x1ba7('0x27')]=function(_0x24bcca,_0x384331){logger[_0x1ba7('0xd')](_0x1ba7('0x28'),_0x384331[_0x1ba7('0x29')],_0x384331[_0x1ba7('0x2a')],_0x384331[_0x1ba7('0x2b')],_0x24bcca);if(this[_0x1ba7('0xe')][_0x24bcca]){return mailAccount['notify'](_0x24bcca,_0x384331)[_0x1ba7('0x2c')](function(_0x56dfa0){if(_0x56dfa0){logger[_0x1ba7('0xd')](_0x1ba7('0x2d'));}})['catch'](function(_0x25cc4a){logger[_0x1ba7('0x22')]('Mail\x20not\x20accepted\x20from\x20routing\x20%s',JSON['stringify'](_0x25cc4a));});}};EmailChannel[_0x1ba7('0x1b')][_0x1ba7('0x21')]=function(_0x12b14e){if(this['mailAccounts'][_0x12b14e]&&this[_0x1ba7('0xe')][_0x12b14e][_0x1ba7('0x15')]){if(this['imapAccounts'][this[_0x1ba7('0xe')][_0x12b14e][_0x1ba7('0x15')]['id']]){delete this[_0x1ba7('0xf')][this[_0x1ba7('0xe')][_0x12b14e][_0x1ba7('0x15')]['id']];}this[_0x1ba7('0xe')][_0x12b14e][_0x1ba7('0x15')][_0x1ba7('0x2e')]=moment();this['emit'](_0x12b14e);}};EmailChannel['prototype'][_0x1ba7('0x23')]=function(_0x34cc8d,_0x5f406b){if(this['mailAccounts'][_0x34cc8d]){this[_0x1ba7('0xe')][_0x34cc8d][_0x1ba7('0x15')][_0x1ba7('0x14')]=_0x1ba7('0x22');this[_0x1ba7('0xe')][_0x34cc8d][_0x1ba7('0x15')]['messageStatus']=_0x5f406b;return this[_0x1ba7('0x11')](_0x34cc8d);}};EmailChannel[_0x1ba7('0x1b')][_0x1ba7('0x2f')]=function(_0x489363,_0x14fc60){return this[_0x1ba7('0x10')][_0x1ba7('0x30')](_0x489363,_0x14fc60);};EmailChannel[_0x1ba7('0x1b')]['verifySmtp']=function(_0x8662f3){var _0x31eb51=this;if(this[_0x1ba7('0xe')][_0x8662f3['id']]){if(_[_0x1ba7('0x18')](this[_0x1ba7('0xe')][_0x8662f3['id']][_0x1ba7('0x31')])){this[_0x1ba7('0xe')][_0x8662f3['id']]['Smtp']={};}this[_0x1ba7('0xe')][_0x8662f3['id']]['Smtp'][_0x1ba7('0x2e')]=moment();return new BPromise(function(_0x19d34f,_0x3aa6d5){return _0x31eb51[_0x1ba7('0x10')][_0x1ba7('0x32')](_0x8662f3)[_0x1ba7('0x2c')](function(_0xad5bcc){_0x31eb51['mailAccounts'][_0x8662f3['id']][_0x1ba7('0x31')][_0x1ba7('0x14')]=_0x1ba7('0x33');_0x31eb51['mailAccounts'][_0x8662f3['id']][_0x1ba7('0x31')][_0x1ba7('0x16')]='';_0x31eb51[_0x1ba7('0x11')](_0x8662f3['id']);_0x19d34f(_0xad5bcc);})[_0x1ba7('0x34')](function(_0xf8413e){_0x31eb51[_0x1ba7('0xe')][_0x8662f3['id']][_0x1ba7('0x31')]['status']='error';_0x31eb51[_0x1ba7('0xe')][_0x8662f3['id']]['Smtp'][_0x1ba7('0x16')]=_0xf8413e;_0x31eb51['emit'](_0x8662f3['id']);_0x3aa6d5(_0xf8413e);});});}return this[_0x1ba7('0x10')][_0x1ba7('0x32')](_0x8662f3);};module[_0x1ba7('0x35')]=EmailChannel; \ No newline at end of file +var _0x6f9c=['verify','then','verified','lodash','moment','md5','ioredis','../../../config/logger','email','redis','defaults','localhost','socket.io-emitter','../rpc/mailAccount','info','mailAccounts','prototype','name','key','active','Imap','status','messageStatus','total','isNil','stringify','mailAccount:update','refresh','hasOwnProperty','imapAccounts','box','bind','end','error','handleImapError','disabled','emit','handleImapBox','connected','messages','handleImapEmail','lastName','from','notify','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','handleImapEnd','sendMail','smtp','send','verifySmtp','Smtp','lastSync'];(function(_0x604173,_0x455db3){var _0x5bf51a=function(_0x50745c){while(--_0x50745c){_0x604173['push'](_0x604173['shift']());}};_0x5bf51a(++_0x455db3);}(_0x6f9c,0x147));var _0xc6f9=function(_0x4746b5,_0x3a9d28){_0x4746b5=_0x4746b5-0x0;var _0x23a130=_0x6f9c[_0x4746b5];return _0x23a130;};'use strict';var _=require(_0xc6f9('0x0'));var moment=require(_0xc6f9('0x1'));var BPromise=require('bluebird');var md5=require(_0xc6f9('0x2'));var Redis=require(_0xc6f9('0x3'));var config=require('../../../config/environment');var logger=require(_0xc6f9('0x4'))(_0xc6f9('0x5'));config[_0xc6f9('0x6')]=_[_0xc6f9('0x7')](config[_0xc6f9('0x6')],{'host':_0xc6f9('0x8'),'port':0x18eb});var io=require(_0xc6f9('0x9'))(new Redis(config[_0xc6f9('0x6')]));var EmailImap=require('./imap');var EmailSmtp=require('./smtp');var mailAccount=require(_0xc6f9('0xa'));var md5Accounts={};function EmailChannel(_0x115c6b){logger[_0xc6f9('0xb')]('start\x20email\x20channel');this[_0xc6f9('0xc')]=_0x115c6b[_0xc6f9('0xc')];this['imapAccounts']={};this['smtp']=new EmailSmtp();}EmailChannel[_0xc6f9('0xd')]['emit']=function(_0x2c8246){var _0x38ab17=this[_0xc6f9('0xc')][_0x2c8246];var _0x841001={'id':_0x38ab17['id'],'name':_0x38ab17[_0xc6f9('0xe')],'key':_0x38ab17[_0xc6f9('0xf')],'active':_0x38ab17[_0xc6f9('0x10')],'Imap':{'status':_0x38ab17[_0xc6f9('0x11')][_0xc6f9('0x12')],'messageStatus':_0x38ab17[_0xc6f9('0x11')][_0xc6f9('0x13')],'total':_0x38ab17[_0xc6f9('0x11')][_0xc6f9('0x14')]}};if(_[_0xc6f9('0x15')](md5Accounts[_0x2c8246])){md5Accounts[_0x2c8246]={};}var _0xf8acd8=md5(JSON[_0xc6f9('0x16')](_0x841001));if(md5Accounts[_0x2c8246][_0xc6f9('0x2')]!==_0xf8acd8){md5Accounts[_0x2c8246][_0xc6f9('0x2')]=_0xf8acd8;io['emit'](_0xc6f9('0x17'),_0x841001);}};EmailChannel[_0xc6f9('0xd')][_0xc6f9('0x18')]=function(_0x51da2a){for(var _0x416f03 in _0x51da2a){if(_0x51da2a[_0xc6f9('0x19')](_0x416f03)){if(_0x51da2a[_0x416f03]['Imap']&&_0x51da2a[_0x416f03]['active']){var _0x36dc35=_0x51da2a[_0x416f03][_0xc6f9('0x11')];if(!this[_0xc6f9('0x1a')][_0xc6f9('0x19')](_0x36dc35['id'])){this[_0xc6f9('0x1a')][_0x36dc35['id']]=new EmailImap(_0x36dc35,_0x51da2a[_0x416f03]['email']);this[_0xc6f9('0x1a')][_0x36dc35['id']]['on'](_0xc6f9('0x1b'),this['handleImapBox'][_0xc6f9('0x1c')](this,_0x416f03));this['imapAccounts'][_0x36dc35['id']]['on'](_0xc6f9('0x5'),this['handleImapEmail'][_0xc6f9('0x1c')](this,_0x416f03));this[_0xc6f9('0x1a')][_0x36dc35['id']]['on'](_0xc6f9('0x1d'),this['handleImapEnd'][_0xc6f9('0x1c')](this,_0x416f03));this[_0xc6f9('0x1a')][_0x36dc35['id']]['on'](_0xc6f9('0x1e'),this[_0xc6f9('0x1f')][_0xc6f9('0x1c')](this,_0x416f03));}}else{if(_[_0xc6f9('0x15')](this[_0xc6f9('0xc')][_0x416f03][_0xc6f9('0x11')])){this[_0xc6f9('0xc')][_0x416f03][_0xc6f9('0x11')]={};}this[_0xc6f9('0xc')][_0x416f03][_0xc6f9('0x11')][_0xc6f9('0x12')]=_0xc6f9('0x20');this['mailAccounts'][_0x416f03][_0xc6f9('0x11')]['messageStatus']='';this[_0xc6f9('0x21')](_0x416f03);}}}};EmailChannel[_0xc6f9('0xd')][_0xc6f9('0x22')]=function(_0x6029e0,_0x3dd28b){if(this[_0xc6f9('0xc')][_0x6029e0]){this[_0xc6f9('0xc')][_0x6029e0]['Imap'][_0xc6f9('0x12')]=_0xc6f9('0x23');this[_0xc6f9('0xc')][_0x6029e0]['Imap'][_0xc6f9('0x13')]=_0x3dd28b[_0xc6f9('0xe')];if(_0x3dd28b[_0xc6f9('0x24')]){this['mailAccounts'][_0x6029e0][_0xc6f9('0x11')][_0xc6f9('0x14')]=_0x3dd28b[_0xc6f9('0x24')]['total'];}return this[_0xc6f9('0x21')](_0x6029e0);}};EmailChannel[_0xc6f9('0xd')][_0xc6f9('0x25')]=function(_0x5a37b5,_0x1790f8){logger[_0xc6f9('0xb')]('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0x1790f8['firstName'],_0x1790f8[_0xc6f9('0x26')],_0x1790f8[_0xc6f9('0x27')],_0x5a37b5);if(this[_0xc6f9('0xc')][_0x5a37b5]){return mailAccount[_0xc6f9('0x28')](_0x5a37b5,_0x1790f8)['then'](function(_0x19a8cd){if(_0x19a8cd){logger[_0xc6f9('0xb')](_0xc6f9('0x29'));}})[_0xc6f9('0x2a')](function(_0xe0f75d){logger[_0xc6f9('0x1e')](_0xc6f9('0x2b'),JSON[_0xc6f9('0x16')](_0xe0f75d));});}};EmailChannel[_0xc6f9('0xd')][_0xc6f9('0x2c')]=function(_0x29d1c5){if(this[_0xc6f9('0xc')][_0x29d1c5]&&this[_0xc6f9('0xc')][_0x29d1c5]['Imap']){if(this[_0xc6f9('0x1a')][this[_0xc6f9('0xc')][_0x29d1c5]['Imap']['id']]){delete this['imapAccounts'][this[_0xc6f9('0xc')][_0x29d1c5]['Imap']['id']];}this['mailAccounts'][_0x29d1c5][_0xc6f9('0x11')]['lastSync']=moment();this[_0xc6f9('0x21')](_0x29d1c5);}};EmailChannel[_0xc6f9('0xd')][_0xc6f9('0x1f')]=function(_0x5f2e23,_0x508995){if(this[_0xc6f9('0xc')][_0x5f2e23]){this['mailAccounts'][_0x5f2e23][_0xc6f9('0x11')]['status']=_0xc6f9('0x1e');this[_0xc6f9('0xc')][_0x5f2e23]['Imap'][_0xc6f9('0x13')]=_0x508995;return this['emit'](_0x5f2e23);}};EmailChannel[_0xc6f9('0xd')][_0xc6f9('0x2d')]=function(_0x18bd43,_0x2ddd21){return this[_0xc6f9('0x2e')][_0xc6f9('0x2f')](_0x18bd43,_0x2ddd21);};EmailChannel[_0xc6f9('0xd')][_0xc6f9('0x30')]=function(_0x2a3c13){var _0x3b55e=this;if(this['mailAccounts'][_0x2a3c13['id']]){if(_[_0xc6f9('0x15')](this[_0xc6f9('0xc')][_0x2a3c13['id']][_0xc6f9('0x31')])){this[_0xc6f9('0xc')][_0x2a3c13['id']][_0xc6f9('0x31')]={};}this[_0xc6f9('0xc')][_0x2a3c13['id']][_0xc6f9('0x31')][_0xc6f9('0x32')]=moment();return new BPromise(function(_0x2c0f2e,_0xdbc2c9){return _0x3b55e['smtp'][_0xc6f9('0x33')](_0x2a3c13)[_0xc6f9('0x34')](function(_0x36645a){_0x3b55e[_0xc6f9('0xc')][_0x2a3c13['id']][_0xc6f9('0x31')][_0xc6f9('0x12')]=_0xc6f9('0x35');_0x3b55e['mailAccounts'][_0x2a3c13['id']][_0xc6f9('0x31')][_0xc6f9('0x13')]='';_0x3b55e[_0xc6f9('0x21')](_0x2a3c13['id']);_0x2c0f2e(_0x36645a);})[_0xc6f9('0x2a')](function(_0x386e86){_0x3b55e[_0xc6f9('0xc')][_0x2a3c13['id']][_0xc6f9('0x31')][_0xc6f9('0x12')]=_0xc6f9('0x1e');_0x3b55e[_0xc6f9('0xc')][_0x2a3c13['id']][_0xc6f9('0x31')][_0xc6f9('0x13')]=_0x386e86;_0x3b55e['emit'](_0x2a3c13['id']);_0xdbc2c9(_0x386e86);});});}return this['smtp'][_0xc6f9('0x33')](_0x2a3c13);};module['exports']=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index 25b88ba..85dcec9 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 _0x574d=['EventEmitter','./utils','email','mailbox','INBOX','account','once','ready','handleReady','bind','end','handleEnd','error','handleError','connect','inherits','prototype','getAccount','connTimeout','authTimeout','isNil','service','user','password','port','tls','autotls','required','getHost','anonymous@xcally.com','openBox','handleOpenBox','box','readUnseen','search','UNSEEN','handleReadUnseen','length','fetch','message','handleFetchMessage','handleFetchError','handleFetchEnd','handleCloseBox','body','attributes','handleMessageAttributes','handleMessageEnd','handleMessageBody','handleSimpleParser','parser','emit','closeBox','stringify','textCode','hasOwnProperty','upperFirst','exports','path','util','imap','lodash','randomstring','mailparser','simpleParser','Iconv','events'];(function(_0x32b4c3,_0x41d9d4){var _0xb0866e=function(_0x576d2b){while(--_0x576d2b){_0x32b4c3['push'](_0x32b4c3['shift']());}};_0xb0866e(++_0x41d9d4);}(_0x574d,0xc0));var _0xd574=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0x574d[_0x21549c];return _0x426cbd;};'use strict';var fs=require('fs');var path=require(_0xd574('0x0'));var util=require(_0xd574('0x1'));var Imap=require(_0xd574('0x2'));var _=require(_0xd574('0x3'));var rs=require(_0xd574('0x4'));var simpleParser=require(_0xd574('0x5'))[_0xd574('0x6')];var Iconv=require('iconv')[_0xd574('0x7')];var EventEmitter=require(_0xd574('0x8'))[_0xd574('0x9')];var utils=require(_0xd574('0xa'));var logger=require('../../../config/logger')(_0xd574('0xb'));function EmailImap(_0x13a566,_0x3ce54f){this[_0xd574('0xc')]=_0xd574('0xd');this[_0xd574('0xe')]=this['getAccount'](_0x13a566,_0x3ce54f);this['imap']=new Imap(this[_0xd574('0xe')]);this[_0xd574('0x2')][_0xd574('0xf')](_0xd574('0x10'),this[_0xd574('0x11')][_0xd574('0x12')](this));this[_0xd574('0x2')]['once'](_0xd574('0x13'),this[_0xd574('0x14')][_0xd574('0x12')](this));this[_0xd574('0x2')]['on'](_0xd574('0x15'),this[_0xd574('0x16')][_0xd574('0x12')](this));this[_0xd574('0x2')][_0xd574('0x17')]();}util[_0xd574('0x18')](EmailImap,EventEmitter);EmailImap[_0xd574('0x19')][_0xd574('0x1a')]=function(_0x564b36,_0xb44f5d){var _0x147cdf={'connTimeout':_0x564b36[_0xd574('0x1b')]?_0x564b36[_0xd574('0x1b')]*0x3e8:0x2710,'authTimeout':_0x564b36[_0xd574('0x1c')]?_0x564b36[_0xd574('0x1c')]*0x3e8:0x1388};if(_[_0xd574('0x1d')](_0x564b36[_0xd574('0x1e')])){if(_0x564b36['authentication']){_0x147cdf['user']=_0x564b36[_0xd574('0x1f')];_0x147cdf[_0xd574('0x20')]=_0x564b36[_0xd574('0x20')];}_0x147cdf['host']=_0x564b36['host'];_0x147cdf[_0xd574('0x21')]=_0x564b36[_0xd574('0x21')]||0x3e1;if(_0x564b36[_0xd574('0x22')]){_0x147cdf[_0xd574('0x22')]=!![];}else{_0x147cdf[_0xd574('0x22')]=![];_0x147cdf[_0xd574('0x23')]=_0xd574('0x24');}}else{_0x147cdf[_0xd574('0x1f')]=_0x564b36[_0xd574('0x1f')];_0x147cdf[_0xd574('0x20')]=_0x564b36[_0xd574('0x20')];_0x147cdf['host']=utils[_0xd574('0x25')](_0x564b36[_0xd574('0x1e')]);_0x147cdf['port']=0x3e1;_0x147cdf[_0xd574('0x22')]=!![];}_0x147cdf['email']=_0xb44f5d||_0x564b36[_0xd574('0x1f')]||_0xd574('0x26');return _0x147cdf;};EmailImap[_0xd574('0x19')][_0xd574('0x11')]=function(){this[_0xd574('0x2')][_0xd574('0x27')](this[_0xd574('0xc')],![],this[_0xd574('0x28')][_0xd574('0x12')](this));};EmailImap[_0xd574('0x19')][_0xd574('0x28')]=function(_0x44ddae,_0x3e0501){if(_0x44ddae){this[_0xd574('0x16')](_0x44ddae,!![]);}else{this['emit'](_0xd574('0x29'),_0x3e0501);this['readUnseen']();}};EmailImap[_0xd574('0x19')]['handleCloseBox']=function(_0x49f2e9){if(_0x49f2e9){this[_0xd574('0x16')](_0x49f2e9,!![]);}else{this[_0xd574('0x2')][_0xd574('0x13')]();}};EmailImap['prototype'][_0xd574('0x2a')]=function(){this[_0xd574('0x2')][_0xd574('0x2b')]([_0xd574('0x2c')],this['handleReadUnseen']['bind'](this));};EmailImap[_0xd574('0x19')][_0xd574('0x2d')]=function(_0x203bcb,_0x23a495){if(_0x203bcb){this[_0xd574('0x16')](_0x203bcb,!![]);}else{if(_0x23a495[_0xd574('0x2e')]){try{var _0x5b66eb=this['imap'][_0xd574('0x2f')](_0x23a495,{'bodies':'','markSeen':!![]});_0x5b66eb['on'](_0xd574('0x30'),this[_0xd574('0x31')][_0xd574('0x12')](this));_0x5b66eb[_0xd574('0xf')](_0xd574('0x15'),this[_0xd574('0x32')][_0xd574('0x12')](this));_0x5b66eb['once']('end',this[_0xd574('0x33')][_0xd574('0x12')](this));}catch(_0xd4b730){logger[_0xd574('0x15')](_0xd4b730);}}else{this[_0xd574('0x2')]['closeBox'](!![],this[_0xd574('0x34')][_0xd574('0x12')](this));}}};EmailImap[_0xd574('0x19')][_0xd574('0x31')]=function(_0x911c31,_0x2f1a1e){_0x911c31['on'](_0xd574('0x35'),this['handleMessageBody'][_0xd574('0x12')](this));_0x911c31['once'](_0xd574('0x36'),this[_0xd574('0x37')][_0xd574('0x12')](this));_0x911c31[_0xd574('0xf')](_0xd574('0x13'),this[_0xd574('0x38')][_0xd574('0x12')](this));};EmailImap[_0xd574('0x19')][_0xd574('0x39')]=function(_0x2d06d9,_0x1cfad2){simpleParser(_0x2d06d9,{'Iconv':Iconv},this['handleSimpleParser'][_0xd574('0x12')](this));};EmailImap[_0xd574('0x19')][_0xd574('0x37')]=function(_0x538721){};EmailImap[_0xd574('0x19')][_0xd574('0x38')]=function(){};EmailImap[_0xd574('0x19')][_0xd574('0x3a')]=function(_0x15d429,_0x445068){if(_0x15d429){logger['error'](_0x15d429);}else{var _0x1dbeb9=this;utils[_0xd574('0x3b')](this[_0xd574('0xe')],_0x445068,function(_0x211479){_0x1dbeb9[_0xd574('0x3c')]('email',_0x211479);});}};EmailImap[_0xd574('0x19')][_0xd574('0x33')]=function(){this[_0xd574('0x2')]['closeBox'](!![],this['handleCloseBox']['bind'](this));};EmailImap[_0xd574('0x19')]['handleFetchError']=function(_0x5874e4){this['handleError'](_0x5874e4);this[_0xd574('0x2')][_0xd574('0x3d')](!![],this[_0xd574('0x34')][_0xd574('0x12')](this));};EmailImap['prototype'][_0xd574('0x14')]=function(){this[_0xd574('0x3c')](_0xd574('0x13'));};EmailImap[_0xd574('0x19')]['handleError']=function(_0x1bf7c5,_0x4caf06){logger[_0xd574('0x15')](_0xd574('0x16'),this[_0xd574('0xe')][_0xd574('0xb')],JSON[_0xd574('0x3e')](_0x1bf7c5));var _0x1baedc='';if(_0x1bf7c5){if(_0x1bf7c5[_0xd574('0x3f')]){_0x1baedc=_0x1bf7c5[_0xd574('0x3f')];}else{for(var _0x1857bb in _0x1bf7c5){if(_0x1bf7c5[_0xd574('0x40')](_0x1857bb)){_0x1baedc+=_[_0xd574('0x41')](_0x1857bb)+':\x20'+_0x1bf7c5[_0x1857bb]+'\x0a';}}}}if(_0x4caf06){this[_0xd574('0x2')][_0xd574('0x13')]();}else{this['emit'](_0xd574('0x15'),_0x1baedc);this['emit']('end');}};module[_0xd574('0x42')]=EmailImap; \ No newline at end of file +var _0x77f4=['stringify','textCode','hasOwnProperty','exports','path','util','imap','lodash','randomstring','mailparser','simpleParser','iconv','events','./utils','mailbox','INBOX','account','getAccount','once','handleReady','bind','end','handleEnd','error','inherits','prototype','connTimeout','authTimeout','isNil','service','authentication','user','password','host','port','tls','autotls','required','email','openBox','handleOpenBox','emit','readUnseen','search','UNSEEN','handleReadUnseen','handleError','length','handleFetchMessage','handleFetchError','handleFetchEnd','closeBox','handleCloseBox','body','handleMessageBody','attributes','handleMessageAttributes','handleSimpleParser','handleMessageEnd'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x77f4,0x1a1));var _0x477f=function(_0x545c72,_0x250789){_0x545c72=_0x545c72-0x0;var _0x75fb2e=_0x77f4[_0x545c72];return _0x75fb2e;};'use strict';var fs=require('fs');var path=require(_0x477f('0x0'));var util=require(_0x477f('0x1'));var Imap=require(_0x477f('0x2'));var _=require(_0x477f('0x3'));var rs=require(_0x477f('0x4'));var simpleParser=require(_0x477f('0x5'))[_0x477f('0x6')];var Iconv=require(_0x477f('0x7'))['Iconv'];var EventEmitter=require(_0x477f('0x8'))['EventEmitter'];var utils=require(_0x477f('0x9'));var logger=require('../../../config/logger')('email');function EmailImap(_0x16eb7d,_0x56912c){this[_0x477f('0xa')]=_0x477f('0xb');this[_0x477f('0xc')]=this[_0x477f('0xd')](_0x16eb7d,_0x56912c);this['imap']=new Imap(this['account']);this[_0x477f('0x2')][_0x477f('0xe')]('ready',this[_0x477f('0xf')][_0x477f('0x10')](this));this[_0x477f('0x2')][_0x477f('0xe')](_0x477f('0x11'),this[_0x477f('0x12')]['bind'](this));this[_0x477f('0x2')]['on'](_0x477f('0x13'),this['handleError'][_0x477f('0x10')](this));this['imap']['connect']();}util[_0x477f('0x14')](EmailImap,EventEmitter);EmailImap[_0x477f('0x15')][_0x477f('0xd')]=function(_0x3d184c,_0x30cab5){var _0x337525={'connTimeout':_0x3d184c['connTimeout']?_0x3d184c[_0x477f('0x16')]*0x3e8:0x2710,'authTimeout':_0x3d184c[_0x477f('0x17')]?_0x3d184c['authTimeout']*0x3e8:0x1388};if(_[_0x477f('0x18')](_0x3d184c[_0x477f('0x19')])){if(_0x3d184c[_0x477f('0x1a')]){_0x337525['user']=_0x3d184c[_0x477f('0x1b')];_0x337525[_0x477f('0x1c')]=_0x3d184c[_0x477f('0x1c')];}_0x337525[_0x477f('0x1d')]=_0x3d184c['host'];_0x337525[_0x477f('0x1e')]=_0x3d184c[_0x477f('0x1e')]||0x3e1;if(_0x3d184c[_0x477f('0x1f')]){_0x337525[_0x477f('0x1f')]=!![];}else{_0x337525[_0x477f('0x1f')]=![];_0x337525[_0x477f('0x20')]=_0x477f('0x21');}}else{_0x337525[_0x477f('0x1b')]=_0x3d184c[_0x477f('0x1b')];_0x337525[_0x477f('0x1c')]=_0x3d184c['password'];_0x337525[_0x477f('0x1d')]=utils['getHost'](_0x3d184c['service']);_0x337525['port']=0x3e1;_0x337525[_0x477f('0x1f')]=!![];}_0x337525[_0x477f('0x22')]=_0x30cab5||_0x3d184c['user']||'anonymous@xcally.com';return _0x337525;};EmailImap[_0x477f('0x15')]['handleReady']=function(){this[_0x477f('0x2')][_0x477f('0x23')](this[_0x477f('0xa')],![],this['handleOpenBox'][_0x477f('0x10')](this));};EmailImap[_0x477f('0x15')][_0x477f('0x24')]=function(_0x2d5ddc,_0xf0406d){if(_0x2d5ddc){this['handleError'](_0x2d5ddc,!![]);}else{this[_0x477f('0x25')]('box',_0xf0406d);this['readUnseen']();}};EmailImap[_0x477f('0x15')]['handleCloseBox']=function(_0x4a86a0){if(_0x4a86a0){this['handleError'](_0x4a86a0,!![]);}else{this[_0x477f('0x2')][_0x477f('0x11')]();}};EmailImap[_0x477f('0x15')][_0x477f('0x26')]=function(){this[_0x477f('0x2')][_0x477f('0x27')]([_0x477f('0x28')],this[_0x477f('0x29')][_0x477f('0x10')](this));};EmailImap[_0x477f('0x15')][_0x477f('0x29')]=function(_0x2a58b7,_0x4d65f2){if(_0x2a58b7){this[_0x477f('0x2a')](_0x2a58b7,!![]);}else{if(_0x4d65f2[_0x477f('0x2b')]){try{var _0x47b20a=this['imap']['fetch'](_0x4d65f2,{'bodies':'','markSeen':!![]});_0x47b20a['on']('message',this[_0x477f('0x2c')][_0x477f('0x10')](this));_0x47b20a[_0x477f('0xe')]('error',this[_0x477f('0x2d')]['bind'](this));_0x47b20a[_0x477f('0xe')]('end',this[_0x477f('0x2e')][_0x477f('0x10')](this));}catch(_0x1c714d){logger['error'](_0x1c714d);}}else{this['imap'][_0x477f('0x2f')](!![],this[_0x477f('0x30')][_0x477f('0x10')](this));}}};EmailImap[_0x477f('0x15')][_0x477f('0x2c')]=function(_0x49de0f,_0x2fb0db){_0x49de0f['on'](_0x477f('0x31'),this[_0x477f('0x32')][_0x477f('0x10')](this));_0x49de0f[_0x477f('0xe')](_0x477f('0x33'),this[_0x477f('0x34')][_0x477f('0x10')](this));_0x49de0f[_0x477f('0xe')](_0x477f('0x11'),this['handleMessageEnd'][_0x477f('0x10')](this));};EmailImap[_0x477f('0x15')][_0x477f('0x32')]=function(_0x1d14cf,_0x1e8d34){simpleParser(_0x1d14cf,{'Iconv':Iconv},this[_0x477f('0x35')][_0x477f('0x10')](this));};EmailImap[_0x477f('0x15')]['handleMessageAttributes']=function(_0x14c994){};EmailImap['prototype'][_0x477f('0x36')]=function(){};EmailImap[_0x477f('0x15')][_0x477f('0x35')]=function(_0x4a8c71,_0x13ec77){if(_0x4a8c71){logger['error'](_0x4a8c71);}else{var _0x34de03=this;utils['parser'](this[_0x477f('0xc')],_0x13ec77,function(_0x2d839e){_0x34de03[_0x477f('0x25')](_0x477f('0x22'),_0x2d839e);});}};EmailImap[_0x477f('0x15')][_0x477f('0x2e')]=function(){this[_0x477f('0x2')][_0x477f('0x2f')](!![],this[_0x477f('0x30')][_0x477f('0x10')](this));};EmailImap['prototype'][_0x477f('0x2d')]=function(_0x1c9760){this['handleError'](_0x1c9760);this[_0x477f('0x2')][_0x477f('0x2f')](!![],this[_0x477f('0x30')][_0x477f('0x10')](this));};EmailImap['prototype']['handleEnd']=function(){this[_0x477f('0x25')](_0x477f('0x11'));};EmailImap[_0x477f('0x15')]['handleError']=function(_0x7e3d02,_0x9dadc0){logger['error'](_0x477f('0x2a'),this['account'][_0x477f('0x22')],JSON[_0x477f('0x37')](_0x7e3d02));var _0x1db340='';if(_0x7e3d02){if(_0x7e3d02['textCode']){_0x1db340=_0x7e3d02[_0x477f('0x38')];}else{for(var _0x408d34 in _0x7e3d02){if(_0x7e3d02[_0x477f('0x39')](_0x408d34)){_0x1db340+=_['upperFirst'](_0x408d34)+':\x20'+_0x7e3d02[_0x408d34]+'\x0a';}}}}if(_0x9dadc0){this[_0x477f('0x2')][_0x477f('0x11')]();}else{this[_0x477f('0x25')](_0x477f('0x13'),_0x1db340);this['emit']('end');}};module[_0x477f('0x3a')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index 2db4d88..3653508 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 _0x3d4a=['prototype','send','createTransport','sendMail','toString','verify','Not\x20verifired','exports','nodemailer','bluebird','nodemailer-plugin-inline-base64'];(function(_0x4a2259,_0x156a88){var _0x537488=function(_0x5b5e24){while(--_0x5b5e24){_0x4a2259['push'](_0x4a2259['shift']());}};_0x537488(++_0x156a88);}(_0x3d4a,0xef));var _0xa3d4=function(_0x2e309b,_0x3b36c9){_0x2e309b=_0x2e309b-0x0;var _0x52ad92=_0x3d4a[_0x2e309b];return _0x52ad92;};'use strict';var nodemailer=require(_0xa3d4('0x0'));var BPromise=require(_0xa3d4('0x1'));var inlineBase64=require(_0xa3d4('0x2'));function EmailSmtp(){}EmailSmtp[_0xa3d4('0x3')][_0xa3d4('0x4')]=function(_0x27e9eb,_0x25e8f5){return new BPromise(function(_0x31c98e,_0x31fbc9){var _0x34a3c0=nodemailer[_0xa3d4('0x5')](_0x27e9eb);_0x34a3c0['use']('compile',inlineBase64());_0x34a3c0[_0xa3d4('0x6')](_0x25e8f5,function(_0x45ff7e,_0x2abb6f){if(_0x45ff7e){_0x31fbc9(_0x45ff7e[_0xa3d4('0x7')]());}else{_0x31c98e(_0x2abb6f);}});});};EmailSmtp['prototype'][_0xa3d4('0x8')]=function(_0x492b5a){return new BPromise(function(_0x5675f0,_0x1cc09e){var _0x59069d=nodemailer[_0xa3d4('0x5')](_0x492b5a);_0x59069d[_0xa3d4('0x8')](function(_0xbe4a7,_0x4ba223){if(_0xbe4a7){_0x1cc09e(_0xbe4a7[_0xa3d4('0x7')]());}else{if(_0x4ba223){_0x5675f0(_0x4ba223);}else{_0x1cc09e(_0xa3d4('0x9'));}}});});};module[_0xa3d4('0xa')]=EmailSmtp; \ No newline at end of file +var _0x40bd=['use','sendMail','prototype','verify','toString','exports','nodemailer','bluebird','send','createTransport'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x40bd,0x1d2));var _0xd40b=function(_0x522a0e,_0x5252c9){_0x522a0e=_0x522a0e-0x0;var _0x285044=_0x40bd[_0x522a0e];return _0x285044;};'use strict';var nodemailer=require(_0xd40b('0x0'));var BPromise=require(_0xd40b('0x1'));var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp['prototype'][_0xd40b('0x2')]=function(_0x347a41,_0x3572c8){return new BPromise(function(_0x394260,_0x877390){var _0x386c53=nodemailer[_0xd40b('0x3')](_0x347a41);_0x386c53[_0xd40b('0x4')]('compile',inlineBase64());_0x386c53[_0xd40b('0x5')](_0x3572c8,function(_0x118b34,_0x19c798){if(_0x118b34){_0x877390(_0x118b34['toString']());}else{_0x394260(_0x19c798);}});});};EmailSmtp[_0xd40b('0x6')]['verify']=function(_0x74d181){return new BPromise(function(_0x5bcb1b,_0x117d08){var _0x5cb338=nodemailer[_0xd40b('0x3')](_0x74d181);_0x5cb338[_0xd40b('0x7')](function(_0x2ea678,_0x58570a){if(_0x2ea678){_0x117d08(_0x2ea678[_0xd40b('0x8')]());}else{if(_0x58570a){_0x5bcb1b(_0x58570a);}else{_0x117d08('Not\x20verifired');}}});});};module[_0xd40b('0x9')]=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index 75b3c43..3403e10 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 _0x9e2e=['getHost','imap.gmail.com','yahoo','imap.mail.yahoo.com','imap-mail.outlook.com','outlook365','outlook.office365.com','lodash','moment','randomstring','util','email','../../../config/environment','head','value','address','anonymous','@xcally.com','name','indexOf','slice','join','Anonymous','length','isEmpty','generate','html','test','replace','includes','Empty\x20message

'];(function(_0x249dcd,_0xeae469){var _0x2b952d=function(_0x5ca7d8){while(--_0x5ca7d8){_0x249dcd['push'](_0x249dcd['shift']());}};_0x2b952d(++_0xeae469);}(_0x9e2e,0xd6));var _0xe9e2=function(_0x3173a5,_0x4d7458){_0x3173a5=_0x3173a5-0x0;var _0x2d4cf4=_0x9e2e[_0x3173a5];return _0x2d4cf4;};'use strict';var _=require(_0xe9e2('0x0'));var moment=require(_0xe9e2('0x1'));var random=require(_0xe9e2('0x2'));var fs=require('fs');var path=require('path');var util=require(_0xe9e2('0x3'));var tnef=require('node-tnef');var logger=require('../../../config/logger')(_0xe9e2('0x4'));var config=require(_0xe9e2('0x5'));function getAddress(_0x3bfa90){var _0x212d98=_[_0xe9e2('0x6')](_0x3bfa90[_0xe9e2('0x7')]);return _0x212d98&&_0x212d98[_0xe9e2('0x8')]?_0x212d98['address']:_0xe9e2('0x9')+random['generate'](0x6)+_0xe9e2('0xa');}function getFirstName(_0x1ade12){var _0x58a008=_[_0xe9e2('0x6')](_0x1ade12[_0xe9e2('0x7')]);if(_0x58a008&&_0x58a008['name']){if(_0x58a008[_0xe9e2('0xb')]==_0x58a008[_0xe9e2('0x8')]){return _0x58a008['name']['substring'](0x0,_0x58a008[_0xe9e2('0xb')][_0xe9e2('0xc')]('@'));}var _0x2e02c8=_0x58a008[_0xe9e2('0xb')]['split'](/\s+/);return _0x2e02c8['length']>0x1?_0x2e02c8[_0xe9e2('0xd')](0x0,-0x1)[_0xe9e2('0xe')]('\x20'):_0x58a008[_0xe9e2('0xb')];}return _0xe9e2('0xf');}function getLastName(_0x13bfad){var _0x23331d=_[_0xe9e2('0x6')](_0x13bfad[_0xe9e2('0x7')]);if(_0x23331d&&_0x23331d[_0xe9e2('0xb')]){var _0x33a169=_0x23331d['name']['split'](/\s+/);return _0x33a169[_0xe9e2('0x10')]>0x1?_0x33a169['pop']():'';}return'';}function getMails(_0x533e9e,_0x17a5c3){var _0x28aff7='';for(var _0x3550ce=0x0;_0x3550ce<_0x17a5c3[_0xe9e2('0x7')][_0xe9e2('0x10')];_0x3550ce+=0x1){if(_0x17a5c3[_0xe9e2('0x7')][_0x3550ce]['address']!==_0x533e9e){if(!_[_0xe9e2('0x11')](_0x28aff7)){_0x28aff7+=',';}_0x28aff7+=_0x17a5c3[_0xe9e2('0x7')][_0x3550ce][_0xe9e2('0xb')]||_0x17a5c3['value'][_0x3550ce][_0xe9e2('0x8')]||'';_0x28aff7+='\x20<';_0x28aff7+=_0x17a5c3[_0xe9e2('0x7')][_0x3550ce][_0xe9e2('0x8')]?_0x17a5c3['value'][_0x3550ce][_0xe9e2('0x8')]:_0xe9e2('0x9')+random[_0xe9e2('0x12')](0x6)+'@xcally.com';_0x28aff7+='>';}}return _0x28aff7;}function parseEmail(_0x16d953,_0x36c8a3,_0x456455){if(_0x36c8a3[_0xe9e2('0x13')]){var _0x5bb286=/)<[^<]*)*<\/script>/gi;while(_0x5bb286[_0xe9e2('0x14')](_0x36c8a3[_0xe9e2('0x13')])){_0x36c8a3[_0xe9e2('0x13')]=_0x36c8a3[_0xe9e2('0x13')][_0xe9e2('0x15')](_0x5bb286,'');}if(_0x36c8a3[_0xe9e2('0x13')][_0xe9e2('0x16')](_0xe9e2('0x17'))){var _0x261d12=[];_0x36c8a3[_0xe9e2('0x18')][_0xe9e2('0x19')](_0x2e8577=>{_0x261d12[_0xe9e2('0x1a')](_0x2e8577[_0xe9e2('0x1b')]);});var _0x313b09=/]+>/g;var _0x1bf061=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x2fac3e=_0x36c8a3['html'][_0xe9e2('0x15')](_0x1bf061,_0xe9e2('0x1c'));var _0x32775d=_0x2fac3e[_0xe9e2('0x15')](_0x313b09,'_IMG');for(let _0x325bf4=0x0;_0x325bf4<_0x261d12[_0xe9e2('0x10')];_0x325bf4++){var _0x13d181=_0x32775d[_0xe9e2('0x15')](_0xe9e2('0x1d'),'\x20[Attachment:\x20'+_0x261d12[_0x325bf4]+'\x20]');_0x32775d=_0x13d181;}_0x36c8a3[_0xe9e2('0x13')]=_0x32775d;}_0x456455[_0xe9e2('0x1e')]=_0x36c8a3[_0xe9e2('0x13')];}else{_0x456455[_0xe9e2('0x1e')]=_0x36c8a3[_0xe9e2('0x1f')];}if(_0x456455[_0xe9e2('0x1e')]){_0x456455[_0xe9e2('0x1e')]=_0x456455[_0xe9e2('0x1e')][_0xe9e2('0x15')](/0x0){var _0x4b423e=[_0xe9e2('0x2e'),_0xe9e2('0x2f'),'Precedence:\x20auto_reply'];for(var _0x2eb636=0x0;_0x2eb636<_0x36c8a3['headerLines'][_0xe9e2('0x10')];_0x2eb636++){var _0x552ff0=_[_0xe9e2('0xc')](_0x4b423e,_0x36c8a3[_0xe9e2('0x2d')][_0x2eb636][_0xe9e2('0x30')]);if(_0x552ff0>=0x0){_0x456455['isAutoreply']=!![];}}}return _0x456455;}exports[_0xe9e2('0x31')]=function(_0x40d34b,_0x22092e,_0x340f11){var _0xc00528={'from':getAddress(_0x22092e[_0xe9e2('0x32')]),'firstName':getFirstName(_0x22092e['from']),'lastName':getLastName(_0x22092e['from']),'mapKey':_0xe9e2('0x4'),'message':{'from':getMails(_0x40d34b[_0xe9e2('0x4')],_0x22092e[_0xe9e2('0x32')]),'to':_0x40d34b[_0xe9e2('0x4')],'cc':'','subject':_0x22092e[_0xe9e2('0x33')]||'','messageId':_0x22092e[_0xe9e2('0x34')],'inReplyTo':_0x22092e['inReplyTo'],'sentAt':moment(_0x22092e[_0xe9e2('0x35')])['format']('YYYY-MM-DD\x20HH:mm:ss'),'attach':![],'attachments':[]}};if(!_0x22092e[_0xe9e2('0x13')]&&!_0x22092e[_0xe9e2('0x1f')]){var _0x5b2ae0=_['filter'](_0x22092e[_0xe9e2('0x18')],{'contentType':_0xe9e2('0x36')});if(_0x5b2ae0['length']){logger['info'](util[_0xe9e2('0x28')](_0xe9e2('0x37'),_0x22092e[_0xe9e2('0x34')]));tnef[_0xe9e2('0x38')](_[_0xe9e2('0x39')](_0x5b2ae0)['content'],function(_0xffdf05,_0x333a2c){if(_0x333a2c){_0x22092e[_0xe9e2('0x13')]=_0x333a2c[_0xe9e2('0x3a')]||'

Empty\x20message

';if(_0x333a2c[_0xe9e2('0x3b')]){for(var _0x176c73=0x0;_0x176c73<_0x333a2c['Attachments']['length'];_0x176c73++){var _0x33505e=_0x333a2c[_0xe9e2('0x3b')][_0x176c73];_0xc00528[_0xe9e2('0x21')][_0xe9e2('0x18')][_0xe9e2('0x1a')]({'filename':_0x33505e['Title'],'content':Buffer[_0xe9e2('0x32')](_0x33505e[_0xe9e2('0x3c')])});}}}_0x340f11(parseEmail(_0x40d34b,_0x22092e,_0xc00528));});}else{_0x22092e[_0xe9e2('0x13')]=_0xe9e2('0x3d');_0x340f11(parseEmail(_0x40d34b,_0x22092e,_0xc00528));}}else{_0x340f11(parseEmail(_0x40d34b,_0x22092e,_0xc00528));}};exports[_0xe9e2('0x3e')]=function(_0x568625){switch(_0x568625){case'gmail':return _0xe9e2('0x3f');case _0xe9e2('0x40'):return _0xe9e2('0x41');case'hotmail':return _0xe9e2('0x42');case _0xe9e2('0x43'):return _0xe9e2('0x44');}return'127.0.0.1';}; \ No newline at end of file +var _0x1fa9=['outlook.office365.com','127.0.0.1','lodash','randomstring','util','node-tnef','../../../config/logger','../../../config/environment','head','value','address','anonymous','name','indexOf','split','length','slice','pop','isEmpty','generate','@xcally.com','html','test','includes','','body','textAsHtml','Empty\x20message

','Attachments','Title','getHost','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365'];(function(_0x5df50a,_0x409b04){var _0x1ba526=function(_0x488fd1){while(--_0x488fd1){_0x5df50a['push'](_0x5df50a['shift']());}};_0x1ba526(++_0x409b04);}(_0x1fa9,0x136));var _0x91fa=function(_0x17520d,_0x20f4bc){_0x17520d=_0x17520d-0x0;var _0x135827=_0x1fa9[_0x17520d];return _0x135827;};'use strict';var _=require(_0x91fa('0x0'));var moment=require('moment');var random=require(_0x91fa('0x1'));var fs=require('fs');var path=require('path');var util=require(_0x91fa('0x2'));var tnef=require(_0x91fa('0x3'));var logger=require(_0x91fa('0x4'))('email');var config=require(_0x91fa('0x5'));function getAddress(_0x33b35a){var _0x4779be=_[_0x91fa('0x6')](_0x33b35a[_0x91fa('0x7')]);return _0x4779be&&_0x4779be['address']?_0x4779be[_0x91fa('0x8')]:_0x91fa('0x9')+random['generate'](0x6)+'@xcally.com';}function getFirstName(_0xb4a51f){var _0x7ad4dd=_[_0x91fa('0x6')](_0xb4a51f[_0x91fa('0x7')]);if(_0x7ad4dd&&_0x7ad4dd[_0x91fa('0xa')]){if(_0x7ad4dd[_0x91fa('0xa')]==_0x7ad4dd[_0x91fa('0x8')]){return _0x7ad4dd['name']['substring'](0x0,_0x7ad4dd[_0x91fa('0xa')][_0x91fa('0xb')]('@'));}var _0x17fc65=_0x7ad4dd[_0x91fa('0xa')][_0x91fa('0xc')](/\s+/);return _0x17fc65[_0x91fa('0xd')]>0x1?_0x17fc65[_0x91fa('0xe')](0x0,-0x1)['join']('\x20'):_0x7ad4dd['name'];}return'Anonymous';}function getLastName(_0xc0b7bf){var _0x4ebf24=_[_0x91fa('0x6')](_0xc0b7bf[_0x91fa('0x7')]);if(_0x4ebf24&&_0x4ebf24[_0x91fa('0xa')]){var _0x2797d2=_0x4ebf24['name'][_0x91fa('0xc')](/\s+/);return _0x2797d2[_0x91fa('0xd')]>0x1?_0x2797d2[_0x91fa('0xf')]():'';}return'';}function getMails(_0x2667da,_0xe9e249){var _0x1f43fa='';for(var _0x5172d8=0x0;_0x5172d8<_0xe9e249[_0x91fa('0x7')][_0x91fa('0xd')];_0x5172d8+=0x1){if(_0xe9e249[_0x91fa('0x7')][_0x5172d8][_0x91fa('0x8')]!==_0x2667da){if(!_[_0x91fa('0x10')](_0x1f43fa)){_0x1f43fa+=',';}_0x1f43fa+=_0xe9e249['value'][_0x5172d8][_0x91fa('0xa')]||_0xe9e249[_0x91fa('0x7')][_0x5172d8][_0x91fa('0x8')]||'';_0x1f43fa+='\x20<';_0x1f43fa+=_0xe9e249[_0x91fa('0x7')][_0x5172d8][_0x91fa('0x8')]?_0xe9e249[_0x91fa('0x7')][_0x5172d8][_0x91fa('0x8')]:_0x91fa('0x9')+random[_0x91fa('0x11')](0x6)+_0x91fa('0x12');_0x1f43fa+='>';}}return _0x1f43fa;}function parseEmail(_0x279288,_0x4a8f08,_0x46433d){if(_0x4a8f08[_0x91fa('0x13')]){var _0x4ac68d=/)<[^<]*)*<\/script>/gi;while(_0x4ac68d[_0x91fa('0x14')](_0x4a8f08['html'])){_0x4a8f08[_0x91fa('0x13')]=_0x4a8f08['html']['replace'](_0x4ac68d,'');}if(_0x4a8f08['html'][_0x91fa('0x15')](_0x91fa('0x16'))){var _0x3dd307=[];_0x4a8f08[_0x91fa('0x17')][_0x91fa('0x18')](_0x5df647=>{_0x3dd307[_0x91fa('0x19')](_0x5df647[_0x91fa('0x1a')]);});var _0x252c71=/]+>/g;var _0x1d2019=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x4b0090=_0x4a8f08['html'][_0x91fa('0x1b')](_0x1d2019,_0x91fa('0x1c'));var _0x26a9b3=_0x4b0090[_0x91fa('0x1b')](_0x252c71,_0x91fa('0x1d'));for(let _0x50b4fa=0x0;_0x50b4fa<_0x3dd307[_0x91fa('0xd')];_0x50b4fa++){var _0x404bbc=_0x26a9b3[_0x91fa('0x1b')]('_IMG','\x20[Attachment:\x20'+_0x3dd307[_0x50b4fa]+_0x91fa('0x1e'));_0x26a9b3=_0x404bbc;}_0x4a8f08[_0x91fa('0x13')]=_0x26a9b3;}_0x46433d[_0x91fa('0x1f')]=_0x4a8f08[_0x91fa('0x13')];}else{_0x46433d[_0x91fa('0x1f')]=_0x4a8f08[_0x91fa('0x20')];}if(_0x46433d[_0x91fa('0x1f')]){_0x46433d[_0x91fa('0x1f')]=_0x46433d[_0x91fa('0x1f')][_0x91fa('0x1b')](/0x0){var _0x8987ad=[_0x91fa('0x2f'),_0x91fa('0x30'),_0x91fa('0x31')];for(var _0x55417b=0x0;_0x55417b<_0x4a8f08[_0x91fa('0x2e')][_0x91fa('0xd')];_0x55417b++){var _0x284134=_[_0x91fa('0xb')](_0x8987ad,_0x4a8f08[_0x91fa('0x2e')][_0x55417b][_0x91fa('0x32')]);if(_0x284134>=0x0){_0x46433d['isAutoreply']=!![];}}}return _0x46433d;}exports[_0x91fa('0x33')]=function(_0x47bd8a,_0x4cdd67,_0x293198){var _0x1a2585={'from':getAddress(_0x4cdd67[_0x91fa('0x34')]),'firstName':getFirstName(_0x4cdd67[_0x91fa('0x34')]),'lastName':getLastName(_0x4cdd67[_0x91fa('0x34')]),'mapKey':_0x91fa('0x22'),'message':{'from':getMails(_0x47bd8a[_0x91fa('0x22')],_0x4cdd67['from']),'to':_0x47bd8a[_0x91fa('0x22')],'cc':'','subject':_0x4cdd67['subject']||'','messageId':_0x4cdd67[_0x91fa('0x35')],'inReplyTo':_0x4cdd67[_0x91fa('0x36')],'sentAt':moment(_0x4cdd67[_0x91fa('0x37')])[_0x91fa('0x28')](_0x91fa('0x38')),'attach':![],'attachments':[]}};if(!_0x4cdd67[_0x91fa('0x13')]&&!_0x4cdd67[_0x91fa('0x20')]){var _0x210657=_[_0x91fa('0x39')](_0x4cdd67[_0x91fa('0x17')],{'contentType':_0x91fa('0x3a')});if(_0x210657[_0x91fa('0xd')]){logger[_0x91fa('0x3b')](util[_0x91fa('0x28')](_0x91fa('0x3c'),_0x4cdd67['messageId']));tnef[_0x91fa('0x3d')](_[_0x91fa('0x3e')](_0x210657)[_0x91fa('0x2c')],function(_0x2b9ba9,_0x3bc598){if(_0x3bc598){_0x4cdd67[_0x91fa('0x13')]=_0x3bc598[_0x91fa('0x3f')]||_0x91fa('0x40');if(_0x3bc598[_0x91fa('0x41')]){for(var _0x3c554c=0x0;_0x3c554c<_0x3bc598[_0x91fa('0x41')][_0x91fa('0xd')];_0x3c554c++){var _0x3e3157=_0x3bc598['Attachments'][_0x3c554c];_0x1a2585[_0x91fa('0x23')][_0x91fa('0x17')][_0x91fa('0x19')]({'filename':_0x3e3157[_0x91fa('0x42')],'content':Buffer[_0x91fa('0x34')](_0x3e3157['Data'])});}}}_0x293198(parseEmail(_0x47bd8a,_0x4cdd67,_0x1a2585));});}else{_0x4cdd67[_0x91fa('0x13')]='

Empty\x20message

';_0x293198(parseEmail(_0x47bd8a,_0x4cdd67,_0x1a2585));}}else{_0x293198(parseEmail(_0x47bd8a,_0x4cdd67,_0x1a2585));}};exports[_0x91fa('0x43')]=function(_0x389ea9){switch(_0x389ea9){case _0x91fa('0x44'):return _0x91fa('0x45');case _0x91fa('0x46'):return _0x91fa('0x47');case _0x91fa('0x48'):return _0x91fa('0x49');case _0x91fa('0x4a'):return _0x91fa('0x4b');}return _0x91fa('0x4c');}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index 418b806..cafb5a4 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 _0x5559=['exports','lodash','name','Service','key','SERV','active','Imap','Smtp'];(function(_0x4c2d60,_0x92e137){var _0x29664f=function(_0x3f6fe3){while(--_0x3f6fe3){_0x4c2d60['push'](_0x4c2d60['shift']());}};_0x29664f(++_0x92e137);}(_0x5559,0x133));var _0x9555=function(_0x360b5b,_0x44188d){_0x360b5b=_0x360b5b-0x0;var _0x1b273f=_0x5559[_0x360b5b];return _0x1b273f;};'use strict';var _=require(_0x9555('0x0'));function MailAccount(_0x4ba9c1){this['id']=_0x4ba9c1['id']||0x0;this[_0x9555('0x1')]=_0x4ba9c1['name']||_0x9555('0x2');this['key']=_0x4ba9c1[_0x9555('0x3')]||_0x9555('0x4');this[_0x9555('0x5')]=_0x4ba9c1[_0x9555('0x5')]||![];this[_0x9555('0x6')]=_0x4ba9c1[_0x9555('0x6')]||[];this[_0x9555('0x7')]=_0x4ba9c1[_0x9555('0x7')]||[];}module[_0x9555('0x8')]=MailAccount; \ No newline at end of file +var _0x765e=['key','SERV','active','Imap','Smtp','exports','name','Service'];(function(_0xed9dd,_0x184eb5){var _0x2b0faf=function(_0x437e21){while(--_0x437e21){_0xed9dd['push'](_0xed9dd['shift']());}};_0x2b0faf(++_0x184eb5);}(_0x765e,0x116));var _0xe765=function(_0x5c4d7d,_0x5a6995){_0x5c4d7d=_0x5c4d7d-0x0;var _0x4f18d3=_0x765e[_0x5c4d7d];return _0x4f18d3;};'use strict';var _=require('lodash');function MailAccount(_0x5cacdb){this['id']=_0x5cacdb['id']||0x0;this[_0xe765('0x0')]=_0x5cacdb['name']||_0xe765('0x1');this['key']=_0x5cacdb[_0xe765('0x2')]||_0xe765('0x3');this[_0xe765('0x4')]=_0x5cacdb[_0xe765('0x4')]||![];this[_0xe765('0x5')]=_0x5cacdb[_0xe765('0x5')]||[];this[_0xe765('0x6')]=_0x5cacdb[_0xe765('0x6')]||[];}module[_0xe765('0x7')]=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index e1af28f..d9a360a 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 _0xa26e=['mailAccounts','mapKeys','hasOwnProperty','prototype','length','isUndefined','merge','lodash','../model/mailAccount'];(function(_0x2d4663,_0x52c0b0){var _0x1736de=function(_0xad68bb){while(--_0xad68bb){_0x2d4663['push'](_0x2d4663['shift']());}};_0x1736de(++_0x52c0b0);}(_0xa26e,0x73));var _0xea26=function(_0x3cdac5,_0x48fdfb){_0x3cdac5=_0x3cdac5-0x0;var _0x359b5a=_0xa26e[_0x3cdac5];return _0x359b5a;};'use strict';var _=require(_0xea26('0x0'));var MailAccount=require(_0xea26('0x1'));var Realtime=function(){this[_0xea26('0x2')]={};};function freeIsNotKey(_0x5b08ec,_0x448685,_0x365446){var _0x26b271=_[_0xea26('0x3')](_0x5b08ec,function(_0x20a07c,_0x2fae7d){return _0x20a07c[_0x365446];});for(var _0x251b5c in _0x448685){if(_0x448685[_0xea26('0x4')](_0x251b5c)){if(!_0x26b271[_0x251b5c]){delete _0x448685[_0x251b5c];}}}}Realtime[_0xea26('0x5')]['mergeFromDatabase']=function(_0x5ccf67,_0x58450d){for(var _0x1b4c20 in _0x58450d){if(_0x5ccf67[_0xea26('0x4')](_0x1b4c20)){_0x5ccf67[_0x1b4c20]=_0x58450d[_0x1b4c20];}}};Realtime[_0xea26('0x5')]['initMailAccounts']=function(){var _0x20cbce=this;return function(_0x18640f){if(_0x18640f){freeIsNotKey(_0x18640f,_0x20cbce[_0xea26('0x2')],'id');for(var _0x51a524=0x0,_0x520fde={},_0xc219b4={};_0x51a524<_0x18640f[_0xea26('0x6')];_0x51a524+=0x1){_0x520fde=_0x18640f[_0x51a524];if(_[_0xea26('0x7')](_0x20cbce[_0xea26('0x2')][_0x520fde['id']])){_0x20cbce[_0xea26('0x2')][_0x520fde['id']]=new MailAccount(_0x520fde);}else{_[_0xea26('0x8')](_0x20cbce[_0xea26('0x2')][_0x520fde['id']],_0x520fde);}}}return _0x20cbce['mailAccounts'];};};module['exports']=Realtime; \ No newline at end of file +var _0x3ba4=['merge','../model/mailAccount','mailAccounts','mapKeys','prototype','mergeFromDatabase','hasOwnProperty','initMailAccounts','isUndefined'];(function(_0x49c816,_0x198631){var _0x23bcac=function(_0x401cf0){while(--_0x401cf0){_0x49c816['push'](_0x49c816['shift']());}};_0x23bcac(++_0x198631);}(_0x3ba4,0xe2));var _0x43ba=function(_0x312a9d,_0x3f1830){_0x312a9d=_0x312a9d-0x0;var _0x28ab49=_0x3ba4[_0x312a9d];return _0x28ab49;};'use strict';var _=require('lodash');var MailAccount=require(_0x43ba('0x0'));var Realtime=function(){this[_0x43ba('0x1')]={};};function freeIsNotKey(_0x26d450,_0x44d364,_0x52a87b){var _0x400f12=_[_0x43ba('0x2')](_0x26d450,function(_0x3cac61,_0x200e31){return _0x3cac61[_0x52a87b];});for(var _0x73c270 in _0x44d364){if(_0x44d364['hasOwnProperty'](_0x73c270)){if(!_0x400f12[_0x73c270]){delete _0x44d364[_0x73c270];}}}}Realtime[_0x43ba('0x3')][_0x43ba('0x4')]=function(_0x524b8f,_0x1d0de3){for(var _0x2fd5aa in _0x1d0de3){if(_0x524b8f[_0x43ba('0x5')](_0x2fd5aa)){_0x524b8f[_0x2fd5aa]=_0x1d0de3[_0x2fd5aa];}}};Realtime[_0x43ba('0x3')][_0x43ba('0x6')]=function(){var _0x2eda56=this;return function(_0x3871dd){if(_0x3871dd){freeIsNotKey(_0x3871dd,_0x2eda56[_0x43ba('0x1')],'id');for(var _0x51a691=0x0,_0x384cba={},_0x489283={};_0x51a691<_0x3871dd['length'];_0x51a691+=0x1){_0x384cba=_0x3871dd[_0x51a691];if(_[_0x43ba('0x7')](_0x2eda56[_0x43ba('0x1')][_0x384cba['id']])){_0x2eda56['mailAccounts'][_0x384cba['id']]=new MailAccount(_0x384cba);}else{_[_0x43ba('0x8')](_0x2eda56['mailAccounts'][_0x384cba['id']],_0x384cba);}}}return _0x2eda56[_0x43ba('0x1')];};};module['exports']=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index 154140a..7792158 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 _0xb235=['active','key','ListId','MailServerIn','Imap','MailServerOut','getMailAccount','Request','NotifyMailAccount','GetMailAccount','name','service','email'];(function(_0x187dbd,_0x2ecf58){var _0x45d1e9=function(_0x2364c0){while(--_0x2364c0){_0x187dbd['push'](_0x187dbd['shift']());}};_0x45d1e9(++_0x2ecf58);}(_0xb235,0x10d));var _0x5b23=function(_0x348021,_0x24fc80){_0x348021=_0x348021-0x0;var _0x426682=_0xb235[_0x348021];return _0x426682;};'use strict';var client=require('../client');exports['getMailAccounts']=function(){return function(){return client['Request'](_0x5b23('0x0'),{'options':{'attributes':['id',_0x5b23('0x1'),_0x5b23('0x2'),_0x5b23('0x3'),_0x5b23('0x4'),_0x5b23('0x5'),_0x5b23('0x6'),'TemplateId'],'raw':![],'include':[{'model':_0x5b23('0x7'),'as':_0x5b23('0x8')},{'model':_0x5b23('0x9'),'as':'Smtp'}]},'log':_0x5b23('0xa')});};};exports['notify']=function(_0x5bea9e,_0x12d845){return client[_0x5b23('0xb')]('NotifyMailAccount',{'account':{'id':_0x5bea9e},'body':_0x12d845,'log':_0x5b23('0xc')});}; \ No newline at end of file +var _0xa775=['TemplateId','MailServerIn','Imap','MailServerOut','Smtp','NotifyMailAccount','../client','Request','service','email','active','key'];(function(_0x3abc15,_0x37a371){var _0x1bd739=function(_0xb04a58){while(--_0xb04a58){_0x3abc15['push'](_0x3abc15['shift']());}};_0x1bd739(++_0x37a371);}(_0xa775,0xf6));var _0x5a77=function(_0x57eb8c,_0xf522d2){_0x57eb8c=_0x57eb8c-0x0;var _0x995479=_0xa775[_0x57eb8c];return _0x995479;};'use strict';var client=require(_0x5a77('0x0'));exports['getMailAccounts']=function(){return function(){return client[_0x5a77('0x1')]('GetMailAccount',{'options':{'attributes':['id','name',_0x5a77('0x2'),_0x5a77('0x3'),_0x5a77('0x4'),_0x5a77('0x5'),'ListId',_0x5a77('0x6')],'raw':![],'include':[{'model':_0x5a77('0x7'),'as':_0x5a77('0x8')},{'model':_0x5a77('0x9'),'as':_0x5a77('0xa')}]},'log':'getMailAccount'});};};exports['notify']=function(_0x5605a3,_0x5ab155){return client[_0x5a77('0x1')](_0x5a77('0xb'),{'account':{'id':_0x5605a3},'body':_0x5ab155,'log':_0x5a77('0xb')});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index 077e054..934977e 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 _0xa231=['ShowSetting','loginMailFrequency','GetSettings','../client','Request'];(function(_0x31b90f,_0x35ef73){var _0x15653b=function(_0x3b992f){while(--_0x3b992f){_0x31b90f['push'](_0x31b90f['shift']());}};_0x15653b(++_0x35ef73);}(_0xa231,0x1b1));var _0x1a23=function(_0x1a55c5,_0x4949a8){_0x1a55c5=_0x1a55c5-0x0;var _0x5eeeb2=_0xa231[_0x1a55c5];return _0x5eeeb2;};'use strict';var client=require(_0x1a23('0x0'));exports['getSettings']=function(){return client[_0x1a23('0x1')](_0x1a23('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x1a23('0x3')]},'log':_0x1a23('0x4')});}; \ No newline at end of file +var _0x4656=['GetSettings','../client','getSettings','Request','ShowSetting'];(function(_0x12bb38,_0x3ddf67){var _0xb5de55=function(_0x4569f7){while(--_0x4569f7){_0x12bb38['push'](_0x12bb38['shift']());}};_0xb5de55(++_0x3ddf67);}(_0x4656,0x1d7));var _0x6465=function(_0x553150,_0x589ff3){_0x553150=_0x553150-0x0;var _0x18193d=_0x4656[_0x553150];return _0x18193d;};'use strict';var client=require(_0x6465('0x0'));exports[_0x6465('0x1')]=function(){return client[_0x6465('0x2')](_0x6465('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['loginMailFrequency']},'log':_0x6465('0x4')});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index 918a9ee..874d9ac 100644 --- a/server/services/email/server/index.js +++ b/server/services/email/server/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xa9e0[_0xc6be3a];return _0x56a310;};'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(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xa9e0[_0x4b7b62];return _0x2280df;};'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 f7c76f7..fd43ebc 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 _0x6d8e=['Express\x20server\x20listening\x20on\x20port\x20%d!','exports','lodash','express','ioredis','createServer','timeout','listen','port','socket.io','websocket','redis','defaults','adapter','socket.io-redis','../../config/triggers','../../config/socketio','../../config/express','default','../../routes','once','listening','log'];(function(_0x33aa12,_0x124178){var _0xed2764=function(_0x29d98a){while(--_0x29d98a){_0x33aa12['push'](_0x33aa12['shift']());}};_0xed2764(++_0x124178);}(_0x6d8e,0xe8));var _0xe6d8=function(_0x3fd712,_0x1c8adc){_0x3fd712=_0x3fd712-0x0;var _0x53a884=_0x6d8e[_0x3fd712];return _0x53a884;};'use strict';var _=require(_0xe6d8('0x0'));var http=require('http');var express=require(_0xe6d8('0x1'));var sticky=require('sticky-session');var Redis=require(_0xe6d8('0x2'));var config=require('../../config/environment');var app=express();var server=http[_0xe6d8('0x3')](app);server[_0xe6d8('0x4')]=0xdbba0;if(sticky[_0xe6d8('0x5')](server,config[_0xe6d8('0x6')])){var socketio=require(_0xe6d8('0x7'))(server,{'transports':[_0xe6d8('0x8'),'polling']});config[_0xe6d8('0x9')]=_[_0xe6d8('0xa')](config[_0xe6d8('0x9')],{'host':'localhost','port':0x18eb});socketio[_0xe6d8('0xb')](require(_0xe6d8('0xc'))({'pubClient':new Redis(config[_0xe6d8('0x9')]),'subClient':new Redis(config[_0xe6d8('0x9')])}));require(_0xe6d8('0xd'))['default']();require(_0xe6d8('0xe'))['default'](socketio);require(_0xe6d8('0xf'))[_0xe6d8('0x10')](app);require(_0xe6d8('0x11'))[_0xe6d8('0x10')](app);}else{server[_0xe6d8('0x12')](_0xe6d8('0x13'),function(){console[_0xe6d8('0x14')](_0xe6d8('0x15'),config[_0xe6d8('0x6')]);});}exports=module[_0xe6d8('0x16')]=app; \ No newline at end of file +var _0xb88e=['socket.io-redis','../../config/triggers','default','../../config/socketio','../../config/express','../../routes','exports','lodash','http','express','sticky-session','ioredis','../../config/environment','createServer','timeout','listen','port','socket.io','polling','defaults','redis','localhost','adapter'];(function(_0x1c8ba6,_0x3bff95){var _0x40831d=function(_0x134025){while(--_0x134025){_0x1c8ba6['push'](_0x1c8ba6['shift']());}};_0x40831d(++_0x3bff95);}(_0xb88e,0x177));var _0xeb88=function(_0x1fedb9,_0x1102f1){_0x1fedb9=_0x1fedb9-0x0;var _0x5a538d=_0xb88e[_0x1fedb9];return _0x5a538d;};'use strict';var _=require(_0xeb88('0x0'));var http=require(_0xeb88('0x1'));var express=require(_0xeb88('0x2'));var sticky=require(_0xeb88('0x3'));var Redis=require(_0xeb88('0x4'));var config=require(_0xeb88('0x5'));var app=express();var server=http[_0xeb88('0x6')](app);server[_0xeb88('0x7')]=0xdbba0;if(sticky[_0xeb88('0x8')](server,config[_0xeb88('0x9')])){var socketio=require(_0xeb88('0xa'))(server,{'transports':['websocket',_0xeb88('0xb')]});config['redis']=_[_0xeb88('0xc')](config[_0xeb88('0xd')],{'host':_0xeb88('0xe'),'port':0x18eb});socketio[_0xeb88('0xf')](require(_0xeb88('0x10'))({'pubClient':new Redis(config[_0xeb88('0xd')]),'subClient':new Redis(config[_0xeb88('0xd')])}));require(_0xeb88('0x11'))[_0xeb88('0x12')]();require(_0xeb88('0x13'))['default'](socketio);require(_0xeb88('0x14'))[_0xeb88('0x12')](app);require(_0xeb88('0x15'))[_0xeb88('0x12')](app);}else{server['once']('listening',function(){console['log']('Express\x20server\x20listening\x20on\x20port\x20%d!',config['port']);});}exports=module[_0xeb88('0x16')]=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index 3cf671f..6ee0684 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 _0x78aa=['../../config/logger','client','http','Request','request','then','debug','rpc','error','routing','message','bluebird'];(function(_0x507ac5,_0x33aaee){var _0x12c1bc=function(_0x5c953c){while(--_0x5c953c){_0x507ac5['push'](_0x507ac5['shift']());}};_0x12c1bc(++_0x33aaee);}(_0x78aa,0x77));var _0xa78a=function(_0x1509aa,_0x37491a){_0x1509aa=_0x1509aa-0x0;var _0x233fc5=_0x78aa[_0x1509aa];return _0x233fc5;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0xa78a('0x0'));var logger=require(_0xa78a('0x1'))('routing');var client=jayson[_0xa78a('0x2')][_0xa78a('0x3')]({'port':0x2329});client[_0xa78a('0x4')]=function(_0x2034cc,_0x2c7ab4){return new BPromise(function(_0x4b7d07,_0x1cf725){return client[_0xa78a('0x5')](_0x2034cc,_0x2c7ab4)[_0xa78a('0x6')](function(_0x49d254){logger[_0xa78a('0x7')](_0xa78a('0x8'),'routing',_0x2034cc,_0x2c7ab4,_0x49d254);if(_0x49d254[_0xa78a('0x9')]){logger[_0xa78a('0x9')](_0xa78a('0x8'),_0xa78a('0xa'),_0x2034cc,_0x49d254[_0xa78a('0x9')]['message'],_0x2c7ab4);return _0x1cf725(_0x49d254[_0xa78a('0x9')][_0xa78a('0xb')]);}else{return _0x4b7d07(_0x49d254['result']);}})['catch'](function(_0x580a1a){logger[_0xa78a('0x9')](_0xa78a('0x8'),_0xa78a('0xa'),_0x2034cc,_0x580a1a,_0x2c7ab4);return _0x1cf725(_0x580a1a);});});};module['exports']=client; \ No newline at end of file +var _0xff95=['routing','client','Request','request','then','debug','rpc','error','message','result','catch','exports','jayson/promise','bluebird','../../config/logger'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xff95,0x84));var _0x5ff9=function(_0x321277,_0x5bf550){_0x321277=_0x321277-0x0;var _0x108f9a=_0xff95[_0x321277];return _0x108f9a;};'use strict';var jayson=require(_0x5ff9('0x0'));var BPromise=require(_0x5ff9('0x1'));var logger=require(_0x5ff9('0x2'))(_0x5ff9('0x3'));var client=jayson[_0x5ff9('0x4')]['http']({'port':0x2329});client[_0x5ff9('0x5')]=function(_0x15b435,_0x1312ed){return new BPromise(function(_0x370de9,_0x9612b3){return client[_0x5ff9('0x6')](_0x15b435,_0x1312ed)[_0x5ff9('0x7')](function(_0x3ea034){logger[_0x5ff9('0x8')](_0x5ff9('0x9'),_0x5ff9('0x3'),_0x15b435,_0x1312ed,_0x3ea034);if(_0x3ea034[_0x5ff9('0xa')]){logger['error'](_0x5ff9('0x9'),_0x5ff9('0x3'),_0x15b435,_0x3ea034[_0x5ff9('0xa')]['message'],_0x1312ed);return _0x9612b3(_0x3ea034['error'][_0x5ff9('0xb')]);}else{return _0x370de9(_0x3ea034[_0x5ff9('0xc')]);}})[_0x5ff9('0xd')](function(_0x988bc9){logger[_0x5ff9('0xa')]('rpc','routing',_0x15b435,_0x988bc9,_0x1312ed);return _0x9612b3(_0x988bc9);});});};module[_0x5ff9('0xe')]=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index f5f7f03..2064cef 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 _0xcb41=['getIntervals','initIntervals','getOpenchannelQueues','getChatQueues','initSmsQueues','getMailQueues','initMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','listen','catch','bluebird','./server','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','then','getAgents','initAgents'];(function(_0x2c84e8,_0x2d67ac){var _0x20d730=function(_0x133586){while(--_0x133586){_0x2c84e8['push'](_0x2c84e8['shift']());}};_0x20d730(++_0x2d67ac);}(_0xcb41,0xdc));var _0x1cb4=function(_0x24a8f8,_0x1c3423){_0x24a8f8=_0x24a8f8-0x0;var _0x2c0878=_0xcb41[_0x24a8f8];return _0x2c0878;};'use strict';var BPromise=require(_0x1cb4('0x0'));var server=require(_0x1cb4('0x1'));var Realtime=require('./realtime');var user=require(_0x1cb4('0x2'));var interval=require(_0x1cb4('0x3'));var openchannelQueue=require(_0x1cb4('0x4'));var chatQueue=require(_0x1cb4('0x5'));var smsQueue=require(_0x1cb4('0x6'));var mailQueue=require(_0x1cb4('0x7'));var faxQueue=require(_0x1cb4('0x8'));var whatsappQueue=require(_0x1cb4('0x9'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x1cb4('0xa')]()[_0x1cb4('0xb')](user[_0x1cb4('0xc')]())[_0x1cb4('0xb')](realtime[_0x1cb4('0xd')]())[_0x1cb4('0xb')](interval[_0x1cb4('0xe')]())['then'](realtime[_0x1cb4('0xf')]())[_0x1cb4('0xb')](openchannelQueue[_0x1cb4('0x10')]())['then'](realtime['initOpenchannelQueues']())[_0x1cb4('0xb')](chatQueue[_0x1cb4('0x11')]())[_0x1cb4('0xb')](realtime['initChatQueues']())['then'](smsQueue['getSmsQueues']())[_0x1cb4('0xb')](realtime[_0x1cb4('0x12')]())[_0x1cb4('0xb')](mailQueue[_0x1cb4('0x13')]())['then'](realtime[_0x1cb4('0x14')]())[_0x1cb4('0xb')](faxQueue[_0x1cb4('0x15')]())['then'](realtime[_0x1cb4('0x16')]())[_0x1cb4('0xb')](whatsappQueue[_0x1cb4('0x17')]())['then'](realtime['initWhatsappQueues']())[_0x1cb4('0xb')](function(){return realtime;});}function main(){return server[_0x1cb4('0x18')](realtime)[_0x1cb4('0xb')](function(_0x202210){return initRealtime();})['then'](function(_0x524abf){return setInterval(initRealtime,0x1388);})[_0x1cb4('0x19')](function(_0x24709a){console['log'](_0x24709a);});}main(); \ No newline at end of file +var _0x0204=['initAgents','getIntervals','getOpenchannelQueues','initChatQueues','initSmsQueues','getMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','listen','catch','log','bluebird','./realtime','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/faxQueue','./rpc/whatsappQueue','then','getAgents'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x0204,0x198));var _0x4020=function(_0x2788fd,_0x460cd4){_0x2788fd=_0x2788fd-0x0;var _0xc86410=_0x0204[_0x2788fd];return _0xc86410;};'use strict';var BPromise=require(_0x4020('0x0'));var server=require('./server');var Realtime=require(_0x4020('0x1'));var user=require(_0x4020('0x2'));var interval=require(_0x4020('0x3'));var openchannelQueue=require(_0x4020('0x4'));var chatQueue=require(_0x4020('0x5'));var smsQueue=require('./rpc/smsQueue');var mailQueue=require('./rpc/mailQueue');var faxQueue=require(_0x4020('0x6'));var whatsappQueue=require(_0x4020('0x7'));var realtime=new Realtime();function initRealtime(){return BPromise['resolve']()[_0x4020('0x8')](user[_0x4020('0x9')]())['then'](realtime[_0x4020('0xa')]())[_0x4020('0x8')](interval[_0x4020('0xb')]())[_0x4020('0x8')](realtime['initIntervals']())[_0x4020('0x8')](openchannelQueue[_0x4020('0xc')]())[_0x4020('0x8')](realtime['initOpenchannelQueues']())[_0x4020('0x8')](chatQueue['getChatQueues']())['then'](realtime[_0x4020('0xd')]())[_0x4020('0x8')](smsQueue['getSmsQueues']())[_0x4020('0x8')](realtime[_0x4020('0xe')]())[_0x4020('0x8')](mailQueue[_0x4020('0xf')]())[_0x4020('0x8')](realtime['initMailQueues']())[_0x4020('0x8')](faxQueue[_0x4020('0x10')]())[_0x4020('0x8')](realtime[_0x4020('0x11')]())[_0x4020('0x8')](whatsappQueue[_0x4020('0x12')]())[_0x4020('0x8')](realtime['initWhatsappQueues']())[_0x4020('0x8')](function(){return realtime;});}function main(){return server[_0x4020('0x13')](realtime)[_0x4020('0x8')](function(_0x37e2e5){return initRealtime();})['then'](function(_0x510780){return setInterval(initRealtime,0x1388);})[_0x4020('0x14')](function(_0x383c0e){console[_0x4020('0x15')](_0x383c0e);});}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 29c7d4f..0432c4d 100644 --- a/server/services/routing/lib/rule-engine.js +++ b/server/services/routing/lib/rule-engine.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe14b=['next','restart','condition','noop','findRules','matches','turn','length','prioritize','priority','toJSON','map','toString','fromJSON','isString','object','register','exports','lodash','util','isNil','ignoreFactChanges','inherits','prototype','init','rules','activeRules','isArray','concat','push','sync','filter','orderBy','asc','execute','result','clone','consequence','ruleRef','name','index_','nextTick','call'];(function(_0x9f2e1b,_0x20f3e4){var _0x1ab90f=function(_0x2ae8d9){while(--_0x2ae8d9){_0x9f2e1b['push'](_0x9f2e1b['shift']());}};_0x1ab90f(++_0x20f3e4);}(_0xe14b,0x93));var _0xbe14=function(_0x3f7b20,_0x3fa430){_0x3f7b20=_0x3f7b20-0x0;var _0x340fe9=_0xe14b[_0x3f7b20];return _0x340fe9;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var EventEmitter=require('events')['EventEmitter'];function RuleEngine(_0x11c3a0,_0x36393a){this['init']();if(!_[_0xbe14('0x2')](_0x11c3a0)){this['register'](_0x11c3a0);}if(_0x36393a){this['ignoreFactChanges']=_0x36393a[_0xbe14('0x3')];}return this;}util[_0xbe14('0x4')](RuleEngine,EventEmitter);RuleEngine[_0xbe14('0x5')][_0xbe14('0x6')]=function(_0x1d9ade){this[_0xbe14('0x7')]=[];this[_0xbe14('0x8')]=[];};RuleEngine['prototype']['register']=function(_0x496063){if(Array[_0xbe14('0x9')](_0x496063)){this[_0xbe14('0x7')]=this[_0xbe14('0x7')][_0xbe14('0xa')](_0x496063);}else if(_0x496063!==null&&_['isObject'](_0x496063)){this['rules'][_0xbe14('0xb')](_0x496063);}this[_0xbe14('0xc')]();};RuleEngine['prototype'][_0xbe14('0xc')]=function(){this[_0xbe14('0x8')]=this[_0xbe14('0x7')][_0xbe14('0xd')](function(_0x27792f){if(_[_0xbe14('0x2')](_0x27792f['on'])){_0x27792f['on']=!![];}if(_0x27792f['on']===!![]){return _0x27792f;}});this[_0xbe14('0x8')]=_[_0xbe14('0xe')](this[_0xbe14('0x8')],['p'],[_0xbe14('0xf')]);};RuleEngine[_0xbe14('0x5')][_0xbe14('0x10')]=function(_0x813399,_0x530538){var _0x55b3a7=![];_0x813399[_0xbe14('0x11')]=!![];var _0x3dc4a9=_[_0xbe14('0x12')](_0x813399);var _0x37ce4e=_['clone'](_0x813399);var _0x21c789=this[_0xbe14('0x8')];var _0xfd7b8f=[];var _0x123ede=this[_0xbe14('0x3')];(function FnRuleLoop(_0x29ab73){var _0x17ae86={'rules':function(){return _0x21c789;},'rule':function(){return _0x21c789[_0x29ab73];},'when':function(_0x5ea1f8){if(_0x5ea1f8){var _0x137ee5=_0x21c789[_0x29ab73][_0xbe14('0x13')];_0x137ee5[_0xbe14('0x14')]=_0x21c789[_0x29ab73]['id']||_0x21c789[_0x29ab73][_0xbe14('0x15')]||_0xbe14('0x16')+_0x29ab73;process[_0xbe14('0x17')](function(){_0xfd7b8f['push'](_0x137ee5[_0xbe14('0x14')]);_0x137ee5[_0xbe14('0x18')](_0x3dc4a9,_0x17ae86);});}else{process[_0xbe14('0x17')](function(){_0x17ae86[_0xbe14('0x19')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x55b3a7=!![];return FnRuleLoop(0x0);},'next':function(_0x188ec4){if(!_0x123ede&&!_['isEqual'](_0x37ce4e,_0x3dc4a9)){_0x37ce4e=_[_0xbe14('0x12')](_0x3dc4a9);process['nextTick'](function(){_0x17ae86[_0xbe14('0x1a')]();});}else{process['nextTick'](function(){if(_[_0xbe14('0x2')](_0x188ec4)){return FnRuleLoop(_0x29ab73+0x1);}else{return FnRuleLoop(_0x188ec4);}});}}};if(_0x29ab73<_0x21c789['length']&&_0x55b3a7===![]){var _0x274018=_0x21c789[_0x29ab73][_0xbe14('0x1b')];_0x274018['call'](_0x3dc4a9,_0x17ae86);}else{process[_0xbe14('0x17')](function(){_0x3dc4a9['matchPath']=_0xfd7b8f;return _0x530538?_0x530538(_0x3dc4a9):_[_0xbe14('0x1c')]();});}}(0x0));};RuleEngine['prototype'][_0xbe14('0x1d')]=function(_0x5fa043){if(_[_0xbe14('0x2')](_0x5fa043)){return this[_0xbe14('0x7')];}else{var _0x15ef02=_[_0xbe14('0x1e')](_0x5fa043);return _['filter'](this[_0xbe14('0x7')],_0x15ef02);}};RuleEngine[_0xbe14('0x5')][_0xbe14('0x1f')]=function(_0x169369,_0x5dd475){var _0x16f884=_0x169369==='on'||_0x169369==='ON'?!![]:![];var _0x29fc64=this['findRules'](_0x5dd475);for(var _0x3c3613=0x0,_0x3b3e84=_0x29fc64[_0xbe14('0x20')];_0x3c3613<_0x3b3e84;_0x3c3613+=0x1){_0x29fc64[_0x3c3613]['on']=_0x16f884;}this[_0xbe14('0xc')]();};RuleEngine[_0xbe14('0x5')][_0xbe14('0x21')]=function(_0x31a664,_0x2b05cb){_0x31a664=parseInt(_0x31a664,0xa);var _0x4168c8=this[_0xbe14('0x1d')](_0x2b05cb);for(var _0x40538f=0x0,_0x3bf43c=_0x4168c8[_0xbe14('0x20')];_0x40538f<_0x3bf43c;_0x40538f+=0x1){_0x4168c8[_0x40538f][_0xbe14('0x22')]=_0x31a664;}this[_0xbe14('0xc')]();};RuleEngine[_0xbe14('0x5')][_0xbe14('0x23')]=function(){var _0x2ff48e=this[_0xbe14('0x7')];if(_0x2ff48e instanceof Array){_0x2ff48e=_0x2ff48e[_0xbe14('0x24')](function(_0x581e86){_0x581e86[_0xbe14('0x1b')]=_0x581e86['condition']['toString']();_0x581e86[_0xbe14('0x13')]=_0x581e86['consequence'][_0xbe14('0x25')]();return _0x581e86;});}else if(!_[_0xbe14('0x2')](_0x2ff48e)){_0x2ff48e['condition']=_0x2ff48e['condition']['toString']();_0x2ff48e[_0xbe14('0x13')]=_0x2ff48e[_0xbe14('0x13')]['toString']();}return _0x2ff48e;};RuleEngine[_0xbe14('0x5')][_0xbe14('0x26')]=function(_0x452635){this[_0xbe14('0x6')]();if(_[_0xbe14('0x27')](_0x452635)){_0x452635=JSON['parse'](_0x452635);}if(_0x452635 instanceof Array){_0x452635=_0x452635['map'](function(_0x15a997){_0x15a997['condition']=eval('('+_0x15a997['condition']+')');_0x15a997['consequence']=eval('('+_0x15a997[_0xbe14('0x13')]+')');return _0x15a997;});}else if(_0x452635!==null&&typeof _0x452635==_0xbe14('0x28')){_0x452635[_0xbe14('0x1b')]=eval('('+_0x452635[_0xbe14('0x1b')]+')');_0x452635[_0xbe14('0x13')]=eval('('+_0x452635[_0xbe14('0x13')]+')');}this[_0xbe14('0x29')](_0x452635);};module[_0xbe14('0x2a')]=RuleEngine; \ No newline at end of file +var _0xc4aa=['ruleRef','name','nextTick','push','call','next','isEqual','restart','isNil','length','condition','matchPath','noop','findRules','matches','turn','prioritize','priority','toJSON','toString','fromJSON','isString','parse','register','exports','lodash','util','events','EventEmitter','ignoreFactChanges','inherits','prototype','init','rules','activeRules','isArray','concat','isObject','sync','filter','orderBy','asc','execute','result','clone','consequence'];(function(_0x355ced,_0x409173){var _0x5ba67a=function(_0x3fe3bb){while(--_0x3fe3bb){_0x355ced['push'](_0x355ced['shift']());}};_0x5ba67a(++_0x409173);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0xc4aa[_0x465a0c];return _0x1e202e;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var EventEmitter=require(_0xac4a('0x2'))[_0xac4a('0x3')];function RuleEngine(_0x275161,_0x22469d){this['init']();if(!_['isNil'](_0x275161)){this['register'](_0x275161);}if(_0x22469d){this[_0xac4a('0x4')]=_0x22469d[_0xac4a('0x4')];}return this;}util[_0xac4a('0x5')](RuleEngine,EventEmitter);RuleEngine[_0xac4a('0x6')][_0xac4a('0x7')]=function(_0x15cd34){this[_0xac4a('0x8')]=[];this[_0xac4a('0x9')]=[];};RuleEngine['prototype']['register']=function(_0x1aba6d){if(Array[_0xac4a('0xa')](_0x1aba6d)){this[_0xac4a('0x8')]=this['rules'][_0xac4a('0xb')](_0x1aba6d);}else if(_0x1aba6d!==null&&_[_0xac4a('0xc')](_0x1aba6d)){this[_0xac4a('0x8')]['push'](_0x1aba6d);}this[_0xac4a('0xd')]();};RuleEngine['prototype'][_0xac4a('0xd')]=function(){this['activeRules']=this[_0xac4a('0x8')][_0xac4a('0xe')](function(_0x24291d){if(_['isNil'](_0x24291d['on'])){_0x24291d['on']=!![];}if(_0x24291d['on']===!![]){return _0x24291d;}});this[_0xac4a('0x9')]=_[_0xac4a('0xf')](this[_0xac4a('0x9')],['p'],[_0xac4a('0x10')]);};RuleEngine[_0xac4a('0x6')][_0xac4a('0x11')]=function(_0x34bc01,_0x33c287){var _0x190418=![];_0x34bc01[_0xac4a('0x12')]=!![];var _0x11e101=_[_0xac4a('0x13')](_0x34bc01);var _0x4a2119=_[_0xac4a('0x13')](_0x34bc01);var _0x34d797=this[_0xac4a('0x9')];var _0x144553=[];var _0x3e88e3=this[_0xac4a('0x4')];(function FnRuleLoop(_0x28e304){var _0x44ec59={'rules':function(){return _0x34d797;},'rule':function(){return _0x34d797[_0x28e304];},'when':function(_0x546c5d){if(_0x546c5d){var _0x5ac21e=_0x34d797[_0x28e304][_0xac4a('0x14')];_0x5ac21e[_0xac4a('0x15')]=_0x34d797[_0x28e304]['id']||_0x34d797[_0x28e304][_0xac4a('0x16')]||'index_'+_0x28e304;process[_0xac4a('0x17')](function(){_0x144553[_0xac4a('0x18')](_0x5ac21e[_0xac4a('0x15')]);_0x5ac21e[_0xac4a('0x19')](_0x11e101,_0x44ec59);});}else{process[_0xac4a('0x17')](function(){_0x44ec59[_0xac4a('0x1a')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x190418=!![];return FnRuleLoop(0x0);},'next':function(_0xe38996){if(!_0x3e88e3&&!_[_0xac4a('0x1b')](_0x4a2119,_0x11e101)){_0x4a2119=_['clone'](_0x11e101);process[_0xac4a('0x17')](function(){_0x44ec59[_0xac4a('0x1c')]();});}else{process['nextTick'](function(){if(_[_0xac4a('0x1d')](_0xe38996)){return FnRuleLoop(_0x28e304+0x1);}else{return FnRuleLoop(_0xe38996);}});}}};if(_0x28e304<_0x34d797[_0xac4a('0x1e')]&&_0x190418===![]){var _0x3eacd3=_0x34d797[_0x28e304][_0xac4a('0x1f')];_0x3eacd3['call'](_0x11e101,_0x44ec59);}else{process[_0xac4a('0x17')](function(){_0x11e101[_0xac4a('0x20')]=_0x144553;return _0x33c287?_0x33c287(_0x11e101):_[_0xac4a('0x21')]();});}}(0x0));};RuleEngine[_0xac4a('0x6')][_0xac4a('0x22')]=function(_0x2b0dc2){if(_[_0xac4a('0x1d')](_0x2b0dc2)){return this[_0xac4a('0x8')];}else{var _0x3e2c69=_[_0xac4a('0x23')](_0x2b0dc2);return _[_0xac4a('0xe')](this[_0xac4a('0x8')],_0x3e2c69);}};RuleEngine[_0xac4a('0x6')][_0xac4a('0x24')]=function(_0x1c13dc,_0x20202c){var _0x4e17ce=_0x1c13dc==='on'||_0x1c13dc==='ON'?!![]:![];var _0x23b061=this[_0xac4a('0x22')](_0x20202c);for(var _0x42a33c=0x0,_0x2772fe=_0x23b061[_0xac4a('0x1e')];_0x42a33c<_0x2772fe;_0x42a33c+=0x1){_0x23b061[_0x42a33c]['on']=_0x4e17ce;}this['sync']();};RuleEngine['prototype'][_0xac4a('0x25')]=function(_0x7a948b,_0x1f12d5){_0x7a948b=parseInt(_0x7a948b,0xa);var _0x546b65=this['findRules'](_0x1f12d5);for(var _0x355755=0x0,_0x2896bc=_0x546b65[_0xac4a('0x1e')];_0x355755<_0x2896bc;_0x355755+=0x1){_0x546b65[_0x355755][_0xac4a('0x26')]=_0x7a948b;}this[_0xac4a('0xd')]();};RuleEngine['prototype'][_0xac4a('0x27')]=function(){var _0x482afc=this[_0xac4a('0x8')];if(_0x482afc instanceof Array){_0x482afc=_0x482afc['map'](function(_0x17e6de){_0x17e6de[_0xac4a('0x1f')]=_0x17e6de[_0xac4a('0x1f')][_0xac4a('0x28')]();_0x17e6de[_0xac4a('0x14')]=_0x17e6de[_0xac4a('0x14')][_0xac4a('0x28')]();return _0x17e6de;});}else if(!_[_0xac4a('0x1d')](_0x482afc)){_0x482afc[_0xac4a('0x1f')]=_0x482afc[_0xac4a('0x1f')][_0xac4a('0x28')]();_0x482afc[_0xac4a('0x14')]=_0x482afc[_0xac4a('0x14')][_0xac4a('0x28')]();}return _0x482afc;};RuleEngine['prototype'][_0xac4a('0x29')]=function(_0x1c41fb){this['init']();if(_[_0xac4a('0x2a')](_0x1c41fb)){_0x1c41fb=JSON[_0xac4a('0x2b')](_0x1c41fb);}if(_0x1c41fb instanceof Array){_0x1c41fb=_0x1c41fb['map'](function(_0x58804b){_0x58804b[_0xac4a('0x1f')]=eval('('+_0x58804b[_0xac4a('0x1f')]+')');_0x58804b[_0xac4a('0x14')]=eval('('+_0x58804b[_0xac4a('0x14')]+')');return _0x58804b;});}else if(_0x1c41fb!==null&&typeof _0x1c41fb=='object'){_0x1c41fb[_0xac4a('0x1f')]=eval('('+_0x1c41fb[_0xac4a('0x1f')]+')');_0x1c41fb['consequence']=eval('('+_0x1c41fb[_0xac4a('0x14')]+')');}this[_0xac4a('0x2c')](_0x1c41fb);};module[_0xac4a('0x2d')]=RuleEngine; \ No newline at end of file diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index 7b8a015..ddc4131 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 _0x936d=['jayson/promise','client','http','request','error','message','SendMail','bluebird'];(function(_0x48c7ea,_0x131737){var _0x474c83=function(_0x150c86){while(--_0x150c86){_0x48c7ea['push'](_0x48c7ea['shift']());}};_0x474c83(++_0x131737);}(_0x936d,0x7f));var _0xd936=function(_0x51323f,_0x3e44ee){_0x51323f=_0x51323f-0x0;var _0x4eeb0f=_0x936d[_0x51323f];return _0x4eeb0f;};'use strict';var BPromise=require(_0xd936('0x0'));var jayson=require(_0xd936('0x1'));var client=jayson[_0xd936('0x2')][_0xd936('0x3')]({'port':0x232b});function request(_0x4bf979,_0x7a39da){return new BPromise(function(_0x491796,_0x5d7848){return client[_0xd936('0x4')](_0x4bf979,_0x7a39da)['then'](function(_0x4bade7){if(_0x4bade7[_0xd936('0x5')]){return _0x5d7848(_0x4bade7[_0xd936('0x5')][_0xd936('0x6')]);}else{return _0x491796(_0x4bade7['result']);}})['catch'](function(_0x1f6887){return _0x5d7848(_0x1f6887);});});}exports['sendMailMessage']=function(_0x3c6829,_0x3dcfd0){return request(_0xd936('0x7'),{'account':_0x3c6829,'message':_0x3dcfd0});}; \ No newline at end of file +var _0x5a4d=['catch','sendMailMessage','SendMail','client','http','request','then','error','message','result'];(function(_0x2e36a7,_0x4f0cf6){var _0x1b1645=function(_0x13dc0f){while(--_0x13dc0f){_0x2e36a7['push'](_0x2e36a7['shift']());}};_0x1b1645(++_0x4f0cf6);}(_0x5a4d,0x19d));var _0xd5a4=function(_0x4a9af0,_0x5916bf){_0x4a9af0=_0x4a9af0-0x0;var _0xeeb194=_0x5a4d[_0x4a9af0];return _0xeeb194;};'use strict';var BPromise=require('bluebird');var jayson=require('jayson/promise');var client=jayson[_0xd5a4('0x0')][_0xd5a4('0x1')]({'port':0x232b});function request(_0x194fb2,_0x5096c8){return new BPromise(function(_0xbf7754,_0x3e0e5d){return client[_0xd5a4('0x2')](_0x194fb2,_0x5096c8)[_0xd5a4('0x3')](function(_0x37e6fa){if(_0x37e6fa[_0xd5a4('0x4')]){return _0x3e0e5d(_0x37e6fa[_0xd5a4('0x4')][_0xd5a4('0x5')]);}else{return _0xbf7754(_0x37e6fa[_0xd5a4('0x6')]);}})[_0xd5a4('0x7')](function(_0x1f9775){return _0x3e0e5d(_0x1f9775);});});}exports[_0xd5a4('0x8')]=function(_0x22bb79,_0x50a400){return request(_0xd5a4('0x9'),{'account':_0x22bb79,'message':_0x50a400});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index 5140731..a61dfee 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 _0x94df=['mailStatus','mailStatusTime','mailCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsCapacity','smsCurrentCapacity','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','updateRealtime','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','working','idle','mail','chat','openchannel','fax','sms','whatsapp','length','Status','StatusTime','toNumber','chatCapacity','mailCurrentCapacity','whatsappStatus','whatsappStatusTime','stringify','exports','lodash','moment','md5','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCurrentCapacity'];(function(_0xc939ce,_0x5d6dd6){var _0x436094=function(_0x38b05c){while(--_0x38b05c){_0xc939ce['push'](_0xc939ce['shift']());}};_0x436094(++_0x5d6dd6);}(_0x94df,0xa3));var _0xf94d=function(_0x5d6486,_0x33a779){_0x5d6486=_0x5d6486-0x0;var _0x45b894=_0x94df[_0x5d6486];return _0x45b894;};'use strict';var _=require(_0xf94d('0x0'));var moment=require(_0xf94d('0x1'));var md5=require(_0xf94d('0x2'));var Redis=require(_0xf94d('0x3'));var config=require(_0xf94d('0x4'));config[_0xf94d('0x5')]=_['defaults'](config[_0xf94d('0x5')],{'host':_0xf94d('0x6'),'port':0x18eb});var io=require(_0xf94d('0x7'))(new Redis(config[_0xf94d('0x5')]));function Agent(_0x4af826){this['id']=_0x4af826['id']||0x0;this[_0xf94d('0x8')]=_0x4af826[_0xf94d('0x8')]||'';this[_0xf94d('0x9')]=_0x4af826[_0xf94d('0x9')]||!![];this[_0xf94d('0xa')]=_0x4af826[_0xf94d('0xa')]||![];this['chatPause']=_0x4af826[_0xf94d('0xb')]||![];this[_0xf94d('0xc')]=_0x4af826[_0xf94d('0xc')]||![];this[_0xf94d('0xd')]=_0x4af826[_0xf94d('0xd')]||![];this[_0xf94d('0xe')]=_0x4af826['smsPause']||![];this[_0xf94d('0xf')]=_0x4af826[_0xf94d('0xf')]||![];this[_0xf94d('0x10')]=_0xf94d('0x11');this[_0xf94d('0x12')]=0x0;this['chatCapacity']=_0x4af826['chatCapacity']||0x0;this[_0xf94d('0x13')]=0x0;this[_0xf94d('0x14')]=_0xf94d('0x11');this[_0xf94d('0x15')]=0x0;this[_0xf94d('0x16')]=_0x4af826[_0xf94d('0x16')]||0x0;this['mailCurrentCapacity']=0x0;this[_0xf94d('0x17')]=_0xf94d('0x11');this[_0xf94d('0x18')]=0x0;this[_0xf94d('0x19')]=_0x4af826[_0xf94d('0x19')]||0x0;this[_0xf94d('0x1a')]=0x0;this[_0xf94d('0x1b')]=_0xf94d('0x11');this['smsStatusTime']=0x0;this[_0xf94d('0x1c')]=_0x4af826['smsCapacity']||0x0;this[_0xf94d('0x1d')]=0x0;this['whatsappStatus']=_0xf94d('0x11');this['whatsappStatusTime']=0x0;this[_0xf94d('0x1e')]=_0x4af826[_0xf94d('0x1e')]||0x0;this[_0xf94d('0x1f')]=0x0;this[_0xf94d('0x20')]='unknown';this[_0xf94d('0x21')]=0x0;this['openchannelCapacity']=_0x4af826[_0xf94d('0x22')]||0x0;this[_0xf94d('0x23')]=0x0;this[_0xf94d('0x24')]=![];this[_0xf94d('0x25')]=undefined;this['md5']='';this[_0xf94d('0x26')]();}Agent['prototype'][_0xf94d('0x27')]=function(_0x1fa6bf){if(this[_0x1fa6bf+_0xf94d('0x28')]>0x0){if(this[_0x1fa6bf+'Capacity']>0x0&&this[_0x1fa6bf+_0xf94d('0x28')]>=this[_0x1fa6bf+_0xf94d('0x29')]){return _0xf94d('0x2a');}else{return _0xf94d('0x2b');}}else{return _0xf94d('0x2c');}};Agent['prototype'][_0xf94d('0x26')]=function(){var _0x51f7f8=[_0xf94d('0x2d'),_0xf94d('0x2e'),_0xf94d('0x2f'),_0xf94d('0x30'),_0xf94d('0x31'),_0xf94d('0x32')];for(var _0x2804dc=0x0;_0x2804dc<_0x51f7f8[_0xf94d('0x33')];_0x2804dc+=0x1){var _0x3c9fe3=this[_0xf94d('0x27')](_0x51f7f8[_0x2804dc]);if(this[_0x51f7f8[_0x2804dc]+_0xf94d('0x34')]!==_0x3c9fe3){this[_0x51f7f8[_0x2804dc]+_0xf94d('0x35')]=_[_0xf94d('0x36')](moment()['format']('x'));}this[_0x51f7f8[_0x2804dc]+'Status']=_0x3c9fe3;}var _0x55a7de={'id':this['id'],'name':this['name'],'online':this[_0xf94d('0x9')],'voicePause':this[_0xf94d('0xa')],'chatPause':this['chatPause'],'mailPause':this[_0xf94d('0xc')],'smsPause':this[_0xf94d('0xe')],'faxPause':this[_0xf94d('0xd')],'openchannelPause':this['openchannelPause'],'chatStatus':this[_0xf94d('0x10')],'chatStatusTime':this['chatStatusTime'],'chatCapacity':this[_0xf94d('0x37')],'chatCurrentCapacity':this[_0xf94d('0x13')],'mailStatus':this['mailStatus'],'mailStatusTime':this[_0xf94d('0x15')],'mailCapacity':this['mailCapacity'],'mailCurrentCapacity':this[_0xf94d('0x38')],'faxStatus':this['faxStatus'],'faxStatusTime':this['faxStatusTime'],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this[_0xf94d('0x1a')],'smsStatus':this[_0xf94d('0x1b')],'smsStatusTime':this['smsStatusTime'],'smsCapacity':this[_0xf94d('0x1c')],'smsCurrentCapacity':this['smsCurrentCapacity'],'whatsappStatus':this[_0xf94d('0x39')],'whatsappStatusTime':this[_0xf94d('0x3a')],'whatsappCapacity':this['whatsappCapacity'],'whatsappCurrentCapacity':this[_0xf94d('0x1f')],'openchannelStatus':this['openchannelStatus'],'openchannelStatusTime':this[_0xf94d('0x21')],'openchannelCapacity':this['openchannelCapacity'],'openchannelCurrentCapacity':this[_0xf94d('0x23')],'busy':this['busy'],'busyQueue':this[_0xf94d('0x25')]};var _0x1ada36=md5(JSON[_0xf94d('0x3b')](_0x55a7de));if(this[_0xf94d('0x2')]!==_0x1ada36){this['md5']=_0x1ada36;io['emit']('user:save',_0x55a7de);}};module[_0xf94d('0x3c')]=Agent; \ No newline at end of file +var _0x6de8=['openchannelCurrentCapacity','prototype','getChannelStatus','Capacity','CurrentCapacity','maxcapacity','working','idle','updateRealtime','chat','fax','whatsapp','length','StatusTime','toNumber','format','mailCurrentCapacity','faxStatus','faxCurrentCapacity','smsStatusTime','openchannelCapacity','busy','busyQueue','stringify','emit','user:save','exports','lodash','md5','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','faxCapacity','smsStatus','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime'];(function(_0x4baae2,_0x487ab6){var _0x1a2285=function(_0x1cea47){while(--_0x1cea47){_0x4baae2['push'](_0x4baae2['shift']());}};_0x1a2285(++_0x487ab6);}(_0x6de8,0x183));var _0x86de=function(_0x21de89,_0x367053){_0x21de89=_0x21de89-0x0;var _0x290b7e=_0x6de8[_0x21de89];return _0x290b7e;};'use strict';var _=require(_0x86de('0x0'));var moment=require('moment');var md5=require(_0x86de('0x1'));var Redis=require(_0x86de('0x2'));var config=require(_0x86de('0x3'));config['redis']=_['defaults'](config[_0x86de('0x4')],{'host':_0x86de('0x5'),'port':0x18eb});var io=require(_0x86de('0x6'))(new Redis(config[_0x86de('0x4')]));function Agent(_0x13d0dd){this['id']=_0x13d0dd['id']||0x0;this[_0x86de('0x7')]=_0x13d0dd[_0x86de('0x7')]||'';this[_0x86de('0x8')]=_0x13d0dd['online']||!![];this[_0x86de('0x9')]=_0x13d0dd[_0x86de('0x9')]||![];this[_0x86de('0xa')]=_0x13d0dd[_0x86de('0xa')]||![];this[_0x86de('0xb')]=_0x13d0dd[_0x86de('0xb')]||![];this['faxPause']=_0x13d0dd[_0x86de('0xc')]||![];this[_0x86de('0xd')]=_0x13d0dd[_0x86de('0xd')]||![];this[_0x86de('0xe')]=_0x13d0dd[_0x86de('0xe')]||![];this[_0x86de('0xf')]=_0x86de('0x10');this[_0x86de('0x11')]=0x0;this['chatCapacity']=_0x13d0dd[_0x86de('0x12')]||0x0;this[_0x86de('0x13')]=0x0;this[_0x86de('0x14')]=_0x86de('0x10');this[_0x86de('0x15')]=0x0;this['mailCapacity']=_0x13d0dd[_0x86de('0x16')]||0x0;this['mailCurrentCapacity']=0x0;this['faxStatus']=_0x86de('0x10');this['faxStatusTime']=0x0;this[_0x86de('0x17')]=_0x13d0dd['faxCapacity']||0x0;this['faxCurrentCapacity']=0x0;this[_0x86de('0x18')]='unknown';this['smsStatusTime']=0x0;this[_0x86de('0x19')]=_0x13d0dd[_0x86de('0x19')]||0x0;this[_0x86de('0x1a')]=0x0;this[_0x86de('0x1b')]=_0x86de('0x10');this[_0x86de('0x1c')]=0x0;this[_0x86de('0x1d')]=_0x13d0dd[_0x86de('0x1d')]||0x0;this[_0x86de('0x1e')]=0x0;this[_0x86de('0x1f')]='unknown';this[_0x86de('0x20')]=0x0;this['openchannelCapacity']=_0x13d0dd['openchannelCapacity']||0x0;this[_0x86de('0x21')]=0x0;this['busy']=![];this['busyQueue']=undefined;this[_0x86de('0x1')]='';this['updateRealtime']();}Agent[_0x86de('0x22')][_0x86de('0x23')]=function(_0x7afea6){if(this[_0x7afea6+'CurrentCapacity']>0x0){if(this[_0x7afea6+_0x86de('0x24')]>0x0&&this[_0x7afea6+_0x86de('0x25')]>=this[_0x7afea6+'Capacity']){return _0x86de('0x26');}else{return _0x86de('0x27');}}else{return _0x86de('0x28');}};Agent['prototype'][_0x86de('0x29')]=function(){var _0x31c941=['mail',_0x86de('0x2a'),'openchannel',_0x86de('0x2b'),'sms',_0x86de('0x2c')];for(var _0x2d10a4=0x0;_0x2d10a4<_0x31c941[_0x86de('0x2d')];_0x2d10a4+=0x1){var _0x239e5b=this[_0x86de('0x23')](_0x31c941[_0x2d10a4]);if(this[_0x31c941[_0x2d10a4]+'Status']!==_0x239e5b){this[_0x31c941[_0x2d10a4]+_0x86de('0x2e')]=_[_0x86de('0x2f')](moment()[_0x86de('0x30')]('x'));}this[_0x31c941[_0x2d10a4]+'Status']=_0x239e5b;}var _0x5404a3={'id':this['id'],'name':this[_0x86de('0x7')],'online':this['online'],'voicePause':this[_0x86de('0x9')],'chatPause':this[_0x86de('0xa')],'mailPause':this['mailPause'],'smsPause':this['smsPause'],'faxPause':this[_0x86de('0xc')],'openchannelPause':this[_0x86de('0xe')],'chatStatus':this[_0x86de('0xf')],'chatStatusTime':this[_0x86de('0x11')],'chatCapacity':this[_0x86de('0x12')],'chatCurrentCapacity':this[_0x86de('0x13')],'mailStatus':this['mailStatus'],'mailStatusTime':this[_0x86de('0x15')],'mailCapacity':this[_0x86de('0x16')],'mailCurrentCapacity':this[_0x86de('0x31')],'faxStatus':this[_0x86de('0x32')],'faxStatusTime':this['faxStatusTime'],'faxCapacity':this[_0x86de('0x17')],'faxCurrentCapacity':this[_0x86de('0x33')],'smsStatus':this[_0x86de('0x18')],'smsStatusTime':this[_0x86de('0x34')],'smsCapacity':this[_0x86de('0x19')],'smsCurrentCapacity':this[_0x86de('0x1a')],'whatsappStatus':this[_0x86de('0x1b')],'whatsappStatusTime':this['whatsappStatusTime'],'whatsappCapacity':this[_0x86de('0x1d')],'whatsappCurrentCapacity':this[_0x86de('0x1e')],'openchannelStatus':this[_0x86de('0x1f')],'openchannelStatusTime':this[_0x86de('0x20')],'openchannelCapacity':this[_0x86de('0x35')],'openchannelCurrentCapacity':this[_0x86de('0x21')],'busy':this[_0x86de('0x36')],'busyQueue':this[_0x86de('0x37')]};var _0xb7d063=md5(JSON[_0x86de('0x38')](_0x5404a3));if(this[_0x86de('0x1')]!==_0xb7d063){this[_0x86de('0x1')]=_0xb7d063;io[_0x86de('0x39')](_0x86de('0x3a'),_0x5404a3);}};module[_0x86de('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 fc20d4f..86ef8ef 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 _0xa6c8=['localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting','updateRealtime','prototype','mapAgentsId','map','loggedIn','length','online','chatPause','paused','available','stringify','format','chat:queue:%s','emit','chat_queue:save','exports','lodash','md5','util','../../../config/environment','redis'];(function(_0x25bea7,_0x49ab45){var _0x175952=function(_0x56a0b5){while(--_0x56a0b5){_0x25bea7['push'](_0x25bea7['shift']());}};_0x175952(++_0x49ab45);}(_0xa6c8,0x19f));var _0x8a6c=function(_0x2f3b0d,_0x467a37){_0x2f3b0d=_0x2f3b0d-0x0;var _0x37af64=_0xa6c8[_0x2f3b0d];return _0x37af64;};'use strict';var _=require(_0x8a6c('0x0'));var md5=require(_0x8a6c('0x1'));var util=require(_0x8a6c('0x2'));var Redis=require('ioredis');var config=require(_0x8a6c('0x3'));config[_0x8a6c('0x4')]=_['defaults'](config[_0x8a6c('0x4')],{'host':_0x8a6c('0x5'),'port':0x18eb});var io=require(_0x8a6c('0x6'))(new Redis(config['redis']));function ChatQueue(_0x3ea5c7){this['id']=_0x3ea5c7['id']||0x0;this[_0x8a6c('0x7')]=_0x3ea5c7[_0x8a6c('0x7')]||'';this['timeout']=_0x3ea5c7[_0x8a6c('0x8')]||0xa;this[_0x8a6c('0x9')]=_0x3ea5c7[_0x8a6c('0x9')]||_0x8a6c('0xa');this['Agents']=_0x3ea5c7[_0x8a6c('0xb')];this['mapAgentsId']={};this[_0x8a6c('0xc')]=0x0;this[_0x8a6c('0x1')]='';this[_0x8a6c('0xd')]();this[_0x8a6c('0xe')]();}ChatQueue[_0x8a6c('0xf')][_0x8a6c('0xd')]=function(){var _0x3c1973=this[_0x8a6c('0x10')]['_rr'];this[_0x8a6c('0x10')]=_[_0x8a6c('0x11')](this[_0x8a6c('0xb')],'id');this[_0x8a6c('0x10')]['_rr']=_0x3c1973;};ChatQueue['prototype']['updateRealtime']=function(){this[_0x8a6c('0x12')]=0x0;this['paused']=0x0;for(var _0x18f6b3=0x0;_0x18f6b3=0x0?this[_0x8a6c('0x17')]:0x0;var _0x48e302={'id':this['id'],'available':this[_0x8a6c('0x17')],'loggedIn':this[_0x8a6c('0x12')],'name':this[_0x8a6c('0x7')],'paused':this[_0x8a6c('0x16')],'waiting':this[_0x8a6c('0xc')]};var _0x4d5361=md5(JSON[_0x8a6c('0x18')](_0x48e302));if(this['md5']!==_0x4d5361){this[_0x8a6c('0x1')]=_0x4d5361;io['to'](util[_0x8a6c('0x19')](_0x8a6c('0x1a'),_0x48e302['name']))[_0x8a6c('0x1b')](_0x8a6c('0x1c'),_0x48e302);}};module[_0x8a6c('0x1d')]=ChatQueue; \ No newline at end of file +var _0x83c2=['chatPause','paused','available','stringify','format','chat:queue:%s','emit','chat_queue:save','exports','lodash','md5','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRealtime','_rr','map','prototype','loggedIn'];(function(_0xd9c21f,_0x1de51c){var _0x667032=function(_0x340b16){while(--_0x340b16){_0xd9c21f['push'](_0xd9c21f['shift']());}};_0x667032(++_0x1de51c);}(_0x83c2,0xe1));var _0x283c=function(_0x16db8b,_0xca7d28){_0x16db8b=_0x16db8b-0x0;var _0x5ba017=_0x83c2[_0x16db8b];return _0x5ba017;};'use strict';var _=require(_0x283c('0x0'));var md5=require(_0x283c('0x1'));var util=require('util');var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x283c('0x2')]=_[_0x283c('0x3')](config[_0x283c('0x2')],{'host':_0x283c('0x4'),'port':0x18eb});var io=require(_0x283c('0x5'))(new Redis(config[_0x283c('0x2')]));function ChatQueue(_0x125f5d){this['id']=_0x125f5d['id']||0x0;this[_0x283c('0x6')]=_0x125f5d[_0x283c('0x6')]||'';this[_0x283c('0x7')]=_0x125f5d[_0x283c('0x7')]||0xa;this[_0x283c('0x8')]=_0x125f5d[_0x283c('0x8')]||_0x283c('0x9');this[_0x283c('0xa')]=_0x125f5d[_0x283c('0xa')];this[_0x283c('0xb')]={};this[_0x283c('0xc')]=0x0;this[_0x283c('0x1')]='';this['updateRouting']();this[_0x283c('0xd')]();}ChatQueue['prototype']['updateRouting']=function(){var _0x176f6e=this[_0x283c('0xb')][_0x283c('0xe')];this['mapAgentsId']=_[_0x283c('0xf')](this[_0x283c('0xa')],'id');this['mapAgentsId'][_0x283c('0xe')]=_0x176f6e;};ChatQueue[_0x283c('0x10')][_0x283c('0xd')]=function(){this[_0x283c('0x11')]=0x0;this['paused']=0x0;for(var _0x24ab1b=0x0;_0x24ab1b=0x0?this[_0x283c('0x14')]:0x0;var _0x3221f4={'id':this['id'],'available':this[_0x283c('0x14')],'loggedIn':this['loggedIn'],'name':this[_0x283c('0x6')],'paused':this[_0x283c('0x13')],'waiting':this[_0x283c('0xc')]};var _0x391036=md5(JSON[_0x283c('0x15')](_0x3221f4));if(this[_0x283c('0x1')]!==_0x391036){this['md5']=_0x391036;io['to'](util[_0x283c('0x16')](_0x283c('0x17'),_0x3221f4[_0x283c('0x6')]))[_0x283c('0x18')](_0x283c('0x19'),_0x3221f4);}};module[_0x283c('0x1a')]=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index 566dddd..18f9a46 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 _0xcbb8=['name','timeout','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','map','_rr','loggedIn','paused','online','available','stringify','format','fax:queue:%s','emit','fax_queue:save','exports','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter'];(function(_0x5f36cd,_0x37d4c9){var _0x49832a=function(_0xa82985){while(--_0xa82985){_0x5f36cd['push'](_0x5f36cd['shift']());}};_0x49832a(++_0x37d4c9);}(_0xcbb8,0x11a));var _0x8cbb=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0xcbb8[_0xc4001c];return _0x49f7bc;};'use strict';var _=require('lodash');var md5=require(_0x8cbb('0x0'));var util=require(_0x8cbb('0x1'));var Redis=require(_0x8cbb('0x2'));var config=require(_0x8cbb('0x3'));config[_0x8cbb('0x4')]=_[_0x8cbb('0x5')](config['redis'],{'host':_0x8cbb('0x6'),'port':0x18eb});var io=require(_0x8cbb('0x7'))(new Redis(config['redis']));function FaxQueue(_0x363273){this['id']=_0x363273['id']||0x0;this[_0x8cbb('0x8')]=_0x363273[_0x8cbb('0x8')]||'';this[_0x8cbb('0x9')]=_0x363273[_0x8cbb('0x9')]||0xa;this['strategy']=_0x363273['strategy']||_0x8cbb('0xa');this[_0x8cbb('0xb')]=_0x363273[_0x8cbb('0xb')];this[_0x8cbb('0xc')]={};this[_0x8cbb('0xd')]=0x0;this['md5']='';this[_0x8cbb('0xe')]();this[_0x8cbb('0xf')]();}FaxQueue[_0x8cbb('0x10')]['updateRouting']=function(){var _0x3c349b=this[_0x8cbb('0xc')]['_rr'];this[_0x8cbb('0xc')]=_[_0x8cbb('0x11')](this[_0x8cbb('0xb')],'id');this[_0x8cbb('0xc')][_0x8cbb('0x12')]=_0x3c349b;};FaxQueue[_0x8cbb('0x10')][_0x8cbb('0xf')]=function(){this[_0x8cbb('0x13')]=0x0;this[_0x8cbb('0x14')]=0x0;for(var _0x458e3a=0x0;_0x458e3a=0x0?this[_0x8cbb('0x16')]:0x0;var _0x43779b={'id':this['id'],'available':this[_0x8cbb('0x16')],'loggedIn':this[_0x8cbb('0x13')],'name':this[_0x8cbb('0x8')],'paused':this[_0x8cbb('0x14')],'waiting':this[_0x8cbb('0xd')]};var _0x2d2aa6=md5(JSON[_0x8cbb('0x17')](_0x43779b));if(this[_0x8cbb('0x0')]!==_0x2d2aa6){this[_0x8cbb('0x0')]=_0x2d2aa6;io['to'](util[_0x8cbb('0x18')](_0x8cbb('0x19'),_0x43779b['name']))[_0x8cbb('0x1a')](_0x8cbb('0x1b'),_0x43779b);}};module[_0x8cbb('0x1c')]=FaxQueue; \ No newline at end of file +var _0xb9ed=['strategy','beepall','Agents','updateRouting','mapAgentsId','_rr','map','prototype','updateRealtime','loggedIn','paused','length','available','waiting','stringify','format','emit','fax_queue:save','exports','md5','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout'];(function(_0x1abf3a,_0x30a018){var _0x46ac24=function(_0x4a7320){while(--_0x4a7320){_0x1abf3a['push'](_0x1abf3a['shift']());}};_0x46ac24(++_0x30a018);}(_0xb9ed,0x13c));var _0xdb9e=function(_0xf87884,_0xe57ae){_0xf87884=_0xf87884-0x0;var _0x3ae85a=_0xb9ed[_0xf87884];return _0x3ae85a;};'use strict';var _=require('lodash');var md5=require(_0xdb9e('0x0'));var util=require('util');var Redis=require(_0xdb9e('0x1'));var config=require(_0xdb9e('0x2'));config[_0xdb9e('0x3')]=_['defaults'](config['redis'],{'host':_0xdb9e('0x4'),'port':0x18eb});var io=require(_0xdb9e('0x5'))(new Redis(config[_0xdb9e('0x3')]));function FaxQueue(_0x8da5cc){this['id']=_0x8da5cc['id']||0x0;this['name']=_0x8da5cc[_0xdb9e('0x6')]||'';this[_0xdb9e('0x7')]=_0x8da5cc['timeout']||0xa;this[_0xdb9e('0x8')]=_0x8da5cc[_0xdb9e('0x8')]||_0xdb9e('0x9');this[_0xdb9e('0xa')]=_0x8da5cc[_0xdb9e('0xa')];this['mapAgentsId']={};this['waiting']=0x0;this[_0xdb9e('0x0')]='';this[_0xdb9e('0xb')]();this['updateRealtime']();}FaxQueue['prototype']['updateRouting']=function(){var _0x5b0965=this[_0xdb9e('0xc')][_0xdb9e('0xd')];this[_0xdb9e('0xc')]=_[_0xdb9e('0xe')](this[_0xdb9e('0xa')],'id');this[_0xdb9e('0xc')]['_rr']=_0x5b0965;};FaxQueue[_0xdb9e('0xf')][_0xdb9e('0x10')]=function(){this[_0xdb9e('0x11')]=0x0;this[_0xdb9e('0x12')]=0x0;for(var _0x4e9bc4=0x0;_0x4e9bc4=0x0?this[_0xdb9e('0x14')]:0x0;var _0xda2596={'id':this['id'],'available':this[_0xdb9e('0x14')],'loggedIn':this[_0xdb9e('0x11')],'name':this['name'],'paused':this[_0xdb9e('0x12')],'waiting':this[_0xdb9e('0x15')]};var _0x5ed8e9=md5(JSON[_0xdb9e('0x16')](_0xda2596));if(this[_0xdb9e('0x0')]!==_0x5ed8e9){this[_0xdb9e('0x0')]=_0x5ed8e9;io['to'](util[_0xdb9e('0x17')]('fax:queue:%s',_0xda2596[_0xdb9e('0x6')]))[_0xdb9e('0x18')](_0xdb9e('0x19'),_0xda2596);}};module[_0xdb9e('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 42b792c..0b07bf0 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 _0xeae5=['name'];(function(_0x181434,_0x3b27ec){var _0xa7544b=function(_0x4f95bf){while(--_0x4f95bf){_0x181434['push'](_0x181434['shift']());}};_0xa7544b(++_0x3b27ec);}(_0xeae5,0x171));var _0x5eae=function(_0x19efb2,_0x4bda67){_0x19efb2=_0x19efb2-0x0;var _0x24c966=_0xeae5[_0x19efb2];return _0x24c966;};'use strict';function Interval(_0x5c0ccf){this['id']=_0x5c0ccf['id']||0x0;this['name']=_0x5c0ccf[_0x5eae('0x0')]||'';this['Intervals']=_0x5c0ccf['Intervals']||{};}module['exports']=Interval; \ No newline at end of file +var _0x6320=['Intervals','exports','name'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x6320,0x77));var _0x0632=function(_0x271b70,_0x50c8e5){_0x271b70=_0x271b70-0x0;var _0xf0aa7a=_0x6320[_0x271b70];return _0xf0aa7a;};'use strict';function Interval(_0x4b4391){this['id']=_0x4b4391['id']||0x0;this[_0x0632('0x0')]=_0x4b4391[_0x0632('0x0')]||'';this[_0x0632('0x1')]=_0x4b4391[_0x0632('0x1')]||{};}module[_0x0632('0x2')]=Interval; \ No newline at end of file diff --git a/server/services/routing/model/mailQueue.js b/server/services/routing/model/mailQueue.js index 230126a..ffd19b6 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 _0xf6fd=['length','online','mailPause','available','name','mail:queue:%s','emit','mail_queue:save','exports','lodash','md5','util','ioredis','redis','defaults','localhost','socket.io-emitter','timeout','strategy','beepall','Agents','waiting','updateRouting','updateRealtime','prototype','mapAgentsId','map','_rr','loggedIn','paused'];(function(_0xbca161,_0x4ff432){var _0x16b108=function(_0x1f0463){while(--_0x1f0463){_0xbca161['push'](_0xbca161['shift']());}};_0x16b108(++_0x4ff432);}(_0xf6fd,0xbd));var _0xdf6f=function(_0x45cd26,_0x5f2575){_0x45cd26=_0x45cd26-0x0;var _0x3801a6=_0xf6fd[_0x45cd26];return _0x3801a6;};'use strict';var _=require(_0xdf6f('0x0'));var md5=require(_0xdf6f('0x1'));var util=require(_0xdf6f('0x2'));var Redis=require(_0xdf6f('0x3'));var config=require('../../../config/environment');config[_0xdf6f('0x4')]=_[_0xdf6f('0x5')](config['redis'],{'host':_0xdf6f('0x6'),'port':0x18eb});var io=require(_0xdf6f('0x7'))(new Redis(config['redis']));function MailQueue(_0x26aedf){this['id']=_0x26aedf['id']||0x0;this['name']=_0x26aedf['name']||'';this[_0xdf6f('0x8')]=_0x26aedf['timeout']||0xa;this[_0xdf6f('0x9')]=_0x26aedf[_0xdf6f('0x9')]||_0xdf6f('0xa');this[_0xdf6f('0xb')]=_0x26aedf[_0xdf6f('0xb')];this['mapAgentsId']={};this[_0xdf6f('0xc')]=0x0;this[_0xdf6f('0x1')]='';this[_0xdf6f('0xd')]();this[_0xdf6f('0xe')]();}MailQueue[_0xdf6f('0xf')][_0xdf6f('0xd')]=function(){var _0x3eee55=this[_0xdf6f('0x10')]['_rr'];this[_0xdf6f('0x10')]=_[_0xdf6f('0x11')](this[_0xdf6f('0xb')],'id');this[_0xdf6f('0x10')][_0xdf6f('0x12')]=_0x3eee55;};MailQueue['prototype']['updateRealtime']=function(){this[_0xdf6f('0x13')]=0x0;this[_0xdf6f('0x14')]=0x0;for(var _0x3a4094=0x0;_0x3a4094=0x0?this[_0xdf6f('0x18')]:0x0;var _0x3b4294={'id':this['id'],'available':this[_0xdf6f('0x18')],'loggedIn':this[_0xdf6f('0x13')],'name':this[_0xdf6f('0x19')],'paused':this[_0xdf6f('0x14')],'waiting':this[_0xdf6f('0xc')]};var _0x1778e3=md5(JSON['stringify'](_0x3b4294));if(this[_0xdf6f('0x1')]!==_0x1778e3){this[_0xdf6f('0x1')]=_0x1778e3;io['to'](util['format'](_0xdf6f('0x1a'),_0x3b4294['name']))[_0xdf6f('0x1b')](_0xdf6f('0x1c'),_0x3b4294);}};module[_0xdf6f('0x1d')]=MailQueue; \ No newline at end of file +var _0x8ea7=['md5','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting','updateRealtime','mapAgentsId','map','_rr','prototype','loggedIn','length','mailPause','paused','available','stringify','mail:queue:%s','exports'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0x8ea7,0x15e));var _0x78ea=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8ea7[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var md5=require(_0x78ea('0x0'));var util=require('util');var Redis=require('ioredis');var config=require(_0x78ea('0x1'));config[_0x78ea('0x2')]=_['defaults'](config[_0x78ea('0x2')],{'host':_0x78ea('0x3'),'port':0x18eb});var io=require(_0x78ea('0x4'))(new Redis(config[_0x78ea('0x2')]));function MailQueue(_0x383e23){this['id']=_0x383e23['id']||0x0;this[_0x78ea('0x5')]=_0x383e23['name']||'';this[_0x78ea('0x6')]=_0x383e23[_0x78ea('0x6')]||0xa;this[_0x78ea('0x7')]=_0x383e23[_0x78ea('0x7')]||_0x78ea('0x8');this[_0x78ea('0x9')]=_0x383e23[_0x78ea('0x9')];this['mapAgentsId']={};this[_0x78ea('0xa')]=0x0;this[_0x78ea('0x0')]='';this[_0x78ea('0xb')]();this[_0x78ea('0xc')]();}MailQueue['prototype'][_0x78ea('0xb')]=function(){var _0x2ba837=this[_0x78ea('0xd')]['_rr'];this[_0x78ea('0xd')]=_[_0x78ea('0xe')](this[_0x78ea('0x9')],'id');this[_0x78ea('0xd')][_0x78ea('0xf')]=_0x2ba837;};MailQueue[_0x78ea('0x10')][_0x78ea('0xc')]=function(){this[_0x78ea('0x11')]=0x0;this['paused']=0x0;for(var _0x255550=0x0;_0x255550=0x0?this[_0x78ea('0x15')]:0x0;var _0x9f48c9={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this[_0x78ea('0x5')],'paused':this[_0x78ea('0x14')],'waiting':this[_0x78ea('0xa')]};var _0x59538b=md5(JSON[_0x78ea('0x16')](_0x9f48c9));if(this[_0x78ea('0x0')]!==_0x59538b){this[_0x78ea('0x0')]=_0x59538b;io['to'](util['format'](_0x78ea('0x17'),_0x9f48c9[_0x78ea('0x5')]))['emit']('mail_queue:save',_0x9f48c9);}};module[_0x78ea('0x18')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index bad5e2c..d188a97 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 _0x5fc3=['format','openchannel:queue:%s','name','emit','openchannel_queue:save','exports','lodash','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','prototype','loggedIn','paused','openchannelPause','available'];(function(_0xf40d11,_0xb4dd63){var _0x2c21c8=function(_0x14a2cc){while(--_0x14a2cc){_0xf40d11['push'](_0xf40d11['shift']());}};_0x2c21c8(++_0xb4dd63);}(_0x5fc3,0xa8));var _0x35fc=function(_0x4fa438,_0x1f15a7){_0x4fa438=_0x4fa438-0x0;var _0x4e3958=_0x5fc3[_0x4fa438];return _0x4e3958;};'use strict';var _=require(_0x35fc('0x0'));var md5=require(_0x35fc('0x1'));var util=require('util');var Redis=require(_0x35fc('0x2'));var config=require(_0x35fc('0x3'));config[_0x35fc('0x4')]=_[_0x35fc('0x5')](config[_0x35fc('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x35fc('0x6'))(new Redis(config[_0x35fc('0x4')]));function OpenchannelQueue(_0x186a06){this['id']=_0x186a06['id']||0x0;this['name']=_0x186a06['name']||'';this[_0x35fc('0x7')]=_0x186a06['timeout']||0xa;this[_0x35fc('0x8')]=_0x186a06[_0x35fc('0x8')]||_0x35fc('0x9');this[_0x35fc('0xa')]=_0x186a06[_0x35fc('0xa')];this[_0x35fc('0xb')]={};this[_0x35fc('0xc')]=0x0;this['md5']='';this[_0x35fc('0xd')]();this[_0x35fc('0xe')]();}OpenchannelQueue['prototype'][_0x35fc('0xd')]=function(){var _0x33f491=this['mapAgentsId'][_0x35fc('0xf')];this[_0x35fc('0xb')]=_['map'](this['Agents'],'id');this[_0x35fc('0xb')]['_rr']=_0x33f491;};OpenchannelQueue[_0x35fc('0x10')][_0x35fc('0xe')]=function(){this[_0x35fc('0x11')]=0x0;this[_0x35fc('0x12')]=0x0;for(var _0x38d9f2=0x0;_0x38d9f2=0x0?this['available']:0x0;var _0x41e165={'id':this['id'],'available':this[_0x35fc('0x14')],'loggedIn':this[_0x35fc('0x11')],'name':this['name'],'paused':this[_0x35fc('0x12')],'waiting':this[_0x35fc('0xc')]};var _0x465eb3=md5(JSON['stringify'](_0x41e165));if(this[_0x35fc('0x1')]!==_0x465eb3){this[_0x35fc('0x1')]=_0x465eb3;io['to'](util[_0x35fc('0x15')](_0x35fc('0x16'),_0x41e165[_0x35fc('0x17')]))[_0x35fc('0x18')](_0x35fc('0x19'),_0x41e165);}};module[_0x35fc('0x1a')]=OpenchannelQueue; \ No newline at end of file +var _0x1261=['available','stringify','openchannel:queue:%s','openchannel_queue:save','exports','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting','prototype','mapAgentsId','map','_rr','updateRealtime','loggedIn','paused','length','online'];(function(_0x2d89ce,_0x24d58d){var _0x3fad10=function(_0xad0ec){while(--_0xad0ec){_0x2d89ce['push'](_0x2d89ce['shift']());}};_0x3fad10(++_0x24d58d);}(_0x1261,0x144));var _0x1126=function(_0x5024c7,_0xd560bd){_0x5024c7=_0x5024c7-0x0;var _0xf2f316=_0x1261[_0x5024c7];return _0xf2f316;};'use strict';var _=require('lodash');var md5=require(_0x1126('0x0'));var util=require(_0x1126('0x1'));var Redis=require(_0x1126('0x2'));var config=require(_0x1126('0x3'));config[_0x1126('0x4')]=_[_0x1126('0x5')](config[_0x1126('0x4')],{'host':_0x1126('0x6'),'port':0x18eb});var io=require(_0x1126('0x7'))(new Redis(config[_0x1126('0x4')]));function OpenchannelQueue(_0x5a2189){this['id']=_0x5a2189['id']||0x0;this['name']=_0x5a2189[_0x1126('0x8')]||'';this[_0x1126('0x9')]=_0x5a2189['timeout']||0xa;this[_0x1126('0xa')]=_0x5a2189[_0x1126('0xa')]||_0x1126('0xb');this[_0x1126('0xc')]=_0x5a2189[_0x1126('0xc')];this['mapAgentsId']={};this[_0x1126('0xd')]=0x0;this[_0x1126('0x0')]='';this[_0x1126('0xe')]();this['updateRealtime']();}OpenchannelQueue[_0x1126('0xf')]['updateRouting']=function(){var _0x52ef15=this[_0x1126('0x10')]['_rr'];this[_0x1126('0x10')]=_[_0x1126('0x11')](this[_0x1126('0xc')],'id');this[_0x1126('0x10')][_0x1126('0x12')]=_0x52ef15;};OpenchannelQueue[_0x1126('0xf')][_0x1126('0x13')]=function(){this[_0x1126('0x14')]=0x0;this[_0x1126('0x15')]=0x0;for(var _0x53a8f0=0x0;_0x53a8f0=0x0?this['available']:0x0;var _0x4d2b38={'id':this['id'],'available':this[_0x1126('0x18')],'loggedIn':this[_0x1126('0x14')],'name':this['name'],'paused':this['paused'],'waiting':this[_0x1126('0xd')]};var _0x58b109=md5(JSON[_0x1126('0x19')](_0x4d2b38));if(this[_0x1126('0x0')]!==_0x58b109){this[_0x1126('0x0')]=_0x58b109;io['to'](util['format'](_0x1126('0x1a'),_0x4d2b38['name']))['emit'](_0x1126('0x1b'),_0x4d2b38);}};module[_0x1126('0x1c')]=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index c3f4e5d..fb1b90e 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 _0xe2cc=['timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','length','smsPause','paused','available','format','sms:queue:%s','name','emit','sms_queue:save','lodash','md5','../../../config/environment','redis','defaults','localhost','socket.io-emitter'];(function(_0x394635,_0x14e475){var _0x2009bf=function(_0x1b6c26){while(--_0x1b6c26){_0x394635['push'](_0x394635['shift']());}};_0x2009bf(++_0x14e475);}(_0xe2cc,0x69));var _0xce2c=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0xe2cc[_0x13d07a];return _0x5ee0ee;};'use strict';var _=require(_0xce2c('0x0'));var md5=require(_0xce2c('0x1'));var util=require('util');var Redis=require('ioredis');var config=require(_0xce2c('0x2'));config[_0xce2c('0x3')]=_[_0xce2c('0x4')](config[_0xce2c('0x3')],{'host':_0xce2c('0x5'),'port':0x18eb});var io=require(_0xce2c('0x6'))(new Redis(config[_0xce2c('0x3')]));function SmsQueue(_0x16312a){this['id']=_0x16312a['id']||0x0;this['name']=_0x16312a['name']||'';this[_0xce2c('0x7')]=_0x16312a[_0xce2c('0x7')]||0xa;this[_0xce2c('0x8')]=_0x16312a[_0xce2c('0x8')]||_0xce2c('0x9');this[_0xce2c('0xa')]=_0x16312a['Agents'];this[_0xce2c('0xb')]={};this[_0xce2c('0xc')]=0x0;this[_0xce2c('0x1')]='';this[_0xce2c('0xd')]();this[_0xce2c('0xe')]();}SmsQueue[_0xce2c('0xf')][_0xce2c('0xd')]=function(){var _0x6fc2c3=this[_0xce2c('0xb')][_0xce2c('0x10')];this[_0xce2c('0xb')]=_[_0xce2c('0x11')](this[_0xce2c('0xa')],'id');this[_0xce2c('0xb')][_0xce2c('0x10')]=_0x6fc2c3;};SmsQueue['prototype']['updateRealtime']=function(){this[_0xce2c('0x12')]=0x0;this['paused']=0x0;for(var _0x214c62=0x0;_0x214c62=0x0?this[_0xce2c('0x16')]:0x0;var _0x383085={'id':this['id'],'available':this[_0xce2c('0x16')],'loggedIn':this[_0xce2c('0x12')],'name':this['name'],'paused':this[_0xce2c('0x15')],'waiting':this[_0xce2c('0xc')]};var _0x591921=md5(JSON['stringify'](_0x383085));if(this[_0xce2c('0x1')]!==_0x591921){this[_0xce2c('0x1')]=_0x591921;io['to'](util[_0xce2c('0x17')](_0xce2c('0x18'),_0x383085[_0xce2c('0x19')]))[_0xce2c('0x1a')](_0xce2c('0x1b'),_0x383085);}};module['exports']=SmsQueue; \ No newline at end of file +var _0x6ddd=['beepall','Agents','mapAgentsId','waiting','md5','updateRouting','updateRealtime','prototype','_rr','loggedIn','paused','length','online','smsPause','available','sms:queue:%s','emit','exports','util','ioredis','../../../config/environment','redis','socket.io-emitter','name','timeout','strategy'];(function(_0x9d903a,_0x84611f){var _0x5153e2=function(_0xb4689d){while(--_0xb4689d){_0x9d903a['push'](_0x9d903a['shift']());}};_0x5153e2(++_0x84611f);}(_0x6ddd,0xae));var _0xd6dd=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x6ddd[_0x465028];return _0xb783d4;};'use strict';var _=require('lodash');var md5=require('md5');var util=require(_0xd6dd('0x0'));var Redis=require(_0xd6dd('0x1'));var config=require(_0xd6dd('0x2'));config[_0xd6dd('0x3')]=_['defaults'](config[_0xd6dd('0x3')],{'host':'localhost','port':0x18eb});var io=require(_0xd6dd('0x4'))(new Redis(config['redis']));function SmsQueue(_0x43c57e){this['id']=_0x43c57e['id']||0x0;this[_0xd6dd('0x5')]=_0x43c57e[_0xd6dd('0x5')]||'';this['timeout']=_0x43c57e[_0xd6dd('0x6')]||0xa;this[_0xd6dd('0x7')]=_0x43c57e[_0xd6dd('0x7')]||_0xd6dd('0x8');this['Agents']=_0x43c57e[_0xd6dd('0x9')];this[_0xd6dd('0xa')]={};this[_0xd6dd('0xb')]=0x0;this[_0xd6dd('0xc')]='';this[_0xd6dd('0xd')]();this[_0xd6dd('0xe')]();}SmsQueue[_0xd6dd('0xf')][_0xd6dd('0xd')]=function(){var _0x1c52dc=this[_0xd6dd('0xa')][_0xd6dd('0x10')];this[_0xd6dd('0xa')]=_['map'](this[_0xd6dd('0x9')],'id');this[_0xd6dd('0xa')][_0xd6dd('0x10')]=_0x1c52dc;};SmsQueue[_0xd6dd('0xf')][_0xd6dd('0xe')]=function(){this[_0xd6dd('0x11')]=0x0;this[_0xd6dd('0x12')]=0x0;for(var _0x550953=0x0;_0x550953=0x0?this[_0xd6dd('0x16')]:0x0;var _0x365abc={'id':this['id'],'available':this[_0xd6dd('0x16')],'loggedIn':this[_0xd6dd('0x11')],'name':this['name'],'paused':this['paused'],'waiting':this[_0xd6dd('0xb')]};var _0x6945de=md5(JSON['stringify'](_0x365abc));if(this[_0xd6dd('0xc')]!==_0x6945de){this[_0xd6dd('0xc')]=_0x6945de;io['to'](util['format'](_0xd6dd('0x17'),_0x365abc[_0xd6dd('0x5')]))[_0xd6dd('0x18')]('sms_queue:save',_0x365abc);}};module[_0xd6dd('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 e97f882..4da5309 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 _0xa40d=['strategy','beepall','Agents','mapAgentsId','md5','updateRouting','updateRealtime','prototype','_rr','loggedIn','length','online','whatsappPause','paused','available','waiting','format','whatsapp:queue:%s','emit','whatsapp_queue:save','exports','lodash','ioredis','../../../config/environment','redis','defaults','localhost','name','timeout'];(function(_0x41ed2f,_0xc2c150){var _0xd966eb=function(_0x83013a){while(--_0x83013a){_0x41ed2f['push'](_0x41ed2f['shift']());}};_0xd966eb(++_0xc2c150);}(_0xa40d,0x18e));var _0xda40=function(_0x2ec461,_0x5f588a){_0x2ec461=_0x2ec461-0x0;var _0x28603d=_0xa40d[_0x2ec461];return _0x28603d;};'use strict';var _=require(_0xda40('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0xda40('0x1'));var config=require(_0xda40('0x2'));config[_0xda40('0x3')]=_[_0xda40('0x4')](config[_0xda40('0x3')],{'host':_0xda40('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function WhatsappQueue(_0x4685d4){this['id']=_0x4685d4['id']||0x0;this['name']=_0x4685d4[_0xda40('0x6')]||'';this['timeout']=_0x4685d4[_0xda40('0x7')]||0xa;this[_0xda40('0x8')]=_0x4685d4[_0xda40('0x8')]||_0xda40('0x9');this[_0xda40('0xa')]=_0x4685d4[_0xda40('0xa')];this[_0xda40('0xb')]={};this['waiting']=0x0;this[_0xda40('0xc')]='';this[_0xda40('0xd')]();this[_0xda40('0xe')]();}WhatsappQueue[_0xda40('0xf')][_0xda40('0xd')]=function(){var _0x1b1a9c=this[_0xda40('0xb')][_0xda40('0x10')];this[_0xda40('0xb')]=_['map'](this[_0xda40('0xa')],'id');this[_0xda40('0xb')][_0xda40('0x10')]=_0x1b1a9c;};WhatsappQueue['prototype'][_0xda40('0xe')]=function(){this[_0xda40('0x11')]=0x0;this['paused']=0x0;for(var _0x257a7b=0x0;_0x257a7b=0x0?this['available']:0x0;var _0x20f696={'id':this['id'],'available':this[_0xda40('0x16')],'loggedIn':this[_0xda40('0x11')],'name':this[_0xda40('0x6')],'paused':this[_0xda40('0x15')],'waiting':this[_0xda40('0x17')]};var _0x360e44=md5(JSON['stringify'](_0x20f696));if(this[_0xda40('0xc')]!==_0x360e44){this[_0xda40('0xc')]=_0x360e44;io['to'](util[_0xda40('0x18')](_0xda40('0x19'),_0x20f696[_0xda40('0x6')]))[_0xda40('0x1a')](_0xda40('0x1b'),_0x20f696);}};module[_0xda40('0x1c')]=WhatsappQueue; \ No newline at end of file +var _0x93a6=['strategy','beepall','Agents','mapAgentsId','updateRouting','prototype','_rr','map','loggedIn','paused','length','online','whatsappPause','available','waiting','format','emit','whatsapp_queue:save','lodash','md5','util','ioredis','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name'];(function(_0x571a17,_0x63fb3d){var _0x3ef337=function(_0x12096b){while(--_0x12096b){_0x571a17['push'](_0x571a17['shift']());}};_0x3ef337(++_0x63fb3d);}(_0x93a6,0x10e));var _0x693a=function(_0x62c286,_0x8afc5f){_0x62c286=_0x62c286-0x0;var _0x446c09=_0x93a6[_0x62c286];return _0x446c09;};'use strict';var _=require(_0x693a('0x0'));var md5=require(_0x693a('0x1'));var util=require(_0x693a('0x2'));var Redis=require(_0x693a('0x3'));var config=require(_0x693a('0x4'));config['redis']=_[_0x693a('0x5')](config[_0x693a('0x6')],{'host':_0x693a('0x7'),'port':0x18eb});var io=require(_0x693a('0x8'))(new Redis(config['redis']));function WhatsappQueue(_0x3eb698){this['id']=_0x3eb698['id']||0x0;this[_0x693a('0x9')]=_0x3eb698[_0x693a('0x9')]||'';this['timeout']=_0x3eb698['timeout']||0xa;this[_0x693a('0xa')]=_0x3eb698[_0x693a('0xa')]||_0x693a('0xb');this[_0x693a('0xc')]=_0x3eb698['Agents'];this[_0x693a('0xd')]={};this['waiting']=0x0;this[_0x693a('0x1')]='';this[_0x693a('0xe')]();this['updateRealtime']();}WhatsappQueue[_0x693a('0xf')][_0x693a('0xe')]=function(){var _0x253d6e=this[_0x693a('0xd')][_0x693a('0x10')];this[_0x693a('0xd')]=_[_0x693a('0x11')](this[_0x693a('0xc')],'id');this[_0x693a('0xd')][_0x693a('0x10')]=_0x253d6e;};WhatsappQueue[_0x693a('0xf')]['updateRealtime']=function(){this[_0x693a('0x12')]=0x0;this[_0x693a('0x13')]=0x0;for(var _0x6c0d96=0x0;_0x6c0d96=0x0?this['available']:0x0;var _0x6e8ad9={'id':this['id'],'available':this[_0x693a('0x17')],'loggedIn':this[_0x693a('0x12')],'name':this[_0x693a('0x9')],'paused':this[_0x693a('0x13')],'waiting':this[_0x693a('0x18')]};var _0x43a84c=md5(JSON['stringify'](_0x6e8ad9));if(this[_0x693a('0x1')]!==_0x43a84c){this[_0x693a('0x1')]=_0x43a84c;io['to'](util[_0x693a('0x19')]('whatsapp:queue:%s',_0x6e8ad9[_0x693a('0x9')]))[_0x693a('0x1a')](_0x693a('0x1b'),_0x6e8ad9);}};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 6ab8163..2f1f068 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(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xa9e0[_0x37bd26];return _0xe83dc4;};'use strict';var BPromise=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Interval=require(_0x0a9e('0x3'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x0a9e('0x4'));var SmsQueue=require(_0x0a9e('0x5'));var MailQueue=require(_0x0a9e('0x6'));var FaxQueue=require(_0x0a9e('0x7'));var WhatsappQueue=require(_0x0a9e('0x8'));var Realtime=function(){this['agents']={};this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]={};this[_0x0a9e('0xb')]={};this['smsQueues']={};this['mailQueues']={};this[_0x0a9e('0xc')]={};this['whatsappQueues']={};this['chatQueuesWaitingInteractions']={};this[_0x0a9e('0xd')]={};this[_0x0a9e('0xe')]={};this[_0x0a9e('0xf')]={};this[_0x0a9e('0x10')]={};this[_0x0a9e('0x11')]={};};function freeIsNotKey(_0xbd1168,_0x4a4c56,_0x50dfb2){var _0x527cdd=_['mapKeys'](_0xbd1168,function(_0x273d4d,_0x36471c){return _0x273d4d[_0x50dfb2];});for(var _0xd5b662 in _0x4a4c56){if(_0x4a4c56[_0x0a9e('0x12')](_0xd5b662)){if(!_0x527cdd[_0xd5b662]){delete _0x4a4c56[_0xd5b662];}}}}Realtime[_0x0a9e('0x13')][_0x0a9e('0x14')]=function(_0x5db4b0,_0x4283ce){for(var _0x239b12 in _0x4283ce){if(_0x5db4b0[_0x0a9e('0x12')](_0x239b12)){_0x5db4b0[_0x239b12]=_0x4283ce[_0x239b12];}}};Realtime[_0x0a9e('0x13')][_0x0a9e('0x15')]=function(){var _0x4d5611=this;return function(_0x52a03d){if(_0x52a03d){freeIsNotKey(_0x52a03d,_0x4d5611[_0x0a9e('0x16')],'id');for(var _0x5d0880=0x0,_0x1985b6={},_0x519dfd={};_0x5d0880<_0x52a03d[_0x0a9e('0x17')];_0x5d0880+=0x1){_0x1985b6=_0x52a03d[_0x5d0880];if(_[_0x0a9e('0x18')](_0x4d5611['agents'][_0x1985b6['id']])){_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']]=new Agent(_0x1985b6);}else{_0x4d5611['mergeFromDatabase'](_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']],_0x1985b6);}}}return _0x4d5611[_0x0a9e('0x16')];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x19')]=function(){var _0x31b1ca=this;return function(_0x2eb11f){if(_0x2eb11f){freeIsNotKey(_0x2eb11f,_0x31b1ca[_0x0a9e('0x9')],'id');for(var _0x20559e=0x0,_0x1314ae={},_0x112016={};_0x20559e<_0x2eb11f[_0x0a9e('0x17')];_0x20559e+=0x1){_0x1314ae=_0x2eb11f[_0x20559e];if(_[_0x0a9e('0x18')](_0x31b1ca['intervals'][_0x1314ae['id']])){_0x31b1ca[_0x0a9e('0x9')][_0x1314ae['id']]=new Interval(_0x1314ae);}else{_0x31b1ca[_0x0a9e('0x14')](_0x31b1ca['intervals'][_0x1314ae['id']],_0x1314ae);}}}return _0x31b1ca[_0x0a9e('0x9')];};};Realtime['prototype']['initOpenchannelQueues']=function(){var _0x3a02e1=this;return function(_0x432e56){if(_0x432e56){freeIsNotKey(_0x432e56,_0x3a02e1[_0x0a9e('0xa')],'id');for(var _0x30bae6=0x0,_0x4abc77={},_0xfb6e48={};_0x30bae6<_0x432e56[_0x0a9e('0x17')];_0x30bae6+=0x1){_0x4abc77=_0x432e56[_0x30bae6];if(_[_0x0a9e('0x18')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']])){_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']]=new OpenchannelQueue(_0x4abc77);}else{_0x3a02e1[_0x0a9e('0x14')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']],_0x4abc77);}_0x3a02e1['openchannelQueues'][_0x4abc77['id']]['updateRouting']();_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']][_0x0a9e('0x1a')]();}}return _0x3a02e1[_0x0a9e('0xa')];};};Realtime[_0x0a9e('0x13')]['initChatQueues']=function(){var _0x384319=this;return function(_0x479bc4){if(_0x479bc4){freeIsNotKey(_0x479bc4,_0x384319[_0x0a9e('0xb')],'id');for(var _0x5bfb33=0x0,_0x1dc186={},_0x34dc65={};_0x5bfb33<_0x479bc4[_0x0a9e('0x17')];_0x5bfb33+=0x1){_0x1dc186=_0x479bc4[_0x5bfb33];if(_[_0x0a9e('0x18')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']])){_0x384319[_0x0a9e('0xb')][_0x1dc186['id']]=new ChatQueue(_0x1dc186);}else{_0x384319[_0x0a9e('0x14')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']],_0x1dc186);}_0x384319['chatQueues'][_0x1dc186['id']][_0x0a9e('0x1b')]();_0x384319[_0x0a9e('0xb')][_0x1dc186['id']][_0x0a9e('0x1a')]();}}return _0x384319[_0x0a9e('0xb')];};};Realtime['prototype'][_0x0a9e('0x1c')]=function(){var _0x40e7a3=this;return function(_0x1843b2){if(_0x1843b2){freeIsNotKey(_0x1843b2,_0x40e7a3[_0x0a9e('0x1d')],'id');for(var _0x58b06f=0x0,_0x563b45={},_0x296f41={};_0x58b06f<_0x1843b2[_0x0a9e('0x17')];_0x58b06f+=0x1){_0x563b45=_0x1843b2[_0x58b06f];if(_[_0x0a9e('0x18')](_0x40e7a3['smsQueues'][_0x563b45['id']])){_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']]=new SmsQueue(_0x563b45);}else{_0x40e7a3['mergeFromDatabase'](_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']],_0x563b45);}_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1b')]();_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1a')]();}}return _0x40e7a3['smsQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x1e')]=function(){var _0x40cb85=this;return function(_0x2da5c0){if(_0x2da5c0){freeIsNotKey(_0x2da5c0,_0x40cb85[_0x0a9e('0x1f')],'id');for(var _0x409319=0x0,_0x332d35={},_0x39e565={};_0x409319<_0x2da5c0['length'];_0x409319+=0x1){_0x332d35=_0x2da5c0[_0x409319];if(_[_0x0a9e('0x18')](_0x40cb85['mailQueues'][_0x332d35['id']])){_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]=new MailQueue(_0x332d35);}else{_0x40cb85[_0x0a9e('0x14')](_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']],_0x332d35);}_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]['updateRouting']();_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']][_0x0a9e('0x1a')]();}}return _0x40cb85[_0x0a9e('0x1f')];};};Realtime[_0x0a9e('0x13')]['initFaxQueues']=function(){var _0x54135e=this;return function(_0x1e8694){if(_0x1e8694){freeIsNotKey(_0x1e8694,_0x54135e['faxQueues'],'id');for(var _0x24936a=0x0,_0x3d9717={},_0x381c37={};_0x24936a<_0x1e8694[_0x0a9e('0x17')];_0x24936a+=0x1){_0x3d9717=_0x1e8694[_0x24936a];if(_['isUndefined'](_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']])){_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]=new FaxQueue(_0x3d9717);}else{_0x54135e[_0x0a9e('0x14')](_0x54135e['faxQueues'][_0x3d9717['id']],_0x3d9717);}_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']][_0x0a9e('0x1b')]();_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]['updateRealtime']();}}return _0x54135e['faxQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x20')]=function(){var _0x5adda1=this;return function(_0x2b814e){if(_0x2b814e){freeIsNotKey(_0x2b814e,_0x5adda1[_0x0a9e('0x21')],'id');for(var _0x2e1b3a=0x0,_0x148f55={},_0x4b38d9={};_0x2e1b3a<_0x2b814e['length'];_0x2e1b3a+=0x1){_0x148f55=_0x2b814e[_0x2e1b3a];if(_[_0x0a9e('0x18')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']])){_0x5adda1['whatsappQueues'][_0x148f55['id']]=new WhatsappQueue(_0x148f55);}else{_0x5adda1[_0x0a9e('0x14')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']],_0x148f55);}_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']]['updateRouting']();_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']][_0x0a9e('0x1a')]();}}return _0x5adda1[_0x0a9e('0x21')];};};module[_0x0a9e('0x22')]=Realtime; \ No newline at end of file +var _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xa9e0[_0x5783f4];return _0x28e380;};'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 b414834..86565ee 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 _0x37fa=['update','Request','addTagsToChatInteraction','../client'];(function(_0x53a828,_0x55cb8b){var _0x417c69=function(_0x42564c){while(--_0x42564c){_0x53a828['push'](_0x53a828['shift']());}};_0x417c69(++_0x55cb8b);}(_0x37fa,0x13f));var _0xa37f=function(_0x5d8e11,_0x1b2574){_0x5d8e11=_0x5d8e11-0x0;var _0x25fa53=_0x37fa[_0x5d8e11];return _0x25fa53;};'use strict';var client=require(_0xa37f('0x0'));exports[_0xa37f('0x1')]=function(_0xb0f696,_0x8ed71e){return client[_0xa37f('0x2')]('UpdateChatInteraction',{'body':_0x8ed71e,'options':{'where':{'id':_0xb0f696}},'log':'updateChatInteraction'});};exports['addTags']=function(_0x1ea99e,_0x229ffe){return client[_0xa37f('0x2')]('AddTagsToChatInteraction',{'body':_0x229ffe,'options':{'where':{'id':_0x1ea99e}},'log':_0xa37f('0x3')});}; \ No newline at end of file +var _0xf979=['UpdateChatInteraction','updateChatInteraction','AddTagsToChatInteraction','addTagsToChatInteraction','../client','update','Request'];(function(_0xe30e17,_0xce02be){var _0x2342c9=function(_0x20b733){while(--_0x20b733){_0xe30e17['push'](_0xe30e17['shift']());}};_0x2342c9(++_0xce02be);}(_0xf979,0xeb));var _0x9f97=function(_0x1e30c5,_0x2ea654){_0x1e30c5=_0x1e30c5-0x0;var _0x580e8c=_0xf979[_0x1e30c5];return _0x580e8c;};'use strict';var client=require(_0x9f97('0x0'));exports[_0x9f97('0x1')]=function(_0x485970,_0x4cef0a){return client[_0x9f97('0x2')](_0x9f97('0x3'),{'body':_0x4cef0a,'options':{'where':{'id':_0x485970}},'log':_0x9f97('0x4')});};exports['addTags']=function(_0x2f36d2,_0x3c41b7){return client[_0x9f97('0x2')](_0x9f97('0x5'),{'body':_0x3c41b7,'options':{'where':{'id':_0x2f36d2}},'log':_0x9f97('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index c3de2c7..29c17cd 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 _0x25a7=['CreateChatMessage','../client','Request'];(function(_0x24eae8,_0x45613e){var _0x50e2f0=function(_0x5ec66f){while(--_0x5ec66f){_0x24eae8['push'](_0x24eae8['shift']());}};_0x50e2f0(++_0x45613e);}(_0x25a7,0xb2));var _0x725a=function(_0x31de5d,_0x1cbe7d){_0x31de5d=_0x31de5d-0x0;var _0x31ad05=_0x25a7[_0x31de5d];return _0x31ad05;};'use strict';var client=require(_0x725a('0x0'));exports['create']=function(_0x13d61d){return client[_0x725a('0x1')](_0x725a('0x2'),{'body':_0x13d61d,'log':'createChatMessage'});}; \ No newline at end of file +var _0x4b06=['createChatMessage','create','Request'];(function(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0x4b06,0x118));var _0x64b0=function(_0x35be95,_0x3b7d3f){_0x35be95=_0x35be95-0x0;var _0xf88959=_0x4b06[_0x35be95];return _0xf88959;};'use strict';var client=require('../client');exports[_0x64b0('0x0')]=function(_0x35e3ef){return client[_0x64b0('0x1')]('CreateChatMessage',{'body':_0x35e3ef,'log':_0x64b0('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 6b44eda..40125e8 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 _0x4403=['timeout','strategy','User','Agents','online','GetChatQueue'];(function(_0x20b9fc,_0x5dab92){var _0x511a2b=function(_0x292cbd){while(--_0x292cbd){_0x20b9fc['push'](_0x20b9fc['shift']());}};_0x511a2b(++_0x5dab92);}(_0x4403,0x179));var _0x3440=function(_0x46efdf,_0x553044){_0x46efdf=_0x46efdf-0x0;var _0x1a12b2=_0x4403[_0x46efdf];return _0x1a12b2;};'use strict';var client=require('../client');exports['getChatQueues']=function(){return function(){return client['Request'](_0x3440('0x0'),{'options':{'raw':![],'attributes':['id','name',_0x3440('0x1'),_0x3440('0x2')],'include':[{'model':_0x3440('0x3'),'as':_0x3440('0x4'),'attributes':['id','name',_0x3440('0x5'),'chatPause']}]},'log':'getChatQueues'});};}; \ No newline at end of file +var _0xc090=['getChatQueues','Request','GetChatQueue','name','timeout','strategy','User','Agents','online','chatPause','../client'];(function(_0x4234bd,_0x64b8a){var _0x2386aa=function(_0x48b853){while(--_0x48b853){_0x4234bd['push'](_0x4234bd['shift']());}};_0x2386aa(++_0x64b8a);}(_0xc090,0x112));var _0x0c09=function(_0x317502,_0x4272a3){_0x317502=_0x317502-0x0;var _0x2225f0=_0xc090[_0x317502];return _0x2225f0;};'use strict';var client=require(_0x0c09('0x0'));exports[_0x0c09('0x1')]=function(){return function(){return client[_0x0c09('0x2')](_0x0c09('0x3'),{'options':{'raw':![],'attributes':['id',_0x0c09('0x4'),_0x0c09('0x5'),_0x0c09('0x6')],'include':[{'model':_0x0c09('0x7'),'as':_0x0c09('0x8'),'attributes':['id','name',_0x0c09('0x9'),_0x0c09('0xa')]}]},'log':'getChatQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index 0c27c83..ec68c95 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 _0x6183=['update','UpdateChatQueueReport','DESC','create','Request','CreateChatQueueReport'];(function(_0x3001d0,_0x3cf8e5){var _0xda85f3=function(_0x332aec){while(--_0x332aec){_0x3001d0['push'](_0x3001d0['shift']());}};_0xda85f3(++_0x3cf8e5);}(_0x6183,0x19b));var _0x3618=function(_0x478c8a,_0x9afc92){_0x478c8a=_0x478c8a-0x0;var _0x3b6b3e=_0x6183[_0x478c8a];return _0x3b6b3e;};'use strict';var client=require('../client');exports[_0x3618('0x0')]=function(_0x3a9324){return client[_0x3618('0x1')]('CreateChatQueueReport',{'body':_0x3a9324,'log':_0x3618('0x2')});};exports[_0x3618('0x3')]=function(_0x176f61,_0x2d62a7){return client[_0x3618('0x1')](_0x3618('0x4'),{'body':_0x2d62a7,'options':{'where':{'uniqueid':_0x176f61},'order':[['id',_0x3618('0x5')]],'limit':0x1},'log':_0x3618('0x4')});}; \ No newline at end of file +var _0x9f3e=['UpdateChatQueueReport','DESC','../client','create','Request','CreateChatQueueReport'];(function(_0x3f8edd,_0x4bb532){var _0x3063f6=function(_0x1bf865){while(--_0x1bf865){_0x3f8edd['push'](_0x3f8edd['shift']());}};_0x3063f6(++_0x4bb532);}(_0x9f3e,0x1c4));var _0xe9f3=function(_0x5dc0ed,_0x5c98b4){_0x5dc0ed=_0x5dc0ed-0x0;var _0x54eeab=_0x9f3e[_0x5dc0ed];return _0x54eeab;};'use strict';var client=require(_0xe9f3('0x0'));exports[_0xe9f3('0x1')]=function(_0x28c509){return client[_0xe9f3('0x2')](_0xe9f3('0x3'),{'body':_0x28c509,'log':'CreateChatQueueReport'});};exports['update']=function(_0x4c3a39,_0x1ea33c){return client['Request'](_0xe9f3('0x4'),{'body':_0x1ea33c,'options':{'where':{'uniqueid':_0x4c3a39},'order':[['id',_0xe9f3('0x5')]],'limit':0x1},'log':_0xe9f3('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index c3eed67..54f6233 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(_0xda6ad1,_0x5f09e3){var _0xedc3a5=function(_0x5459d7){while(--_0x5459d7){_0xda6ad1['push'](_0xda6ad1['shift']());}};_0xedc3a5(++_0x5f09e3);}(_0x7a54,0x106));var _0x47a5=function(_0xe75bee,_0x22e5b2){_0xe75bee=_0xe75bee-0x0;var _0x38f6e5=_0x7a54[_0xe75bee];return _0x38f6e5;};'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(_0x5a2b2d,_0x3e29eb){var _0x104a4f=function(_0x429b87){while(--_0x429b87){_0x5a2b2d['push'](_0x5a2b2d['shift']());}};_0x104a4f(++_0x3e29eb);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'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 8928d45..8ea2e5e 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 _0x3129=['../client','create','CreateFaxMessage'];(function(_0x1931e9,_0x5603b5){var _0x5a87f1=function(_0x22ca92){while(--_0x22ca92){_0x1931e9['push'](_0x1931e9['shift']());}};_0x5a87f1(++_0x5603b5);}(_0x3129,0xfc));var _0x9312=function(_0x5e976a,_0x36f04f){_0x5e976a=_0x5e976a-0x0;var _0x4a59db=_0x3129[_0x5e976a];return _0x4a59db;};'use strict';var client=require(_0x9312('0x0'));exports[_0x9312('0x1')]=function(_0x93f98b){return client['Request'](_0x9312('0x2'),{'body':_0x93f98b,'log':'createFaxMessage'});}; \ No newline at end of file +var _0xcb13=['createFaxMessage','../client','create','Request','CreateFaxMessage'];(function(_0x4c496d,_0x16ce2b){var _0x2190c9=function(_0x30556e){while(--_0x30556e){_0x4c496d['push'](_0x4c496d['shift']());}};_0x2190c9(++_0x16ce2b);}(_0xcb13,0xa6));var _0x3cb1=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0xcb13[_0x27af45];return _0x18df21;};'use strict';var client=require(_0x3cb1('0x0'));exports[_0x3cb1('0x1')]=function(_0x7e8620){return client[_0x3cb1('0x2')](_0x3cb1('0x3'),{'body':_0x7e8620,'log':_0x3cb1('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index 6557649..3566150 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 _0x9387=['faxPause','Request','GetFaxQueue','name','User','Agents','online'];(function(_0xe0aac4,_0x3aa252){var _0x4ed1cd=function(_0x196633){while(--_0x196633){_0xe0aac4['push'](_0xe0aac4['shift']());}};_0x4ed1cd(++_0x3aa252);}(_0x9387,0x1d6));var _0x7938=function(_0x36c888,_0x13398b){_0x36c888=_0x36c888-0x0;var _0x56a597=_0x9387[_0x36c888];return _0x56a597;};'use strict';var client=require('../client');exports['getFaxQueues']=function(){return function(){return client[_0x7938('0x0')](_0x7938('0x1'),{'options':{'raw':![],'attributes':['id',_0x7938('0x2'),'timeout','strategy'],'include':[{'model':_0x7938('0x3'),'as':_0x7938('0x4'),'attributes':['id',_0x7938('0x2'),_0x7938('0x5'),_0x7938('0x6')]}]},'log':'getFaxQueues'});};}; \ No newline at end of file +var _0x6252=['online','faxPause','getFaxQueues','../client','Request','GetFaxQueue','name'];(function(_0x1caf6a,_0x26a5bf){var _0x1bf493=function(_0x3982f5){while(--_0x3982f5){_0x1caf6a['push'](_0x1caf6a['shift']());}};_0x1bf493(++_0x26a5bf);}(_0x6252,0x7a));var _0x2625=function(_0x172747,_0x1732bd){_0x172747=_0x172747-0x0;var _0x509692=_0x6252[_0x172747];return _0x509692;};'use strict';var client=require(_0x2625('0x0'));exports['getFaxQueues']=function(){return function(){return client[_0x2625('0x1')](_0x2625('0x2'),{'options':{'raw':![],'attributes':['id',_0x2625('0x3'),'timeout','strategy'],'include':[{'model':'User','as':'Agents','attributes':['id','name',_0x2625('0x4'),_0x2625('0x5')]}]},'log':_0x2625('0x6')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index 7583854..8d147dd 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 _0x5dc7=['UpdateFaxQueueReport','../client','Request','update'];(function(_0x37c8fd,_0x34b282){var _0x27412c=function(_0x3d087f){while(--_0x3d087f){_0x37c8fd['push'](_0x37c8fd['shift']());}};_0x27412c(++_0x34b282);}(_0x5dc7,0x191));var _0x75dc=function(_0x5b05e2,_0x268950){_0x5b05e2=_0x5b05e2-0x0;var _0x410e34=_0x5dc7[_0x5b05e2];return _0x410e34;};'use strict';var client=require(_0x75dc('0x0'));exports['create']=function(_0x120af9){return client[_0x75dc('0x1')]('CreateFaxQueueReport',{'body':_0x120af9,'log':'CreateFaxQueueReport'});};exports[_0x75dc('0x2')]=function(_0x41ab6d,_0x50071f){return client[_0x75dc('0x1')](_0x75dc('0x3'),{'body':_0x50071f,'options':{'where':{'uniqueid':_0x41ab6d},'order':[['id','DESC']],'limit':0x1},'log':_0x75dc('0x3')});}; \ No newline at end of file +var _0xa4cc=['create','Request','CreateFaxQueueReport','update','DESC'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa4cc,0xc8));var _0xca4c=function(_0x7ce0de,_0x53c4da){_0x7ce0de=_0x7ce0de-0x0;var _0x34c074=_0xa4cc[_0x7ce0de];return _0x34c074;};'use strict';var client=require('../client');exports[_0xca4c('0x0')]=function(_0x48a94d){return client[_0xca4c('0x1')]('CreateFaxQueueReport',{'body':_0x48a94d,'log':_0xca4c('0x2')});};exports[_0xca4c('0x3')]=function(_0x2cfdf8,_0x292f13){return client[_0xca4c('0x1')]('UpdateFaxQueueReport',{'body':_0x292f13,'options':{'where':{'uniqueid':_0x2cfdf8},'order':[['id',_0xca4c('0x4')]],'limit':0x1},'log':'UpdateFaxQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index f1ea668..fcf4bd5 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 _0xaad4=['GetInterval','name','Interval','Intervals','../client','getIntervals'];(function(_0x3c3ae6,_0x15d3e7){var _0x258468=function(_0x3d04cd){while(--_0x3d04cd){_0x3c3ae6['push'](_0x3c3ae6['shift']());}};_0x258468(++_0x15d3e7);}(_0xaad4,0x190));var _0x4aad=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xaad4[_0x122ef9];return _0x42fba0;};'use strict';var client=require(_0x4aad('0x0'));exports[_0x4aad('0x1')]=function(){return function(){return client['Request'](_0x4aad('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x4aad('0x3')],'include':[{'model':_0x4aad('0x4'),'as':_0x4aad('0x5'),'attributes':['id',_0x4aad('0x3'),'interval']}]},'log':_0x4aad('0x1')});};}; \ No newline at end of file +var _0x096c=['Interval','Intervals','../client','getIntervals','Request','GetInterval','name'];(function(_0x264b61,_0x4a5017){var _0x8fff4f=function(_0x25c21e){while(--_0x25c21e){_0x264b61['push'](_0x264b61['shift']());}};_0x8fff4f(++_0x4a5017);}(_0x096c,0x1b4));var _0xc096=function(_0xf81e7c,_0x232e70){_0xf81e7c=_0xf81e7c-0x0;var _0x5547ed=_0x096c[_0xf81e7c];return _0x5547ed;};'use strict';var client=require(_0xc096('0x0'));exports[_0xc096('0x1')]=function(){return function(){return client[_0xc096('0x2')](_0xc096('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xc096('0x4')],'include':[{'model':_0xc096('0x5'),'as':_0xc096('0x6'),'attributes':['id','name','interval']}]},'log':_0xc096('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index 72b5486..0a8c885 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(_0x15106b,_0x4d96f6){var _0x521203=function(_0x4dbe23){while(--_0x4dbe23){_0x15106b['push'](_0x15106b['shift']());}};_0x521203(++_0x4d96f6);}(_0x2a07,0x74));var _0x72a0=function(_0x2e65ee,_0x29dad9){_0x2e65ee=_0x2e65ee-0x0;var _0x4c712a=_0x2a07[_0x2e65ee];return _0x4c712a;};'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 _0x5f2f=['addTags','AddTagsToMailInteraction','addTagsToChatInteraction','../client','update','Request','UpdateMailInteraction','updateMailInteraction'];(function(_0x3264ec,_0x44154c){var _0x300cd2=function(_0x286b83){while(--_0x286b83){_0x3264ec['push'](_0x3264ec['shift']());}};_0x300cd2(++_0x44154c);}(_0x5f2f,0x73));var _0xf5f2=function(_0x44330c,_0x22f9b5){_0x44330c=_0x44330c-0x0;var _0x5b3cd9=_0x5f2f[_0x44330c];return _0x5b3cd9;};'use strict';var client=require(_0xf5f2('0x0'));exports[_0xf5f2('0x1')]=function(_0x2dcf60,_0x1a7be1){return client[_0xf5f2('0x2')](_0xf5f2('0x3'),{'body':_0x1a7be1,'options':{'where':{'id':_0x2dcf60}},'log':_0xf5f2('0x4')});};exports[_0xf5f2('0x5')]=function(_0x501fbd,_0x4854b6){return client[_0xf5f2('0x2')](_0xf5f2('0x6'),{'body':_0x4854b6,'options':{'where':{'id':_0x501fbd}},'log':_0xf5f2('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index b404411..7647428 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 _0xb9e5=['create','Request','createMailMessage'];(function(_0xdbbc81,_0x1df854){var _0x108d6d=function(_0x3a95ad){while(--_0x3a95ad){_0xdbbc81['push'](_0xdbbc81['shift']());}};_0x108d6d(++_0x1df854);}(_0xb9e5,0xfc));var _0x5b9e=function(_0x143759,_0x249c49){_0x143759=_0x143759-0x0;var _0x4582be=_0xb9e5[_0x143759];return _0x4582be;};'use strict';var client=require('../client');exports[_0x5b9e('0x0')]=function(_0x2933e1){return client[_0x5b9e('0x1')]('CreateMailMessage',{'body':_0x2933e1,'log':_0x5b9e('0x2')});}; \ No newline at end of file +var _0x4edf=['create','Request','createMailMessage'];(function(_0xee46a1,_0x217c6a){var _0xb32f68=function(_0x1fe952){while(--_0x1fe952){_0xee46a1['push'](_0xee46a1['shift']());}};_0xb32f68(++_0x217c6a);}(_0x4edf,0x189));var _0xf4ed=function(_0x210718,_0x247b55){_0x210718=_0x210718-0x0;var _0x541bfc=_0x4edf[_0x210718];return _0x541bfc;};'use strict';var client=require('../client');exports[_0xf4ed('0x0')]=function(_0xc3aba4){return client[_0xf4ed('0x1')]('CreateMailMessage',{'body':_0xc3aba4,'log':_0xf4ed('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index 65f77e7..c87a0c1 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 _0x6d48=['timeout','strategy','User','online','mailPause','../client','getMailQueues','GetMailQueue'];(function(_0x24453b,_0x53ffa9){var _0x3c741e=function(_0x18f26a){while(--_0x18f26a){_0x24453b['push'](_0x24453b['shift']());}};_0x3c741e(++_0x53ffa9);}(_0x6d48,0x135));var _0x86d4=function(_0x4113bc,_0x419549){_0x4113bc=_0x4113bc-0x0;var _0x174008=_0x6d48[_0x4113bc];return _0x174008;};'use strict';var client=require(_0x86d4('0x0'));exports[_0x86d4('0x1')]=function(){return function(){return client['Request'](_0x86d4('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x86d4('0x3'),_0x86d4('0x4')],'include':[{'model':_0x86d4('0x5'),'as':'Agents','attributes':['id','name',_0x86d4('0x6'),_0x86d4('0x7')]}]},'log':_0x86d4('0x1')});};}; \ No newline at end of file +var _0x47c7=['timeout','strategy','User','Agents','name','online','mailPause','getMailQueues','../client','Request','GetMailQueue'];(function(_0x1ddc76,_0x2111fa){var _0x318ccc=function(_0x11f7fc){while(--_0x11f7fc){_0x1ddc76['push'](_0x1ddc76['shift']());}};_0x318ccc(++_0x2111fa);}(_0x47c7,0x131));var _0x747c=function(_0x4e7d25,_0x58285f){_0x4e7d25=_0x4e7d25-0x0;var _0x526fe6=_0x47c7[_0x4e7d25];return _0x526fe6;};'use strict';var client=require(_0x747c('0x0'));exports['getMailQueues']=function(){return function(){return client[_0x747c('0x1')](_0x747c('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x747c('0x3'),_0x747c('0x4')],'include':[{'model':_0x747c('0x5'),'as':_0x747c('0x6'),'attributes':['id',_0x747c('0x7'),_0x747c('0x8'),_0x747c('0x9')]}]},'log':_0x747c('0xa')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index f7348fc..cd2b119 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 _0x4e9c=['UpdateMailQueueReport','../client','create','CreateMailQueueReport','Request'];(function(_0x482393,_0x355061){var _0x4c07ae=function(_0x139328){while(--_0x139328){_0x482393['push'](_0x482393['shift']());}};_0x4c07ae(++_0x355061);}(_0x4e9c,0x9c));var _0xc4e9=function(_0x5c6731,_0x3c5a9d){_0x5c6731=_0x5c6731-0x0;var _0x1a6f21=_0x4e9c[_0x5c6731];return _0x1a6f21;};'use strict';var client=require(_0xc4e9('0x0'));exports[_0xc4e9('0x1')]=function(_0x444261){return client['Request'](_0xc4e9('0x2'),{'body':_0x444261,'log':_0xc4e9('0x2')});};exports['update']=function(_0xfd8971,_0x2cbc68){return client[_0xc4e9('0x3')](_0xc4e9('0x4'),{'body':_0x2cbc68,'options':{'where':{'uniqueid':_0xfd8971},'order':[['id','DESC']],'limit':0x1},'log':'UpdateMailQueueReport'});}; \ No newline at end of file +var _0x5266=['UpdateMailQueueReport','../client','create','Request','CreateMailQueueReport','update'];(function(_0x1ecd44,_0xa8284){var _0x8432ac=function(_0x279b18){while(--_0x279b18){_0x1ecd44['push'](_0x1ecd44['shift']());}};_0x8432ac(++_0xa8284);}(_0x5266,0xd9));var _0x6526=function(_0x305bbf,_0x5647b3){_0x305bbf=_0x305bbf-0x0;var _0x4ed772=_0x5266[_0x305bbf];return _0x4ed772;};'use strict';var client=require(_0x6526('0x0'));exports[_0x6526('0x1')]=function(_0xb0b7ee){return client[_0x6526('0x2')]('CreateMailQueueReport',{'body':_0xb0b7ee,'log':_0x6526('0x3')});};exports[_0x6526('0x4')]=function(_0x20345d,_0x18c32a){return client['Request'](_0x6526('0x5'),{'body':_0x18c32a,'options':{'where':{'uniqueid':_0x20345d},'order':[['id','DESC']],'limit':0x1},'log':_0x6526('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index aca5c3c..f8cc881 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 _0x438d=['../client','update','Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTagsToChatInteraction'];(function(_0x365dce,_0x507cd5){var _0x30581f=function(_0x779184){while(--_0x779184){_0x365dce['push'](_0x365dce['shift']());}};_0x30581f(++_0x507cd5);}(_0x438d,0x156));var _0xd438=function(_0x214bde,_0x575edb){_0x214bde=_0x214bde-0x0;var _0x14040c=_0x438d[_0x214bde];return _0x14040c;};'use strict';var client=require(_0xd438('0x0'));exports[_0xd438('0x1')]=function(_0x15d16a,_0x1faacf){return client[_0xd438('0x2')](_0xd438('0x3'),{'body':_0x1faacf,'options':{'where':{'id':_0x15d16a}},'log':_0xd438('0x4')});};exports['addTags']=function(_0x20200f,_0xb25b61){return client[_0xd438('0x2')]('AddTagsToOpenchannelInteraction',{'body':_0xb25b61,'options':{'where':{'id':_0x20200f}},'log':_0xd438('0x5')});}; \ No newline at end of file +var _0xe6a4=['Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','update'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xe6a4,0xa0));var _0x4e6a=function(_0x1e1042,_0x319546){_0x1e1042=_0x1e1042-0x0;var _0x5606bf=_0xe6a4[_0x1e1042];return _0x5606bf;};'use strict';var client=require('../client');exports[_0x4e6a('0x0')]=function(_0x6d97f7,_0x441408){return client[_0x4e6a('0x1')](_0x4e6a('0x2'),{'body':_0x441408,'options':{'where':{'id':_0x6d97f7}},'log':_0x4e6a('0x3')});};exports[_0x4e6a('0x4')]=function(_0xb93002,_0x5efc05){return client[_0x4e6a('0x1')](_0x4e6a('0x5'),{'body':_0x5efc05,'options':{'where':{'id':_0xb93002}},'log':_0x4e6a('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index 813948e..7730d8b 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 _0xcefb=['Request','CreateOpenchannelMessage','createOpenchannelMessage','../client'];(function(_0x11742d,_0x56f928){var _0x569570=function(_0x2fea6d){while(--_0x2fea6d){_0x11742d['push'](_0x11742d['shift']());}};_0x569570(++_0x56f928);}(_0xcefb,0x177));var _0xbcef=function(_0x1b4ca6,_0x37f5d0){_0x1b4ca6=_0x1b4ca6-0x0;var _0x189463=_0xcefb[_0x1b4ca6];return _0x189463;};'use strict';var client=require(_0xbcef('0x0'));exports['create']=function(_0xb92be0){return client[_0xbcef('0x1')](_0xbcef('0x2'),{'body':_0xb92be0,'log':_0xbcef('0x3')});}; \ No newline at end of file +var _0xe599=['Request','CreateOpenchannelMessage','../client','create'];(function(_0x2b7c03,_0x166134){var _0x2bc83f=function(_0x408580){while(--_0x408580){_0x2b7c03['push'](_0x2b7c03['shift']());}};_0x2bc83f(++_0x166134);}(_0xe599,0x12e));var _0x9e59=function(_0x1687f2,_0x5502b3){_0x1687f2=_0x1687f2-0x0;var _0x375c3a=_0xe599[_0x1687f2];return _0x375c3a;};'use strict';var client=require(_0x9e59('0x0'));exports[_0x9e59('0x1')]=function(_0x3f2b40){return client[_0x9e59('0x2')](_0x9e59('0x3'),{'body':_0x3f2b40,'log':'createOpenchannelMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index 353a53d..462727b 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 _0xec1d=['User','Agents','name','openchannelPause','../client','getOpenchannelQueues','Request','GetOpenchannelQueue','timeout','strategy'];(function(_0x19b710,_0xc2858c){var _0x13b42f=function(_0x1b4946){while(--_0x1b4946){_0x19b710['push'](_0x19b710['shift']());}};_0x13b42f(++_0xc2858c);}(_0xec1d,0x7c));var _0xdec1=function(_0x55ff57,_0x157169){_0x55ff57=_0x55ff57-0x0;var _0x3615f5=_0xec1d[_0x55ff57];return _0x3615f5;};'use strict';var client=require(_0xdec1('0x0'));exports[_0xdec1('0x1')]=function(){return function(){return client[_0xdec1('0x2')](_0xdec1('0x3'),{'options':{'raw':![],'attributes':['id','name',_0xdec1('0x4'),_0xdec1('0x5')],'include':[{'model':_0xdec1('0x6'),'as':_0xdec1('0x7'),'attributes':['id',_0xdec1('0x8'),'online',_0xdec1('0x9')]}]},'log':_0xdec1('0x1')});};}; \ No newline at end of file +var _0xec1d=['User','Agents','name','openchannelPause','../client','getOpenchannelQueues','Request','GetOpenchannelQueue','timeout','strategy'];(function(_0x5b0387,_0xabd94b){var _0x51e767=function(_0x3717e3){while(--_0x3717e3){_0x5b0387['push'](_0x5b0387['shift']());}};_0x51e767(++_0xabd94b);}(_0xec1d,0x7c));var _0xdec1=function(_0x34fda0,_0x3f8f09){_0x34fda0=_0x34fda0-0x0;var _0x333cda=_0xec1d[_0x34fda0];return _0x333cda;};'use strict';var client=require(_0xdec1('0x0'));exports[_0xdec1('0x1')]=function(){return function(){return client[_0xdec1('0x2')](_0xdec1('0x3'),{'options':{'raw':![],'attributes':['id','name',_0xdec1('0x4'),_0xdec1('0x5')],'include':[{'model':_0xdec1('0x6'),'as':_0xdec1('0x7'),'attributes':['id',_0xdec1('0x8'),'online',_0xdec1('0x9')]}]},'log':_0xdec1('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index 4af119e..dc368c1 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 _0x317b=['update','UpdateOpenchannelQueueReport','DESC','../client','create','Request','CreateOpenchannelQueueReport'];(function(_0x2b8f54,_0x4023e0){var _0x3514a2=function(_0xdf0545){while(--_0xdf0545){_0x2b8f54['push'](_0x2b8f54['shift']());}};_0x3514a2(++_0x4023e0);}(_0x317b,0x96));var _0xb317=function(_0x30d7fc,_0x44b881){_0x30d7fc=_0x30d7fc-0x0;var _0xd7b0f4=_0x317b[_0x30d7fc];return _0xd7b0f4;};'use strict';var client=require(_0xb317('0x0'));exports[_0xb317('0x1')]=function(_0x101a29){return client[_0xb317('0x2')](_0xb317('0x3'),{'body':_0x101a29,'log':_0xb317('0x3')});};exports[_0xb317('0x4')]=function(_0x3bc8d7,_0x1393dd){return client[_0xb317('0x2')](_0xb317('0x5'),{'body':_0x1393dd,'options':{'where':{'uniqueid':_0x3bc8d7},'order':[['id',_0xb317('0x6')]],'limit':0x1},'log':'UpdateOpenchannelQueueReport'});}; \ No newline at end of file +var _0x4170=['DESC','../client','create','Request','CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport'];(function(_0x435d04,_0x13410b){var _0x23a5bb=function(_0x259d4a){while(--_0x259d4a){_0x435d04['push'](_0x435d04['shift']());}};_0x23a5bb(++_0x13410b);}(_0x4170,0x166));var _0x0417=function(_0x489730,_0x5226b9){_0x489730=_0x489730-0x0;var _0x7855d1=_0x4170[_0x489730];return _0x7855d1;};'use strict';var client=require(_0x0417('0x0'));exports[_0x0417('0x1')]=function(_0x470666){return client[_0x0417('0x2')]('CreateOpenchannelQueueReport',{'body':_0x470666,'log':_0x0417('0x3')});};exports[_0x0417('0x4')]=function(_0x174055,_0x56aff7){return client['Request'](_0x0417('0x5'),{'body':_0x56aff7,'options':{'where':{'uniqueid':_0x174055},'order':[['id',_0x0417('0x6')]],'limit':0x1},'log':_0x0417('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index 9567b76..566ca16 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 _0x616c=['updateSmsInteraction','addTags','AddTagsToSmsInteraction','addTagsToSmsInteraction','update','Request','UpdateSmsInteraction'];(function(_0x1356ef,_0x495929){var _0x31d502=function(_0x53585d){while(--_0x53585d){_0x1356ef['push'](_0x1356ef['shift']());}};_0x31d502(++_0x495929);}(_0x616c,0x1b6));var _0xc616=function(_0x474f78,_0x22aab9){_0x474f78=_0x474f78-0x0;var _0x274c3d=_0x616c[_0x474f78];return _0x274c3d;};'use strict';var client=require('../client');exports[_0xc616('0x0')]=function(_0xebad2f,_0x5a267e){return client[_0xc616('0x1')](_0xc616('0x2'),{'body':_0x5a267e,'options':{'where':{'id':_0xebad2f}},'log':_0xc616('0x3')});};exports[_0xc616('0x4')]=function(_0x52b492,_0x5f2d88){return client[_0xc616('0x1')](_0xc616('0x5'),{'body':_0x5f2d88,'options':{'where':{'id':_0x52b492}},'log':_0xc616('0x6')});}; \ No newline at end of file +var _0xefbf=['Request','addTagsToSmsInteraction','../client','update','UpdateSmsInteraction','updateSmsInteraction','addTags'];(function(_0x4db1bd,_0x832a4b){var _0x50eacf=function(_0xd457b9){while(--_0xd457b9){_0x4db1bd['push'](_0x4db1bd['shift']());}};_0x50eacf(++_0x832a4b);}(_0xefbf,0xa3));var _0xfefb=function(_0x10afad,_0x17244e){_0x10afad=_0x10afad-0x0;var _0x3aa3ef=_0xefbf[_0x10afad];return _0x3aa3ef;};'use strict';var client=require(_0xfefb('0x0'));exports[_0xfefb('0x1')]=function(_0x491b8b,_0x537bf7){return client['Request'](_0xfefb('0x2'),{'body':_0x537bf7,'options':{'where':{'id':_0x491b8b}},'log':_0xfefb('0x3')});};exports[_0xfefb('0x4')]=function(_0x36eb23,_0x79ca1d){return client[_0xfefb('0x5')]('AddTagsToSmsInteraction',{'body':_0x79ca1d,'options':{'where':{'id':_0x36eb23}},'log':_0xfefb('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index c3eb5c0..dcddb93 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 _0x8675=['create','CreateSmsMessage','createSmsMessage','../client'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x8675,0x9f));var _0x5867=function(_0x1db923,_0x426bc8){_0x1db923=_0x1db923-0x0;var _0x2bf565=_0x8675[_0x1db923];return _0x2bf565;};'use strict';var client=require(_0x5867('0x0'));exports[_0x5867('0x1')]=function(_0x49101a){return client['Request'](_0x5867('0x2'),{'body':_0x49101a,'log':_0x5867('0x3')});}; \ No newline at end of file +var _0x497b=['Request','CreateSmsMessage','createSmsMessage','../client'];(function(_0x287c3d,_0xdedb20){var _0x126315=function(_0x2325b0){while(--_0x2325b0){_0x287c3d['push'](_0x287c3d['shift']());}};_0x126315(++_0xdedb20);}(_0x497b,0x18b));var _0xb497=function(_0x2bd377,_0x4873b8){_0x2bd377=_0x2bd377-0x0;var _0x16448f=_0x497b[_0x2bd377];return _0x16448f;};'use strict';var client=require(_0xb497('0x0'));exports['create']=function(_0x328a4f){return client[_0xb497('0x1')](_0xb497('0x2'),{'body':_0x328a4f,'log':_0xb497('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index fe16c52..c408041 100644 --- a/server/services/routing/rpc/smsQueue.js +++ b/server/services/routing/rpc/smsQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['User','Agents','online','../client','getSmsQueues','Request','timeout','strategy'];(function(_0x225d43,_0x22f803){var _0x213152=function(_0x16634e){while(--_0x16634e){_0x225d43['push'](_0x225d43['shift']());}};_0x213152(++_0x22f803);}(_0x70e0,0x17b));var _0x070e=function(_0x2082ba,_0x4c6da3){_0x2082ba=_0x2082ba-0x0;var _0x193ae7=_0x70e0[_0x2082ba];return _0x193ae7;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(){return function(){return client[_0x070e('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x070e('0x3'),_0x070e('0x4')],'include':[{'model':_0x070e('0x5'),'as':_0x070e('0x6'),'attributes':['id','name',_0x070e('0x7'),'smsPause']}]},'log':_0x070e('0x1')});};}; \ No newline at end of file +var _0xb7e7=['online','../client','Request','name','strategy','Agents'];(function(_0x4a2508,_0x512289){var _0x40cda4=function(_0x7c39d7){while(--_0x7c39d7){_0x4a2508['push'](_0x4a2508['shift']());}};_0x40cda4(++_0x512289);}(_0xb7e7,0x121));var _0x7b7e=function(_0x3305de,_0x16582f){_0x3305de=_0x3305de-0x0;var _0x3b5a84=_0xb7e7[_0x3305de];return _0x3b5a84;};'use strict';var client=require(_0x7b7e('0x0'));exports['getSmsQueues']=function(){return function(){return client[_0x7b7e('0x1')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id',_0x7b7e('0x2'),'timeout',_0x7b7e('0x3')],'include':[{'model':'User','as':_0x7b7e('0x4'),'attributes':['id',_0x7b7e('0x2'),_0x7b7e('0x5'),'smsPause']}]},'log':'getSmsQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index 896704b..8219363 100644 --- a/server/services/routing/rpc/smsQueueReport.js +++ b/server/services/routing/rpc/smsQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['../client','create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC'];(function(_0x43c2bb,_0x2d4ace){var _0x233a7f=function(_0x27b59b){while(--_0x27b59b){_0x43c2bb['push'](_0x43c2bb['shift']());}};_0x233a7f(++_0x2d4ace);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3){return client[_0x7995('0x2')]('CreateSmsQueueReport',{'body':_0x2722a3,'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x1902b4,_0x462a03){return client['Request'](_0x7995('0x5'),{'body':_0x462a03,'options':{'where':{'uniqueid':_0x1902b4},'order':[['id',_0x7995('0x6')]],'limit':0x1},'log':_0x7995('0x5')});}; \ No newline at end of file +var _0x9957=['../client','create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC'];(function(_0x579055,_0x3ff8e7){var _0x4e1980=function(_0x45150e){while(--_0x45150e){_0x579055['push'](_0x579055['shift']());}};_0x4e1980(++_0x3ff8e7);}(_0x9957,0x93));var _0x7995=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x9957[_0x19e35c];return _0x3e1fe8;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3){return client[_0x7995('0x2')]('CreateSmsQueueReport',{'body':_0x2722a3,'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x1902b4,_0x462a03){return client['Request'](_0x7995('0x5'),{'body':_0x462a03,'options':{'where':{'uniqueid':_0x1902b4},'order':[['id',_0x7995('0x6')]],'limit':0x1},'log':_0x7995('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 8941943..fb0612e 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(_0x4de2e4,_0x3142c3){var _0x364d5a=function(_0x1d4470){while(--_0x1d4470){_0x4de2e4['push'](_0x4de2e4['shift']());}};_0x364d5a(++_0x3142c3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xa9e0[_0x3054be];return _0x3df150;};'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(_0x270e18,_0x512fc3){var _0xf0137a=function(_0x37e002){while(--_0x37e002){_0x270e18['push'](_0x270e18['shift']());}};_0xf0137a(++_0x512fc3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xa9e0[_0x4ea69d];return _0x5318e0;};'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 54ec0c7..423a5ac 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 _0x687b=['addTagsToWhatsappInteraction','../client','update','updateWhatsappInteraction','addTags','Request','AddTagsToWhatsappInteraction'];(function(_0x2c6bc9,_0x4ababb){var _0x5408b4=function(_0x1d5021){while(--_0x1d5021){_0x2c6bc9['push'](_0x2c6bc9['shift']());}};_0x5408b4(++_0x4ababb);}(_0x687b,0x14a));var _0xb687=function(_0x32c012,_0xe3c576){_0x32c012=_0x32c012-0x0;var _0x48562e=_0x687b[_0x32c012];return _0x48562e;};'use strict';var client=require(_0xb687('0x0'));exports[_0xb687('0x1')]=function(_0xd000be,_0x26d69b){return client['Request']('UpdateWhatsappInteraction',{'body':_0x26d69b,'options':{'where':{'id':_0xd000be}},'log':_0xb687('0x2')});};exports[_0xb687('0x3')]=function(_0x36c468,_0x31bd0d){return client[_0xb687('0x4')](_0xb687('0x5'),{'body':_0x31bd0d,'options':{'where':{'id':_0x36c468}},'log':_0xb687('0x6')});}; \ No newline at end of file +var _0x41fe=['addTagsToWhatsappInteraction','../client','update','Request','UpdateWhatsappInteraction','updateWhatsappInteraction','addTags','AddTagsToWhatsappInteraction'];(function(_0x10daa1,_0x499fdc){var _0x5f1fa5=function(_0x107e29){while(--_0x107e29){_0x10daa1['push'](_0x10daa1['shift']());}};_0x5f1fa5(++_0x499fdc);}(_0x41fe,0xd1));var _0xe41f=function(_0x2f1762,_0xab43df){_0x2f1762=_0x2f1762-0x0;var _0x8ab21=_0x41fe[_0x2f1762];return _0x8ab21;};'use strict';var client=require(_0xe41f('0x0'));exports[_0xe41f('0x1')]=function(_0x38cf9f,_0x2c527f){return client[_0xe41f('0x2')](_0xe41f('0x3'),{'body':_0x2c527f,'options':{'where':{'id':_0x38cf9f}},'log':_0xe41f('0x4')});};exports[_0xe41f('0x5')]=function(_0x2e580b,_0x1c9625){return client[_0xe41f('0x2')](_0xe41f('0x6'),{'body':_0x1c9625,'options':{'where':{'id':_0x2e580b}},'log':_0xe41f('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index 9380a67..34625d9 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 _0x2272=['Request','createWhatsappMessage','../client','create'];(function(_0x17c1da,_0x36ecce){var _0x5552f5=function(_0x1cfc88){while(--_0x1cfc88){_0x17c1da['push'](_0x17c1da['shift']());}};_0x5552f5(++_0x36ecce);}(_0x2272,0x1a6));var _0x2227=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x2272[_0x14add3];return _0x4a174f;};'use strict';var client=require(_0x2227('0x0'));exports[_0x2227('0x1')]=function(_0x4e2c3a){return client[_0x2227('0x2')]('CreateWhatsappMessage',{'body':_0x4e2c3a,'log':_0x2227('0x3')});}; \ No newline at end of file +var _0x8f60=['CreateWhatsappMessage','createWhatsappMessage','Request'];(function(_0x14d382,_0x54b6bd){var _0x31c6a7=function(_0xc9bb74){while(--_0xc9bb74){_0x14d382['push'](_0x14d382['shift']());}};_0x31c6a7(++_0x54b6bd);}(_0x8f60,0xaa));var _0x08f6=function(_0x6c0123,_0x4c8d3b){_0x6c0123=_0x6c0123-0x0;var _0x5a87d2=_0x8f60[_0x6c0123];return _0x5a87d2;};'use strict';var client=require('../client');exports['create']=function(_0x185335){return client[_0x08f6('0x0')](_0x08f6('0x1'),{'body':_0x185335,'log':_0x08f6('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index 6e6dcf7..540611d 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 _0xd103=['name','timeout','strategy','Agents','getWhatsappQueues','Request','GetWhatsappQueue'];(function(_0x5288aa,_0x1f3cfe){var _0x4784d7=function(_0xa07983){while(--_0xa07983){_0x5288aa['push'](_0x5288aa['shift']());}};_0x4784d7(++_0x1f3cfe);}(_0xd103,0xa5));var _0x3d10=function(_0x22002b,_0x4da695){_0x22002b=_0x22002b-0x0;var _0x3072a0=_0xd103[_0x22002b];return _0x3072a0;};'use strict';var client=require('../client');exports[_0x3d10('0x0')]=function(){return function(){return client[_0x3d10('0x1')](_0x3d10('0x2'),{'options':{'raw':![],'attributes':['id',_0x3d10('0x3'),_0x3d10('0x4'),_0x3d10('0x5')],'include':[{'model':'User','as':_0x3d10('0x6'),'attributes':['id',_0x3d10('0x3'),'online','whatsappPause']}]},'log':_0x3d10('0x0')});};}; \ No newline at end of file +var _0x32a6=['name','timeout','strategy','User','Agents','online','../client','getWhatsappQueues','GetWhatsappQueue'];(function(_0x4907e9,_0x522042){var _0x59e793=function(_0x1de9b7){while(--_0x1de9b7){_0x4907e9['push'](_0x4907e9['shift']());}};_0x59e793(++_0x522042);}(_0x32a6,0xf9));var _0x632a=function(_0x3855a4,_0x195847){_0x3855a4=_0x3855a4-0x0;var _0x320e84=_0x32a6[_0x3855a4];return _0x320e84;};'use strict';var client=require(_0x632a('0x0'));exports[_0x632a('0x1')]=function(){return function(){return client['Request'](_0x632a('0x2'),{'options':{'raw':![],'attributes':['id',_0x632a('0x3'),_0x632a('0x4'),_0x632a('0x5')],'include':[{'model':_0x632a('0x6'),'as':_0x632a('0x7'),'attributes':['id',_0x632a('0x3'),_0x632a('0x8'),'whatsappPause']}]},'log':'getWhatsappQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index 95c6021..1e779a7 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 _0x5934=['Request','CreateWhatsappQueueReport','update','UpdateWhatsappQueueReport','DESC','create'];(function(_0x5c5df2,_0x367d02){var _0x3d6e09=function(_0x2c13a0){while(--_0x2c13a0){_0x5c5df2['push'](_0x5c5df2['shift']());}};_0x3d6e09(++_0x367d02);}(_0x5934,0x167));var _0x4593=function(_0x1b433f,_0xbfb267){_0x1b433f=_0x1b433f-0x0;var _0x52c22c=_0x5934[_0x1b433f];return _0x52c22c;};'use strict';var client=require('../client');exports[_0x4593('0x0')]=function(_0x242a75){return client[_0x4593('0x1')](_0x4593('0x2'),{'body':_0x242a75,'log':'CreateWhatsappQueueReport'});};exports[_0x4593('0x3')]=function(_0x5e3537,_0x2b9063){return client[_0x4593('0x1')](_0x4593('0x4'),{'body':_0x2b9063,'options':{'where':{'uniqueid':_0x5e3537},'order':[['id',_0x4593('0x5')]],'limit':0x1},'log':_0x4593('0x4')});}; \ No newline at end of file +var _0x4ba7=['UpdateWhatsappQueueReport','../client','create','CreateWhatsappQueueReport','update','Request'];(function(_0x50aa2e,_0xfbd6f0){var _0x5e07f0=function(_0x3ed540){while(--_0x3ed540){_0x50aa2e['push'](_0x50aa2e['shift']());}};_0x5e07f0(++_0xfbd6f0);}(_0x4ba7,0x139));var _0x74ba=function(_0x22a177,_0x5dccc4){_0x22a177=_0x22a177-0x0;var _0x58d22e=_0x4ba7[_0x22a177];return _0x58d22e;};'use strict';var client=require(_0x74ba('0x0'));exports[_0x74ba('0x1')]=function(_0x44c578){return client['Request']('CreateWhatsappQueueReport',{'body':_0x44c578,'log':_0x74ba('0x2')});};exports[_0x74ba('0x3')]=function(_0x336e8a,_0x3f8f6d){return client[_0x74ba('0x4')]('UpdateWhatsappQueueReport',{'body':_0x3f8f6d,'options':{'where':{'uniqueid':_0x336e8a},'order':[['id','DESC']],'limit':0x1},'log':_0x74ba('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/server/applications/agent.js b/server/services/routing/server/applications/agent.js index 77e7288..850db84 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 _0xe13f=['agents','timeout','createQueue','channel','format','START:%s','rules','end','close','next','stop','[%s][QUEUE]\x20%s','validate','util','../../../../config/logger','routing','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','name','toLowerCase','consequence','length','error','[%s][AGENT]\x20%s','map','message','join','find'];(function(_0x44ea1b,_0x36bbd3){var _0x239690=function(_0x3ec34b){while(--_0x3ec34b){_0x44ea1b['push'](_0x44ea1b['shift']());}};_0x239690(++_0x36bbd3);}(_0xe13f,0x14c));var _0xfe13=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xe13f[_0x47a7d0];return _0xb9bd08;};'use strict';var schema=require(_0xfe13('0x0'));var _=require('lodash');var util=require(_0xfe13('0x1'));var seqqueue=require('seq-queue');var logger=require(_0xfe13('0x2'))(_0xfe13('0x3'));var strategy=require(_0xfe13('0x4'));var queue=schema({'name':{'type':_0xfe13('0x5'),'required':!![],'message':_0xfe13('0x6')},'timeout':{'type':_0xfe13('0x7'),'message':_0xfe13('0x8')}});function writeLog(_0xf830a0,_0xef1565,_0xd5235a){return logger[_0xfe13('0x9')](util['format']('[%s][AGENT][NAME:%s][STATUS:%s]',_0xf830a0,_0xef1565['name'],_0xd5235a));}function handleFindAgent(_0x491459){return function(_0x3795df){return _0x3795df[_0xfe13('0xa')][_0xfe13('0xb')]()===_0x491459[_0xfe13('0xb')]();};}exports[_0xfe13('0xc')]=function(_0x1f23bf,_0x1968de,_0xfebf89,_0x28bff8){return function(_0x889fb1){try{var _0x2fc2a4={'name':_0x1968de[0x0],'timeout':_0x1968de[0x1]};var _0x1556f5=queue['validate'](_0x2fc2a4,{'typecast':!![]});if(_0x1556f5[_0xfe13('0xd')]){logger[_0xfe13('0xe')](_0xfe13('0xf'),_0x1f23bf,_[_0xfe13('0x10')](_0x1556f5,_0xfe13('0x11'))[_0xfe13('0x12')](',\x20'));_0x889fb1['stop']();}else{var _0x1a826b=_[_0xfe13('0x13')](_0xfebf89[_0xfe13('0x14')],handleFindAgent(_0x2fc2a4[_0xfe13('0xa')]));if(_0x1a826b){var _0x141b03=(_0x2fc2a4[_0xfe13('0x15')]||0xa)*0x3e8;var _0x5c69b0,_0x448eef;var _0x3a3aca=seqqueue[_0xfe13('0x16')](_0x141b03);_0x3a3aca['id']=_0x1f23bf;_0x3a3aca['atimeout']=_0x141b03;_0x3a3aca['channel']=_0x28bff8[_0xfe13('0x17')];writeLog(_0x1f23bf,_0x1a826b,util[_0xfe13('0x18')](_0xfe13('0x19'),_0x141b03));_0xfebf89[_0xfe13('0x1a')][_0x1f23bf]['on'](_0xfe13('0x1b'),function(){logger[_0xfe13('0x9')]('[%s][AGENT]\x20ROUTING\x20STOPPED',_0x1f23bf);clearTimeout(_0x448eef);_0x448eef=undefined;_0x3a3aca[_0xfe13('0x1c')]();if(_0xfebf89[_0xfe13('0x1a')][_0x1f23bf]){delete _0xfebf89[_0xfe13('0x1a')][_0x1f23bf];}_0x889fb1['stop']();});_0xfebf89['rules'][_0x1f23bf]['on']('complete',function(){if(_0xfebf89[_0xfe13('0x1a')][_0x1f23bf]){delete _0xfebf89['rules'][_0x1f23bf];}});_0x448eef=setTimeout(function(){logger[_0xfe13('0x9')]('[%s][AGENT]\x20ROUTING\x20END',_0x1f23bf);clearTimeout(_0x448eef);_0x3a3aca[_0xfe13('0x1c')]();_0x889fb1[_0xfe13('0x1d')]();},_0x141b03);strategy['agent'](_0x3a3aca,_0x1a826b,_0xfebf89,_0x28bff8);}else{logger[_0xfe13('0xe')]('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0x1f23bf,_0x2fc2a4[_0xfe13('0xa')]);_0x889fb1[_0xfe13('0x1e')]();}}}catch(_0xa3d00d){console['log'](_0xa3d00d);logger[_0xfe13('0xe')](_0xfe13('0x1f'),_0x1f23bf,_0xa3d00d['stack']);_0x889fb1[_0xfe13('0x1e')]();}};}; \ No newline at end of file +var _0x407b=['consequence','length','[%s][AGENT]\x20%s','map','message','join','stop','find','agents','name','timeout','createQueue','atimeout','channel','format','START:%s','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','rules','complete','[%s][AGENT]\x20ROUTING\x20END','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','error','[%s][QUEUE]\x20%s','validate','lodash','seq-queue','../../../../config/logger','routing','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','info','toLowerCase'];(function(_0x58c2ac,_0x58c01b){var _0x10cb51=function(_0x57d85d){while(--_0x57d85d){_0x58c2ac['push'](_0x58c2ac['shift']());}};_0x10cb51(++_0x58c01b);}(_0x407b,0x1a2));var _0xb407=function(_0x4e8dc4,_0x4d4dbc){_0x4e8dc4=_0x4e8dc4-0x0;var _0x259d3b=_0x407b[_0x4e8dc4];return _0x259d3b;};'use strict';var schema=require(_0xb407('0x0'));var _=require(_0xb407('0x1'));var util=require('util');var seqqueue=require(_0xb407('0x2'));var logger=require(_0xb407('0x3'))(_0xb407('0x4'));var strategy=require(_0xb407('0x5'));var queue=schema({'name':{'type':_0xb407('0x6'),'required':!![],'message':_0xb407('0x7')},'timeout':{'type':_0xb407('0x8'),'message':'timeout\x20is\x20a\x20number'}});function writeLog(_0x40e50d,_0x1a678e,_0x24c7f8){return logger[_0xb407('0x9')](util['format']('[%s][AGENT][NAME:%s][STATUS:%s]',_0x40e50d,_0x1a678e['name'],_0x24c7f8));}function handleFindAgent(_0x46bea0){return function(_0x32a2e1){return _0x32a2e1['name'][_0xb407('0xa')]()===_0x46bea0['toLowerCase']();};}exports[_0xb407('0xb')]=function(_0xd65be7,_0x3d8d8e,_0x35ea8f,_0x222683){return function(_0x31b4b0){try{var _0x501d35={'name':_0x3d8d8e[0x0],'timeout':_0x3d8d8e[0x1]};var _0x38b762=queue['validate'](_0x501d35,{'typecast':!![]});if(_0x38b762[_0xb407('0xc')]){logger['error'](_0xb407('0xd'),_0xd65be7,_[_0xb407('0xe')](_0x38b762,_0xb407('0xf'))[_0xb407('0x10')](',\x20'));_0x31b4b0[_0xb407('0x11')]();}else{var _0x132571=_[_0xb407('0x12')](_0x35ea8f[_0xb407('0x13')],handleFindAgent(_0x501d35[_0xb407('0x14')]));if(_0x132571){var _0x304348=(_0x501d35[_0xb407('0x15')]||0xa)*0x3e8;var _0x44ce0a,_0x5b8013;var _0x1f70c1=seqqueue[_0xb407('0x16')](_0x304348);_0x1f70c1['id']=_0xd65be7;_0x1f70c1[_0xb407('0x17')]=_0x304348;_0x1f70c1[_0xb407('0x18')]=_0x222683[_0xb407('0x18')];writeLog(_0xd65be7,_0x132571,util[_0xb407('0x19')](_0xb407('0x1a'),_0x304348));_0x35ea8f['rules'][_0xd65be7]['on'](_0xb407('0x1b'),function(){logger[_0xb407('0x9')](_0xb407('0x1c'),_0xd65be7);clearTimeout(_0x5b8013);_0x5b8013=undefined;_0x1f70c1[_0xb407('0x1d')]();if(_0x35ea8f[_0xb407('0x1e')][_0xd65be7]){delete _0x35ea8f[_0xb407('0x1e')][_0xd65be7];}_0x31b4b0[_0xb407('0x11')]();});_0x35ea8f[_0xb407('0x1e')][_0xd65be7]['on'](_0xb407('0x1f'),function(){if(_0x35ea8f[_0xb407('0x1e')][_0xd65be7]){delete _0x35ea8f[_0xb407('0x1e')][_0xd65be7];}});_0x5b8013=setTimeout(function(){logger[_0xb407('0x9')](_0xb407('0x20'),_0xd65be7);clearTimeout(_0x5b8013);_0x1f70c1['close']();_0x31b4b0[_0xb407('0x21')]();},_0x304348);strategy[_0xb407('0x22')](_0x1f70c1,_0x132571,_0x35ea8f,_0x222683);}else{logger['error'](_0xb407('0x23'),_0xd65be7,_0x501d35[_0xb407('0x14')]);_0x31b4b0[_0xb407('0x11')]();}}}catch(_0x1e3ce0){console[_0xb407('0x24')](_0x1e3ce0);logger[_0xb407('0x25')](_0xb407('0x26'),_0xd65be7,_0x1e3ce0['stack']);_0x31b4b0['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 6a256ee..e0e10da 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 _0x6086=['channel','toString','postText','providerName','amazonlex','providerResponse','create','then','dialogState','lodash','moment','aws-sdk','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../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','out','sms','whatsapp','phone','chat','account','upperFirst','InteractionId','created','isEmpty','body','getMustacheRender','Message','catch','error','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','message'];(function(_0x31e025,_0x4fb40){var _0x14dc32=function(_0x1cdde9){while(--_0x1cdde9){_0x31e025['push'](_0x31e025['shift']());}};_0x14dc32(++_0x4fb40);}(_0x6086,0x147));var _0x6608=function(_0x4311bd,_0x4b4e4b){_0x4311bd=_0x4311bd-0x0;var _0xe2f809=_0x6086[_0x4311bd];return _0xe2f809;};'use strict';var _=require(_0x6608('0x0'));var moment=require(_0x6608('0x1'));var AWS=require(_0x6608('0x2'));var utils=require('./utils');var logger=require(_0x6608('0x3'))(_0x6608('0x4'));var rpc={'chatMessage':require(_0x6608('0x5')),'openchannelMessage':require(_0x6608('0x6')),'mailMessage':require(_0x6608('0x7')),'smsMessage':require(_0x6608('0x8')),'faxMessage':require(_0x6608('0x9')),'whatsappMessage':require(_0x6608('0xa'))};exports[_0x6608('0xb')]=function(_0x24d5c2,_0x49de6e){return function(_0x3b7f62){try{if(!_[_0x6608('0xc')](this[_0x6608('0xd')][_0x6608('0xe')])){logger[_0x6608('0xf')](_0x6608('0x10'),_0x24d5c2,_0x6608('0x11'));return _0x3b7f62[_0x6608('0x12')]();}var _0x413e8c={'ContactId':this[_0x6608('0x13')]['id'],'sentAt':moment()[_0x6608('0x14')](_0x6608('0x15')),'direction':_0x6608('0x16')};if(this['channel']===_0x6608('0x17')||this['channel']===_0x6608('0x18')){_0x413e8c['phone']=this['interaction'][_0x6608('0x19')];}var _0x2a6435=this['channel'];if(_0x2a6435===_0x6608('0x1a')){_0x413e8c['ChatWebsiteId']=this[_0x6608('0x1b')]['id'];}else{_0x413e8c[_[_0x6608('0x1c')](_0x2a6435)+'AccountId']=this[_0x6608('0x1b')]['id'];}_0x413e8c[_[_0x6608('0x1c')](_0x2a6435)+_0x6608('0x1d')]=this[_0x6608('0xd')]['id'];if(this[_0x6608('0xd')][_0x6608('0x1e')]){var _0x531ec6=_0x49de6e[0x4];if(!_[_0x6608('0x1f')](_0x531ec6)){_0x413e8c[_0x6608('0x20')]=utils[_0x6608('0x21')](_0x531ec6,this);return rpc[_0x2a6435+_0x6608('0x22')]['create'](_0x413e8c)['then'](function(_0x449603){logger[_0x6608('0xf')]('[%s][AMAZONLEX]\x20%s',_0x24d5c2,_0x413e8c['body']);})[_0x6608('0x23')](function(_0x5a1d6a){logger[_0x6608('0x24')](_0x6608('0x10'),_0x24d5c2,JSON[_0x6608('0x25')](_0x5a1d6a));})[_0x6608('0x26')](function(){logger['info'](_0x6608('0x27'),_0x24d5c2);_0x3b7f62[_0x6608('0x28')]();});}else{logger[_0x6608('0xf')](_0x6608('0x29'),_0x24d5c2);_0x3b7f62[_0x6608('0x28')]();}}else{var _0x275de7=this;var _0x2f6e83=new AWS[(_0x6608('0x2a'))]({'accessKeyId':_0x49de6e[0x0],'secretAccessKey':_0x49de6e[0x1],'region':_0x49de6e[0x2]});var _0x4154e9={'botAlias':'$LATEST','botName':_0x49de6e[0x3],'inputText':this[_0x6608('0x2b')]['body'],'userId':this[_0x6608('0x2c')]+':'+this[_0x6608('0xd')]['id'][_0x6608('0x2d')]()};_0x2f6e83[_0x6608('0x2e')](_0x4154e9,function(_0x4437f9,_0x46fa55){if(_0x4437f9){logger[_0x6608('0x24')]('[%s][AMAZONLEX]\x20%s',_0x24d5c2,_0x4437f9['message']);_0x3b7f62[_0x6608('0x12')]();}else if(_0x46fa55&&_0x46fa55[_0x6608('0x2b')]){_0x275de7[_0x6608('0x20')]['amazonlex']=_0x46fa55;_0x413e8c[_0x6608('0x20')]=_0x46fa55[_0x6608('0x2b')];_0x413e8c[_0x6608('0x2f')]=_0x6608('0x30');_0x413e8c[_0x6608('0x31')]=JSON[_0x6608('0x25')](_0x46fa55);return rpc[_0x2a6435+_0x6608('0x22')][_0x6608('0x32')](_0x413e8c)[_0x6608('0x33')](function(_0x26684e){logger[_0x6608('0xf')](_0x6608('0x10'),_0x24d5c2,_0x413e8c[_0x6608('0x20')]);if(_0x46fa55[_0x6608('0x34')]=='Failed'){_0x3b7f62[_0x6608('0x12')]();}else{_0x3b7f62['stop']();}})[_0x6608('0x23')](function(_0x35cc8c){logger['error'](_0x6608('0x10'),_0x24d5c2,JSON[_0x6608('0x25')](_0x35cc8c));_0x3b7f62[_0x6608('0x12')]();});}else{_0x3b7f62[_0x6608('0x12')]();}});}}catch(_0x567306){logger[_0x6608('0x24')](_0x6608('0x10'),_0x24d5c2,JSON['stringify'](_0x567306));_0x3b7f62[_0x6608('0x28')]();}};}; \ No newline at end of file +var _0x6ee7=['providerName','providerResponse','stringify','dialogState','Failed','moment','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','isNil','UserId','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','format','YYYY-MM-DD\x20HH:mm:ss','out','sms','channel','whatsapp','phone','interaction','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','body','getMustacheRender','Message','create','then','catch','error','info','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','message','amazonlex'];(function(_0x20cbc6,_0x91d8b6){var _0x78bb59=function(_0x209f73){while(--_0x209f73){_0x20cbc6['push'](_0x20cbc6['shift']());}};_0x78bb59(++_0x91d8b6);}(_0x6ee7,0x69));var _0x76ee=function(_0x535a4d,_0x58636c){_0x535a4d=_0x535a4d-0x0;var _0x25b653=_0x6ee7[_0x535a4d];return _0x25b653;};'use strict';var _=require('lodash');var moment=require(_0x76ee('0x0'));var AWS=require('aws-sdk');var utils=require(_0x76ee('0x1'));var logger=require(_0x76ee('0x2'))(_0x76ee('0x3'));var rpc={'chatMessage':require(_0x76ee('0x4')),'openchannelMessage':require(_0x76ee('0x5')),'mailMessage':require(_0x76ee('0x6')),'smsMessage':require(_0x76ee('0x7')),'faxMessage':require(_0x76ee('0x8')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x76ee('0x9')]=function(_0x23607a,_0x115311){return function(_0x3e7195){try{if(!_[_0x76ee('0xa')](this['interaction'][_0x76ee('0xb')])){logger['info'](_0x76ee('0xc'),_0x23607a,_0x76ee('0xd'));return _0x3e7195[_0x76ee('0xe')]();}var _0xc2b4d8={'ContactId':this['contact']['id'],'sentAt':moment()[_0x76ee('0xf')](_0x76ee('0x10')),'direction':_0x76ee('0x11')};if(this['channel']===_0x76ee('0x12')||this[_0x76ee('0x13')]===_0x76ee('0x14')){_0xc2b4d8[_0x76ee('0x15')]=this[_0x76ee('0x16')][_0x76ee('0x15')];}var _0x372d62=this[_0x76ee('0x13')];if(_0x372d62===_0x76ee('0x17')){_0xc2b4d8[_0x76ee('0x18')]=this[_0x76ee('0x19')]['id'];}else{_0xc2b4d8[_[_0x76ee('0x1a')](_0x372d62)+_0x76ee('0x1b')]=this[_0x76ee('0x19')]['id'];}_0xc2b4d8[_['upperFirst'](_0x372d62)+_0x76ee('0x1c')]=this[_0x76ee('0x16')]['id'];if(this['interaction'][_0x76ee('0x1d')]){var _0x45915d=_0x115311[0x4];if(!_['isEmpty'](_0x45915d)){_0xc2b4d8[_0x76ee('0x1e')]=utils[_0x76ee('0x1f')](_0x45915d,this);return rpc[_0x372d62+_0x76ee('0x20')][_0x76ee('0x21')](_0xc2b4d8)[_0x76ee('0x22')](function(_0x1d7554){logger['info'](_0x76ee('0xc'),_0x23607a,_0xc2b4d8[_0x76ee('0x1e')]);})[_0x76ee('0x23')](function(_0xcd619){logger[_0x76ee('0x24')](_0x76ee('0xc'),_0x23607a,JSON['stringify'](_0xcd619));})['finally'](function(){logger[_0x76ee('0x25')](_0x76ee('0x26'),_0x23607a);_0x3e7195[_0x76ee('0x27')]();});}else{logger[_0x76ee('0x25')](_0x76ee('0x28'),_0x23607a);_0x3e7195[_0x76ee('0x27')]();}}else{var _0x2cdffa=this;var _0x56d79a=new AWS[(_0x76ee('0x29'))]({'accessKeyId':_0x115311[0x0],'secretAccessKey':_0x115311[0x1],'region':_0x115311[0x2]});var _0x26e3c3={'botAlias':_0x76ee('0x2a'),'botName':_0x115311[0x3],'inputText':this[_0x76ee('0x2b')][_0x76ee('0x1e')],'userId':this['channel']+':'+this[_0x76ee('0x16')]['id']['toString']()};_0x56d79a['postText'](_0x26e3c3,function(_0x818d4b,_0x1a83ed){if(_0x818d4b){logger[_0x76ee('0x24')](_0x76ee('0xc'),_0x23607a,_0x818d4b[_0x76ee('0x2b')]);_0x3e7195[_0x76ee('0xe')]();}else if(_0x1a83ed&&_0x1a83ed[_0x76ee('0x2b')]){_0x2cdffa[_0x76ee('0x1e')][_0x76ee('0x2c')]=_0x1a83ed;_0xc2b4d8[_0x76ee('0x1e')]=_0x1a83ed[_0x76ee('0x2b')];_0xc2b4d8[_0x76ee('0x2d')]='amazonlex';_0xc2b4d8[_0x76ee('0x2e')]=JSON[_0x76ee('0x2f')](_0x1a83ed);return rpc[_0x372d62+'Message']['create'](_0xc2b4d8)[_0x76ee('0x22')](function(_0x284081){logger['info'](_0x76ee('0xc'),_0x23607a,_0xc2b4d8[_0x76ee('0x1e')]);if(_0x1a83ed[_0x76ee('0x30')]==_0x76ee('0x31')){_0x3e7195[_0x76ee('0xe')]();}else{_0x3e7195['stop']();}})[_0x76ee('0x23')](function(_0x2ba786){logger[_0x76ee('0x24')](_0x76ee('0xc'),_0x23607a,JSON[_0x76ee('0x2f')](_0x2ba786));_0x3e7195[_0x76ee('0xe')]();});}else{_0x3e7195[_0x76ee('0xe')]();}});}}catch(_0x1de818){logger[_0x76ee('0x24')]('[%s][AMAZONLEX]\x20%s',_0x23607a,JSON['stringify'](_0x1de818));_0x3e7195[_0x76ee('0x27')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/autoreply.js b/server/services/routing/server/applications/autoreply.js index 1b02e80..296b4d6 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 _0x4801=['account','InteractionId','Message','Smtp','service','host','port','secure','authentication','auth','user','inReplyTo','messageId','html','','replace','','headers','auto-replied','All','auto_reply','sendMailMessage','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','catch','error','[RPC][%s][AUTOREPLY]\x20%s','finally','resolve','then','update','stringify','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','Interaction','stop','lodash','./utils','../../../../config/logger','routing','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/whatsappInteraction','consequence','channel','mail','body','isAutoreply','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','interaction','created','Autoreply\x20already\x20sent','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','contact','format','out','getMustacheRender','message','from','phone','read','subject','startsWith','ChatWebsiteId','upperFirst','AccountId'];(function(_0x53b8e0,_0x55d46e){var _0x10630c=function(_0x3189aa){while(--_0x3189aa){_0x53b8e0['push'](_0x53b8e0['shift']());}};_0x10630c(++_0x55d46e);}(_0x4801,0x1f2));var _0x1480=function(_0x32ad42,_0x4c6948){_0x32ad42=_0x32ad42-0x0;var _0x672a14=_0x4801[_0x32ad42];return _0x672a14;};'use strict';var _=require(_0x1480('0x0'));var moment=require('moment');var utils=require(_0x1480('0x1'));var logger=require(_0x1480('0x2'))(_0x1480('0x3'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x1480('0x4')),'smsMessage':require(_0x1480('0x5')),'faxMessage':require(_0x1480('0x6')),'whatsappMessage':require(_0x1480('0x7')),'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x1480('0x8')),'mailInteraction':require(_0x1480('0x9')),'smsInteraction':require(_0x1480('0xa')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x1480('0xb'))};var mailRpc=require('../../mailRpc');exports[_0x1480('0xc')]=function(_0x532614,_0x90098b,_0x5e619a,_0x56e726){return function(_0x184755){try{var _0x57700b=this[_0x1480('0xd')];if(_0x57700b===_0x1480('0xe')&&_0x56e726[_0x1480('0xf')][_0x1480('0x10')]){logger[_0x1480('0x11')](_0x1480('0x12'),_0x532614,_0x1480('0x13'));return _0x184755[_0x1480('0x14')]();}if(_0x90098b[0x0]==='1'&&(_[_0x1480('0x15')](this[_0x1480('0x16')][_0x1480('0x17')])||!this[_0x1480('0x16')][_0x1480('0x17')])){logger[_0x1480('0x11')](_0x1480('0x12'),_0x532614,_0x1480('0x18'));return _0x184755['next']();}if(_0x90098b[0x0]==='2'&&this[_0x1480('0x16')][_0x1480('0x19')]){logger[_0x1480('0x11')](_0x1480('0x1a'),_0x532614,_0x1480('0x1b'));return _0x184755[_0x1480('0x14')]();}var _0x16bf21={'ContactId':this[_0x1480('0x1c')]['id'],'sentAt':moment()[_0x1480('0x1d')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x1480('0x1e')};if(this[_0x1480('0xd')]==='mail'){_0x16bf21[_0x1480('0xf')]=utils[_0x1480('0x1f')](_0x90098b[0x2],this);}else{_0x16bf21[_0x1480('0xf')]=utils[_0x1480('0x1f')](_0x90098b[0x1],this);}if(this[_0x1480('0x20')]){_0x16bf21['to']=this[_0x1480('0x20')][_0x1480('0x21')]||'';if(this['channel']===_0x1480('0xe')&&_0x90098b[0x1]==='1'){_0x16bf21['cc']=this[_0x1480('0x20')]['cc']||'';}_0x16bf21[_0x1480('0x21')]=this[_0x1480('0x20')]['to']||'';_0x16bf21[_0x1480('0x22')]=this['message'][_0x1480('0x22')]||'';_0x16bf21[_0x1480('0x23')]=!![];if(this['message'][_0x1480('0x24')]){_0x16bf21[_0x1480('0x24')]='';_0x16bf21[_0x1480('0x24')]+=_[_0x1480('0x25')](this[_0x1480('0x20')][_0x1480('0x24')],'Re:')?'':'Re:\x20';_0x16bf21[_0x1480('0x24')]+=this[_0x1480('0x20')][_0x1480('0x24')];}}if(this[_0x1480('0xd')]==='chat'){_0x16bf21[_0x1480('0x26')]=this['account']['id'];}else{_0x16bf21[_[_0x1480('0x27')](this[_0x1480('0xd')])+_0x1480('0x28')]=this[_0x1480('0x29')]['id'];}_0x16bf21[_[_0x1480('0x27')](this['channel'])+_0x1480('0x2a')]=this[_0x1480('0x16')]['id'];var _0x5d9018=this[_0x1480('0x16')];if(rpc[this['channel']+_0x1480('0x2b')]){if(this[_0x1480('0xd')]===_0x1480('0xe')){var _0x3f92c7={'tls':{'rejectUnauthorized':![]}};if(this[_0x1480('0x29')][_0x1480('0x2c')][_0x1480('0x2d')]){_0x3f92c7[_0x1480('0x2d')]=this[_0x1480('0x29')][_0x1480('0x2c')][_0x1480('0x2d')];}else{_0x3f92c7[_0x1480('0x2e')]=this['account'][_0x1480('0x2c')][_0x1480('0x2e')];_0x3f92c7[_0x1480('0x2f')]=this[_0x1480('0x29')][_0x1480('0x2c')][_0x1480('0x2f')];_0x3f92c7[_0x1480('0x30')]=this['account'][_0x1480('0x2c')][_0x1480('0x30')];}if(this[_0x1480('0x29')]['Smtp'][_0x1480('0x31')]){_0x3f92c7[_0x1480('0x32')]={'user':this['account'][_0x1480('0x2c')][_0x1480('0x33')],'pass':this['account']['Smtp']['pass']};}_0x16bf21[_0x1480('0x34')]=this[_0x1480('0x20')][_0x1480('0x35')];_0x16bf21[_0x1480('0x36')]=_0x1480('0x37')+_[_0x1480('0x38')](_0x16bf21['body'],_0x1480('0x39'),'','replace','';_0x4a4881[_0x295b('0x36')]={'Auto-Submitted':_0x295b('0x37'),'X-Auto-Response-Suppress':_0x295b('0x38'),'Precedence':_0x295b('0x39')};return mailRpc['sendMailMessage'](_0x5b87e7,_0x4a4881)[_0x295b('0x3a')](function(_0x5c83d7){logger[_0x295b('0x12')](_0x295b('0x3b'),_0x54fad5);_0x4a4881['messageId']=_0x5c83d7[_0x295b('0x1f')][_0x295b('0x31')];return rpc[_0x2bcf0e+'Message'][_0x295b('0x3c')](_0x4a4881);})[_0x295b('0x3a')](function(_0x20dc88){logger['info'](_0x295b('0x13'),_0x54fad5,JSON[_0x295b('0x3d')](_0x20dc88));})[_0x295b('0x3e')](function(_0x23fccb){logger[_0x295b('0x3f')](_0x295b('0x40'),_0x54fad5,JSON[_0x295b('0x3d')](_0x23fccb));})['finally'](function(){Promise['resolve']()[_0x295b('0x3a')](function(){if(_0x1c7cd2[0x0]!=='2'||_0x2460fb[_0x295b('0x41')])return;return rpc[_0x2bcf0e+_0x295b('0x42')][_0x295b('0x43')](_0x2460fb['id'],{'autoreplyExecuted':!![]})[_0x295b('0x3a')](function(_0x41493b){logger[_0x295b('0x12')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x54fad5,JSON[_0x295b('0x3d')](_0x41493b));})[_0x295b('0x3e')](function(_0x5f215d){logger[_0x295b('0x3f')]('[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x54fad5,JSON[_0x295b('0x3d')](_0x5f215d));});})[_0x295b('0x3a')](function(){_0x336f8b[_0x295b('0x15')]();});});}else{return rpc[this[_0x295b('0xf')]+'Message'][_0x295b('0x3c')](_0x4a4881)[_0x295b('0x3a')](function(_0x267e57){logger[_0x295b('0x12')]('[%s][AUTOREPLY]\x20%s',_0x54fad5,_0x4a4881['body']);})[_0x295b('0x3e')](function(_0x354848){logger[_0x295b('0x3f')](_0x295b('0x13'),_0x54fad5,JSON[_0x295b('0x3d')](_0x354848));})[_0x295b('0x44')](function(){Promise[_0x295b('0x45')]()[_0x295b('0x3a')](function(){if(_0x1c7cd2[0x0]!=='2'||_0x2460fb[_0x295b('0x41')])return;return rpc[_0x2bcf0e+_0x295b('0x42')][_0x295b('0x43')](_0x2460fb['id'],{'autoreplyExecuted':!![]})['then'](function(_0x47da9f){logger[_0x295b('0x12')](_0x295b('0x1a'),_0x54fad5,JSON[_0x295b('0x3d')](_0x47da9f));})[_0x295b('0x3e')](function(_0x466d21){logger[_0x295b('0x3f')](_0x295b('0x46'),_0x54fad5,JSON[_0x295b('0x3d')](_0x466d21));});})['then'](function(){_0x336f8b['next']();});});}}}catch(_0x294613){logger[_0x295b('0x3f')]('[%s][AUTOREPLY]\x20%s',_0x54fad5,JSON['stringify'](_0x294613));_0x336f8b['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/close.js b/server/services/routing/server/applications/close.js index 5be4c09..22480e2 100644 --- a/server/services/routing/server/applications/close.js +++ b/server/services/routing/server/applications/close.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd620=['stop','moment','../../../../config/logger','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction','update','interaction','catch','[%s][CLOSE]\x20%s','stringify','finally'];(function(_0x262f42,_0x4a6ca0){var _0x2b0712=function(_0x406fb8){while(--_0x406fb8){_0x262f42['push'](_0x262f42['shift']());}};_0x2b0712(++_0x4a6ca0);}(_0xd620,0x119));var _0x0d62=function(_0x3efe04,_0x3e9219){_0x3efe04=_0x3efe04-0x0;var _0xdee702=_0xd620[_0x3efe04];return _0xdee702;};'use strict';var moment=require(_0x0d62('0x0'));var logger=require(_0x0d62('0x1'))('routing');var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x0d62('0x2')),'smsInteraction':require(_0x0d62('0x3')),'mailInteraction':require(_0x0d62('0x4')),'faxInteraction':require(_0x0d62('0x5')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};exports[_0x0d62('0x6')]=function(_0xe05bbe,_0x3fc203,_0x54ba79,_0x1344c9){return function(_0x1ba3f1){try{logger[_0x0d62('0x7')](_0x0d62('0x8'),_0xe05bbe,_0x3fc203[0x0]);var _0x33632a={'closed':0x1,'closedAt':moment()['format'](_0x0d62('0x9')),'closeReason':_0x0d62('0xa'),'disposition':_0x3fc203[0x0]};if(rpc[_0x1344c9[_0x0d62('0xb')]+'Interaction']){rpc[_0x1344c9[_0x0d62('0xb')]+_0x0d62('0xc')][_0x0d62('0xd')](_0x1344c9[_0x0d62('0xe')]['id'],_0x33632a)['then'](function(_0xc6e778){logger[_0x0d62('0x7')]('[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!',_0xe05bbe,_0x1344c9[_0x0d62('0xe')]['id']);})[_0x0d62('0xf')](function(_0x544c1f){logger['error'](_0x0d62('0x10'),_0xe05bbe,JSON[_0x0d62('0x11')](_0x544c1f));})[_0x0d62('0x12')](function(){_0x1ba3f1['stop']();});}}catch(_0x36d25a){logger['error'](_0x0d62('0x10'),_0xe05bbe,JSON[_0x0d62('0x11')](_0x36d25a));_0x1ba3f1[_0x0d62('0x13')]();}};}; \ No newline at end of file +var _0xc77c=['routing','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','YYYY-MM-DD\x20HH:mm:ss','system','Interaction','channel','update','interaction','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','error','[%s][CLOSE]\x20%s','stop','moment'];(function(_0x2a7ac2,_0x3f92f7){var _0x34f3ca=function(_0x2069e5){while(--_0x2069e5){_0x2a7ac2['push'](_0x2a7ac2['shift']());}};_0x34f3ca(++_0x3f92f7);}(_0xc77c,0x1df));var _0xcc77=function(_0x186ce7,_0x2acc42){_0x186ce7=_0x186ce7-0x0;var _0x1fc00a=_0xc77c[_0x186ce7];return _0x1fc00a;};'use strict';var moment=require(_0xcc77('0x0'));var logger=require('../../../../config/logger')(_0xcc77('0x1'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0xcc77('0x2')),'faxInteraction':require(_0xcc77('0x3')),'whatsappInteraction':require(_0xcc77('0x4'))};exports[_0xcc77('0x5')]=function(_0x5e8215,_0x39cd18,_0x3588f8,_0x38e262){return function(_0x603f0){try{logger[_0xcc77('0x6')](_0xcc77('0x7'),_0x5e8215,_0x39cd18[0x0]);var _0x410bcf={'closed':0x1,'closedAt':moment()['format'](_0xcc77('0x8')),'closeReason':_0xcc77('0x9'),'disposition':_0x39cd18[0x0]};if(rpc[_0x38e262['channel']+_0xcc77('0xa')]){rpc[_0x38e262[_0xcc77('0xb')]+_0xcc77('0xa')][_0xcc77('0xc')](_0x38e262[_0xcc77('0xd')]['id'],_0x410bcf)[_0xcc77('0xe')](function(_0x327cdd){logger[_0xcc77('0x6')](_0xcc77('0xf'),_0x5e8215,_0x38e262['interaction']['id']);})[_0xcc77('0x10')](function(_0x5bec9c){logger[_0xcc77('0x11')](_0xcc77('0x12'),_0x5e8215,JSON['stringify'](_0x5bec9c));})['finally'](function(){_0x603f0[_0xcc77('0x13')]();});}}catch(_0xf298ce){logger[_0xcc77('0x11')](_0xcc77('0x12'),_0x5e8215,JSON['stringify'](_0xf298ce));_0x603f0['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflow.js b/server/services/routing/server/applications/dialogflow.js index e1cdb1a..58c623b 100644 --- a/server/services/routing/server/applications/dialogflow.js +++ b/server/services/routing/server/applications/dialogflow.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdc59=['error','stringify','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','message','dialogflow','speech','providerName','providerResponse','then','metadata','endConversation','lodash','moment','apiai-promise','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','created','body','getMustacheRender','Message','create','catch'];(function(_0xd388f8,_0x42ef6b){var _0x4fa313=function(_0x3cdf7f){while(--_0x3cdf7f){_0xd388f8['push'](_0xd388f8['shift']());}};_0x4fa313(++_0x42ef6b);}(_0xdc59,0x12c));var _0x9dc5=function(_0x2d89ce,_0x24d58d){_0x2d89ce=_0x2d89ce-0x0;var _0x3fad10=_0xdc59[_0x2d89ce];return _0x3fad10;};'use strict';var _=require(_0x9dc5('0x0'));var moment=require(_0x9dc5('0x1'));var apiai=require(_0x9dc5('0x2'));var md5=require('md5');var utils=require('./utils');var logger=require(_0x9dc5('0x3'))(_0x9dc5('0x4'));var rpc={'chatMessage':require(_0x9dc5('0x5')),'openchannelMessage':require(_0x9dc5('0x6')),'mailMessage':require(_0x9dc5('0x7')),'smsMessage':require(_0x9dc5('0x8')),'faxMessage':require(_0x9dc5('0x9')),'whatsappMessage':require(_0x9dc5('0xa'))};exports[_0x9dc5('0xb')]=function(_0x48beee,_0x42941b){return function(_0x10b268){try{if(!_[_0x9dc5('0xc')](this[_0x9dc5('0xd')][_0x9dc5('0xe')])){logger[_0x9dc5('0xf')](_0x9dc5('0x10'),_0x48beee,_0x9dc5('0x11'));return _0x10b268[_0x9dc5('0x12')]();}var _0x32c99b={'ContactId':this['contact']['id'],'sentAt':moment()[_0x9dc5('0x13')](_0x9dc5('0x14')),'direction':_0x9dc5('0x15')};if(this[_0x9dc5('0x16')]==='sms'||this[_0x9dc5('0x16')]===_0x9dc5('0x17')){_0x32c99b[_0x9dc5('0x18')]=this['interaction'][_0x9dc5('0x18')];}var _0x27e748=this[_0x9dc5('0x16')];if(_0x27e748===_0x9dc5('0x19')){_0x32c99b[_0x9dc5('0x1a')]=this[_0x9dc5('0x1b')]['id'];}else{_0x32c99b[_[_0x9dc5('0x1c')](_0x27e748)+_0x9dc5('0x1d')]=this[_0x9dc5('0x1b')]['id'];}_0x32c99b[_[_0x9dc5('0x1c')](_0x27e748)+'InteractionId']=this[_0x9dc5('0xd')]['id'];if(this['interaction'][_0x9dc5('0x1e')]){var _0x9c1b35=_0x42941b[0x2];if(!_['isEmpty'](_0x9c1b35)){_0x32c99b[_0x9dc5('0x1f')]=utils[_0x9dc5('0x20')](_0x9c1b35,this);return rpc[_0x27e748+_0x9dc5('0x21')][_0x9dc5('0x22')](_0x32c99b)['then'](function(_0x4493c7){logger[_0x9dc5('0xf')](_0x9dc5('0x10'),_0x48beee,_0x32c99b[_0x9dc5('0x1f')]);})[_0x9dc5('0x23')](function(_0x4e999c){logger[_0x9dc5('0x24')](_0x9dc5('0x10'),_0x48beee,JSON[_0x9dc5('0x25')](_0x4e999c));})['finally'](function(){logger['info'](_0x9dc5('0x26'),_0x48beee);_0x10b268['stop']();});}else{logger[_0x9dc5('0xf')]('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x48beee);_0x10b268[_0x9dc5('0x27')]();}}else{var _0x5c8956=this;var _0x100ae7=apiai(_0x42941b[0x0],{'language':_0x42941b[0x1]||'en'});return _0x100ae7['textRequest'](this[_0x9dc5('0x28')][_0x9dc5('0x1f')],{'sessionId':md5(this[_0x9dc5('0xd')]['id'])})['then'](function(_0x184d78){_0x5c8956[_0x9dc5('0x1f')][_0x9dc5('0x29')]=_0x184d78;_0x32c99b[_0x9dc5('0x1f')]=_0x184d78['result']['fulfillment'][_0x9dc5('0x2a')];_0x32c99b[_0x9dc5('0x2b')]=_0x9dc5('0x29');_0x32c99b[_0x9dc5('0x2c')]=JSON['stringify'](_0x184d78);return rpc[_0x27e748+'Message'][_0x9dc5('0x22')](_0x32c99b)[_0x9dc5('0x2d')](function(_0x483778){logger[_0x9dc5('0xf')](_0x9dc5('0x10'),_0x48beee,_0x32c99b[_0x9dc5('0x1f')]);if(_0x184d78['result'][_0x9dc5('0x2e')][_0x9dc5('0x2f')]){_0x10b268[_0x9dc5('0x12')]();}else{_0x10b268[_0x9dc5('0x27')]();}})[_0x9dc5('0x23')](function(_0x2d73e5){logger['error'](_0x9dc5('0x10'),_0x48beee,JSON[_0x9dc5('0x25')](_0x2d73e5));_0x10b268[_0x9dc5('0x12')]();});})[_0x9dc5('0x23')](function(_0x420158){logger['error']('[%s][DIALOGFLOW]\x20%s',_0x48beee,_0x420158[_0x9dc5('0x28')]);_0x10b268[_0x9dc5('0x12')]();});}}catch(_0x4fb3f5){logger[_0x9dc5('0x24')](_0x9dc5('0x10'),_0x48beee,JSON[_0x9dc5('0x25')](_0x4fb3f5));_0x10b268[_0x9dc5('0x27')]();}};}; \ No newline at end of file +var _0xef17=['../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','isNil','interaction','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','channel','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','getMustacheRender','create','catch','stringify','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','message','body','then','dialogflow','speech','providerName','providerResponse','result','endConversation','error','lodash','moment','apiai-promise','md5','./utils'];(function(_0x33389b,_0x31bce2){var _0x48cf42=function(_0x4f6cb6){while(--_0x4f6cb6){_0x33389b['push'](_0x33389b['shift']());}};_0x48cf42(++_0x31bce2);}(_0xef17,0x136));var _0x7ef1=function(_0x275618,_0x27407e){_0x275618=_0x275618-0x0;var _0x5b1a03=_0xef17[_0x275618];return _0x5b1a03;};'use strict';var _=require(_0x7ef1('0x0'));var moment=require(_0x7ef1('0x1'));var apiai=require(_0x7ef1('0x2'));var md5=require(_0x7ef1('0x3'));var utils=require(_0x7ef1('0x4'));var logger=require(_0x7ef1('0x5'))(_0x7ef1('0x6'));var rpc={'chatMessage':require(_0x7ef1('0x7')),'openchannelMessage':require(_0x7ef1('0x8')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x7ef1('0x9')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x7ef1('0xa'))};exports['consequence']=function(_0x34a040,_0x4ba2f0){return function(_0x5aec63){try{if(!_[_0x7ef1('0xb')](this[_0x7ef1('0xc')]['UserId'])){logger[_0x7ef1('0xd')](_0x7ef1('0xe'),_0x34a040,_0x7ef1('0xf'));return _0x5aec63[_0x7ef1('0x10')]();}var _0x2cb9b0={'ContactId':this[_0x7ef1('0x11')]['id'],'sentAt':moment()[_0x7ef1('0x12')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':'out'};if(this[_0x7ef1('0x13')]==='sms'||this['channel']==='whatsapp'){_0x2cb9b0[_0x7ef1('0x14')]=this['interaction'][_0x7ef1('0x14')];}var _0x29c920=this[_0x7ef1('0x13')];if(_0x29c920===_0x7ef1('0x15')){_0x2cb9b0[_0x7ef1('0x16')]=this[_0x7ef1('0x17')]['id'];}else{_0x2cb9b0[_[_0x7ef1('0x18')](_0x29c920)+_0x7ef1('0x19')]=this['account']['id'];}_0x2cb9b0[_['upperFirst'](_0x29c920)+_0x7ef1('0x1a')]=this['interaction']['id'];if(this[_0x7ef1('0xc')][_0x7ef1('0x1b')]){var _0x55e84e=_0x4ba2f0[0x2];if(!_['isEmpty'](_0x55e84e)){_0x2cb9b0['body']=utils[_0x7ef1('0x1c')](_0x55e84e,this);return rpc[_0x29c920+'Message'][_0x7ef1('0x1d')](_0x2cb9b0)['then'](function(_0x5a7b2b){logger['info'](_0x7ef1('0xe'),_0x34a040,_0x2cb9b0['body']);})[_0x7ef1('0x1e')](function(_0x2a8fab){logger['error']('[%s][DIALOGFLOW]\x20%s',_0x34a040,JSON[_0x7ef1('0x1f')](_0x2a8fab));})['finally'](function(){logger[_0x7ef1('0xd')](_0x7ef1('0x20'),_0x34a040);_0x5aec63[_0x7ef1('0x21')]();});}else{logger[_0x7ef1('0xd')](_0x7ef1('0x22'),_0x34a040);_0x5aec63[_0x7ef1('0x21')]();}}else{var _0x20887b=this;var _0xd71594=apiai(_0x4ba2f0[0x0],{'language':_0x4ba2f0[0x1]||'en'});return _0xd71594['textRequest'](this[_0x7ef1('0x23')][_0x7ef1('0x24')],{'sessionId':md5(this[_0x7ef1('0xc')]['id'])})[_0x7ef1('0x25')](function(_0x31b5bf){_0x20887b[_0x7ef1('0x24')][_0x7ef1('0x26')]=_0x31b5bf;_0x2cb9b0[_0x7ef1('0x24')]=_0x31b5bf['result']['fulfillment'][_0x7ef1('0x27')];_0x2cb9b0[_0x7ef1('0x28')]=_0x7ef1('0x26');_0x2cb9b0[_0x7ef1('0x29')]=JSON[_0x7ef1('0x1f')](_0x31b5bf);return rpc[_0x29c920+'Message'][_0x7ef1('0x1d')](_0x2cb9b0)[_0x7ef1('0x25')](function(_0x445902){logger[_0x7ef1('0xd')](_0x7ef1('0xe'),_0x34a040,_0x2cb9b0[_0x7ef1('0x24')]);if(_0x31b5bf[_0x7ef1('0x2a')]['metadata'][_0x7ef1('0x2b')]){_0x5aec63['next']();}else{_0x5aec63[_0x7ef1('0x21')]();}})[_0x7ef1('0x1e')](function(_0x4b5fde){logger['error'](_0x7ef1('0xe'),_0x34a040,JSON[_0x7ef1('0x1f')](_0x4b5fde));_0x5aec63['next']();});})[_0x7ef1('0x1e')](function(_0x56fe40){logger[_0x7ef1('0x2c')]('[%s][DIALOGFLOW]\x20%s',_0x34a040,_0x56fe40[_0x7ef1('0x23')]);_0x5aec63[_0x7ef1('0x10')]();});}}catch(_0x585238){logger['error']('[%s][DIALOGFLOW]\x20%s',_0x34a040,JSON['stringify'](_0x585238));_0x5aec63[_0x7ef1('0x21')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflowV2.js b/server/services/routing/server/applications/dialogflowV2.js index c384ee6..8365fe0 100644 --- a/server/services/routing/server/applications/dialogflowV2.js +++ b/server/services/routing/server/applications/dialogflowV2.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x08bb=['error','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','replace','sessionPath','message','detectIntent','length','dialogflowV2','queryResult','diagnosticInfo','fields','end_conversation','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','boolValue','intent','name','DIALOGFLOWV2_INTENTDISPLAYNAME','DIALOGFLOWV2_ISFALLBACKINTENT','languageCode','DIALOGFLOWV2_QUERYTEXT','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','fulfillmentText','all','catch','lodash','dialogflow','moment','bluebird','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','clone','create','then','body','[%s][DIALOGFLOWV2]\x20%s','stringify','consequence','isNil','interaction','UserId','info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','sms','channel','whatsapp','phone','ChatWebsiteId','upperFirst','AccountId','InteractionId','created','getMustacheRender'];(function(_0x4f93db,_0x3bcabb){var _0x10ac20=function(_0x48058c){while(--_0x48058c){_0x4f93db['push'](_0x4f93db['shift']());}};_0x10ac20(++_0x3bcabb);}(_0x08bb,0x177));var _0xb08b=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0x08bb[_0x32f7d7];return _0x133d09;};'use strict';var _=require(_0xb08b('0x0'));var dialogflow=require(_0xb08b('0x1'));var md5=require('md5');var moment=require(_0xb08b('0x2'));var Promise=require(_0xb08b('0x3'));var logger=require(_0xb08b('0x4'))(_0xb08b('0x5'));var utils=require('./utils');var rpc={'chatMessage':require(_0xb08b('0x6')),'openchannelMessage':require(_0xb08b('0x7')),'mailMessage':require(_0xb08b('0x8')),'smsMessage':require(_0xb08b('0x9')),'faxMessage':require(_0xb08b('0xa')),'whatsappMessage':require(_0xb08b('0xb'))};function createMessage(_0x2eeb47,_0x4fd380,_0x453f31,_0x13273c){return new Promise(function(_0x48470d,_0x304865){var _0x1ff2c6=_[_0xb08b('0xc')](_0x453f31);_0x1ff2c6['body']=_0x13273c;return rpc[_0x4fd380+'Message'][_0xb08b('0xd')](_0x1ff2c6)[_0xb08b('0xe')](function(){logger['info']('[%s][DIALOGFLOWV2]\x20%s',_0x2eeb47,_0x1ff2c6[_0xb08b('0xf')]);_0x48470d();})['catch'](function(_0x3027b5){logger['error'](_0xb08b('0x10'),_0x2eeb47,JSON[_0xb08b('0x11')](_0x3027b5));_0x304865(_0x3027b5);});});}exports[_0xb08b('0x12')]=function(_0x45a5ef,_0x593732){return function(_0x28df7b){try{if(!_[_0xb08b('0x13')](this[_0xb08b('0x14')][_0xb08b('0x15')])){logger[_0xb08b('0x16')](_0xb08b('0x10'),_0x45a5ef,_0xb08b('0x17'));return _0x28df7b[_0xb08b('0x18')]();}var _0x1c3118={'ContactId':this[_0xb08b('0x19')]['id'],'sentAt':moment()[_0xb08b('0x1a')](_0xb08b('0x1b')),'direction':_0xb08b('0x1c')};if(this['channel']===_0xb08b('0x1d')||this[_0xb08b('0x1e')]===_0xb08b('0x1f')){_0x1c3118['phone']=this[_0xb08b('0x14')][_0xb08b('0x20')];}var _0x4c7cbd=this[_0xb08b('0x1e')];if(_0x4c7cbd==='chat'){_0x1c3118[_0xb08b('0x21')]=this['account']['id'];}else{_0x1c3118[_[_0xb08b('0x22')](_0x4c7cbd)+_0xb08b('0x23')]=this['account']['id'];}_0x1c3118[_['upperFirst'](_0x4c7cbd)+_0xb08b('0x24')]=this['interaction']['id'];if(this[_0xb08b('0x14')][_0xb08b('0x25')]){var _0x53af25=_0x593732[0x4];if(!_['isEmpty'](_0x53af25)){_0x1c3118[_0xb08b('0xf')]=utils[_0xb08b('0x26')](_0x53af25,this);return rpc[_0x4c7cbd+'Message']['create'](_0x1c3118)['then'](function(_0x25c34c){logger['info']('[%s][DIALOGFLOWV2]\x20%s',_0x45a5ef,_0x1c3118[_0xb08b('0xf')]);})['catch'](function(_0x4ec847){logger[_0xb08b('0x27')]('[%s][DIALOGFLOWV2]\x20%s',_0x45a5ef,JSON[_0xb08b('0x11')](_0x4ec847));})[_0xb08b('0x28')](function(){logger[_0xb08b('0x16')](_0xb08b('0x29'),_0x45a5ef);_0x28df7b[_0xb08b('0x2a')]();});}else{logger[_0xb08b('0x16')](_0xb08b('0x2b'),_0x45a5ef);_0x28df7b[_0xb08b('0x2a')]();}}else{var _0xbada51=this;var _0xe44e2f=_0x593732[0x2][_0xb08b('0x2c')](/\\n/g,'\x0a');var _0x5b4f07={'credentials':{'private_key':_0xe44e2f,'client_email':_0x593732[0x1]}};var _0x280855=new dialogflow['SessionsClient'](_0x5b4f07);var _0x3ecb3e=_0x280855[_0xb08b('0x2d')](_0x593732[0x0],md5(_0xbada51[_0xb08b('0x14')]['id']));var _0x411fc2={'session':_0x3ecb3e,'queryInput':{'text':{'text':_0xbada51[_0xb08b('0x2e')][_0xb08b('0xf')],'languageCode':_0x593732[0x3]||'en'}}};return _0x280855[_0xb08b('0x2f')](_0x411fc2)[_0xb08b('0xe')](function(_0x47dddf){if(_0x47dddf&&_0x47dddf[_0xb08b('0x30')]){_0xbada51['body'][_0xb08b('0x31')]=_0x47dddf;var _0x59152a=_0x47dddf[0x0];var _0x1a9b9a=_0x59152a[_0xb08b('0x32')][_0xb08b('0x33')]&&_0x59152a[_0xb08b('0x32')][_0xb08b('0x33')][_0xb08b('0x34')]?_0x59152a[_0xb08b('0x32')][_0xb08b('0x33')][_0xb08b('0x34')][_0xb08b('0x35')]['boolValue']:![];_0xbada51[_0xb08b('0xf')]['DIALOGFLOWV2_ACTION']=_0x59152a['queryResult']['action'];_0xbada51[_0xb08b('0xf')]['DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT']=_0x59152a[_0xb08b('0x32')][_0xb08b('0x36')];_0xbada51['body'][_0xb08b('0x37')]=_0x59152a['queryResult'][_0xb08b('0x33')]&&_0x59152a[_0xb08b('0x32')][_0xb08b('0x33')][_0xb08b('0x34')]?_0x59152a[_0xb08b('0x32')]['diagnosticInfo']['fields'][_0xb08b('0x35')][_0xb08b('0x38')]:![];_0xbada51[_0xb08b('0xf')]['DIALOGFLOWV2_INTENTNAME']=_0x59152a[_0xb08b('0x32')][_0xb08b('0x39')][_0xb08b('0x3a')];_0xbada51['body'][_0xb08b('0x3b')]=_0x59152a['queryResult']['intent']['displayName'];_0xbada51[_0xb08b('0xf')][_0xb08b('0x3c')]=_0x59152a[_0xb08b('0x32')][_0xb08b('0x39')]['isFallback'];_0xbada51[_0xb08b('0xf')]['DIALOGFLOWV2_LANGUAGECODE']=_0x59152a[_0xb08b('0x32')][_0xb08b('0x3d')];_0xbada51['body'][_0xb08b('0x3e')]=_0x59152a[_0xb08b('0x32')]['queryText'];_0xbada51[_0xb08b('0xf')][_0xb08b('0x3f')]=_0x59152a[_0xb08b('0x32')][_0xb08b('0x40')];_0x1c3118[_0xb08b('0x41')]=_0xb08b('0x31');_0x1c3118['providerResponse']=JSON[_0xb08b('0x11')](_0x47dddf);var _0x2a78f9=[];for(var _0x567532=0x0;_0x567532<_0x47dddf[_0xb08b('0x30')];_0x567532++){var _0x4ae2f8=_0x47dddf[_0x567532];if(_0x4ae2f8&&_0x4ae2f8[_0xb08b('0x32')]&&_0x4ae2f8[_0xb08b('0x32')][_0xb08b('0x42')]){_0x2a78f9['push'](createMessage(_0x45a5ef,_0x4c7cbd,_0x1c3118,_0x4ae2f8[_0xb08b('0x32')][_0xb08b('0x42')]));}}return Promise[_0xb08b('0x43')](_0x2a78f9)[_0xb08b('0xe')](function(){if(_0x1a9b9a){_0x28df7b[_0xb08b('0x18')]();}else{_0x28df7b[_0xb08b('0x2a')]();}})[_0xb08b('0x44')](function(_0xa2aff1){logger[_0xb08b('0x27')](_0xb08b('0x10'),_0x45a5ef,JSON[_0xb08b('0x11')](_0xa2aff1));_0x28df7b[_0xb08b('0x18')]();});}})[_0xb08b('0x44')](function(_0x1edc8d){logger[_0xb08b('0x27')](_0xb08b('0x10'),_0x45a5ef,_0x1edc8d[_0xb08b('0x2e')]);_0x28df7b[_0xb08b('0x18')]();});}}catch(_0x61e0e3){logger['error'](_0xb08b('0x10'),_0x45a5ef,JSON[_0xb08b('0x11')](_0x61e0e3));_0x28df7b['stop']();}};}; \ No newline at end of file +var _0x0f09=['DIALOGFLOWV2_ACTION','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','DIALOGFLOWV2_INTENTNAME','intent','name','DIALOGFLOWV2_INTENTDISPLAYNAME','displayName','isFallback','DIALOGFLOWV2_LANGUAGECODE','languageCode','DIALOGFLOWV2_QUERYTEXT','queryText','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerResponse','fulfillmentText','push','dialogflow','md5','moment','bluebird','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/faxMessage','clone','body','Message','create','then','info','[%s][DIALOGFLOWV2]\x20%s','catch','error','stringify','consequence','isNil','UserId','next','contact','YYYY-MM-DD\x20HH:mm:ss','out','channel','phone','interaction','chat','ChatWebsiteId','upperFirst','InteractionId','created','isEmpty','getMustacheRender','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','sessionPath','message','detectIntent','length','dialogflowV2','queryResult','diagnosticInfo','fields','end_conversation','boolValue'];(function(_0x13e6e1,_0x22c6f9){var _0xab9bd6=function(_0x52475e){while(--_0x52475e){_0x13e6e1['push'](_0x13e6e1['shift']());}};_0xab9bd6(++_0x22c6f9);}(_0x0f09,0x1a5));var _0x90f0=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x0f09[_0x2641f9];return _0x585741;};'use strict';var _=require('lodash');var dialogflow=require(_0x90f0('0x0'));var md5=require(_0x90f0('0x1'));var moment=require(_0x90f0('0x2'));var Promise=require(_0x90f0('0x3'));var logger=require(_0x90f0('0x4'))(_0x90f0('0x5'));var utils=require('./utils');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x90f0('0x6')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x90f0('0x7')),'whatsappMessage':require('../../rpc/whatsappMessage')};function createMessage(_0x4741a3,_0x17e4ba,_0x2d3559,_0x51edf1){return new Promise(function(_0x2fa7fc,_0x34e28c){var _0x2b4f6d=_[_0x90f0('0x8')](_0x2d3559);_0x2b4f6d[_0x90f0('0x9')]=_0x51edf1;return rpc[_0x17e4ba+_0x90f0('0xa')][_0x90f0('0xb')](_0x2b4f6d)[_0x90f0('0xc')](function(){logger[_0x90f0('0xd')](_0x90f0('0xe'),_0x4741a3,_0x2b4f6d['body']);_0x2fa7fc();})[_0x90f0('0xf')](function(_0x3ebb20){logger[_0x90f0('0x10')](_0x90f0('0xe'),_0x4741a3,JSON[_0x90f0('0x11')](_0x3ebb20));_0x34e28c(_0x3ebb20);});});}exports[_0x90f0('0x12')]=function(_0x5ea8f4,_0xfdf712){return function(_0x3995a5){try{if(!_[_0x90f0('0x13')](this['interaction'][_0x90f0('0x14')])){logger['info']('[%s][DIALOGFLOWV2]\x20%s',_0x5ea8f4,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x3995a5[_0x90f0('0x15')]();}var _0x48414f={'ContactId':this[_0x90f0('0x16')]['id'],'sentAt':moment()['format'](_0x90f0('0x17')),'direction':_0x90f0('0x18')};if(this['channel']==='sms'||this[_0x90f0('0x19')]==='whatsapp'){_0x48414f[_0x90f0('0x1a')]=this[_0x90f0('0x1b')][_0x90f0('0x1a')];}var _0x47d627=this['channel'];if(_0x47d627===_0x90f0('0x1c')){_0x48414f[_0x90f0('0x1d')]=this['account']['id'];}else{_0x48414f[_['upperFirst'](_0x47d627)+'AccountId']=this['account']['id'];}_0x48414f[_[_0x90f0('0x1e')](_0x47d627)+_0x90f0('0x1f')]=this['interaction']['id'];if(this['interaction'][_0x90f0('0x20')]){var _0x4e2993=_0xfdf712[0x4];if(!_[_0x90f0('0x21')](_0x4e2993)){_0x48414f[_0x90f0('0x9')]=utils[_0x90f0('0x22')](_0x4e2993,this);return rpc[_0x47d627+'Message'][_0x90f0('0xb')](_0x48414f)['then'](function(_0x7993b9){logger[_0x90f0('0xd')]('[%s][DIALOGFLOWV2]\x20%s',_0x5ea8f4,_0x48414f[_0x90f0('0x9')]);})[_0x90f0('0xf')](function(_0x2e26ee){logger['error'](_0x90f0('0xe'),_0x5ea8f4,JSON[_0x90f0('0x11')](_0x2e26ee));})[_0x90f0('0x23')](function(){logger[_0x90f0('0xd')](_0x90f0('0x24'),_0x5ea8f4);_0x3995a5[_0x90f0('0x25')]();});}else{logger[_0x90f0('0xd')]('[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x5ea8f4);_0x3995a5[_0x90f0('0x25')]();}}else{var _0x141e7b=this;var _0x1735f6=_0xfdf712[0x2]['replace'](/\\n/g,'\x0a');var _0x49067c={'credentials':{'private_key':_0x1735f6,'client_email':_0xfdf712[0x1]}};var _0x17baaa=new dialogflow['SessionsClient'](_0x49067c);var _0x555c75=_0x17baaa[_0x90f0('0x26')](_0xfdf712[0x0],md5(_0x141e7b[_0x90f0('0x1b')]['id']));var _0x2c6b70={'session':_0x555c75,'queryInput':{'text':{'text':_0x141e7b[_0x90f0('0x27')][_0x90f0('0x9')],'languageCode':_0xfdf712[0x3]||'en'}}};return _0x17baaa[_0x90f0('0x28')](_0x2c6b70)['then'](function(_0x3e8484){if(_0x3e8484&&_0x3e8484[_0x90f0('0x29')]){_0x141e7b[_0x90f0('0x9')][_0x90f0('0x2a')]=_0x3e8484;var _0x3fd89f=_0x3e8484[0x0];var _0x3ba925=_0x3fd89f[_0x90f0('0x2b')]['diagnosticInfo']&&_0x3fd89f[_0x90f0('0x2b')][_0x90f0('0x2c')][_0x90f0('0x2d')]?_0x3fd89f[_0x90f0('0x2b')][_0x90f0('0x2c')]['fields'][_0x90f0('0x2e')][_0x90f0('0x2f')]:![];_0x141e7b[_0x90f0('0x9')][_0x90f0('0x30')]=_0x3fd89f[_0x90f0('0x2b')]['action'];_0x141e7b[_0x90f0('0x9')][_0x90f0('0x31')]=_0x3fd89f['queryResult'][_0x90f0('0x32')];_0x141e7b[_0x90f0('0x9')][_0x90f0('0x33')]=_0x3fd89f[_0x90f0('0x2b')][_0x90f0('0x2c')]&&_0x3fd89f[_0x90f0('0x2b')]['diagnosticInfo'][_0x90f0('0x2d')]?_0x3fd89f[_0x90f0('0x2b')][_0x90f0('0x2c')]['fields'][_0x90f0('0x2e')][_0x90f0('0x2f')]:![];_0x141e7b[_0x90f0('0x9')][_0x90f0('0x34')]=_0x3fd89f['queryResult'][_0x90f0('0x35')][_0x90f0('0x36')];_0x141e7b[_0x90f0('0x9')][_0x90f0('0x37')]=_0x3fd89f[_0x90f0('0x2b')]['intent'][_0x90f0('0x38')];_0x141e7b[_0x90f0('0x9')]['DIALOGFLOWV2_ISFALLBACKINTENT']=_0x3fd89f['queryResult'][_0x90f0('0x35')][_0x90f0('0x39')];_0x141e7b[_0x90f0('0x9')][_0x90f0('0x3a')]=_0x3fd89f[_0x90f0('0x2b')][_0x90f0('0x3b')];_0x141e7b[_0x90f0('0x9')][_0x90f0('0x3c')]=_0x3fd89f[_0x90f0('0x2b')][_0x90f0('0x3d')];_0x141e7b[_0x90f0('0x9')][_0x90f0('0x3e')]=_0x3fd89f[_0x90f0('0x2b')][_0x90f0('0x3f')];_0x48414f['providerName']=_0x90f0('0x2a');_0x48414f[_0x90f0('0x40')]=JSON[_0x90f0('0x11')](_0x3e8484);var _0x3f29ef=[];for(var _0x20e19a=0x0;_0x20e19a<_0x3e8484[_0x90f0('0x29')];_0x20e19a++){var _0x1ab5b1=_0x3e8484[_0x20e19a];if(_0x1ab5b1&&_0x1ab5b1[_0x90f0('0x2b')]&&_0x1ab5b1[_0x90f0('0x2b')][_0x90f0('0x41')]){_0x3f29ef[_0x90f0('0x42')](createMessage(_0x5ea8f4,_0x47d627,_0x48414f,_0x1ab5b1[_0x90f0('0x2b')][_0x90f0('0x41')]));}}return Promise['all'](_0x3f29ef)[_0x90f0('0xc')](function(){if(_0x3ba925){_0x3995a5[_0x90f0('0x15')]();}else{_0x3995a5['stop']();}})[_0x90f0('0xf')](function(_0x599d86){logger['error'](_0x90f0('0xe'),_0x5ea8f4,JSON['stringify'](_0x599d86));_0x3995a5['next']();});}})[_0x90f0('0xf')](function(_0x5f2c37){logger[_0x90f0('0x10')](_0x90f0('0xe'),_0x5ea8f4,_0x5f2c37[_0x90f0('0x27')]);_0x3995a5[_0x90f0('0x15')]();});}}catch(_0x5c36da){logger['error']('[%s][DIALOGFLOWV2]\x20%s',_0x5ea8f4,JSON[_0x90f0('0x11')](_0x5c36da));_0x3995a5[_0x90f0('0x25')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotoif.js b/server/services/routing/server/applications/gotoif.js index f204f56..4962756 100644 --- a/server/services/routing/server/applications/gotoif.js +++ b/server/services/routing/server/applications/gotoif.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7ca4=['condition','priorityTrue','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20eval\x20error:\x20%s','stop','error','[%s][GOTOIF]\x20%s','stringify','validate','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','message','join'];(function(_0x5565d8,_0x1a65d3){var _0x482b0d=function(_0x43809b){while(--_0x43809b){_0x5565d8['push'](_0x5565d8['shift']());}};_0x482b0d(++_0x1a65d3);}(_0x7ca4,0xc8));var _0x47ca=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x7ca4[_0xa464c9];return _0x3d73c4;};'use strict';var schema=require(_0x47ca('0x0'));var _=require('lodash');var htmlToText=require(_0x47ca('0x1'));var utils=require(_0x47ca('0x2'));var logger=require(_0x47ca('0x3'))(_0x47ca('0x4'));var gotoif=schema({'condition':{'type':_0x47ca('0x5'),'required':!![],'message':_0x47ca('0x6')},'priorityTrue':{'type':_0x47ca('0x7'),'message':_0x47ca('0x8')},'priorityFalse':{'type':'number','message':_0x47ca('0x9')}});exports[_0x47ca('0xa')]=function(_0x51b80d,_0x61fc1c){return function(_0x1f5ec9){try{var _0x3e90ca={'condition':htmlToText[_0x47ca('0xb')](utils[_0x47ca('0xc')](_0x61fc1c[0x0],this),{'wordwrap':![]})[_0x47ca('0xd')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x61fc1c[0x1],'priorityFalse':_0x61fc1c[0x2]};var _0x32b049=gotoif[_0x47ca('0x0')](_0x3e90ca,{'typecast':!![]});if(_0x32b049[_0x47ca('0xe')]){logger['error']('[%s][GOTOIF]\x20%s',_0x51b80d,_['map'](_0x32b049,_0x47ca('0xf'))[_0x47ca('0x10')](',\x20'));_0x1f5ec9['stop']();}else{try{var _0x31e7d2=eval('('+_0x3e90ca[_0x47ca('0x11')]+')');var _0x30cac4=_0x31e7d2?_0x3e90ca[_0x47ca('0x12')]:_0x3e90ca[_0x47ca('0x13')];logger[_0x47ca('0x14')](_0x47ca('0x15'),_0x51b80d,_0x3e90ca[_0x47ca('0x11')],_0x31e7d2,_0x30cac4||_0x47ca('0x16'));if(_0x30cac4){var _0x5b2bf2=_[_0x47ca('0x17')](_0x1f5ec9[_0x47ca('0x18')](),{'p':_0x30cac4});if(_0x5b2bf2>=0x0){logger[_0x47ca('0x14')](_0x47ca('0x19'),_0x51b80d,_0x30cac4||_0x47ca('0x16'),_0x5b2bf2);_0x1f5ec9['next'](_0x5b2bf2);}else{logger['info']('[%s][GOTOIF]\x20priority\x20%s\x20not\x20found',_0x51b80d,_0x30cac4||_0x47ca('0x16'));_0x1f5ec9['stop']();}}else{_0x1f5ec9[_0x47ca('0x16')]();}}catch(_0x145b61){logger['error'](_0x47ca('0x1a'),_0x51b80d,_0x145b61[_0x47ca('0xf')]);_0x1f5ec9[_0x47ca('0x1b')]();}}}catch(_0x1d0d7b){logger[_0x47ca('0x1c')](_0x47ca('0x1d'),_0x51b80d,JSON[_0x47ca('0x1e')](_0x1d0d7b));_0x1f5ec9[_0x47ca('0x1b')]();}};}; \ No newline at end of file +var _0xe493=['error','[%s][GOTOIF]\x20%s','map','message','join','stop','condition','priorityTrue','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s','stringify','html-to-text','./utils','../../../../config/logger','string','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','consequence','fromString','validate','length'];(function(_0xc75e69,_0x19ac94){var _0x447f25=function(_0x25125c){while(--_0x25125c){_0xc75e69['push'](_0xc75e69['shift']());}};_0x447f25(++_0x19ac94);}(_0xe493,0x134));var _0x3e49=function(_0xd44879,_0x300a44){_0xd44879=_0xd44879-0x0;var _0x303677=_0xe493[_0xd44879];return _0x303677;};'use strict';var schema=require('validate');var _=require('lodash');var htmlToText=require(_0x3e49('0x0'));var utils=require(_0x3e49('0x1'));var logger=require(_0x3e49('0x2'))('routing');var gotoif=schema({'condition':{'type':_0x3e49('0x3'),'required':!![],'message':'condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'priorityTrue':{'type':_0x3e49('0x4'),'message':_0x3e49('0x5')},'priorityFalse':{'type':'number','message':_0x3e49('0x6')}});exports[_0x3e49('0x7')]=function(_0x308f0c,_0x3c54e7){return function(_0x5d0e4d){try{var _0x54fe69={'condition':htmlToText[_0x3e49('0x8')](utils['getMustacheRender'](_0x3c54e7[0x0],this),{'wordwrap':![]})['replace'](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x3c54e7[0x1],'priorityFalse':_0x3c54e7[0x2]};var _0x26d81b=gotoif[_0x3e49('0x9')](_0x54fe69,{'typecast':!![]});if(_0x26d81b[_0x3e49('0xa')]){logger[_0x3e49('0xb')](_0x3e49('0xc'),_0x308f0c,_[_0x3e49('0xd')](_0x26d81b,_0x3e49('0xe'))[_0x3e49('0xf')](',\x20'));_0x5d0e4d[_0x3e49('0x10')]();}else{try{var _0x24f89e=eval('('+_0x54fe69[_0x3e49('0x11')]+')');var _0x130811=_0x24f89e?_0x54fe69[_0x3e49('0x12')]:_0x54fe69[_0x3e49('0x13')];logger[_0x3e49('0x14')](_0x3e49('0x15'),_0x308f0c,_0x54fe69[_0x3e49('0x11')],_0x24f89e,_0x130811||_0x3e49('0x16'));if(_0x130811){var _0x2e02a3=_[_0x3e49('0x17')](_0x5d0e4d[_0x3e49('0x18')](),{'p':_0x130811});if(_0x2e02a3>=0x0){logger[_0x3e49('0x14')](_0x3e49('0x19'),_0x308f0c,_0x130811||'next',_0x2e02a3);_0x5d0e4d[_0x3e49('0x16')](_0x2e02a3);}else{logger[_0x3e49('0x14')](_0x3e49('0x1a'),_0x308f0c,_0x130811||_0x3e49('0x16'));_0x5d0e4d[_0x3e49('0x10')]();}}else{_0x5d0e4d[_0x3e49('0x16')]();}}catch(_0x2c938c){logger[_0x3e49('0xb')](_0x3e49('0x1b'),_0x308f0c,_0x2c938c[_0x3e49('0xe')]);_0x5d0e4d['stop']();}}}catch(_0x2347f8){logger['error'](_0x3e49('0xc'),_0x308f0c,JSON[_0x3e49('0x1c')](_0x2347f8));_0x5d0e4d[_0x3e49('0x10')]();}};}; \ 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 3ae5020..712af76 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 _0xe930=['stop','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','info','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','error','[%s][GOTOP]\x20%s','stringify','lodash','../../../../config/logger','routing','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','validate','length','map','message','join'];(function(_0x400169,_0x1b4acb){var _0x5cfd4c=function(_0x3a3ab){while(--_0x3a3ab){_0x400169['push'](_0x400169['shift']());}};_0x5cfd4c(++_0x1b4acb);}(_0xe930,0xbf));var _0x0e93=function(_0x1911ed,_0x4e8c73){_0x1911ed=_0x1911ed-0x0;var _0x11edaa=_0xe930[_0x1911ed];return _0x11edaa;};'use strict';var schema=require('validate');var _=require(_0x0e93('0x0'));var logger=require(_0x0e93('0x1'))(_0x0e93('0x2'));var gotop=schema({'priority':{'type':'number','required':!![],'message':_0x0e93('0x3')}});exports['consequence']=function(_0x3c5b20,_0x38598a){return function(_0x30cb7b){try{var _0x55c695={'priority':_0x38598a[0x0]};var _0x33237d=gotop[_0x0e93('0x4')](_0x55c695,{'typecast':!![]});if(_0x33237d[_0x0e93('0x5')]){logger['error']('[%s][GOTOP]\x20%s',_0x3c5b20,_[_0x0e93('0x6')](_0x33237d,_0x0e93('0x7'))[_0x0e93('0x8')](',\x20'));_0x30cb7b[_0x0e93('0x9')]();}else{logger['info'](_0x0e93('0xa'),_0x3c5b20,_0x55c695['priority']);if(_0x55c695[_0x0e93('0xb')]){var _0x8cd075=_[_0x0e93('0xc')](_0x30cb7b[_0x0e93('0xd')](),{'p':_0x55c695['priority']});if(_0x8cd075>=0x0){logger[_0x0e93('0xe')]('[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x3c5b20,_0x55c695[_0x0e93('0xb')]||_0x0e93('0xf'),_0x8cd075);_0x30cb7b['next'](_0x8cd075);}else{logger[_0x0e93('0xe')](_0x0e93('0x10'),_0x3c5b20,_0x55c695['priority']||_0x0e93('0xf'));_0x30cb7b[_0x0e93('0x9')]();}}else{_0x30cb7b['next']();}}}catch(_0x358b00){logger[_0x0e93('0x11')](_0x0e93('0x12'),_0x3c5b20,JSON[_0x0e93('0x13')](_0x358b00));_0x30cb7b['stop']();}};}; \ No newline at end of file +var _0x9e6a=['length','error','map','message','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','[%s][GOTOP]\x20%s','stringify','validate','../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence'];(function(_0x58341d,_0x214345){var _0x5bc3e1=function(_0x2e50ed){while(--_0x2e50ed){_0x58341d['push'](_0x58341d['shift']());}};_0x5bc3e1(++_0x214345);}(_0x9e6a,0xa2));var _0xa9e6=function(_0x26b5ff,_0x92009a){_0x26b5ff=_0x26b5ff-0x0;var _0x58603e=_0x9e6a[_0x26b5ff];return _0x58603e;};'use strict';var schema=require(_0xa9e6('0x0'));var _=require('lodash');var logger=require(_0xa9e6('0x1'))(_0xa9e6('0x2'));var gotop=schema({'priority':{'type':_0xa9e6('0x3'),'required':!![],'message':_0xa9e6('0x4')}});exports[_0xa9e6('0x5')]=function(_0x54a856,_0x2e86a6){return function(_0x35a3d1){try{var _0xf94a6={'priority':_0x2e86a6[0x0]};var _0xca1a67=gotop[_0xa9e6('0x0')](_0xf94a6,{'typecast':!![]});if(_0xca1a67[_0xa9e6('0x6')]){logger[_0xa9e6('0x7')]('[%s][GOTOP]\x20%s',_0x54a856,_[_0xa9e6('0x8')](_0xca1a67,_0xa9e6('0x9'))['join'](',\x20'));_0x35a3d1[_0xa9e6('0xa')]();}else{logger[_0xa9e6('0xb')](_0xa9e6('0xc'),_0x54a856,_0xf94a6[_0xa9e6('0xd')]);if(_0xf94a6[_0xa9e6('0xd')]){var _0x2e7419=_[_0xa9e6('0xe')](_0x35a3d1[_0xa9e6('0xf')](),{'p':_0xf94a6[_0xa9e6('0xd')]});if(_0x2e7419>=0x0){logger[_0xa9e6('0xb')](_0xa9e6('0x10'),_0x54a856,_0xf94a6['priority']||_0xa9e6('0x11'),_0x2e7419);_0x35a3d1[_0xa9e6('0x11')](_0x2e7419);}else{logger[_0xa9e6('0xb')](_0xa9e6('0x12'),_0x54a856,_0xf94a6[_0xa9e6('0xd')]||_0xa9e6('0x11'));_0x35a3d1['stop']();}}else{_0x35a3d1[_0xa9e6('0x11')]();}}}catch(_0x3e36cc){logger[_0xa9e6('0x7')](_0xa9e6('0x13'),_0x54a856,JSON[_0xa9e6('0x14')](_0x3e36cc));_0x35a3d1[_0xa9e6('0xa')]();}};}; \ 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 31e7537..3b0bde7 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 _0x4f54=['catch','error','stop','lodash','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','contact','channel','chat','account','upperFirst','InteractionId','interaction','Message','then','[%s][MESSAGE]\x20%s','body','next'];(function(_0x13f0e2,_0x51e16c){var _0x498b8b=function(_0x55b315){while(--_0x55b315){_0x13f0e2['push'](_0x13f0e2['shift']());}};_0x498b8b(++_0x51e16c);}(_0x4f54,0x123));var _0x44f5=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x4f54[_0x8c43de];return _0xa6591b;};'use strict';var _=require(_0x44f5('0x0'));var utils=require(_0x44f5('0x1'));var logger=require(_0x44f5('0x2'))(_0x44f5('0x3'));var rpc={'chatMessage':require(_0x44f5('0x4')),'openchannelMessage':require(_0x44f5('0x5')),'mailMessage':require(_0x44f5('0x6')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x44f5('0x7')),'whatsappMessage':require(_0x44f5('0x8'))};exports['consequence']=function(_0x5560fa,_0x4b15c6){return function(_0x5815ed){try{var _0x269636={'body':utils['getMustacheRender'](_0x4b15c6[0x0],this),'ContactId':this[_0x44f5('0x9')]['id']};if(this[_0x44f5('0xa')]===_0x44f5('0xb')){_0x269636['ChatWebsiteId']=this[_0x44f5('0xc')]['id'];}else{_0x269636[_[_0x44f5('0xd')](this[_0x44f5('0xa')])+'AccountId']=this[_0x44f5('0xc')]['id'];}_0x269636[_[_0x44f5('0xd')](this[_0x44f5('0xa')])+_0x44f5('0xe')]=this[_0x44f5('0xf')]['id'];if(rpc[this[_0x44f5('0xa')]+_0x44f5('0x10')]){return rpc[this[_0x44f5('0xa')]+_0x44f5('0x10')]['create'](_0x269636)[_0x44f5('0x11')](function(_0x43e37a){logger['info'](_0x44f5('0x12'),_0x5560fa,_0x269636[_0x44f5('0x13')]);_0x5815ed[_0x44f5('0x14')]();})[_0x44f5('0x15')](function(_0x1ae25f){logger[_0x44f5('0x16')](_0x44f5('0x12'),_0x5560fa,JSON['stringify'](_0x1ae25f));_0x5815ed[_0x44f5('0x17')]();});}}catch(_0x26361f){logger[_0x44f5('0x16')]('[%s][MESSAGE]\x20%s',_0x5560fa,JSON['stringify'](_0x26361f));_0x5815ed['stop']();}};}; \ No newline at end of file +var _0x49a1=['lodash','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','contact','channel','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','interaction','Message','create','info','body','next','catch','error','[%s][MESSAGE]\x20%s','stringify','stop'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0x49a1,0x190));var _0x149a=function(_0x46dc08,_0x398f4b){_0x46dc08=_0x46dc08-0x0;var _0x3f067e=_0x49a1[_0x46dc08];return _0x3f067e;};'use strict';var _=require(_0x149a('0x0'));var utils=require(_0x149a('0x1'));var logger=require(_0x149a('0x2'))(_0x149a('0x3'));var rpc={'chatMessage':require(_0x149a('0x4')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x149a('0x5')),'whatsappMessage':require(_0x149a('0x6'))};exports['consequence']=function(_0x14a0a0,_0x25e18e){return function(_0x5b4b37){try{var _0x872ee2={'body':utils['getMustacheRender'](_0x25e18e[0x0],this),'ContactId':this[_0x149a('0x7')]['id']};if(this[_0x149a('0x8')]==='chat'){_0x872ee2[_0x149a('0x9')]=this[_0x149a('0xa')]['id'];}else{_0x872ee2[_[_0x149a('0xb')](this[_0x149a('0x8')])+_0x149a('0xc')]=this[_0x149a('0xa')]['id'];}_0x872ee2[_['upperFirst'](this['channel'])+_0x149a('0xd')]=this[_0x149a('0xe')]['id'];if(rpc[this[_0x149a('0x8')]+_0x149a('0xf')]){return rpc[this[_0x149a('0x8')]+_0x149a('0xf')][_0x149a('0x10')](_0x872ee2)['then'](function(_0x5ddccb){logger[_0x149a('0x11')]('[%s][MESSAGE]\x20%s',_0x14a0a0,_0x872ee2[_0x149a('0x12')]);_0x5b4b37[_0x149a('0x13')]();})[_0x149a('0x14')](function(_0x3a9b6b){logger[_0x149a('0x15')](_0x149a('0x16'),_0x14a0a0,JSON[_0x149a('0x17')](_0x3a9b6b));_0x5b4b37[_0x149a('0x18')]();});}}catch(_0x2b84ae){logger[_0x149a('0x15')]('[%s][MESSAGE]\x20%s',_0x14a0a0,JSON[_0x149a('0x17')](_0x2b84ae));_0x5b4b37[_0x149a('0x18')]();}};}; \ 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 526baea..71b2b72 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 _0x73db=['./utils','../../../../config/logger','routing','consequence','info','next','error','[%s][NOOP]\x20%s','stringify','stop'];(function(_0x124afc,_0x555e96){var _0x3af593=function(_0x160910){while(--_0x160910){_0x124afc['push'](_0x124afc['shift']());}};_0x3af593(++_0x555e96);}(_0x73db,0xfa));var _0xb73d=function(_0x30b09f,_0x261971){_0x30b09f=_0x30b09f-0x0;var _0x2c7d6e=_0x73db[_0x30b09f];return _0x2c7d6e;};'use strict';var utils=require(_0xb73d('0x0'));var logger=require(_0xb73d('0x1'))(_0xb73d('0x2'));exports[_0xb73d('0x3')]=function(_0xa9f022,_0x1cc54e){return function(_0x42e81a){try{logger[_0xb73d('0x4')]('[%s][NOOP]\x20%s',_0xa9f022,utils['getMustacheRender'](_0x1cc54e[0x0],this));_0x42e81a[_0xb73d('0x5')]();}catch(_0x4a6dd1){logger[_0xb73d('0x6')](_0xb73d('0x7'),_0xa9f022,JSON[_0xb73d('0x8')](_0x4a6dd1));_0x42e81a[_0xb73d('0x9')]();}};}; \ No newline at end of file +var _0xbcb4=['error','stringify','./utils','../../../../config/logger','routing','info','[%s][NOOP]\x20%s','getMustacheRender','next'];(function(_0x4f7384,_0x5e157c){var _0x41c281=function(_0x276147){while(--_0x276147){_0x4f7384['push'](_0x4f7384['shift']());}};_0x41c281(++_0x5e157c);}(_0xbcb4,0x92));var _0x4bcb=function(_0x41ecb8,_0x16f1e4){_0x41ecb8=_0x41ecb8-0x0;var _0xfd0d1c=_0xbcb4[_0x41ecb8];return _0xfd0d1c;};'use strict';var utils=require(_0x4bcb('0x0'));var logger=require(_0x4bcb('0x1'))(_0x4bcb('0x2'));exports['consequence']=function(_0x36c418,_0x2bfb01){return function(_0x56e951){try{logger[_0x4bcb('0x3')](_0x4bcb('0x4'),_0x36c418,utils[_0x4bcb('0x5')](_0x2bfb01[0x0],this));_0x56e951[_0x4bcb('0x6')]();}catch(_0x5f362e){logger[_0x4bcb('0x7')](_0x4bcb('0x4'),_0x36c418,JSON[_0x4bcb('0x8')](_0x5f362e));_0x56e951['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 b21704f..fb3bc96 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 _0xfd9e=['name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','QueueId','InteractionId','MessageId','message','chat','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','error','create\x20queue\x20report','accepted','[%s][STOP:QUEUE][NAME:%s]','update','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','join','stop','find','atimeout','qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','complete','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stack','validate','lodash','util','seq-queue','ioredis','../../../../config/environment','../../../../config/logger','routing','./strategy','redis','defaults','localhost','socket.io-emitter','queue_id','account','queue','from','joinAt','emit','clone','format','%sQueuesWaitingInteractions','pick','%s:queue:%s','save','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string'];(function(_0x218346,_0x43c261){var _0x30b7f2=function(_0x40f2c4){while(--_0x40f2c4){_0x218346['push'](_0x218346['shift']());}};_0x30b7f2(++_0x43c261);}(_0xfd9e,0x185));var _0xefd9=function(_0x54a512,_0x4af21f){_0x54a512=_0x54a512-0x0;var _0x4f6d62=_0xfd9e[_0x54a512];return _0x4f6d62;};'use strict';var schema=require(_0xefd9('0x0'));var _=require(_0xefd9('0x1'));var util=require(_0xefd9('0x2'));var seqqueue=require(_0xefd9('0x3'));var moment=require('moment');var Redis=require(_0xefd9('0x4'));var config=require(_0xefd9('0x5'));var logger=require(_0xefd9('0x6'))(_0xefd9('0x7'));var strategy=require(_0xefd9('0x8'));config[_0xefd9('0x9')]=_[_0xefd9('0xa')](config[_0xefd9('0x9')],{'host':_0xefd9('0xb'),'port':0x18eb});var io=require(_0xefd9('0xc'))(new Redis(config[_0xefd9('0x9')]));var attributes=['id',_0xefd9('0xd'),_0xefd9('0xe'),_0xefd9('0xf'),_0xefd9('0x10'),_0xefd9('0x11')];function emit(_0x1ef494,_0x3a8361,_0x8a3557){io['to'](_0x1ef494)[_0xefd9('0x12')](_0x3a8361,_0x8a3557);}function emitChannelQueueInteraction(_0x34dbfb,_0x285203,_0x1c63d8,_0x4c9f68,_0xfaced8,_0xa5fb33,_0x5e1c18,_0x250ea7){var _0x559e53=_[_0xefd9('0x13')](_0x1c63d8);_0x559e53[_0xefd9('0xd')]=_0x250ea7;_0x559e53[_0xefd9('0xf')]=_0x285203;_0x559e53[_0xefd9('0xe')]=_0x4c9f68;_0x559e53['id']=_0xfaced8;if(_0xa5fb33){_0x5e1c18[util[_0xefd9('0x14')](_0xefd9('0x15'),_0x34dbfb)][_0xfaced8]=_[_0xefd9('0x16')](_0x559e53,attributes);}else{delete _0x5e1c18[util[_0xefd9('0x14')](_0xefd9('0x15'),_0x34dbfb)][_0xfaced8];}emit(util['format'](_0xefd9('0x17'),_0x34dbfb,_0x285203),util[_0xefd9('0x14')]('%s_queue_waiting_interaction:%s',_0x34dbfb,_0xa5fb33?_0xefd9('0x18'):'remove'),_['pick'](_0x559e53,attributes));}var rpc={'openchannelQueueReport':require(_0xefd9('0x19')),'mailQueueReport':require(_0xefd9('0x1a')),'chatQueueReport':require(_0xefd9('0x1b')),'smsQueueReport':require('../../rpc/smsQueueReport'),'faxQueueReport':require(_0xefd9('0x1c')),'whatsappQueueReport':require(_0xefd9('0x1d'))};var queue=schema({'name':{'type':_0xefd9('0x1e'),'required':!![],'message':_0xefd9('0x1f')},'timeout':{'type':_0xefd9('0x20'),'message':_0xefd9('0x21')}});function startRouting(_0x2920db,_0x449c19,_0x3c9d3f,_0x4d6ca7){if(_0x2920db&&_0x449c19&&_0x3c9d3f){_0x449c19[_0xefd9('0x22')]+=0x1;var _0x2fc3e7={'uniqueid':_0x2920db,'from':_0x3c9d3f['body']?_0x3c9d3f[_0xefd9('0x23')][_0xefd9('0x10')]:'','joinAt':moment()[_0xefd9('0x14')](_0xefd9('0x24')),'ContactId':_0x3c9d3f[_0xefd9('0x25')]?_0x3c9d3f['contact']['id']:null,'ListId':_0x3c9d3f[_0xefd9('0x26')]?_0x3c9d3f[_0xefd9('0x26')]['id']:null};_0x2fc3e7[_[_0xefd9('0x27')](_0x3c9d3f[_0xefd9('0x28')])+_0xefd9('0x29')]=_0x449c19['id']||null;_0x2fc3e7[_[_0xefd9('0x27')](_0x3c9d3f[_0xefd9('0x28')])+_0xefd9('0x2a')]=_0x3c9d3f['interaction']?_0x3c9d3f['interaction']['id']:null;_0x2fc3e7[_[_0xefd9('0x27')](_0x3c9d3f[_0xefd9('0x28')])+_0xefd9('0x2b')]=_0x3c9d3f['message']?_0x3c9d3f[_0xefd9('0x2c')]['id']:null;_0x2fc3e7[_['upperFirst'](_0x3c9d3f[_0xefd9('0x28')])+(_0x3c9d3f[_0xefd9('0x28')]!==_0xefd9('0x2d')?_0xefd9('0x2e'):_0xefd9('0x2f'))]=_0x3c9d3f['account']?_0x3c9d3f[_0xefd9('0xe')]['id']:null;logger[_0xefd9('0x30')](util[_0xefd9('0x14')](_0xefd9('0x31'),_0x2920db,_0x449c19[_0xefd9('0x32')]));emitChannelQueueInteraction(_0x3c9d3f[_0xefd9('0x28')],_0x449c19[_0xefd9('0x32')],_0x2fc3e7,_0x3c9d3f['account'][_0xefd9('0x32')],_0x3c9d3f['message']['id'],!![],_0x4d6ca7,_0x449c19['id']);if(rpc[_0x3c9d3f[_0xefd9('0x28')]+_0xefd9('0x33')]){return rpc[_0x3c9d3f[_0xefd9('0x28')]+'QueueReport'][_0xefd9('0x34')](_0x2fc3e7)[_0xefd9('0x35')](function(_0x12f60c){logger[_0xefd9('0x36')](_0xefd9('0x37'));});}}}function stopRouting(_0x3ab8ce,_0x4cb004,_0x49875a,_0x1255b8){if(_0x3ab8ce&&_0x4cb004){_0x4cb004['waiting']-=0x1;var _0x2ec231={'leaveAt':moment()['format'](_0xefd9('0x24')),'acceptAt':moment()['format'](_0xefd9('0x24')),'reason':_0xefd9('0x38')};logger[_0xefd9('0x30')](util['format'](_0xefd9('0x39'),_0x3ab8ce,_0x4cb004[_0xefd9('0x32')]));emitChannelQueueInteraction(_0x49875a[_0xefd9('0x28')],_0x4cb004[_0xefd9('0x32')],_0x49875a[_0xefd9('0x23')],_0x49875a[_0xefd9('0xe')][_0xefd9('0x32')],_0x49875a[_0xefd9('0x2c')]['id'],![],_0x1255b8,_0x4cb004['id']);if(rpc[_0x49875a[_0xefd9('0x28')]+_0xefd9('0x33')]){return rpc[_0x49875a[_0xefd9('0x28')]+_0xefd9('0x33')][_0xefd9('0x3a')](_0x3ab8ce,_0x2ec231)[_0xefd9('0x35')](function(_0x2f1318){logger[_0xefd9('0x36')](_0xefd9('0x3b'));});}}}function endRouting(_0x5a4c3f,_0x4f956b,_0x177d55,_0x44a6aa){if(_0x5a4c3f&&_0x4f956b){_0x4f956b[_0xefd9('0x22')]-=0x1;var _0x37c135={'leaveAt':moment()['format'](_0xefd9('0x24')),'exitAt':moment()[_0xefd9('0x14')](_0xefd9('0x24')),'reason':_0xefd9('0x3c')};logger[_0xefd9('0x30')](util[_0xefd9('0x14')](_0xefd9('0x3d'),_0x5a4c3f,_0x4f956b[_0xefd9('0x32')]));emitChannelQueueInteraction(_0x177d55['channel'],_0x4f956b[_0xefd9('0x32')],_0x177d55['body'],_0x177d55[_0xefd9('0xe')]['name'],_0x177d55[_0xefd9('0x2c')]['id'],![],_0x44a6aa);if(rpc[_0x177d55[_0xefd9('0x28')]+_0xefd9('0x33')]){return rpc[_0x177d55[_0xefd9('0x28')]+'QueueReport']['update'](_0x5a4c3f,_0x37c135)[_0xefd9('0x35')](function(_0x37942e){logger[_0xefd9('0x36')]('update\x20queue\x20report');});}}}function handleFindQueue(_0x2a2a0b){return function(_0x5a9009){return _0x5a9009['name'][_0xefd9('0x3e')]()===_0x2a2a0b[_0xefd9('0x3e')]();};}exports[_0xefd9('0x3f')]=function(_0x40e676,_0x5be6f0,_0x40c8ae,_0x19abb6){return function(_0x3637fd){try{var _0x120354={'name':_0x5be6f0[0x0],'timeout':_0x5be6f0[0x1]};var _0x4ed49f=queue[_0xefd9('0x0')](_0x120354,{'typecast':!![]});if(_0x4ed49f[_0xefd9('0x40')]){logger[_0xefd9('0x36')](_0xefd9('0x41'),_0x40e676,_['map'](_0x4ed49f,_0xefd9('0x2c'))[_0xefd9('0x42')](',\x20'));_0x3637fd[_0xefd9('0x43')]();}else{var _0x32949d=_[_0xefd9('0x44')](_0x40c8ae[_0x19abb6[_0xefd9('0x28')]+'Queues'],handleFindQueue(_0x120354['name']));if(_0x32949d){startRouting(_0x40e676,_0x32949d,_0x19abb6,_0x40c8ae);var _0x2a9528=(_0x32949d[_0xefd9('0x3c')]||0xa)*0x3e8;var _0x398d19=(_0x120354[_0xefd9('0x3c')]||0x14)*0x3e8;var _0x5191fb,_0x48e917;if(_0x2a9528>_0x398d19){_0x398d19=_0x2a9528;}var _0x486266=seqqueue['createQueue'](_0x2a9528);_0x486266['id']=_0x40e676;_0x486266[_0xefd9('0x45')]=_0x2a9528;_0x486266[_0xefd9('0x46')]=_0x398d19;_0x486266[_0xefd9('0x28')]=_0x19abb6[_0xefd9('0x28')];_0x40c8ae[_0xefd9('0x47')][_0x40e676]['on'](_0xefd9('0x48'),function(){logger[_0xefd9('0x30')](_0xefd9('0x49'),_0x40e676);stopRouting(_0x40e676,_0x32949d,_0x19abb6,_0x40c8ae);clearTimeout(_0x5191fb);_0x5191fb=undefined;_0x486266[_0xefd9('0x4a')](!![]);if(_0x40c8ae[_0xefd9('0x47')][_0x40e676]){delete _0x40c8ae[_0xefd9('0x47')][_0x40e676];}_0x3637fd['stop']();});_0x40c8ae[_0xefd9('0x47')][_0x40e676]['on'](_0xefd9('0x4b'),function(){if(_0x40c8ae['rules'][_0x40e676]){delete _0x40c8ae[_0xefd9('0x47')][_0x40e676];}});_0x5191fb=setTimeout(function(){logger['info'](_0xefd9('0x4c'),_0x40e676);endRouting(_0x40e676,_0x32949d,_0x19abb6,_0x40c8ae);clearTimeout(_0x5191fb);_0x486266['close'](!![]);_0x3637fd[_0xefd9('0x4d')]();},_0x398d19);switch(_0x32949d[_0xefd9('0x4e')]){case _0xefd9('0x4f'):strategy[_0xefd9('0x4f')](_0x486266,_0x32949d,_0x40c8ae,_0x19abb6);break;default:strategy[_0xefd9('0x50')](_0x486266,_0x32949d,_0x40c8ae,_0x19abb6);}}else{logger[_0xefd9('0x36')](_0xefd9('0x51'),_0x40e676,_0x120354[_0xefd9('0x32')]);_0x3637fd[_0xefd9('0x43')]();}}}catch(_0x2b4e28){console[_0xefd9('0x52')](_0x2b4e28);logger[_0xefd9('0x36')](_0xefd9('0x41'),_0x40e676,_0x2b4e28[_0xefd9('0x53')]);_0x3637fd['stop']();}};}; \ No newline at end of file +var _0xb5b9=['create','catch','error','[%s][STOP:QUEUE][NAME:%s]','update','update\x20queue\x20report','toLowerCase','map','join','find','Queues','timeout','createQueue','qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','stop','complete','[%s][QUEUE]\x20APPLICATION\x20END','strategy','rrmemory','beepall','log','[%s][QUEUE]\x20%s','stack','validate','lodash','util','seq-queue','moment','ioredis','../../../../config/environment','../../../../config/logger','routing','./strategy','redis','localhost','socket.io-emitter','queue_id','account','queue','from','joinAt','emit','clone','format','%sQueuesWaitingInteractions','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','QueueId','channel','MessageId','message','chat','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport'];(function(_0x51268d,_0x153281){var _0xc1ff18=function(_0x27a9c5){while(--_0x27a9c5){_0x51268d['push'](_0x51268d['shift']());}};_0xc1ff18(++_0x153281);}(_0xb5b9,0x153));var _0x9b5b=function(_0x107dfe,_0x38a569){_0x107dfe=_0x107dfe-0x0;var _0x2e2d99=_0xb5b9[_0x107dfe];return _0x2e2d99;};'use strict';var schema=require(_0x9b5b('0x0'));var _=require(_0x9b5b('0x1'));var util=require(_0x9b5b('0x2'));var seqqueue=require(_0x9b5b('0x3'));var moment=require(_0x9b5b('0x4'));var Redis=require(_0x9b5b('0x5'));var config=require(_0x9b5b('0x6'));var logger=require(_0x9b5b('0x7'))(_0x9b5b('0x8'));var strategy=require(_0x9b5b('0x9'));config[_0x9b5b('0xa')]=_['defaults'](config[_0x9b5b('0xa')],{'host':_0x9b5b('0xb'),'port':0x18eb});var io=require(_0x9b5b('0xc'))(new Redis(config[_0x9b5b('0xa')]));var attributes=['id',_0x9b5b('0xd'),_0x9b5b('0xe'),_0x9b5b('0xf'),_0x9b5b('0x10'),_0x9b5b('0x11')];function emit(_0x130417,_0x2f9b5c,_0x42f633){io['to'](_0x130417)[_0x9b5b('0x12')](_0x2f9b5c,_0x42f633);}function emitChannelQueueInteraction(_0x28223b,_0x25d0c7,_0x1ddbcf,_0x4b0b93,_0x42a79a,_0x53ceee,_0x42da21,_0x9f106c){var _0xc60df4=_[_0x9b5b('0x13')](_0x1ddbcf);_0xc60df4['queue_id']=_0x9f106c;_0xc60df4['queue']=_0x25d0c7;_0xc60df4[_0x9b5b('0xe')]=_0x4b0b93;_0xc60df4['id']=_0x42a79a;if(_0x53ceee){_0x42da21[util[_0x9b5b('0x14')](_0x9b5b('0x15'),_0x28223b)][_0x42a79a]=_['pick'](_0xc60df4,attributes);}else{delete _0x42da21[util['format'](_0x9b5b('0x15'),_0x28223b)][_0x42a79a];}emit(util[_0x9b5b('0x14')](_0x9b5b('0x16'),_0x28223b,_0x25d0c7),util[_0x9b5b('0x14')](_0x9b5b('0x17'),_0x28223b,_0x53ceee?_0x9b5b('0x18'):_0x9b5b('0x19')),_['pick'](_0xc60df4,attributes));}var rpc={'openchannelQueueReport':require(_0x9b5b('0x1a')),'mailQueueReport':require(_0x9b5b('0x1b')),'chatQueueReport':require(_0x9b5b('0x1c')),'smsQueueReport':require(_0x9b5b('0x1d')),'faxQueueReport':require('../../rpc/faxQueueReport'),'whatsappQueueReport':require('../../rpc/whatsappQueueReport')};var queue=schema({'name':{'type':_0x9b5b('0x1e'),'required':!![],'message':_0x9b5b('0x1f')},'timeout':{'type':_0x9b5b('0x20'),'message':_0x9b5b('0x21')}});function startRouting(_0x13ff97,_0x1dbd77,_0x374c21,_0x226f2d){if(_0x13ff97&&_0x1dbd77&&_0x374c21){_0x1dbd77[_0x9b5b('0x22')]+=0x1;var _0x47288a={'uniqueid':_0x13ff97,'from':_0x374c21['body']?_0x374c21[_0x9b5b('0x23')][_0x9b5b('0x10')]:'','joinAt':moment()[_0x9b5b('0x14')](_0x9b5b('0x24')),'ContactId':_0x374c21[_0x9b5b('0x25')]?_0x374c21[_0x9b5b('0x25')]['id']:null,'ListId':_0x374c21[_0x9b5b('0x26')]?_0x374c21[_0x9b5b('0x26')]['id']:null};_0x47288a[_[_0x9b5b('0x27')](_0x374c21['channel'])+_0x9b5b('0x28')]=_0x1dbd77['id']||null;_0x47288a[_[_0x9b5b('0x27')](_0x374c21['channel'])+'InteractionId']=_0x374c21['interaction']?_0x374c21['interaction']['id']:null;_0x47288a[_[_0x9b5b('0x27')](_0x374c21[_0x9b5b('0x29')])+_0x9b5b('0x2a')]=_0x374c21[_0x9b5b('0x2b')]?_0x374c21['message']['id']:null;_0x47288a[_['upperFirst'](_0x374c21['channel'])+(_0x374c21[_0x9b5b('0x29')]!==_0x9b5b('0x2c')?_0x9b5b('0x2d'):_0x9b5b('0x2e'))]=_0x374c21['account']?_0x374c21[_0x9b5b('0xe')]['id']:null;logger[_0x9b5b('0x2f')](util[_0x9b5b('0x14')](_0x9b5b('0x30'),_0x13ff97,_0x1dbd77[_0x9b5b('0x31')]));emitChannelQueueInteraction(_0x374c21[_0x9b5b('0x29')],_0x1dbd77[_0x9b5b('0x31')],_0x47288a,_0x374c21['account'][_0x9b5b('0x31')],_0x374c21[_0x9b5b('0x2b')]['id'],!![],_0x226f2d,_0x1dbd77['id']);if(rpc[_0x374c21[_0x9b5b('0x29')]+_0x9b5b('0x32')]){return rpc[_0x374c21[_0x9b5b('0x29')]+_0x9b5b('0x32')][_0x9b5b('0x33')](_0x47288a)[_0x9b5b('0x34')](function(_0x18a8d6){logger[_0x9b5b('0x35')]('create\x20queue\x20report');});}}}function stopRouting(_0x2b8999,_0x177514,_0x8a1e7,_0x49e4d1){if(_0x2b8999&&_0x177514){_0x177514[_0x9b5b('0x22')]-=0x1;var _0x1001a0={'leaveAt':moment()['format'](_0x9b5b('0x24')),'acceptAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'reason':'accepted'};logger[_0x9b5b('0x2f')](util[_0x9b5b('0x14')](_0x9b5b('0x36'),_0x2b8999,_0x177514[_0x9b5b('0x31')]));emitChannelQueueInteraction(_0x8a1e7['channel'],_0x177514['name'],_0x8a1e7[_0x9b5b('0x23')],_0x8a1e7['account'][_0x9b5b('0x31')],_0x8a1e7['message']['id'],![],_0x49e4d1,_0x177514['id']);if(rpc[_0x8a1e7[_0x9b5b('0x29')]+'QueueReport']){return rpc[_0x8a1e7[_0x9b5b('0x29')]+_0x9b5b('0x32')][_0x9b5b('0x37')](_0x2b8999,_0x1001a0)['catch'](function(_0x1be474){logger[_0x9b5b('0x35')]('update\x20queue\x20report');});}}}function endRouting(_0xf4fa4e,_0x411e19,_0x4a8bee,_0xe946bf){if(_0xf4fa4e&&_0x411e19){_0x411e19[_0x9b5b('0x22')]-=0x1;var _0x2f44d0={'leaveAt':moment()['format'](_0x9b5b('0x24')),'exitAt':moment()[_0x9b5b('0x14')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':'timeout'};logger[_0x9b5b('0x2f')](util[_0x9b5b('0x14')]('[%s][END:QUEUE][NAME:%s]',_0xf4fa4e,_0x411e19[_0x9b5b('0x31')]));emitChannelQueueInteraction(_0x4a8bee[_0x9b5b('0x29')],_0x411e19[_0x9b5b('0x31')],_0x4a8bee[_0x9b5b('0x23')],_0x4a8bee[_0x9b5b('0xe')][_0x9b5b('0x31')],_0x4a8bee['message']['id'],![],_0xe946bf);if(rpc[_0x4a8bee[_0x9b5b('0x29')]+'QueueReport']){return rpc[_0x4a8bee[_0x9b5b('0x29')]+_0x9b5b('0x32')]['update'](_0xf4fa4e,_0x2f44d0)[_0x9b5b('0x34')](function(_0x361111){logger[_0x9b5b('0x35')](_0x9b5b('0x38'));});}}}function handleFindQueue(_0x57052f){return function(_0x60383){return _0x60383[_0x9b5b('0x31')]['toLowerCase']()===_0x57052f[_0x9b5b('0x39')]();};}exports['consequence']=function(_0x58aea,_0x15505b,_0x2e4171,_0x28dce9){return function(_0x128bb3){try{var _0xb3d838={'name':_0x15505b[0x0],'timeout':_0x15505b[0x1]};var _0xcee9e7=queue[_0x9b5b('0x0')](_0xb3d838,{'typecast':!![]});if(_0xcee9e7['length']){logger[_0x9b5b('0x35')]('[%s][QUEUE]\x20%s',_0x58aea,_[_0x9b5b('0x3a')](_0xcee9e7,'message')[_0x9b5b('0x3b')](',\x20'));_0x128bb3['stop']();}else{var _0x35785a=_[_0x9b5b('0x3c')](_0x2e4171[_0x28dce9['channel']+_0x9b5b('0x3d')],handleFindQueue(_0xb3d838[_0x9b5b('0x31')]));if(_0x35785a){startRouting(_0x58aea,_0x35785a,_0x28dce9,_0x2e4171);var _0x12e265=(_0x35785a[_0x9b5b('0x3e')]||0xa)*0x3e8;var _0x9e7119=(_0xb3d838[_0x9b5b('0x3e')]||0x14)*0x3e8;var _0xf9ead,_0x1b15f7;if(_0x12e265>_0x9e7119){_0x9e7119=_0x12e265;}var _0x13bc91=seqqueue[_0x9b5b('0x3f')](_0x12e265);_0x13bc91['id']=_0x58aea;_0x13bc91['atimeout']=_0x12e265;_0x13bc91[_0x9b5b('0x40')]=_0x9e7119;_0x13bc91[_0x9b5b('0x29')]=_0x28dce9[_0x9b5b('0x29')];_0x2e4171[_0x9b5b('0x41')][_0x58aea]['on'](_0x9b5b('0x42'),function(){logger[_0x9b5b('0x2f')](_0x9b5b('0x43'),_0x58aea);stopRouting(_0x58aea,_0x35785a,_0x28dce9,_0x2e4171);clearTimeout(_0xf9ead);_0xf9ead=undefined;_0x13bc91[_0x9b5b('0x44')](!![]);if(_0x2e4171['rules'][_0x58aea]){delete _0x2e4171['rules'][_0x58aea];}_0x128bb3[_0x9b5b('0x45')]();});_0x2e4171[_0x9b5b('0x41')][_0x58aea]['on'](_0x9b5b('0x46'),function(){if(_0x2e4171[_0x9b5b('0x41')][_0x58aea]){delete _0x2e4171['rules'][_0x58aea];}});_0xf9ead=setTimeout(function(){logger['info'](_0x9b5b('0x47'),_0x58aea);endRouting(_0x58aea,_0x35785a,_0x28dce9,_0x2e4171);clearTimeout(_0xf9ead);_0x13bc91['close'](!![]);_0x128bb3['next']();},_0x9e7119);switch(_0x35785a[_0x9b5b('0x48')]){case _0x9b5b('0x49'):strategy[_0x9b5b('0x49')](_0x13bc91,_0x35785a,_0x2e4171,_0x28dce9);break;default:strategy[_0x9b5b('0x4a')](_0x13bc91,_0x35785a,_0x2e4171,_0x28dce9);}}else{logger['error']('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x58aea,_0xb3d838[_0x9b5b('0x31')]);_0x128bb3[_0x9b5b('0x45')]();}}}catch(_0x53c6ab){console[_0x9b5b('0x4b')](_0x53c6ab);logger['error'](_0x9b5b('0x4c'),_0x58aea,_0x53c6ab[_0x9b5b('0x4d')]);_0x128bb3[_0x9b5b('0x45')]();}};}; \ 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 9d1105d..f33bb79 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 _0xf2b4=['bind','timeout','handleDrained','prototype','handleRun','info','[%s][AGENT]\x20try\x20with\x20%s','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','agents','channel','writeLog','RINGING','isNil','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','busy','busyQueue','STOP','TIMEOUT','exports','lodash','uuid','./util','../../../../../config/logger','routing','notificationId','squeue','agent','realtime','push','handleTimeout'];(function(_0x278ff5,_0xe8a8da){var _0x2a3b45=function(_0x293d57){while(--_0x293d57){_0x278ff5['push'](_0x278ff5['shift']());}};_0x2a3b45(++_0xe8a8da);}(_0xf2b4,0x12b));var _0x4f2b=function(_0x8afee0,_0x583a13){_0x8afee0=_0x8afee0-0x0;var _0x3315ae=_0xf2b4[_0x8afee0];return _0x3315ae;};'use strict';var _=require(_0x4f2b('0x0'));var uuid=require(_0x4f2b('0x1'));var util=require(_0x4f2b('0x2'));var logger=require(_0x4f2b('0x3'))(_0x4f2b('0x4'));var Agent=function(_0xb4a48f,_0x1623d3,_0x5aa2f3,_0x982963){this[_0x4f2b('0x5')]=uuid['v4']();this[_0x4f2b('0x6')]=_0xb4a48f;this[_0x4f2b('0x7')]=_0x1623d3;this[_0x4f2b('0x8')]=_0x5aa2f3;this[_0x4f2b('0x4')]=_0x982963;this['squeue'][_0x4f2b('0x9')](this['handleRun']['bind'](this),this[_0x4f2b('0xa')][_0x4f2b('0xb')](this));this[_0x4f2b('0x6')]['on'](_0x4f2b('0xc'),this['handleTimeout']['bind'](this));this[_0x4f2b('0x6')]['on']('drained',this[_0x4f2b('0xd')][_0x4f2b('0xb')](this));};Agent[_0x4f2b('0xe')]['push']=function(){this[_0x4f2b('0x6')][_0x4f2b('0x9')](this[_0x4f2b('0xf')][_0x4f2b('0xb')](this),this[_0x4f2b('0xa')][_0x4f2b('0xb')](this));};Agent[_0x4f2b('0xe')]['handleDrained']=function(){this[_0x4f2b('0xa')](!![]);};Agent[_0x4f2b('0xe')]['handleRun']=function(_0x2703c6){logger[_0x4f2b('0x10')](_0x4f2b('0x11'),this[_0x4f2b('0x6')]['id'],this[_0x4f2b('0x7')]['id']);if(_['isNil'](this[_0x4f2b('0x8')]['agents'][this['agent']['id']])){logger[_0x4f2b('0x10')](_0x4f2b('0x12'),this[_0x4f2b('0x6')]['id'],this['agent']['id']);setTimeout(this['push'][_0x4f2b('0xb')](this),0x3e8);}else{if(this[_0x4f2b('0x4')]['forcedOwnership']||util['isAgentAvailable'](this[_0x4f2b('0x6')]['id'],this[_0x4f2b('0x8')][_0x4f2b('0x13')][this[_0x4f2b('0x7')]['id']],this[_0x4f2b('0x6')][_0x4f2b('0x14')],![])){this[_0x4f2b('0x8')]['agents'][this[_0x4f2b('0x7')]['id']]['busy']=!![];this[_0x4f2b('0x8')][_0x4f2b('0x13')][this[_0x4f2b('0x7')]['id']]['busyQueue']=undefined;util['showNotification'](this[_0x4f2b('0x5')],this[_0x4f2b('0x6')]['id'],this[_0x4f2b('0x8')][_0x4f2b('0x13')][this[_0x4f2b('0x7')]['id']],null,this[_0x4f2b('0x4')]);util[_0x4f2b('0x15')](this[_0x4f2b('0x6')]['id'],this[_0x4f2b('0x8')]['agents'][this[_0x4f2b('0x7')]['id']],_0x4f2b('0x16')+(this[_0x4f2b('0x4')]['forcedOwnership']?':FORCED':''));}else{logger[_0x4f2b('0x10')]('[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available',this[_0x4f2b('0x6')]['id'],this[_0x4f2b('0x7')]['id']);setTimeout(this[_0x4f2b('0x9')]['bind'](this),0x3e8);}}};Agent[_0x4f2b('0xe')]['handleTimeout']=function(_0x52dd46){if(_[_0x4f2b('0x17')](this[_0x4f2b('0x8')][_0x4f2b('0x13')][this['agent']['id']])){return logger[_0x4f2b('0x10')](_0x4f2b('0x12'),this[_0x4f2b('0x6')]['id'],this[_0x4f2b('0x7')]['id']);}else{logger[_0x4f2b('0x10')](_0x4f2b('0x18'),this[_0x4f2b('0x6')]['id'],this[_0x4f2b('0x7')]['id']);util[_0x4f2b('0x19')](this['notificationId'],this[_0x4f2b('0x6')]['id'],this['realtime'][_0x4f2b('0x13')][this[_0x4f2b('0x7')]['id']],null,this[_0x4f2b('0x4')]);this['realtime'][_0x4f2b('0x13')][this[_0x4f2b('0x7')]['id']][_0x4f2b('0x1a')]=![];this[_0x4f2b('0x8')][_0x4f2b('0x13')][this[_0x4f2b('0x7')]['id']][_0x4f2b('0x1b')]=undefined;util['writeLog'](this[_0x4f2b('0x6')]['id'],this[_0x4f2b('0x8')][_0x4f2b('0x13')][this['agent']['id']],_0x52dd46?_0x4f2b('0x1c'):_0x4f2b('0x1d'));}if(!_0x52dd46){setTimeout(this[_0x4f2b('0x9')][_0x4f2b('0xb')](this),0x3e8);}};function agent(_0x213eae,_0x55828a,_0x16da02,_0x1b0ecc){return new Agent(_0x213eae,_0x55828a,_0x16da02,_0x1b0ecc);}module[_0x4f2b('0x1e')]=agent; \ No newline at end of file +var _0xebf1=['realtime','push','bind','squeue','timeout','handleTimeout','drained','handleDrained','prototype','handleRun','info','[%s][AGENT]\x20try\x20with\x20%s','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','agents','busy','busyQueue','showNotification','writeLog','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','isNil','[%s][AGENT]\x20timeout\x20with\x20%s','STOP','TIMEOUT','exports','uuid','./util','../../../../../config/logger','routing','notificationId','agent'];(function(_0x5627e1,_0x1b2dbf){var _0x2f013f=function(_0x142015){while(--_0x142015){_0x5627e1['push'](_0x5627e1['shift']());}};_0x2f013f(++_0x1b2dbf);}(_0xebf1,0x170));var _0x1ebf=function(_0x1762b4,_0x33d836){_0x1762b4=_0x1762b4-0x0;var _0x29beda=_0xebf1[_0x1762b4];return _0x29beda;};'use strict';var _=require('lodash');var uuid=require(_0x1ebf('0x0'));var util=require(_0x1ebf('0x1'));var logger=require(_0x1ebf('0x2'))(_0x1ebf('0x3'));var Agent=function(_0x48b397,_0x238376,_0x432ecf,_0x64ec81){this[_0x1ebf('0x4')]=uuid['v4']();this['squeue']=_0x48b397;this[_0x1ebf('0x5')]=_0x238376;this[_0x1ebf('0x6')]=_0x432ecf;this[_0x1ebf('0x3')]=_0x64ec81;this['squeue'][_0x1ebf('0x7')](this['handleRun'][_0x1ebf('0x8')](this),this['handleTimeout']['bind'](this));this[_0x1ebf('0x9')]['on'](_0x1ebf('0xa'),this[_0x1ebf('0xb')][_0x1ebf('0x8')](this));this['squeue']['on'](_0x1ebf('0xc'),this[_0x1ebf('0xd')][_0x1ebf('0x8')](this));};Agent[_0x1ebf('0xe')][_0x1ebf('0x7')]=function(){this['squeue']['push'](this[_0x1ebf('0xf')]['bind'](this),this[_0x1ebf('0xb')][_0x1ebf('0x8')](this));};Agent['prototype'][_0x1ebf('0xd')]=function(){this[_0x1ebf('0xb')](!![]);};Agent[_0x1ebf('0xe')]['handleRun']=function(_0x4ea871){logger[_0x1ebf('0x10')](_0x1ebf('0x11'),this[_0x1ebf('0x9')]['id'],this[_0x1ebf('0x5')]['id']);if(_['isNil'](this[_0x1ebf('0x6')]['agents'][this[_0x1ebf('0x5')]['id']])){logger['info'](_0x1ebf('0x12'),this[_0x1ebf('0x9')]['id'],this['agent']['id']);setTimeout(this[_0x1ebf('0x7')]['bind'](this),0x3e8);}else{if(this[_0x1ebf('0x3')][_0x1ebf('0x13')]||util[_0x1ebf('0x14')](this[_0x1ebf('0x9')]['id'],this['realtime'][_0x1ebf('0x15')][this[_0x1ebf('0x5')]['id']],this['squeue']['channel'],![])){this[_0x1ebf('0x6')][_0x1ebf('0x15')][this[_0x1ebf('0x5')]['id']][_0x1ebf('0x16')]=!![];this[_0x1ebf('0x6')][_0x1ebf('0x15')][this[_0x1ebf('0x5')]['id']][_0x1ebf('0x17')]=undefined;util[_0x1ebf('0x18')](this['notificationId'],this['squeue']['id'],this[_0x1ebf('0x6')]['agents'][this['agent']['id']],null,this[_0x1ebf('0x3')]);util[_0x1ebf('0x19')](this['squeue']['id'],this[_0x1ebf('0x6')]['agents'][this['agent']['id']],_0x1ebf('0x1a')+(this[_0x1ebf('0x3')][_0x1ebf('0x13')]?_0x1ebf('0x1b'):''));}else{logger[_0x1ebf('0x10')](_0x1ebf('0x1c'),this['squeue']['id'],this[_0x1ebf('0x5')]['id']);setTimeout(this[_0x1ebf('0x7')][_0x1ebf('0x8')](this),0x3e8);}}};Agent[_0x1ebf('0xe')]['handleTimeout']=function(_0x257b3c){if(_[_0x1ebf('0x1d')](this[_0x1ebf('0x6')][_0x1ebf('0x15')][this[_0x1ebf('0x5')]['id']])){return logger[_0x1ebf('0x10')](_0x1ebf('0x12'),this['squeue']['id'],this[_0x1ebf('0x5')]['id']);}else{logger[_0x1ebf('0x10')](_0x1ebf('0x1e'),this[_0x1ebf('0x9')]['id'],this[_0x1ebf('0x5')]['id']);util['hideNotification'](this[_0x1ebf('0x4')],this['squeue']['id'],this[_0x1ebf('0x6')][_0x1ebf('0x15')][this[_0x1ebf('0x5')]['id']],null,this[_0x1ebf('0x3')]);this[_0x1ebf('0x6')]['agents'][this[_0x1ebf('0x5')]['id']][_0x1ebf('0x16')]=![];this[_0x1ebf('0x6')][_0x1ebf('0x15')][this[_0x1ebf('0x5')]['id']][_0x1ebf('0x17')]=undefined;util[_0x1ebf('0x19')](this['squeue']['id'],this[_0x1ebf('0x6')][_0x1ebf('0x15')][this['agent']['id']],_0x257b3c?_0x1ebf('0x1f'):_0x1ebf('0x20'));}if(!_0x257b3c){setTimeout(this[_0x1ebf('0x7')][_0x1ebf('0x8')](this),0x3e8);}};function agent(_0x3f31f2,_0x3949b5,_0x293f3a,_0x44c25d){return new Agent(_0x3f31f2,_0x3949b5,_0x293f3a,_0x44c25d);}module[_0x1ebf('0x21')]=agent; \ No newline at end of file diff --git a/server/services/routing/server/applications/strategy/beepall.js b/server/services/routing/server/applications/strategy/beepall.js index 4f38acf..55088b9 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 _0x00b3=['info','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','channel','writeLog','RINGING','busyQueue','name','showNotification','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20EMPTY','hideNotification','STOP','TIMEOUT','busy','exports','lodash','../../../../../config/logger','routing','notificationId','queue','realtime','squeue','push','handleRun','bind','handleTimeout','timeout','drained','handleDrained','prototype','isNil','Agents','length','agents'];(function(_0x5c524e,_0x4f07dc){var _0x49ffd1=function(_0x153467){while(--_0x153467){_0x5c524e['push'](_0x5c524e['shift']());}};_0x49ffd1(++_0x4f07dc);}(_0x00b3,0x97));var _0x300b=function(_0x11c05d,_0xee480){_0x11c05d=_0x11c05d-0x0;var _0x2a9f6a=_0x00b3[_0x11c05d];return _0x2a9f6a;};'use strict';var _=require(_0x300b('0x0'));var uuid=require('uuid');var util=require('./util');var logger=require(_0x300b('0x1'))(_0x300b('0x2'));var Beepall=function(_0x4aa4f4,_0x5a96e9,_0x103196,_0x29e653){this[_0x300b('0x3')]=uuid['v4']();this['squeue']=_0x4aa4f4;this[_0x300b('0x4')]=_0x5a96e9;this[_0x300b('0x5')]=_0x103196;this[_0x300b('0x2')]=_0x29e653;this[_0x300b('0x6')][_0x300b('0x7')](this[_0x300b('0x8')][_0x300b('0x9')](this),this[_0x300b('0xa')][_0x300b('0x9')](this));this[_0x300b('0x6')]['on'](_0x300b('0xb'),this[_0x300b('0xa')][_0x300b('0x9')](this));this['squeue']['on'](_0x300b('0xc'),this[_0x300b('0xd')][_0x300b('0x9')](this));};Beepall['prototype'][_0x300b('0x7')]=function(){this[_0x300b('0x6')]['push'](this['handleRun'][_0x300b('0x9')](this),this['handleTimeout'][_0x300b('0x9')](this));};Beepall[_0x300b('0xe')][_0x300b('0xd')]=function(_0x1f26e3){this[_0x300b('0xa')](!![]);};Beepall[_0x300b('0xe')]['handleRun']=function(_0x59dd20){var _0xbede7=!![];if(!_[_0x300b('0xf')](this[_0x300b('0x4')])&&!_[_0x300b('0xf')](this[_0x300b('0x4')][_0x300b('0x10')])&&this[_0x300b('0x4')][_0x300b('0x10')]['length']>0x0){for(var _0x41cde4=0x0,_0x28c866;_0x41cde40x0){for(var _0x57f65d=0x0,_0x54bfbe;_0x57f65d0x0&&_0x1f3d6d[_0x37fe4e+_0x17ee('0x25')]>=_0x1f3d6d[_0x37fe4e+_0x17ee('0x24')]){writeLog(_0x1425e5,_0x1f3d6d,_0x37fe4e['toUpperCase']()+_0x17ee('0x26'));return![];}}return!![];};exports[_0x17ee('0x27')]=function(_0x11ce7e,_0x258018,_0x125513,_0x51a561,_0x38237c){return sendNotification(!![],_0x11ce7e,_0x258018,_0x125513,_0x51a561,_0x38237c);};exports[_0x17ee('0x28')]=function(_0x295186,_0x4c461b,_0x2220cb,_0x27ab38,_0x56c6ba){return sendNotification(![],_0x295186,_0x4c461b,_0x2220cb,_0x27ab38,_0x56c6ba);};exports[_0x17ee('0x29')]=writeLog; \ No newline at end of file +var _0x583c=['BUSY','online','OFFLINE','Pause','PAUSE','hasOwnProperty','Capacity','CurrentCapacity','toUpperCase','\x20MAXCAPACITY','hideNotification','writeLog','lodash','util','../utils','mustache','../../../../../config/environment','../../../../../config/logger','defaults','redis','socket.io-emitter','emit','format','name','\x20interaction','account','notificationSound','notificationShake','body','queue','msg','getMustacheRender','notificationTemplate','I\x20can\x27t\x20render\x20your\x20template','error','[%s][QUEUE]\x20%s','notification:%s','save','remove','info','[%s][QUEUE][AGENT:%s][STATUS:%s]'];(function(_0x4f15c6,_0x3eb56a){var _0x5cd110=function(_0x8bd15e){while(--_0x8bd15e){_0x4f15c6['push'](_0x4f15c6['shift']());}};_0x5cd110(++_0x3eb56a);}(_0x583c,0x12b));var _0xc583=function(_0x41c381,_0x1176bd){_0x41c381=_0x41c381-0x0;var _0x427981=_0x583c[_0x41c381];return _0x427981;};'use strict';var _=require(_0xc583('0x0'));var util=require(_0xc583('0x1'));var utils=require(_0xc583('0x2'));var Mustache=require(_0xc583('0x3'));var Redis=require('ioredis');var config=require(_0xc583('0x4'));var logger=require(_0xc583('0x5'))('routing');config['redis']=_[_0xc583('0x6')](config[_0xc583('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0xc583('0x8'))(new Redis(config[_0xc583('0x7')]));function emit(_0x2719df,_0x1dd37c,_0x48a8d4){io['to'](_0x2719df)[_0xc583('0x9')](_0x1dd37c,_0x48a8d4);}function sendNotification(_0x26cec0,_0x5b456e,_0x163ab2,_0x24ab4f,_0x25f8d3,_0xb23f07){io['to'](util[_0xc583('0xa')]('user:%s',_0x24ab4f[_0xc583('0xb')]))[_0xc583('0x9')]('user:save',_0x24ab4f);var _0x23c51a=_0xb23f07||{};var _0x2994c5=_0x163ab2['split']('.');var _0x2c2424={'uniqueid':_0x5b456e,'channel':_0x2994c5[0x0],'id':_0x2994c5[0x1],'title':_0x2994c5[0x0]+_0xc583('0xc'),'interactionId':_0x2994c5[0x2],'queue':_0x25f8d3?_0x25f8d3[_0xc583('0xb')]:null,'sound':_0x23c51a[_0xc583('0xd')][_0xc583('0xe')],'shake':_0x23c51a[_0xc583('0xd')][_0xc583('0xf')]};try{if(!_0x23c51a[_0xc583('0x10')]){_0x23c51a[_0xc583('0x10')]={};}if(_0x25f8d3){_0x23c51a['body'][_0xc583('0x11')]=_0x25f8d3;}else if(_0x23c51a['body'][_0xc583('0x11')]){delete _0x23c51a[_0xc583('0x10')]['queue'];}_0x2c2424[_0xc583('0x12')]=utils[_0xc583('0x13')](_0x23c51a['account'][_0xc583('0x14')],_0x23c51a);}catch(_0x4ca776){_0x2c2424['msg']=_0xc583('0x15');logger[_0xc583('0x16')](util[_0xc583('0xa')](_0xc583('0x17'),_0x5b456e,_0x4ca776['message']));}io['to'](util[_0xc583('0xa')]('user:%s',_0x24ab4f[_0xc583('0xb')]))[_0xc583('0x9')](util[_0xc583('0xa')](_0xc583('0x18'),_0x26cec0?_0xc583('0x19'):_0xc583('0x1a')),_0x2c2424);}function writeLog(_0x3ce81b,_0x26756c,_0x37fcd4){return logger[_0xc583('0x1b')](util[_0xc583('0xa')](_0xc583('0x1c'),_0x3ce81b,_0x26756c[_0xc583('0xb')],_0x37fcd4));}exports['isAgentAvailable']=function(_0x542256,_0x34b353,_0x3e075c,_0x8443dc){if(_0x34b353['busy']){writeLog(_0x542256,_0x34b353,_0xc583('0x1d'));return![];}if(!_0x34b353[_0xc583('0x1e')]){writeLog(_0x542256,_0x34b353,_0xc583('0x1f'));return![];}if(_0x34b353[_0x3e075c+_0xc583('0x20')]){writeLog(_0x542256,_0x34b353,_0xc583('0x21'));return![];}if(_0x8443dc&&_0x34b353['hasOwnProperty'](_0x3e075c+'Capacity')&&_0x34b353[_0xc583('0x22')](_0x3e075c+'CurrentCapacity')){if(_0x34b353[_0x3e075c+_0xc583('0x23')]>0x0&&_0x34b353[_0x3e075c+_0xc583('0x24')]>=_0x34b353[_0x3e075c+_0xc583('0x23')]){writeLog(_0x542256,_0x34b353,_0x3e075c[_0xc583('0x25')]()+_0xc583('0x26'));return![];}}return!![];};exports['showNotification']=function(_0x2dafb4,_0x44f76a,_0x4adde3,_0x162c85,_0x483357){return sendNotification(!![],_0x2dafb4,_0x44f76a,_0x4adde3,_0x162c85,_0x483357);};exports[_0xc583('0x27')]=function(_0x8d4ecb,_0x1c80b1,_0x3ed083,_0x1b2b49,_0x19079b){return sendNotification(![],_0x8d4ecb,_0x1c80b1,_0x3ed083,_0x1b2b49,_0x19079b);};exports[_0xc583('0x28')]=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 3e371bb..7a1d0d5 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 _0x1ca5=['shelljs','lodash','./utils','../../../../config/logger','routing','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','length','error','[%s][SYSTEM]\x20%s','message','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','stringify','validate'];(function(_0x35d9b5,_0x782d1b){var _0x3d8f85=function(_0x22a3bf){while(--_0x22a3bf){_0x35d9b5['push'](_0x35d9b5['shift']());}};_0x3d8f85(++_0x782d1b);}(_0x1ca5,0x11d));var _0x51ca=function(_0x597e85,_0x5a2cf5){_0x597e85=_0x597e85-0x0;var _0x4bf259=_0x1ca5[_0x597e85];return _0x4bf259;};'use strict';var schema=require(_0x51ca('0x0'));var sh=require(_0x51ca('0x1'));var _=require(_0x51ca('0x2'));var utils=require(_0x51ca('0x3'));var logger=require(_0x51ca('0x4'))(_0x51ca('0x5'));var system=schema({'command':{'type':'string','required':!![],'message':_0x51ca('0x6')}});exports['consequence']=function(_0x176c0a,_0x133113){return function(_0x22b217){try{var _0x5d2035={'command':_0x133113[0x0]};var _0x296a69=system['validate'](_0x5d2035,{'typecast':!![]});if(_0x296a69[_0x51ca('0x7')]){logger[_0x51ca('0x8')](_0x51ca('0x9'),_0x176c0a,_['map'](_0x296a69,_0x51ca('0xa'))[_0x51ca('0xb')](',\x20'));logger[_0x51ca('0xc')](_0x51ca('0xd'),_0x176c0a);_0x22b217[_0x51ca('0xe')]();}else{var _0x1f478c=this;var _0x473ed5=utils[_0x51ca('0xf')](_0x133113[0x0],this);logger['info'](_0x51ca('0x10'),_0x176c0a,_0x473ed5);sh['exec'](_['trim'](_0x473ed5),function(_0x317271,_0x2d0e0a){logger[_0x51ca('0xc')](_0x51ca('0x11'),_0x176c0a,_0x317271);if(_0x317271==0x0){var _0x4f7467=_0x2d0e0a[_0x51ca('0x12')](/(\r\n|\n|\r)/gm,'');if(_['isNil'](_0x133113[0x1])||_['isEmpty'](_0x133113[0x1])){logger[_0x51ca('0xc')]('[%s][SYSTEM]\x20no\x20variable',_0x176c0a);_0x1f478c[_0x51ca('0x13')][_0x133113[0x1]]=_0x4f7467;}else{logger[_0x51ca('0xc')](_0x51ca('0x14'),_0x176c0a,_0x133113[0x1],_0x4f7467);_0x1f478c[_0x51ca('0x13')][_0x133113[0x1]]=_0x4f7467;}}_0x22b217[_0x51ca('0xe')]();});}}catch(_0x5de690){logger[_0x51ca('0x8')](_0x51ca('0x9'),_0x176c0a,_['isObject'](_0x5de690)?JSON[_0x51ca('0x15')](_0x5de690):_0x5de690);logger[_0x51ca('0xc')](_0x51ca('0xd'),_0x176c0a);_0x22b217[_0x51ca('0xe')]();}};}; \ No newline at end of file +var _0x57af=['getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','body','stringify','validate','lodash','./utils','string','consequence','length','error','[%s][SYSTEM]\x20%s','map','message','join','info','next'];(function(_0x5ec98d,_0x3e50d5){var _0x5367f5=function(_0x36db9f){while(--_0x36db9f){_0x5ec98d['push'](_0x5ec98d['shift']());}};_0x5367f5(++_0x3e50d5);}(_0x57af,0xcb));var _0xf57a=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0x57af[_0x49ca18];return _0x145d54;};'use strict';var schema=require(_0xf57a('0x0'));var sh=require('shelljs');var _=require(_0xf57a('0x1'));var utils=require(_0xf57a('0x2'));var logger=require('../../../../config/logger')('routing');var system=schema({'command':{'type':_0xf57a('0x3'),'required':!![],'message':'command\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0xf57a('0x4')]=function(_0x613cb1,_0x36d42c){return function(_0x45e8ee){try{var _0x5b9f62={'command':_0x36d42c[0x0]};var _0x4e3799=system[_0xf57a('0x0')](_0x5b9f62,{'typecast':!![]});if(_0x4e3799[_0xf57a('0x5')]){logger[_0xf57a('0x6')](_0xf57a('0x7'),_0x613cb1,_[_0xf57a('0x8')](_0x4e3799,_0xf57a('0x9'))[_0xf57a('0xa')](',\x20'));logger[_0xf57a('0xb')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x613cb1);_0x45e8ee[_0xf57a('0xc')]();}else{var _0x56b25c=this;var _0x4639dc=utils[_0xf57a('0xd')](_0x36d42c[0x0],this);logger[_0xf57a('0xb')](_0xf57a('0xe'),_0x613cb1,_0x4639dc);sh[_0xf57a('0xf')](_[_0xf57a('0x10')](_0x4639dc),function(_0x39e38f,_0x4cea16){logger[_0xf57a('0xb')](_0xf57a('0x11'),_0x613cb1,_0x39e38f);if(_0x39e38f==0x0){var _0x32ab3f=_0x4cea16[_0xf57a('0x12')](/(\r\n|\n|\r)/gm,'');if(_[_0xf57a('0x13')](_0x36d42c[0x1])||_[_0xf57a('0x14')](_0x36d42c[0x1])){logger[_0xf57a('0xb')]('[%s][SYSTEM]\x20no\x20variable',_0x613cb1);_0x56b25c['body'][_0x36d42c[0x1]]=_0x32ab3f;}else{logger[_0xf57a('0xb')](_0xf57a('0x15'),_0x613cb1,_0x36d42c[0x1],_0x32ab3f);_0x56b25c[_0xf57a('0x16')][_0x36d42c[0x1]]=_0x32ab3f;}}_0x45e8ee[_0xf57a('0xc')]();});}}catch(_0x194d25){logger[_0xf57a('0x6')](_0xf57a('0x7'),_0x613cb1,_['isObject'](_0x194d25)?JSON[_0xf57a('0x17')](_0x194d25):_0x194d25);logger['info']('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x613cb1);_0x45e8ee['next']();}};}; \ 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 df69a82..28f3ad6 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 _0x0fd7=['interaction','then','catch','stringify','finally','validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][TAG]\x20%s','map','message','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','addTags'];(function(_0x4715d2,_0x3371b2){var _0x141811=function(_0x520bc6){while(--_0x520bc6){_0x4715d2['push'](_0x4715d2['shift']());}};_0x141811(++_0x3371b2);}(_0x0fd7,0xd7));var _0x70fd=function(_0x350e72,_0x59d6c8){_0x350e72=_0x350e72-0x0;var _0x22851f=_0x0fd7[_0x350e72];return _0x22851f;};'use strict';var schema=require(_0x70fd('0x0'));var _=require(_0x70fd('0x1'));var rpc={'chatInteraction':require(_0x70fd('0x2')),'openchannelInteraction':require(_0x70fd('0x3')),'smsInteraction':require(_0x70fd('0x4')),'mailInteraction':require(_0x70fd('0x5')),'faxInteraction':require(_0x70fd('0x6')),'whatsappInteraction':require(_0x70fd('0x7'))};var logger=require(_0x70fd('0x8'))(_0x70fd('0x9'));var tag=schema({'tag':{'type':_0x70fd('0xa'),'required':!![],'message':_0x70fd('0xb')}});exports[_0x70fd('0xc')]=function(_0x56287e,_0x1143e5,_0x1d4b5,_0xafdb96){return function(_0x2606d8){try{var _0x52d892={'tag':_0x1143e5[0x0]};var _0x2d4a3d=tag[_0x70fd('0x0')](_0x52d892,{'typecast':!![]});if(_0x2d4a3d[_0x70fd('0xd')]){logger[_0x70fd('0xe')](_0x70fd('0xf'),_0x56287e,_[_0x70fd('0x10')](_0x2d4a3d,_0x70fd('0x11'))[_0x70fd('0x12')](',\x20'));logger[_0x70fd('0x13')](_0x70fd('0x14'),_0x56287e);_0x2606d8[_0x70fd('0x15')]();}else{var _0xb20693={'ids':[_0x1143e5[0x0]]};if(rpc[_0xafdb96[_0x70fd('0x16')]+_0x70fd('0x17')]){rpc[_0xafdb96['channel']+_0x70fd('0x17')][_0x70fd('0x18')](_0xafdb96[_0x70fd('0x19')]['id'],_0xb20693)[_0x70fd('0x1a')](function(_0x570931){logger[_0x70fd('0x13')]('[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s',_0x56287e,_0x1143e5[0x1],_0xafdb96[_0x70fd('0x16')],_0xafdb96[_0x70fd('0x19')]['id']);})[_0x70fd('0x1b')](function(_0x3e6986){logger[_0x70fd('0xe')](_0x70fd('0xf'),_0x56287e,JSON[_0x70fd('0x1c')](_0x3e6986));logger[_0x70fd('0x13')](_0x70fd('0x14'),_0x56287e);})[_0x70fd('0x1d')](function(){_0x2606d8[_0x70fd('0x15')]();});}}}catch(_0xace46f){logger[_0x70fd('0xe')](_0x70fd('0xf'),_0x56287e,_['isObject'](_0xace46f)?JSON[_0x70fd('0x1c')](_0xace46f):_0xace46f);logger['info'](_0x70fd('0x14'),_0x56287e);_0x2606d8[_0x70fd('0x15')]();}};}; \ No newline at end of file +var _0x819d=['[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','finally','isObject','validate','lodash','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','routing','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','[%s][TAG]\x20%s','map','message','join','info','next','channel','Interaction','interaction','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','error','stringify'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x819d,0x6f));var _0xd819=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x819d[_0x422905];return _0x33dc6c;};'use strict';var schema=require(_0xd819('0x0'));var _=require(_0xd819('0x1'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0xd819('0x2')),'smsInteraction':require(_0xd819('0x3')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0xd819('0x4')),'whatsappInteraction':require(_0xd819('0x5'))};var logger=require('../../../../config/logger')(_0xd819('0x6'));var tag=schema({'tag':{'type':'number','required':!![],'message':_0xd819('0x7')}});exports[_0xd819('0x8')]=function(_0x468400,_0x25c7f9,_0x6c1a31,_0x48f998){return function(_0x177db4){try{var _0x28baa7={'tag':_0x25c7f9[0x0]};var _0x41f01d=tag[_0xd819('0x0')](_0x28baa7,{'typecast':!![]});if(_0x41f01d[_0xd819('0x9')]){logger['error'](_0xd819('0xa'),_0x468400,_[_0xd819('0xb')](_0x41f01d,_0xd819('0xc'))[_0xd819('0xd')](',\x20'));logger[_0xd819('0xe')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x468400);_0x177db4[_0xd819('0xf')]();}else{var _0xe5f8c9={'ids':[_0x25c7f9[0x0]]};if(rpc[_0x48f998[_0xd819('0x10')]+_0xd819('0x11')]){rpc[_0x48f998[_0xd819('0x10')]+_0xd819('0x11')]['addTags'](_0x48f998[_0xd819('0x12')]['id'],_0xe5f8c9)[_0xd819('0x13')](function(_0x4d7419){logger['info'](_0xd819('0x14'),_0x468400,_0x25c7f9[0x1],_0x48f998[_0xd819('0x10')],_0x48f998['interaction']['id']);})[_0xd819('0x15')](function(_0xec5c3c){logger[_0xd819('0x16')](_0xd819('0xa'),_0x468400,JSON[_0xd819('0x17')](_0xec5c3c));logger[_0xd819('0xe')](_0xd819('0x18'),_0x468400);})[_0xd819('0x19')](function(){_0x177db4[_0xd819('0xf')]();});}}}catch(_0x4cd081){logger[_0xd819('0x16')](_0xd819('0xa'),_0x468400,_[_0xd819('0x1a')](_0x4cd081)?JSON[_0xd819('0x17')](_0x4cd081):_0x4cd081);logger['info'](_0xd819('0x18'),_0x468400);_0x177db4[_0xd819('0xf')]();}};}; \ 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 0148a75..6291dcb 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 _0xd8b0=['merge','body','contact','message','list','mustache','lodash','render'];(function(_0x3d0481,_0x44a69e){var _0x2b3c82=function(_0x1f29d6){while(--_0x1f29d6){_0x3d0481['push'](_0x3d0481['shift']());}};_0x2b3c82(++_0x44a69e);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Mustache=require(_0x0d8b('0x0'));var _=require(_0x0d8b('0x1'));module['exports']={'getMustacheRender':function(_0x585166,_0x4b72b0){return Mustache[_0x0d8b('0x2')](_0x585166,_[_0x0d8b('0x3')](_0x4b72b0[_0x0d8b('0x4')],{'contact':_0x4b72b0[_0x0d8b('0x5')],'message':_0x4b72b0[_0x0d8b('0x6')],'account':_0x4b72b0['account'],'interaction':_0x4b72b0['interaction'],'list':_0x4b72b0[_0x0d8b('0x7')]}))||'';}}; \ No newline at end of file +var _0xa9e0=['message','account','interaction','mustache','lodash','exports','render','body','contact'];(function(_0x5b0c07,_0x59fe92){var _0x35caa9=function(_0x3e3080){while(--_0x3e3080){_0x5b0c07['push'](_0x5b0c07['shift']());}};_0x35caa9(++_0x59fe92);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xa9e0[_0x5447fd];return _0x15b28a;};'use strict';var Mustache=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'getMustacheRender':function(_0x5dd881,_0x550fbc){return Mustache[_0x0a9e('0x3')](_0x5dd881,_['merge'](_0x550fbc[_0x0a9e('0x4')],{'contact':_0x550fbc[_0x0a9e('0x5')],'message':_0x550fbc[_0x0a9e('0x6')],'account':_0x550fbc[_0x0a9e('0x7')],'interaction':_0x550fbc[_0x0a9e('0x8')],'list':_0x550fbc['list']}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index f591378..2102035 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 _0x70c3=['isNil','Intervals','map','interval','listen','rules','channel','message','interaction','applications','isArray','length','existsSync','join','app','.js','toLowerCase','appdata','split','push','slice','dialogflow','dialogflowv2','tag','TagId','format','%s:%s:%s','condition','intervals','./applications/','consequence','priority','info','Push\x20new\x20rule','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','execute','stringify','matchPath','emit','complete','No\x20applications\x20to\x20execute','stack','routing\x20is\x20empty','agent','agents','busy','end','QueueReport','update','UserId','message\x20is\x20empty','busyQueue','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','loggedIn','name','paused','waiting','openchannelQueues','available','smsQueues','faxQueues','whatsappQueues','openchannelQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','jayson/promise','bluebird','../../../config/environment','routing','../rpc/openchannelQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','IntervalId'];(function(_0x1bc013,_0x7771c6){var _0x55df36=function(_0x1c02e0){while(--_0x1c02e0){_0x1bc013['push'](_0x1bc013['shift']());}};_0x55df36(++_0x7771c6);}(_0x70c3,0x153));var _0x370c=function(_0x5d8cc7,_0x2f513e){_0x5d8cc7=_0x5d8cc7-0x0;var _0x7c43d0=_0x70c3[_0x5d8cc7];return _0x7c43d0;};'use strict';var _=require(_0x370c('0x0'));var util=require('util');var path=require('path');var fs=require('fs');var jayson=require(_0x370c('0x1'));var BPromise=require(_0x370c('0x2'));var uuid=require('uuid');var config=require(_0x370c('0x3'));var logger=require('../../../config/logger')(_0x370c('0x4'));var rpc={'openchannelQueueReport':require(_0x370c('0x5')),'mailQueueReport':require('../rpc/mailQueueReport'),'chatQueueReport':require('../rpc/chatQueueReport'),'smsQueueReport':require('../rpc/smsQueueReport'),'faxQueueReport':require('../rpc/faxQueueReport'),'whatsappQueueReport':require(_0x370c('0x6'))};var RuleEngine=require(_0x370c('0x7'));function getId(_0x1b4db9,_0xede5f1,_0x4d2552){return util['format']('%s.%s.%s',_0x1b4db9,_0xede5f1||0x0,_0x4d2552||0x0);}function getIntervals(_0x1811cf,_0x73b4f4){var _0x452929=[];if(!_['isNil'](_0x73b4f4[_0x370c('0x8')])&&!_['isNil'](_0x1811cf[_0x73b4f4[_0x370c('0x8')]])&&!_[_0x370c('0x9')](_0x1811cf[_0x73b4f4[_0x370c('0x8')]][_0x370c('0xa')])){_0x452929=_[_0x370c('0xb')](_0x1811cf[_0x73b4f4[_0x370c('0x8')]]['Intervals'],_0x370c('0xc'));}else if(!_['isNil'](_0x73b4f4[_0x370c('0xc')])){_0x452929=[_0x73b4f4[_0x370c('0xc')]];}return _0x452929;}exports[_0x370c('0xd')]=function(_0x4d1fde){_0x4d1fde[_0x370c('0xe')]={};return new BPromise(function(_0x4c751b,_0x334f2d){var _0x341e16={'Start':function(_0x4f185d){var _0x552506=this;return new Promise(function(_0x14ade3,_0x1a60a2){if(_0x4f185d){try{var _0x1a8ea5=[];var _0x55fa65=getId(_0x4f185d[_0x370c('0xf')],_0x4f185d[_0x370c('0x10')]?_0x4f185d[_0x370c('0x10')]['id']:0x0,_0x4f185d[_0x370c('0x11')]?_0x4f185d['interaction']['id']:0x0);if(_0x4f185d[_0x370c('0x12')]&&_[_0x370c('0x13')](_0x4f185d[_0x370c('0x12')])&&_0x4f185d[_0x370c('0x12')][_0x370c('0x14')]){for(var _0x37b50b=0x0;_0x37b50b<_0x4f185d['applications'][_0x370c('0x14')];_0x37b50b+=0x1){var _0x4ab302=_0x4f185d[_0x370c('0x12')][_0x37b50b];if(fs[_0x370c('0x15')](path[_0x370c('0x16')](__dirname,'applications',_0x4ab302[_0x370c('0x17')]+_0x370c('0x18')))){var _0x5864bd=[];switch(_0x4ab302[_0x370c('0x17')][_0x370c('0x19')]()){case'autoreply':var _0x40ea92=_0x4ab302[_0x370c('0x1a')][_0x370c('0x1b')](',');if(_0x4f185d['channel']==='mail'){_0x5864bd[_0x370c('0x1c')](_0x40ea92[0x0]);_0x5864bd[_0x370c('0x1c')](_0x40ea92[0x1]);_0x5864bd[_0x370c('0x1c')](_0x40ea92[_0x370c('0x1d')](0x2,_0x40ea92[_0x370c('0x14')])[_0x370c('0x16')](','));}else{_0x5864bd[_0x370c('0x1c')](_0x40ea92[0x0]);_0x5864bd[_0x370c('0x1c')](_0x40ea92[_0x370c('0x1d')](0x1,_0x40ea92[_0x370c('0x14')])[_0x370c('0x16')](','));}break;case _0x370c('0x1e'):var _0xab51de=_0x4ab302[_0x370c('0x1a')][_0x370c('0x1b')](',');_0x5864bd[_0x370c('0x1c')](_0xab51de[0x0]);_0x5864bd[_0x370c('0x1c')](_0xab51de[0x1]);_0x5864bd['push'](_0xab51de[_0x370c('0x1d')](0x2,_0xab51de[_0x370c('0x14')])[_0x370c('0x16')](','));break;case _0x370c('0x1f'):var _0x1ab256=_0x4ab302[_0x370c('0x1a')][_0x370c('0x1b')](',');_0x5864bd[_0x370c('0x1c')](_0x1ab256[0x0]);_0x5864bd[_0x370c('0x1c')](_0x1ab256[0x1]);_0x5864bd[_0x370c('0x1c')](_0x1ab256[0x2]);_0x5864bd[_0x370c('0x1c')](_0x1ab256[0x3]);_0x5864bd[_0x370c('0x1c')](_0x1ab256[_0x370c('0x1d')](0x4,_0x1ab256[_0x370c('0x14')])[_0x370c('0x16')](','));break;case'amazonlex':var _0x289cfa=_0x4ab302[_0x370c('0x1a')][_0x370c('0x1b')](',');_0x5864bd[_0x370c('0x1c')](_0x289cfa[0x0]);_0x5864bd[_0x370c('0x1c')](_0x289cfa[0x1]);_0x5864bd['push'](_0x289cfa[0x2]);_0x5864bd['push'](_0x289cfa[0x3]);_0x5864bd[_0x370c('0x1c')](_0x289cfa[_0x370c('0x1d')](0x4,_0x289cfa['length'])[_0x370c('0x16')](','));break;case _0x370c('0x10'):_0x5864bd[_0x370c('0x1c')](_0x4ab302['appdata']);break;case _0x370c('0x20'):_0x5864bd[_0x370c('0x1c')](_0x4ab302[_0x370c('0x21')]);_0x5864bd[_0x370c('0x1c')](_0x4ab302[_0x370c('0x1a')]);break;default:_0x5864bd=_[_0x370c('0x9')](_0x4ab302[_0x370c('0x1a')])?[]:_0x4ab302[_0x370c('0x1a')][_0x370c('0x1b')](',');}var _0x6b406d={'id':util[_0x370c('0x22')](_0x370c('0x23'),_0x55fa65,_0x4ab302['id'],_0x4ab302[_0x370c('0x17')]),'condition':require('./interval')[_0x370c('0x24')](_0x55fa65,getIntervals(_0x4d1fde[_0x370c('0x25')],_0x4ab302),_0x4d1fde),'consequence':require(_0x370c('0x26')+_0x4ab302[_0x370c('0x17')])[_0x370c('0x27')](_0x55fa65,_0x5864bd,_0x4d1fde,_0x4f185d),'p':_0x4ab302[_0x370c('0x28')]||0x0};logger[_0x370c('0x29')](_0x370c('0x2a'),_0x6b406d['id'],'on\x20interval',getIntervals(_0x4d1fde[_0x370c('0x25')],_0x4ab302)['join'](_0x370c('0x2b')));_0x1a8ea5['push'](_0x6b406d);}else{logger[_0x370c('0x2c')](_0x370c('0x2d'),path[_0x370c('0x16')](__dirname,_0x370c('0x12'),_0x4ab302[_0x370c('0x17')]+_0x370c('0x18')));}}_0x4d1fde['rules'][_0x55fa65]=new RuleEngine(_0x1a8ea5);_0x4d1fde['rules'][_0x55fa65][_0x370c('0x2e')](_0x4f185d,function(_0x4b7bf0){logger[_0x370c('0x29')]('Applications\x20executed',JSON[_0x370c('0x2f')](_0x4b7bf0[_0x370c('0x30')]));if(_0x4d1fde[_0x370c('0xe')][_0x55fa65]){_0x4d1fde[_0x370c('0xe')][_0x55fa65][_0x370c('0x31')](_0x370c('0x32'));}});return _0x14ade3({'code':0xc8,'message':_0x4f185d});}else{logger[_0x370c('0x29')](_0x370c('0x33'));return _0x14ade3({'code':0xc8,'message':_0x4f185d});}}catch(_0x55cae2){logger['error'](_0x55cae2[_0x370c('0x34')]);return _0x1a60a2(_0x552506['error'](0x1f4,_0x55cae2));}}return _0x1a60a2(_0x370c('0x35'));});},'AcceptMessage':function(_0x99eeee){var _0x13e3eb=this;return new Promise(function(_0x3461cc,_0x15ddd7){if(_0x99eeee[_0x370c('0x36')]&&_0x99eeee[_0x370c('0x36')]['id']){if(_0x4d1fde[_0x370c('0x37')][_0x99eeee[_0x370c('0x36')]['id']]){_0x4d1fde[_0x370c('0x37')][_0x99eeee[_0x370c('0x36')]['id']][_0x370c('0x38')]=![];_0x4d1fde['agents'][_0x99eeee[_0x370c('0x36')]['id']]['busyQueue']=undefined;}}if(_0x99eeee[_0x370c('0x10')]&&_0x99eeee[_0x370c('0x10')]['id']){try{var _0x15cb19=getId(_0x99eeee[_0x370c('0xf')],_0x99eeee[_0x370c('0x10')]?_0x99eeee['message']['id']:0x0,_0x99eeee[_0x370c('0x11')]?_0x99eeee['interaction']['id']:0x0);if(_0x4d1fde[_0x370c('0xe')][_0x15cb19]){_0x4d1fde[_0x370c('0xe')][_0x15cb19][_0x370c('0x31')](_0x370c('0x39'));if(rpc[_0x99eeee['channel']+_0x370c('0x3a')]){rpc[_0x99eeee['channel']+_0x370c('0x3a')][_0x370c('0x3b')](_0x15cb19,{'UserId':_0x99eeee[_0x370c('0x10')][_0x370c('0x3c')]})['catch'](function(_0x15c40c){logger[_0x370c('0x2c')]('error\x20update\x20queue\x20report');});}}return _0x3461cc({'code':0xc8,'message':_0x99eeee});}catch(_0x55f0ca){logger[_0x370c('0x2c')](_0x55f0ca['stack']);return _0x15ddd7(_0x13e3eb[_0x370c('0x2c')](0x1f4,_0x55f0ca));}}logger[_0x370c('0x2c')](_0x370c('0x3d'));return _0x15ddd7(_0x13e3eb[_0x370c('0x2c')](0x1f4,'message\x20is\x20empty'));});},'RejectMessage':function(_0x4fb9e5){var _0x266899=this;return new Promise(function(_0x50a4a6,_0xbf1beb){if(_0x4fb9e5['agent']&&_0x4fb9e5['agent']['id']){try{if(_0x4d1fde[_0x370c('0x37')][_0x4fb9e5[_0x370c('0x36')]['id']]){_0x4d1fde[_0x370c('0x37')][_0x4fb9e5[_0x370c('0x36')]['id']]['busy']=![];_0x4d1fde[_0x370c('0x37')][_0x4fb9e5[_0x370c('0x36')]['id']][_0x370c('0x3e')]=undefined;}return _0x50a4a6({'code':0xc8,'message':_0x4fb9e5});}catch(_0x34b2bc){logger[_0x370c('0x2c')](_0x34b2bc['stack']);return _0xbf1beb(_0x266899[_0x370c('0x2c')](0x1f4,_0x34b2bc));}}logger[_0x370c('0x2c')](_0x370c('0x3d'));return _0xbf1beb(_0x266899[_0x370c('0x2c')](0x1f4,_0x370c('0x3d')));});},'AbandonInteraction':function(_0x4f1cdc){var _0xb44206=this;return new Promise(function(_0x59ada7,_0x291ec4){if(_0x4f1cdc['channel']&&_0x4f1cdc['interaction']&&_0x4f1cdc['interaction']['id']){try{var _0x54170f=getId(_0x4f1cdc[_0x370c('0xf')],_0x4f1cdc[_0x370c('0x10')]?_0x4f1cdc[_0x370c('0x10')]['id']:0x0,_0x4f1cdc['interaction']?_0x4f1cdc[_0x370c('0x11')]['id']:0x0);if(_0x4d1fde['rules'][_0x54170f]){_0x4d1fde[_0x370c('0xe')][_0x54170f][_0x370c('0x31')]('end');}return _0x59ada7({'code':0xc8,'message':_0x4f1cdc});}catch(_0x487c26){logger[_0x370c('0x2c')](_0x487c26[_0x370c('0x34')]);return _0x291ec4(_0xb44206[_0x370c('0x2c')](0x1f4,_0x487c26));}}logger[_0x370c('0x2c')](_0x370c('0x3d'));return _0x291ec4(_0xb44206[_0x370c('0x2c')](0x1f4,_0x370c('0x3d')));});},'AgentCapacity':function(_0x405a99){var _0x31dd18=this;return new Promise(function(_0x6ff15d,_0x5a3bda){if(_0x4d1fde[_0x370c('0x37')][_0x370c('0x3f')](_0x405a99['id'])){for(var _0x195946 in _0x405a99[_0x370c('0x40')]){if(_0x405a99['capacity'][_0x370c('0x3f')](_0x195946)){if(_0x4d1fde[_0x370c('0x37')][_0x405a99['id']][_0x370c('0x3f')](_0x195946+_0x370c('0x41'))){_0x4d1fde['agents'][_0x405a99['id']][_0x195946+'CurrentCapacity']=parseInt(_0x405a99['capacity'][_0x195946],0xa);}}}_0x4d1fde[_0x370c('0x37')][_0x405a99['id']][_0x370c('0x42')]();return _0x6ff15d({'code':0xc8,'message':_0x4d1fde['agents'][_0x405a99['id']]});}else{return _0x5a3bda(_0x31dd18[_0x370c('0x2c')](0x1f4,_0x370c('0x43')));}});},'Agents':function(_0x11e016){return new Promise(function(_0xf91de4,_0x4f4229){var _0x520455=_[_0x370c('0x44')](_0x4d1fde['agents']);_0xf91de4({'count':_0x520455['length'],'rows':_0x520455});});},'ChatQueues':function(_0x6a6176){return new Promise(function(_0x586b07,_0x43c1e6){var _0x59ba5d=[];for(var _0xcd30df in _0x4d1fde['chatQueues']){if(_0x4d1fde[_0x370c('0x45')]['hasOwnProperty'](_0xcd30df)){var _0x1b634f=_0x4d1fde[_0x370c('0x45')][_0xcd30df];var _0x648f9e={'id':_0x1b634f['id'],'available':_0x1b634f['available'],'loggedIn':_0x1b634f[_0x370c('0x46')],'name':_0x1b634f[_0x370c('0x47')],'paused':_0x1b634f[_0x370c('0x48')],'waiting':_0x1b634f['waiting']};_0x59ba5d[_0x370c('0x1c')](_0x648f9e);}}_0x586b07({'count':_0x59ba5d[_0x370c('0x14')],'rows':_0x59ba5d});});},'MailQueues':function(_0x3c5947){return new Promise(function(_0x37829c,_0x411a0f){var _0x50901a=[];for(var _0x112416 in _0x4d1fde['mailQueues']){if(_0x4d1fde['mailQueues']['hasOwnProperty'](_0x112416)){var _0x18a748=_0x4d1fde['mailQueues'][_0x112416];var _0x2d0c12={'id':_0x18a748['id'],'available':_0x18a748['available'],'loggedIn':_0x18a748['loggedIn'],'name':_0x18a748[_0x370c('0x47')],'paused':_0x18a748['paused'],'waiting':_0x18a748[_0x370c('0x49')]};_0x50901a[_0x370c('0x1c')](_0x2d0c12);}}_0x37829c({'count':_0x50901a[_0x370c('0x14')],'rows':_0x50901a});});},'OpenchannelQueues':function(_0x44a53c){return new Promise(function(_0x22a0c2,_0x5d86cc){var _0x39ecc7=[];for(var _0x35da71 in _0x4d1fde[_0x370c('0x4a')]){if(_0x4d1fde[_0x370c('0x4a')][_0x370c('0x3f')](_0x35da71)){var _0x4e4644=_0x4d1fde[_0x370c('0x4a')][_0x35da71];var _0x2b9edb={'id':_0x4e4644['id'],'available':_0x4e4644[_0x370c('0x4b')],'loggedIn':_0x4e4644[_0x370c('0x46')],'name':_0x4e4644[_0x370c('0x47')],'paused':_0x4e4644[_0x370c('0x48')],'waiting':_0x4e4644[_0x370c('0x49')]};_0x39ecc7[_0x370c('0x1c')](_0x2b9edb);}}_0x22a0c2({'count':_0x39ecc7['length'],'rows':_0x39ecc7});});},'SmsQueues':function(_0x16522b){return new Promise(function(_0x5c4916,_0x2a73af){var _0x5aa9e6=[];for(var _0x15fe41 in _0x4d1fde[_0x370c('0x4c')]){if(_0x4d1fde[_0x370c('0x4c')][_0x370c('0x3f')](_0x15fe41)){var _0x3448ff=_0x4d1fde[_0x370c('0x4c')][_0x15fe41];var _0x3b7d86={'id':_0x3448ff['id'],'available':_0x3448ff[_0x370c('0x4b')],'loggedIn':_0x3448ff['loggedIn'],'name':_0x3448ff[_0x370c('0x47')],'paused':_0x3448ff[_0x370c('0x48')],'waiting':_0x3448ff[_0x370c('0x49')]};_0x5aa9e6[_0x370c('0x1c')](_0x3b7d86);}}_0x5c4916({'count':_0x5aa9e6['length'],'rows':_0x5aa9e6});});},'FaxQueues':function(_0x3d312b){return new Promise(function(_0x303ac9,_0x3a66f7){var _0x59986f=[];for(var _0x11a5c8 in _0x4d1fde[_0x370c('0x4d')]){if(_0x4d1fde[_0x370c('0x4d')][_0x370c('0x3f')](_0x11a5c8)){var _0x5a64ca=_0x4d1fde[_0x370c('0x4d')][_0x11a5c8];var _0x320d6d={'id':_0x5a64ca['id'],'available':_0x5a64ca[_0x370c('0x4b')],'loggedIn':_0x5a64ca[_0x370c('0x46')],'name':_0x5a64ca[_0x370c('0x47')],'paused':_0x5a64ca[_0x370c('0x48')],'waiting':_0x5a64ca['waiting']};_0x59986f[_0x370c('0x1c')](_0x320d6d);}}_0x303ac9({'count':_0x59986f[_0x370c('0x14')],'rows':_0x59986f});});},'WhatsappQueues':function(_0x2bd172){return new Promise(function(_0x36da0e,_0x273258){var _0x492d33=[];for(var _0x7a8113 in _0x4d1fde[_0x370c('0x4e')]){if(_0x4d1fde['whatsappQueues']['hasOwnProperty'](_0x7a8113)){var _0xaabf3f=_0x4d1fde[_0x370c('0x4e')][_0x7a8113];var _0x5a183c={'id':_0xaabf3f['id'],'available':_0xaabf3f['available'],'loggedIn':_0xaabf3f[_0x370c('0x46')],'name':_0xaabf3f[_0x370c('0x47')],'paused':_0xaabf3f[_0x370c('0x48')],'waiting':_0xaabf3f['waiting']};_0x492d33[_0x370c('0x1c')](_0x5a183c);}}_0x36da0e({'count':_0x492d33['length'],'rows':_0x492d33});});},'ChatQueuesWaitingInteractions':function(_0x319e88){return new Promise(function(_0x34a867,_0x126800){var _0x3f6f61=_[_0x370c('0x44')](_0x4d1fde['chatQueuesWaitingInteractions']);_0x34a867({'count':_0x3f6f61[_0x370c('0x14')],'rows':_0x3f6f61});});},'MailQueuesWaitingInteractions':function(_0x563f86){return new Promise(function(_0x5ef781,_0x1b6030){var _0x29b75e=_[_0x370c('0x44')](_0x4d1fde['mailQueuesWaitingInteractions']);_0x5ef781({'count':_0x29b75e[_0x370c('0x14')],'rows':_0x29b75e});});},'OpenchannelQueuesWaitingInteractions':function(_0x5694ee){return new Promise(function(_0x1ef255,_0x1e605f){var _0x26eede=_[_0x370c('0x44')](_0x4d1fde[_0x370c('0x4f')]);_0x1ef255({'count':_0x26eede[_0x370c('0x14')],'rows':_0x26eede});});},'SmsQueuesWaitingInteractions':function(_0x40a036){return new Promise(function(_0x307d97,_0x3af2bb){var _0x56b085=_[_0x370c('0x44')](_0x4d1fde['smsQueuesWaitingInteractions']);_0x307d97({'count':_0x56b085[_0x370c('0x14')],'rows':_0x56b085});});},'FaxQueuesWaitingInteractions':function(_0x165d03){return new Promise(function(_0x249a69,_0x3c42d0){var _0x99de9a=_[_0x370c('0x44')](_0x4d1fde[_0x370c('0x50')]);_0x249a69({'count':_0x99de9a[_0x370c('0x14')],'rows':_0x99de9a});});},'WhatsappQueuesWaitingInteractions':function(_0x48a624){return new Promise(function(_0x3587c7,_0x43f0e8){var _0x431483=_[_0x370c('0x44')](_0x4d1fde[_0x370c('0x51')]);_0x3587c7({'count':_0x431483['length'],'rows':_0x431483});});}};var _0x368158=jayson[_0x370c('0x52')](_0x341e16)[_0x370c('0x53')]();_0x368158['on'](_0x370c('0x2c'),function(_0x5b63ce){logger[_0x370c('0x2c')](JSON['stringify'](_0x5b63ce));return _0x334f2d(_0x5b63ce);});_0x368158['listen'](0x232c,_0x370c('0x54'),function(){console[_0x370c('0x55')](_0x370c('0x56'),0x232c);return _0x4c751b('RPC\x20listening\x20on\x20port:'+0x232c);});});}; \ No newline at end of file +var _0x9086=['CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','available','loggedIn','name','waiting','mailQueues','paused','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','util','path','jayson/promise','bluebird','../../../config/environment','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','Intervals','interval','listen','channel','interaction','isArray','applications','length','join','app','.js','autoreply','appdata','mail','push','slice','split','dialogflowv2','amazonlex','tag','TagId','%s:%s:%s','condition','./applications/','consequence','Push\x20new\x20rule','\x20|\x20','error','rules','execute','info','stringify','matchPath','emit','complete','No\x20applications\x20to\x20execute','stack','routing\x20is\x20empty','agent','agents','busyQueue','message','end','QueueReport','update','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','busy','hasOwnProperty','capacity'];(function(_0x473dd0,_0x2994e0){var _0x24fe79=function(_0x789251){while(--_0x789251){_0x473dd0['push'](_0x473dd0['shift']());}};_0x24fe79(++_0x2994e0);}(_0x9086,0x72));var _0x6908=function(_0x2fb87e,_0x483324){_0x2fb87e=_0x2fb87e-0x0;var _0x5de4c1=_0x9086[_0x2fb87e];return _0x5de4c1;};'use strict';var _=require('lodash');var util=require(_0x6908('0x0'));var path=require(_0x6908('0x1'));var fs=require('fs');var jayson=require(_0x6908('0x2'));var BPromise=require(_0x6908('0x3'));var uuid=require('uuid');var config=require(_0x6908('0x4'));var logger=require('../../../config/logger')(_0x6908('0x5'));var rpc={'openchannelQueueReport':require(_0x6908('0x6')),'mailQueueReport':require(_0x6908('0x7')),'chatQueueReport':require(_0x6908('0x8')),'smsQueueReport':require(_0x6908('0x9')),'faxQueueReport':require(_0x6908('0xa')),'whatsappQueueReport':require(_0x6908('0xb'))};var RuleEngine=require(_0x6908('0xc'));function getId(_0x39f77d,_0x3165b8,_0x5e9651){return util[_0x6908('0xd')](_0x6908('0xe'),_0x39f77d,_0x3165b8||0x0,_0x5e9651||0x0);}function getIntervals(_0x418ea8,_0x38fe11){var _0x38be1a=[];if(!_[_0x6908('0xf')](_0x38fe11[_0x6908('0x10')])&&!_['isNil'](_0x418ea8[_0x38fe11[_0x6908('0x10')]])&&!_['isNil'](_0x418ea8[_0x38fe11[_0x6908('0x10')]][_0x6908('0x11')])){_0x38be1a=_['map'](_0x418ea8[_0x38fe11[_0x6908('0x10')]][_0x6908('0x11')],'interval');}else if(!_[_0x6908('0xf')](_0x38fe11['interval'])){_0x38be1a=[_0x38fe11[_0x6908('0x12')]];}return _0x38be1a;}exports[_0x6908('0x13')]=function(_0x55b1ef){_0x55b1ef['rules']={};return new BPromise(function(_0x5c3c0d,_0x3889bf){var _0x165cc8={'Start':function(_0x402596){var _0x38ee58=this;return new Promise(function(_0x45322c,_0x13d243){if(_0x402596){try{var _0x155cda=[];var _0x383dea=getId(_0x402596[_0x6908('0x14')],_0x402596['message']?_0x402596['message']['id']:0x0,_0x402596[_0x6908('0x15')]?_0x402596[_0x6908('0x15')]['id']:0x0);if(_0x402596['applications']&&_[_0x6908('0x16')](_0x402596[_0x6908('0x17')])&&_0x402596[_0x6908('0x17')][_0x6908('0x18')]){for(var _0x540b75=0x0;_0x540b75<_0x402596[_0x6908('0x17')][_0x6908('0x18')];_0x540b75+=0x1){var _0x2b4e7e=_0x402596[_0x6908('0x17')][_0x540b75];if(fs['existsSync'](path[_0x6908('0x19')](__dirname,_0x6908('0x17'),_0x2b4e7e[_0x6908('0x1a')]+_0x6908('0x1b')))){var _0x465c8b=[];switch(_0x2b4e7e['app']['toLowerCase']()){case _0x6908('0x1c'):var _0x11e256=_0x2b4e7e[_0x6908('0x1d')]['split'](',');if(_0x402596[_0x6908('0x14')]===_0x6908('0x1e')){_0x465c8b[_0x6908('0x1f')](_0x11e256[0x0]);_0x465c8b['push'](_0x11e256[0x1]);_0x465c8b[_0x6908('0x1f')](_0x11e256['slice'](0x2,_0x11e256['length'])['join'](','));}else{_0x465c8b[_0x6908('0x1f')](_0x11e256[0x0]);_0x465c8b['push'](_0x11e256[_0x6908('0x20')](0x1,_0x11e256[_0x6908('0x18')])[_0x6908('0x19')](','));}break;case'dialogflow':var _0x59d4e5=_0x2b4e7e[_0x6908('0x1d')][_0x6908('0x21')](',');_0x465c8b[_0x6908('0x1f')](_0x59d4e5[0x0]);_0x465c8b[_0x6908('0x1f')](_0x59d4e5[0x1]);_0x465c8b[_0x6908('0x1f')](_0x59d4e5[_0x6908('0x20')](0x2,_0x59d4e5[_0x6908('0x18')])['join'](','));break;case _0x6908('0x22'):var _0x2d0b3d=_0x2b4e7e[_0x6908('0x1d')][_0x6908('0x21')](',');_0x465c8b[_0x6908('0x1f')](_0x2d0b3d[0x0]);_0x465c8b[_0x6908('0x1f')](_0x2d0b3d[0x1]);_0x465c8b[_0x6908('0x1f')](_0x2d0b3d[0x2]);_0x465c8b[_0x6908('0x1f')](_0x2d0b3d[0x3]);_0x465c8b[_0x6908('0x1f')](_0x2d0b3d[_0x6908('0x20')](0x4,_0x2d0b3d[_0x6908('0x18')])['join'](','));break;case _0x6908('0x23'):var _0x4296d4=_0x2b4e7e['appdata'][_0x6908('0x21')](',');_0x465c8b[_0x6908('0x1f')](_0x4296d4[0x0]);_0x465c8b['push'](_0x4296d4[0x1]);_0x465c8b['push'](_0x4296d4[0x2]);_0x465c8b[_0x6908('0x1f')](_0x4296d4[0x3]);_0x465c8b[_0x6908('0x1f')](_0x4296d4[_0x6908('0x20')](0x4,_0x4296d4[_0x6908('0x18')])[_0x6908('0x19')](','));break;case'message':_0x465c8b['push'](_0x2b4e7e['appdata']);break;case _0x6908('0x24'):_0x465c8b[_0x6908('0x1f')](_0x2b4e7e[_0x6908('0x25')]);_0x465c8b['push'](_0x2b4e7e[_0x6908('0x1d')]);break;default:_0x465c8b=_[_0x6908('0xf')](_0x2b4e7e[_0x6908('0x1d')])?[]:_0x2b4e7e['appdata'][_0x6908('0x21')](',');}var _0x2affd5={'id':util[_0x6908('0xd')](_0x6908('0x26'),_0x383dea,_0x2b4e7e['id'],_0x2b4e7e[_0x6908('0x1a')]),'condition':require('./interval')[_0x6908('0x27')](_0x383dea,getIntervals(_0x55b1ef['intervals'],_0x2b4e7e),_0x55b1ef),'consequence':require(_0x6908('0x28')+_0x2b4e7e[_0x6908('0x1a')])[_0x6908('0x29')](_0x383dea,_0x465c8b,_0x55b1ef,_0x402596),'p':_0x2b4e7e['priority']||0x0};logger['info'](_0x6908('0x2a'),_0x2affd5['id'],'on\x20interval',getIntervals(_0x55b1ef['intervals'],_0x2b4e7e)[_0x6908('0x19')](_0x6908('0x2b')));_0x155cda['push'](_0x2affd5);}else{logger[_0x6908('0x2c')]('Please\x20create\x20a\x20new\x20file\x20under',path['join'](__dirname,_0x6908('0x17'),_0x2b4e7e[_0x6908('0x1a')]+_0x6908('0x1b')));}}_0x55b1ef[_0x6908('0x2d')][_0x383dea]=new RuleEngine(_0x155cda);_0x55b1ef[_0x6908('0x2d')][_0x383dea][_0x6908('0x2e')](_0x402596,function(_0x5b924f){logger[_0x6908('0x2f')]('Applications\x20executed',JSON[_0x6908('0x30')](_0x5b924f[_0x6908('0x31')]));if(_0x55b1ef['rules'][_0x383dea]){_0x55b1ef['rules'][_0x383dea][_0x6908('0x32')](_0x6908('0x33'));}});return _0x45322c({'code':0xc8,'message':_0x402596});}else{logger[_0x6908('0x2f')](_0x6908('0x34'));return _0x45322c({'code':0xc8,'message':_0x402596});}}catch(_0x488a13){logger[_0x6908('0x2c')](_0x488a13[_0x6908('0x35')]);return _0x13d243(_0x38ee58['error'](0x1f4,_0x488a13));}}return _0x13d243(_0x6908('0x36'));});},'AcceptMessage':function(_0x506770){var _0x15dda2=this;return new Promise(function(_0x1c74d6,_0x1829b9){if(_0x506770[_0x6908('0x37')]&&_0x506770[_0x6908('0x37')]['id']){if(_0x55b1ef['agents'][_0x506770['agent']['id']]){_0x55b1ef['agents'][_0x506770[_0x6908('0x37')]['id']]['busy']=![];_0x55b1ef[_0x6908('0x38')][_0x506770['agent']['id']][_0x6908('0x39')]=undefined;}}if(_0x506770[_0x6908('0x3a')]&&_0x506770[_0x6908('0x3a')]['id']){try{var _0x52cdd0=getId(_0x506770['channel'],_0x506770[_0x6908('0x3a')]?_0x506770[_0x6908('0x3a')]['id']:0x0,_0x506770[_0x6908('0x15')]?_0x506770[_0x6908('0x15')]['id']:0x0);if(_0x55b1ef['rules'][_0x52cdd0]){_0x55b1ef[_0x6908('0x2d')][_0x52cdd0][_0x6908('0x32')](_0x6908('0x3b'));if(rpc[_0x506770[_0x6908('0x14')]+_0x6908('0x3c')]){rpc[_0x506770['channel']+_0x6908('0x3c')][_0x6908('0x3d')](_0x52cdd0,{'UserId':_0x506770[_0x6908('0x3a')]['UserId']})[_0x6908('0x3e')](function(_0x473b88){logger[_0x6908('0x2c')](_0x6908('0x3f'));});}}return _0x1c74d6({'code':0xc8,'message':_0x506770});}catch(_0x100e82){logger[_0x6908('0x2c')](_0x100e82[_0x6908('0x35')]);return _0x1829b9(_0x15dda2[_0x6908('0x2c')](0x1f4,_0x100e82));}}logger[_0x6908('0x2c')](_0x6908('0x40'));return _0x1829b9(_0x15dda2[_0x6908('0x2c')](0x1f4,_0x6908('0x40')));});},'RejectMessage':function(_0x4a9a80){var _0x7e8584=this;return new Promise(function(_0x203a97,_0x5628ed){if(_0x4a9a80[_0x6908('0x37')]&&_0x4a9a80[_0x6908('0x37')]['id']){try{if(_0x55b1ef[_0x6908('0x38')][_0x4a9a80[_0x6908('0x37')]['id']]){_0x55b1ef[_0x6908('0x38')][_0x4a9a80['agent']['id']][_0x6908('0x41')]=![];_0x55b1ef[_0x6908('0x38')][_0x4a9a80[_0x6908('0x37')]['id']][_0x6908('0x39')]=undefined;}return _0x203a97({'code':0xc8,'message':_0x4a9a80});}catch(_0x5eaef2){logger['error'](_0x5eaef2['stack']);return _0x5628ed(_0x7e8584[_0x6908('0x2c')](0x1f4,_0x5eaef2));}}logger[_0x6908('0x2c')](_0x6908('0x40'));return _0x5628ed(_0x7e8584['error'](0x1f4,_0x6908('0x40')));});},'AbandonInteraction':function(_0x54fc84){var _0x33f7aa=this;return new Promise(function(_0x4953d6,_0x46f9ae){if(_0x54fc84[_0x6908('0x14')]&&_0x54fc84[_0x6908('0x15')]&&_0x54fc84['interaction']['id']){try{var _0x3a0b4c=getId(_0x54fc84['channel'],_0x54fc84['message']?_0x54fc84[_0x6908('0x3a')]['id']:0x0,_0x54fc84[_0x6908('0x15')]?_0x54fc84[_0x6908('0x15')]['id']:0x0);if(_0x55b1ef[_0x6908('0x2d')][_0x3a0b4c]){_0x55b1ef[_0x6908('0x2d')][_0x3a0b4c][_0x6908('0x32')](_0x6908('0x3b'));}return _0x4953d6({'code':0xc8,'message':_0x54fc84});}catch(_0x2a9a23){logger[_0x6908('0x2c')](_0x2a9a23[_0x6908('0x35')]);return _0x46f9ae(_0x33f7aa['error'](0x1f4,_0x2a9a23));}}logger['error'](_0x6908('0x40'));return _0x46f9ae(_0x33f7aa[_0x6908('0x2c')](0x1f4,_0x6908('0x40')));});},'AgentCapacity':function(_0x38ec6d){var _0x4cfbc2=this;return new Promise(function(_0x1ecd76,_0x4a9cd4){if(_0x55b1ef[_0x6908('0x38')][_0x6908('0x42')](_0x38ec6d['id'])){for(var _0x3209bc in _0x38ec6d[_0x6908('0x43')]){if(_0x38ec6d[_0x6908('0x43')][_0x6908('0x42')](_0x3209bc)){if(_0x55b1ef['agents'][_0x38ec6d['id']]['hasOwnProperty'](_0x3209bc+_0x6908('0x44'))){_0x55b1ef['agents'][_0x38ec6d['id']][_0x3209bc+_0x6908('0x44')]=parseInt(_0x38ec6d[_0x6908('0x43')][_0x3209bc],0xa);}}}_0x55b1ef[_0x6908('0x38')][_0x38ec6d['id']][_0x6908('0x45')]();return _0x1ecd76({'code':0xc8,'message':_0x55b1ef[_0x6908('0x38')][_0x38ec6d['id']]});}else{return _0x4a9cd4(_0x4cfbc2[_0x6908('0x2c')](0x1f4,_0x6908('0x46')));}});},'Agents':function(_0x55e151){return new Promise(function(_0x3899e5,_0x6d1825){var _0x3435ab=_[_0x6908('0x47')](_0x55b1ef[_0x6908('0x38')]);_0x3899e5({'count':_0x3435ab[_0x6908('0x18')],'rows':_0x3435ab});});},'ChatQueues':function(_0x40af3f){return new Promise(function(_0x2dd6ff,_0x4043de){var _0x593bea=[];for(var _0x1c6c7d in _0x55b1ef[_0x6908('0x48')]){if(_0x55b1ef[_0x6908('0x48')][_0x6908('0x42')](_0x1c6c7d)){var _0x4406a2=_0x55b1ef[_0x6908('0x48')][_0x1c6c7d];var _0x39be8f={'id':_0x4406a2['id'],'available':_0x4406a2[_0x6908('0x49')],'loggedIn':_0x4406a2[_0x6908('0x4a')],'name':_0x4406a2[_0x6908('0x4b')],'paused':_0x4406a2['paused'],'waiting':_0x4406a2[_0x6908('0x4c')]};_0x593bea[_0x6908('0x1f')](_0x39be8f);}}_0x2dd6ff({'count':_0x593bea[_0x6908('0x18')],'rows':_0x593bea});});},'MailQueues':function(_0x20ec46){return new Promise(function(_0x30de78,_0x545bf9){var _0x1f9a17=[];for(var _0x33bcab in _0x55b1ef['mailQueues']){if(_0x55b1ef[_0x6908('0x4d')]['hasOwnProperty'](_0x33bcab)){var _0xe68346=_0x55b1ef['mailQueues'][_0x33bcab];var _0x48879e={'id':_0xe68346['id'],'available':_0xe68346['available'],'loggedIn':_0xe68346[_0x6908('0x4a')],'name':_0xe68346['name'],'paused':_0xe68346[_0x6908('0x4e')],'waiting':_0xe68346[_0x6908('0x4c')]};_0x1f9a17['push'](_0x48879e);}}_0x30de78({'count':_0x1f9a17[_0x6908('0x18')],'rows':_0x1f9a17});});},'OpenchannelQueues':function(_0x553eb1){return new Promise(function(_0x1eb2f1,_0xd2aeaf){var _0x543194=[];for(var _0x5358de in _0x55b1ef[_0x6908('0x4f')]){if(_0x55b1ef[_0x6908('0x4f')]['hasOwnProperty'](_0x5358de)){var _0x1e6bf7=_0x55b1ef[_0x6908('0x4f')][_0x5358de];var _0x3b6da4={'id':_0x1e6bf7['id'],'available':_0x1e6bf7[_0x6908('0x49')],'loggedIn':_0x1e6bf7[_0x6908('0x4a')],'name':_0x1e6bf7[_0x6908('0x4b')],'paused':_0x1e6bf7[_0x6908('0x4e')],'waiting':_0x1e6bf7[_0x6908('0x4c')]};_0x543194[_0x6908('0x1f')](_0x3b6da4);}}_0x1eb2f1({'count':_0x543194[_0x6908('0x18')],'rows':_0x543194});});},'SmsQueues':function(_0x5e2aa7){return new Promise(function(_0x1c70f8,_0xd30b1d){var _0x27b1b7=[];for(var _0x5debb1 in _0x55b1ef[_0x6908('0x50')]){if(_0x55b1ef[_0x6908('0x50')][_0x6908('0x42')](_0x5debb1)){var _0x21aa29=_0x55b1ef['smsQueues'][_0x5debb1];var _0x35f462={'id':_0x21aa29['id'],'available':_0x21aa29[_0x6908('0x49')],'loggedIn':_0x21aa29[_0x6908('0x4a')],'name':_0x21aa29[_0x6908('0x4b')],'paused':_0x21aa29[_0x6908('0x4e')],'waiting':_0x21aa29[_0x6908('0x4c')]};_0x27b1b7[_0x6908('0x1f')](_0x35f462);}}_0x1c70f8({'count':_0x27b1b7[_0x6908('0x18')],'rows':_0x27b1b7});});},'FaxQueues':function(_0xabaf48){return new Promise(function(_0x45f1a6,_0x155c48){var _0x2ca8ba=[];for(var _0x12ea14 in _0x55b1ef[_0x6908('0x51')]){if(_0x55b1ef['faxQueues'][_0x6908('0x42')](_0x12ea14)){var _0x57ce30=_0x55b1ef[_0x6908('0x51')][_0x12ea14];var _0x486bd9={'id':_0x57ce30['id'],'available':_0x57ce30[_0x6908('0x49')],'loggedIn':_0x57ce30['loggedIn'],'name':_0x57ce30[_0x6908('0x4b')],'paused':_0x57ce30['paused'],'waiting':_0x57ce30[_0x6908('0x4c')]};_0x2ca8ba[_0x6908('0x1f')](_0x486bd9);}}_0x45f1a6({'count':_0x2ca8ba['length'],'rows':_0x2ca8ba});});},'WhatsappQueues':function(_0x386426){return new Promise(function(_0x367411,_0x5ea5b1){var _0x4db5e3=[];for(var _0xa4aea4 in _0x55b1ef[_0x6908('0x52')]){if(_0x55b1ef[_0x6908('0x52')][_0x6908('0x42')](_0xa4aea4)){var _0x1cdcdf=_0x55b1ef[_0x6908('0x52')][_0xa4aea4];var _0x1ef43d={'id':_0x1cdcdf['id'],'available':_0x1cdcdf[_0x6908('0x49')],'loggedIn':_0x1cdcdf[_0x6908('0x4a')],'name':_0x1cdcdf[_0x6908('0x4b')],'paused':_0x1cdcdf['paused'],'waiting':_0x1cdcdf[_0x6908('0x4c')]};_0x4db5e3[_0x6908('0x1f')](_0x1ef43d);}}_0x367411({'count':_0x4db5e3[_0x6908('0x18')],'rows':_0x4db5e3});});},'ChatQueuesWaitingInteractions':function(_0x10db31){return new Promise(function(_0x26b964,_0x1c1b9c){var _0x3f5860=_[_0x6908('0x47')](_0x55b1ef[_0x6908('0x53')]);_0x26b964({'count':_0x3f5860[_0x6908('0x18')],'rows':_0x3f5860});});},'MailQueuesWaitingInteractions':function(_0x1fb02e){return new Promise(function(_0x1cbf00,_0x1daa20){var _0x9a2a79=_[_0x6908('0x47')](_0x55b1ef['mailQueuesWaitingInteractions']);_0x1cbf00({'count':_0x9a2a79[_0x6908('0x18')],'rows':_0x9a2a79});});},'OpenchannelQueuesWaitingInteractions':function(_0x20ce87){return new Promise(function(_0x4f1ada,_0x4214cc){var _0x4a0b11=_[_0x6908('0x47')](_0x55b1ef['openchannelQueuesWaitingInteractions']);_0x4f1ada({'count':_0x4a0b11[_0x6908('0x18')],'rows':_0x4a0b11});});},'SmsQueuesWaitingInteractions':function(_0x2e722b){return new Promise(function(_0x352a53,_0x581f5a){var _0x5864af=_[_0x6908('0x47')](_0x55b1ef[_0x6908('0x54')]);_0x352a53({'count':_0x5864af[_0x6908('0x18')],'rows':_0x5864af});});},'FaxQueuesWaitingInteractions':function(_0x1b39d5){return new Promise(function(_0x25c59b,_0x2f0e5c){var _0x1b4152=_['values'](_0x55b1ef[_0x6908('0x55')]);_0x25c59b({'count':_0x1b4152[_0x6908('0x18')],'rows':_0x1b4152});});},'WhatsappQueuesWaitingInteractions':function(_0x5f15ab){return new Promise(function(_0x3a10c0,_0x3c4812){var _0x1b4299=_[_0x6908('0x47')](_0x55b1ef[_0x6908('0x56')]);_0x3a10c0({'count':_0x1b4299[_0x6908('0x18')],'rows':_0x1b4299});});}};var _0xfbe1f0=jayson[_0x6908('0x57')](_0x165cc8)['http']();_0xfbe1f0['on'](_0x6908('0x2c'),function(_0x150f97){logger['error'](JSON[_0x6908('0x30')](_0x150f97));return _0x3889bf(_0x150f97);});_0xfbe1f0['listen'](0x232c,_0x6908('0x58'),function(){console[_0x6908('0x59')](_0x6908('0x5a'),0x232c);return _0x5c3c0d('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 cf26a98..c1115c8 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 _0x6910=['jayson/promise','lodash','../../../config/logger','client','request','then','error','message','catch','condition','rules','stop','length','Command','iftime\x20%s','indexOf','true','all','info','join','\x20|\x20','when','[%s][INTERVAL]\x20%s\x20%s','stack','util','bluebird'];(function(_0x5b0996,_0x598f12){var _0x1d99e7=function(_0x3651b5){while(--_0x3651b5){_0x5b0996['push'](_0x5b0996['shift']());}};_0x1d99e7(++_0x598f12);}(_0x6910,0xb4));var _0x0691=function(_0x1717a0,_0x3df0e9){_0x1717a0=_0x1717a0-0x0;var _0x4065f3=_0x6910[_0x1717a0];return _0x4065f3;};'use strict';var util=require(_0x0691('0x0'));var BPromise=require(_0x0691('0x1'));var jayson=require(_0x0691('0x2'));var _=require(_0x0691('0x3'));var logger=require(_0x0691('0x4'))('routing');var client=jayson[_0x0691('0x5')]['http']({'port':0x232a});function request(_0xaea83e,_0x42ff23){return new BPromise(function(_0x133d90,_0x3a129f){return client[_0x0691('0x6')](_0xaea83e,_0x42ff23)[_0x0691('0x7')](function(_0x39840c){if(_0x39840c['error']){return _0x3a129f(_0x39840c[_0x0691('0x8')][_0x0691('0x9')]);}else{return _0x133d90(_0x39840c['result']);}})[_0x0691('0xa')](function(_0x24e0d8){return _0x3a129f(_0x24e0d8);});});}exports[_0x0691('0xb')]=function(_0x440172,_0x230ec8,_0x37d7da){return function(_0x42934c){if(_0x37d7da['rules']&&!_0x37d7da[_0x0691('0xc')][_0x440172]){logger['info']('[%s][INTERVAL]\x20ROUTING\x20STOPPED',_0x440172);return _0x42934c[_0x0691('0xd')]();}var _0x2712ee=[];for(var _0x3a9e16=0x0;_0x3a9e16<_0x230ec8[_0x0691('0xe')];_0x3a9e16+=0x1){_0x2712ee['push'](request(_0x0691('0xf'),{'command':util['format'](_0x0691('0x10'),_0x230ec8[_0x3a9e16])})[_0x0691('0x7')](function(_0x34c91d){return _0x34c91d&&_0x34c91d[_0x0691('0x9')]&&_0x34c91d['message'][_0x0691('0x11')](_0x0691('0x12'))>=0x0?!![]:![];})['catch'](function(_0x59f885){logger[_0x0691('0x8')]('[%s][INTERVAL]\x20%s',_0x440172,_0x230ec8[_0x3a9e16]);}));}BPromise[_0x0691('0x13')](_0x2712ee)[_0x0691('0x7')](function(_0x166e24){var _0x51f378=_['some'](_0x166e24);logger[_0x0691('0x14')]('[%s][INTERVAL]\x20%s\x20%s',_0x440172,_0x230ec8[_0x0691('0x15')](_0x0691('0x16')),_0x51f378);_0x42934c[_0x0691('0x17')](_0x51f378);})[_0x0691('0xa')](function(_0x2f166c){console['log'](_0x2f166c);logger[_0x0691('0x8')](_0x0691('0x18'),_0x440172,_0x230ec8[_0x0691('0x15')]('\x20|\x20'),_0x2f166c[_0x0691('0x19')]);_0x42934c[_0x0691('0xd')]();});};}; \ No newline at end of file +var _0x1707=['lodash','../../../config/logger','routing','client','http','request','error','message','result','catch','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','length','Command','format','iftime\x20%s','then','indexOf','true','[%s][INTERVAL]\x20%s','all','some','[%s][INTERVAL]\x20%s\x20%s','\x20|\x20','when','log','stack','stop','bluebird','jayson/promise'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0x1707,0x1be));var _0x7170=function(_0x528a67,_0x2fcf70){_0x528a67=_0x528a67-0x0;var _0x3c1fdc=_0x1707[_0x528a67];return _0x3c1fdc;};'use strict';var util=require('util');var BPromise=require(_0x7170('0x0'));var jayson=require(_0x7170('0x1'));var _=require(_0x7170('0x2'));var logger=require(_0x7170('0x3'))(_0x7170('0x4'));var client=jayson[_0x7170('0x5')][_0x7170('0x6')]({'port':0x232a});function request(_0x363711,_0x1f648e){return new BPromise(function(_0x1c6d18,_0x578157){return client[_0x7170('0x7')](_0x363711,_0x1f648e)['then'](function(_0x350e88){if(_0x350e88[_0x7170('0x8')]){return _0x578157(_0x350e88[_0x7170('0x8')][_0x7170('0x9')]);}else{return _0x1c6d18(_0x350e88[_0x7170('0xa')]);}})[_0x7170('0xb')](function(_0x40c54e){return _0x578157(_0x40c54e);});});}exports[_0x7170('0xc')]=function(_0x32d387,_0x3a9004,_0x555a95){return function(_0xade886){if(_0x555a95[_0x7170('0xd')]&&!_0x555a95[_0x7170('0xd')][_0x32d387]){logger[_0x7170('0xe')](_0x7170('0xf'),_0x32d387);return _0xade886['stop']();}var _0x5f73fa=[];for(var _0x2f14ab=0x0;_0x2f14ab<_0x3a9004[_0x7170('0x10')];_0x2f14ab+=0x1){_0x5f73fa['push'](request(_0x7170('0x11'),{'command':util[_0x7170('0x12')](_0x7170('0x13'),_0x3a9004[_0x2f14ab])})[_0x7170('0x14')](function(_0x1ddda6){return _0x1ddda6&&_0x1ddda6[_0x7170('0x9')]&&_0x1ddda6[_0x7170('0x9')][_0x7170('0x15')](_0x7170('0x16'))>=0x0?!![]:![];})[_0x7170('0xb')](function(_0x2f18c6){logger['error'](_0x7170('0x17'),_0x32d387,_0x3a9004[_0x2f14ab]);}));}BPromise[_0x7170('0x18')](_0x5f73fa)['then'](function(_0x388909){var _0x2b6cc2=_[_0x7170('0x19')](_0x388909);logger['info'](_0x7170('0x1a'),_0x32d387,_0x3a9004['join'](_0x7170('0x1b')),_0x2b6cc2);_0xade886[_0x7170('0x1c')](_0x2b6cc2);})['catch'](function(_0x3958e3){console[_0x7170('0x1d')](_0x3958e3);logger['error'](_0x7170('0x1a'),_0x32d387,_0x3a9004['join'](_0x7170('0x1b')),_0x3958e3[_0x7170('0x1e')]);_0xade886[_0x7170('0x1f')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index 87304b3..05b01c4 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 _0x9354=['agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','timeout','reason','holdtime','ringtime','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','talktime','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connect','answered_elsewhere','answeredelsewheremembername','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','complete','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfertype','blind','transferexten','transferuniqueid','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','[%s][agents][attendedtransfer]\x20agent:%s','secondtransfereruniqueid','ATTENDED','origtransfererexten','transfereeuniqueid','clone','calleridname','secondtransfererlinkedid','secondtransfererexten','transfertargetuniqueid','agententerreason','hangup','[%s][agents][hangup]','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','agent','transfer','util','./utils','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','getVoiceQueueByName','then','type','agentacw','agentcomplete','acw','acwtime','request','CreateVoiceAgentReport','uniqueid','destuniqueid','agentcalled','debug','[%s][agents][agentcalled]','agentcalledAt','now','called','connectedlinename','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error'];(function(_0x239a9e,_0x5cf3f4){var _0x2a7085=function(_0x232216){while(--_0x232216){_0x239a9e['push'](_0x239a9e['shift']());}};_0x2a7085(++_0x5cf3f4);}(_0x9354,0x96));var _0x4935=function(_0x347471,_0x1c9a02){_0x347471=_0x347471-0x0;var _0x422b6a=_0x9354[_0x347471];return _0x422b6a;};'use strict';var _=require('lodash');var util=require(_0x4935('0x0'));var utils=require(_0x4935('0x1'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x4896da,_0x263dd5){utils[_0x4935('0x2')](util[_0x4935('0x3')](_0x4935('0x4'),_0x4896da['uniqueid'],_0x4896da[_0x4935('0x5')],_0x4896da[_0x4935('0x6')],_0x4896da[_0x4935('0x7')],_0x4896da[_0x4935('0x8')],_0x4896da[_0x4935('0x9')],_0x4896da[_0x4935('0xa')],_0x4896da[_0x4935('0xb')]));if(_0x4896da[_0x4935('0x6')]){utils[_0x4935('0xc')](_0x4896da['queue'])[_0x4935('0xd')](function(_0x47a44f){if(_0x47a44f){_0x4896da[_0x4935('0xe')]=_0x47a44f[_0x4935('0xe')];_0x4896da[_0x4935('0xf')]=_0x4896da[_0x4935('0x10')]?_0x47a44f[_0x4935('0x11')]:![];_0x4896da[_0x4935('0x12')]=_0x4896da['agentacw']?_0x47a44f['acwTimeout']:0x0;}utils[_0x4935('0x13')]('CreateVoiceAgentReport',_0x4896da);});}else{utils['request'](_0x4935('0x14'),_0x4896da);}if(_0x263dd5){delete transfers[_0x4896da[_0x4935('0x15')]];}else{delete agents[_0x4896da[_0x4935('0x16')]];}}exports[_0x4935('0x17')]=function(_0x3b246a){try{utils[_0x4935('0x18')](util[_0x4935('0x3')](_0x4935('0x19'),_0x3b246a[_0x4935('0x15')]),_0x3b246a);agents[_0x3b246a[_0x4935('0x16')]]=_0x3b246a;agents[_0x3b246a[_0x4935('0x16')]][_0x4935('0x1a')]=utils[_0x4935('0x1b')]();agents[_0x3b246a[_0x4935('0x16')]][_0x4935('0xb')]=_0x4935('0x1c');agents[_0x3b246a['destuniqueid']][_0x4935('0xa')]=null;agents[_0x3b246a[_0x4935('0x16')]][_0x4935('0x1d')]=null;utils[_0x4935('0x2')](util[_0x4935('0x3')](_0x4935('0x1e'),_0x3b246a['uniqueid'],agents[_0x3b246a[_0x4935('0x16')]][_0x4935('0x7')],_0x3b246a['destuniqueid']));}catch(_0x288eff){utils[_0x4935('0x1f')](util[_0x4935('0x3')]('[%s][agents][agentcalled]',_0x3b246a['uniqueid']),_0x288eff);}};exports[_0x4935('0x20')]=function(_0x6b849f){try{if(!_[_0x4935('0x21')](agents[_0x6b849f[_0x4935('0x16')]])){utils[_0x4935('0x18')](util[_0x4935('0x3')](_0x4935('0x22'),_0x6b849f[_0x4935('0x15')]),_0x6b849f);utils['info'](util[_0x4935('0x3')](_0x4935('0x23'),_0x6b849f[_0x4935('0x15')],agents[_0x6b849f[_0x4935('0x16')]][_0x4935('0x7')],_0x6b849f['destuniqueid']));agents[_0x6b849f['destuniqueid']][_0x4935('0x20')]=!![];agents[_0x6b849f[_0x4935('0x16')]][_0x4935('0x24')]=utils[_0x4935('0x1b')]();agents[_0x6b849f[_0x4935('0x16')]][_0x4935('0xb')]=_0x4935('0x25');agents[_0x6b849f[_0x4935('0x16')]][_0x4935('0x26')]=_0x4935('0x25');agents[_0x6b849f[_0x4935('0x16')]][_0x4935('0x27')]=_0x6b849f[_0x4935('0x28')]?parseInt(_0x6b849f[_0x4935('0x28')])/0x3e8:0x0;agents[_0x6b849f[_0x4935('0x16')]]['talktime']=0x0;unanswered['push'](_0x6b849f['destuniqueid']);}}catch(_0x1fc218){utils[_0x4935('0x1f')](util['format'](_0x4935('0x22'),_0x6b849f[_0x4935('0x15')]),_0x1fc218);}};exports[_0x4935('0x29')]=function(_0x9fe9f6){try{_[_0x4935('0x2a')](agents,function(_0x24262e,_0x28afc2){if(_0x24262e[_0x4935('0x15')]==_0x9fe9f6['uniqueid']&&!_[_0x4935('0x2b')](unanswered,_0x24262e[_0x4935('0x16')])){utils['debug'](util['format'](_0x4935('0x2c'),_0x9fe9f6['uniqueid']),_0x9fe9f6);utils[_0x4935('0x2')](util[_0x4935('0x3')](_0x4935('0x2d'),_0x9fe9f6['uniqueid'],_0x24262e['membername'],_0x24262e[_0x4935('0x16')]));_0x24262e[_0x4935('0x20')]=!![];_0x24262e['agentringnoanswerAt']=utils[_0x4935('0x1b')]();_0x24262e[_0x4935('0xb')]=_0x4935('0x2e');_0x24262e[_0x4935('0x26')]=_0x4935('0x2e');_0x24262e['holdtime']=_0x9fe9f6['holdtime'];_0x24262e[_0x4935('0x2f')]=0x0;writeDB(_0x24262e);}});}catch(_0x1016cc){utils['error'](util['format'](_0x4935('0x2c'),_0x9fe9f6['uniqueid']),_0x1016cc);}};exports[_0x4935('0x30')]=function(_0x3f32fb){try{if(agents[_0x3f32fb[_0x4935('0x16')]]){utils[_0x4935('0x18')](util[_0x4935('0x3')](_0x4935('0x31'),_0x3f32fb['uniqueid']),_0x3f32fb);utils[_0x4935('0x2')](util['format'](_0x4935('0x32'),_0x3f32fb['uniqueid'],agents[_0x3f32fb[_0x4935('0x16')]]['membername'],_0x3f32fb[_0x4935('0x16')]));agents[_0x3f32fb[_0x4935('0x16')]][_0x4935('0x33')]=utils[_0x4935('0x1b')]();agents[_0x3f32fb[_0x4935('0x16')]][_0x4935('0xa')]=_0x3f32fb[_0x4935('0xa')];agents[_0x3f32fb['destuniqueid']]['connectedlinename']=_0x3f32fb[_0x4935('0x1d')];agents[_0x3f32fb['destuniqueid']]['holdtime']=_0x3f32fb[_0x4935('0x28')];agents[_0x3f32fb['destuniqueid']][_0x4935('0xb')]=_0x4935('0x34');_[_0x4935('0x2a')](agents,function(_0x99b7c5,_0xb366e6){if(_0x99b7c5['destuniqueid']!=_0x3f32fb['destuniqueid']&&_0x99b7c5[_0x4935('0x15')]==_0x3f32fb[_0x4935('0x15')]){_0x99b7c5[_0x4935('0x2f')]=0x0;_0x99b7c5[_0x4935('0x27')]=_0x3f32fb[_0x4935('0x28')];_0x99b7c5[_0x4935('0x20')]=!![];_0x99b7c5[_0x4935('0x24')]=utils[_0x4935('0x1b')]();_0x99b7c5['lastevent']='answered_elsewhere';_0x99b7c5[_0x4935('0x26')]=_0x4935('0x35');_0x99b7c5['answeredelsewheredestinationuniqueid']=_0x3f32fb[_0x4935('0x16')];_0x99b7c5[_0x4935('0x36')]=_0x3f32fb[_0x4935('0x7')];writeDB(_0x99b7c5);}});}}catch(_0xe5c9f5){utils['error'](util['format'](_0x4935('0x31'),_0x3f32fb[_0x4935('0x15')]),_0xe5c9f5);}};exports['agentcomplete']=function(_0x1eaa47){try{if(!_[_0x4935('0x21')](agents[_0x1eaa47[_0x4935('0x16')]])){utils['debug'](util[_0x4935('0x3')](_0x4935('0x37'),_0x1eaa47[_0x4935('0x15')]),_0x1eaa47);utils[_0x4935('0x2')](util[_0x4935('0x3')](_0x4935('0x38'),_0x1eaa47[_0x4935('0x15')],agents[_0x1eaa47[_0x4935('0x16')]][_0x4935('0x7')],_0x1eaa47[_0x4935('0x16')]));agents[_0x1eaa47[_0x4935('0x16')]][_0x4935('0x10')]=!![];agents[_0x1eaa47[_0x4935('0x16')]][_0x4935('0x39')]=utils[_0x4935('0x1b')]();agents[_0x1eaa47[_0x4935('0x16')]][_0x4935('0x2f')]=utils[_0x4935('0x3a')](agents[_0x1eaa47['destuniqueid']][_0x4935('0x39')],agents[_0x1eaa47['destuniqueid']][_0x4935('0x33')]);agents[_0x1eaa47[_0x4935('0x16')]][_0x4935('0x26')]=_0x1eaa47[_0x4935('0x26')];agents[_0x1eaa47['destuniqueid']][_0x4935('0xb')]=_0x4935('0x3b');writeDB(agents[_0x1eaa47[_0x4935('0x16')]]);}}catch(_0xa55ce1){utils[_0x4935('0x1f')](util[_0x4935('0x3')](_0x4935('0x37'),_0x1eaa47[_0x4935('0x15')]),_0xa55ce1);}};exports[_0x4935('0x3c')]=function(_0x392cba){try{if(!_['isNil'](agents[_0x392cba[_0x4935('0x3d')]])){utils[_0x4935('0x18')](util['format'](_0x4935('0x3e'),_0x392cba[_0x4935('0x15')]),_0x392cba);utils[_0x4935('0x2')](util[_0x4935('0x3')](_0x4935('0x3f'),_0x392cba[_0x4935('0x15')],agents[_0x392cba[_0x4935('0x3d')]][_0x4935('0x7')],agents[_0x392cba['transfereruniqueid']][_0x4935('0x15')]));agents[_0x392cba['transfereruniqueid']]['transfer']=!![];agents[_0x392cba[_0x4935('0x3d')]][_0x4935('0x40')]=_0x4935('0x41');agents[_0x392cba[_0x4935('0x3d')]][_0x4935('0x42')]=_0x392cba['extension'];agents[_0x392cba[_0x4935('0x3d')]][_0x4935('0x43')]=agents[_0x392cba[_0x4935('0x3d')]][_0x4935('0x15')];}}catch(_0x377ff4){utils[_0x4935('0x1f')](util[_0x4935('0x3')](_0x4935('0x3e'),_0x392cba[_0x4935('0x15')]),_0x377ff4);}};exports[_0x4935('0x44')]=function(_0x4c1fb4){try{utils[_0x4935('0x18')](util['format'](_0x4935('0x45'),_0x4c1fb4[_0x4935('0x46')]),_0x4c1fb4);if(_0x4c1fb4['origtransfereruniqueid']==_0x4c1fb4[_0x4935('0x47')]){if(!_['isNil'](agents[_0x4c1fb4['secondtransfereruniqueid']])){utils['info'](util[_0x4935('0x3')](_0x4935('0x48'),_0x4c1fb4[_0x4935('0x46')],agents[_0x4c1fb4[_0x4935('0x49')]][_0x4935('0x7')]));agents[_0x4c1fb4['secondtransfereruniqueid']]['transfer']=!![];agents[_0x4c1fb4[_0x4935('0x49')]][_0x4935('0x40')]=_0x4935('0x4a');agents[_0x4c1fb4['secondtransfereruniqueid']][_0x4935('0x42')]=_0x4c1fb4[_0x4935('0x4b')];agents[_0x4c1fb4[_0x4935('0x49')]][_0x4935('0x43')]=_0x4c1fb4['origtransfereruniqueid'];}if(_0x4c1fb4[_0x4935('0x4c')]&&agents[_0x4c1fb4['transfereeuniqueid']]){agents[_0x4c1fb4['transfereeuniqueid']]['agententerreason']=0x1;transfers[_0x4c1fb4[_0x4935('0x4c')]]=_[_0x4935('0x4d')](agents[_0x4c1fb4['transfereeuniqueid']]);transfers[_0x4c1fb4[_0x4935('0x4c')]][_0x4935('0x9')]=agents[_0x4c1fb4['secondtransfereruniqueid']][_0x4935('0x9')];transfers[_0x4c1fb4[_0x4935('0x4c')]][_0x4935('0x4e')]=agents[_0x4c1fb4[_0x4935('0x49')]][_0x4935('0x4e')];transfers[_0x4c1fb4[_0x4935('0x4c')]][_0x4935('0x1a')]=utils['now']();transfers[_0x4c1fb4[_0x4935('0x4c')]]['agentconnectAt']=utils['now']();transfers[_0x4c1fb4[_0x4935('0x4c')]][_0x4935('0x27')]=0x0;transfers[_0x4c1fb4['transfereeuniqueid']]['agententerreason']=0x2;}}else if(_0x4c1fb4[_0x4935('0x49')]==_0x4c1fb4[_0x4935('0x4f')]){if(!_[_0x4935('0x21')](agents[_0x4c1fb4['origtransfereruniqueid']])){utils[_0x4935('0x2')](util['format'](_0x4935('0x48'),_0x4c1fb4[_0x4935('0x46')],agents[_0x4c1fb4[_0x4935('0x46')]][_0x4935('0x7')]));agents[_0x4c1fb4[_0x4935('0x46')]]['transfer']=!![];agents[_0x4c1fb4[_0x4935('0x46')]][_0x4935('0x40')]='ATTENDED';agents[_0x4c1fb4[_0x4935('0x46')]][_0x4935('0x42')]=_0x4c1fb4[_0x4935('0x50')];agents[_0x4c1fb4[_0x4935('0x46')]][_0x4935('0x43')]=_0x4c1fb4[_0x4935('0x49')];}if(_0x4c1fb4[_0x4935('0x51')]&&agents[_0x4c1fb4[_0x4935('0x51')]]){agents[_0x4c1fb4[_0x4935('0x51')]][_0x4935('0x52')]=0x1;transfers[_0x4c1fb4[_0x4935('0x51')]]=_['clone'](agents[_0x4c1fb4[_0x4935('0x51')]]);transfers[_0x4c1fb4[_0x4935('0x51')]][_0x4935('0x9')]=agents[_0x4c1fb4[_0x4935('0x46')]][_0x4935('0x9')];transfers[_0x4c1fb4[_0x4935('0x51')]][_0x4935('0x4e')]=agents[_0x4c1fb4[_0x4935('0x46')]][_0x4935('0x4e')];transfers[_0x4c1fb4[_0x4935('0x51')]][_0x4935('0x1a')]=utils[_0x4935('0x1b')]();transfers[_0x4c1fb4[_0x4935('0x51')]]['agentconnectAt']=utils['now']();transfers[_0x4c1fb4[_0x4935('0x51')]][_0x4935('0x27')]=0x0;transfers[_0x4c1fb4['transfertargetuniqueid']][_0x4935('0x52')]=0x2;}}}catch(_0x30e77f){utils['error'](util['format'](_0x4935('0x45'),_0x4c1fb4[_0x4935('0x46')]),_0x30e77f);}};exports[_0x4935('0x53')]=function(_0x2abd63){try{utils[_0x4935('0x18')](util['format'](_0x4935('0x54'),_0x2abd63[_0x4935('0x15')]),_0x2abd63);if(agents[_0x2abd63[_0x4935('0x15')]]&&agents[_0x2abd63[_0x4935('0x15')]]['reason']===_0x4935('0x25')){if(_0x2abd63['cause']==='21'){agents[_0x2abd63['uniqueid']][_0x4935('0x26')]=_0x4935('0x55');agents[_0x2abd63['uniqueid']][_0x4935('0xb')]=_0x4935('0x55');}utils[_0x4935('0x2')](util['format'](_0x4935('0x56'),_0x2abd63['uniqueid'],agents[_0x2abd63['uniqueid']][_0x4935('0x7')],agents[_0x2abd63[_0x4935('0x15')]][_0x4935('0x26')],agents[_0x2abd63[_0x4935('0x15')]][_0x4935('0xb')]));writeDB(agents[_0x2abd63[_0x4935('0x15')]]);var _0x2eae00=unanswered[_0x4935('0x57')](_0x2abd63['uniqueid']);if(_0x2eae00>-0x1){unanswered[_0x4935('0x58')](_0x2eae00,0x1);}}if(transfers[_0x2abd63[_0x4935('0x15')]]){transfers[_0x2abd63[_0x4935('0x15')]]['agentcomplete']=!![];transfers[_0x2abd63['uniqueid']][_0x4935('0x39')]=utils[_0x4935('0x1b')]();transfers[_0x2abd63['uniqueid']][_0x4935('0x2f')]=utils['diffTime'](transfers[_0x2abd63['uniqueid']][_0x4935('0x39')],transfers[_0x2abd63[_0x4935('0x15')]][_0x4935('0x33')]);transfers[_0x2abd63['uniqueid']]['reason']=_0x4935('0x59');transfers[_0x2abd63['uniqueid']][_0x4935('0xb')]='complete';utils[_0x4935('0x2')](util[_0x4935('0x3')](_0x4935('0x56'),_0x2abd63[_0x4935('0x15')],transfers[_0x2abd63[_0x4935('0x15')]][_0x4935('0x7')],transfers[_0x2abd63[_0x4935('0x15')]]['reason'],transfers[_0x2abd63[_0x4935('0x15')]]['lastevent']));writeDB(transfers[_0x2abd63[_0x4935('0x15')]],!![]);}if(agents[_0x2abd63[_0x4935('0x15')]]&&agents[_0x2abd63['uniqueid']][_0x4935('0x33')]){agents[_0x2abd63['uniqueid']][_0x4935('0x10')]=!![];agents[_0x2abd63[_0x4935('0x15')]]['agentcompleteAt']=utils['now']();agents[_0x2abd63['uniqueid']][_0x4935('0x2f')]=utils['diffTime'](agents[_0x2abd63['uniqueid']][_0x4935('0x39')],agents[_0x2abd63['uniqueid']][_0x4935('0x33')]);agents[_0x2abd63['uniqueid']]['reason']=agents[_0x2abd63['uniqueid']][_0x4935('0x5a')]?'transfer':_0x4935('0x59');agents[_0x2abd63[_0x4935('0x15')]][_0x4935('0xb')]=_0x4935('0x3b');utils[_0x4935('0x2')](util['format'](_0x4935('0x56'),_0x2abd63[_0x4935('0x15')],agents[_0x2abd63['uniqueid']][_0x4935('0x7')],agents[_0x2abd63[_0x4935('0x15')]]['reason'],agents[_0x2abd63[_0x4935('0x15')]][_0x4935('0xb')]));writeDB(agents[_0x2abd63['uniqueid']]);}}catch(_0x390767){utils['error'](util[_0x4935('0x3')](_0x4935('0x54'),_0x2abd63['uniqueid']),_0x390767);}}; \ No newline at end of file +var _0xe205=['interface','calleridnum','then','type','agentacw','agentcomplete','acw','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','agentcalled','agentcalledAt','now','lastevent','connectedlinenum','connectedlinename','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','[%s][agents][agentcalled]','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','timeout','reason','holdtime','ringtime','talktime','push','queuecallerabandon','forIn','includes','debug','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','agentringnoanswer','abandoned','agentconnect','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connect','answered_elsewhere','answeredelsewheremembername','[%s][agents][agentconnect]','isNil','[%s][agents][agentcomplete]','diffTime','agentcompleteAt','complete','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','transfertype','blind','transferexten','extension','transferuniqueid','attendedtransfer','origtransfereruniqueid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','ATTENDED','origtransfererexten','transfereeuniqueid','agententerreason','calleridname','secondtransfererlinkedid','transfertargetuniqueid','clone','hangup','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','agent','[%s][agents][hangup]','lodash','util','./utils','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','queue','membername'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xe205,0xa7));var _0x5e20=function(_0x4a450a,_0x54d42f){_0x4a450a=_0x4a450a-0x0;var _0x28baf9=_0xe205[_0x4a450a];return _0x28baf9;};'use strict';var _=require(_0x5e20('0x0'));var util=require(_0x5e20('0x1'));var utils=require(_0x5e20('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x3cdbb0,_0x6c1585){utils[_0x5e20('0x3')](util[_0x5e20('0x4')](_0x5e20('0x5'),_0x3cdbb0[_0x5e20('0x6')],_0x3cdbb0['channel'],_0x3cdbb0[_0x5e20('0x7')],_0x3cdbb0[_0x5e20('0x8')],_0x3cdbb0[_0x5e20('0x9')],_0x3cdbb0[_0x5e20('0xa')],_0x3cdbb0['connectedlinenum'],_0x3cdbb0['lastevent']));if(_0x3cdbb0[_0x5e20('0x7')]){utils['getVoiceQueueByName'](_0x3cdbb0['queue'])[_0x5e20('0xb')](function(_0x28c142){if(_0x28c142){_0x3cdbb0['type']=_0x28c142[_0x5e20('0xc')];_0x3cdbb0[_0x5e20('0xd')]=_0x3cdbb0[_0x5e20('0xe')]?_0x28c142[_0x5e20('0xf')]:![];_0x3cdbb0['acwtime']=_0x3cdbb0[_0x5e20('0xd')]?_0x28c142[_0x5e20('0x10')]:0x0;}utils[_0x5e20('0x11')](_0x5e20('0x12'),_0x3cdbb0);});}else{utils[_0x5e20('0x11')](_0x5e20('0x12'),_0x3cdbb0);}if(_0x6c1585){delete transfers[_0x3cdbb0['uniqueid']];}else{delete agents[_0x3cdbb0[_0x5e20('0x13')]];}}exports[_0x5e20('0x14')]=function(_0x22540d){try{utils['debug'](util[_0x5e20('0x4')]('[%s][agents][agentcalled]',_0x22540d[_0x5e20('0x6')]),_0x22540d);agents[_0x22540d['destuniqueid']]=_0x22540d;agents[_0x22540d[_0x5e20('0x13')]][_0x5e20('0x15')]=utils[_0x5e20('0x16')]();agents[_0x22540d[_0x5e20('0x13')]][_0x5e20('0x17')]='called';agents[_0x22540d[_0x5e20('0x13')]][_0x5e20('0x18')]=null;agents[_0x22540d[_0x5e20('0x13')]][_0x5e20('0x19')]=null;utils[_0x5e20('0x3')](util[_0x5e20('0x4')](_0x5e20('0x1a'),_0x22540d[_0x5e20('0x6')],agents[_0x22540d['destuniqueid']][_0x5e20('0x8')],_0x22540d[_0x5e20('0x13')]));}catch(_0x4f900b){utils[_0x5e20('0x1b')](util[_0x5e20('0x4')](_0x5e20('0x1c'),_0x22540d[_0x5e20('0x6')]),_0x4f900b);}};exports['agentringnoanswer']=function(_0x2954fc){try{if(!_['isNil'](agents[_0x2954fc['destuniqueid']])){utils['debug'](util['format'](_0x5e20('0x1d'),_0x2954fc['uniqueid']),_0x2954fc);utils[_0x5e20('0x3')](util[_0x5e20('0x4')](_0x5e20('0x1e'),_0x2954fc[_0x5e20('0x6')],agents[_0x2954fc[_0x5e20('0x13')]][_0x5e20('0x8')],_0x2954fc['destuniqueid']));agents[_0x2954fc[_0x5e20('0x13')]]['agentringnoanswer']=!![];agents[_0x2954fc['destuniqueid']][_0x5e20('0x1f')]=utils[_0x5e20('0x16')]();agents[_0x2954fc[_0x5e20('0x13')]][_0x5e20('0x17')]=_0x5e20('0x20');agents[_0x2954fc[_0x5e20('0x13')]][_0x5e20('0x21')]='timeout';agents[_0x2954fc[_0x5e20('0x13')]][_0x5e20('0x22')]=_0x2954fc[_0x5e20('0x23')]?parseInt(_0x2954fc[_0x5e20('0x23')])/0x3e8:0x0;agents[_0x2954fc['destuniqueid']][_0x5e20('0x24')]=0x0;unanswered[_0x5e20('0x25')](_0x2954fc[_0x5e20('0x13')]);}}catch(_0x222e7a){utils[_0x5e20('0x1b')](util[_0x5e20('0x4')]('[%s][agents][agentringnoanswer]',_0x2954fc[_0x5e20('0x6')]),_0x222e7a);}};exports[_0x5e20('0x26')]=function(_0x543c29){try{_[_0x5e20('0x27')](agents,function(_0x21d1d8,_0x335f1e){if(_0x21d1d8[_0x5e20('0x6')]==_0x543c29[_0x5e20('0x6')]&&!_[_0x5e20('0x28')](unanswered,_0x21d1d8['destuniqueid'])){utils[_0x5e20('0x29')](util[_0x5e20('0x4')](_0x5e20('0x2a'),_0x543c29[_0x5e20('0x6')]),_0x543c29);utils[_0x5e20('0x3')](util[_0x5e20('0x4')](_0x5e20('0x2b'),_0x543c29[_0x5e20('0x6')],_0x21d1d8[_0x5e20('0x8')],_0x21d1d8[_0x5e20('0x13')]));_0x21d1d8[_0x5e20('0x2c')]=!![];_0x21d1d8['agentringnoanswerAt']=utils[_0x5e20('0x16')]();_0x21d1d8[_0x5e20('0x17')]=_0x5e20('0x2d');_0x21d1d8['reason']=_0x5e20('0x2d');_0x21d1d8[_0x5e20('0x22')]=_0x543c29[_0x5e20('0x22')];_0x21d1d8[_0x5e20('0x24')]=0x0;writeDB(_0x21d1d8);}});}catch(_0x244209){utils[_0x5e20('0x1b')](util[_0x5e20('0x4')](_0x5e20('0x2a'),_0x543c29[_0x5e20('0x6')]),_0x244209);}};exports[_0x5e20('0x2e')]=function(_0x36e825){try{if(agents[_0x36e825[_0x5e20('0x13')]]){utils[_0x5e20('0x29')](util[_0x5e20('0x4')]('[%s][agents][agentconnect]',_0x36e825[_0x5e20('0x6')]),_0x36e825);utils['info'](util['format'](_0x5e20('0x2f'),_0x36e825[_0x5e20('0x6')],agents[_0x36e825['destuniqueid']][_0x5e20('0x8')],_0x36e825[_0x5e20('0x13')]));agents[_0x36e825['destuniqueid']][_0x5e20('0x30')]=utils[_0x5e20('0x16')]();agents[_0x36e825[_0x5e20('0x13')]][_0x5e20('0x18')]=_0x36e825[_0x5e20('0x18')];agents[_0x36e825[_0x5e20('0x13')]][_0x5e20('0x19')]=_0x36e825[_0x5e20('0x19')];agents[_0x36e825[_0x5e20('0x13')]][_0x5e20('0x22')]=_0x36e825[_0x5e20('0x23')];agents[_0x36e825[_0x5e20('0x13')]][_0x5e20('0x17')]=_0x5e20('0x31');_[_0x5e20('0x27')](agents,function(_0x3d618c,_0x20e83d){if(_0x3d618c[_0x5e20('0x13')]!=_0x36e825['destuniqueid']&&_0x3d618c[_0x5e20('0x6')]==_0x36e825[_0x5e20('0x6')]){_0x3d618c[_0x5e20('0x24')]=0x0;_0x3d618c[_0x5e20('0x22')]=_0x36e825[_0x5e20('0x23')];_0x3d618c['agentringnoanswer']=!![];_0x3d618c[_0x5e20('0x1f')]=utils[_0x5e20('0x16')]();_0x3d618c[_0x5e20('0x17')]=_0x5e20('0x32');_0x3d618c[_0x5e20('0x21')]=_0x5e20('0x32');_0x3d618c['answeredelsewheredestinationuniqueid']=_0x36e825[_0x5e20('0x13')];_0x3d618c[_0x5e20('0x33')]=_0x36e825[_0x5e20('0x8')];writeDB(_0x3d618c);}});}}catch(_0x5a21f0){utils[_0x5e20('0x1b')](util[_0x5e20('0x4')](_0x5e20('0x34'),_0x36e825[_0x5e20('0x6')]),_0x5a21f0);}};exports[_0x5e20('0xe')]=function(_0x336d61){try{if(!_[_0x5e20('0x35')](agents[_0x336d61[_0x5e20('0x13')]])){utils['debug'](util[_0x5e20('0x4')](_0x5e20('0x36'),_0x336d61[_0x5e20('0x6')]),_0x336d61);utils['info'](util[_0x5e20('0x4')]('[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x336d61[_0x5e20('0x6')],agents[_0x336d61[_0x5e20('0x13')]][_0x5e20('0x8')],_0x336d61[_0x5e20('0x13')]));agents[_0x336d61[_0x5e20('0x13')]]['agentcomplete']=!![];agents[_0x336d61[_0x5e20('0x13')]]['agentcompleteAt']=utils['now']();agents[_0x336d61[_0x5e20('0x13')]][_0x5e20('0x24')]=utils[_0x5e20('0x37')](agents[_0x336d61[_0x5e20('0x13')]][_0x5e20('0x38')],agents[_0x336d61[_0x5e20('0x13')]][_0x5e20('0x30')]);agents[_0x336d61['destuniqueid']]['reason']=_0x336d61[_0x5e20('0x21')];agents[_0x336d61[_0x5e20('0x13')]]['lastevent']=_0x5e20('0x39');writeDB(agents[_0x336d61[_0x5e20('0x13')]]);}}catch(_0xf1e97c){utils[_0x5e20('0x1b')](util[_0x5e20('0x4')]('[%s][agents][agentcomplete]',_0x336d61[_0x5e20('0x6')]),_0xf1e97c);}};exports[_0x5e20('0x3a')]=function(_0x25491e){try{if(!_[_0x5e20('0x35')](agents[_0x25491e[_0x5e20('0x3b')]])){utils[_0x5e20('0x29')](util[_0x5e20('0x4')](_0x5e20('0x3c'),_0x25491e['uniqueid']),_0x25491e);utils['info'](util['format'](_0x5e20('0x3d'),_0x25491e[_0x5e20('0x6')],agents[_0x25491e['transfereruniqueid']][_0x5e20('0x8')],agents[_0x25491e['transfereruniqueid']][_0x5e20('0x6')]));agents[_0x25491e['transfereruniqueid']][_0x5e20('0x3e')]=!![];agents[_0x25491e['transfereruniqueid']][_0x5e20('0x3f')]=_0x5e20('0x40');agents[_0x25491e[_0x5e20('0x3b')]][_0x5e20('0x41')]=_0x25491e[_0x5e20('0x42')];agents[_0x25491e[_0x5e20('0x3b')]][_0x5e20('0x43')]=agents[_0x25491e[_0x5e20('0x3b')]][_0x5e20('0x6')];}}catch(_0x43e890){utils[_0x5e20('0x1b')](util[_0x5e20('0x4')](_0x5e20('0x3c'),_0x25491e[_0x5e20('0x6')]),_0x43e890);}};exports[_0x5e20('0x44')]=function(_0xe7759c){try{utils[_0x5e20('0x29')](util[_0x5e20('0x4')]('[%s][agents][attendedtransfer]',_0xe7759c['origtransfereruniqueid']),_0xe7759c);if(_0xe7759c[_0x5e20('0x45')]==_0xe7759c['origtransfererlinkedid']){if(!_[_0x5e20('0x35')](agents[_0xe7759c[_0x5e20('0x46')]])){utils[_0x5e20('0x3')](util['format'](_0x5e20('0x47'),_0xe7759c[_0x5e20('0x45')],agents[_0xe7759c[_0x5e20('0x46')]]['membername']));agents[_0xe7759c['secondtransfereruniqueid']]['transfer']=!![];agents[_0xe7759c[_0x5e20('0x46')]][_0x5e20('0x3f')]=_0x5e20('0x48');agents[_0xe7759c[_0x5e20('0x46')]][_0x5e20('0x41')]=_0xe7759c[_0x5e20('0x49')];agents[_0xe7759c['secondtransfereruniqueid']][_0x5e20('0x43')]=_0xe7759c['origtransfereruniqueid'];}if(_0xe7759c[_0x5e20('0x4a')]&&agents[_0xe7759c['transfereeuniqueid']]){agents[_0xe7759c[_0x5e20('0x4a')]][_0x5e20('0x4b')]=0x1;transfers[_0xe7759c[_0x5e20('0x4a')]]=_['clone'](agents[_0xe7759c[_0x5e20('0x4a')]]);transfers[_0xe7759c[_0x5e20('0x4a')]][_0x5e20('0xa')]=agents[_0xe7759c[_0x5e20('0x46')]][_0x5e20('0xa')];transfers[_0xe7759c[_0x5e20('0x4a')]][_0x5e20('0x4c')]=agents[_0xe7759c['secondtransfereruniqueid']][_0x5e20('0x4c')];transfers[_0xe7759c[_0x5e20('0x4a')]][_0x5e20('0x15')]=utils[_0x5e20('0x16')]();transfers[_0xe7759c['transfereeuniqueid']][_0x5e20('0x30')]=utils[_0x5e20('0x16')]();transfers[_0xe7759c[_0x5e20('0x4a')]][_0x5e20('0x22')]=0x0;transfers[_0xe7759c['transfereeuniqueid']][_0x5e20('0x4b')]=0x2;}}else if(_0xe7759c[_0x5e20('0x46')]==_0xe7759c[_0x5e20('0x4d')]){if(!_['isNil'](agents[_0xe7759c['origtransfereruniqueid']])){utils['info'](util[_0x5e20('0x4')](_0x5e20('0x47'),_0xe7759c['origtransfereruniqueid'],agents[_0xe7759c[_0x5e20('0x45')]][_0x5e20('0x8')]));agents[_0xe7759c[_0x5e20('0x45')]]['transfer']=!![];agents[_0xe7759c[_0x5e20('0x45')]][_0x5e20('0x3f')]='ATTENDED';agents[_0xe7759c[_0x5e20('0x45')]][_0x5e20('0x41')]=_0xe7759c['secondtransfererexten'];agents[_0xe7759c[_0x5e20('0x45')]][_0x5e20('0x43')]=_0xe7759c[_0x5e20('0x46')];}if(_0xe7759c[_0x5e20('0x4e')]&&agents[_0xe7759c['transfertargetuniqueid']]){agents[_0xe7759c[_0x5e20('0x4e')]]['agententerreason']=0x1;transfers[_0xe7759c['transfertargetuniqueid']]=_[_0x5e20('0x4f')](agents[_0xe7759c[_0x5e20('0x4e')]]);transfers[_0xe7759c[_0x5e20('0x4e')]][_0x5e20('0xa')]=agents[_0xe7759c[_0x5e20('0x45')]][_0x5e20('0xa')];transfers[_0xe7759c['transfertargetuniqueid']]['calleridname']=agents[_0xe7759c[_0x5e20('0x45')]][_0x5e20('0x4c')];transfers[_0xe7759c[_0x5e20('0x4e')]]['agentcalledAt']=utils[_0x5e20('0x16')]();transfers[_0xe7759c[_0x5e20('0x4e')]]['agentconnectAt']=utils[_0x5e20('0x16')]();transfers[_0xe7759c['transfertargetuniqueid']]['holdtime']=0x0;transfers[_0xe7759c[_0x5e20('0x4e')]]['agententerreason']=0x2;}}}catch(_0x3e4500){utils[_0x5e20('0x1b')](util[_0x5e20('0x4')]('[%s][agents][attendedtransfer]',_0xe7759c[_0x5e20('0x45')]),_0x3e4500);}};exports[_0x5e20('0x50')]=function(_0xd10013){try{utils[_0x5e20('0x29')](util[_0x5e20('0x4')]('[%s][agents][hangup]',_0xd10013[_0x5e20('0x6')]),_0xd10013);if(agents[_0xd10013[_0x5e20('0x6')]]&&agents[_0xd10013['uniqueid']][_0x5e20('0x21')]===_0x5e20('0x20')){if(_0xd10013[_0x5e20('0x51')]==='21'){agents[_0xd10013['uniqueid']][_0x5e20('0x21')]=_0x5e20('0x52');agents[_0xd10013[_0x5e20('0x6')]][_0x5e20('0x17')]=_0x5e20('0x52');}utils['info'](util[_0x5e20('0x4')](_0x5e20('0x53'),_0xd10013[_0x5e20('0x6')],agents[_0xd10013[_0x5e20('0x6')]][_0x5e20('0x8')],agents[_0xd10013['uniqueid']][_0x5e20('0x21')],agents[_0xd10013[_0x5e20('0x6')]][_0x5e20('0x17')]));writeDB(agents[_0xd10013[_0x5e20('0x6')]]);var _0x1e7cf8=unanswered[_0x5e20('0x54')](_0xd10013[_0x5e20('0x6')]);if(_0x1e7cf8>-0x1){unanswered[_0x5e20('0x55')](_0x1e7cf8,0x1);}}if(transfers[_0xd10013['uniqueid']]){transfers[_0xd10013[_0x5e20('0x6')]]['agentcomplete']=!![];transfers[_0xd10013['uniqueid']][_0x5e20('0x38')]=utils[_0x5e20('0x16')]();transfers[_0xd10013['uniqueid']][_0x5e20('0x24')]=utils[_0x5e20('0x37')](transfers[_0xd10013['uniqueid']][_0x5e20('0x38')],transfers[_0xd10013['uniqueid']][_0x5e20('0x30')]);transfers[_0xd10013['uniqueid']][_0x5e20('0x21')]=_0x5e20('0x56');transfers[_0xd10013[_0x5e20('0x6')]][_0x5e20('0x17')]=_0x5e20('0x39');utils['info'](util[_0x5e20('0x4')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0xd10013[_0x5e20('0x6')],transfers[_0xd10013['uniqueid']][_0x5e20('0x8')],transfers[_0xd10013[_0x5e20('0x6')]][_0x5e20('0x21')],transfers[_0xd10013[_0x5e20('0x6')]]['lastevent']));writeDB(transfers[_0xd10013[_0x5e20('0x6')]],!![]);}if(agents[_0xd10013[_0x5e20('0x6')]]&&agents[_0xd10013['uniqueid']]['agentconnectAt']){agents[_0xd10013[_0x5e20('0x6')]][_0x5e20('0xe')]=!![];agents[_0xd10013[_0x5e20('0x6')]][_0x5e20('0x38')]=utils[_0x5e20('0x16')]();agents[_0xd10013['uniqueid']][_0x5e20('0x24')]=utils['diffTime'](agents[_0xd10013['uniqueid']][_0x5e20('0x38')],agents[_0xd10013['uniqueid']]['agentconnectAt']);agents[_0xd10013[_0x5e20('0x6')]][_0x5e20('0x21')]=agents[_0xd10013['uniqueid']][_0x5e20('0x3e')]?_0x5e20('0x3e'):_0x5e20('0x56');agents[_0xd10013[_0x5e20('0x6')]][_0x5e20('0x17')]='complete';utils[_0x5e20('0x3')](util[_0x5e20('0x4')](_0x5e20('0x53'),_0xd10013[_0x5e20('0x6')],agents[_0xd10013['uniqueid']]['membername'],agents[_0xd10013[_0x5e20('0x6')]][_0x5e20('0x21')],agents[_0xd10013[_0x5e20('0x6')]][_0x5e20('0x17')]));writeDB(agents[_0xd10013[_0x5e20('0x6')]]);}}catch(_0xdc9ff4){utils[_0x5e20('0x1b')](util[_0x5e20('0x4')](_0x5e20('0x57'),_0xd10013[_0x5e20('0x6')]),_0xdc9ff4);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 286c66f..dc5ef97 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 _0x5b33=['cause-txt','endtime','starttime','billableseconds','diffTime','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','variable','value','xmd-phone','\x22\x20<','xmd-callerid-preview','xmd-callerid','xmd-queue','[%s][calls][varset]\x20variable:%s\x20value:%s','lastapplication','Queue','lastdata','queue','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','xmd-cdrtype','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','[%s][calls][varset]','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','startsWith','substring','lastIndexOf','includes','noop','execif','set','lodash','./utils','./transfers.controller','NO\x20ANSWER','FAILED','ANSWERED','BUSY','blinds','uniqueid','transfereeuniqueid','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','membername','interface','calleridnum','connectedlinenum','lastevent','accountcode','getUserByInternal','then','UserId','request','CreateVoiceCallReport','debug','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','now','DOCUMENTATION','error','newstate','[%s][calls][newstate]','isNil','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','channelstate','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition','hangup','[%s][calls][hangup]','callerid','[%s][calls][hangup]\x20callerid:%s\x20reason:%s'];(function(_0x157b99,_0x2c6b9e){var _0x2ee6aa=function(_0xf09554){while(--_0xf09554){_0x157b99['push'](_0x157b99['shift']());}};_0x2ee6aa(++_0x2c6b9e);}(_0x5b33,0x1e0));var _0x35b3=function(_0x34bb68,_0x5b0079){_0x34bb68=_0x34bb68-0x0;var _0x3db9fb=_0x5b33[_0x34bb68];return _0x3db9fb;};'use strict';var _=require(_0x35b3('0x0'));var util=require('util');var utils=require(_0x35b3('0x1'));var transfers=require(_0x35b3('0x2'));var dispositions=[_0x35b3('0x3'),'FAILED',_0x35b3('0x4'),_0x35b3('0x3'),_0x35b3('0x3'),'NO\x20ANSWER',_0x35b3('0x5'),_0x35b3('0x6'),_0x35b3('0x4'),_0x35b3('0x4'),'FAILED'];var channels={};function writeDB(_0x572a39){var _0x346302;if(transfers[_0x35b3('0x7')][_0x572a39['uniqueid']]){_0x346302=_0x572a39[_0x35b3('0x8')];_0x572a39['uniqueid']=transfers[_0x35b3('0x7')][_0x572a39[_0x35b3('0x8')]][_0x35b3('0x9')];}utils[_0x35b3('0xa')](util[_0x35b3('0xb')](_0x35b3('0xc'),_0x572a39[_0x35b3('0x8')],_0x572a39['channel'],_0x572a39['queue'],_0x572a39[_0x35b3('0xd')],_0x572a39[_0x35b3('0xe')],_0x572a39[_0x35b3('0xf')],_0x572a39[_0x35b3('0x10')],_0x572a39[_0x35b3('0x11')]));if(_0x572a39[_0x35b3('0x12')]){utils[_0x35b3('0x13')](_0x572a39['accountcode'])[_0x35b3('0x14')](function(_0x33c621){if(_0x33c621){_0x572a39[_0x35b3('0x15')]=_0x33c621['id'];}utils[_0x35b3('0x16')](_0x35b3('0x17'),_0x572a39);});}else{utils[_0x35b3('0x16')](_0x35b3('0x17'),_0x572a39);}if(channels[_0x572a39[_0x35b3('0x8')]]){delete channels[_0x572a39[_0x35b3('0x8')]];}else if(_0x346302&&channels[_0x346302]){delete transfers[_0x35b3('0x7')][_0x346302];delete channels[_0x346302];}}exports['newchannel']=function(_0x9f263c){try{utils[_0x35b3('0x18')](util[_0x35b3('0xb')](_0x35b3('0x19'),_0x9f263c['uniqueid']),_0x9f263c);if(_0x9f263c[_0x35b3('0x8')]==_0x9f263c[_0x35b3('0x1a')]&&_0x9f263c['channel']!=_0x35b3('0x1b')){utils[_0x35b3('0xa')](util[_0x35b3('0xb')](_0x35b3('0x1c'),_0x9f263c[_0x35b3('0x8')],_0x9f263c[_0x35b3('0x1d')],_0x9f263c[_0x35b3('0x1e')]));channels[_0x9f263c[_0x35b3('0x8')]]={'uniqueid':_0x9f263c['uniqueid'],'accountcode':_0x9f263c['accountcode'],'source':_0x9f263c[_0x35b3('0xf')],'destination':_0x9f263c['exten'],'destinationcontext':_0x9f263c['context'],'channel':_0x9f263c[_0x35b3('0x1f')],'starttime':utils[_0x35b3('0x20')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x35b3('0x3'),'amaflags':_0x35b3('0x21')};}}catch(_0x4d8ce9){utils[_0x35b3('0x22')](util[_0x35b3('0xb')](_0x35b3('0x19'),_0x9f263c[_0x35b3('0x8')]),_0x4d8ce9);}};exports[_0x35b3('0x23')]=function(_0x46b532){try{utils['debug'](util[_0x35b3('0xb')](_0x35b3('0x24'),_0x46b532[_0x35b3('0x8')]),_0x46b532);if(!_[_0x35b3('0x25')](channels[_0x46b532[_0x35b3('0x8')]])&&_0x46b532['channelstate']==0x6){utils[_0x35b3('0xa')](util[_0x35b3('0xb')](_0x35b3('0x26'),_0x46b532['uniqueid'],_0x46b532[_0x35b3('0x1d')],_0x46b532['channel']));if(_[_0x35b3('0x25')](channels[_0x46b532[_0x35b3('0x8')]][_0x35b3('0x27')])){channels[_0x46b532['uniqueid']][_0x35b3('0x27')]=utils[_0x35b3('0x20')]();}}else if(!_[_0x35b3('0x25')](channels[_0x46b532[_0x35b3('0x1a')]])&&_0x46b532[_0x35b3('0x28')]==0x6&&_0x46b532['context']!=_0x35b3('0x29')){utils[_0x35b3('0xa')](util[_0x35b3('0xb')](_0x35b3('0x2a'),_0x46b532[_0x35b3('0x8')],_0x46b532['linkedid'],_0x46b532[_0x35b3('0x1d')],_0x46b532['channel']));channels[_0x46b532[_0x35b3('0x1a')]][_0x35b3('0x12')]=_0x46b532[_0x35b3('0x12')];channels[_0x46b532['linkedid']][_0x35b3('0x2b')]=_0x46b532[_0x35b3('0x1f')];if(_[_0x35b3('0x25')](channels[_0x46b532[_0x35b3('0x1a')]][_0x35b3('0x2c')])){channels[_0x46b532[_0x35b3('0x1a')]][_0x35b3('0x2c')]=utils[_0x35b3('0x20')]();}channels[_0x46b532['linkedid']][_0x35b3('0x2d')]=dispositions[_['toNumber'](_0x46b532[_0x35b3('0x28')])]||'ANSWERED';}}catch(_0x177fcc){utils[_0x35b3('0x22')](util[_0x35b3('0xb')](_0x35b3('0x24'),_0x46b532[_0x35b3('0x8')]),_0x177fcc);}};exports[_0x35b3('0x2e')]=function(_0x2c5544){try{if(!_['isNil'](channels[_0x2c5544[_0x35b3('0x8')]])){utils[_0x35b3('0x18')](util[_0x35b3('0xb')](_0x35b3('0x2f'),_0x2c5544[_0x35b3('0x8')]),_0x2c5544);if(_['isNil'](channels[_0x2c5544[_0x35b3('0x8')]]['callerid'])){channels[_0x2c5544['uniqueid']][_0x35b3('0x30')]=_0x2c5544['calleridname']+'\x20<'+_0x2c5544[_0x35b3('0xf')]+'>';}utils['info'](util['format'](_0x35b3('0x31'),_0x2c5544[_0x35b3('0x8')],channels[_0x2c5544[_0x35b3('0x8')]][_0x35b3('0x30')],_0x2c5544[_0x35b3('0x32')]));channels[_0x2c5544[_0x35b3('0x8')]][_0x35b3('0x33')]=utils[_0x35b3('0x20')]();channels[_0x2c5544[_0x35b3('0x8')]]['duration']=utils['diffTime'](channels[_0x2c5544[_0x35b3('0x8')]][_0x35b3('0x33')],channels[_0x2c5544[_0x35b3('0x8')]][_0x35b3('0x34')]);channels[_0x2c5544[_0x35b3('0x8')]][_0x35b3('0x35')]=channels[_0x2c5544[_0x35b3('0x8')]]['answertime']?utils[_0x35b3('0x36')](channels[_0x2c5544[_0x35b3('0x8')]][_0x35b3('0x33')],channels[_0x2c5544[_0x35b3('0x8')]][_0x35b3('0x2c')]):0x0;writeDB(channels[_0x2c5544[_0x35b3('0x8')]]);}}catch(_0x388606){utils[_0x35b3('0x22')](util[_0x35b3('0xb')](_0x35b3('0x2f'),_0x2c5544[_0x35b3('0x8')]),_0x388606);}};exports['attendedtransfer']=function(_0x4c8a9b){try{if(!_[_0x35b3('0x25')](channels[_0x4c8a9b[_0x35b3('0x37')]])){utils[_0x35b3('0x18')](util[_0x35b3('0xb')](_0x35b3('0x38'),_0x4c8a9b[_0x35b3('0x39')]),_0x4c8a9b);if(channels[_0x4c8a9b[_0x35b3('0x37')]][_0x35b3('0x1f')]==_0x4c8a9b[_0x35b3('0x3a')]){utils['info'](util['format'](_0x35b3('0x3b'),_0x4c8a9b[_0x35b3('0x39')],_0x4c8a9b[_0x35b3('0x37')],_0x4c8a9b[_0x35b3('0x3c')]));channels[_0x4c8a9b[_0x35b3('0x37')]]['destinationchannel']=_0x4c8a9b[_0x35b3('0x3c')];channels[_0x4c8a9b[_0x35b3('0x37')]][_0x35b3('0x3d')]=_0x35b3('0x3e');}else if(channels[_0x4c8a9b[_0x35b3('0x37')]][_0x35b3('0x1f')]=_0x4c8a9b[_0x35b3('0x3f')]){utils['info'](util[_0x35b3('0xb')](_0x35b3('0x3b'),_0x4c8a9b[_0x35b3('0x39')],_0x4c8a9b[_0x35b3('0x37')],_0x4c8a9b['origtransfererchannel']));channels[_0x4c8a9b[_0x35b3('0x37')]]['destinationchannel']=_0x4c8a9b[_0x35b3('0x40')];channels[_0x4c8a9b['localtwolinkedid']][_0x35b3('0x3d')]=_0x35b3('0x3e');}}}catch(_0x248e43){utils[_0x35b3('0x22')](util[_0x35b3('0xb')](_0x35b3('0x38'),_0x4c8a9b[_0x35b3('0x39')]),_0x248e43);}};exports[_0x35b3('0x41')]=function(_0x495ff2){try{if(!_[_0x35b3('0x25')](channels[_0x495ff2[_0x35b3('0x8')]])){utils[_0x35b3('0x18')](util['format'](_0x35b3('0x42'),_0x495ff2[_0x35b3('0x8')]),_0x495ff2);channels[_0x495ff2[_0x35b3('0x8')]][_0x35b3('0x43')]=utils[_0x35b3('0x20')]();utils[_0x35b3('0xa')](util['format'](_0x35b3('0x44'),_0x495ff2[_0x35b3('0x8')],channels[_0x495ff2[_0x35b3('0x8')]][_0x35b3('0x43')]));}}catch(_0x4a11d2){utils[_0x35b3('0x22')](util['format'](_0x35b3('0x42'),_0x495ff2[_0x35b3('0x8')]),_0x4a11d2);}};exports['musiconholdstop']=function(_0x5127a4){try{if(!_[_0x35b3('0x25')](channels[_0x5127a4['uniqueid']])){utils[_0x35b3('0x18')](util['format'](_0x35b3('0x45'),_0x5127a4['uniqueid']),_0x5127a4);if(!_['isNil'](channels[_0x5127a4[_0x35b3('0x8')]]['musiconholdstartAt'])){channels[_0x5127a4[_0x35b3('0x8')]][_0x35b3('0x46')]+=utils[_0x35b3('0x36')](utils['now'](),channels[_0x5127a4[_0x35b3('0x8')]][_0x35b3('0x43')]);utils[_0x35b3('0xa')](util[_0x35b3('0xb')](_0x35b3('0x47'),_0x5127a4[_0x35b3('0x8')],channels[_0x5127a4['uniqueid']][_0x35b3('0x46')]));delete channels[_0x5127a4[_0x35b3('0x8')]][_0x35b3('0x43')];}}}catch(_0x529306){utils[_0x35b3('0x22')](util[_0x35b3('0xb')](_0x35b3('0x45'),_0x5127a4[_0x35b3('0x8')]),_0x529306);}};exports['varset']=function(_0x282938){try{if(!_['isNil'](channels[_0x282938[_0x35b3('0x8')]])){utils[_0x35b3('0x18')](util[_0x35b3('0xb')]('[%s][calls][varset]',_0x282938[_0x35b3('0x8')]),_0x282938);if(!_[_0x35b3('0x25')](_0x282938[_0x35b3('0x48')]['xmd-originatecalleridnum'])){utils['info'](util[_0x35b3('0xb')]('[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x282938[_0x35b3('0x8')],_0x282938[_0x35b3('0x49')]));channels[_0x282938[_0x35b3('0x8')]]['source']=_0x282938['value'];}if(!_[_0x35b3('0x25')](_0x282938[_0x35b3('0x48')][_0x35b3('0x4a')])){utils[_0x35b3('0xa')](util[_0x35b3('0xb')]('[%s][calls][varset]\x20variable:xmd-phone\x20value:%s',_0x282938['uniqueid'],_0x282938[_0x35b3('0x49')]));channels[_0x282938[_0x35b3('0x8')]]['destination']=_0x282938[_0x35b3('0x49')];channels[_0x282938[_0x35b3('0x8')]]['callerid']='\x22'+_0x282938[_0x35b3('0x49')]+_0x35b3('0x4b')+_0x282938[_0x35b3('0x49')]+'>';}if(!_[_0x35b3('0x25')](_0x282938[_0x35b3('0x48')][_0x35b3('0x4c')])||!_[_0x35b3('0x25')](_0x282938['variable'][_0x35b3('0x4d')])){utils['info'](util[_0x35b3('0xb')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x282938[_0x35b3('0x8')],!_[_0x35b3('0x25')](_0x282938[_0x35b3('0x48')]['xmd-callerid-preview'])?_0x35b3('0x4c'):_0x35b3('0x4d'),_0x282938[_0x35b3('0x49')]));channels[_0x282938[_0x35b3('0x8')]][_0x35b3('0x30')]=_0x282938['value'];}if(!_[_0x35b3('0x25')](_0x282938['variable'][_0x35b3('0x4e')])||!_[_0x35b3('0x25')](_0x282938[_0x35b3('0x48')]['xmcs-queue'])){utils['info'](util[_0x35b3('0xb')](_0x35b3('0x4f'),_0x282938[_0x35b3('0x8')],!_['isNil'](_0x282938[_0x35b3('0x48')][_0x35b3('0x4e')])?'xmd-queue':'xmcs-queue',_0x282938[_0x35b3('0x49')]));channels[_0x282938['uniqueid']][_0x35b3('0x50')]=_0x35b3('0x51');channels[_0x282938['uniqueid']][_0x35b3('0x52')]=_0x282938[_0x35b3('0x49')];channels[_0x282938['uniqueid']][_0x35b3('0x53')]=!![];}if(!_[_0x35b3('0x25')](_0x282938[_0x35b3('0x48')][_0x35b3('0x54')])){utils['info'](util['format'](_0x35b3('0x55'),_0x282938['uniqueid'],_0x282938['value']));channels[_0x282938['uniqueid']]['ContactId']=_0x282938[_0x35b3('0x49')];}if(!_[_0x35b3('0x25')](_0x282938[_0x35b3('0x48')][_0x35b3('0x56')])){utils[_0x35b3('0xa')](util[_0x35b3('0xb')]('[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x282938[_0x35b3('0x8')],_0x282938['value']));channels[_0x282938[_0x35b3('0x8')]][_0x35b3('0x57')]=_0x282938[_0x35b3('0x49')];}if(!_['isNil'](_0x282938[_0x35b3('0x48')][_0x35b3('0x58')])){utils['info'](util[_0x35b3('0xb')](_0x35b3('0x59'),_0x282938[_0x35b3('0x8')],_0x282938['value']));channels[_0x282938[_0x35b3('0x8')]][_0x35b3('0x5a')]=_0x282938[_0x35b3('0x49')];}if(!_[_0x35b3('0x25')](_0x282938['variable'][_0x35b3('0x5b')])){utils[_0x35b3('0xa')](util[_0x35b3('0xb')](_0x35b3('0x5c'),_0x282938['uniqueid'],_0x282938[_0x35b3('0x49')]));channels[_0x282938['uniqueid']][_0x35b3('0x5b')]=_0x282938['value'];}}}catch(_0x592371){utils[_0x35b3('0x22')](util[_0x35b3('0xb')](_0x35b3('0x5d'),_0x282938[_0x35b3('0x8')]),_0x592371);}};exports['newexten']=function(_0x4f6621){try{if(!_[_0x35b3('0x25')](channels[_0x4f6621[_0x35b3('0x8')]])){utils['debug'](util['format'](_0x35b3('0x5e'),_0x4f6621[_0x35b3('0x8')]),_0x4f6621);utils[_0x35b3('0xa')](util['format'](_0x35b3('0x5f'),_0x4f6621['uniqueid'],_0x4f6621[_0x35b3('0x60')],_0x4f6621[_0x35b3('0x61')]));if(_0x4f6621['application'][_0x35b3('0x62')]()=='set'&&_[_0x35b3('0x63')](_0x4f6621['appdata'][_0x35b3('0x62')](),'cdr')){var _0x3f3c64=_0x4f6621[_0x35b3('0x61')]['split']('=');var _0x29e38d=_0x3f3c64[0x0][_0x35b3('0x64')](_0x3f3c64[0x0][_0x35b3('0x65')]('(')+0x1,_0x3f3c64[0x0][_0x35b3('0x65')](')'));var _0x5ad213=_0x3f3c64[0x1];channels[_0x4f6621['uniqueid']][_0x29e38d]=_0x5ad213;}if(!_[_0x35b3('0x66')](['hangup',_0x35b3('0x67'),_0x35b3('0x68'),_0x35b3('0x69'),'gotoif'],_0x4f6621[_0x35b3('0x60')][_0x35b3('0x62')]())){channels[_0x4f6621[_0x35b3('0x8')]][_0x35b3('0x50')]=_0x4f6621[_0x35b3('0x60')];channels[_0x4f6621[_0x35b3('0x8')]][_0x35b3('0x52')]=_0x4f6621[_0x35b3('0x61')];}}}catch(_0x1a174){utils[_0x35b3('0x22')](util[_0x35b3('0xb')](_0x35b3('0x5e'),_0x4f6621['uniqueid']),_0x1a174);}}; \ No newline at end of file +var _0x2ba7=['toNumber','hangup','[%s][calls][hangup]','callerid','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','diffTime','billableseconds','localtwolinkedid','origtransfereruniqueid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','userfield','transfertargetchannel','origtransfererchannel','_attended','[%s][calls][attendedtransfer]','[%s][calls][musiconholdstart]','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','value','source','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','\x22\x20<','xmd-callerid-preview','xmd-callerid','xmcs-queue','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','lastapplication','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','cdr','split','lastIndexOf','includes','noop','execif','gotoif','lastdata','lodash','util','./transfers.controller','NO\x20ANSWER','FAILED','ANSWERED','BUSY','blinds','uniqueid','transfereeuniqueid','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','membername','interface','calleridnum','accountcode','getUserByInternal','then','UserId','CreateVoiceCallReport','request','newchannel','debug','[%s][calls][newchannel]','OutgoingSpoolFailed','info','[%s][calls][newchannel]\x20context:%s\x20exten:%s','exten','context','now','DOCUMENTATION','error','[%s][calls][newstate]','isNil','channelstate','systemanswertime','linkedid','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition'];(function(_0x287076,_0x4a2432){var _0x45c6ce=function(_0x5cd1dc){while(--_0x5cd1dc){_0x287076['push'](_0x287076['shift']());}};_0x45c6ce(++_0x4a2432);}(_0x2ba7,0xad));var _0x72ba=function(_0x31ae4e,_0x7e14fc){_0x31ae4e=_0x31ae4e-0x0;var _0x30c85d=_0x2ba7[_0x31ae4e];return _0x30c85d;};'use strict';var _=require(_0x72ba('0x0'));var util=require(_0x72ba('0x1'));var utils=require('./utils');var transfers=require(_0x72ba('0x2'));var dispositions=[_0x72ba('0x3'),_0x72ba('0x4'),_0x72ba('0x4'),'NO\x20ANSWER',_0x72ba('0x3'),_0x72ba('0x3'),_0x72ba('0x5'),_0x72ba('0x6'),_0x72ba('0x4'),'FAILED',_0x72ba('0x4')];var channels={};function writeDB(_0x38fe52){var _0x401164;if(transfers[_0x72ba('0x7')][_0x38fe52[_0x72ba('0x8')]]){_0x401164=_0x38fe52[_0x72ba('0x8')];_0x38fe52[_0x72ba('0x8')]=transfers[_0x72ba('0x7')][_0x38fe52['uniqueid']][_0x72ba('0x9')];}utils['info'](util[_0x72ba('0xa')](_0x72ba('0xb'),_0x38fe52[_0x72ba('0x8')],_0x38fe52[_0x72ba('0xc')],_0x38fe52[_0x72ba('0xd')],_0x38fe52[_0x72ba('0xe')],_0x38fe52[_0x72ba('0xf')],_0x38fe52[_0x72ba('0x10')],_0x38fe52['connectedlinenum'],_0x38fe52['lastevent']));if(_0x38fe52[_0x72ba('0x11')]){utils[_0x72ba('0x12')](_0x38fe52[_0x72ba('0x11')])[_0x72ba('0x13')](function(_0x13f9d8){if(_0x13f9d8){_0x38fe52[_0x72ba('0x14')]=_0x13f9d8['id'];}utils['request'](_0x72ba('0x15'),_0x38fe52);});}else{utils[_0x72ba('0x16')](_0x72ba('0x15'),_0x38fe52);}if(channels[_0x38fe52[_0x72ba('0x8')]]){delete channels[_0x38fe52[_0x72ba('0x8')]];}else if(_0x401164&&channels[_0x401164]){delete transfers['blinds'][_0x401164];delete channels[_0x401164];}}exports[_0x72ba('0x17')]=function(_0x235b71){try{utils[_0x72ba('0x18')](util[_0x72ba('0xa')](_0x72ba('0x19'),_0x235b71[_0x72ba('0x8')]),_0x235b71);if(_0x235b71[_0x72ba('0x8')]==_0x235b71['linkedid']&&_0x235b71['channel']!=_0x72ba('0x1a')){utils[_0x72ba('0x1b')](util[_0x72ba('0xa')](_0x72ba('0x1c'),_0x235b71['uniqueid'],_0x235b71['context'],_0x235b71[_0x72ba('0x1d')]));channels[_0x235b71[_0x72ba('0x8')]]={'uniqueid':_0x235b71[_0x72ba('0x8')],'accountcode':_0x235b71[_0x72ba('0x11')],'source':_0x235b71['calleridnum'],'destination':_0x235b71[_0x72ba('0x1d')],'destinationcontext':_0x235b71[_0x72ba('0x1e')],'channel':_0x235b71[_0x72ba('0xc')],'starttime':utils[_0x72ba('0x1f')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':_0x72ba('0x20')};}}catch(_0x37193d){utils[_0x72ba('0x21')](util[_0x72ba('0xa')](_0x72ba('0x19'),_0x235b71[_0x72ba('0x8')]),_0x37193d);}};exports['newstate']=function(_0x16946c){try{utils['debug'](util[_0x72ba('0xa')](_0x72ba('0x22'),_0x16946c[_0x72ba('0x8')]),_0x16946c);if(!_[_0x72ba('0x23')](channels[_0x16946c['uniqueid']])&&_0x16946c[_0x72ba('0x24')]==0x6){utils[_0x72ba('0x1b')](util[_0x72ba('0xa')]('[%s][calls][newstate]\x20context:%s\x20channel:%s',_0x16946c[_0x72ba('0x8')],_0x16946c[_0x72ba('0x1e')],_0x16946c[_0x72ba('0xc')]));if(_['isNil'](channels[_0x16946c[_0x72ba('0x8')]][_0x72ba('0x25')])){channels[_0x16946c[_0x72ba('0x8')]]['systemanswertime']=utils[_0x72ba('0x1f')]();}}else if(!_['isNil'](channels[_0x16946c[_0x72ba('0x26')]])&&_0x16946c[_0x72ba('0x24')]==0x6&&_0x16946c['context']!='transfer'){utils[_0x72ba('0x1b')](util[_0x72ba('0xa')](_0x72ba('0x27'),_0x16946c[_0x72ba('0x8')],_0x16946c[_0x72ba('0x26')],_0x16946c[_0x72ba('0x1e')],_0x16946c[_0x72ba('0xc')]));channels[_0x16946c[_0x72ba('0x26')]]['accountcode']=_0x16946c[_0x72ba('0x11')];channels[_0x16946c[_0x72ba('0x26')]][_0x72ba('0x28')]=_0x16946c['channel'];if(_['isNil'](channels[_0x16946c[_0x72ba('0x26')]][_0x72ba('0x29')])){channels[_0x16946c['linkedid']][_0x72ba('0x29')]=utils[_0x72ba('0x1f')]();}channels[_0x16946c['linkedid']][_0x72ba('0x2a')]=dispositions[_[_0x72ba('0x2b')](_0x16946c['channelstate'])]||_0x72ba('0x5');}}catch(_0x3e9b7c){utils['error'](util[_0x72ba('0xa')](_0x72ba('0x22'),_0x16946c[_0x72ba('0x8')]),_0x3e9b7c);}};exports[_0x72ba('0x2c')]=function(_0x2676de){try{if(!_['isNil'](channels[_0x2676de['uniqueid']])){utils[_0x72ba('0x18')](util[_0x72ba('0xa')](_0x72ba('0x2d'),_0x2676de[_0x72ba('0x8')]),_0x2676de);if(_[_0x72ba('0x23')](channels[_0x2676de['uniqueid']][_0x72ba('0x2e')])){channels[_0x2676de[_0x72ba('0x8')]][_0x72ba('0x2e')]=_0x2676de['calleridname']+'\x20<'+_0x2676de['calleridnum']+'>';}utils[_0x72ba('0x1b')](util['format'](_0x72ba('0x2f'),_0x2676de[_0x72ba('0x8')],channels[_0x2676de[_0x72ba('0x8')]][_0x72ba('0x2e')],_0x2676de[_0x72ba('0x30')]));channels[_0x2676de[_0x72ba('0x8')]][_0x72ba('0x31')]=utils['now']();channels[_0x2676de[_0x72ba('0x8')]]['duration']=utils[_0x72ba('0x32')](channels[_0x2676de[_0x72ba('0x8')]][_0x72ba('0x31')],channels[_0x2676de['uniqueid']]['starttime']);channels[_0x2676de['uniqueid']][_0x72ba('0x33')]=channels[_0x2676de[_0x72ba('0x8')]]['answertime']?utils[_0x72ba('0x32')](channels[_0x2676de[_0x72ba('0x8')]][_0x72ba('0x31')],channels[_0x2676de['uniqueid']][_0x72ba('0x29')]):0x0;writeDB(channels[_0x2676de['uniqueid']]);}}catch(_0x5eef51){utils['error'](util[_0x72ba('0xa')](_0x72ba('0x2d'),_0x2676de['uniqueid']),_0x5eef51);}};exports['attendedtransfer']=function(_0x17f312){try{if(!_[_0x72ba('0x23')](channels[_0x17f312[_0x72ba('0x34')]])){utils[_0x72ba('0x18')](util['format']('[%s][calls][attendedtransfer]',_0x17f312[_0x72ba('0x35')]),_0x17f312);if(channels[_0x17f312[_0x72ba('0x34')]]['channel']==_0x17f312[_0x72ba('0x36')]){utils['info'](util[_0x72ba('0xa')](_0x72ba('0x37'),_0x17f312[_0x72ba('0x35')],_0x17f312['localtwolinkedid'],_0x17f312[_0x72ba('0x38')]));channels[_0x17f312[_0x72ba('0x34')]]['destinationchannel']=_0x17f312[_0x72ba('0x38')];channels[_0x17f312[_0x72ba('0x34')]][_0x72ba('0x39')]='_attended';}else if(channels[_0x17f312['localtwolinkedid']][_0x72ba('0xc')]=_0x17f312[_0x72ba('0x3a')]){utils[_0x72ba('0x1b')](util[_0x72ba('0xa')](_0x72ba('0x37'),_0x17f312[_0x72ba('0x35')],_0x17f312['localtwolinkedid'],_0x17f312[_0x72ba('0x3b')]));channels[_0x17f312[_0x72ba('0x34')]]['destinationchannel']=_0x17f312[_0x72ba('0x3b')];channels[_0x17f312[_0x72ba('0x34')]][_0x72ba('0x39')]=_0x72ba('0x3c');}}}catch(_0x35c68c){utils[_0x72ba('0x21')](util[_0x72ba('0xa')](_0x72ba('0x3d'),_0x17f312[_0x72ba('0x35')]),_0x35c68c);}};exports['musiconholdstart']=function(_0x45b155){try{if(!_[_0x72ba('0x23')](channels[_0x45b155[_0x72ba('0x8')]])){utils[_0x72ba('0x18')](util[_0x72ba('0xa')](_0x72ba('0x3e'),_0x45b155[_0x72ba('0x8')]),_0x45b155);channels[_0x45b155[_0x72ba('0x8')]]['musiconholdstartAt']=utils[_0x72ba('0x1f')]();utils[_0x72ba('0x1b')](util[_0x72ba('0xa')]('[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s',_0x45b155[_0x72ba('0x8')],channels[_0x45b155[_0x72ba('0x8')]][_0x72ba('0x3f')]));}}catch(_0x4c7c79){utils[_0x72ba('0x21')](util['format'](_0x72ba('0x3e'),_0x45b155['uniqueid']),_0x4c7c79);}};exports[_0x72ba('0x40')]=function(_0x32c988){try{if(!_[_0x72ba('0x23')](channels[_0x32c988[_0x72ba('0x8')]])){utils[_0x72ba('0x18')](util[_0x72ba('0xa')](_0x72ba('0x41'),_0x32c988['uniqueid']),_0x32c988);if(!_['isNil'](channels[_0x32c988[_0x72ba('0x8')]][_0x72ba('0x3f')])){channels[_0x32c988[_0x72ba('0x8')]][_0x72ba('0x42')]+=utils[_0x72ba('0x32')](utils[_0x72ba('0x1f')](),channels[_0x32c988[_0x72ba('0x8')]][_0x72ba('0x3f')]);utils['info'](util[_0x72ba('0xa')](_0x72ba('0x43'),_0x32c988[_0x72ba('0x8')],channels[_0x32c988[_0x72ba('0x8')]]['mohtime']));delete channels[_0x32c988['uniqueid']][_0x72ba('0x3f')];}}}catch(_0x600e85){utils[_0x72ba('0x21')](util['format'](_0x72ba('0x41'),_0x32c988[_0x72ba('0x8')]),_0x600e85);}};exports[_0x72ba('0x44')]=function(_0x334186){try{if(!_[_0x72ba('0x23')](channels[_0x334186[_0x72ba('0x8')]])){utils[_0x72ba('0x18')](util[_0x72ba('0xa')](_0x72ba('0x45'),_0x334186[_0x72ba('0x8')]),_0x334186);if(!_[_0x72ba('0x23')](_0x334186[_0x72ba('0x46')][_0x72ba('0x47')])){utils[_0x72ba('0x1b')](util[_0x72ba('0xa')](_0x72ba('0x48'),_0x334186[_0x72ba('0x8')],_0x334186[_0x72ba('0x49')]));channels[_0x334186[_0x72ba('0x8')]][_0x72ba('0x4a')]=_0x334186[_0x72ba('0x49')];}if(!_[_0x72ba('0x23')](_0x334186[_0x72ba('0x46')][_0x72ba('0x4b')])){utils[_0x72ba('0x1b')](util[_0x72ba('0xa')](_0x72ba('0x4c'),_0x334186['uniqueid'],_0x334186['value']));channels[_0x334186[_0x72ba('0x8')]][_0x72ba('0x4d')]=_0x334186['value'];channels[_0x334186[_0x72ba('0x8')]][_0x72ba('0x2e')]='\x22'+_0x334186[_0x72ba('0x49')]+_0x72ba('0x4e')+_0x334186[_0x72ba('0x49')]+'>';}if(!_[_0x72ba('0x23')](_0x334186['variable'][_0x72ba('0x4f')])||!_['isNil'](_0x334186['variable'][_0x72ba('0x50')])){utils[_0x72ba('0x1b')](util[_0x72ba('0xa')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x334186['uniqueid'],!_[_0x72ba('0x23')](_0x334186[_0x72ba('0x46')][_0x72ba('0x4f')])?_0x72ba('0x4f'):_0x72ba('0x50'),_0x334186[_0x72ba('0x49')]));channels[_0x334186[_0x72ba('0x8')]][_0x72ba('0x2e')]=_0x334186[_0x72ba('0x49')];}if(!_[_0x72ba('0x23')](_0x334186['variable']['xmd-queue'])||!_['isNil'](_0x334186[_0x72ba('0x46')][_0x72ba('0x51')])){utils['info'](util[_0x72ba('0xa')](_0x72ba('0x52'),_0x334186[_0x72ba('0x8')],!_[_0x72ba('0x23')](_0x334186['variable'][_0x72ba('0x53')])?_0x72ba('0x53'):_0x72ba('0x51'),_0x334186[_0x72ba('0x49')]));channels[_0x334186['uniqueid']][_0x72ba('0x54')]='Queue';channels[_0x334186[_0x72ba('0x8')]]['lastdata']=_0x334186[_0x72ba('0x49')];channels[_0x334186['uniqueid']][_0x72ba('0xd')]=!![];}if(!_['isNil'](_0x334186[_0x72ba('0x46')][_0x72ba('0x55')])){utils['info'](util[_0x72ba('0xa')](_0x72ba('0x56'),_0x334186[_0x72ba('0x8')],_0x334186['value']));channels[_0x334186[_0x72ba('0x8')]][_0x72ba('0x57')]=_0x334186[_0x72ba('0x49')];}if(!_[_0x72ba('0x23')](_0x334186[_0x72ba('0x46')][_0x72ba('0x58')])){utils['info'](util[_0x72ba('0xa')](_0x72ba('0x59'),_0x334186[_0x72ba('0x8')],_0x334186[_0x72ba('0x49')]));channels[_0x334186[_0x72ba('0x8')]][_0x72ba('0x5a')]=_0x334186[_0x72ba('0x49')];}if(!_['isNil'](_0x334186[_0x72ba('0x46')][_0x72ba('0x5b')])){utils[_0x72ba('0x1b')](util['format'](_0x72ba('0x5c'),_0x334186[_0x72ba('0x8')],_0x334186[_0x72ba('0x49')]));channels[_0x334186['uniqueid']][_0x72ba('0x5d')]=_0x334186[_0x72ba('0x49')];}if(!_['isNil'](_0x334186[_0x72ba('0x46')][_0x72ba('0x5e')])){utils[_0x72ba('0x1b')](util['format']('[%s][calls][varset]\x20variable:sipcallid\x20value:%s',_0x334186['uniqueid'],_0x334186[_0x72ba('0x49')]));channels[_0x334186[_0x72ba('0x8')]][_0x72ba('0x5e')]=_0x334186[_0x72ba('0x49')];}}}catch(_0x5ae216){utils[_0x72ba('0x21')](util[_0x72ba('0xa')](_0x72ba('0x45'),_0x334186[_0x72ba('0x8')]),_0x5ae216);}};exports['newexten']=function(_0x4aed0e){try{if(!_['isNil'](channels[_0x4aed0e[_0x72ba('0x8')]])){utils[_0x72ba('0x18')](util[_0x72ba('0xa')](_0x72ba('0x5f'),_0x4aed0e['uniqueid']),_0x4aed0e);utils[_0x72ba('0x1b')](util[_0x72ba('0xa')](_0x72ba('0x60'),_0x4aed0e[_0x72ba('0x8')],_0x4aed0e[_0x72ba('0x61')],_0x4aed0e[_0x72ba('0x62')]));if(_0x4aed0e['application'][_0x72ba('0x63')]()=='set'&&_['startsWith'](_0x4aed0e[_0x72ba('0x62')]['toLowerCase'](),_0x72ba('0x64'))){var _0xa12f9e=_0x4aed0e[_0x72ba('0x62')][_0x72ba('0x65')]('=');var _0x1b6063=_0xa12f9e[0x0]['substring'](_0xa12f9e[0x0][_0x72ba('0x66')]('(')+0x1,_0xa12f9e[0x0][_0x72ba('0x66')](')'));var _0x3166cd=_0xa12f9e[0x1];channels[_0x4aed0e[_0x72ba('0x8')]][_0x1b6063]=_0x3166cd;}if(!_[_0x72ba('0x67')]([_0x72ba('0x2c'),_0x72ba('0x68'),_0x72ba('0x69'),'set',_0x72ba('0x6a')],_0x4aed0e[_0x72ba('0x61')][_0x72ba('0x63')]())){channels[_0x4aed0e['uniqueid']][_0x72ba('0x54')]=_0x4aed0e[_0x72ba('0x61')];channels[_0x4aed0e[_0x72ba('0x8')]][_0x72ba('0x6b')]=_0x4aed0e[_0x72ba('0x62')];}}}catch(_0x39f5ba){utils[_0x72ba('0x21')](util[_0x72ba('0xa')](_0x72ba('0x5f'),_0x4aed0e[_0x72ba('0x8')]),_0x39f5ba);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index 4f0eb4f..0a3d214 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 _0x5f34=['[core]\x20error','managerevent','connect','info','shutdown','fullybooted','[core]\x20fullybooted','error'];(function(_0x550d12,_0x5384bd){var _0x12103d=function(_0x2a9834){while(--_0x2a9834){_0x550d12['push'](_0x550d12['shift']());}};_0x12103d(++_0x5384bd);}(_0x5f34,0xba));var _0x45f3=function(_0x50b75c,_0x3a0778){_0x50b75c=_0x50b75c-0x0;var _0x496f7b=_0x5f34[_0x50b75c];return _0x496f7b;};'use strict';var utils=require('./utils');exports[_0x45f3('0x0')]=function(){utils[_0x45f3('0x1')]('[core]\x20connected');};exports[_0x45f3('0x2')]=function(){utils['info']('[core]\x20shutdown');};exports[_0x45f3('0x3')]=function(){utils['info'](_0x45f3('0x4'));};exports[_0x45f3('0x5')]=function(_0x1bdce7){utils[_0x45f3('0x5')](_0x45f3('0x6'),_0x1bdce7);};exports['close']=function(){utils[_0x45f3('0x1')]('[core]\x20close');};exports[_0x45f3('0x7')]=function(_0x2ec025){}; \ No newline at end of file +var _0x3eba=['fullybooted','[core]\x20fullybooted','error','managerevent','connect','info','[core]\x20connected','shutdown','[core]\x20shutdown'];(function(_0x20118a,_0x3dbdf3){var _0x538b5f=function(_0x31c5b4){while(--_0x31c5b4){_0x20118a['push'](_0x20118a['shift']());}};_0x538b5f(++_0x3dbdf3);}(_0x3eba,0x70));var _0xa3eb=function(_0x55ae2b,_0xf5da91){_0x55ae2b=_0x55ae2b-0x0;var _0x23d940=_0x3eba[_0x55ae2b];return _0x23d940;};'use strict';var utils=require('./utils');exports[_0xa3eb('0x0')]=function(){utils[_0xa3eb('0x1')](_0xa3eb('0x2'));};exports[_0xa3eb('0x3')]=function(){utils[_0xa3eb('0x1')](_0xa3eb('0x4'));};exports[_0xa3eb('0x5')]=function(){utils['info'](_0xa3eb('0x6'));};exports[_0xa3eb('0x7')]=function(_0x39c600){utils[_0xa3eb('0x7')]('[core]\x20error',_0x39c600);};exports['close']=function(){utils['info']('[core]\x20close');};exports[_0xa3eb('0x8')]=function(_0x4c9858){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index 2063f23..00b1b29 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 _0x02ba=['assign','now','lastevent','called','starttime','[%s][dials][dialbegin]','dialstatus','ANSWER','answertime','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]','calleridname','cause-txt','complete','duration','holdtime','endtime','diffTime','lodash','util','./utils','info','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','calleridnum','request','CreateVoiceDialReport','format','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','toLowerCase','set','appdata','cdr(routeid)','split','error','debug','[%s][dials][varset]','isNil','variable','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','dialbegin'];(function(_0x236906,_0x1c2803){var _0x21199e=function(_0x5eb347){while(--_0x5eb347){_0x236906['push'](_0x236906['shift']());}};_0x21199e(++_0x1c2803);}(_0x02ba,0xef));var _0xa02b=function(_0x44dff8,_0x12c43e){_0x44dff8=_0x44dff8-0x0;var _0x555174=_0x02ba[_0x44dff8];return _0x555174;};'use strict';var _=require(_0xa02b('0x0'));var util=require(_0xa02b('0x1'));var utils=require(_0xa02b('0x2'));var dials={};function writeDB(_0x3d988b){utils[_0xa02b('0x3')](util['format'](_0xa02b('0x4'),_0x3d988b[_0xa02b('0x5')],_0x3d988b[_0xa02b('0x6')],_0x3d988b['dialstring'],_0x3d988b[_0xa02b('0x7')],_0x3d988b['connectedlinenum'],_0x3d988b['dialstatus']));utils[_0xa02b('0x8')](_0xa02b('0x9'),_0x3d988b);delete dials[_0x3d988b[_0xa02b('0x5')]];}exports['newexten']=function(_0x64f6cd){try{utils['debug'](util[_0xa02b('0xa')](_0xa02b('0xb'),_0x64f6cd[_0xa02b('0x5')]),_0x64f6cd);utils[_0xa02b('0x3')](util[_0xa02b('0xa')](_0xa02b('0xc'),_0x64f6cd[_0xa02b('0x5')],_0x64f6cd['application'],_0x64f6cd['appdata']));if(_0x64f6cd['application'][_0xa02b('0xd')]()==_0xa02b('0xe')&&_['startsWith'](_0x64f6cd[_0xa02b('0xf')][_0xa02b('0xd')](),_0xa02b('0x10'))){var _0x4d3abc=_0x64f6cd['appdata'][_0xa02b('0x11')]('=');dials[_0x64f6cd[_0xa02b('0x5')]]={'routeId':_0x4d3abc[0x1]};}}catch(_0x37a521){utils[_0xa02b('0x12')](util[_0xa02b('0xa')]('[%s][dials][newexten]',_0x64f6cd[_0xa02b('0x5')]),_0x37a521);}};exports['varset']=function(_0x4c77ee){try{utils[_0xa02b('0x13')](util['format'](_0xa02b('0x14'),_0x4c77ee[_0xa02b('0x5')]),_0x4c77ee);if(!_[_0xa02b('0x15')](_0x4c77ee[_0xa02b('0x16')]['outboundrouteid'])){utils['info'](util['format'](_0xa02b('0x17'),_0x4c77ee[_0xa02b('0x5')],_0x4c77ee['value']));dials[_0x4c77ee['uniqueid']]={'routeId':_0x4c77ee['value']};}}catch(_0x4255ce){utils[_0xa02b('0x12')](util[_0xa02b('0xa')](_0xa02b('0x14'),_0x4c77ee[_0xa02b('0x5')]),_0x4255ce);}};exports[_0xa02b('0x18')]=function(_0x2a0d51){try{if(!_[_0xa02b('0x15')](dials[_0x2a0d51[_0xa02b('0x5')]])){utils['debug'](util['format']('[%s][dials][dialbegin]',_0x2a0d51[_0xa02b('0x5')]),_0x2a0d51);dials[_0x2a0d51[_0xa02b('0x5')]]=_[_0xa02b('0x19')](dials[_0x2a0d51[_0xa02b('0x5')]],_0x2a0d51);dials[_0x2a0d51[_0xa02b('0x5')]]['starttime']=utils[_0xa02b('0x1a')]();dials[_0x2a0d51[_0xa02b('0x5')]][_0xa02b('0x1b')]=_0xa02b('0x1c');utils[_0xa02b('0x3')](util[_0xa02b('0xa')]('[%s][dials][hangup]\x20starttime:%s\x20lastevent:called',_0x2a0d51['uniqueid'],dials[_0x2a0d51[_0xa02b('0x5')]][_0xa02b('0x1d')]));}}catch(_0x24668c){utils['error'](util['format'](_0xa02b('0x1e'),_0x2a0d51['uniqueid']),_0x24668c);}};exports['dialend']=function(_0x2f719b){try{if(!_[_0xa02b('0x15')](dials[_0x2f719b[_0xa02b('0x5')]])){utils[_0xa02b('0x13')](util[_0xa02b('0xa')]('[%s][dials][dialend]',_0x2f719b[_0xa02b('0x5')]),_0x2f719b);dials[_0x2f719b[_0xa02b('0x5')]][_0xa02b('0x1f')]=_0x2f719b[_0xa02b('0x1f')];if(_0x2f719b[_0xa02b('0x1f')]==_0xa02b('0x20')){dials[_0x2f719b[_0xa02b('0x5')]]=_[_0xa02b('0x19')](dials[_0x2f719b[_0xa02b('0x5')]],_0x2f719b);dials[_0x2f719b[_0xa02b('0x5')]][_0xa02b('0x21')]=utils[_0xa02b('0x1a')]();dials[_0x2f719b[_0xa02b('0x5')]][_0xa02b('0x1b')]='connect';utils[_0xa02b('0x3')](util[_0xa02b('0xa')]('[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect',_0x2f719b[_0xa02b('0x5')],_0x2f719b[_0xa02b('0x1f')],dials[_0x2f719b['uniqueid']]['answertime']));}else{utils[_0xa02b('0x3')](util[_0xa02b('0xa')](_0xa02b('0x22'),_0x2f719b[_0xa02b('0x5')],_0x2f719b['dialstatus']));}}}catch(_0x49ca2e){utils['error'](util[_0xa02b('0xa')]('[%s][dials][dialend]',_0x2f719b[_0xa02b('0x5')]),_0x49ca2e);}};exports[_0xa02b('0x23')]=function(_0x1e6aa7){try{if(!_[_0xa02b('0x15')](dials[_0x1e6aa7['uniqueid']])){utils[_0xa02b('0x13')](util[_0xa02b('0xa')](_0xa02b('0x24'),_0x1e6aa7[_0xa02b('0x5')]),_0x1e6aa7);utils[_0xa02b('0x3')](util[_0xa02b('0xa')]('[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s',_0x1e6aa7[_0xa02b('0x5')],_0x1e6aa7[_0xa02b('0x7')],_0x1e6aa7[_0xa02b('0x25')],_0x1e6aa7[_0xa02b('0x26')]));dials[_0x1e6aa7[_0xa02b('0x5')]]=_[_0xa02b('0x19')](dials[_0x1e6aa7['uniqueid']],{'endtime':utils[_0xa02b('0x1a')](),'lastevent':_0xa02b('0x27')});dials[_0x1e6aa7[_0xa02b('0x5')]][_0xa02b('0x28')]=utils['diffTime'](dials[_0x1e6aa7[_0xa02b('0x5')]]['endtime'],dials[_0x1e6aa7['uniqueid']]['starttime']);dials[_0x1e6aa7[_0xa02b('0x5')]][_0xa02b('0x29')]=utils['diffTime'](dials[_0x1e6aa7[_0xa02b('0x5')]][_0xa02b('0x21')]||dials[_0x1e6aa7[_0xa02b('0x5')]][_0xa02b('0x2a')],dials[_0x1e6aa7['uniqueid']][_0xa02b('0x1d')]);dials[_0x1e6aa7[_0xa02b('0x5')]]['billableseconds']=dials[_0x1e6aa7[_0xa02b('0x5')]][_0xa02b('0x21')]?utils[_0xa02b('0x2b')](dials[_0x1e6aa7['uniqueid']][_0xa02b('0x2a')],dials[_0x1e6aa7[_0xa02b('0x5')]][_0xa02b('0x21')]):0x0;writeDB(dials[_0x1e6aa7[_0xa02b('0x5')]]);}}catch(_0x59d6ac){utils[_0xa02b('0x12')](util[_0xa02b('0xa')]('[%s][dials][hangup]',_0x1e6aa7['uniqueid']),_0x59d6ac);}}; \ No newline at end of file +var _0x6a4c=['diffTime','endtime','holdtime','billableseconds','lodash','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','calleridnum','connectedlinenum','CreateVoiceDialReport','newexten','debug','format','[%s][dials][newexten]','info','application','appdata','set','startsWith','cdr(routeid)','split','[%s][dials][varset]','isNil','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','error','dialbegin','assign','starttime','now','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','[%s][dials][dialbegin]','dialend','[%s][dials][dialend]','dialstatus','ANSWER','answertime','connect','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]','cause-txt','complete'];(function(_0x2b5eae,_0x55010d){var _0x5f3ac9=function(_0x397bfc){while(--_0x397bfc){_0x2b5eae['push'](_0x2b5eae['shift']());}};_0x5f3ac9(++_0x55010d);}(_0x6a4c,0x94));var _0xc6a4=function(_0x41ca7c,_0xdd8d75){_0x41ca7c=_0x41ca7c-0x0;var _0x291695=_0x6a4c[_0x41ca7c];return _0x291695;};'use strict';var _=require(_0xc6a4('0x0'));var util=require('util');var utils=require('./utils');var dials={};function writeDB(_0xcaafc5){utils['info'](util['format'](_0xc6a4('0x1'),_0xcaafc5[_0xc6a4('0x2')],_0xcaafc5[_0xc6a4('0x3')],_0xcaafc5['dialstring'],_0xcaafc5[_0xc6a4('0x4')],_0xcaafc5[_0xc6a4('0x5')],_0xcaafc5['dialstatus']));utils['request'](_0xc6a4('0x6'),_0xcaafc5);delete dials[_0xcaafc5[_0xc6a4('0x2')]];}exports[_0xc6a4('0x7')]=function(_0x33e1b5){try{utils[_0xc6a4('0x8')](util[_0xc6a4('0x9')](_0xc6a4('0xa'),_0x33e1b5[_0xc6a4('0x2')]),_0x33e1b5);utils[_0xc6a4('0xb')](util[_0xc6a4('0x9')]('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0x33e1b5[_0xc6a4('0x2')],_0x33e1b5[_0xc6a4('0xc')],_0x33e1b5[_0xc6a4('0xd')]));if(_0x33e1b5[_0xc6a4('0xc')]['toLowerCase']()==_0xc6a4('0xe')&&_[_0xc6a4('0xf')](_0x33e1b5[_0xc6a4('0xd')]['toLowerCase'](),_0xc6a4('0x10'))){var _0x1eec5e=_0x33e1b5[_0xc6a4('0xd')][_0xc6a4('0x11')]('=');dials[_0x33e1b5[_0xc6a4('0x2')]]={'routeId':_0x1eec5e[0x1]};}}catch(_0x3aff43){utils['error'](util['format'](_0xc6a4('0xa'),_0x33e1b5[_0xc6a4('0x2')]),_0x3aff43);}};exports['varset']=function(_0x2fe7a0){try{utils['debug'](util[_0xc6a4('0x9')](_0xc6a4('0x12'),_0x2fe7a0[_0xc6a4('0x2')]),_0x2fe7a0);if(!_[_0xc6a4('0x13')](_0x2fe7a0[_0xc6a4('0x14')][_0xc6a4('0x15')])){utils['info'](util[_0xc6a4('0x9')](_0xc6a4('0x16'),_0x2fe7a0[_0xc6a4('0x2')],_0x2fe7a0[_0xc6a4('0x17')]));dials[_0x2fe7a0['uniqueid']]={'routeId':_0x2fe7a0['value']};}}catch(_0x3fad59){utils[_0xc6a4('0x18')](util[_0xc6a4('0x9')](_0xc6a4('0x12'),_0x2fe7a0[_0xc6a4('0x2')]),_0x3fad59);}};exports[_0xc6a4('0x19')]=function(_0x4a7f5b){try{if(!_[_0xc6a4('0x13')](dials[_0x4a7f5b[_0xc6a4('0x2')]])){utils[_0xc6a4('0x8')](util[_0xc6a4('0x9')]('[%s][dials][dialbegin]',_0x4a7f5b[_0xc6a4('0x2')]),_0x4a7f5b);dials[_0x4a7f5b['uniqueid']]=_[_0xc6a4('0x1a')](dials[_0x4a7f5b[_0xc6a4('0x2')]],_0x4a7f5b);dials[_0x4a7f5b[_0xc6a4('0x2')]][_0xc6a4('0x1b')]=utils[_0xc6a4('0x1c')]();dials[_0x4a7f5b[_0xc6a4('0x2')]][_0xc6a4('0x1d')]=_0xc6a4('0x1e');utils[_0xc6a4('0xb')](util[_0xc6a4('0x9')](_0xc6a4('0x1f'),_0x4a7f5b['uniqueid'],dials[_0x4a7f5b['uniqueid']]['starttime']));}}catch(_0x242d0a){utils[_0xc6a4('0x18')](util[_0xc6a4('0x9')](_0xc6a4('0x20'),_0x4a7f5b[_0xc6a4('0x2')]),_0x242d0a);}};exports[_0xc6a4('0x21')]=function(_0xd82a95){try{if(!_['isNil'](dials[_0xd82a95[_0xc6a4('0x2')]])){utils[_0xc6a4('0x8')](util[_0xc6a4('0x9')](_0xc6a4('0x22'),_0xd82a95['uniqueid']),_0xd82a95);dials[_0xd82a95['uniqueid']][_0xc6a4('0x23')]=_0xd82a95['dialstatus'];if(_0xd82a95[_0xc6a4('0x23')]==_0xc6a4('0x24')){dials[_0xd82a95[_0xc6a4('0x2')]]=_['assign'](dials[_0xd82a95[_0xc6a4('0x2')]],_0xd82a95);dials[_0xd82a95['uniqueid']][_0xc6a4('0x25')]=utils[_0xc6a4('0x1c')]();dials[_0xd82a95[_0xc6a4('0x2')]][_0xc6a4('0x1d')]=_0xc6a4('0x26');utils['info'](util[_0xc6a4('0x9')]('[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect',_0xd82a95[_0xc6a4('0x2')],_0xd82a95['dialstatus'],dials[_0xd82a95[_0xc6a4('0x2')]][_0xc6a4('0x25')]));}else{utils['info'](util[_0xc6a4('0x9')](_0xc6a4('0x27'),_0xd82a95['uniqueid'],_0xd82a95[_0xc6a4('0x23')]));}}}catch(_0x1eaeea){utils[_0xc6a4('0x18')](util[_0xc6a4('0x9')](_0xc6a4('0x22'),_0xd82a95[_0xc6a4('0x2')]),_0x1eaeea);}};exports[_0xc6a4('0x28')]=function(_0xe3e6ac){try{if(!_[_0xc6a4('0x13')](dials[_0xe3e6ac['uniqueid']])){utils[_0xc6a4('0x8')](util[_0xc6a4('0x9')](_0xc6a4('0x29'),_0xe3e6ac[_0xc6a4('0x2')]),_0xe3e6ac);utils['info'](util[_0xc6a4('0x9')]('[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s',_0xe3e6ac[_0xc6a4('0x2')],_0xe3e6ac['calleridnum'],_0xe3e6ac['calleridname'],_0xe3e6ac[_0xc6a4('0x2a')]));dials[_0xe3e6ac['uniqueid']]=_[_0xc6a4('0x1a')](dials[_0xe3e6ac[_0xc6a4('0x2')]],{'endtime':utils[_0xc6a4('0x1c')](),'lastevent':_0xc6a4('0x2b')});dials[_0xe3e6ac[_0xc6a4('0x2')]]['duration']=utils[_0xc6a4('0x2c')](dials[_0xe3e6ac[_0xc6a4('0x2')]][_0xc6a4('0x2d')],dials[_0xe3e6ac[_0xc6a4('0x2')]][_0xc6a4('0x1b')]);dials[_0xe3e6ac[_0xc6a4('0x2')]][_0xc6a4('0x2e')]=utils['diffTime'](dials[_0xe3e6ac[_0xc6a4('0x2')]][_0xc6a4('0x25')]||dials[_0xe3e6ac['uniqueid']]['endtime'],dials[_0xe3e6ac['uniqueid']][_0xc6a4('0x1b')]);dials[_0xe3e6ac[_0xc6a4('0x2')]][_0xc6a4('0x2f')]=dials[_0xe3e6ac[_0xc6a4('0x2')]]['answertime']?utils[_0xc6a4('0x2c')](dials[_0xe3e6ac[_0xc6a4('0x2')]]['endtime'],dials[_0xe3e6ac[_0xc6a4('0x2')]]['answertime']):0x0;writeDB(dials[_0xe3e6ac[_0xc6a4('0x2')]]);}}catch(_0x2e74ad){utils[_0xc6a4('0x18')](util[_0xc6a4('0x9')](_0xc6a4('0x29'),_0xe3e6ac[_0xc6a4('0x2')]),_0x2e74ad);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 0e89edb..9d82652 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 _0x5389=['[%s][index][dialend]','asterisk-manager','../../config/environment','./utils','util','asterisk','port','username','keepConnected','xdr','disabled','info','./agents.controller','./calls.controller','./queues.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','format','[%s][index][devicestatechange]','device','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','[%s][index][hangup]','hangup','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','[%s][index][attendedtransfer]','attendedtransfer','origtransfereruniqueid','varset','[%s][index][varset]','newexten','newchannel','[%s][index][newchannel]','dialbegin','dialend'];(function(_0x5c4f6b,_0x2cdfce){var _0x104c4e=function(_0x31171b){while(--_0x31171b){_0x5c4f6b['push'](_0x5c4f6b['shift']());}};_0x104c4e(++_0x2cdfce);}(_0x5389,0x10d));var _0x9538=function(_0x28d9e5,_0x4ae860){_0x28d9e5=_0x28d9e5-0x0;var _0x434426=_0x5389[_0x28d9e5];return _0x434426;};var AsteriskManager=require(_0x9538('0x0'));var config=require(_0x9538('0x1'));var utils=require(_0x9538('0x2'));var util=require(_0x9538('0x3'));var ami=new AsteriskManager(config[_0x9538('0x4')][_0x9538('0x5')],config['asterisk']['ip'],config[_0x9538('0x4')][_0x9538('0x6')],config[_0x9538('0x4')]['password'],!![]);ami[_0x9538('0x7')]();if(config[_0x9538('0x8')]&&config[_0x9538('0x8')][_0x9538('0x9')]){utils[_0x9538('0xa')]('XDR\x20DISABLED');}else{var agents=require(_0x9538('0xb'));var calls=require(_0x9538('0xc'));var queues=require(_0x9538('0xd'));var recordings=require(_0x9538('0xe'));var members=require(_0x9538('0xf'));var dials=require(_0x9538('0x10'));var transfers=require(_0x9538('0x11'));var core=require(_0x9538('0x12'));ami['on'](_0x9538('0x13'),core[_0x9538('0x13')]);ami['on']('shutdown',core[_0x9538('0x14')]);ami['on'](_0x9538('0x15'),core[_0x9538('0x15')]);ami['on'](_0x9538('0x16'),core[_0x9538('0x16')]);ami['on'](_0x9538('0x17'),core[_0x9538('0x17')]);ami['on'](_0x9538('0x18'),core[_0x9538('0x18')]);ami['on'](_0x9538('0x19'),function(_0x30f64e){try{utils[_0x9538('0x1a')](util[_0x9538('0x1b')](_0x9538('0x1c'),_0x30f64e[_0x9538('0x1d')]),_0x30f64e);members[_0x9538('0x19')](_0x30f64e);}catch(_0x2ea85a){utils['error'](util['format'](_0x9538('0x1c'),_0x30f64e[_0x9538('0x1d')]),_0x2ea85a);}});ami['on']('agentcalled',function(_0x183629){try{utils[_0x9538('0x1a')](util['format'](_0x9538('0x1e'),_0x183629[_0x9538('0x1f')]),_0x183629);agents['agentcalled'](_0x183629);}catch(_0x10f134){utils[_0x9538('0x16')](util[_0x9538('0x1b')](_0x9538('0x1e'),_0x183629[_0x9538('0x1f')]),_0x10f134);}});ami['on'](_0x9538('0x20'),function(_0x56a2d3){try{utils['debug'](util[_0x9538('0x1b')](_0x9538('0x21'),_0x56a2d3[_0x9538('0x1f')]),_0x56a2d3);agents[_0x9538('0x20')](_0x56a2d3);}catch(_0x4b0aa0){utils[_0x9538('0x16')](util['format'](_0x9538('0x21'),_0x56a2d3[_0x9538('0x1f')]),_0x4b0aa0);}});ami['on'](_0x9538('0x22'),function(_0x1c1e50){try{utils['debug'](util[_0x9538('0x1b')](_0x9538('0x23'),_0x1c1e50[_0x9538('0x1f')]),_0x1c1e50);agents[_0x9538('0x22')](_0x1c1e50);queues['agentconnect'](_0x1c1e50);}catch(_0x542e07){utils['error'](util[_0x9538('0x1b')]('[%s][index][agentconnect]',_0x1c1e50[_0x9538('0x1f')]),_0x542e07);}});ami['on'](_0x9538('0x24'),function(_0x4e13a5){try{utils['debug'](util[_0x9538('0x1b')]('[%s][index][agentcomplete]',_0x4e13a5[_0x9538('0x1f')]),_0x4e13a5);agents[_0x9538('0x24')](_0x4e13a5);queues[_0x9538('0x24')](_0x4e13a5);members['agentcomplete'](_0x4e13a5);}catch(_0x424412){utils[_0x9538('0x16')](util[_0x9538('0x1b')](_0x9538('0x25'),_0x4e13a5[_0x9538('0x1f')]),_0x424412);}});ami['on'](_0x9538('0x26'),function(_0xeff950){try{utils['debug'](util[_0x9538('0x1b')](_0x9538('0x27'),_0xeff950[_0x9538('0x1f')]),_0xeff950);agents[_0x9538('0x26')](_0xeff950);queues['queuecallerabandon'](_0xeff950);}catch(_0x599548){utils[_0x9538('0x16')](util[_0x9538('0x1b')](_0x9538('0x27'),_0xeff950[_0x9538('0x1f')]),_0x599548);}});ami['on'](_0x9538('0x28'),function(_0x30fb0c){try{utils[_0x9538('0x1a')](util[_0x9538('0x1b')](_0x9538('0x29'),_0x30fb0c['uniqueid']),_0x30fb0c);queues[_0x9538('0x28')](_0x30fb0c);recordings[_0x9538('0x28')](_0x30fb0c);}catch(_0x87928d){utils['error'](util[_0x9538('0x1b')](_0x9538('0x29'),_0x30fb0c[_0x9538('0x1f')]),_0x87928d);}});ami['on'](_0x9538('0x2a'),function(_0x5743d9){try{utils[_0x9538('0x1a')](util['format'](_0x9538('0x2b'),_0x5743d9['uniqueid']),_0x5743d9);queues['queuecallerleave'](_0x5743d9);}catch(_0x4ac2ce){utils[_0x9538('0x16')](util[_0x9538('0x1b')](_0x9538('0x2b'),_0x5743d9[_0x9538('0x1f')]),_0x4ac2ce);}});ami['on'](_0x9538('0x2c'),function(_0x466ff0){try{utils[_0x9538('0x1a')](util['format'](_0x9538('0x2d'),_0x466ff0[_0x9538('0x1f')]),_0x466ff0);queues[_0x9538('0x2c')](_0x466ff0);calls[_0x9538('0x2c')](_0x466ff0);}catch(_0xe3a9c4){utils[_0x9538('0x16')](util[_0x9538('0x1b')](_0x9538('0x2d'),_0x466ff0[_0x9538('0x1f')]),_0xe3a9c4);}});ami['on'](_0x9538('0x2e'),function(_0x367255){try{utils[_0x9538('0x1a')](util['format'](_0x9538('0x2f'),_0x367255[_0x9538('0x1f')]),_0x367255);queues['musiconholdstop'](_0x367255);calls[_0x9538('0x2e')](_0x367255);}catch(_0x59c626){utils[_0x9538('0x16')](util[_0x9538('0x1b')]('[%s][index][musiconholdstop]',_0x367255['uniqueid']),_0x59c626);}});ami['on'](_0x9538('0x30'),function(_0x2510a8){try{utils['debug'](util[_0x9538('0x1b')]('[%s][index][newstate]',_0x2510a8[_0x9538('0x1f')]),_0x2510a8);calls['newstate'](_0x2510a8);recordings[_0x9538('0x30')](_0x2510a8);}catch(_0x577e13){utils['error'](util[_0x9538('0x1b')](_0x9538('0x31'),_0x2510a8['uniqueid']),_0x577e13);}});ami['on']('hangup',function(_0x31af21){try{utils[_0x9538('0x1a')](util[_0x9538('0x1b')](_0x9538('0x32'),_0x31af21[_0x9538('0x1f')]),_0x31af21);calls[_0x9538('0x33')](_0x31af21);recordings[_0x9538('0x33')](_0x31af21);dials[_0x9538('0x33')](_0x31af21);agents[_0x9538('0x33')](_0x31af21);queues[_0x9538('0x33')](_0x31af21);}catch(_0x284320){utils[_0x9538('0x16')](util[_0x9538('0x1b')]('[%s][index][hangup]',_0x31af21['uniqueid']),_0x284320);}});ami['on'](_0x9538('0x34'),function(_0x13e137){try{utils['debug'](util['format'](_0x9538('0x35'),_0x13e137[_0x9538('0x1f')]),_0x13e137);members[_0x9538('0x34')](_0x13e137);}catch(_0x5d3859){utils[_0x9538('0x16')](util['format']('[%s][index][cdr]',_0x13e137[_0x9538('0x1f')]),_0x5d3859);}});ami['on'](_0x9538('0x36'),function(_0x1132a3){try{utils[_0x9538('0x1a')](util['format']('[%s][index][blindtransfer]',_0x1132a3[_0x9538('0x1f')]),_0x1132a3);queues[_0x9538('0x36')](_0x1132a3);agents[_0x9538('0x36')](_0x1132a3);transfers[_0x9538('0x36')](_0x1132a3);}catch(_0x5502f5){utils['error'](util[_0x9538('0x1b')](_0x9538('0x37'),_0x1132a3[_0x9538('0x1f')]),_0x5502f5);}});ami['on']('attendedtransfer',function(_0x3e2b7f){try{utils[_0x9538('0x1a')](util[_0x9538('0x1b')](_0x9538('0x38'),_0x3e2b7f['origtransfereruniqueid']),_0x3e2b7f);queues['attendedtransfer'](_0x3e2b7f);transfers[_0x9538('0x39')](_0x3e2b7f);agents['attendedtransfer'](_0x3e2b7f);calls['attendedtransfer'](_0x3e2b7f);}catch(_0x10708c){utils['error'](util[_0x9538('0x1b')]('[%s][index][attendedtransfer]',_0x3e2b7f[_0x9538('0x3a')]),_0x10708c);}});ami['on'](_0x9538('0x3b'),function(_0x2805a6){try{utils[_0x9538('0x1a')](util[_0x9538('0x1b')](_0x9538('0x3c'),_0x2805a6[_0x9538('0x1f')]),_0x2805a6);queues[_0x9538('0x3b')](_0x2805a6);recordings[_0x9538('0x3b')](_0x2805a6);calls[_0x9538('0x3b')](_0x2805a6);dials[_0x9538('0x3b')](_0x2805a6);}catch(_0x509f9b){utils[_0x9538('0x16')](util['format'](_0x9538('0x3c'),_0x2805a6[_0x9538('0x1f')]),_0x509f9b);}});ami['on'](_0x9538('0x3d'),function(_0x3249b5){try{utils[_0x9538('0x1a')](util[_0x9538('0x1b')]('[%s][index][newexten]',_0x3249b5[_0x9538('0x1f')]),_0x3249b5);calls[_0x9538('0x3d')](_0x3249b5);recordings['newexten'](_0x3249b5);dials[_0x9538('0x3d')](_0x3249b5);}catch(_0x442290){utils[_0x9538('0x16')](util[_0x9538('0x1b')]('[%s][index][newexten]',_0x3249b5[_0x9538('0x1f')]),_0x442290);}});ami['on'](_0x9538('0x3e'),function(_0x5744ea){try{utils['debug'](util[_0x9538('0x1b')](_0x9538('0x3f'),_0x5744ea[_0x9538('0x1f')]),_0x5744ea);calls[_0x9538('0x3e')](_0x5744ea);recordings[_0x9538('0x3e')](_0x5744ea);}catch(_0x451d92){utils[_0x9538('0x16')](util[_0x9538('0x1b')](_0x9538('0x3f'),_0x5744ea[_0x9538('0x1f')]),_0x451d92);}});ami['on'](_0x9538('0x40'),function(_0x4115a5){try{utils[_0x9538('0x1a')](util[_0x9538('0x1b')]('[%s][index][dialbegin]',_0x4115a5['uniqueid']),_0x4115a5);dials['dialbegin'](_0x4115a5);}catch(_0xa7594f){utils[_0x9538('0x16')](util['format']('[%s]dialbegin',_0x4115a5['uniqueid']),_0xa7594f);}});ami['on'](_0x9538('0x41'),function(_0x4e3730){try{utils['debug'](util[_0x9538('0x1b')](_0x9538('0x42'),_0x4e3730[_0x9538('0x1f')]),_0x4e3730);dials['dialend'](_0x4e3730);}catch(_0x234178){utils[_0x9538('0x16')](util[_0x9538('0x1b')]('[%s][index][dialend]',_0x4e3730['uniqueid']),_0x234178);}});} \ No newline at end of file +var _0x79d9=['close','managerevent','devicestatechange','debug','format','device','[%s][index][devicestatechange]','agentcalled','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','[%s][index][queuecallerabandon]','queuecallerabandon','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','[%s][index][hangup]','hangup','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','[%s][index][attendedtransfer]','origtransfereruniqueid','attendedtransfer','varset','[%s][index][varset]','newexten','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','dialend','[%s][index][dialend]','./utils','util','asterisk','username','password','keepConnected','xdr','info','XDR\x20DISABLED','./calls.controller','./queues.controller','./recordings.controller','./members.controller','./dials.controller','./core.controller','connect','shutdown','fullybooted','error'];(function(_0x1ccdf7,_0x215d5a){var _0x52a0ae=function(_0x40324a){while(--_0x40324a){_0x1ccdf7['push'](_0x1ccdf7['shift']());}};_0x52a0ae(++_0x215d5a);}(_0x79d9,0xb3));var _0x979d=function(_0x1a16fc,_0x7524be){_0x1a16fc=_0x1a16fc-0x0;var _0x25ce8f=_0x79d9[_0x1a16fc];return _0x25ce8f;};var AsteriskManager=require('asterisk-manager');var config=require('../../config/environment');var utils=require(_0x979d('0x0'));var util=require(_0x979d('0x1'));var ami=new AsteriskManager(config[_0x979d('0x2')]['port'],config[_0x979d('0x2')]['ip'],config['asterisk'][_0x979d('0x3')],config['asterisk'][_0x979d('0x4')],!![]);ami[_0x979d('0x5')]();if(config['xdr']&&config[_0x979d('0x6')]['disabled']){utils[_0x979d('0x7')](_0x979d('0x8'));}else{var agents=require('./agents.controller');var calls=require(_0x979d('0x9'));var queues=require(_0x979d('0xa'));var recordings=require(_0x979d('0xb'));var members=require(_0x979d('0xc'));var dials=require(_0x979d('0xd'));var transfers=require('./transfers.controller');var core=require(_0x979d('0xe'));ami['on'](_0x979d('0xf'),core[_0x979d('0xf')]);ami['on'](_0x979d('0x10'),core['shutdown']);ami['on']('fullybooted',core[_0x979d('0x11')]);ami['on'](_0x979d('0x12'),core[_0x979d('0x12')]);ami['on']('close',core[_0x979d('0x13')]);ami['on'](_0x979d('0x14'),core[_0x979d('0x14')]);ami['on'](_0x979d('0x15'),function(_0x2927ae){try{utils[_0x979d('0x16')](util[_0x979d('0x17')]('[%s][index][devicestatechange]',_0x2927ae[_0x979d('0x18')]),_0x2927ae);members[_0x979d('0x15')](_0x2927ae);}catch(_0x3c06d2){utils[_0x979d('0x12')](util[_0x979d('0x17')](_0x979d('0x19'),_0x2927ae[_0x979d('0x18')]),_0x3c06d2);}});ami['on'](_0x979d('0x1a'),function(_0x3d3a65){try{utils[_0x979d('0x16')](util[_0x979d('0x17')](_0x979d('0x1b'),_0x3d3a65[_0x979d('0x1c')]),_0x3d3a65);agents[_0x979d('0x1a')](_0x3d3a65);}catch(_0x459eaf){utils['error'](util[_0x979d('0x17')](_0x979d('0x1b'),_0x3d3a65[_0x979d('0x1c')]),_0x459eaf);}});ami['on'](_0x979d('0x1d'),function(_0x2cff2f){try{utils[_0x979d('0x16')](util[_0x979d('0x17')](_0x979d('0x1e'),_0x2cff2f[_0x979d('0x1c')]),_0x2cff2f);agents[_0x979d('0x1d')](_0x2cff2f);}catch(_0x193648){utils['error'](util[_0x979d('0x17')](_0x979d('0x1e'),_0x2cff2f[_0x979d('0x1c')]),_0x193648);}});ami['on'](_0x979d('0x1f'),function(_0x5d0463){try{utils[_0x979d('0x16')](util[_0x979d('0x17')](_0x979d('0x20'),_0x5d0463[_0x979d('0x1c')]),_0x5d0463);agents[_0x979d('0x1f')](_0x5d0463);queues[_0x979d('0x1f')](_0x5d0463);}catch(_0x30ce83){utils[_0x979d('0x12')](util[_0x979d('0x17')](_0x979d('0x20'),_0x5d0463[_0x979d('0x1c')]),_0x30ce83);}});ami['on'](_0x979d('0x21'),function(_0x33a494){try{utils[_0x979d('0x16')](util[_0x979d('0x17')]('[%s][index][agentcomplete]',_0x33a494[_0x979d('0x1c')]),_0x33a494);agents[_0x979d('0x21')](_0x33a494);queues[_0x979d('0x21')](_0x33a494);members[_0x979d('0x21')](_0x33a494);}catch(_0x26d4c5){utils[_0x979d('0x12')](util[_0x979d('0x17')](_0x979d('0x22'),_0x33a494[_0x979d('0x1c')]),_0x26d4c5);}});ami['on']('queuecallerabandon',function(_0x2f4757){try{utils[_0x979d('0x16')](util['format'](_0x979d('0x23'),_0x2f4757[_0x979d('0x1c')]),_0x2f4757);agents[_0x979d('0x24')](_0x2f4757);queues[_0x979d('0x24')](_0x2f4757);}catch(_0x3bdc15){utils[_0x979d('0x12')](util['format']('[%s][index][queuecallerabandon]',_0x2f4757[_0x979d('0x1c')]),_0x3bdc15);}});ami['on'](_0x979d('0x25'),function(_0x4964c6){try{utils[_0x979d('0x16')](util[_0x979d('0x17')](_0x979d('0x26'),_0x4964c6[_0x979d('0x1c')]),_0x4964c6);queues[_0x979d('0x25')](_0x4964c6);recordings[_0x979d('0x25')](_0x4964c6);}catch(_0x42d031){utils[_0x979d('0x12')](util[_0x979d('0x17')](_0x979d('0x26'),_0x4964c6[_0x979d('0x1c')]),_0x42d031);}});ami['on'](_0x979d('0x27'),function(_0x16ef5e){try{utils[_0x979d('0x16')](util[_0x979d('0x17')](_0x979d('0x28'),_0x16ef5e[_0x979d('0x1c')]),_0x16ef5e);queues[_0x979d('0x27')](_0x16ef5e);}catch(_0x627c96){utils[_0x979d('0x12')](util[_0x979d('0x17')](_0x979d('0x28'),_0x16ef5e[_0x979d('0x1c')]),_0x627c96);}});ami['on'](_0x979d('0x29'),function(_0x4b6137){try{utils['debug'](util[_0x979d('0x17')](_0x979d('0x2a'),_0x4b6137['uniqueid']),_0x4b6137);queues[_0x979d('0x29')](_0x4b6137);calls['musiconholdstart'](_0x4b6137);}catch(_0x144774){utils['error'](util[_0x979d('0x17')](_0x979d('0x2a'),_0x4b6137[_0x979d('0x1c')]),_0x144774);}});ami['on'](_0x979d('0x2b'),function(_0x16ea85){try{utils[_0x979d('0x16')](util[_0x979d('0x17')](_0x979d('0x2c'),_0x16ea85[_0x979d('0x1c')]),_0x16ea85);queues[_0x979d('0x2b')](_0x16ea85);calls[_0x979d('0x2b')](_0x16ea85);}catch(_0x4fda67){utils[_0x979d('0x12')](util[_0x979d('0x17')](_0x979d('0x2c'),_0x16ea85[_0x979d('0x1c')]),_0x4fda67);}});ami['on'](_0x979d('0x2d'),function(_0x415a6a){try{utils[_0x979d('0x16')](util['format']('[%s][index][newstate]',_0x415a6a[_0x979d('0x1c')]),_0x415a6a);calls['newstate'](_0x415a6a);recordings[_0x979d('0x2d')](_0x415a6a);}catch(_0x1d82f7){utils[_0x979d('0x12')](util[_0x979d('0x17')](_0x979d('0x2e'),_0x415a6a[_0x979d('0x1c')]),_0x1d82f7);}});ami['on']('hangup',function(_0x39be84){try{utils[_0x979d('0x16')](util[_0x979d('0x17')](_0x979d('0x2f'),_0x39be84[_0x979d('0x1c')]),_0x39be84);calls['hangup'](_0x39be84);recordings[_0x979d('0x30')](_0x39be84);dials[_0x979d('0x30')](_0x39be84);agents[_0x979d('0x30')](_0x39be84);queues[_0x979d('0x30')](_0x39be84);}catch(_0x5a7298){utils['error'](util[_0x979d('0x17')]('[%s][index][hangup]',_0x39be84[_0x979d('0x1c')]),_0x5a7298);}});ami['on'](_0x979d('0x31'),function(_0x27795e){try{utils[_0x979d('0x16')](util[_0x979d('0x17')](_0x979d('0x32'),_0x27795e[_0x979d('0x1c')]),_0x27795e);members[_0x979d('0x31')](_0x27795e);}catch(_0x47f52c){utils[_0x979d('0x12')](util[_0x979d('0x17')]('[%s][index][cdr]',_0x27795e[_0x979d('0x1c')]),_0x47f52c);}});ami['on'](_0x979d('0x33'),function(_0x4d265b){try{utils['debug'](util[_0x979d('0x17')](_0x979d('0x34'),_0x4d265b[_0x979d('0x1c')]),_0x4d265b);queues['blindtransfer'](_0x4d265b);agents[_0x979d('0x33')](_0x4d265b);transfers[_0x979d('0x33')](_0x4d265b);}catch(_0x1903c0){utils[_0x979d('0x12')](util[_0x979d('0x17')](_0x979d('0x34'),_0x4d265b[_0x979d('0x1c')]),_0x1903c0);}});ami['on']('attendedtransfer',function(_0x5cf897){try{utils[_0x979d('0x16')](util['format'](_0x979d('0x35'),_0x5cf897[_0x979d('0x36')]),_0x5cf897);queues[_0x979d('0x37')](_0x5cf897);transfers[_0x979d('0x37')](_0x5cf897);agents[_0x979d('0x37')](_0x5cf897);calls[_0x979d('0x37')](_0x5cf897);}catch(_0x5414b1){utils[_0x979d('0x12')](util[_0x979d('0x17')]('[%s][index][attendedtransfer]',_0x5cf897[_0x979d('0x36')]),_0x5414b1);}});ami['on'](_0x979d('0x38'),function(_0x428595){try{utils['debug'](util[_0x979d('0x17')](_0x979d('0x39'),_0x428595[_0x979d('0x1c')]),_0x428595);queues[_0x979d('0x38')](_0x428595);recordings['varset'](_0x428595);calls['varset'](_0x428595);dials['varset'](_0x428595);}catch(_0x26d861){utils[_0x979d('0x12')](util['format'](_0x979d('0x39'),_0x428595['uniqueid']),_0x26d861);}});ami['on']('newexten',function(_0x5b4096){try{utils[_0x979d('0x16')](util['format']('[%s][index][newexten]',_0x5b4096['uniqueid']),_0x5b4096);calls[_0x979d('0x3a')](_0x5b4096);recordings[_0x979d('0x3a')](_0x5b4096);dials[_0x979d('0x3a')](_0x5b4096);}catch(_0x3c92f8){utils[_0x979d('0x12')](util['format']('[%s][index][newexten]',_0x5b4096[_0x979d('0x1c')]),_0x3c92f8);}});ami['on'](_0x979d('0x3b'),function(_0x569469){try{utils[_0x979d('0x16')](util[_0x979d('0x17')](_0x979d('0x3c'),_0x569469['uniqueid']),_0x569469);calls[_0x979d('0x3b')](_0x569469);recordings[_0x979d('0x3b')](_0x569469);}catch(_0x9cd6){utils[_0x979d('0x12')](util[_0x979d('0x17')](_0x979d('0x3c'),_0x569469['uniqueid']),_0x9cd6);}});ami['on'](_0x979d('0x3d'),function(_0x5d04ef){try{utils['debug'](util['format'](_0x979d('0x3e'),_0x5d04ef['uniqueid']),_0x5d04ef);dials[_0x979d('0x3d')](_0x5d04ef);}catch(_0x10fb7a){utils['error'](util['format'](_0x979d('0x3f'),_0x5d04ef[_0x979d('0x1c')]),_0x10fb7a);}});ami['on']('dialend',function(_0x34c23f){try{utils['debug'](util[_0x979d('0x17')]('[%s][index][dialend]',_0x34c23f['uniqueid']),_0x34c23f);dials[_0x979d('0x40')](_0x34c23f);}catch(_0x368ea7){utils['error'](util[_0x979d('0x17')](_0x979d('0x41'),_0x34c23f[_0x979d('0x1c')]),_0x368ea7);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 28b0c23..be5925d 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 _0x23c5=['agent','NOT_INUSE','isNil','exitAt','duration','diffTime','enterAt','agentcomplete','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','cdr','[%s][members][cdr]','split','data1','data2','source','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','lodash','util','./utils','Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','channel','membername','type','getUserByInterface','then','name','internal','request','getUserByName','CreateMemberReport','catch','error','some','startsWith','devicestatechange','debug','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','voice','TALKING','now'];(function(_0xda5bd3,_0x1399a2){var _0x558bea=function(_0x5b15e2){while(--_0x5b15e2){_0xda5bd3['push'](_0xda5bd3['shift']());}};_0x558bea(++_0x1399a2);}(_0x23c5,0x128));var _0x523c=function(_0x2d0e60,_0x4ab98f){_0x2d0e60=_0x2d0e60-0x0;var _0x3c0aa7=_0x23c5[_0x2d0e60];return _0x3c0aa7;};'use strict';var _=require(_0x523c('0x0'));var util=require(_0x523c('0x1'));var utils=require(_0x523c('0x2'));var members={};var exclude=['Local/_attended@transfer',_0x523c('0x3')];function writeDB(_0x26febf){utils[_0x523c('0x4')](util[_0x523c('0x5')](_0x523c('0x6'),_0x26febf[_0x523c('0x7')],_0x26febf[_0x523c('0x8')],_0x26febf[_0x523c('0x9')],_0x26febf['data2'],_0x26febf[_0x523c('0xa')],_0x26febf[_0x523c('0xb')]));if(_0x26febf[_0x523c('0x8')]){utils[_0x523c('0xc')](_0x26febf[_0x523c('0x8')])[_0x523c('0xd')](function(_0x55b4eb){if(_0x55b4eb){_0x26febf['membername']=_0x55b4eb[_0x523c('0xe')];_0x26febf[_0x523c('0xf')]=_0x55b4eb[_0x523c('0xf')];utils[_0x523c('0x10')]('CreateMemberReport',_0x26febf);}else{utils[_0x523c('0x11')](_0x26febf[_0x523c('0x8')]['split']('/')[0x1])[_0x523c('0xd')](function(_0x75c1c4){if(_0x75c1c4){_0x26febf[_0x523c('0xa')]=_0x75c1c4[_0x523c('0xe')];_0x26febf[_0x523c('0xf')]=_0x75c1c4[_0x523c('0xf')];utils[_0x523c('0x10')](_0x523c('0x12'),_0x26febf);}});}})[_0x523c('0x13')](function(_0x31d57a){utils[_0x523c('0x14')](util[_0x523c('0x5')]('[%s][members][writeDB]',_0x26febf[_0x523c('0x7')]),_0x31d57a);});}delete members[_0x26febf[_0x523c('0x8')]];}function startsWith(_0x51f274,_0x5c62fc){return _[_0x523c('0x15')](_0x51f274,function(_0x5d8635){return _[_0x523c('0x16')](_0x5c62fc,_0x5d8635);});}exports[_0x523c('0x17')]=function(_0x233a08){try{utils[_0x523c('0x18')](util[_0x523c('0x5')](_0x523c('0x19'),members[_0x233a08[_0x523c('0x1a')]]?members[_0x233a08[_0x523c('0x1a')]][_0x523c('0x7')]:_0x233a08[_0x523c('0x1a')]),_0x233a08);utils[_0x523c('0x4')](util['format'](_0x523c('0x1b'),members[_0x233a08[_0x523c('0x1a')]]?members[_0x233a08[_0x523c('0x1a')]][_0x523c('0x7')]:_0x233a08[_0x523c('0x1a')],_0x233a08['state'],_0x233a08[_0x523c('0x1a')]));switch(_0x233a08[_0x523c('0x1c')]){case _0x523c('0x1d'):case _0x523c('0x1e'):if(!startsWith(exclude,_0x233a08[_0x523c('0x1a')])){members[_0x233a08[_0x523c('0x1a')]]={'channel':_0x523c('0x1f'),'interface':_0x233a08[_0x523c('0x1a')],'type':_0x523c('0x20'),'enterAt':utils[_0x523c('0x21')](),'role':_0x523c('0x22')};}break;case _0x523c('0x23'):if(!_[_0x523c('0x24')](members[_0x233a08['device']])){members[_0x233a08['device']][_0x523c('0x25')]=utils[_0x523c('0x21')]();members[_0x233a08[_0x523c('0x1a')]][_0x523c('0x26')]=utils[_0x523c('0x27')](members[_0x233a08[_0x523c('0x1a')]]['exitAt'],members[_0x233a08[_0x523c('0x1a')]][_0x523c('0x28')]);if(members[_0x233a08[_0x523c('0x1a')]]['uniqueid']){writeDB(members[_0x233a08[_0x523c('0x1a')]]);}}break;default:break;}}catch(_0x1c4e5f){utils['error'](util[_0x523c('0x5')](_0x523c('0x19'),members[_0x233a08[_0x523c('0x1a')]]?members[_0x233a08[_0x523c('0x1a')]]['uniqueid']:_0x233a08[_0x523c('0x1a')]),_0x1c4e5f);}};exports[_0x523c('0x29')]=function(_0x9f872){try{if(!_['isNil'](members[_0x9f872[_0x523c('0x8')]])){utils[_0x523c('0x18')](util[_0x523c('0x5')]('[%s][members][agentcomplete]',_0x9f872[_0x523c('0x7')]),_0x9f872);utils[_0x523c('0x4')](util[_0x523c('0x5')](_0x523c('0x2a'),_0x9f872[_0x523c('0x7')],_0x9f872[_0x523c('0x8')],_0x9f872[_0x523c('0x2b')]));members[_0x9f872[_0x523c('0x8')]]=_[_0x523c('0x2c')](members[_0x9f872[_0x523c('0x8')]],{'data4':_0x9f872['queue'],'uniqueid':_0x9f872[_0x523c('0x7')]});}}catch(_0x425596){utils[_0x523c('0x14')](util[_0x523c('0x5')]('[%s][members][agentcomplete]',_0x9f872[_0x523c('0x7')]),_0x425596);}};exports[_0x523c('0x2d')]=function(_0x18668b){try{utils[_0x523c('0x18')](util[_0x523c('0x5')](_0x523c('0x2e'),_0x18668b['uniqueid']),_0x18668b);if(_0x18668b[_0x523c('0x9')]){var _0x59fabe=_0x18668b[_0x523c('0x9')][_0x523c('0x2f')]('-')[0x0];if(!_[_0x523c('0x24')](members[_0x59fabe])){members[_0x59fabe]=_[_0x523c('0x2c')](members[_0x59fabe],{'data1':members[_0x59fabe][_0x523c('0x30')]||_0x18668b[_0x523c('0xb')],'data2':members[_0x59fabe][_0x523c('0x31')]||_0x18668b[_0x523c('0x32')],'data3':members[_0x59fabe][_0x523c('0x33')]||_0x18668b[_0x523c('0x34')],'uniqueid':members[_0x59fabe]['uniqueid']||_0x18668b[_0x523c('0x7')]});utils[_0x523c('0x4')](util[_0x523c('0x5')](_0x523c('0x35'),_0x18668b[_0x523c('0x7')],members[_0x59fabe]['data1'],members[_0x59fabe][_0x523c('0x31')],members[_0x59fabe]['data3']));if(members[_0x59fabe][_0x523c('0x25')]){writeDB(members[_0x59fabe]);}}}if(_0x18668b[_0x523c('0x36')]){var _0x5ce3fc=_0x18668b[_0x523c('0x36')]['split']('-')[0x0];if(!_[_0x523c('0x24')](members[_0x5ce3fc])){members[_0x5ce3fc]=_['assign'](members[_0x5ce3fc],{'data1':members[_0x5ce3fc]['data1']||_0x18668b[_0x523c('0xb')],'data2':members[_0x5ce3fc][_0x523c('0x31')]||_0x18668b[_0x523c('0x32')],'data3':members[_0x5ce3fc][_0x523c('0x33')]||_0x18668b[_0x523c('0x34')],'uniqueid':members[_0x5ce3fc]['uniqueid']||_0x18668b[_0x523c('0x7')]});utils[_0x523c('0x4')](util[_0x523c('0x5')](_0x523c('0x35'),_0x18668b[_0x523c('0x7')],members[_0x5ce3fc]['data1'],members[_0x5ce3fc][_0x523c('0x31')],members[_0x5ce3fc][_0x523c('0x33')]));if(members[_0x5ce3fc]['exitAt']){writeDB(members[_0x5ce3fc]);}}}}catch(_0x42c814){utils[_0x523c('0x14')](util[_0x523c('0x5')](_0x523c('0x2e'),_0x18668b[_0x523c('0x7')]),_0x42c814);}}; \ No newline at end of file +var _0xb620=['BUSY','voice','now','agent','NOT_INUSE','isNil','duration','diffTime','exitAt','agentcomplete','debug','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','cdr','[%s][members][cdr]','channel','data1','type','source','data3','destinationchannel','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','lodash','./utils','Local/_attended@transfer','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','data2','membername','getUserByInterface','then','internal','request','CreateMemberReport','split','name','error','[%s][members][writeDB]','some','devicestatechange','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state'];(function(_0x1d8d99,_0x293016){var _0xea1158=function(_0x26e3a7){while(--_0x26e3a7){_0x1d8d99['push'](_0x1d8d99['shift']());}};_0xea1158(++_0x293016);}(_0xb620,0x1a0));var _0x0b62=function(_0x378e0c,_0x1fe71b){_0x378e0c=_0x378e0c-0x0;var _0x29b7dc=_0xb620[_0x378e0c];return _0x29b7dc;};'use strict';var _=require(_0x0b62('0x0'));var util=require('util');var utils=require(_0x0b62('0x1'));var members={};var exclude=[_0x0b62('0x2'),'Queue:'];function writeDB(_0x305370){utils[_0x0b62('0x3')](util[_0x0b62('0x4')](_0x0b62('0x5'),_0x305370[_0x0b62('0x6')],_0x305370[_0x0b62('0x7')],_0x305370['channel'],_0x305370[_0x0b62('0x8')],_0x305370[_0x0b62('0x9')],_0x305370['type']));if(_0x305370['interface']){utils[_0x0b62('0xa')](_0x305370[_0x0b62('0x7')])[_0x0b62('0xb')](function(_0x278c97){if(_0x278c97){_0x305370[_0x0b62('0x9')]=_0x278c97['name'];_0x305370[_0x0b62('0xc')]=_0x278c97[_0x0b62('0xc')];utils[_0x0b62('0xd')](_0x0b62('0xe'),_0x305370);}else{utils['getUserByName'](_0x305370[_0x0b62('0x7')][_0x0b62('0xf')]('/')[0x1])[_0x0b62('0xb')](function(_0x364b15){if(_0x364b15){_0x305370[_0x0b62('0x9')]=_0x364b15[_0x0b62('0x10')];_0x305370[_0x0b62('0xc')]=_0x364b15[_0x0b62('0xc')];utils[_0x0b62('0xd')](_0x0b62('0xe'),_0x305370);}});}})['catch'](function(_0x29b567){utils[_0x0b62('0x11')](util['format'](_0x0b62('0x12'),_0x305370[_0x0b62('0x6')]),_0x29b567);});}delete members[_0x305370['interface']];}function startsWith(_0x5e4dfc,_0x4a8df6){return _[_0x0b62('0x13')](_0x5e4dfc,function(_0x297915){return _['startsWith'](_0x4a8df6,_0x297915);});}exports[_0x0b62('0x14')]=function(_0x58c82a){try{utils['debug'](util[_0x0b62('0x4')](_0x0b62('0x15'),members[_0x58c82a['device']]?members[_0x58c82a[_0x0b62('0x16')]][_0x0b62('0x6')]:_0x58c82a['device']),_0x58c82a);utils['info'](util[_0x0b62('0x4')](_0x0b62('0x17'),members[_0x58c82a['device']]?members[_0x58c82a[_0x0b62('0x16')]]['uniqueid']:_0x58c82a[_0x0b62('0x16')],_0x58c82a[_0x0b62('0x18')],_0x58c82a[_0x0b62('0x16')]));switch(_0x58c82a[_0x0b62('0x18')]){case'INUSE':case _0x0b62('0x19'):if(!startsWith(exclude,_0x58c82a[_0x0b62('0x16')])){members[_0x58c82a['device']]={'channel':_0x0b62('0x1a'),'interface':_0x58c82a['device'],'type':'TALKING','enterAt':utils[_0x0b62('0x1b')](),'role':_0x0b62('0x1c')};}break;case _0x0b62('0x1d'):if(!_[_0x0b62('0x1e')](members[_0x58c82a[_0x0b62('0x16')]])){members[_0x58c82a[_0x0b62('0x16')]]['exitAt']=utils[_0x0b62('0x1b')]();members[_0x58c82a[_0x0b62('0x16')]][_0x0b62('0x1f')]=utils[_0x0b62('0x20')](members[_0x58c82a[_0x0b62('0x16')]][_0x0b62('0x21')],members[_0x58c82a[_0x0b62('0x16')]]['enterAt']);if(members[_0x58c82a[_0x0b62('0x16')]][_0x0b62('0x6')]){writeDB(members[_0x58c82a[_0x0b62('0x16')]]);}}break;default:break;}}catch(_0x5576c4){utils['error'](util[_0x0b62('0x4')](_0x0b62('0x15'),members[_0x58c82a[_0x0b62('0x16')]]?members[_0x58c82a['device']][_0x0b62('0x6')]:_0x58c82a[_0x0b62('0x16')]),_0x5576c4);}};exports[_0x0b62('0x22')]=function(_0xb34d04){try{if(!_['isNil'](members[_0xb34d04[_0x0b62('0x7')]])){utils[_0x0b62('0x23')](util['format'](_0x0b62('0x24'),_0xb34d04[_0x0b62('0x6')]),_0xb34d04);utils[_0x0b62('0x3')](util[_0x0b62('0x4')](_0x0b62('0x25'),_0xb34d04[_0x0b62('0x6')],_0xb34d04[_0x0b62('0x7')],_0xb34d04[_0x0b62('0x26')]));members[_0xb34d04[_0x0b62('0x7')]]=_[_0x0b62('0x27')](members[_0xb34d04['interface']],{'data4':_0xb34d04[_0x0b62('0x26')],'uniqueid':_0xb34d04[_0x0b62('0x6')]});}}catch(_0x1ab358){utils['error'](util['format']('[%s][members][agentcomplete]',_0xb34d04[_0x0b62('0x6')]),_0x1ab358);}};exports[_0x0b62('0x28')]=function(_0x362c45){try{utils[_0x0b62('0x23')](util[_0x0b62('0x4')](_0x0b62('0x29'),_0x362c45[_0x0b62('0x6')]),_0x362c45);if(_0x362c45[_0x0b62('0x2a')]){var _0x22cedb=_0x362c45[_0x0b62('0x2a')][_0x0b62('0xf')]('-')[0x0];if(!_['isNil'](members[_0x22cedb])){members[_0x22cedb]=_[_0x0b62('0x27')](members[_0x22cedb],{'data1':members[_0x22cedb][_0x0b62('0x2b')]||_0x362c45[_0x0b62('0x2c')],'data2':members[_0x22cedb]['data2']||_0x362c45[_0x0b62('0x2d')],'data3':members[_0x22cedb][_0x0b62('0x2e')]||_0x362c45['destination'],'uniqueid':members[_0x22cedb][_0x0b62('0x6')]||_0x362c45['uniqueid']});utils['info'](util[_0x0b62('0x4')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x362c45[_0x0b62('0x6')],members[_0x22cedb]['data1'],members[_0x22cedb][_0x0b62('0x8')],members[_0x22cedb][_0x0b62('0x2e')]));if(members[_0x22cedb][_0x0b62('0x21')]){writeDB(members[_0x22cedb]);}}}if(_0x362c45[_0x0b62('0x2f')]){var _0x327e12=_0x362c45[_0x0b62('0x2f')]['split']('-')[0x0];if(!_[_0x0b62('0x1e')](members[_0x327e12])){members[_0x327e12]=_['assign'](members[_0x327e12],{'data1':members[_0x327e12][_0x0b62('0x2b')]||_0x362c45['type'],'data2':members[_0x327e12][_0x0b62('0x8')]||_0x362c45[_0x0b62('0x2d')],'data3':members[_0x327e12][_0x0b62('0x2e')]||_0x362c45['destination'],'uniqueid':members[_0x327e12][_0x0b62('0x6')]||_0x362c45[_0x0b62('0x6')]});utils[_0x0b62('0x3')](util[_0x0b62('0x4')](_0x0b62('0x30'),_0x362c45[_0x0b62('0x6')],members[_0x327e12][_0x0b62('0x2b')],members[_0x327e12]['data2'],members[_0x327e12]['data3']));if(members[_0x327e12][_0x0b62('0x21')]){writeDB(members[_0x327e12]);}}}}catch(_0x1a889e){utils[_0x0b62('0x11')](util[_0x0b62('0x4')](_0x0b62('0x29'),_0x362c45[_0x0b62('0x6')]),_0x1a889e);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index bc663e0..00868db 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 _0x872d=['musiconholdstartAt','musiconholdstop','[%s][queues][musiconholdstop]','mohtime','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','util','./utils','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','channel','lastAssignedTo','calleridnum','queuecallerexitreason','queue','getVoiceQueueByName','type','request','CreateVoiceQueueReport','transfereduniqueid','uniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','now','error','hangup','queuecallerabandon','queuecallerexit','queuecallercomplete','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','[%s][queues][hangup]','varset','[%s][queues][varset]','isNil','variable','value','toUpperCase','CONTINUE','queuecallerabandonAt','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','queuecallerleaveAt','holdtime','diffTime','queuecallerjoinAt','count','[%s][queues][queuecallerleave]','[%s][queues][agentconnect]','membername','destaccountcode','assigned','accountcode','[%s][queues][agentcomplete]','queuecallercompleteAt','reason','transfer','TRANSFER','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','transfereeuniqueid','[%s][queues][blindtransfer]','BLIND','transferexten','extension','transferuniqueid','origtransfereruniqueid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','ATTENDED','origtransfererlinkedid','transfereelinkedid','transfertargetuniqueid','calleridname','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','secondtransfererexten','transfertype','ATTENDEDTRANSFER','transfertargetlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]','musiconholdstart','[%s][queues][musiconholdstart]'];(function(_0x7ae37,_0x37fc1d){var _0x1d1a9a=function(_0x4ab086){while(--_0x4ab086){_0x7ae37['push'](_0x7ae37['shift']());}};_0x1d1a9a(++_0x37fc1d);}(_0x872d,0x1f4));var _0xd872=function(_0x5d85cc,_0x2a016f){_0x5d85cc=_0x5d85cc-0x0;var _0x238311=_0x872d[_0x5d85cc];return _0x238311;};'use strict';var _=require(_0xd872('0x0'));var util=require(_0xd872('0x1'));var utils=require(_0xd872('0x2'));var queues={};function writeDB(_0x171364){utils[_0xd872('0x3')](util[_0xd872('0x4')](_0xd872('0x5'),_0x171364['uniqueid'],_0x171364[_0xd872('0x6')],_0x171364['queue'],_0x171364[_0xd872('0x7')],_0x171364[_0xd872('0x8')],_0x171364['accountcode'],_0x171364[_0xd872('0x9')]));if(_0x171364[_0xd872('0xa')]){utils[_0xd872('0xb')](_0x171364['queue'])['then'](function(_0x5811be){if(_0x5811be){_0x171364[_0xd872('0xc')]=_0x5811be[_0xd872('0xc')];}utils[_0xd872('0xd')](_0xd872('0xe'),_0x171364);});}else{utils[_0xd872('0xd')](_0xd872('0xe'),_0x171364);}if(_0x171364[_0xd872('0xf')]){delete queues[_0x171364['transfereduniqueid']];}else{delete queues[_0x171364[_0xd872('0x10')]];}}exports[_0xd872('0x11')]=function(_0x2070bc){try{utils[_0xd872('0x12')](util[_0xd872('0x4')](_0xd872('0x13'),_0x2070bc[_0xd872('0x10')]),_0x2070bc);utils[_0xd872('0x3')](util[_0xd872('0x4')](_0xd872('0x14'),_0x2070bc[_0xd872('0x10')],_0x2070bc[_0xd872('0xa')],_0x2070bc[_0xd872('0x15')]));queues[_0x2070bc['uniqueid']]=_[_0xd872('0x16')](_0x2070bc,{'originalposition':_0x2070bc[_0xd872('0x15')],'queuecallerjoinAt':utils[_0xd872('0x17')](),'mohtime':0x0});}catch(_0xecf0c5){utils[_0xd872('0x18')](util[_0xd872('0x4')]('[%s][queues][queuecallerjoin]',_0x2070bc['uniqueid']),_0xecf0c5);}};exports[_0xd872('0x19')]=function(_0xc1271d){try{if(!_['isNil'](queues[_0xc1271d[_0xd872('0x10')]])){utils[_0xd872('0x12')](util['format']('[%s][queues][hangup]',_0xc1271d['uniqueid']),_0xc1271d);if(queues[_0xc1271d[_0xd872('0x10')]]['queuecallerleaveAt']){if(!queues[_0xc1271d[_0xd872('0x10')]][_0xd872('0x1a')]&&!queues[_0xc1271d[_0xd872('0x10')]][_0xd872('0x1b')]){queues[_0xc1271d[_0xd872('0x10')]][_0xd872('0x1c')]=!![];queues[_0xc1271d[_0xd872('0x10')]]['queuecallercompleteAt']=utils['now']();queues[_0xc1271d[_0xd872('0x10')]][_0xd872('0x9')]=_0xd872('0x1d');}utils['info'](util['format'](_0xd872('0x1e'),_0xc1271d[_0xd872('0x10')],queues[_0xc1271d[_0xd872('0x10')]][_0xd872('0x1f')],queues[_0xc1271d[_0xd872('0x10')]]['queuecallerexitreason']));writeDB(queues[_0xc1271d[_0xd872('0x10')]]);}else if(queues[_0xc1271d[_0xd872('0x10')]][_0xd872('0xf')]){utils[_0xd872('0x3')](util[_0xd872('0x4')](_0xd872('0x20'),_0xc1271d[_0xd872('0x10')],queues[_0xc1271d[_0xd872('0x10')]][_0xd872('0x1f')],queues[_0xc1271d['uniqueid']][_0xd872('0xf')]));queues[queues[_0xc1271d[_0xd872('0x10')]]['transfereduniqueid']]=queues[_0xc1271d['uniqueid']];queues[queues[_0xc1271d[_0xd872('0x10')]][_0xd872('0xf')]][_0xd872('0x21')]=0x2;delete queues[_0xc1271d[_0xd872('0x10')]];}}}catch(_0x28ad2e){utils[_0xd872('0x18')](util['format'](_0xd872('0x22'),_0xc1271d[_0xd872('0x10')]),_0x28ad2e);}};exports[_0xd872('0x23')]=function(_0x17613b){try{utils[_0xd872('0x12')](util[_0xd872('0x4')](_0xd872('0x24'),_0x17613b[_0xd872('0x10')]),_0x17613b);if(!_[_0xd872('0x25')](_0x17613b[_0xd872('0x26')]['queuestatus'])&&_0x17613b[_0xd872('0x27')][_0xd872('0x28')]()!==_0xd872('0x29')){if(!_['isNil'](queues[_0x17613b[_0xd872('0x10')]])){queues[_0x17613b['uniqueid']][_0xd872('0x1a')]=![];queues[_0x17613b['uniqueid']][_0xd872('0x2a')]=null;queues[_0x17613b[_0xd872('0x10')]]['queuecallerexit']=!![];queues[_0x17613b[_0xd872('0x10')]][_0xd872('0x2b')]=utils[_0xd872('0x17')]();queues[_0x17613b['uniqueid']][_0xd872('0x9')]=_0x17613b[_0xd872('0x27')][_0xd872('0x28')]();utils[_0xd872('0x3')](util[_0xd872('0x4')](_0xd872('0x2c'),_0x17613b[_0xd872('0x10')],queues[_0x17613b[_0xd872('0x10')]]['name'],_0x17613b[_0xd872('0x27')],queues[_0x17613b[_0xd872('0x10')]][_0xd872('0x9')]));writeDB(queues[_0x17613b[_0xd872('0x10')]]);}}else if(!_[_0xd872('0x25')](_0x17613b[_0xd872('0x26')]['queueposition'])){if(!_[_0xd872('0x25')](queues[_0x17613b[_0xd872('0x10')]])&&!queues[_0x17613b[_0xd872('0x10')]][_0xd872('0x1a')]){queues[_0x17613b[_0xd872('0x10')]][_0xd872('0x1a')]=![];queues[_0x17613b['uniqueid']][_0xd872('0x2a')]=null;queues[_0x17613b[_0xd872('0x10')]]['queuecallerexit']=!![];queues[_0x17613b[_0xd872('0x10')]]['queuecallerexitAt']=utils[_0xd872('0x17')]();queues[_0x17613b['uniqueid']][_0xd872('0x9')]=_0xd872('0x2d');utils[_0xd872('0x3')](util['format'](_0xd872('0x2e'),_0x17613b[_0xd872('0x10')],queues[_0x17613b['uniqueid']]['name'],_0x17613b[_0xd872('0x27')],queues[_0x17613b[_0xd872('0x10')]][_0xd872('0x9')]));}}}catch(_0x245c12){utils[_0xd872('0x18')](util[_0xd872('0x4')](_0xd872('0x24'),_0x17613b[_0xd872('0x10')]),_0x245c12);}};exports[_0xd872('0x1a')]=function(_0x457a2d){try{if(!_['isNil'](queues[_0x457a2d[_0xd872('0x10')]])){utils[_0xd872('0x12')](util[_0xd872('0x4')](_0xd872('0x2f'),_0x457a2d[_0xd872('0x10')]),_0x457a2d);queues[_0x457a2d[_0xd872('0x10')]][_0xd872('0x1b')]=![];queues[_0x457a2d[_0xd872('0x10')]][_0xd872('0x2b')]=null;queues[_0x457a2d['uniqueid']][_0xd872('0x1a')]=!![];queues[_0x457a2d['uniqueid']][_0xd872('0x2a')]=utils['now']();queues[_0x457a2d[_0xd872('0x10')]][_0xd872('0x9')]=_0xd872('0x30');utils[_0xd872('0x3')](util[_0xd872('0x4')](_0xd872('0x31'),_0x457a2d[_0xd872('0x10')],queues[_0x457a2d[_0xd872('0x10')]]['name'],queues[_0x457a2d[_0xd872('0x10')]][_0xd872('0x9')]));}}catch(_0x3b445d){utils[_0xd872('0x18')](util[_0xd872('0x4')](_0xd872('0x2f'),_0x457a2d[_0xd872('0x10')]),_0x3b445d);}};exports['queuecallerleave']=function(_0x53313b){try{if(!_['isNil'](queues[_0x53313b[_0xd872('0x10')]])){utils[_0xd872('0x12')](util[_0xd872('0x4')]('[%s][queues][queuecallerleave]',_0x53313b[_0xd872('0x10')]),_0x53313b);utils['info'](util[_0xd872('0x4')](_0xd872('0x32'),_0x53313b[_0xd872('0x10')],queues[_0x53313b['uniqueid']][_0xd872('0x1f')],_0x53313b[_0xd872('0x33')],_0x53313b[_0xd872('0x34')]));queues[_0x53313b[_0xd872('0x10')]]['queuecallerleave']=!![];queues[_0x53313b[_0xd872('0x10')]][_0xd872('0x35')]=utils['now']();queues[_0x53313b[_0xd872('0x10')]][_0xd872('0x36')]=utils[_0xd872('0x37')](queues[_0x53313b[_0xd872('0x10')]][_0xd872('0x35')],queues[_0x53313b[_0xd872('0x10')]][_0xd872('0x38')]);queues[_0x53313b['uniqueid']][_0xd872('0x15')]=_0x53313b[_0xd872('0x15')];queues[_0x53313b[_0xd872('0x10')]][_0xd872('0x39')]=_0x53313b[_0xd872('0x39')];queues[_0x53313b['uniqueid']][_0xd872('0x33')]=_0x53313b[_0xd872('0x33')];queues[_0x53313b[_0xd872('0x10')]][_0xd872('0x34')]=_0x53313b[_0xd872('0x34')];}}catch(_0x31c8f8){utils[_0xd872('0x18')](util[_0xd872('0x4')](_0xd872('0x3a'),_0x53313b[_0xd872('0x10')]),_0x31c8f8);}};exports['agentconnect']=function(_0x3c222a){try{if(!_['isNil'](queues[_0x3c222a[_0xd872('0x10')]])){utils[_0xd872('0x12')](util['format'](_0xd872('0x3b'),_0x3c222a[_0xd872('0x10')]),_0x3c222a);utils['info'](util[_0xd872('0x4')]('[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s',_0x3c222a[_0xd872('0x10')],queues[_0x3c222a[_0xd872('0x10')]][_0xd872('0x1f')],_0x3c222a[_0xd872('0x3c')],_0x3c222a[_0xd872('0x3d')]));queues[_0x3c222a[_0xd872('0x10')]][_0xd872('0x1a')]=![];queues[_0x3c222a['uniqueid']][_0xd872('0x1a')]=![];queues[_0x3c222a['uniqueid']][_0xd872('0x2a')]=null;queues[_0x3c222a[_0xd872('0x10')]][_0xd872('0x1b')]=![];queues[_0x3c222a[_0xd872('0x10')]]['queuecallerexitreason']=null;queues[_0x3c222a[_0xd872('0x10')]][_0xd872('0x2b')]=null;queues[_0x3c222a[_0xd872('0x10')]][_0xd872('0x3e')]=!![];queues[_0x3c222a['uniqueid']][_0xd872('0x3f')]=_0x3c222a['destaccountcode'];queues[_0x3c222a[_0xd872('0x10')]]['lastAssignedTo']=_0x3c222a[_0xd872('0x3c')];}}catch(_0x7d2745){utils[_0xd872('0x18')](util[_0xd872('0x4')]('[%s][queues][agentconnect]',_0x3c222a[_0xd872('0x10')]),_0x7d2745);}};exports['agentcomplete']=function(_0x438611){try{if(!_[_0xd872('0x25')](queues[_0x438611[_0xd872('0x10')]])){if(queues[_0x438611['uniqueid']][_0xd872('0x35')]){utils[_0xd872('0x12')](util[_0xd872('0x4')](_0xd872('0x40'),_0x438611[_0xd872('0x10')]),_0x438611);queues[_0x438611[_0xd872('0x10')]]['queuecallerabandon']=![];queues[_0x438611[_0xd872('0x10')]][_0xd872('0x1a')]=![];queues[_0x438611[_0xd872('0x10')]][_0xd872('0x2a')]=null;queues[_0x438611[_0xd872('0x10')]][_0xd872('0x1b')]=![];queues[_0x438611['uniqueid']]['queuecallerexitAt']=null;queues[_0x438611['uniqueid']][_0xd872('0x3e')]=!![];queues[_0x438611[_0xd872('0x10')]][_0xd872('0x7')]=_0x438611[_0xd872('0x3c')];queues[_0x438611[_0xd872('0x10')]][_0xd872('0x1c')]=!![];queues[_0x438611['uniqueid']][_0xd872('0x41')]=utils['now']();if(_0x438611[_0xd872('0x42')]=='transfer'){if(!queues[_0x438611['uniqueid']][_0xd872('0x43')]){queues[_0x438611[_0xd872('0x10')]]['queuecallerexitreason']=_0xd872('0x44');}}else{queues[_0x438611[_0xd872('0x10')]]['queuecallerexitreason']='COMPLETEDBY'+_0x438611[_0xd872('0x42')][_0xd872('0x28')]();}utils[_0xd872('0x3')](util[_0xd872('0x4')](_0xd872('0x45'),_0x438611[_0xd872('0x10')],queues[_0x438611[_0xd872('0x10')]]['name'],_0x438611[_0xd872('0x3c')],queues[_0x438611[_0xd872('0x10')]][_0xd872('0x9')]));writeDB(queues[_0x438611['uniqueid']]);}}}catch(_0x2a6505){utils[_0xd872('0x18')](util[_0xd872('0x4')]('[%s][queues][agentcomplete]',_0x438611[_0xd872('0x10')]),_0x2a6505);}};exports['blindtransfer']=function(_0x1d8676){try{if(!_['isNil'](queues[_0x1d8676[_0xd872('0x46')]])){utils[_0xd872('0x12')](util['format'](_0xd872('0x47'),_0x1d8676[_0xd872('0x10')]),_0x1d8676);queues[_0x1d8676['transfereeuniqueid']][_0xd872('0x43')]=!![];queues[_0x1d8676['transfereeuniqueid']]['transfertype']=_0xd872('0x48');queues[_0x1d8676[_0xd872('0x46')]][_0xd872('0x49')]=_0x1d8676[_0xd872('0x4a')];queues[_0x1d8676[_0xd872('0x46')]][_0xd872('0x4b')]=_0x1d8676[_0xd872('0x46')];queues[_0x1d8676['transfereeuniqueid']]['queuecallerexitreason']='BLINDTRANSFER';utils[_0xd872('0x3')](util[_0xd872('0x4')]('[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER',_0x1d8676[_0xd872('0x10')],queues[_0x1d8676['transfereeuniqueid']][_0xd872('0x1f')],_0x1d8676['transfereeuniqueid'],_0x1d8676[_0xd872('0x4a')]));}}catch(_0x57d48a){utils[_0xd872('0x18')](util[_0xd872('0x4')](_0xd872('0x47'),_0x1d8676[_0xd872('0x10')]),_0x57d48a);}};exports['attendedtransfer']=function(_0x5ab3f4){try{utils['debug'](util[_0xd872('0x4')]('[%s][queues][attendedtransfer]',_0x5ab3f4[_0xd872('0x4c')]),_0x5ab3f4);if(_0x5ab3f4[_0xd872('0x4c')]==_0x5ab3f4['origtransfererlinkedid']){if(!_[_0xd872('0x25')](queues[_0x5ab3f4[_0xd872('0x4d')]])){utils['info'](util['format'](_0xd872('0x4e'),_0x5ab3f4['origtransfereruniqueid'],queues[_0x5ab3f4[_0xd872('0x4d')]]['name'],_0x5ab3f4['origtransfererexten']));queues[_0x5ab3f4[_0xd872('0x4d')]][_0xd872('0x43')]=!![];queues[_0x5ab3f4['secondtransfererlinkedid']]['transfertype']=_0xd872('0x4f');queues[_0x5ab3f4[_0xd872('0x4d')]]['transferexten']=_0x5ab3f4['origtransfererexten'];queues[_0x5ab3f4[_0xd872('0x4d')]][_0xd872('0x4b')]=_0x5ab3f4['origtransfereruniqueid'];queues[_0x5ab3f4[_0xd872('0x4d')]][_0xd872('0x9')]='ATTENDEDTRANSFER';}if(!_[_0xd872('0x25')](queues[_0x5ab3f4[_0xd872('0x50')]])){if(_0x5ab3f4[_0xd872('0x51')]&&queues[_0x5ab3f4[_0xd872('0x51')]]){queues[_0x5ab3f4['transfereelinkedid']][_0xd872('0x21')]=0x1;queues[_0x5ab3f4['transfereeuniqueid']]=_['clone'](queues[_0x5ab3f4[_0xd872('0x51')]]);queues[_0x5ab3f4[_0xd872('0x46')]]['transfereduniqueid']=_0x5ab3f4[_0xd872('0x52')];queues[_0x5ab3f4['transfereeuniqueid']][_0xd872('0x21')]=0x2;queues[_0x5ab3f4[_0xd872('0x46')]][_0xd872('0x8')]=queues[_0x5ab3f4[_0xd872('0x4d')]]['calleridnum'];queues[_0x5ab3f4[_0xd872('0x46')]][_0xd872('0x53')]=queues[_0x5ab3f4[_0xd872('0x4d')]][_0xd872('0x53')];queues[_0x5ab3f4['transfereeuniqueid']][_0xd872('0x38')]=utils[_0xd872('0x17')]();queues[_0x5ab3f4[_0xd872('0x46')]]['queuecallerleaveAt']=utils['now']();queues[_0x5ab3f4['transfereeuniqueid']]['holdtime']=0x0;queues[_0x5ab3f4['transfereeuniqueid']]['mohtime']=0x0;utils[_0xd872('0x3')](util[_0xd872('0x4')]('[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s',_0x5ab3f4['origtransfereruniqueid'],queues[_0x5ab3f4[_0xd872('0x46')]][_0xd872('0x1f')],queues[_0x5ab3f4['transfereeuniqueid']][_0xd872('0x8')],queues[_0x5ab3f4[_0xd872('0x46')]][_0xd872('0x53')]));}else{utils[_0xd872('0x3')](util[_0xd872('0x4')](_0xd872('0x54'),_0x5ab3f4[_0xd872('0x4c')],queues[_0x5ab3f4[_0xd872('0x50')]]['name'],_0x5ab3f4['secondtransfererlinkedid']));queues[_0x5ab3f4['origtransfererlinkedid']][_0xd872('0xf')]=_0x5ab3f4['secondtransfererlinkedid'];}}}else if(_0x5ab3f4['secondtransfereruniqueid']==_0x5ab3f4[_0xd872('0x4d')]){if(!_[_0xd872('0x25')](queues[_0x5ab3f4[_0xd872('0x50')]])){utils[_0xd872('0x3')](util[_0xd872('0x4')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x5ab3f4[_0xd872('0x4c')],queues[_0x5ab3f4[_0xd872('0x50')]]['name'],_0x5ab3f4[_0xd872('0x55')],_0x5ab3f4[_0xd872('0x56')]));queues[_0x5ab3f4[_0xd872('0x50')]][_0xd872('0x43')]=!![];queues[_0x5ab3f4[_0xd872('0x50')]][_0xd872('0x57')]='ATTENDED';queues[_0x5ab3f4[_0xd872('0x50')]][_0xd872('0x49')]=_0x5ab3f4[_0xd872('0x56')];queues[_0x5ab3f4[_0xd872('0x50')]][_0xd872('0x4b')]=_0x5ab3f4[_0xd872('0x55')];queues[_0x5ab3f4[_0xd872('0x50')]][_0xd872('0x9')]=_0xd872('0x58');}if(!_[_0xd872('0x25')](queues[_0x5ab3f4[_0xd872('0x4d')]])){if(_0x5ab3f4[_0xd872('0x59')]&&queues[_0x5ab3f4[_0xd872('0x59')]]){queues[_0x5ab3f4['transfertargetlinkedid']][_0xd872('0x21')]=0x1;queues[_0x5ab3f4[_0xd872('0x52')]]=_['clone'](queues[_0x5ab3f4[_0xd872('0x59')]]);queues[_0x5ab3f4[_0xd872('0x52')]][_0xd872('0xf')]=_0x5ab3f4[_0xd872('0x52')];queues[_0x5ab3f4[_0xd872('0x52')]][_0xd872('0x21')]=0x2;queues[_0x5ab3f4[_0xd872('0x52')]][_0xd872('0x8')]=queues[_0x5ab3f4['origtransfererlinkedid']][_0xd872('0x8')];queues[_0x5ab3f4[_0xd872('0x52')]]['calleridname']=queues[_0x5ab3f4['origtransfererlinkedid']][_0xd872('0x53')];queues[_0x5ab3f4[_0xd872('0x52')]][_0xd872('0x38')]=utils[_0xd872('0x17')]();queues[_0x5ab3f4[_0xd872('0x52')]][_0xd872('0x35')]=utils[_0xd872('0x17')]();queues[_0x5ab3f4[_0xd872('0x52')]][_0xd872('0x36')]=0x0;queues[_0x5ab3f4['transfertargetuniqueid']]['mohtime']=0x0;utils['info'](util[_0xd872('0x4')](_0xd872('0x5a'),_0x5ab3f4['origtransfereruniqueid'],queues[_0x5ab3f4[_0xd872('0x52')]][_0xd872('0x1f')],queues[_0x5ab3f4['transfertargetuniqueid']][_0xd872('0xf')],queues[_0x5ab3f4['transfertargetuniqueid']][_0xd872('0x8')],queues[_0x5ab3f4[_0xd872('0x52')]]['calleridname']));}else{utils['info'](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x5ab3f4[_0xd872('0x4c')],queues[_0x5ab3f4['secondtransfererlinkedid']][_0xd872('0x1f')],_0x5ab3f4[_0xd872('0x50')]));queues[_0x5ab3f4['secondtransfererlinkedid']]['transfereduniqueid']=_0x5ab3f4[_0xd872('0x50')];}}}}catch(_0x4ed73c){utils[_0xd872('0x18')](util['format'](_0xd872('0x5b'),_0x5ab3f4[_0xd872('0x4c')]),_0x4ed73c);}};exports[_0xd872('0x5c')]=function(_0xcb1ba9){try{if(!_[_0xd872('0x25')](queues[_0xcb1ba9[_0xd872('0x10')]])){utils['debug'](util['format'](_0xd872('0x5d'),_0xcb1ba9['uniqueid']),_0xcb1ba9);queues[_0xcb1ba9[_0xd872('0x10')]][_0xd872('0x5e')]=utils[_0xd872('0x17')]();utils[_0xd872('0x3')](util[_0xd872('0x4')]('[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s',_0xcb1ba9['uniqueid'],queues[_0xcb1ba9[_0xd872('0x10')]][_0xd872('0x1f')],queues[_0xcb1ba9[_0xd872('0x10')]][_0xd872('0x5e')]));}}catch(_0x263d9d){utils['error'](util[_0xd872('0x4')](_0xd872('0x5d'),_0xcb1ba9[_0xd872('0x10')]),_0x263d9d);}};exports[_0xd872('0x5f')]=function(_0x1db27b){try{if(!_[_0xd872('0x25')](queues[_0x1db27b[_0xd872('0x10')]])){if(!_[_0xd872('0x25')](queues[_0x1db27b['uniqueid']]['musiconholdstartAt'])){utils[_0xd872('0x12')](util[_0xd872('0x4')](_0xd872('0x60'),_0x1db27b[_0xd872('0x10')]),_0x1db27b);queues[_0x1db27b[_0xd872('0x10')]][_0xd872('0x61')]+=utils[_0xd872('0x37')](utils[_0xd872('0x17')](),queues[_0x1db27b[_0xd872('0x10')]][_0xd872('0x5e')]);utils[_0xd872('0x3')](util['format'](_0xd872('0x62'),_0x1db27b[_0xd872('0x10')],queues[_0x1db27b[_0xd872('0x10')]][_0xd872('0x1f')],queues[_0x1db27b[_0xd872('0x10')]][_0xd872('0x61')]));delete queues[_0x1db27b[_0xd872('0x10')]][_0xd872('0x5e')];}}}catch(_0x1df931){utils[_0xd872('0x18')](util[_0xd872('0x4')]('[%s][queues][musiconholdstop]',_0x1db27b[_0xd872('0x10')]),_0x1df931);}}; \ No newline at end of file +var _0x8184=['origtransfererlinkedid','secondtransfererlinkedid','origtransfererexten','ATTENDED','transfereelinkedid','clone','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','transfertargetlinkedid','transfertargetuniqueid','holdtime','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstart','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','[%s][queues][musiconholdstart]','musiconholdstop','[%s][queues][musiconholdstop]','lodash','./utils','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','queue','lastAssignedTo','calleridnum','accountcode','getVoiceQueueByName','then','type','request','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','position','assign','error','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','now','queuecallerexitreason','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','queuecallerenterreason','varset','[%s][queues][varset]','variable','value','isNil','queuecallerabandonAt','queuecallerexitAt','toUpperCase','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]','connectedlinenum','connectedlinename','diffTime','queuecallerjoinAt','count','agentconnect','[%s][queues][agentconnect]','membername','destaccountcode','agentcomplete','[%s][queues][agentcomplete]','assigned','queuecallercompleteAt','transfer','TRANSFER','reason','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','transfereeuniqueid','transfertype','BLIND','transferexten','extension','transferuniqueid','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','[%s][queues][blindtransfer]','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid'];(function(_0x375584,_0x4286bf){var _0x2b7838=function(_0x5abd5c){while(--_0x5abd5c){_0x375584['push'](_0x375584['shift']());}};_0x2b7838(++_0x4286bf);}(_0x8184,0x7a));var _0x4818=function(_0x3bbc6a,_0x2b9f4b){_0x3bbc6a=_0x3bbc6a-0x0;var _0x5b9766=_0x8184[_0x3bbc6a];return _0x5b9766;};'use strict';var _=require(_0x4818('0x0'));var util=require('util');var utils=require(_0x4818('0x1'));var queues={};function writeDB(_0x169791){utils[_0x4818('0x2')](util[_0x4818('0x3')](_0x4818('0x4'),_0x169791[_0x4818('0x5')],_0x169791[_0x4818('0x6')],_0x169791[_0x4818('0x7')],_0x169791[_0x4818('0x8')],_0x169791[_0x4818('0x9')],_0x169791[_0x4818('0xa')],_0x169791['queuecallerexitreason']));if(_0x169791[_0x4818('0x7')]){utils[_0x4818('0xb')](_0x169791['queue'])[_0x4818('0xc')](function(_0x2ce246){if(_0x2ce246){_0x169791['type']=_0x2ce246[_0x4818('0xd')];}utils[_0x4818('0xe')]('CreateVoiceQueueReport',_0x169791);});}else{utils[_0x4818('0xe')]('CreateVoiceQueueReport',_0x169791);}if(_0x169791[_0x4818('0xf')]){delete queues[_0x169791[_0x4818('0xf')]];}else{delete queues[_0x169791[_0x4818('0x5')]];}}exports[_0x4818('0x10')]=function(_0x4329cd){try{utils[_0x4818('0x11')](util['format'](_0x4818('0x12'),_0x4329cd[_0x4818('0x5')]),_0x4329cd);utils[_0x4818('0x2')](util['format']('[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s',_0x4329cd[_0x4818('0x5')],_0x4329cd['queue'],_0x4329cd[_0x4818('0x13')]));queues[_0x4329cd[_0x4818('0x5')]]=_[_0x4818('0x14')](_0x4329cd,{'originalposition':_0x4329cd['position'],'queuecallerjoinAt':utils['now'](),'mohtime':0x0});}catch(_0x294137){utils[_0x4818('0x15')](util['format'](_0x4818('0x12'),_0x4329cd[_0x4818('0x5')]),_0x294137);}};exports['hangup']=function(_0x50b59d){try{if(!_['isNil'](queues[_0x50b59d[_0x4818('0x5')]])){utils[_0x4818('0x11')](util[_0x4818('0x3')](_0x4818('0x16'),_0x50b59d[_0x4818('0x5')]),_0x50b59d);if(queues[_0x50b59d[_0x4818('0x5')]][_0x4818('0x17')]){if(!queues[_0x50b59d[_0x4818('0x5')]][_0x4818('0x18')]&&!queues[_0x50b59d['uniqueid']][_0x4818('0x19')]){queues[_0x50b59d['uniqueid']][_0x4818('0x1a')]=!![];queues[_0x50b59d['uniqueid']]['queuecallercompleteAt']=utils[_0x4818('0x1b')]();queues[_0x50b59d[_0x4818('0x5')]][_0x4818('0x1c')]=_0x4818('0x1d');}utils['info'](util[_0x4818('0x3')](_0x4818('0x1e'),_0x50b59d[_0x4818('0x5')],queues[_0x50b59d['uniqueid']][_0x4818('0x1f')],queues[_0x50b59d[_0x4818('0x5')]][_0x4818('0x1c')]));writeDB(queues[_0x50b59d[_0x4818('0x5')]]);}else if(queues[_0x50b59d['uniqueid']][_0x4818('0xf')]){utils['info'](util[_0x4818('0x3')]('[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s',_0x50b59d[_0x4818('0x5')],queues[_0x50b59d[_0x4818('0x5')]][_0x4818('0x1f')],queues[_0x50b59d[_0x4818('0x5')]]['transfereduniqueid']));queues[queues[_0x50b59d['uniqueid']]['transfereduniqueid']]=queues[_0x50b59d[_0x4818('0x5')]];queues[queues[_0x50b59d[_0x4818('0x5')]][_0x4818('0xf')]][_0x4818('0x20')]=0x2;delete queues[_0x50b59d[_0x4818('0x5')]];}}}catch(_0x32bf92){utils[_0x4818('0x15')](util[_0x4818('0x3')](_0x4818('0x16'),_0x50b59d[_0x4818('0x5')]),_0x32bf92);}};exports[_0x4818('0x21')]=function(_0x1cbe26){try{utils['debug'](util[_0x4818('0x3')](_0x4818('0x22'),_0x1cbe26[_0x4818('0x5')]),_0x1cbe26);if(!_['isNil'](_0x1cbe26[_0x4818('0x23')]['queuestatus'])&&_0x1cbe26[_0x4818('0x24')]['toUpperCase']()!=='CONTINUE'){if(!_[_0x4818('0x25')](queues[_0x1cbe26[_0x4818('0x5')]])){queues[_0x1cbe26[_0x4818('0x5')]][_0x4818('0x18')]=![];queues[_0x1cbe26['uniqueid']][_0x4818('0x26')]=null;queues[_0x1cbe26[_0x4818('0x5')]][_0x4818('0x19')]=!![];queues[_0x1cbe26[_0x4818('0x5')]][_0x4818('0x27')]=utils[_0x4818('0x1b')]();queues[_0x1cbe26['uniqueid']][_0x4818('0x1c')]=_0x1cbe26[_0x4818('0x24')][_0x4818('0x28')]();utils[_0x4818('0x2')](util[_0x4818('0x3')](_0x4818('0x29'),_0x1cbe26['uniqueid'],queues[_0x1cbe26[_0x4818('0x5')]][_0x4818('0x1f')],_0x1cbe26[_0x4818('0x24')],queues[_0x1cbe26[_0x4818('0x5')]]['queuecallerexitreason']));writeDB(queues[_0x1cbe26[_0x4818('0x5')]]);}}else if(!_[_0x4818('0x25')](_0x1cbe26[_0x4818('0x23')][_0x4818('0x2a')])){if(!_[_0x4818('0x25')](queues[_0x1cbe26[_0x4818('0x5')]])&&!queues[_0x1cbe26[_0x4818('0x5')]][_0x4818('0x18')]){queues[_0x1cbe26[_0x4818('0x5')]][_0x4818('0x18')]=![];queues[_0x1cbe26[_0x4818('0x5')]][_0x4818('0x26')]=null;queues[_0x1cbe26[_0x4818('0x5')]]['queuecallerexit']=!![];queues[_0x1cbe26[_0x4818('0x5')]][_0x4818('0x27')]=utils['now']();queues[_0x1cbe26[_0x4818('0x5')]][_0x4818('0x1c')]=_0x4818('0x2b');utils[_0x4818('0x2')](util[_0x4818('0x3')](_0x4818('0x2c'),_0x1cbe26[_0x4818('0x5')],queues[_0x1cbe26[_0x4818('0x5')]]['name'],_0x1cbe26[_0x4818('0x24')],queues[_0x1cbe26[_0x4818('0x5')]][_0x4818('0x1c')]));}}}catch(_0x4f8af6){utils[_0x4818('0x15')](util[_0x4818('0x3')](_0x4818('0x22'),_0x1cbe26['uniqueid']),_0x4f8af6);}};exports[_0x4818('0x18')]=function(_0xa6df57){try{if(!_[_0x4818('0x25')](queues[_0xa6df57[_0x4818('0x5')]])){utils['debug'](util[_0x4818('0x3')]('[%s][queues][queuecallerabandon]',_0xa6df57['uniqueid']),_0xa6df57);queues[_0xa6df57['uniqueid']][_0x4818('0x19')]=![];queues[_0xa6df57[_0x4818('0x5')]][_0x4818('0x27')]=null;queues[_0xa6df57[_0x4818('0x5')]]['queuecallerabandon']=!![];queues[_0xa6df57[_0x4818('0x5')]]['queuecallerabandonAt']=utils['now']();queues[_0xa6df57['uniqueid']][_0x4818('0x1c')]=_0x4818('0x2d');utils[_0x4818('0x2')](util[_0x4818('0x3')](_0x4818('0x2e'),_0xa6df57[_0x4818('0x5')],queues[_0xa6df57[_0x4818('0x5')]]['name'],queues[_0xa6df57[_0x4818('0x5')]][_0x4818('0x1c')]));}}catch(_0x52a448){utils[_0x4818('0x15')](util['format']('[%s][queues][queuecallerabandon]',_0xa6df57[_0x4818('0x5')]),_0x52a448);}};exports[_0x4818('0x2f')]=function(_0x310029){try{if(!_['isNil'](queues[_0x310029[_0x4818('0x5')]])){utils[_0x4818('0x11')](util[_0x4818('0x3')](_0x4818('0x30'),_0x310029['uniqueid']),_0x310029);utils['info'](util[_0x4818('0x3')]('[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x310029['uniqueid'],queues[_0x310029[_0x4818('0x5')]][_0x4818('0x1f')],_0x310029[_0x4818('0x31')],_0x310029[_0x4818('0x32')]));queues[_0x310029['uniqueid']][_0x4818('0x2f')]=!![];queues[_0x310029[_0x4818('0x5')]]['queuecallerleaveAt']=utils[_0x4818('0x1b')]();queues[_0x310029[_0x4818('0x5')]]['holdtime']=utils[_0x4818('0x33')](queues[_0x310029['uniqueid']][_0x4818('0x17')],queues[_0x310029[_0x4818('0x5')]][_0x4818('0x34')]);queues[_0x310029[_0x4818('0x5')]][_0x4818('0x13')]=_0x310029[_0x4818('0x13')];queues[_0x310029[_0x4818('0x5')]][_0x4818('0x35')]=_0x310029[_0x4818('0x35')];queues[_0x310029[_0x4818('0x5')]][_0x4818('0x31')]=_0x310029['connectedlinenum'];queues[_0x310029[_0x4818('0x5')]][_0x4818('0x32')]=_0x310029[_0x4818('0x32')];}}catch(_0x1f4ded){utils[_0x4818('0x15')](util[_0x4818('0x3')](_0x4818('0x30'),_0x310029[_0x4818('0x5')]),_0x1f4ded);}};exports[_0x4818('0x36')]=function(_0x1d5a9b){try{if(!_[_0x4818('0x25')](queues[_0x1d5a9b['uniqueid']])){utils['debug'](util[_0x4818('0x3')](_0x4818('0x37'),_0x1d5a9b['uniqueid']),_0x1d5a9b);utils['info'](util[_0x4818('0x3')]('[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s',_0x1d5a9b[_0x4818('0x5')],queues[_0x1d5a9b[_0x4818('0x5')]][_0x4818('0x1f')],_0x1d5a9b[_0x4818('0x38')],_0x1d5a9b['destaccountcode']));queues[_0x1d5a9b[_0x4818('0x5')]]['queuecallerabandon']=![];queues[_0x1d5a9b[_0x4818('0x5')]][_0x4818('0x18')]=![];queues[_0x1d5a9b[_0x4818('0x5')]]['queuecallerabandonAt']=null;queues[_0x1d5a9b[_0x4818('0x5')]][_0x4818('0x19')]=![];queues[_0x1d5a9b['uniqueid']][_0x4818('0x1c')]=null;queues[_0x1d5a9b['uniqueid']][_0x4818('0x27')]=null;queues[_0x1d5a9b[_0x4818('0x5')]]['assigned']=!![];queues[_0x1d5a9b[_0x4818('0x5')]]['accountcode']=_0x1d5a9b[_0x4818('0x39')];queues[_0x1d5a9b[_0x4818('0x5')]][_0x4818('0x8')]=_0x1d5a9b[_0x4818('0x38')];}}catch(_0x36f288){utils[_0x4818('0x15')](util['format'](_0x4818('0x37'),_0x1d5a9b[_0x4818('0x5')]),_0x36f288);}};exports[_0x4818('0x3a')]=function(_0x8db903){try{if(!_[_0x4818('0x25')](queues[_0x8db903[_0x4818('0x5')]])){if(queues[_0x8db903[_0x4818('0x5')]][_0x4818('0x17')]){utils[_0x4818('0x11')](util['format'](_0x4818('0x3b'),_0x8db903[_0x4818('0x5')]),_0x8db903);queues[_0x8db903[_0x4818('0x5')]][_0x4818('0x18')]=![];queues[_0x8db903[_0x4818('0x5')]]['queuecallerabandon']=![];queues[_0x8db903[_0x4818('0x5')]][_0x4818('0x26')]=null;queues[_0x8db903[_0x4818('0x5')]][_0x4818('0x19')]=![];queues[_0x8db903[_0x4818('0x5')]][_0x4818('0x27')]=null;queues[_0x8db903[_0x4818('0x5')]][_0x4818('0x3c')]=!![];queues[_0x8db903[_0x4818('0x5')]][_0x4818('0x8')]=_0x8db903[_0x4818('0x38')];queues[_0x8db903[_0x4818('0x5')]][_0x4818('0x1a')]=!![];queues[_0x8db903[_0x4818('0x5')]][_0x4818('0x3d')]=utils['now']();if(_0x8db903['reason']==_0x4818('0x3e')){if(!queues[_0x8db903[_0x4818('0x5')]][_0x4818('0x3e')]){queues[_0x8db903['uniqueid']][_0x4818('0x1c')]=_0x4818('0x3f');}}else{queues[_0x8db903[_0x4818('0x5')]]['queuecallerexitreason']='COMPLETEDBY'+_0x8db903[_0x4818('0x40')][_0x4818('0x28')]();}utils[_0x4818('0x2')](util[_0x4818('0x3')](_0x4818('0x41'),_0x8db903[_0x4818('0x5')],queues[_0x8db903[_0x4818('0x5')]][_0x4818('0x1f')],_0x8db903[_0x4818('0x38')],queues[_0x8db903[_0x4818('0x5')]][_0x4818('0x1c')]));writeDB(queues[_0x8db903[_0x4818('0x5')]]);}}}catch(_0x1a9588){utils[_0x4818('0x15')](util['format']('[%s][queues][agentcomplete]',_0x8db903[_0x4818('0x5')]),_0x1a9588);}};exports[_0x4818('0x42')]=function(_0xa8466b){try{if(!_[_0x4818('0x25')](queues[_0xa8466b[_0x4818('0x43')]])){utils[_0x4818('0x11')](util[_0x4818('0x3')]('[%s][queues][blindtransfer]',_0xa8466b[_0x4818('0x5')]),_0xa8466b);queues[_0xa8466b[_0x4818('0x43')]]['transfer']=!![];queues[_0xa8466b[_0x4818('0x43')]][_0x4818('0x44')]=_0x4818('0x45');queues[_0xa8466b[_0x4818('0x43')]][_0x4818('0x46')]=_0xa8466b[_0x4818('0x47')];queues[_0xa8466b[_0x4818('0x43')]][_0x4818('0x48')]=_0xa8466b[_0x4818('0x43')];queues[_0xa8466b[_0x4818('0x43')]]['queuecallerexitreason']='BLINDTRANSFER';utils['info'](util['format'](_0x4818('0x49'),_0xa8466b[_0x4818('0x5')],queues[_0xa8466b[_0x4818('0x43')]]['name'],_0xa8466b[_0x4818('0x43')],_0xa8466b[_0x4818('0x47')]));}}catch(_0x5e1fe0){utils[_0x4818('0x15')](util[_0x4818('0x3')](_0x4818('0x4a'),_0xa8466b[_0x4818('0x5')]),_0x5e1fe0);}};exports[_0x4818('0x4b')]=function(_0x13e9e3){try{utils[_0x4818('0x11')](util[_0x4818('0x3')](_0x4818('0x4c'),_0x13e9e3[_0x4818('0x4d')]),_0x13e9e3);if(_0x13e9e3[_0x4818('0x4d')]==_0x13e9e3[_0x4818('0x4e')]){if(!_[_0x4818('0x25')](queues[_0x13e9e3[_0x4818('0x4f')]])){utils['info'](util[_0x4818('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x13e9e3[_0x4818('0x4d')],queues[_0x13e9e3[_0x4818('0x4f')]][_0x4818('0x1f')],_0x13e9e3[_0x4818('0x50')]));queues[_0x13e9e3[_0x4818('0x4f')]]['transfer']=!![];queues[_0x13e9e3[_0x4818('0x4f')]]['transfertype']=_0x4818('0x51');queues[_0x13e9e3['secondtransfererlinkedid']]['transferexten']=_0x13e9e3['origtransfererexten'];queues[_0x13e9e3['secondtransfererlinkedid']][_0x4818('0x48')]=_0x13e9e3[_0x4818('0x4d')];queues[_0x13e9e3[_0x4818('0x4f')]]['queuecallerexitreason']='ATTENDEDTRANSFER';}if(!_[_0x4818('0x25')](queues[_0x13e9e3[_0x4818('0x4e')]])){if(_0x13e9e3[_0x4818('0x52')]&&queues[_0x13e9e3[_0x4818('0x52')]]){queues[_0x13e9e3[_0x4818('0x52')]][_0x4818('0x20')]=0x1;queues[_0x13e9e3[_0x4818('0x43')]]=_[_0x4818('0x53')](queues[_0x13e9e3['transfereelinkedid']]);queues[_0x13e9e3[_0x4818('0x43')]][_0x4818('0xf')]=_0x13e9e3['transfertargetuniqueid'];queues[_0x13e9e3[_0x4818('0x43')]][_0x4818('0x20')]=0x2;queues[_0x13e9e3['transfereeuniqueid']][_0x4818('0x9')]=queues[_0x13e9e3[_0x4818('0x4f')]][_0x4818('0x9')];queues[_0x13e9e3[_0x4818('0x43')]][_0x4818('0x54')]=queues[_0x13e9e3[_0x4818('0x4f')]][_0x4818('0x54')];queues[_0x13e9e3[_0x4818('0x43')]][_0x4818('0x34')]=utils[_0x4818('0x1b')]();queues[_0x13e9e3[_0x4818('0x43')]][_0x4818('0x17')]=utils['now']();queues[_0x13e9e3[_0x4818('0x43')]]['holdtime']=0x0;queues[_0x13e9e3[_0x4818('0x43')]][_0x4818('0x55')]=0x0;utils[_0x4818('0x2')](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s',_0x13e9e3['origtransfereruniqueid'],queues[_0x13e9e3[_0x4818('0x43')]][_0x4818('0x1f')],queues[_0x13e9e3[_0x4818('0x43')]]['calleridnum'],queues[_0x13e9e3['transfereeuniqueid']]['calleridname']));}else{utils[_0x4818('0x2')](util[_0x4818('0x3')](_0x4818('0x56'),_0x13e9e3[_0x4818('0x4d')],queues[_0x13e9e3['origtransfererlinkedid']]['name'],_0x13e9e3[_0x4818('0x4f')]));queues[_0x13e9e3[_0x4818('0x4e')]][_0x4818('0xf')]=_0x13e9e3[_0x4818('0x4f')];}}}else if(_0x13e9e3[_0x4818('0x57')]==_0x13e9e3[_0x4818('0x4f')]){if(!_[_0x4818('0x25')](queues[_0x13e9e3[_0x4818('0x4e')]])){utils['info'](util[_0x4818('0x3')](_0x4818('0x58'),_0x13e9e3['origtransfereruniqueid'],queues[_0x13e9e3['origtransfererlinkedid']][_0x4818('0x1f')],_0x13e9e3['secondtransfereruniqueid'],_0x13e9e3[_0x4818('0x59')]));queues[_0x13e9e3['origtransfererlinkedid']][_0x4818('0x3e')]=!![];queues[_0x13e9e3[_0x4818('0x4e')]][_0x4818('0x44')]=_0x4818('0x51');queues[_0x13e9e3[_0x4818('0x4e')]]['transferexten']=_0x13e9e3[_0x4818('0x59')];queues[_0x13e9e3[_0x4818('0x4e')]][_0x4818('0x48')]=_0x13e9e3[_0x4818('0x57')];queues[_0x13e9e3[_0x4818('0x4e')]][_0x4818('0x1c')]='ATTENDEDTRANSFER';}if(!_[_0x4818('0x25')](queues[_0x13e9e3[_0x4818('0x4f')]])){if(_0x13e9e3[_0x4818('0x5a')]&&queues[_0x13e9e3[_0x4818('0x5a')]]){queues[_0x13e9e3[_0x4818('0x5a')]][_0x4818('0x20')]=0x1;queues[_0x13e9e3[_0x4818('0x5b')]]=_[_0x4818('0x53')](queues[_0x13e9e3[_0x4818('0x5a')]]);queues[_0x13e9e3[_0x4818('0x5b')]]['transfereduniqueid']=_0x13e9e3['transfertargetuniqueid'];queues[_0x13e9e3[_0x4818('0x5b')]]['queuecallerenterreason']=0x2;queues[_0x13e9e3[_0x4818('0x5b')]]['calleridnum']=queues[_0x13e9e3[_0x4818('0x4e')]][_0x4818('0x9')];queues[_0x13e9e3[_0x4818('0x5b')]][_0x4818('0x54')]=queues[_0x13e9e3['origtransfererlinkedid']][_0x4818('0x54')];queues[_0x13e9e3[_0x4818('0x5b')]][_0x4818('0x34')]=utils[_0x4818('0x1b')]();queues[_0x13e9e3[_0x4818('0x5b')]][_0x4818('0x17')]=utils[_0x4818('0x1b')]();queues[_0x13e9e3[_0x4818('0x5b')]][_0x4818('0x5c')]=0x0;queues[_0x13e9e3[_0x4818('0x5b')]][_0x4818('0x55')]=0x0;utils[_0x4818('0x2')](util['format'](_0x4818('0x5d'),_0x13e9e3[_0x4818('0x4d')],queues[_0x13e9e3['transfertargetuniqueid']][_0x4818('0x1f')],queues[_0x13e9e3[_0x4818('0x5b')]][_0x4818('0xf')],queues[_0x13e9e3[_0x4818('0x5b')]][_0x4818('0x9')],queues[_0x13e9e3[_0x4818('0x5b')]][_0x4818('0x54')]));}else{utils['info'](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x13e9e3[_0x4818('0x4d')],queues[_0x13e9e3['secondtransfererlinkedid']][_0x4818('0x1f')],_0x13e9e3['origtransfererlinkedid']));queues[_0x13e9e3[_0x4818('0x4f')]]['transfereduniqueid']=_0x13e9e3[_0x4818('0x4e')];}}}}catch(_0x4147e5){utils[_0x4818('0x15')](util['format'](_0x4818('0x4c'),_0x13e9e3[_0x4818('0x4d')]),_0x4147e5);}};exports[_0x4818('0x5e')]=function(_0x544778){try{if(!_[_0x4818('0x25')](queues[_0x544778[_0x4818('0x5')]])){utils[_0x4818('0x11')](util['format']('[%s][queues][musiconholdstart]',_0x544778[_0x4818('0x5')]),_0x544778);queues[_0x544778[_0x4818('0x5')]][_0x4818('0x5f')]=utils[_0x4818('0x1b')]();utils[_0x4818('0x2')](util[_0x4818('0x3')](_0x4818('0x60'),_0x544778[_0x4818('0x5')],queues[_0x544778[_0x4818('0x5')]][_0x4818('0x1f')],queues[_0x544778[_0x4818('0x5')]][_0x4818('0x5f')]));}}catch(_0x3a8de2){utils[_0x4818('0x15')](util[_0x4818('0x3')](_0x4818('0x61'),_0x544778['uniqueid']),_0x3a8de2);}};exports[_0x4818('0x62')]=function(_0x394d62){try{if(!_[_0x4818('0x25')](queues[_0x394d62[_0x4818('0x5')]])){if(!_[_0x4818('0x25')](queues[_0x394d62['uniqueid']][_0x4818('0x5f')])){utils['debug'](util['format'](_0x4818('0x63'),_0x394d62[_0x4818('0x5')]),_0x394d62);queues[_0x394d62[_0x4818('0x5')]][_0x4818('0x55')]+=utils[_0x4818('0x33')](utils[_0x4818('0x1b')](),queues[_0x394d62['uniqueid']][_0x4818('0x5f')]);utils['info'](util[_0x4818('0x3')]('[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s',_0x394d62['uniqueid'],queues[_0x394d62[_0x4818('0x5')]][_0x4818('0x1f')],queues[_0x394d62[_0x4818('0x5')]][_0x4818('0x55')]));delete queues[_0x394d62['uniqueid']]['musiconholdstartAt'];}}}catch(_0x1ffa39){utils['error'](util[_0x4818('0x3')](_0x4818('0x63'),_0x394d62[_0x4818('0x5')]),_0x1ffa39);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index 93bcce7..9285687 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 _0x1164=['context','exten','channel','newstate','[%s][recordings][newstate]','[%s][recordings][newstate]\x20context:%s\x20channel:%s','isNil','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','error','varset','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','replace','.WAV','monitors','push','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','cause-txt','connectedlinenum','connectedlinename','type','clone','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','lodash','info','format','[%s][recordings][writeDB]','uniqueid','accountcode','getUserByInternal','UserId','request','CreateVoiceRecording','debug','[%s][recordings][newchannel]','linkedid'];(function(_0x18ccd6,_0x1098e8){var _0x587d2c=function(_0x460ad6){while(--_0x460ad6){_0x18ccd6['push'](_0x18ccd6['shift']());}};_0x587d2c(++_0x1098e8);}(_0x1164,0x1b3));var _0x4116=function(_0x119f23,_0x36ca9b){_0x119f23=_0x119f23-0x0;var _0x5a94c0=_0x1164[_0x119f23];return _0x5a94c0;};'use strict';var _=require(_0x4116('0x0'));var util=require('util');var utils=require('./utils');var recordings={};function writeDB(_0x54171a){utils[_0x4116('0x1')](util[_0x4116('0x2')](_0x4116('0x3'),_0x54171a[_0x4116('0x4')]));if(_0x54171a[_0x4116('0x5')]){utils[_0x4116('0x6')](_0x54171a[_0x4116('0x5')])['then'](function(_0x4a31cb){if(_0x4a31cb){_0x54171a['membername']=_0x4a31cb['name'];_0x54171a[_0x4116('0x7')]=_0x4a31cb['id'];}utils[_0x4116('0x8')]('CreateVoiceRecording',_0x54171a);});}else{utils[_0x4116('0x8')](_0x4116('0x9'),_0x54171a);}}exports['newchannel']=function(_0x2214ad){try{utils[_0x4116('0xa')](util[_0x4116('0x2')](_0x4116('0xb'),_0x2214ad['uniqueid']),_0x2214ad);if(_0x2214ad[_0x4116('0x4')]==_0x2214ad[_0x4116('0xc')]){utils[_0x4116('0x1')](util[_0x4116('0x2')]('[%s][recordings][newchannel]\x20context:%s\x20exten:%s',_0x2214ad[_0x4116('0x4')],_0x2214ad[_0x4116('0xd')],_0x2214ad[_0x4116('0xe')]));recordings[_0x2214ad[_0x4116('0x4')]]={'uniqueid':_0x2214ad[_0x4116('0x4')],'accountcode':_0x2214ad[_0x4116('0x5')],'exten':_0x2214ad[_0x4116('0xe')],'context':_0x2214ad[_0x4116('0xd')],'channel':_0x2214ad[_0x4116('0xf')],'monitors':[]};}}catch(_0x4a54cb){utils['error'](util[_0x4116('0x2')]('[%s][recordings][newchannel]',_0x2214ad[_0x4116('0x4')]),_0x4a54cb);}};exports[_0x4116('0x10')]=function(_0x46904e){try{utils[_0x4116('0xa')](util['format'](_0x4116('0x11'),_0x46904e[_0x4116('0x4')]),_0x46904e);if(!_['isNil'](recordings[_0x46904e[_0x4116('0x4')]])&&_0x46904e['channelstate']==0x6){utils[_0x4116('0x1')](util[_0x4116('0x2')](_0x4116('0x12'),_0x46904e[_0x4116('0x4')],_0x46904e[_0x4116('0xd')],_0x46904e[_0x4116('0xf')]));}else if(!_[_0x4116('0x13')](recordings[_0x46904e[_0x4116('0xc')]])&&_0x46904e['channelstate']==0x6&&_0x46904e[_0x4116('0xd')]!='transfer'){utils[_0x4116('0x1')](util[_0x4116('0x2')](_0x4116('0x14'),_0x46904e[_0x4116('0x4')],_0x46904e[_0x4116('0xc')],_0x46904e[_0x4116('0xd')],_0x46904e[_0x4116('0xf')]));recordings[_0x46904e[_0x4116('0xc')]][_0x4116('0x5')]=_0x46904e[_0x4116('0x5')];}}catch(_0x15b0bc){utils[_0x4116('0x15')](util[_0x4116('0x2')](_0x4116('0x11'),_0x46904e[_0x4116('0x4')]),_0x15b0bc);}};exports[_0x4116('0x16')]=function(_0x5ff02c){try{if(!_[_0x4116('0x13')](_0x5ff02c[_0x4116('0x17')])&&!_[_0x4116('0x13')](_0x5ff02c[_0x4116('0x17')][_0x4116('0x18')])){utils[_0x4116('0xa')](util[_0x4116('0x2')](_0x4116('0x19'),_0x5ff02c[_0x4116('0x4')]),_0x5ff02c);utils['info'](util[_0x4116('0x2')](_0x4116('0x1a'),_0x5ff02c['uniqueid'],_0x5ff02c[_0x4116('0x17')],_0x5ff02c[_0x4116('0x1b')]));if(_['endsWith'](_0x5ff02c[_0x4116('0x1b')],'.wav49')){_0x5ff02c[_0x4116('0x1b')]=_0x5ff02c[_0x4116('0x1b')][_0x4116('0x1c')]('.wav49',_0x4116('0x1d'));}if(recordings[_0x5ff02c[_0x4116('0xc')]]){var _0x5d77b5=_['find'](recordings[_0x5ff02c[_0x4116('0xc')]][_0x4116('0x1e')],{'value':_0x5ff02c[_0x4116('0x1b')]});if(_['isNil'](_0x5d77b5)){recordings[_0x5ff02c[_0x4116('0xc')]][_0x4116('0x1e')][_0x4116('0x1f')]({'value':_0x5ff02c[_0x4116('0x1b')]});}}}}catch(_0x262816){utils['error'](util[_0x4116('0x2')](_0x4116('0x19'),_0x5ff02c[_0x4116('0x4')]),_0x262816);}};exports['hangup']=function(_0x1d66f5){try{if(!_[_0x4116('0x13')](recordings[_0x1d66f5[_0x4116('0x4')]])){utils['debug'](util[_0x4116('0x2')](_0x4116('0x20'),_0x1d66f5[_0x4116('0x4')]),_0x1d66f5);utils['info'](util[_0x4116('0x2')](_0x4116('0x21'),_0x1d66f5[_0x4116('0x4')],_0x1d66f5[_0x4116('0x22')],_0x1d66f5[_0x4116('0x23')],_0x1d66f5[_0x4116('0x24')]));recordings[_0x1d66f5[_0x4116('0x4')]][_0x4116('0x22')]=_0x1d66f5[_0x4116('0x22')];recordings[_0x1d66f5[_0x4116('0x4')]][_0x4116('0x23')]=_0x1d66f5[_0x4116('0x23')];recordings[_0x1d66f5[_0x4116('0x4')]]['connectedlinenum']=_0x1d66f5[_0x4116('0x25')];recordings[_0x1d66f5[_0x4116('0x4')]][_0x4116('0x26')]=_0x1d66f5[_0x4116('0x26')];if(recordings[_0x1d66f5[_0x4116('0x4')]][_0x4116('0x27')]=='outbound'&&recordings[_0x1d66f5[_0x4116('0x4')]]['accountcode']){recordings[_0x1d66f5[_0x4116('0x4')]][_0x4116('0x25')]=recordings[_0x1d66f5[_0x4116('0x4')]]['accountcode'];recordings[_0x1d66f5[_0x4116('0x4')]][_0x4116('0x26')]='';}recordings[_0x1d66f5[_0x4116('0x4')]][_0x4116('0x1e')]['forEach'](function(_0x565a7d){var _0x14d50f=_[_0x4116('0x28')](recordings[_0x1d66f5[_0x4116('0x4')]]);_0x14d50f['value']=_0x565a7d[_0x4116('0x1b')];writeDB(_0x14d50f);});delete recordings[_0x1d66f5[_0x4116('0x4')]];}}catch(_0x3e97df){utils[_0x4116('0x15')](util[_0x4116('0x2')](_0x4116('0x20'),_0x1d66f5[_0x4116('0x4')]),_0x3e97df);}};exports[_0x4116('0x29')]=function(_0x40f552){try{if(!_[_0x4116('0x13')](recordings[_0x40f552[_0x4116('0x4')]])){utils[_0x4116('0xa')](util[_0x4116('0x2')](_0x4116('0x2a'),_0x40f552[_0x4116('0x4')]),_0x40f552);utils[_0x4116('0x1')](util[_0x4116('0x2')](_0x4116('0x2b'),_0x40f552[_0x4116('0x4')],_0x40f552[_0x4116('0x2c')],_0x40f552[_0x4116('0x2d')]));if(_0x40f552['application'][_0x4116('0x2e')]()==_0x4116('0x2f')&&_[_0x4116('0x30')](_0x40f552['appdata']['toLowerCase'](),_0x4116('0x31'))){var _0x43d7a8=_0x40f552[_0x4116('0x2d')]['split']('=');var _0xa94e47=_0x43d7a8[0x0][_0x4116('0x32')](_0x43d7a8[0x0][_0x4116('0x33')]('(')+0x1,_0x43d7a8[0x0][_0x4116('0x33')](')'));var _0x3784cc=_0x43d7a8[0x1];recordings[_0x40f552[_0x4116('0x4')]][_0xa94e47]=_0x3784cc;}}}catch(_0x254c58){utils[_0x4116('0x15')](util[_0x4116('0x2')]('[%s][recordings][newexten]',_0x40f552['uniqueid']),_0x254c58);}};exports[_0x4116('0x34')]=function(_0x5f41b3){try{if(!_[_0x4116('0x13')](recordings[_0x5f41b3['uniqueid']])){utils[_0x4116('0xa')](util['format'](_0x4116('0x35'),_0x5f41b3[_0x4116('0x4')]),_0x5f41b3);utils[_0x4116('0x1')](util[_0x4116('0x2')](_0x4116('0x36'),_0x5f41b3[_0x4116('0x4')],_0x5f41b3[_0x4116('0x37')]));recordings[_0x5f41b3['uniqueid']]['queue']=_0x5f41b3[_0x4116('0x37')];}}catch(_0x21eb13){utils[_0x4116('0x15')](util[_0x4116('0x2')]('[%s][recordings][queuecallerjoin]',_0x5f41b3[_0x4116('0x4')]),_0x21eb13);}}; \ No newline at end of file +var _0x2771=['exten','channel','[%s][recordings][newstate]','isNil','channelstate','transfer','error','varset','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','replace','.wav49','find','monitors','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridname','cause-txt','calleridnum','connectedlinenum','connectedlinename','outbound','forEach','clone','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','appdata','toLowerCase','set','startsWith','split','lastIndexOf','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','lodash','./utils','info','format','[%s][recordings][writeDB]','uniqueid','accountcode','then','membername','name','UserId','request','CreateVoiceRecording','debug','[%s][recordings][newchannel]','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context'];(function(_0x54b324,_0xeb5725){var _0x4db43a=function(_0x3b926e){while(--_0x3b926e){_0x54b324['push'](_0x54b324['shift']());}};_0x4db43a(++_0xeb5725);}(_0x2771,0xd6));var _0x1277=function(_0x4d90ac,_0x2985ae){_0x4d90ac=_0x4d90ac-0x0;var _0x5a1d5a=_0x2771[_0x4d90ac];return _0x5a1d5a;};'use strict';var _=require(_0x1277('0x0'));var util=require('util');var utils=require(_0x1277('0x1'));var recordings={};function writeDB(_0x17bfb5){utils[_0x1277('0x2')](util[_0x1277('0x3')](_0x1277('0x4'),_0x17bfb5[_0x1277('0x5')]));if(_0x17bfb5['accountcode']){utils['getUserByInternal'](_0x17bfb5[_0x1277('0x6')])[_0x1277('0x7')](function(_0xdc4089){if(_0xdc4089){_0x17bfb5[_0x1277('0x8')]=_0xdc4089[_0x1277('0x9')];_0x17bfb5[_0x1277('0xa')]=_0xdc4089['id'];}utils[_0x1277('0xb')]('CreateVoiceRecording',_0x17bfb5);});}else{utils[_0x1277('0xb')](_0x1277('0xc'),_0x17bfb5);}}exports['newchannel']=function(_0xbbffdd){try{utils[_0x1277('0xd')](util[_0x1277('0x3')](_0x1277('0xe'),_0xbbffdd[_0x1277('0x5')]),_0xbbffdd);if(_0xbbffdd[_0x1277('0x5')]==_0xbbffdd[_0x1277('0xf')]){utils[_0x1277('0x2')](util[_0x1277('0x3')](_0x1277('0x10'),_0xbbffdd[_0x1277('0x5')],_0xbbffdd[_0x1277('0x11')],_0xbbffdd[_0x1277('0x12')]));recordings[_0xbbffdd[_0x1277('0x5')]]={'uniqueid':_0xbbffdd[_0x1277('0x5')],'accountcode':_0xbbffdd[_0x1277('0x6')],'exten':_0xbbffdd['exten'],'context':_0xbbffdd[_0x1277('0x11')],'channel':_0xbbffdd[_0x1277('0x13')],'monitors':[]};}}catch(_0x4a31ac){utils['error'](util[_0x1277('0x3')]('[%s][recordings][newchannel]',_0xbbffdd[_0x1277('0x5')]),_0x4a31ac);}};exports['newstate']=function(_0x277981){try{utils['debug'](util[_0x1277('0x3')](_0x1277('0x14'),_0x277981[_0x1277('0x5')]),_0x277981);if(!_[_0x1277('0x15')](recordings[_0x277981[_0x1277('0x5')]])&&_0x277981[_0x1277('0x16')]==0x6){utils[_0x1277('0x2')](util[_0x1277('0x3')]('[%s][recordings][newstate]\x20context:%s\x20channel:%s',_0x277981['uniqueid'],_0x277981[_0x1277('0x11')],_0x277981[_0x1277('0x13')]));}else if(!_['isNil'](recordings[_0x277981[_0x1277('0xf')]])&&_0x277981[_0x1277('0x16')]==0x6&&_0x277981['context']!=_0x1277('0x17')){utils['info'](util[_0x1277('0x3')]('[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x277981[_0x1277('0x5')],_0x277981['linkedid'],_0x277981['context'],_0x277981[_0x1277('0x13')]));recordings[_0x277981[_0x1277('0xf')]][_0x1277('0x6')]=_0x277981['accountcode'];}}catch(_0x52bdc3){utils[_0x1277('0x18')](util[_0x1277('0x3')]('[%s][recordings][newstate]',_0x277981['uniqueid']),_0x52bdc3);}};exports[_0x1277('0x19')]=function(_0x5f0bf0){try{if(!_[_0x1277('0x15')](_0x5f0bf0[_0x1277('0x1a')])&&!_[_0x1277('0x15')](_0x5f0bf0[_0x1277('0x1a')][_0x1277('0x1b')])){utils[_0x1277('0xd')](util[_0x1277('0x3')](_0x1277('0x1c'),_0x5f0bf0['uniqueid']),_0x5f0bf0);utils[_0x1277('0x2')](util[_0x1277('0x3')](_0x1277('0x1d'),_0x5f0bf0[_0x1277('0x5')],_0x5f0bf0[_0x1277('0x1a')],_0x5f0bf0[_0x1277('0x1e')]));if(_[_0x1277('0x1f')](_0x5f0bf0[_0x1277('0x1e')],'.wav49')){_0x5f0bf0[_0x1277('0x1e')]=_0x5f0bf0['value'][_0x1277('0x20')](_0x1277('0x21'),'.WAV');}if(recordings[_0x5f0bf0['linkedid']]){var _0x57422c=_[_0x1277('0x22')](recordings[_0x5f0bf0[_0x1277('0xf')]][_0x1277('0x23')],{'value':_0x5f0bf0[_0x1277('0x1e')]});if(_[_0x1277('0x15')](_0x57422c)){recordings[_0x5f0bf0[_0x1277('0xf')]]['monitors']['push']({'value':_0x5f0bf0['value']});}}}}catch(_0x3eaa2f){utils['error'](util[_0x1277('0x3')]('[%s][recordings][varset]',_0x5f0bf0['uniqueid']),_0x3eaa2f);}};exports['hangup']=function(_0x3ed33e){try{if(!_[_0x1277('0x15')](recordings[_0x3ed33e[_0x1277('0x5')]])){utils[_0x1277('0xd')](util[_0x1277('0x3')](_0x1277('0x24'),_0x3ed33e[_0x1277('0x5')]),_0x3ed33e);utils[_0x1277('0x2')](util[_0x1277('0x3')](_0x1277('0x25'),_0x3ed33e[_0x1277('0x5')],_0x3ed33e['calleridnum'],_0x3ed33e[_0x1277('0x26')],_0x3ed33e[_0x1277('0x27')]));recordings[_0x3ed33e['uniqueid']][_0x1277('0x28')]=_0x3ed33e[_0x1277('0x28')];recordings[_0x3ed33e[_0x1277('0x5')]][_0x1277('0x26')]=_0x3ed33e[_0x1277('0x26')];recordings[_0x3ed33e[_0x1277('0x5')]]['connectedlinenum']=_0x3ed33e[_0x1277('0x29')];recordings[_0x3ed33e['uniqueid']]['connectedlinename']=_0x3ed33e[_0x1277('0x2a')];if(recordings[_0x3ed33e['uniqueid']]['type']==_0x1277('0x2b')&&recordings[_0x3ed33e[_0x1277('0x5')]][_0x1277('0x6')]){recordings[_0x3ed33e['uniqueid']]['connectedlinenum']=recordings[_0x3ed33e[_0x1277('0x5')]][_0x1277('0x6')];recordings[_0x3ed33e['uniqueid']][_0x1277('0x2a')]='';}recordings[_0x3ed33e[_0x1277('0x5')]][_0x1277('0x23')][_0x1277('0x2c')](function(_0x27ce67){var _0x4b5771=_[_0x1277('0x2d')](recordings[_0x3ed33e[_0x1277('0x5')]]);_0x4b5771[_0x1277('0x1e')]=_0x27ce67[_0x1277('0x1e')];writeDB(_0x4b5771);});delete recordings[_0x3ed33e[_0x1277('0x5')]];}}catch(_0x134147){utils[_0x1277('0x18')](util[_0x1277('0x3')](_0x1277('0x24'),_0x3ed33e[_0x1277('0x5')]),_0x134147);}};exports[_0x1277('0x2e')]=function(_0x30f0b8){try{if(!_[_0x1277('0x15')](recordings[_0x30f0b8[_0x1277('0x5')]])){utils[_0x1277('0xd')](util[_0x1277('0x3')](_0x1277('0x2f'),_0x30f0b8[_0x1277('0x5')]),_0x30f0b8);utils['info'](util[_0x1277('0x3')](_0x1277('0x30'),_0x30f0b8[_0x1277('0x5')],_0x30f0b8['application'],_0x30f0b8[_0x1277('0x31')]));if(_0x30f0b8['application'][_0x1277('0x32')]()==_0x1277('0x33')&&_[_0x1277('0x34')](_0x30f0b8[_0x1277('0x31')][_0x1277('0x32')](),'cdr')){var _0x2ccb58=_0x30f0b8['appdata'][_0x1277('0x35')]('=');var _0x14e4b2=_0x2ccb58[0x0]['substring'](_0x2ccb58[0x0]['lastIndexOf']('(')+0x1,_0x2ccb58[0x0][_0x1277('0x36')](')'));var _0x316d48=_0x2ccb58[0x1];recordings[_0x30f0b8[_0x1277('0x5')]][_0x14e4b2]=_0x316d48;}}}catch(_0x160fb1){utils[_0x1277('0x18')](util[_0x1277('0x3')](_0x1277('0x2f'),_0x30f0b8['uniqueid']),_0x160fb1);}};exports['queuecallerjoin']=function(_0x5d213b){try{if(!_['isNil'](recordings[_0x5d213b['uniqueid']])){utils[_0x1277('0xd')](util['format'](_0x1277('0x37'),_0x5d213b[_0x1277('0x5')]),_0x5d213b);utils['info'](util[_0x1277('0x3')](_0x1277('0x38'),_0x5d213b[_0x1277('0x5')],_0x5d213b[_0x1277('0x39')]));recordings[_0x5d213b[_0x1277('0x5')]][_0x1277('0x39')]=_0x5d213b[_0x1277('0x39')];}}catch(_0x5e3945){utils['error'](util[_0x1277('0x3')]('[%s][recordings][queuecallerjoin]',_0x5d213b[_0x1277('0x5')]),_0x5e3945);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index 05747bb..2cb0ea2 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 _0x3d26=['origtransfererchannel','origtransferercalleridname','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','isNil','transfereechannel','assign','transfertargetchannel','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','[%s][transfers][attendedtransfer]','./utils','info','format','[%s][transfers][writeDB]\x20type:%s','type','attended','origtransfereruniqueid','uniqueid','request','blinds','blindtransfer','transfereecalleridname','blind','transfereruniqueid','error','[%s][transfers][blindtransfer]','attendedtransfer','debug','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transfertargetcalleridnum'];(function(_0x1b0ad7,_0x161cda){var _0x473015=function(_0x3469df){while(--_0x3469df){_0x1b0ad7['push'](_0x1b0ad7['shift']());}};_0x473015(++_0x161cda);}(_0x3d26,0xd0));var _0x63d2=function(_0x4480b9,_0x5c2949){_0x4480b9=_0x4480b9-0x0;var _0x3f0f02=_0x3d26[_0x4480b9];return _0x3f0f02;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0x63d2('0x0'));function writeDB(_0x38ff8a){utils[_0x63d2('0x1')](util[_0x63d2('0x2')](_0x63d2('0x3'),_0x38ff8a[_0x63d2('0x4')]===_0x63d2('0x5')?_0x38ff8a[_0x63d2('0x6')]:_0x38ff8a[_0x63d2('0x7')],_0x38ff8a[_0x63d2('0x4')]));utils[_0x63d2('0x8')]('CreateVoiceTransferReport',_0x38ff8a);}exports[_0x63d2('0x9')]={};exports[_0x63d2('0xa')]=function(_0x1e19cc){try{utils['debug'](util[_0x63d2('0x2')]('[%s][transfers][blindtransfer]',_0x1e19cc[_0x63d2('0x7')]),_0x1e19cc);utils['info'](util[_0x63d2('0x2')]('[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x1e19cc['uniqueid'],_0x1e19cc['transferercalleridnum'],_0x1e19cc['transferercalleridname'],_0x1e19cc['transfereecalleridnum'],_0x1e19cc[_0x63d2('0xb')]));_0x1e19cc[_0x63d2('0x4')]=_0x63d2('0xc');exports[_0x63d2('0x9')][_0x1e19cc[_0x63d2('0xd')]]=_0x1e19cc;writeDB(_0x1e19cc);}catch(_0x84ca9c){utils[_0x63d2('0xe')](util[_0x63d2('0x2')](_0x63d2('0xf'),_0x1e19cc[_0x63d2('0x7')]),_0x84ca9c);}};exports[_0x63d2('0x10')]=function(_0x26d5a3){try{utils[_0x63d2('0x11')](util[_0x63d2('0x2')]('[%s][transfers][attendedtransfer]',_0x26d5a3[_0x63d2('0x6')]),_0x26d5a3);utils[_0x63d2('0x1')](util[_0x63d2('0x2')](_0x63d2('0x12'),_0x26d5a3[_0x63d2('0x6')],_0x26d5a3['origtransferercalleridnum'],_0x26d5a3['origtransferercalleridname'],_0x26d5a3[_0x63d2('0x13')],_0x26d5a3['transfertargetcalleridname']));_0x26d5a3=_['assign'](_0x26d5a3,{'transfererchannel':_0x26d5a3[_0x63d2('0x14')],'transferercalleridnum':_0x26d5a3['origtransferercalleridnum'],'transferercalleridname':_0x26d5a3[_0x63d2('0x15')],'transfererconnectedlinenum':_0x26d5a3['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x26d5a3['secondtransfererconnectedlinename'],'transfereraccountcode':_0x26d5a3[_0x63d2('0x16')],'transferercontext':_0x26d5a3[_0x63d2('0x17')],'transfererexten':_0x26d5a3[_0x63d2('0x18')],'transfererlinkedid':_0x26d5a3[_0x63d2('0x19')],'context':_0x26d5a3['origtransferercontext'],'extension':_0x26d5a3['origtransfererexten'],'type':_0x63d2('0x5')});if(_[_0x63d2('0x1a')](_0x26d5a3[_0x63d2('0x1b')])){_0x26d5a3=_[_0x63d2('0x1c')](_0x26d5a3,{'transfereechannel':_0x26d5a3[_0x63d2('0x1d')],'transfereecalleridnum':_0x26d5a3[_0x63d2('0x13')],'transfereecalleridname':_0x26d5a3[_0x63d2('0x1e')],'transfereeconnectedlinenum':_0x26d5a3[_0x63d2('0x1f')],'transfereeconnectedlinename':_0x26d5a3[_0x63d2('0x20')],'transfereeaccountcode':_0x26d5a3[_0x63d2('0x21')],'transfereecontext':_0x26d5a3[_0x63d2('0x22')],'transfereeexten':_0x26d5a3[_0x63d2('0x23')],'transfereelinkedid':_0x26d5a3[_0x63d2('0x24')]});}writeDB(_0x26d5a3);}catch(_0x4de1b6){utils['error'](util[_0x63d2('0x2')](_0x63d2('0x25'),_0x26d5a3['origtransfereruniqueid']),_0x4de1b6);}}; \ No newline at end of file +var _0x5a97=['transfereecalleridname','blind','blinds','[%s][transfers][blindtransfer]','attendedtransfer','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','assign','origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','transfereechannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetcontext','transfertargetexten','transfertargetlinkedid','error','util','info','type','attended','origtransfereruniqueid','request','debug','format','uniqueid','transferercalleridnum','transferercalleridname','transfereecalleridnum'];(function(_0x412514,_0x2682f8){var _0x4d9f5c=function(_0x449938){while(--_0x449938){_0x412514['push'](_0x412514['shift']());}};_0x4d9f5c(++_0x2682f8);}(_0x5a97,0x134));var _0x75a9=function(_0x30c6fb,_0x2b15bd){_0x30c6fb=_0x30c6fb-0x0;var _0x5d0b3e=_0x5a97[_0x30c6fb];return _0x5d0b3e;};'use strict';var _=require('lodash');var util=require(_0x75a9('0x0'));var utils=require('./utils');function writeDB(_0x35b6d1){utils[_0x75a9('0x1')](util['format']('[%s][transfers][writeDB]\x20type:%s',_0x35b6d1[_0x75a9('0x2')]===_0x75a9('0x3')?_0x35b6d1[_0x75a9('0x4')]:_0x35b6d1['uniqueid'],_0x35b6d1[_0x75a9('0x2')]));utils[_0x75a9('0x5')]('CreateVoiceTransferReport',_0x35b6d1);}exports['blinds']={};exports['blindtransfer']=function(_0x44f462){try{utils[_0x75a9('0x6')](util[_0x75a9('0x7')]('[%s][transfers][blindtransfer]',_0x44f462['uniqueid']),_0x44f462);utils[_0x75a9('0x1')](util[_0x75a9('0x7')]('[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x44f462[_0x75a9('0x8')],_0x44f462[_0x75a9('0x9')],_0x44f462[_0x75a9('0xa')],_0x44f462[_0x75a9('0xb')],_0x44f462[_0x75a9('0xc')]));_0x44f462[_0x75a9('0x2')]=_0x75a9('0xd');exports[_0x75a9('0xe')][_0x44f462['transfereruniqueid']]=_0x44f462;writeDB(_0x44f462);}catch(_0x7e3780){utils['error'](util[_0x75a9('0x7')](_0x75a9('0xf'),_0x44f462['uniqueid']),_0x7e3780);}};exports[_0x75a9('0x10')]=function(_0x3703d6){try{utils[_0x75a9('0x6')](util[_0x75a9('0x7')](_0x75a9('0x11'),_0x3703d6[_0x75a9('0x4')]),_0x3703d6);utils['info'](util['format'](_0x75a9('0x12'),_0x3703d6[_0x75a9('0x4')],_0x3703d6[_0x75a9('0x13')],_0x3703d6[_0x75a9('0x14')],_0x3703d6[_0x75a9('0x15')],_0x3703d6[_0x75a9('0x16')]));_0x3703d6=_[_0x75a9('0x17')](_0x3703d6,{'transfererchannel':_0x3703d6[_0x75a9('0x18')],'transferercalleridnum':_0x3703d6['origtransferercalleridnum'],'transferercalleridname':_0x3703d6[_0x75a9('0x14')],'transfererconnectedlinenum':_0x3703d6[_0x75a9('0x19')],'transfererconnectedlinename':_0x3703d6[_0x75a9('0x1a')],'transfereraccountcode':_0x3703d6[_0x75a9('0x1b')],'transferercontext':_0x3703d6[_0x75a9('0x1c')],'transfererexten':_0x3703d6[_0x75a9('0x1d')],'transfererlinkedid':_0x3703d6[_0x75a9('0x1e')],'context':_0x3703d6[_0x75a9('0x1f')],'extension':_0x3703d6[_0x75a9('0x20')],'type':_0x75a9('0x3')});if(_['isNil'](_0x3703d6[_0x75a9('0x21')])){_0x3703d6=_[_0x75a9('0x17')](_0x3703d6,{'transfereechannel':_0x3703d6['transfertargetchannel'],'transfereecalleridnum':_0x3703d6[_0x75a9('0x15')],'transfereecalleridname':_0x3703d6[_0x75a9('0x16')],'transfereeconnectedlinenum':_0x3703d6[_0x75a9('0x22')],'transfereeconnectedlinename':_0x3703d6[_0x75a9('0x23')],'transfereeaccountcode':_0x3703d6['transfertargetaccountcode'],'transfereecontext':_0x3703d6[_0x75a9('0x24')],'transfereeexten':_0x3703d6[_0x75a9('0x25')],'transfereelinkedid':_0x3703d6[_0x75a9('0x26')]});}writeDB(_0x3703d6);}catch(_0x230f18){utils[_0x75a9('0x27')](util['format'](_0x75a9('0x11'),_0x3703d6[_0x75a9('0x4')]),_0x230f18);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 08ce1b0..54cf072 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 _0xb344=['YYYY-MM-DD\x20HH:mm:ss','subtract','seconds','diffTime','diff','sumTime','now','isAfter','isBefore','bluebird','jayson/promise','moment','util','client','http','../../config/logger','info','inspect','debug','error','[utils][request]\x20name:%s','catch','request','GetUser','name','interface','result','length','getUserByInternal','then','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','[utils][getUserByInternal]','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','getVoiceQueueByName','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]','addTime','format'];(function(_0x40da98,_0x22393e){var _0x183a3f=function(_0x5b12f9){while(--_0x5b12f9){_0x40da98['push'](_0x40da98['shift']());}};_0x183a3f(++_0x22393e);}(_0xb344,0x152));var _0x4b34=function(_0x34bc5e,_0x538eb4){_0x34bc5e=_0x34bc5e-0x0;var _0x3e6969=_0xb344[_0x34bc5e];return _0x3e6969;};'use strict';var BPromise=require(_0x4b34('0x0'));var jayson=require(_0x4b34('0x1'));var moment=require(_0x4b34('0x2'));var util=require(_0x4b34('0x3'));var client=jayson[_0x4b34('0x4')][_0x4b34('0x5')]({'port':0x2329});var logger=require(_0x4b34('0x6'))('xdr');exports[_0x4b34('0x7')]=function(_0x423b07,_0x9f7bf3){logger['info'](_0x423b07,_0x9f7bf3?util[_0x4b34('0x8')](_0x9f7bf3,{'showHidden':![],'depth':null}):'');};exports[_0x4b34('0x9')]=function(_0x575e23,_0x2410de){logger['debug'](_0x575e23,_0x2410de?util[_0x4b34('0x8')](_0x2410de,{'showHidden':![],'depth':null}):'');};exports[_0x4b34('0xa')]=function(_0x5c0c48,_0x20ea42){logger['error'](_0x5c0c48,_0x20ea42?util['inspect'](_0x20ea42,{'showHidden':![],'depth':null}):'');};exports['request']=function(_0x55e478,_0x334df8){return client['request'](_0x55e478,{'body':_0x334df8})['then'](function(_0x5b8f38){logger[_0x4b34('0x9')](_0x4b34('0xb'),_0x55e478,_0x5b8f38?util[_0x4b34('0x8')](_0x5b8f38,{'showHidden':![],'depth':null}):'');})[_0x4b34('0xc')](function(_0x24212a){logger[_0x4b34('0xa')](_0x4b34('0xb'),_0x55e478,_0x24212a?util[_0x4b34('0x8')](_0x24212a,{'showHidden':![],'depth':null}):'');});};function getUser(_0x179efe){return client[_0x4b34('0xd')](_0x4b34('0xe'),{'options':{'raw':!![],'attributes':['id','internal',_0x4b34('0xf'),_0x4b34('0x10')],'where':_0x179efe,'limit':0x1}})['then'](function(_0x10ac9c){logger[_0x4b34('0x9')]('[utils][getUser]\x20where:%s',JSON['stringify'](_0x179efe),_0x10ac9c?util[_0x4b34('0x8')](_0x10ac9c,{'showHidden':![],'depth':null}):'');return _0x10ac9c[_0x4b34('0x11')][_0x4b34('0x12')]?_0x10ac9c[_0x4b34('0x11')][0x0]:null;});}exports[_0x4b34('0x13')]=function(_0x47fb36){return new BPromise(function(_0x558485,_0x5d055d){if(_0x47fb36){return getUser({'internal':_0x47fb36})[_0x4b34('0x14')](function(_0xcec619){logger['info'](_0x4b34('0x15'),_0x47fb36,_0xcec619?_0x4b34('0x16'):_0x4b34('0x17'));return _0x558485(_0xcec619);})[_0x4b34('0xc')](function(_0x5fdbfc){logger[_0x4b34('0xa')](_0x4b34('0x18'),_0x5fdbfc?util['inspect'](_0x5fdbfc,{'showHidden':![],'depth':null}):'');return _0x558485(null);});}return _0x558485(null);});};exports['getUserByInterface']=function(_0x4cb93f){return new BPromise(function(_0x19a8d7,_0x57d5b8){if(_0x4cb93f){return getUser({'interface':_0x4cb93f})[_0x4b34('0x14')](function(_0x18931f){logger['info'](_0x4b34('0x19'),_0x4cb93f,_0x18931f?_0x4b34('0x16'):_0x4b34('0x17'));return _0x19a8d7(_0x18931f);})[_0x4b34('0xc')](function(_0x1d88b4){logger[_0x4b34('0xa')](_0x4b34('0x1a'),_0x1d88b4?util['inspect'](_0x1d88b4,{'showHidden':![],'depth':null}):'');return _0x19a8d7(null);});}return _0x19a8d7(null);});};exports[_0x4b34('0x1b')]=function(_0x239a6a){return new BPromise(function(_0x45256b,_0x22cdf1){if(_0x239a6a){return getUser({'name':_0x239a6a})[_0x4b34('0x14')](function(_0x48a3dc){logger[_0x4b34('0x7')](_0x4b34('0x1c'),_0x239a6a,_0x48a3dc?_0x4b34('0x16'):_0x4b34('0x17'));return _0x45256b(_0x48a3dc);})[_0x4b34('0xc')](function(_0xc49f85){logger[_0x4b34('0xa')](_0x4b34('0x1d'),_0xc49f85?util[_0x4b34('0x8')](_0xc49f85,{'showHidden':![],'depth':null}):'');return _0x45256b(null);});}return _0x45256b(null);});};exports[_0x4b34('0x1e')]=function(_0x1a02aa){return new BPromise(function(_0x462e0a,_0x719483){if(_0x1a02aa){return client[_0x4b34('0xd')]('GetVoiceQueue',{'options':{'raw':!![],'attributes':['id',_0x4b34('0xf'),_0x4b34('0x1f'),_0x4b34('0x20'),_0x4b34('0x21')],'where':{'name':_0x1a02aa},'limit':0x1}})[_0x4b34('0x14')](function(_0x155010){logger[_0x4b34('0x9')](_0x4b34('0x22'),_0x1a02aa,_0x155010?util[_0x4b34('0x8')](_0x155010,{'showHidden':![],'depth':null}):'');logger[_0x4b34('0x7')]('[utils][getVoiceQueueByName]\x20name:%s\x20%s',_0x1a02aa,_0x155010?_0x4b34('0x16'):_0x4b34('0x17'));return _0x462e0a(_0x155010['result'][_0x4b34('0x12')]?_0x155010[_0x4b34('0x11')][0x0]:null);})[_0x4b34('0xc')](function(_0x54b562){logger['error'](_0x4b34('0x23'),_0x54b562?util[_0x4b34('0x8')](_0x54b562,{'showHidden':![],'depth':null}):'');return _0x462e0a(null);});}return _0x462e0a(null);});};exports[_0x4b34('0x24')]=function(_0x1a4488,_0x9aea6){return moment(_0x1a4488)['add'](_0x9aea6,'seconds')[_0x4b34('0x25')](_0x4b34('0x26'));};exports['subtractTime']=function(_0x31d57e,_0xd41a80){return moment(_0x31d57e)[_0x4b34('0x27')](_0xd41a80,_0x4b34('0x28'))['format'](_0x4b34('0x26'));};exports[_0x4b34('0x29')]=function(_0x4e50cf,_0x27ec77){return moment(_0x4e50cf)[_0x4b34('0x2a')](moment(_0x27ec77),_0x4b34('0x28'));};exports[_0x4b34('0x2b')]=function(_0x400a91,_0x3a05a6){return parseInt(_0x400a91,0xa)+parseInt(_0x3a05a6,0xa);};exports[_0x4b34('0x2c')]=function(){return moment()[_0x4b34('0x25')](_0x4b34('0x26'));};exports[_0x4b34('0x2d')]=function(_0x41ed39,_0x37c1d8){if(_0x37c1d8){return moment(_0x41ed39)[_0x4b34('0x2d')](_0x37c1d8);}return!![];};exports[_0x4b34('0x2e')]=function(_0x1e8a84,_0x39af72){if(_0x39af72){return moment(_0x1e8a84)[_0x4b34('0x2e')](_0x39af72);}else if(_0x1e8a84){return!![];}return![];}; \ No newline at end of file +var _0x3766=['add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','diffTime','diff','sumTime','now','isAfter','isBefore','jayson/promise','moment','util','client','../../config/logger','xdr','info','inspect','debug','error','request','catch','[utils][request]\x20name:%s','GetUser','internal','name','interface','then','[utils][getUser]\x20where:%s','stringify','length','getUserByInternal','found','notfound','[utils][getUserByInterface]\x20interface:%s\x20%s','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','GetVoiceQueue','type','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','result','addTime'];(function(_0x1915a8,_0x581c9a){var _0x5e3c96=function(_0x4b8be5){while(--_0x4b8be5){_0x1915a8['push'](_0x1915a8['shift']());}};_0x5e3c96(++_0x581c9a);}(_0x3766,0xc0));var _0x6376=function(_0x37e21b,_0x50b31e){_0x37e21b=_0x37e21b-0x0;var _0x411f61=_0x3766[_0x37e21b];return _0x411f61;};'use strict';var BPromise=require('bluebird');var jayson=require(_0x6376('0x0'));var moment=require(_0x6376('0x1'));var util=require(_0x6376('0x2'));var client=jayson[_0x6376('0x3')]['http']({'port':0x2329});var logger=require(_0x6376('0x4'))(_0x6376('0x5'));exports[_0x6376('0x6')]=function(_0x3f0e5b,_0x241ba3){logger[_0x6376('0x6')](_0x3f0e5b,_0x241ba3?util[_0x6376('0x7')](_0x241ba3,{'showHidden':![],'depth':null}):'');};exports[_0x6376('0x8')]=function(_0x2561e7,_0x4b0a0b){logger[_0x6376('0x8')](_0x2561e7,_0x4b0a0b?util[_0x6376('0x7')](_0x4b0a0b,{'showHidden':![],'depth':null}):'');};exports['error']=function(_0x11de79,_0x263881){logger[_0x6376('0x9')](_0x11de79,_0x263881?util['inspect'](_0x263881,{'showHidden':![],'depth':null}):'');};exports[_0x6376('0xa')]=function(_0x16a4e8,_0x89bbbd){return client[_0x6376('0xa')](_0x16a4e8,{'body':_0x89bbbd})['then'](function(_0x5c5e13){logger[_0x6376('0x8')]('[utils][request]\x20name:%s',_0x16a4e8,_0x5c5e13?util[_0x6376('0x7')](_0x5c5e13,{'showHidden':![],'depth':null}):'');})[_0x6376('0xb')](function(_0x1d6f6c){logger[_0x6376('0x9')](_0x6376('0xc'),_0x16a4e8,_0x1d6f6c?util[_0x6376('0x7')](_0x1d6f6c,{'showHidden':![],'depth':null}):'');});};function getUser(_0x13194d){return client[_0x6376('0xa')](_0x6376('0xd'),{'options':{'raw':!![],'attributes':['id',_0x6376('0xe'),_0x6376('0xf'),_0x6376('0x10')],'where':_0x13194d,'limit':0x1}})[_0x6376('0x11')](function(_0x11d69d){logger[_0x6376('0x8')](_0x6376('0x12'),JSON[_0x6376('0x13')](_0x13194d),_0x11d69d?util[_0x6376('0x7')](_0x11d69d,{'showHidden':![],'depth':null}):'');return _0x11d69d['result'][_0x6376('0x14')]?_0x11d69d['result'][0x0]:null;});}exports[_0x6376('0x15')]=function(_0x47d03d){return new BPromise(function(_0x307847,_0x290296){if(_0x47d03d){return getUser({'internal':_0x47d03d})[_0x6376('0x11')](function(_0x4125f7){logger['info']('[utils][getUserByInternal]\x20internal:%s\x20%s',_0x47d03d,_0x4125f7?_0x6376('0x16'):_0x6376('0x17'));return _0x307847(_0x4125f7);})['catch'](function(_0x541ea6){logger[_0x6376('0x9')]('[utils][getUserByInternal]',_0x541ea6?util[_0x6376('0x7')](_0x541ea6,{'showHidden':![],'depth':null}):'');return _0x307847(null);});}return _0x307847(null);});};exports['getUserByInterface']=function(_0x32d6bd){return new BPromise(function(_0x3bec0e,_0x4ba8d4){if(_0x32d6bd){return getUser({'interface':_0x32d6bd})[_0x6376('0x11')](function(_0x48e9c0){logger[_0x6376('0x6')](_0x6376('0x18'),_0x32d6bd,_0x48e9c0?'found':'notfound');return _0x3bec0e(_0x48e9c0);})[_0x6376('0xb')](function(_0x43c884){logger[_0x6376('0x9')]('[utils][getUserByInterface]',_0x43c884?util[_0x6376('0x7')](_0x43c884,{'showHidden':![],'depth':null}):'');return _0x3bec0e(null);});}return _0x3bec0e(null);});};exports[_0x6376('0x19')]=function(_0x43f143){return new BPromise(function(_0x55cf3c,_0x1cc4cd){if(_0x43f143){return getUser({'name':_0x43f143})[_0x6376('0x11')](function(_0x14a5fb){logger[_0x6376('0x6')](_0x6376('0x1a'),_0x43f143,_0x14a5fb?_0x6376('0x16'):_0x6376('0x17'));return _0x55cf3c(_0x14a5fb);})['catch'](function(_0xc0945a){logger[_0x6376('0x9')]('[utils][getUserByName]',_0xc0945a?util['inspect'](_0xc0945a,{'showHidden':![],'depth':null}):'');return _0x55cf3c(null);});}return _0x55cf3c(null);});};exports['getVoiceQueueByName']=function(_0x1b9e77){return new BPromise(function(_0x3a3025,_0x726f2b){if(_0x1b9e77){return client[_0x6376('0xa')](_0x6376('0x1b'),{'options':{'raw':!![],'attributes':['id',_0x6376('0xf'),_0x6376('0x1c'),'acw','acwTimeout'],'where':{'name':_0x1b9e77},'limit':0x1}})[_0x6376('0x11')](function(_0x11811b){logger[_0x6376('0x8')](_0x6376('0x1d'),_0x1b9e77,_0x11811b?util[_0x6376('0x7')](_0x11811b,{'showHidden':![],'depth':null}):'');logger[_0x6376('0x6')](_0x6376('0x1e'),_0x1b9e77,_0x11811b?_0x6376('0x16'):_0x6376('0x17'));return _0x3a3025(_0x11811b[_0x6376('0x1f')][_0x6376('0x14')]?_0x11811b['result'][0x0]:null);})[_0x6376('0xb')](function(_0xc07912){logger['error']('[utils][getVoiceQueueByName]',_0xc07912?util[_0x6376('0x7')](_0xc07912,{'showHidden':![],'depth':null}):'');return _0x3a3025(null);});}return _0x3a3025(null);});};exports[_0x6376('0x20')]=function(_0x18e2de,_0x420e9a){return moment(_0x18e2de)[_0x6376('0x21')](_0x420e9a,_0x6376('0x22'))[_0x6376('0x23')](_0x6376('0x24'));};exports[_0x6376('0x25')]=function(_0x18ebc7,_0x8dd866){return moment(_0x18ebc7)[_0x6376('0x26')](_0x8dd866,_0x6376('0x22'))['format'](_0x6376('0x24'));};exports[_0x6376('0x27')]=function(_0x184970,_0x106ca8){return moment(_0x184970)[_0x6376('0x28')](moment(_0x106ca8),'seconds');};exports[_0x6376('0x29')]=function(_0x27ea25,_0x38c541){return parseInt(_0x27ea25,0xa)+parseInt(_0x38c541,0xa);};exports[_0x6376('0x2a')]=function(){return moment()[_0x6376('0x23')](_0x6376('0x24'));};exports[_0x6376('0x2b')]=function(_0x5b3895,_0x96cbfa){if(_0x96cbfa){return moment(_0x5b3895)['isAfter'](_0x96cbfa);}return!![];};exports[_0x6376('0x2c')]=function(_0x3d366d,_0x435df5){if(_0x435df5){return moment(_0x3d366d)[_0x6376('0x2c')](_0x435df5);}else if(_0x3d366d){return!![];}return![];}; \ No newline at end of file -- 1.7.1